diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 3d2ac0bdd2e..5aa8e09b7e6 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.1.0"
+ ".": "2.0.0-beta.1"
}
\ No newline at end of file
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 793848b98ee..01f578ddc7a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,15 @@
# Changelog
+## 2.0.0-beta.1 (2024-03-08)
+
+Full Changelog: [v0.1.0...v2.0.0-beta.1](https://github.com/cloudflare/cloudflare-go/compare/v0.1.0...v2.0.0-beta.1)
+
+### Features
+
+* OpenAPI spec update via Stainless API ([#1523](https://github.com/cloudflare/cloudflare-go/issues/1523)) ([9755602](https://github.com/cloudflare/cloudflare-go/commit/9755602b83ed9dd548303600021539a951795043))
+* OpenAPI spec update via Stainless API ([#1524](https://github.com/cloudflare/cloudflare-go/issues/1524)) ([c9e201a](https://github.com/cloudflare/cloudflare-go/commit/c9e201aa36b25699cfb966a79de8b9b552dd73e8))
+* update via SDK Studio ([#1520](https://github.com/cloudflare/cloudflare-go/issues/1520)) ([cdaf537](https://github.com/cloudflare/cloudflare-go/commit/cdaf5374ea14b7e9df99a8a38783381ebfae8b63))
+
## 0.1.0 (2024-03-08)
Full Changelog: [v0.0.1...v0.1.0](https://github.com/cloudflare/cloudflare-go/compare/v0.0.1...v0.1.0)
diff --git a/README.md b/README.md
index f809fba9739..fb8b9e4d764 100644
--- a/README.md
+++ b/README.md
@@ -22,7 +22,7 @@ Or to pin the version:
```sh
-go get -u 'github.com/cloudflare/cloudflare-go@v0.1.0'
+go get -u 'github.com/cloudflare/cloudflare-go@v2.0.0-beta.1'
```
@@ -44,6 +44,7 @@ import (
"github.com/cloudflare/cloudflare-go"
"github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/zones"
)
func main() {
@@ -51,12 +52,12 @@ func main() {
option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), // defaults to os.LookupEnv("CLOUDFLARE_API_KEY")
option.WithAPIEmail("user@example.com"), // defaults to os.LookupEnv("CLOUDFLARE_EMAIL")
)
- zoneNewResponse, err := client.Zones.New(context.TODO(), cloudflare.ZoneNewParams{
- Account: cloudflare.F(cloudflare.ZoneNewParamsAccount{
+ zoneNewResponse, err := client.Zones.New(context.TODO(), zones.ZoneNewParams{
+ Account: cloudflare.F(zones.ZoneNewParamsAccount{
ID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
}),
Name: cloudflare.F("example.com"),
- Type: cloudflare.F(cloudflare.ZoneNewParamsTypeFull),
+ Type: cloudflare.F(zones.ZoneNewParamsTypeFull),
})
if err != nil {
panic(err.Error())
@@ -187,7 +188,7 @@ When the API returns a non-success status code, we return an error with type
To handle errors, we recommend that you use the `errors.As` pattern:
```go
-_, err := client.Zones.Get(context.TODO(), cloudflare.ZoneGetParams{
+_, err := client.Zones.Get(context.TODO(), zones.ZoneGetParams{
ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
})
if err != nil {
@@ -216,7 +217,7 @@ ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)
defer cancel()
client.Zones.Edit(
ctx,
- cloudflare.ZoneEditParams{
+ zones.ZoneEditParams{
ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
},
// This sets the per-retry timeout
@@ -241,7 +242,7 @@ client := cloudflare.NewClient(
// Override per-request:
client.Zones.Get(
context.TODO(),
- cloudflare.ZoneGetParams{
+ zones.ZoneGetParams{
ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
},
option.WithMaxRetries(5),
diff --git a/accountmember.go b/accountmember.go
deleted file mode 100644
index 9db332b3d95..00000000000
--- a/accountmember.go
+++ /dev/null
@@ -1,1581 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// AccountMemberService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewAccountMemberService] method
-// instead.
-type AccountMemberService struct {
- Options []option.RequestOption
-}
-
-// NewAccountMemberService generates a new service that applies the given options
-// to each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewAccountMemberService(opts ...option.RequestOption) (r *AccountMemberService) {
- r = &AccountMemberService{}
- r.Options = opts
- return
-}
-
-// Add a user to the list of members for this account.
-func (r *AccountMemberService) New(ctx context.Context, params AccountMemberNewParams, opts ...option.RequestOption) (res *AccountMemberWithID, err error) {
- opts = append(r.Options[:], opts...)
- var env AccountMemberNewResponseEnvelope
- path := fmt.Sprintf("accounts/%v/members", params.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Modify an account member.
-func (r *AccountMemberService) Update(ctx context.Context, memberID string, params AccountMemberUpdateParams, opts ...option.RequestOption) (res *AccountMember, err error) {
- opts = append(r.Options[:], opts...)
- var env AccountMemberUpdateResponseEnvelope
- path := fmt.Sprintf("accounts/%v/members/%s", params.AccountID, memberID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// List all members of an account.
-func (r *AccountMemberService) List(ctx context.Context, params AccountMemberListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[AccountMemberListResponse], err error) {
- var raw *http.Response
- opts = append(r.Options, opts...)
- opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
- path := fmt.Sprintf("accounts/%v/members", params.AccountID)
- cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, params, &res, opts...)
- if err != nil {
- return nil, err
- }
- err = cfg.Execute()
- if err != nil {
- return nil, err
- }
- res.SetPageConfig(cfg, raw)
- return res, nil
-}
-
-// List all members of an account.
-func (r *AccountMemberService) ListAutoPaging(ctx context.Context, params AccountMemberListParams, opts ...option.RequestOption) *shared.V4PagePaginationArrayAutoPager[AccountMemberListResponse] {
- return shared.NewV4PagePaginationArrayAutoPager(r.List(ctx, params, opts...))
-}
-
-// Remove a member from an account.
-func (r *AccountMemberService) Delete(ctx context.Context, memberID string, body AccountMemberDeleteParams, opts ...option.RequestOption) (res *AccountMemberDeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env AccountMemberDeleteResponseEnvelope
- path := fmt.Sprintf("accounts/%v/members/%s", body.AccountID, memberID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Get information about a specific member of an account.
-func (r *AccountMemberService) Get(ctx context.Context, memberID string, query AccountMemberGetParams, opts ...option.RequestOption) (res *AccountMember, err error) {
- opts = append(r.Options[:], opts...)
- var env AccountMemberGetResponseEnvelope
- path := fmt.Sprintf("accounts/%v/members/%s", query.AccountID, memberID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type AccountMember struct {
- // Membership identifier tag.
- ID string `json:"id,required"`
- // Roles assigned to this member.
- Roles []AccountMemberRole `json:"roles,required"`
- Status interface{} `json:"status,required"`
- User AccountMemberUser `json:"user,required"`
- JSON accountMemberJSON `json:"-"`
-}
-
-// accountMemberJSON contains the JSON metadata for the struct [AccountMember]
-type accountMemberJSON struct {
- ID apijson.Field
- Roles apijson.Field
- Status apijson.Field
- User apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AccountMember) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r accountMemberJSON) RawJSON() string {
- return r.raw
-}
-
-type AccountMemberRole struct {
- // Role identifier tag.
- ID string `json:"id,required"`
- // Description of role's permissions.
- Description string `json:"description,required"`
- // Role name.
- Name string `json:"name,required"`
- Permissions AccountMemberRolesPermissions `json:"permissions,required"`
- JSON accountMemberRoleJSON `json:"-"`
-}
-
-// accountMemberRoleJSON contains the JSON metadata for the struct
-// [AccountMemberRole]
-type accountMemberRoleJSON struct {
- ID apijson.Field
- Description apijson.Field
- Name apijson.Field
- Permissions apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AccountMemberRole) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r accountMemberRoleJSON) RawJSON() string {
- return r.raw
-}
-
-type AccountMemberRolesPermissions struct {
- Analytics AccountMemberRolesPermissionsAnalytics `json:"analytics"`
- Billing AccountMemberRolesPermissionsBilling `json:"billing"`
- CachePurge AccountMemberRolesPermissionsCachePurge `json:"cache_purge"`
- DNS AccountMemberRolesPermissionsDNS `json:"dns"`
- DNSRecords AccountMemberRolesPermissionsDNSRecords `json:"dns_records"`
- Lb AccountMemberRolesPermissionsLb `json:"lb"`
- Logs AccountMemberRolesPermissionsLogs `json:"logs"`
- Organization AccountMemberRolesPermissionsOrganization `json:"organization"`
- SSL AccountMemberRolesPermissionsSSL `json:"ssl"`
- WAF AccountMemberRolesPermissionsWAF `json:"waf"`
- ZoneSettings AccountMemberRolesPermissionsZoneSettings `json:"zone_settings"`
- Zones AccountMemberRolesPermissionsZones `json:"zones"`
- JSON accountMemberRolesPermissionsJSON `json:"-"`
-}
-
-// accountMemberRolesPermissionsJSON contains the JSON metadata for the struct
-// [AccountMemberRolesPermissions]
-type accountMemberRolesPermissionsJSON struct {
- Analytics apijson.Field
- Billing apijson.Field
- CachePurge apijson.Field
- DNS apijson.Field
- DNSRecords apijson.Field
- Lb apijson.Field
- Logs apijson.Field
- Organization apijson.Field
- SSL apijson.Field
- WAF apijson.Field
- ZoneSettings apijson.Field
- Zones apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AccountMemberRolesPermissions) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r accountMemberRolesPermissionsJSON) RawJSON() string {
- return r.raw
-}
-
-type AccountMemberRolesPermissionsAnalytics struct {
- Read bool `json:"read"`
- Write bool `json:"write"`
- JSON accountMemberRolesPermissionsAnalyticsJSON `json:"-"`
-}
-
-// accountMemberRolesPermissionsAnalyticsJSON contains the JSON metadata for the
-// struct [AccountMemberRolesPermissionsAnalytics]
-type accountMemberRolesPermissionsAnalyticsJSON struct {
- Read apijson.Field
- Write apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AccountMemberRolesPermissionsAnalytics) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r accountMemberRolesPermissionsAnalyticsJSON) RawJSON() string {
- return r.raw
-}
-
-type AccountMemberRolesPermissionsBilling struct {
- Read bool `json:"read"`
- Write bool `json:"write"`
- JSON accountMemberRolesPermissionsBillingJSON `json:"-"`
-}
-
-// accountMemberRolesPermissionsBillingJSON contains the JSON metadata for the
-// struct [AccountMemberRolesPermissionsBilling]
-type accountMemberRolesPermissionsBillingJSON struct {
- Read apijson.Field
- Write apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AccountMemberRolesPermissionsBilling) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r accountMemberRolesPermissionsBillingJSON) RawJSON() string {
- return r.raw
-}
-
-type AccountMemberRolesPermissionsCachePurge struct {
- Read bool `json:"read"`
- Write bool `json:"write"`
- JSON accountMemberRolesPermissionsCachePurgeJSON `json:"-"`
-}
-
-// accountMemberRolesPermissionsCachePurgeJSON contains the JSON metadata for the
-// struct [AccountMemberRolesPermissionsCachePurge]
-type accountMemberRolesPermissionsCachePurgeJSON struct {
- Read apijson.Field
- Write apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AccountMemberRolesPermissionsCachePurge) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r accountMemberRolesPermissionsCachePurgeJSON) RawJSON() string {
- return r.raw
-}
-
-type AccountMemberRolesPermissionsDNS struct {
- Read bool `json:"read"`
- Write bool `json:"write"`
- JSON accountMemberRolesPermissionsDNSJSON `json:"-"`
-}
-
-// accountMemberRolesPermissionsDNSJSON contains the JSON metadata for the struct
-// [AccountMemberRolesPermissionsDNS]
-type accountMemberRolesPermissionsDNSJSON struct {
- Read apijson.Field
- Write apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AccountMemberRolesPermissionsDNS) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r accountMemberRolesPermissionsDNSJSON) RawJSON() string {
- return r.raw
-}
-
-type AccountMemberRolesPermissionsDNSRecords struct {
- Read bool `json:"read"`
- Write bool `json:"write"`
- JSON accountMemberRolesPermissionsDNSRecordsJSON `json:"-"`
-}
-
-// accountMemberRolesPermissionsDNSRecordsJSON contains the JSON metadata for the
-// struct [AccountMemberRolesPermissionsDNSRecords]
-type accountMemberRolesPermissionsDNSRecordsJSON struct {
- Read apijson.Field
- Write apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AccountMemberRolesPermissionsDNSRecords) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r accountMemberRolesPermissionsDNSRecordsJSON) RawJSON() string {
- return r.raw
-}
-
-type AccountMemberRolesPermissionsLb struct {
- Read bool `json:"read"`
- Write bool `json:"write"`
- JSON accountMemberRolesPermissionsLbJSON `json:"-"`
-}
-
-// accountMemberRolesPermissionsLbJSON contains the JSON metadata for the struct
-// [AccountMemberRolesPermissionsLb]
-type accountMemberRolesPermissionsLbJSON struct {
- Read apijson.Field
- Write apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AccountMemberRolesPermissionsLb) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r accountMemberRolesPermissionsLbJSON) RawJSON() string {
- return r.raw
-}
-
-type AccountMemberRolesPermissionsLogs struct {
- Read bool `json:"read"`
- Write bool `json:"write"`
- JSON accountMemberRolesPermissionsLogsJSON `json:"-"`
-}
-
-// accountMemberRolesPermissionsLogsJSON contains the JSON metadata for the struct
-// [AccountMemberRolesPermissionsLogs]
-type accountMemberRolesPermissionsLogsJSON struct {
- Read apijson.Field
- Write apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AccountMemberRolesPermissionsLogs) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r accountMemberRolesPermissionsLogsJSON) RawJSON() string {
- return r.raw
-}
-
-type AccountMemberRolesPermissionsOrganization struct {
- Read bool `json:"read"`
- Write bool `json:"write"`
- JSON accountMemberRolesPermissionsOrganizationJSON `json:"-"`
-}
-
-// accountMemberRolesPermissionsOrganizationJSON contains the JSON metadata for the
-// struct [AccountMemberRolesPermissionsOrganization]
-type accountMemberRolesPermissionsOrganizationJSON struct {
- Read apijson.Field
- Write apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AccountMemberRolesPermissionsOrganization) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r accountMemberRolesPermissionsOrganizationJSON) RawJSON() string {
- return r.raw
-}
-
-type AccountMemberRolesPermissionsSSL struct {
- Read bool `json:"read"`
- Write bool `json:"write"`
- JSON accountMemberRolesPermissionsSSLJSON `json:"-"`
-}
-
-// accountMemberRolesPermissionsSSLJSON contains the JSON metadata for the struct
-// [AccountMemberRolesPermissionsSSL]
-type accountMemberRolesPermissionsSSLJSON struct {
- Read apijson.Field
- Write apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AccountMemberRolesPermissionsSSL) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r accountMemberRolesPermissionsSSLJSON) RawJSON() string {
- return r.raw
-}
-
-type AccountMemberRolesPermissionsWAF struct {
- Read bool `json:"read"`
- Write bool `json:"write"`
- JSON accountMemberRolesPermissionsWAFJSON `json:"-"`
-}
-
-// accountMemberRolesPermissionsWAFJSON contains the JSON metadata for the struct
-// [AccountMemberRolesPermissionsWAF]
-type accountMemberRolesPermissionsWAFJSON struct {
- Read apijson.Field
- Write apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AccountMemberRolesPermissionsWAF) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r accountMemberRolesPermissionsWAFJSON) RawJSON() string {
- return r.raw
-}
-
-type AccountMemberRolesPermissionsZoneSettings struct {
- Read bool `json:"read"`
- Write bool `json:"write"`
- JSON accountMemberRolesPermissionsZoneSettingsJSON `json:"-"`
-}
-
-// accountMemberRolesPermissionsZoneSettingsJSON contains the JSON metadata for the
-// struct [AccountMemberRolesPermissionsZoneSettings]
-type accountMemberRolesPermissionsZoneSettingsJSON struct {
- Read apijson.Field
- Write apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AccountMemberRolesPermissionsZoneSettings) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r accountMemberRolesPermissionsZoneSettingsJSON) RawJSON() string {
- return r.raw
-}
-
-type AccountMemberRolesPermissionsZones struct {
- Read bool `json:"read"`
- Write bool `json:"write"`
- JSON accountMemberRolesPermissionsZonesJSON `json:"-"`
-}
-
-// accountMemberRolesPermissionsZonesJSON contains the JSON metadata for the struct
-// [AccountMemberRolesPermissionsZones]
-type accountMemberRolesPermissionsZonesJSON struct {
- Read apijson.Field
- Write apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AccountMemberRolesPermissionsZones) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r accountMemberRolesPermissionsZonesJSON) RawJSON() string {
- return r.raw
-}
-
-type AccountMemberUser struct {
- // The contact email address of the user.
- Email string `json:"email,required"`
- // Identifier
- ID string `json:"id"`
- // User's first name
- FirstName string `json:"first_name,nullable"`
- // User's last name
- LastName string `json:"last_name,nullable"`
- // Indicates whether two-factor authentication is enabled for the user account.
- // Does not apply to API authentication.
- TwoFactorAuthenticationEnabled bool `json:"two_factor_authentication_enabled"`
- JSON accountMemberUserJSON `json:"-"`
-}
-
-// accountMemberUserJSON contains the JSON metadata for the struct
-// [AccountMemberUser]
-type accountMemberUserJSON struct {
- Email apijson.Field
- ID apijson.Field
- FirstName apijson.Field
- LastName apijson.Field
- TwoFactorAuthenticationEnabled apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AccountMemberUser) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r accountMemberUserJSON) RawJSON() string {
- return r.raw
-}
-
-type AccountMemberWithID struct {
- // Membership identifier tag.
- ID string `json:"id,required"`
- // Roles assigned to this member.
- Roles []AccountMemberWithIDRole `json:"roles,required"`
- Status interface{} `json:"status,required"`
- User AccountMemberWithIDUser `json:"user,required"`
- // The unique activation code for the account membership.
- Code string `json:"code"`
- JSON accountMemberWithIDJSON `json:"-"`
-}
-
-// accountMemberWithIDJSON contains the JSON metadata for the struct
-// [AccountMemberWithID]
-type accountMemberWithIDJSON struct {
- ID apijson.Field
- Roles apijson.Field
- Status apijson.Field
- User apijson.Field
- Code apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AccountMemberWithID) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r accountMemberWithIDJSON) RawJSON() string {
- return r.raw
-}
-
-type AccountMemberWithIDRole struct {
- // Role identifier tag.
- ID string `json:"id,required"`
- // Description of role's permissions.
- Description string `json:"description,required"`
- // Role name.
- Name string `json:"name,required"`
- Permissions AccountMemberWithIDRolesPermissions `json:"permissions,required"`
- JSON accountMemberWithIDRoleJSON `json:"-"`
-}
-
-// accountMemberWithIDRoleJSON contains the JSON metadata for the struct
-// [AccountMemberWithIDRole]
-type accountMemberWithIDRoleJSON struct {
- ID apijson.Field
- Description apijson.Field
- Name apijson.Field
- Permissions apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AccountMemberWithIDRole) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r accountMemberWithIDRoleJSON) RawJSON() string {
- return r.raw
-}
-
-type AccountMemberWithIDRolesPermissions struct {
- Analytics AccountMemberWithIDRolesPermissionsAnalytics `json:"analytics"`
- Billing AccountMemberWithIDRolesPermissionsBilling `json:"billing"`
- CachePurge AccountMemberWithIDRolesPermissionsCachePurge `json:"cache_purge"`
- DNS AccountMemberWithIDRolesPermissionsDNS `json:"dns"`
- DNSRecords AccountMemberWithIDRolesPermissionsDNSRecords `json:"dns_records"`
- Lb AccountMemberWithIDRolesPermissionsLb `json:"lb"`
- Logs AccountMemberWithIDRolesPermissionsLogs `json:"logs"`
- Organization AccountMemberWithIDRolesPermissionsOrganization `json:"organization"`
- SSL AccountMemberWithIDRolesPermissionsSSL `json:"ssl"`
- WAF AccountMemberWithIDRolesPermissionsWAF `json:"waf"`
- ZoneSettings AccountMemberWithIDRolesPermissionsZoneSettings `json:"zone_settings"`
- Zones AccountMemberWithIDRolesPermissionsZones `json:"zones"`
- JSON accountMemberWithIDRolesPermissionsJSON `json:"-"`
-}
-
-// accountMemberWithIDRolesPermissionsJSON contains the JSON metadata for the
-// struct [AccountMemberWithIDRolesPermissions]
-type accountMemberWithIDRolesPermissionsJSON struct {
- Analytics apijson.Field
- Billing apijson.Field
- CachePurge apijson.Field
- DNS apijson.Field
- DNSRecords apijson.Field
- Lb apijson.Field
- Logs apijson.Field
- Organization apijson.Field
- SSL apijson.Field
- WAF apijson.Field
- ZoneSettings apijson.Field
- Zones apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AccountMemberWithIDRolesPermissions) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r accountMemberWithIDRolesPermissionsJSON) RawJSON() string {
- return r.raw
-}
-
-type AccountMemberWithIDRolesPermissionsAnalytics struct {
- Read bool `json:"read"`
- Write bool `json:"write"`
- JSON accountMemberWithIDRolesPermissionsAnalyticsJSON `json:"-"`
-}
-
-// accountMemberWithIDRolesPermissionsAnalyticsJSON contains the JSON metadata for
-// the struct [AccountMemberWithIDRolesPermissionsAnalytics]
-type accountMemberWithIDRolesPermissionsAnalyticsJSON struct {
- Read apijson.Field
- Write apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AccountMemberWithIDRolesPermissionsAnalytics) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r accountMemberWithIDRolesPermissionsAnalyticsJSON) RawJSON() string {
- return r.raw
-}
-
-type AccountMemberWithIDRolesPermissionsBilling struct {
- Read bool `json:"read"`
- Write bool `json:"write"`
- JSON accountMemberWithIDRolesPermissionsBillingJSON `json:"-"`
-}
-
-// accountMemberWithIDRolesPermissionsBillingJSON contains the JSON metadata for
-// the struct [AccountMemberWithIDRolesPermissionsBilling]
-type accountMemberWithIDRolesPermissionsBillingJSON struct {
- Read apijson.Field
- Write apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AccountMemberWithIDRolesPermissionsBilling) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r accountMemberWithIDRolesPermissionsBillingJSON) RawJSON() string {
- return r.raw
-}
-
-type AccountMemberWithIDRolesPermissionsCachePurge struct {
- Read bool `json:"read"`
- Write bool `json:"write"`
- JSON accountMemberWithIDRolesPermissionsCachePurgeJSON `json:"-"`
-}
-
-// accountMemberWithIDRolesPermissionsCachePurgeJSON contains the JSON metadata for
-// the struct [AccountMemberWithIDRolesPermissionsCachePurge]
-type accountMemberWithIDRolesPermissionsCachePurgeJSON struct {
- Read apijson.Field
- Write apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AccountMemberWithIDRolesPermissionsCachePurge) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r accountMemberWithIDRolesPermissionsCachePurgeJSON) RawJSON() string {
- return r.raw
-}
-
-type AccountMemberWithIDRolesPermissionsDNS struct {
- Read bool `json:"read"`
- Write bool `json:"write"`
- JSON accountMemberWithIDRolesPermissionsDNSJSON `json:"-"`
-}
-
-// accountMemberWithIDRolesPermissionsDNSJSON contains the JSON metadata for the
-// struct [AccountMemberWithIDRolesPermissionsDNS]
-type accountMemberWithIDRolesPermissionsDNSJSON struct {
- Read apijson.Field
- Write apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AccountMemberWithIDRolesPermissionsDNS) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r accountMemberWithIDRolesPermissionsDNSJSON) RawJSON() string {
- return r.raw
-}
-
-type AccountMemberWithIDRolesPermissionsDNSRecords struct {
- Read bool `json:"read"`
- Write bool `json:"write"`
- JSON accountMemberWithIDRolesPermissionsDNSRecordsJSON `json:"-"`
-}
-
-// accountMemberWithIDRolesPermissionsDNSRecordsJSON contains the JSON metadata for
-// the struct [AccountMemberWithIDRolesPermissionsDNSRecords]
-type accountMemberWithIDRolesPermissionsDNSRecordsJSON struct {
- Read apijson.Field
- Write apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AccountMemberWithIDRolesPermissionsDNSRecords) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r accountMemberWithIDRolesPermissionsDNSRecordsJSON) RawJSON() string {
- return r.raw
-}
-
-type AccountMemberWithIDRolesPermissionsLb struct {
- Read bool `json:"read"`
- Write bool `json:"write"`
- JSON accountMemberWithIDRolesPermissionsLbJSON `json:"-"`
-}
-
-// accountMemberWithIDRolesPermissionsLbJSON contains the JSON metadata for the
-// struct [AccountMemberWithIDRolesPermissionsLb]
-type accountMemberWithIDRolesPermissionsLbJSON struct {
- Read apijson.Field
- Write apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AccountMemberWithIDRolesPermissionsLb) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r accountMemberWithIDRolesPermissionsLbJSON) RawJSON() string {
- return r.raw
-}
-
-type AccountMemberWithIDRolesPermissionsLogs struct {
- Read bool `json:"read"`
- Write bool `json:"write"`
- JSON accountMemberWithIDRolesPermissionsLogsJSON `json:"-"`
-}
-
-// accountMemberWithIDRolesPermissionsLogsJSON contains the JSON metadata for the
-// struct [AccountMemberWithIDRolesPermissionsLogs]
-type accountMemberWithIDRolesPermissionsLogsJSON struct {
- Read apijson.Field
- Write apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AccountMemberWithIDRolesPermissionsLogs) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r accountMemberWithIDRolesPermissionsLogsJSON) RawJSON() string {
- return r.raw
-}
-
-type AccountMemberWithIDRolesPermissionsOrganization struct {
- Read bool `json:"read"`
- Write bool `json:"write"`
- JSON accountMemberWithIDRolesPermissionsOrganizationJSON `json:"-"`
-}
-
-// accountMemberWithIDRolesPermissionsOrganizationJSON contains the JSON metadata
-// for the struct [AccountMemberWithIDRolesPermissionsOrganization]
-type accountMemberWithIDRolesPermissionsOrganizationJSON struct {
- Read apijson.Field
- Write apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AccountMemberWithIDRolesPermissionsOrganization) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r accountMemberWithIDRolesPermissionsOrganizationJSON) RawJSON() string {
- return r.raw
-}
-
-type AccountMemberWithIDRolesPermissionsSSL struct {
- Read bool `json:"read"`
- Write bool `json:"write"`
- JSON accountMemberWithIDRolesPermissionsSSLJSON `json:"-"`
-}
-
-// accountMemberWithIDRolesPermissionsSSLJSON contains the JSON metadata for the
-// struct [AccountMemberWithIDRolesPermissionsSSL]
-type accountMemberWithIDRolesPermissionsSSLJSON struct {
- Read apijson.Field
- Write apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AccountMemberWithIDRolesPermissionsSSL) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r accountMemberWithIDRolesPermissionsSSLJSON) RawJSON() string {
- return r.raw
-}
-
-type AccountMemberWithIDRolesPermissionsWAF struct {
- Read bool `json:"read"`
- Write bool `json:"write"`
- JSON accountMemberWithIDRolesPermissionsWAFJSON `json:"-"`
-}
-
-// accountMemberWithIDRolesPermissionsWAFJSON contains the JSON metadata for the
-// struct [AccountMemberWithIDRolesPermissionsWAF]
-type accountMemberWithIDRolesPermissionsWAFJSON struct {
- Read apijson.Field
- Write apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AccountMemberWithIDRolesPermissionsWAF) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r accountMemberWithIDRolesPermissionsWAFJSON) RawJSON() string {
- return r.raw
-}
-
-type AccountMemberWithIDRolesPermissionsZoneSettings struct {
- Read bool `json:"read"`
- Write bool `json:"write"`
- JSON accountMemberWithIDRolesPermissionsZoneSettingsJSON `json:"-"`
-}
-
-// accountMemberWithIDRolesPermissionsZoneSettingsJSON contains the JSON metadata
-// for the struct [AccountMemberWithIDRolesPermissionsZoneSettings]
-type accountMemberWithIDRolesPermissionsZoneSettingsJSON struct {
- Read apijson.Field
- Write apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AccountMemberWithIDRolesPermissionsZoneSettings) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r accountMemberWithIDRolesPermissionsZoneSettingsJSON) RawJSON() string {
- return r.raw
-}
-
-type AccountMemberWithIDRolesPermissionsZones struct {
- Read bool `json:"read"`
- Write bool `json:"write"`
- JSON accountMemberWithIDRolesPermissionsZonesJSON `json:"-"`
-}
-
-// accountMemberWithIDRolesPermissionsZonesJSON contains the JSON metadata for the
-// struct [AccountMemberWithIDRolesPermissionsZones]
-type accountMemberWithIDRolesPermissionsZonesJSON struct {
- Read apijson.Field
- Write apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AccountMemberWithIDRolesPermissionsZones) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r accountMemberWithIDRolesPermissionsZonesJSON) RawJSON() string {
- return r.raw
-}
-
-type AccountMemberWithIDUser struct {
- // The contact email address of the user.
- Email string `json:"email,required"`
- // Identifier
- ID string `json:"id"`
- // User's first name
- FirstName string `json:"first_name,nullable"`
- // User's last name
- LastName string `json:"last_name,nullable"`
- // Indicates whether two-factor authentication is enabled for the user account.
- // Does not apply to API authentication.
- TwoFactorAuthenticationEnabled bool `json:"two_factor_authentication_enabled"`
- JSON accountMemberWithIDUserJSON `json:"-"`
-}
-
-// accountMemberWithIDUserJSON contains the JSON metadata for the struct
-// [AccountMemberWithIDUser]
-type accountMemberWithIDUserJSON struct {
- Email apijson.Field
- ID apijson.Field
- FirstName apijson.Field
- LastName apijson.Field
- TwoFactorAuthenticationEnabled apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AccountMemberWithIDUser) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r accountMemberWithIDUserJSON) RawJSON() string {
- return r.raw
-}
-
-type AccountMemberListResponse struct {
- // Identifier
- ID string `json:"id,required"`
- // The contact email address of the user.
- Email string `json:"email,required"`
- // Member Name.
- Name string `json:"name,required,nullable"`
- // Roles assigned to this Member.
- Roles []AccountMemberListResponseRole `json:"roles,required"`
- // A member's status in the organization.
- Status AccountMemberListResponseStatus `json:"status,required"`
- JSON accountMemberListResponseJSON `json:"-"`
-}
-
-// accountMemberListResponseJSON contains the JSON metadata for the struct
-// [AccountMemberListResponse]
-type accountMemberListResponseJSON struct {
- ID apijson.Field
- Email apijson.Field
- Name apijson.Field
- Roles apijson.Field
- Status apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AccountMemberListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r accountMemberListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type AccountMemberListResponseRole struct {
- // Role identifier tag.
- ID string `json:"id,required"`
- // Description of role's permissions.
- Description string `json:"description,required"`
- // Role Name.
- Name string `json:"name,required"`
- // Access permissions for this User.
- Permissions []string `json:"permissions,required"`
- JSON accountMemberListResponseRoleJSON `json:"-"`
-}
-
-// accountMemberListResponseRoleJSON contains the JSON metadata for the struct
-// [AccountMemberListResponseRole]
-type accountMemberListResponseRoleJSON struct {
- ID apijson.Field
- Description apijson.Field
- Name apijson.Field
- Permissions apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AccountMemberListResponseRole) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r accountMemberListResponseRoleJSON) RawJSON() string {
- return r.raw
-}
-
-// A member's status in the organization.
-type AccountMemberListResponseStatus string
-
-const (
- AccountMemberListResponseStatusAccepted AccountMemberListResponseStatus = "accepted"
- AccountMemberListResponseStatusInvited AccountMemberListResponseStatus = "invited"
-)
-
-type AccountMemberDeleteResponse struct {
- // Identifier
- ID string `json:"id,required"`
- JSON accountMemberDeleteResponseJSON `json:"-"`
-}
-
-// accountMemberDeleteResponseJSON contains the JSON metadata for the struct
-// [AccountMemberDeleteResponse]
-type accountMemberDeleteResponseJSON struct {
- ID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AccountMemberDeleteResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r accountMemberDeleteResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type AccountMemberNewParams struct {
- AccountID param.Field[interface{}] `path:"account_id,required"`
- // The contact email address of the user.
- Email param.Field[string] `json:"email,required"`
- // Array of roles associated with this member.
- Roles param.Field[[]string] `json:"roles,required"`
- Status param.Field[AccountMemberNewParamsStatus] `json:"status"`
-}
-
-func (r AccountMemberNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type AccountMemberNewParamsStatus string
-
-const (
- AccountMemberNewParamsStatusAccepted AccountMemberNewParamsStatus = "accepted"
- AccountMemberNewParamsStatusPending AccountMemberNewParamsStatus = "pending"
-)
-
-type AccountMemberNewResponseEnvelope struct {
- Errors []AccountMemberNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []AccountMemberNewResponseEnvelopeMessages `json:"messages,required"`
- Result AccountMemberWithID `json:"result,required"`
- // Whether the API call was successful
- Success AccountMemberNewResponseEnvelopeSuccess `json:"success,required"`
- JSON accountMemberNewResponseEnvelopeJSON `json:"-"`
-}
-
-// accountMemberNewResponseEnvelopeJSON contains the JSON metadata for the struct
-// [AccountMemberNewResponseEnvelope]
-type accountMemberNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AccountMemberNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r accountMemberNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type AccountMemberNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON accountMemberNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// accountMemberNewResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [AccountMemberNewResponseEnvelopeErrors]
-type accountMemberNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AccountMemberNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r accountMemberNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type AccountMemberNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON accountMemberNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// accountMemberNewResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [AccountMemberNewResponseEnvelopeMessages]
-type accountMemberNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AccountMemberNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r accountMemberNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type AccountMemberNewResponseEnvelopeSuccess bool
-
-const (
- AccountMemberNewResponseEnvelopeSuccessTrue AccountMemberNewResponseEnvelopeSuccess = true
-)
-
-type AccountMemberUpdateParams struct {
- AccountID param.Field[interface{}] `path:"account_id,required"`
- // Roles assigned to this member.
- Roles param.Field[[]AccountMemberUpdateParamsRole] `json:"roles,required"`
-}
-
-func (r AccountMemberUpdateParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type AccountMemberUpdateParamsRole struct {
- // Role identifier tag.
- ID param.Field[string] `json:"id,required"`
-}
-
-func (r AccountMemberUpdateParamsRole) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type AccountMemberUpdateParamsRolesPermissions struct {
- Analytics param.Field[AccountMemberUpdateParamsRolesPermissionsAnalytics] `json:"analytics"`
- Billing param.Field[AccountMemberUpdateParamsRolesPermissionsBilling] `json:"billing"`
- CachePurge param.Field[AccountMemberUpdateParamsRolesPermissionsCachePurge] `json:"cache_purge"`
- DNS param.Field[AccountMemberUpdateParamsRolesPermissionsDNS] `json:"dns"`
- DNSRecords param.Field[AccountMemberUpdateParamsRolesPermissionsDNSRecords] `json:"dns_records"`
- Lb param.Field[AccountMemberUpdateParamsRolesPermissionsLb] `json:"lb"`
- Logs param.Field[AccountMemberUpdateParamsRolesPermissionsLogs] `json:"logs"`
- Organization param.Field[AccountMemberUpdateParamsRolesPermissionsOrganization] `json:"organization"`
- SSL param.Field[AccountMemberUpdateParamsRolesPermissionsSSL] `json:"ssl"`
- WAF param.Field[AccountMemberUpdateParamsRolesPermissionsWAF] `json:"waf"`
- ZoneSettings param.Field[AccountMemberUpdateParamsRolesPermissionsZoneSettings] `json:"zone_settings"`
- Zones param.Field[AccountMemberUpdateParamsRolesPermissionsZones] `json:"zones"`
-}
-
-func (r AccountMemberUpdateParamsRolesPermissions) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type AccountMemberUpdateParamsRolesPermissionsAnalytics struct {
- Read param.Field[bool] `json:"read"`
- Write param.Field[bool] `json:"write"`
-}
-
-func (r AccountMemberUpdateParamsRolesPermissionsAnalytics) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type AccountMemberUpdateParamsRolesPermissionsBilling struct {
- Read param.Field[bool] `json:"read"`
- Write param.Field[bool] `json:"write"`
-}
-
-func (r AccountMemberUpdateParamsRolesPermissionsBilling) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type AccountMemberUpdateParamsRolesPermissionsCachePurge struct {
- Read param.Field[bool] `json:"read"`
- Write param.Field[bool] `json:"write"`
-}
-
-func (r AccountMemberUpdateParamsRolesPermissionsCachePurge) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type AccountMemberUpdateParamsRolesPermissionsDNS struct {
- Read param.Field[bool] `json:"read"`
- Write param.Field[bool] `json:"write"`
-}
-
-func (r AccountMemberUpdateParamsRolesPermissionsDNS) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type AccountMemberUpdateParamsRolesPermissionsDNSRecords struct {
- Read param.Field[bool] `json:"read"`
- Write param.Field[bool] `json:"write"`
-}
-
-func (r AccountMemberUpdateParamsRolesPermissionsDNSRecords) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type AccountMemberUpdateParamsRolesPermissionsLb struct {
- Read param.Field[bool] `json:"read"`
- Write param.Field[bool] `json:"write"`
-}
-
-func (r AccountMemberUpdateParamsRolesPermissionsLb) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type AccountMemberUpdateParamsRolesPermissionsLogs struct {
- Read param.Field[bool] `json:"read"`
- Write param.Field[bool] `json:"write"`
-}
-
-func (r AccountMemberUpdateParamsRolesPermissionsLogs) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type AccountMemberUpdateParamsRolesPermissionsOrganization struct {
- Read param.Field[bool] `json:"read"`
- Write param.Field[bool] `json:"write"`
-}
-
-func (r AccountMemberUpdateParamsRolesPermissionsOrganization) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type AccountMemberUpdateParamsRolesPermissionsSSL struct {
- Read param.Field[bool] `json:"read"`
- Write param.Field[bool] `json:"write"`
-}
-
-func (r AccountMemberUpdateParamsRolesPermissionsSSL) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type AccountMemberUpdateParamsRolesPermissionsWAF struct {
- Read param.Field[bool] `json:"read"`
- Write param.Field[bool] `json:"write"`
-}
-
-func (r AccountMemberUpdateParamsRolesPermissionsWAF) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type AccountMemberUpdateParamsRolesPermissionsZoneSettings struct {
- Read param.Field[bool] `json:"read"`
- Write param.Field[bool] `json:"write"`
-}
-
-func (r AccountMemberUpdateParamsRolesPermissionsZoneSettings) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type AccountMemberUpdateParamsRolesPermissionsZones struct {
- Read param.Field[bool] `json:"read"`
- Write param.Field[bool] `json:"write"`
-}
-
-func (r AccountMemberUpdateParamsRolesPermissionsZones) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type AccountMemberUpdateResponseEnvelope struct {
- Errors []AccountMemberUpdateResponseEnvelopeErrors `json:"errors,required"`
- Messages []AccountMemberUpdateResponseEnvelopeMessages `json:"messages,required"`
- Result AccountMember `json:"result,required"`
- // Whether the API call was successful
- Success AccountMemberUpdateResponseEnvelopeSuccess `json:"success,required"`
- JSON accountMemberUpdateResponseEnvelopeJSON `json:"-"`
-}
-
-// accountMemberUpdateResponseEnvelopeJSON contains the JSON metadata for the
-// struct [AccountMemberUpdateResponseEnvelope]
-type accountMemberUpdateResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AccountMemberUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r accountMemberUpdateResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type AccountMemberUpdateResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON accountMemberUpdateResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// accountMemberUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [AccountMemberUpdateResponseEnvelopeErrors]
-type accountMemberUpdateResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AccountMemberUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r accountMemberUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type AccountMemberUpdateResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON accountMemberUpdateResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// accountMemberUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [AccountMemberUpdateResponseEnvelopeMessages]
-type accountMemberUpdateResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AccountMemberUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r accountMemberUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type AccountMemberUpdateResponseEnvelopeSuccess bool
-
-const (
- AccountMemberUpdateResponseEnvelopeSuccessTrue AccountMemberUpdateResponseEnvelopeSuccess = true
-)
-
-type AccountMemberListParams struct {
- AccountID param.Field[interface{}] `path:"account_id,required"`
- // Direction to order results.
- Direction param.Field[AccountMemberListParamsDirection] `query:"direction"`
- // Field to order results by.
- Order param.Field[AccountMemberListParamsOrder] `query:"order"`
- // Page number of paginated results.
- Page param.Field[float64] `query:"page"`
- // Maximum number of results per page.
- PerPage param.Field[float64] `query:"per_page"`
- // A member's status in the account.
- Status param.Field[AccountMemberListParamsStatus] `query:"status"`
-}
-
-// URLQuery serializes [AccountMemberListParams]'s query parameters as
-// `url.Values`.
-func (r AccountMemberListParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Direction to order results.
-type AccountMemberListParamsDirection string
-
-const (
- AccountMemberListParamsDirectionAsc AccountMemberListParamsDirection = "asc"
- AccountMemberListParamsDirectionDesc AccountMemberListParamsDirection = "desc"
-)
-
-// Field to order results by.
-type AccountMemberListParamsOrder string
-
-const (
- AccountMemberListParamsOrderUserFirstName AccountMemberListParamsOrder = "user.first_name"
- AccountMemberListParamsOrderUserLastName AccountMemberListParamsOrder = "user.last_name"
- AccountMemberListParamsOrderUserEmail AccountMemberListParamsOrder = "user.email"
- AccountMemberListParamsOrderStatus AccountMemberListParamsOrder = "status"
-)
-
-// A member's status in the account.
-type AccountMemberListParamsStatus string
-
-const (
- AccountMemberListParamsStatusAccepted AccountMemberListParamsStatus = "accepted"
- AccountMemberListParamsStatusPending AccountMemberListParamsStatus = "pending"
- AccountMemberListParamsStatusRejected AccountMemberListParamsStatus = "rejected"
-)
-
-type AccountMemberDeleteParams struct {
- AccountID param.Field[interface{}] `path:"account_id,required"`
-}
-
-type AccountMemberDeleteResponseEnvelope struct {
- Errors []AccountMemberDeleteResponseEnvelopeErrors `json:"errors,required"`
- Messages []AccountMemberDeleteResponseEnvelopeMessages `json:"messages,required"`
- Result AccountMemberDeleteResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success AccountMemberDeleteResponseEnvelopeSuccess `json:"success,required"`
- JSON accountMemberDeleteResponseEnvelopeJSON `json:"-"`
-}
-
-// accountMemberDeleteResponseEnvelopeJSON contains the JSON metadata for the
-// struct [AccountMemberDeleteResponseEnvelope]
-type accountMemberDeleteResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AccountMemberDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r accountMemberDeleteResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type AccountMemberDeleteResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON accountMemberDeleteResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// accountMemberDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [AccountMemberDeleteResponseEnvelopeErrors]
-type accountMemberDeleteResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AccountMemberDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r accountMemberDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type AccountMemberDeleteResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON accountMemberDeleteResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// accountMemberDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [AccountMemberDeleteResponseEnvelopeMessages]
-type accountMemberDeleteResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AccountMemberDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r accountMemberDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type AccountMemberDeleteResponseEnvelopeSuccess bool
-
-const (
- AccountMemberDeleteResponseEnvelopeSuccessTrue AccountMemberDeleteResponseEnvelopeSuccess = true
-)
-
-type AccountMemberGetParams struct {
- AccountID param.Field[interface{}] `path:"account_id,required"`
-}
-
-type AccountMemberGetResponseEnvelope struct {
- Errors []AccountMemberGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []AccountMemberGetResponseEnvelopeMessages `json:"messages,required"`
- Result AccountMember `json:"result,required"`
- // Whether the API call was successful
- Success AccountMemberGetResponseEnvelopeSuccess `json:"success,required"`
- JSON accountMemberGetResponseEnvelopeJSON `json:"-"`
-}
-
-// accountMemberGetResponseEnvelopeJSON contains the JSON metadata for the struct
-// [AccountMemberGetResponseEnvelope]
-type accountMemberGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AccountMemberGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r accountMemberGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type AccountMemberGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON accountMemberGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// accountMemberGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [AccountMemberGetResponseEnvelopeErrors]
-type accountMemberGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AccountMemberGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r accountMemberGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type AccountMemberGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON accountMemberGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// accountMemberGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [AccountMemberGetResponseEnvelopeMessages]
-type accountMemberGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AccountMemberGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r accountMemberGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type AccountMemberGetResponseEnvelopeSuccess bool
-
-const (
- AccountMemberGetResponseEnvelopeSuccessTrue AccountMemberGetResponseEnvelopeSuccess = true
-)
diff --git a/accountmember_test.go b/accountmember_test.go
deleted file mode 100644
index d207c277d84..00000000000
--- a/accountmember_test.go
+++ /dev/null
@@ -1,171 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestAccountMemberNewWithOptionalParams(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"),
- )
- _, err := client.Accounts.Members.New(context.TODO(), cloudflare.AccountMemberNewParams{
- AccountID: cloudflare.F[any](map[string]interface{}{}),
- Email: cloudflare.F("user@example.com"),
- Roles: cloudflare.F([]string{"3536bcfad5faccb999b47003c79917fb", "3536bcfad5faccb999b47003c79917fb", "3536bcfad5faccb999b47003c79917fb"}),
- Status: cloudflare.F(cloudflare.AccountMemberNewParamsStatusAccepted),
- })
- 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())
- }
-}
-
-func TestAccountMemberUpdate(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"),
- )
- _, err := client.Accounts.Members.Update(
- context.TODO(),
- "4536bcfad5faccb111b47003c79917fa",
- cloudflare.AccountMemberUpdateParams{
- AccountID: cloudflare.F[any](map[string]interface{}{}),
- Roles: cloudflare.F([]cloudflare.AccountMemberUpdateParamsRole{{
- ID: cloudflare.F("3536bcfad5faccb999b47003c79917fb"),
- }, {
- ID: cloudflare.F("3536bcfad5faccb999b47003c79917fb"),
- }, {
- ID: cloudflare.F("3536bcfad5faccb999b47003c79917fb"),
- }}),
- },
- )
- 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())
- }
-}
-
-func TestAccountMemberListWithOptionalParams(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"),
- )
- _, err := client.Accounts.Members.List(context.TODO(), cloudflare.AccountMemberListParams{
- AccountID: cloudflare.F[any](map[string]interface{}{}),
- Direction: cloudflare.F(cloudflare.AccountMemberListParamsDirectionDesc),
- Order: cloudflare.F(cloudflare.AccountMemberListParamsOrderStatus),
- Page: cloudflare.F(1.000000),
- PerPage: cloudflare.F(5.000000),
- Status: cloudflare.F(cloudflare.AccountMemberListParamsStatusAccepted),
- })
- 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())
- }
-}
-
-func TestAccountMemberDelete(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"),
- )
- _, err := client.Accounts.Members.Delete(
- context.TODO(),
- "4536bcfad5faccb111b47003c79917fa",
- cloudflare.AccountMemberDeleteParams{
- AccountID: cloudflare.F[any](map[string]interface{}{}),
- },
- )
- 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())
- }
-}
-
-func TestAccountMemberGet(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"),
- )
- _, err := client.Accounts.Members.Get(
- context.TODO(),
- "4536bcfad5faccb111b47003c79917fa",
- cloudflare.AccountMemberGetParams{
- AccountID: cloudflare.F[any](map[string]interface{}{}),
- },
- )
- 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/accountrole.go b/accountrole.go
deleted file mode 100644
index 9d734d7f5e8..00000000000
--- a/accountrole.go
+++ /dev/null
@@ -1,311 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "reflect"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/option"
- "github.com/tidwall/gjson"
-)
-
-// AccountRoleService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewAccountRoleService] method
-// instead.
-type AccountRoleService struct {
- Options []option.RequestOption
-}
-
-// NewAccountRoleService generates a new service that applies the given options to
-// each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewAccountRoleService(opts ...option.RequestOption) (r *AccountRoleService) {
- r = &AccountRoleService{}
- r.Options = opts
- return
-}
-
-// Get all available roles for an account.
-func (r *AccountRoleService) List(ctx context.Context, query AccountRoleListParams, opts ...option.RequestOption) (res *[]AccountRoleListResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env AccountRoleListResponseEnvelope
- path := fmt.Sprintf("accounts/%v/roles", query.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Get information about a specific role for an account.
-func (r *AccountRoleService) Get(ctx context.Context, roleID interface{}, query AccountRoleGetParams, opts ...option.RequestOption) (res *AccountRoleGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env AccountRoleGetResponseEnvelope
- path := fmt.Sprintf("accounts/%v/roles/%v", query.AccountID, roleID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type AccountRoleListResponse struct {
- // Role identifier tag.
- ID string `json:"id,required"`
- // Description of role's permissions.
- Description string `json:"description,required"`
- // Role Name.
- Name string `json:"name,required"`
- // Access permissions for this User.
- Permissions []string `json:"permissions,required"`
- JSON accountRoleListResponseJSON `json:"-"`
-}
-
-// accountRoleListResponseJSON contains the JSON metadata for the struct
-// [AccountRoleListResponse]
-type accountRoleListResponseJSON struct {
- ID apijson.Field
- Description apijson.Field
- Name apijson.Field
- Permissions apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AccountRoleListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r accountRoleListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// Union satisfied by [AccountRoleGetResponseUnknown] or [shared.UnionString].
-type AccountRoleGetResponse interface {
- ImplementsAccountRoleGetResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*AccountRoleGetResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-type AccountRoleListParams struct {
- AccountID param.Field[interface{}] `path:"account_id,required"`
-}
-
-type AccountRoleListResponseEnvelope struct {
- Errors []AccountRoleListResponseEnvelopeErrors `json:"errors,required"`
- Messages []AccountRoleListResponseEnvelopeMessages `json:"messages,required"`
- Result []AccountRoleListResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success AccountRoleListResponseEnvelopeSuccess `json:"success,required"`
- ResultInfo AccountRoleListResponseEnvelopeResultInfo `json:"result_info"`
- JSON accountRoleListResponseEnvelopeJSON `json:"-"`
-}
-
-// accountRoleListResponseEnvelopeJSON contains the JSON metadata for the struct
-// [AccountRoleListResponseEnvelope]
-type accountRoleListResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- ResultInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AccountRoleListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r accountRoleListResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type AccountRoleListResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON accountRoleListResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// accountRoleListResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [AccountRoleListResponseEnvelopeErrors]
-type accountRoleListResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AccountRoleListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r accountRoleListResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type AccountRoleListResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON accountRoleListResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// accountRoleListResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [AccountRoleListResponseEnvelopeMessages]
-type accountRoleListResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AccountRoleListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r accountRoleListResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type AccountRoleListResponseEnvelopeSuccess bool
-
-const (
- AccountRoleListResponseEnvelopeSuccessTrue AccountRoleListResponseEnvelopeSuccess = true
-)
-
-type AccountRoleListResponseEnvelopeResultInfo struct {
- // Total number of results for the requested service
- Count float64 `json:"count"`
- // Current page within paginated list of results
- Page float64 `json:"page"`
- // Number of results per page of results
- PerPage float64 `json:"per_page"`
- // Total results available without any search parameters
- TotalCount float64 `json:"total_count"`
- JSON accountRoleListResponseEnvelopeResultInfoJSON `json:"-"`
-}
-
-// accountRoleListResponseEnvelopeResultInfoJSON contains the JSON metadata for the
-// struct [AccountRoleListResponseEnvelopeResultInfo]
-type accountRoleListResponseEnvelopeResultInfoJSON struct {
- Count apijson.Field
- Page apijson.Field
- PerPage apijson.Field
- TotalCount apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AccountRoleListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r accountRoleListResponseEnvelopeResultInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type AccountRoleGetParams struct {
- AccountID param.Field[interface{}] `path:"account_id,required"`
-}
-
-type AccountRoleGetResponseEnvelope struct {
- Errors []AccountRoleGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []AccountRoleGetResponseEnvelopeMessages `json:"messages,required"`
- Result AccountRoleGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success AccountRoleGetResponseEnvelopeSuccess `json:"success,required"`
- JSON accountRoleGetResponseEnvelopeJSON `json:"-"`
-}
-
-// accountRoleGetResponseEnvelopeJSON contains the JSON metadata for the struct
-// [AccountRoleGetResponseEnvelope]
-type accountRoleGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AccountRoleGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r accountRoleGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type AccountRoleGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON accountRoleGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// accountRoleGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [AccountRoleGetResponseEnvelopeErrors]
-type accountRoleGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AccountRoleGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r accountRoleGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type AccountRoleGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON accountRoleGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// accountRoleGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [AccountRoleGetResponseEnvelopeMessages]
-type accountRoleGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AccountRoleGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r accountRoleGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type AccountRoleGetResponseEnvelopeSuccess bool
-
-const (
- AccountRoleGetResponseEnvelopeSuccessTrue AccountRoleGetResponseEnvelopeSuccess = true
-)
diff --git a/accountrole_test.go b/accountrole_test.go
deleted file mode 100644
index dbb441553ec..00000000000
--- a/accountrole_test.go
+++ /dev/null
@@ -1,70 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestAccountRoleList(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"),
- )
- _, err := client.Accounts.Roles.List(context.TODO(), cloudflare.AccountRoleListParams{
- AccountID: cloudflare.F[any](map[string]interface{}{}),
- })
- 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())
- }
-}
-
-func TestAccountRoleGet(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"),
- )
- _, err := client.Accounts.Roles.Get(
- context.TODO(),
- map[string]interface{}{},
- cloudflare.AccountRoleGetParams{
- AccountID: cloudflare.F[any](map[string]interface{}{}),
- },
- )
- 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/account.go b/accounts/account.go
similarity index 97%
rename from account.go
rename to accounts/account.go
index 802ea57d401..d7d2c10c12f 100644
--- a/account.go
+++ b/accounts/account.go
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package cloudflare
+package accounts
import (
"context"
@@ -25,8 +25,8 @@ import (
// service directly, and instead use the [NewAccountService] method instead.
type AccountService struct {
Options []option.RequestOption
- Members *AccountMemberService
- Roles *AccountRoleService
+ Members *MemberService
+ Roles *RoleService
}
// NewAccountService generates a new service that applies the given options to each
@@ -35,8 +35,8 @@ type AccountService struct {
func NewAccountService(opts ...option.RequestOption) (r *AccountService) {
r = &AccountService{}
r.Options = opts
- r.Members = NewAccountMemberService(opts...)
- r.Roles = NewAccountRoleService(opts...)
+ r.Members = NewMemberService(opts...)
+ r.Roles = NewRoleService(opts...)
return
}
@@ -178,9 +178,10 @@ const (
AccountSettingsDefaultNameserversCustomTenant AccountSettingsDefaultNameservers = "custom.tenant"
)
-// Union satisfied by [AccountUpdateResponseUnknown] or [shared.UnionString].
+// Union satisfied by [accounts.AccountUpdateResponseUnknown] or
+// [shared.UnionString].
type AccountUpdateResponse interface {
- ImplementsAccountUpdateResponse()
+ ImplementsAccountsAccountUpdateResponse()
}
func init() {
@@ -196,9 +197,9 @@ func init() {
type AccountListResponse = interface{}
-// Union satisfied by [AccountGetResponseUnknown] or [shared.UnionString].
+// Union satisfied by [accounts.AccountGetResponseUnknown] or [shared.UnionString].
type AccountGetResponse interface {
- ImplementsAccountGetResponse()
+ ImplementsAccountsAccountGetResponse()
}
func init() {
diff --git a/account_test.go b/accounts/account_test.go
similarity index 81%
rename from account_test.go
rename to accounts/account_test.go
index a21b375e1d1..07330e3865d 100644
--- a/account_test.go
+++ b/accounts/account_test.go
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package cloudflare_test
+package accounts_test
import (
"context"
@@ -9,6 +9,7 @@ import (
"testing"
"github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/accounts"
"github.com/cloudflare/cloudflare-go/internal/testutil"
"github.com/cloudflare/cloudflare-go/option"
)
@@ -27,11 +28,11 @@ func TestAccountUpdateWithOptionalParams(t *testing.T) {
option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"),
option.WithAPIEmail("user@example.com"),
)
- _, err := client.Accounts.Update(context.TODO(), cloudflare.AccountUpdateParams{
+ _, err := client.Accounts.Update(context.TODO(), accounts.AccountUpdateParams{
AccountID: cloudflare.F[any](map[string]interface{}{}),
Name: cloudflare.F("Demo Account"),
- Settings: cloudflare.F(cloudflare.AccountUpdateParamsSettings{
- DefaultNameservers: cloudflare.F(cloudflare.AccountUpdateParamsSettingsDefaultNameserversCloudflareStandard),
+ Settings: cloudflare.F(accounts.AccountUpdateParamsSettings{
+ DefaultNameservers: cloudflare.F(accounts.AccountUpdateParamsSettingsDefaultNameserversCloudflareStandard),
EnforceTwofactor: cloudflare.F(true),
UseAccountCustomNSByDefault: cloudflare.F(true),
}),
@@ -59,8 +60,8 @@ func TestAccountListWithOptionalParams(t *testing.T) {
option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"),
option.WithAPIEmail("user@example.com"),
)
- _, err := client.Accounts.List(context.TODO(), cloudflare.AccountListParams{
- Direction: cloudflare.F(cloudflare.AccountListParamsDirectionDesc),
+ _, err := client.Accounts.List(context.TODO(), accounts.AccountListParams{
+ Direction: cloudflare.F(accounts.AccountListParamsDirectionDesc),
Page: cloudflare.F(1.000000),
PerPage: cloudflare.F(5.000000),
})
@@ -87,7 +88,7 @@ func TestAccountGet(t *testing.T) {
option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"),
option.WithAPIEmail("user@example.com"),
)
- _, err := client.Accounts.Get(context.TODO(), cloudflare.AccountGetParams{
+ _, err := client.Accounts.Get(context.TODO(), accounts.AccountGetParams{
AccountID: cloudflare.F[any](map[string]interface{}{}),
})
if err != nil {
diff --git a/accounts/aliases.go b/accounts/aliases.go
new file mode 100644
index 00000000000..e5cdc5c917e
--- /dev/null
+++ b/accounts/aliases.go
@@ -0,0 +1,9 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package accounts
+
+import (
+ "github.com/cloudflare/cloudflare-go/internal/apierror"
+)
+
+type Error = apierror.Error
diff --git a/accounts/member.go b/accounts/member.go
new file mode 100644
index 00000000000..0b7ac37a83e
--- /dev/null
+++ b/accounts/member.go
@@ -0,0 +1,1548 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package accounts
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// MemberService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewMemberService] method instead.
+type MemberService struct {
+ Options []option.RequestOption
+}
+
+// NewMemberService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewMemberService(opts ...option.RequestOption) (r *MemberService) {
+ r = &MemberService{}
+ r.Options = opts
+ return
+}
+
+// Add a user to the list of members for this account.
+func (r *MemberService) New(ctx context.Context, params MemberNewParams, opts ...option.RequestOption) (res *AccountMemberWithID, err error) {
+ opts = append(r.Options[:], opts...)
+ var env MemberNewResponseEnvelope
+ path := fmt.Sprintf("accounts/%v/members", params.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Modify an account member.
+func (r *MemberService) Update(ctx context.Context, memberID string, params MemberUpdateParams, opts ...option.RequestOption) (res *AccountMember, err error) {
+ opts = append(r.Options[:], opts...)
+ var env MemberUpdateResponseEnvelope
+ path := fmt.Sprintf("accounts/%v/members/%s", params.AccountID, memberID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// List all members of an account.
+func (r *MemberService) List(ctx context.Context, params MemberListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[MemberListResponse], err error) {
+ var raw *http.Response
+ opts = append(r.Options, opts...)
+ opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
+ path := fmt.Sprintf("accounts/%v/members", params.AccountID)
+ cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, params, &res, opts...)
+ if err != nil {
+ return nil, err
+ }
+ err = cfg.Execute()
+ if err != nil {
+ return nil, err
+ }
+ res.SetPageConfig(cfg, raw)
+ return res, nil
+}
+
+// List all members of an account.
+func (r *MemberService) ListAutoPaging(ctx context.Context, params MemberListParams, opts ...option.RequestOption) *shared.V4PagePaginationArrayAutoPager[MemberListResponse] {
+ return shared.NewV4PagePaginationArrayAutoPager(r.List(ctx, params, opts...))
+}
+
+// Remove a member from an account.
+func (r *MemberService) Delete(ctx context.Context, memberID string, body MemberDeleteParams, opts ...option.RequestOption) (res *MemberDeleteResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env MemberDeleteResponseEnvelope
+ path := fmt.Sprintf("accounts/%v/members/%s", body.AccountID, memberID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Get information about a specific member of an account.
+func (r *MemberService) Get(ctx context.Context, memberID string, query MemberGetParams, opts ...option.RequestOption) (res *AccountMember, err error) {
+ opts = append(r.Options[:], opts...)
+ var env MemberGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%v/members/%s", query.AccountID, memberID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type AccountMember struct {
+ // Membership identifier tag.
+ ID string `json:"id,required"`
+ // Roles assigned to this member.
+ Roles []AccountMemberRole `json:"roles,required"`
+ Status interface{} `json:"status,required"`
+ User AccountMemberUser `json:"user,required"`
+ JSON accountMemberJSON `json:"-"`
+}
+
+// accountMemberJSON contains the JSON metadata for the struct [AccountMember]
+type accountMemberJSON struct {
+ ID apijson.Field
+ Roles apijson.Field
+ Status apijson.Field
+ User apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AccountMember) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r accountMemberJSON) RawJSON() string {
+ return r.raw
+}
+
+type AccountMemberRole struct {
+ // Role identifier tag.
+ ID string `json:"id,required"`
+ // Description of role's permissions.
+ Description string `json:"description,required"`
+ // Role name.
+ Name string `json:"name,required"`
+ Permissions AccountMemberRolesPermissions `json:"permissions,required"`
+ JSON accountMemberRoleJSON `json:"-"`
+}
+
+// accountMemberRoleJSON contains the JSON metadata for the struct
+// [AccountMemberRole]
+type accountMemberRoleJSON struct {
+ ID apijson.Field
+ Description apijson.Field
+ Name apijson.Field
+ Permissions apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AccountMemberRole) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r accountMemberRoleJSON) RawJSON() string {
+ return r.raw
+}
+
+type AccountMemberRolesPermissions struct {
+ Analytics AccountMemberRolesPermissionsAnalytics `json:"analytics"`
+ Billing AccountMemberRolesPermissionsBilling `json:"billing"`
+ CachePurge AccountMemberRolesPermissionsCachePurge `json:"cache_purge"`
+ DNS AccountMemberRolesPermissionsDNS `json:"dns"`
+ DNSRecords AccountMemberRolesPermissionsDNSRecords `json:"dns_records"`
+ Lb AccountMemberRolesPermissionsLb `json:"lb"`
+ Logs AccountMemberRolesPermissionsLogs `json:"logs"`
+ Organization AccountMemberRolesPermissionsOrganization `json:"organization"`
+ SSL AccountMemberRolesPermissionsSSL `json:"ssl"`
+ WAF AccountMemberRolesPermissionsWAF `json:"waf"`
+ ZoneSettings AccountMemberRolesPermissionsZoneSettings `json:"zone_settings"`
+ Zones AccountMemberRolesPermissionsZones `json:"zones"`
+ JSON accountMemberRolesPermissionsJSON `json:"-"`
+}
+
+// accountMemberRolesPermissionsJSON contains the JSON metadata for the struct
+// [AccountMemberRolesPermissions]
+type accountMemberRolesPermissionsJSON struct {
+ Analytics apijson.Field
+ Billing apijson.Field
+ CachePurge apijson.Field
+ DNS apijson.Field
+ DNSRecords apijson.Field
+ Lb apijson.Field
+ Logs apijson.Field
+ Organization apijson.Field
+ SSL apijson.Field
+ WAF apijson.Field
+ ZoneSettings apijson.Field
+ Zones apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AccountMemberRolesPermissions) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r accountMemberRolesPermissionsJSON) RawJSON() string {
+ return r.raw
+}
+
+type AccountMemberRolesPermissionsAnalytics struct {
+ Read bool `json:"read"`
+ Write bool `json:"write"`
+ JSON accountMemberRolesPermissionsAnalyticsJSON `json:"-"`
+}
+
+// accountMemberRolesPermissionsAnalyticsJSON contains the JSON metadata for the
+// struct [AccountMemberRolesPermissionsAnalytics]
+type accountMemberRolesPermissionsAnalyticsJSON struct {
+ Read apijson.Field
+ Write apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AccountMemberRolesPermissionsAnalytics) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r accountMemberRolesPermissionsAnalyticsJSON) RawJSON() string {
+ return r.raw
+}
+
+type AccountMemberRolesPermissionsBilling struct {
+ Read bool `json:"read"`
+ Write bool `json:"write"`
+ JSON accountMemberRolesPermissionsBillingJSON `json:"-"`
+}
+
+// accountMemberRolesPermissionsBillingJSON contains the JSON metadata for the
+// struct [AccountMemberRolesPermissionsBilling]
+type accountMemberRolesPermissionsBillingJSON struct {
+ Read apijson.Field
+ Write apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AccountMemberRolesPermissionsBilling) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r accountMemberRolesPermissionsBillingJSON) RawJSON() string {
+ return r.raw
+}
+
+type AccountMemberRolesPermissionsCachePurge struct {
+ Read bool `json:"read"`
+ Write bool `json:"write"`
+ JSON accountMemberRolesPermissionsCachePurgeJSON `json:"-"`
+}
+
+// accountMemberRolesPermissionsCachePurgeJSON contains the JSON metadata for the
+// struct [AccountMemberRolesPermissionsCachePurge]
+type accountMemberRolesPermissionsCachePurgeJSON struct {
+ Read apijson.Field
+ Write apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AccountMemberRolesPermissionsCachePurge) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r accountMemberRolesPermissionsCachePurgeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AccountMemberRolesPermissionsDNS struct {
+ Read bool `json:"read"`
+ Write bool `json:"write"`
+ JSON accountMemberRolesPermissionsDNSJSON `json:"-"`
+}
+
+// accountMemberRolesPermissionsDNSJSON contains the JSON metadata for the struct
+// [AccountMemberRolesPermissionsDNS]
+type accountMemberRolesPermissionsDNSJSON struct {
+ Read apijson.Field
+ Write apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AccountMemberRolesPermissionsDNS) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r accountMemberRolesPermissionsDNSJSON) RawJSON() string {
+ return r.raw
+}
+
+type AccountMemberRolesPermissionsDNSRecords struct {
+ Read bool `json:"read"`
+ Write bool `json:"write"`
+ JSON accountMemberRolesPermissionsDNSRecordsJSON `json:"-"`
+}
+
+// accountMemberRolesPermissionsDNSRecordsJSON contains the JSON metadata for the
+// struct [AccountMemberRolesPermissionsDNSRecords]
+type accountMemberRolesPermissionsDNSRecordsJSON struct {
+ Read apijson.Field
+ Write apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AccountMemberRolesPermissionsDNSRecords) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r accountMemberRolesPermissionsDNSRecordsJSON) RawJSON() string {
+ return r.raw
+}
+
+type AccountMemberRolesPermissionsLb struct {
+ Read bool `json:"read"`
+ Write bool `json:"write"`
+ JSON accountMemberRolesPermissionsLbJSON `json:"-"`
+}
+
+// accountMemberRolesPermissionsLbJSON contains the JSON metadata for the struct
+// [AccountMemberRolesPermissionsLb]
+type accountMemberRolesPermissionsLbJSON struct {
+ Read apijson.Field
+ Write apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AccountMemberRolesPermissionsLb) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r accountMemberRolesPermissionsLbJSON) RawJSON() string {
+ return r.raw
+}
+
+type AccountMemberRolesPermissionsLogs struct {
+ Read bool `json:"read"`
+ Write bool `json:"write"`
+ JSON accountMemberRolesPermissionsLogsJSON `json:"-"`
+}
+
+// accountMemberRolesPermissionsLogsJSON contains the JSON metadata for the struct
+// [AccountMemberRolesPermissionsLogs]
+type accountMemberRolesPermissionsLogsJSON struct {
+ Read apijson.Field
+ Write apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AccountMemberRolesPermissionsLogs) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r accountMemberRolesPermissionsLogsJSON) RawJSON() string {
+ return r.raw
+}
+
+type AccountMemberRolesPermissionsOrganization struct {
+ Read bool `json:"read"`
+ Write bool `json:"write"`
+ JSON accountMemberRolesPermissionsOrganizationJSON `json:"-"`
+}
+
+// accountMemberRolesPermissionsOrganizationJSON contains the JSON metadata for the
+// struct [AccountMemberRolesPermissionsOrganization]
+type accountMemberRolesPermissionsOrganizationJSON struct {
+ Read apijson.Field
+ Write apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AccountMemberRolesPermissionsOrganization) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r accountMemberRolesPermissionsOrganizationJSON) RawJSON() string {
+ return r.raw
+}
+
+type AccountMemberRolesPermissionsSSL struct {
+ Read bool `json:"read"`
+ Write bool `json:"write"`
+ JSON accountMemberRolesPermissionsSSLJSON `json:"-"`
+}
+
+// accountMemberRolesPermissionsSSLJSON contains the JSON metadata for the struct
+// [AccountMemberRolesPermissionsSSL]
+type accountMemberRolesPermissionsSSLJSON struct {
+ Read apijson.Field
+ Write apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AccountMemberRolesPermissionsSSL) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r accountMemberRolesPermissionsSSLJSON) RawJSON() string {
+ return r.raw
+}
+
+type AccountMemberRolesPermissionsWAF struct {
+ Read bool `json:"read"`
+ Write bool `json:"write"`
+ JSON accountMemberRolesPermissionsWAFJSON `json:"-"`
+}
+
+// accountMemberRolesPermissionsWAFJSON contains the JSON metadata for the struct
+// [AccountMemberRolesPermissionsWAF]
+type accountMemberRolesPermissionsWAFJSON struct {
+ Read apijson.Field
+ Write apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AccountMemberRolesPermissionsWAF) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r accountMemberRolesPermissionsWAFJSON) RawJSON() string {
+ return r.raw
+}
+
+type AccountMemberRolesPermissionsZoneSettings struct {
+ Read bool `json:"read"`
+ Write bool `json:"write"`
+ JSON accountMemberRolesPermissionsZoneSettingsJSON `json:"-"`
+}
+
+// accountMemberRolesPermissionsZoneSettingsJSON contains the JSON metadata for the
+// struct [AccountMemberRolesPermissionsZoneSettings]
+type accountMemberRolesPermissionsZoneSettingsJSON struct {
+ Read apijson.Field
+ Write apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AccountMemberRolesPermissionsZoneSettings) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r accountMemberRolesPermissionsZoneSettingsJSON) RawJSON() string {
+ return r.raw
+}
+
+type AccountMemberRolesPermissionsZones struct {
+ Read bool `json:"read"`
+ Write bool `json:"write"`
+ JSON accountMemberRolesPermissionsZonesJSON `json:"-"`
+}
+
+// accountMemberRolesPermissionsZonesJSON contains the JSON metadata for the struct
+// [AccountMemberRolesPermissionsZones]
+type accountMemberRolesPermissionsZonesJSON struct {
+ Read apijson.Field
+ Write apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AccountMemberRolesPermissionsZones) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r accountMemberRolesPermissionsZonesJSON) RawJSON() string {
+ return r.raw
+}
+
+type AccountMemberUser struct {
+ // The contact email address of the user.
+ Email string `json:"email,required"`
+ // Identifier
+ ID string `json:"id"`
+ // User's first name
+ FirstName string `json:"first_name,nullable"`
+ // User's last name
+ LastName string `json:"last_name,nullable"`
+ // Indicates whether two-factor authentication is enabled for the user account.
+ // Does not apply to API authentication.
+ TwoFactorAuthenticationEnabled bool `json:"two_factor_authentication_enabled"`
+ JSON accountMemberUserJSON `json:"-"`
+}
+
+// accountMemberUserJSON contains the JSON metadata for the struct
+// [AccountMemberUser]
+type accountMemberUserJSON struct {
+ Email apijson.Field
+ ID apijson.Field
+ FirstName apijson.Field
+ LastName apijson.Field
+ TwoFactorAuthenticationEnabled apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AccountMemberUser) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r accountMemberUserJSON) RawJSON() string {
+ return r.raw
+}
+
+type AccountMemberWithID struct {
+ // Membership identifier tag.
+ ID string `json:"id,required"`
+ // Roles assigned to this member.
+ Roles []AccountMemberWithIDRole `json:"roles,required"`
+ Status interface{} `json:"status,required"`
+ User AccountMemberWithIDUser `json:"user,required"`
+ // The unique activation code for the account membership.
+ Code string `json:"code"`
+ JSON accountMemberWithIDJSON `json:"-"`
+}
+
+// accountMemberWithIDJSON contains the JSON metadata for the struct
+// [AccountMemberWithID]
+type accountMemberWithIDJSON struct {
+ ID apijson.Field
+ Roles apijson.Field
+ Status apijson.Field
+ User apijson.Field
+ Code apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AccountMemberWithID) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r accountMemberWithIDJSON) RawJSON() string {
+ return r.raw
+}
+
+type AccountMemberWithIDRole struct {
+ // Role identifier tag.
+ ID string `json:"id,required"`
+ // Description of role's permissions.
+ Description string `json:"description,required"`
+ // Role name.
+ Name string `json:"name,required"`
+ Permissions AccountMemberWithIDRolesPermissions `json:"permissions,required"`
+ JSON accountMemberWithIDRoleJSON `json:"-"`
+}
+
+// accountMemberWithIDRoleJSON contains the JSON metadata for the struct
+// [AccountMemberWithIDRole]
+type accountMemberWithIDRoleJSON struct {
+ ID apijson.Field
+ Description apijson.Field
+ Name apijson.Field
+ Permissions apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AccountMemberWithIDRole) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r accountMemberWithIDRoleJSON) RawJSON() string {
+ return r.raw
+}
+
+type AccountMemberWithIDRolesPermissions struct {
+ Analytics AccountMemberWithIDRolesPermissionsAnalytics `json:"analytics"`
+ Billing AccountMemberWithIDRolesPermissionsBilling `json:"billing"`
+ CachePurge AccountMemberWithIDRolesPermissionsCachePurge `json:"cache_purge"`
+ DNS AccountMemberWithIDRolesPermissionsDNS `json:"dns"`
+ DNSRecords AccountMemberWithIDRolesPermissionsDNSRecords `json:"dns_records"`
+ Lb AccountMemberWithIDRolesPermissionsLb `json:"lb"`
+ Logs AccountMemberWithIDRolesPermissionsLogs `json:"logs"`
+ Organization AccountMemberWithIDRolesPermissionsOrganization `json:"organization"`
+ SSL AccountMemberWithIDRolesPermissionsSSL `json:"ssl"`
+ WAF AccountMemberWithIDRolesPermissionsWAF `json:"waf"`
+ ZoneSettings AccountMemberWithIDRolesPermissionsZoneSettings `json:"zone_settings"`
+ Zones AccountMemberWithIDRolesPermissionsZones `json:"zones"`
+ JSON accountMemberWithIDRolesPermissionsJSON `json:"-"`
+}
+
+// accountMemberWithIDRolesPermissionsJSON contains the JSON metadata for the
+// struct [AccountMemberWithIDRolesPermissions]
+type accountMemberWithIDRolesPermissionsJSON struct {
+ Analytics apijson.Field
+ Billing apijson.Field
+ CachePurge apijson.Field
+ DNS apijson.Field
+ DNSRecords apijson.Field
+ Lb apijson.Field
+ Logs apijson.Field
+ Organization apijson.Field
+ SSL apijson.Field
+ WAF apijson.Field
+ ZoneSettings apijson.Field
+ Zones apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AccountMemberWithIDRolesPermissions) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r accountMemberWithIDRolesPermissionsJSON) RawJSON() string {
+ return r.raw
+}
+
+type AccountMemberWithIDRolesPermissionsAnalytics struct {
+ Read bool `json:"read"`
+ Write bool `json:"write"`
+ JSON accountMemberWithIDRolesPermissionsAnalyticsJSON `json:"-"`
+}
+
+// accountMemberWithIDRolesPermissionsAnalyticsJSON contains the JSON metadata for
+// the struct [AccountMemberWithIDRolesPermissionsAnalytics]
+type accountMemberWithIDRolesPermissionsAnalyticsJSON struct {
+ Read apijson.Field
+ Write apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AccountMemberWithIDRolesPermissionsAnalytics) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r accountMemberWithIDRolesPermissionsAnalyticsJSON) RawJSON() string {
+ return r.raw
+}
+
+type AccountMemberWithIDRolesPermissionsBilling struct {
+ Read bool `json:"read"`
+ Write bool `json:"write"`
+ JSON accountMemberWithIDRolesPermissionsBillingJSON `json:"-"`
+}
+
+// accountMemberWithIDRolesPermissionsBillingJSON contains the JSON metadata for
+// the struct [AccountMemberWithIDRolesPermissionsBilling]
+type accountMemberWithIDRolesPermissionsBillingJSON struct {
+ Read apijson.Field
+ Write apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AccountMemberWithIDRolesPermissionsBilling) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r accountMemberWithIDRolesPermissionsBillingJSON) RawJSON() string {
+ return r.raw
+}
+
+type AccountMemberWithIDRolesPermissionsCachePurge struct {
+ Read bool `json:"read"`
+ Write bool `json:"write"`
+ JSON accountMemberWithIDRolesPermissionsCachePurgeJSON `json:"-"`
+}
+
+// accountMemberWithIDRolesPermissionsCachePurgeJSON contains the JSON metadata for
+// the struct [AccountMemberWithIDRolesPermissionsCachePurge]
+type accountMemberWithIDRolesPermissionsCachePurgeJSON struct {
+ Read apijson.Field
+ Write apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AccountMemberWithIDRolesPermissionsCachePurge) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r accountMemberWithIDRolesPermissionsCachePurgeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AccountMemberWithIDRolesPermissionsDNS struct {
+ Read bool `json:"read"`
+ Write bool `json:"write"`
+ JSON accountMemberWithIDRolesPermissionsDNSJSON `json:"-"`
+}
+
+// accountMemberWithIDRolesPermissionsDNSJSON contains the JSON metadata for the
+// struct [AccountMemberWithIDRolesPermissionsDNS]
+type accountMemberWithIDRolesPermissionsDNSJSON struct {
+ Read apijson.Field
+ Write apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AccountMemberWithIDRolesPermissionsDNS) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r accountMemberWithIDRolesPermissionsDNSJSON) RawJSON() string {
+ return r.raw
+}
+
+type AccountMemberWithIDRolesPermissionsDNSRecords struct {
+ Read bool `json:"read"`
+ Write bool `json:"write"`
+ JSON accountMemberWithIDRolesPermissionsDNSRecordsJSON `json:"-"`
+}
+
+// accountMemberWithIDRolesPermissionsDNSRecordsJSON contains the JSON metadata for
+// the struct [AccountMemberWithIDRolesPermissionsDNSRecords]
+type accountMemberWithIDRolesPermissionsDNSRecordsJSON struct {
+ Read apijson.Field
+ Write apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AccountMemberWithIDRolesPermissionsDNSRecords) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r accountMemberWithIDRolesPermissionsDNSRecordsJSON) RawJSON() string {
+ return r.raw
+}
+
+type AccountMemberWithIDRolesPermissionsLb struct {
+ Read bool `json:"read"`
+ Write bool `json:"write"`
+ JSON accountMemberWithIDRolesPermissionsLbJSON `json:"-"`
+}
+
+// accountMemberWithIDRolesPermissionsLbJSON contains the JSON metadata for the
+// struct [AccountMemberWithIDRolesPermissionsLb]
+type accountMemberWithIDRolesPermissionsLbJSON struct {
+ Read apijson.Field
+ Write apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AccountMemberWithIDRolesPermissionsLb) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r accountMemberWithIDRolesPermissionsLbJSON) RawJSON() string {
+ return r.raw
+}
+
+type AccountMemberWithIDRolesPermissionsLogs struct {
+ Read bool `json:"read"`
+ Write bool `json:"write"`
+ JSON accountMemberWithIDRolesPermissionsLogsJSON `json:"-"`
+}
+
+// accountMemberWithIDRolesPermissionsLogsJSON contains the JSON metadata for the
+// struct [AccountMemberWithIDRolesPermissionsLogs]
+type accountMemberWithIDRolesPermissionsLogsJSON struct {
+ Read apijson.Field
+ Write apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AccountMemberWithIDRolesPermissionsLogs) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r accountMemberWithIDRolesPermissionsLogsJSON) RawJSON() string {
+ return r.raw
+}
+
+type AccountMemberWithIDRolesPermissionsOrganization struct {
+ Read bool `json:"read"`
+ Write bool `json:"write"`
+ JSON accountMemberWithIDRolesPermissionsOrganizationJSON `json:"-"`
+}
+
+// accountMemberWithIDRolesPermissionsOrganizationJSON contains the JSON metadata
+// for the struct [AccountMemberWithIDRolesPermissionsOrganization]
+type accountMemberWithIDRolesPermissionsOrganizationJSON struct {
+ Read apijson.Field
+ Write apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AccountMemberWithIDRolesPermissionsOrganization) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r accountMemberWithIDRolesPermissionsOrganizationJSON) RawJSON() string {
+ return r.raw
+}
+
+type AccountMemberWithIDRolesPermissionsSSL struct {
+ Read bool `json:"read"`
+ Write bool `json:"write"`
+ JSON accountMemberWithIDRolesPermissionsSSLJSON `json:"-"`
+}
+
+// accountMemberWithIDRolesPermissionsSSLJSON contains the JSON metadata for the
+// struct [AccountMemberWithIDRolesPermissionsSSL]
+type accountMemberWithIDRolesPermissionsSSLJSON struct {
+ Read apijson.Field
+ Write apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AccountMemberWithIDRolesPermissionsSSL) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r accountMemberWithIDRolesPermissionsSSLJSON) RawJSON() string {
+ return r.raw
+}
+
+type AccountMemberWithIDRolesPermissionsWAF struct {
+ Read bool `json:"read"`
+ Write bool `json:"write"`
+ JSON accountMemberWithIDRolesPermissionsWAFJSON `json:"-"`
+}
+
+// accountMemberWithIDRolesPermissionsWAFJSON contains the JSON metadata for the
+// struct [AccountMemberWithIDRolesPermissionsWAF]
+type accountMemberWithIDRolesPermissionsWAFJSON struct {
+ Read apijson.Field
+ Write apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AccountMemberWithIDRolesPermissionsWAF) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r accountMemberWithIDRolesPermissionsWAFJSON) RawJSON() string {
+ return r.raw
+}
+
+type AccountMemberWithIDRolesPermissionsZoneSettings struct {
+ Read bool `json:"read"`
+ Write bool `json:"write"`
+ JSON accountMemberWithIDRolesPermissionsZoneSettingsJSON `json:"-"`
+}
+
+// accountMemberWithIDRolesPermissionsZoneSettingsJSON contains the JSON metadata
+// for the struct [AccountMemberWithIDRolesPermissionsZoneSettings]
+type accountMemberWithIDRolesPermissionsZoneSettingsJSON struct {
+ Read apijson.Field
+ Write apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AccountMemberWithIDRolesPermissionsZoneSettings) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r accountMemberWithIDRolesPermissionsZoneSettingsJSON) RawJSON() string {
+ return r.raw
+}
+
+type AccountMemberWithIDRolesPermissionsZones struct {
+ Read bool `json:"read"`
+ Write bool `json:"write"`
+ JSON accountMemberWithIDRolesPermissionsZonesJSON `json:"-"`
+}
+
+// accountMemberWithIDRolesPermissionsZonesJSON contains the JSON metadata for the
+// struct [AccountMemberWithIDRolesPermissionsZones]
+type accountMemberWithIDRolesPermissionsZonesJSON struct {
+ Read apijson.Field
+ Write apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AccountMemberWithIDRolesPermissionsZones) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r accountMemberWithIDRolesPermissionsZonesJSON) RawJSON() string {
+ return r.raw
+}
+
+type AccountMemberWithIDUser struct {
+ // The contact email address of the user.
+ Email string `json:"email,required"`
+ // Identifier
+ ID string `json:"id"`
+ // User's first name
+ FirstName string `json:"first_name,nullable"`
+ // User's last name
+ LastName string `json:"last_name,nullable"`
+ // Indicates whether two-factor authentication is enabled for the user account.
+ // Does not apply to API authentication.
+ TwoFactorAuthenticationEnabled bool `json:"two_factor_authentication_enabled"`
+ JSON accountMemberWithIDUserJSON `json:"-"`
+}
+
+// accountMemberWithIDUserJSON contains the JSON metadata for the struct
+// [AccountMemberWithIDUser]
+type accountMemberWithIDUserJSON struct {
+ Email apijson.Field
+ ID apijson.Field
+ FirstName apijson.Field
+ LastName apijson.Field
+ TwoFactorAuthenticationEnabled apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AccountMemberWithIDUser) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r accountMemberWithIDUserJSON) RawJSON() string {
+ return r.raw
+}
+
+type MemberListResponse struct {
+ // Identifier
+ ID string `json:"id,required"`
+ // The contact email address of the user.
+ Email string `json:"email,required"`
+ // Member Name.
+ Name string `json:"name,required,nullable"`
+ // Roles assigned to this Member.
+ Roles []IamSchemasRole `json:"roles,required"`
+ // A member's status in the organization.
+ Status MemberListResponseStatus `json:"status,required"`
+ JSON memberListResponseJSON `json:"-"`
+}
+
+// memberListResponseJSON contains the JSON metadata for the struct
+// [MemberListResponse]
+type memberListResponseJSON struct {
+ ID apijson.Field
+ Email apijson.Field
+ Name apijson.Field
+ Roles apijson.Field
+ Status apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *MemberListResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r memberListResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+// A member's status in the organization.
+type MemberListResponseStatus string
+
+const (
+ MemberListResponseStatusAccepted MemberListResponseStatus = "accepted"
+ MemberListResponseStatusInvited MemberListResponseStatus = "invited"
+)
+
+type MemberDeleteResponse struct {
+ // Identifier
+ ID string `json:"id,required"`
+ JSON memberDeleteResponseJSON `json:"-"`
+}
+
+// memberDeleteResponseJSON contains the JSON metadata for the struct
+// [MemberDeleteResponse]
+type memberDeleteResponseJSON struct {
+ ID apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *MemberDeleteResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r memberDeleteResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type MemberNewParams struct {
+ AccountID param.Field[interface{}] `path:"account_id,required"`
+ // The contact email address of the user.
+ Email param.Field[string] `json:"email,required"`
+ // Array of roles associated with this member.
+ Roles param.Field[[]string] `json:"roles,required"`
+ Status param.Field[MemberNewParamsStatus] `json:"status"`
+}
+
+func (r MemberNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type MemberNewParamsStatus string
+
+const (
+ MemberNewParamsStatusAccepted MemberNewParamsStatus = "accepted"
+ MemberNewParamsStatusPending MemberNewParamsStatus = "pending"
+)
+
+type MemberNewResponseEnvelope struct {
+ Errors []MemberNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []MemberNewResponseEnvelopeMessages `json:"messages,required"`
+ Result AccountMemberWithID `json:"result,required"`
+ // Whether the API call was successful
+ Success MemberNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON memberNewResponseEnvelopeJSON `json:"-"`
+}
+
+// memberNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [MemberNewResponseEnvelope]
+type memberNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *MemberNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r memberNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type MemberNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON memberNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// memberNewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [MemberNewResponseEnvelopeErrors]
+type memberNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *MemberNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r memberNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type MemberNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON memberNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// memberNewResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [MemberNewResponseEnvelopeMessages]
+type memberNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *MemberNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r memberNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type MemberNewResponseEnvelopeSuccess bool
+
+const (
+ MemberNewResponseEnvelopeSuccessTrue MemberNewResponseEnvelopeSuccess = true
+)
+
+type MemberUpdateParams struct {
+ AccountID param.Field[interface{}] `path:"account_id,required"`
+ // Roles assigned to this member.
+ Roles param.Field[[]MemberUpdateParamsRole] `json:"roles,required"`
+}
+
+func (r MemberUpdateParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type MemberUpdateParamsRole struct {
+ // Role identifier tag.
+ ID param.Field[string] `json:"id,required"`
+}
+
+func (r MemberUpdateParamsRole) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type MemberUpdateParamsRolesPermissions struct {
+ Analytics param.Field[MemberUpdateParamsRolesPermissionsAnalytics] `json:"analytics"`
+ Billing param.Field[MemberUpdateParamsRolesPermissionsBilling] `json:"billing"`
+ CachePurge param.Field[MemberUpdateParamsRolesPermissionsCachePurge] `json:"cache_purge"`
+ DNS param.Field[MemberUpdateParamsRolesPermissionsDNS] `json:"dns"`
+ DNSRecords param.Field[MemberUpdateParamsRolesPermissionsDNSRecords] `json:"dns_records"`
+ Lb param.Field[MemberUpdateParamsRolesPermissionsLb] `json:"lb"`
+ Logs param.Field[MemberUpdateParamsRolesPermissionsLogs] `json:"logs"`
+ Organization param.Field[MemberUpdateParamsRolesPermissionsOrganization] `json:"organization"`
+ SSL param.Field[MemberUpdateParamsRolesPermissionsSSL] `json:"ssl"`
+ WAF param.Field[MemberUpdateParamsRolesPermissionsWAF] `json:"waf"`
+ ZoneSettings param.Field[MemberUpdateParamsRolesPermissionsZoneSettings] `json:"zone_settings"`
+ Zones param.Field[MemberUpdateParamsRolesPermissionsZones] `json:"zones"`
+}
+
+func (r MemberUpdateParamsRolesPermissions) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type MemberUpdateParamsRolesPermissionsAnalytics struct {
+ Read param.Field[bool] `json:"read"`
+ Write param.Field[bool] `json:"write"`
+}
+
+func (r MemberUpdateParamsRolesPermissionsAnalytics) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type MemberUpdateParamsRolesPermissionsBilling struct {
+ Read param.Field[bool] `json:"read"`
+ Write param.Field[bool] `json:"write"`
+}
+
+func (r MemberUpdateParamsRolesPermissionsBilling) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type MemberUpdateParamsRolesPermissionsCachePurge struct {
+ Read param.Field[bool] `json:"read"`
+ Write param.Field[bool] `json:"write"`
+}
+
+func (r MemberUpdateParamsRolesPermissionsCachePurge) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type MemberUpdateParamsRolesPermissionsDNS struct {
+ Read param.Field[bool] `json:"read"`
+ Write param.Field[bool] `json:"write"`
+}
+
+func (r MemberUpdateParamsRolesPermissionsDNS) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type MemberUpdateParamsRolesPermissionsDNSRecords struct {
+ Read param.Field[bool] `json:"read"`
+ Write param.Field[bool] `json:"write"`
+}
+
+func (r MemberUpdateParamsRolesPermissionsDNSRecords) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type MemberUpdateParamsRolesPermissionsLb struct {
+ Read param.Field[bool] `json:"read"`
+ Write param.Field[bool] `json:"write"`
+}
+
+func (r MemberUpdateParamsRolesPermissionsLb) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type MemberUpdateParamsRolesPermissionsLogs struct {
+ Read param.Field[bool] `json:"read"`
+ Write param.Field[bool] `json:"write"`
+}
+
+func (r MemberUpdateParamsRolesPermissionsLogs) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type MemberUpdateParamsRolesPermissionsOrganization struct {
+ Read param.Field[bool] `json:"read"`
+ Write param.Field[bool] `json:"write"`
+}
+
+func (r MemberUpdateParamsRolesPermissionsOrganization) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type MemberUpdateParamsRolesPermissionsSSL struct {
+ Read param.Field[bool] `json:"read"`
+ Write param.Field[bool] `json:"write"`
+}
+
+func (r MemberUpdateParamsRolesPermissionsSSL) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type MemberUpdateParamsRolesPermissionsWAF struct {
+ Read param.Field[bool] `json:"read"`
+ Write param.Field[bool] `json:"write"`
+}
+
+func (r MemberUpdateParamsRolesPermissionsWAF) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type MemberUpdateParamsRolesPermissionsZoneSettings struct {
+ Read param.Field[bool] `json:"read"`
+ Write param.Field[bool] `json:"write"`
+}
+
+func (r MemberUpdateParamsRolesPermissionsZoneSettings) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type MemberUpdateParamsRolesPermissionsZones struct {
+ Read param.Field[bool] `json:"read"`
+ Write param.Field[bool] `json:"write"`
+}
+
+func (r MemberUpdateParamsRolesPermissionsZones) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type MemberUpdateResponseEnvelope struct {
+ Errors []MemberUpdateResponseEnvelopeErrors `json:"errors,required"`
+ Messages []MemberUpdateResponseEnvelopeMessages `json:"messages,required"`
+ Result AccountMember `json:"result,required"`
+ // Whether the API call was successful
+ Success MemberUpdateResponseEnvelopeSuccess `json:"success,required"`
+ JSON memberUpdateResponseEnvelopeJSON `json:"-"`
+}
+
+// memberUpdateResponseEnvelopeJSON contains the JSON metadata for the struct
+// [MemberUpdateResponseEnvelope]
+type memberUpdateResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *MemberUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r memberUpdateResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type MemberUpdateResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON memberUpdateResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// memberUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [MemberUpdateResponseEnvelopeErrors]
+type memberUpdateResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *MemberUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r memberUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type MemberUpdateResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON memberUpdateResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// memberUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [MemberUpdateResponseEnvelopeMessages]
+type memberUpdateResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *MemberUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r memberUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type MemberUpdateResponseEnvelopeSuccess bool
+
+const (
+ MemberUpdateResponseEnvelopeSuccessTrue MemberUpdateResponseEnvelopeSuccess = true
+)
+
+type MemberListParams struct {
+ AccountID param.Field[interface{}] `path:"account_id,required"`
+ // Direction to order results.
+ Direction param.Field[MemberListParamsDirection] `query:"direction"`
+ // Field to order results by.
+ Order param.Field[MemberListParamsOrder] `query:"order"`
+ // Page number of paginated results.
+ Page param.Field[float64] `query:"page"`
+ // Maximum number of results per page.
+ PerPage param.Field[float64] `query:"per_page"`
+ // A member's status in the account.
+ Status param.Field[MemberListParamsStatus] `query:"status"`
+}
+
+// URLQuery serializes [MemberListParams]'s query parameters as `url.Values`.
+func (r MemberListParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Direction to order results.
+type MemberListParamsDirection string
+
+const (
+ MemberListParamsDirectionAsc MemberListParamsDirection = "asc"
+ MemberListParamsDirectionDesc MemberListParamsDirection = "desc"
+)
+
+// Field to order results by.
+type MemberListParamsOrder string
+
+const (
+ MemberListParamsOrderUserFirstName MemberListParamsOrder = "user.first_name"
+ MemberListParamsOrderUserLastName MemberListParamsOrder = "user.last_name"
+ MemberListParamsOrderUserEmail MemberListParamsOrder = "user.email"
+ MemberListParamsOrderStatus MemberListParamsOrder = "status"
+)
+
+// A member's status in the account.
+type MemberListParamsStatus string
+
+const (
+ MemberListParamsStatusAccepted MemberListParamsStatus = "accepted"
+ MemberListParamsStatusPending MemberListParamsStatus = "pending"
+ MemberListParamsStatusRejected MemberListParamsStatus = "rejected"
+)
+
+type MemberDeleteParams struct {
+ AccountID param.Field[interface{}] `path:"account_id,required"`
+}
+
+type MemberDeleteResponseEnvelope struct {
+ Errors []MemberDeleteResponseEnvelopeErrors `json:"errors,required"`
+ Messages []MemberDeleteResponseEnvelopeMessages `json:"messages,required"`
+ Result MemberDeleteResponse `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success MemberDeleteResponseEnvelopeSuccess `json:"success,required"`
+ JSON memberDeleteResponseEnvelopeJSON `json:"-"`
+}
+
+// memberDeleteResponseEnvelopeJSON contains the JSON metadata for the struct
+// [MemberDeleteResponseEnvelope]
+type memberDeleteResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *MemberDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r memberDeleteResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type MemberDeleteResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON memberDeleteResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// memberDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [MemberDeleteResponseEnvelopeErrors]
+type memberDeleteResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *MemberDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r memberDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type MemberDeleteResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON memberDeleteResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// memberDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [MemberDeleteResponseEnvelopeMessages]
+type memberDeleteResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *MemberDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r memberDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type MemberDeleteResponseEnvelopeSuccess bool
+
+const (
+ MemberDeleteResponseEnvelopeSuccessTrue MemberDeleteResponseEnvelopeSuccess = true
+)
+
+type MemberGetParams struct {
+ AccountID param.Field[interface{}] `path:"account_id,required"`
+}
+
+type MemberGetResponseEnvelope struct {
+ Errors []MemberGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []MemberGetResponseEnvelopeMessages `json:"messages,required"`
+ Result AccountMember `json:"result,required"`
+ // Whether the API call was successful
+ Success MemberGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON memberGetResponseEnvelopeJSON `json:"-"`
+}
+
+// memberGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [MemberGetResponseEnvelope]
+type memberGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *MemberGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r memberGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type MemberGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON memberGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// memberGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [MemberGetResponseEnvelopeErrors]
+type memberGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *MemberGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r memberGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type MemberGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON memberGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// memberGetResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [MemberGetResponseEnvelopeMessages]
+type memberGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *MemberGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r memberGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type MemberGetResponseEnvelopeSuccess bool
+
+const (
+ MemberGetResponseEnvelopeSuccessTrue MemberGetResponseEnvelopeSuccess = true
+)
diff --git a/accounts/member_test.go b/accounts/member_test.go
new file mode 100644
index 00000000000..cfdac07ebef
--- /dev/null
+++ b/accounts/member_test.go
@@ -0,0 +1,172 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package accounts_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/accounts"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestMemberNewWithOptionalParams(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"),
+ )
+ _, err := client.Accounts.Members.New(context.TODO(), accounts.MemberNewParams{
+ AccountID: cloudflare.F[any](map[string]interface{}{}),
+ Email: cloudflare.F("user@example.com"),
+ Roles: cloudflare.F([]string{"3536bcfad5faccb999b47003c79917fb", "3536bcfad5faccb999b47003c79917fb", "3536bcfad5faccb999b47003c79917fb"}),
+ Status: cloudflare.F(accounts.MemberNewParamsStatusAccepted),
+ })
+ 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())
+ }
+}
+
+func TestMemberUpdate(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"),
+ )
+ _, err := client.Accounts.Members.Update(
+ context.TODO(),
+ "4536bcfad5faccb111b47003c79917fa",
+ accounts.MemberUpdateParams{
+ AccountID: cloudflare.F[any](map[string]interface{}{}),
+ Roles: cloudflare.F([]accounts.MemberUpdateParamsRole{{
+ ID: cloudflare.F("3536bcfad5faccb999b47003c79917fb"),
+ }, {
+ ID: cloudflare.F("3536bcfad5faccb999b47003c79917fb"),
+ }, {
+ ID: cloudflare.F("3536bcfad5faccb999b47003c79917fb"),
+ }}),
+ },
+ )
+ 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())
+ }
+}
+
+func TestMemberListWithOptionalParams(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"),
+ )
+ _, err := client.Accounts.Members.List(context.TODO(), accounts.MemberListParams{
+ AccountID: cloudflare.F[any](map[string]interface{}{}),
+ Direction: cloudflare.F(accounts.MemberListParamsDirectionDesc),
+ Order: cloudflare.F(accounts.MemberListParamsOrderStatus),
+ Page: cloudflare.F(1.000000),
+ PerPage: cloudflare.F(5.000000),
+ Status: cloudflare.F(accounts.MemberListParamsStatusAccepted),
+ })
+ 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())
+ }
+}
+
+func TestMemberDelete(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"),
+ )
+ _, err := client.Accounts.Members.Delete(
+ context.TODO(),
+ "4536bcfad5faccb111b47003c79917fa",
+ accounts.MemberDeleteParams{
+ AccountID: cloudflare.F[any](map[string]interface{}{}),
+ },
+ )
+ 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())
+ }
+}
+
+func TestMemberGet(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"),
+ )
+ _, err := client.Accounts.Members.Get(
+ context.TODO(),
+ "4536bcfad5faccb111b47003c79917fa",
+ accounts.MemberGetParams{
+ AccountID: cloudflare.F[any](map[string]interface{}{}),
+ },
+ )
+ 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/accounts/role.go b/accounts/role.go
new file mode 100644
index 00000000000..1217d22e191
--- /dev/null
+++ b/accounts/role.go
@@ -0,0 +1,309 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package accounts
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "reflect"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/tidwall/gjson"
+)
+
+// RoleService contains methods and other services that help with interacting with
+// the cloudflare API. Note, unlike clients, this service does not read variables
+// from the environment automatically. You should not instantiate this service
+// directly, and instead use the [NewRoleService] method instead.
+type RoleService struct {
+ Options []option.RequestOption
+}
+
+// NewRoleService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewRoleService(opts ...option.RequestOption) (r *RoleService) {
+ r = &RoleService{}
+ r.Options = opts
+ return
+}
+
+// Get all available roles for an account.
+func (r *RoleService) List(ctx context.Context, query RoleListParams, opts ...option.RequestOption) (res *[]IamSchemasRole, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RoleListResponseEnvelope
+ path := fmt.Sprintf("accounts/%v/roles", query.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Get information about a specific role for an account.
+func (r *RoleService) Get(ctx context.Context, roleID interface{}, query RoleGetParams, opts ...option.RequestOption) (res *RoleGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RoleGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%v/roles/%v", query.AccountID, roleID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type IamSchemasRole struct {
+ // Role identifier tag.
+ ID string `json:"id,required"`
+ // Description of role's permissions.
+ Description string `json:"description,required"`
+ // Role Name.
+ Name string `json:"name,required"`
+ // Access permissions for this User.
+ Permissions []string `json:"permissions,required"`
+ JSON iamSchemasRoleJSON `json:"-"`
+}
+
+// iamSchemasRoleJSON contains the JSON metadata for the struct [IamSchemasRole]
+type iamSchemasRoleJSON struct {
+ ID apijson.Field
+ Description apijson.Field
+ Name apijson.Field
+ Permissions apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IamSchemasRole) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r iamSchemasRoleJSON) RawJSON() string {
+ return r.raw
+}
+
+// Union satisfied by [accounts.RoleGetResponseUnknown] or [shared.UnionString].
+type RoleGetResponse interface {
+ ImplementsAccountsRoleGetResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RoleGetResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+type RoleListParams struct {
+ AccountID param.Field[interface{}] `path:"account_id,required"`
+}
+
+type RoleListResponseEnvelope struct {
+ Errors []RoleListResponseEnvelopeErrors `json:"errors,required"`
+ Messages []RoleListResponseEnvelopeMessages `json:"messages,required"`
+ Result []IamSchemasRole `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success RoleListResponseEnvelopeSuccess `json:"success,required"`
+ ResultInfo RoleListResponseEnvelopeResultInfo `json:"result_info"`
+ JSON roleListResponseEnvelopeJSON `json:"-"`
+}
+
+// roleListResponseEnvelopeJSON contains the JSON metadata for the struct
+// [RoleListResponseEnvelope]
+type roleListResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ ResultInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RoleListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r roleListResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type RoleListResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON roleListResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// roleListResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [RoleListResponseEnvelopeErrors]
+type roleListResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RoleListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r roleListResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type RoleListResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON roleListResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// roleListResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [RoleListResponseEnvelopeMessages]
+type roleListResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RoleListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r roleListResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type RoleListResponseEnvelopeSuccess bool
+
+const (
+ RoleListResponseEnvelopeSuccessTrue RoleListResponseEnvelopeSuccess = true
+)
+
+type RoleListResponseEnvelopeResultInfo struct {
+ // Total number of results for the requested service
+ Count float64 `json:"count"`
+ // Current page within paginated list of results
+ Page float64 `json:"page"`
+ // Number of results per page of results
+ PerPage float64 `json:"per_page"`
+ // Total results available without any search parameters
+ TotalCount float64 `json:"total_count"`
+ JSON roleListResponseEnvelopeResultInfoJSON `json:"-"`
+}
+
+// roleListResponseEnvelopeResultInfoJSON contains the JSON metadata for the struct
+// [RoleListResponseEnvelopeResultInfo]
+type roleListResponseEnvelopeResultInfoJSON struct {
+ Count apijson.Field
+ Page apijson.Field
+ PerPage apijson.Field
+ TotalCount apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RoleListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r roleListResponseEnvelopeResultInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type RoleGetParams struct {
+ AccountID param.Field[interface{}] `path:"account_id,required"`
+}
+
+type RoleGetResponseEnvelope struct {
+ Errors []RoleGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []RoleGetResponseEnvelopeMessages `json:"messages,required"`
+ Result RoleGetResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success RoleGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON roleGetResponseEnvelopeJSON `json:"-"`
+}
+
+// roleGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [RoleGetResponseEnvelope]
+type roleGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RoleGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r roleGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type RoleGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON roleGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// roleGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [RoleGetResponseEnvelopeErrors]
+type roleGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RoleGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r roleGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type RoleGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON roleGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// roleGetResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [RoleGetResponseEnvelopeMessages]
+type roleGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RoleGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r roleGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type RoleGetResponseEnvelopeSuccess bool
+
+const (
+ RoleGetResponseEnvelopeSuccessTrue RoleGetResponseEnvelopeSuccess = true
+)
diff --git a/accounts/role_test.go b/accounts/role_test.go
new file mode 100644
index 00000000000..b5653bdec1c
--- /dev/null
+++ b/accounts/role_test.go
@@ -0,0 +1,71 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package accounts_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/accounts"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestRoleList(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"),
+ )
+ _, err := client.Accounts.Roles.List(context.TODO(), accounts.RoleListParams{
+ AccountID: cloudflare.F[any](map[string]interface{}{}),
+ })
+ 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())
+ }
+}
+
+func TestRoleGet(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"),
+ )
+ _, err := client.Accounts.Roles.Get(
+ context.TODO(),
+ map[string]interface{}{},
+ accounts.RoleGetParams{
+ AccountID: cloudflare.F[any](map[string]interface{}{}),
+ },
+ )
+ 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/acm.go b/acm/acm.go
similarity index 89%
rename from acm.go
rename to acm/acm.go
index 74f0a995f7e..7c041287b56 100644
--- a/acm.go
+++ b/acm/acm.go
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package cloudflare
+package acm
import (
"github.com/cloudflare/cloudflare-go/option"
@@ -12,7 +12,7 @@ import (
// directly, and instead use the [NewACMService] method instead.
type ACMService struct {
Options []option.RequestOption
- TotalTLS *ACMTotalTLSService
+ TotalTLS *TotalTLSService
}
// NewACMService generates a new service that applies the given options to each
@@ -21,6 +21,6 @@ type ACMService struct {
func NewACMService(opts ...option.RequestOption) (r *ACMService) {
r = &ACMService{}
r.Options = opts
- r.TotalTLS = NewACMTotalTLSService(opts...)
+ r.TotalTLS = NewTotalTLSService(opts...)
return
}
diff --git a/acm/aliases.go b/acm/aliases.go
new file mode 100644
index 00000000000..4bfeb01e040
--- /dev/null
+++ b/acm/aliases.go
@@ -0,0 +1,9 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package acm
+
+import (
+ "github.com/cloudflare/cloudflare-go/internal/apierror"
+)
+
+type Error = apierror.Error
diff --git a/acm/totaltls.go b/acm/totaltls.go
new file mode 100644
index 00000000000..1d27c9247de
--- /dev/null
+++ b/acm/totaltls.go
@@ -0,0 +1,334 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package acm
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// TotalTLSService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewTotalTLSService] method instead.
+type TotalTLSService struct {
+ Options []option.RequestOption
+}
+
+// NewTotalTLSService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewTotalTLSService(opts ...option.RequestOption) (r *TotalTLSService) {
+ r = &TotalTLSService{}
+ r.Options = opts
+ return
+}
+
+// Set Total TLS Settings or disable the feature for a Zone.
+func (r *TotalTLSService) New(ctx context.Context, params TotalTLSNewParams, opts ...option.RequestOption) (res *TotalTLSNewResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env TotalTLSNewResponseEnvelope
+ path := fmt.Sprintf("zones/%s/acm/total_tls", params.ZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Get Total TLS Settings for a Zone.
+func (r *TotalTLSService) Get(ctx context.Context, query TotalTLSGetParams, opts ...option.RequestOption) (res *TotalTLSGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env TotalTLSGetResponseEnvelope
+ path := fmt.Sprintf("zones/%s/acm/total_tls", query.ZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type TotalTLSNewResponse struct {
+ // The Certificate Authority that Total TLS certificates will be issued through.
+ CertificateAuthority TotalTLSNewResponseCertificateAuthority `json:"certificate_authority"`
+ // If enabled, Total TLS will order a hostname specific TLS certificate for any
+ // proxied A, AAAA, or CNAME record in your zone.
+ Enabled bool `json:"enabled"`
+ // The validity period in days for the certificates ordered via Total TLS.
+ ValidityDays TotalTLSNewResponseValidityDays `json:"validity_days"`
+ JSON totalTLSNewResponseJSON `json:"-"`
+}
+
+// totalTLSNewResponseJSON contains the JSON metadata for the struct
+// [TotalTLSNewResponse]
+type totalTLSNewResponseJSON struct {
+ CertificateAuthority apijson.Field
+ Enabled apijson.Field
+ ValidityDays apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *TotalTLSNewResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r totalTLSNewResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+// The Certificate Authority that Total TLS certificates will be issued through.
+type TotalTLSNewResponseCertificateAuthority string
+
+const (
+ TotalTLSNewResponseCertificateAuthorityGoogle TotalTLSNewResponseCertificateAuthority = "google"
+ TotalTLSNewResponseCertificateAuthorityLetsEncrypt TotalTLSNewResponseCertificateAuthority = "lets_encrypt"
+)
+
+// The validity period in days for the certificates ordered via Total TLS.
+type TotalTLSNewResponseValidityDays int64
+
+const (
+ TotalTLSNewResponseValidityDays90 TotalTLSNewResponseValidityDays = 90
+)
+
+type TotalTLSGetResponse struct {
+ // The Certificate Authority that Total TLS certificates will be issued through.
+ CertificateAuthority TotalTLSGetResponseCertificateAuthority `json:"certificate_authority"`
+ // If enabled, Total TLS will order a hostname specific TLS certificate for any
+ // proxied A, AAAA, or CNAME record in your zone.
+ Enabled bool `json:"enabled"`
+ // The validity period in days for the certificates ordered via Total TLS.
+ ValidityDays TotalTLSGetResponseValidityDays `json:"validity_days"`
+ JSON totalTLSGetResponseJSON `json:"-"`
+}
+
+// totalTLSGetResponseJSON contains the JSON metadata for the struct
+// [TotalTLSGetResponse]
+type totalTLSGetResponseJSON struct {
+ CertificateAuthority apijson.Field
+ Enabled apijson.Field
+ ValidityDays apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *TotalTLSGetResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r totalTLSGetResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+// The Certificate Authority that Total TLS certificates will be issued through.
+type TotalTLSGetResponseCertificateAuthority string
+
+const (
+ TotalTLSGetResponseCertificateAuthorityGoogle TotalTLSGetResponseCertificateAuthority = "google"
+ TotalTLSGetResponseCertificateAuthorityLetsEncrypt TotalTLSGetResponseCertificateAuthority = "lets_encrypt"
+)
+
+// The validity period in days for the certificates ordered via Total TLS.
+type TotalTLSGetResponseValidityDays int64
+
+const (
+ TotalTLSGetResponseValidityDays90 TotalTLSGetResponseValidityDays = 90
+)
+
+type TotalTLSNewParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+ // If enabled, Total TLS will order a hostname specific TLS certificate for any
+ // proxied A, AAAA, or CNAME record in your zone.
+ Enabled param.Field[bool] `json:"enabled,required"`
+ // The Certificate Authority that Total TLS certificates will be issued through.
+ CertificateAuthority param.Field[TotalTLSNewParamsCertificateAuthority] `json:"certificate_authority"`
+}
+
+func (r TotalTLSNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The Certificate Authority that Total TLS certificates will be issued through.
+type TotalTLSNewParamsCertificateAuthority string
+
+const (
+ TotalTLSNewParamsCertificateAuthorityGoogle TotalTLSNewParamsCertificateAuthority = "google"
+ TotalTLSNewParamsCertificateAuthorityLetsEncrypt TotalTLSNewParamsCertificateAuthority = "lets_encrypt"
+)
+
+type TotalTLSNewResponseEnvelope struct {
+ Errors []TotalTLSNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []TotalTLSNewResponseEnvelopeMessages `json:"messages,required"`
+ Result TotalTLSNewResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success TotalTLSNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON totalTLSNewResponseEnvelopeJSON `json:"-"`
+}
+
+// totalTLSNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [TotalTLSNewResponseEnvelope]
+type totalTLSNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *TotalTLSNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r totalTLSNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type TotalTLSNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON totalTLSNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// totalTLSNewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [TotalTLSNewResponseEnvelopeErrors]
+type totalTLSNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *TotalTLSNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r totalTLSNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type TotalTLSNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON totalTLSNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// totalTLSNewResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [TotalTLSNewResponseEnvelopeMessages]
+type totalTLSNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *TotalTLSNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r totalTLSNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type TotalTLSNewResponseEnvelopeSuccess bool
+
+const (
+ TotalTLSNewResponseEnvelopeSuccessTrue TotalTLSNewResponseEnvelopeSuccess = true
+)
+
+type TotalTLSGetParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+}
+
+type TotalTLSGetResponseEnvelope struct {
+ Errors []TotalTLSGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []TotalTLSGetResponseEnvelopeMessages `json:"messages,required"`
+ Result TotalTLSGetResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success TotalTLSGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON totalTLSGetResponseEnvelopeJSON `json:"-"`
+}
+
+// totalTLSGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [TotalTLSGetResponseEnvelope]
+type totalTLSGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *TotalTLSGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r totalTLSGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type TotalTLSGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON totalTLSGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// totalTLSGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [TotalTLSGetResponseEnvelopeErrors]
+type totalTLSGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *TotalTLSGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r totalTLSGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type TotalTLSGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON totalTLSGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// totalTLSGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [TotalTLSGetResponseEnvelopeMessages]
+type totalTLSGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *TotalTLSGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r totalTLSGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type TotalTLSGetResponseEnvelopeSuccess bool
+
+const (
+ TotalTLSGetResponseEnvelopeSuccessTrue TotalTLSGetResponseEnvelopeSuccess = true
+)
diff --git a/acm/totaltls_test.go b/acm/totaltls_test.go
new file mode 100644
index 00000000000..e4db864972f
--- /dev/null
+++ b/acm/totaltls_test.go
@@ -0,0 +1,69 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package acm_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/acm"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestTotalTLSNewWithOptionalParams(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"),
+ )
+ _, err := client.ACM.TotalTLS.New(context.TODO(), acm.TotalTLSNewParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Enabled: cloudflare.F(true),
+ CertificateAuthority: cloudflare.F(acm.TotalTLSNewParamsCertificateAuthorityGoogle),
+ })
+ 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())
+ }
+}
+
+func TestTotalTLSGet(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"),
+ )
+ _, err := client.ACM.TotalTLS.Get(context.TODO(), acm.TotalTLSGetParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ })
+ 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/acmtotaltls.go b/acmtotaltls.go
deleted file mode 100644
index 59ee21aab92..00000000000
--- a/acmtotaltls.go
+++ /dev/null
@@ -1,335 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// ACMTotalTLSService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewACMTotalTLSService] method
-// instead.
-type ACMTotalTLSService struct {
- Options []option.RequestOption
-}
-
-// NewACMTotalTLSService generates a new service that applies the given options to
-// each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewACMTotalTLSService(opts ...option.RequestOption) (r *ACMTotalTLSService) {
- r = &ACMTotalTLSService{}
- r.Options = opts
- return
-}
-
-// Set Total TLS Settings or disable the feature for a Zone.
-func (r *ACMTotalTLSService) New(ctx context.Context, params ACMTotalTLSNewParams, opts ...option.RequestOption) (res *ACMTotalTLSNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env ACMTotalTLSNewResponseEnvelope
- path := fmt.Sprintf("zones/%s/acm/total_tls", params.ZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Get Total TLS Settings for a Zone.
-func (r *ACMTotalTLSService) Get(ctx context.Context, query ACMTotalTLSGetParams, opts ...option.RequestOption) (res *ACMTotalTLSGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env ACMTotalTLSGetResponseEnvelope
- path := fmt.Sprintf("zones/%s/acm/total_tls", query.ZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type ACMTotalTLSNewResponse struct {
- // The Certificate Authority that Total TLS certificates will be issued through.
- CertificateAuthority ACMTotalTLSNewResponseCertificateAuthority `json:"certificate_authority"`
- // If enabled, Total TLS will order a hostname specific TLS certificate for any
- // proxied A, AAAA, or CNAME record in your zone.
- Enabled bool `json:"enabled"`
- // The validity period in days for the certificates ordered via Total TLS.
- ValidityDays ACMTotalTLSNewResponseValidityDays `json:"validity_days"`
- JSON acmTotalTLSNewResponseJSON `json:"-"`
-}
-
-// acmTotalTLSNewResponseJSON contains the JSON metadata for the struct
-// [ACMTotalTLSNewResponse]
-type acmTotalTLSNewResponseJSON struct {
- CertificateAuthority apijson.Field
- Enabled apijson.Field
- ValidityDays apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ACMTotalTLSNewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r acmTotalTLSNewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// The Certificate Authority that Total TLS certificates will be issued through.
-type ACMTotalTLSNewResponseCertificateAuthority string
-
-const (
- ACMTotalTLSNewResponseCertificateAuthorityGoogle ACMTotalTLSNewResponseCertificateAuthority = "google"
- ACMTotalTLSNewResponseCertificateAuthorityLetsEncrypt ACMTotalTLSNewResponseCertificateAuthority = "lets_encrypt"
-)
-
-// The validity period in days for the certificates ordered via Total TLS.
-type ACMTotalTLSNewResponseValidityDays int64
-
-const (
- ACMTotalTLSNewResponseValidityDays90 ACMTotalTLSNewResponseValidityDays = 90
-)
-
-type ACMTotalTLSGetResponse struct {
- // The Certificate Authority that Total TLS certificates will be issued through.
- CertificateAuthority ACMTotalTLSGetResponseCertificateAuthority `json:"certificate_authority"`
- // If enabled, Total TLS will order a hostname specific TLS certificate for any
- // proxied A, AAAA, or CNAME record in your zone.
- Enabled bool `json:"enabled"`
- // The validity period in days for the certificates ordered via Total TLS.
- ValidityDays ACMTotalTLSGetResponseValidityDays `json:"validity_days"`
- JSON acmTotalTLSGetResponseJSON `json:"-"`
-}
-
-// acmTotalTLSGetResponseJSON contains the JSON metadata for the struct
-// [ACMTotalTLSGetResponse]
-type acmTotalTLSGetResponseJSON struct {
- CertificateAuthority apijson.Field
- Enabled apijson.Field
- ValidityDays apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ACMTotalTLSGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r acmTotalTLSGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// The Certificate Authority that Total TLS certificates will be issued through.
-type ACMTotalTLSGetResponseCertificateAuthority string
-
-const (
- ACMTotalTLSGetResponseCertificateAuthorityGoogle ACMTotalTLSGetResponseCertificateAuthority = "google"
- ACMTotalTLSGetResponseCertificateAuthorityLetsEncrypt ACMTotalTLSGetResponseCertificateAuthority = "lets_encrypt"
-)
-
-// The validity period in days for the certificates ordered via Total TLS.
-type ACMTotalTLSGetResponseValidityDays int64
-
-const (
- ACMTotalTLSGetResponseValidityDays90 ACMTotalTLSGetResponseValidityDays = 90
-)
-
-type ACMTotalTLSNewParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
- // If enabled, Total TLS will order a hostname specific TLS certificate for any
- // proxied A, AAAA, or CNAME record in your zone.
- Enabled param.Field[bool] `json:"enabled,required"`
- // The Certificate Authority that Total TLS certificates will be issued through.
- CertificateAuthority param.Field[ACMTotalTLSNewParamsCertificateAuthority] `json:"certificate_authority"`
-}
-
-func (r ACMTotalTLSNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The Certificate Authority that Total TLS certificates will be issued through.
-type ACMTotalTLSNewParamsCertificateAuthority string
-
-const (
- ACMTotalTLSNewParamsCertificateAuthorityGoogle ACMTotalTLSNewParamsCertificateAuthority = "google"
- ACMTotalTLSNewParamsCertificateAuthorityLetsEncrypt ACMTotalTLSNewParamsCertificateAuthority = "lets_encrypt"
-)
-
-type ACMTotalTLSNewResponseEnvelope struct {
- Errors []ACMTotalTLSNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []ACMTotalTLSNewResponseEnvelopeMessages `json:"messages,required"`
- Result ACMTotalTLSNewResponse `json:"result,required"`
- // Whether the API call was successful
- Success ACMTotalTLSNewResponseEnvelopeSuccess `json:"success,required"`
- JSON acmTotalTLSNewResponseEnvelopeJSON `json:"-"`
-}
-
-// acmTotalTLSNewResponseEnvelopeJSON contains the JSON metadata for the struct
-// [ACMTotalTLSNewResponseEnvelope]
-type acmTotalTLSNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ACMTotalTLSNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r acmTotalTLSNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type ACMTotalTLSNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON acmTotalTLSNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// acmTotalTLSNewResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [ACMTotalTLSNewResponseEnvelopeErrors]
-type acmTotalTLSNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ACMTotalTLSNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r acmTotalTLSNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type ACMTotalTLSNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON acmTotalTLSNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// acmTotalTLSNewResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [ACMTotalTLSNewResponseEnvelopeMessages]
-type acmTotalTLSNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ACMTotalTLSNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r acmTotalTLSNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type ACMTotalTLSNewResponseEnvelopeSuccess bool
-
-const (
- ACMTotalTLSNewResponseEnvelopeSuccessTrue ACMTotalTLSNewResponseEnvelopeSuccess = true
-)
-
-type ACMTotalTLSGetParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
-}
-
-type ACMTotalTLSGetResponseEnvelope struct {
- Errors []ACMTotalTLSGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []ACMTotalTLSGetResponseEnvelopeMessages `json:"messages,required"`
- Result ACMTotalTLSGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success ACMTotalTLSGetResponseEnvelopeSuccess `json:"success,required"`
- JSON acmTotalTLSGetResponseEnvelopeJSON `json:"-"`
-}
-
-// acmTotalTLSGetResponseEnvelopeJSON contains the JSON metadata for the struct
-// [ACMTotalTLSGetResponseEnvelope]
-type acmTotalTLSGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ACMTotalTLSGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r acmTotalTLSGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type ACMTotalTLSGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON acmTotalTLSGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// acmTotalTLSGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [ACMTotalTLSGetResponseEnvelopeErrors]
-type acmTotalTLSGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ACMTotalTLSGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r acmTotalTLSGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type ACMTotalTLSGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON acmTotalTLSGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// acmTotalTLSGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [ACMTotalTLSGetResponseEnvelopeMessages]
-type acmTotalTLSGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ACMTotalTLSGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r acmTotalTLSGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type ACMTotalTLSGetResponseEnvelopeSuccess bool
-
-const (
- ACMTotalTLSGetResponseEnvelopeSuccessTrue ACMTotalTLSGetResponseEnvelopeSuccess = true
-)
diff --git a/acmtotaltls_test.go b/acmtotaltls_test.go
deleted file mode 100644
index 79461ab98b3..00000000000
--- a/acmtotaltls_test.go
+++ /dev/null
@@ -1,68 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestACMTotalTLSNewWithOptionalParams(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"),
- )
- _, err := client.ACM.TotalTLS.New(context.TODO(), cloudflare.ACMTotalTLSNewParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Enabled: cloudflare.F(true),
- CertificateAuthority: cloudflare.F(cloudflare.ACMTotalTLSNewParamsCertificateAuthorityGoogle),
- })
- 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())
- }
-}
-
-func TestACMTotalTLSGet(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"),
- )
- _, err := client.ACM.TotalTLS.Get(context.TODO(), cloudflare.ACMTotalTLSGetParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- })
- 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/addressing.go b/addressing.go
deleted file mode 100644
index d48b5c32f56..00000000000
--- a/addressing.go
+++ /dev/null
@@ -1,32 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// AddressingService contains methods and other services that help with interacting
-// with the cloudflare API. Note, unlike clients, this service does not read
-// variables from the environment automatically. You should not instantiate this
-// service directly, and instead use the [NewAddressingService] method instead.
-type AddressingService struct {
- Options []option.RequestOption
- Services *AddressingServiceService
- AddressMaps *AddressingAddressMapService
- LOADocuments *AddressingLOADocumentService
- Prefixes *AddressingPrefixService
-}
-
-// NewAddressingService generates a new service that applies the given options to
-// each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewAddressingService(opts ...option.RequestOption) (r *AddressingService) {
- r = &AddressingService{}
- r.Options = opts
- r.Services = NewAddressingServiceService(opts...)
- r.AddressMaps = NewAddressingAddressMapService(opts...)
- r.LOADocuments = NewAddressingLOADocumentService(opts...)
- r.Prefixes = NewAddressingPrefixService(opts...)
- return
-}
diff --git a/addressing/addressing.go b/addressing/addressing.go
new file mode 100644
index 00000000000..a24739f7107
--- /dev/null
+++ b/addressing/addressing.go
@@ -0,0 +1,32 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package addressing
+
+import (
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// AddressingService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewAddressingService] method instead.
+type AddressingService struct {
+ Options []option.RequestOption
+ Services *ServiceService
+ AddressMaps *AddressMapService
+ LOADocuments *LOADocumentService
+ Prefixes *PrefixService
+}
+
+// NewAddressingService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewAddressingService(opts ...option.RequestOption) (r *AddressingService) {
+ r = &AddressingService{}
+ r.Options = opts
+ r.Services = NewServiceService(opts...)
+ r.AddressMaps = NewAddressMapService(opts...)
+ r.LOADocuments = NewLOADocumentService(opts...)
+ r.Prefixes = NewPrefixService(opts...)
+ return
+}
diff --git a/addressing/addressmap.go b/addressing/addressmap.go
new file mode 100644
index 00000000000..4c380d2d780
--- /dev/null
+++ b/addressing/addressmap.go
@@ -0,0 +1,939 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package addressing
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "reflect"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/tidwall/gjson"
+)
+
+// AddressMapService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewAddressMapService] method instead.
+type AddressMapService struct {
+ Options []option.RequestOption
+ Accounts *AddressMapAccountService
+ IPs *AddressMapIPService
+ Zones *AddressMapZoneService
+}
+
+// NewAddressMapService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewAddressMapService(opts ...option.RequestOption) (r *AddressMapService) {
+ r = &AddressMapService{}
+ r.Options = opts
+ r.Accounts = NewAddressMapAccountService(opts...)
+ r.IPs = NewAddressMapIPService(opts...)
+ r.Zones = NewAddressMapZoneService(opts...)
+ return
+}
+
+// Create a new address map under the account.
+func (r *AddressMapService) New(ctx context.Context, params AddressMapNewParams, opts ...option.RequestOption) (res *AddressMapNewResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AddressMapNewResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/addressing/address_maps", params.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// List all address maps owned by the account.
+func (r *AddressMapService) List(ctx context.Context, query AddressMapListParams, opts ...option.RequestOption) (res *[]AddressingAddressMaps, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AddressMapListResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/addressing/address_maps", query.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Delete a particular address map owned by the account. An Address Map must be
+// disabled before it can be deleted.
+func (r *AddressMapService) Delete(ctx context.Context, addressMapID string, body AddressMapDeleteParams, opts ...option.RequestOption) (res *AddressMapDeleteResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AddressMapDeleteResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/addressing/address_maps/%s", body.AccountID, addressMapID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Modify properties of an address map owned by the account.
+func (r *AddressMapService) Edit(ctx context.Context, addressMapID string, params AddressMapEditParams, opts ...option.RequestOption) (res *AddressingAddressMaps, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AddressMapEditResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/addressing/address_maps/%s", params.AccountID, addressMapID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Show a particular address map owned by the account.
+func (r *AddressMapService) Get(ctx context.Context, addressMapID string, query AddressMapGetParams, opts ...option.RequestOption) (res *AddressMapGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AddressMapGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/addressing/address_maps/%s", query.AccountID, addressMapID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type AddressingAddressMaps struct {
+ // Identifier
+ ID string `json:"id"`
+ // If set to false, then the Address Map cannot be deleted via API. This is true
+ // for Cloudflare-managed maps.
+ CanDelete bool `json:"can_delete"`
+ // If set to false, then the IPs on the Address Map cannot be modified via the API.
+ // This is true for Cloudflare-managed maps.
+ CanModifyIPs bool `json:"can_modify_ips"`
+ CreatedAt time.Time `json:"created_at" format:"date-time"`
+ // If you have legacy TLS clients which do not send the TLS server name indicator,
+ // then you can specify one default SNI on the map. If Cloudflare receives a TLS
+ // handshake from a client without an SNI, it will respond with the default SNI on
+ // those IPs. The default SNI can be any valid zone or subdomain owned by the
+ // account.
+ DefaultSni string `json:"default_sni,nullable"`
+ // An optional description field which may be used to describe the types of IPs or
+ // zones on the map.
+ Description string `json:"description,nullable"`
+ // Whether the Address Map is enabled or not. Cloudflare's DNS will not respond
+ // with IP addresses on an Address Map until the map is enabled.
+ Enabled bool `json:"enabled,nullable"`
+ ModifiedAt time.Time `json:"modified_at" format:"date-time"`
+ JSON addressingAddressMapsJSON `json:"-"`
+}
+
+// addressingAddressMapsJSON contains the JSON metadata for the struct
+// [AddressingAddressMaps]
+type addressingAddressMapsJSON struct {
+ ID apijson.Field
+ CanDelete apijson.Field
+ CanModifyIPs apijson.Field
+ CreatedAt apijson.Field
+ DefaultSni apijson.Field
+ Description apijson.Field
+ Enabled apijson.Field
+ ModifiedAt apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AddressingAddressMaps) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r addressingAddressMapsJSON) RawJSON() string {
+ return r.raw
+}
+
+type AddressMapNewResponse struct {
+ // Identifier
+ ID string `json:"id"`
+ // If set to false, then the Address Map cannot be deleted via API. This is true
+ // for Cloudflare-managed maps.
+ CanDelete bool `json:"can_delete"`
+ // If set to false, then the IPs on the Address Map cannot be modified via the API.
+ // This is true for Cloudflare-managed maps.
+ CanModifyIPs bool `json:"can_modify_ips"`
+ CreatedAt time.Time `json:"created_at" format:"date-time"`
+ // If you have legacy TLS clients which do not send the TLS server name indicator,
+ // then you can specify one default SNI on the map. If Cloudflare receives a TLS
+ // handshake from a client without an SNI, it will respond with the default SNI on
+ // those IPs. The default SNI can be any valid zone or subdomain owned by the
+ // account.
+ DefaultSni string `json:"default_sni,nullable"`
+ // An optional description field which may be used to describe the types of IPs or
+ // zones on the map.
+ Description string `json:"description,nullable"`
+ // Whether the Address Map is enabled or not. Cloudflare's DNS will not respond
+ // with IP addresses on an Address Map until the map is enabled.
+ Enabled bool `json:"enabled,nullable"`
+ // The set of IPs on the Address Map.
+ IPs []AddressMapNewResponseIP `json:"ips"`
+ // Zones and Accounts which will be assigned IPs on this Address Map. A zone
+ // membership will take priority over an account membership.
+ Memberships []AddressMapNewResponseMembership `json:"memberships"`
+ ModifiedAt time.Time `json:"modified_at" format:"date-time"`
+ JSON addressMapNewResponseJSON `json:"-"`
+}
+
+// addressMapNewResponseJSON contains the JSON metadata for the struct
+// [AddressMapNewResponse]
+type addressMapNewResponseJSON struct {
+ ID apijson.Field
+ CanDelete apijson.Field
+ CanModifyIPs apijson.Field
+ CreatedAt apijson.Field
+ DefaultSni apijson.Field
+ Description apijson.Field
+ Enabled apijson.Field
+ IPs apijson.Field
+ Memberships apijson.Field
+ ModifiedAt apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AddressMapNewResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r addressMapNewResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type AddressMapNewResponseIP struct {
+ CreatedAt time.Time `json:"created_at" format:"date-time"`
+ // An IPv4 or IPv6 address.
+ IP string `json:"ip"`
+ JSON addressMapNewResponseIPJSON `json:"-"`
+}
+
+// addressMapNewResponseIPJSON contains the JSON metadata for the struct
+// [AddressMapNewResponseIP]
+type addressMapNewResponseIPJSON struct {
+ CreatedAt apijson.Field
+ IP apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AddressMapNewResponseIP) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r addressMapNewResponseIPJSON) RawJSON() string {
+ return r.raw
+}
+
+type AddressMapNewResponseMembership struct {
+ // Controls whether the membership can be deleted via the API or not.
+ CanDelete bool `json:"can_delete"`
+ CreatedAt time.Time `json:"created_at" format:"date-time"`
+ // Identifier
+ Identifier string `json:"identifier"`
+ // The type of the membership.
+ Kind AddressMapNewResponseMembershipsKind `json:"kind"`
+ JSON addressMapNewResponseMembershipJSON `json:"-"`
+}
+
+// addressMapNewResponseMembershipJSON contains the JSON metadata for the struct
+// [AddressMapNewResponseMembership]
+type addressMapNewResponseMembershipJSON struct {
+ CanDelete apijson.Field
+ CreatedAt apijson.Field
+ Identifier apijson.Field
+ Kind apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AddressMapNewResponseMembership) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r addressMapNewResponseMembershipJSON) RawJSON() string {
+ return r.raw
+}
+
+// The type of the membership.
+type AddressMapNewResponseMembershipsKind string
+
+const (
+ AddressMapNewResponseMembershipsKindZone AddressMapNewResponseMembershipsKind = "zone"
+ AddressMapNewResponseMembershipsKindAccount AddressMapNewResponseMembershipsKind = "account"
+)
+
+// Union satisfied by [addressing.AddressMapDeleteResponseUnknown],
+// [addressing.AddressMapDeleteResponseArray] or [shared.UnionString].
+type AddressMapDeleteResponse interface {
+ ImplementsAddressingAddressMapDeleteResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*AddressMapDeleteResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(AddressMapDeleteResponseArray{}),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+type AddressMapDeleteResponseArray []interface{}
+
+func (r AddressMapDeleteResponseArray) ImplementsAddressingAddressMapDeleteResponse() {}
+
+type AddressMapGetResponse struct {
+ // Identifier
+ ID string `json:"id"`
+ // If set to false, then the Address Map cannot be deleted via API. This is true
+ // for Cloudflare-managed maps.
+ CanDelete bool `json:"can_delete"`
+ // If set to false, then the IPs on the Address Map cannot be modified via the API.
+ // This is true for Cloudflare-managed maps.
+ CanModifyIPs bool `json:"can_modify_ips"`
+ CreatedAt time.Time `json:"created_at" format:"date-time"`
+ // If you have legacy TLS clients which do not send the TLS server name indicator,
+ // then you can specify one default SNI on the map. If Cloudflare receives a TLS
+ // handshake from a client without an SNI, it will respond with the default SNI on
+ // those IPs. The default SNI can be any valid zone or subdomain owned by the
+ // account.
+ DefaultSni string `json:"default_sni,nullable"`
+ // An optional description field which may be used to describe the types of IPs or
+ // zones on the map.
+ Description string `json:"description,nullable"`
+ // Whether the Address Map is enabled or not. Cloudflare's DNS will not respond
+ // with IP addresses on an Address Map until the map is enabled.
+ Enabled bool `json:"enabled,nullable"`
+ // The set of IPs on the Address Map.
+ IPs []AddressMapGetResponseIP `json:"ips"`
+ // Zones and Accounts which will be assigned IPs on this Address Map. A zone
+ // membership will take priority over an account membership.
+ Memberships []AddressMapGetResponseMembership `json:"memberships"`
+ ModifiedAt time.Time `json:"modified_at" format:"date-time"`
+ JSON addressMapGetResponseJSON `json:"-"`
+}
+
+// addressMapGetResponseJSON contains the JSON metadata for the struct
+// [AddressMapGetResponse]
+type addressMapGetResponseJSON struct {
+ ID apijson.Field
+ CanDelete apijson.Field
+ CanModifyIPs apijson.Field
+ CreatedAt apijson.Field
+ DefaultSni apijson.Field
+ Description apijson.Field
+ Enabled apijson.Field
+ IPs apijson.Field
+ Memberships apijson.Field
+ ModifiedAt apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AddressMapGetResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r addressMapGetResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type AddressMapGetResponseIP struct {
+ CreatedAt time.Time `json:"created_at" format:"date-time"`
+ // An IPv4 or IPv6 address.
+ IP string `json:"ip"`
+ JSON addressMapGetResponseIPJSON `json:"-"`
+}
+
+// addressMapGetResponseIPJSON contains the JSON metadata for the struct
+// [AddressMapGetResponseIP]
+type addressMapGetResponseIPJSON struct {
+ CreatedAt apijson.Field
+ IP apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AddressMapGetResponseIP) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r addressMapGetResponseIPJSON) RawJSON() string {
+ return r.raw
+}
+
+type AddressMapGetResponseMembership struct {
+ // Controls whether the membership can be deleted via the API or not.
+ CanDelete bool `json:"can_delete"`
+ CreatedAt time.Time `json:"created_at" format:"date-time"`
+ // Identifier
+ Identifier string `json:"identifier"`
+ // The type of the membership.
+ Kind AddressMapGetResponseMembershipsKind `json:"kind"`
+ JSON addressMapGetResponseMembershipJSON `json:"-"`
+}
+
+// addressMapGetResponseMembershipJSON contains the JSON metadata for the struct
+// [AddressMapGetResponseMembership]
+type addressMapGetResponseMembershipJSON struct {
+ CanDelete apijson.Field
+ CreatedAt apijson.Field
+ Identifier apijson.Field
+ Kind apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AddressMapGetResponseMembership) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r addressMapGetResponseMembershipJSON) RawJSON() string {
+ return r.raw
+}
+
+// The type of the membership.
+type AddressMapGetResponseMembershipsKind string
+
+const (
+ AddressMapGetResponseMembershipsKindZone AddressMapGetResponseMembershipsKind = "zone"
+ AddressMapGetResponseMembershipsKindAccount AddressMapGetResponseMembershipsKind = "account"
+)
+
+type AddressMapNewParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ // An optional description field which may be used to describe the types of IPs or
+ // zones on the map.
+ Description param.Field[string] `json:"description"`
+ // Whether the Address Map is enabled or not. Cloudflare's DNS will not respond
+ // with IP addresses on an Address Map until the map is enabled.
+ Enabled param.Field[bool] `json:"enabled"`
+}
+
+func (r AddressMapNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type AddressMapNewResponseEnvelope struct {
+ Errors []AddressMapNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []AddressMapNewResponseEnvelopeMessages `json:"messages,required"`
+ Result AddressMapNewResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success AddressMapNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON addressMapNewResponseEnvelopeJSON `json:"-"`
+}
+
+// addressMapNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [AddressMapNewResponseEnvelope]
+type addressMapNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AddressMapNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r addressMapNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AddressMapNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON addressMapNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// addressMapNewResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [AddressMapNewResponseEnvelopeErrors]
+type addressMapNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AddressMapNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r addressMapNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type AddressMapNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON addressMapNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// addressMapNewResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [AddressMapNewResponseEnvelopeMessages]
+type addressMapNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AddressMapNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r addressMapNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type AddressMapNewResponseEnvelopeSuccess bool
+
+const (
+ AddressMapNewResponseEnvelopeSuccessTrue AddressMapNewResponseEnvelopeSuccess = true
+)
+
+type AddressMapListParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type AddressMapListResponseEnvelope struct {
+ Errors []AddressMapListResponseEnvelopeErrors `json:"errors,required"`
+ Messages []AddressMapListResponseEnvelopeMessages `json:"messages,required"`
+ Result []AddressingAddressMaps `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success AddressMapListResponseEnvelopeSuccess `json:"success,required"`
+ ResultInfo AddressMapListResponseEnvelopeResultInfo `json:"result_info"`
+ JSON addressMapListResponseEnvelopeJSON `json:"-"`
+}
+
+// addressMapListResponseEnvelopeJSON contains the JSON metadata for the struct
+// [AddressMapListResponseEnvelope]
+type addressMapListResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ ResultInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AddressMapListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r addressMapListResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AddressMapListResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON addressMapListResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// addressMapListResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [AddressMapListResponseEnvelopeErrors]
+type addressMapListResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AddressMapListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r addressMapListResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type AddressMapListResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON addressMapListResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// addressMapListResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [AddressMapListResponseEnvelopeMessages]
+type addressMapListResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AddressMapListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r addressMapListResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type AddressMapListResponseEnvelopeSuccess bool
+
+const (
+ AddressMapListResponseEnvelopeSuccessTrue AddressMapListResponseEnvelopeSuccess = true
+)
+
+type AddressMapListResponseEnvelopeResultInfo struct {
+ // Total number of results for the requested service
+ Count float64 `json:"count"`
+ // Current page within paginated list of results
+ Page float64 `json:"page"`
+ // Number of results per page of results
+ PerPage float64 `json:"per_page"`
+ // Total results available without any search parameters
+ TotalCount float64 `json:"total_count"`
+ JSON addressMapListResponseEnvelopeResultInfoJSON `json:"-"`
+}
+
+// addressMapListResponseEnvelopeResultInfoJSON contains the JSON metadata for the
+// struct [AddressMapListResponseEnvelopeResultInfo]
+type addressMapListResponseEnvelopeResultInfoJSON struct {
+ Count apijson.Field
+ Page apijson.Field
+ PerPage apijson.Field
+ TotalCount apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AddressMapListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r addressMapListResponseEnvelopeResultInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type AddressMapDeleteParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type AddressMapDeleteResponseEnvelope struct {
+ Errors []AddressMapDeleteResponseEnvelopeErrors `json:"errors,required"`
+ Messages []AddressMapDeleteResponseEnvelopeMessages `json:"messages,required"`
+ Result AddressMapDeleteResponse `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success AddressMapDeleteResponseEnvelopeSuccess `json:"success,required"`
+ ResultInfo AddressMapDeleteResponseEnvelopeResultInfo `json:"result_info"`
+ JSON addressMapDeleteResponseEnvelopeJSON `json:"-"`
+}
+
+// addressMapDeleteResponseEnvelopeJSON contains the JSON metadata for the struct
+// [AddressMapDeleteResponseEnvelope]
+type addressMapDeleteResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ ResultInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AddressMapDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r addressMapDeleteResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AddressMapDeleteResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON addressMapDeleteResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// addressMapDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [AddressMapDeleteResponseEnvelopeErrors]
+type addressMapDeleteResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AddressMapDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r addressMapDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type AddressMapDeleteResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON addressMapDeleteResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// addressMapDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [AddressMapDeleteResponseEnvelopeMessages]
+type addressMapDeleteResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AddressMapDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r addressMapDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type AddressMapDeleteResponseEnvelopeSuccess bool
+
+const (
+ AddressMapDeleteResponseEnvelopeSuccessTrue AddressMapDeleteResponseEnvelopeSuccess = true
+)
+
+type AddressMapDeleteResponseEnvelopeResultInfo struct {
+ // Total number of results for the requested service
+ Count float64 `json:"count"`
+ // Current page within paginated list of results
+ Page float64 `json:"page"`
+ // Number of results per page of results
+ PerPage float64 `json:"per_page"`
+ // Total results available without any search parameters
+ TotalCount float64 `json:"total_count"`
+ JSON addressMapDeleteResponseEnvelopeResultInfoJSON `json:"-"`
+}
+
+// addressMapDeleteResponseEnvelopeResultInfoJSON contains the JSON metadata for
+// the struct [AddressMapDeleteResponseEnvelopeResultInfo]
+type addressMapDeleteResponseEnvelopeResultInfoJSON struct {
+ Count apijson.Field
+ Page apijson.Field
+ PerPage apijson.Field
+ TotalCount apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AddressMapDeleteResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r addressMapDeleteResponseEnvelopeResultInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type AddressMapEditParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ // If you have legacy TLS clients which do not send the TLS server name indicator,
+ // then you can specify one default SNI on the map. If Cloudflare receives a TLS
+ // handshake from a client without an SNI, it will respond with the default SNI on
+ // those IPs. The default SNI can be any valid zone or subdomain owned by the
+ // account.
+ DefaultSni param.Field[string] `json:"default_sni"`
+ // An optional description field which may be used to describe the types of IPs or
+ // zones on the map.
+ Description param.Field[string] `json:"description"`
+ // Whether the Address Map is enabled or not. Cloudflare's DNS will not respond
+ // with IP addresses on an Address Map until the map is enabled.
+ Enabled param.Field[bool] `json:"enabled"`
+}
+
+func (r AddressMapEditParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type AddressMapEditResponseEnvelope struct {
+ Errors []AddressMapEditResponseEnvelopeErrors `json:"errors,required"`
+ Messages []AddressMapEditResponseEnvelopeMessages `json:"messages,required"`
+ Result AddressingAddressMaps `json:"result,required"`
+ // Whether the API call was successful
+ Success AddressMapEditResponseEnvelopeSuccess `json:"success,required"`
+ JSON addressMapEditResponseEnvelopeJSON `json:"-"`
+}
+
+// addressMapEditResponseEnvelopeJSON contains the JSON metadata for the struct
+// [AddressMapEditResponseEnvelope]
+type addressMapEditResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AddressMapEditResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r addressMapEditResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AddressMapEditResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON addressMapEditResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// addressMapEditResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [AddressMapEditResponseEnvelopeErrors]
+type addressMapEditResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AddressMapEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r addressMapEditResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type AddressMapEditResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON addressMapEditResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// addressMapEditResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [AddressMapEditResponseEnvelopeMessages]
+type addressMapEditResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AddressMapEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r addressMapEditResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type AddressMapEditResponseEnvelopeSuccess bool
+
+const (
+ AddressMapEditResponseEnvelopeSuccessTrue AddressMapEditResponseEnvelopeSuccess = true
+)
+
+type AddressMapGetParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type AddressMapGetResponseEnvelope struct {
+ Errors []AddressMapGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []AddressMapGetResponseEnvelopeMessages `json:"messages,required"`
+ Result AddressMapGetResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success AddressMapGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON addressMapGetResponseEnvelopeJSON `json:"-"`
+}
+
+// addressMapGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [AddressMapGetResponseEnvelope]
+type addressMapGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AddressMapGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r addressMapGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AddressMapGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON addressMapGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// addressMapGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [AddressMapGetResponseEnvelopeErrors]
+type addressMapGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AddressMapGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r addressMapGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type AddressMapGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON addressMapGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// addressMapGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [AddressMapGetResponseEnvelopeMessages]
+type addressMapGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AddressMapGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r addressMapGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type AddressMapGetResponseEnvelopeSuccess bool
+
+const (
+ AddressMapGetResponseEnvelopeSuccessTrue AddressMapGetResponseEnvelopeSuccess = true
+)
diff --git a/addressing/addressmap_test.go b/addressing/addressmap_test.go
new file mode 100644
index 00000000000..5b5616f105b
--- /dev/null
+++ b/addressing/addressmap_test.go
@@ -0,0 +1,162 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package addressing_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/addressing"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestAddressMapNewWithOptionalParams(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"),
+ )
+ _, err := client.Addressing.AddressMaps.New(context.TODO(), addressing.AddressMapNewParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Description: cloudflare.F("My Ecommerce zones"),
+ Enabled: cloudflare.F(true),
+ })
+ 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())
+ }
+}
+
+func TestAddressMapList(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"),
+ )
+ _, err := client.Addressing.AddressMaps.List(context.TODO(), addressing.AddressMapListParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ })
+ 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())
+ }
+}
+
+func TestAddressMapDelete(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"),
+ )
+ _, err := client.Addressing.AddressMaps.Delete(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ addressing.AddressMapDeleteParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestAddressMapEditWithOptionalParams(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"),
+ )
+ _, err := client.Addressing.AddressMaps.Edit(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ addressing.AddressMapEditParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ DefaultSni: cloudflare.F("*.example.com"),
+ Description: cloudflare.F("My Ecommerce zones"),
+ Enabled: cloudflare.F(true),
+ },
+ )
+ 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())
+ }
+}
+
+func TestAddressMapGet(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"),
+ )
+ _, err := client.Addressing.AddressMaps.Get(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ addressing.AddressMapGetParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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/addressing/addressmapaccount.go b/addressing/addressmapaccount.go
new file mode 100644
index 00000000000..e3a6d0d56b0
--- /dev/null
+++ b/addressing/addressmapaccount.go
@@ -0,0 +1,349 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package addressing
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "reflect"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/tidwall/gjson"
+)
+
+// AddressMapAccountService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewAddressMapAccountService] method
+// instead.
+type AddressMapAccountService struct {
+ Options []option.RequestOption
+}
+
+// NewAddressMapAccountService generates a new service that applies the given
+// options to each request. These options are applied after the parent client's
+// options (if there is one), and before any request-specific options.
+func NewAddressMapAccountService(opts ...option.RequestOption) (r *AddressMapAccountService) {
+ r = &AddressMapAccountService{}
+ r.Options = opts
+ return
+}
+
+// Add an account as a member of a particular address map.
+func (r *AddressMapAccountService) Update(ctx context.Context, addressMapID string, body AddressMapAccountUpdateParams, opts ...option.RequestOption) (res *AddressMapAccountUpdateResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AddressMapAccountUpdateResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/addressing/address_maps/%s/accounts/%s", body.AccountID, addressMapID, body.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Remove an account as a member of a particular address map.
+func (r *AddressMapAccountService) Delete(ctx context.Context, addressMapID string, body AddressMapAccountDeleteParams, opts ...option.RequestOption) (res *AddressMapAccountDeleteResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AddressMapAccountDeleteResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/addressing/address_maps/%s/accounts/%s", body.AccountID, addressMapID, body.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Union satisfied by [addressing.AddressMapAccountUpdateResponseUnknown],
+// [addressing.AddressMapAccountUpdateResponseArray] or [shared.UnionString].
+type AddressMapAccountUpdateResponse interface {
+ ImplementsAddressingAddressMapAccountUpdateResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*AddressMapAccountUpdateResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(AddressMapAccountUpdateResponseArray{}),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+type AddressMapAccountUpdateResponseArray []interface{}
+
+func (r AddressMapAccountUpdateResponseArray) ImplementsAddressingAddressMapAccountUpdateResponse() {}
+
+// Union satisfied by [addressing.AddressMapAccountDeleteResponseUnknown],
+// [addressing.AddressMapAccountDeleteResponseArray] or [shared.UnionString].
+type AddressMapAccountDeleteResponse interface {
+ ImplementsAddressingAddressMapAccountDeleteResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*AddressMapAccountDeleteResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(AddressMapAccountDeleteResponseArray{}),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+type AddressMapAccountDeleteResponseArray []interface{}
+
+func (r AddressMapAccountDeleteResponseArray) ImplementsAddressingAddressMapAccountDeleteResponse() {}
+
+type AddressMapAccountUpdateParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type AddressMapAccountUpdateResponseEnvelope struct {
+ Errors []AddressMapAccountUpdateResponseEnvelopeErrors `json:"errors,required"`
+ Messages []AddressMapAccountUpdateResponseEnvelopeMessages `json:"messages,required"`
+ Result AddressMapAccountUpdateResponse `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success AddressMapAccountUpdateResponseEnvelopeSuccess `json:"success,required"`
+ ResultInfo AddressMapAccountUpdateResponseEnvelopeResultInfo `json:"result_info"`
+ JSON addressMapAccountUpdateResponseEnvelopeJSON `json:"-"`
+}
+
+// addressMapAccountUpdateResponseEnvelopeJSON contains the JSON metadata for the
+// struct [AddressMapAccountUpdateResponseEnvelope]
+type addressMapAccountUpdateResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ ResultInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AddressMapAccountUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r addressMapAccountUpdateResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AddressMapAccountUpdateResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON addressMapAccountUpdateResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// addressMapAccountUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for
+// the struct [AddressMapAccountUpdateResponseEnvelopeErrors]
+type addressMapAccountUpdateResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AddressMapAccountUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r addressMapAccountUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type AddressMapAccountUpdateResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON addressMapAccountUpdateResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// addressMapAccountUpdateResponseEnvelopeMessagesJSON contains the JSON metadata
+// for the struct [AddressMapAccountUpdateResponseEnvelopeMessages]
+type addressMapAccountUpdateResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AddressMapAccountUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r addressMapAccountUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type AddressMapAccountUpdateResponseEnvelopeSuccess bool
+
+const (
+ AddressMapAccountUpdateResponseEnvelopeSuccessTrue AddressMapAccountUpdateResponseEnvelopeSuccess = true
+)
+
+type AddressMapAccountUpdateResponseEnvelopeResultInfo struct {
+ // Total number of results for the requested service
+ Count float64 `json:"count"`
+ // Current page within paginated list of results
+ Page float64 `json:"page"`
+ // Number of results per page of results
+ PerPage float64 `json:"per_page"`
+ // Total results available without any search parameters
+ TotalCount float64 `json:"total_count"`
+ JSON addressMapAccountUpdateResponseEnvelopeResultInfoJSON `json:"-"`
+}
+
+// addressMapAccountUpdateResponseEnvelopeResultInfoJSON contains the JSON metadata
+// for the struct [AddressMapAccountUpdateResponseEnvelopeResultInfo]
+type addressMapAccountUpdateResponseEnvelopeResultInfoJSON struct {
+ Count apijson.Field
+ Page apijson.Field
+ PerPage apijson.Field
+ TotalCount apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AddressMapAccountUpdateResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r addressMapAccountUpdateResponseEnvelopeResultInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type AddressMapAccountDeleteParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type AddressMapAccountDeleteResponseEnvelope struct {
+ Errors []AddressMapAccountDeleteResponseEnvelopeErrors `json:"errors,required"`
+ Messages []AddressMapAccountDeleteResponseEnvelopeMessages `json:"messages,required"`
+ Result AddressMapAccountDeleteResponse `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success AddressMapAccountDeleteResponseEnvelopeSuccess `json:"success,required"`
+ ResultInfo AddressMapAccountDeleteResponseEnvelopeResultInfo `json:"result_info"`
+ JSON addressMapAccountDeleteResponseEnvelopeJSON `json:"-"`
+}
+
+// addressMapAccountDeleteResponseEnvelopeJSON contains the JSON metadata for the
+// struct [AddressMapAccountDeleteResponseEnvelope]
+type addressMapAccountDeleteResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ ResultInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AddressMapAccountDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r addressMapAccountDeleteResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AddressMapAccountDeleteResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON addressMapAccountDeleteResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// addressMapAccountDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for
+// the struct [AddressMapAccountDeleteResponseEnvelopeErrors]
+type addressMapAccountDeleteResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AddressMapAccountDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r addressMapAccountDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type AddressMapAccountDeleteResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON addressMapAccountDeleteResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// addressMapAccountDeleteResponseEnvelopeMessagesJSON contains the JSON metadata
+// for the struct [AddressMapAccountDeleteResponseEnvelopeMessages]
+type addressMapAccountDeleteResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AddressMapAccountDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r addressMapAccountDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type AddressMapAccountDeleteResponseEnvelopeSuccess bool
+
+const (
+ AddressMapAccountDeleteResponseEnvelopeSuccessTrue AddressMapAccountDeleteResponseEnvelopeSuccess = true
+)
+
+type AddressMapAccountDeleteResponseEnvelopeResultInfo struct {
+ // Total number of results for the requested service
+ Count float64 `json:"count"`
+ // Current page within paginated list of results
+ Page float64 `json:"page"`
+ // Number of results per page of results
+ PerPage float64 `json:"per_page"`
+ // Total results available without any search parameters
+ TotalCount float64 `json:"total_count"`
+ JSON addressMapAccountDeleteResponseEnvelopeResultInfoJSON `json:"-"`
+}
+
+// addressMapAccountDeleteResponseEnvelopeResultInfoJSON contains the JSON metadata
+// for the struct [AddressMapAccountDeleteResponseEnvelopeResultInfo]
+type addressMapAccountDeleteResponseEnvelopeResultInfoJSON struct {
+ Count apijson.Field
+ Page apijson.Field
+ PerPage apijson.Field
+ TotalCount apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AddressMapAccountDeleteResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r addressMapAccountDeleteResponseEnvelopeResultInfoJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/addressing/addressmapaccount_test.go b/addressing/addressmapaccount_test.go
new file mode 100644
index 00000000000..80509f5f8cc
--- /dev/null
+++ b/addressing/addressmapaccount_test.go
@@ -0,0 +1,75 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package addressing_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/addressing"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestAddressMapAccountUpdate(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"),
+ )
+ _, err := client.Addressing.AddressMaps.Accounts.Update(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ addressing.AddressMapAccountUpdateParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestAddressMapAccountDelete(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"),
+ )
+ _, err := client.Addressing.AddressMaps.Accounts.Delete(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ addressing.AddressMapAccountDeleteParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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/addressing/addressmapip.go b/addressing/addressmapip.go
new file mode 100644
index 00000000000..966a5c806fc
--- /dev/null
+++ b/addressing/addressmapip.go
@@ -0,0 +1,349 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package addressing
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "reflect"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/tidwall/gjson"
+)
+
+// AddressMapIPService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewAddressMapIPService] method
+// instead.
+type AddressMapIPService struct {
+ Options []option.RequestOption
+}
+
+// NewAddressMapIPService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewAddressMapIPService(opts ...option.RequestOption) (r *AddressMapIPService) {
+ r = &AddressMapIPService{}
+ r.Options = opts
+ return
+}
+
+// Add an IP from a prefix owned by the account to a particular address map.
+func (r *AddressMapIPService) Update(ctx context.Context, addressMapID string, ipAddress string, body AddressMapIPUpdateParams, opts ...option.RequestOption) (res *AddressMapIPUpdateResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AddressMapIPUpdateResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/addressing/address_maps/%s/ips/%s", body.AccountID, addressMapID, ipAddress)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Remove an IP from a particular address map.
+func (r *AddressMapIPService) Delete(ctx context.Context, addressMapID string, ipAddress string, body AddressMapIPDeleteParams, opts ...option.RequestOption) (res *AddressMapIPDeleteResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AddressMapIPDeleteResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/addressing/address_maps/%s/ips/%s", body.AccountID, addressMapID, ipAddress)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Union satisfied by [addressing.AddressMapIPUpdateResponseUnknown],
+// [addressing.AddressMapIPUpdateResponseArray] or [shared.UnionString].
+type AddressMapIPUpdateResponse interface {
+ ImplementsAddressingAddressMapIPUpdateResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*AddressMapIPUpdateResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(AddressMapIPUpdateResponseArray{}),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+type AddressMapIPUpdateResponseArray []interface{}
+
+func (r AddressMapIPUpdateResponseArray) ImplementsAddressingAddressMapIPUpdateResponse() {}
+
+// Union satisfied by [addressing.AddressMapIPDeleteResponseUnknown],
+// [addressing.AddressMapIPDeleteResponseArray] or [shared.UnionString].
+type AddressMapIPDeleteResponse interface {
+ ImplementsAddressingAddressMapIPDeleteResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*AddressMapIPDeleteResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(AddressMapIPDeleteResponseArray{}),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+type AddressMapIPDeleteResponseArray []interface{}
+
+func (r AddressMapIPDeleteResponseArray) ImplementsAddressingAddressMapIPDeleteResponse() {}
+
+type AddressMapIPUpdateParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type AddressMapIPUpdateResponseEnvelope struct {
+ Errors []AddressMapIPUpdateResponseEnvelopeErrors `json:"errors,required"`
+ Messages []AddressMapIPUpdateResponseEnvelopeMessages `json:"messages,required"`
+ Result AddressMapIPUpdateResponse `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success AddressMapIPUpdateResponseEnvelopeSuccess `json:"success,required"`
+ ResultInfo AddressMapIPUpdateResponseEnvelopeResultInfo `json:"result_info"`
+ JSON addressMapIPUpdateResponseEnvelopeJSON `json:"-"`
+}
+
+// addressMapIPUpdateResponseEnvelopeJSON contains the JSON metadata for the struct
+// [AddressMapIPUpdateResponseEnvelope]
+type addressMapIPUpdateResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ ResultInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AddressMapIPUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r addressMapIPUpdateResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AddressMapIPUpdateResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON addressMapIPUpdateResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// addressMapIPUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [AddressMapIPUpdateResponseEnvelopeErrors]
+type addressMapIPUpdateResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AddressMapIPUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r addressMapIPUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type AddressMapIPUpdateResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON addressMapIPUpdateResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// addressMapIPUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for
+// the struct [AddressMapIPUpdateResponseEnvelopeMessages]
+type addressMapIPUpdateResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AddressMapIPUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r addressMapIPUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type AddressMapIPUpdateResponseEnvelopeSuccess bool
+
+const (
+ AddressMapIPUpdateResponseEnvelopeSuccessTrue AddressMapIPUpdateResponseEnvelopeSuccess = true
+)
+
+type AddressMapIPUpdateResponseEnvelopeResultInfo struct {
+ // Total number of results for the requested service
+ Count float64 `json:"count"`
+ // Current page within paginated list of results
+ Page float64 `json:"page"`
+ // Number of results per page of results
+ PerPage float64 `json:"per_page"`
+ // Total results available without any search parameters
+ TotalCount float64 `json:"total_count"`
+ JSON addressMapIPUpdateResponseEnvelopeResultInfoJSON `json:"-"`
+}
+
+// addressMapIPUpdateResponseEnvelopeResultInfoJSON contains the JSON metadata for
+// the struct [AddressMapIPUpdateResponseEnvelopeResultInfo]
+type addressMapIPUpdateResponseEnvelopeResultInfoJSON struct {
+ Count apijson.Field
+ Page apijson.Field
+ PerPage apijson.Field
+ TotalCount apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AddressMapIPUpdateResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r addressMapIPUpdateResponseEnvelopeResultInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type AddressMapIPDeleteParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type AddressMapIPDeleteResponseEnvelope struct {
+ Errors []AddressMapIPDeleteResponseEnvelopeErrors `json:"errors,required"`
+ Messages []AddressMapIPDeleteResponseEnvelopeMessages `json:"messages,required"`
+ Result AddressMapIPDeleteResponse `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success AddressMapIPDeleteResponseEnvelopeSuccess `json:"success,required"`
+ ResultInfo AddressMapIPDeleteResponseEnvelopeResultInfo `json:"result_info"`
+ JSON addressMapIPDeleteResponseEnvelopeJSON `json:"-"`
+}
+
+// addressMapIPDeleteResponseEnvelopeJSON contains the JSON metadata for the struct
+// [AddressMapIPDeleteResponseEnvelope]
+type addressMapIPDeleteResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ ResultInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AddressMapIPDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r addressMapIPDeleteResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AddressMapIPDeleteResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON addressMapIPDeleteResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// addressMapIPDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [AddressMapIPDeleteResponseEnvelopeErrors]
+type addressMapIPDeleteResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AddressMapIPDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r addressMapIPDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type AddressMapIPDeleteResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON addressMapIPDeleteResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// addressMapIPDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for
+// the struct [AddressMapIPDeleteResponseEnvelopeMessages]
+type addressMapIPDeleteResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AddressMapIPDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r addressMapIPDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type AddressMapIPDeleteResponseEnvelopeSuccess bool
+
+const (
+ AddressMapIPDeleteResponseEnvelopeSuccessTrue AddressMapIPDeleteResponseEnvelopeSuccess = true
+)
+
+type AddressMapIPDeleteResponseEnvelopeResultInfo struct {
+ // Total number of results for the requested service
+ Count float64 `json:"count"`
+ // Current page within paginated list of results
+ Page float64 `json:"page"`
+ // Number of results per page of results
+ PerPage float64 `json:"per_page"`
+ // Total results available without any search parameters
+ TotalCount float64 `json:"total_count"`
+ JSON addressMapIPDeleteResponseEnvelopeResultInfoJSON `json:"-"`
+}
+
+// addressMapIPDeleteResponseEnvelopeResultInfoJSON contains the JSON metadata for
+// the struct [AddressMapIPDeleteResponseEnvelopeResultInfo]
+type addressMapIPDeleteResponseEnvelopeResultInfoJSON struct {
+ Count apijson.Field
+ Page apijson.Field
+ PerPage apijson.Field
+ TotalCount apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AddressMapIPDeleteResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r addressMapIPDeleteResponseEnvelopeResultInfoJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/addressing/addressmapip_test.go b/addressing/addressmapip_test.go
new file mode 100644
index 00000000000..a329cb1cc36
--- /dev/null
+++ b/addressing/addressmapip_test.go
@@ -0,0 +1,77 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package addressing_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/addressing"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestAddressMapIPUpdate(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"),
+ )
+ _, err := client.Addressing.AddressMaps.IPs.Update(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ "192.0.2.1",
+ addressing.AddressMapIPUpdateParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestAddressMapIPDelete(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"),
+ )
+ _, err := client.Addressing.AddressMaps.IPs.Delete(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ "192.0.2.1",
+ addressing.AddressMapIPDeleteParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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/addressing/addressmapzone.go b/addressing/addressmapzone.go
new file mode 100644
index 00000000000..4602a184340
--- /dev/null
+++ b/addressing/addressmapzone.go
@@ -0,0 +1,371 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package addressing
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "reflect"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/tidwall/gjson"
+)
+
+// AddressMapZoneService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewAddressMapZoneService] method
+// instead.
+type AddressMapZoneService struct {
+ Options []option.RequestOption
+}
+
+// NewAddressMapZoneService generates a new service that applies the given options
+// to each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewAddressMapZoneService(opts ...option.RequestOption) (r *AddressMapZoneService) {
+ r = &AddressMapZoneService{}
+ r.Options = opts
+ return
+}
+
+// Add a zone as a member of a particular address map.
+func (r *AddressMapZoneService) Update(ctx context.Context, addressMapID string, body AddressMapZoneUpdateParams, opts ...option.RequestOption) (res *AddressMapZoneUpdateResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AddressMapZoneUpdateResponseEnvelope
+ var accountOrZone string
+ var accountOrZoneID param.Field[string]
+ if body.AccountID.Present {
+ accountOrZone = "accounts"
+ accountOrZoneID = body.AccountID
+ } else {
+ accountOrZone = "zones"
+ accountOrZoneID = body.ZoneID
+ }
+ path := fmt.Sprintf("accounts/%s/addressing/address_maps/%s/zones/%s", accountOrZone, addressMapID, accountOrZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Remove a zone as a member of a particular address map.
+func (r *AddressMapZoneService) Delete(ctx context.Context, addressMapID string, body AddressMapZoneDeleteParams, opts ...option.RequestOption) (res *AddressMapZoneDeleteResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AddressMapZoneDeleteResponseEnvelope
+ var accountOrZone string
+ var accountOrZoneID param.Field[string]
+ if body.AccountID.Present {
+ accountOrZone = "accounts"
+ accountOrZoneID = body.AccountID
+ } else {
+ accountOrZone = "zones"
+ accountOrZoneID = body.ZoneID
+ }
+ path := fmt.Sprintf("accounts/%s/addressing/address_maps/%s/zones/%s", accountOrZone, addressMapID, accountOrZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Union satisfied by [addressing.AddressMapZoneUpdateResponseUnknown],
+// [addressing.AddressMapZoneUpdateResponseArray] or [shared.UnionString].
+type AddressMapZoneUpdateResponse interface {
+ ImplementsAddressingAddressMapZoneUpdateResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*AddressMapZoneUpdateResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(AddressMapZoneUpdateResponseArray{}),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+type AddressMapZoneUpdateResponseArray []interface{}
+
+func (r AddressMapZoneUpdateResponseArray) ImplementsAddressingAddressMapZoneUpdateResponse() {}
+
+// Union satisfied by [addressing.AddressMapZoneDeleteResponseUnknown],
+// [addressing.AddressMapZoneDeleteResponseArray] or [shared.UnionString].
+type AddressMapZoneDeleteResponse interface {
+ ImplementsAddressingAddressMapZoneDeleteResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*AddressMapZoneDeleteResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(AddressMapZoneDeleteResponseArray{}),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+type AddressMapZoneDeleteResponseArray []interface{}
+
+func (r AddressMapZoneDeleteResponseArray) ImplementsAddressingAddressMapZoneDeleteResponse() {}
+
+type AddressMapZoneUpdateParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type AddressMapZoneUpdateResponseEnvelope struct {
+ Errors []AddressMapZoneUpdateResponseEnvelopeErrors `json:"errors,required"`
+ Messages []AddressMapZoneUpdateResponseEnvelopeMessages `json:"messages,required"`
+ Result AddressMapZoneUpdateResponse `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success AddressMapZoneUpdateResponseEnvelopeSuccess `json:"success,required"`
+ ResultInfo AddressMapZoneUpdateResponseEnvelopeResultInfo `json:"result_info"`
+ JSON addressMapZoneUpdateResponseEnvelopeJSON `json:"-"`
+}
+
+// addressMapZoneUpdateResponseEnvelopeJSON contains the JSON metadata for the
+// struct [AddressMapZoneUpdateResponseEnvelope]
+type addressMapZoneUpdateResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ ResultInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AddressMapZoneUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r addressMapZoneUpdateResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AddressMapZoneUpdateResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON addressMapZoneUpdateResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// addressMapZoneUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for
+// the struct [AddressMapZoneUpdateResponseEnvelopeErrors]
+type addressMapZoneUpdateResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AddressMapZoneUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r addressMapZoneUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type AddressMapZoneUpdateResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON addressMapZoneUpdateResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// addressMapZoneUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for
+// the struct [AddressMapZoneUpdateResponseEnvelopeMessages]
+type addressMapZoneUpdateResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AddressMapZoneUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r addressMapZoneUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type AddressMapZoneUpdateResponseEnvelopeSuccess bool
+
+const (
+ AddressMapZoneUpdateResponseEnvelopeSuccessTrue AddressMapZoneUpdateResponseEnvelopeSuccess = true
+)
+
+type AddressMapZoneUpdateResponseEnvelopeResultInfo struct {
+ // Total number of results for the requested service
+ Count float64 `json:"count"`
+ // Current page within paginated list of results
+ Page float64 `json:"page"`
+ // Number of results per page of results
+ PerPage float64 `json:"per_page"`
+ // Total results available without any search parameters
+ TotalCount float64 `json:"total_count"`
+ JSON addressMapZoneUpdateResponseEnvelopeResultInfoJSON `json:"-"`
+}
+
+// addressMapZoneUpdateResponseEnvelopeResultInfoJSON contains the JSON metadata
+// for the struct [AddressMapZoneUpdateResponseEnvelopeResultInfo]
+type addressMapZoneUpdateResponseEnvelopeResultInfoJSON struct {
+ Count apijson.Field
+ Page apijson.Field
+ PerPage apijson.Field
+ TotalCount apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AddressMapZoneUpdateResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r addressMapZoneUpdateResponseEnvelopeResultInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type AddressMapZoneDeleteParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type AddressMapZoneDeleteResponseEnvelope struct {
+ Errors []AddressMapZoneDeleteResponseEnvelopeErrors `json:"errors,required"`
+ Messages []AddressMapZoneDeleteResponseEnvelopeMessages `json:"messages,required"`
+ Result AddressMapZoneDeleteResponse `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success AddressMapZoneDeleteResponseEnvelopeSuccess `json:"success,required"`
+ ResultInfo AddressMapZoneDeleteResponseEnvelopeResultInfo `json:"result_info"`
+ JSON addressMapZoneDeleteResponseEnvelopeJSON `json:"-"`
+}
+
+// addressMapZoneDeleteResponseEnvelopeJSON contains the JSON metadata for the
+// struct [AddressMapZoneDeleteResponseEnvelope]
+type addressMapZoneDeleteResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ ResultInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AddressMapZoneDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r addressMapZoneDeleteResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AddressMapZoneDeleteResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON addressMapZoneDeleteResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// addressMapZoneDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for
+// the struct [AddressMapZoneDeleteResponseEnvelopeErrors]
+type addressMapZoneDeleteResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AddressMapZoneDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r addressMapZoneDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type AddressMapZoneDeleteResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON addressMapZoneDeleteResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// addressMapZoneDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for
+// the struct [AddressMapZoneDeleteResponseEnvelopeMessages]
+type addressMapZoneDeleteResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AddressMapZoneDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r addressMapZoneDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type AddressMapZoneDeleteResponseEnvelopeSuccess bool
+
+const (
+ AddressMapZoneDeleteResponseEnvelopeSuccessTrue AddressMapZoneDeleteResponseEnvelopeSuccess = true
+)
+
+type AddressMapZoneDeleteResponseEnvelopeResultInfo struct {
+ // Total number of results for the requested service
+ Count float64 `json:"count"`
+ // Current page within paginated list of results
+ Page float64 `json:"page"`
+ // Number of results per page of results
+ PerPage float64 `json:"per_page"`
+ // Total results available without any search parameters
+ TotalCount float64 `json:"total_count"`
+ JSON addressMapZoneDeleteResponseEnvelopeResultInfoJSON `json:"-"`
+}
+
+// addressMapZoneDeleteResponseEnvelopeResultInfoJSON contains the JSON metadata
+// for the struct [AddressMapZoneDeleteResponseEnvelopeResultInfo]
+type addressMapZoneDeleteResponseEnvelopeResultInfoJSON struct {
+ Count apijson.Field
+ Page apijson.Field
+ PerPage apijson.Field
+ TotalCount apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AddressMapZoneDeleteResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r addressMapZoneDeleteResponseEnvelopeResultInfoJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/addressing/addressmapzone_test.go b/addressing/addressmapzone_test.go
new file mode 100644
index 00000000000..4da0476f172
--- /dev/null
+++ b/addressing/addressmapzone_test.go
@@ -0,0 +1,77 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package addressing_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/addressing"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestAddressMapZoneUpdate(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"),
+ )
+ _, err := client.Addressing.AddressMaps.Zones.Update(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ addressing.AddressMapZoneUpdateParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestAddressMapZoneDelete(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"),
+ )
+ _, err := client.Addressing.AddressMaps.Zones.Delete(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ addressing.AddressMapZoneDeleteParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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/addressing/aliases.go b/addressing/aliases.go
new file mode 100644
index 00000000000..f75a215ad2a
--- /dev/null
+++ b/addressing/aliases.go
@@ -0,0 +1,9 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package addressing
+
+import (
+ "github.com/cloudflare/cloudflare-go/internal/apierror"
+)
+
+type Error = apierror.Error
diff --git a/addressing/loadocument.go b/addressing/loadocument.go
new file mode 100644
index 00000000000..d7b33d08f88
--- /dev/null
+++ b/addressing/loadocument.go
@@ -0,0 +1,161 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package addressing
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// LOADocumentService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewLOADocumentService] method
+// instead.
+type LOADocumentService struct {
+ Options []option.RequestOption
+ Downloads *LOADocumentDownloadService
+}
+
+// NewLOADocumentService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewLOADocumentService(opts ...option.RequestOption) (r *LOADocumentService) {
+ r = &LOADocumentService{}
+ r.Options = opts
+ r.Downloads = NewLOADocumentDownloadService(opts...)
+ return
+}
+
+// Submit LOA document (pdf format) under the account.
+func (r *LOADocumentService) New(ctx context.Context, params LOADocumentNewParams, opts ...option.RequestOption) (res *LOADocumentNewResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env LOADocumentNewResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/addressing/loa_documents", params.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type LOADocumentNewResponse struct {
+ // Name of LOA document.
+ Filename string `json:"filename"`
+ JSON loaDocumentNewResponseJSON `json:"-"`
+}
+
+// loaDocumentNewResponseJSON contains the JSON metadata for the struct
+// [LOADocumentNewResponse]
+type loaDocumentNewResponseJSON struct {
+ Filename apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LOADocumentNewResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r loaDocumentNewResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type LOADocumentNewParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ // LOA document to upload.
+ LOADocument param.Field[string] `json:"loa_document,required"`
+}
+
+func (r LOADocumentNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type LOADocumentNewResponseEnvelope struct {
+ Errors []LOADocumentNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []LOADocumentNewResponseEnvelopeMessages `json:"messages,required"`
+ Result LOADocumentNewResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success LOADocumentNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON loaDocumentNewResponseEnvelopeJSON `json:"-"`
+}
+
+// loaDocumentNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [LOADocumentNewResponseEnvelope]
+type loaDocumentNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LOADocumentNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r loaDocumentNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type LOADocumentNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON loaDocumentNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// loaDocumentNewResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [LOADocumentNewResponseEnvelopeErrors]
+type loaDocumentNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LOADocumentNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r loaDocumentNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type LOADocumentNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON loaDocumentNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// loaDocumentNewResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [LOADocumentNewResponseEnvelopeMessages]
+type loaDocumentNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LOADocumentNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r loaDocumentNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type LOADocumentNewResponseEnvelopeSuccess bool
+
+const (
+ LOADocumentNewResponseEnvelopeSuccessTrue LOADocumentNewResponseEnvelopeSuccess = true
+)
diff --git a/addressing/loadocument_test.go b/addressing/loadocument_test.go
new file mode 100644
index 00000000000..a9a8c993741
--- /dev/null
+++ b/addressing/loadocument_test.go
@@ -0,0 +1,42 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package addressing_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/addressing"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestLOADocumentNew(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"),
+ )
+ _, err := client.Addressing.LOADocuments.New(context.TODO(), addressing.LOADocumentNewParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ LOADocument: cloudflare.F("@document.pdf"),
+ })
+ 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/addressing/loadocumentdownload.go b/addressing/loadocumentdownload.go
new file mode 100644
index 00000000000..62a827ff412
--- /dev/null
+++ b/addressing/loadocumentdownload.go
@@ -0,0 +1,46 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package addressing
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// LOADocumentDownloadService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewLOADocumentDownloadService]
+// method instead.
+type LOADocumentDownloadService struct {
+ Options []option.RequestOption
+}
+
+// NewLOADocumentDownloadService generates a new service that applies the given
+// options to each request. These options are applied after the parent client's
+// options (if there is one), and before any request-specific options.
+func NewLOADocumentDownloadService(opts ...option.RequestOption) (r *LOADocumentDownloadService) {
+ r = &LOADocumentDownloadService{}
+ r.Options = opts
+ return
+}
+
+// Download specified LOA document under the account.
+func (r *LOADocumentDownloadService) Get(ctx context.Context, loaDocumentID string, query LOADocumentDownloadGetParams, opts ...option.RequestOption) (res *LOADocumentDownloadGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ path := fmt.Sprintf("accounts/%s/addressing/loa_documents/%s/download", query.AccountID, loaDocumentID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &res, opts...)
+ return
+}
+
+type LOADocumentDownloadGetResponse = interface{}
+
+type LOADocumentDownloadGetParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
diff --git a/addressing/loadocumentdownload_test.go b/addressing/loadocumentdownload_test.go
new file mode 100644
index 00000000000..8d5e977b202
--- /dev/null
+++ b/addressing/loadocumentdownload_test.go
@@ -0,0 +1,45 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package addressing_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/addressing"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestLOADocumentDownloadGet(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"),
+ )
+ _, err := client.Addressing.LOADocuments.Downloads.Get(
+ context.TODO(),
+ "d933b1530bc56c9953cf8ce166da8004",
+ addressing.LOADocumentDownloadGetParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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/addressing/prefix.go b/addressing/prefix.go
new file mode 100644
index 00000000000..d76c535c7d0
--- /dev/null
+++ b/addressing/prefix.go
@@ -0,0 +1,701 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package addressing
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "reflect"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/tidwall/gjson"
+)
+
+// PrefixService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewPrefixService] method instead.
+type PrefixService struct {
+ Options []option.RequestOption
+ BGP *PrefixBGPService
+ Delegations *PrefixDelegationService
+}
+
+// NewPrefixService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewPrefixService(opts ...option.RequestOption) (r *PrefixService) {
+ r = &PrefixService{}
+ r.Options = opts
+ r.BGP = NewPrefixBGPService(opts...)
+ r.Delegations = NewPrefixDelegationService(opts...)
+ return
+}
+
+// Add a new prefix under the account.
+func (r *PrefixService) New(ctx context.Context, params PrefixNewParams, opts ...option.RequestOption) (res *AddressingIpamPrefixes, err error) {
+ opts = append(r.Options[:], opts...)
+ var env PrefixNewResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/addressing/prefixes", params.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// List all prefixes owned by the account.
+func (r *PrefixService) List(ctx context.Context, query PrefixListParams, opts ...option.RequestOption) (res *[]AddressingIpamPrefixes, err error) {
+ opts = append(r.Options[:], opts...)
+ var env PrefixListResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/addressing/prefixes", query.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Delete an unapproved prefix owned by the account.
+func (r *PrefixService) Delete(ctx context.Context, prefixID string, body PrefixDeleteParams, opts ...option.RequestOption) (res *PrefixDeleteResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env PrefixDeleteResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/addressing/prefixes/%s", body.AccountID, prefixID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Modify the description for a prefix owned by the account.
+func (r *PrefixService) Edit(ctx context.Context, prefixID string, params PrefixEditParams, opts ...option.RequestOption) (res *AddressingIpamPrefixes, err error) {
+ opts = append(r.Options[:], opts...)
+ var env PrefixEditResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/addressing/prefixes/%s", params.AccountID, prefixID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// List a particular prefix owned by the account.
+func (r *PrefixService) Get(ctx context.Context, prefixID string, query PrefixGetParams, opts ...option.RequestOption) (res *AddressingIpamPrefixes, err error) {
+ opts = append(r.Options[:], opts...)
+ var env PrefixGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/addressing/prefixes/%s", query.AccountID, prefixID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type AddressingIpamPrefixes struct {
+ // Identifier
+ ID string `json:"id"`
+ // Identifier
+ AccountID string `json:"account_id"`
+ // Prefix advertisement status to the Internet. This field is only not 'null' if on
+ // demand is enabled.
+ Advertised bool `json:"advertised,nullable"`
+ // Last time the advertisement status was changed. This field is only not 'null' if
+ // on demand is enabled.
+ AdvertisedModifiedAt time.Time `json:"advertised_modified_at,nullable" format:"date-time"`
+ // Approval state of the prefix (P = pending, V = active).
+ Approved string `json:"approved"`
+ // Autonomous System Number (ASN) the prefix will be advertised under.
+ ASN int64 `json:"asn,nullable"`
+ // IP Prefix in Classless Inter-Domain Routing format.
+ Cidr string `json:"cidr"`
+ CreatedAt time.Time `json:"created_at" format:"date-time"`
+ // Description of the prefix.
+ Description string `json:"description"`
+ // Identifier for the uploaded LOA document.
+ LOADocumentID string `json:"loa_document_id,nullable"`
+ ModifiedAt time.Time `json:"modified_at" format:"date-time"`
+ // Whether advertisement of the prefix to the Internet may be dynamically enabled
+ // or disabled.
+ OnDemandEnabled bool `json:"on_demand_enabled"`
+ // Whether advertisement status of the prefix is locked, meaning it cannot be
+ // changed.
+ OnDemandLocked bool `json:"on_demand_locked"`
+ JSON addressingIpamPrefixesJSON `json:"-"`
+}
+
+// addressingIpamPrefixesJSON contains the JSON metadata for the struct
+// [AddressingIpamPrefixes]
+type addressingIpamPrefixesJSON struct {
+ ID apijson.Field
+ AccountID apijson.Field
+ Advertised apijson.Field
+ AdvertisedModifiedAt apijson.Field
+ Approved apijson.Field
+ ASN apijson.Field
+ Cidr apijson.Field
+ CreatedAt apijson.Field
+ Description apijson.Field
+ LOADocumentID apijson.Field
+ ModifiedAt apijson.Field
+ OnDemandEnabled apijson.Field
+ OnDemandLocked apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AddressingIpamPrefixes) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r addressingIpamPrefixesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Union satisfied by [addressing.PrefixDeleteResponseUnknown],
+// [addressing.PrefixDeleteResponseArray] or [shared.UnionString].
+type PrefixDeleteResponse interface {
+ ImplementsAddressingPrefixDeleteResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*PrefixDeleteResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(PrefixDeleteResponseArray{}),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+type PrefixDeleteResponseArray []interface{}
+
+func (r PrefixDeleteResponseArray) ImplementsAddressingPrefixDeleteResponse() {}
+
+type PrefixNewParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ // Autonomous System Number (ASN) the prefix will be advertised under.
+ ASN param.Field[int64] `json:"asn,required"`
+ // IP Prefix in Classless Inter-Domain Routing format.
+ Cidr param.Field[string] `json:"cidr,required"`
+ // Identifier for the uploaded LOA document.
+ LOADocumentID param.Field[string] `json:"loa_document_id,required"`
+}
+
+func (r PrefixNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type PrefixNewResponseEnvelope struct {
+ Errors []PrefixNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []PrefixNewResponseEnvelopeMessages `json:"messages,required"`
+ Result AddressingIpamPrefixes `json:"result,required"`
+ // Whether the API call was successful
+ Success PrefixNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON prefixNewResponseEnvelopeJSON `json:"-"`
+}
+
+// prefixNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [PrefixNewResponseEnvelope]
+type prefixNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PrefixNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r prefixNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type PrefixNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON prefixNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// prefixNewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [PrefixNewResponseEnvelopeErrors]
+type prefixNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PrefixNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r prefixNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type PrefixNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON prefixNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// prefixNewResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [PrefixNewResponseEnvelopeMessages]
+type prefixNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PrefixNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r prefixNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type PrefixNewResponseEnvelopeSuccess bool
+
+const (
+ PrefixNewResponseEnvelopeSuccessTrue PrefixNewResponseEnvelopeSuccess = true
+)
+
+type PrefixListParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type PrefixListResponseEnvelope struct {
+ Errors []PrefixListResponseEnvelopeErrors `json:"errors,required"`
+ Messages []PrefixListResponseEnvelopeMessages `json:"messages,required"`
+ Result []AddressingIpamPrefixes `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success PrefixListResponseEnvelopeSuccess `json:"success,required"`
+ ResultInfo PrefixListResponseEnvelopeResultInfo `json:"result_info"`
+ JSON prefixListResponseEnvelopeJSON `json:"-"`
+}
+
+// prefixListResponseEnvelopeJSON contains the JSON metadata for the struct
+// [PrefixListResponseEnvelope]
+type prefixListResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ ResultInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PrefixListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r prefixListResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type PrefixListResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON prefixListResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// prefixListResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [PrefixListResponseEnvelopeErrors]
+type prefixListResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PrefixListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r prefixListResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type PrefixListResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON prefixListResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// prefixListResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [PrefixListResponseEnvelopeMessages]
+type prefixListResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PrefixListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r prefixListResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type PrefixListResponseEnvelopeSuccess bool
+
+const (
+ PrefixListResponseEnvelopeSuccessTrue PrefixListResponseEnvelopeSuccess = true
+)
+
+type PrefixListResponseEnvelopeResultInfo struct {
+ // Total number of results for the requested service
+ Count float64 `json:"count"`
+ // Current page within paginated list of results
+ Page float64 `json:"page"`
+ // Number of results per page of results
+ PerPage float64 `json:"per_page"`
+ // Total results available without any search parameters
+ TotalCount float64 `json:"total_count"`
+ JSON prefixListResponseEnvelopeResultInfoJSON `json:"-"`
+}
+
+// prefixListResponseEnvelopeResultInfoJSON contains the JSON metadata for the
+// struct [PrefixListResponseEnvelopeResultInfo]
+type prefixListResponseEnvelopeResultInfoJSON struct {
+ Count apijson.Field
+ Page apijson.Field
+ PerPage apijson.Field
+ TotalCount apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PrefixListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r prefixListResponseEnvelopeResultInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type PrefixDeleteParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type PrefixDeleteResponseEnvelope struct {
+ Errors []PrefixDeleteResponseEnvelopeErrors `json:"errors,required"`
+ Messages []PrefixDeleteResponseEnvelopeMessages `json:"messages,required"`
+ Result PrefixDeleteResponse `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success PrefixDeleteResponseEnvelopeSuccess `json:"success,required"`
+ ResultInfo PrefixDeleteResponseEnvelopeResultInfo `json:"result_info"`
+ JSON prefixDeleteResponseEnvelopeJSON `json:"-"`
+}
+
+// prefixDeleteResponseEnvelopeJSON contains the JSON metadata for the struct
+// [PrefixDeleteResponseEnvelope]
+type prefixDeleteResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ ResultInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PrefixDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r prefixDeleteResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type PrefixDeleteResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON prefixDeleteResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// prefixDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [PrefixDeleteResponseEnvelopeErrors]
+type prefixDeleteResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PrefixDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r prefixDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type PrefixDeleteResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON prefixDeleteResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// prefixDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [PrefixDeleteResponseEnvelopeMessages]
+type prefixDeleteResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PrefixDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r prefixDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type PrefixDeleteResponseEnvelopeSuccess bool
+
+const (
+ PrefixDeleteResponseEnvelopeSuccessTrue PrefixDeleteResponseEnvelopeSuccess = true
+)
+
+type PrefixDeleteResponseEnvelopeResultInfo struct {
+ // Total number of results for the requested service
+ Count float64 `json:"count"`
+ // Current page within paginated list of results
+ Page float64 `json:"page"`
+ // Number of results per page of results
+ PerPage float64 `json:"per_page"`
+ // Total results available without any search parameters
+ TotalCount float64 `json:"total_count"`
+ JSON prefixDeleteResponseEnvelopeResultInfoJSON `json:"-"`
+}
+
+// prefixDeleteResponseEnvelopeResultInfoJSON contains the JSON metadata for the
+// struct [PrefixDeleteResponseEnvelopeResultInfo]
+type prefixDeleteResponseEnvelopeResultInfoJSON struct {
+ Count apijson.Field
+ Page apijson.Field
+ PerPage apijson.Field
+ TotalCount apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PrefixDeleteResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r prefixDeleteResponseEnvelopeResultInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type PrefixEditParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ // Description of the prefix.
+ Description param.Field[string] `json:"description,required"`
+}
+
+func (r PrefixEditParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type PrefixEditResponseEnvelope struct {
+ Errors []PrefixEditResponseEnvelopeErrors `json:"errors,required"`
+ Messages []PrefixEditResponseEnvelopeMessages `json:"messages,required"`
+ Result AddressingIpamPrefixes `json:"result,required"`
+ // Whether the API call was successful
+ Success PrefixEditResponseEnvelopeSuccess `json:"success,required"`
+ JSON prefixEditResponseEnvelopeJSON `json:"-"`
+}
+
+// prefixEditResponseEnvelopeJSON contains the JSON metadata for the struct
+// [PrefixEditResponseEnvelope]
+type prefixEditResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PrefixEditResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r prefixEditResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type PrefixEditResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON prefixEditResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// prefixEditResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [PrefixEditResponseEnvelopeErrors]
+type prefixEditResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PrefixEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r prefixEditResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type PrefixEditResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON prefixEditResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// prefixEditResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [PrefixEditResponseEnvelopeMessages]
+type prefixEditResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PrefixEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r prefixEditResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type PrefixEditResponseEnvelopeSuccess bool
+
+const (
+ PrefixEditResponseEnvelopeSuccessTrue PrefixEditResponseEnvelopeSuccess = true
+)
+
+type PrefixGetParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type PrefixGetResponseEnvelope struct {
+ Errors []PrefixGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []PrefixGetResponseEnvelopeMessages `json:"messages,required"`
+ Result AddressingIpamPrefixes `json:"result,required"`
+ // Whether the API call was successful
+ Success PrefixGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON prefixGetResponseEnvelopeJSON `json:"-"`
+}
+
+// prefixGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [PrefixGetResponseEnvelope]
+type prefixGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PrefixGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r prefixGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type PrefixGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON prefixGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// prefixGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [PrefixGetResponseEnvelopeErrors]
+type prefixGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PrefixGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r prefixGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type PrefixGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON prefixGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// prefixGetResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [PrefixGetResponseEnvelopeMessages]
+type prefixGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PrefixGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r prefixGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type PrefixGetResponseEnvelopeSuccess bool
+
+const (
+ PrefixGetResponseEnvelopeSuccessTrue PrefixGetResponseEnvelopeSuccess = true
+)
diff --git a/addressing/prefix_test.go b/addressing/prefix_test.go
new file mode 100644
index 00000000000..781c8f4d65d
--- /dev/null
+++ b/addressing/prefix_test.go
@@ -0,0 +1,161 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package addressing_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/addressing"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestPrefixNew(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"),
+ )
+ _, err := client.Addressing.Prefixes.New(context.TODO(), addressing.PrefixNewParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ ASN: cloudflare.F(int64(209242)),
+ Cidr: cloudflare.F("192.0.2.0/24"),
+ LOADocumentID: cloudflare.F("d933b1530bc56c9953cf8ce166da8004"),
+ })
+ 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())
+ }
+}
+
+func TestPrefixList(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"),
+ )
+ _, err := client.Addressing.Prefixes.List(context.TODO(), addressing.PrefixListParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ })
+ 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())
+ }
+}
+
+func TestPrefixDelete(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"),
+ )
+ _, err := client.Addressing.Prefixes.Delete(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ addressing.PrefixDeleteParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestPrefixEdit(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"),
+ )
+ _, err := client.Addressing.Prefixes.Edit(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ addressing.PrefixEditParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Description: cloudflare.F("Internal test prefix"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestPrefixGet(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"),
+ )
+ _, err := client.Addressing.Prefixes.Get(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ addressing.PrefixGetParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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/addressing/prefixbgp.go b/addressing/prefixbgp.go
new file mode 100644
index 00000000000..f2c918f5b2d
--- /dev/null
+++ b/addressing/prefixbgp.go
@@ -0,0 +1,30 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package addressing
+
+import (
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// PrefixBGPService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewPrefixBGPService] method instead.
+type PrefixBGPService struct {
+ Options []option.RequestOption
+ Bindings *PrefixBGPBindingService
+ Prefixes *PrefixBGPPrefixService
+ Statuses *PrefixBGPStatusService
+}
+
+// NewPrefixBGPService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewPrefixBGPService(opts ...option.RequestOption) (r *PrefixBGPService) {
+ r = &PrefixBGPService{}
+ r.Options = opts
+ r.Bindings = NewPrefixBGPBindingService(opts...)
+ r.Prefixes = NewPrefixBGPPrefixService(opts...)
+ r.Statuses = NewPrefixBGPStatusService(opts...)
+ return
+}
diff --git a/addressing/prefixbgpbinding.go b/addressing/prefixbgpbinding.go
new file mode 100644
index 00000000000..4a19f704d68
--- /dev/null
+++ b/addressing/prefixbgpbinding.go
@@ -0,0 +1,539 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package addressing
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "reflect"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/tidwall/gjson"
+)
+
+// PrefixBGPBindingService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewPrefixBGPBindingService] method
+// instead.
+type PrefixBGPBindingService struct {
+ Options []option.RequestOption
+}
+
+// NewPrefixBGPBindingService generates a new service that applies the given
+// options to each request. These options are applied after the parent client's
+// options (if there is one), and before any request-specific options.
+func NewPrefixBGPBindingService(opts ...option.RequestOption) (r *PrefixBGPBindingService) {
+ r = &PrefixBGPBindingService{}
+ r.Options = opts
+ return
+}
+
+// Creates a new Service Binding, routing traffic to IPs within the given CIDR to a
+// service running on Cloudflare's network. **Note:** This API may only be used on
+// prefixes currently configured with a Magic Transit service binding, and only
+// allows creating service bindings for the Cloudflare CDN or Cloudflare Spectrum.
+func (r *PrefixBGPBindingService) New(ctx context.Context, prefixID string, params PrefixBGPBindingNewParams, opts ...option.RequestOption) (res *AddressingServiceBinding, err error) {
+ opts = append(r.Options[:], opts...)
+ var env PrefixBGPBindingNewResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/addressing/prefixes/%s/bindings", params.AccountID, prefixID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// List the Cloudflare services this prefix is currently bound to. Traffic sent to
+// an address within an IP prefix will be routed to the Cloudflare service of the
+// most-specific Service Binding matching the address. **Example:** binding
+// `192.0.2.0/24` to Cloudflare Magic Transit and `192.0.2.1/32` to the Cloudflare
+// CDN would route traffic for `192.0.2.1` to the CDN, and traffic for all other
+// IPs in the prefix to Cloudflare Magic Transit.
+func (r *PrefixBGPBindingService) List(ctx context.Context, prefixID string, query PrefixBGPBindingListParams, opts ...option.RequestOption) (res *[]AddressingServiceBinding, err error) {
+ opts = append(r.Options[:], opts...)
+ var env PrefixBGPBindingListResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/addressing/prefixes/%s/bindings", query.AccountID, prefixID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Delete a Service Binding
+func (r *PrefixBGPBindingService) Delete(ctx context.Context, prefixID string, bindingID string, body PrefixBGPBindingDeleteParams, opts ...option.RequestOption) (res *PrefixBGPBindingDeleteResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env PrefixBGPBindingDeleteResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/addressing/prefixes/%s/bindings/%s", body.AccountID, prefixID, bindingID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Fetch a single Service Binding
+func (r *PrefixBGPBindingService) Get(ctx context.Context, prefixID string, bindingID string, query PrefixBGPBindingGetParams, opts ...option.RequestOption) (res *AddressingServiceBinding, err error) {
+ opts = append(r.Options[:], opts...)
+ var env PrefixBGPBindingGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/addressing/prefixes/%s/bindings/%s", query.AccountID, prefixID, bindingID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type AddressingServiceBinding struct {
+ // Identifier
+ ID string `json:"id"`
+ // IP Prefix in Classless Inter-Domain Routing format.
+ Cidr string `json:"cidr"`
+ // Status of a Service Binding's deployment to the Cloudflare network
+ Provisioning AddressingServiceBindingProvisioning `json:"provisioning"`
+ // Identifier
+ ServiceID string `json:"service_id"`
+ // Name of a service running on the Cloudflare network
+ ServiceName string `json:"service_name"`
+ JSON addressingServiceBindingJSON `json:"-"`
+}
+
+// addressingServiceBindingJSON contains the JSON metadata for the struct
+// [AddressingServiceBinding]
+type addressingServiceBindingJSON struct {
+ ID apijson.Field
+ Cidr apijson.Field
+ Provisioning apijson.Field
+ ServiceID apijson.Field
+ ServiceName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AddressingServiceBinding) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r addressingServiceBindingJSON) RawJSON() string {
+ return r.raw
+}
+
+// Status of a Service Binding's deployment to the Cloudflare network
+type AddressingServiceBindingProvisioning struct {
+ // When a binding has been deployed to a majority of Cloudflare datacenters, the
+ // binding will become active and can be used with its associated service.
+ State AddressingServiceBindingProvisioningState `json:"state"`
+ JSON addressingServiceBindingProvisioningJSON `json:"-"`
+}
+
+// addressingServiceBindingProvisioningJSON contains the JSON metadata for the
+// struct [AddressingServiceBindingProvisioning]
+type addressingServiceBindingProvisioningJSON struct {
+ State apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AddressingServiceBindingProvisioning) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r addressingServiceBindingProvisioningJSON) RawJSON() string {
+ return r.raw
+}
+
+// When a binding has been deployed to a majority of Cloudflare datacenters, the
+// binding will become active and can be used with its associated service.
+type AddressingServiceBindingProvisioningState string
+
+const (
+ AddressingServiceBindingProvisioningStateProvisioning AddressingServiceBindingProvisioningState = "provisioning"
+ AddressingServiceBindingProvisioningStateActive AddressingServiceBindingProvisioningState = "active"
+)
+
+// Union satisfied by [addressing.PrefixBGPBindingDeleteResponseUnknown],
+// [addressing.PrefixBGPBindingDeleteResponseArray] or [shared.UnionString].
+type PrefixBGPBindingDeleteResponse interface {
+ ImplementsAddressingPrefixBGPBindingDeleteResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*PrefixBGPBindingDeleteResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(PrefixBGPBindingDeleteResponseArray{}),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+type PrefixBGPBindingDeleteResponseArray []interface{}
+
+func (r PrefixBGPBindingDeleteResponseArray) ImplementsAddressingPrefixBGPBindingDeleteResponse() {}
+
+type PrefixBGPBindingNewParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ // IP Prefix in Classless Inter-Domain Routing format.
+ Cidr param.Field[string] `json:"cidr"`
+ // Identifier
+ ServiceID param.Field[string] `json:"service_id"`
+}
+
+func (r PrefixBGPBindingNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type PrefixBGPBindingNewResponseEnvelope struct {
+ Errors []PrefixBGPBindingNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []PrefixBGPBindingNewResponseEnvelopeMessages `json:"messages,required"`
+ Result AddressingServiceBinding `json:"result,required"`
+ // Whether the API call was successful
+ Success PrefixBGPBindingNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON prefixBGPBindingNewResponseEnvelopeJSON `json:"-"`
+}
+
+// prefixBGPBindingNewResponseEnvelopeJSON contains the JSON metadata for the
+// struct [PrefixBGPBindingNewResponseEnvelope]
+type prefixBGPBindingNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PrefixBGPBindingNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r prefixBGPBindingNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type PrefixBGPBindingNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON prefixBGPBindingNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// prefixBGPBindingNewResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [PrefixBGPBindingNewResponseEnvelopeErrors]
+type prefixBGPBindingNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PrefixBGPBindingNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r prefixBGPBindingNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type PrefixBGPBindingNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON prefixBGPBindingNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// prefixBGPBindingNewResponseEnvelopeMessagesJSON contains the JSON metadata for
+// the struct [PrefixBGPBindingNewResponseEnvelopeMessages]
+type prefixBGPBindingNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PrefixBGPBindingNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r prefixBGPBindingNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type PrefixBGPBindingNewResponseEnvelopeSuccess bool
+
+const (
+ PrefixBGPBindingNewResponseEnvelopeSuccessTrue PrefixBGPBindingNewResponseEnvelopeSuccess = true
+)
+
+type PrefixBGPBindingListParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type PrefixBGPBindingListResponseEnvelope struct {
+ Errors []PrefixBGPBindingListResponseEnvelopeErrors `json:"errors,required"`
+ Messages []PrefixBGPBindingListResponseEnvelopeMessages `json:"messages,required"`
+ Result []AddressingServiceBinding `json:"result,required"`
+ // Whether the API call was successful
+ Success PrefixBGPBindingListResponseEnvelopeSuccess `json:"success,required"`
+ JSON prefixBGPBindingListResponseEnvelopeJSON `json:"-"`
+}
+
+// prefixBGPBindingListResponseEnvelopeJSON contains the JSON metadata for the
+// struct [PrefixBGPBindingListResponseEnvelope]
+type prefixBGPBindingListResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PrefixBGPBindingListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r prefixBGPBindingListResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type PrefixBGPBindingListResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON prefixBGPBindingListResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// prefixBGPBindingListResponseEnvelopeErrorsJSON contains the JSON metadata for
+// the struct [PrefixBGPBindingListResponseEnvelopeErrors]
+type prefixBGPBindingListResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PrefixBGPBindingListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r prefixBGPBindingListResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type PrefixBGPBindingListResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON prefixBGPBindingListResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// prefixBGPBindingListResponseEnvelopeMessagesJSON contains the JSON metadata for
+// the struct [PrefixBGPBindingListResponseEnvelopeMessages]
+type prefixBGPBindingListResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PrefixBGPBindingListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r prefixBGPBindingListResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type PrefixBGPBindingListResponseEnvelopeSuccess bool
+
+const (
+ PrefixBGPBindingListResponseEnvelopeSuccessTrue PrefixBGPBindingListResponseEnvelopeSuccess = true
+)
+
+type PrefixBGPBindingDeleteParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type PrefixBGPBindingDeleteResponseEnvelope struct {
+ Errors []PrefixBGPBindingDeleteResponseEnvelopeErrors `json:"errors,required"`
+ Messages []PrefixBGPBindingDeleteResponseEnvelopeMessages `json:"messages,required"`
+ Result PrefixBGPBindingDeleteResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success PrefixBGPBindingDeleteResponseEnvelopeSuccess `json:"success,required"`
+ JSON prefixBGPBindingDeleteResponseEnvelopeJSON `json:"-"`
+}
+
+// prefixBGPBindingDeleteResponseEnvelopeJSON contains the JSON metadata for the
+// struct [PrefixBGPBindingDeleteResponseEnvelope]
+type prefixBGPBindingDeleteResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PrefixBGPBindingDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r prefixBGPBindingDeleteResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type PrefixBGPBindingDeleteResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON prefixBGPBindingDeleteResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// prefixBGPBindingDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for
+// the struct [PrefixBGPBindingDeleteResponseEnvelopeErrors]
+type prefixBGPBindingDeleteResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PrefixBGPBindingDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r prefixBGPBindingDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type PrefixBGPBindingDeleteResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON prefixBGPBindingDeleteResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// prefixBGPBindingDeleteResponseEnvelopeMessagesJSON contains the JSON metadata
+// for the struct [PrefixBGPBindingDeleteResponseEnvelopeMessages]
+type prefixBGPBindingDeleteResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PrefixBGPBindingDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r prefixBGPBindingDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type PrefixBGPBindingDeleteResponseEnvelopeSuccess bool
+
+const (
+ PrefixBGPBindingDeleteResponseEnvelopeSuccessTrue PrefixBGPBindingDeleteResponseEnvelopeSuccess = true
+)
+
+type PrefixBGPBindingGetParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type PrefixBGPBindingGetResponseEnvelope struct {
+ Errors []PrefixBGPBindingGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []PrefixBGPBindingGetResponseEnvelopeMessages `json:"messages,required"`
+ Result AddressingServiceBinding `json:"result,required"`
+ // Whether the API call was successful
+ Success PrefixBGPBindingGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON prefixBGPBindingGetResponseEnvelopeJSON `json:"-"`
+}
+
+// prefixBGPBindingGetResponseEnvelopeJSON contains the JSON metadata for the
+// struct [PrefixBGPBindingGetResponseEnvelope]
+type prefixBGPBindingGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PrefixBGPBindingGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r prefixBGPBindingGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type PrefixBGPBindingGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON prefixBGPBindingGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// prefixBGPBindingGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [PrefixBGPBindingGetResponseEnvelopeErrors]
+type prefixBGPBindingGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PrefixBGPBindingGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r prefixBGPBindingGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type PrefixBGPBindingGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON prefixBGPBindingGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// prefixBGPBindingGetResponseEnvelopeMessagesJSON contains the JSON metadata for
+// the struct [PrefixBGPBindingGetResponseEnvelopeMessages]
+type prefixBGPBindingGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PrefixBGPBindingGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r prefixBGPBindingGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type PrefixBGPBindingGetResponseEnvelopeSuccess bool
+
+const (
+ PrefixBGPBindingGetResponseEnvelopeSuccessTrue PrefixBGPBindingGetResponseEnvelopeSuccess = true
+)
diff --git a/addressing/prefixbgpbinding_test.go b/addressing/prefixbgpbinding_test.go
new file mode 100644
index 00000000000..1f8e7d0183d
--- /dev/null
+++ b/addressing/prefixbgpbinding_test.go
@@ -0,0 +1,139 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package addressing_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/addressing"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestPrefixBGPBindingNewWithOptionalParams(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"),
+ )
+ _, err := client.Addressing.Prefixes.BGP.Bindings.New(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ addressing.PrefixBGPBindingNewParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Cidr: cloudflare.F("192.0.2.0/24"),
+ ServiceID: cloudflare.F("2db684ee7ca04e159946fd05b99e1bcd"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestPrefixBGPBindingList(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"),
+ )
+ _, err := client.Addressing.Prefixes.BGP.Bindings.List(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ addressing.PrefixBGPBindingListParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestPrefixBGPBindingDelete(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"),
+ )
+ _, err := client.Addressing.Prefixes.BGP.Bindings.Delete(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ addressing.PrefixBGPBindingDeleteParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestPrefixBGPBindingGet(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"),
+ )
+ _, err := client.Addressing.Prefixes.BGP.Bindings.Get(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ addressing.PrefixBGPBindingGetParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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/addressing/prefixbgpprefix.go b/addressing/prefixbgpprefix.go
new file mode 100644
index 00000000000..821f5f80fc6
--- /dev/null
+++ b/addressing/prefixbgpprefix.go
@@ -0,0 +1,478 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package addressing
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// PrefixBGPPrefixService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewPrefixBGPPrefixService] method
+// instead.
+type PrefixBGPPrefixService struct {
+ Options []option.RequestOption
+}
+
+// NewPrefixBGPPrefixService generates a new service that applies the given options
+// to each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewPrefixBGPPrefixService(opts ...option.RequestOption) (r *PrefixBGPPrefixService) {
+ r = &PrefixBGPPrefixService{}
+ r.Options = opts
+ return
+}
+
+// List all BGP Prefixes within the specified IP Prefix. BGP Prefixes are used to
+// control which specific subnets are advertised to the Internet. It is possible to
+// advertise subnets more specific than an IP Prefix by creating more specific BGP
+// Prefixes.
+func (r *PrefixBGPPrefixService) List(ctx context.Context, prefixID string, query PrefixBGPPrefixListParams, opts ...option.RequestOption) (res *[]AddressingIpamBGPPrefixes, err error) {
+ opts = append(r.Options[:], opts...)
+ var env PrefixBGPPrefixListResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/addressing/prefixes/%s/bgp/prefixes", query.AccountID, prefixID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Update the properties of a BGP Prefix, such as the on demand advertisement
+// status (advertised or withdrawn).
+func (r *PrefixBGPPrefixService) Edit(ctx context.Context, prefixID string, bgpPrefixID string, params PrefixBGPPrefixEditParams, opts ...option.RequestOption) (res *AddressingIpamBGPPrefixes, err error) {
+ opts = append(r.Options[:], opts...)
+ var env PrefixBGPPrefixEditResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/addressing/prefixes/%s/bgp/prefixes/%s", params.AccountID, prefixID, bgpPrefixID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Retrieve a single BGP Prefix according to its identifier
+func (r *PrefixBGPPrefixService) Get(ctx context.Context, prefixID string, bgpPrefixID string, query PrefixBGPPrefixGetParams, opts ...option.RequestOption) (res *AddressingIpamBGPPrefixes, err error) {
+ opts = append(r.Options[:], opts...)
+ var env PrefixBGPPrefixGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/addressing/prefixes/%s/bgp/prefixes/%s", query.AccountID, prefixID, bgpPrefixID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type AddressingIpamBGPPrefixes struct {
+ // Identifier
+ ID string `json:"id"`
+ // Autonomous System Number (ASN) the prefix will be advertised under.
+ ASN int64 `json:"asn,nullable"`
+ BGPSignalOpts AddressingIpamBGPPrefixesBGPSignalOpts `json:"bgp_signal_opts"`
+ // IP Prefix in Classless Inter-Domain Routing format.
+ Cidr string `json:"cidr"`
+ CreatedAt time.Time `json:"created_at" format:"date-time"`
+ ModifiedAt time.Time `json:"modified_at" format:"date-time"`
+ OnDemand AddressingIpamBGPPrefixesOnDemand `json:"on_demand"`
+ JSON addressingIpamBGPPrefixesJSON `json:"-"`
+}
+
+// addressingIpamBGPPrefixesJSON contains the JSON metadata for the struct
+// [AddressingIpamBGPPrefixes]
+type addressingIpamBGPPrefixesJSON struct {
+ ID apijson.Field
+ ASN apijson.Field
+ BGPSignalOpts apijson.Field
+ Cidr apijson.Field
+ CreatedAt apijson.Field
+ ModifiedAt apijson.Field
+ OnDemand apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AddressingIpamBGPPrefixes) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r addressingIpamBGPPrefixesJSON) RawJSON() string {
+ return r.raw
+}
+
+type AddressingIpamBGPPrefixesBGPSignalOpts struct {
+ // Whether control of advertisement of the prefix to the Internet is enabled to be
+ // performed via BGP signal
+ Enabled bool `json:"enabled"`
+ // Last time BGP signaling control was toggled. This field is null if BGP signaling
+ // has never been enabled.
+ ModifiedAt time.Time `json:"modified_at,nullable" format:"date-time"`
+ JSON addressingIpamBGPPrefixesBGPSignalOptsJSON `json:"-"`
+}
+
+// addressingIpamBGPPrefixesBGPSignalOptsJSON contains the JSON metadata for the
+// struct [AddressingIpamBGPPrefixesBGPSignalOpts]
+type addressingIpamBGPPrefixesBGPSignalOptsJSON struct {
+ Enabled apijson.Field
+ ModifiedAt apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AddressingIpamBGPPrefixesBGPSignalOpts) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r addressingIpamBGPPrefixesBGPSignalOptsJSON) RawJSON() string {
+ return r.raw
+}
+
+type AddressingIpamBGPPrefixesOnDemand struct {
+ // Prefix advertisement status to the Internet. This field is only not 'null' if on
+ // demand is enabled.
+ Advertised bool `json:"advertised,nullable"`
+ // Last time the advertisement status was changed. This field is only not 'null' if
+ // on demand is enabled.
+ AdvertisedModifiedAt time.Time `json:"advertised_modified_at,nullable" format:"date-time"`
+ // Whether advertisement of the prefix to the Internet may be dynamically enabled
+ // or disabled.
+ OnDemandEnabled bool `json:"on_demand_enabled"`
+ // Whether advertisement status of the prefix is locked, meaning it cannot be
+ // changed.
+ OnDemandLocked bool `json:"on_demand_locked"`
+ JSON addressingIpamBGPPrefixesOnDemandJSON `json:"-"`
+}
+
+// addressingIpamBGPPrefixesOnDemandJSON contains the JSON metadata for the struct
+// [AddressingIpamBGPPrefixesOnDemand]
+type addressingIpamBGPPrefixesOnDemandJSON struct {
+ Advertised apijson.Field
+ AdvertisedModifiedAt apijson.Field
+ OnDemandEnabled apijson.Field
+ OnDemandLocked apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AddressingIpamBGPPrefixesOnDemand) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r addressingIpamBGPPrefixesOnDemandJSON) RawJSON() string {
+ return r.raw
+}
+
+type PrefixBGPPrefixListParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type PrefixBGPPrefixListResponseEnvelope struct {
+ Errors []PrefixBGPPrefixListResponseEnvelopeErrors `json:"errors,required"`
+ Messages []PrefixBGPPrefixListResponseEnvelopeMessages `json:"messages,required"`
+ Result []AddressingIpamBGPPrefixes `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success PrefixBGPPrefixListResponseEnvelopeSuccess `json:"success,required"`
+ ResultInfo PrefixBGPPrefixListResponseEnvelopeResultInfo `json:"result_info"`
+ JSON prefixBGPPrefixListResponseEnvelopeJSON `json:"-"`
+}
+
+// prefixBGPPrefixListResponseEnvelopeJSON contains the JSON metadata for the
+// struct [PrefixBGPPrefixListResponseEnvelope]
+type prefixBGPPrefixListResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ ResultInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PrefixBGPPrefixListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r prefixBGPPrefixListResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type PrefixBGPPrefixListResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON prefixBGPPrefixListResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// prefixBGPPrefixListResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [PrefixBGPPrefixListResponseEnvelopeErrors]
+type prefixBGPPrefixListResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PrefixBGPPrefixListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r prefixBGPPrefixListResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type PrefixBGPPrefixListResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON prefixBGPPrefixListResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// prefixBGPPrefixListResponseEnvelopeMessagesJSON contains the JSON metadata for
+// the struct [PrefixBGPPrefixListResponseEnvelopeMessages]
+type prefixBGPPrefixListResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PrefixBGPPrefixListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r prefixBGPPrefixListResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type PrefixBGPPrefixListResponseEnvelopeSuccess bool
+
+const (
+ PrefixBGPPrefixListResponseEnvelopeSuccessTrue PrefixBGPPrefixListResponseEnvelopeSuccess = true
+)
+
+type PrefixBGPPrefixListResponseEnvelopeResultInfo struct {
+ // Total number of results for the requested service
+ Count float64 `json:"count"`
+ // Current page within paginated list of results
+ Page float64 `json:"page"`
+ // Number of results per page of results
+ PerPage float64 `json:"per_page"`
+ // Total results available without any search parameters
+ TotalCount float64 `json:"total_count"`
+ JSON prefixBGPPrefixListResponseEnvelopeResultInfoJSON `json:"-"`
+}
+
+// prefixBGPPrefixListResponseEnvelopeResultInfoJSON contains the JSON metadata for
+// the struct [PrefixBGPPrefixListResponseEnvelopeResultInfo]
+type prefixBGPPrefixListResponseEnvelopeResultInfoJSON struct {
+ Count apijson.Field
+ Page apijson.Field
+ PerPage apijson.Field
+ TotalCount apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PrefixBGPPrefixListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r prefixBGPPrefixListResponseEnvelopeResultInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type PrefixBGPPrefixEditParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ OnDemand param.Field[PrefixBGPPrefixEditParamsOnDemand] `json:"on_demand"`
+}
+
+func (r PrefixBGPPrefixEditParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type PrefixBGPPrefixEditParamsOnDemand struct {
+ Advertised param.Field[bool] `json:"advertised"`
+}
+
+func (r PrefixBGPPrefixEditParamsOnDemand) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type PrefixBGPPrefixEditResponseEnvelope struct {
+ Errors []PrefixBGPPrefixEditResponseEnvelopeErrors `json:"errors,required"`
+ Messages []PrefixBGPPrefixEditResponseEnvelopeMessages `json:"messages,required"`
+ Result AddressingIpamBGPPrefixes `json:"result,required"`
+ // Whether the API call was successful
+ Success PrefixBGPPrefixEditResponseEnvelopeSuccess `json:"success,required"`
+ JSON prefixBGPPrefixEditResponseEnvelopeJSON `json:"-"`
+}
+
+// prefixBGPPrefixEditResponseEnvelopeJSON contains the JSON metadata for the
+// struct [PrefixBGPPrefixEditResponseEnvelope]
+type prefixBGPPrefixEditResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PrefixBGPPrefixEditResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r prefixBGPPrefixEditResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type PrefixBGPPrefixEditResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON prefixBGPPrefixEditResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// prefixBGPPrefixEditResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [PrefixBGPPrefixEditResponseEnvelopeErrors]
+type prefixBGPPrefixEditResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PrefixBGPPrefixEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r prefixBGPPrefixEditResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type PrefixBGPPrefixEditResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON prefixBGPPrefixEditResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// prefixBGPPrefixEditResponseEnvelopeMessagesJSON contains the JSON metadata for
+// the struct [PrefixBGPPrefixEditResponseEnvelopeMessages]
+type prefixBGPPrefixEditResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PrefixBGPPrefixEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r prefixBGPPrefixEditResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type PrefixBGPPrefixEditResponseEnvelopeSuccess bool
+
+const (
+ PrefixBGPPrefixEditResponseEnvelopeSuccessTrue PrefixBGPPrefixEditResponseEnvelopeSuccess = true
+)
+
+type PrefixBGPPrefixGetParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type PrefixBGPPrefixGetResponseEnvelope struct {
+ Errors []PrefixBGPPrefixGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []PrefixBGPPrefixGetResponseEnvelopeMessages `json:"messages,required"`
+ Result AddressingIpamBGPPrefixes `json:"result,required"`
+ // Whether the API call was successful
+ Success PrefixBGPPrefixGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON prefixBGPPrefixGetResponseEnvelopeJSON `json:"-"`
+}
+
+// prefixBGPPrefixGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [PrefixBGPPrefixGetResponseEnvelope]
+type prefixBGPPrefixGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PrefixBGPPrefixGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r prefixBGPPrefixGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type PrefixBGPPrefixGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON prefixBGPPrefixGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// prefixBGPPrefixGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [PrefixBGPPrefixGetResponseEnvelopeErrors]
+type prefixBGPPrefixGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PrefixBGPPrefixGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r prefixBGPPrefixGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type PrefixBGPPrefixGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON prefixBGPPrefixGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// prefixBGPPrefixGetResponseEnvelopeMessagesJSON contains the JSON metadata for
+// the struct [PrefixBGPPrefixGetResponseEnvelopeMessages]
+type prefixBGPPrefixGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PrefixBGPPrefixGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r prefixBGPPrefixGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type PrefixBGPPrefixGetResponseEnvelopeSuccess bool
+
+const (
+ PrefixBGPPrefixGetResponseEnvelopeSuccessTrue PrefixBGPPrefixGetResponseEnvelopeSuccess = true
+)
diff --git a/addressing/prefixbgpprefix_test.go b/addressing/prefixbgpprefix_test.go
new file mode 100644
index 00000000000..b063d175d74
--- /dev/null
+++ b/addressing/prefixbgpprefix_test.go
@@ -0,0 +1,110 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package addressing_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/addressing"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestPrefixBGPPrefixList(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"),
+ )
+ _, err := client.Addressing.Prefixes.BGP.Prefixes.List(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ addressing.PrefixBGPPrefixListParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestPrefixBGPPrefixEditWithOptionalParams(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"),
+ )
+ _, err := client.Addressing.Prefixes.BGP.Prefixes.Edit(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ addressing.PrefixBGPPrefixEditParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ OnDemand: cloudflare.F(addressing.PrefixBGPPrefixEditParamsOnDemand{
+ Advertised: cloudflare.F(true),
+ }),
+ },
+ )
+ 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())
+ }
+}
+
+func TestPrefixBGPPrefixGet(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"),
+ )
+ _, err := client.Addressing.Prefixes.BGP.Prefixes.Get(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ addressing.PrefixBGPPrefixGetParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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/addressing/prefixbgpstatus.go b/addressing/prefixbgpstatus.go
new file mode 100644
index 00000000000..d20afcb3180
--- /dev/null
+++ b/addressing/prefixbgpstatus.go
@@ -0,0 +1,289 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package addressing
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// PrefixBGPStatusService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewPrefixBGPStatusService] method
+// instead.
+type PrefixBGPStatusService struct {
+ Options []option.RequestOption
+}
+
+// NewPrefixBGPStatusService generates a new service that applies the given options
+// to each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewPrefixBGPStatusService(opts ...option.RequestOption) (r *PrefixBGPStatusService) {
+ r = &PrefixBGPStatusService{}
+ r.Options = opts
+ return
+}
+
+// Advertise or withdraw BGP route for a prefix.
+func (r *PrefixBGPStatusService) Edit(ctx context.Context, prefixID string, params PrefixBGPStatusEditParams, opts ...option.RequestOption) (res *PrefixBGPStatusEditResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env PrefixBGPStatusEditResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/addressing/prefixes/%s/bgp/status", params.AccountID, prefixID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// List the current advertisement state for a prefix.
+func (r *PrefixBGPStatusService) Get(ctx context.Context, prefixID string, query PrefixBGPStatusGetParams, opts ...option.RequestOption) (res *PrefixBGPStatusGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env PrefixBGPStatusGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/addressing/prefixes/%s/bgp/status", query.AccountID, prefixID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type PrefixBGPStatusEditResponse struct {
+ // Enablement of prefix advertisement to the Internet.
+ Advertised bool `json:"advertised"`
+ // Last time the advertisement status was changed. This field is only not 'null' if
+ // on demand is enabled.
+ AdvertisedModifiedAt time.Time `json:"advertised_modified_at,nullable" format:"date-time"`
+ JSON prefixBGPStatusEditResponseJSON `json:"-"`
+}
+
+// prefixBGPStatusEditResponseJSON contains the JSON metadata for the struct
+// [PrefixBGPStatusEditResponse]
+type prefixBGPStatusEditResponseJSON struct {
+ Advertised apijson.Field
+ AdvertisedModifiedAt apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PrefixBGPStatusEditResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r prefixBGPStatusEditResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type PrefixBGPStatusGetResponse struct {
+ // Enablement of prefix advertisement to the Internet.
+ Advertised bool `json:"advertised"`
+ // Last time the advertisement status was changed. This field is only not 'null' if
+ // on demand is enabled.
+ AdvertisedModifiedAt time.Time `json:"advertised_modified_at,nullable" format:"date-time"`
+ JSON prefixBGPStatusGetResponseJSON `json:"-"`
+}
+
+// prefixBGPStatusGetResponseJSON contains the JSON metadata for the struct
+// [PrefixBGPStatusGetResponse]
+type prefixBGPStatusGetResponseJSON struct {
+ Advertised apijson.Field
+ AdvertisedModifiedAt apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PrefixBGPStatusGetResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r prefixBGPStatusGetResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type PrefixBGPStatusEditParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ // Enablement of prefix advertisement to the Internet.
+ Advertised param.Field[bool] `json:"advertised,required"`
+}
+
+func (r PrefixBGPStatusEditParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type PrefixBGPStatusEditResponseEnvelope struct {
+ Errors []PrefixBGPStatusEditResponseEnvelopeErrors `json:"errors,required"`
+ Messages []PrefixBGPStatusEditResponseEnvelopeMessages `json:"messages,required"`
+ Result PrefixBGPStatusEditResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success PrefixBGPStatusEditResponseEnvelopeSuccess `json:"success,required"`
+ JSON prefixBGPStatusEditResponseEnvelopeJSON `json:"-"`
+}
+
+// prefixBGPStatusEditResponseEnvelopeJSON contains the JSON metadata for the
+// struct [PrefixBGPStatusEditResponseEnvelope]
+type prefixBGPStatusEditResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PrefixBGPStatusEditResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r prefixBGPStatusEditResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type PrefixBGPStatusEditResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON prefixBGPStatusEditResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// prefixBGPStatusEditResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [PrefixBGPStatusEditResponseEnvelopeErrors]
+type prefixBGPStatusEditResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PrefixBGPStatusEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r prefixBGPStatusEditResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type PrefixBGPStatusEditResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON prefixBGPStatusEditResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// prefixBGPStatusEditResponseEnvelopeMessagesJSON contains the JSON metadata for
+// the struct [PrefixBGPStatusEditResponseEnvelopeMessages]
+type prefixBGPStatusEditResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PrefixBGPStatusEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r prefixBGPStatusEditResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type PrefixBGPStatusEditResponseEnvelopeSuccess bool
+
+const (
+ PrefixBGPStatusEditResponseEnvelopeSuccessTrue PrefixBGPStatusEditResponseEnvelopeSuccess = true
+)
+
+type PrefixBGPStatusGetParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type PrefixBGPStatusGetResponseEnvelope struct {
+ Errors []PrefixBGPStatusGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []PrefixBGPStatusGetResponseEnvelopeMessages `json:"messages,required"`
+ Result PrefixBGPStatusGetResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success PrefixBGPStatusGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON prefixBGPStatusGetResponseEnvelopeJSON `json:"-"`
+}
+
+// prefixBGPStatusGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [PrefixBGPStatusGetResponseEnvelope]
+type prefixBGPStatusGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PrefixBGPStatusGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r prefixBGPStatusGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type PrefixBGPStatusGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON prefixBGPStatusGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// prefixBGPStatusGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [PrefixBGPStatusGetResponseEnvelopeErrors]
+type prefixBGPStatusGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PrefixBGPStatusGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r prefixBGPStatusGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type PrefixBGPStatusGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON prefixBGPStatusGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// prefixBGPStatusGetResponseEnvelopeMessagesJSON contains the JSON metadata for
+// the struct [PrefixBGPStatusGetResponseEnvelopeMessages]
+type prefixBGPStatusGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PrefixBGPStatusGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r prefixBGPStatusGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type PrefixBGPStatusGetResponseEnvelopeSuccess bool
+
+const (
+ PrefixBGPStatusGetResponseEnvelopeSuccessTrue PrefixBGPStatusGetResponseEnvelopeSuccess = true
+)
diff --git a/addressing/prefixbgpstatus_test.go b/addressing/prefixbgpstatus_test.go
new file mode 100644
index 00000000000..e016e002f47
--- /dev/null
+++ b/addressing/prefixbgpstatus_test.go
@@ -0,0 +1,76 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package addressing_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/addressing"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestPrefixBGPStatusEdit(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"),
+ )
+ _, err := client.Addressing.Prefixes.BGP.Statuses.Edit(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ addressing.PrefixBGPStatusEditParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Advertised: cloudflare.F(true),
+ },
+ )
+ 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())
+ }
+}
+
+func TestPrefixBGPStatusGet(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"),
+ )
+ _, err := client.Addressing.Prefixes.BGP.Statuses.Get(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ addressing.PrefixBGPStatusGetParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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/addressing/prefixdelegation.go b/addressing/prefixdelegation.go
new file mode 100644
index 00000000000..64de623ed12
--- /dev/null
+++ b/addressing/prefixdelegation.go
@@ -0,0 +1,428 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package addressing
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// PrefixDelegationService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewPrefixDelegationService] method
+// instead.
+type PrefixDelegationService struct {
+ Options []option.RequestOption
+}
+
+// NewPrefixDelegationService generates a new service that applies the given
+// options to each request. These options are applied after the parent client's
+// options (if there is one), and before any request-specific options.
+func NewPrefixDelegationService(opts ...option.RequestOption) (r *PrefixDelegationService) {
+ r = &PrefixDelegationService{}
+ r.Options = opts
+ return
+}
+
+// Create a new account delegation for a given IP prefix.
+func (r *PrefixDelegationService) New(ctx context.Context, prefixID string, params PrefixDelegationNewParams, opts ...option.RequestOption) (res *AddressingIpamDelegations, err error) {
+ opts = append(r.Options[:], opts...)
+ var env PrefixDelegationNewResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/addressing/prefixes/%s/delegations", params.AccountID, prefixID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// List all delegations for a given account IP prefix.
+func (r *PrefixDelegationService) List(ctx context.Context, prefixID string, query PrefixDelegationListParams, opts ...option.RequestOption) (res *[]AddressingIpamDelegations, err error) {
+ opts = append(r.Options[:], opts...)
+ var env PrefixDelegationListResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/addressing/prefixes/%s/delegations", query.AccountID, prefixID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Delete an account delegation for a given IP prefix.
+func (r *PrefixDelegationService) Delete(ctx context.Context, prefixID string, delegationID string, body PrefixDelegationDeleteParams, opts ...option.RequestOption) (res *PrefixDelegationDeleteResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env PrefixDelegationDeleteResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/addressing/prefixes/%s/delegations/%s", body.AccountID, prefixID, delegationID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type AddressingIpamDelegations struct {
+ // Delegation identifier tag.
+ ID string `json:"id"`
+ // IP Prefix in Classless Inter-Domain Routing format.
+ Cidr string `json:"cidr"`
+ CreatedAt time.Time `json:"created_at" format:"date-time"`
+ // Account identifier for the account to which prefix is being delegated.
+ DelegatedAccountID string `json:"delegated_account_id"`
+ ModifiedAt time.Time `json:"modified_at" format:"date-time"`
+ // Identifier
+ ParentPrefixID string `json:"parent_prefix_id"`
+ JSON addressingIpamDelegationsJSON `json:"-"`
+}
+
+// addressingIpamDelegationsJSON contains the JSON metadata for the struct
+// [AddressingIpamDelegations]
+type addressingIpamDelegationsJSON struct {
+ ID apijson.Field
+ Cidr apijson.Field
+ CreatedAt apijson.Field
+ DelegatedAccountID apijson.Field
+ ModifiedAt apijson.Field
+ ParentPrefixID apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AddressingIpamDelegations) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r addressingIpamDelegationsJSON) RawJSON() string {
+ return r.raw
+}
+
+type PrefixDelegationDeleteResponse struct {
+ // Delegation identifier tag.
+ ID string `json:"id"`
+ JSON prefixDelegationDeleteResponseJSON `json:"-"`
+}
+
+// prefixDelegationDeleteResponseJSON contains the JSON metadata for the struct
+// [PrefixDelegationDeleteResponse]
+type prefixDelegationDeleteResponseJSON struct {
+ ID apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PrefixDelegationDeleteResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r prefixDelegationDeleteResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type PrefixDelegationNewParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ // IP Prefix in Classless Inter-Domain Routing format.
+ Cidr param.Field[string] `json:"cidr,required"`
+ // Account identifier for the account to which prefix is being delegated.
+ DelegatedAccountID param.Field[string] `json:"delegated_account_id,required"`
+}
+
+func (r PrefixDelegationNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type PrefixDelegationNewResponseEnvelope struct {
+ Errors []PrefixDelegationNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []PrefixDelegationNewResponseEnvelopeMessages `json:"messages,required"`
+ Result AddressingIpamDelegations `json:"result,required"`
+ // Whether the API call was successful
+ Success PrefixDelegationNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON prefixDelegationNewResponseEnvelopeJSON `json:"-"`
+}
+
+// prefixDelegationNewResponseEnvelopeJSON contains the JSON metadata for the
+// struct [PrefixDelegationNewResponseEnvelope]
+type prefixDelegationNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PrefixDelegationNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r prefixDelegationNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type PrefixDelegationNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON prefixDelegationNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// prefixDelegationNewResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [PrefixDelegationNewResponseEnvelopeErrors]
+type prefixDelegationNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PrefixDelegationNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r prefixDelegationNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type PrefixDelegationNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON prefixDelegationNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// prefixDelegationNewResponseEnvelopeMessagesJSON contains the JSON metadata for
+// the struct [PrefixDelegationNewResponseEnvelopeMessages]
+type prefixDelegationNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PrefixDelegationNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r prefixDelegationNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type PrefixDelegationNewResponseEnvelopeSuccess bool
+
+const (
+ PrefixDelegationNewResponseEnvelopeSuccessTrue PrefixDelegationNewResponseEnvelopeSuccess = true
+)
+
+type PrefixDelegationListParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type PrefixDelegationListResponseEnvelope struct {
+ Errors []PrefixDelegationListResponseEnvelopeErrors `json:"errors,required"`
+ Messages []PrefixDelegationListResponseEnvelopeMessages `json:"messages,required"`
+ Result []AddressingIpamDelegations `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success PrefixDelegationListResponseEnvelopeSuccess `json:"success,required"`
+ ResultInfo PrefixDelegationListResponseEnvelopeResultInfo `json:"result_info"`
+ JSON prefixDelegationListResponseEnvelopeJSON `json:"-"`
+}
+
+// prefixDelegationListResponseEnvelopeJSON contains the JSON metadata for the
+// struct [PrefixDelegationListResponseEnvelope]
+type prefixDelegationListResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ ResultInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PrefixDelegationListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r prefixDelegationListResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type PrefixDelegationListResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON prefixDelegationListResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// prefixDelegationListResponseEnvelopeErrorsJSON contains the JSON metadata for
+// the struct [PrefixDelegationListResponseEnvelopeErrors]
+type prefixDelegationListResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PrefixDelegationListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r prefixDelegationListResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type PrefixDelegationListResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON prefixDelegationListResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// prefixDelegationListResponseEnvelopeMessagesJSON contains the JSON metadata for
+// the struct [PrefixDelegationListResponseEnvelopeMessages]
+type prefixDelegationListResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PrefixDelegationListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r prefixDelegationListResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type PrefixDelegationListResponseEnvelopeSuccess bool
+
+const (
+ PrefixDelegationListResponseEnvelopeSuccessTrue PrefixDelegationListResponseEnvelopeSuccess = true
+)
+
+type PrefixDelegationListResponseEnvelopeResultInfo struct {
+ // Total number of results for the requested service
+ Count float64 `json:"count"`
+ // Current page within paginated list of results
+ Page float64 `json:"page"`
+ // Number of results per page of results
+ PerPage float64 `json:"per_page"`
+ // Total results available without any search parameters
+ TotalCount float64 `json:"total_count"`
+ JSON prefixDelegationListResponseEnvelopeResultInfoJSON `json:"-"`
+}
+
+// prefixDelegationListResponseEnvelopeResultInfoJSON contains the JSON metadata
+// for the struct [PrefixDelegationListResponseEnvelopeResultInfo]
+type prefixDelegationListResponseEnvelopeResultInfoJSON struct {
+ Count apijson.Field
+ Page apijson.Field
+ PerPage apijson.Field
+ TotalCount apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PrefixDelegationListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r prefixDelegationListResponseEnvelopeResultInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type PrefixDelegationDeleteParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type PrefixDelegationDeleteResponseEnvelope struct {
+ Errors []PrefixDelegationDeleteResponseEnvelopeErrors `json:"errors,required"`
+ Messages []PrefixDelegationDeleteResponseEnvelopeMessages `json:"messages,required"`
+ Result PrefixDelegationDeleteResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success PrefixDelegationDeleteResponseEnvelopeSuccess `json:"success,required"`
+ JSON prefixDelegationDeleteResponseEnvelopeJSON `json:"-"`
+}
+
+// prefixDelegationDeleteResponseEnvelopeJSON contains the JSON metadata for the
+// struct [PrefixDelegationDeleteResponseEnvelope]
+type prefixDelegationDeleteResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PrefixDelegationDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r prefixDelegationDeleteResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type PrefixDelegationDeleteResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON prefixDelegationDeleteResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// prefixDelegationDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for
+// the struct [PrefixDelegationDeleteResponseEnvelopeErrors]
+type prefixDelegationDeleteResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PrefixDelegationDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r prefixDelegationDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type PrefixDelegationDeleteResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON prefixDelegationDeleteResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// prefixDelegationDeleteResponseEnvelopeMessagesJSON contains the JSON metadata
+// for the struct [PrefixDelegationDeleteResponseEnvelopeMessages]
+type prefixDelegationDeleteResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PrefixDelegationDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r prefixDelegationDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type PrefixDelegationDeleteResponseEnvelopeSuccess bool
+
+const (
+ PrefixDelegationDeleteResponseEnvelopeSuccessTrue PrefixDelegationDeleteResponseEnvelopeSuccess = true
+)
diff --git a/addressing/prefixdelegation_test.go b/addressing/prefixdelegation_test.go
new file mode 100644
index 00000000000..4e1ea544b32
--- /dev/null
+++ b/addressing/prefixdelegation_test.go
@@ -0,0 +1,108 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package addressing_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/addressing"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestPrefixDelegationNew(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"),
+ )
+ _, err := client.Addressing.Prefixes.Delegations.New(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ addressing.PrefixDelegationNewParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Cidr: cloudflare.F("192.0.2.0/24"),
+ DelegatedAccountID: cloudflare.F("b1946ac92492d2347c6235b4d2611184"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestPrefixDelegationList(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"),
+ )
+ _, err := client.Addressing.Prefixes.Delegations.List(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ addressing.PrefixDelegationListParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestPrefixDelegationDelete(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"),
+ )
+ _, err := client.Addressing.Prefixes.Delegations.Delete(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ "d933b1530bc56c9953cf8ce166da8004",
+ addressing.PrefixDelegationDeleteParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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/addressing/service.go b/addressing/service.go
new file mode 100644
index 00000000000..32b06b3f46e
--- /dev/null
+++ b/addressing/service.go
@@ -0,0 +1,158 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package addressing
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// ServiceService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewServiceService] method instead.
+type ServiceService struct {
+ Options []option.RequestOption
+}
+
+// NewServiceService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewServiceService(opts ...option.RequestOption) (r *ServiceService) {
+ r = &ServiceService{}
+ r.Options = opts
+ return
+}
+
+// Bring-Your-Own IP (BYOIP) prefixes onboarded to Cloudflare must be bound to a
+// service running on the Cloudflare network to enable a Cloudflare product on the
+// IP addresses. This endpoint can be used as a reference of available services on
+// the Cloudflare network, and their service IDs.
+func (r *ServiceService) List(ctx context.Context, query ServiceListParams, opts ...option.RequestOption) (res *[]ServiceListResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env ServiceListResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/addressing/services", query.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type ServiceListResponse struct {
+ // Identifier
+ ID string `json:"id"`
+ // Name of a service running on the Cloudflare network
+ Name string `json:"name"`
+ JSON serviceListResponseJSON `json:"-"`
+}
+
+// serviceListResponseJSON contains the JSON metadata for the struct
+// [ServiceListResponse]
+type serviceListResponseJSON struct {
+ ID apijson.Field
+ Name apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ServiceListResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r serviceListResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type ServiceListParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type ServiceListResponseEnvelope struct {
+ Errors []ServiceListResponseEnvelopeErrors `json:"errors,required"`
+ Messages []ServiceListResponseEnvelopeMessages `json:"messages,required"`
+ Result []ServiceListResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success ServiceListResponseEnvelopeSuccess `json:"success,required"`
+ JSON serviceListResponseEnvelopeJSON `json:"-"`
+}
+
+// serviceListResponseEnvelopeJSON contains the JSON metadata for the struct
+// [ServiceListResponseEnvelope]
+type serviceListResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ServiceListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r serviceListResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type ServiceListResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON serviceListResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// serviceListResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [ServiceListResponseEnvelopeErrors]
+type serviceListResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ServiceListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r serviceListResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type ServiceListResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON serviceListResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// serviceListResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [ServiceListResponseEnvelopeMessages]
+type serviceListResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ServiceListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r serviceListResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type ServiceListResponseEnvelopeSuccess bool
+
+const (
+ ServiceListResponseEnvelopeSuccessTrue ServiceListResponseEnvelopeSuccess = true
+)
diff --git a/addressing/service_test.go b/addressing/service_test.go
new file mode 100644
index 00000000000..e9a332b4c55
--- /dev/null
+++ b/addressing/service_test.go
@@ -0,0 +1,41 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package addressing_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/addressing"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestServiceList(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"),
+ )
+ _, err := client.Addressing.Services.List(context.TODO(), addressing.ServiceListParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ })
+ 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/addressingaddressmap.go b/addressingaddressmap.go
deleted file mode 100644
index 06ead822a74..00000000000
--- a/addressingaddressmap.go
+++ /dev/null
@@ -1,989 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "reflect"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/option"
- "github.com/tidwall/gjson"
-)
-
-// AddressingAddressMapService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewAddressingAddressMapService]
-// method instead.
-type AddressingAddressMapService struct {
- Options []option.RequestOption
- Accounts *AddressingAddressMapAccountService
- IPs *AddressingAddressMapIPService
- Zones *AddressingAddressMapZoneService
-}
-
-// NewAddressingAddressMapService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewAddressingAddressMapService(opts ...option.RequestOption) (r *AddressingAddressMapService) {
- r = &AddressingAddressMapService{}
- r.Options = opts
- r.Accounts = NewAddressingAddressMapAccountService(opts...)
- r.IPs = NewAddressingAddressMapIPService(opts...)
- r.Zones = NewAddressingAddressMapZoneService(opts...)
- return
-}
-
-// Create a new address map under the account.
-func (r *AddressingAddressMapService) New(ctx context.Context, params AddressingAddressMapNewParams, opts ...option.RequestOption) (res *AddressingAddressMapNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env AddressingAddressMapNewResponseEnvelope
- path := fmt.Sprintf("accounts/%s/addressing/address_maps", params.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// List all address maps owned by the account.
-func (r *AddressingAddressMapService) List(ctx context.Context, query AddressingAddressMapListParams, opts ...option.RequestOption) (res *[]AddressingAddressMapListResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env AddressingAddressMapListResponseEnvelope
- path := fmt.Sprintf("accounts/%s/addressing/address_maps", query.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Delete a particular address map owned by the account. An Address Map must be
-// disabled before it can be deleted.
-func (r *AddressingAddressMapService) Delete(ctx context.Context, addressMapID string, body AddressingAddressMapDeleteParams, opts ...option.RequestOption) (res *AddressingAddressMapDeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env AddressingAddressMapDeleteResponseEnvelope
- path := fmt.Sprintf("accounts/%s/addressing/address_maps/%s", body.AccountID, addressMapID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Modify properties of an address map owned by the account.
-func (r *AddressingAddressMapService) Edit(ctx context.Context, addressMapID string, params AddressingAddressMapEditParams, opts ...option.RequestOption) (res *AddressingAddressMapEditResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env AddressingAddressMapEditResponseEnvelope
- path := fmt.Sprintf("accounts/%s/addressing/address_maps/%s", params.AccountID, addressMapID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Show a particular address map owned by the account.
-func (r *AddressingAddressMapService) Get(ctx context.Context, addressMapID string, query AddressingAddressMapGetParams, opts ...option.RequestOption) (res *AddressingAddressMapGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env AddressingAddressMapGetResponseEnvelope
- path := fmt.Sprintf("accounts/%s/addressing/address_maps/%s", query.AccountID, addressMapID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type AddressingAddressMapNewResponse struct {
- // Identifier
- ID string `json:"id"`
- // If set to false, then the Address Map cannot be deleted via API. This is true
- // for Cloudflare-managed maps.
- CanDelete bool `json:"can_delete"`
- // If set to false, then the IPs on the Address Map cannot be modified via the API.
- // This is true for Cloudflare-managed maps.
- CanModifyIPs bool `json:"can_modify_ips"`
- CreatedAt time.Time `json:"created_at" format:"date-time"`
- // If you have legacy TLS clients which do not send the TLS server name indicator,
- // then you can specify one default SNI on the map. If Cloudflare receives a TLS
- // handshake from a client without an SNI, it will respond with the default SNI on
- // those IPs. The default SNI can be any valid zone or subdomain owned by the
- // account.
- DefaultSni string `json:"default_sni,nullable"`
- // An optional description field which may be used to describe the types of IPs or
- // zones on the map.
- Description string `json:"description,nullable"`
- // Whether the Address Map is enabled or not. Cloudflare's DNS will not respond
- // with IP addresses on an Address Map until the map is enabled.
- Enabled bool `json:"enabled,nullable"`
- // The set of IPs on the Address Map.
- IPs []AddressingAddressMapNewResponseIP `json:"ips"`
- // Zones and Accounts which will be assigned IPs on this Address Map. A zone
- // membership will take priority over an account membership.
- Memberships []AddressingAddressMapNewResponseMembership `json:"memberships"`
- ModifiedAt time.Time `json:"modified_at" format:"date-time"`
- JSON addressingAddressMapNewResponseJSON `json:"-"`
-}
-
-// addressingAddressMapNewResponseJSON contains the JSON metadata for the struct
-// [AddressingAddressMapNewResponse]
-type addressingAddressMapNewResponseJSON struct {
- ID apijson.Field
- CanDelete apijson.Field
- CanModifyIPs apijson.Field
- CreatedAt apijson.Field
- DefaultSni apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- IPs apijson.Field
- Memberships apijson.Field
- ModifiedAt apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingAddressMapNewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingAddressMapNewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingAddressMapNewResponseIP struct {
- CreatedAt time.Time `json:"created_at" format:"date-time"`
- // An IPv4 or IPv6 address.
- IP string `json:"ip"`
- JSON addressingAddressMapNewResponseIPJSON `json:"-"`
-}
-
-// addressingAddressMapNewResponseIPJSON contains the JSON metadata for the struct
-// [AddressingAddressMapNewResponseIP]
-type addressingAddressMapNewResponseIPJSON struct {
- CreatedAt apijson.Field
- IP apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingAddressMapNewResponseIP) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingAddressMapNewResponseIPJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingAddressMapNewResponseMembership struct {
- // Controls whether the membership can be deleted via the API or not.
- CanDelete bool `json:"can_delete"`
- CreatedAt time.Time `json:"created_at" format:"date-time"`
- // Identifier
- Identifier string `json:"identifier"`
- // The type of the membership.
- Kind AddressingAddressMapNewResponseMembershipsKind `json:"kind"`
- JSON addressingAddressMapNewResponseMembershipJSON `json:"-"`
-}
-
-// addressingAddressMapNewResponseMembershipJSON contains the JSON metadata for the
-// struct [AddressingAddressMapNewResponseMembership]
-type addressingAddressMapNewResponseMembershipJSON struct {
- CanDelete apijson.Field
- CreatedAt apijson.Field
- Identifier apijson.Field
- Kind apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingAddressMapNewResponseMembership) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingAddressMapNewResponseMembershipJSON) RawJSON() string {
- return r.raw
-}
-
-// The type of the membership.
-type AddressingAddressMapNewResponseMembershipsKind string
-
-const (
- AddressingAddressMapNewResponseMembershipsKindZone AddressingAddressMapNewResponseMembershipsKind = "zone"
- AddressingAddressMapNewResponseMembershipsKindAccount AddressingAddressMapNewResponseMembershipsKind = "account"
-)
-
-type AddressingAddressMapListResponse struct {
- // Identifier
- ID string `json:"id"`
- // If set to false, then the Address Map cannot be deleted via API. This is true
- // for Cloudflare-managed maps.
- CanDelete bool `json:"can_delete"`
- // If set to false, then the IPs on the Address Map cannot be modified via the API.
- // This is true for Cloudflare-managed maps.
- CanModifyIPs bool `json:"can_modify_ips"`
- CreatedAt time.Time `json:"created_at" format:"date-time"`
- // If you have legacy TLS clients which do not send the TLS server name indicator,
- // then you can specify one default SNI on the map. If Cloudflare receives a TLS
- // handshake from a client without an SNI, it will respond with the default SNI on
- // those IPs. The default SNI can be any valid zone or subdomain owned by the
- // account.
- DefaultSni string `json:"default_sni,nullable"`
- // An optional description field which may be used to describe the types of IPs or
- // zones on the map.
- Description string `json:"description,nullable"`
- // Whether the Address Map is enabled or not. Cloudflare's DNS will not respond
- // with IP addresses on an Address Map until the map is enabled.
- Enabled bool `json:"enabled,nullable"`
- ModifiedAt time.Time `json:"modified_at" format:"date-time"`
- JSON addressingAddressMapListResponseJSON `json:"-"`
-}
-
-// addressingAddressMapListResponseJSON contains the JSON metadata for the struct
-// [AddressingAddressMapListResponse]
-type addressingAddressMapListResponseJSON struct {
- ID apijson.Field
- CanDelete apijson.Field
- CanModifyIPs apijson.Field
- CreatedAt apijson.Field
- DefaultSni apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- ModifiedAt apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingAddressMapListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingAddressMapListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// Union satisfied by [AddressingAddressMapDeleteResponseUnknown],
-// [AddressingAddressMapDeleteResponseArray] or [shared.UnionString].
-type AddressingAddressMapDeleteResponse interface {
- ImplementsAddressingAddressMapDeleteResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*AddressingAddressMapDeleteResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(AddressingAddressMapDeleteResponseArray{}),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-type AddressingAddressMapDeleteResponseArray []interface{}
-
-func (r AddressingAddressMapDeleteResponseArray) ImplementsAddressingAddressMapDeleteResponse() {}
-
-type AddressingAddressMapEditResponse struct {
- // Identifier
- ID string `json:"id"`
- // If set to false, then the Address Map cannot be deleted via API. This is true
- // for Cloudflare-managed maps.
- CanDelete bool `json:"can_delete"`
- // If set to false, then the IPs on the Address Map cannot be modified via the API.
- // This is true for Cloudflare-managed maps.
- CanModifyIPs bool `json:"can_modify_ips"`
- CreatedAt time.Time `json:"created_at" format:"date-time"`
- // If you have legacy TLS clients which do not send the TLS server name indicator,
- // then you can specify one default SNI on the map. If Cloudflare receives a TLS
- // handshake from a client without an SNI, it will respond with the default SNI on
- // those IPs. The default SNI can be any valid zone or subdomain owned by the
- // account.
- DefaultSni string `json:"default_sni,nullable"`
- // An optional description field which may be used to describe the types of IPs or
- // zones on the map.
- Description string `json:"description,nullable"`
- // Whether the Address Map is enabled or not. Cloudflare's DNS will not respond
- // with IP addresses on an Address Map until the map is enabled.
- Enabled bool `json:"enabled,nullable"`
- ModifiedAt time.Time `json:"modified_at" format:"date-time"`
- JSON addressingAddressMapEditResponseJSON `json:"-"`
-}
-
-// addressingAddressMapEditResponseJSON contains the JSON metadata for the struct
-// [AddressingAddressMapEditResponse]
-type addressingAddressMapEditResponseJSON struct {
- ID apijson.Field
- CanDelete apijson.Field
- CanModifyIPs apijson.Field
- CreatedAt apijson.Field
- DefaultSni apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- ModifiedAt apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingAddressMapEditResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingAddressMapEditResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingAddressMapGetResponse struct {
- // Identifier
- ID string `json:"id"`
- // If set to false, then the Address Map cannot be deleted via API. This is true
- // for Cloudflare-managed maps.
- CanDelete bool `json:"can_delete"`
- // If set to false, then the IPs on the Address Map cannot be modified via the API.
- // This is true for Cloudflare-managed maps.
- CanModifyIPs bool `json:"can_modify_ips"`
- CreatedAt time.Time `json:"created_at" format:"date-time"`
- // If you have legacy TLS clients which do not send the TLS server name indicator,
- // then you can specify one default SNI on the map. If Cloudflare receives a TLS
- // handshake from a client without an SNI, it will respond with the default SNI on
- // those IPs. The default SNI can be any valid zone or subdomain owned by the
- // account.
- DefaultSni string `json:"default_sni,nullable"`
- // An optional description field which may be used to describe the types of IPs or
- // zones on the map.
- Description string `json:"description,nullable"`
- // Whether the Address Map is enabled or not. Cloudflare's DNS will not respond
- // with IP addresses on an Address Map until the map is enabled.
- Enabled bool `json:"enabled,nullable"`
- // The set of IPs on the Address Map.
- IPs []AddressingAddressMapGetResponseIP `json:"ips"`
- // Zones and Accounts which will be assigned IPs on this Address Map. A zone
- // membership will take priority over an account membership.
- Memberships []AddressingAddressMapGetResponseMembership `json:"memberships"`
- ModifiedAt time.Time `json:"modified_at" format:"date-time"`
- JSON addressingAddressMapGetResponseJSON `json:"-"`
-}
-
-// addressingAddressMapGetResponseJSON contains the JSON metadata for the struct
-// [AddressingAddressMapGetResponse]
-type addressingAddressMapGetResponseJSON struct {
- ID apijson.Field
- CanDelete apijson.Field
- CanModifyIPs apijson.Field
- CreatedAt apijson.Field
- DefaultSni apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- IPs apijson.Field
- Memberships apijson.Field
- ModifiedAt apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingAddressMapGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingAddressMapGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingAddressMapGetResponseIP struct {
- CreatedAt time.Time `json:"created_at" format:"date-time"`
- // An IPv4 or IPv6 address.
- IP string `json:"ip"`
- JSON addressingAddressMapGetResponseIPJSON `json:"-"`
-}
-
-// addressingAddressMapGetResponseIPJSON contains the JSON metadata for the struct
-// [AddressingAddressMapGetResponseIP]
-type addressingAddressMapGetResponseIPJSON struct {
- CreatedAt apijson.Field
- IP apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingAddressMapGetResponseIP) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingAddressMapGetResponseIPJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingAddressMapGetResponseMembership struct {
- // Controls whether the membership can be deleted via the API or not.
- CanDelete bool `json:"can_delete"`
- CreatedAt time.Time `json:"created_at" format:"date-time"`
- // Identifier
- Identifier string `json:"identifier"`
- // The type of the membership.
- Kind AddressingAddressMapGetResponseMembershipsKind `json:"kind"`
- JSON addressingAddressMapGetResponseMembershipJSON `json:"-"`
-}
-
-// addressingAddressMapGetResponseMembershipJSON contains the JSON metadata for the
-// struct [AddressingAddressMapGetResponseMembership]
-type addressingAddressMapGetResponseMembershipJSON struct {
- CanDelete apijson.Field
- CreatedAt apijson.Field
- Identifier apijson.Field
- Kind apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingAddressMapGetResponseMembership) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingAddressMapGetResponseMembershipJSON) RawJSON() string {
- return r.raw
-}
-
-// The type of the membership.
-type AddressingAddressMapGetResponseMembershipsKind string
-
-const (
- AddressingAddressMapGetResponseMembershipsKindZone AddressingAddressMapGetResponseMembershipsKind = "zone"
- AddressingAddressMapGetResponseMembershipsKindAccount AddressingAddressMapGetResponseMembershipsKind = "account"
-)
-
-type AddressingAddressMapNewParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
- // An optional description field which may be used to describe the types of IPs or
- // zones on the map.
- Description param.Field[string] `json:"description"`
- // Whether the Address Map is enabled or not. Cloudflare's DNS will not respond
- // with IP addresses on an Address Map until the map is enabled.
- Enabled param.Field[bool] `json:"enabled"`
-}
-
-func (r AddressingAddressMapNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type AddressingAddressMapNewResponseEnvelope struct {
- Errors []AddressingAddressMapNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []AddressingAddressMapNewResponseEnvelopeMessages `json:"messages,required"`
- Result AddressingAddressMapNewResponse `json:"result,required"`
- // Whether the API call was successful
- Success AddressingAddressMapNewResponseEnvelopeSuccess `json:"success,required"`
- JSON addressingAddressMapNewResponseEnvelopeJSON `json:"-"`
-}
-
-// addressingAddressMapNewResponseEnvelopeJSON contains the JSON metadata for the
-// struct [AddressingAddressMapNewResponseEnvelope]
-type addressingAddressMapNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingAddressMapNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingAddressMapNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingAddressMapNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON addressingAddressMapNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// addressingAddressMapNewResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [AddressingAddressMapNewResponseEnvelopeErrors]
-type addressingAddressMapNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingAddressMapNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingAddressMapNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingAddressMapNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON addressingAddressMapNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// addressingAddressMapNewResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [AddressingAddressMapNewResponseEnvelopeMessages]
-type addressingAddressMapNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingAddressMapNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingAddressMapNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type AddressingAddressMapNewResponseEnvelopeSuccess bool
-
-const (
- AddressingAddressMapNewResponseEnvelopeSuccessTrue AddressingAddressMapNewResponseEnvelopeSuccess = true
-)
-
-type AddressingAddressMapListParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type AddressingAddressMapListResponseEnvelope struct {
- Errors []AddressingAddressMapListResponseEnvelopeErrors `json:"errors,required"`
- Messages []AddressingAddressMapListResponseEnvelopeMessages `json:"messages,required"`
- Result []AddressingAddressMapListResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success AddressingAddressMapListResponseEnvelopeSuccess `json:"success,required"`
- ResultInfo AddressingAddressMapListResponseEnvelopeResultInfo `json:"result_info"`
- JSON addressingAddressMapListResponseEnvelopeJSON `json:"-"`
-}
-
-// addressingAddressMapListResponseEnvelopeJSON contains the JSON metadata for the
-// struct [AddressingAddressMapListResponseEnvelope]
-type addressingAddressMapListResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- ResultInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingAddressMapListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingAddressMapListResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingAddressMapListResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON addressingAddressMapListResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// addressingAddressMapListResponseEnvelopeErrorsJSON contains the JSON metadata
-// for the struct [AddressingAddressMapListResponseEnvelopeErrors]
-type addressingAddressMapListResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingAddressMapListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingAddressMapListResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingAddressMapListResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON addressingAddressMapListResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// addressingAddressMapListResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [AddressingAddressMapListResponseEnvelopeMessages]
-type addressingAddressMapListResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingAddressMapListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingAddressMapListResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type AddressingAddressMapListResponseEnvelopeSuccess bool
-
-const (
- AddressingAddressMapListResponseEnvelopeSuccessTrue AddressingAddressMapListResponseEnvelopeSuccess = true
-)
-
-type AddressingAddressMapListResponseEnvelopeResultInfo struct {
- // Total number of results for the requested service
- Count float64 `json:"count"`
- // Current page within paginated list of results
- Page float64 `json:"page"`
- // Number of results per page of results
- PerPage float64 `json:"per_page"`
- // Total results available without any search parameters
- TotalCount float64 `json:"total_count"`
- JSON addressingAddressMapListResponseEnvelopeResultInfoJSON `json:"-"`
-}
-
-// addressingAddressMapListResponseEnvelopeResultInfoJSON contains the JSON
-// metadata for the struct [AddressingAddressMapListResponseEnvelopeResultInfo]
-type addressingAddressMapListResponseEnvelopeResultInfoJSON struct {
- Count apijson.Field
- Page apijson.Field
- PerPage apijson.Field
- TotalCount apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingAddressMapListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingAddressMapListResponseEnvelopeResultInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingAddressMapDeleteParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type AddressingAddressMapDeleteResponseEnvelope struct {
- Errors []AddressingAddressMapDeleteResponseEnvelopeErrors `json:"errors,required"`
- Messages []AddressingAddressMapDeleteResponseEnvelopeMessages `json:"messages,required"`
- Result AddressingAddressMapDeleteResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success AddressingAddressMapDeleteResponseEnvelopeSuccess `json:"success,required"`
- ResultInfo AddressingAddressMapDeleteResponseEnvelopeResultInfo `json:"result_info"`
- JSON addressingAddressMapDeleteResponseEnvelopeJSON `json:"-"`
-}
-
-// addressingAddressMapDeleteResponseEnvelopeJSON contains the JSON metadata for
-// the struct [AddressingAddressMapDeleteResponseEnvelope]
-type addressingAddressMapDeleteResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- ResultInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingAddressMapDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingAddressMapDeleteResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingAddressMapDeleteResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON addressingAddressMapDeleteResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// addressingAddressMapDeleteResponseEnvelopeErrorsJSON contains the JSON metadata
-// for the struct [AddressingAddressMapDeleteResponseEnvelopeErrors]
-type addressingAddressMapDeleteResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingAddressMapDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingAddressMapDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingAddressMapDeleteResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON addressingAddressMapDeleteResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// addressingAddressMapDeleteResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct [AddressingAddressMapDeleteResponseEnvelopeMessages]
-type addressingAddressMapDeleteResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingAddressMapDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingAddressMapDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type AddressingAddressMapDeleteResponseEnvelopeSuccess bool
-
-const (
- AddressingAddressMapDeleteResponseEnvelopeSuccessTrue AddressingAddressMapDeleteResponseEnvelopeSuccess = true
-)
-
-type AddressingAddressMapDeleteResponseEnvelopeResultInfo struct {
- // Total number of results for the requested service
- Count float64 `json:"count"`
- // Current page within paginated list of results
- Page float64 `json:"page"`
- // Number of results per page of results
- PerPage float64 `json:"per_page"`
- // Total results available without any search parameters
- TotalCount float64 `json:"total_count"`
- JSON addressingAddressMapDeleteResponseEnvelopeResultInfoJSON `json:"-"`
-}
-
-// addressingAddressMapDeleteResponseEnvelopeResultInfoJSON contains the JSON
-// metadata for the struct [AddressingAddressMapDeleteResponseEnvelopeResultInfo]
-type addressingAddressMapDeleteResponseEnvelopeResultInfoJSON struct {
- Count apijson.Field
- Page apijson.Field
- PerPage apijson.Field
- TotalCount apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingAddressMapDeleteResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingAddressMapDeleteResponseEnvelopeResultInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingAddressMapEditParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
- // If you have legacy TLS clients which do not send the TLS server name indicator,
- // then you can specify one default SNI on the map. If Cloudflare receives a TLS
- // handshake from a client without an SNI, it will respond with the default SNI on
- // those IPs. The default SNI can be any valid zone or subdomain owned by the
- // account.
- DefaultSni param.Field[string] `json:"default_sni"`
- // An optional description field which may be used to describe the types of IPs or
- // zones on the map.
- Description param.Field[string] `json:"description"`
- // Whether the Address Map is enabled or not. Cloudflare's DNS will not respond
- // with IP addresses on an Address Map until the map is enabled.
- Enabled param.Field[bool] `json:"enabled"`
-}
-
-func (r AddressingAddressMapEditParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type AddressingAddressMapEditResponseEnvelope struct {
- Errors []AddressingAddressMapEditResponseEnvelopeErrors `json:"errors,required"`
- Messages []AddressingAddressMapEditResponseEnvelopeMessages `json:"messages,required"`
- Result AddressingAddressMapEditResponse `json:"result,required"`
- // Whether the API call was successful
- Success AddressingAddressMapEditResponseEnvelopeSuccess `json:"success,required"`
- JSON addressingAddressMapEditResponseEnvelopeJSON `json:"-"`
-}
-
-// addressingAddressMapEditResponseEnvelopeJSON contains the JSON metadata for the
-// struct [AddressingAddressMapEditResponseEnvelope]
-type addressingAddressMapEditResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingAddressMapEditResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingAddressMapEditResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingAddressMapEditResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON addressingAddressMapEditResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// addressingAddressMapEditResponseEnvelopeErrorsJSON contains the JSON metadata
-// for the struct [AddressingAddressMapEditResponseEnvelopeErrors]
-type addressingAddressMapEditResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingAddressMapEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingAddressMapEditResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingAddressMapEditResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON addressingAddressMapEditResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// addressingAddressMapEditResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [AddressingAddressMapEditResponseEnvelopeMessages]
-type addressingAddressMapEditResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingAddressMapEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingAddressMapEditResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type AddressingAddressMapEditResponseEnvelopeSuccess bool
-
-const (
- AddressingAddressMapEditResponseEnvelopeSuccessTrue AddressingAddressMapEditResponseEnvelopeSuccess = true
-)
-
-type AddressingAddressMapGetParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type AddressingAddressMapGetResponseEnvelope struct {
- Errors []AddressingAddressMapGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []AddressingAddressMapGetResponseEnvelopeMessages `json:"messages,required"`
- Result AddressingAddressMapGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success AddressingAddressMapGetResponseEnvelopeSuccess `json:"success,required"`
- JSON addressingAddressMapGetResponseEnvelopeJSON `json:"-"`
-}
-
-// addressingAddressMapGetResponseEnvelopeJSON contains the JSON metadata for the
-// struct [AddressingAddressMapGetResponseEnvelope]
-type addressingAddressMapGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingAddressMapGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingAddressMapGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingAddressMapGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON addressingAddressMapGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// addressingAddressMapGetResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [AddressingAddressMapGetResponseEnvelopeErrors]
-type addressingAddressMapGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingAddressMapGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingAddressMapGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingAddressMapGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON addressingAddressMapGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// addressingAddressMapGetResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [AddressingAddressMapGetResponseEnvelopeMessages]
-type addressingAddressMapGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingAddressMapGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingAddressMapGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type AddressingAddressMapGetResponseEnvelopeSuccess bool
-
-const (
- AddressingAddressMapGetResponseEnvelopeSuccessTrue AddressingAddressMapGetResponseEnvelopeSuccess = true
-)
diff --git a/addressingaddressmap_test.go b/addressingaddressmap_test.go
deleted file mode 100644
index c48e01502b9..00000000000
--- a/addressingaddressmap_test.go
+++ /dev/null
@@ -1,161 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestAddressingAddressMapNewWithOptionalParams(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"),
- )
- _, err := client.Addressing.AddressMaps.New(context.TODO(), cloudflare.AddressingAddressMapNewParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Description: cloudflare.F("My Ecommerce zones"),
- Enabled: cloudflare.F(true),
- })
- 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())
- }
-}
-
-func TestAddressingAddressMapList(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"),
- )
- _, err := client.Addressing.AddressMaps.List(context.TODO(), cloudflare.AddressingAddressMapListParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- })
- 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())
- }
-}
-
-func TestAddressingAddressMapDelete(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"),
- )
- _, err := client.Addressing.AddressMaps.Delete(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.AddressingAddressMapDeleteParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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())
- }
-}
-
-func TestAddressingAddressMapEditWithOptionalParams(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"),
- )
- _, err := client.Addressing.AddressMaps.Edit(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.AddressingAddressMapEditParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- DefaultSni: cloudflare.F("*.example.com"),
- Description: cloudflare.F("My Ecommerce zones"),
- Enabled: cloudflare.F(true),
- },
- )
- 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())
- }
-}
-
-func TestAddressingAddressMapGet(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"),
- )
- _, err := client.Addressing.AddressMaps.Get(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.AddressingAddressMapGetParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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/addressingaddressmapaccount.go b/addressingaddressmapaccount.go
deleted file mode 100644
index 2617d3ec415..00000000000
--- a/addressingaddressmapaccount.go
+++ /dev/null
@@ -1,357 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "reflect"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/option"
- "github.com/tidwall/gjson"
-)
-
-// AddressingAddressMapAccountService contains methods and other services that help
-// with interacting with the cloudflare API. Note, unlike clients, this service
-// does not read variables from the environment automatically. You should not
-// instantiate this service directly, and instead use the
-// [NewAddressingAddressMapAccountService] method instead.
-type AddressingAddressMapAccountService struct {
- Options []option.RequestOption
-}
-
-// NewAddressingAddressMapAccountService generates a new service that applies the
-// given options to each request. These options are applied after the parent
-// client's options (if there is one), and before any request-specific options.
-func NewAddressingAddressMapAccountService(opts ...option.RequestOption) (r *AddressingAddressMapAccountService) {
- r = &AddressingAddressMapAccountService{}
- r.Options = opts
- return
-}
-
-// Add an account as a member of a particular address map.
-func (r *AddressingAddressMapAccountService) Update(ctx context.Context, addressMapID string, body AddressingAddressMapAccountUpdateParams, opts ...option.RequestOption) (res *AddressingAddressMapAccountUpdateResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env AddressingAddressMapAccountUpdateResponseEnvelope
- path := fmt.Sprintf("accounts/%s/addressing/address_maps/%s/accounts/%s", body.AccountID, addressMapID, body.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Remove an account as a member of a particular address map.
-func (r *AddressingAddressMapAccountService) Delete(ctx context.Context, addressMapID string, body AddressingAddressMapAccountDeleteParams, opts ...option.RequestOption) (res *AddressingAddressMapAccountDeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env AddressingAddressMapAccountDeleteResponseEnvelope
- path := fmt.Sprintf("accounts/%s/addressing/address_maps/%s/accounts/%s", body.AccountID, addressMapID, body.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Union satisfied by [AddressingAddressMapAccountUpdateResponseUnknown],
-// [AddressingAddressMapAccountUpdateResponseArray] or [shared.UnionString].
-type AddressingAddressMapAccountUpdateResponse interface {
- ImplementsAddressingAddressMapAccountUpdateResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*AddressingAddressMapAccountUpdateResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(AddressingAddressMapAccountUpdateResponseArray{}),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-type AddressingAddressMapAccountUpdateResponseArray []interface{}
-
-func (r AddressingAddressMapAccountUpdateResponseArray) ImplementsAddressingAddressMapAccountUpdateResponse() {
-}
-
-// Union satisfied by [AddressingAddressMapAccountDeleteResponseUnknown],
-// [AddressingAddressMapAccountDeleteResponseArray] or [shared.UnionString].
-type AddressingAddressMapAccountDeleteResponse interface {
- ImplementsAddressingAddressMapAccountDeleteResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*AddressingAddressMapAccountDeleteResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(AddressingAddressMapAccountDeleteResponseArray{}),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-type AddressingAddressMapAccountDeleteResponseArray []interface{}
-
-func (r AddressingAddressMapAccountDeleteResponseArray) ImplementsAddressingAddressMapAccountDeleteResponse() {
-}
-
-type AddressingAddressMapAccountUpdateParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type AddressingAddressMapAccountUpdateResponseEnvelope struct {
- Errors []AddressingAddressMapAccountUpdateResponseEnvelopeErrors `json:"errors,required"`
- Messages []AddressingAddressMapAccountUpdateResponseEnvelopeMessages `json:"messages,required"`
- Result AddressingAddressMapAccountUpdateResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success AddressingAddressMapAccountUpdateResponseEnvelopeSuccess `json:"success,required"`
- ResultInfo AddressingAddressMapAccountUpdateResponseEnvelopeResultInfo `json:"result_info"`
- JSON addressingAddressMapAccountUpdateResponseEnvelopeJSON `json:"-"`
-}
-
-// addressingAddressMapAccountUpdateResponseEnvelopeJSON contains the JSON metadata
-// for the struct [AddressingAddressMapAccountUpdateResponseEnvelope]
-type addressingAddressMapAccountUpdateResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- ResultInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingAddressMapAccountUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingAddressMapAccountUpdateResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingAddressMapAccountUpdateResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON addressingAddressMapAccountUpdateResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// addressingAddressMapAccountUpdateResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct
-// [AddressingAddressMapAccountUpdateResponseEnvelopeErrors]
-type addressingAddressMapAccountUpdateResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingAddressMapAccountUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingAddressMapAccountUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingAddressMapAccountUpdateResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON addressingAddressMapAccountUpdateResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// addressingAddressMapAccountUpdateResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct
-// [AddressingAddressMapAccountUpdateResponseEnvelopeMessages]
-type addressingAddressMapAccountUpdateResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingAddressMapAccountUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingAddressMapAccountUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type AddressingAddressMapAccountUpdateResponseEnvelopeSuccess bool
-
-const (
- AddressingAddressMapAccountUpdateResponseEnvelopeSuccessTrue AddressingAddressMapAccountUpdateResponseEnvelopeSuccess = true
-)
-
-type AddressingAddressMapAccountUpdateResponseEnvelopeResultInfo struct {
- // Total number of results for the requested service
- Count float64 `json:"count"`
- // Current page within paginated list of results
- Page float64 `json:"page"`
- // Number of results per page of results
- PerPage float64 `json:"per_page"`
- // Total results available without any search parameters
- TotalCount float64 `json:"total_count"`
- JSON addressingAddressMapAccountUpdateResponseEnvelopeResultInfoJSON `json:"-"`
-}
-
-// addressingAddressMapAccountUpdateResponseEnvelopeResultInfoJSON contains the
-// JSON metadata for the struct
-// [AddressingAddressMapAccountUpdateResponseEnvelopeResultInfo]
-type addressingAddressMapAccountUpdateResponseEnvelopeResultInfoJSON struct {
- Count apijson.Field
- Page apijson.Field
- PerPage apijson.Field
- TotalCount apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingAddressMapAccountUpdateResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingAddressMapAccountUpdateResponseEnvelopeResultInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingAddressMapAccountDeleteParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type AddressingAddressMapAccountDeleteResponseEnvelope struct {
- Errors []AddressingAddressMapAccountDeleteResponseEnvelopeErrors `json:"errors,required"`
- Messages []AddressingAddressMapAccountDeleteResponseEnvelopeMessages `json:"messages,required"`
- Result AddressingAddressMapAccountDeleteResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success AddressingAddressMapAccountDeleteResponseEnvelopeSuccess `json:"success,required"`
- ResultInfo AddressingAddressMapAccountDeleteResponseEnvelopeResultInfo `json:"result_info"`
- JSON addressingAddressMapAccountDeleteResponseEnvelopeJSON `json:"-"`
-}
-
-// addressingAddressMapAccountDeleteResponseEnvelopeJSON contains the JSON metadata
-// for the struct [AddressingAddressMapAccountDeleteResponseEnvelope]
-type addressingAddressMapAccountDeleteResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- ResultInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingAddressMapAccountDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingAddressMapAccountDeleteResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingAddressMapAccountDeleteResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON addressingAddressMapAccountDeleteResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// addressingAddressMapAccountDeleteResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct
-// [AddressingAddressMapAccountDeleteResponseEnvelopeErrors]
-type addressingAddressMapAccountDeleteResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingAddressMapAccountDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingAddressMapAccountDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingAddressMapAccountDeleteResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON addressingAddressMapAccountDeleteResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// addressingAddressMapAccountDeleteResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct
-// [AddressingAddressMapAccountDeleteResponseEnvelopeMessages]
-type addressingAddressMapAccountDeleteResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingAddressMapAccountDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingAddressMapAccountDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type AddressingAddressMapAccountDeleteResponseEnvelopeSuccess bool
-
-const (
- AddressingAddressMapAccountDeleteResponseEnvelopeSuccessTrue AddressingAddressMapAccountDeleteResponseEnvelopeSuccess = true
-)
-
-type AddressingAddressMapAccountDeleteResponseEnvelopeResultInfo struct {
- // Total number of results for the requested service
- Count float64 `json:"count"`
- // Current page within paginated list of results
- Page float64 `json:"page"`
- // Number of results per page of results
- PerPage float64 `json:"per_page"`
- // Total results available without any search parameters
- TotalCount float64 `json:"total_count"`
- JSON addressingAddressMapAccountDeleteResponseEnvelopeResultInfoJSON `json:"-"`
-}
-
-// addressingAddressMapAccountDeleteResponseEnvelopeResultInfoJSON contains the
-// JSON metadata for the struct
-// [AddressingAddressMapAccountDeleteResponseEnvelopeResultInfo]
-type addressingAddressMapAccountDeleteResponseEnvelopeResultInfoJSON struct {
- Count apijson.Field
- Page apijson.Field
- PerPage apijson.Field
- TotalCount apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingAddressMapAccountDeleteResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingAddressMapAccountDeleteResponseEnvelopeResultInfoJSON) RawJSON() string {
- return r.raw
-}
diff --git a/addressingaddressmapaccount_test.go b/addressingaddressmapaccount_test.go
deleted file mode 100644
index 0513e498d99..00000000000
--- a/addressingaddressmapaccount_test.go
+++ /dev/null
@@ -1,74 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestAddressingAddressMapAccountUpdate(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"),
- )
- _, err := client.Addressing.AddressMaps.Accounts.Update(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.AddressingAddressMapAccountUpdateParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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())
- }
-}
-
-func TestAddressingAddressMapAccountDelete(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"),
- )
- _, err := client.Addressing.AddressMaps.Accounts.Delete(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.AddressingAddressMapAccountDeleteParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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/addressingaddressmapip.go b/addressingaddressmapip.go
deleted file mode 100644
index 1893441030d..00000000000
--- a/addressingaddressmapip.go
+++ /dev/null
@@ -1,349 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "reflect"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/option"
- "github.com/tidwall/gjson"
-)
-
-// AddressingAddressMapIPService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewAddressingAddressMapIPService]
-// method instead.
-type AddressingAddressMapIPService struct {
- Options []option.RequestOption
-}
-
-// NewAddressingAddressMapIPService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewAddressingAddressMapIPService(opts ...option.RequestOption) (r *AddressingAddressMapIPService) {
- r = &AddressingAddressMapIPService{}
- r.Options = opts
- return
-}
-
-// Add an IP from a prefix owned by the account to a particular address map.
-func (r *AddressingAddressMapIPService) Update(ctx context.Context, addressMapID string, ipAddress string, body AddressingAddressMapIPUpdateParams, opts ...option.RequestOption) (res *AddressingAddressMapIPUpdateResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env AddressingAddressMapIPUpdateResponseEnvelope
- path := fmt.Sprintf("accounts/%s/addressing/address_maps/%s/ips/%s", body.AccountID, addressMapID, ipAddress)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Remove an IP from a particular address map.
-func (r *AddressingAddressMapIPService) Delete(ctx context.Context, addressMapID string, ipAddress string, body AddressingAddressMapIPDeleteParams, opts ...option.RequestOption) (res *AddressingAddressMapIPDeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env AddressingAddressMapIPDeleteResponseEnvelope
- path := fmt.Sprintf("accounts/%s/addressing/address_maps/%s/ips/%s", body.AccountID, addressMapID, ipAddress)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Union satisfied by [AddressingAddressMapIPUpdateResponseUnknown],
-// [AddressingAddressMapIPUpdateResponseArray] or [shared.UnionString].
-type AddressingAddressMapIPUpdateResponse interface {
- ImplementsAddressingAddressMapIPUpdateResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*AddressingAddressMapIPUpdateResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(AddressingAddressMapIPUpdateResponseArray{}),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-type AddressingAddressMapIPUpdateResponseArray []interface{}
-
-func (r AddressingAddressMapIPUpdateResponseArray) ImplementsAddressingAddressMapIPUpdateResponse() {}
-
-// Union satisfied by [AddressingAddressMapIPDeleteResponseUnknown],
-// [AddressingAddressMapIPDeleteResponseArray] or [shared.UnionString].
-type AddressingAddressMapIPDeleteResponse interface {
- ImplementsAddressingAddressMapIPDeleteResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*AddressingAddressMapIPDeleteResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(AddressingAddressMapIPDeleteResponseArray{}),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-type AddressingAddressMapIPDeleteResponseArray []interface{}
-
-func (r AddressingAddressMapIPDeleteResponseArray) ImplementsAddressingAddressMapIPDeleteResponse() {}
-
-type AddressingAddressMapIPUpdateParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type AddressingAddressMapIPUpdateResponseEnvelope struct {
- Errors []AddressingAddressMapIPUpdateResponseEnvelopeErrors `json:"errors,required"`
- Messages []AddressingAddressMapIPUpdateResponseEnvelopeMessages `json:"messages,required"`
- Result AddressingAddressMapIPUpdateResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success AddressingAddressMapIPUpdateResponseEnvelopeSuccess `json:"success,required"`
- ResultInfo AddressingAddressMapIPUpdateResponseEnvelopeResultInfo `json:"result_info"`
- JSON addressingAddressMapIPUpdateResponseEnvelopeJSON `json:"-"`
-}
-
-// addressingAddressMapIPUpdateResponseEnvelopeJSON contains the JSON metadata for
-// the struct [AddressingAddressMapIPUpdateResponseEnvelope]
-type addressingAddressMapIPUpdateResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- ResultInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingAddressMapIPUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingAddressMapIPUpdateResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingAddressMapIPUpdateResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON addressingAddressMapIPUpdateResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// addressingAddressMapIPUpdateResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct [AddressingAddressMapIPUpdateResponseEnvelopeErrors]
-type addressingAddressMapIPUpdateResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingAddressMapIPUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingAddressMapIPUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingAddressMapIPUpdateResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON addressingAddressMapIPUpdateResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// addressingAddressMapIPUpdateResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct [AddressingAddressMapIPUpdateResponseEnvelopeMessages]
-type addressingAddressMapIPUpdateResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingAddressMapIPUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingAddressMapIPUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type AddressingAddressMapIPUpdateResponseEnvelopeSuccess bool
-
-const (
- AddressingAddressMapIPUpdateResponseEnvelopeSuccessTrue AddressingAddressMapIPUpdateResponseEnvelopeSuccess = true
-)
-
-type AddressingAddressMapIPUpdateResponseEnvelopeResultInfo struct {
- // Total number of results for the requested service
- Count float64 `json:"count"`
- // Current page within paginated list of results
- Page float64 `json:"page"`
- // Number of results per page of results
- PerPage float64 `json:"per_page"`
- // Total results available without any search parameters
- TotalCount float64 `json:"total_count"`
- JSON addressingAddressMapIPUpdateResponseEnvelopeResultInfoJSON `json:"-"`
-}
-
-// addressingAddressMapIPUpdateResponseEnvelopeResultInfoJSON contains the JSON
-// metadata for the struct [AddressingAddressMapIPUpdateResponseEnvelopeResultInfo]
-type addressingAddressMapIPUpdateResponseEnvelopeResultInfoJSON struct {
- Count apijson.Field
- Page apijson.Field
- PerPage apijson.Field
- TotalCount apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingAddressMapIPUpdateResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingAddressMapIPUpdateResponseEnvelopeResultInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingAddressMapIPDeleteParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type AddressingAddressMapIPDeleteResponseEnvelope struct {
- Errors []AddressingAddressMapIPDeleteResponseEnvelopeErrors `json:"errors,required"`
- Messages []AddressingAddressMapIPDeleteResponseEnvelopeMessages `json:"messages,required"`
- Result AddressingAddressMapIPDeleteResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success AddressingAddressMapIPDeleteResponseEnvelopeSuccess `json:"success,required"`
- ResultInfo AddressingAddressMapIPDeleteResponseEnvelopeResultInfo `json:"result_info"`
- JSON addressingAddressMapIPDeleteResponseEnvelopeJSON `json:"-"`
-}
-
-// addressingAddressMapIPDeleteResponseEnvelopeJSON contains the JSON metadata for
-// the struct [AddressingAddressMapIPDeleteResponseEnvelope]
-type addressingAddressMapIPDeleteResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- ResultInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingAddressMapIPDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingAddressMapIPDeleteResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingAddressMapIPDeleteResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON addressingAddressMapIPDeleteResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// addressingAddressMapIPDeleteResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct [AddressingAddressMapIPDeleteResponseEnvelopeErrors]
-type addressingAddressMapIPDeleteResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingAddressMapIPDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingAddressMapIPDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingAddressMapIPDeleteResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON addressingAddressMapIPDeleteResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// addressingAddressMapIPDeleteResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct [AddressingAddressMapIPDeleteResponseEnvelopeMessages]
-type addressingAddressMapIPDeleteResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingAddressMapIPDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingAddressMapIPDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type AddressingAddressMapIPDeleteResponseEnvelopeSuccess bool
-
-const (
- AddressingAddressMapIPDeleteResponseEnvelopeSuccessTrue AddressingAddressMapIPDeleteResponseEnvelopeSuccess = true
-)
-
-type AddressingAddressMapIPDeleteResponseEnvelopeResultInfo struct {
- // Total number of results for the requested service
- Count float64 `json:"count"`
- // Current page within paginated list of results
- Page float64 `json:"page"`
- // Number of results per page of results
- PerPage float64 `json:"per_page"`
- // Total results available without any search parameters
- TotalCount float64 `json:"total_count"`
- JSON addressingAddressMapIPDeleteResponseEnvelopeResultInfoJSON `json:"-"`
-}
-
-// addressingAddressMapIPDeleteResponseEnvelopeResultInfoJSON contains the JSON
-// metadata for the struct [AddressingAddressMapIPDeleteResponseEnvelopeResultInfo]
-type addressingAddressMapIPDeleteResponseEnvelopeResultInfoJSON struct {
- Count apijson.Field
- Page apijson.Field
- PerPage apijson.Field
- TotalCount apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingAddressMapIPDeleteResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingAddressMapIPDeleteResponseEnvelopeResultInfoJSON) RawJSON() string {
- return r.raw
-}
diff --git a/addressingaddressmapip_test.go b/addressingaddressmapip_test.go
deleted file mode 100644
index 12e9d3f66cb..00000000000
--- a/addressingaddressmapip_test.go
+++ /dev/null
@@ -1,76 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestAddressingAddressMapIPUpdate(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"),
- )
- _, err := client.Addressing.AddressMaps.IPs.Update(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- "192.0.2.1",
- cloudflare.AddressingAddressMapIPUpdateParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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())
- }
-}
-
-func TestAddressingAddressMapIPDelete(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"),
- )
- _, err := client.Addressing.AddressMaps.IPs.Delete(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- "192.0.2.1",
- cloudflare.AddressingAddressMapIPDeleteParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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/addressingaddressmapzone.go b/addressingaddressmapzone.go
deleted file mode 100644
index c08748adfc8..00000000000
--- a/addressingaddressmapzone.go
+++ /dev/null
@@ -1,375 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "reflect"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/option"
- "github.com/tidwall/gjson"
-)
-
-// AddressingAddressMapZoneService contains methods and other services that help
-// with interacting with the cloudflare API. Note, unlike clients, this service
-// does not read variables from the environment automatically. You should not
-// instantiate this service directly, and instead use the
-// [NewAddressingAddressMapZoneService] method instead.
-type AddressingAddressMapZoneService struct {
- Options []option.RequestOption
-}
-
-// NewAddressingAddressMapZoneService generates a new service that applies the
-// given options to each request. These options are applied after the parent
-// client's options (if there is one), and before any request-specific options.
-func NewAddressingAddressMapZoneService(opts ...option.RequestOption) (r *AddressingAddressMapZoneService) {
- r = &AddressingAddressMapZoneService{}
- r.Options = opts
- return
-}
-
-// Add a zone as a member of a particular address map.
-func (r *AddressingAddressMapZoneService) Update(ctx context.Context, addressMapID string, body AddressingAddressMapZoneUpdateParams, opts ...option.RequestOption) (res *AddressingAddressMapZoneUpdateResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env AddressingAddressMapZoneUpdateResponseEnvelope
- var accountOrZone string
- var accountOrZoneID param.Field[string]
- if body.AccountID.Present {
- accountOrZone = "accounts"
- accountOrZoneID = body.AccountID
- } else {
- accountOrZone = "zones"
- accountOrZoneID = body.ZoneID
- }
- path := fmt.Sprintf("accounts/%s/addressing/address_maps/%s/zones/%s", accountOrZone, addressMapID, accountOrZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Remove a zone as a member of a particular address map.
-func (r *AddressingAddressMapZoneService) Delete(ctx context.Context, addressMapID string, body AddressingAddressMapZoneDeleteParams, opts ...option.RequestOption) (res *AddressingAddressMapZoneDeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env AddressingAddressMapZoneDeleteResponseEnvelope
- var accountOrZone string
- var accountOrZoneID param.Field[string]
- if body.AccountID.Present {
- accountOrZone = "accounts"
- accountOrZoneID = body.AccountID
- } else {
- accountOrZone = "zones"
- accountOrZoneID = body.ZoneID
- }
- path := fmt.Sprintf("accounts/%s/addressing/address_maps/%s/zones/%s", accountOrZone, addressMapID, accountOrZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Union satisfied by [AddressingAddressMapZoneUpdateResponseUnknown],
-// [AddressingAddressMapZoneUpdateResponseArray] or [shared.UnionString].
-type AddressingAddressMapZoneUpdateResponse interface {
- ImplementsAddressingAddressMapZoneUpdateResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*AddressingAddressMapZoneUpdateResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(AddressingAddressMapZoneUpdateResponseArray{}),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-type AddressingAddressMapZoneUpdateResponseArray []interface{}
-
-func (r AddressingAddressMapZoneUpdateResponseArray) ImplementsAddressingAddressMapZoneUpdateResponse() {
-}
-
-// Union satisfied by [AddressingAddressMapZoneDeleteResponseUnknown],
-// [AddressingAddressMapZoneDeleteResponseArray] or [shared.UnionString].
-type AddressingAddressMapZoneDeleteResponse interface {
- ImplementsAddressingAddressMapZoneDeleteResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*AddressingAddressMapZoneDeleteResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(AddressingAddressMapZoneDeleteResponseArray{}),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-type AddressingAddressMapZoneDeleteResponseArray []interface{}
-
-func (r AddressingAddressMapZoneDeleteResponseArray) ImplementsAddressingAddressMapZoneDeleteResponse() {
-}
-
-type AddressingAddressMapZoneUpdateParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type AddressingAddressMapZoneUpdateResponseEnvelope struct {
- Errors []AddressingAddressMapZoneUpdateResponseEnvelopeErrors `json:"errors,required"`
- Messages []AddressingAddressMapZoneUpdateResponseEnvelopeMessages `json:"messages,required"`
- Result AddressingAddressMapZoneUpdateResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success AddressingAddressMapZoneUpdateResponseEnvelopeSuccess `json:"success,required"`
- ResultInfo AddressingAddressMapZoneUpdateResponseEnvelopeResultInfo `json:"result_info"`
- JSON addressingAddressMapZoneUpdateResponseEnvelopeJSON `json:"-"`
-}
-
-// addressingAddressMapZoneUpdateResponseEnvelopeJSON contains the JSON metadata
-// for the struct [AddressingAddressMapZoneUpdateResponseEnvelope]
-type addressingAddressMapZoneUpdateResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- ResultInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingAddressMapZoneUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingAddressMapZoneUpdateResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingAddressMapZoneUpdateResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON addressingAddressMapZoneUpdateResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// addressingAddressMapZoneUpdateResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct [AddressingAddressMapZoneUpdateResponseEnvelopeErrors]
-type addressingAddressMapZoneUpdateResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingAddressMapZoneUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingAddressMapZoneUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingAddressMapZoneUpdateResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON addressingAddressMapZoneUpdateResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// addressingAddressMapZoneUpdateResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct [AddressingAddressMapZoneUpdateResponseEnvelopeMessages]
-type addressingAddressMapZoneUpdateResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingAddressMapZoneUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingAddressMapZoneUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type AddressingAddressMapZoneUpdateResponseEnvelopeSuccess bool
-
-const (
- AddressingAddressMapZoneUpdateResponseEnvelopeSuccessTrue AddressingAddressMapZoneUpdateResponseEnvelopeSuccess = true
-)
-
-type AddressingAddressMapZoneUpdateResponseEnvelopeResultInfo struct {
- // Total number of results for the requested service
- Count float64 `json:"count"`
- // Current page within paginated list of results
- Page float64 `json:"page"`
- // Number of results per page of results
- PerPage float64 `json:"per_page"`
- // Total results available without any search parameters
- TotalCount float64 `json:"total_count"`
- JSON addressingAddressMapZoneUpdateResponseEnvelopeResultInfoJSON `json:"-"`
-}
-
-// addressingAddressMapZoneUpdateResponseEnvelopeResultInfoJSON contains the JSON
-// metadata for the struct
-// [AddressingAddressMapZoneUpdateResponseEnvelopeResultInfo]
-type addressingAddressMapZoneUpdateResponseEnvelopeResultInfoJSON struct {
- Count apijson.Field
- Page apijson.Field
- PerPage apijson.Field
- TotalCount apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingAddressMapZoneUpdateResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingAddressMapZoneUpdateResponseEnvelopeResultInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingAddressMapZoneDeleteParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type AddressingAddressMapZoneDeleteResponseEnvelope struct {
- Errors []AddressingAddressMapZoneDeleteResponseEnvelopeErrors `json:"errors,required"`
- Messages []AddressingAddressMapZoneDeleteResponseEnvelopeMessages `json:"messages,required"`
- Result AddressingAddressMapZoneDeleteResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success AddressingAddressMapZoneDeleteResponseEnvelopeSuccess `json:"success,required"`
- ResultInfo AddressingAddressMapZoneDeleteResponseEnvelopeResultInfo `json:"result_info"`
- JSON addressingAddressMapZoneDeleteResponseEnvelopeJSON `json:"-"`
-}
-
-// addressingAddressMapZoneDeleteResponseEnvelopeJSON contains the JSON metadata
-// for the struct [AddressingAddressMapZoneDeleteResponseEnvelope]
-type addressingAddressMapZoneDeleteResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- ResultInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingAddressMapZoneDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingAddressMapZoneDeleteResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingAddressMapZoneDeleteResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON addressingAddressMapZoneDeleteResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// addressingAddressMapZoneDeleteResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct [AddressingAddressMapZoneDeleteResponseEnvelopeErrors]
-type addressingAddressMapZoneDeleteResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingAddressMapZoneDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingAddressMapZoneDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingAddressMapZoneDeleteResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON addressingAddressMapZoneDeleteResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// addressingAddressMapZoneDeleteResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct [AddressingAddressMapZoneDeleteResponseEnvelopeMessages]
-type addressingAddressMapZoneDeleteResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingAddressMapZoneDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingAddressMapZoneDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type AddressingAddressMapZoneDeleteResponseEnvelopeSuccess bool
-
-const (
- AddressingAddressMapZoneDeleteResponseEnvelopeSuccessTrue AddressingAddressMapZoneDeleteResponseEnvelopeSuccess = true
-)
-
-type AddressingAddressMapZoneDeleteResponseEnvelopeResultInfo struct {
- // Total number of results for the requested service
- Count float64 `json:"count"`
- // Current page within paginated list of results
- Page float64 `json:"page"`
- // Number of results per page of results
- PerPage float64 `json:"per_page"`
- // Total results available without any search parameters
- TotalCount float64 `json:"total_count"`
- JSON addressingAddressMapZoneDeleteResponseEnvelopeResultInfoJSON `json:"-"`
-}
-
-// addressingAddressMapZoneDeleteResponseEnvelopeResultInfoJSON contains the JSON
-// metadata for the struct
-// [AddressingAddressMapZoneDeleteResponseEnvelopeResultInfo]
-type addressingAddressMapZoneDeleteResponseEnvelopeResultInfoJSON struct {
- Count apijson.Field
- Page apijson.Field
- PerPage apijson.Field
- TotalCount apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingAddressMapZoneDeleteResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingAddressMapZoneDeleteResponseEnvelopeResultInfoJSON) RawJSON() string {
- return r.raw
-}
diff --git a/addressingaddressmapzone_test.go b/addressingaddressmapzone_test.go
deleted file mode 100644
index 3ab69f2eb81..00000000000
--- a/addressingaddressmapzone_test.go
+++ /dev/null
@@ -1,76 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestAddressingAddressMapZoneUpdate(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"),
- )
- _, err := client.Addressing.AddressMaps.Zones.Update(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.AddressingAddressMapZoneUpdateParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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())
- }
-}
-
-func TestAddressingAddressMapZoneDelete(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"),
- )
- _, err := client.Addressing.AddressMaps.Zones.Delete(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.AddressingAddressMapZoneDeleteParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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/addressingloadocument.go b/addressingloadocument.go
deleted file mode 100644
index 21e7613e473..00000000000
--- a/addressingloadocument.go
+++ /dev/null
@@ -1,161 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// AddressingLOADocumentService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewAddressingLOADocumentService]
-// method instead.
-type AddressingLOADocumentService struct {
- Options []option.RequestOption
- Downloads *AddressingLOADocumentDownloadService
-}
-
-// NewAddressingLOADocumentService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewAddressingLOADocumentService(opts ...option.RequestOption) (r *AddressingLOADocumentService) {
- r = &AddressingLOADocumentService{}
- r.Options = opts
- r.Downloads = NewAddressingLOADocumentDownloadService(opts...)
- return
-}
-
-// Submit LOA document (pdf format) under the account.
-func (r *AddressingLOADocumentService) New(ctx context.Context, params AddressingLOADocumentNewParams, opts ...option.RequestOption) (res *AddressingLOADocumentNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env AddressingLOADocumentNewResponseEnvelope
- path := fmt.Sprintf("accounts/%s/addressing/loa_documents", params.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type AddressingLOADocumentNewResponse struct {
- // Name of LOA document.
- Filename string `json:"filename"`
- JSON addressingLOADocumentNewResponseJSON `json:"-"`
-}
-
-// addressingLOADocumentNewResponseJSON contains the JSON metadata for the struct
-// [AddressingLOADocumentNewResponse]
-type addressingLOADocumentNewResponseJSON struct {
- Filename apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingLOADocumentNewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingLOADocumentNewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingLOADocumentNewParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
- // LOA document to upload.
- LOADocument param.Field[string] `json:"loa_document,required"`
-}
-
-func (r AddressingLOADocumentNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type AddressingLOADocumentNewResponseEnvelope struct {
- Errors []AddressingLOADocumentNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []AddressingLOADocumentNewResponseEnvelopeMessages `json:"messages,required"`
- Result AddressingLOADocumentNewResponse `json:"result,required"`
- // Whether the API call was successful
- Success AddressingLOADocumentNewResponseEnvelopeSuccess `json:"success,required"`
- JSON addressingLOADocumentNewResponseEnvelopeJSON `json:"-"`
-}
-
-// addressingLOADocumentNewResponseEnvelopeJSON contains the JSON metadata for the
-// struct [AddressingLOADocumentNewResponseEnvelope]
-type addressingLOADocumentNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingLOADocumentNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingLOADocumentNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingLOADocumentNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON addressingLOADocumentNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// addressingLOADocumentNewResponseEnvelopeErrorsJSON contains the JSON metadata
-// for the struct [AddressingLOADocumentNewResponseEnvelopeErrors]
-type addressingLOADocumentNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingLOADocumentNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingLOADocumentNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingLOADocumentNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON addressingLOADocumentNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// addressingLOADocumentNewResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [AddressingLOADocumentNewResponseEnvelopeMessages]
-type addressingLOADocumentNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingLOADocumentNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingLOADocumentNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type AddressingLOADocumentNewResponseEnvelopeSuccess bool
-
-const (
- AddressingLOADocumentNewResponseEnvelopeSuccessTrue AddressingLOADocumentNewResponseEnvelopeSuccess = true
-)
diff --git a/addressingloadocument_test.go b/addressingloadocument_test.go
deleted file mode 100644
index 6c94b9df2d7..00000000000
--- a/addressingloadocument_test.go
+++ /dev/null
@@ -1,41 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestAddressingLOADocumentNew(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"),
- )
- _, err := client.Addressing.LOADocuments.New(context.TODO(), cloudflare.AddressingLOADocumentNewParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- LOADocument: cloudflare.F("@document.pdf"),
- })
- 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/addressingloadocumentdownload.go b/addressingloadocumentdownload.go
deleted file mode 100644
index 78dd090fbba..00000000000
--- a/addressingloadocumentdownload.go
+++ /dev/null
@@ -1,46 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
-
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// AddressingLOADocumentDownloadService contains methods and other services that
-// help with interacting with the cloudflare API. Note, unlike clients, this
-// service does not read variables from the environment automatically. You should
-// not instantiate this service directly, and instead use the
-// [NewAddressingLOADocumentDownloadService] method instead.
-type AddressingLOADocumentDownloadService struct {
- Options []option.RequestOption
-}
-
-// NewAddressingLOADocumentDownloadService generates a new service that applies the
-// given options to each request. These options are applied after the parent
-// client's options (if there is one), and before any request-specific options.
-func NewAddressingLOADocumentDownloadService(opts ...option.RequestOption) (r *AddressingLOADocumentDownloadService) {
- r = &AddressingLOADocumentDownloadService{}
- r.Options = opts
- return
-}
-
-// Download specified LOA document under the account.
-func (r *AddressingLOADocumentDownloadService) Get(ctx context.Context, loaDocumentID string, query AddressingLOADocumentDownloadGetParams, opts ...option.RequestOption) (res *AddressingLOADocumentDownloadGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- path := fmt.Sprintf("accounts/%s/addressing/loa_documents/%s/download", query.AccountID, loaDocumentID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &res, opts...)
- return
-}
-
-type AddressingLOADocumentDownloadGetResponse = interface{}
-
-type AddressingLOADocumentDownloadGetParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
diff --git a/addressingloadocumentdownload_test.go b/addressingloadocumentdownload_test.go
deleted file mode 100644
index 1b93eb01b58..00000000000
--- a/addressingloadocumentdownload_test.go
+++ /dev/null
@@ -1,44 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestAddressingLOADocumentDownloadGet(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"),
- )
- _, err := client.Addressing.LOADocuments.Downloads.Get(
- context.TODO(),
- "d933b1530bc56c9953cf8ce166da8004",
- cloudflare.AddressingLOADocumentDownloadGetParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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/addressingprefix.go b/addressingprefix.go
deleted file mode 100644
index af98f6b867d..00000000000
--- a/addressingprefix.go
+++ /dev/null
@@ -1,882 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "reflect"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/option"
- "github.com/tidwall/gjson"
-)
-
-// AddressingPrefixService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewAddressingPrefixService] method
-// instead.
-type AddressingPrefixService struct {
- Options []option.RequestOption
- BGP *AddressingPrefixBGPService
- Delegations *AddressingPrefixDelegationService
-}
-
-// NewAddressingPrefixService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewAddressingPrefixService(opts ...option.RequestOption) (r *AddressingPrefixService) {
- r = &AddressingPrefixService{}
- r.Options = opts
- r.BGP = NewAddressingPrefixBGPService(opts...)
- r.Delegations = NewAddressingPrefixDelegationService(opts...)
- return
-}
-
-// Add a new prefix under the account.
-func (r *AddressingPrefixService) New(ctx context.Context, params AddressingPrefixNewParams, opts ...option.RequestOption) (res *AddressingPrefixNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env AddressingPrefixNewResponseEnvelope
- path := fmt.Sprintf("accounts/%s/addressing/prefixes", params.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// List all prefixes owned by the account.
-func (r *AddressingPrefixService) List(ctx context.Context, query AddressingPrefixListParams, opts ...option.RequestOption) (res *[]AddressingPrefixListResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env AddressingPrefixListResponseEnvelope
- path := fmt.Sprintf("accounts/%s/addressing/prefixes", query.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Delete an unapproved prefix owned by the account.
-func (r *AddressingPrefixService) Delete(ctx context.Context, prefixID string, body AddressingPrefixDeleteParams, opts ...option.RequestOption) (res *AddressingPrefixDeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env AddressingPrefixDeleteResponseEnvelope
- path := fmt.Sprintf("accounts/%s/addressing/prefixes/%s", body.AccountID, prefixID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Modify the description for a prefix owned by the account.
-func (r *AddressingPrefixService) Edit(ctx context.Context, prefixID string, params AddressingPrefixEditParams, opts ...option.RequestOption) (res *AddressingPrefixEditResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env AddressingPrefixEditResponseEnvelope
- path := fmt.Sprintf("accounts/%s/addressing/prefixes/%s", params.AccountID, prefixID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// List a particular prefix owned by the account.
-func (r *AddressingPrefixService) Get(ctx context.Context, prefixID string, query AddressingPrefixGetParams, opts ...option.RequestOption) (res *AddressingPrefixGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env AddressingPrefixGetResponseEnvelope
- path := fmt.Sprintf("accounts/%s/addressing/prefixes/%s", query.AccountID, prefixID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type AddressingPrefixNewResponse struct {
- // Identifier
- ID string `json:"id"`
- // Identifier
- AccountID string `json:"account_id"`
- // Prefix advertisement status to the Internet. This field is only not 'null' if on
- // demand is enabled.
- Advertised bool `json:"advertised,nullable"`
- // Last time the advertisement status was changed. This field is only not 'null' if
- // on demand is enabled.
- AdvertisedModifiedAt time.Time `json:"advertised_modified_at,nullable" format:"date-time"`
- // Approval state of the prefix (P = pending, V = active).
- Approved string `json:"approved"`
- // Autonomous System Number (ASN) the prefix will be advertised under.
- ASN int64 `json:"asn,nullable"`
- // IP Prefix in Classless Inter-Domain Routing format.
- Cidr string `json:"cidr"`
- CreatedAt time.Time `json:"created_at" format:"date-time"`
- // Description of the prefix.
- Description string `json:"description"`
- // Identifier for the uploaded LOA document.
- LOADocumentID string `json:"loa_document_id,nullable"`
- ModifiedAt time.Time `json:"modified_at" format:"date-time"`
- // Whether advertisement of the prefix to the Internet may be dynamically enabled
- // or disabled.
- OnDemandEnabled bool `json:"on_demand_enabled"`
- // Whether advertisement status of the prefix is locked, meaning it cannot be
- // changed.
- OnDemandLocked bool `json:"on_demand_locked"`
- JSON addressingPrefixNewResponseJSON `json:"-"`
-}
-
-// addressingPrefixNewResponseJSON contains the JSON metadata for the struct
-// [AddressingPrefixNewResponse]
-type addressingPrefixNewResponseJSON struct {
- ID apijson.Field
- AccountID apijson.Field
- Advertised apijson.Field
- AdvertisedModifiedAt apijson.Field
- Approved apijson.Field
- ASN apijson.Field
- Cidr apijson.Field
- CreatedAt apijson.Field
- Description apijson.Field
- LOADocumentID apijson.Field
- ModifiedAt apijson.Field
- OnDemandEnabled apijson.Field
- OnDemandLocked apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixNewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixNewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingPrefixListResponse struct {
- // Identifier
- ID string `json:"id"`
- // Identifier
- AccountID string `json:"account_id"`
- // Prefix advertisement status to the Internet. This field is only not 'null' if on
- // demand is enabled.
- Advertised bool `json:"advertised,nullable"`
- // Last time the advertisement status was changed. This field is only not 'null' if
- // on demand is enabled.
- AdvertisedModifiedAt time.Time `json:"advertised_modified_at,nullable" format:"date-time"`
- // Approval state of the prefix (P = pending, V = active).
- Approved string `json:"approved"`
- // Autonomous System Number (ASN) the prefix will be advertised under.
- ASN int64 `json:"asn,nullable"`
- // IP Prefix in Classless Inter-Domain Routing format.
- Cidr string `json:"cidr"`
- CreatedAt time.Time `json:"created_at" format:"date-time"`
- // Description of the prefix.
- Description string `json:"description"`
- // Identifier for the uploaded LOA document.
- LOADocumentID string `json:"loa_document_id,nullable"`
- ModifiedAt time.Time `json:"modified_at" format:"date-time"`
- // Whether advertisement of the prefix to the Internet may be dynamically enabled
- // or disabled.
- OnDemandEnabled bool `json:"on_demand_enabled"`
- // Whether advertisement status of the prefix is locked, meaning it cannot be
- // changed.
- OnDemandLocked bool `json:"on_demand_locked"`
- JSON addressingPrefixListResponseJSON `json:"-"`
-}
-
-// addressingPrefixListResponseJSON contains the JSON metadata for the struct
-// [AddressingPrefixListResponse]
-type addressingPrefixListResponseJSON struct {
- ID apijson.Field
- AccountID apijson.Field
- Advertised apijson.Field
- AdvertisedModifiedAt apijson.Field
- Approved apijson.Field
- ASN apijson.Field
- Cidr apijson.Field
- CreatedAt apijson.Field
- Description apijson.Field
- LOADocumentID apijson.Field
- ModifiedAt apijson.Field
- OnDemandEnabled apijson.Field
- OnDemandLocked apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// Union satisfied by [AddressingPrefixDeleteResponseUnknown],
-// [AddressingPrefixDeleteResponseArray] or [shared.UnionString].
-type AddressingPrefixDeleteResponse interface {
- ImplementsAddressingPrefixDeleteResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*AddressingPrefixDeleteResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(AddressingPrefixDeleteResponseArray{}),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-type AddressingPrefixDeleteResponseArray []interface{}
-
-func (r AddressingPrefixDeleteResponseArray) ImplementsAddressingPrefixDeleteResponse() {}
-
-type AddressingPrefixEditResponse struct {
- // Identifier
- ID string `json:"id"`
- // Identifier
- AccountID string `json:"account_id"`
- // Prefix advertisement status to the Internet. This field is only not 'null' if on
- // demand is enabled.
- Advertised bool `json:"advertised,nullable"`
- // Last time the advertisement status was changed. This field is only not 'null' if
- // on demand is enabled.
- AdvertisedModifiedAt time.Time `json:"advertised_modified_at,nullable" format:"date-time"`
- // Approval state of the prefix (P = pending, V = active).
- Approved string `json:"approved"`
- // Autonomous System Number (ASN) the prefix will be advertised under.
- ASN int64 `json:"asn,nullable"`
- // IP Prefix in Classless Inter-Domain Routing format.
- Cidr string `json:"cidr"`
- CreatedAt time.Time `json:"created_at" format:"date-time"`
- // Description of the prefix.
- Description string `json:"description"`
- // Identifier for the uploaded LOA document.
- LOADocumentID string `json:"loa_document_id,nullable"`
- ModifiedAt time.Time `json:"modified_at" format:"date-time"`
- // Whether advertisement of the prefix to the Internet may be dynamically enabled
- // or disabled.
- OnDemandEnabled bool `json:"on_demand_enabled"`
- // Whether advertisement status of the prefix is locked, meaning it cannot be
- // changed.
- OnDemandLocked bool `json:"on_demand_locked"`
- JSON addressingPrefixEditResponseJSON `json:"-"`
-}
-
-// addressingPrefixEditResponseJSON contains the JSON metadata for the struct
-// [AddressingPrefixEditResponse]
-type addressingPrefixEditResponseJSON struct {
- ID apijson.Field
- AccountID apijson.Field
- Advertised apijson.Field
- AdvertisedModifiedAt apijson.Field
- Approved apijson.Field
- ASN apijson.Field
- Cidr apijson.Field
- CreatedAt apijson.Field
- Description apijson.Field
- LOADocumentID apijson.Field
- ModifiedAt apijson.Field
- OnDemandEnabled apijson.Field
- OnDemandLocked apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixEditResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixEditResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingPrefixGetResponse struct {
- // Identifier
- ID string `json:"id"`
- // Identifier
- AccountID string `json:"account_id"`
- // Prefix advertisement status to the Internet. This field is only not 'null' if on
- // demand is enabled.
- Advertised bool `json:"advertised,nullable"`
- // Last time the advertisement status was changed. This field is only not 'null' if
- // on demand is enabled.
- AdvertisedModifiedAt time.Time `json:"advertised_modified_at,nullable" format:"date-time"`
- // Approval state of the prefix (P = pending, V = active).
- Approved string `json:"approved"`
- // Autonomous System Number (ASN) the prefix will be advertised under.
- ASN int64 `json:"asn,nullable"`
- // IP Prefix in Classless Inter-Domain Routing format.
- Cidr string `json:"cidr"`
- CreatedAt time.Time `json:"created_at" format:"date-time"`
- // Description of the prefix.
- Description string `json:"description"`
- // Identifier for the uploaded LOA document.
- LOADocumentID string `json:"loa_document_id,nullable"`
- ModifiedAt time.Time `json:"modified_at" format:"date-time"`
- // Whether advertisement of the prefix to the Internet may be dynamically enabled
- // or disabled.
- OnDemandEnabled bool `json:"on_demand_enabled"`
- // Whether advertisement status of the prefix is locked, meaning it cannot be
- // changed.
- OnDemandLocked bool `json:"on_demand_locked"`
- JSON addressingPrefixGetResponseJSON `json:"-"`
-}
-
-// addressingPrefixGetResponseJSON contains the JSON metadata for the struct
-// [AddressingPrefixGetResponse]
-type addressingPrefixGetResponseJSON struct {
- ID apijson.Field
- AccountID apijson.Field
- Advertised apijson.Field
- AdvertisedModifiedAt apijson.Field
- Approved apijson.Field
- ASN apijson.Field
- Cidr apijson.Field
- CreatedAt apijson.Field
- Description apijson.Field
- LOADocumentID apijson.Field
- ModifiedAt apijson.Field
- OnDemandEnabled apijson.Field
- OnDemandLocked apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingPrefixNewParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
- // Autonomous System Number (ASN) the prefix will be advertised under.
- ASN param.Field[int64] `json:"asn,required"`
- // IP Prefix in Classless Inter-Domain Routing format.
- Cidr param.Field[string] `json:"cidr,required"`
- // Identifier for the uploaded LOA document.
- LOADocumentID param.Field[string] `json:"loa_document_id,required"`
-}
-
-func (r AddressingPrefixNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type AddressingPrefixNewResponseEnvelope struct {
- Errors []AddressingPrefixNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []AddressingPrefixNewResponseEnvelopeMessages `json:"messages,required"`
- Result AddressingPrefixNewResponse `json:"result,required"`
- // Whether the API call was successful
- Success AddressingPrefixNewResponseEnvelopeSuccess `json:"success,required"`
- JSON addressingPrefixNewResponseEnvelopeJSON `json:"-"`
-}
-
-// addressingPrefixNewResponseEnvelopeJSON contains the JSON metadata for the
-// struct [AddressingPrefixNewResponseEnvelope]
-type addressingPrefixNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingPrefixNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON addressingPrefixNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// addressingPrefixNewResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [AddressingPrefixNewResponseEnvelopeErrors]
-type addressingPrefixNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingPrefixNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON addressingPrefixNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// addressingPrefixNewResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [AddressingPrefixNewResponseEnvelopeMessages]
-type addressingPrefixNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type AddressingPrefixNewResponseEnvelopeSuccess bool
-
-const (
- AddressingPrefixNewResponseEnvelopeSuccessTrue AddressingPrefixNewResponseEnvelopeSuccess = true
-)
-
-type AddressingPrefixListParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type AddressingPrefixListResponseEnvelope struct {
- Errors []AddressingPrefixListResponseEnvelopeErrors `json:"errors,required"`
- Messages []AddressingPrefixListResponseEnvelopeMessages `json:"messages,required"`
- Result []AddressingPrefixListResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success AddressingPrefixListResponseEnvelopeSuccess `json:"success,required"`
- ResultInfo AddressingPrefixListResponseEnvelopeResultInfo `json:"result_info"`
- JSON addressingPrefixListResponseEnvelopeJSON `json:"-"`
-}
-
-// addressingPrefixListResponseEnvelopeJSON contains the JSON metadata for the
-// struct [AddressingPrefixListResponseEnvelope]
-type addressingPrefixListResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- ResultInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixListResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingPrefixListResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON addressingPrefixListResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// addressingPrefixListResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [AddressingPrefixListResponseEnvelopeErrors]
-type addressingPrefixListResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixListResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingPrefixListResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON addressingPrefixListResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// addressingPrefixListResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [AddressingPrefixListResponseEnvelopeMessages]
-type addressingPrefixListResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixListResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type AddressingPrefixListResponseEnvelopeSuccess bool
-
-const (
- AddressingPrefixListResponseEnvelopeSuccessTrue AddressingPrefixListResponseEnvelopeSuccess = true
-)
-
-type AddressingPrefixListResponseEnvelopeResultInfo struct {
- // Total number of results for the requested service
- Count float64 `json:"count"`
- // Current page within paginated list of results
- Page float64 `json:"page"`
- // Number of results per page of results
- PerPage float64 `json:"per_page"`
- // Total results available without any search parameters
- TotalCount float64 `json:"total_count"`
- JSON addressingPrefixListResponseEnvelopeResultInfoJSON `json:"-"`
-}
-
-// addressingPrefixListResponseEnvelopeResultInfoJSON contains the JSON metadata
-// for the struct [AddressingPrefixListResponseEnvelopeResultInfo]
-type addressingPrefixListResponseEnvelopeResultInfoJSON struct {
- Count apijson.Field
- Page apijson.Field
- PerPage apijson.Field
- TotalCount apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixListResponseEnvelopeResultInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingPrefixDeleteParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type AddressingPrefixDeleteResponseEnvelope struct {
- Errors []AddressingPrefixDeleteResponseEnvelopeErrors `json:"errors,required"`
- Messages []AddressingPrefixDeleteResponseEnvelopeMessages `json:"messages,required"`
- Result AddressingPrefixDeleteResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success AddressingPrefixDeleteResponseEnvelopeSuccess `json:"success,required"`
- ResultInfo AddressingPrefixDeleteResponseEnvelopeResultInfo `json:"result_info"`
- JSON addressingPrefixDeleteResponseEnvelopeJSON `json:"-"`
-}
-
-// addressingPrefixDeleteResponseEnvelopeJSON contains the JSON metadata for the
-// struct [AddressingPrefixDeleteResponseEnvelope]
-type addressingPrefixDeleteResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- ResultInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixDeleteResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingPrefixDeleteResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON addressingPrefixDeleteResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// addressingPrefixDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [AddressingPrefixDeleteResponseEnvelopeErrors]
-type addressingPrefixDeleteResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingPrefixDeleteResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON addressingPrefixDeleteResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// addressingPrefixDeleteResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [AddressingPrefixDeleteResponseEnvelopeMessages]
-type addressingPrefixDeleteResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type AddressingPrefixDeleteResponseEnvelopeSuccess bool
-
-const (
- AddressingPrefixDeleteResponseEnvelopeSuccessTrue AddressingPrefixDeleteResponseEnvelopeSuccess = true
-)
-
-type AddressingPrefixDeleteResponseEnvelopeResultInfo struct {
- // Total number of results for the requested service
- Count float64 `json:"count"`
- // Current page within paginated list of results
- Page float64 `json:"page"`
- // Number of results per page of results
- PerPage float64 `json:"per_page"`
- // Total results available without any search parameters
- TotalCount float64 `json:"total_count"`
- JSON addressingPrefixDeleteResponseEnvelopeResultInfoJSON `json:"-"`
-}
-
-// addressingPrefixDeleteResponseEnvelopeResultInfoJSON contains the JSON metadata
-// for the struct [AddressingPrefixDeleteResponseEnvelopeResultInfo]
-type addressingPrefixDeleteResponseEnvelopeResultInfoJSON struct {
- Count apijson.Field
- Page apijson.Field
- PerPage apijson.Field
- TotalCount apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixDeleteResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixDeleteResponseEnvelopeResultInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingPrefixEditParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
- // Description of the prefix.
- Description param.Field[string] `json:"description,required"`
-}
-
-func (r AddressingPrefixEditParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type AddressingPrefixEditResponseEnvelope struct {
- Errors []AddressingPrefixEditResponseEnvelopeErrors `json:"errors,required"`
- Messages []AddressingPrefixEditResponseEnvelopeMessages `json:"messages,required"`
- Result AddressingPrefixEditResponse `json:"result,required"`
- // Whether the API call was successful
- Success AddressingPrefixEditResponseEnvelopeSuccess `json:"success,required"`
- JSON addressingPrefixEditResponseEnvelopeJSON `json:"-"`
-}
-
-// addressingPrefixEditResponseEnvelopeJSON contains the JSON metadata for the
-// struct [AddressingPrefixEditResponseEnvelope]
-type addressingPrefixEditResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixEditResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixEditResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingPrefixEditResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON addressingPrefixEditResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// addressingPrefixEditResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [AddressingPrefixEditResponseEnvelopeErrors]
-type addressingPrefixEditResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixEditResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingPrefixEditResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON addressingPrefixEditResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// addressingPrefixEditResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [AddressingPrefixEditResponseEnvelopeMessages]
-type addressingPrefixEditResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixEditResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type AddressingPrefixEditResponseEnvelopeSuccess bool
-
-const (
- AddressingPrefixEditResponseEnvelopeSuccessTrue AddressingPrefixEditResponseEnvelopeSuccess = true
-)
-
-type AddressingPrefixGetParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type AddressingPrefixGetResponseEnvelope struct {
- Errors []AddressingPrefixGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []AddressingPrefixGetResponseEnvelopeMessages `json:"messages,required"`
- Result AddressingPrefixGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success AddressingPrefixGetResponseEnvelopeSuccess `json:"success,required"`
- JSON addressingPrefixGetResponseEnvelopeJSON `json:"-"`
-}
-
-// addressingPrefixGetResponseEnvelopeJSON contains the JSON metadata for the
-// struct [AddressingPrefixGetResponseEnvelope]
-type addressingPrefixGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingPrefixGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON addressingPrefixGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// addressingPrefixGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [AddressingPrefixGetResponseEnvelopeErrors]
-type addressingPrefixGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingPrefixGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON addressingPrefixGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// addressingPrefixGetResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [AddressingPrefixGetResponseEnvelopeMessages]
-type addressingPrefixGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type AddressingPrefixGetResponseEnvelopeSuccess bool
-
-const (
- AddressingPrefixGetResponseEnvelopeSuccessTrue AddressingPrefixGetResponseEnvelopeSuccess = true
-)
diff --git a/addressingprefix_test.go b/addressingprefix_test.go
deleted file mode 100644
index d185e19b23a..00000000000
--- a/addressingprefix_test.go
+++ /dev/null
@@ -1,160 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestAddressingPrefixNew(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"),
- )
- _, err := client.Addressing.Prefixes.New(context.TODO(), cloudflare.AddressingPrefixNewParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- ASN: cloudflare.F(int64(209242)),
- Cidr: cloudflare.F("192.0.2.0/24"),
- LOADocumentID: cloudflare.F("d933b1530bc56c9953cf8ce166da8004"),
- })
- 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())
- }
-}
-
-func TestAddressingPrefixList(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"),
- )
- _, err := client.Addressing.Prefixes.List(context.TODO(), cloudflare.AddressingPrefixListParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- })
- 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())
- }
-}
-
-func TestAddressingPrefixDelete(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"),
- )
- _, err := client.Addressing.Prefixes.Delete(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.AddressingPrefixDeleteParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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())
- }
-}
-
-func TestAddressingPrefixEdit(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"),
- )
- _, err := client.Addressing.Prefixes.Edit(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.AddressingPrefixEditParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Description: cloudflare.F("Internal test prefix"),
- },
- )
- 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())
- }
-}
-
-func TestAddressingPrefixGet(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"),
- )
- _, err := client.Addressing.Prefixes.Get(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.AddressingPrefixGetParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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/addressingprefixbgp.go b/addressingprefixbgp.go
deleted file mode 100644
index 0b56eb9bc0c..00000000000
--- a/addressingprefixbgp.go
+++ /dev/null
@@ -1,31 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// AddressingPrefixBGPService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewAddressingPrefixBGPService]
-// method instead.
-type AddressingPrefixBGPService struct {
- Options []option.RequestOption
- Bindings *AddressingPrefixBGPBindingService
- Prefixes *AddressingPrefixBGPPrefixService
- Statuses *AddressingPrefixBGPStatusService
-}
-
-// NewAddressingPrefixBGPService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewAddressingPrefixBGPService(opts ...option.RequestOption) (r *AddressingPrefixBGPService) {
- r = &AddressingPrefixBGPService{}
- r.Options = opts
- r.Bindings = NewAddressingPrefixBGPBindingService(opts...)
- r.Prefixes = NewAddressingPrefixBGPPrefixService(opts...)
- r.Statuses = NewAddressingPrefixBGPStatusService(opts...)
- return
-}
diff --git a/addressingprefixbgpbinding.go b/addressingprefixbgpbinding.go
deleted file mode 100644
index 2bb1102e2c0..00000000000
--- a/addressingprefixbgpbinding.go
+++ /dev/null
@@ -1,675 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "reflect"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/option"
- "github.com/tidwall/gjson"
-)
-
-// AddressingPrefixBGPBindingService contains methods and other services that help
-// with interacting with the cloudflare API. Note, unlike clients, this service
-// does not read variables from the environment automatically. You should not
-// instantiate this service directly, and instead use the
-// [NewAddressingPrefixBGPBindingService] method instead.
-type AddressingPrefixBGPBindingService struct {
- Options []option.RequestOption
-}
-
-// NewAddressingPrefixBGPBindingService generates a new service that applies the
-// given options to each request. These options are applied after the parent
-// client's options (if there is one), and before any request-specific options.
-func NewAddressingPrefixBGPBindingService(opts ...option.RequestOption) (r *AddressingPrefixBGPBindingService) {
- r = &AddressingPrefixBGPBindingService{}
- r.Options = opts
- return
-}
-
-// Creates a new Service Binding, routing traffic to IPs within the given CIDR to a
-// service running on Cloudflare's network. **Note:** This API may only be used on
-// prefixes currently configured with a Magic Transit service binding, and only
-// allows creating service bindings for the Cloudflare CDN or Cloudflare Spectrum.
-func (r *AddressingPrefixBGPBindingService) New(ctx context.Context, prefixID string, params AddressingPrefixBGPBindingNewParams, opts ...option.RequestOption) (res *AddressingPrefixBGPBindingNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env AddressingPrefixBGPBindingNewResponseEnvelope
- path := fmt.Sprintf("accounts/%s/addressing/prefixes/%s/bindings", params.AccountID, prefixID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// List the Cloudflare services this prefix is currently bound to. Traffic sent to
-// an address within an IP prefix will be routed to the Cloudflare service of the
-// most-specific Service Binding matching the address. **Example:** binding
-// `192.0.2.0/24` to Cloudflare Magic Transit and `192.0.2.1/32` to the Cloudflare
-// CDN would route traffic for `192.0.2.1` to the CDN, and traffic for all other
-// IPs in the prefix to Cloudflare Magic Transit.
-func (r *AddressingPrefixBGPBindingService) List(ctx context.Context, prefixID string, query AddressingPrefixBGPBindingListParams, opts ...option.RequestOption) (res *[]AddressingPrefixBGPBindingListResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env AddressingPrefixBGPBindingListResponseEnvelope
- path := fmt.Sprintf("accounts/%s/addressing/prefixes/%s/bindings", query.AccountID, prefixID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Delete a Service Binding
-func (r *AddressingPrefixBGPBindingService) Delete(ctx context.Context, prefixID string, bindingID string, body AddressingPrefixBGPBindingDeleteParams, opts ...option.RequestOption) (res *AddressingPrefixBGPBindingDeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env AddressingPrefixBGPBindingDeleteResponseEnvelope
- path := fmt.Sprintf("accounts/%s/addressing/prefixes/%s/bindings/%s", body.AccountID, prefixID, bindingID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Fetch a single Service Binding
-func (r *AddressingPrefixBGPBindingService) Get(ctx context.Context, prefixID string, bindingID string, query AddressingPrefixBGPBindingGetParams, opts ...option.RequestOption) (res *AddressingPrefixBGPBindingGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env AddressingPrefixBGPBindingGetResponseEnvelope
- path := fmt.Sprintf("accounts/%s/addressing/prefixes/%s/bindings/%s", query.AccountID, prefixID, bindingID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type AddressingPrefixBGPBindingNewResponse struct {
- // Identifier
- ID string `json:"id"`
- // IP Prefix in Classless Inter-Domain Routing format.
- Cidr string `json:"cidr"`
- // Status of a Service Binding's deployment to the Cloudflare network
- Provisioning AddressingPrefixBGPBindingNewResponseProvisioning `json:"provisioning"`
- // Identifier
- ServiceID string `json:"service_id"`
- // Name of a service running on the Cloudflare network
- ServiceName string `json:"service_name"`
- JSON addressingPrefixBGPBindingNewResponseJSON `json:"-"`
-}
-
-// addressingPrefixBGPBindingNewResponseJSON contains the JSON metadata for the
-// struct [AddressingPrefixBGPBindingNewResponse]
-type addressingPrefixBGPBindingNewResponseJSON struct {
- ID apijson.Field
- Cidr apijson.Field
- Provisioning apijson.Field
- ServiceID apijson.Field
- ServiceName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixBGPBindingNewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixBGPBindingNewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// Status of a Service Binding's deployment to the Cloudflare network
-type AddressingPrefixBGPBindingNewResponseProvisioning struct {
- // When a binding has been deployed to a majority of Cloudflare datacenters, the
- // binding will become active and can be used with its associated service.
- State AddressingPrefixBGPBindingNewResponseProvisioningState `json:"state"`
- JSON addressingPrefixBGPBindingNewResponseProvisioningJSON `json:"-"`
-}
-
-// addressingPrefixBGPBindingNewResponseProvisioningJSON contains the JSON metadata
-// for the struct [AddressingPrefixBGPBindingNewResponseProvisioning]
-type addressingPrefixBGPBindingNewResponseProvisioningJSON struct {
- State apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixBGPBindingNewResponseProvisioning) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixBGPBindingNewResponseProvisioningJSON) RawJSON() string {
- return r.raw
-}
-
-// When a binding has been deployed to a majority of Cloudflare datacenters, the
-// binding will become active and can be used with its associated service.
-type AddressingPrefixBGPBindingNewResponseProvisioningState string
-
-const (
- AddressingPrefixBGPBindingNewResponseProvisioningStateProvisioning AddressingPrefixBGPBindingNewResponseProvisioningState = "provisioning"
- AddressingPrefixBGPBindingNewResponseProvisioningStateActive AddressingPrefixBGPBindingNewResponseProvisioningState = "active"
-)
-
-type AddressingPrefixBGPBindingListResponse struct {
- // Identifier
- ID string `json:"id"`
- // IP Prefix in Classless Inter-Domain Routing format.
- Cidr string `json:"cidr"`
- // Status of a Service Binding's deployment to the Cloudflare network
- Provisioning AddressingPrefixBGPBindingListResponseProvisioning `json:"provisioning"`
- // Identifier
- ServiceID string `json:"service_id"`
- // Name of a service running on the Cloudflare network
- ServiceName string `json:"service_name"`
- JSON addressingPrefixBGPBindingListResponseJSON `json:"-"`
-}
-
-// addressingPrefixBGPBindingListResponseJSON contains the JSON metadata for the
-// struct [AddressingPrefixBGPBindingListResponse]
-type addressingPrefixBGPBindingListResponseJSON struct {
- ID apijson.Field
- Cidr apijson.Field
- Provisioning apijson.Field
- ServiceID apijson.Field
- ServiceName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixBGPBindingListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixBGPBindingListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// Status of a Service Binding's deployment to the Cloudflare network
-type AddressingPrefixBGPBindingListResponseProvisioning struct {
- // When a binding has been deployed to a majority of Cloudflare datacenters, the
- // binding will become active and can be used with its associated service.
- State AddressingPrefixBGPBindingListResponseProvisioningState `json:"state"`
- JSON addressingPrefixBGPBindingListResponseProvisioningJSON `json:"-"`
-}
-
-// addressingPrefixBGPBindingListResponseProvisioningJSON contains the JSON
-// metadata for the struct [AddressingPrefixBGPBindingListResponseProvisioning]
-type addressingPrefixBGPBindingListResponseProvisioningJSON struct {
- State apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixBGPBindingListResponseProvisioning) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixBGPBindingListResponseProvisioningJSON) RawJSON() string {
- return r.raw
-}
-
-// When a binding has been deployed to a majority of Cloudflare datacenters, the
-// binding will become active and can be used with its associated service.
-type AddressingPrefixBGPBindingListResponseProvisioningState string
-
-const (
- AddressingPrefixBGPBindingListResponseProvisioningStateProvisioning AddressingPrefixBGPBindingListResponseProvisioningState = "provisioning"
- AddressingPrefixBGPBindingListResponseProvisioningStateActive AddressingPrefixBGPBindingListResponseProvisioningState = "active"
-)
-
-// Union satisfied by [AddressingPrefixBGPBindingDeleteResponseUnknown],
-// [AddressingPrefixBGPBindingDeleteResponseArray] or [shared.UnionString].
-type AddressingPrefixBGPBindingDeleteResponse interface {
- ImplementsAddressingPrefixBGPBindingDeleteResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*AddressingPrefixBGPBindingDeleteResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(AddressingPrefixBGPBindingDeleteResponseArray{}),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-type AddressingPrefixBGPBindingDeleteResponseArray []interface{}
-
-func (r AddressingPrefixBGPBindingDeleteResponseArray) ImplementsAddressingPrefixBGPBindingDeleteResponse() {
-}
-
-type AddressingPrefixBGPBindingGetResponse struct {
- // Identifier
- ID string `json:"id"`
- // IP Prefix in Classless Inter-Domain Routing format.
- Cidr string `json:"cidr"`
- // Status of a Service Binding's deployment to the Cloudflare network
- Provisioning AddressingPrefixBGPBindingGetResponseProvisioning `json:"provisioning"`
- // Identifier
- ServiceID string `json:"service_id"`
- // Name of a service running on the Cloudflare network
- ServiceName string `json:"service_name"`
- JSON addressingPrefixBGPBindingGetResponseJSON `json:"-"`
-}
-
-// addressingPrefixBGPBindingGetResponseJSON contains the JSON metadata for the
-// struct [AddressingPrefixBGPBindingGetResponse]
-type addressingPrefixBGPBindingGetResponseJSON struct {
- ID apijson.Field
- Cidr apijson.Field
- Provisioning apijson.Field
- ServiceID apijson.Field
- ServiceName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixBGPBindingGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixBGPBindingGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// Status of a Service Binding's deployment to the Cloudflare network
-type AddressingPrefixBGPBindingGetResponseProvisioning struct {
- // When a binding has been deployed to a majority of Cloudflare datacenters, the
- // binding will become active and can be used with its associated service.
- State AddressingPrefixBGPBindingGetResponseProvisioningState `json:"state"`
- JSON addressingPrefixBGPBindingGetResponseProvisioningJSON `json:"-"`
-}
-
-// addressingPrefixBGPBindingGetResponseProvisioningJSON contains the JSON metadata
-// for the struct [AddressingPrefixBGPBindingGetResponseProvisioning]
-type addressingPrefixBGPBindingGetResponseProvisioningJSON struct {
- State apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixBGPBindingGetResponseProvisioning) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixBGPBindingGetResponseProvisioningJSON) RawJSON() string {
- return r.raw
-}
-
-// When a binding has been deployed to a majority of Cloudflare datacenters, the
-// binding will become active and can be used with its associated service.
-type AddressingPrefixBGPBindingGetResponseProvisioningState string
-
-const (
- AddressingPrefixBGPBindingGetResponseProvisioningStateProvisioning AddressingPrefixBGPBindingGetResponseProvisioningState = "provisioning"
- AddressingPrefixBGPBindingGetResponseProvisioningStateActive AddressingPrefixBGPBindingGetResponseProvisioningState = "active"
-)
-
-type AddressingPrefixBGPBindingNewParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
- // IP Prefix in Classless Inter-Domain Routing format.
- Cidr param.Field[string] `json:"cidr"`
- // Identifier
- ServiceID param.Field[string] `json:"service_id"`
-}
-
-func (r AddressingPrefixBGPBindingNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type AddressingPrefixBGPBindingNewResponseEnvelope struct {
- Errors []AddressingPrefixBGPBindingNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []AddressingPrefixBGPBindingNewResponseEnvelopeMessages `json:"messages,required"`
- Result AddressingPrefixBGPBindingNewResponse `json:"result,required"`
- // Whether the API call was successful
- Success AddressingPrefixBGPBindingNewResponseEnvelopeSuccess `json:"success,required"`
- JSON addressingPrefixBGPBindingNewResponseEnvelopeJSON `json:"-"`
-}
-
-// addressingPrefixBGPBindingNewResponseEnvelopeJSON contains the JSON metadata for
-// the struct [AddressingPrefixBGPBindingNewResponseEnvelope]
-type addressingPrefixBGPBindingNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixBGPBindingNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixBGPBindingNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingPrefixBGPBindingNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON addressingPrefixBGPBindingNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// addressingPrefixBGPBindingNewResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct [AddressingPrefixBGPBindingNewResponseEnvelopeErrors]
-type addressingPrefixBGPBindingNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixBGPBindingNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixBGPBindingNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingPrefixBGPBindingNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON addressingPrefixBGPBindingNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// addressingPrefixBGPBindingNewResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct [AddressingPrefixBGPBindingNewResponseEnvelopeMessages]
-type addressingPrefixBGPBindingNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixBGPBindingNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixBGPBindingNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type AddressingPrefixBGPBindingNewResponseEnvelopeSuccess bool
-
-const (
- AddressingPrefixBGPBindingNewResponseEnvelopeSuccessTrue AddressingPrefixBGPBindingNewResponseEnvelopeSuccess = true
-)
-
-type AddressingPrefixBGPBindingListParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type AddressingPrefixBGPBindingListResponseEnvelope struct {
- Errors []AddressingPrefixBGPBindingListResponseEnvelopeErrors `json:"errors,required"`
- Messages []AddressingPrefixBGPBindingListResponseEnvelopeMessages `json:"messages,required"`
- Result []AddressingPrefixBGPBindingListResponse `json:"result,required"`
- // Whether the API call was successful
- Success AddressingPrefixBGPBindingListResponseEnvelopeSuccess `json:"success,required"`
- JSON addressingPrefixBGPBindingListResponseEnvelopeJSON `json:"-"`
-}
-
-// addressingPrefixBGPBindingListResponseEnvelopeJSON contains the JSON metadata
-// for the struct [AddressingPrefixBGPBindingListResponseEnvelope]
-type addressingPrefixBGPBindingListResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixBGPBindingListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixBGPBindingListResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingPrefixBGPBindingListResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON addressingPrefixBGPBindingListResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// addressingPrefixBGPBindingListResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct [AddressingPrefixBGPBindingListResponseEnvelopeErrors]
-type addressingPrefixBGPBindingListResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixBGPBindingListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixBGPBindingListResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingPrefixBGPBindingListResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON addressingPrefixBGPBindingListResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// addressingPrefixBGPBindingListResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct [AddressingPrefixBGPBindingListResponseEnvelopeMessages]
-type addressingPrefixBGPBindingListResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixBGPBindingListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixBGPBindingListResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type AddressingPrefixBGPBindingListResponseEnvelopeSuccess bool
-
-const (
- AddressingPrefixBGPBindingListResponseEnvelopeSuccessTrue AddressingPrefixBGPBindingListResponseEnvelopeSuccess = true
-)
-
-type AddressingPrefixBGPBindingDeleteParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type AddressingPrefixBGPBindingDeleteResponseEnvelope struct {
- Errors []AddressingPrefixBGPBindingDeleteResponseEnvelopeErrors `json:"errors,required"`
- Messages []AddressingPrefixBGPBindingDeleteResponseEnvelopeMessages `json:"messages,required"`
- Result AddressingPrefixBGPBindingDeleteResponse `json:"result,required"`
- // Whether the API call was successful
- Success AddressingPrefixBGPBindingDeleteResponseEnvelopeSuccess `json:"success,required"`
- JSON addressingPrefixBGPBindingDeleteResponseEnvelopeJSON `json:"-"`
-}
-
-// addressingPrefixBGPBindingDeleteResponseEnvelopeJSON contains the JSON metadata
-// for the struct [AddressingPrefixBGPBindingDeleteResponseEnvelope]
-type addressingPrefixBGPBindingDeleteResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixBGPBindingDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixBGPBindingDeleteResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingPrefixBGPBindingDeleteResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON addressingPrefixBGPBindingDeleteResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// addressingPrefixBGPBindingDeleteResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct [AddressingPrefixBGPBindingDeleteResponseEnvelopeErrors]
-type addressingPrefixBGPBindingDeleteResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixBGPBindingDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixBGPBindingDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingPrefixBGPBindingDeleteResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON addressingPrefixBGPBindingDeleteResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// addressingPrefixBGPBindingDeleteResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct
-// [AddressingPrefixBGPBindingDeleteResponseEnvelopeMessages]
-type addressingPrefixBGPBindingDeleteResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixBGPBindingDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixBGPBindingDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type AddressingPrefixBGPBindingDeleteResponseEnvelopeSuccess bool
-
-const (
- AddressingPrefixBGPBindingDeleteResponseEnvelopeSuccessTrue AddressingPrefixBGPBindingDeleteResponseEnvelopeSuccess = true
-)
-
-type AddressingPrefixBGPBindingGetParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type AddressingPrefixBGPBindingGetResponseEnvelope struct {
- Errors []AddressingPrefixBGPBindingGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []AddressingPrefixBGPBindingGetResponseEnvelopeMessages `json:"messages,required"`
- Result AddressingPrefixBGPBindingGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success AddressingPrefixBGPBindingGetResponseEnvelopeSuccess `json:"success,required"`
- JSON addressingPrefixBGPBindingGetResponseEnvelopeJSON `json:"-"`
-}
-
-// addressingPrefixBGPBindingGetResponseEnvelopeJSON contains the JSON metadata for
-// the struct [AddressingPrefixBGPBindingGetResponseEnvelope]
-type addressingPrefixBGPBindingGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixBGPBindingGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixBGPBindingGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingPrefixBGPBindingGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON addressingPrefixBGPBindingGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// addressingPrefixBGPBindingGetResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct [AddressingPrefixBGPBindingGetResponseEnvelopeErrors]
-type addressingPrefixBGPBindingGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixBGPBindingGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixBGPBindingGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingPrefixBGPBindingGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON addressingPrefixBGPBindingGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// addressingPrefixBGPBindingGetResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct [AddressingPrefixBGPBindingGetResponseEnvelopeMessages]
-type addressingPrefixBGPBindingGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixBGPBindingGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixBGPBindingGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type AddressingPrefixBGPBindingGetResponseEnvelopeSuccess bool
-
-const (
- AddressingPrefixBGPBindingGetResponseEnvelopeSuccessTrue AddressingPrefixBGPBindingGetResponseEnvelopeSuccess = true
-)
diff --git a/addressingprefixbgpbinding_test.go b/addressingprefixbgpbinding_test.go
deleted file mode 100644
index ffbe2eff8ee..00000000000
--- a/addressingprefixbgpbinding_test.go
+++ /dev/null
@@ -1,138 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestAddressingPrefixBGPBindingNewWithOptionalParams(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"),
- )
- _, err := client.Addressing.Prefixes.BGP.Bindings.New(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.AddressingPrefixBGPBindingNewParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Cidr: cloudflare.F("192.0.2.0/24"),
- ServiceID: cloudflare.F("2db684ee7ca04e159946fd05b99e1bcd"),
- },
- )
- 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())
- }
-}
-
-func TestAddressingPrefixBGPBindingList(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"),
- )
- _, err := client.Addressing.Prefixes.BGP.Bindings.List(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.AddressingPrefixBGPBindingListParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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())
- }
-}
-
-func TestAddressingPrefixBGPBindingDelete(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"),
- )
- _, err := client.Addressing.Prefixes.BGP.Bindings.Delete(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.AddressingPrefixBGPBindingDeleteParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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())
- }
-}
-
-func TestAddressingPrefixBGPBindingGet(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"),
- )
- _, err := client.Addressing.Prefixes.BGP.Bindings.Get(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.AddressingPrefixBGPBindingGetParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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/addressingprefixbgpprefix.go b/addressingprefixbgpprefix.go
deleted file mode 100644
index ff7547b172b..00000000000
--- a/addressingprefixbgpprefix.go
+++ /dev/null
@@ -1,675 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// AddressingPrefixBGPPrefixService contains methods and other services that help
-// with interacting with the cloudflare API. Note, unlike clients, this service
-// does not read variables from the environment automatically. You should not
-// instantiate this service directly, and instead use the
-// [NewAddressingPrefixBGPPrefixService] method instead.
-type AddressingPrefixBGPPrefixService struct {
- Options []option.RequestOption
-}
-
-// NewAddressingPrefixBGPPrefixService generates a new service that applies the
-// given options to each request. These options are applied after the parent
-// client's options (if there is one), and before any request-specific options.
-func NewAddressingPrefixBGPPrefixService(opts ...option.RequestOption) (r *AddressingPrefixBGPPrefixService) {
- r = &AddressingPrefixBGPPrefixService{}
- r.Options = opts
- return
-}
-
-// List all BGP Prefixes within the specified IP Prefix. BGP Prefixes are used to
-// control which specific subnets are advertised to the Internet. It is possible to
-// advertise subnets more specific than an IP Prefix by creating more specific BGP
-// Prefixes.
-func (r *AddressingPrefixBGPPrefixService) List(ctx context.Context, prefixID string, query AddressingPrefixBGPPrefixListParams, opts ...option.RequestOption) (res *[]AddressingPrefixBGPPrefixListResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env AddressingPrefixBGPPrefixListResponseEnvelope
- path := fmt.Sprintf("accounts/%s/addressing/prefixes/%s/bgp/prefixes", query.AccountID, prefixID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Update the properties of a BGP Prefix, such as the on demand advertisement
-// status (advertised or withdrawn).
-func (r *AddressingPrefixBGPPrefixService) Edit(ctx context.Context, prefixID string, bgpPrefixID string, params AddressingPrefixBGPPrefixEditParams, opts ...option.RequestOption) (res *AddressingPrefixBGPPrefixEditResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env AddressingPrefixBGPPrefixEditResponseEnvelope
- path := fmt.Sprintf("accounts/%s/addressing/prefixes/%s/bgp/prefixes/%s", params.AccountID, prefixID, bgpPrefixID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Retrieve a single BGP Prefix according to its identifier
-func (r *AddressingPrefixBGPPrefixService) Get(ctx context.Context, prefixID string, bgpPrefixID string, query AddressingPrefixBGPPrefixGetParams, opts ...option.RequestOption) (res *AddressingPrefixBGPPrefixGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env AddressingPrefixBGPPrefixGetResponseEnvelope
- path := fmt.Sprintf("accounts/%s/addressing/prefixes/%s/bgp/prefixes/%s", query.AccountID, prefixID, bgpPrefixID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type AddressingPrefixBGPPrefixListResponse struct {
- // Identifier
- ID string `json:"id"`
- // Autonomous System Number (ASN) the prefix will be advertised under.
- ASN int64 `json:"asn,nullable"`
- BGPSignalOpts AddressingPrefixBGPPrefixListResponseBGPSignalOpts `json:"bgp_signal_opts"`
- // IP Prefix in Classless Inter-Domain Routing format.
- Cidr string `json:"cidr"`
- CreatedAt time.Time `json:"created_at" format:"date-time"`
- ModifiedAt time.Time `json:"modified_at" format:"date-time"`
- OnDemand AddressingPrefixBGPPrefixListResponseOnDemand `json:"on_demand"`
- JSON addressingPrefixBGPPrefixListResponseJSON `json:"-"`
-}
-
-// addressingPrefixBGPPrefixListResponseJSON contains the JSON metadata for the
-// struct [AddressingPrefixBGPPrefixListResponse]
-type addressingPrefixBGPPrefixListResponseJSON struct {
- ID apijson.Field
- ASN apijson.Field
- BGPSignalOpts apijson.Field
- Cidr apijson.Field
- CreatedAt apijson.Field
- ModifiedAt apijson.Field
- OnDemand apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixBGPPrefixListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixBGPPrefixListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingPrefixBGPPrefixListResponseBGPSignalOpts struct {
- // Whether control of advertisement of the prefix to the Internet is enabled to be
- // performed via BGP signal
- Enabled bool `json:"enabled"`
- // Last time BGP signaling control was toggled. This field is null if BGP signaling
- // has never been enabled.
- ModifiedAt time.Time `json:"modified_at,nullable" format:"date-time"`
- JSON addressingPrefixBGPPrefixListResponseBGPSignalOptsJSON `json:"-"`
-}
-
-// addressingPrefixBGPPrefixListResponseBGPSignalOptsJSON contains the JSON
-// metadata for the struct [AddressingPrefixBGPPrefixListResponseBGPSignalOpts]
-type addressingPrefixBGPPrefixListResponseBGPSignalOptsJSON struct {
- Enabled apijson.Field
- ModifiedAt apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixBGPPrefixListResponseBGPSignalOpts) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixBGPPrefixListResponseBGPSignalOptsJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingPrefixBGPPrefixListResponseOnDemand struct {
- // Prefix advertisement status to the Internet. This field is only not 'null' if on
- // demand is enabled.
- Advertised bool `json:"advertised,nullable"`
- // Last time the advertisement status was changed. This field is only not 'null' if
- // on demand is enabled.
- AdvertisedModifiedAt time.Time `json:"advertised_modified_at,nullable" format:"date-time"`
- // Whether advertisement of the prefix to the Internet may be dynamically enabled
- // or disabled.
- OnDemandEnabled bool `json:"on_demand_enabled"`
- // Whether advertisement status of the prefix is locked, meaning it cannot be
- // changed.
- OnDemandLocked bool `json:"on_demand_locked"`
- JSON addressingPrefixBGPPrefixListResponseOnDemandJSON `json:"-"`
-}
-
-// addressingPrefixBGPPrefixListResponseOnDemandJSON contains the JSON metadata for
-// the struct [AddressingPrefixBGPPrefixListResponseOnDemand]
-type addressingPrefixBGPPrefixListResponseOnDemandJSON struct {
- Advertised apijson.Field
- AdvertisedModifiedAt apijson.Field
- OnDemandEnabled apijson.Field
- OnDemandLocked apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixBGPPrefixListResponseOnDemand) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixBGPPrefixListResponseOnDemandJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingPrefixBGPPrefixEditResponse struct {
- // Identifier
- ID string `json:"id"`
- // Autonomous System Number (ASN) the prefix will be advertised under.
- ASN int64 `json:"asn,nullable"`
- BGPSignalOpts AddressingPrefixBGPPrefixEditResponseBGPSignalOpts `json:"bgp_signal_opts"`
- // IP Prefix in Classless Inter-Domain Routing format.
- Cidr string `json:"cidr"`
- CreatedAt time.Time `json:"created_at" format:"date-time"`
- ModifiedAt time.Time `json:"modified_at" format:"date-time"`
- OnDemand AddressingPrefixBGPPrefixEditResponseOnDemand `json:"on_demand"`
- JSON addressingPrefixBGPPrefixEditResponseJSON `json:"-"`
-}
-
-// addressingPrefixBGPPrefixEditResponseJSON contains the JSON metadata for the
-// struct [AddressingPrefixBGPPrefixEditResponse]
-type addressingPrefixBGPPrefixEditResponseJSON struct {
- ID apijson.Field
- ASN apijson.Field
- BGPSignalOpts apijson.Field
- Cidr apijson.Field
- CreatedAt apijson.Field
- ModifiedAt apijson.Field
- OnDemand apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixBGPPrefixEditResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixBGPPrefixEditResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingPrefixBGPPrefixEditResponseBGPSignalOpts struct {
- // Whether control of advertisement of the prefix to the Internet is enabled to be
- // performed via BGP signal
- Enabled bool `json:"enabled"`
- // Last time BGP signaling control was toggled. This field is null if BGP signaling
- // has never been enabled.
- ModifiedAt time.Time `json:"modified_at,nullable" format:"date-time"`
- JSON addressingPrefixBGPPrefixEditResponseBGPSignalOptsJSON `json:"-"`
-}
-
-// addressingPrefixBGPPrefixEditResponseBGPSignalOptsJSON contains the JSON
-// metadata for the struct [AddressingPrefixBGPPrefixEditResponseBGPSignalOpts]
-type addressingPrefixBGPPrefixEditResponseBGPSignalOptsJSON struct {
- Enabled apijson.Field
- ModifiedAt apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixBGPPrefixEditResponseBGPSignalOpts) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixBGPPrefixEditResponseBGPSignalOptsJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingPrefixBGPPrefixEditResponseOnDemand struct {
- // Prefix advertisement status to the Internet. This field is only not 'null' if on
- // demand is enabled.
- Advertised bool `json:"advertised,nullable"`
- // Last time the advertisement status was changed. This field is only not 'null' if
- // on demand is enabled.
- AdvertisedModifiedAt time.Time `json:"advertised_modified_at,nullable" format:"date-time"`
- // Whether advertisement of the prefix to the Internet may be dynamically enabled
- // or disabled.
- OnDemandEnabled bool `json:"on_demand_enabled"`
- // Whether advertisement status of the prefix is locked, meaning it cannot be
- // changed.
- OnDemandLocked bool `json:"on_demand_locked"`
- JSON addressingPrefixBGPPrefixEditResponseOnDemandJSON `json:"-"`
-}
-
-// addressingPrefixBGPPrefixEditResponseOnDemandJSON contains the JSON metadata for
-// the struct [AddressingPrefixBGPPrefixEditResponseOnDemand]
-type addressingPrefixBGPPrefixEditResponseOnDemandJSON struct {
- Advertised apijson.Field
- AdvertisedModifiedAt apijson.Field
- OnDemandEnabled apijson.Field
- OnDemandLocked apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixBGPPrefixEditResponseOnDemand) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixBGPPrefixEditResponseOnDemandJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingPrefixBGPPrefixGetResponse struct {
- // Identifier
- ID string `json:"id"`
- // Autonomous System Number (ASN) the prefix will be advertised under.
- ASN int64 `json:"asn,nullable"`
- BGPSignalOpts AddressingPrefixBGPPrefixGetResponseBGPSignalOpts `json:"bgp_signal_opts"`
- // IP Prefix in Classless Inter-Domain Routing format.
- Cidr string `json:"cidr"`
- CreatedAt time.Time `json:"created_at" format:"date-time"`
- ModifiedAt time.Time `json:"modified_at" format:"date-time"`
- OnDemand AddressingPrefixBGPPrefixGetResponseOnDemand `json:"on_demand"`
- JSON addressingPrefixBGPPrefixGetResponseJSON `json:"-"`
-}
-
-// addressingPrefixBGPPrefixGetResponseJSON contains the JSON metadata for the
-// struct [AddressingPrefixBGPPrefixGetResponse]
-type addressingPrefixBGPPrefixGetResponseJSON struct {
- ID apijson.Field
- ASN apijson.Field
- BGPSignalOpts apijson.Field
- Cidr apijson.Field
- CreatedAt apijson.Field
- ModifiedAt apijson.Field
- OnDemand apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixBGPPrefixGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixBGPPrefixGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingPrefixBGPPrefixGetResponseBGPSignalOpts struct {
- // Whether control of advertisement of the prefix to the Internet is enabled to be
- // performed via BGP signal
- Enabled bool `json:"enabled"`
- // Last time BGP signaling control was toggled. This field is null if BGP signaling
- // has never been enabled.
- ModifiedAt time.Time `json:"modified_at,nullable" format:"date-time"`
- JSON addressingPrefixBGPPrefixGetResponseBGPSignalOptsJSON `json:"-"`
-}
-
-// addressingPrefixBGPPrefixGetResponseBGPSignalOptsJSON contains the JSON metadata
-// for the struct [AddressingPrefixBGPPrefixGetResponseBGPSignalOpts]
-type addressingPrefixBGPPrefixGetResponseBGPSignalOptsJSON struct {
- Enabled apijson.Field
- ModifiedAt apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixBGPPrefixGetResponseBGPSignalOpts) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixBGPPrefixGetResponseBGPSignalOptsJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingPrefixBGPPrefixGetResponseOnDemand struct {
- // Prefix advertisement status to the Internet. This field is only not 'null' if on
- // demand is enabled.
- Advertised bool `json:"advertised,nullable"`
- // Last time the advertisement status was changed. This field is only not 'null' if
- // on demand is enabled.
- AdvertisedModifiedAt time.Time `json:"advertised_modified_at,nullable" format:"date-time"`
- // Whether advertisement of the prefix to the Internet may be dynamically enabled
- // or disabled.
- OnDemandEnabled bool `json:"on_demand_enabled"`
- // Whether advertisement status of the prefix is locked, meaning it cannot be
- // changed.
- OnDemandLocked bool `json:"on_demand_locked"`
- JSON addressingPrefixBGPPrefixGetResponseOnDemandJSON `json:"-"`
-}
-
-// addressingPrefixBGPPrefixGetResponseOnDemandJSON contains the JSON metadata for
-// the struct [AddressingPrefixBGPPrefixGetResponseOnDemand]
-type addressingPrefixBGPPrefixGetResponseOnDemandJSON struct {
- Advertised apijson.Field
- AdvertisedModifiedAt apijson.Field
- OnDemandEnabled apijson.Field
- OnDemandLocked apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixBGPPrefixGetResponseOnDemand) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixBGPPrefixGetResponseOnDemandJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingPrefixBGPPrefixListParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type AddressingPrefixBGPPrefixListResponseEnvelope struct {
- Errors []AddressingPrefixBGPPrefixListResponseEnvelopeErrors `json:"errors,required"`
- Messages []AddressingPrefixBGPPrefixListResponseEnvelopeMessages `json:"messages,required"`
- Result []AddressingPrefixBGPPrefixListResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success AddressingPrefixBGPPrefixListResponseEnvelopeSuccess `json:"success,required"`
- ResultInfo AddressingPrefixBGPPrefixListResponseEnvelopeResultInfo `json:"result_info"`
- JSON addressingPrefixBGPPrefixListResponseEnvelopeJSON `json:"-"`
-}
-
-// addressingPrefixBGPPrefixListResponseEnvelopeJSON contains the JSON metadata for
-// the struct [AddressingPrefixBGPPrefixListResponseEnvelope]
-type addressingPrefixBGPPrefixListResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- ResultInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixBGPPrefixListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixBGPPrefixListResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingPrefixBGPPrefixListResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON addressingPrefixBGPPrefixListResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// addressingPrefixBGPPrefixListResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct [AddressingPrefixBGPPrefixListResponseEnvelopeErrors]
-type addressingPrefixBGPPrefixListResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixBGPPrefixListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixBGPPrefixListResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingPrefixBGPPrefixListResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON addressingPrefixBGPPrefixListResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// addressingPrefixBGPPrefixListResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct [AddressingPrefixBGPPrefixListResponseEnvelopeMessages]
-type addressingPrefixBGPPrefixListResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixBGPPrefixListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixBGPPrefixListResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type AddressingPrefixBGPPrefixListResponseEnvelopeSuccess bool
-
-const (
- AddressingPrefixBGPPrefixListResponseEnvelopeSuccessTrue AddressingPrefixBGPPrefixListResponseEnvelopeSuccess = true
-)
-
-type AddressingPrefixBGPPrefixListResponseEnvelopeResultInfo struct {
- // Total number of results for the requested service
- Count float64 `json:"count"`
- // Current page within paginated list of results
- Page float64 `json:"page"`
- // Number of results per page of results
- PerPage float64 `json:"per_page"`
- // Total results available without any search parameters
- TotalCount float64 `json:"total_count"`
- JSON addressingPrefixBGPPrefixListResponseEnvelopeResultInfoJSON `json:"-"`
-}
-
-// addressingPrefixBGPPrefixListResponseEnvelopeResultInfoJSON contains the JSON
-// metadata for the struct
-// [AddressingPrefixBGPPrefixListResponseEnvelopeResultInfo]
-type addressingPrefixBGPPrefixListResponseEnvelopeResultInfoJSON struct {
- Count apijson.Field
- Page apijson.Field
- PerPage apijson.Field
- TotalCount apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixBGPPrefixListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixBGPPrefixListResponseEnvelopeResultInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingPrefixBGPPrefixEditParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
- OnDemand param.Field[AddressingPrefixBGPPrefixEditParamsOnDemand] `json:"on_demand"`
-}
-
-func (r AddressingPrefixBGPPrefixEditParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type AddressingPrefixBGPPrefixEditParamsOnDemand struct {
- Advertised param.Field[bool] `json:"advertised"`
-}
-
-func (r AddressingPrefixBGPPrefixEditParamsOnDemand) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type AddressingPrefixBGPPrefixEditResponseEnvelope struct {
- Errors []AddressingPrefixBGPPrefixEditResponseEnvelopeErrors `json:"errors,required"`
- Messages []AddressingPrefixBGPPrefixEditResponseEnvelopeMessages `json:"messages,required"`
- Result AddressingPrefixBGPPrefixEditResponse `json:"result,required"`
- // Whether the API call was successful
- Success AddressingPrefixBGPPrefixEditResponseEnvelopeSuccess `json:"success,required"`
- JSON addressingPrefixBGPPrefixEditResponseEnvelopeJSON `json:"-"`
-}
-
-// addressingPrefixBGPPrefixEditResponseEnvelopeJSON contains the JSON metadata for
-// the struct [AddressingPrefixBGPPrefixEditResponseEnvelope]
-type addressingPrefixBGPPrefixEditResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixBGPPrefixEditResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixBGPPrefixEditResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingPrefixBGPPrefixEditResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON addressingPrefixBGPPrefixEditResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// addressingPrefixBGPPrefixEditResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct [AddressingPrefixBGPPrefixEditResponseEnvelopeErrors]
-type addressingPrefixBGPPrefixEditResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixBGPPrefixEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixBGPPrefixEditResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingPrefixBGPPrefixEditResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON addressingPrefixBGPPrefixEditResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// addressingPrefixBGPPrefixEditResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct [AddressingPrefixBGPPrefixEditResponseEnvelopeMessages]
-type addressingPrefixBGPPrefixEditResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixBGPPrefixEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixBGPPrefixEditResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type AddressingPrefixBGPPrefixEditResponseEnvelopeSuccess bool
-
-const (
- AddressingPrefixBGPPrefixEditResponseEnvelopeSuccessTrue AddressingPrefixBGPPrefixEditResponseEnvelopeSuccess = true
-)
-
-type AddressingPrefixBGPPrefixGetParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type AddressingPrefixBGPPrefixGetResponseEnvelope struct {
- Errors []AddressingPrefixBGPPrefixGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []AddressingPrefixBGPPrefixGetResponseEnvelopeMessages `json:"messages,required"`
- Result AddressingPrefixBGPPrefixGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success AddressingPrefixBGPPrefixGetResponseEnvelopeSuccess `json:"success,required"`
- JSON addressingPrefixBGPPrefixGetResponseEnvelopeJSON `json:"-"`
-}
-
-// addressingPrefixBGPPrefixGetResponseEnvelopeJSON contains the JSON metadata for
-// the struct [AddressingPrefixBGPPrefixGetResponseEnvelope]
-type addressingPrefixBGPPrefixGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixBGPPrefixGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixBGPPrefixGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingPrefixBGPPrefixGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON addressingPrefixBGPPrefixGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// addressingPrefixBGPPrefixGetResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct [AddressingPrefixBGPPrefixGetResponseEnvelopeErrors]
-type addressingPrefixBGPPrefixGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixBGPPrefixGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixBGPPrefixGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingPrefixBGPPrefixGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON addressingPrefixBGPPrefixGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// addressingPrefixBGPPrefixGetResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct [AddressingPrefixBGPPrefixGetResponseEnvelopeMessages]
-type addressingPrefixBGPPrefixGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixBGPPrefixGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixBGPPrefixGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type AddressingPrefixBGPPrefixGetResponseEnvelopeSuccess bool
-
-const (
- AddressingPrefixBGPPrefixGetResponseEnvelopeSuccessTrue AddressingPrefixBGPPrefixGetResponseEnvelopeSuccess = true
-)
diff --git a/addressingprefixbgpprefix_test.go b/addressingprefixbgpprefix_test.go
deleted file mode 100644
index 442344662a5..00000000000
--- a/addressingprefixbgpprefix_test.go
+++ /dev/null
@@ -1,109 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestAddressingPrefixBGPPrefixList(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"),
- )
- _, err := client.Addressing.Prefixes.BGP.Prefixes.List(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.AddressingPrefixBGPPrefixListParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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())
- }
-}
-
-func TestAddressingPrefixBGPPrefixEditWithOptionalParams(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"),
- )
- _, err := client.Addressing.Prefixes.BGP.Prefixes.Edit(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.AddressingPrefixBGPPrefixEditParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- OnDemand: cloudflare.F(cloudflare.AddressingPrefixBGPPrefixEditParamsOnDemand{
- Advertised: cloudflare.F(true),
- }),
- },
- )
- 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())
- }
-}
-
-func TestAddressingPrefixBGPPrefixGet(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"),
- )
- _, err := client.Addressing.Prefixes.BGP.Prefixes.Get(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.AddressingPrefixBGPPrefixGetParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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/addressingprefixbgpstatus.go b/addressingprefixbgpstatus.go
deleted file mode 100644
index 3ed3926f276..00000000000
--- a/addressingprefixbgpstatus.go
+++ /dev/null
@@ -1,289 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// AddressingPrefixBGPStatusService contains methods and other services that help
-// with interacting with the cloudflare API. Note, unlike clients, this service
-// does not read variables from the environment automatically. You should not
-// instantiate this service directly, and instead use the
-// [NewAddressingPrefixBGPStatusService] method instead.
-type AddressingPrefixBGPStatusService struct {
- Options []option.RequestOption
-}
-
-// NewAddressingPrefixBGPStatusService generates a new service that applies the
-// given options to each request. These options are applied after the parent
-// client's options (if there is one), and before any request-specific options.
-func NewAddressingPrefixBGPStatusService(opts ...option.RequestOption) (r *AddressingPrefixBGPStatusService) {
- r = &AddressingPrefixBGPStatusService{}
- r.Options = opts
- return
-}
-
-// Advertise or withdraw BGP route for a prefix.
-func (r *AddressingPrefixBGPStatusService) Edit(ctx context.Context, prefixID string, params AddressingPrefixBGPStatusEditParams, opts ...option.RequestOption) (res *AddressingPrefixBGPStatusEditResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env AddressingPrefixBGPStatusEditResponseEnvelope
- path := fmt.Sprintf("accounts/%s/addressing/prefixes/%s/bgp/status", params.AccountID, prefixID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// List the current advertisement state for a prefix.
-func (r *AddressingPrefixBGPStatusService) Get(ctx context.Context, prefixID string, query AddressingPrefixBGPStatusGetParams, opts ...option.RequestOption) (res *AddressingPrefixBGPStatusGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env AddressingPrefixBGPStatusGetResponseEnvelope
- path := fmt.Sprintf("accounts/%s/addressing/prefixes/%s/bgp/status", query.AccountID, prefixID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type AddressingPrefixBGPStatusEditResponse struct {
- // Enablement of prefix advertisement to the Internet.
- Advertised bool `json:"advertised"`
- // Last time the advertisement status was changed. This field is only not 'null' if
- // on demand is enabled.
- AdvertisedModifiedAt time.Time `json:"advertised_modified_at,nullable" format:"date-time"`
- JSON addressingPrefixBGPStatusEditResponseJSON `json:"-"`
-}
-
-// addressingPrefixBGPStatusEditResponseJSON contains the JSON metadata for the
-// struct [AddressingPrefixBGPStatusEditResponse]
-type addressingPrefixBGPStatusEditResponseJSON struct {
- Advertised apijson.Field
- AdvertisedModifiedAt apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixBGPStatusEditResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixBGPStatusEditResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingPrefixBGPStatusGetResponse struct {
- // Enablement of prefix advertisement to the Internet.
- Advertised bool `json:"advertised"`
- // Last time the advertisement status was changed. This field is only not 'null' if
- // on demand is enabled.
- AdvertisedModifiedAt time.Time `json:"advertised_modified_at,nullable" format:"date-time"`
- JSON addressingPrefixBGPStatusGetResponseJSON `json:"-"`
-}
-
-// addressingPrefixBGPStatusGetResponseJSON contains the JSON metadata for the
-// struct [AddressingPrefixBGPStatusGetResponse]
-type addressingPrefixBGPStatusGetResponseJSON struct {
- Advertised apijson.Field
- AdvertisedModifiedAt apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixBGPStatusGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixBGPStatusGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingPrefixBGPStatusEditParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
- // Enablement of prefix advertisement to the Internet.
- Advertised param.Field[bool] `json:"advertised,required"`
-}
-
-func (r AddressingPrefixBGPStatusEditParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type AddressingPrefixBGPStatusEditResponseEnvelope struct {
- Errors []AddressingPrefixBGPStatusEditResponseEnvelopeErrors `json:"errors,required"`
- Messages []AddressingPrefixBGPStatusEditResponseEnvelopeMessages `json:"messages,required"`
- Result AddressingPrefixBGPStatusEditResponse `json:"result,required"`
- // Whether the API call was successful
- Success AddressingPrefixBGPStatusEditResponseEnvelopeSuccess `json:"success,required"`
- JSON addressingPrefixBGPStatusEditResponseEnvelopeJSON `json:"-"`
-}
-
-// addressingPrefixBGPStatusEditResponseEnvelopeJSON contains the JSON metadata for
-// the struct [AddressingPrefixBGPStatusEditResponseEnvelope]
-type addressingPrefixBGPStatusEditResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixBGPStatusEditResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixBGPStatusEditResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingPrefixBGPStatusEditResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON addressingPrefixBGPStatusEditResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// addressingPrefixBGPStatusEditResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct [AddressingPrefixBGPStatusEditResponseEnvelopeErrors]
-type addressingPrefixBGPStatusEditResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixBGPStatusEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixBGPStatusEditResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingPrefixBGPStatusEditResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON addressingPrefixBGPStatusEditResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// addressingPrefixBGPStatusEditResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct [AddressingPrefixBGPStatusEditResponseEnvelopeMessages]
-type addressingPrefixBGPStatusEditResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixBGPStatusEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixBGPStatusEditResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type AddressingPrefixBGPStatusEditResponseEnvelopeSuccess bool
-
-const (
- AddressingPrefixBGPStatusEditResponseEnvelopeSuccessTrue AddressingPrefixBGPStatusEditResponseEnvelopeSuccess = true
-)
-
-type AddressingPrefixBGPStatusGetParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type AddressingPrefixBGPStatusGetResponseEnvelope struct {
- Errors []AddressingPrefixBGPStatusGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []AddressingPrefixBGPStatusGetResponseEnvelopeMessages `json:"messages,required"`
- Result AddressingPrefixBGPStatusGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success AddressingPrefixBGPStatusGetResponseEnvelopeSuccess `json:"success,required"`
- JSON addressingPrefixBGPStatusGetResponseEnvelopeJSON `json:"-"`
-}
-
-// addressingPrefixBGPStatusGetResponseEnvelopeJSON contains the JSON metadata for
-// the struct [AddressingPrefixBGPStatusGetResponseEnvelope]
-type addressingPrefixBGPStatusGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixBGPStatusGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixBGPStatusGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingPrefixBGPStatusGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON addressingPrefixBGPStatusGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// addressingPrefixBGPStatusGetResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct [AddressingPrefixBGPStatusGetResponseEnvelopeErrors]
-type addressingPrefixBGPStatusGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixBGPStatusGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixBGPStatusGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingPrefixBGPStatusGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON addressingPrefixBGPStatusGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// addressingPrefixBGPStatusGetResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct [AddressingPrefixBGPStatusGetResponseEnvelopeMessages]
-type addressingPrefixBGPStatusGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixBGPStatusGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixBGPStatusGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type AddressingPrefixBGPStatusGetResponseEnvelopeSuccess bool
-
-const (
- AddressingPrefixBGPStatusGetResponseEnvelopeSuccessTrue AddressingPrefixBGPStatusGetResponseEnvelopeSuccess = true
-)
diff --git a/addressingprefixbgpstatus_test.go b/addressingprefixbgpstatus_test.go
deleted file mode 100644
index 90b7b0f95cc..00000000000
--- a/addressingprefixbgpstatus_test.go
+++ /dev/null
@@ -1,75 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestAddressingPrefixBGPStatusEdit(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"),
- )
- _, err := client.Addressing.Prefixes.BGP.Statuses.Edit(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.AddressingPrefixBGPStatusEditParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Advertised: cloudflare.F(true),
- },
- )
- 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())
- }
-}
-
-func TestAddressingPrefixBGPStatusGet(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"),
- )
- _, err := client.Addressing.Prefixes.BGP.Statuses.Get(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.AddressingPrefixBGPStatusGetParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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/addressingprefixdelegation.go b/addressingprefixdelegation.go
deleted file mode 100644
index 77e61074654..00000000000
--- a/addressingprefixdelegation.go
+++ /dev/null
@@ -1,465 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// AddressingPrefixDelegationService contains methods and other services that help
-// with interacting with the cloudflare API. Note, unlike clients, this service
-// does not read variables from the environment automatically. You should not
-// instantiate this service directly, and instead use the
-// [NewAddressingPrefixDelegationService] method instead.
-type AddressingPrefixDelegationService struct {
- Options []option.RequestOption
-}
-
-// NewAddressingPrefixDelegationService generates a new service that applies the
-// given options to each request. These options are applied after the parent
-// client's options (if there is one), and before any request-specific options.
-func NewAddressingPrefixDelegationService(opts ...option.RequestOption) (r *AddressingPrefixDelegationService) {
- r = &AddressingPrefixDelegationService{}
- r.Options = opts
- return
-}
-
-// Create a new account delegation for a given IP prefix.
-func (r *AddressingPrefixDelegationService) New(ctx context.Context, prefixID string, params AddressingPrefixDelegationNewParams, opts ...option.RequestOption) (res *AddressingPrefixDelegationNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env AddressingPrefixDelegationNewResponseEnvelope
- path := fmt.Sprintf("accounts/%s/addressing/prefixes/%s/delegations", params.AccountID, prefixID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// List all delegations for a given account IP prefix.
-func (r *AddressingPrefixDelegationService) List(ctx context.Context, prefixID string, query AddressingPrefixDelegationListParams, opts ...option.RequestOption) (res *[]AddressingPrefixDelegationListResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env AddressingPrefixDelegationListResponseEnvelope
- path := fmt.Sprintf("accounts/%s/addressing/prefixes/%s/delegations", query.AccountID, prefixID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Delete an account delegation for a given IP prefix.
-func (r *AddressingPrefixDelegationService) Delete(ctx context.Context, prefixID string, delegationID string, body AddressingPrefixDelegationDeleteParams, opts ...option.RequestOption) (res *AddressingPrefixDelegationDeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env AddressingPrefixDelegationDeleteResponseEnvelope
- path := fmt.Sprintf("accounts/%s/addressing/prefixes/%s/delegations/%s", body.AccountID, prefixID, delegationID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type AddressingPrefixDelegationNewResponse struct {
- // Delegation identifier tag.
- ID string `json:"id"`
- // IP Prefix in Classless Inter-Domain Routing format.
- Cidr string `json:"cidr"`
- CreatedAt time.Time `json:"created_at" format:"date-time"`
- // Account identifier for the account to which prefix is being delegated.
- DelegatedAccountID string `json:"delegated_account_id"`
- ModifiedAt time.Time `json:"modified_at" format:"date-time"`
- // Identifier
- ParentPrefixID string `json:"parent_prefix_id"`
- JSON addressingPrefixDelegationNewResponseJSON `json:"-"`
-}
-
-// addressingPrefixDelegationNewResponseJSON contains the JSON metadata for the
-// struct [AddressingPrefixDelegationNewResponse]
-type addressingPrefixDelegationNewResponseJSON struct {
- ID apijson.Field
- Cidr apijson.Field
- CreatedAt apijson.Field
- DelegatedAccountID apijson.Field
- ModifiedAt apijson.Field
- ParentPrefixID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixDelegationNewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixDelegationNewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingPrefixDelegationListResponse struct {
- // Delegation identifier tag.
- ID string `json:"id"`
- // IP Prefix in Classless Inter-Domain Routing format.
- Cidr string `json:"cidr"`
- CreatedAt time.Time `json:"created_at" format:"date-time"`
- // Account identifier for the account to which prefix is being delegated.
- DelegatedAccountID string `json:"delegated_account_id"`
- ModifiedAt time.Time `json:"modified_at" format:"date-time"`
- // Identifier
- ParentPrefixID string `json:"parent_prefix_id"`
- JSON addressingPrefixDelegationListResponseJSON `json:"-"`
-}
-
-// addressingPrefixDelegationListResponseJSON contains the JSON metadata for the
-// struct [AddressingPrefixDelegationListResponse]
-type addressingPrefixDelegationListResponseJSON struct {
- ID apijson.Field
- Cidr apijson.Field
- CreatedAt apijson.Field
- DelegatedAccountID apijson.Field
- ModifiedAt apijson.Field
- ParentPrefixID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixDelegationListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixDelegationListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingPrefixDelegationDeleteResponse struct {
- // Delegation identifier tag.
- ID string `json:"id"`
- JSON addressingPrefixDelegationDeleteResponseJSON `json:"-"`
-}
-
-// addressingPrefixDelegationDeleteResponseJSON contains the JSON metadata for the
-// struct [AddressingPrefixDelegationDeleteResponse]
-type addressingPrefixDelegationDeleteResponseJSON struct {
- ID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixDelegationDeleteResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixDelegationDeleteResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingPrefixDelegationNewParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
- // IP Prefix in Classless Inter-Domain Routing format.
- Cidr param.Field[string] `json:"cidr,required"`
- // Account identifier for the account to which prefix is being delegated.
- DelegatedAccountID param.Field[string] `json:"delegated_account_id,required"`
-}
-
-func (r AddressingPrefixDelegationNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type AddressingPrefixDelegationNewResponseEnvelope struct {
- Errors []AddressingPrefixDelegationNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []AddressingPrefixDelegationNewResponseEnvelopeMessages `json:"messages,required"`
- Result AddressingPrefixDelegationNewResponse `json:"result,required"`
- // Whether the API call was successful
- Success AddressingPrefixDelegationNewResponseEnvelopeSuccess `json:"success,required"`
- JSON addressingPrefixDelegationNewResponseEnvelopeJSON `json:"-"`
-}
-
-// addressingPrefixDelegationNewResponseEnvelopeJSON contains the JSON metadata for
-// the struct [AddressingPrefixDelegationNewResponseEnvelope]
-type addressingPrefixDelegationNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixDelegationNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixDelegationNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingPrefixDelegationNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON addressingPrefixDelegationNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// addressingPrefixDelegationNewResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct [AddressingPrefixDelegationNewResponseEnvelopeErrors]
-type addressingPrefixDelegationNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixDelegationNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixDelegationNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingPrefixDelegationNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON addressingPrefixDelegationNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// addressingPrefixDelegationNewResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct [AddressingPrefixDelegationNewResponseEnvelopeMessages]
-type addressingPrefixDelegationNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixDelegationNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixDelegationNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type AddressingPrefixDelegationNewResponseEnvelopeSuccess bool
-
-const (
- AddressingPrefixDelegationNewResponseEnvelopeSuccessTrue AddressingPrefixDelegationNewResponseEnvelopeSuccess = true
-)
-
-type AddressingPrefixDelegationListParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type AddressingPrefixDelegationListResponseEnvelope struct {
- Errors []AddressingPrefixDelegationListResponseEnvelopeErrors `json:"errors,required"`
- Messages []AddressingPrefixDelegationListResponseEnvelopeMessages `json:"messages,required"`
- Result []AddressingPrefixDelegationListResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success AddressingPrefixDelegationListResponseEnvelopeSuccess `json:"success,required"`
- ResultInfo AddressingPrefixDelegationListResponseEnvelopeResultInfo `json:"result_info"`
- JSON addressingPrefixDelegationListResponseEnvelopeJSON `json:"-"`
-}
-
-// addressingPrefixDelegationListResponseEnvelopeJSON contains the JSON metadata
-// for the struct [AddressingPrefixDelegationListResponseEnvelope]
-type addressingPrefixDelegationListResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- ResultInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixDelegationListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixDelegationListResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingPrefixDelegationListResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON addressingPrefixDelegationListResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// addressingPrefixDelegationListResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct [AddressingPrefixDelegationListResponseEnvelopeErrors]
-type addressingPrefixDelegationListResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixDelegationListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixDelegationListResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingPrefixDelegationListResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON addressingPrefixDelegationListResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// addressingPrefixDelegationListResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct [AddressingPrefixDelegationListResponseEnvelopeMessages]
-type addressingPrefixDelegationListResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixDelegationListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixDelegationListResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type AddressingPrefixDelegationListResponseEnvelopeSuccess bool
-
-const (
- AddressingPrefixDelegationListResponseEnvelopeSuccessTrue AddressingPrefixDelegationListResponseEnvelopeSuccess = true
-)
-
-type AddressingPrefixDelegationListResponseEnvelopeResultInfo struct {
- // Total number of results for the requested service
- Count float64 `json:"count"`
- // Current page within paginated list of results
- Page float64 `json:"page"`
- // Number of results per page of results
- PerPage float64 `json:"per_page"`
- // Total results available without any search parameters
- TotalCount float64 `json:"total_count"`
- JSON addressingPrefixDelegationListResponseEnvelopeResultInfoJSON `json:"-"`
-}
-
-// addressingPrefixDelegationListResponseEnvelopeResultInfoJSON contains the JSON
-// metadata for the struct
-// [AddressingPrefixDelegationListResponseEnvelopeResultInfo]
-type addressingPrefixDelegationListResponseEnvelopeResultInfoJSON struct {
- Count apijson.Field
- Page apijson.Field
- PerPage apijson.Field
- TotalCount apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixDelegationListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixDelegationListResponseEnvelopeResultInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingPrefixDelegationDeleteParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type AddressingPrefixDelegationDeleteResponseEnvelope struct {
- Errors []AddressingPrefixDelegationDeleteResponseEnvelopeErrors `json:"errors,required"`
- Messages []AddressingPrefixDelegationDeleteResponseEnvelopeMessages `json:"messages,required"`
- Result AddressingPrefixDelegationDeleteResponse `json:"result,required"`
- // Whether the API call was successful
- Success AddressingPrefixDelegationDeleteResponseEnvelopeSuccess `json:"success,required"`
- JSON addressingPrefixDelegationDeleteResponseEnvelopeJSON `json:"-"`
-}
-
-// addressingPrefixDelegationDeleteResponseEnvelopeJSON contains the JSON metadata
-// for the struct [AddressingPrefixDelegationDeleteResponseEnvelope]
-type addressingPrefixDelegationDeleteResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixDelegationDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixDelegationDeleteResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingPrefixDelegationDeleteResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON addressingPrefixDelegationDeleteResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// addressingPrefixDelegationDeleteResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct [AddressingPrefixDelegationDeleteResponseEnvelopeErrors]
-type addressingPrefixDelegationDeleteResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixDelegationDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixDelegationDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingPrefixDelegationDeleteResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON addressingPrefixDelegationDeleteResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// addressingPrefixDelegationDeleteResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct
-// [AddressingPrefixDelegationDeleteResponseEnvelopeMessages]
-type addressingPrefixDelegationDeleteResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingPrefixDelegationDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingPrefixDelegationDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type AddressingPrefixDelegationDeleteResponseEnvelopeSuccess bool
-
-const (
- AddressingPrefixDelegationDeleteResponseEnvelopeSuccessTrue AddressingPrefixDelegationDeleteResponseEnvelopeSuccess = true
-)
diff --git a/addressingprefixdelegation_test.go b/addressingprefixdelegation_test.go
deleted file mode 100644
index 81793b79b65..00000000000
--- a/addressingprefixdelegation_test.go
+++ /dev/null
@@ -1,107 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestAddressingPrefixDelegationNew(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"),
- )
- _, err := client.Addressing.Prefixes.Delegations.New(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.AddressingPrefixDelegationNewParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Cidr: cloudflare.F("192.0.2.0/24"),
- DelegatedAccountID: cloudflare.F("b1946ac92492d2347c6235b4d2611184"),
- },
- )
- 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())
- }
-}
-
-func TestAddressingPrefixDelegationList(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"),
- )
- _, err := client.Addressing.Prefixes.Delegations.List(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.AddressingPrefixDelegationListParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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())
- }
-}
-
-func TestAddressingPrefixDelegationDelete(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"),
- )
- _, err := client.Addressing.Prefixes.Delegations.Delete(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- "d933b1530bc56c9953cf8ce166da8004",
- cloudflare.AddressingPrefixDelegationDeleteParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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/addressingservice.go b/addressingservice.go
deleted file mode 100644
index d99a20e7959..00000000000
--- a/addressingservice.go
+++ /dev/null
@@ -1,159 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// AddressingServiceService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewAddressingServiceService] method
-// instead.
-type AddressingServiceService struct {
- Options []option.RequestOption
-}
-
-// NewAddressingServiceService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewAddressingServiceService(opts ...option.RequestOption) (r *AddressingServiceService) {
- r = &AddressingServiceService{}
- r.Options = opts
- return
-}
-
-// Bring-Your-Own IP (BYOIP) prefixes onboarded to Cloudflare must be bound to a
-// service running on the Cloudflare network to enable a Cloudflare product on the
-// IP addresses. This endpoint can be used as a reference of available services on
-// the Cloudflare network, and their service IDs.
-func (r *AddressingServiceService) List(ctx context.Context, query AddressingServiceListParams, opts ...option.RequestOption) (res *[]AddressingServiceListResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env AddressingServiceListResponseEnvelope
- path := fmt.Sprintf("accounts/%s/addressing/services", query.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type AddressingServiceListResponse struct {
- // Identifier
- ID string `json:"id"`
- // Name of a service running on the Cloudflare network
- Name string `json:"name"`
- JSON addressingServiceListResponseJSON `json:"-"`
-}
-
-// addressingServiceListResponseJSON contains the JSON metadata for the struct
-// [AddressingServiceListResponse]
-type addressingServiceListResponseJSON struct {
- ID apijson.Field
- Name apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingServiceListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingServiceListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingServiceListParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type AddressingServiceListResponseEnvelope struct {
- Errors []AddressingServiceListResponseEnvelopeErrors `json:"errors,required"`
- Messages []AddressingServiceListResponseEnvelopeMessages `json:"messages,required"`
- Result []AddressingServiceListResponse `json:"result,required"`
- // Whether the API call was successful
- Success AddressingServiceListResponseEnvelopeSuccess `json:"success,required"`
- JSON addressingServiceListResponseEnvelopeJSON `json:"-"`
-}
-
-// addressingServiceListResponseEnvelopeJSON contains the JSON metadata for the
-// struct [AddressingServiceListResponseEnvelope]
-type addressingServiceListResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingServiceListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingServiceListResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingServiceListResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON addressingServiceListResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// addressingServiceListResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [AddressingServiceListResponseEnvelopeErrors]
-type addressingServiceListResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingServiceListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingServiceListResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type AddressingServiceListResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON addressingServiceListResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// addressingServiceListResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [AddressingServiceListResponseEnvelopeMessages]
-type addressingServiceListResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AddressingServiceListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r addressingServiceListResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type AddressingServiceListResponseEnvelopeSuccess bool
-
-const (
- AddressingServiceListResponseEnvelopeSuccessTrue AddressingServiceListResponseEnvelopeSuccess = true
-)
diff --git a/addressingservice_test.go b/addressingservice_test.go
deleted file mode 100644
index 0a6756bd4d3..00000000000
--- a/addressingservice_test.go
+++ /dev/null
@@ -1,40 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestAddressingServiceList(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"),
- )
- _, err := client.Addressing.Services.List(context.TODO(), cloudflare.AddressingServiceListParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- })
- 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/alerting.go b/alerting/alerting.go
similarity index 90%
rename from alerting.go
rename to alerting/alerting.go
index 797893e83c3..b52281c930e 100644
--- a/alerting.go
+++ b/alerting/alerting.go
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package cloudflare
+package alerting
import (
"github.com/cloudflare/cloudflare-go/option"
@@ -12,7 +12,7 @@ import (
// service directly, and instead use the [NewAlertingService] method instead.
type AlertingService struct {
Options []option.RequestOption
- V3 *AlertingV3Service
+ V3 *V3Service
}
// NewAlertingService generates a new service that applies the given options to
@@ -21,6 +21,6 @@ type AlertingService struct {
func NewAlertingService(opts ...option.RequestOption) (r *AlertingService) {
r = &AlertingService{}
r.Options = opts
- r.V3 = NewAlertingV3Service(opts...)
+ r.V3 = NewV3Service(opts...)
return
}
diff --git a/alerting/aliases.go b/alerting/aliases.go
new file mode 100644
index 00000000000..f48faf077eb
--- /dev/null
+++ b/alerting/aliases.go
@@ -0,0 +1,9 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package alerting
+
+import (
+ "github.com/cloudflare/cloudflare-go/internal/apierror"
+)
+
+type Error = apierror.Error
diff --git a/alerting/v3.go b/alerting/v3.go
new file mode 100644
index 00000000000..d0d7c72cd43
--- /dev/null
+++ b/alerting/v3.go
@@ -0,0 +1,197 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package alerting
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "reflect"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/tidwall/gjson"
+)
+
+// V3Service contains methods and other services that help with interacting with
+// the cloudflare API. Note, unlike clients, this service does not read variables
+// from the environment automatically. You should not instantiate this service
+// directly, and instead use the [NewV3Service] method instead.
+type V3Service struct {
+ Options []option.RequestOption
+ Destinations *V3DestinationService
+ Histories *V3HistoryService
+ Policies *V3PolicyService
+}
+
+// NewV3Service generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewV3Service(opts ...option.RequestOption) (r *V3Service) {
+ r = &V3Service{}
+ r.Options = opts
+ r.Destinations = NewV3DestinationService(opts...)
+ r.Histories = NewV3HistoryService(opts...)
+ r.Policies = NewV3PolicyService(opts...)
+ return
+}
+
+// Gets a list of all alert types for which an account is eligible.
+func (r *V3Service) List(ctx context.Context, query V3ListParams, opts ...option.RequestOption) (res *V3ListResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env V3ListResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/alerting/v3/available_alerts", query.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Union satisfied by [alerting.V3ListResponseUnknown],
+// [alerting.V3ListResponseArray] or [shared.UnionString].
+type V3ListResponse interface {
+ ImplementsAlertingV3ListResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*V3ListResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(V3ListResponseArray{}),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+type V3ListResponseArray []interface{}
+
+func (r V3ListResponseArray) ImplementsAlertingV3ListResponse() {}
+
+type V3ListParams struct {
+ // The account id
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type V3ListResponseEnvelope struct {
+ Errors []V3ListResponseEnvelopeErrors `json:"errors,required"`
+ Messages []V3ListResponseEnvelopeMessages `json:"messages,required"`
+ Result V3ListResponse `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success V3ListResponseEnvelopeSuccess `json:"success,required"`
+ ResultInfo V3ListResponseEnvelopeResultInfo `json:"result_info"`
+ JSON v3ListResponseEnvelopeJSON `json:"-"`
+}
+
+// v3ListResponseEnvelopeJSON contains the JSON metadata for the struct
+// [V3ListResponseEnvelope]
+type v3ListResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ ResultInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V3ListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v3ListResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type V3ListResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON v3ListResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// v3ListResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [V3ListResponseEnvelopeErrors]
+type v3ListResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V3ListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v3ListResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type V3ListResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON v3ListResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// v3ListResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [V3ListResponseEnvelopeMessages]
+type v3ListResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V3ListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v3ListResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type V3ListResponseEnvelopeSuccess bool
+
+const (
+ V3ListResponseEnvelopeSuccessTrue V3ListResponseEnvelopeSuccess = true
+)
+
+type V3ListResponseEnvelopeResultInfo struct {
+ // Total number of results for the requested service
+ Count float64 `json:"count"`
+ // Current page within paginated list of results
+ Page float64 `json:"page"`
+ // Number of results per page of results
+ PerPage float64 `json:"per_page"`
+ // Total results available without any search parameters
+ TotalCount float64 `json:"total_count"`
+ JSON v3ListResponseEnvelopeResultInfoJSON `json:"-"`
+}
+
+// v3ListResponseEnvelopeResultInfoJSON contains the JSON metadata for the struct
+// [V3ListResponseEnvelopeResultInfo]
+type v3ListResponseEnvelopeResultInfoJSON struct {
+ Count apijson.Field
+ Page apijson.Field
+ PerPage apijson.Field
+ TotalCount apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V3ListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v3ListResponseEnvelopeResultInfoJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/alerting/v3_test.go b/alerting/v3_test.go
new file mode 100644
index 00000000000..3b5ee639db2
--- /dev/null
+++ b/alerting/v3_test.go
@@ -0,0 +1,41 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package alerting_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/alerting"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestV3List(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"),
+ )
+ _, err := client.Alerting.V3.List(context.TODO(), alerting.V3ListParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ })
+ 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/alerting/v3destination.go b/alerting/v3destination.go
new file mode 100644
index 00000000000..3541a59f431
--- /dev/null
+++ b/alerting/v3destination.go
@@ -0,0 +1,31 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package alerting
+
+import (
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// V3DestinationService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewV3DestinationService] method
+// instead.
+type V3DestinationService struct {
+ Options []option.RequestOption
+ Eligible *V3DestinationEligibleService
+ Pagerduty *V3DestinationPagerdutyService
+ Webhooks *V3DestinationWebhookService
+}
+
+// NewV3DestinationService generates a new service that applies the given options
+// to each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewV3DestinationService(opts ...option.RequestOption) (r *V3DestinationService) {
+ r = &V3DestinationService{}
+ r.Options = opts
+ r.Eligible = NewV3DestinationEligibleService(opts...)
+ r.Pagerduty = NewV3DestinationPagerdutyService(opts...)
+ r.Webhooks = NewV3DestinationWebhookService(opts...)
+ return
+}
diff --git a/alerting/v3destinationeligible.go b/alerting/v3destinationeligible.go
new file mode 100644
index 00000000000..193352f8cee
--- /dev/null
+++ b/alerting/v3destinationeligible.go
@@ -0,0 +1,192 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package alerting
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "reflect"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/tidwall/gjson"
+)
+
+// V3DestinationEligibleService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewV3DestinationEligibleService]
+// method instead.
+type V3DestinationEligibleService struct {
+ Options []option.RequestOption
+}
+
+// NewV3DestinationEligibleService generates a new service that applies the given
+// options to each request. These options are applied after the parent client's
+// options (if there is one), and before any request-specific options.
+func NewV3DestinationEligibleService(opts ...option.RequestOption) (r *V3DestinationEligibleService) {
+ r = &V3DestinationEligibleService{}
+ r.Options = opts
+ return
+}
+
+// Get a list of all delivery mechanism types for which an account is eligible.
+func (r *V3DestinationEligibleService) Get(ctx context.Context, query V3DestinationEligibleGetParams, opts ...option.RequestOption) (res *V3DestinationEligibleGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env V3DestinationEligibleGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/alerting/v3/destinations/eligible", query.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Union satisfied by [alerting.V3DestinationEligibleGetResponseUnknown],
+// [alerting.V3DestinationEligibleGetResponseArray] or [shared.UnionString].
+type V3DestinationEligibleGetResponse interface {
+ ImplementsAlertingV3DestinationEligibleGetResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*V3DestinationEligibleGetResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(V3DestinationEligibleGetResponseArray{}),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+type V3DestinationEligibleGetResponseArray []interface{}
+
+func (r V3DestinationEligibleGetResponseArray) ImplementsAlertingV3DestinationEligibleGetResponse() {}
+
+type V3DestinationEligibleGetParams struct {
+ // The account id
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type V3DestinationEligibleGetResponseEnvelope struct {
+ Errors []V3DestinationEligibleGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []V3DestinationEligibleGetResponseEnvelopeMessages `json:"messages,required"`
+ Result V3DestinationEligibleGetResponse `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success V3DestinationEligibleGetResponseEnvelopeSuccess `json:"success,required"`
+ ResultInfo V3DestinationEligibleGetResponseEnvelopeResultInfo `json:"result_info"`
+ JSON v3DestinationEligibleGetResponseEnvelopeJSON `json:"-"`
+}
+
+// v3DestinationEligibleGetResponseEnvelopeJSON contains the JSON metadata for the
+// struct [V3DestinationEligibleGetResponseEnvelope]
+type v3DestinationEligibleGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ ResultInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V3DestinationEligibleGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v3DestinationEligibleGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type V3DestinationEligibleGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON v3DestinationEligibleGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// v3DestinationEligibleGetResponseEnvelopeErrorsJSON contains the JSON metadata
+// for the struct [V3DestinationEligibleGetResponseEnvelopeErrors]
+type v3DestinationEligibleGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V3DestinationEligibleGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v3DestinationEligibleGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type V3DestinationEligibleGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON v3DestinationEligibleGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// v3DestinationEligibleGetResponseEnvelopeMessagesJSON contains the JSON metadata
+// for the struct [V3DestinationEligibleGetResponseEnvelopeMessages]
+type v3DestinationEligibleGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V3DestinationEligibleGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v3DestinationEligibleGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type V3DestinationEligibleGetResponseEnvelopeSuccess bool
+
+const (
+ V3DestinationEligibleGetResponseEnvelopeSuccessTrue V3DestinationEligibleGetResponseEnvelopeSuccess = true
+)
+
+type V3DestinationEligibleGetResponseEnvelopeResultInfo struct {
+ // Total number of results for the requested service
+ Count float64 `json:"count"`
+ // Current page within paginated list of results
+ Page float64 `json:"page"`
+ // Number of results per page of results
+ PerPage float64 `json:"per_page"`
+ // Total results available without any search parameters
+ TotalCount float64 `json:"total_count"`
+ JSON v3DestinationEligibleGetResponseEnvelopeResultInfoJSON `json:"-"`
+}
+
+// v3DestinationEligibleGetResponseEnvelopeResultInfoJSON contains the JSON
+// metadata for the struct [V3DestinationEligibleGetResponseEnvelopeResultInfo]
+type v3DestinationEligibleGetResponseEnvelopeResultInfoJSON struct {
+ Count apijson.Field
+ Page apijson.Field
+ PerPage apijson.Field
+ TotalCount apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V3DestinationEligibleGetResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v3DestinationEligibleGetResponseEnvelopeResultInfoJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/alerting/v3destinationeligible_test.go b/alerting/v3destinationeligible_test.go
new file mode 100644
index 00000000000..1d41c7d3e44
--- /dev/null
+++ b/alerting/v3destinationeligible_test.go
@@ -0,0 +1,41 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package alerting_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/alerting"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestV3DestinationEligibleGet(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"),
+ )
+ _, err := client.Alerting.V3.Destinations.Eligible.Get(context.TODO(), alerting.V3DestinationEligibleGetParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ })
+ 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/alerting/v3destinationpagerduty.go b/alerting/v3destinationpagerduty.go
new file mode 100644
index 00000000000..5744cf8dc23
--- /dev/null
+++ b/alerting/v3destinationpagerduty.go
@@ -0,0 +1,591 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package alerting
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "reflect"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/tidwall/gjson"
+)
+
+// V3DestinationPagerdutyService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewV3DestinationPagerdutyService]
+// method instead.
+type V3DestinationPagerdutyService struct {
+ Options []option.RequestOption
+}
+
+// NewV3DestinationPagerdutyService generates a new service that applies the given
+// options to each request. These options are applied after the parent client's
+// options (if there is one), and before any request-specific options.
+func NewV3DestinationPagerdutyService(opts ...option.RequestOption) (r *V3DestinationPagerdutyService) {
+ r = &V3DestinationPagerdutyService{}
+ r.Options = opts
+ return
+}
+
+// Creates a new token for integrating with PagerDuty.
+func (r *V3DestinationPagerdutyService) New(ctx context.Context, body V3DestinationPagerdutyNewParams, opts ...option.RequestOption) (res *V3DestinationPagerdutyNewResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env V3DestinationPagerdutyNewResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/alerting/v3/destinations/pagerduty/connect", body.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Deletes all the PagerDuty Services connected to the account.
+func (r *V3DestinationPagerdutyService) Delete(ctx context.Context, body V3DestinationPagerdutyDeleteParams, opts ...option.RequestOption) (res *V3DestinationPagerdutyDeleteResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env V3DestinationPagerdutyDeleteResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/alerting/v3/destinations/pagerduty", body.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Get a list of all configured PagerDuty services.
+func (r *V3DestinationPagerdutyService) Get(ctx context.Context, query V3DestinationPagerdutyGetParams, opts ...option.RequestOption) (res *[]AaaPagerduty, err error) {
+ opts = append(r.Options[:], opts...)
+ var env V3DestinationPagerdutyGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/alerting/v3/destinations/pagerduty", query.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Links PagerDuty with the account using the integration token.
+func (r *V3DestinationPagerdutyService) Link(ctx context.Context, tokenID string, query V3DestinationPagerdutyLinkParams, opts ...option.RequestOption) (res *V3DestinationPagerdutyLinkResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env V3DestinationPagerdutyLinkResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/alerting/v3/destinations/pagerduty/connect/%s", query.AccountID, tokenID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type AaaPagerduty struct {
+ // UUID
+ ID string `json:"id"`
+ // The name of the pagerduty service.
+ Name string `json:"name"`
+ JSON aaaPagerdutyJSON `json:"-"`
+}
+
+// aaaPagerdutyJSON contains the JSON metadata for the struct [AaaPagerduty]
+type aaaPagerdutyJSON struct {
+ ID apijson.Field
+ Name apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AaaPagerduty) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r aaaPagerdutyJSON) RawJSON() string {
+ return r.raw
+}
+
+type V3DestinationPagerdutyNewResponse struct {
+ // UUID
+ ID string `json:"id"`
+ JSON v3DestinationPagerdutyNewResponseJSON `json:"-"`
+}
+
+// v3DestinationPagerdutyNewResponseJSON contains the JSON metadata for the struct
+// [V3DestinationPagerdutyNewResponse]
+type v3DestinationPagerdutyNewResponseJSON struct {
+ ID apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V3DestinationPagerdutyNewResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v3DestinationPagerdutyNewResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+// Union satisfied by [alerting.V3DestinationPagerdutyDeleteResponseUnknown],
+// [alerting.V3DestinationPagerdutyDeleteResponseArray] or [shared.UnionString].
+type V3DestinationPagerdutyDeleteResponse interface {
+ ImplementsAlertingV3DestinationPagerdutyDeleteResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*V3DestinationPagerdutyDeleteResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(V3DestinationPagerdutyDeleteResponseArray{}),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+type V3DestinationPagerdutyDeleteResponseArray []interface{}
+
+func (r V3DestinationPagerdutyDeleteResponseArray) ImplementsAlertingV3DestinationPagerdutyDeleteResponse() {
+}
+
+type V3DestinationPagerdutyLinkResponse struct {
+ // UUID
+ ID string `json:"id"`
+ JSON v3DestinationPagerdutyLinkResponseJSON `json:"-"`
+}
+
+// v3DestinationPagerdutyLinkResponseJSON contains the JSON metadata for the struct
+// [V3DestinationPagerdutyLinkResponse]
+type v3DestinationPagerdutyLinkResponseJSON struct {
+ ID apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V3DestinationPagerdutyLinkResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v3DestinationPagerdutyLinkResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type V3DestinationPagerdutyNewParams struct {
+ // The account id
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type V3DestinationPagerdutyNewResponseEnvelope struct {
+ Errors []V3DestinationPagerdutyNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []V3DestinationPagerdutyNewResponseEnvelopeMessages `json:"messages,required"`
+ Result V3DestinationPagerdutyNewResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success V3DestinationPagerdutyNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON v3DestinationPagerdutyNewResponseEnvelopeJSON `json:"-"`
+}
+
+// v3DestinationPagerdutyNewResponseEnvelopeJSON contains the JSON metadata for the
+// struct [V3DestinationPagerdutyNewResponseEnvelope]
+type v3DestinationPagerdutyNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V3DestinationPagerdutyNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v3DestinationPagerdutyNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type V3DestinationPagerdutyNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON v3DestinationPagerdutyNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// v3DestinationPagerdutyNewResponseEnvelopeErrorsJSON contains the JSON metadata
+// for the struct [V3DestinationPagerdutyNewResponseEnvelopeErrors]
+type v3DestinationPagerdutyNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V3DestinationPagerdutyNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v3DestinationPagerdutyNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type V3DestinationPagerdutyNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON v3DestinationPagerdutyNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// v3DestinationPagerdutyNewResponseEnvelopeMessagesJSON contains the JSON metadata
+// for the struct [V3DestinationPagerdutyNewResponseEnvelopeMessages]
+type v3DestinationPagerdutyNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V3DestinationPagerdutyNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v3DestinationPagerdutyNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type V3DestinationPagerdutyNewResponseEnvelopeSuccess bool
+
+const (
+ V3DestinationPagerdutyNewResponseEnvelopeSuccessTrue V3DestinationPagerdutyNewResponseEnvelopeSuccess = true
+)
+
+type V3DestinationPagerdutyDeleteParams struct {
+ // The account id
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type V3DestinationPagerdutyDeleteResponseEnvelope struct {
+ Errors []V3DestinationPagerdutyDeleteResponseEnvelopeErrors `json:"errors,required"`
+ Messages []V3DestinationPagerdutyDeleteResponseEnvelopeMessages `json:"messages,required"`
+ Result V3DestinationPagerdutyDeleteResponse `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success V3DestinationPagerdutyDeleteResponseEnvelopeSuccess `json:"success,required"`
+ ResultInfo V3DestinationPagerdutyDeleteResponseEnvelopeResultInfo `json:"result_info"`
+ JSON v3DestinationPagerdutyDeleteResponseEnvelopeJSON `json:"-"`
+}
+
+// v3DestinationPagerdutyDeleteResponseEnvelopeJSON contains the JSON metadata for
+// the struct [V3DestinationPagerdutyDeleteResponseEnvelope]
+type v3DestinationPagerdutyDeleteResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ ResultInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V3DestinationPagerdutyDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v3DestinationPagerdutyDeleteResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type V3DestinationPagerdutyDeleteResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON v3DestinationPagerdutyDeleteResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// v3DestinationPagerdutyDeleteResponseEnvelopeErrorsJSON contains the JSON
+// metadata for the struct [V3DestinationPagerdutyDeleteResponseEnvelopeErrors]
+type v3DestinationPagerdutyDeleteResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V3DestinationPagerdutyDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v3DestinationPagerdutyDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type V3DestinationPagerdutyDeleteResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON v3DestinationPagerdutyDeleteResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// v3DestinationPagerdutyDeleteResponseEnvelopeMessagesJSON contains the JSON
+// metadata for the struct [V3DestinationPagerdutyDeleteResponseEnvelopeMessages]
+type v3DestinationPagerdutyDeleteResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V3DestinationPagerdutyDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v3DestinationPagerdutyDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type V3DestinationPagerdutyDeleteResponseEnvelopeSuccess bool
+
+const (
+ V3DestinationPagerdutyDeleteResponseEnvelopeSuccessTrue V3DestinationPagerdutyDeleteResponseEnvelopeSuccess = true
+)
+
+type V3DestinationPagerdutyDeleteResponseEnvelopeResultInfo struct {
+ // Total number of results for the requested service
+ Count float64 `json:"count"`
+ // Current page within paginated list of results
+ Page float64 `json:"page"`
+ // Number of results per page of results
+ PerPage float64 `json:"per_page"`
+ // Total results available without any search parameters
+ TotalCount float64 `json:"total_count"`
+ JSON v3DestinationPagerdutyDeleteResponseEnvelopeResultInfoJSON `json:"-"`
+}
+
+// v3DestinationPagerdutyDeleteResponseEnvelopeResultInfoJSON contains the JSON
+// metadata for the struct [V3DestinationPagerdutyDeleteResponseEnvelopeResultInfo]
+type v3DestinationPagerdutyDeleteResponseEnvelopeResultInfoJSON struct {
+ Count apijson.Field
+ Page apijson.Field
+ PerPage apijson.Field
+ TotalCount apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V3DestinationPagerdutyDeleteResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v3DestinationPagerdutyDeleteResponseEnvelopeResultInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type V3DestinationPagerdutyGetParams struct {
+ // The account id
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type V3DestinationPagerdutyGetResponseEnvelope struct {
+ Errors []V3DestinationPagerdutyGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []V3DestinationPagerdutyGetResponseEnvelopeMessages `json:"messages,required"`
+ Result []AaaPagerduty `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success V3DestinationPagerdutyGetResponseEnvelopeSuccess `json:"success,required"`
+ ResultInfo V3DestinationPagerdutyGetResponseEnvelopeResultInfo `json:"result_info"`
+ JSON v3DestinationPagerdutyGetResponseEnvelopeJSON `json:"-"`
+}
+
+// v3DestinationPagerdutyGetResponseEnvelopeJSON contains the JSON metadata for the
+// struct [V3DestinationPagerdutyGetResponseEnvelope]
+type v3DestinationPagerdutyGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ ResultInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V3DestinationPagerdutyGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v3DestinationPagerdutyGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type V3DestinationPagerdutyGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON v3DestinationPagerdutyGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// v3DestinationPagerdutyGetResponseEnvelopeErrorsJSON contains the JSON metadata
+// for the struct [V3DestinationPagerdutyGetResponseEnvelopeErrors]
+type v3DestinationPagerdutyGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V3DestinationPagerdutyGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v3DestinationPagerdutyGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type V3DestinationPagerdutyGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON v3DestinationPagerdutyGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// v3DestinationPagerdutyGetResponseEnvelopeMessagesJSON contains the JSON metadata
+// for the struct [V3DestinationPagerdutyGetResponseEnvelopeMessages]
+type v3DestinationPagerdutyGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V3DestinationPagerdutyGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v3DestinationPagerdutyGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type V3DestinationPagerdutyGetResponseEnvelopeSuccess bool
+
+const (
+ V3DestinationPagerdutyGetResponseEnvelopeSuccessTrue V3DestinationPagerdutyGetResponseEnvelopeSuccess = true
+)
+
+type V3DestinationPagerdutyGetResponseEnvelopeResultInfo struct {
+ // Total number of results for the requested service
+ Count float64 `json:"count"`
+ // Current page within paginated list of results
+ Page float64 `json:"page"`
+ // Number of results per page of results
+ PerPage float64 `json:"per_page"`
+ // Total results available without any search parameters
+ TotalCount float64 `json:"total_count"`
+ JSON v3DestinationPagerdutyGetResponseEnvelopeResultInfoJSON `json:"-"`
+}
+
+// v3DestinationPagerdutyGetResponseEnvelopeResultInfoJSON contains the JSON
+// metadata for the struct [V3DestinationPagerdutyGetResponseEnvelopeResultInfo]
+type v3DestinationPagerdutyGetResponseEnvelopeResultInfoJSON struct {
+ Count apijson.Field
+ Page apijson.Field
+ PerPage apijson.Field
+ TotalCount apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V3DestinationPagerdutyGetResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v3DestinationPagerdutyGetResponseEnvelopeResultInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type V3DestinationPagerdutyLinkParams struct {
+ // The account id
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type V3DestinationPagerdutyLinkResponseEnvelope struct {
+ Errors []V3DestinationPagerdutyLinkResponseEnvelopeErrors `json:"errors,required"`
+ Messages []V3DestinationPagerdutyLinkResponseEnvelopeMessages `json:"messages,required"`
+ Result V3DestinationPagerdutyLinkResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success V3DestinationPagerdutyLinkResponseEnvelopeSuccess `json:"success,required"`
+ JSON v3DestinationPagerdutyLinkResponseEnvelopeJSON `json:"-"`
+}
+
+// v3DestinationPagerdutyLinkResponseEnvelopeJSON contains the JSON metadata for
+// the struct [V3DestinationPagerdutyLinkResponseEnvelope]
+type v3DestinationPagerdutyLinkResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V3DestinationPagerdutyLinkResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v3DestinationPagerdutyLinkResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type V3DestinationPagerdutyLinkResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON v3DestinationPagerdutyLinkResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// v3DestinationPagerdutyLinkResponseEnvelopeErrorsJSON contains the JSON metadata
+// for the struct [V3DestinationPagerdutyLinkResponseEnvelopeErrors]
+type v3DestinationPagerdutyLinkResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V3DestinationPagerdutyLinkResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v3DestinationPagerdutyLinkResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type V3DestinationPagerdutyLinkResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON v3DestinationPagerdutyLinkResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// v3DestinationPagerdutyLinkResponseEnvelopeMessagesJSON contains the JSON
+// metadata for the struct [V3DestinationPagerdutyLinkResponseEnvelopeMessages]
+type v3DestinationPagerdutyLinkResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V3DestinationPagerdutyLinkResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v3DestinationPagerdutyLinkResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type V3DestinationPagerdutyLinkResponseEnvelopeSuccess bool
+
+const (
+ V3DestinationPagerdutyLinkResponseEnvelopeSuccessTrue V3DestinationPagerdutyLinkResponseEnvelopeSuccess = true
+)
diff --git a/alerting/v3destinationpagerduty_test.go b/alerting/v3destinationpagerduty_test.go
new file mode 100644
index 00000000000..31c73015771
--- /dev/null
+++ b/alerting/v3destinationpagerduty_test.go
@@ -0,0 +1,123 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package alerting_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/alerting"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestV3DestinationPagerdutyNew(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"),
+ )
+ _, err := client.Alerting.V3.Destinations.Pagerduty.New(context.TODO(), alerting.V3DestinationPagerdutyNewParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ })
+ 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())
+ }
+}
+
+func TestV3DestinationPagerdutyDelete(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"),
+ )
+ _, err := client.Alerting.V3.Destinations.Pagerduty.Delete(context.TODO(), alerting.V3DestinationPagerdutyDeleteParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ })
+ 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())
+ }
+}
+
+func TestV3DestinationPagerdutyGet(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"),
+ )
+ _, err := client.Alerting.V3.Destinations.Pagerduty.Get(context.TODO(), alerting.V3DestinationPagerdutyGetParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ })
+ 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())
+ }
+}
+
+func TestV3DestinationPagerdutyLink(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"),
+ )
+ _, err := client.Alerting.V3.Destinations.Pagerduty.Link(
+ context.TODO(),
+ "8c71e667571b4f61b94d9e4b12158038",
+ alerting.V3DestinationPagerdutyLinkParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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/alerting/v3destinationwebhook.go b/alerting/v3destinationwebhook.go
new file mode 100644
index 00000000000..9bfe5d9ac98
--- /dev/null
+++ b/alerting/v3destinationwebhook.go
@@ -0,0 +1,749 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package alerting
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "reflect"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/tidwall/gjson"
+)
+
+// V3DestinationWebhookService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewV3DestinationWebhookService]
+// method instead.
+type V3DestinationWebhookService struct {
+ Options []option.RequestOption
+}
+
+// NewV3DestinationWebhookService generates a new service that applies the given
+// options to each request. These options are applied after the parent client's
+// options (if there is one), and before any request-specific options.
+func NewV3DestinationWebhookService(opts ...option.RequestOption) (r *V3DestinationWebhookService) {
+ r = &V3DestinationWebhookService{}
+ r.Options = opts
+ return
+}
+
+// Creates a new webhook destination.
+func (r *V3DestinationWebhookService) New(ctx context.Context, params V3DestinationWebhookNewParams, opts ...option.RequestOption) (res *V3DestinationWebhookNewResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env V3DestinationWebhookNewResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/alerting/v3/destinations/webhooks", params.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Update a webhook destination.
+func (r *V3DestinationWebhookService) Update(ctx context.Context, webhookID string, params V3DestinationWebhookUpdateParams, opts ...option.RequestOption) (res *V3DestinationWebhookUpdateResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env V3DestinationWebhookUpdateResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/alerting/v3/destinations/webhooks/%s", params.AccountID, webhookID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Gets a list of all configured webhook destinations.
+func (r *V3DestinationWebhookService) List(ctx context.Context, query V3DestinationWebhookListParams, opts ...option.RequestOption) (res *[]AaaWebhooks, err error) {
+ opts = append(r.Options[:], opts...)
+ var env V3DestinationWebhookListResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/alerting/v3/destinations/webhooks", query.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Delete a configured webhook destination.
+func (r *V3DestinationWebhookService) Delete(ctx context.Context, webhookID string, body V3DestinationWebhookDeleteParams, opts ...option.RequestOption) (res *V3DestinationWebhookDeleteResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env V3DestinationWebhookDeleteResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/alerting/v3/destinations/webhooks/%s", body.AccountID, webhookID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Get details for a single webhooks destination.
+func (r *V3DestinationWebhookService) Get(ctx context.Context, webhookID string, query V3DestinationWebhookGetParams, opts ...option.RequestOption) (res *AaaWebhooks, err error) {
+ opts = append(r.Options[:], opts...)
+ var env V3DestinationWebhookGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/alerting/v3/destinations/webhooks/%s", query.AccountID, webhookID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type AaaWebhooks struct {
+ // The unique identifier of a webhook
+ ID string `json:"id"`
+ // Timestamp of when the webhook destination was created.
+ CreatedAt time.Time `json:"created_at" format:"date-time"`
+ // Timestamp of the last time an attempt to dispatch a notification to this webhook
+ // failed.
+ LastFailure time.Time `json:"last_failure" format:"date-time"`
+ // Timestamp of the last time Cloudflare was able to successfully dispatch a
+ // notification using this webhook.
+ LastSuccess time.Time `json:"last_success" format:"date-time"`
+ // The name of the webhook destination. This will be included in the request body
+ // when you receive a webhook notification.
+ Name string `json:"name"`
+ // Optional secret that will be passed in the `cf-webhook-auth` header when
+ // dispatching generic webhook notifications or formatted for supported
+ // destinations. Secrets are not returned in any API response body.
+ Secret string `json:"secret"`
+ // Type of webhook endpoint.
+ Type AaaWebhooksType `json:"type"`
+ // The POST endpoint to call when dispatching a notification.
+ URL string `json:"url"`
+ JSON aaaWebhooksJSON `json:"-"`
+}
+
+// aaaWebhooksJSON contains the JSON metadata for the struct [AaaWebhooks]
+type aaaWebhooksJSON struct {
+ ID apijson.Field
+ CreatedAt apijson.Field
+ LastFailure apijson.Field
+ LastSuccess apijson.Field
+ Name apijson.Field
+ Secret apijson.Field
+ Type apijson.Field
+ URL apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AaaWebhooks) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r aaaWebhooksJSON) RawJSON() string {
+ return r.raw
+}
+
+// Type of webhook endpoint.
+type AaaWebhooksType string
+
+const (
+ AaaWebhooksTypeSlack AaaWebhooksType = "slack"
+ AaaWebhooksTypeGeneric AaaWebhooksType = "generic"
+ AaaWebhooksTypeGchat AaaWebhooksType = "gchat"
+)
+
+type V3DestinationWebhookNewResponse struct {
+ // UUID
+ ID string `json:"id"`
+ JSON v3DestinationWebhookNewResponseJSON `json:"-"`
+}
+
+// v3DestinationWebhookNewResponseJSON contains the JSON metadata for the struct
+// [V3DestinationWebhookNewResponse]
+type v3DestinationWebhookNewResponseJSON struct {
+ ID apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V3DestinationWebhookNewResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v3DestinationWebhookNewResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type V3DestinationWebhookUpdateResponse struct {
+ // UUID
+ ID string `json:"id"`
+ JSON v3DestinationWebhookUpdateResponseJSON `json:"-"`
+}
+
+// v3DestinationWebhookUpdateResponseJSON contains the JSON metadata for the struct
+// [V3DestinationWebhookUpdateResponse]
+type v3DestinationWebhookUpdateResponseJSON struct {
+ ID apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V3DestinationWebhookUpdateResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v3DestinationWebhookUpdateResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+// Union satisfied by [alerting.V3DestinationWebhookDeleteResponseUnknown],
+// [alerting.V3DestinationWebhookDeleteResponseArray] or [shared.UnionString].
+type V3DestinationWebhookDeleteResponse interface {
+ ImplementsAlertingV3DestinationWebhookDeleteResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*V3DestinationWebhookDeleteResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(V3DestinationWebhookDeleteResponseArray{}),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+type V3DestinationWebhookDeleteResponseArray []interface{}
+
+func (r V3DestinationWebhookDeleteResponseArray) ImplementsAlertingV3DestinationWebhookDeleteResponse() {
+}
+
+type V3DestinationWebhookNewParams struct {
+ // The account id
+ AccountID param.Field[string] `path:"account_id,required"`
+ // The name of the webhook destination. This will be included in the request body
+ // when you receive a webhook notification.
+ Name param.Field[string] `json:"name,required"`
+ // The POST endpoint to call when dispatching a notification.
+ URL param.Field[string] `json:"url,required"`
+ // Optional secret that will be passed in the `cf-webhook-auth` header when
+ // dispatching generic webhook notifications or formatted for supported
+ // destinations. Secrets are not returned in any API response body.
+ Secret param.Field[string] `json:"secret"`
+}
+
+func (r V3DestinationWebhookNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type V3DestinationWebhookNewResponseEnvelope struct {
+ Errors []V3DestinationWebhookNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []V3DestinationWebhookNewResponseEnvelopeMessages `json:"messages,required"`
+ Result V3DestinationWebhookNewResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success V3DestinationWebhookNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON v3DestinationWebhookNewResponseEnvelopeJSON `json:"-"`
+}
+
+// v3DestinationWebhookNewResponseEnvelopeJSON contains the JSON metadata for the
+// struct [V3DestinationWebhookNewResponseEnvelope]
+type v3DestinationWebhookNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V3DestinationWebhookNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v3DestinationWebhookNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type V3DestinationWebhookNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON v3DestinationWebhookNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// v3DestinationWebhookNewResponseEnvelopeErrorsJSON contains the JSON metadata for
+// the struct [V3DestinationWebhookNewResponseEnvelopeErrors]
+type v3DestinationWebhookNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V3DestinationWebhookNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v3DestinationWebhookNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type V3DestinationWebhookNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON v3DestinationWebhookNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// v3DestinationWebhookNewResponseEnvelopeMessagesJSON contains the JSON metadata
+// for the struct [V3DestinationWebhookNewResponseEnvelopeMessages]
+type v3DestinationWebhookNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V3DestinationWebhookNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v3DestinationWebhookNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type V3DestinationWebhookNewResponseEnvelopeSuccess bool
+
+const (
+ V3DestinationWebhookNewResponseEnvelopeSuccessTrue V3DestinationWebhookNewResponseEnvelopeSuccess = true
+)
+
+type V3DestinationWebhookUpdateParams struct {
+ // The account id
+ AccountID param.Field[string] `path:"account_id,required"`
+ // The name of the webhook destination. This will be included in the request body
+ // when you receive a webhook notification.
+ Name param.Field[string] `json:"name,required"`
+ // The POST endpoint to call when dispatching a notification.
+ URL param.Field[string] `json:"url,required"`
+ // Optional secret that will be passed in the `cf-webhook-auth` header when
+ // dispatching generic webhook notifications or formatted for supported
+ // destinations. Secrets are not returned in any API response body.
+ Secret param.Field[string] `json:"secret"`
+}
+
+func (r V3DestinationWebhookUpdateParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type V3DestinationWebhookUpdateResponseEnvelope struct {
+ Errors []V3DestinationWebhookUpdateResponseEnvelopeErrors `json:"errors,required"`
+ Messages []V3DestinationWebhookUpdateResponseEnvelopeMessages `json:"messages,required"`
+ Result V3DestinationWebhookUpdateResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success V3DestinationWebhookUpdateResponseEnvelopeSuccess `json:"success,required"`
+ JSON v3DestinationWebhookUpdateResponseEnvelopeJSON `json:"-"`
+}
+
+// v3DestinationWebhookUpdateResponseEnvelopeJSON contains the JSON metadata for
+// the struct [V3DestinationWebhookUpdateResponseEnvelope]
+type v3DestinationWebhookUpdateResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V3DestinationWebhookUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v3DestinationWebhookUpdateResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type V3DestinationWebhookUpdateResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON v3DestinationWebhookUpdateResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// v3DestinationWebhookUpdateResponseEnvelopeErrorsJSON contains the JSON metadata
+// for the struct [V3DestinationWebhookUpdateResponseEnvelopeErrors]
+type v3DestinationWebhookUpdateResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V3DestinationWebhookUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v3DestinationWebhookUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type V3DestinationWebhookUpdateResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON v3DestinationWebhookUpdateResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// v3DestinationWebhookUpdateResponseEnvelopeMessagesJSON contains the JSON
+// metadata for the struct [V3DestinationWebhookUpdateResponseEnvelopeMessages]
+type v3DestinationWebhookUpdateResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V3DestinationWebhookUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v3DestinationWebhookUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type V3DestinationWebhookUpdateResponseEnvelopeSuccess bool
+
+const (
+ V3DestinationWebhookUpdateResponseEnvelopeSuccessTrue V3DestinationWebhookUpdateResponseEnvelopeSuccess = true
+)
+
+type V3DestinationWebhookListParams struct {
+ // The account id
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type V3DestinationWebhookListResponseEnvelope struct {
+ Errors []V3DestinationWebhookListResponseEnvelopeErrors `json:"errors,required"`
+ Messages []V3DestinationWebhookListResponseEnvelopeMessages `json:"messages,required"`
+ Result []AaaWebhooks `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success V3DestinationWebhookListResponseEnvelopeSuccess `json:"success,required"`
+ ResultInfo V3DestinationWebhookListResponseEnvelopeResultInfo `json:"result_info"`
+ JSON v3DestinationWebhookListResponseEnvelopeJSON `json:"-"`
+}
+
+// v3DestinationWebhookListResponseEnvelopeJSON contains the JSON metadata for the
+// struct [V3DestinationWebhookListResponseEnvelope]
+type v3DestinationWebhookListResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ ResultInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V3DestinationWebhookListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v3DestinationWebhookListResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type V3DestinationWebhookListResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON v3DestinationWebhookListResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// v3DestinationWebhookListResponseEnvelopeErrorsJSON contains the JSON metadata
+// for the struct [V3DestinationWebhookListResponseEnvelopeErrors]
+type v3DestinationWebhookListResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V3DestinationWebhookListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v3DestinationWebhookListResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type V3DestinationWebhookListResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON v3DestinationWebhookListResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// v3DestinationWebhookListResponseEnvelopeMessagesJSON contains the JSON metadata
+// for the struct [V3DestinationWebhookListResponseEnvelopeMessages]
+type v3DestinationWebhookListResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V3DestinationWebhookListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v3DestinationWebhookListResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type V3DestinationWebhookListResponseEnvelopeSuccess bool
+
+const (
+ V3DestinationWebhookListResponseEnvelopeSuccessTrue V3DestinationWebhookListResponseEnvelopeSuccess = true
+)
+
+type V3DestinationWebhookListResponseEnvelopeResultInfo struct {
+ // Total number of results for the requested service
+ Count float64 `json:"count"`
+ // Current page within paginated list of results
+ Page float64 `json:"page"`
+ // Number of results per page of results
+ PerPage float64 `json:"per_page"`
+ // Total results available without any search parameters
+ TotalCount float64 `json:"total_count"`
+ JSON v3DestinationWebhookListResponseEnvelopeResultInfoJSON `json:"-"`
+}
+
+// v3DestinationWebhookListResponseEnvelopeResultInfoJSON contains the JSON
+// metadata for the struct [V3DestinationWebhookListResponseEnvelopeResultInfo]
+type v3DestinationWebhookListResponseEnvelopeResultInfoJSON struct {
+ Count apijson.Field
+ Page apijson.Field
+ PerPage apijson.Field
+ TotalCount apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V3DestinationWebhookListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v3DestinationWebhookListResponseEnvelopeResultInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type V3DestinationWebhookDeleteParams struct {
+ // The account id
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type V3DestinationWebhookDeleteResponseEnvelope struct {
+ Errors []V3DestinationWebhookDeleteResponseEnvelopeErrors `json:"errors,required"`
+ Messages []V3DestinationWebhookDeleteResponseEnvelopeMessages `json:"messages,required"`
+ Result V3DestinationWebhookDeleteResponse `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success V3DestinationWebhookDeleteResponseEnvelopeSuccess `json:"success,required"`
+ ResultInfo V3DestinationWebhookDeleteResponseEnvelopeResultInfo `json:"result_info"`
+ JSON v3DestinationWebhookDeleteResponseEnvelopeJSON `json:"-"`
+}
+
+// v3DestinationWebhookDeleteResponseEnvelopeJSON contains the JSON metadata for
+// the struct [V3DestinationWebhookDeleteResponseEnvelope]
+type v3DestinationWebhookDeleteResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ ResultInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V3DestinationWebhookDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v3DestinationWebhookDeleteResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type V3DestinationWebhookDeleteResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON v3DestinationWebhookDeleteResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// v3DestinationWebhookDeleteResponseEnvelopeErrorsJSON contains the JSON metadata
+// for the struct [V3DestinationWebhookDeleteResponseEnvelopeErrors]
+type v3DestinationWebhookDeleteResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V3DestinationWebhookDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v3DestinationWebhookDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type V3DestinationWebhookDeleteResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON v3DestinationWebhookDeleteResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// v3DestinationWebhookDeleteResponseEnvelopeMessagesJSON contains the JSON
+// metadata for the struct [V3DestinationWebhookDeleteResponseEnvelopeMessages]
+type v3DestinationWebhookDeleteResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V3DestinationWebhookDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v3DestinationWebhookDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type V3DestinationWebhookDeleteResponseEnvelopeSuccess bool
+
+const (
+ V3DestinationWebhookDeleteResponseEnvelopeSuccessTrue V3DestinationWebhookDeleteResponseEnvelopeSuccess = true
+)
+
+type V3DestinationWebhookDeleteResponseEnvelopeResultInfo struct {
+ // Total number of results for the requested service
+ Count float64 `json:"count"`
+ // Current page within paginated list of results
+ Page float64 `json:"page"`
+ // Number of results per page of results
+ PerPage float64 `json:"per_page"`
+ // Total results available without any search parameters
+ TotalCount float64 `json:"total_count"`
+ JSON v3DestinationWebhookDeleteResponseEnvelopeResultInfoJSON `json:"-"`
+}
+
+// v3DestinationWebhookDeleteResponseEnvelopeResultInfoJSON contains the JSON
+// metadata for the struct [V3DestinationWebhookDeleteResponseEnvelopeResultInfo]
+type v3DestinationWebhookDeleteResponseEnvelopeResultInfoJSON struct {
+ Count apijson.Field
+ Page apijson.Field
+ PerPage apijson.Field
+ TotalCount apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V3DestinationWebhookDeleteResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v3DestinationWebhookDeleteResponseEnvelopeResultInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type V3DestinationWebhookGetParams struct {
+ // The account id
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type V3DestinationWebhookGetResponseEnvelope struct {
+ Errors []V3DestinationWebhookGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []V3DestinationWebhookGetResponseEnvelopeMessages `json:"messages,required"`
+ Result AaaWebhooks `json:"result,required"`
+ // Whether the API call was successful
+ Success V3DestinationWebhookGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON v3DestinationWebhookGetResponseEnvelopeJSON `json:"-"`
+}
+
+// v3DestinationWebhookGetResponseEnvelopeJSON contains the JSON metadata for the
+// struct [V3DestinationWebhookGetResponseEnvelope]
+type v3DestinationWebhookGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V3DestinationWebhookGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v3DestinationWebhookGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type V3DestinationWebhookGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON v3DestinationWebhookGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// v3DestinationWebhookGetResponseEnvelopeErrorsJSON contains the JSON metadata for
+// the struct [V3DestinationWebhookGetResponseEnvelopeErrors]
+type v3DestinationWebhookGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V3DestinationWebhookGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v3DestinationWebhookGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type V3DestinationWebhookGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON v3DestinationWebhookGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// v3DestinationWebhookGetResponseEnvelopeMessagesJSON contains the JSON metadata
+// for the struct [V3DestinationWebhookGetResponseEnvelopeMessages]
+type v3DestinationWebhookGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V3DestinationWebhookGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v3DestinationWebhookGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type V3DestinationWebhookGetResponseEnvelopeSuccess bool
+
+const (
+ V3DestinationWebhookGetResponseEnvelopeSuccessTrue V3DestinationWebhookGetResponseEnvelopeSuccess = true
+)
diff --git a/alerting/v3destinationwebhook_test.go b/alerting/v3destinationwebhook_test.go
new file mode 100644
index 00000000000..628fd5cb1fe
--- /dev/null
+++ b/alerting/v3destinationwebhook_test.go
@@ -0,0 +1,163 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package alerting_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/alerting"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestV3DestinationWebhookNewWithOptionalParams(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"),
+ )
+ _, err := client.Alerting.V3.Destinations.Webhooks.New(context.TODO(), alerting.V3DestinationWebhookNewParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Name: cloudflare.F("Slack Webhook"),
+ URL: cloudflare.F("https://hooks.slack.com/services/Ds3fdBFbV/456464Gdd"),
+ Secret: cloudflare.F("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())
+ }
+}
+
+func TestV3DestinationWebhookUpdateWithOptionalParams(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"),
+ )
+ _, err := client.Alerting.V3.Destinations.Webhooks.Update(
+ context.TODO(),
+ "b115d5ec-15c6-41ee-8b76-92c449b5227b",
+ alerting.V3DestinationWebhookUpdateParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Name: cloudflare.F("Slack Webhook"),
+ URL: cloudflare.F("https://hooks.slack.com/services/Ds3fdBFbV/456464Gdd"),
+ Secret: cloudflare.F("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())
+ }
+}
+
+func TestV3DestinationWebhookList(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"),
+ )
+ _, err := client.Alerting.V3.Destinations.Webhooks.List(context.TODO(), alerting.V3DestinationWebhookListParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ })
+ 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())
+ }
+}
+
+func TestV3DestinationWebhookDelete(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"),
+ )
+ _, err := client.Alerting.V3.Destinations.Webhooks.Delete(
+ context.TODO(),
+ "b115d5ec-15c6-41ee-8b76-92c449b5227b",
+ alerting.V3DestinationWebhookDeleteParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestV3DestinationWebhookGet(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"),
+ )
+ _, err := client.Alerting.V3.Destinations.Webhooks.Get(
+ context.TODO(),
+ "b115d5ec-15c6-41ee-8b76-92c449b5227b",
+ alerting.V3DestinationWebhookGetParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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/alerting/v3history.go b/alerting/v3history.go
new file mode 100644
index 00000000000..9313e040aa2
--- /dev/null
+++ b/alerting/v3history.go
@@ -0,0 +1,141 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package alerting
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// V3HistoryService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewV3HistoryService] method instead.
+type V3HistoryService struct {
+ Options []option.RequestOption
+}
+
+// NewV3HistoryService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewV3HistoryService(opts ...option.RequestOption) (r *V3HistoryService) {
+ r = &V3HistoryService{}
+ r.Options = opts
+ return
+}
+
+// Gets a list of history records for notifications sent to an account. The records
+// are displayed for last `x` number of days based on the zone plan (free = 30, pro
+// = 30, biz = 30, ent = 90).
+func (r *V3HistoryService) List(ctx context.Context, params V3HistoryListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[AaaHistory], err error) {
+ var raw *http.Response
+ opts = append(r.Options, opts...)
+ opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
+ path := fmt.Sprintf("accounts/%s/alerting/v3/history", params.AccountID)
+ cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, params, &res, opts...)
+ if err != nil {
+ return nil, err
+ }
+ err = cfg.Execute()
+ if err != nil {
+ return nil, err
+ }
+ res.SetPageConfig(cfg, raw)
+ return res, nil
+}
+
+// Gets a list of history records for notifications sent to an account. The records
+// are displayed for last `x` number of days based on the zone plan (free = 30, pro
+// = 30, biz = 30, ent = 90).
+func (r *V3HistoryService) ListAutoPaging(ctx context.Context, params V3HistoryListParams, opts ...option.RequestOption) *shared.V4PagePaginationArrayAutoPager[AaaHistory] {
+ return shared.NewV4PagePaginationArrayAutoPager(r.List(ctx, params, opts...))
+}
+
+type AaaHistory struct {
+ // UUID
+ ID string `json:"id"`
+ // Message body included in the notification sent.
+ AlertBody string `json:"alert_body"`
+ // Type of notification that has been dispatched.
+ AlertType string `json:"alert_type"`
+ // Description of the notification policy (if present).
+ Description string `json:"description"`
+ // The mechanism to which the notification has been dispatched.
+ Mechanism string `json:"mechanism"`
+ // The type of mechanism to which the notification has been dispatched. This can be
+ // email/pagerduty/webhook based on the mechanism configured.
+ MechanismType AaaHistoryMechanismType `json:"mechanism_type"`
+ // Name of the policy.
+ Name string `json:"name"`
+ // The unique identifier of a notification policy
+ PolicyID string `json:"policy_id"`
+ // Timestamp of when the notification was dispatched in ISO 8601 format.
+ Sent time.Time `json:"sent" format:"date-time"`
+ JSON aaaHistoryJSON `json:"-"`
+}
+
+// aaaHistoryJSON contains the JSON metadata for the struct [AaaHistory]
+type aaaHistoryJSON struct {
+ ID apijson.Field
+ AlertBody apijson.Field
+ AlertType apijson.Field
+ Description apijson.Field
+ Mechanism apijson.Field
+ MechanismType apijson.Field
+ Name apijson.Field
+ PolicyID apijson.Field
+ Sent apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AaaHistory) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r aaaHistoryJSON) RawJSON() string {
+ return r.raw
+}
+
+// The type of mechanism to which the notification has been dispatched. This can be
+// email/pagerduty/webhook based on the mechanism configured.
+type AaaHistoryMechanismType string
+
+const (
+ AaaHistoryMechanismTypeEmail AaaHistoryMechanismType = "email"
+ AaaHistoryMechanismTypePagerduty AaaHistoryMechanismType = "pagerduty"
+ AaaHistoryMechanismTypeWebhook AaaHistoryMechanismType = "webhook"
+)
+
+type V3HistoryListParams struct {
+ // The account id
+ AccountID param.Field[string] `path:"account_id,required"`
+ // Limit the returned results to history records older than the specified date.
+ // This must be a timestamp that conforms to RFC3339.
+ Before param.Field[time.Time] `query:"before" format:"date-time"`
+ // Page number of paginated results.
+ Page param.Field[float64] `query:"page"`
+ // Number of items per page.
+ PerPage param.Field[float64] `query:"per_page"`
+ // Limit the returned results to history records newer than the specified date.
+ // This must be a timestamp that conforms to RFC3339.
+ Since param.Field[time.Time] `query:"since" format:"date-time"`
+}
+
+// URLQuery serializes [V3HistoryListParams]'s query parameters as `url.Values`.
+func (r V3HistoryListParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
diff --git a/alerting/v3history_test.go b/alerting/v3history_test.go
new file mode 100644
index 00000000000..05f05e23e49
--- /dev/null
+++ b/alerting/v3history_test.go
@@ -0,0 +1,46 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package alerting_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/alerting"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestV3HistoryListWithOptionalParams(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"),
+ )
+ _, err := client.Alerting.V3.Histories.List(context.TODO(), alerting.V3HistoryListParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Before: cloudflare.F(time.Now()),
+ Page: cloudflare.F(1.000000),
+ PerPage: cloudflare.F(5.000000),
+ Since: cloudflare.F(time.Now()),
+ })
+ 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/alerting/v3policy.go b/alerting/v3policy.go
new file mode 100644
index 00000000000..45344c6e409
--- /dev/null
+++ b/alerting/v3policy.go
@@ -0,0 +1,1408 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package alerting
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "reflect"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/tidwall/gjson"
+)
+
+// V3PolicyService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewV3PolicyService] method instead.
+type V3PolicyService struct {
+ Options []option.RequestOption
+}
+
+// NewV3PolicyService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewV3PolicyService(opts ...option.RequestOption) (r *V3PolicyService) {
+ r = &V3PolicyService{}
+ r.Options = opts
+ return
+}
+
+// Creates a new Notification policy.
+func (r *V3PolicyService) New(ctx context.Context, params V3PolicyNewParams, opts ...option.RequestOption) (res *V3PolicyNewResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env V3PolicyNewResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/alerting/v3/policies", params.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Update a Notification policy.
+func (r *V3PolicyService) Update(ctx context.Context, policyID string, params V3PolicyUpdateParams, opts ...option.RequestOption) (res *V3PolicyUpdateResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env V3PolicyUpdateResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/alerting/v3/policies/%s", params.AccountID, policyID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Get a list of all Notification policies.
+func (r *V3PolicyService) List(ctx context.Context, query V3PolicyListParams, opts ...option.RequestOption) (res *[]AaaPolicies, err error) {
+ opts = append(r.Options[:], opts...)
+ var env V3PolicyListResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/alerting/v3/policies", query.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Delete a Notification policy.
+func (r *V3PolicyService) Delete(ctx context.Context, policyID string, body V3PolicyDeleteParams, opts ...option.RequestOption) (res *V3PolicyDeleteResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env V3PolicyDeleteResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/alerting/v3/policies/%s", body.AccountID, policyID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Get details for a single policy.
+func (r *V3PolicyService) Get(ctx context.Context, policyID string, query V3PolicyGetParams, opts ...option.RequestOption) (res *AaaPolicies, err error) {
+ opts = append(r.Options[:], opts...)
+ var env V3PolicyGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/alerting/v3/policies/%s", query.AccountID, policyID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type AaaPolicies struct {
+ // The unique identifier of a notification policy
+ ID string `json:"id"`
+ // Refers to which event will trigger a Notification dispatch. You can use the
+ // endpoint to get available alert types which then will give you a list of
+ // possible values.
+ AlertType AaaPoliciesAlertType `json:"alert_type"`
+ Created time.Time `json:"created" format:"date-time"`
+ // Optional description for the Notification policy.
+ Description string `json:"description"`
+ // Whether or not the Notification policy is enabled.
+ Enabled bool `json:"enabled"`
+ // Optional filters that allow you to be alerted only on a subset of events for
+ // that alert type based on some criteria. This is only available for select alert
+ // types. See alert type documentation for more details.
+ Filters AaaPoliciesFilters `json:"filters"`
+ // List of IDs that will be used when dispatching a notification. IDs for email
+ // type will be the email address.
+ Mechanisms map[string][]AaaPoliciesMechanisms `json:"mechanisms"`
+ Modified time.Time `json:"modified" format:"date-time"`
+ // Name of the policy.
+ Name string `json:"name"`
+ JSON aaaPoliciesJSON `json:"-"`
+}
+
+// aaaPoliciesJSON contains the JSON metadata for the struct [AaaPolicies]
+type aaaPoliciesJSON struct {
+ ID apijson.Field
+ AlertType apijson.Field
+ Created apijson.Field
+ Description apijson.Field
+ Enabled apijson.Field
+ Filters apijson.Field
+ Mechanisms apijson.Field
+ Modified apijson.Field
+ Name apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AaaPolicies) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r aaaPoliciesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Refers to which event will trigger a Notification dispatch. You can use the
+// endpoint to get available alert types which then will give you a list of
+// possible values.
+type AaaPoliciesAlertType string
+
+const (
+ AaaPoliciesAlertTypeAccessCustomCertificateExpirationType AaaPoliciesAlertType = "access_custom_certificate_expiration_type"
+ AaaPoliciesAlertTypeAdvancedDDOSAttackL4Alert AaaPoliciesAlertType = "advanced_ddos_attack_l4_alert"
+ AaaPoliciesAlertTypeAdvancedDDOSAttackL7Alert AaaPoliciesAlertType = "advanced_ddos_attack_l7_alert"
+ AaaPoliciesAlertTypeAdvancedHTTPAlertError AaaPoliciesAlertType = "advanced_http_alert_error"
+ AaaPoliciesAlertTypeBGPHijackNotification AaaPoliciesAlertType = "bgp_hijack_notification"
+ AaaPoliciesAlertTypeBillingUsageAlert AaaPoliciesAlertType = "billing_usage_alert"
+ AaaPoliciesAlertTypeBlockNotificationBlockRemoved AaaPoliciesAlertType = "block_notification_block_removed"
+ AaaPoliciesAlertTypeBlockNotificationNewBlock AaaPoliciesAlertType = "block_notification_new_block"
+ AaaPoliciesAlertTypeBlockNotificationReviewRejected AaaPoliciesAlertType = "block_notification_review_rejected"
+ AaaPoliciesAlertTypeBrandProtectionAlert AaaPoliciesAlertType = "brand_protection_alert"
+ AaaPoliciesAlertTypeBrandProtectionDigest AaaPoliciesAlertType = "brand_protection_digest"
+ AaaPoliciesAlertTypeClickhouseAlertFwAnomaly AaaPoliciesAlertType = "clickhouse_alert_fw_anomaly"
+ AaaPoliciesAlertTypeClickhouseAlertFwEntAnomaly AaaPoliciesAlertType = "clickhouse_alert_fw_ent_anomaly"
+ AaaPoliciesAlertTypeCustomSSLCertificateEventType AaaPoliciesAlertType = "custom_ssl_certificate_event_type"
+ AaaPoliciesAlertTypeDedicatedSSLCertificateEventType AaaPoliciesAlertType = "dedicated_ssl_certificate_event_type"
+ AaaPoliciesAlertTypeDosAttackL4 AaaPoliciesAlertType = "dos_attack_l4"
+ AaaPoliciesAlertTypeDosAttackL7 AaaPoliciesAlertType = "dos_attack_l7"
+ AaaPoliciesAlertTypeExpiringServiceTokenAlert AaaPoliciesAlertType = "expiring_service_token_alert"
+ AaaPoliciesAlertTypeFailingLogpushJobDisabledAlert AaaPoliciesAlertType = "failing_logpush_job_disabled_alert"
+ AaaPoliciesAlertTypeFbmAutoAdvertisement AaaPoliciesAlertType = "fbm_auto_advertisement"
+ AaaPoliciesAlertTypeFbmDosdAttack AaaPoliciesAlertType = "fbm_dosd_attack"
+ AaaPoliciesAlertTypeFbmVolumetricAttack AaaPoliciesAlertType = "fbm_volumetric_attack"
+ AaaPoliciesAlertTypeHealthCheckStatusNotification AaaPoliciesAlertType = "health_check_status_notification"
+ AaaPoliciesAlertTypeHostnameAopCustomCertificateExpirationType AaaPoliciesAlertType = "hostname_aop_custom_certificate_expiration_type"
+ AaaPoliciesAlertTypeHTTPAlertEdgeError AaaPoliciesAlertType = "http_alert_edge_error"
+ AaaPoliciesAlertTypeHTTPAlertOriginError AaaPoliciesAlertType = "http_alert_origin_error"
+ AaaPoliciesAlertTypeIncidentAlert AaaPoliciesAlertType = "incident_alert"
+ AaaPoliciesAlertTypeLoadBalancingHealthAlert AaaPoliciesAlertType = "load_balancing_health_alert"
+ AaaPoliciesAlertTypeLoadBalancingPoolEnablementAlert AaaPoliciesAlertType = "load_balancing_pool_enablement_alert"
+ AaaPoliciesAlertTypeLogoMatchAlert AaaPoliciesAlertType = "logo_match_alert"
+ AaaPoliciesAlertTypeMagicTunnelHealthCheckEvent AaaPoliciesAlertType = "magic_tunnel_health_check_event"
+ AaaPoliciesAlertTypeMaintenanceEventNotification AaaPoliciesAlertType = "maintenance_event_notification"
+ AaaPoliciesAlertTypeMTLSCertificateStoreCertificateExpirationType AaaPoliciesAlertType = "mtls_certificate_store_certificate_expiration_type"
+ AaaPoliciesAlertTypePagesEventAlert AaaPoliciesAlertType = "pages_event_alert"
+ AaaPoliciesAlertTypeRadarNotification AaaPoliciesAlertType = "radar_notification"
+ AaaPoliciesAlertTypeRealOriginMonitoring AaaPoliciesAlertType = "real_origin_monitoring"
+ AaaPoliciesAlertTypeScriptmonitorAlertNewCodeChangeDetections AaaPoliciesAlertType = "scriptmonitor_alert_new_code_change_detections"
+ AaaPoliciesAlertTypeScriptmonitorAlertNewHosts AaaPoliciesAlertType = "scriptmonitor_alert_new_hosts"
+ AaaPoliciesAlertTypeScriptmonitorAlertNewMaliciousHosts AaaPoliciesAlertType = "scriptmonitor_alert_new_malicious_hosts"
+ AaaPoliciesAlertTypeScriptmonitorAlertNewMaliciousScripts AaaPoliciesAlertType = "scriptmonitor_alert_new_malicious_scripts"
+ AaaPoliciesAlertTypeScriptmonitorAlertNewMaliciousURL AaaPoliciesAlertType = "scriptmonitor_alert_new_malicious_url"
+ AaaPoliciesAlertTypeScriptmonitorAlertNewMaxLengthResourceURL AaaPoliciesAlertType = "scriptmonitor_alert_new_max_length_resource_url"
+ AaaPoliciesAlertTypeScriptmonitorAlertNewResources AaaPoliciesAlertType = "scriptmonitor_alert_new_resources"
+ AaaPoliciesAlertTypeSecondaryDNSAllPrimariesFailing AaaPoliciesAlertType = "secondary_dns_all_primaries_failing"
+ AaaPoliciesAlertTypeSecondaryDNSPrimariesFailing AaaPoliciesAlertType = "secondary_dns_primaries_failing"
+ AaaPoliciesAlertTypeSecondaryDNSZoneSuccessfullyUpdated AaaPoliciesAlertType = "secondary_dns_zone_successfully_updated"
+ AaaPoliciesAlertTypeSecondaryDNSZoneValidationWarning AaaPoliciesAlertType = "secondary_dns_zone_validation_warning"
+ AaaPoliciesAlertTypeSentinelAlert AaaPoliciesAlertType = "sentinel_alert"
+ AaaPoliciesAlertTypeStreamLiveNotifications AaaPoliciesAlertType = "stream_live_notifications"
+ AaaPoliciesAlertTypeTunnelHealthEvent AaaPoliciesAlertType = "tunnel_health_event"
+ AaaPoliciesAlertTypeTunnelUpdateEvent AaaPoliciesAlertType = "tunnel_update_event"
+ AaaPoliciesAlertTypeUniversalSSLEventType AaaPoliciesAlertType = "universal_ssl_event_type"
+ AaaPoliciesAlertTypeWebAnalyticsMetricsUpdate AaaPoliciesAlertType = "web_analytics_metrics_update"
+ AaaPoliciesAlertTypeZoneAopCustomCertificateExpirationType AaaPoliciesAlertType = "zone_aop_custom_certificate_expiration_type"
+)
+
+// Optional filters that allow you to be alerted only on a subset of events for
+// that alert type based on some criteria. This is only available for select alert
+// types. See alert type documentation for more details.
+type AaaPoliciesFilters struct {
+ // Usage depends on specific alert type
+ Actions []string `json:"actions"`
+ // Used for configuring radar_notification
+ AffectedASNs []string `json:"affected_asns"`
+ // Used for configuring incident_alert
+ AffectedComponents []string `json:"affected_components"`
+ // Used for configuring radar_notification
+ AffectedLocations []string `json:"affected_locations"`
+ // Used for configuring maintenance_event_notification
+ AirportCode []string `json:"airport_code"`
+ // Usage depends on specific alert type
+ AlertTriggerPreferences []string `json:"alert_trigger_preferences"`
+ // Used for configuring magic_tunnel_health_check_event
+ AlertTriggerPreferencesValue []AaaPoliciesFiltersAlertTriggerPreferencesValue `json:"alert_trigger_preferences_value"`
+ // Used for configuring load_balancing_pool_enablement_alert
+ Enabled []string `json:"enabled"`
+ // Used for configuring pages_event_alert
+ Environment []string `json:"environment"`
+ // Used for configuring pages_event_alert
+ Event []string `json:"event"`
+ // Used for configuring load_balancing_health_alert
+ EventSource []string `json:"event_source"`
+ // Usage depends on specific alert type
+ EventType []string `json:"event_type"`
+ // Usage depends on specific alert type
+ GroupBy []string `json:"group_by"`
+ // Used for configuring health_check_status_notification
+ HealthCheckID []string `json:"health_check_id"`
+ // Used for configuring incident_alert
+ IncidentImpact []AaaPoliciesFiltersIncidentImpact `json:"incident_impact"`
+ // Used for configuring stream_live_notifications
+ InputID []string `json:"input_id"`
+ // Used for configuring billing_usage_alert
+ Limit []string `json:"limit"`
+ // Used for configuring logo_match_alert
+ LogoTag []string `json:"logo_tag"`
+ // Used for configuring advanced_ddos_attack_l4_alert
+ MegabitsPerSecond []string `json:"megabits_per_second"`
+ // Used for configuring load_balancing_health_alert
+ NewHealth []string `json:"new_health"`
+ // Used for configuring tunnel_health_event
+ NewStatus []string `json:"new_status"`
+ // Used for configuring advanced_ddos_attack_l4_alert
+ PacketsPerSecond []string `json:"packets_per_second"`
+ // Usage depends on specific alert type
+ PoolID []string `json:"pool_id"`
+ // Used for configuring billing_usage_alert
+ Product []string `json:"product"`
+ // Used for configuring pages_event_alert
+ ProjectID []string `json:"project_id"`
+ // Used for configuring advanced_ddos_attack_l4_alert
+ Protocol []string `json:"protocol"`
+ // Usage depends on specific alert type
+ QueryTag []string `json:"query_tag"`
+ // Used for configuring advanced_ddos_attack_l7_alert
+ RequestsPerSecond []string `json:"requests_per_second"`
+ // Usage depends on specific alert type
+ Selectors []string `json:"selectors"`
+ // Used for configuring clickhouse_alert_fw_ent_anomaly
+ Services []string `json:"services"`
+ // Usage depends on specific alert type
+ Slo []string `json:"slo"`
+ // Used for configuring health_check_status_notification
+ Status []string `json:"status"`
+ // Used for configuring advanced_ddos_attack_l7_alert
+ TargetHostname []string `json:"target_hostname"`
+ // Used for configuring advanced_ddos_attack_l4_alert
+ TargetIP []string `json:"target_ip"`
+ // Used for configuring advanced_ddos_attack_l7_alert
+ TargetZoneName []string `json:"target_zone_name"`
+ // Used for configuring traffic_anomalies_alert
+ TrafficExclusions []AaaPoliciesFiltersTrafficExclusion `json:"traffic_exclusions"`
+ // Used for configuring tunnel_health_event
+ TunnelID []string `json:"tunnel_id"`
+ // Used for configuring magic_tunnel_health_check_event
+ TunnelName []string `json:"tunnel_name"`
+ // Usage depends on specific alert type
+ Where []string `json:"where"`
+ // Usage depends on specific alert type
+ Zones []string `json:"zones"`
+ JSON aaaPoliciesFiltersJSON `json:"-"`
+}
+
+// aaaPoliciesFiltersJSON contains the JSON metadata for the struct
+// [AaaPoliciesFilters]
+type aaaPoliciesFiltersJSON struct {
+ Actions apijson.Field
+ AffectedASNs apijson.Field
+ AffectedComponents apijson.Field
+ AffectedLocations apijson.Field
+ AirportCode apijson.Field
+ AlertTriggerPreferences apijson.Field
+ AlertTriggerPreferencesValue apijson.Field
+ Enabled apijson.Field
+ Environment apijson.Field
+ Event apijson.Field
+ EventSource apijson.Field
+ EventType apijson.Field
+ GroupBy apijson.Field
+ HealthCheckID apijson.Field
+ IncidentImpact apijson.Field
+ InputID apijson.Field
+ Limit apijson.Field
+ LogoTag apijson.Field
+ MegabitsPerSecond apijson.Field
+ NewHealth apijson.Field
+ NewStatus apijson.Field
+ PacketsPerSecond apijson.Field
+ PoolID apijson.Field
+ Product apijson.Field
+ ProjectID apijson.Field
+ Protocol apijson.Field
+ QueryTag apijson.Field
+ RequestsPerSecond apijson.Field
+ Selectors apijson.Field
+ Services apijson.Field
+ Slo apijson.Field
+ Status apijson.Field
+ TargetHostname apijson.Field
+ TargetIP apijson.Field
+ TargetZoneName apijson.Field
+ TrafficExclusions apijson.Field
+ TunnelID apijson.Field
+ TunnelName apijson.Field
+ Where apijson.Field
+ Zones apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AaaPoliciesFilters) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r aaaPoliciesFiltersJSON) RawJSON() string {
+ return r.raw
+}
+
+type AaaPoliciesFiltersAlertTriggerPreferencesValue string
+
+const (
+ AaaPoliciesFiltersAlertTriggerPreferencesValue99_0 AaaPoliciesFiltersAlertTriggerPreferencesValue = "99.0"
+ AaaPoliciesFiltersAlertTriggerPreferencesValue98_0 AaaPoliciesFiltersAlertTriggerPreferencesValue = "98.0"
+ AaaPoliciesFiltersAlertTriggerPreferencesValue97_0 AaaPoliciesFiltersAlertTriggerPreferencesValue = "97.0"
+)
+
+type AaaPoliciesFiltersIncidentImpact string
+
+const (
+ AaaPoliciesFiltersIncidentImpactIncidentImpactNone AaaPoliciesFiltersIncidentImpact = "INCIDENT_IMPACT_NONE"
+ AaaPoliciesFiltersIncidentImpactIncidentImpactMinor AaaPoliciesFiltersIncidentImpact = "INCIDENT_IMPACT_MINOR"
+ AaaPoliciesFiltersIncidentImpactIncidentImpactMajor AaaPoliciesFiltersIncidentImpact = "INCIDENT_IMPACT_MAJOR"
+ AaaPoliciesFiltersIncidentImpactIncidentImpactCritical AaaPoliciesFiltersIncidentImpact = "INCIDENT_IMPACT_CRITICAL"
+)
+
+type AaaPoliciesFiltersTrafficExclusion string
+
+const (
+ AaaPoliciesFiltersTrafficExclusionSecurityEvents AaaPoliciesFiltersTrafficExclusion = "security_events"
+)
+
+type AaaPoliciesMechanisms struct {
+ // UUID
+ ID AaaPoliciesMechanismsID `json:"id"`
+ JSON aaaPoliciesMechanismsJSON `json:"-"`
+}
+
+// aaaPoliciesMechanismsJSON contains the JSON metadata for the struct
+// [AaaPoliciesMechanisms]
+type aaaPoliciesMechanismsJSON struct {
+ ID apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AaaPoliciesMechanisms) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r aaaPoliciesMechanismsJSON) RawJSON() string {
+ return r.raw
+}
+
+// UUID
+//
+// Union satisfied by [shared.UnionString] or [shared.UnionString].
+type AaaPoliciesMechanismsID interface {
+ ImplementsAlertingAaaPoliciesMechanismsID()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*AaaPoliciesMechanismsID)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+type V3PolicyNewResponse struct {
+ // UUID
+ ID string `json:"id"`
+ JSON v3PolicyNewResponseJSON `json:"-"`
+}
+
+// v3PolicyNewResponseJSON contains the JSON metadata for the struct
+// [V3PolicyNewResponse]
+type v3PolicyNewResponseJSON struct {
+ ID apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V3PolicyNewResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v3PolicyNewResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type V3PolicyUpdateResponse struct {
+ // UUID
+ ID string `json:"id"`
+ JSON v3PolicyUpdateResponseJSON `json:"-"`
+}
+
+// v3PolicyUpdateResponseJSON contains the JSON metadata for the struct
+// [V3PolicyUpdateResponse]
+type v3PolicyUpdateResponseJSON struct {
+ ID apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V3PolicyUpdateResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v3PolicyUpdateResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+// Union satisfied by [alerting.V3PolicyDeleteResponseUnknown],
+// [alerting.V3PolicyDeleteResponseArray] or [shared.UnionString].
+type V3PolicyDeleteResponse interface {
+ ImplementsAlertingV3PolicyDeleteResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*V3PolicyDeleteResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(V3PolicyDeleteResponseArray{}),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+type V3PolicyDeleteResponseArray []interface{}
+
+func (r V3PolicyDeleteResponseArray) ImplementsAlertingV3PolicyDeleteResponse() {}
+
+type V3PolicyNewParams struct {
+ // The account id
+ AccountID param.Field[string] `path:"account_id,required"`
+ // Refers to which event will trigger a Notification dispatch. You can use the
+ // endpoint to get available alert types which then will give you a list of
+ // possible values.
+ AlertType param.Field[V3PolicyNewParamsAlertType] `json:"alert_type,required"`
+ // Whether or not the Notification policy is enabled.
+ Enabled param.Field[bool] `json:"enabled,required"`
+ // List of IDs that will be used when dispatching a notification. IDs for email
+ // type will be the email address.
+ Mechanisms param.Field[map[string][]V3PolicyNewParamsMechanisms] `json:"mechanisms,required"`
+ // Name of the policy.
+ Name param.Field[string] `json:"name,required"`
+ // Optional description for the Notification policy.
+ Description param.Field[string] `json:"description"`
+ // Optional filters that allow you to be alerted only on a subset of events for
+ // that alert type based on some criteria. This is only available for select alert
+ // types. See alert type documentation for more details.
+ Filters param.Field[V3PolicyNewParamsFilters] `json:"filters"`
+}
+
+func (r V3PolicyNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Refers to which event will trigger a Notification dispatch. You can use the
+// endpoint to get available alert types which then will give you a list of
+// possible values.
+type V3PolicyNewParamsAlertType string
+
+const (
+ V3PolicyNewParamsAlertTypeAccessCustomCertificateExpirationType V3PolicyNewParamsAlertType = "access_custom_certificate_expiration_type"
+ V3PolicyNewParamsAlertTypeAdvancedDDOSAttackL4Alert V3PolicyNewParamsAlertType = "advanced_ddos_attack_l4_alert"
+ V3PolicyNewParamsAlertTypeAdvancedDDOSAttackL7Alert V3PolicyNewParamsAlertType = "advanced_ddos_attack_l7_alert"
+ V3PolicyNewParamsAlertTypeAdvancedHTTPAlertError V3PolicyNewParamsAlertType = "advanced_http_alert_error"
+ V3PolicyNewParamsAlertTypeBGPHijackNotification V3PolicyNewParamsAlertType = "bgp_hijack_notification"
+ V3PolicyNewParamsAlertTypeBillingUsageAlert V3PolicyNewParamsAlertType = "billing_usage_alert"
+ V3PolicyNewParamsAlertTypeBlockNotificationBlockRemoved V3PolicyNewParamsAlertType = "block_notification_block_removed"
+ V3PolicyNewParamsAlertTypeBlockNotificationNewBlock V3PolicyNewParamsAlertType = "block_notification_new_block"
+ V3PolicyNewParamsAlertTypeBlockNotificationReviewRejected V3PolicyNewParamsAlertType = "block_notification_review_rejected"
+ V3PolicyNewParamsAlertTypeBrandProtectionAlert V3PolicyNewParamsAlertType = "brand_protection_alert"
+ V3PolicyNewParamsAlertTypeBrandProtectionDigest V3PolicyNewParamsAlertType = "brand_protection_digest"
+ V3PolicyNewParamsAlertTypeClickhouseAlertFwAnomaly V3PolicyNewParamsAlertType = "clickhouse_alert_fw_anomaly"
+ V3PolicyNewParamsAlertTypeClickhouseAlertFwEntAnomaly V3PolicyNewParamsAlertType = "clickhouse_alert_fw_ent_anomaly"
+ V3PolicyNewParamsAlertTypeCustomSSLCertificateEventType V3PolicyNewParamsAlertType = "custom_ssl_certificate_event_type"
+ V3PolicyNewParamsAlertTypeDedicatedSSLCertificateEventType V3PolicyNewParamsAlertType = "dedicated_ssl_certificate_event_type"
+ V3PolicyNewParamsAlertTypeDosAttackL4 V3PolicyNewParamsAlertType = "dos_attack_l4"
+ V3PolicyNewParamsAlertTypeDosAttackL7 V3PolicyNewParamsAlertType = "dos_attack_l7"
+ V3PolicyNewParamsAlertTypeExpiringServiceTokenAlert V3PolicyNewParamsAlertType = "expiring_service_token_alert"
+ V3PolicyNewParamsAlertTypeFailingLogpushJobDisabledAlert V3PolicyNewParamsAlertType = "failing_logpush_job_disabled_alert"
+ V3PolicyNewParamsAlertTypeFbmAutoAdvertisement V3PolicyNewParamsAlertType = "fbm_auto_advertisement"
+ V3PolicyNewParamsAlertTypeFbmDosdAttack V3PolicyNewParamsAlertType = "fbm_dosd_attack"
+ V3PolicyNewParamsAlertTypeFbmVolumetricAttack V3PolicyNewParamsAlertType = "fbm_volumetric_attack"
+ V3PolicyNewParamsAlertTypeHealthCheckStatusNotification V3PolicyNewParamsAlertType = "health_check_status_notification"
+ V3PolicyNewParamsAlertTypeHostnameAopCustomCertificateExpirationType V3PolicyNewParamsAlertType = "hostname_aop_custom_certificate_expiration_type"
+ V3PolicyNewParamsAlertTypeHTTPAlertEdgeError V3PolicyNewParamsAlertType = "http_alert_edge_error"
+ V3PolicyNewParamsAlertTypeHTTPAlertOriginError V3PolicyNewParamsAlertType = "http_alert_origin_error"
+ V3PolicyNewParamsAlertTypeIncidentAlert V3PolicyNewParamsAlertType = "incident_alert"
+ V3PolicyNewParamsAlertTypeLoadBalancingHealthAlert V3PolicyNewParamsAlertType = "load_balancing_health_alert"
+ V3PolicyNewParamsAlertTypeLoadBalancingPoolEnablementAlert V3PolicyNewParamsAlertType = "load_balancing_pool_enablement_alert"
+ V3PolicyNewParamsAlertTypeLogoMatchAlert V3PolicyNewParamsAlertType = "logo_match_alert"
+ V3PolicyNewParamsAlertTypeMagicTunnelHealthCheckEvent V3PolicyNewParamsAlertType = "magic_tunnel_health_check_event"
+ V3PolicyNewParamsAlertTypeMaintenanceEventNotification V3PolicyNewParamsAlertType = "maintenance_event_notification"
+ V3PolicyNewParamsAlertTypeMTLSCertificateStoreCertificateExpirationType V3PolicyNewParamsAlertType = "mtls_certificate_store_certificate_expiration_type"
+ V3PolicyNewParamsAlertTypePagesEventAlert V3PolicyNewParamsAlertType = "pages_event_alert"
+ V3PolicyNewParamsAlertTypeRadarNotification V3PolicyNewParamsAlertType = "radar_notification"
+ V3PolicyNewParamsAlertTypeRealOriginMonitoring V3PolicyNewParamsAlertType = "real_origin_monitoring"
+ V3PolicyNewParamsAlertTypeScriptmonitorAlertNewCodeChangeDetections V3PolicyNewParamsAlertType = "scriptmonitor_alert_new_code_change_detections"
+ V3PolicyNewParamsAlertTypeScriptmonitorAlertNewHosts V3PolicyNewParamsAlertType = "scriptmonitor_alert_new_hosts"
+ V3PolicyNewParamsAlertTypeScriptmonitorAlertNewMaliciousHosts V3PolicyNewParamsAlertType = "scriptmonitor_alert_new_malicious_hosts"
+ V3PolicyNewParamsAlertTypeScriptmonitorAlertNewMaliciousScripts V3PolicyNewParamsAlertType = "scriptmonitor_alert_new_malicious_scripts"
+ V3PolicyNewParamsAlertTypeScriptmonitorAlertNewMaliciousURL V3PolicyNewParamsAlertType = "scriptmonitor_alert_new_malicious_url"
+ V3PolicyNewParamsAlertTypeScriptmonitorAlertNewMaxLengthResourceURL V3PolicyNewParamsAlertType = "scriptmonitor_alert_new_max_length_resource_url"
+ V3PolicyNewParamsAlertTypeScriptmonitorAlertNewResources V3PolicyNewParamsAlertType = "scriptmonitor_alert_new_resources"
+ V3PolicyNewParamsAlertTypeSecondaryDNSAllPrimariesFailing V3PolicyNewParamsAlertType = "secondary_dns_all_primaries_failing"
+ V3PolicyNewParamsAlertTypeSecondaryDNSPrimariesFailing V3PolicyNewParamsAlertType = "secondary_dns_primaries_failing"
+ V3PolicyNewParamsAlertTypeSecondaryDNSZoneSuccessfullyUpdated V3PolicyNewParamsAlertType = "secondary_dns_zone_successfully_updated"
+ V3PolicyNewParamsAlertTypeSecondaryDNSZoneValidationWarning V3PolicyNewParamsAlertType = "secondary_dns_zone_validation_warning"
+ V3PolicyNewParamsAlertTypeSentinelAlert V3PolicyNewParamsAlertType = "sentinel_alert"
+ V3PolicyNewParamsAlertTypeStreamLiveNotifications V3PolicyNewParamsAlertType = "stream_live_notifications"
+ V3PolicyNewParamsAlertTypeTunnelHealthEvent V3PolicyNewParamsAlertType = "tunnel_health_event"
+ V3PolicyNewParamsAlertTypeTunnelUpdateEvent V3PolicyNewParamsAlertType = "tunnel_update_event"
+ V3PolicyNewParamsAlertTypeUniversalSSLEventType V3PolicyNewParamsAlertType = "universal_ssl_event_type"
+ V3PolicyNewParamsAlertTypeWebAnalyticsMetricsUpdate V3PolicyNewParamsAlertType = "web_analytics_metrics_update"
+ V3PolicyNewParamsAlertTypeZoneAopCustomCertificateExpirationType V3PolicyNewParamsAlertType = "zone_aop_custom_certificate_expiration_type"
+)
+
+type V3PolicyNewParamsMechanisms struct {
+ // UUID
+ ID param.Field[V3PolicyNewParamsMechanismsID] `json:"id"`
+}
+
+func (r V3PolicyNewParamsMechanisms) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// UUID
+//
+// Satisfied by [shared.UnionString], [shared.UnionString].
+type V3PolicyNewParamsMechanismsID interface {
+ ImplementsAlertingV3PolicyNewParamsMechanismsID()
+}
+
+// Optional filters that allow you to be alerted only on a subset of events for
+// that alert type based on some criteria. This is only available for select alert
+// types. See alert type documentation for more details.
+type V3PolicyNewParamsFilters struct {
+ // Usage depends on specific alert type
+ Actions param.Field[[]string] `json:"actions"`
+ // Used for configuring radar_notification
+ AffectedASNs param.Field[[]string] `json:"affected_asns"`
+ // Used for configuring incident_alert
+ AffectedComponents param.Field[[]string] `json:"affected_components"`
+ // Used for configuring radar_notification
+ AffectedLocations param.Field[[]string] `json:"affected_locations"`
+ // Used for configuring maintenance_event_notification
+ AirportCode param.Field[[]string] `json:"airport_code"`
+ // Usage depends on specific alert type
+ AlertTriggerPreferences param.Field[[]string] `json:"alert_trigger_preferences"`
+ // Used for configuring magic_tunnel_health_check_event
+ AlertTriggerPreferencesValue param.Field[[]V3PolicyNewParamsFiltersAlertTriggerPreferencesValue] `json:"alert_trigger_preferences_value"`
+ // Used for configuring load_balancing_pool_enablement_alert
+ Enabled param.Field[[]string] `json:"enabled"`
+ // Used for configuring pages_event_alert
+ Environment param.Field[[]string] `json:"environment"`
+ // Used for configuring pages_event_alert
+ Event param.Field[[]string] `json:"event"`
+ // Used for configuring load_balancing_health_alert
+ EventSource param.Field[[]string] `json:"event_source"`
+ // Usage depends on specific alert type
+ EventType param.Field[[]string] `json:"event_type"`
+ // Usage depends on specific alert type
+ GroupBy param.Field[[]string] `json:"group_by"`
+ // Used for configuring health_check_status_notification
+ HealthCheckID param.Field[[]string] `json:"health_check_id"`
+ // Used for configuring incident_alert
+ IncidentImpact param.Field[[]V3PolicyNewParamsFiltersIncidentImpact] `json:"incident_impact"`
+ // Used for configuring stream_live_notifications
+ InputID param.Field[[]string] `json:"input_id"`
+ // Used for configuring billing_usage_alert
+ Limit param.Field[[]string] `json:"limit"`
+ // Used for configuring logo_match_alert
+ LogoTag param.Field[[]string] `json:"logo_tag"`
+ // Used for configuring advanced_ddos_attack_l4_alert
+ MegabitsPerSecond param.Field[[]string] `json:"megabits_per_second"`
+ // Used for configuring load_balancing_health_alert
+ NewHealth param.Field[[]string] `json:"new_health"`
+ // Used for configuring tunnel_health_event
+ NewStatus param.Field[[]string] `json:"new_status"`
+ // Used for configuring advanced_ddos_attack_l4_alert
+ PacketsPerSecond param.Field[[]string] `json:"packets_per_second"`
+ // Usage depends on specific alert type
+ PoolID param.Field[[]string] `json:"pool_id"`
+ // Used for configuring billing_usage_alert
+ Product param.Field[[]string] `json:"product"`
+ // Used for configuring pages_event_alert
+ ProjectID param.Field[[]string] `json:"project_id"`
+ // Used for configuring advanced_ddos_attack_l4_alert
+ Protocol param.Field[[]string] `json:"protocol"`
+ // Usage depends on specific alert type
+ QueryTag param.Field[[]string] `json:"query_tag"`
+ // Used for configuring advanced_ddos_attack_l7_alert
+ RequestsPerSecond param.Field[[]string] `json:"requests_per_second"`
+ // Usage depends on specific alert type
+ Selectors param.Field[[]string] `json:"selectors"`
+ // Used for configuring clickhouse_alert_fw_ent_anomaly
+ Services param.Field[[]string] `json:"services"`
+ // Usage depends on specific alert type
+ Slo param.Field[[]string] `json:"slo"`
+ // Used for configuring health_check_status_notification
+ Status param.Field[[]string] `json:"status"`
+ // Used for configuring advanced_ddos_attack_l7_alert
+ TargetHostname param.Field[[]string] `json:"target_hostname"`
+ // Used for configuring advanced_ddos_attack_l4_alert
+ TargetIP param.Field[[]string] `json:"target_ip"`
+ // Used for configuring advanced_ddos_attack_l7_alert
+ TargetZoneName param.Field[[]string] `json:"target_zone_name"`
+ // Used for configuring traffic_anomalies_alert
+ TrafficExclusions param.Field[[]V3PolicyNewParamsFiltersTrafficExclusion] `json:"traffic_exclusions"`
+ // Used for configuring tunnel_health_event
+ TunnelID param.Field[[]string] `json:"tunnel_id"`
+ // Used for configuring magic_tunnel_health_check_event
+ TunnelName param.Field[[]string] `json:"tunnel_name"`
+ // Usage depends on specific alert type
+ Where param.Field[[]string] `json:"where"`
+ // Usage depends on specific alert type
+ Zones param.Field[[]string] `json:"zones"`
+}
+
+func (r V3PolicyNewParamsFilters) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type V3PolicyNewParamsFiltersAlertTriggerPreferencesValue string
+
+const (
+ V3PolicyNewParamsFiltersAlertTriggerPreferencesValue99_0 V3PolicyNewParamsFiltersAlertTriggerPreferencesValue = "99.0"
+ V3PolicyNewParamsFiltersAlertTriggerPreferencesValue98_0 V3PolicyNewParamsFiltersAlertTriggerPreferencesValue = "98.0"
+ V3PolicyNewParamsFiltersAlertTriggerPreferencesValue97_0 V3PolicyNewParamsFiltersAlertTriggerPreferencesValue = "97.0"
+)
+
+type V3PolicyNewParamsFiltersIncidentImpact string
+
+const (
+ V3PolicyNewParamsFiltersIncidentImpactIncidentImpactNone V3PolicyNewParamsFiltersIncidentImpact = "INCIDENT_IMPACT_NONE"
+ V3PolicyNewParamsFiltersIncidentImpactIncidentImpactMinor V3PolicyNewParamsFiltersIncidentImpact = "INCIDENT_IMPACT_MINOR"
+ V3PolicyNewParamsFiltersIncidentImpactIncidentImpactMajor V3PolicyNewParamsFiltersIncidentImpact = "INCIDENT_IMPACT_MAJOR"
+ V3PolicyNewParamsFiltersIncidentImpactIncidentImpactCritical V3PolicyNewParamsFiltersIncidentImpact = "INCIDENT_IMPACT_CRITICAL"
+)
+
+type V3PolicyNewParamsFiltersTrafficExclusion string
+
+const (
+ V3PolicyNewParamsFiltersTrafficExclusionSecurityEvents V3PolicyNewParamsFiltersTrafficExclusion = "security_events"
+)
+
+type V3PolicyNewResponseEnvelope struct {
+ Errors []V3PolicyNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []V3PolicyNewResponseEnvelopeMessages `json:"messages,required"`
+ Result V3PolicyNewResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success V3PolicyNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON v3PolicyNewResponseEnvelopeJSON `json:"-"`
+}
+
+// v3PolicyNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [V3PolicyNewResponseEnvelope]
+type v3PolicyNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V3PolicyNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v3PolicyNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type V3PolicyNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON v3PolicyNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// v3PolicyNewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [V3PolicyNewResponseEnvelopeErrors]
+type v3PolicyNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V3PolicyNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v3PolicyNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type V3PolicyNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON v3PolicyNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// v3PolicyNewResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [V3PolicyNewResponseEnvelopeMessages]
+type v3PolicyNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V3PolicyNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v3PolicyNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type V3PolicyNewResponseEnvelopeSuccess bool
+
+const (
+ V3PolicyNewResponseEnvelopeSuccessTrue V3PolicyNewResponseEnvelopeSuccess = true
+)
+
+type V3PolicyUpdateParams struct {
+ // The account id
+ AccountID param.Field[string] `path:"account_id,required"`
+ // Refers to which event will trigger a Notification dispatch. You can use the
+ // endpoint to get available alert types which then will give you a list of
+ // possible values.
+ AlertType param.Field[V3PolicyUpdateParamsAlertType] `json:"alert_type"`
+ // Optional description for the Notification policy.
+ Description param.Field[string] `json:"description"`
+ // Whether or not the Notification policy is enabled.
+ Enabled param.Field[bool] `json:"enabled"`
+ // Optional filters that allow you to be alerted only on a subset of events for
+ // that alert type based on some criteria. This is only available for select alert
+ // types. See alert type documentation for more details.
+ Filters param.Field[V3PolicyUpdateParamsFilters] `json:"filters"`
+ // List of IDs that will be used when dispatching a notification. IDs for email
+ // type will be the email address.
+ Mechanisms param.Field[map[string][]V3PolicyUpdateParamsMechanisms] `json:"mechanisms"`
+ // Name of the policy.
+ Name param.Field[string] `json:"name"`
+}
+
+func (r V3PolicyUpdateParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Refers to which event will trigger a Notification dispatch. You can use the
+// endpoint to get available alert types which then will give you a list of
+// possible values.
+type V3PolicyUpdateParamsAlertType string
+
+const (
+ V3PolicyUpdateParamsAlertTypeAccessCustomCertificateExpirationType V3PolicyUpdateParamsAlertType = "access_custom_certificate_expiration_type"
+ V3PolicyUpdateParamsAlertTypeAdvancedDDOSAttackL4Alert V3PolicyUpdateParamsAlertType = "advanced_ddos_attack_l4_alert"
+ V3PolicyUpdateParamsAlertTypeAdvancedDDOSAttackL7Alert V3PolicyUpdateParamsAlertType = "advanced_ddos_attack_l7_alert"
+ V3PolicyUpdateParamsAlertTypeAdvancedHTTPAlertError V3PolicyUpdateParamsAlertType = "advanced_http_alert_error"
+ V3PolicyUpdateParamsAlertTypeBGPHijackNotification V3PolicyUpdateParamsAlertType = "bgp_hijack_notification"
+ V3PolicyUpdateParamsAlertTypeBillingUsageAlert V3PolicyUpdateParamsAlertType = "billing_usage_alert"
+ V3PolicyUpdateParamsAlertTypeBlockNotificationBlockRemoved V3PolicyUpdateParamsAlertType = "block_notification_block_removed"
+ V3PolicyUpdateParamsAlertTypeBlockNotificationNewBlock V3PolicyUpdateParamsAlertType = "block_notification_new_block"
+ V3PolicyUpdateParamsAlertTypeBlockNotificationReviewRejected V3PolicyUpdateParamsAlertType = "block_notification_review_rejected"
+ V3PolicyUpdateParamsAlertTypeBrandProtectionAlert V3PolicyUpdateParamsAlertType = "brand_protection_alert"
+ V3PolicyUpdateParamsAlertTypeBrandProtectionDigest V3PolicyUpdateParamsAlertType = "brand_protection_digest"
+ V3PolicyUpdateParamsAlertTypeClickhouseAlertFwAnomaly V3PolicyUpdateParamsAlertType = "clickhouse_alert_fw_anomaly"
+ V3PolicyUpdateParamsAlertTypeClickhouseAlertFwEntAnomaly V3PolicyUpdateParamsAlertType = "clickhouse_alert_fw_ent_anomaly"
+ V3PolicyUpdateParamsAlertTypeCustomSSLCertificateEventType V3PolicyUpdateParamsAlertType = "custom_ssl_certificate_event_type"
+ V3PolicyUpdateParamsAlertTypeDedicatedSSLCertificateEventType V3PolicyUpdateParamsAlertType = "dedicated_ssl_certificate_event_type"
+ V3PolicyUpdateParamsAlertTypeDosAttackL4 V3PolicyUpdateParamsAlertType = "dos_attack_l4"
+ V3PolicyUpdateParamsAlertTypeDosAttackL7 V3PolicyUpdateParamsAlertType = "dos_attack_l7"
+ V3PolicyUpdateParamsAlertTypeExpiringServiceTokenAlert V3PolicyUpdateParamsAlertType = "expiring_service_token_alert"
+ V3PolicyUpdateParamsAlertTypeFailingLogpushJobDisabledAlert V3PolicyUpdateParamsAlertType = "failing_logpush_job_disabled_alert"
+ V3PolicyUpdateParamsAlertTypeFbmAutoAdvertisement V3PolicyUpdateParamsAlertType = "fbm_auto_advertisement"
+ V3PolicyUpdateParamsAlertTypeFbmDosdAttack V3PolicyUpdateParamsAlertType = "fbm_dosd_attack"
+ V3PolicyUpdateParamsAlertTypeFbmVolumetricAttack V3PolicyUpdateParamsAlertType = "fbm_volumetric_attack"
+ V3PolicyUpdateParamsAlertTypeHealthCheckStatusNotification V3PolicyUpdateParamsAlertType = "health_check_status_notification"
+ V3PolicyUpdateParamsAlertTypeHostnameAopCustomCertificateExpirationType V3PolicyUpdateParamsAlertType = "hostname_aop_custom_certificate_expiration_type"
+ V3PolicyUpdateParamsAlertTypeHTTPAlertEdgeError V3PolicyUpdateParamsAlertType = "http_alert_edge_error"
+ V3PolicyUpdateParamsAlertTypeHTTPAlertOriginError V3PolicyUpdateParamsAlertType = "http_alert_origin_error"
+ V3PolicyUpdateParamsAlertTypeIncidentAlert V3PolicyUpdateParamsAlertType = "incident_alert"
+ V3PolicyUpdateParamsAlertTypeLoadBalancingHealthAlert V3PolicyUpdateParamsAlertType = "load_balancing_health_alert"
+ V3PolicyUpdateParamsAlertTypeLoadBalancingPoolEnablementAlert V3PolicyUpdateParamsAlertType = "load_balancing_pool_enablement_alert"
+ V3PolicyUpdateParamsAlertTypeLogoMatchAlert V3PolicyUpdateParamsAlertType = "logo_match_alert"
+ V3PolicyUpdateParamsAlertTypeMagicTunnelHealthCheckEvent V3PolicyUpdateParamsAlertType = "magic_tunnel_health_check_event"
+ V3PolicyUpdateParamsAlertTypeMaintenanceEventNotification V3PolicyUpdateParamsAlertType = "maintenance_event_notification"
+ V3PolicyUpdateParamsAlertTypeMTLSCertificateStoreCertificateExpirationType V3PolicyUpdateParamsAlertType = "mtls_certificate_store_certificate_expiration_type"
+ V3PolicyUpdateParamsAlertTypePagesEventAlert V3PolicyUpdateParamsAlertType = "pages_event_alert"
+ V3PolicyUpdateParamsAlertTypeRadarNotification V3PolicyUpdateParamsAlertType = "radar_notification"
+ V3PolicyUpdateParamsAlertTypeRealOriginMonitoring V3PolicyUpdateParamsAlertType = "real_origin_monitoring"
+ V3PolicyUpdateParamsAlertTypeScriptmonitorAlertNewCodeChangeDetections V3PolicyUpdateParamsAlertType = "scriptmonitor_alert_new_code_change_detections"
+ V3PolicyUpdateParamsAlertTypeScriptmonitorAlertNewHosts V3PolicyUpdateParamsAlertType = "scriptmonitor_alert_new_hosts"
+ V3PolicyUpdateParamsAlertTypeScriptmonitorAlertNewMaliciousHosts V3PolicyUpdateParamsAlertType = "scriptmonitor_alert_new_malicious_hosts"
+ V3PolicyUpdateParamsAlertTypeScriptmonitorAlertNewMaliciousScripts V3PolicyUpdateParamsAlertType = "scriptmonitor_alert_new_malicious_scripts"
+ V3PolicyUpdateParamsAlertTypeScriptmonitorAlertNewMaliciousURL V3PolicyUpdateParamsAlertType = "scriptmonitor_alert_new_malicious_url"
+ V3PolicyUpdateParamsAlertTypeScriptmonitorAlertNewMaxLengthResourceURL V3PolicyUpdateParamsAlertType = "scriptmonitor_alert_new_max_length_resource_url"
+ V3PolicyUpdateParamsAlertTypeScriptmonitorAlertNewResources V3PolicyUpdateParamsAlertType = "scriptmonitor_alert_new_resources"
+ V3PolicyUpdateParamsAlertTypeSecondaryDNSAllPrimariesFailing V3PolicyUpdateParamsAlertType = "secondary_dns_all_primaries_failing"
+ V3PolicyUpdateParamsAlertTypeSecondaryDNSPrimariesFailing V3PolicyUpdateParamsAlertType = "secondary_dns_primaries_failing"
+ V3PolicyUpdateParamsAlertTypeSecondaryDNSZoneSuccessfullyUpdated V3PolicyUpdateParamsAlertType = "secondary_dns_zone_successfully_updated"
+ V3PolicyUpdateParamsAlertTypeSecondaryDNSZoneValidationWarning V3PolicyUpdateParamsAlertType = "secondary_dns_zone_validation_warning"
+ V3PolicyUpdateParamsAlertTypeSentinelAlert V3PolicyUpdateParamsAlertType = "sentinel_alert"
+ V3PolicyUpdateParamsAlertTypeStreamLiveNotifications V3PolicyUpdateParamsAlertType = "stream_live_notifications"
+ V3PolicyUpdateParamsAlertTypeTunnelHealthEvent V3PolicyUpdateParamsAlertType = "tunnel_health_event"
+ V3PolicyUpdateParamsAlertTypeTunnelUpdateEvent V3PolicyUpdateParamsAlertType = "tunnel_update_event"
+ V3PolicyUpdateParamsAlertTypeUniversalSSLEventType V3PolicyUpdateParamsAlertType = "universal_ssl_event_type"
+ V3PolicyUpdateParamsAlertTypeWebAnalyticsMetricsUpdate V3PolicyUpdateParamsAlertType = "web_analytics_metrics_update"
+ V3PolicyUpdateParamsAlertTypeZoneAopCustomCertificateExpirationType V3PolicyUpdateParamsAlertType = "zone_aop_custom_certificate_expiration_type"
+)
+
+// Optional filters that allow you to be alerted only on a subset of events for
+// that alert type based on some criteria. This is only available for select alert
+// types. See alert type documentation for more details.
+type V3PolicyUpdateParamsFilters struct {
+ // Usage depends on specific alert type
+ Actions param.Field[[]string] `json:"actions"`
+ // Used for configuring radar_notification
+ AffectedASNs param.Field[[]string] `json:"affected_asns"`
+ // Used for configuring incident_alert
+ AffectedComponents param.Field[[]string] `json:"affected_components"`
+ // Used for configuring radar_notification
+ AffectedLocations param.Field[[]string] `json:"affected_locations"`
+ // Used for configuring maintenance_event_notification
+ AirportCode param.Field[[]string] `json:"airport_code"`
+ // Usage depends on specific alert type
+ AlertTriggerPreferences param.Field[[]string] `json:"alert_trigger_preferences"`
+ // Used for configuring magic_tunnel_health_check_event
+ AlertTriggerPreferencesValue param.Field[[]V3PolicyUpdateParamsFiltersAlertTriggerPreferencesValue] `json:"alert_trigger_preferences_value"`
+ // Used for configuring load_balancing_pool_enablement_alert
+ Enabled param.Field[[]string] `json:"enabled"`
+ // Used for configuring pages_event_alert
+ Environment param.Field[[]string] `json:"environment"`
+ // Used for configuring pages_event_alert
+ Event param.Field[[]string] `json:"event"`
+ // Used for configuring load_balancing_health_alert
+ EventSource param.Field[[]string] `json:"event_source"`
+ // Usage depends on specific alert type
+ EventType param.Field[[]string] `json:"event_type"`
+ // Usage depends on specific alert type
+ GroupBy param.Field[[]string] `json:"group_by"`
+ // Used for configuring health_check_status_notification
+ HealthCheckID param.Field[[]string] `json:"health_check_id"`
+ // Used for configuring incident_alert
+ IncidentImpact param.Field[[]V3PolicyUpdateParamsFiltersIncidentImpact] `json:"incident_impact"`
+ // Used for configuring stream_live_notifications
+ InputID param.Field[[]string] `json:"input_id"`
+ // Used for configuring billing_usage_alert
+ Limit param.Field[[]string] `json:"limit"`
+ // Used for configuring logo_match_alert
+ LogoTag param.Field[[]string] `json:"logo_tag"`
+ // Used for configuring advanced_ddos_attack_l4_alert
+ MegabitsPerSecond param.Field[[]string] `json:"megabits_per_second"`
+ // Used for configuring load_balancing_health_alert
+ NewHealth param.Field[[]string] `json:"new_health"`
+ // Used for configuring tunnel_health_event
+ NewStatus param.Field[[]string] `json:"new_status"`
+ // Used for configuring advanced_ddos_attack_l4_alert
+ PacketsPerSecond param.Field[[]string] `json:"packets_per_second"`
+ // Usage depends on specific alert type
+ PoolID param.Field[[]string] `json:"pool_id"`
+ // Used for configuring billing_usage_alert
+ Product param.Field[[]string] `json:"product"`
+ // Used for configuring pages_event_alert
+ ProjectID param.Field[[]string] `json:"project_id"`
+ // Used for configuring advanced_ddos_attack_l4_alert
+ Protocol param.Field[[]string] `json:"protocol"`
+ // Usage depends on specific alert type
+ QueryTag param.Field[[]string] `json:"query_tag"`
+ // Used for configuring advanced_ddos_attack_l7_alert
+ RequestsPerSecond param.Field[[]string] `json:"requests_per_second"`
+ // Usage depends on specific alert type
+ Selectors param.Field[[]string] `json:"selectors"`
+ // Used for configuring clickhouse_alert_fw_ent_anomaly
+ Services param.Field[[]string] `json:"services"`
+ // Usage depends on specific alert type
+ Slo param.Field[[]string] `json:"slo"`
+ // Used for configuring health_check_status_notification
+ Status param.Field[[]string] `json:"status"`
+ // Used for configuring advanced_ddos_attack_l7_alert
+ TargetHostname param.Field[[]string] `json:"target_hostname"`
+ // Used for configuring advanced_ddos_attack_l4_alert
+ TargetIP param.Field[[]string] `json:"target_ip"`
+ // Used for configuring advanced_ddos_attack_l7_alert
+ TargetZoneName param.Field[[]string] `json:"target_zone_name"`
+ // Used for configuring traffic_anomalies_alert
+ TrafficExclusions param.Field[[]V3PolicyUpdateParamsFiltersTrafficExclusion] `json:"traffic_exclusions"`
+ // Used for configuring tunnel_health_event
+ TunnelID param.Field[[]string] `json:"tunnel_id"`
+ // Used for configuring magic_tunnel_health_check_event
+ TunnelName param.Field[[]string] `json:"tunnel_name"`
+ // Usage depends on specific alert type
+ Where param.Field[[]string] `json:"where"`
+ // Usage depends on specific alert type
+ Zones param.Field[[]string] `json:"zones"`
+}
+
+func (r V3PolicyUpdateParamsFilters) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type V3PolicyUpdateParamsFiltersAlertTriggerPreferencesValue string
+
+const (
+ V3PolicyUpdateParamsFiltersAlertTriggerPreferencesValue99_0 V3PolicyUpdateParamsFiltersAlertTriggerPreferencesValue = "99.0"
+ V3PolicyUpdateParamsFiltersAlertTriggerPreferencesValue98_0 V3PolicyUpdateParamsFiltersAlertTriggerPreferencesValue = "98.0"
+ V3PolicyUpdateParamsFiltersAlertTriggerPreferencesValue97_0 V3PolicyUpdateParamsFiltersAlertTriggerPreferencesValue = "97.0"
+)
+
+type V3PolicyUpdateParamsFiltersIncidentImpact string
+
+const (
+ V3PolicyUpdateParamsFiltersIncidentImpactIncidentImpactNone V3PolicyUpdateParamsFiltersIncidentImpact = "INCIDENT_IMPACT_NONE"
+ V3PolicyUpdateParamsFiltersIncidentImpactIncidentImpactMinor V3PolicyUpdateParamsFiltersIncidentImpact = "INCIDENT_IMPACT_MINOR"
+ V3PolicyUpdateParamsFiltersIncidentImpactIncidentImpactMajor V3PolicyUpdateParamsFiltersIncidentImpact = "INCIDENT_IMPACT_MAJOR"
+ V3PolicyUpdateParamsFiltersIncidentImpactIncidentImpactCritical V3PolicyUpdateParamsFiltersIncidentImpact = "INCIDENT_IMPACT_CRITICAL"
+)
+
+type V3PolicyUpdateParamsFiltersTrafficExclusion string
+
+const (
+ V3PolicyUpdateParamsFiltersTrafficExclusionSecurityEvents V3PolicyUpdateParamsFiltersTrafficExclusion = "security_events"
+)
+
+type V3PolicyUpdateParamsMechanisms struct {
+ // UUID
+ ID param.Field[V3PolicyUpdateParamsMechanismsID] `json:"id"`
+}
+
+func (r V3PolicyUpdateParamsMechanisms) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// UUID
+//
+// Satisfied by [shared.UnionString], [shared.UnionString].
+type V3PolicyUpdateParamsMechanismsID interface {
+ ImplementsAlertingV3PolicyUpdateParamsMechanismsID()
+}
+
+type V3PolicyUpdateResponseEnvelope struct {
+ Errors []V3PolicyUpdateResponseEnvelopeErrors `json:"errors,required"`
+ Messages []V3PolicyUpdateResponseEnvelopeMessages `json:"messages,required"`
+ Result V3PolicyUpdateResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success V3PolicyUpdateResponseEnvelopeSuccess `json:"success,required"`
+ JSON v3PolicyUpdateResponseEnvelopeJSON `json:"-"`
+}
+
+// v3PolicyUpdateResponseEnvelopeJSON contains the JSON metadata for the struct
+// [V3PolicyUpdateResponseEnvelope]
+type v3PolicyUpdateResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V3PolicyUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v3PolicyUpdateResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type V3PolicyUpdateResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON v3PolicyUpdateResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// v3PolicyUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [V3PolicyUpdateResponseEnvelopeErrors]
+type v3PolicyUpdateResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V3PolicyUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v3PolicyUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type V3PolicyUpdateResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON v3PolicyUpdateResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// v3PolicyUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [V3PolicyUpdateResponseEnvelopeMessages]
+type v3PolicyUpdateResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V3PolicyUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v3PolicyUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type V3PolicyUpdateResponseEnvelopeSuccess bool
+
+const (
+ V3PolicyUpdateResponseEnvelopeSuccessTrue V3PolicyUpdateResponseEnvelopeSuccess = true
+)
+
+type V3PolicyListParams struct {
+ // The account id
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type V3PolicyListResponseEnvelope struct {
+ Errors []V3PolicyListResponseEnvelopeErrors `json:"errors,required"`
+ Messages []V3PolicyListResponseEnvelopeMessages `json:"messages,required"`
+ Result []AaaPolicies `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success V3PolicyListResponseEnvelopeSuccess `json:"success,required"`
+ ResultInfo V3PolicyListResponseEnvelopeResultInfo `json:"result_info"`
+ JSON v3PolicyListResponseEnvelopeJSON `json:"-"`
+}
+
+// v3PolicyListResponseEnvelopeJSON contains the JSON metadata for the struct
+// [V3PolicyListResponseEnvelope]
+type v3PolicyListResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ ResultInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V3PolicyListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v3PolicyListResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type V3PolicyListResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON v3PolicyListResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// v3PolicyListResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [V3PolicyListResponseEnvelopeErrors]
+type v3PolicyListResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V3PolicyListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v3PolicyListResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type V3PolicyListResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON v3PolicyListResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// v3PolicyListResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [V3PolicyListResponseEnvelopeMessages]
+type v3PolicyListResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V3PolicyListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v3PolicyListResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type V3PolicyListResponseEnvelopeSuccess bool
+
+const (
+ V3PolicyListResponseEnvelopeSuccessTrue V3PolicyListResponseEnvelopeSuccess = true
+)
+
+type V3PolicyListResponseEnvelopeResultInfo struct {
+ // Total number of results for the requested service
+ Count float64 `json:"count"`
+ // Current page within paginated list of results
+ Page float64 `json:"page"`
+ // Number of results per page of results
+ PerPage float64 `json:"per_page"`
+ // Total results available without any search parameters
+ TotalCount float64 `json:"total_count"`
+ JSON v3PolicyListResponseEnvelopeResultInfoJSON `json:"-"`
+}
+
+// v3PolicyListResponseEnvelopeResultInfoJSON contains the JSON metadata for the
+// struct [V3PolicyListResponseEnvelopeResultInfo]
+type v3PolicyListResponseEnvelopeResultInfoJSON struct {
+ Count apijson.Field
+ Page apijson.Field
+ PerPage apijson.Field
+ TotalCount apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V3PolicyListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v3PolicyListResponseEnvelopeResultInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type V3PolicyDeleteParams struct {
+ // The account id
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type V3PolicyDeleteResponseEnvelope struct {
+ Errors []V3PolicyDeleteResponseEnvelopeErrors `json:"errors,required"`
+ Messages []V3PolicyDeleteResponseEnvelopeMessages `json:"messages,required"`
+ Result V3PolicyDeleteResponse `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success V3PolicyDeleteResponseEnvelopeSuccess `json:"success,required"`
+ ResultInfo V3PolicyDeleteResponseEnvelopeResultInfo `json:"result_info"`
+ JSON v3PolicyDeleteResponseEnvelopeJSON `json:"-"`
+}
+
+// v3PolicyDeleteResponseEnvelopeJSON contains the JSON metadata for the struct
+// [V3PolicyDeleteResponseEnvelope]
+type v3PolicyDeleteResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ ResultInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V3PolicyDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v3PolicyDeleteResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type V3PolicyDeleteResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON v3PolicyDeleteResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// v3PolicyDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [V3PolicyDeleteResponseEnvelopeErrors]
+type v3PolicyDeleteResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V3PolicyDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v3PolicyDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type V3PolicyDeleteResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON v3PolicyDeleteResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// v3PolicyDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [V3PolicyDeleteResponseEnvelopeMessages]
+type v3PolicyDeleteResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V3PolicyDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v3PolicyDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type V3PolicyDeleteResponseEnvelopeSuccess bool
+
+const (
+ V3PolicyDeleteResponseEnvelopeSuccessTrue V3PolicyDeleteResponseEnvelopeSuccess = true
+)
+
+type V3PolicyDeleteResponseEnvelopeResultInfo struct {
+ // Total number of results for the requested service
+ Count float64 `json:"count"`
+ // Current page within paginated list of results
+ Page float64 `json:"page"`
+ // Number of results per page of results
+ PerPage float64 `json:"per_page"`
+ // Total results available without any search parameters
+ TotalCount float64 `json:"total_count"`
+ JSON v3PolicyDeleteResponseEnvelopeResultInfoJSON `json:"-"`
+}
+
+// v3PolicyDeleteResponseEnvelopeResultInfoJSON contains the JSON metadata for the
+// struct [V3PolicyDeleteResponseEnvelopeResultInfo]
+type v3PolicyDeleteResponseEnvelopeResultInfoJSON struct {
+ Count apijson.Field
+ Page apijson.Field
+ PerPage apijson.Field
+ TotalCount apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V3PolicyDeleteResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v3PolicyDeleteResponseEnvelopeResultInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type V3PolicyGetParams struct {
+ // The account id
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type V3PolicyGetResponseEnvelope struct {
+ Errors []V3PolicyGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []V3PolicyGetResponseEnvelopeMessages `json:"messages,required"`
+ Result AaaPolicies `json:"result,required"`
+ // Whether the API call was successful
+ Success V3PolicyGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON v3PolicyGetResponseEnvelopeJSON `json:"-"`
+}
+
+// v3PolicyGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [V3PolicyGetResponseEnvelope]
+type v3PolicyGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V3PolicyGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v3PolicyGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type V3PolicyGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON v3PolicyGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// v3PolicyGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [V3PolicyGetResponseEnvelopeErrors]
+type v3PolicyGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V3PolicyGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v3PolicyGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type V3PolicyGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON v3PolicyGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// v3PolicyGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [V3PolicyGetResponseEnvelopeMessages]
+type v3PolicyGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V3PolicyGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v3PolicyGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type V3PolicyGetResponseEnvelopeSuccess bool
+
+const (
+ V3PolicyGetResponseEnvelopeSuccessTrue V3PolicyGetResponseEnvelopeSuccess = true
+)
diff --git a/alerting/v3policy_test.go b/alerting/v3policy_test.go
new file mode 100644
index 00000000000..f44df185b77
--- /dev/null
+++ b/alerting/v3policy_test.go
@@ -0,0 +1,272 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package alerting_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/alerting"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestV3PolicyNewWithOptionalParams(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"),
+ )
+ _, err := client.Alerting.V3.Policies.New(context.TODO(), alerting.V3PolicyNewParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ AlertType: cloudflare.F(alerting.V3PolicyNewParamsAlertTypeUniversalSSLEventType),
+ Enabled: cloudflare.F(true),
+ Mechanisms: cloudflare.F(map[string][]alerting.V3PolicyNewParamsMechanisms{
+ "email": {{
+ ID: cloudflare.F[alerting.V3PolicyNewParamsMechanismsID](shared.UnionString("test@example.com")),
+ }},
+ "pagerduty": {{
+ ID: cloudflare.F[alerting.V3PolicyNewParamsMechanismsID](shared.UnionString("e8133a15-00a4-4d69-aec1-32f70c51f6e5")),
+ }},
+ "webhooks": {{
+ ID: cloudflare.F[alerting.V3PolicyNewParamsMechanismsID](shared.UnionString("14cc1190-5d2b-4b98-a696-c424cb2ad05f")),
+ }},
+ }),
+ Name: cloudflare.F("SSL Notification Event Policy"),
+ Description: cloudflare.F("Something describing the policy."),
+ Filters: cloudflare.F(alerting.V3PolicyNewParamsFilters{
+ Actions: cloudflare.F([]string{"string", "string", "string"}),
+ AffectedASNs: cloudflare.F([]string{"string", "string", "string"}),
+ AffectedComponents: cloudflare.F([]string{"string", "string", "string"}),
+ AffectedLocations: cloudflare.F([]string{"string", "string", "string"}),
+ AirportCode: cloudflare.F([]string{"string", "string", "string"}),
+ AlertTriggerPreferences: cloudflare.F([]string{"string", "string", "string"}),
+ AlertTriggerPreferencesValue: cloudflare.F([]alerting.V3PolicyNewParamsFiltersAlertTriggerPreferencesValue{alerting.V3PolicyNewParamsFiltersAlertTriggerPreferencesValue99_0, alerting.V3PolicyNewParamsFiltersAlertTriggerPreferencesValue98_0, alerting.V3PolicyNewParamsFiltersAlertTriggerPreferencesValue97_0}),
+ Enabled: cloudflare.F([]string{"string", "string", "string"}),
+ Environment: cloudflare.F([]string{"string", "string", "string"}),
+ Event: cloudflare.F([]string{"string", "string", "string"}),
+ EventSource: cloudflare.F([]string{"string", "string", "string"}),
+ EventType: cloudflare.F([]string{"string", "string", "string"}),
+ GroupBy: cloudflare.F([]string{"string", "string", "string"}),
+ HealthCheckID: cloudflare.F([]string{"string", "string", "string"}),
+ IncidentImpact: cloudflare.F([]alerting.V3PolicyNewParamsFiltersIncidentImpact{alerting.V3PolicyNewParamsFiltersIncidentImpactIncidentImpactNone, alerting.V3PolicyNewParamsFiltersIncidentImpactIncidentImpactMinor, alerting.V3PolicyNewParamsFiltersIncidentImpactIncidentImpactMajor}),
+ InputID: cloudflare.F([]string{"string", "string", "string"}),
+ Limit: cloudflare.F([]string{"string", "string", "string"}),
+ LogoTag: cloudflare.F([]string{"string", "string", "string"}),
+ MegabitsPerSecond: cloudflare.F([]string{"string", "string", "string"}),
+ NewHealth: cloudflare.F([]string{"string", "string", "string"}),
+ NewStatus: cloudflare.F([]string{"string", "string", "string"}),
+ PacketsPerSecond: cloudflare.F([]string{"string", "string", "string"}),
+ PoolID: cloudflare.F([]string{"string", "string", "string"}),
+ Product: cloudflare.F([]string{"string", "string", "string"}),
+ ProjectID: cloudflare.F([]string{"string", "string", "string"}),
+ Protocol: cloudflare.F([]string{"string", "string", "string"}),
+ QueryTag: cloudflare.F([]string{"string", "string", "string"}),
+ RequestsPerSecond: cloudflare.F([]string{"string", "string", "string"}),
+ Selectors: cloudflare.F([]string{"string", "string", "string"}),
+ Services: cloudflare.F([]string{"string", "string", "string"}),
+ Slo: cloudflare.F([]string{"99.9"}),
+ Status: cloudflare.F([]string{"string", "string", "string"}),
+ TargetHostname: cloudflare.F([]string{"string", "string", "string"}),
+ TargetIP: cloudflare.F([]string{"string", "string", "string"}),
+ TargetZoneName: cloudflare.F([]string{"string", "string", "string"}),
+ TrafficExclusions: cloudflare.F([]alerting.V3PolicyNewParamsFiltersTrafficExclusion{alerting.V3PolicyNewParamsFiltersTrafficExclusionSecurityEvents}),
+ TunnelID: cloudflare.F([]string{"string", "string", "string"}),
+ TunnelName: cloudflare.F([]string{"string", "string", "string"}),
+ Where: cloudflare.F([]string{"string", "string", "string"}),
+ Zones: 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())
+ }
+}
+
+func TestV3PolicyUpdateWithOptionalParams(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"),
+ )
+ _, err := client.Alerting.V3.Policies.Update(
+ context.TODO(),
+ "0da2b59e-f118-439d-8097-bdfb215203c9",
+ alerting.V3PolicyUpdateParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ AlertType: cloudflare.F(alerting.V3PolicyUpdateParamsAlertTypeUniversalSSLEventType),
+ Description: cloudflare.F("Something describing the policy."),
+ Enabled: cloudflare.F(true),
+ Filters: cloudflare.F(alerting.V3PolicyUpdateParamsFilters{
+ Actions: cloudflare.F([]string{"string", "string", "string"}),
+ AffectedASNs: cloudflare.F([]string{"string", "string", "string"}),
+ AffectedComponents: cloudflare.F([]string{"string", "string", "string"}),
+ AffectedLocations: cloudflare.F([]string{"string", "string", "string"}),
+ AirportCode: cloudflare.F([]string{"string", "string", "string"}),
+ AlertTriggerPreferences: cloudflare.F([]string{"string", "string", "string"}),
+ AlertTriggerPreferencesValue: cloudflare.F([]alerting.V3PolicyUpdateParamsFiltersAlertTriggerPreferencesValue{alerting.V3PolicyUpdateParamsFiltersAlertTriggerPreferencesValue99_0, alerting.V3PolicyUpdateParamsFiltersAlertTriggerPreferencesValue98_0, alerting.V3PolicyUpdateParamsFiltersAlertTriggerPreferencesValue97_0}),
+ Enabled: cloudflare.F([]string{"string", "string", "string"}),
+ Environment: cloudflare.F([]string{"string", "string", "string"}),
+ Event: cloudflare.F([]string{"string", "string", "string"}),
+ EventSource: cloudflare.F([]string{"string", "string", "string"}),
+ EventType: cloudflare.F([]string{"string", "string", "string"}),
+ GroupBy: cloudflare.F([]string{"string", "string", "string"}),
+ HealthCheckID: cloudflare.F([]string{"string", "string", "string"}),
+ IncidentImpact: cloudflare.F([]alerting.V3PolicyUpdateParamsFiltersIncidentImpact{alerting.V3PolicyUpdateParamsFiltersIncidentImpactIncidentImpactNone, alerting.V3PolicyUpdateParamsFiltersIncidentImpactIncidentImpactMinor, alerting.V3PolicyUpdateParamsFiltersIncidentImpactIncidentImpactMajor}),
+ InputID: cloudflare.F([]string{"string", "string", "string"}),
+ Limit: cloudflare.F([]string{"string", "string", "string"}),
+ LogoTag: cloudflare.F([]string{"string", "string", "string"}),
+ MegabitsPerSecond: cloudflare.F([]string{"string", "string", "string"}),
+ NewHealth: cloudflare.F([]string{"string", "string", "string"}),
+ NewStatus: cloudflare.F([]string{"string", "string", "string"}),
+ PacketsPerSecond: cloudflare.F([]string{"string", "string", "string"}),
+ PoolID: cloudflare.F([]string{"string", "string", "string"}),
+ Product: cloudflare.F([]string{"string", "string", "string"}),
+ ProjectID: cloudflare.F([]string{"string", "string", "string"}),
+ Protocol: cloudflare.F([]string{"string", "string", "string"}),
+ QueryTag: cloudflare.F([]string{"string", "string", "string"}),
+ RequestsPerSecond: cloudflare.F([]string{"string", "string", "string"}),
+ Selectors: cloudflare.F([]string{"string", "string", "string"}),
+ Services: cloudflare.F([]string{"string", "string", "string"}),
+ Slo: cloudflare.F([]string{"99.9"}),
+ Status: cloudflare.F([]string{"string", "string", "string"}),
+ TargetHostname: cloudflare.F([]string{"string", "string", "string"}),
+ TargetIP: cloudflare.F([]string{"string", "string", "string"}),
+ TargetZoneName: cloudflare.F([]string{"string", "string", "string"}),
+ TrafficExclusions: cloudflare.F([]alerting.V3PolicyUpdateParamsFiltersTrafficExclusion{alerting.V3PolicyUpdateParamsFiltersTrafficExclusionSecurityEvents}),
+ TunnelID: cloudflare.F([]string{"string", "string", "string"}),
+ TunnelName: cloudflare.F([]string{"string", "string", "string"}),
+ Where: cloudflare.F([]string{"string", "string", "string"}),
+ Zones: cloudflare.F([]string{"string", "string", "string"}),
+ }),
+ Mechanisms: cloudflare.F(map[string][]alerting.V3PolicyUpdateParamsMechanisms{
+ "email": {{
+ ID: cloudflare.F[alerting.V3PolicyUpdateParamsMechanismsID](shared.UnionString("test@example.com")),
+ }},
+ "pagerduty": {{
+ ID: cloudflare.F[alerting.V3PolicyUpdateParamsMechanismsID](shared.UnionString("e8133a15-00a4-4d69-aec1-32f70c51f6e5")),
+ }},
+ "webhooks": {{
+ ID: cloudflare.F[alerting.V3PolicyUpdateParamsMechanismsID](shared.UnionString("14cc1190-5d2b-4b98-a696-c424cb2ad05f")),
+ }},
+ }),
+ Name: cloudflare.F("SSL Notification Event Policy"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestV3PolicyList(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"),
+ )
+ _, err := client.Alerting.V3.Policies.List(context.TODO(), alerting.V3PolicyListParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ })
+ 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())
+ }
+}
+
+func TestV3PolicyDelete(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"),
+ )
+ _, err := client.Alerting.V3.Policies.Delete(
+ context.TODO(),
+ "0da2b59e-f118-439d-8097-bdfb215203c9",
+ alerting.V3PolicyDeleteParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestV3PolicyGet(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"),
+ )
+ _, err := client.Alerting.V3.Policies.Get(
+ context.TODO(),
+ "0da2b59e-f118-439d-8097-bdfb215203c9",
+ alerting.V3PolicyGetParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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/alertingv3.go b/alertingv3.go
deleted file mode 100644
index a7ac2880c93..00000000000
--- a/alertingv3.go
+++ /dev/null
@@ -1,197 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "reflect"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/option"
- "github.com/tidwall/gjson"
-)
-
-// AlertingV3Service contains methods and other services that help with interacting
-// with the cloudflare API. Note, unlike clients, this service does not read
-// variables from the environment automatically. You should not instantiate this
-// service directly, and instead use the [NewAlertingV3Service] method instead.
-type AlertingV3Service struct {
- Options []option.RequestOption
- Destinations *AlertingV3DestinationService
- Histories *AlertingV3HistoryService
- Policies *AlertingV3PolicyService
-}
-
-// NewAlertingV3Service generates a new service that applies the given options to
-// each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewAlertingV3Service(opts ...option.RequestOption) (r *AlertingV3Service) {
- r = &AlertingV3Service{}
- r.Options = opts
- r.Destinations = NewAlertingV3DestinationService(opts...)
- r.Histories = NewAlertingV3HistoryService(opts...)
- r.Policies = NewAlertingV3PolicyService(opts...)
- return
-}
-
-// Gets a list of all alert types for which an account is eligible.
-func (r *AlertingV3Service) List(ctx context.Context, query AlertingV3ListParams, opts ...option.RequestOption) (res *AlertingV3ListResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env AlertingV3ListResponseEnvelope
- path := fmt.Sprintf("accounts/%s/alerting/v3/available_alerts", query.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Union satisfied by [AlertingV3ListResponseUnknown],
-// [AlertingV3ListResponseArray] or [shared.UnionString].
-type AlertingV3ListResponse interface {
- ImplementsAlertingV3ListResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*AlertingV3ListResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(AlertingV3ListResponseArray{}),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-type AlertingV3ListResponseArray []interface{}
-
-func (r AlertingV3ListResponseArray) ImplementsAlertingV3ListResponse() {}
-
-type AlertingV3ListParams struct {
- // The account id
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type AlertingV3ListResponseEnvelope struct {
- Errors []AlertingV3ListResponseEnvelopeErrors `json:"errors,required"`
- Messages []AlertingV3ListResponseEnvelopeMessages `json:"messages,required"`
- Result AlertingV3ListResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success AlertingV3ListResponseEnvelopeSuccess `json:"success,required"`
- ResultInfo AlertingV3ListResponseEnvelopeResultInfo `json:"result_info"`
- JSON alertingV3ListResponseEnvelopeJSON `json:"-"`
-}
-
-// alertingV3ListResponseEnvelopeJSON contains the JSON metadata for the struct
-// [AlertingV3ListResponseEnvelope]
-type alertingV3ListResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- ResultInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AlertingV3ListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r alertingV3ListResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type AlertingV3ListResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON alertingV3ListResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// alertingV3ListResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [AlertingV3ListResponseEnvelopeErrors]
-type alertingV3ListResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AlertingV3ListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r alertingV3ListResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type AlertingV3ListResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON alertingV3ListResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// alertingV3ListResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [AlertingV3ListResponseEnvelopeMessages]
-type alertingV3ListResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AlertingV3ListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r alertingV3ListResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type AlertingV3ListResponseEnvelopeSuccess bool
-
-const (
- AlertingV3ListResponseEnvelopeSuccessTrue AlertingV3ListResponseEnvelopeSuccess = true
-)
-
-type AlertingV3ListResponseEnvelopeResultInfo struct {
- // Total number of results for the requested service
- Count float64 `json:"count"`
- // Current page within paginated list of results
- Page float64 `json:"page"`
- // Number of results per page of results
- PerPage float64 `json:"per_page"`
- // Total results available without any search parameters
- TotalCount float64 `json:"total_count"`
- JSON alertingV3ListResponseEnvelopeResultInfoJSON `json:"-"`
-}
-
-// alertingV3ListResponseEnvelopeResultInfoJSON contains the JSON metadata for the
-// struct [AlertingV3ListResponseEnvelopeResultInfo]
-type alertingV3ListResponseEnvelopeResultInfoJSON struct {
- Count apijson.Field
- Page apijson.Field
- PerPage apijson.Field
- TotalCount apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AlertingV3ListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r alertingV3ListResponseEnvelopeResultInfoJSON) RawJSON() string {
- return r.raw
-}
diff --git a/alertingv3_test.go b/alertingv3_test.go
deleted file mode 100644
index 392e7721989..00000000000
--- a/alertingv3_test.go
+++ /dev/null
@@ -1,40 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestAlertingV3List(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"),
- )
- _, err := client.Alerting.V3.List(context.TODO(), cloudflare.AlertingV3ListParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- })
- 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/alertingv3destination.go b/alertingv3destination.go
deleted file mode 100644
index d57b5c0f7b5..00000000000
--- a/alertingv3destination.go
+++ /dev/null
@@ -1,31 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// AlertingV3DestinationService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewAlertingV3DestinationService]
-// method instead.
-type AlertingV3DestinationService struct {
- Options []option.RequestOption
- Eligible *AlertingV3DestinationEligibleService
- Pagerduty *AlertingV3DestinationPagerdutyService
- Webhooks *AlertingV3DestinationWebhookService
-}
-
-// NewAlertingV3DestinationService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewAlertingV3DestinationService(opts ...option.RequestOption) (r *AlertingV3DestinationService) {
- r = &AlertingV3DestinationService{}
- r.Options = opts
- r.Eligible = NewAlertingV3DestinationEligibleService(opts...)
- r.Pagerduty = NewAlertingV3DestinationPagerdutyService(opts...)
- r.Webhooks = NewAlertingV3DestinationWebhookService(opts...)
- return
-}
diff --git a/alertingv3destinationeligible.go b/alertingv3destinationeligible.go
deleted file mode 100644
index 851d00de1a3..00000000000
--- a/alertingv3destinationeligible.go
+++ /dev/null
@@ -1,195 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "reflect"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/option"
- "github.com/tidwall/gjson"
-)
-
-// AlertingV3DestinationEligibleService contains methods and other services that
-// help with interacting with the cloudflare API. Note, unlike clients, this
-// service does not read variables from the environment automatically. You should
-// not instantiate this service directly, and instead use the
-// [NewAlertingV3DestinationEligibleService] method instead.
-type AlertingV3DestinationEligibleService struct {
- Options []option.RequestOption
-}
-
-// NewAlertingV3DestinationEligibleService generates a new service that applies the
-// given options to each request. These options are applied after the parent
-// client's options (if there is one), and before any request-specific options.
-func NewAlertingV3DestinationEligibleService(opts ...option.RequestOption) (r *AlertingV3DestinationEligibleService) {
- r = &AlertingV3DestinationEligibleService{}
- r.Options = opts
- return
-}
-
-// Get a list of all delivery mechanism types for which an account is eligible.
-func (r *AlertingV3DestinationEligibleService) Get(ctx context.Context, query AlertingV3DestinationEligibleGetParams, opts ...option.RequestOption) (res *AlertingV3DestinationEligibleGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env AlertingV3DestinationEligibleGetResponseEnvelope
- path := fmt.Sprintf("accounts/%s/alerting/v3/destinations/eligible", query.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Union satisfied by [AlertingV3DestinationEligibleGetResponseUnknown],
-// [AlertingV3DestinationEligibleGetResponseArray] or [shared.UnionString].
-type AlertingV3DestinationEligibleGetResponse interface {
- ImplementsAlertingV3DestinationEligibleGetResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*AlertingV3DestinationEligibleGetResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(AlertingV3DestinationEligibleGetResponseArray{}),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-type AlertingV3DestinationEligibleGetResponseArray []interface{}
-
-func (r AlertingV3DestinationEligibleGetResponseArray) ImplementsAlertingV3DestinationEligibleGetResponse() {
-}
-
-type AlertingV3DestinationEligibleGetParams struct {
- // The account id
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type AlertingV3DestinationEligibleGetResponseEnvelope struct {
- Errors []AlertingV3DestinationEligibleGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []AlertingV3DestinationEligibleGetResponseEnvelopeMessages `json:"messages,required"`
- Result AlertingV3DestinationEligibleGetResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success AlertingV3DestinationEligibleGetResponseEnvelopeSuccess `json:"success,required"`
- ResultInfo AlertingV3DestinationEligibleGetResponseEnvelopeResultInfo `json:"result_info"`
- JSON alertingV3DestinationEligibleGetResponseEnvelopeJSON `json:"-"`
-}
-
-// alertingV3DestinationEligibleGetResponseEnvelopeJSON contains the JSON metadata
-// for the struct [AlertingV3DestinationEligibleGetResponseEnvelope]
-type alertingV3DestinationEligibleGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- ResultInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AlertingV3DestinationEligibleGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r alertingV3DestinationEligibleGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type AlertingV3DestinationEligibleGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON alertingV3DestinationEligibleGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// alertingV3DestinationEligibleGetResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct [AlertingV3DestinationEligibleGetResponseEnvelopeErrors]
-type alertingV3DestinationEligibleGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AlertingV3DestinationEligibleGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r alertingV3DestinationEligibleGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type AlertingV3DestinationEligibleGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON alertingV3DestinationEligibleGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// alertingV3DestinationEligibleGetResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct
-// [AlertingV3DestinationEligibleGetResponseEnvelopeMessages]
-type alertingV3DestinationEligibleGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AlertingV3DestinationEligibleGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r alertingV3DestinationEligibleGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type AlertingV3DestinationEligibleGetResponseEnvelopeSuccess bool
-
-const (
- AlertingV3DestinationEligibleGetResponseEnvelopeSuccessTrue AlertingV3DestinationEligibleGetResponseEnvelopeSuccess = true
-)
-
-type AlertingV3DestinationEligibleGetResponseEnvelopeResultInfo struct {
- // Total number of results for the requested service
- Count float64 `json:"count"`
- // Current page within paginated list of results
- Page float64 `json:"page"`
- // Number of results per page of results
- PerPage float64 `json:"per_page"`
- // Total results available without any search parameters
- TotalCount float64 `json:"total_count"`
- JSON alertingV3DestinationEligibleGetResponseEnvelopeResultInfoJSON `json:"-"`
-}
-
-// alertingV3DestinationEligibleGetResponseEnvelopeResultInfoJSON contains the JSON
-// metadata for the struct
-// [AlertingV3DestinationEligibleGetResponseEnvelopeResultInfo]
-type alertingV3DestinationEligibleGetResponseEnvelopeResultInfoJSON struct {
- Count apijson.Field
- Page apijson.Field
- PerPage apijson.Field
- TotalCount apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AlertingV3DestinationEligibleGetResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r alertingV3DestinationEligibleGetResponseEnvelopeResultInfoJSON) RawJSON() string {
- return r.raw
-}
diff --git a/alertingv3destinationeligible_test.go b/alertingv3destinationeligible_test.go
deleted file mode 100644
index c4f991dcd43..00000000000
--- a/alertingv3destinationeligible_test.go
+++ /dev/null
@@ -1,40 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestAlertingV3DestinationEligibleGet(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"),
- )
- _, err := client.Alerting.V3.Destinations.Eligible.Get(context.TODO(), cloudflare.AlertingV3DestinationEligibleGetParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- })
- 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/alertingv3destinationpagerduty.go b/alertingv3destinationpagerduty.go
deleted file mode 100644
index 8c049cce1b2..00000000000
--- a/alertingv3destinationpagerduty.go
+++ /dev/null
@@ -1,602 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "reflect"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/option"
- "github.com/tidwall/gjson"
-)
-
-// AlertingV3DestinationPagerdutyService contains methods and other services that
-// help with interacting with the cloudflare API. Note, unlike clients, this
-// service does not read variables from the environment automatically. You should
-// not instantiate this service directly, and instead use the
-// [NewAlertingV3DestinationPagerdutyService] method instead.
-type AlertingV3DestinationPagerdutyService struct {
- Options []option.RequestOption
-}
-
-// NewAlertingV3DestinationPagerdutyService generates a new service that applies
-// the given options to each request. These options are applied after the parent
-// client's options (if there is one), and before any request-specific options.
-func NewAlertingV3DestinationPagerdutyService(opts ...option.RequestOption) (r *AlertingV3DestinationPagerdutyService) {
- r = &AlertingV3DestinationPagerdutyService{}
- r.Options = opts
- return
-}
-
-// Creates a new token for integrating with PagerDuty.
-func (r *AlertingV3DestinationPagerdutyService) New(ctx context.Context, body AlertingV3DestinationPagerdutyNewParams, opts ...option.RequestOption) (res *AlertingV3DestinationPagerdutyNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env AlertingV3DestinationPagerdutyNewResponseEnvelope
- path := fmt.Sprintf("accounts/%s/alerting/v3/destinations/pagerduty/connect", body.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Deletes all the PagerDuty Services connected to the account.
-func (r *AlertingV3DestinationPagerdutyService) Delete(ctx context.Context, body AlertingV3DestinationPagerdutyDeleteParams, opts ...option.RequestOption) (res *AlertingV3DestinationPagerdutyDeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env AlertingV3DestinationPagerdutyDeleteResponseEnvelope
- path := fmt.Sprintf("accounts/%s/alerting/v3/destinations/pagerduty", body.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Get a list of all configured PagerDuty services.
-func (r *AlertingV3DestinationPagerdutyService) Get(ctx context.Context, query AlertingV3DestinationPagerdutyGetParams, opts ...option.RequestOption) (res *[]AlertingV3DestinationPagerdutyGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env AlertingV3DestinationPagerdutyGetResponseEnvelope
- path := fmt.Sprintf("accounts/%s/alerting/v3/destinations/pagerduty", query.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Links PagerDuty with the account using the integration token.
-func (r *AlertingV3DestinationPagerdutyService) Link(ctx context.Context, tokenID string, query AlertingV3DestinationPagerdutyLinkParams, opts ...option.RequestOption) (res *AlertingV3DestinationPagerdutyLinkResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env AlertingV3DestinationPagerdutyLinkResponseEnvelope
- path := fmt.Sprintf("accounts/%s/alerting/v3/destinations/pagerduty/connect/%s", query.AccountID, tokenID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type AlertingV3DestinationPagerdutyNewResponse struct {
- // UUID
- ID string `json:"id"`
- JSON alertingV3DestinationPagerdutyNewResponseJSON `json:"-"`
-}
-
-// alertingV3DestinationPagerdutyNewResponseJSON contains the JSON metadata for the
-// struct [AlertingV3DestinationPagerdutyNewResponse]
-type alertingV3DestinationPagerdutyNewResponseJSON struct {
- ID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AlertingV3DestinationPagerdutyNewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r alertingV3DestinationPagerdutyNewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// Union satisfied by [AlertingV3DestinationPagerdutyDeleteResponseUnknown],
-// [AlertingV3DestinationPagerdutyDeleteResponseArray] or [shared.UnionString].
-type AlertingV3DestinationPagerdutyDeleteResponse interface {
- ImplementsAlertingV3DestinationPagerdutyDeleteResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*AlertingV3DestinationPagerdutyDeleteResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(AlertingV3DestinationPagerdutyDeleteResponseArray{}),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-type AlertingV3DestinationPagerdutyDeleteResponseArray []interface{}
-
-func (r AlertingV3DestinationPagerdutyDeleteResponseArray) ImplementsAlertingV3DestinationPagerdutyDeleteResponse() {
-}
-
-type AlertingV3DestinationPagerdutyGetResponse struct {
- // UUID
- ID string `json:"id"`
- // The name of the pagerduty service.
- Name string `json:"name"`
- JSON alertingV3DestinationPagerdutyGetResponseJSON `json:"-"`
-}
-
-// alertingV3DestinationPagerdutyGetResponseJSON contains the JSON metadata for the
-// struct [AlertingV3DestinationPagerdutyGetResponse]
-type alertingV3DestinationPagerdutyGetResponseJSON struct {
- ID apijson.Field
- Name apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AlertingV3DestinationPagerdutyGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r alertingV3DestinationPagerdutyGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type AlertingV3DestinationPagerdutyLinkResponse struct {
- // UUID
- ID string `json:"id"`
- JSON alertingV3DestinationPagerdutyLinkResponseJSON `json:"-"`
-}
-
-// alertingV3DestinationPagerdutyLinkResponseJSON contains the JSON metadata for
-// the struct [AlertingV3DestinationPagerdutyLinkResponse]
-type alertingV3DestinationPagerdutyLinkResponseJSON struct {
- ID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AlertingV3DestinationPagerdutyLinkResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r alertingV3DestinationPagerdutyLinkResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type AlertingV3DestinationPagerdutyNewParams struct {
- // The account id
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type AlertingV3DestinationPagerdutyNewResponseEnvelope struct {
- Errors []AlertingV3DestinationPagerdutyNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []AlertingV3DestinationPagerdutyNewResponseEnvelopeMessages `json:"messages,required"`
- Result AlertingV3DestinationPagerdutyNewResponse `json:"result,required"`
- // Whether the API call was successful
- Success AlertingV3DestinationPagerdutyNewResponseEnvelopeSuccess `json:"success,required"`
- JSON alertingV3DestinationPagerdutyNewResponseEnvelopeJSON `json:"-"`
-}
-
-// alertingV3DestinationPagerdutyNewResponseEnvelopeJSON contains the JSON metadata
-// for the struct [AlertingV3DestinationPagerdutyNewResponseEnvelope]
-type alertingV3DestinationPagerdutyNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AlertingV3DestinationPagerdutyNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r alertingV3DestinationPagerdutyNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type AlertingV3DestinationPagerdutyNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON alertingV3DestinationPagerdutyNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// alertingV3DestinationPagerdutyNewResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct
-// [AlertingV3DestinationPagerdutyNewResponseEnvelopeErrors]
-type alertingV3DestinationPagerdutyNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AlertingV3DestinationPagerdutyNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r alertingV3DestinationPagerdutyNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type AlertingV3DestinationPagerdutyNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON alertingV3DestinationPagerdutyNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// alertingV3DestinationPagerdutyNewResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct
-// [AlertingV3DestinationPagerdutyNewResponseEnvelopeMessages]
-type alertingV3DestinationPagerdutyNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AlertingV3DestinationPagerdutyNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r alertingV3DestinationPagerdutyNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type AlertingV3DestinationPagerdutyNewResponseEnvelopeSuccess bool
-
-const (
- AlertingV3DestinationPagerdutyNewResponseEnvelopeSuccessTrue AlertingV3DestinationPagerdutyNewResponseEnvelopeSuccess = true
-)
-
-type AlertingV3DestinationPagerdutyDeleteParams struct {
- // The account id
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type AlertingV3DestinationPagerdutyDeleteResponseEnvelope struct {
- Errors []AlertingV3DestinationPagerdutyDeleteResponseEnvelopeErrors `json:"errors,required"`
- Messages []AlertingV3DestinationPagerdutyDeleteResponseEnvelopeMessages `json:"messages,required"`
- Result AlertingV3DestinationPagerdutyDeleteResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success AlertingV3DestinationPagerdutyDeleteResponseEnvelopeSuccess `json:"success,required"`
- ResultInfo AlertingV3DestinationPagerdutyDeleteResponseEnvelopeResultInfo `json:"result_info"`
- JSON alertingV3DestinationPagerdutyDeleteResponseEnvelopeJSON `json:"-"`
-}
-
-// alertingV3DestinationPagerdutyDeleteResponseEnvelopeJSON contains the JSON
-// metadata for the struct [AlertingV3DestinationPagerdutyDeleteResponseEnvelope]
-type alertingV3DestinationPagerdutyDeleteResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- ResultInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AlertingV3DestinationPagerdutyDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r alertingV3DestinationPagerdutyDeleteResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type AlertingV3DestinationPagerdutyDeleteResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON alertingV3DestinationPagerdutyDeleteResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// alertingV3DestinationPagerdutyDeleteResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct
-// [AlertingV3DestinationPagerdutyDeleteResponseEnvelopeErrors]
-type alertingV3DestinationPagerdutyDeleteResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AlertingV3DestinationPagerdutyDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r alertingV3DestinationPagerdutyDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type AlertingV3DestinationPagerdutyDeleteResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON alertingV3DestinationPagerdutyDeleteResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// alertingV3DestinationPagerdutyDeleteResponseEnvelopeMessagesJSON contains the
-// JSON metadata for the struct
-// [AlertingV3DestinationPagerdutyDeleteResponseEnvelopeMessages]
-type alertingV3DestinationPagerdutyDeleteResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AlertingV3DestinationPagerdutyDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r alertingV3DestinationPagerdutyDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type AlertingV3DestinationPagerdutyDeleteResponseEnvelopeSuccess bool
-
-const (
- AlertingV3DestinationPagerdutyDeleteResponseEnvelopeSuccessTrue AlertingV3DestinationPagerdutyDeleteResponseEnvelopeSuccess = true
-)
-
-type AlertingV3DestinationPagerdutyDeleteResponseEnvelopeResultInfo struct {
- // Total number of results for the requested service
- Count float64 `json:"count"`
- // Current page within paginated list of results
- Page float64 `json:"page"`
- // Number of results per page of results
- PerPage float64 `json:"per_page"`
- // Total results available without any search parameters
- TotalCount float64 `json:"total_count"`
- JSON alertingV3DestinationPagerdutyDeleteResponseEnvelopeResultInfoJSON `json:"-"`
-}
-
-// alertingV3DestinationPagerdutyDeleteResponseEnvelopeResultInfoJSON contains the
-// JSON metadata for the struct
-// [AlertingV3DestinationPagerdutyDeleteResponseEnvelopeResultInfo]
-type alertingV3DestinationPagerdutyDeleteResponseEnvelopeResultInfoJSON struct {
- Count apijson.Field
- Page apijson.Field
- PerPage apijson.Field
- TotalCount apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AlertingV3DestinationPagerdutyDeleteResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r alertingV3DestinationPagerdutyDeleteResponseEnvelopeResultInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type AlertingV3DestinationPagerdutyGetParams struct {
- // The account id
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type AlertingV3DestinationPagerdutyGetResponseEnvelope struct {
- Errors []AlertingV3DestinationPagerdutyGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []AlertingV3DestinationPagerdutyGetResponseEnvelopeMessages `json:"messages,required"`
- Result []AlertingV3DestinationPagerdutyGetResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success AlertingV3DestinationPagerdutyGetResponseEnvelopeSuccess `json:"success,required"`
- ResultInfo AlertingV3DestinationPagerdutyGetResponseEnvelopeResultInfo `json:"result_info"`
- JSON alertingV3DestinationPagerdutyGetResponseEnvelopeJSON `json:"-"`
-}
-
-// alertingV3DestinationPagerdutyGetResponseEnvelopeJSON contains the JSON metadata
-// for the struct [AlertingV3DestinationPagerdutyGetResponseEnvelope]
-type alertingV3DestinationPagerdutyGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- ResultInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AlertingV3DestinationPagerdutyGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r alertingV3DestinationPagerdutyGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type AlertingV3DestinationPagerdutyGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON alertingV3DestinationPagerdutyGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// alertingV3DestinationPagerdutyGetResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct
-// [AlertingV3DestinationPagerdutyGetResponseEnvelopeErrors]
-type alertingV3DestinationPagerdutyGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AlertingV3DestinationPagerdutyGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r alertingV3DestinationPagerdutyGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type AlertingV3DestinationPagerdutyGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON alertingV3DestinationPagerdutyGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// alertingV3DestinationPagerdutyGetResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct
-// [AlertingV3DestinationPagerdutyGetResponseEnvelopeMessages]
-type alertingV3DestinationPagerdutyGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AlertingV3DestinationPagerdutyGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r alertingV3DestinationPagerdutyGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type AlertingV3DestinationPagerdutyGetResponseEnvelopeSuccess bool
-
-const (
- AlertingV3DestinationPagerdutyGetResponseEnvelopeSuccessTrue AlertingV3DestinationPagerdutyGetResponseEnvelopeSuccess = true
-)
-
-type AlertingV3DestinationPagerdutyGetResponseEnvelopeResultInfo struct {
- // Total number of results for the requested service
- Count float64 `json:"count"`
- // Current page within paginated list of results
- Page float64 `json:"page"`
- // Number of results per page of results
- PerPage float64 `json:"per_page"`
- // Total results available without any search parameters
- TotalCount float64 `json:"total_count"`
- JSON alertingV3DestinationPagerdutyGetResponseEnvelopeResultInfoJSON `json:"-"`
-}
-
-// alertingV3DestinationPagerdutyGetResponseEnvelopeResultInfoJSON contains the
-// JSON metadata for the struct
-// [AlertingV3DestinationPagerdutyGetResponseEnvelopeResultInfo]
-type alertingV3DestinationPagerdutyGetResponseEnvelopeResultInfoJSON struct {
- Count apijson.Field
- Page apijson.Field
- PerPage apijson.Field
- TotalCount apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AlertingV3DestinationPagerdutyGetResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r alertingV3DestinationPagerdutyGetResponseEnvelopeResultInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type AlertingV3DestinationPagerdutyLinkParams struct {
- // The account id
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type AlertingV3DestinationPagerdutyLinkResponseEnvelope struct {
- Errors []AlertingV3DestinationPagerdutyLinkResponseEnvelopeErrors `json:"errors,required"`
- Messages []AlertingV3DestinationPagerdutyLinkResponseEnvelopeMessages `json:"messages,required"`
- Result AlertingV3DestinationPagerdutyLinkResponse `json:"result,required"`
- // Whether the API call was successful
- Success AlertingV3DestinationPagerdutyLinkResponseEnvelopeSuccess `json:"success,required"`
- JSON alertingV3DestinationPagerdutyLinkResponseEnvelopeJSON `json:"-"`
-}
-
-// alertingV3DestinationPagerdutyLinkResponseEnvelopeJSON contains the JSON
-// metadata for the struct [AlertingV3DestinationPagerdutyLinkResponseEnvelope]
-type alertingV3DestinationPagerdutyLinkResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AlertingV3DestinationPagerdutyLinkResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r alertingV3DestinationPagerdutyLinkResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type AlertingV3DestinationPagerdutyLinkResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON alertingV3DestinationPagerdutyLinkResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// alertingV3DestinationPagerdutyLinkResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct
-// [AlertingV3DestinationPagerdutyLinkResponseEnvelopeErrors]
-type alertingV3DestinationPagerdutyLinkResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AlertingV3DestinationPagerdutyLinkResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r alertingV3DestinationPagerdutyLinkResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type AlertingV3DestinationPagerdutyLinkResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON alertingV3DestinationPagerdutyLinkResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// alertingV3DestinationPagerdutyLinkResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct
-// [AlertingV3DestinationPagerdutyLinkResponseEnvelopeMessages]
-type alertingV3DestinationPagerdutyLinkResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AlertingV3DestinationPagerdutyLinkResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r alertingV3DestinationPagerdutyLinkResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type AlertingV3DestinationPagerdutyLinkResponseEnvelopeSuccess bool
-
-const (
- AlertingV3DestinationPagerdutyLinkResponseEnvelopeSuccessTrue AlertingV3DestinationPagerdutyLinkResponseEnvelopeSuccess = true
-)
diff --git a/alertingv3destinationpagerduty_test.go b/alertingv3destinationpagerduty_test.go
deleted file mode 100644
index 5d562425b72..00000000000
--- a/alertingv3destinationpagerduty_test.go
+++ /dev/null
@@ -1,122 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestAlertingV3DestinationPagerdutyNew(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"),
- )
- _, err := client.Alerting.V3.Destinations.Pagerduty.New(context.TODO(), cloudflare.AlertingV3DestinationPagerdutyNewParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- })
- 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())
- }
-}
-
-func TestAlertingV3DestinationPagerdutyDelete(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"),
- )
- _, err := client.Alerting.V3.Destinations.Pagerduty.Delete(context.TODO(), cloudflare.AlertingV3DestinationPagerdutyDeleteParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- })
- 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())
- }
-}
-
-func TestAlertingV3DestinationPagerdutyGet(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"),
- )
- _, err := client.Alerting.V3.Destinations.Pagerduty.Get(context.TODO(), cloudflare.AlertingV3DestinationPagerdutyGetParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- })
- 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())
- }
-}
-
-func TestAlertingV3DestinationPagerdutyLink(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"),
- )
- _, err := client.Alerting.V3.Destinations.Pagerduty.Link(
- context.TODO(),
- "8c71e667571b4f61b94d9e4b12158038",
- cloudflare.AlertingV3DestinationPagerdutyLinkParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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/alertingv3destinationwebhook.go b/alertingv3destinationwebhook.go
deleted file mode 100644
index 159cf2cdfbd..00000000000
--- a/alertingv3destinationwebhook.go
+++ /dev/null
@@ -1,816 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "reflect"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/option"
- "github.com/tidwall/gjson"
-)
-
-// AlertingV3DestinationWebhookService contains methods and other services that
-// help with interacting with the cloudflare API. Note, unlike clients, this
-// service does not read variables from the environment automatically. You should
-// not instantiate this service directly, and instead use the
-// [NewAlertingV3DestinationWebhookService] method instead.
-type AlertingV3DestinationWebhookService struct {
- Options []option.RequestOption
-}
-
-// NewAlertingV3DestinationWebhookService generates a new service that applies the
-// given options to each request. These options are applied after the parent
-// client's options (if there is one), and before any request-specific options.
-func NewAlertingV3DestinationWebhookService(opts ...option.RequestOption) (r *AlertingV3DestinationWebhookService) {
- r = &AlertingV3DestinationWebhookService{}
- r.Options = opts
- return
-}
-
-// Creates a new webhook destination.
-func (r *AlertingV3DestinationWebhookService) New(ctx context.Context, params AlertingV3DestinationWebhookNewParams, opts ...option.RequestOption) (res *AlertingV3DestinationWebhookNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env AlertingV3DestinationWebhookNewResponseEnvelope
- path := fmt.Sprintf("accounts/%s/alerting/v3/destinations/webhooks", params.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Update a webhook destination.
-func (r *AlertingV3DestinationWebhookService) Update(ctx context.Context, webhookID string, params AlertingV3DestinationWebhookUpdateParams, opts ...option.RequestOption) (res *AlertingV3DestinationWebhookUpdateResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env AlertingV3DestinationWebhookUpdateResponseEnvelope
- path := fmt.Sprintf("accounts/%s/alerting/v3/destinations/webhooks/%s", params.AccountID, webhookID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Gets a list of all configured webhook destinations.
-func (r *AlertingV3DestinationWebhookService) List(ctx context.Context, query AlertingV3DestinationWebhookListParams, opts ...option.RequestOption) (res *[]AlertingV3DestinationWebhookListResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env AlertingV3DestinationWebhookListResponseEnvelope
- path := fmt.Sprintf("accounts/%s/alerting/v3/destinations/webhooks", query.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Delete a configured webhook destination.
-func (r *AlertingV3DestinationWebhookService) Delete(ctx context.Context, webhookID string, body AlertingV3DestinationWebhookDeleteParams, opts ...option.RequestOption) (res *AlertingV3DestinationWebhookDeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env AlertingV3DestinationWebhookDeleteResponseEnvelope
- path := fmt.Sprintf("accounts/%s/alerting/v3/destinations/webhooks/%s", body.AccountID, webhookID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Get details for a single webhooks destination.
-func (r *AlertingV3DestinationWebhookService) Get(ctx context.Context, webhookID string, query AlertingV3DestinationWebhookGetParams, opts ...option.RequestOption) (res *AlertingV3DestinationWebhookGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env AlertingV3DestinationWebhookGetResponseEnvelope
- path := fmt.Sprintf("accounts/%s/alerting/v3/destinations/webhooks/%s", query.AccountID, webhookID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type AlertingV3DestinationWebhookNewResponse struct {
- // UUID
- ID string `json:"id"`
- JSON alertingV3DestinationWebhookNewResponseJSON `json:"-"`
-}
-
-// alertingV3DestinationWebhookNewResponseJSON contains the JSON metadata for the
-// struct [AlertingV3DestinationWebhookNewResponse]
-type alertingV3DestinationWebhookNewResponseJSON struct {
- ID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AlertingV3DestinationWebhookNewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r alertingV3DestinationWebhookNewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type AlertingV3DestinationWebhookUpdateResponse struct {
- // UUID
- ID string `json:"id"`
- JSON alertingV3DestinationWebhookUpdateResponseJSON `json:"-"`
-}
-
-// alertingV3DestinationWebhookUpdateResponseJSON contains the JSON metadata for
-// the struct [AlertingV3DestinationWebhookUpdateResponse]
-type alertingV3DestinationWebhookUpdateResponseJSON struct {
- ID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AlertingV3DestinationWebhookUpdateResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r alertingV3DestinationWebhookUpdateResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type AlertingV3DestinationWebhookListResponse struct {
- // The unique identifier of a webhook
- ID string `json:"id"`
- // Timestamp of when the webhook destination was created.
- CreatedAt time.Time `json:"created_at" format:"date-time"`
- // Timestamp of the last time an attempt to dispatch a notification to this webhook
- // failed.
- LastFailure time.Time `json:"last_failure" format:"date-time"`
- // Timestamp of the last time Cloudflare was able to successfully dispatch a
- // notification using this webhook.
- LastSuccess time.Time `json:"last_success" format:"date-time"`
- // The name of the webhook destination. This will be included in the request body
- // when you receive a webhook notification.
- Name string `json:"name"`
- // Optional secret that will be passed in the `cf-webhook-auth` header when
- // dispatching generic webhook notifications or formatted for supported
- // destinations. Secrets are not returned in any API response body.
- Secret string `json:"secret"`
- // Type of webhook endpoint.
- Type AlertingV3DestinationWebhookListResponseType `json:"type"`
- // The POST endpoint to call when dispatching a notification.
- URL string `json:"url"`
- JSON alertingV3DestinationWebhookListResponseJSON `json:"-"`
-}
-
-// alertingV3DestinationWebhookListResponseJSON contains the JSON metadata for the
-// struct [AlertingV3DestinationWebhookListResponse]
-type alertingV3DestinationWebhookListResponseJSON struct {
- ID apijson.Field
- CreatedAt apijson.Field
- LastFailure apijson.Field
- LastSuccess apijson.Field
- Name apijson.Field
- Secret apijson.Field
- Type apijson.Field
- URL apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AlertingV3DestinationWebhookListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r alertingV3DestinationWebhookListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// Type of webhook endpoint.
-type AlertingV3DestinationWebhookListResponseType string
-
-const (
- AlertingV3DestinationWebhookListResponseTypeSlack AlertingV3DestinationWebhookListResponseType = "slack"
- AlertingV3DestinationWebhookListResponseTypeGeneric AlertingV3DestinationWebhookListResponseType = "generic"
- AlertingV3DestinationWebhookListResponseTypeGchat AlertingV3DestinationWebhookListResponseType = "gchat"
-)
-
-// Union satisfied by [AlertingV3DestinationWebhookDeleteResponseUnknown],
-// [AlertingV3DestinationWebhookDeleteResponseArray] or [shared.UnionString].
-type AlertingV3DestinationWebhookDeleteResponse interface {
- ImplementsAlertingV3DestinationWebhookDeleteResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*AlertingV3DestinationWebhookDeleteResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(AlertingV3DestinationWebhookDeleteResponseArray{}),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-type AlertingV3DestinationWebhookDeleteResponseArray []interface{}
-
-func (r AlertingV3DestinationWebhookDeleteResponseArray) ImplementsAlertingV3DestinationWebhookDeleteResponse() {
-}
-
-type AlertingV3DestinationWebhookGetResponse struct {
- // The unique identifier of a webhook
- ID string `json:"id"`
- // Timestamp of when the webhook destination was created.
- CreatedAt time.Time `json:"created_at" format:"date-time"`
- // Timestamp of the last time an attempt to dispatch a notification to this webhook
- // failed.
- LastFailure time.Time `json:"last_failure" format:"date-time"`
- // Timestamp of the last time Cloudflare was able to successfully dispatch a
- // notification using this webhook.
- LastSuccess time.Time `json:"last_success" format:"date-time"`
- // The name of the webhook destination. This will be included in the request body
- // when you receive a webhook notification.
- Name string `json:"name"`
- // Optional secret that will be passed in the `cf-webhook-auth` header when
- // dispatching generic webhook notifications or formatted for supported
- // destinations. Secrets are not returned in any API response body.
- Secret string `json:"secret"`
- // Type of webhook endpoint.
- Type AlertingV3DestinationWebhookGetResponseType `json:"type"`
- // The POST endpoint to call when dispatching a notification.
- URL string `json:"url"`
- JSON alertingV3DestinationWebhookGetResponseJSON `json:"-"`
-}
-
-// alertingV3DestinationWebhookGetResponseJSON contains the JSON metadata for the
-// struct [AlertingV3DestinationWebhookGetResponse]
-type alertingV3DestinationWebhookGetResponseJSON struct {
- ID apijson.Field
- CreatedAt apijson.Field
- LastFailure apijson.Field
- LastSuccess apijson.Field
- Name apijson.Field
- Secret apijson.Field
- Type apijson.Field
- URL apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AlertingV3DestinationWebhookGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r alertingV3DestinationWebhookGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// Type of webhook endpoint.
-type AlertingV3DestinationWebhookGetResponseType string
-
-const (
- AlertingV3DestinationWebhookGetResponseTypeSlack AlertingV3DestinationWebhookGetResponseType = "slack"
- AlertingV3DestinationWebhookGetResponseTypeGeneric AlertingV3DestinationWebhookGetResponseType = "generic"
- AlertingV3DestinationWebhookGetResponseTypeGchat AlertingV3DestinationWebhookGetResponseType = "gchat"
-)
-
-type AlertingV3DestinationWebhookNewParams struct {
- // The account id
- AccountID param.Field[string] `path:"account_id,required"`
- // The name of the webhook destination. This will be included in the request body
- // when you receive a webhook notification.
- Name param.Field[string] `json:"name,required"`
- // The POST endpoint to call when dispatching a notification.
- URL param.Field[string] `json:"url,required"`
- // Optional secret that will be passed in the `cf-webhook-auth` header when
- // dispatching generic webhook notifications or formatted for supported
- // destinations. Secrets are not returned in any API response body.
- Secret param.Field[string] `json:"secret"`
-}
-
-func (r AlertingV3DestinationWebhookNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type AlertingV3DestinationWebhookNewResponseEnvelope struct {
- Errors []AlertingV3DestinationWebhookNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []AlertingV3DestinationWebhookNewResponseEnvelopeMessages `json:"messages,required"`
- Result AlertingV3DestinationWebhookNewResponse `json:"result,required"`
- // Whether the API call was successful
- Success AlertingV3DestinationWebhookNewResponseEnvelopeSuccess `json:"success,required"`
- JSON alertingV3DestinationWebhookNewResponseEnvelopeJSON `json:"-"`
-}
-
-// alertingV3DestinationWebhookNewResponseEnvelopeJSON contains the JSON metadata
-// for the struct [AlertingV3DestinationWebhookNewResponseEnvelope]
-type alertingV3DestinationWebhookNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AlertingV3DestinationWebhookNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r alertingV3DestinationWebhookNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type AlertingV3DestinationWebhookNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON alertingV3DestinationWebhookNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// alertingV3DestinationWebhookNewResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct [AlertingV3DestinationWebhookNewResponseEnvelopeErrors]
-type alertingV3DestinationWebhookNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AlertingV3DestinationWebhookNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r alertingV3DestinationWebhookNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type AlertingV3DestinationWebhookNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON alertingV3DestinationWebhookNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// alertingV3DestinationWebhookNewResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct
-// [AlertingV3DestinationWebhookNewResponseEnvelopeMessages]
-type alertingV3DestinationWebhookNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AlertingV3DestinationWebhookNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r alertingV3DestinationWebhookNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type AlertingV3DestinationWebhookNewResponseEnvelopeSuccess bool
-
-const (
- AlertingV3DestinationWebhookNewResponseEnvelopeSuccessTrue AlertingV3DestinationWebhookNewResponseEnvelopeSuccess = true
-)
-
-type AlertingV3DestinationWebhookUpdateParams struct {
- // The account id
- AccountID param.Field[string] `path:"account_id,required"`
- // The name of the webhook destination. This will be included in the request body
- // when you receive a webhook notification.
- Name param.Field[string] `json:"name,required"`
- // The POST endpoint to call when dispatching a notification.
- URL param.Field[string] `json:"url,required"`
- // Optional secret that will be passed in the `cf-webhook-auth` header when
- // dispatching generic webhook notifications or formatted for supported
- // destinations. Secrets are not returned in any API response body.
- Secret param.Field[string] `json:"secret"`
-}
-
-func (r AlertingV3DestinationWebhookUpdateParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type AlertingV3DestinationWebhookUpdateResponseEnvelope struct {
- Errors []AlertingV3DestinationWebhookUpdateResponseEnvelopeErrors `json:"errors,required"`
- Messages []AlertingV3DestinationWebhookUpdateResponseEnvelopeMessages `json:"messages,required"`
- Result AlertingV3DestinationWebhookUpdateResponse `json:"result,required"`
- // Whether the API call was successful
- Success AlertingV3DestinationWebhookUpdateResponseEnvelopeSuccess `json:"success,required"`
- JSON alertingV3DestinationWebhookUpdateResponseEnvelopeJSON `json:"-"`
-}
-
-// alertingV3DestinationWebhookUpdateResponseEnvelopeJSON contains the JSON
-// metadata for the struct [AlertingV3DestinationWebhookUpdateResponseEnvelope]
-type alertingV3DestinationWebhookUpdateResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AlertingV3DestinationWebhookUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r alertingV3DestinationWebhookUpdateResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type AlertingV3DestinationWebhookUpdateResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON alertingV3DestinationWebhookUpdateResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// alertingV3DestinationWebhookUpdateResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct
-// [AlertingV3DestinationWebhookUpdateResponseEnvelopeErrors]
-type alertingV3DestinationWebhookUpdateResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AlertingV3DestinationWebhookUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r alertingV3DestinationWebhookUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type AlertingV3DestinationWebhookUpdateResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON alertingV3DestinationWebhookUpdateResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// alertingV3DestinationWebhookUpdateResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct
-// [AlertingV3DestinationWebhookUpdateResponseEnvelopeMessages]
-type alertingV3DestinationWebhookUpdateResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AlertingV3DestinationWebhookUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r alertingV3DestinationWebhookUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type AlertingV3DestinationWebhookUpdateResponseEnvelopeSuccess bool
-
-const (
- AlertingV3DestinationWebhookUpdateResponseEnvelopeSuccessTrue AlertingV3DestinationWebhookUpdateResponseEnvelopeSuccess = true
-)
-
-type AlertingV3DestinationWebhookListParams struct {
- // The account id
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type AlertingV3DestinationWebhookListResponseEnvelope struct {
- Errors []AlertingV3DestinationWebhookListResponseEnvelopeErrors `json:"errors,required"`
- Messages []AlertingV3DestinationWebhookListResponseEnvelopeMessages `json:"messages,required"`
- Result []AlertingV3DestinationWebhookListResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success AlertingV3DestinationWebhookListResponseEnvelopeSuccess `json:"success,required"`
- ResultInfo AlertingV3DestinationWebhookListResponseEnvelopeResultInfo `json:"result_info"`
- JSON alertingV3DestinationWebhookListResponseEnvelopeJSON `json:"-"`
-}
-
-// alertingV3DestinationWebhookListResponseEnvelopeJSON contains the JSON metadata
-// for the struct [AlertingV3DestinationWebhookListResponseEnvelope]
-type alertingV3DestinationWebhookListResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- ResultInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AlertingV3DestinationWebhookListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r alertingV3DestinationWebhookListResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type AlertingV3DestinationWebhookListResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON alertingV3DestinationWebhookListResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// alertingV3DestinationWebhookListResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct [AlertingV3DestinationWebhookListResponseEnvelopeErrors]
-type alertingV3DestinationWebhookListResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AlertingV3DestinationWebhookListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r alertingV3DestinationWebhookListResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type AlertingV3DestinationWebhookListResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON alertingV3DestinationWebhookListResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// alertingV3DestinationWebhookListResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct
-// [AlertingV3DestinationWebhookListResponseEnvelopeMessages]
-type alertingV3DestinationWebhookListResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AlertingV3DestinationWebhookListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r alertingV3DestinationWebhookListResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type AlertingV3DestinationWebhookListResponseEnvelopeSuccess bool
-
-const (
- AlertingV3DestinationWebhookListResponseEnvelopeSuccessTrue AlertingV3DestinationWebhookListResponseEnvelopeSuccess = true
-)
-
-type AlertingV3DestinationWebhookListResponseEnvelopeResultInfo struct {
- // Total number of results for the requested service
- Count float64 `json:"count"`
- // Current page within paginated list of results
- Page float64 `json:"page"`
- // Number of results per page of results
- PerPage float64 `json:"per_page"`
- // Total results available without any search parameters
- TotalCount float64 `json:"total_count"`
- JSON alertingV3DestinationWebhookListResponseEnvelopeResultInfoJSON `json:"-"`
-}
-
-// alertingV3DestinationWebhookListResponseEnvelopeResultInfoJSON contains the JSON
-// metadata for the struct
-// [AlertingV3DestinationWebhookListResponseEnvelopeResultInfo]
-type alertingV3DestinationWebhookListResponseEnvelopeResultInfoJSON struct {
- Count apijson.Field
- Page apijson.Field
- PerPage apijson.Field
- TotalCount apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AlertingV3DestinationWebhookListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r alertingV3DestinationWebhookListResponseEnvelopeResultInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type AlertingV3DestinationWebhookDeleteParams struct {
- // The account id
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type AlertingV3DestinationWebhookDeleteResponseEnvelope struct {
- Errors []AlertingV3DestinationWebhookDeleteResponseEnvelopeErrors `json:"errors,required"`
- Messages []AlertingV3DestinationWebhookDeleteResponseEnvelopeMessages `json:"messages,required"`
- Result AlertingV3DestinationWebhookDeleteResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success AlertingV3DestinationWebhookDeleteResponseEnvelopeSuccess `json:"success,required"`
- ResultInfo AlertingV3DestinationWebhookDeleteResponseEnvelopeResultInfo `json:"result_info"`
- JSON alertingV3DestinationWebhookDeleteResponseEnvelopeJSON `json:"-"`
-}
-
-// alertingV3DestinationWebhookDeleteResponseEnvelopeJSON contains the JSON
-// metadata for the struct [AlertingV3DestinationWebhookDeleteResponseEnvelope]
-type alertingV3DestinationWebhookDeleteResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- ResultInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AlertingV3DestinationWebhookDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r alertingV3DestinationWebhookDeleteResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type AlertingV3DestinationWebhookDeleteResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON alertingV3DestinationWebhookDeleteResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// alertingV3DestinationWebhookDeleteResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct
-// [AlertingV3DestinationWebhookDeleteResponseEnvelopeErrors]
-type alertingV3DestinationWebhookDeleteResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AlertingV3DestinationWebhookDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r alertingV3DestinationWebhookDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type AlertingV3DestinationWebhookDeleteResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON alertingV3DestinationWebhookDeleteResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// alertingV3DestinationWebhookDeleteResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct
-// [AlertingV3DestinationWebhookDeleteResponseEnvelopeMessages]
-type alertingV3DestinationWebhookDeleteResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AlertingV3DestinationWebhookDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r alertingV3DestinationWebhookDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type AlertingV3DestinationWebhookDeleteResponseEnvelopeSuccess bool
-
-const (
- AlertingV3DestinationWebhookDeleteResponseEnvelopeSuccessTrue AlertingV3DestinationWebhookDeleteResponseEnvelopeSuccess = true
-)
-
-type AlertingV3DestinationWebhookDeleteResponseEnvelopeResultInfo struct {
- // Total number of results for the requested service
- Count float64 `json:"count"`
- // Current page within paginated list of results
- Page float64 `json:"page"`
- // Number of results per page of results
- PerPage float64 `json:"per_page"`
- // Total results available without any search parameters
- TotalCount float64 `json:"total_count"`
- JSON alertingV3DestinationWebhookDeleteResponseEnvelopeResultInfoJSON `json:"-"`
-}
-
-// alertingV3DestinationWebhookDeleteResponseEnvelopeResultInfoJSON contains the
-// JSON metadata for the struct
-// [AlertingV3DestinationWebhookDeleteResponseEnvelopeResultInfo]
-type alertingV3DestinationWebhookDeleteResponseEnvelopeResultInfoJSON struct {
- Count apijson.Field
- Page apijson.Field
- PerPage apijson.Field
- TotalCount apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AlertingV3DestinationWebhookDeleteResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r alertingV3DestinationWebhookDeleteResponseEnvelopeResultInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type AlertingV3DestinationWebhookGetParams struct {
- // The account id
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type AlertingV3DestinationWebhookGetResponseEnvelope struct {
- Errors []AlertingV3DestinationWebhookGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []AlertingV3DestinationWebhookGetResponseEnvelopeMessages `json:"messages,required"`
- Result AlertingV3DestinationWebhookGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success AlertingV3DestinationWebhookGetResponseEnvelopeSuccess `json:"success,required"`
- JSON alertingV3DestinationWebhookGetResponseEnvelopeJSON `json:"-"`
-}
-
-// alertingV3DestinationWebhookGetResponseEnvelopeJSON contains the JSON metadata
-// for the struct [AlertingV3DestinationWebhookGetResponseEnvelope]
-type alertingV3DestinationWebhookGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AlertingV3DestinationWebhookGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r alertingV3DestinationWebhookGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type AlertingV3DestinationWebhookGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON alertingV3DestinationWebhookGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// alertingV3DestinationWebhookGetResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct [AlertingV3DestinationWebhookGetResponseEnvelopeErrors]
-type alertingV3DestinationWebhookGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AlertingV3DestinationWebhookGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r alertingV3DestinationWebhookGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type AlertingV3DestinationWebhookGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON alertingV3DestinationWebhookGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// alertingV3DestinationWebhookGetResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct
-// [AlertingV3DestinationWebhookGetResponseEnvelopeMessages]
-type alertingV3DestinationWebhookGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AlertingV3DestinationWebhookGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r alertingV3DestinationWebhookGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type AlertingV3DestinationWebhookGetResponseEnvelopeSuccess bool
-
-const (
- AlertingV3DestinationWebhookGetResponseEnvelopeSuccessTrue AlertingV3DestinationWebhookGetResponseEnvelopeSuccess = true
-)
diff --git a/alertingv3destinationwebhook_test.go b/alertingv3destinationwebhook_test.go
deleted file mode 100644
index b5579eb571a..00000000000
--- a/alertingv3destinationwebhook_test.go
+++ /dev/null
@@ -1,162 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestAlertingV3DestinationWebhookNewWithOptionalParams(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"),
- )
- _, err := client.Alerting.V3.Destinations.Webhooks.New(context.TODO(), cloudflare.AlertingV3DestinationWebhookNewParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Name: cloudflare.F("Slack Webhook"),
- URL: cloudflare.F("https://hooks.slack.com/services/Ds3fdBFbV/456464Gdd"),
- Secret: cloudflare.F("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())
- }
-}
-
-func TestAlertingV3DestinationWebhookUpdateWithOptionalParams(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"),
- )
- _, err := client.Alerting.V3.Destinations.Webhooks.Update(
- context.TODO(),
- "b115d5ec-15c6-41ee-8b76-92c449b5227b",
- cloudflare.AlertingV3DestinationWebhookUpdateParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Name: cloudflare.F("Slack Webhook"),
- URL: cloudflare.F("https://hooks.slack.com/services/Ds3fdBFbV/456464Gdd"),
- Secret: cloudflare.F("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())
- }
-}
-
-func TestAlertingV3DestinationWebhookList(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"),
- )
- _, err := client.Alerting.V3.Destinations.Webhooks.List(context.TODO(), cloudflare.AlertingV3DestinationWebhookListParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- })
- 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())
- }
-}
-
-func TestAlertingV3DestinationWebhookDelete(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"),
- )
- _, err := client.Alerting.V3.Destinations.Webhooks.Delete(
- context.TODO(),
- "b115d5ec-15c6-41ee-8b76-92c449b5227b",
- cloudflare.AlertingV3DestinationWebhookDeleteParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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())
- }
-}
-
-func TestAlertingV3DestinationWebhookGet(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"),
- )
- _, err := client.Alerting.V3.Destinations.Webhooks.Get(
- context.TODO(),
- "b115d5ec-15c6-41ee-8b76-92c449b5227b",
- cloudflare.AlertingV3DestinationWebhookGetParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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/alertingv3history.go b/alertingv3history.go
deleted file mode 100644
index 8394c43f9bd..00000000000
--- a/alertingv3history.go
+++ /dev/null
@@ -1,144 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// AlertingV3HistoryService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewAlertingV3HistoryService] method
-// instead.
-type AlertingV3HistoryService struct {
- Options []option.RequestOption
-}
-
-// NewAlertingV3HistoryService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewAlertingV3HistoryService(opts ...option.RequestOption) (r *AlertingV3HistoryService) {
- r = &AlertingV3HistoryService{}
- r.Options = opts
- return
-}
-
-// Gets a list of history records for notifications sent to an account. The records
-// are displayed for last `x` number of days based on the zone plan (free = 30, pro
-// = 30, biz = 30, ent = 90).
-func (r *AlertingV3HistoryService) List(ctx context.Context, params AlertingV3HistoryListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[AlertingV3HistoryListResponse], err error) {
- var raw *http.Response
- opts = append(r.Options, opts...)
- opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
- path := fmt.Sprintf("accounts/%s/alerting/v3/history", params.AccountID)
- cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, params, &res, opts...)
- if err != nil {
- return nil, err
- }
- err = cfg.Execute()
- if err != nil {
- return nil, err
- }
- res.SetPageConfig(cfg, raw)
- return res, nil
-}
-
-// Gets a list of history records for notifications sent to an account. The records
-// are displayed for last `x` number of days based on the zone plan (free = 30, pro
-// = 30, biz = 30, ent = 90).
-func (r *AlertingV3HistoryService) ListAutoPaging(ctx context.Context, params AlertingV3HistoryListParams, opts ...option.RequestOption) *shared.V4PagePaginationArrayAutoPager[AlertingV3HistoryListResponse] {
- return shared.NewV4PagePaginationArrayAutoPager(r.List(ctx, params, opts...))
-}
-
-type AlertingV3HistoryListResponse struct {
- // UUID
- ID string `json:"id"`
- // Message body included in the notification sent.
- AlertBody string `json:"alert_body"`
- // Type of notification that has been dispatched.
- AlertType string `json:"alert_type"`
- // Description of the notification policy (if present).
- Description string `json:"description"`
- // The mechanism to which the notification has been dispatched.
- Mechanism string `json:"mechanism"`
- // The type of mechanism to which the notification has been dispatched. This can be
- // email/pagerduty/webhook based on the mechanism configured.
- MechanismType AlertingV3HistoryListResponseMechanismType `json:"mechanism_type"`
- // Name of the policy.
- Name string `json:"name"`
- // The unique identifier of a notification policy
- PolicyID string `json:"policy_id"`
- // Timestamp of when the notification was dispatched in ISO 8601 format.
- Sent time.Time `json:"sent" format:"date-time"`
- JSON alertingV3HistoryListResponseJSON `json:"-"`
-}
-
-// alertingV3HistoryListResponseJSON contains the JSON metadata for the struct
-// [AlertingV3HistoryListResponse]
-type alertingV3HistoryListResponseJSON struct {
- ID apijson.Field
- AlertBody apijson.Field
- AlertType apijson.Field
- Description apijson.Field
- Mechanism apijson.Field
- MechanismType apijson.Field
- Name apijson.Field
- PolicyID apijson.Field
- Sent apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AlertingV3HistoryListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r alertingV3HistoryListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// The type of mechanism to which the notification has been dispatched. This can be
-// email/pagerduty/webhook based on the mechanism configured.
-type AlertingV3HistoryListResponseMechanismType string
-
-const (
- AlertingV3HistoryListResponseMechanismTypeEmail AlertingV3HistoryListResponseMechanismType = "email"
- AlertingV3HistoryListResponseMechanismTypePagerduty AlertingV3HistoryListResponseMechanismType = "pagerduty"
- AlertingV3HistoryListResponseMechanismTypeWebhook AlertingV3HistoryListResponseMechanismType = "webhook"
-)
-
-type AlertingV3HistoryListParams struct {
- // The account id
- AccountID param.Field[string] `path:"account_id,required"`
- // Limit the returned results to history records older than the specified date.
- // This must be a timestamp that conforms to RFC3339.
- Before param.Field[time.Time] `query:"before" format:"date-time"`
- // Page number of paginated results.
- Page param.Field[float64] `query:"page"`
- // Number of items per page.
- PerPage param.Field[float64] `query:"per_page"`
- // Limit the returned results to history records newer than the specified date.
- // This must be a timestamp that conforms to RFC3339.
- Since param.Field[time.Time] `query:"since" format:"date-time"`
-}
-
-// URLQuery serializes [AlertingV3HistoryListParams]'s query parameters as
-// `url.Values`.
-func (r AlertingV3HistoryListParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
diff --git a/alertingv3history_test.go b/alertingv3history_test.go
deleted file mode 100644
index 8c04f3ef635..00000000000
--- a/alertingv3history_test.go
+++ /dev/null
@@ -1,45 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
- "time"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestAlertingV3HistoryListWithOptionalParams(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"),
- )
- _, err := client.Alerting.V3.Histories.List(context.TODO(), cloudflare.AlertingV3HistoryListParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Before: cloudflare.F(time.Now()),
- Page: cloudflare.F(1.000000),
- PerPage: cloudflare.F(5.000000),
- Since: cloudflare.F(time.Now()),
- })
- 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/alertingv3policy.go b/alertingv3policy.go
deleted file mode 100644
index 4802233e203..00000000000
--- a/alertingv3policy.go
+++ /dev/null
@@ -1,1730 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "reflect"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/option"
- "github.com/tidwall/gjson"
-)
-
-// AlertingV3PolicyService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewAlertingV3PolicyService] method
-// instead.
-type AlertingV3PolicyService struct {
- Options []option.RequestOption
-}
-
-// NewAlertingV3PolicyService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewAlertingV3PolicyService(opts ...option.RequestOption) (r *AlertingV3PolicyService) {
- r = &AlertingV3PolicyService{}
- r.Options = opts
- return
-}
-
-// Creates a new Notification policy.
-func (r *AlertingV3PolicyService) New(ctx context.Context, params AlertingV3PolicyNewParams, opts ...option.RequestOption) (res *AlertingV3PolicyNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env AlertingV3PolicyNewResponseEnvelope
- path := fmt.Sprintf("accounts/%s/alerting/v3/policies", params.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Update a Notification policy.
-func (r *AlertingV3PolicyService) Update(ctx context.Context, policyID string, params AlertingV3PolicyUpdateParams, opts ...option.RequestOption) (res *AlertingV3PolicyUpdateResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env AlertingV3PolicyUpdateResponseEnvelope
- path := fmt.Sprintf("accounts/%s/alerting/v3/policies/%s", params.AccountID, policyID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Get a list of all Notification policies.
-func (r *AlertingV3PolicyService) List(ctx context.Context, query AlertingV3PolicyListParams, opts ...option.RequestOption) (res *[]AlertingV3PolicyListResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env AlertingV3PolicyListResponseEnvelope
- path := fmt.Sprintf("accounts/%s/alerting/v3/policies", query.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Delete a Notification policy.
-func (r *AlertingV3PolicyService) Delete(ctx context.Context, policyID string, body AlertingV3PolicyDeleteParams, opts ...option.RequestOption) (res *AlertingV3PolicyDeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env AlertingV3PolicyDeleteResponseEnvelope
- path := fmt.Sprintf("accounts/%s/alerting/v3/policies/%s", body.AccountID, policyID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Get details for a single policy.
-func (r *AlertingV3PolicyService) Get(ctx context.Context, policyID string, query AlertingV3PolicyGetParams, opts ...option.RequestOption) (res *AlertingV3PolicyGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env AlertingV3PolicyGetResponseEnvelope
- path := fmt.Sprintf("accounts/%s/alerting/v3/policies/%s", query.AccountID, policyID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type AlertingV3PolicyNewResponse struct {
- // UUID
- ID string `json:"id"`
- JSON alertingV3PolicyNewResponseJSON `json:"-"`
-}
-
-// alertingV3PolicyNewResponseJSON contains the JSON metadata for the struct
-// [AlertingV3PolicyNewResponse]
-type alertingV3PolicyNewResponseJSON struct {
- ID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AlertingV3PolicyNewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r alertingV3PolicyNewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type AlertingV3PolicyUpdateResponse struct {
- // UUID
- ID string `json:"id"`
- JSON alertingV3PolicyUpdateResponseJSON `json:"-"`
-}
-
-// alertingV3PolicyUpdateResponseJSON contains the JSON metadata for the struct
-// [AlertingV3PolicyUpdateResponse]
-type alertingV3PolicyUpdateResponseJSON struct {
- ID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AlertingV3PolicyUpdateResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r alertingV3PolicyUpdateResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type AlertingV3PolicyListResponse struct {
- // The unique identifier of a notification policy
- ID string `json:"id"`
- // Refers to which event will trigger a Notification dispatch. You can use the
- // endpoint to get available alert types which then will give you a list of
- // possible values.
- AlertType AlertingV3PolicyListResponseAlertType `json:"alert_type"`
- Created time.Time `json:"created" format:"date-time"`
- // Optional description for the Notification policy.
- Description string `json:"description"`
- // Whether or not the Notification policy is enabled.
- Enabled bool `json:"enabled"`
- // Optional filters that allow you to be alerted only on a subset of events for
- // that alert type based on some criteria. This is only available for select alert
- // types. See alert type documentation for more details.
- Filters AlertingV3PolicyListResponseFilters `json:"filters"`
- // List of IDs that will be used when dispatching a notification. IDs for email
- // type will be the email address.
- Mechanisms map[string][]AlertingV3PolicyListResponseMechanisms `json:"mechanisms"`
- Modified time.Time `json:"modified" format:"date-time"`
- // Name of the policy.
- Name string `json:"name"`
- JSON alertingV3PolicyListResponseJSON `json:"-"`
-}
-
-// alertingV3PolicyListResponseJSON contains the JSON metadata for the struct
-// [AlertingV3PolicyListResponse]
-type alertingV3PolicyListResponseJSON struct {
- ID apijson.Field
- AlertType apijson.Field
- Created apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Filters apijson.Field
- Mechanisms apijson.Field
- Modified apijson.Field
- Name apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AlertingV3PolicyListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r alertingV3PolicyListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// Refers to which event will trigger a Notification dispatch. You can use the
-// endpoint to get available alert types which then will give you a list of
-// possible values.
-type AlertingV3PolicyListResponseAlertType string
-
-const (
- AlertingV3PolicyListResponseAlertTypeAccessCustomCertificateExpirationType AlertingV3PolicyListResponseAlertType = "access_custom_certificate_expiration_type"
- AlertingV3PolicyListResponseAlertTypeAdvancedDDOSAttackL4Alert AlertingV3PolicyListResponseAlertType = "advanced_ddos_attack_l4_alert"
- AlertingV3PolicyListResponseAlertTypeAdvancedDDOSAttackL7Alert AlertingV3PolicyListResponseAlertType = "advanced_ddos_attack_l7_alert"
- AlertingV3PolicyListResponseAlertTypeAdvancedHTTPAlertError AlertingV3PolicyListResponseAlertType = "advanced_http_alert_error"
- AlertingV3PolicyListResponseAlertTypeBGPHijackNotification AlertingV3PolicyListResponseAlertType = "bgp_hijack_notification"
- AlertingV3PolicyListResponseAlertTypeBillingUsageAlert AlertingV3PolicyListResponseAlertType = "billing_usage_alert"
- AlertingV3PolicyListResponseAlertTypeBlockNotificationBlockRemoved AlertingV3PolicyListResponseAlertType = "block_notification_block_removed"
- AlertingV3PolicyListResponseAlertTypeBlockNotificationNewBlock AlertingV3PolicyListResponseAlertType = "block_notification_new_block"
- AlertingV3PolicyListResponseAlertTypeBlockNotificationReviewRejected AlertingV3PolicyListResponseAlertType = "block_notification_review_rejected"
- AlertingV3PolicyListResponseAlertTypeBrandProtectionAlert AlertingV3PolicyListResponseAlertType = "brand_protection_alert"
- AlertingV3PolicyListResponseAlertTypeBrandProtectionDigest AlertingV3PolicyListResponseAlertType = "brand_protection_digest"
- AlertingV3PolicyListResponseAlertTypeClickhouseAlertFwAnomaly AlertingV3PolicyListResponseAlertType = "clickhouse_alert_fw_anomaly"
- AlertingV3PolicyListResponseAlertTypeClickhouseAlertFwEntAnomaly AlertingV3PolicyListResponseAlertType = "clickhouse_alert_fw_ent_anomaly"
- AlertingV3PolicyListResponseAlertTypeCustomSSLCertificateEventType AlertingV3PolicyListResponseAlertType = "custom_ssl_certificate_event_type"
- AlertingV3PolicyListResponseAlertTypeDedicatedSSLCertificateEventType AlertingV3PolicyListResponseAlertType = "dedicated_ssl_certificate_event_type"
- AlertingV3PolicyListResponseAlertTypeDosAttackL4 AlertingV3PolicyListResponseAlertType = "dos_attack_l4"
- AlertingV3PolicyListResponseAlertTypeDosAttackL7 AlertingV3PolicyListResponseAlertType = "dos_attack_l7"
- AlertingV3PolicyListResponseAlertTypeExpiringServiceTokenAlert AlertingV3PolicyListResponseAlertType = "expiring_service_token_alert"
- AlertingV3PolicyListResponseAlertTypeFailingLogpushJobDisabledAlert AlertingV3PolicyListResponseAlertType = "failing_logpush_job_disabled_alert"
- AlertingV3PolicyListResponseAlertTypeFbmAutoAdvertisement AlertingV3PolicyListResponseAlertType = "fbm_auto_advertisement"
- AlertingV3PolicyListResponseAlertTypeFbmDosdAttack AlertingV3PolicyListResponseAlertType = "fbm_dosd_attack"
- AlertingV3PolicyListResponseAlertTypeFbmVolumetricAttack AlertingV3PolicyListResponseAlertType = "fbm_volumetric_attack"
- AlertingV3PolicyListResponseAlertTypeHealthCheckStatusNotification AlertingV3PolicyListResponseAlertType = "health_check_status_notification"
- AlertingV3PolicyListResponseAlertTypeHostnameAopCustomCertificateExpirationType AlertingV3PolicyListResponseAlertType = "hostname_aop_custom_certificate_expiration_type"
- AlertingV3PolicyListResponseAlertTypeHTTPAlertEdgeError AlertingV3PolicyListResponseAlertType = "http_alert_edge_error"
- AlertingV3PolicyListResponseAlertTypeHTTPAlertOriginError AlertingV3PolicyListResponseAlertType = "http_alert_origin_error"
- AlertingV3PolicyListResponseAlertTypeIncidentAlert AlertingV3PolicyListResponseAlertType = "incident_alert"
- AlertingV3PolicyListResponseAlertTypeLoadBalancingHealthAlert AlertingV3PolicyListResponseAlertType = "load_balancing_health_alert"
- AlertingV3PolicyListResponseAlertTypeLoadBalancingPoolEnablementAlert AlertingV3PolicyListResponseAlertType = "load_balancing_pool_enablement_alert"
- AlertingV3PolicyListResponseAlertTypeLogoMatchAlert AlertingV3PolicyListResponseAlertType = "logo_match_alert"
- AlertingV3PolicyListResponseAlertTypeMagicTunnelHealthCheckEvent AlertingV3PolicyListResponseAlertType = "magic_tunnel_health_check_event"
- AlertingV3PolicyListResponseAlertTypeMaintenanceEventNotification AlertingV3PolicyListResponseAlertType = "maintenance_event_notification"
- AlertingV3PolicyListResponseAlertTypeMTLSCertificateStoreCertificateExpirationType AlertingV3PolicyListResponseAlertType = "mtls_certificate_store_certificate_expiration_type"
- AlertingV3PolicyListResponseAlertTypePagesEventAlert AlertingV3PolicyListResponseAlertType = "pages_event_alert"
- AlertingV3PolicyListResponseAlertTypeRadarNotification AlertingV3PolicyListResponseAlertType = "radar_notification"
- AlertingV3PolicyListResponseAlertTypeRealOriginMonitoring AlertingV3PolicyListResponseAlertType = "real_origin_monitoring"
- AlertingV3PolicyListResponseAlertTypeScriptmonitorAlertNewCodeChangeDetections AlertingV3PolicyListResponseAlertType = "scriptmonitor_alert_new_code_change_detections"
- AlertingV3PolicyListResponseAlertTypeScriptmonitorAlertNewHosts AlertingV3PolicyListResponseAlertType = "scriptmonitor_alert_new_hosts"
- AlertingV3PolicyListResponseAlertTypeScriptmonitorAlertNewMaliciousHosts AlertingV3PolicyListResponseAlertType = "scriptmonitor_alert_new_malicious_hosts"
- AlertingV3PolicyListResponseAlertTypeScriptmonitorAlertNewMaliciousScripts AlertingV3PolicyListResponseAlertType = "scriptmonitor_alert_new_malicious_scripts"
- AlertingV3PolicyListResponseAlertTypeScriptmonitorAlertNewMaliciousURL AlertingV3PolicyListResponseAlertType = "scriptmonitor_alert_new_malicious_url"
- AlertingV3PolicyListResponseAlertTypeScriptmonitorAlertNewMaxLengthResourceURL AlertingV3PolicyListResponseAlertType = "scriptmonitor_alert_new_max_length_resource_url"
- AlertingV3PolicyListResponseAlertTypeScriptmonitorAlertNewResources AlertingV3PolicyListResponseAlertType = "scriptmonitor_alert_new_resources"
- AlertingV3PolicyListResponseAlertTypeSecondaryDNSAllPrimariesFailing AlertingV3PolicyListResponseAlertType = "secondary_dns_all_primaries_failing"
- AlertingV3PolicyListResponseAlertTypeSecondaryDNSPrimariesFailing AlertingV3PolicyListResponseAlertType = "secondary_dns_primaries_failing"
- AlertingV3PolicyListResponseAlertTypeSecondaryDNSZoneSuccessfullyUpdated AlertingV3PolicyListResponseAlertType = "secondary_dns_zone_successfully_updated"
- AlertingV3PolicyListResponseAlertTypeSecondaryDNSZoneValidationWarning AlertingV3PolicyListResponseAlertType = "secondary_dns_zone_validation_warning"
- AlertingV3PolicyListResponseAlertTypeSentinelAlert AlertingV3PolicyListResponseAlertType = "sentinel_alert"
- AlertingV3PolicyListResponseAlertTypeStreamLiveNotifications AlertingV3PolicyListResponseAlertType = "stream_live_notifications"
- AlertingV3PolicyListResponseAlertTypeTunnelHealthEvent AlertingV3PolicyListResponseAlertType = "tunnel_health_event"
- AlertingV3PolicyListResponseAlertTypeTunnelUpdateEvent AlertingV3PolicyListResponseAlertType = "tunnel_update_event"
- AlertingV3PolicyListResponseAlertTypeUniversalSSLEventType AlertingV3PolicyListResponseAlertType = "universal_ssl_event_type"
- AlertingV3PolicyListResponseAlertTypeWebAnalyticsMetricsUpdate AlertingV3PolicyListResponseAlertType = "web_analytics_metrics_update"
- AlertingV3PolicyListResponseAlertTypeZoneAopCustomCertificateExpirationType AlertingV3PolicyListResponseAlertType = "zone_aop_custom_certificate_expiration_type"
-)
-
-// Optional filters that allow you to be alerted only on a subset of events for
-// that alert type based on some criteria. This is only available for select alert
-// types. See alert type documentation for more details.
-type AlertingV3PolicyListResponseFilters struct {
- // Usage depends on specific alert type
- Actions []string `json:"actions"`
- // Used for configuring radar_notification
- AffectedASNs []string `json:"affected_asns"`
- // Used for configuring incident_alert
- AffectedComponents []string `json:"affected_components"`
- // Used for configuring radar_notification
- AffectedLocations []string `json:"affected_locations"`
- // Used for configuring maintenance_event_notification
- AirportCode []string `json:"airport_code"`
- // Usage depends on specific alert type
- AlertTriggerPreferences []string `json:"alert_trigger_preferences"`
- // Used for configuring magic_tunnel_health_check_event
- AlertTriggerPreferencesValue []AlertingV3PolicyListResponseFiltersAlertTriggerPreferencesValue `json:"alert_trigger_preferences_value"`
- // Used for configuring load_balancing_pool_enablement_alert
- Enabled []string `json:"enabled"`
- // Used for configuring pages_event_alert
- Environment []string `json:"environment"`
- // Used for configuring pages_event_alert
- Event []string `json:"event"`
- // Used for configuring load_balancing_health_alert
- EventSource []string `json:"event_source"`
- // Usage depends on specific alert type
- EventType []string `json:"event_type"`
- // Usage depends on specific alert type
- GroupBy []string `json:"group_by"`
- // Used for configuring health_check_status_notification
- HealthCheckID []string `json:"health_check_id"`
- // Used for configuring incident_alert
- IncidentImpact []AlertingV3PolicyListResponseFiltersIncidentImpact `json:"incident_impact"`
- // Used for configuring stream_live_notifications
- InputID []string `json:"input_id"`
- // Used for configuring billing_usage_alert
- Limit []string `json:"limit"`
- // Used for configuring logo_match_alert
- LogoTag []string `json:"logo_tag"`
- // Used for configuring advanced_ddos_attack_l4_alert
- MegabitsPerSecond []string `json:"megabits_per_second"`
- // Used for configuring load_balancing_health_alert
- NewHealth []string `json:"new_health"`
- // Used for configuring tunnel_health_event
- NewStatus []string `json:"new_status"`
- // Used for configuring advanced_ddos_attack_l4_alert
- PacketsPerSecond []string `json:"packets_per_second"`
- // Usage depends on specific alert type
- PoolID []string `json:"pool_id"`
- // Used for configuring billing_usage_alert
- Product []string `json:"product"`
- // Used for configuring pages_event_alert
- ProjectID []string `json:"project_id"`
- // Used for configuring advanced_ddos_attack_l4_alert
- Protocol []string `json:"protocol"`
- // Usage depends on specific alert type
- QueryTag []string `json:"query_tag"`
- // Used for configuring advanced_ddos_attack_l7_alert
- RequestsPerSecond []string `json:"requests_per_second"`
- // Usage depends on specific alert type
- Selectors []string `json:"selectors"`
- // Used for configuring clickhouse_alert_fw_ent_anomaly
- Services []string `json:"services"`
- // Usage depends on specific alert type
- Slo []string `json:"slo"`
- // Used for configuring health_check_status_notification
- Status []string `json:"status"`
- // Used for configuring advanced_ddos_attack_l7_alert
- TargetHostname []string `json:"target_hostname"`
- // Used for configuring advanced_ddos_attack_l4_alert
- TargetIP []string `json:"target_ip"`
- // Used for configuring advanced_ddos_attack_l7_alert
- TargetZoneName []string `json:"target_zone_name"`
- // Used for configuring traffic_anomalies_alert
- TrafficExclusions []AlertingV3PolicyListResponseFiltersTrafficExclusion `json:"traffic_exclusions"`
- // Used for configuring tunnel_health_event
- TunnelID []string `json:"tunnel_id"`
- // Used for configuring magic_tunnel_health_check_event
- TunnelName []string `json:"tunnel_name"`
- // Usage depends on specific alert type
- Where []string `json:"where"`
- // Usage depends on specific alert type
- Zones []string `json:"zones"`
- JSON alertingV3PolicyListResponseFiltersJSON `json:"-"`
-}
-
-// alertingV3PolicyListResponseFiltersJSON contains the JSON metadata for the
-// struct [AlertingV3PolicyListResponseFilters]
-type alertingV3PolicyListResponseFiltersJSON struct {
- Actions apijson.Field
- AffectedASNs apijson.Field
- AffectedComponents apijson.Field
- AffectedLocations apijson.Field
- AirportCode apijson.Field
- AlertTriggerPreferences apijson.Field
- AlertTriggerPreferencesValue apijson.Field
- Enabled apijson.Field
- Environment apijson.Field
- Event apijson.Field
- EventSource apijson.Field
- EventType apijson.Field
- GroupBy apijson.Field
- HealthCheckID apijson.Field
- IncidentImpact apijson.Field
- InputID apijson.Field
- Limit apijson.Field
- LogoTag apijson.Field
- MegabitsPerSecond apijson.Field
- NewHealth apijson.Field
- NewStatus apijson.Field
- PacketsPerSecond apijson.Field
- PoolID apijson.Field
- Product apijson.Field
- ProjectID apijson.Field
- Protocol apijson.Field
- QueryTag apijson.Field
- RequestsPerSecond apijson.Field
- Selectors apijson.Field
- Services apijson.Field
- Slo apijson.Field
- Status apijson.Field
- TargetHostname apijson.Field
- TargetIP apijson.Field
- TargetZoneName apijson.Field
- TrafficExclusions apijson.Field
- TunnelID apijson.Field
- TunnelName apijson.Field
- Where apijson.Field
- Zones apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AlertingV3PolicyListResponseFilters) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r alertingV3PolicyListResponseFiltersJSON) RawJSON() string {
- return r.raw
-}
-
-type AlertingV3PolicyListResponseFiltersAlertTriggerPreferencesValue string
-
-const (
- AlertingV3PolicyListResponseFiltersAlertTriggerPreferencesValue99_0 AlertingV3PolicyListResponseFiltersAlertTriggerPreferencesValue = "99.0"
- AlertingV3PolicyListResponseFiltersAlertTriggerPreferencesValue98_0 AlertingV3PolicyListResponseFiltersAlertTriggerPreferencesValue = "98.0"
- AlertingV3PolicyListResponseFiltersAlertTriggerPreferencesValue97_0 AlertingV3PolicyListResponseFiltersAlertTriggerPreferencesValue = "97.0"
-)
-
-type AlertingV3PolicyListResponseFiltersIncidentImpact string
-
-const (
- AlertingV3PolicyListResponseFiltersIncidentImpactIncidentImpactNone AlertingV3PolicyListResponseFiltersIncidentImpact = "INCIDENT_IMPACT_NONE"
- AlertingV3PolicyListResponseFiltersIncidentImpactIncidentImpactMinor AlertingV3PolicyListResponseFiltersIncidentImpact = "INCIDENT_IMPACT_MINOR"
- AlertingV3PolicyListResponseFiltersIncidentImpactIncidentImpactMajor AlertingV3PolicyListResponseFiltersIncidentImpact = "INCIDENT_IMPACT_MAJOR"
- AlertingV3PolicyListResponseFiltersIncidentImpactIncidentImpactCritical AlertingV3PolicyListResponseFiltersIncidentImpact = "INCIDENT_IMPACT_CRITICAL"
-)
-
-type AlertingV3PolicyListResponseFiltersTrafficExclusion string
-
-const (
- AlertingV3PolicyListResponseFiltersTrafficExclusionSecurityEvents AlertingV3PolicyListResponseFiltersTrafficExclusion = "security_events"
-)
-
-type AlertingV3PolicyListResponseMechanisms struct {
- // UUID
- ID AlertingV3PolicyListResponseMechanismsID `json:"id"`
- JSON alertingV3PolicyListResponseMechanismsJSON `json:"-"`
-}
-
-// alertingV3PolicyListResponseMechanismsJSON contains the JSON metadata for the
-// struct [AlertingV3PolicyListResponseMechanisms]
-type alertingV3PolicyListResponseMechanismsJSON struct {
- ID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AlertingV3PolicyListResponseMechanisms) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r alertingV3PolicyListResponseMechanismsJSON) RawJSON() string {
- return r.raw
-}
-
-// UUID
-//
-// Union satisfied by [shared.UnionString] or [shared.UnionString].
-type AlertingV3PolicyListResponseMechanismsID interface {
- ImplementsAlertingV3PolicyListResponseMechanismsID()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*AlertingV3PolicyListResponseMechanismsID)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-// Union satisfied by [AlertingV3PolicyDeleteResponseUnknown],
-// [AlertingV3PolicyDeleteResponseArray] or [shared.UnionString].
-type AlertingV3PolicyDeleteResponse interface {
- ImplementsAlertingV3PolicyDeleteResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*AlertingV3PolicyDeleteResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(AlertingV3PolicyDeleteResponseArray{}),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-type AlertingV3PolicyDeleteResponseArray []interface{}
-
-func (r AlertingV3PolicyDeleteResponseArray) ImplementsAlertingV3PolicyDeleteResponse() {}
-
-type AlertingV3PolicyGetResponse struct {
- // The unique identifier of a notification policy
- ID string `json:"id"`
- // Refers to which event will trigger a Notification dispatch. You can use the
- // endpoint to get available alert types which then will give you a list of
- // possible values.
- AlertType AlertingV3PolicyGetResponseAlertType `json:"alert_type"`
- Created time.Time `json:"created" format:"date-time"`
- // Optional description for the Notification policy.
- Description string `json:"description"`
- // Whether or not the Notification policy is enabled.
- Enabled bool `json:"enabled"`
- // Optional filters that allow you to be alerted only on a subset of events for
- // that alert type based on some criteria. This is only available for select alert
- // types. See alert type documentation for more details.
- Filters AlertingV3PolicyGetResponseFilters `json:"filters"`
- // List of IDs that will be used when dispatching a notification. IDs for email
- // type will be the email address.
- Mechanisms map[string][]AlertingV3PolicyGetResponseMechanisms `json:"mechanisms"`
- Modified time.Time `json:"modified" format:"date-time"`
- // Name of the policy.
- Name string `json:"name"`
- JSON alertingV3PolicyGetResponseJSON `json:"-"`
-}
-
-// alertingV3PolicyGetResponseJSON contains the JSON metadata for the struct
-// [AlertingV3PolicyGetResponse]
-type alertingV3PolicyGetResponseJSON struct {
- ID apijson.Field
- AlertType apijson.Field
- Created apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Filters apijson.Field
- Mechanisms apijson.Field
- Modified apijson.Field
- Name apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AlertingV3PolicyGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r alertingV3PolicyGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// Refers to which event will trigger a Notification dispatch. You can use the
-// endpoint to get available alert types which then will give you a list of
-// possible values.
-type AlertingV3PolicyGetResponseAlertType string
-
-const (
- AlertingV3PolicyGetResponseAlertTypeAccessCustomCertificateExpirationType AlertingV3PolicyGetResponseAlertType = "access_custom_certificate_expiration_type"
- AlertingV3PolicyGetResponseAlertTypeAdvancedDDOSAttackL4Alert AlertingV3PolicyGetResponseAlertType = "advanced_ddos_attack_l4_alert"
- AlertingV3PolicyGetResponseAlertTypeAdvancedDDOSAttackL7Alert AlertingV3PolicyGetResponseAlertType = "advanced_ddos_attack_l7_alert"
- AlertingV3PolicyGetResponseAlertTypeAdvancedHTTPAlertError AlertingV3PolicyGetResponseAlertType = "advanced_http_alert_error"
- AlertingV3PolicyGetResponseAlertTypeBGPHijackNotification AlertingV3PolicyGetResponseAlertType = "bgp_hijack_notification"
- AlertingV3PolicyGetResponseAlertTypeBillingUsageAlert AlertingV3PolicyGetResponseAlertType = "billing_usage_alert"
- AlertingV3PolicyGetResponseAlertTypeBlockNotificationBlockRemoved AlertingV3PolicyGetResponseAlertType = "block_notification_block_removed"
- AlertingV3PolicyGetResponseAlertTypeBlockNotificationNewBlock AlertingV3PolicyGetResponseAlertType = "block_notification_new_block"
- AlertingV3PolicyGetResponseAlertTypeBlockNotificationReviewRejected AlertingV3PolicyGetResponseAlertType = "block_notification_review_rejected"
- AlertingV3PolicyGetResponseAlertTypeBrandProtectionAlert AlertingV3PolicyGetResponseAlertType = "brand_protection_alert"
- AlertingV3PolicyGetResponseAlertTypeBrandProtectionDigest AlertingV3PolicyGetResponseAlertType = "brand_protection_digest"
- AlertingV3PolicyGetResponseAlertTypeClickhouseAlertFwAnomaly AlertingV3PolicyGetResponseAlertType = "clickhouse_alert_fw_anomaly"
- AlertingV3PolicyGetResponseAlertTypeClickhouseAlertFwEntAnomaly AlertingV3PolicyGetResponseAlertType = "clickhouse_alert_fw_ent_anomaly"
- AlertingV3PolicyGetResponseAlertTypeCustomSSLCertificateEventType AlertingV3PolicyGetResponseAlertType = "custom_ssl_certificate_event_type"
- AlertingV3PolicyGetResponseAlertTypeDedicatedSSLCertificateEventType AlertingV3PolicyGetResponseAlertType = "dedicated_ssl_certificate_event_type"
- AlertingV3PolicyGetResponseAlertTypeDosAttackL4 AlertingV3PolicyGetResponseAlertType = "dos_attack_l4"
- AlertingV3PolicyGetResponseAlertTypeDosAttackL7 AlertingV3PolicyGetResponseAlertType = "dos_attack_l7"
- AlertingV3PolicyGetResponseAlertTypeExpiringServiceTokenAlert AlertingV3PolicyGetResponseAlertType = "expiring_service_token_alert"
- AlertingV3PolicyGetResponseAlertTypeFailingLogpushJobDisabledAlert AlertingV3PolicyGetResponseAlertType = "failing_logpush_job_disabled_alert"
- AlertingV3PolicyGetResponseAlertTypeFbmAutoAdvertisement AlertingV3PolicyGetResponseAlertType = "fbm_auto_advertisement"
- AlertingV3PolicyGetResponseAlertTypeFbmDosdAttack AlertingV3PolicyGetResponseAlertType = "fbm_dosd_attack"
- AlertingV3PolicyGetResponseAlertTypeFbmVolumetricAttack AlertingV3PolicyGetResponseAlertType = "fbm_volumetric_attack"
- AlertingV3PolicyGetResponseAlertTypeHealthCheckStatusNotification AlertingV3PolicyGetResponseAlertType = "health_check_status_notification"
- AlertingV3PolicyGetResponseAlertTypeHostnameAopCustomCertificateExpirationType AlertingV3PolicyGetResponseAlertType = "hostname_aop_custom_certificate_expiration_type"
- AlertingV3PolicyGetResponseAlertTypeHTTPAlertEdgeError AlertingV3PolicyGetResponseAlertType = "http_alert_edge_error"
- AlertingV3PolicyGetResponseAlertTypeHTTPAlertOriginError AlertingV3PolicyGetResponseAlertType = "http_alert_origin_error"
- AlertingV3PolicyGetResponseAlertTypeIncidentAlert AlertingV3PolicyGetResponseAlertType = "incident_alert"
- AlertingV3PolicyGetResponseAlertTypeLoadBalancingHealthAlert AlertingV3PolicyGetResponseAlertType = "load_balancing_health_alert"
- AlertingV3PolicyGetResponseAlertTypeLoadBalancingPoolEnablementAlert AlertingV3PolicyGetResponseAlertType = "load_balancing_pool_enablement_alert"
- AlertingV3PolicyGetResponseAlertTypeLogoMatchAlert AlertingV3PolicyGetResponseAlertType = "logo_match_alert"
- AlertingV3PolicyGetResponseAlertTypeMagicTunnelHealthCheckEvent AlertingV3PolicyGetResponseAlertType = "magic_tunnel_health_check_event"
- AlertingV3PolicyGetResponseAlertTypeMaintenanceEventNotification AlertingV3PolicyGetResponseAlertType = "maintenance_event_notification"
- AlertingV3PolicyGetResponseAlertTypeMTLSCertificateStoreCertificateExpirationType AlertingV3PolicyGetResponseAlertType = "mtls_certificate_store_certificate_expiration_type"
- AlertingV3PolicyGetResponseAlertTypePagesEventAlert AlertingV3PolicyGetResponseAlertType = "pages_event_alert"
- AlertingV3PolicyGetResponseAlertTypeRadarNotification AlertingV3PolicyGetResponseAlertType = "radar_notification"
- AlertingV3PolicyGetResponseAlertTypeRealOriginMonitoring AlertingV3PolicyGetResponseAlertType = "real_origin_monitoring"
- AlertingV3PolicyGetResponseAlertTypeScriptmonitorAlertNewCodeChangeDetections AlertingV3PolicyGetResponseAlertType = "scriptmonitor_alert_new_code_change_detections"
- AlertingV3PolicyGetResponseAlertTypeScriptmonitorAlertNewHosts AlertingV3PolicyGetResponseAlertType = "scriptmonitor_alert_new_hosts"
- AlertingV3PolicyGetResponseAlertTypeScriptmonitorAlertNewMaliciousHosts AlertingV3PolicyGetResponseAlertType = "scriptmonitor_alert_new_malicious_hosts"
- AlertingV3PolicyGetResponseAlertTypeScriptmonitorAlertNewMaliciousScripts AlertingV3PolicyGetResponseAlertType = "scriptmonitor_alert_new_malicious_scripts"
- AlertingV3PolicyGetResponseAlertTypeScriptmonitorAlertNewMaliciousURL AlertingV3PolicyGetResponseAlertType = "scriptmonitor_alert_new_malicious_url"
- AlertingV3PolicyGetResponseAlertTypeScriptmonitorAlertNewMaxLengthResourceURL AlertingV3PolicyGetResponseAlertType = "scriptmonitor_alert_new_max_length_resource_url"
- AlertingV3PolicyGetResponseAlertTypeScriptmonitorAlertNewResources AlertingV3PolicyGetResponseAlertType = "scriptmonitor_alert_new_resources"
- AlertingV3PolicyGetResponseAlertTypeSecondaryDNSAllPrimariesFailing AlertingV3PolicyGetResponseAlertType = "secondary_dns_all_primaries_failing"
- AlertingV3PolicyGetResponseAlertTypeSecondaryDNSPrimariesFailing AlertingV3PolicyGetResponseAlertType = "secondary_dns_primaries_failing"
- AlertingV3PolicyGetResponseAlertTypeSecondaryDNSZoneSuccessfullyUpdated AlertingV3PolicyGetResponseAlertType = "secondary_dns_zone_successfully_updated"
- AlertingV3PolicyGetResponseAlertTypeSecondaryDNSZoneValidationWarning AlertingV3PolicyGetResponseAlertType = "secondary_dns_zone_validation_warning"
- AlertingV3PolicyGetResponseAlertTypeSentinelAlert AlertingV3PolicyGetResponseAlertType = "sentinel_alert"
- AlertingV3PolicyGetResponseAlertTypeStreamLiveNotifications AlertingV3PolicyGetResponseAlertType = "stream_live_notifications"
- AlertingV3PolicyGetResponseAlertTypeTunnelHealthEvent AlertingV3PolicyGetResponseAlertType = "tunnel_health_event"
- AlertingV3PolicyGetResponseAlertTypeTunnelUpdateEvent AlertingV3PolicyGetResponseAlertType = "tunnel_update_event"
- AlertingV3PolicyGetResponseAlertTypeUniversalSSLEventType AlertingV3PolicyGetResponseAlertType = "universal_ssl_event_type"
- AlertingV3PolicyGetResponseAlertTypeWebAnalyticsMetricsUpdate AlertingV3PolicyGetResponseAlertType = "web_analytics_metrics_update"
- AlertingV3PolicyGetResponseAlertTypeZoneAopCustomCertificateExpirationType AlertingV3PolicyGetResponseAlertType = "zone_aop_custom_certificate_expiration_type"
-)
-
-// Optional filters that allow you to be alerted only on a subset of events for
-// that alert type based on some criteria. This is only available for select alert
-// types. See alert type documentation for more details.
-type AlertingV3PolicyGetResponseFilters struct {
- // Usage depends on specific alert type
- Actions []string `json:"actions"`
- // Used for configuring radar_notification
- AffectedASNs []string `json:"affected_asns"`
- // Used for configuring incident_alert
- AffectedComponents []string `json:"affected_components"`
- // Used for configuring radar_notification
- AffectedLocations []string `json:"affected_locations"`
- // Used for configuring maintenance_event_notification
- AirportCode []string `json:"airport_code"`
- // Usage depends on specific alert type
- AlertTriggerPreferences []string `json:"alert_trigger_preferences"`
- // Used for configuring magic_tunnel_health_check_event
- AlertTriggerPreferencesValue []AlertingV3PolicyGetResponseFiltersAlertTriggerPreferencesValue `json:"alert_trigger_preferences_value"`
- // Used for configuring load_balancing_pool_enablement_alert
- Enabled []string `json:"enabled"`
- // Used for configuring pages_event_alert
- Environment []string `json:"environment"`
- // Used for configuring pages_event_alert
- Event []string `json:"event"`
- // Used for configuring load_balancing_health_alert
- EventSource []string `json:"event_source"`
- // Usage depends on specific alert type
- EventType []string `json:"event_type"`
- // Usage depends on specific alert type
- GroupBy []string `json:"group_by"`
- // Used for configuring health_check_status_notification
- HealthCheckID []string `json:"health_check_id"`
- // Used for configuring incident_alert
- IncidentImpact []AlertingV3PolicyGetResponseFiltersIncidentImpact `json:"incident_impact"`
- // Used for configuring stream_live_notifications
- InputID []string `json:"input_id"`
- // Used for configuring billing_usage_alert
- Limit []string `json:"limit"`
- // Used for configuring logo_match_alert
- LogoTag []string `json:"logo_tag"`
- // Used for configuring advanced_ddos_attack_l4_alert
- MegabitsPerSecond []string `json:"megabits_per_second"`
- // Used for configuring load_balancing_health_alert
- NewHealth []string `json:"new_health"`
- // Used for configuring tunnel_health_event
- NewStatus []string `json:"new_status"`
- // Used for configuring advanced_ddos_attack_l4_alert
- PacketsPerSecond []string `json:"packets_per_second"`
- // Usage depends on specific alert type
- PoolID []string `json:"pool_id"`
- // Used for configuring billing_usage_alert
- Product []string `json:"product"`
- // Used for configuring pages_event_alert
- ProjectID []string `json:"project_id"`
- // Used for configuring advanced_ddos_attack_l4_alert
- Protocol []string `json:"protocol"`
- // Usage depends on specific alert type
- QueryTag []string `json:"query_tag"`
- // Used for configuring advanced_ddos_attack_l7_alert
- RequestsPerSecond []string `json:"requests_per_second"`
- // Usage depends on specific alert type
- Selectors []string `json:"selectors"`
- // Used for configuring clickhouse_alert_fw_ent_anomaly
- Services []string `json:"services"`
- // Usage depends on specific alert type
- Slo []string `json:"slo"`
- // Used for configuring health_check_status_notification
- Status []string `json:"status"`
- // Used for configuring advanced_ddos_attack_l7_alert
- TargetHostname []string `json:"target_hostname"`
- // Used for configuring advanced_ddos_attack_l4_alert
- TargetIP []string `json:"target_ip"`
- // Used for configuring advanced_ddos_attack_l7_alert
- TargetZoneName []string `json:"target_zone_name"`
- // Used for configuring traffic_anomalies_alert
- TrafficExclusions []AlertingV3PolicyGetResponseFiltersTrafficExclusion `json:"traffic_exclusions"`
- // Used for configuring tunnel_health_event
- TunnelID []string `json:"tunnel_id"`
- // Used for configuring magic_tunnel_health_check_event
- TunnelName []string `json:"tunnel_name"`
- // Usage depends on specific alert type
- Where []string `json:"where"`
- // Usage depends on specific alert type
- Zones []string `json:"zones"`
- JSON alertingV3PolicyGetResponseFiltersJSON `json:"-"`
-}
-
-// alertingV3PolicyGetResponseFiltersJSON contains the JSON metadata for the struct
-// [AlertingV3PolicyGetResponseFilters]
-type alertingV3PolicyGetResponseFiltersJSON struct {
- Actions apijson.Field
- AffectedASNs apijson.Field
- AffectedComponents apijson.Field
- AffectedLocations apijson.Field
- AirportCode apijson.Field
- AlertTriggerPreferences apijson.Field
- AlertTriggerPreferencesValue apijson.Field
- Enabled apijson.Field
- Environment apijson.Field
- Event apijson.Field
- EventSource apijson.Field
- EventType apijson.Field
- GroupBy apijson.Field
- HealthCheckID apijson.Field
- IncidentImpact apijson.Field
- InputID apijson.Field
- Limit apijson.Field
- LogoTag apijson.Field
- MegabitsPerSecond apijson.Field
- NewHealth apijson.Field
- NewStatus apijson.Field
- PacketsPerSecond apijson.Field
- PoolID apijson.Field
- Product apijson.Field
- ProjectID apijson.Field
- Protocol apijson.Field
- QueryTag apijson.Field
- RequestsPerSecond apijson.Field
- Selectors apijson.Field
- Services apijson.Field
- Slo apijson.Field
- Status apijson.Field
- TargetHostname apijson.Field
- TargetIP apijson.Field
- TargetZoneName apijson.Field
- TrafficExclusions apijson.Field
- TunnelID apijson.Field
- TunnelName apijson.Field
- Where apijson.Field
- Zones apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AlertingV3PolicyGetResponseFilters) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r alertingV3PolicyGetResponseFiltersJSON) RawJSON() string {
- return r.raw
-}
-
-type AlertingV3PolicyGetResponseFiltersAlertTriggerPreferencesValue string
-
-const (
- AlertingV3PolicyGetResponseFiltersAlertTriggerPreferencesValue99_0 AlertingV3PolicyGetResponseFiltersAlertTriggerPreferencesValue = "99.0"
- AlertingV3PolicyGetResponseFiltersAlertTriggerPreferencesValue98_0 AlertingV3PolicyGetResponseFiltersAlertTriggerPreferencesValue = "98.0"
- AlertingV3PolicyGetResponseFiltersAlertTriggerPreferencesValue97_0 AlertingV3PolicyGetResponseFiltersAlertTriggerPreferencesValue = "97.0"
-)
-
-type AlertingV3PolicyGetResponseFiltersIncidentImpact string
-
-const (
- AlertingV3PolicyGetResponseFiltersIncidentImpactIncidentImpactNone AlertingV3PolicyGetResponseFiltersIncidentImpact = "INCIDENT_IMPACT_NONE"
- AlertingV3PolicyGetResponseFiltersIncidentImpactIncidentImpactMinor AlertingV3PolicyGetResponseFiltersIncidentImpact = "INCIDENT_IMPACT_MINOR"
- AlertingV3PolicyGetResponseFiltersIncidentImpactIncidentImpactMajor AlertingV3PolicyGetResponseFiltersIncidentImpact = "INCIDENT_IMPACT_MAJOR"
- AlertingV3PolicyGetResponseFiltersIncidentImpactIncidentImpactCritical AlertingV3PolicyGetResponseFiltersIncidentImpact = "INCIDENT_IMPACT_CRITICAL"
-)
-
-type AlertingV3PolicyGetResponseFiltersTrafficExclusion string
-
-const (
- AlertingV3PolicyGetResponseFiltersTrafficExclusionSecurityEvents AlertingV3PolicyGetResponseFiltersTrafficExclusion = "security_events"
-)
-
-type AlertingV3PolicyGetResponseMechanisms struct {
- // UUID
- ID AlertingV3PolicyGetResponseMechanismsID `json:"id"`
- JSON alertingV3PolicyGetResponseMechanismsJSON `json:"-"`
-}
-
-// alertingV3PolicyGetResponseMechanismsJSON contains the JSON metadata for the
-// struct [AlertingV3PolicyGetResponseMechanisms]
-type alertingV3PolicyGetResponseMechanismsJSON struct {
- ID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AlertingV3PolicyGetResponseMechanisms) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r alertingV3PolicyGetResponseMechanismsJSON) RawJSON() string {
- return r.raw
-}
-
-// UUID
-//
-// Union satisfied by [shared.UnionString] or [shared.UnionString].
-type AlertingV3PolicyGetResponseMechanismsID interface {
- ImplementsAlertingV3PolicyGetResponseMechanismsID()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*AlertingV3PolicyGetResponseMechanismsID)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-type AlertingV3PolicyNewParams struct {
- // The account id
- AccountID param.Field[string] `path:"account_id,required"`
- // Refers to which event will trigger a Notification dispatch. You can use the
- // endpoint to get available alert types which then will give you a list of
- // possible values.
- AlertType param.Field[AlertingV3PolicyNewParamsAlertType] `json:"alert_type,required"`
- // Whether or not the Notification policy is enabled.
- Enabled param.Field[bool] `json:"enabled,required"`
- // List of IDs that will be used when dispatching a notification. IDs for email
- // type will be the email address.
- Mechanisms param.Field[map[string][]AlertingV3PolicyNewParamsMechanisms] `json:"mechanisms,required"`
- // Name of the policy.
- Name param.Field[string] `json:"name,required"`
- // Optional description for the Notification policy.
- Description param.Field[string] `json:"description"`
- // Optional filters that allow you to be alerted only on a subset of events for
- // that alert type based on some criteria. This is only available for select alert
- // types. See alert type documentation for more details.
- Filters param.Field[AlertingV3PolicyNewParamsFilters] `json:"filters"`
-}
-
-func (r AlertingV3PolicyNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Refers to which event will trigger a Notification dispatch. You can use the
-// endpoint to get available alert types which then will give you a list of
-// possible values.
-type AlertingV3PolicyNewParamsAlertType string
-
-const (
- AlertingV3PolicyNewParamsAlertTypeAccessCustomCertificateExpirationType AlertingV3PolicyNewParamsAlertType = "access_custom_certificate_expiration_type"
- AlertingV3PolicyNewParamsAlertTypeAdvancedDDOSAttackL4Alert AlertingV3PolicyNewParamsAlertType = "advanced_ddos_attack_l4_alert"
- AlertingV3PolicyNewParamsAlertTypeAdvancedDDOSAttackL7Alert AlertingV3PolicyNewParamsAlertType = "advanced_ddos_attack_l7_alert"
- AlertingV3PolicyNewParamsAlertTypeAdvancedHTTPAlertError AlertingV3PolicyNewParamsAlertType = "advanced_http_alert_error"
- AlertingV3PolicyNewParamsAlertTypeBGPHijackNotification AlertingV3PolicyNewParamsAlertType = "bgp_hijack_notification"
- AlertingV3PolicyNewParamsAlertTypeBillingUsageAlert AlertingV3PolicyNewParamsAlertType = "billing_usage_alert"
- AlertingV3PolicyNewParamsAlertTypeBlockNotificationBlockRemoved AlertingV3PolicyNewParamsAlertType = "block_notification_block_removed"
- AlertingV3PolicyNewParamsAlertTypeBlockNotificationNewBlock AlertingV3PolicyNewParamsAlertType = "block_notification_new_block"
- AlertingV3PolicyNewParamsAlertTypeBlockNotificationReviewRejected AlertingV3PolicyNewParamsAlertType = "block_notification_review_rejected"
- AlertingV3PolicyNewParamsAlertTypeBrandProtectionAlert AlertingV3PolicyNewParamsAlertType = "brand_protection_alert"
- AlertingV3PolicyNewParamsAlertTypeBrandProtectionDigest AlertingV3PolicyNewParamsAlertType = "brand_protection_digest"
- AlertingV3PolicyNewParamsAlertTypeClickhouseAlertFwAnomaly AlertingV3PolicyNewParamsAlertType = "clickhouse_alert_fw_anomaly"
- AlertingV3PolicyNewParamsAlertTypeClickhouseAlertFwEntAnomaly AlertingV3PolicyNewParamsAlertType = "clickhouse_alert_fw_ent_anomaly"
- AlertingV3PolicyNewParamsAlertTypeCustomSSLCertificateEventType AlertingV3PolicyNewParamsAlertType = "custom_ssl_certificate_event_type"
- AlertingV3PolicyNewParamsAlertTypeDedicatedSSLCertificateEventType AlertingV3PolicyNewParamsAlertType = "dedicated_ssl_certificate_event_type"
- AlertingV3PolicyNewParamsAlertTypeDosAttackL4 AlertingV3PolicyNewParamsAlertType = "dos_attack_l4"
- AlertingV3PolicyNewParamsAlertTypeDosAttackL7 AlertingV3PolicyNewParamsAlertType = "dos_attack_l7"
- AlertingV3PolicyNewParamsAlertTypeExpiringServiceTokenAlert AlertingV3PolicyNewParamsAlertType = "expiring_service_token_alert"
- AlertingV3PolicyNewParamsAlertTypeFailingLogpushJobDisabledAlert AlertingV3PolicyNewParamsAlertType = "failing_logpush_job_disabled_alert"
- AlertingV3PolicyNewParamsAlertTypeFbmAutoAdvertisement AlertingV3PolicyNewParamsAlertType = "fbm_auto_advertisement"
- AlertingV3PolicyNewParamsAlertTypeFbmDosdAttack AlertingV3PolicyNewParamsAlertType = "fbm_dosd_attack"
- AlertingV3PolicyNewParamsAlertTypeFbmVolumetricAttack AlertingV3PolicyNewParamsAlertType = "fbm_volumetric_attack"
- AlertingV3PolicyNewParamsAlertTypeHealthCheckStatusNotification AlertingV3PolicyNewParamsAlertType = "health_check_status_notification"
- AlertingV3PolicyNewParamsAlertTypeHostnameAopCustomCertificateExpirationType AlertingV3PolicyNewParamsAlertType = "hostname_aop_custom_certificate_expiration_type"
- AlertingV3PolicyNewParamsAlertTypeHTTPAlertEdgeError AlertingV3PolicyNewParamsAlertType = "http_alert_edge_error"
- AlertingV3PolicyNewParamsAlertTypeHTTPAlertOriginError AlertingV3PolicyNewParamsAlertType = "http_alert_origin_error"
- AlertingV3PolicyNewParamsAlertTypeIncidentAlert AlertingV3PolicyNewParamsAlertType = "incident_alert"
- AlertingV3PolicyNewParamsAlertTypeLoadBalancingHealthAlert AlertingV3PolicyNewParamsAlertType = "load_balancing_health_alert"
- AlertingV3PolicyNewParamsAlertTypeLoadBalancingPoolEnablementAlert AlertingV3PolicyNewParamsAlertType = "load_balancing_pool_enablement_alert"
- AlertingV3PolicyNewParamsAlertTypeLogoMatchAlert AlertingV3PolicyNewParamsAlertType = "logo_match_alert"
- AlertingV3PolicyNewParamsAlertTypeMagicTunnelHealthCheckEvent AlertingV3PolicyNewParamsAlertType = "magic_tunnel_health_check_event"
- AlertingV3PolicyNewParamsAlertTypeMaintenanceEventNotification AlertingV3PolicyNewParamsAlertType = "maintenance_event_notification"
- AlertingV3PolicyNewParamsAlertTypeMTLSCertificateStoreCertificateExpirationType AlertingV3PolicyNewParamsAlertType = "mtls_certificate_store_certificate_expiration_type"
- AlertingV3PolicyNewParamsAlertTypePagesEventAlert AlertingV3PolicyNewParamsAlertType = "pages_event_alert"
- AlertingV3PolicyNewParamsAlertTypeRadarNotification AlertingV3PolicyNewParamsAlertType = "radar_notification"
- AlertingV3PolicyNewParamsAlertTypeRealOriginMonitoring AlertingV3PolicyNewParamsAlertType = "real_origin_monitoring"
- AlertingV3PolicyNewParamsAlertTypeScriptmonitorAlertNewCodeChangeDetections AlertingV3PolicyNewParamsAlertType = "scriptmonitor_alert_new_code_change_detections"
- AlertingV3PolicyNewParamsAlertTypeScriptmonitorAlertNewHosts AlertingV3PolicyNewParamsAlertType = "scriptmonitor_alert_new_hosts"
- AlertingV3PolicyNewParamsAlertTypeScriptmonitorAlertNewMaliciousHosts AlertingV3PolicyNewParamsAlertType = "scriptmonitor_alert_new_malicious_hosts"
- AlertingV3PolicyNewParamsAlertTypeScriptmonitorAlertNewMaliciousScripts AlertingV3PolicyNewParamsAlertType = "scriptmonitor_alert_new_malicious_scripts"
- AlertingV3PolicyNewParamsAlertTypeScriptmonitorAlertNewMaliciousURL AlertingV3PolicyNewParamsAlertType = "scriptmonitor_alert_new_malicious_url"
- AlertingV3PolicyNewParamsAlertTypeScriptmonitorAlertNewMaxLengthResourceURL AlertingV3PolicyNewParamsAlertType = "scriptmonitor_alert_new_max_length_resource_url"
- AlertingV3PolicyNewParamsAlertTypeScriptmonitorAlertNewResources AlertingV3PolicyNewParamsAlertType = "scriptmonitor_alert_new_resources"
- AlertingV3PolicyNewParamsAlertTypeSecondaryDNSAllPrimariesFailing AlertingV3PolicyNewParamsAlertType = "secondary_dns_all_primaries_failing"
- AlertingV3PolicyNewParamsAlertTypeSecondaryDNSPrimariesFailing AlertingV3PolicyNewParamsAlertType = "secondary_dns_primaries_failing"
- AlertingV3PolicyNewParamsAlertTypeSecondaryDNSZoneSuccessfullyUpdated AlertingV3PolicyNewParamsAlertType = "secondary_dns_zone_successfully_updated"
- AlertingV3PolicyNewParamsAlertTypeSecondaryDNSZoneValidationWarning AlertingV3PolicyNewParamsAlertType = "secondary_dns_zone_validation_warning"
- AlertingV3PolicyNewParamsAlertTypeSentinelAlert AlertingV3PolicyNewParamsAlertType = "sentinel_alert"
- AlertingV3PolicyNewParamsAlertTypeStreamLiveNotifications AlertingV3PolicyNewParamsAlertType = "stream_live_notifications"
- AlertingV3PolicyNewParamsAlertTypeTunnelHealthEvent AlertingV3PolicyNewParamsAlertType = "tunnel_health_event"
- AlertingV3PolicyNewParamsAlertTypeTunnelUpdateEvent AlertingV3PolicyNewParamsAlertType = "tunnel_update_event"
- AlertingV3PolicyNewParamsAlertTypeUniversalSSLEventType AlertingV3PolicyNewParamsAlertType = "universal_ssl_event_type"
- AlertingV3PolicyNewParamsAlertTypeWebAnalyticsMetricsUpdate AlertingV3PolicyNewParamsAlertType = "web_analytics_metrics_update"
- AlertingV3PolicyNewParamsAlertTypeZoneAopCustomCertificateExpirationType AlertingV3PolicyNewParamsAlertType = "zone_aop_custom_certificate_expiration_type"
-)
-
-type AlertingV3PolicyNewParamsMechanisms struct {
- // UUID
- ID param.Field[AlertingV3PolicyNewParamsMechanismsID] `json:"id"`
-}
-
-func (r AlertingV3PolicyNewParamsMechanisms) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// UUID
-//
-// Satisfied by [shared.UnionString], [shared.UnionString].
-type AlertingV3PolicyNewParamsMechanismsID interface {
- ImplementsAlertingV3PolicyNewParamsMechanismsID()
-}
-
-// Optional filters that allow you to be alerted only on a subset of events for
-// that alert type based on some criteria. This is only available for select alert
-// types. See alert type documentation for more details.
-type AlertingV3PolicyNewParamsFilters struct {
- // Usage depends on specific alert type
- Actions param.Field[[]string] `json:"actions"`
- // Used for configuring radar_notification
- AffectedASNs param.Field[[]string] `json:"affected_asns"`
- // Used for configuring incident_alert
- AffectedComponents param.Field[[]string] `json:"affected_components"`
- // Used for configuring radar_notification
- AffectedLocations param.Field[[]string] `json:"affected_locations"`
- // Used for configuring maintenance_event_notification
- AirportCode param.Field[[]string] `json:"airport_code"`
- // Usage depends on specific alert type
- AlertTriggerPreferences param.Field[[]string] `json:"alert_trigger_preferences"`
- // Used for configuring magic_tunnel_health_check_event
- AlertTriggerPreferencesValue param.Field[[]AlertingV3PolicyNewParamsFiltersAlertTriggerPreferencesValue] `json:"alert_trigger_preferences_value"`
- // Used for configuring load_balancing_pool_enablement_alert
- Enabled param.Field[[]string] `json:"enabled"`
- // Used for configuring pages_event_alert
- Environment param.Field[[]string] `json:"environment"`
- // Used for configuring pages_event_alert
- Event param.Field[[]string] `json:"event"`
- // Used for configuring load_balancing_health_alert
- EventSource param.Field[[]string] `json:"event_source"`
- // Usage depends on specific alert type
- EventType param.Field[[]string] `json:"event_type"`
- // Usage depends on specific alert type
- GroupBy param.Field[[]string] `json:"group_by"`
- // Used for configuring health_check_status_notification
- HealthCheckID param.Field[[]string] `json:"health_check_id"`
- // Used for configuring incident_alert
- IncidentImpact param.Field[[]AlertingV3PolicyNewParamsFiltersIncidentImpact] `json:"incident_impact"`
- // Used for configuring stream_live_notifications
- InputID param.Field[[]string] `json:"input_id"`
- // Used for configuring billing_usage_alert
- Limit param.Field[[]string] `json:"limit"`
- // Used for configuring logo_match_alert
- LogoTag param.Field[[]string] `json:"logo_tag"`
- // Used for configuring advanced_ddos_attack_l4_alert
- MegabitsPerSecond param.Field[[]string] `json:"megabits_per_second"`
- // Used for configuring load_balancing_health_alert
- NewHealth param.Field[[]string] `json:"new_health"`
- // Used for configuring tunnel_health_event
- NewStatus param.Field[[]string] `json:"new_status"`
- // Used for configuring advanced_ddos_attack_l4_alert
- PacketsPerSecond param.Field[[]string] `json:"packets_per_second"`
- // Usage depends on specific alert type
- PoolID param.Field[[]string] `json:"pool_id"`
- // Used for configuring billing_usage_alert
- Product param.Field[[]string] `json:"product"`
- // Used for configuring pages_event_alert
- ProjectID param.Field[[]string] `json:"project_id"`
- // Used for configuring advanced_ddos_attack_l4_alert
- Protocol param.Field[[]string] `json:"protocol"`
- // Usage depends on specific alert type
- QueryTag param.Field[[]string] `json:"query_tag"`
- // Used for configuring advanced_ddos_attack_l7_alert
- RequestsPerSecond param.Field[[]string] `json:"requests_per_second"`
- // Usage depends on specific alert type
- Selectors param.Field[[]string] `json:"selectors"`
- // Used for configuring clickhouse_alert_fw_ent_anomaly
- Services param.Field[[]string] `json:"services"`
- // Usage depends on specific alert type
- Slo param.Field[[]string] `json:"slo"`
- // Used for configuring health_check_status_notification
- Status param.Field[[]string] `json:"status"`
- // Used for configuring advanced_ddos_attack_l7_alert
- TargetHostname param.Field[[]string] `json:"target_hostname"`
- // Used for configuring advanced_ddos_attack_l4_alert
- TargetIP param.Field[[]string] `json:"target_ip"`
- // Used for configuring advanced_ddos_attack_l7_alert
- TargetZoneName param.Field[[]string] `json:"target_zone_name"`
- // Used for configuring traffic_anomalies_alert
- TrafficExclusions param.Field[[]AlertingV3PolicyNewParamsFiltersTrafficExclusion] `json:"traffic_exclusions"`
- // Used for configuring tunnel_health_event
- TunnelID param.Field[[]string] `json:"tunnel_id"`
- // Used for configuring magic_tunnel_health_check_event
- TunnelName param.Field[[]string] `json:"tunnel_name"`
- // Usage depends on specific alert type
- Where param.Field[[]string] `json:"where"`
- // Usage depends on specific alert type
- Zones param.Field[[]string] `json:"zones"`
-}
-
-func (r AlertingV3PolicyNewParamsFilters) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type AlertingV3PolicyNewParamsFiltersAlertTriggerPreferencesValue string
-
-const (
- AlertingV3PolicyNewParamsFiltersAlertTriggerPreferencesValue99_0 AlertingV3PolicyNewParamsFiltersAlertTriggerPreferencesValue = "99.0"
- AlertingV3PolicyNewParamsFiltersAlertTriggerPreferencesValue98_0 AlertingV3PolicyNewParamsFiltersAlertTriggerPreferencesValue = "98.0"
- AlertingV3PolicyNewParamsFiltersAlertTriggerPreferencesValue97_0 AlertingV3PolicyNewParamsFiltersAlertTriggerPreferencesValue = "97.0"
-)
-
-type AlertingV3PolicyNewParamsFiltersIncidentImpact string
-
-const (
- AlertingV3PolicyNewParamsFiltersIncidentImpactIncidentImpactNone AlertingV3PolicyNewParamsFiltersIncidentImpact = "INCIDENT_IMPACT_NONE"
- AlertingV3PolicyNewParamsFiltersIncidentImpactIncidentImpactMinor AlertingV3PolicyNewParamsFiltersIncidentImpact = "INCIDENT_IMPACT_MINOR"
- AlertingV3PolicyNewParamsFiltersIncidentImpactIncidentImpactMajor AlertingV3PolicyNewParamsFiltersIncidentImpact = "INCIDENT_IMPACT_MAJOR"
- AlertingV3PolicyNewParamsFiltersIncidentImpactIncidentImpactCritical AlertingV3PolicyNewParamsFiltersIncidentImpact = "INCIDENT_IMPACT_CRITICAL"
-)
-
-type AlertingV3PolicyNewParamsFiltersTrafficExclusion string
-
-const (
- AlertingV3PolicyNewParamsFiltersTrafficExclusionSecurityEvents AlertingV3PolicyNewParamsFiltersTrafficExclusion = "security_events"
-)
-
-type AlertingV3PolicyNewResponseEnvelope struct {
- Errors []AlertingV3PolicyNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []AlertingV3PolicyNewResponseEnvelopeMessages `json:"messages,required"`
- Result AlertingV3PolicyNewResponse `json:"result,required"`
- // Whether the API call was successful
- Success AlertingV3PolicyNewResponseEnvelopeSuccess `json:"success,required"`
- JSON alertingV3PolicyNewResponseEnvelopeJSON `json:"-"`
-}
-
-// alertingV3PolicyNewResponseEnvelopeJSON contains the JSON metadata for the
-// struct [AlertingV3PolicyNewResponseEnvelope]
-type alertingV3PolicyNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AlertingV3PolicyNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r alertingV3PolicyNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type AlertingV3PolicyNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON alertingV3PolicyNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// alertingV3PolicyNewResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [AlertingV3PolicyNewResponseEnvelopeErrors]
-type alertingV3PolicyNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AlertingV3PolicyNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r alertingV3PolicyNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type AlertingV3PolicyNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON alertingV3PolicyNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// alertingV3PolicyNewResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [AlertingV3PolicyNewResponseEnvelopeMessages]
-type alertingV3PolicyNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AlertingV3PolicyNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r alertingV3PolicyNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type AlertingV3PolicyNewResponseEnvelopeSuccess bool
-
-const (
- AlertingV3PolicyNewResponseEnvelopeSuccessTrue AlertingV3PolicyNewResponseEnvelopeSuccess = true
-)
-
-type AlertingV3PolicyUpdateParams struct {
- // The account id
- AccountID param.Field[string] `path:"account_id,required"`
- // Refers to which event will trigger a Notification dispatch. You can use the
- // endpoint to get available alert types which then will give you a list of
- // possible values.
- AlertType param.Field[AlertingV3PolicyUpdateParamsAlertType] `json:"alert_type"`
- // Optional description for the Notification policy.
- Description param.Field[string] `json:"description"`
- // Whether or not the Notification policy is enabled.
- Enabled param.Field[bool] `json:"enabled"`
- // Optional filters that allow you to be alerted only on a subset of events for
- // that alert type based on some criteria. This is only available for select alert
- // types. See alert type documentation for more details.
- Filters param.Field[AlertingV3PolicyUpdateParamsFilters] `json:"filters"`
- // List of IDs that will be used when dispatching a notification. IDs for email
- // type will be the email address.
- Mechanisms param.Field[map[string][]AlertingV3PolicyUpdateParamsMechanisms] `json:"mechanisms"`
- // Name of the policy.
- Name param.Field[string] `json:"name"`
-}
-
-func (r AlertingV3PolicyUpdateParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Refers to which event will trigger a Notification dispatch. You can use the
-// endpoint to get available alert types which then will give you a list of
-// possible values.
-type AlertingV3PolicyUpdateParamsAlertType string
-
-const (
- AlertingV3PolicyUpdateParamsAlertTypeAccessCustomCertificateExpirationType AlertingV3PolicyUpdateParamsAlertType = "access_custom_certificate_expiration_type"
- AlertingV3PolicyUpdateParamsAlertTypeAdvancedDDOSAttackL4Alert AlertingV3PolicyUpdateParamsAlertType = "advanced_ddos_attack_l4_alert"
- AlertingV3PolicyUpdateParamsAlertTypeAdvancedDDOSAttackL7Alert AlertingV3PolicyUpdateParamsAlertType = "advanced_ddos_attack_l7_alert"
- AlertingV3PolicyUpdateParamsAlertTypeAdvancedHTTPAlertError AlertingV3PolicyUpdateParamsAlertType = "advanced_http_alert_error"
- AlertingV3PolicyUpdateParamsAlertTypeBGPHijackNotification AlertingV3PolicyUpdateParamsAlertType = "bgp_hijack_notification"
- AlertingV3PolicyUpdateParamsAlertTypeBillingUsageAlert AlertingV3PolicyUpdateParamsAlertType = "billing_usage_alert"
- AlertingV3PolicyUpdateParamsAlertTypeBlockNotificationBlockRemoved AlertingV3PolicyUpdateParamsAlertType = "block_notification_block_removed"
- AlertingV3PolicyUpdateParamsAlertTypeBlockNotificationNewBlock AlertingV3PolicyUpdateParamsAlertType = "block_notification_new_block"
- AlertingV3PolicyUpdateParamsAlertTypeBlockNotificationReviewRejected AlertingV3PolicyUpdateParamsAlertType = "block_notification_review_rejected"
- AlertingV3PolicyUpdateParamsAlertTypeBrandProtectionAlert AlertingV3PolicyUpdateParamsAlertType = "brand_protection_alert"
- AlertingV3PolicyUpdateParamsAlertTypeBrandProtectionDigest AlertingV3PolicyUpdateParamsAlertType = "brand_protection_digest"
- AlertingV3PolicyUpdateParamsAlertTypeClickhouseAlertFwAnomaly AlertingV3PolicyUpdateParamsAlertType = "clickhouse_alert_fw_anomaly"
- AlertingV3PolicyUpdateParamsAlertTypeClickhouseAlertFwEntAnomaly AlertingV3PolicyUpdateParamsAlertType = "clickhouse_alert_fw_ent_anomaly"
- AlertingV3PolicyUpdateParamsAlertTypeCustomSSLCertificateEventType AlertingV3PolicyUpdateParamsAlertType = "custom_ssl_certificate_event_type"
- AlertingV3PolicyUpdateParamsAlertTypeDedicatedSSLCertificateEventType AlertingV3PolicyUpdateParamsAlertType = "dedicated_ssl_certificate_event_type"
- AlertingV3PolicyUpdateParamsAlertTypeDosAttackL4 AlertingV3PolicyUpdateParamsAlertType = "dos_attack_l4"
- AlertingV3PolicyUpdateParamsAlertTypeDosAttackL7 AlertingV3PolicyUpdateParamsAlertType = "dos_attack_l7"
- AlertingV3PolicyUpdateParamsAlertTypeExpiringServiceTokenAlert AlertingV3PolicyUpdateParamsAlertType = "expiring_service_token_alert"
- AlertingV3PolicyUpdateParamsAlertTypeFailingLogpushJobDisabledAlert AlertingV3PolicyUpdateParamsAlertType = "failing_logpush_job_disabled_alert"
- AlertingV3PolicyUpdateParamsAlertTypeFbmAutoAdvertisement AlertingV3PolicyUpdateParamsAlertType = "fbm_auto_advertisement"
- AlertingV3PolicyUpdateParamsAlertTypeFbmDosdAttack AlertingV3PolicyUpdateParamsAlertType = "fbm_dosd_attack"
- AlertingV3PolicyUpdateParamsAlertTypeFbmVolumetricAttack AlertingV3PolicyUpdateParamsAlertType = "fbm_volumetric_attack"
- AlertingV3PolicyUpdateParamsAlertTypeHealthCheckStatusNotification AlertingV3PolicyUpdateParamsAlertType = "health_check_status_notification"
- AlertingV3PolicyUpdateParamsAlertTypeHostnameAopCustomCertificateExpirationType AlertingV3PolicyUpdateParamsAlertType = "hostname_aop_custom_certificate_expiration_type"
- AlertingV3PolicyUpdateParamsAlertTypeHTTPAlertEdgeError AlertingV3PolicyUpdateParamsAlertType = "http_alert_edge_error"
- AlertingV3PolicyUpdateParamsAlertTypeHTTPAlertOriginError AlertingV3PolicyUpdateParamsAlertType = "http_alert_origin_error"
- AlertingV3PolicyUpdateParamsAlertTypeIncidentAlert AlertingV3PolicyUpdateParamsAlertType = "incident_alert"
- AlertingV3PolicyUpdateParamsAlertTypeLoadBalancingHealthAlert AlertingV3PolicyUpdateParamsAlertType = "load_balancing_health_alert"
- AlertingV3PolicyUpdateParamsAlertTypeLoadBalancingPoolEnablementAlert AlertingV3PolicyUpdateParamsAlertType = "load_balancing_pool_enablement_alert"
- AlertingV3PolicyUpdateParamsAlertTypeLogoMatchAlert AlertingV3PolicyUpdateParamsAlertType = "logo_match_alert"
- AlertingV3PolicyUpdateParamsAlertTypeMagicTunnelHealthCheckEvent AlertingV3PolicyUpdateParamsAlertType = "magic_tunnel_health_check_event"
- AlertingV3PolicyUpdateParamsAlertTypeMaintenanceEventNotification AlertingV3PolicyUpdateParamsAlertType = "maintenance_event_notification"
- AlertingV3PolicyUpdateParamsAlertTypeMTLSCertificateStoreCertificateExpirationType AlertingV3PolicyUpdateParamsAlertType = "mtls_certificate_store_certificate_expiration_type"
- AlertingV3PolicyUpdateParamsAlertTypePagesEventAlert AlertingV3PolicyUpdateParamsAlertType = "pages_event_alert"
- AlertingV3PolicyUpdateParamsAlertTypeRadarNotification AlertingV3PolicyUpdateParamsAlertType = "radar_notification"
- AlertingV3PolicyUpdateParamsAlertTypeRealOriginMonitoring AlertingV3PolicyUpdateParamsAlertType = "real_origin_monitoring"
- AlertingV3PolicyUpdateParamsAlertTypeScriptmonitorAlertNewCodeChangeDetections AlertingV3PolicyUpdateParamsAlertType = "scriptmonitor_alert_new_code_change_detections"
- AlertingV3PolicyUpdateParamsAlertTypeScriptmonitorAlertNewHosts AlertingV3PolicyUpdateParamsAlertType = "scriptmonitor_alert_new_hosts"
- AlertingV3PolicyUpdateParamsAlertTypeScriptmonitorAlertNewMaliciousHosts AlertingV3PolicyUpdateParamsAlertType = "scriptmonitor_alert_new_malicious_hosts"
- AlertingV3PolicyUpdateParamsAlertTypeScriptmonitorAlertNewMaliciousScripts AlertingV3PolicyUpdateParamsAlertType = "scriptmonitor_alert_new_malicious_scripts"
- AlertingV3PolicyUpdateParamsAlertTypeScriptmonitorAlertNewMaliciousURL AlertingV3PolicyUpdateParamsAlertType = "scriptmonitor_alert_new_malicious_url"
- AlertingV3PolicyUpdateParamsAlertTypeScriptmonitorAlertNewMaxLengthResourceURL AlertingV3PolicyUpdateParamsAlertType = "scriptmonitor_alert_new_max_length_resource_url"
- AlertingV3PolicyUpdateParamsAlertTypeScriptmonitorAlertNewResources AlertingV3PolicyUpdateParamsAlertType = "scriptmonitor_alert_new_resources"
- AlertingV3PolicyUpdateParamsAlertTypeSecondaryDNSAllPrimariesFailing AlertingV3PolicyUpdateParamsAlertType = "secondary_dns_all_primaries_failing"
- AlertingV3PolicyUpdateParamsAlertTypeSecondaryDNSPrimariesFailing AlertingV3PolicyUpdateParamsAlertType = "secondary_dns_primaries_failing"
- AlertingV3PolicyUpdateParamsAlertTypeSecondaryDNSZoneSuccessfullyUpdated AlertingV3PolicyUpdateParamsAlertType = "secondary_dns_zone_successfully_updated"
- AlertingV3PolicyUpdateParamsAlertTypeSecondaryDNSZoneValidationWarning AlertingV3PolicyUpdateParamsAlertType = "secondary_dns_zone_validation_warning"
- AlertingV3PolicyUpdateParamsAlertTypeSentinelAlert AlertingV3PolicyUpdateParamsAlertType = "sentinel_alert"
- AlertingV3PolicyUpdateParamsAlertTypeStreamLiveNotifications AlertingV3PolicyUpdateParamsAlertType = "stream_live_notifications"
- AlertingV3PolicyUpdateParamsAlertTypeTunnelHealthEvent AlertingV3PolicyUpdateParamsAlertType = "tunnel_health_event"
- AlertingV3PolicyUpdateParamsAlertTypeTunnelUpdateEvent AlertingV3PolicyUpdateParamsAlertType = "tunnel_update_event"
- AlertingV3PolicyUpdateParamsAlertTypeUniversalSSLEventType AlertingV3PolicyUpdateParamsAlertType = "universal_ssl_event_type"
- AlertingV3PolicyUpdateParamsAlertTypeWebAnalyticsMetricsUpdate AlertingV3PolicyUpdateParamsAlertType = "web_analytics_metrics_update"
- AlertingV3PolicyUpdateParamsAlertTypeZoneAopCustomCertificateExpirationType AlertingV3PolicyUpdateParamsAlertType = "zone_aop_custom_certificate_expiration_type"
-)
-
-// Optional filters that allow you to be alerted only on a subset of events for
-// that alert type based on some criteria. This is only available for select alert
-// types. See alert type documentation for more details.
-type AlertingV3PolicyUpdateParamsFilters struct {
- // Usage depends on specific alert type
- Actions param.Field[[]string] `json:"actions"`
- // Used for configuring radar_notification
- AffectedASNs param.Field[[]string] `json:"affected_asns"`
- // Used for configuring incident_alert
- AffectedComponents param.Field[[]string] `json:"affected_components"`
- // Used for configuring radar_notification
- AffectedLocations param.Field[[]string] `json:"affected_locations"`
- // Used for configuring maintenance_event_notification
- AirportCode param.Field[[]string] `json:"airport_code"`
- // Usage depends on specific alert type
- AlertTriggerPreferences param.Field[[]string] `json:"alert_trigger_preferences"`
- // Used for configuring magic_tunnel_health_check_event
- AlertTriggerPreferencesValue param.Field[[]AlertingV3PolicyUpdateParamsFiltersAlertTriggerPreferencesValue] `json:"alert_trigger_preferences_value"`
- // Used for configuring load_balancing_pool_enablement_alert
- Enabled param.Field[[]string] `json:"enabled"`
- // Used for configuring pages_event_alert
- Environment param.Field[[]string] `json:"environment"`
- // Used for configuring pages_event_alert
- Event param.Field[[]string] `json:"event"`
- // Used for configuring load_balancing_health_alert
- EventSource param.Field[[]string] `json:"event_source"`
- // Usage depends on specific alert type
- EventType param.Field[[]string] `json:"event_type"`
- // Usage depends on specific alert type
- GroupBy param.Field[[]string] `json:"group_by"`
- // Used for configuring health_check_status_notification
- HealthCheckID param.Field[[]string] `json:"health_check_id"`
- // Used for configuring incident_alert
- IncidentImpact param.Field[[]AlertingV3PolicyUpdateParamsFiltersIncidentImpact] `json:"incident_impact"`
- // Used for configuring stream_live_notifications
- InputID param.Field[[]string] `json:"input_id"`
- // Used for configuring billing_usage_alert
- Limit param.Field[[]string] `json:"limit"`
- // Used for configuring logo_match_alert
- LogoTag param.Field[[]string] `json:"logo_tag"`
- // Used for configuring advanced_ddos_attack_l4_alert
- MegabitsPerSecond param.Field[[]string] `json:"megabits_per_second"`
- // Used for configuring load_balancing_health_alert
- NewHealth param.Field[[]string] `json:"new_health"`
- // Used for configuring tunnel_health_event
- NewStatus param.Field[[]string] `json:"new_status"`
- // Used for configuring advanced_ddos_attack_l4_alert
- PacketsPerSecond param.Field[[]string] `json:"packets_per_second"`
- // Usage depends on specific alert type
- PoolID param.Field[[]string] `json:"pool_id"`
- // Used for configuring billing_usage_alert
- Product param.Field[[]string] `json:"product"`
- // Used for configuring pages_event_alert
- ProjectID param.Field[[]string] `json:"project_id"`
- // Used for configuring advanced_ddos_attack_l4_alert
- Protocol param.Field[[]string] `json:"protocol"`
- // Usage depends on specific alert type
- QueryTag param.Field[[]string] `json:"query_tag"`
- // Used for configuring advanced_ddos_attack_l7_alert
- RequestsPerSecond param.Field[[]string] `json:"requests_per_second"`
- // Usage depends on specific alert type
- Selectors param.Field[[]string] `json:"selectors"`
- // Used for configuring clickhouse_alert_fw_ent_anomaly
- Services param.Field[[]string] `json:"services"`
- // Usage depends on specific alert type
- Slo param.Field[[]string] `json:"slo"`
- // Used for configuring health_check_status_notification
- Status param.Field[[]string] `json:"status"`
- // Used for configuring advanced_ddos_attack_l7_alert
- TargetHostname param.Field[[]string] `json:"target_hostname"`
- // Used for configuring advanced_ddos_attack_l4_alert
- TargetIP param.Field[[]string] `json:"target_ip"`
- // Used for configuring advanced_ddos_attack_l7_alert
- TargetZoneName param.Field[[]string] `json:"target_zone_name"`
- // Used for configuring traffic_anomalies_alert
- TrafficExclusions param.Field[[]AlertingV3PolicyUpdateParamsFiltersTrafficExclusion] `json:"traffic_exclusions"`
- // Used for configuring tunnel_health_event
- TunnelID param.Field[[]string] `json:"tunnel_id"`
- // Used for configuring magic_tunnel_health_check_event
- TunnelName param.Field[[]string] `json:"tunnel_name"`
- // Usage depends on specific alert type
- Where param.Field[[]string] `json:"where"`
- // Usage depends on specific alert type
- Zones param.Field[[]string] `json:"zones"`
-}
-
-func (r AlertingV3PolicyUpdateParamsFilters) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type AlertingV3PolicyUpdateParamsFiltersAlertTriggerPreferencesValue string
-
-const (
- AlertingV3PolicyUpdateParamsFiltersAlertTriggerPreferencesValue99_0 AlertingV3PolicyUpdateParamsFiltersAlertTriggerPreferencesValue = "99.0"
- AlertingV3PolicyUpdateParamsFiltersAlertTriggerPreferencesValue98_0 AlertingV3PolicyUpdateParamsFiltersAlertTriggerPreferencesValue = "98.0"
- AlertingV3PolicyUpdateParamsFiltersAlertTriggerPreferencesValue97_0 AlertingV3PolicyUpdateParamsFiltersAlertTriggerPreferencesValue = "97.0"
-)
-
-type AlertingV3PolicyUpdateParamsFiltersIncidentImpact string
-
-const (
- AlertingV3PolicyUpdateParamsFiltersIncidentImpactIncidentImpactNone AlertingV3PolicyUpdateParamsFiltersIncidentImpact = "INCIDENT_IMPACT_NONE"
- AlertingV3PolicyUpdateParamsFiltersIncidentImpactIncidentImpactMinor AlertingV3PolicyUpdateParamsFiltersIncidentImpact = "INCIDENT_IMPACT_MINOR"
- AlertingV3PolicyUpdateParamsFiltersIncidentImpactIncidentImpactMajor AlertingV3PolicyUpdateParamsFiltersIncidentImpact = "INCIDENT_IMPACT_MAJOR"
- AlertingV3PolicyUpdateParamsFiltersIncidentImpactIncidentImpactCritical AlertingV3PolicyUpdateParamsFiltersIncidentImpact = "INCIDENT_IMPACT_CRITICAL"
-)
-
-type AlertingV3PolicyUpdateParamsFiltersTrafficExclusion string
-
-const (
- AlertingV3PolicyUpdateParamsFiltersTrafficExclusionSecurityEvents AlertingV3PolicyUpdateParamsFiltersTrafficExclusion = "security_events"
-)
-
-type AlertingV3PolicyUpdateParamsMechanisms struct {
- // UUID
- ID param.Field[AlertingV3PolicyUpdateParamsMechanismsID] `json:"id"`
-}
-
-func (r AlertingV3PolicyUpdateParamsMechanisms) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// UUID
-//
-// Satisfied by [shared.UnionString], [shared.UnionString].
-type AlertingV3PolicyUpdateParamsMechanismsID interface {
- ImplementsAlertingV3PolicyUpdateParamsMechanismsID()
-}
-
-type AlertingV3PolicyUpdateResponseEnvelope struct {
- Errors []AlertingV3PolicyUpdateResponseEnvelopeErrors `json:"errors,required"`
- Messages []AlertingV3PolicyUpdateResponseEnvelopeMessages `json:"messages,required"`
- Result AlertingV3PolicyUpdateResponse `json:"result,required"`
- // Whether the API call was successful
- Success AlertingV3PolicyUpdateResponseEnvelopeSuccess `json:"success,required"`
- JSON alertingV3PolicyUpdateResponseEnvelopeJSON `json:"-"`
-}
-
-// alertingV3PolicyUpdateResponseEnvelopeJSON contains the JSON metadata for the
-// struct [AlertingV3PolicyUpdateResponseEnvelope]
-type alertingV3PolicyUpdateResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AlertingV3PolicyUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r alertingV3PolicyUpdateResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type AlertingV3PolicyUpdateResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON alertingV3PolicyUpdateResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// alertingV3PolicyUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [AlertingV3PolicyUpdateResponseEnvelopeErrors]
-type alertingV3PolicyUpdateResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AlertingV3PolicyUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r alertingV3PolicyUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type AlertingV3PolicyUpdateResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON alertingV3PolicyUpdateResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// alertingV3PolicyUpdateResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [AlertingV3PolicyUpdateResponseEnvelopeMessages]
-type alertingV3PolicyUpdateResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AlertingV3PolicyUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r alertingV3PolicyUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type AlertingV3PolicyUpdateResponseEnvelopeSuccess bool
-
-const (
- AlertingV3PolicyUpdateResponseEnvelopeSuccessTrue AlertingV3PolicyUpdateResponseEnvelopeSuccess = true
-)
-
-type AlertingV3PolicyListParams struct {
- // The account id
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type AlertingV3PolicyListResponseEnvelope struct {
- Errors []AlertingV3PolicyListResponseEnvelopeErrors `json:"errors,required"`
- Messages []AlertingV3PolicyListResponseEnvelopeMessages `json:"messages,required"`
- Result []AlertingV3PolicyListResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success AlertingV3PolicyListResponseEnvelopeSuccess `json:"success,required"`
- ResultInfo AlertingV3PolicyListResponseEnvelopeResultInfo `json:"result_info"`
- JSON alertingV3PolicyListResponseEnvelopeJSON `json:"-"`
-}
-
-// alertingV3PolicyListResponseEnvelopeJSON contains the JSON metadata for the
-// struct [AlertingV3PolicyListResponseEnvelope]
-type alertingV3PolicyListResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- ResultInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AlertingV3PolicyListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r alertingV3PolicyListResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type AlertingV3PolicyListResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON alertingV3PolicyListResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// alertingV3PolicyListResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [AlertingV3PolicyListResponseEnvelopeErrors]
-type alertingV3PolicyListResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AlertingV3PolicyListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r alertingV3PolicyListResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type AlertingV3PolicyListResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON alertingV3PolicyListResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// alertingV3PolicyListResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [AlertingV3PolicyListResponseEnvelopeMessages]
-type alertingV3PolicyListResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AlertingV3PolicyListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r alertingV3PolicyListResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type AlertingV3PolicyListResponseEnvelopeSuccess bool
-
-const (
- AlertingV3PolicyListResponseEnvelopeSuccessTrue AlertingV3PolicyListResponseEnvelopeSuccess = true
-)
-
-type AlertingV3PolicyListResponseEnvelopeResultInfo struct {
- // Total number of results for the requested service
- Count float64 `json:"count"`
- // Current page within paginated list of results
- Page float64 `json:"page"`
- // Number of results per page of results
- PerPage float64 `json:"per_page"`
- // Total results available without any search parameters
- TotalCount float64 `json:"total_count"`
- JSON alertingV3PolicyListResponseEnvelopeResultInfoJSON `json:"-"`
-}
-
-// alertingV3PolicyListResponseEnvelopeResultInfoJSON contains the JSON metadata
-// for the struct [AlertingV3PolicyListResponseEnvelopeResultInfo]
-type alertingV3PolicyListResponseEnvelopeResultInfoJSON struct {
- Count apijson.Field
- Page apijson.Field
- PerPage apijson.Field
- TotalCount apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AlertingV3PolicyListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r alertingV3PolicyListResponseEnvelopeResultInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type AlertingV3PolicyDeleteParams struct {
- // The account id
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type AlertingV3PolicyDeleteResponseEnvelope struct {
- Errors []AlertingV3PolicyDeleteResponseEnvelopeErrors `json:"errors,required"`
- Messages []AlertingV3PolicyDeleteResponseEnvelopeMessages `json:"messages,required"`
- Result AlertingV3PolicyDeleteResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success AlertingV3PolicyDeleteResponseEnvelopeSuccess `json:"success,required"`
- ResultInfo AlertingV3PolicyDeleteResponseEnvelopeResultInfo `json:"result_info"`
- JSON alertingV3PolicyDeleteResponseEnvelopeJSON `json:"-"`
-}
-
-// alertingV3PolicyDeleteResponseEnvelopeJSON contains the JSON metadata for the
-// struct [AlertingV3PolicyDeleteResponseEnvelope]
-type alertingV3PolicyDeleteResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- ResultInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AlertingV3PolicyDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r alertingV3PolicyDeleteResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type AlertingV3PolicyDeleteResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON alertingV3PolicyDeleteResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// alertingV3PolicyDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [AlertingV3PolicyDeleteResponseEnvelopeErrors]
-type alertingV3PolicyDeleteResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AlertingV3PolicyDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r alertingV3PolicyDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type AlertingV3PolicyDeleteResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON alertingV3PolicyDeleteResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// alertingV3PolicyDeleteResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [AlertingV3PolicyDeleteResponseEnvelopeMessages]
-type alertingV3PolicyDeleteResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AlertingV3PolicyDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r alertingV3PolicyDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type AlertingV3PolicyDeleteResponseEnvelopeSuccess bool
-
-const (
- AlertingV3PolicyDeleteResponseEnvelopeSuccessTrue AlertingV3PolicyDeleteResponseEnvelopeSuccess = true
-)
-
-type AlertingV3PolicyDeleteResponseEnvelopeResultInfo struct {
- // Total number of results for the requested service
- Count float64 `json:"count"`
- // Current page within paginated list of results
- Page float64 `json:"page"`
- // Number of results per page of results
- PerPage float64 `json:"per_page"`
- // Total results available without any search parameters
- TotalCount float64 `json:"total_count"`
- JSON alertingV3PolicyDeleteResponseEnvelopeResultInfoJSON `json:"-"`
-}
-
-// alertingV3PolicyDeleteResponseEnvelopeResultInfoJSON contains the JSON metadata
-// for the struct [AlertingV3PolicyDeleteResponseEnvelopeResultInfo]
-type alertingV3PolicyDeleteResponseEnvelopeResultInfoJSON struct {
- Count apijson.Field
- Page apijson.Field
- PerPage apijson.Field
- TotalCount apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AlertingV3PolicyDeleteResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r alertingV3PolicyDeleteResponseEnvelopeResultInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type AlertingV3PolicyGetParams struct {
- // The account id
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type AlertingV3PolicyGetResponseEnvelope struct {
- Errors []AlertingV3PolicyGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []AlertingV3PolicyGetResponseEnvelopeMessages `json:"messages,required"`
- Result AlertingV3PolicyGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success AlertingV3PolicyGetResponseEnvelopeSuccess `json:"success,required"`
- JSON alertingV3PolicyGetResponseEnvelopeJSON `json:"-"`
-}
-
-// alertingV3PolicyGetResponseEnvelopeJSON contains the JSON metadata for the
-// struct [AlertingV3PolicyGetResponseEnvelope]
-type alertingV3PolicyGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AlertingV3PolicyGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r alertingV3PolicyGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type AlertingV3PolicyGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON alertingV3PolicyGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// alertingV3PolicyGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [AlertingV3PolicyGetResponseEnvelopeErrors]
-type alertingV3PolicyGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AlertingV3PolicyGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r alertingV3PolicyGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type AlertingV3PolicyGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON alertingV3PolicyGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// alertingV3PolicyGetResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [AlertingV3PolicyGetResponseEnvelopeMessages]
-type alertingV3PolicyGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AlertingV3PolicyGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r alertingV3PolicyGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type AlertingV3PolicyGetResponseEnvelopeSuccess bool
-
-const (
- AlertingV3PolicyGetResponseEnvelopeSuccessTrue AlertingV3PolicyGetResponseEnvelopeSuccess = true
-)
diff --git a/alertingv3policy_test.go b/alertingv3policy_test.go
deleted file mode 100644
index ce9c0a6c3ec..00000000000
--- a/alertingv3policy_test.go
+++ /dev/null
@@ -1,271 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestAlertingV3PolicyNewWithOptionalParams(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"),
- )
- _, err := client.Alerting.V3.Policies.New(context.TODO(), cloudflare.AlertingV3PolicyNewParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- AlertType: cloudflare.F(cloudflare.AlertingV3PolicyNewParamsAlertTypeUniversalSSLEventType),
- Enabled: cloudflare.F(true),
- Mechanisms: cloudflare.F(map[string][]cloudflare.AlertingV3PolicyNewParamsMechanisms{
- "email": {{
- ID: cloudflare.F[cloudflare.AlertingV3PolicyNewParamsMechanismsID](shared.UnionString("test@example.com")),
- }},
- "pagerduty": {{
- ID: cloudflare.F[cloudflare.AlertingV3PolicyNewParamsMechanismsID](shared.UnionString("e8133a15-00a4-4d69-aec1-32f70c51f6e5")),
- }},
- "webhooks": {{
- ID: cloudflare.F[cloudflare.AlertingV3PolicyNewParamsMechanismsID](shared.UnionString("14cc1190-5d2b-4b98-a696-c424cb2ad05f")),
- }},
- }),
- Name: cloudflare.F("SSL Notification Event Policy"),
- Description: cloudflare.F("Something describing the policy."),
- Filters: cloudflare.F(cloudflare.AlertingV3PolicyNewParamsFilters{
- Actions: cloudflare.F([]string{"string", "string", "string"}),
- AffectedASNs: cloudflare.F([]string{"string", "string", "string"}),
- AffectedComponents: cloudflare.F([]string{"string", "string", "string"}),
- AffectedLocations: cloudflare.F([]string{"string", "string", "string"}),
- AirportCode: cloudflare.F([]string{"string", "string", "string"}),
- AlertTriggerPreferences: cloudflare.F([]string{"string", "string", "string"}),
- AlertTriggerPreferencesValue: cloudflare.F([]cloudflare.AlertingV3PolicyNewParamsFiltersAlertTriggerPreferencesValue{cloudflare.AlertingV3PolicyNewParamsFiltersAlertTriggerPreferencesValue99_0, cloudflare.AlertingV3PolicyNewParamsFiltersAlertTriggerPreferencesValue98_0, cloudflare.AlertingV3PolicyNewParamsFiltersAlertTriggerPreferencesValue97_0}),
- Enabled: cloudflare.F([]string{"string", "string", "string"}),
- Environment: cloudflare.F([]string{"string", "string", "string"}),
- Event: cloudflare.F([]string{"string", "string", "string"}),
- EventSource: cloudflare.F([]string{"string", "string", "string"}),
- EventType: cloudflare.F([]string{"string", "string", "string"}),
- GroupBy: cloudflare.F([]string{"string", "string", "string"}),
- HealthCheckID: cloudflare.F([]string{"string", "string", "string"}),
- IncidentImpact: cloudflare.F([]cloudflare.AlertingV3PolicyNewParamsFiltersIncidentImpact{cloudflare.AlertingV3PolicyNewParamsFiltersIncidentImpactIncidentImpactNone, cloudflare.AlertingV3PolicyNewParamsFiltersIncidentImpactIncidentImpactMinor, cloudflare.AlertingV3PolicyNewParamsFiltersIncidentImpactIncidentImpactMajor}),
- InputID: cloudflare.F([]string{"string", "string", "string"}),
- Limit: cloudflare.F([]string{"string", "string", "string"}),
- LogoTag: cloudflare.F([]string{"string", "string", "string"}),
- MegabitsPerSecond: cloudflare.F([]string{"string", "string", "string"}),
- NewHealth: cloudflare.F([]string{"string", "string", "string"}),
- NewStatus: cloudflare.F([]string{"string", "string", "string"}),
- PacketsPerSecond: cloudflare.F([]string{"string", "string", "string"}),
- PoolID: cloudflare.F([]string{"string", "string", "string"}),
- Product: cloudflare.F([]string{"string", "string", "string"}),
- ProjectID: cloudflare.F([]string{"string", "string", "string"}),
- Protocol: cloudflare.F([]string{"string", "string", "string"}),
- QueryTag: cloudflare.F([]string{"string", "string", "string"}),
- RequestsPerSecond: cloudflare.F([]string{"string", "string", "string"}),
- Selectors: cloudflare.F([]string{"string", "string", "string"}),
- Services: cloudflare.F([]string{"string", "string", "string"}),
- Slo: cloudflare.F([]string{"99.9"}),
- Status: cloudflare.F([]string{"string", "string", "string"}),
- TargetHostname: cloudflare.F([]string{"string", "string", "string"}),
- TargetIP: cloudflare.F([]string{"string", "string", "string"}),
- TargetZoneName: cloudflare.F([]string{"string", "string", "string"}),
- TrafficExclusions: cloudflare.F([]cloudflare.AlertingV3PolicyNewParamsFiltersTrafficExclusion{cloudflare.AlertingV3PolicyNewParamsFiltersTrafficExclusionSecurityEvents}),
- TunnelID: cloudflare.F([]string{"string", "string", "string"}),
- TunnelName: cloudflare.F([]string{"string", "string", "string"}),
- Where: cloudflare.F([]string{"string", "string", "string"}),
- Zones: 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())
- }
-}
-
-func TestAlertingV3PolicyUpdateWithOptionalParams(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"),
- )
- _, err := client.Alerting.V3.Policies.Update(
- context.TODO(),
- "0da2b59e-f118-439d-8097-bdfb215203c9",
- cloudflare.AlertingV3PolicyUpdateParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- AlertType: cloudflare.F(cloudflare.AlertingV3PolicyUpdateParamsAlertTypeUniversalSSLEventType),
- Description: cloudflare.F("Something describing the policy."),
- Enabled: cloudflare.F(true),
- Filters: cloudflare.F(cloudflare.AlertingV3PolicyUpdateParamsFilters{
- Actions: cloudflare.F([]string{"string", "string", "string"}),
- AffectedASNs: cloudflare.F([]string{"string", "string", "string"}),
- AffectedComponents: cloudflare.F([]string{"string", "string", "string"}),
- AffectedLocations: cloudflare.F([]string{"string", "string", "string"}),
- AirportCode: cloudflare.F([]string{"string", "string", "string"}),
- AlertTriggerPreferences: cloudflare.F([]string{"string", "string", "string"}),
- AlertTriggerPreferencesValue: cloudflare.F([]cloudflare.AlertingV3PolicyUpdateParamsFiltersAlertTriggerPreferencesValue{cloudflare.AlertingV3PolicyUpdateParamsFiltersAlertTriggerPreferencesValue99_0, cloudflare.AlertingV3PolicyUpdateParamsFiltersAlertTriggerPreferencesValue98_0, cloudflare.AlertingV3PolicyUpdateParamsFiltersAlertTriggerPreferencesValue97_0}),
- Enabled: cloudflare.F([]string{"string", "string", "string"}),
- Environment: cloudflare.F([]string{"string", "string", "string"}),
- Event: cloudflare.F([]string{"string", "string", "string"}),
- EventSource: cloudflare.F([]string{"string", "string", "string"}),
- EventType: cloudflare.F([]string{"string", "string", "string"}),
- GroupBy: cloudflare.F([]string{"string", "string", "string"}),
- HealthCheckID: cloudflare.F([]string{"string", "string", "string"}),
- IncidentImpact: cloudflare.F([]cloudflare.AlertingV3PolicyUpdateParamsFiltersIncidentImpact{cloudflare.AlertingV3PolicyUpdateParamsFiltersIncidentImpactIncidentImpactNone, cloudflare.AlertingV3PolicyUpdateParamsFiltersIncidentImpactIncidentImpactMinor, cloudflare.AlertingV3PolicyUpdateParamsFiltersIncidentImpactIncidentImpactMajor}),
- InputID: cloudflare.F([]string{"string", "string", "string"}),
- Limit: cloudflare.F([]string{"string", "string", "string"}),
- LogoTag: cloudflare.F([]string{"string", "string", "string"}),
- MegabitsPerSecond: cloudflare.F([]string{"string", "string", "string"}),
- NewHealth: cloudflare.F([]string{"string", "string", "string"}),
- NewStatus: cloudflare.F([]string{"string", "string", "string"}),
- PacketsPerSecond: cloudflare.F([]string{"string", "string", "string"}),
- PoolID: cloudflare.F([]string{"string", "string", "string"}),
- Product: cloudflare.F([]string{"string", "string", "string"}),
- ProjectID: cloudflare.F([]string{"string", "string", "string"}),
- Protocol: cloudflare.F([]string{"string", "string", "string"}),
- QueryTag: cloudflare.F([]string{"string", "string", "string"}),
- RequestsPerSecond: cloudflare.F([]string{"string", "string", "string"}),
- Selectors: cloudflare.F([]string{"string", "string", "string"}),
- Services: cloudflare.F([]string{"string", "string", "string"}),
- Slo: cloudflare.F([]string{"99.9"}),
- Status: cloudflare.F([]string{"string", "string", "string"}),
- TargetHostname: cloudflare.F([]string{"string", "string", "string"}),
- TargetIP: cloudflare.F([]string{"string", "string", "string"}),
- TargetZoneName: cloudflare.F([]string{"string", "string", "string"}),
- TrafficExclusions: cloudflare.F([]cloudflare.AlertingV3PolicyUpdateParamsFiltersTrafficExclusion{cloudflare.AlertingV3PolicyUpdateParamsFiltersTrafficExclusionSecurityEvents}),
- TunnelID: cloudflare.F([]string{"string", "string", "string"}),
- TunnelName: cloudflare.F([]string{"string", "string", "string"}),
- Where: cloudflare.F([]string{"string", "string", "string"}),
- Zones: cloudflare.F([]string{"string", "string", "string"}),
- }),
- Mechanisms: cloudflare.F(map[string][]cloudflare.AlertingV3PolicyUpdateParamsMechanisms{
- "email": {{
- ID: cloudflare.F[cloudflare.AlertingV3PolicyUpdateParamsMechanismsID](shared.UnionString("test@example.com")),
- }},
- "pagerduty": {{
- ID: cloudflare.F[cloudflare.AlertingV3PolicyUpdateParamsMechanismsID](shared.UnionString("e8133a15-00a4-4d69-aec1-32f70c51f6e5")),
- }},
- "webhooks": {{
- ID: cloudflare.F[cloudflare.AlertingV3PolicyUpdateParamsMechanismsID](shared.UnionString("14cc1190-5d2b-4b98-a696-c424cb2ad05f")),
- }},
- }),
- Name: cloudflare.F("SSL Notification Event Policy"),
- },
- )
- 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())
- }
-}
-
-func TestAlertingV3PolicyList(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"),
- )
- _, err := client.Alerting.V3.Policies.List(context.TODO(), cloudflare.AlertingV3PolicyListParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- })
- 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())
- }
-}
-
-func TestAlertingV3PolicyDelete(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"),
- )
- _, err := client.Alerting.V3.Policies.Delete(
- context.TODO(),
- "0da2b59e-f118-439d-8097-bdfb215203c9",
- cloudflare.AlertingV3PolicyDeleteParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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())
- }
-}
-
-func TestAlertingV3PolicyGet(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"),
- )
- _, err := client.Alerting.V3.Policies.Get(
- context.TODO(),
- "0da2b59e-f118-439d-8097-bdfb215203c9",
- cloudflare.AlertingV3PolicyGetParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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/api.md b/api.md
index 00a13f62c5f..afb35768d2c 100644
--- a/api.md
+++ b/api.md
@@ -2,111 +2,111 @@
Response Types:
-- cloudflare.Account
-- cloudflare.AccountUpdateResponse
-- cloudflare.AccountListResponse
-- cloudflare.AccountGetResponse
+- accounts.Account
+- accounts.AccountUpdateResponse
+- accounts.AccountListResponse
+- accounts.AccountGetResponse
Methods:
-- client.Accounts.Update(ctx context.Context, params cloudflare.AccountUpdateParams) (cloudflare.AccountUpdateResponse, error)
-- client.Accounts.List(ctx context.Context, query cloudflare.AccountListParams) (shared.V4PagePaginationArray[cloudflare.AccountListResponse], error)
-- client.Accounts.Get(ctx context.Context, query cloudflare.AccountGetParams) (cloudflare.AccountGetResponse, error)
+- client.Accounts.Update(ctx context.Context, params accounts.AccountUpdateParams) (accounts.AccountUpdateResponse, error)
+- client.Accounts.List(ctx context.Context, query accounts.AccountListParams) (shared.V4PagePaginationArray[accounts.AccountListResponse], error)
+- client.Accounts.Get(ctx context.Context, query accounts.AccountGetParams) (accounts.AccountGetResponse, error)
## Members
Response Types:
-- cloudflare.AccountMember
-- cloudflare.AccountMemberWithID
-- cloudflare.AccountMemberListResponse
-- cloudflare.AccountMemberDeleteResponse
+- accounts.AccountMember
+- accounts.AccountMemberWithID
+- accounts.MemberListResponse
+- accounts.MemberDeleteResponse
Methods:
-- client.Accounts.Members.New(ctx context.Context, params cloudflare.AccountMemberNewParams) (cloudflare.AccountMemberWithID, error)
-- client.Accounts.Members.Update(ctx context.Context, memberID string, params cloudflare.AccountMemberUpdateParams) (cloudflare.AccountMember, error)
-- client.Accounts.Members.List(ctx context.Context, params cloudflare.AccountMemberListParams) (shared.V4PagePaginationArray[cloudflare.AccountMemberListResponse], error)
-- client.Accounts.Members.Delete(ctx context.Context, memberID string, body cloudflare.AccountMemberDeleteParams) (cloudflare.AccountMemberDeleteResponse, error)
-- client.Accounts.Members.Get(ctx context.Context, memberID string, query cloudflare.AccountMemberGetParams) (cloudflare.AccountMember, error)
+- client.Accounts.Members.New(ctx context.Context, params accounts.MemberNewParams) (accounts.AccountMemberWithID, error)
+- client.Accounts.Members.Update(ctx context.Context, memberID string, params accounts.MemberUpdateParams) (accounts.AccountMember, error)
+- client.Accounts.Members.List(ctx context.Context, params accounts.MemberListParams) (shared.V4PagePaginationArray[accounts.MemberListResponse], error)
+- client.Accounts.Members.Delete(ctx context.Context, memberID string, body accounts.MemberDeleteParams) (accounts.MemberDeleteResponse, error)
+- client.Accounts.Members.Get(ctx context.Context, memberID string, query accounts.MemberGetParams) (accounts.AccountMember, error)
## Roles
Response Types:
-- cloudflare.AccountRoleListResponse
-- cloudflare.AccountRoleGetResponse
+- accounts.IamSchemasRole
+- accounts.RoleGetResponse
Methods:
-- client.Accounts.Roles.List(ctx context.Context, query cloudflare.AccountRoleListParams) ([]cloudflare.AccountRoleListResponse, error)
-- client.Accounts.Roles.Get(ctx context.Context, roleID interface{}, query cloudflare.AccountRoleGetParams) (cloudflare.AccountRoleGetResponse, error)
+- client.Accounts.Roles.List(ctx context.Context, query accounts.RoleListParams) ([]accounts.IamSchemasRole, error)
+- client.Accounts.Roles.Get(ctx context.Context, roleID interface{}, query accounts.RoleGetParams) (accounts.RoleGetResponse, error)
# Certificates
Response Types:
-- cloudflare.OriginCACertificate
-- cloudflare.CertificateNewResponse
-- cloudflare.CertificateDeleteResponse
-- cloudflare.CertificateGetResponse
+- certificates.OriginCACertificate
+- certificates.CertificateNewResponse
+- certificates.CertificateDeleteResponse
+- certificates.CertificateGetResponse
Methods:
-- client.Certificates.New(ctx context.Context, body cloudflare.CertificateNewParams) (cloudflare.CertificateNewResponse, error)
-- client.Certificates.List(ctx context.Context, query cloudflare.CertificateListParams) ([]cloudflare.OriginCACertificate, error)
-- client.Certificates.Delete(ctx context.Context, certificateID string) (cloudflare.CertificateDeleteResponse, error)
-- client.Certificates.Get(ctx context.Context, certificateID string) (cloudflare.CertificateGetResponse, error)
+- client.Certificates.New(ctx context.Context, body certificates.CertificateNewParams) (certificates.CertificateNewResponse, error)
+- client.Certificates.List(ctx context.Context, query certificates.CertificateListParams) ([]certificates.OriginCACertificate, error)
+- client.Certificates.Delete(ctx context.Context, certificateID string) (certificates.CertificateDeleteResponse, error)
+- client.Certificates.Get(ctx context.Context, certificateID string) (certificates.CertificateGetResponse, error)
# IPs
Response Types:
-- cloudflare.IPs
-- cloudflare.JdcloudIPs
-- cloudflare.IPListResponse
+- ips.IPs
+- ips.JdcloudIPs
+- ips.IPListResponse
Methods:
-- client.IPs.List(ctx context.Context, query cloudflare.IPListParams) (cloudflare.IPListResponse, error)
+- client.IPs.List(ctx context.Context, query ips.IPListParams) (ips.IPListResponse, error)
# Memberships
Response Types:
-- cloudflare.Membership
-- cloudflare.MembershipUpdateResponse
-- cloudflare.MembershipDeleteResponse
-- cloudflare.MembershipGetResponse
+- memberships.Membership
+- memberships.MembershipUpdateResponse
+- memberships.MembershipDeleteResponse
+- memberships.MembershipGetResponse
Methods:
-- client.Memberships.Update(ctx context.Context, membershipID string, body cloudflare.MembershipUpdateParams) (cloudflare.MembershipUpdateResponse, error)
-- client.Memberships.List(ctx context.Context, query cloudflare.MembershipListParams) (shared.V4PagePaginationArray[cloudflare.Membership], error)
-- client.Memberships.Delete(ctx context.Context, membershipID string) (cloudflare.MembershipDeleteResponse, error)
-- client.Memberships.Get(ctx context.Context, membershipID string) (cloudflare.MembershipGetResponse, error)
+- client.Memberships.Update(ctx context.Context, membershipID string, body memberships.MembershipUpdateParams) (memberships.MembershipUpdateResponse, error)
+- client.Memberships.List(ctx context.Context, query memberships.MembershipListParams) (shared.V4PagePaginationArray[memberships.Membership], error)
+- client.Memberships.Delete(ctx context.Context, membershipID string) (memberships.MembershipDeleteResponse, error)
+- client.Memberships.Get(ctx context.Context, membershipID string) (memberships.MembershipGetResponse, error)
# User
Response Types:
-- cloudflare.UserEditResponse
-- cloudflare.UserGetResponse
+- user.UserEditResponse
+- user.UserGetResponse
Methods:
-- client.User.Edit(ctx context.Context, body cloudflare.UserEditParams) (cloudflare.UserEditResponse, error)
-- client.User.Get(ctx context.Context) (cloudflare.UserGetResponse, error)
+- client.User.Edit(ctx context.Context, body user.UserEditParams) (user.UserEditResponse, error)
+- client.User.Get(ctx context.Context) (user.UserGetResponse, error)
## AuditLogs
Response Types:
-- cloudflare.UserAuditLogListResponse
+- user.AuditLogListResponse
Methods:
-- client.User.AuditLogs.List(ctx context.Context, query cloudflare.UserAuditLogListParams) (shared.V4PagePaginationArray[cloudflare.UserAuditLogListResponse], error)
+- client.User.AuditLogs.List(ctx context.Context, query user.AuditLogListParams) (shared.V4PagePaginationArray[user.AuditLogListResponse], error)
## Billing
@@ -114,21 +114,21 @@ Methods:
Response Types:
-- cloudflare.UserBillingHistoryGetResponse
+- user.BillSubsAPIBillingHistory
Methods:
-- client.User.Billing.History.Get(ctx context.Context, query cloudflare.UserBillingHistoryGetParams) ([]cloudflare.UserBillingHistoryGetResponse, error)
+- client.User.Billing.History.Get(ctx context.Context, query user.BillingHistoryGetParams) ([]user.BillSubsAPIBillingHistory, error)
### Profiles
Response Types:
-- cloudflare.UserBillingProfileGetResponse
+- user.BillingProfileGetResponse
Methods:
-- client.User.Billing.Profiles.Get(ctx context.Context) (cloudflare.UserBillingProfileGetResponse, error)
+- client.User.Billing.Profiles.Get(ctx context.Context) (user.BillingProfileGetResponse, error)
## Firewall
@@ -136,31 +136,29 @@ Methods:
Response Types:
-- cloudflare.UserFirewallAccessRuleNewResponse
-- cloudflare.UserFirewallAccessRuleListResponse
-- cloudflare.UserFirewallAccessRuleDeleteResponse
-- cloudflare.UserFirewallAccessRuleEditResponse
+- user.LegacyJhsRule
+- user.FirewallAccessRuleDeleteResponse
Methods:
-- client.User.Firewall.AccessRules.New(ctx context.Context, body cloudflare.UserFirewallAccessRuleNewParams) (cloudflare.UserFirewallAccessRuleNewResponse, error)
-- client.User.Firewall.AccessRules.List(ctx context.Context, query cloudflare.UserFirewallAccessRuleListParams) (shared.V4PagePaginationArray[cloudflare.UserFirewallAccessRuleListResponse], error)
-- client.User.Firewall.AccessRules.Delete(ctx context.Context, identifier string) (cloudflare.UserFirewallAccessRuleDeleteResponse, error)
-- client.User.Firewall.AccessRules.Edit(ctx context.Context, identifier string, body cloudflare.UserFirewallAccessRuleEditParams) (cloudflare.UserFirewallAccessRuleEditResponse, error)
+- client.User.Firewall.AccessRules.New(ctx context.Context, body user.FirewallAccessRuleNewParams) (user.LegacyJhsRule, error)
+- client.User.Firewall.AccessRules.List(ctx context.Context, query user.FirewallAccessRuleListParams) (shared.V4PagePaginationArray[user.LegacyJhsRule], error)
+- client.User.Firewall.AccessRules.Delete(ctx context.Context, identifier string) (user.FirewallAccessRuleDeleteResponse, error)
+- client.User.Firewall.AccessRules.Edit(ctx context.Context, identifier string, body user.FirewallAccessRuleEditParams) (user.LegacyJhsRule, error)
## Invites
Response Types:
-- cloudflare.UserInviteListResponse
-- cloudflare.UserInviteEditResponse
-- cloudflare.UserInviteGetResponse
+- user.InviteListResponse
+- user.InviteEditResponse
+- user.InviteGetResponse
Methods:
-- client.User.Invites.List(ctx context.Context) ([]cloudflare.UserInviteListResponse, error)
-- client.User.Invites.Edit(ctx context.Context, inviteID string, body cloudflare.UserInviteEditParams) (cloudflare.UserInviteEditResponse, error)
-- client.User.Invites.Get(ctx context.Context, inviteID string) (cloudflare.UserInviteGetResponse, error)
+- client.User.Invites.List(ctx context.Context) ([]user.InviteListResponse, error)
+- client.User.Invites.Edit(ctx context.Context, inviteID string, body user.InviteEditParams) (user.InviteEditResponse, error)
+- client.User.Invites.Get(ctx context.Context, inviteID string) (user.InviteGetResponse, error)
## LoadBalancers
@@ -168,61 +166,53 @@ Methods:
Response Types:
-- cloudflare.UserLoadBalancerMonitorNewResponse
-- cloudflare.UserLoadBalancerMonitorUpdateResponse
-- cloudflare.UserLoadBalancerMonitorListResponse
-- cloudflare.UserLoadBalancerMonitorDeleteResponse
-- cloudflare.UserLoadBalancerMonitorEditResponse
-- cloudflare.UserLoadBalancerMonitorGetResponse
-- cloudflare.UserLoadBalancerMonitorPreviewResponse
-- cloudflare.UserLoadBalancerMonitorReferencesResponse
+- user.LoadBalancingMonitor
+- user.LoadBalancerMonitorDeleteResponse
+- user.LoadBalancerMonitorPreviewResponse
+- user.LoadBalancerMonitorReferencesResponse
Methods:
-- client.User.LoadBalancers.Monitors.New(ctx context.Context, body cloudflare.UserLoadBalancerMonitorNewParams) (cloudflare.UserLoadBalancerMonitorNewResponse, error)
-- client.User.LoadBalancers.Monitors.Update(ctx context.Context, monitorID string, body cloudflare.UserLoadBalancerMonitorUpdateParams) (cloudflare.UserLoadBalancerMonitorUpdateResponse, error)
-- client.User.LoadBalancers.Monitors.List(ctx context.Context) ([]cloudflare.UserLoadBalancerMonitorListResponse, error)
-- client.User.LoadBalancers.Monitors.Delete(ctx context.Context, monitorID string) (cloudflare.UserLoadBalancerMonitorDeleteResponse, error)
-- client.User.LoadBalancers.Monitors.Edit(ctx context.Context, monitorID string, body cloudflare.UserLoadBalancerMonitorEditParams) (cloudflare.UserLoadBalancerMonitorEditResponse, error)
-- client.User.LoadBalancers.Monitors.Get(ctx context.Context, monitorID string) (cloudflare.UserLoadBalancerMonitorGetResponse, error)
-- client.User.LoadBalancers.Monitors.Preview(ctx context.Context, monitorID string, body cloudflare.UserLoadBalancerMonitorPreviewParams) (cloudflare.UserLoadBalancerMonitorPreviewResponse, error)
-- client.User.LoadBalancers.Monitors.References(ctx context.Context, monitorID string) ([]cloudflare.UserLoadBalancerMonitorReferencesResponse, error)
+- client.User.LoadBalancers.Monitors.New(ctx context.Context, body user.LoadBalancerMonitorNewParams) (user.LoadBalancingMonitor, error)
+- client.User.LoadBalancers.Monitors.Update(ctx context.Context, monitorID string, body user.LoadBalancerMonitorUpdateParams) (user.LoadBalancingMonitor, error)
+- client.User.LoadBalancers.Monitors.List(ctx context.Context) ([]user.LoadBalancingMonitor, error)
+- client.User.LoadBalancers.Monitors.Delete(ctx context.Context, monitorID string) (user.LoadBalancerMonitorDeleteResponse, error)
+- client.User.LoadBalancers.Monitors.Edit(ctx context.Context, monitorID string, body user.LoadBalancerMonitorEditParams) (user.LoadBalancingMonitor, error)
+- client.User.LoadBalancers.Monitors.Get(ctx context.Context, monitorID string) (user.LoadBalancingMonitor, error)
+- client.User.LoadBalancers.Monitors.Preview(ctx context.Context, monitorID string, body user.LoadBalancerMonitorPreviewParams) (user.LoadBalancerMonitorPreviewResponse, error)
+- client.User.LoadBalancers.Monitors.References(ctx context.Context, monitorID string) ([]user.LoadBalancerMonitorReferencesResponse, error)
### Pools
Response Types:
-- cloudflare.UserLoadBalancerPoolNewResponse
-- cloudflare.UserLoadBalancerPoolUpdateResponse
-- cloudflare.UserLoadBalancerPoolListResponse
-- cloudflare.UserLoadBalancerPoolDeleteResponse
-- cloudflare.UserLoadBalancerPoolEditResponse
-- cloudflare.UserLoadBalancerPoolGetResponse
-- cloudflare.UserLoadBalancerPoolHealthResponse
-- cloudflare.UserLoadBalancerPoolPreviewResponse
-- cloudflare.UserLoadBalancerPoolReferencesResponse
+- user.LoadBalancingPool
+- user.LoadBalancerPoolDeleteResponse
+- user.LoadBalancerPoolHealthResponse
+- user.LoadBalancerPoolPreviewResponse
+- user.LoadBalancerPoolReferencesResponse
Methods:
-- client.User.LoadBalancers.Pools.New(ctx context.Context, body cloudflare.UserLoadBalancerPoolNewParams) (cloudflare.UserLoadBalancerPoolNewResponse, error)
-- client.User.LoadBalancers.Pools.Update(ctx context.Context, poolID string, body cloudflare.UserLoadBalancerPoolUpdateParams) (cloudflare.UserLoadBalancerPoolUpdateResponse, error)
-- client.User.LoadBalancers.Pools.List(ctx context.Context, query cloudflare.UserLoadBalancerPoolListParams) ([]cloudflare.UserLoadBalancerPoolListResponse, error)
-- client.User.LoadBalancers.Pools.Delete(ctx context.Context, poolID string) (cloudflare.UserLoadBalancerPoolDeleteResponse, error)
-- client.User.LoadBalancers.Pools.Edit(ctx context.Context, poolID string, body cloudflare.UserLoadBalancerPoolEditParams) (cloudflare.UserLoadBalancerPoolEditResponse, error)
-- client.User.LoadBalancers.Pools.Get(ctx context.Context, poolID string) (cloudflare.UserLoadBalancerPoolGetResponse, error)
-- client.User.LoadBalancers.Pools.Health(ctx context.Context, poolID string) (cloudflare.UserLoadBalancerPoolHealthResponse, error)
-- client.User.LoadBalancers.Pools.Preview(ctx context.Context, poolID string, body cloudflare.UserLoadBalancerPoolPreviewParams) (cloudflare.UserLoadBalancerPoolPreviewResponse, error)
-- client.User.LoadBalancers.Pools.References(ctx context.Context, poolID string) ([]cloudflare.UserLoadBalancerPoolReferencesResponse, error)
+- client.User.LoadBalancers.Pools.New(ctx context.Context, body user.LoadBalancerPoolNewParams) (user.LoadBalancingPool, error)
+- client.User.LoadBalancers.Pools.Update(ctx context.Context, poolID string, body user.LoadBalancerPoolUpdateParams) (user.LoadBalancingPool, error)
+- client.User.LoadBalancers.Pools.List(ctx context.Context, query user.LoadBalancerPoolListParams) ([]user.LoadBalancingPool, error)
+- client.User.LoadBalancers.Pools.Delete(ctx context.Context, poolID string) (user.LoadBalancerPoolDeleteResponse, error)
+- client.User.LoadBalancers.Pools.Edit(ctx context.Context, poolID string, body user.LoadBalancerPoolEditParams) (user.LoadBalancingPool, error)
+- client.User.LoadBalancers.Pools.Get(ctx context.Context, poolID string) (user.LoadBalancingPool, error)
+- client.User.LoadBalancers.Pools.Health(ctx context.Context, poolID string) (user.LoadBalancerPoolHealthResponse, error)
+- client.User.LoadBalancers.Pools.Preview(ctx context.Context, poolID string, body user.LoadBalancerPoolPreviewParams) (user.LoadBalancerPoolPreviewResponse, error)
+- client.User.LoadBalancers.Pools.References(ctx context.Context, poolID string) ([]user.LoadBalancerPoolReferencesResponse, error)
### Preview
Response Types:
-- cloudflare.UserLoadBalancerPreviewGetResponse
+- user.LoadBalancingPreviewResult
Methods:
-- client.User.LoadBalancers.Preview.Get(ctx context.Context, previewID interface{}) (cloudflare.UserLoadBalancerPreviewGetResponse, error)
+- client.User.LoadBalancers.Preview.Get(ctx context.Context, previewID interface{}) (user.LoadBalancingPreviewResult, error)
### Analytics
@@ -230,753 +220,904 @@ Methods:
Response Types:
-- cloudflare.UserLoadBalancerAnalyticsEventListResponse
+- user.LoadBalancingAnalytics
Methods:
-- client.User.LoadBalancers.Analytics.Events.List(ctx context.Context, query cloudflare.UserLoadBalancerAnalyticsEventListParams) ([]cloudflare.UserLoadBalancerAnalyticsEventListResponse, error)
+- client.User.LoadBalancers.Analytics.Events.List(ctx context.Context, query user.LoadBalancerAnalyticsEventListParams) ([]user.LoadBalancingAnalytics, error)
## Organizations
Response Types:
-- cloudflare.UserOrganizationListResponse
-- cloudflare.UserOrganizationDeleteResponse
-- cloudflare.UserOrganizationGetResponse
+- user.IamOrganization
+- user.OrganizationDeleteResponse
+- user.OrganizationGetResponse
Methods:
-- client.User.Organizations.List(ctx context.Context, query cloudflare.UserOrganizationListParams) (shared.V4PagePaginationArray[cloudflare.UserOrganizationListResponse], error)
-- client.User.Organizations.Delete(ctx context.Context, organizationID string) (cloudflare.UserOrganizationDeleteResponse, error)
-- client.User.Organizations.Get(ctx context.Context, organizationID string) (cloudflare.UserOrganizationGetResponse, error)
+- client.User.Organizations.List(ctx context.Context, query user.OrganizationListParams) (shared.V4PagePaginationArray[user.IamOrganization], error)
+- client.User.Organizations.Delete(ctx context.Context, organizationID string) (user.OrganizationDeleteResponse, error)
+- client.User.Organizations.Get(ctx context.Context, organizationID string) (user.OrganizationGetResponse, error)
## Subscriptions
Response Types:
-- cloudflare.UserSubscriptionUpdateResponse
-- cloudflare.UserSubscriptionDeleteResponse
-- cloudflare.UserSubscriptionEditResponse
-- cloudflare.UserSubscriptionGetResponse
+- user.SubscriptionUpdateResponse
+- user.SubscriptionDeleteResponse
+- user.SubscriptionEditResponse
+- user.SubscriptionGetResponse
Methods:
-- client.User.Subscriptions.Update(ctx context.Context, identifier string, body cloudflare.UserSubscriptionUpdateParams) (cloudflare.UserSubscriptionUpdateResponse, error)
-- client.User.Subscriptions.Delete(ctx context.Context, identifier string) (cloudflare.UserSubscriptionDeleteResponse, error)
-- client.User.Subscriptions.Edit(ctx context.Context, identifier string, body cloudflare.UserSubscriptionEditParams) (cloudflare.UserSubscriptionEditResponse, error)
-- client.User.Subscriptions.Get(ctx context.Context) ([]cloudflare.UserSubscriptionGetResponse, error)
+- client.User.Subscriptions.Update(ctx context.Context, identifier string, body user.SubscriptionUpdateParams) (user.SubscriptionUpdateResponse, error)
+- client.User.Subscriptions.Delete(ctx context.Context, identifier string) (user.SubscriptionDeleteResponse, error)
+- client.User.Subscriptions.Edit(ctx context.Context, identifier string, body user.SubscriptionEditParams) (user.SubscriptionEditResponse, error)
+- client.User.Subscriptions.Get(ctx context.Context) ([]user.SubscriptionGetResponse, error)
## Tokens
Response Types:
-- cloudflare.UserTokenNewResponse
-- cloudflare.UserTokenUpdateResponse
-- cloudflare.UserTokenListResponse
-- cloudflare.UserTokenDeleteResponse
-- cloudflare.UserTokenGetResponse
-- cloudflare.UserTokenVerifyResponse
+- user.TokenNewResponse
+- user.TokenUpdateResponse
+- user.TokenListResponse
+- user.TokenDeleteResponse
+- user.TokenGetResponse
+- user.TokenVerifyResponse
Methods:
-- client.User.Tokens.New(ctx context.Context, body cloudflare.UserTokenNewParams) (cloudflare.UserTokenNewResponse, error)
-- client.User.Tokens.Update(ctx context.Context, tokenID interface{}, body cloudflare.UserTokenUpdateParams) (cloudflare.UserTokenUpdateResponse, error)
-- client.User.Tokens.List(ctx context.Context, query cloudflare.UserTokenListParams) (shared.V4PagePaginationArray[cloudflare.UserTokenListResponse], error)
-- client.User.Tokens.Delete(ctx context.Context, tokenID interface{}) (cloudflare.UserTokenDeleteResponse, error)
-- client.User.Tokens.Get(ctx context.Context, tokenID interface{}) (cloudflare.UserTokenGetResponse, error)
-- client.User.Tokens.Verify(ctx context.Context) (cloudflare.UserTokenVerifyResponse, error)
+- client.User.Tokens.New(ctx context.Context, body user.TokenNewParams) (user.TokenNewResponse, error)
+- client.User.Tokens.Update(ctx context.Context, tokenID interface{}, body user.TokenUpdateParams) (user.TokenUpdateResponse, error)
+- client.User.Tokens.List(ctx context.Context, query user.TokenListParams) (shared.V4PagePaginationArray[user.TokenListResponse], error)
+- client.User.Tokens.Delete(ctx context.Context, tokenID interface{}) (user.TokenDeleteResponse, error)
+- client.User.Tokens.Get(ctx context.Context, tokenID interface{}) (user.TokenGetResponse, error)
+- client.User.Tokens.Verify(ctx context.Context) (user.TokenVerifyResponse, error)
### PermissionGroups
Response Types:
-- cloudflare.UserTokenPermissionGroupListResponse
+- user.TokenPermissionGroupListResponse
Methods:
-- client.User.Tokens.PermissionGroups.List(ctx context.Context) ([]cloudflare.UserTokenPermissionGroupListResponse, error)
+- client.User.Tokens.PermissionGroups.List(ctx context.Context) ([]user.TokenPermissionGroupListResponse, error)
### Value
+Response Types:
+
+- user.IamValue
+
Methods:
-- client.User.Tokens.Value.Update(ctx context.Context, tokenID interface{}, body cloudflare.UserTokenValueUpdateParams) (string, error)
+- client.User.Tokens.Value.Update(ctx context.Context, tokenID interface{}, body user.TokenValueUpdateParams) (user.IamValue, error)
# Zones
Response Types:
-- cloudflare.ZoneNewResponse
-- cloudflare.ZoneListResponse
-- cloudflare.ZoneDeleteResponse
-- cloudflare.ZoneEditResponse
-- cloudflare.ZoneGetResponse
+- zones.ZoneNewResponse
+- zones.ZoneListResponse
+- zones.ZoneDeleteResponse
+- zones.ZoneEditResponse
+- zones.ZoneGetResponse
Methods:
-- client.Zones.New(ctx context.Context, body cloudflare.ZoneNewParams) (cloudflare.ZoneNewResponse, error)
-- client.Zones.List(ctx context.Context, query cloudflare.ZoneListParams) (shared.V4PagePaginationArray[cloudflare.ZoneListResponse], error)
-- client.Zones.Delete(ctx context.Context, body cloudflare.ZoneDeleteParams) (cloudflare.ZoneDeleteResponse, error)
-- client.Zones.Edit(ctx context.Context, params cloudflare.ZoneEditParams) (cloudflare.ZoneEditResponse, error)
-- client.Zones.Get(ctx context.Context, query cloudflare.ZoneGetParams) (cloudflare.ZoneGetResponse, error)
+- client.Zones.New(ctx context.Context, body zones.ZoneNewParams) (zones.ZoneNewResponse, error)
+- client.Zones.List(ctx context.Context, query zones.ZoneListParams) (shared.V4PagePaginationArray[zones.ZoneListResponse], error)
+- client.Zones.Delete(ctx context.Context, body zones.ZoneDeleteParams) (zones.ZoneDeleteResponse, error)
+- client.Zones.Edit(ctx context.Context, params zones.ZoneEditParams) (zones.ZoneEditResponse, error)
+- client.Zones.Get(ctx context.Context, query zones.ZoneGetParams) (zones.ZoneGetResponse, error)
## ActivationCheck
Response Types:
-- cloudflare.ZoneActivationCheckTriggerResponse
+- zones.ActivationCheckTriggerResponse
Methods:
-- client.Zones.ActivationCheck.Trigger(ctx context.Context, body cloudflare.ZoneActivationCheckTriggerParams) (cloudflare.ZoneActivationCheckTriggerResponse, error)
+- client.Zones.ActivationCheck.Trigger(ctx context.Context, body zones.ActivationCheckTriggerParams) (zones.ActivationCheckTriggerResponse, error)
## Settings
Response Types:
-- cloudflare.ZoneSettingEditResponse
-- cloudflare.ZoneSettingGetResponse
+- zones.SettingEditResponse
+- zones.SettingGetResponse
Methods:
-- client.Zones.Settings.Edit(ctx context.Context, params cloudflare.ZoneSettingEditParams) ([]cloudflare.ZoneSettingEditResponse, error)
-- client.Zones.Settings.Get(ctx context.Context, query cloudflare.ZoneSettingGetParams) ([]cloudflare.ZoneSettingGetResponse, error)
+- client.Zones.Settings.Edit(ctx context.Context, params zones.SettingEditParams) ([]zones.SettingEditResponse, error)
+- client.Zones.Settings.Get(ctx context.Context, query zones.SettingGetParams) ([]zones.SettingGetResponse, error)
### ZeroRTT
+Params Types:
+
+- zones.Zones0rttParam
+
Response Types:
-- cloudflare.ZoneSettingZeroRTTEditResponse
-- cloudflare.ZoneSettingZeroRTTGetResponse
+- zones.Zones0rtt
Methods:
-- client.Zones.Settings.ZeroRTT.Edit(ctx context.Context, params cloudflare.ZoneSettingZeroRTTEditParams) (cloudflare.ZoneSettingZeroRTTEditResponse, error)
-- client.Zones.Settings.ZeroRTT.Get(ctx context.Context, query cloudflare.ZoneSettingZeroRTTGetParams) (cloudflare.ZoneSettingZeroRTTGetResponse, error)
+- client.Zones.Settings.ZeroRTT.Edit(ctx context.Context, params zones.SettingZeroRTTEditParams) (zones.Zones0rtt, error)
+- client.Zones.Settings.ZeroRTT.Get(ctx context.Context, query zones.SettingZeroRTTGetParams) (zones.Zones0rtt, error)
### AdvancedDDOS
+Params Types:
+
+- zones.ZonesAdvancedDDOSParam
+
Response Types:
-- cloudflare.ZoneSettingAdvancedDDOSGetResponse
+- zones.ZonesAdvancedDDOS
Methods:
-- client.Zones.Settings.AdvancedDDOS.Get(ctx context.Context, query cloudflare.ZoneSettingAdvancedDDOSGetParams) (cloudflare.ZoneSettingAdvancedDDOSGetResponse, error)
+- client.Zones.Settings.AdvancedDDOS.Get(ctx context.Context, query zones.SettingAdvancedDDOSGetParams) (zones.ZonesAdvancedDDOS, error)
### AlwaysOnline
+Params Types:
+
+- zones.ZonesAlwaysOnlineParam
+
Response Types:
-- cloudflare.ZoneSettingAlwaysOnlineEditResponse
-- cloudflare.ZoneSettingAlwaysOnlineGetResponse
+- zones.ZonesAlwaysOnline
Methods:
-- client.Zones.Settings.AlwaysOnline.Edit(ctx context.Context, params cloudflare.ZoneSettingAlwaysOnlineEditParams) (cloudflare.ZoneSettingAlwaysOnlineEditResponse, error)
-- client.Zones.Settings.AlwaysOnline.Get(ctx context.Context, query cloudflare.ZoneSettingAlwaysOnlineGetParams) (cloudflare.ZoneSettingAlwaysOnlineGetResponse, error)
+- client.Zones.Settings.AlwaysOnline.Edit(ctx context.Context, params zones.SettingAlwaysOnlineEditParams) (zones.ZonesAlwaysOnline, error)
+- client.Zones.Settings.AlwaysOnline.Get(ctx context.Context, query zones.SettingAlwaysOnlineGetParams) (zones.ZonesAlwaysOnline, error)
### AlwaysUseHTTPS
+Params Types:
+
+- zones.ZonesAlwaysUseHTTPSParam
+
Response Types:
-- cloudflare.ZoneSettingAlwaysUseHTTPSEditResponse
-- cloudflare.ZoneSettingAlwaysUseHTTPSGetResponse
+- zones.ZonesAlwaysUseHTTPS
Methods:
-- client.Zones.Settings.AlwaysUseHTTPS.Edit(ctx context.Context, params cloudflare.ZoneSettingAlwaysUseHTTPSEditParams) (cloudflare.ZoneSettingAlwaysUseHTTPSEditResponse, error)
-- client.Zones.Settings.AlwaysUseHTTPS.Get(ctx context.Context, query cloudflare.ZoneSettingAlwaysUseHTTPSGetParams) (cloudflare.ZoneSettingAlwaysUseHTTPSGetResponse, error)
+- client.Zones.Settings.AlwaysUseHTTPS.Edit(ctx context.Context, params zones.SettingAlwaysUseHTTPSEditParams) (zones.ZonesAlwaysUseHTTPS, error)
+- client.Zones.Settings.AlwaysUseHTTPS.Get(ctx context.Context, query zones.SettingAlwaysUseHTTPSGetParams) (zones.ZonesAlwaysUseHTTPS, error)
### AutomaticHTTPSRewrites
+Params Types:
+
+- zones.ZonesAutomaticHTTPSRewritesParam
+
Response Types:
-- cloudflare.ZoneSettingAutomaticHTTPSRewriteEditResponse
-- cloudflare.ZoneSettingAutomaticHTTPSRewriteGetResponse
+- zones.ZonesAutomaticHTTPSRewrites
Methods:
-- client.Zones.Settings.AutomaticHTTPSRewrites.Edit(ctx context.Context, params cloudflare.ZoneSettingAutomaticHTTPSRewriteEditParams) (cloudflare.ZoneSettingAutomaticHTTPSRewriteEditResponse, error)
-- client.Zones.Settings.AutomaticHTTPSRewrites.Get(ctx context.Context, query cloudflare.ZoneSettingAutomaticHTTPSRewriteGetParams) (cloudflare.ZoneSettingAutomaticHTTPSRewriteGetResponse, error)
+- client.Zones.Settings.AutomaticHTTPSRewrites.Edit(ctx context.Context, params zones.SettingAutomaticHTTPSRewriteEditParams) (zones.ZonesAutomaticHTTPSRewrites, error)
+- client.Zones.Settings.AutomaticHTTPSRewrites.Get(ctx context.Context, query zones.SettingAutomaticHTTPSRewriteGetParams) (zones.ZonesAutomaticHTTPSRewrites, error)
### AutomaticPlatformOptimization
+Params Types:
+
+- zones.ZonesAutomaticPlatformOptimizationParam
+
Response Types:
-- cloudflare.ZoneSettingAutomaticPlatformOptimizationEditResponse
-- cloudflare.ZoneSettingAutomaticPlatformOptimizationGetResponse
+- zones.ZonesAutomaticPlatformOptimization
Methods:
-- client.Zones.Settings.AutomaticPlatformOptimization.Edit(ctx context.Context, params cloudflare.ZoneSettingAutomaticPlatformOptimizationEditParams) (cloudflare.ZoneSettingAutomaticPlatformOptimizationEditResponse, error)
-- client.Zones.Settings.AutomaticPlatformOptimization.Get(ctx context.Context, query cloudflare.ZoneSettingAutomaticPlatformOptimizationGetParams) (cloudflare.ZoneSettingAutomaticPlatformOptimizationGetResponse, error)
+- client.Zones.Settings.AutomaticPlatformOptimization.Edit(ctx context.Context, params zones.SettingAutomaticPlatformOptimizationEditParams) (zones.ZonesAutomaticPlatformOptimization, error)
+- client.Zones.Settings.AutomaticPlatformOptimization.Get(ctx context.Context, query zones.SettingAutomaticPlatformOptimizationGetParams) (zones.ZonesAutomaticPlatformOptimization, error)
### Brotli
+Params Types:
+
+- zones.ZonesBrotliParam
+
Response Types:
-- cloudflare.ZoneSettingBrotliEditResponse
-- cloudflare.ZoneSettingBrotliGetResponse
+- zones.ZonesBrotli
Methods:
-- client.Zones.Settings.Brotli.Edit(ctx context.Context, params cloudflare.ZoneSettingBrotliEditParams) (cloudflare.ZoneSettingBrotliEditResponse, error)
-- client.Zones.Settings.Brotli.Get(ctx context.Context, query cloudflare.ZoneSettingBrotliGetParams) (cloudflare.ZoneSettingBrotliGetResponse, error)
+- client.Zones.Settings.Brotli.Edit(ctx context.Context, params zones.SettingBrotliEditParams) (zones.ZonesBrotli, error)
+- client.Zones.Settings.Brotli.Get(ctx context.Context, query zones.SettingBrotliGetParams) (zones.ZonesBrotli, error)
### BrowserCacheTTL
+Params Types:
+
+- zones.ZonesBrowserCacheTTLParam
+
Response Types:
-- cloudflare.ZoneSettingBrowserCacheTTLEditResponse
-- cloudflare.ZoneSettingBrowserCacheTTLGetResponse
+- zones.ZonesBrowserCacheTTL
Methods:
-- client.Zones.Settings.BrowserCacheTTL.Edit(ctx context.Context, params cloudflare.ZoneSettingBrowserCacheTTLEditParams) (cloudflare.ZoneSettingBrowserCacheTTLEditResponse, error)
-- client.Zones.Settings.BrowserCacheTTL.Get(ctx context.Context, query cloudflare.ZoneSettingBrowserCacheTTLGetParams) (cloudflare.ZoneSettingBrowserCacheTTLGetResponse, error)
+- client.Zones.Settings.BrowserCacheTTL.Edit(ctx context.Context, params zones.SettingBrowserCacheTTLEditParams) (zones.ZonesBrowserCacheTTL, error)
+- client.Zones.Settings.BrowserCacheTTL.Get(ctx context.Context, query zones.SettingBrowserCacheTTLGetParams) (zones.ZonesBrowserCacheTTL, error)
### BrowserCheck
+Params Types:
+
+- zones.ZonesBrowserCheckParam
+
Response Types:
-- cloudflare.ZoneSettingBrowserCheckEditResponse
-- cloudflare.ZoneSettingBrowserCheckGetResponse
+- zones.ZonesBrowserCheck
Methods:
-- client.Zones.Settings.BrowserCheck.Edit(ctx context.Context, params cloudflare.ZoneSettingBrowserCheckEditParams) (cloudflare.ZoneSettingBrowserCheckEditResponse, error)
-- client.Zones.Settings.BrowserCheck.Get(ctx context.Context, query cloudflare.ZoneSettingBrowserCheckGetParams) (cloudflare.ZoneSettingBrowserCheckGetResponse, error)
+- client.Zones.Settings.BrowserCheck.Edit(ctx context.Context, params zones.SettingBrowserCheckEditParams) (zones.ZonesBrowserCheck, error)
+- client.Zones.Settings.BrowserCheck.Get(ctx context.Context, query zones.SettingBrowserCheckGetParams) (zones.ZonesBrowserCheck, error)
### CacheLevel
+Params Types:
+
+- zones.ZonesCacheLevelParam
+
Response Types:
-- cloudflare.ZoneSettingCacheLevelEditResponse
-- cloudflare.ZoneSettingCacheLevelGetResponse
+- zones.ZonesCacheLevel
Methods:
-- client.Zones.Settings.CacheLevel.Edit(ctx context.Context, params cloudflare.ZoneSettingCacheLevelEditParams) (cloudflare.ZoneSettingCacheLevelEditResponse, error)
-- client.Zones.Settings.CacheLevel.Get(ctx context.Context, query cloudflare.ZoneSettingCacheLevelGetParams) (cloudflare.ZoneSettingCacheLevelGetResponse, error)
+- client.Zones.Settings.CacheLevel.Edit(ctx context.Context, params zones.SettingCacheLevelEditParams) (zones.ZonesCacheLevel, error)
+- client.Zones.Settings.CacheLevel.Get(ctx context.Context, query zones.SettingCacheLevelGetParams) (zones.ZonesCacheLevel, error)
### ChallengeTTL
+Params Types:
+
+- zones.ZonesChallengeTTLParam
+
Response Types:
-- cloudflare.ZoneSettingChallengeTTLEditResponse
-- cloudflare.ZoneSettingChallengeTTLGetResponse
+- zones.ZonesChallengeTTL
Methods:
-- client.Zones.Settings.ChallengeTTL.Edit(ctx context.Context, params cloudflare.ZoneSettingChallengeTTLEditParams) (cloudflare.ZoneSettingChallengeTTLEditResponse, error)
-- client.Zones.Settings.ChallengeTTL.Get(ctx context.Context, query cloudflare.ZoneSettingChallengeTTLGetParams) (cloudflare.ZoneSettingChallengeTTLGetResponse, error)
+- client.Zones.Settings.ChallengeTTL.Edit(ctx context.Context, params zones.SettingChallengeTTLEditParams) (zones.ZonesChallengeTTL, error)
+- client.Zones.Settings.ChallengeTTL.Get(ctx context.Context, query zones.SettingChallengeTTLGetParams) (zones.ZonesChallengeTTL, error)
### Ciphers
+Params Types:
+
+- zones.ZonesCiphersParam
+
Response Types:
-- cloudflare.ZoneSettingCipherEditResponse
-- cloudflare.ZoneSettingCipherGetResponse
+- zones.ZonesCiphers
Methods:
-- client.Zones.Settings.Ciphers.Edit(ctx context.Context, params cloudflare.ZoneSettingCipherEditParams) (cloudflare.ZoneSettingCipherEditResponse, error)
-- client.Zones.Settings.Ciphers.Get(ctx context.Context, query cloudflare.ZoneSettingCipherGetParams) (cloudflare.ZoneSettingCipherGetResponse, error)
+- client.Zones.Settings.Ciphers.Edit(ctx context.Context, params zones.SettingCipherEditParams) (zones.ZonesCiphers, error)
+- client.Zones.Settings.Ciphers.Get(ctx context.Context, query zones.SettingCipherGetParams) (zones.ZonesCiphers, error)
### DevelopmentMode
+Params Types:
+
+- zones.ZonesDevelopmentModeParam
+
Response Types:
-- cloudflare.ZoneSettingDevelopmentModeEditResponse
-- cloudflare.ZoneSettingDevelopmentModeGetResponse
+- zones.ZonesDevelopmentMode
Methods:
-- client.Zones.Settings.DevelopmentMode.Edit(ctx context.Context, params cloudflare.ZoneSettingDevelopmentModeEditParams) (cloudflare.ZoneSettingDevelopmentModeEditResponse, error)
-- client.Zones.Settings.DevelopmentMode.Get(ctx context.Context, query cloudflare.ZoneSettingDevelopmentModeGetParams) (cloudflare.ZoneSettingDevelopmentModeGetResponse, error)
+- client.Zones.Settings.DevelopmentMode.Edit(ctx context.Context, params zones.SettingDevelopmentModeEditParams) (zones.ZonesDevelopmentMode, error)
+- client.Zones.Settings.DevelopmentMode.Get(ctx context.Context, query zones.SettingDevelopmentModeGetParams) (zones.ZonesDevelopmentMode, error)
### EarlyHints
+Params Types:
+
+- zones.ZonesEarlyHintsParam
+
Response Types:
-- cloudflare.ZoneSettingEarlyHintEditResponse
-- cloudflare.ZoneSettingEarlyHintGetResponse
+- zones.ZonesEarlyHints
Methods:
-- client.Zones.Settings.EarlyHints.Edit(ctx context.Context, params cloudflare.ZoneSettingEarlyHintEditParams) (cloudflare.ZoneSettingEarlyHintEditResponse, error)
-- client.Zones.Settings.EarlyHints.Get(ctx context.Context, query cloudflare.ZoneSettingEarlyHintGetParams) (cloudflare.ZoneSettingEarlyHintGetResponse, error)
+- client.Zones.Settings.EarlyHints.Edit(ctx context.Context, params zones.SettingEarlyHintEditParams) (zones.ZonesEarlyHints, error)
+- client.Zones.Settings.EarlyHints.Get(ctx context.Context, query zones.SettingEarlyHintGetParams) (zones.ZonesEarlyHints, error)
### EmailObfuscation
+Params Types:
+
+- zones.ZonesEmailObfuscationParam
+
Response Types:
-- cloudflare.ZoneSettingEmailObfuscationEditResponse
-- cloudflare.ZoneSettingEmailObfuscationGetResponse
+- zones.ZonesEmailObfuscation
Methods:
-- client.Zones.Settings.EmailObfuscation.Edit(ctx context.Context, params cloudflare.ZoneSettingEmailObfuscationEditParams) (cloudflare.ZoneSettingEmailObfuscationEditResponse, error)
-- client.Zones.Settings.EmailObfuscation.Get(ctx context.Context, query cloudflare.ZoneSettingEmailObfuscationGetParams) (cloudflare.ZoneSettingEmailObfuscationGetResponse, error)
+- client.Zones.Settings.EmailObfuscation.Edit(ctx context.Context, params zones.SettingEmailObfuscationEditParams) (zones.ZonesEmailObfuscation, error)
+- client.Zones.Settings.EmailObfuscation.Get(ctx context.Context, query zones.SettingEmailObfuscationGetParams) (zones.ZonesEmailObfuscation, error)
### H2Prioritization
+Params Types:
+
+- zones.ZonesH2PrioritizationParam
+
Response Types:
-- cloudflare.ZoneSettingH2PrioritizationEditResponse
-- cloudflare.ZoneSettingH2PrioritizationGetResponse
+- zones.ZonesH2Prioritization
Methods:
-- client.Zones.Settings.H2Prioritization.Edit(ctx context.Context, params cloudflare.ZoneSettingH2PrioritizationEditParams) (cloudflare.ZoneSettingH2PrioritizationEditResponse, error)
-- client.Zones.Settings.H2Prioritization.Get(ctx context.Context, query cloudflare.ZoneSettingH2PrioritizationGetParams) (cloudflare.ZoneSettingH2PrioritizationGetResponse, error)
+- client.Zones.Settings.H2Prioritization.Edit(ctx context.Context, params zones.SettingH2PrioritizationEditParams) (zones.ZonesH2Prioritization, error)
+- client.Zones.Settings.H2Prioritization.Get(ctx context.Context, query zones.SettingH2PrioritizationGetParams) (zones.ZonesH2Prioritization, error)
### HotlinkProtection
+Params Types:
+
+- zones.ZonesHotlinkProtectionParam
+
Response Types:
-- cloudflare.ZoneSettingHotlinkProtectionEditResponse
-- cloudflare.ZoneSettingHotlinkProtectionGetResponse
+- zones.ZonesHotlinkProtection
Methods:
-- client.Zones.Settings.HotlinkProtection.Edit(ctx context.Context, params cloudflare.ZoneSettingHotlinkProtectionEditParams) (cloudflare.ZoneSettingHotlinkProtectionEditResponse, error)
-- client.Zones.Settings.HotlinkProtection.Get(ctx context.Context, query cloudflare.ZoneSettingHotlinkProtectionGetParams) (cloudflare.ZoneSettingHotlinkProtectionGetResponse, error)
+- client.Zones.Settings.HotlinkProtection.Edit(ctx context.Context, params zones.SettingHotlinkProtectionEditParams) (zones.ZonesHotlinkProtection, error)
+- client.Zones.Settings.HotlinkProtection.Get(ctx context.Context, query zones.SettingHotlinkProtectionGetParams) (zones.ZonesHotlinkProtection, error)
### HTTP2
+Params Types:
+
+- zones.ZonesHTTP2Param
+
Response Types:
-- cloudflare.ZoneSettingHTTP2EditResponse
-- cloudflare.ZoneSettingHTTP2GetResponse
+- zones.ZonesHTTP2
Methods:
-- client.Zones.Settings.HTTP2.Edit(ctx context.Context, params cloudflare.ZoneSettingHTTP2EditParams) (cloudflare.ZoneSettingHTTP2EditResponse, error)
-- client.Zones.Settings.HTTP2.Get(ctx context.Context, query cloudflare.ZoneSettingHTTP2GetParams) (cloudflare.ZoneSettingHTTP2GetResponse, error)
+- client.Zones.Settings.HTTP2.Edit(ctx context.Context, params zones.SettingHTTP2EditParams) (zones.ZonesHTTP2, error)
+- client.Zones.Settings.HTTP2.Get(ctx context.Context, query zones.SettingHTTP2GetParams) (zones.ZonesHTTP2, error)
### HTTP3
+Params Types:
+
+- zones.ZonesHTTP3Param
+
Response Types:
-- cloudflare.ZoneSettingHTTP3EditResponse
-- cloudflare.ZoneSettingHTTP3GetResponse
+- zones.ZonesHTTP3
Methods:
-- client.Zones.Settings.HTTP3.Edit(ctx context.Context, params cloudflare.ZoneSettingHTTP3EditParams) (cloudflare.ZoneSettingHTTP3EditResponse, error)
-- client.Zones.Settings.HTTP3.Get(ctx context.Context, query cloudflare.ZoneSettingHTTP3GetParams) (cloudflare.ZoneSettingHTTP3GetResponse, error)
+- client.Zones.Settings.HTTP3.Edit(ctx context.Context, params zones.SettingHTTP3EditParams) (zones.ZonesHTTP3, error)
+- client.Zones.Settings.HTTP3.Get(ctx context.Context, query zones.SettingHTTP3GetParams) (zones.ZonesHTTP3, error)
### ImageResizing
+Params Types:
+
+- zones.ZonesImageResizingParam
+
Response Types:
-- cloudflare.ZoneSettingImageResizingEditResponse
-- cloudflare.ZoneSettingImageResizingGetResponse
+- zones.ZonesImageResizing
Methods:
-- client.Zones.Settings.ImageResizing.Edit(ctx context.Context, params cloudflare.ZoneSettingImageResizingEditParams) (cloudflare.ZoneSettingImageResizingEditResponse, error)
-- client.Zones.Settings.ImageResizing.Get(ctx context.Context, query cloudflare.ZoneSettingImageResizingGetParams) (cloudflare.ZoneSettingImageResizingGetResponse, error)
+- client.Zones.Settings.ImageResizing.Edit(ctx context.Context, params zones.SettingImageResizingEditParams) (zones.ZonesImageResizing, error)
+- client.Zones.Settings.ImageResizing.Get(ctx context.Context, query zones.SettingImageResizingGetParams) (zones.ZonesImageResizing, error)
### IPGeolocation
+Params Types:
+
+- zones.ZonesIPGeolocationParam
+
Response Types:
-- cloudflare.ZoneSettingIPGeolocationEditResponse
-- cloudflare.ZoneSettingIPGeolocationGetResponse
+- zones.ZonesIPGeolocation
Methods:
-- client.Zones.Settings.IPGeolocation.Edit(ctx context.Context, params cloudflare.ZoneSettingIPGeolocationEditParams) (cloudflare.ZoneSettingIPGeolocationEditResponse, error)
-- client.Zones.Settings.IPGeolocation.Get(ctx context.Context, query cloudflare.ZoneSettingIPGeolocationGetParams) (cloudflare.ZoneSettingIPGeolocationGetResponse, error)
+- client.Zones.Settings.IPGeolocation.Edit(ctx context.Context, params zones.SettingIPGeolocationEditParams) (zones.ZonesIPGeolocation, error)
+- client.Zones.Settings.IPGeolocation.Get(ctx context.Context, query zones.SettingIPGeolocationGetParams) (zones.ZonesIPGeolocation, error)
### IPV6
+Params Types:
+
+- zones.ZonesIPV6Param
+
Response Types:
-- cloudflare.ZoneSettingIPV6EditResponse
-- cloudflare.ZoneSettingIPV6GetResponse
+- zones.ZonesIPV6
Methods:
-- client.Zones.Settings.IPV6.Edit(ctx context.Context, params cloudflare.ZoneSettingIPV6EditParams) (cloudflare.ZoneSettingIPV6EditResponse, error)
-- client.Zones.Settings.IPV6.Get(ctx context.Context, query cloudflare.ZoneSettingIPV6GetParams) (cloudflare.ZoneSettingIPV6GetResponse, error)
+- client.Zones.Settings.IPV6.Edit(ctx context.Context, params zones.SettingIPV6EditParams) (zones.ZonesIPV6, error)
+- client.Zones.Settings.IPV6.Get(ctx context.Context, query zones.SettingIPV6GetParams) (zones.ZonesIPV6, error)
### MinTLSVersion
+Params Types:
+
+- zones.ZonesMinTLSVersionParam
+
Response Types:
-- cloudflare.ZoneSettingMinTLSVersionEditResponse
-- cloudflare.ZoneSettingMinTLSVersionGetResponse
+- zones.ZonesMinTLSVersion
Methods:
-- client.Zones.Settings.MinTLSVersion.Edit(ctx context.Context, params cloudflare.ZoneSettingMinTLSVersionEditParams) (cloudflare.ZoneSettingMinTLSVersionEditResponse, error)
-- client.Zones.Settings.MinTLSVersion.Get(ctx context.Context, query cloudflare.ZoneSettingMinTLSVersionGetParams) (cloudflare.ZoneSettingMinTLSVersionGetResponse, error)
+- client.Zones.Settings.MinTLSVersion.Edit(ctx context.Context, params zones.SettingMinTLSVersionEditParams) (zones.ZonesMinTLSVersion, error)
+- client.Zones.Settings.MinTLSVersion.Get(ctx context.Context, query zones.SettingMinTLSVersionGetParams) (zones.ZonesMinTLSVersion, error)
### Minify
+Params Types:
+
+- zones.ZonesMinifyParam
+
Response Types:
-- cloudflare.ZoneSettingMinifyEditResponse
-- cloudflare.ZoneSettingMinifyGetResponse
+- zones.ZonesMinify
Methods:
-- client.Zones.Settings.Minify.Edit(ctx context.Context, params cloudflare.ZoneSettingMinifyEditParams) (cloudflare.ZoneSettingMinifyEditResponse, error)
-- client.Zones.Settings.Minify.Get(ctx context.Context, query cloudflare.ZoneSettingMinifyGetParams) (cloudflare.ZoneSettingMinifyGetResponse, error)
+- client.Zones.Settings.Minify.Edit(ctx context.Context, params zones.SettingMinifyEditParams) (zones.ZonesMinify, error)
+- client.Zones.Settings.Minify.Get(ctx context.Context, query zones.SettingMinifyGetParams) (zones.ZonesMinify, error)
### Mirage
+Params Types:
+
+- zones.ZonesMirageParam
+
Response Types:
-- cloudflare.ZoneSettingMirageEditResponse
-- cloudflare.ZoneSettingMirageGetResponse
+- zones.ZonesMirage
Methods:
-- client.Zones.Settings.Mirage.Edit(ctx context.Context, params cloudflare.ZoneSettingMirageEditParams) (cloudflare.ZoneSettingMirageEditResponse, error)
-- client.Zones.Settings.Mirage.Get(ctx context.Context, query cloudflare.ZoneSettingMirageGetParams) (cloudflare.ZoneSettingMirageGetResponse, error)
+- client.Zones.Settings.Mirage.Edit(ctx context.Context, params zones.SettingMirageEditParams) (zones.ZonesMirage, error)
+- client.Zones.Settings.Mirage.Get(ctx context.Context, query zones.SettingMirageGetParams) (zones.ZonesMirage, error)
### MobileRedirect
+Params Types:
+
+- zones.ZonesMobileRedirectParam
+
Response Types:
-- cloudflare.ZoneSettingMobileRedirectEditResponse
-- cloudflare.ZoneSettingMobileRedirectGetResponse
+- zones.ZonesMobileRedirect
Methods:
-- client.Zones.Settings.MobileRedirect.Edit(ctx context.Context, params cloudflare.ZoneSettingMobileRedirectEditParams) (cloudflare.ZoneSettingMobileRedirectEditResponse, error)
-- client.Zones.Settings.MobileRedirect.Get(ctx context.Context, query cloudflare.ZoneSettingMobileRedirectGetParams) (cloudflare.ZoneSettingMobileRedirectGetResponse, error)
+- client.Zones.Settings.MobileRedirect.Edit(ctx context.Context, params zones.SettingMobileRedirectEditParams) (zones.ZonesMobileRedirect, error)
+- client.Zones.Settings.MobileRedirect.Get(ctx context.Context, query zones.SettingMobileRedirectGetParams) (zones.ZonesMobileRedirect, error)
### NEL
+Params Types:
+
+- zones.ZonesNELParam
+
Response Types:
-- cloudflare.ZoneSettingNELEditResponse
-- cloudflare.ZoneSettingNELGetResponse
+- zones.ZonesNEL
Methods:
-- client.Zones.Settings.NEL.Edit(ctx context.Context, params cloudflare.ZoneSettingNELEditParams) (cloudflare.ZoneSettingNELEditResponse, error)
-- client.Zones.Settings.NEL.Get(ctx context.Context, query cloudflare.ZoneSettingNELGetParams) (cloudflare.ZoneSettingNELGetResponse, error)
+- client.Zones.Settings.NEL.Edit(ctx context.Context, params zones.SettingNELEditParams) (zones.ZonesNEL, error)
+- client.Zones.Settings.NEL.Get(ctx context.Context, query zones.SettingNELGetParams) (zones.ZonesNEL, error)
### OpportunisticEncryption
+Params Types:
+
+- zones.ZonesOpportunisticEncryptionParam
+
Response Types:
-- cloudflare.ZoneSettingOpportunisticEncryptionEditResponse
-- cloudflare.ZoneSettingOpportunisticEncryptionGetResponse
+- zones.ZonesOpportunisticEncryption
Methods:
-- client.Zones.Settings.OpportunisticEncryption.Edit(ctx context.Context, params cloudflare.ZoneSettingOpportunisticEncryptionEditParams) (cloudflare.ZoneSettingOpportunisticEncryptionEditResponse, error)
-- client.Zones.Settings.OpportunisticEncryption.Get(ctx context.Context, query cloudflare.ZoneSettingOpportunisticEncryptionGetParams) (cloudflare.ZoneSettingOpportunisticEncryptionGetResponse, error)
+- client.Zones.Settings.OpportunisticEncryption.Edit(ctx context.Context, params zones.SettingOpportunisticEncryptionEditParams) (zones.ZonesOpportunisticEncryption, error)
+- client.Zones.Settings.OpportunisticEncryption.Get(ctx context.Context, query zones.SettingOpportunisticEncryptionGetParams) (zones.ZonesOpportunisticEncryption, error)
### OpportunisticOnion
+Params Types:
+
+- zones.ZonesOpportunisticOnionParam
+
Response Types:
-- cloudflare.ZoneSettingOpportunisticOnionEditResponse
-- cloudflare.ZoneSettingOpportunisticOnionGetResponse
+- zones.ZonesOpportunisticOnion
Methods:
-- client.Zones.Settings.OpportunisticOnion.Edit(ctx context.Context, params cloudflare.ZoneSettingOpportunisticOnionEditParams) (cloudflare.ZoneSettingOpportunisticOnionEditResponse, error)
-- client.Zones.Settings.OpportunisticOnion.Get(ctx context.Context, query cloudflare.ZoneSettingOpportunisticOnionGetParams) (cloudflare.ZoneSettingOpportunisticOnionGetResponse, error)
+- client.Zones.Settings.OpportunisticOnion.Edit(ctx context.Context, params zones.SettingOpportunisticOnionEditParams) (zones.ZonesOpportunisticOnion, error)
+- client.Zones.Settings.OpportunisticOnion.Get(ctx context.Context, query zones.SettingOpportunisticOnionGetParams) (zones.ZonesOpportunisticOnion, error)
### OrangeToOrange
+Params Types:
+
+- zones.ZonesOrangeToOrangeParam
+
Response Types:
-- cloudflare.ZoneSettingOrangeToOrangeEditResponse
-- cloudflare.ZoneSettingOrangeToOrangeGetResponse
+- zones.ZonesOrangeToOrange
Methods:
-- client.Zones.Settings.OrangeToOrange.Edit(ctx context.Context, params cloudflare.ZoneSettingOrangeToOrangeEditParams) (cloudflare.ZoneSettingOrangeToOrangeEditResponse, error)
-- client.Zones.Settings.OrangeToOrange.Get(ctx context.Context, query cloudflare.ZoneSettingOrangeToOrangeGetParams) (cloudflare.ZoneSettingOrangeToOrangeGetResponse, error)
+- client.Zones.Settings.OrangeToOrange.Edit(ctx context.Context, params zones.SettingOrangeToOrangeEditParams) (zones.ZonesOrangeToOrange, error)
+- client.Zones.Settings.OrangeToOrange.Get(ctx context.Context, query zones.SettingOrangeToOrangeGetParams) (zones.ZonesOrangeToOrange, error)
### OriginErrorPagePassThru
+Params Types:
+
+- zones.ZonesOriginErrorPagePassThruParam
+
Response Types:
-- cloudflare.ZoneSettingOriginErrorPagePassThruEditResponse
-- cloudflare.ZoneSettingOriginErrorPagePassThruGetResponse
+- zones.ZonesOriginErrorPagePassThru
Methods:
-- client.Zones.Settings.OriginErrorPagePassThru.Edit(ctx context.Context, params cloudflare.ZoneSettingOriginErrorPagePassThruEditParams) (cloudflare.ZoneSettingOriginErrorPagePassThruEditResponse, error)
-- client.Zones.Settings.OriginErrorPagePassThru.Get(ctx context.Context, query cloudflare.ZoneSettingOriginErrorPagePassThruGetParams) (cloudflare.ZoneSettingOriginErrorPagePassThruGetResponse, error)
+- client.Zones.Settings.OriginErrorPagePassThru.Edit(ctx context.Context, params zones.SettingOriginErrorPagePassThruEditParams) (zones.ZonesOriginErrorPagePassThru, error)
+- client.Zones.Settings.OriginErrorPagePassThru.Get(ctx context.Context, query zones.SettingOriginErrorPagePassThruGetParams) (zones.ZonesOriginErrorPagePassThru, error)
### OriginMaxHTTPVersion
Response Types:
-- cloudflare.ZoneSettingOriginMaxHTTPVersionEditResponse
-- cloudflare.ZoneSettingOriginMaxHTTPVersionGetResponse
+- zones.SettingOriginMaxHTTPVersionEditResponse
+- zones.SettingOriginMaxHTTPVersionGetResponse
Methods:
-- client.Zones.Settings.OriginMaxHTTPVersion.Edit(ctx context.Context, params cloudflare.ZoneSettingOriginMaxHTTPVersionEditParams) (cloudflare.ZoneSettingOriginMaxHTTPVersionEditResponse, error)
-- client.Zones.Settings.OriginMaxHTTPVersion.Get(ctx context.Context, query cloudflare.ZoneSettingOriginMaxHTTPVersionGetParams) (cloudflare.ZoneSettingOriginMaxHTTPVersionGetResponse, error)
+- client.Zones.Settings.OriginMaxHTTPVersion.Edit(ctx context.Context, params zones.SettingOriginMaxHTTPVersionEditParams) (zones.SettingOriginMaxHTTPVersionEditResponse, error)
+- client.Zones.Settings.OriginMaxHTTPVersion.Get(ctx context.Context, query zones.SettingOriginMaxHTTPVersionGetParams) (zones.SettingOriginMaxHTTPVersionGetResponse, error)
### Polish
+Params Types:
+
+- zones.ZonesPolishParam
+
Response Types:
-- cloudflare.ZoneSettingPolishEditResponse
-- cloudflare.ZoneSettingPolishGetResponse
+- zones.ZonesPolish
Methods:
-- client.Zones.Settings.Polish.Edit(ctx context.Context, params cloudflare.ZoneSettingPolishEditParams) (cloudflare.ZoneSettingPolishEditResponse, error)
-- client.Zones.Settings.Polish.Get(ctx context.Context, query cloudflare.ZoneSettingPolishGetParams) (cloudflare.ZoneSettingPolishGetResponse, error)
+- client.Zones.Settings.Polish.Edit(ctx context.Context, params zones.SettingPolishEditParams) (zones.ZonesPolish, error)
+- client.Zones.Settings.Polish.Get(ctx context.Context, query zones.SettingPolishGetParams) (zones.ZonesPolish, error)
### PrefetchPreload
+Params Types:
+
+- zones.ZonesPrefetchPreloadParam
+
Response Types:
-- cloudflare.ZoneSettingPrefetchPreloadEditResponse
-- cloudflare.ZoneSettingPrefetchPreloadGetResponse
+- zones.ZonesPrefetchPreload
Methods:
-- client.Zones.Settings.PrefetchPreload.Edit(ctx context.Context, params cloudflare.ZoneSettingPrefetchPreloadEditParams) (cloudflare.ZoneSettingPrefetchPreloadEditResponse, error)
-- client.Zones.Settings.PrefetchPreload.Get(ctx context.Context, query cloudflare.ZoneSettingPrefetchPreloadGetParams) (cloudflare.ZoneSettingPrefetchPreloadGetResponse, error)
+- client.Zones.Settings.PrefetchPreload.Edit(ctx context.Context, params zones.SettingPrefetchPreloadEditParams) (zones.ZonesPrefetchPreload, error)
+- client.Zones.Settings.PrefetchPreload.Get(ctx context.Context, query zones.SettingPrefetchPreloadGetParams) (zones.ZonesPrefetchPreload, error)
### ProxyReadTimeout
+Params Types:
+
+- zones.ZonesProxyReadTimeoutParam
+
Response Types:
-- cloudflare.ZoneSettingProxyReadTimeoutEditResponse
-- cloudflare.ZoneSettingProxyReadTimeoutGetResponse
+- zones.ZonesProxyReadTimeout
Methods:
-- client.Zones.Settings.ProxyReadTimeout.Edit(ctx context.Context, params cloudflare.ZoneSettingProxyReadTimeoutEditParams) (cloudflare.ZoneSettingProxyReadTimeoutEditResponse, error)
-- client.Zones.Settings.ProxyReadTimeout.Get(ctx context.Context, query cloudflare.ZoneSettingProxyReadTimeoutGetParams) (cloudflare.ZoneSettingProxyReadTimeoutGetResponse, error)
+- client.Zones.Settings.ProxyReadTimeout.Edit(ctx context.Context, params zones.SettingProxyReadTimeoutEditParams) (zones.ZonesProxyReadTimeout, error)
+- client.Zones.Settings.ProxyReadTimeout.Get(ctx context.Context, query zones.SettingProxyReadTimeoutGetParams) (zones.ZonesProxyReadTimeout, error)
### PseudoIPV4
+Params Types:
+
+- zones.ZonesPseudoIPV4Param
+
Response Types:
-- cloudflare.ZoneSettingPseudoIPV4EditResponse
-- cloudflare.ZoneSettingPseudoIPV4GetResponse
+- zones.ZonesPseudoIPV4
Methods:
-- client.Zones.Settings.PseudoIPV4.Edit(ctx context.Context, params cloudflare.ZoneSettingPseudoIPV4EditParams) (cloudflare.ZoneSettingPseudoIPV4EditResponse, error)
-- client.Zones.Settings.PseudoIPV4.Get(ctx context.Context, query cloudflare.ZoneSettingPseudoIPV4GetParams) (cloudflare.ZoneSettingPseudoIPV4GetResponse, error)
+- client.Zones.Settings.PseudoIPV4.Edit(ctx context.Context, params zones.SettingPseudoIPV4EditParams) (zones.ZonesPseudoIPV4, error)
+- client.Zones.Settings.PseudoIPV4.Get(ctx context.Context, query zones.SettingPseudoIPV4GetParams) (zones.ZonesPseudoIPV4, error)
### ResponseBuffering
+Params Types:
+
+- zones.ZonesBufferingParam
+
Response Types:
-- cloudflare.ZoneSettingResponseBufferingEditResponse
-- cloudflare.ZoneSettingResponseBufferingGetResponse
+- zones.ZonesBuffering
Methods:
-- client.Zones.Settings.ResponseBuffering.Edit(ctx context.Context, params cloudflare.ZoneSettingResponseBufferingEditParams) (cloudflare.ZoneSettingResponseBufferingEditResponse, error)
-- client.Zones.Settings.ResponseBuffering.Get(ctx context.Context, query cloudflare.ZoneSettingResponseBufferingGetParams) (cloudflare.ZoneSettingResponseBufferingGetResponse, error)
+- client.Zones.Settings.ResponseBuffering.Edit(ctx context.Context, params zones.SettingResponseBufferingEditParams) (zones.ZonesBuffering, error)
+- client.Zones.Settings.ResponseBuffering.Get(ctx context.Context, query zones.SettingResponseBufferingGetParams) (zones.ZonesBuffering, error)
### RocketLoader
+Params Types:
+
+- zones.ZonesRocketLoaderParam
+
Response Types:
-- cloudflare.ZoneSettingRocketLoaderEditResponse
-- cloudflare.ZoneSettingRocketLoaderGetResponse
+- zones.ZonesRocketLoader
Methods:
-- client.Zones.Settings.RocketLoader.Edit(ctx context.Context, params cloudflare.ZoneSettingRocketLoaderEditParams) (cloudflare.ZoneSettingRocketLoaderEditResponse, error)
-- client.Zones.Settings.RocketLoader.Get(ctx context.Context, query cloudflare.ZoneSettingRocketLoaderGetParams) (cloudflare.ZoneSettingRocketLoaderGetResponse, error)
+- client.Zones.Settings.RocketLoader.Edit(ctx context.Context, params zones.SettingRocketLoaderEditParams) (zones.ZonesRocketLoader, error)
+- client.Zones.Settings.RocketLoader.Get(ctx context.Context, query zones.SettingRocketLoaderGetParams) (zones.ZonesRocketLoader, error)
### SecurityHeaders
+Params Types:
+
+- zones.ZonesSecurityHeaderParam
+
Response Types:
-- cloudflare.ZoneSettingSecurityHeaderEditResponse
-- cloudflare.ZoneSettingSecurityHeaderGetResponse
+- zones.ZonesSecurityHeader
Methods:
-- client.Zones.Settings.SecurityHeaders.Edit(ctx context.Context, params cloudflare.ZoneSettingSecurityHeaderEditParams) (cloudflare.ZoneSettingSecurityHeaderEditResponse, error)
-- client.Zones.Settings.SecurityHeaders.Get(ctx context.Context, query cloudflare.ZoneSettingSecurityHeaderGetParams) (cloudflare.ZoneSettingSecurityHeaderGetResponse, error)
+- client.Zones.Settings.SecurityHeaders.Edit(ctx context.Context, params zones.SettingSecurityHeaderEditParams) (zones.ZonesSecurityHeader, error)
+- client.Zones.Settings.SecurityHeaders.Get(ctx context.Context, query zones.SettingSecurityHeaderGetParams) (zones.ZonesSecurityHeader, error)
### SecurityLevel
+Params Types:
+
+- zones.ZonesSecurityLevelParam
+
Response Types:
-- cloudflare.ZoneSettingSecurityLevelEditResponse
-- cloudflare.ZoneSettingSecurityLevelGetResponse
+- zones.ZonesSecurityLevel
Methods:
-- client.Zones.Settings.SecurityLevel.Edit(ctx context.Context, params cloudflare.ZoneSettingSecurityLevelEditParams) (cloudflare.ZoneSettingSecurityLevelEditResponse, error)
-- client.Zones.Settings.SecurityLevel.Get(ctx context.Context, query cloudflare.ZoneSettingSecurityLevelGetParams) (cloudflare.ZoneSettingSecurityLevelGetResponse, error)
+- client.Zones.Settings.SecurityLevel.Edit(ctx context.Context, params zones.SettingSecurityLevelEditParams) (zones.ZonesSecurityLevel, error)
+- client.Zones.Settings.SecurityLevel.Get(ctx context.Context, query zones.SettingSecurityLevelGetParams) (zones.ZonesSecurityLevel, error)
### ServerSideExcludes
+Params Types:
+
+- zones.ZonesServerSideExcludeParam
+
Response Types:
-- cloudflare.ZoneSettingServerSideExcludeEditResponse
-- cloudflare.ZoneSettingServerSideExcludeGetResponse
+- zones.ZonesServerSideExclude
Methods:
-- client.Zones.Settings.ServerSideExcludes.Edit(ctx context.Context, params cloudflare.ZoneSettingServerSideExcludeEditParams) (cloudflare.ZoneSettingServerSideExcludeEditResponse, error)
-- client.Zones.Settings.ServerSideExcludes.Get(ctx context.Context, query cloudflare.ZoneSettingServerSideExcludeGetParams) (cloudflare.ZoneSettingServerSideExcludeGetResponse, error)
+- client.Zones.Settings.ServerSideExcludes.Edit(ctx context.Context, params zones.SettingServerSideExcludeEditParams) (zones.ZonesServerSideExclude, error)
+- client.Zones.Settings.ServerSideExcludes.Get(ctx context.Context, query zones.SettingServerSideExcludeGetParams) (zones.ZonesServerSideExclude, error)
### SortQueryStringForCache
+Params Types:
+
+- zones.ZonesSortQueryStringForCacheParam
+
Response Types:
-- cloudflare.ZoneSettingSortQueryStringForCacheEditResponse
-- cloudflare.ZoneSettingSortQueryStringForCacheGetResponse
+- zones.ZonesSortQueryStringForCache
Methods:
-- client.Zones.Settings.SortQueryStringForCache.Edit(ctx context.Context, params cloudflare.ZoneSettingSortQueryStringForCacheEditParams) (cloudflare.ZoneSettingSortQueryStringForCacheEditResponse, error)
-- client.Zones.Settings.SortQueryStringForCache.Get(ctx context.Context, query cloudflare.ZoneSettingSortQueryStringForCacheGetParams) (cloudflare.ZoneSettingSortQueryStringForCacheGetResponse, error)
+- client.Zones.Settings.SortQueryStringForCache.Edit(ctx context.Context, params zones.SettingSortQueryStringForCacheEditParams) (zones.ZonesSortQueryStringForCache, error)
+- client.Zones.Settings.SortQueryStringForCache.Get(ctx context.Context, query zones.SettingSortQueryStringForCacheGetParams) (zones.ZonesSortQueryStringForCache, error)
### SSL
+Params Types:
+
+- zones.ZonesSSLParam
+
Response Types:
-- cloudflare.ZoneSettingSSLEditResponse
-- cloudflare.ZoneSettingSSLGetResponse
+- zones.ZonesSSL
Methods:
-- client.Zones.Settings.SSL.Edit(ctx context.Context, params cloudflare.ZoneSettingSSLEditParams) (cloudflare.ZoneSettingSSLEditResponse, error)
-- client.Zones.Settings.SSL.Get(ctx context.Context, query cloudflare.ZoneSettingSSLGetParams) (cloudflare.ZoneSettingSSLGetResponse, error)
+- client.Zones.Settings.SSL.Edit(ctx context.Context, params zones.SettingSSLEditParams) (zones.ZonesSSL, error)
+- client.Zones.Settings.SSL.Get(ctx context.Context, query zones.SettingSSLGetParams) (zones.ZonesSSL, error)
### SSLRecommender
+Params Types:
+
+- zones.ZonesSSLRecommenderParam
+
Response Types:
-- cloudflare.ZoneSettingSSLRecommenderEditResponse
-- cloudflare.ZoneSettingSSLRecommenderGetResponse
+- zones.ZonesSSLRecommender
Methods:
-- client.Zones.Settings.SSLRecommender.Edit(ctx context.Context, params cloudflare.ZoneSettingSSLRecommenderEditParams) (cloudflare.ZoneSettingSSLRecommenderEditResponse, error)
-- client.Zones.Settings.SSLRecommender.Get(ctx context.Context, query cloudflare.ZoneSettingSSLRecommenderGetParams) (cloudflare.ZoneSettingSSLRecommenderGetResponse, error)
+- client.Zones.Settings.SSLRecommender.Edit(ctx context.Context, params zones.SettingSSLRecommenderEditParams) (zones.ZonesSSLRecommender, error)
+- client.Zones.Settings.SSLRecommender.Get(ctx context.Context, query zones.SettingSSLRecommenderGetParams) (zones.ZonesSSLRecommender, error)
### TLS1_3
+Params Types:
+
+- zones.ZonesTLS1_3Param
+
Response Types:
-- cloudflare.ZoneSettingTls1_3EditResponse
-- cloudflare.ZoneSettingTls1_3GetResponse
+- zones.ZonesTLS1_3
Methods:
-- client.Zones.Settings.TLS1_3.Edit(ctx context.Context, params cloudflare.ZoneSettingTLS1_3EditParams) (cloudflare.ZoneSettingTls1_3EditResponse, error)
-- client.Zones.Settings.TLS1_3.Get(ctx context.Context, query cloudflare.ZoneSettingTLS1_3GetParams) (cloudflare.ZoneSettingTls1_3GetResponse, error)
+- client.Zones.Settings.TLS1_3.Edit(ctx context.Context, params zones.SettingTLS1_3EditParams) (zones.ZonesTLS1_3, error)
+- client.Zones.Settings.TLS1_3.Get(ctx context.Context, query zones.SettingTLS1_3GetParams) (zones.ZonesTLS1_3, error)
### TLSClientAuth
+Params Types:
+
+- zones.ZonesTLSClientAuthParam
+
Response Types:
-- cloudflare.ZoneSettingTLSClientAuthEditResponse
-- cloudflare.ZoneSettingTLSClientAuthGetResponse
+- zones.ZonesTLSClientAuth
Methods:
-- client.Zones.Settings.TLSClientAuth.Edit(ctx context.Context, params cloudflare.ZoneSettingTLSClientAuthEditParams) (cloudflare.ZoneSettingTLSClientAuthEditResponse, error)
-- client.Zones.Settings.TLSClientAuth.Get(ctx context.Context, query cloudflare.ZoneSettingTLSClientAuthGetParams) (cloudflare.ZoneSettingTLSClientAuthGetResponse, error)
+- client.Zones.Settings.TLSClientAuth.Edit(ctx context.Context, params zones.SettingTLSClientAuthEditParams) (zones.ZonesTLSClientAuth, error)
+- client.Zones.Settings.TLSClientAuth.Get(ctx context.Context, query zones.SettingTLSClientAuthGetParams) (zones.ZonesTLSClientAuth, error)
### TrueClientIPHeader
+Params Types:
+
+- zones.ZonesTrueClientIPHeaderParam
+
Response Types:
-- cloudflare.ZoneSettingTrueClientIPHeaderEditResponse
-- cloudflare.ZoneSettingTrueClientIPHeaderGetResponse
+- zones.ZonesTrueClientIPHeader
Methods:
-- client.Zones.Settings.TrueClientIPHeader.Edit(ctx context.Context, params cloudflare.ZoneSettingTrueClientIPHeaderEditParams) (cloudflare.ZoneSettingTrueClientIPHeaderEditResponse, error)
-- client.Zones.Settings.TrueClientIPHeader.Get(ctx context.Context, query cloudflare.ZoneSettingTrueClientIPHeaderGetParams) (cloudflare.ZoneSettingTrueClientIPHeaderGetResponse, error)
+- client.Zones.Settings.TrueClientIPHeader.Edit(ctx context.Context, params zones.SettingTrueClientIPHeaderEditParams) (zones.ZonesTrueClientIPHeader, error)
+- client.Zones.Settings.TrueClientIPHeader.Get(ctx context.Context, query zones.SettingTrueClientIPHeaderGetParams) (zones.ZonesTrueClientIPHeader, error)
### WAF
+Params Types:
+
+- zones.ZonesWAFParam
+
Response Types:
-- cloudflare.ZoneSettingWAFEditResponse
-- cloudflare.ZoneSettingWAFGetResponse
+- zones.ZonesWAF
Methods:
-- client.Zones.Settings.WAF.Edit(ctx context.Context, params cloudflare.ZoneSettingWAFEditParams) (cloudflare.ZoneSettingWAFEditResponse, error)
-- client.Zones.Settings.WAF.Get(ctx context.Context, query cloudflare.ZoneSettingWAFGetParams) (cloudflare.ZoneSettingWAFGetResponse, error)
+- client.Zones.Settings.WAF.Edit(ctx context.Context, params zones.SettingWAFEditParams) (zones.ZonesWAF, error)
+- client.Zones.Settings.WAF.Get(ctx context.Context, query zones.SettingWAFGetParams) (zones.ZonesWAF, error)
### Webp
+Params Types:
+
+- zones.ZonesWebpParam
+
Response Types:
-- cloudflare.ZoneSettingWebpEditResponse
-- cloudflare.ZoneSettingWebpGetResponse
+- zones.ZonesWebp
Methods:
-- client.Zones.Settings.Webp.Edit(ctx context.Context, params cloudflare.ZoneSettingWebpEditParams) (cloudflare.ZoneSettingWebpEditResponse, error)
-- client.Zones.Settings.Webp.Get(ctx context.Context, query cloudflare.ZoneSettingWebpGetParams) (cloudflare.ZoneSettingWebpGetResponse, error)
+- client.Zones.Settings.Webp.Edit(ctx context.Context, params zones.SettingWebpEditParams) (zones.ZonesWebp, error)
+- client.Zones.Settings.Webp.Get(ctx context.Context, query zones.SettingWebpGetParams) (zones.ZonesWebp, error)
### Websocket
+Params Types:
+
+- zones.ZonesWebsocketsParam
+
Response Types:
-- cloudflare.ZoneSettingWebsocketEditResponse
-- cloudflare.ZoneSettingWebsocketGetResponse
+- zones.ZonesWebsockets
Methods:
-- client.Zones.Settings.Websocket.Edit(ctx context.Context, params cloudflare.ZoneSettingWebsocketEditParams) (cloudflare.ZoneSettingWebsocketEditResponse, error)
-- client.Zones.Settings.Websocket.Get(ctx context.Context, query cloudflare.ZoneSettingWebsocketGetParams) (cloudflare.ZoneSettingWebsocketGetResponse, error)
+- client.Zones.Settings.Websocket.Edit(ctx context.Context, params zones.SettingWebsocketEditParams) (zones.ZonesWebsockets, error)
+- client.Zones.Settings.Websocket.Get(ctx context.Context, query zones.SettingWebsocketGetParams) (zones.ZonesWebsockets, error)
### FontSettings
Response Types:
-- cloudflare.ZoneSettingFontSettingEditResponse
-- cloudflare.ZoneSettingFontSettingGetResponse
+- zones.SpeedCloudflareFonts
Methods:
-- client.Zones.Settings.FontSettings.Edit(ctx context.Context, params cloudflare.ZoneSettingFontSettingEditParams) (cloudflare.ZoneSettingFontSettingEditResponse, error)
-- client.Zones.Settings.FontSettings.Get(ctx context.Context, query cloudflare.ZoneSettingFontSettingGetParams) (cloudflare.ZoneSettingFontSettingGetResponse, error)
+- client.Zones.Settings.FontSettings.Edit(ctx context.Context, params zones.SettingFontSettingEditParams) (zones.SpeedCloudflareFonts, error)
+- client.Zones.Settings.FontSettings.Get(ctx context.Context, query zones.SettingFontSettingGetParams) (zones.SpeedCloudflareFonts, error)
## CustomNameservers
Response Types:
-- cloudflare.ZoneCustomNameserverUpdateResponse
-- cloudflare.ZoneCustomNameserverGetResponse
+- zones.CustomNameserverUpdateResponse
+- zones.CustomNameserverGetResponse
Methods:
-- client.Zones.CustomNameservers.Update(ctx context.Context, params cloudflare.ZoneCustomNameserverUpdateParams) (cloudflare.ZoneCustomNameserverUpdateResponse, error)
-- client.Zones.CustomNameservers.Get(ctx context.Context, query cloudflare.ZoneCustomNameserverGetParams) (cloudflare.ZoneCustomNameserverGetResponse, error)
+- client.Zones.CustomNameservers.Update(ctx context.Context, params zones.CustomNameserverUpdateParams) (zones.CustomNameserverUpdateResponse, error)
+- client.Zones.CustomNameservers.Get(ctx context.Context, query zones.CustomNameserverGetParams) (zones.CustomNameserverGetResponse, error)
## Holds
Response Types:
-- cloudflare.ZoneHoldNewResponse
-- cloudflare.ZoneHoldDeleteResponse
-- cloudflare.ZoneHoldGetResponse
+- zones.HoldNewResponse
+- zones.HoldDeleteResponse
+- zones.HoldGetResponse
Methods:
-- client.Zones.Holds.New(ctx context.Context, params cloudflare.ZoneHoldNewParams) (cloudflare.ZoneHoldNewResponse, error)
-- client.Zones.Holds.Delete(ctx context.Context, params cloudflare.ZoneHoldDeleteParams) (cloudflare.ZoneHoldDeleteResponse, error)
-- client.Zones.Holds.Get(ctx context.Context, query cloudflare.ZoneHoldGetParams) (cloudflare.ZoneHoldGetResponse, error)
+- client.Zones.Holds.New(ctx context.Context, params zones.HoldNewParams) (zones.HoldNewResponse, error)
+- client.Zones.Holds.Delete(ctx context.Context, params zones.HoldDeleteParams) (zones.HoldDeleteResponse, error)
+- client.Zones.Holds.Get(ctx context.Context, query zones.HoldGetParams) (zones.HoldGetResponse, error)
## Workers
@@ -984,223 +1125,209 @@ Methods:
Response Types:
-- cloudflare.ZoneWorkerScriptUpdateResponse
+- zones.WorkerScriptUpdateResponse
Methods:
-- client.Zones.Workers.Script.Update(ctx context.Context, body cloudflare.ZoneWorkerScriptUpdateParams) (cloudflare.ZoneWorkerScriptUpdateResponse, error)
-- client.Zones.Workers.Script.Delete(ctx context.Context, body cloudflare.ZoneWorkerScriptDeleteParams) error
-- client.Zones.Workers.Script.Get(ctx context.Context, query cloudflare.ZoneWorkerScriptGetParams) (http.Response, error)
+- client.Zones.Workers.Script.Update(ctx context.Context, body zones.WorkerScriptUpdateParams) (zones.WorkerScriptUpdateResponse, error)
+- client.Zones.Workers.Script.Delete(ctx context.Context, body zones.WorkerScriptDeleteParams) error
+- client.Zones.Workers.Script.Get(ctx context.Context, query zones.WorkerScriptGetParams) (http.Response, error)
## Subscriptions
Response Types:
-- cloudflare.ZoneSubscriptionNewResponse
-- cloudflare.ZoneSubscriptionListResponse
-- cloudflare.ZoneSubscriptionGetResponse
+- zones.SubscriptionNewResponse
+- zones.SubscriptionListResponse
+- zones.SubscriptionGetResponse
Methods:
-- client.Zones.Subscriptions.New(ctx context.Context, identifier string, body cloudflare.ZoneSubscriptionNewParams) (cloudflare.ZoneSubscriptionNewResponse, error)
-- client.Zones.Subscriptions.List(ctx context.Context, accountIdentifier string) ([]cloudflare.ZoneSubscriptionListResponse, error)
-- client.Zones.Subscriptions.Get(ctx context.Context, identifier string) (cloudflare.ZoneSubscriptionGetResponse, error)
+- client.Zones.Subscriptions.New(ctx context.Context, identifier string, body zones.SubscriptionNewParams) (zones.SubscriptionNewResponse, error)
+- client.Zones.Subscriptions.List(ctx context.Context, accountIdentifier string) ([]zones.SubscriptionListResponse, error)
+- client.Zones.Subscriptions.Get(ctx context.Context, identifier string) (zones.SubscriptionGetResponse, error)
# LoadBalancers
Response Types:
-- cloudflare.LoadBalancer
-- cloudflare.LoadBalancerDeleteResponse
+- load_balancers.LoadBalancer
+- load_balancers.LoadBalancerDeleteResponse
Methods:
-- client.LoadBalancers.New(ctx context.Context, params cloudflare.LoadBalancerNewParams) (cloudflare.LoadBalancer, error)
-- client.LoadBalancers.Update(ctx context.Context, loadBalancerID string, params cloudflare.LoadBalancerUpdateParams) (cloudflare.LoadBalancer, error)
-- client.LoadBalancers.List(ctx context.Context, query cloudflare.LoadBalancerListParams) ([]cloudflare.LoadBalancer, error)
-- client.LoadBalancers.Delete(ctx context.Context, loadBalancerID string, body cloudflare.LoadBalancerDeleteParams) (cloudflare.LoadBalancerDeleteResponse, error)
-- client.LoadBalancers.Edit(ctx context.Context, loadBalancerID string, params cloudflare.LoadBalancerEditParams) (cloudflare.LoadBalancer, error)
-- client.LoadBalancers.Get(ctx context.Context, loadBalancerID string, query cloudflare.LoadBalancerGetParams) (cloudflare.LoadBalancer, error)
+- client.LoadBalancers.New(ctx context.Context, params load_balancers.LoadBalancerNewParams) (load_balancers.LoadBalancer, error)
+- client.LoadBalancers.Update(ctx context.Context, loadBalancerID string, params load_balancers.LoadBalancerUpdateParams) (load_balancers.LoadBalancer, error)
+- client.LoadBalancers.List(ctx context.Context, query load_balancers.LoadBalancerListParams) ([]load_balancers.LoadBalancer, error)
+- client.LoadBalancers.Delete(ctx context.Context, loadBalancerID string, body load_balancers.LoadBalancerDeleteParams) (load_balancers.LoadBalancerDeleteResponse, error)
+- client.LoadBalancers.Edit(ctx context.Context, loadBalancerID string, params load_balancers.LoadBalancerEditParams) (load_balancers.LoadBalancer, error)
+- client.LoadBalancers.Get(ctx context.Context, loadBalancerID string, query load_balancers.LoadBalancerGetParams) (load_balancers.LoadBalancer, error)
## Monitors
Response Types:
-- cloudflare.LoadBalancerMonitorNewResponse
-- cloudflare.LoadBalancerMonitorUpdateResponse
-- cloudflare.LoadBalancerMonitorListResponse
-- cloudflare.LoadBalancerMonitorDeleteResponse
-- cloudflare.LoadBalancerMonitorEditResponse
-- cloudflare.LoadBalancerMonitorGetResponse
+- load_balancers.MonitorDeleteResponse
Methods:
-- client.LoadBalancers.Monitors.New(ctx context.Context, params cloudflare.LoadBalancerMonitorNewParams) (cloudflare.LoadBalancerMonitorNewResponse, error)
-- client.LoadBalancers.Monitors.Update(ctx context.Context, monitorID string, params cloudflare.LoadBalancerMonitorUpdateParams) (cloudflare.LoadBalancerMonitorUpdateResponse, error)
-- client.LoadBalancers.Monitors.List(ctx context.Context, query cloudflare.LoadBalancerMonitorListParams) ([]cloudflare.LoadBalancerMonitorListResponse, error)
-- client.LoadBalancers.Monitors.Delete(ctx context.Context, monitorID string, body cloudflare.LoadBalancerMonitorDeleteParams) (cloudflare.LoadBalancerMonitorDeleteResponse, error)
-- client.LoadBalancers.Monitors.Edit(ctx context.Context, monitorID string, params cloudflare.LoadBalancerMonitorEditParams) (cloudflare.LoadBalancerMonitorEditResponse, error)
-- client.LoadBalancers.Monitors.Get(ctx context.Context, monitorID string, query cloudflare.LoadBalancerMonitorGetParams) (cloudflare.LoadBalancerMonitorGetResponse, error)
+- client.LoadBalancers.Monitors.New(ctx context.Context, params load_balancers.MonitorNewParams) (user.LoadBalancingMonitor, error)
+- client.LoadBalancers.Monitors.Update(ctx context.Context, monitorID string, params load_balancers.MonitorUpdateParams) (user.LoadBalancingMonitor, error)
+- client.LoadBalancers.Monitors.List(ctx context.Context, query load_balancers.MonitorListParams) ([]user.LoadBalancingMonitor, error)
+- client.LoadBalancers.Monitors.Delete(ctx context.Context, monitorID string, body load_balancers.MonitorDeleteParams) (load_balancers.MonitorDeleteResponse, error)
+- client.LoadBalancers.Monitors.Edit(ctx context.Context, monitorID string, params load_balancers.MonitorEditParams) (user.LoadBalancingMonitor, error)
+- client.LoadBalancers.Monitors.Get(ctx context.Context, monitorID string, query load_balancers.MonitorGetParams) (user.LoadBalancingMonitor, error)
### Previews
Response Types:
-- cloudflare.LoadBalancerMonitorPreviewNewResponse
+- load_balancers.MonitorPreviewNewResponse
Methods:
-- client.LoadBalancers.Monitors.Previews.New(ctx context.Context, monitorID string, params cloudflare.LoadBalancerMonitorPreviewNewParams) (cloudflare.LoadBalancerMonitorPreviewNewResponse, error)
+- client.LoadBalancers.Monitors.Previews.New(ctx context.Context, monitorID string, params load_balancers.MonitorPreviewNewParams) (load_balancers.MonitorPreviewNewResponse, error)
### References
Response Types:
-- cloudflare.LoadBalancerMonitorReferenceGetResponse
+- load_balancers.MonitorReferenceGetResponse
Methods:
-- client.LoadBalancers.Monitors.References.Get(ctx context.Context, monitorID string, query cloudflare.LoadBalancerMonitorReferenceGetParams) ([]cloudflare.LoadBalancerMonitorReferenceGetResponse, error)
+- client.LoadBalancers.Monitors.References.Get(ctx context.Context, monitorID string, query load_balancers.MonitorReferenceGetParams) ([]load_balancers.MonitorReferenceGetResponse, error)
## Pools
Response Types:
-- cloudflare.LoadBalancerPoolNewResponse
-- cloudflare.LoadBalancerPoolUpdateResponse
-- cloudflare.LoadBalancerPoolListResponse
-- cloudflare.LoadBalancerPoolDeleteResponse
-- cloudflare.LoadBalancerPoolEditResponse
-- cloudflare.LoadBalancerPoolGetResponse
+- load_balancers.PoolDeleteResponse
Methods:
-- client.LoadBalancers.Pools.New(ctx context.Context, params cloudflare.LoadBalancerPoolNewParams) (cloudflare.LoadBalancerPoolNewResponse, error)
-- client.LoadBalancers.Pools.Update(ctx context.Context, poolID string, params cloudflare.LoadBalancerPoolUpdateParams) (cloudflare.LoadBalancerPoolUpdateResponse, error)
-- client.LoadBalancers.Pools.List(ctx context.Context, params cloudflare.LoadBalancerPoolListParams) ([]cloudflare.LoadBalancerPoolListResponse, error)
-- client.LoadBalancers.Pools.Delete(ctx context.Context, poolID string, body cloudflare.LoadBalancerPoolDeleteParams) (cloudflare.LoadBalancerPoolDeleteResponse, error)
-- client.LoadBalancers.Pools.Edit(ctx context.Context, poolID string, params cloudflare.LoadBalancerPoolEditParams) (cloudflare.LoadBalancerPoolEditResponse, error)
-- client.LoadBalancers.Pools.Get(ctx context.Context, poolID string, query cloudflare.LoadBalancerPoolGetParams) (cloudflare.LoadBalancerPoolGetResponse, error)
+- client.LoadBalancers.Pools.New(ctx context.Context, params load_balancers.PoolNewParams) (user.LoadBalancingPool, error)
+- client.LoadBalancers.Pools.Update(ctx context.Context, poolID string, params load_balancers.PoolUpdateParams) (user.LoadBalancingPool, error)
+- client.LoadBalancers.Pools.List(ctx context.Context, params load_balancers.PoolListParams) ([]user.LoadBalancingPool, error)
+- client.LoadBalancers.Pools.Delete(ctx context.Context, poolID string, body load_balancers.PoolDeleteParams) (load_balancers.PoolDeleteResponse, error)
+- client.LoadBalancers.Pools.Edit(ctx context.Context, poolID string, params load_balancers.PoolEditParams) (user.LoadBalancingPool, error)
+- client.LoadBalancers.Pools.Get(ctx context.Context, poolID string, query load_balancers.PoolGetParams) (user.LoadBalancingPool, error)
### Health
Response Types:
-- cloudflare.LoadBalancerPoolHealthNewResponse
-- cloudflare.LoadBalancerPoolHealthGetResponse
+- load_balancers.PoolHealthNewResponse
+- load_balancers.PoolHealthGetResponse
Methods:
-- client.LoadBalancers.Pools.Health.New(ctx context.Context, poolID string, params cloudflare.LoadBalancerPoolHealthNewParams) (cloudflare.LoadBalancerPoolHealthNewResponse, error)
-- client.LoadBalancers.Pools.Health.Get(ctx context.Context, poolID string, query cloudflare.LoadBalancerPoolHealthGetParams) (cloudflare.LoadBalancerPoolHealthGetResponse, error)
+- client.LoadBalancers.Pools.Health.New(ctx context.Context, poolID string, params load_balancers.PoolHealthNewParams) (load_balancers.PoolHealthNewResponse, error)
+- client.LoadBalancers.Pools.Health.Get(ctx context.Context, poolID string, query load_balancers.PoolHealthGetParams) (load_balancers.PoolHealthGetResponse, error)
### References
Response Types:
-- cloudflare.LoadBalancerPoolReferenceGetResponse
+- load_balancers.PoolReferenceGetResponse
Methods:
-- client.LoadBalancers.Pools.References.Get(ctx context.Context, poolID string, query cloudflare.LoadBalancerPoolReferenceGetParams) ([]cloudflare.LoadBalancerPoolReferenceGetResponse, error)
+- client.LoadBalancers.Pools.References.Get(ctx context.Context, poolID string, query load_balancers.PoolReferenceGetParams) ([]load_balancers.PoolReferenceGetResponse, error)
## Previews
-Response Types:
-
-- cloudflare.LoadBalancerPreviewGetResponse
-
Methods:
-- client.LoadBalancers.Previews.Get(ctx context.Context, previewID interface{}, query cloudflare.LoadBalancerPreviewGetParams) (cloudflare.LoadBalancerPreviewGetResponse, error)
+- client.LoadBalancers.Previews.Get(ctx context.Context, previewID interface{}, query load_balancers.PreviewGetParams) (user.LoadBalancingPreviewResult, error)
## Regions
Response Types:
-- cloudflare.LoadBalancerRegionListResponse
-- cloudflare.LoadBalancerRegionGetResponse
+- load_balancers.RegionListResponse
+- load_balancers.RegionGetResponse
Methods:
-- client.LoadBalancers.Regions.List(ctx context.Context, params cloudflare.LoadBalancerRegionListParams) (cloudflare.LoadBalancerRegionListResponse, error)
-- client.LoadBalancers.Regions.Get(ctx context.Context, regionID cloudflare.LoadBalancerRegionGetParamsRegionID, query cloudflare.LoadBalancerRegionGetParams) (cloudflare.LoadBalancerRegionGetResponse, error)
+- client.LoadBalancers.Regions.List(ctx context.Context, params load_balancers.RegionListParams) (load_balancers.RegionListResponse, error)
+- client.LoadBalancers.Regions.Get(ctx context.Context, regionID load_balancers.RegionGetParamsRegionID, query load_balancers.RegionGetParams) (load_balancers.RegionGetResponse, error)
## Searches
Response Types:
-- cloudflare.LoadBalancerSearchGetResponse
+- load_balancers.SearchGetResponse
Methods:
-- client.LoadBalancers.Searches.Get(ctx context.Context, params cloudflare.LoadBalancerSearchGetParams) ([]cloudflare.LoadBalancerSearchGetResponse, error)
+- client.LoadBalancers.Searches.Get(ctx context.Context, params load_balancers.SearchGetParams) ([]load_balancers.SearchGetResponse, error)
# Cache
Response Types:
-- cloudflare.CachePurgeResponse
+- cache.CachePurgeResponse
Methods:
-- client.Cache.Purge(ctx context.Context, params cloudflare.CachePurgeParams) (cloudflare.CachePurgeResponse, error)
+- client.Cache.Purge(ctx context.Context, params cache.CachePurgeParams) (cache.CachePurgeResponse, error)
## CacheReserve
Response Types:
-- cloudflare.CacheCacheReserveClearResponse
-- cloudflare.CacheCacheReserveEditResponse
-- cloudflare.CacheCacheReserveGetResponse
-- cloudflare.CacheCacheReserveStatusResponse
+- cache.CacheReserveClearResponse
+- cache.CacheReserveEditResponse
+- cache.CacheReserveGetResponse
+- cache.CacheReserveStatusResponse
Methods:
-- client.Cache.CacheReserve.Clear(ctx context.Context, body cloudflare.CacheCacheReserveClearParams) (cloudflare.CacheCacheReserveClearResponse, error)
-- client.Cache.CacheReserve.Edit(ctx context.Context, params cloudflare.CacheCacheReserveEditParams) (cloudflare.CacheCacheReserveEditResponse, error)
-- client.Cache.CacheReserve.Get(ctx context.Context, query cloudflare.CacheCacheReserveGetParams) (cloudflare.CacheCacheReserveGetResponse, error)
-- client.Cache.CacheReserve.Status(ctx context.Context, query cloudflare.CacheCacheReserveStatusParams) (cloudflare.CacheCacheReserveStatusResponse, error)
+- client.Cache.CacheReserve.Clear(ctx context.Context, body cache.CacheReserveClearParams) (cache.CacheReserveClearResponse, error)
+- client.Cache.CacheReserve.Edit(ctx context.Context, params cache.CacheReserveEditParams) (cache.CacheReserveEditResponse, error)
+- client.Cache.CacheReserve.Get(ctx context.Context, query cache.CacheReserveGetParams) (cache.CacheReserveGetResponse, error)
+- client.Cache.CacheReserve.Status(ctx context.Context, query cache.CacheReserveStatusParams) (cache.CacheReserveStatusResponse, error)
## SmartTieredCached
Response Types:
-- cloudflare.CacheSmartTieredCachedDeleteResponse
-- cloudflare.CacheSmartTieredCachedEditResponse
-- cloudflare.CacheSmartTieredCachedGetResponse
+- cache.SmartTieredCachedDeleteResponse
+- cache.SmartTieredCachedEditResponse
+- cache.SmartTieredCachedGetResponse
Methods:
-- client.Cache.SmartTieredCached.Delete(ctx context.Context, body cloudflare.CacheSmartTieredCachedDeleteParams) (cloudflare.CacheSmartTieredCachedDeleteResponse, error)
-- client.Cache.SmartTieredCached.Edit(ctx context.Context, params cloudflare.CacheSmartTieredCachedEditParams) (cloudflare.CacheSmartTieredCachedEditResponse, error)
-- client.Cache.SmartTieredCached.Get(ctx context.Context, query cloudflare.CacheSmartTieredCachedGetParams) (cloudflare.CacheSmartTieredCachedGetResponse, error)
+- client.Cache.SmartTieredCached.Delete(ctx context.Context, body cache.SmartTieredCachedDeleteParams) (cache.SmartTieredCachedDeleteResponse, error)
+- client.Cache.SmartTieredCached.Edit(ctx context.Context, params cache.SmartTieredCachedEditParams) (cache.SmartTieredCachedEditResponse, error)
+- client.Cache.SmartTieredCached.Get(ctx context.Context, query cache.SmartTieredCachedGetParams) (cache.SmartTieredCachedGetResponse, error)
## Variants
Response Types:
-- cloudflare.CacheVariantDeleteResponse
-- cloudflare.CacheVariantEditResponse
-- cloudflare.CacheVariantGetResponse
+- cache.CacheVariants
+- cache.VariantEditResponse
+- cache.VariantGetResponse
Methods:
-- client.Cache.Variants.Delete(ctx context.Context, body cloudflare.CacheVariantDeleteParams) (cloudflare.CacheVariantDeleteResponse, error)
-- client.Cache.Variants.Edit(ctx context.Context, params cloudflare.CacheVariantEditParams) (cloudflare.CacheVariantEditResponse, error)
-- client.Cache.Variants.Get(ctx context.Context, query cloudflare.CacheVariantGetParams) (cloudflare.CacheVariantGetResponse, error)
+- client.Cache.Variants.Delete(ctx context.Context, body cache.VariantDeleteParams) (cache.CacheVariants, error)
+- client.Cache.Variants.Edit(ctx context.Context, params cache.VariantEditParams) (cache.VariantEditResponse, error)
+- client.Cache.Variants.Get(ctx context.Context, query cache.VariantGetParams) (cache.VariantGetResponse, error)
## RegionalTieredCache
Response Types:
-- cloudflare.CacheRegionalTieredCacheEditResponse
-- cloudflare.CacheRegionalTieredCacheGetResponse
+- cache.RegionalTieredCacheEditResponse
+- cache.RegionalTieredCacheGetResponse
Methods:
-- client.Cache.RegionalTieredCache.Edit(ctx context.Context, params cloudflare.CacheRegionalTieredCacheEditParams) (cloudflare.CacheRegionalTieredCacheEditResponse, error)
-- client.Cache.RegionalTieredCache.Get(ctx context.Context, query cloudflare.CacheRegionalTieredCacheGetParams) (cloudflare.CacheRegionalTieredCacheGetResponse, error)
+- client.Cache.RegionalTieredCache.Edit(ctx context.Context, params cache.RegionalTieredCacheEditParams) (cache.RegionalTieredCacheEditResponse, error)
+- client.Cache.RegionalTieredCache.Get(ctx context.Context, query cache.RegionalTieredCacheGetParams) (cache.RegionalTieredCacheGetResponse, error)
# SSL
@@ -1208,57 +1335,57 @@ Methods:
Response Types:
-- cloudflare.SSLAnalyzeNewResponse
+- ssl.AnalyzeNewResponse
Methods:
-- client.SSL.Analyze.New(ctx context.Context, params cloudflare.SSLAnalyzeNewParams) (cloudflare.SSLAnalyzeNewResponse, error)
+- client.SSL.Analyze.New(ctx context.Context, params ssl.AnalyzeNewParams) (ssl.AnalyzeNewResponse, error)
## CertificatePacks
Response Types:
-- cloudflare.SSLCertificatePackListResponse
-- cloudflare.SSLCertificatePackDeleteResponse
-- cloudflare.SSLCertificatePackEditResponse
-- cloudflare.SSLCertificatePackGetResponse
+- ssl.CertificatePackListResponse
+- ssl.CertificatePackDeleteResponse
+- ssl.CertificatePackEditResponse
+- ssl.CertificatePackGetResponse
Methods:
-- client.SSL.CertificatePacks.List(ctx context.Context, params cloudflare.SSLCertificatePackListParams) ([]cloudflare.SSLCertificatePackListResponse, error)
-- client.SSL.CertificatePacks.Delete(ctx context.Context, certificatePackID string, body cloudflare.SSLCertificatePackDeleteParams) (cloudflare.SSLCertificatePackDeleteResponse, error)
-- client.SSL.CertificatePacks.Edit(ctx context.Context, certificatePackID string, body cloudflare.SSLCertificatePackEditParams) (cloudflare.SSLCertificatePackEditResponse, error)
-- client.SSL.CertificatePacks.Get(ctx context.Context, certificatePackID string, query cloudflare.SSLCertificatePackGetParams) (cloudflare.SSLCertificatePackGetResponse, error)
+- client.SSL.CertificatePacks.List(ctx context.Context, params ssl.CertificatePackListParams) ([]ssl.CertificatePackListResponse, error)
+- client.SSL.CertificatePacks.Delete(ctx context.Context, certificatePackID string, body ssl.CertificatePackDeleteParams) (ssl.CertificatePackDeleteResponse, error)
+- client.SSL.CertificatePacks.Edit(ctx context.Context, certificatePackID string, body ssl.CertificatePackEditParams) (ssl.CertificatePackEditResponse, error)
+- client.SSL.CertificatePacks.Get(ctx context.Context, certificatePackID string, query ssl.CertificatePackGetParams) (ssl.CertificatePackGetResponse, error)
### Order
Response Types:
-- cloudflare.SSLCertificatePackOrderNewResponse
+- ssl.CertificatePackOrderNewResponse
Methods:
-- client.SSL.CertificatePacks.Order.New(ctx context.Context, params cloudflare.SSLCertificatePackOrderNewParams) (cloudflare.SSLCertificatePackOrderNewResponse, error)
+- client.SSL.CertificatePacks.Order.New(ctx context.Context, params ssl.CertificatePackOrderNewParams) (ssl.CertificatePackOrderNewResponse, error)
### Quota
Response Types:
-- cloudflare.SSLCertificatePackQuotaGetResponse
+- ssl.CertificatePackQuotaGetResponse
Methods:
-- client.SSL.CertificatePacks.Quota.Get(ctx context.Context, query cloudflare.SSLCertificatePackQuotaGetParams) (cloudflare.SSLCertificatePackQuotaGetResponse, error)
+- client.SSL.CertificatePacks.Quota.Get(ctx context.Context, query ssl.CertificatePackQuotaGetParams) (ssl.CertificatePackQuotaGetResponse, error)
## Recommendations
Response Types:
-- cloudflare.SSLRecommendationGetResponse
+- ssl.RecommendationGetResponse
Methods:
-- client.SSL.Recommendations.Get(ctx context.Context, zoneIdentifier string) (cloudflare.SSLRecommendationGetResponse, error)
+- client.SSL.Recommendations.Get(ctx context.Context, zoneIdentifier string) (ssl.RecommendationGetResponse, error)
## Universal
@@ -1266,43 +1393,42 @@ Methods:
Response Types:
-- cloudflare.SSLUniversalSettingEditResponse
-- cloudflare.SSLUniversalSettingGetResponse
+- ssl.TLSCertificatesAndHostnamesUniversal
Methods:
-- client.SSL.Universal.Settings.Edit(ctx context.Context, params cloudflare.SSLUniversalSettingEditParams) (cloudflare.SSLUniversalSettingEditResponse, error)
-- client.SSL.Universal.Settings.Get(ctx context.Context, query cloudflare.SSLUniversalSettingGetParams) (cloudflare.SSLUniversalSettingGetResponse, error)
+- client.SSL.Universal.Settings.Edit(ctx context.Context, params ssl.UniversalSettingEditParams) (ssl.TLSCertificatesAndHostnamesUniversal, error)
+- client.SSL.Universal.Settings.Get(ctx context.Context, query ssl.UniversalSettingGetParams) (ssl.TLSCertificatesAndHostnamesUniversal, error)
## Verification
Response Types:
-- cloudflare.SSLVerificationEditResponse
-- cloudflare.SSLVerificationGetResponse
+- ssl.TLSCertificatesAndHostnamesVerification
+- ssl.VerificationEditResponse
Methods:
-- client.SSL.Verification.Edit(ctx context.Context, certificatePackID string, params cloudflare.SSLVerificationEditParams) (cloudflare.SSLVerificationEditResponse, error)
-- client.SSL.Verification.Get(ctx context.Context, params cloudflare.SSLVerificationGetParams) ([]cloudflare.SSLVerificationGetResponse, error)
+- client.SSL.Verification.Edit(ctx context.Context, certificatePackID string, params ssl.VerificationEditParams) (ssl.VerificationEditResponse, error)
+- client.SSL.Verification.Get(ctx context.Context, params ssl.VerificationGetParams) ([]ssl.TLSCertificatesAndHostnamesVerification, error)
# Subscriptions
Response Types:
-- cloudflare.SubscriptionNewResponse
-- cloudflare.SubscriptionUpdateResponse
-- cloudflare.SubscriptionListResponse
-- cloudflare.SubscriptionDeleteResponse
-- cloudflare.SubscriptionGetResponse
+- subscriptions.SubscriptionNewResponse
+- subscriptions.SubscriptionUpdateResponse
+- subscriptions.SubscriptionListResponse
+- subscriptions.SubscriptionDeleteResponse
+- subscriptions.SubscriptionGetResponse
Methods:
-- client.Subscriptions.New(ctx context.Context, identifier string, body cloudflare.SubscriptionNewParams) (cloudflare.SubscriptionNewResponse, error)
-- client.Subscriptions.Update(ctx context.Context, accountIdentifier string, subscriptionIdentifier string, body cloudflare.SubscriptionUpdateParams) (cloudflare.SubscriptionUpdateResponse, error)
-- client.Subscriptions.List(ctx context.Context, accountIdentifier string) ([]cloudflare.SubscriptionListResponse, error)
-- client.Subscriptions.Delete(ctx context.Context, accountIdentifier string, subscriptionIdentifier string) (cloudflare.SubscriptionDeleteResponse, error)
-- client.Subscriptions.Get(ctx context.Context, identifier string) (cloudflare.SubscriptionGetResponse, error)
+- client.Subscriptions.New(ctx context.Context, identifier string, body subscriptions.SubscriptionNewParams) (subscriptions.SubscriptionNewResponse, error)
+- client.Subscriptions.Update(ctx context.Context, accountIdentifier string, subscriptionIdentifier string, body subscriptions.SubscriptionUpdateParams) (subscriptions.SubscriptionUpdateResponse, error)
+- client.Subscriptions.List(ctx context.Context, accountIdentifier string) ([]subscriptions.SubscriptionListResponse, error)
+- client.Subscriptions.Delete(ctx context.Context, accountIdentifier string, subscriptionIdentifier string) (subscriptions.SubscriptionDeleteResponse, error)
+- client.Subscriptions.Get(ctx context.Context, identifier string) (subscriptions.SubscriptionGetResponse, error)
# ACM
@@ -1310,13 +1436,13 @@ Methods:
Response Types:
-- cloudflare.ACMTotalTLSNewResponse
-- cloudflare.ACMTotalTLSGetResponse
+- acm.TotalTLSNewResponse
+- acm.TotalTLSGetResponse
Methods:
-- client.ACM.TotalTLS.New(ctx context.Context, params cloudflare.ACMTotalTLSNewParams) (cloudflare.ACMTotalTLSNewResponse, error)
-- client.ACM.TotalTLS.Get(ctx context.Context, query cloudflare.ACMTotalTLSGetParams) (cloudflare.ACMTotalTLSGetResponse, error)
+- client.ACM.TotalTLS.New(ctx context.Context, params acm.TotalTLSNewParams) (acm.TotalTLSNewResponse, error)
+- client.ACM.TotalTLS.Get(ctx context.Context, query acm.TotalTLSGetParams) (acm.TotalTLSGetResponse, error)
# Argo
@@ -1324,47 +1450,46 @@ Methods:
Response Types:
-- cloudflare.ArgoSmartRoutingEditResponse
-- cloudflare.ArgoSmartRoutingGetResponse
+- argo.SmartRoutingEditResponse
+- argo.SmartRoutingGetResponse
Methods:
-- client.Argo.SmartRouting.Edit(ctx context.Context, params cloudflare.ArgoSmartRoutingEditParams) (cloudflare.ArgoSmartRoutingEditResponse, error)
-- client.Argo.SmartRouting.Get(ctx context.Context, query cloudflare.ArgoSmartRoutingGetParams) (cloudflare.ArgoSmartRoutingGetResponse, error)
+- client.Argo.SmartRouting.Edit(ctx context.Context, params argo.SmartRoutingEditParams) (argo.SmartRoutingEditResponse, error)
+- client.Argo.SmartRouting.Get(ctx context.Context, query argo.SmartRoutingGetParams) (argo.SmartRoutingGetResponse, error)
## TieredCaching
Response Types:
-- cloudflare.ArgoTieredCachingEditResponse
-- cloudflare.ArgoTieredCachingGetResponse
+- argo.TieredCachingEditResponse
+- argo.TieredCachingGetResponse
Methods:
-- client.Argo.TieredCaching.Edit(ctx context.Context, params cloudflare.ArgoTieredCachingEditParams) (cloudflare.ArgoTieredCachingEditResponse, error)
-- client.Argo.TieredCaching.Get(ctx context.Context, query cloudflare.ArgoTieredCachingGetParams) (cloudflare.ArgoTieredCachingGetResponse, error)
+- client.Argo.TieredCaching.Edit(ctx context.Context, params argo.TieredCachingEditParams) (argo.TieredCachingEditResponse, error)
+- client.Argo.TieredCaching.Get(ctx context.Context, query argo.TieredCachingGetParams) (argo.TieredCachingGetResponse, error)
# AvailablePlans
Response Types:
-- cloudflare.AvailablePlanListResponse
-- cloudflare.AvailablePlanGetResponse
+- available_plans.BillSubsAPIAvailableRatePlan
Methods:
-- client.AvailablePlans.List(ctx context.Context, zoneIdentifier string) ([]cloudflare.AvailablePlanListResponse, error)
-- client.AvailablePlans.Get(ctx context.Context, zoneIdentifier string, planIdentifier string) (cloudflare.AvailablePlanGetResponse, error)
+- client.AvailablePlans.List(ctx context.Context, zoneIdentifier string) ([]available_plans.BillSubsAPIAvailableRatePlan, error)
+- client.AvailablePlans.Get(ctx context.Context, zoneIdentifier string, planIdentifier string) (available_plans.BillSubsAPIAvailableRatePlan, error)
# AvailableRatePlans
Response Types:
-- cloudflare.AvailableRatePlanGetResponse
+- available_rate_plans.AvailableRatePlanGetResponse
Methods:
-- client.AvailableRatePlans.Get(ctx context.Context, zoneIdentifier string) ([]cloudflare.AvailableRatePlanGetResponse, error)
+- client.AvailableRatePlans.Get(ctx context.Context, zoneIdentifier string) ([]available_rate_plans.AvailableRatePlanGetResponse, error)
# CertificateAuthorities
@@ -1372,108 +1497,97 @@ Methods:
Response Types:
-- cloudflare.CertificateAuthorityHostnameAssociationUpdateResponse
-- cloudflare.CertificateAuthorityHostnameAssociationGetResponse
+- certificate_authorities.TLSCertificatesAndHostnamesHostnameAssociation
Methods:
-- client.CertificateAuthorities.HostnameAssociations.Update(ctx context.Context, params cloudflare.CertificateAuthorityHostnameAssociationUpdateParams) (cloudflare.CertificateAuthorityHostnameAssociationUpdateResponse, error)
-- client.CertificateAuthorities.HostnameAssociations.Get(ctx context.Context, params cloudflare.CertificateAuthorityHostnameAssociationGetParams) (cloudflare.CertificateAuthorityHostnameAssociationGetResponse, error)
+- client.CertificateAuthorities.HostnameAssociations.Update(ctx context.Context, params certificate_authorities.HostnameAssociationUpdateParams) (certificate_authorities.TLSCertificatesAndHostnamesHostnameAssociation, error)
+- client.CertificateAuthorities.HostnameAssociations.Get(ctx context.Context, params certificate_authorities.HostnameAssociationGetParams) (certificate_authorities.TLSCertificatesAndHostnamesHostnameAssociation, error)
# ClientCertificates
Response Types:
-- cloudflare.ClientCertificateNewResponse
-- cloudflare.ClientCertificateListResponse
-- cloudflare.ClientCertificateDeleteResponse
-- cloudflare.ClientCertificateEditResponse
-- cloudflare.ClientCertificateGetResponse
+- client_certificates.TLSCertificatesAndHostnamesClientCertificate
Methods:
-- client.ClientCertificates.New(ctx context.Context, params cloudflare.ClientCertificateNewParams) (cloudflare.ClientCertificateNewResponse, error)
-- client.ClientCertificates.List(ctx context.Context, params cloudflare.ClientCertificateListParams) (shared.V4PagePaginationArray[cloudflare.ClientCertificateListResponse], error)
-- client.ClientCertificates.Delete(ctx context.Context, clientCertificateID string, body cloudflare.ClientCertificateDeleteParams) (cloudflare.ClientCertificateDeleteResponse, error)
-- client.ClientCertificates.Edit(ctx context.Context, clientCertificateID string, body cloudflare.ClientCertificateEditParams) (cloudflare.ClientCertificateEditResponse, error)
-- client.ClientCertificates.Get(ctx context.Context, clientCertificateID string, query cloudflare.ClientCertificateGetParams) (cloudflare.ClientCertificateGetResponse, error)
+- client.ClientCertificates.New(ctx context.Context, params client_certificates.ClientCertificateNewParams) (client_certificates.TLSCertificatesAndHostnamesClientCertificate, error)
+- client.ClientCertificates.List(ctx context.Context, params client_certificates.ClientCertificateListParams) (shared.V4PagePaginationArray[client_certificates.TLSCertificatesAndHostnamesClientCertificate], error)
+- client.ClientCertificates.Delete(ctx context.Context, clientCertificateID string, body client_certificates.ClientCertificateDeleteParams) (client_certificates.TLSCertificatesAndHostnamesClientCertificate, error)
+- client.ClientCertificates.Edit(ctx context.Context, clientCertificateID string, body client_certificates.ClientCertificateEditParams) (client_certificates.TLSCertificatesAndHostnamesClientCertificate, error)
+- client.ClientCertificates.Get(ctx context.Context, clientCertificateID string, query client_certificates.ClientCertificateGetParams) (client_certificates.TLSCertificatesAndHostnamesClientCertificate, error)
# CustomCertificates
Response Types:
-- cloudflare.CustomCertificateNewResponse
-- cloudflare.CustomCertificateListResponse
-- cloudflare.CustomCertificateDeleteResponse
-- cloudflare.CustomCertificateEditResponse
-- cloudflare.CustomCertificateGetResponse
+- custom_certificates.TLSCertificatesAndHostnamesCustomCertificate
+- custom_certificates.CustomCertificateNewResponse
+- custom_certificates.CustomCertificateDeleteResponse
+- custom_certificates.CustomCertificateEditResponse
+- custom_certificates.CustomCertificateGetResponse
Methods:
-- client.CustomCertificates.New(ctx context.Context, params cloudflare.CustomCertificateNewParams) (cloudflare.CustomCertificateNewResponse, error)
-- client.CustomCertificates.List(ctx context.Context, params cloudflare.CustomCertificateListParams) (shared.V4PagePaginationArray[cloudflare.CustomCertificateListResponse], error)
-- client.CustomCertificates.Delete(ctx context.Context, customCertificateID string, body cloudflare.CustomCertificateDeleteParams) (cloudflare.CustomCertificateDeleteResponse, error)
-- client.CustomCertificates.Edit(ctx context.Context, customCertificateID string, params cloudflare.CustomCertificateEditParams) (cloudflare.CustomCertificateEditResponse, error)
-- client.CustomCertificates.Get(ctx context.Context, customCertificateID string, query cloudflare.CustomCertificateGetParams) (cloudflare.CustomCertificateGetResponse, error)
+- client.CustomCertificates.New(ctx context.Context, params custom_certificates.CustomCertificateNewParams) (custom_certificates.CustomCertificateNewResponse, error)
+- client.CustomCertificates.List(ctx context.Context, params custom_certificates.CustomCertificateListParams) (shared.V4PagePaginationArray[custom_certificates.TLSCertificatesAndHostnamesCustomCertificate], error)
+- client.CustomCertificates.Delete(ctx context.Context, customCertificateID string, body custom_certificates.CustomCertificateDeleteParams) (custom_certificates.CustomCertificateDeleteResponse, error)
+- client.CustomCertificates.Edit(ctx context.Context, customCertificateID string, params custom_certificates.CustomCertificateEditParams) (custom_certificates.CustomCertificateEditResponse, error)
+- client.CustomCertificates.Get(ctx context.Context, customCertificateID string, query custom_certificates.CustomCertificateGetParams) (custom_certificates.CustomCertificateGetResponse, error)
## Prioritize
-Response Types:
-
-- cloudflare.CustomCertificatePrioritizeUpdateResponse
-
Methods:
-- client.CustomCertificates.Prioritize.Update(ctx context.Context, params cloudflare.CustomCertificatePrioritizeUpdateParams) ([]cloudflare.CustomCertificatePrioritizeUpdateResponse, error)
+- client.CustomCertificates.Prioritize.Update(ctx context.Context, params custom_certificates.PrioritizeUpdateParams) ([]custom_certificates.TLSCertificatesAndHostnamesCustomCertificate, error)
# CustomHostnames
Response Types:
-- cloudflare.CustomHostnameNewResponse
-- cloudflare.CustomHostnameListResponse
-- cloudflare.CustomHostnameDeleteResponse
-- cloudflare.CustomHostnameEditResponse
-- cloudflare.CustomHostnameGetResponse
+- custom_hostnames.CustomHostnameNewResponse
+- custom_hostnames.CustomHostnameListResponse
+- custom_hostnames.CustomHostnameDeleteResponse
+- custom_hostnames.CustomHostnameEditResponse
+- custom_hostnames.CustomHostnameGetResponse
Methods:
-- client.CustomHostnames.New(ctx context.Context, params cloudflare.CustomHostnameNewParams) (cloudflare.CustomHostnameNewResponse, error)
-- client.CustomHostnames.List(ctx context.Context, params cloudflare.CustomHostnameListParams) (shared.V4PagePaginationArray[cloudflare.CustomHostnameListResponse], error)
-- client.CustomHostnames.Delete(ctx context.Context, customHostnameID string, body cloudflare.CustomHostnameDeleteParams) (cloudflare.CustomHostnameDeleteResponse, error)
-- client.CustomHostnames.Edit(ctx context.Context, customHostnameID string, params cloudflare.CustomHostnameEditParams) (cloudflare.CustomHostnameEditResponse, error)
-- client.CustomHostnames.Get(ctx context.Context, customHostnameID string, query cloudflare.CustomHostnameGetParams) (cloudflare.CustomHostnameGetResponse, error)
+- client.CustomHostnames.New(ctx context.Context, params custom_hostnames.CustomHostnameNewParams) (custom_hostnames.CustomHostnameNewResponse, error)
+- client.CustomHostnames.List(ctx context.Context, params custom_hostnames.CustomHostnameListParams) (shared.V4PagePaginationArray[custom_hostnames.CustomHostnameListResponse], error)
+- client.CustomHostnames.Delete(ctx context.Context, customHostnameID string, body custom_hostnames.CustomHostnameDeleteParams) (custom_hostnames.CustomHostnameDeleteResponse, error)
+- client.CustomHostnames.Edit(ctx context.Context, customHostnameID string, params custom_hostnames.CustomHostnameEditParams) (custom_hostnames.CustomHostnameEditResponse, error)
+- client.CustomHostnames.Get(ctx context.Context, customHostnameID string, query custom_hostnames.CustomHostnameGetParams) (custom_hostnames.CustomHostnameGetResponse, error)
## FallbackOrigin
Response Types:
-- cloudflare.CustomHostnameFallbackOriginUpdateResponse
-- cloudflare.CustomHostnameFallbackOriginDeleteResponse
-- cloudflare.CustomHostnameFallbackOriginGetResponse
+- custom_hostnames.FallbackOriginUpdateResponse
+- custom_hostnames.FallbackOriginDeleteResponse
+- custom_hostnames.FallbackOriginGetResponse
Methods:
-- client.CustomHostnames.FallbackOrigin.Update(ctx context.Context, params cloudflare.CustomHostnameFallbackOriginUpdateParams) (cloudflare.CustomHostnameFallbackOriginUpdateResponse, error)
-- client.CustomHostnames.FallbackOrigin.Delete(ctx context.Context, body cloudflare.CustomHostnameFallbackOriginDeleteParams) (cloudflare.CustomHostnameFallbackOriginDeleteResponse, error)
-- client.CustomHostnames.FallbackOrigin.Get(ctx context.Context, query cloudflare.CustomHostnameFallbackOriginGetParams) (cloudflare.CustomHostnameFallbackOriginGetResponse, error)
+- client.CustomHostnames.FallbackOrigin.Update(ctx context.Context, params custom_hostnames.FallbackOriginUpdateParams) (custom_hostnames.FallbackOriginUpdateResponse, error)
+- client.CustomHostnames.FallbackOrigin.Delete(ctx context.Context, body custom_hostnames.FallbackOriginDeleteParams) (custom_hostnames.FallbackOriginDeleteResponse, error)
+- client.CustomHostnames.FallbackOrigin.Get(ctx context.Context, query custom_hostnames.FallbackOriginGetParams) (custom_hostnames.FallbackOriginGetResponse, error)
# CustomNameservers
Response Types:
-- cloudflare.CustomNameserverNewResponse
-- cloudflare.CustomNameserverDeleteResponse
-- cloudflare.CustomNameserverGetResponse
-- cloudflare.CustomNameserverVerifyResponse
+- custom_nameservers.DNSCustomNameserversCustomNS
+- custom_nameservers.CustomNameserverDeleteResponse
Methods:
-- client.CustomNameservers.New(ctx context.Context, params cloudflare.CustomNameserverNewParams) (cloudflare.CustomNameserverNewResponse, error)
-- client.CustomNameservers.Delete(ctx context.Context, customNSID string, body cloudflare.CustomNameserverDeleteParams) (cloudflare.CustomNameserverDeleteResponse, error)
-- client.CustomNameservers.Availabilty(ctx context.Context, query cloudflare.CustomNameserverAvailabiltyParams) ([]string, error)
-- client.CustomNameservers.Get(ctx context.Context, query cloudflare.CustomNameserverGetParams) ([]cloudflare.CustomNameserverGetResponse, error)
-- client.CustomNameservers.Verify(ctx context.Context, body cloudflare.CustomNameserverVerifyParams) ([]cloudflare.CustomNameserverVerifyResponse, error)
+- client.CustomNameservers.New(ctx context.Context, params custom_nameservers.CustomNameserverNewParams) (custom_nameservers.DNSCustomNameserversCustomNS, error)
+- client.CustomNameservers.Delete(ctx context.Context, customNSID string, body custom_nameservers.CustomNameserverDeleteParams) (custom_nameservers.CustomNameserverDeleteResponse, error)
+- client.CustomNameservers.Availabilty(ctx context.Context, query custom_nameservers.CustomNameserverAvailabiltyParams) ([]string, error)
+- client.CustomNameservers.Get(ctx context.Context, query custom_nameservers.CustomNameserverGetParams) ([]custom_nameservers.DNSCustomNameserversCustomNS, error)
+- client.CustomNameservers.Verify(ctx context.Context, body custom_nameservers.CustomNameserverVerifyParams) ([]custom_nameservers.DNSCustomNameserversCustomNS, error)
# DNS
@@ -1481,26 +1595,26 @@ Methods:
Response Types:
-- cloudflare.DNSRecordNewResponse
-- cloudflare.DNSRecordUpdateResponse
-- cloudflare.DNSRecordListResponse
-- cloudflare.DNSRecordDeleteResponse
-- cloudflare.DNSRecordEditResponse
-- cloudflare.DNSRecordGetResponse
-- cloudflare.DNSRecordImportResponse
-- cloudflare.DNSRecordScanResponse
+- dns.RecordNewResponse
+- dns.RecordUpdateResponse
+- dns.RecordListResponse
+- dns.RecordDeleteResponse
+- dns.RecordEditResponse
+- dns.RecordGetResponse
+- dns.RecordImportResponse
+- dns.RecordScanResponse
Methods:
-- client.DNS.Records.New(ctx context.Context, params cloudflare.DNSRecordNewParams) (cloudflare.DNSRecordNewResponse, error)
-- client.DNS.Records.Update(ctx context.Context, dnsRecordID string, params cloudflare.DNSRecordUpdateParams) (cloudflare.DNSRecordUpdateResponse, error)
-- client.DNS.Records.List(ctx context.Context, params cloudflare.DNSRecordListParams) (shared.V4PagePaginationArray[cloudflare.DNSRecordListResponse], error)
-- client.DNS.Records.Delete(ctx context.Context, dnsRecordID string, body cloudflare.DNSRecordDeleteParams) (cloudflare.DNSRecordDeleteResponse, error)
-- client.DNS.Records.Edit(ctx context.Context, dnsRecordID string, params cloudflare.DNSRecordEditParams) (cloudflare.DNSRecordEditResponse, error)
-- client.DNS.Records.Export(ctx context.Context, query cloudflare.DNSRecordExportParams) (string, error)
-- client.DNS.Records.Get(ctx context.Context, dnsRecordID string, query cloudflare.DNSRecordGetParams) (cloudflare.DNSRecordGetResponse, error)
-- client.DNS.Records.Import(ctx context.Context, params cloudflare.DNSRecordImportParams) (cloudflare.DNSRecordImportResponse, error)
-- client.DNS.Records.Scan(ctx context.Context, body cloudflare.DNSRecordScanParams) (cloudflare.DNSRecordScanResponse, error)
+- client.DNS.Records.New(ctx context.Context, params dns.RecordNewParams) (dns.RecordNewResponse, error)
+- client.DNS.Records.Update(ctx context.Context, dnsRecordID string, params dns.RecordUpdateParams) (dns.RecordUpdateResponse, error)
+- client.DNS.Records.List(ctx context.Context, params dns.RecordListParams) (shared.V4PagePaginationArray[dns.RecordListResponse], error)
+- client.DNS.Records.Delete(ctx context.Context, dnsRecordID string, body dns.RecordDeleteParams) (dns.RecordDeleteResponse, error)
+- client.DNS.Records.Edit(ctx context.Context, dnsRecordID string, params dns.RecordEditParams) (dns.RecordEditResponse, error)
+- client.DNS.Records.Export(ctx context.Context, query dns.RecordExportParams) (string, error)
+- client.DNS.Records.Get(ctx context.Context, dnsRecordID string, query dns.RecordGetParams) (dns.RecordGetResponse, error)
+- client.DNS.Records.Import(ctx context.Context, params dns.RecordImportParams) (dns.RecordImportResponse, error)
+- client.DNS.Records.Scan(ctx context.Context, body dns.RecordScanParams) (dns.RecordScanResponse, error)
## Analytics
@@ -1508,75 +1622,63 @@ Methods:
Response Types:
-- cloudflare.DNSAnalyticsReportGetResponse
+- dns.DNSDNSAnalyticsAPIReport
Methods:
-- client.DNS.Analytics.Reports.Get(ctx context.Context, identifier string, query cloudflare.DNSAnalyticsReportGetParams) (cloudflare.DNSAnalyticsReportGetResponse, error)
+- client.DNS.Analytics.Reports.Get(ctx context.Context, identifier string, query dns.AnalyticsReportGetParams) (dns.DNSDNSAnalyticsAPIReport, error)
#### Bytimes
Response Types:
-- cloudflare.DNSAnalyticsReportBytimeGetResponse
+- dns.DNSDNSAnalyticsAPIReportBytime
Methods:
-- client.DNS.Analytics.Reports.Bytimes.Get(ctx context.Context, identifier string, query cloudflare.DNSAnalyticsReportBytimeGetParams) (cloudflare.DNSAnalyticsReportBytimeGetResponse, error)
+- client.DNS.Analytics.Reports.Bytimes.Get(ctx context.Context, identifier string, query dns.AnalyticsReportBytimeGetParams) (dns.DNSDNSAnalyticsAPIReportBytime, error)
## Firewall
Response Types:
-- cloudflare.DNSFirewallNewResponse
-- cloudflare.DNSFirewallListResponse
-- cloudflare.DNSFirewallDeleteResponse
-- cloudflare.DNSFirewallEditResponse
-- cloudflare.DNSFirewallGetResponse
+- dns.DNSFirewallDNSFirewall
+- dns.FirewallDeleteResponse
Methods:
-- client.DNS.Firewall.New(ctx context.Context, params cloudflare.DNSFirewallNewParams) (cloudflare.DNSFirewallNewResponse, error)
-- client.DNS.Firewall.List(ctx context.Context, params cloudflare.DNSFirewallListParams) (shared.V4PagePaginationArray[cloudflare.DNSFirewallListResponse], error)
-- client.DNS.Firewall.Delete(ctx context.Context, dnsFirewallID string, body cloudflare.DNSFirewallDeleteParams) (cloudflare.DNSFirewallDeleteResponse, error)
-- client.DNS.Firewall.Edit(ctx context.Context, dnsFirewallID string, params cloudflare.DNSFirewallEditParams) (cloudflare.DNSFirewallEditResponse, error)
-- client.DNS.Firewall.Get(ctx context.Context, dnsFirewallID string, query cloudflare.DNSFirewallGetParams) (cloudflare.DNSFirewallGetResponse, error)
+- client.DNS.Firewall.New(ctx context.Context, params dns.FirewallNewParams) (dns.DNSFirewallDNSFirewall, error)
+- client.DNS.Firewall.List(ctx context.Context, params dns.FirewallListParams) (shared.V4PagePaginationArray[dns.DNSFirewallDNSFirewall], error)
+- client.DNS.Firewall.Delete(ctx context.Context, dnsFirewallID string, body dns.FirewallDeleteParams) (dns.FirewallDeleteResponse, error)
+- client.DNS.Firewall.Edit(ctx context.Context, dnsFirewallID string, params dns.FirewallEditParams) (dns.DNSFirewallDNSFirewall, error)
+- client.DNS.Firewall.Get(ctx context.Context, dnsFirewallID string, query dns.FirewallGetParams) (dns.DNSFirewallDNSFirewall, error)
### Analytics
#### Reports
-Response Types:
-
-- cloudflare.DNSFirewallAnalyticsReportGetResponse
-
Methods:
-- client.DNS.Firewall.Analytics.Reports.Get(ctx context.Context, accountIdentifier string, identifier string, query cloudflare.DNSFirewallAnalyticsReportGetParams) (cloudflare.DNSFirewallAnalyticsReportGetResponse, error)
+- client.DNS.Firewall.Analytics.Reports.Get(ctx context.Context, accountIdentifier string, identifier string, query dns.FirewallAnalyticsReportGetParams) (dns.DNSDNSAnalyticsAPIReport, error)
##### Bytimes
-Response Types:
-
-- cloudflare.DNSFirewallAnalyticsReportBytimeGetResponse
-
Methods:
-- client.DNS.Firewall.Analytics.Reports.Bytimes.Get(ctx context.Context, accountIdentifier string, identifier string, query cloudflare.DNSFirewallAnalyticsReportBytimeGetParams) (cloudflare.DNSFirewallAnalyticsReportBytimeGetResponse, error)
+- client.DNS.Firewall.Analytics.Reports.Bytimes.Get(ctx context.Context, accountIdentifier string, identifier string, query dns.FirewallAnalyticsReportBytimeGetParams) (dns.DNSDNSAnalyticsAPIReportBytime, error)
# DNSSEC
Response Types:
-- cloudflare.DNSSECDeleteResponse
-- cloudflare.DNSSECEditResponse
-- cloudflare.DNSSECGetResponse
+- dnssec.DNSSECDNSSEC
+- dnssec.DNSSECDeleteResponse
Methods:
-- client.DNSSEC.Delete(ctx context.Context, body cloudflare.DNSSECDeleteParams) (cloudflare.DNSSECDeleteResponse, error)
-- client.DNSSEC.Edit(ctx context.Context, params cloudflare.DNSSECEditParams) (cloudflare.DNSSECEditResponse, error)
-- client.DNSSEC.Get(ctx context.Context, query cloudflare.DNSSECGetParams) (cloudflare.DNSSECGetResponse, error)
+- client.DNSSEC.Delete(ctx context.Context, body dnssec.DNSSECDeleteParams) (dnssec.DNSSECDeleteResponse, error)
+- client.DNSSEC.Edit(ctx context.Context, params dnssec.DNSSECEditParams) (dnssec.DNSSECDNSSEC, error)
+- client.DNSSEC.Get(ctx context.Context, query dnssec.DNSSECGetParams) (dnssec.DNSSECDNSSEC, error)
# EmailRouting
@@ -1584,105 +1686,100 @@ Methods:
Response Types:
-- cloudflare.EmailRoutingRoutingGetResponse
+- email_routing.RoutingGetResponse
Methods:
-- client.EmailRouting.Routing.Get(ctx context.Context, zoneIdentifier string) (cloudflare.EmailRoutingRoutingGetResponse, error)
+- client.EmailRouting.Routing.Get(ctx context.Context, zoneIdentifier string) (email_routing.RoutingGetResponse, error)
### Disables
Response Types:
-- cloudflare.EmailRoutingRoutingDisableNewResponse
+- email_routing.RoutingDisableNewResponse
Methods:
-- client.EmailRouting.Routing.Disables.New(ctx context.Context, zoneIdentifier string) (cloudflare.EmailRoutingRoutingDisableNewResponse, error)
+- client.EmailRouting.Routing.Disables.New(ctx context.Context, zoneIdentifier string) (email_routing.RoutingDisableNewResponse, error)
### DNS
Response Types:
-- cloudflare.EmailRoutingRoutingDNSGetResponse
+- email_routing.EmailDNSRecord
Methods:
-- client.EmailRouting.Routing.DNS.Get(ctx context.Context, zoneIdentifier string) ([]cloudflare.EmailRoutingRoutingDNSGetResponse, error)
+- client.EmailRouting.Routing.DNS.Get(ctx context.Context, zoneIdentifier string) ([]email_routing.EmailDNSRecord, error)
### Enables
Response Types:
-- cloudflare.EmailRoutingRoutingEnableNewResponse
+- email_routing.RoutingEnableNewResponse
Methods:
-- client.EmailRouting.Routing.Enables.New(ctx context.Context, zoneIdentifier string) (cloudflare.EmailRoutingRoutingEnableNewResponse, error)
+- client.EmailRouting.Routing.Enables.New(ctx context.Context, zoneIdentifier string) (email_routing.RoutingEnableNewResponse, error)
### Rules
Response Types:
-- cloudflare.EmailRoutingRoutingRuleNewResponse
-- cloudflare.EmailRoutingRoutingRuleUpdateResponse
-- cloudflare.EmailRoutingRoutingRuleListResponse
-- cloudflare.EmailRoutingRoutingRuleDeleteResponse
-- cloudflare.EmailRoutingRoutingRuleGetResponse
+- email_routing.RoutingRuleNewResponse
+- email_routing.RoutingRuleUpdateResponse
+- email_routing.RoutingRuleListResponse
+- email_routing.RoutingRuleDeleteResponse
+- email_routing.RoutingRuleGetResponse
Methods:
-- client.EmailRouting.Routing.Rules.New(ctx context.Context, zoneIdentifier string, body cloudflare.EmailRoutingRoutingRuleNewParams) (cloudflare.EmailRoutingRoutingRuleNewResponse, error)
-- client.EmailRouting.Routing.Rules.Update(ctx context.Context, zoneIdentifier string, ruleIdentifier string, body cloudflare.EmailRoutingRoutingRuleUpdateParams) (cloudflare.EmailRoutingRoutingRuleUpdateResponse, error)
-- client.EmailRouting.Routing.Rules.List(ctx context.Context, zoneIdentifier string, query cloudflare.EmailRoutingRoutingRuleListParams) (shared.V4PagePaginationArray[cloudflare.EmailRoutingRoutingRuleListResponse], error)
-- client.EmailRouting.Routing.Rules.Delete(ctx context.Context, zoneIdentifier string, ruleIdentifier string) (cloudflare.EmailRoutingRoutingRuleDeleteResponse, error)
-- client.EmailRouting.Routing.Rules.Get(ctx context.Context, zoneIdentifier string, ruleIdentifier string) (cloudflare.EmailRoutingRoutingRuleGetResponse, error)
+- client.EmailRouting.Routing.Rules.New(ctx context.Context, zoneIdentifier string, body email_routing.RoutingRuleNewParams) (email_routing.RoutingRuleNewResponse, error)
+- client.EmailRouting.Routing.Rules.Update(ctx context.Context, zoneIdentifier string, ruleIdentifier string, body email_routing.RoutingRuleUpdateParams) (email_routing.RoutingRuleUpdateResponse, error)
+- client.EmailRouting.Routing.Rules.List(ctx context.Context, zoneIdentifier string, query email_routing.RoutingRuleListParams) (shared.V4PagePaginationArray[email_routing.RoutingRuleListResponse], error)
+- client.EmailRouting.Routing.Rules.Delete(ctx context.Context, zoneIdentifier string, ruleIdentifier string) (email_routing.RoutingRuleDeleteResponse, error)
+- client.EmailRouting.Routing.Rules.Get(ctx context.Context, zoneIdentifier string, ruleIdentifier string) (email_routing.RoutingRuleGetResponse, error)
#### CatchAlls
Response Types:
-- cloudflare.EmailRoutingRoutingRuleCatchAllUpdateResponse
-- cloudflare.EmailRoutingRoutingRuleCatchAllGetResponse
+- email_routing.EmailCatchAllRule
Methods:
-- client.EmailRouting.Routing.Rules.CatchAlls.Update(ctx context.Context, zoneIdentifier string, body cloudflare.EmailRoutingRoutingRuleCatchAllUpdateParams) (cloudflare.EmailRoutingRoutingRuleCatchAllUpdateResponse, error)
-- client.EmailRouting.Routing.Rules.CatchAlls.Get(ctx context.Context, zoneIdentifier string) (cloudflare.EmailRoutingRoutingRuleCatchAllGetResponse, error)
+- client.EmailRouting.Routing.Rules.CatchAlls.Update(ctx context.Context, zoneIdentifier string, body email_routing.RoutingRuleCatchAllUpdateParams) (email_routing.EmailCatchAllRule, error)
+- client.EmailRouting.Routing.Rules.CatchAlls.Get(ctx context.Context, zoneIdentifier string) (email_routing.EmailCatchAllRule, error)
### Addresses
Response Types:
-- cloudflare.EmailRoutingRoutingAddressNewResponse
-- cloudflare.EmailRoutingRoutingAddressListResponse
-- cloudflare.EmailRoutingRoutingAddressDeleteResponse
-- cloudflare.EmailRoutingRoutingAddressGetResponse
+- email_routing.RoutingAddressNewResponse
+- email_routing.RoutingAddressListResponse
+- email_routing.RoutingAddressDeleteResponse
+- email_routing.RoutingAddressGetResponse
Methods:
-- client.EmailRouting.Routing.Addresses.New(ctx context.Context, accountIdentifier string, body cloudflare.EmailRoutingRoutingAddressNewParams) (cloudflare.EmailRoutingRoutingAddressNewResponse, error)
-- client.EmailRouting.Routing.Addresses.List(ctx context.Context, accountIdentifier string, query cloudflare.EmailRoutingRoutingAddressListParams) (shared.V4PagePaginationArray[cloudflare.EmailRoutingRoutingAddressListResponse], error)
-- client.EmailRouting.Routing.Addresses.Delete(ctx context.Context, accountIdentifier string, destinationAddressIdentifier string) (cloudflare.EmailRoutingRoutingAddressDeleteResponse, error)
-- client.EmailRouting.Routing.Addresses.Get(ctx context.Context, accountIdentifier string, destinationAddressIdentifier string) (cloudflare.EmailRoutingRoutingAddressGetResponse, error)
+- client.EmailRouting.Routing.Addresses.New(ctx context.Context, accountIdentifier string, body email_routing.RoutingAddressNewParams) (email_routing.RoutingAddressNewResponse, error)
+- client.EmailRouting.Routing.Addresses.List(ctx context.Context, accountIdentifier string, query email_routing.RoutingAddressListParams) (shared.V4PagePaginationArray[email_routing.RoutingAddressListResponse], error)
+- client.EmailRouting.Routing.Addresses.Delete(ctx context.Context, accountIdentifier string, destinationAddressIdentifier string) (email_routing.RoutingAddressDeleteResponse, error)
+- client.EmailRouting.Routing.Addresses.Get(ctx context.Context, accountIdentifier string, destinationAddressIdentifier string) (email_routing.RoutingAddressGetResponse, error)
# Filters
Response Types:
-- cloudflare.FilterNewResponse
-- cloudflare.FilterUpdateResponse
-- cloudflare.FilterListResponse
-- cloudflare.FilterDeleteResponse
-- cloudflare.FilterGetResponse
+- filters.LegacyJhsFilter
Methods:
-- client.Filters.New(ctx context.Context, zoneIdentifier string, body cloudflare.FilterNewParams) ([]cloudflare.FilterNewResponse, error)
-- client.Filters.Update(ctx context.Context, zoneIdentifier string, id string, body cloudflare.FilterUpdateParams) (cloudflare.FilterUpdateResponse, error)
-- client.Filters.List(ctx context.Context, zoneIdentifier string, query cloudflare.FilterListParams) (shared.V4PagePaginationArray[cloudflare.FilterListResponse], error)
-- client.Filters.Delete(ctx context.Context, zoneIdentifier string, id string) (cloudflare.FilterDeleteResponse, error)
-- client.Filters.Get(ctx context.Context, zoneIdentifier string, id string) (cloudflare.FilterGetResponse, error)
+- client.Filters.New(ctx context.Context, zoneIdentifier string, body filters.FilterNewParams) ([]filters.LegacyJhsFilter, error)
+- client.Filters.Update(ctx context.Context, zoneIdentifier string, id string, body filters.FilterUpdateParams) (filters.LegacyJhsFilter, error)
+- client.Filters.List(ctx context.Context, zoneIdentifier string, query filters.FilterListParams) (shared.V4PagePaginationArray[filters.LegacyJhsFilter], error)
+- client.Filters.Delete(ctx context.Context, zoneIdentifier string, id string) (filters.LegacyJhsFilter, error)
+- client.Filters.Get(ctx context.Context, zoneIdentifier string, id string) (filters.LegacyJhsFilter, error)
# Firewall
@@ -1690,75 +1787,67 @@ Methods:
Response Types:
-- cloudflare.FirewallLockdownNewResponse
-- cloudflare.FirewallLockdownUpdateResponse
-- cloudflare.FirewallLockdownListResponse
-- cloudflare.FirewallLockdownDeleteResponse
-- cloudflare.FirewallLockdownGetResponse
+- firewall.LegacyJhsZonelockdown
+- firewall.LockdownDeleteResponse
Methods:
-- client.Firewall.Lockdowns.New(ctx context.Context, zoneIdentifier string, body cloudflare.FirewallLockdownNewParams) (cloudflare.FirewallLockdownNewResponse, error)
-- client.Firewall.Lockdowns.Update(ctx context.Context, zoneIdentifier string, id string, body cloudflare.FirewallLockdownUpdateParams) (cloudflare.FirewallLockdownUpdateResponse, error)
-- client.Firewall.Lockdowns.List(ctx context.Context, zoneIdentifier string, query cloudflare.FirewallLockdownListParams) (shared.V4PagePaginationArray[cloudflare.FirewallLockdownListResponse], error)
-- client.Firewall.Lockdowns.Delete(ctx context.Context, zoneIdentifier string, id string) (cloudflare.FirewallLockdownDeleteResponse, error)
-- client.Firewall.Lockdowns.Get(ctx context.Context, zoneIdentifier string, id string) (cloudflare.FirewallLockdownGetResponse, error)
+- client.Firewall.Lockdowns.New(ctx context.Context, zoneIdentifier string, body firewall.LockdownNewParams) (firewall.LegacyJhsZonelockdown, error)
+- client.Firewall.Lockdowns.Update(ctx context.Context, zoneIdentifier string, id string, body firewall.LockdownUpdateParams) (firewall.LegacyJhsZonelockdown, error)
+- client.Firewall.Lockdowns.List(ctx context.Context, zoneIdentifier string, query firewall.LockdownListParams) (shared.V4PagePaginationArray[firewall.LegacyJhsZonelockdown], error)
+- client.Firewall.Lockdowns.Delete(ctx context.Context, zoneIdentifier string, id string) (firewall.LockdownDeleteResponse, error)
+- client.Firewall.Lockdowns.Get(ctx context.Context, zoneIdentifier string, id string) (firewall.LegacyJhsZonelockdown, error)
## Rules
Response Types:
-- cloudflare.FirewallRuleNewResponse
-- cloudflare.FirewallRuleUpdateResponse
-- cloudflare.FirewallRuleListResponse
-- cloudflare.FirewallRuleDeleteResponse
-- cloudflare.FirewallRuleEditResponse
-- cloudflare.FirewallRuleGetResponse
+- firewall.LegacyJhsFilterRule
Methods:
-- client.Firewall.Rules.New(ctx context.Context, zoneIdentifier string, body cloudflare.FirewallRuleNewParams) ([]cloudflare.FirewallRuleNewResponse, error)
-- client.Firewall.Rules.Update(ctx context.Context, zoneIdentifier string, id string, body cloudflare.FirewallRuleUpdateParams) (cloudflare.FirewallRuleUpdateResponse, error)
-- client.Firewall.Rules.List(ctx context.Context, zoneIdentifier string, query cloudflare.FirewallRuleListParams) (shared.V4PagePaginationArray[cloudflare.FirewallRuleListResponse], error)
-- client.Firewall.Rules.Delete(ctx context.Context, zoneIdentifier string, id string, body cloudflare.FirewallRuleDeleteParams) (cloudflare.FirewallRuleDeleteResponse, error)
-- client.Firewall.Rules.Edit(ctx context.Context, zoneIdentifier string, id string, body cloudflare.FirewallRuleEditParams) ([]cloudflare.FirewallRuleEditResponse, error)
-- client.Firewall.Rules.Get(ctx context.Context, zoneIdentifier string, id string, query cloudflare.FirewallRuleGetParams) (cloudflare.FirewallRuleGetResponse, error)
+- client.Firewall.Rules.New(ctx context.Context, zoneIdentifier string, body firewall.RuleNewParams) ([]firewall.LegacyJhsFilterRule, error)
+- client.Firewall.Rules.Update(ctx context.Context, zoneIdentifier string, id string, body firewall.RuleUpdateParams) (firewall.LegacyJhsFilterRule, error)
+- client.Firewall.Rules.List(ctx context.Context, zoneIdentifier string, query firewall.RuleListParams) (shared.V4PagePaginationArray[firewall.LegacyJhsFilterRule], error)
+- client.Firewall.Rules.Delete(ctx context.Context, zoneIdentifier string, id string, body firewall.RuleDeleteParams) (firewall.LegacyJhsFilterRule, error)
+- client.Firewall.Rules.Edit(ctx context.Context, zoneIdentifier string, id string, body firewall.RuleEditParams) ([]firewall.LegacyJhsFilterRule, error)
+- client.Firewall.Rules.Get(ctx context.Context, zoneIdentifier string, id string, query firewall.RuleGetParams) (firewall.LegacyJhsFilterRule, error)
## AccessRules
Response Types:
-- cloudflare.FirewallAccessRuleNewResponse
-- cloudflare.FirewallAccessRuleListResponse
-- cloudflare.FirewallAccessRuleDeleteResponse
-- cloudflare.FirewallAccessRuleEditResponse
-- cloudflare.FirewallAccessRuleGetResponse
+- firewall.AccessRuleNewResponse
+- firewall.AccessRuleListResponse
+- firewall.AccessRuleDeleteResponse
+- firewall.AccessRuleEditResponse
+- firewall.AccessRuleGetResponse
Methods:
-- client.Firewall.AccessRules.New(ctx context.Context, params cloudflare.FirewallAccessRuleNewParams) (cloudflare.FirewallAccessRuleNewResponse, error)
-- client.Firewall.AccessRules.List(ctx context.Context, params cloudflare.FirewallAccessRuleListParams) (shared.V4PagePaginationArray[cloudflare.FirewallAccessRuleListResponse], error)
-- client.Firewall.AccessRules.Delete(ctx context.Context, identifier interface{}, body cloudflare.FirewallAccessRuleDeleteParams) (cloudflare.FirewallAccessRuleDeleteResponse, error)
-- client.Firewall.AccessRules.Edit(ctx context.Context, identifier interface{}, params cloudflare.FirewallAccessRuleEditParams) (cloudflare.FirewallAccessRuleEditResponse, error)
-- client.Firewall.AccessRules.Get(ctx context.Context, identifier interface{}, query cloudflare.FirewallAccessRuleGetParams) (cloudflare.FirewallAccessRuleGetResponse, error)
+- client.Firewall.AccessRules.New(ctx context.Context, params firewall.AccessRuleNewParams) (firewall.AccessRuleNewResponse, error)
+- client.Firewall.AccessRules.List(ctx context.Context, params firewall.AccessRuleListParams) (shared.V4PagePaginationArray[firewall.AccessRuleListResponse], error)
+- client.Firewall.AccessRules.Delete(ctx context.Context, identifier interface{}, body firewall.AccessRuleDeleteParams) (firewall.AccessRuleDeleteResponse, error)
+- client.Firewall.AccessRules.Edit(ctx context.Context, identifier interface{}, params firewall.AccessRuleEditParams) (firewall.AccessRuleEditResponse, error)
+- client.Firewall.AccessRules.Get(ctx context.Context, identifier interface{}, query firewall.AccessRuleGetParams) (firewall.AccessRuleGetResponse, error)
## UARules
Response Types:
-- cloudflare.FirewallUARuleNewResponse
-- cloudflare.FirewallUARuleUpdateResponse
-- cloudflare.FirewallUARuleListResponse
-- cloudflare.FirewallUARuleDeleteResponse
-- cloudflare.FirewallUARuleGetResponse
+- firewall.UARuleNewResponse
+- firewall.UARuleUpdateResponse
+- firewall.UARuleListResponse
+- firewall.UARuleDeleteResponse
+- firewall.UARuleGetResponse
Methods:
-- client.Firewall.UARules.New(ctx context.Context, zoneIdentifier string, body cloudflare.FirewallUARuleNewParams) (cloudflare.FirewallUARuleNewResponse, error)
-- client.Firewall.UARules.Update(ctx context.Context, zoneIdentifier string, id string, body cloudflare.FirewallUARuleUpdateParams) (cloudflare.FirewallUARuleUpdateResponse, error)
-- client.Firewall.UARules.List(ctx context.Context, zoneIdentifier string, query cloudflare.FirewallUARuleListParams) (shared.V4PagePaginationArray[cloudflare.FirewallUARuleListResponse], error)
-- client.Firewall.UARules.Delete(ctx context.Context, zoneIdentifier string, id string) (cloudflare.FirewallUARuleDeleteResponse, error)
-- client.Firewall.UARules.Get(ctx context.Context, zoneIdentifier string, id string) (cloudflare.FirewallUARuleGetResponse, error)
+- client.Firewall.UARules.New(ctx context.Context, zoneIdentifier string, body firewall.UARuleNewParams) (firewall.UARuleNewResponse, error)
+- client.Firewall.UARules.Update(ctx context.Context, zoneIdentifier string, id string, body firewall.UARuleUpdateParams) (firewall.UARuleUpdateResponse, error)
+- client.Firewall.UARules.List(ctx context.Context, zoneIdentifier string, query firewall.UARuleListParams) (shared.V4PagePaginationArray[firewall.UARuleListResponse], error)
+- client.Firewall.UARules.Delete(ctx context.Context, zoneIdentifier string, id string) (firewall.UARuleDeleteResponse, error)
+- client.Firewall.UARules.Get(ctx context.Context, zoneIdentifier string, id string) (firewall.UARuleGetResponse, error)
## WAF
@@ -1766,111 +1855,99 @@ Methods:
Response Types:
-- cloudflare.FirewallWAFOverrideNewResponse
-- cloudflare.FirewallWAFOverrideUpdateResponse
-- cloudflare.FirewallWAFOverrideListResponse
-- cloudflare.FirewallWAFOverrideDeleteResponse
-- cloudflare.FirewallWAFOverrideGetResponse
+- firewall.LegacyJhsOverride
+- firewall.WAFOverrideDeleteResponse
Methods:
-- client.Firewall.WAF.Overrides.New(ctx context.Context, zoneIdentifier string, body cloudflare.FirewallWAFOverrideNewParams) (cloudflare.FirewallWAFOverrideNewResponse, error)
-- client.Firewall.WAF.Overrides.Update(ctx context.Context, zoneIdentifier string, id string, body cloudflare.FirewallWAFOverrideUpdateParams) (cloudflare.FirewallWAFOverrideUpdateResponse, error)
-- client.Firewall.WAF.Overrides.List(ctx context.Context, zoneIdentifier string, query cloudflare.FirewallWAFOverrideListParams) (shared.V4PagePaginationArray[cloudflare.FirewallWAFOverrideListResponse], error)
-- client.Firewall.WAF.Overrides.Delete(ctx context.Context, zoneIdentifier string, id string) (cloudflare.FirewallWAFOverrideDeleteResponse, error)
-- client.Firewall.WAF.Overrides.Get(ctx context.Context, zoneIdentifier string, id string) (cloudflare.FirewallWAFOverrideGetResponse, error)
+- client.Firewall.WAF.Overrides.New(ctx context.Context, zoneIdentifier string, body firewall.WAFOverrideNewParams) (firewall.LegacyJhsOverride, error)
+- client.Firewall.WAF.Overrides.Update(ctx context.Context, zoneIdentifier string, id string, body firewall.WAFOverrideUpdateParams) (firewall.LegacyJhsOverride, error)
+- client.Firewall.WAF.Overrides.List(ctx context.Context, zoneIdentifier string, query firewall.WAFOverrideListParams) (shared.V4PagePaginationArray[firewall.LegacyJhsOverride], error)
+- client.Firewall.WAF.Overrides.Delete(ctx context.Context, zoneIdentifier string, id string) (firewall.WAFOverrideDeleteResponse, error)
+- client.Firewall.WAF.Overrides.Get(ctx context.Context, zoneIdentifier string, id string) (firewall.LegacyJhsOverride, error)
### Packages
Response Types:
-- cloudflare.FirewallWAFPackageListResponse
-- cloudflare.FirewallWAFPackageGetResponse
+- firewall.WAFPackageListResponse
+- firewall.WAFPackageGetResponse
Methods:
-- client.Firewall.WAF.Packages.List(ctx context.Context, zoneIdentifier string, query cloudflare.FirewallWAFPackageListParams) (shared.V4PagePaginationArray[cloudflare.FirewallWAFPackageListResponse], error)
-- client.Firewall.WAF.Packages.Get(ctx context.Context, zoneIdentifier string, identifier string) (cloudflare.FirewallWAFPackageGetResponse, error)
+- client.Firewall.WAF.Packages.List(ctx context.Context, zoneIdentifier string, query firewall.WAFPackageListParams) (shared.V4PagePaginationArray[firewall.WAFPackageListResponse], error)
+- client.Firewall.WAF.Packages.Get(ctx context.Context, zoneIdentifier string, identifier string) (firewall.WAFPackageGetResponse, error)
#### Groups
Response Types:
-- cloudflare.FirewallWAFPackageGroupListResponse
-- cloudflare.FirewallWAFPackageGroupEditResponse
-- cloudflare.FirewallWAFPackageGroupGetResponse
+- firewall.WAFManagedRulesSchemasGroup
+- firewall.WAFPackageGroupEditResponse
+- firewall.WAFPackageGroupGetResponse
Methods:
-- client.Firewall.WAF.Packages.Groups.List(ctx context.Context, packageID string, params cloudflare.FirewallWAFPackageGroupListParams) (shared.V4PagePaginationArray[cloudflare.FirewallWAFPackageGroupListResponse], error)
-- client.Firewall.WAF.Packages.Groups.Edit(ctx context.Context, packageID string, groupID string, params cloudflare.FirewallWAFPackageGroupEditParams) (cloudflare.FirewallWAFPackageGroupEditResponse, error)
-- client.Firewall.WAF.Packages.Groups.Get(ctx context.Context, packageID string, groupID string, query cloudflare.FirewallWAFPackageGroupGetParams) (cloudflare.FirewallWAFPackageGroupGetResponse, error)
+- client.Firewall.WAF.Packages.Groups.List(ctx context.Context, packageID string, params firewall.WAFPackageGroupListParams) (shared.V4PagePaginationArray[firewall.WAFManagedRulesSchemasGroup], error)
+- client.Firewall.WAF.Packages.Groups.Edit(ctx context.Context, packageID string, groupID string, params firewall.WAFPackageGroupEditParams) (firewall.WAFPackageGroupEditResponse, error)
+- client.Firewall.WAF.Packages.Groups.Get(ctx context.Context, packageID string, groupID string, query firewall.WAFPackageGroupGetParams) (firewall.WAFPackageGroupGetResponse, error)
#### Rules
Response Types:
-- cloudflare.FirewallWAFPackageRuleListResponse
-- cloudflare.FirewallWAFPackageRuleEditResponse
-- cloudflare.FirewallWAFPackageRuleGetResponse
+- firewall.WAFManagedRulesRule
+- firewall.WAFPackageRuleEditResponse
+- firewall.WAFPackageRuleGetResponse
Methods:
-- client.Firewall.WAF.Packages.Rules.List(ctx context.Context, packageID string, params cloudflare.FirewallWAFPackageRuleListParams) (shared.V4PagePaginationArray[cloudflare.FirewallWAFPackageRuleListResponse], error)
-- client.Firewall.WAF.Packages.Rules.Edit(ctx context.Context, packageID string, ruleID string, params cloudflare.FirewallWAFPackageRuleEditParams) (cloudflare.FirewallWAFPackageRuleEditResponse, error)
-- client.Firewall.WAF.Packages.Rules.Get(ctx context.Context, packageID string, ruleID string, query cloudflare.FirewallWAFPackageRuleGetParams) (cloudflare.FirewallWAFPackageRuleGetResponse, error)
+- client.Firewall.WAF.Packages.Rules.List(ctx context.Context, packageID string, params firewall.WAFPackageRuleListParams) (shared.V4PagePaginationArray[firewall.WAFManagedRulesRule], error)
+- client.Firewall.WAF.Packages.Rules.Edit(ctx context.Context, packageID string, ruleID string, params firewall.WAFPackageRuleEditParams) (firewall.WAFPackageRuleEditResponse, error)
+- client.Firewall.WAF.Packages.Rules.Get(ctx context.Context, packageID string, ruleID string, query firewall.WAFPackageRuleGetParams) (firewall.WAFPackageRuleGetResponse, error)
# Healthchecks
Response Types:
-- cloudflare.HealthcheckNewResponse
-- cloudflare.HealthcheckUpdateResponse
-- cloudflare.HealthcheckListResponse
-- cloudflare.HealthcheckDeleteResponse
-- cloudflare.HealthcheckEditResponse
-- cloudflare.HealthcheckGetResponse
+- healthchecks.HealthchecksHealthchecks
+- healthchecks.HealthcheckDeleteResponse
Methods:
-- client.Healthchecks.New(ctx context.Context, zoneIdentifier string, body cloudflare.HealthcheckNewParams) (cloudflare.HealthcheckNewResponse, error)
-- client.Healthchecks.Update(ctx context.Context, zoneIdentifier string, identifier string, body cloudflare.HealthcheckUpdateParams) (cloudflare.HealthcheckUpdateResponse, error)
-- client.Healthchecks.List(ctx context.Context, zoneIdentifier string) ([]cloudflare.HealthcheckListResponse, error)
-- client.Healthchecks.Delete(ctx context.Context, zoneIdentifier string, identifier string) (cloudflare.HealthcheckDeleteResponse, error)
-- client.Healthchecks.Edit(ctx context.Context, zoneIdentifier string, identifier string, body cloudflare.HealthcheckEditParams) (cloudflare.HealthcheckEditResponse, error)
-- client.Healthchecks.Get(ctx context.Context, zoneIdentifier string, identifier string) (cloudflare.HealthcheckGetResponse, error)
+- client.Healthchecks.New(ctx context.Context, zoneIdentifier string, body healthchecks.HealthcheckNewParams) (healthchecks.HealthchecksHealthchecks, error)
+- client.Healthchecks.Update(ctx context.Context, zoneIdentifier string, identifier string, body healthchecks.HealthcheckUpdateParams) (healthchecks.HealthchecksHealthchecks, error)
+- client.Healthchecks.List(ctx context.Context, zoneIdentifier string) ([]healthchecks.HealthchecksHealthchecks, error)
+- client.Healthchecks.Delete(ctx context.Context, zoneIdentifier string, identifier string) (healthchecks.HealthcheckDeleteResponse, error)
+- client.Healthchecks.Edit(ctx context.Context, zoneIdentifier string, identifier string, body healthchecks.HealthcheckEditParams) (healthchecks.HealthchecksHealthchecks, error)
+- client.Healthchecks.Get(ctx context.Context, zoneIdentifier string, identifier string) (healthchecks.HealthchecksHealthchecks, error)
## Previews
Response Types:
-- cloudflare.HealthcheckPreviewNewResponse
-- cloudflare.HealthcheckPreviewDeleteResponse
-- cloudflare.HealthcheckPreviewGetResponse
+- healthchecks.PreviewDeleteResponse
Methods:
-- client.Healthchecks.Previews.New(ctx context.Context, zoneIdentifier string, body cloudflare.HealthcheckPreviewNewParams) (cloudflare.HealthcheckPreviewNewResponse, error)
-- client.Healthchecks.Previews.Delete(ctx context.Context, zoneIdentifier string, identifier string) (cloudflare.HealthcheckPreviewDeleteResponse, error)
-- client.Healthchecks.Previews.Get(ctx context.Context, zoneIdentifier string, identifier string) (cloudflare.HealthcheckPreviewGetResponse, error)
+- client.Healthchecks.Previews.New(ctx context.Context, zoneIdentifier string, body healthchecks.PreviewNewParams) (healthchecks.HealthchecksHealthchecks, error)
+- client.Healthchecks.Previews.Delete(ctx context.Context, zoneIdentifier string, identifier string) (healthchecks.PreviewDeleteResponse, error)
+- client.Healthchecks.Previews.Get(ctx context.Context, zoneIdentifier string, identifier string) (healthchecks.HealthchecksHealthchecks, error)
# KeylessCertificates
Response Types:
-- cloudflare.KeylessCertificateNewResponse
-- cloudflare.KeylessCertificateListResponse
-- cloudflare.KeylessCertificateDeleteResponse
-- cloudflare.KeylessCertificateEditResponse
-- cloudflare.KeylessCertificateGetResponse
+- keyless_certificates.TLSCertificatesAndHostnamesBase
+- keyless_certificates.KeylessCertificateDeleteResponse
Methods:
-- client.KeylessCertificates.New(ctx context.Context, params cloudflare.KeylessCertificateNewParams) (cloudflare.KeylessCertificateNewResponse, error)
-- client.KeylessCertificates.List(ctx context.Context, query cloudflare.KeylessCertificateListParams) ([]cloudflare.KeylessCertificateListResponse, error)
-- client.KeylessCertificates.Delete(ctx context.Context, keylessCertificateID string, body cloudflare.KeylessCertificateDeleteParams) (cloudflare.KeylessCertificateDeleteResponse, error)
-- client.KeylessCertificates.Edit(ctx context.Context, keylessCertificateID string, params cloudflare.KeylessCertificateEditParams) (cloudflare.KeylessCertificateEditResponse, error)
-- client.KeylessCertificates.Get(ctx context.Context, keylessCertificateID string, query cloudflare.KeylessCertificateGetParams) (cloudflare.KeylessCertificateGetResponse, error)
+- client.KeylessCertificates.New(ctx context.Context, params keyless_certificates.KeylessCertificateNewParams) (keyless_certificates.TLSCertificatesAndHostnamesBase, error)
+- client.KeylessCertificates.List(ctx context.Context, query keyless_certificates.KeylessCertificateListParams) ([]keyless_certificates.TLSCertificatesAndHostnamesBase, error)
+- client.KeylessCertificates.Delete(ctx context.Context, keylessCertificateID string, body keyless_certificates.KeylessCertificateDeleteParams) (keyless_certificates.KeylessCertificateDeleteResponse, error)
+- client.KeylessCertificates.Edit(ctx context.Context, keylessCertificateID string, params keyless_certificates.KeylessCertificateEditParams) (keyless_certificates.TLSCertificatesAndHostnamesBase, error)
+- client.KeylessCertificates.Get(ctx context.Context, keylessCertificateID string, query keyless_certificates.KeylessCertificateGetParams) (keyless_certificates.TLSCertificatesAndHostnamesBase, error)
# Logpush
@@ -1880,75 +1957,70 @@ Methods:
Response Types:
-- cloudflare.LogpushDatasetFieldGetResponse
+- logpush.DatasetFieldGetResponse
Methods:
-- client.Logpush.Datasets.Fields.Get(ctx context.Context, datasetID string, query cloudflare.LogpushDatasetFieldGetParams) (cloudflare.LogpushDatasetFieldGetResponse, error)
+- client.Logpush.Datasets.Fields.Get(ctx context.Context, datasetID string, query logpush.DatasetFieldGetParams) (logpush.DatasetFieldGetResponse, error)
### Jobs
Response Types:
-- cloudflare.LogpushDatasetJobGetResponse
+- logpush.LogpushLogpushJob
Methods:
-- client.Logpush.Datasets.Jobs.Get(ctx context.Context, datasetID string, query cloudflare.LogpushDatasetJobGetParams) ([]cloudflare.LogpushDatasetJobGetResponse, error)
+- client.Logpush.Datasets.Jobs.Get(ctx context.Context, datasetID string, query logpush.DatasetJobGetParams) ([]logpush.LogpushLogpushJob, error)
## Edge
Response Types:
-- cloudflare.LogpushEdgeNewResponse
-- cloudflare.LogpushEdgeGetResponse
+- logpush.LogpushInstantLogsJob
Methods:
-- client.Logpush.Edge.New(ctx context.Context, params cloudflare.LogpushEdgeNewParams) (cloudflare.LogpushEdgeNewResponse, error)
-- client.Logpush.Edge.Get(ctx context.Context, query cloudflare.LogpushEdgeGetParams) ([]cloudflare.LogpushEdgeGetResponse, error)
+- client.Logpush.Edge.New(ctx context.Context, params logpush.EdgeNewParams) (logpush.LogpushInstantLogsJob, error)
+- client.Logpush.Edge.Get(ctx context.Context, query logpush.EdgeGetParams) ([]logpush.LogpushInstantLogsJob, error)
## Jobs
Response Types:
-- cloudflare.LogpushJobNewResponse
-- cloudflare.LogpushJobUpdateResponse
-- cloudflare.LogpushJobListResponse
-- cloudflare.LogpushJobDeleteResponse
-- cloudflare.LogpushJobGetResponse
+- logpush.JobDeleteResponse
Methods:
-- client.Logpush.Jobs.New(ctx context.Context, params cloudflare.LogpushJobNewParams) (cloudflare.LogpushJobNewResponse, error)
-- client.Logpush.Jobs.Update(ctx context.Context, jobID int64, params cloudflare.LogpushJobUpdateParams) (cloudflare.LogpushJobUpdateResponse, error)
-- client.Logpush.Jobs.List(ctx context.Context, query cloudflare.LogpushJobListParams) ([]cloudflare.LogpushJobListResponse, error)
-- client.Logpush.Jobs.Delete(ctx context.Context, jobID int64, body cloudflare.LogpushJobDeleteParams) (cloudflare.LogpushJobDeleteResponse, error)
-- client.Logpush.Jobs.Get(ctx context.Context, jobID int64, query cloudflare.LogpushJobGetParams) (cloudflare.LogpushJobGetResponse, error)
+- client.Logpush.Jobs.New(ctx context.Context, params logpush.JobNewParams) (logpush.LogpushLogpushJob, error)
+- client.Logpush.Jobs.Update(ctx context.Context, jobID int64, params logpush.JobUpdateParams) (logpush.LogpushLogpushJob, error)
+- client.Logpush.Jobs.List(ctx context.Context, query logpush.JobListParams) ([]logpush.LogpushLogpushJob, error)
+- client.Logpush.Jobs.Delete(ctx context.Context, jobID int64, body logpush.JobDeleteParams) (logpush.JobDeleteResponse, error)
+- client.Logpush.Jobs.Get(ctx context.Context, jobID int64, query logpush.JobGetParams) (logpush.LogpushLogpushJob, error)
## Ownership
Response Types:
-- cloudflare.LogpushOwnershipNewResponse
-- cloudflare.LogpushOwnershipValidateResponse
+- logpush.OwnershipNewResponse
+- logpush.OwnershipValidateResponse
Methods:
-- client.Logpush.Ownership.New(ctx context.Context, params cloudflare.LogpushOwnershipNewParams) (cloudflare.LogpushOwnershipNewResponse, error)
-- client.Logpush.Ownership.Validate(ctx context.Context, params cloudflare.LogpushOwnershipValidateParams) (cloudflare.LogpushOwnershipValidateResponse, error)
+- client.Logpush.Ownership.New(ctx context.Context, params logpush.OwnershipNewParams) (logpush.OwnershipNewResponse, error)
+- client.Logpush.Ownership.Validate(ctx context.Context, params logpush.OwnershipValidateParams) (logpush.OwnershipValidateResponse, error)
## Validate
Response Types:
-- cloudflare.LogpushValidateDestinationResponse
-- cloudflare.LogpushValidateOriginResponse
+- logpush.ValidateDestinationResponse
+- logpush.ValidateOriginResponse
Methods:
-- client.Logpush.Validate.Destination(ctx context.Context, params cloudflare.LogpushValidateDestinationParams) (cloudflare.LogpushValidateDestinationResponse, error)
-- client.Logpush.Validate.Origin(ctx context.Context, params cloudflare.LogpushValidateOriginParams) (cloudflare.LogpushValidateOriginResponse, error)
+- client.Logpush.Validate.Destination(ctx context.Context, params logpush.ValidateDestinationParams) (logpush.ValidateDestinationResponse, error)
+- client.Logpush.Validate.Origin(ctx context.Context, params logpush.ValidateOriginParams) (logpush.ValidateOriginResponse, error)
# Logs
@@ -1960,13 +2032,13 @@ Methods:
Response Types:
-- cloudflare.LogControlRetentionFlagNewResponse
-- cloudflare.LogControlRetentionFlagGetResponse
+- logs.ControlRetentionFlagNewResponse
+- logs.ControlRetentionFlagGetResponse
Methods:
-- client.Logs.Control.Retention.Flag.New(ctx context.Context, zoneIdentifier string, body cloudflare.LogControlRetentionFlagNewParams) (cloudflare.LogControlRetentionFlagNewResponse, error)
-- client.Logs.Control.Retention.Flag.Get(ctx context.Context, zoneIdentifier string) (cloudflare.LogControlRetentionFlagGetResponse, error)
+- client.Logs.Control.Retention.Flag.New(ctx context.Context, zoneIdentifier string, body logs.ControlRetentionFlagNewParams) (logs.ControlRetentionFlagNewResponse, error)
+- client.Logs.Control.Retention.Flag.Get(ctx context.Context, zoneIdentifier string) (logs.ControlRetentionFlagGetResponse, error)
### Cmb
@@ -1974,346 +2046,328 @@ Methods:
Response Types:
-- cloudflare.LogControlCmbConfigNewResponse
-- cloudflare.LogControlCmbConfigDeleteResponse
-- cloudflare.LogControlCmbConfigGetResponse
+- logs.LogcontrolCmbConfig
+- logs.ControlCmbConfigDeleteResponse
Methods:
-- client.Logs.Control.Cmb.Config.New(ctx context.Context, params cloudflare.LogControlCmbConfigNewParams) (cloudflare.LogControlCmbConfigNewResponse, error)
-- client.Logs.Control.Cmb.Config.Delete(ctx context.Context, body cloudflare.LogControlCmbConfigDeleteParams) (cloudflare.LogControlCmbConfigDeleteResponse, error)
-- client.Logs.Control.Cmb.Config.Get(ctx context.Context, query cloudflare.LogControlCmbConfigGetParams) (cloudflare.LogControlCmbConfigGetResponse, error)
+- client.Logs.Control.Cmb.Config.New(ctx context.Context, params logs.ControlCmbConfigNewParams) (logs.LogcontrolCmbConfig, error)
+- client.Logs.Control.Cmb.Config.Delete(ctx context.Context, body logs.ControlCmbConfigDeleteParams) (logs.ControlCmbConfigDeleteResponse, error)
+- client.Logs.Control.Cmb.Config.Get(ctx context.Context, query logs.ControlCmbConfigGetParams) (logs.LogcontrolCmbConfig, error)
## Rayid
Response Types:
-- cloudflare.LogRayidGetResponse
+- logs.RayidGetResponse
Methods:
-- client.Logs.Rayid.Get(ctx context.Context, zoneIdentifier string, rayIdentifier string, query cloudflare.LogRayidGetParams) (cloudflare.LogRayidGetResponse, error)
+- client.Logs.Rayid.Get(ctx context.Context, zoneIdentifier string, rayIdentifier string, query logs.RayidGetParams) (logs.RayidGetResponse, error)
## Received
Response Types:
-- cloudflare.LogReceivedGetResponse
+- logs.ReceivedGetResponse
Methods:
-- client.Logs.Received.Get(ctx context.Context, zoneIdentifier string, query cloudflare.LogReceivedGetParams) (cloudflare.LogReceivedGetResponse, error)
+- client.Logs.Received.Get(ctx context.Context, zoneIdentifier string, query logs.ReceivedGetParams) (logs.ReceivedGetResponse, error)
### Fields
Response Types:
-- cloudflare.LogReceivedFieldGetResponse
+- logs.ReceivedFieldGetResponse
Methods:
-- client.Logs.Received.Fields.Get(ctx context.Context, zoneIdentifier string) (cloudflare.LogReceivedFieldGetResponse, error)
+- client.Logs.Received.Fields.Get(ctx context.Context, zoneIdentifier string) (logs.ReceivedFieldGetResponse, error)
# OriginTLSClientAuth
Response Types:
-- cloudflare.OriginTLSClientAuthNewResponse
-- cloudflare.OriginTLSClientAuthListResponse
-- cloudflare.OriginTLSClientAuthDeleteResponse
-- cloudflare.OriginTLSClientAuthGetResponse
+- origin_tls_client_auth.OriginTLSClientAuthNewResponse
+- origin_tls_client_auth.OriginTLSClientAuthListResponse
+- origin_tls_client_auth.OriginTLSClientAuthDeleteResponse
+- origin_tls_client_auth.OriginTLSClientAuthGetResponse
Methods:
-- client.OriginTLSClientAuth.New(ctx context.Context, params cloudflare.OriginTLSClientAuthNewParams) (cloudflare.OriginTLSClientAuthNewResponse, error)
-- client.OriginTLSClientAuth.List(ctx context.Context, query cloudflare.OriginTLSClientAuthListParams) ([]cloudflare.OriginTLSClientAuthListResponse, error)
-- client.OriginTLSClientAuth.Delete(ctx context.Context, certificateID string, body cloudflare.OriginTLSClientAuthDeleteParams) (cloudflare.OriginTLSClientAuthDeleteResponse, error)
-- client.OriginTLSClientAuth.Get(ctx context.Context, certificateID string, query cloudflare.OriginTLSClientAuthGetParams) (cloudflare.OriginTLSClientAuthGetResponse, error)
+- client.OriginTLSClientAuth.New(ctx context.Context, params origin_tls_client_auth.OriginTLSClientAuthNewParams) (origin_tls_client_auth.OriginTLSClientAuthNewResponse, error)
+- client.OriginTLSClientAuth.List(ctx context.Context, query origin_tls_client_auth.OriginTLSClientAuthListParams) ([]origin_tls_client_auth.OriginTLSClientAuthListResponse, error)
+- client.OriginTLSClientAuth.Delete(ctx context.Context, certificateID string, body origin_tls_client_auth.OriginTLSClientAuthDeleteParams) (origin_tls_client_auth.OriginTLSClientAuthDeleteResponse, error)
+- client.OriginTLSClientAuth.Get(ctx context.Context, certificateID string, query origin_tls_client_auth.OriginTLSClientAuthGetParams) (origin_tls_client_auth.OriginTLSClientAuthGetResponse, error)
## Hostnames
Response Types:
-- cloudflare.OriginTLSClientAuthHostnameUpdateResponse
-- cloudflare.OriginTLSClientAuthHostnameGetResponse
+- origin_tls_client_auth.TLSCertificatesAndHostnamesHostnameCertidObject
Methods:
-- client.OriginTLSClientAuth.Hostnames.Update(ctx context.Context, params cloudflare.OriginTLSClientAuthHostnameUpdateParams) ([]cloudflare.OriginTLSClientAuthHostnameUpdateResponse, error)
-- client.OriginTLSClientAuth.Hostnames.Get(ctx context.Context, hostname string, query cloudflare.OriginTLSClientAuthHostnameGetParams) (cloudflare.OriginTLSClientAuthHostnameGetResponse, error)
+- client.OriginTLSClientAuth.Hostnames.Update(ctx context.Context, params origin_tls_client_auth.HostnameUpdateParams) ([]origin_tls_client_auth.TLSCertificatesAndHostnamesHostnameCertidObject, error)
+- client.OriginTLSClientAuth.Hostnames.Get(ctx context.Context, hostname string, query origin_tls_client_auth.HostnameGetParams) (origin_tls_client_auth.TLSCertificatesAndHostnamesHostnameCertidObject, error)
### Certificates
Response Types:
-- cloudflare.OriginTLSClientAuthHostnameCertificateNewResponse
-- cloudflare.OriginTLSClientAuthHostnameCertificateListResponse
-- cloudflare.OriginTLSClientAuthHostnameCertificateDeleteResponse
-- cloudflare.OriginTLSClientAuthHostnameCertificateGetResponse
+- origin_tls_client_auth.TLSCertificatesAndHostnamesSchemasCertificateObject
Methods:
-- client.OriginTLSClientAuth.Hostnames.Certificates.New(ctx context.Context, params cloudflare.OriginTLSClientAuthHostnameCertificateNewParams) (cloudflare.OriginTLSClientAuthHostnameCertificateNewResponse, error)
-- client.OriginTLSClientAuth.Hostnames.Certificates.List(ctx context.Context, query cloudflare.OriginTLSClientAuthHostnameCertificateListParams) ([]cloudflare.OriginTLSClientAuthHostnameCertificateListResponse, error)
-- client.OriginTLSClientAuth.Hostnames.Certificates.Delete(ctx context.Context, certificateID string, body cloudflare.OriginTLSClientAuthHostnameCertificateDeleteParams) (cloudflare.OriginTLSClientAuthHostnameCertificateDeleteResponse, error)
-- client.OriginTLSClientAuth.Hostnames.Certificates.Get(ctx context.Context, certificateID string, query cloudflare.OriginTLSClientAuthHostnameCertificateGetParams) (cloudflare.OriginTLSClientAuthHostnameCertificateGetResponse, error)
+- client.OriginTLSClientAuth.Hostnames.Certificates.New(ctx context.Context, params origin_tls_client_auth.HostnameCertificateNewParams) (origin_tls_client_auth.TLSCertificatesAndHostnamesSchemasCertificateObject, error)
+- client.OriginTLSClientAuth.Hostnames.Certificates.List(ctx context.Context, query origin_tls_client_auth.HostnameCertificateListParams) ([]origin_tls_client_auth.TLSCertificatesAndHostnamesHostnameCertidObject, error)
+- client.OriginTLSClientAuth.Hostnames.Certificates.Delete(ctx context.Context, certificateID string, body origin_tls_client_auth.HostnameCertificateDeleteParams) (origin_tls_client_auth.TLSCertificatesAndHostnamesSchemasCertificateObject, error)
+- client.OriginTLSClientAuth.Hostnames.Certificates.Get(ctx context.Context, certificateID string, query origin_tls_client_auth.HostnameCertificateGetParams) (origin_tls_client_auth.TLSCertificatesAndHostnamesSchemasCertificateObject, error)
## Settings
Response Types:
-- cloudflare.OriginTLSClientAuthSettingUpdateResponse
-- cloudflare.OriginTLSClientAuthSettingGetResponse
+- origin_tls_client_auth.SettingUpdateResponse
+- origin_tls_client_auth.SettingGetResponse
Methods:
-- client.OriginTLSClientAuth.Settings.Update(ctx context.Context, params cloudflare.OriginTLSClientAuthSettingUpdateParams) (cloudflare.OriginTLSClientAuthSettingUpdateResponse, error)
-- client.OriginTLSClientAuth.Settings.Get(ctx context.Context, query cloudflare.OriginTLSClientAuthSettingGetParams) (cloudflare.OriginTLSClientAuthSettingGetResponse, error)
+- client.OriginTLSClientAuth.Settings.Update(ctx context.Context, params origin_tls_client_auth.SettingUpdateParams) (origin_tls_client_auth.SettingUpdateResponse, error)
+- client.OriginTLSClientAuth.Settings.Get(ctx context.Context, query origin_tls_client_auth.SettingGetParams) (origin_tls_client_auth.SettingGetResponse, error)
# Pagerules
Response Types:
-- cloudflare.PageruleNewResponse
-- cloudflare.PageruleUpdateResponse
-- cloudflare.PageruleListResponse
-- cloudflare.PageruleDeleteResponse
-- cloudflare.PageruleEditResponse
-- cloudflare.PageruleGetResponse
+- pagerules.ZonesPageRule
+- pagerules.PageruleNewResponse
+- pagerules.PageruleUpdateResponse
+- pagerules.PageruleDeleteResponse
+- pagerules.PageruleEditResponse
+- pagerules.PageruleGetResponse
Methods:
-- client.Pagerules.New(ctx context.Context, params cloudflare.PageruleNewParams) (cloudflare.PageruleNewResponse, error)
-- client.Pagerules.Update(ctx context.Context, pageruleID string, params cloudflare.PageruleUpdateParams) (cloudflare.PageruleUpdateResponse, error)
-- client.Pagerules.List(ctx context.Context, params cloudflare.PageruleListParams) ([]cloudflare.PageruleListResponse, error)
-- client.Pagerules.Delete(ctx context.Context, pageruleID string, body cloudflare.PageruleDeleteParams) (cloudflare.PageruleDeleteResponse, error)
-- client.Pagerules.Edit(ctx context.Context, pageruleID string, params cloudflare.PageruleEditParams) (cloudflare.PageruleEditResponse, error)
-- client.Pagerules.Get(ctx context.Context, pageruleID string, query cloudflare.PageruleGetParams) (cloudflare.PageruleGetResponse, error)
+- client.Pagerules.New(ctx context.Context, params pagerules.PageruleNewParams) (pagerules.PageruleNewResponse, error)
+- client.Pagerules.Update(ctx context.Context, pageruleID string, params pagerules.PageruleUpdateParams) (pagerules.PageruleUpdateResponse, error)
+- client.Pagerules.List(ctx context.Context, params pagerules.PageruleListParams) ([]pagerules.ZonesPageRule, error)
+- client.Pagerules.Delete(ctx context.Context, pageruleID string, body pagerules.PageruleDeleteParams) (pagerules.PageruleDeleteResponse, error)
+- client.Pagerules.Edit(ctx context.Context, pageruleID string, params pagerules.PageruleEditParams) (pagerules.PageruleEditResponse, error)
+- client.Pagerules.Get(ctx context.Context, pageruleID string, query pagerules.PageruleGetParams) (pagerules.PageruleGetResponse, error)
## Settings
Response Types:
-- cloudflare.PageruleSettingListResponse
+- pagerules.ZonesSettings
+- pagerules.SettingListResponse
Methods:
-- client.Pagerules.Settings.List(ctx context.Context, query cloudflare.PageruleSettingListParams) ([]cloudflare.PageruleSettingListResponse, error)
+- client.Pagerules.Settings.List(ctx context.Context, query pagerules.SettingListParams) (pagerules.ZonesSettings, error)
# RateLimits
Response Types:
-- cloudflare.RateLimitNewResponse
-- cloudflare.RateLimitListResponse
-- cloudflare.RateLimitDeleteResponse
-- cloudflare.RateLimitEditResponse
-- cloudflare.RateLimitGetResponse
+- rate_limits.RateLimitNewResponse
+- rate_limits.RateLimitListResponse
+- rate_limits.RateLimitDeleteResponse
+- rate_limits.RateLimitEditResponse
+- rate_limits.RateLimitGetResponse
Methods:
-- client.RateLimits.New(ctx context.Context, zoneIdentifier string, body cloudflare.RateLimitNewParams) (cloudflare.RateLimitNewResponse, error)
-- client.RateLimits.List(ctx context.Context, zoneIdentifier string, query cloudflare.RateLimitListParams) (shared.V4PagePaginationArray[cloudflare.RateLimitListResponse], error)
-- client.RateLimits.Delete(ctx context.Context, zoneIdentifier string, id string) (cloudflare.RateLimitDeleteResponse, error)
-- client.RateLimits.Edit(ctx context.Context, zoneIdentifier string, id string, body cloudflare.RateLimitEditParams) (cloudflare.RateLimitEditResponse, error)
-- client.RateLimits.Get(ctx context.Context, zoneIdentifier string, id string) (cloudflare.RateLimitGetResponse, error)
+- client.RateLimits.New(ctx context.Context, zoneIdentifier string, body rate_limits.RateLimitNewParams) (rate_limits.RateLimitNewResponse, error)
+- client.RateLimits.List(ctx context.Context, zoneIdentifier string, query rate_limits.RateLimitListParams) (shared.V4PagePaginationArray[rate_limits.RateLimitListResponse], error)
+- client.RateLimits.Delete(ctx context.Context, zoneIdentifier string, id string) (rate_limits.RateLimitDeleteResponse, error)
+- client.RateLimits.Edit(ctx context.Context, zoneIdentifier string, id string, body rate_limits.RateLimitEditParams) (rate_limits.RateLimitEditResponse, error)
+- client.RateLimits.Get(ctx context.Context, zoneIdentifier string, id string) (rate_limits.RateLimitGetResponse, error)
# SecondaryDNS
## ForceAxfrs
+Response Types:
+
+- secondary_dns.SecondaryDNSForceResult
+
Methods:
-- client.SecondaryDNS.ForceAxfrs.New(ctx context.Context, body cloudflare.SecondaryDNSForceAxfrNewParams) (string, error)
+- client.SecondaryDNS.ForceAxfrs.New(ctx context.Context, body secondary_dns.ForceAxfrNewParams) (secondary_dns.SecondaryDNSForceResult, error)
## Incoming
Response Types:
-- cloudflare.SecondaryDNSIncomingNewResponse
-- cloudflare.SecondaryDNSIncomingUpdateResponse
-- cloudflare.SecondaryDNSIncomingDeleteResponse
-- cloudflare.SecondaryDNSIncomingGetResponse
+- secondary_dns.IncomingNewResponse
+- secondary_dns.IncomingUpdateResponse
+- secondary_dns.IncomingDeleteResponse
+- secondary_dns.IncomingGetResponse
Methods:
-- client.SecondaryDNS.Incoming.New(ctx context.Context, params cloudflare.SecondaryDNSIncomingNewParams) (cloudflare.SecondaryDNSIncomingNewResponse, error)
-- client.SecondaryDNS.Incoming.Update(ctx context.Context, params cloudflare.SecondaryDNSIncomingUpdateParams) (cloudflare.SecondaryDNSIncomingUpdateResponse, error)
-- client.SecondaryDNS.Incoming.Delete(ctx context.Context, body cloudflare.SecondaryDNSIncomingDeleteParams) (cloudflare.SecondaryDNSIncomingDeleteResponse, error)
-- client.SecondaryDNS.Incoming.Get(ctx context.Context, query cloudflare.SecondaryDNSIncomingGetParams) (cloudflare.SecondaryDNSIncomingGetResponse, error)
+- client.SecondaryDNS.Incoming.New(ctx context.Context, params secondary_dns.IncomingNewParams) (secondary_dns.IncomingNewResponse, error)
+- client.SecondaryDNS.Incoming.Update(ctx context.Context, params secondary_dns.IncomingUpdateParams) (secondary_dns.IncomingUpdateResponse, error)
+- client.SecondaryDNS.Incoming.Delete(ctx context.Context, body secondary_dns.IncomingDeleteParams) (secondary_dns.IncomingDeleteResponse, error)
+- client.SecondaryDNS.Incoming.Get(ctx context.Context, query secondary_dns.IncomingGetParams) (secondary_dns.IncomingGetResponse, error)
## Outgoing
Response Types:
-- cloudflare.SecondaryDNSOutgoingNewResponse
-- cloudflare.SecondaryDNSOutgoingUpdateResponse
-- cloudflare.SecondaryDNSOutgoingDeleteResponse
-- cloudflare.SecondaryDNSOutgoingGetResponse
+- secondary_dns.SecondaryDNSDisableTransferResult
+- secondary_dns.SecondaryDNSEnableTransferResult
+- secondary_dns.SecondaryDNSSchemasForceResult
+- secondary_dns.OutgoingNewResponse
+- secondary_dns.OutgoingUpdateResponse
+- secondary_dns.OutgoingDeleteResponse
+- secondary_dns.OutgoingGetResponse
Methods:
-- client.SecondaryDNS.Outgoing.New(ctx context.Context, params cloudflare.SecondaryDNSOutgoingNewParams) (cloudflare.SecondaryDNSOutgoingNewResponse, error)
-- client.SecondaryDNS.Outgoing.Update(ctx context.Context, params cloudflare.SecondaryDNSOutgoingUpdateParams) (cloudflare.SecondaryDNSOutgoingUpdateResponse, error)
-- client.SecondaryDNS.Outgoing.Delete(ctx context.Context, body cloudflare.SecondaryDNSOutgoingDeleteParams) (cloudflare.SecondaryDNSOutgoingDeleteResponse, error)
-- client.SecondaryDNS.Outgoing.Disable(ctx context.Context, body cloudflare.SecondaryDNSOutgoingDisableParams) (string, error)
-- client.SecondaryDNS.Outgoing.Enable(ctx context.Context, body cloudflare.SecondaryDNSOutgoingEnableParams) (string, error)
-- client.SecondaryDNS.Outgoing.ForceNotify(ctx context.Context, body cloudflare.SecondaryDNSOutgoingForceNotifyParams) (string, error)
-- client.SecondaryDNS.Outgoing.Get(ctx context.Context, query cloudflare.SecondaryDNSOutgoingGetParams) (cloudflare.SecondaryDNSOutgoingGetResponse, error)
+- client.SecondaryDNS.Outgoing.New(ctx context.Context, params secondary_dns.OutgoingNewParams) (secondary_dns.OutgoingNewResponse, error)
+- client.SecondaryDNS.Outgoing.Update(ctx context.Context, params secondary_dns.OutgoingUpdateParams) (secondary_dns.OutgoingUpdateResponse, error)
+- client.SecondaryDNS.Outgoing.Delete(ctx context.Context, body secondary_dns.OutgoingDeleteParams) (secondary_dns.OutgoingDeleteResponse, error)
+- client.SecondaryDNS.Outgoing.Disable(ctx context.Context, body secondary_dns.OutgoingDisableParams) (secondary_dns.SecondaryDNSDisableTransferResult, error)
+- client.SecondaryDNS.Outgoing.Enable(ctx context.Context, body secondary_dns.OutgoingEnableParams) (secondary_dns.SecondaryDNSEnableTransferResult, error)
+- client.SecondaryDNS.Outgoing.ForceNotify(ctx context.Context, body secondary_dns.OutgoingForceNotifyParams) (secondary_dns.SecondaryDNSSchemasForceResult, error)
+- client.SecondaryDNS.Outgoing.Get(ctx context.Context, query secondary_dns.OutgoingGetParams) (secondary_dns.OutgoingGetResponse, error)
### Status
Methods:
-- client.SecondaryDNS.Outgoing.Status.Get(ctx context.Context, query cloudflare.SecondaryDNSOutgoingStatusGetParams) (string, error)
+- client.SecondaryDNS.Outgoing.Status.Get(ctx context.Context, query secondary_dns.OutgoingStatusGetParams) (secondary_dns.SecondaryDNSEnableTransferResult, error)
## ACLs
Response Types:
-- cloudflare.SecondaryDnsaclNewResponse
-- cloudflare.SecondaryDnsaclUpdateResponse
-- cloudflare.SecondaryDnsaclListResponse
-- cloudflare.SecondaryDnsaclDeleteResponse
-- cloudflare.SecondaryDnsaclGetResponse
+- secondary_dns.SecondaryDNSACL
+- secondary_dns.ACLDeleteResponse
Methods:
-- client.SecondaryDNS.ACLs.New(ctx context.Context, params cloudflare.SecondaryDNSACLNewParams) (cloudflare.SecondaryDnsaclNewResponse, error)
-- client.SecondaryDNS.ACLs.Update(ctx context.Context, aclID interface{}, params cloudflare.SecondaryDNSACLUpdateParams) (cloudflare.SecondaryDnsaclUpdateResponse, error)
-- client.SecondaryDNS.ACLs.List(ctx context.Context, query cloudflare.SecondaryDNSACLListParams) ([]cloudflare.SecondaryDnsaclListResponse, error)
-- client.SecondaryDNS.ACLs.Delete(ctx context.Context, aclID interface{}, body cloudflare.SecondaryDNSACLDeleteParams) (cloudflare.SecondaryDnsaclDeleteResponse, error)
-- client.SecondaryDNS.ACLs.Get(ctx context.Context, aclID interface{}, query cloudflare.SecondaryDNSACLGetParams) (cloudflare.SecondaryDnsaclGetResponse, error)
+- client.SecondaryDNS.ACLs.New(ctx context.Context, params secondary_dns.ACLNewParams) (secondary_dns.SecondaryDNSACL, error)
+- client.SecondaryDNS.ACLs.Update(ctx context.Context, aclID interface{}, params secondary_dns.ACLUpdateParams) (secondary_dns.SecondaryDNSACL, error)
+- client.SecondaryDNS.ACLs.List(ctx context.Context, query secondary_dns.ACLListParams) ([]secondary_dns.SecondaryDNSACL, error)
+- client.SecondaryDNS.ACLs.Delete(ctx context.Context, aclID interface{}, body secondary_dns.ACLDeleteParams) (secondary_dns.ACLDeleteResponse, error)
+- client.SecondaryDNS.ACLs.Get(ctx context.Context, aclID interface{}, query secondary_dns.ACLGetParams) (secondary_dns.SecondaryDNSACL, error)
## Peers
Response Types:
-- cloudflare.SecondaryDNSPeerNewResponse
-- cloudflare.SecondaryDNSPeerUpdateResponse
-- cloudflare.SecondaryDNSPeerListResponse
-- cloudflare.SecondaryDNSPeerDeleteResponse
-- cloudflare.SecondaryDNSPeerGetResponse
+- secondary_dns.SecondaryDNSPeer
+- secondary_dns.PeerDeleteResponse
Methods:
-- client.SecondaryDNS.Peers.New(ctx context.Context, params cloudflare.SecondaryDNSPeerNewParams) (cloudflare.SecondaryDNSPeerNewResponse, error)
-- client.SecondaryDNS.Peers.Update(ctx context.Context, peerID interface{}, params cloudflare.SecondaryDNSPeerUpdateParams) (cloudflare.SecondaryDNSPeerUpdateResponse, error)
-- client.SecondaryDNS.Peers.List(ctx context.Context, query cloudflare.SecondaryDNSPeerListParams) ([]cloudflare.SecondaryDNSPeerListResponse, error)
-- client.SecondaryDNS.Peers.Delete(ctx context.Context, peerID interface{}, body cloudflare.SecondaryDNSPeerDeleteParams) (cloudflare.SecondaryDNSPeerDeleteResponse, error)
-- client.SecondaryDNS.Peers.Get(ctx context.Context, peerID interface{}, query cloudflare.SecondaryDNSPeerGetParams) (cloudflare.SecondaryDNSPeerGetResponse, error)
+- client.SecondaryDNS.Peers.New(ctx context.Context, params secondary_dns.PeerNewParams) (secondary_dns.SecondaryDNSPeer, error)
+- client.SecondaryDNS.Peers.Update(ctx context.Context, peerID interface{}, params secondary_dns.PeerUpdateParams) (secondary_dns.SecondaryDNSPeer, error)
+- client.SecondaryDNS.Peers.List(ctx context.Context, query secondary_dns.PeerListParams) ([]secondary_dns.SecondaryDNSPeer, error)
+- client.SecondaryDNS.Peers.Delete(ctx context.Context, peerID interface{}, body secondary_dns.PeerDeleteParams) (secondary_dns.PeerDeleteResponse, error)
+- client.SecondaryDNS.Peers.Get(ctx context.Context, peerID interface{}, query secondary_dns.PeerGetParams) (secondary_dns.SecondaryDNSPeer, error)
## TSIGs
Response Types:
-- cloudflare.SecondaryDnstsigNewResponse
-- cloudflare.SecondaryDnstsigUpdateResponse
-- cloudflare.SecondaryDnstsigListResponse
-- cloudflare.SecondaryDnstsigDeleteResponse
-- cloudflare.SecondaryDnstsigGetResponse
+- secondary_dns.SecondaryDNSTSIG
+- secondary_dns.TSIGDeleteResponse
Methods:
-- client.SecondaryDNS.TSIGs.New(ctx context.Context, params cloudflare.SecondaryDNSTSIGNewParams) (cloudflare.SecondaryDnstsigNewResponse, error)
-- client.SecondaryDNS.TSIGs.Update(ctx context.Context, tsigID interface{}, params cloudflare.SecondaryDNSTSIGUpdateParams) (cloudflare.SecondaryDnstsigUpdateResponse, error)
-- client.SecondaryDNS.TSIGs.List(ctx context.Context, query cloudflare.SecondaryDNSTSIGListParams) ([]cloudflare.SecondaryDnstsigListResponse, error)
-- client.SecondaryDNS.TSIGs.Delete(ctx context.Context, tsigID interface{}, body cloudflare.SecondaryDNSTSIGDeleteParams) (cloudflare.SecondaryDnstsigDeleteResponse, error)
-- client.SecondaryDNS.TSIGs.Get(ctx context.Context, tsigID interface{}, query cloudflare.SecondaryDNSTSIGGetParams) (cloudflare.SecondaryDnstsigGetResponse, error)
+- client.SecondaryDNS.TSIGs.New(ctx context.Context, params secondary_dns.TSIGNewParams) (secondary_dns.SecondaryDNSTSIG, error)
+- client.SecondaryDNS.TSIGs.Update(ctx context.Context, tsigID interface{}, params secondary_dns.TSIGUpdateParams) (secondary_dns.SecondaryDNSTSIG, error)
+- client.SecondaryDNS.TSIGs.List(ctx context.Context, query secondary_dns.TSIGListParams) ([]secondary_dns.SecondaryDNSTSIG, error)
+- client.SecondaryDNS.TSIGs.Delete(ctx context.Context, tsigID interface{}, body secondary_dns.TSIGDeleteParams) (secondary_dns.TSIGDeleteResponse, error)
+- client.SecondaryDNS.TSIGs.Get(ctx context.Context, tsigID interface{}, query secondary_dns.TSIGGetParams) (secondary_dns.SecondaryDNSTSIG, error)
# WaitingRooms
Response Types:
-- cloudflare.WaitingRoomNewResponse
-- cloudflare.WaitingRoomUpdateResponse
-- cloudflare.WaitingRoomListResponse
-- cloudflare.WaitingRoomDeleteResponse
-- cloudflare.WaitingRoomEditResponse
-- cloudflare.WaitingRoomGetResponse
-- cloudflare.WaitingRoomPreviewResponse
+- waiting_rooms.WaitingroomWaitingroom
+- waiting_rooms.WaitingRoomDeleteResponse
+- waiting_rooms.WaitingRoomPreviewResponse
Methods:
-- client.WaitingRooms.New(ctx context.Context, zoneIdentifier string, body cloudflare.WaitingRoomNewParams) (cloudflare.WaitingRoomNewResponse, error)
-- client.WaitingRooms.Update(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, body cloudflare.WaitingRoomUpdateParams) (cloudflare.WaitingRoomUpdateResponse, error)
-- client.WaitingRooms.List(ctx context.Context, zoneIdentifier string) ([]cloudflare.WaitingRoomListResponse, error)
-- client.WaitingRooms.Delete(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}) (cloudflare.WaitingRoomDeleteResponse, error)
-- client.WaitingRooms.Edit(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, body cloudflare.WaitingRoomEditParams) (cloudflare.WaitingRoomEditResponse, error)
-- client.WaitingRooms.Get(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}) (cloudflare.WaitingRoomGetResponse, error)
-- client.WaitingRooms.Preview(ctx context.Context, zoneIdentifier string, body cloudflare.WaitingRoomPreviewParams) (cloudflare.WaitingRoomPreviewResponse, error)
+- client.WaitingRooms.New(ctx context.Context, zoneIdentifier string, body waiting_rooms.WaitingRoomNewParams) (waiting_rooms.WaitingroomWaitingroom, error)
+- client.WaitingRooms.Update(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, body waiting_rooms.WaitingRoomUpdateParams) (waiting_rooms.WaitingroomWaitingroom, error)
+- client.WaitingRooms.List(ctx context.Context, zoneIdentifier string) ([]waiting_rooms.WaitingroomWaitingroom, error)
+- client.WaitingRooms.Delete(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}) (waiting_rooms.WaitingRoomDeleteResponse, error)
+- client.WaitingRooms.Edit(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, body waiting_rooms.WaitingRoomEditParams) (waiting_rooms.WaitingroomWaitingroom, error)
+- client.WaitingRooms.Get(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}) (waiting_rooms.WaitingroomWaitingroom, error)
+- client.WaitingRooms.Preview(ctx context.Context, zoneIdentifier string, body waiting_rooms.WaitingRoomPreviewParams) (waiting_rooms.WaitingRoomPreviewResponse, error)
## Events
Response Types:
-- cloudflare.WaitingRoomEventNewResponse
-- cloudflare.WaitingRoomEventUpdateResponse
-- cloudflare.WaitingRoomEventListResponse
-- cloudflare.WaitingRoomEventDeleteResponse
-- cloudflare.WaitingRoomEventEditResponse
-- cloudflare.WaitingRoomEventGetResponse
+- waiting_rooms.WaitingroomEventResult
+- waiting_rooms.EventDeleteResponse
Methods:
-- client.WaitingRooms.Events.New(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, body cloudflare.WaitingRoomEventNewParams) (cloudflare.WaitingRoomEventNewResponse, error)
-- client.WaitingRooms.Events.Update(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, eventID interface{}, body cloudflare.WaitingRoomEventUpdateParams) (cloudflare.WaitingRoomEventUpdateResponse, error)
-- client.WaitingRooms.Events.List(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}) ([]cloudflare.WaitingRoomEventListResponse, error)
-- client.WaitingRooms.Events.Delete(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, eventID interface{}) (cloudflare.WaitingRoomEventDeleteResponse, error)
-- client.WaitingRooms.Events.Edit(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, eventID interface{}, body cloudflare.WaitingRoomEventEditParams) (cloudflare.WaitingRoomEventEditResponse, error)
-- client.WaitingRooms.Events.Get(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, eventID interface{}) (cloudflare.WaitingRoomEventGetResponse, error)
+- client.WaitingRooms.Events.New(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, body waiting_rooms.EventNewParams) (waiting_rooms.WaitingroomEventResult, error)
+- client.WaitingRooms.Events.Update(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, eventID interface{}, body waiting_rooms.EventUpdateParams) (waiting_rooms.WaitingroomEventResult, error)
+- client.WaitingRooms.Events.List(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}) ([]waiting_rooms.WaitingroomEventResult, error)
+- client.WaitingRooms.Events.Delete(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, eventID interface{}) (waiting_rooms.EventDeleteResponse, error)
+- client.WaitingRooms.Events.Edit(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, eventID interface{}, body waiting_rooms.EventEditParams) (waiting_rooms.WaitingroomEventResult, error)
+- client.WaitingRooms.Events.Get(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, eventID interface{}) (waiting_rooms.WaitingroomEventResult, error)
### Details
Response Types:
-- cloudflare.WaitingRoomEventDetailGetResponse
+- waiting_rooms.WaitingroomEventDetailsResult
Methods:
-- client.WaitingRooms.Events.Details.Get(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, eventID interface{}) (cloudflare.WaitingRoomEventDetailGetResponse, error)
+- client.WaitingRooms.Events.Details.Get(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, eventID interface{}) (waiting_rooms.WaitingroomEventDetailsResult, error)
## Rules
Response Types:
-- cloudflare.WaitingRoomRuleNewResponse
-- cloudflare.WaitingRoomRuleUpdateResponse
-- cloudflare.WaitingRoomRuleListResponse
-- cloudflare.WaitingRoomRuleDeleteResponse
-- cloudflare.WaitingRoomRuleEditResponse
+- waiting_rooms.WaitingroomRuleResult
Methods:
-- client.WaitingRooms.Rules.New(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, body cloudflare.WaitingRoomRuleNewParams) ([]cloudflare.WaitingRoomRuleNewResponse, error)
-- client.WaitingRooms.Rules.Update(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, body cloudflare.WaitingRoomRuleUpdateParams) ([]cloudflare.WaitingRoomRuleUpdateResponse, error)
-- client.WaitingRooms.Rules.List(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}) ([]cloudflare.WaitingRoomRuleListResponse, error)
-- client.WaitingRooms.Rules.Delete(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, ruleID string) ([]cloudflare.WaitingRoomRuleDeleteResponse, error)
-- client.WaitingRooms.Rules.Edit(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, ruleID string, body cloudflare.WaitingRoomRuleEditParams) ([]cloudflare.WaitingRoomRuleEditResponse, error)
+- client.WaitingRooms.Rules.New(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, body waiting_rooms.RuleNewParams) ([]waiting_rooms.WaitingroomRuleResult, error)
+- client.WaitingRooms.Rules.Update(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, body waiting_rooms.RuleUpdateParams) ([]waiting_rooms.WaitingroomRuleResult, error)
+- client.WaitingRooms.Rules.List(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}) ([]waiting_rooms.WaitingroomRuleResult, error)
+- client.WaitingRooms.Rules.Delete(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, ruleID string) ([]waiting_rooms.WaitingroomRuleResult, error)
+- client.WaitingRooms.Rules.Edit(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}, ruleID string, body waiting_rooms.RuleEditParams) ([]waiting_rooms.WaitingroomRuleResult, error)
## Statuses
Response Types:
-- cloudflare.WaitingRoomStatusGetResponse
+- waiting_rooms.StatusGetResponse
Methods:
-- client.WaitingRooms.Statuses.Get(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}) (cloudflare.WaitingRoomStatusGetResponse, error)
+- client.WaitingRooms.Statuses.Get(ctx context.Context, zoneIdentifier string, waitingRoomID interface{}) (waiting_rooms.StatusGetResponse, error)
## Settings
Response Types:
-- cloudflare.WaitingRoomSettingUpdateResponse
-- cloudflare.WaitingRoomSettingEditResponse
-- cloudflare.WaitingRoomSettingGetResponse
+- waiting_rooms.SettingUpdateResponse
+- waiting_rooms.SettingEditResponse
+- waiting_rooms.SettingGetResponse
Methods:
-- client.WaitingRooms.Settings.Update(ctx context.Context, zoneIdentifier string, body cloudflare.WaitingRoomSettingUpdateParams) (cloudflare.WaitingRoomSettingUpdateResponse, error)
-- client.WaitingRooms.Settings.Edit(ctx context.Context, zoneIdentifier string, body cloudflare.WaitingRoomSettingEditParams) (cloudflare.WaitingRoomSettingEditResponse, error)
-- client.WaitingRooms.Settings.Get(ctx context.Context, zoneIdentifier string) (cloudflare.WaitingRoomSettingGetResponse, error)
+- client.WaitingRooms.Settings.Update(ctx context.Context, zoneIdentifier string, body waiting_rooms.SettingUpdateParams) (waiting_rooms.SettingUpdateResponse, error)
+- client.WaitingRooms.Settings.Edit(ctx context.Context, zoneIdentifier string, body waiting_rooms.SettingEditParams) (waiting_rooms.SettingEditResponse, error)
+- client.WaitingRooms.Settings.Get(ctx context.Context, zoneIdentifier string) (waiting_rooms.SettingGetResponse, error)
# Web3
@@ -2321,19 +2375,16 @@ Methods:
Response Types:
-- cloudflare.Web3HostnameNewResponse
-- cloudflare.Web3HostnameListResponse
-- cloudflare.Web3HostnameDeleteResponse
-- cloudflare.Web3HostnameEditResponse
-- cloudflare.Web3HostnameGetResponse
+- web3.DwebConfigWeb3Hostname
+- web3.HostnameDeleteResponse
Methods:
-- client.Web3.Hostnames.New(ctx context.Context, zoneIdentifier string, body cloudflare.Web3HostnameNewParams) (cloudflare.Web3HostnameNewResponse, error)
-- client.Web3.Hostnames.List(ctx context.Context, zoneIdentifier string) ([]cloudflare.Web3HostnameListResponse, error)
-- client.Web3.Hostnames.Delete(ctx context.Context, zoneIdentifier string, identifier string) (cloudflare.Web3HostnameDeleteResponse, error)
-- client.Web3.Hostnames.Edit(ctx context.Context, zoneIdentifier string, identifier string, body cloudflare.Web3HostnameEditParams) (cloudflare.Web3HostnameEditResponse, error)
-- client.Web3.Hostnames.Get(ctx context.Context, zoneIdentifier string, identifier string) (cloudflare.Web3HostnameGetResponse, error)
+- client.Web3.Hostnames.New(ctx context.Context, zoneIdentifier string, body web3.HostnameNewParams) (web3.DwebConfigWeb3Hostname, error)
+- client.Web3.Hostnames.List(ctx context.Context, zoneIdentifier string) ([]web3.DwebConfigWeb3Hostname, error)
+- client.Web3.Hostnames.Delete(ctx context.Context, zoneIdentifier string, identifier string) (web3.HostnameDeleteResponse, error)
+- client.Web3.Hostnames.Edit(ctx context.Context, zoneIdentifier string, identifier string, body web3.HostnameEditParams) (web3.DwebConfigWeb3Hostname, error)
+- client.Web3.Hostnames.Get(ctx context.Context, zoneIdentifier string, identifier string) (web3.DwebConfigWeb3Hostname, error)
### IPFSUniversalPaths
@@ -2341,31 +2392,32 @@ Methods:
Response Types:
-- cloudflare.Web3HostnameIPFSUniversalPathContentListUpdateResponse
-- cloudflare.Web3HostnameIPFSUniversalPathContentListGetResponse
+- web3.DwebConfigContentListDetails
Methods:
-- client.Web3.Hostnames.IPFSUniversalPaths.ContentLists.Update(ctx context.Context, zoneIdentifier string, identifier string, body cloudflare.Web3HostnameIPFSUniversalPathContentListUpdateParams) (cloudflare.Web3HostnameIPFSUniversalPathContentListUpdateResponse, error)
-- client.Web3.Hostnames.IPFSUniversalPaths.ContentLists.Get(ctx context.Context, zoneIdentifier string, identifier string) (cloudflare.Web3HostnameIPFSUniversalPathContentListGetResponse, error)
+- client.Web3.Hostnames.IPFSUniversalPaths.ContentLists.Update(ctx context.Context, zoneIdentifier string, identifier string, body web3.HostnameIPFSUniversalPathContentListUpdateParams) (web3.DwebConfigContentListDetails, error)
+- client.Web3.Hostnames.IPFSUniversalPaths.ContentLists.Get(ctx context.Context, zoneIdentifier string, identifier string) (web3.DwebConfigContentListDetails, error)
##### Entries
+Params Types:
+
+- web3.DwebConfigContentListEntryParam
+
Response Types:
-- cloudflare.Web3HostnameIPFSUniversalPathContentListEntryNewResponse
-- cloudflare.Web3HostnameIPFSUniversalPathContentListEntryUpdateResponse
-- cloudflare.Web3HostnameIPFSUniversalPathContentListEntryListResponse
-- cloudflare.Web3HostnameIPFSUniversalPathContentListEntryDeleteResponse
-- cloudflare.Web3HostnameIPFSUniversalPathContentListEntryGetResponse
+- web3.DwebConfigContentListEntry
+- web3.HostnameIPFSUniversalPathContentListEntryListResponse
+- web3.HostnameIPFSUniversalPathContentListEntryDeleteResponse
Methods:
-- client.Web3.Hostnames.IPFSUniversalPaths.ContentLists.Entries.New(ctx context.Context, zoneIdentifier string, identifier string, body cloudflare.Web3HostnameIPFSUniversalPathContentListEntryNewParams) (cloudflare.Web3HostnameIPFSUniversalPathContentListEntryNewResponse, error)
-- client.Web3.Hostnames.IPFSUniversalPaths.ContentLists.Entries.Update(ctx context.Context, zoneIdentifier string, identifier string, contentListEntryIdentifier string, body cloudflare.Web3HostnameIPFSUniversalPathContentListEntryUpdateParams) (cloudflare.Web3HostnameIPFSUniversalPathContentListEntryUpdateResponse, error)
-- client.Web3.Hostnames.IPFSUniversalPaths.ContentLists.Entries.List(ctx context.Context, zoneIdentifier string, identifier string) (cloudflare.Web3HostnameIPFSUniversalPathContentListEntryListResponse, error)
-- client.Web3.Hostnames.IPFSUniversalPaths.ContentLists.Entries.Delete(ctx context.Context, zoneIdentifier string, identifier string, contentListEntryIdentifier string) (cloudflare.Web3HostnameIPFSUniversalPathContentListEntryDeleteResponse, error)
-- client.Web3.Hostnames.IPFSUniversalPaths.ContentLists.Entries.Get(ctx context.Context, zoneIdentifier string, identifier string, contentListEntryIdentifier string) (cloudflare.Web3HostnameIPFSUniversalPathContentListEntryGetResponse, error)
+- client.Web3.Hostnames.IPFSUniversalPaths.ContentLists.Entries.New(ctx context.Context, zoneIdentifier string, identifier string, body web3.HostnameIPFSUniversalPathContentListEntryNewParams) (web3.DwebConfigContentListEntry, error)
+- client.Web3.Hostnames.IPFSUniversalPaths.ContentLists.Entries.Update(ctx context.Context, zoneIdentifier string, identifier string, contentListEntryIdentifier string, body web3.HostnameIPFSUniversalPathContentListEntryUpdateParams) (web3.DwebConfigContentListEntry, error)
+- client.Web3.Hostnames.IPFSUniversalPaths.ContentLists.Entries.List(ctx context.Context, zoneIdentifier string, identifier string) (web3.HostnameIPFSUniversalPathContentListEntryListResponse, error)
+- client.Web3.Hostnames.IPFSUniversalPaths.ContentLists.Entries.Delete(ctx context.Context, zoneIdentifier string, identifier string, contentListEntryIdentifier string) (web3.HostnameIPFSUniversalPathContentListEntryDeleteResponse, error)
+- client.Web3.Hostnames.IPFSUniversalPaths.ContentLists.Entries.Get(ctx context.Context, zoneIdentifier string, identifier string, contentListEntryIdentifier string) (web3.DwebConfigContentListEntry, error)
# Workers
@@ -2373,147 +2425,139 @@ Methods:
Response Types:
-- cloudflare.WorkerAIRunResponse
+- workers.AIRunResponse
Methods:
-- client.Workers.AI.Run(ctx context.Context, modelName string, params cloudflare.WorkerAIRunParams) (cloudflare.WorkerAIRunResponse, error)
+- client.Workers.AI.Run(ctx context.Context, modelName string, params workers.AIRunParams) (workers.AIRunResponse, error)
## Scripts
Response Types:
-- cloudflare.WorkerScriptUpdateResponse
-- cloudflare.WorkerScriptListResponse
+- workers.WorkersScript
Methods:
-- client.Workers.Scripts.Update(ctx context.Context, scriptName string, params cloudflare.WorkerScriptUpdateParams) (cloudflare.WorkerScriptUpdateResponse, error)
-- client.Workers.Scripts.List(ctx context.Context, query cloudflare.WorkerScriptListParams) ([]cloudflare.WorkerScriptListResponse, error)
-- client.Workers.Scripts.Delete(ctx context.Context, scriptName string, params cloudflare.WorkerScriptDeleteParams) error
-- client.Workers.Scripts.Get(ctx context.Context, scriptName string, query cloudflare.WorkerScriptGetParams) (http.Response, error)
+- client.Workers.Scripts.Update(ctx context.Context, scriptName string, params workers.ScriptUpdateParams) (workers.WorkersScript, error)
+- client.Workers.Scripts.List(ctx context.Context, query workers.ScriptListParams) ([]workers.WorkersScript, error)
+- client.Workers.Scripts.Delete(ctx context.Context, scriptName string, params workers.ScriptDeleteParams) error
+- client.Workers.Scripts.Get(ctx context.Context, scriptName string, query workers.ScriptGetParams) (http.Response, error)
### Bindings
Response Types:
-- cloudflare.WorkerScriptBindingGetResponse
+- workers.WorkersSchemasBinding
Methods:
-- client.Workers.Scripts.Bindings.Get(ctx context.Context, query cloudflare.WorkerScriptBindingGetParams) ([]cloudflare.WorkerScriptBindingGetResponse, error)
+- client.Workers.Scripts.Bindings.Get(ctx context.Context, query workers.ScriptBindingGetParams) ([]workers.WorkersSchemasBinding, error)
### Schedules
Response Types:
-- cloudflare.WorkerScriptScheduleUpdateResponse
-- cloudflare.WorkerScriptScheduleGetResponse
+- workers.ScriptScheduleUpdateResponse
+- workers.ScriptScheduleGetResponse
Methods:
-- client.Workers.Scripts.Schedules.Update(ctx context.Context, scriptName string, params cloudflare.WorkerScriptScheduleUpdateParams) (cloudflare.WorkerScriptScheduleUpdateResponse, error)
-- client.Workers.Scripts.Schedules.Get(ctx context.Context, scriptName string, query cloudflare.WorkerScriptScheduleGetParams) (cloudflare.WorkerScriptScheduleGetResponse, error)
+- client.Workers.Scripts.Schedules.Update(ctx context.Context, scriptName string, params workers.ScriptScheduleUpdateParams) (workers.ScriptScheduleUpdateResponse, error)
+- client.Workers.Scripts.Schedules.Get(ctx context.Context, scriptName string, query workers.ScriptScheduleGetParams) (workers.ScriptScheduleGetResponse, error)
### Tail
Response Types:
-- cloudflare.WorkerScriptTailNewResponse
-- cloudflare.WorkerScriptTailDeleteResponse
-- cloudflare.WorkerScriptTailGetResponse
+- workers.ScriptTailNewResponse
+- workers.ScriptTailDeleteResponse
+- workers.ScriptTailGetResponse
Methods:
-- client.Workers.Scripts.Tail.New(ctx context.Context, scriptName string, body cloudflare.WorkerScriptTailNewParams) (cloudflare.WorkerScriptTailNewResponse, error)
-- client.Workers.Scripts.Tail.Delete(ctx context.Context, scriptName string, id string, body cloudflare.WorkerScriptTailDeleteParams) (cloudflare.WorkerScriptTailDeleteResponse, error)
-- client.Workers.Scripts.Tail.Get(ctx context.Context, scriptName string, query cloudflare.WorkerScriptTailGetParams) (cloudflare.WorkerScriptTailGetResponse, error)
+- client.Workers.Scripts.Tail.New(ctx context.Context, scriptName string, body workers.ScriptTailNewParams) (workers.ScriptTailNewResponse, error)
+- client.Workers.Scripts.Tail.Delete(ctx context.Context, scriptName string, id string, body workers.ScriptTailDeleteParams) (workers.ScriptTailDeleteResponse, error)
+- client.Workers.Scripts.Tail.Get(ctx context.Context, scriptName string, query workers.ScriptTailGetParams) (workers.ScriptTailGetResponse, error)
### UsageModel
Response Types:
-- cloudflare.WorkerScriptUsageModelUpdateResponse
-- cloudflare.WorkerScriptUsageModelGetResponse
+- workers.ScriptUsageModelUpdateResponse
+- workers.ScriptUsageModelGetResponse
Methods:
-- client.Workers.Scripts.UsageModel.Update(ctx context.Context, scriptName string, params cloudflare.WorkerScriptUsageModelUpdateParams) (cloudflare.WorkerScriptUsageModelUpdateResponse, error)
-- client.Workers.Scripts.UsageModel.Get(ctx context.Context, scriptName string, query cloudflare.WorkerScriptUsageModelGetParams) (cloudflare.WorkerScriptUsageModelGetResponse, error)
+- client.Workers.Scripts.UsageModel.Update(ctx context.Context, scriptName string, params workers.ScriptUsageModelUpdateParams) (workers.ScriptUsageModelUpdateResponse, error)
+- client.Workers.Scripts.UsageModel.Get(ctx context.Context, scriptName string, query workers.ScriptUsageModelGetParams) (workers.ScriptUsageModelGetResponse, error)
### Content
-Response Types:
-
-- cloudflare.WorkerScriptContentUpdateResponse
-
Methods:
-- client.Workers.Scripts.Content.Update(ctx context.Context, scriptName string, params cloudflare.WorkerScriptContentUpdateParams) (cloudflare.WorkerScriptContentUpdateResponse, error)
+- client.Workers.Scripts.Content.Update(ctx context.Context, scriptName string, params workers.ScriptContentUpdateParams) (workers.WorkersScript, error)
### ContentV2
Methods:
-- client.Workers.Scripts.ContentV2.Get(ctx context.Context, scriptName string, query cloudflare.WorkerScriptContentV2GetParams) (http.Response, error)
+- client.Workers.Scripts.ContentV2.Get(ctx context.Context, scriptName string, query workers.ScriptContentV2GetParams) (http.Response, error)
### Settings
Response Types:
-- cloudflare.WorkerScriptSettingEditResponse
-- cloudflare.WorkerScriptSettingGetResponse
+- workers.ScriptSettingEditResponse
+- workers.ScriptSettingGetResponse
Methods:
-- client.Workers.Scripts.Settings.Edit(ctx context.Context, scriptName string, params cloudflare.WorkerScriptSettingEditParams) (cloudflare.WorkerScriptSettingEditResponse, error)
-- client.Workers.Scripts.Settings.Get(ctx context.Context, scriptName string, query cloudflare.WorkerScriptSettingGetParams) (cloudflare.WorkerScriptSettingGetResponse, error)
+- client.Workers.Scripts.Settings.Edit(ctx context.Context, scriptName string, params workers.ScriptSettingEditParams) (workers.ScriptSettingEditResponse, error)
+- client.Workers.Scripts.Settings.Get(ctx context.Context, scriptName string, query workers.ScriptSettingGetParams) (workers.ScriptSettingGetResponse, error)
## Filters
Response Types:
-- cloudflare.WorkerFilterNewResponse
-- cloudflare.WorkerFilterUpdateResponse
-- cloudflare.WorkerFilterListResponse
-- cloudflare.WorkerFilterDeleteResponse
+- workers.WorkersFilters
+- workers.FilterNewResponse
+- workers.FilterDeleteResponse
Methods:
-- client.Workers.Filters.New(ctx context.Context, params cloudflare.WorkerFilterNewParams) (cloudflare.WorkerFilterNewResponse, error)
-- client.Workers.Filters.Update(ctx context.Context, filterID string, params cloudflare.WorkerFilterUpdateParams) (cloudflare.WorkerFilterUpdateResponse, error)
-- client.Workers.Filters.List(ctx context.Context, query cloudflare.WorkerFilterListParams) ([]cloudflare.WorkerFilterListResponse, error)
-- client.Workers.Filters.Delete(ctx context.Context, filterID string, body cloudflare.WorkerFilterDeleteParams) (cloudflare.WorkerFilterDeleteResponse, error)
+- client.Workers.Filters.New(ctx context.Context, params workers.FilterNewParams) (workers.FilterNewResponse, error)
+- client.Workers.Filters.Update(ctx context.Context, filterID string, params workers.FilterUpdateParams) (workers.WorkersFilters, error)
+- client.Workers.Filters.List(ctx context.Context, query workers.FilterListParams) ([]workers.WorkersFilters, error)
+- client.Workers.Filters.Delete(ctx context.Context, filterID string, body workers.FilterDeleteParams) (workers.FilterDeleteResponse, error)
## Routes
Response Types:
-- cloudflare.WorkerRouteNewResponse
-- cloudflare.WorkerRouteUpdateResponse
-- cloudflare.WorkerRouteListResponse
-- cloudflare.WorkerRouteDeleteResponse
-- cloudflare.WorkerRouteGetResponse
+- workers.WorkersRoutes
+- workers.RouteNewResponse
+- workers.RouteDeleteResponse
Methods:
-- client.Workers.Routes.New(ctx context.Context, params cloudflare.WorkerRouteNewParams) (cloudflare.WorkerRouteNewResponse, error)
-- client.Workers.Routes.Update(ctx context.Context, routeID string, params cloudflare.WorkerRouteUpdateParams) (cloudflare.WorkerRouteUpdateResponse, error)
-- client.Workers.Routes.List(ctx context.Context, query cloudflare.WorkerRouteListParams) ([]cloudflare.WorkerRouteListResponse, error)
-- client.Workers.Routes.Delete(ctx context.Context, routeID string, body cloudflare.WorkerRouteDeleteParams) (cloudflare.WorkerRouteDeleteResponse, error)
-- client.Workers.Routes.Get(ctx context.Context, routeID string, query cloudflare.WorkerRouteGetParams) (cloudflare.WorkerRouteGetResponse, error)
+- client.Workers.Routes.New(ctx context.Context, params workers.RouteNewParams) (workers.RouteNewResponse, error)
+- client.Workers.Routes.Update(ctx context.Context, routeID string, params workers.RouteUpdateParams) (workers.WorkersRoutes, error)
+- client.Workers.Routes.List(ctx context.Context, query workers.RouteListParams) ([]workers.WorkersRoutes, error)
+- client.Workers.Routes.Delete(ctx context.Context, routeID string, body workers.RouteDeleteParams) (workers.RouteDeleteResponse, error)
+- client.Workers.Routes.Get(ctx context.Context, routeID string, query workers.RouteGetParams) (workers.WorkersRoutes, error)
## AccountSettings
Response Types:
-- cloudflare.WorkerAccountSettingUpdateResponse
-- cloudflare.WorkerAccountSettingGetResponse
+- workers.AccountSettingUpdateResponse
+- workers.AccountSettingGetResponse
Methods:
-- client.Workers.AccountSettings.Update(ctx context.Context, params cloudflare.WorkerAccountSettingUpdateParams) (cloudflare.WorkerAccountSettingUpdateResponse, error)
-- client.Workers.AccountSettings.Get(ctx context.Context, query cloudflare.WorkerAccountSettingGetParams) (cloudflare.WorkerAccountSettingGetResponse, error)
+- client.Workers.AccountSettings.Update(ctx context.Context, params workers.AccountSettingUpdateParams) (workers.AccountSettingUpdateResponse, error)
+- client.Workers.AccountSettings.Get(ctx context.Context, query workers.AccountSettingGetParams) (workers.AccountSettingGetResponse, error)
## Deployments
@@ -2521,48 +2565,46 @@ Methods:
Response Types:
-- cloudflare.WorkerDeploymentByScriptGetResponse
+- workers.DeploymentByScriptGetResponse
Methods:
-- client.Workers.Deployments.ByScripts.Get(ctx context.Context, scriptID string, query cloudflare.WorkerDeploymentByScriptGetParams) (cloudflare.WorkerDeploymentByScriptGetResponse, error)
+- client.Workers.Deployments.ByScripts.Get(ctx context.Context, scriptID string, query workers.DeploymentByScriptGetParams) (workers.DeploymentByScriptGetResponse, error)
#### Details
Response Types:
-- cloudflare.WorkerDeploymentByScriptDetailGetResponse
+- workers.DeploymentByScriptDetailGetResponse
Methods:
-- client.Workers.Deployments.ByScripts.Details.Get(ctx context.Context, scriptID string, deploymentID string, query cloudflare.WorkerDeploymentByScriptDetailGetParams) (cloudflare.WorkerDeploymentByScriptDetailGetResponse, error)
+- client.Workers.Deployments.ByScripts.Details.Get(ctx context.Context, scriptID string, deploymentID string, query workers.DeploymentByScriptDetailGetParams) (workers.DeploymentByScriptDetailGetResponse, error)
## Domains
Response Types:
-- cloudflare.WorkerDomainUpdateResponse
-- cloudflare.WorkerDomainListResponse
-- cloudflare.WorkerDomainGetResponse
+- workers.WorkersDomain
Methods:
-- client.Workers.Domains.Update(ctx context.Context, params cloudflare.WorkerDomainUpdateParams) (cloudflare.WorkerDomainUpdateResponse, error)
-- client.Workers.Domains.List(ctx context.Context, params cloudflare.WorkerDomainListParams) ([]cloudflare.WorkerDomainListResponse, error)
-- client.Workers.Domains.Delete(ctx context.Context, domainID interface{}, body cloudflare.WorkerDomainDeleteParams) error
-- client.Workers.Domains.Get(ctx context.Context, domainID interface{}, query cloudflare.WorkerDomainGetParams) (cloudflare.WorkerDomainGetResponse, error)
+- client.Workers.Domains.Update(ctx context.Context, params workers.DomainUpdateParams) (workers.WorkersDomain, error)
+- client.Workers.Domains.List(ctx context.Context, params workers.DomainListParams) ([]workers.WorkersDomain, error)
+- client.Workers.Domains.Delete(ctx context.Context, domainID interface{}, body workers.DomainDeleteParams) error
+- client.Workers.Domains.Get(ctx context.Context, domainID interface{}, query workers.DomainGetParams) (workers.WorkersDomain, error)
## Subdomains
Response Types:
-- cloudflare.WorkerSubdomainUpdateResponse
-- cloudflare.WorkerSubdomainGetResponse
+- workers.SubdomainUpdateResponse
+- workers.SubdomainGetResponse
Methods:
-- client.Workers.Subdomains.Update(ctx context.Context, params cloudflare.WorkerSubdomainUpdateParams) (cloudflare.WorkerSubdomainUpdateResponse, error)
-- client.Workers.Subdomains.Get(ctx context.Context, query cloudflare.WorkerSubdomainGetParams) (cloudflare.WorkerSubdomainGetResponse, error)
+- client.Workers.Subdomains.Update(ctx context.Context, params workers.SubdomainUpdateParams) (workers.SubdomainUpdateResponse, error)
+- client.Workers.Subdomains.Get(ctx context.Context, query workers.SubdomainGetParams) (workers.SubdomainGetResponse, error)
## Services
@@ -2570,26 +2612,22 @@ Methods:
#### Content
-Response Types:
-
-- cloudflare.WorkerServiceEnvironmentContentUpdateResponse
-
Methods:
-- client.Workers.Services.Environments.Content.Update(ctx context.Context, serviceName string, environmentName string, params cloudflare.WorkerServiceEnvironmentContentUpdateParams) (cloudflare.WorkerServiceEnvironmentContentUpdateResponse, error)
-- client.Workers.Services.Environments.Content.Get(ctx context.Context, serviceName string, environmentName string, query cloudflare.WorkerServiceEnvironmentContentGetParams) (http.Response, error)
+- client.Workers.Services.Environments.Content.Update(ctx context.Context, serviceName string, environmentName string, params workers.ServiceEnvironmentContentUpdateParams) (workers.WorkersScript, error)
+- client.Workers.Services.Environments.Content.Get(ctx context.Context, serviceName string, environmentName string, query workers.ServiceEnvironmentContentGetParams) (http.Response, error)
#### Settings
Response Types:
-- cloudflare.WorkerServiceEnvironmentSettingEditResponse
-- cloudflare.WorkerServiceEnvironmentSettingGetResponse
+- workers.ServiceEnvironmentSettingEditResponse
+- workers.ServiceEnvironmentSettingGetResponse
Methods:
-- client.Workers.Services.Environments.Settings.Edit(ctx context.Context, serviceName string, environmentName string, params cloudflare.WorkerServiceEnvironmentSettingEditParams) (cloudflare.WorkerServiceEnvironmentSettingEditResponse, error)
-- client.Workers.Services.Environments.Settings.Get(ctx context.Context, serviceName string, environmentName string, query cloudflare.WorkerServiceEnvironmentSettingGetParams) (cloudflare.WorkerServiceEnvironmentSettingGetResponse, error)
+- client.Workers.Services.Environments.Settings.Edit(ctx context.Context, serviceName string, environmentName string, params workers.ServiceEnvironmentSettingEditParams) (workers.ServiceEnvironmentSettingEditResponse, error)
+- client.Workers.Services.Environments.Settings.Get(ctx context.Context, serviceName string, environmentName string, query workers.ServiceEnvironmentSettingGetParams) (workers.ServiceEnvironmentSettingGetResponse, error)
# KV
@@ -2597,62 +2635,61 @@ Methods:
Response Types:
-- cloudflare.KVNamespaceNewResponse
-- cloudflare.KVNamespaceUpdateResponse
-- cloudflare.KVNamespaceListResponse
-- cloudflare.KVNamespaceDeleteResponse
+- kv.WorkersKVNamespace
+- kv.NamespaceUpdateResponse
+- kv.NamespaceDeleteResponse
Methods:
-- client.KV.Namespaces.New(ctx context.Context, params cloudflare.KVNamespaceNewParams) (cloudflare.KVNamespaceNewResponse, error)
-- client.KV.Namespaces.Update(ctx context.Context, namespaceID string, params cloudflare.KVNamespaceUpdateParams) (cloudflare.KVNamespaceUpdateResponse, error)
-- client.KV.Namespaces.List(ctx context.Context, params cloudflare.KVNamespaceListParams) (shared.V4PagePaginationArray[cloudflare.KVNamespaceListResponse], error)
-- client.KV.Namespaces.Delete(ctx context.Context, namespaceID string, body cloudflare.KVNamespaceDeleteParams) (cloudflare.KVNamespaceDeleteResponse, error)
+- client.KV.Namespaces.New(ctx context.Context, params kv.NamespaceNewParams) (kv.WorkersKVNamespace, error)
+- client.KV.Namespaces.Update(ctx context.Context, namespaceID string, params kv.NamespaceUpdateParams) (kv.NamespaceUpdateResponse, error)
+- client.KV.Namespaces.List(ctx context.Context, params kv.NamespaceListParams) (shared.V4PagePaginationArray[kv.WorkersKVNamespace], error)
+- client.KV.Namespaces.Delete(ctx context.Context, namespaceID string, body kv.NamespaceDeleteParams) (kv.NamespaceDeleteResponse, error)
### Bulk
Response Types:
-- cloudflare.KVNamespaceBulkUpdateResponse
-- cloudflare.KVNamespaceBulkDeleteResponse
+- kv.NamespaceBulkUpdateResponse
+- kv.NamespaceBulkDeleteResponse
Methods:
-- client.KV.Namespaces.Bulk.Update(ctx context.Context, namespaceID string, params cloudflare.KVNamespaceBulkUpdateParams) (cloudflare.KVNamespaceBulkUpdateResponse, error)
-- client.KV.Namespaces.Bulk.Delete(ctx context.Context, namespaceID string, params cloudflare.KVNamespaceBulkDeleteParams) (cloudflare.KVNamespaceBulkDeleteResponse, error)
+- client.KV.Namespaces.Bulk.Update(ctx context.Context, namespaceID string, params kv.NamespaceBulkUpdateParams) (kv.NamespaceBulkUpdateResponse, error)
+- client.KV.Namespaces.Bulk.Delete(ctx context.Context, namespaceID string, params kv.NamespaceBulkDeleteParams) (kv.NamespaceBulkDeleteResponse, error)
### Keys
Response Types:
-- cloudflare.KVNamespaceKeyListResponse
+- kv.WorkersKVKey
Methods:
-- client.KV.Namespaces.Keys.List(ctx context.Context, namespaceID string, params cloudflare.KVNamespaceKeyListParams) ([]cloudflare.KVNamespaceKeyListResponse, error)
+- client.KV.Namespaces.Keys.List(ctx context.Context, namespaceID string, params kv.NamespaceKeyListParams) ([]kv.WorkersKVKey, error)
### Metadata
Response Types:
-- cloudflare.KVNamespaceMetadataGetResponse
+- kv.NamespaceMetadataGetResponse
Methods:
-- client.KV.Namespaces.Metadata.Get(ctx context.Context, namespaceID string, keyName string, query cloudflare.KVNamespaceMetadataGetParams) (cloudflare.KVNamespaceMetadataGetResponse, error)
+- client.KV.Namespaces.Metadata.Get(ctx context.Context, namespaceID string, keyName string, query kv.NamespaceMetadataGetParams) (kv.NamespaceMetadataGetResponse, error)
### Values
Response Types:
-- cloudflare.KVNamespaceValueUpdateResponse
-- cloudflare.KVNamespaceValueDeleteResponse
+- kv.NamespaceValueUpdateResponse
+- kv.NamespaceValueDeleteResponse
Methods:
-- client.KV.Namespaces.Values.Update(ctx context.Context, namespaceID string, keyName string, params cloudflare.KVNamespaceValueUpdateParams) (cloudflare.KVNamespaceValueUpdateResponse, error)
-- client.KV.Namespaces.Values.Delete(ctx context.Context, namespaceID string, keyName string, body cloudflare.KVNamespaceValueDeleteParams) (cloudflare.KVNamespaceValueDeleteResponse, error)
-- client.KV.Namespaces.Values.Get(ctx context.Context, namespaceID string, keyName string, query cloudflare.KVNamespaceValueGetParams) (string, error)
+- client.KV.Namespaces.Values.Update(ctx context.Context, namespaceID string, keyName string, params kv.NamespaceValueUpdateParams) (kv.NamespaceValueUpdateResponse, error)
+- client.KV.Namespaces.Values.Delete(ctx context.Context, namespaceID string, keyName string, body kv.NamespaceValueDeleteParams) (kv.NamespaceValueDeleteResponse, error)
+- client.KV.Namespaces.Values.Get(ctx context.Context, namespaceID string, keyName string, query kv.NamespaceValueGetParams) (string, error)
# DurableObjects
@@ -2660,210 +2697,187 @@ Methods:
Response Types:
-- cloudflare.DurableObjectNamespaceListResponse
+- durable_objects.WorkersNamespace
Methods:
-- client.DurableObjects.Namespaces.List(ctx context.Context, query cloudflare.DurableObjectNamespaceListParams) ([]cloudflare.DurableObjectNamespaceListResponse, error)
+- client.DurableObjects.Namespaces.List(ctx context.Context, query durable_objects.NamespaceListParams) ([]durable_objects.WorkersNamespace, error)
### Objects
Response Types:
-- cloudflare.DurableObjectNamespaceObjectListResponse
+- durable_objects.WorkersObject
Methods:
-- client.DurableObjects.Namespaces.Objects.List(ctx context.Context, id string, params cloudflare.DurableObjectNamespaceObjectListParams) ([]cloudflare.DurableObjectNamespaceObjectListResponse, error)
+- client.DurableObjects.Namespaces.Objects.List(ctx context.Context, id string, params durable_objects.NamespaceObjectListParams) ([]durable_objects.WorkersObject, error)
# Queues
Response Types:
-- cloudflare.QueueNewResponse
-- cloudflare.QueueUpdateResponse
-- cloudflare.QueueListResponse
-- cloudflare.QueueDeleteResponse
-- cloudflare.QueueGetResponse
+- queues.WorkersQueue
+- queues.WorkersQueueCreated
+- queues.WorkersQueueUpdated
+- queues.QueueDeleteResponse
Methods:
-- client.Queues.New(ctx context.Context, params cloudflare.QueueNewParams) (cloudflare.QueueNewResponse, error)
-- client.Queues.Update(ctx context.Context, name string, params cloudflare.QueueUpdateParams) (cloudflare.QueueUpdateResponse, error)
-- client.Queues.List(ctx context.Context, query cloudflare.QueueListParams) ([]cloudflare.QueueListResponse, error)
-- client.Queues.Delete(ctx context.Context, name string, body cloudflare.QueueDeleteParams) (cloudflare.QueueDeleteResponse, error)
-- client.Queues.Get(ctx context.Context, name string, query cloudflare.QueueGetParams) (cloudflare.QueueGetResponse, error)
+- client.Queues.New(ctx context.Context, params queues.QueueNewParams) (queues.WorkersQueueCreated, error)
+- client.Queues.Update(ctx context.Context, name string, params queues.QueueUpdateParams) (queues.WorkersQueueUpdated, error)
+- client.Queues.List(ctx context.Context, query queues.QueueListParams) ([]queues.WorkersQueue, error)
+- client.Queues.Delete(ctx context.Context, name string, body queues.QueueDeleteParams) (queues.QueueDeleteResponse, error)
+- client.Queues.Get(ctx context.Context, name string, query queues.QueueGetParams) (queues.WorkersQueue, error)
## Consumers
Response Types:
-- cloudflare.QueueConsumerNewResponse
-- cloudflare.QueueConsumerUpdateResponse
-- cloudflare.QueueConsumerDeleteResponse
-- cloudflare.QueueConsumerGetResponse
+- queues.WorkersConsumer
+- queues.WorkersConsumerCreated
+- queues.WorkersConsumerUpdated
+- queues.ConsumerDeleteResponse
Methods:
-- client.Queues.Consumers.New(ctx context.Context, name string, params cloudflare.QueueConsumerNewParams) (cloudflare.QueueConsumerNewResponse, error)
-- client.Queues.Consumers.Update(ctx context.Context, name string, consumerName string, params cloudflare.QueueConsumerUpdateParams) (cloudflare.QueueConsumerUpdateResponse, error)
-- client.Queues.Consumers.Delete(ctx context.Context, name string, consumerName string, body cloudflare.QueueConsumerDeleteParams) (cloudflare.QueueConsumerDeleteResponse, error)
-- client.Queues.Consumers.Get(ctx context.Context, name string, query cloudflare.QueueConsumerGetParams) ([]cloudflare.QueueConsumerGetResponse, error)
+- client.Queues.Consumers.New(ctx context.Context, name string, params queues.ConsumerNewParams) (queues.WorkersConsumerCreated, error)
+- client.Queues.Consumers.Update(ctx context.Context, name string, consumerName string, params queues.ConsumerUpdateParams) (queues.WorkersConsumerUpdated, error)
+- client.Queues.Consumers.Delete(ctx context.Context, name string, consumerName string, body queues.ConsumerDeleteParams) (queues.ConsumerDeleteResponse, error)
+- client.Queues.Consumers.Get(ctx context.Context, name string, query queues.ConsumerGetParams) ([]queues.WorkersConsumer, error)
# ManagedHeaders
Response Types:
-- cloudflare.ManagedHeaderListResponse
-- cloudflare.ManagedHeaderEditResponse
+- managed_headers.ManagedHeaderListResponse
+- managed_headers.ManagedHeaderEditResponse
Methods:
-- client.ManagedHeaders.List(ctx context.Context, query cloudflare.ManagedHeaderListParams) (cloudflare.ManagedHeaderListResponse, error)
-- client.ManagedHeaders.Edit(ctx context.Context, params cloudflare.ManagedHeaderEditParams) (cloudflare.ManagedHeaderEditResponse, error)
+- client.ManagedHeaders.List(ctx context.Context, query managed_headers.ManagedHeaderListParams) (managed_headers.ManagedHeaderListResponse, error)
+- client.ManagedHeaders.Edit(ctx context.Context, params managed_headers.ManagedHeaderEditParams) (managed_headers.ManagedHeaderEditResponse, error)
# PageShield
Response Types:
-- cloudflare.PageShieldUpdateResponse
-- cloudflare.PageShieldListResponse
+- page_shield.PageShieldGetZoneSettings
+- page_shield.PageShieldUpdateZoneSettings
Methods:
-- client.PageShield.Update(ctx context.Context, params cloudflare.PageShieldUpdateParams) (cloudflare.PageShieldUpdateResponse, error)
-- client.PageShield.List(ctx context.Context, query cloudflare.PageShieldListParams) (cloudflare.PageShieldListResponse, error)
+- client.PageShield.Update(ctx context.Context, params page_shield.PageShieldUpdateParams) (page_shield.PageShieldUpdateZoneSettings, error)
+- client.PageShield.List(ctx context.Context, query page_shield.PageShieldListParams) (page_shield.PageShieldGetZoneSettings, error)
## Policies
Response Types:
-- cloudflare.PageShieldPolicyNewResponse
-- cloudflare.PageShieldPolicyUpdateResponse
-- cloudflare.PageShieldPolicyListResponse
-- cloudflare.PageShieldPolicyGetResponse
+- page_shield.PageShieldPageshieldPolicy
Methods:
-- client.PageShield.Policies.New(ctx context.Context, params cloudflare.PageShieldPolicyNewParams) (cloudflare.PageShieldPolicyNewResponse, error)
-- client.PageShield.Policies.Update(ctx context.Context, policyID string, params cloudflare.PageShieldPolicyUpdateParams) (cloudflare.PageShieldPolicyUpdateResponse, error)
-- client.PageShield.Policies.List(ctx context.Context, query cloudflare.PageShieldPolicyListParams) ([]cloudflare.PageShieldPolicyListResponse, error)
-- client.PageShield.Policies.Delete(ctx context.Context, policyID string, body cloudflare.PageShieldPolicyDeleteParams) error
-- client.PageShield.Policies.Get(ctx context.Context, policyID string, query cloudflare.PageShieldPolicyGetParams) (cloudflare.PageShieldPolicyGetResponse, error)
+- client.PageShield.Policies.New(ctx context.Context, params page_shield.PolicyNewParams) (page_shield.PageShieldPageshieldPolicy, error)
+- client.PageShield.Policies.Update(ctx context.Context, policyID string, params page_shield.PolicyUpdateParams) (page_shield.PageShieldPageshieldPolicy, error)
+- client.PageShield.Policies.List(ctx context.Context, query page_shield.PolicyListParams) ([]page_shield.PageShieldPageshieldPolicy, error)
+- client.PageShield.Policies.Delete(ctx context.Context, policyID string, body page_shield.PolicyDeleteParams) error
+- client.PageShield.Policies.Get(ctx context.Context, policyID string, query page_shield.PolicyGetParams) (page_shield.PageShieldPageshieldPolicy, error)
## Connections
Response Types:
-- cloudflare.PageShieldConnectionListResponse
-- cloudflare.PageShieldConnectionGetResponse
+- page_shield.PageShieldConnection
Methods:
-- client.PageShield.Connections.List(ctx context.Context, params cloudflare.PageShieldConnectionListParams) ([]cloudflare.PageShieldConnectionListResponse, error)
-- client.PageShield.Connections.Get(ctx context.Context, connectionID string, query cloudflare.PageShieldConnectionGetParams) (cloudflare.PageShieldConnectionGetResponse, error)
+- client.PageShield.Connections.List(ctx context.Context, params page_shield.ConnectionListParams) ([]page_shield.PageShieldConnection, error)
+- client.PageShield.Connections.Get(ctx context.Context, connectionID string, query page_shield.ConnectionGetParams) (page_shield.PageShieldConnection, error)
## Scripts
Response Types:
-- cloudflare.PageShieldScriptListResponse
-- cloudflare.PageShieldScriptGetResponse
+- page_shield.PageShieldScript
+- page_shield.ScriptGetResponse
Methods:
-- client.PageShield.Scripts.List(ctx context.Context, params cloudflare.PageShieldScriptListParams) ([]cloudflare.PageShieldScriptListResponse, error)
-- client.PageShield.Scripts.Get(ctx context.Context, scriptID string, query cloudflare.PageShieldScriptGetParams) (cloudflare.PageShieldScriptGetResponse, error)
+- client.PageShield.Scripts.List(ctx context.Context, params page_shield.ScriptListParams) ([]page_shield.PageShieldScript, error)
+- client.PageShield.Scripts.Get(ctx context.Context, scriptID string, query page_shield.ScriptGetParams) (page_shield.ScriptGetResponse, error)
# Rulesets
Response Types:
-- cloudflare.RulesetNewResponse
-- cloudflare.RulesetUpdateResponse
-- cloudflare.RulesetListResponse
-- cloudflare.RulesetGetResponse
+- rulesets.RulesetsRulesetResponse
+- rulesets.RulesetsRulesetsResponse
+- rulesets.RulesetListResponse
Methods:
-- client.Rulesets.New(ctx context.Context, params cloudflare.RulesetNewParams) (cloudflare.RulesetNewResponse, error)
-- client.Rulesets.Update(ctx context.Context, rulesetID string, params cloudflare.RulesetUpdateParams) (cloudflare.RulesetUpdateResponse, error)
-- client.Rulesets.List(ctx context.Context, query cloudflare.RulesetListParams) ([]cloudflare.RulesetListResponse, error)
-- client.Rulesets.Delete(ctx context.Context, rulesetID string, body cloudflare.RulesetDeleteParams) error
-- client.Rulesets.Get(ctx context.Context, rulesetID string, query cloudflare.RulesetGetParams) (cloudflare.RulesetGetResponse, error)
+- client.Rulesets.New(ctx context.Context, params rulesets.RulesetNewParams) (rulesets.RulesetsRulesetResponse, error)
+- client.Rulesets.Update(ctx context.Context, rulesetID string, params rulesets.RulesetUpdateParams) (rulesets.RulesetsRulesetResponse, error)
+- client.Rulesets.List(ctx context.Context, query rulesets.RulesetListParams) (rulesets.RulesetsRulesetsResponse, error)
+- client.Rulesets.Delete(ctx context.Context, rulesetID string, body rulesets.RulesetDeleteParams) error
+- client.Rulesets.Get(ctx context.Context, rulesetID string, query rulesets.RulesetGetParams) (rulesets.RulesetsRulesetResponse, error)
## Phases
-Response Types:
-
-- cloudflare.RulesetPhaseUpdateResponse
-- cloudflare.RulesetPhaseGetResponse
-
Methods:
-- client.Rulesets.Phases.Update(ctx context.Context, rulesetPhase cloudflare.RulesetPhaseUpdateParamsRulesetPhase, params cloudflare.RulesetPhaseUpdateParams) (cloudflare.RulesetPhaseUpdateResponse, error)
-- client.Rulesets.Phases.Get(ctx context.Context, rulesetPhase cloudflare.RulesetPhaseGetParamsRulesetPhase, query cloudflare.RulesetPhaseGetParams) (cloudflare.RulesetPhaseGetResponse, error)
+- client.Rulesets.Phases.Update(ctx context.Context, rulesetPhase rulesets.PhaseUpdateParamsRulesetPhase, params rulesets.PhaseUpdateParams) (rulesets.RulesetsRulesetResponse, error)
+- client.Rulesets.Phases.Get(ctx context.Context, rulesetPhase rulesets.PhaseGetParamsRulesetPhase, query rulesets.PhaseGetParams) (rulesets.RulesetsRulesetResponse, error)
### Versions
Response Types:
-- cloudflare.RulesetPhaseVersionListResponse
-- cloudflare.RulesetPhaseVersionGetResponse
+- rulesets.PhaseVersionListResponse
Methods:
-- client.Rulesets.Phases.Versions.List(ctx context.Context, rulesetPhase cloudflare.RulesetPhaseVersionListParamsRulesetPhase, query cloudflare.RulesetPhaseVersionListParams) ([]cloudflare.RulesetPhaseVersionListResponse, error)
-- client.Rulesets.Phases.Versions.Get(ctx context.Context, rulesetPhase cloudflare.RulesetPhaseVersionGetParamsRulesetPhase, rulesetVersion string, query cloudflare.RulesetPhaseVersionGetParams) (cloudflare.RulesetPhaseVersionGetResponse, error)
+- client.Rulesets.Phases.Versions.List(ctx context.Context, rulesetPhase rulesets.PhaseVersionListParamsRulesetPhase, query rulesets.PhaseVersionListParams) (rulesets.RulesetsRulesetsResponse, error)
+- client.Rulesets.Phases.Versions.Get(ctx context.Context, rulesetPhase rulesets.PhaseVersionGetParamsRulesetPhase, rulesetVersion string, query rulesets.PhaseVersionGetParams) (rulesets.RulesetsRulesetResponse, error)
## Rules
-Response Types:
-
-- cloudflare.RulesetRuleNewResponse
-- cloudflare.RulesetRuleDeleteResponse
-- cloudflare.RulesetRuleEditResponse
-
Methods:
-- client.Rulesets.Rules.New(ctx context.Context, rulesetID string, params cloudflare.RulesetRuleNewParams) (cloudflare.RulesetRuleNewResponse, error)
-- client.Rulesets.Rules.Delete(ctx context.Context, rulesetID string, ruleID string, body cloudflare.RulesetRuleDeleteParams) (cloudflare.RulesetRuleDeleteResponse, error)
-- client.Rulesets.Rules.Edit(ctx context.Context, rulesetID string, ruleID string, params cloudflare.RulesetRuleEditParams) (cloudflare.RulesetRuleEditResponse, error)
+- client.Rulesets.Rules.New(ctx context.Context, rulesetID string, params rulesets.RuleNewParams) (rulesets.RulesetsRulesetResponse, error)
+- client.Rulesets.Rules.Delete(ctx context.Context, rulesetID string, ruleID string, body rulesets.RuleDeleteParams) (rulesets.RulesetsRulesetResponse, error)
+- client.Rulesets.Rules.Edit(ctx context.Context, rulesetID string, ruleID string, params rulesets.RuleEditParams) (rulesets.RulesetsRulesetResponse, error)
## Versions
Response Types:
-- cloudflare.RulesetVersionListResponse
-- cloudflare.RulesetVersionGetResponse
+- rulesets.VersionListResponse
Methods:
-- client.Rulesets.Versions.List(ctx context.Context, rulesetID string, query cloudflare.RulesetVersionListParams) ([]cloudflare.RulesetVersionListResponse, error)
-- client.Rulesets.Versions.Delete(ctx context.Context, rulesetID string, rulesetVersion string, body cloudflare.RulesetVersionDeleteParams) error
-- client.Rulesets.Versions.Get(ctx context.Context, rulesetID string, rulesetVersion string, query cloudflare.RulesetVersionGetParams) (cloudflare.RulesetVersionGetResponse, error)
+- client.Rulesets.Versions.List(ctx context.Context, rulesetID string, query rulesets.VersionListParams) (rulesets.RulesetsRulesetsResponse, error)
+- client.Rulesets.Versions.Delete(ctx context.Context, rulesetID string, rulesetVersion string, body rulesets.VersionDeleteParams) error
+- client.Rulesets.Versions.Get(ctx context.Context, rulesetID string, rulesetVersion string, query rulesets.VersionGetParams) (rulesets.RulesetsRulesetResponse, error)
### ByTags
-Response Types:
-
-- cloudflare.RulesetVersionByTagGetResponse
-
Methods:
-- client.Rulesets.Versions.ByTags.Get(ctx context.Context, rulesetID string, rulesetVersion string, ruleTag string, query cloudflare.RulesetVersionByTagGetParams) (cloudflare.RulesetVersionByTagGetResponse, error)
+- client.Rulesets.Versions.ByTags.Get(ctx context.Context, rulesetID string, rulesetVersion string, ruleTag string, query rulesets.VersionByTagGetParams) (rulesets.RulesetsRulesetResponse, error)
# URLNormalization
Response Types:
-- cloudflare.URLNormalizationUpdateResponse
-- cloudflare.URLNormalizationGetResponse
+- url_normalization.URLNormalizationUpdateResponse
+- url_normalization.URLNormalizationGetResponse
Methods:
-- client.URLNormalization.Update(ctx context.Context, params cloudflare.URLNormalizationUpdateParams) (cloudflare.URLNormalizationUpdateResponse, error)
-- client.URLNormalization.Get(ctx context.Context, query cloudflare.URLNormalizationGetParams) (cloudflare.URLNormalizationGetResponse, error)
+- client.URLNormalization.Update(ctx context.Context, params url_normalization.URLNormalizationUpdateParams) (url_normalization.URLNormalizationUpdateResponse, error)
+- client.URLNormalization.Get(ctx context.Context, query url_normalization.URLNormalizationGetParams) (url_normalization.URLNormalizationGetResponse, error)
# Spectrum
@@ -2875,11 +2889,11 @@ Methods:
Response Types:
-- cloudflare.SpectrumAnalyticsAggregateCurrentGetResponse
+- spectrum.AnalyticsAggregateCurrentGetResponse
Methods:
-- client.Spectrum.Analytics.Aggregates.Currents.Get(ctx context.Context, zone string, query cloudflare.SpectrumAnalyticsAggregateCurrentGetParams) ([]cloudflare.SpectrumAnalyticsAggregateCurrentGetResponse, error)
+- client.Spectrum.Analytics.Aggregates.Currents.Get(ctx context.Context, zone string, query spectrum.AnalyticsAggregateCurrentGetParams) ([]spectrum.AnalyticsAggregateCurrentGetResponse, error)
### Events
@@ -2887,39 +2901,39 @@ Methods:
Response Types:
-- cloudflare.SpectrumAnalyticsEventBytimeGetResponse
+- spectrum.AnalyticsEventBytimeGetResponse
Methods:
-- client.Spectrum.Analytics.Events.Bytimes.Get(ctx context.Context, zone string, query cloudflare.SpectrumAnalyticsEventBytimeGetParams) (cloudflare.SpectrumAnalyticsEventBytimeGetResponse, error)
+- client.Spectrum.Analytics.Events.Bytimes.Get(ctx context.Context, zone string, query spectrum.AnalyticsEventBytimeGetParams) (spectrum.AnalyticsEventBytimeGetResponse, error)
#### Summaries
Response Types:
-- cloudflare.SpectrumAnalyticsEventSummaryGetResponse
+- spectrum.AnalyticsEventSummaryGetResponse
Methods:
-- client.Spectrum.Analytics.Events.Summaries.Get(ctx context.Context, zone string, query cloudflare.SpectrumAnalyticsEventSummaryGetParams) (cloudflare.SpectrumAnalyticsEventSummaryGetResponse, error)
+- client.Spectrum.Analytics.Events.Summaries.Get(ctx context.Context, zone string, query spectrum.AnalyticsEventSummaryGetParams) (spectrum.AnalyticsEventSummaryGetResponse, error)
## Apps
Response Types:
-- cloudflare.SpectrumAppNewResponse
-- cloudflare.SpectrumAppUpdateResponse
-- cloudflare.SpectrumAppListResponse
-- cloudflare.SpectrumAppDeleteResponse
-- cloudflare.SpectrumAppGetResponse
+- spectrum.AppNewResponse
+- spectrum.AppUpdateResponse
+- spectrum.AppListResponse
+- spectrum.AppDeleteResponse
+- spectrum.AppGetResponse
Methods:
-- client.Spectrum.Apps.New(ctx context.Context, zone string, body cloudflare.SpectrumAppNewParams) (cloudflare.SpectrumAppNewResponse, error)
-- client.Spectrum.Apps.Update(ctx context.Context, zone string, appID string, body cloudflare.SpectrumAppUpdateParams) (cloudflare.SpectrumAppUpdateResponse, error)
-- client.Spectrum.Apps.List(ctx context.Context, zone string, query cloudflare.SpectrumAppListParams) (shared.V4PagePaginationArray[cloudflare.SpectrumAppListResponse], error)
-- client.Spectrum.Apps.Delete(ctx context.Context, zone string, appID string) (cloudflare.SpectrumAppDeleteResponse, error)
-- client.Spectrum.Apps.Get(ctx context.Context, zone string, appID string) (cloudflare.SpectrumAppGetResponse, error)
+- client.Spectrum.Apps.New(ctx context.Context, zone string, body spectrum.AppNewParams) (spectrum.AppNewResponse, error)
+- client.Spectrum.Apps.Update(ctx context.Context, zone string, appID string, body spectrum.AppUpdateParams) (spectrum.AppUpdateResponse, error)
+- client.Spectrum.Apps.List(ctx context.Context, zone string, query spectrum.AppListParams) (shared.V4PagePaginationArray[spectrum.AppListResponse], error)
+- client.Spectrum.Apps.Delete(ctx context.Context, zone string, appID string) (spectrum.AppDeleteResponse, error)
+- client.Spectrum.Apps.Get(ctx context.Context, zone string, appID string) (spectrum.AppGetResponse, error)
# Addressing
@@ -2927,103 +2941,99 @@ Methods:
Response Types:
-- cloudflare.AddressingServiceListResponse
+- addressing.ServiceListResponse
Methods:
-- client.Addressing.Services.List(ctx context.Context, query cloudflare.AddressingServiceListParams) ([]cloudflare.AddressingServiceListResponse, error)
+- client.Addressing.Services.List(ctx context.Context, query addressing.ServiceListParams) ([]addressing.ServiceListResponse, error)
## AddressMaps
Response Types:
-- cloudflare.AddressingAddressMapNewResponse
-- cloudflare.AddressingAddressMapListResponse
-- cloudflare.AddressingAddressMapDeleteResponse
-- cloudflare.AddressingAddressMapEditResponse
-- cloudflare.AddressingAddressMapGetResponse
+- addressing.AddressingAddressMaps
+- addressing.AddressMapNewResponse
+- addressing.AddressMapDeleteResponse
+- addressing.AddressMapGetResponse
Methods:
-- client.Addressing.AddressMaps.New(ctx context.Context, params cloudflare.AddressingAddressMapNewParams) (cloudflare.AddressingAddressMapNewResponse, error)
-- client.Addressing.AddressMaps.List(ctx context.Context, query cloudflare.AddressingAddressMapListParams) ([]cloudflare.AddressingAddressMapListResponse, error)
-- client.Addressing.AddressMaps.Delete(ctx context.Context, addressMapID string, body cloudflare.AddressingAddressMapDeleteParams) (cloudflare.AddressingAddressMapDeleteResponse, error)
-- client.Addressing.AddressMaps.Edit(ctx context.Context, addressMapID string, params cloudflare.AddressingAddressMapEditParams) (cloudflare.AddressingAddressMapEditResponse, error)
-- client.Addressing.AddressMaps.Get(ctx context.Context, addressMapID string, query cloudflare.AddressingAddressMapGetParams) (cloudflare.AddressingAddressMapGetResponse, error)
+- client.Addressing.AddressMaps.New(ctx context.Context, params addressing.AddressMapNewParams) (addressing.AddressMapNewResponse, error)
+- client.Addressing.AddressMaps.List(ctx context.Context, query addressing.AddressMapListParams) ([]addressing.AddressingAddressMaps, error)
+- client.Addressing.AddressMaps.Delete(ctx context.Context, addressMapID string, body addressing.AddressMapDeleteParams) (addressing.AddressMapDeleteResponse, error)
+- client.Addressing.AddressMaps.Edit(ctx context.Context, addressMapID string, params addressing.AddressMapEditParams) (addressing.AddressingAddressMaps, error)
+- client.Addressing.AddressMaps.Get(ctx context.Context, addressMapID string, query addressing.AddressMapGetParams) (addressing.AddressMapGetResponse, error)
### Accounts
Response Types:
-- cloudflare.AddressingAddressMapAccountUpdateResponse
-- cloudflare.AddressingAddressMapAccountDeleteResponse
+- addressing.AddressMapAccountUpdateResponse
+- addressing.AddressMapAccountDeleteResponse
Methods:
-- client.Addressing.AddressMaps.Accounts.Update(ctx context.Context, addressMapID string, body cloudflare.AddressingAddressMapAccountUpdateParams) (cloudflare.AddressingAddressMapAccountUpdateResponse, error)
-- client.Addressing.AddressMaps.Accounts.Delete(ctx context.Context, addressMapID string, body cloudflare.AddressingAddressMapAccountDeleteParams) (cloudflare.AddressingAddressMapAccountDeleteResponse, error)
+- client.Addressing.AddressMaps.Accounts.Update(ctx context.Context, addressMapID string, body addressing.AddressMapAccountUpdateParams) (addressing.AddressMapAccountUpdateResponse, error)
+- client.Addressing.AddressMaps.Accounts.Delete(ctx context.Context, addressMapID string, body addressing.AddressMapAccountDeleteParams) (addressing.AddressMapAccountDeleteResponse, error)
### IPs
Response Types:
-- cloudflare.AddressingAddressMapIPUpdateResponse
-- cloudflare.AddressingAddressMapIPDeleteResponse
+- addressing.AddressMapIPUpdateResponse
+- addressing.AddressMapIPDeleteResponse
Methods:
-- client.Addressing.AddressMaps.IPs.Update(ctx context.Context, addressMapID string, ipAddress string, body cloudflare.AddressingAddressMapIPUpdateParams) (cloudflare.AddressingAddressMapIPUpdateResponse, error)
-- client.Addressing.AddressMaps.IPs.Delete(ctx context.Context, addressMapID string, ipAddress string, body cloudflare.AddressingAddressMapIPDeleteParams) (cloudflare.AddressingAddressMapIPDeleteResponse, error)
+- client.Addressing.AddressMaps.IPs.Update(ctx context.Context, addressMapID string, ipAddress string, body addressing.AddressMapIPUpdateParams) (addressing.AddressMapIPUpdateResponse, error)
+- client.Addressing.AddressMaps.IPs.Delete(ctx context.Context, addressMapID string, ipAddress string, body addressing.AddressMapIPDeleteParams) (addressing.AddressMapIPDeleteResponse, error)
### Zones
Response Types:
-- cloudflare.AddressingAddressMapZoneUpdateResponse
-- cloudflare.AddressingAddressMapZoneDeleteResponse
+- addressing.AddressMapZoneUpdateResponse
+- addressing.AddressMapZoneDeleteResponse
Methods:
-- client.Addressing.AddressMaps.Zones.Update(ctx context.Context, addressMapID string, body cloudflare.AddressingAddressMapZoneUpdateParams) (cloudflare.AddressingAddressMapZoneUpdateResponse, error)
-- client.Addressing.AddressMaps.Zones.Delete(ctx context.Context, addressMapID string, body cloudflare.AddressingAddressMapZoneDeleteParams) (cloudflare.AddressingAddressMapZoneDeleteResponse, error)
+- client.Addressing.AddressMaps.Zones.Update(ctx context.Context, addressMapID string, body addressing.AddressMapZoneUpdateParams) (addressing.AddressMapZoneUpdateResponse, error)
+- client.Addressing.AddressMaps.Zones.Delete(ctx context.Context, addressMapID string, body addressing.AddressMapZoneDeleteParams) (addressing.AddressMapZoneDeleteResponse, error)
## LOADocuments
Response Types:
-- cloudflare.AddressingLOADocumentNewResponse
+- addressing.LOADocumentNewResponse
Methods:
-- client.Addressing.LOADocuments.New(ctx context.Context, params cloudflare.AddressingLOADocumentNewParams) (cloudflare.AddressingLOADocumentNewResponse, error)
+- client.Addressing.LOADocuments.New(ctx context.Context, params addressing.LOADocumentNewParams) (addressing.LOADocumentNewResponse, error)
### Downloads
Response Types:
-- cloudflare.AddressingLOADocumentDownloadGetResponse
+- addressing.LOADocumentDownloadGetResponse
Methods:
-- client.Addressing.LOADocuments.Downloads.Get(ctx context.Context, loaDocumentID string, query cloudflare.AddressingLOADocumentDownloadGetParams) (cloudflare.AddressingLOADocumentDownloadGetResponse, error)
+- client.Addressing.LOADocuments.Downloads.Get(ctx context.Context, loaDocumentID string, query addressing.LOADocumentDownloadGetParams) (addressing.LOADocumentDownloadGetResponse, error)
## Prefixes
Response Types:
-- cloudflare.AddressingPrefixNewResponse
-- cloudflare.AddressingPrefixListResponse
-- cloudflare.AddressingPrefixDeleteResponse
-- cloudflare.AddressingPrefixEditResponse
-- cloudflare.AddressingPrefixGetResponse
+- addressing.AddressingIpamPrefixes
+- addressing.PrefixDeleteResponse
Methods:
-- client.Addressing.Prefixes.New(ctx context.Context, params cloudflare.AddressingPrefixNewParams) (cloudflare.AddressingPrefixNewResponse, error)
-- client.Addressing.Prefixes.List(ctx context.Context, query cloudflare.AddressingPrefixListParams) ([]cloudflare.AddressingPrefixListResponse, error)
-- client.Addressing.Prefixes.Delete(ctx context.Context, prefixID string, body cloudflare.AddressingPrefixDeleteParams) (cloudflare.AddressingPrefixDeleteResponse, error)
-- client.Addressing.Prefixes.Edit(ctx context.Context, prefixID string, params cloudflare.AddressingPrefixEditParams) (cloudflare.AddressingPrefixEditResponse, error)
-- client.Addressing.Prefixes.Get(ctx context.Context, prefixID string, query cloudflare.AddressingPrefixGetParams) (cloudflare.AddressingPrefixGetResponse, error)
+- client.Addressing.Prefixes.New(ctx context.Context, params addressing.PrefixNewParams) (addressing.AddressingIpamPrefixes, error)
+- client.Addressing.Prefixes.List(ctx context.Context, query addressing.PrefixListParams) ([]addressing.AddressingIpamPrefixes, error)
+- client.Addressing.Prefixes.Delete(ctx context.Context, prefixID string, body addressing.PrefixDeleteParams) (addressing.PrefixDeleteResponse, error)
+- client.Addressing.Prefixes.Edit(ctx context.Context, prefixID string, params addressing.PrefixEditParams) (addressing.AddressingIpamPrefixes, error)
+- client.Addressing.Prefixes.Get(ctx context.Context, prefixID string, query addressing.PrefixGetParams) (addressing.AddressingIpamPrefixes, error)
### BGP
@@ -3031,67 +3041,62 @@ Methods:
Response Types:
-- cloudflare.AddressingPrefixBGPBindingNewResponse
-- cloudflare.AddressingPrefixBGPBindingListResponse
-- cloudflare.AddressingPrefixBGPBindingDeleteResponse
-- cloudflare.AddressingPrefixBGPBindingGetResponse
+- addressing.AddressingServiceBinding
+- addressing.PrefixBGPBindingDeleteResponse
Methods:
-- client.Addressing.Prefixes.BGP.Bindings.New(ctx context.Context, prefixID string, params cloudflare.AddressingPrefixBGPBindingNewParams) (cloudflare.AddressingPrefixBGPBindingNewResponse, error)
-- client.Addressing.Prefixes.BGP.Bindings.List(ctx context.Context, prefixID string, query cloudflare.AddressingPrefixBGPBindingListParams) ([]cloudflare.AddressingPrefixBGPBindingListResponse, error)
-- client.Addressing.Prefixes.BGP.Bindings.Delete(ctx context.Context, prefixID string, bindingID string, body cloudflare.AddressingPrefixBGPBindingDeleteParams) (cloudflare.AddressingPrefixBGPBindingDeleteResponse, error)
-- client.Addressing.Prefixes.BGP.Bindings.Get(ctx context.Context, prefixID string, bindingID string, query cloudflare.AddressingPrefixBGPBindingGetParams) (cloudflare.AddressingPrefixBGPBindingGetResponse, error)
+- client.Addressing.Prefixes.BGP.Bindings.New(ctx context.Context, prefixID string, params addressing.PrefixBGPBindingNewParams) (addressing.AddressingServiceBinding, error)
+- client.Addressing.Prefixes.BGP.Bindings.List(ctx context.Context, prefixID string, query addressing.PrefixBGPBindingListParams) ([]addressing.AddressingServiceBinding, error)
+- client.Addressing.Prefixes.BGP.Bindings.Delete(ctx context.Context, prefixID string, bindingID string, body addressing.PrefixBGPBindingDeleteParams) (addressing.PrefixBGPBindingDeleteResponse, error)
+- client.Addressing.Prefixes.BGP.Bindings.Get(ctx context.Context, prefixID string, bindingID string, query addressing.PrefixBGPBindingGetParams) (addressing.AddressingServiceBinding, error)
#### Prefixes
Response Types:
-- cloudflare.AddressingPrefixBGPPrefixListResponse
-- cloudflare.AddressingPrefixBGPPrefixEditResponse
-- cloudflare.AddressingPrefixBGPPrefixGetResponse
+- addressing.AddressingIpamBGPPrefixes
Methods:
-- client.Addressing.Prefixes.BGP.Prefixes.List(ctx context.Context, prefixID string, query cloudflare.AddressingPrefixBGPPrefixListParams) ([]cloudflare.AddressingPrefixBGPPrefixListResponse, error)
-- client.Addressing.Prefixes.BGP.Prefixes.Edit(ctx context.Context, prefixID string, bgpPrefixID string, params cloudflare.AddressingPrefixBGPPrefixEditParams) (cloudflare.AddressingPrefixBGPPrefixEditResponse, error)
-- client.Addressing.Prefixes.BGP.Prefixes.Get(ctx context.Context, prefixID string, bgpPrefixID string, query cloudflare.AddressingPrefixBGPPrefixGetParams) (cloudflare.AddressingPrefixBGPPrefixGetResponse, error)
+- client.Addressing.Prefixes.BGP.Prefixes.List(ctx context.Context, prefixID string, query addressing.PrefixBGPPrefixListParams) ([]addressing.AddressingIpamBGPPrefixes, error)
+- client.Addressing.Prefixes.BGP.Prefixes.Edit(ctx context.Context, prefixID string, bgpPrefixID string, params addressing.PrefixBGPPrefixEditParams) (addressing.AddressingIpamBGPPrefixes, error)
+- client.Addressing.Prefixes.BGP.Prefixes.Get(ctx context.Context, prefixID string, bgpPrefixID string, query addressing.PrefixBGPPrefixGetParams) (addressing.AddressingIpamBGPPrefixes, error)
#### Statuses
Response Types:
-- cloudflare.AddressingPrefixBGPStatusEditResponse
-- cloudflare.AddressingPrefixBGPStatusGetResponse
+- addressing.PrefixBGPStatusEditResponse
+- addressing.PrefixBGPStatusGetResponse
Methods:
-- client.Addressing.Prefixes.BGP.Statuses.Edit(ctx context.Context, prefixID string, params cloudflare.AddressingPrefixBGPStatusEditParams) (cloudflare.AddressingPrefixBGPStatusEditResponse, error)
-- client.Addressing.Prefixes.BGP.Statuses.Get(ctx context.Context, prefixID string, query cloudflare.AddressingPrefixBGPStatusGetParams) (cloudflare.AddressingPrefixBGPStatusGetResponse, error)
+- client.Addressing.Prefixes.BGP.Statuses.Edit(ctx context.Context, prefixID string, params addressing.PrefixBGPStatusEditParams) (addressing.PrefixBGPStatusEditResponse, error)
+- client.Addressing.Prefixes.BGP.Statuses.Get(ctx context.Context, prefixID string, query addressing.PrefixBGPStatusGetParams) (addressing.PrefixBGPStatusGetResponse, error)
### Delegations
Response Types:
-- cloudflare.AddressingPrefixDelegationNewResponse
-- cloudflare.AddressingPrefixDelegationListResponse
-- cloudflare.AddressingPrefixDelegationDeleteResponse
+- addressing.AddressingIpamDelegations
+- addressing.PrefixDelegationDeleteResponse
Methods:
-- client.Addressing.Prefixes.Delegations.New(ctx context.Context, prefixID string, params cloudflare.AddressingPrefixDelegationNewParams) (cloudflare.AddressingPrefixDelegationNewResponse, error)
-- client.Addressing.Prefixes.Delegations.List(ctx context.Context, prefixID string, query cloudflare.AddressingPrefixDelegationListParams) ([]cloudflare.AddressingPrefixDelegationListResponse, error)
-- client.Addressing.Prefixes.Delegations.Delete(ctx context.Context, prefixID string, delegationID string, body cloudflare.AddressingPrefixDelegationDeleteParams) (cloudflare.AddressingPrefixDelegationDeleteResponse, error)
+- client.Addressing.Prefixes.Delegations.New(ctx context.Context, prefixID string, params addressing.PrefixDelegationNewParams) (addressing.AddressingIpamDelegations, error)
+- client.Addressing.Prefixes.Delegations.List(ctx context.Context, prefixID string, query addressing.PrefixDelegationListParams) ([]addressing.AddressingIpamDelegations, error)
+- client.Addressing.Prefixes.Delegations.Delete(ctx context.Context, prefixID string, delegationID string, body addressing.PrefixDelegationDeleteParams) (addressing.PrefixDelegationDeleteResponse, error)
# AuditLogs
Response Types:
-- cloudflare.AuditLogListResponse
+- audit_logs.AuditLogListResponse
Methods:
-- client.AuditLogs.List(ctx context.Context, accountIdentifier string, query cloudflare.AuditLogListParams) (shared.V4PagePaginationArray[cloudflare.AuditLogListResponse], error)
+- client.AuditLogs.List(ctx context.Context, accountIdentifier string, query audit_logs.AuditLogListParams) (shared.V4PagePaginationArray[audit_logs.AuditLogListResponse], error)
# Billing
@@ -3099,23 +3104,23 @@ Methods:
Response Types:
-- cloudflare.BillingProfileGetResponse
+- billing.ProfileGetResponse
Methods:
-- client.Billing.Profiles.Get(ctx context.Context, accountIdentifier interface{}) (cloudflare.BillingProfileGetResponse, error)
+- client.Billing.Profiles.Get(ctx context.Context, accountIdentifier interface{}) (billing.ProfileGetResponse, error)
# BrandProtection
Response Types:
-- cloudflare.BrandProtectionSubmitResponse
-- cloudflare.BrandProtectionURLInfoResponse
+- brand_protection.IntelPhishingURLInfo
+- brand_protection.IntelPhishingURLSubmit
Methods:
-- client.BrandProtection.Submit(ctx context.Context, params cloudflare.BrandProtectionSubmitParams) (cloudflare.BrandProtectionSubmitResponse, error)
-- client.BrandProtection.URLInfo(ctx context.Context, params cloudflare.BrandProtectionURLInfoParams) (cloudflare.BrandProtectionURLInfoResponse, error)
+- client.BrandProtection.Submit(ctx context.Context, params brand_protection.BrandProtectionSubmitParams) (brand_protection.IntelPhishingURLSubmit, error)
+- client.BrandProtection.URLInfo(ctx context.Context, params brand_protection.BrandProtectionURLInfoParams) (brand_protection.IntelPhishingURLInfo, error)
# Diagnostics
@@ -3123,11 +3128,11 @@ Methods:
Response Types:
-- cloudflare.DiagnosticTracerouteNewResponse
+- diagnostics.MagicTransitTargetResult
Methods:
-- client.Diagnostics.Traceroutes.New(ctx context.Context, params cloudflare.DiagnosticTracerouteNewParams) ([]cloudflare.DiagnosticTracerouteNewResponse, error)
+- client.Diagnostics.Traceroutes.New(ctx context.Context, params diagnostics.TracerouteNewParams) ([]diagnostics.MagicTransitTargetResult, error)
# Images
@@ -3135,222 +3140,224 @@ Methods:
Response Types:
-- cloudflare.ImageV1NewResponse
-- cloudflare.ImageV1ListResponse
-- cloudflare.ImageV1DeleteResponse
-- cloudflare.ImageV1EditResponse
-- cloudflare.ImageV1GetResponse
+- images.ImagesImage
+- images.V1ListResponse
+- images.V1DeleteResponse
Methods:
-- client.Images.V1.New(ctx context.Context, params cloudflare.ImageV1NewParams) (cloudflare.ImageV1NewResponse, error)
-- client.Images.V1.List(ctx context.Context, params cloudflare.ImageV1ListParams) (shared.V4PagePagination[cloudflare.ImageV1ListResponse], error)
-- client.Images.V1.Delete(ctx context.Context, imageID string, body cloudflare.ImageV1DeleteParams) (cloudflare.ImageV1DeleteResponse, error)
-- client.Images.V1.Edit(ctx context.Context, imageID string, params cloudflare.ImageV1EditParams) (cloudflare.ImageV1EditResponse, error)
-- client.Images.V1.Get(ctx context.Context, imageID string, query cloudflare.ImageV1GetParams) (cloudflare.ImageV1GetResponse, error)
+- client.Images.V1.New(ctx context.Context, params images.V1NewParams) (images.ImagesImage, error)
+- client.Images.V1.List(ctx context.Context, params images.V1ListParams) (shared.V4PagePagination[images.V1ListResponse], error)
+- client.Images.V1.Delete(ctx context.Context, imageID string, body images.V1DeleteParams) (images.V1DeleteResponse, error)
+- client.Images.V1.Edit(ctx context.Context, imageID string, params images.V1EditParams) (images.ImagesImage, error)
+- client.Images.V1.Get(ctx context.Context, imageID string, query images.V1GetParams) (images.ImagesImage, error)
### Keys
Response Types:
-- cloudflare.ImageV1KeyListResponse
+- images.ImagesImageKeys
Methods:
-- client.Images.V1.Keys.List(ctx context.Context, query cloudflare.ImageV1KeyListParams) (cloudflare.ImageV1KeyListResponse, error)
+- client.Images.V1.Keys.List(ctx context.Context, query images.V1KeyListParams) (images.ImagesImageKeys, error)
### Stats
Response Types:
-- cloudflare.ImageV1StatGetResponse
+- images.ImagesImagesStats
Methods:
-- client.Images.V1.Stats.Get(ctx context.Context, query cloudflare.ImageV1StatGetParams) (cloudflare.ImageV1StatGetResponse, error)
+- client.Images.V1.Stats.Get(ctx context.Context, query images.V1StatGetParams) (images.ImagesImagesStats, error)
### Variants
Response Types:
-- cloudflare.ImageV1VariantNewResponse
-- cloudflare.ImageV1VariantListResponse
-- cloudflare.ImageV1VariantDeleteResponse
-- cloudflare.ImageV1VariantEditResponse
-- cloudflare.ImageV1VariantGetResponse
+- images.ImageVariant
+- images.ImageVariants
+- images.V1VariantDeleteResponse
Methods:
-- client.Images.V1.Variants.New(ctx context.Context, params cloudflare.ImageV1VariantNewParams) (cloudflare.ImageV1VariantNewResponse, error)
-- client.Images.V1.Variants.List(ctx context.Context, query cloudflare.ImageV1VariantListParams) (cloudflare.ImageV1VariantListResponse, error)
-- client.Images.V1.Variants.Delete(ctx context.Context, variantID interface{}, body cloudflare.ImageV1VariantDeleteParams) (cloudflare.ImageV1VariantDeleteResponse, error)
-- client.Images.V1.Variants.Edit(ctx context.Context, variantID interface{}, params cloudflare.ImageV1VariantEditParams) (cloudflare.ImageV1VariantEditResponse, error)
-- client.Images.V1.Variants.Get(ctx context.Context, variantID interface{}, query cloudflare.ImageV1VariantGetParams) (cloudflare.ImageV1VariantGetResponse, error)
+- client.Images.V1.Variants.New(ctx context.Context, params images.V1VariantNewParams) (images.ImageVariant, error)
+- client.Images.V1.Variants.List(ctx context.Context, query images.V1VariantListParams) (images.ImageVariants, error)
+- client.Images.V1.Variants.Delete(ctx context.Context, variantID interface{}, body images.V1VariantDeleteParams) (images.V1VariantDeleteResponse, error)
+- client.Images.V1.Variants.Edit(ctx context.Context, variantID interface{}, params images.V1VariantEditParams) (images.ImageVariant, error)
+- client.Images.V1.Variants.Get(ctx context.Context, variantID interface{}, query images.V1VariantGetParams) (images.ImageVariant, error)
### Blobs
Methods:
-- client.Images.V1.Blobs.Get(ctx context.Context, imageID string, query cloudflare.ImageV1BlobGetParams) (http.Response, error)
+- client.Images.V1.Blobs.Get(ctx context.Context, imageID string, query images.V1BlobGetParams) (http.Response, error)
## V2
Response Types:
-- cloudflare.ImageV2ListResponse
+- images.V2ListResponse
Methods:
-- client.Images.V2.List(ctx context.Context, params cloudflare.ImageV2ListParams) (cloudflare.ImageV2ListResponse, error)
+- client.Images.V2.List(ctx context.Context, params images.V2ListParams) (images.V2ListResponse, error)
### DirectUploads
Response Types:
-- cloudflare.ImageV2DirectUploadNewResponse
+- images.V2DirectUploadNewResponse
Methods:
-- client.Images.V2.DirectUploads.New(ctx context.Context, params cloudflare.ImageV2DirectUploadNewParams) (cloudflare.ImageV2DirectUploadNewResponse, error)
+- client.Images.V2.DirectUploads.New(ctx context.Context, params images.V2DirectUploadNewParams) (images.V2DirectUploadNewResponse, error)
# Intel
## ASN
+Params Types:
+
+- intel.IntelASNParam
+
+Response Types:
+
+- intel.IntelASN
+
Methods:
-- client.Intel.ASN.Get(ctx context.Context, asn int64, query cloudflare.IntelASNGetParams) (int64, error)
+- client.Intel.ASN.Get(ctx context.Context, asn intel.IntelASNParam, query intel.ASNGetParams) (intel.IntelASN, error)
### Subnets
Response Types:
-- cloudflare.IntelASNSubnetGetResponse
+- intel.ASNSubnetGetResponse
Methods:
-- client.Intel.ASN.Subnets.Get(ctx context.Context, asn int64, query cloudflare.IntelASNSubnetGetParams) (cloudflare.IntelASNSubnetGetResponse, error)
+- client.Intel.ASN.Subnets.Get(ctx context.Context, asn intel.IntelASNParam, query intel.ASNSubnetGetParams) (intel.ASNSubnetGetResponse, error)
## DNS
Response Types:
-- cloudflare.IntelDNSGetResponse
+- intel.IntelPassiveDNSByIP
Methods:
-- client.Intel.DNS.Get(ctx context.Context, params cloudflare.IntelDNSGetParams) (cloudflare.IntelDNSGetResponse, error)
+- client.Intel.DNS.Get(ctx context.Context, params intel.DNSGetParams) (intel.IntelPassiveDNSByIP, error)
## Domains
Response Types:
-- cloudflare.IntelDomainGetResponse
+- intel.IntelDomain
Methods:
-- client.Intel.Domains.Get(ctx context.Context, params cloudflare.IntelDomainGetParams) (cloudflare.IntelDomainGetResponse, error)
+- client.Intel.Domains.Get(ctx context.Context, params intel.DomainGetParams) (intel.IntelDomain, error)
### Bulks
Response Types:
-- cloudflare.IntelDomainBulkGetResponse
+- intel.DomainBulkGetResponse
Methods:
-- client.Intel.Domains.Bulks.Get(ctx context.Context, params cloudflare.IntelDomainBulkGetParams) ([]cloudflare.IntelDomainBulkGetResponse, error)
+- client.Intel.Domains.Bulks.Get(ctx context.Context, params intel.DomainBulkGetParams) ([]intel.DomainBulkGetResponse, error)
## DomainHistory
Response Types:
-- cloudflare.IntelDomainHistoryGetResponse
+- intel.IntelDomainHistory
Methods:
-- client.Intel.DomainHistory.Get(ctx context.Context, params cloudflare.IntelDomainHistoryGetParams) ([]cloudflare.IntelDomainHistoryGetResponse, error)
+- client.Intel.DomainHistory.Get(ctx context.Context, params intel.DomainHistoryGetParams) ([]intel.IntelDomainHistory, error)
## IPs
Response Types:
-- cloudflare.IntelIPGetResponse
+- intel.IntelSchemasIP
Methods:
-- client.Intel.IPs.Get(ctx context.Context, params cloudflare.IntelIPGetParams) ([]cloudflare.IntelIPGetResponse, error)
+- client.Intel.IPs.Get(ctx context.Context, params intel.IPGetParams) ([]intel.IntelSchemasIP, error)
## IPLists
Response Types:
-- cloudflare.IntelIPListGetResponse
+- intel.IntelIPList
Methods:
-- client.Intel.IPLists.Get(ctx context.Context, query cloudflare.IntelIPListGetParams) ([]cloudflare.IntelIPListGetResponse, error)
+- client.Intel.IPLists.Get(ctx context.Context, query intel.IPListGetParams) ([]intel.IntelIPList, error)
## Miscategorizations
Response Types:
-- cloudflare.IntelMiscategorizationNewResponse
+- intel.MiscategorizationNewResponse
Methods:
-- client.Intel.Miscategorizations.New(ctx context.Context, params cloudflare.IntelMiscategorizationNewParams) (cloudflare.IntelMiscategorizationNewResponse, error)
+- client.Intel.Miscategorizations.New(ctx context.Context, params intel.MiscategorizationNewParams) (intel.MiscategorizationNewResponse, error)
## Whois
Response Types:
-- cloudflare.IntelWhoisGetResponse
+- intel.IntelWhois
Methods:
-- client.Intel.Whois.Get(ctx context.Context, params cloudflare.IntelWhoisGetParams) (cloudflare.IntelWhoisGetResponse, error)
+- client.Intel.Whois.Get(ctx context.Context, params intel.WhoisGetParams) (intel.IntelWhois, error)
## IndicatorFeeds
Response Types:
-- cloudflare.IntelIndicatorFeedNewResponse
-- cloudflare.IntelIndicatorFeedUpdateResponse
-- cloudflare.IntelIndicatorFeedListResponse
-- cloudflare.IntelIndicatorFeedGetResponse
+- intel.IntelIndicatorFeedItem
+- intel.IntelIndicatorFeedMetadata
+- intel.IntelUpdateFeed
Methods:
-- client.Intel.IndicatorFeeds.New(ctx context.Context, params cloudflare.IntelIndicatorFeedNewParams) (cloudflare.IntelIndicatorFeedNewResponse, error)
-- client.Intel.IndicatorFeeds.Update(ctx context.Context, feedID int64, params cloudflare.IntelIndicatorFeedUpdateParams) (cloudflare.IntelIndicatorFeedUpdateResponse, error)
-- client.Intel.IndicatorFeeds.List(ctx context.Context, query cloudflare.IntelIndicatorFeedListParams) ([]cloudflare.IntelIndicatorFeedListResponse, error)
-- client.Intel.IndicatorFeeds.Data(ctx context.Context, feedID int64, query cloudflare.IntelIndicatorFeedDataParams) (string, error)
-- client.Intel.IndicatorFeeds.Get(ctx context.Context, feedID int64, query cloudflare.IntelIndicatorFeedGetParams) (cloudflare.IntelIndicatorFeedGetResponse, error)
+- client.Intel.IndicatorFeeds.New(ctx context.Context, params intel.IndicatorFeedNewParams) (intel.IntelIndicatorFeedItem, error)
+- client.Intel.IndicatorFeeds.Update(ctx context.Context, feedID int64, params intel.IndicatorFeedUpdateParams) (intel.IntelUpdateFeed, error)
+- client.Intel.IndicatorFeeds.List(ctx context.Context, query intel.IndicatorFeedListParams) ([]intel.IntelIndicatorFeedItem, error)
+- client.Intel.IndicatorFeeds.Data(ctx context.Context, feedID int64, query intel.IndicatorFeedDataParams) (string, error)
+- client.Intel.IndicatorFeeds.Get(ctx context.Context, feedID int64, query intel.IndicatorFeedGetParams) (intel.IntelIndicatorFeedMetadata, error)
### Permissions
Response Types:
-- cloudflare.IntelIndicatorFeedPermissionNewResponse
-- cloudflare.IntelIndicatorFeedPermissionListResponse
-- cloudflare.IntelIndicatorFeedPermissionDeleteResponse
+- intel.IntelPermissionListItem
+- intel.IntelPermissionsUpdate
Methods:
-- client.Intel.IndicatorFeeds.Permissions.New(ctx context.Context, params cloudflare.IntelIndicatorFeedPermissionNewParams) (cloudflare.IntelIndicatorFeedPermissionNewResponse, error)
-- client.Intel.IndicatorFeeds.Permissions.List(ctx context.Context, query cloudflare.IntelIndicatorFeedPermissionListParams) ([]cloudflare.IntelIndicatorFeedPermissionListResponse, error)
-- client.Intel.IndicatorFeeds.Permissions.Delete(ctx context.Context, params cloudflare.IntelIndicatorFeedPermissionDeleteParams) (cloudflare.IntelIndicatorFeedPermissionDeleteResponse, error)
+- client.Intel.IndicatorFeeds.Permissions.New(ctx context.Context, params intel.IndicatorFeedPermissionNewParams) (intel.IntelPermissionsUpdate, error)
+- client.Intel.IndicatorFeeds.Permissions.List(ctx context.Context, query intel.IndicatorFeedPermissionListParams) ([]intel.IntelPermissionListItem, error)
+- client.Intel.IndicatorFeeds.Permissions.Delete(ctx context.Context, params intel.IndicatorFeedPermissionDeleteParams) (intel.IntelPermissionsUpdate, error)
## Sinkholes
Response Types:
-- cloudflare.IntelSinkholeListResponse
+- intel.IntelSinkholesSinkholeItem
Methods:
-- client.Intel.Sinkholes.List(ctx context.Context, query cloudflare.IntelSinkholeListParams) ([]cloudflare.IntelSinkholeListResponse, error)
+- client.Intel.Sinkholes.List(ctx context.Context, query intel.SinkholeListParams) ([]intel.IntelSinkholesSinkholeItem, error)
# MagicTransit
@@ -3358,73 +3365,73 @@ Methods:
Response Types:
-- cloudflare.MagicTransitCfInterconnectUpdateResponse
-- cloudflare.MagicTransitCfInterconnectListResponse
-- cloudflare.MagicTransitCfInterconnectGetResponse
+- magic_transit.CfInterconnectUpdateResponse
+- magic_transit.CfInterconnectListResponse
+- magic_transit.CfInterconnectGetResponse
Methods:
-- client.MagicTransit.CfInterconnects.Update(ctx context.Context, accountIdentifier string, tunnelIdentifier string, body cloudflare.MagicTransitCfInterconnectUpdateParams) (cloudflare.MagicTransitCfInterconnectUpdateResponse, error)
-- client.MagicTransit.CfInterconnects.List(ctx context.Context, accountIdentifier string) (cloudflare.MagicTransitCfInterconnectListResponse, error)
-- client.MagicTransit.CfInterconnects.Get(ctx context.Context, accountIdentifier string, tunnelIdentifier string) (cloudflare.MagicTransitCfInterconnectGetResponse, error)
+- client.MagicTransit.CfInterconnects.Update(ctx context.Context, accountIdentifier string, tunnelIdentifier string, body magic_transit.CfInterconnectUpdateParams) (magic_transit.CfInterconnectUpdateResponse, error)
+- client.MagicTransit.CfInterconnects.List(ctx context.Context, accountIdentifier string) (magic_transit.CfInterconnectListResponse, error)
+- client.MagicTransit.CfInterconnects.Get(ctx context.Context, accountIdentifier string, tunnelIdentifier string) (magic_transit.CfInterconnectGetResponse, error)
## GRETunnels
Response Types:
-- cloudflare.MagicTransitGRETunnelNewResponse
-- cloudflare.MagicTransitGRETunnelUpdateResponse
-- cloudflare.MagicTransitGRETunnelListResponse
-- cloudflare.MagicTransitGRETunnelDeleteResponse
-- cloudflare.MagicTransitGRETunnelGetResponse
+- magic_transit.GRETunnelNewResponse
+- magic_transit.GRETunnelUpdateResponse
+- magic_transit.GRETunnelListResponse
+- magic_transit.GRETunnelDeleteResponse
+- magic_transit.GRETunnelGetResponse
Methods:
-- client.MagicTransit.GRETunnels.New(ctx context.Context, accountIdentifier string, body cloudflare.MagicTransitGRETunnelNewParams) (cloudflare.MagicTransitGRETunnelNewResponse, error)
-- client.MagicTransit.GRETunnels.Update(ctx context.Context, accountIdentifier string, tunnelIdentifier string, body cloudflare.MagicTransitGRETunnelUpdateParams) (cloudflare.MagicTransitGRETunnelUpdateResponse, error)
-- client.MagicTransit.GRETunnels.List(ctx context.Context, accountIdentifier string) (cloudflare.MagicTransitGRETunnelListResponse, error)
-- client.MagicTransit.GRETunnels.Delete(ctx context.Context, accountIdentifier string, tunnelIdentifier string) (cloudflare.MagicTransitGRETunnelDeleteResponse, error)
-- client.MagicTransit.GRETunnels.Get(ctx context.Context, accountIdentifier string, tunnelIdentifier string) (cloudflare.MagicTransitGRETunnelGetResponse, error)
+- client.MagicTransit.GRETunnels.New(ctx context.Context, accountIdentifier string, body magic_transit.GRETunnelNewParams) (magic_transit.GRETunnelNewResponse, error)
+- client.MagicTransit.GRETunnels.Update(ctx context.Context, accountIdentifier string, tunnelIdentifier string, body magic_transit.GRETunnelUpdateParams) (magic_transit.GRETunnelUpdateResponse, error)
+- client.MagicTransit.GRETunnels.List(ctx context.Context, accountIdentifier string) (magic_transit.GRETunnelListResponse, error)
+- client.MagicTransit.GRETunnels.Delete(ctx context.Context, accountIdentifier string, tunnelIdentifier string) (magic_transit.GRETunnelDeleteResponse, error)
+- client.MagicTransit.GRETunnels.Get(ctx context.Context, accountIdentifier string, tunnelIdentifier string) (magic_transit.GRETunnelGetResponse, error)
## IPSECTunnels
Response Types:
-- cloudflare.MagicTransitIPSECTunnelNewResponse
-- cloudflare.MagicTransitIPSECTunnelUpdateResponse
-- cloudflare.MagicTransitIPSECTunnelListResponse
-- cloudflare.MagicTransitIPSECTunnelDeleteResponse
-- cloudflare.MagicTransitIPSECTunnelGetResponse
-- cloudflare.MagicTransitIPSECTunnelPSKGenerateResponse
+- magic_transit.IPSECTunnelNewResponse
+- magic_transit.IPSECTunnelUpdateResponse
+- magic_transit.IPSECTunnelListResponse
+- magic_transit.IPSECTunnelDeleteResponse
+- magic_transit.IPSECTunnelGetResponse
+- magic_transit.IPSECTunnelPSKGenerateResponse
Methods:
-- client.MagicTransit.IPSECTunnels.New(ctx context.Context, accountIdentifier string, body cloudflare.MagicTransitIPSECTunnelNewParams) (cloudflare.MagicTransitIPSECTunnelNewResponse, error)
-- client.MagicTransit.IPSECTunnels.Update(ctx context.Context, accountIdentifier string, tunnelIdentifier string, body cloudflare.MagicTransitIPSECTunnelUpdateParams) (cloudflare.MagicTransitIPSECTunnelUpdateResponse, error)
-- client.MagicTransit.IPSECTunnels.List(ctx context.Context, accountIdentifier string) (cloudflare.MagicTransitIPSECTunnelListResponse, error)
-- client.MagicTransit.IPSECTunnels.Delete(ctx context.Context, accountIdentifier string, tunnelIdentifier string) (cloudflare.MagicTransitIPSECTunnelDeleteResponse, error)
-- client.MagicTransit.IPSECTunnels.Get(ctx context.Context, accountIdentifier string, tunnelIdentifier string) (cloudflare.MagicTransitIPSECTunnelGetResponse, error)
-- client.MagicTransit.IPSECTunnels.PSKGenerate(ctx context.Context, accountIdentifier string, tunnelIdentifier string) (cloudflare.MagicTransitIPSECTunnelPSKGenerateResponse, error)
+- client.MagicTransit.IPSECTunnels.New(ctx context.Context, accountIdentifier string, body magic_transit.IPSECTunnelNewParams) (magic_transit.IPSECTunnelNewResponse, error)
+- client.MagicTransit.IPSECTunnels.Update(ctx context.Context, accountIdentifier string, tunnelIdentifier string, body magic_transit.IPSECTunnelUpdateParams) (magic_transit.IPSECTunnelUpdateResponse, error)
+- client.MagicTransit.IPSECTunnels.List(ctx context.Context, accountIdentifier string) (magic_transit.IPSECTunnelListResponse, error)
+- client.MagicTransit.IPSECTunnels.Delete(ctx context.Context, accountIdentifier string, tunnelIdentifier string) (magic_transit.IPSECTunnelDeleteResponse, error)
+- client.MagicTransit.IPSECTunnels.Get(ctx context.Context, accountIdentifier string, tunnelIdentifier string) (magic_transit.IPSECTunnelGetResponse, error)
+- client.MagicTransit.IPSECTunnels.PSKGenerate(ctx context.Context, accountIdentifier string, tunnelIdentifier string) (magic_transit.IPSECTunnelPSKGenerateResponse, error)
## Routes
Response Types:
-- cloudflare.MagicTransitRouteNewResponse
-- cloudflare.MagicTransitRouteUpdateResponse
-- cloudflare.MagicTransitRouteListResponse
-- cloudflare.MagicTransitRouteDeleteResponse
-- cloudflare.MagicTransitRouteEmptyResponse
-- cloudflare.MagicTransitRouteGetResponse
+- magic_transit.RouteNewResponse
+- magic_transit.RouteUpdateResponse
+- magic_transit.RouteListResponse
+- magic_transit.RouteDeleteResponse
+- magic_transit.RouteEmptyResponse
+- magic_transit.RouteGetResponse
Methods:
-- client.MagicTransit.Routes.New(ctx context.Context, accountIdentifier string, body cloudflare.MagicTransitRouteNewParams) (cloudflare.MagicTransitRouteNewResponse, error)
-- client.MagicTransit.Routes.Update(ctx context.Context, accountIdentifier string, routeIdentifier string, body cloudflare.MagicTransitRouteUpdateParams) (cloudflare.MagicTransitRouteUpdateResponse, error)
-- client.MagicTransit.Routes.List(ctx context.Context, accountIdentifier string) (cloudflare.MagicTransitRouteListResponse, error)
-- client.MagicTransit.Routes.Delete(ctx context.Context, accountIdentifier string, routeIdentifier string) (cloudflare.MagicTransitRouteDeleteResponse, error)
-- client.MagicTransit.Routes.Empty(ctx context.Context, accountIdentifier string, body cloudflare.MagicTransitRouteEmptyParams) (cloudflare.MagicTransitRouteEmptyResponse, error)
-- client.MagicTransit.Routes.Get(ctx context.Context, accountIdentifier string, routeIdentifier string) (cloudflare.MagicTransitRouteGetResponse, error)
+- client.MagicTransit.Routes.New(ctx context.Context, accountIdentifier string, body magic_transit.RouteNewParams) (magic_transit.RouteNewResponse, error)
+- client.MagicTransit.Routes.Update(ctx context.Context, accountIdentifier string, routeIdentifier string, body magic_transit.RouteUpdateParams) (magic_transit.RouteUpdateResponse, error)
+- client.MagicTransit.Routes.List(ctx context.Context, accountIdentifier string) (magic_transit.RouteListResponse, error)
+- client.MagicTransit.Routes.Delete(ctx context.Context, accountIdentifier string, routeIdentifier string) (magic_transit.RouteDeleteResponse, error)
+- client.MagicTransit.Routes.Empty(ctx context.Context, accountIdentifier string, body magic_transit.RouteEmptyParams) (magic_transit.RouteEmptyResponse, error)
+- client.MagicTransit.Routes.Get(ctx context.Context, accountIdentifier string, routeIdentifier string) (magic_transit.RouteGetResponse, error)
# MagicNetworkMonitoring
@@ -3432,127 +3439,111 @@ Methods:
Response Types:
-- cloudflare.MagicNetworkMonitoringConfigNewResponse
-- cloudflare.MagicNetworkMonitoringConfigUpdateResponse
-- cloudflare.MagicNetworkMonitoringConfigDeleteResponse
-- cloudflare.MagicNetworkMonitoringConfigEditResponse
-- cloudflare.MagicNetworkMonitoringConfigGetResponse
+- magic_network_monitoring.MagicVisibilityMNMConfig
Methods:
-- client.MagicNetworkMonitoring.Configs.New(ctx context.Context, accountIdentifier interface{}) (cloudflare.MagicNetworkMonitoringConfigNewResponse, error)
-- client.MagicNetworkMonitoring.Configs.Update(ctx context.Context, accountIdentifier interface{}) (cloudflare.MagicNetworkMonitoringConfigUpdateResponse, error)
-- client.MagicNetworkMonitoring.Configs.Delete(ctx context.Context, accountIdentifier interface{}) (cloudflare.MagicNetworkMonitoringConfigDeleteResponse, error)
-- client.MagicNetworkMonitoring.Configs.Edit(ctx context.Context, accountIdentifier interface{}) (cloudflare.MagicNetworkMonitoringConfigEditResponse, error)
-- client.MagicNetworkMonitoring.Configs.Get(ctx context.Context, accountIdentifier interface{}) (cloudflare.MagicNetworkMonitoringConfigGetResponse, error)
+- client.MagicNetworkMonitoring.Configs.New(ctx context.Context, accountIdentifier interface{}) (magic_network_monitoring.MagicVisibilityMNMConfig, error)
+- client.MagicNetworkMonitoring.Configs.Update(ctx context.Context, accountIdentifier interface{}) (magic_network_monitoring.MagicVisibilityMNMConfig, error)
+- client.MagicNetworkMonitoring.Configs.Delete(ctx context.Context, accountIdentifier interface{}) (magic_network_monitoring.MagicVisibilityMNMConfig, error)
+- client.MagicNetworkMonitoring.Configs.Edit(ctx context.Context, accountIdentifier interface{}) (magic_network_monitoring.MagicVisibilityMNMConfig, error)
+- client.MagicNetworkMonitoring.Configs.Get(ctx context.Context, accountIdentifier interface{}) (magic_network_monitoring.MagicVisibilityMNMConfig, error)
### Full
-Response Types:
-
-- cloudflare.MagicNetworkMonitoringConfigFullGetResponse
-
Methods:
-- client.MagicNetworkMonitoring.Configs.Full.Get(ctx context.Context, accountIdentifier interface{}) (cloudflare.MagicNetworkMonitoringConfigFullGetResponse, error)
+- client.MagicNetworkMonitoring.Configs.Full.Get(ctx context.Context, accountIdentifier interface{}) (magic_network_monitoring.MagicVisibilityMNMConfig, error)
## Rules
Response Types:
-- cloudflare.MagicNetworkMonitoringRuleNewResponse
-- cloudflare.MagicNetworkMonitoringRuleUpdateResponse
-- cloudflare.MagicNetworkMonitoringRuleListResponse
-- cloudflare.MagicNetworkMonitoringRuleDeleteResponse
-- cloudflare.MagicNetworkMonitoringRuleEditResponse
-- cloudflare.MagicNetworkMonitoringRuleGetResponse
+- magic_network_monitoring.MagicVisibilityMNMRule
Methods:
-- client.MagicNetworkMonitoring.Rules.New(ctx context.Context, accountIdentifier interface{}) (cloudflare.MagicNetworkMonitoringRuleNewResponse, error)
-- client.MagicNetworkMonitoring.Rules.Update(ctx context.Context, accountIdentifier interface{}) (cloudflare.MagicNetworkMonitoringRuleUpdateResponse, error)
-- client.MagicNetworkMonitoring.Rules.List(ctx context.Context, accountIdentifier interface{}) ([]cloudflare.MagicNetworkMonitoringRuleListResponse, error)
-- client.MagicNetworkMonitoring.Rules.Delete(ctx context.Context, accountIdentifier interface{}, ruleIdentifier interface{}) (cloudflare.MagicNetworkMonitoringRuleDeleteResponse, error)
-- client.MagicNetworkMonitoring.Rules.Edit(ctx context.Context, accountIdentifier interface{}, ruleIdentifier interface{}) (cloudflare.MagicNetworkMonitoringRuleEditResponse, error)
-- client.MagicNetworkMonitoring.Rules.Get(ctx context.Context, accountIdentifier interface{}, ruleIdentifier interface{}) (cloudflare.MagicNetworkMonitoringRuleGetResponse, error)
+- client.MagicNetworkMonitoring.Rules.New(ctx context.Context, accountIdentifier interface{}) (magic_network_monitoring.MagicVisibilityMNMRule, error)
+- client.MagicNetworkMonitoring.Rules.Update(ctx context.Context, accountIdentifier interface{}) (magic_network_monitoring.MagicVisibilityMNMRule, error)
+- client.MagicNetworkMonitoring.Rules.List(ctx context.Context, accountIdentifier interface{}) ([]magic_network_monitoring.MagicVisibilityMNMRule, error)
+- client.MagicNetworkMonitoring.Rules.Delete(ctx context.Context, accountIdentifier interface{}, ruleIdentifier interface{}) (magic_network_monitoring.MagicVisibilityMNMRule, error)
+- client.MagicNetworkMonitoring.Rules.Edit(ctx context.Context, accountIdentifier interface{}, ruleIdentifier interface{}) (magic_network_monitoring.MagicVisibilityMNMRule, error)
+- client.MagicNetworkMonitoring.Rules.Get(ctx context.Context, accountIdentifier interface{}, ruleIdentifier interface{}) (magic_network_monitoring.MagicVisibilityMNMRule, error)
### Advertisements
Response Types:
-- cloudflare.MagicNetworkMonitoringRuleAdvertisementEditResponse
+- magic_network_monitoring.MagicVisibilityMNMRuleAdvertisable
Methods:
-- client.MagicNetworkMonitoring.Rules.Advertisements.Edit(ctx context.Context, accountIdentifier interface{}, ruleIdentifier interface{}) (cloudflare.MagicNetworkMonitoringRuleAdvertisementEditResponse, error)
+- client.MagicNetworkMonitoring.Rules.Advertisements.Edit(ctx context.Context, accountIdentifier interface{}, ruleIdentifier interface{}) (magic_network_monitoring.MagicVisibilityMNMRuleAdvertisable, error)
# MTLSCertificates
Response Types:
-- cloudflare.MTLSCertificateNewResponse
-- cloudflare.MTLSCertificateListResponse
-- cloudflare.MTLSCertificateDeleteResponse
-- cloudflare.MTLSCertificateGetResponse
+- mtls_certificates.TLSCertificatesAndHostnamesCertificateObjectPost
+- mtls_certificates.TLSCertificatesAndHostnamesComponentsSchemasCertificateObject
Methods:
-- client.MTLSCertificates.New(ctx context.Context, params cloudflare.MTLSCertificateNewParams) (cloudflare.MTLSCertificateNewResponse, error)
-- client.MTLSCertificates.List(ctx context.Context, query cloudflare.MTLSCertificateListParams) ([]cloudflare.MTLSCertificateListResponse, error)
-- client.MTLSCertificates.Delete(ctx context.Context, mtlsCertificateID string, body cloudflare.MTLSCertificateDeleteParams) (cloudflare.MTLSCertificateDeleteResponse, error)
-- client.MTLSCertificates.Get(ctx context.Context, mtlsCertificateID string, query cloudflare.MTLSCertificateGetParams) (cloudflare.MTLSCertificateGetResponse, error)
+- client.MTLSCertificates.New(ctx context.Context, params mtls_certificates.MTLSCertificateNewParams) (mtls_certificates.TLSCertificatesAndHostnamesCertificateObjectPost, error)
+- client.MTLSCertificates.List(ctx context.Context, query mtls_certificates.MTLSCertificateListParams) ([]mtls_certificates.TLSCertificatesAndHostnamesComponentsSchemasCertificateObject, error)
+- client.MTLSCertificates.Delete(ctx context.Context, mtlsCertificateID string, body mtls_certificates.MTLSCertificateDeleteParams) (mtls_certificates.TLSCertificatesAndHostnamesComponentsSchemasCertificateObject, error)
+- client.MTLSCertificates.Get(ctx context.Context, mtlsCertificateID string, query mtls_certificates.MTLSCertificateGetParams) (mtls_certificates.TLSCertificatesAndHostnamesComponentsSchemasCertificateObject, error)
## Associations
Response Types:
-- cloudflare.MTLSCertificateAssociationGetResponse
+- mtls_certificates.TLSCertificatesAndHostnamesAssociationObject
Methods:
-- client.MTLSCertificates.Associations.Get(ctx context.Context, mtlsCertificateID string, query cloudflare.MTLSCertificateAssociationGetParams) ([]cloudflare.MTLSCertificateAssociationGetResponse, error)
+- client.MTLSCertificates.Associations.Get(ctx context.Context, mtlsCertificateID string, query mtls_certificates.AssociationGetParams) ([]mtls_certificates.TLSCertificatesAndHostnamesAssociationObject, error)
# Pages
## Projects
+Params Types:
+
+- pages.PagesDeploymentsParam
+
Response Types:
-- cloudflare.PageProjectNewResponse
-- cloudflare.PageProjectListResponse
-- cloudflare.PageProjectDeleteResponse
-- cloudflare.PageProjectEditResponse
-- cloudflare.PageProjectGetResponse
-- cloudflare.PageProjectPurgeBuildCacheResponse
+- pages.PagesDeployments
+- pages.PagesProjects
+- pages.ProjectNewResponse
+- pages.ProjectDeleteResponse
+- pages.ProjectEditResponse
+- pages.ProjectPurgeBuildCacheResponse
Methods:
-- client.Pages.Projects.New(ctx context.Context, params cloudflare.PageProjectNewParams) (cloudflare.PageProjectNewResponse, error)
-- client.Pages.Projects.List(ctx context.Context, query cloudflare.PageProjectListParams) ([]cloudflare.PageProjectListResponse, error)
-- client.Pages.Projects.Delete(ctx context.Context, projectName string, body cloudflare.PageProjectDeleteParams) (cloudflare.PageProjectDeleteResponse, error)
-- client.Pages.Projects.Edit(ctx context.Context, projectName string, params cloudflare.PageProjectEditParams) (cloudflare.PageProjectEditResponse, error)
-- client.Pages.Projects.Get(ctx context.Context, projectName string, query cloudflare.PageProjectGetParams) (cloudflare.PageProjectGetResponse, error)
-- client.Pages.Projects.PurgeBuildCache(ctx context.Context, projectName string, body cloudflare.PageProjectPurgeBuildCacheParams) (cloudflare.PageProjectPurgeBuildCacheResponse, error)
+- client.Pages.Projects.New(ctx context.Context, params pages.ProjectNewParams) (pages.ProjectNewResponse, error)
+- client.Pages.Projects.List(ctx context.Context, query pages.ProjectListParams) ([]pages.PagesDeployments, error)
+- client.Pages.Projects.Delete(ctx context.Context, projectName string, body pages.ProjectDeleteParams) (pages.ProjectDeleteResponse, error)
+- client.Pages.Projects.Edit(ctx context.Context, projectName string, params pages.ProjectEditParams) (pages.ProjectEditResponse, error)
+- client.Pages.Projects.Get(ctx context.Context, projectName string, query pages.ProjectGetParams) (pages.PagesProjects, error)
+- client.Pages.Projects.PurgeBuildCache(ctx context.Context, projectName string, body pages.ProjectPurgeBuildCacheParams) (pages.ProjectPurgeBuildCacheResponse, error)
### Deployments
Response Types:
-- cloudflare.PageProjectDeploymentNewResponse
-- cloudflare.PageProjectDeploymentListResponse
-- cloudflare.PageProjectDeploymentDeleteResponse
-- cloudflare.PageProjectDeploymentGetResponse
-- cloudflare.PageProjectDeploymentRetryResponse
-- cloudflare.PageProjectDeploymentRollbackResponse
+- pages.ProjectDeploymentDeleteResponse
Methods:
-- client.Pages.Projects.Deployments.New(ctx context.Context, projectName string, params cloudflare.PageProjectDeploymentNewParams) (cloudflare.PageProjectDeploymentNewResponse, error)
-- client.Pages.Projects.Deployments.List(ctx context.Context, projectName string, query cloudflare.PageProjectDeploymentListParams) ([]cloudflare.PageProjectDeploymentListResponse, error)
-- client.Pages.Projects.Deployments.Delete(ctx context.Context, projectName string, deploymentID string, body cloudflare.PageProjectDeploymentDeleteParams) (cloudflare.PageProjectDeploymentDeleteResponse, error)
-- client.Pages.Projects.Deployments.Get(ctx context.Context, projectName string, deploymentID string, query cloudflare.PageProjectDeploymentGetParams) (cloudflare.PageProjectDeploymentGetResponse, error)
-- client.Pages.Projects.Deployments.Retry(ctx context.Context, projectName string, deploymentID string, body cloudflare.PageProjectDeploymentRetryParams) (cloudflare.PageProjectDeploymentRetryResponse, error)
-- client.Pages.Projects.Deployments.Rollback(ctx context.Context, projectName string, deploymentID string, body cloudflare.PageProjectDeploymentRollbackParams) (cloudflare.PageProjectDeploymentRollbackResponse, error)
+- client.Pages.Projects.Deployments.New(ctx context.Context, projectName string, params pages.ProjectDeploymentNewParams) (pages.PagesDeployments, error)
+- client.Pages.Projects.Deployments.List(ctx context.Context, projectName string, query pages.ProjectDeploymentListParams) ([]pages.PagesDeployments, error)
+- client.Pages.Projects.Deployments.Delete(ctx context.Context, projectName string, deploymentID string, body pages.ProjectDeploymentDeleteParams) (pages.ProjectDeploymentDeleteResponse, error)
+- client.Pages.Projects.Deployments.Get(ctx context.Context, projectName string, deploymentID string, query pages.ProjectDeploymentGetParams) (pages.PagesDeployments, error)
+- client.Pages.Projects.Deployments.Retry(ctx context.Context, projectName string, deploymentID string, body pages.ProjectDeploymentRetryParams) (pages.PagesDeployments, error)
+- client.Pages.Projects.Deployments.Rollback(ctx context.Context, projectName string, deploymentID string, body pages.ProjectDeploymentRollbackParams) (pages.PagesDeployments, error)
#### History
@@ -3560,64 +3551,62 @@ Methods:
Response Types:
-- cloudflare.PageProjectDeploymentHistoryLogGetResponse
+- pages.ProjectDeploymentHistoryLogGetResponse
Methods:
-- client.Pages.Projects.Deployments.History.Logs.Get(ctx context.Context, projectName string, deploymentID string, query cloudflare.PageProjectDeploymentHistoryLogGetParams) (cloudflare.PageProjectDeploymentHistoryLogGetResponse, error)
+- client.Pages.Projects.Deployments.History.Logs.Get(ctx context.Context, projectName string, deploymentID string, query pages.ProjectDeploymentHistoryLogGetParams) (pages.ProjectDeploymentHistoryLogGetResponse, error)
### Domains
Response Types:
-- cloudflare.PageProjectDomainNewResponse
-- cloudflare.PageProjectDomainListResponse
-- cloudflare.PageProjectDomainDeleteResponse
-- cloudflare.PageProjectDomainEditResponse
-- cloudflare.PageProjectDomainGetResponse
+- pages.ProjectDomainNewResponse
+- pages.ProjectDomainListResponse
+- pages.ProjectDomainDeleteResponse
+- pages.ProjectDomainEditResponse
+- pages.ProjectDomainGetResponse
Methods:
-- client.Pages.Projects.Domains.New(ctx context.Context, projectName string, params cloudflare.PageProjectDomainNewParams) (cloudflare.PageProjectDomainNewResponse, error)
-- client.Pages.Projects.Domains.List(ctx context.Context, projectName string, query cloudflare.PageProjectDomainListParams) ([]cloudflare.PageProjectDomainListResponse, error)
-- client.Pages.Projects.Domains.Delete(ctx context.Context, projectName string, domainName string, body cloudflare.PageProjectDomainDeleteParams) (cloudflare.PageProjectDomainDeleteResponse, error)
-- client.Pages.Projects.Domains.Edit(ctx context.Context, projectName string, domainName string, body cloudflare.PageProjectDomainEditParams) (cloudflare.PageProjectDomainEditResponse, error)
-- client.Pages.Projects.Domains.Get(ctx context.Context, projectName string, domainName string, query cloudflare.PageProjectDomainGetParams) (cloudflare.PageProjectDomainGetResponse, error)
+- client.Pages.Projects.Domains.New(ctx context.Context, projectName string, params pages.ProjectDomainNewParams) (pages.ProjectDomainNewResponse, error)
+- client.Pages.Projects.Domains.List(ctx context.Context, projectName string, query pages.ProjectDomainListParams) ([]pages.ProjectDomainListResponse, error)
+- client.Pages.Projects.Domains.Delete(ctx context.Context, projectName string, domainName string, body pages.ProjectDomainDeleteParams) (pages.ProjectDomainDeleteResponse, error)
+- client.Pages.Projects.Domains.Edit(ctx context.Context, projectName string, domainName string, body pages.ProjectDomainEditParams) (pages.ProjectDomainEditResponse, error)
+- client.Pages.Projects.Domains.Get(ctx context.Context, projectName string, domainName string, query pages.ProjectDomainGetParams) (pages.ProjectDomainGetResponse, error)
# PCAPs
Response Types:
-- cloudflare.PCAPNewResponse
-- cloudflare.PCAPListResponse
-- cloudflare.PCAPGetResponse
+- pcaps.PCAPNewResponse
+- pcaps.PCAPListResponse
+- pcaps.PCAPGetResponse
Methods:
-- client.PCAPs.New(ctx context.Context, params cloudflare.PCAPNewParams) (cloudflare.PCAPNewResponse, error)
-- client.PCAPs.List(ctx context.Context, query cloudflare.PCAPListParams) ([]cloudflare.PCAPListResponse, error)
-- client.PCAPs.Get(ctx context.Context, pcapID string, query cloudflare.PCAPGetParams) (cloudflare.PCAPGetResponse, error)
+- client.PCAPs.New(ctx context.Context, params pcaps.PCAPNewParams) (pcaps.PCAPNewResponse, error)
+- client.PCAPs.List(ctx context.Context, query pcaps.PCAPListParams) ([]pcaps.PCAPListResponse, error)
+- client.PCAPs.Get(ctx context.Context, pcapID string, query pcaps.PCAPGetParams) (pcaps.PCAPGetResponse, error)
## Ownerships
Response Types:
-- cloudflare.PCAPOwnershipNewResponse
-- cloudflare.PCAPOwnershipGetResponse
-- cloudflare.PCAPOwnershipValidateResponse
+- pcaps.MagicVisibilityPCAPsOwnership
Methods:
-- client.PCAPs.Ownerships.New(ctx context.Context, params cloudflare.PCAPOwnershipNewParams) (cloudflare.PCAPOwnershipNewResponse, error)
-- client.PCAPs.Ownerships.Delete(ctx context.Context, ownershipID string, body cloudflare.PCAPOwnershipDeleteParams) error
-- client.PCAPs.Ownerships.Get(ctx context.Context, query cloudflare.PCAPOwnershipGetParams) ([]cloudflare.PCAPOwnershipGetResponse, error)
-- client.PCAPs.Ownerships.Validate(ctx context.Context, params cloudflare.PCAPOwnershipValidateParams) (cloudflare.PCAPOwnershipValidateResponse, error)
+- client.PCAPs.Ownerships.New(ctx context.Context, params pcaps.OwnershipNewParams) (pcaps.MagicVisibilityPCAPsOwnership, error)
+- client.PCAPs.Ownerships.Delete(ctx context.Context, ownershipID string, body pcaps.OwnershipDeleteParams) error
+- client.PCAPs.Ownerships.Get(ctx context.Context, query pcaps.OwnershipGetParams) ([]pcaps.MagicVisibilityPCAPsOwnership, error)
+- client.PCAPs.Ownerships.Validate(ctx context.Context, params pcaps.OwnershipValidateParams) (pcaps.MagicVisibilityPCAPsOwnership, error)
## Downloads
Methods:
-- client.PCAPs.Downloads.Get(ctx context.Context, pcapID string, query cloudflare.PCAPDownloadGetParams) (http.Response, error)
+- client.PCAPs.Downloads.Get(ctx context.Context, pcapID string, query pcaps.DownloadGetParams) (http.Response, error)
# Registrar
@@ -3625,15 +3614,15 @@ Methods:
Response Types:
-- cloudflare.RegistrarDomainUpdateResponse
-- cloudflare.RegistrarDomainListResponse
-- cloudflare.RegistrarDomainGetResponse
+- registrar.DomainUpdateResponse
+- registrar.DomainListResponse
+- registrar.DomainGetResponse
Methods:
-- client.Registrar.Domains.Update(ctx context.Context, domainName string, params cloudflare.RegistrarDomainUpdateParams) (cloudflare.RegistrarDomainUpdateResponse, error)
-- client.Registrar.Domains.List(ctx context.Context, query cloudflare.RegistrarDomainListParams) ([]cloudflare.RegistrarDomainListResponse, error)
-- client.Registrar.Domains.Get(ctx context.Context, domainName string, query cloudflare.RegistrarDomainGetParams) (cloudflare.RegistrarDomainGetResponse, error)
+- client.Registrar.Domains.Update(ctx context.Context, domainName string, params registrar.DomainUpdateParams) (registrar.DomainUpdateResponse, error)
+- client.Registrar.Domains.List(ctx context.Context, query registrar.DomainListParams) ([]registrar.DomainListResponse, error)
+- client.Registrar.Domains.Get(ctx context.Context, domainName string, query registrar.DomainGetParams) (registrar.DomainGetResponse, error)
# RequestTracers
@@ -3641,12 +3630,12 @@ Methods:
Response Types:
-- cloudflare.RequestTracerTrace
-- cloudflare.RequestTracerTraceNewResponse
+- request_tracers.RequestTracerTrace
+- request_tracers.TraceNewResponse
Methods:
-- client.RequestTracers.Traces.New(ctx context.Context, accountIdentifier string, body cloudflare.RequestTracerTraceNewParams) (cloudflare.RequestTracerTraceNewResponse, error)
+- client.RequestTracers.Traces.New(ctx context.Context, accountIdentifier string, body request_tracers.TraceNewParams) (request_tracers.TraceNewResponse, error)
# Rules
@@ -3654,47 +3643,47 @@ Methods:
Response Types:
-- cloudflare.RuleListNewResponse
-- cloudflare.RuleListUpdateResponse
-- cloudflare.RuleListListResponse
-- cloudflare.RuleListDeleteResponse
-- cloudflare.RuleListGetResponse
+- rules.ListsList
+- rules.ListNewResponse
+- rules.ListUpdateResponse
+- rules.ListDeleteResponse
+- rules.ListGetResponse
Methods:
-- client.Rules.Lists.New(ctx context.Context, params cloudflare.RuleListNewParams) ([]cloudflare.RuleListNewResponse, error)
-- client.Rules.Lists.Update(ctx context.Context, listID string, params cloudflare.RuleListUpdateParams) ([]cloudflare.RuleListUpdateResponse, error)
-- client.Rules.Lists.List(ctx context.Context, query cloudflare.RuleListListParams) ([]cloudflare.RuleListListResponse, error)
-- client.Rules.Lists.Delete(ctx context.Context, listID string, body cloudflare.RuleListDeleteParams) (cloudflare.RuleListDeleteResponse, error)
-- client.Rules.Lists.Get(ctx context.Context, listID string, query cloudflare.RuleListGetParams) ([]cloudflare.RuleListGetResponse, error)
+- client.Rules.Lists.New(ctx context.Context, params rules.ListNewParams) (rules.ListsList, error)
+- client.Rules.Lists.Update(ctx context.Context, listID string, params rules.ListUpdateParams) (rules.ListsList, error)
+- client.Rules.Lists.List(ctx context.Context, query rules.ListListParams) ([]rules.ListsList, error)
+- client.Rules.Lists.Delete(ctx context.Context, listID string, body rules.ListDeleteParams) (rules.ListDeleteResponse, error)
+- client.Rules.Lists.Get(ctx context.Context, listID string, query rules.ListGetParams) (rules.ListsList, error)
### BulkOperations
Response Types:
-- cloudflare.RuleListBulkOperationGetResponse
+- rules.ListBulkOperationGetResponse
Methods:
-- client.Rules.Lists.BulkOperations.Get(ctx context.Context, accountIdentifier string, operationID string) ([]cloudflare.RuleListBulkOperationGetResponse, error)
+- client.Rules.Lists.BulkOperations.Get(ctx context.Context, accountIdentifier string, operationID string) ([]rules.ListBulkOperationGetResponse, error)
### Items
Response Types:
-- cloudflare.RuleListItemNewResponse
-- cloudflare.RuleListItemUpdateResponse
-- cloudflare.RuleListItemListResponse
-- cloudflare.RuleListItemDeleteResponse
-- cloudflare.RuleListItemGetResponse
+- rules.ListItemNewResponse
+- rules.ListItemUpdateResponse
+- rules.ListItemListResponse
+- rules.ListItemDeleteResponse
+- rules.ListItemGetResponse
Methods:
-- client.Rules.Lists.Items.New(ctx context.Context, listID string, params cloudflare.RuleListItemNewParams) (cloudflare.RuleListItemNewResponse, error)
-- client.Rules.Lists.Items.Update(ctx context.Context, listID string, params cloudflare.RuleListItemUpdateParams) (cloudflare.RuleListItemUpdateResponse, error)
-- client.Rules.Lists.Items.List(ctx context.Context, listID string, params cloudflare.RuleListItemListParams) ([]cloudflare.RuleListItemListResponse, error)
-- client.Rules.Lists.Items.Delete(ctx context.Context, listID string, params cloudflare.RuleListItemDeleteParams) (cloudflare.RuleListItemDeleteResponse, error)
-- client.Rules.Lists.Items.Get(ctx context.Context, accountIdentifier string, listID string, itemID string) (cloudflare.RuleListItemGetResponse, error)
+- client.Rules.Lists.Items.New(ctx context.Context, listID string, params rules.ListItemNewParams) (rules.ListItemNewResponse, error)
+- client.Rules.Lists.Items.Update(ctx context.Context, listID string, params rules.ListItemUpdateParams) (rules.ListItemUpdateResponse, error)
+- client.Rules.Lists.Items.List(ctx context.Context, listID string, params rules.ListItemListParams) ([]rules.ListItemListResponse, error)
+- client.Rules.Lists.Items.Delete(ctx context.Context, listID string, params rules.ListItemDeleteParams) (rules.ListItemDeleteResponse, error)
+- client.Rules.Lists.Items.Get(ctx context.Context, accountIdentifier string, listID string, itemID string) (rules.ListItemGetResponse, error)
# Storage
@@ -3702,207 +3691,196 @@ Methods:
Response Types:
-- cloudflare.StorageAnalyticsListResponse
-- cloudflare.StorageAnalyticsStoredResponse
+- storage.WorkersKVComponentsSchemasResult
+- storage.WorkersKVSchemasResult
Methods:
-- client.Storage.Analytics.List(ctx context.Context, params cloudflare.StorageAnalyticsListParams) (cloudflare.StorageAnalyticsListResponse, error)
-- client.Storage.Analytics.Stored(ctx context.Context, params cloudflare.StorageAnalyticsStoredParams) (cloudflare.StorageAnalyticsStoredResponse, error)
+- client.Storage.Analytics.List(ctx context.Context, params storage.AnalyticsListParams) (storage.WorkersKVSchemasResult, error)
+- client.Storage.Analytics.Stored(ctx context.Context, params storage.AnalyticsStoredParams) (storage.WorkersKVComponentsSchemasResult, error)
# Stream
Response Types:
-- cloudflare.StreamListResponse
-- cloudflare.StreamGetResponse
+- stream.StreamVideos
Methods:
-- client.Stream.New(ctx context.Context, params cloudflare.StreamNewParams) error
-- client.Stream.List(ctx context.Context, params cloudflare.StreamListParams) ([]cloudflare.StreamListResponse, error)
-- client.Stream.Delete(ctx context.Context, identifier string, body cloudflare.StreamDeleteParams) error
-- client.Stream.Get(ctx context.Context, identifier string, query cloudflare.StreamGetParams) (cloudflare.StreamGetResponse, error)
+- client.Stream.New(ctx context.Context, params stream.StreamNewParams) error
+- client.Stream.List(ctx context.Context, params stream.StreamListParams) ([]stream.StreamVideos, error)
+- client.Stream.Delete(ctx context.Context, identifier string, body stream.StreamDeleteParams) error
+- client.Stream.Get(ctx context.Context, identifier string, query stream.StreamGetParams) (stream.StreamVideos, error)
## AudioTracks
Response Types:
-- cloudflare.StreamAudioTrackDeleteResponse
-- cloudflare.StreamAudioTrackCopyResponse
-- cloudflare.StreamAudioTrackEditResponse
-- cloudflare.StreamAudioTrackGetResponse
+- stream.StreamAdditionalAudio
+- stream.AudioTrackDeleteResponse
Methods:
-- client.Stream.AudioTracks.Delete(ctx context.Context, identifier string, audioIdentifier string, body cloudflare.StreamAudioTrackDeleteParams) (cloudflare.StreamAudioTrackDeleteResponse, error)
-- client.Stream.AudioTracks.Copy(ctx context.Context, identifier string, params cloudflare.StreamAudioTrackCopyParams) (cloudflare.StreamAudioTrackCopyResponse, error)
-- client.Stream.AudioTracks.Edit(ctx context.Context, identifier string, audioIdentifier string, params cloudflare.StreamAudioTrackEditParams) (cloudflare.StreamAudioTrackEditResponse, error)
-- client.Stream.AudioTracks.Get(ctx context.Context, identifier string, query cloudflare.StreamAudioTrackGetParams) ([]cloudflare.StreamAudioTrackGetResponse, error)
+- client.Stream.AudioTracks.Delete(ctx context.Context, identifier string, audioIdentifier string, body stream.AudioTrackDeleteParams) (stream.AudioTrackDeleteResponse, error)
+- client.Stream.AudioTracks.Copy(ctx context.Context, identifier string, params stream.AudioTrackCopyParams) (stream.StreamAdditionalAudio, error)
+- client.Stream.AudioTracks.Edit(ctx context.Context, identifier string, audioIdentifier string, params stream.AudioTrackEditParams) (stream.StreamAdditionalAudio, error)
+- client.Stream.AudioTracks.Get(ctx context.Context, identifier string, query stream.AudioTrackGetParams) ([]stream.StreamAdditionalAudio, error)
## Videos
Response Types:
-- cloudflare.StreamVideoStorageUsageResponse
+- stream.VideoStorageUsageResponse
Methods:
-- client.Stream.Videos.StorageUsage(ctx context.Context, params cloudflare.StreamVideoStorageUsageParams) (cloudflare.StreamVideoStorageUsageResponse, error)
+- client.Stream.Videos.StorageUsage(ctx context.Context, params stream.VideoStorageUsageParams) (stream.VideoStorageUsageResponse, error)
## Clips
Response Types:
-- cloudflare.StreamClipNewResponse
+- stream.StreamClipping
Methods:
-- client.Stream.Clips.New(ctx context.Context, params cloudflare.StreamClipNewParams) (cloudflare.StreamClipNewResponse, error)
+- client.Stream.Clips.New(ctx context.Context, params stream.ClipNewParams) (stream.StreamClipping, error)
## Copies
-Response Types:
-
-- cloudflare.StreamCopyNewResponse
-
Methods:
-- client.Stream.Copies.New(ctx context.Context, params cloudflare.StreamCopyNewParams) (cloudflare.StreamCopyNewResponse, error)
+- client.Stream.Copies.New(ctx context.Context, params stream.CopyNewParams) (stream.StreamVideos, error)
## DirectUploads
Response Types:
-- cloudflare.StreamDirectUploadNewResponse
+- stream.DirectUploadNewResponse
Methods:
-- client.Stream.DirectUploads.New(ctx context.Context, params cloudflare.StreamDirectUploadNewParams) (cloudflare.StreamDirectUploadNewResponse, error)
+- client.Stream.DirectUploads.New(ctx context.Context, params stream.DirectUploadNewParams) (stream.DirectUploadNewResponse, error)
## Keys
Response Types:
-- cloudflare.StreamKeyNewResponse
-- cloudflare.StreamKeyDeleteResponse
-- cloudflare.StreamKeyGetResponse
+- stream.StreamKeys
+- stream.KeyDeleteResponse
+- stream.KeyGetResponse
Methods:
-- client.Stream.Keys.New(ctx context.Context, body cloudflare.StreamKeyNewParams) (cloudflare.StreamKeyNewResponse, error)
-- client.Stream.Keys.Delete(ctx context.Context, identifier string, body cloudflare.StreamKeyDeleteParams) (cloudflare.StreamKeyDeleteResponse, error)
-- client.Stream.Keys.Get(ctx context.Context, query cloudflare.StreamKeyGetParams) ([]cloudflare.StreamKeyGetResponse, error)
+- client.Stream.Keys.New(ctx context.Context, body stream.KeyNewParams) (stream.StreamKeys, error)
+- client.Stream.Keys.Delete(ctx context.Context, identifier string, body stream.KeyDeleteParams) (stream.KeyDeleteResponse, error)
+- client.Stream.Keys.Get(ctx context.Context, query stream.KeyGetParams) ([]stream.KeyGetResponse, error)
## LiveInputs
Response Types:
-- cloudflare.StreamLiveInputNewResponse
-- cloudflare.StreamLiveInputUpdateResponse
-- cloudflare.StreamLiveInputListResponse
-- cloudflare.StreamLiveInputGetResponse
+- stream.StreamLiveInput
+- stream.LiveInputListResponse
Methods:
-- client.Stream.LiveInputs.New(ctx context.Context, params cloudflare.StreamLiveInputNewParams) (cloudflare.StreamLiveInputNewResponse, error)
-- client.Stream.LiveInputs.Update(ctx context.Context, liveInputIdentifier string, params cloudflare.StreamLiveInputUpdateParams) (cloudflare.StreamLiveInputUpdateResponse, error)
-- client.Stream.LiveInputs.List(ctx context.Context, params cloudflare.StreamLiveInputListParams) (cloudflare.StreamLiveInputListResponse, error)
-- client.Stream.LiveInputs.Delete(ctx context.Context, liveInputIdentifier string, body cloudflare.StreamLiveInputDeleteParams) error
-- client.Stream.LiveInputs.Get(ctx context.Context, liveInputIdentifier string, query cloudflare.StreamLiveInputGetParams) (cloudflare.StreamLiveInputGetResponse, error)
+- client.Stream.LiveInputs.New(ctx context.Context, params stream.LiveInputNewParams) (stream.StreamLiveInput, error)
+- client.Stream.LiveInputs.Update(ctx context.Context, liveInputIdentifier string, params stream.LiveInputUpdateParams) (stream.StreamLiveInput, error)
+- client.Stream.LiveInputs.List(ctx context.Context, params stream.LiveInputListParams) (stream.LiveInputListResponse, error)
+- client.Stream.LiveInputs.Delete(ctx context.Context, liveInputIdentifier string, body stream.LiveInputDeleteParams) error
+- client.Stream.LiveInputs.Get(ctx context.Context, liveInputIdentifier string, query stream.LiveInputGetParams) (stream.StreamLiveInput, error)
### Outputs
Response Types:
-- cloudflare.StreamLiveInputOutputNewResponse
-- cloudflare.StreamLiveInputOutputUpdateResponse
-- cloudflare.StreamLiveInputOutputListResponse
+- stream.StreamOutput
Methods:
-- client.Stream.LiveInputs.Outputs.New(ctx context.Context, liveInputIdentifier string, params cloudflare.StreamLiveInputOutputNewParams) (cloudflare.StreamLiveInputOutputNewResponse, error)
-- client.Stream.LiveInputs.Outputs.Update(ctx context.Context, liveInputIdentifier string, outputIdentifier string, params cloudflare.StreamLiveInputOutputUpdateParams) (cloudflare.StreamLiveInputOutputUpdateResponse, error)
-- client.Stream.LiveInputs.Outputs.List(ctx context.Context, liveInputIdentifier string, query cloudflare.StreamLiveInputOutputListParams) ([]cloudflare.StreamLiveInputOutputListResponse, error)
-- client.Stream.LiveInputs.Outputs.Delete(ctx context.Context, liveInputIdentifier string, outputIdentifier string, body cloudflare.StreamLiveInputOutputDeleteParams) error
+- client.Stream.LiveInputs.Outputs.New(ctx context.Context, liveInputIdentifier string, params stream.LiveInputOutputNewParams) (stream.StreamOutput, error)
+- client.Stream.LiveInputs.Outputs.Update(ctx context.Context, liveInputIdentifier string, outputIdentifier string, params stream.LiveInputOutputUpdateParams) (stream.StreamOutput, error)
+- client.Stream.LiveInputs.Outputs.List(ctx context.Context, liveInputIdentifier string, query stream.LiveInputOutputListParams) ([]stream.StreamOutput, error)
+- client.Stream.LiveInputs.Outputs.Delete(ctx context.Context, liveInputIdentifier string, outputIdentifier string, body stream.LiveInputOutputDeleteParams) error
## Watermarks
Response Types:
-- cloudflare.StreamWatermarkNewResponse
-- cloudflare.StreamWatermarkListResponse
-- cloudflare.StreamWatermarkDeleteResponse
-- cloudflare.StreamWatermarkGetResponse
+- stream.StreamWatermarks
+- stream.WatermarkNewResponse
+- stream.WatermarkDeleteResponse
+- stream.WatermarkGetResponse
Methods:
-- client.Stream.Watermarks.New(ctx context.Context, params cloudflare.StreamWatermarkNewParams) (cloudflare.StreamWatermarkNewResponse, error)
-- client.Stream.Watermarks.List(ctx context.Context, query cloudflare.StreamWatermarkListParams) ([]cloudflare.StreamWatermarkListResponse, error)
-- client.Stream.Watermarks.Delete(ctx context.Context, identifier string, body cloudflare.StreamWatermarkDeleteParams) (cloudflare.StreamWatermarkDeleteResponse, error)
-- client.Stream.Watermarks.Get(ctx context.Context, identifier string, query cloudflare.StreamWatermarkGetParams) (cloudflare.StreamWatermarkGetResponse, error)
+- client.Stream.Watermarks.New(ctx context.Context, params stream.WatermarkNewParams) (stream.WatermarkNewResponse, error)
+- client.Stream.Watermarks.List(ctx context.Context, query stream.WatermarkListParams) ([]stream.StreamWatermarks, error)
+- client.Stream.Watermarks.Delete(ctx context.Context, identifier string, body stream.WatermarkDeleteParams) (stream.WatermarkDeleteResponse, error)
+- client.Stream.Watermarks.Get(ctx context.Context, identifier string, query stream.WatermarkGetParams) (stream.WatermarkGetResponse, error)
## Webhooks
Response Types:
-- cloudflare.StreamWebhookUpdateResponse
-- cloudflare.StreamWebhookDeleteResponse
-- cloudflare.StreamWebhookGetResponse
+- stream.WebhookUpdateResponse
+- stream.WebhookDeleteResponse
+- stream.WebhookGetResponse
Methods:
-- client.Stream.Webhooks.Update(ctx context.Context, params cloudflare.StreamWebhookUpdateParams) (cloudflare.StreamWebhookUpdateResponse, error)
-- client.Stream.Webhooks.Delete(ctx context.Context, body cloudflare.StreamWebhookDeleteParams) (cloudflare.StreamWebhookDeleteResponse, error)
-- client.Stream.Webhooks.Get(ctx context.Context, query cloudflare.StreamWebhookGetParams) (cloudflare.StreamWebhookGetResponse, error)
+- client.Stream.Webhooks.Update(ctx context.Context, params stream.WebhookUpdateParams) (stream.WebhookUpdateResponse, error)
+- client.Stream.Webhooks.Delete(ctx context.Context, body stream.WebhookDeleteParams) (stream.WebhookDeleteResponse, error)
+- client.Stream.Webhooks.Get(ctx context.Context, query stream.WebhookGetParams) (stream.WebhookGetResponse, error)
## Captions
Response Types:
-- cloudflare.StreamCaptionUpdateResponse
-- cloudflare.StreamCaptionDeleteResponse
-- cloudflare.StreamCaptionGetResponse
+- stream.StreamCaptions
+- stream.CaptionUpdateResponse
+- stream.CaptionDeleteResponse
Methods:
-- client.Stream.Captions.Update(ctx context.Context, identifier string, language string, params cloudflare.StreamCaptionUpdateParams) (cloudflare.StreamCaptionUpdateResponse, error)
-- client.Stream.Captions.Delete(ctx context.Context, identifier string, language string, body cloudflare.StreamCaptionDeleteParams) (cloudflare.StreamCaptionDeleteResponse, error)
-- client.Stream.Captions.Get(ctx context.Context, identifier string, query cloudflare.StreamCaptionGetParams) ([]cloudflare.StreamCaptionGetResponse, error)
+- client.Stream.Captions.Update(ctx context.Context, identifier string, language string, params stream.CaptionUpdateParams) (stream.CaptionUpdateResponse, error)
+- client.Stream.Captions.Delete(ctx context.Context, identifier string, language string, body stream.CaptionDeleteParams) (stream.CaptionDeleteResponse, error)
+- client.Stream.Captions.Get(ctx context.Context, identifier string, query stream.CaptionGetParams) ([]stream.StreamCaptions, error)
## Downloads
Response Types:
-- cloudflare.StreamDownloadNewResponse
-- cloudflare.StreamDownloadDeleteResponse
-- cloudflare.StreamDownloadGetResponse
+- stream.DownloadNewResponse
+- stream.DownloadDeleteResponse
+- stream.DownloadGetResponse
Methods:
-- client.Stream.Downloads.New(ctx context.Context, identifier string, body cloudflare.StreamDownloadNewParams) (cloudflare.StreamDownloadNewResponse, error)
-- client.Stream.Downloads.Delete(ctx context.Context, identifier string, body cloudflare.StreamDownloadDeleteParams) (cloudflare.StreamDownloadDeleteResponse, error)
-- client.Stream.Downloads.Get(ctx context.Context, identifier string, query cloudflare.StreamDownloadGetParams) (cloudflare.StreamDownloadGetResponse, error)
+- client.Stream.Downloads.New(ctx context.Context, identifier string, body stream.DownloadNewParams) (stream.DownloadNewResponse, error)
+- client.Stream.Downloads.Delete(ctx context.Context, identifier string, body stream.DownloadDeleteParams) (stream.DownloadDeleteResponse, error)
+- client.Stream.Downloads.Get(ctx context.Context, identifier string, query stream.DownloadGetParams) (stream.DownloadGetResponse, error)
## Embeds
Response Types:
-- cloudflare.StreamEmbedGetResponse
+- stream.EmbedGetResponse
Methods:
-- client.Stream.Embeds.Get(ctx context.Context, identifier string, query cloudflare.StreamEmbedGetParams) (cloudflare.StreamEmbedGetResponse, error)
+- client.Stream.Embeds.Get(ctx context.Context, identifier string, query stream.EmbedGetParams) (stream.EmbedGetResponse, error)
## Tokens
Response Types:
-- cloudflare.StreamTokenNewResponse
+- stream.TokenNewResponse
Methods:
-- client.Stream.Tokens.New(ctx context.Context, identifier string, params cloudflare.StreamTokenNewParams) (cloudflare.StreamTokenNewResponse, error)
+- client.Stream.Tokens.New(ctx context.Context, identifier string, params stream.TokenNewParams) (stream.TokenNewResponse, error)
# Alerting
@@ -3910,11 +3888,11 @@ Methods:
Response Types:
-- cloudflare.AlertingV3ListResponse
+- alerting.V3ListResponse
Methods:
-- client.Alerting.V3.List(ctx context.Context, query cloudflare.AlertingV3ListParams) (cloudflare.AlertingV3ListResponse, error)
+- client.Alerting.V3.List(ctx context.Context, query alerting.V3ListParams) (alerting.V3ListResponse, error)
### Destinations
@@ -3922,73 +3900,71 @@ Methods:
Response Types:
-- cloudflare.AlertingV3DestinationEligibleGetResponse
+- alerting.V3DestinationEligibleGetResponse
Methods:
-- client.Alerting.V3.Destinations.Eligible.Get(ctx context.Context, query cloudflare.AlertingV3DestinationEligibleGetParams) (cloudflare.AlertingV3DestinationEligibleGetResponse, error)
+- client.Alerting.V3.Destinations.Eligible.Get(ctx context.Context, query alerting.V3DestinationEligibleGetParams) (alerting.V3DestinationEligibleGetResponse, error)
#### Pagerduty
Response Types:
-- cloudflare.AlertingV3DestinationPagerdutyNewResponse
-- cloudflare.AlertingV3DestinationPagerdutyDeleteResponse
-- cloudflare.AlertingV3DestinationPagerdutyGetResponse
-- cloudflare.AlertingV3DestinationPagerdutyLinkResponse
+- alerting.AaaPagerduty
+- alerting.V3DestinationPagerdutyNewResponse
+- alerting.V3DestinationPagerdutyDeleteResponse
+- alerting.V3DestinationPagerdutyLinkResponse
Methods:
-- client.Alerting.V3.Destinations.Pagerduty.New(ctx context.Context, body cloudflare.AlertingV3DestinationPagerdutyNewParams) (cloudflare.AlertingV3DestinationPagerdutyNewResponse, error)
-- client.Alerting.V3.Destinations.Pagerduty.Delete(ctx context.Context, body cloudflare.AlertingV3DestinationPagerdutyDeleteParams) (cloudflare.AlertingV3DestinationPagerdutyDeleteResponse, error)
-- client.Alerting.V3.Destinations.Pagerduty.Get(ctx context.Context, query cloudflare.AlertingV3DestinationPagerdutyGetParams) ([]cloudflare.AlertingV3DestinationPagerdutyGetResponse, error)
-- client.Alerting.V3.Destinations.Pagerduty.Link(ctx context.Context, tokenID string, query cloudflare.AlertingV3DestinationPagerdutyLinkParams) (cloudflare.AlertingV3DestinationPagerdutyLinkResponse, error)
+- client.Alerting.V3.Destinations.Pagerduty.New(ctx context.Context, body alerting.V3DestinationPagerdutyNewParams) (alerting.V3DestinationPagerdutyNewResponse, error)
+- client.Alerting.V3.Destinations.Pagerduty.Delete(ctx context.Context, body alerting.V3DestinationPagerdutyDeleteParams) (alerting.V3DestinationPagerdutyDeleteResponse, error)
+- client.Alerting.V3.Destinations.Pagerduty.Get(ctx context.Context, query alerting.V3DestinationPagerdutyGetParams) ([]alerting.AaaPagerduty, error)
+- client.Alerting.V3.Destinations.Pagerduty.Link(ctx context.Context, tokenID string, query alerting.V3DestinationPagerdutyLinkParams) (alerting.V3DestinationPagerdutyLinkResponse, error)
#### Webhooks
Response Types:
-- cloudflare.AlertingV3DestinationWebhookNewResponse
-- cloudflare.AlertingV3DestinationWebhookUpdateResponse
-- cloudflare.AlertingV3DestinationWebhookListResponse
-- cloudflare.AlertingV3DestinationWebhookDeleteResponse
-- cloudflare.AlertingV3DestinationWebhookGetResponse
+- alerting.AaaWebhooks
+- alerting.V3DestinationWebhookNewResponse
+- alerting.V3DestinationWebhookUpdateResponse
+- alerting.V3DestinationWebhookDeleteResponse
Methods:
-- client.Alerting.V3.Destinations.Webhooks.New(ctx context.Context, params cloudflare.AlertingV3DestinationWebhookNewParams) (cloudflare.AlertingV3DestinationWebhookNewResponse, error)
-- client.Alerting.V3.Destinations.Webhooks.Update(ctx context.Context, webhookID string, params cloudflare.AlertingV3DestinationWebhookUpdateParams) (cloudflare.AlertingV3DestinationWebhookUpdateResponse, error)
-- client.Alerting.V3.Destinations.Webhooks.List(ctx context.Context, query cloudflare.AlertingV3DestinationWebhookListParams) ([]cloudflare.AlertingV3DestinationWebhookListResponse, error)
-- client.Alerting.V3.Destinations.Webhooks.Delete(ctx context.Context, webhookID string, body cloudflare.AlertingV3DestinationWebhookDeleteParams) (cloudflare.AlertingV3DestinationWebhookDeleteResponse, error)
-- client.Alerting.V3.Destinations.Webhooks.Get(ctx context.Context, webhookID string, query cloudflare.AlertingV3DestinationWebhookGetParams) (cloudflare.AlertingV3DestinationWebhookGetResponse, error)
+- client.Alerting.V3.Destinations.Webhooks.New(ctx context.Context, params alerting.V3DestinationWebhookNewParams) (alerting.V3DestinationWebhookNewResponse, error)
+- client.Alerting.V3.Destinations.Webhooks.Update(ctx context.Context, webhookID string, params alerting.V3DestinationWebhookUpdateParams) (alerting.V3DestinationWebhookUpdateResponse, error)
+- client.Alerting.V3.Destinations.Webhooks.List(ctx context.Context, query alerting.V3DestinationWebhookListParams) ([]alerting.AaaWebhooks, error)
+- client.Alerting.V3.Destinations.Webhooks.Delete(ctx context.Context, webhookID string, body alerting.V3DestinationWebhookDeleteParams) (alerting.V3DestinationWebhookDeleteResponse, error)
+- client.Alerting.V3.Destinations.Webhooks.Get(ctx context.Context, webhookID string, query alerting.V3DestinationWebhookGetParams) (alerting.AaaWebhooks, error)
### Histories
Response Types:
-- cloudflare.AlertingV3HistoryListResponse
+- alerting.AaaHistory
Methods:
-- client.Alerting.V3.Histories.List(ctx context.Context, params cloudflare.AlertingV3HistoryListParams) (shared.V4PagePaginationArray[cloudflare.AlertingV3HistoryListResponse], error)
+- client.Alerting.V3.Histories.List(ctx context.Context, params alerting.V3HistoryListParams) (shared.V4PagePaginationArray[alerting.AaaHistory], error)
### Policies
Response Types:
-- cloudflare.AlertingV3PolicyNewResponse
-- cloudflare.AlertingV3PolicyUpdateResponse
-- cloudflare.AlertingV3PolicyListResponse
-- cloudflare.AlertingV3PolicyDeleteResponse
-- cloudflare.AlertingV3PolicyGetResponse
+- alerting.AaaPolicies
+- alerting.V3PolicyNewResponse
+- alerting.V3PolicyUpdateResponse
+- alerting.V3PolicyDeleteResponse
Methods:
-- client.Alerting.V3.Policies.New(ctx context.Context, params cloudflare.AlertingV3PolicyNewParams) (cloudflare.AlertingV3PolicyNewResponse, error)
-- client.Alerting.V3.Policies.Update(ctx context.Context, policyID string, params cloudflare.AlertingV3PolicyUpdateParams) (cloudflare.AlertingV3PolicyUpdateResponse, error)
-- client.Alerting.V3.Policies.List(ctx context.Context, query cloudflare.AlertingV3PolicyListParams) ([]cloudflare.AlertingV3PolicyListResponse, error)
-- client.Alerting.V3.Policies.Delete(ctx context.Context, policyID string, body cloudflare.AlertingV3PolicyDeleteParams) (cloudflare.AlertingV3PolicyDeleteResponse, error)
-- client.Alerting.V3.Policies.Get(ctx context.Context, policyID string, query cloudflare.AlertingV3PolicyGetParams) (cloudflare.AlertingV3PolicyGetResponse, error)
+- client.Alerting.V3.Policies.New(ctx context.Context, params alerting.V3PolicyNewParams) (alerting.V3PolicyNewResponse, error)
+- client.Alerting.V3.Policies.Update(ctx context.Context, policyID string, params alerting.V3PolicyUpdateParams) (alerting.V3PolicyUpdateResponse, error)
+- client.Alerting.V3.Policies.List(ctx context.Context, query alerting.V3PolicyListParams) ([]alerting.AaaPolicies, error)
+- client.Alerting.V3.Policies.Delete(ctx context.Context, policyID string, body alerting.V3PolicyDeleteParams) (alerting.V3PolicyDeleteResponse, error)
+- client.Alerting.V3.Policies.Get(ctx context.Context, policyID string, query alerting.V3PolicyGetParams) (alerting.AaaPolicies, error)
# D1
@@ -3996,19 +3972,18 @@ Methods:
Response Types:
-- cloudflare.D1DatabaseNewResponse
-- cloudflare.D1DatabaseListResponse
-- cloudflare.D1DatabaseDeleteResponse
-- cloudflare.D1DatabaseGetResponse
-- cloudflare.D1DatabaseQueryResponse
+- d1.D1CreateDatabase
+- d1.D1DatabaseDetails
+- d1.D1QueryResult
+- d1.DatabaseDeleteResponse
Methods:
-- client.D1.Database.New(ctx context.Context, params cloudflare.D1DatabaseNewParams) (cloudflare.D1DatabaseNewResponse, error)
-- client.D1.Database.List(ctx context.Context, params cloudflare.D1DatabaseListParams) (shared.V4PagePaginationArray[cloudflare.D1DatabaseListResponse], error)
-- client.D1.Database.Delete(ctx context.Context, accountIdentifier string, databaseIdentifier string) (cloudflare.D1DatabaseDeleteResponse, error)
-- client.D1.Database.Get(ctx context.Context, accountIdentifier string, databaseIdentifier string) (cloudflare.D1DatabaseGetResponse, error)
-- client.D1.Database.Query(ctx context.Context, accountIdentifier string, databaseIdentifier string, body cloudflare.D1DatabaseQueryParams) ([]cloudflare.D1DatabaseQueryResponse, error)
+- client.D1.Database.New(ctx context.Context, params d1.DatabaseNewParams) (d1.D1CreateDatabase, error)
+- client.D1.Database.List(ctx context.Context, params d1.DatabaseListParams) (shared.V4PagePaginationArray[d1.D1CreateDatabase], error)
+- client.D1.Database.Delete(ctx context.Context, accountIdentifier string, databaseIdentifier string) (d1.DatabaseDeleteResponse, error)
+- client.D1.Database.Get(ctx context.Context, accountIdentifier string, databaseIdentifier string) (d1.D1DatabaseDetails, error)
+- client.D1.Database.Query(ctx context.Context, accountIdentifier string, databaseIdentifier string, body d1.DatabaseQueryParams) ([]d1.D1QueryResult, error)
# R2
@@ -4016,51 +3991,48 @@ Methods:
Response Types:
-- cloudflare.R2BucketNewResponse
-- cloudflare.R2BucketListResponse
-- cloudflare.R2BucketDeleteResponse
-- cloudflare.R2BucketGetResponse
+- r2.R2Bucket
+- r2.BucketDeleteResponse
Methods:
-- client.R2.Buckets.New(ctx context.Context, params cloudflare.R2BucketNewParams) (cloudflare.R2BucketNewResponse, error)
-- client.R2.Buckets.List(ctx context.Context, params cloudflare.R2BucketListParams) ([]cloudflare.R2BucketListResponse, error)
-- client.R2.Buckets.Delete(ctx context.Context, bucketName string, body cloudflare.R2BucketDeleteParams) (cloudflare.R2BucketDeleteResponse, error)
-- client.R2.Buckets.Get(ctx context.Context, bucketName string, query cloudflare.R2BucketGetParams) (cloudflare.R2BucketGetResponse, error)
+- client.R2.Buckets.New(ctx context.Context, params r2.BucketNewParams) (r2.R2Bucket, error)
+- client.R2.Buckets.List(ctx context.Context, params r2.BucketListParams) ([]r2.R2Bucket, error)
+- client.R2.Buckets.Delete(ctx context.Context, bucketName string, body r2.BucketDeleteParams) (r2.BucketDeleteResponse, error)
+- client.R2.Buckets.Get(ctx context.Context, bucketName string, query r2.BucketGetParams) (r2.R2Bucket, error)
## Sippy
Response Types:
-- cloudflare.R2SippyUpdateResponse
-- cloudflare.R2SippyDeleteResponse
-- cloudflare.R2SippyGetResponse
+- r2.R2Sippy
+- r2.SippyDeleteResponse
Methods:
-- client.R2.Sippy.Update(ctx context.Context, bucketName string, params cloudflare.R2SippyUpdateParams) (cloudflare.R2SippyUpdateResponse, error)
-- client.R2.Sippy.Delete(ctx context.Context, bucketName string, body cloudflare.R2SippyDeleteParams) (cloudflare.R2SippyDeleteResponse, error)
-- client.R2.Sippy.Get(ctx context.Context, bucketName string, query cloudflare.R2SippyGetParams) (cloudflare.R2SippyGetResponse, error)
+- client.R2.Sippy.Update(ctx context.Context, bucketName string, params r2.SippyUpdateParams) (r2.R2Sippy, error)
+- client.R2.Sippy.Delete(ctx context.Context, bucketName string, body r2.SippyDeleteParams) (r2.SippyDeleteResponse, error)
+- client.R2.Sippy.Get(ctx context.Context, bucketName string, query r2.SippyGetParams) (r2.R2Sippy, error)
# WARPConnector
Response Types:
-- cloudflare.WARPConnectorNewResponse
-- cloudflare.WARPConnectorListResponse
-- cloudflare.WARPConnectorDeleteResponse
-- cloudflare.WARPConnectorEditResponse
-- cloudflare.WARPConnectorGetResponse
-- cloudflare.WARPConnectorTokenResponse
+- warp_connector.WARPConnectorNewResponse
+- warp_connector.WARPConnectorListResponse
+- warp_connector.WARPConnectorDeleteResponse
+- warp_connector.WARPConnectorEditResponse
+- warp_connector.WARPConnectorGetResponse
+- warp_connector.WARPConnectorTokenResponse
Methods:
-- client.WARPConnector.New(ctx context.Context, params cloudflare.WARPConnectorNewParams) (cloudflare.WARPConnectorNewResponse, error)
-- client.WARPConnector.List(ctx context.Context, params cloudflare.WARPConnectorListParams) (shared.V4PagePaginationArray[cloudflare.WARPConnectorListResponse], error)
-- client.WARPConnector.Delete(ctx context.Context, tunnelID string, params cloudflare.WARPConnectorDeleteParams) (cloudflare.WARPConnectorDeleteResponse, error)
-- client.WARPConnector.Edit(ctx context.Context, tunnelID string, params cloudflare.WARPConnectorEditParams) (cloudflare.WARPConnectorEditResponse, error)
-- client.WARPConnector.Get(ctx context.Context, tunnelID string, query cloudflare.WARPConnectorGetParams) (cloudflare.WARPConnectorGetResponse, error)
-- client.WARPConnector.Token(ctx context.Context, tunnelID string, query cloudflare.WARPConnectorTokenParams) (cloudflare.WARPConnectorTokenResponse, error)
+- client.WARPConnector.New(ctx context.Context, params warp_connector.WARPConnectorNewParams) (warp_connector.WARPConnectorNewResponse, error)
+- client.WARPConnector.List(ctx context.Context, params warp_connector.WARPConnectorListParams) (shared.V4PagePaginationArray[warp_connector.WARPConnectorListResponse], error)
+- client.WARPConnector.Delete(ctx context.Context, tunnelID string, params warp_connector.WARPConnectorDeleteParams) (warp_connector.WARPConnectorDeleteResponse, error)
+- client.WARPConnector.Edit(ctx context.Context, tunnelID string, params warp_connector.WARPConnectorEditParams) (warp_connector.WARPConnectorEditResponse, error)
+- client.WARPConnector.Get(ctx context.Context, tunnelID string, query warp_connector.WARPConnectorGetParams) (warp_connector.WARPConnectorGetResponse, error)
+- client.WARPConnector.Token(ctx context.Context, tunnelID string, query warp_connector.WARPConnectorTokenParams) (warp_connector.WARPConnectorTokenResponse, error)
# WorkersForPlatforms
@@ -4072,49 +4044,44 @@ Methods:
Response Types:
-- cloudflare.WorkersForPlatformDispatchNamespaceScriptUpdateResponse
-- cloudflare.WorkersForPlatformDispatchNamespaceScriptGetResponse
+- workers_for_platforms.WorkersNamespaceScript
Methods:
-- client.WorkersForPlatforms.Dispatch.Namespaces.Scripts.Update(ctx context.Context, dispatchNamespace string, scriptName string, params cloudflare.WorkersForPlatformDispatchNamespaceScriptUpdateParams) (cloudflare.WorkersForPlatformDispatchNamespaceScriptUpdateResponse, error)
-- client.WorkersForPlatforms.Dispatch.Namespaces.Scripts.Delete(ctx context.Context, dispatchNamespace string, scriptName string, params cloudflare.WorkersForPlatformDispatchNamespaceScriptDeleteParams) error
-- client.WorkersForPlatforms.Dispatch.Namespaces.Scripts.Get(ctx context.Context, dispatchNamespace string, scriptName string, query cloudflare.WorkersForPlatformDispatchNamespaceScriptGetParams) (cloudflare.WorkersForPlatformDispatchNamespaceScriptGetResponse, error)
+- client.WorkersForPlatforms.Dispatch.Namespaces.Scripts.Update(ctx context.Context, dispatchNamespace string, scriptName string, params workers_for_platforms.DispatchNamespaceScriptUpdateParams) (workers.WorkersScript, error)
+- client.WorkersForPlatforms.Dispatch.Namespaces.Scripts.Delete(ctx context.Context, dispatchNamespace string, scriptName string, params workers_for_platforms.DispatchNamespaceScriptDeleteParams) error
+- client.WorkersForPlatforms.Dispatch.Namespaces.Scripts.Get(ctx context.Context, dispatchNamespace string, scriptName string, query workers_for_platforms.DispatchNamespaceScriptGetParams) (workers_for_platforms.WorkersNamespaceScript, error)
##### Content
###### Scripts
-Response Types:
-
-- cloudflare.WorkersForPlatformDispatchNamespaceScriptContentScriptUpdateResponse
-
Methods:
-- client.WorkersForPlatforms.Dispatch.Namespaces.Scripts.Content.Scripts.Update(ctx context.Context, dispatchNamespace string, scriptName string, params cloudflare.WorkersForPlatformDispatchNamespaceScriptContentScriptUpdateParams) (cloudflare.WorkersForPlatformDispatchNamespaceScriptContentScriptUpdateResponse, error)
-- client.WorkersForPlatforms.Dispatch.Namespaces.Scripts.Content.Scripts.Get(ctx context.Context, dispatchNamespace string, scriptName string, query cloudflare.WorkersForPlatformDispatchNamespaceScriptContentScriptGetParams) (http.Response, error)
+- client.WorkersForPlatforms.Dispatch.Namespaces.Scripts.Content.Scripts.Update(ctx context.Context, dispatchNamespace string, scriptName string, params workers_for_platforms.DispatchNamespaceScriptContentScriptUpdateParams) (workers.WorkersScript, error)
+- client.WorkersForPlatforms.Dispatch.Namespaces.Scripts.Content.Scripts.Get(ctx context.Context, dispatchNamespace string, scriptName string, query workers_for_platforms.DispatchNamespaceScriptContentScriptGetParams) (http.Response, error)
###### Settings
Response Types:
-- cloudflare.WorkersForPlatformDispatchNamespaceScriptContentSettingEditResponse
-- cloudflare.WorkersForPlatformDispatchNamespaceScriptContentSettingGetResponse
+- workers_for_platforms.DispatchNamespaceScriptContentSettingEditResponse
+- workers_for_platforms.DispatchNamespaceScriptContentSettingGetResponse
Methods:
-- client.WorkersForPlatforms.Dispatch.Namespaces.Scripts.Content.Settings.Edit(ctx context.Context, dispatchNamespace string, scriptName string, params cloudflare.WorkersForPlatformDispatchNamespaceScriptContentSettingEditParams) (cloudflare.WorkersForPlatformDispatchNamespaceScriptContentSettingEditResponse, error)
-- client.WorkersForPlatforms.Dispatch.Namespaces.Scripts.Content.Settings.Get(ctx context.Context, dispatchNamespace string, scriptName string, query cloudflare.WorkersForPlatformDispatchNamespaceScriptContentSettingGetParams) (cloudflare.WorkersForPlatformDispatchNamespaceScriptContentSettingGetResponse, error)
+- client.WorkersForPlatforms.Dispatch.Namespaces.Scripts.Content.Settings.Edit(ctx context.Context, dispatchNamespace string, scriptName string, params workers_for_platforms.DispatchNamespaceScriptContentSettingEditParams) (workers_for_platforms.DispatchNamespaceScriptContentSettingEditResponse, error)
+- client.WorkersForPlatforms.Dispatch.Namespaces.Scripts.Content.Settings.Get(ctx context.Context, dispatchNamespace string, scriptName string, query workers_for_platforms.DispatchNamespaceScriptContentSettingGetParams) (workers_for_platforms.DispatchNamespaceScriptContentSettingGetResponse, error)
###### Bindings
Response Types:
-- cloudflare.WorkersForPlatformDispatchNamespaceScriptContentBindingGetResponse
+- workers_for_platforms.DispatchNamespaceScriptContentBindingGetResponse
Methods:
-- client.WorkersForPlatforms.Dispatch.Namespaces.Scripts.Content.Bindings.Get(ctx context.Context, dispatchNamespace string, scriptName string, query cloudflare.WorkersForPlatformDispatchNamespaceScriptContentBindingGetParams) (cloudflare.WorkersForPlatformDispatchNamespaceScriptContentBindingGetResponse, error)
+- client.WorkersForPlatforms.Dispatch.Namespaces.Scripts.Content.Bindings.Get(ctx context.Context, dispatchNamespace string, scriptName string, query workers_for_platforms.DispatchNamespaceScriptContentBindingGetParams) (workers_for_platforms.DispatchNamespaceScriptContentBindingGetResponse, error)
# ZeroTrust
@@ -4122,241 +4089,227 @@ Methods:
Response Types:
-- cloudflare.ZeroTrustDeviceListResponse
-- cloudflare.ZeroTrustDeviceGetResponse
+- zero_trust.TeamsDevicesDevices
+- zero_trust.DeviceGetResponse
Methods:
-- client.ZeroTrust.Devices.List(ctx context.Context, query cloudflare.ZeroTrustDeviceListParams) ([]cloudflare.ZeroTrustDeviceListResponse, error)
-- client.ZeroTrust.Devices.Get(ctx context.Context, deviceID string, query cloudflare.ZeroTrustDeviceGetParams) (cloudflare.ZeroTrustDeviceGetResponse, error)
+- client.ZeroTrust.Devices.List(ctx context.Context, query zero_trust.DeviceListParams) ([]zero_trust.TeamsDevicesDevices, error)
+- client.ZeroTrust.Devices.Get(ctx context.Context, deviceID string, query zero_trust.DeviceGetParams) (zero_trust.DeviceGetResponse, error)
### DEXTests
Response Types:
-- cloudflare.ZeroTrustDeviceDEXTestNewResponse
-- cloudflare.ZeroTrustDeviceDEXTestUpdateResponse
-- cloudflare.ZeroTrustDeviceDEXTestListResponse
-- cloudflare.ZeroTrustDeviceDEXTestDeleteResponse
-- cloudflare.ZeroTrustDeviceDEXTestGetResponse
+- zero_trust.TeamsDevicesDeviceDEXTestSchemasHTTP
Methods:
-- client.ZeroTrust.Devices.DEXTests.New(ctx context.Context, params cloudflare.ZeroTrustDeviceDEXTestNewParams) (cloudflare.ZeroTrustDeviceDEXTestNewResponse, error)
-- client.ZeroTrust.Devices.DEXTests.Update(ctx context.Context, dexTestID string, params cloudflare.ZeroTrustDeviceDEXTestUpdateParams) (cloudflare.ZeroTrustDeviceDEXTestUpdateResponse, error)
-- client.ZeroTrust.Devices.DEXTests.List(ctx context.Context, query cloudflare.ZeroTrustDeviceDEXTestListParams) ([]cloudflare.ZeroTrustDeviceDEXTestListResponse, error)
-- client.ZeroTrust.Devices.DEXTests.Delete(ctx context.Context, dexTestID string, body cloudflare.ZeroTrustDeviceDEXTestDeleteParams) ([]cloudflare.ZeroTrustDeviceDEXTestDeleteResponse, error)
-- client.ZeroTrust.Devices.DEXTests.Get(ctx context.Context, dexTestID string, query cloudflare.ZeroTrustDeviceDEXTestGetParams) (cloudflare.ZeroTrustDeviceDEXTestGetResponse, error)
+- client.ZeroTrust.Devices.DEXTests.New(ctx context.Context, params zero_trust.DeviceDEXTestNewParams) (zero_trust.TeamsDevicesDeviceDEXTestSchemasHTTP, error)
+- client.ZeroTrust.Devices.DEXTests.Update(ctx context.Context, dexTestID string, params zero_trust.DeviceDEXTestUpdateParams) (zero_trust.TeamsDevicesDeviceDEXTestSchemasHTTP, error)
+- client.ZeroTrust.Devices.DEXTests.List(ctx context.Context, query zero_trust.DeviceDEXTestListParams) ([]zero_trust.TeamsDevicesDeviceDEXTestSchemasHTTP, error)
+- client.ZeroTrust.Devices.DEXTests.Delete(ctx context.Context, dexTestID string, body zero_trust.DeviceDEXTestDeleteParams) ([]zero_trust.TeamsDevicesDeviceDEXTestSchemasHTTP, error)
+- client.ZeroTrust.Devices.DEXTests.Get(ctx context.Context, dexTestID string, query zero_trust.DeviceDEXTestGetParams) (zero_trust.TeamsDevicesDeviceDEXTestSchemasHTTP, error)
### Networks
Response Types:
-- cloudflare.ZeroTrustDeviceNetworkNewResponse
-- cloudflare.ZeroTrustDeviceNetworkUpdateResponse
-- cloudflare.ZeroTrustDeviceNetworkListResponse
-- cloudflare.ZeroTrustDeviceNetworkDeleteResponse
-- cloudflare.ZeroTrustDeviceNetworkGetResponse
+- zero_trust.TeamsDevicesDeviceManagedNetworks
Methods:
-- client.ZeroTrust.Devices.Networks.New(ctx context.Context, params cloudflare.ZeroTrustDeviceNetworkNewParams) (cloudflare.ZeroTrustDeviceNetworkNewResponse, error)
-- client.ZeroTrust.Devices.Networks.Update(ctx context.Context, networkID string, params cloudflare.ZeroTrustDeviceNetworkUpdateParams) (cloudflare.ZeroTrustDeviceNetworkUpdateResponse, error)
-- client.ZeroTrust.Devices.Networks.List(ctx context.Context, query cloudflare.ZeroTrustDeviceNetworkListParams) ([]cloudflare.ZeroTrustDeviceNetworkListResponse, error)
-- client.ZeroTrust.Devices.Networks.Delete(ctx context.Context, networkID string, body cloudflare.ZeroTrustDeviceNetworkDeleteParams) ([]cloudflare.ZeroTrustDeviceNetworkDeleteResponse, error)
-- client.ZeroTrust.Devices.Networks.Get(ctx context.Context, networkID string, query cloudflare.ZeroTrustDeviceNetworkGetParams) (cloudflare.ZeroTrustDeviceNetworkGetResponse, error)
+- client.ZeroTrust.Devices.Networks.New(ctx context.Context, params zero_trust.DeviceNetworkNewParams) (zero_trust.TeamsDevicesDeviceManagedNetworks, error)
+- client.ZeroTrust.Devices.Networks.Update(ctx context.Context, networkID string, params zero_trust.DeviceNetworkUpdateParams) (zero_trust.TeamsDevicesDeviceManagedNetworks, error)
+- client.ZeroTrust.Devices.Networks.List(ctx context.Context, query zero_trust.DeviceNetworkListParams) ([]zero_trust.TeamsDevicesDeviceManagedNetworks, error)
+- client.ZeroTrust.Devices.Networks.Delete(ctx context.Context, networkID string, body zero_trust.DeviceNetworkDeleteParams) ([]zero_trust.TeamsDevicesDeviceManagedNetworks, error)
+- client.ZeroTrust.Devices.Networks.Get(ctx context.Context, networkID string, query zero_trust.DeviceNetworkGetParams) (zero_trust.TeamsDevicesDeviceManagedNetworks, error)
### Policies
Response Types:
-- cloudflare.ZeroTrustDevicePolicyNewResponse
-- cloudflare.ZeroTrustDevicePolicyListResponse
-- cloudflare.ZeroTrustDevicePolicyDeleteResponse
-- cloudflare.ZeroTrustDevicePolicyEditResponse
-- cloudflare.ZeroTrustDevicePolicyGetResponse
+- zero_trust.TeamsDevicesDeviceSettingsPolicy
+- zero_trust.DevicePolicyNewResponse
+- zero_trust.DevicePolicyEditResponse
+- zero_trust.DevicePolicyGetResponse
Methods:
-- client.ZeroTrust.Devices.Policies.New(ctx context.Context, params cloudflare.ZeroTrustDevicePolicyNewParams) ([]cloudflare.ZeroTrustDevicePolicyNewResponse, error)
-- client.ZeroTrust.Devices.Policies.List(ctx context.Context, query cloudflare.ZeroTrustDevicePolicyListParams) ([]cloudflare.ZeroTrustDevicePolicyListResponse, error)
-- client.ZeroTrust.Devices.Policies.Delete(ctx context.Context, policyID string, body cloudflare.ZeroTrustDevicePolicyDeleteParams) ([]cloudflare.ZeroTrustDevicePolicyDeleteResponse, error)
-- client.ZeroTrust.Devices.Policies.Edit(ctx context.Context, policyID string, params cloudflare.ZeroTrustDevicePolicyEditParams) ([]cloudflare.ZeroTrustDevicePolicyEditResponse, error)
-- client.ZeroTrust.Devices.Policies.Get(ctx context.Context, policyID string, query cloudflare.ZeroTrustDevicePolicyGetParams) ([]cloudflare.ZeroTrustDevicePolicyGetResponse, error)
+- client.ZeroTrust.Devices.Policies.New(ctx context.Context, params zero_trust.DevicePolicyNewParams) (zero_trust.TeamsDevicesDeviceSettingsPolicy, error)
+- client.ZeroTrust.Devices.Policies.List(ctx context.Context, query zero_trust.DevicePolicyListParams) ([]zero_trust.TeamsDevicesDeviceSettingsPolicy, error)
+- client.ZeroTrust.Devices.Policies.Delete(ctx context.Context, policyID string, body zero_trust.DevicePolicyDeleteParams) ([]zero_trust.TeamsDevicesDeviceSettingsPolicy, error)
+- client.ZeroTrust.Devices.Policies.Edit(ctx context.Context, policyID string, params zero_trust.DevicePolicyEditParams) (zero_trust.TeamsDevicesDeviceSettingsPolicy, error)
+- client.ZeroTrust.Devices.Policies.Get(ctx context.Context, policyID string, query zero_trust.DevicePolicyGetParams) (zero_trust.TeamsDevicesDeviceSettingsPolicy, error)
#### DefaultPolicy
Response Types:
-- cloudflare.ZeroTrustDevicePolicyDefaultPolicyGetResponse
+- zero_trust.DevicePolicyDefaultPolicyGetResponse
Methods:
-- client.ZeroTrust.Devices.Policies.DefaultPolicy.Get(ctx context.Context, query cloudflare.ZeroTrustDevicePolicyDefaultPolicyGetParams) ([]cloudflare.ZeroTrustDevicePolicyDefaultPolicyGetResponse, error)
+- client.ZeroTrust.Devices.Policies.DefaultPolicy.Get(ctx context.Context, query zero_trust.DevicePolicyDefaultPolicyGetParams) ([]zero_trust.DevicePolicyDefaultPolicyGetResponse, error)
#### Excludes
+Params Types:
+
+- zero_trust.TeamsDevicesSplitTunnelParam
+
Response Types:
-- cloudflare.ZeroTrustDevicePolicyExcludeUpdateResponse
-- cloudflare.ZeroTrustDevicePolicyExcludeListResponse
-- cloudflare.ZeroTrustDevicePolicyExcludeGetResponse
+- zero_trust.TeamsDevicesSplitTunnel
Methods:
-- client.ZeroTrust.Devices.Policies.Excludes.Update(ctx context.Context, params cloudflare.ZeroTrustDevicePolicyExcludeUpdateParams) ([]cloudflare.ZeroTrustDevicePolicyExcludeUpdateResponse, error)
-- client.ZeroTrust.Devices.Policies.Excludes.List(ctx context.Context, query cloudflare.ZeroTrustDevicePolicyExcludeListParams) ([]cloudflare.ZeroTrustDevicePolicyExcludeListResponse, error)
-- client.ZeroTrust.Devices.Policies.Excludes.Get(ctx context.Context, policyID string, query cloudflare.ZeroTrustDevicePolicyExcludeGetParams) ([]cloudflare.ZeroTrustDevicePolicyExcludeGetResponse, error)
+- client.ZeroTrust.Devices.Policies.Excludes.Update(ctx context.Context, params zero_trust.DevicePolicyExcludeUpdateParams) ([]zero_trust.TeamsDevicesSplitTunnel, error)
+- client.ZeroTrust.Devices.Policies.Excludes.List(ctx context.Context, query zero_trust.DevicePolicyExcludeListParams) ([]zero_trust.TeamsDevicesSplitTunnel, error)
+- client.ZeroTrust.Devices.Policies.Excludes.Get(ctx context.Context, policyID string, query zero_trust.DevicePolicyExcludeGetParams) ([]zero_trust.TeamsDevicesSplitTunnel, error)
#### FallbackDomains
+Params Types:
+
+- zero_trust.TeamsDevicesFallbackDomainParam
+
Response Types:
-- cloudflare.ZeroTrustDevicePolicyFallbackDomainUpdateResponse
-- cloudflare.ZeroTrustDevicePolicyFallbackDomainListResponse
-- cloudflare.ZeroTrustDevicePolicyFallbackDomainGetResponse
+- zero_trust.TeamsDevicesFallbackDomain
Methods:
-- client.ZeroTrust.Devices.Policies.FallbackDomains.Update(ctx context.Context, policyID string, params cloudflare.ZeroTrustDevicePolicyFallbackDomainUpdateParams) ([]cloudflare.ZeroTrustDevicePolicyFallbackDomainUpdateResponse, error)
-- client.ZeroTrust.Devices.Policies.FallbackDomains.List(ctx context.Context, query cloudflare.ZeroTrustDevicePolicyFallbackDomainListParams) ([]cloudflare.ZeroTrustDevicePolicyFallbackDomainListResponse, error)
-- client.ZeroTrust.Devices.Policies.FallbackDomains.Get(ctx context.Context, policyID string, query cloudflare.ZeroTrustDevicePolicyFallbackDomainGetParams) ([]cloudflare.ZeroTrustDevicePolicyFallbackDomainGetResponse, error)
+- client.ZeroTrust.Devices.Policies.FallbackDomains.Update(ctx context.Context, policyID string, params zero_trust.DevicePolicyFallbackDomainUpdateParams) ([]zero_trust.TeamsDevicesFallbackDomain, error)
+- client.ZeroTrust.Devices.Policies.FallbackDomains.List(ctx context.Context, query zero_trust.DevicePolicyFallbackDomainListParams) ([]zero_trust.TeamsDevicesFallbackDomain, error)
+- client.ZeroTrust.Devices.Policies.FallbackDomains.Get(ctx context.Context, policyID string, query zero_trust.DevicePolicyFallbackDomainGetParams) ([]zero_trust.TeamsDevicesFallbackDomain, error)
#### Includes
+Params Types:
+
+- zero_trust.TeamsDevicesSplitTunnelIncludeParam
+
Response Types:
-- cloudflare.ZeroTrustDevicePolicyIncludeUpdateResponse
-- cloudflare.ZeroTrustDevicePolicyIncludeListResponse
-- cloudflare.ZeroTrustDevicePolicyIncludeGetResponse
+- zero_trust.TeamsDevicesSplitTunnelInclude
Methods:
-- client.ZeroTrust.Devices.Policies.Includes.Update(ctx context.Context, params cloudflare.ZeroTrustDevicePolicyIncludeUpdateParams) ([]cloudflare.ZeroTrustDevicePolicyIncludeUpdateResponse, error)
-- client.ZeroTrust.Devices.Policies.Includes.List(ctx context.Context, query cloudflare.ZeroTrustDevicePolicyIncludeListParams) ([]cloudflare.ZeroTrustDevicePolicyIncludeListResponse, error)
-- client.ZeroTrust.Devices.Policies.Includes.Get(ctx context.Context, policyID string, query cloudflare.ZeroTrustDevicePolicyIncludeGetParams) ([]cloudflare.ZeroTrustDevicePolicyIncludeGetResponse, error)
+- client.ZeroTrust.Devices.Policies.Includes.Update(ctx context.Context, params zero_trust.DevicePolicyIncludeUpdateParams) ([]zero_trust.TeamsDevicesSplitTunnelInclude, error)
+- client.ZeroTrust.Devices.Policies.Includes.List(ctx context.Context, query zero_trust.DevicePolicyIncludeListParams) ([]zero_trust.TeamsDevicesSplitTunnelInclude, error)
+- client.ZeroTrust.Devices.Policies.Includes.Get(ctx context.Context, policyID string, query zero_trust.DevicePolicyIncludeGetParams) ([]zero_trust.TeamsDevicesSplitTunnelInclude, error)
### Postures
Response Types:
-- cloudflare.ZeroTrustDevicePostureNewResponse
-- cloudflare.ZeroTrustDevicePostureUpdateResponse
-- cloudflare.ZeroTrustDevicePostureListResponse
-- cloudflare.ZeroTrustDevicePostureDeleteResponse
-- cloudflare.ZeroTrustDevicePostureGetResponse
+- zero_trust.TeamsDevicesDevicePostureRules
+- zero_trust.DevicePostureDeleteResponse
Methods:
-- client.ZeroTrust.Devices.Postures.New(ctx context.Context, params cloudflare.ZeroTrustDevicePostureNewParams) (cloudflare.ZeroTrustDevicePostureNewResponse, error)
-- client.ZeroTrust.Devices.Postures.Update(ctx context.Context, ruleID string, params cloudflare.ZeroTrustDevicePostureUpdateParams) (cloudflare.ZeroTrustDevicePostureUpdateResponse, error)
-- client.ZeroTrust.Devices.Postures.List(ctx context.Context, query cloudflare.ZeroTrustDevicePostureListParams) ([]cloudflare.ZeroTrustDevicePostureListResponse, error)
-- client.ZeroTrust.Devices.Postures.Delete(ctx context.Context, ruleID string, body cloudflare.ZeroTrustDevicePostureDeleteParams) (cloudflare.ZeroTrustDevicePostureDeleteResponse, error)
-- client.ZeroTrust.Devices.Postures.Get(ctx context.Context, ruleID string, query cloudflare.ZeroTrustDevicePostureGetParams) (cloudflare.ZeroTrustDevicePostureGetResponse, error)
+- client.ZeroTrust.Devices.Postures.New(ctx context.Context, params zero_trust.DevicePostureNewParams) (zero_trust.TeamsDevicesDevicePostureRules, error)
+- client.ZeroTrust.Devices.Postures.Update(ctx context.Context, ruleID string, params zero_trust.DevicePostureUpdateParams) (zero_trust.TeamsDevicesDevicePostureRules, error)
+- client.ZeroTrust.Devices.Postures.List(ctx context.Context, query zero_trust.DevicePostureListParams) ([]zero_trust.TeamsDevicesDevicePostureRules, error)
+- client.ZeroTrust.Devices.Postures.Delete(ctx context.Context, ruleID string, body zero_trust.DevicePostureDeleteParams) (zero_trust.DevicePostureDeleteResponse, error)
+- client.ZeroTrust.Devices.Postures.Get(ctx context.Context, ruleID string, query zero_trust.DevicePostureGetParams) (zero_trust.TeamsDevicesDevicePostureRules, error)
#### Integrations
Response Types:
-- cloudflare.ZeroTrustDevicePostureIntegrationNewResponse
-- cloudflare.ZeroTrustDevicePostureIntegrationListResponse
-- cloudflare.ZeroTrustDevicePostureIntegrationDeleteResponse
-- cloudflare.ZeroTrustDevicePostureIntegrationEditResponse
-- cloudflare.ZeroTrustDevicePostureIntegrationGetResponse
+- zero_trust.TeamsDevicesDevicePostureIntegrations
+- zero_trust.DevicePostureIntegrationDeleteResponse
Methods:
-- client.ZeroTrust.Devices.Postures.Integrations.New(ctx context.Context, params cloudflare.ZeroTrustDevicePostureIntegrationNewParams) (cloudflare.ZeroTrustDevicePostureIntegrationNewResponse, error)
-- client.ZeroTrust.Devices.Postures.Integrations.List(ctx context.Context, query cloudflare.ZeroTrustDevicePostureIntegrationListParams) ([]cloudflare.ZeroTrustDevicePostureIntegrationListResponse, error)
-- client.ZeroTrust.Devices.Postures.Integrations.Delete(ctx context.Context, integrationID string, body cloudflare.ZeroTrustDevicePostureIntegrationDeleteParams) (cloudflare.ZeroTrustDevicePostureIntegrationDeleteResponse, error)
-- client.ZeroTrust.Devices.Postures.Integrations.Edit(ctx context.Context, integrationID string, params cloudflare.ZeroTrustDevicePostureIntegrationEditParams) (cloudflare.ZeroTrustDevicePostureIntegrationEditResponse, error)
-- client.ZeroTrust.Devices.Postures.Integrations.Get(ctx context.Context, integrationID string, query cloudflare.ZeroTrustDevicePostureIntegrationGetParams) (cloudflare.ZeroTrustDevicePostureIntegrationGetResponse, error)
+- client.ZeroTrust.Devices.Postures.Integrations.New(ctx context.Context, params zero_trust.DevicePostureIntegrationNewParams) (zero_trust.TeamsDevicesDevicePostureIntegrations, error)
+- client.ZeroTrust.Devices.Postures.Integrations.List(ctx context.Context, query zero_trust.DevicePostureIntegrationListParams) ([]zero_trust.TeamsDevicesDevicePostureIntegrations, error)
+- client.ZeroTrust.Devices.Postures.Integrations.Delete(ctx context.Context, integrationID string, body zero_trust.DevicePostureIntegrationDeleteParams) (zero_trust.DevicePostureIntegrationDeleteResponse, error)
+- client.ZeroTrust.Devices.Postures.Integrations.Edit(ctx context.Context, integrationID string, params zero_trust.DevicePostureIntegrationEditParams) (zero_trust.TeamsDevicesDevicePostureIntegrations, error)
+- client.ZeroTrust.Devices.Postures.Integrations.Get(ctx context.Context, integrationID string, query zero_trust.DevicePostureIntegrationGetParams) (zero_trust.TeamsDevicesDevicePostureIntegrations, error)
### Revokes
Response Types:
-- cloudflare.ZeroTrustDeviceRevokeNewResponse
+- zero_trust.DeviceRevokeNewResponse
Methods:
-- client.ZeroTrust.Devices.Revokes.New(ctx context.Context, params cloudflare.ZeroTrustDeviceRevokeNewParams) (cloudflare.ZeroTrustDeviceRevokeNewResponse, error)
+- client.ZeroTrust.Devices.Revokes.New(ctx context.Context, params zero_trust.DeviceRevokeNewParams) (zero_trust.DeviceRevokeNewResponse, error)
### Settings
Response Types:
-- cloudflare.ZeroTrustDeviceSettingUpdateResponse
-- cloudflare.ZeroTrustDeviceSettingListResponse
+- zero_trust.TeamsDevicesZeroTrustAccountDeviceSettings
Methods:
-- client.ZeroTrust.Devices.Settings.Update(ctx context.Context, params cloudflare.ZeroTrustDeviceSettingUpdateParams) (cloudflare.ZeroTrustDeviceSettingUpdateResponse, error)
-- client.ZeroTrust.Devices.Settings.List(ctx context.Context, query cloudflare.ZeroTrustDeviceSettingListParams) (cloudflare.ZeroTrustDeviceSettingListResponse, error)
+- client.ZeroTrust.Devices.Settings.Update(ctx context.Context, params zero_trust.DeviceSettingUpdateParams) (zero_trust.TeamsDevicesZeroTrustAccountDeviceSettings, error)
+- client.ZeroTrust.Devices.Settings.List(ctx context.Context, query zero_trust.DeviceSettingListParams) (zero_trust.TeamsDevicesZeroTrustAccountDeviceSettings, error)
### Unrevokes
Response Types:
-- cloudflare.ZeroTrustDeviceUnrevokeNewResponse
+- zero_trust.DeviceUnrevokeNewResponse
Methods:
-- client.ZeroTrust.Devices.Unrevokes.New(ctx context.Context, params cloudflare.ZeroTrustDeviceUnrevokeNewParams) (cloudflare.ZeroTrustDeviceUnrevokeNewResponse, error)
+- client.ZeroTrust.Devices.Unrevokes.New(ctx context.Context, params zero_trust.DeviceUnrevokeNewParams) (zero_trust.DeviceUnrevokeNewResponse, error)
### OverrideCodes
Response Types:
-- cloudflare.ZeroTrustDeviceOverrideCodeListResponse
+- zero_trust.DeviceOverrideCodeListResponse
Methods:
-- client.ZeroTrust.Devices.OverrideCodes.List(ctx context.Context, deviceID string, query cloudflare.ZeroTrustDeviceOverrideCodeListParams) (cloudflare.ZeroTrustDeviceOverrideCodeListResponse, error)
+- client.ZeroTrust.Devices.OverrideCodes.List(ctx context.Context, deviceID string, query zero_trust.DeviceOverrideCodeListParams) (zero_trust.DeviceOverrideCodeListResponse, error)
## IdentityProviders
Response Types:
-- cloudflare.ZeroTrustIdentityProviderNewResponse
-- cloudflare.ZeroTrustIdentityProviderUpdateResponse
-- cloudflare.ZeroTrustIdentityProviderListResponse
-- cloudflare.ZeroTrustIdentityProviderDeleteResponse
-- cloudflare.ZeroTrustIdentityProviderGetResponse
+- zero_trust.AccessIdentityProviders
+- zero_trust.IdentityProviderListResponse
+- zero_trust.IdentityProviderDeleteResponse
Methods:
-- client.ZeroTrust.IdentityProviders.New(ctx context.Context, params cloudflare.ZeroTrustIdentityProviderNewParams) (cloudflare.ZeroTrustIdentityProviderNewResponse, error)
-- client.ZeroTrust.IdentityProviders.Update(ctx context.Context, uuid string, params cloudflare.ZeroTrustIdentityProviderUpdateParams) (cloudflare.ZeroTrustIdentityProviderUpdateResponse, error)
-- client.ZeroTrust.IdentityProviders.List(ctx context.Context, query cloudflare.ZeroTrustIdentityProviderListParams) ([]cloudflare.ZeroTrustIdentityProviderListResponse, error)
-- client.ZeroTrust.IdentityProviders.Delete(ctx context.Context, uuid string, body cloudflare.ZeroTrustIdentityProviderDeleteParams) (cloudflare.ZeroTrustIdentityProviderDeleteResponse, error)
-- client.ZeroTrust.IdentityProviders.Get(ctx context.Context, uuid string, query cloudflare.ZeroTrustIdentityProviderGetParams) (cloudflare.ZeroTrustIdentityProviderGetResponse, error)
+- client.ZeroTrust.IdentityProviders.New(ctx context.Context, params zero_trust.IdentityProviderNewParams) (zero_trust.AccessIdentityProviders, error)
+- client.ZeroTrust.IdentityProviders.Update(ctx context.Context, uuid string, params zero_trust.IdentityProviderUpdateParams) (zero_trust.AccessIdentityProviders, error)
+- client.ZeroTrust.IdentityProviders.List(ctx context.Context, query zero_trust.IdentityProviderListParams) ([]zero_trust.IdentityProviderListResponse, error)
+- client.ZeroTrust.IdentityProviders.Delete(ctx context.Context, uuid string, body zero_trust.IdentityProviderDeleteParams) (zero_trust.IdentityProviderDeleteResponse, error)
+- client.ZeroTrust.IdentityProviders.Get(ctx context.Context, uuid string, query zero_trust.IdentityProviderGetParams) (zero_trust.AccessIdentityProviders, error)
## Organizations
Response Types:
-- cloudflare.ZeroTrustOrganizationNewResponse
-- cloudflare.ZeroTrustOrganizationUpdateResponse
-- cloudflare.ZeroTrustOrganizationListResponse
-- cloudflare.ZeroTrustOrganizationRevokeUsersResponse
+- zero_trust.AccessOrganizations
+- zero_trust.OrganizationRevokeUsersResponse
Methods:
-- client.ZeroTrust.Organizations.New(ctx context.Context, params cloudflare.ZeroTrustOrganizationNewParams) (cloudflare.ZeroTrustOrganizationNewResponse, error)
-- client.ZeroTrust.Organizations.Update(ctx context.Context, params cloudflare.ZeroTrustOrganizationUpdateParams) (cloudflare.ZeroTrustOrganizationUpdateResponse, error)
-- client.ZeroTrust.Organizations.List(ctx context.Context, query cloudflare.ZeroTrustOrganizationListParams) (cloudflare.ZeroTrustOrganizationListResponse, error)
-- client.ZeroTrust.Organizations.RevokeUsers(ctx context.Context, params cloudflare.ZeroTrustOrganizationRevokeUsersParams) (cloudflare.ZeroTrustOrganizationRevokeUsersResponse, error)
+- client.ZeroTrust.Organizations.New(ctx context.Context, params zero_trust.OrganizationNewParams) (zero_trust.AccessOrganizations, error)
+- client.ZeroTrust.Organizations.Update(ctx context.Context, params zero_trust.OrganizationUpdateParams) (zero_trust.AccessOrganizations, error)
+- client.ZeroTrust.Organizations.List(ctx context.Context, query zero_trust.OrganizationListParams) (zero_trust.AccessOrganizations, error)
+- client.ZeroTrust.Organizations.RevokeUsers(ctx context.Context, params zero_trust.OrganizationRevokeUsersParams) (zero_trust.OrganizationRevokeUsersResponse, error)
## Seats
Response Types:
-- cloudflare.ZeroTrustSeatEditResponse
+- zero_trust.AccessSeats
Methods:
-- client.ZeroTrust.Seats.Edit(ctx context.Context, identifier string, body cloudflare.ZeroTrustSeatEditParams) ([]cloudflare.ZeroTrustSeatEditResponse, error)
+- client.ZeroTrust.Seats.Edit(ctx context.Context, identifier string, body zero_trust.SeatEditParams) ([]zero_trust.AccessSeats, error)
## Access
@@ -4364,165 +4317,150 @@ Methods:
Response Types:
-- cloudflare.ZeroTrustAccessApplicationNewResponse
-- cloudflare.ZeroTrustAccessApplicationUpdateResponse
-- cloudflare.ZeroTrustAccessApplicationListResponse
-- cloudflare.ZeroTrustAccessApplicationDeleteResponse
-- cloudflare.ZeroTrustAccessApplicationGetResponse
-- cloudflare.ZeroTrustAccessApplicationRevokeTokensResponse
+- zero_trust.AccessApps
+- zero_trust.AccessApplicationDeleteResponse
+- zero_trust.AccessApplicationRevokeTokensResponse
Methods:
-- client.ZeroTrust.Access.Applications.New(ctx context.Context, params cloudflare.ZeroTrustAccessApplicationNewParams) (cloudflare.ZeroTrustAccessApplicationNewResponse, error)
-- client.ZeroTrust.Access.Applications.Update(ctx context.Context, appID cloudflare.ZeroTrustAccessApplicationUpdateParamsAppID, params cloudflare.ZeroTrustAccessApplicationUpdateParams) (cloudflare.ZeroTrustAccessApplicationUpdateResponse, error)
-- client.ZeroTrust.Access.Applications.List(ctx context.Context, query cloudflare.ZeroTrustAccessApplicationListParams) ([]cloudflare.ZeroTrustAccessApplicationListResponse, error)
-- client.ZeroTrust.Access.Applications.Delete(ctx context.Context, appID cloudflare.ZeroTrustAccessApplicationDeleteParamsAppID, body cloudflare.ZeroTrustAccessApplicationDeleteParams) (cloudflare.ZeroTrustAccessApplicationDeleteResponse, error)
-- client.ZeroTrust.Access.Applications.Get(ctx context.Context, appID cloudflare.ZeroTrustAccessApplicationGetParamsAppID, query cloudflare.ZeroTrustAccessApplicationGetParams) (cloudflare.ZeroTrustAccessApplicationGetResponse, error)
-- client.ZeroTrust.Access.Applications.RevokeTokens(ctx context.Context, appID cloudflare.ZeroTrustAccessApplicationRevokeTokensParamsAppID, body cloudflare.ZeroTrustAccessApplicationRevokeTokensParams) (cloudflare.ZeroTrustAccessApplicationRevokeTokensResponse, error)
+- client.ZeroTrust.Access.Applications.New(ctx context.Context, params zero_trust.AccessApplicationNewParams) (zero_trust.AccessApps, error)
+- client.ZeroTrust.Access.Applications.Update(ctx context.Context, appID zero_trust.AccessApplicationUpdateParamsAppID, params zero_trust.AccessApplicationUpdateParams) (zero_trust.AccessApps, error)
+- client.ZeroTrust.Access.Applications.List(ctx context.Context, query zero_trust.AccessApplicationListParams) ([]zero_trust.AccessApps, error)
+- client.ZeroTrust.Access.Applications.Delete(ctx context.Context, appID zero_trust.AccessApplicationDeleteParamsAppID, body zero_trust.AccessApplicationDeleteParams) (zero_trust.AccessApplicationDeleteResponse, error)
+- client.ZeroTrust.Access.Applications.Get(ctx context.Context, appID zero_trust.AccessApplicationGetParamsAppID, query zero_trust.AccessApplicationGetParams) (zero_trust.AccessApps, error)
+- client.ZeroTrust.Access.Applications.RevokeTokens(ctx context.Context, appID zero_trust.AccessApplicationRevokeTokensParamsAppID, body zero_trust.AccessApplicationRevokeTokensParams) (zero_trust.AccessApplicationRevokeTokensResponse, error)
#### CAs
Response Types:
-- cloudflare.ZeroTrustAccessApplicationCANewResponse
-- cloudflare.ZeroTrustAccessApplicationCAListResponse
-- cloudflare.ZeroTrustAccessApplicationCADeleteResponse
-- cloudflare.ZeroTrustAccessApplicationCAGetResponse
+- zero_trust.AccessCA
+- zero_trust.AccessApplicationCANewResponse
+- zero_trust.AccessApplicationCADeleteResponse
+- zero_trust.AccessApplicationCAGetResponse
Methods:
-- client.ZeroTrust.Access.Applications.CAs.New(ctx context.Context, uuid string, body cloudflare.ZeroTrustAccessApplicationCANewParams) (cloudflare.ZeroTrustAccessApplicationCANewResponse, error)
-- client.ZeroTrust.Access.Applications.CAs.List(ctx context.Context, query cloudflare.ZeroTrustAccessApplicationCAListParams) ([]cloudflare.ZeroTrustAccessApplicationCAListResponse, error)
-- client.ZeroTrust.Access.Applications.CAs.Delete(ctx context.Context, uuid string, body cloudflare.ZeroTrustAccessApplicationCADeleteParams) (cloudflare.ZeroTrustAccessApplicationCADeleteResponse, error)
-- client.ZeroTrust.Access.Applications.CAs.Get(ctx context.Context, uuid string, query cloudflare.ZeroTrustAccessApplicationCAGetParams) (cloudflare.ZeroTrustAccessApplicationCAGetResponse, error)
+- client.ZeroTrust.Access.Applications.CAs.New(ctx context.Context, uuid string, body zero_trust.AccessApplicationCANewParams) (zero_trust.AccessApplicationCANewResponse, error)
+- client.ZeroTrust.Access.Applications.CAs.List(ctx context.Context, query zero_trust.AccessApplicationCAListParams) ([]zero_trust.AccessCA, error)
+- client.ZeroTrust.Access.Applications.CAs.Delete(ctx context.Context, uuid string, body zero_trust.AccessApplicationCADeleteParams) (zero_trust.AccessApplicationCADeleteResponse, error)
+- client.ZeroTrust.Access.Applications.CAs.Get(ctx context.Context, uuid string, query zero_trust.AccessApplicationCAGetParams) (zero_trust.AccessApplicationCAGetResponse, error)
#### UserPolicyChecks
Response Types:
-- cloudflare.ZeroTrustAccessApplicationUserPolicyCheckListResponse
+- zero_trust.AccessApplicationUserPolicyCheckListResponse
Methods:
-- client.ZeroTrust.Access.Applications.UserPolicyChecks.List(ctx context.Context, appID cloudflare.ZeroTrustAccessApplicationUserPolicyCheckListParamsAppID, query cloudflare.ZeroTrustAccessApplicationUserPolicyCheckListParams) (cloudflare.ZeroTrustAccessApplicationUserPolicyCheckListResponse, error)
+- client.ZeroTrust.Access.Applications.UserPolicyChecks.List(ctx context.Context, appID zero_trust.AccessApplicationUserPolicyCheckListParamsAppID, query zero_trust.AccessApplicationUserPolicyCheckListParams) (zero_trust.AccessApplicationUserPolicyCheckListResponse, error)
#### Policies
Response Types:
-- cloudflare.ZeroTrustAccessApplicationPolicyNewResponse
-- cloudflare.ZeroTrustAccessApplicationPolicyUpdateResponse
-- cloudflare.ZeroTrustAccessApplicationPolicyListResponse
-- cloudflare.ZeroTrustAccessApplicationPolicyDeleteResponse
-- cloudflare.ZeroTrustAccessApplicationPolicyGetResponse
+- zero_trust.AccessPolicies
+- zero_trust.AccessApplicationPolicyDeleteResponse
Methods:
-- client.ZeroTrust.Access.Applications.Policies.New(ctx context.Context, uuid string, params cloudflare.ZeroTrustAccessApplicationPolicyNewParams) (cloudflare.ZeroTrustAccessApplicationPolicyNewResponse, error)
-- client.ZeroTrust.Access.Applications.Policies.Update(ctx context.Context, uuid1 string, uuid string, params cloudflare.ZeroTrustAccessApplicationPolicyUpdateParams) (cloudflare.ZeroTrustAccessApplicationPolicyUpdateResponse, error)
-- client.ZeroTrust.Access.Applications.Policies.List(ctx context.Context, uuid string, query cloudflare.ZeroTrustAccessApplicationPolicyListParams) ([]cloudflare.ZeroTrustAccessApplicationPolicyListResponse, error)
-- client.ZeroTrust.Access.Applications.Policies.Delete(ctx context.Context, uuid1 string, uuid string, body cloudflare.ZeroTrustAccessApplicationPolicyDeleteParams) (cloudflare.ZeroTrustAccessApplicationPolicyDeleteResponse, error)
-- client.ZeroTrust.Access.Applications.Policies.Get(ctx context.Context, uuid1 string, uuid string, query cloudflare.ZeroTrustAccessApplicationPolicyGetParams) (cloudflare.ZeroTrustAccessApplicationPolicyGetResponse, error)
+- client.ZeroTrust.Access.Applications.Policies.New(ctx context.Context, uuid string, params zero_trust.AccessApplicationPolicyNewParams) (zero_trust.AccessPolicies, error)
+- client.ZeroTrust.Access.Applications.Policies.Update(ctx context.Context, uuid1 string, uuid string, params zero_trust.AccessApplicationPolicyUpdateParams) (zero_trust.AccessPolicies, error)
+- client.ZeroTrust.Access.Applications.Policies.List(ctx context.Context, uuid string, query zero_trust.AccessApplicationPolicyListParams) ([]zero_trust.AccessPolicies, error)
+- client.ZeroTrust.Access.Applications.Policies.Delete(ctx context.Context, uuid1 string, uuid string, body zero_trust.AccessApplicationPolicyDeleteParams) (zero_trust.AccessApplicationPolicyDeleteResponse, error)
+- client.ZeroTrust.Access.Applications.Policies.Get(ctx context.Context, uuid1 string, uuid string, query zero_trust.AccessApplicationPolicyGetParams) (zero_trust.AccessPolicies, error)
### Certificates
Response Types:
-- cloudflare.ZeroTrustAccessCertificateNewResponse
-- cloudflare.ZeroTrustAccessCertificateUpdateResponse
-- cloudflare.ZeroTrustAccessCertificateListResponse
-- cloudflare.ZeroTrustAccessCertificateDeleteResponse
-- cloudflare.ZeroTrustAccessCertificateGetResponse
+- zero_trust.AccessCertificates
+- zero_trust.AccessCertificateDeleteResponse
Methods:
-- client.ZeroTrust.Access.Certificates.New(ctx context.Context, params cloudflare.ZeroTrustAccessCertificateNewParams) (cloudflare.ZeroTrustAccessCertificateNewResponse, error)
-- client.ZeroTrust.Access.Certificates.Update(ctx context.Context, uuid string, params cloudflare.ZeroTrustAccessCertificateUpdateParams) (cloudflare.ZeroTrustAccessCertificateUpdateResponse, error)
-- client.ZeroTrust.Access.Certificates.List(ctx context.Context, query cloudflare.ZeroTrustAccessCertificateListParams) ([]cloudflare.ZeroTrustAccessCertificateListResponse, error)
-- client.ZeroTrust.Access.Certificates.Delete(ctx context.Context, uuid string, body cloudflare.ZeroTrustAccessCertificateDeleteParams) (cloudflare.ZeroTrustAccessCertificateDeleteResponse, error)
-- client.ZeroTrust.Access.Certificates.Get(ctx context.Context, uuid string, query cloudflare.ZeroTrustAccessCertificateGetParams) (cloudflare.ZeroTrustAccessCertificateGetResponse, error)
+- client.ZeroTrust.Access.Certificates.New(ctx context.Context, params zero_trust.AccessCertificateNewParams) (zero_trust.AccessCertificates, error)
+- client.ZeroTrust.Access.Certificates.Update(ctx context.Context, uuid string, params zero_trust.AccessCertificateUpdateParams) (zero_trust.AccessCertificates, error)
+- client.ZeroTrust.Access.Certificates.List(ctx context.Context, query zero_trust.AccessCertificateListParams) ([]zero_trust.AccessCertificates, error)
+- client.ZeroTrust.Access.Certificates.Delete(ctx context.Context, uuid string, body zero_trust.AccessCertificateDeleteParams) (zero_trust.AccessCertificateDeleteResponse, error)
+- client.ZeroTrust.Access.Certificates.Get(ctx context.Context, uuid string, query zero_trust.AccessCertificateGetParams) (zero_trust.AccessCertificates, error)
#### Settings
+Params Types:
+
+- zero_trust.AccessSettingsParam
+
Response Types:
-- cloudflare.ZeroTrustAccessCertificateSettingUpdateResponse
-- cloudflare.ZeroTrustAccessCertificateSettingListResponse
+- zero_trust.AccessSettings
Methods:
-- client.ZeroTrust.Access.Certificates.Settings.Update(ctx context.Context, params cloudflare.ZeroTrustAccessCertificateSettingUpdateParams) ([]cloudflare.ZeroTrustAccessCertificateSettingUpdateResponse, error)
-- client.ZeroTrust.Access.Certificates.Settings.List(ctx context.Context, query cloudflare.ZeroTrustAccessCertificateSettingListParams) ([]cloudflare.ZeroTrustAccessCertificateSettingListResponse, error)
+- client.ZeroTrust.Access.Certificates.Settings.Update(ctx context.Context, params zero_trust.AccessCertificateSettingUpdateParams) ([]zero_trust.AccessSettings, error)
+- client.ZeroTrust.Access.Certificates.Settings.List(ctx context.Context, query zero_trust.AccessCertificateSettingListParams) ([]zero_trust.AccessSettings, error)
### Groups
Response Types:
-- cloudflare.ZeroTrustAccessGroupNewResponse
-- cloudflare.ZeroTrustAccessGroupUpdateResponse
-- cloudflare.ZeroTrustAccessGroupListResponse
-- cloudflare.ZeroTrustAccessGroupDeleteResponse
-- cloudflare.ZeroTrustAccessGroupGetResponse
+- zero_trust.AccessGroups
+- zero_trust.AccessGroupDeleteResponse
Methods:
-- client.ZeroTrust.Access.Groups.New(ctx context.Context, params cloudflare.ZeroTrustAccessGroupNewParams) (cloudflare.ZeroTrustAccessGroupNewResponse, error)
-- client.ZeroTrust.Access.Groups.Update(ctx context.Context, uuid string, params cloudflare.ZeroTrustAccessGroupUpdateParams) (cloudflare.ZeroTrustAccessGroupUpdateResponse, error)
-- client.ZeroTrust.Access.Groups.List(ctx context.Context, query cloudflare.ZeroTrustAccessGroupListParams) ([]cloudflare.ZeroTrustAccessGroupListResponse, error)
-- client.ZeroTrust.Access.Groups.Delete(ctx context.Context, uuid string, body cloudflare.ZeroTrustAccessGroupDeleteParams) (cloudflare.ZeroTrustAccessGroupDeleteResponse, error)
-- client.ZeroTrust.Access.Groups.Get(ctx context.Context, uuid string, query cloudflare.ZeroTrustAccessGroupGetParams) (cloudflare.ZeroTrustAccessGroupGetResponse, error)
+- client.ZeroTrust.Access.Groups.New(ctx context.Context, params zero_trust.AccessGroupNewParams) (zero_trust.AccessGroups, error)
+- client.ZeroTrust.Access.Groups.Update(ctx context.Context, uuid string, params zero_trust.AccessGroupUpdateParams) (zero_trust.AccessGroups, error)
+- client.ZeroTrust.Access.Groups.List(ctx context.Context, query zero_trust.AccessGroupListParams) ([]zero_trust.AccessGroups, error)
+- client.ZeroTrust.Access.Groups.Delete(ctx context.Context, uuid string, body zero_trust.AccessGroupDeleteParams) (zero_trust.AccessGroupDeleteResponse, error)
+- client.ZeroTrust.Access.Groups.Get(ctx context.Context, uuid string, query zero_trust.AccessGroupGetParams) (zero_trust.AccessGroups, error)
### ServiceTokens
Response Types:
-- cloudflare.ZeroTrustAccessServiceTokenNewResponse
-- cloudflare.ZeroTrustAccessServiceTokenUpdateResponse
-- cloudflare.ZeroTrustAccessServiceTokenListResponse
-- cloudflare.ZeroTrustAccessServiceTokenDeleteResponse
-- cloudflare.ZeroTrustAccessServiceTokenRefreshResponse
-- cloudflare.ZeroTrustAccessServiceTokenRotateResponse
+- zero_trust.AccessServiceTokens
+- zero_trust.AccessServiceTokenNewResponse
+- zero_trust.AccessServiceTokenRotateResponse
Methods:
-- client.ZeroTrust.Access.ServiceTokens.New(ctx context.Context, params cloudflare.ZeroTrustAccessServiceTokenNewParams) (cloudflare.ZeroTrustAccessServiceTokenNewResponse, error)
-- client.ZeroTrust.Access.ServiceTokens.Update(ctx context.Context, uuid string, params cloudflare.ZeroTrustAccessServiceTokenUpdateParams) (cloudflare.ZeroTrustAccessServiceTokenUpdateResponse, error)
-- client.ZeroTrust.Access.ServiceTokens.List(ctx context.Context, query cloudflare.ZeroTrustAccessServiceTokenListParams) ([]cloudflare.ZeroTrustAccessServiceTokenListResponse, error)
-- client.ZeroTrust.Access.ServiceTokens.Delete(ctx context.Context, uuid string, body cloudflare.ZeroTrustAccessServiceTokenDeleteParams) (cloudflare.ZeroTrustAccessServiceTokenDeleteResponse, error)
-- client.ZeroTrust.Access.ServiceTokens.Refresh(ctx context.Context, identifier string, uuid string) (cloudflare.ZeroTrustAccessServiceTokenRefreshResponse, error)
-- client.ZeroTrust.Access.ServiceTokens.Rotate(ctx context.Context, identifier string, uuid string) (cloudflare.ZeroTrustAccessServiceTokenRotateResponse, error)
+- client.ZeroTrust.Access.ServiceTokens.New(ctx context.Context, params zero_trust.AccessServiceTokenNewParams) (zero_trust.AccessServiceTokenNewResponse, error)
+- client.ZeroTrust.Access.ServiceTokens.Update(ctx context.Context, uuid string, params zero_trust.AccessServiceTokenUpdateParams) (zero_trust.AccessServiceTokens, error)
+- client.ZeroTrust.Access.ServiceTokens.List(ctx context.Context, query zero_trust.AccessServiceTokenListParams) ([]zero_trust.AccessServiceTokens, error)
+- client.ZeroTrust.Access.ServiceTokens.Delete(ctx context.Context, uuid string, body zero_trust.AccessServiceTokenDeleteParams) (zero_trust.AccessServiceTokens, error)
+- client.ZeroTrust.Access.ServiceTokens.Refresh(ctx context.Context, identifier string, uuid string) (zero_trust.AccessServiceTokens, error)
+- client.ZeroTrust.Access.ServiceTokens.Rotate(ctx context.Context, identifier string, uuid string) (zero_trust.AccessServiceTokenRotateResponse, error)
### Bookmarks
Response Types:
-- cloudflare.ZeroTrustAccessBookmarkNewResponse
-- cloudflare.ZeroTrustAccessBookmarkUpdateResponse
-- cloudflare.ZeroTrustAccessBookmarkListResponse
-- cloudflare.ZeroTrustAccessBookmarkDeleteResponse
-- cloudflare.ZeroTrustAccessBookmarkGetResponse
+- zero_trust.AccessBookmarks
+- zero_trust.AccessBookmarkDeleteResponse
Methods:
-- client.ZeroTrust.Access.Bookmarks.New(ctx context.Context, identifier interface{}, uuid string) (cloudflare.ZeroTrustAccessBookmarkNewResponse, error)
-- client.ZeroTrust.Access.Bookmarks.Update(ctx context.Context, identifier interface{}, uuid string) (cloudflare.ZeroTrustAccessBookmarkUpdateResponse, error)
-- client.ZeroTrust.Access.Bookmarks.List(ctx context.Context, identifier interface{}) ([]cloudflare.ZeroTrustAccessBookmarkListResponse, error)
-- client.ZeroTrust.Access.Bookmarks.Delete(ctx context.Context, identifier interface{}, uuid string) (cloudflare.ZeroTrustAccessBookmarkDeleteResponse, error)
-- client.ZeroTrust.Access.Bookmarks.Get(ctx context.Context, identifier interface{}, uuid string) (cloudflare.ZeroTrustAccessBookmarkGetResponse, error)
+- client.ZeroTrust.Access.Bookmarks.New(ctx context.Context, identifier interface{}, uuid string) (zero_trust.AccessBookmarks, error)
+- client.ZeroTrust.Access.Bookmarks.Update(ctx context.Context, identifier interface{}, uuid string) (zero_trust.AccessBookmarks, error)
+- client.ZeroTrust.Access.Bookmarks.List(ctx context.Context, identifier interface{}) ([]zero_trust.AccessBookmarks, error)
+- client.ZeroTrust.Access.Bookmarks.Delete(ctx context.Context, identifier interface{}, uuid string) (zero_trust.AccessBookmarkDeleteResponse, error)
+- client.ZeroTrust.Access.Bookmarks.Get(ctx context.Context, identifier interface{}, uuid string) (zero_trust.AccessBookmarks, error)
### Keys
Response Types:
-- cloudflare.ZeroTrustAccessKeyUpdateResponse
-- cloudflare.ZeroTrustAccessKeyListResponse
-- cloudflare.ZeroTrustAccessKeyRotateResponse
+- zero_trust.AccessKeyUpdateResponse
+- zero_trust.AccessKeyListResponse
+- zero_trust.AccessKeyRotateResponse
Methods:
-- client.ZeroTrust.Access.Keys.Update(ctx context.Context, identifier string, body cloudflare.ZeroTrustAccessKeyUpdateParams) (cloudflare.ZeroTrustAccessKeyUpdateResponse, error)
-- client.ZeroTrust.Access.Keys.List(ctx context.Context, identifier string) (cloudflare.ZeroTrustAccessKeyListResponse, error)
-- client.ZeroTrust.Access.Keys.Rotate(ctx context.Context, identifier string) (cloudflare.ZeroTrustAccessKeyRotateResponse, error)
+- client.ZeroTrust.Access.Keys.Update(ctx context.Context, identifier string, body zero_trust.AccessKeyUpdateParams) (zero_trust.AccessKeyUpdateResponse, error)
+- client.ZeroTrust.Access.Keys.List(ctx context.Context, identifier string) (zero_trust.AccessKeyListResponse, error)
+- client.ZeroTrust.Access.Keys.Rotate(ctx context.Context, identifier string) (zero_trust.AccessKeyRotateResponse, error)
### Logs
@@ -4530,89 +4468,84 @@ Methods:
Response Types:
-- cloudflare.ZeroTrustAccessLogAccessRequestListResponse
+- zero_trust.AccessAccessRequests
Methods:
-- client.ZeroTrust.Access.Logs.AccessRequests.List(ctx context.Context, identifier string) ([]cloudflare.ZeroTrustAccessLogAccessRequestListResponse, error)
+- client.ZeroTrust.Access.Logs.AccessRequests.List(ctx context.Context, identifier string) ([]zero_trust.AccessAccessRequests, error)
### Users
Response Types:
-- cloudflare.ZeroTrustAccessUserListResponse
+- zero_trust.AccessUsers
Methods:
-- client.ZeroTrust.Access.Users.List(ctx context.Context, identifier string) ([]cloudflare.ZeroTrustAccessUserListResponse, error)
+- client.ZeroTrust.Access.Users.List(ctx context.Context, identifier string) ([]zero_trust.AccessUsers, error)
#### ActiveSessions
Response Types:
-- cloudflare.ZeroTrustAccessUserActiveSessionListResponse
-- cloudflare.ZeroTrustAccessUserActiveSessionGetResponse
+- zero_trust.AccessUserActiveSessionListResponse
+- zero_trust.AccessUserActiveSessionGetResponse
Methods:
-- client.ZeroTrust.Access.Users.ActiveSessions.List(ctx context.Context, identifier string, id string) ([]cloudflare.ZeroTrustAccessUserActiveSessionListResponse, error)
-- client.ZeroTrust.Access.Users.ActiveSessions.Get(ctx context.Context, identifier string, id string, nonce string) (cloudflare.ZeroTrustAccessUserActiveSessionGetResponse, error)
+- client.ZeroTrust.Access.Users.ActiveSessions.List(ctx context.Context, identifier string, id string) ([]zero_trust.AccessUserActiveSessionListResponse, error)
+- client.ZeroTrust.Access.Users.ActiveSessions.Get(ctx context.Context, identifier string, id string, nonce string) (zero_trust.AccessUserActiveSessionGetResponse, error)
#### LastSeenIdentity
Response Types:
-- cloudflare.ZeroTrustAccessUserLastSeenIdentityGetResponse
+- zero_trust.AccessIdentity
Methods:
-- client.ZeroTrust.Access.Users.LastSeenIdentity.Get(ctx context.Context, identifier string, id string) (cloudflare.ZeroTrustAccessUserLastSeenIdentityGetResponse, error)
+- client.ZeroTrust.Access.Users.LastSeenIdentity.Get(ctx context.Context, identifier string, id string) (zero_trust.AccessIdentity, error)
#### FailedLogins
Response Types:
-- cloudflare.ZeroTrustAccessUserFailedLoginListResponse
+- zero_trust.AccessUserFailedLoginListResponse
Methods:
-- client.ZeroTrust.Access.Users.FailedLogins.List(ctx context.Context, identifier string, id string) ([]cloudflare.ZeroTrustAccessUserFailedLoginListResponse, error)
+- client.ZeroTrust.Access.Users.FailedLogins.List(ctx context.Context, identifier string, id string) ([]zero_trust.AccessUserFailedLoginListResponse, error)
### CustomPages
Response Types:
-- cloudflare.ZeroTrustAccessCustomPageNewResponse
-- cloudflare.ZeroTrustAccessCustomPageUpdateResponse
-- cloudflare.ZeroTrustAccessCustomPageListResponse
-- cloudflare.ZeroTrustAccessCustomPageDeleteResponse
-- cloudflare.ZeroTrustAccessCustomPageGetResponse
+- zero_trust.AccessCustomPage
+- zero_trust.AccessCustomPageWithoutHTML
+- zero_trust.AccessCustomPageDeleteResponse
Methods:
-- client.ZeroTrust.Access.CustomPages.New(ctx context.Context, identifier string, body cloudflare.ZeroTrustAccessCustomPageNewParams) (cloudflare.ZeroTrustAccessCustomPageNewResponse, error)
-- client.ZeroTrust.Access.CustomPages.Update(ctx context.Context, identifier string, uuid string, body cloudflare.ZeroTrustAccessCustomPageUpdateParams) (cloudflare.ZeroTrustAccessCustomPageUpdateResponse, error)
-- client.ZeroTrust.Access.CustomPages.List(ctx context.Context, identifier string) ([]cloudflare.ZeroTrustAccessCustomPageListResponse, error)
-- client.ZeroTrust.Access.CustomPages.Delete(ctx context.Context, identifier string, uuid string) (cloudflare.ZeroTrustAccessCustomPageDeleteResponse, error)
-- client.ZeroTrust.Access.CustomPages.Get(ctx context.Context, identifier string, uuid string) (cloudflare.ZeroTrustAccessCustomPageGetResponse, error)
+- client.ZeroTrust.Access.CustomPages.New(ctx context.Context, identifier string, body zero_trust.AccessCustomPageNewParams) (zero_trust.AccessCustomPageWithoutHTML, error)
+- client.ZeroTrust.Access.CustomPages.Update(ctx context.Context, identifier string, uuid string, body zero_trust.AccessCustomPageUpdateParams) (zero_trust.AccessCustomPageWithoutHTML, error)
+- client.ZeroTrust.Access.CustomPages.List(ctx context.Context, identifier string) ([]zero_trust.AccessCustomPageWithoutHTML, error)
+- client.ZeroTrust.Access.CustomPages.Delete(ctx context.Context, identifier string, uuid string) (zero_trust.AccessCustomPageDeleteResponse, error)
+- client.ZeroTrust.Access.CustomPages.Get(ctx context.Context, identifier string, uuid string) (zero_trust.AccessCustomPage, error)
### Tags
Response Types:
-- cloudflare.ZeroTrustAccessTagNewResponse
-- cloudflare.ZeroTrustAccessTagUpdateResponse
-- cloudflare.ZeroTrustAccessTagListResponse
-- cloudflare.ZeroTrustAccessTagDeleteResponse
-- cloudflare.ZeroTrustAccessTagGetResponse
+- zero_trust.AccessTag
+- zero_trust.AccessTagDeleteResponse
Methods:
-- client.ZeroTrust.Access.Tags.New(ctx context.Context, identifier string, body cloudflare.ZeroTrustAccessTagNewParams) (cloudflare.ZeroTrustAccessTagNewResponse, error)
-- client.ZeroTrust.Access.Tags.Update(ctx context.Context, identifier string, tagName string, body cloudflare.ZeroTrustAccessTagUpdateParams) (cloudflare.ZeroTrustAccessTagUpdateResponse, error)
-- client.ZeroTrust.Access.Tags.List(ctx context.Context, identifier string) ([]cloudflare.ZeroTrustAccessTagListResponse, error)
-- client.ZeroTrust.Access.Tags.Delete(ctx context.Context, identifier string, name string) (cloudflare.ZeroTrustAccessTagDeleteResponse, error)
-- client.ZeroTrust.Access.Tags.Get(ctx context.Context, identifier string, name string) (cloudflare.ZeroTrustAccessTagGetResponse, error)
+- client.ZeroTrust.Access.Tags.New(ctx context.Context, identifier string, body zero_trust.AccessTagNewParams) (zero_trust.AccessTag, error)
+- client.ZeroTrust.Access.Tags.Update(ctx context.Context, identifier string, tagName string, body zero_trust.AccessTagUpdateParams) (zero_trust.AccessTag, error)
+- client.ZeroTrust.Access.Tags.List(ctx context.Context, identifier string) ([]zero_trust.AccessTag, error)
+- client.ZeroTrust.Access.Tags.Delete(ctx context.Context, identifier string, name string) (zero_trust.AccessTagDeleteResponse, error)
+- client.ZeroTrust.Access.Tags.Get(ctx context.Context, identifier string, name string) (zero_trust.AccessTag, error)
## DEX
@@ -4620,11 +4553,11 @@ Methods:
Response Types:
-- cloudflare.ZeroTrustDEXColoListResponse
+- zero_trust.DEXColoListResponse
Methods:
-- client.ZeroTrust.DEX.Colos.List(ctx context.Context, params cloudflare.ZeroTrustDEXColoListParams) ([]cloudflare.ZeroTrustDEXColoListResponse, error)
+- client.ZeroTrust.DEX.Colos.List(ctx context.Context, params zero_trust.DEXColoListParams) ([]zero_trust.DEXColoListResponse, error)
### FleetStatus
@@ -4632,67 +4565,68 @@ Methods:
Response Types:
-- cloudflare.ZeroTrustDEXFleetStatusDeviceListResponse
+- zero_trust.DigitalExperienceMonitoringDevice
Methods:
-- client.ZeroTrust.DEX.FleetStatus.Devices.List(ctx context.Context, params cloudflare.ZeroTrustDEXFleetStatusDeviceListParams) (shared.V4PagePaginationArray[cloudflare.ZeroTrustDEXFleetStatusDeviceListResponse], error)
+- client.ZeroTrust.DEX.FleetStatus.Devices.List(ctx context.Context, params zero_trust.DEXFleetStatusDeviceListParams) (shared.V4PagePaginationArray[zero_trust.DigitalExperienceMonitoringDevice], error)
#### Live
Response Types:
-- cloudflare.ZeroTrustDEXFleetStatusLiveListResponse
+- zero_trust.DEXFleetStatusLiveListResponse
Methods:
-- client.ZeroTrust.DEX.FleetStatus.Live.List(ctx context.Context, params cloudflare.ZeroTrustDEXFleetStatusLiveListParams) (cloudflare.ZeroTrustDEXFleetStatusLiveListResponse, error)
+- client.ZeroTrust.DEX.FleetStatus.Live.List(ctx context.Context, params zero_trust.DEXFleetStatusLiveListParams) (zero_trust.DEXFleetStatusLiveListResponse, error)
#### OverTime
Methods:
-- client.ZeroTrust.DEX.FleetStatus.OverTime.List(ctx context.Context, params cloudflare.ZeroTrustDEXFleetStatusOverTimeListParams) error
+- client.ZeroTrust.DEX.FleetStatus.OverTime.List(ctx context.Context, params zero_trust.DEXFleetStatusOverTimeListParams) error
### HTTPTests
Response Types:
-- cloudflare.ZeroTrustDexhttpTestGetResponse
+- zero_trust.DigitalExperienceMonitoringHTTPDetails
Methods:
-- client.ZeroTrust.DEX.HTTPTests.Get(ctx context.Context, testID string, params cloudflare.ZeroTrustDEXHTTPTestGetParams) (cloudflare.ZeroTrustDexhttpTestGetResponse, error)
+- client.ZeroTrust.DEX.HTTPTests.Get(ctx context.Context, testID string, params zero_trust.DEXHTTPTestGetParams) (zero_trust.DigitalExperienceMonitoringHTTPDetails, error)
#### Percentiles
Response Types:
-- cloudflare.ZeroTrustDexhttpTestPercentileListResponse
+- zero_trust.DigitalExperienceMonitoringHTTPDetailsPercentiles
Methods:
-- client.ZeroTrust.DEX.HTTPTests.Percentiles.List(ctx context.Context, testID string, params cloudflare.ZeroTrustDEXHTTPTestPercentileListParams) (cloudflare.ZeroTrustDexhttpTestPercentileListResponse, error)
+- client.ZeroTrust.DEX.HTTPTests.Percentiles.List(ctx context.Context, testID string, params zero_trust.DEXHTTPTestPercentileListParams) (zero_trust.DigitalExperienceMonitoringHTTPDetailsPercentiles, error)
### Tests
Response Types:
-- cloudflare.ZeroTrustDEXTestListResponse
+- zero_trust.DigitalExperienceMonitoringTests
+- zero_trust.DEXTestListResponse
Methods:
-- client.ZeroTrust.DEX.Tests.List(ctx context.Context, params cloudflare.ZeroTrustDEXTestListParams) (shared.V4PagePagination[cloudflare.ZeroTrustDEXTestListResponse], error)
+- client.ZeroTrust.DEX.Tests.List(ctx context.Context, params zero_trust.DEXTestListParams) (shared.V4PagePagination[zero_trust.DEXTestListResponse], error)
#### UniqueDevices
Response Types:
-- cloudflare.ZeroTrustDEXTestUniqueDeviceListResponse
+- zero_trust.DigitalExperienceMonitoringUniqueDevices
Methods:
-- client.ZeroTrust.DEX.Tests.UniqueDevices.List(ctx context.Context, params cloudflare.ZeroTrustDEXTestUniqueDeviceListParams) (cloudflare.ZeroTrustDEXTestUniqueDeviceListResponse, error)
+- client.ZeroTrust.DEX.Tests.UniqueDevices.List(ctx context.Context, params zero_trust.DEXTestUniqueDeviceListParams) (zero_trust.DigitalExperienceMonitoringUniqueDevices, error)
### TracerouteTestResults
@@ -4700,109 +4634,103 @@ Methods:
Response Types:
-- cloudflare.ZeroTrustDEXTracerouteTestResultNetworkPathListResponse
+- zero_trust.DigitalExperienceMonitoringTracerouteTestResultNetworkPath
Methods:
-- client.ZeroTrust.DEX.TracerouteTestResults.NetworkPath.List(ctx context.Context, testResultID string, query cloudflare.ZeroTrustDEXTracerouteTestResultNetworkPathListParams) (cloudflare.ZeroTrustDEXTracerouteTestResultNetworkPathListResponse, error)
+- client.ZeroTrust.DEX.TracerouteTestResults.NetworkPath.List(ctx context.Context, testResultID string, query zero_trust.DEXTracerouteTestResultNetworkPathListParams) (zero_trust.DigitalExperienceMonitoringTracerouteTestResultNetworkPath, error)
### TracerouteTests
Response Types:
-- cloudflare.ZeroTrustDEXTracerouteTestGetResponse
-- cloudflare.ZeroTrustDEXTracerouteTestNetworkPathResponse
-- cloudflare.ZeroTrustDEXTracerouteTestPercentilesResponse
+- zero_trust.DigitalExperienceMonitoringTracerouteDetails
+- zero_trust.DigitalExperienceMonitoringTracerouteDetailsPercentiles
+- zero_trust.DigitalExperienceMonitoringTracerouteTestNetworkPath
Methods:
-- client.ZeroTrust.DEX.TracerouteTests.Get(ctx context.Context, testID string, params cloudflare.ZeroTrustDEXTracerouteTestGetParams) (cloudflare.ZeroTrustDEXTracerouteTestGetResponse, error)
-- client.ZeroTrust.DEX.TracerouteTests.NetworkPath(ctx context.Context, testID string, params cloudflare.ZeroTrustDEXTracerouteTestNetworkPathParams) (cloudflare.ZeroTrustDEXTracerouteTestNetworkPathResponse, error)
-- client.ZeroTrust.DEX.TracerouteTests.Percentiles(ctx context.Context, testID string, params cloudflare.ZeroTrustDEXTracerouteTestPercentilesParams) (cloudflare.ZeroTrustDEXTracerouteTestPercentilesResponse, error)
+- client.ZeroTrust.DEX.TracerouteTests.Get(ctx context.Context, testID string, params zero_trust.DEXTracerouteTestGetParams) (zero_trust.DigitalExperienceMonitoringTracerouteDetails, error)
+- client.ZeroTrust.DEX.TracerouteTests.NetworkPath(ctx context.Context, testID string, params zero_trust.DEXTracerouteTestNetworkPathParams) (zero_trust.DigitalExperienceMonitoringTracerouteTestNetworkPath, error)
+- client.ZeroTrust.DEX.TracerouteTests.Percentiles(ctx context.Context, testID string, params zero_trust.DEXTracerouteTestPercentilesParams) (zero_trust.DigitalExperienceMonitoringTracerouteDetailsPercentiles, error)
## Tunnels
Response Types:
-- cloudflare.ZeroTrustTunnelNewResponse
-- cloudflare.ZeroTrustTunnelListResponse
-- cloudflare.ZeroTrustTunnelDeleteResponse
-- cloudflare.ZeroTrustTunnelEditResponse
-- cloudflare.ZeroTrustTunnelGetResponse
+- zero_trust.TunnelArgoTunnel
+- zero_trust.TunnelListResponse
+- zero_trust.TunnelEditResponse
Methods:
-- client.ZeroTrust.Tunnels.New(ctx context.Context, params cloudflare.ZeroTrustTunnelNewParams) (cloudflare.ZeroTrustTunnelNewResponse, error)
-- client.ZeroTrust.Tunnels.List(ctx context.Context, params cloudflare.ZeroTrustTunnelListParams) (shared.V4PagePaginationArray[cloudflare.ZeroTrustTunnelListResponse], error)
-- client.ZeroTrust.Tunnels.Delete(ctx context.Context, tunnelID string, params cloudflare.ZeroTrustTunnelDeleteParams) (cloudflare.ZeroTrustTunnelDeleteResponse, error)
-- client.ZeroTrust.Tunnels.Edit(ctx context.Context, tunnelID string, params cloudflare.ZeroTrustTunnelEditParams) (cloudflare.ZeroTrustTunnelEditResponse, error)
-- client.ZeroTrust.Tunnels.Get(ctx context.Context, tunnelID string, query cloudflare.ZeroTrustTunnelGetParams) (cloudflare.ZeroTrustTunnelGetResponse, error)
+- client.ZeroTrust.Tunnels.New(ctx context.Context, params zero_trust.TunnelNewParams) (zero_trust.TunnelArgoTunnel, error)
+- client.ZeroTrust.Tunnels.List(ctx context.Context, params zero_trust.TunnelListParams) (shared.V4PagePaginationArray[zero_trust.TunnelListResponse], error)
+- client.ZeroTrust.Tunnels.Delete(ctx context.Context, tunnelID string, params zero_trust.TunnelDeleteParams) (zero_trust.TunnelArgoTunnel, error)
+- client.ZeroTrust.Tunnels.Edit(ctx context.Context, tunnelID string, params zero_trust.TunnelEditParams) (zero_trust.TunnelEditResponse, error)
+- client.ZeroTrust.Tunnels.Get(ctx context.Context, tunnelID string, query zero_trust.TunnelGetParams) (zero_trust.TunnelArgoTunnel, error)
### Configurations
Response Types:
-- cloudflare.ZeroTrustTunnelConfigurationUpdateResponse
-- cloudflare.ZeroTrustTunnelConfigurationGetResponse
+- zero_trust.TunnelConfigurationUpdateResponse
+- zero_trust.TunnelConfigurationGetResponse
Methods:
-- client.ZeroTrust.Tunnels.Configurations.Update(ctx context.Context, tunnelID string, params cloudflare.ZeroTrustTunnelConfigurationUpdateParams) (cloudflare.ZeroTrustTunnelConfigurationUpdateResponse, error)
-- client.ZeroTrust.Tunnels.Configurations.Get(ctx context.Context, tunnelID string, query cloudflare.ZeroTrustTunnelConfigurationGetParams) (cloudflare.ZeroTrustTunnelConfigurationGetResponse, error)
+- client.ZeroTrust.Tunnels.Configurations.Update(ctx context.Context, tunnelID string, params zero_trust.TunnelConfigurationUpdateParams) (zero_trust.TunnelConfigurationUpdateResponse, error)
+- client.ZeroTrust.Tunnels.Configurations.Get(ctx context.Context, tunnelID string, query zero_trust.TunnelConfigurationGetParams) (zero_trust.TunnelConfigurationGetResponse, error)
### Connections
Response Types:
-- cloudflare.ZeroTrustTunnelConnectionDeleteResponse
-- cloudflare.ZeroTrustTunnelConnectionGetResponse
+- zero_trust.TunnelTunnelClient
+- zero_trust.TunnelConnectionDeleteResponse
Methods:
-- client.ZeroTrust.Tunnels.Connections.Delete(ctx context.Context, tunnelID string, params cloudflare.ZeroTrustTunnelConnectionDeleteParams) (cloudflare.ZeroTrustTunnelConnectionDeleteResponse, error)
-- client.ZeroTrust.Tunnels.Connections.Get(ctx context.Context, tunnelID string, query cloudflare.ZeroTrustTunnelConnectionGetParams) ([]cloudflare.ZeroTrustTunnelConnectionGetResponse, error)
+- client.ZeroTrust.Tunnels.Connections.Delete(ctx context.Context, tunnelID string, params zero_trust.TunnelConnectionDeleteParams) (zero_trust.TunnelConnectionDeleteResponse, error)
+- client.ZeroTrust.Tunnels.Connections.Get(ctx context.Context, tunnelID string, query zero_trust.TunnelConnectionGetParams) ([]zero_trust.TunnelTunnelClient, error)
### Token
Response Types:
-- cloudflare.ZeroTrustTunnelTokenGetResponse
+- zero_trust.TunnelTokenGetResponse
Methods:
-- client.ZeroTrust.Tunnels.Token.Get(ctx context.Context, tunnelID string, query cloudflare.ZeroTrustTunnelTokenGetParams) (cloudflare.ZeroTrustTunnelTokenGetResponse, error)
+- client.ZeroTrust.Tunnels.Token.Get(ctx context.Context, tunnelID string, query zero_trust.TunnelTokenGetParams) (zero_trust.TunnelTokenGetResponse, error)
### Connectors
-Response Types:
-
-- cloudflare.ZeroTrustTunnelConnectorGetResponse
-
Methods:
-- client.ZeroTrust.Tunnels.Connectors.Get(ctx context.Context, tunnelID string, connectorID string, query cloudflare.ZeroTrustTunnelConnectorGetParams) (cloudflare.ZeroTrustTunnelConnectorGetResponse, error)
+- client.ZeroTrust.Tunnels.Connectors.Get(ctx context.Context, tunnelID string, connectorID string, query zero_trust.TunnelConnectorGetParams) (zero_trust.TunnelTunnelClient, error)
### Management
Response Types:
-- cloudflare.ZeroTrustTunnelManagementNewResponse
+- zero_trust.TunnelManagementNewResponse
Methods:
-- client.ZeroTrust.Tunnels.Management.New(ctx context.Context, tunnelID string, params cloudflare.ZeroTrustTunnelManagementNewParams) (cloudflare.ZeroTrustTunnelManagementNewResponse, error)
+- client.ZeroTrust.Tunnels.Management.New(ctx context.Context, tunnelID string, params zero_trust.TunnelManagementNewParams) (zero_trust.TunnelManagementNewResponse, error)
## ConnectivitySettings
Response Types:
-- cloudflare.ZeroTrustConnectivitySettingEditResponse
-- cloudflare.ZeroTrustConnectivitySettingGetResponse
+- zero_trust.ConnectivitySettingEditResponse
+- zero_trust.ConnectivitySettingGetResponse
Methods:
-- client.ZeroTrust.ConnectivitySettings.Edit(ctx context.Context, params cloudflare.ZeroTrustConnectivitySettingEditParams) (cloudflare.ZeroTrustConnectivitySettingEditResponse, error)
-- client.ZeroTrust.ConnectivitySettings.Get(ctx context.Context, query cloudflare.ZeroTrustConnectivitySettingGetParams) (cloudflare.ZeroTrustConnectivitySettingGetResponse, error)
+- client.ZeroTrust.ConnectivitySettings.Edit(ctx context.Context, params zero_trust.ConnectivitySettingEditParams) (zero_trust.ConnectivitySettingEditResponse, error)
+- client.ZeroTrust.ConnectivitySettings.Get(ctx context.Context, query zero_trust.ConnectivitySettingGetParams) (zero_trust.ConnectivitySettingGetResponse, error)
## DLP
@@ -4810,246 +4738,227 @@ Methods:
Response Types:
-- cloudflare.ZeroTrustDLPDatasetNewResponse
-- cloudflare.ZeroTrustDLPDatasetUpdateResponse
-- cloudflare.ZeroTrustDLPDatasetListResponse
-- cloudflare.ZeroTrustDLPDatasetGetResponse
+- zero_trust.DLPDataset
+- zero_trust.DLPDatasetArray
+- zero_trust.DLPDatasetCreation
Methods:
-- client.ZeroTrust.DLP.Datasets.New(ctx context.Context, params cloudflare.ZeroTrustDLPDatasetNewParams) (cloudflare.ZeroTrustDLPDatasetNewResponse, error)
-- client.ZeroTrust.DLP.Datasets.Update(ctx context.Context, datasetID string, params cloudflare.ZeroTrustDLPDatasetUpdateParams) (cloudflare.ZeroTrustDLPDatasetUpdateResponse, error)
-- client.ZeroTrust.DLP.Datasets.List(ctx context.Context, query cloudflare.ZeroTrustDLPDatasetListParams) ([]cloudflare.ZeroTrustDLPDatasetListResponse, error)
-- client.ZeroTrust.DLP.Datasets.Delete(ctx context.Context, datasetID string, body cloudflare.ZeroTrustDLPDatasetDeleteParams) error
-- client.ZeroTrust.DLP.Datasets.Get(ctx context.Context, datasetID string, query cloudflare.ZeroTrustDLPDatasetGetParams) (cloudflare.ZeroTrustDLPDatasetGetResponse, error)
+- client.ZeroTrust.DLP.Datasets.New(ctx context.Context, params zero_trust.DLPDatasetNewParams) (zero_trust.DLPDatasetCreation, error)
+- client.ZeroTrust.DLP.Datasets.Update(ctx context.Context, datasetID string, params zero_trust.DLPDatasetUpdateParams) (zero_trust.DLPDataset, error)
+- client.ZeroTrust.DLP.Datasets.List(ctx context.Context, query zero_trust.DLPDatasetListParams) (zero_trust.DLPDatasetArray, error)
+- client.ZeroTrust.DLP.Datasets.Delete(ctx context.Context, datasetID string, body zero_trust.DLPDatasetDeleteParams) error
+- client.ZeroTrust.DLP.Datasets.Get(ctx context.Context, datasetID string, query zero_trust.DLPDatasetGetParams) (zero_trust.DLPDataset, error)
#### Upload
Response Types:
-- cloudflare.ZeroTrustDLPDatasetUploadNewResponse
-- cloudflare.ZeroTrustDLPDatasetUploadEditResponse
+- zero_trust.DLPDatasetNewVersion
Methods:
-- client.ZeroTrust.DLP.Datasets.Upload.New(ctx context.Context, datasetID string, body cloudflare.ZeroTrustDLPDatasetUploadNewParams) (cloudflare.ZeroTrustDLPDatasetUploadNewResponse, error)
-- client.ZeroTrust.DLP.Datasets.Upload.Edit(ctx context.Context, datasetID string, version int64, body cloudflare.ZeroTrustDLPDatasetUploadEditParams) (cloudflare.ZeroTrustDLPDatasetUploadEditResponse, error)
+- client.ZeroTrust.DLP.Datasets.Upload.New(ctx context.Context, datasetID string, body zero_trust.DLPDatasetUploadNewParams) (zero_trust.DLPDatasetNewVersion, error)
+- client.ZeroTrust.DLP.Datasets.Upload.Edit(ctx context.Context, datasetID string, version int64, body zero_trust.DLPDatasetUploadEditParams) (zero_trust.DLPDataset, error)
### Patterns
Response Types:
-- cloudflare.ZeroTrustDLPPatternValidateResponse
+- zero_trust.DLPPatternValidateResponse
Methods:
-- client.ZeroTrust.DLP.Patterns.Validate(ctx context.Context, params cloudflare.ZeroTrustDLPPatternValidateParams) (cloudflare.ZeroTrustDLPPatternValidateResponse, error)
+- client.ZeroTrust.DLP.Patterns.Validate(ctx context.Context, params zero_trust.DLPPatternValidateParams) (zero_trust.DLPPatternValidateResponse, error)
### PayloadLogs
Response Types:
-- cloudflare.ZeroTrustDLPPayloadLogUpdateResponse
-- cloudflare.ZeroTrustDLPPayloadLogGetResponse
+- zero_trust.DLPPayloadLogUpdateResponse
+- zero_trust.DLPPayloadLogGetResponse
Methods:
-- client.ZeroTrust.DLP.PayloadLogs.Update(ctx context.Context, params cloudflare.ZeroTrustDLPPayloadLogUpdateParams) (cloudflare.ZeroTrustDLPPayloadLogUpdateResponse, error)
-- client.ZeroTrust.DLP.PayloadLogs.Get(ctx context.Context, query cloudflare.ZeroTrustDLPPayloadLogGetParams) (cloudflare.ZeroTrustDLPPayloadLogGetResponse, error)
+- client.ZeroTrust.DLP.PayloadLogs.Update(ctx context.Context, params zero_trust.DLPPayloadLogUpdateParams) (zero_trust.DLPPayloadLogUpdateResponse, error)
+- client.ZeroTrust.DLP.PayloadLogs.Get(ctx context.Context, query zero_trust.DLPPayloadLogGetParams) (zero_trust.DLPPayloadLogGetResponse, error)
### Profiles
Response Types:
-- cloudflare.ZeroTrustDLPProfileListResponse
-- cloudflare.ZeroTrustDLPProfileGetResponse
+- zero_trust.DLPProfiles
+- zero_trust.DLPProfileGetResponse
Methods:
-- client.ZeroTrust.DLP.Profiles.List(ctx context.Context, query cloudflare.ZeroTrustDLPProfileListParams) ([]cloudflare.ZeroTrustDLPProfileListResponse, error)
-- client.ZeroTrust.DLP.Profiles.Get(ctx context.Context, profileID string, query cloudflare.ZeroTrustDLPProfileGetParams) (cloudflare.ZeroTrustDLPProfileGetResponse, error)
+- client.ZeroTrust.DLP.Profiles.List(ctx context.Context, query zero_trust.DLPProfileListParams) ([]zero_trust.DLPProfiles, error)
+- client.ZeroTrust.DLP.Profiles.Get(ctx context.Context, profileID string, query zero_trust.DLPProfileGetParams) (zero_trust.DLPProfileGetResponse, error)
#### Customs
Response Types:
-- cloudflare.ZeroTrustDLPProfileCustomNewResponse
-- cloudflare.ZeroTrustDLPProfileCustomUpdateResponse
-- cloudflare.ZeroTrustDLPProfileCustomDeleteResponse
-- cloudflare.ZeroTrustDLPProfileCustomGetResponse
+- zero_trust.DLPCustomProfile
+- zero_trust.DLPProfileCustomDeleteResponse
Methods:
-- client.ZeroTrust.DLP.Profiles.Customs.New(ctx context.Context, params cloudflare.ZeroTrustDLPProfileCustomNewParams) ([]cloudflare.ZeroTrustDLPProfileCustomNewResponse, error)
-- client.ZeroTrust.DLP.Profiles.Customs.Update(ctx context.Context, profileID string, params cloudflare.ZeroTrustDLPProfileCustomUpdateParams) (cloudflare.ZeroTrustDLPProfileCustomUpdateResponse, error)
-- client.ZeroTrust.DLP.Profiles.Customs.Delete(ctx context.Context, profileID string, body cloudflare.ZeroTrustDLPProfileCustomDeleteParams) (cloudflare.ZeroTrustDLPProfileCustomDeleteResponse, error)
-- client.ZeroTrust.DLP.Profiles.Customs.Get(ctx context.Context, profileID string, query cloudflare.ZeroTrustDLPProfileCustomGetParams) (cloudflare.ZeroTrustDLPProfileCustomGetResponse, error)
+- client.ZeroTrust.DLP.Profiles.Customs.New(ctx context.Context, params zero_trust.DLPProfileCustomNewParams) ([]zero_trust.DLPCustomProfile, error)
+- client.ZeroTrust.DLP.Profiles.Customs.Update(ctx context.Context, profileID string, params zero_trust.DLPProfileCustomUpdateParams) (zero_trust.DLPCustomProfile, error)
+- client.ZeroTrust.DLP.Profiles.Customs.Delete(ctx context.Context, profileID string, body zero_trust.DLPProfileCustomDeleteParams) (zero_trust.DLPProfileCustomDeleteResponse, error)
+- client.ZeroTrust.DLP.Profiles.Customs.Get(ctx context.Context, profileID string, query zero_trust.DLPProfileCustomGetParams) (zero_trust.DLPCustomProfile, error)
#### Predefineds
Response Types:
-- cloudflare.ZeroTrustDLPProfilePredefinedUpdateResponse
-- cloudflare.ZeroTrustDLPProfilePredefinedGetResponse
+- zero_trust.DLPPredefinedProfile
Methods:
-- client.ZeroTrust.DLP.Profiles.Predefineds.Update(ctx context.Context, profileID string, params cloudflare.ZeroTrustDLPProfilePredefinedUpdateParams) (cloudflare.ZeroTrustDLPProfilePredefinedUpdateResponse, error)
-- client.ZeroTrust.DLP.Profiles.Predefineds.Get(ctx context.Context, profileID string, query cloudflare.ZeroTrustDLPProfilePredefinedGetParams) (cloudflare.ZeroTrustDLPProfilePredefinedGetResponse, error)
+- client.ZeroTrust.DLP.Profiles.Predefineds.Update(ctx context.Context, profileID string, params zero_trust.DLPProfilePredefinedUpdateParams) (zero_trust.DLPPredefinedProfile, error)
+- client.ZeroTrust.DLP.Profiles.Predefineds.Get(ctx context.Context, profileID string, query zero_trust.DLPProfilePredefinedGetParams) (zero_trust.DLPPredefinedProfile, error)
## Gateway
Response Types:
-- cloudflare.ZeroTrustGatewayNewResponse
-- cloudflare.ZeroTrustGatewayListResponse
+- zero_trust.GatewayNewResponse
+- zero_trust.GatewayListResponse
Methods:
-- client.ZeroTrust.Gateway.New(ctx context.Context, body cloudflare.ZeroTrustGatewayNewParams) (cloudflare.ZeroTrustGatewayNewResponse, error)
-- client.ZeroTrust.Gateway.List(ctx context.Context, query cloudflare.ZeroTrustGatewayListParams) (cloudflare.ZeroTrustGatewayListResponse, error)
+- client.ZeroTrust.Gateway.New(ctx context.Context, body zero_trust.GatewayNewParams) (zero_trust.GatewayNewResponse, error)
+- client.ZeroTrust.Gateway.List(ctx context.Context, query zero_trust.GatewayListParams) (zero_trust.GatewayListResponse, error)
### AuditSSHSettings
Response Types:
-- cloudflare.ZeroTrustGatewayAuditSSHSettingUpdateResponse
-- cloudflare.ZeroTrustGatewayAuditSSHSettingGetResponse
+- zero_trust.ZeroTrustGatewaySettings
Methods:
-- client.ZeroTrust.Gateway.AuditSSHSettings.Update(ctx context.Context, params cloudflare.ZeroTrustGatewayAuditSSHSettingUpdateParams) (cloudflare.ZeroTrustGatewayAuditSSHSettingUpdateResponse, error)
-- client.ZeroTrust.Gateway.AuditSSHSettings.Get(ctx context.Context, query cloudflare.ZeroTrustGatewayAuditSSHSettingGetParams) (cloudflare.ZeroTrustGatewayAuditSSHSettingGetResponse, error)
+- client.ZeroTrust.Gateway.AuditSSHSettings.Update(ctx context.Context, params zero_trust.GatewayAuditSSHSettingUpdateParams) (zero_trust.ZeroTrustGatewaySettings, error)
+- client.ZeroTrust.Gateway.AuditSSHSettings.Get(ctx context.Context, query zero_trust.GatewayAuditSSHSettingGetParams) (zero_trust.ZeroTrustGatewaySettings, error)
### Categories
Response Types:
-- cloudflare.ZeroTrustGatewayCategoryListResponse
+- zero_trust.ZeroTrustGatewayCategories
Methods:
-- client.ZeroTrust.Gateway.Categories.List(ctx context.Context, query cloudflare.ZeroTrustGatewayCategoryListParams) ([]cloudflare.ZeroTrustGatewayCategoryListResponse, error)
+- client.ZeroTrust.Gateway.Categories.List(ctx context.Context, query zero_trust.GatewayCategoryListParams) ([]zero_trust.ZeroTrustGatewayCategories, error)
### AppTypes
Response Types:
-- cloudflare.ZeroTrustGatewayAppTypeListResponse
+- zero_trust.ZeroTrustGatewayAppTypes
Methods:
-- client.ZeroTrust.Gateway.AppTypes.List(ctx context.Context, query cloudflare.ZeroTrustGatewayAppTypeListParams) ([]cloudflare.ZeroTrustGatewayAppTypeListResponse, error)
+- client.ZeroTrust.Gateway.AppTypes.List(ctx context.Context, query zero_trust.GatewayAppTypeListParams) ([]zero_trust.ZeroTrustGatewayAppTypes, error)
### Configurations
Response Types:
-- cloudflare.ZeroTrustGatewayConfigurationUpdateResponse
-- cloudflare.ZeroTrustGatewayConfigurationEditResponse
-- cloudflare.ZeroTrustGatewayConfigurationGetResponse
+- zero_trust.GatewayConfigurationUpdateResponse
+- zero_trust.GatewayConfigurationEditResponse
+- zero_trust.GatewayConfigurationGetResponse
Methods:
-- client.ZeroTrust.Gateway.Configurations.Update(ctx context.Context, params cloudflare.ZeroTrustGatewayConfigurationUpdateParams) (cloudflare.ZeroTrustGatewayConfigurationUpdateResponse, error)
-- client.ZeroTrust.Gateway.Configurations.Edit(ctx context.Context, params cloudflare.ZeroTrustGatewayConfigurationEditParams) (cloudflare.ZeroTrustGatewayConfigurationEditResponse, error)
-- client.ZeroTrust.Gateway.Configurations.Get(ctx context.Context, query cloudflare.ZeroTrustGatewayConfigurationGetParams) (cloudflare.ZeroTrustGatewayConfigurationGetResponse, error)
+- client.ZeroTrust.Gateway.Configurations.Update(ctx context.Context, params zero_trust.GatewayConfigurationUpdateParams) (zero_trust.GatewayConfigurationUpdateResponse, error)
+- client.ZeroTrust.Gateway.Configurations.Edit(ctx context.Context, params zero_trust.GatewayConfigurationEditParams) (zero_trust.GatewayConfigurationEditResponse, error)
+- client.ZeroTrust.Gateway.Configurations.Get(ctx context.Context, query zero_trust.GatewayConfigurationGetParams) (zero_trust.GatewayConfigurationGetResponse, error)
### Lists
Response Types:
-- cloudflare.ZeroTrustGatewayListNewResponse
-- cloudflare.ZeroTrustGatewayListUpdateResponse
-- cloudflare.ZeroTrustGatewayListListResponse
-- cloudflare.ZeroTrustGatewayListDeleteResponse
-- cloudflare.ZeroTrustGatewayListEditResponse
-- cloudflare.ZeroTrustGatewayListGetResponse
+- zero_trust.ZeroTrustGatewayLists
+- zero_trust.GatewayListNewResponse
+- zero_trust.GatewayListDeleteResponse
Methods:
-- client.ZeroTrust.Gateway.Lists.New(ctx context.Context, params cloudflare.ZeroTrustGatewayListNewParams) (cloudflare.ZeroTrustGatewayListNewResponse, error)
-- client.ZeroTrust.Gateway.Lists.Update(ctx context.Context, listID string, params cloudflare.ZeroTrustGatewayListUpdateParams) (cloudflare.ZeroTrustGatewayListUpdateResponse, error)
-- client.ZeroTrust.Gateway.Lists.List(ctx context.Context, query cloudflare.ZeroTrustGatewayListListParams) ([]cloudflare.ZeroTrustGatewayListListResponse, error)
-- client.ZeroTrust.Gateway.Lists.Delete(ctx context.Context, listID string, body cloudflare.ZeroTrustGatewayListDeleteParams) (cloudflare.ZeroTrustGatewayListDeleteResponse, error)
-- client.ZeroTrust.Gateway.Lists.Edit(ctx context.Context, listID string, params cloudflare.ZeroTrustGatewayListEditParams) (cloudflare.ZeroTrustGatewayListEditResponse, error)
-- client.ZeroTrust.Gateway.Lists.Get(ctx context.Context, listID string, query cloudflare.ZeroTrustGatewayListGetParams) (cloudflare.ZeroTrustGatewayListGetResponse, error)
+- client.ZeroTrust.Gateway.Lists.New(ctx context.Context, params zero_trust.GatewayListNewParams) (zero_trust.GatewayListNewResponse, error)
+- client.ZeroTrust.Gateway.Lists.Update(ctx context.Context, listID string, params zero_trust.GatewayListUpdateParams) (zero_trust.ZeroTrustGatewayLists, error)
+- client.ZeroTrust.Gateway.Lists.List(ctx context.Context, query zero_trust.GatewayListListParams) ([]zero_trust.ZeroTrustGatewayLists, error)
+- client.ZeroTrust.Gateway.Lists.Delete(ctx context.Context, listID string, body zero_trust.GatewayListDeleteParams) (zero_trust.GatewayListDeleteResponse, error)
+- client.ZeroTrust.Gateway.Lists.Edit(ctx context.Context, listID string, params zero_trust.GatewayListEditParams) (zero_trust.ZeroTrustGatewayLists, error)
+- client.ZeroTrust.Gateway.Lists.Get(ctx context.Context, listID string, query zero_trust.GatewayListGetParams) (zero_trust.ZeroTrustGatewayLists, error)
#### Items
Response Types:
-- cloudflare.ZeroTrustGatewayListItemListResponse
+- zero_trust.GatewayListItemListResponse
Methods:
-- client.ZeroTrust.Gateway.Lists.Items.List(ctx context.Context, listID string, query cloudflare.ZeroTrustGatewayListItemListParams) ([][]cloudflare.ZeroTrustGatewayListItemListResponse, error)
+- client.ZeroTrust.Gateway.Lists.Items.List(ctx context.Context, listID string, query zero_trust.GatewayListItemListParams) ([][]zero_trust.GatewayListItemListResponse, error)
### Locations
Response Types:
-- cloudflare.ZeroTrustGatewayLocationNewResponse
-- cloudflare.ZeroTrustGatewayLocationUpdateResponse
-- cloudflare.ZeroTrustGatewayLocationListResponse
-- cloudflare.ZeroTrustGatewayLocationDeleteResponse
-- cloudflare.ZeroTrustGatewayLocationGetResponse
+- zero_trust.ZeroTrustGatewayLocations
+- zero_trust.GatewayLocationDeleteResponse
Methods:
-- client.ZeroTrust.Gateway.Locations.New(ctx context.Context, params cloudflare.ZeroTrustGatewayLocationNewParams) (cloudflare.ZeroTrustGatewayLocationNewResponse, error)
-- client.ZeroTrust.Gateway.Locations.Update(ctx context.Context, locationID interface{}, params cloudflare.ZeroTrustGatewayLocationUpdateParams) (cloudflare.ZeroTrustGatewayLocationUpdateResponse, error)
-- client.ZeroTrust.Gateway.Locations.List(ctx context.Context, query cloudflare.ZeroTrustGatewayLocationListParams) ([]cloudflare.ZeroTrustGatewayLocationListResponse, error)
-- client.ZeroTrust.Gateway.Locations.Delete(ctx context.Context, locationID interface{}, body cloudflare.ZeroTrustGatewayLocationDeleteParams) (cloudflare.ZeroTrustGatewayLocationDeleteResponse, error)
-- client.ZeroTrust.Gateway.Locations.Get(ctx context.Context, locationID interface{}, query cloudflare.ZeroTrustGatewayLocationGetParams) (cloudflare.ZeroTrustGatewayLocationGetResponse, error)
+- client.ZeroTrust.Gateway.Locations.New(ctx context.Context, params zero_trust.GatewayLocationNewParams) (zero_trust.ZeroTrustGatewayLocations, error)
+- client.ZeroTrust.Gateway.Locations.Update(ctx context.Context, locationID interface{}, params zero_trust.GatewayLocationUpdateParams) (zero_trust.ZeroTrustGatewayLocations, error)
+- client.ZeroTrust.Gateway.Locations.List(ctx context.Context, query zero_trust.GatewayLocationListParams) ([]zero_trust.ZeroTrustGatewayLocations, error)
+- client.ZeroTrust.Gateway.Locations.Delete(ctx context.Context, locationID interface{}, body zero_trust.GatewayLocationDeleteParams) (zero_trust.GatewayLocationDeleteResponse, error)
+- client.ZeroTrust.Gateway.Locations.Get(ctx context.Context, locationID interface{}, query zero_trust.GatewayLocationGetParams) (zero_trust.ZeroTrustGatewayLocations, error)
### Loggings
Response Types:
-- cloudflare.ZeroTrustGatewayLoggingUpdateResponse
-- cloudflare.ZeroTrustGatewayLoggingGetResponse
+- zero_trust.ZeroTrustGatewayGatewayAccountLoggingSettings
Methods:
-- client.ZeroTrust.Gateway.Loggings.Update(ctx context.Context, params cloudflare.ZeroTrustGatewayLoggingUpdateParams) (cloudflare.ZeroTrustGatewayLoggingUpdateResponse, error)
-- client.ZeroTrust.Gateway.Loggings.Get(ctx context.Context, query cloudflare.ZeroTrustGatewayLoggingGetParams) (cloudflare.ZeroTrustGatewayLoggingGetResponse, error)
+- client.ZeroTrust.Gateway.Loggings.Update(ctx context.Context, params zero_trust.GatewayLoggingUpdateParams) (zero_trust.ZeroTrustGatewayGatewayAccountLoggingSettings, error)
+- client.ZeroTrust.Gateway.Loggings.Get(ctx context.Context, query zero_trust.GatewayLoggingGetParams) (zero_trust.ZeroTrustGatewayGatewayAccountLoggingSettings, error)
### ProxyEndpoints
Response Types:
-- cloudflare.ZeroTrustGatewayProxyEndpointNewResponse
-- cloudflare.ZeroTrustGatewayProxyEndpointListResponse
-- cloudflare.ZeroTrustGatewayProxyEndpointDeleteResponse
-- cloudflare.ZeroTrustGatewayProxyEndpointEditResponse
-- cloudflare.ZeroTrustGatewayProxyEndpointGetResponse
+- zero_trust.ZeroTrustGatewayProxyEndpoints
+- zero_trust.GatewayProxyEndpointDeleteResponse
Methods:
-- client.ZeroTrust.Gateway.ProxyEndpoints.New(ctx context.Context, params cloudflare.ZeroTrustGatewayProxyEndpointNewParams) (cloudflare.ZeroTrustGatewayProxyEndpointNewResponse, error)
-- client.ZeroTrust.Gateway.ProxyEndpoints.List(ctx context.Context, query cloudflare.ZeroTrustGatewayProxyEndpointListParams) ([]cloudflare.ZeroTrustGatewayProxyEndpointListResponse, error)
-- client.ZeroTrust.Gateway.ProxyEndpoints.Delete(ctx context.Context, proxyEndpointID interface{}, body cloudflare.ZeroTrustGatewayProxyEndpointDeleteParams) (cloudflare.ZeroTrustGatewayProxyEndpointDeleteResponse, error)
-- client.ZeroTrust.Gateway.ProxyEndpoints.Edit(ctx context.Context, proxyEndpointID interface{}, params cloudflare.ZeroTrustGatewayProxyEndpointEditParams) (cloudflare.ZeroTrustGatewayProxyEndpointEditResponse, error)
-- client.ZeroTrust.Gateway.ProxyEndpoints.Get(ctx context.Context, proxyEndpointID interface{}, query cloudflare.ZeroTrustGatewayProxyEndpointGetParams) (cloudflare.ZeroTrustGatewayProxyEndpointGetResponse, error)
+- client.ZeroTrust.Gateway.ProxyEndpoints.New(ctx context.Context, params zero_trust.GatewayProxyEndpointNewParams) (zero_trust.ZeroTrustGatewayProxyEndpoints, error)
+- client.ZeroTrust.Gateway.ProxyEndpoints.List(ctx context.Context, query zero_trust.GatewayProxyEndpointListParams) ([]zero_trust.ZeroTrustGatewayProxyEndpoints, error)
+- client.ZeroTrust.Gateway.ProxyEndpoints.Delete(ctx context.Context, proxyEndpointID interface{}, body zero_trust.GatewayProxyEndpointDeleteParams) (zero_trust.GatewayProxyEndpointDeleteResponse, error)
+- client.ZeroTrust.Gateway.ProxyEndpoints.Edit(ctx context.Context, proxyEndpointID interface{}, params zero_trust.GatewayProxyEndpointEditParams) (zero_trust.ZeroTrustGatewayProxyEndpoints, error)
+- client.ZeroTrust.Gateway.ProxyEndpoints.Get(ctx context.Context, proxyEndpointID interface{}, query zero_trust.GatewayProxyEndpointGetParams) (zero_trust.ZeroTrustGatewayProxyEndpoints, error)
### Rules
Response Types:
-- cloudflare.ZeroTrustGatewayRuleNewResponse
-- cloudflare.ZeroTrustGatewayRuleUpdateResponse
-- cloudflare.ZeroTrustGatewayRuleListResponse
-- cloudflare.ZeroTrustGatewayRuleDeleteResponse
-- cloudflare.ZeroTrustGatewayRuleGetResponse
+- zero_trust.ZeroTrustGatewayRules
+- zero_trust.GatewayRuleDeleteResponse
Methods:
-- client.ZeroTrust.Gateway.Rules.New(ctx context.Context, params cloudflare.ZeroTrustGatewayRuleNewParams) (cloudflare.ZeroTrustGatewayRuleNewResponse, error)
-- client.ZeroTrust.Gateway.Rules.Update(ctx context.Context, ruleID string, params cloudflare.ZeroTrustGatewayRuleUpdateParams) (cloudflare.ZeroTrustGatewayRuleUpdateResponse, error)
-- client.ZeroTrust.Gateway.Rules.List(ctx context.Context, query cloudflare.ZeroTrustGatewayRuleListParams) ([]cloudflare.ZeroTrustGatewayRuleListResponse, error)
-- client.ZeroTrust.Gateway.Rules.Delete(ctx context.Context, ruleID string, body cloudflare.ZeroTrustGatewayRuleDeleteParams) (cloudflare.ZeroTrustGatewayRuleDeleteResponse, error)
-- client.ZeroTrust.Gateway.Rules.Get(ctx context.Context, ruleID string, query cloudflare.ZeroTrustGatewayRuleGetParams) (cloudflare.ZeroTrustGatewayRuleGetResponse, error)
+- client.ZeroTrust.Gateway.Rules.New(ctx context.Context, params zero_trust.GatewayRuleNewParams) (zero_trust.ZeroTrustGatewayRules, error)
+- client.ZeroTrust.Gateway.Rules.Update(ctx context.Context, ruleID string, params zero_trust.GatewayRuleUpdateParams) (zero_trust.ZeroTrustGatewayRules, error)
+- client.ZeroTrust.Gateway.Rules.List(ctx context.Context, query zero_trust.GatewayRuleListParams) ([]zero_trust.ZeroTrustGatewayRules, error)
+- client.ZeroTrust.Gateway.Rules.Delete(ctx context.Context, ruleID string, body zero_trust.GatewayRuleDeleteParams) (zero_trust.GatewayRuleDeleteResponse, error)
+- client.ZeroTrust.Gateway.Rules.Get(ctx context.Context, ruleID string, query zero_trust.GatewayRuleGetParams) (zero_trust.ZeroTrustGatewayRules, error)
## Networks
@@ -5057,57 +4966,45 @@ Methods:
Response Types:
-- cloudflare.ZeroTrustNetworkRouteNewResponse
-- cloudflare.ZeroTrustNetworkRouteListResponse
-- cloudflare.ZeroTrustNetworkRouteDeleteResponse
-- cloudflare.ZeroTrustNetworkRouteEditResponse
+- zero_trust.TunnelRoute
+- zero_trust.TunnelTeamnet
Methods:
-- client.ZeroTrust.Networks.Routes.New(ctx context.Context, params cloudflare.ZeroTrustNetworkRouteNewParams) (cloudflare.ZeroTrustNetworkRouteNewResponse, error)
-- client.ZeroTrust.Networks.Routes.List(ctx context.Context, params cloudflare.ZeroTrustNetworkRouteListParams) (shared.V4PagePaginationArray[cloudflare.ZeroTrustNetworkRouteListResponse], error)
-- client.ZeroTrust.Networks.Routes.Delete(ctx context.Context, routeID string, body cloudflare.ZeroTrustNetworkRouteDeleteParams) (cloudflare.ZeroTrustNetworkRouteDeleteResponse, error)
-- client.ZeroTrust.Networks.Routes.Edit(ctx context.Context, routeID string, params cloudflare.ZeroTrustNetworkRouteEditParams) (cloudflare.ZeroTrustNetworkRouteEditResponse, error)
+- client.ZeroTrust.Networks.Routes.New(ctx context.Context, params zero_trust.NetworkRouteNewParams) (zero_trust.TunnelRoute, error)
+- client.ZeroTrust.Networks.Routes.List(ctx context.Context, params zero_trust.NetworkRouteListParams) (shared.V4PagePaginationArray[zero_trust.TunnelTeamnet], error)
+- client.ZeroTrust.Networks.Routes.Delete(ctx context.Context, routeID string, body zero_trust.NetworkRouteDeleteParams) (zero_trust.TunnelRoute, error)
+- client.ZeroTrust.Networks.Routes.Edit(ctx context.Context, routeID string, params zero_trust.NetworkRouteEditParams) (zero_trust.TunnelRoute, error)
#### IPs
-Response Types:
-
-- cloudflare.ZeroTrustNetworkRouteIPGetResponse
-
Methods:
-- client.ZeroTrust.Networks.Routes.IPs.Get(ctx context.Context, ip string, params cloudflare.ZeroTrustNetworkRouteIPGetParams) (cloudflare.ZeroTrustNetworkRouteIPGetResponse, error)
+- client.ZeroTrust.Networks.Routes.IPs.Get(ctx context.Context, ip string, params zero_trust.NetworkRouteIPGetParams) (zero_trust.TunnelTeamnet, error)
#### Networks
-Response Types:
-
-- cloudflare.ZeroTrustNetworkRouteNetworkNewResponse
-- cloudflare.ZeroTrustNetworkRouteNetworkDeleteResponse
-- cloudflare.ZeroTrustNetworkRouteNetworkEditResponse
-
Methods:
-- client.ZeroTrust.Networks.Routes.Networks.New(ctx context.Context, ipNetworkEncoded string, params cloudflare.ZeroTrustNetworkRouteNetworkNewParams) (cloudflare.ZeroTrustNetworkRouteNetworkNewResponse, error)
-- client.ZeroTrust.Networks.Routes.Networks.Delete(ctx context.Context, ipNetworkEncoded string, params cloudflare.ZeroTrustNetworkRouteNetworkDeleteParams) (cloudflare.ZeroTrustNetworkRouteNetworkDeleteResponse, error)
-- client.ZeroTrust.Networks.Routes.Networks.Edit(ctx context.Context, ipNetworkEncoded string, body cloudflare.ZeroTrustNetworkRouteNetworkEditParams) (cloudflare.ZeroTrustNetworkRouteNetworkEditResponse, error)
+- client.ZeroTrust.Networks.Routes.Networks.New(ctx context.Context, ipNetworkEncoded string, params zero_trust.NetworkRouteNetworkNewParams) (zero_trust.TunnelRoute, error)
+- client.ZeroTrust.Networks.Routes.Networks.Delete(ctx context.Context, ipNetworkEncoded string, params zero_trust.NetworkRouteNetworkDeleteParams) (zero_trust.TunnelRoute, error)
+- client.ZeroTrust.Networks.Routes.Networks.Edit(ctx context.Context, ipNetworkEncoded string, body zero_trust.NetworkRouteNetworkEditParams) (zero_trust.TunnelRoute, error)
### VirtualNetworks
Response Types:
-- cloudflare.ZeroTrustNetworkVirtualNetworkNewResponse
-- cloudflare.ZeroTrustNetworkVirtualNetworkListResponse
-- cloudflare.ZeroTrustNetworkVirtualNetworkDeleteResponse
-- cloudflare.ZeroTrustNetworkVirtualNetworkEditResponse
+- zero_trust.TunnelVirtualNetwork
+- zero_trust.NetworkVirtualNetworkNewResponse
+- zero_trust.NetworkVirtualNetworkDeleteResponse
+- zero_trust.NetworkVirtualNetworkEditResponse
Methods:
-- client.ZeroTrust.Networks.VirtualNetworks.New(ctx context.Context, params cloudflare.ZeroTrustNetworkVirtualNetworkNewParams) (cloudflare.ZeroTrustNetworkVirtualNetworkNewResponse, error)
-- client.ZeroTrust.Networks.VirtualNetworks.List(ctx context.Context, params cloudflare.ZeroTrustNetworkVirtualNetworkListParams) ([]cloudflare.ZeroTrustNetworkVirtualNetworkListResponse, error)
-- client.ZeroTrust.Networks.VirtualNetworks.Delete(ctx context.Context, virtualNetworkID string, body cloudflare.ZeroTrustNetworkVirtualNetworkDeleteParams) (cloudflare.ZeroTrustNetworkVirtualNetworkDeleteResponse, error)
-- client.ZeroTrust.Networks.VirtualNetworks.Edit(ctx context.Context, virtualNetworkID string, params cloudflare.ZeroTrustNetworkVirtualNetworkEditParams) (cloudflare.ZeroTrustNetworkVirtualNetworkEditResponse, error)
+- client.ZeroTrust.Networks.VirtualNetworks.New(ctx context.Context, params zero_trust.NetworkVirtualNetworkNewParams) (zero_trust.NetworkVirtualNetworkNewResponse, error)
+- client.ZeroTrust.Networks.VirtualNetworks.List(ctx context.Context, params zero_trust.NetworkVirtualNetworkListParams) ([]zero_trust.TunnelVirtualNetwork, error)
+- client.ZeroTrust.Networks.VirtualNetworks.Delete(ctx context.Context, virtualNetworkID string, body zero_trust.NetworkVirtualNetworkDeleteParams) (zero_trust.NetworkVirtualNetworkDeleteResponse, error)
+- client.ZeroTrust.Networks.VirtualNetworks.Edit(ctx context.Context, virtualNetworkID string, params zero_trust.NetworkVirtualNetworkEditParams) (zero_trust.NetworkVirtualNetworkEditResponse, error)
# Challenges
@@ -5115,21 +5012,17 @@ Methods:
Response Types:
-- cloudflare.ChallengeWidgetNewResponse
-- cloudflare.ChallengeWidgetUpdateResponse
-- cloudflare.ChallengeWidgetListResponse
-- cloudflare.ChallengeWidgetDeleteResponse
-- cloudflare.ChallengeWidgetGetResponse
-- cloudflare.ChallengeWidgetRotateSecretResponse
+- challenges.NcChallengesAdminWidgetDetail
+- challenges.NcChallengesAdminWidgetList
Methods:
-- client.Challenges.Widgets.New(ctx context.Context, accountIdentifier string, params cloudflare.ChallengeWidgetNewParams) (cloudflare.ChallengeWidgetNewResponse, error)
-- client.Challenges.Widgets.Update(ctx context.Context, accountIdentifier string, sitekey string, body cloudflare.ChallengeWidgetUpdateParams) (cloudflare.ChallengeWidgetUpdateResponse, error)
-- client.Challenges.Widgets.List(ctx context.Context, accountIdentifier string, query cloudflare.ChallengeWidgetListParams) (shared.V4PagePaginationArray[cloudflare.ChallengeWidgetListResponse], error)
-- client.Challenges.Widgets.Delete(ctx context.Context, accountIdentifier string, sitekey string) (cloudflare.ChallengeWidgetDeleteResponse, error)
-- client.Challenges.Widgets.Get(ctx context.Context, accountIdentifier string, sitekey string) (cloudflare.ChallengeWidgetGetResponse, error)
-- client.Challenges.Widgets.RotateSecret(ctx context.Context, accountIdentifier string, sitekey string, body cloudflare.ChallengeWidgetRotateSecretParams) (cloudflare.ChallengeWidgetRotateSecretResponse, error)
+- client.Challenges.Widgets.New(ctx context.Context, accountIdentifier string, params challenges.WidgetNewParams) (challenges.NcChallengesAdminWidgetDetail, error)
+- client.Challenges.Widgets.Update(ctx context.Context, accountIdentifier string, sitekey string, body challenges.WidgetUpdateParams) (challenges.NcChallengesAdminWidgetDetail, error)
+- client.Challenges.Widgets.List(ctx context.Context, accountIdentifier string, query challenges.WidgetListParams) (shared.V4PagePaginationArray[challenges.NcChallengesAdminWidgetList], error)
+- client.Challenges.Widgets.Delete(ctx context.Context, accountIdentifier string, sitekey string) (challenges.NcChallengesAdminWidgetDetail, error)
+- client.Challenges.Widgets.Get(ctx context.Context, accountIdentifier string, sitekey string) (challenges.NcChallengesAdminWidgetDetail, error)
+- client.Challenges.Widgets.RotateSecret(ctx context.Context, accountIdentifier string, sitekey string, body challenges.WidgetRotateSecretParams) (challenges.NcChallengesAdminWidgetDetail, error)
# Hyperdrive
@@ -5137,21 +5030,21 @@ Methods:
Response Types:
-- cloudflare.HyperdriveConfigNewResponse
-- cloudflare.HyperdriveConfigUpdateResponse
-- cloudflare.HyperdriveConfigListResponse
-- cloudflare.HyperdriveConfigDeleteResponse
-- cloudflare.HyperdriveConfigEditResponse
-- cloudflare.HyperdriveConfigGetResponse
+- hyperdrive.ConfigNewResponse
+- hyperdrive.ConfigUpdateResponse
+- hyperdrive.ConfigListResponse
+- hyperdrive.ConfigDeleteResponse
+- hyperdrive.ConfigEditResponse
+- hyperdrive.ConfigGetResponse
Methods:
-- client.Hyperdrive.Configs.New(ctx context.Context, params cloudflare.HyperdriveConfigNewParams) (cloudflare.HyperdriveConfigNewResponse, error)
-- client.Hyperdrive.Configs.Update(ctx context.Context, hyperdriveID string, params cloudflare.HyperdriveConfigUpdateParams) (cloudflare.HyperdriveConfigUpdateResponse, error)
-- client.Hyperdrive.Configs.List(ctx context.Context, query cloudflare.HyperdriveConfigListParams) ([]cloudflare.HyperdriveConfigListResponse, error)
-- client.Hyperdrive.Configs.Delete(ctx context.Context, hyperdriveID string, body cloudflare.HyperdriveConfigDeleteParams) (cloudflare.HyperdriveConfigDeleteResponse, error)
-- client.Hyperdrive.Configs.Edit(ctx context.Context, hyperdriveID string, params cloudflare.HyperdriveConfigEditParams) (cloudflare.HyperdriveConfigEditResponse, error)
-- client.Hyperdrive.Configs.Get(ctx context.Context, hyperdriveID string, query cloudflare.HyperdriveConfigGetParams) (cloudflare.HyperdriveConfigGetResponse, error)
+- client.Hyperdrive.Configs.New(ctx context.Context, params hyperdrive.ConfigNewParams) (hyperdrive.ConfigNewResponse, error)
+- client.Hyperdrive.Configs.Update(ctx context.Context, hyperdriveID string, params hyperdrive.ConfigUpdateParams) (hyperdrive.ConfigUpdateResponse, error)
+- client.Hyperdrive.Configs.List(ctx context.Context, query hyperdrive.ConfigListParams) ([]hyperdrive.ConfigListResponse, error)
+- client.Hyperdrive.Configs.Delete(ctx context.Context, hyperdriveID string, body hyperdrive.ConfigDeleteParams) (hyperdrive.ConfigDeleteResponse, error)
+- client.Hyperdrive.Configs.Edit(ctx context.Context, hyperdriveID string, params hyperdrive.ConfigEditParams) (hyperdrive.ConfigEditResponse, error)
+- client.Hyperdrive.Configs.Get(ctx context.Context, hyperdriveID string, query hyperdrive.ConfigGetParams) (hyperdrive.ConfigGetResponse, error)
# RUM
@@ -5159,35 +5052,31 @@ Methods:
Response Types:
-- cloudflare.RUMSiteInfoNewResponse
-- cloudflare.RUMSiteInfoUpdateResponse
-- cloudflare.RUMSiteInfoListResponse
-- cloudflare.RUMSiteInfoDeleteResponse
-- cloudflare.RUMSiteInfoGetResponse
+- rum.RUMSite
+- rum.SiteInfoDeleteResponse
Methods:
-- client.RUM.SiteInfos.New(ctx context.Context, params cloudflare.RUMSiteInfoNewParams) (cloudflare.RUMSiteInfoNewResponse, error)
-- client.RUM.SiteInfos.Update(ctx context.Context, siteID string, params cloudflare.RUMSiteInfoUpdateParams) (cloudflare.RUMSiteInfoUpdateResponse, error)
-- client.RUM.SiteInfos.List(ctx context.Context, params cloudflare.RUMSiteInfoListParams) (shared.V4PagePaginationArray[cloudflare.RUMSiteInfoListResponse], error)
-- client.RUM.SiteInfos.Delete(ctx context.Context, siteID string, body cloudflare.RUMSiteInfoDeleteParams) (cloudflare.RUMSiteInfoDeleteResponse, error)
-- client.RUM.SiteInfos.Get(ctx context.Context, siteID string, query cloudflare.RUMSiteInfoGetParams) (cloudflare.RUMSiteInfoGetResponse, error)
+- client.RUM.SiteInfos.New(ctx context.Context, params rum.SiteInfoNewParams) (rum.RUMSite, error)
+- client.RUM.SiteInfos.Update(ctx context.Context, siteID string, params rum.SiteInfoUpdateParams) (rum.RUMSite, error)
+- client.RUM.SiteInfos.List(ctx context.Context, params rum.SiteInfoListParams) (shared.V4PagePaginationArray[rum.RUMSite], error)
+- client.RUM.SiteInfos.Delete(ctx context.Context, siteID string, body rum.SiteInfoDeleteParams) (rum.SiteInfoDeleteResponse, error)
+- client.RUM.SiteInfos.Get(ctx context.Context, siteID string, query rum.SiteInfoGetParams) (rum.RUMSite, error)
## Rules
Response Types:
-- cloudflare.RUMRuleNewResponse
-- cloudflare.RUMRuleUpdateResponse
-- cloudflare.RUMRuleListResponse
-- cloudflare.RUMRuleDeleteResponse
+- rum.RUMRule
+- rum.RuleListResponse
+- rum.RuleDeleteResponse
Methods:
-- client.RUM.Rules.New(ctx context.Context, rulesetID string, params cloudflare.RUMRuleNewParams) (cloudflare.RUMRuleNewResponse, error)
-- client.RUM.Rules.Update(ctx context.Context, rulesetID string, ruleID string, params cloudflare.RUMRuleUpdateParams) (cloudflare.RUMRuleUpdateResponse, error)
-- client.RUM.Rules.List(ctx context.Context, rulesetID string, query cloudflare.RUMRuleListParams) (cloudflare.RUMRuleListResponse, error)
-- client.RUM.Rules.Delete(ctx context.Context, rulesetID string, ruleID string, body cloudflare.RUMRuleDeleteParams) (cloudflare.RUMRuleDeleteResponse, error)
+- client.RUM.Rules.New(ctx context.Context, rulesetID string, params rum.RuleNewParams) (rum.RUMRule, error)
+- client.RUM.Rules.Update(ctx context.Context, rulesetID string, ruleID string, params rum.RuleUpdateParams) (rum.RUMRule, error)
+- client.RUM.Rules.List(ctx context.Context, rulesetID string, query rum.RuleListParams) (rum.RuleListResponse, error)
+- client.RUM.Rules.Delete(ctx context.Context, rulesetID string, ruleID string, body rum.RuleDeleteParams) (rum.RuleDeleteResponse, error)
# Vectorize
@@ -5195,54 +5084,51 @@ Methods:
Response Types:
-- cloudflare.VectorizeIndexNewResponse
-- cloudflare.VectorizeIndexUpdateResponse
-- cloudflare.VectorizeIndexListResponse
-- cloudflare.VectorizeIndexDeleteResponse
-- cloudflare.VectorizeIndexDeleteByIDsResponse
-- cloudflare.VectorizeIndexGetResponse
-- cloudflare.VectorizeIndexGetByIDsResponse
-- cloudflare.VectorizeIndexInsertResponse
-- cloudflare.VectorizeIndexQueryResponse
-- cloudflare.VectorizeIndexUpsertResponse
+- vectorize.VectorizeCreateIndex
+- vectorize.VectorizeIndexDeleteVectorsByID
+- vectorize.VectorizeIndexInsert
+- vectorize.VectorizeIndexQuery
+- vectorize.VectorizeIndexUpsert
+- vectorize.IndexDeleteResponse
+- vectorize.IndexGetByIDsResponse
Methods:
-- client.Vectorize.Indexes.New(ctx context.Context, accountIdentifier string, body cloudflare.VectorizeIndexNewParams) (cloudflare.VectorizeIndexNewResponse, error)
-- client.Vectorize.Indexes.Update(ctx context.Context, accountIdentifier string, indexName string, body cloudflare.VectorizeIndexUpdateParams) (cloudflare.VectorizeIndexUpdateResponse, error)
-- client.Vectorize.Indexes.List(ctx context.Context, accountIdentifier string) ([]cloudflare.VectorizeIndexListResponse, error)
-- client.Vectorize.Indexes.Delete(ctx context.Context, accountIdentifier string, indexName string) (cloudflare.VectorizeIndexDeleteResponse, error)
-- client.Vectorize.Indexes.DeleteByIDs(ctx context.Context, accountIdentifier string, indexName string, body cloudflare.VectorizeIndexDeleteByIDsParams) (cloudflare.VectorizeIndexDeleteByIDsResponse, error)
-- client.Vectorize.Indexes.Get(ctx context.Context, accountIdentifier string, indexName string) (cloudflare.VectorizeIndexGetResponse, error)
-- client.Vectorize.Indexes.GetByIDs(ctx context.Context, accountIdentifier string, indexName string, body cloudflare.VectorizeIndexGetByIDsParams) (cloudflare.VectorizeIndexGetByIDsResponse, error)
-- client.Vectorize.Indexes.Insert(ctx context.Context, accountIdentifier string, indexName string) (cloudflare.VectorizeIndexInsertResponse, error)
-- client.Vectorize.Indexes.Query(ctx context.Context, accountIdentifier string, indexName string, body cloudflare.VectorizeIndexQueryParams) (cloudflare.VectorizeIndexQueryResponse, error)
-- client.Vectorize.Indexes.Upsert(ctx context.Context, accountIdentifier string, indexName string) (cloudflare.VectorizeIndexUpsertResponse, error)
+- client.Vectorize.Indexes.New(ctx context.Context, accountIdentifier string, body vectorize.IndexNewParams) (vectorize.VectorizeCreateIndex, error)
+- client.Vectorize.Indexes.Update(ctx context.Context, accountIdentifier string, indexName string, body vectorize.IndexUpdateParams) (vectorize.VectorizeCreateIndex, error)
+- client.Vectorize.Indexes.List(ctx context.Context, accountIdentifier string) ([]vectorize.VectorizeCreateIndex, error)
+- client.Vectorize.Indexes.Delete(ctx context.Context, accountIdentifier string, indexName string) (vectorize.IndexDeleteResponse, error)
+- client.Vectorize.Indexes.DeleteByIDs(ctx context.Context, accountIdentifier string, indexName string, body vectorize.IndexDeleteByIDsParams) (vectorize.VectorizeIndexDeleteVectorsByID, error)
+- client.Vectorize.Indexes.Get(ctx context.Context, accountIdentifier string, indexName string) (vectorize.VectorizeCreateIndex, error)
+- client.Vectorize.Indexes.GetByIDs(ctx context.Context, accountIdentifier string, indexName string, body vectorize.IndexGetByIDsParams) (vectorize.IndexGetByIDsResponse, error)
+- client.Vectorize.Indexes.Insert(ctx context.Context, accountIdentifier string, indexName string) (vectorize.VectorizeIndexInsert, error)
+- client.Vectorize.Indexes.Query(ctx context.Context, accountIdentifier string, indexName string, body vectorize.IndexQueryParams) (vectorize.VectorizeIndexQuery, error)
+- client.Vectorize.Indexes.Upsert(ctx context.Context, accountIdentifier string, indexName string) (vectorize.VectorizeIndexUpsert, error)
# URLScanner
Response Types:
-- cloudflare.URLScannerScanResponse
+- url_scanner.URLScannerScanResponse
Methods:
-- client.URLScanner.Scan(ctx context.Context, accountID string, query cloudflare.URLScannerScanParams) (cloudflare.URLScannerScanResponse, error)
+- client.URLScanner.Scan(ctx context.Context, accountID string, query url_scanner.URLScannerScanParams) (url_scanner.URLScannerScanResponse, error)
## Scans
Response Types:
-- cloudflare.URLScannerScanNewResponse
-- cloudflare.URLScannerScanGetResponse
-- cloudflare.URLScannerScanHarResponse
+- url_scanner.ScanNewResponse
+- url_scanner.ScanGetResponse
+- url_scanner.ScanHarResponse
Methods:
-- client.URLScanner.Scans.New(ctx context.Context, accountID string, body cloudflare.URLScannerScanNewParams) (cloudflare.URLScannerScanNewResponse, error)
-- client.URLScanner.Scans.Get(ctx context.Context, accountID string, scanID string) (cloudflare.URLScannerScanGetResponse, error)
-- client.URLScanner.Scans.Har(ctx context.Context, accountID string, scanID string) (cloudflare.URLScannerScanHarResponse, error)
-- client.URLScanner.Scans.Screenshot(ctx context.Context, accountID string, scanID string, query cloudflare.URLScannerScanScreenshotParams) (http.Response, error)
+- client.URLScanner.Scans.New(ctx context.Context, accountID string, body url_scanner.ScanNewParams) (url_scanner.ScanNewResponse, error)
+- client.URLScanner.Scans.Get(ctx context.Context, accountID string, scanID string) (url_scanner.ScanGetResponse, error)
+- client.URLScanner.Scans.Har(ctx context.Context, accountID string, scanID string) (url_scanner.ScanHarResponse, error)
+- client.URLScanner.Scans.Screenshot(ctx context.Context, accountID string, scanID string, query url_scanner.ScanScreenshotParams) (http.Response, error)
# Radar
@@ -5252,94 +5138,94 @@ Methods:
Response Types:
-- cloudflare.RadarAnnotationOutageGetResponse
-- cloudflare.RadarAnnotationOutageLocationsResponse
+- radar.AnnotationOutageGetResponse
+- radar.AnnotationOutageLocationsResponse
Methods:
-- client.Radar.Annotations.Outages.Get(ctx context.Context, query cloudflare.RadarAnnotationOutageGetParams) (cloudflare.RadarAnnotationOutageGetResponse, error)
-- client.Radar.Annotations.Outages.Locations(ctx context.Context, query cloudflare.RadarAnnotationOutageLocationsParams) (cloudflare.RadarAnnotationOutageLocationsResponse, error)
+- client.Radar.Annotations.Outages.Get(ctx context.Context, query radar.AnnotationOutageGetParams) (radar.AnnotationOutageGetResponse, error)
+- client.Radar.Annotations.Outages.Locations(ctx context.Context, query radar.AnnotationOutageLocationsParams) (radar.AnnotationOutageLocationsResponse, error)
## BGP
Response Types:
-- cloudflare.RadarBGPTimeseriesResponse
+- radar.BGPTimeseriesResponse
Methods:
-- client.Radar.BGP.Timeseries(ctx context.Context, query cloudflare.RadarBGPTimeseriesParams) (cloudflare.RadarBGPTimeseriesResponse, error)
+- client.Radar.BGP.Timeseries(ctx context.Context, query radar.BGPTimeseriesParams) (radar.BGPTimeseriesResponse, error)
### Leaks
Response Types:
-- cloudflare.RadarBGPLeakEventsResponse
+- radar.BGPLeakEventsResponse
Methods:
-- client.Radar.BGP.Leaks.Events(ctx context.Context, query cloudflare.RadarBGPLeakEventsParams) (cloudflare.RadarBGPLeakEventsResponse, error)
+- client.Radar.BGP.Leaks.Events(ctx context.Context, query radar.BGPLeakEventsParams) (radar.BGPLeakEventsResponse, error)
### Top
Response Types:
-- cloudflare.RadarBGPTopPrefixesResponse
+- radar.BGPTopPrefixesResponse
Methods:
-- client.Radar.BGP.Top.Prefixes(ctx context.Context, query cloudflare.RadarBGPTopPrefixesParams) (cloudflare.RadarBGPTopPrefixesResponse, error)
+- client.Radar.BGP.Top.Prefixes(ctx context.Context, query radar.BGPTopPrefixesParams) (radar.BGPTopPrefixesResponse, error)
#### Ases
Response Types:
-- cloudflare.RadarBGPTopAseGetResponse
-- cloudflare.RadarBGPTopAsePrefixesResponse
+- radar.BGPTopAseGetResponse
+- radar.BGPTopAsePrefixesResponse
Methods:
-- client.Radar.BGP.Top.Ases.Get(ctx context.Context, query cloudflare.RadarBGPTopAseGetParams) (cloudflare.RadarBGPTopAseGetResponse, error)
-- client.Radar.BGP.Top.Ases.Prefixes(ctx context.Context, query cloudflare.RadarBGPTopAsePrefixesParams) (cloudflare.RadarBGPTopAsePrefixesResponse, error)
+- client.Radar.BGP.Top.Ases.Get(ctx context.Context, query radar.BGPTopAseGetParams) (radar.BGPTopAseGetResponse, error)
+- client.Radar.BGP.Top.Ases.Prefixes(ctx context.Context, query radar.BGPTopAsePrefixesParams) (radar.BGPTopAsePrefixesResponse, error)
### Hijacks
Response Types:
-- cloudflare.RadarBGPHijackEventsResponse
+- radar.BGPHijackEventsResponse
Methods:
-- client.Radar.BGP.Hijacks.Events(ctx context.Context, query cloudflare.RadarBGPHijackEventsParams) (cloudflare.RadarBGPHijackEventsResponse, error)
+- client.Radar.BGP.Hijacks.Events(ctx context.Context, query radar.BGPHijackEventsParams) (radar.BGPHijackEventsResponse, error)
### Routes
Response Types:
-- cloudflare.RadarBGPRouteMoasResponse
-- cloudflare.RadarBGPRoutePfx2asResponse
-- cloudflare.RadarBGPRouteStatsResponse
-- cloudflare.RadarBGPRouteTimeseriesResponse
+- radar.BGPRouteMoasResponse
+- radar.BGPRoutePfx2asResponse
+- radar.BGPRouteStatsResponse
+- radar.BGPRouteTimeseriesResponse
Methods:
-- client.Radar.BGP.Routes.Moas(ctx context.Context, query cloudflare.RadarBGPRouteMoasParams) (cloudflare.RadarBGPRouteMoasResponse, error)
-- client.Radar.BGP.Routes.Pfx2as(ctx context.Context, query cloudflare.RadarBGPRoutePfx2asParams) (cloudflare.RadarBGPRoutePfx2asResponse, error)
-- client.Radar.BGP.Routes.Stats(ctx context.Context, query cloudflare.RadarBGPRouteStatsParams) (cloudflare.RadarBGPRouteStatsResponse, error)
-- client.Radar.BGP.Routes.Timeseries(ctx context.Context, query cloudflare.RadarBGPRouteTimeseriesParams) (cloudflare.RadarBGPRouteTimeseriesResponse, error)
+- client.Radar.BGP.Routes.Moas(ctx context.Context, query radar.BGPRouteMoasParams) (radar.BGPRouteMoasResponse, error)
+- client.Radar.BGP.Routes.Pfx2as(ctx context.Context, query radar.BGPRoutePfx2asParams) (radar.BGPRoutePfx2asResponse, error)
+- client.Radar.BGP.Routes.Stats(ctx context.Context, query radar.BGPRouteStatsParams) (radar.BGPRouteStatsResponse, error)
+- client.Radar.BGP.Routes.Timeseries(ctx context.Context, query radar.BGPRouteTimeseriesParams) (radar.BGPRouteTimeseriesResponse, error)
## Datasets
Response Types:
-- cloudflare.RadarDatasetListResponse
-- cloudflare.RadarDatasetDownloadResponse
+- radar.DatasetListResponse
+- radar.DatasetDownloadResponse
Methods:
-- client.Radar.Datasets.List(ctx context.Context, query cloudflare.RadarDatasetListParams) (cloudflare.RadarDatasetListResponse, error)
-- client.Radar.Datasets.Download(ctx context.Context, params cloudflare.RadarDatasetDownloadParams) (cloudflare.RadarDatasetDownloadResponse, error)
-- client.Radar.Datasets.Get(ctx context.Context, alias string, query cloudflare.RadarDatasetGetParams) (string, error)
+- client.Radar.Datasets.List(ctx context.Context, query radar.DatasetListParams) (radar.DatasetListResponse, error)
+- client.Radar.Datasets.Download(ctx context.Context, params radar.DatasetDownloadParams) (radar.DatasetDownloadResponse, error)
+- client.Radar.Datasets.Get(ctx context.Context, alias string, query radar.DatasetGetParams) (string, error)
## DNS
@@ -5347,45 +5233,45 @@ Methods:
Response Types:
-- cloudflare.RadarDNSTopAsesResponse
-- cloudflare.RadarDNSTopLocationsResponse
+- radar.DNSTopAsesResponse
+- radar.DNSTopLocationsResponse
Methods:
-- client.Radar.DNS.Top.Ases(ctx context.Context, query cloudflare.RadarDNSTopAsesParams) (cloudflare.RadarDNSTopAsesResponse, error)
-- client.Radar.DNS.Top.Locations(ctx context.Context, query cloudflare.RadarDNSTopLocationsParams) (cloudflare.RadarDNSTopLocationsResponse, error)
+- client.Radar.DNS.Top.Ases(ctx context.Context, query radar.DNSTopAsesParams) (radar.DNSTopAsesResponse, error)
+- client.Radar.DNS.Top.Locations(ctx context.Context, query radar.DNSTopLocationsParams) (radar.DNSTopLocationsResponse, error)
## Netflows
Response Types:
-- cloudflare.RadarNetflowTimeseriesResponse
+- radar.NetflowTimeseriesResponse
Methods:
-- client.Radar.Netflows.Timeseries(ctx context.Context, query cloudflare.RadarNetflowTimeseriesParams) (cloudflare.RadarNetflowTimeseriesResponse, error)
+- client.Radar.Netflows.Timeseries(ctx context.Context, query radar.NetflowTimeseriesParams) (radar.NetflowTimeseriesResponse, error)
### Top
Response Types:
-- cloudflare.RadarNetflowTopAsesResponse
-- cloudflare.RadarNetflowTopLocationsResponse
+- radar.NetflowTopAsesResponse
+- radar.NetflowTopLocationsResponse
Methods:
-- client.Radar.Netflows.Top.Ases(ctx context.Context, query cloudflare.RadarNetflowTopAsesParams) (cloudflare.RadarNetflowTopAsesResponse, error)
-- client.Radar.Netflows.Top.Locations(ctx context.Context, query cloudflare.RadarNetflowTopLocationsParams) (cloudflare.RadarNetflowTopLocationsResponse, error)
+- client.Radar.Netflows.Top.Ases(ctx context.Context, query radar.NetflowTopAsesParams) (radar.NetflowTopAsesResponse, error)
+- client.Radar.Netflows.Top.Locations(ctx context.Context, query radar.NetflowTopLocationsParams) (radar.NetflowTopLocationsResponse, error)
## Search
Response Types:
-- cloudflare.RadarSearchGlobalResponse
+- radar.SearchGlobalResponse
Methods:
-- client.Radar.Search.Global(ctx context.Context, query cloudflare.RadarSearchGlobalParams) (cloudflare.RadarSearchGlobalResponse, error)
+- client.Radar.Search.Global(ctx context.Context, query radar.SearchGlobalParams) (radar.SearchGlobalResponse, error)
## VerifiedBots
@@ -5393,91 +5279,91 @@ Methods:
Response Types:
-- cloudflare.RadarVerifiedBotTopBotsResponse
-- cloudflare.RadarVerifiedBotTopCategoriesResponse
+- radar.VerifiedBotTopBotsResponse
+- radar.VerifiedBotTopCategoriesResponse
Methods:
-- client.Radar.VerifiedBots.Top.Bots(ctx context.Context, query cloudflare.RadarVerifiedBotTopBotsParams) (cloudflare.RadarVerifiedBotTopBotsResponse, error)
-- client.Radar.VerifiedBots.Top.Categories(ctx context.Context, query cloudflare.RadarVerifiedBotTopCategoriesParams) (cloudflare.RadarVerifiedBotTopCategoriesResponse, error)
+- client.Radar.VerifiedBots.Top.Bots(ctx context.Context, query radar.VerifiedBotTopBotsParams) (radar.VerifiedBotTopBotsResponse, error)
+- client.Radar.VerifiedBots.Top.Categories(ctx context.Context, query radar.VerifiedBotTopCategoriesParams) (radar.VerifiedBotTopCategoriesResponse, error)
## AS112
Response Types:
-- cloudflare.RadarAS112TimeseriesResponse
+- radar.AS112TimeseriesResponse
Methods:
-- client.Radar.AS112.Timeseries(ctx context.Context, query cloudflare.RadarAS112TimeseriesParams) (cloudflare.RadarAS112TimeseriesResponse, error)
+- client.Radar.AS112.Timeseries(ctx context.Context, query radar.AS112TimeseriesParams) (radar.AS112TimeseriesResponse, error)
### Summary
Response Types:
-- cloudflare.RadarAS112SummaryDNSSECResponse
-- cloudflare.RadarAS112SummaryEdnsResponse
-- cloudflare.RadarAS112SummaryIPVersionResponse
-- cloudflare.RadarAS112SummaryProtocolResponse
-- cloudflare.RadarAS112SummaryQueryTypeResponse
-- cloudflare.RadarAS112SummaryResponseCodesResponse
+- radar.AS112SummaryDNSSECResponse
+- radar.AS112SummaryEdnsResponse
+- radar.AS112SummaryIPVersionResponse
+- radar.AS112SummaryProtocolResponse
+- radar.AS112SummaryQueryTypeResponse
+- radar.AS112SummaryResponseCodesResponse
Methods:
-- client.Radar.AS112.Summary.DNSSEC(ctx context.Context, query cloudflare.RadarAS112SummaryDNSSECParams) (cloudflare.RadarAS112SummaryDNSSECResponse, error)
-- client.Radar.AS112.Summary.Edns(ctx context.Context, query cloudflare.RadarAS112SummaryEdnsParams) (cloudflare.RadarAS112SummaryEdnsResponse, error)
-- client.Radar.AS112.Summary.IPVersion(ctx context.Context, query cloudflare.RadarAS112SummaryIPVersionParams) (cloudflare.RadarAS112SummaryIPVersionResponse, error)
-- client.Radar.AS112.Summary.Protocol(ctx context.Context, query cloudflare.RadarAS112SummaryProtocolParams) (cloudflare.RadarAS112SummaryProtocolResponse, error)
-- client.Radar.AS112.Summary.QueryType(ctx context.Context, query cloudflare.RadarAS112SummaryQueryTypeParams) (cloudflare.RadarAS112SummaryQueryTypeResponse, error)
-- client.Radar.AS112.Summary.ResponseCodes(ctx context.Context, query cloudflare.RadarAS112SummaryResponseCodesParams) (cloudflare.RadarAS112SummaryResponseCodesResponse, error)
+- client.Radar.AS112.Summary.DNSSEC(ctx context.Context, query radar.AS112SummaryDNSSECParams) (radar.AS112SummaryDNSSECResponse, error)
+- client.Radar.AS112.Summary.Edns(ctx context.Context, query radar.AS112SummaryEdnsParams) (radar.AS112SummaryEdnsResponse, error)
+- client.Radar.AS112.Summary.IPVersion(ctx context.Context, query radar.AS112SummaryIPVersionParams) (radar.AS112SummaryIPVersionResponse, error)
+- client.Radar.AS112.Summary.Protocol(ctx context.Context, query radar.AS112SummaryProtocolParams) (radar.AS112SummaryProtocolResponse, error)
+- client.Radar.AS112.Summary.QueryType(ctx context.Context, query radar.AS112SummaryQueryTypeParams) (radar.AS112SummaryQueryTypeResponse, error)
+- client.Radar.AS112.Summary.ResponseCodes(ctx context.Context, query radar.AS112SummaryResponseCodesParams) (radar.AS112SummaryResponseCodesResponse, error)
### TimeseriesGroups
Response Types:
-- cloudflare.RadarAS112TimeseriesGroupDNSSECResponse
-- cloudflare.RadarAS112TimeseriesGroupEdnsResponse
-- cloudflare.RadarAS112TimeseriesGroupIPVersionResponse
-- cloudflare.RadarAS112TimeseriesGroupProtocolResponse
-- cloudflare.RadarAS112TimeseriesGroupQueryTypeResponse
-- cloudflare.RadarAS112TimeseriesGroupResponseCodesResponse
+- radar.AS112TimeseriesGroupDNSSECResponse
+- radar.AS112TimeseriesGroupEdnsResponse
+- radar.AS112TimeseriesGroupIPVersionResponse
+- radar.AS112TimeseriesGroupProtocolResponse
+- radar.AS112TimeseriesGroupQueryTypeResponse
+- radar.AS112TimeseriesGroupResponseCodesResponse
Methods:
-- client.Radar.AS112.TimeseriesGroups.DNSSEC(ctx context.Context, query cloudflare.RadarAS112TimeseriesGroupDNSSECParams) (cloudflare.RadarAS112TimeseriesGroupDNSSECResponse, error)
-- client.Radar.AS112.TimeseriesGroups.Edns(ctx context.Context, query cloudflare.RadarAS112TimeseriesGroupEdnsParams) (cloudflare.RadarAS112TimeseriesGroupEdnsResponse, error)
-- client.Radar.AS112.TimeseriesGroups.IPVersion(ctx context.Context, query cloudflare.RadarAS112TimeseriesGroupIPVersionParams) (cloudflare.RadarAS112TimeseriesGroupIPVersionResponse, error)
-- client.Radar.AS112.TimeseriesGroups.Protocol(ctx context.Context, query cloudflare.RadarAS112TimeseriesGroupProtocolParams) (cloudflare.RadarAS112TimeseriesGroupProtocolResponse, error)
-- client.Radar.AS112.TimeseriesGroups.QueryType(ctx context.Context, query cloudflare.RadarAS112TimeseriesGroupQueryTypeParams) (cloudflare.RadarAS112TimeseriesGroupQueryTypeResponse, error)
-- client.Radar.AS112.TimeseriesGroups.ResponseCodes(ctx context.Context, query cloudflare.RadarAS112TimeseriesGroupResponseCodesParams) (cloudflare.RadarAS112TimeseriesGroupResponseCodesResponse, error)
+- client.Radar.AS112.TimeseriesGroups.DNSSEC(ctx context.Context, query radar.AS112TimeseriesGroupDNSSECParams) (radar.AS112TimeseriesGroupDNSSECResponse, error)
+- client.Radar.AS112.TimeseriesGroups.Edns(ctx context.Context, query radar.AS112TimeseriesGroupEdnsParams) (radar.AS112TimeseriesGroupEdnsResponse, error)
+- client.Radar.AS112.TimeseriesGroups.IPVersion(ctx context.Context, query radar.AS112TimeseriesGroupIPVersionParams) (radar.AS112TimeseriesGroupIPVersionResponse, error)
+- client.Radar.AS112.TimeseriesGroups.Protocol(ctx context.Context, query radar.AS112TimeseriesGroupProtocolParams) (radar.AS112TimeseriesGroupProtocolResponse, error)
+- client.Radar.AS112.TimeseriesGroups.QueryType(ctx context.Context, query radar.AS112TimeseriesGroupQueryTypeParams) (radar.AS112TimeseriesGroupQueryTypeResponse, error)
+- client.Radar.AS112.TimeseriesGroups.ResponseCodes(ctx context.Context, query radar.AS112TimeseriesGroupResponseCodesParams) (radar.AS112TimeseriesGroupResponseCodesResponse, error)
### Top
Response Types:
-- cloudflare.RadarAS112TopDNSSECResponse
-- cloudflare.RadarAS112TopEdnsResponse
-- cloudflare.RadarAS112TopIPVersionResponse
-- cloudflare.RadarAS112TopLocationsResponse
+- radar.AS112TopDNSSECResponse
+- radar.AS112TopEdnsResponse
+- radar.AS112TopIPVersionResponse
+- radar.AS112TopLocationsResponse
Methods:
-- client.Radar.AS112.Top.DNSSEC(ctx context.Context, dnssec cloudflare.RadarAS112TopDNSSECParamsDNSSEC, query cloudflare.RadarAS112TopDNSSECParams) (cloudflare.RadarAS112TopDNSSECResponse, error)
-- client.Radar.AS112.Top.Edns(ctx context.Context, edns cloudflare.RadarAS112TopEdnsParamsEdns, query cloudflare.RadarAS112TopEdnsParams) (cloudflare.RadarAS112TopEdnsResponse, error)
-- client.Radar.AS112.Top.IPVersion(ctx context.Context, ipVersion cloudflare.RadarAS112TopIPVersionParamsIPVersion, query cloudflare.RadarAS112TopIPVersionParams) (cloudflare.RadarAS112TopIPVersionResponse, error)
-- client.Radar.AS112.Top.Locations(ctx context.Context, query cloudflare.RadarAS112TopLocationsParams) (cloudflare.RadarAS112TopLocationsResponse, error)
+- client.Radar.AS112.Top.DNSSEC(ctx context.Context, dnssec radar.AS112TopDNSSECParamsDNSSEC, query radar.AS112TopDNSSECParams) (radar.AS112TopDNSSECResponse, error)
+- client.Radar.AS112.Top.Edns(ctx context.Context, edns radar.AS112TopEdnsParamsEdns, query radar.AS112TopEdnsParams) (radar.AS112TopEdnsResponse, error)
+- client.Radar.AS112.Top.IPVersion(ctx context.Context, ipVersion radar.AS112TopIPVersionParamsIPVersion, query radar.AS112TopIPVersionParams) (radar.AS112TopIPVersionResponse, error)
+- client.Radar.AS112.Top.Locations(ctx context.Context, query radar.AS112TopLocationsParams) (radar.AS112TopLocationsResponse, error)
## ConnectionTampering
Response Types:
-- cloudflare.RadarConnectionTamperingSummaryResponse
-- cloudflare.RadarConnectionTamperingTimeseriesGroupsResponse
+- radar.ConnectionTamperingSummaryResponse
+- radar.ConnectionTamperingTimeseriesGroupsResponse
Methods:
-- client.Radar.ConnectionTampering.Summary(ctx context.Context, query cloudflare.RadarConnectionTamperingSummaryParams) (cloudflare.RadarConnectionTamperingSummaryResponse, error)
-- client.Radar.ConnectionTampering.TimeseriesGroups(ctx context.Context, query cloudflare.RadarConnectionTamperingTimeseriesGroupsParams) (cloudflare.RadarConnectionTamperingTimeseriesGroupsResponse, error)
+- client.Radar.ConnectionTampering.Summary(ctx context.Context, query radar.ConnectionTamperingSummaryParams) (radar.ConnectionTamperingSummaryResponse, error)
+- client.Radar.ConnectionTampering.TimeseriesGroups(ctx context.Context, query radar.ConnectionTamperingTimeseriesGroupsParams) (radar.ConnectionTamperingTimeseriesGroupsResponse, error)
## Email
@@ -5487,41 +5373,41 @@ Methods:
Response Types:
-- cloudflare.RadarEmailRoutingSummaryARCResponse
-- cloudflare.RadarEmailRoutingSummaryDKIMResponse
-- cloudflare.RadarEmailRoutingSummaryDMARCResponse
-- cloudflare.RadarEmailRoutingSummaryEncryptedResponse
-- cloudflare.RadarEmailRoutingSummaryIPVersionResponse
-- cloudflare.RadarEmailRoutingSummarySPFResponse
+- radar.EmailRoutingSummaryARCResponse
+- radar.EmailRoutingSummaryDKIMResponse
+- radar.EmailRoutingSummaryDMARCResponse
+- radar.EmailRoutingSummaryEncryptedResponse
+- radar.EmailRoutingSummaryIPVersionResponse
+- radar.EmailRoutingSummarySPFResponse
Methods:
-- client.Radar.Email.Routing.Summary.ARC(ctx context.Context, query cloudflare.RadarEmailRoutingSummaryARCParams) (cloudflare.RadarEmailRoutingSummaryARCResponse, error)
-- client.Radar.Email.Routing.Summary.DKIM(ctx context.Context, query cloudflare.RadarEmailRoutingSummaryDKIMParams) (cloudflare.RadarEmailRoutingSummaryDKIMResponse, error)
-- client.Radar.Email.Routing.Summary.DMARC(ctx context.Context, query cloudflare.RadarEmailRoutingSummaryDMARCParams) (cloudflare.RadarEmailRoutingSummaryDMARCResponse, error)
-- client.Radar.Email.Routing.Summary.Encrypted(ctx context.Context, query cloudflare.RadarEmailRoutingSummaryEncryptedParams) (cloudflare.RadarEmailRoutingSummaryEncryptedResponse, error)
-- client.Radar.Email.Routing.Summary.IPVersion(ctx context.Context, query cloudflare.RadarEmailRoutingSummaryIPVersionParams) (cloudflare.RadarEmailRoutingSummaryIPVersionResponse, error)
-- client.Radar.Email.Routing.Summary.SPF(ctx context.Context, query cloudflare.RadarEmailRoutingSummarySPFParams) (cloudflare.RadarEmailRoutingSummarySPFResponse, error)
+- client.Radar.Email.Routing.Summary.ARC(ctx context.Context, query radar.EmailRoutingSummaryARCParams) (radar.EmailRoutingSummaryARCResponse, error)
+- client.Radar.Email.Routing.Summary.DKIM(ctx context.Context, query radar.EmailRoutingSummaryDKIMParams) (radar.EmailRoutingSummaryDKIMResponse, error)
+- client.Radar.Email.Routing.Summary.DMARC(ctx context.Context, query radar.EmailRoutingSummaryDMARCParams) (radar.EmailRoutingSummaryDMARCResponse, error)
+- client.Radar.Email.Routing.Summary.Encrypted(ctx context.Context, query radar.EmailRoutingSummaryEncryptedParams) (radar.EmailRoutingSummaryEncryptedResponse, error)
+- client.Radar.Email.Routing.Summary.IPVersion(ctx context.Context, query radar.EmailRoutingSummaryIPVersionParams) (radar.EmailRoutingSummaryIPVersionResponse, error)
+- client.Radar.Email.Routing.Summary.SPF(ctx context.Context, query radar.EmailRoutingSummarySPFParams) (radar.EmailRoutingSummarySPFResponse, error)
#### TimeseriesGroups
Response Types:
-- cloudflare.RadarEmailRoutingTimeseriesGroupARCResponse
-- cloudflare.RadarEmailRoutingTimeseriesGroupDKIMResponse
-- cloudflare.RadarEmailRoutingTimeseriesGroupDMARCResponse
-- cloudflare.RadarEmailRoutingTimeseriesGroupEncryptedResponse
-- cloudflare.RadarEmailRoutingTimeseriesGroupIPVersionResponse
-- cloudflare.RadarEmailRoutingTimeseriesGroupSPFResponse
+- radar.EmailRoutingTimeseriesGroupARCResponse
+- radar.EmailRoutingTimeseriesGroupDKIMResponse
+- radar.EmailRoutingTimeseriesGroupDMARCResponse
+- radar.EmailRoutingTimeseriesGroupEncryptedResponse
+- radar.EmailRoutingTimeseriesGroupIPVersionResponse
+- radar.EmailRoutingTimeseriesGroupSPFResponse
Methods:
-- client.Radar.Email.Routing.TimeseriesGroups.ARC(ctx context.Context, query cloudflare.RadarEmailRoutingTimeseriesGroupARCParams) (cloudflare.RadarEmailRoutingTimeseriesGroupARCResponse, error)
-- client.Radar.Email.Routing.TimeseriesGroups.DKIM(ctx context.Context, query cloudflare.RadarEmailRoutingTimeseriesGroupDKIMParams) (cloudflare.RadarEmailRoutingTimeseriesGroupDKIMResponse, error)
-- client.Radar.Email.Routing.TimeseriesGroups.DMARC(ctx context.Context, query cloudflare.RadarEmailRoutingTimeseriesGroupDMARCParams) (cloudflare.RadarEmailRoutingTimeseriesGroupDMARCResponse, error)
-- client.Radar.Email.Routing.TimeseriesGroups.Encrypted(ctx context.Context, query cloudflare.RadarEmailRoutingTimeseriesGroupEncryptedParams) (cloudflare.RadarEmailRoutingTimeseriesGroupEncryptedResponse, error)
-- client.Radar.Email.Routing.TimeseriesGroups.IPVersion(ctx context.Context, query cloudflare.RadarEmailRoutingTimeseriesGroupIPVersionParams) (cloudflare.RadarEmailRoutingTimeseriesGroupIPVersionResponse, error)
-- client.Radar.Email.Routing.TimeseriesGroups.SPF(ctx context.Context, query cloudflare.RadarEmailRoutingTimeseriesGroupSPFParams) (cloudflare.RadarEmailRoutingTimeseriesGroupSPFResponse, error)
+- client.Radar.Email.Routing.TimeseriesGroups.ARC(ctx context.Context, query radar.EmailRoutingTimeseriesGroupARCParams) (radar.EmailRoutingTimeseriesGroupARCResponse, error)
+- client.Radar.Email.Routing.TimeseriesGroups.DKIM(ctx context.Context, query radar.EmailRoutingTimeseriesGroupDKIMParams) (radar.EmailRoutingTimeseriesGroupDKIMResponse, error)
+- client.Radar.Email.Routing.TimeseriesGroups.DMARC(ctx context.Context, query radar.EmailRoutingTimeseriesGroupDMARCParams) (radar.EmailRoutingTimeseriesGroupDMARCResponse, error)
+- client.Radar.Email.Routing.TimeseriesGroups.Encrypted(ctx context.Context, query radar.EmailRoutingTimeseriesGroupEncryptedParams) (radar.EmailRoutingTimeseriesGroupEncryptedResponse, error)
+- client.Radar.Email.Routing.TimeseriesGroups.IPVersion(ctx context.Context, query radar.EmailRoutingTimeseriesGroupIPVersionParams) (radar.EmailRoutingTimeseriesGroupIPVersionResponse, error)
+- client.Radar.Email.Routing.TimeseriesGroups.SPF(ctx context.Context, query radar.EmailRoutingTimeseriesGroupSPFParams) (radar.EmailRoutingTimeseriesGroupSPFResponse, error)
### Security
@@ -5531,93 +5417,93 @@ Methods:
Response Types:
-- cloudflare.RadarEmailSecurityTopTldGetResponse
+- radar.EmailSecurityTopTldGetResponse
Methods:
-- client.Radar.Email.Security.Top.Tlds.Get(ctx context.Context, query cloudflare.RadarEmailSecurityTopTldGetParams) (cloudflare.RadarEmailSecurityTopTldGetResponse, error)
+- client.Radar.Email.Security.Top.Tlds.Get(ctx context.Context, query radar.EmailSecurityTopTldGetParams) (radar.EmailSecurityTopTldGetResponse, error)
###### Malicious
Response Types:
-- cloudflare.RadarEmailSecurityTopTldMaliciousGetResponse
+- radar.EmailSecurityTopTldMaliciousGetResponse
Methods:
-- client.Radar.Email.Security.Top.Tlds.Malicious.Get(ctx context.Context, malicious cloudflare.RadarEmailSecurityTopTldMaliciousGetParamsMalicious, query cloudflare.RadarEmailSecurityTopTldMaliciousGetParams) (cloudflare.RadarEmailSecurityTopTldMaliciousGetResponse, error)
+- client.Radar.Email.Security.Top.Tlds.Malicious.Get(ctx context.Context, malicious radar.EmailSecurityTopTldMaliciousGetParamsMalicious, query radar.EmailSecurityTopTldMaliciousGetParams) (radar.EmailSecurityTopTldMaliciousGetResponse, error)
###### Spam
Response Types:
-- cloudflare.RadarEmailSecurityTopTldSpamGetResponse
+- radar.EmailSecurityTopTldSpamGetResponse
Methods:
-- client.Radar.Email.Security.Top.Tlds.Spam.Get(ctx context.Context, spam cloudflare.RadarEmailSecurityTopTldSpamGetParamsSpam, query cloudflare.RadarEmailSecurityTopTldSpamGetParams) (cloudflare.RadarEmailSecurityTopTldSpamGetResponse, error)
+- client.Radar.Email.Security.Top.Tlds.Spam.Get(ctx context.Context, spam radar.EmailSecurityTopTldSpamGetParamsSpam, query radar.EmailSecurityTopTldSpamGetParams) (radar.EmailSecurityTopTldSpamGetResponse, error)
###### Spoof
Response Types:
-- cloudflare.RadarEmailSecurityTopTldSpoofGetResponse
+- radar.EmailSecurityTopTldSpoofGetResponse
Methods:
-- client.Radar.Email.Security.Top.Tlds.Spoof.Get(ctx context.Context, spoof cloudflare.RadarEmailSecurityTopTldSpoofGetParamsSpoof, query cloudflare.RadarEmailSecurityTopTldSpoofGetParams) (cloudflare.RadarEmailSecurityTopTldSpoofGetResponse, error)
+- client.Radar.Email.Security.Top.Tlds.Spoof.Get(ctx context.Context, spoof radar.EmailSecurityTopTldSpoofGetParamsSpoof, query radar.EmailSecurityTopTldSpoofGetParams) (radar.EmailSecurityTopTldSpoofGetResponse, error)
#### Summary
Response Types:
-- cloudflare.RadarEmailSecuritySummaryARCResponse
-- cloudflare.RadarEmailSecuritySummaryDKIMResponse
-- cloudflare.RadarEmailSecuritySummaryDMARCResponse
-- cloudflare.RadarEmailSecuritySummaryMaliciousResponse
-- cloudflare.RadarEmailSecuritySummarySpamResponse
-- cloudflare.RadarEmailSecuritySummarySPFResponse
-- cloudflare.RadarEmailSecuritySummarySpoofResponse
-- cloudflare.RadarEmailSecuritySummaryThreatCategoryResponse
-- cloudflare.RadarEmailSecuritySummaryTLSVersionResponse
+- radar.EmailSecuritySummaryARCResponse
+- radar.EmailSecuritySummaryDKIMResponse
+- radar.EmailSecuritySummaryDMARCResponse
+- radar.EmailSecuritySummaryMaliciousResponse
+- radar.EmailSecuritySummarySpamResponse
+- radar.EmailSecuritySummarySPFResponse
+- radar.EmailSecuritySummarySpoofResponse
+- radar.EmailSecuritySummaryThreatCategoryResponse
+- radar.EmailSecuritySummaryTLSVersionResponse
Methods:
-- client.Radar.Email.Security.Summary.ARC(ctx context.Context, query cloudflare.RadarEmailSecuritySummaryARCParams) (cloudflare.RadarEmailSecuritySummaryARCResponse, error)
-- client.Radar.Email.Security.Summary.DKIM(ctx context.Context, query cloudflare.RadarEmailSecuritySummaryDKIMParams) (cloudflare.RadarEmailSecuritySummaryDKIMResponse, error)
-- client.Radar.Email.Security.Summary.DMARC(ctx context.Context, query cloudflare.RadarEmailSecuritySummaryDMARCParams) (cloudflare.RadarEmailSecuritySummaryDMARCResponse, error)
-- client.Radar.Email.Security.Summary.Malicious(ctx context.Context, query cloudflare.RadarEmailSecuritySummaryMaliciousParams) (cloudflare.RadarEmailSecuritySummaryMaliciousResponse, error)
-- client.Radar.Email.Security.Summary.Spam(ctx context.Context, query cloudflare.RadarEmailSecuritySummarySpamParams) (cloudflare.RadarEmailSecuritySummarySpamResponse, error)
-- client.Radar.Email.Security.Summary.SPF(ctx context.Context, query cloudflare.RadarEmailSecuritySummarySPFParams) (cloudflare.RadarEmailSecuritySummarySPFResponse, error)
-- client.Radar.Email.Security.Summary.Spoof(ctx context.Context, query cloudflare.RadarEmailSecuritySummarySpoofParams) (cloudflare.RadarEmailSecuritySummarySpoofResponse, error)
-- client.Radar.Email.Security.Summary.ThreatCategory(ctx context.Context, query cloudflare.RadarEmailSecuritySummaryThreatCategoryParams) (cloudflare.RadarEmailSecuritySummaryThreatCategoryResponse, error)
-- client.Radar.Email.Security.Summary.TLSVersion(ctx context.Context, query cloudflare.RadarEmailSecuritySummaryTLSVersionParams) (cloudflare.RadarEmailSecuritySummaryTLSVersionResponse, error)
+- client.Radar.Email.Security.Summary.ARC(ctx context.Context, query radar.EmailSecuritySummaryARCParams) (radar.EmailSecuritySummaryARCResponse, error)
+- client.Radar.Email.Security.Summary.DKIM(ctx context.Context, query radar.EmailSecuritySummaryDKIMParams) (radar.EmailSecuritySummaryDKIMResponse, error)
+- client.Radar.Email.Security.Summary.DMARC(ctx context.Context, query radar.EmailSecuritySummaryDMARCParams) (radar.EmailSecuritySummaryDMARCResponse, error)
+- client.Radar.Email.Security.Summary.Malicious(ctx context.Context, query radar.EmailSecuritySummaryMaliciousParams) (radar.EmailSecuritySummaryMaliciousResponse, error)
+- client.Radar.Email.Security.Summary.Spam(ctx context.Context, query radar.EmailSecuritySummarySpamParams) (radar.EmailSecuritySummarySpamResponse, error)
+- client.Radar.Email.Security.Summary.SPF(ctx context.Context, query radar.EmailSecuritySummarySPFParams) (radar.EmailSecuritySummarySPFResponse, error)
+- client.Radar.Email.Security.Summary.Spoof(ctx context.Context, query radar.EmailSecuritySummarySpoofParams) (radar.EmailSecuritySummarySpoofResponse, error)
+- client.Radar.Email.Security.Summary.ThreatCategory(ctx context.Context, query radar.EmailSecuritySummaryThreatCategoryParams) (radar.EmailSecuritySummaryThreatCategoryResponse, error)
+- client.Radar.Email.Security.Summary.TLSVersion(ctx context.Context, query radar.EmailSecuritySummaryTLSVersionParams) (radar.EmailSecuritySummaryTLSVersionResponse, error)
#### TimeseriesGroups
Response Types:
-- cloudflare.RadarEmailSecurityTimeseriesGroupARCResponse
-- cloudflare.RadarEmailSecurityTimeseriesGroupDKIMResponse
-- cloudflare.RadarEmailSecurityTimeseriesGroupDMARCResponse
-- cloudflare.RadarEmailSecurityTimeseriesGroupMaliciousResponse
-- cloudflare.RadarEmailSecurityTimeseriesGroupSpamResponse
-- cloudflare.RadarEmailSecurityTimeseriesGroupSPFResponse
-- cloudflare.RadarEmailSecurityTimeseriesGroupSpoofResponse
-- cloudflare.RadarEmailSecurityTimeseriesGroupThreatCategoryResponse
-- cloudflare.RadarEmailSecurityTimeseriesGroupTLSVersionResponse
+- radar.EmailSecurityTimeseriesGroupARCResponse
+- radar.EmailSecurityTimeseriesGroupDKIMResponse
+- radar.EmailSecurityTimeseriesGroupDMARCResponse
+- radar.EmailSecurityTimeseriesGroupMaliciousResponse
+- radar.EmailSecurityTimeseriesGroupSpamResponse
+- radar.EmailSecurityTimeseriesGroupSPFResponse
+- radar.EmailSecurityTimeseriesGroupSpoofResponse
+- radar.EmailSecurityTimeseriesGroupThreatCategoryResponse
+- radar.EmailSecurityTimeseriesGroupTLSVersionResponse
Methods:
-- client.Radar.Email.Security.TimeseriesGroups.ARC(ctx context.Context, query cloudflare.RadarEmailSecurityTimeseriesGroupARCParams) (cloudflare.RadarEmailSecurityTimeseriesGroupARCResponse, error)
-- client.Radar.Email.Security.TimeseriesGroups.DKIM(ctx context.Context, query cloudflare.RadarEmailSecurityTimeseriesGroupDKIMParams) (cloudflare.RadarEmailSecurityTimeseriesGroupDKIMResponse, error)
-- client.Radar.Email.Security.TimeseriesGroups.DMARC(ctx context.Context, query cloudflare.RadarEmailSecurityTimeseriesGroupDMARCParams) (cloudflare.RadarEmailSecurityTimeseriesGroupDMARCResponse, error)
-- client.Radar.Email.Security.TimeseriesGroups.Malicious(ctx context.Context, query cloudflare.RadarEmailSecurityTimeseriesGroupMaliciousParams) (cloudflare.RadarEmailSecurityTimeseriesGroupMaliciousResponse, error)
-- client.Radar.Email.Security.TimeseriesGroups.Spam(ctx context.Context, query cloudflare.RadarEmailSecurityTimeseriesGroupSpamParams) (cloudflare.RadarEmailSecurityTimeseriesGroupSpamResponse, error)
-- client.Radar.Email.Security.TimeseriesGroups.SPF(ctx context.Context, query cloudflare.RadarEmailSecurityTimeseriesGroupSPFParams) (cloudflare.RadarEmailSecurityTimeseriesGroupSPFResponse, error)
-- client.Radar.Email.Security.TimeseriesGroups.Spoof(ctx context.Context, query cloudflare.RadarEmailSecurityTimeseriesGroupSpoofParams) (cloudflare.RadarEmailSecurityTimeseriesGroupSpoofResponse, error)
-- client.Radar.Email.Security.TimeseriesGroups.ThreatCategory(ctx context.Context, query cloudflare.RadarEmailSecurityTimeseriesGroupThreatCategoryParams) (cloudflare.RadarEmailSecurityTimeseriesGroupThreatCategoryResponse, error)
-- client.Radar.Email.Security.TimeseriesGroups.TLSVersion(ctx context.Context, query cloudflare.RadarEmailSecurityTimeseriesGroupTLSVersionParams) (cloudflare.RadarEmailSecurityTimeseriesGroupTLSVersionResponse, error)
+- client.Radar.Email.Security.TimeseriesGroups.ARC(ctx context.Context, query radar.EmailSecurityTimeseriesGroupARCParams) (radar.EmailSecurityTimeseriesGroupARCResponse, error)
+- client.Radar.Email.Security.TimeseriesGroups.DKIM(ctx context.Context, query radar.EmailSecurityTimeseriesGroupDKIMParams) (radar.EmailSecurityTimeseriesGroupDKIMResponse, error)
+- client.Radar.Email.Security.TimeseriesGroups.DMARC(ctx context.Context, query radar.EmailSecurityTimeseriesGroupDMARCParams) (radar.EmailSecurityTimeseriesGroupDMARCResponse, error)
+- client.Radar.Email.Security.TimeseriesGroups.Malicious(ctx context.Context, query radar.EmailSecurityTimeseriesGroupMaliciousParams) (radar.EmailSecurityTimeseriesGroupMaliciousResponse, error)
+- client.Radar.Email.Security.TimeseriesGroups.Spam(ctx context.Context, query radar.EmailSecurityTimeseriesGroupSpamParams) (radar.EmailSecurityTimeseriesGroupSpamResponse, error)
+- client.Radar.Email.Security.TimeseriesGroups.SPF(ctx context.Context, query radar.EmailSecurityTimeseriesGroupSPFParams) (radar.EmailSecurityTimeseriesGroupSPFResponse, error)
+- client.Radar.Email.Security.TimeseriesGroups.Spoof(ctx context.Context, query radar.EmailSecurityTimeseriesGroupSpoofParams) (radar.EmailSecurityTimeseriesGroupSpoofResponse, error)
+- client.Radar.Email.Security.TimeseriesGroups.ThreatCategory(ctx context.Context, query radar.EmailSecurityTimeseriesGroupThreatCategoryParams) (radar.EmailSecurityTimeseriesGroupThreatCategoryResponse, error)
+- client.Radar.Email.Security.TimeseriesGroups.TLSVersion(ctx context.Context, query radar.EmailSecurityTimeseriesGroupTLSVersionParams) (radar.EmailSecurityTimeseriesGroupTLSVersionResponse, error)
## Attacks
@@ -5625,209 +5511,209 @@ Methods:
Response Types:
-- cloudflare.RadarAttackLayer3TimeseriesResponse
+- radar.AttackLayer3TimeseriesResponse
Methods:
-- client.Radar.Attacks.Layer3.Timeseries(ctx context.Context, query cloudflare.RadarAttackLayer3TimeseriesParams) (cloudflare.RadarAttackLayer3TimeseriesResponse, error)
+- client.Radar.Attacks.Layer3.Timeseries(ctx context.Context, query radar.AttackLayer3TimeseriesParams) (radar.AttackLayer3TimeseriesResponse, error)
#### Summary
Response Types:
-- cloudflare.RadarAttackLayer3SummaryBitrateResponse
-- cloudflare.RadarAttackLayer3SummaryDurationResponse
-- cloudflare.RadarAttackLayer3SummaryGetResponse
-- cloudflare.RadarAttackLayer3SummaryIPVersionResponse
-- cloudflare.RadarAttackLayer3SummaryProtocolResponse
-- cloudflare.RadarAttackLayer3SummaryVectorResponse
+- radar.AttackLayer3SummaryBitrateResponse
+- radar.AttackLayer3SummaryDurationResponse
+- radar.AttackLayer3SummaryGetResponse
+- radar.AttackLayer3SummaryIPVersionResponse
+- radar.AttackLayer3SummaryProtocolResponse
+- radar.AttackLayer3SummaryVectorResponse
Methods:
-- client.Radar.Attacks.Layer3.Summary.Bitrate(ctx context.Context, query cloudflare.RadarAttackLayer3SummaryBitrateParams) (cloudflare.RadarAttackLayer3SummaryBitrateResponse, error)
-- client.Radar.Attacks.Layer3.Summary.Duration(ctx context.Context, query cloudflare.RadarAttackLayer3SummaryDurationParams) (cloudflare.RadarAttackLayer3SummaryDurationResponse, error)
-- client.Radar.Attacks.Layer3.Summary.Get(ctx context.Context, query cloudflare.RadarAttackLayer3SummaryGetParams) (cloudflare.RadarAttackLayer3SummaryGetResponse, error)
-- client.Radar.Attacks.Layer3.Summary.IPVersion(ctx context.Context, query cloudflare.RadarAttackLayer3SummaryIPVersionParams) (cloudflare.RadarAttackLayer3SummaryIPVersionResponse, error)
-- client.Radar.Attacks.Layer3.Summary.Protocol(ctx context.Context, query cloudflare.RadarAttackLayer3SummaryProtocolParams) (cloudflare.RadarAttackLayer3SummaryProtocolResponse, error)
-- client.Radar.Attacks.Layer3.Summary.Vector(ctx context.Context, query cloudflare.RadarAttackLayer3SummaryVectorParams) (cloudflare.RadarAttackLayer3SummaryVectorResponse, error)
+- client.Radar.Attacks.Layer3.Summary.Bitrate(ctx context.Context, query radar.AttackLayer3SummaryBitrateParams) (radar.AttackLayer3SummaryBitrateResponse, error)
+- client.Radar.Attacks.Layer3.Summary.Duration(ctx context.Context, query radar.AttackLayer3SummaryDurationParams) (radar.AttackLayer3SummaryDurationResponse, error)
+- client.Radar.Attacks.Layer3.Summary.Get(ctx context.Context, query radar.AttackLayer3SummaryGetParams) (radar.AttackLayer3SummaryGetResponse, error)
+- client.Radar.Attacks.Layer3.Summary.IPVersion(ctx context.Context, query radar.AttackLayer3SummaryIPVersionParams) (radar.AttackLayer3SummaryIPVersionResponse, error)
+- client.Radar.Attacks.Layer3.Summary.Protocol(ctx context.Context, query radar.AttackLayer3SummaryProtocolParams) (radar.AttackLayer3SummaryProtocolResponse, error)
+- client.Radar.Attacks.Layer3.Summary.Vector(ctx context.Context, query radar.AttackLayer3SummaryVectorParams) (radar.AttackLayer3SummaryVectorResponse, error)
#### TimeseriesGroups
Response Types:
-- cloudflare.RadarAttackLayer3TimeseriesGroupBitrateResponse
-- cloudflare.RadarAttackLayer3TimeseriesGroupDurationResponse
-- cloudflare.RadarAttackLayer3TimeseriesGroupGetResponse
-- cloudflare.RadarAttackLayer3TimeseriesGroupIndustryResponse
-- cloudflare.RadarAttackLayer3TimeseriesGroupIPVersionResponse
-- cloudflare.RadarAttackLayer3TimeseriesGroupProtocolResponse
-- cloudflare.RadarAttackLayer3TimeseriesGroupVectorResponse
-- cloudflare.RadarAttackLayer3TimeseriesGroupVerticalResponse
+- radar.AttackLayer3TimeseriesGroupBitrateResponse
+- radar.AttackLayer3TimeseriesGroupDurationResponse
+- radar.AttackLayer3TimeseriesGroupGetResponse
+- radar.AttackLayer3TimeseriesGroupIndustryResponse
+- radar.AttackLayer3TimeseriesGroupIPVersionResponse
+- radar.AttackLayer3TimeseriesGroupProtocolResponse
+- radar.AttackLayer3TimeseriesGroupVectorResponse
+- radar.AttackLayer3TimeseriesGroupVerticalResponse
Methods:
-- client.Radar.Attacks.Layer3.TimeseriesGroups.Bitrate(ctx context.Context, query cloudflare.RadarAttackLayer3TimeseriesGroupBitrateParams) (cloudflare.RadarAttackLayer3TimeseriesGroupBitrateResponse, error)
-- client.Radar.Attacks.Layer3.TimeseriesGroups.Duration(ctx context.Context, query cloudflare.RadarAttackLayer3TimeseriesGroupDurationParams) (cloudflare.RadarAttackLayer3TimeseriesGroupDurationResponse, error)
-- client.Radar.Attacks.Layer3.TimeseriesGroups.Get(ctx context.Context, query cloudflare.RadarAttackLayer3TimeseriesGroupGetParams) (cloudflare.RadarAttackLayer3TimeseriesGroupGetResponse, error)
-- client.Radar.Attacks.Layer3.TimeseriesGroups.Industry(ctx context.Context, query cloudflare.RadarAttackLayer3TimeseriesGroupIndustryParams) (cloudflare.RadarAttackLayer3TimeseriesGroupIndustryResponse, error)
-- client.Radar.Attacks.Layer3.TimeseriesGroups.IPVersion(ctx context.Context, query cloudflare.RadarAttackLayer3TimeseriesGroupIPVersionParams) (cloudflare.RadarAttackLayer3TimeseriesGroupIPVersionResponse, error)
-- client.Radar.Attacks.Layer3.TimeseriesGroups.Protocol(ctx context.Context, query cloudflare.RadarAttackLayer3TimeseriesGroupProtocolParams) (cloudflare.RadarAttackLayer3TimeseriesGroupProtocolResponse, error)
-- client.Radar.Attacks.Layer3.TimeseriesGroups.Vector(ctx context.Context, query cloudflare.RadarAttackLayer3TimeseriesGroupVectorParams) (cloudflare.RadarAttackLayer3TimeseriesGroupVectorResponse, error)
-- client.Radar.Attacks.Layer3.TimeseriesGroups.Vertical(ctx context.Context, query cloudflare.RadarAttackLayer3TimeseriesGroupVerticalParams) (cloudflare.RadarAttackLayer3TimeseriesGroupVerticalResponse, error)
+- client.Radar.Attacks.Layer3.TimeseriesGroups.Bitrate(ctx context.Context, query radar.AttackLayer3TimeseriesGroupBitrateParams) (radar.AttackLayer3TimeseriesGroupBitrateResponse, error)
+- client.Radar.Attacks.Layer3.TimeseriesGroups.Duration(ctx context.Context, query radar.AttackLayer3TimeseriesGroupDurationParams) (radar.AttackLayer3TimeseriesGroupDurationResponse, error)
+- client.Radar.Attacks.Layer3.TimeseriesGroups.Get(ctx context.Context, query radar.AttackLayer3TimeseriesGroupGetParams) (radar.AttackLayer3TimeseriesGroupGetResponse, error)
+- client.Radar.Attacks.Layer3.TimeseriesGroups.Industry(ctx context.Context, query radar.AttackLayer3TimeseriesGroupIndustryParams) (radar.AttackLayer3TimeseriesGroupIndustryResponse, error)
+- client.Radar.Attacks.Layer3.TimeseriesGroups.IPVersion(ctx context.Context, query radar.AttackLayer3TimeseriesGroupIPVersionParams) (radar.AttackLayer3TimeseriesGroupIPVersionResponse, error)
+- client.Radar.Attacks.Layer3.TimeseriesGroups.Protocol(ctx context.Context, query radar.AttackLayer3TimeseriesGroupProtocolParams) (radar.AttackLayer3TimeseriesGroupProtocolResponse, error)
+- client.Radar.Attacks.Layer3.TimeseriesGroups.Vector(ctx context.Context, query radar.AttackLayer3TimeseriesGroupVectorParams) (radar.AttackLayer3TimeseriesGroupVectorResponse, error)
+- client.Radar.Attacks.Layer3.TimeseriesGroups.Vertical(ctx context.Context, query radar.AttackLayer3TimeseriesGroupVerticalParams) (radar.AttackLayer3TimeseriesGroupVerticalResponse, error)
#### Top
Response Types:
-- cloudflare.RadarAttackLayer3TopAttacksResponse
-- cloudflare.RadarAttackLayer3TopIndustryResponse
-- cloudflare.RadarAttackLayer3TopVerticalResponse
+- radar.AttackLayer3TopAttacksResponse
+- radar.AttackLayer3TopIndustryResponse
+- radar.AttackLayer3TopVerticalResponse
Methods:
-- client.Radar.Attacks.Layer3.Top.Attacks(ctx context.Context, query cloudflare.RadarAttackLayer3TopAttacksParams) (cloudflare.RadarAttackLayer3TopAttacksResponse, error)
-- client.Radar.Attacks.Layer3.Top.Industry(ctx context.Context, query cloudflare.RadarAttackLayer3TopIndustryParams) (cloudflare.RadarAttackLayer3TopIndustryResponse, error)
-- client.Radar.Attacks.Layer3.Top.Vertical(ctx context.Context, query cloudflare.RadarAttackLayer3TopVerticalParams) (cloudflare.RadarAttackLayer3TopVerticalResponse, error)
+- client.Radar.Attacks.Layer3.Top.Attacks(ctx context.Context, query radar.AttackLayer3TopAttacksParams) (radar.AttackLayer3TopAttacksResponse, error)
+- client.Radar.Attacks.Layer3.Top.Industry(ctx context.Context, query radar.AttackLayer3TopIndustryParams) (radar.AttackLayer3TopIndustryResponse, error)
+- client.Radar.Attacks.Layer3.Top.Vertical(ctx context.Context, query radar.AttackLayer3TopVerticalParams) (radar.AttackLayer3TopVerticalResponse, error)
##### Locations
Response Types:
-- cloudflare.RadarAttackLayer3TopLocationOriginResponse
-- cloudflare.RadarAttackLayer3TopLocationTargetResponse
+- radar.AttackLayer3TopLocationOriginResponse
+- radar.AttackLayer3TopLocationTargetResponse
Methods:
-- client.Radar.Attacks.Layer3.Top.Locations.Origin(ctx context.Context, query cloudflare.RadarAttackLayer3TopLocationOriginParams) (cloudflare.RadarAttackLayer3TopLocationOriginResponse, error)
-- client.Radar.Attacks.Layer3.Top.Locations.Target(ctx context.Context, query cloudflare.RadarAttackLayer3TopLocationTargetParams) (cloudflare.RadarAttackLayer3TopLocationTargetResponse, error)
+- client.Radar.Attacks.Layer3.Top.Locations.Origin(ctx context.Context, query radar.AttackLayer3TopLocationOriginParams) (radar.AttackLayer3TopLocationOriginResponse, error)
+- client.Radar.Attacks.Layer3.Top.Locations.Target(ctx context.Context, query radar.AttackLayer3TopLocationTargetParams) (radar.AttackLayer3TopLocationTargetResponse, error)
### Layer7
Response Types:
-- cloudflare.RadarAttackLayer7TimeseriesResponse
+- radar.AttackLayer7TimeseriesResponse
Methods:
-- client.Radar.Attacks.Layer7.Timeseries(ctx context.Context, query cloudflare.RadarAttackLayer7TimeseriesParams) (cloudflare.RadarAttackLayer7TimeseriesResponse, error)
+- client.Radar.Attacks.Layer7.Timeseries(ctx context.Context, query radar.AttackLayer7TimeseriesParams) (radar.AttackLayer7TimeseriesResponse, error)
#### Summary
Response Types:
-- cloudflare.RadarAttackLayer7SummaryGetResponse
-- cloudflare.RadarAttackLayer7SummaryHTTPMethodResponse
-- cloudflare.RadarAttackLayer7SummaryHTTPVersionResponse
-- cloudflare.RadarAttackLayer7SummaryIPVersionResponse
-- cloudflare.RadarAttackLayer7SummaryManagedRulesResponse
-- cloudflare.RadarAttackLayer7SummaryMitigationProductResponse
+- radar.AttackLayer7SummaryGetResponse
+- radar.AttackLayer7SummaryHTTPMethodResponse
+- radar.AttackLayer7SummaryHTTPVersionResponse
+- radar.AttackLayer7SummaryIPVersionResponse
+- radar.AttackLayer7SummaryManagedRulesResponse
+- radar.AttackLayer7SummaryMitigationProductResponse
Methods:
-- client.Radar.Attacks.Layer7.Summary.Get(ctx context.Context, query cloudflare.RadarAttackLayer7SummaryGetParams) (cloudflare.RadarAttackLayer7SummaryGetResponse, error)
-- client.Radar.Attacks.Layer7.Summary.HTTPMethod(ctx context.Context, query cloudflare.RadarAttackLayer7SummaryHTTPMethodParams) (cloudflare.RadarAttackLayer7SummaryHTTPMethodResponse, error)
-- client.Radar.Attacks.Layer7.Summary.HTTPVersion(ctx context.Context, query cloudflare.RadarAttackLayer7SummaryHTTPVersionParams) (cloudflare.RadarAttackLayer7SummaryHTTPVersionResponse, error)
-- client.Radar.Attacks.Layer7.Summary.IPVersion(ctx context.Context, query cloudflare.RadarAttackLayer7SummaryIPVersionParams) (cloudflare.RadarAttackLayer7SummaryIPVersionResponse, error)
-- client.Radar.Attacks.Layer7.Summary.ManagedRules(ctx context.Context, query cloudflare.RadarAttackLayer7SummaryManagedRulesParams) (cloudflare.RadarAttackLayer7SummaryManagedRulesResponse, error)
-- client.Radar.Attacks.Layer7.Summary.MitigationProduct(ctx context.Context, query cloudflare.RadarAttackLayer7SummaryMitigationProductParams) (cloudflare.RadarAttackLayer7SummaryMitigationProductResponse, error)
+- client.Radar.Attacks.Layer7.Summary.Get(ctx context.Context, query radar.AttackLayer7SummaryGetParams) (radar.AttackLayer7SummaryGetResponse, error)
+- client.Radar.Attacks.Layer7.Summary.HTTPMethod(ctx context.Context, query radar.AttackLayer7SummaryHTTPMethodParams) (radar.AttackLayer7SummaryHTTPMethodResponse, error)
+- client.Radar.Attacks.Layer7.Summary.HTTPVersion(ctx context.Context, query radar.AttackLayer7SummaryHTTPVersionParams) (radar.AttackLayer7SummaryHTTPVersionResponse, error)
+- client.Radar.Attacks.Layer7.Summary.IPVersion(ctx context.Context, query radar.AttackLayer7SummaryIPVersionParams) (radar.AttackLayer7SummaryIPVersionResponse, error)
+- client.Radar.Attacks.Layer7.Summary.ManagedRules(ctx context.Context, query radar.AttackLayer7SummaryManagedRulesParams) (radar.AttackLayer7SummaryManagedRulesResponse, error)
+- client.Radar.Attacks.Layer7.Summary.MitigationProduct(ctx context.Context, query radar.AttackLayer7SummaryMitigationProductParams) (radar.AttackLayer7SummaryMitigationProductResponse, error)
#### TimeseriesGroups
Response Types:
-- cloudflare.RadarAttackLayer7TimeseriesGroupGetResponse
-- cloudflare.RadarAttackLayer7TimeseriesGroupHTTPMethodResponse
-- cloudflare.RadarAttackLayer7TimeseriesGroupHTTPVersionResponse
-- cloudflare.RadarAttackLayer7TimeseriesGroupIndustryResponse
-- cloudflare.RadarAttackLayer7TimeseriesGroupIPVersionResponse
-- cloudflare.RadarAttackLayer7TimeseriesGroupManagedRulesResponse
-- cloudflare.RadarAttackLayer7TimeseriesGroupMitigationProductResponse
-- cloudflare.RadarAttackLayer7TimeseriesGroupVerticalResponse
+- radar.AttackLayer7TimeseriesGroupGetResponse
+- radar.AttackLayer7TimeseriesGroupHTTPMethodResponse
+- radar.AttackLayer7TimeseriesGroupHTTPVersionResponse
+- radar.AttackLayer7TimeseriesGroupIndustryResponse
+- radar.AttackLayer7TimeseriesGroupIPVersionResponse
+- radar.AttackLayer7TimeseriesGroupManagedRulesResponse
+- radar.AttackLayer7TimeseriesGroupMitigationProductResponse
+- radar.AttackLayer7TimeseriesGroupVerticalResponse
Methods:
-- client.Radar.Attacks.Layer7.TimeseriesGroups.Get(ctx context.Context, query cloudflare.RadarAttackLayer7TimeseriesGroupGetParams) (cloudflare.RadarAttackLayer7TimeseriesGroupGetResponse, error)
-- client.Radar.Attacks.Layer7.TimeseriesGroups.HTTPMethod(ctx context.Context, query cloudflare.RadarAttackLayer7TimeseriesGroupHTTPMethodParams) (cloudflare.RadarAttackLayer7TimeseriesGroupHTTPMethodResponse, error)
-- client.Radar.Attacks.Layer7.TimeseriesGroups.HTTPVersion(ctx context.Context, query cloudflare.RadarAttackLayer7TimeseriesGroupHTTPVersionParams) (cloudflare.RadarAttackLayer7TimeseriesGroupHTTPVersionResponse, error)
-- client.Radar.Attacks.Layer7.TimeseriesGroups.Industry(ctx context.Context, query cloudflare.RadarAttackLayer7TimeseriesGroupIndustryParams) (cloudflare.RadarAttackLayer7TimeseriesGroupIndustryResponse, error)
-- client.Radar.Attacks.Layer7.TimeseriesGroups.IPVersion(ctx context.Context, query cloudflare.RadarAttackLayer7TimeseriesGroupIPVersionParams) (cloudflare.RadarAttackLayer7TimeseriesGroupIPVersionResponse, error)
-- client.Radar.Attacks.Layer7.TimeseriesGroups.ManagedRules(ctx context.Context, query cloudflare.RadarAttackLayer7TimeseriesGroupManagedRulesParams) (cloudflare.RadarAttackLayer7TimeseriesGroupManagedRulesResponse, error)
-- client.Radar.Attacks.Layer7.TimeseriesGroups.MitigationProduct(ctx context.Context, query cloudflare.RadarAttackLayer7TimeseriesGroupMitigationProductParams) (cloudflare.RadarAttackLayer7TimeseriesGroupMitigationProductResponse, error)
-- client.Radar.Attacks.Layer7.TimeseriesGroups.Vertical(ctx context.Context, query cloudflare.RadarAttackLayer7TimeseriesGroupVerticalParams) (cloudflare.RadarAttackLayer7TimeseriesGroupVerticalResponse, error)
+- client.Radar.Attacks.Layer7.TimeseriesGroups.Get(ctx context.Context, query radar.AttackLayer7TimeseriesGroupGetParams) (radar.AttackLayer7TimeseriesGroupGetResponse, error)
+- client.Radar.Attacks.Layer7.TimeseriesGroups.HTTPMethod(ctx context.Context, query radar.AttackLayer7TimeseriesGroupHTTPMethodParams) (radar.AttackLayer7TimeseriesGroupHTTPMethodResponse, error)
+- client.Radar.Attacks.Layer7.TimeseriesGroups.HTTPVersion(ctx context.Context, query radar.AttackLayer7TimeseriesGroupHTTPVersionParams) (radar.AttackLayer7TimeseriesGroupHTTPVersionResponse, error)
+- client.Radar.Attacks.Layer7.TimeseriesGroups.Industry(ctx context.Context, query radar.AttackLayer7TimeseriesGroupIndustryParams) (radar.AttackLayer7TimeseriesGroupIndustryResponse, error)
+- client.Radar.Attacks.Layer7.TimeseriesGroups.IPVersion(ctx context.Context, query radar.AttackLayer7TimeseriesGroupIPVersionParams) (radar.AttackLayer7TimeseriesGroupIPVersionResponse, error)
+- client.Radar.Attacks.Layer7.TimeseriesGroups.ManagedRules(ctx context.Context, query radar.AttackLayer7TimeseriesGroupManagedRulesParams) (radar.AttackLayer7TimeseriesGroupManagedRulesResponse, error)
+- client.Radar.Attacks.Layer7.TimeseriesGroups.MitigationProduct(ctx context.Context, query radar.AttackLayer7TimeseriesGroupMitigationProductParams) (radar.AttackLayer7TimeseriesGroupMitigationProductResponse, error)
+- client.Radar.Attacks.Layer7.TimeseriesGroups.Vertical(ctx context.Context, query radar.AttackLayer7TimeseriesGroupVerticalParams) (radar.AttackLayer7TimeseriesGroupVerticalResponse, error)
#### Top
Response Types:
-- cloudflare.RadarAttackLayer7TopAttacksResponse
-- cloudflare.RadarAttackLayer7TopIndustryResponse
-- cloudflare.RadarAttackLayer7TopVerticalResponse
+- radar.AttackLayer7TopAttacksResponse
+- radar.AttackLayer7TopIndustryResponse
+- radar.AttackLayer7TopVerticalResponse
Methods:
-- client.Radar.Attacks.Layer7.Top.Attacks(ctx context.Context, query cloudflare.RadarAttackLayer7TopAttacksParams) (cloudflare.RadarAttackLayer7TopAttacksResponse, error)
-- client.Radar.Attacks.Layer7.Top.Industry(ctx context.Context, query cloudflare.RadarAttackLayer7TopIndustryParams) (cloudflare.RadarAttackLayer7TopIndustryResponse, error)
-- client.Radar.Attacks.Layer7.Top.Vertical(ctx context.Context, query cloudflare.RadarAttackLayer7TopVerticalParams) (cloudflare.RadarAttackLayer7TopVerticalResponse, error)
+- client.Radar.Attacks.Layer7.Top.Attacks(ctx context.Context, query radar.AttackLayer7TopAttacksParams) (radar.AttackLayer7TopAttacksResponse, error)
+- client.Radar.Attacks.Layer7.Top.Industry(ctx context.Context, query radar.AttackLayer7TopIndustryParams) (radar.AttackLayer7TopIndustryResponse, error)
+- client.Radar.Attacks.Layer7.Top.Vertical(ctx context.Context, query radar.AttackLayer7TopVerticalParams) (radar.AttackLayer7TopVerticalResponse, error)
##### Locations
Response Types:
-- cloudflare.RadarAttackLayer7TopLocationOriginResponse
-- cloudflare.RadarAttackLayer7TopLocationTargetResponse
+- radar.AttackLayer7TopLocationOriginResponse
+- radar.AttackLayer7TopLocationTargetResponse
Methods:
-- client.Radar.Attacks.Layer7.Top.Locations.Origin(ctx context.Context, query cloudflare.RadarAttackLayer7TopLocationOriginParams) (cloudflare.RadarAttackLayer7TopLocationOriginResponse, error)
-- client.Radar.Attacks.Layer7.Top.Locations.Target(ctx context.Context, query cloudflare.RadarAttackLayer7TopLocationTargetParams) (cloudflare.RadarAttackLayer7TopLocationTargetResponse, error)
+- client.Radar.Attacks.Layer7.Top.Locations.Origin(ctx context.Context, query radar.AttackLayer7TopLocationOriginParams) (radar.AttackLayer7TopLocationOriginResponse, error)
+- client.Radar.Attacks.Layer7.Top.Locations.Target(ctx context.Context, query radar.AttackLayer7TopLocationTargetParams) (radar.AttackLayer7TopLocationTargetResponse, error)
##### Ases
Response Types:
-- cloudflare.RadarAttackLayer7TopAseOriginResponse
+- radar.AttackLayer7TopAseOriginResponse
Methods:
-- client.Radar.Attacks.Layer7.Top.Ases.Origin(ctx context.Context, query cloudflare.RadarAttackLayer7TopAseOriginParams) (cloudflare.RadarAttackLayer7TopAseOriginResponse, error)
+- client.Radar.Attacks.Layer7.Top.Ases.Origin(ctx context.Context, query radar.AttackLayer7TopAseOriginParams) (radar.AttackLayer7TopAseOriginResponse, error)
## Entities
Response Types:
-- cloudflare.RadarEntityGetResponse
+- radar.EntityGetResponse
Methods:
-- client.Radar.Entities.Get(ctx context.Context, query cloudflare.RadarEntityGetParams) (cloudflare.RadarEntityGetResponse, error)
+- client.Radar.Entities.Get(ctx context.Context, query radar.EntityGetParams) (radar.EntityGetResponse, error)
### ASNs
Response Types:
-- cloudflare.RadarEntityASNListResponse
-- cloudflare.RadarEntityASNGetResponse
-- cloudflare.RadarEntityAsnipResponse
-- cloudflare.RadarEntityASNRelResponse
+- radar.EntityASNListResponse
+- radar.EntityASNGetResponse
+- radar.EntityAsnipResponse
+- radar.EntityASNRelResponse
Methods:
-- client.Radar.Entities.ASNs.List(ctx context.Context, query cloudflare.RadarEntityASNListParams) (cloudflare.RadarEntityASNListResponse, error)
-- client.Radar.Entities.ASNs.Get(ctx context.Context, asn int64, query cloudflare.RadarEntityASNGetParams) (cloudflare.RadarEntityASNGetResponse, error)
-- client.Radar.Entities.ASNs.IP(ctx context.Context, query cloudflare.RadarEntityASNIPParams) (cloudflare.RadarEntityAsnipResponse, error)
-- client.Radar.Entities.ASNs.Rel(ctx context.Context, asn int64, query cloudflare.RadarEntityASNRelParams) (cloudflare.RadarEntityASNRelResponse, error)
+- client.Radar.Entities.ASNs.List(ctx context.Context, query radar.EntityASNListParams) (radar.EntityASNListResponse, error)
+- client.Radar.Entities.ASNs.Get(ctx context.Context, asn int64, query radar.EntityASNGetParams) (radar.EntityASNGetResponse, error)
+- client.Radar.Entities.ASNs.IP(ctx context.Context, query radar.EntityASNIPParams) (radar.EntityAsnipResponse, error)
+- client.Radar.Entities.ASNs.Rel(ctx context.Context, asn int64, query radar.EntityASNRelParams) (radar.EntityASNRelResponse, error)
### Locations
Response Types:
-- cloudflare.RadarEntityLocationListResponse
-- cloudflare.RadarEntityLocationGetResponse
+- radar.EntityLocationListResponse
+- radar.EntityLocationGetResponse
Methods:
-- client.Radar.Entities.Locations.List(ctx context.Context, query cloudflare.RadarEntityLocationListParams) (cloudflare.RadarEntityLocationListResponse, error)
-- client.Radar.Entities.Locations.Get(ctx context.Context, location string, query cloudflare.RadarEntityLocationGetParams) (cloudflare.RadarEntityLocationGetResponse, error)
+- client.Radar.Entities.Locations.List(ctx context.Context, query radar.EntityLocationListParams) (radar.EntityLocationListResponse, error)
+- client.Radar.Entities.Locations.Get(ctx context.Context, location string, query radar.EntityLocationGetParams) (radar.EntityLocationGetResponse, error)
## HTTP
@@ -5835,221 +5721,221 @@ Methods:
Response Types:
-- cloudflare.RadarHTTPTopBrowserFamiliesResponse
-- cloudflare.RadarHTTPTopBrowsersResponse
+- radar.HTTPTopBrowserFamiliesResponse
+- radar.HTTPTopBrowsersResponse
Methods:
-- client.Radar.HTTP.Top.BrowserFamilies(ctx context.Context, query cloudflare.RadarHTTPTopBrowserFamiliesParams) (cloudflare.RadarHTTPTopBrowserFamiliesResponse, error)
-- client.Radar.HTTP.Top.Browsers(ctx context.Context, query cloudflare.RadarHTTPTopBrowsersParams) (cloudflare.RadarHTTPTopBrowsersResponse, error)
+- client.Radar.HTTP.Top.BrowserFamilies(ctx context.Context, query radar.HTTPTopBrowserFamiliesParams) (radar.HTTPTopBrowserFamiliesResponse, error)
+- client.Radar.HTTP.Top.Browsers(ctx context.Context, query radar.HTTPTopBrowsersParams) (radar.HTTPTopBrowsersResponse, error)
### Locations
Response Types:
-- cloudflare.RadarHTTPLocationGetResponse
+- radar.HTTPLocationGetResponse
Methods:
-- client.Radar.HTTP.Locations.Get(ctx context.Context, query cloudflare.RadarHTTPLocationGetParams) (cloudflare.RadarHTTPLocationGetResponse, error)
+- client.Radar.HTTP.Locations.Get(ctx context.Context, query radar.HTTPLocationGetParams) (radar.HTTPLocationGetResponse, error)
#### BotClass
Response Types:
-- cloudflare.RadarHTTPLocationBotClassGetResponse
+- radar.HTTPLocationBotClassGetResponse
Methods:
-- client.Radar.HTTP.Locations.BotClass.Get(ctx context.Context, botClass cloudflare.RadarHTTPLocationBotClassGetParamsBotClass, query cloudflare.RadarHTTPLocationBotClassGetParams) (cloudflare.RadarHTTPLocationBotClassGetResponse, error)
+- client.Radar.HTTP.Locations.BotClass.Get(ctx context.Context, botClass radar.HTTPLocationBotClassGetParamsBotClass, query radar.HTTPLocationBotClassGetParams) (radar.HTTPLocationBotClassGetResponse, error)
#### DeviceType
Response Types:
-- cloudflare.RadarHTTPLocationDeviceTypeGetResponse
+- radar.HTTPLocationDeviceTypeGetResponse
Methods:
-- client.Radar.HTTP.Locations.DeviceType.Get(ctx context.Context, deviceType cloudflare.RadarHTTPLocationDeviceTypeGetParamsDeviceType, query cloudflare.RadarHTTPLocationDeviceTypeGetParams) (cloudflare.RadarHTTPLocationDeviceTypeGetResponse, error)
+- client.Radar.HTTP.Locations.DeviceType.Get(ctx context.Context, deviceType radar.HTTPLocationDeviceTypeGetParamsDeviceType, query radar.HTTPLocationDeviceTypeGetParams) (radar.HTTPLocationDeviceTypeGetResponse, error)
#### HTTPProtocol
Response Types:
-- cloudflare.RadarHTTPLocationHTTPProtocolGetResponse
+- radar.HTTPLocationHTTPProtocolGetResponse
Methods:
-- client.Radar.HTTP.Locations.HTTPProtocol.Get(ctx context.Context, httpProtocol cloudflare.RadarHTTPLocationHTTPProtocolGetParamsHTTPProtocol, query cloudflare.RadarHTTPLocationHTTPProtocolGetParams) (cloudflare.RadarHTTPLocationHTTPProtocolGetResponse, error)
+- client.Radar.HTTP.Locations.HTTPProtocol.Get(ctx context.Context, httpProtocol radar.HTTPLocationHTTPProtocolGetParamsHTTPProtocol, query radar.HTTPLocationHTTPProtocolGetParams) (radar.HTTPLocationHTTPProtocolGetResponse, error)
#### HTTPMethod
Response Types:
-- cloudflare.RadarHTTPLocationHTTPMethodGetResponse
+- radar.HTTPLocationHTTPMethodGetResponse
Methods:
-- client.Radar.HTTP.Locations.HTTPMethod.Get(ctx context.Context, httpVersion cloudflare.RadarHTTPLocationHTTPMethodGetParamsHTTPVersion, query cloudflare.RadarHTTPLocationHTTPMethodGetParams) (cloudflare.RadarHTTPLocationHTTPMethodGetResponse, error)
+- client.Radar.HTTP.Locations.HTTPMethod.Get(ctx context.Context, httpVersion radar.HTTPLocationHTTPMethodGetParamsHTTPVersion, query radar.HTTPLocationHTTPMethodGetParams) (radar.HTTPLocationHTTPMethodGetResponse, error)
#### IPVersion
Response Types:
-- cloudflare.RadarHTTPLocationIPVersionGetResponse
+- radar.HTTPLocationIPVersionGetResponse
Methods:
-- client.Radar.HTTP.Locations.IPVersion.Get(ctx context.Context, ipVersion cloudflare.RadarHTTPLocationIPVersionGetParamsIPVersion, query cloudflare.RadarHTTPLocationIPVersionGetParams) (cloudflare.RadarHTTPLocationIPVersionGetResponse, error)
+- client.Radar.HTTP.Locations.IPVersion.Get(ctx context.Context, ipVersion radar.HTTPLocationIPVersionGetParamsIPVersion, query radar.HTTPLocationIPVersionGetParams) (radar.HTTPLocationIPVersionGetResponse, error)
#### OS
Response Types:
-- cloudflare.RadarHTTPLocationOSGetResponse
+- radar.HTTPLocationOSGetResponse
Methods:
-- client.Radar.HTTP.Locations.OS.Get(ctx context.Context, os cloudflare.RadarHTTPLocationOSGetParamsOS, query cloudflare.RadarHTTPLocationOSGetParams) (cloudflare.RadarHTTPLocationOSGetResponse, error)
+- client.Radar.HTTP.Locations.OS.Get(ctx context.Context, os radar.HTTPLocationOSGetParamsOS, query radar.HTTPLocationOSGetParams) (radar.HTTPLocationOSGetResponse, error)
#### TLSVersion
Response Types:
-- cloudflare.RadarHTTPLocationTLSVersionGetResponse
+- radar.HTTPLocationTLSVersionGetResponse
Methods:
-- client.Radar.HTTP.Locations.TLSVersion.Get(ctx context.Context, tlsVersion cloudflare.RadarHTTPLocationTLSVersionGetParamsTLSVersion, query cloudflare.RadarHTTPLocationTLSVersionGetParams) (cloudflare.RadarHTTPLocationTLSVersionGetResponse, error)
+- client.Radar.HTTP.Locations.TLSVersion.Get(ctx context.Context, tlsVersion radar.HTTPLocationTLSVersionGetParamsTLSVersion, query radar.HTTPLocationTLSVersionGetParams) (radar.HTTPLocationTLSVersionGetResponse, error)
### Ases
Response Types:
-- cloudflare.RadarHTTPAseGetResponse
+- radar.HTTPAseGetResponse
Methods:
-- client.Radar.HTTP.Ases.Get(ctx context.Context, query cloudflare.RadarHTTPAseGetParams) (cloudflare.RadarHTTPAseGetResponse, error)
+- client.Radar.HTTP.Ases.Get(ctx context.Context, query radar.HTTPAseGetParams) (radar.HTTPAseGetResponse, error)
#### BotClass
Response Types:
-- cloudflare.RadarHTTPAseBotClassGetResponse
+- radar.HTTPAseBotClassGetResponse
Methods:
-- client.Radar.HTTP.Ases.BotClass.Get(ctx context.Context, botClass cloudflare.RadarHTTPAseBotClassGetParamsBotClass, query cloudflare.RadarHTTPAseBotClassGetParams) (cloudflare.RadarHTTPAseBotClassGetResponse, error)
+- client.Radar.HTTP.Ases.BotClass.Get(ctx context.Context, botClass radar.HTTPAseBotClassGetParamsBotClass, query radar.HTTPAseBotClassGetParams) (radar.HTTPAseBotClassGetResponse, error)
#### DeviceType
Response Types:
-- cloudflare.RadarHTTPAseDeviceTypeGetResponse
+- radar.HTTPAseDeviceTypeGetResponse
Methods:
-- client.Radar.HTTP.Ases.DeviceType.Get(ctx context.Context, deviceType cloudflare.RadarHTTPAseDeviceTypeGetParamsDeviceType, query cloudflare.RadarHTTPAseDeviceTypeGetParams) (cloudflare.RadarHTTPAseDeviceTypeGetResponse, error)
+- client.Radar.HTTP.Ases.DeviceType.Get(ctx context.Context, deviceType radar.HTTPAseDeviceTypeGetParamsDeviceType, query radar.HTTPAseDeviceTypeGetParams) (radar.HTTPAseDeviceTypeGetResponse, error)
#### HTTPProtocol
Response Types:
-- cloudflare.RadarHTTPAseHTTPProtocolGetResponse
+- radar.HTTPAseHTTPProtocolGetResponse
Methods:
-- client.Radar.HTTP.Ases.HTTPProtocol.Get(ctx context.Context, httpProtocol cloudflare.RadarHTTPAseHTTPProtocolGetParamsHTTPProtocol, query cloudflare.RadarHTTPAseHTTPProtocolGetParams) (cloudflare.RadarHTTPAseHTTPProtocolGetResponse, error)
+- client.Radar.HTTP.Ases.HTTPProtocol.Get(ctx context.Context, httpProtocol radar.HTTPAseHTTPProtocolGetParamsHTTPProtocol, query radar.HTTPAseHTTPProtocolGetParams) (radar.HTTPAseHTTPProtocolGetResponse, error)
#### HTTPMethod
Response Types:
-- cloudflare.RadarHTTPAseHTTPMethodGetResponse
+- radar.HTTPAseHTTPMethodGetResponse
Methods:
-- client.Radar.HTTP.Ases.HTTPMethod.Get(ctx context.Context, httpVersion cloudflare.RadarHTTPAseHTTPMethodGetParamsHTTPVersion, query cloudflare.RadarHTTPAseHTTPMethodGetParams) (cloudflare.RadarHTTPAseHTTPMethodGetResponse, error)
+- client.Radar.HTTP.Ases.HTTPMethod.Get(ctx context.Context, httpVersion radar.HTTPAseHTTPMethodGetParamsHTTPVersion, query radar.HTTPAseHTTPMethodGetParams) (radar.HTTPAseHTTPMethodGetResponse, error)
#### IPVersion
Response Types:
-- cloudflare.RadarHTTPAseIPVersionGetResponse
+- radar.HTTPAseIPVersionGetResponse
Methods:
-- client.Radar.HTTP.Ases.IPVersion.Get(ctx context.Context, ipVersion cloudflare.RadarHTTPAseIPVersionGetParamsIPVersion, query cloudflare.RadarHTTPAseIPVersionGetParams) (cloudflare.RadarHTTPAseIPVersionGetResponse, error)
+- client.Radar.HTTP.Ases.IPVersion.Get(ctx context.Context, ipVersion radar.HTTPAseIPVersionGetParamsIPVersion, query radar.HTTPAseIPVersionGetParams) (radar.HTTPAseIPVersionGetResponse, error)
#### OS
Response Types:
-- cloudflare.RadarHTTPAseOSGetResponse
+- radar.HTTPAseOSGetResponse
Methods:
-- client.Radar.HTTP.Ases.OS.Get(ctx context.Context, os cloudflare.RadarHTTPAseOSGetParamsOS, query cloudflare.RadarHTTPAseOSGetParams) (cloudflare.RadarHTTPAseOSGetResponse, error)
+- client.Radar.HTTP.Ases.OS.Get(ctx context.Context, os radar.HTTPAseOSGetParamsOS, query radar.HTTPAseOSGetParams) (radar.HTTPAseOSGetResponse, error)
#### TLSVersion
Response Types:
-- cloudflare.RadarHTTPAseTLSVersionGetResponse
+- radar.HTTPAseTLSVersionGetResponse
Methods:
-- client.Radar.HTTP.Ases.TLSVersion.Get(ctx context.Context, tlsVersion cloudflare.RadarHTTPAseTLSVersionGetParamsTLSVersion, query cloudflare.RadarHTTPAseTLSVersionGetParams) (cloudflare.RadarHTTPAseTLSVersionGetResponse, error)
+- client.Radar.HTTP.Ases.TLSVersion.Get(ctx context.Context, tlsVersion radar.HTTPAseTLSVersionGetParamsTLSVersion, query radar.HTTPAseTLSVersionGetParams) (radar.HTTPAseTLSVersionGetResponse, error)
### Summary
Response Types:
-- cloudflare.RadarHTTPSummaryBotClassResponse
-- cloudflare.RadarHTTPSummaryDeviceTypeResponse
-- cloudflare.RadarHTTPSummaryHTTPProtocolResponse
-- cloudflare.RadarHTTPSummaryHTTPVersionResponse
-- cloudflare.RadarHTTPSummaryIPVersionResponse
-- cloudflare.RadarHTTPSummaryOSResponse
-- cloudflare.RadarHTTPSummaryTLSVersionResponse
+- radar.HTTPSummaryBotClassResponse
+- radar.HTTPSummaryDeviceTypeResponse
+- radar.HTTPSummaryHTTPProtocolResponse
+- radar.HTTPSummaryHTTPVersionResponse
+- radar.HTTPSummaryIPVersionResponse
+- radar.HTTPSummaryOSResponse
+- radar.HTTPSummaryTLSVersionResponse
Methods:
-- client.Radar.HTTP.Summary.BotClass(ctx context.Context, query cloudflare.RadarHTTPSummaryBotClassParams) (cloudflare.RadarHTTPSummaryBotClassResponse, error)
-- client.Radar.HTTP.Summary.DeviceType(ctx context.Context, query cloudflare.RadarHTTPSummaryDeviceTypeParams) (cloudflare.RadarHTTPSummaryDeviceTypeResponse, error)
-- client.Radar.HTTP.Summary.HTTPProtocol(ctx context.Context, query cloudflare.RadarHTTPSummaryHTTPProtocolParams) (cloudflare.RadarHTTPSummaryHTTPProtocolResponse, error)
-- client.Radar.HTTP.Summary.HTTPVersion(ctx context.Context, query cloudflare.RadarHTTPSummaryHTTPVersionParams) (cloudflare.RadarHTTPSummaryHTTPVersionResponse, error)
-- client.Radar.HTTP.Summary.IPVersion(ctx context.Context, query cloudflare.RadarHTTPSummaryIPVersionParams) (cloudflare.RadarHTTPSummaryIPVersionResponse, error)
-- client.Radar.HTTP.Summary.OS(ctx context.Context, query cloudflare.RadarHTTPSummaryOSParams) (cloudflare.RadarHTTPSummaryOSResponse, error)
-- client.Radar.HTTP.Summary.TLSVersion(ctx context.Context, query cloudflare.RadarHTTPSummaryTLSVersionParams) (cloudflare.RadarHTTPSummaryTLSVersionResponse, error)
+- client.Radar.HTTP.Summary.BotClass(ctx context.Context, query radar.HTTPSummaryBotClassParams) (radar.HTTPSummaryBotClassResponse, error)
+- client.Radar.HTTP.Summary.DeviceType(ctx context.Context, query radar.HTTPSummaryDeviceTypeParams) (radar.HTTPSummaryDeviceTypeResponse, error)
+- client.Radar.HTTP.Summary.HTTPProtocol(ctx context.Context, query radar.HTTPSummaryHTTPProtocolParams) (radar.HTTPSummaryHTTPProtocolResponse, error)
+- client.Radar.HTTP.Summary.HTTPVersion(ctx context.Context, query radar.HTTPSummaryHTTPVersionParams) (radar.HTTPSummaryHTTPVersionResponse, error)
+- client.Radar.HTTP.Summary.IPVersion(ctx context.Context, query radar.HTTPSummaryIPVersionParams) (radar.HTTPSummaryIPVersionResponse, error)
+- client.Radar.HTTP.Summary.OS(ctx context.Context, query radar.HTTPSummaryOSParams) (radar.HTTPSummaryOSResponse, error)
+- client.Radar.HTTP.Summary.TLSVersion(ctx context.Context, query radar.HTTPSummaryTLSVersionParams) (radar.HTTPSummaryTLSVersionResponse, error)
### TimeseriesGroups
Response Types:
-- cloudflare.RadarHTTPTimeseriesGroupBotClassResponse
-- cloudflare.RadarHTTPTimeseriesGroupBrowserResponse
-- cloudflare.RadarHTTPTimeseriesGroupBrowserFamilyResponse
-- cloudflare.RadarHTTPTimeseriesGroupDeviceTypeResponse
-- cloudflare.RadarHTTPTimeseriesGroupHTTPProtocolResponse
-- cloudflare.RadarHTTPTimeseriesGroupHTTPVersionResponse
-- cloudflare.RadarHTTPTimeseriesGroupIPVersionResponse
-- cloudflare.RadarHTTPTimeseriesGroupOSResponse
-- cloudflare.RadarHTTPTimeseriesGroupTLSVersionResponse
+- radar.HTTPTimeseriesGroupBotClassResponse
+- radar.HTTPTimeseriesGroupBrowserResponse
+- radar.HTTPTimeseriesGroupBrowserFamilyResponse
+- radar.HTTPTimeseriesGroupDeviceTypeResponse
+- radar.HTTPTimeseriesGroupHTTPProtocolResponse
+- radar.HTTPTimeseriesGroupHTTPVersionResponse
+- radar.HTTPTimeseriesGroupIPVersionResponse
+- radar.HTTPTimeseriesGroupOSResponse
+- radar.HTTPTimeseriesGroupTLSVersionResponse
Methods:
-- client.Radar.HTTP.TimeseriesGroups.BotClass(ctx context.Context, query cloudflare.RadarHTTPTimeseriesGroupBotClassParams) (cloudflare.RadarHTTPTimeseriesGroupBotClassResponse, error)
-- client.Radar.HTTP.TimeseriesGroups.Browser(ctx context.Context, query cloudflare.RadarHTTPTimeseriesGroupBrowserParams) (cloudflare.RadarHTTPTimeseriesGroupBrowserResponse, error)
-- client.Radar.HTTP.TimeseriesGroups.BrowserFamily(ctx context.Context, query cloudflare.RadarHTTPTimeseriesGroupBrowserFamilyParams) (cloudflare.RadarHTTPTimeseriesGroupBrowserFamilyResponse, error)
-- client.Radar.HTTP.TimeseriesGroups.DeviceType(ctx context.Context, query cloudflare.RadarHTTPTimeseriesGroupDeviceTypeParams) (cloudflare.RadarHTTPTimeseriesGroupDeviceTypeResponse, error)
-- client.Radar.HTTP.TimeseriesGroups.HTTPProtocol(ctx context.Context, query cloudflare.RadarHTTPTimeseriesGroupHTTPProtocolParams) (cloudflare.RadarHTTPTimeseriesGroupHTTPProtocolResponse, error)
-- client.Radar.HTTP.TimeseriesGroups.HTTPVersion(ctx context.Context, query cloudflare.RadarHTTPTimeseriesGroupHTTPVersionParams) (cloudflare.RadarHTTPTimeseriesGroupHTTPVersionResponse, error)
-- client.Radar.HTTP.TimeseriesGroups.IPVersion(ctx context.Context, query cloudflare.RadarHTTPTimeseriesGroupIPVersionParams) (cloudflare.RadarHTTPTimeseriesGroupIPVersionResponse, error)
-- client.Radar.HTTP.TimeseriesGroups.OS(ctx context.Context, query cloudflare.RadarHTTPTimeseriesGroupOSParams) (cloudflare.RadarHTTPTimeseriesGroupOSResponse, error)
-- client.Radar.HTTP.TimeseriesGroups.TLSVersion(ctx context.Context, query cloudflare.RadarHTTPTimeseriesGroupTLSVersionParams) (cloudflare.RadarHTTPTimeseriesGroupTLSVersionResponse, error)
+- client.Radar.HTTP.TimeseriesGroups.BotClass(ctx context.Context, query radar.HTTPTimeseriesGroupBotClassParams) (radar.HTTPTimeseriesGroupBotClassResponse, error)
+- client.Radar.HTTP.TimeseriesGroups.Browser(ctx context.Context, query radar.HTTPTimeseriesGroupBrowserParams) (radar.HTTPTimeseriesGroupBrowserResponse, error)
+- client.Radar.HTTP.TimeseriesGroups.BrowserFamily(ctx context.Context, query radar.HTTPTimeseriesGroupBrowserFamilyParams) (radar.HTTPTimeseriesGroupBrowserFamilyResponse, error)
+- client.Radar.HTTP.TimeseriesGroups.DeviceType(ctx context.Context, query radar.HTTPTimeseriesGroupDeviceTypeParams) (radar.HTTPTimeseriesGroupDeviceTypeResponse, error)
+- client.Radar.HTTP.TimeseriesGroups.HTTPProtocol(ctx context.Context, query radar.HTTPTimeseriesGroupHTTPProtocolParams) (radar.HTTPTimeseriesGroupHTTPProtocolResponse, error)
+- client.Radar.HTTP.TimeseriesGroups.HTTPVersion(ctx context.Context, query radar.HTTPTimeseriesGroupHTTPVersionParams) (radar.HTTPTimeseriesGroupHTTPVersionResponse, error)
+- client.Radar.HTTP.TimeseriesGroups.IPVersion(ctx context.Context, query radar.HTTPTimeseriesGroupIPVersionParams) (radar.HTTPTimeseriesGroupIPVersionResponse, error)
+- client.Radar.HTTP.TimeseriesGroups.OS(ctx context.Context, query radar.HTTPTimeseriesGroupOSParams) (radar.HTTPTimeseriesGroupOSResponse, error)
+- client.Radar.HTTP.TimeseriesGroups.TLSVersion(ctx context.Context, query radar.HTTPTimeseriesGroupTLSVersionParams) (radar.HTTPTimeseriesGroupTLSVersionResponse, error)
## Quality
@@ -6057,163 +5943,162 @@ Methods:
Response Types:
-- cloudflare.RadarQualityIQISummaryResponse
-- cloudflare.RadarQualityIQITimeseriesGroupsResponse
+- radar.QualityIQISummaryResponse
+- radar.QualityIQITimeseriesGroupsResponse
Methods:
-- client.Radar.Quality.IQI.Summary(ctx context.Context, query cloudflare.RadarQualityIQISummaryParams) (cloudflare.RadarQualityIQISummaryResponse, error)
-- client.Radar.Quality.IQI.TimeseriesGroups(ctx context.Context, query cloudflare.RadarQualityIQITimeseriesGroupsParams) (cloudflare.RadarQualityIQITimeseriesGroupsResponse, error)
+- client.Radar.Quality.IQI.Summary(ctx context.Context, query radar.QualityIQISummaryParams) (radar.QualityIQISummaryResponse, error)
+- client.Radar.Quality.IQI.TimeseriesGroups(ctx context.Context, query radar.QualityIQITimeseriesGroupsParams) (radar.QualityIQITimeseriesGroupsResponse, error)
### Speed
Response Types:
-- cloudflare.RadarQualitySpeedHistogramResponse
-- cloudflare.RadarQualitySpeedSummaryResponse
+- radar.QualitySpeedHistogramResponse
+- radar.QualitySpeedSummaryResponse
Methods:
-- client.Radar.Quality.Speed.Histogram(ctx context.Context, query cloudflare.RadarQualitySpeedHistogramParams) (cloudflare.RadarQualitySpeedHistogramResponse, error)
-- client.Radar.Quality.Speed.Summary(ctx context.Context, query cloudflare.RadarQualitySpeedSummaryParams) (cloudflare.RadarQualitySpeedSummaryResponse, error)
+- client.Radar.Quality.Speed.Histogram(ctx context.Context, query radar.QualitySpeedHistogramParams) (radar.QualitySpeedHistogramResponse, error)
+- client.Radar.Quality.Speed.Summary(ctx context.Context, query radar.QualitySpeedSummaryParams) (radar.QualitySpeedSummaryResponse, error)
#### Top
Response Types:
-- cloudflare.RadarQualitySpeedTopAsesResponse
-- cloudflare.RadarQualitySpeedTopLocationsResponse
+- radar.QualitySpeedTopAsesResponse
+- radar.QualitySpeedTopLocationsResponse
Methods:
-- client.Radar.Quality.Speed.Top.Ases(ctx context.Context, query cloudflare.RadarQualitySpeedTopAsesParams) (cloudflare.RadarQualitySpeedTopAsesResponse, error)
-- client.Radar.Quality.Speed.Top.Locations(ctx context.Context, query cloudflare.RadarQualitySpeedTopLocationsParams) (cloudflare.RadarQualitySpeedTopLocationsResponse, error)
+- client.Radar.Quality.Speed.Top.Ases(ctx context.Context, query radar.QualitySpeedTopAsesParams) (radar.QualitySpeedTopAsesResponse, error)
+- client.Radar.Quality.Speed.Top.Locations(ctx context.Context, query radar.QualitySpeedTopLocationsParams) (radar.QualitySpeedTopLocationsResponse, error)
## Ranking
Response Types:
-- cloudflare.RadarRankingTimeseriesGroupsResponse
-- cloudflare.RadarRankingTopResponse
+- radar.RankingTimeseriesGroupsResponse
+- radar.RankingTopResponse
Methods:
-- client.Radar.Ranking.TimeseriesGroups(ctx context.Context, query cloudflare.RadarRankingTimeseriesGroupsParams) (cloudflare.RadarRankingTimeseriesGroupsResponse, error)
-- client.Radar.Ranking.Top(ctx context.Context, query cloudflare.RadarRankingTopParams) (cloudflare.RadarRankingTopResponse, error)
+- client.Radar.Ranking.TimeseriesGroups(ctx context.Context, query radar.RankingTimeseriesGroupsParams) (radar.RankingTimeseriesGroupsResponse, error)
+- client.Radar.Ranking.Top(ctx context.Context, query radar.RankingTopParams) (radar.RankingTopResponse, error)
### Domain
Response Types:
-- cloudflare.RadarRankingDomainGetResponse
+- radar.RankingDomainGetResponse
Methods:
-- client.Radar.Ranking.Domain.Get(ctx context.Context, domain string, query cloudflare.RadarRankingDomainGetParams) (cloudflare.RadarRankingDomainGetResponse, error)
+- client.Radar.Ranking.Domain.Get(ctx context.Context, domain string, query radar.RankingDomainGetParams) (radar.RankingDomainGetResponse, error)
## TrafficAnomalies
Response Types:
-- cloudflare.RadarTrafficAnomalyGetResponse
+- radar.TrafficAnomalyGetResponse
Methods:
-- client.Radar.TrafficAnomalies.Get(ctx context.Context, query cloudflare.RadarTrafficAnomalyGetParams) (cloudflare.RadarTrafficAnomalyGetResponse, error)
+- client.Radar.TrafficAnomalies.Get(ctx context.Context, query radar.TrafficAnomalyGetParams) (radar.TrafficAnomalyGetResponse, error)
### Locations
Response Types:
-- cloudflare.RadarTrafficAnomalyLocationGetResponse
+- radar.TrafficAnomalyLocationGetResponse
Methods:
-- client.Radar.TrafficAnomalies.Locations.Get(ctx context.Context, query cloudflare.RadarTrafficAnomalyLocationGetParams) (cloudflare.RadarTrafficAnomalyLocationGetResponse, error)
+- client.Radar.TrafficAnomalies.Locations.Get(ctx context.Context, query radar.TrafficAnomalyLocationGetParams) (radar.TrafficAnomalyLocationGetResponse, error)
# BotManagement
Response Types:
-- cloudflare.BotManagementUpdateResponse
-- cloudflare.BotManagementGetResponse
+- bot_management.BotManagementUpdateResponse
+- bot_management.BotManagementGetResponse
Methods:
-- client.BotManagement.Update(ctx context.Context, params cloudflare.BotManagementUpdateParams) (cloudflare.BotManagementUpdateResponse, error)
-- client.BotManagement.Get(ctx context.Context, query cloudflare.BotManagementGetParams) (cloudflare.BotManagementGetResponse, error)
+- client.BotManagement.Update(ctx context.Context, params bot_management.BotManagementUpdateParams) (bot_management.BotManagementUpdateResponse, error)
+- client.BotManagement.Get(ctx context.Context, query bot_management.BotManagementGetParams) (bot_management.BotManagementGetResponse, error)
# OriginPostQuantumEncryption
Response Types:
-- cloudflare.OriginPostQuantumEncryptionUpdateResponse
-- cloudflare.OriginPostQuantumEncryptionGetResponse
+- origin_post_quantum_encryption.OriginPostQuantumEncryptionUpdateResponse
+- origin_post_quantum_encryption.OriginPostQuantumEncryptionGetResponse
Methods:
-- client.OriginPostQuantumEncryption.Update(ctx context.Context, params cloudflare.OriginPostQuantumEncryptionUpdateParams) (cloudflare.OriginPostQuantumEncryptionUpdateResponse, error)
-- client.OriginPostQuantumEncryption.Get(ctx context.Context, query cloudflare.OriginPostQuantumEncryptionGetParams) (cloudflare.OriginPostQuantumEncryptionGetResponse, error)
+- client.OriginPostQuantumEncryption.Update(ctx context.Context, params origin_post_quantum_encryption.OriginPostQuantumEncryptionUpdateParams) (origin_post_quantum_encryption.OriginPostQuantumEncryptionUpdateResponse, error)
+- client.OriginPostQuantumEncryption.Get(ctx context.Context, query origin_post_quantum_encryption.OriginPostQuantumEncryptionGetParams) (origin_post_quantum_encryption.OriginPostQuantumEncryptionGetResponse, error)
# Speed
Response Types:
-- cloudflare.SpeedDeleteResponse
-- cloudflare.SpeedScheduleGetResponse
-- cloudflare.SpeedTrendsListResponse
+- speed.ObservatorySchedule
+- speed.ObservatoryTrend
+- speed.SpeedDeleteResponse
Methods:
-- client.Speed.Delete(ctx context.Context, url string, params cloudflare.SpeedDeleteParams) (cloudflare.SpeedDeleteResponse, error)
-- client.Speed.ScheduleGet(ctx context.Context, url string, params cloudflare.SpeedScheduleGetParams) (cloudflare.SpeedScheduleGetResponse, error)
-- client.Speed.TrendsList(ctx context.Context, url string, params cloudflare.SpeedTrendsListParams) (cloudflare.SpeedTrendsListResponse, error)
+- client.Speed.Delete(ctx context.Context, url string, params speed.SpeedDeleteParams) (speed.SpeedDeleteResponse, error)
+- client.Speed.ScheduleGet(ctx context.Context, url string, params speed.SpeedScheduleGetParams) (speed.ObservatorySchedule, error)
+- client.Speed.TrendsList(ctx context.Context, url string, params speed.SpeedTrendsListParams) (speed.ObservatoryTrend, error)
## Tests
Response Types:
-- cloudflare.SpeedTestNewResponse
-- cloudflare.SpeedTestListResponse
-- cloudflare.SpeedTestDeleteResponse
-- cloudflare.SpeedTestGetResponse
+- speed.ObservatoryPageTest
+- speed.TestListResponse
+- speed.TestDeleteResponse
Methods:
-- client.Speed.Tests.New(ctx context.Context, url string, params cloudflare.SpeedTestNewParams) (cloudflare.SpeedTestNewResponse, error)
-- client.Speed.Tests.List(ctx context.Context, url string, params cloudflare.SpeedTestListParams) (cloudflare.SpeedTestListResponse, error)
-- client.Speed.Tests.Delete(ctx context.Context, url string, params cloudflare.SpeedTestDeleteParams) (cloudflare.SpeedTestDeleteResponse, error)
-- client.Speed.Tests.Get(ctx context.Context, url string, testID string, query cloudflare.SpeedTestGetParams) (cloudflare.SpeedTestGetResponse, error)
+- client.Speed.Tests.New(ctx context.Context, url string, params speed.TestNewParams) (speed.ObservatoryPageTest, error)
+- client.Speed.Tests.List(ctx context.Context, url string, params speed.TestListParams) (speed.TestListResponse, error)
+- client.Speed.Tests.Delete(ctx context.Context, url string, params speed.TestDeleteParams) (speed.TestDeleteResponse, error)
+- client.Speed.Tests.Get(ctx context.Context, url string, testID string, query speed.TestGetParams) (speed.ObservatoryPageTest, error)
## Schedule
Response Types:
-- cloudflare.SpeedScheduleNewResponse
+- speed.ScheduleNewResponse
Methods:
-- client.Speed.Schedule.New(ctx context.Context, url string, params cloudflare.SpeedScheduleNewParams) (cloudflare.SpeedScheduleNewResponse, error)
+- client.Speed.Schedule.New(ctx context.Context, url string, params speed.ScheduleNewParams) (speed.ScheduleNewResponse, error)
## Availabilities
Response Types:
-- cloudflare.SpeedAvailabilityListResponse
+- speed.ObservatoryAvailabilities
Methods:
-- client.Speed.Availabilities.List(ctx context.Context, query cloudflare.SpeedAvailabilityListParams) (cloudflare.SpeedAvailabilityListResponse, error)
+- client.Speed.Availabilities.List(ctx context.Context, query speed.AvailabilityListParams) (speed.ObservatoryAvailabilities, error)
## Pages
Response Types:
-- cloudflare.SpeedPageListResponse
+- speed.PageListResponse
Methods:
-- client.Speed.Pages.List(ctx context.Context, query cloudflare.SpeedPageListParams) ([]cloudflare.SpeedPageListResponse, error)
+- client.Speed.Pages.List(ctx context.Context, query speed.PageListParams) ([]speed.PageListResponse, error)
# DCVDelegation
@@ -6221,11 +6106,11 @@ Methods:
Response Types:
-- cloudflare.DCVDelegationUUIDGetResponse
+- dcv_delegation.TLSCertificatesAndHostnamesUUIDObject
Methods:
-- client.DCVDelegation.UUID.Get(ctx context.Context, query cloudflare.DCVDelegationUUIDGetParams) (cloudflare.DCVDelegationUUIDGetResponse, error)
+- client.DCVDelegation.UUID.Get(ctx context.Context, query dcv_delegation.UUIDGetParams) (dcv_delegation.TLSCertificatesAndHostnamesUUIDObject, error)
# Hostnames
@@ -6235,67 +6120,62 @@ Methods:
Response Types:
-- cloudflare.HostnameSettingTLSUpdateResponse
-- cloudflare.HostnameSettingTLSDeleteResponse
-- cloudflare.HostnameSettingTLSGetResponse
+- hostnames.TLSCertificatesAndHostnamesSettingObject
+- hostnames.TLSCertificatesAndHostnamesSettingObjectDelete
+- hostnames.SettingTLSGetResponse
Methods:
-- client.Hostnames.Settings.TLS.Update(ctx context.Context, settingID cloudflare.HostnameSettingTLSUpdateParamsSettingID, hostname string, params cloudflare.HostnameSettingTLSUpdateParams) (cloudflare.HostnameSettingTLSUpdateResponse, error)
-- client.Hostnames.Settings.TLS.Delete(ctx context.Context, settingID cloudflare.HostnameSettingTLSDeleteParamsSettingID, hostname string, body cloudflare.HostnameSettingTLSDeleteParams) (cloudflare.HostnameSettingTLSDeleteResponse, error)
-- client.Hostnames.Settings.TLS.Get(ctx context.Context, settingID cloudflare.HostnameSettingTLSGetParamsSettingID, query cloudflare.HostnameSettingTLSGetParams) ([]cloudflare.HostnameSettingTLSGetResponse, error)
+- client.Hostnames.Settings.TLS.Update(ctx context.Context, settingID hostnames.SettingTLSUpdateParamsSettingID, hostname string, params hostnames.SettingTLSUpdateParams) (hostnames.TLSCertificatesAndHostnamesSettingObject, error)
+- client.Hostnames.Settings.TLS.Delete(ctx context.Context, settingID hostnames.SettingTLSDeleteParamsSettingID, hostname string, body hostnames.SettingTLSDeleteParams) (hostnames.TLSCertificatesAndHostnamesSettingObjectDelete, error)
+- client.Hostnames.Settings.TLS.Get(ctx context.Context, settingID hostnames.SettingTLSGetParamsSettingID, query hostnames.SettingTLSGetParams) ([]hostnames.SettingTLSGetResponse, error)
# Snippets
Response Types:
-- cloudflare.SnippetUpdateResponse
-- cloudflare.SnippetListResponse
-- cloudflare.SnippetDeleteResponse
-- cloudflare.SnippetGetResponse
+- snippets.Snippet
+- snippets.SnippetDeleteResponse
Methods:
-- client.Snippets.Update(ctx context.Context, zoneIdentifier string, snippetName string, body cloudflare.SnippetUpdateParams) (cloudflare.SnippetUpdateResponse, error)
-- client.Snippets.List(ctx context.Context, zoneIdentifier string) ([]cloudflare.SnippetListResponse, error)
-- client.Snippets.Delete(ctx context.Context, zoneIdentifier string, snippetName string) (cloudflare.SnippetDeleteResponse, error)
-- client.Snippets.Get(ctx context.Context, zoneIdentifier string, snippetName string) (cloudflare.SnippetGetResponse, error)
+- client.Snippets.Update(ctx context.Context, zoneIdentifier string, snippetName string, body snippets.SnippetUpdateParams) (snippets.Snippet, error)
+- client.Snippets.List(ctx context.Context, zoneIdentifier string) ([]snippets.Snippet, error)
+- client.Snippets.Delete(ctx context.Context, zoneIdentifier string, snippetName string) (snippets.SnippetDeleteResponse, error)
+- client.Snippets.Get(ctx context.Context, zoneIdentifier string, snippetName string) (snippets.Snippet, error)
## Content
Methods:
-- client.Snippets.Content.Get(ctx context.Context, zoneIdentifier string, snippetName string) (http.Response, error)
+- client.Snippets.Content.Get(ctx context.Context, zoneIdentifier string, snippetName string) (http.Response, error)
## Rules
Response Types:
-- cloudflare.SnippetRuleUpdateResponse
-- cloudflare.SnippetRuleListResponse
+- snippets.RuleUpdateResponse
+- snippets.RuleListResponse
Methods:
-- client.Snippets.Rules.Update(ctx context.Context, zoneIdentifier string, body cloudflare.SnippetRuleUpdateParams) ([]cloudflare.SnippetRuleUpdateResponse, error)
-- client.Snippets.Rules.List(ctx context.Context, zoneIdentifier string) ([]cloudflare.SnippetRuleListResponse, error)
+- client.Snippets.Rules.Update(ctx context.Context, zoneIdentifier string, body snippets.RuleUpdateParams) ([]snippets.RuleUpdateResponse, error)
+- client.Snippets.Rules.List(ctx context.Context, zoneIdentifier string) ([]snippets.RuleListResponse, error)
# Calls
Response Types:
-- cloudflare.CallNewResponse
-- cloudflare.CallUpdateResponse
-- cloudflare.CallListResponse
-- cloudflare.CallDeleteResponse
-- cloudflare.CallGetResponse
+- calls.CallsApp
+- calls.CallsAppWithSecret
Methods:
-- client.Calls.New(ctx context.Context, params cloudflare.CallNewParams) (cloudflare.CallNewResponse, error)
-- client.Calls.Update(ctx context.Context, appID string, params cloudflare.CallUpdateParams) (cloudflare.CallUpdateResponse, error)
-- client.Calls.List(ctx context.Context, query cloudflare.CallListParams) ([]cloudflare.CallListResponse, error)
-- client.Calls.Delete(ctx context.Context, appID string, body cloudflare.CallDeleteParams) (cloudflare.CallDeleteResponse, error)
-- client.Calls.Get(ctx context.Context, appID string, query cloudflare.CallGetParams) (cloudflare.CallGetResponse, error)
+- client.Calls.New(ctx context.Context, params calls.CallNewParams) (calls.CallsAppWithSecret, error)
+- client.Calls.Update(ctx context.Context, appID string, params calls.CallUpdateParams) (calls.CallsApp, error)
+- client.Calls.List(ctx context.Context, query calls.CallListParams) ([]calls.CallsApp, error)
+- client.Calls.Delete(ctx context.Context, appID string, body calls.CallDeleteParams) (calls.CallsApp, error)
+- client.Calls.Get(ctx context.Context, appID string, query calls.CallGetParams) (calls.CallsApp, error)
# CloudforceOne
@@ -6303,55 +6183,49 @@ Methods:
Response Types:
-- cloudflare.CloudforceOneRequestNewResponse
-- cloudflare.CloudforceOneRequestUpdateResponse
-- cloudflare.CloudforceOneRequestListResponse
-- cloudflare.CloudforceOneRequestDeleteResponse
-- cloudflare.CloudforceOneRequestConstantsResponse
-- cloudflare.CloudforceOneRequestGetResponse
-- cloudflare.CloudforceOneRequestQuotaResponse
+- cloudforce_one.CloudforceOneQuota
+- cloudforce_one.CloudforceOneRequestConstants
+- cloudforce_one.CloudforceOneRequestItem
+- cloudforce_one.CloudforceOneRequestListItem
+- cloudforce_one.CloudforceOneRequestTypes
+- cloudforce_one.RequestDeleteResponse
Methods:
-- client.CloudforceOne.Requests.New(ctx context.Context, accountIdentifier string, body cloudflare.CloudforceOneRequestNewParams) (cloudflare.CloudforceOneRequestNewResponse, error)
-- client.CloudforceOne.Requests.Update(ctx context.Context, accountIdentifier string, requestIdentifier string, body cloudflare.CloudforceOneRequestUpdateParams) (cloudflare.CloudforceOneRequestUpdateResponse, error)
-- client.CloudforceOne.Requests.List(ctx context.Context, accountIdentifier string, body cloudflare.CloudforceOneRequestListParams) (shared.V4PagePaginationArray[cloudflare.CloudforceOneRequestListResponse], error)
-- client.CloudforceOne.Requests.Delete(ctx context.Context, accountIdentifier string, requestIdentifier string) (cloudflare.CloudforceOneRequestDeleteResponse, error)
-- client.CloudforceOne.Requests.Constants(ctx context.Context, accountIdentifier string) (cloudflare.CloudforceOneRequestConstantsResponse, error)
-- client.CloudforceOne.Requests.Get(ctx context.Context, accountIdentifier string, requestIdentifier string) (cloudflare.CloudforceOneRequestGetResponse, error)
-- client.CloudforceOne.Requests.Quota(ctx context.Context, accountIdentifier string) (cloudflare.CloudforceOneRequestQuotaResponse, error)
-- client.CloudforceOne.Requests.Types(ctx context.Context, accountIdentifier string) ([]string, error)
+- client.CloudforceOne.Requests.New(ctx context.Context, accountIdentifier string, body cloudforce_one.RequestNewParams) (cloudforce_one.CloudforceOneRequestItem, error)
+- client.CloudforceOne.Requests.Update(ctx context.Context, accountIdentifier string, requestIdentifier string, body cloudforce_one.RequestUpdateParams) (cloudforce_one.CloudforceOneRequestItem, error)
+- client.CloudforceOne.Requests.List(ctx context.Context, accountIdentifier string, body cloudforce_one.RequestListParams) (shared.V4PagePaginationArray[cloudforce_one.CloudforceOneRequestListItem], error)
+- client.CloudforceOne.Requests.Delete(ctx context.Context, accountIdentifier string, requestIdentifier string) (cloudforce_one.RequestDeleteResponse, error)
+- client.CloudforceOne.Requests.Constants(ctx context.Context, accountIdentifier string) (cloudforce_one.CloudforceOneRequestConstants, error)
+- client.CloudforceOne.Requests.Get(ctx context.Context, accountIdentifier string, requestIdentifier string) (cloudforce_one.CloudforceOneRequestItem, error)
+- client.CloudforceOne.Requests.Quota(ctx context.Context, accountIdentifier string) (cloudforce_one.CloudforceOneQuota, error)
+- client.CloudforceOne.Requests.Types(ctx context.Context, accountIdentifier string) (cloudforce_one.CloudforceOneRequestTypes, error)
### Message
Response Types:
-- cloudflare.CloudforceOneRequestMessageNewResponse
-- cloudflare.CloudforceOneRequestMessageUpdateResponse
-- cloudflare.CloudforceOneRequestMessageDeleteResponse
-- cloudflare.CloudforceOneRequestMessageGetResponse
+- cloudforce_one.CloudforceOneRequestMessageItem
+- cloudforce_one.RequestMessageDeleteResponse
Methods:
-- client.CloudforceOne.Requests.Message.New(ctx context.Context, accountIdentifier string, requestIdentifier string, body cloudflare.CloudforceOneRequestMessageNewParams) (cloudflare.CloudforceOneRequestMessageNewResponse, error)
-- client.CloudforceOne.Requests.Message.Update(ctx context.Context, accountIdentifier string, requestIdentifier string, messageIdentifer int64, body cloudflare.CloudforceOneRequestMessageUpdateParams) (cloudflare.CloudforceOneRequestMessageUpdateResponse, error)
-- client.CloudforceOne.Requests.Message.Delete(ctx context.Context, accountIdentifier string, requestIdentifier string, messageIdentifer int64) (cloudflare.CloudforceOneRequestMessageDeleteResponse, error)
-- client.CloudforceOne.Requests.Message.Get(ctx context.Context, accountIdentifier string, requestIdentifier string, body cloudflare.CloudforceOneRequestMessageGetParams) ([]cloudflare.CloudforceOneRequestMessageGetResponse, error)
+- client.CloudforceOne.Requests.Message.New(ctx context.Context, accountIdentifier string, requestIdentifier string, body cloudforce_one.RequestMessageNewParams) (cloudforce_one.CloudforceOneRequestMessageItem, error)
+- client.CloudforceOne.Requests.Message.Update(ctx context.Context, accountIdentifier string, requestIdentifier string, messageIdentifer int64, body cloudforce_one.RequestMessageUpdateParams) (cloudforce_one.CloudforceOneRequestMessageItem, error)
+- client.CloudforceOne.Requests.Message.Delete(ctx context.Context, accountIdentifier string, requestIdentifier string, messageIdentifer int64) (cloudforce_one.RequestMessageDeleteResponse, error)
+- client.CloudforceOne.Requests.Message.Get(ctx context.Context, accountIdentifier string, requestIdentifier string, body cloudforce_one.RequestMessageGetParams) ([]cloudforce_one.CloudforceOneRequestMessageItem, error)
### Priority
Response Types:
-- cloudflare.CloudforceOneRequestPriorityNewResponse
-- cloudflare.CloudforceOneRequestPriorityUpdateResponse
-- cloudflare.CloudforceOneRequestPriorityDeleteResponse
-- cloudflare.CloudforceOneRequestPriorityGetResponse
-- cloudflare.CloudforceOneRequestPriorityQuotaResponse
+- cloudforce_one.CloudforceOnePriorityItem
+- cloudforce_one.RequestPriorityDeleteResponse
Methods:
-- client.CloudforceOne.Requests.Priority.New(ctx context.Context, accountIdentifier string, body cloudflare.CloudforceOneRequestPriorityNewParams) (cloudflare.CloudforceOneRequestPriorityNewResponse, error)
-- client.CloudforceOne.Requests.Priority.Update(ctx context.Context, accountIdentifier string, priorityIdentifer string, body cloudflare.CloudforceOneRequestPriorityUpdateParams) (cloudflare.CloudforceOneRequestPriorityUpdateResponse, error)
-- client.CloudforceOne.Requests.Priority.Delete(ctx context.Context, accountIdentifier string, priorityIdentifer string) (cloudflare.CloudforceOneRequestPriorityDeleteResponse, error)
-- client.CloudforceOne.Requests.Priority.Get(ctx context.Context, accountIdentifier string, priorityIdentifer string) (cloudflare.CloudforceOneRequestPriorityGetResponse, error)
-- client.CloudforceOne.Requests.Priority.Quota(ctx context.Context, accountIdentifier string) (cloudflare.CloudforceOneRequestPriorityQuotaResponse, error)
+- client.CloudforceOne.Requests.Priority.New(ctx context.Context, accountIdentifier string, body cloudforce_one.RequestPriorityNewParams) (cloudforce_one.CloudforceOnePriorityItem, error)
+- client.CloudforceOne.Requests.Priority.Update(ctx context.Context, accountIdentifier string, priorityIdentifer string, body cloudforce_one.RequestPriorityUpdateParams) (cloudforce_one.CloudforceOneRequestItem, error)
+- client.CloudforceOne.Requests.Priority.Delete(ctx context.Context, accountIdentifier string, priorityIdentifer string) (cloudforce_one.RequestPriorityDeleteResponse, error)
+- client.CloudforceOne.Requests.Priority.Get(ctx context.Context, accountIdentifier string, priorityIdentifer string) (cloudforce_one.CloudforceOneRequestItem, error)
+- client.CloudforceOne.Requests.Priority.Quota(ctx context.Context, accountIdentifier string) (cloudforce_one.CloudforceOneQuota, error)
diff --git a/argo/aliases.go b/argo/aliases.go
new file mode 100644
index 00000000000..0e8ee10cac6
--- /dev/null
+++ b/argo/aliases.go
@@ -0,0 +1,9 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package argo
+
+import (
+ "github.com/cloudflare/cloudflare-go/internal/apierror"
+)
+
+type Error = apierror.Error
diff --git a/argo.go b/argo/argo.go
similarity index 79%
rename from argo.go
rename to argo/argo.go
index 1ce03ddfb72..bdf13df6418 100644
--- a/argo.go
+++ b/argo/argo.go
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package cloudflare
+package argo
import (
"github.com/cloudflare/cloudflare-go/option"
@@ -12,8 +12,8 @@ import (
// directly, and instead use the [NewArgoService] method instead.
type ArgoService struct {
Options []option.RequestOption
- SmartRouting *ArgoSmartRoutingService
- TieredCaching *ArgoTieredCachingService
+ SmartRouting *SmartRoutingService
+ TieredCaching *TieredCachingService
}
// NewArgoService generates a new service that applies the given options to each
@@ -22,7 +22,7 @@ type ArgoService struct {
func NewArgoService(opts ...option.RequestOption) (r *ArgoService) {
r = &ArgoService{}
r.Options = opts
- r.SmartRouting = NewArgoSmartRoutingService(opts...)
- r.TieredCaching = NewArgoTieredCachingService(opts...)
+ r.SmartRouting = NewSmartRoutingService(opts...)
+ r.TieredCaching = NewTieredCachingService(opts...)
return
}
diff --git a/argo/smartrouting.go b/argo/smartrouting.go
new file mode 100644
index 00000000000..cd29d62b171
--- /dev/null
+++ b/argo/smartrouting.go
@@ -0,0 +1,281 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package argo
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "reflect"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/tidwall/gjson"
+)
+
+// SmartRoutingService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewSmartRoutingService] method
+// instead.
+type SmartRoutingService struct {
+ Options []option.RequestOption
+}
+
+// NewSmartRoutingService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewSmartRoutingService(opts ...option.RequestOption) (r *SmartRoutingService) {
+ r = &SmartRoutingService{}
+ r.Options = opts
+ return
+}
+
+// Updates enablement of Argo Smart Routing.
+func (r *SmartRoutingService) Edit(ctx context.Context, params SmartRoutingEditParams, opts ...option.RequestOption) (res *SmartRoutingEditResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env SmartRoutingEditResponseEnvelope
+ path := fmt.Sprintf("zones/%s/argo/smart_routing", params.ZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Get Argo Smart Routing setting
+func (r *SmartRoutingService) Get(ctx context.Context, query SmartRoutingGetParams, opts ...option.RequestOption) (res *SmartRoutingGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env SmartRoutingGetResponseEnvelope
+ path := fmt.Sprintf("zones/%s/argo/smart_routing", query.ZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Union satisfied by [argo.SmartRoutingEditResponseUnknown] or
+// [shared.UnionString].
+type SmartRoutingEditResponse interface {
+ ImplementsArgoSmartRoutingEditResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*SmartRoutingEditResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+// Union satisfied by [argo.SmartRoutingGetResponseUnknown] or
+// [shared.UnionString].
+type SmartRoutingGetResponse interface {
+ ImplementsArgoSmartRoutingGetResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*SmartRoutingGetResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+type SmartRoutingEditParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+ // Enables Argo Smart Routing.
+ Value param.Field[SmartRoutingEditParamsValue] `json:"value,required"`
+}
+
+func (r SmartRoutingEditParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Enables Argo Smart Routing.
+type SmartRoutingEditParamsValue string
+
+const (
+ SmartRoutingEditParamsValueOn SmartRoutingEditParamsValue = "on"
+ SmartRoutingEditParamsValueOff SmartRoutingEditParamsValue = "off"
+)
+
+type SmartRoutingEditResponseEnvelope struct {
+ Errors []SmartRoutingEditResponseEnvelopeErrors `json:"errors,required"`
+ Messages []SmartRoutingEditResponseEnvelopeMessages `json:"messages,required"`
+ Result SmartRoutingEditResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success SmartRoutingEditResponseEnvelopeSuccess `json:"success,required"`
+ JSON smartRoutingEditResponseEnvelopeJSON `json:"-"`
+}
+
+// smartRoutingEditResponseEnvelopeJSON contains the JSON metadata for the struct
+// [SmartRoutingEditResponseEnvelope]
+type smartRoutingEditResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *SmartRoutingEditResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r smartRoutingEditResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type SmartRoutingEditResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON smartRoutingEditResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// smartRoutingEditResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [SmartRoutingEditResponseEnvelopeErrors]
+type smartRoutingEditResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *SmartRoutingEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r smartRoutingEditResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type SmartRoutingEditResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON smartRoutingEditResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// smartRoutingEditResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [SmartRoutingEditResponseEnvelopeMessages]
+type smartRoutingEditResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *SmartRoutingEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r smartRoutingEditResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type SmartRoutingEditResponseEnvelopeSuccess bool
+
+const (
+ SmartRoutingEditResponseEnvelopeSuccessTrue SmartRoutingEditResponseEnvelopeSuccess = true
+)
+
+type SmartRoutingGetParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+}
+
+type SmartRoutingGetResponseEnvelope struct {
+ Errors []SmartRoutingGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []SmartRoutingGetResponseEnvelopeMessages `json:"messages,required"`
+ Result SmartRoutingGetResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success SmartRoutingGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON smartRoutingGetResponseEnvelopeJSON `json:"-"`
+}
+
+// smartRoutingGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [SmartRoutingGetResponseEnvelope]
+type smartRoutingGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *SmartRoutingGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r smartRoutingGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type SmartRoutingGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON smartRoutingGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// smartRoutingGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [SmartRoutingGetResponseEnvelopeErrors]
+type smartRoutingGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *SmartRoutingGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r smartRoutingGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type SmartRoutingGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON smartRoutingGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// smartRoutingGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [SmartRoutingGetResponseEnvelopeMessages]
+type smartRoutingGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *SmartRoutingGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r smartRoutingGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type SmartRoutingGetResponseEnvelopeSuccess bool
+
+const (
+ SmartRoutingGetResponseEnvelopeSuccessTrue SmartRoutingGetResponseEnvelopeSuccess = true
+)
diff --git a/argo/smartrouting_test.go b/argo/smartrouting_test.go
new file mode 100644
index 00000000000..82a3c4d6acf
--- /dev/null
+++ b/argo/smartrouting_test.go
@@ -0,0 +1,68 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package argo_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/argo"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestSmartRoutingEdit(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"),
+ )
+ _, err := client.Argo.SmartRouting.Edit(context.TODO(), argo.SmartRoutingEditParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Value: cloudflare.F(argo.SmartRoutingEditParamsValueOn),
+ })
+ 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())
+ }
+}
+
+func TestSmartRoutingGet(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"),
+ )
+ _, err := client.Argo.SmartRouting.Get(context.TODO(), argo.SmartRoutingGetParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ })
+ 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/argo/tieredcaching.go b/argo/tieredcaching.go
new file mode 100644
index 00000000000..85502c90779
--- /dev/null
+++ b/argo/tieredcaching.go
@@ -0,0 +1,281 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package argo
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "reflect"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/tidwall/gjson"
+)
+
+// TieredCachingService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewTieredCachingService] method
+// instead.
+type TieredCachingService struct {
+ Options []option.RequestOption
+}
+
+// NewTieredCachingService generates a new service that applies the given options
+// to each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewTieredCachingService(opts ...option.RequestOption) (r *TieredCachingService) {
+ r = &TieredCachingService{}
+ r.Options = opts
+ return
+}
+
+// Updates enablement of Tiered Caching
+func (r *TieredCachingService) Edit(ctx context.Context, params TieredCachingEditParams, opts ...option.RequestOption) (res *TieredCachingEditResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env TieredCachingEditResponseEnvelope
+ path := fmt.Sprintf("zones/%s/argo/tiered_caching", params.ZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Get Tiered Caching setting
+func (r *TieredCachingService) Get(ctx context.Context, query TieredCachingGetParams, opts ...option.RequestOption) (res *TieredCachingGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env TieredCachingGetResponseEnvelope
+ path := fmt.Sprintf("zones/%s/argo/tiered_caching", query.ZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Union satisfied by [argo.TieredCachingEditResponseUnknown] or
+// [shared.UnionString].
+type TieredCachingEditResponse interface {
+ ImplementsArgoTieredCachingEditResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*TieredCachingEditResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+// Union satisfied by [argo.TieredCachingGetResponseUnknown] or
+// [shared.UnionString].
+type TieredCachingGetResponse interface {
+ ImplementsArgoTieredCachingGetResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*TieredCachingGetResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+type TieredCachingEditParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+ // Enables Tiered Caching.
+ Value param.Field[TieredCachingEditParamsValue] `json:"value,required"`
+}
+
+func (r TieredCachingEditParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Enables Tiered Caching.
+type TieredCachingEditParamsValue string
+
+const (
+ TieredCachingEditParamsValueOn TieredCachingEditParamsValue = "on"
+ TieredCachingEditParamsValueOff TieredCachingEditParamsValue = "off"
+)
+
+type TieredCachingEditResponseEnvelope struct {
+ Errors []TieredCachingEditResponseEnvelopeErrors `json:"errors,required"`
+ Messages []TieredCachingEditResponseEnvelopeMessages `json:"messages,required"`
+ Result TieredCachingEditResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success TieredCachingEditResponseEnvelopeSuccess `json:"success,required"`
+ JSON tieredCachingEditResponseEnvelopeJSON `json:"-"`
+}
+
+// tieredCachingEditResponseEnvelopeJSON contains the JSON metadata for the struct
+// [TieredCachingEditResponseEnvelope]
+type tieredCachingEditResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *TieredCachingEditResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r tieredCachingEditResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type TieredCachingEditResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON tieredCachingEditResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// tieredCachingEditResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [TieredCachingEditResponseEnvelopeErrors]
+type tieredCachingEditResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *TieredCachingEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r tieredCachingEditResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type TieredCachingEditResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON tieredCachingEditResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// tieredCachingEditResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [TieredCachingEditResponseEnvelopeMessages]
+type tieredCachingEditResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *TieredCachingEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r tieredCachingEditResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type TieredCachingEditResponseEnvelopeSuccess bool
+
+const (
+ TieredCachingEditResponseEnvelopeSuccessTrue TieredCachingEditResponseEnvelopeSuccess = true
+)
+
+type TieredCachingGetParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+}
+
+type TieredCachingGetResponseEnvelope struct {
+ Errors []TieredCachingGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []TieredCachingGetResponseEnvelopeMessages `json:"messages,required"`
+ Result TieredCachingGetResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success TieredCachingGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON tieredCachingGetResponseEnvelopeJSON `json:"-"`
+}
+
+// tieredCachingGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [TieredCachingGetResponseEnvelope]
+type tieredCachingGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *TieredCachingGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r tieredCachingGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type TieredCachingGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON tieredCachingGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// tieredCachingGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [TieredCachingGetResponseEnvelopeErrors]
+type tieredCachingGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *TieredCachingGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r tieredCachingGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type TieredCachingGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON tieredCachingGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// tieredCachingGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [TieredCachingGetResponseEnvelopeMessages]
+type tieredCachingGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *TieredCachingGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r tieredCachingGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type TieredCachingGetResponseEnvelopeSuccess bool
+
+const (
+ TieredCachingGetResponseEnvelopeSuccessTrue TieredCachingGetResponseEnvelopeSuccess = true
+)
diff --git a/argo/tieredcaching_test.go b/argo/tieredcaching_test.go
new file mode 100644
index 00000000000..89cae75e0d2
--- /dev/null
+++ b/argo/tieredcaching_test.go
@@ -0,0 +1,68 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package argo_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/argo"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestTieredCachingEdit(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"),
+ )
+ _, err := client.Argo.TieredCaching.Edit(context.TODO(), argo.TieredCachingEditParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Value: cloudflare.F(argo.TieredCachingEditParamsValueOn),
+ })
+ 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())
+ }
+}
+
+func TestTieredCachingGet(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"),
+ )
+ _, err := client.Argo.TieredCaching.Get(context.TODO(), argo.TieredCachingGetParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ })
+ 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/argosmartrouting.go b/argosmartrouting.go
deleted file mode 100644
index a32fcbcef79..00000000000
--- a/argosmartrouting.go
+++ /dev/null
@@ -1,280 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "reflect"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/option"
- "github.com/tidwall/gjson"
-)
-
-// ArgoSmartRoutingService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewArgoSmartRoutingService] method
-// instead.
-type ArgoSmartRoutingService struct {
- Options []option.RequestOption
-}
-
-// NewArgoSmartRoutingService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewArgoSmartRoutingService(opts ...option.RequestOption) (r *ArgoSmartRoutingService) {
- r = &ArgoSmartRoutingService{}
- r.Options = opts
- return
-}
-
-// Updates enablement of Argo Smart Routing.
-func (r *ArgoSmartRoutingService) Edit(ctx context.Context, params ArgoSmartRoutingEditParams, opts ...option.RequestOption) (res *ArgoSmartRoutingEditResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env ArgoSmartRoutingEditResponseEnvelope
- path := fmt.Sprintf("zones/%s/argo/smart_routing", params.ZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Get Argo Smart Routing setting
-func (r *ArgoSmartRoutingService) Get(ctx context.Context, query ArgoSmartRoutingGetParams, opts ...option.RequestOption) (res *ArgoSmartRoutingGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env ArgoSmartRoutingGetResponseEnvelope
- path := fmt.Sprintf("zones/%s/argo/smart_routing", query.ZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Union satisfied by [ArgoSmartRoutingEditResponseUnknown] or
-// [shared.UnionString].
-type ArgoSmartRoutingEditResponse interface {
- ImplementsArgoSmartRoutingEditResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*ArgoSmartRoutingEditResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-// Union satisfied by [ArgoSmartRoutingGetResponseUnknown] or [shared.UnionString].
-type ArgoSmartRoutingGetResponse interface {
- ImplementsArgoSmartRoutingGetResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*ArgoSmartRoutingGetResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-type ArgoSmartRoutingEditParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
- // Enables Argo Smart Routing.
- Value param.Field[ArgoSmartRoutingEditParamsValue] `json:"value,required"`
-}
-
-func (r ArgoSmartRoutingEditParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Enables Argo Smart Routing.
-type ArgoSmartRoutingEditParamsValue string
-
-const (
- ArgoSmartRoutingEditParamsValueOn ArgoSmartRoutingEditParamsValue = "on"
- ArgoSmartRoutingEditParamsValueOff ArgoSmartRoutingEditParamsValue = "off"
-)
-
-type ArgoSmartRoutingEditResponseEnvelope struct {
- Errors []ArgoSmartRoutingEditResponseEnvelopeErrors `json:"errors,required"`
- Messages []ArgoSmartRoutingEditResponseEnvelopeMessages `json:"messages,required"`
- Result ArgoSmartRoutingEditResponse `json:"result,required"`
- // Whether the API call was successful
- Success ArgoSmartRoutingEditResponseEnvelopeSuccess `json:"success,required"`
- JSON argoSmartRoutingEditResponseEnvelopeJSON `json:"-"`
-}
-
-// argoSmartRoutingEditResponseEnvelopeJSON contains the JSON metadata for the
-// struct [ArgoSmartRoutingEditResponseEnvelope]
-type argoSmartRoutingEditResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ArgoSmartRoutingEditResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r argoSmartRoutingEditResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type ArgoSmartRoutingEditResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON argoSmartRoutingEditResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// argoSmartRoutingEditResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [ArgoSmartRoutingEditResponseEnvelopeErrors]
-type argoSmartRoutingEditResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ArgoSmartRoutingEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r argoSmartRoutingEditResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type ArgoSmartRoutingEditResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON argoSmartRoutingEditResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// argoSmartRoutingEditResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [ArgoSmartRoutingEditResponseEnvelopeMessages]
-type argoSmartRoutingEditResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ArgoSmartRoutingEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r argoSmartRoutingEditResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type ArgoSmartRoutingEditResponseEnvelopeSuccess bool
-
-const (
- ArgoSmartRoutingEditResponseEnvelopeSuccessTrue ArgoSmartRoutingEditResponseEnvelopeSuccess = true
-)
-
-type ArgoSmartRoutingGetParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
-}
-
-type ArgoSmartRoutingGetResponseEnvelope struct {
- Errors []ArgoSmartRoutingGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []ArgoSmartRoutingGetResponseEnvelopeMessages `json:"messages,required"`
- Result ArgoSmartRoutingGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success ArgoSmartRoutingGetResponseEnvelopeSuccess `json:"success,required"`
- JSON argoSmartRoutingGetResponseEnvelopeJSON `json:"-"`
-}
-
-// argoSmartRoutingGetResponseEnvelopeJSON contains the JSON metadata for the
-// struct [ArgoSmartRoutingGetResponseEnvelope]
-type argoSmartRoutingGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ArgoSmartRoutingGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r argoSmartRoutingGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type ArgoSmartRoutingGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON argoSmartRoutingGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// argoSmartRoutingGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [ArgoSmartRoutingGetResponseEnvelopeErrors]
-type argoSmartRoutingGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ArgoSmartRoutingGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r argoSmartRoutingGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type ArgoSmartRoutingGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON argoSmartRoutingGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// argoSmartRoutingGetResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [ArgoSmartRoutingGetResponseEnvelopeMessages]
-type argoSmartRoutingGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ArgoSmartRoutingGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r argoSmartRoutingGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type ArgoSmartRoutingGetResponseEnvelopeSuccess bool
-
-const (
- ArgoSmartRoutingGetResponseEnvelopeSuccessTrue ArgoSmartRoutingGetResponseEnvelopeSuccess = true
-)
diff --git a/argosmartrouting_test.go b/argosmartrouting_test.go
deleted file mode 100644
index 383bf7b2bf3..00000000000
--- a/argosmartrouting_test.go
+++ /dev/null
@@ -1,67 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestArgoSmartRoutingEdit(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"),
- )
- _, err := client.Argo.SmartRouting.Edit(context.TODO(), cloudflare.ArgoSmartRoutingEditParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Value: cloudflare.F(cloudflare.ArgoSmartRoutingEditParamsValueOn),
- })
- 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())
- }
-}
-
-func TestArgoSmartRoutingGet(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"),
- )
- _, err := client.Argo.SmartRouting.Get(context.TODO(), cloudflare.ArgoSmartRoutingGetParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- })
- 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/argotieredcaching.go b/argotieredcaching.go
deleted file mode 100644
index a714e165c9c..00000000000
--- a/argotieredcaching.go
+++ /dev/null
@@ -1,281 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "reflect"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/option"
- "github.com/tidwall/gjson"
-)
-
-// ArgoTieredCachingService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewArgoTieredCachingService] method
-// instead.
-type ArgoTieredCachingService struct {
- Options []option.RequestOption
-}
-
-// NewArgoTieredCachingService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewArgoTieredCachingService(opts ...option.RequestOption) (r *ArgoTieredCachingService) {
- r = &ArgoTieredCachingService{}
- r.Options = opts
- return
-}
-
-// Updates enablement of Tiered Caching
-func (r *ArgoTieredCachingService) Edit(ctx context.Context, params ArgoTieredCachingEditParams, opts ...option.RequestOption) (res *ArgoTieredCachingEditResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env ArgoTieredCachingEditResponseEnvelope
- path := fmt.Sprintf("zones/%s/argo/tiered_caching", params.ZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Get Tiered Caching setting
-func (r *ArgoTieredCachingService) Get(ctx context.Context, query ArgoTieredCachingGetParams, opts ...option.RequestOption) (res *ArgoTieredCachingGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env ArgoTieredCachingGetResponseEnvelope
- path := fmt.Sprintf("zones/%s/argo/tiered_caching", query.ZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Union satisfied by [ArgoTieredCachingEditResponseUnknown] or
-// [shared.UnionString].
-type ArgoTieredCachingEditResponse interface {
- ImplementsArgoTieredCachingEditResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*ArgoTieredCachingEditResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-// Union satisfied by [ArgoTieredCachingGetResponseUnknown] or
-// [shared.UnionString].
-type ArgoTieredCachingGetResponse interface {
- ImplementsArgoTieredCachingGetResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*ArgoTieredCachingGetResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-type ArgoTieredCachingEditParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
- // Enables Tiered Caching.
- Value param.Field[ArgoTieredCachingEditParamsValue] `json:"value,required"`
-}
-
-func (r ArgoTieredCachingEditParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Enables Tiered Caching.
-type ArgoTieredCachingEditParamsValue string
-
-const (
- ArgoTieredCachingEditParamsValueOn ArgoTieredCachingEditParamsValue = "on"
- ArgoTieredCachingEditParamsValueOff ArgoTieredCachingEditParamsValue = "off"
-)
-
-type ArgoTieredCachingEditResponseEnvelope struct {
- Errors []ArgoTieredCachingEditResponseEnvelopeErrors `json:"errors,required"`
- Messages []ArgoTieredCachingEditResponseEnvelopeMessages `json:"messages,required"`
- Result ArgoTieredCachingEditResponse `json:"result,required"`
- // Whether the API call was successful
- Success ArgoTieredCachingEditResponseEnvelopeSuccess `json:"success,required"`
- JSON argoTieredCachingEditResponseEnvelopeJSON `json:"-"`
-}
-
-// argoTieredCachingEditResponseEnvelopeJSON contains the JSON metadata for the
-// struct [ArgoTieredCachingEditResponseEnvelope]
-type argoTieredCachingEditResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ArgoTieredCachingEditResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r argoTieredCachingEditResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type ArgoTieredCachingEditResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON argoTieredCachingEditResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// argoTieredCachingEditResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [ArgoTieredCachingEditResponseEnvelopeErrors]
-type argoTieredCachingEditResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ArgoTieredCachingEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r argoTieredCachingEditResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type ArgoTieredCachingEditResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON argoTieredCachingEditResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// argoTieredCachingEditResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [ArgoTieredCachingEditResponseEnvelopeMessages]
-type argoTieredCachingEditResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ArgoTieredCachingEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r argoTieredCachingEditResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type ArgoTieredCachingEditResponseEnvelopeSuccess bool
-
-const (
- ArgoTieredCachingEditResponseEnvelopeSuccessTrue ArgoTieredCachingEditResponseEnvelopeSuccess = true
-)
-
-type ArgoTieredCachingGetParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
-}
-
-type ArgoTieredCachingGetResponseEnvelope struct {
- Errors []ArgoTieredCachingGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []ArgoTieredCachingGetResponseEnvelopeMessages `json:"messages,required"`
- Result ArgoTieredCachingGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success ArgoTieredCachingGetResponseEnvelopeSuccess `json:"success,required"`
- JSON argoTieredCachingGetResponseEnvelopeJSON `json:"-"`
-}
-
-// argoTieredCachingGetResponseEnvelopeJSON contains the JSON metadata for the
-// struct [ArgoTieredCachingGetResponseEnvelope]
-type argoTieredCachingGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ArgoTieredCachingGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r argoTieredCachingGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type ArgoTieredCachingGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON argoTieredCachingGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// argoTieredCachingGetResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [ArgoTieredCachingGetResponseEnvelopeErrors]
-type argoTieredCachingGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ArgoTieredCachingGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r argoTieredCachingGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type ArgoTieredCachingGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON argoTieredCachingGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// argoTieredCachingGetResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [ArgoTieredCachingGetResponseEnvelopeMessages]
-type argoTieredCachingGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ArgoTieredCachingGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r argoTieredCachingGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type ArgoTieredCachingGetResponseEnvelopeSuccess bool
-
-const (
- ArgoTieredCachingGetResponseEnvelopeSuccessTrue ArgoTieredCachingGetResponseEnvelopeSuccess = true
-)
diff --git a/argotieredcaching_test.go b/argotieredcaching_test.go
deleted file mode 100644
index 70d53ab9d08..00000000000
--- a/argotieredcaching_test.go
+++ /dev/null
@@ -1,67 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestArgoTieredCachingEdit(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"),
- )
- _, err := client.Argo.TieredCaching.Edit(context.TODO(), cloudflare.ArgoTieredCachingEditParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Value: cloudflare.F(cloudflare.ArgoTieredCachingEditParamsValueOn),
- })
- 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())
- }
-}
-
-func TestArgoTieredCachingGet(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"),
- )
- _, err := client.Argo.TieredCaching.Get(context.TODO(), cloudflare.ArgoTieredCachingGetParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- })
- 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/audit_logs/aliases.go b/audit_logs/aliases.go
new file mode 100644
index 00000000000..11570892dad
--- /dev/null
+++ b/audit_logs/aliases.go
@@ -0,0 +1,9 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package audit_logs
+
+import (
+ "github.com/cloudflare/cloudflare-go/internal/apierror"
+)
+
+type Error = apierror.Error
diff --git a/audit_logs/auditlog.go b/audit_logs/auditlog.go
new file mode 100644
index 00000000000..66f6608db86
--- /dev/null
+++ b/audit_logs/auditlog.go
@@ -0,0 +1,303 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package audit_logs
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// AuditLogService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewAuditLogService] method instead.
+type AuditLogService struct {
+ Options []option.RequestOption
+}
+
+// NewAuditLogService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewAuditLogService(opts ...option.RequestOption) (r *AuditLogService) {
+ r = &AuditLogService{}
+ r.Options = opts
+ return
+}
+
+// Gets a list of audit logs for an account. Can be filtered by who made the
+// change, on which zone, and the timeframe of the change.
+func (r *AuditLogService) List(ctx context.Context, accountIdentifier string, query AuditLogListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[AuditLogListResponse], err error) {
+ var raw *http.Response
+ opts = append(r.Options, opts...)
+ opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
+ path := fmt.Sprintf("accounts/%s/audit_logs", accountIdentifier)
+ cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...)
+ if err != nil {
+ return nil, err
+ }
+ err = cfg.Execute()
+ if err != nil {
+ return nil, err
+ }
+ res.SetPageConfig(cfg, raw)
+ return res, nil
+}
+
+// Gets a list of audit logs for an account. Can be filtered by who made the
+// change, on which zone, and the timeframe of the change.
+func (r *AuditLogService) ListAutoPaging(ctx context.Context, accountIdentifier string, query AuditLogListParams, opts ...option.RequestOption) *shared.V4PagePaginationArrayAutoPager[AuditLogListResponse] {
+ return shared.NewV4PagePaginationArrayAutoPager(r.List(ctx, accountIdentifier, query, opts...))
+}
+
+type AuditLogListResponse struct {
+ // A string that uniquely identifies the audit log.
+ ID string `json:"id"`
+ Action AuditLogListResponseAction `json:"action"`
+ Actor AuditLogListResponseActor `json:"actor"`
+ // The source of the event.
+ Interface string `json:"interface"`
+ // An object which can lend more context to the action being logged. This is a
+ // flexible value and varies between different actions.
+ Metadata interface{} `json:"metadata"`
+ // The new value of the resource that was modified.
+ NewValue string `json:"newValue"`
+ // The value of the resource before it was modified.
+ OldValue string `json:"oldValue"`
+ Owner AuditLogListResponseOwner `json:"owner"`
+ Resource AuditLogListResponseResource `json:"resource"`
+ // A UTC RFC3339 timestamp that specifies when the action being logged occured.
+ When time.Time `json:"when" format:"date-time"`
+ JSON auditLogListResponseJSON `json:"-"`
+}
+
+// auditLogListResponseJSON contains the JSON metadata for the struct
+// [AuditLogListResponse]
+type auditLogListResponseJSON struct {
+ ID apijson.Field
+ Action apijson.Field
+ Actor apijson.Field
+ Interface apijson.Field
+ Metadata apijson.Field
+ NewValue apijson.Field
+ OldValue apijson.Field
+ Owner apijson.Field
+ Resource apijson.Field
+ When apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AuditLogListResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r auditLogListResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type AuditLogListResponseAction struct {
+ // A boolean that indicates if the action attempted was successful.
+ Result bool `json:"result"`
+ // A short string that describes the action that was performed.
+ Type string `json:"type"`
+ JSON auditLogListResponseActionJSON `json:"-"`
+}
+
+// auditLogListResponseActionJSON contains the JSON metadata for the struct
+// [AuditLogListResponseAction]
+type auditLogListResponseActionJSON struct {
+ Result apijson.Field
+ Type apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AuditLogListResponseAction) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r auditLogListResponseActionJSON) RawJSON() string {
+ return r.raw
+}
+
+type AuditLogListResponseActor struct {
+ // The ID of the actor that performed the action. If a user performed the action,
+ // this will be their User ID.
+ ID string `json:"id"`
+ // The email of the user that performed the action.
+ Email string `json:"email" format:"email"`
+ // The IP address of the request that performed the action.
+ IP string `json:"ip"`
+ // The type of actor, whether a User, Cloudflare Admin, or an Automated System.
+ Type AuditLogListResponseActorType `json:"type"`
+ JSON auditLogListResponseActorJSON `json:"-"`
+}
+
+// auditLogListResponseActorJSON contains the JSON metadata for the struct
+// [AuditLogListResponseActor]
+type auditLogListResponseActorJSON struct {
+ ID apijson.Field
+ Email apijson.Field
+ IP apijson.Field
+ Type apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AuditLogListResponseActor) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r auditLogListResponseActorJSON) RawJSON() string {
+ return r.raw
+}
+
+// The type of actor, whether a User, Cloudflare Admin, or an Automated System.
+type AuditLogListResponseActorType string
+
+const (
+ AuditLogListResponseActorTypeUser AuditLogListResponseActorType = "user"
+ AuditLogListResponseActorTypeAdmin AuditLogListResponseActorType = "admin"
+ AuditLogListResponseActorTypeCloudflare AuditLogListResponseActorType = "Cloudflare"
+)
+
+type AuditLogListResponseOwner struct {
+ // Identifier
+ ID string `json:"id"`
+ JSON auditLogListResponseOwnerJSON `json:"-"`
+}
+
+// auditLogListResponseOwnerJSON contains the JSON metadata for the struct
+// [AuditLogListResponseOwner]
+type auditLogListResponseOwnerJSON struct {
+ ID apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AuditLogListResponseOwner) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r auditLogListResponseOwnerJSON) RawJSON() string {
+ return r.raw
+}
+
+type AuditLogListResponseResource struct {
+ // An identifier for the resource that was affected by the action.
+ ID string `json:"id"`
+ // A short string that describes the resource that was affected by the action.
+ Type string `json:"type"`
+ JSON auditLogListResponseResourceJSON `json:"-"`
+}
+
+// auditLogListResponseResourceJSON contains the JSON metadata for the struct
+// [AuditLogListResponseResource]
+type auditLogListResponseResourceJSON struct {
+ ID apijson.Field
+ Type apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AuditLogListResponseResource) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r auditLogListResponseResourceJSON) RawJSON() string {
+ return r.raw
+}
+
+type AuditLogListParams struct {
+ // Finds a specific log by its ID.
+ ID param.Field[string] `query:"id"`
+ Action param.Field[AuditLogListParamsAction] `query:"action"`
+ Actor param.Field[AuditLogListParamsActor] `query:"actor"`
+ // Limits the returned results to logs older than the specified date. This can be a
+ // date string `2019-04-30` or an absolute timestamp that conforms to RFC3339.
+ Before param.Field[time.Time] `query:"before" format:"date-time"`
+ // Changes the direction of the chronological sorting.
+ Direction param.Field[AuditLogListParamsDirection] `query:"direction"`
+ // Indicates that this request is an export of logs in CSV format.
+ Export param.Field[bool] `query:"export"`
+ // Indicates whether or not to hide user level audit logs.
+ HideUserLogs param.Field[bool] `query:"hide_user_logs"`
+ // Defines which page of results to return.
+ Page param.Field[float64] `query:"page"`
+ // Sets the number of results to return per page.
+ PerPage param.Field[float64] `query:"per_page"`
+ // Limits the returned results to logs newer than the specified date. This can be a
+ // date string `2019-04-30` or an absolute timestamp that conforms to RFC3339.
+ Since param.Field[time.Time] `query:"since" format:"date-time"`
+ Zone param.Field[AuditLogListParamsZone] `query:"zone"`
+}
+
+// URLQuery serializes [AuditLogListParams]'s query parameters as `url.Values`.
+func (r AuditLogListParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type AuditLogListParamsAction struct {
+ // Filters by the action type.
+ Type param.Field[string] `query:"type"`
+}
+
+// URLQuery serializes [AuditLogListParamsAction]'s query parameters as
+// `url.Values`.
+func (r AuditLogListParamsAction) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type AuditLogListParamsActor struct {
+ // Filters by the email address of the actor that made the change.
+ Email param.Field[string] `query:"email" format:"email"`
+ // Filters by the IP address of the request that made the change by specific IP
+ // address or valid CIDR Range.
+ IP param.Field[string] `query:"ip"`
+}
+
+// URLQuery serializes [AuditLogListParamsActor]'s query parameters as
+// `url.Values`.
+func (r AuditLogListParamsActor) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Changes the direction of the chronological sorting.
+type AuditLogListParamsDirection string
+
+const (
+ AuditLogListParamsDirectionDesc AuditLogListParamsDirection = "desc"
+ AuditLogListParamsDirectionAsc AuditLogListParamsDirection = "asc"
+)
+
+type AuditLogListParamsZone struct {
+ // Filters by the name of the zone associated to the change.
+ Name param.Field[string] `query:"name"`
+}
+
+// URLQuery serializes [AuditLogListParamsZone]'s query parameters as `url.Values`.
+func (r AuditLogListParamsZone) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
diff --git a/audit_logs/auditlog_test.go b/audit_logs/auditlog_test.go
new file mode 100644
index 00000000000..eb6bc0e3ad5
--- /dev/null
+++ b/audit_logs/auditlog_test.go
@@ -0,0 +1,63 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package audit_logs_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/audit_logs"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestAuditLogListWithOptionalParams(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"),
+ )
+ _, err := client.AuditLogs.List(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ audit_logs.AuditLogListParams{
+ ID: cloudflare.F("f174be97-19b1-40d6-954d-70cd5fbd52db"),
+ Action: cloudflare.F(audit_logs.AuditLogListParamsAction{
+ Type: cloudflare.F("add"),
+ }),
+ Actor: cloudflare.F(audit_logs.AuditLogListParamsActor{
+ IP: cloudflare.F("17.168.228.63"),
+ Email: cloudflare.F("alice@example.com"),
+ }),
+ Before: cloudflare.F(time.Now()),
+ Direction: cloudflare.F(audit_logs.AuditLogListParamsDirectionDesc),
+ Export: cloudflare.F(true),
+ HideUserLogs: cloudflare.F(true),
+ Page: cloudflare.F(50.000000),
+ PerPage: cloudflare.F(25.000000),
+ Since: cloudflare.F(time.Now()),
+ Zone: cloudflare.F(audit_logs.AuditLogListParamsZone{
+ Name: cloudflare.F("example.com"),
+ }),
+ },
+ )
+ 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/auditlog.go b/auditlog.go
deleted file mode 100644
index 3cd930b7c2d..00000000000
--- a/auditlog.go
+++ /dev/null
@@ -1,303 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// AuditLogService contains methods and other services that help with interacting
-// with the cloudflare API. Note, unlike clients, this service does not read
-// variables from the environment automatically. You should not instantiate this
-// service directly, and instead use the [NewAuditLogService] method instead.
-type AuditLogService struct {
- Options []option.RequestOption
-}
-
-// NewAuditLogService generates a new service that applies the given options to
-// each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewAuditLogService(opts ...option.RequestOption) (r *AuditLogService) {
- r = &AuditLogService{}
- r.Options = opts
- return
-}
-
-// Gets a list of audit logs for an account. Can be filtered by who made the
-// change, on which zone, and the timeframe of the change.
-func (r *AuditLogService) List(ctx context.Context, accountIdentifier string, query AuditLogListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[AuditLogListResponse], err error) {
- var raw *http.Response
- opts = append(r.Options, opts...)
- opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
- path := fmt.Sprintf("accounts/%s/audit_logs", accountIdentifier)
- cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...)
- if err != nil {
- return nil, err
- }
- err = cfg.Execute()
- if err != nil {
- return nil, err
- }
- res.SetPageConfig(cfg, raw)
- return res, nil
-}
-
-// Gets a list of audit logs for an account. Can be filtered by who made the
-// change, on which zone, and the timeframe of the change.
-func (r *AuditLogService) ListAutoPaging(ctx context.Context, accountIdentifier string, query AuditLogListParams, opts ...option.RequestOption) *shared.V4PagePaginationArrayAutoPager[AuditLogListResponse] {
- return shared.NewV4PagePaginationArrayAutoPager(r.List(ctx, accountIdentifier, query, opts...))
-}
-
-type AuditLogListResponse struct {
- // A string that uniquely identifies the audit log.
- ID string `json:"id"`
- Action AuditLogListResponseAction `json:"action"`
- Actor AuditLogListResponseActor `json:"actor"`
- // The source of the event.
- Interface string `json:"interface"`
- // An object which can lend more context to the action being logged. This is a
- // flexible value and varies between different actions.
- Metadata interface{} `json:"metadata"`
- // The new value of the resource that was modified.
- NewValue string `json:"newValue"`
- // The value of the resource before it was modified.
- OldValue string `json:"oldValue"`
- Owner AuditLogListResponseOwner `json:"owner"`
- Resource AuditLogListResponseResource `json:"resource"`
- // A UTC RFC3339 timestamp that specifies when the action being logged occured.
- When time.Time `json:"when" format:"date-time"`
- JSON auditLogListResponseJSON `json:"-"`
-}
-
-// auditLogListResponseJSON contains the JSON metadata for the struct
-// [AuditLogListResponse]
-type auditLogListResponseJSON struct {
- ID apijson.Field
- Action apijson.Field
- Actor apijson.Field
- Interface apijson.Field
- Metadata apijson.Field
- NewValue apijson.Field
- OldValue apijson.Field
- Owner apijson.Field
- Resource apijson.Field
- When apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AuditLogListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r auditLogListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type AuditLogListResponseAction struct {
- // A boolean that indicates if the action attempted was successful.
- Result bool `json:"result"`
- // A short string that describes the action that was performed.
- Type string `json:"type"`
- JSON auditLogListResponseActionJSON `json:"-"`
-}
-
-// auditLogListResponseActionJSON contains the JSON metadata for the struct
-// [AuditLogListResponseAction]
-type auditLogListResponseActionJSON struct {
- Result apijson.Field
- Type apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AuditLogListResponseAction) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r auditLogListResponseActionJSON) RawJSON() string {
- return r.raw
-}
-
-type AuditLogListResponseActor struct {
- // The ID of the actor that performed the action. If a user performed the action,
- // this will be their User ID.
- ID string `json:"id"`
- // The email of the user that performed the action.
- Email string `json:"email" format:"email"`
- // The IP address of the request that performed the action.
- IP string `json:"ip"`
- // The type of actor, whether a User, Cloudflare Admin, or an Automated System.
- Type AuditLogListResponseActorType `json:"type"`
- JSON auditLogListResponseActorJSON `json:"-"`
-}
-
-// auditLogListResponseActorJSON contains the JSON metadata for the struct
-// [AuditLogListResponseActor]
-type auditLogListResponseActorJSON struct {
- ID apijson.Field
- Email apijson.Field
- IP apijson.Field
- Type apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AuditLogListResponseActor) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r auditLogListResponseActorJSON) RawJSON() string {
- return r.raw
-}
-
-// The type of actor, whether a User, Cloudflare Admin, or an Automated System.
-type AuditLogListResponseActorType string
-
-const (
- AuditLogListResponseActorTypeUser AuditLogListResponseActorType = "user"
- AuditLogListResponseActorTypeAdmin AuditLogListResponseActorType = "admin"
- AuditLogListResponseActorTypeCloudflare AuditLogListResponseActorType = "Cloudflare"
-)
-
-type AuditLogListResponseOwner struct {
- // Identifier
- ID string `json:"id"`
- JSON auditLogListResponseOwnerJSON `json:"-"`
-}
-
-// auditLogListResponseOwnerJSON contains the JSON metadata for the struct
-// [AuditLogListResponseOwner]
-type auditLogListResponseOwnerJSON struct {
- ID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AuditLogListResponseOwner) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r auditLogListResponseOwnerJSON) RawJSON() string {
- return r.raw
-}
-
-type AuditLogListResponseResource struct {
- // An identifier for the resource that was affected by the action.
- ID string `json:"id"`
- // A short string that describes the resource that was affected by the action.
- Type string `json:"type"`
- JSON auditLogListResponseResourceJSON `json:"-"`
-}
-
-// auditLogListResponseResourceJSON contains the JSON metadata for the struct
-// [AuditLogListResponseResource]
-type auditLogListResponseResourceJSON struct {
- ID apijson.Field
- Type apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AuditLogListResponseResource) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r auditLogListResponseResourceJSON) RawJSON() string {
- return r.raw
-}
-
-type AuditLogListParams struct {
- // Finds a specific log by its ID.
- ID param.Field[string] `query:"id"`
- Action param.Field[AuditLogListParamsAction] `query:"action"`
- Actor param.Field[AuditLogListParamsActor] `query:"actor"`
- // Limits the returned results to logs older than the specified date. This can be a
- // date string `2019-04-30` or an absolute timestamp that conforms to RFC3339.
- Before param.Field[time.Time] `query:"before" format:"date-time"`
- // Changes the direction of the chronological sorting.
- Direction param.Field[AuditLogListParamsDirection] `query:"direction"`
- // Indicates that this request is an export of logs in CSV format.
- Export param.Field[bool] `query:"export"`
- // Indicates whether or not to hide user level audit logs.
- HideUserLogs param.Field[bool] `query:"hide_user_logs"`
- // Defines which page of results to return.
- Page param.Field[float64] `query:"page"`
- // Sets the number of results to return per page.
- PerPage param.Field[float64] `query:"per_page"`
- // Limits the returned results to logs newer than the specified date. This can be a
- // date string `2019-04-30` or an absolute timestamp that conforms to RFC3339.
- Since param.Field[time.Time] `query:"since" format:"date-time"`
- Zone param.Field[AuditLogListParamsZone] `query:"zone"`
-}
-
-// URLQuery serializes [AuditLogListParams]'s query parameters as `url.Values`.
-func (r AuditLogListParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type AuditLogListParamsAction struct {
- // Filters by the action type.
- Type param.Field[string] `query:"type"`
-}
-
-// URLQuery serializes [AuditLogListParamsAction]'s query parameters as
-// `url.Values`.
-func (r AuditLogListParamsAction) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type AuditLogListParamsActor struct {
- // Filters by the email address of the actor that made the change.
- Email param.Field[string] `query:"email" format:"email"`
- // Filters by the IP address of the request that made the change by specific IP
- // address or valid CIDR Range.
- IP param.Field[string] `query:"ip"`
-}
-
-// URLQuery serializes [AuditLogListParamsActor]'s query parameters as
-// `url.Values`.
-func (r AuditLogListParamsActor) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Changes the direction of the chronological sorting.
-type AuditLogListParamsDirection string
-
-const (
- AuditLogListParamsDirectionDesc AuditLogListParamsDirection = "desc"
- AuditLogListParamsDirectionAsc AuditLogListParamsDirection = "asc"
-)
-
-type AuditLogListParamsZone struct {
- // Filters by the name of the zone associated to the change.
- Name param.Field[string] `query:"name"`
-}
-
-// URLQuery serializes [AuditLogListParamsZone]'s query parameters as `url.Values`.
-func (r AuditLogListParamsZone) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
diff --git a/auditlog_test.go b/auditlog_test.go
deleted file mode 100644
index 468d5062ab9..00000000000
--- a/auditlog_test.go
+++ /dev/null
@@ -1,62 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
- "time"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestAuditLogListWithOptionalParams(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"),
- )
- _, err := client.AuditLogs.List(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.AuditLogListParams{
- ID: cloudflare.F("f174be97-19b1-40d6-954d-70cd5fbd52db"),
- Action: cloudflare.F(cloudflare.AuditLogListParamsAction{
- Type: cloudflare.F("add"),
- }),
- Actor: cloudflare.F(cloudflare.AuditLogListParamsActor{
- IP: cloudflare.F("17.168.228.63"),
- Email: cloudflare.F("alice@example.com"),
- }),
- Before: cloudflare.F(time.Now()),
- Direction: cloudflare.F(cloudflare.AuditLogListParamsDirectionDesc),
- Export: cloudflare.F(true),
- HideUserLogs: cloudflare.F(true),
- Page: cloudflare.F(50.000000),
- PerPage: cloudflare.F(25.000000),
- Since: cloudflare.F(time.Now()),
- Zone: cloudflare.F(cloudflare.AuditLogListParamsZone{
- Name: cloudflare.F("example.com"),
- }),
- },
- )
- 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/available_plans/aliases.go b/available_plans/aliases.go
new file mode 100644
index 00000000000..ae82fa2aab7
--- /dev/null
+++ b/available_plans/aliases.go
@@ -0,0 +1,9 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package available_plans
+
+import (
+ "github.com/cloudflare/cloudflare-go/internal/apierror"
+)
+
+type Error = apierror.Error
diff --git a/available_plans/availableplan.go b/available_plans/availableplan.go
new file mode 100644
index 00000000000..aa2835319b9
--- /dev/null
+++ b/available_plans/availableplan.go
@@ -0,0 +1,311 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package available_plans
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// AvailablePlanService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewAvailablePlanService] method
+// instead.
+type AvailablePlanService struct {
+ Options []option.RequestOption
+}
+
+// NewAvailablePlanService generates a new service that applies the given options
+// to each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewAvailablePlanService(opts ...option.RequestOption) (r *AvailablePlanService) {
+ r = &AvailablePlanService{}
+ r.Options = opts
+ return
+}
+
+// Lists available plans the zone can subscribe to.
+func (r *AvailablePlanService) List(ctx context.Context, zoneIdentifier string, opts ...option.RequestOption) (res *[]BillSubsAPIAvailableRatePlan, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AvailablePlanListResponseEnvelope
+ path := fmt.Sprintf("zones/%s/available_plans", zoneIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Details of the available plan that the zone can subscribe to.
+func (r *AvailablePlanService) Get(ctx context.Context, zoneIdentifier string, planIdentifier string, opts ...option.RequestOption) (res *BillSubsAPIAvailableRatePlan, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AvailablePlanGetResponseEnvelope
+ path := fmt.Sprintf("zones/%s/available_plans/%s", zoneIdentifier, planIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type BillSubsAPIAvailableRatePlan struct {
+ // Identifier
+ ID string `json:"id"`
+ // Indicates whether you can subscribe to this plan.
+ CanSubscribe bool `json:"can_subscribe"`
+ // The monetary unit in which pricing information is displayed.
+ Currency string `json:"currency"`
+ // Indicates whether this plan is managed externally.
+ ExternallyManaged bool `json:"externally_managed"`
+ // The frequency at which you will be billed for this plan.
+ Frequency BillSubsAPIAvailableRatePlanFrequency `json:"frequency"`
+ // Indicates whether you are currently subscribed to this plan.
+ IsSubscribed bool `json:"is_subscribed"`
+ // Indicates whether this plan has a legacy discount applied.
+ LegacyDiscount bool `json:"legacy_discount"`
+ // The legacy identifier for this rate plan, if any.
+ LegacyID string `json:"legacy_id"`
+ // The plan name.
+ Name string `json:"name"`
+ // The amount you will be billed for this plan.
+ Price float64 `json:"price"`
+ JSON billSubsAPIAvailableRatePlanJSON `json:"-"`
+}
+
+// billSubsAPIAvailableRatePlanJSON contains the JSON metadata for the struct
+// [BillSubsAPIAvailableRatePlan]
+type billSubsAPIAvailableRatePlanJSON struct {
+ ID apijson.Field
+ CanSubscribe apijson.Field
+ Currency apijson.Field
+ ExternallyManaged apijson.Field
+ Frequency apijson.Field
+ IsSubscribed apijson.Field
+ LegacyDiscount apijson.Field
+ LegacyID apijson.Field
+ Name apijson.Field
+ Price apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *BillSubsAPIAvailableRatePlan) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r billSubsAPIAvailableRatePlanJSON) RawJSON() string {
+ return r.raw
+}
+
+// The frequency at which you will be billed for this plan.
+type BillSubsAPIAvailableRatePlanFrequency string
+
+const (
+ BillSubsAPIAvailableRatePlanFrequencyWeekly BillSubsAPIAvailableRatePlanFrequency = "weekly"
+ BillSubsAPIAvailableRatePlanFrequencyMonthly BillSubsAPIAvailableRatePlanFrequency = "monthly"
+ BillSubsAPIAvailableRatePlanFrequencyQuarterly BillSubsAPIAvailableRatePlanFrequency = "quarterly"
+ BillSubsAPIAvailableRatePlanFrequencyYearly BillSubsAPIAvailableRatePlanFrequency = "yearly"
+)
+
+type AvailablePlanListResponseEnvelope struct {
+ Errors []AvailablePlanListResponseEnvelopeErrors `json:"errors,required"`
+ Messages []AvailablePlanListResponseEnvelopeMessages `json:"messages,required"`
+ Result []BillSubsAPIAvailableRatePlan `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success AvailablePlanListResponseEnvelopeSuccess `json:"success,required"`
+ ResultInfo AvailablePlanListResponseEnvelopeResultInfo `json:"result_info"`
+ JSON availablePlanListResponseEnvelopeJSON `json:"-"`
+}
+
+// availablePlanListResponseEnvelopeJSON contains the JSON metadata for the struct
+// [AvailablePlanListResponseEnvelope]
+type availablePlanListResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ ResultInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AvailablePlanListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r availablePlanListResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AvailablePlanListResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON availablePlanListResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// availablePlanListResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [AvailablePlanListResponseEnvelopeErrors]
+type availablePlanListResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AvailablePlanListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r availablePlanListResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type AvailablePlanListResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON availablePlanListResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// availablePlanListResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [AvailablePlanListResponseEnvelopeMessages]
+type availablePlanListResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AvailablePlanListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r availablePlanListResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type AvailablePlanListResponseEnvelopeSuccess bool
+
+const (
+ AvailablePlanListResponseEnvelopeSuccessTrue AvailablePlanListResponseEnvelopeSuccess = true
+)
+
+type AvailablePlanListResponseEnvelopeResultInfo struct {
+ // Total number of results for the requested service
+ Count float64 `json:"count"`
+ // Current page within paginated list of results
+ Page float64 `json:"page"`
+ // Number of results per page of results
+ PerPage float64 `json:"per_page"`
+ // Total results available without any search parameters
+ TotalCount float64 `json:"total_count"`
+ JSON availablePlanListResponseEnvelopeResultInfoJSON `json:"-"`
+}
+
+// availablePlanListResponseEnvelopeResultInfoJSON contains the JSON metadata for
+// the struct [AvailablePlanListResponseEnvelopeResultInfo]
+type availablePlanListResponseEnvelopeResultInfoJSON struct {
+ Count apijson.Field
+ Page apijson.Field
+ PerPage apijson.Field
+ TotalCount apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AvailablePlanListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r availablePlanListResponseEnvelopeResultInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type AvailablePlanGetResponseEnvelope struct {
+ Errors []AvailablePlanGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []AvailablePlanGetResponseEnvelopeMessages `json:"messages,required"`
+ Result BillSubsAPIAvailableRatePlan `json:"result,required"`
+ // Whether the API call was successful
+ Success AvailablePlanGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON availablePlanGetResponseEnvelopeJSON `json:"-"`
+}
+
+// availablePlanGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [AvailablePlanGetResponseEnvelope]
+type availablePlanGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AvailablePlanGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r availablePlanGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AvailablePlanGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON availablePlanGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// availablePlanGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [AvailablePlanGetResponseEnvelopeErrors]
+type availablePlanGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AvailablePlanGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r availablePlanGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type AvailablePlanGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON availablePlanGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// availablePlanGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [AvailablePlanGetResponseEnvelopeMessages]
+type availablePlanGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AvailablePlanGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r availablePlanGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type AvailablePlanGetResponseEnvelopeSuccess bool
+
+const (
+ AvailablePlanGetResponseEnvelopeSuccessTrue AvailablePlanGetResponseEnvelopeSuccess = true
+)
diff --git a/availableplan_test.go b/available_plans/availableplan_test.go
similarity index 98%
rename from availableplan_test.go
rename to available_plans/availableplan_test.go
index efb604f6008..9d451147875 100644
--- a/availableplan_test.go
+++ b/available_plans/availableplan_test.go
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package cloudflare_test
+package available_plans_test
import (
"context"
diff --git a/available_rate_plans/aliases.go b/available_rate_plans/aliases.go
new file mode 100644
index 00000000000..810995c509d
--- /dev/null
+++ b/available_rate_plans/aliases.go
@@ -0,0 +1,9 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package available_rate_plans
+
+import (
+ "github.com/cloudflare/cloudflare-go/internal/apierror"
+)
+
+type Error = apierror.Error
diff --git a/availablerateplan.go b/available_rate_plans/availablerateplan.go
similarity index 99%
rename from availablerateplan.go
rename to available_rate_plans/availablerateplan.go
index be7e7472414..25747209b45 100644
--- a/availablerateplan.go
+++ b/available_rate_plans/availablerateplan.go
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package cloudflare
+package available_rate_plans
import (
"context"
diff --git a/availablerateplan_test.go b/available_rate_plans/availablerateplan_test.go
similarity index 96%
rename from availablerateplan_test.go
rename to available_rate_plans/availablerateplan_test.go
index 6ee9de04fd3..da8170275a4 100644
--- a/availablerateplan_test.go
+++ b/available_rate_plans/availablerateplan_test.go
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package cloudflare_test
+package available_rate_plans_test
import (
"context"
diff --git a/availableplan.go b/availableplan.go
deleted file mode 100644
index f9787785da9..00000000000
--- a/availableplan.go
+++ /dev/null
@@ -1,370 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// AvailablePlanService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewAvailablePlanService] method
-// instead.
-type AvailablePlanService struct {
- Options []option.RequestOption
-}
-
-// NewAvailablePlanService generates a new service that applies the given options
-// to each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewAvailablePlanService(opts ...option.RequestOption) (r *AvailablePlanService) {
- r = &AvailablePlanService{}
- r.Options = opts
- return
-}
-
-// Lists available plans the zone can subscribe to.
-func (r *AvailablePlanService) List(ctx context.Context, zoneIdentifier string, opts ...option.RequestOption) (res *[]AvailablePlanListResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env AvailablePlanListResponseEnvelope
- path := fmt.Sprintf("zones/%s/available_plans", zoneIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Details of the available plan that the zone can subscribe to.
-func (r *AvailablePlanService) Get(ctx context.Context, zoneIdentifier string, planIdentifier string, opts ...option.RequestOption) (res *AvailablePlanGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env AvailablePlanGetResponseEnvelope
- path := fmt.Sprintf("zones/%s/available_plans/%s", zoneIdentifier, planIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type AvailablePlanListResponse struct {
- // Identifier
- ID string `json:"id"`
- // Indicates whether you can subscribe to this plan.
- CanSubscribe bool `json:"can_subscribe"`
- // The monetary unit in which pricing information is displayed.
- Currency string `json:"currency"`
- // Indicates whether this plan is managed externally.
- ExternallyManaged bool `json:"externally_managed"`
- // The frequency at which you will be billed for this plan.
- Frequency AvailablePlanListResponseFrequency `json:"frequency"`
- // Indicates whether you are currently subscribed to this plan.
- IsSubscribed bool `json:"is_subscribed"`
- // Indicates whether this plan has a legacy discount applied.
- LegacyDiscount bool `json:"legacy_discount"`
- // The legacy identifier for this rate plan, if any.
- LegacyID string `json:"legacy_id"`
- // The plan name.
- Name string `json:"name"`
- // The amount you will be billed for this plan.
- Price float64 `json:"price"`
- JSON availablePlanListResponseJSON `json:"-"`
-}
-
-// availablePlanListResponseJSON contains the JSON metadata for the struct
-// [AvailablePlanListResponse]
-type availablePlanListResponseJSON struct {
- ID apijson.Field
- CanSubscribe apijson.Field
- Currency apijson.Field
- ExternallyManaged apijson.Field
- Frequency apijson.Field
- IsSubscribed apijson.Field
- LegacyDiscount apijson.Field
- LegacyID apijson.Field
- Name apijson.Field
- Price apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AvailablePlanListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r availablePlanListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// The frequency at which you will be billed for this plan.
-type AvailablePlanListResponseFrequency string
-
-const (
- AvailablePlanListResponseFrequencyWeekly AvailablePlanListResponseFrequency = "weekly"
- AvailablePlanListResponseFrequencyMonthly AvailablePlanListResponseFrequency = "monthly"
- AvailablePlanListResponseFrequencyQuarterly AvailablePlanListResponseFrequency = "quarterly"
- AvailablePlanListResponseFrequencyYearly AvailablePlanListResponseFrequency = "yearly"
-)
-
-type AvailablePlanGetResponse struct {
- // Identifier
- ID string `json:"id"`
- // Indicates whether you can subscribe to this plan.
- CanSubscribe bool `json:"can_subscribe"`
- // The monetary unit in which pricing information is displayed.
- Currency string `json:"currency"`
- // Indicates whether this plan is managed externally.
- ExternallyManaged bool `json:"externally_managed"`
- // The frequency at which you will be billed for this plan.
- Frequency AvailablePlanGetResponseFrequency `json:"frequency"`
- // Indicates whether you are currently subscribed to this plan.
- IsSubscribed bool `json:"is_subscribed"`
- // Indicates whether this plan has a legacy discount applied.
- LegacyDiscount bool `json:"legacy_discount"`
- // The legacy identifier for this rate plan, if any.
- LegacyID string `json:"legacy_id"`
- // The plan name.
- Name string `json:"name"`
- // The amount you will be billed for this plan.
- Price float64 `json:"price"`
- JSON availablePlanGetResponseJSON `json:"-"`
-}
-
-// availablePlanGetResponseJSON contains the JSON metadata for the struct
-// [AvailablePlanGetResponse]
-type availablePlanGetResponseJSON struct {
- ID apijson.Field
- CanSubscribe apijson.Field
- Currency apijson.Field
- ExternallyManaged apijson.Field
- Frequency apijson.Field
- IsSubscribed apijson.Field
- LegacyDiscount apijson.Field
- LegacyID apijson.Field
- Name apijson.Field
- Price apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AvailablePlanGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r availablePlanGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// The frequency at which you will be billed for this plan.
-type AvailablePlanGetResponseFrequency string
-
-const (
- AvailablePlanGetResponseFrequencyWeekly AvailablePlanGetResponseFrequency = "weekly"
- AvailablePlanGetResponseFrequencyMonthly AvailablePlanGetResponseFrequency = "monthly"
- AvailablePlanGetResponseFrequencyQuarterly AvailablePlanGetResponseFrequency = "quarterly"
- AvailablePlanGetResponseFrequencyYearly AvailablePlanGetResponseFrequency = "yearly"
-)
-
-type AvailablePlanListResponseEnvelope struct {
- Errors []AvailablePlanListResponseEnvelopeErrors `json:"errors,required"`
- Messages []AvailablePlanListResponseEnvelopeMessages `json:"messages,required"`
- Result []AvailablePlanListResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success AvailablePlanListResponseEnvelopeSuccess `json:"success,required"`
- ResultInfo AvailablePlanListResponseEnvelopeResultInfo `json:"result_info"`
- JSON availablePlanListResponseEnvelopeJSON `json:"-"`
-}
-
-// availablePlanListResponseEnvelopeJSON contains the JSON metadata for the struct
-// [AvailablePlanListResponseEnvelope]
-type availablePlanListResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- ResultInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AvailablePlanListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r availablePlanListResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type AvailablePlanListResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON availablePlanListResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// availablePlanListResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [AvailablePlanListResponseEnvelopeErrors]
-type availablePlanListResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AvailablePlanListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r availablePlanListResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type AvailablePlanListResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON availablePlanListResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// availablePlanListResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [AvailablePlanListResponseEnvelopeMessages]
-type availablePlanListResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AvailablePlanListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r availablePlanListResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type AvailablePlanListResponseEnvelopeSuccess bool
-
-const (
- AvailablePlanListResponseEnvelopeSuccessTrue AvailablePlanListResponseEnvelopeSuccess = true
-)
-
-type AvailablePlanListResponseEnvelopeResultInfo struct {
- // Total number of results for the requested service
- Count float64 `json:"count"`
- // Current page within paginated list of results
- Page float64 `json:"page"`
- // Number of results per page of results
- PerPage float64 `json:"per_page"`
- // Total results available without any search parameters
- TotalCount float64 `json:"total_count"`
- JSON availablePlanListResponseEnvelopeResultInfoJSON `json:"-"`
-}
-
-// availablePlanListResponseEnvelopeResultInfoJSON contains the JSON metadata for
-// the struct [AvailablePlanListResponseEnvelopeResultInfo]
-type availablePlanListResponseEnvelopeResultInfoJSON struct {
- Count apijson.Field
- Page apijson.Field
- PerPage apijson.Field
- TotalCount apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AvailablePlanListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r availablePlanListResponseEnvelopeResultInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type AvailablePlanGetResponseEnvelope struct {
- Errors []AvailablePlanGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []AvailablePlanGetResponseEnvelopeMessages `json:"messages,required"`
- Result AvailablePlanGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success AvailablePlanGetResponseEnvelopeSuccess `json:"success,required"`
- JSON availablePlanGetResponseEnvelopeJSON `json:"-"`
-}
-
-// availablePlanGetResponseEnvelopeJSON contains the JSON metadata for the struct
-// [AvailablePlanGetResponseEnvelope]
-type availablePlanGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AvailablePlanGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r availablePlanGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type AvailablePlanGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON availablePlanGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// availablePlanGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [AvailablePlanGetResponseEnvelopeErrors]
-type availablePlanGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AvailablePlanGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r availablePlanGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type AvailablePlanGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON availablePlanGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// availablePlanGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [AvailablePlanGetResponseEnvelopeMessages]
-type availablePlanGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *AvailablePlanGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r availablePlanGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type AvailablePlanGetResponseEnvelopeSuccess bool
-
-const (
- AvailablePlanGetResponseEnvelopeSuccessTrue AvailablePlanGetResponseEnvelopeSuccess = true
-)
diff --git a/billing.go b/billing.go
deleted file mode 100644
index b42688b8df2..00000000000
--- a/billing.go
+++ /dev/null
@@ -1,26 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// BillingService contains methods and other services that help with interacting
-// with the cloudflare API. Note, unlike clients, this service does not read
-// variables from the environment automatically. You should not instantiate this
-// service directly, and instead use the [NewBillingService] method instead.
-type BillingService struct {
- Options []option.RequestOption
- Profiles *BillingProfileService
-}
-
-// NewBillingService generates a new service that applies the given options to each
-// request. These options are applied after the parent client's options (if there
-// is one), and before any request-specific options.
-func NewBillingService(opts ...option.RequestOption) (r *BillingService) {
- r = &BillingService{}
- r.Options = opts
- r.Profiles = NewBillingProfileService(opts...)
- return
-}
diff --git a/billing/aliases.go b/billing/aliases.go
new file mode 100644
index 00000000000..61a101e8bcc
--- /dev/null
+++ b/billing/aliases.go
@@ -0,0 +1,9 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package billing
+
+import (
+ "github.com/cloudflare/cloudflare-go/internal/apierror"
+)
+
+type Error = apierror.Error
diff --git a/billing/billing.go b/billing/billing.go
new file mode 100644
index 00000000000..8e18aaf0f85
--- /dev/null
+++ b/billing/billing.go
@@ -0,0 +1,26 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package billing
+
+import (
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// BillingService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewBillingService] method instead.
+type BillingService struct {
+ Options []option.RequestOption
+ Profiles *ProfileService
+}
+
+// NewBillingService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewBillingService(opts ...option.RequestOption) (r *BillingService) {
+ r = &BillingService{}
+ r.Options = opts
+ r.Profiles = NewProfileService(opts...)
+ return
+}
diff --git a/billing/profile.go b/billing/profile.go
new file mode 100644
index 00000000000..f1a570018ec
--- /dev/null
+++ b/billing/profile.go
@@ -0,0 +1,143 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package billing
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "reflect"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/tidwall/gjson"
+)
+
+// ProfileService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewProfileService] method instead.
+type ProfileService struct {
+ Options []option.RequestOption
+}
+
+// NewProfileService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewProfileService(opts ...option.RequestOption) (r *ProfileService) {
+ r = &ProfileService{}
+ r.Options = opts
+ return
+}
+
+// Gets the current billing profile for the account.
+func (r *ProfileService) Get(ctx context.Context, accountIdentifier interface{}, opts ...option.RequestOption) (res *ProfileGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env ProfileGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%v/billing/profile", accountIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Union satisfied by [billing.ProfileGetResponseUnknown] or [shared.UnionString].
+type ProfileGetResponse interface {
+ ImplementsBillingProfileGetResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*ProfileGetResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+type ProfileGetResponseEnvelope struct {
+ Errors []ProfileGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []ProfileGetResponseEnvelopeMessages `json:"messages,required"`
+ Result ProfileGetResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success ProfileGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON profileGetResponseEnvelopeJSON `json:"-"`
+}
+
+// profileGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [ProfileGetResponseEnvelope]
+type profileGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ProfileGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r profileGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type ProfileGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON profileGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// profileGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [ProfileGetResponseEnvelopeErrors]
+type profileGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ProfileGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r profileGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type ProfileGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON profileGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// profileGetResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [ProfileGetResponseEnvelopeMessages]
+type profileGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ProfileGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r profileGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type ProfileGetResponseEnvelopeSuccess bool
+
+const (
+ ProfileGetResponseEnvelopeSuccessTrue ProfileGetResponseEnvelopeSuccess = true
+)
diff --git a/billing/profile_test.go b/billing/profile_test.go
new file mode 100644
index 00000000000..82850c03486
--- /dev/null
+++ b/billing/profile_test.go
@@ -0,0 +1,38 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package billing_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestProfileGet(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"),
+ )
+ _, err := client.Billing.Profiles.Get(context.TODO(), map[string]interface{}{})
+ 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/bot_management/aliases.go b/bot_management/aliases.go
new file mode 100644
index 00000000000..76c07c367b6
--- /dev/null
+++ b/bot_management/aliases.go
@@ -0,0 +1,9 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package bot_management
+
+import (
+ "github.com/cloudflare/cloudflare-go/internal/apierror"
+)
+
+type Error = apierror.Error
diff --git a/botmanagement.go b/bot_management/botmanagement.go
similarity index 96%
rename from botmanagement.go
rename to bot_management/botmanagement.go
index a8747032f08..fd93be2ef40 100644
--- a/botmanagement.go
+++ b/bot_management/botmanagement.go
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package cloudflare
+package bot_management
import (
"context"
@@ -68,12 +68,13 @@ func (r *BotManagementService) Get(ctx context.Context, query BotManagementGetPa
return
}
-// Union satisfied by [BotManagementUpdateResponseBotManagementBotFightModeConfig],
-// [BotManagementUpdateResponseBotManagementSbfmDefinitelyConfig],
-// [BotManagementUpdateResponseBotManagementSbfmLikelyConfig] or
-// [BotManagementUpdateResponseBotManagementBmSubscriptionConfig].
+// Union satisfied by
+// [bot_management.BotManagementUpdateResponseBotManagementBotFightModeConfig],
+// [bot_management.BotManagementUpdateResponseBotManagementSbfmDefinitelyConfig],
+// [bot_management.BotManagementUpdateResponseBotManagementSbfmLikelyConfig] or
+// [bot_management.BotManagementUpdateResponseBotManagementBmSubscriptionConfig].
type BotManagementUpdateResponse interface {
- implementsBotManagementUpdateResponse()
+ implementsBotManagementBotManagementUpdateResponse()
}
func init() {
@@ -130,7 +131,7 @@ func (r botManagementUpdateResponseBotManagementBotFightModeConfigJSON) RawJSON(
return r.raw
}
-func (r BotManagementUpdateResponseBotManagementBotFightModeConfig) implementsBotManagementUpdateResponse() {
+func (r BotManagementUpdateResponseBotManagementBotFightModeConfig) implementsBotManagementBotManagementUpdateResponse() {
}
type BotManagementUpdateResponseBotManagementSbfmDefinitelyConfig struct {
@@ -175,7 +176,7 @@ func (r botManagementUpdateResponseBotManagementSbfmDefinitelyConfigJSON) RawJSO
return r.raw
}
-func (r BotManagementUpdateResponseBotManagementSbfmDefinitelyConfig) implementsBotManagementUpdateResponse() {
+func (r BotManagementUpdateResponseBotManagementSbfmDefinitelyConfig) implementsBotManagementBotManagementUpdateResponse() {
}
// Super Bot Fight Mode (SBFM) action to take on definitely automated requests.
@@ -240,7 +241,7 @@ func (r botManagementUpdateResponseBotManagementSbfmLikelyConfigJSON) RawJSON()
return r.raw
}
-func (r BotManagementUpdateResponseBotManagementSbfmLikelyConfig) implementsBotManagementUpdateResponse() {
+func (r BotManagementUpdateResponseBotManagementSbfmLikelyConfig) implementsBotManagementBotManagementUpdateResponse() {
}
// Super Bot Fight Mode (SBFM) action to take on definitely automated requests.
@@ -306,15 +307,16 @@ func (r botManagementUpdateResponseBotManagementBmSubscriptionConfigJSON) RawJSO
return r.raw
}
-func (r BotManagementUpdateResponseBotManagementBmSubscriptionConfig) implementsBotManagementUpdateResponse() {
+func (r BotManagementUpdateResponseBotManagementBmSubscriptionConfig) implementsBotManagementBotManagementUpdateResponse() {
}
-// Union satisfied by [BotManagementGetResponseBotManagementBotFightModeConfig],
-// [BotManagementGetResponseBotManagementSbfmDefinitelyConfig],
-// [BotManagementGetResponseBotManagementSbfmLikelyConfig] or
-// [BotManagementGetResponseBotManagementBmSubscriptionConfig].
+// Union satisfied by
+// [bot_management.BotManagementGetResponseBotManagementBotFightModeConfig],
+// [bot_management.BotManagementGetResponseBotManagementSbfmDefinitelyConfig],
+// [bot_management.BotManagementGetResponseBotManagementSbfmLikelyConfig] or
+// [bot_management.BotManagementGetResponseBotManagementBmSubscriptionConfig].
type BotManagementGetResponse interface {
- implementsBotManagementGetResponse()
+ implementsBotManagementBotManagementGetResponse()
}
func init() {
@@ -371,7 +373,7 @@ func (r botManagementGetResponseBotManagementBotFightModeConfigJSON) RawJSON() s
return r.raw
}
-func (r BotManagementGetResponseBotManagementBotFightModeConfig) implementsBotManagementGetResponse() {
+func (r BotManagementGetResponseBotManagementBotFightModeConfig) implementsBotManagementBotManagementGetResponse() {
}
type BotManagementGetResponseBotManagementSbfmDefinitelyConfig struct {
@@ -416,7 +418,7 @@ func (r botManagementGetResponseBotManagementSbfmDefinitelyConfigJSON) RawJSON()
return r.raw
}
-func (r BotManagementGetResponseBotManagementSbfmDefinitelyConfig) implementsBotManagementGetResponse() {
+func (r BotManagementGetResponseBotManagementSbfmDefinitelyConfig) implementsBotManagementBotManagementGetResponse() {
}
// Super Bot Fight Mode (SBFM) action to take on definitely automated requests.
@@ -480,7 +482,8 @@ func (r botManagementGetResponseBotManagementSbfmLikelyConfigJSON) RawJSON() str
return r.raw
}
-func (r BotManagementGetResponseBotManagementSbfmLikelyConfig) implementsBotManagementGetResponse() {}
+func (r BotManagementGetResponseBotManagementSbfmLikelyConfig) implementsBotManagementBotManagementGetResponse() {
+}
// Super Bot Fight Mode (SBFM) action to take on definitely automated requests.
type BotManagementGetResponseBotManagementSbfmLikelyConfigSbfmDefinitelyAutomated string
@@ -545,7 +548,7 @@ func (r botManagementGetResponseBotManagementBmSubscriptionConfigJSON) RawJSON()
return r.raw
}
-func (r BotManagementGetResponseBotManagementBmSubscriptionConfig) implementsBotManagementGetResponse() {
+func (r BotManagementGetResponseBotManagementBmSubscriptionConfig) implementsBotManagementBotManagementGetResponse() {
}
type BotManagementUpdateParams struct {
diff --git a/botmanagement_test.go b/bot_management/botmanagement_test.go
similarity index 76%
rename from botmanagement_test.go
rename to bot_management/botmanagement_test.go
index be90e227faf..7c84996dbc7 100644
--- a/botmanagement_test.go
+++ b/bot_management/botmanagement_test.go
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package cloudflare_test
+package bot_management_test
import (
"context"
@@ -9,6 +9,7 @@ import (
"testing"
"github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/bot_management"
"github.com/cloudflare/cloudflare-go/internal/testutil"
"github.com/cloudflare/cloudflare-go/option"
)
@@ -27,16 +28,16 @@ func TestBotManagementUpdateWithOptionalParams(t *testing.T) {
option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"),
option.WithAPIEmail("user@example.com"),
)
- _, err := client.BotManagement.Update(context.TODO(), cloudflare.BotManagementUpdateParams{
+ _, err := client.BotManagement.Update(context.TODO(), bot_management.BotManagementUpdateParams{
ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
AutoUpdateModel: cloudflare.F(true),
EnableJs: cloudflare.F(true),
FightMode: cloudflare.F(true),
OptimizeWordpress: cloudflare.F(true),
- SbfmDefinitelyAutomated: cloudflare.F(cloudflare.BotManagementUpdateParamsSbfmDefinitelyAutomatedAllow),
- SbfmLikelyAutomated: cloudflare.F(cloudflare.BotManagementUpdateParamsSbfmLikelyAutomatedAllow),
+ SbfmDefinitelyAutomated: cloudflare.F(bot_management.BotManagementUpdateParamsSbfmDefinitelyAutomatedAllow),
+ SbfmLikelyAutomated: cloudflare.F(bot_management.BotManagementUpdateParamsSbfmLikelyAutomatedAllow),
SbfmStaticResourceProtection: cloudflare.F(true),
- SbfmVerifiedBots: cloudflare.F(cloudflare.BotManagementUpdateParamsSbfmVerifiedBotsAllow),
+ SbfmVerifiedBots: cloudflare.F(bot_management.BotManagementUpdateParamsSbfmVerifiedBotsAllow),
SuppressSessionScore: cloudflare.F(false),
})
if err != nil {
@@ -62,7 +63,7 @@ func TestBotManagementGet(t *testing.T) {
option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"),
option.WithAPIEmail("user@example.com"),
)
- _, err := client.BotManagement.Get(context.TODO(), cloudflare.BotManagementGetParams{
+ _, err := client.BotManagement.Get(context.TODO(), bot_management.BotManagementGetParams{
ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
})
if err != nil {
diff --git a/brand_protection/aliases.go b/brand_protection/aliases.go
new file mode 100644
index 00000000000..33f5e9ab811
--- /dev/null
+++ b/brand_protection/aliases.go
@@ -0,0 +1,9 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package brand_protection
+
+import (
+ "github.com/cloudflare/cloudflare-go/internal/apierror"
+)
+
+type Error = apierror.Error
diff --git a/brand_protection/brandprotection.go b/brand_protection/brandprotection.go
new file mode 100644
index 00000000000..b5f1683dbc1
--- /dev/null
+++ b/brand_protection/brandprotection.go
@@ -0,0 +1,518 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package brand_protection
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// BrandProtectionService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewBrandProtectionService] method
+// instead.
+type BrandProtectionService struct {
+ Options []option.RequestOption
+}
+
+// NewBrandProtectionService generates a new service that applies the given options
+// to each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewBrandProtectionService(opts ...option.RequestOption) (r *BrandProtectionService) {
+ r = &BrandProtectionService{}
+ r.Options = opts
+ return
+}
+
+// Submit suspicious URL for scanning
+func (r *BrandProtectionService) Submit(ctx context.Context, params BrandProtectionSubmitParams, opts ...option.RequestOption) (res *IntelPhishingURLSubmit, err error) {
+ opts = append(r.Options[:], opts...)
+ var env BrandProtectionSubmitResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/brand-protection/submit", params.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Get results for a URL scan
+func (r *BrandProtectionService) URLInfo(ctx context.Context, params BrandProtectionURLInfoParams, opts ...option.RequestOption) (res *IntelPhishingURLInfo, err error) {
+ opts = append(r.Options[:], opts...)
+ var env BrandProtectionURLInfoResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/brand-protection/url-info", params.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type IntelPhishingURLInfo struct {
+ // List of categorizations applied to this submission.
+ Categorizations []IntelPhishingURLInfoCategorization `json:"categorizations"`
+ // List of model results for completed scans.
+ ModelResults []IntelPhishingURLInfoModelResult `json:"model_results"`
+ // List of signatures that matched against site content found when crawling the
+ // URL.
+ RuleMatches []IntelPhishingURLInfoRuleMatch `json:"rule_matches"`
+ // Status of the most recent scan found.
+ ScanStatus IntelPhishingURLInfoScanStatus `json:"scan_status"`
+ // For internal use.
+ ScreenshotDownloadSignature string `json:"screenshot_download_signature"`
+ // For internal use.
+ ScreenshotPath string `json:"screenshot_path"`
+ // URL that was submitted.
+ URL string `json:"url"`
+ JSON intelPhishingURLInfoJSON `json:"-"`
+}
+
+// intelPhishingURLInfoJSON contains the JSON metadata for the struct
+// [IntelPhishingURLInfo]
+type intelPhishingURLInfoJSON struct {
+ Categorizations apijson.Field
+ ModelResults apijson.Field
+ RuleMatches apijson.Field
+ ScanStatus apijson.Field
+ ScreenshotDownloadSignature apijson.Field
+ ScreenshotPath apijson.Field
+ URL apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IntelPhishingURLInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r intelPhishingURLInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type IntelPhishingURLInfoCategorization struct {
+ // Name of the category applied.
+ Category string `json:"category"`
+ // Result of human review for this categorization.
+ VerificationStatus string `json:"verification_status"`
+ JSON intelPhishingURLInfoCategorizationJSON `json:"-"`
+}
+
+// intelPhishingURLInfoCategorizationJSON contains the JSON metadata for the struct
+// [IntelPhishingURLInfoCategorization]
+type intelPhishingURLInfoCategorizationJSON struct {
+ Category apijson.Field
+ VerificationStatus apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IntelPhishingURLInfoCategorization) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r intelPhishingURLInfoCategorizationJSON) RawJSON() string {
+ return r.raw
+}
+
+type IntelPhishingURLInfoModelResult struct {
+ // Name of the model.
+ ModelName string `json:"model_name"`
+ // Score output by the model for this submission.
+ ModelScore float64 `json:"model_score"`
+ JSON intelPhishingURLInfoModelResultJSON `json:"-"`
+}
+
+// intelPhishingURLInfoModelResultJSON contains the JSON metadata for the struct
+// [IntelPhishingURLInfoModelResult]
+type intelPhishingURLInfoModelResultJSON struct {
+ ModelName apijson.Field
+ ModelScore apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IntelPhishingURLInfoModelResult) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r intelPhishingURLInfoModelResultJSON) RawJSON() string {
+ return r.raw
+}
+
+type IntelPhishingURLInfoRuleMatch struct {
+ // For internal use.
+ Banning bool `json:"banning"`
+ // For internal use.
+ Blocking bool `json:"blocking"`
+ // Description of the signature that matched.
+ Description string `json:"description"`
+ // Name of the signature that matched.
+ Name string `json:"name"`
+ JSON intelPhishingURLInfoRuleMatchJSON `json:"-"`
+}
+
+// intelPhishingURLInfoRuleMatchJSON contains the JSON metadata for the struct
+// [IntelPhishingURLInfoRuleMatch]
+type intelPhishingURLInfoRuleMatchJSON struct {
+ Banning apijson.Field
+ Blocking apijson.Field
+ Description apijson.Field
+ Name apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IntelPhishingURLInfoRuleMatch) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r intelPhishingURLInfoRuleMatchJSON) RawJSON() string {
+ return r.raw
+}
+
+// Status of the most recent scan found.
+type IntelPhishingURLInfoScanStatus struct {
+ // Timestamp of when the submission was processed.
+ LastProcessed string `json:"last_processed"`
+ // For internal use.
+ ScanComplete bool `json:"scan_complete"`
+ // Status code that the crawler received when loading the submitted URL.
+ StatusCode int64 `json:"status_code"`
+ // ID of the most recent submission.
+ SubmissionID int64 `json:"submission_id"`
+ JSON intelPhishingURLInfoScanStatusJSON `json:"-"`
+}
+
+// intelPhishingURLInfoScanStatusJSON contains the JSON metadata for the struct
+// [IntelPhishingURLInfoScanStatus]
+type intelPhishingURLInfoScanStatusJSON struct {
+ LastProcessed apijson.Field
+ ScanComplete apijson.Field
+ StatusCode apijson.Field
+ SubmissionID apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IntelPhishingURLInfoScanStatus) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r intelPhishingURLInfoScanStatusJSON) RawJSON() string {
+ return r.raw
+}
+
+type IntelPhishingURLSubmit struct {
+ // URLs that were excluded from scanning because their domain is in our no-scan
+ // list.
+ ExcludedURLs []IntelPhishingURLSubmitExcludedURL `json:"excluded_urls"`
+ // URLs that were skipped because the same URL is currently being scanned
+ SkippedURLs []IntelPhishingURLSubmitSkippedURL `json:"skipped_urls"`
+ // URLs that were successfully submitted for scanning.
+ SubmittedURLs []IntelPhishingURLSubmitSubmittedURL `json:"submitted_urls"`
+ JSON intelPhishingURLSubmitJSON `json:"-"`
+}
+
+// intelPhishingURLSubmitJSON contains the JSON metadata for the struct
+// [IntelPhishingURLSubmit]
+type intelPhishingURLSubmitJSON struct {
+ ExcludedURLs apijson.Field
+ SkippedURLs apijson.Field
+ SubmittedURLs apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IntelPhishingURLSubmit) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r intelPhishingURLSubmitJSON) RawJSON() string {
+ return r.raw
+}
+
+type IntelPhishingURLSubmitExcludedURL struct {
+ // URL that was excluded.
+ URL string `json:"url"`
+ JSON intelPhishingURLSubmitExcludedURLJSON `json:"-"`
+}
+
+// intelPhishingURLSubmitExcludedURLJSON contains the JSON metadata for the struct
+// [IntelPhishingURLSubmitExcludedURL]
+type intelPhishingURLSubmitExcludedURLJSON struct {
+ URL apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IntelPhishingURLSubmitExcludedURL) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r intelPhishingURLSubmitExcludedURLJSON) RawJSON() string {
+ return r.raw
+}
+
+type IntelPhishingURLSubmitSkippedURL struct {
+ // URL that was skipped.
+ URL string `json:"url"`
+ // ID of the submission of that URL that is currently scanning.
+ URLID int64 `json:"url_id"`
+ JSON intelPhishingURLSubmitSkippedURLJSON `json:"-"`
+}
+
+// intelPhishingURLSubmitSkippedURLJSON contains the JSON metadata for the struct
+// [IntelPhishingURLSubmitSkippedURL]
+type intelPhishingURLSubmitSkippedURLJSON struct {
+ URL apijson.Field
+ URLID apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IntelPhishingURLSubmitSkippedURL) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r intelPhishingURLSubmitSkippedURLJSON) RawJSON() string {
+ return r.raw
+}
+
+type IntelPhishingURLSubmitSubmittedURL struct {
+ // URL that was submitted.
+ URL string `json:"url"`
+ // ID assigned to this URL submission. Used to retrieve scanning results.
+ URLID int64 `json:"url_id"`
+ JSON intelPhishingURLSubmitSubmittedURLJSON `json:"-"`
+}
+
+// intelPhishingURLSubmitSubmittedURLJSON contains the JSON metadata for the struct
+// [IntelPhishingURLSubmitSubmittedURL]
+type intelPhishingURLSubmitSubmittedURLJSON struct {
+ URL apijson.Field
+ URLID apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IntelPhishingURLSubmitSubmittedURL) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r intelPhishingURLSubmitSubmittedURLJSON) RawJSON() string {
+ return r.raw
+}
+
+type BrandProtectionSubmitParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ // URL(s) to filter submissions results by
+ URL param.Field[string] `json:"url" format:"uri"`
+}
+
+func (r BrandProtectionSubmitParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type BrandProtectionSubmitResponseEnvelope struct {
+ Errors []BrandProtectionSubmitResponseEnvelopeErrors `json:"errors,required"`
+ Messages []BrandProtectionSubmitResponseEnvelopeMessages `json:"messages,required"`
+ Result IntelPhishingURLSubmit `json:"result,required"`
+ // Whether the API call was successful
+ Success BrandProtectionSubmitResponseEnvelopeSuccess `json:"success,required"`
+ JSON brandProtectionSubmitResponseEnvelopeJSON `json:"-"`
+}
+
+// brandProtectionSubmitResponseEnvelopeJSON contains the JSON metadata for the
+// struct [BrandProtectionSubmitResponseEnvelope]
+type brandProtectionSubmitResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *BrandProtectionSubmitResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r brandProtectionSubmitResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type BrandProtectionSubmitResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON brandProtectionSubmitResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// brandProtectionSubmitResponseEnvelopeErrorsJSON contains the JSON metadata for
+// the struct [BrandProtectionSubmitResponseEnvelopeErrors]
+type brandProtectionSubmitResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *BrandProtectionSubmitResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r brandProtectionSubmitResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type BrandProtectionSubmitResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON brandProtectionSubmitResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// brandProtectionSubmitResponseEnvelopeMessagesJSON contains the JSON metadata for
+// the struct [BrandProtectionSubmitResponseEnvelopeMessages]
+type brandProtectionSubmitResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *BrandProtectionSubmitResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r brandProtectionSubmitResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type BrandProtectionSubmitResponseEnvelopeSuccess bool
+
+const (
+ BrandProtectionSubmitResponseEnvelopeSuccessTrue BrandProtectionSubmitResponseEnvelopeSuccess = true
+)
+
+type BrandProtectionURLInfoParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ URL param.Field[string] `query:"url"`
+ URLIDParam param.Field[BrandProtectionURLInfoParamsURLIDParam] `query:"url_id_param"`
+}
+
+// URLQuery serializes [BrandProtectionURLInfoParams]'s query parameters as
+// `url.Values`.
+func (r BrandProtectionURLInfoParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type BrandProtectionURLInfoParamsURLIDParam struct {
+ // Submission ID(s) to filter submission results by.
+ URLID param.Field[int64] `query:"url_id"`
+}
+
+// URLQuery serializes [BrandProtectionURLInfoParamsURLIDParam]'s query parameters
+// as `url.Values`.
+func (r BrandProtectionURLInfoParamsURLIDParam) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type BrandProtectionURLInfoResponseEnvelope struct {
+ Errors []BrandProtectionURLInfoResponseEnvelopeErrors `json:"errors,required"`
+ Messages []BrandProtectionURLInfoResponseEnvelopeMessages `json:"messages,required"`
+ Result IntelPhishingURLInfo `json:"result,required"`
+ // Whether the API call was successful
+ Success BrandProtectionURLInfoResponseEnvelopeSuccess `json:"success,required"`
+ JSON brandProtectionURLInfoResponseEnvelopeJSON `json:"-"`
+}
+
+// brandProtectionURLInfoResponseEnvelopeJSON contains the JSON metadata for the
+// struct [BrandProtectionURLInfoResponseEnvelope]
+type brandProtectionURLInfoResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *BrandProtectionURLInfoResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r brandProtectionURLInfoResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type BrandProtectionURLInfoResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON brandProtectionURLInfoResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// brandProtectionURLInfoResponseEnvelopeErrorsJSON contains the JSON metadata for
+// the struct [BrandProtectionURLInfoResponseEnvelopeErrors]
+type brandProtectionURLInfoResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *BrandProtectionURLInfoResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r brandProtectionURLInfoResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type BrandProtectionURLInfoResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON brandProtectionURLInfoResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// brandProtectionURLInfoResponseEnvelopeMessagesJSON contains the JSON metadata
+// for the struct [BrandProtectionURLInfoResponseEnvelopeMessages]
+type brandProtectionURLInfoResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *BrandProtectionURLInfoResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r brandProtectionURLInfoResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type BrandProtectionURLInfoResponseEnvelopeSuccess bool
+
+const (
+ BrandProtectionURLInfoResponseEnvelopeSuccessTrue BrandProtectionURLInfoResponseEnvelopeSuccess = true
+)
diff --git a/brandprotection_test.go b/brand_protection/brandprotection_test.go
similarity index 82%
rename from brandprotection_test.go
rename to brand_protection/brandprotection_test.go
index 4ee72fb7bf8..747242163d6 100644
--- a/brandprotection_test.go
+++ b/brand_protection/brandprotection_test.go
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package cloudflare_test
+package brand_protection_test
import (
"context"
@@ -9,6 +9,7 @@ import (
"testing"
"github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/brand_protection"
"github.com/cloudflare/cloudflare-go/internal/testutil"
"github.com/cloudflare/cloudflare-go/option"
)
@@ -27,7 +28,7 @@ func TestBrandProtectionSubmitWithOptionalParams(t *testing.T) {
option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"),
option.WithAPIEmail("user@example.com"),
)
- _, err := client.BrandProtection.Submit(context.TODO(), cloudflare.BrandProtectionSubmitParams{
+ _, err := client.BrandProtection.Submit(context.TODO(), brand_protection.BrandProtectionSubmitParams{
AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
URL: cloudflare.F("https://www.cloudflare.com"),
})
@@ -54,10 +55,10 @@ func TestBrandProtectionURLInfoWithOptionalParams(t *testing.T) {
option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"),
option.WithAPIEmail("user@example.com"),
)
- _, err := client.BrandProtection.URLInfo(context.TODO(), cloudflare.BrandProtectionURLInfoParams{
+ _, err := client.BrandProtection.URLInfo(context.TODO(), brand_protection.BrandProtectionURLInfoParams{
AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
URL: cloudflare.F("string"),
- URLIDParam: cloudflare.F(cloudflare.BrandProtectionURLInfoParamsURLIDParam{
+ URLIDParam: cloudflare.F(brand_protection.BrandProtectionURLInfoParamsURLIDParam{
URLID: cloudflare.F(int64(0)),
}),
})
diff --git a/brandprotection.go b/brandprotection.go
deleted file mode 100644
index 31e3bbb7a23..00000000000
--- a/brandprotection.go
+++ /dev/null
@@ -1,518 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// BrandProtectionService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewBrandProtectionService] method
-// instead.
-type BrandProtectionService struct {
- Options []option.RequestOption
-}
-
-// NewBrandProtectionService generates a new service that applies the given options
-// to each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewBrandProtectionService(opts ...option.RequestOption) (r *BrandProtectionService) {
- r = &BrandProtectionService{}
- r.Options = opts
- return
-}
-
-// Submit suspicious URL for scanning
-func (r *BrandProtectionService) Submit(ctx context.Context, params BrandProtectionSubmitParams, opts ...option.RequestOption) (res *BrandProtectionSubmitResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env BrandProtectionSubmitResponseEnvelope
- path := fmt.Sprintf("accounts/%s/brand-protection/submit", params.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Get results for a URL scan
-func (r *BrandProtectionService) URLInfo(ctx context.Context, params BrandProtectionURLInfoParams, opts ...option.RequestOption) (res *BrandProtectionURLInfoResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env BrandProtectionURLInfoResponseEnvelope
- path := fmt.Sprintf("accounts/%s/brand-protection/url-info", params.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type BrandProtectionSubmitResponse struct {
- // URLs that were excluded from scanning because their domain is in our no-scan
- // list.
- ExcludedURLs []BrandProtectionSubmitResponseExcludedURL `json:"excluded_urls"`
- // URLs that were skipped because the same URL is currently being scanned
- SkippedURLs []BrandProtectionSubmitResponseSkippedURL `json:"skipped_urls"`
- // URLs that were successfully submitted for scanning.
- SubmittedURLs []BrandProtectionSubmitResponseSubmittedURL `json:"submitted_urls"`
- JSON brandProtectionSubmitResponseJSON `json:"-"`
-}
-
-// brandProtectionSubmitResponseJSON contains the JSON metadata for the struct
-// [BrandProtectionSubmitResponse]
-type brandProtectionSubmitResponseJSON struct {
- ExcludedURLs apijson.Field
- SkippedURLs apijson.Field
- SubmittedURLs apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *BrandProtectionSubmitResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r brandProtectionSubmitResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type BrandProtectionSubmitResponseExcludedURL struct {
- // URL that was excluded.
- URL string `json:"url"`
- JSON brandProtectionSubmitResponseExcludedURLJSON `json:"-"`
-}
-
-// brandProtectionSubmitResponseExcludedURLJSON contains the JSON metadata for the
-// struct [BrandProtectionSubmitResponseExcludedURL]
-type brandProtectionSubmitResponseExcludedURLJSON struct {
- URL apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *BrandProtectionSubmitResponseExcludedURL) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r brandProtectionSubmitResponseExcludedURLJSON) RawJSON() string {
- return r.raw
-}
-
-type BrandProtectionSubmitResponseSkippedURL struct {
- // URL that was skipped.
- URL string `json:"url"`
- // ID of the submission of that URL that is currently scanning.
- URLID int64 `json:"url_id"`
- JSON brandProtectionSubmitResponseSkippedURLJSON `json:"-"`
-}
-
-// brandProtectionSubmitResponseSkippedURLJSON contains the JSON metadata for the
-// struct [BrandProtectionSubmitResponseSkippedURL]
-type brandProtectionSubmitResponseSkippedURLJSON struct {
- URL apijson.Field
- URLID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *BrandProtectionSubmitResponseSkippedURL) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r brandProtectionSubmitResponseSkippedURLJSON) RawJSON() string {
- return r.raw
-}
-
-type BrandProtectionSubmitResponseSubmittedURL struct {
- // URL that was submitted.
- URL string `json:"url"`
- // ID assigned to this URL submission. Used to retrieve scanning results.
- URLID int64 `json:"url_id"`
- JSON brandProtectionSubmitResponseSubmittedURLJSON `json:"-"`
-}
-
-// brandProtectionSubmitResponseSubmittedURLJSON contains the JSON metadata for the
-// struct [BrandProtectionSubmitResponseSubmittedURL]
-type brandProtectionSubmitResponseSubmittedURLJSON struct {
- URL apijson.Field
- URLID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *BrandProtectionSubmitResponseSubmittedURL) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r brandProtectionSubmitResponseSubmittedURLJSON) RawJSON() string {
- return r.raw
-}
-
-type BrandProtectionURLInfoResponse struct {
- // List of categorizations applied to this submission.
- Categorizations []BrandProtectionURLInfoResponseCategorization `json:"categorizations"`
- // List of model results for completed scans.
- ModelResults []BrandProtectionURLInfoResponseModelResult `json:"model_results"`
- // List of signatures that matched against site content found when crawling the
- // URL.
- RuleMatches []BrandProtectionURLInfoResponseRuleMatch `json:"rule_matches"`
- // Status of the most recent scan found.
- ScanStatus BrandProtectionURLInfoResponseScanStatus `json:"scan_status"`
- // For internal use.
- ScreenshotDownloadSignature string `json:"screenshot_download_signature"`
- // For internal use.
- ScreenshotPath string `json:"screenshot_path"`
- // URL that was submitted.
- URL string `json:"url"`
- JSON brandProtectionURLInfoResponseJSON `json:"-"`
-}
-
-// brandProtectionURLInfoResponseJSON contains the JSON metadata for the struct
-// [BrandProtectionURLInfoResponse]
-type brandProtectionURLInfoResponseJSON struct {
- Categorizations apijson.Field
- ModelResults apijson.Field
- RuleMatches apijson.Field
- ScanStatus apijson.Field
- ScreenshotDownloadSignature apijson.Field
- ScreenshotPath apijson.Field
- URL apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *BrandProtectionURLInfoResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r brandProtectionURLInfoResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type BrandProtectionURLInfoResponseCategorization struct {
- // Name of the category applied.
- Category string `json:"category"`
- // Result of human review for this categorization.
- VerificationStatus string `json:"verification_status"`
- JSON brandProtectionURLInfoResponseCategorizationJSON `json:"-"`
-}
-
-// brandProtectionURLInfoResponseCategorizationJSON contains the JSON metadata for
-// the struct [BrandProtectionURLInfoResponseCategorization]
-type brandProtectionURLInfoResponseCategorizationJSON struct {
- Category apijson.Field
- VerificationStatus apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *BrandProtectionURLInfoResponseCategorization) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r brandProtectionURLInfoResponseCategorizationJSON) RawJSON() string {
- return r.raw
-}
-
-type BrandProtectionURLInfoResponseModelResult struct {
- // Name of the model.
- ModelName string `json:"model_name"`
- // Score output by the model for this submission.
- ModelScore float64 `json:"model_score"`
- JSON brandProtectionURLInfoResponseModelResultJSON `json:"-"`
-}
-
-// brandProtectionURLInfoResponseModelResultJSON contains the JSON metadata for the
-// struct [BrandProtectionURLInfoResponseModelResult]
-type brandProtectionURLInfoResponseModelResultJSON struct {
- ModelName apijson.Field
- ModelScore apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *BrandProtectionURLInfoResponseModelResult) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r brandProtectionURLInfoResponseModelResultJSON) RawJSON() string {
- return r.raw
-}
-
-type BrandProtectionURLInfoResponseRuleMatch struct {
- // For internal use.
- Banning bool `json:"banning"`
- // For internal use.
- Blocking bool `json:"blocking"`
- // Description of the signature that matched.
- Description string `json:"description"`
- // Name of the signature that matched.
- Name string `json:"name"`
- JSON brandProtectionURLInfoResponseRuleMatchJSON `json:"-"`
-}
-
-// brandProtectionURLInfoResponseRuleMatchJSON contains the JSON metadata for the
-// struct [BrandProtectionURLInfoResponseRuleMatch]
-type brandProtectionURLInfoResponseRuleMatchJSON struct {
- Banning apijson.Field
- Blocking apijson.Field
- Description apijson.Field
- Name apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *BrandProtectionURLInfoResponseRuleMatch) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r brandProtectionURLInfoResponseRuleMatchJSON) RawJSON() string {
- return r.raw
-}
-
-// Status of the most recent scan found.
-type BrandProtectionURLInfoResponseScanStatus struct {
- // Timestamp of when the submission was processed.
- LastProcessed string `json:"last_processed"`
- // For internal use.
- ScanComplete bool `json:"scan_complete"`
- // Status code that the crawler received when loading the submitted URL.
- StatusCode int64 `json:"status_code"`
- // ID of the most recent submission.
- SubmissionID int64 `json:"submission_id"`
- JSON brandProtectionURLInfoResponseScanStatusJSON `json:"-"`
-}
-
-// brandProtectionURLInfoResponseScanStatusJSON contains the JSON metadata for the
-// struct [BrandProtectionURLInfoResponseScanStatus]
-type brandProtectionURLInfoResponseScanStatusJSON struct {
- LastProcessed apijson.Field
- ScanComplete apijson.Field
- StatusCode apijson.Field
- SubmissionID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *BrandProtectionURLInfoResponseScanStatus) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r brandProtectionURLInfoResponseScanStatusJSON) RawJSON() string {
- return r.raw
-}
-
-type BrandProtectionSubmitParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
- // URL(s) to filter submissions results by
- URL param.Field[string] `json:"url" format:"uri"`
-}
-
-func (r BrandProtectionSubmitParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type BrandProtectionSubmitResponseEnvelope struct {
- Errors []BrandProtectionSubmitResponseEnvelopeErrors `json:"errors,required"`
- Messages []BrandProtectionSubmitResponseEnvelopeMessages `json:"messages,required"`
- Result BrandProtectionSubmitResponse `json:"result,required"`
- // Whether the API call was successful
- Success BrandProtectionSubmitResponseEnvelopeSuccess `json:"success,required"`
- JSON brandProtectionSubmitResponseEnvelopeJSON `json:"-"`
-}
-
-// brandProtectionSubmitResponseEnvelopeJSON contains the JSON metadata for the
-// struct [BrandProtectionSubmitResponseEnvelope]
-type brandProtectionSubmitResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *BrandProtectionSubmitResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r brandProtectionSubmitResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type BrandProtectionSubmitResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON brandProtectionSubmitResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// brandProtectionSubmitResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [BrandProtectionSubmitResponseEnvelopeErrors]
-type brandProtectionSubmitResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *BrandProtectionSubmitResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r brandProtectionSubmitResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type BrandProtectionSubmitResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON brandProtectionSubmitResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// brandProtectionSubmitResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [BrandProtectionSubmitResponseEnvelopeMessages]
-type brandProtectionSubmitResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *BrandProtectionSubmitResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r brandProtectionSubmitResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type BrandProtectionSubmitResponseEnvelopeSuccess bool
-
-const (
- BrandProtectionSubmitResponseEnvelopeSuccessTrue BrandProtectionSubmitResponseEnvelopeSuccess = true
-)
-
-type BrandProtectionURLInfoParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
- URL param.Field[string] `query:"url"`
- URLIDParam param.Field[BrandProtectionURLInfoParamsURLIDParam] `query:"url_id_param"`
-}
-
-// URLQuery serializes [BrandProtectionURLInfoParams]'s query parameters as
-// `url.Values`.
-func (r BrandProtectionURLInfoParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type BrandProtectionURLInfoParamsURLIDParam struct {
- // Submission ID(s) to filter submission results by.
- URLID param.Field[int64] `query:"url_id"`
-}
-
-// URLQuery serializes [BrandProtectionURLInfoParamsURLIDParam]'s query parameters
-// as `url.Values`.
-func (r BrandProtectionURLInfoParamsURLIDParam) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type BrandProtectionURLInfoResponseEnvelope struct {
- Errors []BrandProtectionURLInfoResponseEnvelopeErrors `json:"errors,required"`
- Messages []BrandProtectionURLInfoResponseEnvelopeMessages `json:"messages,required"`
- Result BrandProtectionURLInfoResponse `json:"result,required"`
- // Whether the API call was successful
- Success BrandProtectionURLInfoResponseEnvelopeSuccess `json:"success,required"`
- JSON brandProtectionURLInfoResponseEnvelopeJSON `json:"-"`
-}
-
-// brandProtectionURLInfoResponseEnvelopeJSON contains the JSON metadata for the
-// struct [BrandProtectionURLInfoResponseEnvelope]
-type brandProtectionURLInfoResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *BrandProtectionURLInfoResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r brandProtectionURLInfoResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type BrandProtectionURLInfoResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON brandProtectionURLInfoResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// brandProtectionURLInfoResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [BrandProtectionURLInfoResponseEnvelopeErrors]
-type brandProtectionURLInfoResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *BrandProtectionURLInfoResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r brandProtectionURLInfoResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type BrandProtectionURLInfoResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON brandProtectionURLInfoResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// brandProtectionURLInfoResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [BrandProtectionURLInfoResponseEnvelopeMessages]
-type brandProtectionURLInfoResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *BrandProtectionURLInfoResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r brandProtectionURLInfoResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type BrandProtectionURLInfoResponseEnvelopeSuccess bool
-
-const (
- BrandProtectionURLInfoResponseEnvelopeSuccessTrue BrandProtectionURLInfoResponseEnvelopeSuccess = true
-)
diff --git a/cache/aliases.go b/cache/aliases.go
new file mode 100644
index 00000000000..84393769749
--- /dev/null
+++ b/cache/aliases.go
@@ -0,0 +1,9 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package cache
+
+import (
+ "github.com/cloudflare/cloudflare-go/internal/apierror"
+)
+
+type Error = apierror.Error
diff --git a/cache.go b/cache/cache.go
similarity index 92%
rename from cache.go
rename to cache/cache.go
index 0983eb1cad4..6ae254a27cd 100644
--- a/cache.go
+++ b/cache/cache.go
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package cloudflare
+package cache
import (
"context"
@@ -19,10 +19,10 @@ import (
// directly, and instead use the [NewCacheService] method instead.
type CacheService struct {
Options []option.RequestOption
- CacheReserve *CacheCacheReserveService
- SmartTieredCached *CacheSmartTieredCachedService
- Variants *CacheVariantService
- RegionalTieredCache *CacheRegionalTieredCacheService
+ CacheReserve *CacheReserveService
+ SmartTieredCached *SmartTieredCachedService
+ Variants *VariantService
+ RegionalTieredCache *RegionalTieredCacheService
}
// NewCacheService generates a new service that applies the given options to each
@@ -31,10 +31,10 @@ type CacheService struct {
func NewCacheService(opts ...option.RequestOption) (r *CacheService) {
r = &CacheService{}
r.Options = opts
- r.CacheReserve = NewCacheCacheReserveService(opts...)
- r.SmartTieredCached = NewCacheSmartTieredCachedService(opts...)
- r.Variants = NewCacheVariantService(opts...)
- r.RegionalTieredCache = NewCacheRegionalTieredCacheService(opts...)
+ r.CacheReserve = NewCacheReserveService(opts...)
+ r.SmartTieredCached = NewSmartTieredCachedService(opts...)
+ r.Variants = NewVariantService(opts...)
+ r.RegionalTieredCache = NewRegionalTieredCacheService(opts...)
return
}
@@ -114,9 +114,9 @@ func (r CachePurgeParams) MarshalJSON() (data []byte, err error) {
}
// Satisfied by [shared.UnionString],
-// [CachePurgeParamsFilesCachePurgeURLAndHeaders].
+// [cache.CachePurgeParamsFilesCachePurgeURLAndHeaders].
type CachePurgeParamsFile interface {
- ImplementsCachePurgeParamsFile()
+ ImplementsCacheCachePurgeParamsFile()
}
type CachePurgeParamsFilesCachePurgeURLAndHeaders struct {
@@ -128,7 +128,7 @@ func (r CachePurgeParamsFilesCachePurgeURLAndHeaders) MarshalJSON() (data []byte
return apijson.MarshalRoot(r)
}
-func (r CachePurgeParamsFilesCachePurgeURLAndHeaders) ImplementsCachePurgeParamsFile() {}
+func (r CachePurgeParamsFilesCachePurgeURLAndHeaders) ImplementsCacheCachePurgeParamsFile() {}
type CachePurgeResponseEnvelope struct {
Errors []CachePurgeResponseEnvelopeErrors `json:"errors,required"`
diff --git a/cache_test.go b/cache/cache_test.go
similarity index 76%
rename from cache_test.go
rename to cache/cache_test.go
index 62ebcb63a2b..98a40dea8a7 100644
--- a/cache_test.go
+++ b/cache/cache_test.go
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package cloudflare_test
+package cache_test
import (
"context"
@@ -9,6 +9,7 @@ import (
"testing"
"github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/cache"
"github.com/cloudflare/cloudflare-go/internal/shared"
"github.com/cloudflare/cloudflare-go/internal/testutil"
"github.com/cloudflare/cloudflare-go/option"
@@ -28,9 +29,9 @@ func TestCachePurgeWithOptionalParams(t *testing.T) {
option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"),
option.WithAPIEmail("user@example.com"),
)
- _, err := client.Cache.Purge(context.TODO(), cloudflare.CachePurgeParams{
+ _, err := client.Cache.Purge(context.TODO(), cache.CachePurgeParams{
ZoneID: cloudflare.F("string"),
- Files: cloudflare.F([]cloudflare.CachePurgeParamsFile{shared.UnionString("http://www.example.com/css/styles.css"), shared.UnionString("http://www.example.com/css/styles.css"), shared.UnionString("http://www.example.com/css/styles.css")}),
+ Files: cloudflare.F([]cache.CachePurgeParamsFile{shared.UnionString("http://www.example.com/css/styles.css"), shared.UnionString("http://www.example.com/css/styles.css"), shared.UnionString("http://www.example.com/css/styles.css")}),
Hosts: cloudflare.F([]string{"www.example.com", "images.example.com"}),
Prefixes: cloudflare.F([]string{"www.example.com/foo", "images.example.com/bar/baz"}),
PurgeEverything: cloudflare.F(true),
diff --git a/cache/cachereserve.go b/cache/cachereserve.go
new file mode 100644
index 00000000000..933c0bf0e52
--- /dev/null
+++ b/cache/cachereserve.go
@@ -0,0 +1,683 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package cache
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// CacheReserveService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewCacheReserveService] method
+// instead.
+type CacheReserveService struct {
+ Options []option.RequestOption
+}
+
+// NewCacheReserveService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewCacheReserveService(opts ...option.RequestOption) (r *CacheReserveService) {
+ r = &CacheReserveService{}
+ r.Options = opts
+ return
+}
+
+// You can use Cache Reserve Clear to clear your Cache Reserve, but you must first
+// disable Cache Reserve. In most cases, this will be accomplished within 24 hours.
+// You cannot re-enable Cache Reserve while this process is ongoing. Keep in mind
+// that you cannot undo or cancel this operation.
+func (r *CacheReserveService) Clear(ctx context.Context, body CacheReserveClearParams, opts ...option.RequestOption) (res *CacheReserveClearResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env CacheReserveClearResponseEnvelope
+ path := fmt.Sprintf("zones/%s/cache/cache_reserve_clear", body.ZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Increase cache lifetimes by automatically storing all cacheable files into
+// Cloudflare's persistent object storage buckets. Requires Cache Reserve
+// subscription. Note: using Tiered Cache with Cache Reserve is highly recommended
+// to reduce Reserve operations costs. See the
+// [developer docs](https://developers.cloudflare.com/cache/about/cache-reserve)
+// for more information.
+func (r *CacheReserveService) Edit(ctx context.Context, params CacheReserveEditParams, opts ...option.RequestOption) (res *CacheReserveEditResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env CacheReserveEditResponseEnvelope
+ path := fmt.Sprintf("zones/%s/cache/cache_reserve", params.ZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Increase cache lifetimes by automatically storing all cacheable files into
+// Cloudflare's persistent object storage buckets. Requires Cache Reserve
+// subscription. Note: using Tiered Cache with Cache Reserve is highly recommended
+// to reduce Reserve operations costs. See the
+// [developer docs](https://developers.cloudflare.com/cache/about/cache-reserve)
+// for more information.
+func (r *CacheReserveService) Get(ctx context.Context, query CacheReserveGetParams, opts ...option.RequestOption) (res *CacheReserveGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env CacheReserveGetResponseEnvelope
+ path := fmt.Sprintf("zones/%s/cache/cache_reserve", query.ZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// You can use Cache Reserve Clear to clear your Cache Reserve, but you must first
+// disable Cache Reserve. In most cases, this will be accomplished within 24 hours.
+// You cannot re-enable Cache Reserve while this process is ongoing. Keep in mind
+// that you cannot undo or cancel this operation.
+func (r *CacheReserveService) Status(ctx context.Context, query CacheReserveStatusParams, opts ...option.RequestOption) (res *CacheReserveStatusResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env CacheReserveStatusResponseEnvelope
+ path := fmt.Sprintf("zones/%s/cache/cache_reserve_clear", query.ZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// You can use Cache Reserve Clear to clear your Cache Reserve, but you must first
+// disable Cache Reserve. In most cases, this will be accomplished within 24 hours.
+// You cannot re-enable Cache Reserve while this process is ongoing. Keep in mind
+// that you cannot undo or cancel this operation.
+type CacheReserveClearResponse struct {
+ // ID of the zone setting.
+ ID CacheReserveClearResponseID `json:"id,required"`
+ // last time this setting was modified.
+ ModifiedOn time.Time `json:"modified_on,required,nullable" format:"date-time"`
+ // The time that the latest Cache Reserve Clear operation started.
+ StartTs time.Time `json:"start_ts,required" format:"date-time"`
+ // The current state of the Cache Reserve Clear operation.
+ State CacheReserveClearResponseState `json:"state,required"`
+ // The time that the latest Cache Reserve Clear operation completed.
+ EndTs time.Time `json:"end_ts" format:"date-time"`
+ JSON cacheReserveClearResponseJSON `json:"-"`
+}
+
+// cacheReserveClearResponseJSON contains the JSON metadata for the struct
+// [CacheReserveClearResponse]
+type cacheReserveClearResponseJSON struct {
+ ID apijson.Field
+ ModifiedOn apijson.Field
+ StartTs apijson.Field
+ State apijson.Field
+ EndTs apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CacheReserveClearResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r cacheReserveClearResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+// ID of the zone setting.
+type CacheReserveClearResponseID string
+
+const (
+ CacheReserveClearResponseIDCacheReserveClear CacheReserveClearResponseID = "cache_reserve_clear"
+)
+
+// The current state of the Cache Reserve Clear operation.
+type CacheReserveClearResponseState string
+
+const (
+ CacheReserveClearResponseStateInProgress CacheReserveClearResponseState = "In-progress"
+ CacheReserveClearResponseStateCompleted CacheReserveClearResponseState = "Completed"
+)
+
+// Increase cache lifetimes by automatically storing all cacheable files into
+// Cloudflare's persistent object storage buckets. Requires Cache Reserve
+// subscription. Note: using Tiered Cache with Cache Reserve is highly recommended
+// to reduce Reserve operations costs. See the
+// [developer docs](https://developers.cloudflare.com/cache/about/cache-reserve)
+// for more information.
+type CacheReserveEditResponse struct {
+ // ID of the zone setting.
+ ID CacheReserveEditResponseID `json:"id,required"`
+ // last time this setting was modified.
+ ModifiedOn time.Time `json:"modified_on,required,nullable" format:"date-time"`
+ // Value of the Cache Reserve zone setting.
+ Value CacheReserveEditResponseValue `json:"value,required"`
+ JSON cacheReserveEditResponseJSON `json:"-"`
+}
+
+// cacheReserveEditResponseJSON contains the JSON metadata for the struct
+// [CacheReserveEditResponse]
+type cacheReserveEditResponseJSON struct {
+ ID apijson.Field
+ ModifiedOn apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CacheReserveEditResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r cacheReserveEditResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+// ID of the zone setting.
+type CacheReserveEditResponseID string
+
+const (
+ CacheReserveEditResponseIDCacheReserve CacheReserveEditResponseID = "cache_reserve"
+)
+
+// Value of the Cache Reserve zone setting.
+type CacheReserveEditResponseValue string
+
+const (
+ CacheReserveEditResponseValueOn CacheReserveEditResponseValue = "on"
+ CacheReserveEditResponseValueOff CacheReserveEditResponseValue = "off"
+)
+
+// Increase cache lifetimes by automatically storing all cacheable files into
+// Cloudflare's persistent object storage buckets. Requires Cache Reserve
+// subscription. Note: using Tiered Cache with Cache Reserve is highly recommended
+// to reduce Reserve operations costs. See the
+// [developer docs](https://developers.cloudflare.com/cache/about/cache-reserve)
+// for more information.
+type CacheReserveGetResponse struct {
+ // ID of the zone setting.
+ ID CacheReserveGetResponseID `json:"id,required"`
+ // last time this setting was modified.
+ ModifiedOn time.Time `json:"modified_on,required,nullable" format:"date-time"`
+ // Value of the Cache Reserve zone setting.
+ Value CacheReserveGetResponseValue `json:"value,required"`
+ JSON cacheReserveGetResponseJSON `json:"-"`
+}
+
+// cacheReserveGetResponseJSON contains the JSON metadata for the struct
+// [CacheReserveGetResponse]
+type cacheReserveGetResponseJSON struct {
+ ID apijson.Field
+ ModifiedOn apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CacheReserveGetResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r cacheReserveGetResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+// ID of the zone setting.
+type CacheReserveGetResponseID string
+
+const (
+ CacheReserveGetResponseIDCacheReserve CacheReserveGetResponseID = "cache_reserve"
+)
+
+// Value of the Cache Reserve zone setting.
+type CacheReserveGetResponseValue string
+
+const (
+ CacheReserveGetResponseValueOn CacheReserveGetResponseValue = "on"
+ CacheReserveGetResponseValueOff CacheReserveGetResponseValue = "off"
+)
+
+// You can use Cache Reserve Clear to clear your Cache Reserve, but you must first
+// disable Cache Reserve. In most cases, this will be accomplished within 24 hours.
+// You cannot re-enable Cache Reserve while this process is ongoing. Keep in mind
+// that you cannot undo or cancel this operation.
+type CacheReserveStatusResponse struct {
+ // ID of the zone setting.
+ ID CacheReserveStatusResponseID `json:"id,required"`
+ // last time this setting was modified.
+ ModifiedOn time.Time `json:"modified_on,required,nullable" format:"date-time"`
+ // The time that the latest Cache Reserve Clear operation started.
+ StartTs time.Time `json:"start_ts,required" format:"date-time"`
+ // The current state of the Cache Reserve Clear operation.
+ State CacheReserveStatusResponseState `json:"state,required"`
+ // The time that the latest Cache Reserve Clear operation completed.
+ EndTs time.Time `json:"end_ts" format:"date-time"`
+ JSON cacheReserveStatusResponseJSON `json:"-"`
+}
+
+// cacheReserveStatusResponseJSON contains the JSON metadata for the struct
+// [CacheReserveStatusResponse]
+type cacheReserveStatusResponseJSON struct {
+ ID apijson.Field
+ ModifiedOn apijson.Field
+ StartTs apijson.Field
+ State apijson.Field
+ EndTs apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CacheReserveStatusResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r cacheReserveStatusResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+// ID of the zone setting.
+type CacheReserveStatusResponseID string
+
+const (
+ CacheReserveStatusResponseIDCacheReserveClear CacheReserveStatusResponseID = "cache_reserve_clear"
+)
+
+// The current state of the Cache Reserve Clear operation.
+type CacheReserveStatusResponseState string
+
+const (
+ CacheReserveStatusResponseStateInProgress CacheReserveStatusResponseState = "In-progress"
+ CacheReserveStatusResponseStateCompleted CacheReserveStatusResponseState = "Completed"
+)
+
+type CacheReserveClearParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+}
+
+type CacheReserveClearResponseEnvelope struct {
+ Errors []CacheReserveClearResponseEnvelopeErrors `json:"errors,required"`
+ Messages []CacheReserveClearResponseEnvelopeMessages `json:"messages,required"`
+ // You can use Cache Reserve Clear to clear your Cache Reserve, but you must first
+ // disable Cache Reserve. In most cases, this will be accomplished within 24 hours.
+ // You cannot re-enable Cache Reserve while this process is ongoing. Keep in mind
+ // that you cannot undo or cancel this operation.
+ Result CacheReserveClearResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success CacheReserveClearResponseEnvelopeSuccess `json:"success,required"`
+ JSON cacheReserveClearResponseEnvelopeJSON `json:"-"`
+}
+
+// cacheReserveClearResponseEnvelopeJSON contains the JSON metadata for the struct
+// [CacheReserveClearResponseEnvelope]
+type cacheReserveClearResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CacheReserveClearResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r cacheReserveClearResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type CacheReserveClearResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON cacheReserveClearResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// cacheReserveClearResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [CacheReserveClearResponseEnvelopeErrors]
+type cacheReserveClearResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CacheReserveClearResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r cacheReserveClearResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type CacheReserveClearResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON cacheReserveClearResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// cacheReserveClearResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [CacheReserveClearResponseEnvelopeMessages]
+type cacheReserveClearResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CacheReserveClearResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r cacheReserveClearResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type CacheReserveClearResponseEnvelopeSuccess bool
+
+const (
+ CacheReserveClearResponseEnvelopeSuccessTrue CacheReserveClearResponseEnvelopeSuccess = true
+)
+
+type CacheReserveEditParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+ // Value of the Cache Reserve zone setting.
+ Value param.Field[CacheReserveEditParamsValue] `json:"value,required"`
+}
+
+func (r CacheReserveEditParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Value of the Cache Reserve zone setting.
+type CacheReserveEditParamsValue string
+
+const (
+ CacheReserveEditParamsValueOn CacheReserveEditParamsValue = "on"
+ CacheReserveEditParamsValueOff CacheReserveEditParamsValue = "off"
+)
+
+type CacheReserveEditResponseEnvelope struct {
+ Errors []CacheReserveEditResponseEnvelopeErrors `json:"errors,required"`
+ Messages []CacheReserveEditResponseEnvelopeMessages `json:"messages,required"`
+ // Increase cache lifetimes by automatically storing all cacheable files into
+ // Cloudflare's persistent object storage buckets. Requires Cache Reserve
+ // subscription. Note: using Tiered Cache with Cache Reserve is highly recommended
+ // to reduce Reserve operations costs. See the
+ // [developer docs](https://developers.cloudflare.com/cache/about/cache-reserve)
+ // for more information.
+ Result CacheReserveEditResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success CacheReserveEditResponseEnvelopeSuccess `json:"success,required"`
+ JSON cacheReserveEditResponseEnvelopeJSON `json:"-"`
+}
+
+// cacheReserveEditResponseEnvelopeJSON contains the JSON metadata for the struct
+// [CacheReserveEditResponseEnvelope]
+type cacheReserveEditResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CacheReserveEditResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r cacheReserveEditResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type CacheReserveEditResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON cacheReserveEditResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// cacheReserveEditResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [CacheReserveEditResponseEnvelopeErrors]
+type cacheReserveEditResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CacheReserveEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r cacheReserveEditResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type CacheReserveEditResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON cacheReserveEditResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// cacheReserveEditResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [CacheReserveEditResponseEnvelopeMessages]
+type cacheReserveEditResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CacheReserveEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r cacheReserveEditResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type CacheReserveEditResponseEnvelopeSuccess bool
+
+const (
+ CacheReserveEditResponseEnvelopeSuccessTrue CacheReserveEditResponseEnvelopeSuccess = true
+)
+
+type CacheReserveGetParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+}
+
+type CacheReserveGetResponseEnvelope struct {
+ Errors []CacheReserveGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []CacheReserveGetResponseEnvelopeMessages `json:"messages,required"`
+ // Increase cache lifetimes by automatically storing all cacheable files into
+ // Cloudflare's persistent object storage buckets. Requires Cache Reserve
+ // subscription. Note: using Tiered Cache with Cache Reserve is highly recommended
+ // to reduce Reserve operations costs. See the
+ // [developer docs](https://developers.cloudflare.com/cache/about/cache-reserve)
+ // for more information.
+ Result CacheReserveGetResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success CacheReserveGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON cacheReserveGetResponseEnvelopeJSON `json:"-"`
+}
+
+// cacheReserveGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [CacheReserveGetResponseEnvelope]
+type cacheReserveGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CacheReserveGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r cacheReserveGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type CacheReserveGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON cacheReserveGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// cacheReserveGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [CacheReserveGetResponseEnvelopeErrors]
+type cacheReserveGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CacheReserveGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r cacheReserveGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type CacheReserveGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON cacheReserveGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// cacheReserveGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [CacheReserveGetResponseEnvelopeMessages]
+type cacheReserveGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CacheReserveGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r cacheReserveGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type CacheReserveGetResponseEnvelopeSuccess bool
+
+const (
+ CacheReserveGetResponseEnvelopeSuccessTrue CacheReserveGetResponseEnvelopeSuccess = true
+)
+
+type CacheReserveStatusParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+}
+
+type CacheReserveStatusResponseEnvelope struct {
+ Errors []CacheReserveStatusResponseEnvelopeErrors `json:"errors,required"`
+ Messages []CacheReserveStatusResponseEnvelopeMessages `json:"messages,required"`
+ // You can use Cache Reserve Clear to clear your Cache Reserve, but you must first
+ // disable Cache Reserve. In most cases, this will be accomplished within 24 hours.
+ // You cannot re-enable Cache Reserve while this process is ongoing. Keep in mind
+ // that you cannot undo or cancel this operation.
+ Result CacheReserveStatusResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success CacheReserveStatusResponseEnvelopeSuccess `json:"success,required"`
+ JSON cacheReserveStatusResponseEnvelopeJSON `json:"-"`
+}
+
+// cacheReserveStatusResponseEnvelopeJSON contains the JSON metadata for the struct
+// [CacheReserveStatusResponseEnvelope]
+type cacheReserveStatusResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CacheReserveStatusResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r cacheReserveStatusResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type CacheReserveStatusResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON cacheReserveStatusResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// cacheReserveStatusResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [CacheReserveStatusResponseEnvelopeErrors]
+type cacheReserveStatusResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CacheReserveStatusResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r cacheReserveStatusResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type CacheReserveStatusResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON cacheReserveStatusResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// cacheReserveStatusResponseEnvelopeMessagesJSON contains the JSON metadata for
+// the struct [CacheReserveStatusResponseEnvelopeMessages]
+type cacheReserveStatusResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CacheReserveStatusResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r cacheReserveStatusResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type CacheReserveStatusResponseEnvelopeSuccess bool
+
+const (
+ CacheReserveStatusResponseEnvelopeSuccessTrue CacheReserveStatusResponseEnvelopeSuccess = true
+)
diff --git a/cache/cachereserve_test.go b/cache/cachereserve_test.go
new file mode 100644
index 00000000000..c08861345de
--- /dev/null
+++ b/cache/cachereserve_test.go
@@ -0,0 +1,120 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package cache_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/cache"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestCacheReserveClear(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"),
+ )
+ _, err := client.Cache.CacheReserve.Clear(context.TODO(), cache.CacheReserveClearParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ })
+ 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())
+ }
+}
+
+func TestCacheReserveEdit(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"),
+ )
+ _, err := client.Cache.CacheReserve.Edit(context.TODO(), cache.CacheReserveEditParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Value: cloudflare.F(cache.CacheReserveEditParamsValueOn),
+ })
+ 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())
+ }
+}
+
+func TestCacheReserveGet(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"),
+ )
+ _, err := client.Cache.CacheReserve.Get(context.TODO(), cache.CacheReserveGetParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ })
+ 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())
+ }
+}
+
+func TestCacheReserveStatus(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"),
+ )
+ _, err := client.Cache.CacheReserve.Status(context.TODO(), cache.CacheReserveStatusParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ })
+ 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/cache/regionaltieredcache.go b/cache/regionaltieredcache.go
new file mode 100644
index 00000000000..ac0e2ade56e
--- /dev/null
+++ b/cache/regionaltieredcache.go
@@ -0,0 +1,405 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package cache
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// RegionalTieredCacheService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewRegionalTieredCacheService]
+// method instead.
+type RegionalTieredCacheService struct {
+ Options []option.RequestOption
+}
+
+// NewRegionalTieredCacheService generates a new service that applies the given
+// options to each request. These options are applied after the parent client's
+// options (if there is one), and before any request-specific options.
+func NewRegionalTieredCacheService(opts ...option.RequestOption) (r *RegionalTieredCacheService) {
+ r = &RegionalTieredCacheService{}
+ r.Options = opts
+ return
+}
+
+// Instructs Cloudflare to check a regional hub data center on the way to your
+// upper tier. This can help improve performance for smart and custom tiered cache
+// topologies.
+func (r *RegionalTieredCacheService) Edit(ctx context.Context, params RegionalTieredCacheEditParams, opts ...option.RequestOption) (res *RegionalTieredCacheEditResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RegionalTieredCacheEditResponseEnvelope
+ path := fmt.Sprintf("zones/%s/cache/regional_tiered_cache", params.ZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Instructs Cloudflare to check a regional hub data center on the way to your
+// upper tier. This can help improve performance for smart and custom tiered cache
+// topologies.
+func (r *RegionalTieredCacheService) Get(ctx context.Context, query RegionalTieredCacheGetParams, opts ...option.RequestOption) (res *RegionalTieredCacheGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RegionalTieredCacheGetResponseEnvelope
+ path := fmt.Sprintf("zones/%s/cache/regional_tiered_cache", query.ZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Instructs Cloudflare to check a regional hub data center on the way to your
+// upper tier. This can help improve performance for smart and custom tiered cache
+// topologies.
+type RegionalTieredCacheEditResponse struct {
+ // ID of the zone setting.
+ ID RegionalTieredCacheEditResponseID `json:"id,required"`
+ // last time this setting was modified.
+ ModifiedOn time.Time `json:"modified_on,required,nullable" format:"date-time"`
+ // Instructs Cloudflare to check a regional hub data center on the way to your
+ // upper tier. This can help improve performance for smart and custom tiered cache
+ // topologies.
+ Value RegionalTieredCacheEditResponseValue `json:"value,required"`
+ JSON regionalTieredCacheEditResponseJSON `json:"-"`
+}
+
+// regionalTieredCacheEditResponseJSON contains the JSON metadata for the struct
+// [RegionalTieredCacheEditResponse]
+type regionalTieredCacheEditResponseJSON struct {
+ ID apijson.Field
+ ModifiedOn apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RegionalTieredCacheEditResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r regionalTieredCacheEditResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+// ID of the zone setting.
+type RegionalTieredCacheEditResponseID string
+
+const (
+ RegionalTieredCacheEditResponseIDTcRegional RegionalTieredCacheEditResponseID = "tc_regional"
+)
+
+// Instructs Cloudflare to check a regional hub data center on the way to your
+// upper tier. This can help improve performance for smart and custom tiered cache
+// topologies.
+type RegionalTieredCacheEditResponseValue struct {
+ // ID of the zone setting.
+ ID RegionalTieredCacheEditResponseValueID `json:"id,required"`
+ // last time this setting was modified.
+ ModifiedOn time.Time `json:"modified_on,required,nullable" format:"date-time"`
+ JSON regionalTieredCacheEditResponseValueJSON `json:"-"`
+}
+
+// regionalTieredCacheEditResponseValueJSON contains the JSON metadata for the
+// struct [RegionalTieredCacheEditResponseValue]
+type regionalTieredCacheEditResponseValueJSON struct {
+ ID apijson.Field
+ ModifiedOn apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RegionalTieredCacheEditResponseValue) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r regionalTieredCacheEditResponseValueJSON) RawJSON() string {
+ return r.raw
+}
+
+// ID of the zone setting.
+type RegionalTieredCacheEditResponseValueID string
+
+const (
+ RegionalTieredCacheEditResponseValueIDTcRegional RegionalTieredCacheEditResponseValueID = "tc_regional"
+)
+
+// Instructs Cloudflare to check a regional hub data center on the way to your
+// upper tier. This can help improve performance for smart and custom tiered cache
+// topologies.
+type RegionalTieredCacheGetResponse struct {
+ // ID of the zone setting.
+ ID RegionalTieredCacheGetResponseID `json:"id,required"`
+ // last time this setting was modified.
+ ModifiedOn time.Time `json:"modified_on,required,nullable" format:"date-time"`
+ // Instructs Cloudflare to check a regional hub data center on the way to your
+ // upper tier. This can help improve performance for smart and custom tiered cache
+ // topologies.
+ Value RegionalTieredCacheGetResponseValue `json:"value,required"`
+ JSON regionalTieredCacheGetResponseJSON `json:"-"`
+}
+
+// regionalTieredCacheGetResponseJSON contains the JSON metadata for the struct
+// [RegionalTieredCacheGetResponse]
+type regionalTieredCacheGetResponseJSON struct {
+ ID apijson.Field
+ ModifiedOn apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RegionalTieredCacheGetResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r regionalTieredCacheGetResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+// ID of the zone setting.
+type RegionalTieredCacheGetResponseID string
+
+const (
+ RegionalTieredCacheGetResponseIDTcRegional RegionalTieredCacheGetResponseID = "tc_regional"
+)
+
+// Instructs Cloudflare to check a regional hub data center on the way to your
+// upper tier. This can help improve performance for smart and custom tiered cache
+// topologies.
+type RegionalTieredCacheGetResponseValue struct {
+ // ID of the zone setting.
+ ID RegionalTieredCacheGetResponseValueID `json:"id,required"`
+ // last time this setting was modified.
+ ModifiedOn time.Time `json:"modified_on,required,nullable" format:"date-time"`
+ JSON regionalTieredCacheGetResponseValueJSON `json:"-"`
+}
+
+// regionalTieredCacheGetResponseValueJSON contains the JSON metadata for the
+// struct [RegionalTieredCacheGetResponseValue]
+type regionalTieredCacheGetResponseValueJSON struct {
+ ID apijson.Field
+ ModifiedOn apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RegionalTieredCacheGetResponseValue) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r regionalTieredCacheGetResponseValueJSON) RawJSON() string {
+ return r.raw
+}
+
+// ID of the zone setting.
+type RegionalTieredCacheGetResponseValueID string
+
+const (
+ RegionalTieredCacheGetResponseValueIDTcRegional RegionalTieredCacheGetResponseValueID = "tc_regional"
+)
+
+type RegionalTieredCacheEditParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+ // Value of the Regional Tiered Cache zone setting.
+ Value param.Field[RegionalTieredCacheEditParamsValue] `json:"value,required"`
+}
+
+func (r RegionalTieredCacheEditParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Value of the Regional Tiered Cache zone setting.
+type RegionalTieredCacheEditParamsValue string
+
+const (
+ RegionalTieredCacheEditParamsValueOn RegionalTieredCacheEditParamsValue = "on"
+ RegionalTieredCacheEditParamsValueOff RegionalTieredCacheEditParamsValue = "off"
+)
+
+type RegionalTieredCacheEditResponseEnvelope struct {
+ Errors []RegionalTieredCacheEditResponseEnvelopeErrors `json:"errors,required"`
+ Messages []RegionalTieredCacheEditResponseEnvelopeMessages `json:"messages,required"`
+ // Instructs Cloudflare to check a regional hub data center on the way to your
+ // upper tier. This can help improve performance for smart and custom tiered cache
+ // topologies.
+ Result RegionalTieredCacheEditResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success RegionalTieredCacheEditResponseEnvelopeSuccess `json:"success,required"`
+ JSON regionalTieredCacheEditResponseEnvelopeJSON `json:"-"`
+}
+
+// regionalTieredCacheEditResponseEnvelopeJSON contains the JSON metadata for the
+// struct [RegionalTieredCacheEditResponseEnvelope]
+type regionalTieredCacheEditResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RegionalTieredCacheEditResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r regionalTieredCacheEditResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type RegionalTieredCacheEditResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON regionalTieredCacheEditResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// regionalTieredCacheEditResponseEnvelopeErrorsJSON contains the JSON metadata for
+// the struct [RegionalTieredCacheEditResponseEnvelopeErrors]
+type regionalTieredCacheEditResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RegionalTieredCacheEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r regionalTieredCacheEditResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type RegionalTieredCacheEditResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON regionalTieredCacheEditResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// regionalTieredCacheEditResponseEnvelopeMessagesJSON contains the JSON metadata
+// for the struct [RegionalTieredCacheEditResponseEnvelopeMessages]
+type regionalTieredCacheEditResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RegionalTieredCacheEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r regionalTieredCacheEditResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type RegionalTieredCacheEditResponseEnvelopeSuccess bool
+
+const (
+ RegionalTieredCacheEditResponseEnvelopeSuccessTrue RegionalTieredCacheEditResponseEnvelopeSuccess = true
+)
+
+type RegionalTieredCacheGetParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+}
+
+type RegionalTieredCacheGetResponseEnvelope struct {
+ Errors []RegionalTieredCacheGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []RegionalTieredCacheGetResponseEnvelopeMessages `json:"messages,required"`
+ // Instructs Cloudflare to check a regional hub data center on the way to your
+ // upper tier. This can help improve performance for smart and custom tiered cache
+ // topologies.
+ Result RegionalTieredCacheGetResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success RegionalTieredCacheGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON regionalTieredCacheGetResponseEnvelopeJSON `json:"-"`
+}
+
+// regionalTieredCacheGetResponseEnvelopeJSON contains the JSON metadata for the
+// struct [RegionalTieredCacheGetResponseEnvelope]
+type regionalTieredCacheGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RegionalTieredCacheGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r regionalTieredCacheGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type RegionalTieredCacheGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON regionalTieredCacheGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// regionalTieredCacheGetResponseEnvelopeErrorsJSON contains the JSON metadata for
+// the struct [RegionalTieredCacheGetResponseEnvelopeErrors]
+type regionalTieredCacheGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RegionalTieredCacheGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r regionalTieredCacheGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type RegionalTieredCacheGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON regionalTieredCacheGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// regionalTieredCacheGetResponseEnvelopeMessagesJSON contains the JSON metadata
+// for the struct [RegionalTieredCacheGetResponseEnvelopeMessages]
+type regionalTieredCacheGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RegionalTieredCacheGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r regionalTieredCacheGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type RegionalTieredCacheGetResponseEnvelopeSuccess bool
+
+const (
+ RegionalTieredCacheGetResponseEnvelopeSuccessTrue RegionalTieredCacheGetResponseEnvelopeSuccess = true
+)
diff --git a/cache/regionaltieredcache_test.go b/cache/regionaltieredcache_test.go
new file mode 100644
index 00000000000..00cee364604
--- /dev/null
+++ b/cache/regionaltieredcache_test.go
@@ -0,0 +1,68 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package cache_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/cache"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestRegionalTieredCacheEdit(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"),
+ )
+ _, err := client.Cache.RegionalTieredCache.Edit(context.TODO(), cache.RegionalTieredCacheEditParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Value: cloudflare.F(cache.RegionalTieredCacheEditParamsValueOn),
+ })
+ 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())
+ }
+}
+
+func TestRegionalTieredCacheGet(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"),
+ )
+ _, err := client.Cache.RegionalTieredCache.Get(context.TODO(), cache.RegionalTieredCacheGetParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ })
+ 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/cache/smarttieredcached.go b/cache/smarttieredcached.go
new file mode 100644
index 00000000000..be5cc9b0a25
--- /dev/null
+++ b/cache/smarttieredcached.go
@@ -0,0 +1,397 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package cache
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "reflect"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/tidwall/gjson"
+)
+
+// SmartTieredCachedService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewSmartTieredCachedService] method
+// instead.
+type SmartTieredCachedService struct {
+ Options []option.RequestOption
+}
+
+// NewSmartTieredCachedService generates a new service that applies the given
+// options to each request. These options are applied after the parent client's
+// options (if there is one), and before any request-specific options.
+func NewSmartTieredCachedService(opts ...option.RequestOption) (r *SmartTieredCachedService) {
+ r = &SmartTieredCachedService{}
+ r.Options = opts
+ return
+}
+
+// Remvoves enablement of Smart Tiered Cache
+func (r *SmartTieredCachedService) Delete(ctx context.Context, body SmartTieredCachedDeleteParams, opts ...option.RequestOption) (res *SmartTieredCachedDeleteResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env SmartTieredCachedDeleteResponseEnvelope
+ path := fmt.Sprintf("zones/%s/cache/tiered_cache_smart_topology_enable", body.ZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Updates enablement of Tiered Cache
+func (r *SmartTieredCachedService) Edit(ctx context.Context, params SmartTieredCachedEditParams, opts ...option.RequestOption) (res *SmartTieredCachedEditResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env SmartTieredCachedEditResponseEnvelope
+ path := fmt.Sprintf("zones/%s/cache/tiered_cache_smart_topology_enable", params.ZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Get Smart Tiered Cache setting
+func (r *SmartTieredCachedService) Get(ctx context.Context, query SmartTieredCachedGetParams, opts ...option.RequestOption) (res *SmartTieredCachedGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env SmartTieredCachedGetResponseEnvelope
+ path := fmt.Sprintf("zones/%s/cache/tiered_cache_smart_topology_enable", query.ZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Union satisfied by [cache.SmartTieredCachedDeleteResponseUnknown] or
+// [shared.UnionString].
+type SmartTieredCachedDeleteResponse interface {
+ ImplementsCacheSmartTieredCachedDeleteResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*SmartTieredCachedDeleteResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+// Union satisfied by [cache.SmartTieredCachedEditResponseUnknown] or
+// [shared.UnionString].
+type SmartTieredCachedEditResponse interface {
+ ImplementsCacheSmartTieredCachedEditResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*SmartTieredCachedEditResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+// Union satisfied by [cache.SmartTieredCachedGetResponseUnknown] or
+// [shared.UnionString].
+type SmartTieredCachedGetResponse interface {
+ ImplementsCacheSmartTieredCachedGetResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*SmartTieredCachedGetResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+type SmartTieredCachedDeleteParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+}
+
+type SmartTieredCachedDeleteResponseEnvelope struct {
+ Errors []SmartTieredCachedDeleteResponseEnvelopeErrors `json:"errors,required"`
+ Messages []SmartTieredCachedDeleteResponseEnvelopeMessages `json:"messages,required"`
+ Result SmartTieredCachedDeleteResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success SmartTieredCachedDeleteResponseEnvelopeSuccess `json:"success,required"`
+ JSON smartTieredCachedDeleteResponseEnvelopeJSON `json:"-"`
+}
+
+// smartTieredCachedDeleteResponseEnvelopeJSON contains the JSON metadata for the
+// struct [SmartTieredCachedDeleteResponseEnvelope]
+type smartTieredCachedDeleteResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *SmartTieredCachedDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r smartTieredCachedDeleteResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type SmartTieredCachedDeleteResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON smartTieredCachedDeleteResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// smartTieredCachedDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for
+// the struct [SmartTieredCachedDeleteResponseEnvelopeErrors]
+type smartTieredCachedDeleteResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *SmartTieredCachedDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r smartTieredCachedDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type SmartTieredCachedDeleteResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON smartTieredCachedDeleteResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// smartTieredCachedDeleteResponseEnvelopeMessagesJSON contains the JSON metadata
+// for the struct [SmartTieredCachedDeleteResponseEnvelopeMessages]
+type smartTieredCachedDeleteResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *SmartTieredCachedDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r smartTieredCachedDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type SmartTieredCachedDeleteResponseEnvelopeSuccess bool
+
+const (
+ SmartTieredCachedDeleteResponseEnvelopeSuccessTrue SmartTieredCachedDeleteResponseEnvelopeSuccess = true
+)
+
+type SmartTieredCachedEditParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+ // Enables Tiered Cache.
+ Value param.Field[SmartTieredCachedEditParamsValue] `json:"value,required"`
+}
+
+func (r SmartTieredCachedEditParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Enables Tiered Cache.
+type SmartTieredCachedEditParamsValue string
+
+const (
+ SmartTieredCachedEditParamsValueOn SmartTieredCachedEditParamsValue = "on"
+ SmartTieredCachedEditParamsValueOff SmartTieredCachedEditParamsValue = "off"
+)
+
+type SmartTieredCachedEditResponseEnvelope struct {
+ Errors []SmartTieredCachedEditResponseEnvelopeErrors `json:"errors,required"`
+ Messages []SmartTieredCachedEditResponseEnvelopeMessages `json:"messages,required"`
+ Result SmartTieredCachedEditResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success SmartTieredCachedEditResponseEnvelopeSuccess `json:"success,required"`
+ JSON smartTieredCachedEditResponseEnvelopeJSON `json:"-"`
+}
+
+// smartTieredCachedEditResponseEnvelopeJSON contains the JSON metadata for the
+// struct [SmartTieredCachedEditResponseEnvelope]
+type smartTieredCachedEditResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *SmartTieredCachedEditResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r smartTieredCachedEditResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type SmartTieredCachedEditResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON smartTieredCachedEditResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// smartTieredCachedEditResponseEnvelopeErrorsJSON contains the JSON metadata for
+// the struct [SmartTieredCachedEditResponseEnvelopeErrors]
+type smartTieredCachedEditResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *SmartTieredCachedEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r smartTieredCachedEditResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type SmartTieredCachedEditResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON smartTieredCachedEditResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// smartTieredCachedEditResponseEnvelopeMessagesJSON contains the JSON metadata for
+// the struct [SmartTieredCachedEditResponseEnvelopeMessages]
+type smartTieredCachedEditResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *SmartTieredCachedEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r smartTieredCachedEditResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type SmartTieredCachedEditResponseEnvelopeSuccess bool
+
+const (
+ SmartTieredCachedEditResponseEnvelopeSuccessTrue SmartTieredCachedEditResponseEnvelopeSuccess = true
+)
+
+type SmartTieredCachedGetParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+}
+
+type SmartTieredCachedGetResponseEnvelope struct {
+ Errors []SmartTieredCachedGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []SmartTieredCachedGetResponseEnvelopeMessages `json:"messages,required"`
+ Result SmartTieredCachedGetResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success SmartTieredCachedGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON smartTieredCachedGetResponseEnvelopeJSON `json:"-"`
+}
+
+// smartTieredCachedGetResponseEnvelopeJSON contains the JSON metadata for the
+// struct [SmartTieredCachedGetResponseEnvelope]
+type smartTieredCachedGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *SmartTieredCachedGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r smartTieredCachedGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type SmartTieredCachedGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON smartTieredCachedGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// smartTieredCachedGetResponseEnvelopeErrorsJSON contains the JSON metadata for
+// the struct [SmartTieredCachedGetResponseEnvelopeErrors]
+type smartTieredCachedGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *SmartTieredCachedGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r smartTieredCachedGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type SmartTieredCachedGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON smartTieredCachedGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// smartTieredCachedGetResponseEnvelopeMessagesJSON contains the JSON metadata for
+// the struct [SmartTieredCachedGetResponseEnvelopeMessages]
+type smartTieredCachedGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *SmartTieredCachedGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r smartTieredCachedGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type SmartTieredCachedGetResponseEnvelopeSuccess bool
+
+const (
+ SmartTieredCachedGetResponseEnvelopeSuccessTrue SmartTieredCachedGetResponseEnvelopeSuccess = true
+)
diff --git a/cache/smarttieredcached_test.go b/cache/smarttieredcached_test.go
new file mode 100644
index 00000000000..45cafafd6e4
--- /dev/null
+++ b/cache/smarttieredcached_test.go
@@ -0,0 +1,94 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package cache_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/cache"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestSmartTieredCachedDelete(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"),
+ )
+ _, err := client.Cache.SmartTieredCached.Delete(context.TODO(), cache.SmartTieredCachedDeleteParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ })
+ 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())
+ }
+}
+
+func TestSmartTieredCachedEdit(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"),
+ )
+ _, err := client.Cache.SmartTieredCached.Edit(context.TODO(), cache.SmartTieredCachedEditParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Value: cloudflare.F(cache.SmartTieredCachedEditParamsValueOn),
+ })
+ 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())
+ }
+}
+
+func TestSmartTieredCachedGet(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"),
+ )
+ _, err := client.Cache.SmartTieredCached.Get(context.TODO(), cache.SmartTieredCachedGetParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ })
+ 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/cache/variant.go b/cache/variant.go
new file mode 100644
index 00000000000..7990520c43e
--- /dev/null
+++ b/cache/variant.go
@@ -0,0 +1,647 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package cache
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// VariantService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewVariantService] method instead.
+type VariantService struct {
+ Options []option.RequestOption
+}
+
+// NewVariantService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewVariantService(opts ...option.RequestOption) (r *VariantService) {
+ r = &VariantService{}
+ r.Options = opts
+ return
+}
+
+// Variant support enables caching variants of images with certain file extensions
+// in addition to the original. This only applies when the origin server sends the
+// 'Vary: Accept' response header. If the origin server sends 'Vary: Accept' but
+// does not serve the variant requested, the response will not be cached. This will
+// be indicated with BYPASS cache status in the response headers.
+func (r *VariantService) Delete(ctx context.Context, body VariantDeleteParams, opts ...option.RequestOption) (res *CacheVariants, err error) {
+ opts = append(r.Options[:], opts...)
+ var env VariantDeleteResponseEnvelope
+ path := fmt.Sprintf("zones/%s/cache/variants", body.ZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Variant support enables caching variants of images with certain file extensions
+// in addition to the original. This only applies when the origin server sends the
+// 'Vary: Accept' response header. If the origin server sends 'Vary: Accept' but
+// does not serve the variant requested, the response will not be cached. This will
+// be indicated with BYPASS cache status in the response headers.
+func (r *VariantService) Edit(ctx context.Context, params VariantEditParams, opts ...option.RequestOption) (res *VariantEditResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env VariantEditResponseEnvelope
+ path := fmt.Sprintf("zones/%s/cache/variants", params.ZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Variant support enables caching variants of images with certain file extensions
+// in addition to the original. This only applies when the origin server sends the
+// 'Vary: Accept' response header. If the origin server sends 'Vary: Accept' but
+// does not serve the variant requested, the response will not be cached. This will
+// be indicated with BYPASS cache status in the response headers.
+func (r *VariantService) Get(ctx context.Context, query VariantGetParams, opts ...option.RequestOption) (res *VariantGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env VariantGetResponseEnvelope
+ path := fmt.Sprintf("zones/%s/cache/variants", query.ZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Variant support enables caching variants of images with certain file extensions
+// in addition to the original. This only applies when the origin server sends the
+// 'Vary: Accept' response header. If the origin server sends 'Vary: Accept' but
+// does not serve the variant requested, the response will not be cached. This will
+// be indicated with BYPASS cache status in the response headers.
+type CacheVariants struct {
+ // ID of the zone setting.
+ ID CacheVariantsID `json:"id,required"`
+ // last time this setting was modified.
+ ModifiedOn time.Time `json:"modified_on,required,nullable" format:"date-time"`
+ JSON cacheVariantsJSON `json:"-"`
+}
+
+// cacheVariantsJSON contains the JSON metadata for the struct [CacheVariants]
+type cacheVariantsJSON struct {
+ ID apijson.Field
+ ModifiedOn apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CacheVariants) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r cacheVariantsJSON) RawJSON() string {
+ return r.raw
+}
+
+// ID of the zone setting.
+type CacheVariantsID string
+
+const (
+ CacheVariantsIDVariants CacheVariantsID = "variants"
+)
+
+// Variant support enables caching variants of images with certain file extensions
+// in addition to the original. This only applies when the origin server sends the
+// 'Vary: Accept' response header. If the origin server sends 'Vary: Accept' but
+// does not serve the variant requested, the response will not be cached. This will
+// be indicated with BYPASS cache status in the response headers.
+type VariantEditResponse struct {
+ // ID of the zone setting.
+ ID VariantEditResponseID `json:"id,required"`
+ // last time this setting was modified.
+ ModifiedOn time.Time `json:"modified_on,required,nullable" format:"date-time"`
+ // Value of the zone setting.
+ Value VariantEditResponseValue `json:"value,required"`
+ JSON variantEditResponseJSON `json:"-"`
+}
+
+// variantEditResponseJSON contains the JSON metadata for the struct
+// [VariantEditResponse]
+type variantEditResponseJSON struct {
+ ID apijson.Field
+ ModifiedOn apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *VariantEditResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r variantEditResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+// ID of the zone setting.
+type VariantEditResponseID string
+
+const (
+ VariantEditResponseIDVariants VariantEditResponseID = "variants"
+)
+
+// Value of the zone setting.
+type VariantEditResponseValue struct {
+ // List of strings with the MIME types of all the variants that should be served
+ // for avif.
+ Avif []interface{} `json:"avif"`
+ // List of strings with the MIME types of all the variants that should be served
+ // for bmp.
+ Bmp []interface{} `json:"bmp"`
+ // List of strings with the MIME types of all the variants that should be served
+ // for gif.
+ Gif []interface{} `json:"gif"`
+ // List of strings with the MIME types of all the variants that should be served
+ // for jp2.
+ Jp2 []interface{} `json:"jp2"`
+ // List of strings with the MIME types of all the variants that should be served
+ // for jpeg.
+ Jpeg []interface{} `json:"jpeg"`
+ // List of strings with the MIME types of all the variants that should be served
+ // for jpg.
+ Jpg []interface{} `json:"jpg"`
+ // List of strings with the MIME types of all the variants that should be served
+ // for jpg2.
+ Jpg2 []interface{} `json:"jpg2"`
+ // List of strings with the MIME types of all the variants that should be served
+ // for png.
+ Png []interface{} `json:"png"`
+ // List of strings with the MIME types of all the variants that should be served
+ // for tif.
+ Tif []interface{} `json:"tif"`
+ // List of strings with the MIME types of all the variants that should be served
+ // for tiff.
+ Tiff []interface{} `json:"tiff"`
+ // List of strings with the MIME types of all the variants that should be served
+ // for webp.
+ Webp []interface{} `json:"webp"`
+ JSON variantEditResponseValueJSON `json:"-"`
+}
+
+// variantEditResponseValueJSON contains the JSON metadata for the struct
+// [VariantEditResponseValue]
+type variantEditResponseValueJSON struct {
+ Avif apijson.Field
+ Bmp apijson.Field
+ Gif apijson.Field
+ Jp2 apijson.Field
+ Jpeg apijson.Field
+ Jpg apijson.Field
+ Jpg2 apijson.Field
+ Png apijson.Field
+ Tif apijson.Field
+ Tiff apijson.Field
+ Webp apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *VariantEditResponseValue) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r variantEditResponseValueJSON) RawJSON() string {
+ return r.raw
+}
+
+// Variant support enables caching variants of images with certain file extensions
+// in addition to the original. This only applies when the origin server sends the
+// 'Vary: Accept' response header. If the origin server sends 'Vary: Accept' but
+// does not serve the variant requested, the response will not be cached. This will
+// be indicated with BYPASS cache status in the response headers.
+type VariantGetResponse struct {
+ // ID of the zone setting.
+ ID VariantGetResponseID `json:"id,required"`
+ // last time this setting was modified.
+ ModifiedOn time.Time `json:"modified_on,required,nullable" format:"date-time"`
+ // Value of the zone setting.
+ Value VariantGetResponseValue `json:"value,required"`
+ JSON variantGetResponseJSON `json:"-"`
+}
+
+// variantGetResponseJSON contains the JSON metadata for the struct
+// [VariantGetResponse]
+type variantGetResponseJSON struct {
+ ID apijson.Field
+ ModifiedOn apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *VariantGetResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r variantGetResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+// ID of the zone setting.
+type VariantGetResponseID string
+
+const (
+ VariantGetResponseIDVariants VariantGetResponseID = "variants"
+)
+
+// Value of the zone setting.
+type VariantGetResponseValue struct {
+ // List of strings with the MIME types of all the variants that should be served
+ // for avif.
+ Avif []interface{} `json:"avif"`
+ // List of strings with the MIME types of all the variants that should be served
+ // for bmp.
+ Bmp []interface{} `json:"bmp"`
+ // List of strings with the MIME types of all the variants that should be served
+ // for gif.
+ Gif []interface{} `json:"gif"`
+ // List of strings with the MIME types of all the variants that should be served
+ // for jp2.
+ Jp2 []interface{} `json:"jp2"`
+ // List of strings with the MIME types of all the variants that should be served
+ // for jpeg.
+ Jpeg []interface{} `json:"jpeg"`
+ // List of strings with the MIME types of all the variants that should be served
+ // for jpg.
+ Jpg []interface{} `json:"jpg"`
+ // List of strings with the MIME types of all the variants that should be served
+ // for jpg2.
+ Jpg2 []interface{} `json:"jpg2"`
+ // List of strings with the MIME types of all the variants that should be served
+ // for png.
+ Png []interface{} `json:"png"`
+ // List of strings with the MIME types of all the variants that should be served
+ // for tif.
+ Tif []interface{} `json:"tif"`
+ // List of strings with the MIME types of all the variants that should be served
+ // for tiff.
+ Tiff []interface{} `json:"tiff"`
+ // List of strings with the MIME types of all the variants that should be served
+ // for webp.
+ Webp []interface{} `json:"webp"`
+ JSON variantGetResponseValueJSON `json:"-"`
+}
+
+// variantGetResponseValueJSON contains the JSON metadata for the struct
+// [VariantGetResponseValue]
+type variantGetResponseValueJSON struct {
+ Avif apijson.Field
+ Bmp apijson.Field
+ Gif apijson.Field
+ Jp2 apijson.Field
+ Jpeg apijson.Field
+ Jpg apijson.Field
+ Jpg2 apijson.Field
+ Png apijson.Field
+ Tif apijson.Field
+ Tiff apijson.Field
+ Webp apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *VariantGetResponseValue) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r variantGetResponseValueJSON) RawJSON() string {
+ return r.raw
+}
+
+type VariantDeleteParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+}
+
+type VariantDeleteResponseEnvelope struct {
+ Errors []VariantDeleteResponseEnvelopeErrors `json:"errors,required"`
+ Messages []VariantDeleteResponseEnvelopeMessages `json:"messages,required"`
+ // Variant support enables caching variants of images with certain file extensions
+ // in addition to the original. This only applies when the origin server sends the
+ // 'Vary: Accept' response header. If the origin server sends 'Vary: Accept' but
+ // does not serve the variant requested, the response will not be cached. This will
+ // be indicated with BYPASS cache status in the response headers.
+ Result CacheVariants `json:"result,required"`
+ // Whether the API call was successful
+ Success VariantDeleteResponseEnvelopeSuccess `json:"success,required"`
+ JSON variantDeleteResponseEnvelopeJSON `json:"-"`
+}
+
+// variantDeleteResponseEnvelopeJSON contains the JSON metadata for the struct
+// [VariantDeleteResponseEnvelope]
+type variantDeleteResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *VariantDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r variantDeleteResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type VariantDeleteResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON variantDeleteResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// variantDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [VariantDeleteResponseEnvelopeErrors]
+type variantDeleteResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *VariantDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r variantDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type VariantDeleteResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON variantDeleteResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// variantDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [VariantDeleteResponseEnvelopeMessages]
+type variantDeleteResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *VariantDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r variantDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type VariantDeleteResponseEnvelopeSuccess bool
+
+const (
+ VariantDeleteResponseEnvelopeSuccessTrue VariantDeleteResponseEnvelopeSuccess = true
+)
+
+type VariantEditParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+ // Value of the zone setting.
+ Value param.Field[VariantEditParamsValue] `json:"value,required"`
+}
+
+func (r VariantEditParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Value of the zone setting.
+type VariantEditParamsValue struct {
+ // List of strings with the MIME types of all the variants that should be served
+ // for avif.
+ Avif param.Field[[]interface{}] `json:"avif"`
+ // List of strings with the MIME types of all the variants that should be served
+ // for bmp.
+ Bmp param.Field[[]interface{}] `json:"bmp"`
+ // List of strings with the MIME types of all the variants that should be served
+ // for gif.
+ Gif param.Field[[]interface{}] `json:"gif"`
+ // List of strings with the MIME types of all the variants that should be served
+ // for jp2.
+ Jp2 param.Field[[]interface{}] `json:"jp2"`
+ // List of strings with the MIME types of all the variants that should be served
+ // for jpeg.
+ Jpeg param.Field[[]interface{}] `json:"jpeg"`
+ // List of strings with the MIME types of all the variants that should be served
+ // for jpg.
+ Jpg param.Field[[]interface{}] `json:"jpg"`
+ // List of strings with the MIME types of all the variants that should be served
+ // for jpg2.
+ Jpg2 param.Field[[]interface{}] `json:"jpg2"`
+ // List of strings with the MIME types of all the variants that should be served
+ // for png.
+ Png param.Field[[]interface{}] `json:"png"`
+ // List of strings with the MIME types of all the variants that should be served
+ // for tif.
+ Tif param.Field[[]interface{}] `json:"tif"`
+ // List of strings with the MIME types of all the variants that should be served
+ // for tiff.
+ Tiff param.Field[[]interface{}] `json:"tiff"`
+ // List of strings with the MIME types of all the variants that should be served
+ // for webp.
+ Webp param.Field[[]interface{}] `json:"webp"`
+}
+
+func (r VariantEditParamsValue) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type VariantEditResponseEnvelope struct {
+ Errors []VariantEditResponseEnvelopeErrors `json:"errors,required"`
+ Messages []VariantEditResponseEnvelopeMessages `json:"messages,required"`
+ // Variant support enables caching variants of images with certain file extensions
+ // in addition to the original. This only applies when the origin server sends the
+ // 'Vary: Accept' response header. If the origin server sends 'Vary: Accept' but
+ // does not serve the variant requested, the response will not be cached. This will
+ // be indicated with BYPASS cache status in the response headers.
+ Result VariantEditResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success VariantEditResponseEnvelopeSuccess `json:"success,required"`
+ JSON variantEditResponseEnvelopeJSON `json:"-"`
+}
+
+// variantEditResponseEnvelopeJSON contains the JSON metadata for the struct
+// [VariantEditResponseEnvelope]
+type variantEditResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *VariantEditResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r variantEditResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type VariantEditResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON variantEditResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// variantEditResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [VariantEditResponseEnvelopeErrors]
+type variantEditResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *VariantEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r variantEditResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type VariantEditResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON variantEditResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// variantEditResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [VariantEditResponseEnvelopeMessages]
+type variantEditResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *VariantEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r variantEditResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type VariantEditResponseEnvelopeSuccess bool
+
+const (
+ VariantEditResponseEnvelopeSuccessTrue VariantEditResponseEnvelopeSuccess = true
+)
+
+type VariantGetParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+}
+
+type VariantGetResponseEnvelope struct {
+ Errors []VariantGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []VariantGetResponseEnvelopeMessages `json:"messages,required"`
+ // Variant support enables caching variants of images with certain file extensions
+ // in addition to the original. This only applies when the origin server sends the
+ // 'Vary: Accept' response header. If the origin server sends 'Vary: Accept' but
+ // does not serve the variant requested, the response will not be cached. This will
+ // be indicated with BYPASS cache status in the response headers.
+ Result VariantGetResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success VariantGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON variantGetResponseEnvelopeJSON `json:"-"`
+}
+
+// variantGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [VariantGetResponseEnvelope]
+type variantGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *VariantGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r variantGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type VariantGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON variantGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// variantGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [VariantGetResponseEnvelopeErrors]
+type variantGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *VariantGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r variantGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type VariantGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON variantGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// variantGetResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [VariantGetResponseEnvelopeMessages]
+type variantGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *VariantGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r variantGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type VariantGetResponseEnvelopeSuccess bool
+
+const (
+ VariantGetResponseEnvelopeSuccessTrue VariantGetResponseEnvelopeSuccess = true
+)
diff --git a/cache/variant_test.go b/cache/variant_test.go
new file mode 100644
index 00000000000..14d9915c8fd
--- /dev/null
+++ b/cache/variant_test.go
@@ -0,0 +1,106 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package cache_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/cache"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestVariantDelete(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"),
+ )
+ _, err := client.Cache.Variants.Delete(context.TODO(), cache.VariantDeleteParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ })
+ 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())
+ }
+}
+
+func TestVariantEditWithOptionalParams(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"),
+ )
+ _, err := client.Cache.Variants.Edit(context.TODO(), cache.VariantEditParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Value: cloudflare.F(cache.VariantEditParamsValue{
+ Avif: cloudflare.F([]interface{}{"image/webp", "image/jpeg"}),
+ Bmp: cloudflare.F([]interface{}{"image/webp", "image/jpeg"}),
+ Gif: cloudflare.F([]interface{}{"image/webp", "image/jpeg"}),
+ Jp2: cloudflare.F([]interface{}{"image/webp", "image/avif"}),
+ Jpeg: cloudflare.F([]interface{}{"image/webp", "image/avif"}),
+ Jpg: cloudflare.F([]interface{}{"image/webp", "image/avif"}),
+ Jpg2: cloudflare.F([]interface{}{"image/webp", "image/avif"}),
+ Png: cloudflare.F([]interface{}{"image/webp", "image/avif"}),
+ Tif: cloudflare.F([]interface{}{"image/webp", "image/avif"}),
+ Tiff: cloudflare.F([]interface{}{"image/webp", "image/avif"}),
+ Webp: cloudflare.F([]interface{}{"image/jpeg", "image/avif"}),
+ }),
+ })
+ 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())
+ }
+}
+
+func TestVariantGet(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"),
+ )
+ _, err := client.Cache.Variants.Get(context.TODO(), cache.VariantGetParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ })
+ 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/cachecachereserve.go b/cachecachereserve.go
deleted file mode 100644
index f3c6c52f4fa..00000000000
--- a/cachecachereserve.go
+++ /dev/null
@@ -1,683 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// CacheCacheReserveService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewCacheCacheReserveService] method
-// instead.
-type CacheCacheReserveService struct {
- Options []option.RequestOption
-}
-
-// NewCacheCacheReserveService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewCacheCacheReserveService(opts ...option.RequestOption) (r *CacheCacheReserveService) {
- r = &CacheCacheReserveService{}
- r.Options = opts
- return
-}
-
-// You can use Cache Reserve Clear to clear your Cache Reserve, but you must first
-// disable Cache Reserve. In most cases, this will be accomplished within 24 hours.
-// You cannot re-enable Cache Reserve while this process is ongoing. Keep in mind
-// that you cannot undo or cancel this operation.
-func (r *CacheCacheReserveService) Clear(ctx context.Context, body CacheCacheReserveClearParams, opts ...option.RequestOption) (res *CacheCacheReserveClearResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env CacheCacheReserveClearResponseEnvelope
- path := fmt.Sprintf("zones/%s/cache/cache_reserve_clear", body.ZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Increase cache lifetimes by automatically storing all cacheable files into
-// Cloudflare's persistent object storage buckets. Requires Cache Reserve
-// subscription. Note: using Tiered Cache with Cache Reserve is highly recommended
-// to reduce Reserve operations costs. See the
-// [developer docs](https://developers.cloudflare.com/cache/about/cache-reserve)
-// for more information.
-func (r *CacheCacheReserveService) Edit(ctx context.Context, params CacheCacheReserveEditParams, opts ...option.RequestOption) (res *CacheCacheReserveEditResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env CacheCacheReserveEditResponseEnvelope
- path := fmt.Sprintf("zones/%s/cache/cache_reserve", params.ZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Increase cache lifetimes by automatically storing all cacheable files into
-// Cloudflare's persistent object storage buckets. Requires Cache Reserve
-// subscription. Note: using Tiered Cache with Cache Reserve is highly recommended
-// to reduce Reserve operations costs. See the
-// [developer docs](https://developers.cloudflare.com/cache/about/cache-reserve)
-// for more information.
-func (r *CacheCacheReserveService) Get(ctx context.Context, query CacheCacheReserveGetParams, opts ...option.RequestOption) (res *CacheCacheReserveGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env CacheCacheReserveGetResponseEnvelope
- path := fmt.Sprintf("zones/%s/cache/cache_reserve", query.ZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// You can use Cache Reserve Clear to clear your Cache Reserve, but you must first
-// disable Cache Reserve. In most cases, this will be accomplished within 24 hours.
-// You cannot re-enable Cache Reserve while this process is ongoing. Keep in mind
-// that you cannot undo or cancel this operation.
-func (r *CacheCacheReserveService) Status(ctx context.Context, query CacheCacheReserveStatusParams, opts ...option.RequestOption) (res *CacheCacheReserveStatusResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env CacheCacheReserveStatusResponseEnvelope
- path := fmt.Sprintf("zones/%s/cache/cache_reserve_clear", query.ZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// You can use Cache Reserve Clear to clear your Cache Reserve, but you must first
-// disable Cache Reserve. In most cases, this will be accomplished within 24 hours.
-// You cannot re-enable Cache Reserve while this process is ongoing. Keep in mind
-// that you cannot undo or cancel this operation.
-type CacheCacheReserveClearResponse struct {
- // ID of the zone setting.
- ID CacheCacheReserveClearResponseID `json:"id,required"`
- // last time this setting was modified.
- ModifiedOn time.Time `json:"modified_on,required,nullable" format:"date-time"`
- // The time that the latest Cache Reserve Clear operation started.
- StartTs time.Time `json:"start_ts,required" format:"date-time"`
- // The current state of the Cache Reserve Clear operation.
- State CacheCacheReserveClearResponseState `json:"state,required"`
- // The time that the latest Cache Reserve Clear operation completed.
- EndTs time.Time `json:"end_ts" format:"date-time"`
- JSON cacheCacheReserveClearResponseJSON `json:"-"`
-}
-
-// cacheCacheReserveClearResponseJSON contains the JSON metadata for the struct
-// [CacheCacheReserveClearResponse]
-type cacheCacheReserveClearResponseJSON struct {
- ID apijson.Field
- ModifiedOn apijson.Field
- StartTs apijson.Field
- State apijson.Field
- EndTs apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CacheCacheReserveClearResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cacheCacheReserveClearResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// ID of the zone setting.
-type CacheCacheReserveClearResponseID string
-
-const (
- CacheCacheReserveClearResponseIDCacheReserveClear CacheCacheReserveClearResponseID = "cache_reserve_clear"
-)
-
-// The current state of the Cache Reserve Clear operation.
-type CacheCacheReserveClearResponseState string
-
-const (
- CacheCacheReserveClearResponseStateInProgress CacheCacheReserveClearResponseState = "In-progress"
- CacheCacheReserveClearResponseStateCompleted CacheCacheReserveClearResponseState = "Completed"
-)
-
-// Increase cache lifetimes by automatically storing all cacheable files into
-// Cloudflare's persistent object storage buckets. Requires Cache Reserve
-// subscription. Note: using Tiered Cache with Cache Reserve is highly recommended
-// to reduce Reserve operations costs. See the
-// [developer docs](https://developers.cloudflare.com/cache/about/cache-reserve)
-// for more information.
-type CacheCacheReserveEditResponse struct {
- // ID of the zone setting.
- ID CacheCacheReserveEditResponseID `json:"id,required"`
- // last time this setting was modified.
- ModifiedOn time.Time `json:"modified_on,required,nullable" format:"date-time"`
- // Value of the Cache Reserve zone setting.
- Value CacheCacheReserveEditResponseValue `json:"value,required"`
- JSON cacheCacheReserveEditResponseJSON `json:"-"`
-}
-
-// cacheCacheReserveEditResponseJSON contains the JSON metadata for the struct
-// [CacheCacheReserveEditResponse]
-type cacheCacheReserveEditResponseJSON struct {
- ID apijson.Field
- ModifiedOn apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CacheCacheReserveEditResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cacheCacheReserveEditResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// ID of the zone setting.
-type CacheCacheReserveEditResponseID string
-
-const (
- CacheCacheReserveEditResponseIDCacheReserve CacheCacheReserveEditResponseID = "cache_reserve"
-)
-
-// Value of the Cache Reserve zone setting.
-type CacheCacheReserveEditResponseValue string
-
-const (
- CacheCacheReserveEditResponseValueOn CacheCacheReserveEditResponseValue = "on"
- CacheCacheReserveEditResponseValueOff CacheCacheReserveEditResponseValue = "off"
-)
-
-// Increase cache lifetimes by automatically storing all cacheable files into
-// Cloudflare's persistent object storage buckets. Requires Cache Reserve
-// subscription. Note: using Tiered Cache with Cache Reserve is highly recommended
-// to reduce Reserve operations costs. See the
-// [developer docs](https://developers.cloudflare.com/cache/about/cache-reserve)
-// for more information.
-type CacheCacheReserveGetResponse struct {
- // ID of the zone setting.
- ID CacheCacheReserveGetResponseID `json:"id,required"`
- // last time this setting was modified.
- ModifiedOn time.Time `json:"modified_on,required,nullable" format:"date-time"`
- // Value of the Cache Reserve zone setting.
- Value CacheCacheReserveGetResponseValue `json:"value,required"`
- JSON cacheCacheReserveGetResponseJSON `json:"-"`
-}
-
-// cacheCacheReserveGetResponseJSON contains the JSON metadata for the struct
-// [CacheCacheReserveGetResponse]
-type cacheCacheReserveGetResponseJSON struct {
- ID apijson.Field
- ModifiedOn apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CacheCacheReserveGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cacheCacheReserveGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// ID of the zone setting.
-type CacheCacheReserveGetResponseID string
-
-const (
- CacheCacheReserveGetResponseIDCacheReserve CacheCacheReserveGetResponseID = "cache_reserve"
-)
-
-// Value of the Cache Reserve zone setting.
-type CacheCacheReserveGetResponseValue string
-
-const (
- CacheCacheReserveGetResponseValueOn CacheCacheReserveGetResponseValue = "on"
- CacheCacheReserveGetResponseValueOff CacheCacheReserveGetResponseValue = "off"
-)
-
-// You can use Cache Reserve Clear to clear your Cache Reserve, but you must first
-// disable Cache Reserve. In most cases, this will be accomplished within 24 hours.
-// You cannot re-enable Cache Reserve while this process is ongoing. Keep in mind
-// that you cannot undo or cancel this operation.
-type CacheCacheReserveStatusResponse struct {
- // ID of the zone setting.
- ID CacheCacheReserveStatusResponseID `json:"id,required"`
- // last time this setting was modified.
- ModifiedOn time.Time `json:"modified_on,required,nullable" format:"date-time"`
- // The time that the latest Cache Reserve Clear operation started.
- StartTs time.Time `json:"start_ts,required" format:"date-time"`
- // The current state of the Cache Reserve Clear operation.
- State CacheCacheReserveStatusResponseState `json:"state,required"`
- // The time that the latest Cache Reserve Clear operation completed.
- EndTs time.Time `json:"end_ts" format:"date-time"`
- JSON cacheCacheReserveStatusResponseJSON `json:"-"`
-}
-
-// cacheCacheReserveStatusResponseJSON contains the JSON metadata for the struct
-// [CacheCacheReserveStatusResponse]
-type cacheCacheReserveStatusResponseJSON struct {
- ID apijson.Field
- ModifiedOn apijson.Field
- StartTs apijson.Field
- State apijson.Field
- EndTs apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CacheCacheReserveStatusResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cacheCacheReserveStatusResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// ID of the zone setting.
-type CacheCacheReserveStatusResponseID string
-
-const (
- CacheCacheReserveStatusResponseIDCacheReserveClear CacheCacheReserveStatusResponseID = "cache_reserve_clear"
-)
-
-// The current state of the Cache Reserve Clear operation.
-type CacheCacheReserveStatusResponseState string
-
-const (
- CacheCacheReserveStatusResponseStateInProgress CacheCacheReserveStatusResponseState = "In-progress"
- CacheCacheReserveStatusResponseStateCompleted CacheCacheReserveStatusResponseState = "Completed"
-)
-
-type CacheCacheReserveClearParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
-}
-
-type CacheCacheReserveClearResponseEnvelope struct {
- Errors []CacheCacheReserveClearResponseEnvelopeErrors `json:"errors,required"`
- Messages []CacheCacheReserveClearResponseEnvelopeMessages `json:"messages,required"`
- // You can use Cache Reserve Clear to clear your Cache Reserve, but you must first
- // disable Cache Reserve. In most cases, this will be accomplished within 24 hours.
- // You cannot re-enable Cache Reserve while this process is ongoing. Keep in mind
- // that you cannot undo or cancel this operation.
- Result CacheCacheReserveClearResponse `json:"result,required"`
- // Whether the API call was successful
- Success CacheCacheReserveClearResponseEnvelopeSuccess `json:"success,required"`
- JSON cacheCacheReserveClearResponseEnvelopeJSON `json:"-"`
-}
-
-// cacheCacheReserveClearResponseEnvelopeJSON contains the JSON metadata for the
-// struct [CacheCacheReserveClearResponseEnvelope]
-type cacheCacheReserveClearResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CacheCacheReserveClearResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cacheCacheReserveClearResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type CacheCacheReserveClearResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON cacheCacheReserveClearResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// cacheCacheReserveClearResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [CacheCacheReserveClearResponseEnvelopeErrors]
-type cacheCacheReserveClearResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CacheCacheReserveClearResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cacheCacheReserveClearResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type CacheCacheReserveClearResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON cacheCacheReserveClearResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// cacheCacheReserveClearResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [CacheCacheReserveClearResponseEnvelopeMessages]
-type cacheCacheReserveClearResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CacheCacheReserveClearResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cacheCacheReserveClearResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type CacheCacheReserveClearResponseEnvelopeSuccess bool
-
-const (
- CacheCacheReserveClearResponseEnvelopeSuccessTrue CacheCacheReserveClearResponseEnvelopeSuccess = true
-)
-
-type CacheCacheReserveEditParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
- // Value of the Cache Reserve zone setting.
- Value param.Field[CacheCacheReserveEditParamsValue] `json:"value,required"`
-}
-
-func (r CacheCacheReserveEditParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Value of the Cache Reserve zone setting.
-type CacheCacheReserveEditParamsValue string
-
-const (
- CacheCacheReserveEditParamsValueOn CacheCacheReserveEditParamsValue = "on"
- CacheCacheReserveEditParamsValueOff CacheCacheReserveEditParamsValue = "off"
-)
-
-type CacheCacheReserveEditResponseEnvelope struct {
- Errors []CacheCacheReserveEditResponseEnvelopeErrors `json:"errors,required"`
- Messages []CacheCacheReserveEditResponseEnvelopeMessages `json:"messages,required"`
- // Increase cache lifetimes by automatically storing all cacheable files into
- // Cloudflare's persistent object storage buckets. Requires Cache Reserve
- // subscription. Note: using Tiered Cache with Cache Reserve is highly recommended
- // to reduce Reserve operations costs. See the
- // [developer docs](https://developers.cloudflare.com/cache/about/cache-reserve)
- // for more information.
- Result CacheCacheReserveEditResponse `json:"result,required"`
- // Whether the API call was successful
- Success CacheCacheReserveEditResponseEnvelopeSuccess `json:"success,required"`
- JSON cacheCacheReserveEditResponseEnvelopeJSON `json:"-"`
-}
-
-// cacheCacheReserveEditResponseEnvelopeJSON contains the JSON metadata for the
-// struct [CacheCacheReserveEditResponseEnvelope]
-type cacheCacheReserveEditResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CacheCacheReserveEditResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cacheCacheReserveEditResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type CacheCacheReserveEditResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON cacheCacheReserveEditResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// cacheCacheReserveEditResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [CacheCacheReserveEditResponseEnvelopeErrors]
-type cacheCacheReserveEditResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CacheCacheReserveEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cacheCacheReserveEditResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type CacheCacheReserveEditResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON cacheCacheReserveEditResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// cacheCacheReserveEditResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [CacheCacheReserveEditResponseEnvelopeMessages]
-type cacheCacheReserveEditResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CacheCacheReserveEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cacheCacheReserveEditResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type CacheCacheReserveEditResponseEnvelopeSuccess bool
-
-const (
- CacheCacheReserveEditResponseEnvelopeSuccessTrue CacheCacheReserveEditResponseEnvelopeSuccess = true
-)
-
-type CacheCacheReserveGetParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
-}
-
-type CacheCacheReserveGetResponseEnvelope struct {
- Errors []CacheCacheReserveGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []CacheCacheReserveGetResponseEnvelopeMessages `json:"messages,required"`
- // Increase cache lifetimes by automatically storing all cacheable files into
- // Cloudflare's persistent object storage buckets. Requires Cache Reserve
- // subscription. Note: using Tiered Cache with Cache Reserve is highly recommended
- // to reduce Reserve operations costs. See the
- // [developer docs](https://developers.cloudflare.com/cache/about/cache-reserve)
- // for more information.
- Result CacheCacheReserveGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success CacheCacheReserveGetResponseEnvelopeSuccess `json:"success,required"`
- JSON cacheCacheReserveGetResponseEnvelopeJSON `json:"-"`
-}
-
-// cacheCacheReserveGetResponseEnvelopeJSON contains the JSON metadata for the
-// struct [CacheCacheReserveGetResponseEnvelope]
-type cacheCacheReserveGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CacheCacheReserveGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cacheCacheReserveGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type CacheCacheReserveGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON cacheCacheReserveGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// cacheCacheReserveGetResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [CacheCacheReserveGetResponseEnvelopeErrors]
-type cacheCacheReserveGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CacheCacheReserveGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cacheCacheReserveGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type CacheCacheReserveGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON cacheCacheReserveGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// cacheCacheReserveGetResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [CacheCacheReserveGetResponseEnvelopeMessages]
-type cacheCacheReserveGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CacheCacheReserveGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cacheCacheReserveGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type CacheCacheReserveGetResponseEnvelopeSuccess bool
-
-const (
- CacheCacheReserveGetResponseEnvelopeSuccessTrue CacheCacheReserveGetResponseEnvelopeSuccess = true
-)
-
-type CacheCacheReserveStatusParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
-}
-
-type CacheCacheReserveStatusResponseEnvelope struct {
- Errors []CacheCacheReserveStatusResponseEnvelopeErrors `json:"errors,required"`
- Messages []CacheCacheReserveStatusResponseEnvelopeMessages `json:"messages,required"`
- // You can use Cache Reserve Clear to clear your Cache Reserve, but you must first
- // disable Cache Reserve. In most cases, this will be accomplished within 24 hours.
- // You cannot re-enable Cache Reserve while this process is ongoing. Keep in mind
- // that you cannot undo or cancel this operation.
- Result CacheCacheReserveStatusResponse `json:"result,required"`
- // Whether the API call was successful
- Success CacheCacheReserveStatusResponseEnvelopeSuccess `json:"success,required"`
- JSON cacheCacheReserveStatusResponseEnvelopeJSON `json:"-"`
-}
-
-// cacheCacheReserveStatusResponseEnvelopeJSON contains the JSON metadata for the
-// struct [CacheCacheReserveStatusResponseEnvelope]
-type cacheCacheReserveStatusResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CacheCacheReserveStatusResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cacheCacheReserveStatusResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type CacheCacheReserveStatusResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON cacheCacheReserveStatusResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// cacheCacheReserveStatusResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [CacheCacheReserveStatusResponseEnvelopeErrors]
-type cacheCacheReserveStatusResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CacheCacheReserveStatusResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cacheCacheReserveStatusResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type CacheCacheReserveStatusResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON cacheCacheReserveStatusResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// cacheCacheReserveStatusResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [CacheCacheReserveStatusResponseEnvelopeMessages]
-type cacheCacheReserveStatusResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CacheCacheReserveStatusResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cacheCacheReserveStatusResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type CacheCacheReserveStatusResponseEnvelopeSuccess bool
-
-const (
- CacheCacheReserveStatusResponseEnvelopeSuccessTrue CacheCacheReserveStatusResponseEnvelopeSuccess = true
-)
diff --git a/cachecachereserve_test.go b/cachecachereserve_test.go
deleted file mode 100644
index ae556a79add..00000000000
--- a/cachecachereserve_test.go
+++ /dev/null
@@ -1,119 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestCacheCacheReserveClear(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"),
- )
- _, err := client.Cache.CacheReserve.Clear(context.TODO(), cloudflare.CacheCacheReserveClearParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- })
- 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())
- }
-}
-
-func TestCacheCacheReserveEdit(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"),
- )
- _, err := client.Cache.CacheReserve.Edit(context.TODO(), cloudflare.CacheCacheReserveEditParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Value: cloudflare.F(cloudflare.CacheCacheReserveEditParamsValueOn),
- })
- 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())
- }
-}
-
-func TestCacheCacheReserveGet(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"),
- )
- _, err := client.Cache.CacheReserve.Get(context.TODO(), cloudflare.CacheCacheReserveGetParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- })
- 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())
- }
-}
-
-func TestCacheCacheReserveStatus(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"),
- )
- _, err := client.Cache.CacheReserve.Status(context.TODO(), cloudflare.CacheCacheReserveStatusParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- })
- 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/cacheregionaltieredcache.go b/cacheregionaltieredcache.go
deleted file mode 100644
index 78cd0069661..00000000000
--- a/cacheregionaltieredcache.go
+++ /dev/null
@@ -1,405 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// CacheRegionalTieredCacheService contains methods and other services that help
-// with interacting with the cloudflare API. Note, unlike clients, this service
-// does not read variables from the environment automatically. You should not
-// instantiate this service directly, and instead use the
-// [NewCacheRegionalTieredCacheService] method instead.
-type CacheRegionalTieredCacheService struct {
- Options []option.RequestOption
-}
-
-// NewCacheRegionalTieredCacheService generates a new service that applies the
-// given options to each request. These options are applied after the parent
-// client's options (if there is one), and before any request-specific options.
-func NewCacheRegionalTieredCacheService(opts ...option.RequestOption) (r *CacheRegionalTieredCacheService) {
- r = &CacheRegionalTieredCacheService{}
- r.Options = opts
- return
-}
-
-// Instructs Cloudflare to check a regional hub data center on the way to your
-// upper tier. This can help improve performance for smart and custom tiered cache
-// topologies.
-func (r *CacheRegionalTieredCacheService) Edit(ctx context.Context, params CacheRegionalTieredCacheEditParams, opts ...option.RequestOption) (res *CacheRegionalTieredCacheEditResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env CacheRegionalTieredCacheEditResponseEnvelope
- path := fmt.Sprintf("zones/%s/cache/regional_tiered_cache", params.ZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Instructs Cloudflare to check a regional hub data center on the way to your
-// upper tier. This can help improve performance for smart and custom tiered cache
-// topologies.
-func (r *CacheRegionalTieredCacheService) Get(ctx context.Context, query CacheRegionalTieredCacheGetParams, opts ...option.RequestOption) (res *CacheRegionalTieredCacheGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env CacheRegionalTieredCacheGetResponseEnvelope
- path := fmt.Sprintf("zones/%s/cache/regional_tiered_cache", query.ZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Instructs Cloudflare to check a regional hub data center on the way to your
-// upper tier. This can help improve performance for smart and custom tiered cache
-// topologies.
-type CacheRegionalTieredCacheEditResponse struct {
- // ID of the zone setting.
- ID CacheRegionalTieredCacheEditResponseID `json:"id,required"`
- // last time this setting was modified.
- ModifiedOn time.Time `json:"modified_on,required,nullable" format:"date-time"`
- // Instructs Cloudflare to check a regional hub data center on the way to your
- // upper tier. This can help improve performance for smart and custom tiered cache
- // topologies.
- Value CacheRegionalTieredCacheEditResponseValue `json:"value,required"`
- JSON cacheRegionalTieredCacheEditResponseJSON `json:"-"`
-}
-
-// cacheRegionalTieredCacheEditResponseJSON contains the JSON metadata for the
-// struct [CacheRegionalTieredCacheEditResponse]
-type cacheRegionalTieredCacheEditResponseJSON struct {
- ID apijson.Field
- ModifiedOn apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CacheRegionalTieredCacheEditResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cacheRegionalTieredCacheEditResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// ID of the zone setting.
-type CacheRegionalTieredCacheEditResponseID string
-
-const (
- CacheRegionalTieredCacheEditResponseIDTcRegional CacheRegionalTieredCacheEditResponseID = "tc_regional"
-)
-
-// Instructs Cloudflare to check a regional hub data center on the way to your
-// upper tier. This can help improve performance for smart and custom tiered cache
-// topologies.
-type CacheRegionalTieredCacheEditResponseValue struct {
- // ID of the zone setting.
- ID CacheRegionalTieredCacheEditResponseValueID `json:"id,required"`
- // last time this setting was modified.
- ModifiedOn time.Time `json:"modified_on,required,nullable" format:"date-time"`
- JSON cacheRegionalTieredCacheEditResponseValueJSON `json:"-"`
-}
-
-// cacheRegionalTieredCacheEditResponseValueJSON contains the JSON metadata for the
-// struct [CacheRegionalTieredCacheEditResponseValue]
-type cacheRegionalTieredCacheEditResponseValueJSON struct {
- ID apijson.Field
- ModifiedOn apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CacheRegionalTieredCacheEditResponseValue) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cacheRegionalTieredCacheEditResponseValueJSON) RawJSON() string {
- return r.raw
-}
-
-// ID of the zone setting.
-type CacheRegionalTieredCacheEditResponseValueID string
-
-const (
- CacheRegionalTieredCacheEditResponseValueIDTcRegional CacheRegionalTieredCacheEditResponseValueID = "tc_regional"
-)
-
-// Instructs Cloudflare to check a regional hub data center on the way to your
-// upper tier. This can help improve performance for smart and custom tiered cache
-// topologies.
-type CacheRegionalTieredCacheGetResponse struct {
- // ID of the zone setting.
- ID CacheRegionalTieredCacheGetResponseID `json:"id,required"`
- // last time this setting was modified.
- ModifiedOn time.Time `json:"modified_on,required,nullable" format:"date-time"`
- // Instructs Cloudflare to check a regional hub data center on the way to your
- // upper tier. This can help improve performance for smart and custom tiered cache
- // topologies.
- Value CacheRegionalTieredCacheGetResponseValue `json:"value,required"`
- JSON cacheRegionalTieredCacheGetResponseJSON `json:"-"`
-}
-
-// cacheRegionalTieredCacheGetResponseJSON contains the JSON metadata for the
-// struct [CacheRegionalTieredCacheGetResponse]
-type cacheRegionalTieredCacheGetResponseJSON struct {
- ID apijson.Field
- ModifiedOn apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CacheRegionalTieredCacheGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cacheRegionalTieredCacheGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// ID of the zone setting.
-type CacheRegionalTieredCacheGetResponseID string
-
-const (
- CacheRegionalTieredCacheGetResponseIDTcRegional CacheRegionalTieredCacheGetResponseID = "tc_regional"
-)
-
-// Instructs Cloudflare to check a regional hub data center on the way to your
-// upper tier. This can help improve performance for smart and custom tiered cache
-// topologies.
-type CacheRegionalTieredCacheGetResponseValue struct {
- // ID of the zone setting.
- ID CacheRegionalTieredCacheGetResponseValueID `json:"id,required"`
- // last time this setting was modified.
- ModifiedOn time.Time `json:"modified_on,required,nullable" format:"date-time"`
- JSON cacheRegionalTieredCacheGetResponseValueJSON `json:"-"`
-}
-
-// cacheRegionalTieredCacheGetResponseValueJSON contains the JSON metadata for the
-// struct [CacheRegionalTieredCacheGetResponseValue]
-type cacheRegionalTieredCacheGetResponseValueJSON struct {
- ID apijson.Field
- ModifiedOn apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CacheRegionalTieredCacheGetResponseValue) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cacheRegionalTieredCacheGetResponseValueJSON) RawJSON() string {
- return r.raw
-}
-
-// ID of the zone setting.
-type CacheRegionalTieredCacheGetResponseValueID string
-
-const (
- CacheRegionalTieredCacheGetResponseValueIDTcRegional CacheRegionalTieredCacheGetResponseValueID = "tc_regional"
-)
-
-type CacheRegionalTieredCacheEditParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
- // Value of the Regional Tiered Cache zone setting.
- Value param.Field[CacheRegionalTieredCacheEditParamsValue] `json:"value,required"`
-}
-
-func (r CacheRegionalTieredCacheEditParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Value of the Regional Tiered Cache zone setting.
-type CacheRegionalTieredCacheEditParamsValue string
-
-const (
- CacheRegionalTieredCacheEditParamsValueOn CacheRegionalTieredCacheEditParamsValue = "on"
- CacheRegionalTieredCacheEditParamsValueOff CacheRegionalTieredCacheEditParamsValue = "off"
-)
-
-type CacheRegionalTieredCacheEditResponseEnvelope struct {
- Errors []CacheRegionalTieredCacheEditResponseEnvelopeErrors `json:"errors,required"`
- Messages []CacheRegionalTieredCacheEditResponseEnvelopeMessages `json:"messages,required"`
- // Instructs Cloudflare to check a regional hub data center on the way to your
- // upper tier. This can help improve performance for smart and custom tiered cache
- // topologies.
- Result CacheRegionalTieredCacheEditResponse `json:"result,required"`
- // Whether the API call was successful
- Success CacheRegionalTieredCacheEditResponseEnvelopeSuccess `json:"success,required"`
- JSON cacheRegionalTieredCacheEditResponseEnvelopeJSON `json:"-"`
-}
-
-// cacheRegionalTieredCacheEditResponseEnvelopeJSON contains the JSON metadata for
-// the struct [CacheRegionalTieredCacheEditResponseEnvelope]
-type cacheRegionalTieredCacheEditResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CacheRegionalTieredCacheEditResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cacheRegionalTieredCacheEditResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type CacheRegionalTieredCacheEditResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON cacheRegionalTieredCacheEditResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// cacheRegionalTieredCacheEditResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct [CacheRegionalTieredCacheEditResponseEnvelopeErrors]
-type cacheRegionalTieredCacheEditResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CacheRegionalTieredCacheEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cacheRegionalTieredCacheEditResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type CacheRegionalTieredCacheEditResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON cacheRegionalTieredCacheEditResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// cacheRegionalTieredCacheEditResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct [CacheRegionalTieredCacheEditResponseEnvelopeMessages]
-type cacheRegionalTieredCacheEditResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CacheRegionalTieredCacheEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cacheRegionalTieredCacheEditResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type CacheRegionalTieredCacheEditResponseEnvelopeSuccess bool
-
-const (
- CacheRegionalTieredCacheEditResponseEnvelopeSuccessTrue CacheRegionalTieredCacheEditResponseEnvelopeSuccess = true
-)
-
-type CacheRegionalTieredCacheGetParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
-}
-
-type CacheRegionalTieredCacheGetResponseEnvelope struct {
- Errors []CacheRegionalTieredCacheGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []CacheRegionalTieredCacheGetResponseEnvelopeMessages `json:"messages,required"`
- // Instructs Cloudflare to check a regional hub data center on the way to your
- // upper tier. This can help improve performance for smart and custom tiered cache
- // topologies.
- Result CacheRegionalTieredCacheGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success CacheRegionalTieredCacheGetResponseEnvelopeSuccess `json:"success,required"`
- JSON cacheRegionalTieredCacheGetResponseEnvelopeJSON `json:"-"`
-}
-
-// cacheRegionalTieredCacheGetResponseEnvelopeJSON contains the JSON metadata for
-// the struct [CacheRegionalTieredCacheGetResponseEnvelope]
-type cacheRegionalTieredCacheGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CacheRegionalTieredCacheGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cacheRegionalTieredCacheGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type CacheRegionalTieredCacheGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON cacheRegionalTieredCacheGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// cacheRegionalTieredCacheGetResponseEnvelopeErrorsJSON contains the JSON metadata
-// for the struct [CacheRegionalTieredCacheGetResponseEnvelopeErrors]
-type cacheRegionalTieredCacheGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CacheRegionalTieredCacheGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cacheRegionalTieredCacheGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type CacheRegionalTieredCacheGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON cacheRegionalTieredCacheGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// cacheRegionalTieredCacheGetResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct [CacheRegionalTieredCacheGetResponseEnvelopeMessages]
-type cacheRegionalTieredCacheGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CacheRegionalTieredCacheGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cacheRegionalTieredCacheGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type CacheRegionalTieredCacheGetResponseEnvelopeSuccess bool
-
-const (
- CacheRegionalTieredCacheGetResponseEnvelopeSuccessTrue CacheRegionalTieredCacheGetResponseEnvelopeSuccess = true
-)
diff --git a/cacheregionaltieredcache_test.go b/cacheregionaltieredcache_test.go
deleted file mode 100644
index 19580ebef25..00000000000
--- a/cacheregionaltieredcache_test.go
+++ /dev/null
@@ -1,67 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestCacheRegionalTieredCacheEdit(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"),
- )
- _, err := client.Cache.RegionalTieredCache.Edit(context.TODO(), cloudflare.CacheRegionalTieredCacheEditParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Value: cloudflare.F(cloudflare.CacheRegionalTieredCacheEditParamsValueOn),
- })
- 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())
- }
-}
-
-func TestCacheRegionalTieredCacheGet(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"),
- )
- _, err := client.Cache.RegionalTieredCache.Get(context.TODO(), cloudflare.CacheRegionalTieredCacheGetParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- })
- 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/cachesmarttieredcached.go b/cachesmarttieredcached.go
deleted file mode 100644
index 5f2fe8c3b4f..00000000000
--- a/cachesmarttieredcached.go
+++ /dev/null
@@ -1,397 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "reflect"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/option"
- "github.com/tidwall/gjson"
-)
-
-// CacheSmartTieredCachedService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewCacheSmartTieredCachedService]
-// method instead.
-type CacheSmartTieredCachedService struct {
- Options []option.RequestOption
-}
-
-// NewCacheSmartTieredCachedService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewCacheSmartTieredCachedService(opts ...option.RequestOption) (r *CacheSmartTieredCachedService) {
- r = &CacheSmartTieredCachedService{}
- r.Options = opts
- return
-}
-
-// Remvoves enablement of Smart Tiered Cache
-func (r *CacheSmartTieredCachedService) Delete(ctx context.Context, body CacheSmartTieredCachedDeleteParams, opts ...option.RequestOption) (res *CacheSmartTieredCachedDeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env CacheSmartTieredCachedDeleteResponseEnvelope
- path := fmt.Sprintf("zones/%s/cache/tiered_cache_smart_topology_enable", body.ZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Updates enablement of Tiered Cache
-func (r *CacheSmartTieredCachedService) Edit(ctx context.Context, params CacheSmartTieredCachedEditParams, opts ...option.RequestOption) (res *CacheSmartTieredCachedEditResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env CacheSmartTieredCachedEditResponseEnvelope
- path := fmt.Sprintf("zones/%s/cache/tiered_cache_smart_topology_enable", params.ZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Get Smart Tiered Cache setting
-func (r *CacheSmartTieredCachedService) Get(ctx context.Context, query CacheSmartTieredCachedGetParams, opts ...option.RequestOption) (res *CacheSmartTieredCachedGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env CacheSmartTieredCachedGetResponseEnvelope
- path := fmt.Sprintf("zones/%s/cache/tiered_cache_smart_topology_enable", query.ZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Union satisfied by [CacheSmartTieredCachedDeleteResponseUnknown] or
-// [shared.UnionString].
-type CacheSmartTieredCachedDeleteResponse interface {
- ImplementsCacheSmartTieredCachedDeleteResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*CacheSmartTieredCachedDeleteResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-// Union satisfied by [CacheSmartTieredCachedEditResponseUnknown] or
-// [shared.UnionString].
-type CacheSmartTieredCachedEditResponse interface {
- ImplementsCacheSmartTieredCachedEditResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*CacheSmartTieredCachedEditResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-// Union satisfied by [CacheSmartTieredCachedGetResponseUnknown] or
-// [shared.UnionString].
-type CacheSmartTieredCachedGetResponse interface {
- ImplementsCacheSmartTieredCachedGetResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*CacheSmartTieredCachedGetResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-type CacheSmartTieredCachedDeleteParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
-}
-
-type CacheSmartTieredCachedDeleteResponseEnvelope struct {
- Errors []CacheSmartTieredCachedDeleteResponseEnvelopeErrors `json:"errors,required"`
- Messages []CacheSmartTieredCachedDeleteResponseEnvelopeMessages `json:"messages,required"`
- Result CacheSmartTieredCachedDeleteResponse `json:"result,required"`
- // Whether the API call was successful
- Success CacheSmartTieredCachedDeleteResponseEnvelopeSuccess `json:"success,required"`
- JSON cacheSmartTieredCachedDeleteResponseEnvelopeJSON `json:"-"`
-}
-
-// cacheSmartTieredCachedDeleteResponseEnvelopeJSON contains the JSON metadata for
-// the struct [CacheSmartTieredCachedDeleteResponseEnvelope]
-type cacheSmartTieredCachedDeleteResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CacheSmartTieredCachedDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cacheSmartTieredCachedDeleteResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type CacheSmartTieredCachedDeleteResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON cacheSmartTieredCachedDeleteResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// cacheSmartTieredCachedDeleteResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct [CacheSmartTieredCachedDeleteResponseEnvelopeErrors]
-type cacheSmartTieredCachedDeleteResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CacheSmartTieredCachedDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cacheSmartTieredCachedDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type CacheSmartTieredCachedDeleteResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON cacheSmartTieredCachedDeleteResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// cacheSmartTieredCachedDeleteResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct [CacheSmartTieredCachedDeleteResponseEnvelopeMessages]
-type cacheSmartTieredCachedDeleteResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CacheSmartTieredCachedDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cacheSmartTieredCachedDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type CacheSmartTieredCachedDeleteResponseEnvelopeSuccess bool
-
-const (
- CacheSmartTieredCachedDeleteResponseEnvelopeSuccessTrue CacheSmartTieredCachedDeleteResponseEnvelopeSuccess = true
-)
-
-type CacheSmartTieredCachedEditParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
- // Enables Tiered Cache.
- Value param.Field[CacheSmartTieredCachedEditParamsValue] `json:"value,required"`
-}
-
-func (r CacheSmartTieredCachedEditParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Enables Tiered Cache.
-type CacheSmartTieredCachedEditParamsValue string
-
-const (
- CacheSmartTieredCachedEditParamsValueOn CacheSmartTieredCachedEditParamsValue = "on"
- CacheSmartTieredCachedEditParamsValueOff CacheSmartTieredCachedEditParamsValue = "off"
-)
-
-type CacheSmartTieredCachedEditResponseEnvelope struct {
- Errors []CacheSmartTieredCachedEditResponseEnvelopeErrors `json:"errors,required"`
- Messages []CacheSmartTieredCachedEditResponseEnvelopeMessages `json:"messages,required"`
- Result CacheSmartTieredCachedEditResponse `json:"result,required"`
- // Whether the API call was successful
- Success CacheSmartTieredCachedEditResponseEnvelopeSuccess `json:"success,required"`
- JSON cacheSmartTieredCachedEditResponseEnvelopeJSON `json:"-"`
-}
-
-// cacheSmartTieredCachedEditResponseEnvelopeJSON contains the JSON metadata for
-// the struct [CacheSmartTieredCachedEditResponseEnvelope]
-type cacheSmartTieredCachedEditResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CacheSmartTieredCachedEditResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cacheSmartTieredCachedEditResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type CacheSmartTieredCachedEditResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON cacheSmartTieredCachedEditResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// cacheSmartTieredCachedEditResponseEnvelopeErrorsJSON contains the JSON metadata
-// for the struct [CacheSmartTieredCachedEditResponseEnvelopeErrors]
-type cacheSmartTieredCachedEditResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CacheSmartTieredCachedEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cacheSmartTieredCachedEditResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type CacheSmartTieredCachedEditResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON cacheSmartTieredCachedEditResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// cacheSmartTieredCachedEditResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct [CacheSmartTieredCachedEditResponseEnvelopeMessages]
-type cacheSmartTieredCachedEditResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CacheSmartTieredCachedEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cacheSmartTieredCachedEditResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type CacheSmartTieredCachedEditResponseEnvelopeSuccess bool
-
-const (
- CacheSmartTieredCachedEditResponseEnvelopeSuccessTrue CacheSmartTieredCachedEditResponseEnvelopeSuccess = true
-)
-
-type CacheSmartTieredCachedGetParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
-}
-
-type CacheSmartTieredCachedGetResponseEnvelope struct {
- Errors []CacheSmartTieredCachedGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []CacheSmartTieredCachedGetResponseEnvelopeMessages `json:"messages,required"`
- Result CacheSmartTieredCachedGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success CacheSmartTieredCachedGetResponseEnvelopeSuccess `json:"success,required"`
- JSON cacheSmartTieredCachedGetResponseEnvelopeJSON `json:"-"`
-}
-
-// cacheSmartTieredCachedGetResponseEnvelopeJSON contains the JSON metadata for the
-// struct [CacheSmartTieredCachedGetResponseEnvelope]
-type cacheSmartTieredCachedGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CacheSmartTieredCachedGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cacheSmartTieredCachedGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type CacheSmartTieredCachedGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON cacheSmartTieredCachedGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// cacheSmartTieredCachedGetResponseEnvelopeErrorsJSON contains the JSON metadata
-// for the struct [CacheSmartTieredCachedGetResponseEnvelopeErrors]
-type cacheSmartTieredCachedGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CacheSmartTieredCachedGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cacheSmartTieredCachedGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type CacheSmartTieredCachedGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON cacheSmartTieredCachedGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// cacheSmartTieredCachedGetResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [CacheSmartTieredCachedGetResponseEnvelopeMessages]
-type cacheSmartTieredCachedGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CacheSmartTieredCachedGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cacheSmartTieredCachedGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type CacheSmartTieredCachedGetResponseEnvelopeSuccess bool
-
-const (
- CacheSmartTieredCachedGetResponseEnvelopeSuccessTrue CacheSmartTieredCachedGetResponseEnvelopeSuccess = true
-)
diff --git a/cachesmarttieredcached_test.go b/cachesmarttieredcached_test.go
deleted file mode 100644
index 6b44c95e851..00000000000
--- a/cachesmarttieredcached_test.go
+++ /dev/null
@@ -1,93 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestCacheSmartTieredCachedDelete(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"),
- )
- _, err := client.Cache.SmartTieredCached.Delete(context.TODO(), cloudflare.CacheSmartTieredCachedDeleteParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- })
- 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())
- }
-}
-
-func TestCacheSmartTieredCachedEdit(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"),
- )
- _, err := client.Cache.SmartTieredCached.Edit(context.TODO(), cloudflare.CacheSmartTieredCachedEditParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Value: cloudflare.F(cloudflare.CacheSmartTieredCachedEditParamsValueOn),
- })
- 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())
- }
-}
-
-func TestCacheSmartTieredCachedGet(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"),
- )
- _, err := client.Cache.SmartTieredCached.Get(context.TODO(), cloudflare.CacheSmartTieredCachedGetParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- })
- 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/cachevariant.go b/cachevariant.go
deleted file mode 100644
index 4dd7a099ff6..00000000000
--- a/cachevariant.go
+++ /dev/null
@@ -1,649 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// CacheVariantService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewCacheVariantService] method
-// instead.
-type CacheVariantService struct {
- Options []option.RequestOption
-}
-
-// NewCacheVariantService generates a new service that applies the given options to
-// each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewCacheVariantService(opts ...option.RequestOption) (r *CacheVariantService) {
- r = &CacheVariantService{}
- r.Options = opts
- return
-}
-
-// Variant support enables caching variants of images with certain file extensions
-// in addition to the original. This only applies when the origin server sends the
-// 'Vary: Accept' response header. If the origin server sends 'Vary: Accept' but
-// does not serve the variant requested, the response will not be cached. This will
-// be indicated with BYPASS cache status in the response headers.
-func (r *CacheVariantService) Delete(ctx context.Context, body CacheVariantDeleteParams, opts ...option.RequestOption) (res *CacheVariantDeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env CacheVariantDeleteResponseEnvelope
- path := fmt.Sprintf("zones/%s/cache/variants", body.ZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Variant support enables caching variants of images with certain file extensions
-// in addition to the original. This only applies when the origin server sends the
-// 'Vary: Accept' response header. If the origin server sends 'Vary: Accept' but
-// does not serve the variant requested, the response will not be cached. This will
-// be indicated with BYPASS cache status in the response headers.
-func (r *CacheVariantService) Edit(ctx context.Context, params CacheVariantEditParams, opts ...option.RequestOption) (res *CacheVariantEditResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env CacheVariantEditResponseEnvelope
- path := fmt.Sprintf("zones/%s/cache/variants", params.ZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Variant support enables caching variants of images with certain file extensions
-// in addition to the original. This only applies when the origin server sends the
-// 'Vary: Accept' response header. If the origin server sends 'Vary: Accept' but
-// does not serve the variant requested, the response will not be cached. This will
-// be indicated with BYPASS cache status in the response headers.
-func (r *CacheVariantService) Get(ctx context.Context, query CacheVariantGetParams, opts ...option.RequestOption) (res *CacheVariantGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env CacheVariantGetResponseEnvelope
- path := fmt.Sprintf("zones/%s/cache/variants", query.ZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Variant support enables caching variants of images with certain file extensions
-// in addition to the original. This only applies when the origin server sends the
-// 'Vary: Accept' response header. If the origin server sends 'Vary: Accept' but
-// does not serve the variant requested, the response will not be cached. This will
-// be indicated with BYPASS cache status in the response headers.
-type CacheVariantDeleteResponse struct {
- // ID of the zone setting.
- ID CacheVariantDeleteResponseID `json:"id,required"`
- // last time this setting was modified.
- ModifiedOn time.Time `json:"modified_on,required,nullable" format:"date-time"`
- JSON cacheVariantDeleteResponseJSON `json:"-"`
-}
-
-// cacheVariantDeleteResponseJSON contains the JSON metadata for the struct
-// [CacheVariantDeleteResponse]
-type cacheVariantDeleteResponseJSON struct {
- ID apijson.Field
- ModifiedOn apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CacheVariantDeleteResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cacheVariantDeleteResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// ID of the zone setting.
-type CacheVariantDeleteResponseID string
-
-const (
- CacheVariantDeleteResponseIDVariants CacheVariantDeleteResponseID = "variants"
-)
-
-// Variant support enables caching variants of images with certain file extensions
-// in addition to the original. This only applies when the origin server sends the
-// 'Vary: Accept' response header. If the origin server sends 'Vary: Accept' but
-// does not serve the variant requested, the response will not be cached. This will
-// be indicated with BYPASS cache status in the response headers.
-type CacheVariantEditResponse struct {
- // ID of the zone setting.
- ID CacheVariantEditResponseID `json:"id,required"`
- // last time this setting was modified.
- ModifiedOn time.Time `json:"modified_on,required,nullable" format:"date-time"`
- // Value of the zone setting.
- Value CacheVariantEditResponseValue `json:"value,required"`
- JSON cacheVariantEditResponseJSON `json:"-"`
-}
-
-// cacheVariantEditResponseJSON contains the JSON metadata for the struct
-// [CacheVariantEditResponse]
-type cacheVariantEditResponseJSON struct {
- ID apijson.Field
- ModifiedOn apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CacheVariantEditResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cacheVariantEditResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// ID of the zone setting.
-type CacheVariantEditResponseID string
-
-const (
- CacheVariantEditResponseIDVariants CacheVariantEditResponseID = "variants"
-)
-
-// Value of the zone setting.
-type CacheVariantEditResponseValue struct {
- // List of strings with the MIME types of all the variants that should be served
- // for avif.
- Avif []interface{} `json:"avif"`
- // List of strings with the MIME types of all the variants that should be served
- // for bmp.
- Bmp []interface{} `json:"bmp"`
- // List of strings with the MIME types of all the variants that should be served
- // for gif.
- Gif []interface{} `json:"gif"`
- // List of strings with the MIME types of all the variants that should be served
- // for jp2.
- Jp2 []interface{} `json:"jp2"`
- // List of strings with the MIME types of all the variants that should be served
- // for jpeg.
- Jpeg []interface{} `json:"jpeg"`
- // List of strings with the MIME types of all the variants that should be served
- // for jpg.
- Jpg []interface{} `json:"jpg"`
- // List of strings with the MIME types of all the variants that should be served
- // for jpg2.
- Jpg2 []interface{} `json:"jpg2"`
- // List of strings with the MIME types of all the variants that should be served
- // for png.
- Png []interface{} `json:"png"`
- // List of strings with the MIME types of all the variants that should be served
- // for tif.
- Tif []interface{} `json:"tif"`
- // List of strings with the MIME types of all the variants that should be served
- // for tiff.
- Tiff []interface{} `json:"tiff"`
- // List of strings with the MIME types of all the variants that should be served
- // for webp.
- Webp []interface{} `json:"webp"`
- JSON cacheVariantEditResponseValueJSON `json:"-"`
-}
-
-// cacheVariantEditResponseValueJSON contains the JSON metadata for the struct
-// [CacheVariantEditResponseValue]
-type cacheVariantEditResponseValueJSON struct {
- Avif apijson.Field
- Bmp apijson.Field
- Gif apijson.Field
- Jp2 apijson.Field
- Jpeg apijson.Field
- Jpg apijson.Field
- Jpg2 apijson.Field
- Png apijson.Field
- Tif apijson.Field
- Tiff apijson.Field
- Webp apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CacheVariantEditResponseValue) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cacheVariantEditResponseValueJSON) RawJSON() string {
- return r.raw
-}
-
-// Variant support enables caching variants of images with certain file extensions
-// in addition to the original. This only applies when the origin server sends the
-// 'Vary: Accept' response header. If the origin server sends 'Vary: Accept' but
-// does not serve the variant requested, the response will not be cached. This will
-// be indicated with BYPASS cache status in the response headers.
-type CacheVariantGetResponse struct {
- // ID of the zone setting.
- ID CacheVariantGetResponseID `json:"id,required"`
- // last time this setting was modified.
- ModifiedOn time.Time `json:"modified_on,required,nullable" format:"date-time"`
- // Value of the zone setting.
- Value CacheVariantGetResponseValue `json:"value,required"`
- JSON cacheVariantGetResponseJSON `json:"-"`
-}
-
-// cacheVariantGetResponseJSON contains the JSON metadata for the struct
-// [CacheVariantGetResponse]
-type cacheVariantGetResponseJSON struct {
- ID apijson.Field
- ModifiedOn apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CacheVariantGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cacheVariantGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// ID of the zone setting.
-type CacheVariantGetResponseID string
-
-const (
- CacheVariantGetResponseIDVariants CacheVariantGetResponseID = "variants"
-)
-
-// Value of the zone setting.
-type CacheVariantGetResponseValue struct {
- // List of strings with the MIME types of all the variants that should be served
- // for avif.
- Avif []interface{} `json:"avif"`
- // List of strings with the MIME types of all the variants that should be served
- // for bmp.
- Bmp []interface{} `json:"bmp"`
- // List of strings with the MIME types of all the variants that should be served
- // for gif.
- Gif []interface{} `json:"gif"`
- // List of strings with the MIME types of all the variants that should be served
- // for jp2.
- Jp2 []interface{} `json:"jp2"`
- // List of strings with the MIME types of all the variants that should be served
- // for jpeg.
- Jpeg []interface{} `json:"jpeg"`
- // List of strings with the MIME types of all the variants that should be served
- // for jpg.
- Jpg []interface{} `json:"jpg"`
- // List of strings with the MIME types of all the variants that should be served
- // for jpg2.
- Jpg2 []interface{} `json:"jpg2"`
- // List of strings with the MIME types of all the variants that should be served
- // for png.
- Png []interface{} `json:"png"`
- // List of strings with the MIME types of all the variants that should be served
- // for tif.
- Tif []interface{} `json:"tif"`
- // List of strings with the MIME types of all the variants that should be served
- // for tiff.
- Tiff []interface{} `json:"tiff"`
- // List of strings with the MIME types of all the variants that should be served
- // for webp.
- Webp []interface{} `json:"webp"`
- JSON cacheVariantGetResponseValueJSON `json:"-"`
-}
-
-// cacheVariantGetResponseValueJSON contains the JSON metadata for the struct
-// [CacheVariantGetResponseValue]
-type cacheVariantGetResponseValueJSON struct {
- Avif apijson.Field
- Bmp apijson.Field
- Gif apijson.Field
- Jp2 apijson.Field
- Jpeg apijson.Field
- Jpg apijson.Field
- Jpg2 apijson.Field
- Png apijson.Field
- Tif apijson.Field
- Tiff apijson.Field
- Webp apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CacheVariantGetResponseValue) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cacheVariantGetResponseValueJSON) RawJSON() string {
- return r.raw
-}
-
-type CacheVariantDeleteParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
-}
-
-type CacheVariantDeleteResponseEnvelope struct {
- Errors []CacheVariantDeleteResponseEnvelopeErrors `json:"errors,required"`
- Messages []CacheVariantDeleteResponseEnvelopeMessages `json:"messages,required"`
- // Variant support enables caching variants of images with certain file extensions
- // in addition to the original. This only applies when the origin server sends the
- // 'Vary: Accept' response header. If the origin server sends 'Vary: Accept' but
- // does not serve the variant requested, the response will not be cached. This will
- // be indicated with BYPASS cache status in the response headers.
- Result CacheVariantDeleteResponse `json:"result,required"`
- // Whether the API call was successful
- Success CacheVariantDeleteResponseEnvelopeSuccess `json:"success,required"`
- JSON cacheVariantDeleteResponseEnvelopeJSON `json:"-"`
-}
-
-// cacheVariantDeleteResponseEnvelopeJSON contains the JSON metadata for the struct
-// [CacheVariantDeleteResponseEnvelope]
-type cacheVariantDeleteResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CacheVariantDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cacheVariantDeleteResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type CacheVariantDeleteResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON cacheVariantDeleteResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// cacheVariantDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [CacheVariantDeleteResponseEnvelopeErrors]
-type cacheVariantDeleteResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CacheVariantDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cacheVariantDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type CacheVariantDeleteResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON cacheVariantDeleteResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// cacheVariantDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [CacheVariantDeleteResponseEnvelopeMessages]
-type cacheVariantDeleteResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CacheVariantDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cacheVariantDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type CacheVariantDeleteResponseEnvelopeSuccess bool
-
-const (
- CacheVariantDeleteResponseEnvelopeSuccessTrue CacheVariantDeleteResponseEnvelopeSuccess = true
-)
-
-type CacheVariantEditParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
- // Value of the zone setting.
- Value param.Field[CacheVariantEditParamsValue] `json:"value,required"`
-}
-
-func (r CacheVariantEditParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Value of the zone setting.
-type CacheVariantEditParamsValue struct {
- // List of strings with the MIME types of all the variants that should be served
- // for avif.
- Avif param.Field[[]interface{}] `json:"avif"`
- // List of strings with the MIME types of all the variants that should be served
- // for bmp.
- Bmp param.Field[[]interface{}] `json:"bmp"`
- // List of strings with the MIME types of all the variants that should be served
- // for gif.
- Gif param.Field[[]interface{}] `json:"gif"`
- // List of strings with the MIME types of all the variants that should be served
- // for jp2.
- Jp2 param.Field[[]interface{}] `json:"jp2"`
- // List of strings with the MIME types of all the variants that should be served
- // for jpeg.
- Jpeg param.Field[[]interface{}] `json:"jpeg"`
- // List of strings with the MIME types of all the variants that should be served
- // for jpg.
- Jpg param.Field[[]interface{}] `json:"jpg"`
- // List of strings with the MIME types of all the variants that should be served
- // for jpg2.
- Jpg2 param.Field[[]interface{}] `json:"jpg2"`
- // List of strings with the MIME types of all the variants that should be served
- // for png.
- Png param.Field[[]interface{}] `json:"png"`
- // List of strings with the MIME types of all the variants that should be served
- // for tif.
- Tif param.Field[[]interface{}] `json:"tif"`
- // List of strings with the MIME types of all the variants that should be served
- // for tiff.
- Tiff param.Field[[]interface{}] `json:"tiff"`
- // List of strings with the MIME types of all the variants that should be served
- // for webp.
- Webp param.Field[[]interface{}] `json:"webp"`
-}
-
-func (r CacheVariantEditParamsValue) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type CacheVariantEditResponseEnvelope struct {
- Errors []CacheVariantEditResponseEnvelopeErrors `json:"errors,required"`
- Messages []CacheVariantEditResponseEnvelopeMessages `json:"messages,required"`
- // Variant support enables caching variants of images with certain file extensions
- // in addition to the original. This only applies when the origin server sends the
- // 'Vary: Accept' response header. If the origin server sends 'Vary: Accept' but
- // does not serve the variant requested, the response will not be cached. This will
- // be indicated with BYPASS cache status in the response headers.
- Result CacheVariantEditResponse `json:"result,required"`
- // Whether the API call was successful
- Success CacheVariantEditResponseEnvelopeSuccess `json:"success,required"`
- JSON cacheVariantEditResponseEnvelopeJSON `json:"-"`
-}
-
-// cacheVariantEditResponseEnvelopeJSON contains the JSON metadata for the struct
-// [CacheVariantEditResponseEnvelope]
-type cacheVariantEditResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CacheVariantEditResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cacheVariantEditResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type CacheVariantEditResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON cacheVariantEditResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// cacheVariantEditResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [CacheVariantEditResponseEnvelopeErrors]
-type cacheVariantEditResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CacheVariantEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cacheVariantEditResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type CacheVariantEditResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON cacheVariantEditResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// cacheVariantEditResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [CacheVariantEditResponseEnvelopeMessages]
-type cacheVariantEditResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CacheVariantEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cacheVariantEditResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type CacheVariantEditResponseEnvelopeSuccess bool
-
-const (
- CacheVariantEditResponseEnvelopeSuccessTrue CacheVariantEditResponseEnvelopeSuccess = true
-)
-
-type CacheVariantGetParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
-}
-
-type CacheVariantGetResponseEnvelope struct {
- Errors []CacheVariantGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []CacheVariantGetResponseEnvelopeMessages `json:"messages,required"`
- // Variant support enables caching variants of images with certain file extensions
- // in addition to the original. This only applies when the origin server sends the
- // 'Vary: Accept' response header. If the origin server sends 'Vary: Accept' but
- // does not serve the variant requested, the response will not be cached. This will
- // be indicated with BYPASS cache status in the response headers.
- Result CacheVariantGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success CacheVariantGetResponseEnvelopeSuccess `json:"success,required"`
- JSON cacheVariantGetResponseEnvelopeJSON `json:"-"`
-}
-
-// cacheVariantGetResponseEnvelopeJSON contains the JSON metadata for the struct
-// [CacheVariantGetResponseEnvelope]
-type cacheVariantGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CacheVariantGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cacheVariantGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type CacheVariantGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON cacheVariantGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// cacheVariantGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [CacheVariantGetResponseEnvelopeErrors]
-type cacheVariantGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CacheVariantGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cacheVariantGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type CacheVariantGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON cacheVariantGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// cacheVariantGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [CacheVariantGetResponseEnvelopeMessages]
-type cacheVariantGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CacheVariantGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cacheVariantGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type CacheVariantGetResponseEnvelopeSuccess bool
-
-const (
- CacheVariantGetResponseEnvelopeSuccessTrue CacheVariantGetResponseEnvelopeSuccess = true
-)
diff --git a/cachevariant_test.go b/cachevariant_test.go
deleted file mode 100644
index b7b3115bcb2..00000000000
--- a/cachevariant_test.go
+++ /dev/null
@@ -1,105 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestCacheVariantDelete(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"),
- )
- _, err := client.Cache.Variants.Delete(context.TODO(), cloudflare.CacheVariantDeleteParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- })
- 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())
- }
-}
-
-func TestCacheVariantEditWithOptionalParams(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"),
- )
- _, err := client.Cache.Variants.Edit(context.TODO(), cloudflare.CacheVariantEditParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Value: cloudflare.F(cloudflare.CacheVariantEditParamsValue{
- Avif: cloudflare.F([]interface{}{"image/webp", "image/jpeg"}),
- Bmp: cloudflare.F([]interface{}{"image/webp", "image/jpeg"}),
- Gif: cloudflare.F([]interface{}{"image/webp", "image/jpeg"}),
- Jp2: cloudflare.F([]interface{}{"image/webp", "image/avif"}),
- Jpeg: cloudflare.F([]interface{}{"image/webp", "image/avif"}),
- Jpg: cloudflare.F([]interface{}{"image/webp", "image/avif"}),
- Jpg2: cloudflare.F([]interface{}{"image/webp", "image/avif"}),
- Png: cloudflare.F([]interface{}{"image/webp", "image/avif"}),
- Tif: cloudflare.F([]interface{}{"image/webp", "image/avif"}),
- Tiff: cloudflare.F([]interface{}{"image/webp", "image/avif"}),
- Webp: cloudflare.F([]interface{}{"image/jpeg", "image/avif"}),
- }),
- })
- 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())
- }
-}
-
-func TestCacheVariantGet(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"),
- )
- _, err := client.Cache.Variants.Get(context.TODO(), cloudflare.CacheVariantGetParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- })
- 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/calls/aliases.go b/calls/aliases.go
new file mode 100644
index 00000000000..b81b82b3d74
--- /dev/null
+++ b/calls/aliases.go
@@ -0,0 +1,9 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package calls
+
+import (
+ "github.com/cloudflare/cloudflare-go/internal/apierror"
+)
+
+type Error = apierror.Error
diff --git a/call.go b/calls/call.go
similarity index 81%
rename from call.go
rename to calls/call.go
index 49a531480b5..0cff3e2645b 100644
--- a/call.go
+++ b/calls/call.go
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package cloudflare
+package calls
import (
"context"
@@ -33,7 +33,7 @@ func NewCallService(opts ...option.RequestOption) (r *CallService) {
// Creates a new Cloudflare calls app. An app is an unique enviroment where each
// Session can access all Tracks within the app.
-func (r *CallService) New(ctx context.Context, params CallNewParams, opts ...option.RequestOption) (res *CallNewResponse, err error) {
+func (r *CallService) New(ctx context.Context, params CallNewParams, opts ...option.RequestOption) (res *CallsAppWithSecret, err error) {
opts = append(r.Options[:], opts...)
var env CallNewResponseEnvelope
path := fmt.Sprintf("accounts/%s/calls/apps", params.AccountID)
@@ -46,7 +46,7 @@ func (r *CallService) New(ctx context.Context, params CallNewParams, opts ...opt
}
// Edit details for a single app.
-func (r *CallService) Update(ctx context.Context, appID string, params CallUpdateParams, opts ...option.RequestOption) (res *CallUpdateResponse, err error) {
+func (r *CallService) Update(ctx context.Context, appID string, params CallUpdateParams, opts ...option.RequestOption) (res *CallsApp, err error) {
opts = append(r.Options[:], opts...)
var env CallUpdateResponseEnvelope
path := fmt.Sprintf("accounts/%s/calls/apps/%s", params.AccountID, appID)
@@ -59,7 +59,7 @@ func (r *CallService) Update(ctx context.Context, appID string, params CallUpdat
}
// Lists all apps in the Cloudflare account
-func (r *CallService) List(ctx context.Context, query CallListParams, opts ...option.RequestOption) (res *[]CallListResponse, err error) {
+func (r *CallService) List(ctx context.Context, query CallListParams, opts ...option.RequestOption) (res *[]CallsApp, err error) {
opts = append(r.Options[:], opts...)
var env CallListResponseEnvelope
path := fmt.Sprintf("accounts/%s/calls/apps", query.AccountID)
@@ -72,7 +72,7 @@ func (r *CallService) List(ctx context.Context, query CallListParams, opts ...op
}
// Deletes an app from Cloudflare Calls
-func (r *CallService) Delete(ctx context.Context, appID string, body CallDeleteParams, opts ...option.RequestOption) (res *CallDeleteResponse, err error) {
+func (r *CallService) Delete(ctx context.Context, appID string, body CallDeleteParams, opts ...option.RequestOption) (res *CallsApp, err error) {
opts = append(r.Options[:], opts...)
var env CallDeleteResponseEnvelope
path := fmt.Sprintf("accounts/%s/calls/apps/%s", body.AccountID, appID)
@@ -85,7 +85,7 @@ func (r *CallService) Delete(ctx context.Context, appID string, body CallDeleteP
}
// Fetches details for a single Calls app.
-func (r *CallService) Get(ctx context.Context, appID string, query CallGetParams, opts ...option.RequestOption) (res *CallGetResponse, err error) {
+func (r *CallService) Get(ctx context.Context, appID string, query CallGetParams, opts ...option.RequestOption) (res *CallsApp, err error) {
opts = append(r.Options[:], opts...)
var env CallGetResponseEnvelope
path := fmt.Sprintf("accounts/%s/calls/apps/%s", query.AccountID, appID)
@@ -97,71 +97,7 @@ func (r *CallService) Get(ctx context.Context, appID string, query CallGetParams
return
}
-type CallNewResponse struct {
- // The date and time the item was created.
- Created time.Time `json:"created" format:"date-time"`
- // The date and time the item was last modified.
- Modified time.Time `json:"modified" format:"date-time"`
- // A short description of Calls app, not shown to end users.
- Name string `json:"name"`
- // Bearer token to use the Calls API.
- Secret string `json:"secret"`
- // A Cloudflare-generated unique identifier for a item.
- Uid string `json:"uid"`
- JSON callNewResponseJSON `json:"-"`
-}
-
-// callNewResponseJSON contains the JSON metadata for the struct [CallNewResponse]
-type callNewResponseJSON struct {
- Created apijson.Field
- Modified apijson.Field
- Name apijson.Field
- Secret apijson.Field
- Uid apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CallNewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r callNewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type CallUpdateResponse struct {
- // The date and time the item was created.
- Created time.Time `json:"created" format:"date-time"`
- // The date and time the item was last modified.
- Modified time.Time `json:"modified" format:"date-time"`
- // A short description of Calls app, not shown to end users.
- Name string `json:"name"`
- // A Cloudflare-generated unique identifier for a item.
- Uid string `json:"uid"`
- JSON callUpdateResponseJSON `json:"-"`
-}
-
-// callUpdateResponseJSON contains the JSON metadata for the struct
-// [CallUpdateResponse]
-type callUpdateResponseJSON struct {
- Created apijson.Field
- Modified apijson.Field
- Name apijson.Field
- Uid apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CallUpdateResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r callUpdateResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type CallListResponse struct {
+type CallsApp struct {
// The date and time the item was created.
Created time.Time `json:"created" format:"date-time"`
// The date and time the item was last modified.
@@ -169,13 +105,12 @@ type CallListResponse struct {
// A short description of Calls app, not shown to end users.
Name string `json:"name"`
// A Cloudflare-generated unique identifier for a item.
- Uid string `json:"uid"`
- JSON callListResponseJSON `json:"-"`
+ Uid string `json:"uid"`
+ JSON callsAppJSON `json:"-"`
}
-// callListResponseJSON contains the JSON metadata for the struct
-// [CallListResponse]
-type callListResponseJSON struct {
+// callsAppJSON contains the JSON metadata for the struct [CallsApp]
+type callsAppJSON struct {
Created apijson.Field
Modified apijson.Field
Name apijson.Field
@@ -184,72 +119,45 @@ type callListResponseJSON struct {
ExtraFields map[string]apijson.Field
}
-func (r *CallListResponse) UnmarshalJSON(data []byte) (err error) {
+func (r *CallsApp) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
-func (r callListResponseJSON) RawJSON() string {
+func (r callsAppJSON) RawJSON() string {
return r.raw
}
-type CallDeleteResponse struct {
+type CallsAppWithSecret struct {
// The date and time the item was created.
Created time.Time `json:"created" format:"date-time"`
// The date and time the item was last modified.
Modified time.Time `json:"modified" format:"date-time"`
// A short description of Calls app, not shown to end users.
Name string `json:"name"`
+ // Bearer token to use the Calls API.
+ Secret string `json:"secret"`
// A Cloudflare-generated unique identifier for a item.
Uid string `json:"uid"`
- JSON callDeleteResponseJSON `json:"-"`
-}
-
-// callDeleteResponseJSON contains the JSON metadata for the struct
-// [CallDeleteResponse]
-type callDeleteResponseJSON struct {
- Created apijson.Field
- Modified apijson.Field
- Name apijson.Field
- Uid apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CallDeleteResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
+ JSON callsAppWithSecretJSON `json:"-"`
}
-func (r callDeleteResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type CallGetResponse struct {
- // The date and time the item was created.
- Created time.Time `json:"created" format:"date-time"`
- // The date and time the item was last modified.
- Modified time.Time `json:"modified" format:"date-time"`
- // A short description of Calls app, not shown to end users.
- Name string `json:"name"`
- // A Cloudflare-generated unique identifier for a item.
- Uid string `json:"uid"`
- JSON callGetResponseJSON `json:"-"`
-}
-
-// callGetResponseJSON contains the JSON metadata for the struct [CallGetResponse]
-type callGetResponseJSON struct {
+// callsAppWithSecretJSON contains the JSON metadata for the struct
+// [CallsAppWithSecret]
+type callsAppWithSecretJSON struct {
Created apijson.Field
Modified apijson.Field
Name apijson.Field
+ Secret apijson.Field
Uid apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
-func (r *CallGetResponse) UnmarshalJSON(data []byte) (err error) {
+func (r *CallsAppWithSecret) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
-func (r callGetResponseJSON) RawJSON() string {
+func (r callsAppWithSecretJSON) RawJSON() string {
return r.raw
}
@@ -267,7 +175,7 @@ func (r CallNewParams) MarshalJSON() (data []byte, err error) {
type CallNewResponseEnvelope struct {
Errors []CallNewResponseEnvelopeErrors `json:"errors,required"`
Messages []CallNewResponseEnvelopeMessages `json:"messages,required"`
- Result CallNewResponse `json:"result,required"`
+ Result CallsAppWithSecret `json:"result,required"`
// Whether the API call was successful
Success CallNewResponseEnvelopeSuccess `json:"success,required"`
JSON callNewResponseEnvelopeJSON `json:"-"`
@@ -359,7 +267,7 @@ func (r CallUpdateParams) MarshalJSON() (data []byte, err error) {
type CallUpdateResponseEnvelope struct {
Errors []CallUpdateResponseEnvelopeErrors `json:"errors,required"`
Messages []CallUpdateResponseEnvelopeMessages `json:"messages,required"`
- Result CallUpdateResponse `json:"result,required"`
+ Result CallsApp `json:"result,required"`
// Whether the API call was successful
Success CallUpdateResponseEnvelopeSuccess `json:"success,required"`
JSON callUpdateResponseEnvelopeJSON `json:"-"`
@@ -445,7 +353,7 @@ type CallListParams struct {
type CallListResponseEnvelope struct {
Errors []CallListResponseEnvelopeErrors `json:"errors,required"`
Messages []CallListResponseEnvelopeMessages `json:"messages,required"`
- Result []CallListResponse `json:"result,required"`
+ Result []CallsApp `json:"result,required"`
// Whether the API call was successful
Success CallListResponseEnvelopeSuccess `json:"success,required"`
JSON callListResponseEnvelopeJSON `json:"-"`
@@ -531,7 +439,7 @@ type CallDeleteParams struct {
type CallDeleteResponseEnvelope struct {
Errors []CallDeleteResponseEnvelopeErrors `json:"errors,required"`
Messages []CallDeleteResponseEnvelopeMessages `json:"messages,required"`
- Result CallDeleteResponse `json:"result,required"`
+ Result CallsApp `json:"result,required"`
// Whether the API call was successful
Success CallDeleteResponseEnvelopeSuccess `json:"success,required"`
JSON callDeleteResponseEnvelopeJSON `json:"-"`
@@ -617,7 +525,7 @@ type CallGetParams struct {
type CallGetResponseEnvelope struct {
Errors []CallGetResponseEnvelopeErrors `json:"errors,required"`
Messages []CallGetResponseEnvelopeMessages `json:"messages,required"`
- Result CallGetResponse `json:"result,required"`
+ Result CallsApp `json:"result,required"`
// Whether the API call was successful
Success CallGetResponseEnvelopeSuccess `json:"success,required"`
JSON callGetResponseEnvelopeJSON `json:"-"`
diff --git a/call_test.go b/calls/call_test.go
similarity index 93%
rename from call_test.go
rename to calls/call_test.go
index d6fd53b4e7d..300984e98ee 100644
--- a/call_test.go
+++ b/calls/call_test.go
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package cloudflare_test
+package calls_test
import (
"context"
@@ -9,6 +9,7 @@ import (
"testing"
"github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/calls"
"github.com/cloudflare/cloudflare-go/internal/testutil"
"github.com/cloudflare/cloudflare-go/option"
)
@@ -27,7 +28,7 @@ func TestCallNewWithOptionalParams(t *testing.T) {
option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"),
option.WithAPIEmail("user@example.com"),
)
- _, err := client.Calls.New(context.TODO(), cloudflare.CallNewParams{
+ _, err := client.Calls.New(context.TODO(), calls.CallNewParams{
AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
Name: cloudflare.F("production-realtime-app"),
})
@@ -57,7 +58,7 @@ func TestCallUpdateWithOptionalParams(t *testing.T) {
_, err := client.Calls.Update(
context.TODO(),
"2a95132c15732412d22c1476fa83f27a",
- cloudflare.CallUpdateParams{
+ calls.CallUpdateParams{
AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
Name: cloudflare.F("production-realtime-app"),
},
@@ -85,7 +86,7 @@ func TestCallList(t *testing.T) {
option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"),
option.WithAPIEmail("user@example.com"),
)
- _, err := client.Calls.List(context.TODO(), cloudflare.CallListParams{
+ _, err := client.Calls.List(context.TODO(), calls.CallListParams{
AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
})
if err != nil {
@@ -114,7 +115,7 @@ func TestCallDelete(t *testing.T) {
_, err := client.Calls.Delete(
context.TODO(),
"2a95132c15732412d22c1476fa83f27a",
- cloudflare.CallDeleteParams{
+ calls.CallDeleteParams{
AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
},
)
@@ -144,7 +145,7 @@ func TestCallGet(t *testing.T) {
_, err := client.Calls.Get(
context.TODO(),
"2a95132c15732412d22c1476fa83f27a",
- cloudflare.CallGetParams{
+ calls.CallGetParams{
AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
},
)
diff --git a/certificate_authorities/aliases.go b/certificate_authorities/aliases.go
new file mode 100644
index 00000000000..690e081945b
--- /dev/null
+++ b/certificate_authorities/aliases.go
@@ -0,0 +1,9 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package certificate_authorities
+
+import (
+ "github.com/cloudflare/cloudflare-go/internal/apierror"
+)
+
+type Error = apierror.Error
diff --git a/certificateauthority.go b/certificate_authorities/certificateauthority.go
similarity index 84%
rename from certificateauthority.go
rename to certificate_authorities/certificateauthority.go
index d7680729f9b..888604c3761 100644
--- a/certificateauthority.go
+++ b/certificate_authorities/certificateauthority.go
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package cloudflare
+package certificate_authorities
import (
"github.com/cloudflare/cloudflare-go/option"
@@ -13,7 +13,7 @@ import (
// method instead.
type CertificateAuthorityService struct {
Options []option.RequestOption
- HostnameAssociations *CertificateAuthorityHostnameAssociationService
+ HostnameAssociations *HostnameAssociationService
}
// NewCertificateAuthorityService generates a new service that applies the given
@@ -22,6 +22,6 @@ type CertificateAuthorityService struct {
func NewCertificateAuthorityService(opts ...option.RequestOption) (r *CertificateAuthorityService) {
r = &CertificateAuthorityService{}
r.Options = opts
- r.HostnameAssociations = NewCertificateAuthorityHostnameAssociationService(opts...)
+ r.HostnameAssociations = NewHostnameAssociationService(opts...)
return
}
diff --git a/certificate_authorities/hostnameassociation.go b/certificate_authorities/hostnameassociation.go
new file mode 100644
index 00000000000..c9d49a8e50c
--- /dev/null
+++ b/certificate_authorities/hostnameassociation.go
@@ -0,0 +1,280 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package certificate_authorities
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// HostnameAssociationService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewHostnameAssociationService]
+// method instead.
+type HostnameAssociationService struct {
+ Options []option.RequestOption
+}
+
+// NewHostnameAssociationService generates a new service that applies the given
+// options to each request. These options are applied after the parent client's
+// options (if there is one), and before any request-specific options.
+func NewHostnameAssociationService(opts ...option.RequestOption) (r *HostnameAssociationService) {
+ r = &HostnameAssociationService{}
+ r.Options = opts
+ return
+}
+
+// Replace Hostname Associations
+func (r *HostnameAssociationService) Update(ctx context.Context, params HostnameAssociationUpdateParams, opts ...option.RequestOption) (res *TLSCertificatesAndHostnamesHostnameAssociation, err error) {
+ opts = append(r.Options[:], opts...)
+ var env HostnameAssociationUpdateResponseEnvelope
+ path := fmt.Sprintf("zones/%s/certificate_authorities/hostname_associations", params.ZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// List Hostname Associations
+func (r *HostnameAssociationService) Get(ctx context.Context, params HostnameAssociationGetParams, opts ...option.RequestOption) (res *TLSCertificatesAndHostnamesHostnameAssociation, err error) {
+ opts = append(r.Options[:], opts...)
+ var env HostnameAssociationGetResponseEnvelope
+ path := fmt.Sprintf("zones/%s/certificate_authorities/hostname_associations", params.ZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type TLSCertificatesAndHostnamesHostnameAssociation struct {
+ Hostnames []string `json:"hostnames"`
+ // The UUID for a certificate that was uploaded to the mTLS Certificate Management
+ // endpoint. If no mtls_certificate_id is given, the hostnames will be associated
+ // to your active Cloudflare Managed CA.
+ MTLSCertificateID string `json:"mtls_certificate_id"`
+ JSON tlsCertificatesAndHostnamesHostnameAssociationJSON `json:"-"`
+}
+
+// tlsCertificatesAndHostnamesHostnameAssociationJSON contains the JSON metadata
+// for the struct [TLSCertificatesAndHostnamesHostnameAssociation]
+type tlsCertificatesAndHostnamesHostnameAssociationJSON struct {
+ Hostnames apijson.Field
+ MTLSCertificateID apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *TLSCertificatesAndHostnamesHostnameAssociation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r tlsCertificatesAndHostnamesHostnameAssociationJSON) RawJSON() string {
+ return r.raw
+}
+
+type HostnameAssociationUpdateParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+ Hostnames param.Field[[]string] `json:"hostnames"`
+ // The UUID for a certificate that was uploaded to the mTLS Certificate Management
+ // endpoint. If no mtls_certificate_id is given, the hostnames will be associated
+ // to your active Cloudflare Managed CA.
+ MTLSCertificateID param.Field[string] `json:"mtls_certificate_id"`
+}
+
+func (r HostnameAssociationUpdateParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type HostnameAssociationUpdateResponseEnvelope struct {
+ Errors []HostnameAssociationUpdateResponseEnvelopeErrors `json:"errors,required"`
+ Messages []HostnameAssociationUpdateResponseEnvelopeMessages `json:"messages,required"`
+ Result TLSCertificatesAndHostnamesHostnameAssociation `json:"result,required"`
+ // Whether the API call was successful
+ Success HostnameAssociationUpdateResponseEnvelopeSuccess `json:"success,required"`
+ JSON hostnameAssociationUpdateResponseEnvelopeJSON `json:"-"`
+}
+
+// hostnameAssociationUpdateResponseEnvelopeJSON contains the JSON metadata for the
+// struct [HostnameAssociationUpdateResponseEnvelope]
+type hostnameAssociationUpdateResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HostnameAssociationUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r hostnameAssociationUpdateResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type HostnameAssociationUpdateResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON hostnameAssociationUpdateResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// hostnameAssociationUpdateResponseEnvelopeErrorsJSON contains the JSON metadata
+// for the struct [HostnameAssociationUpdateResponseEnvelopeErrors]
+type hostnameAssociationUpdateResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HostnameAssociationUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r hostnameAssociationUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type HostnameAssociationUpdateResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON hostnameAssociationUpdateResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// hostnameAssociationUpdateResponseEnvelopeMessagesJSON contains the JSON metadata
+// for the struct [HostnameAssociationUpdateResponseEnvelopeMessages]
+type hostnameAssociationUpdateResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HostnameAssociationUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r hostnameAssociationUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type HostnameAssociationUpdateResponseEnvelopeSuccess bool
+
+const (
+ HostnameAssociationUpdateResponseEnvelopeSuccessTrue HostnameAssociationUpdateResponseEnvelopeSuccess = true
+)
+
+type HostnameAssociationGetParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+ // The UUID to match against for a certificate that was uploaded to the mTLS
+ // Certificate Management endpoint. If no mtls_certificate_id is given, the results
+ // will be the hostnames associated to your active Cloudflare Managed CA.
+ MTLSCertificateID param.Field[string] `query:"mtls_certificate_id"`
+}
+
+// URLQuery serializes [HostnameAssociationGetParams]'s query parameters as
+// `url.Values`.
+func (r HostnameAssociationGetParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type HostnameAssociationGetResponseEnvelope struct {
+ Errors []HostnameAssociationGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []HostnameAssociationGetResponseEnvelopeMessages `json:"messages,required"`
+ Result TLSCertificatesAndHostnamesHostnameAssociation `json:"result,required"`
+ // Whether the API call was successful
+ Success HostnameAssociationGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON hostnameAssociationGetResponseEnvelopeJSON `json:"-"`
+}
+
+// hostnameAssociationGetResponseEnvelopeJSON contains the JSON metadata for the
+// struct [HostnameAssociationGetResponseEnvelope]
+type hostnameAssociationGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HostnameAssociationGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r hostnameAssociationGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type HostnameAssociationGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON hostnameAssociationGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// hostnameAssociationGetResponseEnvelopeErrorsJSON contains the JSON metadata for
+// the struct [HostnameAssociationGetResponseEnvelopeErrors]
+type hostnameAssociationGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HostnameAssociationGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r hostnameAssociationGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type HostnameAssociationGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON hostnameAssociationGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// hostnameAssociationGetResponseEnvelopeMessagesJSON contains the JSON metadata
+// for the struct [HostnameAssociationGetResponseEnvelopeMessages]
+type hostnameAssociationGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HostnameAssociationGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r hostnameAssociationGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type HostnameAssociationGetResponseEnvelopeSuccess bool
+
+const (
+ HostnameAssociationGetResponseEnvelopeSuccessTrue HostnameAssociationGetResponseEnvelopeSuccess = true
+)
diff --git a/certificate_authorities/hostnameassociation_test.go b/certificate_authorities/hostnameassociation_test.go
new file mode 100644
index 00000000000..f53be0dc82d
--- /dev/null
+++ b/certificate_authorities/hostnameassociation_test.go
@@ -0,0 +1,70 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package certificate_authorities_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/certificate_authorities"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestHostnameAssociationUpdateWithOptionalParams(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"),
+ )
+ _, err := client.CertificateAuthorities.HostnameAssociations.Update(context.TODO(), certificate_authorities.HostnameAssociationUpdateParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Hostnames: cloudflare.F([]string{"api.example.com", "api.example.com", "api.example.com"}),
+ MTLSCertificateID: cloudflare.F("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"),
+ })
+ 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())
+ }
+}
+
+func TestHostnameAssociationGetWithOptionalParams(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"),
+ )
+ _, err := client.CertificateAuthorities.HostnameAssociations.Get(context.TODO(), certificate_authorities.HostnameAssociationGetParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ MTLSCertificateID: cloudflare.F("b2134436-2555-4acf-be5b-26c48136575e"),
+ })
+ 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/certificateauthorityhostnameassociation.go b/certificateauthorityhostnameassociation.go
deleted file mode 100644
index d1315bdace7..00000000000
--- a/certificateauthorityhostnameassociation.go
+++ /dev/null
@@ -1,313 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// CertificateAuthorityHostnameAssociationService contains methods and other
-// services that help with interacting with the cloudflare API. Note, unlike
-// clients, this service does not read variables from the environment
-// automatically. You should not instantiate this service directly, and instead use
-// the [NewCertificateAuthorityHostnameAssociationService] method instead.
-type CertificateAuthorityHostnameAssociationService struct {
- Options []option.RequestOption
-}
-
-// NewCertificateAuthorityHostnameAssociationService generates a new service that
-// applies the given options to each request. These options are applied after the
-// parent client's options (if there is one), and before any request-specific
-// options.
-func NewCertificateAuthorityHostnameAssociationService(opts ...option.RequestOption) (r *CertificateAuthorityHostnameAssociationService) {
- r = &CertificateAuthorityHostnameAssociationService{}
- r.Options = opts
- return
-}
-
-// Replace Hostname Associations
-func (r *CertificateAuthorityHostnameAssociationService) Update(ctx context.Context, params CertificateAuthorityHostnameAssociationUpdateParams, opts ...option.RequestOption) (res *CertificateAuthorityHostnameAssociationUpdateResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env CertificateAuthorityHostnameAssociationUpdateResponseEnvelope
- path := fmt.Sprintf("zones/%s/certificate_authorities/hostname_associations", params.ZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// List Hostname Associations
-func (r *CertificateAuthorityHostnameAssociationService) Get(ctx context.Context, params CertificateAuthorityHostnameAssociationGetParams, opts ...option.RequestOption) (res *CertificateAuthorityHostnameAssociationGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env CertificateAuthorityHostnameAssociationGetResponseEnvelope
- path := fmt.Sprintf("zones/%s/certificate_authorities/hostname_associations", params.ZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type CertificateAuthorityHostnameAssociationUpdateResponse struct {
- Hostnames []string `json:"hostnames"`
- // The UUID for a certificate that was uploaded to the mTLS Certificate Management
- // endpoint. If no mtls_certificate_id is given, the hostnames will be associated
- // to your active Cloudflare Managed CA.
- MTLSCertificateID string `json:"mtls_certificate_id"`
- JSON certificateAuthorityHostnameAssociationUpdateResponseJSON `json:"-"`
-}
-
-// certificateAuthorityHostnameAssociationUpdateResponseJSON contains the JSON
-// metadata for the struct [CertificateAuthorityHostnameAssociationUpdateResponse]
-type certificateAuthorityHostnameAssociationUpdateResponseJSON struct {
- Hostnames apijson.Field
- MTLSCertificateID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CertificateAuthorityHostnameAssociationUpdateResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r certificateAuthorityHostnameAssociationUpdateResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type CertificateAuthorityHostnameAssociationGetResponse struct {
- Hostnames []string `json:"hostnames"`
- // The UUID for a certificate that was uploaded to the mTLS Certificate Management
- // endpoint. If no mtls_certificate_id is given, the hostnames will be associated
- // to your active Cloudflare Managed CA.
- MTLSCertificateID string `json:"mtls_certificate_id"`
- JSON certificateAuthorityHostnameAssociationGetResponseJSON `json:"-"`
-}
-
-// certificateAuthorityHostnameAssociationGetResponseJSON contains the JSON
-// metadata for the struct [CertificateAuthorityHostnameAssociationGetResponse]
-type certificateAuthorityHostnameAssociationGetResponseJSON struct {
- Hostnames apijson.Field
- MTLSCertificateID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CertificateAuthorityHostnameAssociationGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r certificateAuthorityHostnameAssociationGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type CertificateAuthorityHostnameAssociationUpdateParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
- Hostnames param.Field[[]string] `json:"hostnames"`
- // The UUID for a certificate that was uploaded to the mTLS Certificate Management
- // endpoint. If no mtls_certificate_id is given, the hostnames will be associated
- // to your active Cloudflare Managed CA.
- MTLSCertificateID param.Field[string] `json:"mtls_certificate_id"`
-}
-
-func (r CertificateAuthorityHostnameAssociationUpdateParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type CertificateAuthorityHostnameAssociationUpdateResponseEnvelope struct {
- Errors []CertificateAuthorityHostnameAssociationUpdateResponseEnvelopeErrors `json:"errors,required"`
- Messages []CertificateAuthorityHostnameAssociationUpdateResponseEnvelopeMessages `json:"messages,required"`
- Result CertificateAuthorityHostnameAssociationUpdateResponse `json:"result,required"`
- // Whether the API call was successful
- Success CertificateAuthorityHostnameAssociationUpdateResponseEnvelopeSuccess `json:"success,required"`
- JSON certificateAuthorityHostnameAssociationUpdateResponseEnvelopeJSON `json:"-"`
-}
-
-// certificateAuthorityHostnameAssociationUpdateResponseEnvelopeJSON contains the
-// JSON metadata for the struct
-// [CertificateAuthorityHostnameAssociationUpdateResponseEnvelope]
-type certificateAuthorityHostnameAssociationUpdateResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CertificateAuthorityHostnameAssociationUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r certificateAuthorityHostnameAssociationUpdateResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type CertificateAuthorityHostnameAssociationUpdateResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON certificateAuthorityHostnameAssociationUpdateResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// certificateAuthorityHostnameAssociationUpdateResponseEnvelopeErrorsJSON contains
-// the JSON metadata for the struct
-// [CertificateAuthorityHostnameAssociationUpdateResponseEnvelopeErrors]
-type certificateAuthorityHostnameAssociationUpdateResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CertificateAuthorityHostnameAssociationUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r certificateAuthorityHostnameAssociationUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type CertificateAuthorityHostnameAssociationUpdateResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON certificateAuthorityHostnameAssociationUpdateResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// certificateAuthorityHostnameAssociationUpdateResponseEnvelopeMessagesJSON
-// contains the JSON metadata for the struct
-// [CertificateAuthorityHostnameAssociationUpdateResponseEnvelopeMessages]
-type certificateAuthorityHostnameAssociationUpdateResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CertificateAuthorityHostnameAssociationUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r certificateAuthorityHostnameAssociationUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type CertificateAuthorityHostnameAssociationUpdateResponseEnvelopeSuccess bool
-
-const (
- CertificateAuthorityHostnameAssociationUpdateResponseEnvelopeSuccessTrue CertificateAuthorityHostnameAssociationUpdateResponseEnvelopeSuccess = true
-)
-
-type CertificateAuthorityHostnameAssociationGetParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
- // The UUID to match against for a certificate that was uploaded to the mTLS
- // Certificate Management endpoint. If no mtls_certificate_id is given, the results
- // will be the hostnames associated to your active Cloudflare Managed CA.
- MTLSCertificateID param.Field[string] `query:"mtls_certificate_id"`
-}
-
-// URLQuery serializes [CertificateAuthorityHostnameAssociationGetParams]'s query
-// parameters as `url.Values`.
-func (r CertificateAuthorityHostnameAssociationGetParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type CertificateAuthorityHostnameAssociationGetResponseEnvelope struct {
- Errors []CertificateAuthorityHostnameAssociationGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []CertificateAuthorityHostnameAssociationGetResponseEnvelopeMessages `json:"messages,required"`
- Result CertificateAuthorityHostnameAssociationGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success CertificateAuthorityHostnameAssociationGetResponseEnvelopeSuccess `json:"success,required"`
- JSON certificateAuthorityHostnameAssociationGetResponseEnvelopeJSON `json:"-"`
-}
-
-// certificateAuthorityHostnameAssociationGetResponseEnvelopeJSON contains the JSON
-// metadata for the struct
-// [CertificateAuthorityHostnameAssociationGetResponseEnvelope]
-type certificateAuthorityHostnameAssociationGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CertificateAuthorityHostnameAssociationGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r certificateAuthorityHostnameAssociationGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type CertificateAuthorityHostnameAssociationGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON certificateAuthorityHostnameAssociationGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// certificateAuthorityHostnameAssociationGetResponseEnvelopeErrorsJSON contains
-// the JSON metadata for the struct
-// [CertificateAuthorityHostnameAssociationGetResponseEnvelopeErrors]
-type certificateAuthorityHostnameAssociationGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CertificateAuthorityHostnameAssociationGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r certificateAuthorityHostnameAssociationGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type CertificateAuthorityHostnameAssociationGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON certificateAuthorityHostnameAssociationGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// certificateAuthorityHostnameAssociationGetResponseEnvelopeMessagesJSON contains
-// the JSON metadata for the struct
-// [CertificateAuthorityHostnameAssociationGetResponseEnvelopeMessages]
-type certificateAuthorityHostnameAssociationGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CertificateAuthorityHostnameAssociationGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r certificateAuthorityHostnameAssociationGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type CertificateAuthorityHostnameAssociationGetResponseEnvelopeSuccess bool
-
-const (
- CertificateAuthorityHostnameAssociationGetResponseEnvelopeSuccessTrue CertificateAuthorityHostnameAssociationGetResponseEnvelopeSuccess = true
-)
diff --git a/certificateauthorityhostnameassociation_test.go b/certificateauthorityhostnameassociation_test.go
deleted file mode 100644
index 446f0f594aa..00000000000
--- a/certificateauthorityhostnameassociation_test.go
+++ /dev/null
@@ -1,69 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestCertificateAuthorityHostnameAssociationUpdateWithOptionalParams(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"),
- )
- _, err := client.CertificateAuthorities.HostnameAssociations.Update(context.TODO(), cloudflare.CertificateAuthorityHostnameAssociationUpdateParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Hostnames: cloudflare.F([]string{"api.example.com", "api.example.com", "api.example.com"}),
- MTLSCertificateID: cloudflare.F("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"),
- })
- 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())
- }
-}
-
-func TestCertificateAuthorityHostnameAssociationGetWithOptionalParams(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"),
- )
- _, err := client.CertificateAuthorities.HostnameAssociations.Get(context.TODO(), cloudflare.CertificateAuthorityHostnameAssociationGetParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- MTLSCertificateID: cloudflare.F("b2134436-2555-4acf-be5b-26c48136575e"),
- })
- 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/certificates/aliases.go b/certificates/aliases.go
new file mode 100644
index 00000000000..247483de752
--- /dev/null
+++ b/certificates/aliases.go
@@ -0,0 +1,9 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package certificates
+
+import (
+ "github.com/cloudflare/cloudflare-go/internal/apierror"
+)
+
+type Error = apierror.Error
diff --git a/certificate.go b/certificates/certificate.go
similarity index 98%
rename from certificate.go
rename to certificates/certificate.go
index 5173084f3e2..8bfd2dcff68 100644
--- a/certificate.go
+++ b/certificates/certificate.go
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package cloudflare
+package certificates
import (
"context"
@@ -159,9 +159,10 @@ const (
OriginCACertificateRequestedValidity5475 OriginCACertificateRequestedValidity = 5475
)
-// Union satisfied by [CertificateNewResponseUnknown] or [shared.UnionString].
+// Union satisfied by [certificates.CertificateNewResponseUnknown] or
+// [shared.UnionString].
type CertificateNewResponse interface {
- ImplementsCertificateNewResponse()
+ ImplementsCertificatesCertificateNewResponse()
}
func init() {
@@ -197,9 +198,10 @@ func (r certificateDeleteResponseJSON) RawJSON() string {
return r.raw
}
-// Union satisfied by [CertificateGetResponseUnknown] or [shared.UnionString].
+// Union satisfied by [certificates.CertificateGetResponseUnknown] or
+// [shared.UnionString].
type CertificateGetResponse interface {
- ImplementsCertificateGetResponse()
+ ImplementsCertificatesCertificateGetResponse()
}
func init() {
diff --git a/certificate_test.go b/certificates/certificate_test.go
similarity index 90%
rename from certificate_test.go
rename to certificates/certificate_test.go
index 6042d295051..21ca360c70c 100644
--- a/certificate_test.go
+++ b/certificates/certificate_test.go
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package cloudflare_test
+package certificates_test
import (
"context"
@@ -9,6 +9,7 @@ import (
"testing"
"github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/certificates"
"github.com/cloudflare/cloudflare-go/internal/testutil"
"github.com/cloudflare/cloudflare-go/option"
)
@@ -27,11 +28,11 @@ func TestCertificateNewWithOptionalParams(t *testing.T) {
option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"),
option.WithAPIEmail("user@example.com"),
)
- _, err := client.Certificates.New(context.TODO(), cloudflare.CertificateNewParams{
+ _, err := client.Certificates.New(context.TODO(), certificates.CertificateNewParams{
Csr: cloudflare.F("-----BEGIN CERTIFICATE REQUEST-----\nMIICxzCCAa8CAQAwSDELMAkGA1UEBhMCVVMxFjAUBgNVBAgTDVNhbiBGcmFuY2lz\nY28xCzAJBgNVBAcTAkNBMRQwEgYDVQQDEwtleGFtcGxlLm5ldDCCASIwDQYJKoZI\nhvcNAQEBBQADggEPADCCAQoCggEBALxejtu4b+jPdFeFi6OUsye8TYJQBm3WfCvL\nHu5EvijMO/4Z2TImwASbwUF7Ir8OLgH+mGlQZeqyNvGoSOMEaZVXcYfpR1hlVak8\n4GGVr+04IGfOCqaBokaBFIwzclGZbzKmLGwIQioNxGfqFm6RGYGA3be2Je2iseBc\nN8GV1wYmvYE0RR+yWweJCTJ157exyRzu7sVxaEW9F87zBQLyOnwXc64rflXslRqi\ng7F7w5IaQYOl8yvmk/jEPCAha7fkiUfEpj4N12+oPRiMvleJF98chxjD4MH39c5I\nuOslULhrWunfh7GB1jwWNA9y44H0snrf+xvoy2TcHmxvma9Eln8CAwEAAaA6MDgG\nCSqGSIb3DQEJDjErMCkwJwYDVR0RBCAwHoILZXhhbXBsZS5uZXSCD3d3dy5leGFt\ncGxlLm5ldDANBgkqhkiG9w0BAQsFAAOCAQEAcBaX6dOnI8ncARrI9ZSF2AJX+8mx\npTHY2+Y2C0VvrVDGMtbBRH8R9yMbqWtlxeeNGf//LeMkSKSFa4kbpdx226lfui8/\nauRDBTJGx2R1ccUxmLZXx4my0W5iIMxunu+kez+BDlu7bTT2io0uXMRHue4i6quH\nyc5ibxvbJMjR7dqbcanVE10/34oprzXQsJ/VmSuZNXtjbtSKDlmcpw6To/eeAJ+J\nhXykcUihvHyG4A1m2R6qpANBjnA0pHexfwM/SgfzvpbvUg0T1ubmer8BgTwCKIWs\ndcWYTthM51JIqRBfNqy4QcBnX+GY05yltEEswQI55wdiS3CjTTA67sdbcQ==\n-----END CERTIFICATE REQUEST-----"),
Hostnames: cloudflare.F([]interface{}{"example.com", "*.example.com"}),
- RequestType: cloudflare.F(cloudflare.CertificateNewParamsRequestTypeOriginRsa),
- RequestedValidity: cloudflare.F(cloudflare.CertificateNewParamsRequestedValidity5475),
+ RequestType: cloudflare.F(certificates.CertificateNewParamsRequestTypeOriginRsa),
+ RequestedValidity: cloudflare.F(certificates.CertificateNewParamsRequestedValidity5475),
})
if err != nil {
var apierr *cloudflare.Error
@@ -56,7 +57,7 @@ func TestCertificateList(t *testing.T) {
option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"),
option.WithAPIEmail("user@example.com"),
)
- _, err := client.Certificates.List(context.TODO(), cloudflare.CertificateListParams{})
+ _, err := client.Certificates.List(context.TODO(), certificates.CertificateListParams{})
if err != nil {
var apierr *cloudflare.Error
if errors.As(err, &apierr) {
diff --git a/challenges/aliases.go b/challenges/aliases.go
new file mode 100644
index 00000000000..125f74d5e2f
--- /dev/null
+++ b/challenges/aliases.go
@@ -0,0 +1,9 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package challenges
+
+import (
+ "github.com/cloudflare/cloudflare-go/internal/apierror"
+)
+
+type Error = apierror.Error
diff --git a/challenge.go b/challenges/challenge.go
similarity index 89%
rename from challenge.go
rename to challenges/challenge.go
index f427e27ac85..8564a6d38f9 100644
--- a/challenge.go
+++ b/challenges/challenge.go
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package cloudflare
+package challenges
import (
"github.com/cloudflare/cloudflare-go/option"
@@ -12,7 +12,7 @@ import (
// service directly, and instead use the [NewChallengeService] method instead.
type ChallengeService struct {
Options []option.RequestOption
- Widgets *ChallengeWidgetService
+ Widgets *WidgetService
}
// NewChallengeService generates a new service that applies the given options to
@@ -21,6 +21,6 @@ type ChallengeService struct {
func NewChallengeService(opts ...option.RequestOption) (r *ChallengeService) {
r = &ChallengeService{}
r.Options = opts
- r.Widgets = NewChallengeWidgetService(opts...)
+ r.Widgets = NewWidgetService(opts...)
return
}
diff --git a/challenges/widget.go b/challenges/widget.go
new file mode 100644
index 00000000000..caa1ce2a150
--- /dev/null
+++ b/challenges/widget.go
@@ -0,0 +1,874 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package challenges
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// WidgetService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewWidgetService] method instead.
+type WidgetService struct {
+ Options []option.RequestOption
+}
+
+// NewWidgetService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewWidgetService(opts ...option.RequestOption) (r *WidgetService) {
+ r = &WidgetService{}
+ r.Options = opts
+ return
+}
+
+// Lists challenge widgets.
+func (r *WidgetService) New(ctx context.Context, accountIdentifier string, params WidgetNewParams, opts ...option.RequestOption) (res *NcChallengesAdminWidgetDetail, err error) {
+ opts = append(r.Options[:], opts...)
+ var env WidgetNewResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/challenges/widgets", accountIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Update the configuration of a widget.
+func (r *WidgetService) Update(ctx context.Context, accountIdentifier string, sitekey string, body WidgetUpdateParams, opts ...option.RequestOption) (res *NcChallengesAdminWidgetDetail, err error) {
+ opts = append(r.Options[:], opts...)
+ var env WidgetUpdateResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/challenges/widgets/%s", accountIdentifier, sitekey)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Lists all turnstile widgets of an account.
+func (r *WidgetService) List(ctx context.Context, accountIdentifier string, query WidgetListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[NcChallengesAdminWidgetList], err error) {
+ var raw *http.Response
+ opts = append(r.Options, opts...)
+ opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
+ path := fmt.Sprintf("accounts/%s/challenges/widgets", accountIdentifier)
+ cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...)
+ if err != nil {
+ return nil, err
+ }
+ err = cfg.Execute()
+ if err != nil {
+ return nil, err
+ }
+ res.SetPageConfig(cfg, raw)
+ return res, nil
+}
+
+// Lists all turnstile widgets of an account.
+func (r *WidgetService) ListAutoPaging(ctx context.Context, accountIdentifier string, query WidgetListParams, opts ...option.RequestOption) *shared.V4PagePaginationArrayAutoPager[NcChallengesAdminWidgetList] {
+ return shared.NewV4PagePaginationArrayAutoPager(r.List(ctx, accountIdentifier, query, opts...))
+}
+
+// Destroy a Turnstile Widget.
+func (r *WidgetService) Delete(ctx context.Context, accountIdentifier string, sitekey string, opts ...option.RequestOption) (res *NcChallengesAdminWidgetDetail, err error) {
+ opts = append(r.Options[:], opts...)
+ var env WidgetDeleteResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/challenges/widgets/%s", accountIdentifier, sitekey)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Show a single challenge widget configuration.
+func (r *WidgetService) Get(ctx context.Context, accountIdentifier string, sitekey string, opts ...option.RequestOption) (res *NcChallengesAdminWidgetDetail, err error) {
+ opts = append(r.Options[:], opts...)
+ var env WidgetGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/challenges/widgets/%s", accountIdentifier, sitekey)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Generate a new secret key for this widget. If `invalidate_immediately` is set to
+// `false`, the previous secret remains valid for 2 hours.
+//
+// Note that secrets cannot be rotated again during the grace period.
+func (r *WidgetService) RotateSecret(ctx context.Context, accountIdentifier string, sitekey string, body WidgetRotateSecretParams, opts ...option.RequestOption) (res *NcChallengesAdminWidgetDetail, err error) {
+ opts = append(r.Options[:], opts...)
+ var env WidgetRotateSecretResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/challenges/widgets/%s/rotate_secret", accountIdentifier, sitekey)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// A Turnstile widget's detailed configuration
+type NcChallengesAdminWidgetDetail struct {
+ // If bot_fight_mode is set to `true`, Cloudflare issues computationally expensive
+ // challenges in response to malicious bots (ENT only).
+ BotFightMode bool `json:"bot_fight_mode,required"`
+ // If Turnstile is embedded on a Cloudflare site and the widget should grant
+ // challenge clearance, this setting can determine the clearance level to be set
+ ClearanceLevel NcChallengesAdminWidgetDetailClearanceLevel `json:"clearance_level,required"`
+ // When the widget was created.
+ CreatedOn time.Time `json:"created_on,required" format:"date-time"`
+ Domains []string `json:"domains,required"`
+ // Widget Mode
+ Mode NcChallengesAdminWidgetDetailMode `json:"mode,required"`
+ // When the widget was modified.
+ ModifiedOn time.Time `json:"modified_on,required" format:"date-time"`
+ // Human readable widget name. Not unique. Cloudflare suggests that you set this to
+ // a meaningful string to make it easier to identify your widget, and where it is
+ // used.
+ Name string `json:"name,required"`
+ // Do not show any Cloudflare branding on the widget (ENT only).
+ Offlabel bool `json:"offlabel,required"`
+ // Region where this widget can be used.
+ Region NcChallengesAdminWidgetDetailRegion `json:"region,required"`
+ // Secret key for this widget.
+ Secret string `json:"secret,required"`
+ // Widget item identifier tag.
+ Sitekey string `json:"sitekey,required"`
+ JSON ncChallengesAdminWidgetDetailJSON `json:"-"`
+}
+
+// ncChallengesAdminWidgetDetailJSON contains the JSON metadata for the struct
+// [NcChallengesAdminWidgetDetail]
+type ncChallengesAdminWidgetDetailJSON struct {
+ BotFightMode apijson.Field
+ ClearanceLevel apijson.Field
+ CreatedOn apijson.Field
+ Domains apijson.Field
+ Mode apijson.Field
+ ModifiedOn apijson.Field
+ Name apijson.Field
+ Offlabel apijson.Field
+ Region apijson.Field
+ Secret apijson.Field
+ Sitekey apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *NcChallengesAdminWidgetDetail) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ncChallengesAdminWidgetDetailJSON) RawJSON() string {
+ return r.raw
+}
+
+// If Turnstile is embedded on a Cloudflare site and the widget should grant
+// challenge clearance, this setting can determine the clearance level to be set
+type NcChallengesAdminWidgetDetailClearanceLevel string
+
+const (
+ NcChallengesAdminWidgetDetailClearanceLevelNoClearance NcChallengesAdminWidgetDetailClearanceLevel = "no_clearance"
+ NcChallengesAdminWidgetDetailClearanceLevelJschallenge NcChallengesAdminWidgetDetailClearanceLevel = "jschallenge"
+ NcChallengesAdminWidgetDetailClearanceLevelManaged NcChallengesAdminWidgetDetailClearanceLevel = "managed"
+ NcChallengesAdminWidgetDetailClearanceLevelInteractive NcChallengesAdminWidgetDetailClearanceLevel = "interactive"
+)
+
+// Widget Mode
+type NcChallengesAdminWidgetDetailMode string
+
+const (
+ NcChallengesAdminWidgetDetailModeNonInteractive NcChallengesAdminWidgetDetailMode = "non-interactive"
+ NcChallengesAdminWidgetDetailModeInvisible NcChallengesAdminWidgetDetailMode = "invisible"
+ NcChallengesAdminWidgetDetailModeManaged NcChallengesAdminWidgetDetailMode = "managed"
+)
+
+// Region where this widget can be used.
+type NcChallengesAdminWidgetDetailRegion string
+
+const (
+ NcChallengesAdminWidgetDetailRegionWorld NcChallengesAdminWidgetDetailRegion = "world"
+)
+
+// A Turnstile Widgets configuration as it appears in listings
+type NcChallengesAdminWidgetList struct {
+ // If bot_fight_mode is set to `true`, Cloudflare issues computationally expensive
+ // challenges in response to malicious bots (ENT only).
+ BotFightMode bool `json:"bot_fight_mode,required"`
+ // If Turnstile is embedded on a Cloudflare site and the widget should grant
+ // challenge clearance, this setting can determine the clearance level to be set
+ ClearanceLevel NcChallengesAdminWidgetListClearanceLevel `json:"clearance_level,required"`
+ // When the widget was created.
+ CreatedOn time.Time `json:"created_on,required" format:"date-time"`
+ Domains []string `json:"domains,required"`
+ // Widget Mode
+ Mode NcChallengesAdminWidgetListMode `json:"mode,required"`
+ // When the widget was modified.
+ ModifiedOn time.Time `json:"modified_on,required" format:"date-time"`
+ // Human readable widget name. Not unique. Cloudflare suggests that you set this to
+ // a meaningful string to make it easier to identify your widget, and where it is
+ // used.
+ Name string `json:"name,required"`
+ // Do not show any Cloudflare branding on the widget (ENT only).
+ Offlabel bool `json:"offlabel,required"`
+ // Region where this widget can be used.
+ Region NcChallengesAdminWidgetListRegion `json:"region,required"`
+ // Widget item identifier tag.
+ Sitekey string `json:"sitekey,required"`
+ JSON ncChallengesAdminWidgetListJSON `json:"-"`
+}
+
+// ncChallengesAdminWidgetListJSON contains the JSON metadata for the struct
+// [NcChallengesAdminWidgetList]
+type ncChallengesAdminWidgetListJSON struct {
+ BotFightMode apijson.Field
+ ClearanceLevel apijson.Field
+ CreatedOn apijson.Field
+ Domains apijson.Field
+ Mode apijson.Field
+ ModifiedOn apijson.Field
+ Name apijson.Field
+ Offlabel apijson.Field
+ Region apijson.Field
+ Sitekey apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *NcChallengesAdminWidgetList) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ncChallengesAdminWidgetListJSON) RawJSON() string {
+ return r.raw
+}
+
+// If Turnstile is embedded on a Cloudflare site and the widget should grant
+// challenge clearance, this setting can determine the clearance level to be set
+type NcChallengesAdminWidgetListClearanceLevel string
+
+const (
+ NcChallengesAdminWidgetListClearanceLevelNoClearance NcChallengesAdminWidgetListClearanceLevel = "no_clearance"
+ NcChallengesAdminWidgetListClearanceLevelJschallenge NcChallengesAdminWidgetListClearanceLevel = "jschallenge"
+ NcChallengesAdminWidgetListClearanceLevelManaged NcChallengesAdminWidgetListClearanceLevel = "managed"
+ NcChallengesAdminWidgetListClearanceLevelInteractive NcChallengesAdminWidgetListClearanceLevel = "interactive"
+)
+
+// Widget Mode
+type NcChallengesAdminWidgetListMode string
+
+const (
+ NcChallengesAdminWidgetListModeNonInteractive NcChallengesAdminWidgetListMode = "non-interactive"
+ NcChallengesAdminWidgetListModeInvisible NcChallengesAdminWidgetListMode = "invisible"
+ NcChallengesAdminWidgetListModeManaged NcChallengesAdminWidgetListMode = "managed"
+)
+
+// Region where this widget can be used.
+type NcChallengesAdminWidgetListRegion string
+
+const (
+ NcChallengesAdminWidgetListRegionWorld NcChallengesAdminWidgetListRegion = "world"
+)
+
+type WidgetNewParams struct {
+ Domains param.Field[[]string] `json:"domains,required"`
+ // Widget Mode
+ Mode param.Field[WidgetNewParamsMode] `json:"mode,required"`
+ // Human readable widget name. Not unique. Cloudflare suggests that you set this to
+ // a meaningful string to make it easier to identify your widget, and where it is
+ // used.
+ Name param.Field[string] `json:"name,required"`
+ // Direction to order widgets.
+ Direction param.Field[WidgetNewParamsDirection] `query:"direction"`
+ // Field to order widgets by.
+ Order param.Field[WidgetNewParamsOrder] `query:"order"`
+ // Page number of paginated results.
+ Page param.Field[float64] `query:"page"`
+ // Number of items per page.
+ PerPage param.Field[float64] `query:"per_page"`
+ // If bot_fight_mode is set to `true`, Cloudflare issues computationally expensive
+ // challenges in response to malicious bots (ENT only).
+ BotFightMode param.Field[bool] `json:"bot_fight_mode"`
+ // If Turnstile is embedded on a Cloudflare site and the widget should grant
+ // challenge clearance, this setting can determine the clearance level to be set
+ ClearanceLevel param.Field[WidgetNewParamsClearanceLevel] `json:"clearance_level"`
+ // Do not show any Cloudflare branding on the widget (ENT only).
+ Offlabel param.Field[bool] `json:"offlabel"`
+ // Region where this widget can be used.
+ Region param.Field[WidgetNewParamsRegion] `json:"region"`
+}
+
+func (r WidgetNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// URLQuery serializes [WidgetNewParams]'s query parameters as `url.Values`.
+func (r WidgetNewParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Widget Mode
+type WidgetNewParamsMode string
+
+const (
+ WidgetNewParamsModeNonInteractive WidgetNewParamsMode = "non-interactive"
+ WidgetNewParamsModeInvisible WidgetNewParamsMode = "invisible"
+ WidgetNewParamsModeManaged WidgetNewParamsMode = "managed"
+)
+
+// Direction to order widgets.
+type WidgetNewParamsDirection string
+
+const (
+ WidgetNewParamsDirectionAsc WidgetNewParamsDirection = "asc"
+ WidgetNewParamsDirectionDesc WidgetNewParamsDirection = "desc"
+)
+
+// Field to order widgets by.
+type WidgetNewParamsOrder string
+
+const (
+ WidgetNewParamsOrderID WidgetNewParamsOrder = "id"
+ WidgetNewParamsOrderSitekey WidgetNewParamsOrder = "sitekey"
+ WidgetNewParamsOrderName WidgetNewParamsOrder = "name"
+ WidgetNewParamsOrderCreatedOn WidgetNewParamsOrder = "created_on"
+ WidgetNewParamsOrderModifiedOn WidgetNewParamsOrder = "modified_on"
+)
+
+// If Turnstile is embedded on a Cloudflare site and the widget should grant
+// challenge clearance, this setting can determine the clearance level to be set
+type WidgetNewParamsClearanceLevel string
+
+const (
+ WidgetNewParamsClearanceLevelNoClearance WidgetNewParamsClearanceLevel = "no_clearance"
+ WidgetNewParamsClearanceLevelJschallenge WidgetNewParamsClearanceLevel = "jschallenge"
+ WidgetNewParamsClearanceLevelManaged WidgetNewParamsClearanceLevel = "managed"
+ WidgetNewParamsClearanceLevelInteractive WidgetNewParamsClearanceLevel = "interactive"
+)
+
+// Region where this widget can be used.
+type WidgetNewParamsRegion string
+
+const (
+ WidgetNewParamsRegionWorld WidgetNewParamsRegion = "world"
+)
+
+type WidgetNewResponseEnvelope struct {
+ Errors []WidgetNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []WidgetNewResponseEnvelopeMessages `json:"messages,required"`
+ // Whether the API call was successful
+ Success bool `json:"success,required"`
+ // A Turnstile widget's detailed configuration
+ Result NcChallengesAdminWidgetDetail `json:"result"`
+ ResultInfo WidgetNewResponseEnvelopeResultInfo `json:"result_info"`
+ JSON widgetNewResponseEnvelopeJSON `json:"-"`
+}
+
+// widgetNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [WidgetNewResponseEnvelope]
+type widgetNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Success apijson.Field
+ Result apijson.Field
+ ResultInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WidgetNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r widgetNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type WidgetNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON widgetNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// widgetNewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [WidgetNewResponseEnvelopeErrors]
+type widgetNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WidgetNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r widgetNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type WidgetNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON widgetNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// widgetNewResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [WidgetNewResponseEnvelopeMessages]
+type widgetNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WidgetNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r widgetNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+type WidgetNewResponseEnvelopeResultInfo struct {
+ // Total number of results for the requested service
+ Count float64 `json:"count,required"`
+ // Current page within paginated list of results
+ Page float64 `json:"page,required"`
+ // Number of results per page of results
+ PerPage float64 `json:"per_page,required"`
+ // Total results available without any search parameters
+ TotalCount float64 `json:"total_count,required"`
+ JSON widgetNewResponseEnvelopeResultInfoJSON `json:"-"`
+}
+
+// widgetNewResponseEnvelopeResultInfoJSON contains the JSON metadata for the
+// struct [WidgetNewResponseEnvelopeResultInfo]
+type widgetNewResponseEnvelopeResultInfoJSON struct {
+ Count apijson.Field
+ Page apijson.Field
+ PerPage apijson.Field
+ TotalCount apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WidgetNewResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r widgetNewResponseEnvelopeResultInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type WidgetUpdateParams struct {
+ Domains param.Field[[]string] `json:"domains,required"`
+ // Widget Mode
+ Mode param.Field[WidgetUpdateParamsMode] `json:"mode,required"`
+ // Human readable widget name. Not unique. Cloudflare suggests that you set this to
+ // a meaningful string to make it easier to identify your widget, and where it is
+ // used.
+ Name param.Field[string] `json:"name,required"`
+ // If bot_fight_mode is set to `true`, Cloudflare issues computationally expensive
+ // challenges in response to malicious bots (ENT only).
+ BotFightMode param.Field[bool] `json:"bot_fight_mode"`
+ // If Turnstile is embedded on a Cloudflare site and the widget should grant
+ // challenge clearance, this setting can determine the clearance level to be set
+ ClearanceLevel param.Field[WidgetUpdateParamsClearanceLevel] `json:"clearance_level"`
+ // Do not show any Cloudflare branding on the widget (ENT only).
+ Offlabel param.Field[bool] `json:"offlabel"`
+}
+
+func (r WidgetUpdateParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Widget Mode
+type WidgetUpdateParamsMode string
+
+const (
+ WidgetUpdateParamsModeNonInteractive WidgetUpdateParamsMode = "non-interactive"
+ WidgetUpdateParamsModeInvisible WidgetUpdateParamsMode = "invisible"
+ WidgetUpdateParamsModeManaged WidgetUpdateParamsMode = "managed"
+)
+
+// If Turnstile is embedded on a Cloudflare site and the widget should grant
+// challenge clearance, this setting can determine the clearance level to be set
+type WidgetUpdateParamsClearanceLevel string
+
+const (
+ WidgetUpdateParamsClearanceLevelNoClearance WidgetUpdateParamsClearanceLevel = "no_clearance"
+ WidgetUpdateParamsClearanceLevelJschallenge WidgetUpdateParamsClearanceLevel = "jschallenge"
+ WidgetUpdateParamsClearanceLevelManaged WidgetUpdateParamsClearanceLevel = "managed"
+ WidgetUpdateParamsClearanceLevelInteractive WidgetUpdateParamsClearanceLevel = "interactive"
+)
+
+type WidgetUpdateResponseEnvelope struct {
+ Errors []WidgetUpdateResponseEnvelopeErrors `json:"errors,required"`
+ Messages []WidgetUpdateResponseEnvelopeMessages `json:"messages,required"`
+ // Whether the API call was successful
+ Success bool `json:"success,required"`
+ // A Turnstile widget's detailed configuration
+ Result NcChallengesAdminWidgetDetail `json:"result"`
+ JSON widgetUpdateResponseEnvelopeJSON `json:"-"`
+}
+
+// widgetUpdateResponseEnvelopeJSON contains the JSON metadata for the struct
+// [WidgetUpdateResponseEnvelope]
+type widgetUpdateResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Success apijson.Field
+ Result apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WidgetUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r widgetUpdateResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type WidgetUpdateResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON widgetUpdateResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// widgetUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [WidgetUpdateResponseEnvelopeErrors]
+type widgetUpdateResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WidgetUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r widgetUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type WidgetUpdateResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON widgetUpdateResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// widgetUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [WidgetUpdateResponseEnvelopeMessages]
+type widgetUpdateResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WidgetUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r widgetUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+type WidgetListParams struct {
+ // Direction to order widgets.
+ Direction param.Field[WidgetListParamsDirection] `query:"direction"`
+ // Field to order widgets by.
+ Order param.Field[WidgetListParamsOrder] `query:"order"`
+ // Page number of paginated results.
+ Page param.Field[float64] `query:"page"`
+ // Number of items per page.
+ PerPage param.Field[float64] `query:"per_page"`
+}
+
+// URLQuery serializes [WidgetListParams]'s query parameters as `url.Values`.
+func (r WidgetListParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Direction to order widgets.
+type WidgetListParamsDirection string
+
+const (
+ WidgetListParamsDirectionAsc WidgetListParamsDirection = "asc"
+ WidgetListParamsDirectionDesc WidgetListParamsDirection = "desc"
+)
+
+// Field to order widgets by.
+type WidgetListParamsOrder string
+
+const (
+ WidgetListParamsOrderID WidgetListParamsOrder = "id"
+ WidgetListParamsOrderSitekey WidgetListParamsOrder = "sitekey"
+ WidgetListParamsOrderName WidgetListParamsOrder = "name"
+ WidgetListParamsOrderCreatedOn WidgetListParamsOrder = "created_on"
+ WidgetListParamsOrderModifiedOn WidgetListParamsOrder = "modified_on"
+)
+
+type WidgetDeleteResponseEnvelope struct {
+ Errors []WidgetDeleteResponseEnvelopeErrors `json:"errors,required"`
+ Messages []WidgetDeleteResponseEnvelopeMessages `json:"messages,required"`
+ // Whether the API call was successful
+ Success bool `json:"success,required"`
+ // A Turnstile widget's detailed configuration
+ Result NcChallengesAdminWidgetDetail `json:"result"`
+ JSON widgetDeleteResponseEnvelopeJSON `json:"-"`
+}
+
+// widgetDeleteResponseEnvelopeJSON contains the JSON metadata for the struct
+// [WidgetDeleteResponseEnvelope]
+type widgetDeleteResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Success apijson.Field
+ Result apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WidgetDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r widgetDeleteResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type WidgetDeleteResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON widgetDeleteResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// widgetDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [WidgetDeleteResponseEnvelopeErrors]
+type widgetDeleteResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WidgetDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r widgetDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type WidgetDeleteResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON widgetDeleteResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// widgetDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [WidgetDeleteResponseEnvelopeMessages]
+type widgetDeleteResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WidgetDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r widgetDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+type WidgetGetResponseEnvelope struct {
+ Errors []WidgetGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []WidgetGetResponseEnvelopeMessages `json:"messages,required"`
+ // Whether the API call was successful
+ Success bool `json:"success,required"`
+ // A Turnstile widget's detailed configuration
+ Result NcChallengesAdminWidgetDetail `json:"result"`
+ JSON widgetGetResponseEnvelopeJSON `json:"-"`
+}
+
+// widgetGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [WidgetGetResponseEnvelope]
+type widgetGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Success apijson.Field
+ Result apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WidgetGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r widgetGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type WidgetGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON widgetGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// widgetGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [WidgetGetResponseEnvelopeErrors]
+type widgetGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WidgetGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r widgetGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type WidgetGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON widgetGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// widgetGetResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [WidgetGetResponseEnvelopeMessages]
+type widgetGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WidgetGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r widgetGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+type WidgetRotateSecretParams struct {
+ // If `invalidate_immediately` is set to `false`, the previous secret will remain
+ // valid for two hours. Otherwise, the secret is immediately invalidated, and
+ // requests using it will be rejected.
+ InvalidateImmediately param.Field[bool] `json:"invalidate_immediately"`
+}
+
+func (r WidgetRotateSecretParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type WidgetRotateSecretResponseEnvelope struct {
+ Errors []WidgetRotateSecretResponseEnvelopeErrors `json:"errors,required"`
+ Messages []WidgetRotateSecretResponseEnvelopeMessages `json:"messages,required"`
+ // Whether the API call was successful
+ Success bool `json:"success,required"`
+ // A Turnstile widget's detailed configuration
+ Result NcChallengesAdminWidgetDetail `json:"result"`
+ JSON widgetRotateSecretResponseEnvelopeJSON `json:"-"`
+}
+
+// widgetRotateSecretResponseEnvelopeJSON contains the JSON metadata for the struct
+// [WidgetRotateSecretResponseEnvelope]
+type widgetRotateSecretResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Success apijson.Field
+ Result apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WidgetRotateSecretResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r widgetRotateSecretResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type WidgetRotateSecretResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON widgetRotateSecretResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// widgetRotateSecretResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [WidgetRotateSecretResponseEnvelopeErrors]
+type widgetRotateSecretResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WidgetRotateSecretResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r widgetRotateSecretResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type WidgetRotateSecretResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON widgetRotateSecretResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// widgetRotateSecretResponseEnvelopeMessagesJSON contains the JSON metadata for
+// the struct [WidgetRotateSecretResponseEnvelopeMessages]
+type widgetRotateSecretResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WidgetRotateSecretResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r widgetRotateSecretResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/challenges/widget_test.go b/challenges/widget_test.go
new file mode 100644
index 00000000000..96dbf873020
--- /dev/null
+++ b/challenges/widget_test.go
@@ -0,0 +1,211 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package challenges_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/challenges"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestWidgetNewWithOptionalParams(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"),
+ )
+ _, err := client.Challenges.Widgets.New(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ challenges.WidgetNewParams{
+ Domains: cloudflare.F([]string{"203.0.113.1", "cloudflare.com", "blog.example.com"}),
+ Mode: cloudflare.F(challenges.WidgetNewParamsModeInvisible),
+ Name: cloudflare.F("blog.cloudflare.com login form"),
+ Direction: cloudflare.F(challenges.WidgetNewParamsDirectionAsc),
+ Order: cloudflare.F(challenges.WidgetNewParamsOrderID),
+ Page: cloudflare.F(1.000000),
+ PerPage: cloudflare.F(5.000000),
+ BotFightMode: cloudflare.F(true),
+ ClearanceLevel: cloudflare.F(challenges.WidgetNewParamsClearanceLevelInteractive),
+ Offlabel: cloudflare.F(true),
+ Region: cloudflare.F(challenges.WidgetNewParamsRegionWorld),
+ },
+ )
+ 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())
+ }
+}
+
+func TestWidgetUpdateWithOptionalParams(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"),
+ )
+ _, err := client.Challenges.Widgets.Update(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ "0x4AAF00AAAABn0R22HWm-YUc",
+ challenges.WidgetUpdateParams{
+ Domains: cloudflare.F([]string{"203.0.113.1", "cloudflare.com", "blog.example.com"}),
+ Mode: cloudflare.F(challenges.WidgetUpdateParamsModeInvisible),
+ Name: cloudflare.F("blog.cloudflare.com login form"),
+ BotFightMode: cloudflare.F(true),
+ ClearanceLevel: cloudflare.F(challenges.WidgetUpdateParamsClearanceLevelInteractive),
+ Offlabel: cloudflare.F(true),
+ },
+ )
+ 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())
+ }
+}
+
+func TestWidgetListWithOptionalParams(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"),
+ )
+ _, err := client.Challenges.Widgets.List(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ challenges.WidgetListParams{
+ Direction: cloudflare.F(challenges.WidgetListParamsDirectionAsc),
+ Order: cloudflare.F(challenges.WidgetListParamsOrderID),
+ Page: cloudflare.F(1.000000),
+ PerPage: cloudflare.F(5.000000),
+ },
+ )
+ 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())
+ }
+}
+
+func TestWidgetDelete(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"),
+ )
+ _, err := client.Challenges.Widgets.Delete(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ "0x4AAF00AAAABn0R22HWm-YUc",
+ )
+ 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())
+ }
+}
+
+func TestWidgetGet(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"),
+ )
+ _, err := client.Challenges.Widgets.Get(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ "0x4AAF00AAAABn0R22HWm-YUc",
+ )
+ 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())
+ }
+}
+
+func TestWidgetRotateSecretWithOptionalParams(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"),
+ )
+ _, err := client.Challenges.Widgets.RotateSecret(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ "0x4AAF00AAAABn0R22HWm-YUc",
+ challenges.WidgetRotateSecretParams{
+ InvalidateImmediately: cloudflare.F(true),
+ },
+ )
+ 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/challengewidget.go b/challengewidget.go
deleted file mode 100644
index 12157a91d90..00000000000
--- a/challengewidget.go
+++ /dev/null
@@ -1,1209 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// ChallengeWidgetService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewChallengeWidgetService] method
-// instead.
-type ChallengeWidgetService struct {
- Options []option.RequestOption
-}
-
-// NewChallengeWidgetService generates a new service that applies the given options
-// to each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewChallengeWidgetService(opts ...option.RequestOption) (r *ChallengeWidgetService) {
- r = &ChallengeWidgetService{}
- r.Options = opts
- return
-}
-
-// Lists challenge widgets.
-func (r *ChallengeWidgetService) New(ctx context.Context, accountIdentifier string, params ChallengeWidgetNewParams, opts ...option.RequestOption) (res *ChallengeWidgetNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env ChallengeWidgetNewResponseEnvelope
- path := fmt.Sprintf("accounts/%s/challenges/widgets", accountIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Update the configuration of a widget.
-func (r *ChallengeWidgetService) Update(ctx context.Context, accountIdentifier string, sitekey string, body ChallengeWidgetUpdateParams, opts ...option.RequestOption) (res *ChallengeWidgetUpdateResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env ChallengeWidgetUpdateResponseEnvelope
- path := fmt.Sprintf("accounts/%s/challenges/widgets/%s", accountIdentifier, sitekey)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Lists all turnstile widgets of an account.
-func (r *ChallengeWidgetService) List(ctx context.Context, accountIdentifier string, query ChallengeWidgetListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[ChallengeWidgetListResponse], err error) {
- var raw *http.Response
- opts = append(r.Options, opts...)
- opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
- path := fmt.Sprintf("accounts/%s/challenges/widgets", accountIdentifier)
- cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...)
- if err != nil {
- return nil, err
- }
- err = cfg.Execute()
- if err != nil {
- return nil, err
- }
- res.SetPageConfig(cfg, raw)
- return res, nil
-}
-
-// Lists all turnstile widgets of an account.
-func (r *ChallengeWidgetService) ListAutoPaging(ctx context.Context, accountIdentifier string, query ChallengeWidgetListParams, opts ...option.RequestOption) *shared.V4PagePaginationArrayAutoPager[ChallengeWidgetListResponse] {
- return shared.NewV4PagePaginationArrayAutoPager(r.List(ctx, accountIdentifier, query, opts...))
-}
-
-// Destroy a Turnstile Widget.
-func (r *ChallengeWidgetService) Delete(ctx context.Context, accountIdentifier string, sitekey string, opts ...option.RequestOption) (res *ChallengeWidgetDeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env ChallengeWidgetDeleteResponseEnvelope
- path := fmt.Sprintf("accounts/%s/challenges/widgets/%s", accountIdentifier, sitekey)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Show a single challenge widget configuration.
-func (r *ChallengeWidgetService) Get(ctx context.Context, accountIdentifier string, sitekey string, opts ...option.RequestOption) (res *ChallengeWidgetGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env ChallengeWidgetGetResponseEnvelope
- path := fmt.Sprintf("accounts/%s/challenges/widgets/%s", accountIdentifier, sitekey)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Generate a new secret key for this widget. If `invalidate_immediately` is set to
-// `false`, the previous secret remains valid for 2 hours.
-//
-// Note that secrets cannot be rotated again during the grace period.
-func (r *ChallengeWidgetService) RotateSecret(ctx context.Context, accountIdentifier string, sitekey string, body ChallengeWidgetRotateSecretParams, opts ...option.RequestOption) (res *ChallengeWidgetRotateSecretResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env ChallengeWidgetRotateSecretResponseEnvelope
- path := fmt.Sprintf("accounts/%s/challenges/widgets/%s/rotate_secret", accountIdentifier, sitekey)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// A Turnstile widget's detailed configuration
-type ChallengeWidgetNewResponse struct {
- // If bot_fight_mode is set to `true`, Cloudflare issues computationally expensive
- // challenges in response to malicious bots (ENT only).
- BotFightMode bool `json:"bot_fight_mode,required"`
- // If Turnstile is embedded on a Cloudflare site and the widget should grant
- // challenge clearance, this setting can determine the clearance level to be set
- ClearanceLevel ChallengeWidgetNewResponseClearanceLevel `json:"clearance_level,required"`
- // When the widget was created.
- CreatedOn time.Time `json:"created_on,required" format:"date-time"`
- Domains []string `json:"domains,required"`
- // Widget Mode
- Mode ChallengeWidgetNewResponseMode `json:"mode,required"`
- // When the widget was modified.
- ModifiedOn time.Time `json:"modified_on,required" format:"date-time"`
- // Human readable widget name. Not unique. Cloudflare suggests that you set this to
- // a meaningful string to make it easier to identify your widget, and where it is
- // used.
- Name string `json:"name,required"`
- // Do not show any Cloudflare branding on the widget (ENT only).
- Offlabel bool `json:"offlabel,required"`
- // Region where this widget can be used.
- Region ChallengeWidgetNewResponseRegion `json:"region,required"`
- // Secret key for this widget.
- Secret string `json:"secret,required"`
- // Widget item identifier tag.
- Sitekey string `json:"sitekey,required"`
- JSON challengeWidgetNewResponseJSON `json:"-"`
-}
-
-// challengeWidgetNewResponseJSON contains the JSON metadata for the struct
-// [ChallengeWidgetNewResponse]
-type challengeWidgetNewResponseJSON struct {
- BotFightMode apijson.Field
- ClearanceLevel apijson.Field
- CreatedOn apijson.Field
- Domains apijson.Field
- Mode apijson.Field
- ModifiedOn apijson.Field
- Name apijson.Field
- Offlabel apijson.Field
- Region apijson.Field
- Secret apijson.Field
- Sitekey apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ChallengeWidgetNewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r challengeWidgetNewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// If Turnstile is embedded on a Cloudflare site and the widget should grant
-// challenge clearance, this setting can determine the clearance level to be set
-type ChallengeWidgetNewResponseClearanceLevel string
-
-const (
- ChallengeWidgetNewResponseClearanceLevelNoClearance ChallengeWidgetNewResponseClearanceLevel = "no_clearance"
- ChallengeWidgetNewResponseClearanceLevelJschallenge ChallengeWidgetNewResponseClearanceLevel = "jschallenge"
- ChallengeWidgetNewResponseClearanceLevelManaged ChallengeWidgetNewResponseClearanceLevel = "managed"
- ChallengeWidgetNewResponseClearanceLevelInteractive ChallengeWidgetNewResponseClearanceLevel = "interactive"
-)
-
-// Widget Mode
-type ChallengeWidgetNewResponseMode string
-
-const (
- ChallengeWidgetNewResponseModeNonInteractive ChallengeWidgetNewResponseMode = "non-interactive"
- ChallengeWidgetNewResponseModeInvisible ChallengeWidgetNewResponseMode = "invisible"
- ChallengeWidgetNewResponseModeManaged ChallengeWidgetNewResponseMode = "managed"
-)
-
-// Region where this widget can be used.
-type ChallengeWidgetNewResponseRegion string
-
-const (
- ChallengeWidgetNewResponseRegionWorld ChallengeWidgetNewResponseRegion = "world"
-)
-
-// A Turnstile widget's detailed configuration
-type ChallengeWidgetUpdateResponse struct {
- // If bot_fight_mode is set to `true`, Cloudflare issues computationally expensive
- // challenges in response to malicious bots (ENT only).
- BotFightMode bool `json:"bot_fight_mode,required"`
- // If Turnstile is embedded on a Cloudflare site and the widget should grant
- // challenge clearance, this setting can determine the clearance level to be set
- ClearanceLevel ChallengeWidgetUpdateResponseClearanceLevel `json:"clearance_level,required"`
- // When the widget was created.
- CreatedOn time.Time `json:"created_on,required" format:"date-time"`
- Domains []string `json:"domains,required"`
- // Widget Mode
- Mode ChallengeWidgetUpdateResponseMode `json:"mode,required"`
- // When the widget was modified.
- ModifiedOn time.Time `json:"modified_on,required" format:"date-time"`
- // Human readable widget name. Not unique. Cloudflare suggests that you set this to
- // a meaningful string to make it easier to identify your widget, and where it is
- // used.
- Name string `json:"name,required"`
- // Do not show any Cloudflare branding on the widget (ENT only).
- Offlabel bool `json:"offlabel,required"`
- // Region where this widget can be used.
- Region ChallengeWidgetUpdateResponseRegion `json:"region,required"`
- // Secret key for this widget.
- Secret string `json:"secret,required"`
- // Widget item identifier tag.
- Sitekey string `json:"sitekey,required"`
- JSON challengeWidgetUpdateResponseJSON `json:"-"`
-}
-
-// challengeWidgetUpdateResponseJSON contains the JSON metadata for the struct
-// [ChallengeWidgetUpdateResponse]
-type challengeWidgetUpdateResponseJSON struct {
- BotFightMode apijson.Field
- ClearanceLevel apijson.Field
- CreatedOn apijson.Field
- Domains apijson.Field
- Mode apijson.Field
- ModifiedOn apijson.Field
- Name apijson.Field
- Offlabel apijson.Field
- Region apijson.Field
- Secret apijson.Field
- Sitekey apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ChallengeWidgetUpdateResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r challengeWidgetUpdateResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// If Turnstile is embedded on a Cloudflare site and the widget should grant
-// challenge clearance, this setting can determine the clearance level to be set
-type ChallengeWidgetUpdateResponseClearanceLevel string
-
-const (
- ChallengeWidgetUpdateResponseClearanceLevelNoClearance ChallengeWidgetUpdateResponseClearanceLevel = "no_clearance"
- ChallengeWidgetUpdateResponseClearanceLevelJschallenge ChallengeWidgetUpdateResponseClearanceLevel = "jschallenge"
- ChallengeWidgetUpdateResponseClearanceLevelManaged ChallengeWidgetUpdateResponseClearanceLevel = "managed"
- ChallengeWidgetUpdateResponseClearanceLevelInteractive ChallengeWidgetUpdateResponseClearanceLevel = "interactive"
-)
-
-// Widget Mode
-type ChallengeWidgetUpdateResponseMode string
-
-const (
- ChallengeWidgetUpdateResponseModeNonInteractive ChallengeWidgetUpdateResponseMode = "non-interactive"
- ChallengeWidgetUpdateResponseModeInvisible ChallengeWidgetUpdateResponseMode = "invisible"
- ChallengeWidgetUpdateResponseModeManaged ChallengeWidgetUpdateResponseMode = "managed"
-)
-
-// Region where this widget can be used.
-type ChallengeWidgetUpdateResponseRegion string
-
-const (
- ChallengeWidgetUpdateResponseRegionWorld ChallengeWidgetUpdateResponseRegion = "world"
-)
-
-// A Turnstile Widgets configuration as it appears in listings
-type ChallengeWidgetListResponse struct {
- // If bot_fight_mode is set to `true`, Cloudflare issues computationally expensive
- // challenges in response to malicious bots (ENT only).
- BotFightMode bool `json:"bot_fight_mode,required"`
- // If Turnstile is embedded on a Cloudflare site and the widget should grant
- // challenge clearance, this setting can determine the clearance level to be set
- ClearanceLevel ChallengeWidgetListResponseClearanceLevel `json:"clearance_level,required"`
- // When the widget was created.
- CreatedOn time.Time `json:"created_on,required" format:"date-time"`
- Domains []string `json:"domains,required"`
- // Widget Mode
- Mode ChallengeWidgetListResponseMode `json:"mode,required"`
- // When the widget was modified.
- ModifiedOn time.Time `json:"modified_on,required" format:"date-time"`
- // Human readable widget name. Not unique. Cloudflare suggests that you set this to
- // a meaningful string to make it easier to identify your widget, and where it is
- // used.
- Name string `json:"name,required"`
- // Do not show any Cloudflare branding on the widget (ENT only).
- Offlabel bool `json:"offlabel,required"`
- // Region where this widget can be used.
- Region ChallengeWidgetListResponseRegion `json:"region,required"`
- // Widget item identifier tag.
- Sitekey string `json:"sitekey,required"`
- JSON challengeWidgetListResponseJSON `json:"-"`
-}
-
-// challengeWidgetListResponseJSON contains the JSON metadata for the struct
-// [ChallengeWidgetListResponse]
-type challengeWidgetListResponseJSON struct {
- BotFightMode apijson.Field
- ClearanceLevel apijson.Field
- CreatedOn apijson.Field
- Domains apijson.Field
- Mode apijson.Field
- ModifiedOn apijson.Field
- Name apijson.Field
- Offlabel apijson.Field
- Region apijson.Field
- Sitekey apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ChallengeWidgetListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r challengeWidgetListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// If Turnstile is embedded on a Cloudflare site and the widget should grant
-// challenge clearance, this setting can determine the clearance level to be set
-type ChallengeWidgetListResponseClearanceLevel string
-
-const (
- ChallengeWidgetListResponseClearanceLevelNoClearance ChallengeWidgetListResponseClearanceLevel = "no_clearance"
- ChallengeWidgetListResponseClearanceLevelJschallenge ChallengeWidgetListResponseClearanceLevel = "jschallenge"
- ChallengeWidgetListResponseClearanceLevelManaged ChallengeWidgetListResponseClearanceLevel = "managed"
- ChallengeWidgetListResponseClearanceLevelInteractive ChallengeWidgetListResponseClearanceLevel = "interactive"
-)
-
-// Widget Mode
-type ChallengeWidgetListResponseMode string
-
-const (
- ChallengeWidgetListResponseModeNonInteractive ChallengeWidgetListResponseMode = "non-interactive"
- ChallengeWidgetListResponseModeInvisible ChallengeWidgetListResponseMode = "invisible"
- ChallengeWidgetListResponseModeManaged ChallengeWidgetListResponseMode = "managed"
-)
-
-// Region where this widget can be used.
-type ChallengeWidgetListResponseRegion string
-
-const (
- ChallengeWidgetListResponseRegionWorld ChallengeWidgetListResponseRegion = "world"
-)
-
-// A Turnstile widget's detailed configuration
-type ChallengeWidgetDeleteResponse struct {
- // If bot_fight_mode is set to `true`, Cloudflare issues computationally expensive
- // challenges in response to malicious bots (ENT only).
- BotFightMode bool `json:"bot_fight_mode,required"`
- // If Turnstile is embedded on a Cloudflare site and the widget should grant
- // challenge clearance, this setting can determine the clearance level to be set
- ClearanceLevel ChallengeWidgetDeleteResponseClearanceLevel `json:"clearance_level,required"`
- // When the widget was created.
- CreatedOn time.Time `json:"created_on,required" format:"date-time"`
- Domains []string `json:"domains,required"`
- // Widget Mode
- Mode ChallengeWidgetDeleteResponseMode `json:"mode,required"`
- // When the widget was modified.
- ModifiedOn time.Time `json:"modified_on,required" format:"date-time"`
- // Human readable widget name. Not unique. Cloudflare suggests that you set this to
- // a meaningful string to make it easier to identify your widget, and where it is
- // used.
- Name string `json:"name,required"`
- // Do not show any Cloudflare branding on the widget (ENT only).
- Offlabel bool `json:"offlabel,required"`
- // Region where this widget can be used.
- Region ChallengeWidgetDeleteResponseRegion `json:"region,required"`
- // Secret key for this widget.
- Secret string `json:"secret,required"`
- // Widget item identifier tag.
- Sitekey string `json:"sitekey,required"`
- JSON challengeWidgetDeleteResponseJSON `json:"-"`
-}
-
-// challengeWidgetDeleteResponseJSON contains the JSON metadata for the struct
-// [ChallengeWidgetDeleteResponse]
-type challengeWidgetDeleteResponseJSON struct {
- BotFightMode apijson.Field
- ClearanceLevel apijson.Field
- CreatedOn apijson.Field
- Domains apijson.Field
- Mode apijson.Field
- ModifiedOn apijson.Field
- Name apijson.Field
- Offlabel apijson.Field
- Region apijson.Field
- Secret apijson.Field
- Sitekey apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ChallengeWidgetDeleteResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r challengeWidgetDeleteResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// If Turnstile is embedded on a Cloudflare site and the widget should grant
-// challenge clearance, this setting can determine the clearance level to be set
-type ChallengeWidgetDeleteResponseClearanceLevel string
-
-const (
- ChallengeWidgetDeleteResponseClearanceLevelNoClearance ChallengeWidgetDeleteResponseClearanceLevel = "no_clearance"
- ChallengeWidgetDeleteResponseClearanceLevelJschallenge ChallengeWidgetDeleteResponseClearanceLevel = "jschallenge"
- ChallengeWidgetDeleteResponseClearanceLevelManaged ChallengeWidgetDeleteResponseClearanceLevel = "managed"
- ChallengeWidgetDeleteResponseClearanceLevelInteractive ChallengeWidgetDeleteResponseClearanceLevel = "interactive"
-)
-
-// Widget Mode
-type ChallengeWidgetDeleteResponseMode string
-
-const (
- ChallengeWidgetDeleteResponseModeNonInteractive ChallengeWidgetDeleteResponseMode = "non-interactive"
- ChallengeWidgetDeleteResponseModeInvisible ChallengeWidgetDeleteResponseMode = "invisible"
- ChallengeWidgetDeleteResponseModeManaged ChallengeWidgetDeleteResponseMode = "managed"
-)
-
-// Region where this widget can be used.
-type ChallengeWidgetDeleteResponseRegion string
-
-const (
- ChallengeWidgetDeleteResponseRegionWorld ChallengeWidgetDeleteResponseRegion = "world"
-)
-
-// A Turnstile widget's detailed configuration
-type ChallengeWidgetGetResponse struct {
- // If bot_fight_mode is set to `true`, Cloudflare issues computationally expensive
- // challenges in response to malicious bots (ENT only).
- BotFightMode bool `json:"bot_fight_mode,required"`
- // If Turnstile is embedded on a Cloudflare site and the widget should grant
- // challenge clearance, this setting can determine the clearance level to be set
- ClearanceLevel ChallengeWidgetGetResponseClearanceLevel `json:"clearance_level,required"`
- // When the widget was created.
- CreatedOn time.Time `json:"created_on,required" format:"date-time"`
- Domains []string `json:"domains,required"`
- // Widget Mode
- Mode ChallengeWidgetGetResponseMode `json:"mode,required"`
- // When the widget was modified.
- ModifiedOn time.Time `json:"modified_on,required" format:"date-time"`
- // Human readable widget name. Not unique. Cloudflare suggests that you set this to
- // a meaningful string to make it easier to identify your widget, and where it is
- // used.
- Name string `json:"name,required"`
- // Do not show any Cloudflare branding on the widget (ENT only).
- Offlabel bool `json:"offlabel,required"`
- // Region where this widget can be used.
- Region ChallengeWidgetGetResponseRegion `json:"region,required"`
- // Secret key for this widget.
- Secret string `json:"secret,required"`
- // Widget item identifier tag.
- Sitekey string `json:"sitekey,required"`
- JSON challengeWidgetGetResponseJSON `json:"-"`
-}
-
-// challengeWidgetGetResponseJSON contains the JSON metadata for the struct
-// [ChallengeWidgetGetResponse]
-type challengeWidgetGetResponseJSON struct {
- BotFightMode apijson.Field
- ClearanceLevel apijson.Field
- CreatedOn apijson.Field
- Domains apijson.Field
- Mode apijson.Field
- ModifiedOn apijson.Field
- Name apijson.Field
- Offlabel apijson.Field
- Region apijson.Field
- Secret apijson.Field
- Sitekey apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ChallengeWidgetGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r challengeWidgetGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// If Turnstile is embedded on a Cloudflare site and the widget should grant
-// challenge clearance, this setting can determine the clearance level to be set
-type ChallengeWidgetGetResponseClearanceLevel string
-
-const (
- ChallengeWidgetGetResponseClearanceLevelNoClearance ChallengeWidgetGetResponseClearanceLevel = "no_clearance"
- ChallengeWidgetGetResponseClearanceLevelJschallenge ChallengeWidgetGetResponseClearanceLevel = "jschallenge"
- ChallengeWidgetGetResponseClearanceLevelManaged ChallengeWidgetGetResponseClearanceLevel = "managed"
- ChallengeWidgetGetResponseClearanceLevelInteractive ChallengeWidgetGetResponseClearanceLevel = "interactive"
-)
-
-// Widget Mode
-type ChallengeWidgetGetResponseMode string
-
-const (
- ChallengeWidgetGetResponseModeNonInteractive ChallengeWidgetGetResponseMode = "non-interactive"
- ChallengeWidgetGetResponseModeInvisible ChallengeWidgetGetResponseMode = "invisible"
- ChallengeWidgetGetResponseModeManaged ChallengeWidgetGetResponseMode = "managed"
-)
-
-// Region where this widget can be used.
-type ChallengeWidgetGetResponseRegion string
-
-const (
- ChallengeWidgetGetResponseRegionWorld ChallengeWidgetGetResponseRegion = "world"
-)
-
-// A Turnstile widget's detailed configuration
-type ChallengeWidgetRotateSecretResponse struct {
- // If bot_fight_mode is set to `true`, Cloudflare issues computationally expensive
- // challenges in response to malicious bots (ENT only).
- BotFightMode bool `json:"bot_fight_mode,required"`
- // If Turnstile is embedded on a Cloudflare site and the widget should grant
- // challenge clearance, this setting can determine the clearance level to be set
- ClearanceLevel ChallengeWidgetRotateSecretResponseClearanceLevel `json:"clearance_level,required"`
- // When the widget was created.
- CreatedOn time.Time `json:"created_on,required" format:"date-time"`
- Domains []string `json:"domains,required"`
- // Widget Mode
- Mode ChallengeWidgetRotateSecretResponseMode `json:"mode,required"`
- // When the widget was modified.
- ModifiedOn time.Time `json:"modified_on,required" format:"date-time"`
- // Human readable widget name. Not unique. Cloudflare suggests that you set this to
- // a meaningful string to make it easier to identify your widget, and where it is
- // used.
- Name string `json:"name,required"`
- // Do not show any Cloudflare branding on the widget (ENT only).
- Offlabel bool `json:"offlabel,required"`
- // Region where this widget can be used.
- Region ChallengeWidgetRotateSecretResponseRegion `json:"region,required"`
- // Secret key for this widget.
- Secret string `json:"secret,required"`
- // Widget item identifier tag.
- Sitekey string `json:"sitekey,required"`
- JSON challengeWidgetRotateSecretResponseJSON `json:"-"`
-}
-
-// challengeWidgetRotateSecretResponseJSON contains the JSON metadata for the
-// struct [ChallengeWidgetRotateSecretResponse]
-type challengeWidgetRotateSecretResponseJSON struct {
- BotFightMode apijson.Field
- ClearanceLevel apijson.Field
- CreatedOn apijson.Field
- Domains apijson.Field
- Mode apijson.Field
- ModifiedOn apijson.Field
- Name apijson.Field
- Offlabel apijson.Field
- Region apijson.Field
- Secret apijson.Field
- Sitekey apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ChallengeWidgetRotateSecretResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r challengeWidgetRotateSecretResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// If Turnstile is embedded on a Cloudflare site and the widget should grant
-// challenge clearance, this setting can determine the clearance level to be set
-type ChallengeWidgetRotateSecretResponseClearanceLevel string
-
-const (
- ChallengeWidgetRotateSecretResponseClearanceLevelNoClearance ChallengeWidgetRotateSecretResponseClearanceLevel = "no_clearance"
- ChallengeWidgetRotateSecretResponseClearanceLevelJschallenge ChallengeWidgetRotateSecretResponseClearanceLevel = "jschallenge"
- ChallengeWidgetRotateSecretResponseClearanceLevelManaged ChallengeWidgetRotateSecretResponseClearanceLevel = "managed"
- ChallengeWidgetRotateSecretResponseClearanceLevelInteractive ChallengeWidgetRotateSecretResponseClearanceLevel = "interactive"
-)
-
-// Widget Mode
-type ChallengeWidgetRotateSecretResponseMode string
-
-const (
- ChallengeWidgetRotateSecretResponseModeNonInteractive ChallengeWidgetRotateSecretResponseMode = "non-interactive"
- ChallengeWidgetRotateSecretResponseModeInvisible ChallengeWidgetRotateSecretResponseMode = "invisible"
- ChallengeWidgetRotateSecretResponseModeManaged ChallengeWidgetRotateSecretResponseMode = "managed"
-)
-
-// Region where this widget can be used.
-type ChallengeWidgetRotateSecretResponseRegion string
-
-const (
- ChallengeWidgetRotateSecretResponseRegionWorld ChallengeWidgetRotateSecretResponseRegion = "world"
-)
-
-type ChallengeWidgetNewParams struct {
- Domains param.Field[[]string] `json:"domains,required"`
- // Widget Mode
- Mode param.Field[ChallengeWidgetNewParamsMode] `json:"mode,required"`
- // Human readable widget name. Not unique. Cloudflare suggests that you set this to
- // a meaningful string to make it easier to identify your widget, and where it is
- // used.
- Name param.Field[string] `json:"name,required"`
- // Direction to order widgets.
- Direction param.Field[ChallengeWidgetNewParamsDirection] `query:"direction"`
- // Field to order widgets by.
- Order param.Field[ChallengeWidgetNewParamsOrder] `query:"order"`
- // Page number of paginated results.
- Page param.Field[float64] `query:"page"`
- // Number of items per page.
- PerPage param.Field[float64] `query:"per_page"`
- // If bot_fight_mode is set to `true`, Cloudflare issues computationally expensive
- // challenges in response to malicious bots (ENT only).
- BotFightMode param.Field[bool] `json:"bot_fight_mode"`
- // If Turnstile is embedded on a Cloudflare site and the widget should grant
- // challenge clearance, this setting can determine the clearance level to be set
- ClearanceLevel param.Field[ChallengeWidgetNewParamsClearanceLevel] `json:"clearance_level"`
- // Do not show any Cloudflare branding on the widget (ENT only).
- Offlabel param.Field[bool] `json:"offlabel"`
- // Region where this widget can be used.
- Region param.Field[ChallengeWidgetNewParamsRegion] `json:"region"`
-}
-
-func (r ChallengeWidgetNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// URLQuery serializes [ChallengeWidgetNewParams]'s query parameters as
-// `url.Values`.
-func (r ChallengeWidgetNewParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Widget Mode
-type ChallengeWidgetNewParamsMode string
-
-const (
- ChallengeWidgetNewParamsModeNonInteractive ChallengeWidgetNewParamsMode = "non-interactive"
- ChallengeWidgetNewParamsModeInvisible ChallengeWidgetNewParamsMode = "invisible"
- ChallengeWidgetNewParamsModeManaged ChallengeWidgetNewParamsMode = "managed"
-)
-
-// Direction to order widgets.
-type ChallengeWidgetNewParamsDirection string
-
-const (
- ChallengeWidgetNewParamsDirectionAsc ChallengeWidgetNewParamsDirection = "asc"
- ChallengeWidgetNewParamsDirectionDesc ChallengeWidgetNewParamsDirection = "desc"
-)
-
-// Field to order widgets by.
-type ChallengeWidgetNewParamsOrder string
-
-const (
- ChallengeWidgetNewParamsOrderID ChallengeWidgetNewParamsOrder = "id"
- ChallengeWidgetNewParamsOrderSitekey ChallengeWidgetNewParamsOrder = "sitekey"
- ChallengeWidgetNewParamsOrderName ChallengeWidgetNewParamsOrder = "name"
- ChallengeWidgetNewParamsOrderCreatedOn ChallengeWidgetNewParamsOrder = "created_on"
- ChallengeWidgetNewParamsOrderModifiedOn ChallengeWidgetNewParamsOrder = "modified_on"
-)
-
-// If Turnstile is embedded on a Cloudflare site and the widget should grant
-// challenge clearance, this setting can determine the clearance level to be set
-type ChallengeWidgetNewParamsClearanceLevel string
-
-const (
- ChallengeWidgetNewParamsClearanceLevelNoClearance ChallengeWidgetNewParamsClearanceLevel = "no_clearance"
- ChallengeWidgetNewParamsClearanceLevelJschallenge ChallengeWidgetNewParamsClearanceLevel = "jschallenge"
- ChallengeWidgetNewParamsClearanceLevelManaged ChallengeWidgetNewParamsClearanceLevel = "managed"
- ChallengeWidgetNewParamsClearanceLevelInteractive ChallengeWidgetNewParamsClearanceLevel = "interactive"
-)
-
-// Region where this widget can be used.
-type ChallengeWidgetNewParamsRegion string
-
-const (
- ChallengeWidgetNewParamsRegionWorld ChallengeWidgetNewParamsRegion = "world"
-)
-
-type ChallengeWidgetNewResponseEnvelope struct {
- Errors []ChallengeWidgetNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []ChallengeWidgetNewResponseEnvelopeMessages `json:"messages,required"`
- // Whether the API call was successful
- Success bool `json:"success,required"`
- // A Turnstile widget's detailed configuration
- Result ChallengeWidgetNewResponse `json:"result"`
- ResultInfo ChallengeWidgetNewResponseEnvelopeResultInfo `json:"result_info"`
- JSON challengeWidgetNewResponseEnvelopeJSON `json:"-"`
-}
-
-// challengeWidgetNewResponseEnvelopeJSON contains the JSON metadata for the struct
-// [ChallengeWidgetNewResponseEnvelope]
-type challengeWidgetNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Success apijson.Field
- Result apijson.Field
- ResultInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ChallengeWidgetNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r challengeWidgetNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type ChallengeWidgetNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON challengeWidgetNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// challengeWidgetNewResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [ChallengeWidgetNewResponseEnvelopeErrors]
-type challengeWidgetNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ChallengeWidgetNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r challengeWidgetNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type ChallengeWidgetNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON challengeWidgetNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// challengeWidgetNewResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [ChallengeWidgetNewResponseEnvelopeMessages]
-type challengeWidgetNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ChallengeWidgetNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r challengeWidgetNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-type ChallengeWidgetNewResponseEnvelopeResultInfo struct {
- // Total number of results for the requested service
- Count float64 `json:"count,required"`
- // Current page within paginated list of results
- Page float64 `json:"page,required"`
- // Number of results per page of results
- PerPage float64 `json:"per_page,required"`
- // Total results available without any search parameters
- TotalCount float64 `json:"total_count,required"`
- JSON challengeWidgetNewResponseEnvelopeResultInfoJSON `json:"-"`
-}
-
-// challengeWidgetNewResponseEnvelopeResultInfoJSON contains the JSON metadata for
-// the struct [ChallengeWidgetNewResponseEnvelopeResultInfo]
-type challengeWidgetNewResponseEnvelopeResultInfoJSON struct {
- Count apijson.Field
- Page apijson.Field
- PerPage apijson.Field
- TotalCount apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ChallengeWidgetNewResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r challengeWidgetNewResponseEnvelopeResultInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type ChallengeWidgetUpdateParams struct {
- Domains param.Field[[]string] `json:"domains,required"`
- // Widget Mode
- Mode param.Field[ChallengeWidgetUpdateParamsMode] `json:"mode,required"`
- // Human readable widget name. Not unique. Cloudflare suggests that you set this to
- // a meaningful string to make it easier to identify your widget, and where it is
- // used.
- Name param.Field[string] `json:"name,required"`
- // If bot_fight_mode is set to `true`, Cloudflare issues computationally expensive
- // challenges in response to malicious bots (ENT only).
- BotFightMode param.Field[bool] `json:"bot_fight_mode"`
- // If Turnstile is embedded on a Cloudflare site and the widget should grant
- // challenge clearance, this setting can determine the clearance level to be set
- ClearanceLevel param.Field[ChallengeWidgetUpdateParamsClearanceLevel] `json:"clearance_level"`
- // Do not show any Cloudflare branding on the widget (ENT only).
- Offlabel param.Field[bool] `json:"offlabel"`
-}
-
-func (r ChallengeWidgetUpdateParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Widget Mode
-type ChallengeWidgetUpdateParamsMode string
-
-const (
- ChallengeWidgetUpdateParamsModeNonInteractive ChallengeWidgetUpdateParamsMode = "non-interactive"
- ChallengeWidgetUpdateParamsModeInvisible ChallengeWidgetUpdateParamsMode = "invisible"
- ChallengeWidgetUpdateParamsModeManaged ChallengeWidgetUpdateParamsMode = "managed"
-)
-
-// If Turnstile is embedded on a Cloudflare site and the widget should grant
-// challenge clearance, this setting can determine the clearance level to be set
-type ChallengeWidgetUpdateParamsClearanceLevel string
-
-const (
- ChallengeWidgetUpdateParamsClearanceLevelNoClearance ChallengeWidgetUpdateParamsClearanceLevel = "no_clearance"
- ChallengeWidgetUpdateParamsClearanceLevelJschallenge ChallengeWidgetUpdateParamsClearanceLevel = "jschallenge"
- ChallengeWidgetUpdateParamsClearanceLevelManaged ChallengeWidgetUpdateParamsClearanceLevel = "managed"
- ChallengeWidgetUpdateParamsClearanceLevelInteractive ChallengeWidgetUpdateParamsClearanceLevel = "interactive"
-)
-
-type ChallengeWidgetUpdateResponseEnvelope struct {
- Errors []ChallengeWidgetUpdateResponseEnvelopeErrors `json:"errors,required"`
- Messages []ChallengeWidgetUpdateResponseEnvelopeMessages `json:"messages,required"`
- // Whether the API call was successful
- Success bool `json:"success,required"`
- // A Turnstile widget's detailed configuration
- Result ChallengeWidgetUpdateResponse `json:"result"`
- JSON challengeWidgetUpdateResponseEnvelopeJSON `json:"-"`
-}
-
-// challengeWidgetUpdateResponseEnvelopeJSON contains the JSON metadata for the
-// struct [ChallengeWidgetUpdateResponseEnvelope]
-type challengeWidgetUpdateResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Success apijson.Field
- Result apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ChallengeWidgetUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r challengeWidgetUpdateResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type ChallengeWidgetUpdateResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON challengeWidgetUpdateResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// challengeWidgetUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [ChallengeWidgetUpdateResponseEnvelopeErrors]
-type challengeWidgetUpdateResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ChallengeWidgetUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r challengeWidgetUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type ChallengeWidgetUpdateResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON challengeWidgetUpdateResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// challengeWidgetUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [ChallengeWidgetUpdateResponseEnvelopeMessages]
-type challengeWidgetUpdateResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ChallengeWidgetUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r challengeWidgetUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-type ChallengeWidgetListParams struct {
- // Direction to order widgets.
- Direction param.Field[ChallengeWidgetListParamsDirection] `query:"direction"`
- // Field to order widgets by.
- Order param.Field[ChallengeWidgetListParamsOrder] `query:"order"`
- // Page number of paginated results.
- Page param.Field[float64] `query:"page"`
- // Number of items per page.
- PerPage param.Field[float64] `query:"per_page"`
-}
-
-// URLQuery serializes [ChallengeWidgetListParams]'s query parameters as
-// `url.Values`.
-func (r ChallengeWidgetListParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Direction to order widgets.
-type ChallengeWidgetListParamsDirection string
-
-const (
- ChallengeWidgetListParamsDirectionAsc ChallengeWidgetListParamsDirection = "asc"
- ChallengeWidgetListParamsDirectionDesc ChallengeWidgetListParamsDirection = "desc"
-)
-
-// Field to order widgets by.
-type ChallengeWidgetListParamsOrder string
-
-const (
- ChallengeWidgetListParamsOrderID ChallengeWidgetListParamsOrder = "id"
- ChallengeWidgetListParamsOrderSitekey ChallengeWidgetListParamsOrder = "sitekey"
- ChallengeWidgetListParamsOrderName ChallengeWidgetListParamsOrder = "name"
- ChallengeWidgetListParamsOrderCreatedOn ChallengeWidgetListParamsOrder = "created_on"
- ChallengeWidgetListParamsOrderModifiedOn ChallengeWidgetListParamsOrder = "modified_on"
-)
-
-type ChallengeWidgetDeleteResponseEnvelope struct {
- Errors []ChallengeWidgetDeleteResponseEnvelopeErrors `json:"errors,required"`
- Messages []ChallengeWidgetDeleteResponseEnvelopeMessages `json:"messages,required"`
- // Whether the API call was successful
- Success bool `json:"success,required"`
- // A Turnstile widget's detailed configuration
- Result ChallengeWidgetDeleteResponse `json:"result"`
- JSON challengeWidgetDeleteResponseEnvelopeJSON `json:"-"`
-}
-
-// challengeWidgetDeleteResponseEnvelopeJSON contains the JSON metadata for the
-// struct [ChallengeWidgetDeleteResponseEnvelope]
-type challengeWidgetDeleteResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Success apijson.Field
- Result apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ChallengeWidgetDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r challengeWidgetDeleteResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type ChallengeWidgetDeleteResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON challengeWidgetDeleteResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// challengeWidgetDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [ChallengeWidgetDeleteResponseEnvelopeErrors]
-type challengeWidgetDeleteResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ChallengeWidgetDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r challengeWidgetDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type ChallengeWidgetDeleteResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON challengeWidgetDeleteResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// challengeWidgetDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [ChallengeWidgetDeleteResponseEnvelopeMessages]
-type challengeWidgetDeleteResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ChallengeWidgetDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r challengeWidgetDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-type ChallengeWidgetGetResponseEnvelope struct {
- Errors []ChallengeWidgetGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []ChallengeWidgetGetResponseEnvelopeMessages `json:"messages,required"`
- // Whether the API call was successful
- Success bool `json:"success,required"`
- // A Turnstile widget's detailed configuration
- Result ChallengeWidgetGetResponse `json:"result"`
- JSON challengeWidgetGetResponseEnvelopeJSON `json:"-"`
-}
-
-// challengeWidgetGetResponseEnvelopeJSON contains the JSON metadata for the struct
-// [ChallengeWidgetGetResponseEnvelope]
-type challengeWidgetGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Success apijson.Field
- Result apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ChallengeWidgetGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r challengeWidgetGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type ChallengeWidgetGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON challengeWidgetGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// challengeWidgetGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [ChallengeWidgetGetResponseEnvelopeErrors]
-type challengeWidgetGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ChallengeWidgetGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r challengeWidgetGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type ChallengeWidgetGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON challengeWidgetGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// challengeWidgetGetResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [ChallengeWidgetGetResponseEnvelopeMessages]
-type challengeWidgetGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ChallengeWidgetGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r challengeWidgetGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-type ChallengeWidgetRotateSecretParams struct {
- // If `invalidate_immediately` is set to `false`, the previous secret will remain
- // valid for two hours. Otherwise, the secret is immediately invalidated, and
- // requests using it will be rejected.
- InvalidateImmediately param.Field[bool] `json:"invalidate_immediately"`
-}
-
-func (r ChallengeWidgetRotateSecretParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type ChallengeWidgetRotateSecretResponseEnvelope struct {
- Errors []ChallengeWidgetRotateSecretResponseEnvelopeErrors `json:"errors,required"`
- Messages []ChallengeWidgetRotateSecretResponseEnvelopeMessages `json:"messages,required"`
- // Whether the API call was successful
- Success bool `json:"success,required"`
- // A Turnstile widget's detailed configuration
- Result ChallengeWidgetRotateSecretResponse `json:"result"`
- JSON challengeWidgetRotateSecretResponseEnvelopeJSON `json:"-"`
-}
-
-// challengeWidgetRotateSecretResponseEnvelopeJSON contains the JSON metadata for
-// the struct [ChallengeWidgetRotateSecretResponseEnvelope]
-type challengeWidgetRotateSecretResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Success apijson.Field
- Result apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ChallengeWidgetRotateSecretResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r challengeWidgetRotateSecretResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type ChallengeWidgetRotateSecretResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON challengeWidgetRotateSecretResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// challengeWidgetRotateSecretResponseEnvelopeErrorsJSON contains the JSON metadata
-// for the struct [ChallengeWidgetRotateSecretResponseEnvelopeErrors]
-type challengeWidgetRotateSecretResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ChallengeWidgetRotateSecretResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r challengeWidgetRotateSecretResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type ChallengeWidgetRotateSecretResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON challengeWidgetRotateSecretResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// challengeWidgetRotateSecretResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct [ChallengeWidgetRotateSecretResponseEnvelopeMessages]
-type challengeWidgetRotateSecretResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ChallengeWidgetRotateSecretResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r challengeWidgetRotateSecretResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
diff --git a/challengewidget_test.go b/challengewidget_test.go
deleted file mode 100644
index c9e029a6eac..00000000000
--- a/challengewidget_test.go
+++ /dev/null
@@ -1,210 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestChallengeWidgetNewWithOptionalParams(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"),
- )
- _, err := client.Challenges.Widgets.New(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.ChallengeWidgetNewParams{
- Domains: cloudflare.F([]string{"203.0.113.1", "cloudflare.com", "blog.example.com"}),
- Mode: cloudflare.F(cloudflare.ChallengeWidgetNewParamsModeInvisible),
- Name: cloudflare.F("blog.cloudflare.com login form"),
- Direction: cloudflare.F(cloudflare.ChallengeWidgetNewParamsDirectionAsc),
- Order: cloudflare.F(cloudflare.ChallengeWidgetNewParamsOrderID),
- Page: cloudflare.F(1.000000),
- PerPage: cloudflare.F(5.000000),
- BotFightMode: cloudflare.F(true),
- ClearanceLevel: cloudflare.F(cloudflare.ChallengeWidgetNewParamsClearanceLevelInteractive),
- Offlabel: cloudflare.F(true),
- Region: cloudflare.F(cloudflare.ChallengeWidgetNewParamsRegionWorld),
- },
- )
- 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())
- }
-}
-
-func TestChallengeWidgetUpdateWithOptionalParams(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"),
- )
- _, err := client.Challenges.Widgets.Update(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- "0x4AAF00AAAABn0R22HWm-YUc",
- cloudflare.ChallengeWidgetUpdateParams{
- Domains: cloudflare.F([]string{"203.0.113.1", "cloudflare.com", "blog.example.com"}),
- Mode: cloudflare.F(cloudflare.ChallengeWidgetUpdateParamsModeInvisible),
- Name: cloudflare.F("blog.cloudflare.com login form"),
- BotFightMode: cloudflare.F(true),
- ClearanceLevel: cloudflare.F(cloudflare.ChallengeWidgetUpdateParamsClearanceLevelInteractive),
- Offlabel: cloudflare.F(true),
- },
- )
- 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())
- }
-}
-
-func TestChallengeWidgetListWithOptionalParams(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"),
- )
- _, err := client.Challenges.Widgets.List(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.ChallengeWidgetListParams{
- Direction: cloudflare.F(cloudflare.ChallengeWidgetListParamsDirectionAsc),
- Order: cloudflare.F(cloudflare.ChallengeWidgetListParamsOrderID),
- Page: cloudflare.F(1.000000),
- PerPage: cloudflare.F(5.000000),
- },
- )
- 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())
- }
-}
-
-func TestChallengeWidgetDelete(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"),
- )
- _, err := client.Challenges.Widgets.Delete(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- "0x4AAF00AAAABn0R22HWm-YUc",
- )
- 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())
- }
-}
-
-func TestChallengeWidgetGet(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"),
- )
- _, err := client.Challenges.Widgets.Get(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- "0x4AAF00AAAABn0R22HWm-YUc",
- )
- 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())
- }
-}
-
-func TestChallengeWidgetRotateSecretWithOptionalParams(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"),
- )
- _, err := client.Challenges.Widgets.RotateSecret(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- "0x4AAF00AAAABn0R22HWm-YUc",
- cloudflare.ChallengeWidgetRotateSecretParams{
- InvalidateImmediately: cloudflare.F(true),
- },
- )
- 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/client.go b/client.go
index cc9269e48e5..796f1024583 100644
--- a/client.go
+++ b/client.go
@@ -5,7 +5,87 @@ package cloudflare
import (
"os"
+ "github.com/cloudflare/cloudflare-go/accounts"
+ "github.com/cloudflare/cloudflare-go/acm"
+ "github.com/cloudflare/cloudflare-go/addressing"
+ "github.com/cloudflare/cloudflare-go/alerting"
+ "github.com/cloudflare/cloudflare-go/argo"
+ "github.com/cloudflare/cloudflare-go/audit_logs"
+ "github.com/cloudflare/cloudflare-go/available_plans"
+ "github.com/cloudflare/cloudflare-go/available_rate_plans"
+ "github.com/cloudflare/cloudflare-go/billing"
+ "github.com/cloudflare/cloudflare-go/bot_management"
+ "github.com/cloudflare/cloudflare-go/brand_protection"
+ "github.com/cloudflare/cloudflare-go/cache"
+ "github.com/cloudflare/cloudflare-go/calls"
+ "github.com/cloudflare/cloudflare-go/certificate_authorities"
+ "github.com/cloudflare/cloudflare-go/certificates"
+ "github.com/cloudflare/cloudflare-go/challenges"
+ "github.com/cloudflare/cloudflare-go/client_certificates"
+ "github.com/cloudflare/cloudflare-go/cloudforce_one"
+ "github.com/cloudflare/cloudflare-go/custom_certificates"
+ "github.com/cloudflare/cloudflare-go/custom_hostnames"
+ "github.com/cloudflare/cloudflare-go/custom_nameservers"
+ "github.com/cloudflare/cloudflare-go/d1"
+ "github.com/cloudflare/cloudflare-go/dcv_delegation"
+ "github.com/cloudflare/cloudflare-go/diagnostics"
+ "github.com/cloudflare/cloudflare-go/dns"
+ "github.com/cloudflare/cloudflare-go/dnssec"
+ "github.com/cloudflare/cloudflare-go/durable_objects"
+ "github.com/cloudflare/cloudflare-go/email_routing"
+ "github.com/cloudflare/cloudflare-go/filters"
+ "github.com/cloudflare/cloudflare-go/firewall"
+ "github.com/cloudflare/cloudflare-go/healthchecks"
+ "github.com/cloudflare/cloudflare-go/hostnames"
+ "github.com/cloudflare/cloudflare-go/hyperdrive"
+ "github.com/cloudflare/cloudflare-go/images"
+ "github.com/cloudflare/cloudflare-go/intel"
+ "github.com/cloudflare/cloudflare-go/ips"
+ "github.com/cloudflare/cloudflare-go/keyless_certificates"
+ "github.com/cloudflare/cloudflare-go/kv"
+ "github.com/cloudflare/cloudflare-go/load_balancers"
+ "github.com/cloudflare/cloudflare-go/logpush"
+ "github.com/cloudflare/cloudflare-go/logs"
+ "github.com/cloudflare/cloudflare-go/magic_network_monitoring"
+ "github.com/cloudflare/cloudflare-go/magic_transit"
+ "github.com/cloudflare/cloudflare-go/managed_headers"
+ "github.com/cloudflare/cloudflare-go/memberships"
+ "github.com/cloudflare/cloudflare-go/mtls_certificates"
"github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/origin_post_quantum_encryption"
+ "github.com/cloudflare/cloudflare-go/origin_tls_client_auth"
+ "github.com/cloudflare/cloudflare-go/page_shield"
+ "github.com/cloudflare/cloudflare-go/pagerules"
+ "github.com/cloudflare/cloudflare-go/pages"
+ "github.com/cloudflare/cloudflare-go/pcaps"
+ "github.com/cloudflare/cloudflare-go/queues"
+ "github.com/cloudflare/cloudflare-go/r2"
+ "github.com/cloudflare/cloudflare-go/radar"
+ "github.com/cloudflare/cloudflare-go/rate_limits"
+ "github.com/cloudflare/cloudflare-go/registrar"
+ "github.com/cloudflare/cloudflare-go/request_tracers"
+ "github.com/cloudflare/cloudflare-go/rules"
+ "github.com/cloudflare/cloudflare-go/rulesets"
+ "github.com/cloudflare/cloudflare-go/rum"
+ "github.com/cloudflare/cloudflare-go/secondary_dns"
+ "github.com/cloudflare/cloudflare-go/snippets"
+ "github.com/cloudflare/cloudflare-go/spectrum"
+ "github.com/cloudflare/cloudflare-go/speed"
+ "github.com/cloudflare/cloudflare-go/ssl"
+ "github.com/cloudflare/cloudflare-go/storage"
+ "github.com/cloudflare/cloudflare-go/stream"
+ "github.com/cloudflare/cloudflare-go/subscriptions"
+ "github.com/cloudflare/cloudflare-go/url_normalization"
+ "github.com/cloudflare/cloudflare-go/url_scanner"
+ "github.com/cloudflare/cloudflare-go/user"
+ "github.com/cloudflare/cloudflare-go/vectorize"
+ "github.com/cloudflare/cloudflare-go/waiting_rooms"
+ "github.com/cloudflare/cloudflare-go/warp_connector"
+ "github.com/cloudflare/cloudflare-go/web3"
+ "github.com/cloudflare/cloudflare-go/workers"
+ "github.com/cloudflare/cloudflare-go/workers_for_platforms"
+ "github.com/cloudflare/cloudflare-go/zero_trust"
+ "github.com/cloudflare/cloudflare-go/zones"
)
// Client creates a struct with services and top level methods that help with
@@ -13,86 +93,86 @@ import (
// directly, and instead use the [NewClient] method instead.
type Client struct {
Options []option.RequestOption
- Accounts *AccountService
- Certificates *CertificateService
- IPs *IPService
- Memberships *MembershipService
- User *UserService
- Zones *ZoneService
- LoadBalancers *LoadBalancerService
- Cache *CacheService
- SSL *SSLService
- Subscriptions *SubscriptionService
- ACM *ACMService
- Argo *ArgoService
- AvailablePlans *AvailablePlanService
- AvailableRatePlans *AvailableRatePlanService
- CertificateAuthorities *CertificateAuthorityService
- ClientCertificates *ClientCertificateService
- CustomCertificates *CustomCertificateService
- CustomHostnames *CustomHostnameService
- CustomNameservers *CustomNameserverService
- DNS *DNSService
- DNSSEC *DNSSECService
- EmailRouting *EmailRoutingService
- Filters *FilterService
- Firewall *FirewallService
- Healthchecks *HealthcheckService
- KeylessCertificates *KeylessCertificateService
- Logpush *LogpushService
- Logs *LogService
- OriginTLSClientAuth *OriginTLSClientAuthService
- Pagerules *PageruleService
- RateLimits *RateLimitService
- SecondaryDNS *SecondaryDNSService
- WaitingRooms *WaitingRoomService
- Web3 *Web3Service
- Workers *WorkerService
- KV *KVService
- DurableObjects *DurableObjectService
- Queues *QueueService
- ManagedHeaders *ManagedHeaderService
- PageShield *PageShieldService
- Rulesets *RulesetService
- URLNormalization *URLNormalizationService
- Spectrum *SpectrumService
- Addressing *AddressingService
- AuditLogs *AuditLogService
- Billing *BillingService
- BrandProtection *BrandProtectionService
- Diagnostics *DiagnosticService
- Images *ImageService
- Intel *IntelService
- MagicTransit *MagicTransitService
- MagicNetworkMonitoring *MagicNetworkMonitoringService
- MTLSCertificates *MTLSCertificateService
- Pages *PageService
- PCAPs *PCAPService
- Registrar *RegistrarService
- RequestTracers *RequestTracerService
- Rules *RuleService
- Storage *StorageService
- Stream *StreamService
- Alerting *AlertingService
- D1 *D1Service
- R2 *R2Service
- WARPConnector *WARPConnectorService
- WorkersForPlatforms *WorkersForPlatformService
- ZeroTrust *ZeroTrustService
- Challenges *ChallengeService
- Hyperdrive *HyperdriveService
- RUM *RUMService
- Vectorize *VectorizeService
- URLScanner *URLScannerService
- Radar *RadarService
- BotManagement *BotManagementService
- OriginPostQuantumEncryption *OriginPostQuantumEncryptionService
- Speed *SpeedService
- DCVDelegation *DCVDelegationService
- Hostnames *HostnameService
- Snippets *SnippetService
- Calls *CallService
- CloudforceOne *CloudforceOneService
+ Accounts *accounts.AccountService
+ Certificates *certificates.CertificateService
+ IPs *ips.IPService
+ Memberships *memberships.MembershipService
+ User *user.UserService
+ Zones *zones.ZoneService
+ LoadBalancers *load_balancers.LoadBalancerService
+ Cache *cache.CacheService
+ SSL *ssl.SSLService
+ Subscriptions *subscriptions.SubscriptionService
+ ACM *acm.ACMService
+ Argo *argo.ArgoService
+ AvailablePlans *available_plans.AvailablePlanService
+ AvailableRatePlans *available_rate_plans.AvailableRatePlanService
+ CertificateAuthorities *certificate_authorities.CertificateAuthorityService
+ ClientCertificates *client_certificates.ClientCertificateService
+ CustomCertificates *custom_certificates.CustomCertificateService
+ CustomHostnames *custom_hostnames.CustomHostnameService
+ CustomNameservers *custom_nameservers.CustomNameserverService
+ DNS *dns.DNSService
+ DNSSEC *dnssec.DNSSECService
+ EmailRouting *email_routing.EmailRoutingService
+ Filters *filters.FilterService
+ Firewall *firewall.FirewallService
+ Healthchecks *healthchecks.HealthcheckService
+ KeylessCertificates *keyless_certificates.KeylessCertificateService
+ Logpush *logpush.LogpushService
+ Logs *logs.LogService
+ OriginTLSClientAuth *origin_tls_client_auth.OriginTLSClientAuthService
+ Pagerules *pagerules.PageruleService
+ RateLimits *rate_limits.RateLimitService
+ SecondaryDNS *secondary_dns.SecondaryDNSService
+ WaitingRooms *waiting_rooms.WaitingRoomService
+ Web3 *web3.Web3Service
+ Workers *workers.WorkerService
+ KV *kv.KVService
+ DurableObjects *durable_objects.DurableObjectService
+ Queues *queues.QueueService
+ ManagedHeaders *managed_headers.ManagedHeaderService
+ PageShield *page_shield.PageShieldService
+ Rulesets *rulesets.RulesetService
+ URLNormalization *url_normalization.URLNormalizationService
+ Spectrum *spectrum.SpectrumService
+ Addressing *addressing.AddressingService
+ AuditLogs *audit_logs.AuditLogService
+ Billing *billing.BillingService
+ BrandProtection *brand_protection.BrandProtectionService
+ Diagnostics *diagnostics.DiagnosticService
+ Images *images.ImageService
+ Intel *intel.IntelService
+ MagicTransit *magic_transit.MagicTransitService
+ MagicNetworkMonitoring *magic_network_monitoring.MagicNetworkMonitoringService
+ MTLSCertificates *mtls_certificates.MTLSCertificateService
+ Pages *pages.PageService
+ PCAPs *pcaps.PCAPService
+ Registrar *registrar.RegistrarService
+ RequestTracers *request_tracers.RequestTracerService
+ Rules *rules.RuleService
+ Storage *storage.StorageService
+ Stream *stream.StreamService
+ Alerting *alerting.AlertingService
+ D1 *d1.D1Service
+ R2 *r2.R2Service
+ WARPConnector *warp_connector.WARPConnectorService
+ WorkersForPlatforms *workers_for_platforms.WorkersForPlatformService
+ ZeroTrust *zero_trust.ZeroTrustService
+ Challenges *challenges.ChallengeService
+ Hyperdrive *hyperdrive.HyperdriveService
+ RUM *rum.RUMService
+ Vectorize *vectorize.VectorizeService
+ URLScanner *url_scanner.URLScannerService
+ Radar *radar.RadarService
+ BotManagement *bot_management.BotManagementService
+ OriginPostQuantumEncryption *origin_post_quantum_encryption.OriginPostQuantumEncryptionService
+ Speed *speed.SpeedService
+ DCVDelegation *dcv_delegation.DCVDelegationService
+ Hostnames *hostnames.HostnameService
+ Snippets *snippets.SnippetService
+ Calls *calls.CallService
+ CloudforceOne *cloudforce_one.CloudforceOneService
}
// NewClient generates a new client with the default option read from the
@@ -118,86 +198,86 @@ func NewClient(opts ...option.RequestOption) (r *Client) {
r = &Client{Options: opts}
- r.Accounts = NewAccountService(opts...)
- r.Certificates = NewCertificateService(opts...)
- r.IPs = NewIPService(opts...)
- r.Memberships = NewMembershipService(opts...)
- r.User = NewUserService(opts...)
- r.Zones = NewZoneService(opts...)
- r.LoadBalancers = NewLoadBalancerService(opts...)
- r.Cache = NewCacheService(opts...)
- r.SSL = NewSSLService(opts...)
- r.Subscriptions = NewSubscriptionService(opts...)
- r.ACM = NewACMService(opts...)
- r.Argo = NewArgoService(opts...)
- r.AvailablePlans = NewAvailablePlanService(opts...)
- r.AvailableRatePlans = NewAvailableRatePlanService(opts...)
- r.CertificateAuthorities = NewCertificateAuthorityService(opts...)
- r.ClientCertificates = NewClientCertificateService(opts...)
- r.CustomCertificates = NewCustomCertificateService(opts...)
- r.CustomHostnames = NewCustomHostnameService(opts...)
- r.CustomNameservers = NewCustomNameserverService(opts...)
- r.DNS = NewDNSService(opts...)
- r.DNSSEC = NewDNSSECService(opts...)
- r.EmailRouting = NewEmailRoutingService(opts...)
- r.Filters = NewFilterService(opts...)
- r.Firewall = NewFirewallService(opts...)
- r.Healthchecks = NewHealthcheckService(opts...)
- r.KeylessCertificates = NewKeylessCertificateService(opts...)
- r.Logpush = NewLogpushService(opts...)
- r.Logs = NewLogService(opts...)
- r.OriginTLSClientAuth = NewOriginTLSClientAuthService(opts...)
- r.Pagerules = NewPageruleService(opts...)
- r.RateLimits = NewRateLimitService(opts...)
- r.SecondaryDNS = NewSecondaryDNSService(opts...)
- r.WaitingRooms = NewWaitingRoomService(opts...)
- r.Web3 = NewWeb3Service(opts...)
- r.Workers = NewWorkerService(opts...)
- r.KV = NewKVService(opts...)
- r.DurableObjects = NewDurableObjectService(opts...)
- r.Queues = NewQueueService(opts...)
- r.ManagedHeaders = NewManagedHeaderService(opts...)
- r.PageShield = NewPageShieldService(opts...)
- r.Rulesets = NewRulesetService(opts...)
- r.URLNormalization = NewURLNormalizationService(opts...)
- r.Spectrum = NewSpectrumService(opts...)
- r.Addressing = NewAddressingService(opts...)
- r.AuditLogs = NewAuditLogService(opts...)
- r.Billing = NewBillingService(opts...)
- r.BrandProtection = NewBrandProtectionService(opts...)
- r.Diagnostics = NewDiagnosticService(opts...)
- r.Images = NewImageService(opts...)
- r.Intel = NewIntelService(opts...)
- r.MagicTransit = NewMagicTransitService(opts...)
- r.MagicNetworkMonitoring = NewMagicNetworkMonitoringService(opts...)
- r.MTLSCertificates = NewMTLSCertificateService(opts...)
- r.Pages = NewPageService(opts...)
- r.PCAPs = NewPCAPService(opts...)
- r.Registrar = NewRegistrarService(opts...)
- r.RequestTracers = NewRequestTracerService(opts...)
- r.Rules = NewRuleService(opts...)
- r.Storage = NewStorageService(opts...)
- r.Stream = NewStreamService(opts...)
- r.Alerting = NewAlertingService(opts...)
- r.D1 = NewD1Service(opts...)
- r.R2 = NewR2Service(opts...)
- r.WARPConnector = NewWARPConnectorService(opts...)
- r.WorkersForPlatforms = NewWorkersForPlatformService(opts...)
- r.ZeroTrust = NewZeroTrustService(opts...)
- r.Challenges = NewChallengeService(opts...)
- r.Hyperdrive = NewHyperdriveService(opts...)
- r.RUM = NewRUMService(opts...)
- r.Vectorize = NewVectorizeService(opts...)
- r.URLScanner = NewURLScannerService(opts...)
- r.Radar = NewRadarService(opts...)
- r.BotManagement = NewBotManagementService(opts...)
- r.OriginPostQuantumEncryption = NewOriginPostQuantumEncryptionService(opts...)
- r.Speed = NewSpeedService(opts...)
- r.DCVDelegation = NewDCVDelegationService(opts...)
- r.Hostnames = NewHostnameService(opts...)
- r.Snippets = NewSnippetService(opts...)
- r.Calls = NewCallService(opts...)
- r.CloudforceOne = NewCloudforceOneService(opts...)
+ r.Accounts = accounts.NewAccountService(opts...)
+ r.Certificates = certificates.NewCertificateService(opts...)
+ r.IPs = ips.NewIPService(opts...)
+ r.Memberships = memberships.NewMembershipService(opts...)
+ r.User = user.NewUserService(opts...)
+ r.Zones = zones.NewZoneService(opts...)
+ r.LoadBalancers = load_balancers.NewLoadBalancerService(opts...)
+ r.Cache = cache.NewCacheService(opts...)
+ r.SSL = ssl.NewSSLService(opts...)
+ r.Subscriptions = subscriptions.NewSubscriptionService(opts...)
+ r.ACM = acm.NewACMService(opts...)
+ r.Argo = argo.NewArgoService(opts...)
+ r.AvailablePlans = available_plans.NewAvailablePlanService(opts...)
+ r.AvailableRatePlans = available_rate_plans.NewAvailableRatePlanService(opts...)
+ r.CertificateAuthorities = certificate_authorities.NewCertificateAuthorityService(opts...)
+ r.ClientCertificates = client_certificates.NewClientCertificateService(opts...)
+ r.CustomCertificates = custom_certificates.NewCustomCertificateService(opts...)
+ r.CustomHostnames = custom_hostnames.NewCustomHostnameService(opts...)
+ r.CustomNameservers = custom_nameservers.NewCustomNameserverService(opts...)
+ r.DNS = dns.NewDNSService(opts...)
+ r.DNSSEC = dnssec.NewDNSSECService(opts...)
+ r.EmailRouting = email_routing.NewEmailRoutingService(opts...)
+ r.Filters = filters.NewFilterService(opts...)
+ r.Firewall = firewall.NewFirewallService(opts...)
+ r.Healthchecks = healthchecks.NewHealthcheckService(opts...)
+ r.KeylessCertificates = keyless_certificates.NewKeylessCertificateService(opts...)
+ r.Logpush = logpush.NewLogpushService(opts...)
+ r.Logs = logs.NewLogService(opts...)
+ r.OriginTLSClientAuth = origin_tls_client_auth.NewOriginTLSClientAuthService(opts...)
+ r.Pagerules = pagerules.NewPageruleService(opts...)
+ r.RateLimits = rate_limits.NewRateLimitService(opts...)
+ r.SecondaryDNS = secondary_dns.NewSecondaryDNSService(opts...)
+ r.WaitingRooms = waiting_rooms.NewWaitingRoomService(opts...)
+ r.Web3 = web3.NewWeb3Service(opts...)
+ r.Workers = workers.NewWorkerService(opts...)
+ r.KV = kv.NewKVService(opts...)
+ r.DurableObjects = durable_objects.NewDurableObjectService(opts...)
+ r.Queues = queues.NewQueueService(opts...)
+ r.ManagedHeaders = managed_headers.NewManagedHeaderService(opts...)
+ r.PageShield = page_shield.NewPageShieldService(opts...)
+ r.Rulesets = rulesets.NewRulesetService(opts...)
+ r.URLNormalization = url_normalization.NewURLNormalizationService(opts...)
+ r.Spectrum = spectrum.NewSpectrumService(opts...)
+ r.Addressing = addressing.NewAddressingService(opts...)
+ r.AuditLogs = audit_logs.NewAuditLogService(opts...)
+ r.Billing = billing.NewBillingService(opts...)
+ r.BrandProtection = brand_protection.NewBrandProtectionService(opts...)
+ r.Diagnostics = diagnostics.NewDiagnosticService(opts...)
+ r.Images = images.NewImageService(opts...)
+ r.Intel = intel.NewIntelService(opts...)
+ r.MagicTransit = magic_transit.NewMagicTransitService(opts...)
+ r.MagicNetworkMonitoring = magic_network_monitoring.NewMagicNetworkMonitoringService(opts...)
+ r.MTLSCertificates = mtls_certificates.NewMTLSCertificateService(opts...)
+ r.Pages = pages.NewPageService(opts...)
+ r.PCAPs = pcaps.NewPCAPService(opts...)
+ r.Registrar = registrar.NewRegistrarService(opts...)
+ r.RequestTracers = request_tracers.NewRequestTracerService(opts...)
+ r.Rules = rules.NewRuleService(opts...)
+ r.Storage = storage.NewStorageService(opts...)
+ r.Stream = stream.NewStreamService(opts...)
+ r.Alerting = alerting.NewAlertingService(opts...)
+ r.D1 = d1.NewD1Service(opts...)
+ r.R2 = r2.NewR2Service(opts...)
+ r.WARPConnector = warp_connector.NewWARPConnectorService(opts...)
+ r.WorkersForPlatforms = workers_for_platforms.NewWorkersForPlatformService(opts...)
+ r.ZeroTrust = zero_trust.NewZeroTrustService(opts...)
+ r.Challenges = challenges.NewChallengeService(opts...)
+ r.Hyperdrive = hyperdrive.NewHyperdriveService(opts...)
+ r.RUM = rum.NewRUMService(opts...)
+ r.Vectorize = vectorize.NewVectorizeService(opts...)
+ r.URLScanner = url_scanner.NewURLScannerService(opts...)
+ r.Radar = radar.NewRadarService(opts...)
+ r.BotManagement = bot_management.NewBotManagementService(opts...)
+ r.OriginPostQuantumEncryption = origin_post_quantum_encryption.NewOriginPostQuantumEncryptionService(opts...)
+ r.Speed = speed.NewSpeedService(opts...)
+ r.DCVDelegation = dcv_delegation.NewDCVDelegationService(opts...)
+ r.Hostnames = hostnames.NewHostnameService(opts...)
+ r.Snippets = snippets.NewSnippetService(opts...)
+ r.Calls = calls.NewCallService(opts...)
+ r.CloudforceOne = cloudforce_one.NewCloudforceOneService(opts...)
return
}
diff --git a/client_certificates/aliases.go b/client_certificates/aliases.go
new file mode 100644
index 00000000000..5498011d1e3
--- /dev/null
+++ b/client_certificates/aliases.go
@@ -0,0 +1,9 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package client_certificates
+
+import (
+ "github.com/cloudflare/cloudflare-go/internal/apierror"
+)
+
+type Error = apierror.Error
diff --git a/client_certificates/clientcertificate.go b/client_certificates/clientcertificate.go
new file mode 100644
index 00000000000..cedac812eb4
--- /dev/null
+++ b/client_certificates/clientcertificate.go
@@ -0,0 +1,611 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package client_certificates
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// ClientCertificateService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewClientCertificateService] method
+// instead.
+type ClientCertificateService struct {
+ Options []option.RequestOption
+}
+
+// NewClientCertificateService generates a new service that applies the given
+// options to each request. These options are applied after the parent client's
+// options (if there is one), and before any request-specific options.
+func NewClientCertificateService(opts ...option.RequestOption) (r *ClientCertificateService) {
+ r = &ClientCertificateService{}
+ r.Options = opts
+ return
+}
+
+// Create a new API Shield mTLS Client Certificate
+func (r *ClientCertificateService) New(ctx context.Context, params ClientCertificateNewParams, opts ...option.RequestOption) (res *TLSCertificatesAndHostnamesClientCertificate, err error) {
+ opts = append(r.Options[:], opts...)
+ var env ClientCertificateNewResponseEnvelope
+ path := fmt.Sprintf("zones/%s/client_certificates", params.ZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// List all of your Zone's API Shield mTLS Client Certificates by Status and/or
+// using Pagination
+func (r *ClientCertificateService) List(ctx context.Context, params ClientCertificateListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[TLSCertificatesAndHostnamesClientCertificate], err error) {
+ var raw *http.Response
+ opts = append(r.Options, opts...)
+ opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
+ path := fmt.Sprintf("zones/%s/client_certificates", params.ZoneID)
+ cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, params, &res, opts...)
+ if err != nil {
+ return nil, err
+ }
+ err = cfg.Execute()
+ if err != nil {
+ return nil, err
+ }
+ res.SetPageConfig(cfg, raw)
+ return res, nil
+}
+
+// List all of your Zone's API Shield mTLS Client Certificates by Status and/or
+// using Pagination
+func (r *ClientCertificateService) ListAutoPaging(ctx context.Context, params ClientCertificateListParams, opts ...option.RequestOption) *shared.V4PagePaginationArrayAutoPager[TLSCertificatesAndHostnamesClientCertificate] {
+ return shared.NewV4PagePaginationArrayAutoPager(r.List(ctx, params, opts...))
+}
+
+// Set a API Shield mTLS Client Certificate to pending_revocation status for
+// processing to revoked status.
+func (r *ClientCertificateService) Delete(ctx context.Context, clientCertificateID string, body ClientCertificateDeleteParams, opts ...option.RequestOption) (res *TLSCertificatesAndHostnamesClientCertificate, err error) {
+ opts = append(r.Options[:], opts...)
+ var env ClientCertificateDeleteResponseEnvelope
+ path := fmt.Sprintf("zones/%s/client_certificates/%s", body.ZoneID, clientCertificateID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// If a API Shield mTLS Client Certificate is in a pending_revocation state, you
+// may reactivate it with this endpoint.
+func (r *ClientCertificateService) Edit(ctx context.Context, clientCertificateID string, body ClientCertificateEditParams, opts ...option.RequestOption) (res *TLSCertificatesAndHostnamesClientCertificate, err error) {
+ opts = append(r.Options[:], opts...)
+ var env ClientCertificateEditResponseEnvelope
+ path := fmt.Sprintf("zones/%s/client_certificates/%s", body.ZoneID, clientCertificateID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Get Details for a single mTLS API Shield Client Certificate
+func (r *ClientCertificateService) Get(ctx context.Context, clientCertificateID string, query ClientCertificateGetParams, opts ...option.RequestOption) (res *TLSCertificatesAndHostnamesClientCertificate, err error) {
+ opts = append(r.Options[:], opts...)
+ var env ClientCertificateGetResponseEnvelope
+ path := fmt.Sprintf("zones/%s/client_certificates/%s", query.ZoneID, clientCertificateID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type TLSCertificatesAndHostnamesClientCertificate struct {
+ // Identifier
+ ID string `json:"id"`
+ // The Client Certificate PEM
+ Certificate string `json:"certificate"`
+ // Certificate Authority used to issue the Client Certificate
+ CertificateAuthority TLSCertificatesAndHostnamesClientCertificateCertificateAuthority `json:"certificate_authority"`
+ // Common Name of the Client Certificate
+ CommonName string `json:"common_name"`
+ // Country, provided by the CSR
+ Country string `json:"country"`
+ // The Certificate Signing Request (CSR). Must be newline-encoded.
+ Csr string `json:"csr"`
+ // Date that the Client Certificate expires
+ ExpiresOn string `json:"expires_on"`
+ // Unique identifier of the Client Certificate
+ FingerprintSha256 string `json:"fingerprint_sha256"`
+ // Date that the Client Certificate was issued by the Certificate Authority
+ IssuedOn string `json:"issued_on"`
+ // Location, provided by the CSR
+ Location string `json:"location"`
+ // Organization, provided by the CSR
+ Organization string `json:"organization"`
+ // Organizational Unit, provided by the CSR
+ OrganizationalUnit string `json:"organizational_unit"`
+ // The serial number on the created Client Certificate.
+ SerialNumber string `json:"serial_number"`
+ // The type of hash used for the Client Certificate..
+ Signature string `json:"signature"`
+ // Subject Key Identifier
+ Ski string `json:"ski"`
+ // State, provided by the CSR
+ State string `json:"state"`
+ // Client Certificates may be active or revoked, and the pending_reactivation or
+ // pending_revocation represent in-progress asynchronous transitions
+ Status TLSCertificatesAndHostnamesClientCertificateStatus `json:"status"`
+ // The number of days the Client Certificate will be valid after the issued_on date
+ ValidityDays int64 `json:"validity_days"`
+ JSON tlsCertificatesAndHostnamesClientCertificateJSON `json:"-"`
+}
+
+// tlsCertificatesAndHostnamesClientCertificateJSON contains the JSON metadata for
+// the struct [TLSCertificatesAndHostnamesClientCertificate]
+type tlsCertificatesAndHostnamesClientCertificateJSON struct {
+ ID apijson.Field
+ Certificate apijson.Field
+ CertificateAuthority apijson.Field
+ CommonName apijson.Field
+ Country apijson.Field
+ Csr apijson.Field
+ ExpiresOn apijson.Field
+ FingerprintSha256 apijson.Field
+ IssuedOn apijson.Field
+ Location apijson.Field
+ Organization apijson.Field
+ OrganizationalUnit apijson.Field
+ SerialNumber apijson.Field
+ Signature apijson.Field
+ Ski apijson.Field
+ State apijson.Field
+ Status apijson.Field
+ ValidityDays apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *TLSCertificatesAndHostnamesClientCertificate) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r tlsCertificatesAndHostnamesClientCertificateJSON) RawJSON() string {
+ return r.raw
+}
+
+// Certificate Authority used to issue the Client Certificate
+type TLSCertificatesAndHostnamesClientCertificateCertificateAuthority struct {
+ ID string `json:"id"`
+ Name string `json:"name"`
+ JSON tlsCertificatesAndHostnamesClientCertificateCertificateAuthorityJSON `json:"-"`
+}
+
+// tlsCertificatesAndHostnamesClientCertificateCertificateAuthorityJSON contains
+// the JSON metadata for the struct
+// [TLSCertificatesAndHostnamesClientCertificateCertificateAuthority]
+type tlsCertificatesAndHostnamesClientCertificateCertificateAuthorityJSON struct {
+ ID apijson.Field
+ Name apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *TLSCertificatesAndHostnamesClientCertificateCertificateAuthority) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r tlsCertificatesAndHostnamesClientCertificateCertificateAuthorityJSON) RawJSON() string {
+ return r.raw
+}
+
+// Client Certificates may be active or revoked, and the pending_reactivation or
+// pending_revocation represent in-progress asynchronous transitions
+type TLSCertificatesAndHostnamesClientCertificateStatus string
+
+const (
+ TLSCertificatesAndHostnamesClientCertificateStatusActive TLSCertificatesAndHostnamesClientCertificateStatus = "active"
+ TLSCertificatesAndHostnamesClientCertificateStatusPendingReactivation TLSCertificatesAndHostnamesClientCertificateStatus = "pending_reactivation"
+ TLSCertificatesAndHostnamesClientCertificateStatusPendingRevocation TLSCertificatesAndHostnamesClientCertificateStatus = "pending_revocation"
+ TLSCertificatesAndHostnamesClientCertificateStatusRevoked TLSCertificatesAndHostnamesClientCertificateStatus = "revoked"
+)
+
+type ClientCertificateNewParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+ // The Certificate Signing Request (CSR). Must be newline-encoded.
+ Csr param.Field[string] `json:"csr,required"`
+ // The number of days the Client Certificate will be valid after the issued_on date
+ ValidityDays param.Field[int64] `json:"validity_days,required"`
+}
+
+func (r ClientCertificateNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type ClientCertificateNewResponseEnvelope struct {
+ Errors []ClientCertificateNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []ClientCertificateNewResponseEnvelopeMessages `json:"messages,required"`
+ Result TLSCertificatesAndHostnamesClientCertificate `json:"result,required"`
+ // Whether the API call was successful
+ Success ClientCertificateNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON clientCertificateNewResponseEnvelopeJSON `json:"-"`
+}
+
+// clientCertificateNewResponseEnvelopeJSON contains the JSON metadata for the
+// struct [ClientCertificateNewResponseEnvelope]
+type clientCertificateNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ClientCertificateNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r clientCertificateNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type ClientCertificateNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON clientCertificateNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// clientCertificateNewResponseEnvelopeErrorsJSON contains the JSON metadata for
+// the struct [ClientCertificateNewResponseEnvelopeErrors]
+type clientCertificateNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ClientCertificateNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r clientCertificateNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type ClientCertificateNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON clientCertificateNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// clientCertificateNewResponseEnvelopeMessagesJSON contains the JSON metadata for
+// the struct [ClientCertificateNewResponseEnvelopeMessages]
+type clientCertificateNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ClientCertificateNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r clientCertificateNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type ClientCertificateNewResponseEnvelopeSuccess bool
+
+const (
+ ClientCertificateNewResponseEnvelopeSuccessTrue ClientCertificateNewResponseEnvelopeSuccess = true
+)
+
+type ClientCertificateListParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+ // Limit to the number of records returned.
+ Limit param.Field[int64] `query:"limit"`
+ // Offset the results
+ Offset param.Field[int64] `query:"offset"`
+ // Page number of paginated results.
+ Page param.Field[float64] `query:"page"`
+ // Number of records per page.
+ PerPage param.Field[float64] `query:"per_page"`
+ // Client Certitifcate Status to filter results by.
+ Status param.Field[ClientCertificateListParamsStatus] `query:"status"`
+}
+
+// URLQuery serializes [ClientCertificateListParams]'s query parameters as
+// `url.Values`.
+func (r ClientCertificateListParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Client Certitifcate Status to filter results by.
+type ClientCertificateListParamsStatus string
+
+const (
+ ClientCertificateListParamsStatusAll ClientCertificateListParamsStatus = "all"
+ ClientCertificateListParamsStatusActive ClientCertificateListParamsStatus = "active"
+ ClientCertificateListParamsStatusPendingReactivation ClientCertificateListParamsStatus = "pending_reactivation"
+ ClientCertificateListParamsStatusPendingRevocation ClientCertificateListParamsStatus = "pending_revocation"
+ ClientCertificateListParamsStatusRevoked ClientCertificateListParamsStatus = "revoked"
+)
+
+type ClientCertificateDeleteParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+}
+
+type ClientCertificateDeleteResponseEnvelope struct {
+ Errors []ClientCertificateDeleteResponseEnvelopeErrors `json:"errors,required"`
+ Messages []ClientCertificateDeleteResponseEnvelopeMessages `json:"messages,required"`
+ Result TLSCertificatesAndHostnamesClientCertificate `json:"result,required"`
+ // Whether the API call was successful
+ Success ClientCertificateDeleteResponseEnvelopeSuccess `json:"success,required"`
+ JSON clientCertificateDeleteResponseEnvelopeJSON `json:"-"`
+}
+
+// clientCertificateDeleteResponseEnvelopeJSON contains the JSON metadata for the
+// struct [ClientCertificateDeleteResponseEnvelope]
+type clientCertificateDeleteResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ClientCertificateDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r clientCertificateDeleteResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type ClientCertificateDeleteResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON clientCertificateDeleteResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// clientCertificateDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for
+// the struct [ClientCertificateDeleteResponseEnvelopeErrors]
+type clientCertificateDeleteResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ClientCertificateDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r clientCertificateDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type ClientCertificateDeleteResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON clientCertificateDeleteResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// clientCertificateDeleteResponseEnvelopeMessagesJSON contains the JSON metadata
+// for the struct [ClientCertificateDeleteResponseEnvelopeMessages]
+type clientCertificateDeleteResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ClientCertificateDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r clientCertificateDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type ClientCertificateDeleteResponseEnvelopeSuccess bool
+
+const (
+ ClientCertificateDeleteResponseEnvelopeSuccessTrue ClientCertificateDeleteResponseEnvelopeSuccess = true
+)
+
+type ClientCertificateEditParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+}
+
+type ClientCertificateEditResponseEnvelope struct {
+ Errors []ClientCertificateEditResponseEnvelopeErrors `json:"errors,required"`
+ Messages []ClientCertificateEditResponseEnvelopeMessages `json:"messages,required"`
+ Result TLSCertificatesAndHostnamesClientCertificate `json:"result,required"`
+ // Whether the API call was successful
+ Success ClientCertificateEditResponseEnvelopeSuccess `json:"success,required"`
+ JSON clientCertificateEditResponseEnvelopeJSON `json:"-"`
+}
+
+// clientCertificateEditResponseEnvelopeJSON contains the JSON metadata for the
+// struct [ClientCertificateEditResponseEnvelope]
+type clientCertificateEditResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ClientCertificateEditResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r clientCertificateEditResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type ClientCertificateEditResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON clientCertificateEditResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// clientCertificateEditResponseEnvelopeErrorsJSON contains the JSON metadata for
+// the struct [ClientCertificateEditResponseEnvelopeErrors]
+type clientCertificateEditResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ClientCertificateEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r clientCertificateEditResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type ClientCertificateEditResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON clientCertificateEditResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// clientCertificateEditResponseEnvelopeMessagesJSON contains the JSON metadata for
+// the struct [ClientCertificateEditResponseEnvelopeMessages]
+type clientCertificateEditResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ClientCertificateEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r clientCertificateEditResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type ClientCertificateEditResponseEnvelopeSuccess bool
+
+const (
+ ClientCertificateEditResponseEnvelopeSuccessTrue ClientCertificateEditResponseEnvelopeSuccess = true
+)
+
+type ClientCertificateGetParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+}
+
+type ClientCertificateGetResponseEnvelope struct {
+ Errors []ClientCertificateGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []ClientCertificateGetResponseEnvelopeMessages `json:"messages,required"`
+ Result TLSCertificatesAndHostnamesClientCertificate `json:"result,required"`
+ // Whether the API call was successful
+ Success ClientCertificateGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON clientCertificateGetResponseEnvelopeJSON `json:"-"`
+}
+
+// clientCertificateGetResponseEnvelopeJSON contains the JSON metadata for the
+// struct [ClientCertificateGetResponseEnvelope]
+type clientCertificateGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ClientCertificateGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r clientCertificateGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type ClientCertificateGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON clientCertificateGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// clientCertificateGetResponseEnvelopeErrorsJSON contains the JSON metadata for
+// the struct [ClientCertificateGetResponseEnvelopeErrors]
+type clientCertificateGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ClientCertificateGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r clientCertificateGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type ClientCertificateGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON clientCertificateGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// clientCertificateGetResponseEnvelopeMessagesJSON contains the JSON metadata for
+// the struct [ClientCertificateGetResponseEnvelopeMessages]
+type clientCertificateGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ClientCertificateGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r clientCertificateGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type ClientCertificateGetResponseEnvelopeSuccess bool
+
+const (
+ ClientCertificateGetResponseEnvelopeSuccessTrue ClientCertificateGetResponseEnvelopeSuccess = true
+)
diff --git a/clientcertificate_test.go b/client_certificates/clientcertificate_test.go
similarity index 88%
rename from clientcertificate_test.go
rename to client_certificates/clientcertificate_test.go
index b816738ccf2..e8f2afeb194 100644
--- a/clientcertificate_test.go
+++ b/client_certificates/clientcertificate_test.go
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package cloudflare_test
+package client_certificates_test
import (
"context"
@@ -9,6 +9,7 @@ import (
"testing"
"github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/client_certificates"
"github.com/cloudflare/cloudflare-go/internal/testutil"
"github.com/cloudflare/cloudflare-go/option"
)
@@ -27,7 +28,7 @@ func TestClientCertificateNew(t *testing.T) {
option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"),
option.WithAPIEmail("user@example.com"),
)
- _, err := client.ClientCertificates.New(context.TODO(), cloudflare.ClientCertificateNewParams{
+ _, err := client.ClientCertificates.New(context.TODO(), client_certificates.ClientCertificateNewParams{
ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
Csr: cloudflare.F("-----BEGIN CERTIFICATE REQUEST-----\\nMIICY....\\n-----END CERTIFICATE REQUEST-----\\n"),
ValidityDays: cloudflare.F(int64(3650)),
@@ -55,13 +56,13 @@ func TestClientCertificateListWithOptionalParams(t *testing.T) {
option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"),
option.WithAPIEmail("user@example.com"),
)
- _, err := client.ClientCertificates.List(context.TODO(), cloudflare.ClientCertificateListParams{
+ _, err := client.ClientCertificates.List(context.TODO(), client_certificates.ClientCertificateListParams{
ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
Limit: cloudflare.F(int64(10)),
Offset: cloudflare.F(int64(10)),
Page: cloudflare.F(1.000000),
PerPage: cloudflare.F(5.000000),
- Status: cloudflare.F(cloudflare.ClientCertificateListParamsStatusAll),
+ Status: cloudflare.F(client_certificates.ClientCertificateListParamsStatusAll),
})
if err != nil {
var apierr *cloudflare.Error
@@ -89,7 +90,7 @@ func TestClientCertificateDelete(t *testing.T) {
_, err := client.ClientCertificates.Delete(
context.TODO(),
"023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.ClientCertificateDeleteParams{
+ client_certificates.ClientCertificateDeleteParams{
ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
},
)
@@ -119,7 +120,7 @@ func TestClientCertificateEdit(t *testing.T) {
_, err := client.ClientCertificates.Edit(
context.TODO(),
"023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.ClientCertificateEditParams{
+ client_certificates.ClientCertificateEditParams{
ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
},
)
@@ -149,7 +150,7 @@ func TestClientCertificateGet(t *testing.T) {
_, err := client.ClientCertificates.Get(
context.TODO(),
"023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.ClientCertificateGetParams{
+ client_certificates.ClientCertificateGetParams{
ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
},
)
diff --git a/client_test.go b/client_test.go
index f2bb874ad31..1cb6f5c03ab 100644
--- a/client_test.go
+++ b/client_test.go
@@ -10,6 +10,7 @@ import (
"github.com/cloudflare/cloudflare-go"
"github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/zones"
)
type closureTransport struct {
@@ -37,12 +38,12 @@ func TestRetryAfter(t *testing.T) {
},
}),
)
- res, err := client.Zones.New(context.Background(), cloudflare.ZoneNewParams{
- Account: cloudflare.F(cloudflare.ZoneNewParamsAccount{
+ res, err := client.Zones.New(context.Background(), zones.ZoneNewParams{
+ Account: cloudflare.F(zones.ZoneNewParamsAccount{
ID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
}),
Name: cloudflare.F("example.com"),
- Type: cloudflare.F(cloudflare.ZoneNewParamsTypeFull),
+ Type: cloudflare.F(zones.ZoneNewParamsTypeFull),
})
if err == nil || res != nil {
t.Error("Expected there to be a cancel error and for the response to be nil")
@@ -69,12 +70,12 @@ func TestRetryAfterMs(t *testing.T) {
},
}),
)
- res, err := client.Zones.New(context.Background(), cloudflare.ZoneNewParams{
- Account: cloudflare.F(cloudflare.ZoneNewParamsAccount{
+ res, err := client.Zones.New(context.Background(), zones.ZoneNewParams{
+ Account: cloudflare.F(zones.ZoneNewParamsAccount{
ID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
}),
Name: cloudflare.F("example.com"),
- Type: cloudflare.F(cloudflare.ZoneNewParamsTypeFull),
+ Type: cloudflare.F(zones.ZoneNewParamsTypeFull),
})
if err == nil || res != nil {
t.Error("Expected there to be a cancel error and for the response to be nil")
@@ -97,12 +98,12 @@ func TestContextCancel(t *testing.T) {
)
cancelCtx, cancel := context.WithCancel(context.Background())
cancel()
- res, err := client.Zones.New(cancelCtx, cloudflare.ZoneNewParams{
- Account: cloudflare.F(cloudflare.ZoneNewParamsAccount{
+ res, err := client.Zones.New(cancelCtx, zones.ZoneNewParams{
+ Account: cloudflare.F(zones.ZoneNewParamsAccount{
ID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
}),
Name: cloudflare.F("example.com"),
- Type: cloudflare.F(cloudflare.ZoneNewParamsTypeFull),
+ Type: cloudflare.F(zones.ZoneNewParamsTypeFull),
})
if err == nil || res != nil {
t.Error("Expected there to be a cancel error and for the response to be nil")
@@ -122,12 +123,12 @@ func TestContextCancelDelay(t *testing.T) {
)
cancelCtx, cancel := context.WithTimeout(context.Background(), 2*time.Millisecond)
defer cancel()
- res, err := client.Zones.New(cancelCtx, cloudflare.ZoneNewParams{
- Account: cloudflare.F(cloudflare.ZoneNewParamsAccount{
+ res, err := client.Zones.New(cancelCtx, zones.ZoneNewParams{
+ Account: cloudflare.F(zones.ZoneNewParamsAccount{
ID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
}),
Name: cloudflare.F("example.com"),
- Type: cloudflare.F(cloudflare.ZoneNewParamsTypeFull),
+ Type: cloudflare.F(zones.ZoneNewParamsTypeFull),
})
if err == nil || res != nil {
t.Error("expected there to be a cancel error and for the response to be nil")
@@ -153,12 +154,12 @@ func TestContextDeadline(t *testing.T) {
},
}),
)
- res, err := client.Zones.New(deadlineCtx, cloudflare.ZoneNewParams{
- Account: cloudflare.F(cloudflare.ZoneNewParamsAccount{
+ res, err := client.Zones.New(deadlineCtx, zones.ZoneNewParams{
+ Account: cloudflare.F(zones.ZoneNewParamsAccount{
ID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
}),
Name: cloudflare.F("example.com"),
- Type: cloudflare.F(cloudflare.ZoneNewParamsTypeFull),
+ Type: cloudflare.F(zones.ZoneNewParamsTypeFull),
})
if err == nil || res != nil {
t.Error("expected there to be a deadline error and for the response to be nil")
diff --git a/clientcertificate.go b/clientcertificate.go
deleted file mode 100644
index 4f85ff5465e..00000000000
--- a/clientcertificate.go
+++ /dev/null
@@ -1,1046 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// ClientCertificateService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewClientCertificateService] method
-// instead.
-type ClientCertificateService struct {
- Options []option.RequestOption
-}
-
-// NewClientCertificateService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewClientCertificateService(opts ...option.RequestOption) (r *ClientCertificateService) {
- r = &ClientCertificateService{}
- r.Options = opts
- return
-}
-
-// Create a new API Shield mTLS Client Certificate
-func (r *ClientCertificateService) New(ctx context.Context, params ClientCertificateNewParams, opts ...option.RequestOption) (res *ClientCertificateNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env ClientCertificateNewResponseEnvelope
- path := fmt.Sprintf("zones/%s/client_certificates", params.ZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// List all of your Zone's API Shield mTLS Client Certificates by Status and/or
-// using Pagination
-func (r *ClientCertificateService) List(ctx context.Context, params ClientCertificateListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[ClientCertificateListResponse], err error) {
- var raw *http.Response
- opts = append(r.Options, opts...)
- opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
- path := fmt.Sprintf("zones/%s/client_certificates", params.ZoneID)
- cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, params, &res, opts...)
- if err != nil {
- return nil, err
- }
- err = cfg.Execute()
- if err != nil {
- return nil, err
- }
- res.SetPageConfig(cfg, raw)
- return res, nil
-}
-
-// List all of your Zone's API Shield mTLS Client Certificates by Status and/or
-// using Pagination
-func (r *ClientCertificateService) ListAutoPaging(ctx context.Context, params ClientCertificateListParams, opts ...option.RequestOption) *shared.V4PagePaginationArrayAutoPager[ClientCertificateListResponse] {
- return shared.NewV4PagePaginationArrayAutoPager(r.List(ctx, params, opts...))
-}
-
-// Set a API Shield mTLS Client Certificate to pending_revocation status for
-// processing to revoked status.
-func (r *ClientCertificateService) Delete(ctx context.Context, clientCertificateID string, body ClientCertificateDeleteParams, opts ...option.RequestOption) (res *ClientCertificateDeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env ClientCertificateDeleteResponseEnvelope
- path := fmt.Sprintf("zones/%s/client_certificates/%s", body.ZoneID, clientCertificateID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// If a API Shield mTLS Client Certificate is in a pending_revocation state, you
-// may reactivate it with this endpoint.
-func (r *ClientCertificateService) Edit(ctx context.Context, clientCertificateID string, body ClientCertificateEditParams, opts ...option.RequestOption) (res *ClientCertificateEditResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env ClientCertificateEditResponseEnvelope
- path := fmt.Sprintf("zones/%s/client_certificates/%s", body.ZoneID, clientCertificateID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Get Details for a single mTLS API Shield Client Certificate
-func (r *ClientCertificateService) Get(ctx context.Context, clientCertificateID string, query ClientCertificateGetParams, opts ...option.RequestOption) (res *ClientCertificateGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env ClientCertificateGetResponseEnvelope
- path := fmt.Sprintf("zones/%s/client_certificates/%s", query.ZoneID, clientCertificateID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type ClientCertificateNewResponse struct {
- // Identifier
- ID string `json:"id"`
- // The Client Certificate PEM
- Certificate string `json:"certificate"`
- // Certificate Authority used to issue the Client Certificate
- CertificateAuthority ClientCertificateNewResponseCertificateAuthority `json:"certificate_authority"`
- // Common Name of the Client Certificate
- CommonName string `json:"common_name"`
- // Country, provided by the CSR
- Country string `json:"country"`
- // The Certificate Signing Request (CSR). Must be newline-encoded.
- Csr string `json:"csr"`
- // Date that the Client Certificate expires
- ExpiresOn string `json:"expires_on"`
- // Unique identifier of the Client Certificate
- FingerprintSha256 string `json:"fingerprint_sha256"`
- // Date that the Client Certificate was issued by the Certificate Authority
- IssuedOn string `json:"issued_on"`
- // Location, provided by the CSR
- Location string `json:"location"`
- // Organization, provided by the CSR
- Organization string `json:"organization"`
- // Organizational Unit, provided by the CSR
- OrganizationalUnit string `json:"organizational_unit"`
- // The serial number on the created Client Certificate.
- SerialNumber string `json:"serial_number"`
- // The type of hash used for the Client Certificate..
- Signature string `json:"signature"`
- // Subject Key Identifier
- Ski string `json:"ski"`
- // State, provided by the CSR
- State string `json:"state"`
- // Client Certificates may be active or revoked, and the pending_reactivation or
- // pending_revocation represent in-progress asynchronous transitions
- Status ClientCertificateNewResponseStatus `json:"status"`
- // The number of days the Client Certificate will be valid after the issued_on date
- ValidityDays int64 `json:"validity_days"`
- JSON clientCertificateNewResponseJSON `json:"-"`
-}
-
-// clientCertificateNewResponseJSON contains the JSON metadata for the struct
-// [ClientCertificateNewResponse]
-type clientCertificateNewResponseJSON struct {
- ID apijson.Field
- Certificate apijson.Field
- CertificateAuthority apijson.Field
- CommonName apijson.Field
- Country apijson.Field
- Csr apijson.Field
- ExpiresOn apijson.Field
- FingerprintSha256 apijson.Field
- IssuedOn apijson.Field
- Location apijson.Field
- Organization apijson.Field
- OrganizationalUnit apijson.Field
- SerialNumber apijson.Field
- Signature apijson.Field
- Ski apijson.Field
- State apijson.Field
- Status apijson.Field
- ValidityDays apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ClientCertificateNewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r clientCertificateNewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// Certificate Authority used to issue the Client Certificate
-type ClientCertificateNewResponseCertificateAuthority struct {
- ID string `json:"id"`
- Name string `json:"name"`
- JSON clientCertificateNewResponseCertificateAuthorityJSON `json:"-"`
-}
-
-// clientCertificateNewResponseCertificateAuthorityJSON contains the JSON metadata
-// for the struct [ClientCertificateNewResponseCertificateAuthority]
-type clientCertificateNewResponseCertificateAuthorityJSON struct {
- ID apijson.Field
- Name apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ClientCertificateNewResponseCertificateAuthority) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r clientCertificateNewResponseCertificateAuthorityJSON) RawJSON() string {
- return r.raw
-}
-
-// Client Certificates may be active or revoked, and the pending_reactivation or
-// pending_revocation represent in-progress asynchronous transitions
-type ClientCertificateNewResponseStatus string
-
-const (
- ClientCertificateNewResponseStatusActive ClientCertificateNewResponseStatus = "active"
- ClientCertificateNewResponseStatusPendingReactivation ClientCertificateNewResponseStatus = "pending_reactivation"
- ClientCertificateNewResponseStatusPendingRevocation ClientCertificateNewResponseStatus = "pending_revocation"
- ClientCertificateNewResponseStatusRevoked ClientCertificateNewResponseStatus = "revoked"
-)
-
-type ClientCertificateListResponse struct {
- // Identifier
- ID string `json:"id"`
- // The Client Certificate PEM
- Certificate string `json:"certificate"`
- // Certificate Authority used to issue the Client Certificate
- CertificateAuthority ClientCertificateListResponseCertificateAuthority `json:"certificate_authority"`
- // Common Name of the Client Certificate
- CommonName string `json:"common_name"`
- // Country, provided by the CSR
- Country string `json:"country"`
- // The Certificate Signing Request (CSR). Must be newline-encoded.
- Csr string `json:"csr"`
- // Date that the Client Certificate expires
- ExpiresOn string `json:"expires_on"`
- // Unique identifier of the Client Certificate
- FingerprintSha256 string `json:"fingerprint_sha256"`
- // Date that the Client Certificate was issued by the Certificate Authority
- IssuedOn string `json:"issued_on"`
- // Location, provided by the CSR
- Location string `json:"location"`
- // Organization, provided by the CSR
- Organization string `json:"organization"`
- // Organizational Unit, provided by the CSR
- OrganizationalUnit string `json:"organizational_unit"`
- // The serial number on the created Client Certificate.
- SerialNumber string `json:"serial_number"`
- // The type of hash used for the Client Certificate..
- Signature string `json:"signature"`
- // Subject Key Identifier
- Ski string `json:"ski"`
- // State, provided by the CSR
- State string `json:"state"`
- // Client Certificates may be active or revoked, and the pending_reactivation or
- // pending_revocation represent in-progress asynchronous transitions
- Status ClientCertificateListResponseStatus `json:"status"`
- // The number of days the Client Certificate will be valid after the issued_on date
- ValidityDays int64 `json:"validity_days"`
- JSON clientCertificateListResponseJSON `json:"-"`
-}
-
-// clientCertificateListResponseJSON contains the JSON metadata for the struct
-// [ClientCertificateListResponse]
-type clientCertificateListResponseJSON struct {
- ID apijson.Field
- Certificate apijson.Field
- CertificateAuthority apijson.Field
- CommonName apijson.Field
- Country apijson.Field
- Csr apijson.Field
- ExpiresOn apijson.Field
- FingerprintSha256 apijson.Field
- IssuedOn apijson.Field
- Location apijson.Field
- Organization apijson.Field
- OrganizationalUnit apijson.Field
- SerialNumber apijson.Field
- Signature apijson.Field
- Ski apijson.Field
- State apijson.Field
- Status apijson.Field
- ValidityDays apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ClientCertificateListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r clientCertificateListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// Certificate Authority used to issue the Client Certificate
-type ClientCertificateListResponseCertificateAuthority struct {
- ID string `json:"id"`
- Name string `json:"name"`
- JSON clientCertificateListResponseCertificateAuthorityJSON `json:"-"`
-}
-
-// clientCertificateListResponseCertificateAuthorityJSON contains the JSON metadata
-// for the struct [ClientCertificateListResponseCertificateAuthority]
-type clientCertificateListResponseCertificateAuthorityJSON struct {
- ID apijson.Field
- Name apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ClientCertificateListResponseCertificateAuthority) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r clientCertificateListResponseCertificateAuthorityJSON) RawJSON() string {
- return r.raw
-}
-
-// Client Certificates may be active or revoked, and the pending_reactivation or
-// pending_revocation represent in-progress asynchronous transitions
-type ClientCertificateListResponseStatus string
-
-const (
- ClientCertificateListResponseStatusActive ClientCertificateListResponseStatus = "active"
- ClientCertificateListResponseStatusPendingReactivation ClientCertificateListResponseStatus = "pending_reactivation"
- ClientCertificateListResponseStatusPendingRevocation ClientCertificateListResponseStatus = "pending_revocation"
- ClientCertificateListResponseStatusRevoked ClientCertificateListResponseStatus = "revoked"
-)
-
-type ClientCertificateDeleteResponse struct {
- // Identifier
- ID string `json:"id"`
- // The Client Certificate PEM
- Certificate string `json:"certificate"`
- // Certificate Authority used to issue the Client Certificate
- CertificateAuthority ClientCertificateDeleteResponseCertificateAuthority `json:"certificate_authority"`
- // Common Name of the Client Certificate
- CommonName string `json:"common_name"`
- // Country, provided by the CSR
- Country string `json:"country"`
- // The Certificate Signing Request (CSR). Must be newline-encoded.
- Csr string `json:"csr"`
- // Date that the Client Certificate expires
- ExpiresOn string `json:"expires_on"`
- // Unique identifier of the Client Certificate
- FingerprintSha256 string `json:"fingerprint_sha256"`
- // Date that the Client Certificate was issued by the Certificate Authority
- IssuedOn string `json:"issued_on"`
- // Location, provided by the CSR
- Location string `json:"location"`
- // Organization, provided by the CSR
- Organization string `json:"organization"`
- // Organizational Unit, provided by the CSR
- OrganizationalUnit string `json:"organizational_unit"`
- // The serial number on the created Client Certificate.
- SerialNumber string `json:"serial_number"`
- // The type of hash used for the Client Certificate..
- Signature string `json:"signature"`
- // Subject Key Identifier
- Ski string `json:"ski"`
- // State, provided by the CSR
- State string `json:"state"`
- // Client Certificates may be active or revoked, and the pending_reactivation or
- // pending_revocation represent in-progress asynchronous transitions
- Status ClientCertificateDeleteResponseStatus `json:"status"`
- // The number of days the Client Certificate will be valid after the issued_on date
- ValidityDays int64 `json:"validity_days"`
- JSON clientCertificateDeleteResponseJSON `json:"-"`
-}
-
-// clientCertificateDeleteResponseJSON contains the JSON metadata for the struct
-// [ClientCertificateDeleteResponse]
-type clientCertificateDeleteResponseJSON struct {
- ID apijson.Field
- Certificate apijson.Field
- CertificateAuthority apijson.Field
- CommonName apijson.Field
- Country apijson.Field
- Csr apijson.Field
- ExpiresOn apijson.Field
- FingerprintSha256 apijson.Field
- IssuedOn apijson.Field
- Location apijson.Field
- Organization apijson.Field
- OrganizationalUnit apijson.Field
- SerialNumber apijson.Field
- Signature apijson.Field
- Ski apijson.Field
- State apijson.Field
- Status apijson.Field
- ValidityDays apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ClientCertificateDeleteResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r clientCertificateDeleteResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// Certificate Authority used to issue the Client Certificate
-type ClientCertificateDeleteResponseCertificateAuthority struct {
- ID string `json:"id"`
- Name string `json:"name"`
- JSON clientCertificateDeleteResponseCertificateAuthorityJSON `json:"-"`
-}
-
-// clientCertificateDeleteResponseCertificateAuthorityJSON contains the JSON
-// metadata for the struct [ClientCertificateDeleteResponseCertificateAuthority]
-type clientCertificateDeleteResponseCertificateAuthorityJSON struct {
- ID apijson.Field
- Name apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ClientCertificateDeleteResponseCertificateAuthority) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r clientCertificateDeleteResponseCertificateAuthorityJSON) RawJSON() string {
- return r.raw
-}
-
-// Client Certificates may be active or revoked, and the pending_reactivation or
-// pending_revocation represent in-progress asynchronous transitions
-type ClientCertificateDeleteResponseStatus string
-
-const (
- ClientCertificateDeleteResponseStatusActive ClientCertificateDeleteResponseStatus = "active"
- ClientCertificateDeleteResponseStatusPendingReactivation ClientCertificateDeleteResponseStatus = "pending_reactivation"
- ClientCertificateDeleteResponseStatusPendingRevocation ClientCertificateDeleteResponseStatus = "pending_revocation"
- ClientCertificateDeleteResponseStatusRevoked ClientCertificateDeleteResponseStatus = "revoked"
-)
-
-type ClientCertificateEditResponse struct {
- // Identifier
- ID string `json:"id"`
- // The Client Certificate PEM
- Certificate string `json:"certificate"`
- // Certificate Authority used to issue the Client Certificate
- CertificateAuthority ClientCertificateEditResponseCertificateAuthority `json:"certificate_authority"`
- // Common Name of the Client Certificate
- CommonName string `json:"common_name"`
- // Country, provided by the CSR
- Country string `json:"country"`
- // The Certificate Signing Request (CSR). Must be newline-encoded.
- Csr string `json:"csr"`
- // Date that the Client Certificate expires
- ExpiresOn string `json:"expires_on"`
- // Unique identifier of the Client Certificate
- FingerprintSha256 string `json:"fingerprint_sha256"`
- // Date that the Client Certificate was issued by the Certificate Authority
- IssuedOn string `json:"issued_on"`
- // Location, provided by the CSR
- Location string `json:"location"`
- // Organization, provided by the CSR
- Organization string `json:"organization"`
- // Organizational Unit, provided by the CSR
- OrganizationalUnit string `json:"organizational_unit"`
- // The serial number on the created Client Certificate.
- SerialNumber string `json:"serial_number"`
- // The type of hash used for the Client Certificate..
- Signature string `json:"signature"`
- // Subject Key Identifier
- Ski string `json:"ski"`
- // State, provided by the CSR
- State string `json:"state"`
- // Client Certificates may be active or revoked, and the pending_reactivation or
- // pending_revocation represent in-progress asynchronous transitions
- Status ClientCertificateEditResponseStatus `json:"status"`
- // The number of days the Client Certificate will be valid after the issued_on date
- ValidityDays int64 `json:"validity_days"`
- JSON clientCertificateEditResponseJSON `json:"-"`
-}
-
-// clientCertificateEditResponseJSON contains the JSON metadata for the struct
-// [ClientCertificateEditResponse]
-type clientCertificateEditResponseJSON struct {
- ID apijson.Field
- Certificate apijson.Field
- CertificateAuthority apijson.Field
- CommonName apijson.Field
- Country apijson.Field
- Csr apijson.Field
- ExpiresOn apijson.Field
- FingerprintSha256 apijson.Field
- IssuedOn apijson.Field
- Location apijson.Field
- Organization apijson.Field
- OrganizationalUnit apijson.Field
- SerialNumber apijson.Field
- Signature apijson.Field
- Ski apijson.Field
- State apijson.Field
- Status apijson.Field
- ValidityDays apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ClientCertificateEditResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r clientCertificateEditResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// Certificate Authority used to issue the Client Certificate
-type ClientCertificateEditResponseCertificateAuthority struct {
- ID string `json:"id"`
- Name string `json:"name"`
- JSON clientCertificateEditResponseCertificateAuthorityJSON `json:"-"`
-}
-
-// clientCertificateEditResponseCertificateAuthorityJSON contains the JSON metadata
-// for the struct [ClientCertificateEditResponseCertificateAuthority]
-type clientCertificateEditResponseCertificateAuthorityJSON struct {
- ID apijson.Field
- Name apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ClientCertificateEditResponseCertificateAuthority) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r clientCertificateEditResponseCertificateAuthorityJSON) RawJSON() string {
- return r.raw
-}
-
-// Client Certificates may be active or revoked, and the pending_reactivation or
-// pending_revocation represent in-progress asynchronous transitions
-type ClientCertificateEditResponseStatus string
-
-const (
- ClientCertificateEditResponseStatusActive ClientCertificateEditResponseStatus = "active"
- ClientCertificateEditResponseStatusPendingReactivation ClientCertificateEditResponseStatus = "pending_reactivation"
- ClientCertificateEditResponseStatusPendingRevocation ClientCertificateEditResponseStatus = "pending_revocation"
- ClientCertificateEditResponseStatusRevoked ClientCertificateEditResponseStatus = "revoked"
-)
-
-type ClientCertificateGetResponse struct {
- // Identifier
- ID string `json:"id"`
- // The Client Certificate PEM
- Certificate string `json:"certificate"`
- // Certificate Authority used to issue the Client Certificate
- CertificateAuthority ClientCertificateGetResponseCertificateAuthority `json:"certificate_authority"`
- // Common Name of the Client Certificate
- CommonName string `json:"common_name"`
- // Country, provided by the CSR
- Country string `json:"country"`
- // The Certificate Signing Request (CSR). Must be newline-encoded.
- Csr string `json:"csr"`
- // Date that the Client Certificate expires
- ExpiresOn string `json:"expires_on"`
- // Unique identifier of the Client Certificate
- FingerprintSha256 string `json:"fingerprint_sha256"`
- // Date that the Client Certificate was issued by the Certificate Authority
- IssuedOn string `json:"issued_on"`
- // Location, provided by the CSR
- Location string `json:"location"`
- // Organization, provided by the CSR
- Organization string `json:"organization"`
- // Organizational Unit, provided by the CSR
- OrganizationalUnit string `json:"organizational_unit"`
- // The serial number on the created Client Certificate.
- SerialNumber string `json:"serial_number"`
- // The type of hash used for the Client Certificate..
- Signature string `json:"signature"`
- // Subject Key Identifier
- Ski string `json:"ski"`
- // State, provided by the CSR
- State string `json:"state"`
- // Client Certificates may be active or revoked, and the pending_reactivation or
- // pending_revocation represent in-progress asynchronous transitions
- Status ClientCertificateGetResponseStatus `json:"status"`
- // The number of days the Client Certificate will be valid after the issued_on date
- ValidityDays int64 `json:"validity_days"`
- JSON clientCertificateGetResponseJSON `json:"-"`
-}
-
-// clientCertificateGetResponseJSON contains the JSON metadata for the struct
-// [ClientCertificateGetResponse]
-type clientCertificateGetResponseJSON struct {
- ID apijson.Field
- Certificate apijson.Field
- CertificateAuthority apijson.Field
- CommonName apijson.Field
- Country apijson.Field
- Csr apijson.Field
- ExpiresOn apijson.Field
- FingerprintSha256 apijson.Field
- IssuedOn apijson.Field
- Location apijson.Field
- Organization apijson.Field
- OrganizationalUnit apijson.Field
- SerialNumber apijson.Field
- Signature apijson.Field
- Ski apijson.Field
- State apijson.Field
- Status apijson.Field
- ValidityDays apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ClientCertificateGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r clientCertificateGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// Certificate Authority used to issue the Client Certificate
-type ClientCertificateGetResponseCertificateAuthority struct {
- ID string `json:"id"`
- Name string `json:"name"`
- JSON clientCertificateGetResponseCertificateAuthorityJSON `json:"-"`
-}
-
-// clientCertificateGetResponseCertificateAuthorityJSON contains the JSON metadata
-// for the struct [ClientCertificateGetResponseCertificateAuthority]
-type clientCertificateGetResponseCertificateAuthorityJSON struct {
- ID apijson.Field
- Name apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ClientCertificateGetResponseCertificateAuthority) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r clientCertificateGetResponseCertificateAuthorityJSON) RawJSON() string {
- return r.raw
-}
-
-// Client Certificates may be active or revoked, and the pending_reactivation or
-// pending_revocation represent in-progress asynchronous transitions
-type ClientCertificateGetResponseStatus string
-
-const (
- ClientCertificateGetResponseStatusActive ClientCertificateGetResponseStatus = "active"
- ClientCertificateGetResponseStatusPendingReactivation ClientCertificateGetResponseStatus = "pending_reactivation"
- ClientCertificateGetResponseStatusPendingRevocation ClientCertificateGetResponseStatus = "pending_revocation"
- ClientCertificateGetResponseStatusRevoked ClientCertificateGetResponseStatus = "revoked"
-)
-
-type ClientCertificateNewParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
- // The Certificate Signing Request (CSR). Must be newline-encoded.
- Csr param.Field[string] `json:"csr,required"`
- // The number of days the Client Certificate will be valid after the issued_on date
- ValidityDays param.Field[int64] `json:"validity_days,required"`
-}
-
-func (r ClientCertificateNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type ClientCertificateNewResponseEnvelope struct {
- Errors []ClientCertificateNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []ClientCertificateNewResponseEnvelopeMessages `json:"messages,required"`
- Result ClientCertificateNewResponse `json:"result,required"`
- // Whether the API call was successful
- Success ClientCertificateNewResponseEnvelopeSuccess `json:"success,required"`
- JSON clientCertificateNewResponseEnvelopeJSON `json:"-"`
-}
-
-// clientCertificateNewResponseEnvelopeJSON contains the JSON metadata for the
-// struct [ClientCertificateNewResponseEnvelope]
-type clientCertificateNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ClientCertificateNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r clientCertificateNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type ClientCertificateNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON clientCertificateNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// clientCertificateNewResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [ClientCertificateNewResponseEnvelopeErrors]
-type clientCertificateNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ClientCertificateNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r clientCertificateNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type ClientCertificateNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON clientCertificateNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// clientCertificateNewResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [ClientCertificateNewResponseEnvelopeMessages]
-type clientCertificateNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ClientCertificateNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r clientCertificateNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type ClientCertificateNewResponseEnvelopeSuccess bool
-
-const (
- ClientCertificateNewResponseEnvelopeSuccessTrue ClientCertificateNewResponseEnvelopeSuccess = true
-)
-
-type ClientCertificateListParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
- // Limit to the number of records returned.
- Limit param.Field[int64] `query:"limit"`
- // Offset the results
- Offset param.Field[int64] `query:"offset"`
- // Page number of paginated results.
- Page param.Field[float64] `query:"page"`
- // Number of records per page.
- PerPage param.Field[float64] `query:"per_page"`
- // Client Certitifcate Status to filter results by.
- Status param.Field[ClientCertificateListParamsStatus] `query:"status"`
-}
-
-// URLQuery serializes [ClientCertificateListParams]'s query parameters as
-// `url.Values`.
-func (r ClientCertificateListParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Client Certitifcate Status to filter results by.
-type ClientCertificateListParamsStatus string
-
-const (
- ClientCertificateListParamsStatusAll ClientCertificateListParamsStatus = "all"
- ClientCertificateListParamsStatusActive ClientCertificateListParamsStatus = "active"
- ClientCertificateListParamsStatusPendingReactivation ClientCertificateListParamsStatus = "pending_reactivation"
- ClientCertificateListParamsStatusPendingRevocation ClientCertificateListParamsStatus = "pending_revocation"
- ClientCertificateListParamsStatusRevoked ClientCertificateListParamsStatus = "revoked"
-)
-
-type ClientCertificateDeleteParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
-}
-
-type ClientCertificateDeleteResponseEnvelope struct {
- Errors []ClientCertificateDeleteResponseEnvelopeErrors `json:"errors,required"`
- Messages []ClientCertificateDeleteResponseEnvelopeMessages `json:"messages,required"`
- Result ClientCertificateDeleteResponse `json:"result,required"`
- // Whether the API call was successful
- Success ClientCertificateDeleteResponseEnvelopeSuccess `json:"success,required"`
- JSON clientCertificateDeleteResponseEnvelopeJSON `json:"-"`
-}
-
-// clientCertificateDeleteResponseEnvelopeJSON contains the JSON metadata for the
-// struct [ClientCertificateDeleteResponseEnvelope]
-type clientCertificateDeleteResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ClientCertificateDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r clientCertificateDeleteResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type ClientCertificateDeleteResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON clientCertificateDeleteResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// clientCertificateDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [ClientCertificateDeleteResponseEnvelopeErrors]
-type clientCertificateDeleteResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ClientCertificateDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r clientCertificateDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type ClientCertificateDeleteResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON clientCertificateDeleteResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// clientCertificateDeleteResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [ClientCertificateDeleteResponseEnvelopeMessages]
-type clientCertificateDeleteResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ClientCertificateDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r clientCertificateDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type ClientCertificateDeleteResponseEnvelopeSuccess bool
-
-const (
- ClientCertificateDeleteResponseEnvelopeSuccessTrue ClientCertificateDeleteResponseEnvelopeSuccess = true
-)
-
-type ClientCertificateEditParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
-}
-
-type ClientCertificateEditResponseEnvelope struct {
- Errors []ClientCertificateEditResponseEnvelopeErrors `json:"errors,required"`
- Messages []ClientCertificateEditResponseEnvelopeMessages `json:"messages,required"`
- Result ClientCertificateEditResponse `json:"result,required"`
- // Whether the API call was successful
- Success ClientCertificateEditResponseEnvelopeSuccess `json:"success,required"`
- JSON clientCertificateEditResponseEnvelopeJSON `json:"-"`
-}
-
-// clientCertificateEditResponseEnvelopeJSON contains the JSON metadata for the
-// struct [ClientCertificateEditResponseEnvelope]
-type clientCertificateEditResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ClientCertificateEditResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r clientCertificateEditResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type ClientCertificateEditResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON clientCertificateEditResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// clientCertificateEditResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [ClientCertificateEditResponseEnvelopeErrors]
-type clientCertificateEditResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ClientCertificateEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r clientCertificateEditResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type ClientCertificateEditResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON clientCertificateEditResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// clientCertificateEditResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [ClientCertificateEditResponseEnvelopeMessages]
-type clientCertificateEditResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ClientCertificateEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r clientCertificateEditResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type ClientCertificateEditResponseEnvelopeSuccess bool
-
-const (
- ClientCertificateEditResponseEnvelopeSuccessTrue ClientCertificateEditResponseEnvelopeSuccess = true
-)
-
-type ClientCertificateGetParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
-}
-
-type ClientCertificateGetResponseEnvelope struct {
- Errors []ClientCertificateGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []ClientCertificateGetResponseEnvelopeMessages `json:"messages,required"`
- Result ClientCertificateGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success ClientCertificateGetResponseEnvelopeSuccess `json:"success,required"`
- JSON clientCertificateGetResponseEnvelopeJSON `json:"-"`
-}
-
-// clientCertificateGetResponseEnvelopeJSON contains the JSON metadata for the
-// struct [ClientCertificateGetResponseEnvelope]
-type clientCertificateGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ClientCertificateGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r clientCertificateGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type ClientCertificateGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON clientCertificateGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// clientCertificateGetResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [ClientCertificateGetResponseEnvelopeErrors]
-type clientCertificateGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ClientCertificateGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r clientCertificateGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type ClientCertificateGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON clientCertificateGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// clientCertificateGetResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [ClientCertificateGetResponseEnvelopeMessages]
-type clientCertificateGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ClientCertificateGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r clientCertificateGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type ClientCertificateGetResponseEnvelopeSuccess bool
-
-const (
- ClientCertificateGetResponseEnvelopeSuccessTrue ClientCertificateGetResponseEnvelopeSuccess = true
-)
diff --git a/cloudforce_one/aliases.go b/cloudforce_one/aliases.go
new file mode 100644
index 00000000000..97c5ca888e3
--- /dev/null
+++ b/cloudforce_one/aliases.go
@@ -0,0 +1,9 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package cloudforce_one
+
+import (
+ "github.com/cloudflare/cloudflare-go/internal/apierror"
+)
+
+type Error = apierror.Error
diff --git a/cloudforceone.go b/cloudforce_one/cloudforceone.go
similarity index 88%
rename from cloudforceone.go
rename to cloudforce_one/cloudforceone.go
index f619fb3b0bd..dfcf8c97e79 100644
--- a/cloudforceone.go
+++ b/cloudforce_one/cloudforceone.go
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package cloudflare
+package cloudforce_one
import (
"github.com/cloudflare/cloudflare-go/option"
@@ -13,7 +13,7 @@ import (
// instead.
type CloudforceOneService struct {
Options []option.RequestOption
- Requests *CloudforceOneRequestService
+ Requests *RequestService
}
// NewCloudforceOneService generates a new service that applies the given options
@@ -22,6 +22,6 @@ type CloudforceOneService struct {
func NewCloudforceOneService(opts ...option.RequestOption) (r *CloudforceOneService) {
r = &CloudforceOneService{}
r.Options = opts
- r.Requests = NewCloudforceOneRequestService(opts...)
+ r.Requests = NewRequestService(opts...)
return
}
diff --git a/cloudforce_one/request.go b/cloudforce_one/request.go
new file mode 100644
index 00000000000..9e9674433d4
--- /dev/null
+++ b/cloudforce_one/request.go
@@ -0,0 +1,1103 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package cloudforce_one
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "reflect"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/tidwall/gjson"
+)
+
+// RequestService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewRequestService] method instead.
+type RequestService struct {
+ Options []option.RequestOption
+ Message *RequestMessageService
+ Priority *RequestPriorityService
+}
+
+// NewRequestService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewRequestService(opts ...option.RequestOption) (r *RequestService) {
+ r = &RequestService{}
+ r.Options = opts
+ r.Message = NewRequestMessageService(opts...)
+ r.Priority = NewRequestPriorityService(opts...)
+ return
+}
+
+// Creating a request adds the request into the Cloudforce One queue for analysis.
+// In addition to the content, a short title, type, priority, and releasability
+// should be provided. If one is not provided a default will be assigned.
+func (r *RequestService) New(ctx context.Context, accountIdentifier string, body RequestNewParams, opts ...option.RequestOption) (res *CloudforceOneRequestItem, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RequestNewResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/cloudforce-one/requests/new", accountIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Updating a request alters the request in the Cloudforce One queue. This API may
+// be used to update any attributes of the request after the initial submission.
+// Only fields that you choose to update need to be add to the request body
+func (r *RequestService) Update(ctx context.Context, accountIdentifier string, requestIdentifier string, body RequestUpdateParams, opts ...option.RequestOption) (res *CloudforceOneRequestItem, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RequestUpdateResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/cloudforce-one/requests/%s", accountIdentifier, requestIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// List Requests
+func (r *RequestService) List(ctx context.Context, accountIdentifier string, body RequestListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[CloudforceOneRequestListItem], err error) {
+ var raw *http.Response
+ opts = append(r.Options, opts...)
+ opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
+ path := fmt.Sprintf("accounts/%s/cloudforce-one/requests", accountIdentifier)
+ cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodPost, path, body, &res, opts...)
+ if err != nil {
+ return nil, err
+ }
+ err = cfg.Execute()
+ if err != nil {
+ return nil, err
+ }
+ res.SetPageConfig(cfg, raw)
+ return res, nil
+}
+
+// List Requests
+func (r *RequestService) ListAutoPaging(ctx context.Context, accountIdentifier string, body RequestListParams, opts ...option.RequestOption) *shared.V4PagePaginationArrayAutoPager[CloudforceOneRequestListItem] {
+ return shared.NewV4PagePaginationArrayAutoPager(r.List(ctx, accountIdentifier, body, opts...))
+}
+
+// Delete a Request
+func (r *RequestService) Delete(ctx context.Context, accountIdentifier string, requestIdentifier string, opts ...option.RequestOption) (res *RequestDeleteResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RequestDeleteResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/cloudforce-one/requests/%s", accountIdentifier, requestIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Get Request Priority, Status, and TLP constants
+func (r *RequestService) Constants(ctx context.Context, accountIdentifier string, opts ...option.RequestOption) (res *CloudforceOneRequestConstants, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RequestConstantsResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/cloudforce-one/requests/constants", accountIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Get a Request
+func (r *RequestService) Get(ctx context.Context, accountIdentifier string, requestIdentifier string, opts ...option.RequestOption) (res *CloudforceOneRequestItem, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RequestGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/cloudforce-one/requests/%s", accountIdentifier, requestIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Get Request Quota
+func (r *RequestService) Quota(ctx context.Context, accountIdentifier string, opts ...option.RequestOption) (res *CloudforceOneQuota, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RequestQuotaResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/cloudforce-one/requests/quota", accountIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Get Request Types
+func (r *RequestService) Types(ctx context.Context, accountIdentifier string, opts ...option.RequestOption) (res *CloudforceOneRequestTypes, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RequestTypesResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/cloudforce-one/requests/types", accountIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type CloudforceOneQuota struct {
+ // Anniversary date is when annual quota limit is refresh
+ AnniversaryDate time.Time `json:"anniversary_date" format:"date-time"`
+ // Quater anniversary date is when quota limit is refreshed each quarter
+ QuarterAnniversaryDate time.Time `json:"quarter_anniversary_date" format:"date-time"`
+ // Tokens for the quarter
+ Quota int64 `json:"quota"`
+ // Tokens remaining for the quarter
+ Remaining int64 `json:"remaining"`
+ JSON cloudforceOneQuotaJSON `json:"-"`
+}
+
+// cloudforceOneQuotaJSON contains the JSON metadata for the struct
+// [CloudforceOneQuota]
+type cloudforceOneQuotaJSON struct {
+ AnniversaryDate apijson.Field
+ QuarterAnniversaryDate apijson.Field
+ Quota apijson.Field
+ Remaining apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CloudforceOneQuota) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r cloudforceOneQuotaJSON) RawJSON() string {
+ return r.raw
+}
+
+type CloudforceOneRequestConstants struct {
+ Priority []CloudforceOneRequestConstantsPriority `json:"priority"`
+ Status []CloudforceOneRequestConstantsStatus `json:"status"`
+ Tlp []CloudforceOneRequestConstantsTlp `json:"tlp"`
+ JSON cloudforceOneRequestConstantsJSON `json:"-"`
+}
+
+// cloudforceOneRequestConstantsJSON contains the JSON metadata for the struct
+// [CloudforceOneRequestConstants]
+type cloudforceOneRequestConstantsJSON struct {
+ Priority apijson.Field
+ Status apijson.Field
+ Tlp apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CloudforceOneRequestConstants) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r cloudforceOneRequestConstantsJSON) RawJSON() string {
+ return r.raw
+}
+
+type CloudforceOneRequestConstantsPriority string
+
+const (
+ CloudforceOneRequestConstantsPriorityRoutine CloudforceOneRequestConstantsPriority = "routine"
+ CloudforceOneRequestConstantsPriorityHigh CloudforceOneRequestConstantsPriority = "high"
+ CloudforceOneRequestConstantsPriorityUrgent CloudforceOneRequestConstantsPriority = "urgent"
+)
+
+// Request Status
+type CloudforceOneRequestConstantsStatus string
+
+const (
+ CloudforceOneRequestConstantsStatusOpen CloudforceOneRequestConstantsStatus = "open"
+ CloudforceOneRequestConstantsStatusAccepted CloudforceOneRequestConstantsStatus = "accepted"
+ CloudforceOneRequestConstantsStatusReported CloudforceOneRequestConstantsStatus = "reported"
+ CloudforceOneRequestConstantsStatusApproved CloudforceOneRequestConstantsStatus = "approved"
+ CloudforceOneRequestConstantsStatusCompleted CloudforceOneRequestConstantsStatus = "completed"
+ CloudforceOneRequestConstantsStatusDeclined CloudforceOneRequestConstantsStatus = "declined"
+)
+
+// The CISA defined Traffic Light Protocol (TLP)
+type CloudforceOneRequestConstantsTlp string
+
+const (
+ CloudforceOneRequestConstantsTlpClear CloudforceOneRequestConstantsTlp = "clear"
+ CloudforceOneRequestConstantsTlpAmber CloudforceOneRequestConstantsTlp = "amber"
+ CloudforceOneRequestConstantsTlpAmberStrict CloudforceOneRequestConstantsTlp = "amber-strict"
+ CloudforceOneRequestConstantsTlpGreen CloudforceOneRequestConstantsTlp = "green"
+ CloudforceOneRequestConstantsTlpRed CloudforceOneRequestConstantsTlp = "red"
+)
+
+type CloudforceOneRequestItem struct {
+ // UUID
+ ID string `json:"id,required"`
+ // Request content
+ Content string `json:"content,required"`
+ Created time.Time `json:"created,required" format:"date-time"`
+ Priority time.Time `json:"priority,required" format:"date-time"`
+ // Requested information from request
+ Request string `json:"request,required"`
+ // Brief description of the request
+ Summary string `json:"summary,required"`
+ // The CISA defined Traffic Light Protocol (TLP)
+ Tlp CloudforceOneRequestItemTlp `json:"tlp,required"`
+ Updated time.Time `json:"updated,required" format:"date-time"`
+ Completed time.Time `json:"completed" format:"date-time"`
+ // Tokens for the request messages
+ MessageTokens int64 `json:"message_tokens"`
+ // Readable Request ID
+ ReadableID string `json:"readable_id"`
+ // Request Status
+ Status CloudforceOneRequestItemStatus `json:"status"`
+ // Tokens for the request
+ Tokens int64 `json:"tokens"`
+ JSON cloudforceOneRequestItemJSON `json:"-"`
+}
+
+// cloudforceOneRequestItemJSON contains the JSON metadata for the struct
+// [CloudforceOneRequestItem]
+type cloudforceOneRequestItemJSON struct {
+ ID apijson.Field
+ Content apijson.Field
+ Created apijson.Field
+ Priority apijson.Field
+ Request apijson.Field
+ Summary apijson.Field
+ Tlp apijson.Field
+ Updated apijson.Field
+ Completed apijson.Field
+ MessageTokens apijson.Field
+ ReadableID apijson.Field
+ Status apijson.Field
+ Tokens apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CloudforceOneRequestItem) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r cloudforceOneRequestItemJSON) RawJSON() string {
+ return r.raw
+}
+
+// The CISA defined Traffic Light Protocol (TLP)
+type CloudforceOneRequestItemTlp string
+
+const (
+ CloudforceOneRequestItemTlpClear CloudforceOneRequestItemTlp = "clear"
+ CloudforceOneRequestItemTlpAmber CloudforceOneRequestItemTlp = "amber"
+ CloudforceOneRequestItemTlpAmberStrict CloudforceOneRequestItemTlp = "amber-strict"
+ CloudforceOneRequestItemTlpGreen CloudforceOneRequestItemTlp = "green"
+ CloudforceOneRequestItemTlpRed CloudforceOneRequestItemTlp = "red"
+)
+
+// Request Status
+type CloudforceOneRequestItemStatus string
+
+const (
+ CloudforceOneRequestItemStatusOpen CloudforceOneRequestItemStatus = "open"
+ CloudforceOneRequestItemStatusAccepted CloudforceOneRequestItemStatus = "accepted"
+ CloudforceOneRequestItemStatusReported CloudforceOneRequestItemStatus = "reported"
+ CloudforceOneRequestItemStatusApproved CloudforceOneRequestItemStatus = "approved"
+ CloudforceOneRequestItemStatusCompleted CloudforceOneRequestItemStatus = "completed"
+ CloudforceOneRequestItemStatusDeclined CloudforceOneRequestItemStatus = "declined"
+)
+
+type CloudforceOneRequestListItem struct {
+ // UUID
+ ID string `json:"id,required"`
+ // Request creation time
+ Created time.Time `json:"created,required" format:"date-time"`
+ Priority CloudforceOneRequestListItemPriority `json:"priority,required"`
+ // Requested information from request
+ Request string `json:"request,required"`
+ // Brief description of the request
+ Summary string `json:"summary,required"`
+ // The CISA defined Traffic Light Protocol (TLP)
+ Tlp CloudforceOneRequestListItemTlp `json:"tlp,required"`
+ // Request last updated time
+ Updated time.Time `json:"updated,required" format:"date-time"`
+ // Request completion time
+ Completed time.Time `json:"completed" format:"date-time"`
+ // Tokens for the request messages
+ MessageTokens int64 `json:"message_tokens"`
+ // Readable Request ID
+ ReadableID string `json:"readable_id"`
+ // Request Status
+ Status CloudforceOneRequestListItemStatus `json:"status"`
+ // Tokens for the request
+ Tokens int64 `json:"tokens"`
+ JSON cloudforceOneRequestListItemJSON `json:"-"`
+}
+
+// cloudforceOneRequestListItemJSON contains the JSON metadata for the struct
+// [CloudforceOneRequestListItem]
+type cloudforceOneRequestListItemJSON struct {
+ ID apijson.Field
+ Created apijson.Field
+ Priority apijson.Field
+ Request apijson.Field
+ Summary apijson.Field
+ Tlp apijson.Field
+ Updated apijson.Field
+ Completed apijson.Field
+ MessageTokens apijson.Field
+ ReadableID apijson.Field
+ Status apijson.Field
+ Tokens apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CloudforceOneRequestListItem) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r cloudforceOneRequestListItemJSON) RawJSON() string {
+ return r.raw
+}
+
+type CloudforceOneRequestListItemPriority string
+
+const (
+ CloudforceOneRequestListItemPriorityRoutine CloudforceOneRequestListItemPriority = "routine"
+ CloudforceOneRequestListItemPriorityHigh CloudforceOneRequestListItemPriority = "high"
+ CloudforceOneRequestListItemPriorityUrgent CloudforceOneRequestListItemPriority = "urgent"
+)
+
+// The CISA defined Traffic Light Protocol (TLP)
+type CloudforceOneRequestListItemTlp string
+
+const (
+ CloudforceOneRequestListItemTlpClear CloudforceOneRequestListItemTlp = "clear"
+ CloudforceOneRequestListItemTlpAmber CloudforceOneRequestListItemTlp = "amber"
+ CloudforceOneRequestListItemTlpAmberStrict CloudforceOneRequestListItemTlp = "amber-strict"
+ CloudforceOneRequestListItemTlpGreen CloudforceOneRequestListItemTlp = "green"
+ CloudforceOneRequestListItemTlpRed CloudforceOneRequestListItemTlp = "red"
+)
+
+// Request Status
+type CloudforceOneRequestListItemStatus string
+
+const (
+ CloudforceOneRequestListItemStatusOpen CloudforceOneRequestListItemStatus = "open"
+ CloudforceOneRequestListItemStatusAccepted CloudforceOneRequestListItemStatus = "accepted"
+ CloudforceOneRequestListItemStatusReported CloudforceOneRequestListItemStatus = "reported"
+ CloudforceOneRequestListItemStatusApproved CloudforceOneRequestListItemStatus = "approved"
+ CloudforceOneRequestListItemStatusCompleted CloudforceOneRequestListItemStatus = "completed"
+ CloudforceOneRequestListItemStatusDeclined CloudforceOneRequestListItemStatus = "declined"
+)
+
+type CloudforceOneRequestTypes []string
+
+// Union satisfied by [cloudforce_one.RequestDeleteResponseUnknown],
+// [cloudforce_one.RequestDeleteResponseArray] or [shared.UnionString].
+type RequestDeleteResponse interface {
+ ImplementsCloudforceOneRequestDeleteResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RequestDeleteResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RequestDeleteResponseArray{}),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+type RequestDeleteResponseArray []interface{}
+
+func (r RequestDeleteResponseArray) ImplementsCloudforceOneRequestDeleteResponse() {}
+
+type RequestNewParams struct {
+ // Request content
+ Content param.Field[string] `json:"content"`
+ // Priority for analyzing the request
+ Priority param.Field[string] `json:"priority"`
+ // Requested information from request
+ RequestType param.Field[string] `json:"request_type"`
+ // Brief description of the request
+ Summary param.Field[string] `json:"summary"`
+ // The CISA defined Traffic Light Protocol (TLP)
+ Tlp param.Field[RequestNewParamsTlp] `json:"tlp"`
+}
+
+func (r RequestNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The CISA defined Traffic Light Protocol (TLP)
+type RequestNewParamsTlp string
+
+const (
+ RequestNewParamsTlpClear RequestNewParamsTlp = "clear"
+ RequestNewParamsTlpAmber RequestNewParamsTlp = "amber"
+ RequestNewParamsTlpAmberStrict RequestNewParamsTlp = "amber-strict"
+ RequestNewParamsTlpGreen RequestNewParamsTlp = "green"
+ RequestNewParamsTlpRed RequestNewParamsTlp = "red"
+)
+
+type RequestNewResponseEnvelope struct {
+ Errors []RequestNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []RequestNewResponseEnvelopeMessages `json:"messages,required"`
+ Result CloudforceOneRequestItem `json:"result,required"`
+ // Whether the API call was successful
+ Success RequestNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON requestNewResponseEnvelopeJSON `json:"-"`
+}
+
+// requestNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [RequestNewResponseEnvelope]
+type requestNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RequestNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r requestNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type RequestNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON requestNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// requestNewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [RequestNewResponseEnvelopeErrors]
+type requestNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RequestNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r requestNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type RequestNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON requestNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// requestNewResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [RequestNewResponseEnvelopeMessages]
+type requestNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RequestNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r requestNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type RequestNewResponseEnvelopeSuccess bool
+
+const (
+ RequestNewResponseEnvelopeSuccessTrue RequestNewResponseEnvelopeSuccess = true
+)
+
+type RequestUpdateParams struct {
+ // Request content
+ Content param.Field[string] `json:"content"`
+ // Priority for analyzing the request
+ Priority param.Field[string] `json:"priority"`
+ // Requested information from request
+ RequestType param.Field[string] `json:"request_type"`
+ // Brief description of the request
+ Summary param.Field[string] `json:"summary"`
+ // The CISA defined Traffic Light Protocol (TLP)
+ Tlp param.Field[RequestUpdateParamsTlp] `json:"tlp"`
+}
+
+func (r RequestUpdateParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The CISA defined Traffic Light Protocol (TLP)
+type RequestUpdateParamsTlp string
+
+const (
+ RequestUpdateParamsTlpClear RequestUpdateParamsTlp = "clear"
+ RequestUpdateParamsTlpAmber RequestUpdateParamsTlp = "amber"
+ RequestUpdateParamsTlpAmberStrict RequestUpdateParamsTlp = "amber-strict"
+ RequestUpdateParamsTlpGreen RequestUpdateParamsTlp = "green"
+ RequestUpdateParamsTlpRed RequestUpdateParamsTlp = "red"
+)
+
+type RequestUpdateResponseEnvelope struct {
+ Errors []RequestUpdateResponseEnvelopeErrors `json:"errors,required"`
+ Messages []RequestUpdateResponseEnvelopeMessages `json:"messages,required"`
+ Result CloudforceOneRequestItem `json:"result,required"`
+ // Whether the API call was successful
+ Success RequestUpdateResponseEnvelopeSuccess `json:"success,required"`
+ JSON requestUpdateResponseEnvelopeJSON `json:"-"`
+}
+
+// requestUpdateResponseEnvelopeJSON contains the JSON metadata for the struct
+// [RequestUpdateResponseEnvelope]
+type requestUpdateResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RequestUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r requestUpdateResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type RequestUpdateResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON requestUpdateResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// requestUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [RequestUpdateResponseEnvelopeErrors]
+type requestUpdateResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RequestUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r requestUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type RequestUpdateResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON requestUpdateResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// requestUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [RequestUpdateResponseEnvelopeMessages]
+type requestUpdateResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RequestUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r requestUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type RequestUpdateResponseEnvelopeSuccess bool
+
+const (
+ RequestUpdateResponseEnvelopeSuccessTrue RequestUpdateResponseEnvelopeSuccess = true
+)
+
+type RequestListParams struct {
+ // Page number of results
+ Page param.Field[int64] `json:"page,required"`
+ // Number of results per page
+ PerPage param.Field[int64] `json:"per_page,required"`
+ // Retrieve requests completed after this time
+ CompletedAfter param.Field[time.Time] `json:"completed_after" format:"date-time"`
+ // Retrieve requests completed before this time
+ CompletedBefore param.Field[time.Time] `json:"completed_before" format:"date-time"`
+ // Retrieve requests created after this time
+ CreatedAfter param.Field[time.Time] `json:"created_after" format:"date-time"`
+ // Retrieve requests created before this time
+ CreatedBefore param.Field[time.Time] `json:"created_before" format:"date-time"`
+ // Requested information from request
+ RequestType param.Field[string] `json:"request_type"`
+ // Field to sort results by
+ SortBy param.Field[string] `json:"sort_by"`
+ // Sort order (asc or desc)
+ SortOrder param.Field[RequestListParamsSortOrder] `json:"sort_order"`
+ // Request Status
+ Status param.Field[RequestListParamsStatus] `json:"status"`
+}
+
+func (r RequestListParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Sort order (asc or desc)
+type RequestListParamsSortOrder string
+
+const (
+ RequestListParamsSortOrderAsc RequestListParamsSortOrder = "asc"
+ RequestListParamsSortOrderDesc RequestListParamsSortOrder = "desc"
+)
+
+// Request Status
+type RequestListParamsStatus string
+
+const (
+ RequestListParamsStatusOpen RequestListParamsStatus = "open"
+ RequestListParamsStatusAccepted RequestListParamsStatus = "accepted"
+ RequestListParamsStatusReported RequestListParamsStatus = "reported"
+ RequestListParamsStatusApproved RequestListParamsStatus = "approved"
+ RequestListParamsStatusCompleted RequestListParamsStatus = "completed"
+ RequestListParamsStatusDeclined RequestListParamsStatus = "declined"
+)
+
+type RequestDeleteResponseEnvelope struct {
+ Errors []RequestDeleteResponseEnvelopeErrors `json:"errors,required"`
+ Messages []RequestDeleteResponseEnvelopeMessages `json:"messages,required"`
+ Result RequestDeleteResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success RequestDeleteResponseEnvelopeSuccess `json:"success,required"`
+ JSON requestDeleteResponseEnvelopeJSON `json:"-"`
+}
+
+// requestDeleteResponseEnvelopeJSON contains the JSON metadata for the struct
+// [RequestDeleteResponseEnvelope]
+type requestDeleteResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RequestDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r requestDeleteResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type RequestDeleteResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON requestDeleteResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// requestDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [RequestDeleteResponseEnvelopeErrors]
+type requestDeleteResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RequestDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r requestDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type RequestDeleteResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON requestDeleteResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// requestDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [RequestDeleteResponseEnvelopeMessages]
+type requestDeleteResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RequestDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r requestDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type RequestDeleteResponseEnvelopeSuccess bool
+
+const (
+ RequestDeleteResponseEnvelopeSuccessTrue RequestDeleteResponseEnvelopeSuccess = true
+)
+
+type RequestConstantsResponseEnvelope struct {
+ Errors []RequestConstantsResponseEnvelopeErrors `json:"errors,required"`
+ Messages []RequestConstantsResponseEnvelopeMessages `json:"messages,required"`
+ Result CloudforceOneRequestConstants `json:"result,required"`
+ // Whether the API call was successful
+ Success RequestConstantsResponseEnvelopeSuccess `json:"success,required"`
+ JSON requestConstantsResponseEnvelopeJSON `json:"-"`
+}
+
+// requestConstantsResponseEnvelopeJSON contains the JSON metadata for the struct
+// [RequestConstantsResponseEnvelope]
+type requestConstantsResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RequestConstantsResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r requestConstantsResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type RequestConstantsResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON requestConstantsResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// requestConstantsResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [RequestConstantsResponseEnvelopeErrors]
+type requestConstantsResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RequestConstantsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r requestConstantsResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type RequestConstantsResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON requestConstantsResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// requestConstantsResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [RequestConstantsResponseEnvelopeMessages]
+type requestConstantsResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RequestConstantsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r requestConstantsResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type RequestConstantsResponseEnvelopeSuccess bool
+
+const (
+ RequestConstantsResponseEnvelopeSuccessTrue RequestConstantsResponseEnvelopeSuccess = true
+)
+
+type RequestGetResponseEnvelope struct {
+ Errors []RequestGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []RequestGetResponseEnvelopeMessages `json:"messages,required"`
+ Result CloudforceOneRequestItem `json:"result,required"`
+ // Whether the API call was successful
+ Success RequestGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON requestGetResponseEnvelopeJSON `json:"-"`
+}
+
+// requestGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [RequestGetResponseEnvelope]
+type requestGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RequestGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r requestGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type RequestGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON requestGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// requestGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [RequestGetResponseEnvelopeErrors]
+type requestGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RequestGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r requestGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type RequestGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON requestGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// requestGetResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [RequestGetResponseEnvelopeMessages]
+type requestGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RequestGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r requestGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type RequestGetResponseEnvelopeSuccess bool
+
+const (
+ RequestGetResponseEnvelopeSuccessTrue RequestGetResponseEnvelopeSuccess = true
+)
+
+type RequestQuotaResponseEnvelope struct {
+ Errors []RequestQuotaResponseEnvelopeErrors `json:"errors,required"`
+ Messages []RequestQuotaResponseEnvelopeMessages `json:"messages,required"`
+ Result CloudforceOneQuota `json:"result,required"`
+ // Whether the API call was successful
+ Success RequestQuotaResponseEnvelopeSuccess `json:"success,required"`
+ JSON requestQuotaResponseEnvelopeJSON `json:"-"`
+}
+
+// requestQuotaResponseEnvelopeJSON contains the JSON metadata for the struct
+// [RequestQuotaResponseEnvelope]
+type requestQuotaResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RequestQuotaResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r requestQuotaResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type RequestQuotaResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON requestQuotaResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// requestQuotaResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [RequestQuotaResponseEnvelopeErrors]
+type requestQuotaResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RequestQuotaResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r requestQuotaResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type RequestQuotaResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON requestQuotaResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// requestQuotaResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [RequestQuotaResponseEnvelopeMessages]
+type requestQuotaResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RequestQuotaResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r requestQuotaResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type RequestQuotaResponseEnvelopeSuccess bool
+
+const (
+ RequestQuotaResponseEnvelopeSuccessTrue RequestQuotaResponseEnvelopeSuccess = true
+)
+
+type RequestTypesResponseEnvelope struct {
+ Errors []RequestTypesResponseEnvelopeErrors `json:"errors,required"`
+ Messages []RequestTypesResponseEnvelopeMessages `json:"messages,required"`
+ Result CloudforceOneRequestTypes `json:"result,required"`
+ // Whether the API call was successful
+ Success RequestTypesResponseEnvelopeSuccess `json:"success,required"`
+ JSON requestTypesResponseEnvelopeJSON `json:"-"`
+}
+
+// requestTypesResponseEnvelopeJSON contains the JSON metadata for the struct
+// [RequestTypesResponseEnvelope]
+type requestTypesResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RequestTypesResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r requestTypesResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type RequestTypesResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON requestTypesResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// requestTypesResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [RequestTypesResponseEnvelopeErrors]
+type requestTypesResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RequestTypesResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r requestTypesResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type RequestTypesResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON requestTypesResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// requestTypesResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [RequestTypesResponseEnvelopeMessages]
+type requestTypesResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RequestTypesResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r requestTypesResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type RequestTypesResponseEnvelopeSuccess bool
+
+const (
+ RequestTypesResponseEnvelopeSuccessTrue RequestTypesResponseEnvelopeSuccess = true
+)
diff --git a/cloudforce_one/request_test.go b/cloudforce_one/request_test.go
new file mode 100644
index 00000000000..f7630573426
--- /dev/null
+++ b/cloudforce_one/request_test.go
@@ -0,0 +1,252 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package cloudforce_one_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/cloudforce_one"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestRequestNewWithOptionalParams(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"),
+ )
+ _, err := client.CloudforceOne.Requests.New(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ cloudforce_one.RequestNewParams{
+ Content: cloudflare.F("What regions were most effected by the recent DoS?"),
+ Priority: cloudflare.F("routine"),
+ RequestType: cloudflare.F("Victomology"),
+ Summary: cloudflare.F("DoS attack"),
+ Tlp: cloudflare.F(cloudforce_one.RequestNewParamsTlpClear),
+ },
+ )
+ 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())
+ }
+}
+
+func TestRequestUpdateWithOptionalParams(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"),
+ )
+ _, err := client.CloudforceOne.Requests.Update(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ cloudforce_one.RequestUpdateParams{
+ Content: cloudflare.F("What regions were most effected by the recent DoS?"),
+ Priority: cloudflare.F("routine"),
+ RequestType: cloudflare.F("Victomology"),
+ Summary: cloudflare.F("DoS attack"),
+ Tlp: cloudflare.F(cloudforce_one.RequestUpdateParamsTlpClear),
+ },
+ )
+ 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())
+ }
+}
+
+func TestRequestListWithOptionalParams(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"),
+ )
+ _, err := client.CloudforceOne.Requests.List(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ cloudforce_one.RequestListParams{
+ Page: cloudflare.F(int64(0)),
+ PerPage: cloudflare.F(int64(10)),
+ CompletedAfter: cloudflare.F(time.Now()),
+ CompletedBefore: cloudflare.F(time.Now()),
+ CreatedAfter: cloudflare.F(time.Now()),
+ CreatedBefore: cloudflare.F(time.Now()),
+ RequestType: cloudflare.F("Victomology"),
+ SortBy: cloudflare.F("created"),
+ SortOrder: cloudflare.F(cloudforce_one.RequestListParamsSortOrderAsc),
+ Status: cloudflare.F(cloudforce_one.RequestListParamsStatusOpen),
+ },
+ )
+ 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())
+ }
+}
+
+func TestRequestDelete(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"),
+ )
+ _, err := client.CloudforceOne.Requests.Delete(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ )
+ 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())
+ }
+}
+
+func TestRequestConstants(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"),
+ )
+ _, err := client.CloudforceOne.Requests.Constants(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353")
+ 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())
+ }
+}
+
+func TestRequestGet(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"),
+ )
+ _, err := client.CloudforceOne.Requests.Get(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ )
+ 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())
+ }
+}
+
+func TestRequestQuota(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"),
+ )
+ _, err := client.CloudforceOne.Requests.Quota(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353")
+ 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())
+ }
+}
+
+func TestRequestTypes(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"),
+ )
+ _, err := client.CloudforceOne.Requests.Types(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353")
+ 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/cloudforce_one/requestmessage.go b/cloudforce_one/requestmessage.go
new file mode 100644
index 00000000000..d246ed01c70
--- /dev/null
+++ b/cloudforce_one/requestmessage.go
@@ -0,0 +1,540 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package cloudforce_one
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "reflect"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/tidwall/gjson"
+)
+
+// RequestMessageService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewRequestMessageService] method
+// instead.
+type RequestMessageService struct {
+ Options []option.RequestOption
+}
+
+// NewRequestMessageService generates a new service that applies the given options
+// to each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewRequestMessageService(opts ...option.RequestOption) (r *RequestMessageService) {
+ r = &RequestMessageService{}
+ r.Options = opts
+ return
+}
+
+// Creating a request adds the request into the Cloudforce One queue for analysis.
+// In addition to the content, a short title, type, priority, and releasability
+// should be provided. If one is not provided a default will be assigned.
+func (r *RequestMessageService) New(ctx context.Context, accountIdentifier string, requestIdentifier string, body RequestMessageNewParams, opts ...option.RequestOption) (res *CloudforceOneRequestMessageItem, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RequestMessageNewResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/cloudforce-one/requests/%s/message/new", accountIdentifier, requestIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Update a Request Message
+func (r *RequestMessageService) Update(ctx context.Context, accountIdentifier string, requestIdentifier string, messageIdentifer int64, body RequestMessageUpdateParams, opts ...option.RequestOption) (res *CloudforceOneRequestMessageItem, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RequestMessageUpdateResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/cloudforce-one/requests/%s/message/%v", accountIdentifier, requestIdentifier, messageIdentifer)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Delete a Request Message
+func (r *RequestMessageService) Delete(ctx context.Context, accountIdentifier string, requestIdentifier string, messageIdentifer int64, opts ...option.RequestOption) (res *RequestMessageDeleteResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RequestMessageDeleteResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/cloudforce-one/requests/%s/message/%v", accountIdentifier, requestIdentifier, messageIdentifer)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// List Request Messages
+func (r *RequestMessageService) Get(ctx context.Context, accountIdentifier string, requestIdentifier string, body RequestMessageGetParams, opts ...option.RequestOption) (res *[]CloudforceOneRequestMessageItem, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RequestMessageGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/cloudforce-one/requests/%s/message", accountIdentifier, requestIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type CloudforceOneRequestMessageItem struct {
+ // Message ID
+ ID int64 `json:"id,required"`
+ // Author of message
+ Author string `json:"author,required"`
+ // Content of message
+ Content string `json:"content,required"`
+ // Message is a follow-on request
+ IsFollowOnRequest bool `json:"is_follow_on_request,required"`
+ // Message last updated time
+ Updated time.Time `json:"updated,required" format:"date-time"`
+ // Message creation time
+ Created time.Time `json:"created" format:"date-time"`
+ JSON cloudforceOneRequestMessageItemJSON `json:"-"`
+}
+
+// cloudforceOneRequestMessageItemJSON contains the JSON metadata for the struct
+// [CloudforceOneRequestMessageItem]
+type cloudforceOneRequestMessageItemJSON struct {
+ ID apijson.Field
+ Author apijson.Field
+ Content apijson.Field
+ IsFollowOnRequest apijson.Field
+ Updated apijson.Field
+ Created apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CloudforceOneRequestMessageItem) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r cloudforceOneRequestMessageItemJSON) RawJSON() string {
+ return r.raw
+}
+
+// Union satisfied by [cloudforce_one.RequestMessageDeleteResponseUnknown],
+// [cloudforce_one.RequestMessageDeleteResponseArray] or [shared.UnionString].
+type RequestMessageDeleteResponse interface {
+ ImplementsCloudforceOneRequestMessageDeleteResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RequestMessageDeleteResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RequestMessageDeleteResponseArray{}),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+type RequestMessageDeleteResponseArray []interface{}
+
+func (r RequestMessageDeleteResponseArray) ImplementsCloudforceOneRequestMessageDeleteResponse() {}
+
+type RequestMessageNewParams struct {
+ // Content of message
+ Content param.Field[string] `json:"content"`
+}
+
+func (r RequestMessageNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type RequestMessageNewResponseEnvelope struct {
+ Errors []RequestMessageNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []RequestMessageNewResponseEnvelopeMessages `json:"messages,required"`
+ Result CloudforceOneRequestMessageItem `json:"result,required"`
+ // Whether the API call was successful
+ Success RequestMessageNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON requestMessageNewResponseEnvelopeJSON `json:"-"`
+}
+
+// requestMessageNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [RequestMessageNewResponseEnvelope]
+type requestMessageNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RequestMessageNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r requestMessageNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type RequestMessageNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON requestMessageNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// requestMessageNewResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [RequestMessageNewResponseEnvelopeErrors]
+type requestMessageNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RequestMessageNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r requestMessageNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type RequestMessageNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON requestMessageNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// requestMessageNewResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [RequestMessageNewResponseEnvelopeMessages]
+type requestMessageNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RequestMessageNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r requestMessageNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type RequestMessageNewResponseEnvelopeSuccess bool
+
+const (
+ RequestMessageNewResponseEnvelopeSuccessTrue RequestMessageNewResponseEnvelopeSuccess = true
+)
+
+type RequestMessageUpdateParams struct {
+ // Request content
+ Content param.Field[string] `json:"content"`
+ // Priority for analyzing the request
+ Priority param.Field[string] `json:"priority"`
+ // Requested information from request
+ RequestType param.Field[string] `json:"request_type"`
+ // Brief description of the request
+ Summary param.Field[string] `json:"summary"`
+ // The CISA defined Traffic Light Protocol (TLP)
+ Tlp param.Field[RequestMessageUpdateParamsTlp] `json:"tlp"`
+}
+
+func (r RequestMessageUpdateParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The CISA defined Traffic Light Protocol (TLP)
+type RequestMessageUpdateParamsTlp string
+
+const (
+ RequestMessageUpdateParamsTlpClear RequestMessageUpdateParamsTlp = "clear"
+ RequestMessageUpdateParamsTlpAmber RequestMessageUpdateParamsTlp = "amber"
+ RequestMessageUpdateParamsTlpAmberStrict RequestMessageUpdateParamsTlp = "amber-strict"
+ RequestMessageUpdateParamsTlpGreen RequestMessageUpdateParamsTlp = "green"
+ RequestMessageUpdateParamsTlpRed RequestMessageUpdateParamsTlp = "red"
+)
+
+type RequestMessageUpdateResponseEnvelope struct {
+ Errors []RequestMessageUpdateResponseEnvelopeErrors `json:"errors,required"`
+ Messages []RequestMessageUpdateResponseEnvelopeMessages `json:"messages,required"`
+ Result CloudforceOneRequestMessageItem `json:"result,required"`
+ // Whether the API call was successful
+ Success RequestMessageUpdateResponseEnvelopeSuccess `json:"success,required"`
+ JSON requestMessageUpdateResponseEnvelopeJSON `json:"-"`
+}
+
+// requestMessageUpdateResponseEnvelopeJSON contains the JSON metadata for the
+// struct [RequestMessageUpdateResponseEnvelope]
+type requestMessageUpdateResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RequestMessageUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r requestMessageUpdateResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type RequestMessageUpdateResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON requestMessageUpdateResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// requestMessageUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for
+// the struct [RequestMessageUpdateResponseEnvelopeErrors]
+type requestMessageUpdateResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RequestMessageUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r requestMessageUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type RequestMessageUpdateResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON requestMessageUpdateResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// requestMessageUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for
+// the struct [RequestMessageUpdateResponseEnvelopeMessages]
+type requestMessageUpdateResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RequestMessageUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r requestMessageUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type RequestMessageUpdateResponseEnvelopeSuccess bool
+
+const (
+ RequestMessageUpdateResponseEnvelopeSuccessTrue RequestMessageUpdateResponseEnvelopeSuccess = true
+)
+
+type RequestMessageDeleteResponseEnvelope struct {
+ Errors []RequestMessageDeleteResponseEnvelopeErrors `json:"errors,required"`
+ Messages []RequestMessageDeleteResponseEnvelopeMessages `json:"messages,required"`
+ Result RequestMessageDeleteResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success RequestMessageDeleteResponseEnvelopeSuccess `json:"success,required"`
+ JSON requestMessageDeleteResponseEnvelopeJSON `json:"-"`
+}
+
+// requestMessageDeleteResponseEnvelopeJSON contains the JSON metadata for the
+// struct [RequestMessageDeleteResponseEnvelope]
+type requestMessageDeleteResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RequestMessageDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r requestMessageDeleteResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type RequestMessageDeleteResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON requestMessageDeleteResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// requestMessageDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for
+// the struct [RequestMessageDeleteResponseEnvelopeErrors]
+type requestMessageDeleteResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RequestMessageDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r requestMessageDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type RequestMessageDeleteResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON requestMessageDeleteResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// requestMessageDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for
+// the struct [RequestMessageDeleteResponseEnvelopeMessages]
+type requestMessageDeleteResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RequestMessageDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r requestMessageDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type RequestMessageDeleteResponseEnvelopeSuccess bool
+
+const (
+ RequestMessageDeleteResponseEnvelopeSuccessTrue RequestMessageDeleteResponseEnvelopeSuccess = true
+)
+
+type RequestMessageGetParams struct {
+ // Page number of results
+ Page param.Field[int64] `json:"page,required"`
+ // Number of results per page
+ PerPage param.Field[int64] `json:"per_page,required"`
+ // Retrieve messages created after this time
+ After param.Field[time.Time] `json:"after" format:"date-time"`
+ // Retrieve messages created before this time
+ Before param.Field[time.Time] `json:"before" format:"date-time"`
+ // Field to sort results by
+ SortBy param.Field[string] `json:"sort_by"`
+ // Sort order (asc or desc)
+ SortOrder param.Field[RequestMessageGetParamsSortOrder] `json:"sort_order"`
+}
+
+func (r RequestMessageGetParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Sort order (asc or desc)
+type RequestMessageGetParamsSortOrder string
+
+const (
+ RequestMessageGetParamsSortOrderAsc RequestMessageGetParamsSortOrder = "asc"
+ RequestMessageGetParamsSortOrderDesc RequestMessageGetParamsSortOrder = "desc"
+)
+
+type RequestMessageGetResponseEnvelope struct {
+ Errors []RequestMessageGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []RequestMessageGetResponseEnvelopeMessages `json:"messages,required"`
+ Result []CloudforceOneRequestMessageItem `json:"result,required"`
+ // Whether the API call was successful
+ Success RequestMessageGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON requestMessageGetResponseEnvelopeJSON `json:"-"`
+}
+
+// requestMessageGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [RequestMessageGetResponseEnvelope]
+type requestMessageGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RequestMessageGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r requestMessageGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type RequestMessageGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON requestMessageGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// requestMessageGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [RequestMessageGetResponseEnvelopeErrors]
+type requestMessageGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RequestMessageGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r requestMessageGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type RequestMessageGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON requestMessageGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// requestMessageGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [RequestMessageGetResponseEnvelopeMessages]
+type requestMessageGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RequestMessageGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r requestMessageGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type RequestMessageGetResponseEnvelopeSuccess bool
+
+const (
+ RequestMessageGetResponseEnvelopeSuccessTrue RequestMessageGetResponseEnvelopeSuccess = true
+)
diff --git a/cloudforce_one/requestmessage_test.go b/cloudforce_one/requestmessage_test.go
new file mode 100644
index 00000000000..3c5cd92418d
--- /dev/null
+++ b/cloudforce_one/requestmessage_test.go
@@ -0,0 +1,148 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package cloudforce_one_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/cloudforce_one"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestRequestMessageNewWithOptionalParams(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"),
+ )
+ _, err := client.CloudforceOne.Requests.Message.New(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ cloudforce_one.RequestMessageNewParams{
+ Content: cloudflare.F("Can you elaborate on the type of DoS that occurred?"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestRequestMessageUpdateWithOptionalParams(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"),
+ )
+ _, err := client.CloudforceOne.Requests.Message.Update(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ int64(0),
+ cloudforce_one.RequestMessageUpdateParams{
+ Content: cloudflare.F("What regions were most effected by the recent DoS?"),
+ Priority: cloudflare.F("routine"),
+ RequestType: cloudflare.F("Victomology"),
+ Summary: cloudflare.F("DoS attack"),
+ Tlp: cloudflare.F(cloudforce_one.RequestMessageUpdateParamsTlpClear),
+ },
+ )
+ 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())
+ }
+}
+
+func TestRequestMessageDelete(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"),
+ )
+ _, err := client.CloudforceOne.Requests.Message.Delete(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ int64(0),
+ )
+ 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())
+ }
+}
+
+func TestRequestMessageGetWithOptionalParams(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"),
+ )
+ _, err := client.CloudforceOne.Requests.Message.Get(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ cloudforce_one.RequestMessageGetParams{
+ Page: cloudflare.F(int64(0)),
+ PerPage: cloudflare.F(int64(10)),
+ After: cloudflare.F(time.Now()),
+ Before: cloudflare.F(time.Now()),
+ SortBy: cloudflare.F("created"),
+ SortOrder: cloudflare.F(cloudforce_one.RequestMessageGetParamsSortOrderAsc),
+ },
+ )
+ 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/cloudforce_one/requestpriority.go b/cloudforce_one/requestpriority.go
new file mode 100644
index 00000000000..2576110271c
--- /dev/null
+++ b/cloudforce_one/requestpriority.go
@@ -0,0 +1,634 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package cloudforce_one
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "reflect"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/tidwall/gjson"
+)
+
+// RequestPriorityService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewRequestPriorityService] method
+// instead.
+type RequestPriorityService struct {
+ Options []option.RequestOption
+}
+
+// NewRequestPriorityService generates a new service that applies the given options
+// to each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewRequestPriorityService(opts ...option.RequestOption) (r *RequestPriorityService) {
+ r = &RequestPriorityService{}
+ r.Options = opts
+ return
+}
+
+// Create a New Priority Requirement
+func (r *RequestPriorityService) New(ctx context.Context, accountIdentifier string, body RequestPriorityNewParams, opts ...option.RequestOption) (res *CloudforceOnePriorityItem, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RequestPriorityNewResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/cloudforce-one/requests/priority/new", accountIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Update a Priority Intelligence Requirement
+func (r *RequestPriorityService) Update(ctx context.Context, accountIdentifier string, priorityIdentifer string, body RequestPriorityUpdateParams, opts ...option.RequestOption) (res *CloudforceOneRequestItem, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RequestPriorityUpdateResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/cloudforce-one/requests/priority/%s", accountIdentifier, priorityIdentifer)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Delete a Priority Intelligence Report
+func (r *RequestPriorityService) Delete(ctx context.Context, accountIdentifier string, priorityIdentifer string, opts ...option.RequestOption) (res *RequestPriorityDeleteResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RequestPriorityDeleteResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/cloudforce-one/requests/priority/%s", accountIdentifier, priorityIdentifer)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Get a Priority Intelligence Requirement
+func (r *RequestPriorityService) Get(ctx context.Context, accountIdentifier string, priorityIdentifer string, opts ...option.RequestOption) (res *CloudforceOneRequestItem, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RequestPriorityGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/cloudforce-one/requests/priority/%s", accountIdentifier, priorityIdentifer)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Get Priority Intelligence Requirement Quota
+func (r *RequestPriorityService) Quota(ctx context.Context, accountIdentifier string, opts ...option.RequestOption) (res *CloudforceOneQuota, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RequestPriorityQuotaResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/cloudforce-one/requests/priority/quota", accountIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type CloudforceOnePriorityItem struct {
+ // UUID
+ ID string `json:"id,required"`
+ // Priority creation time
+ Created time.Time `json:"created,required" format:"date-time"`
+ // List of labels
+ Labels []string `json:"labels,required"`
+ // Priority
+ Priority int64 `json:"priority,required"`
+ // Requirement
+ Requirement string `json:"requirement,required"`
+ // The CISA defined Traffic Light Protocol (TLP)
+ Tlp CloudforceOnePriorityItemTlp `json:"tlp,required"`
+ // Priority last updated time
+ Updated time.Time `json:"updated,required" format:"date-time"`
+ JSON cloudforceOnePriorityItemJSON `json:"-"`
+}
+
+// cloudforceOnePriorityItemJSON contains the JSON metadata for the struct
+// [CloudforceOnePriorityItem]
+type cloudforceOnePriorityItemJSON struct {
+ ID apijson.Field
+ Created apijson.Field
+ Labels apijson.Field
+ Priority apijson.Field
+ Requirement apijson.Field
+ Tlp apijson.Field
+ Updated apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CloudforceOnePriorityItem) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r cloudforceOnePriorityItemJSON) RawJSON() string {
+ return r.raw
+}
+
+// The CISA defined Traffic Light Protocol (TLP)
+type CloudforceOnePriorityItemTlp string
+
+const (
+ CloudforceOnePriorityItemTlpClear CloudforceOnePriorityItemTlp = "clear"
+ CloudforceOnePriorityItemTlpAmber CloudforceOnePriorityItemTlp = "amber"
+ CloudforceOnePriorityItemTlpAmberStrict CloudforceOnePriorityItemTlp = "amber-strict"
+ CloudforceOnePriorityItemTlpGreen CloudforceOnePriorityItemTlp = "green"
+ CloudforceOnePriorityItemTlpRed CloudforceOnePriorityItemTlp = "red"
+)
+
+// Union satisfied by [cloudforce_one.RequestPriorityDeleteResponseUnknown],
+// [cloudforce_one.RequestPriorityDeleteResponseArray] or [shared.UnionString].
+type RequestPriorityDeleteResponse interface {
+ ImplementsCloudforceOneRequestPriorityDeleteResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RequestPriorityDeleteResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RequestPriorityDeleteResponseArray{}),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+type RequestPriorityDeleteResponseArray []interface{}
+
+func (r RequestPriorityDeleteResponseArray) ImplementsCloudforceOneRequestPriorityDeleteResponse() {}
+
+type RequestPriorityNewParams struct {
+ // List of labels
+ Labels param.Field[[]string] `json:"labels,required"`
+ // Priority
+ Priority param.Field[int64] `json:"priority,required"`
+ // Requirement
+ Requirement param.Field[string] `json:"requirement,required"`
+ // The CISA defined Traffic Light Protocol (TLP)
+ Tlp param.Field[RequestPriorityNewParamsTlp] `json:"tlp,required"`
+}
+
+func (r RequestPriorityNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The CISA defined Traffic Light Protocol (TLP)
+type RequestPriorityNewParamsTlp string
+
+const (
+ RequestPriorityNewParamsTlpClear RequestPriorityNewParamsTlp = "clear"
+ RequestPriorityNewParamsTlpAmber RequestPriorityNewParamsTlp = "amber"
+ RequestPriorityNewParamsTlpAmberStrict RequestPriorityNewParamsTlp = "amber-strict"
+ RequestPriorityNewParamsTlpGreen RequestPriorityNewParamsTlp = "green"
+ RequestPriorityNewParamsTlpRed RequestPriorityNewParamsTlp = "red"
+)
+
+type RequestPriorityNewResponseEnvelope struct {
+ Errors []RequestPriorityNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []RequestPriorityNewResponseEnvelopeMessages `json:"messages,required"`
+ Result CloudforceOnePriorityItem `json:"result,required"`
+ // Whether the API call was successful
+ Success RequestPriorityNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON requestPriorityNewResponseEnvelopeJSON `json:"-"`
+}
+
+// requestPriorityNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [RequestPriorityNewResponseEnvelope]
+type requestPriorityNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RequestPriorityNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r requestPriorityNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type RequestPriorityNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON requestPriorityNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// requestPriorityNewResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [RequestPriorityNewResponseEnvelopeErrors]
+type requestPriorityNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RequestPriorityNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r requestPriorityNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type RequestPriorityNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON requestPriorityNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// requestPriorityNewResponseEnvelopeMessagesJSON contains the JSON metadata for
+// the struct [RequestPriorityNewResponseEnvelopeMessages]
+type requestPriorityNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RequestPriorityNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r requestPriorityNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type RequestPriorityNewResponseEnvelopeSuccess bool
+
+const (
+ RequestPriorityNewResponseEnvelopeSuccessTrue RequestPriorityNewResponseEnvelopeSuccess = true
+)
+
+type RequestPriorityUpdateParams struct {
+ // List of labels
+ Labels param.Field[[]string] `json:"labels,required"`
+ // Priority
+ Priority param.Field[int64] `json:"priority,required"`
+ // Requirement
+ Requirement param.Field[string] `json:"requirement,required"`
+ // The CISA defined Traffic Light Protocol (TLP)
+ Tlp param.Field[RequestPriorityUpdateParamsTlp] `json:"tlp,required"`
+}
+
+func (r RequestPriorityUpdateParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The CISA defined Traffic Light Protocol (TLP)
+type RequestPriorityUpdateParamsTlp string
+
+const (
+ RequestPriorityUpdateParamsTlpClear RequestPriorityUpdateParamsTlp = "clear"
+ RequestPriorityUpdateParamsTlpAmber RequestPriorityUpdateParamsTlp = "amber"
+ RequestPriorityUpdateParamsTlpAmberStrict RequestPriorityUpdateParamsTlp = "amber-strict"
+ RequestPriorityUpdateParamsTlpGreen RequestPriorityUpdateParamsTlp = "green"
+ RequestPriorityUpdateParamsTlpRed RequestPriorityUpdateParamsTlp = "red"
+)
+
+type RequestPriorityUpdateResponseEnvelope struct {
+ Errors []RequestPriorityUpdateResponseEnvelopeErrors `json:"errors,required"`
+ Messages []RequestPriorityUpdateResponseEnvelopeMessages `json:"messages,required"`
+ Result CloudforceOneRequestItem `json:"result,required"`
+ // Whether the API call was successful
+ Success RequestPriorityUpdateResponseEnvelopeSuccess `json:"success,required"`
+ JSON requestPriorityUpdateResponseEnvelopeJSON `json:"-"`
+}
+
+// requestPriorityUpdateResponseEnvelopeJSON contains the JSON metadata for the
+// struct [RequestPriorityUpdateResponseEnvelope]
+type requestPriorityUpdateResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RequestPriorityUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r requestPriorityUpdateResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type RequestPriorityUpdateResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON requestPriorityUpdateResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// requestPriorityUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for
+// the struct [RequestPriorityUpdateResponseEnvelopeErrors]
+type requestPriorityUpdateResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RequestPriorityUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r requestPriorityUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type RequestPriorityUpdateResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON requestPriorityUpdateResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// requestPriorityUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for
+// the struct [RequestPriorityUpdateResponseEnvelopeMessages]
+type requestPriorityUpdateResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RequestPriorityUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r requestPriorityUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type RequestPriorityUpdateResponseEnvelopeSuccess bool
+
+const (
+ RequestPriorityUpdateResponseEnvelopeSuccessTrue RequestPriorityUpdateResponseEnvelopeSuccess = true
+)
+
+type RequestPriorityDeleteResponseEnvelope struct {
+ Errors []RequestPriorityDeleteResponseEnvelopeErrors `json:"errors,required"`
+ Messages []RequestPriorityDeleteResponseEnvelopeMessages `json:"messages,required"`
+ Result RequestPriorityDeleteResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success RequestPriorityDeleteResponseEnvelopeSuccess `json:"success,required"`
+ JSON requestPriorityDeleteResponseEnvelopeJSON `json:"-"`
+}
+
+// requestPriorityDeleteResponseEnvelopeJSON contains the JSON metadata for the
+// struct [RequestPriorityDeleteResponseEnvelope]
+type requestPriorityDeleteResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RequestPriorityDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r requestPriorityDeleteResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type RequestPriorityDeleteResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON requestPriorityDeleteResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// requestPriorityDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for
+// the struct [RequestPriorityDeleteResponseEnvelopeErrors]
+type requestPriorityDeleteResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RequestPriorityDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r requestPriorityDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type RequestPriorityDeleteResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON requestPriorityDeleteResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// requestPriorityDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for
+// the struct [RequestPriorityDeleteResponseEnvelopeMessages]
+type requestPriorityDeleteResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RequestPriorityDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r requestPriorityDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type RequestPriorityDeleteResponseEnvelopeSuccess bool
+
+const (
+ RequestPriorityDeleteResponseEnvelopeSuccessTrue RequestPriorityDeleteResponseEnvelopeSuccess = true
+)
+
+type RequestPriorityGetResponseEnvelope struct {
+ Errors []RequestPriorityGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []RequestPriorityGetResponseEnvelopeMessages `json:"messages,required"`
+ Result CloudforceOneRequestItem `json:"result,required"`
+ // Whether the API call was successful
+ Success RequestPriorityGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON requestPriorityGetResponseEnvelopeJSON `json:"-"`
+}
+
+// requestPriorityGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [RequestPriorityGetResponseEnvelope]
+type requestPriorityGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RequestPriorityGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r requestPriorityGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type RequestPriorityGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON requestPriorityGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// requestPriorityGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [RequestPriorityGetResponseEnvelopeErrors]
+type requestPriorityGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RequestPriorityGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r requestPriorityGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type RequestPriorityGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON requestPriorityGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// requestPriorityGetResponseEnvelopeMessagesJSON contains the JSON metadata for
+// the struct [RequestPriorityGetResponseEnvelopeMessages]
+type requestPriorityGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RequestPriorityGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r requestPriorityGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type RequestPriorityGetResponseEnvelopeSuccess bool
+
+const (
+ RequestPriorityGetResponseEnvelopeSuccessTrue RequestPriorityGetResponseEnvelopeSuccess = true
+)
+
+type RequestPriorityQuotaResponseEnvelope struct {
+ Errors []RequestPriorityQuotaResponseEnvelopeErrors `json:"errors,required"`
+ Messages []RequestPriorityQuotaResponseEnvelopeMessages `json:"messages,required"`
+ Result CloudforceOneQuota `json:"result,required"`
+ // Whether the API call was successful
+ Success RequestPriorityQuotaResponseEnvelopeSuccess `json:"success,required"`
+ JSON requestPriorityQuotaResponseEnvelopeJSON `json:"-"`
+}
+
+// requestPriorityQuotaResponseEnvelopeJSON contains the JSON metadata for the
+// struct [RequestPriorityQuotaResponseEnvelope]
+type requestPriorityQuotaResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RequestPriorityQuotaResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r requestPriorityQuotaResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type RequestPriorityQuotaResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON requestPriorityQuotaResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// requestPriorityQuotaResponseEnvelopeErrorsJSON contains the JSON metadata for
+// the struct [RequestPriorityQuotaResponseEnvelopeErrors]
+type requestPriorityQuotaResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RequestPriorityQuotaResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r requestPriorityQuotaResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type RequestPriorityQuotaResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON requestPriorityQuotaResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// requestPriorityQuotaResponseEnvelopeMessagesJSON contains the JSON metadata for
+// the struct [RequestPriorityQuotaResponseEnvelopeMessages]
+type requestPriorityQuotaResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RequestPriorityQuotaResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r requestPriorityQuotaResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type RequestPriorityQuotaResponseEnvelopeSuccess bool
+
+const (
+ RequestPriorityQuotaResponseEnvelopeSuccessTrue RequestPriorityQuotaResponseEnvelopeSuccess = true
+)
diff --git a/cloudforce_one/requestpriority_test.go b/cloudforce_one/requestpriority_test.go
new file mode 100644
index 00000000000..0bab359eb7c
--- /dev/null
+++ b/cloudforce_one/requestpriority_test.go
@@ -0,0 +1,162 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package cloudforce_one_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/cloudforce_one"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestRequestPriorityNew(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"),
+ )
+ _, err := client.CloudforceOne.Requests.Priority.New(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ cloudforce_one.RequestPriorityNewParams{
+ Labels: cloudflare.F([]string{"DoS", "CVE"}),
+ Priority: cloudflare.F(int64(1)),
+ Requirement: cloudflare.F("DoS attacks carried out by CVEs"),
+ Tlp: cloudflare.F(cloudforce_one.RequestPriorityNewParamsTlpClear),
+ },
+ )
+ 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())
+ }
+}
+
+func TestRequestPriorityUpdate(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"),
+ )
+ _, err := client.CloudforceOne.Requests.Priority.Update(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ cloudforce_one.RequestPriorityUpdateParams{
+ Labels: cloudflare.F([]string{"DoS", "CVE"}),
+ Priority: cloudflare.F(int64(1)),
+ Requirement: cloudflare.F("DoS attacks carried out by CVEs"),
+ Tlp: cloudflare.F(cloudforce_one.RequestPriorityUpdateParamsTlpClear),
+ },
+ )
+ 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())
+ }
+}
+
+func TestRequestPriorityDelete(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"),
+ )
+ _, err := client.CloudforceOne.Requests.Priority.Delete(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ )
+ 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())
+ }
+}
+
+func TestRequestPriorityGet(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"),
+ )
+ _, err := client.CloudforceOne.Requests.Priority.Get(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ )
+ 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())
+ }
+}
+
+func TestRequestPriorityQuota(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"),
+ )
+ _, err := client.CloudforceOne.Requests.Priority.Quota(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353")
+ 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/cloudforceonerequest.go b/cloudforceonerequest.go
deleted file mode 100644
index 31eb1846f06..00000000000
--- a/cloudforceonerequest.go
+++ /dev/null
@@ -1,1256 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "reflect"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/option"
- "github.com/tidwall/gjson"
-)
-
-// CloudforceOneRequestService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewCloudforceOneRequestService]
-// method instead.
-type CloudforceOneRequestService struct {
- Options []option.RequestOption
- Message *CloudforceOneRequestMessageService
- Priority *CloudforceOneRequestPriorityService
-}
-
-// NewCloudforceOneRequestService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewCloudforceOneRequestService(opts ...option.RequestOption) (r *CloudforceOneRequestService) {
- r = &CloudforceOneRequestService{}
- r.Options = opts
- r.Message = NewCloudforceOneRequestMessageService(opts...)
- r.Priority = NewCloudforceOneRequestPriorityService(opts...)
- return
-}
-
-// Creating a request adds the request into the Cloudforce One queue for analysis.
-// In addition to the content, a short title, type, priority, and releasability
-// should be provided. If one is not provided a default will be assigned.
-func (r *CloudforceOneRequestService) New(ctx context.Context, accountIdentifier string, body CloudforceOneRequestNewParams, opts ...option.RequestOption) (res *CloudforceOneRequestNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env CloudforceOneRequestNewResponseEnvelope
- path := fmt.Sprintf("accounts/%s/cloudforce-one/requests/new", accountIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Updating a request alters the request in the Cloudforce One queue. This API may
-// be used to update any attributes of the request after the initial submission.
-// Only fields that you choose to update need to be add to the request body
-func (r *CloudforceOneRequestService) Update(ctx context.Context, accountIdentifier string, requestIdentifier string, body CloudforceOneRequestUpdateParams, opts ...option.RequestOption) (res *CloudforceOneRequestUpdateResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env CloudforceOneRequestUpdateResponseEnvelope
- path := fmt.Sprintf("accounts/%s/cloudforce-one/requests/%s", accountIdentifier, requestIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// List Requests
-func (r *CloudforceOneRequestService) List(ctx context.Context, accountIdentifier string, body CloudforceOneRequestListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[CloudforceOneRequestListResponse], err error) {
- var raw *http.Response
- opts = append(r.Options, opts...)
- opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
- path := fmt.Sprintf("accounts/%s/cloudforce-one/requests", accountIdentifier)
- cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodPost, path, body, &res, opts...)
- if err != nil {
- return nil, err
- }
- err = cfg.Execute()
- if err != nil {
- return nil, err
- }
- res.SetPageConfig(cfg, raw)
- return res, nil
-}
-
-// List Requests
-func (r *CloudforceOneRequestService) ListAutoPaging(ctx context.Context, accountIdentifier string, body CloudforceOneRequestListParams, opts ...option.RequestOption) *shared.V4PagePaginationArrayAutoPager[CloudforceOneRequestListResponse] {
- return shared.NewV4PagePaginationArrayAutoPager(r.List(ctx, accountIdentifier, body, opts...))
-}
-
-// Delete a Request
-func (r *CloudforceOneRequestService) Delete(ctx context.Context, accountIdentifier string, requestIdentifier string, opts ...option.RequestOption) (res *CloudforceOneRequestDeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env CloudforceOneRequestDeleteResponseEnvelope
- path := fmt.Sprintf("accounts/%s/cloudforce-one/requests/%s", accountIdentifier, requestIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Get Request Priority, Status, and TLP constants
-func (r *CloudforceOneRequestService) Constants(ctx context.Context, accountIdentifier string, opts ...option.RequestOption) (res *CloudforceOneRequestConstantsResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env CloudforceOneRequestConstantsResponseEnvelope
- path := fmt.Sprintf("accounts/%s/cloudforce-one/requests/constants", accountIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Get a Request
-func (r *CloudforceOneRequestService) Get(ctx context.Context, accountIdentifier string, requestIdentifier string, opts ...option.RequestOption) (res *CloudforceOneRequestGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env CloudforceOneRequestGetResponseEnvelope
- path := fmt.Sprintf("accounts/%s/cloudforce-one/requests/%s", accountIdentifier, requestIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Get Request Quota
-func (r *CloudforceOneRequestService) Quota(ctx context.Context, accountIdentifier string, opts ...option.RequestOption) (res *CloudforceOneRequestQuotaResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env CloudforceOneRequestQuotaResponseEnvelope
- path := fmt.Sprintf("accounts/%s/cloudforce-one/requests/quota", accountIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Get Request Types
-func (r *CloudforceOneRequestService) Types(ctx context.Context, accountIdentifier string, opts ...option.RequestOption) (res *[]string, err error) {
- opts = append(r.Options[:], opts...)
- var env CloudforceOneRequestTypesResponseEnvelope
- path := fmt.Sprintf("accounts/%s/cloudforce-one/requests/types", accountIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type CloudforceOneRequestNewResponse struct {
- // UUID
- ID string `json:"id,required"`
- // Request content
- Content string `json:"content,required"`
- Created time.Time `json:"created,required" format:"date-time"`
- Priority time.Time `json:"priority,required" format:"date-time"`
- // Requested information from request
- Request string `json:"request,required"`
- // Brief description of the request
- Summary string `json:"summary,required"`
- // The CISA defined Traffic Light Protocol (TLP)
- Tlp CloudforceOneRequestNewResponseTlp `json:"tlp,required"`
- Updated time.Time `json:"updated,required" format:"date-time"`
- Completed time.Time `json:"completed" format:"date-time"`
- // Tokens for the request messages
- MessageTokens int64 `json:"message_tokens"`
- // Readable Request ID
- ReadableID string `json:"readable_id"`
- // Request Status
- Status CloudforceOneRequestNewResponseStatus `json:"status"`
- // Tokens for the request
- Tokens int64 `json:"tokens"`
- JSON cloudforceOneRequestNewResponseJSON `json:"-"`
-}
-
-// cloudforceOneRequestNewResponseJSON contains the JSON metadata for the struct
-// [CloudforceOneRequestNewResponse]
-type cloudforceOneRequestNewResponseJSON struct {
- ID apijson.Field
- Content apijson.Field
- Created apijson.Field
- Priority apijson.Field
- Request apijson.Field
- Summary apijson.Field
- Tlp apijson.Field
- Updated apijson.Field
- Completed apijson.Field
- MessageTokens apijson.Field
- ReadableID apijson.Field
- Status apijson.Field
- Tokens apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CloudforceOneRequestNewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cloudforceOneRequestNewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// The CISA defined Traffic Light Protocol (TLP)
-type CloudforceOneRequestNewResponseTlp string
-
-const (
- CloudforceOneRequestNewResponseTlpClear CloudforceOneRequestNewResponseTlp = "clear"
- CloudforceOneRequestNewResponseTlpAmber CloudforceOneRequestNewResponseTlp = "amber"
- CloudforceOneRequestNewResponseTlpAmberStrict CloudforceOneRequestNewResponseTlp = "amber-strict"
- CloudforceOneRequestNewResponseTlpGreen CloudforceOneRequestNewResponseTlp = "green"
- CloudforceOneRequestNewResponseTlpRed CloudforceOneRequestNewResponseTlp = "red"
-)
-
-// Request Status
-type CloudforceOneRequestNewResponseStatus string
-
-const (
- CloudforceOneRequestNewResponseStatusOpen CloudforceOneRequestNewResponseStatus = "open"
- CloudforceOneRequestNewResponseStatusAccepted CloudforceOneRequestNewResponseStatus = "accepted"
- CloudforceOneRequestNewResponseStatusReported CloudforceOneRequestNewResponseStatus = "reported"
- CloudforceOneRequestNewResponseStatusApproved CloudforceOneRequestNewResponseStatus = "approved"
- CloudforceOneRequestNewResponseStatusCompleted CloudforceOneRequestNewResponseStatus = "completed"
- CloudforceOneRequestNewResponseStatusDeclined CloudforceOneRequestNewResponseStatus = "declined"
-)
-
-type CloudforceOneRequestUpdateResponse struct {
- // UUID
- ID string `json:"id,required"`
- // Request content
- Content string `json:"content,required"`
- Created time.Time `json:"created,required" format:"date-time"`
- Priority time.Time `json:"priority,required" format:"date-time"`
- // Requested information from request
- Request string `json:"request,required"`
- // Brief description of the request
- Summary string `json:"summary,required"`
- // The CISA defined Traffic Light Protocol (TLP)
- Tlp CloudforceOneRequestUpdateResponseTlp `json:"tlp,required"`
- Updated time.Time `json:"updated,required" format:"date-time"`
- Completed time.Time `json:"completed" format:"date-time"`
- // Tokens for the request messages
- MessageTokens int64 `json:"message_tokens"`
- // Readable Request ID
- ReadableID string `json:"readable_id"`
- // Request Status
- Status CloudforceOneRequestUpdateResponseStatus `json:"status"`
- // Tokens for the request
- Tokens int64 `json:"tokens"`
- JSON cloudforceOneRequestUpdateResponseJSON `json:"-"`
-}
-
-// cloudforceOneRequestUpdateResponseJSON contains the JSON metadata for the struct
-// [CloudforceOneRequestUpdateResponse]
-type cloudforceOneRequestUpdateResponseJSON struct {
- ID apijson.Field
- Content apijson.Field
- Created apijson.Field
- Priority apijson.Field
- Request apijson.Field
- Summary apijson.Field
- Tlp apijson.Field
- Updated apijson.Field
- Completed apijson.Field
- MessageTokens apijson.Field
- ReadableID apijson.Field
- Status apijson.Field
- Tokens apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CloudforceOneRequestUpdateResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cloudforceOneRequestUpdateResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// The CISA defined Traffic Light Protocol (TLP)
-type CloudforceOneRequestUpdateResponseTlp string
-
-const (
- CloudforceOneRequestUpdateResponseTlpClear CloudforceOneRequestUpdateResponseTlp = "clear"
- CloudforceOneRequestUpdateResponseTlpAmber CloudforceOneRequestUpdateResponseTlp = "amber"
- CloudforceOneRequestUpdateResponseTlpAmberStrict CloudforceOneRequestUpdateResponseTlp = "amber-strict"
- CloudforceOneRequestUpdateResponseTlpGreen CloudforceOneRequestUpdateResponseTlp = "green"
- CloudforceOneRequestUpdateResponseTlpRed CloudforceOneRequestUpdateResponseTlp = "red"
-)
-
-// Request Status
-type CloudforceOneRequestUpdateResponseStatus string
-
-const (
- CloudforceOneRequestUpdateResponseStatusOpen CloudforceOneRequestUpdateResponseStatus = "open"
- CloudforceOneRequestUpdateResponseStatusAccepted CloudforceOneRequestUpdateResponseStatus = "accepted"
- CloudforceOneRequestUpdateResponseStatusReported CloudforceOneRequestUpdateResponseStatus = "reported"
- CloudforceOneRequestUpdateResponseStatusApproved CloudforceOneRequestUpdateResponseStatus = "approved"
- CloudforceOneRequestUpdateResponseStatusCompleted CloudforceOneRequestUpdateResponseStatus = "completed"
- CloudforceOneRequestUpdateResponseStatusDeclined CloudforceOneRequestUpdateResponseStatus = "declined"
-)
-
-type CloudforceOneRequestListResponse struct {
- // UUID
- ID string `json:"id,required"`
- // Request creation time
- Created time.Time `json:"created,required" format:"date-time"`
- Priority CloudforceOneRequestListResponsePriority `json:"priority,required"`
- // Requested information from request
- Request string `json:"request,required"`
- // Brief description of the request
- Summary string `json:"summary,required"`
- // The CISA defined Traffic Light Protocol (TLP)
- Tlp CloudforceOneRequestListResponseTlp `json:"tlp,required"`
- // Request last updated time
- Updated time.Time `json:"updated,required" format:"date-time"`
- // Request completion time
- Completed time.Time `json:"completed" format:"date-time"`
- // Tokens for the request messages
- MessageTokens int64 `json:"message_tokens"`
- // Readable Request ID
- ReadableID string `json:"readable_id"`
- // Request Status
- Status CloudforceOneRequestListResponseStatus `json:"status"`
- // Tokens for the request
- Tokens int64 `json:"tokens"`
- JSON cloudforceOneRequestListResponseJSON `json:"-"`
-}
-
-// cloudforceOneRequestListResponseJSON contains the JSON metadata for the struct
-// [CloudforceOneRequestListResponse]
-type cloudforceOneRequestListResponseJSON struct {
- ID apijson.Field
- Created apijson.Field
- Priority apijson.Field
- Request apijson.Field
- Summary apijson.Field
- Tlp apijson.Field
- Updated apijson.Field
- Completed apijson.Field
- MessageTokens apijson.Field
- ReadableID apijson.Field
- Status apijson.Field
- Tokens apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CloudforceOneRequestListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cloudforceOneRequestListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type CloudforceOneRequestListResponsePriority string
-
-const (
- CloudforceOneRequestListResponsePriorityRoutine CloudforceOneRequestListResponsePriority = "routine"
- CloudforceOneRequestListResponsePriorityHigh CloudforceOneRequestListResponsePriority = "high"
- CloudforceOneRequestListResponsePriorityUrgent CloudforceOneRequestListResponsePriority = "urgent"
-)
-
-// The CISA defined Traffic Light Protocol (TLP)
-type CloudforceOneRequestListResponseTlp string
-
-const (
- CloudforceOneRequestListResponseTlpClear CloudforceOneRequestListResponseTlp = "clear"
- CloudforceOneRequestListResponseTlpAmber CloudforceOneRequestListResponseTlp = "amber"
- CloudforceOneRequestListResponseTlpAmberStrict CloudforceOneRequestListResponseTlp = "amber-strict"
- CloudforceOneRequestListResponseTlpGreen CloudforceOneRequestListResponseTlp = "green"
- CloudforceOneRequestListResponseTlpRed CloudforceOneRequestListResponseTlp = "red"
-)
-
-// Request Status
-type CloudforceOneRequestListResponseStatus string
-
-const (
- CloudforceOneRequestListResponseStatusOpen CloudforceOneRequestListResponseStatus = "open"
- CloudforceOneRequestListResponseStatusAccepted CloudforceOneRequestListResponseStatus = "accepted"
- CloudforceOneRequestListResponseStatusReported CloudforceOneRequestListResponseStatus = "reported"
- CloudforceOneRequestListResponseStatusApproved CloudforceOneRequestListResponseStatus = "approved"
- CloudforceOneRequestListResponseStatusCompleted CloudforceOneRequestListResponseStatus = "completed"
- CloudforceOneRequestListResponseStatusDeclined CloudforceOneRequestListResponseStatus = "declined"
-)
-
-// Union satisfied by [CloudforceOneRequestDeleteResponseUnknown],
-// [CloudforceOneRequestDeleteResponseArray] or [shared.UnionString].
-type CloudforceOneRequestDeleteResponse interface {
- ImplementsCloudforceOneRequestDeleteResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*CloudforceOneRequestDeleteResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(CloudforceOneRequestDeleteResponseArray{}),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-type CloudforceOneRequestDeleteResponseArray []interface{}
-
-func (r CloudforceOneRequestDeleteResponseArray) ImplementsCloudforceOneRequestDeleteResponse() {}
-
-type CloudforceOneRequestConstantsResponse struct {
- Priority []CloudforceOneRequestConstantsResponsePriority `json:"priority"`
- Status []CloudforceOneRequestConstantsResponseStatus `json:"status"`
- Tlp []CloudforceOneRequestConstantsResponseTlp `json:"tlp"`
- JSON cloudforceOneRequestConstantsResponseJSON `json:"-"`
-}
-
-// cloudforceOneRequestConstantsResponseJSON contains the JSON metadata for the
-// struct [CloudforceOneRequestConstantsResponse]
-type cloudforceOneRequestConstantsResponseJSON struct {
- Priority apijson.Field
- Status apijson.Field
- Tlp apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CloudforceOneRequestConstantsResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cloudforceOneRequestConstantsResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type CloudforceOneRequestConstantsResponsePriority string
-
-const (
- CloudforceOneRequestConstantsResponsePriorityRoutine CloudforceOneRequestConstantsResponsePriority = "routine"
- CloudforceOneRequestConstantsResponsePriorityHigh CloudforceOneRequestConstantsResponsePriority = "high"
- CloudforceOneRequestConstantsResponsePriorityUrgent CloudforceOneRequestConstantsResponsePriority = "urgent"
-)
-
-// Request Status
-type CloudforceOneRequestConstantsResponseStatus string
-
-const (
- CloudforceOneRequestConstantsResponseStatusOpen CloudforceOneRequestConstantsResponseStatus = "open"
- CloudforceOneRequestConstantsResponseStatusAccepted CloudforceOneRequestConstantsResponseStatus = "accepted"
- CloudforceOneRequestConstantsResponseStatusReported CloudforceOneRequestConstantsResponseStatus = "reported"
- CloudforceOneRequestConstantsResponseStatusApproved CloudforceOneRequestConstantsResponseStatus = "approved"
- CloudforceOneRequestConstantsResponseStatusCompleted CloudforceOneRequestConstantsResponseStatus = "completed"
- CloudforceOneRequestConstantsResponseStatusDeclined CloudforceOneRequestConstantsResponseStatus = "declined"
-)
-
-// The CISA defined Traffic Light Protocol (TLP)
-type CloudforceOneRequestConstantsResponseTlp string
-
-const (
- CloudforceOneRequestConstantsResponseTlpClear CloudforceOneRequestConstantsResponseTlp = "clear"
- CloudforceOneRequestConstantsResponseTlpAmber CloudforceOneRequestConstantsResponseTlp = "amber"
- CloudforceOneRequestConstantsResponseTlpAmberStrict CloudforceOneRequestConstantsResponseTlp = "amber-strict"
- CloudforceOneRequestConstantsResponseTlpGreen CloudforceOneRequestConstantsResponseTlp = "green"
- CloudforceOneRequestConstantsResponseTlpRed CloudforceOneRequestConstantsResponseTlp = "red"
-)
-
-type CloudforceOneRequestGetResponse struct {
- // UUID
- ID string `json:"id,required"`
- // Request content
- Content string `json:"content,required"`
- Created time.Time `json:"created,required" format:"date-time"`
- Priority time.Time `json:"priority,required" format:"date-time"`
- // Requested information from request
- Request string `json:"request,required"`
- // Brief description of the request
- Summary string `json:"summary,required"`
- // The CISA defined Traffic Light Protocol (TLP)
- Tlp CloudforceOneRequestGetResponseTlp `json:"tlp,required"`
- Updated time.Time `json:"updated,required" format:"date-time"`
- Completed time.Time `json:"completed" format:"date-time"`
- // Tokens for the request messages
- MessageTokens int64 `json:"message_tokens"`
- // Readable Request ID
- ReadableID string `json:"readable_id"`
- // Request Status
- Status CloudforceOneRequestGetResponseStatus `json:"status"`
- // Tokens for the request
- Tokens int64 `json:"tokens"`
- JSON cloudforceOneRequestGetResponseJSON `json:"-"`
-}
-
-// cloudforceOneRequestGetResponseJSON contains the JSON metadata for the struct
-// [CloudforceOneRequestGetResponse]
-type cloudforceOneRequestGetResponseJSON struct {
- ID apijson.Field
- Content apijson.Field
- Created apijson.Field
- Priority apijson.Field
- Request apijson.Field
- Summary apijson.Field
- Tlp apijson.Field
- Updated apijson.Field
- Completed apijson.Field
- MessageTokens apijson.Field
- ReadableID apijson.Field
- Status apijson.Field
- Tokens apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CloudforceOneRequestGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cloudforceOneRequestGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// The CISA defined Traffic Light Protocol (TLP)
-type CloudforceOneRequestGetResponseTlp string
-
-const (
- CloudforceOneRequestGetResponseTlpClear CloudforceOneRequestGetResponseTlp = "clear"
- CloudforceOneRequestGetResponseTlpAmber CloudforceOneRequestGetResponseTlp = "amber"
- CloudforceOneRequestGetResponseTlpAmberStrict CloudforceOneRequestGetResponseTlp = "amber-strict"
- CloudforceOneRequestGetResponseTlpGreen CloudforceOneRequestGetResponseTlp = "green"
- CloudforceOneRequestGetResponseTlpRed CloudforceOneRequestGetResponseTlp = "red"
-)
-
-// Request Status
-type CloudforceOneRequestGetResponseStatus string
-
-const (
- CloudforceOneRequestGetResponseStatusOpen CloudforceOneRequestGetResponseStatus = "open"
- CloudforceOneRequestGetResponseStatusAccepted CloudforceOneRequestGetResponseStatus = "accepted"
- CloudforceOneRequestGetResponseStatusReported CloudforceOneRequestGetResponseStatus = "reported"
- CloudforceOneRequestGetResponseStatusApproved CloudforceOneRequestGetResponseStatus = "approved"
- CloudforceOneRequestGetResponseStatusCompleted CloudforceOneRequestGetResponseStatus = "completed"
- CloudforceOneRequestGetResponseStatusDeclined CloudforceOneRequestGetResponseStatus = "declined"
-)
-
-type CloudforceOneRequestQuotaResponse struct {
- // Anniversary date is when annual quota limit is refresh
- AnniversaryDate time.Time `json:"anniversary_date" format:"date-time"`
- // Quater anniversary date is when quota limit is refreshed each quarter
- QuarterAnniversaryDate time.Time `json:"quarter_anniversary_date" format:"date-time"`
- // Tokens for the quarter
- Quota int64 `json:"quota"`
- // Tokens remaining for the quarter
- Remaining int64 `json:"remaining"`
- JSON cloudforceOneRequestQuotaResponseJSON `json:"-"`
-}
-
-// cloudforceOneRequestQuotaResponseJSON contains the JSON metadata for the struct
-// [CloudforceOneRequestQuotaResponse]
-type cloudforceOneRequestQuotaResponseJSON struct {
- AnniversaryDate apijson.Field
- QuarterAnniversaryDate apijson.Field
- Quota apijson.Field
- Remaining apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CloudforceOneRequestQuotaResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cloudforceOneRequestQuotaResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type CloudforceOneRequestNewParams struct {
- // Request content
- Content param.Field[string] `json:"content"`
- // Priority for analyzing the request
- Priority param.Field[string] `json:"priority"`
- // Requested information from request
- RequestType param.Field[string] `json:"request_type"`
- // Brief description of the request
- Summary param.Field[string] `json:"summary"`
- // The CISA defined Traffic Light Protocol (TLP)
- Tlp param.Field[CloudforceOneRequestNewParamsTlp] `json:"tlp"`
-}
-
-func (r CloudforceOneRequestNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The CISA defined Traffic Light Protocol (TLP)
-type CloudforceOneRequestNewParamsTlp string
-
-const (
- CloudforceOneRequestNewParamsTlpClear CloudforceOneRequestNewParamsTlp = "clear"
- CloudforceOneRequestNewParamsTlpAmber CloudforceOneRequestNewParamsTlp = "amber"
- CloudforceOneRequestNewParamsTlpAmberStrict CloudforceOneRequestNewParamsTlp = "amber-strict"
- CloudforceOneRequestNewParamsTlpGreen CloudforceOneRequestNewParamsTlp = "green"
- CloudforceOneRequestNewParamsTlpRed CloudforceOneRequestNewParamsTlp = "red"
-)
-
-type CloudforceOneRequestNewResponseEnvelope struct {
- Errors []CloudforceOneRequestNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []CloudforceOneRequestNewResponseEnvelopeMessages `json:"messages,required"`
- Result CloudforceOneRequestNewResponse `json:"result,required"`
- // Whether the API call was successful
- Success CloudforceOneRequestNewResponseEnvelopeSuccess `json:"success,required"`
- JSON cloudforceOneRequestNewResponseEnvelopeJSON `json:"-"`
-}
-
-// cloudforceOneRequestNewResponseEnvelopeJSON contains the JSON metadata for the
-// struct [CloudforceOneRequestNewResponseEnvelope]
-type cloudforceOneRequestNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CloudforceOneRequestNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cloudforceOneRequestNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type CloudforceOneRequestNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON cloudforceOneRequestNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// cloudforceOneRequestNewResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [CloudforceOneRequestNewResponseEnvelopeErrors]
-type cloudforceOneRequestNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CloudforceOneRequestNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cloudforceOneRequestNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type CloudforceOneRequestNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON cloudforceOneRequestNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// cloudforceOneRequestNewResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [CloudforceOneRequestNewResponseEnvelopeMessages]
-type cloudforceOneRequestNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CloudforceOneRequestNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cloudforceOneRequestNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type CloudforceOneRequestNewResponseEnvelopeSuccess bool
-
-const (
- CloudforceOneRequestNewResponseEnvelopeSuccessTrue CloudforceOneRequestNewResponseEnvelopeSuccess = true
-)
-
-type CloudforceOneRequestUpdateParams struct {
- // Request content
- Content param.Field[string] `json:"content"`
- // Priority for analyzing the request
- Priority param.Field[string] `json:"priority"`
- // Requested information from request
- RequestType param.Field[string] `json:"request_type"`
- // Brief description of the request
- Summary param.Field[string] `json:"summary"`
- // The CISA defined Traffic Light Protocol (TLP)
- Tlp param.Field[CloudforceOneRequestUpdateParamsTlp] `json:"tlp"`
-}
-
-func (r CloudforceOneRequestUpdateParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The CISA defined Traffic Light Protocol (TLP)
-type CloudforceOneRequestUpdateParamsTlp string
-
-const (
- CloudforceOneRequestUpdateParamsTlpClear CloudforceOneRequestUpdateParamsTlp = "clear"
- CloudforceOneRequestUpdateParamsTlpAmber CloudforceOneRequestUpdateParamsTlp = "amber"
- CloudforceOneRequestUpdateParamsTlpAmberStrict CloudforceOneRequestUpdateParamsTlp = "amber-strict"
- CloudforceOneRequestUpdateParamsTlpGreen CloudforceOneRequestUpdateParamsTlp = "green"
- CloudforceOneRequestUpdateParamsTlpRed CloudforceOneRequestUpdateParamsTlp = "red"
-)
-
-type CloudforceOneRequestUpdateResponseEnvelope struct {
- Errors []CloudforceOneRequestUpdateResponseEnvelopeErrors `json:"errors,required"`
- Messages []CloudforceOneRequestUpdateResponseEnvelopeMessages `json:"messages,required"`
- Result CloudforceOneRequestUpdateResponse `json:"result,required"`
- // Whether the API call was successful
- Success CloudforceOneRequestUpdateResponseEnvelopeSuccess `json:"success,required"`
- JSON cloudforceOneRequestUpdateResponseEnvelopeJSON `json:"-"`
-}
-
-// cloudforceOneRequestUpdateResponseEnvelopeJSON contains the JSON metadata for
-// the struct [CloudforceOneRequestUpdateResponseEnvelope]
-type cloudforceOneRequestUpdateResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CloudforceOneRequestUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cloudforceOneRequestUpdateResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type CloudforceOneRequestUpdateResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON cloudforceOneRequestUpdateResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// cloudforceOneRequestUpdateResponseEnvelopeErrorsJSON contains the JSON metadata
-// for the struct [CloudforceOneRequestUpdateResponseEnvelopeErrors]
-type cloudforceOneRequestUpdateResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CloudforceOneRequestUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cloudforceOneRequestUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type CloudforceOneRequestUpdateResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON cloudforceOneRequestUpdateResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// cloudforceOneRequestUpdateResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct [CloudforceOneRequestUpdateResponseEnvelopeMessages]
-type cloudforceOneRequestUpdateResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CloudforceOneRequestUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cloudforceOneRequestUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type CloudforceOneRequestUpdateResponseEnvelopeSuccess bool
-
-const (
- CloudforceOneRequestUpdateResponseEnvelopeSuccessTrue CloudforceOneRequestUpdateResponseEnvelopeSuccess = true
-)
-
-type CloudforceOneRequestListParams struct {
- // Page number of results
- Page param.Field[int64] `json:"page,required"`
- // Number of results per page
- PerPage param.Field[int64] `json:"per_page,required"`
- // Retrieve requests completed after this time
- CompletedAfter param.Field[time.Time] `json:"completed_after" format:"date-time"`
- // Retrieve requests completed before this time
- CompletedBefore param.Field[time.Time] `json:"completed_before" format:"date-time"`
- // Retrieve requests created after this time
- CreatedAfter param.Field[time.Time] `json:"created_after" format:"date-time"`
- // Retrieve requests created before this time
- CreatedBefore param.Field[time.Time] `json:"created_before" format:"date-time"`
- // Requested information from request
- RequestType param.Field[string] `json:"request_type"`
- // Field to sort results by
- SortBy param.Field[string] `json:"sort_by"`
- // Sort order (asc or desc)
- SortOrder param.Field[CloudforceOneRequestListParamsSortOrder] `json:"sort_order"`
- // Request Status
- Status param.Field[CloudforceOneRequestListParamsStatus] `json:"status"`
-}
-
-func (r CloudforceOneRequestListParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Sort order (asc or desc)
-type CloudforceOneRequestListParamsSortOrder string
-
-const (
- CloudforceOneRequestListParamsSortOrderAsc CloudforceOneRequestListParamsSortOrder = "asc"
- CloudforceOneRequestListParamsSortOrderDesc CloudforceOneRequestListParamsSortOrder = "desc"
-)
-
-// Request Status
-type CloudforceOneRequestListParamsStatus string
-
-const (
- CloudforceOneRequestListParamsStatusOpen CloudforceOneRequestListParamsStatus = "open"
- CloudforceOneRequestListParamsStatusAccepted CloudforceOneRequestListParamsStatus = "accepted"
- CloudforceOneRequestListParamsStatusReported CloudforceOneRequestListParamsStatus = "reported"
- CloudforceOneRequestListParamsStatusApproved CloudforceOneRequestListParamsStatus = "approved"
- CloudforceOneRequestListParamsStatusCompleted CloudforceOneRequestListParamsStatus = "completed"
- CloudforceOneRequestListParamsStatusDeclined CloudforceOneRequestListParamsStatus = "declined"
-)
-
-type CloudforceOneRequestDeleteResponseEnvelope struct {
- Errors []CloudforceOneRequestDeleteResponseEnvelopeErrors `json:"errors,required"`
- Messages []CloudforceOneRequestDeleteResponseEnvelopeMessages `json:"messages,required"`
- Result CloudforceOneRequestDeleteResponse `json:"result,required"`
- // Whether the API call was successful
- Success CloudforceOneRequestDeleteResponseEnvelopeSuccess `json:"success,required"`
- JSON cloudforceOneRequestDeleteResponseEnvelopeJSON `json:"-"`
-}
-
-// cloudforceOneRequestDeleteResponseEnvelopeJSON contains the JSON metadata for
-// the struct [CloudforceOneRequestDeleteResponseEnvelope]
-type cloudforceOneRequestDeleteResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CloudforceOneRequestDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cloudforceOneRequestDeleteResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type CloudforceOneRequestDeleteResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON cloudforceOneRequestDeleteResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// cloudforceOneRequestDeleteResponseEnvelopeErrorsJSON contains the JSON metadata
-// for the struct [CloudforceOneRequestDeleteResponseEnvelopeErrors]
-type cloudforceOneRequestDeleteResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CloudforceOneRequestDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cloudforceOneRequestDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type CloudforceOneRequestDeleteResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON cloudforceOneRequestDeleteResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// cloudforceOneRequestDeleteResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct [CloudforceOneRequestDeleteResponseEnvelopeMessages]
-type cloudforceOneRequestDeleteResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CloudforceOneRequestDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cloudforceOneRequestDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type CloudforceOneRequestDeleteResponseEnvelopeSuccess bool
-
-const (
- CloudforceOneRequestDeleteResponseEnvelopeSuccessTrue CloudforceOneRequestDeleteResponseEnvelopeSuccess = true
-)
-
-type CloudforceOneRequestConstantsResponseEnvelope struct {
- Errors []CloudforceOneRequestConstantsResponseEnvelopeErrors `json:"errors,required"`
- Messages []CloudforceOneRequestConstantsResponseEnvelopeMessages `json:"messages,required"`
- Result CloudforceOneRequestConstantsResponse `json:"result,required"`
- // Whether the API call was successful
- Success CloudforceOneRequestConstantsResponseEnvelopeSuccess `json:"success,required"`
- JSON cloudforceOneRequestConstantsResponseEnvelopeJSON `json:"-"`
-}
-
-// cloudforceOneRequestConstantsResponseEnvelopeJSON contains the JSON metadata for
-// the struct [CloudforceOneRequestConstantsResponseEnvelope]
-type cloudforceOneRequestConstantsResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CloudforceOneRequestConstantsResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cloudforceOneRequestConstantsResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type CloudforceOneRequestConstantsResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON cloudforceOneRequestConstantsResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// cloudforceOneRequestConstantsResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct [CloudforceOneRequestConstantsResponseEnvelopeErrors]
-type cloudforceOneRequestConstantsResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CloudforceOneRequestConstantsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cloudforceOneRequestConstantsResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type CloudforceOneRequestConstantsResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON cloudforceOneRequestConstantsResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// cloudforceOneRequestConstantsResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct [CloudforceOneRequestConstantsResponseEnvelopeMessages]
-type cloudforceOneRequestConstantsResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CloudforceOneRequestConstantsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cloudforceOneRequestConstantsResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type CloudforceOneRequestConstantsResponseEnvelopeSuccess bool
-
-const (
- CloudforceOneRequestConstantsResponseEnvelopeSuccessTrue CloudforceOneRequestConstantsResponseEnvelopeSuccess = true
-)
-
-type CloudforceOneRequestGetResponseEnvelope struct {
- Errors []CloudforceOneRequestGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []CloudforceOneRequestGetResponseEnvelopeMessages `json:"messages,required"`
- Result CloudforceOneRequestGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success CloudforceOneRequestGetResponseEnvelopeSuccess `json:"success,required"`
- JSON cloudforceOneRequestGetResponseEnvelopeJSON `json:"-"`
-}
-
-// cloudforceOneRequestGetResponseEnvelopeJSON contains the JSON metadata for the
-// struct [CloudforceOneRequestGetResponseEnvelope]
-type cloudforceOneRequestGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CloudforceOneRequestGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cloudforceOneRequestGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type CloudforceOneRequestGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON cloudforceOneRequestGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// cloudforceOneRequestGetResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [CloudforceOneRequestGetResponseEnvelopeErrors]
-type cloudforceOneRequestGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CloudforceOneRequestGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cloudforceOneRequestGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type CloudforceOneRequestGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON cloudforceOneRequestGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// cloudforceOneRequestGetResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [CloudforceOneRequestGetResponseEnvelopeMessages]
-type cloudforceOneRequestGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CloudforceOneRequestGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cloudforceOneRequestGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type CloudforceOneRequestGetResponseEnvelopeSuccess bool
-
-const (
- CloudforceOneRequestGetResponseEnvelopeSuccessTrue CloudforceOneRequestGetResponseEnvelopeSuccess = true
-)
-
-type CloudforceOneRequestQuotaResponseEnvelope struct {
- Errors []CloudforceOneRequestQuotaResponseEnvelopeErrors `json:"errors,required"`
- Messages []CloudforceOneRequestQuotaResponseEnvelopeMessages `json:"messages,required"`
- Result CloudforceOneRequestQuotaResponse `json:"result,required"`
- // Whether the API call was successful
- Success CloudforceOneRequestQuotaResponseEnvelopeSuccess `json:"success,required"`
- JSON cloudforceOneRequestQuotaResponseEnvelopeJSON `json:"-"`
-}
-
-// cloudforceOneRequestQuotaResponseEnvelopeJSON contains the JSON metadata for the
-// struct [CloudforceOneRequestQuotaResponseEnvelope]
-type cloudforceOneRequestQuotaResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CloudforceOneRequestQuotaResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cloudforceOneRequestQuotaResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type CloudforceOneRequestQuotaResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON cloudforceOneRequestQuotaResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// cloudforceOneRequestQuotaResponseEnvelopeErrorsJSON contains the JSON metadata
-// for the struct [CloudforceOneRequestQuotaResponseEnvelopeErrors]
-type cloudforceOneRequestQuotaResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CloudforceOneRequestQuotaResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cloudforceOneRequestQuotaResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type CloudforceOneRequestQuotaResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON cloudforceOneRequestQuotaResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// cloudforceOneRequestQuotaResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [CloudforceOneRequestQuotaResponseEnvelopeMessages]
-type cloudforceOneRequestQuotaResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CloudforceOneRequestQuotaResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cloudforceOneRequestQuotaResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type CloudforceOneRequestQuotaResponseEnvelopeSuccess bool
-
-const (
- CloudforceOneRequestQuotaResponseEnvelopeSuccessTrue CloudforceOneRequestQuotaResponseEnvelopeSuccess = true
-)
-
-type CloudforceOneRequestTypesResponseEnvelope struct {
- Errors []CloudforceOneRequestTypesResponseEnvelopeErrors `json:"errors,required"`
- Messages []CloudforceOneRequestTypesResponseEnvelopeMessages `json:"messages,required"`
- Result []string `json:"result,required"`
- // Whether the API call was successful
- Success CloudforceOneRequestTypesResponseEnvelopeSuccess `json:"success,required"`
- JSON cloudforceOneRequestTypesResponseEnvelopeJSON `json:"-"`
-}
-
-// cloudforceOneRequestTypesResponseEnvelopeJSON contains the JSON metadata for the
-// struct [CloudforceOneRequestTypesResponseEnvelope]
-type cloudforceOneRequestTypesResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CloudforceOneRequestTypesResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cloudforceOneRequestTypesResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type CloudforceOneRequestTypesResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON cloudforceOneRequestTypesResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// cloudforceOneRequestTypesResponseEnvelopeErrorsJSON contains the JSON metadata
-// for the struct [CloudforceOneRequestTypesResponseEnvelopeErrors]
-type cloudforceOneRequestTypesResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CloudforceOneRequestTypesResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cloudforceOneRequestTypesResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type CloudforceOneRequestTypesResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON cloudforceOneRequestTypesResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// cloudforceOneRequestTypesResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [CloudforceOneRequestTypesResponseEnvelopeMessages]
-type cloudforceOneRequestTypesResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CloudforceOneRequestTypesResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cloudforceOneRequestTypesResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type CloudforceOneRequestTypesResponseEnvelopeSuccess bool
-
-const (
- CloudforceOneRequestTypesResponseEnvelopeSuccessTrue CloudforceOneRequestTypesResponseEnvelopeSuccess = true
-)
diff --git a/cloudforceonerequest_test.go b/cloudforceonerequest_test.go
deleted file mode 100644
index 5a6b29cf177..00000000000
--- a/cloudforceonerequest_test.go
+++ /dev/null
@@ -1,251 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
- "time"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestCloudforceOneRequestNewWithOptionalParams(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"),
- )
- _, err := client.CloudforceOne.Requests.New(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.CloudforceOneRequestNewParams{
- Content: cloudflare.F("What regions were most effected by the recent DoS?"),
- Priority: cloudflare.F("routine"),
- RequestType: cloudflare.F("Victomology"),
- Summary: cloudflare.F("DoS attack"),
- Tlp: cloudflare.F(cloudflare.CloudforceOneRequestNewParamsTlpClear),
- },
- )
- 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())
- }
-}
-
-func TestCloudforceOneRequestUpdateWithOptionalParams(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"),
- )
- _, err := client.CloudforceOne.Requests.Update(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- cloudflare.CloudforceOneRequestUpdateParams{
- Content: cloudflare.F("What regions were most effected by the recent DoS?"),
- Priority: cloudflare.F("routine"),
- RequestType: cloudflare.F("Victomology"),
- Summary: cloudflare.F("DoS attack"),
- Tlp: cloudflare.F(cloudflare.CloudforceOneRequestUpdateParamsTlpClear),
- },
- )
- 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())
- }
-}
-
-func TestCloudforceOneRequestListWithOptionalParams(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"),
- )
- _, err := client.CloudforceOne.Requests.List(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.CloudforceOneRequestListParams{
- Page: cloudflare.F(int64(0)),
- PerPage: cloudflare.F(int64(10)),
- CompletedAfter: cloudflare.F(time.Now()),
- CompletedBefore: cloudflare.F(time.Now()),
- CreatedAfter: cloudflare.F(time.Now()),
- CreatedBefore: cloudflare.F(time.Now()),
- RequestType: cloudflare.F("Victomology"),
- SortBy: cloudflare.F("created"),
- SortOrder: cloudflare.F(cloudflare.CloudforceOneRequestListParamsSortOrderAsc),
- Status: cloudflare.F(cloudflare.CloudforceOneRequestListParamsStatusOpen),
- },
- )
- 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())
- }
-}
-
-func TestCloudforceOneRequestDelete(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"),
- )
- _, err := client.CloudforceOne.Requests.Delete(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- )
- 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())
- }
-}
-
-func TestCloudforceOneRequestConstants(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"),
- )
- _, err := client.CloudforceOne.Requests.Constants(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353")
- 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())
- }
-}
-
-func TestCloudforceOneRequestGet(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"),
- )
- _, err := client.CloudforceOne.Requests.Get(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- )
- 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())
- }
-}
-
-func TestCloudforceOneRequestQuota(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"),
- )
- _, err := client.CloudforceOne.Requests.Quota(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353")
- 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())
- }
-}
-
-func TestCloudforceOneRequestTypes(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"),
- )
- _, err := client.CloudforceOne.Requests.Types(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353")
- 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/cloudforceonerequestmessage.go b/cloudforceonerequestmessage.go
deleted file mode 100644
index 1ed338776bc..00000000000
--- a/cloudforceonerequestmessage.go
+++ /dev/null
@@ -1,619 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "reflect"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/option"
- "github.com/tidwall/gjson"
-)
-
-// CloudforceOneRequestMessageService contains methods and other services that help
-// with interacting with the cloudflare API. Note, unlike clients, this service
-// does not read variables from the environment automatically. You should not
-// instantiate this service directly, and instead use the
-// [NewCloudforceOneRequestMessageService] method instead.
-type CloudforceOneRequestMessageService struct {
- Options []option.RequestOption
-}
-
-// NewCloudforceOneRequestMessageService generates a new service that applies the
-// given options to each request. These options are applied after the parent
-// client's options (if there is one), and before any request-specific options.
-func NewCloudforceOneRequestMessageService(opts ...option.RequestOption) (r *CloudforceOneRequestMessageService) {
- r = &CloudforceOneRequestMessageService{}
- r.Options = opts
- return
-}
-
-// Creating a request adds the request into the Cloudforce One queue for analysis.
-// In addition to the content, a short title, type, priority, and releasability
-// should be provided. If one is not provided a default will be assigned.
-func (r *CloudforceOneRequestMessageService) New(ctx context.Context, accountIdentifier string, requestIdentifier string, body CloudforceOneRequestMessageNewParams, opts ...option.RequestOption) (res *CloudforceOneRequestMessageNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env CloudforceOneRequestMessageNewResponseEnvelope
- path := fmt.Sprintf("accounts/%s/cloudforce-one/requests/%s/message/new", accountIdentifier, requestIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Update a Request Message
-func (r *CloudforceOneRequestMessageService) Update(ctx context.Context, accountIdentifier string, requestIdentifier string, messageIdentifer int64, body CloudforceOneRequestMessageUpdateParams, opts ...option.RequestOption) (res *CloudforceOneRequestMessageUpdateResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env CloudforceOneRequestMessageUpdateResponseEnvelope
- path := fmt.Sprintf("accounts/%s/cloudforce-one/requests/%s/message/%v", accountIdentifier, requestIdentifier, messageIdentifer)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Delete a Request Message
-func (r *CloudforceOneRequestMessageService) Delete(ctx context.Context, accountIdentifier string, requestIdentifier string, messageIdentifer int64, opts ...option.RequestOption) (res *CloudforceOneRequestMessageDeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env CloudforceOneRequestMessageDeleteResponseEnvelope
- path := fmt.Sprintf("accounts/%s/cloudforce-one/requests/%s/message/%v", accountIdentifier, requestIdentifier, messageIdentifer)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// List Request Messages
-func (r *CloudforceOneRequestMessageService) Get(ctx context.Context, accountIdentifier string, requestIdentifier string, body CloudforceOneRequestMessageGetParams, opts ...option.RequestOption) (res *[]CloudforceOneRequestMessageGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env CloudforceOneRequestMessageGetResponseEnvelope
- path := fmt.Sprintf("accounts/%s/cloudforce-one/requests/%s/message", accountIdentifier, requestIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type CloudforceOneRequestMessageNewResponse struct {
- // Message ID
- ID int64 `json:"id,required"`
- // Author of message
- Author string `json:"author,required"`
- // Content of message
- Content string `json:"content,required"`
- // Message is a follow-on request
- IsFollowOnRequest bool `json:"is_follow_on_request,required"`
- // Message last updated time
- Updated time.Time `json:"updated,required" format:"date-time"`
- // Message creation time
- Created time.Time `json:"created" format:"date-time"`
- JSON cloudforceOneRequestMessageNewResponseJSON `json:"-"`
-}
-
-// cloudforceOneRequestMessageNewResponseJSON contains the JSON metadata for the
-// struct [CloudforceOneRequestMessageNewResponse]
-type cloudforceOneRequestMessageNewResponseJSON struct {
- ID apijson.Field
- Author apijson.Field
- Content apijson.Field
- IsFollowOnRequest apijson.Field
- Updated apijson.Field
- Created apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CloudforceOneRequestMessageNewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cloudforceOneRequestMessageNewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type CloudforceOneRequestMessageUpdateResponse struct {
- // Message ID
- ID int64 `json:"id,required"`
- // Author of message
- Author string `json:"author,required"`
- // Content of message
- Content string `json:"content,required"`
- // Message is a follow-on request
- IsFollowOnRequest bool `json:"is_follow_on_request,required"`
- // Message last updated time
- Updated time.Time `json:"updated,required" format:"date-time"`
- // Message creation time
- Created time.Time `json:"created" format:"date-time"`
- JSON cloudforceOneRequestMessageUpdateResponseJSON `json:"-"`
-}
-
-// cloudforceOneRequestMessageUpdateResponseJSON contains the JSON metadata for the
-// struct [CloudforceOneRequestMessageUpdateResponse]
-type cloudforceOneRequestMessageUpdateResponseJSON struct {
- ID apijson.Field
- Author apijson.Field
- Content apijson.Field
- IsFollowOnRequest apijson.Field
- Updated apijson.Field
- Created apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CloudforceOneRequestMessageUpdateResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cloudforceOneRequestMessageUpdateResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// Union satisfied by [CloudforceOneRequestMessageDeleteResponseUnknown],
-// [CloudforceOneRequestMessageDeleteResponseArray] or [shared.UnionString].
-type CloudforceOneRequestMessageDeleteResponse interface {
- ImplementsCloudforceOneRequestMessageDeleteResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*CloudforceOneRequestMessageDeleteResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(CloudforceOneRequestMessageDeleteResponseArray{}),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-type CloudforceOneRequestMessageDeleteResponseArray []interface{}
-
-func (r CloudforceOneRequestMessageDeleteResponseArray) ImplementsCloudforceOneRequestMessageDeleteResponse() {
-}
-
-type CloudforceOneRequestMessageGetResponse struct {
- // Message ID
- ID int64 `json:"id,required"`
- // Author of message
- Author string `json:"author,required"`
- // Content of message
- Content string `json:"content,required"`
- // Message is a follow-on request
- IsFollowOnRequest bool `json:"is_follow_on_request,required"`
- // Message last updated time
- Updated time.Time `json:"updated,required" format:"date-time"`
- // Message creation time
- Created time.Time `json:"created" format:"date-time"`
- JSON cloudforceOneRequestMessageGetResponseJSON `json:"-"`
-}
-
-// cloudforceOneRequestMessageGetResponseJSON contains the JSON metadata for the
-// struct [CloudforceOneRequestMessageGetResponse]
-type cloudforceOneRequestMessageGetResponseJSON struct {
- ID apijson.Field
- Author apijson.Field
- Content apijson.Field
- IsFollowOnRequest apijson.Field
- Updated apijson.Field
- Created apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CloudforceOneRequestMessageGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cloudforceOneRequestMessageGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type CloudforceOneRequestMessageNewParams struct {
- // Content of message
- Content param.Field[string] `json:"content"`
-}
-
-func (r CloudforceOneRequestMessageNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type CloudforceOneRequestMessageNewResponseEnvelope struct {
- Errors []CloudforceOneRequestMessageNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []CloudforceOneRequestMessageNewResponseEnvelopeMessages `json:"messages,required"`
- Result CloudforceOneRequestMessageNewResponse `json:"result,required"`
- // Whether the API call was successful
- Success CloudforceOneRequestMessageNewResponseEnvelopeSuccess `json:"success,required"`
- JSON cloudforceOneRequestMessageNewResponseEnvelopeJSON `json:"-"`
-}
-
-// cloudforceOneRequestMessageNewResponseEnvelopeJSON contains the JSON metadata
-// for the struct [CloudforceOneRequestMessageNewResponseEnvelope]
-type cloudforceOneRequestMessageNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CloudforceOneRequestMessageNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cloudforceOneRequestMessageNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type CloudforceOneRequestMessageNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON cloudforceOneRequestMessageNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// cloudforceOneRequestMessageNewResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct [CloudforceOneRequestMessageNewResponseEnvelopeErrors]
-type cloudforceOneRequestMessageNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CloudforceOneRequestMessageNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cloudforceOneRequestMessageNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type CloudforceOneRequestMessageNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON cloudforceOneRequestMessageNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// cloudforceOneRequestMessageNewResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct [CloudforceOneRequestMessageNewResponseEnvelopeMessages]
-type cloudforceOneRequestMessageNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CloudforceOneRequestMessageNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cloudforceOneRequestMessageNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type CloudforceOneRequestMessageNewResponseEnvelopeSuccess bool
-
-const (
- CloudforceOneRequestMessageNewResponseEnvelopeSuccessTrue CloudforceOneRequestMessageNewResponseEnvelopeSuccess = true
-)
-
-type CloudforceOneRequestMessageUpdateParams struct {
- // Request content
- Content param.Field[string] `json:"content"`
- // Priority for analyzing the request
- Priority param.Field[string] `json:"priority"`
- // Requested information from request
- RequestType param.Field[string] `json:"request_type"`
- // Brief description of the request
- Summary param.Field[string] `json:"summary"`
- // The CISA defined Traffic Light Protocol (TLP)
- Tlp param.Field[CloudforceOneRequestMessageUpdateParamsTlp] `json:"tlp"`
-}
-
-func (r CloudforceOneRequestMessageUpdateParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The CISA defined Traffic Light Protocol (TLP)
-type CloudforceOneRequestMessageUpdateParamsTlp string
-
-const (
- CloudforceOneRequestMessageUpdateParamsTlpClear CloudforceOneRequestMessageUpdateParamsTlp = "clear"
- CloudforceOneRequestMessageUpdateParamsTlpAmber CloudforceOneRequestMessageUpdateParamsTlp = "amber"
- CloudforceOneRequestMessageUpdateParamsTlpAmberStrict CloudforceOneRequestMessageUpdateParamsTlp = "amber-strict"
- CloudforceOneRequestMessageUpdateParamsTlpGreen CloudforceOneRequestMessageUpdateParamsTlp = "green"
- CloudforceOneRequestMessageUpdateParamsTlpRed CloudforceOneRequestMessageUpdateParamsTlp = "red"
-)
-
-type CloudforceOneRequestMessageUpdateResponseEnvelope struct {
- Errors []CloudforceOneRequestMessageUpdateResponseEnvelopeErrors `json:"errors,required"`
- Messages []CloudforceOneRequestMessageUpdateResponseEnvelopeMessages `json:"messages,required"`
- Result CloudforceOneRequestMessageUpdateResponse `json:"result,required"`
- // Whether the API call was successful
- Success CloudforceOneRequestMessageUpdateResponseEnvelopeSuccess `json:"success,required"`
- JSON cloudforceOneRequestMessageUpdateResponseEnvelopeJSON `json:"-"`
-}
-
-// cloudforceOneRequestMessageUpdateResponseEnvelopeJSON contains the JSON metadata
-// for the struct [CloudforceOneRequestMessageUpdateResponseEnvelope]
-type cloudforceOneRequestMessageUpdateResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CloudforceOneRequestMessageUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cloudforceOneRequestMessageUpdateResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type CloudforceOneRequestMessageUpdateResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON cloudforceOneRequestMessageUpdateResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// cloudforceOneRequestMessageUpdateResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct
-// [CloudforceOneRequestMessageUpdateResponseEnvelopeErrors]
-type cloudforceOneRequestMessageUpdateResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CloudforceOneRequestMessageUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cloudforceOneRequestMessageUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type CloudforceOneRequestMessageUpdateResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON cloudforceOneRequestMessageUpdateResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// cloudforceOneRequestMessageUpdateResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct
-// [CloudforceOneRequestMessageUpdateResponseEnvelopeMessages]
-type cloudforceOneRequestMessageUpdateResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CloudforceOneRequestMessageUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cloudforceOneRequestMessageUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type CloudforceOneRequestMessageUpdateResponseEnvelopeSuccess bool
-
-const (
- CloudforceOneRequestMessageUpdateResponseEnvelopeSuccessTrue CloudforceOneRequestMessageUpdateResponseEnvelopeSuccess = true
-)
-
-type CloudforceOneRequestMessageDeleteResponseEnvelope struct {
- Errors []CloudforceOneRequestMessageDeleteResponseEnvelopeErrors `json:"errors,required"`
- Messages []CloudforceOneRequestMessageDeleteResponseEnvelopeMessages `json:"messages,required"`
- Result CloudforceOneRequestMessageDeleteResponse `json:"result,required"`
- // Whether the API call was successful
- Success CloudforceOneRequestMessageDeleteResponseEnvelopeSuccess `json:"success,required"`
- JSON cloudforceOneRequestMessageDeleteResponseEnvelopeJSON `json:"-"`
-}
-
-// cloudforceOneRequestMessageDeleteResponseEnvelopeJSON contains the JSON metadata
-// for the struct [CloudforceOneRequestMessageDeleteResponseEnvelope]
-type cloudforceOneRequestMessageDeleteResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CloudforceOneRequestMessageDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cloudforceOneRequestMessageDeleteResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type CloudforceOneRequestMessageDeleteResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON cloudforceOneRequestMessageDeleteResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// cloudforceOneRequestMessageDeleteResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct
-// [CloudforceOneRequestMessageDeleteResponseEnvelopeErrors]
-type cloudforceOneRequestMessageDeleteResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CloudforceOneRequestMessageDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cloudforceOneRequestMessageDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type CloudforceOneRequestMessageDeleteResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON cloudforceOneRequestMessageDeleteResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// cloudforceOneRequestMessageDeleteResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct
-// [CloudforceOneRequestMessageDeleteResponseEnvelopeMessages]
-type cloudforceOneRequestMessageDeleteResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CloudforceOneRequestMessageDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cloudforceOneRequestMessageDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type CloudforceOneRequestMessageDeleteResponseEnvelopeSuccess bool
-
-const (
- CloudforceOneRequestMessageDeleteResponseEnvelopeSuccessTrue CloudforceOneRequestMessageDeleteResponseEnvelopeSuccess = true
-)
-
-type CloudforceOneRequestMessageGetParams struct {
- // Page number of results
- Page param.Field[int64] `json:"page,required"`
- // Number of results per page
- PerPage param.Field[int64] `json:"per_page,required"`
- // Retrieve messages created after this time
- After param.Field[time.Time] `json:"after" format:"date-time"`
- // Retrieve messages created before this time
- Before param.Field[time.Time] `json:"before" format:"date-time"`
- // Field to sort results by
- SortBy param.Field[string] `json:"sort_by"`
- // Sort order (asc or desc)
- SortOrder param.Field[CloudforceOneRequestMessageGetParamsSortOrder] `json:"sort_order"`
-}
-
-func (r CloudforceOneRequestMessageGetParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Sort order (asc or desc)
-type CloudforceOneRequestMessageGetParamsSortOrder string
-
-const (
- CloudforceOneRequestMessageGetParamsSortOrderAsc CloudforceOneRequestMessageGetParamsSortOrder = "asc"
- CloudforceOneRequestMessageGetParamsSortOrderDesc CloudforceOneRequestMessageGetParamsSortOrder = "desc"
-)
-
-type CloudforceOneRequestMessageGetResponseEnvelope struct {
- Errors []CloudforceOneRequestMessageGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []CloudforceOneRequestMessageGetResponseEnvelopeMessages `json:"messages,required"`
- Result []CloudforceOneRequestMessageGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success CloudforceOneRequestMessageGetResponseEnvelopeSuccess `json:"success,required"`
- JSON cloudforceOneRequestMessageGetResponseEnvelopeJSON `json:"-"`
-}
-
-// cloudforceOneRequestMessageGetResponseEnvelopeJSON contains the JSON metadata
-// for the struct [CloudforceOneRequestMessageGetResponseEnvelope]
-type cloudforceOneRequestMessageGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CloudforceOneRequestMessageGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cloudforceOneRequestMessageGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type CloudforceOneRequestMessageGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON cloudforceOneRequestMessageGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// cloudforceOneRequestMessageGetResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct [CloudforceOneRequestMessageGetResponseEnvelopeErrors]
-type cloudforceOneRequestMessageGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CloudforceOneRequestMessageGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cloudforceOneRequestMessageGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type CloudforceOneRequestMessageGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON cloudforceOneRequestMessageGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// cloudforceOneRequestMessageGetResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct [CloudforceOneRequestMessageGetResponseEnvelopeMessages]
-type cloudforceOneRequestMessageGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CloudforceOneRequestMessageGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cloudforceOneRequestMessageGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type CloudforceOneRequestMessageGetResponseEnvelopeSuccess bool
-
-const (
- CloudforceOneRequestMessageGetResponseEnvelopeSuccessTrue CloudforceOneRequestMessageGetResponseEnvelopeSuccess = true
-)
diff --git a/cloudforceonerequestmessage_test.go b/cloudforceonerequestmessage_test.go
deleted file mode 100644
index 9e55de90185..00000000000
--- a/cloudforceonerequestmessage_test.go
+++ /dev/null
@@ -1,147 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
- "time"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestCloudforceOneRequestMessageNewWithOptionalParams(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"),
- )
- _, err := client.CloudforceOne.Requests.Message.New(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- cloudflare.CloudforceOneRequestMessageNewParams{
- Content: cloudflare.F("Can you elaborate on the type of DoS that occurred?"),
- },
- )
- 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())
- }
-}
-
-func TestCloudforceOneRequestMessageUpdateWithOptionalParams(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"),
- )
- _, err := client.CloudforceOne.Requests.Message.Update(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- int64(0),
- cloudflare.CloudforceOneRequestMessageUpdateParams{
- Content: cloudflare.F("What regions were most effected by the recent DoS?"),
- Priority: cloudflare.F("routine"),
- RequestType: cloudflare.F("Victomology"),
- Summary: cloudflare.F("DoS attack"),
- Tlp: cloudflare.F(cloudflare.CloudforceOneRequestMessageUpdateParamsTlpClear),
- },
- )
- 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())
- }
-}
-
-func TestCloudforceOneRequestMessageDelete(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"),
- )
- _, err := client.CloudforceOne.Requests.Message.Delete(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- int64(0),
- )
- 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())
- }
-}
-
-func TestCloudforceOneRequestMessageGetWithOptionalParams(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"),
- )
- _, err := client.CloudforceOne.Requests.Message.Get(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- cloudflare.CloudforceOneRequestMessageGetParams{
- Page: cloudflare.F(int64(0)),
- PerPage: cloudflare.F(int64(10)),
- After: cloudflare.F(time.Now()),
- Before: cloudflare.F(time.Now()),
- SortBy: cloudflare.F("created"),
- SortOrder: cloudflare.F(cloudflare.CloudforceOneRequestMessageGetParamsSortOrderAsc),
- },
- )
- 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/cloudforceonerequestpriority.go b/cloudforceonerequestpriority.go
deleted file mode 100644
index b2001a761ac..00000000000
--- a/cloudforceonerequestpriority.go
+++ /dev/null
@@ -1,828 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "reflect"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/option"
- "github.com/tidwall/gjson"
-)
-
-// CloudforceOneRequestPriorityService contains methods and other services that
-// help with interacting with the cloudflare API. Note, unlike clients, this
-// service does not read variables from the environment automatically. You should
-// not instantiate this service directly, and instead use the
-// [NewCloudforceOneRequestPriorityService] method instead.
-type CloudforceOneRequestPriorityService struct {
- Options []option.RequestOption
-}
-
-// NewCloudforceOneRequestPriorityService generates a new service that applies the
-// given options to each request. These options are applied after the parent
-// client's options (if there is one), and before any request-specific options.
-func NewCloudforceOneRequestPriorityService(opts ...option.RequestOption) (r *CloudforceOneRequestPriorityService) {
- r = &CloudforceOneRequestPriorityService{}
- r.Options = opts
- return
-}
-
-// Create a New Priority Requirement
-func (r *CloudforceOneRequestPriorityService) New(ctx context.Context, accountIdentifier string, body CloudforceOneRequestPriorityNewParams, opts ...option.RequestOption) (res *CloudforceOneRequestPriorityNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env CloudforceOneRequestPriorityNewResponseEnvelope
- path := fmt.Sprintf("accounts/%s/cloudforce-one/requests/priority/new", accountIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Update a Priority Intelligence Requirement
-func (r *CloudforceOneRequestPriorityService) Update(ctx context.Context, accountIdentifier string, priorityIdentifer string, body CloudforceOneRequestPriorityUpdateParams, opts ...option.RequestOption) (res *CloudforceOneRequestPriorityUpdateResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env CloudforceOneRequestPriorityUpdateResponseEnvelope
- path := fmt.Sprintf("accounts/%s/cloudforce-one/requests/priority/%s", accountIdentifier, priorityIdentifer)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Delete a Priority Intelligence Report
-func (r *CloudforceOneRequestPriorityService) Delete(ctx context.Context, accountIdentifier string, priorityIdentifer string, opts ...option.RequestOption) (res *CloudforceOneRequestPriorityDeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env CloudforceOneRequestPriorityDeleteResponseEnvelope
- path := fmt.Sprintf("accounts/%s/cloudforce-one/requests/priority/%s", accountIdentifier, priorityIdentifer)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Get a Priority Intelligence Requirement
-func (r *CloudforceOneRequestPriorityService) Get(ctx context.Context, accountIdentifier string, priorityIdentifer string, opts ...option.RequestOption) (res *CloudforceOneRequestPriorityGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env CloudforceOneRequestPriorityGetResponseEnvelope
- path := fmt.Sprintf("accounts/%s/cloudforce-one/requests/priority/%s", accountIdentifier, priorityIdentifer)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Get Priority Intelligence Requirement Quota
-func (r *CloudforceOneRequestPriorityService) Quota(ctx context.Context, accountIdentifier string, opts ...option.RequestOption) (res *CloudforceOneRequestPriorityQuotaResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env CloudforceOneRequestPriorityQuotaResponseEnvelope
- path := fmt.Sprintf("accounts/%s/cloudforce-one/requests/priority/quota", accountIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type CloudforceOneRequestPriorityNewResponse struct {
- // UUID
- ID string `json:"id,required"`
- // Priority creation time
- Created time.Time `json:"created,required" format:"date-time"`
- // List of labels
- Labels []string `json:"labels,required"`
- // Priority
- Priority int64 `json:"priority,required"`
- // Requirement
- Requirement string `json:"requirement,required"`
- // The CISA defined Traffic Light Protocol (TLP)
- Tlp CloudforceOneRequestPriorityNewResponseTlp `json:"tlp,required"`
- // Priority last updated time
- Updated time.Time `json:"updated,required" format:"date-time"`
- JSON cloudforceOneRequestPriorityNewResponseJSON `json:"-"`
-}
-
-// cloudforceOneRequestPriorityNewResponseJSON contains the JSON metadata for the
-// struct [CloudforceOneRequestPriorityNewResponse]
-type cloudforceOneRequestPriorityNewResponseJSON struct {
- ID apijson.Field
- Created apijson.Field
- Labels apijson.Field
- Priority apijson.Field
- Requirement apijson.Field
- Tlp apijson.Field
- Updated apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CloudforceOneRequestPriorityNewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cloudforceOneRequestPriorityNewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// The CISA defined Traffic Light Protocol (TLP)
-type CloudforceOneRequestPriorityNewResponseTlp string
-
-const (
- CloudforceOneRequestPriorityNewResponseTlpClear CloudforceOneRequestPriorityNewResponseTlp = "clear"
- CloudforceOneRequestPriorityNewResponseTlpAmber CloudforceOneRequestPriorityNewResponseTlp = "amber"
- CloudforceOneRequestPriorityNewResponseTlpAmberStrict CloudforceOneRequestPriorityNewResponseTlp = "amber-strict"
- CloudforceOneRequestPriorityNewResponseTlpGreen CloudforceOneRequestPriorityNewResponseTlp = "green"
- CloudforceOneRequestPriorityNewResponseTlpRed CloudforceOneRequestPriorityNewResponseTlp = "red"
-)
-
-type CloudforceOneRequestPriorityUpdateResponse struct {
- // UUID
- ID string `json:"id,required"`
- // Request content
- Content string `json:"content,required"`
- Created time.Time `json:"created,required" format:"date-time"`
- Priority time.Time `json:"priority,required" format:"date-time"`
- // Requested information from request
- Request string `json:"request,required"`
- // Brief description of the request
- Summary string `json:"summary,required"`
- // The CISA defined Traffic Light Protocol (TLP)
- Tlp CloudforceOneRequestPriorityUpdateResponseTlp `json:"tlp,required"`
- Updated time.Time `json:"updated,required" format:"date-time"`
- Completed time.Time `json:"completed" format:"date-time"`
- // Tokens for the request messages
- MessageTokens int64 `json:"message_tokens"`
- // Readable Request ID
- ReadableID string `json:"readable_id"`
- // Request Status
- Status CloudforceOneRequestPriorityUpdateResponseStatus `json:"status"`
- // Tokens for the request
- Tokens int64 `json:"tokens"`
- JSON cloudforceOneRequestPriorityUpdateResponseJSON `json:"-"`
-}
-
-// cloudforceOneRequestPriorityUpdateResponseJSON contains the JSON metadata for
-// the struct [CloudforceOneRequestPriorityUpdateResponse]
-type cloudforceOneRequestPriorityUpdateResponseJSON struct {
- ID apijson.Field
- Content apijson.Field
- Created apijson.Field
- Priority apijson.Field
- Request apijson.Field
- Summary apijson.Field
- Tlp apijson.Field
- Updated apijson.Field
- Completed apijson.Field
- MessageTokens apijson.Field
- ReadableID apijson.Field
- Status apijson.Field
- Tokens apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CloudforceOneRequestPriorityUpdateResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cloudforceOneRequestPriorityUpdateResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// The CISA defined Traffic Light Protocol (TLP)
-type CloudforceOneRequestPriorityUpdateResponseTlp string
-
-const (
- CloudforceOneRequestPriorityUpdateResponseTlpClear CloudforceOneRequestPriorityUpdateResponseTlp = "clear"
- CloudforceOneRequestPriorityUpdateResponseTlpAmber CloudforceOneRequestPriorityUpdateResponseTlp = "amber"
- CloudforceOneRequestPriorityUpdateResponseTlpAmberStrict CloudforceOneRequestPriorityUpdateResponseTlp = "amber-strict"
- CloudforceOneRequestPriorityUpdateResponseTlpGreen CloudforceOneRequestPriorityUpdateResponseTlp = "green"
- CloudforceOneRequestPriorityUpdateResponseTlpRed CloudforceOneRequestPriorityUpdateResponseTlp = "red"
-)
-
-// Request Status
-type CloudforceOneRequestPriorityUpdateResponseStatus string
-
-const (
- CloudforceOneRequestPriorityUpdateResponseStatusOpen CloudforceOneRequestPriorityUpdateResponseStatus = "open"
- CloudforceOneRequestPriorityUpdateResponseStatusAccepted CloudforceOneRequestPriorityUpdateResponseStatus = "accepted"
- CloudforceOneRequestPriorityUpdateResponseStatusReported CloudforceOneRequestPriorityUpdateResponseStatus = "reported"
- CloudforceOneRequestPriorityUpdateResponseStatusApproved CloudforceOneRequestPriorityUpdateResponseStatus = "approved"
- CloudforceOneRequestPriorityUpdateResponseStatusCompleted CloudforceOneRequestPriorityUpdateResponseStatus = "completed"
- CloudforceOneRequestPriorityUpdateResponseStatusDeclined CloudforceOneRequestPriorityUpdateResponseStatus = "declined"
-)
-
-// Union satisfied by [CloudforceOneRequestPriorityDeleteResponseUnknown],
-// [CloudforceOneRequestPriorityDeleteResponseArray] or [shared.UnionString].
-type CloudforceOneRequestPriorityDeleteResponse interface {
- ImplementsCloudforceOneRequestPriorityDeleteResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*CloudforceOneRequestPriorityDeleteResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(CloudforceOneRequestPriorityDeleteResponseArray{}),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-type CloudforceOneRequestPriorityDeleteResponseArray []interface{}
-
-func (r CloudforceOneRequestPriorityDeleteResponseArray) ImplementsCloudforceOneRequestPriorityDeleteResponse() {
-}
-
-type CloudforceOneRequestPriorityGetResponse struct {
- // UUID
- ID string `json:"id,required"`
- // Request content
- Content string `json:"content,required"`
- Created time.Time `json:"created,required" format:"date-time"`
- Priority time.Time `json:"priority,required" format:"date-time"`
- // Requested information from request
- Request string `json:"request,required"`
- // Brief description of the request
- Summary string `json:"summary,required"`
- // The CISA defined Traffic Light Protocol (TLP)
- Tlp CloudforceOneRequestPriorityGetResponseTlp `json:"tlp,required"`
- Updated time.Time `json:"updated,required" format:"date-time"`
- Completed time.Time `json:"completed" format:"date-time"`
- // Tokens for the request messages
- MessageTokens int64 `json:"message_tokens"`
- // Readable Request ID
- ReadableID string `json:"readable_id"`
- // Request Status
- Status CloudforceOneRequestPriorityGetResponseStatus `json:"status"`
- // Tokens for the request
- Tokens int64 `json:"tokens"`
- JSON cloudforceOneRequestPriorityGetResponseJSON `json:"-"`
-}
-
-// cloudforceOneRequestPriorityGetResponseJSON contains the JSON metadata for the
-// struct [CloudforceOneRequestPriorityGetResponse]
-type cloudforceOneRequestPriorityGetResponseJSON struct {
- ID apijson.Field
- Content apijson.Field
- Created apijson.Field
- Priority apijson.Field
- Request apijson.Field
- Summary apijson.Field
- Tlp apijson.Field
- Updated apijson.Field
- Completed apijson.Field
- MessageTokens apijson.Field
- ReadableID apijson.Field
- Status apijson.Field
- Tokens apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CloudforceOneRequestPriorityGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cloudforceOneRequestPriorityGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// The CISA defined Traffic Light Protocol (TLP)
-type CloudforceOneRequestPriorityGetResponseTlp string
-
-const (
- CloudforceOneRequestPriorityGetResponseTlpClear CloudforceOneRequestPriorityGetResponseTlp = "clear"
- CloudforceOneRequestPriorityGetResponseTlpAmber CloudforceOneRequestPriorityGetResponseTlp = "amber"
- CloudforceOneRequestPriorityGetResponseTlpAmberStrict CloudforceOneRequestPriorityGetResponseTlp = "amber-strict"
- CloudforceOneRequestPriorityGetResponseTlpGreen CloudforceOneRequestPriorityGetResponseTlp = "green"
- CloudforceOneRequestPriorityGetResponseTlpRed CloudforceOneRequestPriorityGetResponseTlp = "red"
-)
-
-// Request Status
-type CloudforceOneRequestPriorityGetResponseStatus string
-
-const (
- CloudforceOneRequestPriorityGetResponseStatusOpen CloudforceOneRequestPriorityGetResponseStatus = "open"
- CloudforceOneRequestPriorityGetResponseStatusAccepted CloudforceOneRequestPriorityGetResponseStatus = "accepted"
- CloudforceOneRequestPriorityGetResponseStatusReported CloudforceOneRequestPriorityGetResponseStatus = "reported"
- CloudforceOneRequestPriorityGetResponseStatusApproved CloudforceOneRequestPriorityGetResponseStatus = "approved"
- CloudforceOneRequestPriorityGetResponseStatusCompleted CloudforceOneRequestPriorityGetResponseStatus = "completed"
- CloudforceOneRequestPriorityGetResponseStatusDeclined CloudforceOneRequestPriorityGetResponseStatus = "declined"
-)
-
-type CloudforceOneRequestPriorityQuotaResponse struct {
- // Anniversary date is when annual quota limit is refresh
- AnniversaryDate time.Time `json:"anniversary_date" format:"date-time"`
- // Quater anniversary date is when quota limit is refreshed each quarter
- QuarterAnniversaryDate time.Time `json:"quarter_anniversary_date" format:"date-time"`
- // Tokens for the quarter
- Quota int64 `json:"quota"`
- // Tokens remaining for the quarter
- Remaining int64 `json:"remaining"`
- JSON cloudforceOneRequestPriorityQuotaResponseJSON `json:"-"`
-}
-
-// cloudforceOneRequestPriorityQuotaResponseJSON contains the JSON metadata for the
-// struct [CloudforceOneRequestPriorityQuotaResponse]
-type cloudforceOneRequestPriorityQuotaResponseJSON struct {
- AnniversaryDate apijson.Field
- QuarterAnniversaryDate apijson.Field
- Quota apijson.Field
- Remaining apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CloudforceOneRequestPriorityQuotaResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cloudforceOneRequestPriorityQuotaResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type CloudforceOneRequestPriorityNewParams struct {
- // List of labels
- Labels param.Field[[]string] `json:"labels,required"`
- // Priority
- Priority param.Field[int64] `json:"priority,required"`
- // Requirement
- Requirement param.Field[string] `json:"requirement,required"`
- // The CISA defined Traffic Light Protocol (TLP)
- Tlp param.Field[CloudforceOneRequestPriorityNewParamsTlp] `json:"tlp,required"`
-}
-
-func (r CloudforceOneRequestPriorityNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The CISA defined Traffic Light Protocol (TLP)
-type CloudforceOneRequestPriorityNewParamsTlp string
-
-const (
- CloudforceOneRequestPriorityNewParamsTlpClear CloudforceOneRequestPriorityNewParamsTlp = "clear"
- CloudforceOneRequestPriorityNewParamsTlpAmber CloudforceOneRequestPriorityNewParamsTlp = "amber"
- CloudforceOneRequestPriorityNewParamsTlpAmberStrict CloudforceOneRequestPriorityNewParamsTlp = "amber-strict"
- CloudforceOneRequestPriorityNewParamsTlpGreen CloudforceOneRequestPriorityNewParamsTlp = "green"
- CloudforceOneRequestPriorityNewParamsTlpRed CloudforceOneRequestPriorityNewParamsTlp = "red"
-)
-
-type CloudforceOneRequestPriorityNewResponseEnvelope struct {
- Errors []CloudforceOneRequestPriorityNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []CloudforceOneRequestPriorityNewResponseEnvelopeMessages `json:"messages,required"`
- Result CloudforceOneRequestPriorityNewResponse `json:"result,required"`
- // Whether the API call was successful
- Success CloudforceOneRequestPriorityNewResponseEnvelopeSuccess `json:"success,required"`
- JSON cloudforceOneRequestPriorityNewResponseEnvelopeJSON `json:"-"`
-}
-
-// cloudforceOneRequestPriorityNewResponseEnvelopeJSON contains the JSON metadata
-// for the struct [CloudforceOneRequestPriorityNewResponseEnvelope]
-type cloudforceOneRequestPriorityNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CloudforceOneRequestPriorityNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cloudforceOneRequestPriorityNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type CloudforceOneRequestPriorityNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON cloudforceOneRequestPriorityNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// cloudforceOneRequestPriorityNewResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct [CloudforceOneRequestPriorityNewResponseEnvelopeErrors]
-type cloudforceOneRequestPriorityNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CloudforceOneRequestPriorityNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cloudforceOneRequestPriorityNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type CloudforceOneRequestPriorityNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON cloudforceOneRequestPriorityNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// cloudforceOneRequestPriorityNewResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct
-// [CloudforceOneRequestPriorityNewResponseEnvelopeMessages]
-type cloudforceOneRequestPriorityNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CloudforceOneRequestPriorityNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cloudforceOneRequestPriorityNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type CloudforceOneRequestPriorityNewResponseEnvelopeSuccess bool
-
-const (
- CloudforceOneRequestPriorityNewResponseEnvelopeSuccessTrue CloudforceOneRequestPriorityNewResponseEnvelopeSuccess = true
-)
-
-type CloudforceOneRequestPriorityUpdateParams struct {
- // List of labels
- Labels param.Field[[]string] `json:"labels,required"`
- // Priority
- Priority param.Field[int64] `json:"priority,required"`
- // Requirement
- Requirement param.Field[string] `json:"requirement,required"`
- // The CISA defined Traffic Light Protocol (TLP)
- Tlp param.Field[CloudforceOneRequestPriorityUpdateParamsTlp] `json:"tlp,required"`
-}
-
-func (r CloudforceOneRequestPriorityUpdateParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The CISA defined Traffic Light Protocol (TLP)
-type CloudforceOneRequestPriorityUpdateParamsTlp string
-
-const (
- CloudforceOneRequestPriorityUpdateParamsTlpClear CloudforceOneRequestPriorityUpdateParamsTlp = "clear"
- CloudforceOneRequestPriorityUpdateParamsTlpAmber CloudforceOneRequestPriorityUpdateParamsTlp = "amber"
- CloudforceOneRequestPriorityUpdateParamsTlpAmberStrict CloudforceOneRequestPriorityUpdateParamsTlp = "amber-strict"
- CloudforceOneRequestPriorityUpdateParamsTlpGreen CloudforceOneRequestPriorityUpdateParamsTlp = "green"
- CloudforceOneRequestPriorityUpdateParamsTlpRed CloudforceOneRequestPriorityUpdateParamsTlp = "red"
-)
-
-type CloudforceOneRequestPriorityUpdateResponseEnvelope struct {
- Errors []CloudforceOneRequestPriorityUpdateResponseEnvelopeErrors `json:"errors,required"`
- Messages []CloudforceOneRequestPriorityUpdateResponseEnvelopeMessages `json:"messages,required"`
- Result CloudforceOneRequestPriorityUpdateResponse `json:"result,required"`
- // Whether the API call was successful
- Success CloudforceOneRequestPriorityUpdateResponseEnvelopeSuccess `json:"success,required"`
- JSON cloudforceOneRequestPriorityUpdateResponseEnvelopeJSON `json:"-"`
-}
-
-// cloudforceOneRequestPriorityUpdateResponseEnvelopeJSON contains the JSON
-// metadata for the struct [CloudforceOneRequestPriorityUpdateResponseEnvelope]
-type cloudforceOneRequestPriorityUpdateResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CloudforceOneRequestPriorityUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cloudforceOneRequestPriorityUpdateResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type CloudforceOneRequestPriorityUpdateResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON cloudforceOneRequestPriorityUpdateResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// cloudforceOneRequestPriorityUpdateResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct
-// [CloudforceOneRequestPriorityUpdateResponseEnvelopeErrors]
-type cloudforceOneRequestPriorityUpdateResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CloudforceOneRequestPriorityUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cloudforceOneRequestPriorityUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type CloudforceOneRequestPriorityUpdateResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON cloudforceOneRequestPriorityUpdateResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// cloudforceOneRequestPriorityUpdateResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct
-// [CloudforceOneRequestPriorityUpdateResponseEnvelopeMessages]
-type cloudforceOneRequestPriorityUpdateResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CloudforceOneRequestPriorityUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cloudforceOneRequestPriorityUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type CloudforceOneRequestPriorityUpdateResponseEnvelopeSuccess bool
-
-const (
- CloudforceOneRequestPriorityUpdateResponseEnvelopeSuccessTrue CloudforceOneRequestPriorityUpdateResponseEnvelopeSuccess = true
-)
-
-type CloudforceOneRequestPriorityDeleteResponseEnvelope struct {
- Errors []CloudforceOneRequestPriorityDeleteResponseEnvelopeErrors `json:"errors,required"`
- Messages []CloudforceOneRequestPriorityDeleteResponseEnvelopeMessages `json:"messages,required"`
- Result CloudforceOneRequestPriorityDeleteResponse `json:"result,required"`
- // Whether the API call was successful
- Success CloudforceOneRequestPriorityDeleteResponseEnvelopeSuccess `json:"success,required"`
- JSON cloudforceOneRequestPriorityDeleteResponseEnvelopeJSON `json:"-"`
-}
-
-// cloudforceOneRequestPriorityDeleteResponseEnvelopeJSON contains the JSON
-// metadata for the struct [CloudforceOneRequestPriorityDeleteResponseEnvelope]
-type cloudforceOneRequestPriorityDeleteResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CloudforceOneRequestPriorityDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cloudforceOneRequestPriorityDeleteResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type CloudforceOneRequestPriorityDeleteResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON cloudforceOneRequestPriorityDeleteResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// cloudforceOneRequestPriorityDeleteResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct
-// [CloudforceOneRequestPriorityDeleteResponseEnvelopeErrors]
-type cloudforceOneRequestPriorityDeleteResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CloudforceOneRequestPriorityDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cloudforceOneRequestPriorityDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type CloudforceOneRequestPriorityDeleteResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON cloudforceOneRequestPriorityDeleteResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// cloudforceOneRequestPriorityDeleteResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct
-// [CloudforceOneRequestPriorityDeleteResponseEnvelopeMessages]
-type cloudforceOneRequestPriorityDeleteResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CloudforceOneRequestPriorityDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cloudforceOneRequestPriorityDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type CloudforceOneRequestPriorityDeleteResponseEnvelopeSuccess bool
-
-const (
- CloudforceOneRequestPriorityDeleteResponseEnvelopeSuccessTrue CloudforceOneRequestPriorityDeleteResponseEnvelopeSuccess = true
-)
-
-type CloudforceOneRequestPriorityGetResponseEnvelope struct {
- Errors []CloudforceOneRequestPriorityGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []CloudforceOneRequestPriorityGetResponseEnvelopeMessages `json:"messages,required"`
- Result CloudforceOneRequestPriorityGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success CloudforceOneRequestPriorityGetResponseEnvelopeSuccess `json:"success,required"`
- JSON cloudforceOneRequestPriorityGetResponseEnvelopeJSON `json:"-"`
-}
-
-// cloudforceOneRequestPriorityGetResponseEnvelopeJSON contains the JSON metadata
-// for the struct [CloudforceOneRequestPriorityGetResponseEnvelope]
-type cloudforceOneRequestPriorityGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CloudforceOneRequestPriorityGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cloudforceOneRequestPriorityGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type CloudforceOneRequestPriorityGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON cloudforceOneRequestPriorityGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// cloudforceOneRequestPriorityGetResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct [CloudforceOneRequestPriorityGetResponseEnvelopeErrors]
-type cloudforceOneRequestPriorityGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CloudforceOneRequestPriorityGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cloudforceOneRequestPriorityGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type CloudforceOneRequestPriorityGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON cloudforceOneRequestPriorityGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// cloudforceOneRequestPriorityGetResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct
-// [CloudforceOneRequestPriorityGetResponseEnvelopeMessages]
-type cloudforceOneRequestPriorityGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CloudforceOneRequestPriorityGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cloudforceOneRequestPriorityGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type CloudforceOneRequestPriorityGetResponseEnvelopeSuccess bool
-
-const (
- CloudforceOneRequestPriorityGetResponseEnvelopeSuccessTrue CloudforceOneRequestPriorityGetResponseEnvelopeSuccess = true
-)
-
-type CloudforceOneRequestPriorityQuotaResponseEnvelope struct {
- Errors []CloudforceOneRequestPriorityQuotaResponseEnvelopeErrors `json:"errors,required"`
- Messages []CloudforceOneRequestPriorityQuotaResponseEnvelopeMessages `json:"messages,required"`
- Result CloudforceOneRequestPriorityQuotaResponse `json:"result,required"`
- // Whether the API call was successful
- Success CloudforceOneRequestPriorityQuotaResponseEnvelopeSuccess `json:"success,required"`
- JSON cloudforceOneRequestPriorityQuotaResponseEnvelopeJSON `json:"-"`
-}
-
-// cloudforceOneRequestPriorityQuotaResponseEnvelopeJSON contains the JSON metadata
-// for the struct [CloudforceOneRequestPriorityQuotaResponseEnvelope]
-type cloudforceOneRequestPriorityQuotaResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CloudforceOneRequestPriorityQuotaResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cloudforceOneRequestPriorityQuotaResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type CloudforceOneRequestPriorityQuotaResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON cloudforceOneRequestPriorityQuotaResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// cloudforceOneRequestPriorityQuotaResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct
-// [CloudforceOneRequestPriorityQuotaResponseEnvelopeErrors]
-type cloudforceOneRequestPriorityQuotaResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CloudforceOneRequestPriorityQuotaResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cloudforceOneRequestPriorityQuotaResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type CloudforceOneRequestPriorityQuotaResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON cloudforceOneRequestPriorityQuotaResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// cloudforceOneRequestPriorityQuotaResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct
-// [CloudforceOneRequestPriorityQuotaResponseEnvelopeMessages]
-type cloudforceOneRequestPriorityQuotaResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CloudforceOneRequestPriorityQuotaResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r cloudforceOneRequestPriorityQuotaResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type CloudforceOneRequestPriorityQuotaResponseEnvelopeSuccess bool
-
-const (
- CloudforceOneRequestPriorityQuotaResponseEnvelopeSuccessTrue CloudforceOneRequestPriorityQuotaResponseEnvelopeSuccess = true
-)
diff --git a/cloudforceonerequestpriority_test.go b/cloudforceonerequestpriority_test.go
deleted file mode 100644
index 77a49c2d7bc..00000000000
--- a/cloudforceonerequestpriority_test.go
+++ /dev/null
@@ -1,161 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestCloudforceOneRequestPriorityNew(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"),
- )
- _, err := client.CloudforceOne.Requests.Priority.New(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.CloudforceOneRequestPriorityNewParams{
- Labels: cloudflare.F([]string{"DoS", "CVE"}),
- Priority: cloudflare.F(int64(1)),
- Requirement: cloudflare.F("DoS attacks carried out by CVEs"),
- Tlp: cloudflare.F(cloudflare.CloudforceOneRequestPriorityNewParamsTlpClear),
- },
- )
- 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())
- }
-}
-
-func TestCloudforceOneRequestPriorityUpdate(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"),
- )
- _, err := client.CloudforceOne.Requests.Priority.Update(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- cloudflare.CloudforceOneRequestPriorityUpdateParams{
- Labels: cloudflare.F([]string{"DoS", "CVE"}),
- Priority: cloudflare.F(int64(1)),
- Requirement: cloudflare.F("DoS attacks carried out by CVEs"),
- Tlp: cloudflare.F(cloudflare.CloudforceOneRequestPriorityUpdateParamsTlpClear),
- },
- )
- 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())
- }
-}
-
-func TestCloudforceOneRequestPriorityDelete(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"),
- )
- _, err := client.CloudforceOne.Requests.Priority.Delete(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- )
- 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())
- }
-}
-
-func TestCloudforceOneRequestPriorityGet(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"),
- )
- _, err := client.CloudforceOne.Requests.Priority.Get(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- )
- 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())
- }
-}
-
-func TestCloudforceOneRequestPriorityQuota(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"),
- )
- _, err := client.CloudforceOne.Requests.Priority.Quota(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353")
- 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/custom_certificates/aliases.go b/custom_certificates/aliases.go
new file mode 100644
index 00000000000..7eda3217bb7
--- /dev/null
+++ b/custom_certificates/aliases.go
@@ -0,0 +1,9 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package custom_certificates
+
+import (
+ "github.com/cloudflare/cloudflare-go/internal/apierror"
+)
+
+type Error = apierror.Error
diff --git a/customcertificate.go b/custom_certificates/customcertificate.go
similarity index 83%
rename from customcertificate.go
rename to custom_certificates/customcertificate.go
index e082658579d..689a774059e 100644
--- a/customcertificate.go
+++ b/custom_certificates/customcertificate.go
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package cloudflare
+package custom_certificates
import (
"context"
@@ -15,6 +15,7 @@ import (
"github.com/cloudflare/cloudflare-go/internal/param"
"github.com/cloudflare/cloudflare-go/internal/requestconfig"
"github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/keyless_certificates"
"github.com/cloudflare/cloudflare-go/option"
"github.com/tidwall/gjson"
)
@@ -26,7 +27,7 @@ import (
// instead.
type CustomCertificateService struct {
Options []option.RequestOption
- Prioritize *CustomCertificatePrioritizeService
+ Prioritize *PrioritizeService
}
// NewCustomCertificateService generates a new service that applies the given
@@ -35,7 +36,7 @@ type CustomCertificateService struct {
func NewCustomCertificateService(opts ...option.RequestOption) (r *CustomCertificateService) {
r = &CustomCertificateService{}
r.Options = opts
- r.Prioritize = NewCustomCertificatePrioritizeService(opts...)
+ r.Prioritize = NewPrioritizeService(opts...)
return
}
@@ -55,7 +56,7 @@ func (r *CustomCertificateService) New(ctx context.Context, params CustomCertifi
// List, search, and filter all of your custom SSL certificates. The higher
// priority will break ties across overlapping 'legacy_custom' certificates, but
// 'legacy_custom' certificates will always supercede 'sni_custom' certificates.
-func (r *CustomCertificateService) List(ctx context.Context, params CustomCertificateListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[CustomCertificateListResponse], err error) {
+func (r *CustomCertificateService) List(ctx context.Context, params CustomCertificateListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[TLSCertificatesAndHostnamesCustomCertificate], err error) {
var raw *http.Response
opts = append(r.Options, opts...)
opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
@@ -75,7 +76,7 @@ func (r *CustomCertificateService) List(ctx context.Context, params CustomCertif
// List, search, and filter all of your custom SSL certificates. The higher
// priority will break ties across overlapping 'legacy_custom' certificates, but
// 'legacy_custom' certificates will always supercede 'sni_custom' certificates.
-func (r *CustomCertificateService) ListAutoPaging(ctx context.Context, params CustomCertificateListParams, opts ...option.RequestOption) *shared.V4PagePaginationArrayAutoPager[CustomCertificateListResponse] {
+func (r *CustomCertificateService) ListAutoPaging(ctx context.Context, params CustomCertificateListParams, opts ...option.RequestOption) *shared.V4PagePaginationArrayAutoPager[TLSCertificatesAndHostnamesCustomCertificate] {
return shared.NewV4PagePaginationArrayAutoPager(r.List(ctx, params, opts...))
}
@@ -120,31 +121,14 @@ func (r *CustomCertificateService) Get(ctx context.Context, customCertificateID
return
}
-// Union satisfied by [CustomCertificateNewResponseUnknown] or
-// [shared.UnionString].
-type CustomCertificateNewResponse interface {
- ImplementsCustomCertificateNewResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*CustomCertificateNewResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-type CustomCertificateListResponse struct {
+type TLSCertificatesAndHostnamesCustomCertificate struct {
// Identifier
ID string `json:"id,required"`
// A ubiquitous bundle has the highest probability of being verified everywhere,
// even by clients using outdated or unusual trust stores. An optimal bundle uses
// the shortest chain and newest intermediates. And the force bundle verifies the
// chain, but does not otherwise modify it.
- BundleMethod CustomCertificateListResponseBundleMethod `json:"bundle_method,required"`
+ BundleMethod TLSCertificatesAndHostnamesCustomCertificateBundleMethod `json:"bundle_method,required"`
// When the certificate from the authority expires.
ExpiresOn time.Time `json:"expires_on,required" format:"date-time"`
Hosts []string `json:"hosts,required"`
@@ -160,7 +144,7 @@ type CustomCertificateListResponse struct {
// The type of hash used for the certificate.
Signature string `json:"signature,required"`
// Status of the zone's custom SSL.
- Status CustomCertificateListResponseStatus `json:"status,required"`
+ Status TLSCertificatesAndHostnamesCustomCertificateStatus `json:"status,required"`
// When the certificate was uploaded to Cloudflare.
UploadedOn time.Time `json:"uploaded_on,required" format:"date-time"`
// Identifier
@@ -172,8 +156,8 @@ type CustomCertificateListResponse struct {
// only to U.S. data centers, only to E.U. data centers, or only to highest
// security data centers. Default distribution is to all Cloudflare datacenters,
// for optimal performance.
- GeoRestrictions CustomCertificateListResponseGeoRestrictions `json:"geo_restrictions"`
- KeylessServer CustomCertificateListResponseKeylessServer `json:"keyless_server"`
+ GeoRestrictions TLSCertificatesAndHostnamesCustomCertificateGeoRestrictions `json:"geo_restrictions"`
+ KeylessServer keyless_certificates.TLSCertificatesAndHostnamesBase `json:"keyless_server"`
// Specify the policy that determines the region where your private key will be
// held locally. HTTPS connections to any excluded data center will still be fully
// encrypted, but will incur some latency while Keyless SSL is used to complete the
@@ -183,13 +167,13 @@ type CustomCertificateListResponse struct {
// can be chosen, such as 'country: IN', as well as 'region: EU' which refers to
// the EU region. If there are too few data centers satisfying the policy, it will
// be rejected.
- Policy string `json:"policy"`
- JSON customCertificateListResponseJSON `json:"-"`
+ Policy string `json:"policy"`
+ JSON tlsCertificatesAndHostnamesCustomCertificateJSON `json:"-"`
}
-// customCertificateListResponseJSON contains the JSON metadata for the struct
-// [CustomCertificateListResponse]
-type customCertificateListResponseJSON struct {
+// tlsCertificatesAndHostnamesCustomCertificateJSON contains the JSON metadata for
+// the struct [TLSCertificatesAndHostnamesCustomCertificate]
+type tlsCertificatesAndHostnamesCustomCertificateJSON struct {
ID apijson.Field
BundleMethod apijson.Field
ExpiresOn apijson.Field
@@ -208,11 +192,11 @@ type customCertificateListResponseJSON struct {
ExtraFields map[string]apijson.Field
}
-func (r *CustomCertificateListResponse) UnmarshalJSON(data []byte) (err error) {
+func (r *TLSCertificatesAndHostnamesCustomCertificate) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
-func (r customCertificateListResponseJSON) RawJSON() string {
+func (r tlsCertificatesAndHostnamesCustomCertificateJSON) RawJSON() string {
return r.raw
}
@@ -220,23 +204,23 @@ func (r customCertificateListResponseJSON) RawJSON() string {
// even by clients using outdated or unusual trust stores. An optimal bundle uses
// the shortest chain and newest intermediates. And the force bundle verifies the
// chain, but does not otherwise modify it.
-type CustomCertificateListResponseBundleMethod string
+type TLSCertificatesAndHostnamesCustomCertificateBundleMethod string
const (
- CustomCertificateListResponseBundleMethodUbiquitous CustomCertificateListResponseBundleMethod = "ubiquitous"
- CustomCertificateListResponseBundleMethodOptimal CustomCertificateListResponseBundleMethod = "optimal"
- CustomCertificateListResponseBundleMethodForce CustomCertificateListResponseBundleMethod = "force"
+ TLSCertificatesAndHostnamesCustomCertificateBundleMethodUbiquitous TLSCertificatesAndHostnamesCustomCertificateBundleMethod = "ubiquitous"
+ TLSCertificatesAndHostnamesCustomCertificateBundleMethodOptimal TLSCertificatesAndHostnamesCustomCertificateBundleMethod = "optimal"
+ TLSCertificatesAndHostnamesCustomCertificateBundleMethodForce TLSCertificatesAndHostnamesCustomCertificateBundleMethod = "force"
)
// Status of the zone's custom SSL.
-type CustomCertificateListResponseStatus string
+type TLSCertificatesAndHostnamesCustomCertificateStatus string
const (
- CustomCertificateListResponseStatusActive CustomCertificateListResponseStatus = "active"
- CustomCertificateListResponseStatusExpired CustomCertificateListResponseStatus = "expired"
- CustomCertificateListResponseStatusDeleted CustomCertificateListResponseStatus = "deleted"
- CustomCertificateListResponseStatusPending CustomCertificateListResponseStatus = "pending"
- CustomCertificateListResponseStatusInitializing CustomCertificateListResponseStatus = "initializing"
+ TLSCertificatesAndHostnamesCustomCertificateStatusActive TLSCertificatesAndHostnamesCustomCertificateStatus = "active"
+ TLSCertificatesAndHostnamesCustomCertificateStatusExpired TLSCertificatesAndHostnamesCustomCertificateStatus = "expired"
+ TLSCertificatesAndHostnamesCustomCertificateStatusDeleted TLSCertificatesAndHostnamesCustomCertificateStatus = "deleted"
+ TLSCertificatesAndHostnamesCustomCertificateStatusPending TLSCertificatesAndHostnamesCustomCertificateStatus = "pending"
+ TLSCertificatesAndHostnamesCustomCertificateStatusInitializing TLSCertificatesAndHostnamesCustomCertificateStatus = "initializing"
)
// Specify the region where your private key can be held locally for optimal TLS
@@ -246,118 +230,51 @@ const (
// only to U.S. data centers, only to E.U. data centers, or only to highest
// security data centers. Default distribution is to all Cloudflare datacenters,
// for optimal performance.
-type CustomCertificateListResponseGeoRestrictions struct {
- Label CustomCertificateListResponseGeoRestrictionsLabel `json:"label"`
- JSON customCertificateListResponseGeoRestrictionsJSON `json:"-"`
+type TLSCertificatesAndHostnamesCustomCertificateGeoRestrictions struct {
+ Label TLSCertificatesAndHostnamesCustomCertificateGeoRestrictionsLabel `json:"label"`
+ JSON tlsCertificatesAndHostnamesCustomCertificateGeoRestrictionsJSON `json:"-"`
}
-// customCertificateListResponseGeoRestrictionsJSON contains the JSON metadata for
-// the struct [CustomCertificateListResponseGeoRestrictions]
-type customCertificateListResponseGeoRestrictionsJSON struct {
+// tlsCertificatesAndHostnamesCustomCertificateGeoRestrictionsJSON contains the
+// JSON metadata for the struct
+// [TLSCertificatesAndHostnamesCustomCertificateGeoRestrictions]
+type tlsCertificatesAndHostnamesCustomCertificateGeoRestrictionsJSON struct {
Label apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
-func (r *CustomCertificateListResponseGeoRestrictions) UnmarshalJSON(data []byte) (err error) {
+func (r *TLSCertificatesAndHostnamesCustomCertificateGeoRestrictions) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
-func (r customCertificateListResponseGeoRestrictionsJSON) RawJSON() string {
+func (r tlsCertificatesAndHostnamesCustomCertificateGeoRestrictionsJSON) RawJSON() string {
return r.raw
}
-type CustomCertificateListResponseGeoRestrictionsLabel string
+type TLSCertificatesAndHostnamesCustomCertificateGeoRestrictionsLabel string
const (
- CustomCertificateListResponseGeoRestrictionsLabelUs CustomCertificateListResponseGeoRestrictionsLabel = "us"
- CustomCertificateListResponseGeoRestrictionsLabelEu CustomCertificateListResponseGeoRestrictionsLabel = "eu"
- CustomCertificateListResponseGeoRestrictionsLabelHighestSecurity CustomCertificateListResponseGeoRestrictionsLabel = "highest_security"
+ TLSCertificatesAndHostnamesCustomCertificateGeoRestrictionsLabelUs TLSCertificatesAndHostnamesCustomCertificateGeoRestrictionsLabel = "us"
+ TLSCertificatesAndHostnamesCustomCertificateGeoRestrictionsLabelEu TLSCertificatesAndHostnamesCustomCertificateGeoRestrictionsLabel = "eu"
+ TLSCertificatesAndHostnamesCustomCertificateGeoRestrictionsLabelHighestSecurity TLSCertificatesAndHostnamesCustomCertificateGeoRestrictionsLabel = "highest_security"
)
-type CustomCertificateListResponseKeylessServer struct {
- // Keyless certificate identifier tag.
- ID string `json:"id,required"`
- // When the Keyless SSL was created.
- CreatedOn time.Time `json:"created_on,required" format:"date-time"`
- // Whether or not the Keyless SSL is on or off.
- Enabled bool `json:"enabled,required"`
- // The keyless SSL name.
- Host string `json:"host,required" format:"hostname"`
- // When the Keyless SSL was last modified.
- ModifiedOn time.Time `json:"modified_on,required" format:"date-time"`
- // The keyless SSL name.
- Name string `json:"name,required"`
- // Available permissions for the Keyless SSL for the current user requesting the
- // item.
- Permissions []interface{} `json:"permissions,required"`
- // The keyless SSL port used to communicate between Cloudflare and the client's
- // Keyless SSL server.
- Port float64 `json:"port,required"`
- // Status of the Keyless SSL.
- Status CustomCertificateListResponseKeylessServerStatus `json:"status,required"`
- // Configuration for using Keyless SSL through a Cloudflare Tunnel
- Tunnel CustomCertificateListResponseKeylessServerTunnel `json:"tunnel"`
- JSON customCertificateListResponseKeylessServerJSON `json:"-"`
-}
-
-// customCertificateListResponseKeylessServerJSON contains the JSON metadata for
-// the struct [CustomCertificateListResponseKeylessServer]
-type customCertificateListResponseKeylessServerJSON struct {
- ID apijson.Field
- CreatedOn apijson.Field
- Enabled apijson.Field
- Host apijson.Field
- ModifiedOn apijson.Field
- Name apijson.Field
- Permissions apijson.Field
- Port apijson.Field
- Status apijson.Field
- Tunnel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CustomCertificateListResponseKeylessServer) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r customCertificateListResponseKeylessServerJSON) RawJSON() string {
- return r.raw
-}
-
-// Status of the Keyless SSL.
-type CustomCertificateListResponseKeylessServerStatus string
-
-const (
- CustomCertificateListResponseKeylessServerStatusActive CustomCertificateListResponseKeylessServerStatus = "active"
- CustomCertificateListResponseKeylessServerStatusDeleted CustomCertificateListResponseKeylessServerStatus = "deleted"
-)
-
-// Configuration for using Keyless SSL through a Cloudflare Tunnel
-type CustomCertificateListResponseKeylessServerTunnel struct {
- // Private IP of the Key Server Host
- PrivateIP string `json:"private_ip,required"`
- // Cloudflare Tunnel Virtual Network ID
- VnetID string `json:"vnet_id,required"`
- JSON customCertificateListResponseKeylessServerTunnelJSON `json:"-"`
-}
-
-// customCertificateListResponseKeylessServerTunnelJSON contains the JSON metadata
-// for the struct [CustomCertificateListResponseKeylessServerTunnel]
-type customCertificateListResponseKeylessServerTunnelJSON struct {
- PrivateIP apijson.Field
- VnetID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CustomCertificateListResponseKeylessServerTunnel) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
+// Union satisfied by [custom_certificates.CustomCertificateNewResponseUnknown] or
+// [shared.UnionString].
+type CustomCertificateNewResponse interface {
+ ImplementsCustomCertificatesCustomCertificateNewResponse()
}
-func (r customCertificateListResponseKeylessServerTunnelJSON) RawJSON() string {
- return r.raw
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*CustomCertificateNewResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
}
type CustomCertificateDeleteResponse struct {
@@ -382,10 +299,10 @@ func (r customCertificateDeleteResponseJSON) RawJSON() string {
return r.raw
}
-// Union satisfied by [CustomCertificateEditResponseUnknown] or
+// Union satisfied by [custom_certificates.CustomCertificateEditResponseUnknown] or
// [shared.UnionString].
type CustomCertificateEditResponse interface {
- ImplementsCustomCertificateEditResponse()
+ ImplementsCustomCertificatesCustomCertificateEditResponse()
}
func init() {
@@ -399,10 +316,10 @@ func init() {
)
}
-// Union satisfied by [CustomCertificateGetResponseUnknown] or
+// Union satisfied by [custom_certificates.CustomCertificateGetResponseUnknown] or
// [shared.UnionString].
type CustomCertificateGetResponse interface {
- ImplementsCustomCertificateGetResponse()
+ ImplementsCustomCertificatesCustomCertificateGetResponse()
}
func init() {
diff --git a/customcertificate_test.go b/custom_certificates/customcertificate_test.go
similarity index 89%
rename from customcertificate_test.go
rename to custom_certificates/customcertificate_test.go
index 3685d5868d1..2bd7333280d 100644
--- a/customcertificate_test.go
+++ b/custom_certificates/customcertificate_test.go
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package cloudflare_test
+package custom_certificates_test
import (
"context"
@@ -9,6 +9,7 @@ import (
"testing"
"github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/custom_certificates"
"github.com/cloudflare/cloudflare-go/internal/testutil"
"github.com/cloudflare/cloudflare-go/option"
)
@@ -27,16 +28,16 @@ func TestCustomCertificateNewWithOptionalParams(t *testing.T) {
option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"),
option.WithAPIEmail("user@example.com"),
)
- _, err := client.CustomCertificates.New(context.TODO(), cloudflare.CustomCertificateNewParams{
+ _, err := client.CustomCertificates.New(context.TODO(), custom_certificates.CustomCertificateNewParams{
ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
Certificate: cloudflare.F("-----BEGIN CERTIFICATE-----\nMIIDtTCCAp2gAwIBAgIJAMHAwfXZ5/PWMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV\nBAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX\naWRnaXRzIFB0eSBMdGQwHhcNMTYwODI0MTY0MzAxWhcNMTYxMTIyMTY0MzAxWjBF\nMQswCQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50\nZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB\nCgKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmGdtcGbg/1\nCGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKnabIRuGvB\nKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpidtnKX/a+5\n0GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+pyFxIXjbEI\ndZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pEewooaeO2\nizNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABo4GnMIGkMB0GA1UdDgQWBBT/LbE4\n9rWf288N6sJA5BRb6FJIGDB1BgNVHSMEbjBsgBT/LbE49rWf288N6sJA5BRb6FJI\nGKFJpEcwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNV\nBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAMHAwfXZ5/PWMAwGA1UdEwQF\nMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAHHFwl0tH0quUYZYO0dZYt4R7SJ0pCm2\n2satiyzHl4OnXcHDpekAo7/a09c6Lz6AU83cKy/+x3/djYHXWba7HpEu0dR3ugQP\nMlr4zrhd9xKZ0KZKiYmtJH+ak4OM4L3FbT0owUZPyjLSlhMtJVcoRp5CJsjAMBUG\nSvD8RX+T01wzox/Qb+lnnNnOlaWpqu8eoOenybxKp1a9ULzIVvN/LAcc+14vioFq\n2swRWtmocBAs8QR9n4uvbpiYvS8eYueDCWMM4fvFfBhaDZ3N9IbtySh3SpFdQDhw\nYbjM2rxXiyLGxB4Bol7QTv4zHif7Zt89FReT/NBy4rzaskDJY5L6xmY=\n-----END CERTIFICATE-----\n"),
PrivateKey: cloudflare.F("-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmG\ndtcGbg/1CGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKn\nabIRuGvBKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpid\ntnKX/a+50GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+py\nFxIXjbEIdZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pE\newooaeO2izNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABAoIBACbhTYXBZYKmYPCb\nHBR1IBlCQA2nLGf0qRuJNJZg5iEzXows/6tc8YymZkQE7nolapWsQ+upk2y5Xdp/\naxiuprIs9JzkYK8Ox0r+dlwCG1kSW+UAbX0bQ/qUqlsTvU6muVuMP8vZYHxJ3wmb\n+ufRBKztPTQ/rYWaYQcgC0RWI20HTFBMxlTAyNxYNWzX7RKFkGVVyB9RsAtmcc8g\n+j4OdosbfNoJPS0HeIfNpAznDfHKdxDk2Yc1tV6RHBrC1ynyLE9+TaflIAdo2MVv\nKLMLq51GqYKtgJFIlBRPQqKoyXdz3fGvXrTkf/WY9QNq0J1Vk5ERePZ54mN8iZB7\n9lwy/AkCgYEA6FXzosxswaJ2wQLeoYc7ceaweX/SwTvxHgXzRyJIIT0eJWgx13Wo\n/WA3Iziimsjf6qE+SI/8laxPp2A86VMaIt3Z3mJN/CqSVGw8LK2AQst+OwdPyDMu\niacE8lj/IFGC8mwNUAb9CzGU3JpU4PxxGFjS/eMtGeRXCWkK4NE+G08CgYEA1Kp9\nN2JrVlqUz+gAX+LPmE9OEMAS9WQSQsfCHGogIFDGGcNf7+uwBM7GAaSJIP01zcoe\nVAgWdzXCv3FLhsaZoJ6RyLOLay5phbu1iaTr4UNYm5WtYTzMzqh8l1+MFFDl9xDB\nvULuCIIrglM5MeS/qnSg1uMoH2oVPj9TVst/ir8CgYEAxrI7Ws9Zc4Bt70N1As+U\nlySjaEVZCMkqvHJ6TCuVZFfQoE0r0whdLdRLU2PsLFP+q7qaeZQqgBaNSKeVcDYR\n9B+nY/jOmQoPewPVsp/vQTCnE/R81spu0mp0YI6cIheT1Z9zAy322svcc43JaWB7\nmEbeqyLOP4Z4qSOcmghZBSECgYACvR9Xs0DGn+wCsW4vze/2ei77MD4OQvepPIFX\ndFZtlBy5ADcgE9z0cuVB6CiL8DbdK5kwY9pGNr8HUCI03iHkW6Zs+0L0YmihfEVe\nPG19PSzK9CaDdhD9KFZSbLyVFmWfxOt50H7YRTTiPMgjyFpfi5j2q348yVT0tEQS\nfhRqaQKBgAcWPokmJ7EbYQGeMbS7HC8eWO/RyamlnSffdCdSc7ue3zdVJxpAkQ8W\nqu80pEIF6raIQfAf8MXiiZ7auFOSnHQTXUbhCpvDLKi0Mwq3G8Pl07l+2s6dQG6T\nlv6XTQaMyf6n1yjzL+fzDrH3qXMxHMO/b13EePXpDMpY7HQpoLDi\n-----END RSA PRIVATE KEY-----\n"),
- BundleMethod: cloudflare.F(cloudflare.CustomCertificateNewParamsBundleMethodUbiquitous),
- GeoRestrictions: cloudflare.F(cloudflare.CustomCertificateNewParamsGeoRestrictions{
- Label: cloudflare.F(cloudflare.CustomCertificateNewParamsGeoRestrictionsLabelUs),
+ BundleMethod: cloudflare.F(custom_certificates.CustomCertificateNewParamsBundleMethodUbiquitous),
+ GeoRestrictions: cloudflare.F(custom_certificates.CustomCertificateNewParamsGeoRestrictions{
+ Label: cloudflare.F(custom_certificates.CustomCertificateNewParamsGeoRestrictionsLabelUs),
}),
Policy: cloudflare.F("(country: US) or (region: EU)"),
- Type: cloudflare.F(cloudflare.CustomCertificateNewParamsTypeSniCustom),
+ Type: cloudflare.F(custom_certificates.CustomCertificateNewParamsTypeSniCustom),
})
if err != nil {
var apierr *cloudflare.Error
@@ -61,9 +62,9 @@ func TestCustomCertificateListWithOptionalParams(t *testing.T) {
option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"),
option.WithAPIEmail("user@example.com"),
)
- _, err := client.CustomCertificates.List(context.TODO(), cloudflare.CustomCertificateListParams{
+ _, err := client.CustomCertificates.List(context.TODO(), custom_certificates.CustomCertificateListParams{
ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Match: cloudflare.F(cloudflare.CustomCertificateListParamsMatchAny),
+ Match: cloudflare.F(custom_certificates.CustomCertificateListParamsMatchAny),
Page: cloudflare.F(1.000000),
PerPage: cloudflare.F(5.000000),
})
@@ -93,7 +94,7 @@ func TestCustomCertificateDelete(t *testing.T) {
_, err := client.CustomCertificates.Delete(
context.TODO(),
"023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.CustomCertificateDeleteParams{
+ custom_certificates.CustomCertificateDeleteParams{
ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
},
)
@@ -123,12 +124,12 @@ func TestCustomCertificateEditWithOptionalParams(t *testing.T) {
_, err := client.CustomCertificates.Edit(
context.TODO(),
"023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.CustomCertificateEditParams{
+ custom_certificates.CustomCertificateEditParams{
ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- BundleMethod: cloudflare.F(cloudflare.CustomCertificateEditParamsBundleMethodUbiquitous),
+ BundleMethod: cloudflare.F(custom_certificates.CustomCertificateEditParamsBundleMethodUbiquitous),
Certificate: cloudflare.F("-----BEGIN CERTIFICATE-----\nMIIDtTCCAp2gAwIBAgIJAMHAwfXZ5/PWMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV\nBAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX\naWRnaXRzIFB0eSBMdGQwHhcNMTYwODI0MTY0MzAxWhcNMTYxMTIyMTY0MzAxWjBF\nMQswCQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50\nZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB\nCgKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmGdtcGbg/1\nCGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKnabIRuGvB\nKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpidtnKX/a+5\n0GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+pyFxIXjbEI\ndZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pEewooaeO2\nizNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABo4GnMIGkMB0GA1UdDgQWBBT/LbE4\n9rWf288N6sJA5BRb6FJIGDB1BgNVHSMEbjBsgBT/LbE49rWf288N6sJA5BRb6FJI\nGKFJpEcwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNV\nBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAMHAwfXZ5/PWMAwGA1UdEwQF\nMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAHHFwl0tH0quUYZYO0dZYt4R7SJ0pCm2\n2satiyzHl4OnXcHDpekAo7/a09c6Lz6AU83cKy/+x3/djYHXWba7HpEu0dR3ugQP\nMlr4zrhd9xKZ0KZKiYmtJH+ak4OM4L3FbT0owUZPyjLSlhMtJVcoRp5CJsjAMBUG\nSvD8RX+T01wzox/Qb+lnnNnOlaWpqu8eoOenybxKp1a9ULzIVvN/LAcc+14vioFq\n2swRWtmocBAs8QR9n4uvbpiYvS8eYueDCWMM4fvFfBhaDZ3N9IbtySh3SpFdQDhw\nYbjM2rxXiyLGxB4Bol7QTv4zHif7Zt89FReT/NBy4rzaskDJY5L6xmY=\n-----END CERTIFICATE-----\n"),
- GeoRestrictions: cloudflare.F(cloudflare.CustomCertificateEditParamsGeoRestrictions{
- Label: cloudflare.F(cloudflare.CustomCertificateEditParamsGeoRestrictionsLabelUs),
+ GeoRestrictions: cloudflare.F(custom_certificates.CustomCertificateEditParamsGeoRestrictions{
+ Label: cloudflare.F(custom_certificates.CustomCertificateEditParamsGeoRestrictionsLabelUs),
}),
Policy: cloudflare.F("(country: US) or (region: EU)"),
PrivateKey: cloudflare.F("-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmG\ndtcGbg/1CGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKn\nabIRuGvBKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpid\ntnKX/a+50GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+py\nFxIXjbEIdZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pE\newooaeO2izNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABAoIBACbhTYXBZYKmYPCb\nHBR1IBlCQA2nLGf0qRuJNJZg5iEzXows/6tc8YymZkQE7nolapWsQ+upk2y5Xdp/\naxiuprIs9JzkYK8Ox0r+dlwCG1kSW+UAbX0bQ/qUqlsTvU6muVuMP8vZYHxJ3wmb\n+ufRBKztPTQ/rYWaYQcgC0RWI20HTFBMxlTAyNxYNWzX7RKFkGVVyB9RsAtmcc8g\n+j4OdosbfNoJPS0HeIfNpAznDfHKdxDk2Yc1tV6RHBrC1ynyLE9+TaflIAdo2MVv\nKLMLq51GqYKtgJFIlBRPQqKoyXdz3fGvXrTkf/WY9QNq0J1Vk5ERePZ54mN8iZB7\n9lwy/AkCgYEA6FXzosxswaJ2wQLeoYc7ceaweX/SwTvxHgXzRyJIIT0eJWgx13Wo\n/WA3Iziimsjf6qE+SI/8laxPp2A86VMaIt3Z3mJN/CqSVGw8LK2AQst+OwdPyDMu\niacE8lj/IFGC8mwNUAb9CzGU3JpU4PxxGFjS/eMtGeRXCWkK4NE+G08CgYEA1Kp9\nN2JrVlqUz+gAX+LPmE9OEMAS9WQSQsfCHGogIFDGGcNf7+uwBM7GAaSJIP01zcoe\nVAgWdzXCv3FLhsaZoJ6RyLOLay5phbu1iaTr4UNYm5WtYTzMzqh8l1+MFFDl9xDB\nvULuCIIrglM5MeS/qnSg1uMoH2oVPj9TVst/ir8CgYEAxrI7Ws9Zc4Bt70N1As+U\nlySjaEVZCMkqvHJ6TCuVZFfQoE0r0whdLdRLU2PsLFP+q7qaeZQqgBaNSKeVcDYR\n9B+nY/jOmQoPewPVsp/vQTCnE/R81spu0mp0YI6cIheT1Z9zAy322svcc43JaWB7\nmEbeqyLOP4Z4qSOcmghZBSECgYACvR9Xs0DGn+wCsW4vze/2ei77MD4OQvepPIFX\ndFZtlBy5ADcgE9z0cuVB6CiL8DbdK5kwY9pGNr8HUCI03iHkW6Zs+0L0YmihfEVe\nPG19PSzK9CaDdhD9KFZSbLyVFmWfxOt50H7YRTTiPMgjyFpfi5j2q348yVT0tEQS\nfhRqaQKBgAcWPokmJ7EbYQGeMbS7HC8eWO/RyamlnSffdCdSc7ue3zdVJxpAkQ8W\nqu80pEIF6raIQfAf8MXiiZ7auFOSnHQTXUbhCpvDLKi0Mwq3G8Pl07l+2s6dQG6T\nlv6XTQaMyf6n1yjzL+fzDrH3qXMxHMO/b13EePXpDMpY7HQpoLDi\n-----END RSA PRIVATE KEY-----\n"),
@@ -160,7 +161,7 @@ func TestCustomCertificateGet(t *testing.T) {
_, err := client.CustomCertificates.Get(
context.TODO(),
"023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.CustomCertificateGetParams{
+ custom_certificates.CustomCertificateGetParams{
ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
},
)
diff --git a/custom_certificates/prioritize.go b/custom_certificates/prioritize.go
new file mode 100644
index 00000000000..85652da78cf
--- /dev/null
+++ b/custom_certificates/prioritize.go
@@ -0,0 +1,183 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package custom_certificates
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// PrioritizeService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewPrioritizeService] method instead.
+type PrioritizeService struct {
+ Options []option.RequestOption
+}
+
+// NewPrioritizeService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewPrioritizeService(opts ...option.RequestOption) (r *PrioritizeService) {
+ r = &PrioritizeService{}
+ r.Options = opts
+ return
+}
+
+// If a zone has multiple SSL certificates, you can set the order in which they
+// should be used during a request. The higher priority will break ties across
+// overlapping 'legacy_custom' certificates.
+func (r *PrioritizeService) Update(ctx context.Context, params PrioritizeUpdateParams, opts ...option.RequestOption) (res *[]TLSCertificatesAndHostnamesCustomCertificate, err error) {
+ opts = append(r.Options[:], opts...)
+ var env PrioritizeUpdateResponseEnvelope
+ path := fmt.Sprintf("zones/%s/custom_certificates/prioritize", params.ZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type PrioritizeUpdateParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+ // Array of ordered certificates.
+ Certificates param.Field[[]PrioritizeUpdateParamsCertificate] `json:"certificates,required"`
+}
+
+func (r PrioritizeUpdateParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type PrioritizeUpdateParamsCertificate struct {
+ // The order/priority in which the certificate will be used in a request. The
+ // higher priority will break ties across overlapping 'legacy_custom' certificates,
+ // but 'legacy_custom' certificates will always supercede 'sni_custom'
+ // certificates.
+ Priority param.Field[float64] `json:"priority"`
+}
+
+func (r PrioritizeUpdateParamsCertificate) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type PrioritizeUpdateResponseEnvelope struct {
+ Errors []PrioritizeUpdateResponseEnvelopeErrors `json:"errors,required"`
+ Messages []PrioritizeUpdateResponseEnvelopeMessages `json:"messages,required"`
+ Result []TLSCertificatesAndHostnamesCustomCertificate `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success PrioritizeUpdateResponseEnvelopeSuccess `json:"success,required"`
+ ResultInfo PrioritizeUpdateResponseEnvelopeResultInfo `json:"result_info"`
+ JSON prioritizeUpdateResponseEnvelopeJSON `json:"-"`
+}
+
+// prioritizeUpdateResponseEnvelopeJSON contains the JSON metadata for the struct
+// [PrioritizeUpdateResponseEnvelope]
+type prioritizeUpdateResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ ResultInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PrioritizeUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r prioritizeUpdateResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type PrioritizeUpdateResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON prioritizeUpdateResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// prioritizeUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [PrioritizeUpdateResponseEnvelopeErrors]
+type prioritizeUpdateResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PrioritizeUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r prioritizeUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type PrioritizeUpdateResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON prioritizeUpdateResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// prioritizeUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [PrioritizeUpdateResponseEnvelopeMessages]
+type prioritizeUpdateResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PrioritizeUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r prioritizeUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type PrioritizeUpdateResponseEnvelopeSuccess bool
+
+const (
+ PrioritizeUpdateResponseEnvelopeSuccessTrue PrioritizeUpdateResponseEnvelopeSuccess = true
+)
+
+type PrioritizeUpdateResponseEnvelopeResultInfo struct {
+ // Total number of results for the requested service
+ Count float64 `json:"count"`
+ // Current page within paginated list of results
+ Page float64 `json:"page"`
+ // Number of results per page of results
+ PerPage float64 `json:"per_page"`
+ // Total results available without any search parameters
+ TotalCount float64 `json:"total_count"`
+ JSON prioritizeUpdateResponseEnvelopeResultInfoJSON `json:"-"`
+}
+
+// prioritizeUpdateResponseEnvelopeResultInfoJSON contains the JSON metadata for
+// the struct [PrioritizeUpdateResponseEnvelopeResultInfo]
+type prioritizeUpdateResponseEnvelopeResultInfoJSON struct {
+ Count apijson.Field
+ Page apijson.Field
+ PerPage apijson.Field
+ TotalCount apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PrioritizeUpdateResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r prioritizeUpdateResponseEnvelopeResultInfoJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/custom_certificates/prioritize_test.go b/custom_certificates/prioritize_test.go
new file mode 100644
index 00000000000..14bf6ea4b72
--- /dev/null
+++ b/custom_certificates/prioritize_test.go
@@ -0,0 +1,46 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package custom_certificates_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/custom_certificates"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestPrioritizeUpdate(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"),
+ )
+ _, err := client.CustomCertificates.Prioritize.Update(context.TODO(), custom_certificates.PrioritizeUpdateParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Certificates: cloudflare.F([]custom_certificates.PrioritizeUpdateParamsCertificate{{
+ Priority: cloudflare.F(2.000000),
+ }, {
+ Priority: cloudflare.F(1.000000),
+ }}),
+ })
+ 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/custom_hostnames/aliases.go b/custom_hostnames/aliases.go
new file mode 100644
index 00000000000..6737125279a
--- /dev/null
+++ b/custom_hostnames/aliases.go
@@ -0,0 +1,9 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package custom_hostnames
+
+import (
+ "github.com/cloudflare/cloudflare-go/internal/apierror"
+)
+
+type Error = apierror.Error
diff --git a/customhostname.go b/custom_hostnames/customhostname.go
similarity index 99%
rename from customhostname.go
rename to custom_hostnames/customhostname.go
index 0f8e7c71b4e..528629dbd36 100644
--- a/customhostname.go
+++ b/custom_hostnames/customhostname.go
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package cloudflare
+package custom_hostnames
import (
"context"
@@ -24,7 +24,7 @@ import (
// instead.
type CustomHostnameService struct {
Options []option.RequestOption
- FallbackOrigin *CustomHostnameFallbackOriginService
+ FallbackOrigin *FallbackOriginService
}
// NewCustomHostnameService generates a new service that applies the given options
@@ -33,7 +33,7 @@ type CustomHostnameService struct {
func NewCustomHostnameService(opts ...option.RequestOption) (r *CustomHostnameService) {
r = &CustomHostnameService{}
r.Options = opts
- r.FallbackOrigin = NewCustomHostnameFallbackOriginService(opts...)
+ r.FallbackOrigin = NewFallbackOriginService(opts...)
return
}
diff --git a/customhostname_test.go b/custom_hostnames/customhostname_test.go
similarity index 76%
rename from customhostname_test.go
rename to custom_hostnames/customhostname_test.go
index 61fdec517c7..729c54bb9c9 100644
--- a/customhostname_test.go
+++ b/custom_hostnames/customhostname_test.go
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package cloudflare_test
+package custom_hostnames_test
import (
"context"
@@ -9,6 +9,7 @@ import (
"testing"
"github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/custom_hostnames"
"github.com/cloudflare/cloudflare-go/internal/testutil"
"github.com/cloudflare/cloudflare-go/option"
)
@@ -27,26 +28,26 @@ func TestCustomHostnameNewWithOptionalParams(t *testing.T) {
option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"),
option.WithAPIEmail("user@example.com"),
)
- _, err := client.CustomHostnames.New(context.TODO(), cloudflare.CustomHostnameNewParams{
+ _, err := client.CustomHostnames.New(context.TODO(), custom_hostnames.CustomHostnameNewParams{
ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
Hostname: cloudflare.F("app.example.com"),
- SSL: cloudflare.F(cloudflare.CustomHostnameNewParamsSSL{
- BundleMethod: cloudflare.F(cloudflare.CustomHostnameNewParamsSSLBundleMethodUbiquitous),
- CertificateAuthority: cloudflare.F(cloudflare.CustomHostnameNewParamsSSLCertificateAuthorityGoogle),
+ SSL: cloudflare.F(custom_hostnames.CustomHostnameNewParamsSSL{
+ BundleMethod: cloudflare.F(custom_hostnames.CustomHostnameNewParamsSSLBundleMethodUbiquitous),
+ CertificateAuthority: cloudflare.F(custom_hostnames.CustomHostnameNewParamsSSLCertificateAuthorityGoogle),
CustomCertificate: cloudflare.F("-----BEGIN CERTIFICATE-----\\nMIIFJDCCBAygAwIBAgIQD0ifmj/Yi5NP/2gdUySbfzANBgkqhkiG9w0BAQsFADBN\\nMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMScwJQYDVQQDEx5E...SzSHfXp5lnu/3V08I72q1QNzOCgY1XeL4GKVcj4or6cT6tX6oJH7ePPmfrBfqI/O\\nOeH8gMJ+FuwtXYEPa4hBf38M5eU5xWG7\\n-----END CERTIFICATE-----\\n"),
CustomKey: cloudflare.F("-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmG\ndtcGbg/1CGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKn\nabIRuGvBKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpid\ntnKX/a+50GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+py\nFxIXjbEIdZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pE\newooaeO2izNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABAoIBACbhTYXBZYKmYPCb\nHBR1IBlCQA2nLGf0qRuJNJZg5iEzXows/6tc8YymZkQE7nolapWsQ+upk2y5Xdp/\naxiuprIs9JzkYK8Ox0r+dlwCG1kSW+UAbX0bQ/qUqlsTvU6muVuMP8vZYHxJ3wmb\n+ufRBKztPTQ/rYWaYQcgC0RWI20HTFBMxlTAyNxYNWzX7RKFkGVVyB9RsAtmcc8g\n+j4OdosbfNoJPS0HeIfNpAznDfHKdxDk2Yc1tV6RHBrC1ynyLE9+TaflIAdo2MVv\nKLMLq51GqYKtgJFIlBRPQqKoyXdz3fGvXrTkf/WY9QNq0J1Vk5ERePZ54mN8iZB7\n9lwy/AkCgYEA6FXzosxswaJ2wQLeoYc7ceaweX/SwTvxHgXzRyJIIT0eJWgx13Wo\n/WA3Iziimsjf6qE+SI/8laxPp2A86VMaIt3Z3mJN/CqSVGw8LK2AQst+OwdPyDMu\niacE8lj/IFGC8mwNUAb9CzGU3JpU4PxxGFjS/eMtGeRXCWkK4NE+G08CgYEA1Kp9\nN2JrVlqUz+gAX+LPmE9OEMAS9WQSQsfCHGogIFDGGcNf7+uwBM7GAaSJIP01zcoe\nVAgWdzXCv3FLhsaZoJ6RyLOLay5phbu1iaTr4UNYm5WtYTzMzqh8l1+MFFDl9xDB\nvULuCIIrglM5MeS/qnSg1uMoH2oVPj9TVst/ir8CgYEAxrI7Ws9Zc4Bt70N1As+U\nlySjaEVZCMkqvHJ6TCuVZFfQoE0r0whdLdRLU2PsLFP+q7qaeZQqgBaNSKeVcDYR\n9B+nY/jOmQoPewPVsp/vQTCnE/R81spu0mp0YI6cIheT1Z9zAy322svcc43JaWB7\nmEbeqyLOP4Z4qSOcmghZBSECgYACvR9Xs0DGn+wCsW4vze/2ei77MD4OQvepPIFX\ndFZtlBy5ADcgE9z0cuVB6CiL8DbdK5kwY9pGNr8HUCI03iHkW6Zs+0L0YmihfEVe\nPG19PSzK9CaDdhD9KFZSbLyVFmWfxOt50H7YRTTiPMgjyFpfi5j2q348yVT0tEQS\nfhRqaQKBgAcWPokmJ7EbYQGeMbS7HC8eWO/RyamlnSffdCdSc7ue3zdVJxpAkQ8W\nqu80pEIF6raIQfAf8MXiiZ7auFOSnHQTXUbhCpvDLKi0Mwq3G8Pl07l+2s6dQG6T\nlv6XTQaMyf6n1yjzL+fzDrH3qXMxHMO/b13EePXpDMpY7HQpoLDi\n-----END RSA PRIVATE KEY-----\n"),
- Method: cloudflare.F(cloudflare.CustomHostnameNewParamsSSLMethodHTTP),
- Settings: cloudflare.F(cloudflare.CustomHostnameNewParamsSSLSettings{
+ Method: cloudflare.F(custom_hostnames.CustomHostnameNewParamsSSLMethodHTTP),
+ Settings: cloudflare.F(custom_hostnames.CustomHostnameNewParamsSSLSettings{
Ciphers: cloudflare.F([]string{"ECDHE-RSA-AES128-GCM-SHA256", "AES128-SHA"}),
- EarlyHints: cloudflare.F(cloudflare.CustomHostnameNewParamsSSLSettingsEarlyHintsOn),
- HTTP2: cloudflare.F(cloudflare.CustomHostnameNewParamsSSLSettingsHTTP2On),
- MinTLSVersion: cloudflare.F(cloudflare.CustomHostnameNewParamsSSLSettingsMinTLSVersion1_2),
- TLS1_3: cloudflare.F(cloudflare.CustomHostnameNewParamsSSLSettingsTLS1_3On),
+ EarlyHints: cloudflare.F(custom_hostnames.CustomHostnameNewParamsSSLSettingsEarlyHintsOn),
+ HTTP2: cloudflare.F(custom_hostnames.CustomHostnameNewParamsSSLSettingsHTTP2On),
+ MinTLSVersion: cloudflare.F(custom_hostnames.CustomHostnameNewParamsSSLSettingsMinTLSVersion1_2),
+ TLS1_3: cloudflare.F(custom_hostnames.CustomHostnameNewParamsSSLSettingsTLS1_3On),
}),
- Type: cloudflare.F(cloudflare.CustomHostnameNewParamsSSLTypeDv),
+ Type: cloudflare.F(custom_hostnames.CustomHostnameNewParamsSSLTypeDv),
Wildcard: cloudflare.F(false),
}),
- CustomMetadata: cloudflare.F(cloudflare.CustomHostnameNewParamsCustomMetadata{
+ CustomMetadata: cloudflare.F(custom_hostnames.CustomHostnameNewParamsCustomMetadata{
Key: cloudflare.F("value"),
}),
})
@@ -73,15 +74,15 @@ func TestCustomHostnameListWithOptionalParams(t *testing.T) {
option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"),
option.WithAPIEmail("user@example.com"),
)
- _, err := client.CustomHostnames.List(context.TODO(), cloudflare.CustomHostnameListParams{
+ _, err := client.CustomHostnames.List(context.TODO(), custom_hostnames.CustomHostnameListParams{
ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
ID: cloudflare.F("0d89c70d-ad9f-4843-b99f-6cc0252067e9"),
- Direction: cloudflare.F(cloudflare.CustomHostnameListParamsDirectionDesc),
+ Direction: cloudflare.F(custom_hostnames.CustomHostnameListParamsDirectionDesc),
Hostname: cloudflare.F("app.example.com"),
- Order: cloudflare.F(cloudflare.CustomHostnameListParamsOrderSSL),
+ Order: cloudflare.F(custom_hostnames.CustomHostnameListParamsOrderSSL),
Page: cloudflare.F(1.000000),
PerPage: cloudflare.F(5.000000),
- SSL: cloudflare.F(cloudflare.CustomHostnameListParamsSSL0),
+ SSL: cloudflare.F(custom_hostnames.CustomHostnameListParamsSSL0),
})
if err != nil {
var apierr *cloudflare.Error
@@ -109,7 +110,7 @@ func TestCustomHostnameDelete(t *testing.T) {
_, err := client.CustomHostnames.Delete(
context.TODO(),
"023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.CustomHostnameDeleteParams{
+ custom_hostnames.CustomHostnameDeleteParams{
ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
},
)
@@ -139,27 +140,27 @@ func TestCustomHostnameEditWithOptionalParams(t *testing.T) {
_, err := client.CustomHostnames.Edit(
context.TODO(),
"023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.CustomHostnameEditParams{
+ custom_hostnames.CustomHostnameEditParams{
ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- CustomMetadata: cloudflare.F(cloudflare.CustomHostnameEditParamsCustomMetadata{
+ CustomMetadata: cloudflare.F(custom_hostnames.CustomHostnameEditParamsCustomMetadata{
Key: cloudflare.F("value"),
}),
CustomOriginServer: cloudflare.F("origin2.example.com"),
CustomOriginSni: cloudflare.F("sni.example.com"),
- SSL: cloudflare.F(cloudflare.CustomHostnameEditParamsSSL{
- BundleMethod: cloudflare.F(cloudflare.CustomHostnameEditParamsSSLBundleMethodUbiquitous),
- CertificateAuthority: cloudflare.F(cloudflare.CustomHostnameEditParamsSSLCertificateAuthorityGoogle),
+ SSL: cloudflare.F(custom_hostnames.CustomHostnameEditParamsSSL{
+ BundleMethod: cloudflare.F(custom_hostnames.CustomHostnameEditParamsSSLBundleMethodUbiquitous),
+ CertificateAuthority: cloudflare.F(custom_hostnames.CustomHostnameEditParamsSSLCertificateAuthorityGoogle),
CustomCertificate: cloudflare.F("-----BEGIN CERTIFICATE-----\\nMIIFJDCCBAygAwIBAgIQD0ifmj/Yi5NP/2gdUySbfzANBgkqhkiG9w0BAQsFADBN\\nMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMScwJQYDVQQDEx5E...SzSHfXp5lnu/3V08I72q1QNzOCgY1XeL4GKVcj4or6cT6tX6oJH7ePPmfrBfqI/O\\nOeH8gMJ+FuwtXYEPa4hBf38M5eU5xWG7\\n-----END CERTIFICATE-----\\n"),
CustomKey: cloudflare.F("-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmG\ndtcGbg/1CGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKn\nabIRuGvBKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpid\ntnKX/a+50GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+py\nFxIXjbEIdZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pE\newooaeO2izNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABAoIBACbhTYXBZYKmYPCb\nHBR1IBlCQA2nLGf0qRuJNJZg5iEzXows/6tc8YymZkQE7nolapWsQ+upk2y5Xdp/\naxiuprIs9JzkYK8Ox0r+dlwCG1kSW+UAbX0bQ/qUqlsTvU6muVuMP8vZYHxJ3wmb\n+ufRBKztPTQ/rYWaYQcgC0RWI20HTFBMxlTAyNxYNWzX7RKFkGVVyB9RsAtmcc8g\n+j4OdosbfNoJPS0HeIfNpAznDfHKdxDk2Yc1tV6RHBrC1ynyLE9+TaflIAdo2MVv\nKLMLq51GqYKtgJFIlBRPQqKoyXdz3fGvXrTkf/WY9QNq0J1Vk5ERePZ54mN8iZB7\n9lwy/AkCgYEA6FXzosxswaJ2wQLeoYc7ceaweX/SwTvxHgXzRyJIIT0eJWgx13Wo\n/WA3Iziimsjf6qE+SI/8laxPp2A86VMaIt3Z3mJN/CqSVGw8LK2AQst+OwdPyDMu\niacE8lj/IFGC8mwNUAb9CzGU3JpU4PxxGFjS/eMtGeRXCWkK4NE+G08CgYEA1Kp9\nN2JrVlqUz+gAX+LPmE9OEMAS9WQSQsfCHGogIFDGGcNf7+uwBM7GAaSJIP01zcoe\nVAgWdzXCv3FLhsaZoJ6RyLOLay5phbu1iaTr4UNYm5WtYTzMzqh8l1+MFFDl9xDB\nvULuCIIrglM5MeS/qnSg1uMoH2oVPj9TVst/ir8CgYEAxrI7Ws9Zc4Bt70N1As+U\nlySjaEVZCMkqvHJ6TCuVZFfQoE0r0whdLdRLU2PsLFP+q7qaeZQqgBaNSKeVcDYR\n9B+nY/jOmQoPewPVsp/vQTCnE/R81spu0mp0YI6cIheT1Z9zAy322svcc43JaWB7\nmEbeqyLOP4Z4qSOcmghZBSECgYACvR9Xs0DGn+wCsW4vze/2ei77MD4OQvepPIFX\ndFZtlBy5ADcgE9z0cuVB6CiL8DbdK5kwY9pGNr8HUCI03iHkW6Zs+0L0YmihfEVe\nPG19PSzK9CaDdhD9KFZSbLyVFmWfxOt50H7YRTTiPMgjyFpfi5j2q348yVT0tEQS\nfhRqaQKBgAcWPokmJ7EbYQGeMbS7HC8eWO/RyamlnSffdCdSc7ue3zdVJxpAkQ8W\nqu80pEIF6raIQfAf8MXiiZ7auFOSnHQTXUbhCpvDLKi0Mwq3G8Pl07l+2s6dQG6T\nlv6XTQaMyf6n1yjzL+fzDrH3qXMxHMO/b13EePXpDMpY7HQpoLDi\n-----END RSA PRIVATE KEY-----\n"),
- Method: cloudflare.F(cloudflare.CustomHostnameEditParamsSSLMethodHTTP),
- Settings: cloudflare.F(cloudflare.CustomHostnameEditParamsSSLSettings{
+ Method: cloudflare.F(custom_hostnames.CustomHostnameEditParamsSSLMethodHTTP),
+ Settings: cloudflare.F(custom_hostnames.CustomHostnameEditParamsSSLSettings{
Ciphers: cloudflare.F([]string{"ECDHE-RSA-AES128-GCM-SHA256", "AES128-SHA"}),
- EarlyHints: cloudflare.F(cloudflare.CustomHostnameEditParamsSSLSettingsEarlyHintsOn),
- HTTP2: cloudflare.F(cloudflare.CustomHostnameEditParamsSSLSettingsHTTP2On),
- MinTLSVersion: cloudflare.F(cloudflare.CustomHostnameEditParamsSSLSettingsMinTLSVersion1_2),
- TLS1_3: cloudflare.F(cloudflare.CustomHostnameEditParamsSSLSettingsTLS1_3On),
+ EarlyHints: cloudflare.F(custom_hostnames.CustomHostnameEditParamsSSLSettingsEarlyHintsOn),
+ HTTP2: cloudflare.F(custom_hostnames.CustomHostnameEditParamsSSLSettingsHTTP2On),
+ MinTLSVersion: cloudflare.F(custom_hostnames.CustomHostnameEditParamsSSLSettingsMinTLSVersion1_2),
+ TLS1_3: cloudflare.F(custom_hostnames.CustomHostnameEditParamsSSLSettingsTLS1_3On),
}),
- Type: cloudflare.F(cloudflare.CustomHostnameEditParamsSSLTypeDv),
+ Type: cloudflare.F(custom_hostnames.CustomHostnameEditParamsSSLTypeDv),
Wildcard: cloudflare.F(false),
}),
},
@@ -190,7 +191,7 @@ func TestCustomHostnameGet(t *testing.T) {
_, err := client.CustomHostnames.Get(
context.TODO(),
"023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.CustomHostnameGetParams{
+ custom_hostnames.CustomHostnameGetParams{
ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
},
)
diff --git a/custom_hostnames/fallbackorigin.go b/custom_hostnames/fallbackorigin.go
new file mode 100644
index 00000000000..8f97acbf63c
--- /dev/null
+++ b/custom_hostnames/fallbackorigin.go
@@ -0,0 +1,389 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package custom_hostnames
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "reflect"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/tidwall/gjson"
+)
+
+// FallbackOriginService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewFallbackOriginService] method
+// instead.
+type FallbackOriginService struct {
+ Options []option.RequestOption
+}
+
+// NewFallbackOriginService generates a new service that applies the given options
+// to each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewFallbackOriginService(opts ...option.RequestOption) (r *FallbackOriginService) {
+ r = &FallbackOriginService{}
+ r.Options = opts
+ return
+}
+
+// Update Fallback Origin for Custom Hostnames
+func (r *FallbackOriginService) Update(ctx context.Context, params FallbackOriginUpdateParams, opts ...option.RequestOption) (res *FallbackOriginUpdateResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env FallbackOriginUpdateResponseEnvelope
+ path := fmt.Sprintf("zones/%s/custom_hostnames/fallback_origin", params.ZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Delete Fallback Origin for Custom Hostnames
+func (r *FallbackOriginService) Delete(ctx context.Context, body FallbackOriginDeleteParams, opts ...option.RequestOption) (res *FallbackOriginDeleteResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env FallbackOriginDeleteResponseEnvelope
+ path := fmt.Sprintf("zones/%s/custom_hostnames/fallback_origin", body.ZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Get Fallback Origin for Custom Hostnames
+func (r *FallbackOriginService) Get(ctx context.Context, query FallbackOriginGetParams, opts ...option.RequestOption) (res *FallbackOriginGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env FallbackOriginGetResponseEnvelope
+ path := fmt.Sprintf("zones/%s/custom_hostnames/fallback_origin", query.ZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Union satisfied by [custom_hostnames.FallbackOriginUpdateResponseUnknown] or
+// [shared.UnionString].
+type FallbackOriginUpdateResponse interface {
+ ImplementsCustomHostnamesFallbackOriginUpdateResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*FallbackOriginUpdateResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+// Union satisfied by [custom_hostnames.FallbackOriginDeleteResponseUnknown] or
+// [shared.UnionString].
+type FallbackOriginDeleteResponse interface {
+ ImplementsCustomHostnamesFallbackOriginDeleteResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*FallbackOriginDeleteResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+// Union satisfied by [custom_hostnames.FallbackOriginGetResponseUnknown] or
+// [shared.UnionString].
+type FallbackOriginGetResponse interface {
+ ImplementsCustomHostnamesFallbackOriginGetResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*FallbackOriginGetResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+type FallbackOriginUpdateParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+ // Your origin hostname that requests to your custom hostnames will be sent to.
+ Origin param.Field[string] `json:"origin,required"`
+}
+
+func (r FallbackOriginUpdateParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type FallbackOriginUpdateResponseEnvelope struct {
+ Errors []FallbackOriginUpdateResponseEnvelopeErrors `json:"errors,required"`
+ Messages []FallbackOriginUpdateResponseEnvelopeMessages `json:"messages,required"`
+ Result FallbackOriginUpdateResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success FallbackOriginUpdateResponseEnvelopeSuccess `json:"success,required"`
+ JSON fallbackOriginUpdateResponseEnvelopeJSON `json:"-"`
+}
+
+// fallbackOriginUpdateResponseEnvelopeJSON contains the JSON metadata for the
+// struct [FallbackOriginUpdateResponseEnvelope]
+type fallbackOriginUpdateResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *FallbackOriginUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r fallbackOriginUpdateResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type FallbackOriginUpdateResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON fallbackOriginUpdateResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// fallbackOriginUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for
+// the struct [FallbackOriginUpdateResponseEnvelopeErrors]
+type fallbackOriginUpdateResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *FallbackOriginUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r fallbackOriginUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type FallbackOriginUpdateResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON fallbackOriginUpdateResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// fallbackOriginUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for
+// the struct [FallbackOriginUpdateResponseEnvelopeMessages]
+type fallbackOriginUpdateResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *FallbackOriginUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r fallbackOriginUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type FallbackOriginUpdateResponseEnvelopeSuccess bool
+
+const (
+ FallbackOriginUpdateResponseEnvelopeSuccessTrue FallbackOriginUpdateResponseEnvelopeSuccess = true
+)
+
+type FallbackOriginDeleteParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+}
+
+type FallbackOriginDeleteResponseEnvelope struct {
+ Errors []FallbackOriginDeleteResponseEnvelopeErrors `json:"errors,required"`
+ Messages []FallbackOriginDeleteResponseEnvelopeMessages `json:"messages,required"`
+ Result FallbackOriginDeleteResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success FallbackOriginDeleteResponseEnvelopeSuccess `json:"success,required"`
+ JSON fallbackOriginDeleteResponseEnvelopeJSON `json:"-"`
+}
+
+// fallbackOriginDeleteResponseEnvelopeJSON contains the JSON metadata for the
+// struct [FallbackOriginDeleteResponseEnvelope]
+type fallbackOriginDeleteResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *FallbackOriginDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r fallbackOriginDeleteResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type FallbackOriginDeleteResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON fallbackOriginDeleteResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// fallbackOriginDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for
+// the struct [FallbackOriginDeleteResponseEnvelopeErrors]
+type fallbackOriginDeleteResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *FallbackOriginDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r fallbackOriginDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type FallbackOriginDeleteResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON fallbackOriginDeleteResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// fallbackOriginDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for
+// the struct [FallbackOriginDeleteResponseEnvelopeMessages]
+type fallbackOriginDeleteResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *FallbackOriginDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r fallbackOriginDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type FallbackOriginDeleteResponseEnvelopeSuccess bool
+
+const (
+ FallbackOriginDeleteResponseEnvelopeSuccessTrue FallbackOriginDeleteResponseEnvelopeSuccess = true
+)
+
+type FallbackOriginGetParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+}
+
+type FallbackOriginGetResponseEnvelope struct {
+ Errors []FallbackOriginGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []FallbackOriginGetResponseEnvelopeMessages `json:"messages,required"`
+ Result FallbackOriginGetResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success FallbackOriginGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON fallbackOriginGetResponseEnvelopeJSON `json:"-"`
+}
+
+// fallbackOriginGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [FallbackOriginGetResponseEnvelope]
+type fallbackOriginGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *FallbackOriginGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r fallbackOriginGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type FallbackOriginGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON fallbackOriginGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// fallbackOriginGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [FallbackOriginGetResponseEnvelopeErrors]
+type fallbackOriginGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *FallbackOriginGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r fallbackOriginGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type FallbackOriginGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON fallbackOriginGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// fallbackOriginGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [FallbackOriginGetResponseEnvelopeMessages]
+type fallbackOriginGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *FallbackOriginGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r fallbackOriginGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type FallbackOriginGetResponseEnvelopeSuccess bool
+
+const (
+ FallbackOriginGetResponseEnvelopeSuccessTrue FallbackOriginGetResponseEnvelopeSuccess = true
+)
diff --git a/custom_hostnames/fallbackorigin_test.go b/custom_hostnames/fallbackorigin_test.go
new file mode 100644
index 00000000000..d9add129b21
--- /dev/null
+++ b/custom_hostnames/fallbackorigin_test.go
@@ -0,0 +1,94 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package custom_hostnames_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/custom_hostnames"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestFallbackOriginUpdate(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"),
+ )
+ _, err := client.CustomHostnames.FallbackOrigin.Update(context.TODO(), custom_hostnames.FallbackOriginUpdateParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Origin: cloudflare.F("fallback.example.com"),
+ })
+ 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())
+ }
+}
+
+func TestFallbackOriginDelete(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"),
+ )
+ _, err := client.CustomHostnames.FallbackOrigin.Delete(context.TODO(), custom_hostnames.FallbackOriginDeleteParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ })
+ 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())
+ }
+}
+
+func TestFallbackOriginGet(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"),
+ )
+ _, err := client.CustomHostnames.FallbackOrigin.Get(context.TODO(), custom_hostnames.FallbackOriginGetParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ })
+ 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/custom_nameservers/aliases.go b/custom_nameservers/aliases.go
new file mode 100644
index 00000000000..65c8f236e4f
--- /dev/null
+++ b/custom_nameservers/aliases.go
@@ -0,0 +1,9 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package custom_nameservers
+
+import (
+ "github.com/cloudflare/cloudflare-go/internal/apierror"
+)
+
+type Error = apierror.Error
diff --git a/custom_nameservers/customnameserver.go b/custom_nameservers/customnameserver.go
new file mode 100644
index 00000000000..43ea750073b
--- /dev/null
+++ b/custom_nameservers/customnameserver.go
@@ -0,0 +1,775 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package custom_nameservers
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "reflect"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/tidwall/gjson"
+)
+
+// CustomNameserverService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewCustomNameserverService] method
+// instead.
+type CustomNameserverService struct {
+ Options []option.RequestOption
+}
+
+// NewCustomNameserverService generates a new service that applies the given
+// options to each request. These options are applied after the parent client's
+// options (if there is one), and before any request-specific options.
+func NewCustomNameserverService(opts ...option.RequestOption) (r *CustomNameserverService) {
+ r = &CustomNameserverService{}
+ r.Options = opts
+ return
+}
+
+// Add Account Custom Nameserver
+func (r *CustomNameserverService) New(ctx context.Context, params CustomNameserverNewParams, opts ...option.RequestOption) (res *DNSCustomNameserversCustomNS, err error) {
+ opts = append(r.Options[:], opts...)
+ var env CustomNameserverNewResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/custom_ns", params.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Delete Account Custom Nameserver
+func (r *CustomNameserverService) Delete(ctx context.Context, customNSID string, body CustomNameserverDeleteParams, opts ...option.RequestOption) (res *CustomNameserverDeleteResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env CustomNameserverDeleteResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/custom_ns/%s", body.AccountID, customNSID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Get Eligible Zones for Account Custom Nameservers
+func (r *CustomNameserverService) Availabilty(ctx context.Context, query CustomNameserverAvailabiltyParams, opts ...option.RequestOption) (res *[]string, err error) {
+ opts = append(r.Options[:], opts...)
+ var env CustomNameserverAvailabiltyResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/custom_ns/availability", query.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// List an account's custom nameservers.
+func (r *CustomNameserverService) Get(ctx context.Context, query CustomNameserverGetParams, opts ...option.RequestOption) (res *[]DNSCustomNameserversCustomNS, err error) {
+ opts = append(r.Options[:], opts...)
+ var env CustomNameserverGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/custom_ns", query.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Verify Account Custom Nameserver Glue Records
+func (r *CustomNameserverService) Verify(ctx context.Context, body CustomNameserverVerifyParams, opts ...option.RequestOption) (res *[]DNSCustomNameserversCustomNS, err error) {
+ opts = append(r.Options[:], opts...)
+ var env CustomNameserverVerifyResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/custom_ns/verify", body.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// A single account custom nameserver.
+type DNSCustomNameserversCustomNS struct {
+ // A and AAAA records associated with the nameserver.
+ DNSRecords []DNSCustomNameserversCustomNSDNSRecord `json:"dns_records,required"`
+ // The FQDN of the name server.
+ NSName string `json:"ns_name,required" format:"hostname"`
+ // Verification status of the nameserver.
+ Status DNSCustomNameserversCustomNSStatus `json:"status,required"`
+ // Identifier
+ ZoneTag string `json:"zone_tag,required"`
+ // The number of the set that this name server belongs to.
+ NSSet float64 `json:"ns_set"`
+ JSON dnsCustomNameserversCustomNSJSON `json:"-"`
+}
+
+// dnsCustomNameserversCustomNSJSON contains the JSON metadata for the struct
+// [DNSCustomNameserversCustomNS]
+type dnsCustomNameserversCustomNSJSON struct {
+ DNSRecords apijson.Field
+ NSName apijson.Field
+ Status apijson.Field
+ ZoneTag apijson.Field
+ NSSet apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DNSCustomNameserversCustomNS) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r dnsCustomNameserversCustomNSJSON) RawJSON() string {
+ return r.raw
+}
+
+type DNSCustomNameserversCustomNSDNSRecord struct {
+ // DNS record type.
+ Type DNSCustomNameserversCustomNSDNSRecordsType `json:"type"`
+ // DNS record contents (an IPv4 or IPv6 address).
+ Value string `json:"value"`
+ JSON dnsCustomNameserversCustomNsdnsRecordJSON `json:"-"`
+}
+
+// dnsCustomNameserversCustomNsdnsRecordJSON contains the JSON metadata for the
+// struct [DNSCustomNameserversCustomNSDNSRecord]
+type dnsCustomNameserversCustomNsdnsRecordJSON struct {
+ Type apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DNSCustomNameserversCustomNSDNSRecord) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r dnsCustomNameserversCustomNsdnsRecordJSON) RawJSON() string {
+ return r.raw
+}
+
+// DNS record type.
+type DNSCustomNameserversCustomNSDNSRecordsType string
+
+const (
+ DNSCustomNameserversCustomNSDNSRecordsTypeA DNSCustomNameserversCustomNSDNSRecordsType = "A"
+ DNSCustomNameserversCustomNSDNSRecordsTypeAAAA DNSCustomNameserversCustomNSDNSRecordsType = "AAAA"
+)
+
+// Verification status of the nameserver.
+type DNSCustomNameserversCustomNSStatus string
+
+const (
+ DNSCustomNameserversCustomNSStatusMoved DNSCustomNameserversCustomNSStatus = "moved"
+ DNSCustomNameserversCustomNSStatusPending DNSCustomNameserversCustomNSStatus = "pending"
+ DNSCustomNameserversCustomNSStatusVerified DNSCustomNameserversCustomNSStatus = "verified"
+)
+
+// Union satisfied by [custom_nameservers.CustomNameserverDeleteResponseUnknown],
+// [custom_nameservers.CustomNameserverDeleteResponseArray] or
+// [shared.UnionString].
+type CustomNameserverDeleteResponse interface {
+ ImplementsCustomNameserversCustomNameserverDeleteResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*CustomNameserverDeleteResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(CustomNameserverDeleteResponseArray{}),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+type CustomNameserverDeleteResponseArray []interface{}
+
+func (r CustomNameserverDeleteResponseArray) ImplementsCustomNameserversCustomNameserverDeleteResponse() {
+}
+
+type CustomNameserverNewParams struct {
+ // Account identifier tag.
+ AccountID param.Field[string] `path:"account_id,required"`
+ // The FQDN of the name server.
+ NSName param.Field[string] `json:"ns_name,required" format:"hostname"`
+ // The number of the set that this name server belongs to.
+ NSSet param.Field[float64] `json:"ns_set"`
+}
+
+func (r CustomNameserverNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type CustomNameserverNewResponseEnvelope struct {
+ Errors []CustomNameserverNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []CustomNameserverNewResponseEnvelopeMessages `json:"messages,required"`
+ // A single account custom nameserver.
+ Result DNSCustomNameserversCustomNS `json:"result,required"`
+ // Whether the API call was successful
+ Success CustomNameserverNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON customNameserverNewResponseEnvelopeJSON `json:"-"`
+}
+
+// customNameserverNewResponseEnvelopeJSON contains the JSON metadata for the
+// struct [CustomNameserverNewResponseEnvelope]
+type customNameserverNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CustomNameserverNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r customNameserverNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type CustomNameserverNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON customNameserverNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// customNameserverNewResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [CustomNameserverNewResponseEnvelopeErrors]
+type customNameserverNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CustomNameserverNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r customNameserverNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type CustomNameserverNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON customNameserverNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// customNameserverNewResponseEnvelopeMessagesJSON contains the JSON metadata for
+// the struct [CustomNameserverNewResponseEnvelopeMessages]
+type customNameserverNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CustomNameserverNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r customNameserverNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type CustomNameserverNewResponseEnvelopeSuccess bool
+
+const (
+ CustomNameserverNewResponseEnvelopeSuccessTrue CustomNameserverNewResponseEnvelopeSuccess = true
+)
+
+type CustomNameserverDeleteParams struct {
+ // Account identifier tag.
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type CustomNameserverDeleteResponseEnvelope struct {
+ Errors []CustomNameserverDeleteResponseEnvelopeErrors `json:"errors,required"`
+ Messages []CustomNameserverDeleteResponseEnvelopeMessages `json:"messages,required"`
+ Result CustomNameserverDeleteResponse `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success CustomNameserverDeleteResponseEnvelopeSuccess `json:"success,required"`
+ ResultInfo CustomNameserverDeleteResponseEnvelopeResultInfo `json:"result_info"`
+ JSON customNameserverDeleteResponseEnvelopeJSON `json:"-"`
+}
+
+// customNameserverDeleteResponseEnvelopeJSON contains the JSON metadata for the
+// struct [CustomNameserverDeleteResponseEnvelope]
+type customNameserverDeleteResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ ResultInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CustomNameserverDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r customNameserverDeleteResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type CustomNameserverDeleteResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON customNameserverDeleteResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// customNameserverDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for
+// the struct [CustomNameserverDeleteResponseEnvelopeErrors]
+type customNameserverDeleteResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CustomNameserverDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r customNameserverDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type CustomNameserverDeleteResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON customNameserverDeleteResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// customNameserverDeleteResponseEnvelopeMessagesJSON contains the JSON metadata
+// for the struct [CustomNameserverDeleteResponseEnvelopeMessages]
+type customNameserverDeleteResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CustomNameserverDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r customNameserverDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type CustomNameserverDeleteResponseEnvelopeSuccess bool
+
+const (
+ CustomNameserverDeleteResponseEnvelopeSuccessTrue CustomNameserverDeleteResponseEnvelopeSuccess = true
+)
+
+type CustomNameserverDeleteResponseEnvelopeResultInfo struct {
+ // Total number of results for the requested service
+ Count float64 `json:"count"`
+ // Current page within paginated list of results
+ Page float64 `json:"page"`
+ // Number of results per page of results
+ PerPage float64 `json:"per_page"`
+ // Total results available without any search parameters
+ TotalCount float64 `json:"total_count"`
+ JSON customNameserverDeleteResponseEnvelopeResultInfoJSON `json:"-"`
+}
+
+// customNameserverDeleteResponseEnvelopeResultInfoJSON contains the JSON metadata
+// for the struct [CustomNameserverDeleteResponseEnvelopeResultInfo]
+type customNameserverDeleteResponseEnvelopeResultInfoJSON struct {
+ Count apijson.Field
+ Page apijson.Field
+ PerPage apijson.Field
+ TotalCount apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CustomNameserverDeleteResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r customNameserverDeleteResponseEnvelopeResultInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type CustomNameserverAvailabiltyParams struct {
+ // Account identifier tag.
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type CustomNameserverAvailabiltyResponseEnvelope struct {
+ Errors []CustomNameserverAvailabiltyResponseEnvelopeErrors `json:"errors,required"`
+ Messages []CustomNameserverAvailabiltyResponseEnvelopeMessages `json:"messages,required"`
+ Result []string `json:"result,required,nullable" format:"hostname"`
+ // Whether the API call was successful
+ Success CustomNameserverAvailabiltyResponseEnvelopeSuccess `json:"success,required"`
+ ResultInfo CustomNameserverAvailabiltyResponseEnvelopeResultInfo `json:"result_info"`
+ JSON customNameserverAvailabiltyResponseEnvelopeJSON `json:"-"`
+}
+
+// customNameserverAvailabiltyResponseEnvelopeJSON contains the JSON metadata for
+// the struct [CustomNameserverAvailabiltyResponseEnvelope]
+type customNameserverAvailabiltyResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ ResultInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CustomNameserverAvailabiltyResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r customNameserverAvailabiltyResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type CustomNameserverAvailabiltyResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON customNameserverAvailabiltyResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// customNameserverAvailabiltyResponseEnvelopeErrorsJSON contains the JSON metadata
+// for the struct [CustomNameserverAvailabiltyResponseEnvelopeErrors]
+type customNameserverAvailabiltyResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CustomNameserverAvailabiltyResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r customNameserverAvailabiltyResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type CustomNameserverAvailabiltyResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON customNameserverAvailabiltyResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// customNameserverAvailabiltyResponseEnvelopeMessagesJSON contains the JSON
+// metadata for the struct [CustomNameserverAvailabiltyResponseEnvelopeMessages]
+type customNameserverAvailabiltyResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CustomNameserverAvailabiltyResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r customNameserverAvailabiltyResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type CustomNameserverAvailabiltyResponseEnvelopeSuccess bool
+
+const (
+ CustomNameserverAvailabiltyResponseEnvelopeSuccessTrue CustomNameserverAvailabiltyResponseEnvelopeSuccess = true
+)
+
+type CustomNameserverAvailabiltyResponseEnvelopeResultInfo struct {
+ // Total number of results for the requested service
+ Count float64 `json:"count"`
+ // Current page within paginated list of results
+ Page float64 `json:"page"`
+ // Number of results per page of results
+ PerPage float64 `json:"per_page"`
+ // Total results available without any search parameters
+ TotalCount float64 `json:"total_count"`
+ JSON customNameserverAvailabiltyResponseEnvelopeResultInfoJSON `json:"-"`
+}
+
+// customNameserverAvailabiltyResponseEnvelopeResultInfoJSON contains the JSON
+// metadata for the struct [CustomNameserverAvailabiltyResponseEnvelopeResultInfo]
+type customNameserverAvailabiltyResponseEnvelopeResultInfoJSON struct {
+ Count apijson.Field
+ Page apijson.Field
+ PerPage apijson.Field
+ TotalCount apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CustomNameserverAvailabiltyResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r customNameserverAvailabiltyResponseEnvelopeResultInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type CustomNameserverGetParams struct {
+ // Account identifier tag.
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type CustomNameserverGetResponseEnvelope struct {
+ Errors []CustomNameserverGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []CustomNameserverGetResponseEnvelopeMessages `json:"messages,required"`
+ Result []DNSCustomNameserversCustomNS `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success CustomNameserverGetResponseEnvelopeSuccess `json:"success,required"`
+ ResultInfo CustomNameserverGetResponseEnvelopeResultInfo `json:"result_info"`
+ JSON customNameserverGetResponseEnvelopeJSON `json:"-"`
+}
+
+// customNameserverGetResponseEnvelopeJSON contains the JSON metadata for the
+// struct [CustomNameserverGetResponseEnvelope]
+type customNameserverGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ ResultInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CustomNameserverGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r customNameserverGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type CustomNameserverGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON customNameserverGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// customNameserverGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [CustomNameserverGetResponseEnvelopeErrors]
+type customNameserverGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CustomNameserverGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r customNameserverGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type CustomNameserverGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON customNameserverGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// customNameserverGetResponseEnvelopeMessagesJSON contains the JSON metadata for
+// the struct [CustomNameserverGetResponseEnvelopeMessages]
+type customNameserverGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CustomNameserverGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r customNameserverGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type CustomNameserverGetResponseEnvelopeSuccess bool
+
+const (
+ CustomNameserverGetResponseEnvelopeSuccessTrue CustomNameserverGetResponseEnvelopeSuccess = true
+)
+
+type CustomNameserverGetResponseEnvelopeResultInfo struct {
+ // Total number of results for the requested service
+ Count float64 `json:"count"`
+ // Current page within paginated list of results
+ Page float64 `json:"page"`
+ // Number of results per page of results
+ PerPage float64 `json:"per_page"`
+ // Total results available without any search parameters
+ TotalCount float64 `json:"total_count"`
+ JSON customNameserverGetResponseEnvelopeResultInfoJSON `json:"-"`
+}
+
+// customNameserverGetResponseEnvelopeResultInfoJSON contains the JSON metadata for
+// the struct [CustomNameserverGetResponseEnvelopeResultInfo]
+type customNameserverGetResponseEnvelopeResultInfoJSON struct {
+ Count apijson.Field
+ Page apijson.Field
+ PerPage apijson.Field
+ TotalCount apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CustomNameserverGetResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r customNameserverGetResponseEnvelopeResultInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type CustomNameserverVerifyParams struct {
+ // Account identifier tag.
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type CustomNameserverVerifyResponseEnvelope struct {
+ Errors []CustomNameserverVerifyResponseEnvelopeErrors `json:"errors,required"`
+ Messages []CustomNameserverVerifyResponseEnvelopeMessages `json:"messages,required"`
+ Result []DNSCustomNameserversCustomNS `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success CustomNameserverVerifyResponseEnvelopeSuccess `json:"success,required"`
+ ResultInfo CustomNameserverVerifyResponseEnvelopeResultInfo `json:"result_info"`
+ JSON customNameserverVerifyResponseEnvelopeJSON `json:"-"`
+}
+
+// customNameserverVerifyResponseEnvelopeJSON contains the JSON metadata for the
+// struct [CustomNameserverVerifyResponseEnvelope]
+type customNameserverVerifyResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ ResultInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CustomNameserverVerifyResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r customNameserverVerifyResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type CustomNameserverVerifyResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON customNameserverVerifyResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// customNameserverVerifyResponseEnvelopeErrorsJSON contains the JSON metadata for
+// the struct [CustomNameserverVerifyResponseEnvelopeErrors]
+type customNameserverVerifyResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CustomNameserverVerifyResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r customNameserverVerifyResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type CustomNameserverVerifyResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON customNameserverVerifyResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// customNameserverVerifyResponseEnvelopeMessagesJSON contains the JSON metadata
+// for the struct [CustomNameserverVerifyResponseEnvelopeMessages]
+type customNameserverVerifyResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CustomNameserverVerifyResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r customNameserverVerifyResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type CustomNameserverVerifyResponseEnvelopeSuccess bool
+
+const (
+ CustomNameserverVerifyResponseEnvelopeSuccessTrue CustomNameserverVerifyResponseEnvelopeSuccess = true
+)
+
+type CustomNameserverVerifyResponseEnvelopeResultInfo struct {
+ // Total number of results for the requested service
+ Count float64 `json:"count"`
+ // Current page within paginated list of results
+ Page float64 `json:"page"`
+ // Number of results per page of results
+ PerPage float64 `json:"per_page"`
+ // Total results available without any search parameters
+ TotalCount float64 `json:"total_count"`
+ JSON customNameserverVerifyResponseEnvelopeResultInfoJSON `json:"-"`
+}
+
+// customNameserverVerifyResponseEnvelopeResultInfoJSON contains the JSON metadata
+// for the struct [CustomNameserverVerifyResponseEnvelopeResultInfo]
+type customNameserverVerifyResponseEnvelopeResultInfoJSON struct {
+ Count apijson.Field
+ Page apijson.Field
+ PerPage apijson.Field
+ TotalCount apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CustomNameserverVerifyResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r customNameserverVerifyResponseEnvelopeResultInfoJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/custom_nameservers/customnameserver_test.go b/custom_nameservers/customnameserver_test.go
new file mode 100644
index 00000000000..79b3bab9a00
--- /dev/null
+++ b/custom_nameservers/customnameserver_test.go
@@ -0,0 +1,151 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package custom_nameservers_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/custom_nameservers"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestCustomNameserverNewWithOptionalParams(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"),
+ )
+ _, err := client.CustomNameservers.New(context.TODO(), custom_nameservers.CustomNameserverNewParams{
+ AccountID: cloudflare.F("372e67954025e0ba6aaa6d586b9e0b59"),
+ NSName: cloudflare.F("ns1.example.com"),
+ NSSet: cloudflare.F(1.000000),
+ })
+ 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())
+ }
+}
+
+func TestCustomNameserverDelete(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"),
+ )
+ _, err := client.CustomNameservers.Delete(
+ context.TODO(),
+ "ns1.example.com",
+ custom_nameservers.CustomNameserverDeleteParams{
+ AccountID: cloudflare.F("372e67954025e0ba6aaa6d586b9e0b59"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestCustomNameserverAvailabilty(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"),
+ )
+ _, err := client.CustomNameservers.Availabilty(context.TODO(), custom_nameservers.CustomNameserverAvailabiltyParams{
+ AccountID: cloudflare.F("372e67954025e0ba6aaa6d586b9e0b59"),
+ })
+ 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())
+ }
+}
+
+func TestCustomNameserverGet(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"),
+ )
+ _, err := client.CustomNameservers.Get(context.TODO(), custom_nameservers.CustomNameserverGetParams{
+ AccountID: cloudflare.F("372e67954025e0ba6aaa6d586b9e0b59"),
+ })
+ 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())
+ }
+}
+
+func TestCustomNameserverVerify(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"),
+ )
+ _, err := client.CustomNameservers.Verify(context.TODO(), custom_nameservers.CustomNameserverVerifyParams{
+ AccountID: cloudflare.F("372e67954025e0ba6aaa6d586b9e0b59"),
+ })
+ 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/customcertificateprioritize.go b/customcertificateprioritize.go
deleted file mode 100644
index 9239cd29008..00000000000
--- a/customcertificateprioritize.go
+++ /dev/null
@@ -1,413 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// CustomCertificatePrioritizeService contains methods and other services that help
-// with interacting with the cloudflare API. Note, unlike clients, this service
-// does not read variables from the environment automatically. You should not
-// instantiate this service directly, and instead use the
-// [NewCustomCertificatePrioritizeService] method instead.
-type CustomCertificatePrioritizeService struct {
- Options []option.RequestOption
-}
-
-// NewCustomCertificatePrioritizeService generates a new service that applies the
-// given options to each request. These options are applied after the parent
-// client's options (if there is one), and before any request-specific options.
-func NewCustomCertificatePrioritizeService(opts ...option.RequestOption) (r *CustomCertificatePrioritizeService) {
- r = &CustomCertificatePrioritizeService{}
- r.Options = opts
- return
-}
-
-// If a zone has multiple SSL certificates, you can set the order in which they
-// should be used during a request. The higher priority will break ties across
-// overlapping 'legacy_custom' certificates.
-func (r *CustomCertificatePrioritizeService) Update(ctx context.Context, params CustomCertificatePrioritizeUpdateParams, opts ...option.RequestOption) (res *[]CustomCertificatePrioritizeUpdateResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env CustomCertificatePrioritizeUpdateResponseEnvelope
- path := fmt.Sprintf("zones/%s/custom_certificates/prioritize", params.ZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type CustomCertificatePrioritizeUpdateResponse struct {
- // Identifier
- ID string `json:"id,required"`
- // A ubiquitous bundle has the highest probability of being verified everywhere,
- // even by clients using outdated or unusual trust stores. An optimal bundle uses
- // the shortest chain and newest intermediates. And the force bundle verifies the
- // chain, but does not otherwise modify it.
- BundleMethod CustomCertificatePrioritizeUpdateResponseBundleMethod `json:"bundle_method,required"`
- // When the certificate from the authority expires.
- ExpiresOn time.Time `json:"expires_on,required" format:"date-time"`
- Hosts []string `json:"hosts,required"`
- // The certificate authority that issued the certificate.
- Issuer string `json:"issuer,required"`
- // When the certificate was last modified.
- ModifiedOn time.Time `json:"modified_on,required" format:"date-time"`
- // The order/priority in which the certificate will be used in a request. The
- // higher priority will break ties across overlapping 'legacy_custom' certificates,
- // but 'legacy_custom' certificates will always supercede 'sni_custom'
- // certificates.
- Priority float64 `json:"priority,required"`
- // The type of hash used for the certificate.
- Signature string `json:"signature,required"`
- // Status of the zone's custom SSL.
- Status CustomCertificatePrioritizeUpdateResponseStatus `json:"status,required"`
- // When the certificate was uploaded to Cloudflare.
- UploadedOn time.Time `json:"uploaded_on,required" format:"date-time"`
- // Identifier
- ZoneID string `json:"zone_id,required"`
- // Specify the region where your private key can be held locally for optimal TLS
- // performance. HTTPS connections to any excluded data center will still be fully
- // encrypted, but will incur some latency while Keyless SSL is used to complete the
- // handshake with the nearest allowed data center. Options allow distribution to
- // only to U.S. data centers, only to E.U. data centers, or only to highest
- // security data centers. Default distribution is to all Cloudflare datacenters,
- // for optimal performance.
- GeoRestrictions CustomCertificatePrioritizeUpdateResponseGeoRestrictions `json:"geo_restrictions"`
- KeylessServer CustomCertificatePrioritizeUpdateResponseKeylessServer `json:"keyless_server"`
- // Specify the policy that determines the region where your private key will be
- // held locally. HTTPS connections to any excluded data center will still be fully
- // encrypted, but will incur some latency while Keyless SSL is used to complete the
- // handshake with the nearest allowed data center. Any combination of countries,
- // specified by their two letter country code
- // (https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements)
- // can be chosen, such as 'country: IN', as well as 'region: EU' which refers to
- // the EU region. If there are too few data centers satisfying the policy, it will
- // be rejected.
- Policy string `json:"policy"`
- JSON customCertificatePrioritizeUpdateResponseJSON `json:"-"`
-}
-
-// customCertificatePrioritizeUpdateResponseJSON contains the JSON metadata for the
-// struct [CustomCertificatePrioritizeUpdateResponse]
-type customCertificatePrioritizeUpdateResponseJSON struct {
- ID apijson.Field
- BundleMethod apijson.Field
- ExpiresOn apijson.Field
- Hosts apijson.Field
- Issuer apijson.Field
- ModifiedOn apijson.Field
- Priority apijson.Field
- Signature apijson.Field
- Status apijson.Field
- UploadedOn apijson.Field
- ZoneID apijson.Field
- GeoRestrictions apijson.Field
- KeylessServer apijson.Field
- Policy apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CustomCertificatePrioritizeUpdateResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r customCertificatePrioritizeUpdateResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// A ubiquitous bundle has the highest probability of being verified everywhere,
-// even by clients using outdated or unusual trust stores. An optimal bundle uses
-// the shortest chain and newest intermediates. And the force bundle verifies the
-// chain, but does not otherwise modify it.
-type CustomCertificatePrioritizeUpdateResponseBundleMethod string
-
-const (
- CustomCertificatePrioritizeUpdateResponseBundleMethodUbiquitous CustomCertificatePrioritizeUpdateResponseBundleMethod = "ubiquitous"
- CustomCertificatePrioritizeUpdateResponseBundleMethodOptimal CustomCertificatePrioritizeUpdateResponseBundleMethod = "optimal"
- CustomCertificatePrioritizeUpdateResponseBundleMethodForce CustomCertificatePrioritizeUpdateResponseBundleMethod = "force"
-)
-
-// Status of the zone's custom SSL.
-type CustomCertificatePrioritizeUpdateResponseStatus string
-
-const (
- CustomCertificatePrioritizeUpdateResponseStatusActive CustomCertificatePrioritizeUpdateResponseStatus = "active"
- CustomCertificatePrioritizeUpdateResponseStatusExpired CustomCertificatePrioritizeUpdateResponseStatus = "expired"
- CustomCertificatePrioritizeUpdateResponseStatusDeleted CustomCertificatePrioritizeUpdateResponseStatus = "deleted"
- CustomCertificatePrioritizeUpdateResponseStatusPending CustomCertificatePrioritizeUpdateResponseStatus = "pending"
- CustomCertificatePrioritizeUpdateResponseStatusInitializing CustomCertificatePrioritizeUpdateResponseStatus = "initializing"
-)
-
-// Specify the region where your private key can be held locally for optimal TLS
-// performance. HTTPS connections to any excluded data center will still be fully
-// encrypted, but will incur some latency while Keyless SSL is used to complete the
-// handshake with the nearest allowed data center. Options allow distribution to
-// only to U.S. data centers, only to E.U. data centers, or only to highest
-// security data centers. Default distribution is to all Cloudflare datacenters,
-// for optimal performance.
-type CustomCertificatePrioritizeUpdateResponseGeoRestrictions struct {
- Label CustomCertificatePrioritizeUpdateResponseGeoRestrictionsLabel `json:"label"`
- JSON customCertificatePrioritizeUpdateResponseGeoRestrictionsJSON `json:"-"`
-}
-
-// customCertificatePrioritizeUpdateResponseGeoRestrictionsJSON contains the JSON
-// metadata for the struct
-// [CustomCertificatePrioritizeUpdateResponseGeoRestrictions]
-type customCertificatePrioritizeUpdateResponseGeoRestrictionsJSON struct {
- Label apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CustomCertificatePrioritizeUpdateResponseGeoRestrictions) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r customCertificatePrioritizeUpdateResponseGeoRestrictionsJSON) RawJSON() string {
- return r.raw
-}
-
-type CustomCertificatePrioritizeUpdateResponseGeoRestrictionsLabel string
-
-const (
- CustomCertificatePrioritizeUpdateResponseGeoRestrictionsLabelUs CustomCertificatePrioritizeUpdateResponseGeoRestrictionsLabel = "us"
- CustomCertificatePrioritizeUpdateResponseGeoRestrictionsLabelEu CustomCertificatePrioritizeUpdateResponseGeoRestrictionsLabel = "eu"
- CustomCertificatePrioritizeUpdateResponseGeoRestrictionsLabelHighestSecurity CustomCertificatePrioritizeUpdateResponseGeoRestrictionsLabel = "highest_security"
-)
-
-type CustomCertificatePrioritizeUpdateResponseKeylessServer struct {
- // Keyless certificate identifier tag.
- ID string `json:"id,required"`
- // When the Keyless SSL was created.
- CreatedOn time.Time `json:"created_on,required" format:"date-time"`
- // Whether or not the Keyless SSL is on or off.
- Enabled bool `json:"enabled,required"`
- // The keyless SSL name.
- Host string `json:"host,required" format:"hostname"`
- // When the Keyless SSL was last modified.
- ModifiedOn time.Time `json:"modified_on,required" format:"date-time"`
- // The keyless SSL name.
- Name string `json:"name,required"`
- // Available permissions for the Keyless SSL for the current user requesting the
- // item.
- Permissions []interface{} `json:"permissions,required"`
- // The keyless SSL port used to communicate between Cloudflare and the client's
- // Keyless SSL server.
- Port float64 `json:"port,required"`
- // Status of the Keyless SSL.
- Status CustomCertificatePrioritizeUpdateResponseKeylessServerStatus `json:"status,required"`
- // Configuration for using Keyless SSL through a Cloudflare Tunnel
- Tunnel CustomCertificatePrioritizeUpdateResponseKeylessServerTunnel `json:"tunnel"`
- JSON customCertificatePrioritizeUpdateResponseKeylessServerJSON `json:"-"`
-}
-
-// customCertificatePrioritizeUpdateResponseKeylessServerJSON contains the JSON
-// metadata for the struct [CustomCertificatePrioritizeUpdateResponseKeylessServer]
-type customCertificatePrioritizeUpdateResponseKeylessServerJSON struct {
- ID apijson.Field
- CreatedOn apijson.Field
- Enabled apijson.Field
- Host apijson.Field
- ModifiedOn apijson.Field
- Name apijson.Field
- Permissions apijson.Field
- Port apijson.Field
- Status apijson.Field
- Tunnel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CustomCertificatePrioritizeUpdateResponseKeylessServer) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r customCertificatePrioritizeUpdateResponseKeylessServerJSON) RawJSON() string {
- return r.raw
-}
-
-// Status of the Keyless SSL.
-type CustomCertificatePrioritizeUpdateResponseKeylessServerStatus string
-
-const (
- CustomCertificatePrioritizeUpdateResponseKeylessServerStatusActive CustomCertificatePrioritizeUpdateResponseKeylessServerStatus = "active"
- CustomCertificatePrioritizeUpdateResponseKeylessServerStatusDeleted CustomCertificatePrioritizeUpdateResponseKeylessServerStatus = "deleted"
-)
-
-// Configuration for using Keyless SSL through a Cloudflare Tunnel
-type CustomCertificatePrioritizeUpdateResponseKeylessServerTunnel struct {
- // Private IP of the Key Server Host
- PrivateIP string `json:"private_ip,required"`
- // Cloudflare Tunnel Virtual Network ID
- VnetID string `json:"vnet_id,required"`
- JSON customCertificatePrioritizeUpdateResponseKeylessServerTunnelJSON `json:"-"`
-}
-
-// customCertificatePrioritizeUpdateResponseKeylessServerTunnelJSON contains the
-// JSON metadata for the struct
-// [CustomCertificatePrioritizeUpdateResponseKeylessServerTunnel]
-type customCertificatePrioritizeUpdateResponseKeylessServerTunnelJSON struct {
- PrivateIP apijson.Field
- VnetID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CustomCertificatePrioritizeUpdateResponseKeylessServerTunnel) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r customCertificatePrioritizeUpdateResponseKeylessServerTunnelJSON) RawJSON() string {
- return r.raw
-}
-
-type CustomCertificatePrioritizeUpdateParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
- // Array of ordered certificates.
- Certificates param.Field[[]CustomCertificatePrioritizeUpdateParamsCertificate] `json:"certificates,required"`
-}
-
-func (r CustomCertificatePrioritizeUpdateParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type CustomCertificatePrioritizeUpdateParamsCertificate struct {
- // The order/priority in which the certificate will be used in a request. The
- // higher priority will break ties across overlapping 'legacy_custom' certificates,
- // but 'legacy_custom' certificates will always supercede 'sni_custom'
- // certificates.
- Priority param.Field[float64] `json:"priority"`
-}
-
-func (r CustomCertificatePrioritizeUpdateParamsCertificate) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type CustomCertificatePrioritizeUpdateResponseEnvelope struct {
- Errors []CustomCertificatePrioritizeUpdateResponseEnvelopeErrors `json:"errors,required"`
- Messages []CustomCertificatePrioritizeUpdateResponseEnvelopeMessages `json:"messages,required"`
- Result []CustomCertificatePrioritizeUpdateResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success CustomCertificatePrioritizeUpdateResponseEnvelopeSuccess `json:"success,required"`
- ResultInfo CustomCertificatePrioritizeUpdateResponseEnvelopeResultInfo `json:"result_info"`
- JSON customCertificatePrioritizeUpdateResponseEnvelopeJSON `json:"-"`
-}
-
-// customCertificatePrioritizeUpdateResponseEnvelopeJSON contains the JSON metadata
-// for the struct [CustomCertificatePrioritizeUpdateResponseEnvelope]
-type customCertificatePrioritizeUpdateResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- ResultInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CustomCertificatePrioritizeUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r customCertificatePrioritizeUpdateResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type CustomCertificatePrioritizeUpdateResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON customCertificatePrioritizeUpdateResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// customCertificatePrioritizeUpdateResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct
-// [CustomCertificatePrioritizeUpdateResponseEnvelopeErrors]
-type customCertificatePrioritizeUpdateResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CustomCertificatePrioritizeUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r customCertificatePrioritizeUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type CustomCertificatePrioritizeUpdateResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON customCertificatePrioritizeUpdateResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// customCertificatePrioritizeUpdateResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct
-// [CustomCertificatePrioritizeUpdateResponseEnvelopeMessages]
-type customCertificatePrioritizeUpdateResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CustomCertificatePrioritizeUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r customCertificatePrioritizeUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type CustomCertificatePrioritizeUpdateResponseEnvelopeSuccess bool
-
-const (
- CustomCertificatePrioritizeUpdateResponseEnvelopeSuccessTrue CustomCertificatePrioritizeUpdateResponseEnvelopeSuccess = true
-)
-
-type CustomCertificatePrioritizeUpdateResponseEnvelopeResultInfo struct {
- // Total number of results for the requested service
- Count float64 `json:"count"`
- // Current page within paginated list of results
- Page float64 `json:"page"`
- // Number of results per page of results
- PerPage float64 `json:"per_page"`
- // Total results available without any search parameters
- TotalCount float64 `json:"total_count"`
- JSON customCertificatePrioritizeUpdateResponseEnvelopeResultInfoJSON `json:"-"`
-}
-
-// customCertificatePrioritizeUpdateResponseEnvelopeResultInfoJSON contains the
-// JSON metadata for the struct
-// [CustomCertificatePrioritizeUpdateResponseEnvelopeResultInfo]
-type customCertificatePrioritizeUpdateResponseEnvelopeResultInfoJSON struct {
- Count apijson.Field
- Page apijson.Field
- PerPage apijson.Field
- TotalCount apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CustomCertificatePrioritizeUpdateResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r customCertificatePrioritizeUpdateResponseEnvelopeResultInfoJSON) RawJSON() string {
- return r.raw
-}
diff --git a/customcertificateprioritize_test.go b/customcertificateprioritize_test.go
deleted file mode 100644
index f1598cc6cd1..00000000000
--- a/customcertificateprioritize_test.go
+++ /dev/null
@@ -1,45 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestCustomCertificatePrioritizeUpdate(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"),
- )
- _, err := client.CustomCertificates.Prioritize.Update(context.TODO(), cloudflare.CustomCertificatePrioritizeUpdateParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Certificates: cloudflare.F([]cloudflare.CustomCertificatePrioritizeUpdateParamsCertificate{{
- Priority: cloudflare.F(2.000000),
- }, {
- Priority: cloudflare.F(1.000000),
- }}),
- })
- 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/customhostnamefallbackorigin.go b/customhostnamefallbackorigin.go
deleted file mode 100644
index 9618af5f943..00000000000
--- a/customhostnamefallbackorigin.go
+++ /dev/null
@@ -1,394 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "reflect"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/option"
- "github.com/tidwall/gjson"
-)
-
-// CustomHostnameFallbackOriginService contains methods and other services that
-// help with interacting with the cloudflare API. Note, unlike clients, this
-// service does not read variables from the environment automatically. You should
-// not instantiate this service directly, and instead use the
-// [NewCustomHostnameFallbackOriginService] method instead.
-type CustomHostnameFallbackOriginService struct {
- Options []option.RequestOption
-}
-
-// NewCustomHostnameFallbackOriginService generates a new service that applies the
-// given options to each request. These options are applied after the parent
-// client's options (if there is one), and before any request-specific options.
-func NewCustomHostnameFallbackOriginService(opts ...option.RequestOption) (r *CustomHostnameFallbackOriginService) {
- r = &CustomHostnameFallbackOriginService{}
- r.Options = opts
- return
-}
-
-// Update Fallback Origin for Custom Hostnames
-func (r *CustomHostnameFallbackOriginService) Update(ctx context.Context, params CustomHostnameFallbackOriginUpdateParams, opts ...option.RequestOption) (res *CustomHostnameFallbackOriginUpdateResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env CustomHostnameFallbackOriginUpdateResponseEnvelope
- path := fmt.Sprintf("zones/%s/custom_hostnames/fallback_origin", params.ZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Delete Fallback Origin for Custom Hostnames
-func (r *CustomHostnameFallbackOriginService) Delete(ctx context.Context, body CustomHostnameFallbackOriginDeleteParams, opts ...option.RequestOption) (res *CustomHostnameFallbackOriginDeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env CustomHostnameFallbackOriginDeleteResponseEnvelope
- path := fmt.Sprintf("zones/%s/custom_hostnames/fallback_origin", body.ZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Get Fallback Origin for Custom Hostnames
-func (r *CustomHostnameFallbackOriginService) Get(ctx context.Context, query CustomHostnameFallbackOriginGetParams, opts ...option.RequestOption) (res *CustomHostnameFallbackOriginGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env CustomHostnameFallbackOriginGetResponseEnvelope
- path := fmt.Sprintf("zones/%s/custom_hostnames/fallback_origin", query.ZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Union satisfied by [CustomHostnameFallbackOriginUpdateResponseUnknown] or
-// [shared.UnionString].
-type CustomHostnameFallbackOriginUpdateResponse interface {
- ImplementsCustomHostnameFallbackOriginUpdateResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*CustomHostnameFallbackOriginUpdateResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-// Union satisfied by [CustomHostnameFallbackOriginDeleteResponseUnknown] or
-// [shared.UnionString].
-type CustomHostnameFallbackOriginDeleteResponse interface {
- ImplementsCustomHostnameFallbackOriginDeleteResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*CustomHostnameFallbackOriginDeleteResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-// Union satisfied by [CustomHostnameFallbackOriginGetResponseUnknown] or
-// [shared.UnionString].
-type CustomHostnameFallbackOriginGetResponse interface {
- ImplementsCustomHostnameFallbackOriginGetResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*CustomHostnameFallbackOriginGetResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-type CustomHostnameFallbackOriginUpdateParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
- // Your origin hostname that requests to your custom hostnames will be sent to.
- Origin param.Field[string] `json:"origin,required"`
-}
-
-func (r CustomHostnameFallbackOriginUpdateParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type CustomHostnameFallbackOriginUpdateResponseEnvelope struct {
- Errors []CustomHostnameFallbackOriginUpdateResponseEnvelopeErrors `json:"errors,required"`
- Messages []CustomHostnameFallbackOriginUpdateResponseEnvelopeMessages `json:"messages,required"`
- Result CustomHostnameFallbackOriginUpdateResponse `json:"result,required"`
- // Whether the API call was successful
- Success CustomHostnameFallbackOriginUpdateResponseEnvelopeSuccess `json:"success,required"`
- JSON customHostnameFallbackOriginUpdateResponseEnvelopeJSON `json:"-"`
-}
-
-// customHostnameFallbackOriginUpdateResponseEnvelopeJSON contains the JSON
-// metadata for the struct [CustomHostnameFallbackOriginUpdateResponseEnvelope]
-type customHostnameFallbackOriginUpdateResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CustomHostnameFallbackOriginUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r customHostnameFallbackOriginUpdateResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type CustomHostnameFallbackOriginUpdateResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON customHostnameFallbackOriginUpdateResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// customHostnameFallbackOriginUpdateResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct
-// [CustomHostnameFallbackOriginUpdateResponseEnvelopeErrors]
-type customHostnameFallbackOriginUpdateResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CustomHostnameFallbackOriginUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r customHostnameFallbackOriginUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type CustomHostnameFallbackOriginUpdateResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON customHostnameFallbackOriginUpdateResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// customHostnameFallbackOriginUpdateResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct
-// [CustomHostnameFallbackOriginUpdateResponseEnvelopeMessages]
-type customHostnameFallbackOriginUpdateResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CustomHostnameFallbackOriginUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r customHostnameFallbackOriginUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type CustomHostnameFallbackOriginUpdateResponseEnvelopeSuccess bool
-
-const (
- CustomHostnameFallbackOriginUpdateResponseEnvelopeSuccessTrue CustomHostnameFallbackOriginUpdateResponseEnvelopeSuccess = true
-)
-
-type CustomHostnameFallbackOriginDeleteParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
-}
-
-type CustomHostnameFallbackOriginDeleteResponseEnvelope struct {
- Errors []CustomHostnameFallbackOriginDeleteResponseEnvelopeErrors `json:"errors,required"`
- Messages []CustomHostnameFallbackOriginDeleteResponseEnvelopeMessages `json:"messages,required"`
- Result CustomHostnameFallbackOriginDeleteResponse `json:"result,required"`
- // Whether the API call was successful
- Success CustomHostnameFallbackOriginDeleteResponseEnvelopeSuccess `json:"success,required"`
- JSON customHostnameFallbackOriginDeleteResponseEnvelopeJSON `json:"-"`
-}
-
-// customHostnameFallbackOriginDeleteResponseEnvelopeJSON contains the JSON
-// metadata for the struct [CustomHostnameFallbackOriginDeleteResponseEnvelope]
-type customHostnameFallbackOriginDeleteResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CustomHostnameFallbackOriginDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r customHostnameFallbackOriginDeleteResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type CustomHostnameFallbackOriginDeleteResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON customHostnameFallbackOriginDeleteResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// customHostnameFallbackOriginDeleteResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct
-// [CustomHostnameFallbackOriginDeleteResponseEnvelopeErrors]
-type customHostnameFallbackOriginDeleteResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CustomHostnameFallbackOriginDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r customHostnameFallbackOriginDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type CustomHostnameFallbackOriginDeleteResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON customHostnameFallbackOriginDeleteResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// customHostnameFallbackOriginDeleteResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct
-// [CustomHostnameFallbackOriginDeleteResponseEnvelopeMessages]
-type customHostnameFallbackOriginDeleteResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CustomHostnameFallbackOriginDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r customHostnameFallbackOriginDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type CustomHostnameFallbackOriginDeleteResponseEnvelopeSuccess bool
-
-const (
- CustomHostnameFallbackOriginDeleteResponseEnvelopeSuccessTrue CustomHostnameFallbackOriginDeleteResponseEnvelopeSuccess = true
-)
-
-type CustomHostnameFallbackOriginGetParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
-}
-
-type CustomHostnameFallbackOriginGetResponseEnvelope struct {
- Errors []CustomHostnameFallbackOriginGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []CustomHostnameFallbackOriginGetResponseEnvelopeMessages `json:"messages,required"`
- Result CustomHostnameFallbackOriginGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success CustomHostnameFallbackOriginGetResponseEnvelopeSuccess `json:"success,required"`
- JSON customHostnameFallbackOriginGetResponseEnvelopeJSON `json:"-"`
-}
-
-// customHostnameFallbackOriginGetResponseEnvelopeJSON contains the JSON metadata
-// for the struct [CustomHostnameFallbackOriginGetResponseEnvelope]
-type customHostnameFallbackOriginGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CustomHostnameFallbackOriginGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r customHostnameFallbackOriginGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type CustomHostnameFallbackOriginGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON customHostnameFallbackOriginGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// customHostnameFallbackOriginGetResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct [CustomHostnameFallbackOriginGetResponseEnvelopeErrors]
-type customHostnameFallbackOriginGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CustomHostnameFallbackOriginGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r customHostnameFallbackOriginGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type CustomHostnameFallbackOriginGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON customHostnameFallbackOriginGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// customHostnameFallbackOriginGetResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct
-// [CustomHostnameFallbackOriginGetResponseEnvelopeMessages]
-type customHostnameFallbackOriginGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CustomHostnameFallbackOriginGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r customHostnameFallbackOriginGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type CustomHostnameFallbackOriginGetResponseEnvelopeSuccess bool
-
-const (
- CustomHostnameFallbackOriginGetResponseEnvelopeSuccessTrue CustomHostnameFallbackOriginGetResponseEnvelopeSuccess = true
-)
diff --git a/customhostnamefallbackorigin_test.go b/customhostnamefallbackorigin_test.go
deleted file mode 100644
index ae0992cdb1e..00000000000
--- a/customhostnamefallbackorigin_test.go
+++ /dev/null
@@ -1,93 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestCustomHostnameFallbackOriginUpdate(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"),
- )
- _, err := client.CustomHostnames.FallbackOrigin.Update(context.TODO(), cloudflare.CustomHostnameFallbackOriginUpdateParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Origin: cloudflare.F("fallback.example.com"),
- })
- 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())
- }
-}
-
-func TestCustomHostnameFallbackOriginDelete(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"),
- )
- _, err := client.CustomHostnames.FallbackOrigin.Delete(context.TODO(), cloudflare.CustomHostnameFallbackOriginDeleteParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- })
- 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())
- }
-}
-
-func TestCustomHostnameFallbackOriginGet(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"),
- )
- _, err := client.CustomHostnames.FallbackOrigin.Get(context.TODO(), cloudflare.CustomHostnameFallbackOriginGetParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- })
- 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/customnameserver.go b/customnameserver.go
deleted file mode 100644
index 2d3cf9dee96..00000000000
--- a/customnameserver.go
+++ /dev/null
@@ -1,927 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "reflect"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/option"
- "github.com/tidwall/gjson"
-)
-
-// CustomNameserverService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewCustomNameserverService] method
-// instead.
-type CustomNameserverService struct {
- Options []option.RequestOption
-}
-
-// NewCustomNameserverService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewCustomNameserverService(opts ...option.RequestOption) (r *CustomNameserverService) {
- r = &CustomNameserverService{}
- r.Options = opts
- return
-}
-
-// Add Account Custom Nameserver
-func (r *CustomNameserverService) New(ctx context.Context, params CustomNameserverNewParams, opts ...option.RequestOption) (res *CustomNameserverNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env CustomNameserverNewResponseEnvelope
- path := fmt.Sprintf("accounts/%s/custom_ns", params.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Delete Account Custom Nameserver
-func (r *CustomNameserverService) Delete(ctx context.Context, customNSID string, body CustomNameserverDeleteParams, opts ...option.RequestOption) (res *CustomNameserverDeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env CustomNameserverDeleteResponseEnvelope
- path := fmt.Sprintf("accounts/%s/custom_ns/%s", body.AccountID, customNSID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Get Eligible Zones for Account Custom Nameservers
-func (r *CustomNameserverService) Availabilty(ctx context.Context, query CustomNameserverAvailabiltyParams, opts ...option.RequestOption) (res *[]string, err error) {
- opts = append(r.Options[:], opts...)
- var env CustomNameserverAvailabiltyResponseEnvelope
- path := fmt.Sprintf("accounts/%s/custom_ns/availability", query.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// List an account's custom nameservers.
-func (r *CustomNameserverService) Get(ctx context.Context, query CustomNameserverGetParams, opts ...option.RequestOption) (res *[]CustomNameserverGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env CustomNameserverGetResponseEnvelope
- path := fmt.Sprintf("accounts/%s/custom_ns", query.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Verify Account Custom Nameserver Glue Records
-func (r *CustomNameserverService) Verify(ctx context.Context, body CustomNameserverVerifyParams, opts ...option.RequestOption) (res *[]CustomNameserverVerifyResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env CustomNameserverVerifyResponseEnvelope
- path := fmt.Sprintf("accounts/%s/custom_ns/verify", body.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// A single account custom nameserver.
-type CustomNameserverNewResponse struct {
- // A and AAAA records associated with the nameserver.
- DNSRecords []CustomNameserverNewResponseDNSRecord `json:"dns_records,required"`
- // The FQDN of the name server.
- NSName string `json:"ns_name,required" format:"hostname"`
- // Verification status of the nameserver.
- Status CustomNameserverNewResponseStatus `json:"status,required"`
- // Identifier
- ZoneTag string `json:"zone_tag,required"`
- // The number of the set that this name server belongs to.
- NSSet float64 `json:"ns_set"`
- JSON customNameserverNewResponseJSON `json:"-"`
-}
-
-// customNameserverNewResponseJSON contains the JSON metadata for the struct
-// [CustomNameserverNewResponse]
-type customNameserverNewResponseJSON struct {
- DNSRecords apijson.Field
- NSName apijson.Field
- Status apijson.Field
- ZoneTag apijson.Field
- NSSet apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CustomNameserverNewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r customNameserverNewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type CustomNameserverNewResponseDNSRecord struct {
- // DNS record type.
- Type CustomNameserverNewResponseDNSRecordsType `json:"type"`
- // DNS record contents (an IPv4 or IPv6 address).
- Value string `json:"value"`
- JSON customNameserverNewResponseDNSRecordJSON `json:"-"`
-}
-
-// customNameserverNewResponseDNSRecordJSON contains the JSON metadata for the
-// struct [CustomNameserverNewResponseDNSRecord]
-type customNameserverNewResponseDNSRecordJSON struct {
- Type apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CustomNameserverNewResponseDNSRecord) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r customNameserverNewResponseDNSRecordJSON) RawJSON() string {
- return r.raw
-}
-
-// DNS record type.
-type CustomNameserverNewResponseDNSRecordsType string
-
-const (
- CustomNameserverNewResponseDNSRecordsTypeA CustomNameserverNewResponseDNSRecordsType = "A"
- CustomNameserverNewResponseDNSRecordsTypeAAAA CustomNameserverNewResponseDNSRecordsType = "AAAA"
-)
-
-// Verification status of the nameserver.
-type CustomNameserverNewResponseStatus string
-
-const (
- CustomNameserverNewResponseStatusMoved CustomNameserverNewResponseStatus = "moved"
- CustomNameserverNewResponseStatusPending CustomNameserverNewResponseStatus = "pending"
- CustomNameserverNewResponseStatusVerified CustomNameserverNewResponseStatus = "verified"
-)
-
-// Union satisfied by [CustomNameserverDeleteResponseUnknown],
-// [CustomNameserverDeleteResponseArray] or [shared.UnionString].
-type CustomNameserverDeleteResponse interface {
- ImplementsCustomNameserverDeleteResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*CustomNameserverDeleteResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(CustomNameserverDeleteResponseArray{}),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-type CustomNameserverDeleteResponseArray []interface{}
-
-func (r CustomNameserverDeleteResponseArray) ImplementsCustomNameserverDeleteResponse() {}
-
-// A single account custom nameserver.
-type CustomNameserverGetResponse struct {
- // A and AAAA records associated with the nameserver.
- DNSRecords []CustomNameserverGetResponseDNSRecord `json:"dns_records,required"`
- // The FQDN of the name server.
- NSName string `json:"ns_name,required" format:"hostname"`
- // Verification status of the nameserver.
- Status CustomNameserverGetResponseStatus `json:"status,required"`
- // Identifier
- ZoneTag string `json:"zone_tag,required"`
- // The number of the set that this name server belongs to.
- NSSet float64 `json:"ns_set"`
- JSON customNameserverGetResponseJSON `json:"-"`
-}
-
-// customNameserverGetResponseJSON contains the JSON metadata for the struct
-// [CustomNameserverGetResponse]
-type customNameserverGetResponseJSON struct {
- DNSRecords apijson.Field
- NSName apijson.Field
- Status apijson.Field
- ZoneTag apijson.Field
- NSSet apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CustomNameserverGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r customNameserverGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type CustomNameserverGetResponseDNSRecord struct {
- // DNS record type.
- Type CustomNameserverGetResponseDNSRecordsType `json:"type"`
- // DNS record contents (an IPv4 or IPv6 address).
- Value string `json:"value"`
- JSON customNameserverGetResponseDNSRecordJSON `json:"-"`
-}
-
-// customNameserverGetResponseDNSRecordJSON contains the JSON metadata for the
-// struct [CustomNameserverGetResponseDNSRecord]
-type customNameserverGetResponseDNSRecordJSON struct {
- Type apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CustomNameserverGetResponseDNSRecord) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r customNameserverGetResponseDNSRecordJSON) RawJSON() string {
- return r.raw
-}
-
-// DNS record type.
-type CustomNameserverGetResponseDNSRecordsType string
-
-const (
- CustomNameserverGetResponseDNSRecordsTypeA CustomNameserverGetResponseDNSRecordsType = "A"
- CustomNameserverGetResponseDNSRecordsTypeAAAA CustomNameserverGetResponseDNSRecordsType = "AAAA"
-)
-
-// Verification status of the nameserver.
-type CustomNameserverGetResponseStatus string
-
-const (
- CustomNameserverGetResponseStatusMoved CustomNameserverGetResponseStatus = "moved"
- CustomNameserverGetResponseStatusPending CustomNameserverGetResponseStatus = "pending"
- CustomNameserverGetResponseStatusVerified CustomNameserverGetResponseStatus = "verified"
-)
-
-// A single account custom nameserver.
-type CustomNameserverVerifyResponse struct {
- // A and AAAA records associated with the nameserver.
- DNSRecords []CustomNameserverVerifyResponseDNSRecord `json:"dns_records,required"`
- // The FQDN of the name server.
- NSName string `json:"ns_name,required" format:"hostname"`
- // Verification status of the nameserver.
- Status CustomNameserverVerifyResponseStatus `json:"status,required"`
- // Identifier
- ZoneTag string `json:"zone_tag,required"`
- // The number of the set that this name server belongs to.
- NSSet float64 `json:"ns_set"`
- JSON customNameserverVerifyResponseJSON `json:"-"`
-}
-
-// customNameserverVerifyResponseJSON contains the JSON metadata for the struct
-// [CustomNameserverVerifyResponse]
-type customNameserverVerifyResponseJSON struct {
- DNSRecords apijson.Field
- NSName apijson.Field
- Status apijson.Field
- ZoneTag apijson.Field
- NSSet apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CustomNameserverVerifyResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r customNameserverVerifyResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type CustomNameserverVerifyResponseDNSRecord struct {
- // DNS record type.
- Type CustomNameserverVerifyResponseDNSRecordsType `json:"type"`
- // DNS record contents (an IPv4 or IPv6 address).
- Value string `json:"value"`
- JSON customNameserverVerifyResponseDNSRecordJSON `json:"-"`
-}
-
-// customNameserverVerifyResponseDNSRecordJSON contains the JSON metadata for the
-// struct [CustomNameserverVerifyResponseDNSRecord]
-type customNameserverVerifyResponseDNSRecordJSON struct {
- Type apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CustomNameserverVerifyResponseDNSRecord) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r customNameserverVerifyResponseDNSRecordJSON) RawJSON() string {
- return r.raw
-}
-
-// DNS record type.
-type CustomNameserverVerifyResponseDNSRecordsType string
-
-const (
- CustomNameserverVerifyResponseDNSRecordsTypeA CustomNameserverVerifyResponseDNSRecordsType = "A"
- CustomNameserverVerifyResponseDNSRecordsTypeAAAA CustomNameserverVerifyResponseDNSRecordsType = "AAAA"
-)
-
-// Verification status of the nameserver.
-type CustomNameserverVerifyResponseStatus string
-
-const (
- CustomNameserverVerifyResponseStatusMoved CustomNameserverVerifyResponseStatus = "moved"
- CustomNameserverVerifyResponseStatusPending CustomNameserverVerifyResponseStatus = "pending"
- CustomNameserverVerifyResponseStatusVerified CustomNameserverVerifyResponseStatus = "verified"
-)
-
-type CustomNameserverNewParams struct {
- // Account identifier tag.
- AccountID param.Field[string] `path:"account_id,required"`
- // The FQDN of the name server.
- NSName param.Field[string] `json:"ns_name,required" format:"hostname"`
- // The number of the set that this name server belongs to.
- NSSet param.Field[float64] `json:"ns_set"`
-}
-
-func (r CustomNameserverNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type CustomNameserverNewResponseEnvelope struct {
- Errors []CustomNameserverNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []CustomNameserverNewResponseEnvelopeMessages `json:"messages,required"`
- // A single account custom nameserver.
- Result CustomNameserverNewResponse `json:"result,required"`
- // Whether the API call was successful
- Success CustomNameserverNewResponseEnvelopeSuccess `json:"success,required"`
- JSON customNameserverNewResponseEnvelopeJSON `json:"-"`
-}
-
-// customNameserverNewResponseEnvelopeJSON contains the JSON metadata for the
-// struct [CustomNameserverNewResponseEnvelope]
-type customNameserverNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CustomNameserverNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r customNameserverNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type CustomNameserverNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON customNameserverNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// customNameserverNewResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [CustomNameserverNewResponseEnvelopeErrors]
-type customNameserverNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CustomNameserverNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r customNameserverNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type CustomNameserverNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON customNameserverNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// customNameserverNewResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [CustomNameserverNewResponseEnvelopeMessages]
-type customNameserverNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CustomNameserverNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r customNameserverNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type CustomNameserverNewResponseEnvelopeSuccess bool
-
-const (
- CustomNameserverNewResponseEnvelopeSuccessTrue CustomNameserverNewResponseEnvelopeSuccess = true
-)
-
-type CustomNameserverDeleteParams struct {
- // Account identifier tag.
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type CustomNameserverDeleteResponseEnvelope struct {
- Errors []CustomNameserverDeleteResponseEnvelopeErrors `json:"errors,required"`
- Messages []CustomNameserverDeleteResponseEnvelopeMessages `json:"messages,required"`
- Result CustomNameserverDeleteResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success CustomNameserverDeleteResponseEnvelopeSuccess `json:"success,required"`
- ResultInfo CustomNameserverDeleteResponseEnvelopeResultInfo `json:"result_info"`
- JSON customNameserverDeleteResponseEnvelopeJSON `json:"-"`
-}
-
-// customNameserverDeleteResponseEnvelopeJSON contains the JSON metadata for the
-// struct [CustomNameserverDeleteResponseEnvelope]
-type customNameserverDeleteResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- ResultInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CustomNameserverDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r customNameserverDeleteResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type CustomNameserverDeleteResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON customNameserverDeleteResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// customNameserverDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [CustomNameserverDeleteResponseEnvelopeErrors]
-type customNameserverDeleteResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CustomNameserverDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r customNameserverDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type CustomNameserverDeleteResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON customNameserverDeleteResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// customNameserverDeleteResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [CustomNameserverDeleteResponseEnvelopeMessages]
-type customNameserverDeleteResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CustomNameserverDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r customNameserverDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type CustomNameserverDeleteResponseEnvelopeSuccess bool
-
-const (
- CustomNameserverDeleteResponseEnvelopeSuccessTrue CustomNameserverDeleteResponseEnvelopeSuccess = true
-)
-
-type CustomNameserverDeleteResponseEnvelopeResultInfo struct {
- // Total number of results for the requested service
- Count float64 `json:"count"`
- // Current page within paginated list of results
- Page float64 `json:"page"`
- // Number of results per page of results
- PerPage float64 `json:"per_page"`
- // Total results available without any search parameters
- TotalCount float64 `json:"total_count"`
- JSON customNameserverDeleteResponseEnvelopeResultInfoJSON `json:"-"`
-}
-
-// customNameserverDeleteResponseEnvelopeResultInfoJSON contains the JSON metadata
-// for the struct [CustomNameserverDeleteResponseEnvelopeResultInfo]
-type customNameserverDeleteResponseEnvelopeResultInfoJSON struct {
- Count apijson.Field
- Page apijson.Field
- PerPage apijson.Field
- TotalCount apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CustomNameserverDeleteResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r customNameserverDeleteResponseEnvelopeResultInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type CustomNameserverAvailabiltyParams struct {
- // Account identifier tag.
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type CustomNameserverAvailabiltyResponseEnvelope struct {
- Errors []CustomNameserverAvailabiltyResponseEnvelopeErrors `json:"errors,required"`
- Messages []CustomNameserverAvailabiltyResponseEnvelopeMessages `json:"messages,required"`
- Result []string `json:"result,required,nullable" format:"hostname"`
- // Whether the API call was successful
- Success CustomNameserverAvailabiltyResponseEnvelopeSuccess `json:"success,required"`
- ResultInfo CustomNameserverAvailabiltyResponseEnvelopeResultInfo `json:"result_info"`
- JSON customNameserverAvailabiltyResponseEnvelopeJSON `json:"-"`
-}
-
-// customNameserverAvailabiltyResponseEnvelopeJSON contains the JSON metadata for
-// the struct [CustomNameserverAvailabiltyResponseEnvelope]
-type customNameserverAvailabiltyResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- ResultInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CustomNameserverAvailabiltyResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r customNameserverAvailabiltyResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type CustomNameserverAvailabiltyResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON customNameserverAvailabiltyResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// customNameserverAvailabiltyResponseEnvelopeErrorsJSON contains the JSON metadata
-// for the struct [CustomNameserverAvailabiltyResponseEnvelopeErrors]
-type customNameserverAvailabiltyResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CustomNameserverAvailabiltyResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r customNameserverAvailabiltyResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type CustomNameserverAvailabiltyResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON customNameserverAvailabiltyResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// customNameserverAvailabiltyResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct [CustomNameserverAvailabiltyResponseEnvelopeMessages]
-type customNameserverAvailabiltyResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CustomNameserverAvailabiltyResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r customNameserverAvailabiltyResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type CustomNameserverAvailabiltyResponseEnvelopeSuccess bool
-
-const (
- CustomNameserverAvailabiltyResponseEnvelopeSuccessTrue CustomNameserverAvailabiltyResponseEnvelopeSuccess = true
-)
-
-type CustomNameserverAvailabiltyResponseEnvelopeResultInfo struct {
- // Total number of results for the requested service
- Count float64 `json:"count"`
- // Current page within paginated list of results
- Page float64 `json:"page"`
- // Number of results per page of results
- PerPage float64 `json:"per_page"`
- // Total results available without any search parameters
- TotalCount float64 `json:"total_count"`
- JSON customNameserverAvailabiltyResponseEnvelopeResultInfoJSON `json:"-"`
-}
-
-// customNameserverAvailabiltyResponseEnvelopeResultInfoJSON contains the JSON
-// metadata for the struct [CustomNameserverAvailabiltyResponseEnvelopeResultInfo]
-type customNameserverAvailabiltyResponseEnvelopeResultInfoJSON struct {
- Count apijson.Field
- Page apijson.Field
- PerPage apijson.Field
- TotalCount apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CustomNameserverAvailabiltyResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r customNameserverAvailabiltyResponseEnvelopeResultInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type CustomNameserverGetParams struct {
- // Account identifier tag.
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type CustomNameserverGetResponseEnvelope struct {
- Errors []CustomNameserverGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []CustomNameserverGetResponseEnvelopeMessages `json:"messages,required"`
- Result []CustomNameserverGetResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success CustomNameserverGetResponseEnvelopeSuccess `json:"success,required"`
- ResultInfo CustomNameserverGetResponseEnvelopeResultInfo `json:"result_info"`
- JSON customNameserverGetResponseEnvelopeJSON `json:"-"`
-}
-
-// customNameserverGetResponseEnvelopeJSON contains the JSON metadata for the
-// struct [CustomNameserverGetResponseEnvelope]
-type customNameserverGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- ResultInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CustomNameserverGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r customNameserverGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type CustomNameserverGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON customNameserverGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// customNameserverGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [CustomNameserverGetResponseEnvelopeErrors]
-type customNameserverGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CustomNameserverGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r customNameserverGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type CustomNameserverGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON customNameserverGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// customNameserverGetResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [CustomNameserverGetResponseEnvelopeMessages]
-type customNameserverGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CustomNameserverGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r customNameserverGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type CustomNameserverGetResponseEnvelopeSuccess bool
-
-const (
- CustomNameserverGetResponseEnvelopeSuccessTrue CustomNameserverGetResponseEnvelopeSuccess = true
-)
-
-type CustomNameserverGetResponseEnvelopeResultInfo struct {
- // Total number of results for the requested service
- Count float64 `json:"count"`
- // Current page within paginated list of results
- Page float64 `json:"page"`
- // Number of results per page of results
- PerPage float64 `json:"per_page"`
- // Total results available without any search parameters
- TotalCount float64 `json:"total_count"`
- JSON customNameserverGetResponseEnvelopeResultInfoJSON `json:"-"`
-}
-
-// customNameserverGetResponseEnvelopeResultInfoJSON contains the JSON metadata for
-// the struct [CustomNameserverGetResponseEnvelopeResultInfo]
-type customNameserverGetResponseEnvelopeResultInfoJSON struct {
- Count apijson.Field
- Page apijson.Field
- PerPage apijson.Field
- TotalCount apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CustomNameserverGetResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r customNameserverGetResponseEnvelopeResultInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type CustomNameserverVerifyParams struct {
- // Account identifier tag.
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type CustomNameserverVerifyResponseEnvelope struct {
- Errors []CustomNameserverVerifyResponseEnvelopeErrors `json:"errors,required"`
- Messages []CustomNameserverVerifyResponseEnvelopeMessages `json:"messages,required"`
- Result []CustomNameserverVerifyResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success CustomNameserverVerifyResponseEnvelopeSuccess `json:"success,required"`
- ResultInfo CustomNameserverVerifyResponseEnvelopeResultInfo `json:"result_info"`
- JSON customNameserverVerifyResponseEnvelopeJSON `json:"-"`
-}
-
-// customNameserverVerifyResponseEnvelopeJSON contains the JSON metadata for the
-// struct [CustomNameserverVerifyResponseEnvelope]
-type customNameserverVerifyResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- ResultInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CustomNameserverVerifyResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r customNameserverVerifyResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type CustomNameserverVerifyResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON customNameserverVerifyResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// customNameserverVerifyResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [CustomNameserverVerifyResponseEnvelopeErrors]
-type customNameserverVerifyResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CustomNameserverVerifyResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r customNameserverVerifyResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type CustomNameserverVerifyResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON customNameserverVerifyResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// customNameserverVerifyResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [CustomNameserverVerifyResponseEnvelopeMessages]
-type customNameserverVerifyResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CustomNameserverVerifyResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r customNameserverVerifyResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type CustomNameserverVerifyResponseEnvelopeSuccess bool
-
-const (
- CustomNameserverVerifyResponseEnvelopeSuccessTrue CustomNameserverVerifyResponseEnvelopeSuccess = true
-)
-
-type CustomNameserverVerifyResponseEnvelopeResultInfo struct {
- // Total number of results for the requested service
- Count float64 `json:"count"`
- // Current page within paginated list of results
- Page float64 `json:"page"`
- // Number of results per page of results
- PerPage float64 `json:"per_page"`
- // Total results available without any search parameters
- TotalCount float64 `json:"total_count"`
- JSON customNameserverVerifyResponseEnvelopeResultInfoJSON `json:"-"`
-}
-
-// customNameserverVerifyResponseEnvelopeResultInfoJSON contains the JSON metadata
-// for the struct [CustomNameserverVerifyResponseEnvelopeResultInfo]
-type customNameserverVerifyResponseEnvelopeResultInfoJSON struct {
- Count apijson.Field
- Page apijson.Field
- PerPage apijson.Field
- TotalCount apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *CustomNameserverVerifyResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r customNameserverVerifyResponseEnvelopeResultInfoJSON) RawJSON() string {
- return r.raw
-}
diff --git a/customnameserver_test.go b/customnameserver_test.go
deleted file mode 100644
index 2e657317c8d..00000000000
--- a/customnameserver_test.go
+++ /dev/null
@@ -1,150 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestCustomNameserverNewWithOptionalParams(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"),
- )
- _, err := client.CustomNameservers.New(context.TODO(), cloudflare.CustomNameserverNewParams{
- AccountID: cloudflare.F("372e67954025e0ba6aaa6d586b9e0b59"),
- NSName: cloudflare.F("ns1.example.com"),
- NSSet: cloudflare.F(1.000000),
- })
- 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())
- }
-}
-
-func TestCustomNameserverDelete(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"),
- )
- _, err := client.CustomNameservers.Delete(
- context.TODO(),
- "ns1.example.com",
- cloudflare.CustomNameserverDeleteParams{
- AccountID: cloudflare.F("372e67954025e0ba6aaa6d586b9e0b59"),
- },
- )
- 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())
- }
-}
-
-func TestCustomNameserverAvailabilty(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"),
- )
- _, err := client.CustomNameservers.Availabilty(context.TODO(), cloudflare.CustomNameserverAvailabiltyParams{
- AccountID: cloudflare.F("372e67954025e0ba6aaa6d586b9e0b59"),
- })
- 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())
- }
-}
-
-func TestCustomNameserverGet(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"),
- )
- _, err := client.CustomNameservers.Get(context.TODO(), cloudflare.CustomNameserverGetParams{
- AccountID: cloudflare.F("372e67954025e0ba6aaa6d586b9e0b59"),
- })
- 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())
- }
-}
-
-func TestCustomNameserverVerify(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"),
- )
- _, err := client.CustomNameservers.Verify(context.TODO(), cloudflare.CustomNameserverVerifyParams{
- AccountID: cloudflare.F("372e67954025e0ba6aaa6d586b9e0b59"),
- })
- 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/d1/aliases.go b/d1/aliases.go
new file mode 100644
index 00000000000..6d6c5a665f5
--- /dev/null
+++ b/d1/aliases.go
@@ -0,0 +1,9 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package d1
+
+import (
+ "github.com/cloudflare/cloudflare-go/internal/apierror"
+)
+
+type Error = apierror.Error
diff --git a/d1.go b/d1/d1.go
similarity index 89%
rename from d1.go
rename to d1/d1.go
index 47eaf321399..35b2f7c34ef 100644
--- a/d1.go
+++ b/d1/d1.go
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package cloudflare
+package d1
import (
"github.com/cloudflare/cloudflare-go/option"
@@ -12,7 +12,7 @@ import (
// directly, and instead use the [NewD1Service] method instead.
type D1Service struct {
Options []option.RequestOption
- Database *D1DatabaseService
+ Database *DatabaseService
}
// NewD1Service generates a new service that applies the given options to each
@@ -21,6 +21,6 @@ type D1Service struct {
func NewD1Service(opts ...option.RequestOption) (r *D1Service) {
r = &D1Service{}
r.Options = opts
- r.Database = NewD1DatabaseService(opts...)
+ r.Database = NewDatabaseService(opts...)
return
}
diff --git a/d1/database.go b/d1/database.go
new file mode 100644
index 00000000000..18e8fafa25c
--- /dev/null
+++ b/d1/database.go
@@ -0,0 +1,607 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package d1
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+ "reflect"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/tidwall/gjson"
+)
+
+// DatabaseService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewDatabaseService] method instead.
+type DatabaseService struct {
+ Options []option.RequestOption
+}
+
+// NewDatabaseService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewDatabaseService(opts ...option.RequestOption) (r *DatabaseService) {
+ r = &DatabaseService{}
+ r.Options = opts
+ return
+}
+
+// Returns the created D1 database.
+func (r *DatabaseService) New(ctx context.Context, params DatabaseNewParams, opts ...option.RequestOption) (res *D1CreateDatabase, err error) {
+ opts = append(r.Options[:], opts...)
+ var env DatabaseNewResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/d1/database", params.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Returns a list of D1 databases.
+func (r *DatabaseService) List(ctx context.Context, params DatabaseListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[D1CreateDatabase], err error) {
+ var raw *http.Response
+ opts = append(r.Options, opts...)
+ opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
+ path := fmt.Sprintf("accounts/%s/d1/database", params.AccountID)
+ cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, params, &res, opts...)
+ if err != nil {
+ return nil, err
+ }
+ err = cfg.Execute()
+ if err != nil {
+ return nil, err
+ }
+ res.SetPageConfig(cfg, raw)
+ return res, nil
+}
+
+// Returns a list of D1 databases.
+func (r *DatabaseService) ListAutoPaging(ctx context.Context, params DatabaseListParams, opts ...option.RequestOption) *shared.V4PagePaginationArrayAutoPager[D1CreateDatabase] {
+ return shared.NewV4PagePaginationArrayAutoPager(r.List(ctx, params, opts...))
+}
+
+// Deletes the specified D1 database.
+func (r *DatabaseService) Delete(ctx context.Context, accountIdentifier string, databaseIdentifier string, opts ...option.RequestOption) (res *DatabaseDeleteResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env DatabaseDeleteResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/d1/database/%s", accountIdentifier, databaseIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Returns the specified D1 database.
+func (r *DatabaseService) Get(ctx context.Context, accountIdentifier string, databaseIdentifier string, opts ...option.RequestOption) (res *D1DatabaseDetails, err error) {
+ opts = append(r.Options[:], opts...)
+ var env DatabaseGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/d1/database/%s", accountIdentifier, databaseIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Returns the query result.
+func (r *DatabaseService) Query(ctx context.Context, accountIdentifier string, databaseIdentifier string, body DatabaseQueryParams, opts ...option.RequestOption) (res *[]D1QueryResult, err error) {
+ opts = append(r.Options[:], opts...)
+ var env DatabaseQueryResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/d1/database/%s/query", accountIdentifier, databaseIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type D1CreateDatabase struct {
+ // Specifies the timestamp the resource was created as an ISO8601 string.
+ CreatedAt interface{} `json:"created_at"`
+ Name string `json:"name"`
+ UUID string `json:"uuid"`
+ Version string `json:"version"`
+ JSON d1CreateDatabaseJSON `json:"-"`
+}
+
+// d1CreateDatabaseJSON contains the JSON metadata for the struct
+// [D1CreateDatabase]
+type d1CreateDatabaseJSON struct {
+ CreatedAt apijson.Field
+ Name apijson.Field
+ UUID apijson.Field
+ Version apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *D1CreateDatabase) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r d1CreateDatabaseJSON) RawJSON() string {
+ return r.raw
+}
+
+type D1DatabaseDetails struct {
+ // Specifies the timestamp the resource was created as an ISO8601 string.
+ CreatedAt interface{} `json:"created_at"`
+ // The D1 database's size, in bytes.
+ FileSize float64 `json:"file_size"`
+ Name string `json:"name"`
+ NumTables float64 `json:"num_tables"`
+ UUID string `json:"uuid"`
+ Version string `json:"version"`
+ JSON d1DatabaseDetailsJSON `json:"-"`
+}
+
+// d1DatabaseDetailsJSON contains the JSON metadata for the struct
+// [D1DatabaseDetails]
+type d1DatabaseDetailsJSON struct {
+ CreatedAt apijson.Field
+ FileSize apijson.Field
+ Name apijson.Field
+ NumTables apijson.Field
+ UUID apijson.Field
+ Version apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *D1DatabaseDetails) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r d1DatabaseDetailsJSON) RawJSON() string {
+ return r.raw
+}
+
+type D1QueryResult struct {
+ Meta D1QueryResultMeta `json:"meta"`
+ Results []interface{} `json:"results"`
+ Success bool `json:"success"`
+ JSON d1QueryResultJSON `json:"-"`
+}
+
+// d1QueryResultJSON contains the JSON metadata for the struct [D1QueryResult]
+type d1QueryResultJSON struct {
+ Meta apijson.Field
+ Results apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *D1QueryResult) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r d1QueryResultJSON) RawJSON() string {
+ return r.raw
+}
+
+type D1QueryResultMeta struct {
+ ChangedDB bool `json:"changed_db"`
+ Changes float64 `json:"changes"`
+ Duration float64 `json:"duration"`
+ LastRowID float64 `json:"last_row_id"`
+ RowsRead float64 `json:"rows_read"`
+ RowsWritten float64 `json:"rows_written"`
+ SizeAfter float64 `json:"size_after"`
+ JSON d1QueryResultMetaJSON `json:"-"`
+}
+
+// d1QueryResultMetaJSON contains the JSON metadata for the struct
+// [D1QueryResultMeta]
+type d1QueryResultMetaJSON struct {
+ ChangedDB apijson.Field
+ Changes apijson.Field
+ Duration apijson.Field
+ LastRowID apijson.Field
+ RowsRead apijson.Field
+ RowsWritten apijson.Field
+ SizeAfter apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *D1QueryResultMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r d1QueryResultMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Union satisfied by [d1.DatabaseDeleteResponseUnknown] or [shared.UnionString].
+type DatabaseDeleteResponse interface {
+ ImplementsD1DatabaseDeleteResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*DatabaseDeleteResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+type DatabaseNewParams struct {
+ // Account identifier tag.
+ AccountID param.Field[string] `path:"account_id,required"`
+ Name param.Field[string] `json:"name,required"`
+}
+
+func (r DatabaseNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type DatabaseNewResponseEnvelope struct {
+ Errors []DatabaseNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []DatabaseNewResponseEnvelopeMessages `json:"messages,required"`
+ Result D1CreateDatabase `json:"result,required"`
+ // Whether the API call was successful
+ Success DatabaseNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON databaseNewResponseEnvelopeJSON `json:"-"`
+}
+
+// databaseNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [DatabaseNewResponseEnvelope]
+type databaseNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DatabaseNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r databaseNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type DatabaseNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON databaseNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// databaseNewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [DatabaseNewResponseEnvelopeErrors]
+type databaseNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DatabaseNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r databaseNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type DatabaseNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON databaseNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// databaseNewResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [DatabaseNewResponseEnvelopeMessages]
+type databaseNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DatabaseNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r databaseNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type DatabaseNewResponseEnvelopeSuccess bool
+
+const (
+ DatabaseNewResponseEnvelopeSuccessTrue DatabaseNewResponseEnvelopeSuccess = true
+)
+
+type DatabaseListParams struct {
+ // Account identifier tag.
+ AccountID param.Field[string] `path:"account_id,required"`
+ // a database name to search for.
+ Name param.Field[string] `query:"name"`
+ // Page number of paginated results.
+ Page param.Field[float64] `query:"page"`
+ // Number of items per page.
+ PerPage param.Field[float64] `query:"per_page"`
+}
+
+// URLQuery serializes [DatabaseListParams]'s query parameters as `url.Values`.
+func (r DatabaseListParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type DatabaseDeleteResponseEnvelope struct {
+ Errors []DatabaseDeleteResponseEnvelopeErrors `json:"errors,required"`
+ Messages []DatabaseDeleteResponseEnvelopeMessages `json:"messages,required"`
+ Result DatabaseDeleteResponse `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success DatabaseDeleteResponseEnvelopeSuccess `json:"success,required"`
+ JSON databaseDeleteResponseEnvelopeJSON `json:"-"`
+}
+
+// databaseDeleteResponseEnvelopeJSON contains the JSON metadata for the struct
+// [DatabaseDeleteResponseEnvelope]
+type databaseDeleteResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DatabaseDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r databaseDeleteResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type DatabaseDeleteResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON databaseDeleteResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// databaseDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [DatabaseDeleteResponseEnvelopeErrors]
+type databaseDeleteResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DatabaseDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r databaseDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type DatabaseDeleteResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON databaseDeleteResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// databaseDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [DatabaseDeleteResponseEnvelopeMessages]
+type databaseDeleteResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DatabaseDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r databaseDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type DatabaseDeleteResponseEnvelopeSuccess bool
+
+const (
+ DatabaseDeleteResponseEnvelopeSuccessTrue DatabaseDeleteResponseEnvelopeSuccess = true
+)
+
+type DatabaseGetResponseEnvelope struct {
+ Errors []DatabaseGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []DatabaseGetResponseEnvelopeMessages `json:"messages,required"`
+ Result D1DatabaseDetails `json:"result,required"`
+ // Whether the API call was successful
+ Success DatabaseGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON databaseGetResponseEnvelopeJSON `json:"-"`
+}
+
+// databaseGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [DatabaseGetResponseEnvelope]
+type databaseGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DatabaseGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r databaseGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type DatabaseGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON databaseGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// databaseGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [DatabaseGetResponseEnvelopeErrors]
+type databaseGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DatabaseGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r databaseGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type DatabaseGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON databaseGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// databaseGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [DatabaseGetResponseEnvelopeMessages]
+type databaseGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DatabaseGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r databaseGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type DatabaseGetResponseEnvelopeSuccess bool
+
+const (
+ DatabaseGetResponseEnvelopeSuccessTrue DatabaseGetResponseEnvelopeSuccess = true
+)
+
+type DatabaseQueryParams struct {
+ Sql param.Field[string] `json:"sql,required"`
+ Params param.Field[[]string] `json:"params"`
+}
+
+func (r DatabaseQueryParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type DatabaseQueryResponseEnvelope struct {
+ Errors []DatabaseQueryResponseEnvelopeErrors `json:"errors,required"`
+ Messages []DatabaseQueryResponseEnvelopeMessages `json:"messages,required"`
+ Result []D1QueryResult `json:"result,required"`
+ // Whether the API call was successful
+ Success DatabaseQueryResponseEnvelopeSuccess `json:"success,required"`
+ JSON databaseQueryResponseEnvelopeJSON `json:"-"`
+}
+
+// databaseQueryResponseEnvelopeJSON contains the JSON metadata for the struct
+// [DatabaseQueryResponseEnvelope]
+type databaseQueryResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DatabaseQueryResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r databaseQueryResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type DatabaseQueryResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON databaseQueryResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// databaseQueryResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [DatabaseQueryResponseEnvelopeErrors]
+type databaseQueryResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DatabaseQueryResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r databaseQueryResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type DatabaseQueryResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON databaseQueryResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// databaseQueryResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [DatabaseQueryResponseEnvelopeMessages]
+type databaseQueryResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DatabaseQueryResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r databaseQueryResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type DatabaseQueryResponseEnvelopeSuccess bool
+
+const (
+ DatabaseQueryResponseEnvelopeSuccessTrue DatabaseQueryResponseEnvelopeSuccess = true
+)
diff --git a/d1/database_test.go b/d1/database_test.go
new file mode 100644
index 00000000000..00fe4c2f55e
--- /dev/null
+++ b/d1/database_test.go
@@ -0,0 +1,159 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package d1_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/d1"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestDatabaseNew(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"),
+ )
+ _, err := client.D1.Database.New(context.TODO(), d1.DatabaseNewParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Name: cloudflare.F("my-database"),
+ })
+ 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())
+ }
+}
+
+func TestDatabaseListWithOptionalParams(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"),
+ )
+ _, err := client.D1.Database.List(context.TODO(), d1.DatabaseListParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Name: cloudflare.F("string"),
+ Page: cloudflare.F(1.000000),
+ PerPage: cloudflare.F(10.000000),
+ })
+ 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())
+ }
+}
+
+func TestDatabaseDelete(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"),
+ )
+ _, err := client.D1.Database.Delete(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
+ )
+ 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())
+ }
+}
+
+func TestDatabaseGet(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"),
+ )
+ _, err := client.D1.Database.Get(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
+ )
+ 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())
+ }
+}
+
+func TestDatabaseQueryWithOptionalParams(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"),
+ )
+ _, err := client.D1.Database.Query(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
+ d1.DatabaseQueryParams{
+ Sql: cloudflare.F("SELECT * FROM myTable WHERE field = ? OR field = ?;"),
+ Params: cloudflare.F([]string{"firstParam", "secondParam"}),
+ },
+ )
+ 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/d1database.go b/d1database.go
deleted file mode 100644
index 5d430d7fc34..00000000000
--- a/d1database.go
+++ /dev/null
@@ -1,636 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
- "reflect"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/option"
- "github.com/tidwall/gjson"
-)
-
-// D1DatabaseService contains methods and other services that help with interacting
-// with the cloudflare API. Note, unlike clients, this service does not read
-// variables from the environment automatically. You should not instantiate this
-// service directly, and instead use the [NewD1DatabaseService] method instead.
-type D1DatabaseService struct {
- Options []option.RequestOption
-}
-
-// NewD1DatabaseService generates a new service that applies the given options to
-// each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewD1DatabaseService(opts ...option.RequestOption) (r *D1DatabaseService) {
- r = &D1DatabaseService{}
- r.Options = opts
- return
-}
-
-// Returns the created D1 database.
-func (r *D1DatabaseService) New(ctx context.Context, params D1DatabaseNewParams, opts ...option.RequestOption) (res *D1DatabaseNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env D1DatabaseNewResponseEnvelope
- path := fmt.Sprintf("accounts/%s/d1/database", params.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Returns a list of D1 databases.
-func (r *D1DatabaseService) List(ctx context.Context, params D1DatabaseListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[D1DatabaseListResponse], err error) {
- var raw *http.Response
- opts = append(r.Options, opts...)
- opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
- path := fmt.Sprintf("accounts/%s/d1/database", params.AccountID)
- cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, params, &res, opts...)
- if err != nil {
- return nil, err
- }
- err = cfg.Execute()
- if err != nil {
- return nil, err
- }
- res.SetPageConfig(cfg, raw)
- return res, nil
-}
-
-// Returns a list of D1 databases.
-func (r *D1DatabaseService) ListAutoPaging(ctx context.Context, params D1DatabaseListParams, opts ...option.RequestOption) *shared.V4PagePaginationArrayAutoPager[D1DatabaseListResponse] {
- return shared.NewV4PagePaginationArrayAutoPager(r.List(ctx, params, opts...))
-}
-
-// Deletes the specified D1 database.
-func (r *D1DatabaseService) Delete(ctx context.Context, accountIdentifier string, databaseIdentifier string, opts ...option.RequestOption) (res *D1DatabaseDeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env D1DatabaseDeleteResponseEnvelope
- path := fmt.Sprintf("accounts/%s/d1/database/%s", accountIdentifier, databaseIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Returns the specified D1 database.
-func (r *D1DatabaseService) Get(ctx context.Context, accountIdentifier string, databaseIdentifier string, opts ...option.RequestOption) (res *D1DatabaseGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env D1DatabaseGetResponseEnvelope
- path := fmt.Sprintf("accounts/%s/d1/database/%s", accountIdentifier, databaseIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Returns the query result.
-func (r *D1DatabaseService) Query(ctx context.Context, accountIdentifier string, databaseIdentifier string, body D1DatabaseQueryParams, opts ...option.RequestOption) (res *[]D1DatabaseQueryResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env D1DatabaseQueryResponseEnvelope
- path := fmt.Sprintf("accounts/%s/d1/database/%s/query", accountIdentifier, databaseIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type D1DatabaseNewResponse struct {
- // Specifies the timestamp the resource was created as an ISO8601 string.
- CreatedAt interface{} `json:"created_at"`
- Name string `json:"name"`
- UUID string `json:"uuid"`
- Version string `json:"version"`
- JSON d1DatabaseNewResponseJSON `json:"-"`
-}
-
-// d1DatabaseNewResponseJSON contains the JSON metadata for the struct
-// [D1DatabaseNewResponse]
-type d1DatabaseNewResponseJSON struct {
- CreatedAt apijson.Field
- Name apijson.Field
- UUID apijson.Field
- Version apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *D1DatabaseNewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r d1DatabaseNewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type D1DatabaseListResponse struct {
- // Specifies the timestamp the resource was created as an ISO8601 string.
- CreatedAt interface{} `json:"created_at"`
- Name string `json:"name"`
- UUID string `json:"uuid"`
- Version string `json:"version"`
- JSON d1DatabaseListResponseJSON `json:"-"`
-}
-
-// d1DatabaseListResponseJSON contains the JSON metadata for the struct
-// [D1DatabaseListResponse]
-type d1DatabaseListResponseJSON struct {
- CreatedAt apijson.Field
- Name apijson.Field
- UUID apijson.Field
- Version apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *D1DatabaseListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r d1DatabaseListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// Union satisfied by [D1DatabaseDeleteResponseUnknown] or [shared.UnionString].
-type D1DatabaseDeleteResponse interface {
- ImplementsD1DatabaseDeleteResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*D1DatabaseDeleteResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-type D1DatabaseGetResponse struct {
- // Specifies the timestamp the resource was created as an ISO8601 string.
- CreatedAt interface{} `json:"created_at"`
- // The D1 database's size, in bytes.
- FileSize float64 `json:"file_size"`
- Name string `json:"name"`
- NumTables float64 `json:"num_tables"`
- UUID string `json:"uuid"`
- Version string `json:"version"`
- JSON d1DatabaseGetResponseJSON `json:"-"`
-}
-
-// d1DatabaseGetResponseJSON contains the JSON metadata for the struct
-// [D1DatabaseGetResponse]
-type d1DatabaseGetResponseJSON struct {
- CreatedAt apijson.Field
- FileSize apijson.Field
- Name apijson.Field
- NumTables apijson.Field
- UUID apijson.Field
- Version apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *D1DatabaseGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r d1DatabaseGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type D1DatabaseQueryResponse struct {
- Meta D1DatabaseQueryResponseMeta `json:"meta"`
- Results []interface{} `json:"results"`
- Success bool `json:"success"`
- JSON d1DatabaseQueryResponseJSON `json:"-"`
-}
-
-// d1DatabaseQueryResponseJSON contains the JSON metadata for the struct
-// [D1DatabaseQueryResponse]
-type d1DatabaseQueryResponseJSON struct {
- Meta apijson.Field
- Results apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *D1DatabaseQueryResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r d1DatabaseQueryResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type D1DatabaseQueryResponseMeta struct {
- ChangedDB bool `json:"changed_db"`
- Changes float64 `json:"changes"`
- Duration float64 `json:"duration"`
- LastRowID float64 `json:"last_row_id"`
- RowsRead float64 `json:"rows_read"`
- RowsWritten float64 `json:"rows_written"`
- SizeAfter float64 `json:"size_after"`
- JSON d1DatabaseQueryResponseMetaJSON `json:"-"`
-}
-
-// d1DatabaseQueryResponseMetaJSON contains the JSON metadata for the struct
-// [D1DatabaseQueryResponseMeta]
-type d1DatabaseQueryResponseMetaJSON struct {
- ChangedDB apijson.Field
- Changes apijson.Field
- Duration apijson.Field
- LastRowID apijson.Field
- RowsRead apijson.Field
- RowsWritten apijson.Field
- SizeAfter apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *D1DatabaseQueryResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r d1DatabaseQueryResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type D1DatabaseNewParams struct {
- // Account identifier tag.
- AccountID param.Field[string] `path:"account_id,required"`
- Name param.Field[string] `json:"name,required"`
-}
-
-func (r D1DatabaseNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type D1DatabaseNewResponseEnvelope struct {
- Errors []D1DatabaseNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []D1DatabaseNewResponseEnvelopeMessages `json:"messages,required"`
- Result D1DatabaseNewResponse `json:"result,required"`
- // Whether the API call was successful
- Success D1DatabaseNewResponseEnvelopeSuccess `json:"success,required"`
- JSON d1DatabaseNewResponseEnvelopeJSON `json:"-"`
-}
-
-// d1DatabaseNewResponseEnvelopeJSON contains the JSON metadata for the struct
-// [D1DatabaseNewResponseEnvelope]
-type d1DatabaseNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *D1DatabaseNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r d1DatabaseNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type D1DatabaseNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON d1DatabaseNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// d1DatabaseNewResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [D1DatabaseNewResponseEnvelopeErrors]
-type d1DatabaseNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *D1DatabaseNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r d1DatabaseNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type D1DatabaseNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON d1DatabaseNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// d1DatabaseNewResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [D1DatabaseNewResponseEnvelopeMessages]
-type d1DatabaseNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *D1DatabaseNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r d1DatabaseNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type D1DatabaseNewResponseEnvelopeSuccess bool
-
-const (
- D1DatabaseNewResponseEnvelopeSuccessTrue D1DatabaseNewResponseEnvelopeSuccess = true
-)
-
-type D1DatabaseListParams struct {
- // Account identifier tag.
- AccountID param.Field[string] `path:"account_id,required"`
- // a database name to search for.
- Name param.Field[string] `query:"name"`
- // Page number of paginated results.
- Page param.Field[float64] `query:"page"`
- // Number of items per page.
- PerPage param.Field[float64] `query:"per_page"`
-}
-
-// URLQuery serializes [D1DatabaseListParams]'s query parameters as `url.Values`.
-func (r D1DatabaseListParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type D1DatabaseDeleteResponseEnvelope struct {
- Errors []D1DatabaseDeleteResponseEnvelopeErrors `json:"errors,required"`
- Messages []D1DatabaseDeleteResponseEnvelopeMessages `json:"messages,required"`
- Result D1DatabaseDeleteResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success D1DatabaseDeleteResponseEnvelopeSuccess `json:"success,required"`
- JSON d1DatabaseDeleteResponseEnvelopeJSON `json:"-"`
-}
-
-// d1DatabaseDeleteResponseEnvelopeJSON contains the JSON metadata for the struct
-// [D1DatabaseDeleteResponseEnvelope]
-type d1DatabaseDeleteResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *D1DatabaseDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r d1DatabaseDeleteResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type D1DatabaseDeleteResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON d1DatabaseDeleteResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// d1DatabaseDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [D1DatabaseDeleteResponseEnvelopeErrors]
-type d1DatabaseDeleteResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *D1DatabaseDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r d1DatabaseDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type D1DatabaseDeleteResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON d1DatabaseDeleteResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// d1DatabaseDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [D1DatabaseDeleteResponseEnvelopeMessages]
-type d1DatabaseDeleteResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *D1DatabaseDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r d1DatabaseDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type D1DatabaseDeleteResponseEnvelopeSuccess bool
-
-const (
- D1DatabaseDeleteResponseEnvelopeSuccessTrue D1DatabaseDeleteResponseEnvelopeSuccess = true
-)
-
-type D1DatabaseGetResponseEnvelope struct {
- Errors []D1DatabaseGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []D1DatabaseGetResponseEnvelopeMessages `json:"messages,required"`
- Result D1DatabaseGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success D1DatabaseGetResponseEnvelopeSuccess `json:"success,required"`
- JSON d1DatabaseGetResponseEnvelopeJSON `json:"-"`
-}
-
-// d1DatabaseGetResponseEnvelopeJSON contains the JSON metadata for the struct
-// [D1DatabaseGetResponseEnvelope]
-type d1DatabaseGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *D1DatabaseGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r d1DatabaseGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type D1DatabaseGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON d1DatabaseGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// d1DatabaseGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [D1DatabaseGetResponseEnvelopeErrors]
-type d1DatabaseGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *D1DatabaseGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r d1DatabaseGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type D1DatabaseGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON d1DatabaseGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// d1DatabaseGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [D1DatabaseGetResponseEnvelopeMessages]
-type d1DatabaseGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *D1DatabaseGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r d1DatabaseGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type D1DatabaseGetResponseEnvelopeSuccess bool
-
-const (
- D1DatabaseGetResponseEnvelopeSuccessTrue D1DatabaseGetResponseEnvelopeSuccess = true
-)
-
-type D1DatabaseQueryParams struct {
- Sql param.Field[string] `json:"sql,required"`
- Params param.Field[[]string] `json:"params"`
-}
-
-func (r D1DatabaseQueryParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type D1DatabaseQueryResponseEnvelope struct {
- Errors []D1DatabaseQueryResponseEnvelopeErrors `json:"errors,required"`
- Messages []D1DatabaseQueryResponseEnvelopeMessages `json:"messages,required"`
- Result []D1DatabaseQueryResponse `json:"result,required"`
- // Whether the API call was successful
- Success D1DatabaseQueryResponseEnvelopeSuccess `json:"success,required"`
- JSON d1DatabaseQueryResponseEnvelopeJSON `json:"-"`
-}
-
-// d1DatabaseQueryResponseEnvelopeJSON contains the JSON metadata for the struct
-// [D1DatabaseQueryResponseEnvelope]
-type d1DatabaseQueryResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *D1DatabaseQueryResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r d1DatabaseQueryResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type D1DatabaseQueryResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON d1DatabaseQueryResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// d1DatabaseQueryResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [D1DatabaseQueryResponseEnvelopeErrors]
-type d1DatabaseQueryResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *D1DatabaseQueryResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r d1DatabaseQueryResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type D1DatabaseQueryResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON d1DatabaseQueryResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// d1DatabaseQueryResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [D1DatabaseQueryResponseEnvelopeMessages]
-type d1DatabaseQueryResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *D1DatabaseQueryResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r d1DatabaseQueryResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type D1DatabaseQueryResponseEnvelopeSuccess bool
-
-const (
- D1DatabaseQueryResponseEnvelopeSuccessTrue D1DatabaseQueryResponseEnvelopeSuccess = true
-)
diff --git a/d1database_test.go b/d1database_test.go
deleted file mode 100644
index ccebc0cb21d..00000000000
--- a/d1database_test.go
+++ /dev/null
@@ -1,158 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestD1DatabaseNew(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"),
- )
- _, err := client.D1.Database.New(context.TODO(), cloudflare.D1DatabaseNewParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Name: cloudflare.F("my-database"),
- })
- 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())
- }
-}
-
-func TestD1DatabaseListWithOptionalParams(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"),
- )
- _, err := client.D1.Database.List(context.TODO(), cloudflare.D1DatabaseListParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Name: cloudflare.F("string"),
- Page: cloudflare.F(1.000000),
- PerPage: cloudflare.F(10.000000),
- })
- 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())
- }
-}
-
-func TestD1DatabaseDelete(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"),
- )
- _, err := client.D1.Database.Delete(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
- )
- 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())
- }
-}
-
-func TestD1DatabaseGet(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"),
- )
- _, err := client.D1.Database.Get(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
- )
- 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())
- }
-}
-
-func TestD1DatabaseQueryWithOptionalParams(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"),
- )
- _, err := client.D1.Database.Query(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
- cloudflare.D1DatabaseQueryParams{
- Sql: cloudflare.F("SELECT * FROM myTable WHERE field = ? OR field = ?;"),
- Params: cloudflare.F([]string{"firstParam", "secondParam"}),
- },
- )
- 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/dcv_delegation/aliases.go b/dcv_delegation/aliases.go
new file mode 100644
index 00000000000..e365dceb676
--- /dev/null
+++ b/dcv_delegation/aliases.go
@@ -0,0 +1,9 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package dcv_delegation
+
+import (
+ "github.com/cloudflare/cloudflare-go/internal/apierror"
+)
+
+type Error = apierror.Error
diff --git a/dcvdelegation.go b/dcv_delegation/dcvdelegation.go
similarity index 89%
rename from dcvdelegation.go
rename to dcv_delegation/dcvdelegation.go
index ff863b54cd2..cdf95b048ff 100644
--- a/dcvdelegation.go
+++ b/dcv_delegation/dcvdelegation.go
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package cloudflare
+package dcv_delegation
import (
"github.com/cloudflare/cloudflare-go/option"
@@ -13,7 +13,7 @@ import (
// instead.
type DCVDelegationService struct {
Options []option.RequestOption
- UUID *DCVDelegationUUIDService
+ UUID *UUIDService
}
// NewDCVDelegationService generates a new service that applies the given options
@@ -22,6 +22,6 @@ type DCVDelegationService struct {
func NewDCVDelegationService(opts ...option.RequestOption) (r *DCVDelegationService) {
r = &DCVDelegationService{}
r.Options = opts
- r.UUID = NewDCVDelegationUUIDService(opts...)
+ r.UUID = NewUUIDService(opts...)
return
}
diff --git a/dcv_delegation/uuid.go b/dcv_delegation/uuid.go
new file mode 100644
index 00000000000..0bfa6d1c918
--- /dev/null
+++ b/dcv_delegation/uuid.go
@@ -0,0 +1,153 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package dcv_delegation
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// UUIDService contains methods and other services that help with interacting with
+// the cloudflare API. Note, unlike clients, this service does not read variables
+// from the environment automatically. You should not instantiate this service
+// directly, and instead use the [NewUUIDService] method instead.
+type UUIDService struct {
+ Options []option.RequestOption
+}
+
+// NewUUIDService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewUUIDService(opts ...option.RequestOption) (r *UUIDService) {
+ r = &UUIDService{}
+ r.Options = opts
+ return
+}
+
+// Retrieve the account and zone specific unique identifier used as part of the
+// CNAME target for DCV Delegation.
+func (r *UUIDService) Get(ctx context.Context, query UUIDGetParams, opts ...option.RequestOption) (res *TLSCertificatesAndHostnamesUUIDObject, err error) {
+ opts = append(r.Options[:], opts...)
+ var env UUIDGetResponseEnvelope
+ path := fmt.Sprintf("zones/%s/dcv_delegation/uuid", query.ZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type TLSCertificatesAndHostnamesUUIDObject struct {
+ // The DCV Delegation unique identifier.
+ UUID string `json:"uuid"`
+ JSON tlsCertificatesAndHostnamesUUIDObjectJSON `json:"-"`
+}
+
+// tlsCertificatesAndHostnamesUUIDObjectJSON contains the JSON metadata for the
+// struct [TLSCertificatesAndHostnamesUUIDObject]
+type tlsCertificatesAndHostnamesUUIDObjectJSON struct {
+ UUID apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *TLSCertificatesAndHostnamesUUIDObject) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r tlsCertificatesAndHostnamesUUIDObjectJSON) RawJSON() string {
+ return r.raw
+}
+
+type UUIDGetParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+}
+
+type UUIDGetResponseEnvelope struct {
+ Errors []UUIDGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []UUIDGetResponseEnvelopeMessages `json:"messages,required"`
+ Result TLSCertificatesAndHostnamesUUIDObject `json:"result,required"`
+ // Whether the API call was successful
+ Success UUIDGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON uuidGetResponseEnvelopeJSON `json:"-"`
+}
+
+// uuidGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [UUIDGetResponseEnvelope]
+type uuidGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *UUIDGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r uuidGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type UUIDGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON uuidGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// uuidGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [UUIDGetResponseEnvelopeErrors]
+type uuidGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *UUIDGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r uuidGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type UUIDGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON uuidGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// uuidGetResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [UUIDGetResponseEnvelopeMessages]
+type uuidGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *UUIDGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r uuidGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type UUIDGetResponseEnvelopeSuccess bool
+
+const (
+ UUIDGetResponseEnvelopeSuccessTrue UUIDGetResponseEnvelopeSuccess = true
+)
diff --git a/dcv_delegation/uuid_test.go b/dcv_delegation/uuid_test.go
new file mode 100644
index 00000000000..95aef6f6db3
--- /dev/null
+++ b/dcv_delegation/uuid_test.go
@@ -0,0 +1,41 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package dcv_delegation_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/dcv_delegation"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestUUIDGet(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"),
+ )
+ _, err := client.DCVDelegation.UUID.Get(context.TODO(), dcv_delegation.UUIDGetParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ })
+ 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/dcvdelegationuuid.go b/dcvdelegationuuid.go
deleted file mode 100644
index f5df0292fcc..00000000000
--- a/dcvdelegationuuid.go
+++ /dev/null
@@ -1,154 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// DCVDelegationUUIDService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewDCVDelegationUUIDService] method
-// instead.
-type DCVDelegationUUIDService struct {
- Options []option.RequestOption
-}
-
-// NewDCVDelegationUUIDService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewDCVDelegationUUIDService(opts ...option.RequestOption) (r *DCVDelegationUUIDService) {
- r = &DCVDelegationUUIDService{}
- r.Options = opts
- return
-}
-
-// Retrieve the account and zone specific unique identifier used as part of the
-// CNAME target for DCV Delegation.
-func (r *DCVDelegationUUIDService) Get(ctx context.Context, query DCVDelegationUUIDGetParams, opts ...option.RequestOption) (res *DCVDelegationUUIDGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env DCVDelegationUUIDGetResponseEnvelope
- path := fmt.Sprintf("zones/%s/dcv_delegation/uuid", query.ZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type DCVDelegationUUIDGetResponse struct {
- // The DCV Delegation unique identifier.
- UUID string `json:"uuid"`
- JSON dcvDelegationUUIDGetResponseJSON `json:"-"`
-}
-
-// dcvDelegationUUIDGetResponseJSON contains the JSON metadata for the struct
-// [DCVDelegationUUIDGetResponse]
-type dcvDelegationUUIDGetResponseJSON struct {
- UUID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DCVDelegationUUIDGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dcvDelegationUUIDGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type DCVDelegationUUIDGetParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
-}
-
-type DCVDelegationUUIDGetResponseEnvelope struct {
- Errors []DCVDelegationUUIDGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []DCVDelegationUUIDGetResponseEnvelopeMessages `json:"messages,required"`
- Result DCVDelegationUUIDGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success DCVDelegationUUIDGetResponseEnvelopeSuccess `json:"success,required"`
- JSON dcvDelegationUUIDGetResponseEnvelopeJSON `json:"-"`
-}
-
-// dcvDelegationUUIDGetResponseEnvelopeJSON contains the JSON metadata for the
-// struct [DCVDelegationUUIDGetResponseEnvelope]
-type dcvDelegationUUIDGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DCVDelegationUUIDGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dcvDelegationUUIDGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type DCVDelegationUUIDGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON dcvDelegationUUIDGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// dcvDelegationUUIDGetResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [DCVDelegationUUIDGetResponseEnvelopeErrors]
-type dcvDelegationUUIDGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DCVDelegationUUIDGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dcvDelegationUUIDGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type DCVDelegationUUIDGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON dcvDelegationUUIDGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// dcvDelegationUUIDGetResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [DCVDelegationUUIDGetResponseEnvelopeMessages]
-type dcvDelegationUUIDGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DCVDelegationUUIDGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dcvDelegationUUIDGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type DCVDelegationUUIDGetResponseEnvelopeSuccess bool
-
-const (
- DCVDelegationUUIDGetResponseEnvelopeSuccessTrue DCVDelegationUUIDGetResponseEnvelopeSuccess = true
-)
diff --git a/dcvdelegationuuid_test.go b/dcvdelegationuuid_test.go
deleted file mode 100644
index 3c1573c351f..00000000000
--- a/dcvdelegationuuid_test.go
+++ /dev/null
@@ -1,40 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestDCVDelegationUUIDGet(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"),
- )
- _, err := client.DCVDelegation.UUID.Get(context.TODO(), cloudflare.DCVDelegationUUIDGetParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- })
- 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/diagnostics/aliases.go b/diagnostics/aliases.go
new file mode 100644
index 00000000000..ea9656ed49c
--- /dev/null
+++ b/diagnostics/aliases.go
@@ -0,0 +1,9 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package diagnostics
+
+import (
+ "github.com/cloudflare/cloudflare-go/internal/apierror"
+)
+
+type Error = apierror.Error
diff --git a/diagnostic.go b/diagnostics/diagnostic.go
similarity index 87%
rename from diagnostic.go
rename to diagnostics/diagnostic.go
index 5321da515d5..3221f0dfd0b 100644
--- a/diagnostic.go
+++ b/diagnostics/diagnostic.go
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package cloudflare
+package diagnostics
import (
"github.com/cloudflare/cloudflare-go/option"
@@ -12,7 +12,7 @@ import (
// service directly, and instead use the [NewDiagnosticService] method instead.
type DiagnosticService struct {
Options []option.RequestOption
- Traceroutes *DiagnosticTracerouteService
+ Traceroutes *TracerouteService
}
// NewDiagnosticService generates a new service that applies the given options to
@@ -21,6 +21,6 @@ type DiagnosticService struct {
func NewDiagnosticService(opts ...option.RequestOption) (r *DiagnosticService) {
r = &DiagnosticService{}
r.Options = opts
- r.Traceroutes = NewDiagnosticTracerouteService(opts...)
+ r.Traceroutes = NewTracerouteService(opts...)
return
}
diff --git a/diagnostics/traceroute.go b/diagnostics/traceroute.go
new file mode 100644
index 00000000000..ae0d591a300
--- /dev/null
+++ b/diagnostics/traceroute.go
@@ -0,0 +1,373 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package diagnostics
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// TracerouteService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewTracerouteService] method instead.
+type TracerouteService struct {
+ Options []option.RequestOption
+}
+
+// NewTracerouteService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewTracerouteService(opts ...option.RequestOption) (r *TracerouteService) {
+ r = &TracerouteService{}
+ r.Options = opts
+ return
+}
+
+// Run traceroutes from Cloudflare colos.
+func (r *TracerouteService) New(ctx context.Context, params TracerouteNewParams, opts ...option.RequestOption) (res *[]MagicTransitTargetResult, err error) {
+ opts = append(r.Options[:], opts...)
+ var env TracerouteNewResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/diagnostics/traceroute", params.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type MagicTransitTargetResult struct {
+ Colos []MagicTransitTargetResultColo `json:"colos"`
+ // The target hostname, IPv6, or IPv6 address.
+ Target string `json:"target"`
+ JSON magicTransitTargetResultJSON `json:"-"`
+}
+
+// magicTransitTargetResultJSON contains the JSON metadata for the struct
+// [MagicTransitTargetResult]
+type magicTransitTargetResultJSON struct {
+ Colos apijson.Field
+ Target apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *MagicTransitTargetResult) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r magicTransitTargetResultJSON) RawJSON() string {
+ return r.raw
+}
+
+type MagicTransitTargetResultColo struct {
+ Colo MagicTransitTargetResultColosColo `json:"colo"`
+ // Errors resulting from collecting traceroute from colo to target.
+ Error MagicTransitTargetResultColosError `json:"error"`
+ Hops []MagicTransitTargetResultColosHop `json:"hops"`
+ // Aggregated statistics from all hops about the target.
+ TargetSummary interface{} `json:"target_summary"`
+ // Total time of traceroute in ms.
+ TracerouteTimeMs int64 `json:"traceroute_time_ms"`
+ JSON magicTransitTargetResultColoJSON `json:"-"`
+}
+
+// magicTransitTargetResultColoJSON contains the JSON metadata for the struct
+// [MagicTransitTargetResultColo]
+type magicTransitTargetResultColoJSON struct {
+ Colo apijson.Field
+ Error apijson.Field
+ Hops apijson.Field
+ TargetSummary apijson.Field
+ TracerouteTimeMs apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *MagicTransitTargetResultColo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r magicTransitTargetResultColoJSON) RawJSON() string {
+ return r.raw
+}
+
+type MagicTransitTargetResultColosColo struct {
+ // Source colo city.
+ City string `json:"city"`
+ // Source colo name.
+ Name string `json:"name"`
+ JSON magicTransitTargetResultColosColoJSON `json:"-"`
+}
+
+// magicTransitTargetResultColosColoJSON contains the JSON metadata for the struct
+// [MagicTransitTargetResultColosColo]
+type magicTransitTargetResultColosColoJSON struct {
+ City apijson.Field
+ Name apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *MagicTransitTargetResultColosColo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r magicTransitTargetResultColosColoJSON) RawJSON() string {
+ return r.raw
+}
+
+// Errors resulting from collecting traceroute from colo to target.
+type MagicTransitTargetResultColosError string
+
+const (
+ MagicTransitTargetResultColosErrorEmpty MagicTransitTargetResultColosError = ""
+ MagicTransitTargetResultColosErrorCouldNotGatherTracerouteDataCode1 MagicTransitTargetResultColosError = "Could not gather traceroute data: Code 1"
+ MagicTransitTargetResultColosErrorCouldNotGatherTracerouteDataCode2 MagicTransitTargetResultColosError = "Could not gather traceroute data: Code 2"
+ MagicTransitTargetResultColosErrorCouldNotGatherTracerouteDataCode3 MagicTransitTargetResultColosError = "Could not gather traceroute data: Code 3"
+ MagicTransitTargetResultColosErrorCouldNotGatherTracerouteDataCode4 MagicTransitTargetResultColosError = "Could not gather traceroute data: Code 4"
+)
+
+type MagicTransitTargetResultColosHop struct {
+ // An array of node objects.
+ Nodes []MagicTransitTargetResultColosHopsNode `json:"nodes"`
+ // Number of packets where no response was received.
+ PacketsLost int64 `json:"packets_lost"`
+ // Number of packets sent with specified TTL.
+ PacketsSent int64 `json:"packets_sent"`
+ // The time to live (TTL).
+ PacketsTTL int64 `json:"packets_ttl"`
+ JSON magicTransitTargetResultColosHopJSON `json:"-"`
+}
+
+// magicTransitTargetResultColosHopJSON contains the JSON metadata for the struct
+// [MagicTransitTargetResultColosHop]
+type magicTransitTargetResultColosHopJSON struct {
+ Nodes apijson.Field
+ PacketsLost apijson.Field
+ PacketsSent apijson.Field
+ PacketsTTL apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *MagicTransitTargetResultColosHop) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r magicTransitTargetResultColosHopJSON) RawJSON() string {
+ return r.raw
+}
+
+type MagicTransitTargetResultColosHopsNode struct {
+ // AS number associated with the node object.
+ ASN string `json:"asn"`
+ // IP address of the node.
+ IP string `json:"ip"`
+ // Field appears if there is an additional annotation printed when the probe
+ // returns. Field also appears when running a GRE+ICMP traceroute to denote which
+ // traceroute a node comes from.
+ Labels []string `json:"labels"`
+ // Maximum RTT in ms.
+ MaxRTTMs float64 `json:"max_rtt_ms"`
+ // Mean RTT in ms.
+ MeanRTTMs float64 `json:"mean_rtt_ms"`
+ // Minimum RTT in ms.
+ MinRTTMs float64 `json:"min_rtt_ms"`
+ // Host name of the address, this may be the same as the IP address.
+ Name string `json:"name"`
+ // Number of packets with a response from this node.
+ PacketCount int64 `json:"packet_count"`
+ // Standard deviation of the RTTs in ms.
+ StdDevRTTMs float64 `json:"std_dev_rtt_ms"`
+ JSON magicTransitTargetResultColosHopsNodeJSON `json:"-"`
+}
+
+// magicTransitTargetResultColosHopsNodeJSON contains the JSON metadata for the
+// struct [MagicTransitTargetResultColosHopsNode]
+type magicTransitTargetResultColosHopsNodeJSON struct {
+ ASN apijson.Field
+ IP apijson.Field
+ Labels apijson.Field
+ MaxRTTMs apijson.Field
+ MeanRTTMs apijson.Field
+ MinRTTMs apijson.Field
+ Name apijson.Field
+ PacketCount apijson.Field
+ StdDevRTTMs apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *MagicTransitTargetResultColosHopsNode) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r magicTransitTargetResultColosHopsNodeJSON) RawJSON() string {
+ return r.raw
+}
+
+type TracerouteNewParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ Targets param.Field[[]string] `json:"targets,required"`
+ // If no source colo names specified, all colos will be used. China colos are
+ // unavailable for traceroutes.
+ Colos param.Field[[]string] `json:"colos"`
+ Options param.Field[TracerouteNewParamsOptions] `json:"options"`
+}
+
+func (r TracerouteNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type TracerouteNewParamsOptions struct {
+ // Max TTL.
+ MaxTTL param.Field[int64] `json:"max_ttl"`
+ // Type of packet sent.
+ PacketType param.Field[TracerouteNewParamsOptionsPacketType] `json:"packet_type"`
+ // Number of packets sent at each TTL.
+ PacketsPerTTL param.Field[int64] `json:"packets_per_ttl"`
+ // For UDP and TCP, specifies the destination port. For ICMP, specifies the initial
+ // ICMP sequence value. Default value 0 will choose the best value to use for each
+ // protocol.
+ Port param.Field[int64] `json:"port"`
+ // Set the time (in seconds) to wait for a response to a probe.
+ WaitTime param.Field[int64] `json:"wait_time"`
+}
+
+func (r TracerouteNewParamsOptions) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Type of packet sent.
+type TracerouteNewParamsOptionsPacketType string
+
+const (
+ TracerouteNewParamsOptionsPacketTypeIcmp TracerouteNewParamsOptionsPacketType = "icmp"
+ TracerouteNewParamsOptionsPacketTypeTcp TracerouteNewParamsOptionsPacketType = "tcp"
+ TracerouteNewParamsOptionsPacketTypeUdp TracerouteNewParamsOptionsPacketType = "udp"
+ TracerouteNewParamsOptionsPacketTypeGRE TracerouteNewParamsOptionsPacketType = "gre"
+ TracerouteNewParamsOptionsPacketTypeGREIcmp TracerouteNewParamsOptionsPacketType = "gre+icmp"
+)
+
+type TracerouteNewResponseEnvelope struct {
+ Errors []TracerouteNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []TracerouteNewResponseEnvelopeMessages `json:"messages,required"`
+ Result []MagicTransitTargetResult `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success TracerouteNewResponseEnvelopeSuccess `json:"success,required"`
+ ResultInfo TracerouteNewResponseEnvelopeResultInfo `json:"result_info"`
+ JSON tracerouteNewResponseEnvelopeJSON `json:"-"`
+}
+
+// tracerouteNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [TracerouteNewResponseEnvelope]
+type tracerouteNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ ResultInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *TracerouteNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r tracerouteNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type TracerouteNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON tracerouteNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// tracerouteNewResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [TracerouteNewResponseEnvelopeErrors]
+type tracerouteNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *TracerouteNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r tracerouteNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type TracerouteNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON tracerouteNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// tracerouteNewResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [TracerouteNewResponseEnvelopeMessages]
+type tracerouteNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *TracerouteNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r tracerouteNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type TracerouteNewResponseEnvelopeSuccess bool
+
+const (
+ TracerouteNewResponseEnvelopeSuccessTrue TracerouteNewResponseEnvelopeSuccess = true
+)
+
+type TracerouteNewResponseEnvelopeResultInfo struct {
+ // Total number of results for the requested service
+ Count float64 `json:"count"`
+ // Current page within paginated list of results
+ Page float64 `json:"page"`
+ // Number of results per page of results
+ PerPage float64 `json:"per_page"`
+ // Total results available without any search parameters
+ TotalCount float64 `json:"total_count"`
+ JSON tracerouteNewResponseEnvelopeResultInfoJSON `json:"-"`
+}
+
+// tracerouteNewResponseEnvelopeResultInfoJSON contains the JSON metadata for the
+// struct [TracerouteNewResponseEnvelopeResultInfo]
+type tracerouteNewResponseEnvelopeResultInfoJSON struct {
+ Count apijson.Field
+ Page apijson.Field
+ PerPage apijson.Field
+ TotalCount apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *TracerouteNewResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r tracerouteNewResponseEnvelopeResultInfoJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/diagnostics/traceroute_test.go b/diagnostics/traceroute_test.go
new file mode 100644
index 00000000000..4df6185cd70
--- /dev/null
+++ b/diagnostics/traceroute_test.go
@@ -0,0 +1,50 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package diagnostics_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/diagnostics"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestTracerouteNewWithOptionalParams(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"),
+ )
+ _, err := client.Diagnostics.Traceroutes.New(context.TODO(), diagnostics.TracerouteNewParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Targets: cloudflare.F([]string{"203.0.113.1", "cloudflare.com"}),
+ Colos: cloudflare.F([]string{"den", "sin"}),
+ Options: cloudflare.F(diagnostics.TracerouteNewParamsOptions{
+ MaxTTL: cloudflare.F(int64(15)),
+ PacketType: cloudflare.F(diagnostics.TracerouteNewParamsOptionsPacketTypeIcmp),
+ PacketsPerTTL: cloudflare.F(int64(0)),
+ Port: cloudflare.F(int64(0)),
+ WaitTime: cloudflare.F(int64(1)),
+ }),
+ })
+ 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/diagnostictraceroute.go b/diagnostictraceroute.go
deleted file mode 100644
index 574b0d58302..00000000000
--- a/diagnostictraceroute.go
+++ /dev/null
@@ -1,374 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// DiagnosticTracerouteService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewDiagnosticTracerouteService]
-// method instead.
-type DiagnosticTracerouteService struct {
- Options []option.RequestOption
-}
-
-// NewDiagnosticTracerouteService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewDiagnosticTracerouteService(opts ...option.RequestOption) (r *DiagnosticTracerouteService) {
- r = &DiagnosticTracerouteService{}
- r.Options = opts
- return
-}
-
-// Run traceroutes from Cloudflare colos.
-func (r *DiagnosticTracerouteService) New(ctx context.Context, params DiagnosticTracerouteNewParams, opts ...option.RequestOption) (res *[]DiagnosticTracerouteNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env DiagnosticTracerouteNewResponseEnvelope
- path := fmt.Sprintf("accounts/%s/diagnostics/traceroute", params.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type DiagnosticTracerouteNewResponse struct {
- Colos []DiagnosticTracerouteNewResponseColo `json:"colos"`
- // The target hostname, IPv6, or IPv6 address.
- Target string `json:"target"`
- JSON diagnosticTracerouteNewResponseJSON `json:"-"`
-}
-
-// diagnosticTracerouteNewResponseJSON contains the JSON metadata for the struct
-// [DiagnosticTracerouteNewResponse]
-type diagnosticTracerouteNewResponseJSON struct {
- Colos apijson.Field
- Target apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DiagnosticTracerouteNewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r diagnosticTracerouteNewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type DiagnosticTracerouteNewResponseColo struct {
- Colo DiagnosticTracerouteNewResponseColosColo `json:"colo"`
- // Errors resulting from collecting traceroute from colo to target.
- Error DiagnosticTracerouteNewResponseColosError `json:"error"`
- Hops []DiagnosticTracerouteNewResponseColosHop `json:"hops"`
- // Aggregated statistics from all hops about the target.
- TargetSummary interface{} `json:"target_summary"`
- // Total time of traceroute in ms.
- TracerouteTimeMs int64 `json:"traceroute_time_ms"`
- JSON diagnosticTracerouteNewResponseColoJSON `json:"-"`
-}
-
-// diagnosticTracerouteNewResponseColoJSON contains the JSON metadata for the
-// struct [DiagnosticTracerouteNewResponseColo]
-type diagnosticTracerouteNewResponseColoJSON struct {
- Colo apijson.Field
- Error apijson.Field
- Hops apijson.Field
- TargetSummary apijson.Field
- TracerouteTimeMs apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DiagnosticTracerouteNewResponseColo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r diagnosticTracerouteNewResponseColoJSON) RawJSON() string {
- return r.raw
-}
-
-type DiagnosticTracerouteNewResponseColosColo struct {
- // Source colo city.
- City string `json:"city"`
- // Source colo name.
- Name string `json:"name"`
- JSON diagnosticTracerouteNewResponseColosColoJSON `json:"-"`
-}
-
-// diagnosticTracerouteNewResponseColosColoJSON contains the JSON metadata for the
-// struct [DiagnosticTracerouteNewResponseColosColo]
-type diagnosticTracerouteNewResponseColosColoJSON struct {
- City apijson.Field
- Name apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DiagnosticTracerouteNewResponseColosColo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r diagnosticTracerouteNewResponseColosColoJSON) RawJSON() string {
- return r.raw
-}
-
-// Errors resulting from collecting traceroute from colo to target.
-type DiagnosticTracerouteNewResponseColosError string
-
-const (
- DiagnosticTracerouteNewResponseColosErrorEmpty DiagnosticTracerouteNewResponseColosError = ""
- DiagnosticTracerouteNewResponseColosErrorCouldNotGatherTracerouteDataCode1 DiagnosticTracerouteNewResponseColosError = "Could not gather traceroute data: Code 1"
- DiagnosticTracerouteNewResponseColosErrorCouldNotGatherTracerouteDataCode2 DiagnosticTracerouteNewResponseColosError = "Could not gather traceroute data: Code 2"
- DiagnosticTracerouteNewResponseColosErrorCouldNotGatherTracerouteDataCode3 DiagnosticTracerouteNewResponseColosError = "Could not gather traceroute data: Code 3"
- DiagnosticTracerouteNewResponseColosErrorCouldNotGatherTracerouteDataCode4 DiagnosticTracerouteNewResponseColosError = "Could not gather traceroute data: Code 4"
-)
-
-type DiagnosticTracerouteNewResponseColosHop struct {
- // An array of node objects.
- Nodes []DiagnosticTracerouteNewResponseColosHopsNode `json:"nodes"`
- // Number of packets where no response was received.
- PacketsLost int64 `json:"packets_lost"`
- // Number of packets sent with specified TTL.
- PacketsSent int64 `json:"packets_sent"`
- // The time to live (TTL).
- PacketsTTL int64 `json:"packets_ttl"`
- JSON diagnosticTracerouteNewResponseColosHopJSON `json:"-"`
-}
-
-// diagnosticTracerouteNewResponseColosHopJSON contains the JSON metadata for the
-// struct [DiagnosticTracerouteNewResponseColosHop]
-type diagnosticTracerouteNewResponseColosHopJSON struct {
- Nodes apijson.Field
- PacketsLost apijson.Field
- PacketsSent apijson.Field
- PacketsTTL apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DiagnosticTracerouteNewResponseColosHop) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r diagnosticTracerouteNewResponseColosHopJSON) RawJSON() string {
- return r.raw
-}
-
-type DiagnosticTracerouteNewResponseColosHopsNode struct {
- // AS number associated with the node object.
- ASN string `json:"asn"`
- // IP address of the node.
- IP string `json:"ip"`
- // Field appears if there is an additional annotation printed when the probe
- // returns. Field also appears when running a GRE+ICMP traceroute to denote which
- // traceroute a node comes from.
- Labels []string `json:"labels"`
- // Maximum RTT in ms.
- MaxRTTMs float64 `json:"max_rtt_ms"`
- // Mean RTT in ms.
- MeanRTTMs float64 `json:"mean_rtt_ms"`
- // Minimum RTT in ms.
- MinRTTMs float64 `json:"min_rtt_ms"`
- // Host name of the address, this may be the same as the IP address.
- Name string `json:"name"`
- // Number of packets with a response from this node.
- PacketCount int64 `json:"packet_count"`
- // Standard deviation of the RTTs in ms.
- StdDevRTTMs float64 `json:"std_dev_rtt_ms"`
- JSON diagnosticTracerouteNewResponseColosHopsNodeJSON `json:"-"`
-}
-
-// diagnosticTracerouteNewResponseColosHopsNodeJSON contains the JSON metadata for
-// the struct [DiagnosticTracerouteNewResponseColosHopsNode]
-type diagnosticTracerouteNewResponseColosHopsNodeJSON struct {
- ASN apijson.Field
- IP apijson.Field
- Labels apijson.Field
- MaxRTTMs apijson.Field
- MeanRTTMs apijson.Field
- MinRTTMs apijson.Field
- Name apijson.Field
- PacketCount apijson.Field
- StdDevRTTMs apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DiagnosticTracerouteNewResponseColosHopsNode) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r diagnosticTracerouteNewResponseColosHopsNodeJSON) RawJSON() string {
- return r.raw
-}
-
-type DiagnosticTracerouteNewParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
- Targets param.Field[[]string] `json:"targets,required"`
- // If no source colo names specified, all colos will be used. China colos are
- // unavailable for traceroutes.
- Colos param.Field[[]string] `json:"colos"`
- Options param.Field[DiagnosticTracerouteNewParamsOptions] `json:"options"`
-}
-
-func (r DiagnosticTracerouteNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type DiagnosticTracerouteNewParamsOptions struct {
- // Max TTL.
- MaxTTL param.Field[int64] `json:"max_ttl"`
- // Type of packet sent.
- PacketType param.Field[DiagnosticTracerouteNewParamsOptionsPacketType] `json:"packet_type"`
- // Number of packets sent at each TTL.
- PacketsPerTTL param.Field[int64] `json:"packets_per_ttl"`
- // For UDP and TCP, specifies the destination port. For ICMP, specifies the initial
- // ICMP sequence value. Default value 0 will choose the best value to use for each
- // protocol.
- Port param.Field[int64] `json:"port"`
- // Set the time (in seconds) to wait for a response to a probe.
- WaitTime param.Field[int64] `json:"wait_time"`
-}
-
-func (r DiagnosticTracerouteNewParamsOptions) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Type of packet sent.
-type DiagnosticTracerouteNewParamsOptionsPacketType string
-
-const (
- DiagnosticTracerouteNewParamsOptionsPacketTypeIcmp DiagnosticTracerouteNewParamsOptionsPacketType = "icmp"
- DiagnosticTracerouteNewParamsOptionsPacketTypeTcp DiagnosticTracerouteNewParamsOptionsPacketType = "tcp"
- DiagnosticTracerouteNewParamsOptionsPacketTypeUdp DiagnosticTracerouteNewParamsOptionsPacketType = "udp"
- DiagnosticTracerouteNewParamsOptionsPacketTypeGRE DiagnosticTracerouteNewParamsOptionsPacketType = "gre"
- DiagnosticTracerouteNewParamsOptionsPacketTypeGREIcmp DiagnosticTracerouteNewParamsOptionsPacketType = "gre+icmp"
-)
-
-type DiagnosticTracerouteNewResponseEnvelope struct {
- Errors []DiagnosticTracerouteNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []DiagnosticTracerouteNewResponseEnvelopeMessages `json:"messages,required"`
- Result []DiagnosticTracerouteNewResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success DiagnosticTracerouteNewResponseEnvelopeSuccess `json:"success,required"`
- ResultInfo DiagnosticTracerouteNewResponseEnvelopeResultInfo `json:"result_info"`
- JSON diagnosticTracerouteNewResponseEnvelopeJSON `json:"-"`
-}
-
-// diagnosticTracerouteNewResponseEnvelopeJSON contains the JSON metadata for the
-// struct [DiagnosticTracerouteNewResponseEnvelope]
-type diagnosticTracerouteNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- ResultInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DiagnosticTracerouteNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r diagnosticTracerouteNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type DiagnosticTracerouteNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON diagnosticTracerouteNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// diagnosticTracerouteNewResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [DiagnosticTracerouteNewResponseEnvelopeErrors]
-type diagnosticTracerouteNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DiagnosticTracerouteNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r diagnosticTracerouteNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type DiagnosticTracerouteNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON diagnosticTracerouteNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// diagnosticTracerouteNewResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [DiagnosticTracerouteNewResponseEnvelopeMessages]
-type diagnosticTracerouteNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DiagnosticTracerouteNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r diagnosticTracerouteNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type DiagnosticTracerouteNewResponseEnvelopeSuccess bool
-
-const (
- DiagnosticTracerouteNewResponseEnvelopeSuccessTrue DiagnosticTracerouteNewResponseEnvelopeSuccess = true
-)
-
-type DiagnosticTracerouteNewResponseEnvelopeResultInfo struct {
- // Total number of results for the requested service
- Count float64 `json:"count"`
- // Current page within paginated list of results
- Page float64 `json:"page"`
- // Number of results per page of results
- PerPage float64 `json:"per_page"`
- // Total results available without any search parameters
- TotalCount float64 `json:"total_count"`
- JSON diagnosticTracerouteNewResponseEnvelopeResultInfoJSON `json:"-"`
-}
-
-// diagnosticTracerouteNewResponseEnvelopeResultInfoJSON contains the JSON metadata
-// for the struct [DiagnosticTracerouteNewResponseEnvelopeResultInfo]
-type diagnosticTracerouteNewResponseEnvelopeResultInfoJSON struct {
- Count apijson.Field
- Page apijson.Field
- PerPage apijson.Field
- TotalCount apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DiagnosticTracerouteNewResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r diagnosticTracerouteNewResponseEnvelopeResultInfoJSON) RawJSON() string {
- return r.raw
-}
diff --git a/diagnostictraceroute_test.go b/diagnostictraceroute_test.go
deleted file mode 100644
index bb7704b982e..00000000000
--- a/diagnostictraceroute_test.go
+++ /dev/null
@@ -1,49 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestDiagnosticTracerouteNewWithOptionalParams(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"),
- )
- _, err := client.Diagnostics.Traceroutes.New(context.TODO(), cloudflare.DiagnosticTracerouteNewParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Targets: cloudflare.F([]string{"203.0.113.1", "cloudflare.com"}),
- Colos: cloudflare.F([]string{"den", "sin"}),
- Options: cloudflare.F(cloudflare.DiagnosticTracerouteNewParamsOptions{
- MaxTTL: cloudflare.F(int64(15)),
- PacketType: cloudflare.F(cloudflare.DiagnosticTracerouteNewParamsOptionsPacketTypeIcmp),
- PacketsPerTTL: cloudflare.F(int64(0)),
- Port: cloudflare.F(int64(0)),
- WaitTime: cloudflare.F(int64(1)),
- }),
- })
- 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/dns.go b/dns.go
deleted file mode 100644
index 17eabf6f763..00000000000
--- a/dns.go
+++ /dev/null
@@ -1,30 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// DNSService contains methods and other services that help with interacting with
-// the cloudflare API. Note, unlike clients, this service does not read variables
-// from the environment automatically. You should not instantiate this service
-// directly, and instead use the [NewDNSService] method instead.
-type DNSService struct {
- Options []option.RequestOption
- Records *DNSRecordService
- Analytics *DNSAnalyticsService
- Firewall *DNSFirewallService
-}
-
-// NewDNSService generates a new service that applies the given options to each
-// request. These options are applied after the parent client's options (if there
-// is one), and before any request-specific options.
-func NewDNSService(opts ...option.RequestOption) (r *DNSService) {
- r = &DNSService{}
- r.Options = opts
- r.Records = NewDNSRecordService(opts...)
- r.Analytics = NewDNSAnalyticsService(opts...)
- r.Firewall = NewDNSFirewallService(opts...)
- return
-}
diff --git a/dns/aliases.go b/dns/aliases.go
new file mode 100644
index 00000000000..317e2b8f536
--- /dev/null
+++ b/dns/aliases.go
@@ -0,0 +1,9 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package dns
+
+import (
+ "github.com/cloudflare/cloudflare-go/internal/apierror"
+)
+
+type Error = apierror.Error
diff --git a/dns/analytics.go b/dns/analytics.go
new file mode 100644
index 00000000000..766d1fbcbd5
--- /dev/null
+++ b/dns/analytics.go
@@ -0,0 +1,26 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package dns
+
+import (
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// AnalyticsService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewAnalyticsService] method instead.
+type AnalyticsService struct {
+ Options []option.RequestOption
+ Reports *AnalyticsReportService
+}
+
+// NewAnalyticsService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewAnalyticsService(opts ...option.RequestOption) (r *AnalyticsService) {
+ r = &AnalyticsService{}
+ r.Options = opts
+ r.Reports = NewAnalyticsReportService(opts...)
+ return
+}
diff --git a/dns/analyticsreport.go b/dns/analyticsreport.go
new file mode 100644
index 00000000000..102fb481b74
--- /dev/null
+++ b/dns/analyticsreport.go
@@ -0,0 +1,272 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package dns
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// AnalyticsReportService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewAnalyticsReportService] method
+// instead.
+type AnalyticsReportService struct {
+ Options []option.RequestOption
+ Bytimes *AnalyticsReportBytimeService
+}
+
+// NewAnalyticsReportService generates a new service that applies the given options
+// to each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewAnalyticsReportService(opts ...option.RequestOption) (r *AnalyticsReportService) {
+ r = &AnalyticsReportService{}
+ r.Options = opts
+ r.Bytimes = NewAnalyticsReportBytimeService(opts...)
+ return
+}
+
+// Retrieves a list of summarised aggregate metrics over a given time period.
+//
+// See
+// [Analytics API properties](https://developers.cloudflare.com/dns/reference/analytics-api-properties/)
+// for detailed information about the available query parameters.
+func (r *AnalyticsReportService) Get(ctx context.Context, identifier string, query AnalyticsReportGetParams, opts ...option.RequestOption) (res *DNSDNSAnalyticsAPIReport, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AnalyticsReportGetResponseEnvelope
+ path := fmt.Sprintf("zones/%s/dns_analytics/report", identifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type DNSDNSAnalyticsAPIReport struct {
+ // Array with one row per combination of dimension values.
+ Data []DNSDNSAnalyticsAPIReportData `json:"data,required"`
+ // Number of seconds between current time and last processed event, in another
+ // words how many seconds of data could be missing.
+ DataLag float64 `json:"data_lag,required"`
+ // Maximum results for each metric (object mapping metric names to values).
+ // Currently always an empty object.
+ Max interface{} `json:"max,required"`
+ // Minimum results for each metric (object mapping metric names to values).
+ // Currently always an empty object.
+ Min interface{} `json:"min,required"`
+ Query DNSDNSAnalyticsAPIReportQuery `json:"query,required"`
+ // Total number of rows in the result.
+ Rows float64 `json:"rows,required"`
+ // Total results for metrics across all data (object mapping metric names to
+ // values).
+ Totals interface{} `json:"totals,required"`
+ JSON dnsdnsAnalyticsAPIReportJSON `json:"-"`
+}
+
+// dnsdnsAnalyticsAPIReportJSON contains the JSON metadata for the struct
+// [DNSDNSAnalyticsAPIReport]
+type dnsdnsAnalyticsAPIReportJSON struct {
+ Data apijson.Field
+ DataLag apijson.Field
+ Max apijson.Field
+ Min apijson.Field
+ Query apijson.Field
+ Rows apijson.Field
+ Totals apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DNSDNSAnalyticsAPIReport) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r dnsdnsAnalyticsAPIReportJSON) RawJSON() string {
+ return r.raw
+}
+
+type DNSDNSAnalyticsAPIReportData struct {
+ // Array of dimension values, representing the combination of dimension values
+ // corresponding to this row.
+ Dimensions []string `json:"dimensions,required"`
+ // Array with one item per requested metric. Each item is a single value.
+ Metrics []float64 `json:"metrics,required"`
+ JSON dnsdnsAnalyticsAPIReportDataJSON `json:"-"`
+}
+
+// dnsdnsAnalyticsAPIReportDataJSON contains the JSON metadata for the struct
+// [DNSDNSAnalyticsAPIReportData]
+type dnsdnsAnalyticsAPIReportDataJSON struct {
+ Dimensions apijson.Field
+ Metrics apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DNSDNSAnalyticsAPIReportData) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r dnsdnsAnalyticsAPIReportDataJSON) RawJSON() string {
+ return r.raw
+}
+
+type DNSDNSAnalyticsAPIReportQuery struct {
+ // Array of dimension names.
+ Dimensions []string `json:"dimensions,required"`
+ // Limit number of returned metrics.
+ Limit int64 `json:"limit,required"`
+ // Array of metric names.
+ Metrics []string `json:"metrics,required"`
+ // Start date and time of requesting data period in ISO 8601 format.
+ Since time.Time `json:"since,required" format:"date-time"`
+ // End date and time of requesting data period in ISO 8601 format.
+ Until time.Time `json:"until,required" format:"date-time"`
+ // Segmentation filter in 'attribute operator value' format.
+ Filters string `json:"filters"`
+ // Array of dimensions to sort by, where each dimension may be prefixed by -
+ // (descending) or + (ascending).
+ Sort []string `json:"sort"`
+ JSON dnsdnsAnalyticsAPIReportQueryJSON `json:"-"`
+}
+
+// dnsdnsAnalyticsAPIReportQueryJSON contains the JSON metadata for the struct
+// [DNSDNSAnalyticsAPIReportQuery]
+type dnsdnsAnalyticsAPIReportQueryJSON struct {
+ Dimensions apijson.Field
+ Limit apijson.Field
+ Metrics apijson.Field
+ Since apijson.Field
+ Until apijson.Field
+ Filters apijson.Field
+ Sort apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DNSDNSAnalyticsAPIReportQuery) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r dnsdnsAnalyticsAPIReportQueryJSON) RawJSON() string {
+ return r.raw
+}
+
+type AnalyticsReportGetParams struct {
+ // A comma-separated list of dimensions to group results by.
+ Dimensions param.Field[string] `query:"dimensions"`
+ // Segmentation filter in 'attribute operator value' format.
+ Filters param.Field[string] `query:"filters"`
+ // Limit number of returned metrics.
+ Limit param.Field[int64] `query:"limit"`
+ // A comma-separated list of metrics to query.
+ Metrics param.Field[string] `query:"metrics"`
+ // Start date and time of requesting data period in ISO 8601 format.
+ Since param.Field[time.Time] `query:"since" format:"date-time"`
+ // A comma-separated list of dimensions to sort by, where each dimension may be
+ // prefixed by - (descending) or + (ascending).
+ Sort param.Field[string] `query:"sort"`
+ // End date and time of requesting data period in ISO 8601 format.
+ Until param.Field[time.Time] `query:"until" format:"date-time"`
+}
+
+// URLQuery serializes [AnalyticsReportGetParams]'s query parameters as
+// `url.Values`.
+func (r AnalyticsReportGetParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type AnalyticsReportGetResponseEnvelope struct {
+ Errors []AnalyticsReportGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []AnalyticsReportGetResponseEnvelopeMessages `json:"messages,required"`
+ Result DNSDNSAnalyticsAPIReport `json:"result,required"`
+ // Whether the API call was successful
+ Success AnalyticsReportGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON analyticsReportGetResponseEnvelopeJSON `json:"-"`
+}
+
+// analyticsReportGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [AnalyticsReportGetResponseEnvelope]
+type analyticsReportGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AnalyticsReportGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r analyticsReportGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AnalyticsReportGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON analyticsReportGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// analyticsReportGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [AnalyticsReportGetResponseEnvelopeErrors]
+type analyticsReportGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AnalyticsReportGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r analyticsReportGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type AnalyticsReportGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON analyticsReportGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// analyticsReportGetResponseEnvelopeMessagesJSON contains the JSON metadata for
+// the struct [AnalyticsReportGetResponseEnvelopeMessages]
+type analyticsReportGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AnalyticsReportGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r analyticsReportGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type AnalyticsReportGetResponseEnvelopeSuccess bool
+
+const (
+ AnalyticsReportGetResponseEnvelopeSuccessTrue AnalyticsReportGetResponseEnvelopeSuccess = true
+)
diff --git a/dns/analyticsreport_test.go b/dns/analyticsreport_test.go
new file mode 100644
index 00000000000..e10333e306c
--- /dev/null
+++ b/dns/analyticsreport_test.go
@@ -0,0 +1,52 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package dns_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/dns"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestAnalyticsReportGetWithOptionalParams(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"),
+ )
+ _, err := client.DNS.Analytics.Reports.Get(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ dns.AnalyticsReportGetParams{
+ Dimensions: cloudflare.F("queryType"),
+ Filters: cloudflare.F("responseCode==NOERROR,queryType==A"),
+ Limit: cloudflare.F(int64(100)),
+ Metrics: cloudflare.F("queryCount,uncachedCount"),
+ Since: cloudflare.F(time.Now()),
+ Sort: cloudflare.F("+responseCode,-queryName"),
+ Until: cloudflare.F(time.Now()),
+ },
+ )
+ 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/dns/analyticsreportbytime.go b/dns/analyticsreportbytime.go
new file mode 100644
index 00000000000..9a6aa737d9c
--- /dev/null
+++ b/dns/analyticsreportbytime.go
@@ -0,0 +1,312 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package dns
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// AnalyticsReportBytimeService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewAnalyticsReportBytimeService]
+// method instead.
+type AnalyticsReportBytimeService struct {
+ Options []option.RequestOption
+}
+
+// NewAnalyticsReportBytimeService generates a new service that applies the given
+// options to each request. These options are applied after the parent client's
+// options (if there is one), and before any request-specific options.
+func NewAnalyticsReportBytimeService(opts ...option.RequestOption) (r *AnalyticsReportBytimeService) {
+ r = &AnalyticsReportBytimeService{}
+ r.Options = opts
+ return
+}
+
+// Retrieves a list of aggregate metrics grouped by time interval.
+//
+// See
+// [Analytics API properties](https://developers.cloudflare.com/dns/reference/analytics-api-properties/)
+// for detailed information about the available query parameters.
+func (r *AnalyticsReportBytimeService) Get(ctx context.Context, identifier string, query AnalyticsReportBytimeGetParams, opts ...option.RequestOption) (res *DNSDNSAnalyticsAPIReportBytime, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AnalyticsReportBytimeGetResponseEnvelope
+ path := fmt.Sprintf("zones/%s/dns_analytics/report/bytime", identifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type DNSDNSAnalyticsAPIReportBytime struct {
+ // Array with one row per combination of dimension values.
+ Data []DNSDNSAnalyticsAPIReportBytimeData `json:"data,required"`
+ // Number of seconds between current time and last processed event, in another
+ // words how many seconds of data could be missing.
+ DataLag float64 `json:"data_lag,required"`
+ // Maximum results for each metric (object mapping metric names to values).
+ // Currently always an empty object.
+ Max interface{} `json:"max,required"`
+ // Minimum results for each metric (object mapping metric names to values).
+ // Currently always an empty object.
+ Min interface{} `json:"min,required"`
+ Query DNSDNSAnalyticsAPIReportBytimeQuery `json:"query,required"`
+ // Total number of rows in the result.
+ Rows float64 `json:"rows,required"`
+ // Array of time intervals in the response data. Each interval is represented as an
+ // array containing two values: the start time, and the end time.
+ TimeIntervals [][]time.Time `json:"time_intervals,required" format:"date-time"`
+ // Total results for metrics across all data (object mapping metric names to
+ // values).
+ Totals interface{} `json:"totals,required"`
+ JSON dnsdnsAnalyticsAPIReportBytimeJSON `json:"-"`
+}
+
+// dnsdnsAnalyticsAPIReportBytimeJSON contains the JSON metadata for the struct
+// [DNSDNSAnalyticsAPIReportBytime]
+type dnsdnsAnalyticsAPIReportBytimeJSON struct {
+ Data apijson.Field
+ DataLag apijson.Field
+ Max apijson.Field
+ Min apijson.Field
+ Query apijson.Field
+ Rows apijson.Field
+ TimeIntervals apijson.Field
+ Totals apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DNSDNSAnalyticsAPIReportBytime) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r dnsdnsAnalyticsAPIReportBytimeJSON) RawJSON() string {
+ return r.raw
+}
+
+type DNSDNSAnalyticsAPIReportBytimeData struct {
+ // Array of dimension values, representing the combination of dimension values
+ // corresponding to this row.
+ Dimensions []string `json:"dimensions,required"`
+ // Array with one item per requested metric. Each item is an array of values,
+ // broken down by time interval.
+ Metrics [][]interface{} `json:"metrics,required"`
+ JSON dnsdnsAnalyticsAPIReportBytimeDataJSON `json:"-"`
+}
+
+// dnsdnsAnalyticsAPIReportBytimeDataJSON contains the JSON metadata for the struct
+// [DNSDNSAnalyticsAPIReportBytimeData]
+type dnsdnsAnalyticsAPIReportBytimeDataJSON struct {
+ Dimensions apijson.Field
+ Metrics apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DNSDNSAnalyticsAPIReportBytimeData) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r dnsdnsAnalyticsAPIReportBytimeDataJSON) RawJSON() string {
+ return r.raw
+}
+
+type DNSDNSAnalyticsAPIReportBytimeQuery struct {
+ // Array of dimension names.
+ Dimensions []string `json:"dimensions,required"`
+ // Limit number of returned metrics.
+ Limit int64 `json:"limit,required"`
+ // Array of metric names.
+ Metrics []string `json:"metrics,required"`
+ // Start date and time of requesting data period in ISO 8601 format.
+ Since time.Time `json:"since,required" format:"date-time"`
+ // Unit of time to group data by.
+ TimeDelta DNSDNSAnalyticsAPIReportBytimeQueryTimeDelta `json:"time_delta,required"`
+ // End date and time of requesting data period in ISO 8601 format.
+ Until time.Time `json:"until,required" format:"date-time"`
+ // Segmentation filter in 'attribute operator value' format.
+ Filters string `json:"filters"`
+ // Array of dimensions to sort by, where each dimension may be prefixed by -
+ // (descending) or + (ascending).
+ Sort []string `json:"sort"`
+ JSON dnsdnsAnalyticsAPIReportBytimeQueryJSON `json:"-"`
+}
+
+// dnsdnsAnalyticsAPIReportBytimeQueryJSON contains the JSON metadata for the
+// struct [DNSDNSAnalyticsAPIReportBytimeQuery]
+type dnsdnsAnalyticsAPIReportBytimeQueryJSON struct {
+ Dimensions apijson.Field
+ Limit apijson.Field
+ Metrics apijson.Field
+ Since apijson.Field
+ TimeDelta apijson.Field
+ Until apijson.Field
+ Filters apijson.Field
+ Sort apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DNSDNSAnalyticsAPIReportBytimeQuery) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r dnsdnsAnalyticsAPIReportBytimeQueryJSON) RawJSON() string {
+ return r.raw
+}
+
+// Unit of time to group data by.
+type DNSDNSAnalyticsAPIReportBytimeQueryTimeDelta string
+
+const (
+ DNSDNSAnalyticsAPIReportBytimeQueryTimeDeltaAll DNSDNSAnalyticsAPIReportBytimeQueryTimeDelta = "all"
+ DNSDNSAnalyticsAPIReportBytimeQueryTimeDeltaAuto DNSDNSAnalyticsAPIReportBytimeQueryTimeDelta = "auto"
+ DNSDNSAnalyticsAPIReportBytimeQueryTimeDeltaYear DNSDNSAnalyticsAPIReportBytimeQueryTimeDelta = "year"
+ DNSDNSAnalyticsAPIReportBytimeQueryTimeDeltaQuarter DNSDNSAnalyticsAPIReportBytimeQueryTimeDelta = "quarter"
+ DNSDNSAnalyticsAPIReportBytimeQueryTimeDeltaMonth DNSDNSAnalyticsAPIReportBytimeQueryTimeDelta = "month"
+ DNSDNSAnalyticsAPIReportBytimeQueryTimeDeltaWeek DNSDNSAnalyticsAPIReportBytimeQueryTimeDelta = "week"
+ DNSDNSAnalyticsAPIReportBytimeQueryTimeDeltaDay DNSDNSAnalyticsAPIReportBytimeQueryTimeDelta = "day"
+ DNSDNSAnalyticsAPIReportBytimeQueryTimeDeltaHour DNSDNSAnalyticsAPIReportBytimeQueryTimeDelta = "hour"
+ DNSDNSAnalyticsAPIReportBytimeQueryTimeDeltaDekaminute DNSDNSAnalyticsAPIReportBytimeQueryTimeDelta = "dekaminute"
+ DNSDNSAnalyticsAPIReportBytimeQueryTimeDeltaMinute DNSDNSAnalyticsAPIReportBytimeQueryTimeDelta = "minute"
+)
+
+type AnalyticsReportBytimeGetParams struct {
+ // A comma-separated list of dimensions to group results by.
+ Dimensions param.Field[string] `query:"dimensions"`
+ // Segmentation filter in 'attribute operator value' format.
+ Filters param.Field[string] `query:"filters"`
+ // Limit number of returned metrics.
+ Limit param.Field[int64] `query:"limit"`
+ // A comma-separated list of metrics to query.
+ Metrics param.Field[string] `query:"metrics"`
+ // Start date and time of requesting data period in ISO 8601 format.
+ Since param.Field[time.Time] `query:"since" format:"date-time"`
+ // A comma-separated list of dimensions to sort by, where each dimension may be
+ // prefixed by - (descending) or + (ascending).
+ Sort param.Field[string] `query:"sort"`
+ // Unit of time to group data by.
+ TimeDelta param.Field[AnalyticsReportBytimeGetParamsTimeDelta] `query:"time_delta"`
+ // End date and time of requesting data period in ISO 8601 format.
+ Until param.Field[time.Time] `query:"until" format:"date-time"`
+}
+
+// URLQuery serializes [AnalyticsReportBytimeGetParams]'s query parameters as
+// `url.Values`.
+func (r AnalyticsReportBytimeGetParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Unit of time to group data by.
+type AnalyticsReportBytimeGetParamsTimeDelta string
+
+const (
+ AnalyticsReportBytimeGetParamsTimeDeltaAll AnalyticsReportBytimeGetParamsTimeDelta = "all"
+ AnalyticsReportBytimeGetParamsTimeDeltaAuto AnalyticsReportBytimeGetParamsTimeDelta = "auto"
+ AnalyticsReportBytimeGetParamsTimeDeltaYear AnalyticsReportBytimeGetParamsTimeDelta = "year"
+ AnalyticsReportBytimeGetParamsTimeDeltaQuarter AnalyticsReportBytimeGetParamsTimeDelta = "quarter"
+ AnalyticsReportBytimeGetParamsTimeDeltaMonth AnalyticsReportBytimeGetParamsTimeDelta = "month"
+ AnalyticsReportBytimeGetParamsTimeDeltaWeek AnalyticsReportBytimeGetParamsTimeDelta = "week"
+ AnalyticsReportBytimeGetParamsTimeDeltaDay AnalyticsReportBytimeGetParamsTimeDelta = "day"
+ AnalyticsReportBytimeGetParamsTimeDeltaHour AnalyticsReportBytimeGetParamsTimeDelta = "hour"
+ AnalyticsReportBytimeGetParamsTimeDeltaDekaminute AnalyticsReportBytimeGetParamsTimeDelta = "dekaminute"
+ AnalyticsReportBytimeGetParamsTimeDeltaMinute AnalyticsReportBytimeGetParamsTimeDelta = "minute"
+)
+
+type AnalyticsReportBytimeGetResponseEnvelope struct {
+ Errors []AnalyticsReportBytimeGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []AnalyticsReportBytimeGetResponseEnvelopeMessages `json:"messages,required"`
+ Result DNSDNSAnalyticsAPIReportBytime `json:"result,required"`
+ // Whether the API call was successful
+ Success AnalyticsReportBytimeGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON analyticsReportBytimeGetResponseEnvelopeJSON `json:"-"`
+}
+
+// analyticsReportBytimeGetResponseEnvelopeJSON contains the JSON metadata for the
+// struct [AnalyticsReportBytimeGetResponseEnvelope]
+type analyticsReportBytimeGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AnalyticsReportBytimeGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r analyticsReportBytimeGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AnalyticsReportBytimeGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON analyticsReportBytimeGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// analyticsReportBytimeGetResponseEnvelopeErrorsJSON contains the JSON metadata
+// for the struct [AnalyticsReportBytimeGetResponseEnvelopeErrors]
+type analyticsReportBytimeGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AnalyticsReportBytimeGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r analyticsReportBytimeGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type AnalyticsReportBytimeGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON analyticsReportBytimeGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// analyticsReportBytimeGetResponseEnvelopeMessagesJSON contains the JSON metadata
+// for the struct [AnalyticsReportBytimeGetResponseEnvelopeMessages]
+type analyticsReportBytimeGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AnalyticsReportBytimeGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r analyticsReportBytimeGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type AnalyticsReportBytimeGetResponseEnvelopeSuccess bool
+
+const (
+ AnalyticsReportBytimeGetResponseEnvelopeSuccessTrue AnalyticsReportBytimeGetResponseEnvelopeSuccess = true
+)
diff --git a/dns/analyticsreportbytime_test.go b/dns/analyticsreportbytime_test.go
new file mode 100644
index 00000000000..d922d4e61ff
--- /dev/null
+++ b/dns/analyticsreportbytime_test.go
@@ -0,0 +1,53 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package dns_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/dns"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestAnalyticsReportBytimeGetWithOptionalParams(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"),
+ )
+ _, err := client.DNS.Analytics.Reports.Bytimes.Get(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ dns.AnalyticsReportBytimeGetParams{
+ Dimensions: cloudflare.F("queryType"),
+ Filters: cloudflare.F("responseCode==NOERROR,queryType==A"),
+ Limit: cloudflare.F(int64(100)),
+ Metrics: cloudflare.F("queryCount,uncachedCount"),
+ Since: cloudflare.F(time.Now()),
+ Sort: cloudflare.F("+responseCode,-queryName"),
+ TimeDelta: cloudflare.F(dns.AnalyticsReportBytimeGetParamsTimeDeltaHour),
+ Until: cloudflare.F(time.Now()),
+ },
+ )
+ 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/dns/dns.go b/dns/dns.go
new file mode 100644
index 00000000000..474b59daec8
--- /dev/null
+++ b/dns/dns.go
@@ -0,0 +1,30 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package dns
+
+import (
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// DNSService contains methods and other services that help with interacting with
+// the cloudflare API. Note, unlike clients, this service does not read variables
+// from the environment automatically. You should not instantiate this service
+// directly, and instead use the [NewDNSService] method instead.
+type DNSService struct {
+ Options []option.RequestOption
+ Records *RecordService
+ Analytics *AnalyticsService
+ Firewall *FirewallService
+}
+
+// NewDNSService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewDNSService(opts ...option.RequestOption) (r *DNSService) {
+ r = &DNSService{}
+ r.Options = opts
+ r.Records = NewRecordService(opts...)
+ r.Analytics = NewAnalyticsService(opts...)
+ r.Firewall = NewFirewallService(opts...)
+ return
+}
diff --git a/dns/firewall.go b/dns/firewall.go
new file mode 100644
index 00000000000..51a9b04ec01
--- /dev/null
+++ b/dns/firewall.go
@@ -0,0 +1,738 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package dns
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+ "reflect"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/tidwall/gjson"
+)
+
+// FirewallService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewFirewallService] method instead.
+type FirewallService struct {
+ Options []option.RequestOption
+ Analytics *FirewallAnalyticsService
+}
+
+// NewFirewallService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewFirewallService(opts ...option.RequestOption) (r *FirewallService) {
+ r = &FirewallService{}
+ r.Options = opts
+ r.Analytics = NewFirewallAnalyticsService(opts...)
+ return
+}
+
+// Create a configured DNS Firewall Cluster.
+func (r *FirewallService) New(ctx context.Context, params FirewallNewParams, opts ...option.RequestOption) (res *DNSFirewallDNSFirewall, err error) {
+ opts = append(r.Options[:], opts...)
+ var env FirewallNewResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/dns_firewall", params.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// List configured DNS Firewall clusters for an account.
+func (r *FirewallService) List(ctx context.Context, params FirewallListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[DNSFirewallDNSFirewall], err error) {
+ var raw *http.Response
+ opts = append(r.Options, opts...)
+ opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
+ path := fmt.Sprintf("accounts/%s/dns_firewall", params.AccountID)
+ cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, params, &res, opts...)
+ if err != nil {
+ return nil, err
+ }
+ err = cfg.Execute()
+ if err != nil {
+ return nil, err
+ }
+ res.SetPageConfig(cfg, raw)
+ return res, nil
+}
+
+// List configured DNS Firewall clusters for an account.
+func (r *FirewallService) ListAutoPaging(ctx context.Context, params FirewallListParams, opts ...option.RequestOption) *shared.V4PagePaginationArrayAutoPager[DNSFirewallDNSFirewall] {
+ return shared.NewV4PagePaginationArrayAutoPager(r.List(ctx, params, opts...))
+}
+
+// Delete a configured DNS Firewall Cluster.
+func (r *FirewallService) Delete(ctx context.Context, dnsFirewallID string, body FirewallDeleteParams, opts ...option.RequestOption) (res *FirewallDeleteResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env FirewallDeleteResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/dns_firewall/%s", body.AccountID, dnsFirewallID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Modify a DNS Firewall Cluster configuration.
+func (r *FirewallService) Edit(ctx context.Context, dnsFirewallID string, params FirewallEditParams, opts ...option.RequestOption) (res *DNSFirewallDNSFirewall, err error) {
+ opts = append(r.Options[:], opts...)
+ var env FirewallEditResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/dns_firewall/%s", params.AccountID, dnsFirewallID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Show a single configured DNS Firewall cluster for an account.
+func (r *FirewallService) Get(ctx context.Context, dnsFirewallID string, query FirewallGetParams, opts ...option.RequestOption) (res *DNSFirewallDNSFirewall, err error) {
+ opts = append(r.Options[:], opts...)
+ var env FirewallGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/dns_firewall/%s", query.AccountID, dnsFirewallID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type DNSFirewallDNSFirewall struct {
+ // Identifier
+ ID string `json:"id,required"`
+ // Deprecate the response to ANY requests.
+ DeprecateAnyRequests bool `json:"deprecate_any_requests,required"`
+ DNSFirewallIPs []DNSFirewallDNSFirewallDNSFirewallIP `json:"dns_firewall_ips,required" format:"ipv4"`
+ // Forward client IP (resolver) subnet if no EDNS Client Subnet is sent.
+ EcsFallback bool `json:"ecs_fallback,required"`
+ // Maximum DNS Cache TTL.
+ MaximumCacheTTL float64 `json:"maximum_cache_ttl,required"`
+ // Minimum DNS Cache TTL.
+ MinimumCacheTTL float64 `json:"minimum_cache_ttl,required"`
+ // Last modification of DNS Firewall cluster.
+ ModifiedOn time.Time `json:"modified_on,required" format:"date-time"`
+ // DNS Firewall Cluster Name.
+ Name string `json:"name,required"`
+ UpstreamIPs []DNSFirewallDNSFirewallUpstreamIP `json:"upstream_ips,required" format:"ipv4"`
+ // Attack mitigation settings.
+ AttackMitigation DNSFirewallDNSFirewallAttackMitigation `json:"attack_mitigation,nullable"`
+ // Negative DNS Cache TTL.
+ NegativeCacheTTL float64 `json:"negative_cache_ttl,nullable"`
+ // Deprecated alias for "upstream_ips".
+ OriginIPs interface{} `json:"origin_ips"`
+ // Ratelimit in queries per second per datacenter (applies to DNS queries sent to
+ // the upstream nameservers configured on the cluster).
+ Ratelimit float64 `json:"ratelimit,nullable"`
+ // Number of retries for fetching DNS responses from upstream nameservers (not
+ // counting the initial attempt).
+ Retries float64 `json:"retries"`
+ JSON dnsFirewallDNSFirewallJSON `json:"-"`
+}
+
+// dnsFirewallDNSFirewallJSON contains the JSON metadata for the struct
+// [DNSFirewallDNSFirewall]
+type dnsFirewallDNSFirewallJSON struct {
+ ID apijson.Field
+ DeprecateAnyRequests apijson.Field
+ DNSFirewallIPs apijson.Field
+ EcsFallback apijson.Field
+ MaximumCacheTTL apijson.Field
+ MinimumCacheTTL apijson.Field
+ ModifiedOn apijson.Field
+ Name apijson.Field
+ UpstreamIPs apijson.Field
+ AttackMitigation apijson.Field
+ NegativeCacheTTL apijson.Field
+ OriginIPs apijson.Field
+ Ratelimit apijson.Field
+ Retries apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DNSFirewallDNSFirewall) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r dnsFirewallDNSFirewallJSON) RawJSON() string {
+ return r.raw
+}
+
+// Cloudflare-assigned DNS IPv4 Address.
+//
+// Union satisfied by [shared.UnionString] or [shared.UnionString].
+type DNSFirewallDNSFirewallDNSFirewallIP interface {
+ ImplementsDNSDNSFirewallDNSFirewallDNSFirewallIP()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*DNSFirewallDNSFirewallDNSFirewallIP)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+// Upstream DNS Server IPv4 Address.
+//
+// Union satisfied by [shared.UnionString] or [shared.UnionString].
+type DNSFirewallDNSFirewallUpstreamIP interface {
+ ImplementsDNSDNSFirewallDNSFirewallUpstreamIP()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*DNSFirewallDNSFirewallUpstreamIP)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+// Attack mitigation settings.
+type DNSFirewallDNSFirewallAttackMitigation struct {
+ // When enabled, random-prefix attacks are automatically mitigated and the upstream
+ // DNS servers protected.
+ Enabled bool `json:"enabled"`
+ // Deprecated alias for "only_when_upstream_unhealthy".
+ OnlyWhenOriginUnhealthy interface{} `json:"only_when_origin_unhealthy"`
+ // Only mitigate attacks when upstream servers seem unhealthy.
+ OnlyWhenUpstreamUnhealthy bool `json:"only_when_upstream_unhealthy"`
+ JSON dnsFirewallDNSFirewallAttackMitigationJSON `json:"-"`
+}
+
+// dnsFirewallDNSFirewallAttackMitigationJSON contains the JSON metadata for the
+// struct [DNSFirewallDNSFirewallAttackMitigation]
+type dnsFirewallDNSFirewallAttackMitigationJSON struct {
+ Enabled apijson.Field
+ OnlyWhenOriginUnhealthy apijson.Field
+ OnlyWhenUpstreamUnhealthy apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DNSFirewallDNSFirewallAttackMitigation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r dnsFirewallDNSFirewallAttackMitigationJSON) RawJSON() string {
+ return r.raw
+}
+
+type FirewallDeleteResponse struct {
+ // Identifier
+ ID string `json:"id"`
+ JSON firewallDeleteResponseJSON `json:"-"`
+}
+
+// firewallDeleteResponseJSON contains the JSON metadata for the struct
+// [FirewallDeleteResponse]
+type firewallDeleteResponseJSON struct {
+ ID apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *FirewallDeleteResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r firewallDeleteResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type FirewallNewParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ // DNS Firewall Cluster Name.
+ Name param.Field[string] `json:"name,required"`
+ UpstreamIPs param.Field[[]FirewallNewParamsUpstreamIP] `json:"upstream_ips,required" format:"ipv4"`
+ // Attack mitigation settings.
+ AttackMitigation param.Field[FirewallNewParamsAttackMitigation] `json:"attack_mitigation"`
+ // Deprecate the response to ANY requests.
+ DeprecateAnyRequests param.Field[bool] `json:"deprecate_any_requests"`
+ // Forward client IP (resolver) subnet if no EDNS Client Subnet is sent.
+ EcsFallback param.Field[bool] `json:"ecs_fallback"`
+ // Maximum DNS Cache TTL.
+ MaximumCacheTTL param.Field[float64] `json:"maximum_cache_ttl"`
+ // Minimum DNS Cache TTL.
+ MinimumCacheTTL param.Field[float64] `json:"minimum_cache_ttl"`
+ // Negative DNS Cache TTL.
+ NegativeCacheTTL param.Field[float64] `json:"negative_cache_ttl"`
+ // Deprecated alias for "upstream_ips".
+ OriginIPs param.Field[interface{}] `json:"origin_ips"`
+ // Ratelimit in queries per second per datacenter (applies to DNS queries sent to
+ // the upstream nameservers configured on the cluster).
+ Ratelimit param.Field[float64] `json:"ratelimit"`
+ // Number of retries for fetching DNS responses from upstream nameservers (not
+ // counting the initial attempt).
+ Retries param.Field[float64] `json:"retries"`
+}
+
+func (r FirewallNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Upstream DNS Server IPv4 Address.
+//
+// Satisfied by [shared.UnionString], [shared.UnionString].
+type FirewallNewParamsUpstreamIP interface {
+ ImplementsDNSFirewallNewParamsUpstreamIP()
+}
+
+// Attack mitigation settings.
+type FirewallNewParamsAttackMitigation struct {
+ // When enabled, random-prefix attacks are automatically mitigated and the upstream
+ // DNS servers protected.
+ Enabled param.Field[bool] `json:"enabled"`
+ // Deprecated alias for "only_when_upstream_unhealthy".
+ OnlyWhenOriginUnhealthy param.Field[interface{}] `json:"only_when_origin_unhealthy"`
+ // Only mitigate attacks when upstream servers seem unhealthy.
+ OnlyWhenUpstreamUnhealthy param.Field[bool] `json:"only_when_upstream_unhealthy"`
+}
+
+func (r FirewallNewParamsAttackMitigation) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type FirewallNewResponseEnvelope struct {
+ Errors []FirewallNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []FirewallNewResponseEnvelopeMessages `json:"messages,required"`
+ Result DNSFirewallDNSFirewall `json:"result,required"`
+ // Whether the API call was successful
+ Success FirewallNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON firewallNewResponseEnvelopeJSON `json:"-"`
+}
+
+// firewallNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [FirewallNewResponseEnvelope]
+type firewallNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *FirewallNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r firewallNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type FirewallNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON firewallNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// firewallNewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [FirewallNewResponseEnvelopeErrors]
+type firewallNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *FirewallNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r firewallNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type FirewallNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON firewallNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// firewallNewResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [FirewallNewResponseEnvelopeMessages]
+type firewallNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *FirewallNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r firewallNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type FirewallNewResponseEnvelopeSuccess bool
+
+const (
+ FirewallNewResponseEnvelopeSuccessTrue FirewallNewResponseEnvelopeSuccess = true
+)
+
+type FirewallListParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ // Page number of paginated results.
+ Page param.Field[float64] `query:"page"`
+ // Number of clusters per page.
+ PerPage param.Field[float64] `query:"per_page"`
+}
+
+// URLQuery serializes [FirewallListParams]'s query parameters as `url.Values`.
+func (r FirewallListParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type FirewallDeleteParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type FirewallDeleteResponseEnvelope struct {
+ Errors []FirewallDeleteResponseEnvelopeErrors `json:"errors,required"`
+ Messages []FirewallDeleteResponseEnvelopeMessages `json:"messages,required"`
+ Result FirewallDeleteResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success FirewallDeleteResponseEnvelopeSuccess `json:"success,required"`
+ JSON firewallDeleteResponseEnvelopeJSON `json:"-"`
+}
+
+// firewallDeleteResponseEnvelopeJSON contains the JSON metadata for the struct
+// [FirewallDeleteResponseEnvelope]
+type firewallDeleteResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *FirewallDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r firewallDeleteResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type FirewallDeleteResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON firewallDeleteResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// firewallDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [FirewallDeleteResponseEnvelopeErrors]
+type firewallDeleteResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *FirewallDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r firewallDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type FirewallDeleteResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON firewallDeleteResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// firewallDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [FirewallDeleteResponseEnvelopeMessages]
+type firewallDeleteResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *FirewallDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r firewallDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type FirewallDeleteResponseEnvelopeSuccess bool
+
+const (
+ FirewallDeleteResponseEnvelopeSuccessTrue FirewallDeleteResponseEnvelopeSuccess = true
+)
+
+type FirewallEditParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ // Deprecate the response to ANY requests.
+ DeprecateAnyRequests param.Field[bool] `json:"deprecate_any_requests,required"`
+ DNSFirewallIPs param.Field[[]FirewallEditParamsDNSFirewallIP] `json:"dns_firewall_ips,required" format:"ipv4"`
+ // Forward client IP (resolver) subnet if no EDNS Client Subnet is sent.
+ EcsFallback param.Field[bool] `json:"ecs_fallback,required"`
+ // Maximum DNS Cache TTL.
+ MaximumCacheTTL param.Field[float64] `json:"maximum_cache_ttl,required"`
+ // Minimum DNS Cache TTL.
+ MinimumCacheTTL param.Field[float64] `json:"minimum_cache_ttl,required"`
+ // DNS Firewall Cluster Name.
+ Name param.Field[string] `json:"name,required"`
+ UpstreamIPs param.Field[[]FirewallEditParamsUpstreamIP] `json:"upstream_ips,required" format:"ipv4"`
+ // Attack mitigation settings.
+ AttackMitigation param.Field[FirewallEditParamsAttackMitigation] `json:"attack_mitigation"`
+ // Negative DNS Cache TTL.
+ NegativeCacheTTL param.Field[float64] `json:"negative_cache_ttl"`
+ // Deprecated alias for "upstream_ips".
+ OriginIPs param.Field[interface{}] `json:"origin_ips"`
+ // Ratelimit in queries per second per datacenter (applies to DNS queries sent to
+ // the upstream nameservers configured on the cluster).
+ Ratelimit param.Field[float64] `json:"ratelimit"`
+ // Number of retries for fetching DNS responses from upstream nameservers (not
+ // counting the initial attempt).
+ Retries param.Field[float64] `json:"retries"`
+}
+
+func (r FirewallEditParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Cloudflare-assigned DNS IPv4 Address.
+//
+// Satisfied by [shared.UnionString], [shared.UnionString].
+type FirewallEditParamsDNSFirewallIP interface {
+ ImplementsDNSFirewallEditParamsDNSFirewallIP()
+}
+
+// Upstream DNS Server IPv4 Address.
+//
+// Satisfied by [shared.UnionString], [shared.UnionString].
+type FirewallEditParamsUpstreamIP interface {
+ ImplementsDNSFirewallEditParamsUpstreamIP()
+}
+
+// Attack mitigation settings.
+type FirewallEditParamsAttackMitigation struct {
+ // When enabled, random-prefix attacks are automatically mitigated and the upstream
+ // DNS servers protected.
+ Enabled param.Field[bool] `json:"enabled"`
+ // Deprecated alias for "only_when_upstream_unhealthy".
+ OnlyWhenOriginUnhealthy param.Field[interface{}] `json:"only_when_origin_unhealthy"`
+ // Only mitigate attacks when upstream servers seem unhealthy.
+ OnlyWhenUpstreamUnhealthy param.Field[bool] `json:"only_when_upstream_unhealthy"`
+}
+
+func (r FirewallEditParamsAttackMitigation) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type FirewallEditResponseEnvelope struct {
+ Errors []FirewallEditResponseEnvelopeErrors `json:"errors,required"`
+ Messages []FirewallEditResponseEnvelopeMessages `json:"messages,required"`
+ Result DNSFirewallDNSFirewall `json:"result,required"`
+ // Whether the API call was successful
+ Success FirewallEditResponseEnvelopeSuccess `json:"success,required"`
+ JSON firewallEditResponseEnvelopeJSON `json:"-"`
+}
+
+// firewallEditResponseEnvelopeJSON contains the JSON metadata for the struct
+// [FirewallEditResponseEnvelope]
+type firewallEditResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *FirewallEditResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r firewallEditResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type FirewallEditResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON firewallEditResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// firewallEditResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [FirewallEditResponseEnvelopeErrors]
+type firewallEditResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *FirewallEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r firewallEditResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type FirewallEditResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON firewallEditResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// firewallEditResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [FirewallEditResponseEnvelopeMessages]
+type firewallEditResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *FirewallEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r firewallEditResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type FirewallEditResponseEnvelopeSuccess bool
+
+const (
+ FirewallEditResponseEnvelopeSuccessTrue FirewallEditResponseEnvelopeSuccess = true
+)
+
+type FirewallGetParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type FirewallGetResponseEnvelope struct {
+ Errors []FirewallGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []FirewallGetResponseEnvelopeMessages `json:"messages,required"`
+ Result DNSFirewallDNSFirewall `json:"result,required"`
+ // Whether the API call was successful
+ Success FirewallGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON firewallGetResponseEnvelopeJSON `json:"-"`
+}
+
+// firewallGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [FirewallGetResponseEnvelope]
+type firewallGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *FirewallGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r firewallGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type FirewallGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON firewallGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// firewallGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [FirewallGetResponseEnvelopeErrors]
+type firewallGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *FirewallGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r firewallGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type FirewallGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON firewallGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// firewallGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [FirewallGetResponseEnvelopeMessages]
+type firewallGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *FirewallGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r firewallGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type FirewallGetResponseEnvelopeSuccess bool
+
+const (
+ FirewallGetResponseEnvelopeSuccessTrue FirewallGetResponseEnvelopeSuccess = true
+)
diff --git a/dns/firewall_test.go b/dns/firewall_test.go
new file mode 100644
index 00000000000..25536f64a0b
--- /dev/null
+++ b/dns/firewall_test.go
@@ -0,0 +1,191 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package dns_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/dns"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestFirewallNewWithOptionalParams(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"),
+ )
+ _, err := client.DNS.Firewall.New(context.TODO(), dns.FirewallNewParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Name: cloudflare.F("My Awesome DNS Firewall cluster"),
+ UpstreamIPs: cloudflare.F([]dns.FirewallNewParamsUpstreamIP{shared.UnionString("192.0.2.1"), shared.UnionString("198.51.100.1"), shared.UnionString("2001:DB8:100::CF")}),
+ AttackMitigation: cloudflare.F(dns.FirewallNewParamsAttackMitigation{
+ Enabled: cloudflare.F(true),
+ OnlyWhenOriginUnhealthy: cloudflare.F[any](map[string]interface{}{}),
+ OnlyWhenUpstreamUnhealthy: cloudflare.F(false),
+ }),
+ DeprecateAnyRequests: cloudflare.F(true),
+ EcsFallback: cloudflare.F(false),
+ MaximumCacheTTL: cloudflare.F(900.000000),
+ MinimumCacheTTL: cloudflare.F(60.000000),
+ NegativeCacheTTL: cloudflare.F(900.000000),
+ OriginIPs: cloudflare.F[any](map[string]interface{}{}),
+ Ratelimit: cloudflare.F(600.000000),
+ Retries: cloudflare.F(2.000000),
+ })
+ 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())
+ }
+}
+
+func TestFirewallListWithOptionalParams(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"),
+ )
+ _, err := client.DNS.Firewall.List(context.TODO(), dns.FirewallListParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Page: cloudflare.F(1.000000),
+ PerPage: cloudflare.F(1.000000),
+ })
+ 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())
+ }
+}
+
+func TestFirewallDelete(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"),
+ )
+ _, err := client.DNS.Firewall.Delete(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ dns.FirewallDeleteParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestFirewallEditWithOptionalParams(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"),
+ )
+ _, err := client.DNS.Firewall.Edit(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ dns.FirewallEditParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ DeprecateAnyRequests: cloudflare.F(true),
+ DNSFirewallIPs: cloudflare.F([]dns.FirewallEditParamsDNSFirewallIP{shared.UnionString("203.0.113.1"), shared.UnionString("203.0.113.254"), shared.UnionString("2001:DB8:AB::CF"), shared.UnionString("2001:DB8:CD::CF")}),
+ EcsFallback: cloudflare.F(false),
+ MaximumCacheTTL: cloudflare.F(900.000000),
+ MinimumCacheTTL: cloudflare.F(60.000000),
+ Name: cloudflare.F("My Awesome DNS Firewall cluster"),
+ UpstreamIPs: cloudflare.F([]dns.FirewallEditParamsUpstreamIP{shared.UnionString("192.0.2.1"), shared.UnionString("198.51.100.1"), shared.UnionString("2001:DB8:100::CF")}),
+ AttackMitigation: cloudflare.F(dns.FirewallEditParamsAttackMitigation{
+ Enabled: cloudflare.F(true),
+ OnlyWhenOriginUnhealthy: cloudflare.F[any](map[string]interface{}{}),
+ OnlyWhenUpstreamUnhealthy: cloudflare.F(false),
+ }),
+ NegativeCacheTTL: cloudflare.F(900.000000),
+ OriginIPs: cloudflare.F[any](map[string]interface{}{}),
+ Ratelimit: cloudflare.F(600.000000),
+ Retries: cloudflare.F(2.000000),
+ },
+ )
+ 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())
+ }
+}
+
+func TestFirewallGet(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"),
+ )
+ _, err := client.DNS.Firewall.Get(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ dns.FirewallGetParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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/dns/firewallanalytics.go b/dns/firewallanalytics.go
new file mode 100644
index 00000000000..be749ce9d0c
--- /dev/null
+++ b/dns/firewallanalytics.go
@@ -0,0 +1,27 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package dns
+
+import (
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// FirewallAnalyticsService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewFirewallAnalyticsService] method
+// instead.
+type FirewallAnalyticsService struct {
+ Options []option.RequestOption
+ Reports *FirewallAnalyticsReportService
+}
+
+// NewFirewallAnalyticsService generates a new service that applies the given
+// options to each request. These options are applied after the parent client's
+// options (if there is one), and before any request-specific options.
+func NewFirewallAnalyticsService(opts ...option.RequestOption) (r *FirewallAnalyticsService) {
+ r = &FirewallAnalyticsService{}
+ r.Options = opts
+ r.Reports = NewFirewallAnalyticsReportService(opts...)
+ return
+}
diff --git a/dns/firewallanalyticsreport.go b/dns/firewallanalyticsreport.go
new file mode 100644
index 00000000000..d6c63c0a248
--- /dev/null
+++ b/dns/firewallanalyticsreport.go
@@ -0,0 +1,162 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package dns
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// FirewallAnalyticsReportService contains methods and other services that help
+// with interacting with the cloudflare API. Note, unlike clients, this service
+// does not read variables from the environment automatically. You should not
+// instantiate this service directly, and instead use the
+// [NewFirewallAnalyticsReportService] method instead.
+type FirewallAnalyticsReportService struct {
+ Options []option.RequestOption
+ Bytimes *FirewallAnalyticsReportBytimeService
+}
+
+// NewFirewallAnalyticsReportService generates a new service that applies the given
+// options to each request. These options are applied after the parent client's
+// options (if there is one), and before any request-specific options.
+func NewFirewallAnalyticsReportService(opts ...option.RequestOption) (r *FirewallAnalyticsReportService) {
+ r = &FirewallAnalyticsReportService{}
+ r.Options = opts
+ r.Bytimes = NewFirewallAnalyticsReportBytimeService(opts...)
+ return
+}
+
+// Retrieves a list of summarised aggregate metrics over a given time period.
+//
+// See
+// [Analytics API properties](https://developers.cloudflare.com/dns/reference/analytics-api-properties/)
+// for detailed information about the available query parameters.
+func (r *FirewallAnalyticsReportService) Get(ctx context.Context, accountIdentifier string, identifier string, query FirewallAnalyticsReportGetParams, opts ...option.RequestOption) (res *DNSDNSAnalyticsAPIReport, err error) {
+ opts = append(r.Options[:], opts...)
+ var env FirewallAnalyticsReportGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/dns_firewall/%s/dns_analytics/report", accountIdentifier, identifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type FirewallAnalyticsReportGetParams struct {
+ // A comma-separated list of dimensions to group results by.
+ Dimensions param.Field[string] `query:"dimensions"`
+ // Segmentation filter in 'attribute operator value' format.
+ Filters param.Field[string] `query:"filters"`
+ // Limit number of returned metrics.
+ Limit param.Field[int64] `query:"limit"`
+ // A comma-separated list of metrics to query.
+ Metrics param.Field[string] `query:"metrics"`
+ // Start date and time of requesting data period in ISO 8601 format.
+ Since param.Field[time.Time] `query:"since" format:"date-time"`
+ // A comma-separated list of dimensions to sort by, where each dimension may be
+ // prefixed by - (descending) or + (ascending).
+ Sort param.Field[string] `query:"sort"`
+ // End date and time of requesting data period in ISO 8601 format.
+ Until param.Field[time.Time] `query:"until" format:"date-time"`
+}
+
+// URLQuery serializes [FirewallAnalyticsReportGetParams]'s query parameters as
+// `url.Values`.
+func (r FirewallAnalyticsReportGetParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type FirewallAnalyticsReportGetResponseEnvelope struct {
+ Errors []FirewallAnalyticsReportGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []FirewallAnalyticsReportGetResponseEnvelopeMessages `json:"messages,required"`
+ Result DNSDNSAnalyticsAPIReport `json:"result,required"`
+ // Whether the API call was successful
+ Success FirewallAnalyticsReportGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON firewallAnalyticsReportGetResponseEnvelopeJSON `json:"-"`
+}
+
+// firewallAnalyticsReportGetResponseEnvelopeJSON contains the JSON metadata for
+// the struct [FirewallAnalyticsReportGetResponseEnvelope]
+type firewallAnalyticsReportGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *FirewallAnalyticsReportGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r firewallAnalyticsReportGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type FirewallAnalyticsReportGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON firewallAnalyticsReportGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// firewallAnalyticsReportGetResponseEnvelopeErrorsJSON contains the JSON metadata
+// for the struct [FirewallAnalyticsReportGetResponseEnvelopeErrors]
+type firewallAnalyticsReportGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *FirewallAnalyticsReportGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r firewallAnalyticsReportGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type FirewallAnalyticsReportGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON firewallAnalyticsReportGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// firewallAnalyticsReportGetResponseEnvelopeMessagesJSON contains the JSON
+// metadata for the struct [FirewallAnalyticsReportGetResponseEnvelopeMessages]
+type firewallAnalyticsReportGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *FirewallAnalyticsReportGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r firewallAnalyticsReportGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type FirewallAnalyticsReportGetResponseEnvelopeSuccess bool
+
+const (
+ FirewallAnalyticsReportGetResponseEnvelopeSuccessTrue FirewallAnalyticsReportGetResponseEnvelopeSuccess = true
+)
diff --git a/dns/firewallanalyticsreport_test.go b/dns/firewallanalyticsreport_test.go
new file mode 100644
index 00000000000..5f64c884a96
--- /dev/null
+++ b/dns/firewallanalyticsreport_test.go
@@ -0,0 +1,53 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package dns_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/dns"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestFirewallAnalyticsReportGetWithOptionalParams(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"),
+ )
+ _, err := client.DNS.Firewall.Analytics.Reports.Get(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ dns.FirewallAnalyticsReportGetParams{
+ Dimensions: cloudflare.F("queryType"),
+ Filters: cloudflare.F("responseCode==NOERROR,queryType==A"),
+ Limit: cloudflare.F(int64(100)),
+ Metrics: cloudflare.F("queryCount,uncachedCount"),
+ Since: cloudflare.F(time.Now()),
+ Sort: cloudflare.F("+responseCode,-queryName"),
+ Until: cloudflare.F(time.Now()),
+ },
+ )
+ 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/dns/firewallanalyticsreportbytime.go b/dns/firewallanalyticsreportbytime.go
new file mode 100644
index 00000000000..ecbf19b4fc7
--- /dev/null
+++ b/dns/firewallanalyticsreportbytime.go
@@ -0,0 +1,179 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package dns
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// FirewallAnalyticsReportBytimeService contains methods and other services that
+// help with interacting with the cloudflare API. Note, unlike clients, this
+// service does not read variables from the environment automatically. You should
+// not instantiate this service directly, and instead use the
+// [NewFirewallAnalyticsReportBytimeService] method instead.
+type FirewallAnalyticsReportBytimeService struct {
+ Options []option.RequestOption
+}
+
+// NewFirewallAnalyticsReportBytimeService generates a new service that applies the
+// given options to each request. These options are applied after the parent
+// client's options (if there is one), and before any request-specific options.
+func NewFirewallAnalyticsReportBytimeService(opts ...option.RequestOption) (r *FirewallAnalyticsReportBytimeService) {
+ r = &FirewallAnalyticsReportBytimeService{}
+ r.Options = opts
+ return
+}
+
+// Retrieves a list of aggregate metrics grouped by time interval.
+//
+// See
+// [Analytics API properties](https://developers.cloudflare.com/dns/reference/analytics-api-properties/)
+// for detailed information about the available query parameters.
+func (r *FirewallAnalyticsReportBytimeService) Get(ctx context.Context, accountIdentifier string, identifier string, query FirewallAnalyticsReportBytimeGetParams, opts ...option.RequestOption) (res *DNSDNSAnalyticsAPIReportBytime, err error) {
+ opts = append(r.Options[:], opts...)
+ var env FirewallAnalyticsReportBytimeGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/dns_firewall/%s/dns_analytics/report/bytime", accountIdentifier, identifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type FirewallAnalyticsReportBytimeGetParams struct {
+ // A comma-separated list of dimensions to group results by.
+ Dimensions param.Field[string] `query:"dimensions"`
+ // Segmentation filter in 'attribute operator value' format.
+ Filters param.Field[string] `query:"filters"`
+ // Limit number of returned metrics.
+ Limit param.Field[int64] `query:"limit"`
+ // A comma-separated list of metrics to query.
+ Metrics param.Field[string] `query:"metrics"`
+ // Start date and time of requesting data period in ISO 8601 format.
+ Since param.Field[time.Time] `query:"since" format:"date-time"`
+ // A comma-separated list of dimensions to sort by, where each dimension may be
+ // prefixed by - (descending) or + (ascending).
+ Sort param.Field[string] `query:"sort"`
+ // Unit of time to group data by.
+ TimeDelta param.Field[FirewallAnalyticsReportBytimeGetParamsTimeDelta] `query:"time_delta"`
+ // End date and time of requesting data period in ISO 8601 format.
+ Until param.Field[time.Time] `query:"until" format:"date-time"`
+}
+
+// URLQuery serializes [FirewallAnalyticsReportBytimeGetParams]'s query parameters
+// as `url.Values`.
+func (r FirewallAnalyticsReportBytimeGetParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Unit of time to group data by.
+type FirewallAnalyticsReportBytimeGetParamsTimeDelta string
+
+const (
+ FirewallAnalyticsReportBytimeGetParamsTimeDeltaAll FirewallAnalyticsReportBytimeGetParamsTimeDelta = "all"
+ FirewallAnalyticsReportBytimeGetParamsTimeDeltaAuto FirewallAnalyticsReportBytimeGetParamsTimeDelta = "auto"
+ FirewallAnalyticsReportBytimeGetParamsTimeDeltaYear FirewallAnalyticsReportBytimeGetParamsTimeDelta = "year"
+ FirewallAnalyticsReportBytimeGetParamsTimeDeltaQuarter FirewallAnalyticsReportBytimeGetParamsTimeDelta = "quarter"
+ FirewallAnalyticsReportBytimeGetParamsTimeDeltaMonth FirewallAnalyticsReportBytimeGetParamsTimeDelta = "month"
+ FirewallAnalyticsReportBytimeGetParamsTimeDeltaWeek FirewallAnalyticsReportBytimeGetParamsTimeDelta = "week"
+ FirewallAnalyticsReportBytimeGetParamsTimeDeltaDay FirewallAnalyticsReportBytimeGetParamsTimeDelta = "day"
+ FirewallAnalyticsReportBytimeGetParamsTimeDeltaHour FirewallAnalyticsReportBytimeGetParamsTimeDelta = "hour"
+ FirewallAnalyticsReportBytimeGetParamsTimeDeltaDekaminute FirewallAnalyticsReportBytimeGetParamsTimeDelta = "dekaminute"
+ FirewallAnalyticsReportBytimeGetParamsTimeDeltaMinute FirewallAnalyticsReportBytimeGetParamsTimeDelta = "minute"
+)
+
+type FirewallAnalyticsReportBytimeGetResponseEnvelope struct {
+ Errors []FirewallAnalyticsReportBytimeGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []FirewallAnalyticsReportBytimeGetResponseEnvelopeMessages `json:"messages,required"`
+ Result DNSDNSAnalyticsAPIReportBytime `json:"result,required"`
+ // Whether the API call was successful
+ Success FirewallAnalyticsReportBytimeGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON firewallAnalyticsReportBytimeGetResponseEnvelopeJSON `json:"-"`
+}
+
+// firewallAnalyticsReportBytimeGetResponseEnvelopeJSON contains the JSON metadata
+// for the struct [FirewallAnalyticsReportBytimeGetResponseEnvelope]
+type firewallAnalyticsReportBytimeGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *FirewallAnalyticsReportBytimeGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r firewallAnalyticsReportBytimeGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type FirewallAnalyticsReportBytimeGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON firewallAnalyticsReportBytimeGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// firewallAnalyticsReportBytimeGetResponseEnvelopeErrorsJSON contains the JSON
+// metadata for the struct [FirewallAnalyticsReportBytimeGetResponseEnvelopeErrors]
+type firewallAnalyticsReportBytimeGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *FirewallAnalyticsReportBytimeGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r firewallAnalyticsReportBytimeGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type FirewallAnalyticsReportBytimeGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON firewallAnalyticsReportBytimeGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// firewallAnalyticsReportBytimeGetResponseEnvelopeMessagesJSON contains the JSON
+// metadata for the struct
+// [FirewallAnalyticsReportBytimeGetResponseEnvelopeMessages]
+type firewallAnalyticsReportBytimeGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *FirewallAnalyticsReportBytimeGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r firewallAnalyticsReportBytimeGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type FirewallAnalyticsReportBytimeGetResponseEnvelopeSuccess bool
+
+const (
+ FirewallAnalyticsReportBytimeGetResponseEnvelopeSuccessTrue FirewallAnalyticsReportBytimeGetResponseEnvelopeSuccess = true
+)
diff --git a/dns/firewallanalyticsreportbytime_test.go b/dns/firewallanalyticsreportbytime_test.go
new file mode 100644
index 00000000000..dcf25f118b0
--- /dev/null
+++ b/dns/firewallanalyticsreportbytime_test.go
@@ -0,0 +1,54 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package dns_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/dns"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestFirewallAnalyticsReportBytimeGetWithOptionalParams(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"),
+ )
+ _, err := client.DNS.Firewall.Analytics.Reports.Bytimes.Get(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ dns.FirewallAnalyticsReportBytimeGetParams{
+ Dimensions: cloudflare.F("queryType"),
+ Filters: cloudflare.F("responseCode==NOERROR,queryType==A"),
+ Limit: cloudflare.F(int64(100)),
+ Metrics: cloudflare.F("queryCount,uncachedCount"),
+ Since: cloudflare.F(time.Now()),
+ Sort: cloudflare.F("+responseCode,-queryName"),
+ TimeDelta: cloudflare.F(dns.FirewallAnalyticsReportBytimeGetParamsTimeDeltaHour),
+ Until: cloudflare.F(time.Now()),
+ },
+ )
+ 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/dns/record.go b/dns/record.go
new file mode 100644
index 00000000000..4331a733fdb
--- /dev/null
+++ b/dns/record.go
@@ -0,0 +1,17901 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package dns
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+ "reflect"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/tidwall/gjson"
+)
+
+// RecordService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewRecordService] method instead.
+type RecordService struct {
+ Options []option.RequestOption
+}
+
+// NewRecordService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewRecordService(opts ...option.RequestOption) (r *RecordService) {
+ r = &RecordService{}
+ r.Options = opts
+ return
+}
+
+// Create a new DNS record for a zone.
+//
+// Notes:
+//
+// - A/AAAA records cannot exist on the same name as CNAME records.
+// - NS records cannot exist on the same name as any other record type.
+// - Domain names are always represented in Punycode, even if Unicode characters
+// were used when creating the record.
+func (r *RecordService) New(ctx context.Context, params RecordNewParams, opts ...option.RequestOption) (res *RecordNewResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RecordNewResponseEnvelope
+ path := fmt.Sprintf("zones/%s/dns_records", params.ZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Overwrite an existing DNS record. Notes:
+//
+// - A/AAAA records cannot exist on the same name as CNAME records.
+// - NS records cannot exist on the same name as any other record type.
+// - Domain names are always represented in Punycode, even if Unicode characters
+// were used when creating the record.
+func (r *RecordService) Update(ctx context.Context, dnsRecordID string, params RecordUpdateParams, opts ...option.RequestOption) (res *RecordUpdateResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RecordUpdateResponseEnvelope
+ path := fmt.Sprintf("zones/%s/dns_records/%s", params.ZoneID, dnsRecordID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// List, search, sort, and filter a zones' DNS records.
+func (r *RecordService) List(ctx context.Context, params RecordListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[RecordListResponse], err error) {
+ var raw *http.Response
+ opts = append(r.Options, opts...)
+ opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
+ path := fmt.Sprintf("zones/%s/dns_records", params.ZoneID)
+ cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, params, &res, opts...)
+ if err != nil {
+ return nil, err
+ }
+ err = cfg.Execute()
+ if err != nil {
+ return nil, err
+ }
+ res.SetPageConfig(cfg, raw)
+ return res, nil
+}
+
+// List, search, sort, and filter a zones' DNS records.
+func (r *RecordService) ListAutoPaging(ctx context.Context, params RecordListParams, opts ...option.RequestOption) *shared.V4PagePaginationArrayAutoPager[RecordListResponse] {
+ return shared.NewV4PagePaginationArrayAutoPager(r.List(ctx, params, opts...))
+}
+
+// Delete DNS Record
+func (r *RecordService) Delete(ctx context.Context, dnsRecordID string, body RecordDeleteParams, opts ...option.RequestOption) (res *RecordDeleteResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RecordDeleteResponseEnvelope
+ path := fmt.Sprintf("zones/%s/dns_records/%s", body.ZoneID, dnsRecordID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Update an existing DNS record. Notes:
+//
+// - A/AAAA records cannot exist on the same name as CNAME records.
+// - NS records cannot exist on the same name as any other record type.
+// - Domain names are always represented in Punycode, even if Unicode characters
+// were used when creating the record.
+func (r *RecordService) Edit(ctx context.Context, dnsRecordID string, params RecordEditParams, opts ...option.RequestOption) (res *RecordEditResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RecordEditResponseEnvelope
+ path := fmt.Sprintf("zones/%s/dns_records/%s", params.ZoneID, dnsRecordID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// You can export your
+// [BIND config](https://en.wikipedia.org/wiki/Zone_file "Zone file") through this
+// endpoint.
+//
+// See
+// [the documentation](https://developers.cloudflare.com/dns/manage-dns-records/how-to/import-and-export/ "Import and export records")
+// for more information.
+func (r *RecordService) Export(ctx context.Context, query RecordExportParams, opts ...option.RequestOption) (res *string, err error) {
+ opts = append(r.Options[:], opts...)
+ opts = append([]option.RequestOption{option.WithHeader("Accept", "text/plain")}, opts...)
+ path := fmt.Sprintf("zones/%s/dns_records/export", query.ZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &res, opts...)
+ return
+}
+
+// DNS Record Details
+func (r *RecordService) Get(ctx context.Context, dnsRecordID string, query RecordGetParams, opts ...option.RequestOption) (res *RecordGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RecordGetResponseEnvelope
+ path := fmt.Sprintf("zones/%s/dns_records/%s", query.ZoneID, dnsRecordID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// You can upload your
+// [BIND config](https://en.wikipedia.org/wiki/Zone_file "Zone file") through this
+// endpoint. It assumes that cURL is called from a location with bind_config.txt
+// (valid BIND config) present.
+//
+// See
+// [the documentation](https://developers.cloudflare.com/dns/manage-dns-records/how-to/import-and-export/ "Import and export records")
+// for more information.
+func (r *RecordService) Import(ctx context.Context, params RecordImportParams, opts ...option.RequestOption) (res *RecordImportResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RecordImportResponseEnvelope
+ path := fmt.Sprintf("zones/%s/dns_records/import", params.ZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Scan for common DNS records on your domain and automatically add them to your
+// zone. Useful if you haven't updated your nameservers yet.
+func (r *RecordService) Scan(ctx context.Context, body RecordScanParams, opts ...option.RequestOption) (res *RecordScanResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RecordScanResponseEnvelope
+ path := fmt.Sprintf("zones/%s/dns_records/scan", body.ZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Union satisfied by [dns.RecordNewResponseA], [dns.RecordNewResponseAAAA],
+// [dns.RecordNewResponseCAA], [dns.RecordNewResponseCert],
+// [dns.RecordNewResponseCNAME], [dns.RecordNewResponseDNSKEY],
+// [dns.RecordNewResponseDS], [dns.RecordNewResponseHTTPS],
+// [dns.RecordNewResponseLOC], [dns.RecordNewResponseMX],
+// [dns.RecordNewResponseNAPTR], [dns.RecordNewResponseNS],
+// [dns.RecordNewResponsePTR], [dns.RecordNewResponseSmimea],
+// [dns.RecordNewResponseSRV], [dns.RecordNewResponseSSHFP],
+// [dns.RecordNewResponseSVCB], [dns.RecordNewResponseTLSA],
+// [dns.RecordNewResponseTXT] or [dns.RecordNewResponseURI].
+type RecordNewResponse interface {
+ implementsDNSRecordNewResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordNewResponse)(nil)).Elem(),
+ "type",
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordNewResponseA{}),
+ DiscriminatorValue: "A",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordNewResponseAAAA{}),
+ DiscriminatorValue: "AAAA",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordNewResponseCAA{}),
+ DiscriminatorValue: "CAA",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordNewResponseCert{}),
+ DiscriminatorValue: "CERT",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordNewResponseCNAME{}),
+ DiscriminatorValue: "CNAME",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordNewResponseDNSKEY{}),
+ DiscriminatorValue: "DNSKEY",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordNewResponseDS{}),
+ DiscriminatorValue: "DS",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordNewResponseHTTPS{}),
+ DiscriminatorValue: "HTTPS",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordNewResponseLOC{}),
+ DiscriminatorValue: "LOC",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordNewResponseMX{}),
+ DiscriminatorValue: "MX",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordNewResponseNAPTR{}),
+ DiscriminatorValue: "NAPTR",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordNewResponseNS{}),
+ DiscriminatorValue: "NS",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordNewResponsePTR{}),
+ DiscriminatorValue: "PTR",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordNewResponseSmimea{}),
+ DiscriminatorValue: "SMIMEA",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordNewResponseSRV{}),
+ DiscriminatorValue: "SRV",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordNewResponseSSHFP{}),
+ DiscriminatorValue: "SSHFP",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordNewResponseSVCB{}),
+ DiscriminatorValue: "SVCB",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordNewResponseTLSA{}),
+ DiscriminatorValue: "TLSA",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordNewResponseTXT{}),
+ DiscriminatorValue: "TXT",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordNewResponseURI{}),
+ DiscriminatorValue: "URI",
+ },
+ )
+}
+
+type RecordNewResponseA struct {
+ // A valid IPv4 address.
+ Content string `json:"content,required" format:"ipv4"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordNewResponseAType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordNewResponseAMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Whether the record is receiving the performance and security benefits of
+ // Cloudflare.
+ Proxied bool `json:"proxied"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordNewResponseATTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordNewResponseAJSON `json:"-"`
+}
+
+// recordNewResponseAJSON contains the JSON metadata for the struct
+// [RecordNewResponseA]
+type recordNewResponseAJSON struct {
+ Content apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Proxied apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordNewResponseA) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordNewResponseAJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordNewResponseA) implementsDNSRecordNewResponse() {}
+
+// Record type.
+type RecordNewResponseAType string
+
+const (
+ RecordNewResponseATypeA RecordNewResponseAType = "A"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordNewResponseAMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordNewResponseAMetaJSON `json:"-"`
+}
+
+// recordNewResponseAMetaJSON contains the JSON metadata for the struct
+// [RecordNewResponseAMeta]
+type recordNewResponseAMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordNewResponseAMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordNewResponseAMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or [dns.RecordNewResponseATTLNumber].
+type RecordNewResponseATTL interface {
+ ImplementsDNSRecordNewResponseAttl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordNewResponseATTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordNewResponseATTLNumber(0)),
+ },
+ )
+}
+
+type RecordNewResponseATTLNumber float64
+
+const (
+ RecordNewResponseATTLNumber1 RecordNewResponseATTLNumber = 1
+)
+
+type RecordNewResponseAAAA struct {
+ // A valid IPv6 address.
+ Content string `json:"content,required" format:"ipv6"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordNewResponseAAAAType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordNewResponseAAAAMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Whether the record is receiving the performance and security benefits of
+ // Cloudflare.
+ Proxied bool `json:"proxied"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordNewResponseAAAATTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordNewResponseAAAAJSON `json:"-"`
+}
+
+// recordNewResponseAAAAJSON contains the JSON metadata for the struct
+// [RecordNewResponseAAAA]
+type recordNewResponseAAAAJSON struct {
+ Content apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Proxied apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordNewResponseAAAA) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordNewResponseAAAAJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordNewResponseAAAA) implementsDNSRecordNewResponse() {}
+
+// Record type.
+type RecordNewResponseAAAAType string
+
+const (
+ RecordNewResponseAAAATypeAAAA RecordNewResponseAAAAType = "AAAA"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordNewResponseAAAAMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordNewResponseAAAAMetaJSON `json:"-"`
+}
+
+// recordNewResponseAAAAMetaJSON contains the JSON metadata for the struct
+// [RecordNewResponseAAAAMeta]
+type recordNewResponseAAAAMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordNewResponseAAAAMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordNewResponseAAAAMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or [dns.RecordNewResponseAAAATTLNumber].
+type RecordNewResponseAAAATTL interface {
+ ImplementsDNSRecordNewResponseAaaattl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordNewResponseAAAATTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordNewResponseAAAATTLNumber(0)),
+ },
+ )
+}
+
+type RecordNewResponseAAAATTLNumber float64
+
+const (
+ RecordNewResponseAAAATTLNumber1 RecordNewResponseAAAATTLNumber = 1
+)
+
+type RecordNewResponseCAA struct {
+ // Components of a CAA record.
+ Data RecordNewResponseCAAData `json:"data,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordNewResponseCAAType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // Formatted CAA content. See 'data' to set CAA properties.
+ Content string `json:"content"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordNewResponseCAAMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordNewResponseCAATTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordNewResponseCAAJSON `json:"-"`
+}
+
+// recordNewResponseCAAJSON contains the JSON metadata for the struct
+// [RecordNewResponseCAA]
+type recordNewResponseCAAJSON struct {
+ Data apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ Content apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordNewResponseCAA) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordNewResponseCAAJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordNewResponseCAA) implementsDNSRecordNewResponse() {}
+
+// Components of a CAA record.
+type RecordNewResponseCAAData struct {
+ // Flags for the CAA record.
+ Flags float64 `json:"flags"`
+ // Name of the property controlled by this record (e.g.: issue, issuewild, iodef).
+ Tag string `json:"tag"`
+ // Value of the record. This field's semantics depend on the chosen tag.
+ Value string `json:"value"`
+ JSON recordNewResponseCAADataJSON `json:"-"`
+}
+
+// recordNewResponseCAADataJSON contains the JSON metadata for the struct
+// [RecordNewResponseCAAData]
+type recordNewResponseCAADataJSON struct {
+ Flags apijson.Field
+ Tag apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordNewResponseCAAData) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordNewResponseCAADataJSON) RawJSON() string {
+ return r.raw
+}
+
+// Record type.
+type RecordNewResponseCAAType string
+
+const (
+ RecordNewResponseCAATypeCAA RecordNewResponseCAAType = "CAA"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordNewResponseCAAMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordNewResponseCAAMetaJSON `json:"-"`
+}
+
+// recordNewResponseCAAMetaJSON contains the JSON metadata for the struct
+// [RecordNewResponseCAAMeta]
+type recordNewResponseCAAMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordNewResponseCAAMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordNewResponseCAAMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or [dns.RecordNewResponseCAATTLNumber].
+type RecordNewResponseCAATTL interface {
+ ImplementsDNSRecordNewResponseCaattl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordNewResponseCAATTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordNewResponseCAATTLNumber(0)),
+ },
+ )
+}
+
+type RecordNewResponseCAATTLNumber float64
+
+const (
+ RecordNewResponseCAATTLNumber1 RecordNewResponseCAATTLNumber = 1
+)
+
+type RecordNewResponseCert struct {
+ // Components of a CERT record.
+ Data RecordNewResponseCertData `json:"data,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordNewResponseCertType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // Formatted CERT content. See 'data' to set CERT properties.
+ Content string `json:"content"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordNewResponseCertMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordNewResponseCertTTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordNewResponseCertJSON `json:"-"`
+}
+
+// recordNewResponseCertJSON contains the JSON metadata for the struct
+// [RecordNewResponseCert]
+type recordNewResponseCertJSON struct {
+ Data apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ Content apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordNewResponseCert) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordNewResponseCertJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordNewResponseCert) implementsDNSRecordNewResponse() {}
+
+// Components of a CERT record.
+type RecordNewResponseCertData struct {
+ // Algorithm.
+ Algorithm float64 `json:"algorithm"`
+ // Certificate.
+ Certificate string `json:"certificate"`
+ // Key Tag.
+ KeyTag float64 `json:"key_tag"`
+ // Type.
+ Type float64 `json:"type"`
+ JSON recordNewResponseCertDataJSON `json:"-"`
+}
+
+// recordNewResponseCertDataJSON contains the JSON metadata for the struct
+// [RecordNewResponseCertData]
+type recordNewResponseCertDataJSON struct {
+ Algorithm apijson.Field
+ Certificate apijson.Field
+ KeyTag apijson.Field
+ Type apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordNewResponseCertData) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordNewResponseCertDataJSON) RawJSON() string {
+ return r.raw
+}
+
+// Record type.
+type RecordNewResponseCertType string
+
+const (
+ RecordNewResponseCertTypeCert RecordNewResponseCertType = "CERT"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordNewResponseCertMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordNewResponseCertMetaJSON `json:"-"`
+}
+
+// recordNewResponseCertMetaJSON contains the JSON metadata for the struct
+// [RecordNewResponseCertMeta]
+type recordNewResponseCertMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordNewResponseCertMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordNewResponseCertMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or [dns.RecordNewResponseCertTTLNumber].
+type RecordNewResponseCertTTL interface {
+ ImplementsDNSRecordNewResponseCertTTL()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordNewResponseCertTTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordNewResponseCertTTLNumber(0)),
+ },
+ )
+}
+
+type RecordNewResponseCertTTLNumber float64
+
+const (
+ RecordNewResponseCertTTLNumber1 RecordNewResponseCertTTLNumber = 1
+)
+
+type RecordNewResponseCNAME struct {
+ // A valid hostname. Must not match the record's name.
+ Content interface{} `json:"content,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordNewResponseCNAMEType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordNewResponseCNAMEMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Whether the record is receiving the performance and security benefits of
+ // Cloudflare.
+ Proxied bool `json:"proxied"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordNewResponseCNAMETTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordNewResponseCNAMEJSON `json:"-"`
+}
+
+// recordNewResponseCNAMEJSON contains the JSON metadata for the struct
+// [RecordNewResponseCNAME]
+type recordNewResponseCNAMEJSON struct {
+ Content apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Proxied apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordNewResponseCNAME) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordNewResponseCNAMEJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordNewResponseCNAME) implementsDNSRecordNewResponse() {}
+
+// Record type.
+type RecordNewResponseCNAMEType string
+
+const (
+ RecordNewResponseCNAMETypeCNAME RecordNewResponseCNAMEType = "CNAME"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordNewResponseCNAMEMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordNewResponseCNAMEMetaJSON `json:"-"`
+}
+
+// recordNewResponseCNAMEMetaJSON contains the JSON metadata for the struct
+// [RecordNewResponseCNAMEMeta]
+type recordNewResponseCNAMEMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordNewResponseCNAMEMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordNewResponseCNAMEMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or [dns.RecordNewResponseCNAMETTLNumber].
+type RecordNewResponseCNAMETTL interface {
+ ImplementsDNSRecordNewResponseCnamettl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordNewResponseCNAMETTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordNewResponseCNAMETTLNumber(0)),
+ },
+ )
+}
+
+type RecordNewResponseCNAMETTLNumber float64
+
+const (
+ RecordNewResponseCNAMETTLNumber1 RecordNewResponseCNAMETTLNumber = 1
+)
+
+type RecordNewResponseDNSKEY struct {
+ // Components of a DNSKEY record.
+ Data RecordNewResponseDNSKEYData `json:"data,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordNewResponseDNSKEYType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // Formatted DNSKEY content. See 'data' to set DNSKEY properties.
+ Content string `json:"content"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordNewResponseDNSKEYMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordNewResponseDNSKEYTTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordNewResponseDNSKEYJSON `json:"-"`
+}
+
+// recordNewResponseDNSKEYJSON contains the JSON metadata for the struct
+// [RecordNewResponseDNSKEY]
+type recordNewResponseDNSKEYJSON struct {
+ Data apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ Content apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordNewResponseDNSKEY) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordNewResponseDNSKEYJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordNewResponseDNSKEY) implementsDNSRecordNewResponse() {}
+
+// Components of a DNSKEY record.
+type RecordNewResponseDNSKEYData struct {
+ // Algorithm.
+ Algorithm float64 `json:"algorithm"`
+ // Flags.
+ Flags float64 `json:"flags"`
+ // Protocol.
+ Protocol float64 `json:"protocol"`
+ // Public Key.
+ PublicKey string `json:"public_key"`
+ JSON recordNewResponseDNSKEYDataJSON `json:"-"`
+}
+
+// recordNewResponseDNSKEYDataJSON contains the JSON metadata for the struct
+// [RecordNewResponseDNSKEYData]
+type recordNewResponseDNSKEYDataJSON struct {
+ Algorithm apijson.Field
+ Flags apijson.Field
+ Protocol apijson.Field
+ PublicKey apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordNewResponseDNSKEYData) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordNewResponseDNSKEYDataJSON) RawJSON() string {
+ return r.raw
+}
+
+// Record type.
+type RecordNewResponseDNSKEYType string
+
+const (
+ RecordNewResponseDNSKEYTypeDNSKEY RecordNewResponseDNSKEYType = "DNSKEY"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordNewResponseDNSKEYMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordNewResponseDNSKEYMetaJSON `json:"-"`
+}
+
+// recordNewResponseDNSKEYMetaJSON contains the JSON metadata for the struct
+// [RecordNewResponseDNSKEYMeta]
+type recordNewResponseDNSKEYMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordNewResponseDNSKEYMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordNewResponseDNSKEYMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or
+// [dns.RecordNewResponseDNSKEYTTLNumber].
+type RecordNewResponseDNSKEYTTL interface {
+ ImplementsDNSRecordNewResponseDnskeyttl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordNewResponseDNSKEYTTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordNewResponseDNSKEYTTLNumber(0)),
+ },
+ )
+}
+
+type RecordNewResponseDNSKEYTTLNumber float64
+
+const (
+ RecordNewResponseDNSKEYTTLNumber1 RecordNewResponseDNSKEYTTLNumber = 1
+)
+
+type RecordNewResponseDS struct {
+ // Components of a DS record.
+ Data RecordNewResponseDSData `json:"data,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordNewResponseDSType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // Formatted DS content. See 'data' to set DS properties.
+ Content string `json:"content"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordNewResponseDSMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordNewResponseDSTTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordNewResponseDSJSON `json:"-"`
+}
+
+// recordNewResponseDSJSON contains the JSON metadata for the struct
+// [RecordNewResponseDS]
+type recordNewResponseDSJSON struct {
+ Data apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ Content apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordNewResponseDS) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordNewResponseDSJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordNewResponseDS) implementsDNSRecordNewResponse() {}
+
+// Components of a DS record.
+type RecordNewResponseDSData struct {
+ // Algorithm.
+ Algorithm float64 `json:"algorithm"`
+ // Digest.
+ Digest string `json:"digest"`
+ // Digest Type.
+ DigestType float64 `json:"digest_type"`
+ // Key Tag.
+ KeyTag float64 `json:"key_tag"`
+ JSON recordNewResponseDSDataJSON `json:"-"`
+}
+
+// recordNewResponseDSDataJSON contains the JSON metadata for the struct
+// [RecordNewResponseDSData]
+type recordNewResponseDSDataJSON struct {
+ Algorithm apijson.Field
+ Digest apijson.Field
+ DigestType apijson.Field
+ KeyTag apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordNewResponseDSData) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordNewResponseDSDataJSON) RawJSON() string {
+ return r.raw
+}
+
+// Record type.
+type RecordNewResponseDSType string
+
+const (
+ RecordNewResponseDSTypeDS RecordNewResponseDSType = "DS"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordNewResponseDSMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordNewResponseDSMetaJSON `json:"-"`
+}
+
+// recordNewResponseDSMetaJSON contains the JSON metadata for the struct
+// [RecordNewResponseDSMeta]
+type recordNewResponseDSMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordNewResponseDSMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordNewResponseDSMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or [dns.RecordNewResponseDSTTLNumber].
+type RecordNewResponseDSTTL interface {
+ ImplementsDNSRecordNewResponseDsttl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordNewResponseDSTTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordNewResponseDSTTLNumber(0)),
+ },
+ )
+}
+
+type RecordNewResponseDSTTLNumber float64
+
+const (
+ RecordNewResponseDSTTLNumber1 RecordNewResponseDSTTLNumber = 1
+)
+
+type RecordNewResponseHTTPS struct {
+ // Components of a HTTPS record.
+ Data RecordNewResponseHTTPSData `json:"data,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordNewResponseHTTPSType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // Formatted HTTPS content. See 'data' to set HTTPS properties.
+ Content string `json:"content"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordNewResponseHTTPSMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordNewResponseHTTPSTTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordNewResponseHTTPSJSON `json:"-"`
+}
+
+// recordNewResponseHTTPSJSON contains the JSON metadata for the struct
+// [RecordNewResponseHTTPS]
+type recordNewResponseHTTPSJSON struct {
+ Data apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ Content apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordNewResponseHTTPS) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordNewResponseHTTPSJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordNewResponseHTTPS) implementsDNSRecordNewResponse() {}
+
+// Components of a HTTPS record.
+type RecordNewResponseHTTPSData struct {
+ // priority.
+ Priority float64 `json:"priority"`
+ // target.
+ Target string `json:"target"`
+ // value.
+ Value string `json:"value"`
+ JSON recordNewResponseHTTPSDataJSON `json:"-"`
+}
+
+// recordNewResponseHTTPSDataJSON contains the JSON metadata for the struct
+// [RecordNewResponseHTTPSData]
+type recordNewResponseHTTPSDataJSON struct {
+ Priority apijson.Field
+ Target apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordNewResponseHTTPSData) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordNewResponseHTTPSDataJSON) RawJSON() string {
+ return r.raw
+}
+
+// Record type.
+type RecordNewResponseHTTPSType string
+
+const (
+ RecordNewResponseHTTPSTypeHTTPS RecordNewResponseHTTPSType = "HTTPS"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordNewResponseHTTPSMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordNewResponseHTTPSMetaJSON `json:"-"`
+}
+
+// recordNewResponseHTTPSMetaJSON contains the JSON metadata for the struct
+// [RecordNewResponseHTTPSMeta]
+type recordNewResponseHTTPSMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordNewResponseHTTPSMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordNewResponseHTTPSMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or [dns.RecordNewResponseHTTPSTTLNumber].
+type RecordNewResponseHTTPSTTL interface {
+ ImplementsDNSRecordNewResponseHttpsttl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordNewResponseHTTPSTTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordNewResponseHTTPSTTLNumber(0)),
+ },
+ )
+}
+
+type RecordNewResponseHTTPSTTLNumber float64
+
+const (
+ RecordNewResponseHTTPSTTLNumber1 RecordNewResponseHTTPSTTLNumber = 1
+)
+
+type RecordNewResponseLOC struct {
+ // Components of a LOC record.
+ Data RecordNewResponseLOCData `json:"data,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordNewResponseLOCType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // Formatted LOC content. See 'data' to set LOC properties.
+ Content string `json:"content"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordNewResponseLOCMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordNewResponseLOCTTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordNewResponseLOCJSON `json:"-"`
+}
+
+// recordNewResponseLOCJSON contains the JSON metadata for the struct
+// [RecordNewResponseLOC]
+type recordNewResponseLOCJSON struct {
+ Data apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ Content apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordNewResponseLOC) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordNewResponseLOCJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordNewResponseLOC) implementsDNSRecordNewResponse() {}
+
+// Components of a LOC record.
+type RecordNewResponseLOCData struct {
+ // Altitude of location in meters.
+ Altitude float64 `json:"altitude"`
+ // Degrees of latitude.
+ LatDegrees float64 `json:"lat_degrees"`
+ // Latitude direction.
+ LatDirection RecordNewResponseLOCDataLatDirection `json:"lat_direction"`
+ // Minutes of latitude.
+ LatMinutes float64 `json:"lat_minutes"`
+ // Seconds of latitude.
+ LatSeconds float64 `json:"lat_seconds"`
+ // Degrees of longitude.
+ LongDegrees float64 `json:"long_degrees"`
+ // Longitude direction.
+ LongDirection RecordNewResponseLOCDataLongDirection `json:"long_direction"`
+ // Minutes of longitude.
+ LongMinutes float64 `json:"long_minutes"`
+ // Seconds of longitude.
+ LongSeconds float64 `json:"long_seconds"`
+ // Horizontal precision of location.
+ PrecisionHorz float64 `json:"precision_horz"`
+ // Vertical precision of location.
+ PrecisionVert float64 `json:"precision_vert"`
+ // Size of location in meters.
+ Size float64 `json:"size"`
+ JSON recordNewResponseLOCDataJSON `json:"-"`
+}
+
+// recordNewResponseLOCDataJSON contains the JSON metadata for the struct
+// [RecordNewResponseLOCData]
+type recordNewResponseLOCDataJSON struct {
+ Altitude apijson.Field
+ LatDegrees apijson.Field
+ LatDirection apijson.Field
+ LatMinutes apijson.Field
+ LatSeconds apijson.Field
+ LongDegrees apijson.Field
+ LongDirection apijson.Field
+ LongMinutes apijson.Field
+ LongSeconds apijson.Field
+ PrecisionHorz apijson.Field
+ PrecisionVert apijson.Field
+ Size apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordNewResponseLOCData) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordNewResponseLOCDataJSON) RawJSON() string {
+ return r.raw
+}
+
+// Latitude direction.
+type RecordNewResponseLOCDataLatDirection string
+
+const (
+ RecordNewResponseLOCDataLatDirectionN RecordNewResponseLOCDataLatDirection = "N"
+ RecordNewResponseLOCDataLatDirectionS RecordNewResponseLOCDataLatDirection = "S"
+)
+
+// Longitude direction.
+type RecordNewResponseLOCDataLongDirection string
+
+const (
+ RecordNewResponseLOCDataLongDirectionE RecordNewResponseLOCDataLongDirection = "E"
+ RecordNewResponseLOCDataLongDirectionW RecordNewResponseLOCDataLongDirection = "W"
+)
+
+// Record type.
+type RecordNewResponseLOCType string
+
+const (
+ RecordNewResponseLOCTypeLOC RecordNewResponseLOCType = "LOC"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordNewResponseLOCMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordNewResponseLOCMetaJSON `json:"-"`
+}
+
+// recordNewResponseLOCMetaJSON contains the JSON metadata for the struct
+// [RecordNewResponseLOCMeta]
+type recordNewResponseLOCMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordNewResponseLOCMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordNewResponseLOCMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or [dns.RecordNewResponseLOCTTLNumber].
+type RecordNewResponseLOCTTL interface {
+ ImplementsDNSRecordNewResponseLocttl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordNewResponseLOCTTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordNewResponseLOCTTLNumber(0)),
+ },
+ )
+}
+
+type RecordNewResponseLOCTTLNumber float64
+
+const (
+ RecordNewResponseLOCTTLNumber1 RecordNewResponseLOCTTLNumber = 1
+)
+
+type RecordNewResponseMX struct {
+ // A valid mail server hostname.
+ Content string `json:"content,required" format:"hostname"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Required for MX, SRV and URI records; unused by other record types. Records with
+ // lower priorities are preferred.
+ Priority float64 `json:"priority,required"`
+ // Record type.
+ Type RecordNewResponseMXType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordNewResponseMXMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordNewResponseMXTTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordNewResponseMXJSON `json:"-"`
+}
+
+// recordNewResponseMXJSON contains the JSON metadata for the struct
+// [RecordNewResponseMX]
+type recordNewResponseMXJSON struct {
+ Content apijson.Field
+ Name apijson.Field
+ Priority apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordNewResponseMX) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordNewResponseMXJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordNewResponseMX) implementsDNSRecordNewResponse() {}
+
+// Record type.
+type RecordNewResponseMXType string
+
+const (
+ RecordNewResponseMXTypeMX RecordNewResponseMXType = "MX"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordNewResponseMXMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordNewResponseMXMetaJSON `json:"-"`
+}
+
+// recordNewResponseMXMetaJSON contains the JSON metadata for the struct
+// [RecordNewResponseMXMeta]
+type recordNewResponseMXMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordNewResponseMXMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordNewResponseMXMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or [dns.RecordNewResponseMXTTLNumber].
+type RecordNewResponseMXTTL interface {
+ ImplementsDNSRecordNewResponseMxttl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordNewResponseMXTTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordNewResponseMXTTLNumber(0)),
+ },
+ )
+}
+
+type RecordNewResponseMXTTLNumber float64
+
+const (
+ RecordNewResponseMXTTLNumber1 RecordNewResponseMXTTLNumber = 1
+)
+
+type RecordNewResponseNAPTR struct {
+ // Components of a NAPTR record.
+ Data RecordNewResponseNAPTRData `json:"data,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordNewResponseNAPTRType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // Formatted NAPTR content. See 'data' to set NAPTR properties.
+ Content string `json:"content"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordNewResponseNAPTRMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordNewResponseNAPTRTTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordNewResponseNAPTRJSON `json:"-"`
+}
+
+// recordNewResponseNAPTRJSON contains the JSON metadata for the struct
+// [RecordNewResponseNAPTR]
+type recordNewResponseNAPTRJSON struct {
+ Data apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ Content apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordNewResponseNAPTR) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordNewResponseNAPTRJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordNewResponseNAPTR) implementsDNSRecordNewResponse() {}
+
+// Components of a NAPTR record.
+type RecordNewResponseNAPTRData struct {
+ // Flags.
+ Flags string `json:"flags"`
+ // Order.
+ Order float64 `json:"order"`
+ // Preference.
+ Preference float64 `json:"preference"`
+ // Regex.
+ Regex string `json:"regex"`
+ // Replacement.
+ Replacement string `json:"replacement"`
+ // Service.
+ Service string `json:"service"`
+ JSON recordNewResponseNAPTRDataJSON `json:"-"`
+}
+
+// recordNewResponseNAPTRDataJSON contains the JSON metadata for the struct
+// [RecordNewResponseNAPTRData]
+type recordNewResponseNAPTRDataJSON struct {
+ Flags apijson.Field
+ Order apijson.Field
+ Preference apijson.Field
+ Regex apijson.Field
+ Replacement apijson.Field
+ Service apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordNewResponseNAPTRData) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordNewResponseNAPTRDataJSON) RawJSON() string {
+ return r.raw
+}
+
+// Record type.
+type RecordNewResponseNAPTRType string
+
+const (
+ RecordNewResponseNAPTRTypeNAPTR RecordNewResponseNAPTRType = "NAPTR"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordNewResponseNAPTRMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordNewResponseNAPTRMetaJSON `json:"-"`
+}
+
+// recordNewResponseNAPTRMetaJSON contains the JSON metadata for the struct
+// [RecordNewResponseNAPTRMeta]
+type recordNewResponseNAPTRMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordNewResponseNAPTRMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordNewResponseNAPTRMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or [dns.RecordNewResponseNAPTRTTLNumber].
+type RecordNewResponseNAPTRTTL interface {
+ ImplementsDNSRecordNewResponseNaptrttl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordNewResponseNAPTRTTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordNewResponseNAPTRTTLNumber(0)),
+ },
+ )
+}
+
+type RecordNewResponseNAPTRTTLNumber float64
+
+const (
+ RecordNewResponseNAPTRTTLNumber1 RecordNewResponseNAPTRTTLNumber = 1
+)
+
+type RecordNewResponseNS struct {
+ // A valid name server host name.
+ Content interface{} `json:"content,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordNewResponseNSType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordNewResponseNSMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordNewResponseNSTTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordNewResponseNSJSON `json:"-"`
+}
+
+// recordNewResponseNSJSON contains the JSON metadata for the struct
+// [RecordNewResponseNS]
+type recordNewResponseNSJSON struct {
+ Content apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordNewResponseNS) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordNewResponseNSJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordNewResponseNS) implementsDNSRecordNewResponse() {}
+
+// Record type.
+type RecordNewResponseNSType string
+
+const (
+ RecordNewResponseNSTypeNS RecordNewResponseNSType = "NS"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordNewResponseNSMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordNewResponseNSMetaJSON `json:"-"`
+}
+
+// recordNewResponseNSMetaJSON contains the JSON metadata for the struct
+// [RecordNewResponseNSMeta]
+type recordNewResponseNSMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordNewResponseNSMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordNewResponseNSMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or [dns.RecordNewResponseNSTTLNumber].
+type RecordNewResponseNSTTL interface {
+ ImplementsDNSRecordNewResponseNsttl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordNewResponseNSTTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordNewResponseNSTTLNumber(0)),
+ },
+ )
+}
+
+type RecordNewResponseNSTTLNumber float64
+
+const (
+ RecordNewResponseNSTTLNumber1 RecordNewResponseNSTTLNumber = 1
+)
+
+type RecordNewResponsePTR struct {
+ // Domain name pointing to the address.
+ Content string `json:"content,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordNewResponsePTRType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordNewResponsePTRMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordNewResponsePTRTTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordNewResponsePTRJSON `json:"-"`
+}
+
+// recordNewResponsePTRJSON contains the JSON metadata for the struct
+// [RecordNewResponsePTR]
+type recordNewResponsePTRJSON struct {
+ Content apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordNewResponsePTR) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordNewResponsePTRJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordNewResponsePTR) implementsDNSRecordNewResponse() {}
+
+// Record type.
+type RecordNewResponsePTRType string
+
+const (
+ RecordNewResponsePTRTypePTR RecordNewResponsePTRType = "PTR"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordNewResponsePTRMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordNewResponsePTRMetaJSON `json:"-"`
+}
+
+// recordNewResponsePTRMetaJSON contains the JSON metadata for the struct
+// [RecordNewResponsePTRMeta]
+type recordNewResponsePTRMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordNewResponsePTRMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordNewResponsePTRMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or [dns.RecordNewResponsePTRTTLNumber].
+type RecordNewResponsePTRTTL interface {
+ ImplementsDNSRecordNewResponsePtrttl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordNewResponsePTRTTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordNewResponsePTRTTLNumber(0)),
+ },
+ )
+}
+
+type RecordNewResponsePTRTTLNumber float64
+
+const (
+ RecordNewResponsePTRTTLNumber1 RecordNewResponsePTRTTLNumber = 1
+)
+
+type RecordNewResponseSmimea struct {
+ // Components of a SMIMEA record.
+ Data RecordNewResponseSmimeaData `json:"data,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordNewResponseSmimeaType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // Formatted SMIMEA content. See 'data' to set SMIMEA properties.
+ Content string `json:"content"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordNewResponseSmimeaMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordNewResponseSmimeaTTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordNewResponseSmimeaJSON `json:"-"`
+}
+
+// recordNewResponseSmimeaJSON contains the JSON metadata for the struct
+// [RecordNewResponseSmimea]
+type recordNewResponseSmimeaJSON struct {
+ Data apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ Content apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordNewResponseSmimea) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordNewResponseSmimeaJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordNewResponseSmimea) implementsDNSRecordNewResponse() {}
+
+// Components of a SMIMEA record.
+type RecordNewResponseSmimeaData struct {
+ // Certificate.
+ Certificate string `json:"certificate"`
+ // Matching Type.
+ MatchingType float64 `json:"matching_type"`
+ // Selector.
+ Selector float64 `json:"selector"`
+ // Usage.
+ Usage float64 `json:"usage"`
+ JSON recordNewResponseSmimeaDataJSON `json:"-"`
+}
+
+// recordNewResponseSmimeaDataJSON contains the JSON metadata for the struct
+// [RecordNewResponseSmimeaData]
+type recordNewResponseSmimeaDataJSON struct {
+ Certificate apijson.Field
+ MatchingType apijson.Field
+ Selector apijson.Field
+ Usage apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordNewResponseSmimeaData) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordNewResponseSmimeaDataJSON) RawJSON() string {
+ return r.raw
+}
+
+// Record type.
+type RecordNewResponseSmimeaType string
+
+const (
+ RecordNewResponseSmimeaTypeSmimea RecordNewResponseSmimeaType = "SMIMEA"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordNewResponseSmimeaMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordNewResponseSmimeaMetaJSON `json:"-"`
+}
+
+// recordNewResponseSmimeaMetaJSON contains the JSON metadata for the struct
+// [RecordNewResponseSmimeaMeta]
+type recordNewResponseSmimeaMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordNewResponseSmimeaMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordNewResponseSmimeaMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or
+// [dns.RecordNewResponseSmimeaTTLNumber].
+type RecordNewResponseSmimeaTTL interface {
+ ImplementsDNSRecordNewResponseSmimeaTTL()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordNewResponseSmimeaTTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordNewResponseSmimeaTTLNumber(0)),
+ },
+ )
+}
+
+type RecordNewResponseSmimeaTTLNumber float64
+
+const (
+ RecordNewResponseSmimeaTTLNumber1 RecordNewResponseSmimeaTTLNumber = 1
+)
+
+type RecordNewResponseSRV struct {
+ // Components of a SRV record.
+ Data RecordNewResponseSRVData `json:"data,required"`
+ // DNS record name (or @ for the zone apex) in Punycode. For SRV records, the first
+ // label is normally a service and the second a protocol name, each starting with
+ // an underscore.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordNewResponseSRVType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // Priority, weight, port, and SRV target. See 'data' for setting the individual
+ // component values.
+ Content string `json:"content"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordNewResponseSRVMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordNewResponseSRVTTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordNewResponseSRVJSON `json:"-"`
+}
+
+// recordNewResponseSRVJSON contains the JSON metadata for the struct
+// [RecordNewResponseSRV]
+type recordNewResponseSRVJSON struct {
+ Data apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ Content apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordNewResponseSRV) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordNewResponseSRVJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordNewResponseSRV) implementsDNSRecordNewResponse() {}
+
+// Components of a SRV record.
+type RecordNewResponseSRVData struct {
+ // A valid hostname. Deprecated in favor of the regular 'name' outside the data
+ // map. This data map field represents the remainder of the full 'name' after the
+ // service and protocol.
+ Name string `json:"name" format:"hostname"`
+ // The port of the service.
+ Port float64 `json:"port"`
+ // Required for MX, SRV and URI records; unused by other record types. Records with
+ // lower priorities are preferred.
+ Priority float64 `json:"priority"`
+ // A valid protocol, prefixed with an underscore. Deprecated in favor of the
+ // regular 'name' outside the data map. This data map field normally represents the
+ // second label of that 'name'.
+ Proto string `json:"proto"`
+ // A service type, prefixed with an underscore. Deprecated in favor of the regular
+ // 'name' outside the data map. This data map field normally represents the first
+ // label of that 'name'.
+ Service string `json:"service"`
+ // A valid hostname.
+ Target string `json:"target" format:"hostname"`
+ // The record weight.
+ Weight float64 `json:"weight"`
+ JSON recordNewResponseSRVDataJSON `json:"-"`
+}
+
+// recordNewResponseSRVDataJSON contains the JSON metadata for the struct
+// [RecordNewResponseSRVData]
+type recordNewResponseSRVDataJSON struct {
+ Name apijson.Field
+ Port apijson.Field
+ Priority apijson.Field
+ Proto apijson.Field
+ Service apijson.Field
+ Target apijson.Field
+ Weight apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordNewResponseSRVData) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordNewResponseSRVDataJSON) RawJSON() string {
+ return r.raw
+}
+
+// Record type.
+type RecordNewResponseSRVType string
+
+const (
+ RecordNewResponseSRVTypeSRV RecordNewResponseSRVType = "SRV"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordNewResponseSRVMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordNewResponseSRVMetaJSON `json:"-"`
+}
+
+// recordNewResponseSRVMetaJSON contains the JSON metadata for the struct
+// [RecordNewResponseSRVMeta]
+type recordNewResponseSRVMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordNewResponseSRVMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordNewResponseSRVMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or [dns.RecordNewResponseSRVTTLNumber].
+type RecordNewResponseSRVTTL interface {
+ ImplementsDNSRecordNewResponseSrvttl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordNewResponseSRVTTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordNewResponseSRVTTLNumber(0)),
+ },
+ )
+}
+
+type RecordNewResponseSRVTTLNumber float64
+
+const (
+ RecordNewResponseSRVTTLNumber1 RecordNewResponseSRVTTLNumber = 1
+)
+
+type RecordNewResponseSSHFP struct {
+ // Components of a SSHFP record.
+ Data RecordNewResponseSSHFPData `json:"data,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordNewResponseSSHFPType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // Formatted SSHFP content. See 'data' to set SSHFP properties.
+ Content string `json:"content"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordNewResponseSSHFPMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordNewResponseSSHFPTTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordNewResponseSSHFPJSON `json:"-"`
+}
+
+// recordNewResponseSSHFPJSON contains the JSON metadata for the struct
+// [RecordNewResponseSSHFP]
+type recordNewResponseSSHFPJSON struct {
+ Data apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ Content apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordNewResponseSSHFP) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordNewResponseSSHFPJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordNewResponseSSHFP) implementsDNSRecordNewResponse() {}
+
+// Components of a SSHFP record.
+type RecordNewResponseSSHFPData struct {
+ // algorithm.
+ Algorithm float64 `json:"algorithm"`
+ // fingerprint.
+ Fingerprint string `json:"fingerprint"`
+ // type.
+ Type float64 `json:"type"`
+ JSON recordNewResponseSSHFPDataJSON `json:"-"`
+}
+
+// recordNewResponseSSHFPDataJSON contains the JSON metadata for the struct
+// [RecordNewResponseSSHFPData]
+type recordNewResponseSSHFPDataJSON struct {
+ Algorithm apijson.Field
+ Fingerprint apijson.Field
+ Type apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordNewResponseSSHFPData) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordNewResponseSSHFPDataJSON) RawJSON() string {
+ return r.raw
+}
+
+// Record type.
+type RecordNewResponseSSHFPType string
+
+const (
+ RecordNewResponseSSHFPTypeSSHFP RecordNewResponseSSHFPType = "SSHFP"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordNewResponseSSHFPMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordNewResponseSSHFPMetaJSON `json:"-"`
+}
+
+// recordNewResponseSSHFPMetaJSON contains the JSON metadata for the struct
+// [RecordNewResponseSSHFPMeta]
+type recordNewResponseSSHFPMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordNewResponseSSHFPMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordNewResponseSSHFPMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or [dns.RecordNewResponseSSHFPTTLNumber].
+type RecordNewResponseSSHFPTTL interface {
+ ImplementsDNSRecordNewResponseSshfpttl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordNewResponseSSHFPTTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordNewResponseSSHFPTTLNumber(0)),
+ },
+ )
+}
+
+type RecordNewResponseSSHFPTTLNumber float64
+
+const (
+ RecordNewResponseSSHFPTTLNumber1 RecordNewResponseSSHFPTTLNumber = 1
+)
+
+type RecordNewResponseSVCB struct {
+ // Components of a SVCB record.
+ Data RecordNewResponseSVCBData `json:"data,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordNewResponseSVCBType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // Formatted SVCB content. See 'data' to set SVCB properties.
+ Content string `json:"content"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordNewResponseSVCBMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordNewResponseSVCBTTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordNewResponseSVCBJSON `json:"-"`
+}
+
+// recordNewResponseSVCBJSON contains the JSON metadata for the struct
+// [RecordNewResponseSVCB]
+type recordNewResponseSVCBJSON struct {
+ Data apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ Content apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordNewResponseSVCB) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordNewResponseSVCBJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordNewResponseSVCB) implementsDNSRecordNewResponse() {}
+
+// Components of a SVCB record.
+type RecordNewResponseSVCBData struct {
+ // priority.
+ Priority float64 `json:"priority"`
+ // target.
+ Target string `json:"target"`
+ // value.
+ Value string `json:"value"`
+ JSON recordNewResponseSVCBDataJSON `json:"-"`
+}
+
+// recordNewResponseSVCBDataJSON contains the JSON metadata for the struct
+// [RecordNewResponseSVCBData]
+type recordNewResponseSVCBDataJSON struct {
+ Priority apijson.Field
+ Target apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordNewResponseSVCBData) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordNewResponseSVCBDataJSON) RawJSON() string {
+ return r.raw
+}
+
+// Record type.
+type RecordNewResponseSVCBType string
+
+const (
+ RecordNewResponseSVCBTypeSVCB RecordNewResponseSVCBType = "SVCB"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordNewResponseSVCBMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordNewResponseSVCBMetaJSON `json:"-"`
+}
+
+// recordNewResponseSVCBMetaJSON contains the JSON metadata for the struct
+// [RecordNewResponseSVCBMeta]
+type recordNewResponseSVCBMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordNewResponseSVCBMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordNewResponseSVCBMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or [dns.RecordNewResponseSVCBTTLNumber].
+type RecordNewResponseSVCBTTL interface {
+ ImplementsDNSRecordNewResponseSvcbttl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordNewResponseSVCBTTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordNewResponseSVCBTTLNumber(0)),
+ },
+ )
+}
+
+type RecordNewResponseSVCBTTLNumber float64
+
+const (
+ RecordNewResponseSVCBTTLNumber1 RecordNewResponseSVCBTTLNumber = 1
+)
+
+type RecordNewResponseTLSA struct {
+ // Components of a TLSA record.
+ Data RecordNewResponseTLSAData `json:"data,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordNewResponseTLSAType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // Formatted TLSA content. See 'data' to set TLSA properties.
+ Content string `json:"content"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordNewResponseTLSAMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordNewResponseTLSATTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordNewResponseTLSAJSON `json:"-"`
+}
+
+// recordNewResponseTLSAJSON contains the JSON metadata for the struct
+// [RecordNewResponseTLSA]
+type recordNewResponseTLSAJSON struct {
+ Data apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ Content apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordNewResponseTLSA) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordNewResponseTLSAJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordNewResponseTLSA) implementsDNSRecordNewResponse() {}
+
+// Components of a TLSA record.
+type RecordNewResponseTLSAData struct {
+ // certificate.
+ Certificate string `json:"certificate"`
+ // Matching Type.
+ MatchingType float64 `json:"matching_type"`
+ // Selector.
+ Selector float64 `json:"selector"`
+ // Usage.
+ Usage float64 `json:"usage"`
+ JSON recordNewResponseTLSADataJSON `json:"-"`
+}
+
+// recordNewResponseTLSADataJSON contains the JSON metadata for the struct
+// [RecordNewResponseTLSAData]
+type recordNewResponseTLSADataJSON struct {
+ Certificate apijson.Field
+ MatchingType apijson.Field
+ Selector apijson.Field
+ Usage apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordNewResponseTLSAData) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordNewResponseTLSADataJSON) RawJSON() string {
+ return r.raw
+}
+
+// Record type.
+type RecordNewResponseTLSAType string
+
+const (
+ RecordNewResponseTLSATypeTLSA RecordNewResponseTLSAType = "TLSA"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordNewResponseTLSAMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordNewResponseTLSAMetaJSON `json:"-"`
+}
+
+// recordNewResponseTLSAMetaJSON contains the JSON metadata for the struct
+// [RecordNewResponseTLSAMeta]
+type recordNewResponseTLSAMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordNewResponseTLSAMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordNewResponseTLSAMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or [dns.RecordNewResponseTLSATTLNumber].
+type RecordNewResponseTLSATTL interface {
+ ImplementsDNSRecordNewResponseTlsattl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordNewResponseTLSATTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordNewResponseTLSATTLNumber(0)),
+ },
+ )
+}
+
+type RecordNewResponseTLSATTLNumber float64
+
+const (
+ RecordNewResponseTLSATTLNumber1 RecordNewResponseTLSATTLNumber = 1
+)
+
+type RecordNewResponseTXT struct {
+ // Text content for the record.
+ Content string `json:"content,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordNewResponseTXTType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordNewResponseTXTMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordNewResponseTXTTTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordNewResponseTXTJSON `json:"-"`
+}
+
+// recordNewResponseTXTJSON contains the JSON metadata for the struct
+// [RecordNewResponseTXT]
+type recordNewResponseTXTJSON struct {
+ Content apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordNewResponseTXT) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordNewResponseTXTJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordNewResponseTXT) implementsDNSRecordNewResponse() {}
+
+// Record type.
+type RecordNewResponseTXTType string
+
+const (
+ RecordNewResponseTXTTypeTXT RecordNewResponseTXTType = "TXT"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordNewResponseTXTMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordNewResponseTXTMetaJSON `json:"-"`
+}
+
+// recordNewResponseTXTMetaJSON contains the JSON metadata for the struct
+// [RecordNewResponseTXTMeta]
+type recordNewResponseTXTMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordNewResponseTXTMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordNewResponseTXTMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or [dns.RecordNewResponseTXTTTLNumber].
+type RecordNewResponseTXTTTL interface {
+ ImplementsDNSRecordNewResponseTxtttl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordNewResponseTXTTTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordNewResponseTXTTTLNumber(0)),
+ },
+ )
+}
+
+type RecordNewResponseTXTTTLNumber float64
+
+const (
+ RecordNewResponseTXTTTLNumber1 RecordNewResponseTXTTTLNumber = 1
+)
+
+type RecordNewResponseURI struct {
+ // Components of a URI record.
+ Data RecordNewResponseURIData `json:"data,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Required for MX, SRV and URI records; unused by other record types. Records with
+ // lower priorities are preferred.
+ Priority float64 `json:"priority,required"`
+ // Record type.
+ Type RecordNewResponseURIType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // Formatted URI content. See 'data' to set URI properties.
+ Content string `json:"content"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordNewResponseURIMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordNewResponseURITTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordNewResponseURIJSON `json:"-"`
+}
+
+// recordNewResponseURIJSON contains the JSON metadata for the struct
+// [RecordNewResponseURI]
+type recordNewResponseURIJSON struct {
+ Data apijson.Field
+ Name apijson.Field
+ Priority apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ Content apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordNewResponseURI) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordNewResponseURIJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordNewResponseURI) implementsDNSRecordNewResponse() {}
+
+// Components of a URI record.
+type RecordNewResponseURIData struct {
+ // The record content.
+ Content string `json:"content"`
+ // The record weight.
+ Weight float64 `json:"weight"`
+ JSON recordNewResponseURIDataJSON `json:"-"`
+}
+
+// recordNewResponseURIDataJSON contains the JSON metadata for the struct
+// [RecordNewResponseURIData]
+type recordNewResponseURIDataJSON struct {
+ Content apijson.Field
+ Weight apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordNewResponseURIData) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordNewResponseURIDataJSON) RawJSON() string {
+ return r.raw
+}
+
+// Record type.
+type RecordNewResponseURIType string
+
+const (
+ RecordNewResponseURITypeURI RecordNewResponseURIType = "URI"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordNewResponseURIMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordNewResponseURIMetaJSON `json:"-"`
+}
+
+// recordNewResponseURIMetaJSON contains the JSON metadata for the struct
+// [RecordNewResponseURIMeta]
+type recordNewResponseURIMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordNewResponseURIMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordNewResponseURIMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or [dns.RecordNewResponseURITTLNumber].
+type RecordNewResponseURITTL interface {
+ ImplementsDNSRecordNewResponseUrittl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordNewResponseURITTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordNewResponseURITTLNumber(0)),
+ },
+ )
+}
+
+type RecordNewResponseURITTLNumber float64
+
+const (
+ RecordNewResponseURITTLNumber1 RecordNewResponseURITTLNumber = 1
+)
+
+// Union satisfied by [dns.RecordUpdateResponseA], [dns.RecordUpdateResponseAAAA],
+// [dns.RecordUpdateResponseCAA], [dns.RecordUpdateResponseCert],
+// [dns.RecordUpdateResponseCNAME], [dns.RecordUpdateResponseDNSKEY],
+// [dns.RecordUpdateResponseDS], [dns.RecordUpdateResponseHTTPS],
+// [dns.RecordUpdateResponseLOC], [dns.RecordUpdateResponseMX],
+// [dns.RecordUpdateResponseNAPTR], [dns.RecordUpdateResponseNS],
+// [dns.RecordUpdateResponsePTR], [dns.RecordUpdateResponseSmimea],
+// [dns.RecordUpdateResponseSRV], [dns.RecordUpdateResponseSSHFP],
+// [dns.RecordUpdateResponseSVCB], [dns.RecordUpdateResponseTLSA],
+// [dns.RecordUpdateResponseTXT] or [dns.RecordUpdateResponseURI].
+type RecordUpdateResponse interface {
+ implementsDNSRecordUpdateResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordUpdateResponse)(nil)).Elem(),
+ "type",
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordUpdateResponseA{}),
+ DiscriminatorValue: "A",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordUpdateResponseAAAA{}),
+ DiscriminatorValue: "AAAA",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordUpdateResponseCAA{}),
+ DiscriminatorValue: "CAA",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordUpdateResponseCert{}),
+ DiscriminatorValue: "CERT",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordUpdateResponseCNAME{}),
+ DiscriminatorValue: "CNAME",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordUpdateResponseDNSKEY{}),
+ DiscriminatorValue: "DNSKEY",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordUpdateResponseDS{}),
+ DiscriminatorValue: "DS",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordUpdateResponseHTTPS{}),
+ DiscriminatorValue: "HTTPS",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordUpdateResponseLOC{}),
+ DiscriminatorValue: "LOC",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordUpdateResponseMX{}),
+ DiscriminatorValue: "MX",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordUpdateResponseNAPTR{}),
+ DiscriminatorValue: "NAPTR",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordUpdateResponseNS{}),
+ DiscriminatorValue: "NS",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordUpdateResponsePTR{}),
+ DiscriminatorValue: "PTR",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordUpdateResponseSmimea{}),
+ DiscriminatorValue: "SMIMEA",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordUpdateResponseSRV{}),
+ DiscriminatorValue: "SRV",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordUpdateResponseSSHFP{}),
+ DiscriminatorValue: "SSHFP",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordUpdateResponseSVCB{}),
+ DiscriminatorValue: "SVCB",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordUpdateResponseTLSA{}),
+ DiscriminatorValue: "TLSA",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordUpdateResponseTXT{}),
+ DiscriminatorValue: "TXT",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordUpdateResponseURI{}),
+ DiscriminatorValue: "URI",
+ },
+ )
+}
+
+type RecordUpdateResponseA struct {
+ // A valid IPv4 address.
+ Content string `json:"content,required" format:"ipv4"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordUpdateResponseAType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordUpdateResponseAMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Whether the record is receiving the performance and security benefits of
+ // Cloudflare.
+ Proxied bool `json:"proxied"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordUpdateResponseATTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordUpdateResponseAJSON `json:"-"`
+}
+
+// recordUpdateResponseAJSON contains the JSON metadata for the struct
+// [RecordUpdateResponseA]
+type recordUpdateResponseAJSON struct {
+ Content apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Proxied apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordUpdateResponseA) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordUpdateResponseAJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordUpdateResponseA) implementsDNSRecordUpdateResponse() {}
+
+// Record type.
+type RecordUpdateResponseAType string
+
+const (
+ RecordUpdateResponseATypeA RecordUpdateResponseAType = "A"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordUpdateResponseAMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordUpdateResponseAMetaJSON `json:"-"`
+}
+
+// recordUpdateResponseAMetaJSON contains the JSON metadata for the struct
+// [RecordUpdateResponseAMeta]
+type recordUpdateResponseAMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordUpdateResponseAMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordUpdateResponseAMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or [dns.RecordUpdateResponseATTLNumber].
+type RecordUpdateResponseATTL interface {
+ ImplementsDNSRecordUpdateResponseAttl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordUpdateResponseATTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordUpdateResponseATTLNumber(0)),
+ },
+ )
+}
+
+type RecordUpdateResponseATTLNumber float64
+
+const (
+ RecordUpdateResponseATTLNumber1 RecordUpdateResponseATTLNumber = 1
+)
+
+type RecordUpdateResponseAAAA struct {
+ // A valid IPv6 address.
+ Content string `json:"content,required" format:"ipv6"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordUpdateResponseAAAAType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordUpdateResponseAAAAMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Whether the record is receiving the performance and security benefits of
+ // Cloudflare.
+ Proxied bool `json:"proxied"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordUpdateResponseAAAATTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordUpdateResponseAAAAJSON `json:"-"`
+}
+
+// recordUpdateResponseAAAAJSON contains the JSON metadata for the struct
+// [RecordUpdateResponseAAAA]
+type recordUpdateResponseAAAAJSON struct {
+ Content apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Proxied apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordUpdateResponseAAAA) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordUpdateResponseAAAAJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordUpdateResponseAAAA) implementsDNSRecordUpdateResponse() {}
+
+// Record type.
+type RecordUpdateResponseAAAAType string
+
+const (
+ RecordUpdateResponseAAAATypeAAAA RecordUpdateResponseAAAAType = "AAAA"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordUpdateResponseAAAAMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordUpdateResponseAAAAMetaJSON `json:"-"`
+}
+
+// recordUpdateResponseAAAAMetaJSON contains the JSON metadata for the struct
+// [RecordUpdateResponseAAAAMeta]
+type recordUpdateResponseAAAAMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordUpdateResponseAAAAMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordUpdateResponseAAAAMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or
+// [dns.RecordUpdateResponseAAAATTLNumber].
+type RecordUpdateResponseAAAATTL interface {
+ ImplementsDNSRecordUpdateResponseAaaattl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordUpdateResponseAAAATTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordUpdateResponseAAAATTLNumber(0)),
+ },
+ )
+}
+
+type RecordUpdateResponseAAAATTLNumber float64
+
+const (
+ RecordUpdateResponseAAAATTLNumber1 RecordUpdateResponseAAAATTLNumber = 1
+)
+
+type RecordUpdateResponseCAA struct {
+ // Components of a CAA record.
+ Data RecordUpdateResponseCAAData `json:"data,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordUpdateResponseCAAType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // Formatted CAA content. See 'data' to set CAA properties.
+ Content string `json:"content"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordUpdateResponseCAAMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordUpdateResponseCAATTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordUpdateResponseCAAJSON `json:"-"`
+}
+
+// recordUpdateResponseCAAJSON contains the JSON metadata for the struct
+// [RecordUpdateResponseCAA]
+type recordUpdateResponseCAAJSON struct {
+ Data apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ Content apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordUpdateResponseCAA) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordUpdateResponseCAAJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordUpdateResponseCAA) implementsDNSRecordUpdateResponse() {}
+
+// Components of a CAA record.
+type RecordUpdateResponseCAAData struct {
+ // Flags for the CAA record.
+ Flags float64 `json:"flags"`
+ // Name of the property controlled by this record (e.g.: issue, issuewild, iodef).
+ Tag string `json:"tag"`
+ // Value of the record. This field's semantics depend on the chosen tag.
+ Value string `json:"value"`
+ JSON recordUpdateResponseCAADataJSON `json:"-"`
+}
+
+// recordUpdateResponseCAADataJSON contains the JSON metadata for the struct
+// [RecordUpdateResponseCAAData]
+type recordUpdateResponseCAADataJSON struct {
+ Flags apijson.Field
+ Tag apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordUpdateResponseCAAData) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordUpdateResponseCAADataJSON) RawJSON() string {
+ return r.raw
+}
+
+// Record type.
+type RecordUpdateResponseCAAType string
+
+const (
+ RecordUpdateResponseCAATypeCAA RecordUpdateResponseCAAType = "CAA"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordUpdateResponseCAAMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordUpdateResponseCAAMetaJSON `json:"-"`
+}
+
+// recordUpdateResponseCAAMetaJSON contains the JSON metadata for the struct
+// [RecordUpdateResponseCAAMeta]
+type recordUpdateResponseCAAMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordUpdateResponseCAAMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordUpdateResponseCAAMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or
+// [dns.RecordUpdateResponseCAATTLNumber].
+type RecordUpdateResponseCAATTL interface {
+ ImplementsDNSRecordUpdateResponseCaattl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordUpdateResponseCAATTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordUpdateResponseCAATTLNumber(0)),
+ },
+ )
+}
+
+type RecordUpdateResponseCAATTLNumber float64
+
+const (
+ RecordUpdateResponseCAATTLNumber1 RecordUpdateResponseCAATTLNumber = 1
+)
+
+type RecordUpdateResponseCert struct {
+ // Components of a CERT record.
+ Data RecordUpdateResponseCertData `json:"data,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordUpdateResponseCertType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // Formatted CERT content. See 'data' to set CERT properties.
+ Content string `json:"content"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordUpdateResponseCertMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordUpdateResponseCertTTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordUpdateResponseCertJSON `json:"-"`
+}
+
+// recordUpdateResponseCertJSON contains the JSON metadata for the struct
+// [RecordUpdateResponseCert]
+type recordUpdateResponseCertJSON struct {
+ Data apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ Content apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordUpdateResponseCert) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordUpdateResponseCertJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordUpdateResponseCert) implementsDNSRecordUpdateResponse() {}
+
+// Components of a CERT record.
+type RecordUpdateResponseCertData struct {
+ // Algorithm.
+ Algorithm float64 `json:"algorithm"`
+ // Certificate.
+ Certificate string `json:"certificate"`
+ // Key Tag.
+ KeyTag float64 `json:"key_tag"`
+ // Type.
+ Type float64 `json:"type"`
+ JSON recordUpdateResponseCertDataJSON `json:"-"`
+}
+
+// recordUpdateResponseCertDataJSON contains the JSON metadata for the struct
+// [RecordUpdateResponseCertData]
+type recordUpdateResponseCertDataJSON struct {
+ Algorithm apijson.Field
+ Certificate apijson.Field
+ KeyTag apijson.Field
+ Type apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordUpdateResponseCertData) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordUpdateResponseCertDataJSON) RawJSON() string {
+ return r.raw
+}
+
+// Record type.
+type RecordUpdateResponseCertType string
+
+const (
+ RecordUpdateResponseCertTypeCert RecordUpdateResponseCertType = "CERT"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordUpdateResponseCertMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordUpdateResponseCertMetaJSON `json:"-"`
+}
+
+// recordUpdateResponseCertMetaJSON contains the JSON metadata for the struct
+// [RecordUpdateResponseCertMeta]
+type recordUpdateResponseCertMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordUpdateResponseCertMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordUpdateResponseCertMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or
+// [dns.RecordUpdateResponseCertTTLNumber].
+type RecordUpdateResponseCertTTL interface {
+ ImplementsDNSRecordUpdateResponseCertTTL()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordUpdateResponseCertTTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordUpdateResponseCertTTLNumber(0)),
+ },
+ )
+}
+
+type RecordUpdateResponseCertTTLNumber float64
+
+const (
+ RecordUpdateResponseCertTTLNumber1 RecordUpdateResponseCertTTLNumber = 1
+)
+
+type RecordUpdateResponseCNAME struct {
+ // A valid hostname. Must not match the record's name.
+ Content interface{} `json:"content,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordUpdateResponseCNAMEType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordUpdateResponseCNAMEMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Whether the record is receiving the performance and security benefits of
+ // Cloudflare.
+ Proxied bool `json:"proxied"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordUpdateResponseCNAMETTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordUpdateResponseCNAMEJSON `json:"-"`
+}
+
+// recordUpdateResponseCNAMEJSON contains the JSON metadata for the struct
+// [RecordUpdateResponseCNAME]
+type recordUpdateResponseCNAMEJSON struct {
+ Content apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Proxied apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordUpdateResponseCNAME) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordUpdateResponseCNAMEJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordUpdateResponseCNAME) implementsDNSRecordUpdateResponse() {}
+
+// Record type.
+type RecordUpdateResponseCNAMEType string
+
+const (
+ RecordUpdateResponseCNAMETypeCNAME RecordUpdateResponseCNAMEType = "CNAME"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordUpdateResponseCNAMEMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordUpdateResponseCNAMEMetaJSON `json:"-"`
+}
+
+// recordUpdateResponseCNAMEMetaJSON contains the JSON metadata for the struct
+// [RecordUpdateResponseCNAMEMeta]
+type recordUpdateResponseCNAMEMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordUpdateResponseCNAMEMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordUpdateResponseCNAMEMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or
+// [dns.RecordUpdateResponseCNAMETTLNumber].
+type RecordUpdateResponseCNAMETTL interface {
+ ImplementsDNSRecordUpdateResponseCnamettl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordUpdateResponseCNAMETTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordUpdateResponseCNAMETTLNumber(0)),
+ },
+ )
+}
+
+type RecordUpdateResponseCNAMETTLNumber float64
+
+const (
+ RecordUpdateResponseCNAMETTLNumber1 RecordUpdateResponseCNAMETTLNumber = 1
+)
+
+type RecordUpdateResponseDNSKEY struct {
+ // Components of a DNSKEY record.
+ Data RecordUpdateResponseDNSKEYData `json:"data,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordUpdateResponseDNSKEYType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // Formatted DNSKEY content. See 'data' to set DNSKEY properties.
+ Content string `json:"content"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordUpdateResponseDNSKEYMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordUpdateResponseDNSKEYTTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordUpdateResponseDNSKEYJSON `json:"-"`
+}
+
+// recordUpdateResponseDNSKEYJSON contains the JSON metadata for the struct
+// [RecordUpdateResponseDNSKEY]
+type recordUpdateResponseDNSKEYJSON struct {
+ Data apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ Content apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordUpdateResponseDNSKEY) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordUpdateResponseDNSKEYJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordUpdateResponseDNSKEY) implementsDNSRecordUpdateResponse() {}
+
+// Components of a DNSKEY record.
+type RecordUpdateResponseDNSKEYData struct {
+ // Algorithm.
+ Algorithm float64 `json:"algorithm"`
+ // Flags.
+ Flags float64 `json:"flags"`
+ // Protocol.
+ Protocol float64 `json:"protocol"`
+ // Public Key.
+ PublicKey string `json:"public_key"`
+ JSON recordUpdateResponseDNSKEYDataJSON `json:"-"`
+}
+
+// recordUpdateResponseDNSKEYDataJSON contains the JSON metadata for the struct
+// [RecordUpdateResponseDNSKEYData]
+type recordUpdateResponseDNSKEYDataJSON struct {
+ Algorithm apijson.Field
+ Flags apijson.Field
+ Protocol apijson.Field
+ PublicKey apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordUpdateResponseDNSKEYData) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordUpdateResponseDNSKEYDataJSON) RawJSON() string {
+ return r.raw
+}
+
+// Record type.
+type RecordUpdateResponseDNSKEYType string
+
+const (
+ RecordUpdateResponseDNSKEYTypeDNSKEY RecordUpdateResponseDNSKEYType = "DNSKEY"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordUpdateResponseDNSKEYMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordUpdateResponseDNSKEYMetaJSON `json:"-"`
+}
+
+// recordUpdateResponseDNSKEYMetaJSON contains the JSON metadata for the struct
+// [RecordUpdateResponseDNSKEYMeta]
+type recordUpdateResponseDNSKEYMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordUpdateResponseDNSKEYMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordUpdateResponseDNSKEYMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or
+// [dns.RecordUpdateResponseDNSKEYTTLNumber].
+type RecordUpdateResponseDNSKEYTTL interface {
+ ImplementsDNSRecordUpdateResponseDnskeyttl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordUpdateResponseDNSKEYTTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordUpdateResponseDNSKEYTTLNumber(0)),
+ },
+ )
+}
+
+type RecordUpdateResponseDNSKEYTTLNumber float64
+
+const (
+ RecordUpdateResponseDNSKEYTTLNumber1 RecordUpdateResponseDNSKEYTTLNumber = 1
+)
+
+type RecordUpdateResponseDS struct {
+ // Components of a DS record.
+ Data RecordUpdateResponseDSData `json:"data,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordUpdateResponseDSType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // Formatted DS content. See 'data' to set DS properties.
+ Content string `json:"content"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordUpdateResponseDSMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordUpdateResponseDSTTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordUpdateResponseDSJSON `json:"-"`
+}
+
+// recordUpdateResponseDSJSON contains the JSON metadata for the struct
+// [RecordUpdateResponseDS]
+type recordUpdateResponseDSJSON struct {
+ Data apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ Content apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordUpdateResponseDS) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordUpdateResponseDSJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordUpdateResponseDS) implementsDNSRecordUpdateResponse() {}
+
+// Components of a DS record.
+type RecordUpdateResponseDSData struct {
+ // Algorithm.
+ Algorithm float64 `json:"algorithm"`
+ // Digest.
+ Digest string `json:"digest"`
+ // Digest Type.
+ DigestType float64 `json:"digest_type"`
+ // Key Tag.
+ KeyTag float64 `json:"key_tag"`
+ JSON recordUpdateResponseDSDataJSON `json:"-"`
+}
+
+// recordUpdateResponseDSDataJSON contains the JSON metadata for the struct
+// [RecordUpdateResponseDSData]
+type recordUpdateResponseDSDataJSON struct {
+ Algorithm apijson.Field
+ Digest apijson.Field
+ DigestType apijson.Field
+ KeyTag apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordUpdateResponseDSData) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordUpdateResponseDSDataJSON) RawJSON() string {
+ return r.raw
+}
+
+// Record type.
+type RecordUpdateResponseDSType string
+
+const (
+ RecordUpdateResponseDSTypeDS RecordUpdateResponseDSType = "DS"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordUpdateResponseDSMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordUpdateResponseDSMetaJSON `json:"-"`
+}
+
+// recordUpdateResponseDSMetaJSON contains the JSON metadata for the struct
+// [RecordUpdateResponseDSMeta]
+type recordUpdateResponseDSMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordUpdateResponseDSMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordUpdateResponseDSMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or [dns.RecordUpdateResponseDSTTLNumber].
+type RecordUpdateResponseDSTTL interface {
+ ImplementsDNSRecordUpdateResponseDsttl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordUpdateResponseDSTTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordUpdateResponseDSTTLNumber(0)),
+ },
+ )
+}
+
+type RecordUpdateResponseDSTTLNumber float64
+
+const (
+ RecordUpdateResponseDSTTLNumber1 RecordUpdateResponseDSTTLNumber = 1
+)
+
+type RecordUpdateResponseHTTPS struct {
+ // Components of a HTTPS record.
+ Data RecordUpdateResponseHTTPSData `json:"data,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordUpdateResponseHTTPSType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // Formatted HTTPS content. See 'data' to set HTTPS properties.
+ Content string `json:"content"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordUpdateResponseHTTPSMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordUpdateResponseHTTPSTTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordUpdateResponseHTTPSJSON `json:"-"`
+}
+
+// recordUpdateResponseHTTPSJSON contains the JSON metadata for the struct
+// [RecordUpdateResponseHTTPS]
+type recordUpdateResponseHTTPSJSON struct {
+ Data apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ Content apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordUpdateResponseHTTPS) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordUpdateResponseHTTPSJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordUpdateResponseHTTPS) implementsDNSRecordUpdateResponse() {}
+
+// Components of a HTTPS record.
+type RecordUpdateResponseHTTPSData struct {
+ // priority.
+ Priority float64 `json:"priority"`
+ // target.
+ Target string `json:"target"`
+ // value.
+ Value string `json:"value"`
+ JSON recordUpdateResponseHTTPSDataJSON `json:"-"`
+}
+
+// recordUpdateResponseHTTPSDataJSON contains the JSON metadata for the struct
+// [RecordUpdateResponseHTTPSData]
+type recordUpdateResponseHTTPSDataJSON struct {
+ Priority apijson.Field
+ Target apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordUpdateResponseHTTPSData) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordUpdateResponseHTTPSDataJSON) RawJSON() string {
+ return r.raw
+}
+
+// Record type.
+type RecordUpdateResponseHTTPSType string
+
+const (
+ RecordUpdateResponseHTTPSTypeHTTPS RecordUpdateResponseHTTPSType = "HTTPS"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordUpdateResponseHTTPSMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordUpdateResponseHTTPSMetaJSON `json:"-"`
+}
+
+// recordUpdateResponseHTTPSMetaJSON contains the JSON metadata for the struct
+// [RecordUpdateResponseHTTPSMeta]
+type recordUpdateResponseHTTPSMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordUpdateResponseHTTPSMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordUpdateResponseHTTPSMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or
+// [dns.RecordUpdateResponseHTTPSTTLNumber].
+type RecordUpdateResponseHTTPSTTL interface {
+ ImplementsDNSRecordUpdateResponseHttpsttl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordUpdateResponseHTTPSTTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordUpdateResponseHTTPSTTLNumber(0)),
+ },
+ )
+}
+
+type RecordUpdateResponseHTTPSTTLNumber float64
+
+const (
+ RecordUpdateResponseHTTPSTTLNumber1 RecordUpdateResponseHTTPSTTLNumber = 1
+)
+
+type RecordUpdateResponseLOC struct {
+ // Components of a LOC record.
+ Data RecordUpdateResponseLOCData `json:"data,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordUpdateResponseLOCType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // Formatted LOC content. See 'data' to set LOC properties.
+ Content string `json:"content"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordUpdateResponseLOCMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordUpdateResponseLOCTTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordUpdateResponseLOCJSON `json:"-"`
+}
+
+// recordUpdateResponseLOCJSON contains the JSON metadata for the struct
+// [RecordUpdateResponseLOC]
+type recordUpdateResponseLOCJSON struct {
+ Data apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ Content apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordUpdateResponseLOC) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordUpdateResponseLOCJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordUpdateResponseLOC) implementsDNSRecordUpdateResponse() {}
+
+// Components of a LOC record.
+type RecordUpdateResponseLOCData struct {
+ // Altitude of location in meters.
+ Altitude float64 `json:"altitude"`
+ // Degrees of latitude.
+ LatDegrees float64 `json:"lat_degrees"`
+ // Latitude direction.
+ LatDirection RecordUpdateResponseLOCDataLatDirection `json:"lat_direction"`
+ // Minutes of latitude.
+ LatMinutes float64 `json:"lat_minutes"`
+ // Seconds of latitude.
+ LatSeconds float64 `json:"lat_seconds"`
+ // Degrees of longitude.
+ LongDegrees float64 `json:"long_degrees"`
+ // Longitude direction.
+ LongDirection RecordUpdateResponseLOCDataLongDirection `json:"long_direction"`
+ // Minutes of longitude.
+ LongMinutes float64 `json:"long_minutes"`
+ // Seconds of longitude.
+ LongSeconds float64 `json:"long_seconds"`
+ // Horizontal precision of location.
+ PrecisionHorz float64 `json:"precision_horz"`
+ // Vertical precision of location.
+ PrecisionVert float64 `json:"precision_vert"`
+ // Size of location in meters.
+ Size float64 `json:"size"`
+ JSON recordUpdateResponseLOCDataJSON `json:"-"`
+}
+
+// recordUpdateResponseLOCDataJSON contains the JSON metadata for the struct
+// [RecordUpdateResponseLOCData]
+type recordUpdateResponseLOCDataJSON struct {
+ Altitude apijson.Field
+ LatDegrees apijson.Field
+ LatDirection apijson.Field
+ LatMinutes apijson.Field
+ LatSeconds apijson.Field
+ LongDegrees apijson.Field
+ LongDirection apijson.Field
+ LongMinutes apijson.Field
+ LongSeconds apijson.Field
+ PrecisionHorz apijson.Field
+ PrecisionVert apijson.Field
+ Size apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordUpdateResponseLOCData) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordUpdateResponseLOCDataJSON) RawJSON() string {
+ return r.raw
+}
+
+// Latitude direction.
+type RecordUpdateResponseLOCDataLatDirection string
+
+const (
+ RecordUpdateResponseLOCDataLatDirectionN RecordUpdateResponseLOCDataLatDirection = "N"
+ RecordUpdateResponseLOCDataLatDirectionS RecordUpdateResponseLOCDataLatDirection = "S"
+)
+
+// Longitude direction.
+type RecordUpdateResponseLOCDataLongDirection string
+
+const (
+ RecordUpdateResponseLOCDataLongDirectionE RecordUpdateResponseLOCDataLongDirection = "E"
+ RecordUpdateResponseLOCDataLongDirectionW RecordUpdateResponseLOCDataLongDirection = "W"
+)
+
+// Record type.
+type RecordUpdateResponseLOCType string
+
+const (
+ RecordUpdateResponseLOCTypeLOC RecordUpdateResponseLOCType = "LOC"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordUpdateResponseLOCMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordUpdateResponseLOCMetaJSON `json:"-"`
+}
+
+// recordUpdateResponseLOCMetaJSON contains the JSON metadata for the struct
+// [RecordUpdateResponseLOCMeta]
+type recordUpdateResponseLOCMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordUpdateResponseLOCMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordUpdateResponseLOCMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or
+// [dns.RecordUpdateResponseLOCTTLNumber].
+type RecordUpdateResponseLOCTTL interface {
+ ImplementsDNSRecordUpdateResponseLocttl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordUpdateResponseLOCTTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordUpdateResponseLOCTTLNumber(0)),
+ },
+ )
+}
+
+type RecordUpdateResponseLOCTTLNumber float64
+
+const (
+ RecordUpdateResponseLOCTTLNumber1 RecordUpdateResponseLOCTTLNumber = 1
+)
+
+type RecordUpdateResponseMX struct {
+ // A valid mail server hostname.
+ Content string `json:"content,required" format:"hostname"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Required for MX, SRV and URI records; unused by other record types. Records with
+ // lower priorities are preferred.
+ Priority float64 `json:"priority,required"`
+ // Record type.
+ Type RecordUpdateResponseMXType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordUpdateResponseMXMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordUpdateResponseMXTTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordUpdateResponseMXJSON `json:"-"`
+}
+
+// recordUpdateResponseMXJSON contains the JSON metadata for the struct
+// [RecordUpdateResponseMX]
+type recordUpdateResponseMXJSON struct {
+ Content apijson.Field
+ Name apijson.Field
+ Priority apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordUpdateResponseMX) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordUpdateResponseMXJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordUpdateResponseMX) implementsDNSRecordUpdateResponse() {}
+
+// Record type.
+type RecordUpdateResponseMXType string
+
+const (
+ RecordUpdateResponseMXTypeMX RecordUpdateResponseMXType = "MX"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordUpdateResponseMXMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordUpdateResponseMXMetaJSON `json:"-"`
+}
+
+// recordUpdateResponseMXMetaJSON contains the JSON metadata for the struct
+// [RecordUpdateResponseMXMeta]
+type recordUpdateResponseMXMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordUpdateResponseMXMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordUpdateResponseMXMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or [dns.RecordUpdateResponseMXTTLNumber].
+type RecordUpdateResponseMXTTL interface {
+ ImplementsDNSRecordUpdateResponseMxttl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordUpdateResponseMXTTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordUpdateResponseMXTTLNumber(0)),
+ },
+ )
+}
+
+type RecordUpdateResponseMXTTLNumber float64
+
+const (
+ RecordUpdateResponseMXTTLNumber1 RecordUpdateResponseMXTTLNumber = 1
+)
+
+type RecordUpdateResponseNAPTR struct {
+ // Components of a NAPTR record.
+ Data RecordUpdateResponseNAPTRData `json:"data,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordUpdateResponseNAPTRType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // Formatted NAPTR content. See 'data' to set NAPTR properties.
+ Content string `json:"content"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordUpdateResponseNAPTRMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordUpdateResponseNAPTRTTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordUpdateResponseNAPTRJSON `json:"-"`
+}
+
+// recordUpdateResponseNAPTRJSON contains the JSON metadata for the struct
+// [RecordUpdateResponseNAPTR]
+type recordUpdateResponseNAPTRJSON struct {
+ Data apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ Content apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordUpdateResponseNAPTR) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordUpdateResponseNAPTRJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordUpdateResponseNAPTR) implementsDNSRecordUpdateResponse() {}
+
+// Components of a NAPTR record.
+type RecordUpdateResponseNAPTRData struct {
+ // Flags.
+ Flags string `json:"flags"`
+ // Order.
+ Order float64 `json:"order"`
+ // Preference.
+ Preference float64 `json:"preference"`
+ // Regex.
+ Regex string `json:"regex"`
+ // Replacement.
+ Replacement string `json:"replacement"`
+ // Service.
+ Service string `json:"service"`
+ JSON recordUpdateResponseNAPTRDataJSON `json:"-"`
+}
+
+// recordUpdateResponseNAPTRDataJSON contains the JSON metadata for the struct
+// [RecordUpdateResponseNAPTRData]
+type recordUpdateResponseNAPTRDataJSON struct {
+ Flags apijson.Field
+ Order apijson.Field
+ Preference apijson.Field
+ Regex apijson.Field
+ Replacement apijson.Field
+ Service apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordUpdateResponseNAPTRData) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordUpdateResponseNAPTRDataJSON) RawJSON() string {
+ return r.raw
+}
+
+// Record type.
+type RecordUpdateResponseNAPTRType string
+
+const (
+ RecordUpdateResponseNAPTRTypeNAPTR RecordUpdateResponseNAPTRType = "NAPTR"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordUpdateResponseNAPTRMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordUpdateResponseNAPTRMetaJSON `json:"-"`
+}
+
+// recordUpdateResponseNAPTRMetaJSON contains the JSON metadata for the struct
+// [RecordUpdateResponseNAPTRMeta]
+type recordUpdateResponseNAPTRMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordUpdateResponseNAPTRMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordUpdateResponseNAPTRMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or
+// [dns.RecordUpdateResponseNAPTRTTLNumber].
+type RecordUpdateResponseNAPTRTTL interface {
+ ImplementsDNSRecordUpdateResponseNaptrttl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordUpdateResponseNAPTRTTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordUpdateResponseNAPTRTTLNumber(0)),
+ },
+ )
+}
+
+type RecordUpdateResponseNAPTRTTLNumber float64
+
+const (
+ RecordUpdateResponseNAPTRTTLNumber1 RecordUpdateResponseNAPTRTTLNumber = 1
+)
+
+type RecordUpdateResponseNS struct {
+ // A valid name server host name.
+ Content interface{} `json:"content,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordUpdateResponseNSType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordUpdateResponseNSMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordUpdateResponseNSTTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordUpdateResponseNSJSON `json:"-"`
+}
+
+// recordUpdateResponseNSJSON contains the JSON metadata for the struct
+// [RecordUpdateResponseNS]
+type recordUpdateResponseNSJSON struct {
+ Content apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordUpdateResponseNS) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordUpdateResponseNSJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordUpdateResponseNS) implementsDNSRecordUpdateResponse() {}
+
+// Record type.
+type RecordUpdateResponseNSType string
+
+const (
+ RecordUpdateResponseNSTypeNS RecordUpdateResponseNSType = "NS"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordUpdateResponseNSMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordUpdateResponseNSMetaJSON `json:"-"`
+}
+
+// recordUpdateResponseNSMetaJSON contains the JSON metadata for the struct
+// [RecordUpdateResponseNSMeta]
+type recordUpdateResponseNSMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordUpdateResponseNSMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordUpdateResponseNSMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or [dns.RecordUpdateResponseNSTTLNumber].
+type RecordUpdateResponseNSTTL interface {
+ ImplementsDNSRecordUpdateResponseNsttl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordUpdateResponseNSTTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordUpdateResponseNSTTLNumber(0)),
+ },
+ )
+}
+
+type RecordUpdateResponseNSTTLNumber float64
+
+const (
+ RecordUpdateResponseNSTTLNumber1 RecordUpdateResponseNSTTLNumber = 1
+)
+
+type RecordUpdateResponsePTR struct {
+ // Domain name pointing to the address.
+ Content string `json:"content,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordUpdateResponsePTRType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordUpdateResponsePTRMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordUpdateResponsePTRTTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordUpdateResponsePTRJSON `json:"-"`
+}
+
+// recordUpdateResponsePTRJSON contains the JSON metadata for the struct
+// [RecordUpdateResponsePTR]
+type recordUpdateResponsePTRJSON struct {
+ Content apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordUpdateResponsePTR) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordUpdateResponsePTRJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordUpdateResponsePTR) implementsDNSRecordUpdateResponse() {}
+
+// Record type.
+type RecordUpdateResponsePTRType string
+
+const (
+ RecordUpdateResponsePTRTypePTR RecordUpdateResponsePTRType = "PTR"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordUpdateResponsePTRMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordUpdateResponsePTRMetaJSON `json:"-"`
+}
+
+// recordUpdateResponsePTRMetaJSON contains the JSON metadata for the struct
+// [RecordUpdateResponsePTRMeta]
+type recordUpdateResponsePTRMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordUpdateResponsePTRMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordUpdateResponsePTRMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or
+// [dns.RecordUpdateResponsePTRTTLNumber].
+type RecordUpdateResponsePTRTTL interface {
+ ImplementsDNSRecordUpdateResponsePtrttl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordUpdateResponsePTRTTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordUpdateResponsePTRTTLNumber(0)),
+ },
+ )
+}
+
+type RecordUpdateResponsePTRTTLNumber float64
+
+const (
+ RecordUpdateResponsePTRTTLNumber1 RecordUpdateResponsePTRTTLNumber = 1
+)
+
+type RecordUpdateResponseSmimea struct {
+ // Components of a SMIMEA record.
+ Data RecordUpdateResponseSmimeaData `json:"data,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordUpdateResponseSmimeaType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // Formatted SMIMEA content. See 'data' to set SMIMEA properties.
+ Content string `json:"content"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordUpdateResponseSmimeaMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordUpdateResponseSmimeaTTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordUpdateResponseSmimeaJSON `json:"-"`
+}
+
+// recordUpdateResponseSmimeaJSON contains the JSON metadata for the struct
+// [RecordUpdateResponseSmimea]
+type recordUpdateResponseSmimeaJSON struct {
+ Data apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ Content apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordUpdateResponseSmimea) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordUpdateResponseSmimeaJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordUpdateResponseSmimea) implementsDNSRecordUpdateResponse() {}
+
+// Components of a SMIMEA record.
+type RecordUpdateResponseSmimeaData struct {
+ // Certificate.
+ Certificate string `json:"certificate"`
+ // Matching Type.
+ MatchingType float64 `json:"matching_type"`
+ // Selector.
+ Selector float64 `json:"selector"`
+ // Usage.
+ Usage float64 `json:"usage"`
+ JSON recordUpdateResponseSmimeaDataJSON `json:"-"`
+}
+
+// recordUpdateResponseSmimeaDataJSON contains the JSON metadata for the struct
+// [RecordUpdateResponseSmimeaData]
+type recordUpdateResponseSmimeaDataJSON struct {
+ Certificate apijson.Field
+ MatchingType apijson.Field
+ Selector apijson.Field
+ Usage apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordUpdateResponseSmimeaData) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordUpdateResponseSmimeaDataJSON) RawJSON() string {
+ return r.raw
+}
+
+// Record type.
+type RecordUpdateResponseSmimeaType string
+
+const (
+ RecordUpdateResponseSmimeaTypeSmimea RecordUpdateResponseSmimeaType = "SMIMEA"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordUpdateResponseSmimeaMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordUpdateResponseSmimeaMetaJSON `json:"-"`
+}
+
+// recordUpdateResponseSmimeaMetaJSON contains the JSON metadata for the struct
+// [RecordUpdateResponseSmimeaMeta]
+type recordUpdateResponseSmimeaMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordUpdateResponseSmimeaMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordUpdateResponseSmimeaMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or
+// [dns.RecordUpdateResponseSmimeaTTLNumber].
+type RecordUpdateResponseSmimeaTTL interface {
+ ImplementsDNSRecordUpdateResponseSmimeaTTL()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordUpdateResponseSmimeaTTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordUpdateResponseSmimeaTTLNumber(0)),
+ },
+ )
+}
+
+type RecordUpdateResponseSmimeaTTLNumber float64
+
+const (
+ RecordUpdateResponseSmimeaTTLNumber1 RecordUpdateResponseSmimeaTTLNumber = 1
+)
+
+type RecordUpdateResponseSRV struct {
+ // Components of a SRV record.
+ Data RecordUpdateResponseSRVData `json:"data,required"`
+ // DNS record name (or @ for the zone apex) in Punycode. For SRV records, the first
+ // label is normally a service and the second a protocol name, each starting with
+ // an underscore.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordUpdateResponseSRVType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // Priority, weight, port, and SRV target. See 'data' for setting the individual
+ // component values.
+ Content string `json:"content"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordUpdateResponseSRVMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordUpdateResponseSRVTTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordUpdateResponseSRVJSON `json:"-"`
+}
+
+// recordUpdateResponseSRVJSON contains the JSON metadata for the struct
+// [RecordUpdateResponseSRV]
+type recordUpdateResponseSRVJSON struct {
+ Data apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ Content apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordUpdateResponseSRV) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordUpdateResponseSRVJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordUpdateResponseSRV) implementsDNSRecordUpdateResponse() {}
+
+// Components of a SRV record.
+type RecordUpdateResponseSRVData struct {
+ // A valid hostname. Deprecated in favor of the regular 'name' outside the data
+ // map. This data map field represents the remainder of the full 'name' after the
+ // service and protocol.
+ Name string `json:"name" format:"hostname"`
+ // The port of the service.
+ Port float64 `json:"port"`
+ // Required for MX, SRV and URI records; unused by other record types. Records with
+ // lower priorities are preferred.
+ Priority float64 `json:"priority"`
+ // A valid protocol, prefixed with an underscore. Deprecated in favor of the
+ // regular 'name' outside the data map. This data map field normally represents the
+ // second label of that 'name'.
+ Proto string `json:"proto"`
+ // A service type, prefixed with an underscore. Deprecated in favor of the regular
+ // 'name' outside the data map. This data map field normally represents the first
+ // label of that 'name'.
+ Service string `json:"service"`
+ // A valid hostname.
+ Target string `json:"target" format:"hostname"`
+ // The record weight.
+ Weight float64 `json:"weight"`
+ JSON recordUpdateResponseSRVDataJSON `json:"-"`
+}
+
+// recordUpdateResponseSRVDataJSON contains the JSON metadata for the struct
+// [RecordUpdateResponseSRVData]
+type recordUpdateResponseSRVDataJSON struct {
+ Name apijson.Field
+ Port apijson.Field
+ Priority apijson.Field
+ Proto apijson.Field
+ Service apijson.Field
+ Target apijson.Field
+ Weight apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordUpdateResponseSRVData) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordUpdateResponseSRVDataJSON) RawJSON() string {
+ return r.raw
+}
+
+// Record type.
+type RecordUpdateResponseSRVType string
+
+const (
+ RecordUpdateResponseSRVTypeSRV RecordUpdateResponseSRVType = "SRV"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordUpdateResponseSRVMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordUpdateResponseSRVMetaJSON `json:"-"`
+}
+
+// recordUpdateResponseSRVMetaJSON contains the JSON metadata for the struct
+// [RecordUpdateResponseSRVMeta]
+type recordUpdateResponseSRVMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordUpdateResponseSRVMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordUpdateResponseSRVMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or
+// [dns.RecordUpdateResponseSRVTTLNumber].
+type RecordUpdateResponseSRVTTL interface {
+ ImplementsDNSRecordUpdateResponseSrvttl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordUpdateResponseSRVTTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordUpdateResponseSRVTTLNumber(0)),
+ },
+ )
+}
+
+type RecordUpdateResponseSRVTTLNumber float64
+
+const (
+ RecordUpdateResponseSRVTTLNumber1 RecordUpdateResponseSRVTTLNumber = 1
+)
+
+type RecordUpdateResponseSSHFP struct {
+ // Components of a SSHFP record.
+ Data RecordUpdateResponseSSHFPData `json:"data,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordUpdateResponseSSHFPType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // Formatted SSHFP content. See 'data' to set SSHFP properties.
+ Content string `json:"content"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordUpdateResponseSSHFPMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordUpdateResponseSSHFPTTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordUpdateResponseSSHFPJSON `json:"-"`
+}
+
+// recordUpdateResponseSSHFPJSON contains the JSON metadata for the struct
+// [RecordUpdateResponseSSHFP]
+type recordUpdateResponseSSHFPJSON struct {
+ Data apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ Content apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordUpdateResponseSSHFP) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordUpdateResponseSSHFPJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordUpdateResponseSSHFP) implementsDNSRecordUpdateResponse() {}
+
+// Components of a SSHFP record.
+type RecordUpdateResponseSSHFPData struct {
+ // algorithm.
+ Algorithm float64 `json:"algorithm"`
+ // fingerprint.
+ Fingerprint string `json:"fingerprint"`
+ // type.
+ Type float64 `json:"type"`
+ JSON recordUpdateResponseSSHFPDataJSON `json:"-"`
+}
+
+// recordUpdateResponseSSHFPDataJSON contains the JSON metadata for the struct
+// [RecordUpdateResponseSSHFPData]
+type recordUpdateResponseSSHFPDataJSON struct {
+ Algorithm apijson.Field
+ Fingerprint apijson.Field
+ Type apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordUpdateResponseSSHFPData) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordUpdateResponseSSHFPDataJSON) RawJSON() string {
+ return r.raw
+}
+
+// Record type.
+type RecordUpdateResponseSSHFPType string
+
+const (
+ RecordUpdateResponseSSHFPTypeSSHFP RecordUpdateResponseSSHFPType = "SSHFP"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordUpdateResponseSSHFPMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordUpdateResponseSSHFPMetaJSON `json:"-"`
+}
+
+// recordUpdateResponseSSHFPMetaJSON contains the JSON metadata for the struct
+// [RecordUpdateResponseSSHFPMeta]
+type recordUpdateResponseSSHFPMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordUpdateResponseSSHFPMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordUpdateResponseSSHFPMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or
+// [dns.RecordUpdateResponseSSHFPTTLNumber].
+type RecordUpdateResponseSSHFPTTL interface {
+ ImplementsDNSRecordUpdateResponseSshfpttl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordUpdateResponseSSHFPTTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordUpdateResponseSSHFPTTLNumber(0)),
+ },
+ )
+}
+
+type RecordUpdateResponseSSHFPTTLNumber float64
+
+const (
+ RecordUpdateResponseSSHFPTTLNumber1 RecordUpdateResponseSSHFPTTLNumber = 1
+)
+
+type RecordUpdateResponseSVCB struct {
+ // Components of a SVCB record.
+ Data RecordUpdateResponseSVCBData `json:"data,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordUpdateResponseSVCBType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // Formatted SVCB content. See 'data' to set SVCB properties.
+ Content string `json:"content"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordUpdateResponseSVCBMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordUpdateResponseSVCBTTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordUpdateResponseSVCBJSON `json:"-"`
+}
+
+// recordUpdateResponseSVCBJSON contains the JSON metadata for the struct
+// [RecordUpdateResponseSVCB]
+type recordUpdateResponseSVCBJSON struct {
+ Data apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ Content apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordUpdateResponseSVCB) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordUpdateResponseSVCBJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordUpdateResponseSVCB) implementsDNSRecordUpdateResponse() {}
+
+// Components of a SVCB record.
+type RecordUpdateResponseSVCBData struct {
+ // priority.
+ Priority float64 `json:"priority"`
+ // target.
+ Target string `json:"target"`
+ // value.
+ Value string `json:"value"`
+ JSON recordUpdateResponseSVCBDataJSON `json:"-"`
+}
+
+// recordUpdateResponseSVCBDataJSON contains the JSON metadata for the struct
+// [RecordUpdateResponseSVCBData]
+type recordUpdateResponseSVCBDataJSON struct {
+ Priority apijson.Field
+ Target apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordUpdateResponseSVCBData) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordUpdateResponseSVCBDataJSON) RawJSON() string {
+ return r.raw
+}
+
+// Record type.
+type RecordUpdateResponseSVCBType string
+
+const (
+ RecordUpdateResponseSVCBTypeSVCB RecordUpdateResponseSVCBType = "SVCB"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordUpdateResponseSVCBMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordUpdateResponseSVCBMetaJSON `json:"-"`
+}
+
+// recordUpdateResponseSVCBMetaJSON contains the JSON metadata for the struct
+// [RecordUpdateResponseSVCBMeta]
+type recordUpdateResponseSVCBMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordUpdateResponseSVCBMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordUpdateResponseSVCBMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or
+// [dns.RecordUpdateResponseSVCBTTLNumber].
+type RecordUpdateResponseSVCBTTL interface {
+ ImplementsDNSRecordUpdateResponseSvcbttl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordUpdateResponseSVCBTTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordUpdateResponseSVCBTTLNumber(0)),
+ },
+ )
+}
+
+type RecordUpdateResponseSVCBTTLNumber float64
+
+const (
+ RecordUpdateResponseSVCBTTLNumber1 RecordUpdateResponseSVCBTTLNumber = 1
+)
+
+type RecordUpdateResponseTLSA struct {
+ // Components of a TLSA record.
+ Data RecordUpdateResponseTLSAData `json:"data,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordUpdateResponseTLSAType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // Formatted TLSA content. See 'data' to set TLSA properties.
+ Content string `json:"content"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordUpdateResponseTLSAMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordUpdateResponseTLSATTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordUpdateResponseTLSAJSON `json:"-"`
+}
+
+// recordUpdateResponseTLSAJSON contains the JSON metadata for the struct
+// [RecordUpdateResponseTLSA]
+type recordUpdateResponseTLSAJSON struct {
+ Data apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ Content apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordUpdateResponseTLSA) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordUpdateResponseTLSAJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordUpdateResponseTLSA) implementsDNSRecordUpdateResponse() {}
+
+// Components of a TLSA record.
+type RecordUpdateResponseTLSAData struct {
+ // certificate.
+ Certificate string `json:"certificate"`
+ // Matching Type.
+ MatchingType float64 `json:"matching_type"`
+ // Selector.
+ Selector float64 `json:"selector"`
+ // Usage.
+ Usage float64 `json:"usage"`
+ JSON recordUpdateResponseTLSADataJSON `json:"-"`
+}
+
+// recordUpdateResponseTLSADataJSON contains the JSON metadata for the struct
+// [RecordUpdateResponseTLSAData]
+type recordUpdateResponseTLSADataJSON struct {
+ Certificate apijson.Field
+ MatchingType apijson.Field
+ Selector apijson.Field
+ Usage apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordUpdateResponseTLSAData) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordUpdateResponseTLSADataJSON) RawJSON() string {
+ return r.raw
+}
+
+// Record type.
+type RecordUpdateResponseTLSAType string
+
+const (
+ RecordUpdateResponseTLSATypeTLSA RecordUpdateResponseTLSAType = "TLSA"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordUpdateResponseTLSAMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordUpdateResponseTLSAMetaJSON `json:"-"`
+}
+
+// recordUpdateResponseTLSAMetaJSON contains the JSON metadata for the struct
+// [RecordUpdateResponseTLSAMeta]
+type recordUpdateResponseTLSAMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordUpdateResponseTLSAMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordUpdateResponseTLSAMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or
+// [dns.RecordUpdateResponseTLSATTLNumber].
+type RecordUpdateResponseTLSATTL interface {
+ ImplementsDNSRecordUpdateResponseTlsattl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordUpdateResponseTLSATTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordUpdateResponseTLSATTLNumber(0)),
+ },
+ )
+}
+
+type RecordUpdateResponseTLSATTLNumber float64
+
+const (
+ RecordUpdateResponseTLSATTLNumber1 RecordUpdateResponseTLSATTLNumber = 1
+)
+
+type RecordUpdateResponseTXT struct {
+ // Text content for the record.
+ Content string `json:"content,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordUpdateResponseTXTType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordUpdateResponseTXTMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordUpdateResponseTXTTTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordUpdateResponseTXTJSON `json:"-"`
+}
+
+// recordUpdateResponseTXTJSON contains the JSON metadata for the struct
+// [RecordUpdateResponseTXT]
+type recordUpdateResponseTXTJSON struct {
+ Content apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordUpdateResponseTXT) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordUpdateResponseTXTJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordUpdateResponseTXT) implementsDNSRecordUpdateResponse() {}
+
+// Record type.
+type RecordUpdateResponseTXTType string
+
+const (
+ RecordUpdateResponseTXTTypeTXT RecordUpdateResponseTXTType = "TXT"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordUpdateResponseTXTMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordUpdateResponseTXTMetaJSON `json:"-"`
+}
+
+// recordUpdateResponseTXTMetaJSON contains the JSON metadata for the struct
+// [RecordUpdateResponseTXTMeta]
+type recordUpdateResponseTXTMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordUpdateResponseTXTMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordUpdateResponseTXTMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or
+// [dns.RecordUpdateResponseTXTTTLNumber].
+type RecordUpdateResponseTXTTTL interface {
+ ImplementsDNSRecordUpdateResponseTxtttl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordUpdateResponseTXTTTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordUpdateResponseTXTTTLNumber(0)),
+ },
+ )
+}
+
+type RecordUpdateResponseTXTTTLNumber float64
+
+const (
+ RecordUpdateResponseTXTTTLNumber1 RecordUpdateResponseTXTTTLNumber = 1
+)
+
+type RecordUpdateResponseURI struct {
+ // Components of a URI record.
+ Data RecordUpdateResponseURIData `json:"data,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Required for MX, SRV and URI records; unused by other record types. Records with
+ // lower priorities are preferred.
+ Priority float64 `json:"priority,required"`
+ // Record type.
+ Type RecordUpdateResponseURIType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // Formatted URI content. See 'data' to set URI properties.
+ Content string `json:"content"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordUpdateResponseURIMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordUpdateResponseURITTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordUpdateResponseURIJSON `json:"-"`
+}
+
+// recordUpdateResponseURIJSON contains the JSON metadata for the struct
+// [RecordUpdateResponseURI]
+type recordUpdateResponseURIJSON struct {
+ Data apijson.Field
+ Name apijson.Field
+ Priority apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ Content apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordUpdateResponseURI) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordUpdateResponseURIJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordUpdateResponseURI) implementsDNSRecordUpdateResponse() {}
+
+// Components of a URI record.
+type RecordUpdateResponseURIData struct {
+ // The record content.
+ Content string `json:"content"`
+ // The record weight.
+ Weight float64 `json:"weight"`
+ JSON recordUpdateResponseURIDataJSON `json:"-"`
+}
+
+// recordUpdateResponseURIDataJSON contains the JSON metadata for the struct
+// [RecordUpdateResponseURIData]
+type recordUpdateResponseURIDataJSON struct {
+ Content apijson.Field
+ Weight apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordUpdateResponseURIData) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordUpdateResponseURIDataJSON) RawJSON() string {
+ return r.raw
+}
+
+// Record type.
+type RecordUpdateResponseURIType string
+
+const (
+ RecordUpdateResponseURITypeURI RecordUpdateResponseURIType = "URI"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordUpdateResponseURIMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordUpdateResponseURIMetaJSON `json:"-"`
+}
+
+// recordUpdateResponseURIMetaJSON contains the JSON metadata for the struct
+// [RecordUpdateResponseURIMeta]
+type recordUpdateResponseURIMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordUpdateResponseURIMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordUpdateResponseURIMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or
+// [dns.RecordUpdateResponseURITTLNumber].
+type RecordUpdateResponseURITTL interface {
+ ImplementsDNSRecordUpdateResponseUrittl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordUpdateResponseURITTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordUpdateResponseURITTLNumber(0)),
+ },
+ )
+}
+
+type RecordUpdateResponseURITTLNumber float64
+
+const (
+ RecordUpdateResponseURITTLNumber1 RecordUpdateResponseURITTLNumber = 1
+)
+
+// Union satisfied by [dns.RecordListResponseA], [dns.RecordListResponseAAAA],
+// [dns.RecordListResponseCAA], [dns.RecordListResponseCert],
+// [dns.RecordListResponseCNAME], [dns.RecordListResponseDNSKEY],
+// [dns.RecordListResponseDS], [dns.RecordListResponseHTTPS],
+// [dns.RecordListResponseLOC], [dns.RecordListResponseMX],
+// [dns.RecordListResponseNAPTR], [dns.RecordListResponseNS],
+// [dns.RecordListResponsePTR], [dns.RecordListResponseSmimea],
+// [dns.RecordListResponseSRV], [dns.RecordListResponseSSHFP],
+// [dns.RecordListResponseSVCB], [dns.RecordListResponseTLSA],
+// [dns.RecordListResponseTXT] or [dns.RecordListResponseURI].
+type RecordListResponse interface {
+ implementsDNSRecordListResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordListResponse)(nil)).Elem(),
+ "type",
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordListResponseA{}),
+ DiscriminatorValue: "A",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordListResponseAAAA{}),
+ DiscriminatorValue: "AAAA",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordListResponseCAA{}),
+ DiscriminatorValue: "CAA",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordListResponseCert{}),
+ DiscriminatorValue: "CERT",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordListResponseCNAME{}),
+ DiscriminatorValue: "CNAME",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordListResponseDNSKEY{}),
+ DiscriminatorValue: "DNSKEY",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordListResponseDS{}),
+ DiscriminatorValue: "DS",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordListResponseHTTPS{}),
+ DiscriminatorValue: "HTTPS",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordListResponseLOC{}),
+ DiscriminatorValue: "LOC",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordListResponseMX{}),
+ DiscriminatorValue: "MX",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordListResponseNAPTR{}),
+ DiscriminatorValue: "NAPTR",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordListResponseNS{}),
+ DiscriminatorValue: "NS",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordListResponsePTR{}),
+ DiscriminatorValue: "PTR",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordListResponseSmimea{}),
+ DiscriminatorValue: "SMIMEA",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordListResponseSRV{}),
+ DiscriminatorValue: "SRV",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordListResponseSSHFP{}),
+ DiscriminatorValue: "SSHFP",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordListResponseSVCB{}),
+ DiscriminatorValue: "SVCB",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordListResponseTLSA{}),
+ DiscriminatorValue: "TLSA",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordListResponseTXT{}),
+ DiscriminatorValue: "TXT",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordListResponseURI{}),
+ DiscriminatorValue: "URI",
+ },
+ )
+}
+
+type RecordListResponseA struct {
+ // A valid IPv4 address.
+ Content string `json:"content,required" format:"ipv4"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordListResponseAType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordListResponseAMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Whether the record is receiving the performance and security benefits of
+ // Cloudflare.
+ Proxied bool `json:"proxied"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordListResponseATTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordListResponseAJSON `json:"-"`
+}
+
+// recordListResponseAJSON contains the JSON metadata for the struct
+// [RecordListResponseA]
+type recordListResponseAJSON struct {
+ Content apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Proxied apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordListResponseA) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordListResponseAJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordListResponseA) implementsDNSRecordListResponse() {}
+
+// Record type.
+type RecordListResponseAType string
+
+const (
+ RecordListResponseATypeA RecordListResponseAType = "A"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordListResponseAMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordListResponseAMetaJSON `json:"-"`
+}
+
+// recordListResponseAMetaJSON contains the JSON metadata for the struct
+// [RecordListResponseAMeta]
+type recordListResponseAMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordListResponseAMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordListResponseAMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or [dns.RecordListResponseATTLNumber].
+type RecordListResponseATTL interface {
+ ImplementsDNSRecordListResponseAttl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordListResponseATTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordListResponseATTLNumber(0)),
+ },
+ )
+}
+
+type RecordListResponseATTLNumber float64
+
+const (
+ RecordListResponseATTLNumber1 RecordListResponseATTLNumber = 1
+)
+
+type RecordListResponseAAAA struct {
+ // A valid IPv6 address.
+ Content string `json:"content,required" format:"ipv6"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordListResponseAAAAType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordListResponseAAAAMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Whether the record is receiving the performance and security benefits of
+ // Cloudflare.
+ Proxied bool `json:"proxied"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordListResponseAAAATTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordListResponseAAAAJSON `json:"-"`
+}
+
+// recordListResponseAAAAJSON contains the JSON metadata for the struct
+// [RecordListResponseAAAA]
+type recordListResponseAAAAJSON struct {
+ Content apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Proxied apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordListResponseAAAA) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordListResponseAAAAJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordListResponseAAAA) implementsDNSRecordListResponse() {}
+
+// Record type.
+type RecordListResponseAAAAType string
+
+const (
+ RecordListResponseAAAATypeAAAA RecordListResponseAAAAType = "AAAA"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordListResponseAAAAMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordListResponseAAAAMetaJSON `json:"-"`
+}
+
+// recordListResponseAAAAMetaJSON contains the JSON metadata for the struct
+// [RecordListResponseAAAAMeta]
+type recordListResponseAAAAMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordListResponseAAAAMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordListResponseAAAAMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or [dns.RecordListResponseAAAATTLNumber].
+type RecordListResponseAAAATTL interface {
+ ImplementsDNSRecordListResponseAaaattl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordListResponseAAAATTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordListResponseAAAATTLNumber(0)),
+ },
+ )
+}
+
+type RecordListResponseAAAATTLNumber float64
+
+const (
+ RecordListResponseAAAATTLNumber1 RecordListResponseAAAATTLNumber = 1
+)
+
+type RecordListResponseCAA struct {
+ // Components of a CAA record.
+ Data RecordListResponseCAAData `json:"data,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordListResponseCAAType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // Formatted CAA content. See 'data' to set CAA properties.
+ Content string `json:"content"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordListResponseCAAMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordListResponseCAATTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordListResponseCAAJSON `json:"-"`
+}
+
+// recordListResponseCAAJSON contains the JSON metadata for the struct
+// [RecordListResponseCAA]
+type recordListResponseCAAJSON struct {
+ Data apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ Content apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordListResponseCAA) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordListResponseCAAJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordListResponseCAA) implementsDNSRecordListResponse() {}
+
+// Components of a CAA record.
+type RecordListResponseCAAData struct {
+ // Flags for the CAA record.
+ Flags float64 `json:"flags"`
+ // Name of the property controlled by this record (e.g.: issue, issuewild, iodef).
+ Tag string `json:"tag"`
+ // Value of the record. This field's semantics depend on the chosen tag.
+ Value string `json:"value"`
+ JSON recordListResponseCAADataJSON `json:"-"`
+}
+
+// recordListResponseCAADataJSON contains the JSON metadata for the struct
+// [RecordListResponseCAAData]
+type recordListResponseCAADataJSON struct {
+ Flags apijson.Field
+ Tag apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordListResponseCAAData) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordListResponseCAADataJSON) RawJSON() string {
+ return r.raw
+}
+
+// Record type.
+type RecordListResponseCAAType string
+
+const (
+ RecordListResponseCAATypeCAA RecordListResponseCAAType = "CAA"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordListResponseCAAMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordListResponseCAAMetaJSON `json:"-"`
+}
+
+// recordListResponseCAAMetaJSON contains the JSON metadata for the struct
+// [RecordListResponseCAAMeta]
+type recordListResponseCAAMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordListResponseCAAMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordListResponseCAAMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or [dns.RecordListResponseCAATTLNumber].
+type RecordListResponseCAATTL interface {
+ ImplementsDNSRecordListResponseCaattl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordListResponseCAATTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordListResponseCAATTLNumber(0)),
+ },
+ )
+}
+
+type RecordListResponseCAATTLNumber float64
+
+const (
+ RecordListResponseCAATTLNumber1 RecordListResponseCAATTLNumber = 1
+)
+
+type RecordListResponseCert struct {
+ // Components of a CERT record.
+ Data RecordListResponseCertData `json:"data,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordListResponseCertType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // Formatted CERT content. See 'data' to set CERT properties.
+ Content string `json:"content"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordListResponseCertMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordListResponseCertTTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordListResponseCertJSON `json:"-"`
+}
+
+// recordListResponseCertJSON contains the JSON metadata for the struct
+// [RecordListResponseCert]
+type recordListResponseCertJSON struct {
+ Data apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ Content apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordListResponseCert) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordListResponseCertJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordListResponseCert) implementsDNSRecordListResponse() {}
+
+// Components of a CERT record.
+type RecordListResponseCertData struct {
+ // Algorithm.
+ Algorithm float64 `json:"algorithm"`
+ // Certificate.
+ Certificate string `json:"certificate"`
+ // Key Tag.
+ KeyTag float64 `json:"key_tag"`
+ // Type.
+ Type float64 `json:"type"`
+ JSON recordListResponseCertDataJSON `json:"-"`
+}
+
+// recordListResponseCertDataJSON contains the JSON metadata for the struct
+// [RecordListResponseCertData]
+type recordListResponseCertDataJSON struct {
+ Algorithm apijson.Field
+ Certificate apijson.Field
+ KeyTag apijson.Field
+ Type apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordListResponseCertData) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordListResponseCertDataJSON) RawJSON() string {
+ return r.raw
+}
+
+// Record type.
+type RecordListResponseCertType string
+
+const (
+ RecordListResponseCertTypeCert RecordListResponseCertType = "CERT"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordListResponseCertMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordListResponseCertMetaJSON `json:"-"`
+}
+
+// recordListResponseCertMetaJSON contains the JSON metadata for the struct
+// [RecordListResponseCertMeta]
+type recordListResponseCertMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordListResponseCertMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordListResponseCertMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or [dns.RecordListResponseCertTTLNumber].
+type RecordListResponseCertTTL interface {
+ ImplementsDNSRecordListResponseCertTTL()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordListResponseCertTTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordListResponseCertTTLNumber(0)),
+ },
+ )
+}
+
+type RecordListResponseCertTTLNumber float64
+
+const (
+ RecordListResponseCertTTLNumber1 RecordListResponseCertTTLNumber = 1
+)
+
+type RecordListResponseCNAME struct {
+ // A valid hostname. Must not match the record's name.
+ Content interface{} `json:"content,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordListResponseCNAMEType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordListResponseCNAMEMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Whether the record is receiving the performance and security benefits of
+ // Cloudflare.
+ Proxied bool `json:"proxied"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordListResponseCNAMETTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordListResponseCNAMEJSON `json:"-"`
+}
+
+// recordListResponseCNAMEJSON contains the JSON metadata for the struct
+// [RecordListResponseCNAME]
+type recordListResponseCNAMEJSON struct {
+ Content apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Proxied apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordListResponseCNAME) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordListResponseCNAMEJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordListResponseCNAME) implementsDNSRecordListResponse() {}
+
+// Record type.
+type RecordListResponseCNAMEType string
+
+const (
+ RecordListResponseCNAMETypeCNAME RecordListResponseCNAMEType = "CNAME"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordListResponseCNAMEMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordListResponseCNAMEMetaJSON `json:"-"`
+}
+
+// recordListResponseCNAMEMetaJSON contains the JSON metadata for the struct
+// [RecordListResponseCNAMEMeta]
+type recordListResponseCNAMEMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordListResponseCNAMEMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordListResponseCNAMEMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or
+// [dns.RecordListResponseCNAMETTLNumber].
+type RecordListResponseCNAMETTL interface {
+ ImplementsDNSRecordListResponseCnamettl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordListResponseCNAMETTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordListResponseCNAMETTLNumber(0)),
+ },
+ )
+}
+
+type RecordListResponseCNAMETTLNumber float64
+
+const (
+ RecordListResponseCNAMETTLNumber1 RecordListResponseCNAMETTLNumber = 1
+)
+
+type RecordListResponseDNSKEY struct {
+ // Components of a DNSKEY record.
+ Data RecordListResponseDNSKEYData `json:"data,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordListResponseDNSKEYType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // Formatted DNSKEY content. See 'data' to set DNSKEY properties.
+ Content string `json:"content"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordListResponseDNSKEYMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordListResponseDNSKEYTTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordListResponseDNSKEYJSON `json:"-"`
+}
+
+// recordListResponseDNSKEYJSON contains the JSON metadata for the struct
+// [RecordListResponseDNSKEY]
+type recordListResponseDNSKEYJSON struct {
+ Data apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ Content apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordListResponseDNSKEY) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordListResponseDNSKEYJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordListResponseDNSKEY) implementsDNSRecordListResponse() {}
+
+// Components of a DNSKEY record.
+type RecordListResponseDNSKEYData struct {
+ // Algorithm.
+ Algorithm float64 `json:"algorithm"`
+ // Flags.
+ Flags float64 `json:"flags"`
+ // Protocol.
+ Protocol float64 `json:"protocol"`
+ // Public Key.
+ PublicKey string `json:"public_key"`
+ JSON recordListResponseDNSKEYDataJSON `json:"-"`
+}
+
+// recordListResponseDNSKEYDataJSON contains the JSON metadata for the struct
+// [RecordListResponseDNSKEYData]
+type recordListResponseDNSKEYDataJSON struct {
+ Algorithm apijson.Field
+ Flags apijson.Field
+ Protocol apijson.Field
+ PublicKey apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordListResponseDNSKEYData) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordListResponseDNSKEYDataJSON) RawJSON() string {
+ return r.raw
+}
+
+// Record type.
+type RecordListResponseDNSKEYType string
+
+const (
+ RecordListResponseDNSKEYTypeDNSKEY RecordListResponseDNSKEYType = "DNSKEY"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordListResponseDNSKEYMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordListResponseDNSKEYMetaJSON `json:"-"`
+}
+
+// recordListResponseDNSKEYMetaJSON contains the JSON metadata for the struct
+// [RecordListResponseDNSKEYMeta]
+type recordListResponseDNSKEYMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordListResponseDNSKEYMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordListResponseDNSKEYMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or
+// [dns.RecordListResponseDNSKEYTTLNumber].
+type RecordListResponseDNSKEYTTL interface {
+ ImplementsDNSRecordListResponseDnskeyttl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordListResponseDNSKEYTTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordListResponseDNSKEYTTLNumber(0)),
+ },
+ )
+}
+
+type RecordListResponseDNSKEYTTLNumber float64
+
+const (
+ RecordListResponseDNSKEYTTLNumber1 RecordListResponseDNSKEYTTLNumber = 1
+)
+
+type RecordListResponseDS struct {
+ // Components of a DS record.
+ Data RecordListResponseDSData `json:"data,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordListResponseDSType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // Formatted DS content. See 'data' to set DS properties.
+ Content string `json:"content"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordListResponseDSMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordListResponseDSTTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordListResponseDSJSON `json:"-"`
+}
+
+// recordListResponseDSJSON contains the JSON metadata for the struct
+// [RecordListResponseDS]
+type recordListResponseDSJSON struct {
+ Data apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ Content apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordListResponseDS) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordListResponseDSJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordListResponseDS) implementsDNSRecordListResponse() {}
+
+// Components of a DS record.
+type RecordListResponseDSData struct {
+ // Algorithm.
+ Algorithm float64 `json:"algorithm"`
+ // Digest.
+ Digest string `json:"digest"`
+ // Digest Type.
+ DigestType float64 `json:"digest_type"`
+ // Key Tag.
+ KeyTag float64 `json:"key_tag"`
+ JSON recordListResponseDSDataJSON `json:"-"`
+}
+
+// recordListResponseDSDataJSON contains the JSON metadata for the struct
+// [RecordListResponseDSData]
+type recordListResponseDSDataJSON struct {
+ Algorithm apijson.Field
+ Digest apijson.Field
+ DigestType apijson.Field
+ KeyTag apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordListResponseDSData) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordListResponseDSDataJSON) RawJSON() string {
+ return r.raw
+}
+
+// Record type.
+type RecordListResponseDSType string
+
+const (
+ RecordListResponseDSTypeDS RecordListResponseDSType = "DS"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordListResponseDSMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordListResponseDSMetaJSON `json:"-"`
+}
+
+// recordListResponseDSMetaJSON contains the JSON metadata for the struct
+// [RecordListResponseDSMeta]
+type recordListResponseDSMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordListResponseDSMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordListResponseDSMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or [dns.RecordListResponseDSTTLNumber].
+type RecordListResponseDSTTL interface {
+ ImplementsDNSRecordListResponseDsttl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordListResponseDSTTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordListResponseDSTTLNumber(0)),
+ },
+ )
+}
+
+type RecordListResponseDSTTLNumber float64
+
+const (
+ RecordListResponseDSTTLNumber1 RecordListResponseDSTTLNumber = 1
+)
+
+type RecordListResponseHTTPS struct {
+ // Components of a HTTPS record.
+ Data RecordListResponseHTTPSData `json:"data,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordListResponseHTTPSType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // Formatted HTTPS content. See 'data' to set HTTPS properties.
+ Content string `json:"content"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordListResponseHTTPSMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordListResponseHTTPSTTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordListResponseHTTPSJSON `json:"-"`
+}
+
+// recordListResponseHTTPSJSON contains the JSON metadata for the struct
+// [RecordListResponseHTTPS]
+type recordListResponseHTTPSJSON struct {
+ Data apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ Content apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordListResponseHTTPS) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordListResponseHTTPSJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordListResponseHTTPS) implementsDNSRecordListResponse() {}
+
+// Components of a HTTPS record.
+type RecordListResponseHTTPSData struct {
+ // priority.
+ Priority float64 `json:"priority"`
+ // target.
+ Target string `json:"target"`
+ // value.
+ Value string `json:"value"`
+ JSON recordListResponseHTTPSDataJSON `json:"-"`
+}
+
+// recordListResponseHTTPSDataJSON contains the JSON metadata for the struct
+// [RecordListResponseHTTPSData]
+type recordListResponseHTTPSDataJSON struct {
+ Priority apijson.Field
+ Target apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordListResponseHTTPSData) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordListResponseHTTPSDataJSON) RawJSON() string {
+ return r.raw
+}
+
+// Record type.
+type RecordListResponseHTTPSType string
+
+const (
+ RecordListResponseHTTPSTypeHTTPS RecordListResponseHTTPSType = "HTTPS"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordListResponseHTTPSMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordListResponseHTTPSMetaJSON `json:"-"`
+}
+
+// recordListResponseHTTPSMetaJSON contains the JSON metadata for the struct
+// [RecordListResponseHTTPSMeta]
+type recordListResponseHTTPSMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordListResponseHTTPSMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordListResponseHTTPSMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or
+// [dns.RecordListResponseHTTPSTTLNumber].
+type RecordListResponseHTTPSTTL interface {
+ ImplementsDNSRecordListResponseHttpsttl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordListResponseHTTPSTTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordListResponseHTTPSTTLNumber(0)),
+ },
+ )
+}
+
+type RecordListResponseHTTPSTTLNumber float64
+
+const (
+ RecordListResponseHTTPSTTLNumber1 RecordListResponseHTTPSTTLNumber = 1
+)
+
+type RecordListResponseLOC struct {
+ // Components of a LOC record.
+ Data RecordListResponseLOCData `json:"data,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordListResponseLOCType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // Formatted LOC content. See 'data' to set LOC properties.
+ Content string `json:"content"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordListResponseLOCMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordListResponseLOCTTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordListResponseLOCJSON `json:"-"`
+}
+
+// recordListResponseLOCJSON contains the JSON metadata for the struct
+// [RecordListResponseLOC]
+type recordListResponseLOCJSON struct {
+ Data apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ Content apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordListResponseLOC) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordListResponseLOCJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordListResponseLOC) implementsDNSRecordListResponse() {}
+
+// Components of a LOC record.
+type RecordListResponseLOCData struct {
+ // Altitude of location in meters.
+ Altitude float64 `json:"altitude"`
+ // Degrees of latitude.
+ LatDegrees float64 `json:"lat_degrees"`
+ // Latitude direction.
+ LatDirection RecordListResponseLOCDataLatDirection `json:"lat_direction"`
+ // Minutes of latitude.
+ LatMinutes float64 `json:"lat_minutes"`
+ // Seconds of latitude.
+ LatSeconds float64 `json:"lat_seconds"`
+ // Degrees of longitude.
+ LongDegrees float64 `json:"long_degrees"`
+ // Longitude direction.
+ LongDirection RecordListResponseLOCDataLongDirection `json:"long_direction"`
+ // Minutes of longitude.
+ LongMinutes float64 `json:"long_minutes"`
+ // Seconds of longitude.
+ LongSeconds float64 `json:"long_seconds"`
+ // Horizontal precision of location.
+ PrecisionHorz float64 `json:"precision_horz"`
+ // Vertical precision of location.
+ PrecisionVert float64 `json:"precision_vert"`
+ // Size of location in meters.
+ Size float64 `json:"size"`
+ JSON recordListResponseLOCDataJSON `json:"-"`
+}
+
+// recordListResponseLOCDataJSON contains the JSON metadata for the struct
+// [RecordListResponseLOCData]
+type recordListResponseLOCDataJSON struct {
+ Altitude apijson.Field
+ LatDegrees apijson.Field
+ LatDirection apijson.Field
+ LatMinutes apijson.Field
+ LatSeconds apijson.Field
+ LongDegrees apijson.Field
+ LongDirection apijson.Field
+ LongMinutes apijson.Field
+ LongSeconds apijson.Field
+ PrecisionHorz apijson.Field
+ PrecisionVert apijson.Field
+ Size apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordListResponseLOCData) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordListResponseLOCDataJSON) RawJSON() string {
+ return r.raw
+}
+
+// Latitude direction.
+type RecordListResponseLOCDataLatDirection string
+
+const (
+ RecordListResponseLOCDataLatDirectionN RecordListResponseLOCDataLatDirection = "N"
+ RecordListResponseLOCDataLatDirectionS RecordListResponseLOCDataLatDirection = "S"
+)
+
+// Longitude direction.
+type RecordListResponseLOCDataLongDirection string
+
+const (
+ RecordListResponseLOCDataLongDirectionE RecordListResponseLOCDataLongDirection = "E"
+ RecordListResponseLOCDataLongDirectionW RecordListResponseLOCDataLongDirection = "W"
+)
+
+// Record type.
+type RecordListResponseLOCType string
+
+const (
+ RecordListResponseLOCTypeLOC RecordListResponseLOCType = "LOC"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordListResponseLOCMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordListResponseLOCMetaJSON `json:"-"`
+}
+
+// recordListResponseLOCMetaJSON contains the JSON metadata for the struct
+// [RecordListResponseLOCMeta]
+type recordListResponseLOCMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordListResponseLOCMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordListResponseLOCMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or [dns.RecordListResponseLOCTTLNumber].
+type RecordListResponseLOCTTL interface {
+ ImplementsDNSRecordListResponseLocttl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordListResponseLOCTTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordListResponseLOCTTLNumber(0)),
+ },
+ )
+}
+
+type RecordListResponseLOCTTLNumber float64
+
+const (
+ RecordListResponseLOCTTLNumber1 RecordListResponseLOCTTLNumber = 1
+)
+
+type RecordListResponseMX struct {
+ // A valid mail server hostname.
+ Content string `json:"content,required" format:"hostname"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Required for MX, SRV and URI records; unused by other record types. Records with
+ // lower priorities are preferred.
+ Priority float64 `json:"priority,required"`
+ // Record type.
+ Type RecordListResponseMXType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordListResponseMXMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordListResponseMXTTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordListResponseMXJSON `json:"-"`
+}
+
+// recordListResponseMXJSON contains the JSON metadata for the struct
+// [RecordListResponseMX]
+type recordListResponseMXJSON struct {
+ Content apijson.Field
+ Name apijson.Field
+ Priority apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordListResponseMX) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordListResponseMXJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordListResponseMX) implementsDNSRecordListResponse() {}
+
+// Record type.
+type RecordListResponseMXType string
+
+const (
+ RecordListResponseMXTypeMX RecordListResponseMXType = "MX"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordListResponseMXMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordListResponseMXMetaJSON `json:"-"`
+}
+
+// recordListResponseMXMetaJSON contains the JSON metadata for the struct
+// [RecordListResponseMXMeta]
+type recordListResponseMXMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordListResponseMXMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordListResponseMXMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or [dns.RecordListResponseMXTTLNumber].
+type RecordListResponseMXTTL interface {
+ ImplementsDNSRecordListResponseMxttl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordListResponseMXTTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordListResponseMXTTLNumber(0)),
+ },
+ )
+}
+
+type RecordListResponseMXTTLNumber float64
+
+const (
+ RecordListResponseMXTTLNumber1 RecordListResponseMXTTLNumber = 1
+)
+
+type RecordListResponseNAPTR struct {
+ // Components of a NAPTR record.
+ Data RecordListResponseNAPTRData `json:"data,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordListResponseNAPTRType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // Formatted NAPTR content. See 'data' to set NAPTR properties.
+ Content string `json:"content"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordListResponseNAPTRMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordListResponseNAPTRTTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordListResponseNAPTRJSON `json:"-"`
+}
+
+// recordListResponseNAPTRJSON contains the JSON metadata for the struct
+// [RecordListResponseNAPTR]
+type recordListResponseNAPTRJSON struct {
+ Data apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ Content apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordListResponseNAPTR) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordListResponseNAPTRJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordListResponseNAPTR) implementsDNSRecordListResponse() {}
+
+// Components of a NAPTR record.
+type RecordListResponseNAPTRData struct {
+ // Flags.
+ Flags string `json:"flags"`
+ // Order.
+ Order float64 `json:"order"`
+ // Preference.
+ Preference float64 `json:"preference"`
+ // Regex.
+ Regex string `json:"regex"`
+ // Replacement.
+ Replacement string `json:"replacement"`
+ // Service.
+ Service string `json:"service"`
+ JSON recordListResponseNAPTRDataJSON `json:"-"`
+}
+
+// recordListResponseNAPTRDataJSON contains the JSON metadata for the struct
+// [RecordListResponseNAPTRData]
+type recordListResponseNAPTRDataJSON struct {
+ Flags apijson.Field
+ Order apijson.Field
+ Preference apijson.Field
+ Regex apijson.Field
+ Replacement apijson.Field
+ Service apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordListResponseNAPTRData) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordListResponseNAPTRDataJSON) RawJSON() string {
+ return r.raw
+}
+
+// Record type.
+type RecordListResponseNAPTRType string
+
+const (
+ RecordListResponseNAPTRTypeNAPTR RecordListResponseNAPTRType = "NAPTR"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordListResponseNAPTRMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordListResponseNAPTRMetaJSON `json:"-"`
+}
+
+// recordListResponseNAPTRMetaJSON contains the JSON metadata for the struct
+// [RecordListResponseNAPTRMeta]
+type recordListResponseNAPTRMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordListResponseNAPTRMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordListResponseNAPTRMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or
+// [dns.RecordListResponseNAPTRTTLNumber].
+type RecordListResponseNAPTRTTL interface {
+ ImplementsDNSRecordListResponseNaptrttl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordListResponseNAPTRTTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordListResponseNAPTRTTLNumber(0)),
+ },
+ )
+}
+
+type RecordListResponseNAPTRTTLNumber float64
+
+const (
+ RecordListResponseNAPTRTTLNumber1 RecordListResponseNAPTRTTLNumber = 1
+)
+
+type RecordListResponseNS struct {
+ // A valid name server host name.
+ Content interface{} `json:"content,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordListResponseNSType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordListResponseNSMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordListResponseNSTTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordListResponseNSJSON `json:"-"`
+}
+
+// recordListResponseNSJSON contains the JSON metadata for the struct
+// [RecordListResponseNS]
+type recordListResponseNSJSON struct {
+ Content apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordListResponseNS) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordListResponseNSJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordListResponseNS) implementsDNSRecordListResponse() {}
+
+// Record type.
+type RecordListResponseNSType string
+
+const (
+ RecordListResponseNSTypeNS RecordListResponseNSType = "NS"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordListResponseNSMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordListResponseNSMetaJSON `json:"-"`
+}
+
+// recordListResponseNSMetaJSON contains the JSON metadata for the struct
+// [RecordListResponseNSMeta]
+type recordListResponseNSMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordListResponseNSMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordListResponseNSMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or [dns.RecordListResponseNSTTLNumber].
+type RecordListResponseNSTTL interface {
+ ImplementsDNSRecordListResponseNsttl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordListResponseNSTTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordListResponseNSTTLNumber(0)),
+ },
+ )
+}
+
+type RecordListResponseNSTTLNumber float64
+
+const (
+ RecordListResponseNSTTLNumber1 RecordListResponseNSTTLNumber = 1
+)
+
+type RecordListResponsePTR struct {
+ // Domain name pointing to the address.
+ Content string `json:"content,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordListResponsePTRType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordListResponsePTRMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordListResponsePTRTTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordListResponsePTRJSON `json:"-"`
+}
+
+// recordListResponsePTRJSON contains the JSON metadata for the struct
+// [RecordListResponsePTR]
+type recordListResponsePTRJSON struct {
+ Content apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordListResponsePTR) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordListResponsePTRJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordListResponsePTR) implementsDNSRecordListResponse() {}
+
+// Record type.
+type RecordListResponsePTRType string
+
+const (
+ RecordListResponsePTRTypePTR RecordListResponsePTRType = "PTR"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordListResponsePTRMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordListResponsePTRMetaJSON `json:"-"`
+}
+
+// recordListResponsePTRMetaJSON contains the JSON metadata for the struct
+// [RecordListResponsePTRMeta]
+type recordListResponsePTRMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordListResponsePTRMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordListResponsePTRMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or [dns.RecordListResponsePTRTTLNumber].
+type RecordListResponsePTRTTL interface {
+ ImplementsDNSRecordListResponsePtrttl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordListResponsePTRTTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordListResponsePTRTTLNumber(0)),
+ },
+ )
+}
+
+type RecordListResponsePTRTTLNumber float64
+
+const (
+ RecordListResponsePTRTTLNumber1 RecordListResponsePTRTTLNumber = 1
+)
+
+type RecordListResponseSmimea struct {
+ // Components of a SMIMEA record.
+ Data RecordListResponseSmimeaData `json:"data,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordListResponseSmimeaType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // Formatted SMIMEA content. See 'data' to set SMIMEA properties.
+ Content string `json:"content"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordListResponseSmimeaMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordListResponseSmimeaTTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordListResponseSmimeaJSON `json:"-"`
+}
+
+// recordListResponseSmimeaJSON contains the JSON metadata for the struct
+// [RecordListResponseSmimea]
+type recordListResponseSmimeaJSON struct {
+ Data apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ Content apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordListResponseSmimea) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordListResponseSmimeaJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordListResponseSmimea) implementsDNSRecordListResponse() {}
+
+// Components of a SMIMEA record.
+type RecordListResponseSmimeaData struct {
+ // Certificate.
+ Certificate string `json:"certificate"`
+ // Matching Type.
+ MatchingType float64 `json:"matching_type"`
+ // Selector.
+ Selector float64 `json:"selector"`
+ // Usage.
+ Usage float64 `json:"usage"`
+ JSON recordListResponseSmimeaDataJSON `json:"-"`
+}
+
+// recordListResponseSmimeaDataJSON contains the JSON metadata for the struct
+// [RecordListResponseSmimeaData]
+type recordListResponseSmimeaDataJSON struct {
+ Certificate apijson.Field
+ MatchingType apijson.Field
+ Selector apijson.Field
+ Usage apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordListResponseSmimeaData) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordListResponseSmimeaDataJSON) RawJSON() string {
+ return r.raw
+}
+
+// Record type.
+type RecordListResponseSmimeaType string
+
+const (
+ RecordListResponseSmimeaTypeSmimea RecordListResponseSmimeaType = "SMIMEA"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordListResponseSmimeaMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordListResponseSmimeaMetaJSON `json:"-"`
+}
+
+// recordListResponseSmimeaMetaJSON contains the JSON metadata for the struct
+// [RecordListResponseSmimeaMeta]
+type recordListResponseSmimeaMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordListResponseSmimeaMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordListResponseSmimeaMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or
+// [dns.RecordListResponseSmimeaTTLNumber].
+type RecordListResponseSmimeaTTL interface {
+ ImplementsDNSRecordListResponseSmimeaTTL()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordListResponseSmimeaTTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordListResponseSmimeaTTLNumber(0)),
+ },
+ )
+}
+
+type RecordListResponseSmimeaTTLNumber float64
+
+const (
+ RecordListResponseSmimeaTTLNumber1 RecordListResponseSmimeaTTLNumber = 1
+)
+
+type RecordListResponseSRV struct {
+ // Components of a SRV record.
+ Data RecordListResponseSRVData `json:"data,required"`
+ // DNS record name (or @ for the zone apex) in Punycode. For SRV records, the first
+ // label is normally a service and the second a protocol name, each starting with
+ // an underscore.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordListResponseSRVType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // Priority, weight, port, and SRV target. See 'data' for setting the individual
+ // component values.
+ Content string `json:"content"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordListResponseSRVMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordListResponseSRVTTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordListResponseSRVJSON `json:"-"`
+}
+
+// recordListResponseSRVJSON contains the JSON metadata for the struct
+// [RecordListResponseSRV]
+type recordListResponseSRVJSON struct {
+ Data apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ Content apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordListResponseSRV) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordListResponseSRVJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordListResponseSRV) implementsDNSRecordListResponse() {}
+
+// Components of a SRV record.
+type RecordListResponseSRVData struct {
+ // A valid hostname. Deprecated in favor of the regular 'name' outside the data
+ // map. This data map field represents the remainder of the full 'name' after the
+ // service and protocol.
+ Name string `json:"name" format:"hostname"`
+ // The port of the service.
+ Port float64 `json:"port"`
+ // Required for MX, SRV and URI records; unused by other record types. Records with
+ // lower priorities are preferred.
+ Priority float64 `json:"priority"`
+ // A valid protocol, prefixed with an underscore. Deprecated in favor of the
+ // regular 'name' outside the data map. This data map field normally represents the
+ // second label of that 'name'.
+ Proto string `json:"proto"`
+ // A service type, prefixed with an underscore. Deprecated in favor of the regular
+ // 'name' outside the data map. This data map field normally represents the first
+ // label of that 'name'.
+ Service string `json:"service"`
+ // A valid hostname.
+ Target string `json:"target" format:"hostname"`
+ // The record weight.
+ Weight float64 `json:"weight"`
+ JSON recordListResponseSRVDataJSON `json:"-"`
+}
+
+// recordListResponseSRVDataJSON contains the JSON metadata for the struct
+// [RecordListResponseSRVData]
+type recordListResponseSRVDataJSON struct {
+ Name apijson.Field
+ Port apijson.Field
+ Priority apijson.Field
+ Proto apijson.Field
+ Service apijson.Field
+ Target apijson.Field
+ Weight apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordListResponseSRVData) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordListResponseSRVDataJSON) RawJSON() string {
+ return r.raw
+}
+
+// Record type.
+type RecordListResponseSRVType string
+
+const (
+ RecordListResponseSRVTypeSRV RecordListResponseSRVType = "SRV"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordListResponseSRVMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordListResponseSRVMetaJSON `json:"-"`
+}
+
+// recordListResponseSRVMetaJSON contains the JSON metadata for the struct
+// [RecordListResponseSRVMeta]
+type recordListResponseSRVMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordListResponseSRVMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordListResponseSRVMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or [dns.RecordListResponseSRVTTLNumber].
+type RecordListResponseSRVTTL interface {
+ ImplementsDNSRecordListResponseSrvttl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordListResponseSRVTTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordListResponseSRVTTLNumber(0)),
+ },
+ )
+}
+
+type RecordListResponseSRVTTLNumber float64
+
+const (
+ RecordListResponseSRVTTLNumber1 RecordListResponseSRVTTLNumber = 1
+)
+
+type RecordListResponseSSHFP struct {
+ // Components of a SSHFP record.
+ Data RecordListResponseSSHFPData `json:"data,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordListResponseSSHFPType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // Formatted SSHFP content. See 'data' to set SSHFP properties.
+ Content string `json:"content"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordListResponseSSHFPMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordListResponseSSHFPTTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordListResponseSSHFPJSON `json:"-"`
+}
+
+// recordListResponseSSHFPJSON contains the JSON metadata for the struct
+// [RecordListResponseSSHFP]
+type recordListResponseSSHFPJSON struct {
+ Data apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ Content apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordListResponseSSHFP) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordListResponseSSHFPJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordListResponseSSHFP) implementsDNSRecordListResponse() {}
+
+// Components of a SSHFP record.
+type RecordListResponseSSHFPData struct {
+ // algorithm.
+ Algorithm float64 `json:"algorithm"`
+ // fingerprint.
+ Fingerprint string `json:"fingerprint"`
+ // type.
+ Type float64 `json:"type"`
+ JSON recordListResponseSSHFPDataJSON `json:"-"`
+}
+
+// recordListResponseSSHFPDataJSON contains the JSON metadata for the struct
+// [RecordListResponseSSHFPData]
+type recordListResponseSSHFPDataJSON struct {
+ Algorithm apijson.Field
+ Fingerprint apijson.Field
+ Type apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordListResponseSSHFPData) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordListResponseSSHFPDataJSON) RawJSON() string {
+ return r.raw
+}
+
+// Record type.
+type RecordListResponseSSHFPType string
+
+const (
+ RecordListResponseSSHFPTypeSSHFP RecordListResponseSSHFPType = "SSHFP"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordListResponseSSHFPMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordListResponseSSHFPMetaJSON `json:"-"`
+}
+
+// recordListResponseSSHFPMetaJSON contains the JSON metadata for the struct
+// [RecordListResponseSSHFPMeta]
+type recordListResponseSSHFPMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordListResponseSSHFPMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordListResponseSSHFPMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or
+// [dns.RecordListResponseSSHFPTTLNumber].
+type RecordListResponseSSHFPTTL interface {
+ ImplementsDNSRecordListResponseSshfpttl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordListResponseSSHFPTTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordListResponseSSHFPTTLNumber(0)),
+ },
+ )
+}
+
+type RecordListResponseSSHFPTTLNumber float64
+
+const (
+ RecordListResponseSSHFPTTLNumber1 RecordListResponseSSHFPTTLNumber = 1
+)
+
+type RecordListResponseSVCB struct {
+ // Components of a SVCB record.
+ Data RecordListResponseSVCBData `json:"data,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordListResponseSVCBType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // Formatted SVCB content. See 'data' to set SVCB properties.
+ Content string `json:"content"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordListResponseSVCBMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordListResponseSVCBTTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordListResponseSVCBJSON `json:"-"`
+}
+
+// recordListResponseSVCBJSON contains the JSON metadata for the struct
+// [RecordListResponseSVCB]
+type recordListResponseSVCBJSON struct {
+ Data apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ Content apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordListResponseSVCB) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordListResponseSVCBJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordListResponseSVCB) implementsDNSRecordListResponse() {}
+
+// Components of a SVCB record.
+type RecordListResponseSVCBData struct {
+ // priority.
+ Priority float64 `json:"priority"`
+ // target.
+ Target string `json:"target"`
+ // value.
+ Value string `json:"value"`
+ JSON recordListResponseSVCBDataJSON `json:"-"`
+}
+
+// recordListResponseSVCBDataJSON contains the JSON metadata for the struct
+// [RecordListResponseSVCBData]
+type recordListResponseSVCBDataJSON struct {
+ Priority apijson.Field
+ Target apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordListResponseSVCBData) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordListResponseSVCBDataJSON) RawJSON() string {
+ return r.raw
+}
+
+// Record type.
+type RecordListResponseSVCBType string
+
+const (
+ RecordListResponseSVCBTypeSVCB RecordListResponseSVCBType = "SVCB"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordListResponseSVCBMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordListResponseSVCBMetaJSON `json:"-"`
+}
+
+// recordListResponseSVCBMetaJSON contains the JSON metadata for the struct
+// [RecordListResponseSVCBMeta]
+type recordListResponseSVCBMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordListResponseSVCBMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordListResponseSVCBMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or [dns.RecordListResponseSVCBTTLNumber].
+type RecordListResponseSVCBTTL interface {
+ ImplementsDNSRecordListResponseSvcbttl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordListResponseSVCBTTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordListResponseSVCBTTLNumber(0)),
+ },
+ )
+}
+
+type RecordListResponseSVCBTTLNumber float64
+
+const (
+ RecordListResponseSVCBTTLNumber1 RecordListResponseSVCBTTLNumber = 1
+)
+
+type RecordListResponseTLSA struct {
+ // Components of a TLSA record.
+ Data RecordListResponseTLSAData `json:"data,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordListResponseTLSAType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // Formatted TLSA content. See 'data' to set TLSA properties.
+ Content string `json:"content"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordListResponseTLSAMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordListResponseTLSATTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordListResponseTLSAJSON `json:"-"`
+}
+
+// recordListResponseTLSAJSON contains the JSON metadata for the struct
+// [RecordListResponseTLSA]
+type recordListResponseTLSAJSON struct {
+ Data apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ Content apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordListResponseTLSA) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordListResponseTLSAJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordListResponseTLSA) implementsDNSRecordListResponse() {}
+
+// Components of a TLSA record.
+type RecordListResponseTLSAData struct {
+ // certificate.
+ Certificate string `json:"certificate"`
+ // Matching Type.
+ MatchingType float64 `json:"matching_type"`
+ // Selector.
+ Selector float64 `json:"selector"`
+ // Usage.
+ Usage float64 `json:"usage"`
+ JSON recordListResponseTLSADataJSON `json:"-"`
+}
+
+// recordListResponseTLSADataJSON contains the JSON metadata for the struct
+// [RecordListResponseTLSAData]
+type recordListResponseTLSADataJSON struct {
+ Certificate apijson.Field
+ MatchingType apijson.Field
+ Selector apijson.Field
+ Usage apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordListResponseTLSAData) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordListResponseTLSADataJSON) RawJSON() string {
+ return r.raw
+}
+
+// Record type.
+type RecordListResponseTLSAType string
+
+const (
+ RecordListResponseTLSATypeTLSA RecordListResponseTLSAType = "TLSA"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordListResponseTLSAMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordListResponseTLSAMetaJSON `json:"-"`
+}
+
+// recordListResponseTLSAMetaJSON contains the JSON metadata for the struct
+// [RecordListResponseTLSAMeta]
+type recordListResponseTLSAMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordListResponseTLSAMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordListResponseTLSAMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or [dns.RecordListResponseTLSATTLNumber].
+type RecordListResponseTLSATTL interface {
+ ImplementsDNSRecordListResponseTlsattl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordListResponseTLSATTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordListResponseTLSATTLNumber(0)),
+ },
+ )
+}
+
+type RecordListResponseTLSATTLNumber float64
+
+const (
+ RecordListResponseTLSATTLNumber1 RecordListResponseTLSATTLNumber = 1
+)
+
+type RecordListResponseTXT struct {
+ // Text content for the record.
+ Content string `json:"content,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordListResponseTXTType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordListResponseTXTMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordListResponseTXTTTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordListResponseTXTJSON `json:"-"`
+}
+
+// recordListResponseTXTJSON contains the JSON metadata for the struct
+// [RecordListResponseTXT]
+type recordListResponseTXTJSON struct {
+ Content apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordListResponseTXT) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordListResponseTXTJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordListResponseTXT) implementsDNSRecordListResponse() {}
+
+// Record type.
+type RecordListResponseTXTType string
+
+const (
+ RecordListResponseTXTTypeTXT RecordListResponseTXTType = "TXT"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordListResponseTXTMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordListResponseTXTMetaJSON `json:"-"`
+}
+
+// recordListResponseTXTMetaJSON contains the JSON metadata for the struct
+// [RecordListResponseTXTMeta]
+type recordListResponseTXTMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordListResponseTXTMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordListResponseTXTMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or [dns.RecordListResponseTXTTTLNumber].
+type RecordListResponseTXTTTL interface {
+ ImplementsDNSRecordListResponseTxtttl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordListResponseTXTTTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordListResponseTXTTTLNumber(0)),
+ },
+ )
+}
+
+type RecordListResponseTXTTTLNumber float64
+
+const (
+ RecordListResponseTXTTTLNumber1 RecordListResponseTXTTTLNumber = 1
+)
+
+type RecordListResponseURI struct {
+ // Components of a URI record.
+ Data RecordListResponseURIData `json:"data,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Required for MX, SRV and URI records; unused by other record types. Records with
+ // lower priorities are preferred.
+ Priority float64 `json:"priority,required"`
+ // Record type.
+ Type RecordListResponseURIType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // Formatted URI content. See 'data' to set URI properties.
+ Content string `json:"content"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordListResponseURIMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordListResponseURITTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordListResponseURIJSON `json:"-"`
+}
+
+// recordListResponseURIJSON contains the JSON metadata for the struct
+// [RecordListResponseURI]
+type recordListResponseURIJSON struct {
+ Data apijson.Field
+ Name apijson.Field
+ Priority apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ Content apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordListResponseURI) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordListResponseURIJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordListResponseURI) implementsDNSRecordListResponse() {}
+
+// Components of a URI record.
+type RecordListResponseURIData struct {
+ // The record content.
+ Content string `json:"content"`
+ // The record weight.
+ Weight float64 `json:"weight"`
+ JSON recordListResponseURIDataJSON `json:"-"`
+}
+
+// recordListResponseURIDataJSON contains the JSON metadata for the struct
+// [RecordListResponseURIData]
+type recordListResponseURIDataJSON struct {
+ Content apijson.Field
+ Weight apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordListResponseURIData) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordListResponseURIDataJSON) RawJSON() string {
+ return r.raw
+}
+
+// Record type.
+type RecordListResponseURIType string
+
+const (
+ RecordListResponseURITypeURI RecordListResponseURIType = "URI"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordListResponseURIMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordListResponseURIMetaJSON `json:"-"`
+}
+
+// recordListResponseURIMetaJSON contains the JSON metadata for the struct
+// [RecordListResponseURIMeta]
+type recordListResponseURIMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordListResponseURIMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordListResponseURIMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or [dns.RecordListResponseURITTLNumber].
+type RecordListResponseURITTL interface {
+ ImplementsDNSRecordListResponseUrittl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordListResponseURITTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordListResponseURITTLNumber(0)),
+ },
+ )
+}
+
+type RecordListResponseURITTLNumber float64
+
+const (
+ RecordListResponseURITTLNumber1 RecordListResponseURITTLNumber = 1
+)
+
+type RecordDeleteResponse struct {
+ // Identifier
+ ID string `json:"id"`
+ JSON recordDeleteResponseJSON `json:"-"`
+}
+
+// recordDeleteResponseJSON contains the JSON metadata for the struct
+// [RecordDeleteResponse]
+type recordDeleteResponseJSON struct {
+ ID apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordDeleteResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordDeleteResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+// Union satisfied by [dns.RecordEditResponseA], [dns.RecordEditResponseAAAA],
+// [dns.RecordEditResponseCAA], [dns.RecordEditResponseCert],
+// [dns.RecordEditResponseCNAME], [dns.RecordEditResponseDNSKEY],
+// [dns.RecordEditResponseDS], [dns.RecordEditResponseHTTPS],
+// [dns.RecordEditResponseLOC], [dns.RecordEditResponseMX],
+// [dns.RecordEditResponseNAPTR], [dns.RecordEditResponseNS],
+// [dns.RecordEditResponsePTR], [dns.RecordEditResponseSmimea],
+// [dns.RecordEditResponseSRV], [dns.RecordEditResponseSSHFP],
+// [dns.RecordEditResponseSVCB], [dns.RecordEditResponseTLSA],
+// [dns.RecordEditResponseTXT] or [dns.RecordEditResponseURI].
+type RecordEditResponse interface {
+ implementsDNSRecordEditResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordEditResponse)(nil)).Elem(),
+ "type",
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordEditResponseA{}),
+ DiscriminatorValue: "A",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordEditResponseAAAA{}),
+ DiscriminatorValue: "AAAA",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordEditResponseCAA{}),
+ DiscriminatorValue: "CAA",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordEditResponseCert{}),
+ DiscriminatorValue: "CERT",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordEditResponseCNAME{}),
+ DiscriminatorValue: "CNAME",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordEditResponseDNSKEY{}),
+ DiscriminatorValue: "DNSKEY",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordEditResponseDS{}),
+ DiscriminatorValue: "DS",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordEditResponseHTTPS{}),
+ DiscriminatorValue: "HTTPS",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordEditResponseLOC{}),
+ DiscriminatorValue: "LOC",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordEditResponseMX{}),
+ DiscriminatorValue: "MX",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordEditResponseNAPTR{}),
+ DiscriminatorValue: "NAPTR",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordEditResponseNS{}),
+ DiscriminatorValue: "NS",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordEditResponsePTR{}),
+ DiscriminatorValue: "PTR",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordEditResponseSmimea{}),
+ DiscriminatorValue: "SMIMEA",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordEditResponseSRV{}),
+ DiscriminatorValue: "SRV",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordEditResponseSSHFP{}),
+ DiscriminatorValue: "SSHFP",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordEditResponseSVCB{}),
+ DiscriminatorValue: "SVCB",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordEditResponseTLSA{}),
+ DiscriminatorValue: "TLSA",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordEditResponseTXT{}),
+ DiscriminatorValue: "TXT",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordEditResponseURI{}),
+ DiscriminatorValue: "URI",
+ },
+ )
+}
+
+type RecordEditResponseA struct {
+ // A valid IPv4 address.
+ Content string `json:"content,required" format:"ipv4"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordEditResponseAType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordEditResponseAMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Whether the record is receiving the performance and security benefits of
+ // Cloudflare.
+ Proxied bool `json:"proxied"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordEditResponseATTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordEditResponseAJSON `json:"-"`
+}
+
+// recordEditResponseAJSON contains the JSON metadata for the struct
+// [RecordEditResponseA]
+type recordEditResponseAJSON struct {
+ Content apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Proxied apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordEditResponseA) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordEditResponseAJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordEditResponseA) implementsDNSRecordEditResponse() {}
+
+// Record type.
+type RecordEditResponseAType string
+
+const (
+ RecordEditResponseATypeA RecordEditResponseAType = "A"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordEditResponseAMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordEditResponseAMetaJSON `json:"-"`
+}
+
+// recordEditResponseAMetaJSON contains the JSON metadata for the struct
+// [RecordEditResponseAMeta]
+type recordEditResponseAMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordEditResponseAMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordEditResponseAMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or [dns.RecordEditResponseATTLNumber].
+type RecordEditResponseATTL interface {
+ ImplementsDNSRecordEditResponseAttl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordEditResponseATTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordEditResponseATTLNumber(0)),
+ },
+ )
+}
+
+type RecordEditResponseATTLNumber float64
+
+const (
+ RecordEditResponseATTLNumber1 RecordEditResponseATTLNumber = 1
+)
+
+type RecordEditResponseAAAA struct {
+ // A valid IPv6 address.
+ Content string `json:"content,required" format:"ipv6"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordEditResponseAAAAType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordEditResponseAAAAMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Whether the record is receiving the performance and security benefits of
+ // Cloudflare.
+ Proxied bool `json:"proxied"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordEditResponseAAAATTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordEditResponseAAAAJSON `json:"-"`
+}
+
+// recordEditResponseAAAAJSON contains the JSON metadata for the struct
+// [RecordEditResponseAAAA]
+type recordEditResponseAAAAJSON struct {
+ Content apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Proxied apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordEditResponseAAAA) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordEditResponseAAAAJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordEditResponseAAAA) implementsDNSRecordEditResponse() {}
+
+// Record type.
+type RecordEditResponseAAAAType string
+
+const (
+ RecordEditResponseAAAATypeAAAA RecordEditResponseAAAAType = "AAAA"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordEditResponseAAAAMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordEditResponseAAAAMetaJSON `json:"-"`
+}
+
+// recordEditResponseAAAAMetaJSON contains the JSON metadata for the struct
+// [RecordEditResponseAAAAMeta]
+type recordEditResponseAAAAMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordEditResponseAAAAMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordEditResponseAAAAMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or [dns.RecordEditResponseAAAATTLNumber].
+type RecordEditResponseAAAATTL interface {
+ ImplementsDNSRecordEditResponseAaaattl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordEditResponseAAAATTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordEditResponseAAAATTLNumber(0)),
+ },
+ )
+}
+
+type RecordEditResponseAAAATTLNumber float64
+
+const (
+ RecordEditResponseAAAATTLNumber1 RecordEditResponseAAAATTLNumber = 1
+)
+
+type RecordEditResponseCAA struct {
+ // Components of a CAA record.
+ Data RecordEditResponseCAAData `json:"data,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordEditResponseCAAType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // Formatted CAA content. See 'data' to set CAA properties.
+ Content string `json:"content"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordEditResponseCAAMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordEditResponseCAATTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordEditResponseCAAJSON `json:"-"`
+}
+
+// recordEditResponseCAAJSON contains the JSON metadata for the struct
+// [RecordEditResponseCAA]
+type recordEditResponseCAAJSON struct {
+ Data apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ Content apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordEditResponseCAA) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordEditResponseCAAJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordEditResponseCAA) implementsDNSRecordEditResponse() {}
+
+// Components of a CAA record.
+type RecordEditResponseCAAData struct {
+ // Flags for the CAA record.
+ Flags float64 `json:"flags"`
+ // Name of the property controlled by this record (e.g.: issue, issuewild, iodef).
+ Tag string `json:"tag"`
+ // Value of the record. This field's semantics depend on the chosen tag.
+ Value string `json:"value"`
+ JSON recordEditResponseCAADataJSON `json:"-"`
+}
+
+// recordEditResponseCAADataJSON contains the JSON metadata for the struct
+// [RecordEditResponseCAAData]
+type recordEditResponseCAADataJSON struct {
+ Flags apijson.Field
+ Tag apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordEditResponseCAAData) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordEditResponseCAADataJSON) RawJSON() string {
+ return r.raw
+}
+
+// Record type.
+type RecordEditResponseCAAType string
+
+const (
+ RecordEditResponseCAATypeCAA RecordEditResponseCAAType = "CAA"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordEditResponseCAAMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordEditResponseCAAMetaJSON `json:"-"`
+}
+
+// recordEditResponseCAAMetaJSON contains the JSON metadata for the struct
+// [RecordEditResponseCAAMeta]
+type recordEditResponseCAAMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordEditResponseCAAMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordEditResponseCAAMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or [dns.RecordEditResponseCAATTLNumber].
+type RecordEditResponseCAATTL interface {
+ ImplementsDNSRecordEditResponseCaattl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordEditResponseCAATTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordEditResponseCAATTLNumber(0)),
+ },
+ )
+}
+
+type RecordEditResponseCAATTLNumber float64
+
+const (
+ RecordEditResponseCAATTLNumber1 RecordEditResponseCAATTLNumber = 1
+)
+
+type RecordEditResponseCert struct {
+ // Components of a CERT record.
+ Data RecordEditResponseCertData `json:"data,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordEditResponseCertType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // Formatted CERT content. See 'data' to set CERT properties.
+ Content string `json:"content"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordEditResponseCertMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordEditResponseCertTTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordEditResponseCertJSON `json:"-"`
+}
+
+// recordEditResponseCertJSON contains the JSON metadata for the struct
+// [RecordEditResponseCert]
+type recordEditResponseCertJSON struct {
+ Data apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ Content apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordEditResponseCert) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordEditResponseCertJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordEditResponseCert) implementsDNSRecordEditResponse() {}
+
+// Components of a CERT record.
+type RecordEditResponseCertData struct {
+ // Algorithm.
+ Algorithm float64 `json:"algorithm"`
+ // Certificate.
+ Certificate string `json:"certificate"`
+ // Key Tag.
+ KeyTag float64 `json:"key_tag"`
+ // Type.
+ Type float64 `json:"type"`
+ JSON recordEditResponseCertDataJSON `json:"-"`
+}
+
+// recordEditResponseCertDataJSON contains the JSON metadata for the struct
+// [RecordEditResponseCertData]
+type recordEditResponseCertDataJSON struct {
+ Algorithm apijson.Field
+ Certificate apijson.Field
+ KeyTag apijson.Field
+ Type apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordEditResponseCertData) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordEditResponseCertDataJSON) RawJSON() string {
+ return r.raw
+}
+
+// Record type.
+type RecordEditResponseCertType string
+
+const (
+ RecordEditResponseCertTypeCert RecordEditResponseCertType = "CERT"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordEditResponseCertMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordEditResponseCertMetaJSON `json:"-"`
+}
+
+// recordEditResponseCertMetaJSON contains the JSON metadata for the struct
+// [RecordEditResponseCertMeta]
+type recordEditResponseCertMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordEditResponseCertMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordEditResponseCertMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or [dns.RecordEditResponseCertTTLNumber].
+type RecordEditResponseCertTTL interface {
+ ImplementsDNSRecordEditResponseCertTTL()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordEditResponseCertTTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordEditResponseCertTTLNumber(0)),
+ },
+ )
+}
+
+type RecordEditResponseCertTTLNumber float64
+
+const (
+ RecordEditResponseCertTTLNumber1 RecordEditResponseCertTTLNumber = 1
+)
+
+type RecordEditResponseCNAME struct {
+ // A valid hostname. Must not match the record's name.
+ Content interface{} `json:"content,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordEditResponseCNAMEType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordEditResponseCNAMEMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Whether the record is receiving the performance and security benefits of
+ // Cloudflare.
+ Proxied bool `json:"proxied"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordEditResponseCNAMETTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordEditResponseCNAMEJSON `json:"-"`
+}
+
+// recordEditResponseCNAMEJSON contains the JSON metadata for the struct
+// [RecordEditResponseCNAME]
+type recordEditResponseCNAMEJSON struct {
+ Content apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Proxied apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordEditResponseCNAME) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordEditResponseCNAMEJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordEditResponseCNAME) implementsDNSRecordEditResponse() {}
+
+// Record type.
+type RecordEditResponseCNAMEType string
+
+const (
+ RecordEditResponseCNAMETypeCNAME RecordEditResponseCNAMEType = "CNAME"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordEditResponseCNAMEMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordEditResponseCNAMEMetaJSON `json:"-"`
+}
+
+// recordEditResponseCNAMEMetaJSON contains the JSON metadata for the struct
+// [RecordEditResponseCNAMEMeta]
+type recordEditResponseCNAMEMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordEditResponseCNAMEMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordEditResponseCNAMEMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or
+// [dns.RecordEditResponseCNAMETTLNumber].
+type RecordEditResponseCNAMETTL interface {
+ ImplementsDNSRecordEditResponseCnamettl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordEditResponseCNAMETTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordEditResponseCNAMETTLNumber(0)),
+ },
+ )
+}
+
+type RecordEditResponseCNAMETTLNumber float64
+
+const (
+ RecordEditResponseCNAMETTLNumber1 RecordEditResponseCNAMETTLNumber = 1
+)
+
+type RecordEditResponseDNSKEY struct {
+ // Components of a DNSKEY record.
+ Data RecordEditResponseDNSKEYData `json:"data,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordEditResponseDNSKEYType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // Formatted DNSKEY content. See 'data' to set DNSKEY properties.
+ Content string `json:"content"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordEditResponseDNSKEYMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordEditResponseDNSKEYTTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordEditResponseDNSKEYJSON `json:"-"`
+}
+
+// recordEditResponseDNSKEYJSON contains the JSON metadata for the struct
+// [RecordEditResponseDNSKEY]
+type recordEditResponseDNSKEYJSON struct {
+ Data apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ Content apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordEditResponseDNSKEY) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordEditResponseDNSKEYJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordEditResponseDNSKEY) implementsDNSRecordEditResponse() {}
+
+// Components of a DNSKEY record.
+type RecordEditResponseDNSKEYData struct {
+ // Algorithm.
+ Algorithm float64 `json:"algorithm"`
+ // Flags.
+ Flags float64 `json:"flags"`
+ // Protocol.
+ Protocol float64 `json:"protocol"`
+ // Public Key.
+ PublicKey string `json:"public_key"`
+ JSON recordEditResponseDNSKEYDataJSON `json:"-"`
+}
+
+// recordEditResponseDNSKEYDataJSON contains the JSON metadata for the struct
+// [RecordEditResponseDNSKEYData]
+type recordEditResponseDNSKEYDataJSON struct {
+ Algorithm apijson.Field
+ Flags apijson.Field
+ Protocol apijson.Field
+ PublicKey apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordEditResponseDNSKEYData) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordEditResponseDNSKEYDataJSON) RawJSON() string {
+ return r.raw
+}
+
+// Record type.
+type RecordEditResponseDNSKEYType string
+
+const (
+ RecordEditResponseDNSKEYTypeDNSKEY RecordEditResponseDNSKEYType = "DNSKEY"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordEditResponseDNSKEYMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordEditResponseDNSKEYMetaJSON `json:"-"`
+}
+
+// recordEditResponseDNSKEYMetaJSON contains the JSON metadata for the struct
+// [RecordEditResponseDNSKEYMeta]
+type recordEditResponseDNSKEYMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordEditResponseDNSKEYMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordEditResponseDNSKEYMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or
+// [dns.RecordEditResponseDNSKEYTTLNumber].
+type RecordEditResponseDNSKEYTTL interface {
+ ImplementsDNSRecordEditResponseDnskeyttl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordEditResponseDNSKEYTTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordEditResponseDNSKEYTTLNumber(0)),
+ },
+ )
+}
+
+type RecordEditResponseDNSKEYTTLNumber float64
+
+const (
+ RecordEditResponseDNSKEYTTLNumber1 RecordEditResponseDNSKEYTTLNumber = 1
+)
+
+type RecordEditResponseDS struct {
+ // Components of a DS record.
+ Data RecordEditResponseDSData `json:"data,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordEditResponseDSType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // Formatted DS content. See 'data' to set DS properties.
+ Content string `json:"content"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordEditResponseDSMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordEditResponseDSTTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordEditResponseDSJSON `json:"-"`
+}
+
+// recordEditResponseDSJSON contains the JSON metadata for the struct
+// [RecordEditResponseDS]
+type recordEditResponseDSJSON struct {
+ Data apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ Content apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordEditResponseDS) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordEditResponseDSJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordEditResponseDS) implementsDNSRecordEditResponse() {}
+
+// Components of a DS record.
+type RecordEditResponseDSData struct {
+ // Algorithm.
+ Algorithm float64 `json:"algorithm"`
+ // Digest.
+ Digest string `json:"digest"`
+ // Digest Type.
+ DigestType float64 `json:"digest_type"`
+ // Key Tag.
+ KeyTag float64 `json:"key_tag"`
+ JSON recordEditResponseDSDataJSON `json:"-"`
+}
+
+// recordEditResponseDSDataJSON contains the JSON metadata for the struct
+// [RecordEditResponseDSData]
+type recordEditResponseDSDataJSON struct {
+ Algorithm apijson.Field
+ Digest apijson.Field
+ DigestType apijson.Field
+ KeyTag apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordEditResponseDSData) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordEditResponseDSDataJSON) RawJSON() string {
+ return r.raw
+}
+
+// Record type.
+type RecordEditResponseDSType string
+
+const (
+ RecordEditResponseDSTypeDS RecordEditResponseDSType = "DS"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordEditResponseDSMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordEditResponseDSMetaJSON `json:"-"`
+}
+
+// recordEditResponseDSMetaJSON contains the JSON metadata for the struct
+// [RecordEditResponseDSMeta]
+type recordEditResponseDSMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordEditResponseDSMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordEditResponseDSMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or [dns.RecordEditResponseDSTTLNumber].
+type RecordEditResponseDSTTL interface {
+ ImplementsDNSRecordEditResponseDsttl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordEditResponseDSTTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordEditResponseDSTTLNumber(0)),
+ },
+ )
+}
+
+type RecordEditResponseDSTTLNumber float64
+
+const (
+ RecordEditResponseDSTTLNumber1 RecordEditResponseDSTTLNumber = 1
+)
+
+type RecordEditResponseHTTPS struct {
+ // Components of a HTTPS record.
+ Data RecordEditResponseHTTPSData `json:"data,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordEditResponseHTTPSType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // Formatted HTTPS content. See 'data' to set HTTPS properties.
+ Content string `json:"content"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordEditResponseHTTPSMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordEditResponseHTTPSTTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordEditResponseHTTPSJSON `json:"-"`
+}
+
+// recordEditResponseHTTPSJSON contains the JSON metadata for the struct
+// [RecordEditResponseHTTPS]
+type recordEditResponseHTTPSJSON struct {
+ Data apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ Content apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordEditResponseHTTPS) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordEditResponseHTTPSJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordEditResponseHTTPS) implementsDNSRecordEditResponse() {}
+
+// Components of a HTTPS record.
+type RecordEditResponseHTTPSData struct {
+ // priority.
+ Priority float64 `json:"priority"`
+ // target.
+ Target string `json:"target"`
+ // value.
+ Value string `json:"value"`
+ JSON recordEditResponseHTTPSDataJSON `json:"-"`
+}
+
+// recordEditResponseHTTPSDataJSON contains the JSON metadata for the struct
+// [RecordEditResponseHTTPSData]
+type recordEditResponseHTTPSDataJSON struct {
+ Priority apijson.Field
+ Target apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordEditResponseHTTPSData) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordEditResponseHTTPSDataJSON) RawJSON() string {
+ return r.raw
+}
+
+// Record type.
+type RecordEditResponseHTTPSType string
+
+const (
+ RecordEditResponseHTTPSTypeHTTPS RecordEditResponseHTTPSType = "HTTPS"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordEditResponseHTTPSMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordEditResponseHTTPSMetaJSON `json:"-"`
+}
+
+// recordEditResponseHTTPSMetaJSON contains the JSON metadata for the struct
+// [RecordEditResponseHTTPSMeta]
+type recordEditResponseHTTPSMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordEditResponseHTTPSMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordEditResponseHTTPSMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or
+// [dns.RecordEditResponseHTTPSTTLNumber].
+type RecordEditResponseHTTPSTTL interface {
+ ImplementsDNSRecordEditResponseHttpsttl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordEditResponseHTTPSTTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordEditResponseHTTPSTTLNumber(0)),
+ },
+ )
+}
+
+type RecordEditResponseHTTPSTTLNumber float64
+
+const (
+ RecordEditResponseHTTPSTTLNumber1 RecordEditResponseHTTPSTTLNumber = 1
+)
+
+type RecordEditResponseLOC struct {
+ // Components of a LOC record.
+ Data RecordEditResponseLOCData `json:"data,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordEditResponseLOCType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // Formatted LOC content. See 'data' to set LOC properties.
+ Content string `json:"content"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordEditResponseLOCMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordEditResponseLOCTTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordEditResponseLOCJSON `json:"-"`
+}
+
+// recordEditResponseLOCJSON contains the JSON metadata for the struct
+// [RecordEditResponseLOC]
+type recordEditResponseLOCJSON struct {
+ Data apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ Content apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordEditResponseLOC) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordEditResponseLOCJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordEditResponseLOC) implementsDNSRecordEditResponse() {}
+
+// Components of a LOC record.
+type RecordEditResponseLOCData struct {
+ // Altitude of location in meters.
+ Altitude float64 `json:"altitude"`
+ // Degrees of latitude.
+ LatDegrees float64 `json:"lat_degrees"`
+ // Latitude direction.
+ LatDirection RecordEditResponseLOCDataLatDirection `json:"lat_direction"`
+ // Minutes of latitude.
+ LatMinutes float64 `json:"lat_minutes"`
+ // Seconds of latitude.
+ LatSeconds float64 `json:"lat_seconds"`
+ // Degrees of longitude.
+ LongDegrees float64 `json:"long_degrees"`
+ // Longitude direction.
+ LongDirection RecordEditResponseLOCDataLongDirection `json:"long_direction"`
+ // Minutes of longitude.
+ LongMinutes float64 `json:"long_minutes"`
+ // Seconds of longitude.
+ LongSeconds float64 `json:"long_seconds"`
+ // Horizontal precision of location.
+ PrecisionHorz float64 `json:"precision_horz"`
+ // Vertical precision of location.
+ PrecisionVert float64 `json:"precision_vert"`
+ // Size of location in meters.
+ Size float64 `json:"size"`
+ JSON recordEditResponseLOCDataJSON `json:"-"`
+}
+
+// recordEditResponseLOCDataJSON contains the JSON metadata for the struct
+// [RecordEditResponseLOCData]
+type recordEditResponseLOCDataJSON struct {
+ Altitude apijson.Field
+ LatDegrees apijson.Field
+ LatDirection apijson.Field
+ LatMinutes apijson.Field
+ LatSeconds apijson.Field
+ LongDegrees apijson.Field
+ LongDirection apijson.Field
+ LongMinutes apijson.Field
+ LongSeconds apijson.Field
+ PrecisionHorz apijson.Field
+ PrecisionVert apijson.Field
+ Size apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordEditResponseLOCData) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordEditResponseLOCDataJSON) RawJSON() string {
+ return r.raw
+}
+
+// Latitude direction.
+type RecordEditResponseLOCDataLatDirection string
+
+const (
+ RecordEditResponseLOCDataLatDirectionN RecordEditResponseLOCDataLatDirection = "N"
+ RecordEditResponseLOCDataLatDirectionS RecordEditResponseLOCDataLatDirection = "S"
+)
+
+// Longitude direction.
+type RecordEditResponseLOCDataLongDirection string
+
+const (
+ RecordEditResponseLOCDataLongDirectionE RecordEditResponseLOCDataLongDirection = "E"
+ RecordEditResponseLOCDataLongDirectionW RecordEditResponseLOCDataLongDirection = "W"
+)
+
+// Record type.
+type RecordEditResponseLOCType string
+
+const (
+ RecordEditResponseLOCTypeLOC RecordEditResponseLOCType = "LOC"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordEditResponseLOCMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordEditResponseLOCMetaJSON `json:"-"`
+}
+
+// recordEditResponseLOCMetaJSON contains the JSON metadata for the struct
+// [RecordEditResponseLOCMeta]
+type recordEditResponseLOCMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordEditResponseLOCMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordEditResponseLOCMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or [dns.RecordEditResponseLOCTTLNumber].
+type RecordEditResponseLOCTTL interface {
+ ImplementsDNSRecordEditResponseLocttl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordEditResponseLOCTTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordEditResponseLOCTTLNumber(0)),
+ },
+ )
+}
+
+type RecordEditResponseLOCTTLNumber float64
+
+const (
+ RecordEditResponseLOCTTLNumber1 RecordEditResponseLOCTTLNumber = 1
+)
+
+type RecordEditResponseMX struct {
+ // A valid mail server hostname.
+ Content string `json:"content,required" format:"hostname"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Required for MX, SRV and URI records; unused by other record types. Records with
+ // lower priorities are preferred.
+ Priority float64 `json:"priority,required"`
+ // Record type.
+ Type RecordEditResponseMXType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordEditResponseMXMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordEditResponseMXTTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordEditResponseMXJSON `json:"-"`
+}
+
+// recordEditResponseMXJSON contains the JSON metadata for the struct
+// [RecordEditResponseMX]
+type recordEditResponseMXJSON struct {
+ Content apijson.Field
+ Name apijson.Field
+ Priority apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordEditResponseMX) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordEditResponseMXJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordEditResponseMX) implementsDNSRecordEditResponse() {}
+
+// Record type.
+type RecordEditResponseMXType string
+
+const (
+ RecordEditResponseMXTypeMX RecordEditResponseMXType = "MX"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordEditResponseMXMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordEditResponseMXMetaJSON `json:"-"`
+}
+
+// recordEditResponseMXMetaJSON contains the JSON metadata for the struct
+// [RecordEditResponseMXMeta]
+type recordEditResponseMXMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordEditResponseMXMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordEditResponseMXMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or [dns.RecordEditResponseMXTTLNumber].
+type RecordEditResponseMXTTL interface {
+ ImplementsDNSRecordEditResponseMxttl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordEditResponseMXTTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordEditResponseMXTTLNumber(0)),
+ },
+ )
+}
+
+type RecordEditResponseMXTTLNumber float64
+
+const (
+ RecordEditResponseMXTTLNumber1 RecordEditResponseMXTTLNumber = 1
+)
+
+type RecordEditResponseNAPTR struct {
+ // Components of a NAPTR record.
+ Data RecordEditResponseNAPTRData `json:"data,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordEditResponseNAPTRType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // Formatted NAPTR content. See 'data' to set NAPTR properties.
+ Content string `json:"content"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordEditResponseNAPTRMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordEditResponseNAPTRTTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordEditResponseNAPTRJSON `json:"-"`
+}
+
+// recordEditResponseNAPTRJSON contains the JSON metadata for the struct
+// [RecordEditResponseNAPTR]
+type recordEditResponseNAPTRJSON struct {
+ Data apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ Content apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordEditResponseNAPTR) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordEditResponseNAPTRJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordEditResponseNAPTR) implementsDNSRecordEditResponse() {}
+
+// Components of a NAPTR record.
+type RecordEditResponseNAPTRData struct {
+ // Flags.
+ Flags string `json:"flags"`
+ // Order.
+ Order float64 `json:"order"`
+ // Preference.
+ Preference float64 `json:"preference"`
+ // Regex.
+ Regex string `json:"regex"`
+ // Replacement.
+ Replacement string `json:"replacement"`
+ // Service.
+ Service string `json:"service"`
+ JSON recordEditResponseNAPTRDataJSON `json:"-"`
+}
+
+// recordEditResponseNAPTRDataJSON contains the JSON metadata for the struct
+// [RecordEditResponseNAPTRData]
+type recordEditResponseNAPTRDataJSON struct {
+ Flags apijson.Field
+ Order apijson.Field
+ Preference apijson.Field
+ Regex apijson.Field
+ Replacement apijson.Field
+ Service apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordEditResponseNAPTRData) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordEditResponseNAPTRDataJSON) RawJSON() string {
+ return r.raw
+}
+
+// Record type.
+type RecordEditResponseNAPTRType string
+
+const (
+ RecordEditResponseNAPTRTypeNAPTR RecordEditResponseNAPTRType = "NAPTR"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordEditResponseNAPTRMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordEditResponseNAPTRMetaJSON `json:"-"`
+}
+
+// recordEditResponseNAPTRMetaJSON contains the JSON metadata for the struct
+// [RecordEditResponseNAPTRMeta]
+type recordEditResponseNAPTRMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordEditResponseNAPTRMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordEditResponseNAPTRMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or
+// [dns.RecordEditResponseNAPTRTTLNumber].
+type RecordEditResponseNAPTRTTL interface {
+ ImplementsDNSRecordEditResponseNaptrttl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordEditResponseNAPTRTTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordEditResponseNAPTRTTLNumber(0)),
+ },
+ )
+}
+
+type RecordEditResponseNAPTRTTLNumber float64
+
+const (
+ RecordEditResponseNAPTRTTLNumber1 RecordEditResponseNAPTRTTLNumber = 1
+)
+
+type RecordEditResponseNS struct {
+ // A valid name server host name.
+ Content interface{} `json:"content,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordEditResponseNSType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordEditResponseNSMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordEditResponseNSTTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordEditResponseNSJSON `json:"-"`
+}
+
+// recordEditResponseNSJSON contains the JSON metadata for the struct
+// [RecordEditResponseNS]
+type recordEditResponseNSJSON struct {
+ Content apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordEditResponseNS) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordEditResponseNSJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordEditResponseNS) implementsDNSRecordEditResponse() {}
+
+// Record type.
+type RecordEditResponseNSType string
+
+const (
+ RecordEditResponseNSTypeNS RecordEditResponseNSType = "NS"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordEditResponseNSMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordEditResponseNSMetaJSON `json:"-"`
+}
+
+// recordEditResponseNSMetaJSON contains the JSON metadata for the struct
+// [RecordEditResponseNSMeta]
+type recordEditResponseNSMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordEditResponseNSMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordEditResponseNSMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or [dns.RecordEditResponseNSTTLNumber].
+type RecordEditResponseNSTTL interface {
+ ImplementsDNSRecordEditResponseNsttl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordEditResponseNSTTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordEditResponseNSTTLNumber(0)),
+ },
+ )
+}
+
+type RecordEditResponseNSTTLNumber float64
+
+const (
+ RecordEditResponseNSTTLNumber1 RecordEditResponseNSTTLNumber = 1
+)
+
+type RecordEditResponsePTR struct {
+ // Domain name pointing to the address.
+ Content string `json:"content,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordEditResponsePTRType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordEditResponsePTRMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordEditResponsePTRTTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordEditResponsePTRJSON `json:"-"`
+}
+
+// recordEditResponsePTRJSON contains the JSON metadata for the struct
+// [RecordEditResponsePTR]
+type recordEditResponsePTRJSON struct {
+ Content apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordEditResponsePTR) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordEditResponsePTRJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordEditResponsePTR) implementsDNSRecordEditResponse() {}
+
+// Record type.
+type RecordEditResponsePTRType string
+
+const (
+ RecordEditResponsePTRTypePTR RecordEditResponsePTRType = "PTR"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordEditResponsePTRMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordEditResponsePTRMetaJSON `json:"-"`
+}
+
+// recordEditResponsePTRMetaJSON contains the JSON metadata for the struct
+// [RecordEditResponsePTRMeta]
+type recordEditResponsePTRMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordEditResponsePTRMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordEditResponsePTRMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or [dns.RecordEditResponsePTRTTLNumber].
+type RecordEditResponsePTRTTL interface {
+ ImplementsDNSRecordEditResponsePtrttl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordEditResponsePTRTTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordEditResponsePTRTTLNumber(0)),
+ },
+ )
+}
+
+type RecordEditResponsePTRTTLNumber float64
+
+const (
+ RecordEditResponsePTRTTLNumber1 RecordEditResponsePTRTTLNumber = 1
+)
+
+type RecordEditResponseSmimea struct {
+ // Components of a SMIMEA record.
+ Data RecordEditResponseSmimeaData `json:"data,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordEditResponseSmimeaType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // Formatted SMIMEA content. See 'data' to set SMIMEA properties.
+ Content string `json:"content"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordEditResponseSmimeaMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordEditResponseSmimeaTTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordEditResponseSmimeaJSON `json:"-"`
+}
+
+// recordEditResponseSmimeaJSON contains the JSON metadata for the struct
+// [RecordEditResponseSmimea]
+type recordEditResponseSmimeaJSON struct {
+ Data apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ Content apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordEditResponseSmimea) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordEditResponseSmimeaJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordEditResponseSmimea) implementsDNSRecordEditResponse() {}
+
+// Components of a SMIMEA record.
+type RecordEditResponseSmimeaData struct {
+ // Certificate.
+ Certificate string `json:"certificate"`
+ // Matching Type.
+ MatchingType float64 `json:"matching_type"`
+ // Selector.
+ Selector float64 `json:"selector"`
+ // Usage.
+ Usage float64 `json:"usage"`
+ JSON recordEditResponseSmimeaDataJSON `json:"-"`
+}
+
+// recordEditResponseSmimeaDataJSON contains the JSON metadata for the struct
+// [RecordEditResponseSmimeaData]
+type recordEditResponseSmimeaDataJSON struct {
+ Certificate apijson.Field
+ MatchingType apijson.Field
+ Selector apijson.Field
+ Usage apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordEditResponseSmimeaData) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordEditResponseSmimeaDataJSON) RawJSON() string {
+ return r.raw
+}
+
+// Record type.
+type RecordEditResponseSmimeaType string
+
+const (
+ RecordEditResponseSmimeaTypeSmimea RecordEditResponseSmimeaType = "SMIMEA"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordEditResponseSmimeaMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordEditResponseSmimeaMetaJSON `json:"-"`
+}
+
+// recordEditResponseSmimeaMetaJSON contains the JSON metadata for the struct
+// [RecordEditResponseSmimeaMeta]
+type recordEditResponseSmimeaMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordEditResponseSmimeaMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordEditResponseSmimeaMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or
+// [dns.RecordEditResponseSmimeaTTLNumber].
+type RecordEditResponseSmimeaTTL interface {
+ ImplementsDNSRecordEditResponseSmimeaTTL()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordEditResponseSmimeaTTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordEditResponseSmimeaTTLNumber(0)),
+ },
+ )
+}
+
+type RecordEditResponseSmimeaTTLNumber float64
+
+const (
+ RecordEditResponseSmimeaTTLNumber1 RecordEditResponseSmimeaTTLNumber = 1
+)
+
+type RecordEditResponseSRV struct {
+ // Components of a SRV record.
+ Data RecordEditResponseSRVData `json:"data,required"`
+ // DNS record name (or @ for the zone apex) in Punycode. For SRV records, the first
+ // label is normally a service and the second a protocol name, each starting with
+ // an underscore.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordEditResponseSRVType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // Priority, weight, port, and SRV target. See 'data' for setting the individual
+ // component values.
+ Content string `json:"content"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordEditResponseSRVMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordEditResponseSRVTTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordEditResponseSRVJSON `json:"-"`
+}
+
+// recordEditResponseSRVJSON contains the JSON metadata for the struct
+// [RecordEditResponseSRV]
+type recordEditResponseSRVJSON struct {
+ Data apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ Content apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordEditResponseSRV) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordEditResponseSRVJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordEditResponseSRV) implementsDNSRecordEditResponse() {}
+
+// Components of a SRV record.
+type RecordEditResponseSRVData struct {
+ // A valid hostname. Deprecated in favor of the regular 'name' outside the data
+ // map. This data map field represents the remainder of the full 'name' after the
+ // service and protocol.
+ Name string `json:"name" format:"hostname"`
+ // The port of the service.
+ Port float64 `json:"port"`
+ // Required for MX, SRV and URI records; unused by other record types. Records with
+ // lower priorities are preferred.
+ Priority float64 `json:"priority"`
+ // A valid protocol, prefixed with an underscore. Deprecated in favor of the
+ // regular 'name' outside the data map. This data map field normally represents the
+ // second label of that 'name'.
+ Proto string `json:"proto"`
+ // A service type, prefixed with an underscore. Deprecated in favor of the regular
+ // 'name' outside the data map. This data map field normally represents the first
+ // label of that 'name'.
+ Service string `json:"service"`
+ // A valid hostname.
+ Target string `json:"target" format:"hostname"`
+ // The record weight.
+ Weight float64 `json:"weight"`
+ JSON recordEditResponseSRVDataJSON `json:"-"`
+}
+
+// recordEditResponseSRVDataJSON contains the JSON metadata for the struct
+// [RecordEditResponseSRVData]
+type recordEditResponseSRVDataJSON struct {
+ Name apijson.Field
+ Port apijson.Field
+ Priority apijson.Field
+ Proto apijson.Field
+ Service apijson.Field
+ Target apijson.Field
+ Weight apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordEditResponseSRVData) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordEditResponseSRVDataJSON) RawJSON() string {
+ return r.raw
+}
+
+// Record type.
+type RecordEditResponseSRVType string
+
+const (
+ RecordEditResponseSRVTypeSRV RecordEditResponseSRVType = "SRV"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordEditResponseSRVMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordEditResponseSRVMetaJSON `json:"-"`
+}
+
+// recordEditResponseSRVMetaJSON contains the JSON metadata for the struct
+// [RecordEditResponseSRVMeta]
+type recordEditResponseSRVMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordEditResponseSRVMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordEditResponseSRVMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or [dns.RecordEditResponseSRVTTLNumber].
+type RecordEditResponseSRVTTL interface {
+ ImplementsDNSRecordEditResponseSrvttl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordEditResponseSRVTTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordEditResponseSRVTTLNumber(0)),
+ },
+ )
+}
+
+type RecordEditResponseSRVTTLNumber float64
+
+const (
+ RecordEditResponseSRVTTLNumber1 RecordEditResponseSRVTTLNumber = 1
+)
+
+type RecordEditResponseSSHFP struct {
+ // Components of a SSHFP record.
+ Data RecordEditResponseSSHFPData `json:"data,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordEditResponseSSHFPType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // Formatted SSHFP content. See 'data' to set SSHFP properties.
+ Content string `json:"content"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordEditResponseSSHFPMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordEditResponseSSHFPTTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordEditResponseSSHFPJSON `json:"-"`
+}
+
+// recordEditResponseSSHFPJSON contains the JSON metadata for the struct
+// [RecordEditResponseSSHFP]
+type recordEditResponseSSHFPJSON struct {
+ Data apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ Content apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordEditResponseSSHFP) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordEditResponseSSHFPJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordEditResponseSSHFP) implementsDNSRecordEditResponse() {}
+
+// Components of a SSHFP record.
+type RecordEditResponseSSHFPData struct {
+ // algorithm.
+ Algorithm float64 `json:"algorithm"`
+ // fingerprint.
+ Fingerprint string `json:"fingerprint"`
+ // type.
+ Type float64 `json:"type"`
+ JSON recordEditResponseSSHFPDataJSON `json:"-"`
+}
+
+// recordEditResponseSSHFPDataJSON contains the JSON metadata for the struct
+// [RecordEditResponseSSHFPData]
+type recordEditResponseSSHFPDataJSON struct {
+ Algorithm apijson.Field
+ Fingerprint apijson.Field
+ Type apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordEditResponseSSHFPData) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordEditResponseSSHFPDataJSON) RawJSON() string {
+ return r.raw
+}
+
+// Record type.
+type RecordEditResponseSSHFPType string
+
+const (
+ RecordEditResponseSSHFPTypeSSHFP RecordEditResponseSSHFPType = "SSHFP"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordEditResponseSSHFPMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordEditResponseSSHFPMetaJSON `json:"-"`
+}
+
+// recordEditResponseSSHFPMetaJSON contains the JSON metadata for the struct
+// [RecordEditResponseSSHFPMeta]
+type recordEditResponseSSHFPMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordEditResponseSSHFPMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordEditResponseSSHFPMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or
+// [dns.RecordEditResponseSSHFPTTLNumber].
+type RecordEditResponseSSHFPTTL interface {
+ ImplementsDNSRecordEditResponseSshfpttl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordEditResponseSSHFPTTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordEditResponseSSHFPTTLNumber(0)),
+ },
+ )
+}
+
+type RecordEditResponseSSHFPTTLNumber float64
+
+const (
+ RecordEditResponseSSHFPTTLNumber1 RecordEditResponseSSHFPTTLNumber = 1
+)
+
+type RecordEditResponseSVCB struct {
+ // Components of a SVCB record.
+ Data RecordEditResponseSVCBData `json:"data,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordEditResponseSVCBType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // Formatted SVCB content. See 'data' to set SVCB properties.
+ Content string `json:"content"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordEditResponseSVCBMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordEditResponseSVCBTTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordEditResponseSVCBJSON `json:"-"`
+}
+
+// recordEditResponseSVCBJSON contains the JSON metadata for the struct
+// [RecordEditResponseSVCB]
+type recordEditResponseSVCBJSON struct {
+ Data apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ Content apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordEditResponseSVCB) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordEditResponseSVCBJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordEditResponseSVCB) implementsDNSRecordEditResponse() {}
+
+// Components of a SVCB record.
+type RecordEditResponseSVCBData struct {
+ // priority.
+ Priority float64 `json:"priority"`
+ // target.
+ Target string `json:"target"`
+ // value.
+ Value string `json:"value"`
+ JSON recordEditResponseSVCBDataJSON `json:"-"`
+}
+
+// recordEditResponseSVCBDataJSON contains the JSON metadata for the struct
+// [RecordEditResponseSVCBData]
+type recordEditResponseSVCBDataJSON struct {
+ Priority apijson.Field
+ Target apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordEditResponseSVCBData) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordEditResponseSVCBDataJSON) RawJSON() string {
+ return r.raw
+}
+
+// Record type.
+type RecordEditResponseSVCBType string
+
+const (
+ RecordEditResponseSVCBTypeSVCB RecordEditResponseSVCBType = "SVCB"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordEditResponseSVCBMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordEditResponseSVCBMetaJSON `json:"-"`
+}
+
+// recordEditResponseSVCBMetaJSON contains the JSON metadata for the struct
+// [RecordEditResponseSVCBMeta]
+type recordEditResponseSVCBMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordEditResponseSVCBMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordEditResponseSVCBMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or [dns.RecordEditResponseSVCBTTLNumber].
+type RecordEditResponseSVCBTTL interface {
+ ImplementsDNSRecordEditResponseSvcbttl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordEditResponseSVCBTTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordEditResponseSVCBTTLNumber(0)),
+ },
+ )
+}
+
+type RecordEditResponseSVCBTTLNumber float64
+
+const (
+ RecordEditResponseSVCBTTLNumber1 RecordEditResponseSVCBTTLNumber = 1
+)
+
+type RecordEditResponseTLSA struct {
+ // Components of a TLSA record.
+ Data RecordEditResponseTLSAData `json:"data,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordEditResponseTLSAType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // Formatted TLSA content. See 'data' to set TLSA properties.
+ Content string `json:"content"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordEditResponseTLSAMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordEditResponseTLSATTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordEditResponseTLSAJSON `json:"-"`
+}
+
+// recordEditResponseTLSAJSON contains the JSON metadata for the struct
+// [RecordEditResponseTLSA]
+type recordEditResponseTLSAJSON struct {
+ Data apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ Content apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordEditResponseTLSA) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordEditResponseTLSAJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordEditResponseTLSA) implementsDNSRecordEditResponse() {}
+
+// Components of a TLSA record.
+type RecordEditResponseTLSAData struct {
+ // certificate.
+ Certificate string `json:"certificate"`
+ // Matching Type.
+ MatchingType float64 `json:"matching_type"`
+ // Selector.
+ Selector float64 `json:"selector"`
+ // Usage.
+ Usage float64 `json:"usage"`
+ JSON recordEditResponseTLSADataJSON `json:"-"`
+}
+
+// recordEditResponseTLSADataJSON contains the JSON metadata for the struct
+// [RecordEditResponseTLSAData]
+type recordEditResponseTLSADataJSON struct {
+ Certificate apijson.Field
+ MatchingType apijson.Field
+ Selector apijson.Field
+ Usage apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordEditResponseTLSAData) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordEditResponseTLSADataJSON) RawJSON() string {
+ return r.raw
+}
+
+// Record type.
+type RecordEditResponseTLSAType string
+
+const (
+ RecordEditResponseTLSATypeTLSA RecordEditResponseTLSAType = "TLSA"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordEditResponseTLSAMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordEditResponseTLSAMetaJSON `json:"-"`
+}
+
+// recordEditResponseTLSAMetaJSON contains the JSON metadata for the struct
+// [RecordEditResponseTLSAMeta]
+type recordEditResponseTLSAMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordEditResponseTLSAMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordEditResponseTLSAMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or [dns.RecordEditResponseTLSATTLNumber].
+type RecordEditResponseTLSATTL interface {
+ ImplementsDNSRecordEditResponseTlsattl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordEditResponseTLSATTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordEditResponseTLSATTLNumber(0)),
+ },
+ )
+}
+
+type RecordEditResponseTLSATTLNumber float64
+
+const (
+ RecordEditResponseTLSATTLNumber1 RecordEditResponseTLSATTLNumber = 1
+)
+
+type RecordEditResponseTXT struct {
+ // Text content for the record.
+ Content string `json:"content,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordEditResponseTXTType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordEditResponseTXTMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordEditResponseTXTTTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordEditResponseTXTJSON `json:"-"`
+}
+
+// recordEditResponseTXTJSON contains the JSON metadata for the struct
+// [RecordEditResponseTXT]
+type recordEditResponseTXTJSON struct {
+ Content apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordEditResponseTXT) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordEditResponseTXTJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordEditResponseTXT) implementsDNSRecordEditResponse() {}
+
+// Record type.
+type RecordEditResponseTXTType string
+
+const (
+ RecordEditResponseTXTTypeTXT RecordEditResponseTXTType = "TXT"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordEditResponseTXTMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordEditResponseTXTMetaJSON `json:"-"`
+}
+
+// recordEditResponseTXTMetaJSON contains the JSON metadata for the struct
+// [RecordEditResponseTXTMeta]
+type recordEditResponseTXTMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordEditResponseTXTMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordEditResponseTXTMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or [dns.RecordEditResponseTXTTTLNumber].
+type RecordEditResponseTXTTTL interface {
+ ImplementsDNSRecordEditResponseTxtttl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordEditResponseTXTTTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordEditResponseTXTTTLNumber(0)),
+ },
+ )
+}
+
+type RecordEditResponseTXTTTLNumber float64
+
+const (
+ RecordEditResponseTXTTTLNumber1 RecordEditResponseTXTTTLNumber = 1
+)
+
+type RecordEditResponseURI struct {
+ // Components of a URI record.
+ Data RecordEditResponseURIData `json:"data,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Required for MX, SRV and URI records; unused by other record types. Records with
+ // lower priorities are preferred.
+ Priority float64 `json:"priority,required"`
+ // Record type.
+ Type RecordEditResponseURIType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // Formatted URI content. See 'data' to set URI properties.
+ Content string `json:"content"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordEditResponseURIMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordEditResponseURITTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordEditResponseURIJSON `json:"-"`
+}
+
+// recordEditResponseURIJSON contains the JSON metadata for the struct
+// [RecordEditResponseURI]
+type recordEditResponseURIJSON struct {
+ Data apijson.Field
+ Name apijson.Field
+ Priority apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ Content apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordEditResponseURI) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordEditResponseURIJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordEditResponseURI) implementsDNSRecordEditResponse() {}
+
+// Components of a URI record.
+type RecordEditResponseURIData struct {
+ // The record content.
+ Content string `json:"content"`
+ // The record weight.
+ Weight float64 `json:"weight"`
+ JSON recordEditResponseURIDataJSON `json:"-"`
+}
+
+// recordEditResponseURIDataJSON contains the JSON metadata for the struct
+// [RecordEditResponseURIData]
+type recordEditResponseURIDataJSON struct {
+ Content apijson.Field
+ Weight apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordEditResponseURIData) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordEditResponseURIDataJSON) RawJSON() string {
+ return r.raw
+}
+
+// Record type.
+type RecordEditResponseURIType string
+
+const (
+ RecordEditResponseURITypeURI RecordEditResponseURIType = "URI"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordEditResponseURIMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordEditResponseURIMetaJSON `json:"-"`
+}
+
+// recordEditResponseURIMetaJSON contains the JSON metadata for the struct
+// [RecordEditResponseURIMeta]
+type recordEditResponseURIMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordEditResponseURIMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordEditResponseURIMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or [dns.RecordEditResponseURITTLNumber].
+type RecordEditResponseURITTL interface {
+ ImplementsDNSRecordEditResponseUrittl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordEditResponseURITTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordEditResponseURITTLNumber(0)),
+ },
+ )
+}
+
+type RecordEditResponseURITTLNumber float64
+
+const (
+ RecordEditResponseURITTLNumber1 RecordEditResponseURITTLNumber = 1
+)
+
+// Union satisfied by [dns.RecordGetResponseA], [dns.RecordGetResponseAAAA],
+// [dns.RecordGetResponseCAA], [dns.RecordGetResponseCert],
+// [dns.RecordGetResponseCNAME], [dns.RecordGetResponseDNSKEY],
+// [dns.RecordGetResponseDS], [dns.RecordGetResponseHTTPS],
+// [dns.RecordGetResponseLOC], [dns.RecordGetResponseMX],
+// [dns.RecordGetResponseNAPTR], [dns.RecordGetResponseNS],
+// [dns.RecordGetResponsePTR], [dns.RecordGetResponseSmimea],
+// [dns.RecordGetResponseSRV], [dns.RecordGetResponseSSHFP],
+// [dns.RecordGetResponseSVCB], [dns.RecordGetResponseTLSA],
+// [dns.RecordGetResponseTXT] or [dns.RecordGetResponseURI].
+type RecordGetResponse interface {
+ implementsDNSRecordGetResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordGetResponse)(nil)).Elem(),
+ "type",
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordGetResponseA{}),
+ DiscriminatorValue: "A",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordGetResponseAAAA{}),
+ DiscriminatorValue: "AAAA",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordGetResponseCAA{}),
+ DiscriminatorValue: "CAA",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordGetResponseCert{}),
+ DiscriminatorValue: "CERT",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordGetResponseCNAME{}),
+ DiscriminatorValue: "CNAME",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordGetResponseDNSKEY{}),
+ DiscriminatorValue: "DNSKEY",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordGetResponseDS{}),
+ DiscriminatorValue: "DS",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordGetResponseHTTPS{}),
+ DiscriminatorValue: "HTTPS",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordGetResponseLOC{}),
+ DiscriminatorValue: "LOC",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordGetResponseMX{}),
+ DiscriminatorValue: "MX",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordGetResponseNAPTR{}),
+ DiscriminatorValue: "NAPTR",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordGetResponseNS{}),
+ DiscriminatorValue: "NS",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordGetResponsePTR{}),
+ DiscriminatorValue: "PTR",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordGetResponseSmimea{}),
+ DiscriminatorValue: "SMIMEA",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordGetResponseSRV{}),
+ DiscriminatorValue: "SRV",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordGetResponseSSHFP{}),
+ DiscriminatorValue: "SSHFP",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordGetResponseSVCB{}),
+ DiscriminatorValue: "SVCB",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordGetResponseTLSA{}),
+ DiscriminatorValue: "TLSA",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordGetResponseTXT{}),
+ DiscriminatorValue: "TXT",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RecordGetResponseURI{}),
+ DiscriminatorValue: "URI",
+ },
+ )
+}
+
+type RecordGetResponseA struct {
+ // A valid IPv4 address.
+ Content string `json:"content,required" format:"ipv4"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordGetResponseAType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordGetResponseAMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Whether the record is receiving the performance and security benefits of
+ // Cloudflare.
+ Proxied bool `json:"proxied"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordGetResponseATTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordGetResponseAJSON `json:"-"`
+}
+
+// recordGetResponseAJSON contains the JSON metadata for the struct
+// [RecordGetResponseA]
+type recordGetResponseAJSON struct {
+ Content apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Proxied apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordGetResponseA) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordGetResponseAJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordGetResponseA) implementsDNSRecordGetResponse() {}
+
+// Record type.
+type RecordGetResponseAType string
+
+const (
+ RecordGetResponseATypeA RecordGetResponseAType = "A"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordGetResponseAMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordGetResponseAMetaJSON `json:"-"`
+}
+
+// recordGetResponseAMetaJSON contains the JSON metadata for the struct
+// [RecordGetResponseAMeta]
+type recordGetResponseAMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordGetResponseAMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordGetResponseAMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or [dns.RecordGetResponseATTLNumber].
+type RecordGetResponseATTL interface {
+ ImplementsDNSRecordGetResponseAttl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordGetResponseATTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordGetResponseATTLNumber(0)),
+ },
+ )
+}
+
+type RecordGetResponseATTLNumber float64
+
+const (
+ RecordGetResponseATTLNumber1 RecordGetResponseATTLNumber = 1
+)
+
+type RecordGetResponseAAAA struct {
+ // A valid IPv6 address.
+ Content string `json:"content,required" format:"ipv6"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordGetResponseAAAAType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordGetResponseAAAAMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Whether the record is receiving the performance and security benefits of
+ // Cloudflare.
+ Proxied bool `json:"proxied"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordGetResponseAAAATTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordGetResponseAAAAJSON `json:"-"`
+}
+
+// recordGetResponseAAAAJSON contains the JSON metadata for the struct
+// [RecordGetResponseAAAA]
+type recordGetResponseAAAAJSON struct {
+ Content apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Proxied apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordGetResponseAAAA) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordGetResponseAAAAJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordGetResponseAAAA) implementsDNSRecordGetResponse() {}
+
+// Record type.
+type RecordGetResponseAAAAType string
+
+const (
+ RecordGetResponseAAAATypeAAAA RecordGetResponseAAAAType = "AAAA"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordGetResponseAAAAMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordGetResponseAAAAMetaJSON `json:"-"`
+}
+
+// recordGetResponseAAAAMetaJSON contains the JSON metadata for the struct
+// [RecordGetResponseAAAAMeta]
+type recordGetResponseAAAAMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordGetResponseAAAAMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordGetResponseAAAAMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or [dns.RecordGetResponseAAAATTLNumber].
+type RecordGetResponseAAAATTL interface {
+ ImplementsDNSRecordGetResponseAaaattl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordGetResponseAAAATTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordGetResponseAAAATTLNumber(0)),
+ },
+ )
+}
+
+type RecordGetResponseAAAATTLNumber float64
+
+const (
+ RecordGetResponseAAAATTLNumber1 RecordGetResponseAAAATTLNumber = 1
+)
+
+type RecordGetResponseCAA struct {
+ // Components of a CAA record.
+ Data RecordGetResponseCAAData `json:"data,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordGetResponseCAAType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // Formatted CAA content. See 'data' to set CAA properties.
+ Content string `json:"content"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordGetResponseCAAMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordGetResponseCAATTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordGetResponseCAAJSON `json:"-"`
+}
+
+// recordGetResponseCAAJSON contains the JSON metadata for the struct
+// [RecordGetResponseCAA]
+type recordGetResponseCAAJSON struct {
+ Data apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ Content apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordGetResponseCAA) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordGetResponseCAAJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordGetResponseCAA) implementsDNSRecordGetResponse() {}
+
+// Components of a CAA record.
+type RecordGetResponseCAAData struct {
+ // Flags for the CAA record.
+ Flags float64 `json:"flags"`
+ // Name of the property controlled by this record (e.g.: issue, issuewild, iodef).
+ Tag string `json:"tag"`
+ // Value of the record. This field's semantics depend on the chosen tag.
+ Value string `json:"value"`
+ JSON recordGetResponseCAADataJSON `json:"-"`
+}
+
+// recordGetResponseCAADataJSON contains the JSON metadata for the struct
+// [RecordGetResponseCAAData]
+type recordGetResponseCAADataJSON struct {
+ Flags apijson.Field
+ Tag apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordGetResponseCAAData) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordGetResponseCAADataJSON) RawJSON() string {
+ return r.raw
+}
+
+// Record type.
+type RecordGetResponseCAAType string
+
+const (
+ RecordGetResponseCAATypeCAA RecordGetResponseCAAType = "CAA"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordGetResponseCAAMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordGetResponseCAAMetaJSON `json:"-"`
+}
+
+// recordGetResponseCAAMetaJSON contains the JSON metadata for the struct
+// [RecordGetResponseCAAMeta]
+type recordGetResponseCAAMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordGetResponseCAAMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordGetResponseCAAMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or [dns.RecordGetResponseCAATTLNumber].
+type RecordGetResponseCAATTL interface {
+ ImplementsDNSRecordGetResponseCaattl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordGetResponseCAATTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordGetResponseCAATTLNumber(0)),
+ },
+ )
+}
+
+type RecordGetResponseCAATTLNumber float64
+
+const (
+ RecordGetResponseCAATTLNumber1 RecordGetResponseCAATTLNumber = 1
+)
+
+type RecordGetResponseCert struct {
+ // Components of a CERT record.
+ Data RecordGetResponseCertData `json:"data,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordGetResponseCertType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // Formatted CERT content. See 'data' to set CERT properties.
+ Content string `json:"content"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordGetResponseCertMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordGetResponseCertTTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordGetResponseCertJSON `json:"-"`
+}
+
+// recordGetResponseCertJSON contains the JSON metadata for the struct
+// [RecordGetResponseCert]
+type recordGetResponseCertJSON struct {
+ Data apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ Content apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordGetResponseCert) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordGetResponseCertJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordGetResponseCert) implementsDNSRecordGetResponse() {}
+
+// Components of a CERT record.
+type RecordGetResponseCertData struct {
+ // Algorithm.
+ Algorithm float64 `json:"algorithm"`
+ // Certificate.
+ Certificate string `json:"certificate"`
+ // Key Tag.
+ KeyTag float64 `json:"key_tag"`
+ // Type.
+ Type float64 `json:"type"`
+ JSON recordGetResponseCertDataJSON `json:"-"`
+}
+
+// recordGetResponseCertDataJSON contains the JSON metadata for the struct
+// [RecordGetResponseCertData]
+type recordGetResponseCertDataJSON struct {
+ Algorithm apijson.Field
+ Certificate apijson.Field
+ KeyTag apijson.Field
+ Type apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordGetResponseCertData) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordGetResponseCertDataJSON) RawJSON() string {
+ return r.raw
+}
+
+// Record type.
+type RecordGetResponseCertType string
+
+const (
+ RecordGetResponseCertTypeCert RecordGetResponseCertType = "CERT"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordGetResponseCertMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordGetResponseCertMetaJSON `json:"-"`
+}
+
+// recordGetResponseCertMetaJSON contains the JSON metadata for the struct
+// [RecordGetResponseCertMeta]
+type recordGetResponseCertMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordGetResponseCertMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordGetResponseCertMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or [dns.RecordGetResponseCertTTLNumber].
+type RecordGetResponseCertTTL interface {
+ ImplementsDNSRecordGetResponseCertTTL()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordGetResponseCertTTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordGetResponseCertTTLNumber(0)),
+ },
+ )
+}
+
+type RecordGetResponseCertTTLNumber float64
+
+const (
+ RecordGetResponseCertTTLNumber1 RecordGetResponseCertTTLNumber = 1
+)
+
+type RecordGetResponseCNAME struct {
+ // A valid hostname. Must not match the record's name.
+ Content interface{} `json:"content,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordGetResponseCNAMEType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordGetResponseCNAMEMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Whether the record is receiving the performance and security benefits of
+ // Cloudflare.
+ Proxied bool `json:"proxied"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordGetResponseCNAMETTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordGetResponseCNAMEJSON `json:"-"`
+}
+
+// recordGetResponseCNAMEJSON contains the JSON metadata for the struct
+// [RecordGetResponseCNAME]
+type recordGetResponseCNAMEJSON struct {
+ Content apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Proxied apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordGetResponseCNAME) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordGetResponseCNAMEJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordGetResponseCNAME) implementsDNSRecordGetResponse() {}
+
+// Record type.
+type RecordGetResponseCNAMEType string
+
+const (
+ RecordGetResponseCNAMETypeCNAME RecordGetResponseCNAMEType = "CNAME"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordGetResponseCNAMEMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordGetResponseCNAMEMetaJSON `json:"-"`
+}
+
+// recordGetResponseCNAMEMetaJSON contains the JSON metadata for the struct
+// [RecordGetResponseCNAMEMeta]
+type recordGetResponseCNAMEMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordGetResponseCNAMEMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordGetResponseCNAMEMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or [dns.RecordGetResponseCNAMETTLNumber].
+type RecordGetResponseCNAMETTL interface {
+ ImplementsDNSRecordGetResponseCnamettl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordGetResponseCNAMETTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordGetResponseCNAMETTLNumber(0)),
+ },
+ )
+}
+
+type RecordGetResponseCNAMETTLNumber float64
+
+const (
+ RecordGetResponseCNAMETTLNumber1 RecordGetResponseCNAMETTLNumber = 1
+)
+
+type RecordGetResponseDNSKEY struct {
+ // Components of a DNSKEY record.
+ Data RecordGetResponseDNSKEYData `json:"data,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordGetResponseDNSKEYType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // Formatted DNSKEY content. See 'data' to set DNSKEY properties.
+ Content string `json:"content"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordGetResponseDNSKEYMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordGetResponseDNSKEYTTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordGetResponseDNSKEYJSON `json:"-"`
+}
+
+// recordGetResponseDNSKEYJSON contains the JSON metadata for the struct
+// [RecordGetResponseDNSKEY]
+type recordGetResponseDNSKEYJSON struct {
+ Data apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ Content apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordGetResponseDNSKEY) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordGetResponseDNSKEYJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordGetResponseDNSKEY) implementsDNSRecordGetResponse() {}
+
+// Components of a DNSKEY record.
+type RecordGetResponseDNSKEYData struct {
+ // Algorithm.
+ Algorithm float64 `json:"algorithm"`
+ // Flags.
+ Flags float64 `json:"flags"`
+ // Protocol.
+ Protocol float64 `json:"protocol"`
+ // Public Key.
+ PublicKey string `json:"public_key"`
+ JSON recordGetResponseDNSKEYDataJSON `json:"-"`
+}
+
+// recordGetResponseDNSKEYDataJSON contains the JSON metadata for the struct
+// [RecordGetResponseDNSKEYData]
+type recordGetResponseDNSKEYDataJSON struct {
+ Algorithm apijson.Field
+ Flags apijson.Field
+ Protocol apijson.Field
+ PublicKey apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordGetResponseDNSKEYData) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordGetResponseDNSKEYDataJSON) RawJSON() string {
+ return r.raw
+}
+
+// Record type.
+type RecordGetResponseDNSKEYType string
+
+const (
+ RecordGetResponseDNSKEYTypeDNSKEY RecordGetResponseDNSKEYType = "DNSKEY"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordGetResponseDNSKEYMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordGetResponseDNSKEYMetaJSON `json:"-"`
+}
+
+// recordGetResponseDNSKEYMetaJSON contains the JSON metadata for the struct
+// [RecordGetResponseDNSKEYMeta]
+type recordGetResponseDNSKEYMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordGetResponseDNSKEYMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordGetResponseDNSKEYMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or
+// [dns.RecordGetResponseDNSKEYTTLNumber].
+type RecordGetResponseDNSKEYTTL interface {
+ ImplementsDNSRecordGetResponseDnskeyttl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordGetResponseDNSKEYTTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordGetResponseDNSKEYTTLNumber(0)),
+ },
+ )
+}
+
+type RecordGetResponseDNSKEYTTLNumber float64
+
+const (
+ RecordGetResponseDNSKEYTTLNumber1 RecordGetResponseDNSKEYTTLNumber = 1
+)
+
+type RecordGetResponseDS struct {
+ // Components of a DS record.
+ Data RecordGetResponseDSData `json:"data,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordGetResponseDSType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // Formatted DS content. See 'data' to set DS properties.
+ Content string `json:"content"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordGetResponseDSMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordGetResponseDSTTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordGetResponseDSJSON `json:"-"`
+}
+
+// recordGetResponseDSJSON contains the JSON metadata for the struct
+// [RecordGetResponseDS]
+type recordGetResponseDSJSON struct {
+ Data apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ Content apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordGetResponseDS) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordGetResponseDSJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordGetResponseDS) implementsDNSRecordGetResponse() {}
+
+// Components of a DS record.
+type RecordGetResponseDSData struct {
+ // Algorithm.
+ Algorithm float64 `json:"algorithm"`
+ // Digest.
+ Digest string `json:"digest"`
+ // Digest Type.
+ DigestType float64 `json:"digest_type"`
+ // Key Tag.
+ KeyTag float64 `json:"key_tag"`
+ JSON recordGetResponseDSDataJSON `json:"-"`
+}
+
+// recordGetResponseDSDataJSON contains the JSON metadata for the struct
+// [RecordGetResponseDSData]
+type recordGetResponseDSDataJSON struct {
+ Algorithm apijson.Field
+ Digest apijson.Field
+ DigestType apijson.Field
+ KeyTag apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordGetResponseDSData) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordGetResponseDSDataJSON) RawJSON() string {
+ return r.raw
+}
+
+// Record type.
+type RecordGetResponseDSType string
+
+const (
+ RecordGetResponseDSTypeDS RecordGetResponseDSType = "DS"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordGetResponseDSMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordGetResponseDSMetaJSON `json:"-"`
+}
+
+// recordGetResponseDSMetaJSON contains the JSON metadata for the struct
+// [RecordGetResponseDSMeta]
+type recordGetResponseDSMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordGetResponseDSMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordGetResponseDSMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or [dns.RecordGetResponseDSTTLNumber].
+type RecordGetResponseDSTTL interface {
+ ImplementsDNSRecordGetResponseDsttl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordGetResponseDSTTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordGetResponseDSTTLNumber(0)),
+ },
+ )
+}
+
+type RecordGetResponseDSTTLNumber float64
+
+const (
+ RecordGetResponseDSTTLNumber1 RecordGetResponseDSTTLNumber = 1
+)
+
+type RecordGetResponseHTTPS struct {
+ // Components of a HTTPS record.
+ Data RecordGetResponseHTTPSData `json:"data,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordGetResponseHTTPSType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // Formatted HTTPS content. See 'data' to set HTTPS properties.
+ Content string `json:"content"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordGetResponseHTTPSMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordGetResponseHTTPSTTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordGetResponseHTTPSJSON `json:"-"`
+}
+
+// recordGetResponseHTTPSJSON contains the JSON metadata for the struct
+// [RecordGetResponseHTTPS]
+type recordGetResponseHTTPSJSON struct {
+ Data apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ Content apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordGetResponseHTTPS) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordGetResponseHTTPSJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordGetResponseHTTPS) implementsDNSRecordGetResponse() {}
+
+// Components of a HTTPS record.
+type RecordGetResponseHTTPSData struct {
+ // priority.
+ Priority float64 `json:"priority"`
+ // target.
+ Target string `json:"target"`
+ // value.
+ Value string `json:"value"`
+ JSON recordGetResponseHTTPSDataJSON `json:"-"`
+}
+
+// recordGetResponseHTTPSDataJSON contains the JSON metadata for the struct
+// [RecordGetResponseHTTPSData]
+type recordGetResponseHTTPSDataJSON struct {
+ Priority apijson.Field
+ Target apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordGetResponseHTTPSData) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordGetResponseHTTPSDataJSON) RawJSON() string {
+ return r.raw
+}
+
+// Record type.
+type RecordGetResponseHTTPSType string
+
+const (
+ RecordGetResponseHTTPSTypeHTTPS RecordGetResponseHTTPSType = "HTTPS"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordGetResponseHTTPSMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordGetResponseHTTPSMetaJSON `json:"-"`
+}
+
+// recordGetResponseHTTPSMetaJSON contains the JSON metadata for the struct
+// [RecordGetResponseHTTPSMeta]
+type recordGetResponseHTTPSMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordGetResponseHTTPSMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordGetResponseHTTPSMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or [dns.RecordGetResponseHTTPSTTLNumber].
+type RecordGetResponseHTTPSTTL interface {
+ ImplementsDNSRecordGetResponseHttpsttl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordGetResponseHTTPSTTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordGetResponseHTTPSTTLNumber(0)),
+ },
+ )
+}
+
+type RecordGetResponseHTTPSTTLNumber float64
+
+const (
+ RecordGetResponseHTTPSTTLNumber1 RecordGetResponseHTTPSTTLNumber = 1
+)
+
+type RecordGetResponseLOC struct {
+ // Components of a LOC record.
+ Data RecordGetResponseLOCData `json:"data,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordGetResponseLOCType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // Formatted LOC content. See 'data' to set LOC properties.
+ Content string `json:"content"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordGetResponseLOCMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordGetResponseLOCTTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordGetResponseLOCJSON `json:"-"`
+}
+
+// recordGetResponseLOCJSON contains the JSON metadata for the struct
+// [RecordGetResponseLOC]
+type recordGetResponseLOCJSON struct {
+ Data apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ Content apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordGetResponseLOC) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordGetResponseLOCJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordGetResponseLOC) implementsDNSRecordGetResponse() {}
+
+// Components of a LOC record.
+type RecordGetResponseLOCData struct {
+ // Altitude of location in meters.
+ Altitude float64 `json:"altitude"`
+ // Degrees of latitude.
+ LatDegrees float64 `json:"lat_degrees"`
+ // Latitude direction.
+ LatDirection RecordGetResponseLOCDataLatDirection `json:"lat_direction"`
+ // Minutes of latitude.
+ LatMinutes float64 `json:"lat_minutes"`
+ // Seconds of latitude.
+ LatSeconds float64 `json:"lat_seconds"`
+ // Degrees of longitude.
+ LongDegrees float64 `json:"long_degrees"`
+ // Longitude direction.
+ LongDirection RecordGetResponseLOCDataLongDirection `json:"long_direction"`
+ // Minutes of longitude.
+ LongMinutes float64 `json:"long_minutes"`
+ // Seconds of longitude.
+ LongSeconds float64 `json:"long_seconds"`
+ // Horizontal precision of location.
+ PrecisionHorz float64 `json:"precision_horz"`
+ // Vertical precision of location.
+ PrecisionVert float64 `json:"precision_vert"`
+ // Size of location in meters.
+ Size float64 `json:"size"`
+ JSON recordGetResponseLOCDataJSON `json:"-"`
+}
+
+// recordGetResponseLOCDataJSON contains the JSON metadata for the struct
+// [RecordGetResponseLOCData]
+type recordGetResponseLOCDataJSON struct {
+ Altitude apijson.Field
+ LatDegrees apijson.Field
+ LatDirection apijson.Field
+ LatMinutes apijson.Field
+ LatSeconds apijson.Field
+ LongDegrees apijson.Field
+ LongDirection apijson.Field
+ LongMinutes apijson.Field
+ LongSeconds apijson.Field
+ PrecisionHorz apijson.Field
+ PrecisionVert apijson.Field
+ Size apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordGetResponseLOCData) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordGetResponseLOCDataJSON) RawJSON() string {
+ return r.raw
+}
+
+// Latitude direction.
+type RecordGetResponseLOCDataLatDirection string
+
+const (
+ RecordGetResponseLOCDataLatDirectionN RecordGetResponseLOCDataLatDirection = "N"
+ RecordGetResponseLOCDataLatDirectionS RecordGetResponseLOCDataLatDirection = "S"
+)
+
+// Longitude direction.
+type RecordGetResponseLOCDataLongDirection string
+
+const (
+ RecordGetResponseLOCDataLongDirectionE RecordGetResponseLOCDataLongDirection = "E"
+ RecordGetResponseLOCDataLongDirectionW RecordGetResponseLOCDataLongDirection = "W"
+)
+
+// Record type.
+type RecordGetResponseLOCType string
+
+const (
+ RecordGetResponseLOCTypeLOC RecordGetResponseLOCType = "LOC"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordGetResponseLOCMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordGetResponseLOCMetaJSON `json:"-"`
+}
+
+// recordGetResponseLOCMetaJSON contains the JSON metadata for the struct
+// [RecordGetResponseLOCMeta]
+type recordGetResponseLOCMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordGetResponseLOCMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordGetResponseLOCMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or [dns.RecordGetResponseLOCTTLNumber].
+type RecordGetResponseLOCTTL interface {
+ ImplementsDNSRecordGetResponseLocttl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordGetResponseLOCTTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordGetResponseLOCTTLNumber(0)),
+ },
+ )
+}
+
+type RecordGetResponseLOCTTLNumber float64
+
+const (
+ RecordGetResponseLOCTTLNumber1 RecordGetResponseLOCTTLNumber = 1
+)
+
+type RecordGetResponseMX struct {
+ // A valid mail server hostname.
+ Content string `json:"content,required" format:"hostname"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Required for MX, SRV and URI records; unused by other record types. Records with
+ // lower priorities are preferred.
+ Priority float64 `json:"priority,required"`
+ // Record type.
+ Type RecordGetResponseMXType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordGetResponseMXMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordGetResponseMXTTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordGetResponseMXJSON `json:"-"`
+}
+
+// recordGetResponseMXJSON contains the JSON metadata for the struct
+// [RecordGetResponseMX]
+type recordGetResponseMXJSON struct {
+ Content apijson.Field
+ Name apijson.Field
+ Priority apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordGetResponseMX) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordGetResponseMXJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordGetResponseMX) implementsDNSRecordGetResponse() {}
+
+// Record type.
+type RecordGetResponseMXType string
+
+const (
+ RecordGetResponseMXTypeMX RecordGetResponseMXType = "MX"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordGetResponseMXMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordGetResponseMXMetaJSON `json:"-"`
+}
+
+// recordGetResponseMXMetaJSON contains the JSON metadata for the struct
+// [RecordGetResponseMXMeta]
+type recordGetResponseMXMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordGetResponseMXMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordGetResponseMXMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or [dns.RecordGetResponseMXTTLNumber].
+type RecordGetResponseMXTTL interface {
+ ImplementsDNSRecordGetResponseMxttl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordGetResponseMXTTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordGetResponseMXTTLNumber(0)),
+ },
+ )
+}
+
+type RecordGetResponseMXTTLNumber float64
+
+const (
+ RecordGetResponseMXTTLNumber1 RecordGetResponseMXTTLNumber = 1
+)
+
+type RecordGetResponseNAPTR struct {
+ // Components of a NAPTR record.
+ Data RecordGetResponseNAPTRData `json:"data,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordGetResponseNAPTRType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // Formatted NAPTR content. See 'data' to set NAPTR properties.
+ Content string `json:"content"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordGetResponseNAPTRMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordGetResponseNAPTRTTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordGetResponseNAPTRJSON `json:"-"`
+}
+
+// recordGetResponseNAPTRJSON contains the JSON metadata for the struct
+// [RecordGetResponseNAPTR]
+type recordGetResponseNAPTRJSON struct {
+ Data apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ Content apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordGetResponseNAPTR) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordGetResponseNAPTRJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordGetResponseNAPTR) implementsDNSRecordGetResponse() {}
+
+// Components of a NAPTR record.
+type RecordGetResponseNAPTRData struct {
+ // Flags.
+ Flags string `json:"flags"`
+ // Order.
+ Order float64 `json:"order"`
+ // Preference.
+ Preference float64 `json:"preference"`
+ // Regex.
+ Regex string `json:"regex"`
+ // Replacement.
+ Replacement string `json:"replacement"`
+ // Service.
+ Service string `json:"service"`
+ JSON recordGetResponseNAPTRDataJSON `json:"-"`
+}
+
+// recordGetResponseNAPTRDataJSON contains the JSON metadata for the struct
+// [RecordGetResponseNAPTRData]
+type recordGetResponseNAPTRDataJSON struct {
+ Flags apijson.Field
+ Order apijson.Field
+ Preference apijson.Field
+ Regex apijson.Field
+ Replacement apijson.Field
+ Service apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordGetResponseNAPTRData) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordGetResponseNAPTRDataJSON) RawJSON() string {
+ return r.raw
+}
+
+// Record type.
+type RecordGetResponseNAPTRType string
+
+const (
+ RecordGetResponseNAPTRTypeNAPTR RecordGetResponseNAPTRType = "NAPTR"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordGetResponseNAPTRMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordGetResponseNAPTRMetaJSON `json:"-"`
+}
+
+// recordGetResponseNAPTRMetaJSON contains the JSON metadata for the struct
+// [RecordGetResponseNAPTRMeta]
+type recordGetResponseNAPTRMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordGetResponseNAPTRMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordGetResponseNAPTRMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or [dns.RecordGetResponseNAPTRTTLNumber].
+type RecordGetResponseNAPTRTTL interface {
+ ImplementsDNSRecordGetResponseNaptrttl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordGetResponseNAPTRTTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordGetResponseNAPTRTTLNumber(0)),
+ },
+ )
+}
+
+type RecordGetResponseNAPTRTTLNumber float64
+
+const (
+ RecordGetResponseNAPTRTTLNumber1 RecordGetResponseNAPTRTTLNumber = 1
+)
+
+type RecordGetResponseNS struct {
+ // A valid name server host name.
+ Content interface{} `json:"content,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordGetResponseNSType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordGetResponseNSMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordGetResponseNSTTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordGetResponseNSJSON `json:"-"`
+}
+
+// recordGetResponseNSJSON contains the JSON metadata for the struct
+// [RecordGetResponseNS]
+type recordGetResponseNSJSON struct {
+ Content apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordGetResponseNS) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordGetResponseNSJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordGetResponseNS) implementsDNSRecordGetResponse() {}
+
+// Record type.
+type RecordGetResponseNSType string
+
+const (
+ RecordGetResponseNSTypeNS RecordGetResponseNSType = "NS"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordGetResponseNSMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordGetResponseNSMetaJSON `json:"-"`
+}
+
+// recordGetResponseNSMetaJSON contains the JSON metadata for the struct
+// [RecordGetResponseNSMeta]
+type recordGetResponseNSMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordGetResponseNSMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordGetResponseNSMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or [dns.RecordGetResponseNSTTLNumber].
+type RecordGetResponseNSTTL interface {
+ ImplementsDNSRecordGetResponseNsttl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordGetResponseNSTTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordGetResponseNSTTLNumber(0)),
+ },
+ )
+}
+
+type RecordGetResponseNSTTLNumber float64
+
+const (
+ RecordGetResponseNSTTLNumber1 RecordGetResponseNSTTLNumber = 1
+)
+
+type RecordGetResponsePTR struct {
+ // Domain name pointing to the address.
+ Content string `json:"content,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordGetResponsePTRType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordGetResponsePTRMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordGetResponsePTRTTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordGetResponsePTRJSON `json:"-"`
+}
+
+// recordGetResponsePTRJSON contains the JSON metadata for the struct
+// [RecordGetResponsePTR]
+type recordGetResponsePTRJSON struct {
+ Content apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordGetResponsePTR) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordGetResponsePTRJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordGetResponsePTR) implementsDNSRecordGetResponse() {}
+
+// Record type.
+type RecordGetResponsePTRType string
+
+const (
+ RecordGetResponsePTRTypePTR RecordGetResponsePTRType = "PTR"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordGetResponsePTRMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordGetResponsePTRMetaJSON `json:"-"`
+}
+
+// recordGetResponsePTRMetaJSON contains the JSON metadata for the struct
+// [RecordGetResponsePTRMeta]
+type recordGetResponsePTRMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordGetResponsePTRMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordGetResponsePTRMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or [dns.RecordGetResponsePTRTTLNumber].
+type RecordGetResponsePTRTTL interface {
+ ImplementsDNSRecordGetResponsePtrttl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordGetResponsePTRTTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordGetResponsePTRTTLNumber(0)),
+ },
+ )
+}
+
+type RecordGetResponsePTRTTLNumber float64
+
+const (
+ RecordGetResponsePTRTTLNumber1 RecordGetResponsePTRTTLNumber = 1
+)
+
+type RecordGetResponseSmimea struct {
+ // Components of a SMIMEA record.
+ Data RecordGetResponseSmimeaData `json:"data,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordGetResponseSmimeaType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // Formatted SMIMEA content. See 'data' to set SMIMEA properties.
+ Content string `json:"content"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordGetResponseSmimeaMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordGetResponseSmimeaTTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordGetResponseSmimeaJSON `json:"-"`
+}
+
+// recordGetResponseSmimeaJSON contains the JSON metadata for the struct
+// [RecordGetResponseSmimea]
+type recordGetResponseSmimeaJSON struct {
+ Data apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ Content apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordGetResponseSmimea) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordGetResponseSmimeaJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordGetResponseSmimea) implementsDNSRecordGetResponse() {}
+
+// Components of a SMIMEA record.
+type RecordGetResponseSmimeaData struct {
+ // Certificate.
+ Certificate string `json:"certificate"`
+ // Matching Type.
+ MatchingType float64 `json:"matching_type"`
+ // Selector.
+ Selector float64 `json:"selector"`
+ // Usage.
+ Usage float64 `json:"usage"`
+ JSON recordGetResponseSmimeaDataJSON `json:"-"`
+}
+
+// recordGetResponseSmimeaDataJSON contains the JSON metadata for the struct
+// [RecordGetResponseSmimeaData]
+type recordGetResponseSmimeaDataJSON struct {
+ Certificate apijson.Field
+ MatchingType apijson.Field
+ Selector apijson.Field
+ Usage apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordGetResponseSmimeaData) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordGetResponseSmimeaDataJSON) RawJSON() string {
+ return r.raw
+}
+
+// Record type.
+type RecordGetResponseSmimeaType string
+
+const (
+ RecordGetResponseSmimeaTypeSmimea RecordGetResponseSmimeaType = "SMIMEA"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordGetResponseSmimeaMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordGetResponseSmimeaMetaJSON `json:"-"`
+}
+
+// recordGetResponseSmimeaMetaJSON contains the JSON metadata for the struct
+// [RecordGetResponseSmimeaMeta]
+type recordGetResponseSmimeaMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordGetResponseSmimeaMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordGetResponseSmimeaMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or
+// [dns.RecordGetResponseSmimeaTTLNumber].
+type RecordGetResponseSmimeaTTL interface {
+ ImplementsDNSRecordGetResponseSmimeaTTL()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordGetResponseSmimeaTTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordGetResponseSmimeaTTLNumber(0)),
+ },
+ )
+}
+
+type RecordGetResponseSmimeaTTLNumber float64
+
+const (
+ RecordGetResponseSmimeaTTLNumber1 RecordGetResponseSmimeaTTLNumber = 1
+)
+
+type RecordGetResponseSRV struct {
+ // Components of a SRV record.
+ Data RecordGetResponseSRVData `json:"data,required"`
+ // DNS record name (or @ for the zone apex) in Punycode. For SRV records, the first
+ // label is normally a service and the second a protocol name, each starting with
+ // an underscore.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordGetResponseSRVType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // Priority, weight, port, and SRV target. See 'data' for setting the individual
+ // component values.
+ Content string `json:"content"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordGetResponseSRVMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordGetResponseSRVTTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordGetResponseSRVJSON `json:"-"`
+}
+
+// recordGetResponseSRVJSON contains the JSON metadata for the struct
+// [RecordGetResponseSRV]
+type recordGetResponseSRVJSON struct {
+ Data apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ Content apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordGetResponseSRV) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordGetResponseSRVJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordGetResponseSRV) implementsDNSRecordGetResponse() {}
+
+// Components of a SRV record.
+type RecordGetResponseSRVData struct {
+ // A valid hostname. Deprecated in favor of the regular 'name' outside the data
+ // map. This data map field represents the remainder of the full 'name' after the
+ // service and protocol.
+ Name string `json:"name" format:"hostname"`
+ // The port of the service.
+ Port float64 `json:"port"`
+ // Required for MX, SRV and URI records; unused by other record types. Records with
+ // lower priorities are preferred.
+ Priority float64 `json:"priority"`
+ // A valid protocol, prefixed with an underscore. Deprecated in favor of the
+ // regular 'name' outside the data map. This data map field normally represents the
+ // second label of that 'name'.
+ Proto string `json:"proto"`
+ // A service type, prefixed with an underscore. Deprecated in favor of the regular
+ // 'name' outside the data map. This data map field normally represents the first
+ // label of that 'name'.
+ Service string `json:"service"`
+ // A valid hostname.
+ Target string `json:"target" format:"hostname"`
+ // The record weight.
+ Weight float64 `json:"weight"`
+ JSON recordGetResponseSRVDataJSON `json:"-"`
+}
+
+// recordGetResponseSRVDataJSON contains the JSON metadata for the struct
+// [RecordGetResponseSRVData]
+type recordGetResponseSRVDataJSON struct {
+ Name apijson.Field
+ Port apijson.Field
+ Priority apijson.Field
+ Proto apijson.Field
+ Service apijson.Field
+ Target apijson.Field
+ Weight apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordGetResponseSRVData) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordGetResponseSRVDataJSON) RawJSON() string {
+ return r.raw
+}
+
+// Record type.
+type RecordGetResponseSRVType string
+
+const (
+ RecordGetResponseSRVTypeSRV RecordGetResponseSRVType = "SRV"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordGetResponseSRVMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordGetResponseSRVMetaJSON `json:"-"`
+}
+
+// recordGetResponseSRVMetaJSON contains the JSON metadata for the struct
+// [RecordGetResponseSRVMeta]
+type recordGetResponseSRVMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordGetResponseSRVMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordGetResponseSRVMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or [dns.RecordGetResponseSRVTTLNumber].
+type RecordGetResponseSRVTTL interface {
+ ImplementsDNSRecordGetResponseSrvttl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordGetResponseSRVTTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordGetResponseSRVTTLNumber(0)),
+ },
+ )
+}
+
+type RecordGetResponseSRVTTLNumber float64
+
+const (
+ RecordGetResponseSRVTTLNumber1 RecordGetResponseSRVTTLNumber = 1
+)
+
+type RecordGetResponseSSHFP struct {
+ // Components of a SSHFP record.
+ Data RecordGetResponseSSHFPData `json:"data,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordGetResponseSSHFPType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // Formatted SSHFP content. See 'data' to set SSHFP properties.
+ Content string `json:"content"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordGetResponseSSHFPMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordGetResponseSSHFPTTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordGetResponseSSHFPJSON `json:"-"`
+}
+
+// recordGetResponseSSHFPJSON contains the JSON metadata for the struct
+// [RecordGetResponseSSHFP]
+type recordGetResponseSSHFPJSON struct {
+ Data apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ Content apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordGetResponseSSHFP) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordGetResponseSSHFPJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordGetResponseSSHFP) implementsDNSRecordGetResponse() {}
+
+// Components of a SSHFP record.
+type RecordGetResponseSSHFPData struct {
+ // algorithm.
+ Algorithm float64 `json:"algorithm"`
+ // fingerprint.
+ Fingerprint string `json:"fingerprint"`
+ // type.
+ Type float64 `json:"type"`
+ JSON recordGetResponseSSHFPDataJSON `json:"-"`
+}
+
+// recordGetResponseSSHFPDataJSON contains the JSON metadata for the struct
+// [RecordGetResponseSSHFPData]
+type recordGetResponseSSHFPDataJSON struct {
+ Algorithm apijson.Field
+ Fingerprint apijson.Field
+ Type apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordGetResponseSSHFPData) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordGetResponseSSHFPDataJSON) RawJSON() string {
+ return r.raw
+}
+
+// Record type.
+type RecordGetResponseSSHFPType string
+
+const (
+ RecordGetResponseSSHFPTypeSSHFP RecordGetResponseSSHFPType = "SSHFP"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordGetResponseSSHFPMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordGetResponseSSHFPMetaJSON `json:"-"`
+}
+
+// recordGetResponseSSHFPMetaJSON contains the JSON metadata for the struct
+// [RecordGetResponseSSHFPMeta]
+type recordGetResponseSSHFPMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordGetResponseSSHFPMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordGetResponseSSHFPMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or [dns.RecordGetResponseSSHFPTTLNumber].
+type RecordGetResponseSSHFPTTL interface {
+ ImplementsDNSRecordGetResponseSshfpttl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordGetResponseSSHFPTTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordGetResponseSSHFPTTLNumber(0)),
+ },
+ )
+}
+
+type RecordGetResponseSSHFPTTLNumber float64
+
+const (
+ RecordGetResponseSSHFPTTLNumber1 RecordGetResponseSSHFPTTLNumber = 1
+)
+
+type RecordGetResponseSVCB struct {
+ // Components of a SVCB record.
+ Data RecordGetResponseSVCBData `json:"data,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordGetResponseSVCBType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // Formatted SVCB content. See 'data' to set SVCB properties.
+ Content string `json:"content"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordGetResponseSVCBMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordGetResponseSVCBTTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordGetResponseSVCBJSON `json:"-"`
+}
+
+// recordGetResponseSVCBJSON contains the JSON metadata for the struct
+// [RecordGetResponseSVCB]
+type recordGetResponseSVCBJSON struct {
+ Data apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ Content apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordGetResponseSVCB) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordGetResponseSVCBJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordGetResponseSVCB) implementsDNSRecordGetResponse() {}
+
+// Components of a SVCB record.
+type RecordGetResponseSVCBData struct {
+ // priority.
+ Priority float64 `json:"priority"`
+ // target.
+ Target string `json:"target"`
+ // value.
+ Value string `json:"value"`
+ JSON recordGetResponseSVCBDataJSON `json:"-"`
+}
+
+// recordGetResponseSVCBDataJSON contains the JSON metadata for the struct
+// [RecordGetResponseSVCBData]
+type recordGetResponseSVCBDataJSON struct {
+ Priority apijson.Field
+ Target apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordGetResponseSVCBData) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordGetResponseSVCBDataJSON) RawJSON() string {
+ return r.raw
+}
+
+// Record type.
+type RecordGetResponseSVCBType string
+
+const (
+ RecordGetResponseSVCBTypeSVCB RecordGetResponseSVCBType = "SVCB"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordGetResponseSVCBMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordGetResponseSVCBMetaJSON `json:"-"`
+}
+
+// recordGetResponseSVCBMetaJSON contains the JSON metadata for the struct
+// [RecordGetResponseSVCBMeta]
+type recordGetResponseSVCBMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordGetResponseSVCBMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordGetResponseSVCBMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or [dns.RecordGetResponseSVCBTTLNumber].
+type RecordGetResponseSVCBTTL interface {
+ ImplementsDNSRecordGetResponseSvcbttl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordGetResponseSVCBTTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordGetResponseSVCBTTLNumber(0)),
+ },
+ )
+}
+
+type RecordGetResponseSVCBTTLNumber float64
+
+const (
+ RecordGetResponseSVCBTTLNumber1 RecordGetResponseSVCBTTLNumber = 1
+)
+
+type RecordGetResponseTLSA struct {
+ // Components of a TLSA record.
+ Data RecordGetResponseTLSAData `json:"data,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordGetResponseTLSAType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // Formatted TLSA content. See 'data' to set TLSA properties.
+ Content string `json:"content"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordGetResponseTLSAMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordGetResponseTLSATTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordGetResponseTLSAJSON `json:"-"`
+}
+
+// recordGetResponseTLSAJSON contains the JSON metadata for the struct
+// [RecordGetResponseTLSA]
+type recordGetResponseTLSAJSON struct {
+ Data apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ Content apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordGetResponseTLSA) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordGetResponseTLSAJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordGetResponseTLSA) implementsDNSRecordGetResponse() {}
+
+// Components of a TLSA record.
+type RecordGetResponseTLSAData struct {
+ // certificate.
+ Certificate string `json:"certificate"`
+ // Matching Type.
+ MatchingType float64 `json:"matching_type"`
+ // Selector.
+ Selector float64 `json:"selector"`
+ // Usage.
+ Usage float64 `json:"usage"`
+ JSON recordGetResponseTLSADataJSON `json:"-"`
+}
+
+// recordGetResponseTLSADataJSON contains the JSON metadata for the struct
+// [RecordGetResponseTLSAData]
+type recordGetResponseTLSADataJSON struct {
+ Certificate apijson.Field
+ MatchingType apijson.Field
+ Selector apijson.Field
+ Usage apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordGetResponseTLSAData) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordGetResponseTLSADataJSON) RawJSON() string {
+ return r.raw
+}
+
+// Record type.
+type RecordGetResponseTLSAType string
+
+const (
+ RecordGetResponseTLSATypeTLSA RecordGetResponseTLSAType = "TLSA"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordGetResponseTLSAMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordGetResponseTLSAMetaJSON `json:"-"`
+}
+
+// recordGetResponseTLSAMetaJSON contains the JSON metadata for the struct
+// [RecordGetResponseTLSAMeta]
+type recordGetResponseTLSAMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordGetResponseTLSAMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordGetResponseTLSAMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or [dns.RecordGetResponseTLSATTLNumber].
+type RecordGetResponseTLSATTL interface {
+ ImplementsDNSRecordGetResponseTlsattl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordGetResponseTLSATTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordGetResponseTLSATTLNumber(0)),
+ },
+ )
+}
+
+type RecordGetResponseTLSATTLNumber float64
+
+const (
+ RecordGetResponseTLSATTLNumber1 RecordGetResponseTLSATTLNumber = 1
+)
+
+type RecordGetResponseTXT struct {
+ // Text content for the record.
+ Content string `json:"content,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Record type.
+ Type RecordGetResponseTXTType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordGetResponseTXTMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordGetResponseTXTTTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordGetResponseTXTJSON `json:"-"`
+}
+
+// recordGetResponseTXTJSON contains the JSON metadata for the struct
+// [RecordGetResponseTXT]
+type recordGetResponseTXTJSON struct {
+ Content apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordGetResponseTXT) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordGetResponseTXTJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordGetResponseTXT) implementsDNSRecordGetResponse() {}
+
+// Record type.
+type RecordGetResponseTXTType string
+
+const (
+ RecordGetResponseTXTTypeTXT RecordGetResponseTXTType = "TXT"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordGetResponseTXTMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordGetResponseTXTMetaJSON `json:"-"`
+}
+
+// recordGetResponseTXTMetaJSON contains the JSON metadata for the struct
+// [RecordGetResponseTXTMeta]
+type recordGetResponseTXTMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordGetResponseTXTMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordGetResponseTXTMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or [dns.RecordGetResponseTXTTTLNumber].
+type RecordGetResponseTXTTTL interface {
+ ImplementsDNSRecordGetResponseTxtttl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordGetResponseTXTTTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordGetResponseTXTTTLNumber(0)),
+ },
+ )
+}
+
+type RecordGetResponseTXTTTLNumber float64
+
+const (
+ RecordGetResponseTXTTTLNumber1 RecordGetResponseTXTTTLNumber = 1
+)
+
+type RecordGetResponseURI struct {
+ // Components of a URI record.
+ Data RecordGetResponseURIData `json:"data,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name string `json:"name,required"`
+ // Required for MX, SRV and URI records; unused by other record types. Records with
+ // lower priorities are preferred.
+ Priority float64 `json:"priority,required"`
+ // Record type.
+ Type RecordGetResponseURIType `json:"type,required"`
+ // Identifier
+ ID string `json:"id"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment string `json:"comment"`
+ // Formatted URI content. See 'data' to set URI properties.
+ Content string `json:"content"`
+ // When the record was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Whether this record can be modified/deleted (true means it's managed by
+ // Cloudflare).
+ Locked bool `json:"locked"`
+ // Extra Cloudflare-specific information about the record.
+ Meta RecordGetResponseURIMeta `json:"meta"`
+ // When the record was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Whether the record can be proxied by Cloudflare or not.
+ Proxiable bool `json:"proxiable"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags []string `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL RecordGetResponseURITTL `json:"ttl"`
+ // Identifier
+ ZoneID string `json:"zone_id"`
+ // The domain of the record.
+ ZoneName string `json:"zone_name" format:"hostname"`
+ JSON recordGetResponseURIJSON `json:"-"`
+}
+
+// recordGetResponseURIJSON contains the JSON metadata for the struct
+// [RecordGetResponseURI]
+type recordGetResponseURIJSON struct {
+ Data apijson.Field
+ Name apijson.Field
+ Priority apijson.Field
+ Type apijson.Field
+ ID apijson.Field
+ Comment apijson.Field
+ Content apijson.Field
+ CreatedOn apijson.Field
+ Locked apijson.Field
+ Meta apijson.Field
+ ModifiedOn apijson.Field
+ Proxiable apijson.Field
+ Tags apijson.Field
+ TTL apijson.Field
+ ZoneID apijson.Field
+ ZoneName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordGetResponseURI) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordGetResponseURIJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RecordGetResponseURI) implementsDNSRecordGetResponse() {}
+
+// Components of a URI record.
+type RecordGetResponseURIData struct {
+ // The record content.
+ Content string `json:"content"`
+ // The record weight.
+ Weight float64 `json:"weight"`
+ JSON recordGetResponseURIDataJSON `json:"-"`
+}
+
+// recordGetResponseURIDataJSON contains the JSON metadata for the struct
+// [RecordGetResponseURIData]
+type recordGetResponseURIDataJSON struct {
+ Content apijson.Field
+ Weight apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordGetResponseURIData) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordGetResponseURIDataJSON) RawJSON() string {
+ return r.raw
+}
+
+// Record type.
+type RecordGetResponseURIType string
+
+const (
+ RecordGetResponseURITypeURI RecordGetResponseURIType = "URI"
+)
+
+// Extra Cloudflare-specific information about the record.
+type RecordGetResponseURIMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded bool `json:"auto_added"`
+ // Where the record originated from.
+ Source string `json:"source"`
+ JSON recordGetResponseURIMetaJSON `json:"-"`
+}
+
+// recordGetResponseURIMetaJSON contains the JSON metadata for the struct
+// [RecordGetResponseURIMeta]
+type recordGetResponseURIMetaJSON struct {
+ AutoAdded apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordGetResponseURIMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordGetResponseURIMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Union satisfied by [shared.UnionFloat] or [dns.RecordGetResponseURITTLNumber].
+type RecordGetResponseURITTL interface {
+ ImplementsDNSRecordGetResponseUrittl()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RecordGetResponseURITTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(RecordGetResponseURITTLNumber(0)),
+ },
+ )
+}
+
+type RecordGetResponseURITTLNumber float64
+
+const (
+ RecordGetResponseURITTLNumber1 RecordGetResponseURITTLNumber = 1
+)
+
+type RecordImportResponse struct {
+ // Number of DNS records added.
+ RecsAdded float64 `json:"recs_added"`
+ // Total number of DNS records parsed.
+ TotalRecordsParsed float64 `json:"total_records_parsed"`
+ JSON recordImportResponseJSON `json:"-"`
+}
+
+// recordImportResponseJSON contains the JSON metadata for the struct
+// [RecordImportResponse]
+type recordImportResponseJSON struct {
+ RecsAdded apijson.Field
+ TotalRecordsParsed apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordImportResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordImportResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type RecordScanResponse struct {
+ // Number of DNS records added.
+ RecsAdded float64 `json:"recs_added"`
+ // Total number of DNS records parsed.
+ TotalRecordsParsed float64 `json:"total_records_parsed"`
+ JSON recordScanResponseJSON `json:"-"`
+}
+
+// recordScanResponseJSON contains the JSON metadata for the struct
+// [RecordScanResponse]
+type recordScanResponseJSON struct {
+ RecsAdded apijson.Field
+ TotalRecordsParsed apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordScanResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordScanResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type RecordNewParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name param.Field[string] `json:"name,required"`
+ // Record type.
+ Type param.Field[RecordNewParamsType] `json:"type,required"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment param.Field[string] `json:"comment"`
+ Data param.Field[RecordNewParamsData] `json:"data"`
+ Meta param.Field[RecordNewParamsMeta] `json:"meta"`
+ // Required for MX, SRV and URI records; unused by other record types. Records with
+ // lower priorities are preferred.
+ Priority param.Field[float64] `json:"priority"`
+ // Whether the record is receiving the performance and security benefits of
+ // Cloudflare.
+ Proxied param.Field[bool] `json:"proxied"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags param.Field[[]string] `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL param.Field[RecordNewParamsTTL] `json:"ttl"`
+}
+
+func (r RecordNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Record type.
+type RecordNewParamsType string
+
+const (
+ RecordNewParamsTypeURI RecordNewParamsType = "URI"
+)
+
+type RecordNewParamsData struct {
+ // algorithm.
+ Algorithm param.Field[float64] `json:"algorithm"`
+ // Altitude of location in meters.
+ Altitude param.Field[float64] `json:"altitude"`
+ // certificate.
+ Certificate param.Field[string] `json:"certificate"`
+ // The record content.
+ Content param.Field[string] `json:"content"`
+ // Digest.
+ Digest param.Field[string] `json:"digest"`
+ // Digest Type.
+ DigestType param.Field[float64] `json:"digest_type"`
+ // fingerprint.
+ Fingerprint param.Field[string] `json:"fingerprint"`
+ // Flags.
+ Flags param.Field[string] `json:"flags"`
+ // Key Tag.
+ KeyTag param.Field[float64] `json:"key_tag"`
+ // Degrees of latitude.
+ LatDegrees param.Field[float64] `json:"lat_degrees"`
+ // Latitude direction.
+ LatDirection param.Field[RecordNewParamsDataLatDirection] `json:"lat_direction"`
+ // Minutes of latitude.
+ LatMinutes param.Field[float64] `json:"lat_minutes"`
+ // Seconds of latitude.
+ LatSeconds param.Field[float64] `json:"lat_seconds"`
+ // Degrees of longitude.
+ LongDegrees param.Field[float64] `json:"long_degrees"`
+ // Longitude direction.
+ LongDirection param.Field[RecordNewParamsDataLongDirection] `json:"long_direction"`
+ // Minutes of longitude.
+ LongMinutes param.Field[float64] `json:"long_minutes"`
+ // Seconds of longitude.
+ LongSeconds param.Field[float64] `json:"long_seconds"`
+ // Matching Type.
+ MatchingType param.Field[float64] `json:"matching_type"`
+ // A valid hostname. Deprecated in favor of the regular 'name' outside the data
+ // map. This data map field represents the remainder of the full 'name' after the
+ // service and protocol.
+ Name param.Field[string] `json:"name" format:"hostname"`
+ // Order.
+ Order param.Field[float64] `json:"order"`
+ // The port of the service.
+ Port param.Field[float64] `json:"port"`
+ // Horizontal precision of location.
+ PrecisionHorz param.Field[float64] `json:"precision_horz"`
+ // Vertical precision of location.
+ PrecisionVert param.Field[float64] `json:"precision_vert"`
+ // Preference.
+ Preference param.Field[float64] `json:"preference"`
+ // priority.
+ Priority param.Field[float64] `json:"priority"`
+ // A valid protocol, prefixed with an underscore. Deprecated in favor of the
+ // regular 'name' outside the data map. This data map field normally represents the
+ // second label of that 'name'.
+ Proto param.Field[string] `json:"proto"`
+ // Protocol.
+ Protocol param.Field[float64] `json:"protocol"`
+ // Public Key.
+ PublicKey param.Field[string] `json:"public_key"`
+ // Regex.
+ Regex param.Field[string] `json:"regex"`
+ // Replacement.
+ Replacement param.Field[string] `json:"replacement"`
+ // Selector.
+ Selector param.Field[float64] `json:"selector"`
+ // A service type, prefixed with an underscore. Deprecated in favor of the regular
+ // 'name' outside the data map. This data map field normally represents the first
+ // label of that 'name'.
+ Service param.Field[string] `json:"service"`
+ // Size of location in meters.
+ Size param.Field[float64] `json:"size"`
+ // Name of the property controlled by this record (e.g.: issue, issuewild, iodef).
+ Tag param.Field[string] `json:"tag"`
+ // target.
+ Target param.Field[string] `json:"target"`
+ // type.
+ Type param.Field[float64] `json:"type"`
+ // Usage.
+ Usage param.Field[float64] `json:"usage"`
+ // value.
+ Value param.Field[string] `json:"value"`
+ // The record weight.
+ Weight param.Field[float64] `json:"weight"`
+}
+
+func (r RecordNewParamsData) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Latitude direction.
+type RecordNewParamsDataLatDirection string
+
+const (
+ RecordNewParamsDataLatDirectionN RecordNewParamsDataLatDirection = "N"
+ RecordNewParamsDataLatDirectionS RecordNewParamsDataLatDirection = "S"
+)
+
+// Longitude direction.
+type RecordNewParamsDataLongDirection string
+
+const (
+ RecordNewParamsDataLongDirectionE RecordNewParamsDataLongDirection = "E"
+ RecordNewParamsDataLongDirectionW RecordNewParamsDataLongDirection = "W"
+)
+
+type RecordNewParamsMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded param.Field[bool] `json:"auto_added"`
+ // Where the record originated from.
+ Source param.Field[string] `json:"source"`
+}
+
+func (r RecordNewParamsMeta) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Satisfied by [shared.UnionFloat], [dns.RecordNewParamsTTLNumber].
+type RecordNewParamsTTL interface {
+ ImplementsDNSRecordNewParamsTTL()
+}
+
+type RecordNewParamsTTLNumber float64
+
+const (
+ RecordNewParamsTTLNumber1 RecordNewParamsTTLNumber = 1
+)
+
+type RecordNewResponseEnvelope struct {
+ Errors []RecordNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []RecordNewResponseEnvelopeMessages `json:"messages,required"`
+ Result RecordNewResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success RecordNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON recordNewResponseEnvelopeJSON `json:"-"`
+}
+
+// recordNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [RecordNewResponseEnvelope]
+type recordNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type RecordNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON recordNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// recordNewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [RecordNewResponseEnvelopeErrors]
+type recordNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type RecordNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON recordNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// recordNewResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [RecordNewResponseEnvelopeMessages]
+type recordNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type RecordNewResponseEnvelopeSuccess bool
+
+const (
+ RecordNewResponseEnvelopeSuccessTrue RecordNewResponseEnvelopeSuccess = true
+)
+
+type RecordUpdateParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name param.Field[string] `json:"name,required"`
+ // Record type.
+ Type param.Field[RecordUpdateParamsType] `json:"type,required"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment param.Field[string] `json:"comment"`
+ Data param.Field[RecordUpdateParamsData] `json:"data"`
+ Meta param.Field[RecordUpdateParamsMeta] `json:"meta"`
+ // Required for MX, SRV and URI records; unused by other record types. Records with
+ // lower priorities are preferred.
+ Priority param.Field[float64] `json:"priority"`
+ // Whether the record is receiving the performance and security benefits of
+ // Cloudflare.
+ Proxied param.Field[bool] `json:"proxied"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags param.Field[[]string] `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL param.Field[RecordUpdateParamsTTL] `json:"ttl"`
+}
+
+func (r RecordUpdateParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Record type.
+type RecordUpdateParamsType string
+
+const (
+ RecordUpdateParamsTypeURI RecordUpdateParamsType = "URI"
+)
+
+type RecordUpdateParamsData struct {
+ // algorithm.
+ Algorithm param.Field[float64] `json:"algorithm"`
+ // Altitude of location in meters.
+ Altitude param.Field[float64] `json:"altitude"`
+ // certificate.
+ Certificate param.Field[string] `json:"certificate"`
+ // The record content.
+ Content param.Field[string] `json:"content"`
+ // Digest.
+ Digest param.Field[string] `json:"digest"`
+ // Digest Type.
+ DigestType param.Field[float64] `json:"digest_type"`
+ // fingerprint.
+ Fingerprint param.Field[string] `json:"fingerprint"`
+ // Flags.
+ Flags param.Field[string] `json:"flags"`
+ // Key Tag.
+ KeyTag param.Field[float64] `json:"key_tag"`
+ // Degrees of latitude.
+ LatDegrees param.Field[float64] `json:"lat_degrees"`
+ // Latitude direction.
+ LatDirection param.Field[RecordUpdateParamsDataLatDirection] `json:"lat_direction"`
+ // Minutes of latitude.
+ LatMinutes param.Field[float64] `json:"lat_minutes"`
+ // Seconds of latitude.
+ LatSeconds param.Field[float64] `json:"lat_seconds"`
+ // Degrees of longitude.
+ LongDegrees param.Field[float64] `json:"long_degrees"`
+ // Longitude direction.
+ LongDirection param.Field[RecordUpdateParamsDataLongDirection] `json:"long_direction"`
+ // Minutes of longitude.
+ LongMinutes param.Field[float64] `json:"long_minutes"`
+ // Seconds of longitude.
+ LongSeconds param.Field[float64] `json:"long_seconds"`
+ // Matching Type.
+ MatchingType param.Field[float64] `json:"matching_type"`
+ // A valid hostname. Deprecated in favor of the regular 'name' outside the data
+ // map. This data map field represents the remainder of the full 'name' after the
+ // service and protocol.
+ Name param.Field[string] `json:"name" format:"hostname"`
+ // Order.
+ Order param.Field[float64] `json:"order"`
+ // The port of the service.
+ Port param.Field[float64] `json:"port"`
+ // Horizontal precision of location.
+ PrecisionHorz param.Field[float64] `json:"precision_horz"`
+ // Vertical precision of location.
+ PrecisionVert param.Field[float64] `json:"precision_vert"`
+ // Preference.
+ Preference param.Field[float64] `json:"preference"`
+ // priority.
+ Priority param.Field[float64] `json:"priority"`
+ // A valid protocol, prefixed with an underscore. Deprecated in favor of the
+ // regular 'name' outside the data map. This data map field normally represents the
+ // second label of that 'name'.
+ Proto param.Field[string] `json:"proto"`
+ // Protocol.
+ Protocol param.Field[float64] `json:"protocol"`
+ // Public Key.
+ PublicKey param.Field[string] `json:"public_key"`
+ // Regex.
+ Regex param.Field[string] `json:"regex"`
+ // Replacement.
+ Replacement param.Field[string] `json:"replacement"`
+ // Selector.
+ Selector param.Field[float64] `json:"selector"`
+ // A service type, prefixed with an underscore. Deprecated in favor of the regular
+ // 'name' outside the data map. This data map field normally represents the first
+ // label of that 'name'.
+ Service param.Field[string] `json:"service"`
+ // Size of location in meters.
+ Size param.Field[float64] `json:"size"`
+ // Name of the property controlled by this record (e.g.: issue, issuewild, iodef).
+ Tag param.Field[string] `json:"tag"`
+ // target.
+ Target param.Field[string] `json:"target"`
+ // type.
+ Type param.Field[float64] `json:"type"`
+ // Usage.
+ Usage param.Field[float64] `json:"usage"`
+ // value.
+ Value param.Field[string] `json:"value"`
+ // The record weight.
+ Weight param.Field[float64] `json:"weight"`
+}
+
+func (r RecordUpdateParamsData) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Latitude direction.
+type RecordUpdateParamsDataLatDirection string
+
+const (
+ RecordUpdateParamsDataLatDirectionN RecordUpdateParamsDataLatDirection = "N"
+ RecordUpdateParamsDataLatDirectionS RecordUpdateParamsDataLatDirection = "S"
+)
+
+// Longitude direction.
+type RecordUpdateParamsDataLongDirection string
+
+const (
+ RecordUpdateParamsDataLongDirectionE RecordUpdateParamsDataLongDirection = "E"
+ RecordUpdateParamsDataLongDirectionW RecordUpdateParamsDataLongDirection = "W"
+)
+
+type RecordUpdateParamsMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded param.Field[bool] `json:"auto_added"`
+ // Where the record originated from.
+ Source param.Field[string] `json:"source"`
+}
+
+func (r RecordUpdateParamsMeta) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Satisfied by [shared.UnionFloat], [dns.RecordUpdateParamsTTLNumber].
+type RecordUpdateParamsTTL interface {
+ ImplementsDNSRecordUpdateParamsTTL()
+}
+
+type RecordUpdateParamsTTLNumber float64
+
+const (
+ RecordUpdateParamsTTLNumber1 RecordUpdateParamsTTLNumber = 1
+)
+
+type RecordUpdateResponseEnvelope struct {
+ Errors []RecordUpdateResponseEnvelopeErrors `json:"errors,required"`
+ Messages []RecordUpdateResponseEnvelopeMessages `json:"messages,required"`
+ Result RecordUpdateResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success RecordUpdateResponseEnvelopeSuccess `json:"success,required"`
+ JSON recordUpdateResponseEnvelopeJSON `json:"-"`
+}
+
+// recordUpdateResponseEnvelopeJSON contains the JSON metadata for the struct
+// [RecordUpdateResponseEnvelope]
+type recordUpdateResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordUpdateResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type RecordUpdateResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON recordUpdateResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// recordUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [RecordUpdateResponseEnvelopeErrors]
+type recordUpdateResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type RecordUpdateResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON recordUpdateResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// recordUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [RecordUpdateResponseEnvelopeMessages]
+type recordUpdateResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type RecordUpdateResponseEnvelopeSuccess bool
+
+const (
+ RecordUpdateResponseEnvelopeSuccessTrue RecordUpdateResponseEnvelopeSuccess = true
+)
+
+type RecordListParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+ Comment param.Field[RecordListParamsComment] `query:"comment"`
+ // DNS record content.
+ Content param.Field[string] `query:"content"`
+ // Direction to order DNS records in.
+ Direction param.Field[RecordListParamsDirection] `query:"direction"`
+ // Whether to match all search requirements or at least one (any). If set to `all`,
+ // acts like a logical AND between filters. If set to `any`, acts like a logical OR
+ // instead. Note that the interaction between tag filters is controlled by the
+ // `tag-match` parameter instead.
+ Match param.Field[RecordListParamsMatch] `query:"match"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name param.Field[string] `query:"name"`
+ // Field to order DNS records by.
+ Order param.Field[RecordListParamsOrder] `query:"order"`
+ // Page number of paginated results.
+ Page param.Field[float64] `query:"page"`
+ // Number of DNS records per page.
+ PerPage param.Field[float64] `query:"per_page"`
+ // Whether the record is receiving the performance and security benefits of
+ // Cloudflare.
+ Proxied param.Field[bool] `query:"proxied"`
+ // Allows searching in multiple properties of a DNS record simultaneously. This
+ // parameter is intended for human users, not automation. Its exact behavior is
+ // intentionally left unspecified and is subject to change in the future. This
+ // parameter works independently of the `match` setting. For automated searches,
+ // please use the other available parameters.
+ Search param.Field[string] `query:"search"`
+ Tag param.Field[RecordListParamsTag] `query:"tag"`
+ // Whether to match all tag search requirements or at least one (any). If set to
+ // `all`, acts like a logical AND between tag filters. If set to `any`, acts like a
+ // logical OR instead. Note that the regular `match` parameter is still used to
+ // combine the resulting condition with other filters that aren't related to tags.
+ TagMatch param.Field[RecordListParamsTagMatch] `query:"tag_match"`
+ // Record type.
+ Type param.Field[RecordListParamsType] `query:"type"`
+}
+
+// URLQuery serializes [RecordListParams]'s query parameters as `url.Values`.
+func (r RecordListParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type RecordListParamsComment struct {
+ // If this parameter is present, only records _without_ a comment are returned.
+ Absent param.Field[string] `query:"absent"`
+ // Substring of the DNS record comment. Comment filters are case-insensitive.
+ Contains param.Field[string] `query:"contains"`
+ // Suffix of the DNS record comment. Comment filters are case-insensitive.
+ Endswith param.Field[string] `query:"endswith"`
+ // Exact value of the DNS record comment. Comment filters are case-insensitive.
+ Exact param.Field[string] `query:"exact"`
+ // If this parameter is present, only records _with_ a comment are returned.
+ Present param.Field[string] `query:"present"`
+ // Prefix of the DNS record comment. Comment filters are case-insensitive.
+ Startswith param.Field[string] `query:"startswith"`
+}
+
+// URLQuery serializes [RecordListParamsComment]'s query parameters as
+// `url.Values`.
+func (r RecordListParamsComment) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Direction to order DNS records in.
+type RecordListParamsDirection string
+
+const (
+ RecordListParamsDirectionAsc RecordListParamsDirection = "asc"
+ RecordListParamsDirectionDesc RecordListParamsDirection = "desc"
+)
+
+// Whether to match all search requirements or at least one (any). If set to `all`,
+// acts like a logical AND between filters. If set to `any`, acts like a logical OR
+// instead. Note that the interaction between tag filters is controlled by the
+// `tag-match` parameter instead.
+type RecordListParamsMatch string
+
+const (
+ RecordListParamsMatchAny RecordListParamsMatch = "any"
+ RecordListParamsMatchAll RecordListParamsMatch = "all"
+)
+
+// Field to order DNS records by.
+type RecordListParamsOrder string
+
+const (
+ RecordListParamsOrderType RecordListParamsOrder = "type"
+ RecordListParamsOrderName RecordListParamsOrder = "name"
+ RecordListParamsOrderContent RecordListParamsOrder = "content"
+ RecordListParamsOrderTTL RecordListParamsOrder = "ttl"
+ RecordListParamsOrderProxied RecordListParamsOrder = "proxied"
+)
+
+type RecordListParamsTag struct {
+ // Name of a tag which must _not_ be present on the DNS record. Tag filters are
+ // case-insensitive.
+ Absent param.Field[string] `query:"absent"`
+ // A tag and value, of the form `:`. The API will only return
+ // DNS records that have a tag named `` whose value contains
+ // ``. Tag filters are case-insensitive.
+ Contains param.Field[string] `query:"contains"`
+ // A tag and value, of the form `:`. The API will only return
+ // DNS records that have a tag named `` whose value ends with
+ // ``. Tag filters are case-insensitive.
+ Endswith param.Field[string] `query:"endswith"`
+ // A tag and value, of the form `:`. The API will only return
+ // DNS records that have a tag named `` whose value is ``. Tag
+ // filters are case-insensitive.
+ Exact param.Field[string] `query:"exact"`
+ // Name of a tag which must be present on the DNS record. Tag filters are
+ // case-insensitive.
+ Present param.Field[string] `query:"present"`
+ // A tag and value, of the form `:`. The API will only return
+ // DNS records that have a tag named `` whose value starts with
+ // ``. Tag filters are case-insensitive.
+ Startswith param.Field[string] `query:"startswith"`
+}
+
+// URLQuery serializes [RecordListParamsTag]'s query parameters as `url.Values`.
+func (r RecordListParamsTag) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Whether to match all tag search requirements or at least one (any). If set to
+// `all`, acts like a logical AND between tag filters. If set to `any`, acts like a
+// logical OR instead. Note that the regular `match` parameter is still used to
+// combine the resulting condition with other filters that aren't related to tags.
+type RecordListParamsTagMatch string
+
+const (
+ RecordListParamsTagMatchAny RecordListParamsTagMatch = "any"
+ RecordListParamsTagMatchAll RecordListParamsTagMatch = "all"
+)
+
+// Record type.
+type RecordListParamsType string
+
+const (
+ RecordListParamsTypeA RecordListParamsType = "A"
+ RecordListParamsTypeAAAA RecordListParamsType = "AAAA"
+ RecordListParamsTypeCAA RecordListParamsType = "CAA"
+ RecordListParamsTypeCert RecordListParamsType = "CERT"
+ RecordListParamsTypeCNAME RecordListParamsType = "CNAME"
+ RecordListParamsTypeDNSKEY RecordListParamsType = "DNSKEY"
+ RecordListParamsTypeDS RecordListParamsType = "DS"
+ RecordListParamsTypeHTTPS RecordListParamsType = "HTTPS"
+ RecordListParamsTypeLOC RecordListParamsType = "LOC"
+ RecordListParamsTypeMX RecordListParamsType = "MX"
+ RecordListParamsTypeNAPTR RecordListParamsType = "NAPTR"
+ RecordListParamsTypeNS RecordListParamsType = "NS"
+ RecordListParamsTypePTR RecordListParamsType = "PTR"
+ RecordListParamsTypeSmimea RecordListParamsType = "SMIMEA"
+ RecordListParamsTypeSRV RecordListParamsType = "SRV"
+ RecordListParamsTypeSSHFP RecordListParamsType = "SSHFP"
+ RecordListParamsTypeSVCB RecordListParamsType = "SVCB"
+ RecordListParamsTypeTLSA RecordListParamsType = "TLSA"
+ RecordListParamsTypeTXT RecordListParamsType = "TXT"
+ RecordListParamsTypeURI RecordListParamsType = "URI"
+)
+
+type RecordDeleteParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+}
+
+type RecordDeleteResponseEnvelope struct {
+ Result RecordDeleteResponse `json:"result"`
+ JSON recordDeleteResponseEnvelopeJSON `json:"-"`
+}
+
+// recordDeleteResponseEnvelopeJSON contains the JSON metadata for the struct
+// [RecordDeleteResponseEnvelope]
+type recordDeleteResponseEnvelopeJSON struct {
+ Result apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordDeleteResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type RecordEditParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+ // DNS record name (or @ for the zone apex) in Punycode.
+ Name param.Field[string] `json:"name,required"`
+ // Record type.
+ Type param.Field[RecordEditParamsType] `json:"type,required"`
+ // Comments or notes about the DNS record. This field has no effect on DNS
+ // responses.
+ Comment param.Field[string] `json:"comment"`
+ Data param.Field[RecordEditParamsData] `json:"data"`
+ Meta param.Field[RecordEditParamsMeta] `json:"meta"`
+ // Required for MX, SRV and URI records; unused by other record types. Records with
+ // lower priorities are preferred.
+ Priority param.Field[float64] `json:"priority"`
+ // Whether the record is receiving the performance and security benefits of
+ // Cloudflare.
+ Proxied param.Field[bool] `json:"proxied"`
+ // Custom tags for the DNS record. This field has no effect on DNS responses.
+ Tags param.Field[[]string] `json:"tags"`
+ // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+ // Value must be between 60 and 86400, with the minimum reduced to 30 for
+ // Enterprise zones.
+ TTL param.Field[RecordEditParamsTTL] `json:"ttl"`
+}
+
+func (r RecordEditParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Record type.
+type RecordEditParamsType string
+
+const (
+ RecordEditParamsTypeURI RecordEditParamsType = "URI"
+)
+
+type RecordEditParamsData struct {
+ // algorithm.
+ Algorithm param.Field[float64] `json:"algorithm"`
+ // Altitude of location in meters.
+ Altitude param.Field[float64] `json:"altitude"`
+ // certificate.
+ Certificate param.Field[string] `json:"certificate"`
+ // The record content.
+ Content param.Field[string] `json:"content"`
+ // Digest.
+ Digest param.Field[string] `json:"digest"`
+ // Digest Type.
+ DigestType param.Field[float64] `json:"digest_type"`
+ // fingerprint.
+ Fingerprint param.Field[string] `json:"fingerprint"`
+ // Flags.
+ Flags param.Field[string] `json:"flags"`
+ // Key Tag.
+ KeyTag param.Field[float64] `json:"key_tag"`
+ // Degrees of latitude.
+ LatDegrees param.Field[float64] `json:"lat_degrees"`
+ // Latitude direction.
+ LatDirection param.Field[RecordEditParamsDataLatDirection] `json:"lat_direction"`
+ // Minutes of latitude.
+ LatMinutes param.Field[float64] `json:"lat_minutes"`
+ // Seconds of latitude.
+ LatSeconds param.Field[float64] `json:"lat_seconds"`
+ // Degrees of longitude.
+ LongDegrees param.Field[float64] `json:"long_degrees"`
+ // Longitude direction.
+ LongDirection param.Field[RecordEditParamsDataLongDirection] `json:"long_direction"`
+ // Minutes of longitude.
+ LongMinutes param.Field[float64] `json:"long_minutes"`
+ // Seconds of longitude.
+ LongSeconds param.Field[float64] `json:"long_seconds"`
+ // Matching Type.
+ MatchingType param.Field[float64] `json:"matching_type"`
+ // A valid hostname. Deprecated in favor of the regular 'name' outside the data
+ // map. This data map field represents the remainder of the full 'name' after the
+ // service and protocol.
+ Name param.Field[string] `json:"name" format:"hostname"`
+ // Order.
+ Order param.Field[float64] `json:"order"`
+ // The port of the service.
+ Port param.Field[float64] `json:"port"`
+ // Horizontal precision of location.
+ PrecisionHorz param.Field[float64] `json:"precision_horz"`
+ // Vertical precision of location.
+ PrecisionVert param.Field[float64] `json:"precision_vert"`
+ // Preference.
+ Preference param.Field[float64] `json:"preference"`
+ // priority.
+ Priority param.Field[float64] `json:"priority"`
+ // A valid protocol, prefixed with an underscore. Deprecated in favor of the
+ // regular 'name' outside the data map. This data map field normally represents the
+ // second label of that 'name'.
+ Proto param.Field[string] `json:"proto"`
+ // Protocol.
+ Protocol param.Field[float64] `json:"protocol"`
+ // Public Key.
+ PublicKey param.Field[string] `json:"public_key"`
+ // Regex.
+ Regex param.Field[string] `json:"regex"`
+ // Replacement.
+ Replacement param.Field[string] `json:"replacement"`
+ // Selector.
+ Selector param.Field[float64] `json:"selector"`
+ // A service type, prefixed with an underscore. Deprecated in favor of the regular
+ // 'name' outside the data map. This data map field normally represents the first
+ // label of that 'name'.
+ Service param.Field[string] `json:"service"`
+ // Size of location in meters.
+ Size param.Field[float64] `json:"size"`
+ // Name of the property controlled by this record (e.g.: issue, issuewild, iodef).
+ Tag param.Field[string] `json:"tag"`
+ // target.
+ Target param.Field[string] `json:"target"`
+ // type.
+ Type param.Field[float64] `json:"type"`
+ // Usage.
+ Usage param.Field[float64] `json:"usage"`
+ // value.
+ Value param.Field[string] `json:"value"`
+ // The record weight.
+ Weight param.Field[float64] `json:"weight"`
+}
+
+func (r RecordEditParamsData) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Latitude direction.
+type RecordEditParamsDataLatDirection string
+
+const (
+ RecordEditParamsDataLatDirectionN RecordEditParamsDataLatDirection = "N"
+ RecordEditParamsDataLatDirectionS RecordEditParamsDataLatDirection = "S"
+)
+
+// Longitude direction.
+type RecordEditParamsDataLongDirection string
+
+const (
+ RecordEditParamsDataLongDirectionE RecordEditParamsDataLongDirection = "E"
+ RecordEditParamsDataLongDirectionW RecordEditParamsDataLongDirection = "W"
+)
+
+type RecordEditParamsMeta struct {
+ // Will exist if Cloudflare automatically added this DNS record during initial
+ // setup.
+ AutoAdded param.Field[bool] `json:"auto_added"`
+ // Where the record originated from.
+ Source param.Field[string] `json:"source"`
+}
+
+func (r RecordEditParamsMeta) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
+// Value must be between 60 and 86400, with the minimum reduced to 30 for
+// Enterprise zones.
+//
+// Satisfied by [shared.UnionFloat], [dns.RecordEditParamsTTLNumber].
+type RecordEditParamsTTL interface {
+ ImplementsDNSRecordEditParamsTTL()
+}
+
+type RecordEditParamsTTLNumber float64
+
+const (
+ RecordEditParamsTTLNumber1 RecordEditParamsTTLNumber = 1
+)
+
+type RecordEditResponseEnvelope struct {
+ Errors []RecordEditResponseEnvelopeErrors `json:"errors,required"`
+ Messages []RecordEditResponseEnvelopeMessages `json:"messages,required"`
+ Result RecordEditResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success RecordEditResponseEnvelopeSuccess `json:"success,required"`
+ JSON recordEditResponseEnvelopeJSON `json:"-"`
+}
+
+// recordEditResponseEnvelopeJSON contains the JSON metadata for the struct
+// [RecordEditResponseEnvelope]
+type recordEditResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordEditResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordEditResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type RecordEditResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON recordEditResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// recordEditResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [RecordEditResponseEnvelopeErrors]
+type recordEditResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordEditResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type RecordEditResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON recordEditResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// recordEditResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [RecordEditResponseEnvelopeMessages]
+type recordEditResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordEditResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type RecordEditResponseEnvelopeSuccess bool
+
+const (
+ RecordEditResponseEnvelopeSuccessTrue RecordEditResponseEnvelopeSuccess = true
+)
+
+type RecordExportParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+}
+
+type RecordGetParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+}
+
+type RecordGetResponseEnvelope struct {
+ Errors []RecordGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []RecordGetResponseEnvelopeMessages `json:"messages,required"`
+ Result RecordGetResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success RecordGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON recordGetResponseEnvelopeJSON `json:"-"`
+}
+
+// recordGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [RecordGetResponseEnvelope]
+type recordGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type RecordGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON recordGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// recordGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [RecordGetResponseEnvelopeErrors]
+type recordGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type RecordGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON recordGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// recordGetResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [RecordGetResponseEnvelopeMessages]
+type recordGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type RecordGetResponseEnvelopeSuccess bool
+
+const (
+ RecordGetResponseEnvelopeSuccessTrue RecordGetResponseEnvelopeSuccess = true
+)
+
+type RecordImportParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+ // BIND config to import.
+ //
+ // **Tip:** When using cURL, a file can be uploaded using
+ // `--form 'file=@bind_config.txt'`.
+ File param.Field[string] `json:"file,required"`
+ // Whether or not proxiable records should receive the performance and security
+ // benefits of Cloudflare.
+ //
+ // The value should be either `true` or `false`.
+ Proxied param.Field[string] `json:"proxied"`
+}
+
+func (r RecordImportParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type RecordImportResponseEnvelope struct {
+ Errors []RecordImportResponseEnvelopeErrors `json:"errors,required"`
+ Messages []RecordImportResponseEnvelopeMessages `json:"messages,required"`
+ Result RecordImportResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success RecordImportResponseEnvelopeSuccess `json:"success,required"`
+ Timing RecordImportResponseEnvelopeTiming `json:"timing"`
+ JSON recordImportResponseEnvelopeJSON `json:"-"`
+}
+
+// recordImportResponseEnvelopeJSON contains the JSON metadata for the struct
+// [RecordImportResponseEnvelope]
+type recordImportResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ Timing apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordImportResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordImportResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type RecordImportResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON recordImportResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// recordImportResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [RecordImportResponseEnvelopeErrors]
+type recordImportResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordImportResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordImportResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type RecordImportResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON recordImportResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// recordImportResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [RecordImportResponseEnvelopeMessages]
+type recordImportResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordImportResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordImportResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type RecordImportResponseEnvelopeSuccess bool
+
+const (
+ RecordImportResponseEnvelopeSuccessTrue RecordImportResponseEnvelopeSuccess = true
+)
+
+type RecordImportResponseEnvelopeTiming struct {
+ // When the file parsing ended.
+ EndTime time.Time `json:"end_time" format:"date-time"`
+ // Processing time of the file in seconds.
+ ProcessTime float64 `json:"process_time"`
+ // When the file parsing started.
+ StartTime time.Time `json:"start_time" format:"date-time"`
+ JSON recordImportResponseEnvelopeTimingJSON `json:"-"`
+}
+
+// recordImportResponseEnvelopeTimingJSON contains the JSON metadata for the struct
+// [RecordImportResponseEnvelopeTiming]
+type recordImportResponseEnvelopeTimingJSON struct {
+ EndTime apijson.Field
+ ProcessTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordImportResponseEnvelopeTiming) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordImportResponseEnvelopeTimingJSON) RawJSON() string {
+ return r.raw
+}
+
+type RecordScanParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+}
+
+type RecordScanResponseEnvelope struct {
+ Errors []RecordScanResponseEnvelopeErrors `json:"errors,required"`
+ Messages []RecordScanResponseEnvelopeMessages `json:"messages,required"`
+ Result RecordScanResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success RecordScanResponseEnvelopeSuccess `json:"success,required"`
+ Timing RecordScanResponseEnvelopeTiming `json:"timing"`
+ JSON recordScanResponseEnvelopeJSON `json:"-"`
+}
+
+// recordScanResponseEnvelopeJSON contains the JSON metadata for the struct
+// [RecordScanResponseEnvelope]
+type recordScanResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ Timing apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordScanResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordScanResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type RecordScanResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON recordScanResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// recordScanResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [RecordScanResponseEnvelopeErrors]
+type recordScanResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordScanResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordScanResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type RecordScanResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON recordScanResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// recordScanResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [RecordScanResponseEnvelopeMessages]
+type recordScanResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordScanResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordScanResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type RecordScanResponseEnvelopeSuccess bool
+
+const (
+ RecordScanResponseEnvelopeSuccessTrue RecordScanResponseEnvelopeSuccess = true
+)
+
+type RecordScanResponseEnvelopeTiming struct {
+ // When the file parsing ended.
+ EndTime time.Time `json:"end_time" format:"date-time"`
+ // Processing time of the file in seconds.
+ ProcessTime float64 `json:"process_time"`
+ // When the file parsing started.
+ StartTime time.Time `json:"start_time" format:"date-time"`
+ JSON recordScanResponseEnvelopeTimingJSON `json:"-"`
+}
+
+// recordScanResponseEnvelopeTimingJSON contains the JSON metadata for the struct
+// [RecordScanResponseEnvelopeTiming]
+type recordScanResponseEnvelopeTimingJSON struct {
+ EndTime apijson.Field
+ ProcessTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecordScanResponseEnvelopeTiming) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recordScanResponseEnvelopeTimingJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/dns/record_test.go b/dns/record_test.go
new file mode 100644
index 00000000000..47dfd78fa09
--- /dev/null
+++ b/dns/record_test.go
@@ -0,0 +1,451 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package dns_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/dns"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestRecordNewWithOptionalParams(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"),
+ )
+ _, err := client.DNS.Records.New(context.TODO(), dns.RecordNewParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Name: cloudflare.F("example.com"),
+ Type: cloudflare.F(dns.RecordNewParamsTypeURI),
+ Comment: cloudflare.F("Domain verification record"),
+ Data: cloudflare.F(dns.RecordNewParamsData{
+ Flags: cloudflare.F("string"),
+ Tag: cloudflare.F("issue"),
+ Value: cloudflare.F("alpn=\"h3,h2\" ipv4hint=\"127.0.0.1\" ipv6hint=\"::1\""),
+ Algorithm: cloudflare.F(2.000000),
+ Certificate: cloudflare.F("string"),
+ KeyTag: cloudflare.F(1.000000),
+ Type: cloudflare.F(1.000000),
+ Protocol: cloudflare.F(3.000000),
+ PublicKey: cloudflare.F("string"),
+ Digest: cloudflare.F("string"),
+ DigestType: cloudflare.F(1.000000),
+ Priority: cloudflare.F(1.000000),
+ Target: cloudflare.F("."),
+ Altitude: cloudflare.F(0.000000),
+ LatDegrees: cloudflare.F(37.000000),
+ LatDirection: cloudflare.F(dns.RecordNewParamsDataLatDirectionN),
+ LatMinutes: cloudflare.F(46.000000),
+ LatSeconds: cloudflare.F(46.000000),
+ LongDegrees: cloudflare.F(122.000000),
+ LongDirection: cloudflare.F(dns.RecordNewParamsDataLongDirectionW),
+ LongMinutes: cloudflare.F(23.000000),
+ LongSeconds: cloudflare.F(35.000000),
+ PrecisionHorz: cloudflare.F(0.000000),
+ PrecisionVert: cloudflare.F(0.000000),
+ Size: cloudflare.F(100.000000),
+ Order: cloudflare.F(100.000000),
+ Preference: cloudflare.F(10.000000),
+ Regex: cloudflare.F("string"),
+ Replacement: cloudflare.F("string"),
+ Service: cloudflare.F("_sip"),
+ MatchingType: cloudflare.F(1.000000),
+ Selector: cloudflare.F(0.000000),
+ Usage: cloudflare.F(0.000000),
+ Name: cloudflare.F("example.com"),
+ Port: cloudflare.F(8806.000000),
+ Proto: cloudflare.F("_tcp"),
+ Weight: cloudflare.F(20.000000),
+ Fingerprint: cloudflare.F("string"),
+ Content: cloudflare.F("http://example.com/example.html"),
+ }),
+ Meta: cloudflare.F(dns.RecordNewParamsMeta{
+ AutoAdded: cloudflare.F(true),
+ Source: cloudflare.F("primary"),
+ }),
+ Priority: cloudflare.F(10.000000),
+ Proxied: cloudflare.F(false),
+ Tags: cloudflare.F([]string{"owner:dns-team", "owner:dns-team", "owner:dns-team"}),
+ TTL: cloudflare.F[dns.RecordNewParamsTTL](shared.UnionFloat(3600.000000)),
+ })
+ 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())
+ }
+}
+
+func TestRecordUpdateWithOptionalParams(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"),
+ )
+ _, err := client.DNS.Records.Update(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ dns.RecordUpdateParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Name: cloudflare.F("example.com"),
+ Type: cloudflare.F(dns.RecordUpdateParamsTypeURI),
+ Comment: cloudflare.F("Domain verification record"),
+ Data: cloudflare.F(dns.RecordUpdateParamsData{
+ Flags: cloudflare.F("string"),
+ Tag: cloudflare.F("issue"),
+ Value: cloudflare.F("alpn=\"h3,h2\" ipv4hint=\"127.0.0.1\" ipv6hint=\"::1\""),
+ Algorithm: cloudflare.F(2.000000),
+ Certificate: cloudflare.F("string"),
+ KeyTag: cloudflare.F(1.000000),
+ Type: cloudflare.F(1.000000),
+ Protocol: cloudflare.F(3.000000),
+ PublicKey: cloudflare.F("string"),
+ Digest: cloudflare.F("string"),
+ DigestType: cloudflare.F(1.000000),
+ Priority: cloudflare.F(1.000000),
+ Target: cloudflare.F("."),
+ Altitude: cloudflare.F(0.000000),
+ LatDegrees: cloudflare.F(37.000000),
+ LatDirection: cloudflare.F(dns.RecordUpdateParamsDataLatDirectionN),
+ LatMinutes: cloudflare.F(46.000000),
+ LatSeconds: cloudflare.F(46.000000),
+ LongDegrees: cloudflare.F(122.000000),
+ LongDirection: cloudflare.F(dns.RecordUpdateParamsDataLongDirectionW),
+ LongMinutes: cloudflare.F(23.000000),
+ LongSeconds: cloudflare.F(35.000000),
+ PrecisionHorz: cloudflare.F(0.000000),
+ PrecisionVert: cloudflare.F(0.000000),
+ Size: cloudflare.F(100.000000),
+ Order: cloudflare.F(100.000000),
+ Preference: cloudflare.F(10.000000),
+ Regex: cloudflare.F("string"),
+ Replacement: cloudflare.F("string"),
+ Service: cloudflare.F("_sip"),
+ MatchingType: cloudflare.F(1.000000),
+ Selector: cloudflare.F(0.000000),
+ Usage: cloudflare.F(0.000000),
+ Name: cloudflare.F("example.com"),
+ Port: cloudflare.F(8806.000000),
+ Proto: cloudflare.F("_tcp"),
+ Weight: cloudflare.F(20.000000),
+ Fingerprint: cloudflare.F("string"),
+ Content: cloudflare.F("http://example.com/example.html"),
+ }),
+ Meta: cloudflare.F(dns.RecordUpdateParamsMeta{
+ AutoAdded: cloudflare.F(true),
+ Source: cloudflare.F("primary"),
+ }),
+ Priority: cloudflare.F(10.000000),
+ Proxied: cloudflare.F(false),
+ Tags: cloudflare.F([]string{"owner:dns-team", "owner:dns-team", "owner:dns-team"}),
+ TTL: cloudflare.F[dns.RecordUpdateParamsTTL](shared.UnionFloat(3600.000000)),
+ },
+ )
+ 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())
+ }
+}
+
+func TestRecordListWithOptionalParams(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"),
+ )
+ _, err := client.DNS.Records.List(context.TODO(), dns.RecordListParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Comment: cloudflare.F(dns.RecordListParamsComment{
+ Present: cloudflare.F("string"),
+ Absent: cloudflare.F("string"),
+ Exact: cloudflare.F("Hello, world"),
+ Contains: cloudflare.F("ello, worl"),
+ Startswith: cloudflare.F("Hello, w"),
+ Endswith: cloudflare.F("o, world"),
+ }),
+ Content: cloudflare.F("127.0.0.1"),
+ Direction: cloudflare.F(dns.RecordListParamsDirectionAsc),
+ Match: cloudflare.F(dns.RecordListParamsMatchAny),
+ Name: cloudflare.F("example.com"),
+ Order: cloudflare.F(dns.RecordListParamsOrderType),
+ Page: cloudflare.F(1.000000),
+ PerPage: cloudflare.F(5.000000),
+ Proxied: cloudflare.F(false),
+ Search: cloudflare.F("www.cloudflare.com"),
+ Tag: cloudflare.F(dns.RecordListParamsTag{
+ Present: cloudflare.F("important"),
+ Absent: cloudflare.F("important"),
+ Exact: cloudflare.F("greeting:Hello, world"),
+ Contains: cloudflare.F("greeting:ello, worl"),
+ Startswith: cloudflare.F("greeting:Hello, w"),
+ Endswith: cloudflare.F("greeting:o, world"),
+ }),
+ TagMatch: cloudflare.F(dns.RecordListParamsTagMatchAny),
+ Type: cloudflare.F(dns.RecordListParamsTypeA),
+ })
+ 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())
+ }
+}
+
+func TestRecordDelete(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"),
+ )
+ _, err := client.DNS.Records.Delete(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ dns.RecordDeleteParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestRecordEditWithOptionalParams(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"),
+ )
+ _, err := client.DNS.Records.Edit(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ dns.RecordEditParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Name: cloudflare.F("example.com"),
+ Type: cloudflare.F(dns.RecordEditParamsTypeURI),
+ Comment: cloudflare.F("Domain verification record"),
+ Data: cloudflare.F(dns.RecordEditParamsData{
+ Flags: cloudflare.F("string"),
+ Tag: cloudflare.F("issue"),
+ Value: cloudflare.F("alpn=\"h3,h2\" ipv4hint=\"127.0.0.1\" ipv6hint=\"::1\""),
+ Algorithm: cloudflare.F(2.000000),
+ Certificate: cloudflare.F("string"),
+ KeyTag: cloudflare.F(1.000000),
+ Type: cloudflare.F(1.000000),
+ Protocol: cloudflare.F(3.000000),
+ PublicKey: cloudflare.F("string"),
+ Digest: cloudflare.F("string"),
+ DigestType: cloudflare.F(1.000000),
+ Priority: cloudflare.F(1.000000),
+ Target: cloudflare.F("."),
+ Altitude: cloudflare.F(0.000000),
+ LatDegrees: cloudflare.F(37.000000),
+ LatDirection: cloudflare.F(dns.RecordEditParamsDataLatDirectionN),
+ LatMinutes: cloudflare.F(46.000000),
+ LatSeconds: cloudflare.F(46.000000),
+ LongDegrees: cloudflare.F(122.000000),
+ LongDirection: cloudflare.F(dns.RecordEditParamsDataLongDirectionW),
+ LongMinutes: cloudflare.F(23.000000),
+ LongSeconds: cloudflare.F(35.000000),
+ PrecisionHorz: cloudflare.F(0.000000),
+ PrecisionVert: cloudflare.F(0.000000),
+ Size: cloudflare.F(100.000000),
+ Order: cloudflare.F(100.000000),
+ Preference: cloudflare.F(10.000000),
+ Regex: cloudflare.F("string"),
+ Replacement: cloudflare.F("string"),
+ Service: cloudflare.F("_sip"),
+ MatchingType: cloudflare.F(1.000000),
+ Selector: cloudflare.F(0.000000),
+ Usage: cloudflare.F(0.000000),
+ Name: cloudflare.F("example.com"),
+ Port: cloudflare.F(8806.000000),
+ Proto: cloudflare.F("_tcp"),
+ Weight: cloudflare.F(20.000000),
+ Fingerprint: cloudflare.F("string"),
+ Content: cloudflare.F("http://example.com/example.html"),
+ }),
+ Meta: cloudflare.F(dns.RecordEditParamsMeta{
+ AutoAdded: cloudflare.F(true),
+ Source: cloudflare.F("primary"),
+ }),
+ Priority: cloudflare.F(10.000000),
+ Proxied: cloudflare.F(false),
+ Tags: cloudflare.F([]string{"owner:dns-team", "owner:dns-team", "owner:dns-team"}),
+ TTL: cloudflare.F[dns.RecordEditParamsTTL](shared.UnionFloat(3600.000000)),
+ },
+ )
+ 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())
+ }
+}
+
+func TestRecordExport(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"),
+ )
+ _, err := client.DNS.Records.Export(context.TODO(), dns.RecordExportParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ })
+ 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())
+ }
+}
+
+func TestRecordGet(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"),
+ )
+ _, err := client.DNS.Records.Get(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ dns.RecordGetParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestRecordImportWithOptionalParams(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"),
+ )
+ _, err := client.DNS.Records.Import(context.TODO(), dns.RecordImportParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ File: cloudflare.F("www.example.com. 300 IN A 127.0.0.1"),
+ Proxied: cloudflare.F("true"),
+ })
+ 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())
+ }
+}
+
+func TestRecordScan(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"),
+ )
+ _, err := client.DNS.Records.Scan(context.TODO(), dns.RecordScanParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ })
+ 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/dnsanalytics.go b/dnsanalytics.go
deleted file mode 100644
index 88d9775adb2..00000000000
--- a/dnsanalytics.go
+++ /dev/null
@@ -1,27 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// DNSAnalyticsService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewDNSAnalyticsService] method
-// instead.
-type DNSAnalyticsService struct {
- Options []option.RequestOption
- Reports *DNSAnalyticsReportService
-}
-
-// NewDNSAnalyticsService generates a new service that applies the given options to
-// each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewDNSAnalyticsService(opts ...option.RequestOption) (r *DNSAnalyticsService) {
- r = &DNSAnalyticsService{}
- r.Options = opts
- r.Reports = NewDNSAnalyticsReportService(opts...)
- return
-}
diff --git a/dnsanalyticsreport.go b/dnsanalyticsreport.go
deleted file mode 100644
index ca3b5326718..00000000000
--- a/dnsanalyticsreport.go
+++ /dev/null
@@ -1,272 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// DNSAnalyticsReportService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewDNSAnalyticsReportService] method
-// instead.
-type DNSAnalyticsReportService struct {
- Options []option.RequestOption
- Bytimes *DNSAnalyticsReportBytimeService
-}
-
-// NewDNSAnalyticsReportService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewDNSAnalyticsReportService(opts ...option.RequestOption) (r *DNSAnalyticsReportService) {
- r = &DNSAnalyticsReportService{}
- r.Options = opts
- r.Bytimes = NewDNSAnalyticsReportBytimeService(opts...)
- return
-}
-
-// Retrieves a list of summarised aggregate metrics over a given time period.
-//
-// See
-// [Analytics API properties](https://developers.cloudflare.com/dns/reference/analytics-api-properties/)
-// for detailed information about the available query parameters.
-func (r *DNSAnalyticsReportService) Get(ctx context.Context, identifier string, query DNSAnalyticsReportGetParams, opts ...option.RequestOption) (res *DNSAnalyticsReportGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env DNSAnalyticsReportGetResponseEnvelope
- path := fmt.Sprintf("zones/%s/dns_analytics/report", identifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type DNSAnalyticsReportGetResponse struct {
- // Array with one row per combination of dimension values.
- Data []DNSAnalyticsReportGetResponseData `json:"data,required"`
- // Number of seconds between current time and last processed event, in another
- // words how many seconds of data could be missing.
- DataLag float64 `json:"data_lag,required"`
- // Maximum results for each metric (object mapping metric names to values).
- // Currently always an empty object.
- Max interface{} `json:"max,required"`
- // Minimum results for each metric (object mapping metric names to values).
- // Currently always an empty object.
- Min interface{} `json:"min,required"`
- Query DNSAnalyticsReportGetResponseQuery `json:"query,required"`
- // Total number of rows in the result.
- Rows float64 `json:"rows,required"`
- // Total results for metrics across all data (object mapping metric names to
- // values).
- Totals interface{} `json:"totals,required"`
- JSON dnsAnalyticsReportGetResponseJSON `json:"-"`
-}
-
-// dnsAnalyticsReportGetResponseJSON contains the JSON metadata for the struct
-// [DNSAnalyticsReportGetResponse]
-type dnsAnalyticsReportGetResponseJSON struct {
- Data apijson.Field
- DataLag apijson.Field
- Max apijson.Field
- Min apijson.Field
- Query apijson.Field
- Rows apijson.Field
- Totals apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSAnalyticsReportGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsAnalyticsReportGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type DNSAnalyticsReportGetResponseData struct {
- // Array of dimension values, representing the combination of dimension values
- // corresponding to this row.
- Dimensions []string `json:"dimensions,required"`
- // Array with one item per requested metric. Each item is a single value.
- Metrics []float64 `json:"metrics,required"`
- JSON dnsAnalyticsReportGetResponseDataJSON `json:"-"`
-}
-
-// dnsAnalyticsReportGetResponseDataJSON contains the JSON metadata for the struct
-// [DNSAnalyticsReportGetResponseData]
-type dnsAnalyticsReportGetResponseDataJSON struct {
- Dimensions apijson.Field
- Metrics apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSAnalyticsReportGetResponseData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsAnalyticsReportGetResponseDataJSON) RawJSON() string {
- return r.raw
-}
-
-type DNSAnalyticsReportGetResponseQuery struct {
- // Array of dimension names.
- Dimensions []string `json:"dimensions,required"`
- // Limit number of returned metrics.
- Limit int64 `json:"limit,required"`
- // Array of metric names.
- Metrics []string `json:"metrics,required"`
- // Start date and time of requesting data period in ISO 8601 format.
- Since time.Time `json:"since,required" format:"date-time"`
- // End date and time of requesting data period in ISO 8601 format.
- Until time.Time `json:"until,required" format:"date-time"`
- // Segmentation filter in 'attribute operator value' format.
- Filters string `json:"filters"`
- // Array of dimensions to sort by, where each dimension may be prefixed by -
- // (descending) or + (ascending).
- Sort []string `json:"sort"`
- JSON dnsAnalyticsReportGetResponseQueryJSON `json:"-"`
-}
-
-// dnsAnalyticsReportGetResponseQueryJSON contains the JSON metadata for the struct
-// [DNSAnalyticsReportGetResponseQuery]
-type dnsAnalyticsReportGetResponseQueryJSON struct {
- Dimensions apijson.Field
- Limit apijson.Field
- Metrics apijson.Field
- Since apijson.Field
- Until apijson.Field
- Filters apijson.Field
- Sort apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSAnalyticsReportGetResponseQuery) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsAnalyticsReportGetResponseQueryJSON) RawJSON() string {
- return r.raw
-}
-
-type DNSAnalyticsReportGetParams struct {
- // A comma-separated list of dimensions to group results by.
- Dimensions param.Field[string] `query:"dimensions"`
- // Segmentation filter in 'attribute operator value' format.
- Filters param.Field[string] `query:"filters"`
- // Limit number of returned metrics.
- Limit param.Field[int64] `query:"limit"`
- // A comma-separated list of metrics to query.
- Metrics param.Field[string] `query:"metrics"`
- // Start date and time of requesting data period in ISO 8601 format.
- Since param.Field[time.Time] `query:"since" format:"date-time"`
- // A comma-separated list of dimensions to sort by, where each dimension may be
- // prefixed by - (descending) or + (ascending).
- Sort param.Field[string] `query:"sort"`
- // End date and time of requesting data period in ISO 8601 format.
- Until param.Field[time.Time] `query:"until" format:"date-time"`
-}
-
-// URLQuery serializes [DNSAnalyticsReportGetParams]'s query parameters as
-// `url.Values`.
-func (r DNSAnalyticsReportGetParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type DNSAnalyticsReportGetResponseEnvelope struct {
- Errors []DNSAnalyticsReportGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []DNSAnalyticsReportGetResponseEnvelopeMessages `json:"messages,required"`
- Result DNSAnalyticsReportGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success DNSAnalyticsReportGetResponseEnvelopeSuccess `json:"success,required"`
- JSON dnsAnalyticsReportGetResponseEnvelopeJSON `json:"-"`
-}
-
-// dnsAnalyticsReportGetResponseEnvelopeJSON contains the JSON metadata for the
-// struct [DNSAnalyticsReportGetResponseEnvelope]
-type dnsAnalyticsReportGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSAnalyticsReportGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsAnalyticsReportGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type DNSAnalyticsReportGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON dnsAnalyticsReportGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// dnsAnalyticsReportGetResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [DNSAnalyticsReportGetResponseEnvelopeErrors]
-type dnsAnalyticsReportGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSAnalyticsReportGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsAnalyticsReportGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type DNSAnalyticsReportGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON dnsAnalyticsReportGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// dnsAnalyticsReportGetResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [DNSAnalyticsReportGetResponseEnvelopeMessages]
-type dnsAnalyticsReportGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSAnalyticsReportGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsAnalyticsReportGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type DNSAnalyticsReportGetResponseEnvelopeSuccess bool
-
-const (
- DNSAnalyticsReportGetResponseEnvelopeSuccessTrue DNSAnalyticsReportGetResponseEnvelopeSuccess = true
-)
diff --git a/dnsanalyticsreport_test.go b/dnsanalyticsreport_test.go
deleted file mode 100644
index af0a043f762..00000000000
--- a/dnsanalyticsreport_test.go
+++ /dev/null
@@ -1,51 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
- "time"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestDNSAnalyticsReportGetWithOptionalParams(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"),
- )
- _, err := client.DNS.Analytics.Reports.Get(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.DNSAnalyticsReportGetParams{
- Dimensions: cloudflare.F("queryType"),
- Filters: cloudflare.F("responseCode==NOERROR,queryType==A"),
- Limit: cloudflare.F(int64(100)),
- Metrics: cloudflare.F("queryCount,uncachedCount"),
- Since: cloudflare.F(time.Now()),
- Sort: cloudflare.F("+responseCode,-queryName"),
- Until: cloudflare.F(time.Now()),
- },
- )
- 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/dnsanalyticsreportbytime.go b/dnsanalyticsreportbytime.go
deleted file mode 100644
index a79157a7d65..00000000000
--- a/dnsanalyticsreportbytime.go
+++ /dev/null
@@ -1,312 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// DNSAnalyticsReportBytimeService contains methods and other services that help
-// with interacting with the cloudflare API. Note, unlike clients, this service
-// does not read variables from the environment automatically. You should not
-// instantiate this service directly, and instead use the
-// [NewDNSAnalyticsReportBytimeService] method instead.
-type DNSAnalyticsReportBytimeService struct {
- Options []option.RequestOption
-}
-
-// NewDNSAnalyticsReportBytimeService generates a new service that applies the
-// given options to each request. These options are applied after the parent
-// client's options (if there is one), and before any request-specific options.
-func NewDNSAnalyticsReportBytimeService(opts ...option.RequestOption) (r *DNSAnalyticsReportBytimeService) {
- r = &DNSAnalyticsReportBytimeService{}
- r.Options = opts
- return
-}
-
-// Retrieves a list of aggregate metrics grouped by time interval.
-//
-// See
-// [Analytics API properties](https://developers.cloudflare.com/dns/reference/analytics-api-properties/)
-// for detailed information about the available query parameters.
-func (r *DNSAnalyticsReportBytimeService) Get(ctx context.Context, identifier string, query DNSAnalyticsReportBytimeGetParams, opts ...option.RequestOption) (res *DNSAnalyticsReportBytimeGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env DNSAnalyticsReportBytimeGetResponseEnvelope
- path := fmt.Sprintf("zones/%s/dns_analytics/report/bytime", identifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type DNSAnalyticsReportBytimeGetResponse struct {
- // Array with one row per combination of dimension values.
- Data []DNSAnalyticsReportBytimeGetResponseData `json:"data,required"`
- // Number of seconds between current time and last processed event, in another
- // words how many seconds of data could be missing.
- DataLag float64 `json:"data_lag,required"`
- // Maximum results for each metric (object mapping metric names to values).
- // Currently always an empty object.
- Max interface{} `json:"max,required"`
- // Minimum results for each metric (object mapping metric names to values).
- // Currently always an empty object.
- Min interface{} `json:"min,required"`
- Query DNSAnalyticsReportBytimeGetResponseQuery `json:"query,required"`
- // Total number of rows in the result.
- Rows float64 `json:"rows,required"`
- // Array of time intervals in the response data. Each interval is represented as an
- // array containing two values: the start time, and the end time.
- TimeIntervals [][]time.Time `json:"time_intervals,required" format:"date-time"`
- // Total results for metrics across all data (object mapping metric names to
- // values).
- Totals interface{} `json:"totals,required"`
- JSON dnsAnalyticsReportBytimeGetResponseJSON `json:"-"`
-}
-
-// dnsAnalyticsReportBytimeGetResponseJSON contains the JSON metadata for the
-// struct [DNSAnalyticsReportBytimeGetResponse]
-type dnsAnalyticsReportBytimeGetResponseJSON struct {
- Data apijson.Field
- DataLag apijson.Field
- Max apijson.Field
- Min apijson.Field
- Query apijson.Field
- Rows apijson.Field
- TimeIntervals apijson.Field
- Totals apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSAnalyticsReportBytimeGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsAnalyticsReportBytimeGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type DNSAnalyticsReportBytimeGetResponseData struct {
- // Array of dimension values, representing the combination of dimension values
- // corresponding to this row.
- Dimensions []string `json:"dimensions,required"`
- // Array with one item per requested metric. Each item is an array of values,
- // broken down by time interval.
- Metrics [][]interface{} `json:"metrics,required"`
- JSON dnsAnalyticsReportBytimeGetResponseDataJSON `json:"-"`
-}
-
-// dnsAnalyticsReportBytimeGetResponseDataJSON contains the JSON metadata for the
-// struct [DNSAnalyticsReportBytimeGetResponseData]
-type dnsAnalyticsReportBytimeGetResponseDataJSON struct {
- Dimensions apijson.Field
- Metrics apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSAnalyticsReportBytimeGetResponseData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsAnalyticsReportBytimeGetResponseDataJSON) RawJSON() string {
- return r.raw
-}
-
-type DNSAnalyticsReportBytimeGetResponseQuery struct {
- // Array of dimension names.
- Dimensions []string `json:"dimensions,required"`
- // Limit number of returned metrics.
- Limit int64 `json:"limit,required"`
- // Array of metric names.
- Metrics []string `json:"metrics,required"`
- // Start date and time of requesting data period in ISO 8601 format.
- Since time.Time `json:"since,required" format:"date-time"`
- // Unit of time to group data by.
- TimeDelta DNSAnalyticsReportBytimeGetResponseQueryTimeDelta `json:"time_delta,required"`
- // End date and time of requesting data period in ISO 8601 format.
- Until time.Time `json:"until,required" format:"date-time"`
- // Segmentation filter in 'attribute operator value' format.
- Filters string `json:"filters"`
- // Array of dimensions to sort by, where each dimension may be prefixed by -
- // (descending) or + (ascending).
- Sort []string `json:"sort"`
- JSON dnsAnalyticsReportBytimeGetResponseQueryJSON `json:"-"`
-}
-
-// dnsAnalyticsReportBytimeGetResponseQueryJSON contains the JSON metadata for the
-// struct [DNSAnalyticsReportBytimeGetResponseQuery]
-type dnsAnalyticsReportBytimeGetResponseQueryJSON struct {
- Dimensions apijson.Field
- Limit apijson.Field
- Metrics apijson.Field
- Since apijson.Field
- TimeDelta apijson.Field
- Until apijson.Field
- Filters apijson.Field
- Sort apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSAnalyticsReportBytimeGetResponseQuery) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsAnalyticsReportBytimeGetResponseQueryJSON) RawJSON() string {
- return r.raw
-}
-
-// Unit of time to group data by.
-type DNSAnalyticsReportBytimeGetResponseQueryTimeDelta string
-
-const (
- DNSAnalyticsReportBytimeGetResponseQueryTimeDeltaAll DNSAnalyticsReportBytimeGetResponseQueryTimeDelta = "all"
- DNSAnalyticsReportBytimeGetResponseQueryTimeDeltaAuto DNSAnalyticsReportBytimeGetResponseQueryTimeDelta = "auto"
- DNSAnalyticsReportBytimeGetResponseQueryTimeDeltaYear DNSAnalyticsReportBytimeGetResponseQueryTimeDelta = "year"
- DNSAnalyticsReportBytimeGetResponseQueryTimeDeltaQuarter DNSAnalyticsReportBytimeGetResponseQueryTimeDelta = "quarter"
- DNSAnalyticsReportBytimeGetResponseQueryTimeDeltaMonth DNSAnalyticsReportBytimeGetResponseQueryTimeDelta = "month"
- DNSAnalyticsReportBytimeGetResponseQueryTimeDeltaWeek DNSAnalyticsReportBytimeGetResponseQueryTimeDelta = "week"
- DNSAnalyticsReportBytimeGetResponseQueryTimeDeltaDay DNSAnalyticsReportBytimeGetResponseQueryTimeDelta = "day"
- DNSAnalyticsReportBytimeGetResponseQueryTimeDeltaHour DNSAnalyticsReportBytimeGetResponseQueryTimeDelta = "hour"
- DNSAnalyticsReportBytimeGetResponseQueryTimeDeltaDekaminute DNSAnalyticsReportBytimeGetResponseQueryTimeDelta = "dekaminute"
- DNSAnalyticsReportBytimeGetResponseQueryTimeDeltaMinute DNSAnalyticsReportBytimeGetResponseQueryTimeDelta = "minute"
-)
-
-type DNSAnalyticsReportBytimeGetParams struct {
- // A comma-separated list of dimensions to group results by.
- Dimensions param.Field[string] `query:"dimensions"`
- // Segmentation filter in 'attribute operator value' format.
- Filters param.Field[string] `query:"filters"`
- // Limit number of returned metrics.
- Limit param.Field[int64] `query:"limit"`
- // A comma-separated list of metrics to query.
- Metrics param.Field[string] `query:"metrics"`
- // Start date and time of requesting data period in ISO 8601 format.
- Since param.Field[time.Time] `query:"since" format:"date-time"`
- // A comma-separated list of dimensions to sort by, where each dimension may be
- // prefixed by - (descending) or + (ascending).
- Sort param.Field[string] `query:"sort"`
- // Unit of time to group data by.
- TimeDelta param.Field[DNSAnalyticsReportBytimeGetParamsTimeDelta] `query:"time_delta"`
- // End date and time of requesting data period in ISO 8601 format.
- Until param.Field[time.Time] `query:"until" format:"date-time"`
-}
-
-// URLQuery serializes [DNSAnalyticsReportBytimeGetParams]'s query parameters as
-// `url.Values`.
-func (r DNSAnalyticsReportBytimeGetParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Unit of time to group data by.
-type DNSAnalyticsReportBytimeGetParamsTimeDelta string
-
-const (
- DNSAnalyticsReportBytimeGetParamsTimeDeltaAll DNSAnalyticsReportBytimeGetParamsTimeDelta = "all"
- DNSAnalyticsReportBytimeGetParamsTimeDeltaAuto DNSAnalyticsReportBytimeGetParamsTimeDelta = "auto"
- DNSAnalyticsReportBytimeGetParamsTimeDeltaYear DNSAnalyticsReportBytimeGetParamsTimeDelta = "year"
- DNSAnalyticsReportBytimeGetParamsTimeDeltaQuarter DNSAnalyticsReportBytimeGetParamsTimeDelta = "quarter"
- DNSAnalyticsReportBytimeGetParamsTimeDeltaMonth DNSAnalyticsReportBytimeGetParamsTimeDelta = "month"
- DNSAnalyticsReportBytimeGetParamsTimeDeltaWeek DNSAnalyticsReportBytimeGetParamsTimeDelta = "week"
- DNSAnalyticsReportBytimeGetParamsTimeDeltaDay DNSAnalyticsReportBytimeGetParamsTimeDelta = "day"
- DNSAnalyticsReportBytimeGetParamsTimeDeltaHour DNSAnalyticsReportBytimeGetParamsTimeDelta = "hour"
- DNSAnalyticsReportBytimeGetParamsTimeDeltaDekaminute DNSAnalyticsReportBytimeGetParamsTimeDelta = "dekaminute"
- DNSAnalyticsReportBytimeGetParamsTimeDeltaMinute DNSAnalyticsReportBytimeGetParamsTimeDelta = "minute"
-)
-
-type DNSAnalyticsReportBytimeGetResponseEnvelope struct {
- Errors []DNSAnalyticsReportBytimeGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []DNSAnalyticsReportBytimeGetResponseEnvelopeMessages `json:"messages,required"`
- Result DNSAnalyticsReportBytimeGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success DNSAnalyticsReportBytimeGetResponseEnvelopeSuccess `json:"success,required"`
- JSON dnsAnalyticsReportBytimeGetResponseEnvelopeJSON `json:"-"`
-}
-
-// dnsAnalyticsReportBytimeGetResponseEnvelopeJSON contains the JSON metadata for
-// the struct [DNSAnalyticsReportBytimeGetResponseEnvelope]
-type dnsAnalyticsReportBytimeGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSAnalyticsReportBytimeGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsAnalyticsReportBytimeGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type DNSAnalyticsReportBytimeGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON dnsAnalyticsReportBytimeGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// dnsAnalyticsReportBytimeGetResponseEnvelopeErrorsJSON contains the JSON metadata
-// for the struct [DNSAnalyticsReportBytimeGetResponseEnvelopeErrors]
-type dnsAnalyticsReportBytimeGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSAnalyticsReportBytimeGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsAnalyticsReportBytimeGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type DNSAnalyticsReportBytimeGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON dnsAnalyticsReportBytimeGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// dnsAnalyticsReportBytimeGetResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct [DNSAnalyticsReportBytimeGetResponseEnvelopeMessages]
-type dnsAnalyticsReportBytimeGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSAnalyticsReportBytimeGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsAnalyticsReportBytimeGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type DNSAnalyticsReportBytimeGetResponseEnvelopeSuccess bool
-
-const (
- DNSAnalyticsReportBytimeGetResponseEnvelopeSuccessTrue DNSAnalyticsReportBytimeGetResponseEnvelopeSuccess = true
-)
diff --git a/dnsanalyticsreportbytime_test.go b/dnsanalyticsreportbytime_test.go
deleted file mode 100644
index c55b1dcbc88..00000000000
--- a/dnsanalyticsreportbytime_test.go
+++ /dev/null
@@ -1,52 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
- "time"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestDNSAnalyticsReportBytimeGetWithOptionalParams(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"),
- )
- _, err := client.DNS.Analytics.Reports.Bytimes.Get(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.DNSAnalyticsReportBytimeGetParams{
- Dimensions: cloudflare.F("queryType"),
- Filters: cloudflare.F("responseCode==NOERROR,queryType==A"),
- Limit: cloudflare.F(int64(100)),
- Metrics: cloudflare.F("queryCount,uncachedCount"),
- Since: cloudflare.F(time.Now()),
- Sort: cloudflare.F("+responseCode,-queryName"),
- TimeDelta: cloudflare.F(cloudflare.DNSAnalyticsReportBytimeGetParamsTimeDeltaHour),
- Until: cloudflare.F(time.Now()),
- },
- )
- 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/dnsfirewall.go b/dnsfirewall.go
deleted file mode 100644
index 2e456b38749..00000000000
--- a/dnsfirewall.go
+++ /dev/null
@@ -1,1144 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
- "reflect"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/option"
- "github.com/tidwall/gjson"
-)
-
-// DNSFirewallService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewDNSFirewallService] method
-// instead.
-type DNSFirewallService struct {
- Options []option.RequestOption
- Analytics *DNSFirewallAnalyticsService
-}
-
-// NewDNSFirewallService generates a new service that applies the given options to
-// each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewDNSFirewallService(opts ...option.RequestOption) (r *DNSFirewallService) {
- r = &DNSFirewallService{}
- r.Options = opts
- r.Analytics = NewDNSFirewallAnalyticsService(opts...)
- return
-}
-
-// Create a configured DNS Firewall Cluster.
-func (r *DNSFirewallService) New(ctx context.Context, params DNSFirewallNewParams, opts ...option.RequestOption) (res *DNSFirewallNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env DNSFirewallNewResponseEnvelope
- path := fmt.Sprintf("accounts/%s/dns_firewall", params.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// List configured DNS Firewall clusters for an account.
-func (r *DNSFirewallService) List(ctx context.Context, params DNSFirewallListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[DNSFirewallListResponse], err error) {
- var raw *http.Response
- opts = append(r.Options, opts...)
- opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
- path := fmt.Sprintf("accounts/%s/dns_firewall", params.AccountID)
- cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, params, &res, opts...)
- if err != nil {
- return nil, err
- }
- err = cfg.Execute()
- if err != nil {
- return nil, err
- }
- res.SetPageConfig(cfg, raw)
- return res, nil
-}
-
-// List configured DNS Firewall clusters for an account.
-func (r *DNSFirewallService) ListAutoPaging(ctx context.Context, params DNSFirewallListParams, opts ...option.RequestOption) *shared.V4PagePaginationArrayAutoPager[DNSFirewallListResponse] {
- return shared.NewV4PagePaginationArrayAutoPager(r.List(ctx, params, opts...))
-}
-
-// Delete a configured DNS Firewall Cluster.
-func (r *DNSFirewallService) Delete(ctx context.Context, dnsFirewallID string, body DNSFirewallDeleteParams, opts ...option.RequestOption) (res *DNSFirewallDeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env DNSFirewallDeleteResponseEnvelope
- path := fmt.Sprintf("accounts/%s/dns_firewall/%s", body.AccountID, dnsFirewallID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Modify a DNS Firewall Cluster configuration.
-func (r *DNSFirewallService) Edit(ctx context.Context, dnsFirewallID string, params DNSFirewallEditParams, opts ...option.RequestOption) (res *DNSFirewallEditResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env DNSFirewallEditResponseEnvelope
- path := fmt.Sprintf("accounts/%s/dns_firewall/%s", params.AccountID, dnsFirewallID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Show a single configured DNS Firewall cluster for an account.
-func (r *DNSFirewallService) Get(ctx context.Context, dnsFirewallID string, query DNSFirewallGetParams, opts ...option.RequestOption) (res *DNSFirewallGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env DNSFirewallGetResponseEnvelope
- path := fmt.Sprintf("accounts/%s/dns_firewall/%s", query.AccountID, dnsFirewallID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type DNSFirewallNewResponse struct {
- // Identifier
- ID string `json:"id,required"`
- // Deprecate the response to ANY requests.
- DeprecateAnyRequests bool `json:"deprecate_any_requests,required"`
- DNSFirewallIPs []DNSFirewallNewResponseDNSFirewallIP `json:"dns_firewall_ips,required" format:"ipv4"`
- // Forward client IP (resolver) subnet if no EDNS Client Subnet is sent.
- EcsFallback bool `json:"ecs_fallback,required"`
- // Maximum DNS Cache TTL.
- MaximumCacheTTL float64 `json:"maximum_cache_ttl,required"`
- // Minimum DNS Cache TTL.
- MinimumCacheTTL float64 `json:"minimum_cache_ttl,required"`
- // Last modification of DNS Firewall cluster.
- ModifiedOn time.Time `json:"modified_on,required" format:"date-time"`
- // DNS Firewall Cluster Name.
- Name string `json:"name,required"`
- UpstreamIPs []DNSFirewallNewResponseUpstreamIP `json:"upstream_ips,required" format:"ipv4"`
- // Attack mitigation settings.
- AttackMitigation DNSFirewallNewResponseAttackMitigation `json:"attack_mitigation,nullable"`
- // Negative DNS Cache TTL.
- NegativeCacheTTL float64 `json:"negative_cache_ttl,nullable"`
- // Deprecated alias for "upstream_ips".
- OriginIPs interface{} `json:"origin_ips"`
- // Ratelimit in queries per second per datacenter (applies to DNS queries sent to
- // the upstream nameservers configured on the cluster).
- Ratelimit float64 `json:"ratelimit,nullable"`
- // Number of retries for fetching DNS responses from upstream nameservers (not
- // counting the initial attempt).
- Retries float64 `json:"retries"`
- JSON dnsFirewallNewResponseJSON `json:"-"`
-}
-
-// dnsFirewallNewResponseJSON contains the JSON metadata for the struct
-// [DNSFirewallNewResponse]
-type dnsFirewallNewResponseJSON struct {
- ID apijson.Field
- DeprecateAnyRequests apijson.Field
- DNSFirewallIPs apijson.Field
- EcsFallback apijson.Field
- MaximumCacheTTL apijson.Field
- MinimumCacheTTL apijson.Field
- ModifiedOn apijson.Field
- Name apijson.Field
- UpstreamIPs apijson.Field
- AttackMitigation apijson.Field
- NegativeCacheTTL apijson.Field
- OriginIPs apijson.Field
- Ratelimit apijson.Field
- Retries apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSFirewallNewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsFirewallNewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// Cloudflare-assigned DNS IPv4 Address.
-//
-// Union satisfied by [shared.UnionString] or [shared.UnionString].
-type DNSFirewallNewResponseDNSFirewallIP interface {
- ImplementsDNSFirewallNewResponseDNSFirewallIP()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSFirewallNewResponseDNSFirewallIP)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-// Upstream DNS Server IPv4 Address.
-//
-// Union satisfied by [shared.UnionString] or [shared.UnionString].
-type DNSFirewallNewResponseUpstreamIP interface {
- ImplementsDNSFirewallNewResponseUpstreamIP()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSFirewallNewResponseUpstreamIP)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-// Attack mitigation settings.
-type DNSFirewallNewResponseAttackMitigation struct {
- // When enabled, random-prefix attacks are automatically mitigated and the upstream
- // DNS servers protected.
- Enabled bool `json:"enabled"`
- // Deprecated alias for "only_when_upstream_unhealthy".
- OnlyWhenOriginUnhealthy interface{} `json:"only_when_origin_unhealthy"`
- // Only mitigate attacks when upstream servers seem unhealthy.
- OnlyWhenUpstreamUnhealthy bool `json:"only_when_upstream_unhealthy"`
- JSON dnsFirewallNewResponseAttackMitigationJSON `json:"-"`
-}
-
-// dnsFirewallNewResponseAttackMitigationJSON contains the JSON metadata for the
-// struct [DNSFirewallNewResponseAttackMitigation]
-type dnsFirewallNewResponseAttackMitigationJSON struct {
- Enabled apijson.Field
- OnlyWhenOriginUnhealthy apijson.Field
- OnlyWhenUpstreamUnhealthy apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSFirewallNewResponseAttackMitigation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsFirewallNewResponseAttackMitigationJSON) RawJSON() string {
- return r.raw
-}
-
-type DNSFirewallListResponse struct {
- // Identifier
- ID string `json:"id,required"`
- // Deprecate the response to ANY requests.
- DeprecateAnyRequests bool `json:"deprecate_any_requests,required"`
- DNSFirewallIPs []DNSFirewallListResponseDNSFirewallIP `json:"dns_firewall_ips,required" format:"ipv4"`
- // Forward client IP (resolver) subnet if no EDNS Client Subnet is sent.
- EcsFallback bool `json:"ecs_fallback,required"`
- // Maximum DNS Cache TTL.
- MaximumCacheTTL float64 `json:"maximum_cache_ttl,required"`
- // Minimum DNS Cache TTL.
- MinimumCacheTTL float64 `json:"minimum_cache_ttl,required"`
- // Last modification of DNS Firewall cluster.
- ModifiedOn time.Time `json:"modified_on,required" format:"date-time"`
- // DNS Firewall Cluster Name.
- Name string `json:"name,required"`
- UpstreamIPs []DNSFirewallListResponseUpstreamIP `json:"upstream_ips,required" format:"ipv4"`
- // Attack mitigation settings.
- AttackMitigation DNSFirewallListResponseAttackMitigation `json:"attack_mitigation,nullable"`
- // Negative DNS Cache TTL.
- NegativeCacheTTL float64 `json:"negative_cache_ttl,nullable"`
- // Deprecated alias for "upstream_ips".
- OriginIPs interface{} `json:"origin_ips"`
- // Ratelimit in queries per second per datacenter (applies to DNS queries sent to
- // the upstream nameservers configured on the cluster).
- Ratelimit float64 `json:"ratelimit,nullable"`
- // Number of retries for fetching DNS responses from upstream nameservers (not
- // counting the initial attempt).
- Retries float64 `json:"retries"`
- JSON dnsFirewallListResponseJSON `json:"-"`
-}
-
-// dnsFirewallListResponseJSON contains the JSON metadata for the struct
-// [DNSFirewallListResponse]
-type dnsFirewallListResponseJSON struct {
- ID apijson.Field
- DeprecateAnyRequests apijson.Field
- DNSFirewallIPs apijson.Field
- EcsFallback apijson.Field
- MaximumCacheTTL apijson.Field
- MinimumCacheTTL apijson.Field
- ModifiedOn apijson.Field
- Name apijson.Field
- UpstreamIPs apijson.Field
- AttackMitigation apijson.Field
- NegativeCacheTTL apijson.Field
- OriginIPs apijson.Field
- Ratelimit apijson.Field
- Retries apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSFirewallListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsFirewallListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// Cloudflare-assigned DNS IPv4 Address.
-//
-// Union satisfied by [shared.UnionString] or [shared.UnionString].
-type DNSFirewallListResponseDNSFirewallIP interface {
- ImplementsDNSFirewallListResponseDNSFirewallIP()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSFirewallListResponseDNSFirewallIP)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-// Upstream DNS Server IPv4 Address.
-//
-// Union satisfied by [shared.UnionString] or [shared.UnionString].
-type DNSFirewallListResponseUpstreamIP interface {
- ImplementsDNSFirewallListResponseUpstreamIP()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSFirewallListResponseUpstreamIP)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-// Attack mitigation settings.
-type DNSFirewallListResponseAttackMitigation struct {
- // When enabled, random-prefix attacks are automatically mitigated and the upstream
- // DNS servers protected.
- Enabled bool `json:"enabled"`
- // Deprecated alias for "only_when_upstream_unhealthy".
- OnlyWhenOriginUnhealthy interface{} `json:"only_when_origin_unhealthy"`
- // Only mitigate attacks when upstream servers seem unhealthy.
- OnlyWhenUpstreamUnhealthy bool `json:"only_when_upstream_unhealthy"`
- JSON dnsFirewallListResponseAttackMitigationJSON `json:"-"`
-}
-
-// dnsFirewallListResponseAttackMitigationJSON contains the JSON metadata for the
-// struct [DNSFirewallListResponseAttackMitigation]
-type dnsFirewallListResponseAttackMitigationJSON struct {
- Enabled apijson.Field
- OnlyWhenOriginUnhealthy apijson.Field
- OnlyWhenUpstreamUnhealthy apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSFirewallListResponseAttackMitigation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsFirewallListResponseAttackMitigationJSON) RawJSON() string {
- return r.raw
-}
-
-type DNSFirewallDeleteResponse struct {
- // Identifier
- ID string `json:"id"`
- JSON dnsFirewallDeleteResponseJSON `json:"-"`
-}
-
-// dnsFirewallDeleteResponseJSON contains the JSON metadata for the struct
-// [DNSFirewallDeleteResponse]
-type dnsFirewallDeleteResponseJSON struct {
- ID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSFirewallDeleteResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsFirewallDeleteResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type DNSFirewallEditResponse struct {
- // Identifier
- ID string `json:"id,required"`
- // Deprecate the response to ANY requests.
- DeprecateAnyRequests bool `json:"deprecate_any_requests,required"`
- DNSFirewallIPs []DNSFirewallEditResponseDNSFirewallIP `json:"dns_firewall_ips,required" format:"ipv4"`
- // Forward client IP (resolver) subnet if no EDNS Client Subnet is sent.
- EcsFallback bool `json:"ecs_fallback,required"`
- // Maximum DNS Cache TTL.
- MaximumCacheTTL float64 `json:"maximum_cache_ttl,required"`
- // Minimum DNS Cache TTL.
- MinimumCacheTTL float64 `json:"minimum_cache_ttl,required"`
- // Last modification of DNS Firewall cluster.
- ModifiedOn time.Time `json:"modified_on,required" format:"date-time"`
- // DNS Firewall Cluster Name.
- Name string `json:"name,required"`
- UpstreamIPs []DNSFirewallEditResponseUpstreamIP `json:"upstream_ips,required" format:"ipv4"`
- // Attack mitigation settings.
- AttackMitigation DNSFirewallEditResponseAttackMitigation `json:"attack_mitigation,nullable"`
- // Negative DNS Cache TTL.
- NegativeCacheTTL float64 `json:"negative_cache_ttl,nullable"`
- // Deprecated alias for "upstream_ips".
- OriginIPs interface{} `json:"origin_ips"`
- // Ratelimit in queries per second per datacenter (applies to DNS queries sent to
- // the upstream nameservers configured on the cluster).
- Ratelimit float64 `json:"ratelimit,nullable"`
- // Number of retries for fetching DNS responses from upstream nameservers (not
- // counting the initial attempt).
- Retries float64 `json:"retries"`
- JSON dnsFirewallEditResponseJSON `json:"-"`
-}
-
-// dnsFirewallEditResponseJSON contains the JSON metadata for the struct
-// [DNSFirewallEditResponse]
-type dnsFirewallEditResponseJSON struct {
- ID apijson.Field
- DeprecateAnyRequests apijson.Field
- DNSFirewallIPs apijson.Field
- EcsFallback apijson.Field
- MaximumCacheTTL apijson.Field
- MinimumCacheTTL apijson.Field
- ModifiedOn apijson.Field
- Name apijson.Field
- UpstreamIPs apijson.Field
- AttackMitigation apijson.Field
- NegativeCacheTTL apijson.Field
- OriginIPs apijson.Field
- Ratelimit apijson.Field
- Retries apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSFirewallEditResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsFirewallEditResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// Cloudflare-assigned DNS IPv4 Address.
-//
-// Union satisfied by [shared.UnionString] or [shared.UnionString].
-type DNSFirewallEditResponseDNSFirewallIP interface {
- ImplementsDNSFirewallEditResponseDNSFirewallIP()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSFirewallEditResponseDNSFirewallIP)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-// Upstream DNS Server IPv4 Address.
-//
-// Union satisfied by [shared.UnionString] or [shared.UnionString].
-type DNSFirewallEditResponseUpstreamIP interface {
- ImplementsDNSFirewallEditResponseUpstreamIP()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSFirewallEditResponseUpstreamIP)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-// Attack mitigation settings.
-type DNSFirewallEditResponseAttackMitigation struct {
- // When enabled, random-prefix attacks are automatically mitigated and the upstream
- // DNS servers protected.
- Enabled bool `json:"enabled"`
- // Deprecated alias for "only_when_upstream_unhealthy".
- OnlyWhenOriginUnhealthy interface{} `json:"only_when_origin_unhealthy"`
- // Only mitigate attacks when upstream servers seem unhealthy.
- OnlyWhenUpstreamUnhealthy bool `json:"only_when_upstream_unhealthy"`
- JSON dnsFirewallEditResponseAttackMitigationJSON `json:"-"`
-}
-
-// dnsFirewallEditResponseAttackMitigationJSON contains the JSON metadata for the
-// struct [DNSFirewallEditResponseAttackMitigation]
-type dnsFirewallEditResponseAttackMitigationJSON struct {
- Enabled apijson.Field
- OnlyWhenOriginUnhealthy apijson.Field
- OnlyWhenUpstreamUnhealthy apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSFirewallEditResponseAttackMitigation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsFirewallEditResponseAttackMitigationJSON) RawJSON() string {
- return r.raw
-}
-
-type DNSFirewallGetResponse struct {
- // Identifier
- ID string `json:"id,required"`
- // Deprecate the response to ANY requests.
- DeprecateAnyRequests bool `json:"deprecate_any_requests,required"`
- DNSFirewallIPs []DNSFirewallGetResponseDNSFirewallIP `json:"dns_firewall_ips,required" format:"ipv4"`
- // Forward client IP (resolver) subnet if no EDNS Client Subnet is sent.
- EcsFallback bool `json:"ecs_fallback,required"`
- // Maximum DNS Cache TTL.
- MaximumCacheTTL float64 `json:"maximum_cache_ttl,required"`
- // Minimum DNS Cache TTL.
- MinimumCacheTTL float64 `json:"minimum_cache_ttl,required"`
- // Last modification of DNS Firewall cluster.
- ModifiedOn time.Time `json:"modified_on,required" format:"date-time"`
- // DNS Firewall Cluster Name.
- Name string `json:"name,required"`
- UpstreamIPs []DNSFirewallGetResponseUpstreamIP `json:"upstream_ips,required" format:"ipv4"`
- // Attack mitigation settings.
- AttackMitigation DNSFirewallGetResponseAttackMitigation `json:"attack_mitigation,nullable"`
- // Negative DNS Cache TTL.
- NegativeCacheTTL float64 `json:"negative_cache_ttl,nullable"`
- // Deprecated alias for "upstream_ips".
- OriginIPs interface{} `json:"origin_ips"`
- // Ratelimit in queries per second per datacenter (applies to DNS queries sent to
- // the upstream nameservers configured on the cluster).
- Ratelimit float64 `json:"ratelimit,nullable"`
- // Number of retries for fetching DNS responses from upstream nameservers (not
- // counting the initial attempt).
- Retries float64 `json:"retries"`
- JSON dnsFirewallGetResponseJSON `json:"-"`
-}
-
-// dnsFirewallGetResponseJSON contains the JSON metadata for the struct
-// [DNSFirewallGetResponse]
-type dnsFirewallGetResponseJSON struct {
- ID apijson.Field
- DeprecateAnyRequests apijson.Field
- DNSFirewallIPs apijson.Field
- EcsFallback apijson.Field
- MaximumCacheTTL apijson.Field
- MinimumCacheTTL apijson.Field
- ModifiedOn apijson.Field
- Name apijson.Field
- UpstreamIPs apijson.Field
- AttackMitigation apijson.Field
- NegativeCacheTTL apijson.Field
- OriginIPs apijson.Field
- Ratelimit apijson.Field
- Retries apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSFirewallGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsFirewallGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// Cloudflare-assigned DNS IPv4 Address.
-//
-// Union satisfied by [shared.UnionString] or [shared.UnionString].
-type DNSFirewallGetResponseDNSFirewallIP interface {
- ImplementsDNSFirewallGetResponseDNSFirewallIP()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSFirewallGetResponseDNSFirewallIP)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-// Upstream DNS Server IPv4 Address.
-//
-// Union satisfied by [shared.UnionString] or [shared.UnionString].
-type DNSFirewallGetResponseUpstreamIP interface {
- ImplementsDNSFirewallGetResponseUpstreamIP()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSFirewallGetResponseUpstreamIP)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-// Attack mitigation settings.
-type DNSFirewallGetResponseAttackMitigation struct {
- // When enabled, random-prefix attacks are automatically mitigated and the upstream
- // DNS servers protected.
- Enabled bool `json:"enabled"`
- // Deprecated alias for "only_when_upstream_unhealthy".
- OnlyWhenOriginUnhealthy interface{} `json:"only_when_origin_unhealthy"`
- // Only mitigate attacks when upstream servers seem unhealthy.
- OnlyWhenUpstreamUnhealthy bool `json:"only_when_upstream_unhealthy"`
- JSON dnsFirewallGetResponseAttackMitigationJSON `json:"-"`
-}
-
-// dnsFirewallGetResponseAttackMitigationJSON contains the JSON metadata for the
-// struct [DNSFirewallGetResponseAttackMitigation]
-type dnsFirewallGetResponseAttackMitigationJSON struct {
- Enabled apijson.Field
- OnlyWhenOriginUnhealthy apijson.Field
- OnlyWhenUpstreamUnhealthy apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSFirewallGetResponseAttackMitigation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsFirewallGetResponseAttackMitigationJSON) RawJSON() string {
- return r.raw
-}
-
-type DNSFirewallNewParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
- // DNS Firewall Cluster Name.
- Name param.Field[string] `json:"name,required"`
- UpstreamIPs param.Field[[]DNSFirewallNewParamsUpstreamIP] `json:"upstream_ips,required" format:"ipv4"`
- // Attack mitigation settings.
- AttackMitigation param.Field[DNSFirewallNewParamsAttackMitigation] `json:"attack_mitigation"`
- // Deprecate the response to ANY requests.
- DeprecateAnyRequests param.Field[bool] `json:"deprecate_any_requests"`
- // Forward client IP (resolver) subnet if no EDNS Client Subnet is sent.
- EcsFallback param.Field[bool] `json:"ecs_fallback"`
- // Maximum DNS Cache TTL.
- MaximumCacheTTL param.Field[float64] `json:"maximum_cache_ttl"`
- // Minimum DNS Cache TTL.
- MinimumCacheTTL param.Field[float64] `json:"minimum_cache_ttl"`
- // Negative DNS Cache TTL.
- NegativeCacheTTL param.Field[float64] `json:"negative_cache_ttl"`
- // Deprecated alias for "upstream_ips".
- OriginIPs param.Field[interface{}] `json:"origin_ips"`
- // Ratelimit in queries per second per datacenter (applies to DNS queries sent to
- // the upstream nameservers configured on the cluster).
- Ratelimit param.Field[float64] `json:"ratelimit"`
- // Number of retries for fetching DNS responses from upstream nameservers (not
- // counting the initial attempt).
- Retries param.Field[float64] `json:"retries"`
-}
-
-func (r DNSFirewallNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Upstream DNS Server IPv4 Address.
-//
-// Satisfied by [shared.UnionString], [shared.UnionString].
-type DNSFirewallNewParamsUpstreamIP interface {
- ImplementsDNSFirewallNewParamsUpstreamIP()
-}
-
-// Attack mitigation settings.
-type DNSFirewallNewParamsAttackMitigation struct {
- // When enabled, random-prefix attacks are automatically mitigated and the upstream
- // DNS servers protected.
- Enabled param.Field[bool] `json:"enabled"`
- // Deprecated alias for "only_when_upstream_unhealthy".
- OnlyWhenOriginUnhealthy param.Field[interface{}] `json:"only_when_origin_unhealthy"`
- // Only mitigate attacks when upstream servers seem unhealthy.
- OnlyWhenUpstreamUnhealthy param.Field[bool] `json:"only_when_upstream_unhealthy"`
-}
-
-func (r DNSFirewallNewParamsAttackMitigation) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type DNSFirewallNewResponseEnvelope struct {
- Errors []DNSFirewallNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []DNSFirewallNewResponseEnvelopeMessages `json:"messages,required"`
- Result DNSFirewallNewResponse `json:"result,required"`
- // Whether the API call was successful
- Success DNSFirewallNewResponseEnvelopeSuccess `json:"success,required"`
- JSON dnsFirewallNewResponseEnvelopeJSON `json:"-"`
-}
-
-// dnsFirewallNewResponseEnvelopeJSON contains the JSON metadata for the struct
-// [DNSFirewallNewResponseEnvelope]
-type dnsFirewallNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSFirewallNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsFirewallNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type DNSFirewallNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON dnsFirewallNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// dnsFirewallNewResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [DNSFirewallNewResponseEnvelopeErrors]
-type dnsFirewallNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSFirewallNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsFirewallNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type DNSFirewallNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON dnsFirewallNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// dnsFirewallNewResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [DNSFirewallNewResponseEnvelopeMessages]
-type dnsFirewallNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSFirewallNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsFirewallNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type DNSFirewallNewResponseEnvelopeSuccess bool
-
-const (
- DNSFirewallNewResponseEnvelopeSuccessTrue DNSFirewallNewResponseEnvelopeSuccess = true
-)
-
-type DNSFirewallListParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
- // Page number of paginated results.
- Page param.Field[float64] `query:"page"`
- // Number of clusters per page.
- PerPage param.Field[float64] `query:"per_page"`
-}
-
-// URLQuery serializes [DNSFirewallListParams]'s query parameters as `url.Values`.
-func (r DNSFirewallListParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type DNSFirewallDeleteParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type DNSFirewallDeleteResponseEnvelope struct {
- Errors []DNSFirewallDeleteResponseEnvelopeErrors `json:"errors,required"`
- Messages []DNSFirewallDeleteResponseEnvelopeMessages `json:"messages,required"`
- Result DNSFirewallDeleteResponse `json:"result,required"`
- // Whether the API call was successful
- Success DNSFirewallDeleteResponseEnvelopeSuccess `json:"success,required"`
- JSON dnsFirewallDeleteResponseEnvelopeJSON `json:"-"`
-}
-
-// dnsFirewallDeleteResponseEnvelopeJSON contains the JSON metadata for the struct
-// [DNSFirewallDeleteResponseEnvelope]
-type dnsFirewallDeleteResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSFirewallDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsFirewallDeleteResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type DNSFirewallDeleteResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON dnsFirewallDeleteResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// dnsFirewallDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [DNSFirewallDeleteResponseEnvelopeErrors]
-type dnsFirewallDeleteResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSFirewallDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsFirewallDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type DNSFirewallDeleteResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON dnsFirewallDeleteResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// dnsFirewallDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [DNSFirewallDeleteResponseEnvelopeMessages]
-type dnsFirewallDeleteResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSFirewallDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsFirewallDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type DNSFirewallDeleteResponseEnvelopeSuccess bool
-
-const (
- DNSFirewallDeleteResponseEnvelopeSuccessTrue DNSFirewallDeleteResponseEnvelopeSuccess = true
-)
-
-type DNSFirewallEditParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
- // Deprecate the response to ANY requests.
- DeprecateAnyRequests param.Field[bool] `json:"deprecate_any_requests,required"`
- DNSFirewallIPs param.Field[[]DNSFirewallEditParamsDNSFirewallIP] `json:"dns_firewall_ips,required" format:"ipv4"`
- // Forward client IP (resolver) subnet if no EDNS Client Subnet is sent.
- EcsFallback param.Field[bool] `json:"ecs_fallback,required"`
- // Maximum DNS Cache TTL.
- MaximumCacheTTL param.Field[float64] `json:"maximum_cache_ttl,required"`
- // Minimum DNS Cache TTL.
- MinimumCacheTTL param.Field[float64] `json:"minimum_cache_ttl,required"`
- // DNS Firewall Cluster Name.
- Name param.Field[string] `json:"name,required"`
- UpstreamIPs param.Field[[]DNSFirewallEditParamsUpstreamIP] `json:"upstream_ips,required" format:"ipv4"`
- // Attack mitigation settings.
- AttackMitigation param.Field[DNSFirewallEditParamsAttackMitigation] `json:"attack_mitigation"`
- // Negative DNS Cache TTL.
- NegativeCacheTTL param.Field[float64] `json:"negative_cache_ttl"`
- // Deprecated alias for "upstream_ips".
- OriginIPs param.Field[interface{}] `json:"origin_ips"`
- // Ratelimit in queries per second per datacenter (applies to DNS queries sent to
- // the upstream nameservers configured on the cluster).
- Ratelimit param.Field[float64] `json:"ratelimit"`
- // Number of retries for fetching DNS responses from upstream nameservers (not
- // counting the initial attempt).
- Retries param.Field[float64] `json:"retries"`
-}
-
-func (r DNSFirewallEditParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Cloudflare-assigned DNS IPv4 Address.
-//
-// Satisfied by [shared.UnionString], [shared.UnionString].
-type DNSFirewallEditParamsDNSFirewallIP interface {
- ImplementsDNSFirewallEditParamsDNSFirewallIP()
-}
-
-// Upstream DNS Server IPv4 Address.
-//
-// Satisfied by [shared.UnionString], [shared.UnionString].
-type DNSFirewallEditParamsUpstreamIP interface {
- ImplementsDNSFirewallEditParamsUpstreamIP()
-}
-
-// Attack mitigation settings.
-type DNSFirewallEditParamsAttackMitigation struct {
- // When enabled, random-prefix attacks are automatically mitigated and the upstream
- // DNS servers protected.
- Enabled param.Field[bool] `json:"enabled"`
- // Deprecated alias for "only_when_upstream_unhealthy".
- OnlyWhenOriginUnhealthy param.Field[interface{}] `json:"only_when_origin_unhealthy"`
- // Only mitigate attacks when upstream servers seem unhealthy.
- OnlyWhenUpstreamUnhealthy param.Field[bool] `json:"only_when_upstream_unhealthy"`
-}
-
-func (r DNSFirewallEditParamsAttackMitigation) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type DNSFirewallEditResponseEnvelope struct {
- Errors []DNSFirewallEditResponseEnvelopeErrors `json:"errors,required"`
- Messages []DNSFirewallEditResponseEnvelopeMessages `json:"messages,required"`
- Result DNSFirewallEditResponse `json:"result,required"`
- // Whether the API call was successful
- Success DNSFirewallEditResponseEnvelopeSuccess `json:"success,required"`
- JSON dnsFirewallEditResponseEnvelopeJSON `json:"-"`
-}
-
-// dnsFirewallEditResponseEnvelopeJSON contains the JSON metadata for the struct
-// [DNSFirewallEditResponseEnvelope]
-type dnsFirewallEditResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSFirewallEditResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsFirewallEditResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type DNSFirewallEditResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON dnsFirewallEditResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// dnsFirewallEditResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [DNSFirewallEditResponseEnvelopeErrors]
-type dnsFirewallEditResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSFirewallEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsFirewallEditResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type DNSFirewallEditResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON dnsFirewallEditResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// dnsFirewallEditResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [DNSFirewallEditResponseEnvelopeMessages]
-type dnsFirewallEditResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSFirewallEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsFirewallEditResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type DNSFirewallEditResponseEnvelopeSuccess bool
-
-const (
- DNSFirewallEditResponseEnvelopeSuccessTrue DNSFirewallEditResponseEnvelopeSuccess = true
-)
-
-type DNSFirewallGetParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type DNSFirewallGetResponseEnvelope struct {
- Errors []DNSFirewallGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []DNSFirewallGetResponseEnvelopeMessages `json:"messages,required"`
- Result DNSFirewallGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success DNSFirewallGetResponseEnvelopeSuccess `json:"success,required"`
- JSON dnsFirewallGetResponseEnvelopeJSON `json:"-"`
-}
-
-// dnsFirewallGetResponseEnvelopeJSON contains the JSON metadata for the struct
-// [DNSFirewallGetResponseEnvelope]
-type dnsFirewallGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSFirewallGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsFirewallGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type DNSFirewallGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON dnsFirewallGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// dnsFirewallGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [DNSFirewallGetResponseEnvelopeErrors]
-type dnsFirewallGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSFirewallGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsFirewallGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type DNSFirewallGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON dnsFirewallGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// dnsFirewallGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [DNSFirewallGetResponseEnvelopeMessages]
-type dnsFirewallGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSFirewallGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsFirewallGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type DNSFirewallGetResponseEnvelopeSuccess bool
-
-const (
- DNSFirewallGetResponseEnvelopeSuccessTrue DNSFirewallGetResponseEnvelopeSuccess = true
-)
diff --git a/dnsfirewall_test.go b/dnsfirewall_test.go
deleted file mode 100644
index 8ec9b533b21..00000000000
--- a/dnsfirewall_test.go
+++ /dev/null
@@ -1,190 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestDNSFirewallNewWithOptionalParams(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"),
- )
- _, err := client.DNS.Firewall.New(context.TODO(), cloudflare.DNSFirewallNewParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Name: cloudflare.F("My Awesome DNS Firewall cluster"),
- UpstreamIPs: cloudflare.F([]cloudflare.DNSFirewallNewParamsUpstreamIP{shared.UnionString("192.0.2.1"), shared.UnionString("198.51.100.1"), shared.UnionString("2001:DB8:100::CF")}),
- AttackMitigation: cloudflare.F(cloudflare.DNSFirewallNewParamsAttackMitigation{
- Enabled: cloudflare.F(true),
- OnlyWhenOriginUnhealthy: cloudflare.F[any](map[string]interface{}{}),
- OnlyWhenUpstreamUnhealthy: cloudflare.F(false),
- }),
- DeprecateAnyRequests: cloudflare.F(true),
- EcsFallback: cloudflare.F(false),
- MaximumCacheTTL: cloudflare.F(900.000000),
- MinimumCacheTTL: cloudflare.F(60.000000),
- NegativeCacheTTL: cloudflare.F(900.000000),
- OriginIPs: cloudflare.F[any](map[string]interface{}{}),
- Ratelimit: cloudflare.F(600.000000),
- Retries: cloudflare.F(2.000000),
- })
- 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())
- }
-}
-
-func TestDNSFirewallListWithOptionalParams(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"),
- )
- _, err := client.DNS.Firewall.List(context.TODO(), cloudflare.DNSFirewallListParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Page: cloudflare.F(1.000000),
- PerPage: cloudflare.F(1.000000),
- })
- 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())
- }
-}
-
-func TestDNSFirewallDelete(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"),
- )
- _, err := client.DNS.Firewall.Delete(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.DNSFirewallDeleteParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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())
- }
-}
-
-func TestDNSFirewallEditWithOptionalParams(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"),
- )
- _, err := client.DNS.Firewall.Edit(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.DNSFirewallEditParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- DeprecateAnyRequests: cloudflare.F(true),
- DNSFirewallIPs: cloudflare.F([]cloudflare.DNSFirewallEditParamsDNSFirewallIP{shared.UnionString("203.0.113.1"), shared.UnionString("203.0.113.254"), shared.UnionString("2001:DB8:AB::CF"), shared.UnionString("2001:DB8:CD::CF")}),
- EcsFallback: cloudflare.F(false),
- MaximumCacheTTL: cloudflare.F(900.000000),
- MinimumCacheTTL: cloudflare.F(60.000000),
- Name: cloudflare.F("My Awesome DNS Firewall cluster"),
- UpstreamIPs: cloudflare.F([]cloudflare.DNSFirewallEditParamsUpstreamIP{shared.UnionString("192.0.2.1"), shared.UnionString("198.51.100.1"), shared.UnionString("2001:DB8:100::CF")}),
- AttackMitigation: cloudflare.F(cloudflare.DNSFirewallEditParamsAttackMitigation{
- Enabled: cloudflare.F(true),
- OnlyWhenOriginUnhealthy: cloudflare.F[any](map[string]interface{}{}),
- OnlyWhenUpstreamUnhealthy: cloudflare.F(false),
- }),
- NegativeCacheTTL: cloudflare.F(900.000000),
- OriginIPs: cloudflare.F[any](map[string]interface{}{}),
- Ratelimit: cloudflare.F(600.000000),
- Retries: cloudflare.F(2.000000),
- },
- )
- 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())
- }
-}
-
-func TestDNSFirewallGet(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"),
- )
- _, err := client.DNS.Firewall.Get(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.DNSFirewallGetParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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/dnsfirewallanalytics.go b/dnsfirewallanalytics.go
deleted file mode 100644
index 3ce0971e510..00000000000
--- a/dnsfirewallanalytics.go
+++ /dev/null
@@ -1,27 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// DNSFirewallAnalyticsService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewDNSFirewallAnalyticsService]
-// method instead.
-type DNSFirewallAnalyticsService struct {
- Options []option.RequestOption
- Reports *DNSFirewallAnalyticsReportService
-}
-
-// NewDNSFirewallAnalyticsService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewDNSFirewallAnalyticsService(opts ...option.RequestOption) (r *DNSFirewallAnalyticsService) {
- r = &DNSFirewallAnalyticsService{}
- r.Options = opts
- r.Reports = NewDNSFirewallAnalyticsReportService(opts...)
- return
-}
diff --git a/dnsfirewallanalyticsreport.go b/dnsfirewallanalyticsreport.go
deleted file mode 100644
index d613da0a847..00000000000
--- a/dnsfirewallanalyticsreport.go
+++ /dev/null
@@ -1,272 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// DNSFirewallAnalyticsReportService contains methods and other services that help
-// with interacting with the cloudflare API. Note, unlike clients, this service
-// does not read variables from the environment automatically. You should not
-// instantiate this service directly, and instead use the
-// [NewDNSFirewallAnalyticsReportService] method instead.
-type DNSFirewallAnalyticsReportService struct {
- Options []option.RequestOption
- Bytimes *DNSFirewallAnalyticsReportBytimeService
-}
-
-// NewDNSFirewallAnalyticsReportService generates a new service that applies the
-// given options to each request. These options are applied after the parent
-// client's options (if there is one), and before any request-specific options.
-func NewDNSFirewallAnalyticsReportService(opts ...option.RequestOption) (r *DNSFirewallAnalyticsReportService) {
- r = &DNSFirewallAnalyticsReportService{}
- r.Options = opts
- r.Bytimes = NewDNSFirewallAnalyticsReportBytimeService(opts...)
- return
-}
-
-// Retrieves a list of summarised aggregate metrics over a given time period.
-//
-// See
-// [Analytics API properties](https://developers.cloudflare.com/dns/reference/analytics-api-properties/)
-// for detailed information about the available query parameters.
-func (r *DNSFirewallAnalyticsReportService) Get(ctx context.Context, accountIdentifier string, identifier string, query DNSFirewallAnalyticsReportGetParams, opts ...option.RequestOption) (res *DNSFirewallAnalyticsReportGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env DNSFirewallAnalyticsReportGetResponseEnvelope
- path := fmt.Sprintf("accounts/%s/dns_firewall/%s/dns_analytics/report", accountIdentifier, identifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type DNSFirewallAnalyticsReportGetResponse struct {
- // Array with one row per combination of dimension values.
- Data []DNSFirewallAnalyticsReportGetResponseData `json:"data,required"`
- // Number of seconds between current time and last processed event, in another
- // words how many seconds of data could be missing.
- DataLag float64 `json:"data_lag,required"`
- // Maximum results for each metric (object mapping metric names to values).
- // Currently always an empty object.
- Max interface{} `json:"max,required"`
- // Minimum results for each metric (object mapping metric names to values).
- // Currently always an empty object.
- Min interface{} `json:"min,required"`
- Query DNSFirewallAnalyticsReportGetResponseQuery `json:"query,required"`
- // Total number of rows in the result.
- Rows float64 `json:"rows,required"`
- // Total results for metrics across all data (object mapping metric names to
- // values).
- Totals interface{} `json:"totals,required"`
- JSON dnsFirewallAnalyticsReportGetResponseJSON `json:"-"`
-}
-
-// dnsFirewallAnalyticsReportGetResponseJSON contains the JSON metadata for the
-// struct [DNSFirewallAnalyticsReportGetResponse]
-type dnsFirewallAnalyticsReportGetResponseJSON struct {
- Data apijson.Field
- DataLag apijson.Field
- Max apijson.Field
- Min apijson.Field
- Query apijson.Field
- Rows apijson.Field
- Totals apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSFirewallAnalyticsReportGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsFirewallAnalyticsReportGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type DNSFirewallAnalyticsReportGetResponseData struct {
- // Array of dimension values, representing the combination of dimension values
- // corresponding to this row.
- Dimensions []string `json:"dimensions,required"`
- // Array with one item per requested metric. Each item is a single value.
- Metrics []float64 `json:"metrics,required"`
- JSON dnsFirewallAnalyticsReportGetResponseDataJSON `json:"-"`
-}
-
-// dnsFirewallAnalyticsReportGetResponseDataJSON contains the JSON metadata for the
-// struct [DNSFirewallAnalyticsReportGetResponseData]
-type dnsFirewallAnalyticsReportGetResponseDataJSON struct {
- Dimensions apijson.Field
- Metrics apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSFirewallAnalyticsReportGetResponseData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsFirewallAnalyticsReportGetResponseDataJSON) RawJSON() string {
- return r.raw
-}
-
-type DNSFirewallAnalyticsReportGetResponseQuery struct {
- // Array of dimension names.
- Dimensions []string `json:"dimensions,required"`
- // Limit number of returned metrics.
- Limit int64 `json:"limit,required"`
- // Array of metric names.
- Metrics []string `json:"metrics,required"`
- // Start date and time of requesting data period in ISO 8601 format.
- Since time.Time `json:"since,required" format:"date-time"`
- // End date and time of requesting data period in ISO 8601 format.
- Until time.Time `json:"until,required" format:"date-time"`
- // Segmentation filter in 'attribute operator value' format.
- Filters string `json:"filters"`
- // Array of dimensions to sort by, where each dimension may be prefixed by -
- // (descending) or + (ascending).
- Sort []string `json:"sort"`
- JSON dnsFirewallAnalyticsReportGetResponseQueryJSON `json:"-"`
-}
-
-// dnsFirewallAnalyticsReportGetResponseQueryJSON contains the JSON metadata for
-// the struct [DNSFirewallAnalyticsReportGetResponseQuery]
-type dnsFirewallAnalyticsReportGetResponseQueryJSON struct {
- Dimensions apijson.Field
- Limit apijson.Field
- Metrics apijson.Field
- Since apijson.Field
- Until apijson.Field
- Filters apijson.Field
- Sort apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSFirewallAnalyticsReportGetResponseQuery) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsFirewallAnalyticsReportGetResponseQueryJSON) RawJSON() string {
- return r.raw
-}
-
-type DNSFirewallAnalyticsReportGetParams struct {
- // A comma-separated list of dimensions to group results by.
- Dimensions param.Field[string] `query:"dimensions"`
- // Segmentation filter in 'attribute operator value' format.
- Filters param.Field[string] `query:"filters"`
- // Limit number of returned metrics.
- Limit param.Field[int64] `query:"limit"`
- // A comma-separated list of metrics to query.
- Metrics param.Field[string] `query:"metrics"`
- // Start date and time of requesting data period in ISO 8601 format.
- Since param.Field[time.Time] `query:"since" format:"date-time"`
- // A comma-separated list of dimensions to sort by, where each dimension may be
- // prefixed by - (descending) or + (ascending).
- Sort param.Field[string] `query:"sort"`
- // End date and time of requesting data period in ISO 8601 format.
- Until param.Field[time.Time] `query:"until" format:"date-time"`
-}
-
-// URLQuery serializes [DNSFirewallAnalyticsReportGetParams]'s query parameters as
-// `url.Values`.
-func (r DNSFirewallAnalyticsReportGetParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type DNSFirewallAnalyticsReportGetResponseEnvelope struct {
- Errors []DNSFirewallAnalyticsReportGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []DNSFirewallAnalyticsReportGetResponseEnvelopeMessages `json:"messages,required"`
- Result DNSFirewallAnalyticsReportGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success DNSFirewallAnalyticsReportGetResponseEnvelopeSuccess `json:"success,required"`
- JSON dnsFirewallAnalyticsReportGetResponseEnvelopeJSON `json:"-"`
-}
-
-// dnsFirewallAnalyticsReportGetResponseEnvelopeJSON contains the JSON metadata for
-// the struct [DNSFirewallAnalyticsReportGetResponseEnvelope]
-type dnsFirewallAnalyticsReportGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSFirewallAnalyticsReportGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsFirewallAnalyticsReportGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type DNSFirewallAnalyticsReportGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON dnsFirewallAnalyticsReportGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// dnsFirewallAnalyticsReportGetResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct [DNSFirewallAnalyticsReportGetResponseEnvelopeErrors]
-type dnsFirewallAnalyticsReportGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSFirewallAnalyticsReportGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsFirewallAnalyticsReportGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type DNSFirewallAnalyticsReportGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON dnsFirewallAnalyticsReportGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// dnsFirewallAnalyticsReportGetResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct [DNSFirewallAnalyticsReportGetResponseEnvelopeMessages]
-type dnsFirewallAnalyticsReportGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSFirewallAnalyticsReportGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsFirewallAnalyticsReportGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type DNSFirewallAnalyticsReportGetResponseEnvelopeSuccess bool
-
-const (
- DNSFirewallAnalyticsReportGetResponseEnvelopeSuccessTrue DNSFirewallAnalyticsReportGetResponseEnvelopeSuccess = true
-)
diff --git a/dnsfirewallanalyticsreport_test.go b/dnsfirewallanalyticsreport_test.go
deleted file mode 100644
index ac6bf629763..00000000000
--- a/dnsfirewallanalyticsreport_test.go
+++ /dev/null
@@ -1,52 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
- "time"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestDNSFirewallAnalyticsReportGetWithOptionalParams(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"),
- )
- _, err := client.DNS.Firewall.Analytics.Reports.Get(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.DNSFirewallAnalyticsReportGetParams{
- Dimensions: cloudflare.F("queryType"),
- Filters: cloudflare.F("responseCode==NOERROR,queryType==A"),
- Limit: cloudflare.F(int64(100)),
- Metrics: cloudflare.F("queryCount,uncachedCount"),
- Since: cloudflare.F(time.Now()),
- Sort: cloudflare.F("+responseCode,-queryName"),
- Until: cloudflare.F(time.Now()),
- },
- )
- 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/dnsfirewallanalyticsreportbytime.go b/dnsfirewallanalyticsreportbytime.go
deleted file mode 100644
index da739a4a369..00000000000
--- a/dnsfirewallanalyticsreportbytime.go
+++ /dev/null
@@ -1,314 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// DNSFirewallAnalyticsReportBytimeService contains methods and other services that
-// help with interacting with the cloudflare API. Note, unlike clients, this
-// service does not read variables from the environment automatically. You should
-// not instantiate this service directly, and instead use the
-// [NewDNSFirewallAnalyticsReportBytimeService] method instead.
-type DNSFirewallAnalyticsReportBytimeService struct {
- Options []option.RequestOption
-}
-
-// NewDNSFirewallAnalyticsReportBytimeService generates a new service that applies
-// the given options to each request. These options are applied after the parent
-// client's options (if there is one), and before any request-specific options.
-func NewDNSFirewallAnalyticsReportBytimeService(opts ...option.RequestOption) (r *DNSFirewallAnalyticsReportBytimeService) {
- r = &DNSFirewallAnalyticsReportBytimeService{}
- r.Options = opts
- return
-}
-
-// Retrieves a list of aggregate metrics grouped by time interval.
-//
-// See
-// [Analytics API properties](https://developers.cloudflare.com/dns/reference/analytics-api-properties/)
-// for detailed information about the available query parameters.
-func (r *DNSFirewallAnalyticsReportBytimeService) Get(ctx context.Context, accountIdentifier string, identifier string, query DNSFirewallAnalyticsReportBytimeGetParams, opts ...option.RequestOption) (res *DNSFirewallAnalyticsReportBytimeGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env DNSFirewallAnalyticsReportBytimeGetResponseEnvelope
- path := fmt.Sprintf("accounts/%s/dns_firewall/%s/dns_analytics/report/bytime", accountIdentifier, identifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type DNSFirewallAnalyticsReportBytimeGetResponse struct {
- // Array with one row per combination of dimension values.
- Data []DNSFirewallAnalyticsReportBytimeGetResponseData `json:"data,required"`
- // Number of seconds between current time and last processed event, in another
- // words how many seconds of data could be missing.
- DataLag float64 `json:"data_lag,required"`
- // Maximum results for each metric (object mapping metric names to values).
- // Currently always an empty object.
- Max interface{} `json:"max,required"`
- // Minimum results for each metric (object mapping metric names to values).
- // Currently always an empty object.
- Min interface{} `json:"min,required"`
- Query DNSFirewallAnalyticsReportBytimeGetResponseQuery `json:"query,required"`
- // Total number of rows in the result.
- Rows float64 `json:"rows,required"`
- // Array of time intervals in the response data. Each interval is represented as an
- // array containing two values: the start time, and the end time.
- TimeIntervals [][]time.Time `json:"time_intervals,required" format:"date-time"`
- // Total results for metrics across all data (object mapping metric names to
- // values).
- Totals interface{} `json:"totals,required"`
- JSON dnsFirewallAnalyticsReportBytimeGetResponseJSON `json:"-"`
-}
-
-// dnsFirewallAnalyticsReportBytimeGetResponseJSON contains the JSON metadata for
-// the struct [DNSFirewallAnalyticsReportBytimeGetResponse]
-type dnsFirewallAnalyticsReportBytimeGetResponseJSON struct {
- Data apijson.Field
- DataLag apijson.Field
- Max apijson.Field
- Min apijson.Field
- Query apijson.Field
- Rows apijson.Field
- TimeIntervals apijson.Field
- Totals apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSFirewallAnalyticsReportBytimeGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsFirewallAnalyticsReportBytimeGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type DNSFirewallAnalyticsReportBytimeGetResponseData struct {
- // Array of dimension values, representing the combination of dimension values
- // corresponding to this row.
- Dimensions []string `json:"dimensions,required"`
- // Array with one item per requested metric. Each item is an array of values,
- // broken down by time interval.
- Metrics [][]interface{} `json:"metrics,required"`
- JSON dnsFirewallAnalyticsReportBytimeGetResponseDataJSON `json:"-"`
-}
-
-// dnsFirewallAnalyticsReportBytimeGetResponseDataJSON contains the JSON metadata
-// for the struct [DNSFirewallAnalyticsReportBytimeGetResponseData]
-type dnsFirewallAnalyticsReportBytimeGetResponseDataJSON struct {
- Dimensions apijson.Field
- Metrics apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSFirewallAnalyticsReportBytimeGetResponseData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsFirewallAnalyticsReportBytimeGetResponseDataJSON) RawJSON() string {
- return r.raw
-}
-
-type DNSFirewallAnalyticsReportBytimeGetResponseQuery struct {
- // Array of dimension names.
- Dimensions []string `json:"dimensions,required"`
- // Limit number of returned metrics.
- Limit int64 `json:"limit,required"`
- // Array of metric names.
- Metrics []string `json:"metrics,required"`
- // Start date and time of requesting data period in ISO 8601 format.
- Since time.Time `json:"since,required" format:"date-time"`
- // Unit of time to group data by.
- TimeDelta DNSFirewallAnalyticsReportBytimeGetResponseQueryTimeDelta `json:"time_delta,required"`
- // End date and time of requesting data period in ISO 8601 format.
- Until time.Time `json:"until,required" format:"date-time"`
- // Segmentation filter in 'attribute operator value' format.
- Filters string `json:"filters"`
- // Array of dimensions to sort by, where each dimension may be prefixed by -
- // (descending) or + (ascending).
- Sort []string `json:"sort"`
- JSON dnsFirewallAnalyticsReportBytimeGetResponseQueryJSON `json:"-"`
-}
-
-// dnsFirewallAnalyticsReportBytimeGetResponseQueryJSON contains the JSON metadata
-// for the struct [DNSFirewallAnalyticsReportBytimeGetResponseQuery]
-type dnsFirewallAnalyticsReportBytimeGetResponseQueryJSON struct {
- Dimensions apijson.Field
- Limit apijson.Field
- Metrics apijson.Field
- Since apijson.Field
- TimeDelta apijson.Field
- Until apijson.Field
- Filters apijson.Field
- Sort apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSFirewallAnalyticsReportBytimeGetResponseQuery) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsFirewallAnalyticsReportBytimeGetResponseQueryJSON) RawJSON() string {
- return r.raw
-}
-
-// Unit of time to group data by.
-type DNSFirewallAnalyticsReportBytimeGetResponseQueryTimeDelta string
-
-const (
- DNSFirewallAnalyticsReportBytimeGetResponseQueryTimeDeltaAll DNSFirewallAnalyticsReportBytimeGetResponseQueryTimeDelta = "all"
- DNSFirewallAnalyticsReportBytimeGetResponseQueryTimeDeltaAuto DNSFirewallAnalyticsReportBytimeGetResponseQueryTimeDelta = "auto"
- DNSFirewallAnalyticsReportBytimeGetResponseQueryTimeDeltaYear DNSFirewallAnalyticsReportBytimeGetResponseQueryTimeDelta = "year"
- DNSFirewallAnalyticsReportBytimeGetResponseQueryTimeDeltaQuarter DNSFirewallAnalyticsReportBytimeGetResponseQueryTimeDelta = "quarter"
- DNSFirewallAnalyticsReportBytimeGetResponseQueryTimeDeltaMonth DNSFirewallAnalyticsReportBytimeGetResponseQueryTimeDelta = "month"
- DNSFirewallAnalyticsReportBytimeGetResponseQueryTimeDeltaWeek DNSFirewallAnalyticsReportBytimeGetResponseQueryTimeDelta = "week"
- DNSFirewallAnalyticsReportBytimeGetResponseQueryTimeDeltaDay DNSFirewallAnalyticsReportBytimeGetResponseQueryTimeDelta = "day"
- DNSFirewallAnalyticsReportBytimeGetResponseQueryTimeDeltaHour DNSFirewallAnalyticsReportBytimeGetResponseQueryTimeDelta = "hour"
- DNSFirewallAnalyticsReportBytimeGetResponseQueryTimeDeltaDekaminute DNSFirewallAnalyticsReportBytimeGetResponseQueryTimeDelta = "dekaminute"
- DNSFirewallAnalyticsReportBytimeGetResponseQueryTimeDeltaMinute DNSFirewallAnalyticsReportBytimeGetResponseQueryTimeDelta = "minute"
-)
-
-type DNSFirewallAnalyticsReportBytimeGetParams struct {
- // A comma-separated list of dimensions to group results by.
- Dimensions param.Field[string] `query:"dimensions"`
- // Segmentation filter in 'attribute operator value' format.
- Filters param.Field[string] `query:"filters"`
- // Limit number of returned metrics.
- Limit param.Field[int64] `query:"limit"`
- // A comma-separated list of metrics to query.
- Metrics param.Field[string] `query:"metrics"`
- // Start date and time of requesting data period in ISO 8601 format.
- Since param.Field[time.Time] `query:"since" format:"date-time"`
- // A comma-separated list of dimensions to sort by, where each dimension may be
- // prefixed by - (descending) or + (ascending).
- Sort param.Field[string] `query:"sort"`
- // Unit of time to group data by.
- TimeDelta param.Field[DNSFirewallAnalyticsReportBytimeGetParamsTimeDelta] `query:"time_delta"`
- // End date and time of requesting data period in ISO 8601 format.
- Until param.Field[time.Time] `query:"until" format:"date-time"`
-}
-
-// URLQuery serializes [DNSFirewallAnalyticsReportBytimeGetParams]'s query
-// parameters as `url.Values`.
-func (r DNSFirewallAnalyticsReportBytimeGetParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Unit of time to group data by.
-type DNSFirewallAnalyticsReportBytimeGetParamsTimeDelta string
-
-const (
- DNSFirewallAnalyticsReportBytimeGetParamsTimeDeltaAll DNSFirewallAnalyticsReportBytimeGetParamsTimeDelta = "all"
- DNSFirewallAnalyticsReportBytimeGetParamsTimeDeltaAuto DNSFirewallAnalyticsReportBytimeGetParamsTimeDelta = "auto"
- DNSFirewallAnalyticsReportBytimeGetParamsTimeDeltaYear DNSFirewallAnalyticsReportBytimeGetParamsTimeDelta = "year"
- DNSFirewallAnalyticsReportBytimeGetParamsTimeDeltaQuarter DNSFirewallAnalyticsReportBytimeGetParamsTimeDelta = "quarter"
- DNSFirewallAnalyticsReportBytimeGetParamsTimeDeltaMonth DNSFirewallAnalyticsReportBytimeGetParamsTimeDelta = "month"
- DNSFirewallAnalyticsReportBytimeGetParamsTimeDeltaWeek DNSFirewallAnalyticsReportBytimeGetParamsTimeDelta = "week"
- DNSFirewallAnalyticsReportBytimeGetParamsTimeDeltaDay DNSFirewallAnalyticsReportBytimeGetParamsTimeDelta = "day"
- DNSFirewallAnalyticsReportBytimeGetParamsTimeDeltaHour DNSFirewallAnalyticsReportBytimeGetParamsTimeDelta = "hour"
- DNSFirewallAnalyticsReportBytimeGetParamsTimeDeltaDekaminute DNSFirewallAnalyticsReportBytimeGetParamsTimeDelta = "dekaminute"
- DNSFirewallAnalyticsReportBytimeGetParamsTimeDeltaMinute DNSFirewallAnalyticsReportBytimeGetParamsTimeDelta = "minute"
-)
-
-type DNSFirewallAnalyticsReportBytimeGetResponseEnvelope struct {
- Errors []DNSFirewallAnalyticsReportBytimeGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []DNSFirewallAnalyticsReportBytimeGetResponseEnvelopeMessages `json:"messages,required"`
- Result DNSFirewallAnalyticsReportBytimeGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success DNSFirewallAnalyticsReportBytimeGetResponseEnvelopeSuccess `json:"success,required"`
- JSON dnsFirewallAnalyticsReportBytimeGetResponseEnvelopeJSON `json:"-"`
-}
-
-// dnsFirewallAnalyticsReportBytimeGetResponseEnvelopeJSON contains the JSON
-// metadata for the struct [DNSFirewallAnalyticsReportBytimeGetResponseEnvelope]
-type dnsFirewallAnalyticsReportBytimeGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSFirewallAnalyticsReportBytimeGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsFirewallAnalyticsReportBytimeGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type DNSFirewallAnalyticsReportBytimeGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON dnsFirewallAnalyticsReportBytimeGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// dnsFirewallAnalyticsReportBytimeGetResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct
-// [DNSFirewallAnalyticsReportBytimeGetResponseEnvelopeErrors]
-type dnsFirewallAnalyticsReportBytimeGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSFirewallAnalyticsReportBytimeGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsFirewallAnalyticsReportBytimeGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type DNSFirewallAnalyticsReportBytimeGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON dnsFirewallAnalyticsReportBytimeGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// dnsFirewallAnalyticsReportBytimeGetResponseEnvelopeMessagesJSON contains the
-// JSON metadata for the struct
-// [DNSFirewallAnalyticsReportBytimeGetResponseEnvelopeMessages]
-type dnsFirewallAnalyticsReportBytimeGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSFirewallAnalyticsReportBytimeGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsFirewallAnalyticsReportBytimeGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type DNSFirewallAnalyticsReportBytimeGetResponseEnvelopeSuccess bool
-
-const (
- DNSFirewallAnalyticsReportBytimeGetResponseEnvelopeSuccessTrue DNSFirewallAnalyticsReportBytimeGetResponseEnvelopeSuccess = true
-)
diff --git a/dnsfirewallanalyticsreportbytime_test.go b/dnsfirewallanalyticsreportbytime_test.go
deleted file mode 100644
index 881bb5c4382..00000000000
--- a/dnsfirewallanalyticsreportbytime_test.go
+++ /dev/null
@@ -1,53 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
- "time"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestDNSFirewallAnalyticsReportBytimeGetWithOptionalParams(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"),
- )
- _, err := client.DNS.Firewall.Analytics.Reports.Bytimes.Get(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.DNSFirewallAnalyticsReportBytimeGetParams{
- Dimensions: cloudflare.F("queryType"),
- Filters: cloudflare.F("responseCode==NOERROR,queryType==A"),
- Limit: cloudflare.F(int64(100)),
- Metrics: cloudflare.F("queryCount,uncachedCount"),
- Since: cloudflare.F(time.Now()),
- Sort: cloudflare.F("+responseCode,-queryName"),
- TimeDelta: cloudflare.F(cloudflare.DNSFirewallAnalyticsReportBytimeGetParamsTimeDeltaHour),
- Until: cloudflare.F(time.Now()),
- },
- )
- 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/dnsrecord.go b/dnsrecord.go
deleted file mode 100644
index b2ced52889d..00000000000
--- a/dnsrecord.go
+++ /dev/null
@@ -1,17883 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
- "reflect"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/option"
- "github.com/tidwall/gjson"
-)
-
-// DNSRecordService contains methods and other services that help with interacting
-// with the cloudflare API. Note, unlike clients, this service does not read
-// variables from the environment automatically. You should not instantiate this
-// service directly, and instead use the [NewDNSRecordService] method instead.
-type DNSRecordService struct {
- Options []option.RequestOption
-}
-
-// NewDNSRecordService generates a new service that applies the given options to
-// each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewDNSRecordService(opts ...option.RequestOption) (r *DNSRecordService) {
- r = &DNSRecordService{}
- r.Options = opts
- return
-}
-
-// Create a new DNS record for a zone.
-//
-// Notes:
-//
-// - A/AAAA records cannot exist on the same name as CNAME records.
-// - NS records cannot exist on the same name as any other record type.
-// - Domain names are always represented in Punycode, even if Unicode characters
-// were used when creating the record.
-func (r *DNSRecordService) New(ctx context.Context, params DNSRecordNewParams, opts ...option.RequestOption) (res *DNSRecordNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env DNSRecordNewResponseEnvelope
- path := fmt.Sprintf("zones/%s/dns_records", params.ZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Overwrite an existing DNS record. Notes:
-//
-// - A/AAAA records cannot exist on the same name as CNAME records.
-// - NS records cannot exist on the same name as any other record type.
-// - Domain names are always represented in Punycode, even if Unicode characters
-// were used when creating the record.
-func (r *DNSRecordService) Update(ctx context.Context, dnsRecordID string, params DNSRecordUpdateParams, opts ...option.RequestOption) (res *DNSRecordUpdateResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env DNSRecordUpdateResponseEnvelope
- path := fmt.Sprintf("zones/%s/dns_records/%s", params.ZoneID, dnsRecordID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// List, search, sort, and filter a zones' DNS records.
-func (r *DNSRecordService) List(ctx context.Context, params DNSRecordListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[DNSRecordListResponse], err error) {
- var raw *http.Response
- opts = append(r.Options, opts...)
- opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
- path := fmt.Sprintf("zones/%s/dns_records", params.ZoneID)
- cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, params, &res, opts...)
- if err != nil {
- return nil, err
- }
- err = cfg.Execute()
- if err != nil {
- return nil, err
- }
- res.SetPageConfig(cfg, raw)
- return res, nil
-}
-
-// List, search, sort, and filter a zones' DNS records.
-func (r *DNSRecordService) ListAutoPaging(ctx context.Context, params DNSRecordListParams, opts ...option.RequestOption) *shared.V4PagePaginationArrayAutoPager[DNSRecordListResponse] {
- return shared.NewV4PagePaginationArrayAutoPager(r.List(ctx, params, opts...))
-}
-
-// Delete DNS Record
-func (r *DNSRecordService) Delete(ctx context.Context, dnsRecordID string, body DNSRecordDeleteParams, opts ...option.RequestOption) (res *DNSRecordDeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env DNSRecordDeleteResponseEnvelope
- path := fmt.Sprintf("zones/%s/dns_records/%s", body.ZoneID, dnsRecordID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Update an existing DNS record. Notes:
-//
-// - A/AAAA records cannot exist on the same name as CNAME records.
-// - NS records cannot exist on the same name as any other record type.
-// - Domain names are always represented in Punycode, even if Unicode characters
-// were used when creating the record.
-func (r *DNSRecordService) Edit(ctx context.Context, dnsRecordID string, params DNSRecordEditParams, opts ...option.RequestOption) (res *DNSRecordEditResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env DNSRecordEditResponseEnvelope
- path := fmt.Sprintf("zones/%s/dns_records/%s", params.ZoneID, dnsRecordID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// You can export your
-// [BIND config](https://en.wikipedia.org/wiki/Zone_file "Zone file") through this
-// endpoint.
-//
-// See
-// [the documentation](https://developers.cloudflare.com/dns/manage-dns-records/how-to/import-and-export/ "Import and export records")
-// for more information.
-func (r *DNSRecordService) Export(ctx context.Context, query DNSRecordExportParams, opts ...option.RequestOption) (res *string, err error) {
- opts = append(r.Options[:], opts...)
- opts = append([]option.RequestOption{option.WithHeader("Accept", "text/plain")}, opts...)
- path := fmt.Sprintf("zones/%s/dns_records/export", query.ZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &res, opts...)
- return
-}
-
-// DNS Record Details
-func (r *DNSRecordService) Get(ctx context.Context, dnsRecordID string, query DNSRecordGetParams, opts ...option.RequestOption) (res *DNSRecordGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env DNSRecordGetResponseEnvelope
- path := fmt.Sprintf("zones/%s/dns_records/%s", query.ZoneID, dnsRecordID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// You can upload your
-// [BIND config](https://en.wikipedia.org/wiki/Zone_file "Zone file") through this
-// endpoint. It assumes that cURL is called from a location with bind_config.txt
-// (valid BIND config) present.
-//
-// See
-// [the documentation](https://developers.cloudflare.com/dns/manage-dns-records/how-to/import-and-export/ "Import and export records")
-// for more information.
-func (r *DNSRecordService) Import(ctx context.Context, params DNSRecordImportParams, opts ...option.RequestOption) (res *DNSRecordImportResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env DNSRecordImportResponseEnvelope
- path := fmt.Sprintf("zones/%s/dns_records/import", params.ZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Scan for common DNS records on your domain and automatically add them to your
-// zone. Useful if you haven't updated your nameservers yet.
-func (r *DNSRecordService) Scan(ctx context.Context, body DNSRecordScanParams, opts ...option.RequestOption) (res *DNSRecordScanResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env DNSRecordScanResponseEnvelope
- path := fmt.Sprintf("zones/%s/dns_records/scan", body.ZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Union satisfied by [DNSRecordNewResponseA], [DNSRecordNewResponseAAAA],
-// [DNSRecordNewResponseCAA], [DNSRecordNewResponseCert],
-// [DNSRecordNewResponseCNAME], [DNSRecordNewResponseDNSKEY],
-// [DNSRecordNewResponseDS], [DNSRecordNewResponseHTTPS],
-// [DNSRecordNewResponseLOC], [DNSRecordNewResponseMX],
-// [DNSRecordNewResponseNAPTR], [DNSRecordNewResponseNS],
-// [DNSRecordNewResponsePTR], [DNSRecordNewResponseSmimea],
-// [DNSRecordNewResponseSRV], [DNSRecordNewResponseSSHFP],
-// [DNSRecordNewResponseSVCB], [DNSRecordNewResponseTLSA],
-// [DNSRecordNewResponseTXT] or [DNSRecordNewResponseURI].
-type DNSRecordNewResponse interface {
- implementsDNSRecordNewResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordNewResponse)(nil)).Elem(),
- "type",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordNewResponseA{}),
- DiscriminatorValue: "A",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordNewResponseAAAA{}),
- DiscriminatorValue: "AAAA",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordNewResponseCAA{}),
- DiscriminatorValue: "CAA",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordNewResponseCert{}),
- DiscriminatorValue: "CERT",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordNewResponseCNAME{}),
- DiscriminatorValue: "CNAME",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordNewResponseDNSKEY{}),
- DiscriminatorValue: "DNSKEY",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordNewResponseDS{}),
- DiscriminatorValue: "DS",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordNewResponseHTTPS{}),
- DiscriminatorValue: "HTTPS",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordNewResponseLOC{}),
- DiscriminatorValue: "LOC",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordNewResponseMX{}),
- DiscriminatorValue: "MX",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordNewResponseNAPTR{}),
- DiscriminatorValue: "NAPTR",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordNewResponseNS{}),
- DiscriminatorValue: "NS",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordNewResponsePTR{}),
- DiscriminatorValue: "PTR",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordNewResponseSmimea{}),
- DiscriminatorValue: "SMIMEA",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordNewResponseSRV{}),
- DiscriminatorValue: "SRV",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordNewResponseSSHFP{}),
- DiscriminatorValue: "SSHFP",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordNewResponseSVCB{}),
- DiscriminatorValue: "SVCB",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordNewResponseTLSA{}),
- DiscriminatorValue: "TLSA",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordNewResponseTXT{}),
- DiscriminatorValue: "TXT",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordNewResponseURI{}),
- DiscriminatorValue: "URI",
- },
- )
-}
-
-type DNSRecordNewResponseA struct {
- // A valid IPv4 address.
- Content string `json:"content,required" format:"ipv4"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordNewResponseAType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordNewResponseAMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Whether the record is receiving the performance and security benefits of
- // Cloudflare.
- Proxied bool `json:"proxied"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordNewResponseATTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordNewResponseAJSON `json:"-"`
-}
-
-// dnsRecordNewResponseAJSON contains the JSON metadata for the struct
-// [DNSRecordNewResponseA]
-type dnsRecordNewResponseAJSON struct {
- Content apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Proxied apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordNewResponseA) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordNewResponseAJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordNewResponseA) implementsDNSRecordNewResponse() {}
-
-// Record type.
-type DNSRecordNewResponseAType string
-
-const (
- DNSRecordNewResponseATypeA DNSRecordNewResponseAType = "A"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordNewResponseAMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordNewResponseAMetaJSON `json:"-"`
-}
-
-// dnsRecordNewResponseAMetaJSON contains the JSON metadata for the struct
-// [DNSRecordNewResponseAMeta]
-type dnsRecordNewResponseAMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordNewResponseAMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordNewResponseAMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordNewResponseATTLNumber].
-type DNSRecordNewResponseATTL interface {
- ImplementsDNSRecordNewResponseAttl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordNewResponseATTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordNewResponseATTLNumber(0)),
- },
- )
-}
-
-type DNSRecordNewResponseATTLNumber float64
-
-const (
- DNSRecordNewResponseATTLNumber1 DNSRecordNewResponseATTLNumber = 1
-)
-
-type DNSRecordNewResponseAAAA struct {
- // A valid IPv6 address.
- Content string `json:"content,required" format:"ipv6"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordNewResponseAAAAType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordNewResponseAAAAMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Whether the record is receiving the performance and security benefits of
- // Cloudflare.
- Proxied bool `json:"proxied"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordNewResponseAAAATTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordNewResponseAAAAJSON `json:"-"`
-}
-
-// dnsRecordNewResponseAAAAJSON contains the JSON metadata for the struct
-// [DNSRecordNewResponseAAAA]
-type dnsRecordNewResponseAAAAJSON struct {
- Content apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Proxied apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordNewResponseAAAA) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordNewResponseAAAAJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordNewResponseAAAA) implementsDNSRecordNewResponse() {}
-
-// Record type.
-type DNSRecordNewResponseAAAAType string
-
-const (
- DNSRecordNewResponseAAAATypeAAAA DNSRecordNewResponseAAAAType = "AAAA"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordNewResponseAAAAMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordNewResponseAAAAMetaJSON `json:"-"`
-}
-
-// dnsRecordNewResponseAAAAMetaJSON contains the JSON metadata for the struct
-// [DNSRecordNewResponseAAAAMeta]
-type dnsRecordNewResponseAAAAMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordNewResponseAAAAMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordNewResponseAAAAMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordNewResponseAAAATTLNumber].
-type DNSRecordNewResponseAAAATTL interface {
- ImplementsDNSRecordNewResponseAaaattl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordNewResponseAAAATTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordNewResponseAAAATTLNumber(0)),
- },
- )
-}
-
-type DNSRecordNewResponseAAAATTLNumber float64
-
-const (
- DNSRecordNewResponseAAAATTLNumber1 DNSRecordNewResponseAAAATTLNumber = 1
-)
-
-type DNSRecordNewResponseCAA struct {
- // Components of a CAA record.
- Data DNSRecordNewResponseCAAData `json:"data,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordNewResponseCAAType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // Formatted CAA content. See 'data' to set CAA properties.
- Content string `json:"content"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordNewResponseCAAMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordNewResponseCAATTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordNewResponseCAAJSON `json:"-"`
-}
-
-// dnsRecordNewResponseCAAJSON contains the JSON metadata for the struct
-// [DNSRecordNewResponseCAA]
-type dnsRecordNewResponseCAAJSON struct {
- Data apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- Content apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordNewResponseCAA) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordNewResponseCAAJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordNewResponseCAA) implementsDNSRecordNewResponse() {}
-
-// Components of a CAA record.
-type DNSRecordNewResponseCAAData struct {
- // Flags for the CAA record.
- Flags float64 `json:"flags"`
- // Name of the property controlled by this record (e.g.: issue, issuewild, iodef).
- Tag string `json:"tag"`
- // Value of the record. This field's semantics depend on the chosen tag.
- Value string `json:"value"`
- JSON dnsRecordNewResponseCAADataJSON `json:"-"`
-}
-
-// dnsRecordNewResponseCAADataJSON contains the JSON metadata for the struct
-// [DNSRecordNewResponseCAAData]
-type dnsRecordNewResponseCAADataJSON struct {
- Flags apijson.Field
- Tag apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordNewResponseCAAData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordNewResponseCAADataJSON) RawJSON() string {
- return r.raw
-}
-
-// Record type.
-type DNSRecordNewResponseCAAType string
-
-const (
- DNSRecordNewResponseCAATypeCAA DNSRecordNewResponseCAAType = "CAA"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordNewResponseCAAMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordNewResponseCAAMetaJSON `json:"-"`
-}
-
-// dnsRecordNewResponseCAAMetaJSON contains the JSON metadata for the struct
-// [DNSRecordNewResponseCAAMeta]
-type dnsRecordNewResponseCAAMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordNewResponseCAAMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordNewResponseCAAMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordNewResponseCAATTLNumber].
-type DNSRecordNewResponseCAATTL interface {
- ImplementsDNSRecordNewResponseCaattl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordNewResponseCAATTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordNewResponseCAATTLNumber(0)),
- },
- )
-}
-
-type DNSRecordNewResponseCAATTLNumber float64
-
-const (
- DNSRecordNewResponseCAATTLNumber1 DNSRecordNewResponseCAATTLNumber = 1
-)
-
-type DNSRecordNewResponseCert struct {
- // Components of a CERT record.
- Data DNSRecordNewResponseCertData `json:"data,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordNewResponseCertType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // Formatted CERT content. See 'data' to set CERT properties.
- Content string `json:"content"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordNewResponseCertMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordNewResponseCertTTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordNewResponseCertJSON `json:"-"`
-}
-
-// dnsRecordNewResponseCertJSON contains the JSON metadata for the struct
-// [DNSRecordNewResponseCert]
-type dnsRecordNewResponseCertJSON struct {
- Data apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- Content apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordNewResponseCert) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordNewResponseCertJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordNewResponseCert) implementsDNSRecordNewResponse() {}
-
-// Components of a CERT record.
-type DNSRecordNewResponseCertData struct {
- // Algorithm.
- Algorithm float64 `json:"algorithm"`
- // Certificate.
- Certificate string `json:"certificate"`
- // Key Tag.
- KeyTag float64 `json:"key_tag"`
- // Type.
- Type float64 `json:"type"`
- JSON dnsRecordNewResponseCertDataJSON `json:"-"`
-}
-
-// dnsRecordNewResponseCertDataJSON contains the JSON metadata for the struct
-// [DNSRecordNewResponseCertData]
-type dnsRecordNewResponseCertDataJSON struct {
- Algorithm apijson.Field
- Certificate apijson.Field
- KeyTag apijson.Field
- Type apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordNewResponseCertData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordNewResponseCertDataJSON) RawJSON() string {
- return r.raw
-}
-
-// Record type.
-type DNSRecordNewResponseCertType string
-
-const (
- DNSRecordNewResponseCertTypeCert DNSRecordNewResponseCertType = "CERT"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordNewResponseCertMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordNewResponseCertMetaJSON `json:"-"`
-}
-
-// dnsRecordNewResponseCertMetaJSON contains the JSON metadata for the struct
-// [DNSRecordNewResponseCertMeta]
-type dnsRecordNewResponseCertMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordNewResponseCertMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordNewResponseCertMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordNewResponseCertTTLNumber].
-type DNSRecordNewResponseCertTTL interface {
- ImplementsDNSRecordNewResponseCertTTL()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordNewResponseCertTTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordNewResponseCertTTLNumber(0)),
- },
- )
-}
-
-type DNSRecordNewResponseCertTTLNumber float64
-
-const (
- DNSRecordNewResponseCertTTLNumber1 DNSRecordNewResponseCertTTLNumber = 1
-)
-
-type DNSRecordNewResponseCNAME struct {
- // A valid hostname. Must not match the record's name.
- Content interface{} `json:"content,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordNewResponseCNAMEType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordNewResponseCNAMEMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Whether the record is receiving the performance and security benefits of
- // Cloudflare.
- Proxied bool `json:"proxied"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordNewResponseCNAMETTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordNewResponseCNAMEJSON `json:"-"`
-}
-
-// dnsRecordNewResponseCNAMEJSON contains the JSON metadata for the struct
-// [DNSRecordNewResponseCNAME]
-type dnsRecordNewResponseCNAMEJSON struct {
- Content apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Proxied apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordNewResponseCNAME) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordNewResponseCNAMEJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordNewResponseCNAME) implementsDNSRecordNewResponse() {}
-
-// Record type.
-type DNSRecordNewResponseCNAMEType string
-
-const (
- DNSRecordNewResponseCNAMETypeCNAME DNSRecordNewResponseCNAMEType = "CNAME"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordNewResponseCNAMEMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordNewResponseCNAMEMetaJSON `json:"-"`
-}
-
-// dnsRecordNewResponseCNAMEMetaJSON contains the JSON metadata for the struct
-// [DNSRecordNewResponseCNAMEMeta]
-type dnsRecordNewResponseCNAMEMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordNewResponseCNAMEMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordNewResponseCNAMEMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordNewResponseCNAMETTLNumber].
-type DNSRecordNewResponseCNAMETTL interface {
- ImplementsDNSRecordNewResponseCnamettl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordNewResponseCNAMETTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordNewResponseCNAMETTLNumber(0)),
- },
- )
-}
-
-type DNSRecordNewResponseCNAMETTLNumber float64
-
-const (
- DNSRecordNewResponseCNAMETTLNumber1 DNSRecordNewResponseCNAMETTLNumber = 1
-)
-
-type DNSRecordNewResponseDNSKEY struct {
- // Components of a DNSKEY record.
- Data DNSRecordNewResponseDNSKEYData `json:"data,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordNewResponseDNSKEYType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // Formatted DNSKEY content. See 'data' to set DNSKEY properties.
- Content string `json:"content"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordNewResponseDNSKEYMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordNewResponseDNSKEYTTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordNewResponseDNSKEYJSON `json:"-"`
-}
-
-// dnsRecordNewResponseDNSKEYJSON contains the JSON metadata for the struct
-// [DNSRecordNewResponseDNSKEY]
-type dnsRecordNewResponseDNSKEYJSON struct {
- Data apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- Content apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordNewResponseDNSKEY) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordNewResponseDNSKEYJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordNewResponseDNSKEY) implementsDNSRecordNewResponse() {}
-
-// Components of a DNSKEY record.
-type DNSRecordNewResponseDNSKEYData struct {
- // Algorithm.
- Algorithm float64 `json:"algorithm"`
- // Flags.
- Flags float64 `json:"flags"`
- // Protocol.
- Protocol float64 `json:"protocol"`
- // Public Key.
- PublicKey string `json:"public_key"`
- JSON dnsRecordNewResponseDNSKEYDataJSON `json:"-"`
-}
-
-// dnsRecordNewResponseDNSKEYDataJSON contains the JSON metadata for the struct
-// [DNSRecordNewResponseDNSKEYData]
-type dnsRecordNewResponseDNSKEYDataJSON struct {
- Algorithm apijson.Field
- Flags apijson.Field
- Protocol apijson.Field
- PublicKey apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordNewResponseDNSKEYData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordNewResponseDNSKEYDataJSON) RawJSON() string {
- return r.raw
-}
-
-// Record type.
-type DNSRecordNewResponseDNSKEYType string
-
-const (
- DNSRecordNewResponseDNSKEYTypeDNSKEY DNSRecordNewResponseDNSKEYType = "DNSKEY"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordNewResponseDNSKEYMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordNewResponseDNSKEYMetaJSON `json:"-"`
-}
-
-// dnsRecordNewResponseDNSKEYMetaJSON contains the JSON metadata for the struct
-// [DNSRecordNewResponseDNSKEYMeta]
-type dnsRecordNewResponseDNSKEYMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordNewResponseDNSKEYMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordNewResponseDNSKEYMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordNewResponseDNSKEYTTLNumber].
-type DNSRecordNewResponseDNSKEYTTL interface {
- ImplementsDNSRecordNewResponseDnskeyttl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordNewResponseDNSKEYTTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordNewResponseDNSKEYTTLNumber(0)),
- },
- )
-}
-
-type DNSRecordNewResponseDNSKEYTTLNumber float64
-
-const (
- DNSRecordNewResponseDNSKEYTTLNumber1 DNSRecordNewResponseDNSKEYTTLNumber = 1
-)
-
-type DNSRecordNewResponseDS struct {
- // Components of a DS record.
- Data DNSRecordNewResponseDSData `json:"data,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordNewResponseDSType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // Formatted DS content. See 'data' to set DS properties.
- Content string `json:"content"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordNewResponseDSMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordNewResponseDSTTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordNewResponseDSJSON `json:"-"`
-}
-
-// dnsRecordNewResponseDSJSON contains the JSON metadata for the struct
-// [DNSRecordNewResponseDS]
-type dnsRecordNewResponseDSJSON struct {
- Data apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- Content apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordNewResponseDS) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordNewResponseDSJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordNewResponseDS) implementsDNSRecordNewResponse() {}
-
-// Components of a DS record.
-type DNSRecordNewResponseDSData struct {
- // Algorithm.
- Algorithm float64 `json:"algorithm"`
- // Digest.
- Digest string `json:"digest"`
- // Digest Type.
- DigestType float64 `json:"digest_type"`
- // Key Tag.
- KeyTag float64 `json:"key_tag"`
- JSON dnsRecordNewResponseDSDataJSON `json:"-"`
-}
-
-// dnsRecordNewResponseDSDataJSON contains the JSON metadata for the struct
-// [DNSRecordNewResponseDSData]
-type dnsRecordNewResponseDSDataJSON struct {
- Algorithm apijson.Field
- Digest apijson.Field
- DigestType apijson.Field
- KeyTag apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordNewResponseDSData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordNewResponseDSDataJSON) RawJSON() string {
- return r.raw
-}
-
-// Record type.
-type DNSRecordNewResponseDSType string
-
-const (
- DNSRecordNewResponseDSTypeDS DNSRecordNewResponseDSType = "DS"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordNewResponseDSMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordNewResponseDSMetaJSON `json:"-"`
-}
-
-// dnsRecordNewResponseDSMetaJSON contains the JSON metadata for the struct
-// [DNSRecordNewResponseDSMeta]
-type dnsRecordNewResponseDSMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordNewResponseDSMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordNewResponseDSMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordNewResponseDSTTLNumber].
-type DNSRecordNewResponseDSTTL interface {
- ImplementsDNSRecordNewResponseDsttl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordNewResponseDSTTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordNewResponseDSTTLNumber(0)),
- },
- )
-}
-
-type DNSRecordNewResponseDSTTLNumber float64
-
-const (
- DNSRecordNewResponseDSTTLNumber1 DNSRecordNewResponseDSTTLNumber = 1
-)
-
-type DNSRecordNewResponseHTTPS struct {
- // Components of a HTTPS record.
- Data DNSRecordNewResponseHTTPSData `json:"data,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordNewResponseHTTPSType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // Formatted HTTPS content. See 'data' to set HTTPS properties.
- Content string `json:"content"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordNewResponseHTTPSMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordNewResponseHTTPSTTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordNewResponseHTTPSJSON `json:"-"`
-}
-
-// dnsRecordNewResponseHTTPSJSON contains the JSON metadata for the struct
-// [DNSRecordNewResponseHTTPS]
-type dnsRecordNewResponseHTTPSJSON struct {
- Data apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- Content apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordNewResponseHTTPS) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordNewResponseHTTPSJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordNewResponseHTTPS) implementsDNSRecordNewResponse() {}
-
-// Components of a HTTPS record.
-type DNSRecordNewResponseHTTPSData struct {
- // priority.
- Priority float64 `json:"priority"`
- // target.
- Target string `json:"target"`
- // value.
- Value string `json:"value"`
- JSON dnsRecordNewResponseHTTPSDataJSON `json:"-"`
-}
-
-// dnsRecordNewResponseHTTPSDataJSON contains the JSON metadata for the struct
-// [DNSRecordNewResponseHTTPSData]
-type dnsRecordNewResponseHTTPSDataJSON struct {
- Priority apijson.Field
- Target apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordNewResponseHTTPSData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordNewResponseHTTPSDataJSON) RawJSON() string {
- return r.raw
-}
-
-// Record type.
-type DNSRecordNewResponseHTTPSType string
-
-const (
- DNSRecordNewResponseHTTPSTypeHTTPS DNSRecordNewResponseHTTPSType = "HTTPS"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordNewResponseHTTPSMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordNewResponseHTTPSMetaJSON `json:"-"`
-}
-
-// dnsRecordNewResponseHTTPSMetaJSON contains the JSON metadata for the struct
-// [DNSRecordNewResponseHTTPSMeta]
-type dnsRecordNewResponseHTTPSMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordNewResponseHTTPSMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordNewResponseHTTPSMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordNewResponseHTTPSTTLNumber].
-type DNSRecordNewResponseHTTPSTTL interface {
- ImplementsDNSRecordNewResponseHttpsttl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordNewResponseHTTPSTTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordNewResponseHTTPSTTLNumber(0)),
- },
- )
-}
-
-type DNSRecordNewResponseHTTPSTTLNumber float64
-
-const (
- DNSRecordNewResponseHTTPSTTLNumber1 DNSRecordNewResponseHTTPSTTLNumber = 1
-)
-
-type DNSRecordNewResponseLOC struct {
- // Components of a LOC record.
- Data DNSRecordNewResponseLOCData `json:"data,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordNewResponseLOCType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // Formatted LOC content. See 'data' to set LOC properties.
- Content string `json:"content"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordNewResponseLOCMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordNewResponseLOCTTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordNewResponseLOCJSON `json:"-"`
-}
-
-// dnsRecordNewResponseLOCJSON contains the JSON metadata for the struct
-// [DNSRecordNewResponseLOC]
-type dnsRecordNewResponseLOCJSON struct {
- Data apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- Content apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordNewResponseLOC) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordNewResponseLOCJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordNewResponseLOC) implementsDNSRecordNewResponse() {}
-
-// Components of a LOC record.
-type DNSRecordNewResponseLOCData struct {
- // Altitude of location in meters.
- Altitude float64 `json:"altitude"`
- // Degrees of latitude.
- LatDegrees float64 `json:"lat_degrees"`
- // Latitude direction.
- LatDirection DNSRecordNewResponseLOCDataLatDirection `json:"lat_direction"`
- // Minutes of latitude.
- LatMinutes float64 `json:"lat_minutes"`
- // Seconds of latitude.
- LatSeconds float64 `json:"lat_seconds"`
- // Degrees of longitude.
- LongDegrees float64 `json:"long_degrees"`
- // Longitude direction.
- LongDirection DNSRecordNewResponseLOCDataLongDirection `json:"long_direction"`
- // Minutes of longitude.
- LongMinutes float64 `json:"long_minutes"`
- // Seconds of longitude.
- LongSeconds float64 `json:"long_seconds"`
- // Horizontal precision of location.
- PrecisionHorz float64 `json:"precision_horz"`
- // Vertical precision of location.
- PrecisionVert float64 `json:"precision_vert"`
- // Size of location in meters.
- Size float64 `json:"size"`
- JSON dnsRecordNewResponseLOCDataJSON `json:"-"`
-}
-
-// dnsRecordNewResponseLOCDataJSON contains the JSON metadata for the struct
-// [DNSRecordNewResponseLOCData]
-type dnsRecordNewResponseLOCDataJSON struct {
- Altitude apijson.Field
- LatDegrees apijson.Field
- LatDirection apijson.Field
- LatMinutes apijson.Field
- LatSeconds apijson.Field
- LongDegrees apijson.Field
- LongDirection apijson.Field
- LongMinutes apijson.Field
- LongSeconds apijson.Field
- PrecisionHorz apijson.Field
- PrecisionVert apijson.Field
- Size apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordNewResponseLOCData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordNewResponseLOCDataJSON) RawJSON() string {
- return r.raw
-}
-
-// Latitude direction.
-type DNSRecordNewResponseLOCDataLatDirection string
-
-const (
- DNSRecordNewResponseLOCDataLatDirectionN DNSRecordNewResponseLOCDataLatDirection = "N"
- DNSRecordNewResponseLOCDataLatDirectionS DNSRecordNewResponseLOCDataLatDirection = "S"
-)
-
-// Longitude direction.
-type DNSRecordNewResponseLOCDataLongDirection string
-
-const (
- DNSRecordNewResponseLOCDataLongDirectionE DNSRecordNewResponseLOCDataLongDirection = "E"
- DNSRecordNewResponseLOCDataLongDirectionW DNSRecordNewResponseLOCDataLongDirection = "W"
-)
-
-// Record type.
-type DNSRecordNewResponseLOCType string
-
-const (
- DNSRecordNewResponseLOCTypeLOC DNSRecordNewResponseLOCType = "LOC"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordNewResponseLOCMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordNewResponseLOCMetaJSON `json:"-"`
-}
-
-// dnsRecordNewResponseLOCMetaJSON contains the JSON metadata for the struct
-// [DNSRecordNewResponseLOCMeta]
-type dnsRecordNewResponseLOCMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordNewResponseLOCMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordNewResponseLOCMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordNewResponseLOCTTLNumber].
-type DNSRecordNewResponseLOCTTL interface {
- ImplementsDNSRecordNewResponseLocttl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordNewResponseLOCTTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordNewResponseLOCTTLNumber(0)),
- },
- )
-}
-
-type DNSRecordNewResponseLOCTTLNumber float64
-
-const (
- DNSRecordNewResponseLOCTTLNumber1 DNSRecordNewResponseLOCTTLNumber = 1
-)
-
-type DNSRecordNewResponseMX struct {
- // A valid mail server hostname.
- Content string `json:"content,required" format:"hostname"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Required for MX, SRV and URI records; unused by other record types. Records with
- // lower priorities are preferred.
- Priority float64 `json:"priority,required"`
- // Record type.
- Type DNSRecordNewResponseMXType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordNewResponseMXMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordNewResponseMXTTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordNewResponseMXJSON `json:"-"`
-}
-
-// dnsRecordNewResponseMXJSON contains the JSON metadata for the struct
-// [DNSRecordNewResponseMX]
-type dnsRecordNewResponseMXJSON struct {
- Content apijson.Field
- Name apijson.Field
- Priority apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordNewResponseMX) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordNewResponseMXJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordNewResponseMX) implementsDNSRecordNewResponse() {}
-
-// Record type.
-type DNSRecordNewResponseMXType string
-
-const (
- DNSRecordNewResponseMXTypeMX DNSRecordNewResponseMXType = "MX"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordNewResponseMXMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordNewResponseMXMetaJSON `json:"-"`
-}
-
-// dnsRecordNewResponseMXMetaJSON contains the JSON metadata for the struct
-// [DNSRecordNewResponseMXMeta]
-type dnsRecordNewResponseMXMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordNewResponseMXMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordNewResponseMXMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordNewResponseMXTTLNumber].
-type DNSRecordNewResponseMXTTL interface {
- ImplementsDNSRecordNewResponseMxttl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordNewResponseMXTTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordNewResponseMXTTLNumber(0)),
- },
- )
-}
-
-type DNSRecordNewResponseMXTTLNumber float64
-
-const (
- DNSRecordNewResponseMXTTLNumber1 DNSRecordNewResponseMXTTLNumber = 1
-)
-
-type DNSRecordNewResponseNAPTR struct {
- // Components of a NAPTR record.
- Data DNSRecordNewResponseNAPTRData `json:"data,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordNewResponseNAPTRType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // Formatted NAPTR content. See 'data' to set NAPTR properties.
- Content string `json:"content"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordNewResponseNAPTRMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordNewResponseNAPTRTTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordNewResponseNAPTRJSON `json:"-"`
-}
-
-// dnsRecordNewResponseNAPTRJSON contains the JSON metadata for the struct
-// [DNSRecordNewResponseNAPTR]
-type dnsRecordNewResponseNAPTRJSON struct {
- Data apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- Content apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordNewResponseNAPTR) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordNewResponseNAPTRJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordNewResponseNAPTR) implementsDNSRecordNewResponse() {}
-
-// Components of a NAPTR record.
-type DNSRecordNewResponseNAPTRData struct {
- // Flags.
- Flags string `json:"flags"`
- // Order.
- Order float64 `json:"order"`
- // Preference.
- Preference float64 `json:"preference"`
- // Regex.
- Regex string `json:"regex"`
- // Replacement.
- Replacement string `json:"replacement"`
- // Service.
- Service string `json:"service"`
- JSON dnsRecordNewResponseNAPTRDataJSON `json:"-"`
-}
-
-// dnsRecordNewResponseNAPTRDataJSON contains the JSON metadata for the struct
-// [DNSRecordNewResponseNAPTRData]
-type dnsRecordNewResponseNAPTRDataJSON struct {
- Flags apijson.Field
- Order apijson.Field
- Preference apijson.Field
- Regex apijson.Field
- Replacement apijson.Field
- Service apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordNewResponseNAPTRData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordNewResponseNAPTRDataJSON) RawJSON() string {
- return r.raw
-}
-
-// Record type.
-type DNSRecordNewResponseNAPTRType string
-
-const (
- DNSRecordNewResponseNAPTRTypeNAPTR DNSRecordNewResponseNAPTRType = "NAPTR"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordNewResponseNAPTRMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordNewResponseNAPTRMetaJSON `json:"-"`
-}
-
-// dnsRecordNewResponseNAPTRMetaJSON contains the JSON metadata for the struct
-// [DNSRecordNewResponseNAPTRMeta]
-type dnsRecordNewResponseNAPTRMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordNewResponseNAPTRMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordNewResponseNAPTRMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordNewResponseNAPTRTTLNumber].
-type DNSRecordNewResponseNAPTRTTL interface {
- ImplementsDNSRecordNewResponseNaptrttl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordNewResponseNAPTRTTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordNewResponseNAPTRTTLNumber(0)),
- },
- )
-}
-
-type DNSRecordNewResponseNAPTRTTLNumber float64
-
-const (
- DNSRecordNewResponseNAPTRTTLNumber1 DNSRecordNewResponseNAPTRTTLNumber = 1
-)
-
-type DNSRecordNewResponseNS struct {
- // A valid name server host name.
- Content interface{} `json:"content,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordNewResponseNSType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordNewResponseNSMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordNewResponseNSTTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordNewResponseNSJSON `json:"-"`
-}
-
-// dnsRecordNewResponseNSJSON contains the JSON metadata for the struct
-// [DNSRecordNewResponseNS]
-type dnsRecordNewResponseNSJSON struct {
- Content apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordNewResponseNS) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordNewResponseNSJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordNewResponseNS) implementsDNSRecordNewResponse() {}
-
-// Record type.
-type DNSRecordNewResponseNSType string
-
-const (
- DNSRecordNewResponseNSTypeNS DNSRecordNewResponseNSType = "NS"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordNewResponseNSMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordNewResponseNSMetaJSON `json:"-"`
-}
-
-// dnsRecordNewResponseNSMetaJSON contains the JSON metadata for the struct
-// [DNSRecordNewResponseNSMeta]
-type dnsRecordNewResponseNSMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordNewResponseNSMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordNewResponseNSMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordNewResponseNSTTLNumber].
-type DNSRecordNewResponseNSTTL interface {
- ImplementsDNSRecordNewResponseNsttl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordNewResponseNSTTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordNewResponseNSTTLNumber(0)),
- },
- )
-}
-
-type DNSRecordNewResponseNSTTLNumber float64
-
-const (
- DNSRecordNewResponseNSTTLNumber1 DNSRecordNewResponseNSTTLNumber = 1
-)
-
-type DNSRecordNewResponsePTR struct {
- // Domain name pointing to the address.
- Content string `json:"content,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordNewResponsePTRType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordNewResponsePTRMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordNewResponsePTRTTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordNewResponsePTRJSON `json:"-"`
-}
-
-// dnsRecordNewResponsePTRJSON contains the JSON metadata for the struct
-// [DNSRecordNewResponsePTR]
-type dnsRecordNewResponsePTRJSON struct {
- Content apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordNewResponsePTR) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordNewResponsePTRJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordNewResponsePTR) implementsDNSRecordNewResponse() {}
-
-// Record type.
-type DNSRecordNewResponsePTRType string
-
-const (
- DNSRecordNewResponsePTRTypePTR DNSRecordNewResponsePTRType = "PTR"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordNewResponsePTRMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordNewResponsePTRMetaJSON `json:"-"`
-}
-
-// dnsRecordNewResponsePTRMetaJSON contains the JSON metadata for the struct
-// [DNSRecordNewResponsePTRMeta]
-type dnsRecordNewResponsePTRMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordNewResponsePTRMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordNewResponsePTRMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordNewResponsePTRTTLNumber].
-type DNSRecordNewResponsePTRTTL interface {
- ImplementsDNSRecordNewResponsePtrttl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordNewResponsePTRTTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordNewResponsePTRTTLNumber(0)),
- },
- )
-}
-
-type DNSRecordNewResponsePTRTTLNumber float64
-
-const (
- DNSRecordNewResponsePTRTTLNumber1 DNSRecordNewResponsePTRTTLNumber = 1
-)
-
-type DNSRecordNewResponseSmimea struct {
- // Components of a SMIMEA record.
- Data DNSRecordNewResponseSmimeaData `json:"data,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordNewResponseSmimeaType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // Formatted SMIMEA content. See 'data' to set SMIMEA properties.
- Content string `json:"content"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordNewResponseSmimeaMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordNewResponseSmimeaTTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordNewResponseSmimeaJSON `json:"-"`
-}
-
-// dnsRecordNewResponseSmimeaJSON contains the JSON metadata for the struct
-// [DNSRecordNewResponseSmimea]
-type dnsRecordNewResponseSmimeaJSON struct {
- Data apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- Content apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordNewResponseSmimea) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordNewResponseSmimeaJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordNewResponseSmimea) implementsDNSRecordNewResponse() {}
-
-// Components of a SMIMEA record.
-type DNSRecordNewResponseSmimeaData struct {
- // Certificate.
- Certificate string `json:"certificate"`
- // Matching Type.
- MatchingType float64 `json:"matching_type"`
- // Selector.
- Selector float64 `json:"selector"`
- // Usage.
- Usage float64 `json:"usage"`
- JSON dnsRecordNewResponseSmimeaDataJSON `json:"-"`
-}
-
-// dnsRecordNewResponseSmimeaDataJSON contains the JSON metadata for the struct
-// [DNSRecordNewResponseSmimeaData]
-type dnsRecordNewResponseSmimeaDataJSON struct {
- Certificate apijson.Field
- MatchingType apijson.Field
- Selector apijson.Field
- Usage apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordNewResponseSmimeaData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordNewResponseSmimeaDataJSON) RawJSON() string {
- return r.raw
-}
-
-// Record type.
-type DNSRecordNewResponseSmimeaType string
-
-const (
- DNSRecordNewResponseSmimeaTypeSmimea DNSRecordNewResponseSmimeaType = "SMIMEA"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordNewResponseSmimeaMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordNewResponseSmimeaMetaJSON `json:"-"`
-}
-
-// dnsRecordNewResponseSmimeaMetaJSON contains the JSON metadata for the struct
-// [DNSRecordNewResponseSmimeaMeta]
-type dnsRecordNewResponseSmimeaMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordNewResponseSmimeaMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordNewResponseSmimeaMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordNewResponseSmimeaTTLNumber].
-type DNSRecordNewResponseSmimeaTTL interface {
- ImplementsDNSRecordNewResponseSmimeaTTL()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordNewResponseSmimeaTTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordNewResponseSmimeaTTLNumber(0)),
- },
- )
-}
-
-type DNSRecordNewResponseSmimeaTTLNumber float64
-
-const (
- DNSRecordNewResponseSmimeaTTLNumber1 DNSRecordNewResponseSmimeaTTLNumber = 1
-)
-
-type DNSRecordNewResponseSRV struct {
- // Components of a SRV record.
- Data DNSRecordNewResponseSRVData `json:"data,required"`
- // DNS record name (or @ for the zone apex) in Punycode. For SRV records, the first
- // label is normally a service and the second a protocol name, each starting with
- // an underscore.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordNewResponseSRVType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // Priority, weight, port, and SRV target. See 'data' for setting the individual
- // component values.
- Content string `json:"content"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordNewResponseSRVMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordNewResponseSRVTTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordNewResponseSRVJSON `json:"-"`
-}
-
-// dnsRecordNewResponseSRVJSON contains the JSON metadata for the struct
-// [DNSRecordNewResponseSRV]
-type dnsRecordNewResponseSRVJSON struct {
- Data apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- Content apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordNewResponseSRV) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordNewResponseSRVJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordNewResponseSRV) implementsDNSRecordNewResponse() {}
-
-// Components of a SRV record.
-type DNSRecordNewResponseSRVData struct {
- // A valid hostname. Deprecated in favor of the regular 'name' outside the data
- // map. This data map field represents the remainder of the full 'name' after the
- // service and protocol.
- Name string `json:"name" format:"hostname"`
- // The port of the service.
- Port float64 `json:"port"`
- // Required for MX, SRV and URI records; unused by other record types. Records with
- // lower priorities are preferred.
- Priority float64 `json:"priority"`
- // A valid protocol, prefixed with an underscore. Deprecated in favor of the
- // regular 'name' outside the data map. This data map field normally represents the
- // second label of that 'name'.
- Proto string `json:"proto"`
- // A service type, prefixed with an underscore. Deprecated in favor of the regular
- // 'name' outside the data map. This data map field normally represents the first
- // label of that 'name'.
- Service string `json:"service"`
- // A valid hostname.
- Target string `json:"target" format:"hostname"`
- // The record weight.
- Weight float64 `json:"weight"`
- JSON dnsRecordNewResponseSRVDataJSON `json:"-"`
-}
-
-// dnsRecordNewResponseSRVDataJSON contains the JSON metadata for the struct
-// [DNSRecordNewResponseSRVData]
-type dnsRecordNewResponseSRVDataJSON struct {
- Name apijson.Field
- Port apijson.Field
- Priority apijson.Field
- Proto apijson.Field
- Service apijson.Field
- Target apijson.Field
- Weight apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordNewResponseSRVData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordNewResponseSRVDataJSON) RawJSON() string {
- return r.raw
-}
-
-// Record type.
-type DNSRecordNewResponseSRVType string
-
-const (
- DNSRecordNewResponseSRVTypeSRV DNSRecordNewResponseSRVType = "SRV"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordNewResponseSRVMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordNewResponseSRVMetaJSON `json:"-"`
-}
-
-// dnsRecordNewResponseSRVMetaJSON contains the JSON metadata for the struct
-// [DNSRecordNewResponseSRVMeta]
-type dnsRecordNewResponseSRVMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordNewResponseSRVMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordNewResponseSRVMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordNewResponseSRVTTLNumber].
-type DNSRecordNewResponseSRVTTL interface {
- ImplementsDNSRecordNewResponseSrvttl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordNewResponseSRVTTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordNewResponseSRVTTLNumber(0)),
- },
- )
-}
-
-type DNSRecordNewResponseSRVTTLNumber float64
-
-const (
- DNSRecordNewResponseSRVTTLNumber1 DNSRecordNewResponseSRVTTLNumber = 1
-)
-
-type DNSRecordNewResponseSSHFP struct {
- // Components of a SSHFP record.
- Data DNSRecordNewResponseSSHFPData `json:"data,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordNewResponseSSHFPType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // Formatted SSHFP content. See 'data' to set SSHFP properties.
- Content string `json:"content"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordNewResponseSSHFPMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordNewResponseSSHFPTTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordNewResponseSSHFPJSON `json:"-"`
-}
-
-// dnsRecordNewResponseSSHFPJSON contains the JSON metadata for the struct
-// [DNSRecordNewResponseSSHFP]
-type dnsRecordNewResponseSSHFPJSON struct {
- Data apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- Content apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordNewResponseSSHFP) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordNewResponseSSHFPJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordNewResponseSSHFP) implementsDNSRecordNewResponse() {}
-
-// Components of a SSHFP record.
-type DNSRecordNewResponseSSHFPData struct {
- // algorithm.
- Algorithm float64 `json:"algorithm"`
- // fingerprint.
- Fingerprint string `json:"fingerprint"`
- // type.
- Type float64 `json:"type"`
- JSON dnsRecordNewResponseSSHFPDataJSON `json:"-"`
-}
-
-// dnsRecordNewResponseSSHFPDataJSON contains the JSON metadata for the struct
-// [DNSRecordNewResponseSSHFPData]
-type dnsRecordNewResponseSSHFPDataJSON struct {
- Algorithm apijson.Field
- Fingerprint apijson.Field
- Type apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordNewResponseSSHFPData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordNewResponseSSHFPDataJSON) RawJSON() string {
- return r.raw
-}
-
-// Record type.
-type DNSRecordNewResponseSSHFPType string
-
-const (
- DNSRecordNewResponseSSHFPTypeSSHFP DNSRecordNewResponseSSHFPType = "SSHFP"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordNewResponseSSHFPMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordNewResponseSSHFPMetaJSON `json:"-"`
-}
-
-// dnsRecordNewResponseSSHFPMetaJSON contains the JSON metadata for the struct
-// [DNSRecordNewResponseSSHFPMeta]
-type dnsRecordNewResponseSSHFPMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordNewResponseSSHFPMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordNewResponseSSHFPMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordNewResponseSSHFPTTLNumber].
-type DNSRecordNewResponseSSHFPTTL interface {
- ImplementsDNSRecordNewResponseSshfpttl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordNewResponseSSHFPTTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordNewResponseSSHFPTTLNumber(0)),
- },
- )
-}
-
-type DNSRecordNewResponseSSHFPTTLNumber float64
-
-const (
- DNSRecordNewResponseSSHFPTTLNumber1 DNSRecordNewResponseSSHFPTTLNumber = 1
-)
-
-type DNSRecordNewResponseSVCB struct {
- // Components of a SVCB record.
- Data DNSRecordNewResponseSVCBData `json:"data,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordNewResponseSVCBType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // Formatted SVCB content. See 'data' to set SVCB properties.
- Content string `json:"content"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordNewResponseSVCBMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordNewResponseSVCBTTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordNewResponseSVCBJSON `json:"-"`
-}
-
-// dnsRecordNewResponseSVCBJSON contains the JSON metadata for the struct
-// [DNSRecordNewResponseSVCB]
-type dnsRecordNewResponseSVCBJSON struct {
- Data apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- Content apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordNewResponseSVCB) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordNewResponseSVCBJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordNewResponseSVCB) implementsDNSRecordNewResponse() {}
-
-// Components of a SVCB record.
-type DNSRecordNewResponseSVCBData struct {
- // priority.
- Priority float64 `json:"priority"`
- // target.
- Target string `json:"target"`
- // value.
- Value string `json:"value"`
- JSON dnsRecordNewResponseSVCBDataJSON `json:"-"`
-}
-
-// dnsRecordNewResponseSVCBDataJSON contains the JSON metadata for the struct
-// [DNSRecordNewResponseSVCBData]
-type dnsRecordNewResponseSVCBDataJSON struct {
- Priority apijson.Field
- Target apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordNewResponseSVCBData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordNewResponseSVCBDataJSON) RawJSON() string {
- return r.raw
-}
-
-// Record type.
-type DNSRecordNewResponseSVCBType string
-
-const (
- DNSRecordNewResponseSVCBTypeSVCB DNSRecordNewResponseSVCBType = "SVCB"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordNewResponseSVCBMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordNewResponseSVCBMetaJSON `json:"-"`
-}
-
-// dnsRecordNewResponseSVCBMetaJSON contains the JSON metadata for the struct
-// [DNSRecordNewResponseSVCBMeta]
-type dnsRecordNewResponseSVCBMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordNewResponseSVCBMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordNewResponseSVCBMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordNewResponseSVCBTTLNumber].
-type DNSRecordNewResponseSVCBTTL interface {
- ImplementsDNSRecordNewResponseSvcbttl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordNewResponseSVCBTTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordNewResponseSVCBTTLNumber(0)),
- },
- )
-}
-
-type DNSRecordNewResponseSVCBTTLNumber float64
-
-const (
- DNSRecordNewResponseSVCBTTLNumber1 DNSRecordNewResponseSVCBTTLNumber = 1
-)
-
-type DNSRecordNewResponseTLSA struct {
- // Components of a TLSA record.
- Data DNSRecordNewResponseTLSAData `json:"data,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordNewResponseTLSAType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // Formatted TLSA content. See 'data' to set TLSA properties.
- Content string `json:"content"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordNewResponseTLSAMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordNewResponseTLSATTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordNewResponseTLSAJSON `json:"-"`
-}
-
-// dnsRecordNewResponseTLSAJSON contains the JSON metadata for the struct
-// [DNSRecordNewResponseTLSA]
-type dnsRecordNewResponseTLSAJSON struct {
- Data apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- Content apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordNewResponseTLSA) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordNewResponseTLSAJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordNewResponseTLSA) implementsDNSRecordNewResponse() {}
-
-// Components of a TLSA record.
-type DNSRecordNewResponseTLSAData struct {
- // certificate.
- Certificate string `json:"certificate"`
- // Matching Type.
- MatchingType float64 `json:"matching_type"`
- // Selector.
- Selector float64 `json:"selector"`
- // Usage.
- Usage float64 `json:"usage"`
- JSON dnsRecordNewResponseTLSADataJSON `json:"-"`
-}
-
-// dnsRecordNewResponseTLSADataJSON contains the JSON metadata for the struct
-// [DNSRecordNewResponseTLSAData]
-type dnsRecordNewResponseTLSADataJSON struct {
- Certificate apijson.Field
- MatchingType apijson.Field
- Selector apijson.Field
- Usage apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordNewResponseTLSAData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordNewResponseTLSADataJSON) RawJSON() string {
- return r.raw
-}
-
-// Record type.
-type DNSRecordNewResponseTLSAType string
-
-const (
- DNSRecordNewResponseTLSATypeTLSA DNSRecordNewResponseTLSAType = "TLSA"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordNewResponseTLSAMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordNewResponseTLSAMetaJSON `json:"-"`
-}
-
-// dnsRecordNewResponseTLSAMetaJSON contains the JSON metadata for the struct
-// [DNSRecordNewResponseTLSAMeta]
-type dnsRecordNewResponseTLSAMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordNewResponseTLSAMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordNewResponseTLSAMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordNewResponseTLSATTLNumber].
-type DNSRecordNewResponseTLSATTL interface {
- ImplementsDNSRecordNewResponseTlsattl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordNewResponseTLSATTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordNewResponseTLSATTLNumber(0)),
- },
- )
-}
-
-type DNSRecordNewResponseTLSATTLNumber float64
-
-const (
- DNSRecordNewResponseTLSATTLNumber1 DNSRecordNewResponseTLSATTLNumber = 1
-)
-
-type DNSRecordNewResponseTXT struct {
- // Text content for the record.
- Content string `json:"content,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordNewResponseTXTType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordNewResponseTXTMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordNewResponseTXTTTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordNewResponseTXTJSON `json:"-"`
-}
-
-// dnsRecordNewResponseTXTJSON contains the JSON metadata for the struct
-// [DNSRecordNewResponseTXT]
-type dnsRecordNewResponseTXTJSON struct {
- Content apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordNewResponseTXT) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordNewResponseTXTJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordNewResponseTXT) implementsDNSRecordNewResponse() {}
-
-// Record type.
-type DNSRecordNewResponseTXTType string
-
-const (
- DNSRecordNewResponseTXTTypeTXT DNSRecordNewResponseTXTType = "TXT"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordNewResponseTXTMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordNewResponseTXTMetaJSON `json:"-"`
-}
-
-// dnsRecordNewResponseTXTMetaJSON contains the JSON metadata for the struct
-// [DNSRecordNewResponseTXTMeta]
-type dnsRecordNewResponseTXTMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordNewResponseTXTMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordNewResponseTXTMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordNewResponseTXTTTLNumber].
-type DNSRecordNewResponseTXTTTL interface {
- ImplementsDNSRecordNewResponseTxtttl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordNewResponseTXTTTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordNewResponseTXTTTLNumber(0)),
- },
- )
-}
-
-type DNSRecordNewResponseTXTTTLNumber float64
-
-const (
- DNSRecordNewResponseTXTTTLNumber1 DNSRecordNewResponseTXTTTLNumber = 1
-)
-
-type DNSRecordNewResponseURI struct {
- // Components of a URI record.
- Data DNSRecordNewResponseURIData `json:"data,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Required for MX, SRV and URI records; unused by other record types. Records with
- // lower priorities are preferred.
- Priority float64 `json:"priority,required"`
- // Record type.
- Type DNSRecordNewResponseURIType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // Formatted URI content. See 'data' to set URI properties.
- Content string `json:"content"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordNewResponseURIMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordNewResponseURITTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordNewResponseURIJSON `json:"-"`
-}
-
-// dnsRecordNewResponseURIJSON contains the JSON metadata for the struct
-// [DNSRecordNewResponseURI]
-type dnsRecordNewResponseURIJSON struct {
- Data apijson.Field
- Name apijson.Field
- Priority apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- Content apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordNewResponseURI) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordNewResponseURIJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordNewResponseURI) implementsDNSRecordNewResponse() {}
-
-// Components of a URI record.
-type DNSRecordNewResponseURIData struct {
- // The record content.
- Content string `json:"content"`
- // The record weight.
- Weight float64 `json:"weight"`
- JSON dnsRecordNewResponseURIDataJSON `json:"-"`
-}
-
-// dnsRecordNewResponseURIDataJSON contains the JSON metadata for the struct
-// [DNSRecordNewResponseURIData]
-type dnsRecordNewResponseURIDataJSON struct {
- Content apijson.Field
- Weight apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordNewResponseURIData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordNewResponseURIDataJSON) RawJSON() string {
- return r.raw
-}
-
-// Record type.
-type DNSRecordNewResponseURIType string
-
-const (
- DNSRecordNewResponseURITypeURI DNSRecordNewResponseURIType = "URI"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordNewResponseURIMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordNewResponseURIMetaJSON `json:"-"`
-}
-
-// dnsRecordNewResponseURIMetaJSON contains the JSON metadata for the struct
-// [DNSRecordNewResponseURIMeta]
-type dnsRecordNewResponseURIMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordNewResponseURIMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordNewResponseURIMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordNewResponseURITTLNumber].
-type DNSRecordNewResponseURITTL interface {
- ImplementsDNSRecordNewResponseUrittl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordNewResponseURITTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordNewResponseURITTLNumber(0)),
- },
- )
-}
-
-type DNSRecordNewResponseURITTLNumber float64
-
-const (
- DNSRecordNewResponseURITTLNumber1 DNSRecordNewResponseURITTLNumber = 1
-)
-
-// Union satisfied by [DNSRecordUpdateResponseA], [DNSRecordUpdateResponseAAAA],
-// [DNSRecordUpdateResponseCAA], [DNSRecordUpdateResponseCert],
-// [DNSRecordUpdateResponseCNAME], [DNSRecordUpdateResponseDNSKEY],
-// [DNSRecordUpdateResponseDS], [DNSRecordUpdateResponseHTTPS],
-// [DNSRecordUpdateResponseLOC], [DNSRecordUpdateResponseMX],
-// [DNSRecordUpdateResponseNAPTR], [DNSRecordUpdateResponseNS],
-// [DNSRecordUpdateResponsePTR], [DNSRecordUpdateResponseSmimea],
-// [DNSRecordUpdateResponseSRV], [DNSRecordUpdateResponseSSHFP],
-// [DNSRecordUpdateResponseSVCB], [DNSRecordUpdateResponseTLSA],
-// [DNSRecordUpdateResponseTXT] or [DNSRecordUpdateResponseURI].
-type DNSRecordUpdateResponse interface {
- implementsDNSRecordUpdateResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordUpdateResponse)(nil)).Elem(),
- "type",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordUpdateResponseA{}),
- DiscriminatorValue: "A",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordUpdateResponseAAAA{}),
- DiscriminatorValue: "AAAA",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordUpdateResponseCAA{}),
- DiscriminatorValue: "CAA",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordUpdateResponseCert{}),
- DiscriminatorValue: "CERT",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordUpdateResponseCNAME{}),
- DiscriminatorValue: "CNAME",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordUpdateResponseDNSKEY{}),
- DiscriminatorValue: "DNSKEY",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordUpdateResponseDS{}),
- DiscriminatorValue: "DS",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordUpdateResponseHTTPS{}),
- DiscriminatorValue: "HTTPS",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordUpdateResponseLOC{}),
- DiscriminatorValue: "LOC",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordUpdateResponseMX{}),
- DiscriminatorValue: "MX",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordUpdateResponseNAPTR{}),
- DiscriminatorValue: "NAPTR",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordUpdateResponseNS{}),
- DiscriminatorValue: "NS",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordUpdateResponsePTR{}),
- DiscriminatorValue: "PTR",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordUpdateResponseSmimea{}),
- DiscriminatorValue: "SMIMEA",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordUpdateResponseSRV{}),
- DiscriminatorValue: "SRV",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordUpdateResponseSSHFP{}),
- DiscriminatorValue: "SSHFP",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordUpdateResponseSVCB{}),
- DiscriminatorValue: "SVCB",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordUpdateResponseTLSA{}),
- DiscriminatorValue: "TLSA",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordUpdateResponseTXT{}),
- DiscriminatorValue: "TXT",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordUpdateResponseURI{}),
- DiscriminatorValue: "URI",
- },
- )
-}
-
-type DNSRecordUpdateResponseA struct {
- // A valid IPv4 address.
- Content string `json:"content,required" format:"ipv4"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordUpdateResponseAType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordUpdateResponseAMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Whether the record is receiving the performance and security benefits of
- // Cloudflare.
- Proxied bool `json:"proxied"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordUpdateResponseATTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordUpdateResponseAJSON `json:"-"`
-}
-
-// dnsRecordUpdateResponseAJSON contains the JSON metadata for the struct
-// [DNSRecordUpdateResponseA]
-type dnsRecordUpdateResponseAJSON struct {
- Content apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Proxied apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordUpdateResponseA) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordUpdateResponseAJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordUpdateResponseA) implementsDNSRecordUpdateResponse() {}
-
-// Record type.
-type DNSRecordUpdateResponseAType string
-
-const (
- DNSRecordUpdateResponseATypeA DNSRecordUpdateResponseAType = "A"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordUpdateResponseAMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordUpdateResponseAMetaJSON `json:"-"`
-}
-
-// dnsRecordUpdateResponseAMetaJSON contains the JSON metadata for the struct
-// [DNSRecordUpdateResponseAMeta]
-type dnsRecordUpdateResponseAMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordUpdateResponseAMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordUpdateResponseAMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordUpdateResponseATTLNumber].
-type DNSRecordUpdateResponseATTL interface {
- ImplementsDNSRecordUpdateResponseAttl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordUpdateResponseATTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordUpdateResponseATTLNumber(0)),
- },
- )
-}
-
-type DNSRecordUpdateResponseATTLNumber float64
-
-const (
- DNSRecordUpdateResponseATTLNumber1 DNSRecordUpdateResponseATTLNumber = 1
-)
-
-type DNSRecordUpdateResponseAAAA struct {
- // A valid IPv6 address.
- Content string `json:"content,required" format:"ipv6"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordUpdateResponseAAAAType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordUpdateResponseAAAAMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Whether the record is receiving the performance and security benefits of
- // Cloudflare.
- Proxied bool `json:"proxied"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordUpdateResponseAAAATTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordUpdateResponseAAAAJSON `json:"-"`
-}
-
-// dnsRecordUpdateResponseAAAAJSON contains the JSON metadata for the struct
-// [DNSRecordUpdateResponseAAAA]
-type dnsRecordUpdateResponseAAAAJSON struct {
- Content apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Proxied apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordUpdateResponseAAAA) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordUpdateResponseAAAAJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordUpdateResponseAAAA) implementsDNSRecordUpdateResponse() {}
-
-// Record type.
-type DNSRecordUpdateResponseAAAAType string
-
-const (
- DNSRecordUpdateResponseAAAATypeAAAA DNSRecordUpdateResponseAAAAType = "AAAA"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordUpdateResponseAAAAMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordUpdateResponseAAAAMetaJSON `json:"-"`
-}
-
-// dnsRecordUpdateResponseAAAAMetaJSON contains the JSON metadata for the struct
-// [DNSRecordUpdateResponseAAAAMeta]
-type dnsRecordUpdateResponseAAAAMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordUpdateResponseAAAAMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordUpdateResponseAAAAMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or
-// [DNSRecordUpdateResponseAAAATTLNumber].
-type DNSRecordUpdateResponseAAAATTL interface {
- ImplementsDNSRecordUpdateResponseAaaattl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordUpdateResponseAAAATTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordUpdateResponseAAAATTLNumber(0)),
- },
- )
-}
-
-type DNSRecordUpdateResponseAAAATTLNumber float64
-
-const (
- DNSRecordUpdateResponseAAAATTLNumber1 DNSRecordUpdateResponseAAAATTLNumber = 1
-)
-
-type DNSRecordUpdateResponseCAA struct {
- // Components of a CAA record.
- Data DNSRecordUpdateResponseCAAData `json:"data,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordUpdateResponseCAAType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // Formatted CAA content. See 'data' to set CAA properties.
- Content string `json:"content"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordUpdateResponseCAAMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordUpdateResponseCAATTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordUpdateResponseCAAJSON `json:"-"`
-}
-
-// dnsRecordUpdateResponseCAAJSON contains the JSON metadata for the struct
-// [DNSRecordUpdateResponseCAA]
-type dnsRecordUpdateResponseCAAJSON struct {
- Data apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- Content apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordUpdateResponseCAA) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordUpdateResponseCAAJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordUpdateResponseCAA) implementsDNSRecordUpdateResponse() {}
-
-// Components of a CAA record.
-type DNSRecordUpdateResponseCAAData struct {
- // Flags for the CAA record.
- Flags float64 `json:"flags"`
- // Name of the property controlled by this record (e.g.: issue, issuewild, iodef).
- Tag string `json:"tag"`
- // Value of the record. This field's semantics depend on the chosen tag.
- Value string `json:"value"`
- JSON dnsRecordUpdateResponseCAADataJSON `json:"-"`
-}
-
-// dnsRecordUpdateResponseCAADataJSON contains the JSON metadata for the struct
-// [DNSRecordUpdateResponseCAAData]
-type dnsRecordUpdateResponseCAADataJSON struct {
- Flags apijson.Field
- Tag apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordUpdateResponseCAAData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordUpdateResponseCAADataJSON) RawJSON() string {
- return r.raw
-}
-
-// Record type.
-type DNSRecordUpdateResponseCAAType string
-
-const (
- DNSRecordUpdateResponseCAATypeCAA DNSRecordUpdateResponseCAAType = "CAA"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordUpdateResponseCAAMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordUpdateResponseCAAMetaJSON `json:"-"`
-}
-
-// dnsRecordUpdateResponseCAAMetaJSON contains the JSON metadata for the struct
-// [DNSRecordUpdateResponseCAAMeta]
-type dnsRecordUpdateResponseCAAMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordUpdateResponseCAAMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordUpdateResponseCAAMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordUpdateResponseCAATTLNumber].
-type DNSRecordUpdateResponseCAATTL interface {
- ImplementsDNSRecordUpdateResponseCaattl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordUpdateResponseCAATTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordUpdateResponseCAATTLNumber(0)),
- },
- )
-}
-
-type DNSRecordUpdateResponseCAATTLNumber float64
-
-const (
- DNSRecordUpdateResponseCAATTLNumber1 DNSRecordUpdateResponseCAATTLNumber = 1
-)
-
-type DNSRecordUpdateResponseCert struct {
- // Components of a CERT record.
- Data DNSRecordUpdateResponseCertData `json:"data,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordUpdateResponseCertType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // Formatted CERT content. See 'data' to set CERT properties.
- Content string `json:"content"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordUpdateResponseCertMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordUpdateResponseCertTTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordUpdateResponseCertJSON `json:"-"`
-}
-
-// dnsRecordUpdateResponseCertJSON contains the JSON metadata for the struct
-// [DNSRecordUpdateResponseCert]
-type dnsRecordUpdateResponseCertJSON struct {
- Data apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- Content apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordUpdateResponseCert) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordUpdateResponseCertJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordUpdateResponseCert) implementsDNSRecordUpdateResponse() {}
-
-// Components of a CERT record.
-type DNSRecordUpdateResponseCertData struct {
- // Algorithm.
- Algorithm float64 `json:"algorithm"`
- // Certificate.
- Certificate string `json:"certificate"`
- // Key Tag.
- KeyTag float64 `json:"key_tag"`
- // Type.
- Type float64 `json:"type"`
- JSON dnsRecordUpdateResponseCertDataJSON `json:"-"`
-}
-
-// dnsRecordUpdateResponseCertDataJSON contains the JSON metadata for the struct
-// [DNSRecordUpdateResponseCertData]
-type dnsRecordUpdateResponseCertDataJSON struct {
- Algorithm apijson.Field
- Certificate apijson.Field
- KeyTag apijson.Field
- Type apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordUpdateResponseCertData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordUpdateResponseCertDataJSON) RawJSON() string {
- return r.raw
-}
-
-// Record type.
-type DNSRecordUpdateResponseCertType string
-
-const (
- DNSRecordUpdateResponseCertTypeCert DNSRecordUpdateResponseCertType = "CERT"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordUpdateResponseCertMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordUpdateResponseCertMetaJSON `json:"-"`
-}
-
-// dnsRecordUpdateResponseCertMetaJSON contains the JSON metadata for the struct
-// [DNSRecordUpdateResponseCertMeta]
-type dnsRecordUpdateResponseCertMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordUpdateResponseCertMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordUpdateResponseCertMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or
-// [DNSRecordUpdateResponseCertTTLNumber].
-type DNSRecordUpdateResponseCertTTL interface {
- ImplementsDNSRecordUpdateResponseCertTTL()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordUpdateResponseCertTTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordUpdateResponseCertTTLNumber(0)),
- },
- )
-}
-
-type DNSRecordUpdateResponseCertTTLNumber float64
-
-const (
- DNSRecordUpdateResponseCertTTLNumber1 DNSRecordUpdateResponseCertTTLNumber = 1
-)
-
-type DNSRecordUpdateResponseCNAME struct {
- // A valid hostname. Must not match the record's name.
- Content interface{} `json:"content,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordUpdateResponseCNAMEType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordUpdateResponseCNAMEMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Whether the record is receiving the performance and security benefits of
- // Cloudflare.
- Proxied bool `json:"proxied"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordUpdateResponseCNAMETTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordUpdateResponseCNAMEJSON `json:"-"`
-}
-
-// dnsRecordUpdateResponseCNAMEJSON contains the JSON metadata for the struct
-// [DNSRecordUpdateResponseCNAME]
-type dnsRecordUpdateResponseCNAMEJSON struct {
- Content apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Proxied apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordUpdateResponseCNAME) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordUpdateResponseCNAMEJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordUpdateResponseCNAME) implementsDNSRecordUpdateResponse() {}
-
-// Record type.
-type DNSRecordUpdateResponseCNAMEType string
-
-const (
- DNSRecordUpdateResponseCNAMETypeCNAME DNSRecordUpdateResponseCNAMEType = "CNAME"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordUpdateResponseCNAMEMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordUpdateResponseCNAMEMetaJSON `json:"-"`
-}
-
-// dnsRecordUpdateResponseCNAMEMetaJSON contains the JSON metadata for the struct
-// [DNSRecordUpdateResponseCNAMEMeta]
-type dnsRecordUpdateResponseCNAMEMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordUpdateResponseCNAMEMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordUpdateResponseCNAMEMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or
-// [DNSRecordUpdateResponseCNAMETTLNumber].
-type DNSRecordUpdateResponseCNAMETTL interface {
- ImplementsDNSRecordUpdateResponseCnamettl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordUpdateResponseCNAMETTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordUpdateResponseCNAMETTLNumber(0)),
- },
- )
-}
-
-type DNSRecordUpdateResponseCNAMETTLNumber float64
-
-const (
- DNSRecordUpdateResponseCNAMETTLNumber1 DNSRecordUpdateResponseCNAMETTLNumber = 1
-)
-
-type DNSRecordUpdateResponseDNSKEY struct {
- // Components of a DNSKEY record.
- Data DNSRecordUpdateResponseDNSKEYData `json:"data,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordUpdateResponseDNSKEYType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // Formatted DNSKEY content. See 'data' to set DNSKEY properties.
- Content string `json:"content"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordUpdateResponseDNSKEYMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordUpdateResponseDNSKEYTTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordUpdateResponseDNSKEYJSON `json:"-"`
-}
-
-// dnsRecordUpdateResponseDNSKEYJSON contains the JSON metadata for the struct
-// [DNSRecordUpdateResponseDNSKEY]
-type dnsRecordUpdateResponseDNSKEYJSON struct {
- Data apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- Content apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordUpdateResponseDNSKEY) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordUpdateResponseDNSKEYJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordUpdateResponseDNSKEY) implementsDNSRecordUpdateResponse() {}
-
-// Components of a DNSKEY record.
-type DNSRecordUpdateResponseDNSKEYData struct {
- // Algorithm.
- Algorithm float64 `json:"algorithm"`
- // Flags.
- Flags float64 `json:"flags"`
- // Protocol.
- Protocol float64 `json:"protocol"`
- // Public Key.
- PublicKey string `json:"public_key"`
- JSON dnsRecordUpdateResponseDNSKEYDataJSON `json:"-"`
-}
-
-// dnsRecordUpdateResponseDNSKEYDataJSON contains the JSON metadata for the struct
-// [DNSRecordUpdateResponseDNSKEYData]
-type dnsRecordUpdateResponseDNSKEYDataJSON struct {
- Algorithm apijson.Field
- Flags apijson.Field
- Protocol apijson.Field
- PublicKey apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordUpdateResponseDNSKEYData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordUpdateResponseDNSKEYDataJSON) RawJSON() string {
- return r.raw
-}
-
-// Record type.
-type DNSRecordUpdateResponseDNSKEYType string
-
-const (
- DNSRecordUpdateResponseDNSKEYTypeDNSKEY DNSRecordUpdateResponseDNSKEYType = "DNSKEY"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordUpdateResponseDNSKEYMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordUpdateResponseDNSKEYMetaJSON `json:"-"`
-}
-
-// dnsRecordUpdateResponseDNSKEYMetaJSON contains the JSON metadata for the struct
-// [DNSRecordUpdateResponseDNSKEYMeta]
-type dnsRecordUpdateResponseDNSKEYMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordUpdateResponseDNSKEYMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordUpdateResponseDNSKEYMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or
-// [DNSRecordUpdateResponseDNSKEYTTLNumber].
-type DNSRecordUpdateResponseDNSKEYTTL interface {
- ImplementsDNSRecordUpdateResponseDnskeyttl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordUpdateResponseDNSKEYTTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordUpdateResponseDNSKEYTTLNumber(0)),
- },
- )
-}
-
-type DNSRecordUpdateResponseDNSKEYTTLNumber float64
-
-const (
- DNSRecordUpdateResponseDNSKEYTTLNumber1 DNSRecordUpdateResponseDNSKEYTTLNumber = 1
-)
-
-type DNSRecordUpdateResponseDS struct {
- // Components of a DS record.
- Data DNSRecordUpdateResponseDSData `json:"data,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordUpdateResponseDSType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // Formatted DS content. See 'data' to set DS properties.
- Content string `json:"content"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordUpdateResponseDSMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordUpdateResponseDSTTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordUpdateResponseDSJSON `json:"-"`
-}
-
-// dnsRecordUpdateResponseDSJSON contains the JSON metadata for the struct
-// [DNSRecordUpdateResponseDS]
-type dnsRecordUpdateResponseDSJSON struct {
- Data apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- Content apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordUpdateResponseDS) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordUpdateResponseDSJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordUpdateResponseDS) implementsDNSRecordUpdateResponse() {}
-
-// Components of a DS record.
-type DNSRecordUpdateResponseDSData struct {
- // Algorithm.
- Algorithm float64 `json:"algorithm"`
- // Digest.
- Digest string `json:"digest"`
- // Digest Type.
- DigestType float64 `json:"digest_type"`
- // Key Tag.
- KeyTag float64 `json:"key_tag"`
- JSON dnsRecordUpdateResponseDSDataJSON `json:"-"`
-}
-
-// dnsRecordUpdateResponseDSDataJSON contains the JSON metadata for the struct
-// [DNSRecordUpdateResponseDSData]
-type dnsRecordUpdateResponseDSDataJSON struct {
- Algorithm apijson.Field
- Digest apijson.Field
- DigestType apijson.Field
- KeyTag apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordUpdateResponseDSData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordUpdateResponseDSDataJSON) RawJSON() string {
- return r.raw
-}
-
-// Record type.
-type DNSRecordUpdateResponseDSType string
-
-const (
- DNSRecordUpdateResponseDSTypeDS DNSRecordUpdateResponseDSType = "DS"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordUpdateResponseDSMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordUpdateResponseDSMetaJSON `json:"-"`
-}
-
-// dnsRecordUpdateResponseDSMetaJSON contains the JSON metadata for the struct
-// [DNSRecordUpdateResponseDSMeta]
-type dnsRecordUpdateResponseDSMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordUpdateResponseDSMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordUpdateResponseDSMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordUpdateResponseDSTTLNumber].
-type DNSRecordUpdateResponseDSTTL interface {
- ImplementsDNSRecordUpdateResponseDsttl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordUpdateResponseDSTTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordUpdateResponseDSTTLNumber(0)),
- },
- )
-}
-
-type DNSRecordUpdateResponseDSTTLNumber float64
-
-const (
- DNSRecordUpdateResponseDSTTLNumber1 DNSRecordUpdateResponseDSTTLNumber = 1
-)
-
-type DNSRecordUpdateResponseHTTPS struct {
- // Components of a HTTPS record.
- Data DNSRecordUpdateResponseHTTPSData `json:"data,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordUpdateResponseHTTPSType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // Formatted HTTPS content. See 'data' to set HTTPS properties.
- Content string `json:"content"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordUpdateResponseHTTPSMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordUpdateResponseHTTPSTTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordUpdateResponseHTTPSJSON `json:"-"`
-}
-
-// dnsRecordUpdateResponseHTTPSJSON contains the JSON metadata for the struct
-// [DNSRecordUpdateResponseHTTPS]
-type dnsRecordUpdateResponseHTTPSJSON struct {
- Data apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- Content apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordUpdateResponseHTTPS) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordUpdateResponseHTTPSJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordUpdateResponseHTTPS) implementsDNSRecordUpdateResponse() {}
-
-// Components of a HTTPS record.
-type DNSRecordUpdateResponseHTTPSData struct {
- // priority.
- Priority float64 `json:"priority"`
- // target.
- Target string `json:"target"`
- // value.
- Value string `json:"value"`
- JSON dnsRecordUpdateResponseHTTPSDataJSON `json:"-"`
-}
-
-// dnsRecordUpdateResponseHTTPSDataJSON contains the JSON metadata for the struct
-// [DNSRecordUpdateResponseHTTPSData]
-type dnsRecordUpdateResponseHTTPSDataJSON struct {
- Priority apijson.Field
- Target apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordUpdateResponseHTTPSData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordUpdateResponseHTTPSDataJSON) RawJSON() string {
- return r.raw
-}
-
-// Record type.
-type DNSRecordUpdateResponseHTTPSType string
-
-const (
- DNSRecordUpdateResponseHTTPSTypeHTTPS DNSRecordUpdateResponseHTTPSType = "HTTPS"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordUpdateResponseHTTPSMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordUpdateResponseHTTPSMetaJSON `json:"-"`
-}
-
-// dnsRecordUpdateResponseHTTPSMetaJSON contains the JSON metadata for the struct
-// [DNSRecordUpdateResponseHTTPSMeta]
-type dnsRecordUpdateResponseHTTPSMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordUpdateResponseHTTPSMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordUpdateResponseHTTPSMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or
-// [DNSRecordUpdateResponseHTTPSTTLNumber].
-type DNSRecordUpdateResponseHTTPSTTL interface {
- ImplementsDNSRecordUpdateResponseHttpsttl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordUpdateResponseHTTPSTTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordUpdateResponseHTTPSTTLNumber(0)),
- },
- )
-}
-
-type DNSRecordUpdateResponseHTTPSTTLNumber float64
-
-const (
- DNSRecordUpdateResponseHTTPSTTLNumber1 DNSRecordUpdateResponseHTTPSTTLNumber = 1
-)
-
-type DNSRecordUpdateResponseLOC struct {
- // Components of a LOC record.
- Data DNSRecordUpdateResponseLOCData `json:"data,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordUpdateResponseLOCType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // Formatted LOC content. See 'data' to set LOC properties.
- Content string `json:"content"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordUpdateResponseLOCMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordUpdateResponseLOCTTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordUpdateResponseLOCJSON `json:"-"`
-}
-
-// dnsRecordUpdateResponseLOCJSON contains the JSON metadata for the struct
-// [DNSRecordUpdateResponseLOC]
-type dnsRecordUpdateResponseLOCJSON struct {
- Data apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- Content apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordUpdateResponseLOC) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordUpdateResponseLOCJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordUpdateResponseLOC) implementsDNSRecordUpdateResponse() {}
-
-// Components of a LOC record.
-type DNSRecordUpdateResponseLOCData struct {
- // Altitude of location in meters.
- Altitude float64 `json:"altitude"`
- // Degrees of latitude.
- LatDegrees float64 `json:"lat_degrees"`
- // Latitude direction.
- LatDirection DNSRecordUpdateResponseLOCDataLatDirection `json:"lat_direction"`
- // Minutes of latitude.
- LatMinutes float64 `json:"lat_minutes"`
- // Seconds of latitude.
- LatSeconds float64 `json:"lat_seconds"`
- // Degrees of longitude.
- LongDegrees float64 `json:"long_degrees"`
- // Longitude direction.
- LongDirection DNSRecordUpdateResponseLOCDataLongDirection `json:"long_direction"`
- // Minutes of longitude.
- LongMinutes float64 `json:"long_minutes"`
- // Seconds of longitude.
- LongSeconds float64 `json:"long_seconds"`
- // Horizontal precision of location.
- PrecisionHorz float64 `json:"precision_horz"`
- // Vertical precision of location.
- PrecisionVert float64 `json:"precision_vert"`
- // Size of location in meters.
- Size float64 `json:"size"`
- JSON dnsRecordUpdateResponseLOCDataJSON `json:"-"`
-}
-
-// dnsRecordUpdateResponseLOCDataJSON contains the JSON metadata for the struct
-// [DNSRecordUpdateResponseLOCData]
-type dnsRecordUpdateResponseLOCDataJSON struct {
- Altitude apijson.Field
- LatDegrees apijson.Field
- LatDirection apijson.Field
- LatMinutes apijson.Field
- LatSeconds apijson.Field
- LongDegrees apijson.Field
- LongDirection apijson.Field
- LongMinutes apijson.Field
- LongSeconds apijson.Field
- PrecisionHorz apijson.Field
- PrecisionVert apijson.Field
- Size apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordUpdateResponseLOCData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordUpdateResponseLOCDataJSON) RawJSON() string {
- return r.raw
-}
-
-// Latitude direction.
-type DNSRecordUpdateResponseLOCDataLatDirection string
-
-const (
- DNSRecordUpdateResponseLOCDataLatDirectionN DNSRecordUpdateResponseLOCDataLatDirection = "N"
- DNSRecordUpdateResponseLOCDataLatDirectionS DNSRecordUpdateResponseLOCDataLatDirection = "S"
-)
-
-// Longitude direction.
-type DNSRecordUpdateResponseLOCDataLongDirection string
-
-const (
- DNSRecordUpdateResponseLOCDataLongDirectionE DNSRecordUpdateResponseLOCDataLongDirection = "E"
- DNSRecordUpdateResponseLOCDataLongDirectionW DNSRecordUpdateResponseLOCDataLongDirection = "W"
-)
-
-// Record type.
-type DNSRecordUpdateResponseLOCType string
-
-const (
- DNSRecordUpdateResponseLOCTypeLOC DNSRecordUpdateResponseLOCType = "LOC"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordUpdateResponseLOCMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordUpdateResponseLOCMetaJSON `json:"-"`
-}
-
-// dnsRecordUpdateResponseLOCMetaJSON contains the JSON metadata for the struct
-// [DNSRecordUpdateResponseLOCMeta]
-type dnsRecordUpdateResponseLOCMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordUpdateResponseLOCMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordUpdateResponseLOCMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordUpdateResponseLOCTTLNumber].
-type DNSRecordUpdateResponseLOCTTL interface {
- ImplementsDNSRecordUpdateResponseLocttl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordUpdateResponseLOCTTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordUpdateResponseLOCTTLNumber(0)),
- },
- )
-}
-
-type DNSRecordUpdateResponseLOCTTLNumber float64
-
-const (
- DNSRecordUpdateResponseLOCTTLNumber1 DNSRecordUpdateResponseLOCTTLNumber = 1
-)
-
-type DNSRecordUpdateResponseMX struct {
- // A valid mail server hostname.
- Content string `json:"content,required" format:"hostname"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Required for MX, SRV and URI records; unused by other record types. Records with
- // lower priorities are preferred.
- Priority float64 `json:"priority,required"`
- // Record type.
- Type DNSRecordUpdateResponseMXType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordUpdateResponseMXMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordUpdateResponseMXTTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordUpdateResponseMXJSON `json:"-"`
-}
-
-// dnsRecordUpdateResponseMXJSON contains the JSON metadata for the struct
-// [DNSRecordUpdateResponseMX]
-type dnsRecordUpdateResponseMXJSON struct {
- Content apijson.Field
- Name apijson.Field
- Priority apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordUpdateResponseMX) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordUpdateResponseMXJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordUpdateResponseMX) implementsDNSRecordUpdateResponse() {}
-
-// Record type.
-type DNSRecordUpdateResponseMXType string
-
-const (
- DNSRecordUpdateResponseMXTypeMX DNSRecordUpdateResponseMXType = "MX"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordUpdateResponseMXMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordUpdateResponseMXMetaJSON `json:"-"`
-}
-
-// dnsRecordUpdateResponseMXMetaJSON contains the JSON metadata for the struct
-// [DNSRecordUpdateResponseMXMeta]
-type dnsRecordUpdateResponseMXMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordUpdateResponseMXMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordUpdateResponseMXMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordUpdateResponseMXTTLNumber].
-type DNSRecordUpdateResponseMXTTL interface {
- ImplementsDNSRecordUpdateResponseMxttl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordUpdateResponseMXTTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordUpdateResponseMXTTLNumber(0)),
- },
- )
-}
-
-type DNSRecordUpdateResponseMXTTLNumber float64
-
-const (
- DNSRecordUpdateResponseMXTTLNumber1 DNSRecordUpdateResponseMXTTLNumber = 1
-)
-
-type DNSRecordUpdateResponseNAPTR struct {
- // Components of a NAPTR record.
- Data DNSRecordUpdateResponseNAPTRData `json:"data,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordUpdateResponseNAPTRType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // Formatted NAPTR content. See 'data' to set NAPTR properties.
- Content string `json:"content"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordUpdateResponseNAPTRMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordUpdateResponseNAPTRTTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordUpdateResponseNAPTRJSON `json:"-"`
-}
-
-// dnsRecordUpdateResponseNAPTRJSON contains the JSON metadata for the struct
-// [DNSRecordUpdateResponseNAPTR]
-type dnsRecordUpdateResponseNAPTRJSON struct {
- Data apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- Content apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordUpdateResponseNAPTR) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordUpdateResponseNAPTRJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordUpdateResponseNAPTR) implementsDNSRecordUpdateResponse() {}
-
-// Components of a NAPTR record.
-type DNSRecordUpdateResponseNAPTRData struct {
- // Flags.
- Flags string `json:"flags"`
- // Order.
- Order float64 `json:"order"`
- // Preference.
- Preference float64 `json:"preference"`
- // Regex.
- Regex string `json:"regex"`
- // Replacement.
- Replacement string `json:"replacement"`
- // Service.
- Service string `json:"service"`
- JSON dnsRecordUpdateResponseNAPTRDataJSON `json:"-"`
-}
-
-// dnsRecordUpdateResponseNAPTRDataJSON contains the JSON metadata for the struct
-// [DNSRecordUpdateResponseNAPTRData]
-type dnsRecordUpdateResponseNAPTRDataJSON struct {
- Flags apijson.Field
- Order apijson.Field
- Preference apijson.Field
- Regex apijson.Field
- Replacement apijson.Field
- Service apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordUpdateResponseNAPTRData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordUpdateResponseNAPTRDataJSON) RawJSON() string {
- return r.raw
-}
-
-// Record type.
-type DNSRecordUpdateResponseNAPTRType string
-
-const (
- DNSRecordUpdateResponseNAPTRTypeNAPTR DNSRecordUpdateResponseNAPTRType = "NAPTR"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordUpdateResponseNAPTRMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordUpdateResponseNAPTRMetaJSON `json:"-"`
-}
-
-// dnsRecordUpdateResponseNAPTRMetaJSON contains the JSON metadata for the struct
-// [DNSRecordUpdateResponseNAPTRMeta]
-type dnsRecordUpdateResponseNAPTRMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordUpdateResponseNAPTRMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordUpdateResponseNAPTRMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or
-// [DNSRecordUpdateResponseNAPTRTTLNumber].
-type DNSRecordUpdateResponseNAPTRTTL interface {
- ImplementsDNSRecordUpdateResponseNaptrttl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordUpdateResponseNAPTRTTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordUpdateResponseNAPTRTTLNumber(0)),
- },
- )
-}
-
-type DNSRecordUpdateResponseNAPTRTTLNumber float64
-
-const (
- DNSRecordUpdateResponseNAPTRTTLNumber1 DNSRecordUpdateResponseNAPTRTTLNumber = 1
-)
-
-type DNSRecordUpdateResponseNS struct {
- // A valid name server host name.
- Content interface{} `json:"content,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordUpdateResponseNSType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordUpdateResponseNSMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordUpdateResponseNSTTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordUpdateResponseNSJSON `json:"-"`
-}
-
-// dnsRecordUpdateResponseNSJSON contains the JSON metadata for the struct
-// [DNSRecordUpdateResponseNS]
-type dnsRecordUpdateResponseNSJSON struct {
- Content apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordUpdateResponseNS) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordUpdateResponseNSJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordUpdateResponseNS) implementsDNSRecordUpdateResponse() {}
-
-// Record type.
-type DNSRecordUpdateResponseNSType string
-
-const (
- DNSRecordUpdateResponseNSTypeNS DNSRecordUpdateResponseNSType = "NS"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordUpdateResponseNSMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordUpdateResponseNSMetaJSON `json:"-"`
-}
-
-// dnsRecordUpdateResponseNSMetaJSON contains the JSON metadata for the struct
-// [DNSRecordUpdateResponseNSMeta]
-type dnsRecordUpdateResponseNSMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordUpdateResponseNSMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordUpdateResponseNSMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordUpdateResponseNSTTLNumber].
-type DNSRecordUpdateResponseNSTTL interface {
- ImplementsDNSRecordUpdateResponseNsttl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordUpdateResponseNSTTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordUpdateResponseNSTTLNumber(0)),
- },
- )
-}
-
-type DNSRecordUpdateResponseNSTTLNumber float64
-
-const (
- DNSRecordUpdateResponseNSTTLNumber1 DNSRecordUpdateResponseNSTTLNumber = 1
-)
-
-type DNSRecordUpdateResponsePTR struct {
- // Domain name pointing to the address.
- Content string `json:"content,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordUpdateResponsePTRType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordUpdateResponsePTRMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordUpdateResponsePTRTTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordUpdateResponsePTRJSON `json:"-"`
-}
-
-// dnsRecordUpdateResponsePTRJSON contains the JSON metadata for the struct
-// [DNSRecordUpdateResponsePTR]
-type dnsRecordUpdateResponsePTRJSON struct {
- Content apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordUpdateResponsePTR) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordUpdateResponsePTRJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordUpdateResponsePTR) implementsDNSRecordUpdateResponse() {}
-
-// Record type.
-type DNSRecordUpdateResponsePTRType string
-
-const (
- DNSRecordUpdateResponsePTRTypePTR DNSRecordUpdateResponsePTRType = "PTR"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordUpdateResponsePTRMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordUpdateResponsePTRMetaJSON `json:"-"`
-}
-
-// dnsRecordUpdateResponsePTRMetaJSON contains the JSON metadata for the struct
-// [DNSRecordUpdateResponsePTRMeta]
-type dnsRecordUpdateResponsePTRMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordUpdateResponsePTRMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordUpdateResponsePTRMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordUpdateResponsePTRTTLNumber].
-type DNSRecordUpdateResponsePTRTTL interface {
- ImplementsDNSRecordUpdateResponsePtrttl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordUpdateResponsePTRTTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordUpdateResponsePTRTTLNumber(0)),
- },
- )
-}
-
-type DNSRecordUpdateResponsePTRTTLNumber float64
-
-const (
- DNSRecordUpdateResponsePTRTTLNumber1 DNSRecordUpdateResponsePTRTTLNumber = 1
-)
-
-type DNSRecordUpdateResponseSmimea struct {
- // Components of a SMIMEA record.
- Data DNSRecordUpdateResponseSmimeaData `json:"data,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordUpdateResponseSmimeaType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // Formatted SMIMEA content. See 'data' to set SMIMEA properties.
- Content string `json:"content"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordUpdateResponseSmimeaMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordUpdateResponseSmimeaTTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordUpdateResponseSmimeaJSON `json:"-"`
-}
-
-// dnsRecordUpdateResponseSmimeaJSON contains the JSON metadata for the struct
-// [DNSRecordUpdateResponseSmimea]
-type dnsRecordUpdateResponseSmimeaJSON struct {
- Data apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- Content apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordUpdateResponseSmimea) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordUpdateResponseSmimeaJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordUpdateResponseSmimea) implementsDNSRecordUpdateResponse() {}
-
-// Components of a SMIMEA record.
-type DNSRecordUpdateResponseSmimeaData struct {
- // Certificate.
- Certificate string `json:"certificate"`
- // Matching Type.
- MatchingType float64 `json:"matching_type"`
- // Selector.
- Selector float64 `json:"selector"`
- // Usage.
- Usage float64 `json:"usage"`
- JSON dnsRecordUpdateResponseSmimeaDataJSON `json:"-"`
-}
-
-// dnsRecordUpdateResponseSmimeaDataJSON contains the JSON metadata for the struct
-// [DNSRecordUpdateResponseSmimeaData]
-type dnsRecordUpdateResponseSmimeaDataJSON struct {
- Certificate apijson.Field
- MatchingType apijson.Field
- Selector apijson.Field
- Usage apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordUpdateResponseSmimeaData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordUpdateResponseSmimeaDataJSON) RawJSON() string {
- return r.raw
-}
-
-// Record type.
-type DNSRecordUpdateResponseSmimeaType string
-
-const (
- DNSRecordUpdateResponseSmimeaTypeSmimea DNSRecordUpdateResponseSmimeaType = "SMIMEA"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordUpdateResponseSmimeaMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordUpdateResponseSmimeaMetaJSON `json:"-"`
-}
-
-// dnsRecordUpdateResponseSmimeaMetaJSON contains the JSON metadata for the struct
-// [DNSRecordUpdateResponseSmimeaMeta]
-type dnsRecordUpdateResponseSmimeaMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordUpdateResponseSmimeaMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordUpdateResponseSmimeaMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or
-// [DNSRecordUpdateResponseSmimeaTTLNumber].
-type DNSRecordUpdateResponseSmimeaTTL interface {
- ImplementsDNSRecordUpdateResponseSmimeaTTL()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordUpdateResponseSmimeaTTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordUpdateResponseSmimeaTTLNumber(0)),
- },
- )
-}
-
-type DNSRecordUpdateResponseSmimeaTTLNumber float64
-
-const (
- DNSRecordUpdateResponseSmimeaTTLNumber1 DNSRecordUpdateResponseSmimeaTTLNumber = 1
-)
-
-type DNSRecordUpdateResponseSRV struct {
- // Components of a SRV record.
- Data DNSRecordUpdateResponseSRVData `json:"data,required"`
- // DNS record name (or @ for the zone apex) in Punycode. For SRV records, the first
- // label is normally a service and the second a protocol name, each starting with
- // an underscore.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordUpdateResponseSRVType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // Priority, weight, port, and SRV target. See 'data' for setting the individual
- // component values.
- Content string `json:"content"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordUpdateResponseSRVMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordUpdateResponseSRVTTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordUpdateResponseSRVJSON `json:"-"`
-}
-
-// dnsRecordUpdateResponseSRVJSON contains the JSON metadata for the struct
-// [DNSRecordUpdateResponseSRV]
-type dnsRecordUpdateResponseSRVJSON struct {
- Data apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- Content apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordUpdateResponseSRV) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordUpdateResponseSRVJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordUpdateResponseSRV) implementsDNSRecordUpdateResponse() {}
-
-// Components of a SRV record.
-type DNSRecordUpdateResponseSRVData struct {
- // A valid hostname. Deprecated in favor of the regular 'name' outside the data
- // map. This data map field represents the remainder of the full 'name' after the
- // service and protocol.
- Name string `json:"name" format:"hostname"`
- // The port of the service.
- Port float64 `json:"port"`
- // Required for MX, SRV and URI records; unused by other record types. Records with
- // lower priorities are preferred.
- Priority float64 `json:"priority"`
- // A valid protocol, prefixed with an underscore. Deprecated in favor of the
- // regular 'name' outside the data map. This data map field normally represents the
- // second label of that 'name'.
- Proto string `json:"proto"`
- // A service type, prefixed with an underscore. Deprecated in favor of the regular
- // 'name' outside the data map. This data map field normally represents the first
- // label of that 'name'.
- Service string `json:"service"`
- // A valid hostname.
- Target string `json:"target" format:"hostname"`
- // The record weight.
- Weight float64 `json:"weight"`
- JSON dnsRecordUpdateResponseSRVDataJSON `json:"-"`
-}
-
-// dnsRecordUpdateResponseSRVDataJSON contains the JSON metadata for the struct
-// [DNSRecordUpdateResponseSRVData]
-type dnsRecordUpdateResponseSRVDataJSON struct {
- Name apijson.Field
- Port apijson.Field
- Priority apijson.Field
- Proto apijson.Field
- Service apijson.Field
- Target apijson.Field
- Weight apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordUpdateResponseSRVData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordUpdateResponseSRVDataJSON) RawJSON() string {
- return r.raw
-}
-
-// Record type.
-type DNSRecordUpdateResponseSRVType string
-
-const (
- DNSRecordUpdateResponseSRVTypeSRV DNSRecordUpdateResponseSRVType = "SRV"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordUpdateResponseSRVMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordUpdateResponseSRVMetaJSON `json:"-"`
-}
-
-// dnsRecordUpdateResponseSRVMetaJSON contains the JSON metadata for the struct
-// [DNSRecordUpdateResponseSRVMeta]
-type dnsRecordUpdateResponseSRVMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordUpdateResponseSRVMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordUpdateResponseSRVMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordUpdateResponseSRVTTLNumber].
-type DNSRecordUpdateResponseSRVTTL interface {
- ImplementsDNSRecordUpdateResponseSrvttl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordUpdateResponseSRVTTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordUpdateResponseSRVTTLNumber(0)),
- },
- )
-}
-
-type DNSRecordUpdateResponseSRVTTLNumber float64
-
-const (
- DNSRecordUpdateResponseSRVTTLNumber1 DNSRecordUpdateResponseSRVTTLNumber = 1
-)
-
-type DNSRecordUpdateResponseSSHFP struct {
- // Components of a SSHFP record.
- Data DNSRecordUpdateResponseSSHFPData `json:"data,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordUpdateResponseSSHFPType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // Formatted SSHFP content. See 'data' to set SSHFP properties.
- Content string `json:"content"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordUpdateResponseSSHFPMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordUpdateResponseSSHFPTTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordUpdateResponseSSHFPJSON `json:"-"`
-}
-
-// dnsRecordUpdateResponseSSHFPJSON contains the JSON metadata for the struct
-// [DNSRecordUpdateResponseSSHFP]
-type dnsRecordUpdateResponseSSHFPJSON struct {
- Data apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- Content apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordUpdateResponseSSHFP) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordUpdateResponseSSHFPJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordUpdateResponseSSHFP) implementsDNSRecordUpdateResponse() {}
-
-// Components of a SSHFP record.
-type DNSRecordUpdateResponseSSHFPData struct {
- // algorithm.
- Algorithm float64 `json:"algorithm"`
- // fingerprint.
- Fingerprint string `json:"fingerprint"`
- // type.
- Type float64 `json:"type"`
- JSON dnsRecordUpdateResponseSSHFPDataJSON `json:"-"`
-}
-
-// dnsRecordUpdateResponseSSHFPDataJSON contains the JSON metadata for the struct
-// [DNSRecordUpdateResponseSSHFPData]
-type dnsRecordUpdateResponseSSHFPDataJSON struct {
- Algorithm apijson.Field
- Fingerprint apijson.Field
- Type apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordUpdateResponseSSHFPData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordUpdateResponseSSHFPDataJSON) RawJSON() string {
- return r.raw
-}
-
-// Record type.
-type DNSRecordUpdateResponseSSHFPType string
-
-const (
- DNSRecordUpdateResponseSSHFPTypeSSHFP DNSRecordUpdateResponseSSHFPType = "SSHFP"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordUpdateResponseSSHFPMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordUpdateResponseSSHFPMetaJSON `json:"-"`
-}
-
-// dnsRecordUpdateResponseSSHFPMetaJSON contains the JSON metadata for the struct
-// [DNSRecordUpdateResponseSSHFPMeta]
-type dnsRecordUpdateResponseSSHFPMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordUpdateResponseSSHFPMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordUpdateResponseSSHFPMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or
-// [DNSRecordUpdateResponseSSHFPTTLNumber].
-type DNSRecordUpdateResponseSSHFPTTL interface {
- ImplementsDNSRecordUpdateResponseSshfpttl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordUpdateResponseSSHFPTTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordUpdateResponseSSHFPTTLNumber(0)),
- },
- )
-}
-
-type DNSRecordUpdateResponseSSHFPTTLNumber float64
-
-const (
- DNSRecordUpdateResponseSSHFPTTLNumber1 DNSRecordUpdateResponseSSHFPTTLNumber = 1
-)
-
-type DNSRecordUpdateResponseSVCB struct {
- // Components of a SVCB record.
- Data DNSRecordUpdateResponseSVCBData `json:"data,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordUpdateResponseSVCBType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // Formatted SVCB content. See 'data' to set SVCB properties.
- Content string `json:"content"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordUpdateResponseSVCBMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordUpdateResponseSVCBTTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordUpdateResponseSVCBJSON `json:"-"`
-}
-
-// dnsRecordUpdateResponseSVCBJSON contains the JSON metadata for the struct
-// [DNSRecordUpdateResponseSVCB]
-type dnsRecordUpdateResponseSVCBJSON struct {
- Data apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- Content apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordUpdateResponseSVCB) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordUpdateResponseSVCBJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordUpdateResponseSVCB) implementsDNSRecordUpdateResponse() {}
-
-// Components of a SVCB record.
-type DNSRecordUpdateResponseSVCBData struct {
- // priority.
- Priority float64 `json:"priority"`
- // target.
- Target string `json:"target"`
- // value.
- Value string `json:"value"`
- JSON dnsRecordUpdateResponseSVCBDataJSON `json:"-"`
-}
-
-// dnsRecordUpdateResponseSVCBDataJSON contains the JSON metadata for the struct
-// [DNSRecordUpdateResponseSVCBData]
-type dnsRecordUpdateResponseSVCBDataJSON struct {
- Priority apijson.Field
- Target apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordUpdateResponseSVCBData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordUpdateResponseSVCBDataJSON) RawJSON() string {
- return r.raw
-}
-
-// Record type.
-type DNSRecordUpdateResponseSVCBType string
-
-const (
- DNSRecordUpdateResponseSVCBTypeSVCB DNSRecordUpdateResponseSVCBType = "SVCB"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordUpdateResponseSVCBMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordUpdateResponseSVCBMetaJSON `json:"-"`
-}
-
-// dnsRecordUpdateResponseSVCBMetaJSON contains the JSON metadata for the struct
-// [DNSRecordUpdateResponseSVCBMeta]
-type dnsRecordUpdateResponseSVCBMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordUpdateResponseSVCBMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordUpdateResponseSVCBMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or
-// [DNSRecordUpdateResponseSVCBTTLNumber].
-type DNSRecordUpdateResponseSVCBTTL interface {
- ImplementsDNSRecordUpdateResponseSvcbttl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordUpdateResponseSVCBTTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordUpdateResponseSVCBTTLNumber(0)),
- },
- )
-}
-
-type DNSRecordUpdateResponseSVCBTTLNumber float64
-
-const (
- DNSRecordUpdateResponseSVCBTTLNumber1 DNSRecordUpdateResponseSVCBTTLNumber = 1
-)
-
-type DNSRecordUpdateResponseTLSA struct {
- // Components of a TLSA record.
- Data DNSRecordUpdateResponseTLSAData `json:"data,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordUpdateResponseTLSAType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // Formatted TLSA content. See 'data' to set TLSA properties.
- Content string `json:"content"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordUpdateResponseTLSAMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordUpdateResponseTLSATTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordUpdateResponseTLSAJSON `json:"-"`
-}
-
-// dnsRecordUpdateResponseTLSAJSON contains the JSON metadata for the struct
-// [DNSRecordUpdateResponseTLSA]
-type dnsRecordUpdateResponseTLSAJSON struct {
- Data apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- Content apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordUpdateResponseTLSA) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordUpdateResponseTLSAJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordUpdateResponseTLSA) implementsDNSRecordUpdateResponse() {}
-
-// Components of a TLSA record.
-type DNSRecordUpdateResponseTLSAData struct {
- // certificate.
- Certificate string `json:"certificate"`
- // Matching Type.
- MatchingType float64 `json:"matching_type"`
- // Selector.
- Selector float64 `json:"selector"`
- // Usage.
- Usage float64 `json:"usage"`
- JSON dnsRecordUpdateResponseTLSADataJSON `json:"-"`
-}
-
-// dnsRecordUpdateResponseTLSADataJSON contains the JSON metadata for the struct
-// [DNSRecordUpdateResponseTLSAData]
-type dnsRecordUpdateResponseTLSADataJSON struct {
- Certificate apijson.Field
- MatchingType apijson.Field
- Selector apijson.Field
- Usage apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordUpdateResponseTLSAData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordUpdateResponseTLSADataJSON) RawJSON() string {
- return r.raw
-}
-
-// Record type.
-type DNSRecordUpdateResponseTLSAType string
-
-const (
- DNSRecordUpdateResponseTLSATypeTLSA DNSRecordUpdateResponseTLSAType = "TLSA"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordUpdateResponseTLSAMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordUpdateResponseTLSAMetaJSON `json:"-"`
-}
-
-// dnsRecordUpdateResponseTLSAMetaJSON contains the JSON metadata for the struct
-// [DNSRecordUpdateResponseTLSAMeta]
-type dnsRecordUpdateResponseTLSAMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordUpdateResponseTLSAMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordUpdateResponseTLSAMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or
-// [DNSRecordUpdateResponseTLSATTLNumber].
-type DNSRecordUpdateResponseTLSATTL interface {
- ImplementsDNSRecordUpdateResponseTlsattl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordUpdateResponseTLSATTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordUpdateResponseTLSATTLNumber(0)),
- },
- )
-}
-
-type DNSRecordUpdateResponseTLSATTLNumber float64
-
-const (
- DNSRecordUpdateResponseTLSATTLNumber1 DNSRecordUpdateResponseTLSATTLNumber = 1
-)
-
-type DNSRecordUpdateResponseTXT struct {
- // Text content for the record.
- Content string `json:"content,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordUpdateResponseTXTType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordUpdateResponseTXTMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordUpdateResponseTXTTTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordUpdateResponseTXTJSON `json:"-"`
-}
-
-// dnsRecordUpdateResponseTXTJSON contains the JSON metadata for the struct
-// [DNSRecordUpdateResponseTXT]
-type dnsRecordUpdateResponseTXTJSON struct {
- Content apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordUpdateResponseTXT) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordUpdateResponseTXTJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordUpdateResponseTXT) implementsDNSRecordUpdateResponse() {}
-
-// Record type.
-type DNSRecordUpdateResponseTXTType string
-
-const (
- DNSRecordUpdateResponseTXTTypeTXT DNSRecordUpdateResponseTXTType = "TXT"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordUpdateResponseTXTMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordUpdateResponseTXTMetaJSON `json:"-"`
-}
-
-// dnsRecordUpdateResponseTXTMetaJSON contains the JSON metadata for the struct
-// [DNSRecordUpdateResponseTXTMeta]
-type dnsRecordUpdateResponseTXTMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordUpdateResponseTXTMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordUpdateResponseTXTMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordUpdateResponseTXTTTLNumber].
-type DNSRecordUpdateResponseTXTTTL interface {
- ImplementsDNSRecordUpdateResponseTxtttl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordUpdateResponseTXTTTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordUpdateResponseTXTTTLNumber(0)),
- },
- )
-}
-
-type DNSRecordUpdateResponseTXTTTLNumber float64
-
-const (
- DNSRecordUpdateResponseTXTTTLNumber1 DNSRecordUpdateResponseTXTTTLNumber = 1
-)
-
-type DNSRecordUpdateResponseURI struct {
- // Components of a URI record.
- Data DNSRecordUpdateResponseURIData `json:"data,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Required for MX, SRV and URI records; unused by other record types. Records with
- // lower priorities are preferred.
- Priority float64 `json:"priority,required"`
- // Record type.
- Type DNSRecordUpdateResponseURIType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // Formatted URI content. See 'data' to set URI properties.
- Content string `json:"content"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordUpdateResponseURIMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordUpdateResponseURITTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordUpdateResponseURIJSON `json:"-"`
-}
-
-// dnsRecordUpdateResponseURIJSON contains the JSON metadata for the struct
-// [DNSRecordUpdateResponseURI]
-type dnsRecordUpdateResponseURIJSON struct {
- Data apijson.Field
- Name apijson.Field
- Priority apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- Content apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordUpdateResponseURI) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordUpdateResponseURIJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordUpdateResponseURI) implementsDNSRecordUpdateResponse() {}
-
-// Components of a URI record.
-type DNSRecordUpdateResponseURIData struct {
- // The record content.
- Content string `json:"content"`
- // The record weight.
- Weight float64 `json:"weight"`
- JSON dnsRecordUpdateResponseURIDataJSON `json:"-"`
-}
-
-// dnsRecordUpdateResponseURIDataJSON contains the JSON metadata for the struct
-// [DNSRecordUpdateResponseURIData]
-type dnsRecordUpdateResponseURIDataJSON struct {
- Content apijson.Field
- Weight apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordUpdateResponseURIData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordUpdateResponseURIDataJSON) RawJSON() string {
- return r.raw
-}
-
-// Record type.
-type DNSRecordUpdateResponseURIType string
-
-const (
- DNSRecordUpdateResponseURITypeURI DNSRecordUpdateResponseURIType = "URI"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordUpdateResponseURIMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordUpdateResponseURIMetaJSON `json:"-"`
-}
-
-// dnsRecordUpdateResponseURIMetaJSON contains the JSON metadata for the struct
-// [DNSRecordUpdateResponseURIMeta]
-type dnsRecordUpdateResponseURIMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordUpdateResponseURIMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordUpdateResponseURIMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordUpdateResponseURITTLNumber].
-type DNSRecordUpdateResponseURITTL interface {
- ImplementsDNSRecordUpdateResponseUrittl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordUpdateResponseURITTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordUpdateResponseURITTLNumber(0)),
- },
- )
-}
-
-type DNSRecordUpdateResponseURITTLNumber float64
-
-const (
- DNSRecordUpdateResponseURITTLNumber1 DNSRecordUpdateResponseURITTLNumber = 1
-)
-
-// Union satisfied by [DNSRecordListResponseA], [DNSRecordListResponseAAAA],
-// [DNSRecordListResponseCAA], [DNSRecordListResponseCert],
-// [DNSRecordListResponseCNAME], [DNSRecordListResponseDNSKEY],
-// [DNSRecordListResponseDS], [DNSRecordListResponseHTTPS],
-// [DNSRecordListResponseLOC], [DNSRecordListResponseMX],
-// [DNSRecordListResponseNAPTR], [DNSRecordListResponseNS],
-// [DNSRecordListResponsePTR], [DNSRecordListResponseSmimea],
-// [DNSRecordListResponseSRV], [DNSRecordListResponseSSHFP],
-// [DNSRecordListResponseSVCB], [DNSRecordListResponseTLSA],
-// [DNSRecordListResponseTXT] or [DNSRecordListResponseURI].
-type DNSRecordListResponse interface {
- implementsDNSRecordListResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordListResponse)(nil)).Elem(),
- "type",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordListResponseA{}),
- DiscriminatorValue: "A",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordListResponseAAAA{}),
- DiscriminatorValue: "AAAA",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordListResponseCAA{}),
- DiscriminatorValue: "CAA",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordListResponseCert{}),
- DiscriminatorValue: "CERT",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordListResponseCNAME{}),
- DiscriminatorValue: "CNAME",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordListResponseDNSKEY{}),
- DiscriminatorValue: "DNSKEY",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordListResponseDS{}),
- DiscriminatorValue: "DS",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordListResponseHTTPS{}),
- DiscriminatorValue: "HTTPS",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordListResponseLOC{}),
- DiscriminatorValue: "LOC",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordListResponseMX{}),
- DiscriminatorValue: "MX",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordListResponseNAPTR{}),
- DiscriminatorValue: "NAPTR",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordListResponseNS{}),
- DiscriminatorValue: "NS",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordListResponsePTR{}),
- DiscriminatorValue: "PTR",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordListResponseSmimea{}),
- DiscriminatorValue: "SMIMEA",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordListResponseSRV{}),
- DiscriminatorValue: "SRV",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordListResponseSSHFP{}),
- DiscriminatorValue: "SSHFP",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordListResponseSVCB{}),
- DiscriminatorValue: "SVCB",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordListResponseTLSA{}),
- DiscriminatorValue: "TLSA",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordListResponseTXT{}),
- DiscriminatorValue: "TXT",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordListResponseURI{}),
- DiscriminatorValue: "URI",
- },
- )
-}
-
-type DNSRecordListResponseA struct {
- // A valid IPv4 address.
- Content string `json:"content,required" format:"ipv4"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordListResponseAType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordListResponseAMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Whether the record is receiving the performance and security benefits of
- // Cloudflare.
- Proxied bool `json:"proxied"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordListResponseATTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordListResponseAJSON `json:"-"`
-}
-
-// dnsRecordListResponseAJSON contains the JSON metadata for the struct
-// [DNSRecordListResponseA]
-type dnsRecordListResponseAJSON struct {
- Content apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Proxied apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordListResponseA) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordListResponseAJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordListResponseA) implementsDNSRecordListResponse() {}
-
-// Record type.
-type DNSRecordListResponseAType string
-
-const (
- DNSRecordListResponseATypeA DNSRecordListResponseAType = "A"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordListResponseAMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordListResponseAMetaJSON `json:"-"`
-}
-
-// dnsRecordListResponseAMetaJSON contains the JSON metadata for the struct
-// [DNSRecordListResponseAMeta]
-type dnsRecordListResponseAMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordListResponseAMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordListResponseAMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordListResponseATTLNumber].
-type DNSRecordListResponseATTL interface {
- ImplementsDNSRecordListResponseAttl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordListResponseATTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordListResponseATTLNumber(0)),
- },
- )
-}
-
-type DNSRecordListResponseATTLNumber float64
-
-const (
- DNSRecordListResponseATTLNumber1 DNSRecordListResponseATTLNumber = 1
-)
-
-type DNSRecordListResponseAAAA struct {
- // A valid IPv6 address.
- Content string `json:"content,required" format:"ipv6"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordListResponseAAAAType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordListResponseAAAAMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Whether the record is receiving the performance and security benefits of
- // Cloudflare.
- Proxied bool `json:"proxied"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordListResponseAAAATTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordListResponseAAAAJSON `json:"-"`
-}
-
-// dnsRecordListResponseAAAAJSON contains the JSON metadata for the struct
-// [DNSRecordListResponseAAAA]
-type dnsRecordListResponseAAAAJSON struct {
- Content apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Proxied apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordListResponseAAAA) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordListResponseAAAAJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordListResponseAAAA) implementsDNSRecordListResponse() {}
-
-// Record type.
-type DNSRecordListResponseAAAAType string
-
-const (
- DNSRecordListResponseAAAATypeAAAA DNSRecordListResponseAAAAType = "AAAA"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordListResponseAAAAMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordListResponseAAAAMetaJSON `json:"-"`
-}
-
-// dnsRecordListResponseAAAAMetaJSON contains the JSON metadata for the struct
-// [DNSRecordListResponseAAAAMeta]
-type dnsRecordListResponseAAAAMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordListResponseAAAAMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordListResponseAAAAMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordListResponseAAAATTLNumber].
-type DNSRecordListResponseAAAATTL interface {
- ImplementsDNSRecordListResponseAaaattl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordListResponseAAAATTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordListResponseAAAATTLNumber(0)),
- },
- )
-}
-
-type DNSRecordListResponseAAAATTLNumber float64
-
-const (
- DNSRecordListResponseAAAATTLNumber1 DNSRecordListResponseAAAATTLNumber = 1
-)
-
-type DNSRecordListResponseCAA struct {
- // Components of a CAA record.
- Data DNSRecordListResponseCAAData `json:"data,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordListResponseCAAType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // Formatted CAA content. See 'data' to set CAA properties.
- Content string `json:"content"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordListResponseCAAMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordListResponseCAATTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordListResponseCAAJSON `json:"-"`
-}
-
-// dnsRecordListResponseCAAJSON contains the JSON metadata for the struct
-// [DNSRecordListResponseCAA]
-type dnsRecordListResponseCAAJSON struct {
- Data apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- Content apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordListResponseCAA) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordListResponseCAAJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordListResponseCAA) implementsDNSRecordListResponse() {}
-
-// Components of a CAA record.
-type DNSRecordListResponseCAAData struct {
- // Flags for the CAA record.
- Flags float64 `json:"flags"`
- // Name of the property controlled by this record (e.g.: issue, issuewild, iodef).
- Tag string `json:"tag"`
- // Value of the record. This field's semantics depend on the chosen tag.
- Value string `json:"value"`
- JSON dnsRecordListResponseCAADataJSON `json:"-"`
-}
-
-// dnsRecordListResponseCAADataJSON contains the JSON metadata for the struct
-// [DNSRecordListResponseCAAData]
-type dnsRecordListResponseCAADataJSON struct {
- Flags apijson.Field
- Tag apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordListResponseCAAData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordListResponseCAADataJSON) RawJSON() string {
- return r.raw
-}
-
-// Record type.
-type DNSRecordListResponseCAAType string
-
-const (
- DNSRecordListResponseCAATypeCAA DNSRecordListResponseCAAType = "CAA"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordListResponseCAAMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordListResponseCAAMetaJSON `json:"-"`
-}
-
-// dnsRecordListResponseCAAMetaJSON contains the JSON metadata for the struct
-// [DNSRecordListResponseCAAMeta]
-type dnsRecordListResponseCAAMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordListResponseCAAMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordListResponseCAAMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordListResponseCAATTLNumber].
-type DNSRecordListResponseCAATTL interface {
- ImplementsDNSRecordListResponseCaattl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordListResponseCAATTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordListResponseCAATTLNumber(0)),
- },
- )
-}
-
-type DNSRecordListResponseCAATTLNumber float64
-
-const (
- DNSRecordListResponseCAATTLNumber1 DNSRecordListResponseCAATTLNumber = 1
-)
-
-type DNSRecordListResponseCert struct {
- // Components of a CERT record.
- Data DNSRecordListResponseCertData `json:"data,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordListResponseCertType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // Formatted CERT content. See 'data' to set CERT properties.
- Content string `json:"content"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordListResponseCertMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordListResponseCertTTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordListResponseCertJSON `json:"-"`
-}
-
-// dnsRecordListResponseCertJSON contains the JSON metadata for the struct
-// [DNSRecordListResponseCert]
-type dnsRecordListResponseCertJSON struct {
- Data apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- Content apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordListResponseCert) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordListResponseCertJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordListResponseCert) implementsDNSRecordListResponse() {}
-
-// Components of a CERT record.
-type DNSRecordListResponseCertData struct {
- // Algorithm.
- Algorithm float64 `json:"algorithm"`
- // Certificate.
- Certificate string `json:"certificate"`
- // Key Tag.
- KeyTag float64 `json:"key_tag"`
- // Type.
- Type float64 `json:"type"`
- JSON dnsRecordListResponseCertDataJSON `json:"-"`
-}
-
-// dnsRecordListResponseCertDataJSON contains the JSON metadata for the struct
-// [DNSRecordListResponseCertData]
-type dnsRecordListResponseCertDataJSON struct {
- Algorithm apijson.Field
- Certificate apijson.Field
- KeyTag apijson.Field
- Type apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordListResponseCertData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordListResponseCertDataJSON) RawJSON() string {
- return r.raw
-}
-
-// Record type.
-type DNSRecordListResponseCertType string
-
-const (
- DNSRecordListResponseCertTypeCert DNSRecordListResponseCertType = "CERT"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordListResponseCertMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordListResponseCertMetaJSON `json:"-"`
-}
-
-// dnsRecordListResponseCertMetaJSON contains the JSON metadata for the struct
-// [DNSRecordListResponseCertMeta]
-type dnsRecordListResponseCertMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordListResponseCertMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordListResponseCertMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordListResponseCertTTLNumber].
-type DNSRecordListResponseCertTTL interface {
- ImplementsDNSRecordListResponseCertTTL()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordListResponseCertTTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordListResponseCertTTLNumber(0)),
- },
- )
-}
-
-type DNSRecordListResponseCertTTLNumber float64
-
-const (
- DNSRecordListResponseCertTTLNumber1 DNSRecordListResponseCertTTLNumber = 1
-)
-
-type DNSRecordListResponseCNAME struct {
- // A valid hostname. Must not match the record's name.
- Content interface{} `json:"content,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordListResponseCNAMEType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordListResponseCNAMEMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Whether the record is receiving the performance and security benefits of
- // Cloudflare.
- Proxied bool `json:"proxied"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordListResponseCNAMETTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordListResponseCNAMEJSON `json:"-"`
-}
-
-// dnsRecordListResponseCNAMEJSON contains the JSON metadata for the struct
-// [DNSRecordListResponseCNAME]
-type dnsRecordListResponseCNAMEJSON struct {
- Content apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Proxied apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordListResponseCNAME) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordListResponseCNAMEJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordListResponseCNAME) implementsDNSRecordListResponse() {}
-
-// Record type.
-type DNSRecordListResponseCNAMEType string
-
-const (
- DNSRecordListResponseCNAMETypeCNAME DNSRecordListResponseCNAMEType = "CNAME"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordListResponseCNAMEMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordListResponseCNAMEMetaJSON `json:"-"`
-}
-
-// dnsRecordListResponseCNAMEMetaJSON contains the JSON metadata for the struct
-// [DNSRecordListResponseCNAMEMeta]
-type dnsRecordListResponseCNAMEMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordListResponseCNAMEMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordListResponseCNAMEMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordListResponseCNAMETTLNumber].
-type DNSRecordListResponseCNAMETTL interface {
- ImplementsDNSRecordListResponseCnamettl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordListResponseCNAMETTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordListResponseCNAMETTLNumber(0)),
- },
- )
-}
-
-type DNSRecordListResponseCNAMETTLNumber float64
-
-const (
- DNSRecordListResponseCNAMETTLNumber1 DNSRecordListResponseCNAMETTLNumber = 1
-)
-
-type DNSRecordListResponseDNSKEY struct {
- // Components of a DNSKEY record.
- Data DNSRecordListResponseDNSKEYData `json:"data,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordListResponseDNSKEYType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // Formatted DNSKEY content. See 'data' to set DNSKEY properties.
- Content string `json:"content"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordListResponseDNSKEYMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordListResponseDNSKEYTTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordListResponseDNSKEYJSON `json:"-"`
-}
-
-// dnsRecordListResponseDNSKEYJSON contains the JSON metadata for the struct
-// [DNSRecordListResponseDNSKEY]
-type dnsRecordListResponseDNSKEYJSON struct {
- Data apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- Content apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordListResponseDNSKEY) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordListResponseDNSKEYJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordListResponseDNSKEY) implementsDNSRecordListResponse() {}
-
-// Components of a DNSKEY record.
-type DNSRecordListResponseDNSKEYData struct {
- // Algorithm.
- Algorithm float64 `json:"algorithm"`
- // Flags.
- Flags float64 `json:"flags"`
- // Protocol.
- Protocol float64 `json:"protocol"`
- // Public Key.
- PublicKey string `json:"public_key"`
- JSON dnsRecordListResponseDNSKEYDataJSON `json:"-"`
-}
-
-// dnsRecordListResponseDNSKEYDataJSON contains the JSON metadata for the struct
-// [DNSRecordListResponseDNSKEYData]
-type dnsRecordListResponseDNSKEYDataJSON struct {
- Algorithm apijson.Field
- Flags apijson.Field
- Protocol apijson.Field
- PublicKey apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordListResponseDNSKEYData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordListResponseDNSKEYDataJSON) RawJSON() string {
- return r.raw
-}
-
-// Record type.
-type DNSRecordListResponseDNSKEYType string
-
-const (
- DNSRecordListResponseDNSKEYTypeDNSKEY DNSRecordListResponseDNSKEYType = "DNSKEY"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordListResponseDNSKEYMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordListResponseDNSKEYMetaJSON `json:"-"`
-}
-
-// dnsRecordListResponseDNSKEYMetaJSON contains the JSON metadata for the struct
-// [DNSRecordListResponseDNSKEYMeta]
-type dnsRecordListResponseDNSKEYMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordListResponseDNSKEYMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordListResponseDNSKEYMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or
-// [DNSRecordListResponseDNSKEYTTLNumber].
-type DNSRecordListResponseDNSKEYTTL interface {
- ImplementsDNSRecordListResponseDnskeyttl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordListResponseDNSKEYTTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordListResponseDNSKEYTTLNumber(0)),
- },
- )
-}
-
-type DNSRecordListResponseDNSKEYTTLNumber float64
-
-const (
- DNSRecordListResponseDNSKEYTTLNumber1 DNSRecordListResponseDNSKEYTTLNumber = 1
-)
-
-type DNSRecordListResponseDS struct {
- // Components of a DS record.
- Data DNSRecordListResponseDSData `json:"data,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordListResponseDSType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // Formatted DS content. See 'data' to set DS properties.
- Content string `json:"content"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordListResponseDSMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordListResponseDSTTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordListResponseDSJSON `json:"-"`
-}
-
-// dnsRecordListResponseDSJSON contains the JSON metadata for the struct
-// [DNSRecordListResponseDS]
-type dnsRecordListResponseDSJSON struct {
- Data apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- Content apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordListResponseDS) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordListResponseDSJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordListResponseDS) implementsDNSRecordListResponse() {}
-
-// Components of a DS record.
-type DNSRecordListResponseDSData struct {
- // Algorithm.
- Algorithm float64 `json:"algorithm"`
- // Digest.
- Digest string `json:"digest"`
- // Digest Type.
- DigestType float64 `json:"digest_type"`
- // Key Tag.
- KeyTag float64 `json:"key_tag"`
- JSON dnsRecordListResponseDSDataJSON `json:"-"`
-}
-
-// dnsRecordListResponseDSDataJSON contains the JSON metadata for the struct
-// [DNSRecordListResponseDSData]
-type dnsRecordListResponseDSDataJSON struct {
- Algorithm apijson.Field
- Digest apijson.Field
- DigestType apijson.Field
- KeyTag apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordListResponseDSData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordListResponseDSDataJSON) RawJSON() string {
- return r.raw
-}
-
-// Record type.
-type DNSRecordListResponseDSType string
-
-const (
- DNSRecordListResponseDSTypeDS DNSRecordListResponseDSType = "DS"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordListResponseDSMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordListResponseDSMetaJSON `json:"-"`
-}
-
-// dnsRecordListResponseDSMetaJSON contains the JSON metadata for the struct
-// [DNSRecordListResponseDSMeta]
-type dnsRecordListResponseDSMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordListResponseDSMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordListResponseDSMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordListResponseDSTTLNumber].
-type DNSRecordListResponseDSTTL interface {
- ImplementsDNSRecordListResponseDsttl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordListResponseDSTTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordListResponseDSTTLNumber(0)),
- },
- )
-}
-
-type DNSRecordListResponseDSTTLNumber float64
-
-const (
- DNSRecordListResponseDSTTLNumber1 DNSRecordListResponseDSTTLNumber = 1
-)
-
-type DNSRecordListResponseHTTPS struct {
- // Components of a HTTPS record.
- Data DNSRecordListResponseHTTPSData `json:"data,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordListResponseHTTPSType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // Formatted HTTPS content. See 'data' to set HTTPS properties.
- Content string `json:"content"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordListResponseHTTPSMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordListResponseHTTPSTTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordListResponseHTTPSJSON `json:"-"`
-}
-
-// dnsRecordListResponseHTTPSJSON contains the JSON metadata for the struct
-// [DNSRecordListResponseHTTPS]
-type dnsRecordListResponseHTTPSJSON struct {
- Data apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- Content apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordListResponseHTTPS) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordListResponseHTTPSJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordListResponseHTTPS) implementsDNSRecordListResponse() {}
-
-// Components of a HTTPS record.
-type DNSRecordListResponseHTTPSData struct {
- // priority.
- Priority float64 `json:"priority"`
- // target.
- Target string `json:"target"`
- // value.
- Value string `json:"value"`
- JSON dnsRecordListResponseHTTPSDataJSON `json:"-"`
-}
-
-// dnsRecordListResponseHTTPSDataJSON contains the JSON metadata for the struct
-// [DNSRecordListResponseHTTPSData]
-type dnsRecordListResponseHTTPSDataJSON struct {
- Priority apijson.Field
- Target apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordListResponseHTTPSData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordListResponseHTTPSDataJSON) RawJSON() string {
- return r.raw
-}
-
-// Record type.
-type DNSRecordListResponseHTTPSType string
-
-const (
- DNSRecordListResponseHTTPSTypeHTTPS DNSRecordListResponseHTTPSType = "HTTPS"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordListResponseHTTPSMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordListResponseHTTPSMetaJSON `json:"-"`
-}
-
-// dnsRecordListResponseHTTPSMetaJSON contains the JSON metadata for the struct
-// [DNSRecordListResponseHTTPSMeta]
-type dnsRecordListResponseHTTPSMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordListResponseHTTPSMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordListResponseHTTPSMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordListResponseHTTPSTTLNumber].
-type DNSRecordListResponseHTTPSTTL interface {
- ImplementsDNSRecordListResponseHttpsttl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordListResponseHTTPSTTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordListResponseHTTPSTTLNumber(0)),
- },
- )
-}
-
-type DNSRecordListResponseHTTPSTTLNumber float64
-
-const (
- DNSRecordListResponseHTTPSTTLNumber1 DNSRecordListResponseHTTPSTTLNumber = 1
-)
-
-type DNSRecordListResponseLOC struct {
- // Components of a LOC record.
- Data DNSRecordListResponseLOCData `json:"data,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordListResponseLOCType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // Formatted LOC content. See 'data' to set LOC properties.
- Content string `json:"content"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordListResponseLOCMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordListResponseLOCTTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordListResponseLOCJSON `json:"-"`
-}
-
-// dnsRecordListResponseLOCJSON contains the JSON metadata for the struct
-// [DNSRecordListResponseLOC]
-type dnsRecordListResponseLOCJSON struct {
- Data apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- Content apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordListResponseLOC) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordListResponseLOCJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordListResponseLOC) implementsDNSRecordListResponse() {}
-
-// Components of a LOC record.
-type DNSRecordListResponseLOCData struct {
- // Altitude of location in meters.
- Altitude float64 `json:"altitude"`
- // Degrees of latitude.
- LatDegrees float64 `json:"lat_degrees"`
- // Latitude direction.
- LatDirection DNSRecordListResponseLOCDataLatDirection `json:"lat_direction"`
- // Minutes of latitude.
- LatMinutes float64 `json:"lat_minutes"`
- // Seconds of latitude.
- LatSeconds float64 `json:"lat_seconds"`
- // Degrees of longitude.
- LongDegrees float64 `json:"long_degrees"`
- // Longitude direction.
- LongDirection DNSRecordListResponseLOCDataLongDirection `json:"long_direction"`
- // Minutes of longitude.
- LongMinutes float64 `json:"long_minutes"`
- // Seconds of longitude.
- LongSeconds float64 `json:"long_seconds"`
- // Horizontal precision of location.
- PrecisionHorz float64 `json:"precision_horz"`
- // Vertical precision of location.
- PrecisionVert float64 `json:"precision_vert"`
- // Size of location in meters.
- Size float64 `json:"size"`
- JSON dnsRecordListResponseLOCDataJSON `json:"-"`
-}
-
-// dnsRecordListResponseLOCDataJSON contains the JSON metadata for the struct
-// [DNSRecordListResponseLOCData]
-type dnsRecordListResponseLOCDataJSON struct {
- Altitude apijson.Field
- LatDegrees apijson.Field
- LatDirection apijson.Field
- LatMinutes apijson.Field
- LatSeconds apijson.Field
- LongDegrees apijson.Field
- LongDirection apijson.Field
- LongMinutes apijson.Field
- LongSeconds apijson.Field
- PrecisionHorz apijson.Field
- PrecisionVert apijson.Field
- Size apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordListResponseLOCData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordListResponseLOCDataJSON) RawJSON() string {
- return r.raw
-}
-
-// Latitude direction.
-type DNSRecordListResponseLOCDataLatDirection string
-
-const (
- DNSRecordListResponseLOCDataLatDirectionN DNSRecordListResponseLOCDataLatDirection = "N"
- DNSRecordListResponseLOCDataLatDirectionS DNSRecordListResponseLOCDataLatDirection = "S"
-)
-
-// Longitude direction.
-type DNSRecordListResponseLOCDataLongDirection string
-
-const (
- DNSRecordListResponseLOCDataLongDirectionE DNSRecordListResponseLOCDataLongDirection = "E"
- DNSRecordListResponseLOCDataLongDirectionW DNSRecordListResponseLOCDataLongDirection = "W"
-)
-
-// Record type.
-type DNSRecordListResponseLOCType string
-
-const (
- DNSRecordListResponseLOCTypeLOC DNSRecordListResponseLOCType = "LOC"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordListResponseLOCMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordListResponseLOCMetaJSON `json:"-"`
-}
-
-// dnsRecordListResponseLOCMetaJSON contains the JSON metadata for the struct
-// [DNSRecordListResponseLOCMeta]
-type dnsRecordListResponseLOCMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordListResponseLOCMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordListResponseLOCMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordListResponseLOCTTLNumber].
-type DNSRecordListResponseLOCTTL interface {
- ImplementsDNSRecordListResponseLocttl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordListResponseLOCTTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordListResponseLOCTTLNumber(0)),
- },
- )
-}
-
-type DNSRecordListResponseLOCTTLNumber float64
-
-const (
- DNSRecordListResponseLOCTTLNumber1 DNSRecordListResponseLOCTTLNumber = 1
-)
-
-type DNSRecordListResponseMX struct {
- // A valid mail server hostname.
- Content string `json:"content,required" format:"hostname"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Required for MX, SRV and URI records; unused by other record types. Records with
- // lower priorities are preferred.
- Priority float64 `json:"priority,required"`
- // Record type.
- Type DNSRecordListResponseMXType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordListResponseMXMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordListResponseMXTTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordListResponseMXJSON `json:"-"`
-}
-
-// dnsRecordListResponseMXJSON contains the JSON metadata for the struct
-// [DNSRecordListResponseMX]
-type dnsRecordListResponseMXJSON struct {
- Content apijson.Field
- Name apijson.Field
- Priority apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordListResponseMX) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordListResponseMXJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordListResponseMX) implementsDNSRecordListResponse() {}
-
-// Record type.
-type DNSRecordListResponseMXType string
-
-const (
- DNSRecordListResponseMXTypeMX DNSRecordListResponseMXType = "MX"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordListResponseMXMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordListResponseMXMetaJSON `json:"-"`
-}
-
-// dnsRecordListResponseMXMetaJSON contains the JSON metadata for the struct
-// [DNSRecordListResponseMXMeta]
-type dnsRecordListResponseMXMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordListResponseMXMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordListResponseMXMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordListResponseMXTTLNumber].
-type DNSRecordListResponseMXTTL interface {
- ImplementsDNSRecordListResponseMxttl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordListResponseMXTTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordListResponseMXTTLNumber(0)),
- },
- )
-}
-
-type DNSRecordListResponseMXTTLNumber float64
-
-const (
- DNSRecordListResponseMXTTLNumber1 DNSRecordListResponseMXTTLNumber = 1
-)
-
-type DNSRecordListResponseNAPTR struct {
- // Components of a NAPTR record.
- Data DNSRecordListResponseNAPTRData `json:"data,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordListResponseNAPTRType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // Formatted NAPTR content. See 'data' to set NAPTR properties.
- Content string `json:"content"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordListResponseNAPTRMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordListResponseNAPTRTTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordListResponseNAPTRJSON `json:"-"`
-}
-
-// dnsRecordListResponseNAPTRJSON contains the JSON metadata for the struct
-// [DNSRecordListResponseNAPTR]
-type dnsRecordListResponseNAPTRJSON struct {
- Data apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- Content apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordListResponseNAPTR) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordListResponseNAPTRJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordListResponseNAPTR) implementsDNSRecordListResponse() {}
-
-// Components of a NAPTR record.
-type DNSRecordListResponseNAPTRData struct {
- // Flags.
- Flags string `json:"flags"`
- // Order.
- Order float64 `json:"order"`
- // Preference.
- Preference float64 `json:"preference"`
- // Regex.
- Regex string `json:"regex"`
- // Replacement.
- Replacement string `json:"replacement"`
- // Service.
- Service string `json:"service"`
- JSON dnsRecordListResponseNAPTRDataJSON `json:"-"`
-}
-
-// dnsRecordListResponseNAPTRDataJSON contains the JSON metadata for the struct
-// [DNSRecordListResponseNAPTRData]
-type dnsRecordListResponseNAPTRDataJSON struct {
- Flags apijson.Field
- Order apijson.Field
- Preference apijson.Field
- Regex apijson.Field
- Replacement apijson.Field
- Service apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordListResponseNAPTRData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordListResponseNAPTRDataJSON) RawJSON() string {
- return r.raw
-}
-
-// Record type.
-type DNSRecordListResponseNAPTRType string
-
-const (
- DNSRecordListResponseNAPTRTypeNAPTR DNSRecordListResponseNAPTRType = "NAPTR"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordListResponseNAPTRMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordListResponseNAPTRMetaJSON `json:"-"`
-}
-
-// dnsRecordListResponseNAPTRMetaJSON contains the JSON metadata for the struct
-// [DNSRecordListResponseNAPTRMeta]
-type dnsRecordListResponseNAPTRMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordListResponseNAPTRMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordListResponseNAPTRMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordListResponseNAPTRTTLNumber].
-type DNSRecordListResponseNAPTRTTL interface {
- ImplementsDNSRecordListResponseNaptrttl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordListResponseNAPTRTTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordListResponseNAPTRTTLNumber(0)),
- },
- )
-}
-
-type DNSRecordListResponseNAPTRTTLNumber float64
-
-const (
- DNSRecordListResponseNAPTRTTLNumber1 DNSRecordListResponseNAPTRTTLNumber = 1
-)
-
-type DNSRecordListResponseNS struct {
- // A valid name server host name.
- Content interface{} `json:"content,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordListResponseNSType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordListResponseNSMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordListResponseNSTTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordListResponseNSJSON `json:"-"`
-}
-
-// dnsRecordListResponseNSJSON contains the JSON metadata for the struct
-// [DNSRecordListResponseNS]
-type dnsRecordListResponseNSJSON struct {
- Content apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordListResponseNS) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordListResponseNSJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordListResponseNS) implementsDNSRecordListResponse() {}
-
-// Record type.
-type DNSRecordListResponseNSType string
-
-const (
- DNSRecordListResponseNSTypeNS DNSRecordListResponseNSType = "NS"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordListResponseNSMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordListResponseNSMetaJSON `json:"-"`
-}
-
-// dnsRecordListResponseNSMetaJSON contains the JSON metadata for the struct
-// [DNSRecordListResponseNSMeta]
-type dnsRecordListResponseNSMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordListResponseNSMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordListResponseNSMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordListResponseNSTTLNumber].
-type DNSRecordListResponseNSTTL interface {
- ImplementsDNSRecordListResponseNsttl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordListResponseNSTTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordListResponseNSTTLNumber(0)),
- },
- )
-}
-
-type DNSRecordListResponseNSTTLNumber float64
-
-const (
- DNSRecordListResponseNSTTLNumber1 DNSRecordListResponseNSTTLNumber = 1
-)
-
-type DNSRecordListResponsePTR struct {
- // Domain name pointing to the address.
- Content string `json:"content,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordListResponsePTRType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordListResponsePTRMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordListResponsePTRTTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordListResponsePTRJSON `json:"-"`
-}
-
-// dnsRecordListResponsePTRJSON contains the JSON metadata for the struct
-// [DNSRecordListResponsePTR]
-type dnsRecordListResponsePTRJSON struct {
- Content apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordListResponsePTR) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordListResponsePTRJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordListResponsePTR) implementsDNSRecordListResponse() {}
-
-// Record type.
-type DNSRecordListResponsePTRType string
-
-const (
- DNSRecordListResponsePTRTypePTR DNSRecordListResponsePTRType = "PTR"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordListResponsePTRMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordListResponsePTRMetaJSON `json:"-"`
-}
-
-// dnsRecordListResponsePTRMetaJSON contains the JSON metadata for the struct
-// [DNSRecordListResponsePTRMeta]
-type dnsRecordListResponsePTRMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordListResponsePTRMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordListResponsePTRMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordListResponsePTRTTLNumber].
-type DNSRecordListResponsePTRTTL interface {
- ImplementsDNSRecordListResponsePtrttl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordListResponsePTRTTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordListResponsePTRTTLNumber(0)),
- },
- )
-}
-
-type DNSRecordListResponsePTRTTLNumber float64
-
-const (
- DNSRecordListResponsePTRTTLNumber1 DNSRecordListResponsePTRTTLNumber = 1
-)
-
-type DNSRecordListResponseSmimea struct {
- // Components of a SMIMEA record.
- Data DNSRecordListResponseSmimeaData `json:"data,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordListResponseSmimeaType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // Formatted SMIMEA content. See 'data' to set SMIMEA properties.
- Content string `json:"content"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordListResponseSmimeaMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordListResponseSmimeaTTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordListResponseSmimeaJSON `json:"-"`
-}
-
-// dnsRecordListResponseSmimeaJSON contains the JSON metadata for the struct
-// [DNSRecordListResponseSmimea]
-type dnsRecordListResponseSmimeaJSON struct {
- Data apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- Content apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordListResponseSmimea) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordListResponseSmimeaJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordListResponseSmimea) implementsDNSRecordListResponse() {}
-
-// Components of a SMIMEA record.
-type DNSRecordListResponseSmimeaData struct {
- // Certificate.
- Certificate string `json:"certificate"`
- // Matching Type.
- MatchingType float64 `json:"matching_type"`
- // Selector.
- Selector float64 `json:"selector"`
- // Usage.
- Usage float64 `json:"usage"`
- JSON dnsRecordListResponseSmimeaDataJSON `json:"-"`
-}
-
-// dnsRecordListResponseSmimeaDataJSON contains the JSON metadata for the struct
-// [DNSRecordListResponseSmimeaData]
-type dnsRecordListResponseSmimeaDataJSON struct {
- Certificate apijson.Field
- MatchingType apijson.Field
- Selector apijson.Field
- Usage apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordListResponseSmimeaData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordListResponseSmimeaDataJSON) RawJSON() string {
- return r.raw
-}
-
-// Record type.
-type DNSRecordListResponseSmimeaType string
-
-const (
- DNSRecordListResponseSmimeaTypeSmimea DNSRecordListResponseSmimeaType = "SMIMEA"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordListResponseSmimeaMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordListResponseSmimeaMetaJSON `json:"-"`
-}
-
-// dnsRecordListResponseSmimeaMetaJSON contains the JSON metadata for the struct
-// [DNSRecordListResponseSmimeaMeta]
-type dnsRecordListResponseSmimeaMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordListResponseSmimeaMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordListResponseSmimeaMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or
-// [DNSRecordListResponseSmimeaTTLNumber].
-type DNSRecordListResponseSmimeaTTL interface {
- ImplementsDNSRecordListResponseSmimeaTTL()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordListResponseSmimeaTTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordListResponseSmimeaTTLNumber(0)),
- },
- )
-}
-
-type DNSRecordListResponseSmimeaTTLNumber float64
-
-const (
- DNSRecordListResponseSmimeaTTLNumber1 DNSRecordListResponseSmimeaTTLNumber = 1
-)
-
-type DNSRecordListResponseSRV struct {
- // Components of a SRV record.
- Data DNSRecordListResponseSRVData `json:"data,required"`
- // DNS record name (or @ for the zone apex) in Punycode. For SRV records, the first
- // label is normally a service and the second a protocol name, each starting with
- // an underscore.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordListResponseSRVType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // Priority, weight, port, and SRV target. See 'data' for setting the individual
- // component values.
- Content string `json:"content"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordListResponseSRVMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordListResponseSRVTTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordListResponseSRVJSON `json:"-"`
-}
-
-// dnsRecordListResponseSRVJSON contains the JSON metadata for the struct
-// [DNSRecordListResponseSRV]
-type dnsRecordListResponseSRVJSON struct {
- Data apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- Content apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordListResponseSRV) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordListResponseSRVJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordListResponseSRV) implementsDNSRecordListResponse() {}
-
-// Components of a SRV record.
-type DNSRecordListResponseSRVData struct {
- // A valid hostname. Deprecated in favor of the regular 'name' outside the data
- // map. This data map field represents the remainder of the full 'name' after the
- // service and protocol.
- Name string `json:"name" format:"hostname"`
- // The port of the service.
- Port float64 `json:"port"`
- // Required for MX, SRV and URI records; unused by other record types. Records with
- // lower priorities are preferred.
- Priority float64 `json:"priority"`
- // A valid protocol, prefixed with an underscore. Deprecated in favor of the
- // regular 'name' outside the data map. This data map field normally represents the
- // second label of that 'name'.
- Proto string `json:"proto"`
- // A service type, prefixed with an underscore. Deprecated in favor of the regular
- // 'name' outside the data map. This data map field normally represents the first
- // label of that 'name'.
- Service string `json:"service"`
- // A valid hostname.
- Target string `json:"target" format:"hostname"`
- // The record weight.
- Weight float64 `json:"weight"`
- JSON dnsRecordListResponseSRVDataJSON `json:"-"`
-}
-
-// dnsRecordListResponseSRVDataJSON contains the JSON metadata for the struct
-// [DNSRecordListResponseSRVData]
-type dnsRecordListResponseSRVDataJSON struct {
- Name apijson.Field
- Port apijson.Field
- Priority apijson.Field
- Proto apijson.Field
- Service apijson.Field
- Target apijson.Field
- Weight apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordListResponseSRVData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordListResponseSRVDataJSON) RawJSON() string {
- return r.raw
-}
-
-// Record type.
-type DNSRecordListResponseSRVType string
-
-const (
- DNSRecordListResponseSRVTypeSRV DNSRecordListResponseSRVType = "SRV"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordListResponseSRVMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordListResponseSRVMetaJSON `json:"-"`
-}
-
-// dnsRecordListResponseSRVMetaJSON contains the JSON metadata for the struct
-// [DNSRecordListResponseSRVMeta]
-type dnsRecordListResponseSRVMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordListResponseSRVMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordListResponseSRVMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordListResponseSRVTTLNumber].
-type DNSRecordListResponseSRVTTL interface {
- ImplementsDNSRecordListResponseSrvttl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordListResponseSRVTTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordListResponseSRVTTLNumber(0)),
- },
- )
-}
-
-type DNSRecordListResponseSRVTTLNumber float64
-
-const (
- DNSRecordListResponseSRVTTLNumber1 DNSRecordListResponseSRVTTLNumber = 1
-)
-
-type DNSRecordListResponseSSHFP struct {
- // Components of a SSHFP record.
- Data DNSRecordListResponseSSHFPData `json:"data,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordListResponseSSHFPType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // Formatted SSHFP content. See 'data' to set SSHFP properties.
- Content string `json:"content"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordListResponseSSHFPMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordListResponseSSHFPTTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordListResponseSSHFPJSON `json:"-"`
-}
-
-// dnsRecordListResponseSSHFPJSON contains the JSON metadata for the struct
-// [DNSRecordListResponseSSHFP]
-type dnsRecordListResponseSSHFPJSON struct {
- Data apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- Content apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordListResponseSSHFP) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordListResponseSSHFPJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordListResponseSSHFP) implementsDNSRecordListResponse() {}
-
-// Components of a SSHFP record.
-type DNSRecordListResponseSSHFPData struct {
- // algorithm.
- Algorithm float64 `json:"algorithm"`
- // fingerprint.
- Fingerprint string `json:"fingerprint"`
- // type.
- Type float64 `json:"type"`
- JSON dnsRecordListResponseSSHFPDataJSON `json:"-"`
-}
-
-// dnsRecordListResponseSSHFPDataJSON contains the JSON metadata for the struct
-// [DNSRecordListResponseSSHFPData]
-type dnsRecordListResponseSSHFPDataJSON struct {
- Algorithm apijson.Field
- Fingerprint apijson.Field
- Type apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordListResponseSSHFPData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordListResponseSSHFPDataJSON) RawJSON() string {
- return r.raw
-}
-
-// Record type.
-type DNSRecordListResponseSSHFPType string
-
-const (
- DNSRecordListResponseSSHFPTypeSSHFP DNSRecordListResponseSSHFPType = "SSHFP"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordListResponseSSHFPMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordListResponseSSHFPMetaJSON `json:"-"`
-}
-
-// dnsRecordListResponseSSHFPMetaJSON contains the JSON metadata for the struct
-// [DNSRecordListResponseSSHFPMeta]
-type dnsRecordListResponseSSHFPMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordListResponseSSHFPMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordListResponseSSHFPMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordListResponseSSHFPTTLNumber].
-type DNSRecordListResponseSSHFPTTL interface {
- ImplementsDNSRecordListResponseSshfpttl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordListResponseSSHFPTTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordListResponseSSHFPTTLNumber(0)),
- },
- )
-}
-
-type DNSRecordListResponseSSHFPTTLNumber float64
-
-const (
- DNSRecordListResponseSSHFPTTLNumber1 DNSRecordListResponseSSHFPTTLNumber = 1
-)
-
-type DNSRecordListResponseSVCB struct {
- // Components of a SVCB record.
- Data DNSRecordListResponseSVCBData `json:"data,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordListResponseSVCBType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // Formatted SVCB content. See 'data' to set SVCB properties.
- Content string `json:"content"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordListResponseSVCBMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordListResponseSVCBTTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordListResponseSVCBJSON `json:"-"`
-}
-
-// dnsRecordListResponseSVCBJSON contains the JSON metadata for the struct
-// [DNSRecordListResponseSVCB]
-type dnsRecordListResponseSVCBJSON struct {
- Data apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- Content apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordListResponseSVCB) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordListResponseSVCBJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordListResponseSVCB) implementsDNSRecordListResponse() {}
-
-// Components of a SVCB record.
-type DNSRecordListResponseSVCBData struct {
- // priority.
- Priority float64 `json:"priority"`
- // target.
- Target string `json:"target"`
- // value.
- Value string `json:"value"`
- JSON dnsRecordListResponseSVCBDataJSON `json:"-"`
-}
-
-// dnsRecordListResponseSVCBDataJSON contains the JSON metadata for the struct
-// [DNSRecordListResponseSVCBData]
-type dnsRecordListResponseSVCBDataJSON struct {
- Priority apijson.Field
- Target apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordListResponseSVCBData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordListResponseSVCBDataJSON) RawJSON() string {
- return r.raw
-}
-
-// Record type.
-type DNSRecordListResponseSVCBType string
-
-const (
- DNSRecordListResponseSVCBTypeSVCB DNSRecordListResponseSVCBType = "SVCB"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordListResponseSVCBMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordListResponseSVCBMetaJSON `json:"-"`
-}
-
-// dnsRecordListResponseSVCBMetaJSON contains the JSON metadata for the struct
-// [DNSRecordListResponseSVCBMeta]
-type dnsRecordListResponseSVCBMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordListResponseSVCBMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordListResponseSVCBMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordListResponseSVCBTTLNumber].
-type DNSRecordListResponseSVCBTTL interface {
- ImplementsDNSRecordListResponseSvcbttl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordListResponseSVCBTTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordListResponseSVCBTTLNumber(0)),
- },
- )
-}
-
-type DNSRecordListResponseSVCBTTLNumber float64
-
-const (
- DNSRecordListResponseSVCBTTLNumber1 DNSRecordListResponseSVCBTTLNumber = 1
-)
-
-type DNSRecordListResponseTLSA struct {
- // Components of a TLSA record.
- Data DNSRecordListResponseTLSAData `json:"data,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordListResponseTLSAType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // Formatted TLSA content. See 'data' to set TLSA properties.
- Content string `json:"content"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordListResponseTLSAMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordListResponseTLSATTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordListResponseTLSAJSON `json:"-"`
-}
-
-// dnsRecordListResponseTLSAJSON contains the JSON metadata for the struct
-// [DNSRecordListResponseTLSA]
-type dnsRecordListResponseTLSAJSON struct {
- Data apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- Content apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordListResponseTLSA) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordListResponseTLSAJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordListResponseTLSA) implementsDNSRecordListResponse() {}
-
-// Components of a TLSA record.
-type DNSRecordListResponseTLSAData struct {
- // certificate.
- Certificate string `json:"certificate"`
- // Matching Type.
- MatchingType float64 `json:"matching_type"`
- // Selector.
- Selector float64 `json:"selector"`
- // Usage.
- Usage float64 `json:"usage"`
- JSON dnsRecordListResponseTLSADataJSON `json:"-"`
-}
-
-// dnsRecordListResponseTLSADataJSON contains the JSON metadata for the struct
-// [DNSRecordListResponseTLSAData]
-type dnsRecordListResponseTLSADataJSON struct {
- Certificate apijson.Field
- MatchingType apijson.Field
- Selector apijson.Field
- Usage apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordListResponseTLSAData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordListResponseTLSADataJSON) RawJSON() string {
- return r.raw
-}
-
-// Record type.
-type DNSRecordListResponseTLSAType string
-
-const (
- DNSRecordListResponseTLSATypeTLSA DNSRecordListResponseTLSAType = "TLSA"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordListResponseTLSAMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordListResponseTLSAMetaJSON `json:"-"`
-}
-
-// dnsRecordListResponseTLSAMetaJSON contains the JSON metadata for the struct
-// [DNSRecordListResponseTLSAMeta]
-type dnsRecordListResponseTLSAMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordListResponseTLSAMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordListResponseTLSAMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordListResponseTLSATTLNumber].
-type DNSRecordListResponseTLSATTL interface {
- ImplementsDNSRecordListResponseTlsattl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordListResponseTLSATTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordListResponseTLSATTLNumber(0)),
- },
- )
-}
-
-type DNSRecordListResponseTLSATTLNumber float64
-
-const (
- DNSRecordListResponseTLSATTLNumber1 DNSRecordListResponseTLSATTLNumber = 1
-)
-
-type DNSRecordListResponseTXT struct {
- // Text content for the record.
- Content string `json:"content,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordListResponseTXTType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordListResponseTXTMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordListResponseTXTTTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordListResponseTXTJSON `json:"-"`
-}
-
-// dnsRecordListResponseTXTJSON contains the JSON metadata for the struct
-// [DNSRecordListResponseTXT]
-type dnsRecordListResponseTXTJSON struct {
- Content apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordListResponseTXT) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordListResponseTXTJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordListResponseTXT) implementsDNSRecordListResponse() {}
-
-// Record type.
-type DNSRecordListResponseTXTType string
-
-const (
- DNSRecordListResponseTXTTypeTXT DNSRecordListResponseTXTType = "TXT"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordListResponseTXTMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordListResponseTXTMetaJSON `json:"-"`
-}
-
-// dnsRecordListResponseTXTMetaJSON contains the JSON metadata for the struct
-// [DNSRecordListResponseTXTMeta]
-type dnsRecordListResponseTXTMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordListResponseTXTMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordListResponseTXTMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordListResponseTXTTTLNumber].
-type DNSRecordListResponseTXTTTL interface {
- ImplementsDNSRecordListResponseTxtttl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordListResponseTXTTTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordListResponseTXTTTLNumber(0)),
- },
- )
-}
-
-type DNSRecordListResponseTXTTTLNumber float64
-
-const (
- DNSRecordListResponseTXTTTLNumber1 DNSRecordListResponseTXTTTLNumber = 1
-)
-
-type DNSRecordListResponseURI struct {
- // Components of a URI record.
- Data DNSRecordListResponseURIData `json:"data,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Required for MX, SRV and URI records; unused by other record types. Records with
- // lower priorities are preferred.
- Priority float64 `json:"priority,required"`
- // Record type.
- Type DNSRecordListResponseURIType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // Formatted URI content. See 'data' to set URI properties.
- Content string `json:"content"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordListResponseURIMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordListResponseURITTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordListResponseURIJSON `json:"-"`
-}
-
-// dnsRecordListResponseURIJSON contains the JSON metadata for the struct
-// [DNSRecordListResponseURI]
-type dnsRecordListResponseURIJSON struct {
- Data apijson.Field
- Name apijson.Field
- Priority apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- Content apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordListResponseURI) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordListResponseURIJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordListResponseURI) implementsDNSRecordListResponse() {}
-
-// Components of a URI record.
-type DNSRecordListResponseURIData struct {
- // The record content.
- Content string `json:"content"`
- // The record weight.
- Weight float64 `json:"weight"`
- JSON dnsRecordListResponseURIDataJSON `json:"-"`
-}
-
-// dnsRecordListResponseURIDataJSON contains the JSON metadata for the struct
-// [DNSRecordListResponseURIData]
-type dnsRecordListResponseURIDataJSON struct {
- Content apijson.Field
- Weight apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordListResponseURIData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordListResponseURIDataJSON) RawJSON() string {
- return r.raw
-}
-
-// Record type.
-type DNSRecordListResponseURIType string
-
-const (
- DNSRecordListResponseURITypeURI DNSRecordListResponseURIType = "URI"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordListResponseURIMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordListResponseURIMetaJSON `json:"-"`
-}
-
-// dnsRecordListResponseURIMetaJSON contains the JSON metadata for the struct
-// [DNSRecordListResponseURIMeta]
-type dnsRecordListResponseURIMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordListResponseURIMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordListResponseURIMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordListResponseURITTLNumber].
-type DNSRecordListResponseURITTL interface {
- ImplementsDNSRecordListResponseUrittl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordListResponseURITTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordListResponseURITTLNumber(0)),
- },
- )
-}
-
-type DNSRecordListResponseURITTLNumber float64
-
-const (
- DNSRecordListResponseURITTLNumber1 DNSRecordListResponseURITTLNumber = 1
-)
-
-type DNSRecordDeleteResponse struct {
- // Identifier
- ID string `json:"id"`
- JSON dnsRecordDeleteResponseJSON `json:"-"`
-}
-
-// dnsRecordDeleteResponseJSON contains the JSON metadata for the struct
-// [DNSRecordDeleteResponse]
-type dnsRecordDeleteResponseJSON struct {
- ID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordDeleteResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordDeleteResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// Union satisfied by [DNSRecordEditResponseA], [DNSRecordEditResponseAAAA],
-// [DNSRecordEditResponseCAA], [DNSRecordEditResponseCert],
-// [DNSRecordEditResponseCNAME], [DNSRecordEditResponseDNSKEY],
-// [DNSRecordEditResponseDS], [DNSRecordEditResponseHTTPS],
-// [DNSRecordEditResponseLOC], [DNSRecordEditResponseMX],
-// [DNSRecordEditResponseNAPTR], [DNSRecordEditResponseNS],
-// [DNSRecordEditResponsePTR], [DNSRecordEditResponseSmimea],
-// [DNSRecordEditResponseSRV], [DNSRecordEditResponseSSHFP],
-// [DNSRecordEditResponseSVCB], [DNSRecordEditResponseTLSA],
-// [DNSRecordEditResponseTXT] or [DNSRecordEditResponseURI].
-type DNSRecordEditResponse interface {
- implementsDNSRecordEditResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordEditResponse)(nil)).Elem(),
- "type",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordEditResponseA{}),
- DiscriminatorValue: "A",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordEditResponseAAAA{}),
- DiscriminatorValue: "AAAA",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordEditResponseCAA{}),
- DiscriminatorValue: "CAA",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordEditResponseCert{}),
- DiscriminatorValue: "CERT",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordEditResponseCNAME{}),
- DiscriminatorValue: "CNAME",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordEditResponseDNSKEY{}),
- DiscriminatorValue: "DNSKEY",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordEditResponseDS{}),
- DiscriminatorValue: "DS",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordEditResponseHTTPS{}),
- DiscriminatorValue: "HTTPS",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordEditResponseLOC{}),
- DiscriminatorValue: "LOC",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordEditResponseMX{}),
- DiscriminatorValue: "MX",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordEditResponseNAPTR{}),
- DiscriminatorValue: "NAPTR",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordEditResponseNS{}),
- DiscriminatorValue: "NS",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordEditResponsePTR{}),
- DiscriminatorValue: "PTR",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordEditResponseSmimea{}),
- DiscriminatorValue: "SMIMEA",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordEditResponseSRV{}),
- DiscriminatorValue: "SRV",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordEditResponseSSHFP{}),
- DiscriminatorValue: "SSHFP",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordEditResponseSVCB{}),
- DiscriminatorValue: "SVCB",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordEditResponseTLSA{}),
- DiscriminatorValue: "TLSA",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordEditResponseTXT{}),
- DiscriminatorValue: "TXT",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordEditResponseURI{}),
- DiscriminatorValue: "URI",
- },
- )
-}
-
-type DNSRecordEditResponseA struct {
- // A valid IPv4 address.
- Content string `json:"content,required" format:"ipv4"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordEditResponseAType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordEditResponseAMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Whether the record is receiving the performance and security benefits of
- // Cloudflare.
- Proxied bool `json:"proxied"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordEditResponseATTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordEditResponseAJSON `json:"-"`
-}
-
-// dnsRecordEditResponseAJSON contains the JSON metadata for the struct
-// [DNSRecordEditResponseA]
-type dnsRecordEditResponseAJSON struct {
- Content apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Proxied apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordEditResponseA) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordEditResponseAJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordEditResponseA) implementsDNSRecordEditResponse() {}
-
-// Record type.
-type DNSRecordEditResponseAType string
-
-const (
- DNSRecordEditResponseATypeA DNSRecordEditResponseAType = "A"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordEditResponseAMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordEditResponseAMetaJSON `json:"-"`
-}
-
-// dnsRecordEditResponseAMetaJSON contains the JSON metadata for the struct
-// [DNSRecordEditResponseAMeta]
-type dnsRecordEditResponseAMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordEditResponseAMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordEditResponseAMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordEditResponseATTLNumber].
-type DNSRecordEditResponseATTL interface {
- ImplementsDNSRecordEditResponseAttl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordEditResponseATTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordEditResponseATTLNumber(0)),
- },
- )
-}
-
-type DNSRecordEditResponseATTLNumber float64
-
-const (
- DNSRecordEditResponseATTLNumber1 DNSRecordEditResponseATTLNumber = 1
-)
-
-type DNSRecordEditResponseAAAA struct {
- // A valid IPv6 address.
- Content string `json:"content,required" format:"ipv6"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordEditResponseAAAAType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordEditResponseAAAAMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Whether the record is receiving the performance and security benefits of
- // Cloudflare.
- Proxied bool `json:"proxied"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordEditResponseAAAATTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordEditResponseAAAAJSON `json:"-"`
-}
-
-// dnsRecordEditResponseAAAAJSON contains the JSON metadata for the struct
-// [DNSRecordEditResponseAAAA]
-type dnsRecordEditResponseAAAAJSON struct {
- Content apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Proxied apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordEditResponseAAAA) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordEditResponseAAAAJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordEditResponseAAAA) implementsDNSRecordEditResponse() {}
-
-// Record type.
-type DNSRecordEditResponseAAAAType string
-
-const (
- DNSRecordEditResponseAAAATypeAAAA DNSRecordEditResponseAAAAType = "AAAA"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordEditResponseAAAAMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordEditResponseAAAAMetaJSON `json:"-"`
-}
-
-// dnsRecordEditResponseAAAAMetaJSON contains the JSON metadata for the struct
-// [DNSRecordEditResponseAAAAMeta]
-type dnsRecordEditResponseAAAAMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordEditResponseAAAAMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordEditResponseAAAAMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordEditResponseAAAATTLNumber].
-type DNSRecordEditResponseAAAATTL interface {
- ImplementsDNSRecordEditResponseAaaattl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordEditResponseAAAATTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordEditResponseAAAATTLNumber(0)),
- },
- )
-}
-
-type DNSRecordEditResponseAAAATTLNumber float64
-
-const (
- DNSRecordEditResponseAAAATTLNumber1 DNSRecordEditResponseAAAATTLNumber = 1
-)
-
-type DNSRecordEditResponseCAA struct {
- // Components of a CAA record.
- Data DNSRecordEditResponseCAAData `json:"data,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordEditResponseCAAType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // Formatted CAA content. See 'data' to set CAA properties.
- Content string `json:"content"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordEditResponseCAAMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordEditResponseCAATTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordEditResponseCAAJSON `json:"-"`
-}
-
-// dnsRecordEditResponseCAAJSON contains the JSON metadata for the struct
-// [DNSRecordEditResponseCAA]
-type dnsRecordEditResponseCAAJSON struct {
- Data apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- Content apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordEditResponseCAA) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordEditResponseCAAJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordEditResponseCAA) implementsDNSRecordEditResponse() {}
-
-// Components of a CAA record.
-type DNSRecordEditResponseCAAData struct {
- // Flags for the CAA record.
- Flags float64 `json:"flags"`
- // Name of the property controlled by this record (e.g.: issue, issuewild, iodef).
- Tag string `json:"tag"`
- // Value of the record. This field's semantics depend on the chosen tag.
- Value string `json:"value"`
- JSON dnsRecordEditResponseCAADataJSON `json:"-"`
-}
-
-// dnsRecordEditResponseCAADataJSON contains the JSON metadata for the struct
-// [DNSRecordEditResponseCAAData]
-type dnsRecordEditResponseCAADataJSON struct {
- Flags apijson.Field
- Tag apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordEditResponseCAAData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordEditResponseCAADataJSON) RawJSON() string {
- return r.raw
-}
-
-// Record type.
-type DNSRecordEditResponseCAAType string
-
-const (
- DNSRecordEditResponseCAATypeCAA DNSRecordEditResponseCAAType = "CAA"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordEditResponseCAAMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordEditResponseCAAMetaJSON `json:"-"`
-}
-
-// dnsRecordEditResponseCAAMetaJSON contains the JSON metadata for the struct
-// [DNSRecordEditResponseCAAMeta]
-type dnsRecordEditResponseCAAMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordEditResponseCAAMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordEditResponseCAAMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordEditResponseCAATTLNumber].
-type DNSRecordEditResponseCAATTL interface {
- ImplementsDNSRecordEditResponseCaattl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordEditResponseCAATTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordEditResponseCAATTLNumber(0)),
- },
- )
-}
-
-type DNSRecordEditResponseCAATTLNumber float64
-
-const (
- DNSRecordEditResponseCAATTLNumber1 DNSRecordEditResponseCAATTLNumber = 1
-)
-
-type DNSRecordEditResponseCert struct {
- // Components of a CERT record.
- Data DNSRecordEditResponseCertData `json:"data,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordEditResponseCertType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // Formatted CERT content. See 'data' to set CERT properties.
- Content string `json:"content"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordEditResponseCertMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordEditResponseCertTTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordEditResponseCertJSON `json:"-"`
-}
-
-// dnsRecordEditResponseCertJSON contains the JSON metadata for the struct
-// [DNSRecordEditResponseCert]
-type dnsRecordEditResponseCertJSON struct {
- Data apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- Content apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordEditResponseCert) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordEditResponseCertJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordEditResponseCert) implementsDNSRecordEditResponse() {}
-
-// Components of a CERT record.
-type DNSRecordEditResponseCertData struct {
- // Algorithm.
- Algorithm float64 `json:"algorithm"`
- // Certificate.
- Certificate string `json:"certificate"`
- // Key Tag.
- KeyTag float64 `json:"key_tag"`
- // Type.
- Type float64 `json:"type"`
- JSON dnsRecordEditResponseCertDataJSON `json:"-"`
-}
-
-// dnsRecordEditResponseCertDataJSON contains the JSON metadata for the struct
-// [DNSRecordEditResponseCertData]
-type dnsRecordEditResponseCertDataJSON struct {
- Algorithm apijson.Field
- Certificate apijson.Field
- KeyTag apijson.Field
- Type apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordEditResponseCertData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordEditResponseCertDataJSON) RawJSON() string {
- return r.raw
-}
-
-// Record type.
-type DNSRecordEditResponseCertType string
-
-const (
- DNSRecordEditResponseCertTypeCert DNSRecordEditResponseCertType = "CERT"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordEditResponseCertMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordEditResponseCertMetaJSON `json:"-"`
-}
-
-// dnsRecordEditResponseCertMetaJSON contains the JSON metadata for the struct
-// [DNSRecordEditResponseCertMeta]
-type dnsRecordEditResponseCertMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordEditResponseCertMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordEditResponseCertMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordEditResponseCertTTLNumber].
-type DNSRecordEditResponseCertTTL interface {
- ImplementsDNSRecordEditResponseCertTTL()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordEditResponseCertTTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordEditResponseCertTTLNumber(0)),
- },
- )
-}
-
-type DNSRecordEditResponseCertTTLNumber float64
-
-const (
- DNSRecordEditResponseCertTTLNumber1 DNSRecordEditResponseCertTTLNumber = 1
-)
-
-type DNSRecordEditResponseCNAME struct {
- // A valid hostname. Must not match the record's name.
- Content interface{} `json:"content,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordEditResponseCNAMEType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordEditResponseCNAMEMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Whether the record is receiving the performance and security benefits of
- // Cloudflare.
- Proxied bool `json:"proxied"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordEditResponseCNAMETTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordEditResponseCNAMEJSON `json:"-"`
-}
-
-// dnsRecordEditResponseCNAMEJSON contains the JSON metadata for the struct
-// [DNSRecordEditResponseCNAME]
-type dnsRecordEditResponseCNAMEJSON struct {
- Content apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Proxied apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordEditResponseCNAME) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordEditResponseCNAMEJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordEditResponseCNAME) implementsDNSRecordEditResponse() {}
-
-// Record type.
-type DNSRecordEditResponseCNAMEType string
-
-const (
- DNSRecordEditResponseCNAMETypeCNAME DNSRecordEditResponseCNAMEType = "CNAME"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordEditResponseCNAMEMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordEditResponseCNAMEMetaJSON `json:"-"`
-}
-
-// dnsRecordEditResponseCNAMEMetaJSON contains the JSON metadata for the struct
-// [DNSRecordEditResponseCNAMEMeta]
-type dnsRecordEditResponseCNAMEMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordEditResponseCNAMEMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordEditResponseCNAMEMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordEditResponseCNAMETTLNumber].
-type DNSRecordEditResponseCNAMETTL interface {
- ImplementsDNSRecordEditResponseCnamettl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordEditResponseCNAMETTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordEditResponseCNAMETTLNumber(0)),
- },
- )
-}
-
-type DNSRecordEditResponseCNAMETTLNumber float64
-
-const (
- DNSRecordEditResponseCNAMETTLNumber1 DNSRecordEditResponseCNAMETTLNumber = 1
-)
-
-type DNSRecordEditResponseDNSKEY struct {
- // Components of a DNSKEY record.
- Data DNSRecordEditResponseDNSKEYData `json:"data,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordEditResponseDNSKEYType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // Formatted DNSKEY content. See 'data' to set DNSKEY properties.
- Content string `json:"content"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordEditResponseDNSKEYMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordEditResponseDNSKEYTTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordEditResponseDNSKEYJSON `json:"-"`
-}
-
-// dnsRecordEditResponseDNSKEYJSON contains the JSON metadata for the struct
-// [DNSRecordEditResponseDNSKEY]
-type dnsRecordEditResponseDNSKEYJSON struct {
- Data apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- Content apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordEditResponseDNSKEY) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordEditResponseDNSKEYJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordEditResponseDNSKEY) implementsDNSRecordEditResponse() {}
-
-// Components of a DNSKEY record.
-type DNSRecordEditResponseDNSKEYData struct {
- // Algorithm.
- Algorithm float64 `json:"algorithm"`
- // Flags.
- Flags float64 `json:"flags"`
- // Protocol.
- Protocol float64 `json:"protocol"`
- // Public Key.
- PublicKey string `json:"public_key"`
- JSON dnsRecordEditResponseDNSKEYDataJSON `json:"-"`
-}
-
-// dnsRecordEditResponseDNSKEYDataJSON contains the JSON metadata for the struct
-// [DNSRecordEditResponseDNSKEYData]
-type dnsRecordEditResponseDNSKEYDataJSON struct {
- Algorithm apijson.Field
- Flags apijson.Field
- Protocol apijson.Field
- PublicKey apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordEditResponseDNSKEYData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordEditResponseDNSKEYDataJSON) RawJSON() string {
- return r.raw
-}
-
-// Record type.
-type DNSRecordEditResponseDNSKEYType string
-
-const (
- DNSRecordEditResponseDNSKEYTypeDNSKEY DNSRecordEditResponseDNSKEYType = "DNSKEY"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordEditResponseDNSKEYMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordEditResponseDNSKEYMetaJSON `json:"-"`
-}
-
-// dnsRecordEditResponseDNSKEYMetaJSON contains the JSON metadata for the struct
-// [DNSRecordEditResponseDNSKEYMeta]
-type dnsRecordEditResponseDNSKEYMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordEditResponseDNSKEYMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordEditResponseDNSKEYMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or
-// [DNSRecordEditResponseDNSKEYTTLNumber].
-type DNSRecordEditResponseDNSKEYTTL interface {
- ImplementsDNSRecordEditResponseDnskeyttl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordEditResponseDNSKEYTTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordEditResponseDNSKEYTTLNumber(0)),
- },
- )
-}
-
-type DNSRecordEditResponseDNSKEYTTLNumber float64
-
-const (
- DNSRecordEditResponseDNSKEYTTLNumber1 DNSRecordEditResponseDNSKEYTTLNumber = 1
-)
-
-type DNSRecordEditResponseDS struct {
- // Components of a DS record.
- Data DNSRecordEditResponseDSData `json:"data,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordEditResponseDSType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // Formatted DS content. See 'data' to set DS properties.
- Content string `json:"content"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordEditResponseDSMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordEditResponseDSTTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordEditResponseDSJSON `json:"-"`
-}
-
-// dnsRecordEditResponseDSJSON contains the JSON metadata for the struct
-// [DNSRecordEditResponseDS]
-type dnsRecordEditResponseDSJSON struct {
- Data apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- Content apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordEditResponseDS) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordEditResponseDSJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordEditResponseDS) implementsDNSRecordEditResponse() {}
-
-// Components of a DS record.
-type DNSRecordEditResponseDSData struct {
- // Algorithm.
- Algorithm float64 `json:"algorithm"`
- // Digest.
- Digest string `json:"digest"`
- // Digest Type.
- DigestType float64 `json:"digest_type"`
- // Key Tag.
- KeyTag float64 `json:"key_tag"`
- JSON dnsRecordEditResponseDSDataJSON `json:"-"`
-}
-
-// dnsRecordEditResponseDSDataJSON contains the JSON metadata for the struct
-// [DNSRecordEditResponseDSData]
-type dnsRecordEditResponseDSDataJSON struct {
- Algorithm apijson.Field
- Digest apijson.Field
- DigestType apijson.Field
- KeyTag apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordEditResponseDSData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordEditResponseDSDataJSON) RawJSON() string {
- return r.raw
-}
-
-// Record type.
-type DNSRecordEditResponseDSType string
-
-const (
- DNSRecordEditResponseDSTypeDS DNSRecordEditResponseDSType = "DS"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordEditResponseDSMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordEditResponseDSMetaJSON `json:"-"`
-}
-
-// dnsRecordEditResponseDSMetaJSON contains the JSON metadata for the struct
-// [DNSRecordEditResponseDSMeta]
-type dnsRecordEditResponseDSMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordEditResponseDSMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordEditResponseDSMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordEditResponseDSTTLNumber].
-type DNSRecordEditResponseDSTTL interface {
- ImplementsDNSRecordEditResponseDsttl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordEditResponseDSTTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordEditResponseDSTTLNumber(0)),
- },
- )
-}
-
-type DNSRecordEditResponseDSTTLNumber float64
-
-const (
- DNSRecordEditResponseDSTTLNumber1 DNSRecordEditResponseDSTTLNumber = 1
-)
-
-type DNSRecordEditResponseHTTPS struct {
- // Components of a HTTPS record.
- Data DNSRecordEditResponseHTTPSData `json:"data,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordEditResponseHTTPSType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // Formatted HTTPS content. See 'data' to set HTTPS properties.
- Content string `json:"content"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordEditResponseHTTPSMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordEditResponseHTTPSTTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordEditResponseHTTPSJSON `json:"-"`
-}
-
-// dnsRecordEditResponseHTTPSJSON contains the JSON metadata for the struct
-// [DNSRecordEditResponseHTTPS]
-type dnsRecordEditResponseHTTPSJSON struct {
- Data apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- Content apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordEditResponseHTTPS) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordEditResponseHTTPSJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordEditResponseHTTPS) implementsDNSRecordEditResponse() {}
-
-// Components of a HTTPS record.
-type DNSRecordEditResponseHTTPSData struct {
- // priority.
- Priority float64 `json:"priority"`
- // target.
- Target string `json:"target"`
- // value.
- Value string `json:"value"`
- JSON dnsRecordEditResponseHTTPSDataJSON `json:"-"`
-}
-
-// dnsRecordEditResponseHTTPSDataJSON contains the JSON metadata for the struct
-// [DNSRecordEditResponseHTTPSData]
-type dnsRecordEditResponseHTTPSDataJSON struct {
- Priority apijson.Field
- Target apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordEditResponseHTTPSData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordEditResponseHTTPSDataJSON) RawJSON() string {
- return r.raw
-}
-
-// Record type.
-type DNSRecordEditResponseHTTPSType string
-
-const (
- DNSRecordEditResponseHTTPSTypeHTTPS DNSRecordEditResponseHTTPSType = "HTTPS"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordEditResponseHTTPSMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordEditResponseHTTPSMetaJSON `json:"-"`
-}
-
-// dnsRecordEditResponseHTTPSMetaJSON contains the JSON metadata for the struct
-// [DNSRecordEditResponseHTTPSMeta]
-type dnsRecordEditResponseHTTPSMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordEditResponseHTTPSMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordEditResponseHTTPSMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordEditResponseHTTPSTTLNumber].
-type DNSRecordEditResponseHTTPSTTL interface {
- ImplementsDNSRecordEditResponseHttpsttl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordEditResponseHTTPSTTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordEditResponseHTTPSTTLNumber(0)),
- },
- )
-}
-
-type DNSRecordEditResponseHTTPSTTLNumber float64
-
-const (
- DNSRecordEditResponseHTTPSTTLNumber1 DNSRecordEditResponseHTTPSTTLNumber = 1
-)
-
-type DNSRecordEditResponseLOC struct {
- // Components of a LOC record.
- Data DNSRecordEditResponseLOCData `json:"data,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordEditResponseLOCType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // Formatted LOC content. See 'data' to set LOC properties.
- Content string `json:"content"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordEditResponseLOCMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordEditResponseLOCTTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordEditResponseLOCJSON `json:"-"`
-}
-
-// dnsRecordEditResponseLOCJSON contains the JSON metadata for the struct
-// [DNSRecordEditResponseLOC]
-type dnsRecordEditResponseLOCJSON struct {
- Data apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- Content apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordEditResponseLOC) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordEditResponseLOCJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordEditResponseLOC) implementsDNSRecordEditResponse() {}
-
-// Components of a LOC record.
-type DNSRecordEditResponseLOCData struct {
- // Altitude of location in meters.
- Altitude float64 `json:"altitude"`
- // Degrees of latitude.
- LatDegrees float64 `json:"lat_degrees"`
- // Latitude direction.
- LatDirection DNSRecordEditResponseLOCDataLatDirection `json:"lat_direction"`
- // Minutes of latitude.
- LatMinutes float64 `json:"lat_minutes"`
- // Seconds of latitude.
- LatSeconds float64 `json:"lat_seconds"`
- // Degrees of longitude.
- LongDegrees float64 `json:"long_degrees"`
- // Longitude direction.
- LongDirection DNSRecordEditResponseLOCDataLongDirection `json:"long_direction"`
- // Minutes of longitude.
- LongMinutes float64 `json:"long_minutes"`
- // Seconds of longitude.
- LongSeconds float64 `json:"long_seconds"`
- // Horizontal precision of location.
- PrecisionHorz float64 `json:"precision_horz"`
- // Vertical precision of location.
- PrecisionVert float64 `json:"precision_vert"`
- // Size of location in meters.
- Size float64 `json:"size"`
- JSON dnsRecordEditResponseLOCDataJSON `json:"-"`
-}
-
-// dnsRecordEditResponseLOCDataJSON contains the JSON metadata for the struct
-// [DNSRecordEditResponseLOCData]
-type dnsRecordEditResponseLOCDataJSON struct {
- Altitude apijson.Field
- LatDegrees apijson.Field
- LatDirection apijson.Field
- LatMinutes apijson.Field
- LatSeconds apijson.Field
- LongDegrees apijson.Field
- LongDirection apijson.Field
- LongMinutes apijson.Field
- LongSeconds apijson.Field
- PrecisionHorz apijson.Field
- PrecisionVert apijson.Field
- Size apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordEditResponseLOCData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordEditResponseLOCDataJSON) RawJSON() string {
- return r.raw
-}
-
-// Latitude direction.
-type DNSRecordEditResponseLOCDataLatDirection string
-
-const (
- DNSRecordEditResponseLOCDataLatDirectionN DNSRecordEditResponseLOCDataLatDirection = "N"
- DNSRecordEditResponseLOCDataLatDirectionS DNSRecordEditResponseLOCDataLatDirection = "S"
-)
-
-// Longitude direction.
-type DNSRecordEditResponseLOCDataLongDirection string
-
-const (
- DNSRecordEditResponseLOCDataLongDirectionE DNSRecordEditResponseLOCDataLongDirection = "E"
- DNSRecordEditResponseLOCDataLongDirectionW DNSRecordEditResponseLOCDataLongDirection = "W"
-)
-
-// Record type.
-type DNSRecordEditResponseLOCType string
-
-const (
- DNSRecordEditResponseLOCTypeLOC DNSRecordEditResponseLOCType = "LOC"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordEditResponseLOCMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordEditResponseLOCMetaJSON `json:"-"`
-}
-
-// dnsRecordEditResponseLOCMetaJSON contains the JSON metadata for the struct
-// [DNSRecordEditResponseLOCMeta]
-type dnsRecordEditResponseLOCMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordEditResponseLOCMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordEditResponseLOCMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordEditResponseLOCTTLNumber].
-type DNSRecordEditResponseLOCTTL interface {
- ImplementsDNSRecordEditResponseLocttl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordEditResponseLOCTTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordEditResponseLOCTTLNumber(0)),
- },
- )
-}
-
-type DNSRecordEditResponseLOCTTLNumber float64
-
-const (
- DNSRecordEditResponseLOCTTLNumber1 DNSRecordEditResponseLOCTTLNumber = 1
-)
-
-type DNSRecordEditResponseMX struct {
- // A valid mail server hostname.
- Content string `json:"content,required" format:"hostname"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Required for MX, SRV and URI records; unused by other record types. Records with
- // lower priorities are preferred.
- Priority float64 `json:"priority,required"`
- // Record type.
- Type DNSRecordEditResponseMXType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordEditResponseMXMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordEditResponseMXTTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordEditResponseMXJSON `json:"-"`
-}
-
-// dnsRecordEditResponseMXJSON contains the JSON metadata for the struct
-// [DNSRecordEditResponseMX]
-type dnsRecordEditResponseMXJSON struct {
- Content apijson.Field
- Name apijson.Field
- Priority apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordEditResponseMX) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordEditResponseMXJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordEditResponseMX) implementsDNSRecordEditResponse() {}
-
-// Record type.
-type DNSRecordEditResponseMXType string
-
-const (
- DNSRecordEditResponseMXTypeMX DNSRecordEditResponseMXType = "MX"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordEditResponseMXMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordEditResponseMXMetaJSON `json:"-"`
-}
-
-// dnsRecordEditResponseMXMetaJSON contains the JSON metadata for the struct
-// [DNSRecordEditResponseMXMeta]
-type dnsRecordEditResponseMXMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordEditResponseMXMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordEditResponseMXMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordEditResponseMXTTLNumber].
-type DNSRecordEditResponseMXTTL interface {
- ImplementsDNSRecordEditResponseMxttl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordEditResponseMXTTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordEditResponseMXTTLNumber(0)),
- },
- )
-}
-
-type DNSRecordEditResponseMXTTLNumber float64
-
-const (
- DNSRecordEditResponseMXTTLNumber1 DNSRecordEditResponseMXTTLNumber = 1
-)
-
-type DNSRecordEditResponseNAPTR struct {
- // Components of a NAPTR record.
- Data DNSRecordEditResponseNAPTRData `json:"data,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordEditResponseNAPTRType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // Formatted NAPTR content. See 'data' to set NAPTR properties.
- Content string `json:"content"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordEditResponseNAPTRMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordEditResponseNAPTRTTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordEditResponseNAPTRJSON `json:"-"`
-}
-
-// dnsRecordEditResponseNAPTRJSON contains the JSON metadata for the struct
-// [DNSRecordEditResponseNAPTR]
-type dnsRecordEditResponseNAPTRJSON struct {
- Data apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- Content apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordEditResponseNAPTR) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordEditResponseNAPTRJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordEditResponseNAPTR) implementsDNSRecordEditResponse() {}
-
-// Components of a NAPTR record.
-type DNSRecordEditResponseNAPTRData struct {
- // Flags.
- Flags string `json:"flags"`
- // Order.
- Order float64 `json:"order"`
- // Preference.
- Preference float64 `json:"preference"`
- // Regex.
- Regex string `json:"regex"`
- // Replacement.
- Replacement string `json:"replacement"`
- // Service.
- Service string `json:"service"`
- JSON dnsRecordEditResponseNAPTRDataJSON `json:"-"`
-}
-
-// dnsRecordEditResponseNAPTRDataJSON contains the JSON metadata for the struct
-// [DNSRecordEditResponseNAPTRData]
-type dnsRecordEditResponseNAPTRDataJSON struct {
- Flags apijson.Field
- Order apijson.Field
- Preference apijson.Field
- Regex apijson.Field
- Replacement apijson.Field
- Service apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordEditResponseNAPTRData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordEditResponseNAPTRDataJSON) RawJSON() string {
- return r.raw
-}
-
-// Record type.
-type DNSRecordEditResponseNAPTRType string
-
-const (
- DNSRecordEditResponseNAPTRTypeNAPTR DNSRecordEditResponseNAPTRType = "NAPTR"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordEditResponseNAPTRMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordEditResponseNAPTRMetaJSON `json:"-"`
-}
-
-// dnsRecordEditResponseNAPTRMetaJSON contains the JSON metadata for the struct
-// [DNSRecordEditResponseNAPTRMeta]
-type dnsRecordEditResponseNAPTRMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordEditResponseNAPTRMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordEditResponseNAPTRMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordEditResponseNAPTRTTLNumber].
-type DNSRecordEditResponseNAPTRTTL interface {
- ImplementsDNSRecordEditResponseNaptrttl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordEditResponseNAPTRTTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordEditResponseNAPTRTTLNumber(0)),
- },
- )
-}
-
-type DNSRecordEditResponseNAPTRTTLNumber float64
-
-const (
- DNSRecordEditResponseNAPTRTTLNumber1 DNSRecordEditResponseNAPTRTTLNumber = 1
-)
-
-type DNSRecordEditResponseNS struct {
- // A valid name server host name.
- Content interface{} `json:"content,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordEditResponseNSType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordEditResponseNSMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordEditResponseNSTTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordEditResponseNSJSON `json:"-"`
-}
-
-// dnsRecordEditResponseNSJSON contains the JSON metadata for the struct
-// [DNSRecordEditResponseNS]
-type dnsRecordEditResponseNSJSON struct {
- Content apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordEditResponseNS) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordEditResponseNSJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordEditResponseNS) implementsDNSRecordEditResponse() {}
-
-// Record type.
-type DNSRecordEditResponseNSType string
-
-const (
- DNSRecordEditResponseNSTypeNS DNSRecordEditResponseNSType = "NS"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordEditResponseNSMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordEditResponseNSMetaJSON `json:"-"`
-}
-
-// dnsRecordEditResponseNSMetaJSON contains the JSON metadata for the struct
-// [DNSRecordEditResponseNSMeta]
-type dnsRecordEditResponseNSMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordEditResponseNSMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordEditResponseNSMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordEditResponseNSTTLNumber].
-type DNSRecordEditResponseNSTTL interface {
- ImplementsDNSRecordEditResponseNsttl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordEditResponseNSTTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordEditResponseNSTTLNumber(0)),
- },
- )
-}
-
-type DNSRecordEditResponseNSTTLNumber float64
-
-const (
- DNSRecordEditResponseNSTTLNumber1 DNSRecordEditResponseNSTTLNumber = 1
-)
-
-type DNSRecordEditResponsePTR struct {
- // Domain name pointing to the address.
- Content string `json:"content,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordEditResponsePTRType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordEditResponsePTRMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordEditResponsePTRTTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordEditResponsePTRJSON `json:"-"`
-}
-
-// dnsRecordEditResponsePTRJSON contains the JSON metadata for the struct
-// [DNSRecordEditResponsePTR]
-type dnsRecordEditResponsePTRJSON struct {
- Content apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordEditResponsePTR) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordEditResponsePTRJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordEditResponsePTR) implementsDNSRecordEditResponse() {}
-
-// Record type.
-type DNSRecordEditResponsePTRType string
-
-const (
- DNSRecordEditResponsePTRTypePTR DNSRecordEditResponsePTRType = "PTR"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordEditResponsePTRMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordEditResponsePTRMetaJSON `json:"-"`
-}
-
-// dnsRecordEditResponsePTRMetaJSON contains the JSON metadata for the struct
-// [DNSRecordEditResponsePTRMeta]
-type dnsRecordEditResponsePTRMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordEditResponsePTRMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordEditResponsePTRMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordEditResponsePTRTTLNumber].
-type DNSRecordEditResponsePTRTTL interface {
- ImplementsDNSRecordEditResponsePtrttl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordEditResponsePTRTTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordEditResponsePTRTTLNumber(0)),
- },
- )
-}
-
-type DNSRecordEditResponsePTRTTLNumber float64
-
-const (
- DNSRecordEditResponsePTRTTLNumber1 DNSRecordEditResponsePTRTTLNumber = 1
-)
-
-type DNSRecordEditResponseSmimea struct {
- // Components of a SMIMEA record.
- Data DNSRecordEditResponseSmimeaData `json:"data,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordEditResponseSmimeaType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // Formatted SMIMEA content. See 'data' to set SMIMEA properties.
- Content string `json:"content"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordEditResponseSmimeaMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordEditResponseSmimeaTTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordEditResponseSmimeaJSON `json:"-"`
-}
-
-// dnsRecordEditResponseSmimeaJSON contains the JSON metadata for the struct
-// [DNSRecordEditResponseSmimea]
-type dnsRecordEditResponseSmimeaJSON struct {
- Data apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- Content apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordEditResponseSmimea) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordEditResponseSmimeaJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordEditResponseSmimea) implementsDNSRecordEditResponse() {}
-
-// Components of a SMIMEA record.
-type DNSRecordEditResponseSmimeaData struct {
- // Certificate.
- Certificate string `json:"certificate"`
- // Matching Type.
- MatchingType float64 `json:"matching_type"`
- // Selector.
- Selector float64 `json:"selector"`
- // Usage.
- Usage float64 `json:"usage"`
- JSON dnsRecordEditResponseSmimeaDataJSON `json:"-"`
-}
-
-// dnsRecordEditResponseSmimeaDataJSON contains the JSON metadata for the struct
-// [DNSRecordEditResponseSmimeaData]
-type dnsRecordEditResponseSmimeaDataJSON struct {
- Certificate apijson.Field
- MatchingType apijson.Field
- Selector apijson.Field
- Usage apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordEditResponseSmimeaData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordEditResponseSmimeaDataJSON) RawJSON() string {
- return r.raw
-}
-
-// Record type.
-type DNSRecordEditResponseSmimeaType string
-
-const (
- DNSRecordEditResponseSmimeaTypeSmimea DNSRecordEditResponseSmimeaType = "SMIMEA"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordEditResponseSmimeaMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordEditResponseSmimeaMetaJSON `json:"-"`
-}
-
-// dnsRecordEditResponseSmimeaMetaJSON contains the JSON metadata for the struct
-// [DNSRecordEditResponseSmimeaMeta]
-type dnsRecordEditResponseSmimeaMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordEditResponseSmimeaMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordEditResponseSmimeaMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or
-// [DNSRecordEditResponseSmimeaTTLNumber].
-type DNSRecordEditResponseSmimeaTTL interface {
- ImplementsDNSRecordEditResponseSmimeaTTL()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordEditResponseSmimeaTTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordEditResponseSmimeaTTLNumber(0)),
- },
- )
-}
-
-type DNSRecordEditResponseSmimeaTTLNumber float64
-
-const (
- DNSRecordEditResponseSmimeaTTLNumber1 DNSRecordEditResponseSmimeaTTLNumber = 1
-)
-
-type DNSRecordEditResponseSRV struct {
- // Components of a SRV record.
- Data DNSRecordEditResponseSRVData `json:"data,required"`
- // DNS record name (or @ for the zone apex) in Punycode. For SRV records, the first
- // label is normally a service and the second a protocol name, each starting with
- // an underscore.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordEditResponseSRVType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // Priority, weight, port, and SRV target. See 'data' for setting the individual
- // component values.
- Content string `json:"content"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordEditResponseSRVMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordEditResponseSRVTTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordEditResponseSRVJSON `json:"-"`
-}
-
-// dnsRecordEditResponseSRVJSON contains the JSON metadata for the struct
-// [DNSRecordEditResponseSRV]
-type dnsRecordEditResponseSRVJSON struct {
- Data apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- Content apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordEditResponseSRV) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordEditResponseSRVJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordEditResponseSRV) implementsDNSRecordEditResponse() {}
-
-// Components of a SRV record.
-type DNSRecordEditResponseSRVData struct {
- // A valid hostname. Deprecated in favor of the regular 'name' outside the data
- // map. This data map field represents the remainder of the full 'name' after the
- // service and protocol.
- Name string `json:"name" format:"hostname"`
- // The port of the service.
- Port float64 `json:"port"`
- // Required for MX, SRV and URI records; unused by other record types. Records with
- // lower priorities are preferred.
- Priority float64 `json:"priority"`
- // A valid protocol, prefixed with an underscore. Deprecated in favor of the
- // regular 'name' outside the data map. This data map field normally represents the
- // second label of that 'name'.
- Proto string `json:"proto"`
- // A service type, prefixed with an underscore. Deprecated in favor of the regular
- // 'name' outside the data map. This data map field normally represents the first
- // label of that 'name'.
- Service string `json:"service"`
- // A valid hostname.
- Target string `json:"target" format:"hostname"`
- // The record weight.
- Weight float64 `json:"weight"`
- JSON dnsRecordEditResponseSRVDataJSON `json:"-"`
-}
-
-// dnsRecordEditResponseSRVDataJSON contains the JSON metadata for the struct
-// [DNSRecordEditResponseSRVData]
-type dnsRecordEditResponseSRVDataJSON struct {
- Name apijson.Field
- Port apijson.Field
- Priority apijson.Field
- Proto apijson.Field
- Service apijson.Field
- Target apijson.Field
- Weight apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordEditResponseSRVData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordEditResponseSRVDataJSON) RawJSON() string {
- return r.raw
-}
-
-// Record type.
-type DNSRecordEditResponseSRVType string
-
-const (
- DNSRecordEditResponseSRVTypeSRV DNSRecordEditResponseSRVType = "SRV"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordEditResponseSRVMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordEditResponseSRVMetaJSON `json:"-"`
-}
-
-// dnsRecordEditResponseSRVMetaJSON contains the JSON metadata for the struct
-// [DNSRecordEditResponseSRVMeta]
-type dnsRecordEditResponseSRVMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordEditResponseSRVMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordEditResponseSRVMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordEditResponseSRVTTLNumber].
-type DNSRecordEditResponseSRVTTL interface {
- ImplementsDNSRecordEditResponseSrvttl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordEditResponseSRVTTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordEditResponseSRVTTLNumber(0)),
- },
- )
-}
-
-type DNSRecordEditResponseSRVTTLNumber float64
-
-const (
- DNSRecordEditResponseSRVTTLNumber1 DNSRecordEditResponseSRVTTLNumber = 1
-)
-
-type DNSRecordEditResponseSSHFP struct {
- // Components of a SSHFP record.
- Data DNSRecordEditResponseSSHFPData `json:"data,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordEditResponseSSHFPType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // Formatted SSHFP content. See 'data' to set SSHFP properties.
- Content string `json:"content"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordEditResponseSSHFPMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordEditResponseSSHFPTTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordEditResponseSSHFPJSON `json:"-"`
-}
-
-// dnsRecordEditResponseSSHFPJSON contains the JSON metadata for the struct
-// [DNSRecordEditResponseSSHFP]
-type dnsRecordEditResponseSSHFPJSON struct {
- Data apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- Content apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordEditResponseSSHFP) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordEditResponseSSHFPJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordEditResponseSSHFP) implementsDNSRecordEditResponse() {}
-
-// Components of a SSHFP record.
-type DNSRecordEditResponseSSHFPData struct {
- // algorithm.
- Algorithm float64 `json:"algorithm"`
- // fingerprint.
- Fingerprint string `json:"fingerprint"`
- // type.
- Type float64 `json:"type"`
- JSON dnsRecordEditResponseSSHFPDataJSON `json:"-"`
-}
-
-// dnsRecordEditResponseSSHFPDataJSON contains the JSON metadata for the struct
-// [DNSRecordEditResponseSSHFPData]
-type dnsRecordEditResponseSSHFPDataJSON struct {
- Algorithm apijson.Field
- Fingerprint apijson.Field
- Type apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordEditResponseSSHFPData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordEditResponseSSHFPDataJSON) RawJSON() string {
- return r.raw
-}
-
-// Record type.
-type DNSRecordEditResponseSSHFPType string
-
-const (
- DNSRecordEditResponseSSHFPTypeSSHFP DNSRecordEditResponseSSHFPType = "SSHFP"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordEditResponseSSHFPMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordEditResponseSSHFPMetaJSON `json:"-"`
-}
-
-// dnsRecordEditResponseSSHFPMetaJSON contains the JSON metadata for the struct
-// [DNSRecordEditResponseSSHFPMeta]
-type dnsRecordEditResponseSSHFPMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordEditResponseSSHFPMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordEditResponseSSHFPMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordEditResponseSSHFPTTLNumber].
-type DNSRecordEditResponseSSHFPTTL interface {
- ImplementsDNSRecordEditResponseSshfpttl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordEditResponseSSHFPTTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordEditResponseSSHFPTTLNumber(0)),
- },
- )
-}
-
-type DNSRecordEditResponseSSHFPTTLNumber float64
-
-const (
- DNSRecordEditResponseSSHFPTTLNumber1 DNSRecordEditResponseSSHFPTTLNumber = 1
-)
-
-type DNSRecordEditResponseSVCB struct {
- // Components of a SVCB record.
- Data DNSRecordEditResponseSVCBData `json:"data,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordEditResponseSVCBType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // Formatted SVCB content. See 'data' to set SVCB properties.
- Content string `json:"content"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordEditResponseSVCBMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordEditResponseSVCBTTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordEditResponseSVCBJSON `json:"-"`
-}
-
-// dnsRecordEditResponseSVCBJSON contains the JSON metadata for the struct
-// [DNSRecordEditResponseSVCB]
-type dnsRecordEditResponseSVCBJSON struct {
- Data apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- Content apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordEditResponseSVCB) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordEditResponseSVCBJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordEditResponseSVCB) implementsDNSRecordEditResponse() {}
-
-// Components of a SVCB record.
-type DNSRecordEditResponseSVCBData struct {
- // priority.
- Priority float64 `json:"priority"`
- // target.
- Target string `json:"target"`
- // value.
- Value string `json:"value"`
- JSON dnsRecordEditResponseSVCBDataJSON `json:"-"`
-}
-
-// dnsRecordEditResponseSVCBDataJSON contains the JSON metadata for the struct
-// [DNSRecordEditResponseSVCBData]
-type dnsRecordEditResponseSVCBDataJSON struct {
- Priority apijson.Field
- Target apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordEditResponseSVCBData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordEditResponseSVCBDataJSON) RawJSON() string {
- return r.raw
-}
-
-// Record type.
-type DNSRecordEditResponseSVCBType string
-
-const (
- DNSRecordEditResponseSVCBTypeSVCB DNSRecordEditResponseSVCBType = "SVCB"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordEditResponseSVCBMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordEditResponseSVCBMetaJSON `json:"-"`
-}
-
-// dnsRecordEditResponseSVCBMetaJSON contains the JSON metadata for the struct
-// [DNSRecordEditResponseSVCBMeta]
-type dnsRecordEditResponseSVCBMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordEditResponseSVCBMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordEditResponseSVCBMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordEditResponseSVCBTTLNumber].
-type DNSRecordEditResponseSVCBTTL interface {
- ImplementsDNSRecordEditResponseSvcbttl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordEditResponseSVCBTTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordEditResponseSVCBTTLNumber(0)),
- },
- )
-}
-
-type DNSRecordEditResponseSVCBTTLNumber float64
-
-const (
- DNSRecordEditResponseSVCBTTLNumber1 DNSRecordEditResponseSVCBTTLNumber = 1
-)
-
-type DNSRecordEditResponseTLSA struct {
- // Components of a TLSA record.
- Data DNSRecordEditResponseTLSAData `json:"data,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordEditResponseTLSAType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // Formatted TLSA content. See 'data' to set TLSA properties.
- Content string `json:"content"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordEditResponseTLSAMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordEditResponseTLSATTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordEditResponseTLSAJSON `json:"-"`
-}
-
-// dnsRecordEditResponseTLSAJSON contains the JSON metadata for the struct
-// [DNSRecordEditResponseTLSA]
-type dnsRecordEditResponseTLSAJSON struct {
- Data apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- Content apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordEditResponseTLSA) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordEditResponseTLSAJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordEditResponseTLSA) implementsDNSRecordEditResponse() {}
-
-// Components of a TLSA record.
-type DNSRecordEditResponseTLSAData struct {
- // certificate.
- Certificate string `json:"certificate"`
- // Matching Type.
- MatchingType float64 `json:"matching_type"`
- // Selector.
- Selector float64 `json:"selector"`
- // Usage.
- Usage float64 `json:"usage"`
- JSON dnsRecordEditResponseTLSADataJSON `json:"-"`
-}
-
-// dnsRecordEditResponseTLSADataJSON contains the JSON metadata for the struct
-// [DNSRecordEditResponseTLSAData]
-type dnsRecordEditResponseTLSADataJSON struct {
- Certificate apijson.Field
- MatchingType apijson.Field
- Selector apijson.Field
- Usage apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordEditResponseTLSAData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordEditResponseTLSADataJSON) RawJSON() string {
- return r.raw
-}
-
-// Record type.
-type DNSRecordEditResponseTLSAType string
-
-const (
- DNSRecordEditResponseTLSATypeTLSA DNSRecordEditResponseTLSAType = "TLSA"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordEditResponseTLSAMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordEditResponseTLSAMetaJSON `json:"-"`
-}
-
-// dnsRecordEditResponseTLSAMetaJSON contains the JSON metadata for the struct
-// [DNSRecordEditResponseTLSAMeta]
-type dnsRecordEditResponseTLSAMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordEditResponseTLSAMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordEditResponseTLSAMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordEditResponseTLSATTLNumber].
-type DNSRecordEditResponseTLSATTL interface {
- ImplementsDNSRecordEditResponseTlsattl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordEditResponseTLSATTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordEditResponseTLSATTLNumber(0)),
- },
- )
-}
-
-type DNSRecordEditResponseTLSATTLNumber float64
-
-const (
- DNSRecordEditResponseTLSATTLNumber1 DNSRecordEditResponseTLSATTLNumber = 1
-)
-
-type DNSRecordEditResponseTXT struct {
- // Text content for the record.
- Content string `json:"content,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordEditResponseTXTType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordEditResponseTXTMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordEditResponseTXTTTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordEditResponseTXTJSON `json:"-"`
-}
-
-// dnsRecordEditResponseTXTJSON contains the JSON metadata for the struct
-// [DNSRecordEditResponseTXT]
-type dnsRecordEditResponseTXTJSON struct {
- Content apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordEditResponseTXT) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordEditResponseTXTJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordEditResponseTXT) implementsDNSRecordEditResponse() {}
-
-// Record type.
-type DNSRecordEditResponseTXTType string
-
-const (
- DNSRecordEditResponseTXTTypeTXT DNSRecordEditResponseTXTType = "TXT"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordEditResponseTXTMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordEditResponseTXTMetaJSON `json:"-"`
-}
-
-// dnsRecordEditResponseTXTMetaJSON contains the JSON metadata for the struct
-// [DNSRecordEditResponseTXTMeta]
-type dnsRecordEditResponseTXTMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordEditResponseTXTMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordEditResponseTXTMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordEditResponseTXTTTLNumber].
-type DNSRecordEditResponseTXTTTL interface {
- ImplementsDNSRecordEditResponseTxtttl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordEditResponseTXTTTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordEditResponseTXTTTLNumber(0)),
- },
- )
-}
-
-type DNSRecordEditResponseTXTTTLNumber float64
-
-const (
- DNSRecordEditResponseTXTTTLNumber1 DNSRecordEditResponseTXTTTLNumber = 1
-)
-
-type DNSRecordEditResponseURI struct {
- // Components of a URI record.
- Data DNSRecordEditResponseURIData `json:"data,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Required for MX, SRV and URI records; unused by other record types. Records with
- // lower priorities are preferred.
- Priority float64 `json:"priority,required"`
- // Record type.
- Type DNSRecordEditResponseURIType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // Formatted URI content. See 'data' to set URI properties.
- Content string `json:"content"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordEditResponseURIMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordEditResponseURITTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordEditResponseURIJSON `json:"-"`
-}
-
-// dnsRecordEditResponseURIJSON contains the JSON metadata for the struct
-// [DNSRecordEditResponseURI]
-type dnsRecordEditResponseURIJSON struct {
- Data apijson.Field
- Name apijson.Field
- Priority apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- Content apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordEditResponseURI) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordEditResponseURIJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordEditResponseURI) implementsDNSRecordEditResponse() {}
-
-// Components of a URI record.
-type DNSRecordEditResponseURIData struct {
- // The record content.
- Content string `json:"content"`
- // The record weight.
- Weight float64 `json:"weight"`
- JSON dnsRecordEditResponseURIDataJSON `json:"-"`
-}
-
-// dnsRecordEditResponseURIDataJSON contains the JSON metadata for the struct
-// [DNSRecordEditResponseURIData]
-type dnsRecordEditResponseURIDataJSON struct {
- Content apijson.Field
- Weight apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordEditResponseURIData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordEditResponseURIDataJSON) RawJSON() string {
- return r.raw
-}
-
-// Record type.
-type DNSRecordEditResponseURIType string
-
-const (
- DNSRecordEditResponseURITypeURI DNSRecordEditResponseURIType = "URI"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordEditResponseURIMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordEditResponseURIMetaJSON `json:"-"`
-}
-
-// dnsRecordEditResponseURIMetaJSON contains the JSON metadata for the struct
-// [DNSRecordEditResponseURIMeta]
-type dnsRecordEditResponseURIMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordEditResponseURIMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordEditResponseURIMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordEditResponseURITTLNumber].
-type DNSRecordEditResponseURITTL interface {
- ImplementsDNSRecordEditResponseUrittl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordEditResponseURITTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordEditResponseURITTLNumber(0)),
- },
- )
-}
-
-type DNSRecordEditResponseURITTLNumber float64
-
-const (
- DNSRecordEditResponseURITTLNumber1 DNSRecordEditResponseURITTLNumber = 1
-)
-
-// Union satisfied by [DNSRecordGetResponseA], [DNSRecordGetResponseAAAA],
-// [DNSRecordGetResponseCAA], [DNSRecordGetResponseCert],
-// [DNSRecordGetResponseCNAME], [DNSRecordGetResponseDNSKEY],
-// [DNSRecordGetResponseDS], [DNSRecordGetResponseHTTPS],
-// [DNSRecordGetResponseLOC], [DNSRecordGetResponseMX],
-// [DNSRecordGetResponseNAPTR], [DNSRecordGetResponseNS],
-// [DNSRecordGetResponsePTR], [DNSRecordGetResponseSmimea],
-// [DNSRecordGetResponseSRV], [DNSRecordGetResponseSSHFP],
-// [DNSRecordGetResponseSVCB], [DNSRecordGetResponseTLSA],
-// [DNSRecordGetResponseTXT] or [DNSRecordGetResponseURI].
-type DNSRecordGetResponse interface {
- implementsDNSRecordGetResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordGetResponse)(nil)).Elem(),
- "type",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordGetResponseA{}),
- DiscriminatorValue: "A",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordGetResponseAAAA{}),
- DiscriminatorValue: "AAAA",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordGetResponseCAA{}),
- DiscriminatorValue: "CAA",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordGetResponseCert{}),
- DiscriminatorValue: "CERT",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordGetResponseCNAME{}),
- DiscriminatorValue: "CNAME",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordGetResponseDNSKEY{}),
- DiscriminatorValue: "DNSKEY",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordGetResponseDS{}),
- DiscriminatorValue: "DS",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordGetResponseHTTPS{}),
- DiscriminatorValue: "HTTPS",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordGetResponseLOC{}),
- DiscriminatorValue: "LOC",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordGetResponseMX{}),
- DiscriminatorValue: "MX",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordGetResponseNAPTR{}),
- DiscriminatorValue: "NAPTR",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordGetResponseNS{}),
- DiscriminatorValue: "NS",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordGetResponsePTR{}),
- DiscriminatorValue: "PTR",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordGetResponseSmimea{}),
- DiscriminatorValue: "SMIMEA",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordGetResponseSRV{}),
- DiscriminatorValue: "SRV",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordGetResponseSSHFP{}),
- DiscriminatorValue: "SSHFP",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordGetResponseSVCB{}),
- DiscriminatorValue: "SVCB",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordGetResponseTLSA{}),
- DiscriminatorValue: "TLSA",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordGetResponseTXT{}),
- DiscriminatorValue: "TXT",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(DNSRecordGetResponseURI{}),
- DiscriminatorValue: "URI",
- },
- )
-}
-
-type DNSRecordGetResponseA struct {
- // A valid IPv4 address.
- Content string `json:"content,required" format:"ipv4"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordGetResponseAType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordGetResponseAMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Whether the record is receiving the performance and security benefits of
- // Cloudflare.
- Proxied bool `json:"proxied"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordGetResponseATTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordGetResponseAJSON `json:"-"`
-}
-
-// dnsRecordGetResponseAJSON contains the JSON metadata for the struct
-// [DNSRecordGetResponseA]
-type dnsRecordGetResponseAJSON struct {
- Content apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Proxied apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordGetResponseA) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordGetResponseAJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordGetResponseA) implementsDNSRecordGetResponse() {}
-
-// Record type.
-type DNSRecordGetResponseAType string
-
-const (
- DNSRecordGetResponseATypeA DNSRecordGetResponseAType = "A"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordGetResponseAMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordGetResponseAMetaJSON `json:"-"`
-}
-
-// dnsRecordGetResponseAMetaJSON contains the JSON metadata for the struct
-// [DNSRecordGetResponseAMeta]
-type dnsRecordGetResponseAMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordGetResponseAMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordGetResponseAMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordGetResponseATTLNumber].
-type DNSRecordGetResponseATTL interface {
- ImplementsDNSRecordGetResponseAttl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordGetResponseATTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordGetResponseATTLNumber(0)),
- },
- )
-}
-
-type DNSRecordGetResponseATTLNumber float64
-
-const (
- DNSRecordGetResponseATTLNumber1 DNSRecordGetResponseATTLNumber = 1
-)
-
-type DNSRecordGetResponseAAAA struct {
- // A valid IPv6 address.
- Content string `json:"content,required" format:"ipv6"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordGetResponseAAAAType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordGetResponseAAAAMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Whether the record is receiving the performance and security benefits of
- // Cloudflare.
- Proxied bool `json:"proxied"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordGetResponseAAAATTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordGetResponseAAAAJSON `json:"-"`
-}
-
-// dnsRecordGetResponseAAAAJSON contains the JSON metadata for the struct
-// [DNSRecordGetResponseAAAA]
-type dnsRecordGetResponseAAAAJSON struct {
- Content apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Proxied apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordGetResponseAAAA) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordGetResponseAAAAJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordGetResponseAAAA) implementsDNSRecordGetResponse() {}
-
-// Record type.
-type DNSRecordGetResponseAAAAType string
-
-const (
- DNSRecordGetResponseAAAATypeAAAA DNSRecordGetResponseAAAAType = "AAAA"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordGetResponseAAAAMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordGetResponseAAAAMetaJSON `json:"-"`
-}
-
-// dnsRecordGetResponseAAAAMetaJSON contains the JSON metadata for the struct
-// [DNSRecordGetResponseAAAAMeta]
-type dnsRecordGetResponseAAAAMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordGetResponseAAAAMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordGetResponseAAAAMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordGetResponseAAAATTLNumber].
-type DNSRecordGetResponseAAAATTL interface {
- ImplementsDNSRecordGetResponseAaaattl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordGetResponseAAAATTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordGetResponseAAAATTLNumber(0)),
- },
- )
-}
-
-type DNSRecordGetResponseAAAATTLNumber float64
-
-const (
- DNSRecordGetResponseAAAATTLNumber1 DNSRecordGetResponseAAAATTLNumber = 1
-)
-
-type DNSRecordGetResponseCAA struct {
- // Components of a CAA record.
- Data DNSRecordGetResponseCAAData `json:"data,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordGetResponseCAAType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // Formatted CAA content. See 'data' to set CAA properties.
- Content string `json:"content"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordGetResponseCAAMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordGetResponseCAATTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordGetResponseCAAJSON `json:"-"`
-}
-
-// dnsRecordGetResponseCAAJSON contains the JSON metadata for the struct
-// [DNSRecordGetResponseCAA]
-type dnsRecordGetResponseCAAJSON struct {
- Data apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- Content apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordGetResponseCAA) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordGetResponseCAAJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordGetResponseCAA) implementsDNSRecordGetResponse() {}
-
-// Components of a CAA record.
-type DNSRecordGetResponseCAAData struct {
- // Flags for the CAA record.
- Flags float64 `json:"flags"`
- // Name of the property controlled by this record (e.g.: issue, issuewild, iodef).
- Tag string `json:"tag"`
- // Value of the record. This field's semantics depend on the chosen tag.
- Value string `json:"value"`
- JSON dnsRecordGetResponseCAADataJSON `json:"-"`
-}
-
-// dnsRecordGetResponseCAADataJSON contains the JSON metadata for the struct
-// [DNSRecordGetResponseCAAData]
-type dnsRecordGetResponseCAADataJSON struct {
- Flags apijson.Field
- Tag apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordGetResponseCAAData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordGetResponseCAADataJSON) RawJSON() string {
- return r.raw
-}
-
-// Record type.
-type DNSRecordGetResponseCAAType string
-
-const (
- DNSRecordGetResponseCAATypeCAA DNSRecordGetResponseCAAType = "CAA"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordGetResponseCAAMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordGetResponseCAAMetaJSON `json:"-"`
-}
-
-// dnsRecordGetResponseCAAMetaJSON contains the JSON metadata for the struct
-// [DNSRecordGetResponseCAAMeta]
-type dnsRecordGetResponseCAAMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordGetResponseCAAMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordGetResponseCAAMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordGetResponseCAATTLNumber].
-type DNSRecordGetResponseCAATTL interface {
- ImplementsDNSRecordGetResponseCaattl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordGetResponseCAATTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordGetResponseCAATTLNumber(0)),
- },
- )
-}
-
-type DNSRecordGetResponseCAATTLNumber float64
-
-const (
- DNSRecordGetResponseCAATTLNumber1 DNSRecordGetResponseCAATTLNumber = 1
-)
-
-type DNSRecordGetResponseCert struct {
- // Components of a CERT record.
- Data DNSRecordGetResponseCertData `json:"data,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordGetResponseCertType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // Formatted CERT content. See 'data' to set CERT properties.
- Content string `json:"content"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordGetResponseCertMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordGetResponseCertTTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordGetResponseCertJSON `json:"-"`
-}
-
-// dnsRecordGetResponseCertJSON contains the JSON metadata for the struct
-// [DNSRecordGetResponseCert]
-type dnsRecordGetResponseCertJSON struct {
- Data apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- Content apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordGetResponseCert) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordGetResponseCertJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordGetResponseCert) implementsDNSRecordGetResponse() {}
-
-// Components of a CERT record.
-type DNSRecordGetResponseCertData struct {
- // Algorithm.
- Algorithm float64 `json:"algorithm"`
- // Certificate.
- Certificate string `json:"certificate"`
- // Key Tag.
- KeyTag float64 `json:"key_tag"`
- // Type.
- Type float64 `json:"type"`
- JSON dnsRecordGetResponseCertDataJSON `json:"-"`
-}
-
-// dnsRecordGetResponseCertDataJSON contains the JSON metadata for the struct
-// [DNSRecordGetResponseCertData]
-type dnsRecordGetResponseCertDataJSON struct {
- Algorithm apijson.Field
- Certificate apijson.Field
- KeyTag apijson.Field
- Type apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordGetResponseCertData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordGetResponseCertDataJSON) RawJSON() string {
- return r.raw
-}
-
-// Record type.
-type DNSRecordGetResponseCertType string
-
-const (
- DNSRecordGetResponseCertTypeCert DNSRecordGetResponseCertType = "CERT"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordGetResponseCertMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordGetResponseCertMetaJSON `json:"-"`
-}
-
-// dnsRecordGetResponseCertMetaJSON contains the JSON metadata for the struct
-// [DNSRecordGetResponseCertMeta]
-type dnsRecordGetResponseCertMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordGetResponseCertMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordGetResponseCertMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordGetResponseCertTTLNumber].
-type DNSRecordGetResponseCertTTL interface {
- ImplementsDNSRecordGetResponseCertTTL()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordGetResponseCertTTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordGetResponseCertTTLNumber(0)),
- },
- )
-}
-
-type DNSRecordGetResponseCertTTLNumber float64
-
-const (
- DNSRecordGetResponseCertTTLNumber1 DNSRecordGetResponseCertTTLNumber = 1
-)
-
-type DNSRecordGetResponseCNAME struct {
- // A valid hostname. Must not match the record's name.
- Content interface{} `json:"content,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordGetResponseCNAMEType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordGetResponseCNAMEMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Whether the record is receiving the performance and security benefits of
- // Cloudflare.
- Proxied bool `json:"proxied"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordGetResponseCNAMETTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordGetResponseCNAMEJSON `json:"-"`
-}
-
-// dnsRecordGetResponseCNAMEJSON contains the JSON metadata for the struct
-// [DNSRecordGetResponseCNAME]
-type dnsRecordGetResponseCNAMEJSON struct {
- Content apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Proxied apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordGetResponseCNAME) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordGetResponseCNAMEJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordGetResponseCNAME) implementsDNSRecordGetResponse() {}
-
-// Record type.
-type DNSRecordGetResponseCNAMEType string
-
-const (
- DNSRecordGetResponseCNAMETypeCNAME DNSRecordGetResponseCNAMEType = "CNAME"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordGetResponseCNAMEMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordGetResponseCNAMEMetaJSON `json:"-"`
-}
-
-// dnsRecordGetResponseCNAMEMetaJSON contains the JSON metadata for the struct
-// [DNSRecordGetResponseCNAMEMeta]
-type dnsRecordGetResponseCNAMEMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordGetResponseCNAMEMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordGetResponseCNAMEMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordGetResponseCNAMETTLNumber].
-type DNSRecordGetResponseCNAMETTL interface {
- ImplementsDNSRecordGetResponseCnamettl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordGetResponseCNAMETTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordGetResponseCNAMETTLNumber(0)),
- },
- )
-}
-
-type DNSRecordGetResponseCNAMETTLNumber float64
-
-const (
- DNSRecordGetResponseCNAMETTLNumber1 DNSRecordGetResponseCNAMETTLNumber = 1
-)
-
-type DNSRecordGetResponseDNSKEY struct {
- // Components of a DNSKEY record.
- Data DNSRecordGetResponseDNSKEYData `json:"data,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordGetResponseDNSKEYType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // Formatted DNSKEY content. See 'data' to set DNSKEY properties.
- Content string `json:"content"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordGetResponseDNSKEYMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordGetResponseDNSKEYTTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordGetResponseDNSKEYJSON `json:"-"`
-}
-
-// dnsRecordGetResponseDNSKEYJSON contains the JSON metadata for the struct
-// [DNSRecordGetResponseDNSKEY]
-type dnsRecordGetResponseDNSKEYJSON struct {
- Data apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- Content apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordGetResponseDNSKEY) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordGetResponseDNSKEYJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordGetResponseDNSKEY) implementsDNSRecordGetResponse() {}
-
-// Components of a DNSKEY record.
-type DNSRecordGetResponseDNSKEYData struct {
- // Algorithm.
- Algorithm float64 `json:"algorithm"`
- // Flags.
- Flags float64 `json:"flags"`
- // Protocol.
- Protocol float64 `json:"protocol"`
- // Public Key.
- PublicKey string `json:"public_key"`
- JSON dnsRecordGetResponseDNSKEYDataJSON `json:"-"`
-}
-
-// dnsRecordGetResponseDNSKEYDataJSON contains the JSON metadata for the struct
-// [DNSRecordGetResponseDNSKEYData]
-type dnsRecordGetResponseDNSKEYDataJSON struct {
- Algorithm apijson.Field
- Flags apijson.Field
- Protocol apijson.Field
- PublicKey apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordGetResponseDNSKEYData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordGetResponseDNSKEYDataJSON) RawJSON() string {
- return r.raw
-}
-
-// Record type.
-type DNSRecordGetResponseDNSKEYType string
-
-const (
- DNSRecordGetResponseDNSKEYTypeDNSKEY DNSRecordGetResponseDNSKEYType = "DNSKEY"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordGetResponseDNSKEYMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordGetResponseDNSKEYMetaJSON `json:"-"`
-}
-
-// dnsRecordGetResponseDNSKEYMetaJSON contains the JSON metadata for the struct
-// [DNSRecordGetResponseDNSKEYMeta]
-type dnsRecordGetResponseDNSKEYMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordGetResponseDNSKEYMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordGetResponseDNSKEYMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordGetResponseDNSKEYTTLNumber].
-type DNSRecordGetResponseDNSKEYTTL interface {
- ImplementsDNSRecordGetResponseDnskeyttl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordGetResponseDNSKEYTTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordGetResponseDNSKEYTTLNumber(0)),
- },
- )
-}
-
-type DNSRecordGetResponseDNSKEYTTLNumber float64
-
-const (
- DNSRecordGetResponseDNSKEYTTLNumber1 DNSRecordGetResponseDNSKEYTTLNumber = 1
-)
-
-type DNSRecordGetResponseDS struct {
- // Components of a DS record.
- Data DNSRecordGetResponseDSData `json:"data,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordGetResponseDSType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // Formatted DS content. See 'data' to set DS properties.
- Content string `json:"content"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordGetResponseDSMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordGetResponseDSTTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordGetResponseDSJSON `json:"-"`
-}
-
-// dnsRecordGetResponseDSJSON contains the JSON metadata for the struct
-// [DNSRecordGetResponseDS]
-type dnsRecordGetResponseDSJSON struct {
- Data apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- Content apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordGetResponseDS) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordGetResponseDSJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordGetResponseDS) implementsDNSRecordGetResponse() {}
-
-// Components of a DS record.
-type DNSRecordGetResponseDSData struct {
- // Algorithm.
- Algorithm float64 `json:"algorithm"`
- // Digest.
- Digest string `json:"digest"`
- // Digest Type.
- DigestType float64 `json:"digest_type"`
- // Key Tag.
- KeyTag float64 `json:"key_tag"`
- JSON dnsRecordGetResponseDSDataJSON `json:"-"`
-}
-
-// dnsRecordGetResponseDSDataJSON contains the JSON metadata for the struct
-// [DNSRecordGetResponseDSData]
-type dnsRecordGetResponseDSDataJSON struct {
- Algorithm apijson.Field
- Digest apijson.Field
- DigestType apijson.Field
- KeyTag apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordGetResponseDSData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordGetResponseDSDataJSON) RawJSON() string {
- return r.raw
-}
-
-// Record type.
-type DNSRecordGetResponseDSType string
-
-const (
- DNSRecordGetResponseDSTypeDS DNSRecordGetResponseDSType = "DS"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordGetResponseDSMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordGetResponseDSMetaJSON `json:"-"`
-}
-
-// dnsRecordGetResponseDSMetaJSON contains the JSON metadata for the struct
-// [DNSRecordGetResponseDSMeta]
-type dnsRecordGetResponseDSMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordGetResponseDSMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordGetResponseDSMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordGetResponseDSTTLNumber].
-type DNSRecordGetResponseDSTTL interface {
- ImplementsDNSRecordGetResponseDsttl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordGetResponseDSTTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordGetResponseDSTTLNumber(0)),
- },
- )
-}
-
-type DNSRecordGetResponseDSTTLNumber float64
-
-const (
- DNSRecordGetResponseDSTTLNumber1 DNSRecordGetResponseDSTTLNumber = 1
-)
-
-type DNSRecordGetResponseHTTPS struct {
- // Components of a HTTPS record.
- Data DNSRecordGetResponseHTTPSData `json:"data,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordGetResponseHTTPSType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // Formatted HTTPS content. See 'data' to set HTTPS properties.
- Content string `json:"content"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordGetResponseHTTPSMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordGetResponseHTTPSTTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordGetResponseHTTPSJSON `json:"-"`
-}
-
-// dnsRecordGetResponseHTTPSJSON contains the JSON metadata for the struct
-// [DNSRecordGetResponseHTTPS]
-type dnsRecordGetResponseHTTPSJSON struct {
- Data apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- Content apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordGetResponseHTTPS) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordGetResponseHTTPSJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordGetResponseHTTPS) implementsDNSRecordGetResponse() {}
-
-// Components of a HTTPS record.
-type DNSRecordGetResponseHTTPSData struct {
- // priority.
- Priority float64 `json:"priority"`
- // target.
- Target string `json:"target"`
- // value.
- Value string `json:"value"`
- JSON dnsRecordGetResponseHTTPSDataJSON `json:"-"`
-}
-
-// dnsRecordGetResponseHTTPSDataJSON contains the JSON metadata for the struct
-// [DNSRecordGetResponseHTTPSData]
-type dnsRecordGetResponseHTTPSDataJSON struct {
- Priority apijson.Field
- Target apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordGetResponseHTTPSData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordGetResponseHTTPSDataJSON) RawJSON() string {
- return r.raw
-}
-
-// Record type.
-type DNSRecordGetResponseHTTPSType string
-
-const (
- DNSRecordGetResponseHTTPSTypeHTTPS DNSRecordGetResponseHTTPSType = "HTTPS"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordGetResponseHTTPSMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordGetResponseHTTPSMetaJSON `json:"-"`
-}
-
-// dnsRecordGetResponseHTTPSMetaJSON contains the JSON metadata for the struct
-// [DNSRecordGetResponseHTTPSMeta]
-type dnsRecordGetResponseHTTPSMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordGetResponseHTTPSMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordGetResponseHTTPSMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordGetResponseHTTPSTTLNumber].
-type DNSRecordGetResponseHTTPSTTL interface {
- ImplementsDNSRecordGetResponseHttpsttl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordGetResponseHTTPSTTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordGetResponseHTTPSTTLNumber(0)),
- },
- )
-}
-
-type DNSRecordGetResponseHTTPSTTLNumber float64
-
-const (
- DNSRecordGetResponseHTTPSTTLNumber1 DNSRecordGetResponseHTTPSTTLNumber = 1
-)
-
-type DNSRecordGetResponseLOC struct {
- // Components of a LOC record.
- Data DNSRecordGetResponseLOCData `json:"data,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordGetResponseLOCType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // Formatted LOC content. See 'data' to set LOC properties.
- Content string `json:"content"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordGetResponseLOCMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordGetResponseLOCTTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordGetResponseLOCJSON `json:"-"`
-}
-
-// dnsRecordGetResponseLOCJSON contains the JSON metadata for the struct
-// [DNSRecordGetResponseLOC]
-type dnsRecordGetResponseLOCJSON struct {
- Data apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- Content apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordGetResponseLOC) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordGetResponseLOCJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordGetResponseLOC) implementsDNSRecordGetResponse() {}
-
-// Components of a LOC record.
-type DNSRecordGetResponseLOCData struct {
- // Altitude of location in meters.
- Altitude float64 `json:"altitude"`
- // Degrees of latitude.
- LatDegrees float64 `json:"lat_degrees"`
- // Latitude direction.
- LatDirection DNSRecordGetResponseLOCDataLatDirection `json:"lat_direction"`
- // Minutes of latitude.
- LatMinutes float64 `json:"lat_minutes"`
- // Seconds of latitude.
- LatSeconds float64 `json:"lat_seconds"`
- // Degrees of longitude.
- LongDegrees float64 `json:"long_degrees"`
- // Longitude direction.
- LongDirection DNSRecordGetResponseLOCDataLongDirection `json:"long_direction"`
- // Minutes of longitude.
- LongMinutes float64 `json:"long_minutes"`
- // Seconds of longitude.
- LongSeconds float64 `json:"long_seconds"`
- // Horizontal precision of location.
- PrecisionHorz float64 `json:"precision_horz"`
- // Vertical precision of location.
- PrecisionVert float64 `json:"precision_vert"`
- // Size of location in meters.
- Size float64 `json:"size"`
- JSON dnsRecordGetResponseLOCDataJSON `json:"-"`
-}
-
-// dnsRecordGetResponseLOCDataJSON contains the JSON metadata for the struct
-// [DNSRecordGetResponseLOCData]
-type dnsRecordGetResponseLOCDataJSON struct {
- Altitude apijson.Field
- LatDegrees apijson.Field
- LatDirection apijson.Field
- LatMinutes apijson.Field
- LatSeconds apijson.Field
- LongDegrees apijson.Field
- LongDirection apijson.Field
- LongMinutes apijson.Field
- LongSeconds apijson.Field
- PrecisionHorz apijson.Field
- PrecisionVert apijson.Field
- Size apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordGetResponseLOCData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordGetResponseLOCDataJSON) RawJSON() string {
- return r.raw
-}
-
-// Latitude direction.
-type DNSRecordGetResponseLOCDataLatDirection string
-
-const (
- DNSRecordGetResponseLOCDataLatDirectionN DNSRecordGetResponseLOCDataLatDirection = "N"
- DNSRecordGetResponseLOCDataLatDirectionS DNSRecordGetResponseLOCDataLatDirection = "S"
-)
-
-// Longitude direction.
-type DNSRecordGetResponseLOCDataLongDirection string
-
-const (
- DNSRecordGetResponseLOCDataLongDirectionE DNSRecordGetResponseLOCDataLongDirection = "E"
- DNSRecordGetResponseLOCDataLongDirectionW DNSRecordGetResponseLOCDataLongDirection = "W"
-)
-
-// Record type.
-type DNSRecordGetResponseLOCType string
-
-const (
- DNSRecordGetResponseLOCTypeLOC DNSRecordGetResponseLOCType = "LOC"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordGetResponseLOCMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordGetResponseLOCMetaJSON `json:"-"`
-}
-
-// dnsRecordGetResponseLOCMetaJSON contains the JSON metadata for the struct
-// [DNSRecordGetResponseLOCMeta]
-type dnsRecordGetResponseLOCMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordGetResponseLOCMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordGetResponseLOCMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordGetResponseLOCTTLNumber].
-type DNSRecordGetResponseLOCTTL interface {
- ImplementsDNSRecordGetResponseLocttl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordGetResponseLOCTTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordGetResponseLOCTTLNumber(0)),
- },
- )
-}
-
-type DNSRecordGetResponseLOCTTLNumber float64
-
-const (
- DNSRecordGetResponseLOCTTLNumber1 DNSRecordGetResponseLOCTTLNumber = 1
-)
-
-type DNSRecordGetResponseMX struct {
- // A valid mail server hostname.
- Content string `json:"content,required" format:"hostname"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Required for MX, SRV and URI records; unused by other record types. Records with
- // lower priorities are preferred.
- Priority float64 `json:"priority,required"`
- // Record type.
- Type DNSRecordGetResponseMXType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordGetResponseMXMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordGetResponseMXTTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordGetResponseMXJSON `json:"-"`
-}
-
-// dnsRecordGetResponseMXJSON contains the JSON metadata for the struct
-// [DNSRecordGetResponseMX]
-type dnsRecordGetResponseMXJSON struct {
- Content apijson.Field
- Name apijson.Field
- Priority apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordGetResponseMX) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordGetResponseMXJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordGetResponseMX) implementsDNSRecordGetResponse() {}
-
-// Record type.
-type DNSRecordGetResponseMXType string
-
-const (
- DNSRecordGetResponseMXTypeMX DNSRecordGetResponseMXType = "MX"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordGetResponseMXMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordGetResponseMXMetaJSON `json:"-"`
-}
-
-// dnsRecordGetResponseMXMetaJSON contains the JSON metadata for the struct
-// [DNSRecordGetResponseMXMeta]
-type dnsRecordGetResponseMXMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordGetResponseMXMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordGetResponseMXMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordGetResponseMXTTLNumber].
-type DNSRecordGetResponseMXTTL interface {
- ImplementsDNSRecordGetResponseMxttl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordGetResponseMXTTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordGetResponseMXTTLNumber(0)),
- },
- )
-}
-
-type DNSRecordGetResponseMXTTLNumber float64
-
-const (
- DNSRecordGetResponseMXTTLNumber1 DNSRecordGetResponseMXTTLNumber = 1
-)
-
-type DNSRecordGetResponseNAPTR struct {
- // Components of a NAPTR record.
- Data DNSRecordGetResponseNAPTRData `json:"data,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordGetResponseNAPTRType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // Formatted NAPTR content. See 'data' to set NAPTR properties.
- Content string `json:"content"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordGetResponseNAPTRMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordGetResponseNAPTRTTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordGetResponseNAPTRJSON `json:"-"`
-}
-
-// dnsRecordGetResponseNAPTRJSON contains the JSON metadata for the struct
-// [DNSRecordGetResponseNAPTR]
-type dnsRecordGetResponseNAPTRJSON struct {
- Data apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- Content apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordGetResponseNAPTR) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordGetResponseNAPTRJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordGetResponseNAPTR) implementsDNSRecordGetResponse() {}
-
-// Components of a NAPTR record.
-type DNSRecordGetResponseNAPTRData struct {
- // Flags.
- Flags string `json:"flags"`
- // Order.
- Order float64 `json:"order"`
- // Preference.
- Preference float64 `json:"preference"`
- // Regex.
- Regex string `json:"regex"`
- // Replacement.
- Replacement string `json:"replacement"`
- // Service.
- Service string `json:"service"`
- JSON dnsRecordGetResponseNAPTRDataJSON `json:"-"`
-}
-
-// dnsRecordGetResponseNAPTRDataJSON contains the JSON metadata for the struct
-// [DNSRecordGetResponseNAPTRData]
-type dnsRecordGetResponseNAPTRDataJSON struct {
- Flags apijson.Field
- Order apijson.Field
- Preference apijson.Field
- Regex apijson.Field
- Replacement apijson.Field
- Service apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordGetResponseNAPTRData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordGetResponseNAPTRDataJSON) RawJSON() string {
- return r.raw
-}
-
-// Record type.
-type DNSRecordGetResponseNAPTRType string
-
-const (
- DNSRecordGetResponseNAPTRTypeNAPTR DNSRecordGetResponseNAPTRType = "NAPTR"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordGetResponseNAPTRMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordGetResponseNAPTRMetaJSON `json:"-"`
-}
-
-// dnsRecordGetResponseNAPTRMetaJSON contains the JSON metadata for the struct
-// [DNSRecordGetResponseNAPTRMeta]
-type dnsRecordGetResponseNAPTRMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordGetResponseNAPTRMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordGetResponseNAPTRMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordGetResponseNAPTRTTLNumber].
-type DNSRecordGetResponseNAPTRTTL interface {
- ImplementsDNSRecordGetResponseNaptrttl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordGetResponseNAPTRTTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordGetResponseNAPTRTTLNumber(0)),
- },
- )
-}
-
-type DNSRecordGetResponseNAPTRTTLNumber float64
-
-const (
- DNSRecordGetResponseNAPTRTTLNumber1 DNSRecordGetResponseNAPTRTTLNumber = 1
-)
-
-type DNSRecordGetResponseNS struct {
- // A valid name server host name.
- Content interface{} `json:"content,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordGetResponseNSType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordGetResponseNSMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordGetResponseNSTTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordGetResponseNSJSON `json:"-"`
-}
-
-// dnsRecordGetResponseNSJSON contains the JSON metadata for the struct
-// [DNSRecordGetResponseNS]
-type dnsRecordGetResponseNSJSON struct {
- Content apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordGetResponseNS) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordGetResponseNSJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordGetResponseNS) implementsDNSRecordGetResponse() {}
-
-// Record type.
-type DNSRecordGetResponseNSType string
-
-const (
- DNSRecordGetResponseNSTypeNS DNSRecordGetResponseNSType = "NS"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordGetResponseNSMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordGetResponseNSMetaJSON `json:"-"`
-}
-
-// dnsRecordGetResponseNSMetaJSON contains the JSON metadata for the struct
-// [DNSRecordGetResponseNSMeta]
-type dnsRecordGetResponseNSMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordGetResponseNSMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordGetResponseNSMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordGetResponseNSTTLNumber].
-type DNSRecordGetResponseNSTTL interface {
- ImplementsDNSRecordGetResponseNsttl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordGetResponseNSTTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordGetResponseNSTTLNumber(0)),
- },
- )
-}
-
-type DNSRecordGetResponseNSTTLNumber float64
-
-const (
- DNSRecordGetResponseNSTTLNumber1 DNSRecordGetResponseNSTTLNumber = 1
-)
-
-type DNSRecordGetResponsePTR struct {
- // Domain name pointing to the address.
- Content string `json:"content,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordGetResponsePTRType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordGetResponsePTRMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordGetResponsePTRTTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordGetResponsePTRJSON `json:"-"`
-}
-
-// dnsRecordGetResponsePTRJSON contains the JSON metadata for the struct
-// [DNSRecordGetResponsePTR]
-type dnsRecordGetResponsePTRJSON struct {
- Content apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordGetResponsePTR) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordGetResponsePTRJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordGetResponsePTR) implementsDNSRecordGetResponse() {}
-
-// Record type.
-type DNSRecordGetResponsePTRType string
-
-const (
- DNSRecordGetResponsePTRTypePTR DNSRecordGetResponsePTRType = "PTR"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordGetResponsePTRMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordGetResponsePTRMetaJSON `json:"-"`
-}
-
-// dnsRecordGetResponsePTRMetaJSON contains the JSON metadata for the struct
-// [DNSRecordGetResponsePTRMeta]
-type dnsRecordGetResponsePTRMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordGetResponsePTRMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordGetResponsePTRMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordGetResponsePTRTTLNumber].
-type DNSRecordGetResponsePTRTTL interface {
- ImplementsDNSRecordGetResponsePtrttl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordGetResponsePTRTTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordGetResponsePTRTTLNumber(0)),
- },
- )
-}
-
-type DNSRecordGetResponsePTRTTLNumber float64
-
-const (
- DNSRecordGetResponsePTRTTLNumber1 DNSRecordGetResponsePTRTTLNumber = 1
-)
-
-type DNSRecordGetResponseSmimea struct {
- // Components of a SMIMEA record.
- Data DNSRecordGetResponseSmimeaData `json:"data,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordGetResponseSmimeaType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // Formatted SMIMEA content. See 'data' to set SMIMEA properties.
- Content string `json:"content"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordGetResponseSmimeaMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordGetResponseSmimeaTTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordGetResponseSmimeaJSON `json:"-"`
-}
-
-// dnsRecordGetResponseSmimeaJSON contains the JSON metadata for the struct
-// [DNSRecordGetResponseSmimea]
-type dnsRecordGetResponseSmimeaJSON struct {
- Data apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- Content apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordGetResponseSmimea) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordGetResponseSmimeaJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordGetResponseSmimea) implementsDNSRecordGetResponse() {}
-
-// Components of a SMIMEA record.
-type DNSRecordGetResponseSmimeaData struct {
- // Certificate.
- Certificate string `json:"certificate"`
- // Matching Type.
- MatchingType float64 `json:"matching_type"`
- // Selector.
- Selector float64 `json:"selector"`
- // Usage.
- Usage float64 `json:"usage"`
- JSON dnsRecordGetResponseSmimeaDataJSON `json:"-"`
-}
-
-// dnsRecordGetResponseSmimeaDataJSON contains the JSON metadata for the struct
-// [DNSRecordGetResponseSmimeaData]
-type dnsRecordGetResponseSmimeaDataJSON struct {
- Certificate apijson.Field
- MatchingType apijson.Field
- Selector apijson.Field
- Usage apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordGetResponseSmimeaData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordGetResponseSmimeaDataJSON) RawJSON() string {
- return r.raw
-}
-
-// Record type.
-type DNSRecordGetResponseSmimeaType string
-
-const (
- DNSRecordGetResponseSmimeaTypeSmimea DNSRecordGetResponseSmimeaType = "SMIMEA"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordGetResponseSmimeaMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordGetResponseSmimeaMetaJSON `json:"-"`
-}
-
-// dnsRecordGetResponseSmimeaMetaJSON contains the JSON metadata for the struct
-// [DNSRecordGetResponseSmimeaMeta]
-type dnsRecordGetResponseSmimeaMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordGetResponseSmimeaMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordGetResponseSmimeaMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordGetResponseSmimeaTTLNumber].
-type DNSRecordGetResponseSmimeaTTL interface {
- ImplementsDNSRecordGetResponseSmimeaTTL()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordGetResponseSmimeaTTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordGetResponseSmimeaTTLNumber(0)),
- },
- )
-}
-
-type DNSRecordGetResponseSmimeaTTLNumber float64
-
-const (
- DNSRecordGetResponseSmimeaTTLNumber1 DNSRecordGetResponseSmimeaTTLNumber = 1
-)
-
-type DNSRecordGetResponseSRV struct {
- // Components of a SRV record.
- Data DNSRecordGetResponseSRVData `json:"data,required"`
- // DNS record name (or @ for the zone apex) in Punycode. For SRV records, the first
- // label is normally a service and the second a protocol name, each starting with
- // an underscore.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordGetResponseSRVType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // Priority, weight, port, and SRV target. See 'data' for setting the individual
- // component values.
- Content string `json:"content"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordGetResponseSRVMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordGetResponseSRVTTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordGetResponseSRVJSON `json:"-"`
-}
-
-// dnsRecordGetResponseSRVJSON contains the JSON metadata for the struct
-// [DNSRecordGetResponseSRV]
-type dnsRecordGetResponseSRVJSON struct {
- Data apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- Content apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordGetResponseSRV) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordGetResponseSRVJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordGetResponseSRV) implementsDNSRecordGetResponse() {}
-
-// Components of a SRV record.
-type DNSRecordGetResponseSRVData struct {
- // A valid hostname. Deprecated in favor of the regular 'name' outside the data
- // map. This data map field represents the remainder of the full 'name' after the
- // service and protocol.
- Name string `json:"name" format:"hostname"`
- // The port of the service.
- Port float64 `json:"port"`
- // Required for MX, SRV and URI records; unused by other record types. Records with
- // lower priorities are preferred.
- Priority float64 `json:"priority"`
- // A valid protocol, prefixed with an underscore. Deprecated in favor of the
- // regular 'name' outside the data map. This data map field normally represents the
- // second label of that 'name'.
- Proto string `json:"proto"`
- // A service type, prefixed with an underscore. Deprecated in favor of the regular
- // 'name' outside the data map. This data map field normally represents the first
- // label of that 'name'.
- Service string `json:"service"`
- // A valid hostname.
- Target string `json:"target" format:"hostname"`
- // The record weight.
- Weight float64 `json:"weight"`
- JSON dnsRecordGetResponseSRVDataJSON `json:"-"`
-}
-
-// dnsRecordGetResponseSRVDataJSON contains the JSON metadata for the struct
-// [DNSRecordGetResponseSRVData]
-type dnsRecordGetResponseSRVDataJSON struct {
- Name apijson.Field
- Port apijson.Field
- Priority apijson.Field
- Proto apijson.Field
- Service apijson.Field
- Target apijson.Field
- Weight apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordGetResponseSRVData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordGetResponseSRVDataJSON) RawJSON() string {
- return r.raw
-}
-
-// Record type.
-type DNSRecordGetResponseSRVType string
-
-const (
- DNSRecordGetResponseSRVTypeSRV DNSRecordGetResponseSRVType = "SRV"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordGetResponseSRVMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordGetResponseSRVMetaJSON `json:"-"`
-}
-
-// dnsRecordGetResponseSRVMetaJSON contains the JSON metadata for the struct
-// [DNSRecordGetResponseSRVMeta]
-type dnsRecordGetResponseSRVMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordGetResponseSRVMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordGetResponseSRVMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordGetResponseSRVTTLNumber].
-type DNSRecordGetResponseSRVTTL interface {
- ImplementsDNSRecordGetResponseSrvttl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordGetResponseSRVTTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordGetResponseSRVTTLNumber(0)),
- },
- )
-}
-
-type DNSRecordGetResponseSRVTTLNumber float64
-
-const (
- DNSRecordGetResponseSRVTTLNumber1 DNSRecordGetResponseSRVTTLNumber = 1
-)
-
-type DNSRecordGetResponseSSHFP struct {
- // Components of a SSHFP record.
- Data DNSRecordGetResponseSSHFPData `json:"data,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordGetResponseSSHFPType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // Formatted SSHFP content. See 'data' to set SSHFP properties.
- Content string `json:"content"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordGetResponseSSHFPMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordGetResponseSSHFPTTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordGetResponseSSHFPJSON `json:"-"`
-}
-
-// dnsRecordGetResponseSSHFPJSON contains the JSON metadata for the struct
-// [DNSRecordGetResponseSSHFP]
-type dnsRecordGetResponseSSHFPJSON struct {
- Data apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- Content apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordGetResponseSSHFP) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordGetResponseSSHFPJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordGetResponseSSHFP) implementsDNSRecordGetResponse() {}
-
-// Components of a SSHFP record.
-type DNSRecordGetResponseSSHFPData struct {
- // algorithm.
- Algorithm float64 `json:"algorithm"`
- // fingerprint.
- Fingerprint string `json:"fingerprint"`
- // type.
- Type float64 `json:"type"`
- JSON dnsRecordGetResponseSSHFPDataJSON `json:"-"`
-}
-
-// dnsRecordGetResponseSSHFPDataJSON contains the JSON metadata for the struct
-// [DNSRecordGetResponseSSHFPData]
-type dnsRecordGetResponseSSHFPDataJSON struct {
- Algorithm apijson.Field
- Fingerprint apijson.Field
- Type apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordGetResponseSSHFPData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordGetResponseSSHFPDataJSON) RawJSON() string {
- return r.raw
-}
-
-// Record type.
-type DNSRecordGetResponseSSHFPType string
-
-const (
- DNSRecordGetResponseSSHFPTypeSSHFP DNSRecordGetResponseSSHFPType = "SSHFP"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordGetResponseSSHFPMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordGetResponseSSHFPMetaJSON `json:"-"`
-}
-
-// dnsRecordGetResponseSSHFPMetaJSON contains the JSON metadata for the struct
-// [DNSRecordGetResponseSSHFPMeta]
-type dnsRecordGetResponseSSHFPMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordGetResponseSSHFPMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordGetResponseSSHFPMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordGetResponseSSHFPTTLNumber].
-type DNSRecordGetResponseSSHFPTTL interface {
- ImplementsDNSRecordGetResponseSshfpttl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordGetResponseSSHFPTTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordGetResponseSSHFPTTLNumber(0)),
- },
- )
-}
-
-type DNSRecordGetResponseSSHFPTTLNumber float64
-
-const (
- DNSRecordGetResponseSSHFPTTLNumber1 DNSRecordGetResponseSSHFPTTLNumber = 1
-)
-
-type DNSRecordGetResponseSVCB struct {
- // Components of a SVCB record.
- Data DNSRecordGetResponseSVCBData `json:"data,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordGetResponseSVCBType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // Formatted SVCB content. See 'data' to set SVCB properties.
- Content string `json:"content"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordGetResponseSVCBMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordGetResponseSVCBTTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordGetResponseSVCBJSON `json:"-"`
-}
-
-// dnsRecordGetResponseSVCBJSON contains the JSON metadata for the struct
-// [DNSRecordGetResponseSVCB]
-type dnsRecordGetResponseSVCBJSON struct {
- Data apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- Content apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordGetResponseSVCB) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordGetResponseSVCBJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordGetResponseSVCB) implementsDNSRecordGetResponse() {}
-
-// Components of a SVCB record.
-type DNSRecordGetResponseSVCBData struct {
- // priority.
- Priority float64 `json:"priority"`
- // target.
- Target string `json:"target"`
- // value.
- Value string `json:"value"`
- JSON dnsRecordGetResponseSVCBDataJSON `json:"-"`
-}
-
-// dnsRecordGetResponseSVCBDataJSON contains the JSON metadata for the struct
-// [DNSRecordGetResponseSVCBData]
-type dnsRecordGetResponseSVCBDataJSON struct {
- Priority apijson.Field
- Target apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordGetResponseSVCBData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordGetResponseSVCBDataJSON) RawJSON() string {
- return r.raw
-}
-
-// Record type.
-type DNSRecordGetResponseSVCBType string
-
-const (
- DNSRecordGetResponseSVCBTypeSVCB DNSRecordGetResponseSVCBType = "SVCB"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordGetResponseSVCBMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordGetResponseSVCBMetaJSON `json:"-"`
-}
-
-// dnsRecordGetResponseSVCBMetaJSON contains the JSON metadata for the struct
-// [DNSRecordGetResponseSVCBMeta]
-type dnsRecordGetResponseSVCBMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordGetResponseSVCBMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordGetResponseSVCBMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordGetResponseSVCBTTLNumber].
-type DNSRecordGetResponseSVCBTTL interface {
- ImplementsDNSRecordGetResponseSvcbttl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordGetResponseSVCBTTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordGetResponseSVCBTTLNumber(0)),
- },
- )
-}
-
-type DNSRecordGetResponseSVCBTTLNumber float64
-
-const (
- DNSRecordGetResponseSVCBTTLNumber1 DNSRecordGetResponseSVCBTTLNumber = 1
-)
-
-type DNSRecordGetResponseTLSA struct {
- // Components of a TLSA record.
- Data DNSRecordGetResponseTLSAData `json:"data,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordGetResponseTLSAType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // Formatted TLSA content. See 'data' to set TLSA properties.
- Content string `json:"content"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordGetResponseTLSAMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordGetResponseTLSATTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordGetResponseTLSAJSON `json:"-"`
-}
-
-// dnsRecordGetResponseTLSAJSON contains the JSON metadata for the struct
-// [DNSRecordGetResponseTLSA]
-type dnsRecordGetResponseTLSAJSON struct {
- Data apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- Content apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordGetResponseTLSA) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordGetResponseTLSAJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordGetResponseTLSA) implementsDNSRecordGetResponse() {}
-
-// Components of a TLSA record.
-type DNSRecordGetResponseTLSAData struct {
- // certificate.
- Certificate string `json:"certificate"`
- // Matching Type.
- MatchingType float64 `json:"matching_type"`
- // Selector.
- Selector float64 `json:"selector"`
- // Usage.
- Usage float64 `json:"usage"`
- JSON dnsRecordGetResponseTLSADataJSON `json:"-"`
-}
-
-// dnsRecordGetResponseTLSADataJSON contains the JSON metadata for the struct
-// [DNSRecordGetResponseTLSAData]
-type dnsRecordGetResponseTLSADataJSON struct {
- Certificate apijson.Field
- MatchingType apijson.Field
- Selector apijson.Field
- Usage apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordGetResponseTLSAData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordGetResponseTLSADataJSON) RawJSON() string {
- return r.raw
-}
-
-// Record type.
-type DNSRecordGetResponseTLSAType string
-
-const (
- DNSRecordGetResponseTLSATypeTLSA DNSRecordGetResponseTLSAType = "TLSA"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordGetResponseTLSAMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordGetResponseTLSAMetaJSON `json:"-"`
-}
-
-// dnsRecordGetResponseTLSAMetaJSON contains the JSON metadata for the struct
-// [DNSRecordGetResponseTLSAMeta]
-type dnsRecordGetResponseTLSAMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordGetResponseTLSAMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordGetResponseTLSAMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordGetResponseTLSATTLNumber].
-type DNSRecordGetResponseTLSATTL interface {
- ImplementsDNSRecordGetResponseTlsattl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordGetResponseTLSATTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordGetResponseTLSATTLNumber(0)),
- },
- )
-}
-
-type DNSRecordGetResponseTLSATTLNumber float64
-
-const (
- DNSRecordGetResponseTLSATTLNumber1 DNSRecordGetResponseTLSATTLNumber = 1
-)
-
-type DNSRecordGetResponseTXT struct {
- // Text content for the record.
- Content string `json:"content,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Record type.
- Type DNSRecordGetResponseTXTType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordGetResponseTXTMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordGetResponseTXTTTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordGetResponseTXTJSON `json:"-"`
-}
-
-// dnsRecordGetResponseTXTJSON contains the JSON metadata for the struct
-// [DNSRecordGetResponseTXT]
-type dnsRecordGetResponseTXTJSON struct {
- Content apijson.Field
- Name apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordGetResponseTXT) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordGetResponseTXTJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordGetResponseTXT) implementsDNSRecordGetResponse() {}
-
-// Record type.
-type DNSRecordGetResponseTXTType string
-
-const (
- DNSRecordGetResponseTXTTypeTXT DNSRecordGetResponseTXTType = "TXT"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordGetResponseTXTMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordGetResponseTXTMetaJSON `json:"-"`
-}
-
-// dnsRecordGetResponseTXTMetaJSON contains the JSON metadata for the struct
-// [DNSRecordGetResponseTXTMeta]
-type dnsRecordGetResponseTXTMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordGetResponseTXTMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordGetResponseTXTMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordGetResponseTXTTTLNumber].
-type DNSRecordGetResponseTXTTTL interface {
- ImplementsDNSRecordGetResponseTxtttl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordGetResponseTXTTTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordGetResponseTXTTTLNumber(0)),
- },
- )
-}
-
-type DNSRecordGetResponseTXTTTLNumber float64
-
-const (
- DNSRecordGetResponseTXTTTLNumber1 DNSRecordGetResponseTXTTTLNumber = 1
-)
-
-type DNSRecordGetResponseURI struct {
- // Components of a URI record.
- Data DNSRecordGetResponseURIData `json:"data,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name string `json:"name,required"`
- // Required for MX, SRV and URI records; unused by other record types. Records with
- // lower priorities are preferred.
- Priority float64 `json:"priority,required"`
- // Record type.
- Type DNSRecordGetResponseURIType `json:"type,required"`
- // Identifier
- ID string `json:"id"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment string `json:"comment"`
- // Formatted URI content. See 'data' to set URI properties.
- Content string `json:"content"`
- // When the record was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Whether this record can be modified/deleted (true means it's managed by
- // Cloudflare).
- Locked bool `json:"locked"`
- // Extra Cloudflare-specific information about the record.
- Meta DNSRecordGetResponseURIMeta `json:"meta"`
- // When the record was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Whether the record can be proxied by Cloudflare or not.
- Proxiable bool `json:"proxiable"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags []string `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL DNSRecordGetResponseURITTL `json:"ttl"`
- // Identifier
- ZoneID string `json:"zone_id"`
- // The domain of the record.
- ZoneName string `json:"zone_name" format:"hostname"`
- JSON dnsRecordGetResponseURIJSON `json:"-"`
-}
-
-// dnsRecordGetResponseURIJSON contains the JSON metadata for the struct
-// [DNSRecordGetResponseURI]
-type dnsRecordGetResponseURIJSON struct {
- Data apijson.Field
- Name apijson.Field
- Priority apijson.Field
- Type apijson.Field
- ID apijson.Field
- Comment apijson.Field
- Content apijson.Field
- CreatedOn apijson.Field
- Locked apijson.Field
- Meta apijson.Field
- ModifiedOn apijson.Field
- Proxiable apijson.Field
- Tags apijson.Field
- TTL apijson.Field
- ZoneID apijson.Field
- ZoneName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordGetResponseURI) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordGetResponseURIJSON) RawJSON() string {
- return r.raw
-}
-
-func (r DNSRecordGetResponseURI) implementsDNSRecordGetResponse() {}
-
-// Components of a URI record.
-type DNSRecordGetResponseURIData struct {
- // The record content.
- Content string `json:"content"`
- // The record weight.
- Weight float64 `json:"weight"`
- JSON dnsRecordGetResponseURIDataJSON `json:"-"`
-}
-
-// dnsRecordGetResponseURIDataJSON contains the JSON metadata for the struct
-// [DNSRecordGetResponseURIData]
-type dnsRecordGetResponseURIDataJSON struct {
- Content apijson.Field
- Weight apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordGetResponseURIData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordGetResponseURIDataJSON) RawJSON() string {
- return r.raw
-}
-
-// Record type.
-type DNSRecordGetResponseURIType string
-
-const (
- DNSRecordGetResponseURITypeURI DNSRecordGetResponseURIType = "URI"
-)
-
-// Extra Cloudflare-specific information about the record.
-type DNSRecordGetResponseURIMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded bool `json:"auto_added"`
- // Where the record originated from.
- Source string `json:"source"`
- JSON dnsRecordGetResponseURIMetaJSON `json:"-"`
-}
-
-// dnsRecordGetResponseURIMetaJSON contains the JSON metadata for the struct
-// [DNSRecordGetResponseURIMeta]
-type dnsRecordGetResponseURIMetaJSON struct {
- AutoAdded apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordGetResponseURIMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordGetResponseURIMetaJSON) RawJSON() string {
- return r.raw
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Union satisfied by [shared.UnionFloat] or [DNSRecordGetResponseURITTLNumber].
-type DNSRecordGetResponseURITTL interface {
- ImplementsDNSRecordGetResponseUrittl()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSRecordGetResponseURITTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(DNSRecordGetResponseURITTLNumber(0)),
- },
- )
-}
-
-type DNSRecordGetResponseURITTLNumber float64
-
-const (
- DNSRecordGetResponseURITTLNumber1 DNSRecordGetResponseURITTLNumber = 1
-)
-
-type DNSRecordImportResponse struct {
- // Number of DNS records added.
- RecsAdded float64 `json:"recs_added"`
- // Total number of DNS records parsed.
- TotalRecordsParsed float64 `json:"total_records_parsed"`
- JSON dnsRecordImportResponseJSON `json:"-"`
-}
-
-// dnsRecordImportResponseJSON contains the JSON metadata for the struct
-// [DNSRecordImportResponse]
-type dnsRecordImportResponseJSON struct {
- RecsAdded apijson.Field
- TotalRecordsParsed apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordImportResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordImportResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type DNSRecordScanResponse struct {
- // Number of DNS records added.
- RecsAdded float64 `json:"recs_added"`
- // Total number of DNS records parsed.
- TotalRecordsParsed float64 `json:"total_records_parsed"`
- JSON dnsRecordScanResponseJSON `json:"-"`
-}
-
-// dnsRecordScanResponseJSON contains the JSON metadata for the struct
-// [DNSRecordScanResponse]
-type dnsRecordScanResponseJSON struct {
- RecsAdded apijson.Field
- TotalRecordsParsed apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordScanResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordScanResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type DNSRecordNewParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name param.Field[string] `json:"name,required"`
- // Record type.
- Type param.Field[DNSRecordNewParamsType] `json:"type,required"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment param.Field[string] `json:"comment"`
- Data param.Field[DNSRecordNewParamsData] `json:"data"`
- Meta param.Field[DNSRecordNewParamsMeta] `json:"meta"`
- // Required for MX, SRV and URI records; unused by other record types. Records with
- // lower priorities are preferred.
- Priority param.Field[float64] `json:"priority"`
- // Whether the record is receiving the performance and security benefits of
- // Cloudflare.
- Proxied param.Field[bool] `json:"proxied"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags param.Field[[]string] `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL param.Field[DNSRecordNewParamsTTL] `json:"ttl"`
-}
-
-func (r DNSRecordNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Record type.
-type DNSRecordNewParamsType string
-
-const (
- DNSRecordNewParamsTypeURI DNSRecordNewParamsType = "URI"
-)
-
-type DNSRecordNewParamsData struct {
- // algorithm.
- Algorithm param.Field[float64] `json:"algorithm"`
- // Altitude of location in meters.
- Altitude param.Field[float64] `json:"altitude"`
- // certificate.
- Certificate param.Field[string] `json:"certificate"`
- // The record content.
- Content param.Field[string] `json:"content"`
- // Digest.
- Digest param.Field[string] `json:"digest"`
- // Digest Type.
- DigestType param.Field[float64] `json:"digest_type"`
- // fingerprint.
- Fingerprint param.Field[string] `json:"fingerprint"`
- // Flags.
- Flags param.Field[string] `json:"flags"`
- // Key Tag.
- KeyTag param.Field[float64] `json:"key_tag"`
- // Degrees of latitude.
- LatDegrees param.Field[float64] `json:"lat_degrees"`
- // Latitude direction.
- LatDirection param.Field[DNSRecordNewParamsDataLatDirection] `json:"lat_direction"`
- // Minutes of latitude.
- LatMinutes param.Field[float64] `json:"lat_minutes"`
- // Seconds of latitude.
- LatSeconds param.Field[float64] `json:"lat_seconds"`
- // Degrees of longitude.
- LongDegrees param.Field[float64] `json:"long_degrees"`
- // Longitude direction.
- LongDirection param.Field[DNSRecordNewParamsDataLongDirection] `json:"long_direction"`
- // Minutes of longitude.
- LongMinutes param.Field[float64] `json:"long_minutes"`
- // Seconds of longitude.
- LongSeconds param.Field[float64] `json:"long_seconds"`
- // Matching Type.
- MatchingType param.Field[float64] `json:"matching_type"`
- // A valid hostname. Deprecated in favor of the regular 'name' outside the data
- // map. This data map field represents the remainder of the full 'name' after the
- // service and protocol.
- Name param.Field[string] `json:"name" format:"hostname"`
- // Order.
- Order param.Field[float64] `json:"order"`
- // The port of the service.
- Port param.Field[float64] `json:"port"`
- // Horizontal precision of location.
- PrecisionHorz param.Field[float64] `json:"precision_horz"`
- // Vertical precision of location.
- PrecisionVert param.Field[float64] `json:"precision_vert"`
- // Preference.
- Preference param.Field[float64] `json:"preference"`
- // priority.
- Priority param.Field[float64] `json:"priority"`
- // A valid protocol, prefixed with an underscore. Deprecated in favor of the
- // regular 'name' outside the data map. This data map field normally represents the
- // second label of that 'name'.
- Proto param.Field[string] `json:"proto"`
- // Protocol.
- Protocol param.Field[float64] `json:"protocol"`
- // Public Key.
- PublicKey param.Field[string] `json:"public_key"`
- // Regex.
- Regex param.Field[string] `json:"regex"`
- // Replacement.
- Replacement param.Field[string] `json:"replacement"`
- // Selector.
- Selector param.Field[float64] `json:"selector"`
- // A service type, prefixed with an underscore. Deprecated in favor of the regular
- // 'name' outside the data map. This data map field normally represents the first
- // label of that 'name'.
- Service param.Field[string] `json:"service"`
- // Size of location in meters.
- Size param.Field[float64] `json:"size"`
- // Name of the property controlled by this record (e.g.: issue, issuewild, iodef).
- Tag param.Field[string] `json:"tag"`
- // target.
- Target param.Field[string] `json:"target"`
- // type.
- Type param.Field[float64] `json:"type"`
- // Usage.
- Usage param.Field[float64] `json:"usage"`
- // value.
- Value param.Field[string] `json:"value"`
- // The record weight.
- Weight param.Field[float64] `json:"weight"`
-}
-
-func (r DNSRecordNewParamsData) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Latitude direction.
-type DNSRecordNewParamsDataLatDirection string
-
-const (
- DNSRecordNewParamsDataLatDirectionN DNSRecordNewParamsDataLatDirection = "N"
- DNSRecordNewParamsDataLatDirectionS DNSRecordNewParamsDataLatDirection = "S"
-)
-
-// Longitude direction.
-type DNSRecordNewParamsDataLongDirection string
-
-const (
- DNSRecordNewParamsDataLongDirectionE DNSRecordNewParamsDataLongDirection = "E"
- DNSRecordNewParamsDataLongDirectionW DNSRecordNewParamsDataLongDirection = "W"
-)
-
-type DNSRecordNewParamsMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded param.Field[bool] `json:"auto_added"`
- // Where the record originated from.
- Source param.Field[string] `json:"source"`
-}
-
-func (r DNSRecordNewParamsMeta) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Satisfied by [shared.UnionFloat], [DNSRecordNewParamsTTLNumber].
-type DNSRecordNewParamsTTL interface {
- ImplementsDNSRecordNewParamsTTL()
-}
-
-type DNSRecordNewParamsTTLNumber float64
-
-const (
- DNSRecordNewParamsTTLNumber1 DNSRecordNewParamsTTLNumber = 1
-)
-
-type DNSRecordNewResponseEnvelope struct {
- Errors []DNSRecordNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []DNSRecordNewResponseEnvelopeMessages `json:"messages,required"`
- Result DNSRecordNewResponse `json:"result,required"`
- // Whether the API call was successful
- Success DNSRecordNewResponseEnvelopeSuccess `json:"success,required"`
- JSON dnsRecordNewResponseEnvelopeJSON `json:"-"`
-}
-
-// dnsRecordNewResponseEnvelopeJSON contains the JSON metadata for the struct
-// [DNSRecordNewResponseEnvelope]
-type dnsRecordNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type DNSRecordNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON dnsRecordNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// dnsRecordNewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
-// [DNSRecordNewResponseEnvelopeErrors]
-type dnsRecordNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type DNSRecordNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON dnsRecordNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// dnsRecordNewResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [DNSRecordNewResponseEnvelopeMessages]
-type dnsRecordNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type DNSRecordNewResponseEnvelopeSuccess bool
-
-const (
- DNSRecordNewResponseEnvelopeSuccessTrue DNSRecordNewResponseEnvelopeSuccess = true
-)
-
-type DNSRecordUpdateParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name param.Field[string] `json:"name,required"`
- // Record type.
- Type param.Field[DNSRecordUpdateParamsType] `json:"type,required"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment param.Field[string] `json:"comment"`
- Data param.Field[DNSRecordUpdateParamsData] `json:"data"`
- Meta param.Field[DNSRecordUpdateParamsMeta] `json:"meta"`
- // Required for MX, SRV and URI records; unused by other record types. Records with
- // lower priorities are preferred.
- Priority param.Field[float64] `json:"priority"`
- // Whether the record is receiving the performance and security benefits of
- // Cloudflare.
- Proxied param.Field[bool] `json:"proxied"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags param.Field[[]string] `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL param.Field[DNSRecordUpdateParamsTTL] `json:"ttl"`
-}
-
-func (r DNSRecordUpdateParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Record type.
-type DNSRecordUpdateParamsType string
-
-const (
- DNSRecordUpdateParamsTypeURI DNSRecordUpdateParamsType = "URI"
-)
-
-type DNSRecordUpdateParamsData struct {
- // algorithm.
- Algorithm param.Field[float64] `json:"algorithm"`
- // Altitude of location in meters.
- Altitude param.Field[float64] `json:"altitude"`
- // certificate.
- Certificate param.Field[string] `json:"certificate"`
- // The record content.
- Content param.Field[string] `json:"content"`
- // Digest.
- Digest param.Field[string] `json:"digest"`
- // Digest Type.
- DigestType param.Field[float64] `json:"digest_type"`
- // fingerprint.
- Fingerprint param.Field[string] `json:"fingerprint"`
- // Flags.
- Flags param.Field[string] `json:"flags"`
- // Key Tag.
- KeyTag param.Field[float64] `json:"key_tag"`
- // Degrees of latitude.
- LatDegrees param.Field[float64] `json:"lat_degrees"`
- // Latitude direction.
- LatDirection param.Field[DNSRecordUpdateParamsDataLatDirection] `json:"lat_direction"`
- // Minutes of latitude.
- LatMinutes param.Field[float64] `json:"lat_minutes"`
- // Seconds of latitude.
- LatSeconds param.Field[float64] `json:"lat_seconds"`
- // Degrees of longitude.
- LongDegrees param.Field[float64] `json:"long_degrees"`
- // Longitude direction.
- LongDirection param.Field[DNSRecordUpdateParamsDataLongDirection] `json:"long_direction"`
- // Minutes of longitude.
- LongMinutes param.Field[float64] `json:"long_minutes"`
- // Seconds of longitude.
- LongSeconds param.Field[float64] `json:"long_seconds"`
- // Matching Type.
- MatchingType param.Field[float64] `json:"matching_type"`
- // A valid hostname. Deprecated in favor of the regular 'name' outside the data
- // map. This data map field represents the remainder of the full 'name' after the
- // service and protocol.
- Name param.Field[string] `json:"name" format:"hostname"`
- // Order.
- Order param.Field[float64] `json:"order"`
- // The port of the service.
- Port param.Field[float64] `json:"port"`
- // Horizontal precision of location.
- PrecisionHorz param.Field[float64] `json:"precision_horz"`
- // Vertical precision of location.
- PrecisionVert param.Field[float64] `json:"precision_vert"`
- // Preference.
- Preference param.Field[float64] `json:"preference"`
- // priority.
- Priority param.Field[float64] `json:"priority"`
- // A valid protocol, prefixed with an underscore. Deprecated in favor of the
- // regular 'name' outside the data map. This data map field normally represents the
- // second label of that 'name'.
- Proto param.Field[string] `json:"proto"`
- // Protocol.
- Protocol param.Field[float64] `json:"protocol"`
- // Public Key.
- PublicKey param.Field[string] `json:"public_key"`
- // Regex.
- Regex param.Field[string] `json:"regex"`
- // Replacement.
- Replacement param.Field[string] `json:"replacement"`
- // Selector.
- Selector param.Field[float64] `json:"selector"`
- // A service type, prefixed with an underscore. Deprecated in favor of the regular
- // 'name' outside the data map. This data map field normally represents the first
- // label of that 'name'.
- Service param.Field[string] `json:"service"`
- // Size of location in meters.
- Size param.Field[float64] `json:"size"`
- // Name of the property controlled by this record (e.g.: issue, issuewild, iodef).
- Tag param.Field[string] `json:"tag"`
- // target.
- Target param.Field[string] `json:"target"`
- // type.
- Type param.Field[float64] `json:"type"`
- // Usage.
- Usage param.Field[float64] `json:"usage"`
- // value.
- Value param.Field[string] `json:"value"`
- // The record weight.
- Weight param.Field[float64] `json:"weight"`
-}
-
-func (r DNSRecordUpdateParamsData) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Latitude direction.
-type DNSRecordUpdateParamsDataLatDirection string
-
-const (
- DNSRecordUpdateParamsDataLatDirectionN DNSRecordUpdateParamsDataLatDirection = "N"
- DNSRecordUpdateParamsDataLatDirectionS DNSRecordUpdateParamsDataLatDirection = "S"
-)
-
-// Longitude direction.
-type DNSRecordUpdateParamsDataLongDirection string
-
-const (
- DNSRecordUpdateParamsDataLongDirectionE DNSRecordUpdateParamsDataLongDirection = "E"
- DNSRecordUpdateParamsDataLongDirectionW DNSRecordUpdateParamsDataLongDirection = "W"
-)
-
-type DNSRecordUpdateParamsMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded param.Field[bool] `json:"auto_added"`
- // Where the record originated from.
- Source param.Field[string] `json:"source"`
-}
-
-func (r DNSRecordUpdateParamsMeta) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Satisfied by [shared.UnionFloat], [DNSRecordUpdateParamsTTLNumber].
-type DNSRecordUpdateParamsTTL interface {
- ImplementsDNSRecordUpdateParamsTTL()
-}
-
-type DNSRecordUpdateParamsTTLNumber float64
-
-const (
- DNSRecordUpdateParamsTTLNumber1 DNSRecordUpdateParamsTTLNumber = 1
-)
-
-type DNSRecordUpdateResponseEnvelope struct {
- Errors []DNSRecordUpdateResponseEnvelopeErrors `json:"errors,required"`
- Messages []DNSRecordUpdateResponseEnvelopeMessages `json:"messages,required"`
- Result DNSRecordUpdateResponse `json:"result,required"`
- // Whether the API call was successful
- Success DNSRecordUpdateResponseEnvelopeSuccess `json:"success,required"`
- JSON dnsRecordUpdateResponseEnvelopeJSON `json:"-"`
-}
-
-// dnsRecordUpdateResponseEnvelopeJSON contains the JSON metadata for the struct
-// [DNSRecordUpdateResponseEnvelope]
-type dnsRecordUpdateResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordUpdateResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type DNSRecordUpdateResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON dnsRecordUpdateResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// dnsRecordUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [DNSRecordUpdateResponseEnvelopeErrors]
-type dnsRecordUpdateResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type DNSRecordUpdateResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON dnsRecordUpdateResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// dnsRecordUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [DNSRecordUpdateResponseEnvelopeMessages]
-type dnsRecordUpdateResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type DNSRecordUpdateResponseEnvelopeSuccess bool
-
-const (
- DNSRecordUpdateResponseEnvelopeSuccessTrue DNSRecordUpdateResponseEnvelopeSuccess = true
-)
-
-type DNSRecordListParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
- Comment param.Field[DNSRecordListParamsComment] `query:"comment"`
- // DNS record content.
- Content param.Field[string] `query:"content"`
- // Direction to order DNS records in.
- Direction param.Field[DNSRecordListParamsDirection] `query:"direction"`
- // Whether to match all search requirements or at least one (any). If set to `all`,
- // acts like a logical AND between filters. If set to `any`, acts like a logical OR
- // instead. Note that the interaction between tag filters is controlled by the
- // `tag-match` parameter instead.
- Match param.Field[DNSRecordListParamsMatch] `query:"match"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name param.Field[string] `query:"name"`
- // Field to order DNS records by.
- Order param.Field[DNSRecordListParamsOrder] `query:"order"`
- // Page number of paginated results.
- Page param.Field[float64] `query:"page"`
- // Number of DNS records per page.
- PerPage param.Field[float64] `query:"per_page"`
- // Whether the record is receiving the performance and security benefits of
- // Cloudflare.
- Proxied param.Field[bool] `query:"proxied"`
- // Allows searching in multiple properties of a DNS record simultaneously. This
- // parameter is intended for human users, not automation. Its exact behavior is
- // intentionally left unspecified and is subject to change in the future. This
- // parameter works independently of the `match` setting. For automated searches,
- // please use the other available parameters.
- Search param.Field[string] `query:"search"`
- Tag param.Field[DNSRecordListParamsTag] `query:"tag"`
- // Whether to match all tag search requirements or at least one (any). If set to
- // `all`, acts like a logical AND between tag filters. If set to `any`, acts like a
- // logical OR instead. Note that the regular `match` parameter is still used to
- // combine the resulting condition with other filters that aren't related to tags.
- TagMatch param.Field[DNSRecordListParamsTagMatch] `query:"tag_match"`
- // Record type.
- Type param.Field[DNSRecordListParamsType] `query:"type"`
-}
-
-// URLQuery serializes [DNSRecordListParams]'s query parameters as `url.Values`.
-func (r DNSRecordListParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type DNSRecordListParamsComment struct {
- // If this parameter is present, only records _without_ a comment are returned.
- Absent param.Field[string] `query:"absent"`
- // Substring of the DNS record comment. Comment filters are case-insensitive.
- Contains param.Field[string] `query:"contains"`
- // Suffix of the DNS record comment. Comment filters are case-insensitive.
- Endswith param.Field[string] `query:"endswith"`
- // Exact value of the DNS record comment. Comment filters are case-insensitive.
- Exact param.Field[string] `query:"exact"`
- // If this parameter is present, only records _with_ a comment are returned.
- Present param.Field[string] `query:"present"`
- // Prefix of the DNS record comment. Comment filters are case-insensitive.
- Startswith param.Field[string] `query:"startswith"`
-}
-
-// URLQuery serializes [DNSRecordListParamsComment]'s query parameters as
-// `url.Values`.
-func (r DNSRecordListParamsComment) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Direction to order DNS records in.
-type DNSRecordListParamsDirection string
-
-const (
- DNSRecordListParamsDirectionAsc DNSRecordListParamsDirection = "asc"
- DNSRecordListParamsDirectionDesc DNSRecordListParamsDirection = "desc"
-)
-
-// Whether to match all search requirements or at least one (any). If set to `all`,
-// acts like a logical AND between filters. If set to `any`, acts like a logical OR
-// instead. Note that the interaction between tag filters is controlled by the
-// `tag-match` parameter instead.
-type DNSRecordListParamsMatch string
-
-const (
- DNSRecordListParamsMatchAny DNSRecordListParamsMatch = "any"
- DNSRecordListParamsMatchAll DNSRecordListParamsMatch = "all"
-)
-
-// Field to order DNS records by.
-type DNSRecordListParamsOrder string
-
-const (
- DNSRecordListParamsOrderType DNSRecordListParamsOrder = "type"
- DNSRecordListParamsOrderName DNSRecordListParamsOrder = "name"
- DNSRecordListParamsOrderContent DNSRecordListParamsOrder = "content"
- DNSRecordListParamsOrderTTL DNSRecordListParamsOrder = "ttl"
- DNSRecordListParamsOrderProxied DNSRecordListParamsOrder = "proxied"
-)
-
-type DNSRecordListParamsTag struct {
- // Name of a tag which must _not_ be present on the DNS record. Tag filters are
- // case-insensitive.
- Absent param.Field[string] `query:"absent"`
- // A tag and value, of the form `:`. The API will only return
- // DNS records that have a tag named `` whose value contains
- // ``. Tag filters are case-insensitive.
- Contains param.Field[string] `query:"contains"`
- // A tag and value, of the form `:`. The API will only return
- // DNS records that have a tag named `` whose value ends with
- // ``. Tag filters are case-insensitive.
- Endswith param.Field[string] `query:"endswith"`
- // A tag and value, of the form `:`. The API will only return
- // DNS records that have a tag named `` whose value is ``. Tag
- // filters are case-insensitive.
- Exact param.Field[string] `query:"exact"`
- // Name of a tag which must be present on the DNS record. Tag filters are
- // case-insensitive.
- Present param.Field[string] `query:"present"`
- // A tag and value, of the form `:`. The API will only return
- // DNS records that have a tag named `` whose value starts with
- // ``. Tag filters are case-insensitive.
- Startswith param.Field[string] `query:"startswith"`
-}
-
-// URLQuery serializes [DNSRecordListParamsTag]'s query parameters as `url.Values`.
-func (r DNSRecordListParamsTag) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Whether to match all tag search requirements or at least one (any). If set to
-// `all`, acts like a logical AND between tag filters. If set to `any`, acts like a
-// logical OR instead. Note that the regular `match` parameter is still used to
-// combine the resulting condition with other filters that aren't related to tags.
-type DNSRecordListParamsTagMatch string
-
-const (
- DNSRecordListParamsTagMatchAny DNSRecordListParamsTagMatch = "any"
- DNSRecordListParamsTagMatchAll DNSRecordListParamsTagMatch = "all"
-)
-
-// Record type.
-type DNSRecordListParamsType string
-
-const (
- DNSRecordListParamsTypeA DNSRecordListParamsType = "A"
- DNSRecordListParamsTypeAAAA DNSRecordListParamsType = "AAAA"
- DNSRecordListParamsTypeCAA DNSRecordListParamsType = "CAA"
- DNSRecordListParamsTypeCert DNSRecordListParamsType = "CERT"
- DNSRecordListParamsTypeCNAME DNSRecordListParamsType = "CNAME"
- DNSRecordListParamsTypeDNSKEY DNSRecordListParamsType = "DNSKEY"
- DNSRecordListParamsTypeDS DNSRecordListParamsType = "DS"
- DNSRecordListParamsTypeHTTPS DNSRecordListParamsType = "HTTPS"
- DNSRecordListParamsTypeLOC DNSRecordListParamsType = "LOC"
- DNSRecordListParamsTypeMX DNSRecordListParamsType = "MX"
- DNSRecordListParamsTypeNAPTR DNSRecordListParamsType = "NAPTR"
- DNSRecordListParamsTypeNS DNSRecordListParamsType = "NS"
- DNSRecordListParamsTypePTR DNSRecordListParamsType = "PTR"
- DNSRecordListParamsTypeSmimea DNSRecordListParamsType = "SMIMEA"
- DNSRecordListParamsTypeSRV DNSRecordListParamsType = "SRV"
- DNSRecordListParamsTypeSSHFP DNSRecordListParamsType = "SSHFP"
- DNSRecordListParamsTypeSVCB DNSRecordListParamsType = "SVCB"
- DNSRecordListParamsTypeTLSA DNSRecordListParamsType = "TLSA"
- DNSRecordListParamsTypeTXT DNSRecordListParamsType = "TXT"
- DNSRecordListParamsTypeURI DNSRecordListParamsType = "URI"
-)
-
-type DNSRecordDeleteParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
-}
-
-type DNSRecordDeleteResponseEnvelope struct {
- Result DNSRecordDeleteResponse `json:"result"`
- JSON dnsRecordDeleteResponseEnvelopeJSON `json:"-"`
-}
-
-// dnsRecordDeleteResponseEnvelopeJSON contains the JSON metadata for the struct
-// [DNSRecordDeleteResponseEnvelope]
-type dnsRecordDeleteResponseEnvelopeJSON struct {
- Result apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordDeleteResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type DNSRecordEditParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
- // DNS record name (or @ for the zone apex) in Punycode.
- Name param.Field[string] `json:"name,required"`
- // Record type.
- Type param.Field[DNSRecordEditParamsType] `json:"type,required"`
- // Comments or notes about the DNS record. This field has no effect on DNS
- // responses.
- Comment param.Field[string] `json:"comment"`
- Data param.Field[DNSRecordEditParamsData] `json:"data"`
- Meta param.Field[DNSRecordEditParamsMeta] `json:"meta"`
- // Required for MX, SRV and URI records; unused by other record types. Records with
- // lower priorities are preferred.
- Priority param.Field[float64] `json:"priority"`
- // Whether the record is receiving the performance and security benefits of
- // Cloudflare.
- Proxied param.Field[bool] `json:"proxied"`
- // Custom tags for the DNS record. This field has no effect on DNS responses.
- Tags param.Field[[]string] `json:"tags"`
- // Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- // Value must be between 60 and 86400, with the minimum reduced to 30 for
- // Enterprise zones.
- TTL param.Field[DNSRecordEditParamsTTL] `json:"ttl"`
-}
-
-func (r DNSRecordEditParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Record type.
-type DNSRecordEditParamsType string
-
-const (
- DNSRecordEditParamsTypeURI DNSRecordEditParamsType = "URI"
-)
-
-type DNSRecordEditParamsData struct {
- // algorithm.
- Algorithm param.Field[float64] `json:"algorithm"`
- // Altitude of location in meters.
- Altitude param.Field[float64] `json:"altitude"`
- // certificate.
- Certificate param.Field[string] `json:"certificate"`
- // The record content.
- Content param.Field[string] `json:"content"`
- // Digest.
- Digest param.Field[string] `json:"digest"`
- // Digest Type.
- DigestType param.Field[float64] `json:"digest_type"`
- // fingerprint.
- Fingerprint param.Field[string] `json:"fingerprint"`
- // Flags.
- Flags param.Field[string] `json:"flags"`
- // Key Tag.
- KeyTag param.Field[float64] `json:"key_tag"`
- // Degrees of latitude.
- LatDegrees param.Field[float64] `json:"lat_degrees"`
- // Latitude direction.
- LatDirection param.Field[DNSRecordEditParamsDataLatDirection] `json:"lat_direction"`
- // Minutes of latitude.
- LatMinutes param.Field[float64] `json:"lat_minutes"`
- // Seconds of latitude.
- LatSeconds param.Field[float64] `json:"lat_seconds"`
- // Degrees of longitude.
- LongDegrees param.Field[float64] `json:"long_degrees"`
- // Longitude direction.
- LongDirection param.Field[DNSRecordEditParamsDataLongDirection] `json:"long_direction"`
- // Minutes of longitude.
- LongMinutes param.Field[float64] `json:"long_minutes"`
- // Seconds of longitude.
- LongSeconds param.Field[float64] `json:"long_seconds"`
- // Matching Type.
- MatchingType param.Field[float64] `json:"matching_type"`
- // A valid hostname. Deprecated in favor of the regular 'name' outside the data
- // map. This data map field represents the remainder of the full 'name' after the
- // service and protocol.
- Name param.Field[string] `json:"name" format:"hostname"`
- // Order.
- Order param.Field[float64] `json:"order"`
- // The port of the service.
- Port param.Field[float64] `json:"port"`
- // Horizontal precision of location.
- PrecisionHorz param.Field[float64] `json:"precision_horz"`
- // Vertical precision of location.
- PrecisionVert param.Field[float64] `json:"precision_vert"`
- // Preference.
- Preference param.Field[float64] `json:"preference"`
- // priority.
- Priority param.Field[float64] `json:"priority"`
- // A valid protocol, prefixed with an underscore. Deprecated in favor of the
- // regular 'name' outside the data map. This data map field normally represents the
- // second label of that 'name'.
- Proto param.Field[string] `json:"proto"`
- // Protocol.
- Protocol param.Field[float64] `json:"protocol"`
- // Public Key.
- PublicKey param.Field[string] `json:"public_key"`
- // Regex.
- Regex param.Field[string] `json:"regex"`
- // Replacement.
- Replacement param.Field[string] `json:"replacement"`
- // Selector.
- Selector param.Field[float64] `json:"selector"`
- // A service type, prefixed with an underscore. Deprecated in favor of the regular
- // 'name' outside the data map. This data map field normally represents the first
- // label of that 'name'.
- Service param.Field[string] `json:"service"`
- // Size of location in meters.
- Size param.Field[float64] `json:"size"`
- // Name of the property controlled by this record (e.g.: issue, issuewild, iodef).
- Tag param.Field[string] `json:"tag"`
- // target.
- Target param.Field[string] `json:"target"`
- // type.
- Type param.Field[float64] `json:"type"`
- // Usage.
- Usage param.Field[float64] `json:"usage"`
- // value.
- Value param.Field[string] `json:"value"`
- // The record weight.
- Weight param.Field[float64] `json:"weight"`
-}
-
-func (r DNSRecordEditParamsData) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Latitude direction.
-type DNSRecordEditParamsDataLatDirection string
-
-const (
- DNSRecordEditParamsDataLatDirectionN DNSRecordEditParamsDataLatDirection = "N"
- DNSRecordEditParamsDataLatDirectionS DNSRecordEditParamsDataLatDirection = "S"
-)
-
-// Longitude direction.
-type DNSRecordEditParamsDataLongDirection string
-
-const (
- DNSRecordEditParamsDataLongDirectionE DNSRecordEditParamsDataLongDirection = "E"
- DNSRecordEditParamsDataLongDirectionW DNSRecordEditParamsDataLongDirection = "W"
-)
-
-type DNSRecordEditParamsMeta struct {
- // Will exist if Cloudflare automatically added this DNS record during initial
- // setup.
- AutoAdded param.Field[bool] `json:"auto_added"`
- // Where the record originated from.
- Source param.Field[string] `json:"source"`
-}
-
-func (r DNSRecordEditParamsMeta) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
-// Value must be between 60 and 86400, with the minimum reduced to 30 for
-// Enterprise zones.
-//
-// Satisfied by [shared.UnionFloat], [DNSRecordEditParamsTTLNumber].
-type DNSRecordEditParamsTTL interface {
- ImplementsDNSRecordEditParamsTTL()
-}
-
-type DNSRecordEditParamsTTLNumber float64
-
-const (
- DNSRecordEditParamsTTLNumber1 DNSRecordEditParamsTTLNumber = 1
-)
-
-type DNSRecordEditResponseEnvelope struct {
- Errors []DNSRecordEditResponseEnvelopeErrors `json:"errors,required"`
- Messages []DNSRecordEditResponseEnvelopeMessages `json:"messages,required"`
- Result DNSRecordEditResponse `json:"result,required"`
- // Whether the API call was successful
- Success DNSRecordEditResponseEnvelopeSuccess `json:"success,required"`
- JSON dnsRecordEditResponseEnvelopeJSON `json:"-"`
-}
-
-// dnsRecordEditResponseEnvelopeJSON contains the JSON metadata for the struct
-// [DNSRecordEditResponseEnvelope]
-type dnsRecordEditResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordEditResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordEditResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type DNSRecordEditResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON dnsRecordEditResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// dnsRecordEditResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [DNSRecordEditResponseEnvelopeErrors]
-type dnsRecordEditResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordEditResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type DNSRecordEditResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON dnsRecordEditResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// dnsRecordEditResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [DNSRecordEditResponseEnvelopeMessages]
-type dnsRecordEditResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordEditResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type DNSRecordEditResponseEnvelopeSuccess bool
-
-const (
- DNSRecordEditResponseEnvelopeSuccessTrue DNSRecordEditResponseEnvelopeSuccess = true
-)
-
-type DNSRecordExportParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
-}
-
-type DNSRecordGetParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
-}
-
-type DNSRecordGetResponseEnvelope struct {
- Errors []DNSRecordGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []DNSRecordGetResponseEnvelopeMessages `json:"messages,required"`
- Result DNSRecordGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success DNSRecordGetResponseEnvelopeSuccess `json:"success,required"`
- JSON dnsRecordGetResponseEnvelopeJSON `json:"-"`
-}
-
-// dnsRecordGetResponseEnvelopeJSON contains the JSON metadata for the struct
-// [DNSRecordGetResponseEnvelope]
-type dnsRecordGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type DNSRecordGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON dnsRecordGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// dnsRecordGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
-// [DNSRecordGetResponseEnvelopeErrors]
-type dnsRecordGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type DNSRecordGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON dnsRecordGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// dnsRecordGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [DNSRecordGetResponseEnvelopeMessages]
-type dnsRecordGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type DNSRecordGetResponseEnvelopeSuccess bool
-
-const (
- DNSRecordGetResponseEnvelopeSuccessTrue DNSRecordGetResponseEnvelopeSuccess = true
-)
-
-type DNSRecordImportParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
- // BIND config to import.
- //
- // **Tip:** When using cURL, a file can be uploaded using
- // `--form 'file=@bind_config.txt'`.
- File param.Field[string] `json:"file,required"`
- // Whether or not proxiable records should receive the performance and security
- // benefits of Cloudflare.
- //
- // The value should be either `true` or `false`.
- Proxied param.Field[string] `json:"proxied"`
-}
-
-func (r DNSRecordImportParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type DNSRecordImportResponseEnvelope struct {
- Errors []DNSRecordImportResponseEnvelopeErrors `json:"errors,required"`
- Messages []DNSRecordImportResponseEnvelopeMessages `json:"messages,required"`
- Result DNSRecordImportResponse `json:"result,required"`
- // Whether the API call was successful
- Success DNSRecordImportResponseEnvelopeSuccess `json:"success,required"`
- Timing DNSRecordImportResponseEnvelopeTiming `json:"timing"`
- JSON dnsRecordImportResponseEnvelopeJSON `json:"-"`
-}
-
-// dnsRecordImportResponseEnvelopeJSON contains the JSON metadata for the struct
-// [DNSRecordImportResponseEnvelope]
-type dnsRecordImportResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- Timing apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordImportResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordImportResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type DNSRecordImportResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON dnsRecordImportResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// dnsRecordImportResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [DNSRecordImportResponseEnvelopeErrors]
-type dnsRecordImportResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordImportResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordImportResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type DNSRecordImportResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON dnsRecordImportResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// dnsRecordImportResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [DNSRecordImportResponseEnvelopeMessages]
-type dnsRecordImportResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordImportResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordImportResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type DNSRecordImportResponseEnvelopeSuccess bool
-
-const (
- DNSRecordImportResponseEnvelopeSuccessTrue DNSRecordImportResponseEnvelopeSuccess = true
-)
-
-type DNSRecordImportResponseEnvelopeTiming struct {
- // When the file parsing ended.
- EndTime time.Time `json:"end_time" format:"date-time"`
- // Processing time of the file in seconds.
- ProcessTime float64 `json:"process_time"`
- // When the file parsing started.
- StartTime time.Time `json:"start_time" format:"date-time"`
- JSON dnsRecordImportResponseEnvelopeTimingJSON `json:"-"`
-}
-
-// dnsRecordImportResponseEnvelopeTimingJSON contains the JSON metadata for the
-// struct [DNSRecordImportResponseEnvelopeTiming]
-type dnsRecordImportResponseEnvelopeTimingJSON struct {
- EndTime apijson.Field
- ProcessTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordImportResponseEnvelopeTiming) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordImportResponseEnvelopeTimingJSON) RawJSON() string {
- return r.raw
-}
-
-type DNSRecordScanParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
-}
-
-type DNSRecordScanResponseEnvelope struct {
- Errors []DNSRecordScanResponseEnvelopeErrors `json:"errors,required"`
- Messages []DNSRecordScanResponseEnvelopeMessages `json:"messages,required"`
- Result DNSRecordScanResponse `json:"result,required"`
- // Whether the API call was successful
- Success DNSRecordScanResponseEnvelopeSuccess `json:"success,required"`
- Timing DNSRecordScanResponseEnvelopeTiming `json:"timing"`
- JSON dnsRecordScanResponseEnvelopeJSON `json:"-"`
-}
-
-// dnsRecordScanResponseEnvelopeJSON contains the JSON metadata for the struct
-// [DNSRecordScanResponseEnvelope]
-type dnsRecordScanResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- Timing apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordScanResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordScanResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type DNSRecordScanResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON dnsRecordScanResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// dnsRecordScanResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [DNSRecordScanResponseEnvelopeErrors]
-type dnsRecordScanResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordScanResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordScanResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type DNSRecordScanResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON dnsRecordScanResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// dnsRecordScanResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [DNSRecordScanResponseEnvelopeMessages]
-type dnsRecordScanResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordScanResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordScanResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type DNSRecordScanResponseEnvelopeSuccess bool
-
-const (
- DNSRecordScanResponseEnvelopeSuccessTrue DNSRecordScanResponseEnvelopeSuccess = true
-)
-
-type DNSRecordScanResponseEnvelopeTiming struct {
- // When the file parsing ended.
- EndTime time.Time `json:"end_time" format:"date-time"`
- // Processing time of the file in seconds.
- ProcessTime float64 `json:"process_time"`
- // When the file parsing started.
- StartTime time.Time `json:"start_time" format:"date-time"`
- JSON dnsRecordScanResponseEnvelopeTimingJSON `json:"-"`
-}
-
-// dnsRecordScanResponseEnvelopeTimingJSON contains the JSON metadata for the
-// struct [DNSRecordScanResponseEnvelopeTiming]
-type dnsRecordScanResponseEnvelopeTimingJSON struct {
- EndTime apijson.Field
- ProcessTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSRecordScanResponseEnvelopeTiming) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r dnsRecordScanResponseEnvelopeTimingJSON) RawJSON() string {
- return r.raw
-}
diff --git a/dnsrecord_test.go b/dnsrecord_test.go
deleted file mode 100644
index 7ab99df15e6..00000000000
--- a/dnsrecord_test.go
+++ /dev/null
@@ -1,450 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestDNSRecordNewWithOptionalParams(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"),
- )
- _, err := client.DNS.Records.New(context.TODO(), cloudflare.DNSRecordNewParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Name: cloudflare.F("example.com"),
- Type: cloudflare.F(cloudflare.DNSRecordNewParamsTypeURI),
- Comment: cloudflare.F("Domain verification record"),
- Data: cloudflare.F(cloudflare.DNSRecordNewParamsData{
- Flags: cloudflare.F("string"),
- Tag: cloudflare.F("issue"),
- Value: cloudflare.F("alpn=\"h3,h2\" ipv4hint=\"127.0.0.1\" ipv6hint=\"::1\""),
- Algorithm: cloudflare.F(2.000000),
- Certificate: cloudflare.F("string"),
- KeyTag: cloudflare.F(1.000000),
- Type: cloudflare.F(1.000000),
- Protocol: cloudflare.F(3.000000),
- PublicKey: cloudflare.F("string"),
- Digest: cloudflare.F("string"),
- DigestType: cloudflare.F(1.000000),
- Priority: cloudflare.F(1.000000),
- Target: cloudflare.F("."),
- Altitude: cloudflare.F(0.000000),
- LatDegrees: cloudflare.F(37.000000),
- LatDirection: cloudflare.F(cloudflare.DNSRecordNewParamsDataLatDirectionN),
- LatMinutes: cloudflare.F(46.000000),
- LatSeconds: cloudflare.F(46.000000),
- LongDegrees: cloudflare.F(122.000000),
- LongDirection: cloudflare.F(cloudflare.DNSRecordNewParamsDataLongDirectionW),
- LongMinutes: cloudflare.F(23.000000),
- LongSeconds: cloudflare.F(35.000000),
- PrecisionHorz: cloudflare.F(0.000000),
- PrecisionVert: cloudflare.F(0.000000),
- Size: cloudflare.F(100.000000),
- Order: cloudflare.F(100.000000),
- Preference: cloudflare.F(10.000000),
- Regex: cloudflare.F("string"),
- Replacement: cloudflare.F("string"),
- Service: cloudflare.F("_sip"),
- MatchingType: cloudflare.F(1.000000),
- Selector: cloudflare.F(0.000000),
- Usage: cloudflare.F(0.000000),
- Name: cloudflare.F("example.com"),
- Port: cloudflare.F(8806.000000),
- Proto: cloudflare.F("_tcp"),
- Weight: cloudflare.F(20.000000),
- Fingerprint: cloudflare.F("string"),
- Content: cloudflare.F("http://example.com/example.html"),
- }),
- Meta: cloudflare.F(cloudflare.DNSRecordNewParamsMeta{
- AutoAdded: cloudflare.F(true),
- Source: cloudflare.F("primary"),
- }),
- Priority: cloudflare.F(10.000000),
- Proxied: cloudflare.F(false),
- Tags: cloudflare.F([]string{"owner:dns-team", "owner:dns-team", "owner:dns-team"}),
- TTL: cloudflare.F[cloudflare.DNSRecordNewParamsTTL](shared.UnionFloat(3600.000000)),
- })
- 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())
- }
-}
-
-func TestDNSRecordUpdateWithOptionalParams(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"),
- )
- _, err := client.DNS.Records.Update(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.DNSRecordUpdateParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Name: cloudflare.F("example.com"),
- Type: cloudflare.F(cloudflare.DNSRecordUpdateParamsTypeURI),
- Comment: cloudflare.F("Domain verification record"),
- Data: cloudflare.F(cloudflare.DNSRecordUpdateParamsData{
- Flags: cloudflare.F("string"),
- Tag: cloudflare.F("issue"),
- Value: cloudflare.F("alpn=\"h3,h2\" ipv4hint=\"127.0.0.1\" ipv6hint=\"::1\""),
- Algorithm: cloudflare.F(2.000000),
- Certificate: cloudflare.F("string"),
- KeyTag: cloudflare.F(1.000000),
- Type: cloudflare.F(1.000000),
- Protocol: cloudflare.F(3.000000),
- PublicKey: cloudflare.F("string"),
- Digest: cloudflare.F("string"),
- DigestType: cloudflare.F(1.000000),
- Priority: cloudflare.F(1.000000),
- Target: cloudflare.F("."),
- Altitude: cloudflare.F(0.000000),
- LatDegrees: cloudflare.F(37.000000),
- LatDirection: cloudflare.F(cloudflare.DNSRecordUpdateParamsDataLatDirectionN),
- LatMinutes: cloudflare.F(46.000000),
- LatSeconds: cloudflare.F(46.000000),
- LongDegrees: cloudflare.F(122.000000),
- LongDirection: cloudflare.F(cloudflare.DNSRecordUpdateParamsDataLongDirectionW),
- LongMinutes: cloudflare.F(23.000000),
- LongSeconds: cloudflare.F(35.000000),
- PrecisionHorz: cloudflare.F(0.000000),
- PrecisionVert: cloudflare.F(0.000000),
- Size: cloudflare.F(100.000000),
- Order: cloudflare.F(100.000000),
- Preference: cloudflare.F(10.000000),
- Regex: cloudflare.F("string"),
- Replacement: cloudflare.F("string"),
- Service: cloudflare.F("_sip"),
- MatchingType: cloudflare.F(1.000000),
- Selector: cloudflare.F(0.000000),
- Usage: cloudflare.F(0.000000),
- Name: cloudflare.F("example.com"),
- Port: cloudflare.F(8806.000000),
- Proto: cloudflare.F("_tcp"),
- Weight: cloudflare.F(20.000000),
- Fingerprint: cloudflare.F("string"),
- Content: cloudflare.F("http://example.com/example.html"),
- }),
- Meta: cloudflare.F(cloudflare.DNSRecordUpdateParamsMeta{
- AutoAdded: cloudflare.F(true),
- Source: cloudflare.F("primary"),
- }),
- Priority: cloudflare.F(10.000000),
- Proxied: cloudflare.F(false),
- Tags: cloudflare.F([]string{"owner:dns-team", "owner:dns-team", "owner:dns-team"}),
- TTL: cloudflare.F[cloudflare.DNSRecordUpdateParamsTTL](shared.UnionFloat(3600.000000)),
- },
- )
- 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())
- }
-}
-
-func TestDNSRecordListWithOptionalParams(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"),
- )
- _, err := client.DNS.Records.List(context.TODO(), cloudflare.DNSRecordListParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Comment: cloudflare.F(cloudflare.DNSRecordListParamsComment{
- Present: cloudflare.F("string"),
- Absent: cloudflare.F("string"),
- Exact: cloudflare.F("Hello, world"),
- Contains: cloudflare.F("ello, worl"),
- Startswith: cloudflare.F("Hello, w"),
- Endswith: cloudflare.F("o, world"),
- }),
- Content: cloudflare.F("127.0.0.1"),
- Direction: cloudflare.F(cloudflare.DNSRecordListParamsDirectionAsc),
- Match: cloudflare.F(cloudflare.DNSRecordListParamsMatchAny),
- Name: cloudflare.F("example.com"),
- Order: cloudflare.F(cloudflare.DNSRecordListParamsOrderType),
- Page: cloudflare.F(1.000000),
- PerPage: cloudflare.F(5.000000),
- Proxied: cloudflare.F(false),
- Search: cloudflare.F("www.cloudflare.com"),
- Tag: cloudflare.F(cloudflare.DNSRecordListParamsTag{
- Present: cloudflare.F("important"),
- Absent: cloudflare.F("important"),
- Exact: cloudflare.F("greeting:Hello, world"),
- Contains: cloudflare.F("greeting:ello, worl"),
- Startswith: cloudflare.F("greeting:Hello, w"),
- Endswith: cloudflare.F("greeting:o, world"),
- }),
- TagMatch: cloudflare.F(cloudflare.DNSRecordListParamsTagMatchAny),
- Type: cloudflare.F(cloudflare.DNSRecordListParamsTypeA),
- })
- 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())
- }
-}
-
-func TestDNSRecordDelete(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"),
- )
- _, err := client.DNS.Records.Delete(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.DNSRecordDeleteParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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())
- }
-}
-
-func TestDNSRecordEditWithOptionalParams(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"),
- )
- _, err := client.DNS.Records.Edit(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.DNSRecordEditParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Name: cloudflare.F("example.com"),
- Type: cloudflare.F(cloudflare.DNSRecordEditParamsTypeURI),
- Comment: cloudflare.F("Domain verification record"),
- Data: cloudflare.F(cloudflare.DNSRecordEditParamsData{
- Flags: cloudflare.F("string"),
- Tag: cloudflare.F("issue"),
- Value: cloudflare.F("alpn=\"h3,h2\" ipv4hint=\"127.0.0.1\" ipv6hint=\"::1\""),
- Algorithm: cloudflare.F(2.000000),
- Certificate: cloudflare.F("string"),
- KeyTag: cloudflare.F(1.000000),
- Type: cloudflare.F(1.000000),
- Protocol: cloudflare.F(3.000000),
- PublicKey: cloudflare.F("string"),
- Digest: cloudflare.F("string"),
- DigestType: cloudflare.F(1.000000),
- Priority: cloudflare.F(1.000000),
- Target: cloudflare.F("."),
- Altitude: cloudflare.F(0.000000),
- LatDegrees: cloudflare.F(37.000000),
- LatDirection: cloudflare.F(cloudflare.DNSRecordEditParamsDataLatDirectionN),
- LatMinutes: cloudflare.F(46.000000),
- LatSeconds: cloudflare.F(46.000000),
- LongDegrees: cloudflare.F(122.000000),
- LongDirection: cloudflare.F(cloudflare.DNSRecordEditParamsDataLongDirectionW),
- LongMinutes: cloudflare.F(23.000000),
- LongSeconds: cloudflare.F(35.000000),
- PrecisionHorz: cloudflare.F(0.000000),
- PrecisionVert: cloudflare.F(0.000000),
- Size: cloudflare.F(100.000000),
- Order: cloudflare.F(100.000000),
- Preference: cloudflare.F(10.000000),
- Regex: cloudflare.F("string"),
- Replacement: cloudflare.F("string"),
- Service: cloudflare.F("_sip"),
- MatchingType: cloudflare.F(1.000000),
- Selector: cloudflare.F(0.000000),
- Usage: cloudflare.F(0.000000),
- Name: cloudflare.F("example.com"),
- Port: cloudflare.F(8806.000000),
- Proto: cloudflare.F("_tcp"),
- Weight: cloudflare.F(20.000000),
- Fingerprint: cloudflare.F("string"),
- Content: cloudflare.F("http://example.com/example.html"),
- }),
- Meta: cloudflare.F(cloudflare.DNSRecordEditParamsMeta{
- AutoAdded: cloudflare.F(true),
- Source: cloudflare.F("primary"),
- }),
- Priority: cloudflare.F(10.000000),
- Proxied: cloudflare.F(false),
- Tags: cloudflare.F([]string{"owner:dns-team", "owner:dns-team", "owner:dns-team"}),
- TTL: cloudflare.F[cloudflare.DNSRecordEditParamsTTL](shared.UnionFloat(3600.000000)),
- },
- )
- 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())
- }
-}
-
-func TestDNSRecordExport(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"),
- )
- _, err := client.DNS.Records.Export(context.TODO(), cloudflare.DNSRecordExportParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- })
- 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())
- }
-}
-
-func TestDNSRecordGet(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"),
- )
- _, err := client.DNS.Records.Get(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.DNSRecordGetParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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())
- }
-}
-
-func TestDNSRecordImportWithOptionalParams(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"),
- )
- _, err := client.DNS.Records.Import(context.TODO(), cloudflare.DNSRecordImportParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- File: cloudflare.F("www.example.com. 300 IN A 127.0.0.1"),
- Proxied: cloudflare.F("true"),
- })
- 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())
- }
-}
-
-func TestDNSRecordScan(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"),
- )
- _, err := client.DNS.Records.Scan(context.TODO(), cloudflare.DNSRecordScanParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- })
- 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/dnssec/aliases.go b/dnssec/aliases.go
new file mode 100644
index 00000000000..034880d63ae
--- /dev/null
+++ b/dnssec/aliases.go
@@ -0,0 +1,9 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package dnssec
+
+import (
+ "github.com/cloudflare/cloudflare-go/internal/apierror"
+)
+
+type Error = apierror.Error
diff --git a/dnssec.go b/dnssec/dnssec.go
similarity index 76%
rename from dnssec.go
rename to dnssec/dnssec.go
index 57e9b6f7bff..0c9bd92064a 100644
--- a/dnssec.go
+++ b/dnssec/dnssec.go
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package cloudflare
+package dnssec
import (
"context"
@@ -48,7 +48,7 @@ func (r *DNSSECService) Delete(ctx context.Context, body DNSSECDeleteParams, opt
}
// Enable or disable DNSSEC.
-func (r *DNSSECService) Edit(ctx context.Context, params DNSSECEditParams, opts ...option.RequestOption) (res *DNSSECEditResponse, err error) {
+func (r *DNSSECService) Edit(ctx context.Context, params DNSSECEditParams, opts ...option.RequestOption) (res *DNSSECDNSSEC, err error) {
opts = append(r.Options[:], opts...)
var env DNSSECEditResponseEnvelope
path := fmt.Sprintf("zones/%s/dnssec", params.ZoneID)
@@ -61,7 +61,7 @@ func (r *DNSSECService) Edit(ctx context.Context, params DNSSECEditParams, opts
}
// Details about DNSSEC status and configuration.
-func (r *DNSSECService) Get(ctx context.Context, query DNSSECGetParams, opts ...option.RequestOption) (res *DNSSECGetResponse, err error) {
+func (r *DNSSECService) Get(ctx context.Context, query DNSSECGetParams, opts ...option.RequestOption) (res *DNSSECDNSSEC, err error) {
opts = append(r.Options[:], opts...)
var env DNSSECGetResponseEnvelope
path := fmt.Sprintf("zones/%s/dnssec", query.ZoneID)
@@ -73,23 +73,7 @@ func (r *DNSSECService) Get(ctx context.Context, query DNSSECGetParams, opts ...
return
}
-// Union satisfied by [DNSSECDeleteResponseUnknown] or [shared.UnionString].
-type DNSSECDeleteResponse interface {
- ImplementsDNSSECDeleteResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*DNSSECDeleteResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-type DNSSECEditResponse struct {
+type DNSSECDNSSEC struct {
// Algorithm key code.
Algorithm string `json:"algorithm,nullable"`
// Digest hash.
@@ -128,13 +112,12 @@ type DNSSECEditResponse struct {
// Public key for DS record.
PublicKey string `json:"public_key,nullable"`
// Status of DNSSEC, based on user-desired state and presence of necessary records.
- Status DNSSECEditResponseStatus `json:"status"`
- JSON dnssecEditResponseJSON `json:"-"`
+ Status DNSSECDNSSECStatus `json:"status"`
+ JSON dnssecdnssecJSON `json:"-"`
}
-// dnssecEditResponseJSON contains the JSON metadata for the struct
-// [DNSSECEditResponse]
-type dnssecEditResponseJSON struct {
+// dnssecdnssecJSON contains the JSON metadata for the struct [DNSSECDNSSEC]
+type dnssecdnssecJSON struct {
Algorithm apijson.Field
Digest apijson.Field
DigestAlgorithm apijson.Field
@@ -152,107 +135,41 @@ type dnssecEditResponseJSON struct {
ExtraFields map[string]apijson.Field
}
-func (r *DNSSECEditResponse) UnmarshalJSON(data []byte) (err error) {
+func (r *DNSSECDNSSEC) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
-func (r dnssecEditResponseJSON) RawJSON() string {
+func (r dnssecdnssecJSON) RawJSON() string {
return r.raw
}
// Status of DNSSEC, based on user-desired state and presence of necessary records.
-type DNSSECEditResponseStatus string
+type DNSSECDNSSECStatus string
const (
- DNSSECEditResponseStatusActive DNSSECEditResponseStatus = "active"
- DNSSECEditResponseStatusPending DNSSECEditResponseStatus = "pending"
- DNSSECEditResponseStatusDisabled DNSSECEditResponseStatus = "disabled"
- DNSSECEditResponseStatusPendingDisabled DNSSECEditResponseStatus = "pending-disabled"
- DNSSECEditResponseStatusError DNSSECEditResponseStatus = "error"
+ DNSSECDNSSECStatusActive DNSSECDNSSECStatus = "active"
+ DNSSECDNSSECStatusPending DNSSECDNSSECStatus = "pending"
+ DNSSECDNSSECStatusDisabled DNSSECDNSSECStatus = "disabled"
+ DNSSECDNSSECStatusPendingDisabled DNSSECDNSSECStatus = "pending-disabled"
+ DNSSECDNSSECStatusError DNSSECDNSSECStatus = "error"
)
-type DNSSECGetResponse struct {
- // Algorithm key code.
- Algorithm string `json:"algorithm,nullable"`
- // Digest hash.
- Digest string `json:"digest,nullable"`
- // Type of digest algorithm.
- DigestAlgorithm string `json:"digest_algorithm,nullable"`
- // Coded type for digest algorithm.
- DigestType string `json:"digest_type,nullable"`
- // If true, multi-signer DNSSEC is enabled on the zone, allowing multiple providers
- // to serve a DNSSEC-signed zone at the same time. This is required for DNSKEY
- // records (except those automatically generated by Cloudflare) to be added to the
- // zone.
- //
- // See
- // [Multi-signer DNSSEC](https://developers.cloudflare.com/dns/dnssec/multi-signer-dnssec/)
- // for details.
- DNSSECMultiSigner bool `json:"dnssec_multi_signer"`
- // If true, allows Cloudflare to transfer in a DNSSEC-signed zone including
- // signatures from an external provider, without requiring Cloudflare to sign any
- // records on the fly.
- //
- // Note that this feature has some limitations. See
- // [Cloudflare as Secondary](https://developers.cloudflare.com/dns/zone-setups/zone-transfers/cloudflare-as-secondary/setup/#dnssec)
- // for details.
- DNSSECPresigned bool `json:"dnssec_presigned"`
- // Full DS record.
- DS string `json:"ds,nullable"`
- // Flag for DNSSEC record.
- Flags float64 `json:"flags,nullable"`
- // Code for key tag.
- KeyTag float64 `json:"key_tag,nullable"`
- // Algorithm key type.
- KeyType string `json:"key_type,nullable"`
- // When DNSSEC was last modified.
- ModifiedOn time.Time `json:"modified_on,nullable" format:"date-time"`
- // Public key for DS record.
- PublicKey string `json:"public_key,nullable"`
- // Status of DNSSEC, based on user-desired state and presence of necessary records.
- Status DNSSECGetResponseStatus `json:"status"`
- JSON dnssecGetResponseJSON `json:"-"`
-}
-
-// dnssecGetResponseJSON contains the JSON metadata for the struct
-// [DNSSECGetResponse]
-type dnssecGetResponseJSON struct {
- Algorithm apijson.Field
- Digest apijson.Field
- DigestAlgorithm apijson.Field
- DigestType apijson.Field
- DNSSECMultiSigner apijson.Field
- DNSSECPresigned apijson.Field
- DS apijson.Field
- Flags apijson.Field
- KeyTag apijson.Field
- KeyType apijson.Field
- ModifiedOn apijson.Field
- PublicKey apijson.Field
- Status apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DNSSECGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
+// Union satisfied by [dnssec.DNSSECDeleteResponseUnknown] or [shared.UnionString].
+type DNSSECDeleteResponse interface {
+ ImplementsDNSSECDNSSECDeleteResponse()
}
-func (r dnssecGetResponseJSON) RawJSON() string {
- return r.raw
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*DNSSECDeleteResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
}
-// Status of DNSSEC, based on user-desired state and presence of necessary records.
-type DNSSECGetResponseStatus string
-
-const (
- DNSSECGetResponseStatusActive DNSSECGetResponseStatus = "active"
- DNSSECGetResponseStatusPending DNSSECGetResponseStatus = "pending"
- DNSSECGetResponseStatusDisabled DNSSECGetResponseStatus = "disabled"
- DNSSECGetResponseStatusPendingDisabled DNSSECGetResponseStatus = "pending-disabled"
- DNSSECGetResponseStatusError DNSSECGetResponseStatus = "error"
-)
-
type DNSSECDeleteParams struct {
// Identifier
ZoneID param.Field[string] `path:"zone_id,required"`
@@ -378,7 +295,7 @@ const (
type DNSSECEditResponseEnvelope struct {
Errors []DNSSECEditResponseEnvelopeErrors `json:"errors,required"`
Messages []DNSSECEditResponseEnvelopeMessages `json:"messages,required"`
- Result DNSSECEditResponse `json:"result,required"`
+ Result DNSSECDNSSEC `json:"result,required"`
// Whether the API call was successful
Success DNSSECEditResponseEnvelopeSuccess `json:"success,required"`
JSON dnssecEditResponseEnvelopeJSON `json:"-"`
@@ -464,7 +381,7 @@ type DNSSECGetParams struct {
type DNSSECGetResponseEnvelope struct {
Errors []DNSSECGetResponseEnvelopeErrors `json:"errors,required"`
Messages []DNSSECGetResponseEnvelopeMessages `json:"messages,required"`
- Result DNSSECGetResponse `json:"result,required"`
+ Result DNSSECDNSSEC `json:"result,required"`
// Whether the API call was successful
Success DNSSECGetResponseEnvelopeSuccess `json:"success,required"`
JSON dnssecGetResponseEnvelopeJSON `json:"-"`
diff --git a/dnssec_test.go b/dnssec/dnssec_test.go
similarity index 87%
rename from dnssec_test.go
rename to dnssec/dnssec_test.go
index 6206b7ddfd5..5aaf6a804da 100644
--- a/dnssec_test.go
+++ b/dnssec/dnssec_test.go
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package cloudflare_test
+package dnssec_test
import (
"context"
@@ -9,6 +9,7 @@ import (
"testing"
"github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/dnssec"
"github.com/cloudflare/cloudflare-go/internal/testutil"
"github.com/cloudflare/cloudflare-go/option"
)
@@ -27,7 +28,7 @@ func TestDNSSECDelete(t *testing.T) {
option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"),
option.WithAPIEmail("user@example.com"),
)
- _, err := client.DNSSEC.Delete(context.TODO(), cloudflare.DNSSECDeleteParams{
+ _, err := client.DNSSEC.Delete(context.TODO(), dnssec.DNSSECDeleteParams{
ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
})
if err != nil {
@@ -53,11 +54,11 @@ func TestDNSSECEditWithOptionalParams(t *testing.T) {
option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"),
option.WithAPIEmail("user@example.com"),
)
- _, err := client.DNSSEC.Edit(context.TODO(), cloudflare.DNSSECEditParams{
+ _, err := client.DNSSEC.Edit(context.TODO(), dnssec.DNSSECEditParams{
ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
DNSSECMultiSigner: cloudflare.F(false),
DNSSECPresigned: cloudflare.F(true),
- Status: cloudflare.F(cloudflare.DNSSECEditParamsStatusActive),
+ Status: cloudflare.F(dnssec.DNSSECEditParamsStatusActive),
})
if err != nil {
var apierr *cloudflare.Error
@@ -82,7 +83,7 @@ func TestDNSSECGet(t *testing.T) {
option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"),
option.WithAPIEmail("user@example.com"),
)
- _, err := client.DNSSEC.Get(context.TODO(), cloudflare.DNSSECGetParams{
+ _, err := client.DNSSEC.Get(context.TODO(), dnssec.DNSSECGetParams{
ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
})
if err != nil {
diff --git a/durable_objects/aliases.go b/durable_objects/aliases.go
new file mode 100644
index 00000000000..95c043ed13f
--- /dev/null
+++ b/durable_objects/aliases.go
@@ -0,0 +1,9 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package durable_objects
+
+import (
+ "github.com/cloudflare/cloudflare-go/internal/apierror"
+)
+
+type Error = apierror.Error
diff --git a/durableobject.go b/durable_objects/durableobject.go
similarity index 88%
rename from durableobject.go
rename to durable_objects/durableobject.go
index b69725b4f0f..3a1caefa77b 100644
--- a/durableobject.go
+++ b/durable_objects/durableobject.go
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package cloudflare
+package durable_objects
import (
"github.com/cloudflare/cloudflare-go/option"
@@ -13,7 +13,7 @@ import (
// instead.
type DurableObjectService struct {
Options []option.RequestOption
- Namespaces *DurableObjectNamespaceService
+ Namespaces *NamespaceService
}
// NewDurableObjectService generates a new service that applies the given options
@@ -22,6 +22,6 @@ type DurableObjectService struct {
func NewDurableObjectService(opts ...option.RequestOption) (r *DurableObjectService) {
r = &DurableObjectService{}
r.Options = opts
- r.Namespaces = NewDurableObjectNamespaceService(opts...)
+ r.Namespaces = NewNamespaceService(opts...)
return
}
diff --git a/durable_objects/namespace.go b/durable_objects/namespace.go
new file mode 100644
index 00000000000..0dafa3ead4b
--- /dev/null
+++ b/durable_objects/namespace.go
@@ -0,0 +1,192 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package durable_objects
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// NamespaceService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewNamespaceService] method instead.
+type NamespaceService struct {
+ Options []option.RequestOption
+ Objects *NamespaceObjectService
+}
+
+// NewNamespaceService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewNamespaceService(opts ...option.RequestOption) (r *NamespaceService) {
+ r = &NamespaceService{}
+ r.Options = opts
+ r.Objects = NewNamespaceObjectService(opts...)
+ return
+}
+
+// Returns the Durable Object namespaces owned by an account.
+func (r *NamespaceService) List(ctx context.Context, query NamespaceListParams, opts ...option.RequestOption) (res *[]WorkersNamespace, err error) {
+ opts = append(r.Options[:], opts...)
+ var env NamespaceListResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/workers/durable_objects/namespaces", query.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type WorkersNamespace struct {
+ ID interface{} `json:"id"`
+ Class interface{} `json:"class"`
+ Name interface{} `json:"name"`
+ Script interface{} `json:"script"`
+ JSON workersNamespaceJSON `json:"-"`
+}
+
+// workersNamespaceJSON contains the JSON metadata for the struct
+// [WorkersNamespace]
+type workersNamespaceJSON struct {
+ ID apijson.Field
+ Class apijson.Field
+ Name apijson.Field
+ Script apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WorkersNamespace) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r workersNamespaceJSON) RawJSON() string {
+ return r.raw
+}
+
+type NamespaceListParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type NamespaceListResponseEnvelope struct {
+ Errors []NamespaceListResponseEnvelopeErrors `json:"errors,required"`
+ Messages []NamespaceListResponseEnvelopeMessages `json:"messages,required"`
+ Result []WorkersNamespace `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success NamespaceListResponseEnvelopeSuccess `json:"success,required"`
+ ResultInfo NamespaceListResponseEnvelopeResultInfo `json:"result_info"`
+ JSON namespaceListResponseEnvelopeJSON `json:"-"`
+}
+
+// namespaceListResponseEnvelopeJSON contains the JSON metadata for the struct
+// [NamespaceListResponseEnvelope]
+type namespaceListResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ ResultInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *NamespaceListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r namespaceListResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type NamespaceListResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON namespaceListResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// namespaceListResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [NamespaceListResponseEnvelopeErrors]
+type namespaceListResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *NamespaceListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r namespaceListResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type NamespaceListResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON namespaceListResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// namespaceListResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [NamespaceListResponseEnvelopeMessages]
+type namespaceListResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *NamespaceListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r namespaceListResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type NamespaceListResponseEnvelopeSuccess bool
+
+const (
+ NamespaceListResponseEnvelopeSuccessTrue NamespaceListResponseEnvelopeSuccess = true
+)
+
+type NamespaceListResponseEnvelopeResultInfo struct {
+ // Total number of results for the requested service
+ Count float64 `json:"count"`
+ // Current page within paginated list of results
+ Page float64 `json:"page"`
+ // Number of results per page of results
+ PerPage float64 `json:"per_page"`
+ // Total results available without any search parameters
+ TotalCount float64 `json:"total_count"`
+ JSON namespaceListResponseEnvelopeResultInfoJSON `json:"-"`
+}
+
+// namespaceListResponseEnvelopeResultInfoJSON contains the JSON metadata for the
+// struct [NamespaceListResponseEnvelopeResultInfo]
+type namespaceListResponseEnvelopeResultInfoJSON struct {
+ Count apijson.Field
+ Page apijson.Field
+ PerPage apijson.Field
+ TotalCount apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *NamespaceListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r namespaceListResponseEnvelopeResultInfoJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/durable_objects/namespace_test.go b/durable_objects/namespace_test.go
new file mode 100644
index 00000000000..ea9e5757d33
--- /dev/null
+++ b/durable_objects/namespace_test.go
@@ -0,0 +1,41 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package durable_objects_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/durable_objects"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestNamespaceList(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"),
+ )
+ _, err := client.DurableObjects.Namespaces.List(context.TODO(), durable_objects.NamespaceListParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ })
+ 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/durable_objects/namespaceobject.go b/durable_objects/namespaceobject.go
new file mode 100644
index 00000000000..697786e1b5f
--- /dev/null
+++ b/durable_objects/namespaceobject.go
@@ -0,0 +1,211 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package durable_objects
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// NamespaceObjectService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewNamespaceObjectService] method
+// instead.
+type NamespaceObjectService struct {
+ Options []option.RequestOption
+}
+
+// NewNamespaceObjectService generates a new service that applies the given options
+// to each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewNamespaceObjectService(opts ...option.RequestOption) (r *NamespaceObjectService) {
+ r = &NamespaceObjectService{}
+ r.Options = opts
+ return
+}
+
+// Returns the Durable Objects in a given namespace.
+func (r *NamespaceObjectService) List(ctx context.Context, id string, params NamespaceObjectListParams, opts ...option.RequestOption) (res *[]WorkersObject, err error) {
+ opts = append(r.Options[:], opts...)
+ var env NamespaceObjectListResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/workers/durable_objects/namespaces/%s/objects", params.AccountID, id)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type WorkersObject struct {
+ // ID of the Durable Object.
+ ID string `json:"id"`
+ // Whether the Durable Object has stored data.
+ HasStoredData bool `json:"hasStoredData"`
+ JSON workersObjectJSON `json:"-"`
+}
+
+// workersObjectJSON contains the JSON metadata for the struct [WorkersObject]
+type workersObjectJSON struct {
+ ID apijson.Field
+ HasStoredData apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WorkersObject) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r workersObjectJSON) RawJSON() string {
+ return r.raw
+}
+
+type NamespaceObjectListParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ // Opaque token indicating the position from which to continue when requesting the
+ // next set of records. A valid value for the cursor can be obtained from the
+ // cursors object in the result_info structure.
+ Cursor param.Field[string] `query:"cursor"`
+ // The number of objects to return. The cursor attribute may be used to iterate
+ // over the next batch of objects if there are more than the limit.
+ Limit param.Field[float64] `query:"limit"`
+}
+
+// URLQuery serializes [NamespaceObjectListParams]'s query parameters as
+// `url.Values`.
+func (r NamespaceObjectListParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type NamespaceObjectListResponseEnvelope struct {
+ Errors []NamespaceObjectListResponseEnvelopeErrors `json:"errors,required"`
+ Messages []NamespaceObjectListResponseEnvelopeMessages `json:"messages,required"`
+ Result []WorkersObject `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success NamespaceObjectListResponseEnvelopeSuccess `json:"success,required"`
+ ResultInfo NamespaceObjectListResponseEnvelopeResultInfo `json:"result_info"`
+ JSON namespaceObjectListResponseEnvelopeJSON `json:"-"`
+}
+
+// namespaceObjectListResponseEnvelopeJSON contains the JSON metadata for the
+// struct [NamespaceObjectListResponseEnvelope]
+type namespaceObjectListResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ ResultInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *NamespaceObjectListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r namespaceObjectListResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type NamespaceObjectListResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON namespaceObjectListResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// namespaceObjectListResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [NamespaceObjectListResponseEnvelopeErrors]
+type namespaceObjectListResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *NamespaceObjectListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r namespaceObjectListResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type NamespaceObjectListResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON namespaceObjectListResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// namespaceObjectListResponseEnvelopeMessagesJSON contains the JSON metadata for
+// the struct [NamespaceObjectListResponseEnvelopeMessages]
+type namespaceObjectListResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *NamespaceObjectListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r namespaceObjectListResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type NamespaceObjectListResponseEnvelopeSuccess bool
+
+const (
+ NamespaceObjectListResponseEnvelopeSuccessTrue NamespaceObjectListResponseEnvelopeSuccess = true
+)
+
+type NamespaceObjectListResponseEnvelopeResultInfo struct {
+ // Total results returned based on your list parameters.
+ Count float64 `json:"count"`
+ // Opaque token indicating the position from which to continue when requesting the
+ // next set of records. A valid value for the cursor can be obtained from the
+ // cursors object in the result_info structure.
+ Cursor string `json:"cursor"`
+ // Current page within paginated list of results
+ Page float64 `json:"page"`
+ // Number of results per page of results
+ PerPage float64 `json:"per_page"`
+ // Total results available without any search parameters
+ TotalCount float64 `json:"total_count"`
+ JSON namespaceObjectListResponseEnvelopeResultInfoJSON `json:"-"`
+}
+
+// namespaceObjectListResponseEnvelopeResultInfoJSON contains the JSON metadata for
+// the struct [NamespaceObjectListResponseEnvelopeResultInfo]
+type namespaceObjectListResponseEnvelopeResultInfoJSON struct {
+ Count apijson.Field
+ Cursor apijson.Field
+ Page apijson.Field
+ PerPage apijson.Field
+ TotalCount apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *NamespaceObjectListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r namespaceObjectListResponseEnvelopeResultInfoJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/durable_objects/namespaceobject_test.go b/durable_objects/namespaceobject_test.go
new file mode 100644
index 00000000000..9004628eba0
--- /dev/null
+++ b/durable_objects/namespaceobject_test.go
@@ -0,0 +1,47 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package durable_objects_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/durable_objects"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestNamespaceObjectListWithOptionalParams(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"),
+ )
+ _, err := client.DurableObjects.Namespaces.Objects.List(
+ context.TODO(),
+ "5fd1cafff895419c8bcc647fc64ab8f0",
+ durable_objects.NamespaceObjectListParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Cursor: cloudflare.F("AAAAANuhDN7SjacTnSVsDu3WW1Lvst6dxJGTjRY5BhxPXdf6L6uTcpd_NVtjhn11OUYRsVEykxoUwF-JQU4dn6QylZSKTOJuG0indrdn_MlHpMRtsxgXjs-RPdHYIVm3odE_uvEQ_dTQGFm8oikZMohns34DLBgrQpc"),
+ Limit: cloudflare.F(10.000000),
+ },
+ )
+ 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/durableobjectnamespace.go b/durableobjectnamespace.go
deleted file mode 100644
index e612973f7cb..00000000000
--- a/durableobjectnamespace.go
+++ /dev/null
@@ -1,193 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// DurableObjectNamespaceService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewDurableObjectNamespaceService]
-// method instead.
-type DurableObjectNamespaceService struct {
- Options []option.RequestOption
- Objects *DurableObjectNamespaceObjectService
-}
-
-// NewDurableObjectNamespaceService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewDurableObjectNamespaceService(opts ...option.RequestOption) (r *DurableObjectNamespaceService) {
- r = &DurableObjectNamespaceService{}
- r.Options = opts
- r.Objects = NewDurableObjectNamespaceObjectService(opts...)
- return
-}
-
-// Returns the Durable Object namespaces owned by an account.
-func (r *DurableObjectNamespaceService) List(ctx context.Context, query DurableObjectNamespaceListParams, opts ...option.RequestOption) (res *[]DurableObjectNamespaceListResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env DurableObjectNamespaceListResponseEnvelope
- path := fmt.Sprintf("accounts/%s/workers/durable_objects/namespaces", query.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type DurableObjectNamespaceListResponse struct {
- ID interface{} `json:"id"`
- Class interface{} `json:"class"`
- Name interface{} `json:"name"`
- Script interface{} `json:"script"`
- JSON durableObjectNamespaceListResponseJSON `json:"-"`
-}
-
-// durableObjectNamespaceListResponseJSON contains the JSON metadata for the struct
-// [DurableObjectNamespaceListResponse]
-type durableObjectNamespaceListResponseJSON struct {
- ID apijson.Field
- Class apijson.Field
- Name apijson.Field
- Script apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DurableObjectNamespaceListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r durableObjectNamespaceListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type DurableObjectNamespaceListParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type DurableObjectNamespaceListResponseEnvelope struct {
- Errors []DurableObjectNamespaceListResponseEnvelopeErrors `json:"errors,required"`
- Messages []DurableObjectNamespaceListResponseEnvelopeMessages `json:"messages,required"`
- Result []DurableObjectNamespaceListResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success DurableObjectNamespaceListResponseEnvelopeSuccess `json:"success,required"`
- ResultInfo DurableObjectNamespaceListResponseEnvelopeResultInfo `json:"result_info"`
- JSON durableObjectNamespaceListResponseEnvelopeJSON `json:"-"`
-}
-
-// durableObjectNamespaceListResponseEnvelopeJSON contains the JSON metadata for
-// the struct [DurableObjectNamespaceListResponseEnvelope]
-type durableObjectNamespaceListResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- ResultInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DurableObjectNamespaceListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r durableObjectNamespaceListResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type DurableObjectNamespaceListResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON durableObjectNamespaceListResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// durableObjectNamespaceListResponseEnvelopeErrorsJSON contains the JSON metadata
-// for the struct [DurableObjectNamespaceListResponseEnvelopeErrors]
-type durableObjectNamespaceListResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DurableObjectNamespaceListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r durableObjectNamespaceListResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type DurableObjectNamespaceListResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON durableObjectNamespaceListResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// durableObjectNamespaceListResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct [DurableObjectNamespaceListResponseEnvelopeMessages]
-type durableObjectNamespaceListResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DurableObjectNamespaceListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r durableObjectNamespaceListResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type DurableObjectNamespaceListResponseEnvelopeSuccess bool
-
-const (
- DurableObjectNamespaceListResponseEnvelopeSuccessTrue DurableObjectNamespaceListResponseEnvelopeSuccess = true
-)
-
-type DurableObjectNamespaceListResponseEnvelopeResultInfo struct {
- // Total number of results for the requested service
- Count float64 `json:"count"`
- // Current page within paginated list of results
- Page float64 `json:"page"`
- // Number of results per page of results
- PerPage float64 `json:"per_page"`
- // Total results available without any search parameters
- TotalCount float64 `json:"total_count"`
- JSON durableObjectNamespaceListResponseEnvelopeResultInfoJSON `json:"-"`
-}
-
-// durableObjectNamespaceListResponseEnvelopeResultInfoJSON contains the JSON
-// metadata for the struct [DurableObjectNamespaceListResponseEnvelopeResultInfo]
-type durableObjectNamespaceListResponseEnvelopeResultInfoJSON struct {
- Count apijson.Field
- Page apijson.Field
- PerPage apijson.Field
- TotalCount apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DurableObjectNamespaceListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r durableObjectNamespaceListResponseEnvelopeResultInfoJSON) RawJSON() string {
- return r.raw
-}
diff --git a/durableobjectnamespace_test.go b/durableobjectnamespace_test.go
deleted file mode 100644
index a2463a768c0..00000000000
--- a/durableobjectnamespace_test.go
+++ /dev/null
@@ -1,40 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestDurableObjectNamespaceList(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"),
- )
- _, err := client.DurableObjects.Namespaces.List(context.TODO(), cloudflare.DurableObjectNamespaceListParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- })
- 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/durableobjectnamespaceobject.go b/durableobjectnamespaceobject.go
deleted file mode 100644
index e52d156ec3a..00000000000
--- a/durableobjectnamespaceobject.go
+++ /dev/null
@@ -1,214 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// DurableObjectNamespaceObjectService contains methods and other services that
-// help with interacting with the cloudflare API. Note, unlike clients, this
-// service does not read variables from the environment automatically. You should
-// not instantiate this service directly, and instead use the
-// [NewDurableObjectNamespaceObjectService] method instead.
-type DurableObjectNamespaceObjectService struct {
- Options []option.RequestOption
-}
-
-// NewDurableObjectNamespaceObjectService generates a new service that applies the
-// given options to each request. These options are applied after the parent
-// client's options (if there is one), and before any request-specific options.
-func NewDurableObjectNamespaceObjectService(opts ...option.RequestOption) (r *DurableObjectNamespaceObjectService) {
- r = &DurableObjectNamespaceObjectService{}
- r.Options = opts
- return
-}
-
-// Returns the Durable Objects in a given namespace.
-func (r *DurableObjectNamespaceObjectService) List(ctx context.Context, id string, params DurableObjectNamespaceObjectListParams, opts ...option.RequestOption) (res *[]DurableObjectNamespaceObjectListResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env DurableObjectNamespaceObjectListResponseEnvelope
- path := fmt.Sprintf("accounts/%s/workers/durable_objects/namespaces/%s/objects", params.AccountID, id)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type DurableObjectNamespaceObjectListResponse struct {
- // ID of the Durable Object.
- ID string `json:"id"`
- // Whether the Durable Object has stored data.
- HasStoredData bool `json:"hasStoredData"`
- JSON durableObjectNamespaceObjectListResponseJSON `json:"-"`
-}
-
-// durableObjectNamespaceObjectListResponseJSON contains the JSON metadata for the
-// struct [DurableObjectNamespaceObjectListResponse]
-type durableObjectNamespaceObjectListResponseJSON struct {
- ID apijson.Field
- HasStoredData apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DurableObjectNamespaceObjectListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r durableObjectNamespaceObjectListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type DurableObjectNamespaceObjectListParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
- // Opaque token indicating the position from which to continue when requesting the
- // next set of records. A valid value for the cursor can be obtained from the
- // cursors object in the result_info structure.
- Cursor param.Field[string] `query:"cursor"`
- // The number of objects to return. The cursor attribute may be used to iterate
- // over the next batch of objects if there are more than the limit.
- Limit param.Field[float64] `query:"limit"`
-}
-
-// URLQuery serializes [DurableObjectNamespaceObjectListParams]'s query parameters
-// as `url.Values`.
-func (r DurableObjectNamespaceObjectListParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type DurableObjectNamespaceObjectListResponseEnvelope struct {
- Errors []DurableObjectNamespaceObjectListResponseEnvelopeErrors `json:"errors,required"`
- Messages []DurableObjectNamespaceObjectListResponseEnvelopeMessages `json:"messages,required"`
- Result []DurableObjectNamespaceObjectListResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success DurableObjectNamespaceObjectListResponseEnvelopeSuccess `json:"success,required"`
- ResultInfo DurableObjectNamespaceObjectListResponseEnvelopeResultInfo `json:"result_info"`
- JSON durableObjectNamespaceObjectListResponseEnvelopeJSON `json:"-"`
-}
-
-// durableObjectNamespaceObjectListResponseEnvelopeJSON contains the JSON metadata
-// for the struct [DurableObjectNamespaceObjectListResponseEnvelope]
-type durableObjectNamespaceObjectListResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- ResultInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DurableObjectNamespaceObjectListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r durableObjectNamespaceObjectListResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type DurableObjectNamespaceObjectListResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON durableObjectNamespaceObjectListResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// durableObjectNamespaceObjectListResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct [DurableObjectNamespaceObjectListResponseEnvelopeErrors]
-type durableObjectNamespaceObjectListResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DurableObjectNamespaceObjectListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r durableObjectNamespaceObjectListResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type DurableObjectNamespaceObjectListResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON durableObjectNamespaceObjectListResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// durableObjectNamespaceObjectListResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct
-// [DurableObjectNamespaceObjectListResponseEnvelopeMessages]
-type durableObjectNamespaceObjectListResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DurableObjectNamespaceObjectListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r durableObjectNamespaceObjectListResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type DurableObjectNamespaceObjectListResponseEnvelopeSuccess bool
-
-const (
- DurableObjectNamespaceObjectListResponseEnvelopeSuccessTrue DurableObjectNamespaceObjectListResponseEnvelopeSuccess = true
-)
-
-type DurableObjectNamespaceObjectListResponseEnvelopeResultInfo struct {
- // Total results returned based on your list parameters.
- Count float64 `json:"count"`
- // Opaque token indicating the position from which to continue when requesting the
- // next set of records. A valid value for the cursor can be obtained from the
- // cursors object in the result_info structure.
- Cursor string `json:"cursor"`
- // Current page within paginated list of results
- Page float64 `json:"page"`
- // Number of results per page of results
- PerPage float64 `json:"per_page"`
- // Total results available without any search parameters
- TotalCount float64 `json:"total_count"`
- JSON durableObjectNamespaceObjectListResponseEnvelopeResultInfoJSON `json:"-"`
-}
-
-// durableObjectNamespaceObjectListResponseEnvelopeResultInfoJSON contains the JSON
-// metadata for the struct
-// [DurableObjectNamespaceObjectListResponseEnvelopeResultInfo]
-type durableObjectNamespaceObjectListResponseEnvelopeResultInfoJSON struct {
- Count apijson.Field
- Cursor apijson.Field
- Page apijson.Field
- PerPage apijson.Field
- TotalCount apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *DurableObjectNamespaceObjectListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r durableObjectNamespaceObjectListResponseEnvelopeResultInfoJSON) RawJSON() string {
- return r.raw
-}
diff --git a/durableobjectnamespaceobject_test.go b/durableobjectnamespaceobject_test.go
deleted file mode 100644
index a8492cdc201..00000000000
--- a/durableobjectnamespaceobject_test.go
+++ /dev/null
@@ -1,46 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestDurableObjectNamespaceObjectListWithOptionalParams(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"),
- )
- _, err := client.DurableObjects.Namespaces.Objects.List(
- context.TODO(),
- "5fd1cafff895419c8bcc647fc64ab8f0",
- cloudflare.DurableObjectNamespaceObjectListParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Cursor: cloudflare.F("AAAAANuhDN7SjacTnSVsDu3WW1Lvst6dxJGTjRY5BhxPXdf6L6uTcpd_NVtjhn11OUYRsVEykxoUwF-JQU4dn6QylZSKTOJuG0indrdn_MlHpMRtsxgXjs-RPdHYIVm3odE_uvEQ_dTQGFm8oikZMohns34DLBgrQpc"),
- Limit: cloudflare.F(10.000000),
- },
- )
- 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/email_routing/aliases.go b/email_routing/aliases.go
new file mode 100644
index 00000000000..8b3ee41cd3c
--- /dev/null
+++ b/email_routing/aliases.go
@@ -0,0 +1,9 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package email_routing
+
+import (
+ "github.com/cloudflare/cloudflare-go/internal/apierror"
+)
+
+type Error = apierror.Error
diff --git a/email_routing/emailrouting.go b/email_routing/emailrouting.go
new file mode 100644
index 00000000000..e4658126517
--- /dev/null
+++ b/email_routing/emailrouting.go
@@ -0,0 +1,27 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package email_routing
+
+import (
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// EmailRoutingService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewEmailRoutingService] method
+// instead.
+type EmailRoutingService struct {
+ Options []option.RequestOption
+ Routing *RoutingService
+}
+
+// NewEmailRoutingService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewEmailRoutingService(opts ...option.RequestOption) (r *EmailRoutingService) {
+ r = &EmailRoutingService{}
+ r.Options = opts
+ r.Routing = NewRoutingService(opts...)
+ return
+}
diff --git a/email_routing/routing.go b/email_routing/routing.go
new file mode 100644
index 00000000000..0073569dda0
--- /dev/null
+++ b/email_routing/routing.go
@@ -0,0 +1,206 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package email_routing
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// RoutingService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewRoutingService] method instead.
+type RoutingService struct {
+ Options []option.RequestOption
+ Disables *RoutingDisableService
+ DNS *RoutingDNSService
+ Enables *RoutingEnableService
+ Rules *RoutingRuleService
+ Addresses *RoutingAddressService
+}
+
+// NewRoutingService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewRoutingService(opts ...option.RequestOption) (r *RoutingService) {
+ r = &RoutingService{}
+ r.Options = opts
+ r.Disables = NewRoutingDisableService(opts...)
+ r.DNS = NewRoutingDNSService(opts...)
+ r.Enables = NewRoutingEnableService(opts...)
+ r.Rules = NewRoutingRuleService(opts...)
+ r.Addresses = NewRoutingAddressService(opts...)
+ return
+}
+
+// Get information about the settings for your Email Routing zone.
+func (r *RoutingService) Get(ctx context.Context, zoneIdentifier string, opts ...option.RequestOption) (res *RoutingGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RoutingGetResponseEnvelope
+ path := fmt.Sprintf("zones/%s/email/routing", zoneIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type RoutingGetResponse struct {
+ // Email Routing settings identifier.
+ ID string `json:"id"`
+ // The date and time the settings have been created.
+ Created time.Time `json:"created" format:"date-time"`
+ // State of the zone settings for Email Routing.
+ Enabled RoutingGetResponseEnabled `json:"enabled"`
+ // The date and time the settings have been modified.
+ Modified time.Time `json:"modified" format:"date-time"`
+ // Domain of your zone.
+ Name string `json:"name"`
+ // Flag to check if the user skipped the configuration wizard.
+ SkipWizard RoutingGetResponseSkipWizard `json:"skip_wizard"`
+ // Show the state of your account, and the type or configuration error.
+ Status RoutingGetResponseStatus `json:"status"`
+ // Email Routing settings tag. (Deprecated, replaced by Email Routing settings
+ // identifier)
+ Tag string `json:"tag"`
+ JSON routingGetResponseJSON `json:"-"`
+}
+
+// routingGetResponseJSON contains the JSON metadata for the struct
+// [RoutingGetResponse]
+type routingGetResponseJSON struct {
+ ID apijson.Field
+ Created apijson.Field
+ Enabled apijson.Field
+ Modified apijson.Field
+ Name apijson.Field
+ SkipWizard apijson.Field
+ Status apijson.Field
+ Tag apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RoutingGetResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routingGetResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+// State of the zone settings for Email Routing.
+type RoutingGetResponseEnabled bool
+
+const (
+ RoutingGetResponseEnabledTrue RoutingGetResponseEnabled = true
+ RoutingGetResponseEnabledFalse RoutingGetResponseEnabled = false
+)
+
+// Flag to check if the user skipped the configuration wizard.
+type RoutingGetResponseSkipWizard bool
+
+const (
+ RoutingGetResponseSkipWizardTrue RoutingGetResponseSkipWizard = true
+ RoutingGetResponseSkipWizardFalse RoutingGetResponseSkipWizard = false
+)
+
+// Show the state of your account, and the type or configuration error.
+type RoutingGetResponseStatus string
+
+const (
+ RoutingGetResponseStatusReady RoutingGetResponseStatus = "ready"
+ RoutingGetResponseStatusUnconfigured RoutingGetResponseStatus = "unconfigured"
+ RoutingGetResponseStatusMisconfigured RoutingGetResponseStatus = "misconfigured"
+ RoutingGetResponseStatusMisconfiguredLocked RoutingGetResponseStatus = "misconfigured/locked"
+ RoutingGetResponseStatusUnlocked RoutingGetResponseStatus = "unlocked"
+)
+
+type RoutingGetResponseEnvelope struct {
+ Errors []RoutingGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []RoutingGetResponseEnvelopeMessages `json:"messages,required"`
+ Result RoutingGetResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success RoutingGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON routingGetResponseEnvelopeJSON `json:"-"`
+}
+
+// routingGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [RoutingGetResponseEnvelope]
+type routingGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RoutingGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routingGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type RoutingGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON routingGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// routingGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [RoutingGetResponseEnvelopeErrors]
+type routingGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RoutingGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routingGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type RoutingGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON routingGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// routingGetResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [RoutingGetResponseEnvelopeMessages]
+type routingGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RoutingGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routingGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type RoutingGetResponseEnvelopeSuccess bool
+
+const (
+ RoutingGetResponseEnvelopeSuccessTrue RoutingGetResponseEnvelopeSuccess = true
+)
diff --git a/email_routing/routing_test.go b/email_routing/routing_test.go
new file mode 100644
index 00000000000..d88bb39b4e4
--- /dev/null
+++ b/email_routing/routing_test.go
@@ -0,0 +1,38 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package email_routing_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestRoutingGet(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"),
+ )
+ _, err := client.EmailRouting.Routing.Get(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353")
+ 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/email_routing/routingaddress.go b/email_routing/routingaddress.go
new file mode 100644
index 00000000000..1245833b5dc
--- /dev/null
+++ b/email_routing/routingaddress.go
@@ -0,0 +1,543 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package email_routing
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// RoutingAddressService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewRoutingAddressService] method
+// instead.
+type RoutingAddressService struct {
+ Options []option.RequestOption
+}
+
+// NewRoutingAddressService generates a new service that applies the given options
+// to each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewRoutingAddressService(opts ...option.RequestOption) (r *RoutingAddressService) {
+ r = &RoutingAddressService{}
+ r.Options = opts
+ return
+}
+
+// Create a destination address to forward your emails to. Destination addresses
+// need to be verified before they can be used.
+func (r *RoutingAddressService) New(ctx context.Context, accountIdentifier string, body RoutingAddressNewParams, opts ...option.RequestOption) (res *RoutingAddressNewResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RoutingAddressNewResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/email/routing/addresses", accountIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Lists existing destination addresses.
+func (r *RoutingAddressService) List(ctx context.Context, accountIdentifier string, query RoutingAddressListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[RoutingAddressListResponse], err error) {
+ var raw *http.Response
+ opts = append(r.Options, opts...)
+ opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
+ path := fmt.Sprintf("accounts/%s/email/routing/addresses", accountIdentifier)
+ cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...)
+ if err != nil {
+ return nil, err
+ }
+ err = cfg.Execute()
+ if err != nil {
+ return nil, err
+ }
+ res.SetPageConfig(cfg, raw)
+ return res, nil
+}
+
+// Lists existing destination addresses.
+func (r *RoutingAddressService) ListAutoPaging(ctx context.Context, accountIdentifier string, query RoutingAddressListParams, opts ...option.RequestOption) *shared.V4PagePaginationArrayAutoPager[RoutingAddressListResponse] {
+ return shared.NewV4PagePaginationArrayAutoPager(r.List(ctx, accountIdentifier, query, opts...))
+}
+
+// Deletes a specific destination address.
+func (r *RoutingAddressService) Delete(ctx context.Context, accountIdentifier string, destinationAddressIdentifier string, opts ...option.RequestOption) (res *RoutingAddressDeleteResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RoutingAddressDeleteResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/email/routing/addresses/%s", accountIdentifier, destinationAddressIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Gets information for a specific destination email already created.
+func (r *RoutingAddressService) Get(ctx context.Context, accountIdentifier string, destinationAddressIdentifier string, opts ...option.RequestOption) (res *RoutingAddressGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RoutingAddressGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/email/routing/addresses/%s", accountIdentifier, destinationAddressIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type RoutingAddressNewResponse struct {
+ // Destination address identifier.
+ ID string `json:"id"`
+ // The date and time the destination address has been created.
+ Created time.Time `json:"created" format:"date-time"`
+ // The contact email address of the user.
+ Email string `json:"email"`
+ // The date and time the destination address was last modified.
+ Modified time.Time `json:"modified" format:"date-time"`
+ // Destination address tag. (Deprecated, replaced by destination address
+ // identifier)
+ Tag string `json:"tag"`
+ // The date and time the destination address has been verified. Null means not
+ // verified yet.
+ Verified time.Time `json:"verified" format:"date-time"`
+ JSON routingAddressNewResponseJSON `json:"-"`
+}
+
+// routingAddressNewResponseJSON contains the JSON metadata for the struct
+// [RoutingAddressNewResponse]
+type routingAddressNewResponseJSON struct {
+ ID apijson.Field
+ Created apijson.Field
+ Email apijson.Field
+ Modified apijson.Field
+ Tag apijson.Field
+ Verified apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RoutingAddressNewResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routingAddressNewResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type RoutingAddressListResponse struct {
+ // Destination address identifier.
+ ID string `json:"id"`
+ // The date and time the destination address has been created.
+ Created time.Time `json:"created" format:"date-time"`
+ // The contact email address of the user.
+ Email string `json:"email"`
+ // The date and time the destination address was last modified.
+ Modified time.Time `json:"modified" format:"date-time"`
+ // Destination address tag. (Deprecated, replaced by destination address
+ // identifier)
+ Tag string `json:"tag"`
+ // The date and time the destination address has been verified. Null means not
+ // verified yet.
+ Verified time.Time `json:"verified" format:"date-time"`
+ JSON routingAddressListResponseJSON `json:"-"`
+}
+
+// routingAddressListResponseJSON contains the JSON metadata for the struct
+// [RoutingAddressListResponse]
+type routingAddressListResponseJSON struct {
+ ID apijson.Field
+ Created apijson.Field
+ Email apijson.Field
+ Modified apijson.Field
+ Tag apijson.Field
+ Verified apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RoutingAddressListResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routingAddressListResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type RoutingAddressDeleteResponse struct {
+ // Destination address identifier.
+ ID string `json:"id"`
+ // The date and time the destination address has been created.
+ Created time.Time `json:"created" format:"date-time"`
+ // The contact email address of the user.
+ Email string `json:"email"`
+ // The date and time the destination address was last modified.
+ Modified time.Time `json:"modified" format:"date-time"`
+ // Destination address tag. (Deprecated, replaced by destination address
+ // identifier)
+ Tag string `json:"tag"`
+ // The date and time the destination address has been verified. Null means not
+ // verified yet.
+ Verified time.Time `json:"verified" format:"date-time"`
+ JSON routingAddressDeleteResponseJSON `json:"-"`
+}
+
+// routingAddressDeleteResponseJSON contains the JSON metadata for the struct
+// [RoutingAddressDeleteResponse]
+type routingAddressDeleteResponseJSON struct {
+ ID apijson.Field
+ Created apijson.Field
+ Email apijson.Field
+ Modified apijson.Field
+ Tag apijson.Field
+ Verified apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RoutingAddressDeleteResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routingAddressDeleteResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type RoutingAddressGetResponse struct {
+ // Destination address identifier.
+ ID string `json:"id"`
+ // The date and time the destination address has been created.
+ Created time.Time `json:"created" format:"date-time"`
+ // The contact email address of the user.
+ Email string `json:"email"`
+ // The date and time the destination address was last modified.
+ Modified time.Time `json:"modified" format:"date-time"`
+ // Destination address tag. (Deprecated, replaced by destination address
+ // identifier)
+ Tag string `json:"tag"`
+ // The date and time the destination address has been verified. Null means not
+ // verified yet.
+ Verified time.Time `json:"verified" format:"date-time"`
+ JSON routingAddressGetResponseJSON `json:"-"`
+}
+
+// routingAddressGetResponseJSON contains the JSON metadata for the struct
+// [RoutingAddressGetResponse]
+type routingAddressGetResponseJSON struct {
+ ID apijson.Field
+ Created apijson.Field
+ Email apijson.Field
+ Modified apijson.Field
+ Tag apijson.Field
+ Verified apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RoutingAddressGetResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routingAddressGetResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type RoutingAddressNewParams struct {
+ // The contact email address of the user.
+ Email param.Field[string] `json:"email,required"`
+}
+
+func (r RoutingAddressNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type RoutingAddressNewResponseEnvelope struct {
+ Errors []RoutingAddressNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []RoutingAddressNewResponseEnvelopeMessages `json:"messages,required"`
+ Result RoutingAddressNewResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success RoutingAddressNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON routingAddressNewResponseEnvelopeJSON `json:"-"`
+}
+
+// routingAddressNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [RoutingAddressNewResponseEnvelope]
+type routingAddressNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RoutingAddressNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routingAddressNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type RoutingAddressNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON routingAddressNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// routingAddressNewResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [RoutingAddressNewResponseEnvelopeErrors]
+type routingAddressNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RoutingAddressNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routingAddressNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type RoutingAddressNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON routingAddressNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// routingAddressNewResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [RoutingAddressNewResponseEnvelopeMessages]
+type routingAddressNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RoutingAddressNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routingAddressNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type RoutingAddressNewResponseEnvelopeSuccess bool
+
+const (
+ RoutingAddressNewResponseEnvelopeSuccessTrue RoutingAddressNewResponseEnvelopeSuccess = true
+)
+
+type RoutingAddressListParams struct {
+ // Sorts results in an ascending or descending order.
+ Direction param.Field[RoutingAddressListParamsDirection] `query:"direction"`
+ // Page number of paginated results.
+ Page param.Field[float64] `query:"page"`
+ // Maximum number of results per page.
+ PerPage param.Field[float64] `query:"per_page"`
+ // Filter by verified destination addresses.
+ Verified param.Field[RoutingAddressListParamsVerified] `query:"verified"`
+}
+
+// URLQuery serializes [RoutingAddressListParams]'s query parameters as
+// `url.Values`.
+func (r RoutingAddressListParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Sorts results in an ascending or descending order.
+type RoutingAddressListParamsDirection string
+
+const (
+ RoutingAddressListParamsDirectionAsc RoutingAddressListParamsDirection = "asc"
+ RoutingAddressListParamsDirectionDesc RoutingAddressListParamsDirection = "desc"
+)
+
+// Filter by verified destination addresses.
+type RoutingAddressListParamsVerified bool
+
+const (
+ RoutingAddressListParamsVerifiedTrue RoutingAddressListParamsVerified = true
+ RoutingAddressListParamsVerifiedFalse RoutingAddressListParamsVerified = false
+)
+
+type RoutingAddressDeleteResponseEnvelope struct {
+ Errors []RoutingAddressDeleteResponseEnvelopeErrors `json:"errors,required"`
+ Messages []RoutingAddressDeleteResponseEnvelopeMessages `json:"messages,required"`
+ Result RoutingAddressDeleteResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success RoutingAddressDeleteResponseEnvelopeSuccess `json:"success,required"`
+ JSON routingAddressDeleteResponseEnvelopeJSON `json:"-"`
+}
+
+// routingAddressDeleteResponseEnvelopeJSON contains the JSON metadata for the
+// struct [RoutingAddressDeleteResponseEnvelope]
+type routingAddressDeleteResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RoutingAddressDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routingAddressDeleteResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type RoutingAddressDeleteResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON routingAddressDeleteResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// routingAddressDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for
+// the struct [RoutingAddressDeleteResponseEnvelopeErrors]
+type routingAddressDeleteResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RoutingAddressDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routingAddressDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type RoutingAddressDeleteResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON routingAddressDeleteResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// routingAddressDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for
+// the struct [RoutingAddressDeleteResponseEnvelopeMessages]
+type routingAddressDeleteResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RoutingAddressDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routingAddressDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type RoutingAddressDeleteResponseEnvelopeSuccess bool
+
+const (
+ RoutingAddressDeleteResponseEnvelopeSuccessTrue RoutingAddressDeleteResponseEnvelopeSuccess = true
+)
+
+type RoutingAddressGetResponseEnvelope struct {
+ Errors []RoutingAddressGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []RoutingAddressGetResponseEnvelopeMessages `json:"messages,required"`
+ Result RoutingAddressGetResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success RoutingAddressGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON routingAddressGetResponseEnvelopeJSON `json:"-"`
+}
+
+// routingAddressGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [RoutingAddressGetResponseEnvelope]
+type routingAddressGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RoutingAddressGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routingAddressGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type RoutingAddressGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON routingAddressGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// routingAddressGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [RoutingAddressGetResponseEnvelopeErrors]
+type routingAddressGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RoutingAddressGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routingAddressGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type RoutingAddressGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON routingAddressGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// routingAddressGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [RoutingAddressGetResponseEnvelopeMessages]
+type routingAddressGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RoutingAddressGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routingAddressGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type RoutingAddressGetResponseEnvelopeSuccess bool
+
+const (
+ RoutingAddressGetResponseEnvelopeSuccessTrue RoutingAddressGetResponseEnvelopeSuccess = true
+)
diff --git a/email_routing/routingaddress_test.go b/email_routing/routingaddress_test.go
new file mode 100644
index 00000000000..b3013956118
--- /dev/null
+++ b/email_routing/routingaddress_test.go
@@ -0,0 +1,134 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package email_routing_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/email_routing"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestRoutingAddressNew(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"),
+ )
+ _, err := client.EmailRouting.Routing.Addresses.New(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ email_routing.RoutingAddressNewParams{
+ Email: cloudflare.F("user@example.com"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestRoutingAddressListWithOptionalParams(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"),
+ )
+ _, err := client.EmailRouting.Routing.Addresses.List(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ email_routing.RoutingAddressListParams{
+ Direction: cloudflare.F(email_routing.RoutingAddressListParamsDirectionAsc),
+ Page: cloudflare.F(1.000000),
+ PerPage: cloudflare.F(5.000000),
+ Verified: cloudflare.F(email_routing.RoutingAddressListParamsVerifiedTrue),
+ },
+ )
+ 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())
+ }
+}
+
+func TestRoutingAddressDelete(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"),
+ )
+ _, err := client.EmailRouting.Routing.Addresses.Delete(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ "ea95132c15732412d22c1476fa83f27a",
+ )
+ 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())
+ }
+}
+
+func TestRoutingAddressGet(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"),
+ )
+ _, err := client.EmailRouting.Routing.Addresses.Get(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ "ea95132c15732412d22c1476fa83f27a",
+ )
+ 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/email_routing/routingdisable.go b/email_routing/routingdisable.go
new file mode 100644
index 00000000000..65bdf6c1d95
--- /dev/null
+++ b/email_routing/routingdisable.go
@@ -0,0 +1,198 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package email_routing
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// RoutingDisableService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewRoutingDisableService] method
+// instead.
+type RoutingDisableService struct {
+ Options []option.RequestOption
+}
+
+// NewRoutingDisableService generates a new service that applies the given options
+// to each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewRoutingDisableService(opts ...option.RequestOption) (r *RoutingDisableService) {
+ r = &RoutingDisableService{}
+ r.Options = opts
+ return
+}
+
+// Disable your Email Routing zone. Also removes additional MX records previously
+// required for Email Routing to work.
+func (r *RoutingDisableService) New(ctx context.Context, zoneIdentifier string, opts ...option.RequestOption) (res *RoutingDisableNewResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RoutingDisableNewResponseEnvelope
+ path := fmt.Sprintf("zones/%s/email/routing/disable", zoneIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type RoutingDisableNewResponse struct {
+ // Email Routing settings identifier.
+ ID string `json:"id"`
+ // The date and time the settings have been created.
+ Created time.Time `json:"created" format:"date-time"`
+ // State of the zone settings for Email Routing.
+ Enabled RoutingDisableNewResponseEnabled `json:"enabled"`
+ // The date and time the settings have been modified.
+ Modified time.Time `json:"modified" format:"date-time"`
+ // Domain of your zone.
+ Name string `json:"name"`
+ // Flag to check if the user skipped the configuration wizard.
+ SkipWizard RoutingDisableNewResponseSkipWizard `json:"skip_wizard"`
+ // Show the state of your account, and the type or configuration error.
+ Status RoutingDisableNewResponseStatus `json:"status"`
+ // Email Routing settings tag. (Deprecated, replaced by Email Routing settings
+ // identifier)
+ Tag string `json:"tag"`
+ JSON routingDisableNewResponseJSON `json:"-"`
+}
+
+// routingDisableNewResponseJSON contains the JSON metadata for the struct
+// [RoutingDisableNewResponse]
+type routingDisableNewResponseJSON struct {
+ ID apijson.Field
+ Created apijson.Field
+ Enabled apijson.Field
+ Modified apijson.Field
+ Name apijson.Field
+ SkipWizard apijson.Field
+ Status apijson.Field
+ Tag apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RoutingDisableNewResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routingDisableNewResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+// State of the zone settings for Email Routing.
+type RoutingDisableNewResponseEnabled bool
+
+const (
+ RoutingDisableNewResponseEnabledTrue RoutingDisableNewResponseEnabled = true
+ RoutingDisableNewResponseEnabledFalse RoutingDisableNewResponseEnabled = false
+)
+
+// Flag to check if the user skipped the configuration wizard.
+type RoutingDisableNewResponseSkipWizard bool
+
+const (
+ RoutingDisableNewResponseSkipWizardTrue RoutingDisableNewResponseSkipWizard = true
+ RoutingDisableNewResponseSkipWizardFalse RoutingDisableNewResponseSkipWizard = false
+)
+
+// Show the state of your account, and the type or configuration error.
+type RoutingDisableNewResponseStatus string
+
+const (
+ RoutingDisableNewResponseStatusReady RoutingDisableNewResponseStatus = "ready"
+ RoutingDisableNewResponseStatusUnconfigured RoutingDisableNewResponseStatus = "unconfigured"
+ RoutingDisableNewResponseStatusMisconfigured RoutingDisableNewResponseStatus = "misconfigured"
+ RoutingDisableNewResponseStatusMisconfiguredLocked RoutingDisableNewResponseStatus = "misconfigured/locked"
+ RoutingDisableNewResponseStatusUnlocked RoutingDisableNewResponseStatus = "unlocked"
+)
+
+type RoutingDisableNewResponseEnvelope struct {
+ Errors []RoutingDisableNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []RoutingDisableNewResponseEnvelopeMessages `json:"messages,required"`
+ Result RoutingDisableNewResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success RoutingDisableNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON routingDisableNewResponseEnvelopeJSON `json:"-"`
+}
+
+// routingDisableNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [RoutingDisableNewResponseEnvelope]
+type routingDisableNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RoutingDisableNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routingDisableNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type RoutingDisableNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON routingDisableNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// routingDisableNewResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [RoutingDisableNewResponseEnvelopeErrors]
+type routingDisableNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RoutingDisableNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routingDisableNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type RoutingDisableNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON routingDisableNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// routingDisableNewResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [RoutingDisableNewResponseEnvelopeMessages]
+type routingDisableNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RoutingDisableNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routingDisableNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type RoutingDisableNewResponseEnvelopeSuccess bool
+
+const (
+ RoutingDisableNewResponseEnvelopeSuccessTrue RoutingDisableNewResponseEnvelopeSuccess = true
+)
diff --git a/email_routing/routingdisable_test.go b/email_routing/routingdisable_test.go
new file mode 100644
index 00000000000..82f9982f6aa
--- /dev/null
+++ b/email_routing/routingdisable_test.go
@@ -0,0 +1,38 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package email_routing_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestRoutingDisableNew(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"),
+ )
+ _, err := client.EmailRouting.Routing.Disables.New(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353")
+ 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/email_routing/routingdns.go b/email_routing/routingdns.go
new file mode 100644
index 00000000000..bc886a298b9
--- /dev/null
+++ b/email_routing/routingdns.go
@@ -0,0 +1,250 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package email_routing
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "reflect"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/tidwall/gjson"
+)
+
+// RoutingDNSService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewRoutingDNSService] method instead.
+type RoutingDNSService struct {
+ Options []option.RequestOption
+}
+
+// NewRoutingDNSService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewRoutingDNSService(opts ...option.RequestOption) (r *RoutingDNSService) {
+ r = &RoutingDNSService{}
+ r.Options = opts
+ return
+}
+
+// Show the DNS records needed to configure your Email Routing zone.
+func (r *RoutingDNSService) Get(ctx context.Context, zoneIdentifier string, opts ...option.RequestOption) (res *[]EmailDNSRecord, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RoutingDNSGetResponseEnvelope
+ path := fmt.Sprintf("zones/%s/email/routing/dns", zoneIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// List of records needed to enable an Email Routing zone.
+type EmailDNSRecord struct {
+ // DNS record content.
+ Content string `json:"content"`
+ // DNS record name (or @ for the zone apex).
+ Name string `json:"name"`
+ // Required for MX, SRV and URI records. Unused by other record types. Records with
+ // lower priorities are preferred.
+ Priority float64 `json:"priority"`
+ // Time to live, in seconds, of the DNS record. Must be between 60 and 86400, or 1
+ // for 'automatic'.
+ TTL EmailDNSRecordTTL `json:"ttl"`
+ // DNS record type.
+ Type EmailDNSRecordType `json:"type"`
+ JSON emailDNSRecordJSON `json:"-"`
+}
+
+// emailDNSRecordJSON contains the JSON metadata for the struct [EmailDNSRecord]
+type emailDNSRecordJSON struct {
+ Content apijson.Field
+ Name apijson.Field
+ Priority apijson.Field
+ TTL apijson.Field
+ Type apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailDNSRecord) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailDNSRecordJSON) RawJSON() string {
+ return r.raw
+}
+
+// Time to live, in seconds, of the DNS record. Must be between 60 and 86400, or 1
+// for 'automatic'.
+//
+// Union satisfied by [shared.UnionFloat] or
+// [email_routing.EmailDNSRecordTTLNumber].
+type EmailDNSRecordTTL interface {
+ ImplementsEmailRoutingEmailDNSRecordTTL()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*EmailDNSRecordTTL)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(EmailDNSRecordTTLNumber(0)),
+ },
+ )
+}
+
+type EmailDNSRecordTTLNumber float64
+
+const (
+ EmailDNSRecordTTLNumber1 EmailDNSRecordTTLNumber = 1
+)
+
+// DNS record type.
+type EmailDNSRecordType string
+
+const (
+ EmailDNSRecordTypeA EmailDNSRecordType = "A"
+ EmailDNSRecordTypeAAAA EmailDNSRecordType = "AAAA"
+ EmailDNSRecordTypeCNAME EmailDNSRecordType = "CNAME"
+ EmailDNSRecordTypeHTTPS EmailDNSRecordType = "HTTPS"
+ EmailDNSRecordTypeTXT EmailDNSRecordType = "TXT"
+ EmailDNSRecordTypeSRV EmailDNSRecordType = "SRV"
+ EmailDNSRecordTypeLOC EmailDNSRecordType = "LOC"
+ EmailDNSRecordTypeMX EmailDNSRecordType = "MX"
+ EmailDNSRecordTypeNS EmailDNSRecordType = "NS"
+ EmailDNSRecordTypeCert EmailDNSRecordType = "CERT"
+ EmailDNSRecordTypeDNSKEY EmailDNSRecordType = "DNSKEY"
+ EmailDNSRecordTypeDS EmailDNSRecordType = "DS"
+ EmailDNSRecordTypeNAPTR EmailDNSRecordType = "NAPTR"
+ EmailDNSRecordTypeSmimea EmailDNSRecordType = "SMIMEA"
+ EmailDNSRecordTypeSSHFP EmailDNSRecordType = "SSHFP"
+ EmailDNSRecordTypeSVCB EmailDNSRecordType = "SVCB"
+ EmailDNSRecordTypeTLSA EmailDNSRecordType = "TLSA"
+ EmailDNSRecordTypeURI EmailDNSRecordType = "URI"
+)
+
+type RoutingDNSGetResponseEnvelope struct {
+ Errors []RoutingDNSGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []RoutingDNSGetResponseEnvelopeMessages `json:"messages,required"`
+ Result []EmailDNSRecord `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success RoutingDNSGetResponseEnvelopeSuccess `json:"success,required"`
+ ResultInfo RoutingDNSGetResponseEnvelopeResultInfo `json:"result_info"`
+ JSON routingDNSGetResponseEnvelopeJSON `json:"-"`
+}
+
+// routingDNSGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [RoutingDNSGetResponseEnvelope]
+type routingDNSGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ ResultInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RoutingDNSGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routingDNSGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type RoutingDNSGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON routingDNSGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// routingDNSGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [RoutingDNSGetResponseEnvelopeErrors]
+type routingDNSGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RoutingDNSGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routingDNSGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type RoutingDNSGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON routingDNSGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// routingDNSGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [RoutingDNSGetResponseEnvelopeMessages]
+type routingDNSGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RoutingDNSGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routingDNSGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type RoutingDNSGetResponseEnvelopeSuccess bool
+
+const (
+ RoutingDNSGetResponseEnvelopeSuccessTrue RoutingDNSGetResponseEnvelopeSuccess = true
+)
+
+type RoutingDNSGetResponseEnvelopeResultInfo struct {
+ // Total number of results for the requested service
+ Count float64 `json:"count"`
+ // Current page within paginated list of results
+ Page float64 `json:"page"`
+ // Number of results per page of results
+ PerPage float64 `json:"per_page"`
+ // Total results available without any search parameters
+ TotalCount float64 `json:"total_count"`
+ JSON routingDNSGetResponseEnvelopeResultInfoJSON `json:"-"`
+}
+
+// routingDNSGetResponseEnvelopeResultInfoJSON contains the JSON metadata for the
+// struct [RoutingDNSGetResponseEnvelopeResultInfo]
+type routingDNSGetResponseEnvelopeResultInfoJSON struct {
+ Count apijson.Field
+ Page apijson.Field
+ PerPage apijson.Field
+ TotalCount apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RoutingDNSGetResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routingDNSGetResponseEnvelopeResultInfoJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/email_routing/routingdns_test.go b/email_routing/routingdns_test.go
new file mode 100644
index 00000000000..46d79c7fc6f
--- /dev/null
+++ b/email_routing/routingdns_test.go
@@ -0,0 +1,38 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package email_routing_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestRoutingDNSGet(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"),
+ )
+ _, err := client.EmailRouting.Routing.DNS.Get(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353")
+ 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/email_routing/routingenable.go b/email_routing/routingenable.go
new file mode 100644
index 00000000000..a8cbeb7a8d4
--- /dev/null
+++ b/email_routing/routingenable.go
@@ -0,0 +1,197 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package email_routing
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// RoutingEnableService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewRoutingEnableService] method
+// instead.
+type RoutingEnableService struct {
+ Options []option.RequestOption
+}
+
+// NewRoutingEnableService generates a new service that applies the given options
+// to each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewRoutingEnableService(opts ...option.RequestOption) (r *RoutingEnableService) {
+ r = &RoutingEnableService{}
+ r.Options = opts
+ return
+}
+
+// Enable you Email Routing zone. Add and lock the necessary MX and SPF records.
+func (r *RoutingEnableService) New(ctx context.Context, zoneIdentifier string, opts ...option.RequestOption) (res *RoutingEnableNewResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RoutingEnableNewResponseEnvelope
+ path := fmt.Sprintf("zones/%s/email/routing/enable", zoneIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type RoutingEnableNewResponse struct {
+ // Email Routing settings identifier.
+ ID string `json:"id"`
+ // The date and time the settings have been created.
+ Created time.Time `json:"created" format:"date-time"`
+ // State of the zone settings for Email Routing.
+ Enabled RoutingEnableNewResponseEnabled `json:"enabled"`
+ // The date and time the settings have been modified.
+ Modified time.Time `json:"modified" format:"date-time"`
+ // Domain of your zone.
+ Name string `json:"name"`
+ // Flag to check if the user skipped the configuration wizard.
+ SkipWizard RoutingEnableNewResponseSkipWizard `json:"skip_wizard"`
+ // Show the state of your account, and the type or configuration error.
+ Status RoutingEnableNewResponseStatus `json:"status"`
+ // Email Routing settings tag. (Deprecated, replaced by Email Routing settings
+ // identifier)
+ Tag string `json:"tag"`
+ JSON routingEnableNewResponseJSON `json:"-"`
+}
+
+// routingEnableNewResponseJSON contains the JSON metadata for the struct
+// [RoutingEnableNewResponse]
+type routingEnableNewResponseJSON struct {
+ ID apijson.Field
+ Created apijson.Field
+ Enabled apijson.Field
+ Modified apijson.Field
+ Name apijson.Field
+ SkipWizard apijson.Field
+ Status apijson.Field
+ Tag apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RoutingEnableNewResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routingEnableNewResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+// State of the zone settings for Email Routing.
+type RoutingEnableNewResponseEnabled bool
+
+const (
+ RoutingEnableNewResponseEnabledTrue RoutingEnableNewResponseEnabled = true
+ RoutingEnableNewResponseEnabledFalse RoutingEnableNewResponseEnabled = false
+)
+
+// Flag to check if the user skipped the configuration wizard.
+type RoutingEnableNewResponseSkipWizard bool
+
+const (
+ RoutingEnableNewResponseSkipWizardTrue RoutingEnableNewResponseSkipWizard = true
+ RoutingEnableNewResponseSkipWizardFalse RoutingEnableNewResponseSkipWizard = false
+)
+
+// Show the state of your account, and the type or configuration error.
+type RoutingEnableNewResponseStatus string
+
+const (
+ RoutingEnableNewResponseStatusReady RoutingEnableNewResponseStatus = "ready"
+ RoutingEnableNewResponseStatusUnconfigured RoutingEnableNewResponseStatus = "unconfigured"
+ RoutingEnableNewResponseStatusMisconfigured RoutingEnableNewResponseStatus = "misconfigured"
+ RoutingEnableNewResponseStatusMisconfiguredLocked RoutingEnableNewResponseStatus = "misconfigured/locked"
+ RoutingEnableNewResponseStatusUnlocked RoutingEnableNewResponseStatus = "unlocked"
+)
+
+type RoutingEnableNewResponseEnvelope struct {
+ Errors []RoutingEnableNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []RoutingEnableNewResponseEnvelopeMessages `json:"messages,required"`
+ Result RoutingEnableNewResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success RoutingEnableNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON routingEnableNewResponseEnvelopeJSON `json:"-"`
+}
+
+// routingEnableNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [RoutingEnableNewResponseEnvelope]
+type routingEnableNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RoutingEnableNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routingEnableNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type RoutingEnableNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON routingEnableNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// routingEnableNewResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [RoutingEnableNewResponseEnvelopeErrors]
+type routingEnableNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RoutingEnableNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routingEnableNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type RoutingEnableNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON routingEnableNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// routingEnableNewResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [RoutingEnableNewResponseEnvelopeMessages]
+type routingEnableNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RoutingEnableNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routingEnableNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type RoutingEnableNewResponseEnvelopeSuccess bool
+
+const (
+ RoutingEnableNewResponseEnvelopeSuccessTrue RoutingEnableNewResponseEnvelopeSuccess = true
+)
diff --git a/email_routing/routingenable_test.go b/email_routing/routingenable_test.go
new file mode 100644
index 00000000000..33646a828a9
--- /dev/null
+++ b/email_routing/routingenable_test.go
@@ -0,0 +1,38 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package email_routing_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestRoutingEnableNew(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"),
+ )
+ _, err := client.EmailRouting.Routing.Enables.New(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353")
+ 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/email_routing/routingrule.go b/email_routing/routingrule.go
new file mode 100644
index 00000000000..392a3029d64
--- /dev/null
+++ b/email_routing/routingrule.go
@@ -0,0 +1,1234 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package email_routing
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// RoutingRuleService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewRoutingRuleService] method
+// instead.
+type RoutingRuleService struct {
+ Options []option.RequestOption
+ CatchAlls *RoutingRuleCatchAllService
+}
+
+// NewRoutingRuleService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewRoutingRuleService(opts ...option.RequestOption) (r *RoutingRuleService) {
+ r = &RoutingRuleService{}
+ r.Options = opts
+ r.CatchAlls = NewRoutingRuleCatchAllService(opts...)
+ return
+}
+
+// Rules consist of a set of criteria for matching emails (such as an email being
+// sent to a specific custom email address) plus a set of actions to take on the
+// email (like forwarding it to a specific destination address).
+func (r *RoutingRuleService) New(ctx context.Context, zoneIdentifier string, body RoutingRuleNewParams, opts ...option.RequestOption) (res *RoutingRuleNewResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RoutingRuleNewResponseEnvelope
+ path := fmt.Sprintf("zones/%s/email/routing/rules", zoneIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Update actions and matches, or enable/disable specific routing rules.
+func (r *RoutingRuleService) Update(ctx context.Context, zoneIdentifier string, ruleIdentifier string, body RoutingRuleUpdateParams, opts ...option.RequestOption) (res *RoutingRuleUpdateResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RoutingRuleUpdateResponseEnvelope
+ path := fmt.Sprintf("zones/%s/email/routing/rules/%s", zoneIdentifier, ruleIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Lists existing routing rules.
+func (r *RoutingRuleService) List(ctx context.Context, zoneIdentifier string, query RoutingRuleListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[RoutingRuleListResponse], err error) {
+ var raw *http.Response
+ opts = append(r.Options, opts...)
+ opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
+ path := fmt.Sprintf("zones/%s/email/routing/rules", zoneIdentifier)
+ cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...)
+ if err != nil {
+ return nil, err
+ }
+ err = cfg.Execute()
+ if err != nil {
+ return nil, err
+ }
+ res.SetPageConfig(cfg, raw)
+ return res, nil
+}
+
+// Lists existing routing rules.
+func (r *RoutingRuleService) ListAutoPaging(ctx context.Context, zoneIdentifier string, query RoutingRuleListParams, opts ...option.RequestOption) *shared.V4PagePaginationArrayAutoPager[RoutingRuleListResponse] {
+ return shared.NewV4PagePaginationArrayAutoPager(r.List(ctx, zoneIdentifier, query, opts...))
+}
+
+// Delete a specific routing rule.
+func (r *RoutingRuleService) Delete(ctx context.Context, zoneIdentifier string, ruleIdentifier string, opts ...option.RequestOption) (res *RoutingRuleDeleteResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RoutingRuleDeleteResponseEnvelope
+ path := fmt.Sprintf("zones/%s/email/routing/rules/%s", zoneIdentifier, ruleIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Get information for a specific routing rule already created.
+func (r *RoutingRuleService) Get(ctx context.Context, zoneIdentifier string, ruleIdentifier string, opts ...option.RequestOption) (res *RoutingRuleGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RoutingRuleGetResponseEnvelope
+ path := fmt.Sprintf("zones/%s/email/routing/rules/%s", zoneIdentifier, ruleIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type RoutingRuleNewResponse struct {
+ // Routing rule identifier.
+ ID string `json:"id"`
+ // List actions patterns.
+ Actions []RoutingRuleNewResponseAction `json:"actions"`
+ // Routing rule status.
+ Enabled RoutingRuleNewResponseEnabled `json:"enabled"`
+ // Matching patterns to forward to your actions.
+ Matchers []RoutingRuleNewResponseMatcher `json:"matchers"`
+ // Routing rule name.
+ Name string `json:"name"`
+ // Priority of the routing rule.
+ Priority float64 `json:"priority"`
+ // Routing rule tag. (Deprecated, replaced by routing rule identifier)
+ Tag string `json:"tag"`
+ JSON routingRuleNewResponseJSON `json:"-"`
+}
+
+// routingRuleNewResponseJSON contains the JSON metadata for the struct
+// [RoutingRuleNewResponse]
+type routingRuleNewResponseJSON struct {
+ ID apijson.Field
+ Actions apijson.Field
+ Enabled apijson.Field
+ Matchers apijson.Field
+ Name apijson.Field
+ Priority apijson.Field
+ Tag apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RoutingRuleNewResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routingRuleNewResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+// Actions pattern.
+type RoutingRuleNewResponseAction struct {
+ // Type of supported action.
+ Type RoutingRuleNewResponseActionsType `json:"type,required"`
+ Value []string `json:"value,required"`
+ JSON routingRuleNewResponseActionJSON `json:"-"`
+}
+
+// routingRuleNewResponseActionJSON contains the JSON metadata for the struct
+// [RoutingRuleNewResponseAction]
+type routingRuleNewResponseActionJSON struct {
+ Type apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RoutingRuleNewResponseAction) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routingRuleNewResponseActionJSON) RawJSON() string {
+ return r.raw
+}
+
+// Type of supported action.
+type RoutingRuleNewResponseActionsType string
+
+const (
+ RoutingRuleNewResponseActionsTypeDrop RoutingRuleNewResponseActionsType = "drop"
+ RoutingRuleNewResponseActionsTypeForward RoutingRuleNewResponseActionsType = "forward"
+ RoutingRuleNewResponseActionsTypeWorker RoutingRuleNewResponseActionsType = "worker"
+)
+
+// Routing rule status.
+type RoutingRuleNewResponseEnabled bool
+
+const (
+ RoutingRuleNewResponseEnabledTrue RoutingRuleNewResponseEnabled = true
+ RoutingRuleNewResponseEnabledFalse RoutingRuleNewResponseEnabled = false
+)
+
+// Matching pattern to forward your actions.
+type RoutingRuleNewResponseMatcher struct {
+ // Field for type matcher.
+ Field RoutingRuleNewResponseMatchersField `json:"field,required"`
+ // Type of matcher.
+ Type RoutingRuleNewResponseMatchersType `json:"type,required"`
+ // Value for matcher.
+ Value string `json:"value,required"`
+ JSON routingRuleNewResponseMatcherJSON `json:"-"`
+}
+
+// routingRuleNewResponseMatcherJSON contains the JSON metadata for the struct
+// [RoutingRuleNewResponseMatcher]
+type routingRuleNewResponseMatcherJSON struct {
+ Field apijson.Field
+ Type apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RoutingRuleNewResponseMatcher) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routingRuleNewResponseMatcherJSON) RawJSON() string {
+ return r.raw
+}
+
+// Field for type matcher.
+type RoutingRuleNewResponseMatchersField string
+
+const (
+ RoutingRuleNewResponseMatchersFieldTo RoutingRuleNewResponseMatchersField = "to"
+)
+
+// Type of matcher.
+type RoutingRuleNewResponseMatchersType string
+
+const (
+ RoutingRuleNewResponseMatchersTypeLiteral RoutingRuleNewResponseMatchersType = "literal"
+)
+
+type RoutingRuleUpdateResponse struct {
+ // Routing rule identifier.
+ ID string `json:"id"`
+ // List actions patterns.
+ Actions []RoutingRuleUpdateResponseAction `json:"actions"`
+ // Routing rule status.
+ Enabled RoutingRuleUpdateResponseEnabled `json:"enabled"`
+ // Matching patterns to forward to your actions.
+ Matchers []RoutingRuleUpdateResponseMatcher `json:"matchers"`
+ // Routing rule name.
+ Name string `json:"name"`
+ // Priority of the routing rule.
+ Priority float64 `json:"priority"`
+ // Routing rule tag. (Deprecated, replaced by routing rule identifier)
+ Tag string `json:"tag"`
+ JSON routingRuleUpdateResponseJSON `json:"-"`
+}
+
+// routingRuleUpdateResponseJSON contains the JSON metadata for the struct
+// [RoutingRuleUpdateResponse]
+type routingRuleUpdateResponseJSON struct {
+ ID apijson.Field
+ Actions apijson.Field
+ Enabled apijson.Field
+ Matchers apijson.Field
+ Name apijson.Field
+ Priority apijson.Field
+ Tag apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RoutingRuleUpdateResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routingRuleUpdateResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+// Actions pattern.
+type RoutingRuleUpdateResponseAction struct {
+ // Type of supported action.
+ Type RoutingRuleUpdateResponseActionsType `json:"type,required"`
+ Value []string `json:"value,required"`
+ JSON routingRuleUpdateResponseActionJSON `json:"-"`
+}
+
+// routingRuleUpdateResponseActionJSON contains the JSON metadata for the struct
+// [RoutingRuleUpdateResponseAction]
+type routingRuleUpdateResponseActionJSON struct {
+ Type apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RoutingRuleUpdateResponseAction) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routingRuleUpdateResponseActionJSON) RawJSON() string {
+ return r.raw
+}
+
+// Type of supported action.
+type RoutingRuleUpdateResponseActionsType string
+
+const (
+ RoutingRuleUpdateResponseActionsTypeDrop RoutingRuleUpdateResponseActionsType = "drop"
+ RoutingRuleUpdateResponseActionsTypeForward RoutingRuleUpdateResponseActionsType = "forward"
+ RoutingRuleUpdateResponseActionsTypeWorker RoutingRuleUpdateResponseActionsType = "worker"
+)
+
+// Routing rule status.
+type RoutingRuleUpdateResponseEnabled bool
+
+const (
+ RoutingRuleUpdateResponseEnabledTrue RoutingRuleUpdateResponseEnabled = true
+ RoutingRuleUpdateResponseEnabledFalse RoutingRuleUpdateResponseEnabled = false
+)
+
+// Matching pattern to forward your actions.
+type RoutingRuleUpdateResponseMatcher struct {
+ // Field for type matcher.
+ Field RoutingRuleUpdateResponseMatchersField `json:"field,required"`
+ // Type of matcher.
+ Type RoutingRuleUpdateResponseMatchersType `json:"type,required"`
+ // Value for matcher.
+ Value string `json:"value,required"`
+ JSON routingRuleUpdateResponseMatcherJSON `json:"-"`
+}
+
+// routingRuleUpdateResponseMatcherJSON contains the JSON metadata for the struct
+// [RoutingRuleUpdateResponseMatcher]
+type routingRuleUpdateResponseMatcherJSON struct {
+ Field apijson.Field
+ Type apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RoutingRuleUpdateResponseMatcher) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routingRuleUpdateResponseMatcherJSON) RawJSON() string {
+ return r.raw
+}
+
+// Field for type matcher.
+type RoutingRuleUpdateResponseMatchersField string
+
+const (
+ RoutingRuleUpdateResponseMatchersFieldTo RoutingRuleUpdateResponseMatchersField = "to"
+)
+
+// Type of matcher.
+type RoutingRuleUpdateResponseMatchersType string
+
+const (
+ RoutingRuleUpdateResponseMatchersTypeLiteral RoutingRuleUpdateResponseMatchersType = "literal"
+)
+
+type RoutingRuleListResponse struct {
+ // Routing rule identifier.
+ ID string `json:"id"`
+ // List actions patterns.
+ Actions []RoutingRuleListResponseAction `json:"actions"`
+ // Routing rule status.
+ Enabled RoutingRuleListResponseEnabled `json:"enabled"`
+ // Matching patterns to forward to your actions.
+ Matchers []RoutingRuleListResponseMatcher `json:"matchers"`
+ // Routing rule name.
+ Name string `json:"name"`
+ // Priority of the routing rule.
+ Priority float64 `json:"priority"`
+ // Routing rule tag. (Deprecated, replaced by routing rule identifier)
+ Tag string `json:"tag"`
+ JSON routingRuleListResponseJSON `json:"-"`
+}
+
+// routingRuleListResponseJSON contains the JSON metadata for the struct
+// [RoutingRuleListResponse]
+type routingRuleListResponseJSON struct {
+ ID apijson.Field
+ Actions apijson.Field
+ Enabled apijson.Field
+ Matchers apijson.Field
+ Name apijson.Field
+ Priority apijson.Field
+ Tag apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RoutingRuleListResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routingRuleListResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+// Actions pattern.
+type RoutingRuleListResponseAction struct {
+ // Type of supported action.
+ Type RoutingRuleListResponseActionsType `json:"type,required"`
+ Value []string `json:"value,required"`
+ JSON routingRuleListResponseActionJSON `json:"-"`
+}
+
+// routingRuleListResponseActionJSON contains the JSON metadata for the struct
+// [RoutingRuleListResponseAction]
+type routingRuleListResponseActionJSON struct {
+ Type apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RoutingRuleListResponseAction) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routingRuleListResponseActionJSON) RawJSON() string {
+ return r.raw
+}
+
+// Type of supported action.
+type RoutingRuleListResponseActionsType string
+
+const (
+ RoutingRuleListResponseActionsTypeDrop RoutingRuleListResponseActionsType = "drop"
+ RoutingRuleListResponseActionsTypeForward RoutingRuleListResponseActionsType = "forward"
+ RoutingRuleListResponseActionsTypeWorker RoutingRuleListResponseActionsType = "worker"
+)
+
+// Routing rule status.
+type RoutingRuleListResponseEnabled bool
+
+const (
+ RoutingRuleListResponseEnabledTrue RoutingRuleListResponseEnabled = true
+ RoutingRuleListResponseEnabledFalse RoutingRuleListResponseEnabled = false
+)
+
+// Matching pattern to forward your actions.
+type RoutingRuleListResponseMatcher struct {
+ // Field for type matcher.
+ Field RoutingRuleListResponseMatchersField `json:"field,required"`
+ // Type of matcher.
+ Type RoutingRuleListResponseMatchersType `json:"type,required"`
+ // Value for matcher.
+ Value string `json:"value,required"`
+ JSON routingRuleListResponseMatcherJSON `json:"-"`
+}
+
+// routingRuleListResponseMatcherJSON contains the JSON metadata for the struct
+// [RoutingRuleListResponseMatcher]
+type routingRuleListResponseMatcherJSON struct {
+ Field apijson.Field
+ Type apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RoutingRuleListResponseMatcher) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routingRuleListResponseMatcherJSON) RawJSON() string {
+ return r.raw
+}
+
+// Field for type matcher.
+type RoutingRuleListResponseMatchersField string
+
+const (
+ RoutingRuleListResponseMatchersFieldTo RoutingRuleListResponseMatchersField = "to"
+)
+
+// Type of matcher.
+type RoutingRuleListResponseMatchersType string
+
+const (
+ RoutingRuleListResponseMatchersTypeLiteral RoutingRuleListResponseMatchersType = "literal"
+)
+
+type RoutingRuleDeleteResponse struct {
+ // Routing rule identifier.
+ ID string `json:"id"`
+ // List actions patterns.
+ Actions []RoutingRuleDeleteResponseAction `json:"actions"`
+ // Routing rule status.
+ Enabled RoutingRuleDeleteResponseEnabled `json:"enabled"`
+ // Matching patterns to forward to your actions.
+ Matchers []RoutingRuleDeleteResponseMatcher `json:"matchers"`
+ // Routing rule name.
+ Name string `json:"name"`
+ // Priority of the routing rule.
+ Priority float64 `json:"priority"`
+ // Routing rule tag. (Deprecated, replaced by routing rule identifier)
+ Tag string `json:"tag"`
+ JSON routingRuleDeleteResponseJSON `json:"-"`
+}
+
+// routingRuleDeleteResponseJSON contains the JSON metadata for the struct
+// [RoutingRuleDeleteResponse]
+type routingRuleDeleteResponseJSON struct {
+ ID apijson.Field
+ Actions apijson.Field
+ Enabled apijson.Field
+ Matchers apijson.Field
+ Name apijson.Field
+ Priority apijson.Field
+ Tag apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RoutingRuleDeleteResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routingRuleDeleteResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+// Actions pattern.
+type RoutingRuleDeleteResponseAction struct {
+ // Type of supported action.
+ Type RoutingRuleDeleteResponseActionsType `json:"type,required"`
+ Value []string `json:"value,required"`
+ JSON routingRuleDeleteResponseActionJSON `json:"-"`
+}
+
+// routingRuleDeleteResponseActionJSON contains the JSON metadata for the struct
+// [RoutingRuleDeleteResponseAction]
+type routingRuleDeleteResponseActionJSON struct {
+ Type apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RoutingRuleDeleteResponseAction) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routingRuleDeleteResponseActionJSON) RawJSON() string {
+ return r.raw
+}
+
+// Type of supported action.
+type RoutingRuleDeleteResponseActionsType string
+
+const (
+ RoutingRuleDeleteResponseActionsTypeDrop RoutingRuleDeleteResponseActionsType = "drop"
+ RoutingRuleDeleteResponseActionsTypeForward RoutingRuleDeleteResponseActionsType = "forward"
+ RoutingRuleDeleteResponseActionsTypeWorker RoutingRuleDeleteResponseActionsType = "worker"
+)
+
+// Routing rule status.
+type RoutingRuleDeleteResponseEnabled bool
+
+const (
+ RoutingRuleDeleteResponseEnabledTrue RoutingRuleDeleteResponseEnabled = true
+ RoutingRuleDeleteResponseEnabledFalse RoutingRuleDeleteResponseEnabled = false
+)
+
+// Matching pattern to forward your actions.
+type RoutingRuleDeleteResponseMatcher struct {
+ // Field for type matcher.
+ Field RoutingRuleDeleteResponseMatchersField `json:"field,required"`
+ // Type of matcher.
+ Type RoutingRuleDeleteResponseMatchersType `json:"type,required"`
+ // Value for matcher.
+ Value string `json:"value,required"`
+ JSON routingRuleDeleteResponseMatcherJSON `json:"-"`
+}
+
+// routingRuleDeleteResponseMatcherJSON contains the JSON metadata for the struct
+// [RoutingRuleDeleteResponseMatcher]
+type routingRuleDeleteResponseMatcherJSON struct {
+ Field apijson.Field
+ Type apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RoutingRuleDeleteResponseMatcher) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routingRuleDeleteResponseMatcherJSON) RawJSON() string {
+ return r.raw
+}
+
+// Field for type matcher.
+type RoutingRuleDeleteResponseMatchersField string
+
+const (
+ RoutingRuleDeleteResponseMatchersFieldTo RoutingRuleDeleteResponseMatchersField = "to"
+)
+
+// Type of matcher.
+type RoutingRuleDeleteResponseMatchersType string
+
+const (
+ RoutingRuleDeleteResponseMatchersTypeLiteral RoutingRuleDeleteResponseMatchersType = "literal"
+)
+
+type RoutingRuleGetResponse struct {
+ // Routing rule identifier.
+ ID string `json:"id"`
+ // List actions patterns.
+ Actions []RoutingRuleGetResponseAction `json:"actions"`
+ // Routing rule status.
+ Enabled RoutingRuleGetResponseEnabled `json:"enabled"`
+ // Matching patterns to forward to your actions.
+ Matchers []RoutingRuleGetResponseMatcher `json:"matchers"`
+ // Routing rule name.
+ Name string `json:"name"`
+ // Priority of the routing rule.
+ Priority float64 `json:"priority"`
+ // Routing rule tag. (Deprecated, replaced by routing rule identifier)
+ Tag string `json:"tag"`
+ JSON routingRuleGetResponseJSON `json:"-"`
+}
+
+// routingRuleGetResponseJSON contains the JSON metadata for the struct
+// [RoutingRuleGetResponse]
+type routingRuleGetResponseJSON struct {
+ ID apijson.Field
+ Actions apijson.Field
+ Enabled apijson.Field
+ Matchers apijson.Field
+ Name apijson.Field
+ Priority apijson.Field
+ Tag apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RoutingRuleGetResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routingRuleGetResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+// Actions pattern.
+type RoutingRuleGetResponseAction struct {
+ // Type of supported action.
+ Type RoutingRuleGetResponseActionsType `json:"type,required"`
+ Value []string `json:"value,required"`
+ JSON routingRuleGetResponseActionJSON `json:"-"`
+}
+
+// routingRuleGetResponseActionJSON contains the JSON metadata for the struct
+// [RoutingRuleGetResponseAction]
+type routingRuleGetResponseActionJSON struct {
+ Type apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RoutingRuleGetResponseAction) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routingRuleGetResponseActionJSON) RawJSON() string {
+ return r.raw
+}
+
+// Type of supported action.
+type RoutingRuleGetResponseActionsType string
+
+const (
+ RoutingRuleGetResponseActionsTypeDrop RoutingRuleGetResponseActionsType = "drop"
+ RoutingRuleGetResponseActionsTypeForward RoutingRuleGetResponseActionsType = "forward"
+ RoutingRuleGetResponseActionsTypeWorker RoutingRuleGetResponseActionsType = "worker"
+)
+
+// Routing rule status.
+type RoutingRuleGetResponseEnabled bool
+
+const (
+ RoutingRuleGetResponseEnabledTrue RoutingRuleGetResponseEnabled = true
+ RoutingRuleGetResponseEnabledFalse RoutingRuleGetResponseEnabled = false
+)
+
+// Matching pattern to forward your actions.
+type RoutingRuleGetResponseMatcher struct {
+ // Field for type matcher.
+ Field RoutingRuleGetResponseMatchersField `json:"field,required"`
+ // Type of matcher.
+ Type RoutingRuleGetResponseMatchersType `json:"type,required"`
+ // Value for matcher.
+ Value string `json:"value,required"`
+ JSON routingRuleGetResponseMatcherJSON `json:"-"`
+}
+
+// routingRuleGetResponseMatcherJSON contains the JSON metadata for the struct
+// [RoutingRuleGetResponseMatcher]
+type routingRuleGetResponseMatcherJSON struct {
+ Field apijson.Field
+ Type apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RoutingRuleGetResponseMatcher) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routingRuleGetResponseMatcherJSON) RawJSON() string {
+ return r.raw
+}
+
+// Field for type matcher.
+type RoutingRuleGetResponseMatchersField string
+
+const (
+ RoutingRuleGetResponseMatchersFieldTo RoutingRuleGetResponseMatchersField = "to"
+)
+
+// Type of matcher.
+type RoutingRuleGetResponseMatchersType string
+
+const (
+ RoutingRuleGetResponseMatchersTypeLiteral RoutingRuleGetResponseMatchersType = "literal"
+)
+
+type RoutingRuleNewParams struct {
+ // List actions patterns.
+ Actions param.Field[[]RoutingRuleNewParamsAction] `json:"actions,required"`
+ // Matching patterns to forward to your actions.
+ Matchers param.Field[[]RoutingRuleNewParamsMatcher] `json:"matchers,required"`
+ // Routing rule status.
+ Enabled param.Field[RoutingRuleNewParamsEnabled] `json:"enabled"`
+ // Routing rule name.
+ Name param.Field[string] `json:"name"`
+ // Priority of the routing rule.
+ Priority param.Field[float64] `json:"priority"`
+}
+
+func (r RoutingRuleNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Actions pattern.
+type RoutingRuleNewParamsAction struct {
+ // Type of supported action.
+ Type param.Field[RoutingRuleNewParamsActionsType] `json:"type,required"`
+ Value param.Field[[]string] `json:"value,required"`
+}
+
+func (r RoutingRuleNewParamsAction) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Type of supported action.
+type RoutingRuleNewParamsActionsType string
+
+const (
+ RoutingRuleNewParamsActionsTypeDrop RoutingRuleNewParamsActionsType = "drop"
+ RoutingRuleNewParamsActionsTypeForward RoutingRuleNewParamsActionsType = "forward"
+ RoutingRuleNewParamsActionsTypeWorker RoutingRuleNewParamsActionsType = "worker"
+)
+
+// Matching pattern to forward your actions.
+type RoutingRuleNewParamsMatcher struct {
+ // Field for type matcher.
+ Field param.Field[RoutingRuleNewParamsMatchersField] `json:"field,required"`
+ // Type of matcher.
+ Type param.Field[RoutingRuleNewParamsMatchersType] `json:"type,required"`
+ // Value for matcher.
+ Value param.Field[string] `json:"value,required"`
+}
+
+func (r RoutingRuleNewParamsMatcher) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Field for type matcher.
+type RoutingRuleNewParamsMatchersField string
+
+const (
+ RoutingRuleNewParamsMatchersFieldTo RoutingRuleNewParamsMatchersField = "to"
+)
+
+// Type of matcher.
+type RoutingRuleNewParamsMatchersType string
+
+const (
+ RoutingRuleNewParamsMatchersTypeLiteral RoutingRuleNewParamsMatchersType = "literal"
+)
+
+// Routing rule status.
+type RoutingRuleNewParamsEnabled bool
+
+const (
+ RoutingRuleNewParamsEnabledTrue RoutingRuleNewParamsEnabled = true
+ RoutingRuleNewParamsEnabledFalse RoutingRuleNewParamsEnabled = false
+)
+
+type RoutingRuleNewResponseEnvelope struct {
+ Errors []RoutingRuleNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []RoutingRuleNewResponseEnvelopeMessages `json:"messages,required"`
+ Result RoutingRuleNewResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success RoutingRuleNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON routingRuleNewResponseEnvelopeJSON `json:"-"`
+}
+
+// routingRuleNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [RoutingRuleNewResponseEnvelope]
+type routingRuleNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RoutingRuleNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routingRuleNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type RoutingRuleNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON routingRuleNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// routingRuleNewResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [RoutingRuleNewResponseEnvelopeErrors]
+type routingRuleNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RoutingRuleNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routingRuleNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type RoutingRuleNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON routingRuleNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// routingRuleNewResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [RoutingRuleNewResponseEnvelopeMessages]
+type routingRuleNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RoutingRuleNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routingRuleNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type RoutingRuleNewResponseEnvelopeSuccess bool
+
+const (
+ RoutingRuleNewResponseEnvelopeSuccessTrue RoutingRuleNewResponseEnvelopeSuccess = true
+)
+
+type RoutingRuleUpdateParams struct {
+ // List actions patterns.
+ Actions param.Field[[]RoutingRuleUpdateParamsAction] `json:"actions,required"`
+ // Matching patterns to forward to your actions.
+ Matchers param.Field[[]RoutingRuleUpdateParamsMatcher] `json:"matchers,required"`
+ // Routing rule status.
+ Enabled param.Field[RoutingRuleUpdateParamsEnabled] `json:"enabled"`
+ // Routing rule name.
+ Name param.Field[string] `json:"name"`
+ // Priority of the routing rule.
+ Priority param.Field[float64] `json:"priority"`
+}
+
+func (r RoutingRuleUpdateParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Actions pattern.
+type RoutingRuleUpdateParamsAction struct {
+ // Type of supported action.
+ Type param.Field[RoutingRuleUpdateParamsActionsType] `json:"type,required"`
+ Value param.Field[[]string] `json:"value,required"`
+}
+
+func (r RoutingRuleUpdateParamsAction) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Type of supported action.
+type RoutingRuleUpdateParamsActionsType string
+
+const (
+ RoutingRuleUpdateParamsActionsTypeDrop RoutingRuleUpdateParamsActionsType = "drop"
+ RoutingRuleUpdateParamsActionsTypeForward RoutingRuleUpdateParamsActionsType = "forward"
+ RoutingRuleUpdateParamsActionsTypeWorker RoutingRuleUpdateParamsActionsType = "worker"
+)
+
+// Matching pattern to forward your actions.
+type RoutingRuleUpdateParamsMatcher struct {
+ // Field for type matcher.
+ Field param.Field[RoutingRuleUpdateParamsMatchersField] `json:"field,required"`
+ // Type of matcher.
+ Type param.Field[RoutingRuleUpdateParamsMatchersType] `json:"type,required"`
+ // Value for matcher.
+ Value param.Field[string] `json:"value,required"`
+}
+
+func (r RoutingRuleUpdateParamsMatcher) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Field for type matcher.
+type RoutingRuleUpdateParamsMatchersField string
+
+const (
+ RoutingRuleUpdateParamsMatchersFieldTo RoutingRuleUpdateParamsMatchersField = "to"
+)
+
+// Type of matcher.
+type RoutingRuleUpdateParamsMatchersType string
+
+const (
+ RoutingRuleUpdateParamsMatchersTypeLiteral RoutingRuleUpdateParamsMatchersType = "literal"
+)
+
+// Routing rule status.
+type RoutingRuleUpdateParamsEnabled bool
+
+const (
+ RoutingRuleUpdateParamsEnabledTrue RoutingRuleUpdateParamsEnabled = true
+ RoutingRuleUpdateParamsEnabledFalse RoutingRuleUpdateParamsEnabled = false
+)
+
+type RoutingRuleUpdateResponseEnvelope struct {
+ Errors []RoutingRuleUpdateResponseEnvelopeErrors `json:"errors,required"`
+ Messages []RoutingRuleUpdateResponseEnvelopeMessages `json:"messages,required"`
+ Result RoutingRuleUpdateResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success RoutingRuleUpdateResponseEnvelopeSuccess `json:"success,required"`
+ JSON routingRuleUpdateResponseEnvelopeJSON `json:"-"`
+}
+
+// routingRuleUpdateResponseEnvelopeJSON contains the JSON metadata for the struct
+// [RoutingRuleUpdateResponseEnvelope]
+type routingRuleUpdateResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RoutingRuleUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routingRuleUpdateResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type RoutingRuleUpdateResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON routingRuleUpdateResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// routingRuleUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [RoutingRuleUpdateResponseEnvelopeErrors]
+type routingRuleUpdateResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RoutingRuleUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routingRuleUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type RoutingRuleUpdateResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON routingRuleUpdateResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// routingRuleUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [RoutingRuleUpdateResponseEnvelopeMessages]
+type routingRuleUpdateResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RoutingRuleUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routingRuleUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type RoutingRuleUpdateResponseEnvelopeSuccess bool
+
+const (
+ RoutingRuleUpdateResponseEnvelopeSuccessTrue RoutingRuleUpdateResponseEnvelopeSuccess = true
+)
+
+type RoutingRuleListParams struct {
+ // Filter by enabled routing rules.
+ Enabled param.Field[RoutingRuleListParamsEnabled] `query:"enabled"`
+ // Page number of paginated results.
+ Page param.Field[float64] `query:"page"`
+ // Maximum number of results per page.
+ PerPage param.Field[float64] `query:"per_page"`
+}
+
+// URLQuery serializes [RoutingRuleListParams]'s query parameters as `url.Values`.
+func (r RoutingRuleListParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Filter by enabled routing rules.
+type RoutingRuleListParamsEnabled bool
+
+const (
+ RoutingRuleListParamsEnabledTrue RoutingRuleListParamsEnabled = true
+ RoutingRuleListParamsEnabledFalse RoutingRuleListParamsEnabled = false
+)
+
+type RoutingRuleDeleteResponseEnvelope struct {
+ Errors []RoutingRuleDeleteResponseEnvelopeErrors `json:"errors,required"`
+ Messages []RoutingRuleDeleteResponseEnvelopeMessages `json:"messages,required"`
+ Result RoutingRuleDeleteResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success RoutingRuleDeleteResponseEnvelopeSuccess `json:"success,required"`
+ JSON routingRuleDeleteResponseEnvelopeJSON `json:"-"`
+}
+
+// routingRuleDeleteResponseEnvelopeJSON contains the JSON metadata for the struct
+// [RoutingRuleDeleteResponseEnvelope]
+type routingRuleDeleteResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RoutingRuleDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routingRuleDeleteResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type RoutingRuleDeleteResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON routingRuleDeleteResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// routingRuleDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [RoutingRuleDeleteResponseEnvelopeErrors]
+type routingRuleDeleteResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RoutingRuleDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routingRuleDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type RoutingRuleDeleteResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON routingRuleDeleteResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// routingRuleDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [RoutingRuleDeleteResponseEnvelopeMessages]
+type routingRuleDeleteResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RoutingRuleDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routingRuleDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type RoutingRuleDeleteResponseEnvelopeSuccess bool
+
+const (
+ RoutingRuleDeleteResponseEnvelopeSuccessTrue RoutingRuleDeleteResponseEnvelopeSuccess = true
+)
+
+type RoutingRuleGetResponseEnvelope struct {
+ Errors []RoutingRuleGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []RoutingRuleGetResponseEnvelopeMessages `json:"messages,required"`
+ Result RoutingRuleGetResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success RoutingRuleGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON routingRuleGetResponseEnvelopeJSON `json:"-"`
+}
+
+// routingRuleGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [RoutingRuleGetResponseEnvelope]
+type routingRuleGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RoutingRuleGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routingRuleGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type RoutingRuleGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON routingRuleGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// routingRuleGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [RoutingRuleGetResponseEnvelopeErrors]
+type routingRuleGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RoutingRuleGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routingRuleGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type RoutingRuleGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON routingRuleGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// routingRuleGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [RoutingRuleGetResponseEnvelopeMessages]
+type routingRuleGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RoutingRuleGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routingRuleGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type RoutingRuleGetResponseEnvelopeSuccess bool
+
+const (
+ RoutingRuleGetResponseEnvelopeSuccessTrue RoutingRuleGetResponseEnvelopeSuccess = true
+)
diff --git a/email_routing/routingrule_test.go b/email_routing/routingrule_test.go
new file mode 100644
index 00000000000..405b2cf49ac
--- /dev/null
+++ b/email_routing/routingrule_test.go
@@ -0,0 +1,214 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package email_routing_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/email_routing"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestRoutingRuleNewWithOptionalParams(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"),
+ )
+ _, err := client.EmailRouting.Routing.Rules.New(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ email_routing.RoutingRuleNewParams{
+ Actions: cloudflare.F([]email_routing.RoutingRuleNewParamsAction{{
+ Type: cloudflare.F(email_routing.RoutingRuleNewParamsActionsTypeForward),
+ Value: cloudflare.F([]string{"destinationaddress@example.net", "destinationaddress@example.net", "destinationaddress@example.net"}),
+ }, {
+ Type: cloudflare.F(email_routing.RoutingRuleNewParamsActionsTypeForward),
+ Value: cloudflare.F([]string{"destinationaddress@example.net", "destinationaddress@example.net", "destinationaddress@example.net"}),
+ }, {
+ Type: cloudflare.F(email_routing.RoutingRuleNewParamsActionsTypeForward),
+ Value: cloudflare.F([]string{"destinationaddress@example.net", "destinationaddress@example.net", "destinationaddress@example.net"}),
+ }}),
+ Matchers: cloudflare.F([]email_routing.RoutingRuleNewParamsMatcher{{
+ Field: cloudflare.F(email_routing.RoutingRuleNewParamsMatchersFieldTo),
+ Type: cloudflare.F(email_routing.RoutingRuleNewParamsMatchersTypeLiteral),
+ Value: cloudflare.F("test@example.com"),
+ }, {
+ Field: cloudflare.F(email_routing.RoutingRuleNewParamsMatchersFieldTo),
+ Type: cloudflare.F(email_routing.RoutingRuleNewParamsMatchersTypeLiteral),
+ Value: cloudflare.F("test@example.com"),
+ }, {
+ Field: cloudflare.F(email_routing.RoutingRuleNewParamsMatchersFieldTo),
+ Type: cloudflare.F(email_routing.RoutingRuleNewParamsMatchersTypeLiteral),
+ Value: cloudflare.F("test@example.com"),
+ }}),
+ Enabled: cloudflare.F(email_routing.RoutingRuleNewParamsEnabledTrue),
+ Name: cloudflare.F("Send to user@example.net rule."),
+ Priority: cloudflare.F(0.000000),
+ },
+ )
+ 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())
+ }
+}
+
+func TestRoutingRuleUpdateWithOptionalParams(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"),
+ )
+ _, err := client.EmailRouting.Routing.Rules.Update(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ "a7e6fb77503c41d8a7f3113c6918f10c",
+ email_routing.RoutingRuleUpdateParams{
+ Actions: cloudflare.F([]email_routing.RoutingRuleUpdateParamsAction{{
+ Type: cloudflare.F(email_routing.RoutingRuleUpdateParamsActionsTypeForward),
+ Value: cloudflare.F([]string{"destinationaddress@example.net", "destinationaddress@example.net", "destinationaddress@example.net"}),
+ }, {
+ Type: cloudflare.F(email_routing.RoutingRuleUpdateParamsActionsTypeForward),
+ Value: cloudflare.F([]string{"destinationaddress@example.net", "destinationaddress@example.net", "destinationaddress@example.net"}),
+ }, {
+ Type: cloudflare.F(email_routing.RoutingRuleUpdateParamsActionsTypeForward),
+ Value: cloudflare.F([]string{"destinationaddress@example.net", "destinationaddress@example.net", "destinationaddress@example.net"}),
+ }}),
+ Matchers: cloudflare.F([]email_routing.RoutingRuleUpdateParamsMatcher{{
+ Field: cloudflare.F(email_routing.RoutingRuleUpdateParamsMatchersFieldTo),
+ Type: cloudflare.F(email_routing.RoutingRuleUpdateParamsMatchersTypeLiteral),
+ Value: cloudflare.F("test@example.com"),
+ }, {
+ Field: cloudflare.F(email_routing.RoutingRuleUpdateParamsMatchersFieldTo),
+ Type: cloudflare.F(email_routing.RoutingRuleUpdateParamsMatchersTypeLiteral),
+ Value: cloudflare.F("test@example.com"),
+ }, {
+ Field: cloudflare.F(email_routing.RoutingRuleUpdateParamsMatchersFieldTo),
+ Type: cloudflare.F(email_routing.RoutingRuleUpdateParamsMatchersTypeLiteral),
+ Value: cloudflare.F("test@example.com"),
+ }}),
+ Enabled: cloudflare.F(email_routing.RoutingRuleUpdateParamsEnabledTrue),
+ Name: cloudflare.F("Send to user@example.net rule."),
+ Priority: cloudflare.F(0.000000),
+ },
+ )
+ 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())
+ }
+}
+
+func TestRoutingRuleListWithOptionalParams(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"),
+ )
+ _, err := client.EmailRouting.Routing.Rules.List(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ email_routing.RoutingRuleListParams{
+ Enabled: cloudflare.F(email_routing.RoutingRuleListParamsEnabledTrue),
+ Page: cloudflare.F(1.000000),
+ PerPage: cloudflare.F(5.000000),
+ },
+ )
+ 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())
+ }
+}
+
+func TestRoutingRuleDelete(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"),
+ )
+ _, err := client.EmailRouting.Routing.Rules.Delete(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ "a7e6fb77503c41d8a7f3113c6918f10c",
+ )
+ 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())
+ }
+}
+
+func TestRoutingRuleGet(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"),
+ )
+ _, err := client.EmailRouting.Routing.Rules.Get(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ "a7e6fb77503c41d8a7f3113c6918f10c",
+ )
+ 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/email_routing/routingrulecatchall.go b/email_routing/routingrulecatchall.go
new file mode 100644
index 00000000000..d5af910a6f4
--- /dev/null
+++ b/email_routing/routingrulecatchall.go
@@ -0,0 +1,390 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package email_routing
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// RoutingRuleCatchAllService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewRoutingRuleCatchAllService]
+// method instead.
+type RoutingRuleCatchAllService struct {
+ Options []option.RequestOption
+}
+
+// NewRoutingRuleCatchAllService generates a new service that applies the given
+// options to each request. These options are applied after the parent client's
+// options (if there is one), and before any request-specific options.
+func NewRoutingRuleCatchAllService(opts ...option.RequestOption) (r *RoutingRuleCatchAllService) {
+ r = &RoutingRuleCatchAllService{}
+ r.Options = opts
+ return
+}
+
+// Enable or disable catch-all routing rule, or change action to forward to
+// specific destination address.
+func (r *RoutingRuleCatchAllService) Update(ctx context.Context, zoneIdentifier string, body RoutingRuleCatchAllUpdateParams, opts ...option.RequestOption) (res *EmailCatchAllRule, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RoutingRuleCatchAllUpdateResponseEnvelope
+ path := fmt.Sprintf("zones/%s/email/routing/rules/catch_all", zoneIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Get information on the default catch-all routing rule.
+func (r *RoutingRuleCatchAllService) Get(ctx context.Context, zoneIdentifier string, opts ...option.RequestOption) (res *EmailCatchAllRule, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RoutingRuleCatchAllGetResponseEnvelope
+ path := fmt.Sprintf("zones/%s/email/routing/rules/catch_all", zoneIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type EmailCatchAllRule struct {
+ // Routing rule identifier.
+ ID string `json:"id"`
+ // List actions for the catch-all routing rule.
+ Actions []EmailCatchAllRuleAction `json:"actions"`
+ // Routing rule status.
+ Enabled EmailCatchAllRuleEnabled `json:"enabled"`
+ // List of matchers for the catch-all routing rule.
+ Matchers []EmailCatchAllRuleMatcher `json:"matchers"`
+ // Routing rule name.
+ Name string `json:"name"`
+ // Routing rule tag. (Deprecated, replaced by routing rule identifier)
+ Tag string `json:"tag"`
+ JSON emailCatchAllRuleJSON `json:"-"`
+}
+
+// emailCatchAllRuleJSON contains the JSON metadata for the struct
+// [EmailCatchAllRule]
+type emailCatchAllRuleJSON struct {
+ ID apijson.Field
+ Actions apijson.Field
+ Enabled apijson.Field
+ Matchers apijson.Field
+ Name apijson.Field
+ Tag apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailCatchAllRule) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailCatchAllRuleJSON) RawJSON() string {
+ return r.raw
+}
+
+// Action for the catch-all routing rule.
+type EmailCatchAllRuleAction struct {
+ // Type of action for catch-all rule.
+ Type EmailCatchAllRuleActionsType `json:"type,required"`
+ Value []string `json:"value"`
+ JSON emailCatchAllRuleActionJSON `json:"-"`
+}
+
+// emailCatchAllRuleActionJSON contains the JSON metadata for the struct
+// [EmailCatchAllRuleAction]
+type emailCatchAllRuleActionJSON struct {
+ Type apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailCatchAllRuleAction) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailCatchAllRuleActionJSON) RawJSON() string {
+ return r.raw
+}
+
+// Type of action for catch-all rule.
+type EmailCatchAllRuleActionsType string
+
+const (
+ EmailCatchAllRuleActionsTypeDrop EmailCatchAllRuleActionsType = "drop"
+ EmailCatchAllRuleActionsTypeForward EmailCatchAllRuleActionsType = "forward"
+ EmailCatchAllRuleActionsTypeWorker EmailCatchAllRuleActionsType = "worker"
+)
+
+// Routing rule status.
+type EmailCatchAllRuleEnabled bool
+
+const (
+ EmailCatchAllRuleEnabledTrue EmailCatchAllRuleEnabled = true
+ EmailCatchAllRuleEnabledFalse EmailCatchAllRuleEnabled = false
+)
+
+// Matcher for catch-all routing rule.
+type EmailCatchAllRuleMatcher struct {
+ // Type of matcher. Default is 'all'.
+ Type EmailCatchAllRuleMatchersType `json:"type,required"`
+ JSON emailCatchAllRuleMatcherJSON `json:"-"`
+}
+
+// emailCatchAllRuleMatcherJSON contains the JSON metadata for the struct
+// [EmailCatchAllRuleMatcher]
+type emailCatchAllRuleMatcherJSON struct {
+ Type apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailCatchAllRuleMatcher) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailCatchAllRuleMatcherJSON) RawJSON() string {
+ return r.raw
+}
+
+// Type of matcher. Default is 'all'.
+type EmailCatchAllRuleMatchersType string
+
+const (
+ EmailCatchAllRuleMatchersTypeAll EmailCatchAllRuleMatchersType = "all"
+)
+
+type RoutingRuleCatchAllUpdateParams struct {
+ // List actions for the catch-all routing rule.
+ Actions param.Field[[]RoutingRuleCatchAllUpdateParamsAction] `json:"actions,required"`
+ // List of matchers for the catch-all routing rule.
+ Matchers param.Field[[]RoutingRuleCatchAllUpdateParamsMatcher] `json:"matchers,required"`
+ // Routing rule status.
+ Enabled param.Field[RoutingRuleCatchAllUpdateParamsEnabled] `json:"enabled"`
+ // Routing rule name.
+ Name param.Field[string] `json:"name"`
+}
+
+func (r RoutingRuleCatchAllUpdateParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Action for the catch-all routing rule.
+type RoutingRuleCatchAllUpdateParamsAction struct {
+ // Type of action for catch-all rule.
+ Type param.Field[RoutingRuleCatchAllUpdateParamsActionsType] `json:"type,required"`
+ Value param.Field[[]string] `json:"value"`
+}
+
+func (r RoutingRuleCatchAllUpdateParamsAction) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Type of action for catch-all rule.
+type RoutingRuleCatchAllUpdateParamsActionsType string
+
+const (
+ RoutingRuleCatchAllUpdateParamsActionsTypeDrop RoutingRuleCatchAllUpdateParamsActionsType = "drop"
+ RoutingRuleCatchAllUpdateParamsActionsTypeForward RoutingRuleCatchAllUpdateParamsActionsType = "forward"
+ RoutingRuleCatchAllUpdateParamsActionsTypeWorker RoutingRuleCatchAllUpdateParamsActionsType = "worker"
+)
+
+// Matcher for catch-all routing rule.
+type RoutingRuleCatchAllUpdateParamsMatcher struct {
+ // Type of matcher. Default is 'all'.
+ Type param.Field[RoutingRuleCatchAllUpdateParamsMatchersType] `json:"type,required"`
+}
+
+func (r RoutingRuleCatchAllUpdateParamsMatcher) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Type of matcher. Default is 'all'.
+type RoutingRuleCatchAllUpdateParamsMatchersType string
+
+const (
+ RoutingRuleCatchAllUpdateParamsMatchersTypeAll RoutingRuleCatchAllUpdateParamsMatchersType = "all"
+)
+
+// Routing rule status.
+type RoutingRuleCatchAllUpdateParamsEnabled bool
+
+const (
+ RoutingRuleCatchAllUpdateParamsEnabledTrue RoutingRuleCatchAllUpdateParamsEnabled = true
+ RoutingRuleCatchAllUpdateParamsEnabledFalse RoutingRuleCatchAllUpdateParamsEnabled = false
+)
+
+type RoutingRuleCatchAllUpdateResponseEnvelope struct {
+ Errors []RoutingRuleCatchAllUpdateResponseEnvelopeErrors `json:"errors,required"`
+ Messages []RoutingRuleCatchAllUpdateResponseEnvelopeMessages `json:"messages,required"`
+ Result EmailCatchAllRule `json:"result,required"`
+ // Whether the API call was successful
+ Success RoutingRuleCatchAllUpdateResponseEnvelopeSuccess `json:"success,required"`
+ JSON routingRuleCatchAllUpdateResponseEnvelopeJSON `json:"-"`
+}
+
+// routingRuleCatchAllUpdateResponseEnvelopeJSON contains the JSON metadata for the
+// struct [RoutingRuleCatchAllUpdateResponseEnvelope]
+type routingRuleCatchAllUpdateResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RoutingRuleCatchAllUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routingRuleCatchAllUpdateResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type RoutingRuleCatchAllUpdateResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON routingRuleCatchAllUpdateResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// routingRuleCatchAllUpdateResponseEnvelopeErrorsJSON contains the JSON metadata
+// for the struct [RoutingRuleCatchAllUpdateResponseEnvelopeErrors]
+type routingRuleCatchAllUpdateResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RoutingRuleCatchAllUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routingRuleCatchAllUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type RoutingRuleCatchAllUpdateResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON routingRuleCatchAllUpdateResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// routingRuleCatchAllUpdateResponseEnvelopeMessagesJSON contains the JSON metadata
+// for the struct [RoutingRuleCatchAllUpdateResponseEnvelopeMessages]
+type routingRuleCatchAllUpdateResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RoutingRuleCatchAllUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routingRuleCatchAllUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type RoutingRuleCatchAllUpdateResponseEnvelopeSuccess bool
+
+const (
+ RoutingRuleCatchAllUpdateResponseEnvelopeSuccessTrue RoutingRuleCatchAllUpdateResponseEnvelopeSuccess = true
+)
+
+type RoutingRuleCatchAllGetResponseEnvelope struct {
+ Errors []RoutingRuleCatchAllGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []RoutingRuleCatchAllGetResponseEnvelopeMessages `json:"messages,required"`
+ Result EmailCatchAllRule `json:"result,required"`
+ // Whether the API call was successful
+ Success RoutingRuleCatchAllGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON routingRuleCatchAllGetResponseEnvelopeJSON `json:"-"`
+}
+
+// routingRuleCatchAllGetResponseEnvelopeJSON contains the JSON metadata for the
+// struct [RoutingRuleCatchAllGetResponseEnvelope]
+type routingRuleCatchAllGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RoutingRuleCatchAllGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routingRuleCatchAllGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type RoutingRuleCatchAllGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON routingRuleCatchAllGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// routingRuleCatchAllGetResponseEnvelopeErrorsJSON contains the JSON metadata for
+// the struct [RoutingRuleCatchAllGetResponseEnvelopeErrors]
+type routingRuleCatchAllGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RoutingRuleCatchAllGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routingRuleCatchAllGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type RoutingRuleCatchAllGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON routingRuleCatchAllGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// routingRuleCatchAllGetResponseEnvelopeMessagesJSON contains the JSON metadata
+// for the struct [RoutingRuleCatchAllGetResponseEnvelopeMessages]
+type routingRuleCatchAllGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RoutingRuleCatchAllGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routingRuleCatchAllGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type RoutingRuleCatchAllGetResponseEnvelopeSuccess bool
+
+const (
+ RoutingRuleCatchAllGetResponseEnvelopeSuccessTrue RoutingRuleCatchAllGetResponseEnvelopeSuccess = true
+)
diff --git a/email_routing/routingrulecatchall_test.go b/email_routing/routingrulecatchall_test.go
new file mode 100644
index 00000000000..b3d46bc1036
--- /dev/null
+++ b/email_routing/routingrulecatchall_test.go
@@ -0,0 +1,87 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package email_routing_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/email_routing"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestRoutingRuleCatchAllUpdateWithOptionalParams(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"),
+ )
+ _, err := client.EmailRouting.Routing.Rules.CatchAlls.Update(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ email_routing.RoutingRuleCatchAllUpdateParams{
+ Actions: cloudflare.F([]email_routing.RoutingRuleCatchAllUpdateParamsAction{{
+ Type: cloudflare.F(email_routing.RoutingRuleCatchAllUpdateParamsActionsTypeForward),
+ Value: cloudflare.F([]string{"destinationaddress@example.net", "destinationaddress@example.net", "destinationaddress@example.net"}),
+ }, {
+ Type: cloudflare.F(email_routing.RoutingRuleCatchAllUpdateParamsActionsTypeForward),
+ Value: cloudflare.F([]string{"destinationaddress@example.net", "destinationaddress@example.net", "destinationaddress@example.net"}),
+ }, {
+ Type: cloudflare.F(email_routing.RoutingRuleCatchAllUpdateParamsActionsTypeForward),
+ Value: cloudflare.F([]string{"destinationaddress@example.net", "destinationaddress@example.net", "destinationaddress@example.net"}),
+ }}),
+ Matchers: cloudflare.F([]email_routing.RoutingRuleCatchAllUpdateParamsMatcher{{
+ Type: cloudflare.F(email_routing.RoutingRuleCatchAllUpdateParamsMatchersTypeAll),
+ }, {
+ Type: cloudflare.F(email_routing.RoutingRuleCatchAllUpdateParamsMatchersTypeAll),
+ }, {
+ Type: cloudflare.F(email_routing.RoutingRuleCatchAllUpdateParamsMatchersTypeAll),
+ }}),
+ Enabled: cloudflare.F(email_routing.RoutingRuleCatchAllUpdateParamsEnabledTrue),
+ Name: cloudflare.F("Send to user@example.net rule."),
+ },
+ )
+ 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())
+ }
+}
+
+func TestRoutingRuleCatchAllGet(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"),
+ )
+ _, err := client.EmailRouting.Routing.Rules.CatchAlls.Get(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353")
+ 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/emailrouting.go b/emailrouting.go
deleted file mode 100644
index ed4bddd4fe0..00000000000
--- a/emailrouting.go
+++ /dev/null
@@ -1,27 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// EmailRoutingService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewEmailRoutingService] method
-// instead.
-type EmailRoutingService struct {
- Options []option.RequestOption
- Routing *EmailRoutingRoutingService
-}
-
-// NewEmailRoutingService generates a new service that applies the given options to
-// each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewEmailRoutingService(opts ...option.RequestOption) (r *EmailRoutingService) {
- r = &EmailRoutingService{}
- r.Options = opts
- r.Routing = NewEmailRoutingRoutingService(opts...)
- return
-}
diff --git a/emailroutingrouting.go b/emailroutingrouting.go
deleted file mode 100644
index a0bdad6cd2d..00000000000
--- a/emailroutingrouting.go
+++ /dev/null
@@ -1,207 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// EmailRoutingRoutingService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewEmailRoutingRoutingService]
-// method instead.
-type EmailRoutingRoutingService struct {
- Options []option.RequestOption
- Disables *EmailRoutingRoutingDisableService
- DNS *EmailRoutingRoutingDNSService
- Enables *EmailRoutingRoutingEnableService
- Rules *EmailRoutingRoutingRuleService
- Addresses *EmailRoutingRoutingAddressService
-}
-
-// NewEmailRoutingRoutingService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewEmailRoutingRoutingService(opts ...option.RequestOption) (r *EmailRoutingRoutingService) {
- r = &EmailRoutingRoutingService{}
- r.Options = opts
- r.Disables = NewEmailRoutingRoutingDisableService(opts...)
- r.DNS = NewEmailRoutingRoutingDNSService(opts...)
- r.Enables = NewEmailRoutingRoutingEnableService(opts...)
- r.Rules = NewEmailRoutingRoutingRuleService(opts...)
- r.Addresses = NewEmailRoutingRoutingAddressService(opts...)
- return
-}
-
-// Get information about the settings for your Email Routing zone.
-func (r *EmailRoutingRoutingService) Get(ctx context.Context, zoneIdentifier string, opts ...option.RequestOption) (res *EmailRoutingRoutingGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env EmailRoutingRoutingGetResponseEnvelope
- path := fmt.Sprintf("zones/%s/email/routing", zoneIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type EmailRoutingRoutingGetResponse struct {
- // Email Routing settings identifier.
- ID string `json:"id"`
- // The date and time the settings have been created.
- Created time.Time `json:"created" format:"date-time"`
- // State of the zone settings for Email Routing.
- Enabled EmailRoutingRoutingGetResponseEnabled `json:"enabled"`
- // The date and time the settings have been modified.
- Modified time.Time `json:"modified" format:"date-time"`
- // Domain of your zone.
- Name string `json:"name"`
- // Flag to check if the user skipped the configuration wizard.
- SkipWizard EmailRoutingRoutingGetResponseSkipWizard `json:"skip_wizard"`
- // Show the state of your account, and the type or configuration error.
- Status EmailRoutingRoutingGetResponseStatus `json:"status"`
- // Email Routing settings tag. (Deprecated, replaced by Email Routing settings
- // identifier)
- Tag string `json:"tag"`
- JSON emailRoutingRoutingGetResponseJSON `json:"-"`
-}
-
-// emailRoutingRoutingGetResponseJSON contains the JSON metadata for the struct
-// [EmailRoutingRoutingGetResponse]
-type emailRoutingRoutingGetResponseJSON struct {
- ID apijson.Field
- Created apijson.Field
- Enabled apijson.Field
- Modified apijson.Field
- Name apijson.Field
- SkipWizard apijson.Field
- Status apijson.Field
- Tag apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *EmailRoutingRoutingGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r emailRoutingRoutingGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// State of the zone settings for Email Routing.
-type EmailRoutingRoutingGetResponseEnabled bool
-
-const (
- EmailRoutingRoutingGetResponseEnabledTrue EmailRoutingRoutingGetResponseEnabled = true
- EmailRoutingRoutingGetResponseEnabledFalse EmailRoutingRoutingGetResponseEnabled = false
-)
-
-// Flag to check if the user skipped the configuration wizard.
-type EmailRoutingRoutingGetResponseSkipWizard bool
-
-const (
- EmailRoutingRoutingGetResponseSkipWizardTrue EmailRoutingRoutingGetResponseSkipWizard = true
- EmailRoutingRoutingGetResponseSkipWizardFalse EmailRoutingRoutingGetResponseSkipWizard = false
-)
-
-// Show the state of your account, and the type or configuration error.
-type EmailRoutingRoutingGetResponseStatus string
-
-const (
- EmailRoutingRoutingGetResponseStatusReady EmailRoutingRoutingGetResponseStatus = "ready"
- EmailRoutingRoutingGetResponseStatusUnconfigured EmailRoutingRoutingGetResponseStatus = "unconfigured"
- EmailRoutingRoutingGetResponseStatusMisconfigured EmailRoutingRoutingGetResponseStatus = "misconfigured"
- EmailRoutingRoutingGetResponseStatusMisconfiguredLocked EmailRoutingRoutingGetResponseStatus = "misconfigured/locked"
- EmailRoutingRoutingGetResponseStatusUnlocked EmailRoutingRoutingGetResponseStatus = "unlocked"
-)
-
-type EmailRoutingRoutingGetResponseEnvelope struct {
- Errors []EmailRoutingRoutingGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []EmailRoutingRoutingGetResponseEnvelopeMessages `json:"messages,required"`
- Result EmailRoutingRoutingGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success EmailRoutingRoutingGetResponseEnvelopeSuccess `json:"success,required"`
- JSON emailRoutingRoutingGetResponseEnvelopeJSON `json:"-"`
-}
-
-// emailRoutingRoutingGetResponseEnvelopeJSON contains the JSON metadata for the
-// struct [EmailRoutingRoutingGetResponseEnvelope]
-type emailRoutingRoutingGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *EmailRoutingRoutingGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r emailRoutingRoutingGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type EmailRoutingRoutingGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON emailRoutingRoutingGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// emailRoutingRoutingGetResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [EmailRoutingRoutingGetResponseEnvelopeErrors]
-type emailRoutingRoutingGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *EmailRoutingRoutingGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r emailRoutingRoutingGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type EmailRoutingRoutingGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON emailRoutingRoutingGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// emailRoutingRoutingGetResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [EmailRoutingRoutingGetResponseEnvelopeMessages]
-type emailRoutingRoutingGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *EmailRoutingRoutingGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r emailRoutingRoutingGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type EmailRoutingRoutingGetResponseEnvelopeSuccess bool
-
-const (
- EmailRoutingRoutingGetResponseEnvelopeSuccessTrue EmailRoutingRoutingGetResponseEnvelopeSuccess = true
-)
diff --git a/emailroutingrouting_test.go b/emailroutingrouting_test.go
deleted file mode 100644
index 0b13e3198cd..00000000000
--- a/emailroutingrouting_test.go
+++ /dev/null
@@ -1,38 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestEmailRoutingRoutingGet(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"),
- )
- _, err := client.EmailRouting.Routing.Get(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353")
- 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/emailroutingroutingaddress.go b/emailroutingroutingaddress.go
deleted file mode 100644
index 5564992f51a..00000000000
--- a/emailroutingroutingaddress.go
+++ /dev/null
@@ -1,544 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// EmailRoutingRoutingAddressService contains methods and other services that help
-// with interacting with the cloudflare API. Note, unlike clients, this service
-// does not read variables from the environment automatically. You should not
-// instantiate this service directly, and instead use the
-// [NewEmailRoutingRoutingAddressService] method instead.
-type EmailRoutingRoutingAddressService struct {
- Options []option.RequestOption
-}
-
-// NewEmailRoutingRoutingAddressService generates a new service that applies the
-// given options to each request. These options are applied after the parent
-// client's options (if there is one), and before any request-specific options.
-func NewEmailRoutingRoutingAddressService(opts ...option.RequestOption) (r *EmailRoutingRoutingAddressService) {
- r = &EmailRoutingRoutingAddressService{}
- r.Options = opts
- return
-}
-
-// Create a destination address to forward your emails to. Destination addresses
-// need to be verified before they can be used.
-func (r *EmailRoutingRoutingAddressService) New(ctx context.Context, accountIdentifier string, body EmailRoutingRoutingAddressNewParams, opts ...option.RequestOption) (res *EmailRoutingRoutingAddressNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env EmailRoutingRoutingAddressNewResponseEnvelope
- path := fmt.Sprintf("accounts/%s/email/routing/addresses", accountIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Lists existing destination addresses.
-func (r *EmailRoutingRoutingAddressService) List(ctx context.Context, accountIdentifier string, query EmailRoutingRoutingAddressListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[EmailRoutingRoutingAddressListResponse], err error) {
- var raw *http.Response
- opts = append(r.Options, opts...)
- opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
- path := fmt.Sprintf("accounts/%s/email/routing/addresses", accountIdentifier)
- cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...)
- if err != nil {
- return nil, err
- }
- err = cfg.Execute()
- if err != nil {
- return nil, err
- }
- res.SetPageConfig(cfg, raw)
- return res, nil
-}
-
-// Lists existing destination addresses.
-func (r *EmailRoutingRoutingAddressService) ListAutoPaging(ctx context.Context, accountIdentifier string, query EmailRoutingRoutingAddressListParams, opts ...option.RequestOption) *shared.V4PagePaginationArrayAutoPager[EmailRoutingRoutingAddressListResponse] {
- return shared.NewV4PagePaginationArrayAutoPager(r.List(ctx, accountIdentifier, query, opts...))
-}
-
-// Deletes a specific destination address.
-func (r *EmailRoutingRoutingAddressService) Delete(ctx context.Context, accountIdentifier string, destinationAddressIdentifier string, opts ...option.RequestOption) (res *EmailRoutingRoutingAddressDeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env EmailRoutingRoutingAddressDeleteResponseEnvelope
- path := fmt.Sprintf("accounts/%s/email/routing/addresses/%s", accountIdentifier, destinationAddressIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Gets information for a specific destination email already created.
-func (r *EmailRoutingRoutingAddressService) Get(ctx context.Context, accountIdentifier string, destinationAddressIdentifier string, opts ...option.RequestOption) (res *EmailRoutingRoutingAddressGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env EmailRoutingRoutingAddressGetResponseEnvelope
- path := fmt.Sprintf("accounts/%s/email/routing/addresses/%s", accountIdentifier, destinationAddressIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type EmailRoutingRoutingAddressNewResponse struct {
- // Destination address identifier.
- ID string `json:"id"`
- // The date and time the destination address has been created.
- Created time.Time `json:"created" format:"date-time"`
- // The contact email address of the user.
- Email string `json:"email"`
- // The date and time the destination address was last modified.
- Modified time.Time `json:"modified" format:"date-time"`
- // Destination address tag. (Deprecated, replaced by destination address
- // identifier)
- Tag string `json:"tag"`
- // The date and time the destination address has been verified. Null means not
- // verified yet.
- Verified time.Time `json:"verified" format:"date-time"`
- JSON emailRoutingRoutingAddressNewResponseJSON `json:"-"`
-}
-
-// emailRoutingRoutingAddressNewResponseJSON contains the JSON metadata for the
-// struct [EmailRoutingRoutingAddressNewResponse]
-type emailRoutingRoutingAddressNewResponseJSON struct {
- ID apijson.Field
- Created apijson.Field
- Email apijson.Field
- Modified apijson.Field
- Tag apijson.Field
- Verified apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *EmailRoutingRoutingAddressNewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r emailRoutingRoutingAddressNewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type EmailRoutingRoutingAddressListResponse struct {
- // Destination address identifier.
- ID string `json:"id"`
- // The date and time the destination address has been created.
- Created time.Time `json:"created" format:"date-time"`
- // The contact email address of the user.
- Email string `json:"email"`
- // The date and time the destination address was last modified.
- Modified time.Time `json:"modified" format:"date-time"`
- // Destination address tag. (Deprecated, replaced by destination address
- // identifier)
- Tag string `json:"tag"`
- // The date and time the destination address has been verified. Null means not
- // verified yet.
- Verified time.Time `json:"verified" format:"date-time"`
- JSON emailRoutingRoutingAddressListResponseJSON `json:"-"`
-}
-
-// emailRoutingRoutingAddressListResponseJSON contains the JSON metadata for the
-// struct [EmailRoutingRoutingAddressListResponse]
-type emailRoutingRoutingAddressListResponseJSON struct {
- ID apijson.Field
- Created apijson.Field
- Email apijson.Field
- Modified apijson.Field
- Tag apijson.Field
- Verified apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *EmailRoutingRoutingAddressListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r emailRoutingRoutingAddressListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type EmailRoutingRoutingAddressDeleteResponse struct {
- // Destination address identifier.
- ID string `json:"id"`
- // The date and time the destination address has been created.
- Created time.Time `json:"created" format:"date-time"`
- // The contact email address of the user.
- Email string `json:"email"`
- // The date and time the destination address was last modified.
- Modified time.Time `json:"modified" format:"date-time"`
- // Destination address tag. (Deprecated, replaced by destination address
- // identifier)
- Tag string `json:"tag"`
- // The date and time the destination address has been verified. Null means not
- // verified yet.
- Verified time.Time `json:"verified" format:"date-time"`
- JSON emailRoutingRoutingAddressDeleteResponseJSON `json:"-"`
-}
-
-// emailRoutingRoutingAddressDeleteResponseJSON contains the JSON metadata for the
-// struct [EmailRoutingRoutingAddressDeleteResponse]
-type emailRoutingRoutingAddressDeleteResponseJSON struct {
- ID apijson.Field
- Created apijson.Field
- Email apijson.Field
- Modified apijson.Field
- Tag apijson.Field
- Verified apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *EmailRoutingRoutingAddressDeleteResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r emailRoutingRoutingAddressDeleteResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type EmailRoutingRoutingAddressGetResponse struct {
- // Destination address identifier.
- ID string `json:"id"`
- // The date and time the destination address has been created.
- Created time.Time `json:"created" format:"date-time"`
- // The contact email address of the user.
- Email string `json:"email"`
- // The date and time the destination address was last modified.
- Modified time.Time `json:"modified" format:"date-time"`
- // Destination address tag. (Deprecated, replaced by destination address
- // identifier)
- Tag string `json:"tag"`
- // The date and time the destination address has been verified. Null means not
- // verified yet.
- Verified time.Time `json:"verified" format:"date-time"`
- JSON emailRoutingRoutingAddressGetResponseJSON `json:"-"`
-}
-
-// emailRoutingRoutingAddressGetResponseJSON contains the JSON metadata for the
-// struct [EmailRoutingRoutingAddressGetResponse]
-type emailRoutingRoutingAddressGetResponseJSON struct {
- ID apijson.Field
- Created apijson.Field
- Email apijson.Field
- Modified apijson.Field
- Tag apijson.Field
- Verified apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *EmailRoutingRoutingAddressGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r emailRoutingRoutingAddressGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type EmailRoutingRoutingAddressNewParams struct {
- // The contact email address of the user.
- Email param.Field[string] `json:"email,required"`
-}
-
-func (r EmailRoutingRoutingAddressNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type EmailRoutingRoutingAddressNewResponseEnvelope struct {
- Errors []EmailRoutingRoutingAddressNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []EmailRoutingRoutingAddressNewResponseEnvelopeMessages `json:"messages,required"`
- Result EmailRoutingRoutingAddressNewResponse `json:"result,required"`
- // Whether the API call was successful
- Success EmailRoutingRoutingAddressNewResponseEnvelopeSuccess `json:"success,required"`
- JSON emailRoutingRoutingAddressNewResponseEnvelopeJSON `json:"-"`
-}
-
-// emailRoutingRoutingAddressNewResponseEnvelopeJSON contains the JSON metadata for
-// the struct [EmailRoutingRoutingAddressNewResponseEnvelope]
-type emailRoutingRoutingAddressNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *EmailRoutingRoutingAddressNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r emailRoutingRoutingAddressNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type EmailRoutingRoutingAddressNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON emailRoutingRoutingAddressNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// emailRoutingRoutingAddressNewResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct [EmailRoutingRoutingAddressNewResponseEnvelopeErrors]
-type emailRoutingRoutingAddressNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *EmailRoutingRoutingAddressNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r emailRoutingRoutingAddressNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type EmailRoutingRoutingAddressNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON emailRoutingRoutingAddressNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// emailRoutingRoutingAddressNewResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct [EmailRoutingRoutingAddressNewResponseEnvelopeMessages]
-type emailRoutingRoutingAddressNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *EmailRoutingRoutingAddressNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r emailRoutingRoutingAddressNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type EmailRoutingRoutingAddressNewResponseEnvelopeSuccess bool
-
-const (
- EmailRoutingRoutingAddressNewResponseEnvelopeSuccessTrue EmailRoutingRoutingAddressNewResponseEnvelopeSuccess = true
-)
-
-type EmailRoutingRoutingAddressListParams struct {
- // Sorts results in an ascending or descending order.
- Direction param.Field[EmailRoutingRoutingAddressListParamsDirection] `query:"direction"`
- // Page number of paginated results.
- Page param.Field[float64] `query:"page"`
- // Maximum number of results per page.
- PerPage param.Field[float64] `query:"per_page"`
- // Filter by verified destination addresses.
- Verified param.Field[EmailRoutingRoutingAddressListParamsVerified] `query:"verified"`
-}
-
-// URLQuery serializes [EmailRoutingRoutingAddressListParams]'s query parameters as
-// `url.Values`.
-func (r EmailRoutingRoutingAddressListParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Sorts results in an ascending or descending order.
-type EmailRoutingRoutingAddressListParamsDirection string
-
-const (
- EmailRoutingRoutingAddressListParamsDirectionAsc EmailRoutingRoutingAddressListParamsDirection = "asc"
- EmailRoutingRoutingAddressListParamsDirectionDesc EmailRoutingRoutingAddressListParamsDirection = "desc"
-)
-
-// Filter by verified destination addresses.
-type EmailRoutingRoutingAddressListParamsVerified bool
-
-const (
- EmailRoutingRoutingAddressListParamsVerifiedTrue EmailRoutingRoutingAddressListParamsVerified = true
- EmailRoutingRoutingAddressListParamsVerifiedFalse EmailRoutingRoutingAddressListParamsVerified = false
-)
-
-type EmailRoutingRoutingAddressDeleteResponseEnvelope struct {
- Errors []EmailRoutingRoutingAddressDeleteResponseEnvelopeErrors `json:"errors,required"`
- Messages []EmailRoutingRoutingAddressDeleteResponseEnvelopeMessages `json:"messages,required"`
- Result EmailRoutingRoutingAddressDeleteResponse `json:"result,required"`
- // Whether the API call was successful
- Success EmailRoutingRoutingAddressDeleteResponseEnvelopeSuccess `json:"success,required"`
- JSON emailRoutingRoutingAddressDeleteResponseEnvelopeJSON `json:"-"`
-}
-
-// emailRoutingRoutingAddressDeleteResponseEnvelopeJSON contains the JSON metadata
-// for the struct [EmailRoutingRoutingAddressDeleteResponseEnvelope]
-type emailRoutingRoutingAddressDeleteResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *EmailRoutingRoutingAddressDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r emailRoutingRoutingAddressDeleteResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type EmailRoutingRoutingAddressDeleteResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON emailRoutingRoutingAddressDeleteResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// emailRoutingRoutingAddressDeleteResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct [EmailRoutingRoutingAddressDeleteResponseEnvelopeErrors]
-type emailRoutingRoutingAddressDeleteResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *EmailRoutingRoutingAddressDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r emailRoutingRoutingAddressDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type EmailRoutingRoutingAddressDeleteResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON emailRoutingRoutingAddressDeleteResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// emailRoutingRoutingAddressDeleteResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct
-// [EmailRoutingRoutingAddressDeleteResponseEnvelopeMessages]
-type emailRoutingRoutingAddressDeleteResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *EmailRoutingRoutingAddressDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r emailRoutingRoutingAddressDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type EmailRoutingRoutingAddressDeleteResponseEnvelopeSuccess bool
-
-const (
- EmailRoutingRoutingAddressDeleteResponseEnvelopeSuccessTrue EmailRoutingRoutingAddressDeleteResponseEnvelopeSuccess = true
-)
-
-type EmailRoutingRoutingAddressGetResponseEnvelope struct {
- Errors []EmailRoutingRoutingAddressGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []EmailRoutingRoutingAddressGetResponseEnvelopeMessages `json:"messages,required"`
- Result EmailRoutingRoutingAddressGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success EmailRoutingRoutingAddressGetResponseEnvelopeSuccess `json:"success,required"`
- JSON emailRoutingRoutingAddressGetResponseEnvelopeJSON `json:"-"`
-}
-
-// emailRoutingRoutingAddressGetResponseEnvelopeJSON contains the JSON metadata for
-// the struct [EmailRoutingRoutingAddressGetResponseEnvelope]
-type emailRoutingRoutingAddressGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *EmailRoutingRoutingAddressGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r emailRoutingRoutingAddressGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type EmailRoutingRoutingAddressGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON emailRoutingRoutingAddressGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// emailRoutingRoutingAddressGetResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct [EmailRoutingRoutingAddressGetResponseEnvelopeErrors]
-type emailRoutingRoutingAddressGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *EmailRoutingRoutingAddressGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r emailRoutingRoutingAddressGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type EmailRoutingRoutingAddressGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON emailRoutingRoutingAddressGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// emailRoutingRoutingAddressGetResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct [EmailRoutingRoutingAddressGetResponseEnvelopeMessages]
-type emailRoutingRoutingAddressGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *EmailRoutingRoutingAddressGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r emailRoutingRoutingAddressGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type EmailRoutingRoutingAddressGetResponseEnvelopeSuccess bool
-
-const (
- EmailRoutingRoutingAddressGetResponseEnvelopeSuccessTrue EmailRoutingRoutingAddressGetResponseEnvelopeSuccess = true
-)
diff --git a/emailroutingroutingaddress_test.go b/emailroutingroutingaddress_test.go
deleted file mode 100644
index 6ddce07007d..00000000000
--- a/emailroutingroutingaddress_test.go
+++ /dev/null
@@ -1,133 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestEmailRoutingRoutingAddressNew(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"),
- )
- _, err := client.EmailRouting.Routing.Addresses.New(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.EmailRoutingRoutingAddressNewParams{
- Email: cloudflare.F("user@example.com"),
- },
- )
- 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())
- }
-}
-
-func TestEmailRoutingRoutingAddressListWithOptionalParams(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"),
- )
- _, err := client.EmailRouting.Routing.Addresses.List(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.EmailRoutingRoutingAddressListParams{
- Direction: cloudflare.F(cloudflare.EmailRoutingRoutingAddressListParamsDirectionAsc),
- Page: cloudflare.F(1.000000),
- PerPage: cloudflare.F(5.000000),
- Verified: cloudflare.F(cloudflare.EmailRoutingRoutingAddressListParamsVerifiedTrue),
- },
- )
- 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())
- }
-}
-
-func TestEmailRoutingRoutingAddressDelete(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"),
- )
- _, err := client.EmailRouting.Routing.Addresses.Delete(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- "ea95132c15732412d22c1476fa83f27a",
- )
- 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())
- }
-}
-
-func TestEmailRoutingRoutingAddressGet(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"),
- )
- _, err := client.EmailRouting.Routing.Addresses.Get(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- "ea95132c15732412d22c1476fa83f27a",
- )
- 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/emailroutingroutingdisable.go b/emailroutingroutingdisable.go
deleted file mode 100644
index 98ad915a92f..00000000000
--- a/emailroutingroutingdisable.go
+++ /dev/null
@@ -1,198 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// EmailRoutingRoutingDisableService contains methods and other services that help
-// with interacting with the cloudflare API. Note, unlike clients, this service
-// does not read variables from the environment automatically. You should not
-// instantiate this service directly, and instead use the
-// [NewEmailRoutingRoutingDisableService] method instead.
-type EmailRoutingRoutingDisableService struct {
- Options []option.RequestOption
-}
-
-// NewEmailRoutingRoutingDisableService generates a new service that applies the
-// given options to each request. These options are applied after the parent
-// client's options (if there is one), and before any request-specific options.
-func NewEmailRoutingRoutingDisableService(opts ...option.RequestOption) (r *EmailRoutingRoutingDisableService) {
- r = &EmailRoutingRoutingDisableService{}
- r.Options = opts
- return
-}
-
-// Disable your Email Routing zone. Also removes additional MX records previously
-// required for Email Routing to work.
-func (r *EmailRoutingRoutingDisableService) New(ctx context.Context, zoneIdentifier string, opts ...option.RequestOption) (res *EmailRoutingRoutingDisableNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env EmailRoutingRoutingDisableNewResponseEnvelope
- path := fmt.Sprintf("zones/%s/email/routing/disable", zoneIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type EmailRoutingRoutingDisableNewResponse struct {
- // Email Routing settings identifier.
- ID string `json:"id"`
- // The date and time the settings have been created.
- Created time.Time `json:"created" format:"date-time"`
- // State of the zone settings for Email Routing.
- Enabled EmailRoutingRoutingDisableNewResponseEnabled `json:"enabled"`
- // The date and time the settings have been modified.
- Modified time.Time `json:"modified" format:"date-time"`
- // Domain of your zone.
- Name string `json:"name"`
- // Flag to check if the user skipped the configuration wizard.
- SkipWizard EmailRoutingRoutingDisableNewResponseSkipWizard `json:"skip_wizard"`
- // Show the state of your account, and the type or configuration error.
- Status EmailRoutingRoutingDisableNewResponseStatus `json:"status"`
- // Email Routing settings tag. (Deprecated, replaced by Email Routing settings
- // identifier)
- Tag string `json:"tag"`
- JSON emailRoutingRoutingDisableNewResponseJSON `json:"-"`
-}
-
-// emailRoutingRoutingDisableNewResponseJSON contains the JSON metadata for the
-// struct [EmailRoutingRoutingDisableNewResponse]
-type emailRoutingRoutingDisableNewResponseJSON struct {
- ID apijson.Field
- Created apijson.Field
- Enabled apijson.Field
- Modified apijson.Field
- Name apijson.Field
- SkipWizard apijson.Field
- Status apijson.Field
- Tag apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *EmailRoutingRoutingDisableNewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r emailRoutingRoutingDisableNewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// State of the zone settings for Email Routing.
-type EmailRoutingRoutingDisableNewResponseEnabled bool
-
-const (
- EmailRoutingRoutingDisableNewResponseEnabledTrue EmailRoutingRoutingDisableNewResponseEnabled = true
- EmailRoutingRoutingDisableNewResponseEnabledFalse EmailRoutingRoutingDisableNewResponseEnabled = false
-)
-
-// Flag to check if the user skipped the configuration wizard.
-type EmailRoutingRoutingDisableNewResponseSkipWizard bool
-
-const (
- EmailRoutingRoutingDisableNewResponseSkipWizardTrue EmailRoutingRoutingDisableNewResponseSkipWizard = true
- EmailRoutingRoutingDisableNewResponseSkipWizardFalse EmailRoutingRoutingDisableNewResponseSkipWizard = false
-)
-
-// Show the state of your account, and the type or configuration error.
-type EmailRoutingRoutingDisableNewResponseStatus string
-
-const (
- EmailRoutingRoutingDisableNewResponseStatusReady EmailRoutingRoutingDisableNewResponseStatus = "ready"
- EmailRoutingRoutingDisableNewResponseStatusUnconfigured EmailRoutingRoutingDisableNewResponseStatus = "unconfigured"
- EmailRoutingRoutingDisableNewResponseStatusMisconfigured EmailRoutingRoutingDisableNewResponseStatus = "misconfigured"
- EmailRoutingRoutingDisableNewResponseStatusMisconfiguredLocked EmailRoutingRoutingDisableNewResponseStatus = "misconfigured/locked"
- EmailRoutingRoutingDisableNewResponseStatusUnlocked EmailRoutingRoutingDisableNewResponseStatus = "unlocked"
-)
-
-type EmailRoutingRoutingDisableNewResponseEnvelope struct {
- Errors []EmailRoutingRoutingDisableNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []EmailRoutingRoutingDisableNewResponseEnvelopeMessages `json:"messages,required"`
- Result EmailRoutingRoutingDisableNewResponse `json:"result,required"`
- // Whether the API call was successful
- Success EmailRoutingRoutingDisableNewResponseEnvelopeSuccess `json:"success,required"`
- JSON emailRoutingRoutingDisableNewResponseEnvelopeJSON `json:"-"`
-}
-
-// emailRoutingRoutingDisableNewResponseEnvelopeJSON contains the JSON metadata for
-// the struct [EmailRoutingRoutingDisableNewResponseEnvelope]
-type emailRoutingRoutingDisableNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *EmailRoutingRoutingDisableNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r emailRoutingRoutingDisableNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type EmailRoutingRoutingDisableNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON emailRoutingRoutingDisableNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// emailRoutingRoutingDisableNewResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct [EmailRoutingRoutingDisableNewResponseEnvelopeErrors]
-type emailRoutingRoutingDisableNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *EmailRoutingRoutingDisableNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r emailRoutingRoutingDisableNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type EmailRoutingRoutingDisableNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON emailRoutingRoutingDisableNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// emailRoutingRoutingDisableNewResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct [EmailRoutingRoutingDisableNewResponseEnvelopeMessages]
-type emailRoutingRoutingDisableNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *EmailRoutingRoutingDisableNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r emailRoutingRoutingDisableNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type EmailRoutingRoutingDisableNewResponseEnvelopeSuccess bool
-
-const (
- EmailRoutingRoutingDisableNewResponseEnvelopeSuccessTrue EmailRoutingRoutingDisableNewResponseEnvelopeSuccess = true
-)
diff --git a/emailroutingroutingdisable_test.go b/emailroutingroutingdisable_test.go
deleted file mode 100644
index 5055e799333..00000000000
--- a/emailroutingroutingdisable_test.go
+++ /dev/null
@@ -1,38 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestEmailRoutingRoutingDisableNew(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"),
- )
- _, err := client.EmailRouting.Routing.Disables.New(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353")
- 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/emailroutingroutingdns.go b/emailroutingroutingdns.go
deleted file mode 100644
index 962392eabc8..00000000000
--- a/emailroutingroutingdns.go
+++ /dev/null
@@ -1,252 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "reflect"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/option"
- "github.com/tidwall/gjson"
-)
-
-// EmailRoutingRoutingDNSService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewEmailRoutingRoutingDNSService]
-// method instead.
-type EmailRoutingRoutingDNSService struct {
- Options []option.RequestOption
-}
-
-// NewEmailRoutingRoutingDNSService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewEmailRoutingRoutingDNSService(opts ...option.RequestOption) (r *EmailRoutingRoutingDNSService) {
- r = &EmailRoutingRoutingDNSService{}
- r.Options = opts
- return
-}
-
-// Show the DNS records needed to configure your Email Routing zone.
-func (r *EmailRoutingRoutingDNSService) Get(ctx context.Context, zoneIdentifier string, opts ...option.RequestOption) (res *[]EmailRoutingRoutingDNSGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env EmailRoutingRoutingDNSGetResponseEnvelope
- path := fmt.Sprintf("zones/%s/email/routing/dns", zoneIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// List of records needed to enable an Email Routing zone.
-type EmailRoutingRoutingDNSGetResponse struct {
- // DNS record content.
- Content string `json:"content"`
- // DNS record name (or @ for the zone apex).
- Name string `json:"name"`
- // Required for MX, SRV and URI records. Unused by other record types. Records with
- // lower priorities are preferred.
- Priority float64 `json:"priority"`
- // Time to live, in seconds, of the DNS record. Must be between 60 and 86400, or 1
- // for 'automatic'.
- TTL EmailRoutingRoutingDNSGetResponseTTL `json:"ttl"`
- // DNS record type.
- Type EmailRoutingRoutingDNSGetResponseType `json:"type"`
- JSON emailRoutingRoutingDNSGetResponseJSON `json:"-"`
-}
-
-// emailRoutingRoutingDNSGetResponseJSON contains the JSON metadata for the struct
-// [EmailRoutingRoutingDNSGetResponse]
-type emailRoutingRoutingDNSGetResponseJSON struct {
- Content apijson.Field
- Name apijson.Field
- Priority apijson.Field
- TTL apijson.Field
- Type apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *EmailRoutingRoutingDNSGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r emailRoutingRoutingDNSGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// Time to live, in seconds, of the DNS record. Must be between 60 and 86400, or 1
-// for 'automatic'.
-//
-// Union satisfied by [shared.UnionFloat] or
-// [EmailRoutingRoutingDNSGetResponseTTLNumber].
-type EmailRoutingRoutingDNSGetResponseTTL interface {
- ImplementsEmailRoutingRoutingDNSGetResponseTTL()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*EmailRoutingRoutingDNSGetResponseTTL)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(EmailRoutingRoutingDNSGetResponseTTLNumber(0)),
- },
- )
-}
-
-type EmailRoutingRoutingDNSGetResponseTTLNumber float64
-
-const (
- EmailRoutingRoutingDNSGetResponseTTLNumber1 EmailRoutingRoutingDNSGetResponseTTLNumber = 1
-)
-
-// DNS record type.
-type EmailRoutingRoutingDNSGetResponseType string
-
-const (
- EmailRoutingRoutingDNSGetResponseTypeA EmailRoutingRoutingDNSGetResponseType = "A"
- EmailRoutingRoutingDNSGetResponseTypeAAAA EmailRoutingRoutingDNSGetResponseType = "AAAA"
- EmailRoutingRoutingDNSGetResponseTypeCNAME EmailRoutingRoutingDNSGetResponseType = "CNAME"
- EmailRoutingRoutingDNSGetResponseTypeHTTPS EmailRoutingRoutingDNSGetResponseType = "HTTPS"
- EmailRoutingRoutingDNSGetResponseTypeTXT EmailRoutingRoutingDNSGetResponseType = "TXT"
- EmailRoutingRoutingDNSGetResponseTypeSRV EmailRoutingRoutingDNSGetResponseType = "SRV"
- EmailRoutingRoutingDNSGetResponseTypeLOC EmailRoutingRoutingDNSGetResponseType = "LOC"
- EmailRoutingRoutingDNSGetResponseTypeMX EmailRoutingRoutingDNSGetResponseType = "MX"
- EmailRoutingRoutingDNSGetResponseTypeNS EmailRoutingRoutingDNSGetResponseType = "NS"
- EmailRoutingRoutingDNSGetResponseTypeCert EmailRoutingRoutingDNSGetResponseType = "CERT"
- EmailRoutingRoutingDNSGetResponseTypeDNSKEY EmailRoutingRoutingDNSGetResponseType = "DNSKEY"
- EmailRoutingRoutingDNSGetResponseTypeDS EmailRoutingRoutingDNSGetResponseType = "DS"
- EmailRoutingRoutingDNSGetResponseTypeNAPTR EmailRoutingRoutingDNSGetResponseType = "NAPTR"
- EmailRoutingRoutingDNSGetResponseTypeSmimea EmailRoutingRoutingDNSGetResponseType = "SMIMEA"
- EmailRoutingRoutingDNSGetResponseTypeSSHFP EmailRoutingRoutingDNSGetResponseType = "SSHFP"
- EmailRoutingRoutingDNSGetResponseTypeSVCB EmailRoutingRoutingDNSGetResponseType = "SVCB"
- EmailRoutingRoutingDNSGetResponseTypeTLSA EmailRoutingRoutingDNSGetResponseType = "TLSA"
- EmailRoutingRoutingDNSGetResponseTypeURI EmailRoutingRoutingDNSGetResponseType = "URI"
-)
-
-type EmailRoutingRoutingDNSGetResponseEnvelope struct {
- Errors []EmailRoutingRoutingDNSGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []EmailRoutingRoutingDNSGetResponseEnvelopeMessages `json:"messages,required"`
- Result []EmailRoutingRoutingDNSGetResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success EmailRoutingRoutingDNSGetResponseEnvelopeSuccess `json:"success,required"`
- ResultInfo EmailRoutingRoutingDNSGetResponseEnvelopeResultInfo `json:"result_info"`
- JSON emailRoutingRoutingDNSGetResponseEnvelopeJSON `json:"-"`
-}
-
-// emailRoutingRoutingDNSGetResponseEnvelopeJSON contains the JSON metadata for the
-// struct [EmailRoutingRoutingDNSGetResponseEnvelope]
-type emailRoutingRoutingDNSGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- ResultInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *EmailRoutingRoutingDNSGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r emailRoutingRoutingDNSGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type EmailRoutingRoutingDNSGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON emailRoutingRoutingDNSGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// emailRoutingRoutingDNSGetResponseEnvelopeErrorsJSON contains the JSON metadata
-// for the struct [EmailRoutingRoutingDNSGetResponseEnvelopeErrors]
-type emailRoutingRoutingDNSGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *EmailRoutingRoutingDNSGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r emailRoutingRoutingDNSGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type EmailRoutingRoutingDNSGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON emailRoutingRoutingDNSGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// emailRoutingRoutingDNSGetResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [EmailRoutingRoutingDNSGetResponseEnvelopeMessages]
-type emailRoutingRoutingDNSGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *EmailRoutingRoutingDNSGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r emailRoutingRoutingDNSGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type EmailRoutingRoutingDNSGetResponseEnvelopeSuccess bool
-
-const (
- EmailRoutingRoutingDNSGetResponseEnvelopeSuccessTrue EmailRoutingRoutingDNSGetResponseEnvelopeSuccess = true
-)
-
-type EmailRoutingRoutingDNSGetResponseEnvelopeResultInfo struct {
- // Total number of results for the requested service
- Count float64 `json:"count"`
- // Current page within paginated list of results
- Page float64 `json:"page"`
- // Number of results per page of results
- PerPage float64 `json:"per_page"`
- // Total results available without any search parameters
- TotalCount float64 `json:"total_count"`
- JSON emailRoutingRoutingDNSGetResponseEnvelopeResultInfoJSON `json:"-"`
-}
-
-// emailRoutingRoutingDNSGetResponseEnvelopeResultInfoJSON contains the JSON
-// metadata for the struct [EmailRoutingRoutingDNSGetResponseEnvelopeResultInfo]
-type emailRoutingRoutingDNSGetResponseEnvelopeResultInfoJSON struct {
- Count apijson.Field
- Page apijson.Field
- PerPage apijson.Field
- TotalCount apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *EmailRoutingRoutingDNSGetResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r emailRoutingRoutingDNSGetResponseEnvelopeResultInfoJSON) RawJSON() string {
- return r.raw
-}
diff --git a/emailroutingroutingdns_test.go b/emailroutingroutingdns_test.go
deleted file mode 100644
index 393febf15f3..00000000000
--- a/emailroutingroutingdns_test.go
+++ /dev/null
@@ -1,38 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestEmailRoutingRoutingDNSGet(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"),
- )
- _, err := client.EmailRouting.Routing.DNS.Get(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353")
- 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/emailroutingroutingenable.go b/emailroutingroutingenable.go
deleted file mode 100644
index e3b49eec2c8..00000000000
--- a/emailroutingroutingenable.go
+++ /dev/null
@@ -1,197 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// EmailRoutingRoutingEnableService contains methods and other services that help
-// with interacting with the cloudflare API. Note, unlike clients, this service
-// does not read variables from the environment automatically. You should not
-// instantiate this service directly, and instead use the
-// [NewEmailRoutingRoutingEnableService] method instead.
-type EmailRoutingRoutingEnableService struct {
- Options []option.RequestOption
-}
-
-// NewEmailRoutingRoutingEnableService generates a new service that applies the
-// given options to each request. These options are applied after the parent
-// client's options (if there is one), and before any request-specific options.
-func NewEmailRoutingRoutingEnableService(opts ...option.RequestOption) (r *EmailRoutingRoutingEnableService) {
- r = &EmailRoutingRoutingEnableService{}
- r.Options = opts
- return
-}
-
-// Enable you Email Routing zone. Add and lock the necessary MX and SPF records.
-func (r *EmailRoutingRoutingEnableService) New(ctx context.Context, zoneIdentifier string, opts ...option.RequestOption) (res *EmailRoutingRoutingEnableNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env EmailRoutingRoutingEnableNewResponseEnvelope
- path := fmt.Sprintf("zones/%s/email/routing/enable", zoneIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type EmailRoutingRoutingEnableNewResponse struct {
- // Email Routing settings identifier.
- ID string `json:"id"`
- // The date and time the settings have been created.
- Created time.Time `json:"created" format:"date-time"`
- // State of the zone settings for Email Routing.
- Enabled EmailRoutingRoutingEnableNewResponseEnabled `json:"enabled"`
- // The date and time the settings have been modified.
- Modified time.Time `json:"modified" format:"date-time"`
- // Domain of your zone.
- Name string `json:"name"`
- // Flag to check if the user skipped the configuration wizard.
- SkipWizard EmailRoutingRoutingEnableNewResponseSkipWizard `json:"skip_wizard"`
- // Show the state of your account, and the type or configuration error.
- Status EmailRoutingRoutingEnableNewResponseStatus `json:"status"`
- // Email Routing settings tag. (Deprecated, replaced by Email Routing settings
- // identifier)
- Tag string `json:"tag"`
- JSON emailRoutingRoutingEnableNewResponseJSON `json:"-"`
-}
-
-// emailRoutingRoutingEnableNewResponseJSON contains the JSON metadata for the
-// struct [EmailRoutingRoutingEnableNewResponse]
-type emailRoutingRoutingEnableNewResponseJSON struct {
- ID apijson.Field
- Created apijson.Field
- Enabled apijson.Field
- Modified apijson.Field
- Name apijson.Field
- SkipWizard apijson.Field
- Status apijson.Field
- Tag apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *EmailRoutingRoutingEnableNewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r emailRoutingRoutingEnableNewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// State of the zone settings for Email Routing.
-type EmailRoutingRoutingEnableNewResponseEnabled bool
-
-const (
- EmailRoutingRoutingEnableNewResponseEnabledTrue EmailRoutingRoutingEnableNewResponseEnabled = true
- EmailRoutingRoutingEnableNewResponseEnabledFalse EmailRoutingRoutingEnableNewResponseEnabled = false
-)
-
-// Flag to check if the user skipped the configuration wizard.
-type EmailRoutingRoutingEnableNewResponseSkipWizard bool
-
-const (
- EmailRoutingRoutingEnableNewResponseSkipWizardTrue EmailRoutingRoutingEnableNewResponseSkipWizard = true
- EmailRoutingRoutingEnableNewResponseSkipWizardFalse EmailRoutingRoutingEnableNewResponseSkipWizard = false
-)
-
-// Show the state of your account, and the type or configuration error.
-type EmailRoutingRoutingEnableNewResponseStatus string
-
-const (
- EmailRoutingRoutingEnableNewResponseStatusReady EmailRoutingRoutingEnableNewResponseStatus = "ready"
- EmailRoutingRoutingEnableNewResponseStatusUnconfigured EmailRoutingRoutingEnableNewResponseStatus = "unconfigured"
- EmailRoutingRoutingEnableNewResponseStatusMisconfigured EmailRoutingRoutingEnableNewResponseStatus = "misconfigured"
- EmailRoutingRoutingEnableNewResponseStatusMisconfiguredLocked EmailRoutingRoutingEnableNewResponseStatus = "misconfigured/locked"
- EmailRoutingRoutingEnableNewResponseStatusUnlocked EmailRoutingRoutingEnableNewResponseStatus = "unlocked"
-)
-
-type EmailRoutingRoutingEnableNewResponseEnvelope struct {
- Errors []EmailRoutingRoutingEnableNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []EmailRoutingRoutingEnableNewResponseEnvelopeMessages `json:"messages,required"`
- Result EmailRoutingRoutingEnableNewResponse `json:"result,required"`
- // Whether the API call was successful
- Success EmailRoutingRoutingEnableNewResponseEnvelopeSuccess `json:"success,required"`
- JSON emailRoutingRoutingEnableNewResponseEnvelopeJSON `json:"-"`
-}
-
-// emailRoutingRoutingEnableNewResponseEnvelopeJSON contains the JSON metadata for
-// the struct [EmailRoutingRoutingEnableNewResponseEnvelope]
-type emailRoutingRoutingEnableNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *EmailRoutingRoutingEnableNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r emailRoutingRoutingEnableNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type EmailRoutingRoutingEnableNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON emailRoutingRoutingEnableNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// emailRoutingRoutingEnableNewResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct [EmailRoutingRoutingEnableNewResponseEnvelopeErrors]
-type emailRoutingRoutingEnableNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *EmailRoutingRoutingEnableNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r emailRoutingRoutingEnableNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type EmailRoutingRoutingEnableNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON emailRoutingRoutingEnableNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// emailRoutingRoutingEnableNewResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct [EmailRoutingRoutingEnableNewResponseEnvelopeMessages]
-type emailRoutingRoutingEnableNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *EmailRoutingRoutingEnableNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r emailRoutingRoutingEnableNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type EmailRoutingRoutingEnableNewResponseEnvelopeSuccess bool
-
-const (
- EmailRoutingRoutingEnableNewResponseEnvelopeSuccessTrue EmailRoutingRoutingEnableNewResponseEnvelopeSuccess = true
-)
diff --git a/emailroutingroutingenable_test.go b/emailroutingroutingenable_test.go
deleted file mode 100644
index 751332c1860..00000000000
--- a/emailroutingroutingenable_test.go
+++ /dev/null
@@ -1,38 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestEmailRoutingRoutingEnableNew(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"),
- )
- _, err := client.EmailRouting.Routing.Enables.New(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353")
- 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/emailroutingroutingrule.go b/emailroutingroutingrule.go
deleted file mode 100644
index b5a73868966..00000000000
--- a/emailroutingroutingrule.go
+++ /dev/null
@@ -1,1235 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// EmailRoutingRoutingRuleService contains methods and other services that help
-// with interacting with the cloudflare API. Note, unlike clients, this service
-// does not read variables from the environment automatically. You should not
-// instantiate this service directly, and instead use the
-// [NewEmailRoutingRoutingRuleService] method instead.
-type EmailRoutingRoutingRuleService struct {
- Options []option.RequestOption
- CatchAlls *EmailRoutingRoutingRuleCatchAllService
-}
-
-// NewEmailRoutingRoutingRuleService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewEmailRoutingRoutingRuleService(opts ...option.RequestOption) (r *EmailRoutingRoutingRuleService) {
- r = &EmailRoutingRoutingRuleService{}
- r.Options = opts
- r.CatchAlls = NewEmailRoutingRoutingRuleCatchAllService(opts...)
- return
-}
-
-// Rules consist of a set of criteria for matching emails (such as an email being
-// sent to a specific custom email address) plus a set of actions to take on the
-// email (like forwarding it to a specific destination address).
-func (r *EmailRoutingRoutingRuleService) New(ctx context.Context, zoneIdentifier string, body EmailRoutingRoutingRuleNewParams, opts ...option.RequestOption) (res *EmailRoutingRoutingRuleNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env EmailRoutingRoutingRuleNewResponseEnvelope
- path := fmt.Sprintf("zones/%s/email/routing/rules", zoneIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Update actions and matches, or enable/disable specific routing rules.
-func (r *EmailRoutingRoutingRuleService) Update(ctx context.Context, zoneIdentifier string, ruleIdentifier string, body EmailRoutingRoutingRuleUpdateParams, opts ...option.RequestOption) (res *EmailRoutingRoutingRuleUpdateResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env EmailRoutingRoutingRuleUpdateResponseEnvelope
- path := fmt.Sprintf("zones/%s/email/routing/rules/%s", zoneIdentifier, ruleIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Lists existing routing rules.
-func (r *EmailRoutingRoutingRuleService) List(ctx context.Context, zoneIdentifier string, query EmailRoutingRoutingRuleListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[EmailRoutingRoutingRuleListResponse], err error) {
- var raw *http.Response
- opts = append(r.Options, opts...)
- opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
- path := fmt.Sprintf("zones/%s/email/routing/rules", zoneIdentifier)
- cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...)
- if err != nil {
- return nil, err
- }
- err = cfg.Execute()
- if err != nil {
- return nil, err
- }
- res.SetPageConfig(cfg, raw)
- return res, nil
-}
-
-// Lists existing routing rules.
-func (r *EmailRoutingRoutingRuleService) ListAutoPaging(ctx context.Context, zoneIdentifier string, query EmailRoutingRoutingRuleListParams, opts ...option.RequestOption) *shared.V4PagePaginationArrayAutoPager[EmailRoutingRoutingRuleListResponse] {
- return shared.NewV4PagePaginationArrayAutoPager(r.List(ctx, zoneIdentifier, query, opts...))
-}
-
-// Delete a specific routing rule.
-func (r *EmailRoutingRoutingRuleService) Delete(ctx context.Context, zoneIdentifier string, ruleIdentifier string, opts ...option.RequestOption) (res *EmailRoutingRoutingRuleDeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env EmailRoutingRoutingRuleDeleteResponseEnvelope
- path := fmt.Sprintf("zones/%s/email/routing/rules/%s", zoneIdentifier, ruleIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Get information for a specific routing rule already created.
-func (r *EmailRoutingRoutingRuleService) Get(ctx context.Context, zoneIdentifier string, ruleIdentifier string, opts ...option.RequestOption) (res *EmailRoutingRoutingRuleGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env EmailRoutingRoutingRuleGetResponseEnvelope
- path := fmt.Sprintf("zones/%s/email/routing/rules/%s", zoneIdentifier, ruleIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type EmailRoutingRoutingRuleNewResponse struct {
- // Routing rule identifier.
- ID string `json:"id"`
- // List actions patterns.
- Actions []EmailRoutingRoutingRuleNewResponseAction `json:"actions"`
- // Routing rule status.
- Enabled EmailRoutingRoutingRuleNewResponseEnabled `json:"enabled"`
- // Matching patterns to forward to your actions.
- Matchers []EmailRoutingRoutingRuleNewResponseMatcher `json:"matchers"`
- // Routing rule name.
- Name string `json:"name"`
- // Priority of the routing rule.
- Priority float64 `json:"priority"`
- // Routing rule tag. (Deprecated, replaced by routing rule identifier)
- Tag string `json:"tag"`
- JSON emailRoutingRoutingRuleNewResponseJSON `json:"-"`
-}
-
-// emailRoutingRoutingRuleNewResponseJSON contains the JSON metadata for the struct
-// [EmailRoutingRoutingRuleNewResponse]
-type emailRoutingRoutingRuleNewResponseJSON struct {
- ID apijson.Field
- Actions apijson.Field
- Enabled apijson.Field
- Matchers apijson.Field
- Name apijson.Field
- Priority apijson.Field
- Tag apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *EmailRoutingRoutingRuleNewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r emailRoutingRoutingRuleNewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// Actions pattern.
-type EmailRoutingRoutingRuleNewResponseAction struct {
- // Type of supported action.
- Type EmailRoutingRoutingRuleNewResponseActionsType `json:"type,required"`
- Value []string `json:"value,required"`
- JSON emailRoutingRoutingRuleNewResponseActionJSON `json:"-"`
-}
-
-// emailRoutingRoutingRuleNewResponseActionJSON contains the JSON metadata for the
-// struct [EmailRoutingRoutingRuleNewResponseAction]
-type emailRoutingRoutingRuleNewResponseActionJSON struct {
- Type apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *EmailRoutingRoutingRuleNewResponseAction) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r emailRoutingRoutingRuleNewResponseActionJSON) RawJSON() string {
- return r.raw
-}
-
-// Type of supported action.
-type EmailRoutingRoutingRuleNewResponseActionsType string
-
-const (
- EmailRoutingRoutingRuleNewResponseActionsTypeDrop EmailRoutingRoutingRuleNewResponseActionsType = "drop"
- EmailRoutingRoutingRuleNewResponseActionsTypeForward EmailRoutingRoutingRuleNewResponseActionsType = "forward"
- EmailRoutingRoutingRuleNewResponseActionsTypeWorker EmailRoutingRoutingRuleNewResponseActionsType = "worker"
-)
-
-// Routing rule status.
-type EmailRoutingRoutingRuleNewResponseEnabled bool
-
-const (
- EmailRoutingRoutingRuleNewResponseEnabledTrue EmailRoutingRoutingRuleNewResponseEnabled = true
- EmailRoutingRoutingRuleNewResponseEnabledFalse EmailRoutingRoutingRuleNewResponseEnabled = false
-)
-
-// Matching pattern to forward your actions.
-type EmailRoutingRoutingRuleNewResponseMatcher struct {
- // Field for type matcher.
- Field EmailRoutingRoutingRuleNewResponseMatchersField `json:"field,required"`
- // Type of matcher.
- Type EmailRoutingRoutingRuleNewResponseMatchersType `json:"type,required"`
- // Value for matcher.
- Value string `json:"value,required"`
- JSON emailRoutingRoutingRuleNewResponseMatcherJSON `json:"-"`
-}
-
-// emailRoutingRoutingRuleNewResponseMatcherJSON contains the JSON metadata for the
-// struct [EmailRoutingRoutingRuleNewResponseMatcher]
-type emailRoutingRoutingRuleNewResponseMatcherJSON struct {
- Field apijson.Field
- Type apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *EmailRoutingRoutingRuleNewResponseMatcher) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r emailRoutingRoutingRuleNewResponseMatcherJSON) RawJSON() string {
- return r.raw
-}
-
-// Field for type matcher.
-type EmailRoutingRoutingRuleNewResponseMatchersField string
-
-const (
- EmailRoutingRoutingRuleNewResponseMatchersFieldTo EmailRoutingRoutingRuleNewResponseMatchersField = "to"
-)
-
-// Type of matcher.
-type EmailRoutingRoutingRuleNewResponseMatchersType string
-
-const (
- EmailRoutingRoutingRuleNewResponseMatchersTypeLiteral EmailRoutingRoutingRuleNewResponseMatchersType = "literal"
-)
-
-type EmailRoutingRoutingRuleUpdateResponse struct {
- // Routing rule identifier.
- ID string `json:"id"`
- // List actions patterns.
- Actions []EmailRoutingRoutingRuleUpdateResponseAction `json:"actions"`
- // Routing rule status.
- Enabled EmailRoutingRoutingRuleUpdateResponseEnabled `json:"enabled"`
- // Matching patterns to forward to your actions.
- Matchers []EmailRoutingRoutingRuleUpdateResponseMatcher `json:"matchers"`
- // Routing rule name.
- Name string `json:"name"`
- // Priority of the routing rule.
- Priority float64 `json:"priority"`
- // Routing rule tag. (Deprecated, replaced by routing rule identifier)
- Tag string `json:"tag"`
- JSON emailRoutingRoutingRuleUpdateResponseJSON `json:"-"`
-}
-
-// emailRoutingRoutingRuleUpdateResponseJSON contains the JSON metadata for the
-// struct [EmailRoutingRoutingRuleUpdateResponse]
-type emailRoutingRoutingRuleUpdateResponseJSON struct {
- ID apijson.Field
- Actions apijson.Field
- Enabled apijson.Field
- Matchers apijson.Field
- Name apijson.Field
- Priority apijson.Field
- Tag apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *EmailRoutingRoutingRuleUpdateResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r emailRoutingRoutingRuleUpdateResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// Actions pattern.
-type EmailRoutingRoutingRuleUpdateResponseAction struct {
- // Type of supported action.
- Type EmailRoutingRoutingRuleUpdateResponseActionsType `json:"type,required"`
- Value []string `json:"value,required"`
- JSON emailRoutingRoutingRuleUpdateResponseActionJSON `json:"-"`
-}
-
-// emailRoutingRoutingRuleUpdateResponseActionJSON contains the JSON metadata for
-// the struct [EmailRoutingRoutingRuleUpdateResponseAction]
-type emailRoutingRoutingRuleUpdateResponseActionJSON struct {
- Type apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *EmailRoutingRoutingRuleUpdateResponseAction) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r emailRoutingRoutingRuleUpdateResponseActionJSON) RawJSON() string {
- return r.raw
-}
-
-// Type of supported action.
-type EmailRoutingRoutingRuleUpdateResponseActionsType string
-
-const (
- EmailRoutingRoutingRuleUpdateResponseActionsTypeDrop EmailRoutingRoutingRuleUpdateResponseActionsType = "drop"
- EmailRoutingRoutingRuleUpdateResponseActionsTypeForward EmailRoutingRoutingRuleUpdateResponseActionsType = "forward"
- EmailRoutingRoutingRuleUpdateResponseActionsTypeWorker EmailRoutingRoutingRuleUpdateResponseActionsType = "worker"
-)
-
-// Routing rule status.
-type EmailRoutingRoutingRuleUpdateResponseEnabled bool
-
-const (
- EmailRoutingRoutingRuleUpdateResponseEnabledTrue EmailRoutingRoutingRuleUpdateResponseEnabled = true
- EmailRoutingRoutingRuleUpdateResponseEnabledFalse EmailRoutingRoutingRuleUpdateResponseEnabled = false
-)
-
-// Matching pattern to forward your actions.
-type EmailRoutingRoutingRuleUpdateResponseMatcher struct {
- // Field for type matcher.
- Field EmailRoutingRoutingRuleUpdateResponseMatchersField `json:"field,required"`
- // Type of matcher.
- Type EmailRoutingRoutingRuleUpdateResponseMatchersType `json:"type,required"`
- // Value for matcher.
- Value string `json:"value,required"`
- JSON emailRoutingRoutingRuleUpdateResponseMatcherJSON `json:"-"`
-}
-
-// emailRoutingRoutingRuleUpdateResponseMatcherJSON contains the JSON metadata for
-// the struct [EmailRoutingRoutingRuleUpdateResponseMatcher]
-type emailRoutingRoutingRuleUpdateResponseMatcherJSON struct {
- Field apijson.Field
- Type apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *EmailRoutingRoutingRuleUpdateResponseMatcher) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r emailRoutingRoutingRuleUpdateResponseMatcherJSON) RawJSON() string {
- return r.raw
-}
-
-// Field for type matcher.
-type EmailRoutingRoutingRuleUpdateResponseMatchersField string
-
-const (
- EmailRoutingRoutingRuleUpdateResponseMatchersFieldTo EmailRoutingRoutingRuleUpdateResponseMatchersField = "to"
-)
-
-// Type of matcher.
-type EmailRoutingRoutingRuleUpdateResponseMatchersType string
-
-const (
- EmailRoutingRoutingRuleUpdateResponseMatchersTypeLiteral EmailRoutingRoutingRuleUpdateResponseMatchersType = "literal"
-)
-
-type EmailRoutingRoutingRuleListResponse struct {
- // Routing rule identifier.
- ID string `json:"id"`
- // List actions patterns.
- Actions []EmailRoutingRoutingRuleListResponseAction `json:"actions"`
- // Routing rule status.
- Enabled EmailRoutingRoutingRuleListResponseEnabled `json:"enabled"`
- // Matching patterns to forward to your actions.
- Matchers []EmailRoutingRoutingRuleListResponseMatcher `json:"matchers"`
- // Routing rule name.
- Name string `json:"name"`
- // Priority of the routing rule.
- Priority float64 `json:"priority"`
- // Routing rule tag. (Deprecated, replaced by routing rule identifier)
- Tag string `json:"tag"`
- JSON emailRoutingRoutingRuleListResponseJSON `json:"-"`
-}
-
-// emailRoutingRoutingRuleListResponseJSON contains the JSON metadata for the
-// struct [EmailRoutingRoutingRuleListResponse]
-type emailRoutingRoutingRuleListResponseJSON struct {
- ID apijson.Field
- Actions apijson.Field
- Enabled apijson.Field
- Matchers apijson.Field
- Name apijson.Field
- Priority apijson.Field
- Tag apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *EmailRoutingRoutingRuleListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r emailRoutingRoutingRuleListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// Actions pattern.
-type EmailRoutingRoutingRuleListResponseAction struct {
- // Type of supported action.
- Type EmailRoutingRoutingRuleListResponseActionsType `json:"type,required"`
- Value []string `json:"value,required"`
- JSON emailRoutingRoutingRuleListResponseActionJSON `json:"-"`
-}
-
-// emailRoutingRoutingRuleListResponseActionJSON contains the JSON metadata for the
-// struct [EmailRoutingRoutingRuleListResponseAction]
-type emailRoutingRoutingRuleListResponseActionJSON struct {
- Type apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *EmailRoutingRoutingRuleListResponseAction) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r emailRoutingRoutingRuleListResponseActionJSON) RawJSON() string {
- return r.raw
-}
-
-// Type of supported action.
-type EmailRoutingRoutingRuleListResponseActionsType string
-
-const (
- EmailRoutingRoutingRuleListResponseActionsTypeDrop EmailRoutingRoutingRuleListResponseActionsType = "drop"
- EmailRoutingRoutingRuleListResponseActionsTypeForward EmailRoutingRoutingRuleListResponseActionsType = "forward"
- EmailRoutingRoutingRuleListResponseActionsTypeWorker EmailRoutingRoutingRuleListResponseActionsType = "worker"
-)
-
-// Routing rule status.
-type EmailRoutingRoutingRuleListResponseEnabled bool
-
-const (
- EmailRoutingRoutingRuleListResponseEnabledTrue EmailRoutingRoutingRuleListResponseEnabled = true
- EmailRoutingRoutingRuleListResponseEnabledFalse EmailRoutingRoutingRuleListResponseEnabled = false
-)
-
-// Matching pattern to forward your actions.
-type EmailRoutingRoutingRuleListResponseMatcher struct {
- // Field for type matcher.
- Field EmailRoutingRoutingRuleListResponseMatchersField `json:"field,required"`
- // Type of matcher.
- Type EmailRoutingRoutingRuleListResponseMatchersType `json:"type,required"`
- // Value for matcher.
- Value string `json:"value,required"`
- JSON emailRoutingRoutingRuleListResponseMatcherJSON `json:"-"`
-}
-
-// emailRoutingRoutingRuleListResponseMatcherJSON contains the JSON metadata for
-// the struct [EmailRoutingRoutingRuleListResponseMatcher]
-type emailRoutingRoutingRuleListResponseMatcherJSON struct {
- Field apijson.Field
- Type apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *EmailRoutingRoutingRuleListResponseMatcher) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r emailRoutingRoutingRuleListResponseMatcherJSON) RawJSON() string {
- return r.raw
-}
-
-// Field for type matcher.
-type EmailRoutingRoutingRuleListResponseMatchersField string
-
-const (
- EmailRoutingRoutingRuleListResponseMatchersFieldTo EmailRoutingRoutingRuleListResponseMatchersField = "to"
-)
-
-// Type of matcher.
-type EmailRoutingRoutingRuleListResponseMatchersType string
-
-const (
- EmailRoutingRoutingRuleListResponseMatchersTypeLiteral EmailRoutingRoutingRuleListResponseMatchersType = "literal"
-)
-
-type EmailRoutingRoutingRuleDeleteResponse struct {
- // Routing rule identifier.
- ID string `json:"id"`
- // List actions patterns.
- Actions []EmailRoutingRoutingRuleDeleteResponseAction `json:"actions"`
- // Routing rule status.
- Enabled EmailRoutingRoutingRuleDeleteResponseEnabled `json:"enabled"`
- // Matching patterns to forward to your actions.
- Matchers []EmailRoutingRoutingRuleDeleteResponseMatcher `json:"matchers"`
- // Routing rule name.
- Name string `json:"name"`
- // Priority of the routing rule.
- Priority float64 `json:"priority"`
- // Routing rule tag. (Deprecated, replaced by routing rule identifier)
- Tag string `json:"tag"`
- JSON emailRoutingRoutingRuleDeleteResponseJSON `json:"-"`
-}
-
-// emailRoutingRoutingRuleDeleteResponseJSON contains the JSON metadata for the
-// struct [EmailRoutingRoutingRuleDeleteResponse]
-type emailRoutingRoutingRuleDeleteResponseJSON struct {
- ID apijson.Field
- Actions apijson.Field
- Enabled apijson.Field
- Matchers apijson.Field
- Name apijson.Field
- Priority apijson.Field
- Tag apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *EmailRoutingRoutingRuleDeleteResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r emailRoutingRoutingRuleDeleteResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// Actions pattern.
-type EmailRoutingRoutingRuleDeleteResponseAction struct {
- // Type of supported action.
- Type EmailRoutingRoutingRuleDeleteResponseActionsType `json:"type,required"`
- Value []string `json:"value,required"`
- JSON emailRoutingRoutingRuleDeleteResponseActionJSON `json:"-"`
-}
-
-// emailRoutingRoutingRuleDeleteResponseActionJSON contains the JSON metadata for
-// the struct [EmailRoutingRoutingRuleDeleteResponseAction]
-type emailRoutingRoutingRuleDeleteResponseActionJSON struct {
- Type apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *EmailRoutingRoutingRuleDeleteResponseAction) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r emailRoutingRoutingRuleDeleteResponseActionJSON) RawJSON() string {
- return r.raw
-}
-
-// Type of supported action.
-type EmailRoutingRoutingRuleDeleteResponseActionsType string
-
-const (
- EmailRoutingRoutingRuleDeleteResponseActionsTypeDrop EmailRoutingRoutingRuleDeleteResponseActionsType = "drop"
- EmailRoutingRoutingRuleDeleteResponseActionsTypeForward EmailRoutingRoutingRuleDeleteResponseActionsType = "forward"
- EmailRoutingRoutingRuleDeleteResponseActionsTypeWorker EmailRoutingRoutingRuleDeleteResponseActionsType = "worker"
-)
-
-// Routing rule status.
-type EmailRoutingRoutingRuleDeleteResponseEnabled bool
-
-const (
- EmailRoutingRoutingRuleDeleteResponseEnabledTrue EmailRoutingRoutingRuleDeleteResponseEnabled = true
- EmailRoutingRoutingRuleDeleteResponseEnabledFalse EmailRoutingRoutingRuleDeleteResponseEnabled = false
-)
-
-// Matching pattern to forward your actions.
-type EmailRoutingRoutingRuleDeleteResponseMatcher struct {
- // Field for type matcher.
- Field EmailRoutingRoutingRuleDeleteResponseMatchersField `json:"field,required"`
- // Type of matcher.
- Type EmailRoutingRoutingRuleDeleteResponseMatchersType `json:"type,required"`
- // Value for matcher.
- Value string `json:"value,required"`
- JSON emailRoutingRoutingRuleDeleteResponseMatcherJSON `json:"-"`
-}
-
-// emailRoutingRoutingRuleDeleteResponseMatcherJSON contains the JSON metadata for
-// the struct [EmailRoutingRoutingRuleDeleteResponseMatcher]
-type emailRoutingRoutingRuleDeleteResponseMatcherJSON struct {
- Field apijson.Field
- Type apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *EmailRoutingRoutingRuleDeleteResponseMatcher) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r emailRoutingRoutingRuleDeleteResponseMatcherJSON) RawJSON() string {
- return r.raw
-}
-
-// Field for type matcher.
-type EmailRoutingRoutingRuleDeleteResponseMatchersField string
-
-const (
- EmailRoutingRoutingRuleDeleteResponseMatchersFieldTo EmailRoutingRoutingRuleDeleteResponseMatchersField = "to"
-)
-
-// Type of matcher.
-type EmailRoutingRoutingRuleDeleteResponseMatchersType string
-
-const (
- EmailRoutingRoutingRuleDeleteResponseMatchersTypeLiteral EmailRoutingRoutingRuleDeleteResponseMatchersType = "literal"
-)
-
-type EmailRoutingRoutingRuleGetResponse struct {
- // Routing rule identifier.
- ID string `json:"id"`
- // List actions patterns.
- Actions []EmailRoutingRoutingRuleGetResponseAction `json:"actions"`
- // Routing rule status.
- Enabled EmailRoutingRoutingRuleGetResponseEnabled `json:"enabled"`
- // Matching patterns to forward to your actions.
- Matchers []EmailRoutingRoutingRuleGetResponseMatcher `json:"matchers"`
- // Routing rule name.
- Name string `json:"name"`
- // Priority of the routing rule.
- Priority float64 `json:"priority"`
- // Routing rule tag. (Deprecated, replaced by routing rule identifier)
- Tag string `json:"tag"`
- JSON emailRoutingRoutingRuleGetResponseJSON `json:"-"`
-}
-
-// emailRoutingRoutingRuleGetResponseJSON contains the JSON metadata for the struct
-// [EmailRoutingRoutingRuleGetResponse]
-type emailRoutingRoutingRuleGetResponseJSON struct {
- ID apijson.Field
- Actions apijson.Field
- Enabled apijson.Field
- Matchers apijson.Field
- Name apijson.Field
- Priority apijson.Field
- Tag apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *EmailRoutingRoutingRuleGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r emailRoutingRoutingRuleGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// Actions pattern.
-type EmailRoutingRoutingRuleGetResponseAction struct {
- // Type of supported action.
- Type EmailRoutingRoutingRuleGetResponseActionsType `json:"type,required"`
- Value []string `json:"value,required"`
- JSON emailRoutingRoutingRuleGetResponseActionJSON `json:"-"`
-}
-
-// emailRoutingRoutingRuleGetResponseActionJSON contains the JSON metadata for the
-// struct [EmailRoutingRoutingRuleGetResponseAction]
-type emailRoutingRoutingRuleGetResponseActionJSON struct {
- Type apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *EmailRoutingRoutingRuleGetResponseAction) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r emailRoutingRoutingRuleGetResponseActionJSON) RawJSON() string {
- return r.raw
-}
-
-// Type of supported action.
-type EmailRoutingRoutingRuleGetResponseActionsType string
-
-const (
- EmailRoutingRoutingRuleGetResponseActionsTypeDrop EmailRoutingRoutingRuleGetResponseActionsType = "drop"
- EmailRoutingRoutingRuleGetResponseActionsTypeForward EmailRoutingRoutingRuleGetResponseActionsType = "forward"
- EmailRoutingRoutingRuleGetResponseActionsTypeWorker EmailRoutingRoutingRuleGetResponseActionsType = "worker"
-)
-
-// Routing rule status.
-type EmailRoutingRoutingRuleGetResponseEnabled bool
-
-const (
- EmailRoutingRoutingRuleGetResponseEnabledTrue EmailRoutingRoutingRuleGetResponseEnabled = true
- EmailRoutingRoutingRuleGetResponseEnabledFalse EmailRoutingRoutingRuleGetResponseEnabled = false
-)
-
-// Matching pattern to forward your actions.
-type EmailRoutingRoutingRuleGetResponseMatcher struct {
- // Field for type matcher.
- Field EmailRoutingRoutingRuleGetResponseMatchersField `json:"field,required"`
- // Type of matcher.
- Type EmailRoutingRoutingRuleGetResponseMatchersType `json:"type,required"`
- // Value for matcher.
- Value string `json:"value,required"`
- JSON emailRoutingRoutingRuleGetResponseMatcherJSON `json:"-"`
-}
-
-// emailRoutingRoutingRuleGetResponseMatcherJSON contains the JSON metadata for the
-// struct [EmailRoutingRoutingRuleGetResponseMatcher]
-type emailRoutingRoutingRuleGetResponseMatcherJSON struct {
- Field apijson.Field
- Type apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *EmailRoutingRoutingRuleGetResponseMatcher) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r emailRoutingRoutingRuleGetResponseMatcherJSON) RawJSON() string {
- return r.raw
-}
-
-// Field for type matcher.
-type EmailRoutingRoutingRuleGetResponseMatchersField string
-
-const (
- EmailRoutingRoutingRuleGetResponseMatchersFieldTo EmailRoutingRoutingRuleGetResponseMatchersField = "to"
-)
-
-// Type of matcher.
-type EmailRoutingRoutingRuleGetResponseMatchersType string
-
-const (
- EmailRoutingRoutingRuleGetResponseMatchersTypeLiteral EmailRoutingRoutingRuleGetResponseMatchersType = "literal"
-)
-
-type EmailRoutingRoutingRuleNewParams struct {
- // List actions patterns.
- Actions param.Field[[]EmailRoutingRoutingRuleNewParamsAction] `json:"actions,required"`
- // Matching patterns to forward to your actions.
- Matchers param.Field[[]EmailRoutingRoutingRuleNewParamsMatcher] `json:"matchers,required"`
- // Routing rule status.
- Enabled param.Field[EmailRoutingRoutingRuleNewParamsEnabled] `json:"enabled"`
- // Routing rule name.
- Name param.Field[string] `json:"name"`
- // Priority of the routing rule.
- Priority param.Field[float64] `json:"priority"`
-}
-
-func (r EmailRoutingRoutingRuleNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Actions pattern.
-type EmailRoutingRoutingRuleNewParamsAction struct {
- // Type of supported action.
- Type param.Field[EmailRoutingRoutingRuleNewParamsActionsType] `json:"type,required"`
- Value param.Field[[]string] `json:"value,required"`
-}
-
-func (r EmailRoutingRoutingRuleNewParamsAction) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Type of supported action.
-type EmailRoutingRoutingRuleNewParamsActionsType string
-
-const (
- EmailRoutingRoutingRuleNewParamsActionsTypeDrop EmailRoutingRoutingRuleNewParamsActionsType = "drop"
- EmailRoutingRoutingRuleNewParamsActionsTypeForward EmailRoutingRoutingRuleNewParamsActionsType = "forward"
- EmailRoutingRoutingRuleNewParamsActionsTypeWorker EmailRoutingRoutingRuleNewParamsActionsType = "worker"
-)
-
-// Matching pattern to forward your actions.
-type EmailRoutingRoutingRuleNewParamsMatcher struct {
- // Field for type matcher.
- Field param.Field[EmailRoutingRoutingRuleNewParamsMatchersField] `json:"field,required"`
- // Type of matcher.
- Type param.Field[EmailRoutingRoutingRuleNewParamsMatchersType] `json:"type,required"`
- // Value for matcher.
- Value param.Field[string] `json:"value,required"`
-}
-
-func (r EmailRoutingRoutingRuleNewParamsMatcher) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Field for type matcher.
-type EmailRoutingRoutingRuleNewParamsMatchersField string
-
-const (
- EmailRoutingRoutingRuleNewParamsMatchersFieldTo EmailRoutingRoutingRuleNewParamsMatchersField = "to"
-)
-
-// Type of matcher.
-type EmailRoutingRoutingRuleNewParamsMatchersType string
-
-const (
- EmailRoutingRoutingRuleNewParamsMatchersTypeLiteral EmailRoutingRoutingRuleNewParamsMatchersType = "literal"
-)
-
-// Routing rule status.
-type EmailRoutingRoutingRuleNewParamsEnabled bool
-
-const (
- EmailRoutingRoutingRuleNewParamsEnabledTrue EmailRoutingRoutingRuleNewParamsEnabled = true
- EmailRoutingRoutingRuleNewParamsEnabledFalse EmailRoutingRoutingRuleNewParamsEnabled = false
-)
-
-type EmailRoutingRoutingRuleNewResponseEnvelope struct {
- Errors []EmailRoutingRoutingRuleNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []EmailRoutingRoutingRuleNewResponseEnvelopeMessages `json:"messages,required"`
- Result EmailRoutingRoutingRuleNewResponse `json:"result,required"`
- // Whether the API call was successful
- Success EmailRoutingRoutingRuleNewResponseEnvelopeSuccess `json:"success,required"`
- JSON emailRoutingRoutingRuleNewResponseEnvelopeJSON `json:"-"`
-}
-
-// emailRoutingRoutingRuleNewResponseEnvelopeJSON contains the JSON metadata for
-// the struct [EmailRoutingRoutingRuleNewResponseEnvelope]
-type emailRoutingRoutingRuleNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *EmailRoutingRoutingRuleNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r emailRoutingRoutingRuleNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type EmailRoutingRoutingRuleNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON emailRoutingRoutingRuleNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// emailRoutingRoutingRuleNewResponseEnvelopeErrorsJSON contains the JSON metadata
-// for the struct [EmailRoutingRoutingRuleNewResponseEnvelopeErrors]
-type emailRoutingRoutingRuleNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *EmailRoutingRoutingRuleNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r emailRoutingRoutingRuleNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type EmailRoutingRoutingRuleNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON emailRoutingRoutingRuleNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// emailRoutingRoutingRuleNewResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct [EmailRoutingRoutingRuleNewResponseEnvelopeMessages]
-type emailRoutingRoutingRuleNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *EmailRoutingRoutingRuleNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r emailRoutingRoutingRuleNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type EmailRoutingRoutingRuleNewResponseEnvelopeSuccess bool
-
-const (
- EmailRoutingRoutingRuleNewResponseEnvelopeSuccessTrue EmailRoutingRoutingRuleNewResponseEnvelopeSuccess = true
-)
-
-type EmailRoutingRoutingRuleUpdateParams struct {
- // List actions patterns.
- Actions param.Field[[]EmailRoutingRoutingRuleUpdateParamsAction] `json:"actions,required"`
- // Matching patterns to forward to your actions.
- Matchers param.Field[[]EmailRoutingRoutingRuleUpdateParamsMatcher] `json:"matchers,required"`
- // Routing rule status.
- Enabled param.Field[EmailRoutingRoutingRuleUpdateParamsEnabled] `json:"enabled"`
- // Routing rule name.
- Name param.Field[string] `json:"name"`
- // Priority of the routing rule.
- Priority param.Field[float64] `json:"priority"`
-}
-
-func (r EmailRoutingRoutingRuleUpdateParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Actions pattern.
-type EmailRoutingRoutingRuleUpdateParamsAction struct {
- // Type of supported action.
- Type param.Field[EmailRoutingRoutingRuleUpdateParamsActionsType] `json:"type,required"`
- Value param.Field[[]string] `json:"value,required"`
-}
-
-func (r EmailRoutingRoutingRuleUpdateParamsAction) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Type of supported action.
-type EmailRoutingRoutingRuleUpdateParamsActionsType string
-
-const (
- EmailRoutingRoutingRuleUpdateParamsActionsTypeDrop EmailRoutingRoutingRuleUpdateParamsActionsType = "drop"
- EmailRoutingRoutingRuleUpdateParamsActionsTypeForward EmailRoutingRoutingRuleUpdateParamsActionsType = "forward"
- EmailRoutingRoutingRuleUpdateParamsActionsTypeWorker EmailRoutingRoutingRuleUpdateParamsActionsType = "worker"
-)
-
-// Matching pattern to forward your actions.
-type EmailRoutingRoutingRuleUpdateParamsMatcher struct {
- // Field for type matcher.
- Field param.Field[EmailRoutingRoutingRuleUpdateParamsMatchersField] `json:"field,required"`
- // Type of matcher.
- Type param.Field[EmailRoutingRoutingRuleUpdateParamsMatchersType] `json:"type,required"`
- // Value for matcher.
- Value param.Field[string] `json:"value,required"`
-}
-
-func (r EmailRoutingRoutingRuleUpdateParamsMatcher) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Field for type matcher.
-type EmailRoutingRoutingRuleUpdateParamsMatchersField string
-
-const (
- EmailRoutingRoutingRuleUpdateParamsMatchersFieldTo EmailRoutingRoutingRuleUpdateParamsMatchersField = "to"
-)
-
-// Type of matcher.
-type EmailRoutingRoutingRuleUpdateParamsMatchersType string
-
-const (
- EmailRoutingRoutingRuleUpdateParamsMatchersTypeLiteral EmailRoutingRoutingRuleUpdateParamsMatchersType = "literal"
-)
-
-// Routing rule status.
-type EmailRoutingRoutingRuleUpdateParamsEnabled bool
-
-const (
- EmailRoutingRoutingRuleUpdateParamsEnabledTrue EmailRoutingRoutingRuleUpdateParamsEnabled = true
- EmailRoutingRoutingRuleUpdateParamsEnabledFalse EmailRoutingRoutingRuleUpdateParamsEnabled = false
-)
-
-type EmailRoutingRoutingRuleUpdateResponseEnvelope struct {
- Errors []EmailRoutingRoutingRuleUpdateResponseEnvelopeErrors `json:"errors,required"`
- Messages []EmailRoutingRoutingRuleUpdateResponseEnvelopeMessages `json:"messages,required"`
- Result EmailRoutingRoutingRuleUpdateResponse `json:"result,required"`
- // Whether the API call was successful
- Success EmailRoutingRoutingRuleUpdateResponseEnvelopeSuccess `json:"success,required"`
- JSON emailRoutingRoutingRuleUpdateResponseEnvelopeJSON `json:"-"`
-}
-
-// emailRoutingRoutingRuleUpdateResponseEnvelopeJSON contains the JSON metadata for
-// the struct [EmailRoutingRoutingRuleUpdateResponseEnvelope]
-type emailRoutingRoutingRuleUpdateResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *EmailRoutingRoutingRuleUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r emailRoutingRoutingRuleUpdateResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type EmailRoutingRoutingRuleUpdateResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON emailRoutingRoutingRuleUpdateResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// emailRoutingRoutingRuleUpdateResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct [EmailRoutingRoutingRuleUpdateResponseEnvelopeErrors]
-type emailRoutingRoutingRuleUpdateResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *EmailRoutingRoutingRuleUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r emailRoutingRoutingRuleUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type EmailRoutingRoutingRuleUpdateResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON emailRoutingRoutingRuleUpdateResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// emailRoutingRoutingRuleUpdateResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct [EmailRoutingRoutingRuleUpdateResponseEnvelopeMessages]
-type emailRoutingRoutingRuleUpdateResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *EmailRoutingRoutingRuleUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r emailRoutingRoutingRuleUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type EmailRoutingRoutingRuleUpdateResponseEnvelopeSuccess bool
-
-const (
- EmailRoutingRoutingRuleUpdateResponseEnvelopeSuccessTrue EmailRoutingRoutingRuleUpdateResponseEnvelopeSuccess = true
-)
-
-type EmailRoutingRoutingRuleListParams struct {
- // Filter by enabled routing rules.
- Enabled param.Field[EmailRoutingRoutingRuleListParamsEnabled] `query:"enabled"`
- // Page number of paginated results.
- Page param.Field[float64] `query:"page"`
- // Maximum number of results per page.
- PerPage param.Field[float64] `query:"per_page"`
-}
-
-// URLQuery serializes [EmailRoutingRoutingRuleListParams]'s query parameters as
-// `url.Values`.
-func (r EmailRoutingRoutingRuleListParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Filter by enabled routing rules.
-type EmailRoutingRoutingRuleListParamsEnabled bool
-
-const (
- EmailRoutingRoutingRuleListParamsEnabledTrue EmailRoutingRoutingRuleListParamsEnabled = true
- EmailRoutingRoutingRuleListParamsEnabledFalse EmailRoutingRoutingRuleListParamsEnabled = false
-)
-
-type EmailRoutingRoutingRuleDeleteResponseEnvelope struct {
- Errors []EmailRoutingRoutingRuleDeleteResponseEnvelopeErrors `json:"errors,required"`
- Messages []EmailRoutingRoutingRuleDeleteResponseEnvelopeMessages `json:"messages,required"`
- Result EmailRoutingRoutingRuleDeleteResponse `json:"result,required"`
- // Whether the API call was successful
- Success EmailRoutingRoutingRuleDeleteResponseEnvelopeSuccess `json:"success,required"`
- JSON emailRoutingRoutingRuleDeleteResponseEnvelopeJSON `json:"-"`
-}
-
-// emailRoutingRoutingRuleDeleteResponseEnvelopeJSON contains the JSON metadata for
-// the struct [EmailRoutingRoutingRuleDeleteResponseEnvelope]
-type emailRoutingRoutingRuleDeleteResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *EmailRoutingRoutingRuleDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r emailRoutingRoutingRuleDeleteResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type EmailRoutingRoutingRuleDeleteResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON emailRoutingRoutingRuleDeleteResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// emailRoutingRoutingRuleDeleteResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct [EmailRoutingRoutingRuleDeleteResponseEnvelopeErrors]
-type emailRoutingRoutingRuleDeleteResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *EmailRoutingRoutingRuleDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r emailRoutingRoutingRuleDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type EmailRoutingRoutingRuleDeleteResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON emailRoutingRoutingRuleDeleteResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// emailRoutingRoutingRuleDeleteResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct [EmailRoutingRoutingRuleDeleteResponseEnvelopeMessages]
-type emailRoutingRoutingRuleDeleteResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *EmailRoutingRoutingRuleDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r emailRoutingRoutingRuleDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type EmailRoutingRoutingRuleDeleteResponseEnvelopeSuccess bool
-
-const (
- EmailRoutingRoutingRuleDeleteResponseEnvelopeSuccessTrue EmailRoutingRoutingRuleDeleteResponseEnvelopeSuccess = true
-)
-
-type EmailRoutingRoutingRuleGetResponseEnvelope struct {
- Errors []EmailRoutingRoutingRuleGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []EmailRoutingRoutingRuleGetResponseEnvelopeMessages `json:"messages,required"`
- Result EmailRoutingRoutingRuleGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success EmailRoutingRoutingRuleGetResponseEnvelopeSuccess `json:"success,required"`
- JSON emailRoutingRoutingRuleGetResponseEnvelopeJSON `json:"-"`
-}
-
-// emailRoutingRoutingRuleGetResponseEnvelopeJSON contains the JSON metadata for
-// the struct [EmailRoutingRoutingRuleGetResponseEnvelope]
-type emailRoutingRoutingRuleGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *EmailRoutingRoutingRuleGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r emailRoutingRoutingRuleGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type EmailRoutingRoutingRuleGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON emailRoutingRoutingRuleGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// emailRoutingRoutingRuleGetResponseEnvelopeErrorsJSON contains the JSON metadata
-// for the struct [EmailRoutingRoutingRuleGetResponseEnvelopeErrors]
-type emailRoutingRoutingRuleGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *EmailRoutingRoutingRuleGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r emailRoutingRoutingRuleGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type EmailRoutingRoutingRuleGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON emailRoutingRoutingRuleGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// emailRoutingRoutingRuleGetResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct [EmailRoutingRoutingRuleGetResponseEnvelopeMessages]
-type emailRoutingRoutingRuleGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *EmailRoutingRoutingRuleGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r emailRoutingRoutingRuleGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type EmailRoutingRoutingRuleGetResponseEnvelopeSuccess bool
-
-const (
- EmailRoutingRoutingRuleGetResponseEnvelopeSuccessTrue EmailRoutingRoutingRuleGetResponseEnvelopeSuccess = true
-)
diff --git a/emailroutingroutingrule_test.go b/emailroutingroutingrule_test.go
deleted file mode 100644
index b091530ba9c..00000000000
--- a/emailroutingroutingrule_test.go
+++ /dev/null
@@ -1,213 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestEmailRoutingRoutingRuleNewWithOptionalParams(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"),
- )
- _, err := client.EmailRouting.Routing.Rules.New(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.EmailRoutingRoutingRuleNewParams{
- Actions: cloudflare.F([]cloudflare.EmailRoutingRoutingRuleNewParamsAction{{
- Type: cloudflare.F(cloudflare.EmailRoutingRoutingRuleNewParamsActionsTypeForward),
- Value: cloudflare.F([]string{"destinationaddress@example.net", "destinationaddress@example.net", "destinationaddress@example.net"}),
- }, {
- Type: cloudflare.F(cloudflare.EmailRoutingRoutingRuleNewParamsActionsTypeForward),
- Value: cloudflare.F([]string{"destinationaddress@example.net", "destinationaddress@example.net", "destinationaddress@example.net"}),
- }, {
- Type: cloudflare.F(cloudflare.EmailRoutingRoutingRuleNewParamsActionsTypeForward),
- Value: cloudflare.F([]string{"destinationaddress@example.net", "destinationaddress@example.net", "destinationaddress@example.net"}),
- }}),
- Matchers: cloudflare.F([]cloudflare.EmailRoutingRoutingRuleNewParamsMatcher{{
- Field: cloudflare.F(cloudflare.EmailRoutingRoutingRuleNewParamsMatchersFieldTo),
- Type: cloudflare.F(cloudflare.EmailRoutingRoutingRuleNewParamsMatchersTypeLiteral),
- Value: cloudflare.F("test@example.com"),
- }, {
- Field: cloudflare.F(cloudflare.EmailRoutingRoutingRuleNewParamsMatchersFieldTo),
- Type: cloudflare.F(cloudflare.EmailRoutingRoutingRuleNewParamsMatchersTypeLiteral),
- Value: cloudflare.F("test@example.com"),
- }, {
- Field: cloudflare.F(cloudflare.EmailRoutingRoutingRuleNewParamsMatchersFieldTo),
- Type: cloudflare.F(cloudflare.EmailRoutingRoutingRuleNewParamsMatchersTypeLiteral),
- Value: cloudflare.F("test@example.com"),
- }}),
- Enabled: cloudflare.F(cloudflare.EmailRoutingRoutingRuleNewParamsEnabledTrue),
- Name: cloudflare.F("Send to user@example.net rule."),
- Priority: cloudflare.F(0.000000),
- },
- )
- 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())
- }
-}
-
-func TestEmailRoutingRoutingRuleUpdateWithOptionalParams(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"),
- )
- _, err := client.EmailRouting.Routing.Rules.Update(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- "a7e6fb77503c41d8a7f3113c6918f10c",
- cloudflare.EmailRoutingRoutingRuleUpdateParams{
- Actions: cloudflare.F([]cloudflare.EmailRoutingRoutingRuleUpdateParamsAction{{
- Type: cloudflare.F(cloudflare.EmailRoutingRoutingRuleUpdateParamsActionsTypeForward),
- Value: cloudflare.F([]string{"destinationaddress@example.net", "destinationaddress@example.net", "destinationaddress@example.net"}),
- }, {
- Type: cloudflare.F(cloudflare.EmailRoutingRoutingRuleUpdateParamsActionsTypeForward),
- Value: cloudflare.F([]string{"destinationaddress@example.net", "destinationaddress@example.net", "destinationaddress@example.net"}),
- }, {
- Type: cloudflare.F(cloudflare.EmailRoutingRoutingRuleUpdateParamsActionsTypeForward),
- Value: cloudflare.F([]string{"destinationaddress@example.net", "destinationaddress@example.net", "destinationaddress@example.net"}),
- }}),
- Matchers: cloudflare.F([]cloudflare.EmailRoutingRoutingRuleUpdateParamsMatcher{{
- Field: cloudflare.F(cloudflare.EmailRoutingRoutingRuleUpdateParamsMatchersFieldTo),
- Type: cloudflare.F(cloudflare.EmailRoutingRoutingRuleUpdateParamsMatchersTypeLiteral),
- Value: cloudflare.F("test@example.com"),
- }, {
- Field: cloudflare.F(cloudflare.EmailRoutingRoutingRuleUpdateParamsMatchersFieldTo),
- Type: cloudflare.F(cloudflare.EmailRoutingRoutingRuleUpdateParamsMatchersTypeLiteral),
- Value: cloudflare.F("test@example.com"),
- }, {
- Field: cloudflare.F(cloudflare.EmailRoutingRoutingRuleUpdateParamsMatchersFieldTo),
- Type: cloudflare.F(cloudflare.EmailRoutingRoutingRuleUpdateParamsMatchersTypeLiteral),
- Value: cloudflare.F("test@example.com"),
- }}),
- Enabled: cloudflare.F(cloudflare.EmailRoutingRoutingRuleUpdateParamsEnabledTrue),
- Name: cloudflare.F("Send to user@example.net rule."),
- Priority: cloudflare.F(0.000000),
- },
- )
- 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())
- }
-}
-
-func TestEmailRoutingRoutingRuleListWithOptionalParams(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"),
- )
- _, err := client.EmailRouting.Routing.Rules.List(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.EmailRoutingRoutingRuleListParams{
- Enabled: cloudflare.F(cloudflare.EmailRoutingRoutingRuleListParamsEnabledTrue),
- Page: cloudflare.F(1.000000),
- PerPage: cloudflare.F(5.000000),
- },
- )
- 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())
- }
-}
-
-func TestEmailRoutingRoutingRuleDelete(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"),
- )
- _, err := client.EmailRouting.Routing.Rules.Delete(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- "a7e6fb77503c41d8a7f3113c6918f10c",
- )
- 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())
- }
-}
-
-func TestEmailRoutingRoutingRuleGet(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"),
- )
- _, err := client.EmailRouting.Routing.Rules.Get(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- "a7e6fb77503c41d8a7f3113c6918f10c",
- )
- 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/emailroutingroutingrulecatchall.go b/emailroutingroutingrulecatchall.go
deleted file mode 100644
index 39315f4e584..00000000000
--- a/emailroutingroutingrulecatchall.go
+++ /dev/null
@@ -1,503 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// EmailRoutingRoutingRuleCatchAllService contains methods and other services that
-// help with interacting with the cloudflare API. Note, unlike clients, this
-// service does not read variables from the environment automatically. You should
-// not instantiate this service directly, and instead use the
-// [NewEmailRoutingRoutingRuleCatchAllService] method instead.
-type EmailRoutingRoutingRuleCatchAllService struct {
- Options []option.RequestOption
-}
-
-// NewEmailRoutingRoutingRuleCatchAllService generates a new service that applies
-// the given options to each request. These options are applied after the parent
-// client's options (if there is one), and before any request-specific options.
-func NewEmailRoutingRoutingRuleCatchAllService(opts ...option.RequestOption) (r *EmailRoutingRoutingRuleCatchAllService) {
- r = &EmailRoutingRoutingRuleCatchAllService{}
- r.Options = opts
- return
-}
-
-// Enable or disable catch-all routing rule, or change action to forward to
-// specific destination address.
-func (r *EmailRoutingRoutingRuleCatchAllService) Update(ctx context.Context, zoneIdentifier string, body EmailRoutingRoutingRuleCatchAllUpdateParams, opts ...option.RequestOption) (res *EmailRoutingRoutingRuleCatchAllUpdateResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env EmailRoutingRoutingRuleCatchAllUpdateResponseEnvelope
- path := fmt.Sprintf("zones/%s/email/routing/rules/catch_all", zoneIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Get information on the default catch-all routing rule.
-func (r *EmailRoutingRoutingRuleCatchAllService) Get(ctx context.Context, zoneIdentifier string, opts ...option.RequestOption) (res *EmailRoutingRoutingRuleCatchAllGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env EmailRoutingRoutingRuleCatchAllGetResponseEnvelope
- path := fmt.Sprintf("zones/%s/email/routing/rules/catch_all", zoneIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type EmailRoutingRoutingRuleCatchAllUpdateResponse struct {
- // Routing rule identifier.
- ID string `json:"id"`
- // List actions for the catch-all routing rule.
- Actions []EmailRoutingRoutingRuleCatchAllUpdateResponseAction `json:"actions"`
- // Routing rule status.
- Enabled EmailRoutingRoutingRuleCatchAllUpdateResponseEnabled `json:"enabled"`
- // List of matchers for the catch-all routing rule.
- Matchers []EmailRoutingRoutingRuleCatchAllUpdateResponseMatcher `json:"matchers"`
- // Routing rule name.
- Name string `json:"name"`
- // Routing rule tag. (Deprecated, replaced by routing rule identifier)
- Tag string `json:"tag"`
- JSON emailRoutingRoutingRuleCatchAllUpdateResponseJSON `json:"-"`
-}
-
-// emailRoutingRoutingRuleCatchAllUpdateResponseJSON contains the JSON metadata for
-// the struct [EmailRoutingRoutingRuleCatchAllUpdateResponse]
-type emailRoutingRoutingRuleCatchAllUpdateResponseJSON struct {
- ID apijson.Field
- Actions apijson.Field
- Enabled apijson.Field
- Matchers apijson.Field
- Name apijson.Field
- Tag apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *EmailRoutingRoutingRuleCatchAllUpdateResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r emailRoutingRoutingRuleCatchAllUpdateResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// Action for the catch-all routing rule.
-type EmailRoutingRoutingRuleCatchAllUpdateResponseAction struct {
- // Type of action for catch-all rule.
- Type EmailRoutingRoutingRuleCatchAllUpdateResponseActionsType `json:"type,required"`
- Value []string `json:"value"`
- JSON emailRoutingRoutingRuleCatchAllUpdateResponseActionJSON `json:"-"`
-}
-
-// emailRoutingRoutingRuleCatchAllUpdateResponseActionJSON contains the JSON
-// metadata for the struct [EmailRoutingRoutingRuleCatchAllUpdateResponseAction]
-type emailRoutingRoutingRuleCatchAllUpdateResponseActionJSON struct {
- Type apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *EmailRoutingRoutingRuleCatchAllUpdateResponseAction) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r emailRoutingRoutingRuleCatchAllUpdateResponseActionJSON) RawJSON() string {
- return r.raw
-}
-
-// Type of action for catch-all rule.
-type EmailRoutingRoutingRuleCatchAllUpdateResponseActionsType string
-
-const (
- EmailRoutingRoutingRuleCatchAllUpdateResponseActionsTypeDrop EmailRoutingRoutingRuleCatchAllUpdateResponseActionsType = "drop"
- EmailRoutingRoutingRuleCatchAllUpdateResponseActionsTypeForward EmailRoutingRoutingRuleCatchAllUpdateResponseActionsType = "forward"
- EmailRoutingRoutingRuleCatchAllUpdateResponseActionsTypeWorker EmailRoutingRoutingRuleCatchAllUpdateResponseActionsType = "worker"
-)
-
-// Routing rule status.
-type EmailRoutingRoutingRuleCatchAllUpdateResponseEnabled bool
-
-const (
- EmailRoutingRoutingRuleCatchAllUpdateResponseEnabledTrue EmailRoutingRoutingRuleCatchAllUpdateResponseEnabled = true
- EmailRoutingRoutingRuleCatchAllUpdateResponseEnabledFalse EmailRoutingRoutingRuleCatchAllUpdateResponseEnabled = false
-)
-
-// Matcher for catch-all routing rule.
-type EmailRoutingRoutingRuleCatchAllUpdateResponseMatcher struct {
- // Type of matcher. Default is 'all'.
- Type EmailRoutingRoutingRuleCatchAllUpdateResponseMatchersType `json:"type,required"`
- JSON emailRoutingRoutingRuleCatchAllUpdateResponseMatcherJSON `json:"-"`
-}
-
-// emailRoutingRoutingRuleCatchAllUpdateResponseMatcherJSON contains the JSON
-// metadata for the struct [EmailRoutingRoutingRuleCatchAllUpdateResponseMatcher]
-type emailRoutingRoutingRuleCatchAllUpdateResponseMatcherJSON struct {
- Type apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *EmailRoutingRoutingRuleCatchAllUpdateResponseMatcher) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r emailRoutingRoutingRuleCatchAllUpdateResponseMatcherJSON) RawJSON() string {
- return r.raw
-}
-
-// Type of matcher. Default is 'all'.
-type EmailRoutingRoutingRuleCatchAllUpdateResponseMatchersType string
-
-const (
- EmailRoutingRoutingRuleCatchAllUpdateResponseMatchersTypeAll EmailRoutingRoutingRuleCatchAllUpdateResponseMatchersType = "all"
-)
-
-type EmailRoutingRoutingRuleCatchAllGetResponse struct {
- // Routing rule identifier.
- ID string `json:"id"`
- // List actions for the catch-all routing rule.
- Actions []EmailRoutingRoutingRuleCatchAllGetResponseAction `json:"actions"`
- // Routing rule status.
- Enabled EmailRoutingRoutingRuleCatchAllGetResponseEnabled `json:"enabled"`
- // List of matchers for the catch-all routing rule.
- Matchers []EmailRoutingRoutingRuleCatchAllGetResponseMatcher `json:"matchers"`
- // Routing rule name.
- Name string `json:"name"`
- // Routing rule tag. (Deprecated, replaced by routing rule identifier)
- Tag string `json:"tag"`
- JSON emailRoutingRoutingRuleCatchAllGetResponseJSON `json:"-"`
-}
-
-// emailRoutingRoutingRuleCatchAllGetResponseJSON contains the JSON metadata for
-// the struct [EmailRoutingRoutingRuleCatchAllGetResponse]
-type emailRoutingRoutingRuleCatchAllGetResponseJSON struct {
- ID apijson.Field
- Actions apijson.Field
- Enabled apijson.Field
- Matchers apijson.Field
- Name apijson.Field
- Tag apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *EmailRoutingRoutingRuleCatchAllGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r emailRoutingRoutingRuleCatchAllGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// Action for the catch-all routing rule.
-type EmailRoutingRoutingRuleCatchAllGetResponseAction struct {
- // Type of action for catch-all rule.
- Type EmailRoutingRoutingRuleCatchAllGetResponseActionsType `json:"type,required"`
- Value []string `json:"value"`
- JSON emailRoutingRoutingRuleCatchAllGetResponseActionJSON `json:"-"`
-}
-
-// emailRoutingRoutingRuleCatchAllGetResponseActionJSON contains the JSON metadata
-// for the struct [EmailRoutingRoutingRuleCatchAllGetResponseAction]
-type emailRoutingRoutingRuleCatchAllGetResponseActionJSON struct {
- Type apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *EmailRoutingRoutingRuleCatchAllGetResponseAction) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r emailRoutingRoutingRuleCatchAllGetResponseActionJSON) RawJSON() string {
- return r.raw
-}
-
-// Type of action for catch-all rule.
-type EmailRoutingRoutingRuleCatchAllGetResponseActionsType string
-
-const (
- EmailRoutingRoutingRuleCatchAllGetResponseActionsTypeDrop EmailRoutingRoutingRuleCatchAllGetResponseActionsType = "drop"
- EmailRoutingRoutingRuleCatchAllGetResponseActionsTypeForward EmailRoutingRoutingRuleCatchAllGetResponseActionsType = "forward"
- EmailRoutingRoutingRuleCatchAllGetResponseActionsTypeWorker EmailRoutingRoutingRuleCatchAllGetResponseActionsType = "worker"
-)
-
-// Routing rule status.
-type EmailRoutingRoutingRuleCatchAllGetResponseEnabled bool
-
-const (
- EmailRoutingRoutingRuleCatchAllGetResponseEnabledTrue EmailRoutingRoutingRuleCatchAllGetResponseEnabled = true
- EmailRoutingRoutingRuleCatchAllGetResponseEnabledFalse EmailRoutingRoutingRuleCatchAllGetResponseEnabled = false
-)
-
-// Matcher for catch-all routing rule.
-type EmailRoutingRoutingRuleCatchAllGetResponseMatcher struct {
- // Type of matcher. Default is 'all'.
- Type EmailRoutingRoutingRuleCatchAllGetResponseMatchersType `json:"type,required"`
- JSON emailRoutingRoutingRuleCatchAllGetResponseMatcherJSON `json:"-"`
-}
-
-// emailRoutingRoutingRuleCatchAllGetResponseMatcherJSON contains the JSON metadata
-// for the struct [EmailRoutingRoutingRuleCatchAllGetResponseMatcher]
-type emailRoutingRoutingRuleCatchAllGetResponseMatcherJSON struct {
- Type apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *EmailRoutingRoutingRuleCatchAllGetResponseMatcher) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r emailRoutingRoutingRuleCatchAllGetResponseMatcherJSON) RawJSON() string {
- return r.raw
-}
-
-// Type of matcher. Default is 'all'.
-type EmailRoutingRoutingRuleCatchAllGetResponseMatchersType string
-
-const (
- EmailRoutingRoutingRuleCatchAllGetResponseMatchersTypeAll EmailRoutingRoutingRuleCatchAllGetResponseMatchersType = "all"
-)
-
-type EmailRoutingRoutingRuleCatchAllUpdateParams struct {
- // List actions for the catch-all routing rule.
- Actions param.Field[[]EmailRoutingRoutingRuleCatchAllUpdateParamsAction] `json:"actions,required"`
- // List of matchers for the catch-all routing rule.
- Matchers param.Field[[]EmailRoutingRoutingRuleCatchAllUpdateParamsMatcher] `json:"matchers,required"`
- // Routing rule status.
- Enabled param.Field[EmailRoutingRoutingRuleCatchAllUpdateParamsEnabled] `json:"enabled"`
- // Routing rule name.
- Name param.Field[string] `json:"name"`
-}
-
-func (r EmailRoutingRoutingRuleCatchAllUpdateParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Action for the catch-all routing rule.
-type EmailRoutingRoutingRuleCatchAllUpdateParamsAction struct {
- // Type of action for catch-all rule.
- Type param.Field[EmailRoutingRoutingRuleCatchAllUpdateParamsActionsType] `json:"type,required"`
- Value param.Field[[]string] `json:"value"`
-}
-
-func (r EmailRoutingRoutingRuleCatchAllUpdateParamsAction) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Type of action for catch-all rule.
-type EmailRoutingRoutingRuleCatchAllUpdateParamsActionsType string
-
-const (
- EmailRoutingRoutingRuleCatchAllUpdateParamsActionsTypeDrop EmailRoutingRoutingRuleCatchAllUpdateParamsActionsType = "drop"
- EmailRoutingRoutingRuleCatchAllUpdateParamsActionsTypeForward EmailRoutingRoutingRuleCatchAllUpdateParamsActionsType = "forward"
- EmailRoutingRoutingRuleCatchAllUpdateParamsActionsTypeWorker EmailRoutingRoutingRuleCatchAllUpdateParamsActionsType = "worker"
-)
-
-// Matcher for catch-all routing rule.
-type EmailRoutingRoutingRuleCatchAllUpdateParamsMatcher struct {
- // Type of matcher. Default is 'all'.
- Type param.Field[EmailRoutingRoutingRuleCatchAllUpdateParamsMatchersType] `json:"type,required"`
-}
-
-func (r EmailRoutingRoutingRuleCatchAllUpdateParamsMatcher) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Type of matcher. Default is 'all'.
-type EmailRoutingRoutingRuleCatchAllUpdateParamsMatchersType string
-
-const (
- EmailRoutingRoutingRuleCatchAllUpdateParamsMatchersTypeAll EmailRoutingRoutingRuleCatchAllUpdateParamsMatchersType = "all"
-)
-
-// Routing rule status.
-type EmailRoutingRoutingRuleCatchAllUpdateParamsEnabled bool
-
-const (
- EmailRoutingRoutingRuleCatchAllUpdateParamsEnabledTrue EmailRoutingRoutingRuleCatchAllUpdateParamsEnabled = true
- EmailRoutingRoutingRuleCatchAllUpdateParamsEnabledFalse EmailRoutingRoutingRuleCatchAllUpdateParamsEnabled = false
-)
-
-type EmailRoutingRoutingRuleCatchAllUpdateResponseEnvelope struct {
- Errors []EmailRoutingRoutingRuleCatchAllUpdateResponseEnvelopeErrors `json:"errors,required"`
- Messages []EmailRoutingRoutingRuleCatchAllUpdateResponseEnvelopeMessages `json:"messages,required"`
- Result EmailRoutingRoutingRuleCatchAllUpdateResponse `json:"result,required"`
- // Whether the API call was successful
- Success EmailRoutingRoutingRuleCatchAllUpdateResponseEnvelopeSuccess `json:"success,required"`
- JSON emailRoutingRoutingRuleCatchAllUpdateResponseEnvelopeJSON `json:"-"`
-}
-
-// emailRoutingRoutingRuleCatchAllUpdateResponseEnvelopeJSON contains the JSON
-// metadata for the struct [EmailRoutingRoutingRuleCatchAllUpdateResponseEnvelope]
-type emailRoutingRoutingRuleCatchAllUpdateResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *EmailRoutingRoutingRuleCatchAllUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r emailRoutingRoutingRuleCatchAllUpdateResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type EmailRoutingRoutingRuleCatchAllUpdateResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON emailRoutingRoutingRuleCatchAllUpdateResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// emailRoutingRoutingRuleCatchAllUpdateResponseEnvelopeErrorsJSON contains the
-// JSON metadata for the struct
-// [EmailRoutingRoutingRuleCatchAllUpdateResponseEnvelopeErrors]
-type emailRoutingRoutingRuleCatchAllUpdateResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *EmailRoutingRoutingRuleCatchAllUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r emailRoutingRoutingRuleCatchAllUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type EmailRoutingRoutingRuleCatchAllUpdateResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON emailRoutingRoutingRuleCatchAllUpdateResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// emailRoutingRoutingRuleCatchAllUpdateResponseEnvelopeMessagesJSON contains the
-// JSON metadata for the struct
-// [EmailRoutingRoutingRuleCatchAllUpdateResponseEnvelopeMessages]
-type emailRoutingRoutingRuleCatchAllUpdateResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *EmailRoutingRoutingRuleCatchAllUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r emailRoutingRoutingRuleCatchAllUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type EmailRoutingRoutingRuleCatchAllUpdateResponseEnvelopeSuccess bool
-
-const (
- EmailRoutingRoutingRuleCatchAllUpdateResponseEnvelopeSuccessTrue EmailRoutingRoutingRuleCatchAllUpdateResponseEnvelopeSuccess = true
-)
-
-type EmailRoutingRoutingRuleCatchAllGetResponseEnvelope struct {
- Errors []EmailRoutingRoutingRuleCatchAllGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []EmailRoutingRoutingRuleCatchAllGetResponseEnvelopeMessages `json:"messages,required"`
- Result EmailRoutingRoutingRuleCatchAllGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success EmailRoutingRoutingRuleCatchAllGetResponseEnvelopeSuccess `json:"success,required"`
- JSON emailRoutingRoutingRuleCatchAllGetResponseEnvelopeJSON `json:"-"`
-}
-
-// emailRoutingRoutingRuleCatchAllGetResponseEnvelopeJSON contains the JSON
-// metadata for the struct [EmailRoutingRoutingRuleCatchAllGetResponseEnvelope]
-type emailRoutingRoutingRuleCatchAllGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *EmailRoutingRoutingRuleCatchAllGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r emailRoutingRoutingRuleCatchAllGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type EmailRoutingRoutingRuleCatchAllGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON emailRoutingRoutingRuleCatchAllGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// emailRoutingRoutingRuleCatchAllGetResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct
-// [EmailRoutingRoutingRuleCatchAllGetResponseEnvelopeErrors]
-type emailRoutingRoutingRuleCatchAllGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *EmailRoutingRoutingRuleCatchAllGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r emailRoutingRoutingRuleCatchAllGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type EmailRoutingRoutingRuleCatchAllGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON emailRoutingRoutingRuleCatchAllGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// emailRoutingRoutingRuleCatchAllGetResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct
-// [EmailRoutingRoutingRuleCatchAllGetResponseEnvelopeMessages]
-type emailRoutingRoutingRuleCatchAllGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *EmailRoutingRoutingRuleCatchAllGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r emailRoutingRoutingRuleCatchAllGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type EmailRoutingRoutingRuleCatchAllGetResponseEnvelopeSuccess bool
-
-const (
- EmailRoutingRoutingRuleCatchAllGetResponseEnvelopeSuccessTrue EmailRoutingRoutingRuleCatchAllGetResponseEnvelopeSuccess = true
-)
diff --git a/emailroutingroutingrulecatchall_test.go b/emailroutingroutingrulecatchall_test.go
deleted file mode 100644
index b644b9fe3cd..00000000000
--- a/emailroutingroutingrulecatchall_test.go
+++ /dev/null
@@ -1,86 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestEmailRoutingRoutingRuleCatchAllUpdateWithOptionalParams(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"),
- )
- _, err := client.EmailRouting.Routing.Rules.CatchAlls.Update(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.EmailRoutingRoutingRuleCatchAllUpdateParams{
- Actions: cloudflare.F([]cloudflare.EmailRoutingRoutingRuleCatchAllUpdateParamsAction{{
- Type: cloudflare.F(cloudflare.EmailRoutingRoutingRuleCatchAllUpdateParamsActionsTypeForward),
- Value: cloudflare.F([]string{"destinationaddress@example.net", "destinationaddress@example.net", "destinationaddress@example.net"}),
- }, {
- Type: cloudflare.F(cloudflare.EmailRoutingRoutingRuleCatchAllUpdateParamsActionsTypeForward),
- Value: cloudflare.F([]string{"destinationaddress@example.net", "destinationaddress@example.net", "destinationaddress@example.net"}),
- }, {
- Type: cloudflare.F(cloudflare.EmailRoutingRoutingRuleCatchAllUpdateParamsActionsTypeForward),
- Value: cloudflare.F([]string{"destinationaddress@example.net", "destinationaddress@example.net", "destinationaddress@example.net"}),
- }}),
- Matchers: cloudflare.F([]cloudflare.EmailRoutingRoutingRuleCatchAllUpdateParamsMatcher{{
- Type: cloudflare.F(cloudflare.EmailRoutingRoutingRuleCatchAllUpdateParamsMatchersTypeAll),
- }, {
- Type: cloudflare.F(cloudflare.EmailRoutingRoutingRuleCatchAllUpdateParamsMatchersTypeAll),
- }, {
- Type: cloudflare.F(cloudflare.EmailRoutingRoutingRuleCatchAllUpdateParamsMatchersTypeAll),
- }}),
- Enabled: cloudflare.F(cloudflare.EmailRoutingRoutingRuleCatchAllUpdateParamsEnabledTrue),
- Name: cloudflare.F("Send to user@example.net rule."),
- },
- )
- 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())
- }
-}
-
-func TestEmailRoutingRoutingRuleCatchAllGet(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"),
- )
- _, err := client.EmailRouting.Routing.Rules.CatchAlls.Get(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353")
- 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/filter.go b/filter.go
deleted file mode 100644
index 44f45fd4858..00000000000
--- a/filter.go
+++ /dev/null
@@ -1,682 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// FilterService contains methods and other services that help with interacting
-// with the cloudflare API. Note, unlike clients, this service does not read
-// variables from the environment automatically. You should not instantiate this
-// service directly, and instead use the [NewFilterService] method instead.
-type FilterService struct {
- Options []option.RequestOption
-}
-
-// NewFilterService generates a new service that applies the given options to each
-// request. These options are applied after the parent client's options (if there
-// is one), and before any request-specific options.
-func NewFilterService(opts ...option.RequestOption) (r *FilterService) {
- r = &FilterService{}
- r.Options = opts
- return
-}
-
-// Creates one or more filters.
-func (r *FilterService) New(ctx context.Context, zoneIdentifier string, body FilterNewParams, opts ...option.RequestOption) (res *[]FilterNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env FilterNewResponseEnvelope
- path := fmt.Sprintf("zones/%s/filters", zoneIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Updates an existing filter.
-func (r *FilterService) Update(ctx context.Context, zoneIdentifier string, id string, body FilterUpdateParams, opts ...option.RequestOption) (res *FilterUpdateResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env FilterUpdateResponseEnvelope
- path := fmt.Sprintf("zones/%s/filters/%s", zoneIdentifier, id)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Fetches filters in a zone. You can filter the results using several optional
-// parameters.
-func (r *FilterService) List(ctx context.Context, zoneIdentifier string, query FilterListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[FilterListResponse], err error) {
- var raw *http.Response
- opts = append(r.Options, opts...)
- opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
- path := fmt.Sprintf("zones/%s/filters", zoneIdentifier)
- cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...)
- if err != nil {
- return nil, err
- }
- err = cfg.Execute()
- if err != nil {
- return nil, err
- }
- res.SetPageConfig(cfg, raw)
- return res, nil
-}
-
-// Fetches filters in a zone. You can filter the results using several optional
-// parameters.
-func (r *FilterService) ListAutoPaging(ctx context.Context, zoneIdentifier string, query FilterListParams, opts ...option.RequestOption) *shared.V4PagePaginationArrayAutoPager[FilterListResponse] {
- return shared.NewV4PagePaginationArrayAutoPager(r.List(ctx, zoneIdentifier, query, opts...))
-}
-
-// Deletes an existing filter.
-func (r *FilterService) Delete(ctx context.Context, zoneIdentifier string, id string, opts ...option.RequestOption) (res *FilterDeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env FilterDeleteResponseEnvelope
- path := fmt.Sprintf("zones/%s/filters/%s", zoneIdentifier, id)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Fetches the details of a filter.
-func (r *FilterService) Get(ctx context.Context, zoneIdentifier string, id string, opts ...option.RequestOption) (res *FilterGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env FilterGetResponseEnvelope
- path := fmt.Sprintf("zones/%s/filters/%s", zoneIdentifier, id)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type FilterNewResponse struct {
- // The unique identifier of the filter.
- ID string `json:"id,required"`
- // The filter expression. For more information, refer to
- // [Expressions](https://developers.cloudflare.com/ruleset-engine/rules-language/expressions/).
- Expression string `json:"expression,required"`
- // When true, indicates that the filter is currently paused.
- Paused bool `json:"paused,required"`
- // An informative summary of the filter.
- Description string `json:"description"`
- // A short reference tag. Allows you to select related filters.
- Ref string `json:"ref"`
- JSON filterNewResponseJSON `json:"-"`
-}
-
-// filterNewResponseJSON contains the JSON metadata for the struct
-// [FilterNewResponse]
-type filterNewResponseJSON struct {
- ID apijson.Field
- Expression apijson.Field
- Paused apijson.Field
- Description apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FilterNewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r filterNewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type FilterUpdateResponse struct {
- // The unique identifier of the filter.
- ID string `json:"id,required"`
- // The filter expression. For more information, refer to
- // [Expressions](https://developers.cloudflare.com/ruleset-engine/rules-language/expressions/).
- Expression string `json:"expression,required"`
- // When true, indicates that the filter is currently paused.
- Paused bool `json:"paused,required"`
- // An informative summary of the filter.
- Description string `json:"description"`
- // A short reference tag. Allows you to select related filters.
- Ref string `json:"ref"`
- JSON filterUpdateResponseJSON `json:"-"`
-}
-
-// filterUpdateResponseJSON contains the JSON metadata for the struct
-// [FilterUpdateResponse]
-type filterUpdateResponseJSON struct {
- ID apijson.Field
- Expression apijson.Field
- Paused apijson.Field
- Description apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FilterUpdateResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r filterUpdateResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type FilterListResponse struct {
- // The unique identifier of the filter.
- ID string `json:"id,required"`
- // The filter expression. For more information, refer to
- // [Expressions](https://developers.cloudflare.com/ruleset-engine/rules-language/expressions/).
- Expression string `json:"expression,required"`
- // When true, indicates that the filter is currently paused.
- Paused bool `json:"paused,required"`
- // An informative summary of the filter.
- Description string `json:"description"`
- // A short reference tag. Allows you to select related filters.
- Ref string `json:"ref"`
- JSON filterListResponseJSON `json:"-"`
-}
-
-// filterListResponseJSON contains the JSON metadata for the struct
-// [FilterListResponse]
-type filterListResponseJSON struct {
- ID apijson.Field
- Expression apijson.Field
- Paused apijson.Field
- Description apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FilterListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r filterListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type FilterDeleteResponse struct {
- // The unique identifier of the filter.
- ID string `json:"id,required"`
- // An informative summary of the filter.
- Description string `json:"description"`
- // The filter expression. For more information, refer to
- // [Expressions](https://developers.cloudflare.com/ruleset-engine/rules-language/expressions/).
- Expression string `json:"expression"`
- // When true, indicates that the filter is currently paused.
- Paused bool `json:"paused"`
- // A short reference tag. Allows you to select related filters.
- Ref string `json:"ref"`
- JSON filterDeleteResponseJSON `json:"-"`
-}
-
-// filterDeleteResponseJSON contains the JSON metadata for the struct
-// [FilterDeleteResponse]
-type filterDeleteResponseJSON struct {
- ID apijson.Field
- Description apijson.Field
- Expression apijson.Field
- Paused apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FilterDeleteResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r filterDeleteResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type FilterGetResponse struct {
- // The unique identifier of the filter.
- ID string `json:"id,required"`
- // The filter expression. For more information, refer to
- // [Expressions](https://developers.cloudflare.com/ruleset-engine/rules-language/expressions/).
- Expression string `json:"expression,required"`
- // When true, indicates that the filter is currently paused.
- Paused bool `json:"paused,required"`
- // An informative summary of the filter.
- Description string `json:"description"`
- // A short reference tag. Allows you to select related filters.
- Ref string `json:"ref"`
- JSON filterGetResponseJSON `json:"-"`
-}
-
-// filterGetResponseJSON contains the JSON metadata for the struct
-// [FilterGetResponse]
-type filterGetResponseJSON struct {
- ID apijson.Field
- Expression apijson.Field
- Paused apijson.Field
- Description apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FilterGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r filterGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type FilterNewParams struct {
- Body param.Field[interface{}] `json:"body,required"`
-}
-
-func (r FilterNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r.Body)
-}
-
-type FilterNewResponseEnvelope struct {
- Errors []FilterNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []FilterNewResponseEnvelopeMessages `json:"messages,required"`
- Result []FilterNewResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success FilterNewResponseEnvelopeSuccess `json:"success,required"`
- ResultInfo FilterNewResponseEnvelopeResultInfo `json:"result_info"`
- JSON filterNewResponseEnvelopeJSON `json:"-"`
-}
-
-// filterNewResponseEnvelopeJSON contains the JSON metadata for the struct
-// [FilterNewResponseEnvelope]
-type filterNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- ResultInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FilterNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r filterNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type FilterNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON filterNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// filterNewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
-// [FilterNewResponseEnvelopeErrors]
-type filterNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FilterNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r filterNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type FilterNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON filterNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// filterNewResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
-// [FilterNewResponseEnvelopeMessages]
-type filterNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FilterNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r filterNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type FilterNewResponseEnvelopeSuccess bool
-
-const (
- FilterNewResponseEnvelopeSuccessTrue FilterNewResponseEnvelopeSuccess = true
-)
-
-type FilterNewResponseEnvelopeResultInfo struct {
- // Total number of results for the requested service
- Count float64 `json:"count"`
- // Current page within paginated list of results
- Page float64 `json:"page"`
- // Number of results per page of results
- PerPage float64 `json:"per_page"`
- // Total results available without any search parameters
- TotalCount float64 `json:"total_count"`
- JSON filterNewResponseEnvelopeResultInfoJSON `json:"-"`
-}
-
-// filterNewResponseEnvelopeResultInfoJSON contains the JSON metadata for the
-// struct [FilterNewResponseEnvelopeResultInfo]
-type filterNewResponseEnvelopeResultInfoJSON struct {
- Count apijson.Field
- Page apijson.Field
- PerPage apijson.Field
- TotalCount apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FilterNewResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r filterNewResponseEnvelopeResultInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type FilterUpdateParams struct {
- Body param.Field[interface{}] `json:"body,required"`
-}
-
-func (r FilterUpdateParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r.Body)
-}
-
-type FilterUpdateResponseEnvelope struct {
- Errors []FilterUpdateResponseEnvelopeErrors `json:"errors,required"`
- Messages []FilterUpdateResponseEnvelopeMessages `json:"messages,required"`
- Result FilterUpdateResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success FilterUpdateResponseEnvelopeSuccess `json:"success,required"`
- JSON filterUpdateResponseEnvelopeJSON `json:"-"`
-}
-
-// filterUpdateResponseEnvelopeJSON contains the JSON metadata for the struct
-// [FilterUpdateResponseEnvelope]
-type filterUpdateResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FilterUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r filterUpdateResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type FilterUpdateResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON filterUpdateResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// filterUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
-// [FilterUpdateResponseEnvelopeErrors]
-type filterUpdateResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FilterUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r filterUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type FilterUpdateResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON filterUpdateResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// filterUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [FilterUpdateResponseEnvelopeMessages]
-type filterUpdateResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FilterUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r filterUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type FilterUpdateResponseEnvelopeSuccess bool
-
-const (
- FilterUpdateResponseEnvelopeSuccessTrue FilterUpdateResponseEnvelopeSuccess = true
-)
-
-type FilterListParams struct {
- // A case-insensitive string to find in the description.
- Description param.Field[string] `query:"description"`
- // A case-insensitive string to find in the expression.
- Expression param.Field[string] `query:"expression"`
- // Page number of paginated results.
- Page param.Field[float64] `query:"page"`
- // When true, indicates that the filter is currently paused.
- Paused param.Field[bool] `query:"paused"`
- // Number of filters per page.
- PerPage param.Field[float64] `query:"per_page"`
- // The filter ref (a short reference tag) to search for. Must be an exact match.
- Ref param.Field[string] `query:"ref"`
-}
-
-// URLQuery serializes [FilterListParams]'s query parameters as `url.Values`.
-func (r FilterListParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type FilterDeleteResponseEnvelope struct {
- Errors []FilterDeleteResponseEnvelopeErrors `json:"errors,required"`
- Messages []FilterDeleteResponseEnvelopeMessages `json:"messages,required"`
- Result FilterDeleteResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success FilterDeleteResponseEnvelopeSuccess `json:"success,required"`
- JSON filterDeleteResponseEnvelopeJSON `json:"-"`
-}
-
-// filterDeleteResponseEnvelopeJSON contains the JSON metadata for the struct
-// [FilterDeleteResponseEnvelope]
-type filterDeleteResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FilterDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r filterDeleteResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type FilterDeleteResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON filterDeleteResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// filterDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
-// [FilterDeleteResponseEnvelopeErrors]
-type filterDeleteResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FilterDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r filterDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type FilterDeleteResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON filterDeleteResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// filterDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [FilterDeleteResponseEnvelopeMessages]
-type filterDeleteResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FilterDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r filterDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type FilterDeleteResponseEnvelopeSuccess bool
-
-const (
- FilterDeleteResponseEnvelopeSuccessTrue FilterDeleteResponseEnvelopeSuccess = true
-)
-
-type FilterGetResponseEnvelope struct {
- Errors []FilterGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []FilterGetResponseEnvelopeMessages `json:"messages,required"`
- Result FilterGetResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success FilterGetResponseEnvelopeSuccess `json:"success,required"`
- JSON filterGetResponseEnvelopeJSON `json:"-"`
-}
-
-// filterGetResponseEnvelopeJSON contains the JSON metadata for the struct
-// [FilterGetResponseEnvelope]
-type filterGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FilterGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r filterGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type FilterGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON filterGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// filterGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
-// [FilterGetResponseEnvelopeErrors]
-type filterGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FilterGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r filterGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type FilterGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON filterGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// filterGetResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
-// [FilterGetResponseEnvelopeMessages]
-type filterGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FilterGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r filterGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type FilterGetResponseEnvelopeSuccess bool
-
-const (
- FilterGetResponseEnvelopeSuccessTrue FilterGetResponseEnvelopeSuccess = true
-)
diff --git a/filter_test.go b/filter_test.go
deleted file mode 100644
index f38dc018bc4..00000000000
--- a/filter_test.go
+++ /dev/null
@@ -1,166 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestFilterNew(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"),
- )
- _, err := client.Filters.New(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.FilterNewParams{
- Body: cloudflare.F[any](map[string]interface{}{}),
- },
- )
- 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())
- }
-}
-
-func TestFilterUpdate(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"),
- )
- _, err := client.Filters.Update(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- "372e67954025e0ba6aaa6d586b9e0b61",
- cloudflare.FilterUpdateParams{
- Body: cloudflare.F[any](map[string]interface{}{}),
- },
- )
- 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())
- }
-}
-
-func TestFilterListWithOptionalParams(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"),
- )
- _, err := client.Filters.List(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.FilterListParams{
- Description: cloudflare.F("browsers"),
- Expression: cloudflare.F("php"),
- Page: cloudflare.F(1.000000),
- Paused: cloudflare.F(false),
- PerPage: cloudflare.F(5.000000),
- Ref: cloudflare.F("FIL-100"),
- },
- )
- 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())
- }
-}
-
-func TestFilterDelete(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"),
- )
- _, err := client.Filters.Delete(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- "372e67954025e0ba6aaa6d586b9e0b61",
- )
- 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())
- }
-}
-
-func TestFilterGet(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"),
- )
- _, err := client.Filters.Get(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- "372e67954025e0ba6aaa6d586b9e0b61",
- )
- 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/filters/aliases.go b/filters/aliases.go
new file mode 100644
index 00000000000..a02fc7e23c0
--- /dev/null
+++ b/filters/aliases.go
@@ -0,0 +1,9 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package filters
+
+import (
+ "github.com/cloudflare/cloudflare-go/internal/apierror"
+)
+
+type Error = apierror.Error
diff --git a/filters/filter.go b/filters/filter.go
new file mode 100644
index 00000000000..e15aafde717
--- /dev/null
+++ b/filters/filter.go
@@ -0,0 +1,543 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package filters
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// FilterService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewFilterService] method instead.
+type FilterService struct {
+ Options []option.RequestOption
+}
+
+// NewFilterService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewFilterService(opts ...option.RequestOption) (r *FilterService) {
+ r = &FilterService{}
+ r.Options = opts
+ return
+}
+
+// Creates one or more filters.
+func (r *FilterService) New(ctx context.Context, zoneIdentifier string, body FilterNewParams, opts ...option.RequestOption) (res *[]LegacyJhsFilter, err error) {
+ opts = append(r.Options[:], opts...)
+ var env FilterNewResponseEnvelope
+ path := fmt.Sprintf("zones/%s/filters", zoneIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Updates an existing filter.
+func (r *FilterService) Update(ctx context.Context, zoneIdentifier string, id string, body FilterUpdateParams, opts ...option.RequestOption) (res *LegacyJhsFilter, err error) {
+ opts = append(r.Options[:], opts...)
+ var env FilterUpdateResponseEnvelope
+ path := fmt.Sprintf("zones/%s/filters/%s", zoneIdentifier, id)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Fetches filters in a zone. You can filter the results using several optional
+// parameters.
+func (r *FilterService) List(ctx context.Context, zoneIdentifier string, query FilterListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[LegacyJhsFilter], err error) {
+ var raw *http.Response
+ opts = append(r.Options, opts...)
+ opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
+ path := fmt.Sprintf("zones/%s/filters", zoneIdentifier)
+ cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...)
+ if err != nil {
+ return nil, err
+ }
+ err = cfg.Execute()
+ if err != nil {
+ return nil, err
+ }
+ res.SetPageConfig(cfg, raw)
+ return res, nil
+}
+
+// Fetches filters in a zone. You can filter the results using several optional
+// parameters.
+func (r *FilterService) ListAutoPaging(ctx context.Context, zoneIdentifier string, query FilterListParams, opts ...option.RequestOption) *shared.V4PagePaginationArrayAutoPager[LegacyJhsFilter] {
+ return shared.NewV4PagePaginationArrayAutoPager(r.List(ctx, zoneIdentifier, query, opts...))
+}
+
+// Deletes an existing filter.
+func (r *FilterService) Delete(ctx context.Context, zoneIdentifier string, id string, opts ...option.RequestOption) (res *LegacyJhsFilter, err error) {
+ opts = append(r.Options[:], opts...)
+ var env FilterDeleteResponseEnvelope
+ path := fmt.Sprintf("zones/%s/filters/%s", zoneIdentifier, id)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Fetches the details of a filter.
+func (r *FilterService) Get(ctx context.Context, zoneIdentifier string, id string, opts ...option.RequestOption) (res *LegacyJhsFilter, err error) {
+ opts = append(r.Options[:], opts...)
+ var env FilterGetResponseEnvelope
+ path := fmt.Sprintf("zones/%s/filters/%s", zoneIdentifier, id)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type LegacyJhsFilter struct {
+ // The unique identifier of the filter.
+ ID string `json:"id"`
+ // An informative summary of the filter.
+ Description string `json:"description"`
+ // The filter expression. For more information, refer to
+ // [Expressions](https://developers.cloudflare.com/ruleset-engine/rules-language/expressions/).
+ Expression string `json:"expression"`
+ // When true, indicates that the filter is currently paused.
+ Paused bool `json:"paused"`
+ // A short reference tag. Allows you to select related filters.
+ Ref string `json:"ref"`
+ JSON legacyJhsFilterJSON `json:"-"`
+}
+
+// legacyJhsFilterJSON contains the JSON metadata for the struct [LegacyJhsFilter]
+type legacyJhsFilterJSON struct {
+ ID apijson.Field
+ Description apijson.Field
+ Expression apijson.Field
+ Paused apijson.Field
+ Ref apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LegacyJhsFilter) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r legacyJhsFilterJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r LegacyJhsFilter) implementsFirewallLegacyJhsFilterRuleFilter() {}
+
+type FilterNewParams struct {
+ Body param.Field[interface{}] `json:"body,required"`
+}
+
+func (r FilterNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r.Body)
+}
+
+type FilterNewResponseEnvelope struct {
+ Errors []FilterNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []FilterNewResponseEnvelopeMessages `json:"messages,required"`
+ Result []LegacyJhsFilter `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success FilterNewResponseEnvelopeSuccess `json:"success,required"`
+ ResultInfo FilterNewResponseEnvelopeResultInfo `json:"result_info"`
+ JSON filterNewResponseEnvelopeJSON `json:"-"`
+}
+
+// filterNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [FilterNewResponseEnvelope]
+type filterNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ ResultInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *FilterNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r filterNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type FilterNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON filterNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// filterNewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [FilterNewResponseEnvelopeErrors]
+type filterNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *FilterNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r filterNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type FilterNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON filterNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// filterNewResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [FilterNewResponseEnvelopeMessages]
+type filterNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *FilterNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r filterNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type FilterNewResponseEnvelopeSuccess bool
+
+const (
+ FilterNewResponseEnvelopeSuccessTrue FilterNewResponseEnvelopeSuccess = true
+)
+
+type FilterNewResponseEnvelopeResultInfo struct {
+ // Total number of results for the requested service
+ Count float64 `json:"count"`
+ // Current page within paginated list of results
+ Page float64 `json:"page"`
+ // Number of results per page of results
+ PerPage float64 `json:"per_page"`
+ // Total results available without any search parameters
+ TotalCount float64 `json:"total_count"`
+ JSON filterNewResponseEnvelopeResultInfoJSON `json:"-"`
+}
+
+// filterNewResponseEnvelopeResultInfoJSON contains the JSON metadata for the
+// struct [FilterNewResponseEnvelopeResultInfo]
+type filterNewResponseEnvelopeResultInfoJSON struct {
+ Count apijson.Field
+ Page apijson.Field
+ PerPage apijson.Field
+ TotalCount apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *FilterNewResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r filterNewResponseEnvelopeResultInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type FilterUpdateParams struct {
+ Body param.Field[interface{}] `json:"body,required"`
+}
+
+func (r FilterUpdateParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r.Body)
+}
+
+type FilterUpdateResponseEnvelope struct {
+ Errors []FilterUpdateResponseEnvelopeErrors `json:"errors,required"`
+ Messages []FilterUpdateResponseEnvelopeMessages `json:"messages,required"`
+ Result LegacyJhsFilter `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success FilterUpdateResponseEnvelopeSuccess `json:"success,required"`
+ JSON filterUpdateResponseEnvelopeJSON `json:"-"`
+}
+
+// filterUpdateResponseEnvelopeJSON contains the JSON metadata for the struct
+// [FilterUpdateResponseEnvelope]
+type filterUpdateResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *FilterUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r filterUpdateResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type FilterUpdateResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON filterUpdateResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// filterUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [FilterUpdateResponseEnvelopeErrors]
+type filterUpdateResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *FilterUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r filterUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type FilterUpdateResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON filterUpdateResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// filterUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [FilterUpdateResponseEnvelopeMessages]
+type filterUpdateResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *FilterUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r filterUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type FilterUpdateResponseEnvelopeSuccess bool
+
+const (
+ FilterUpdateResponseEnvelopeSuccessTrue FilterUpdateResponseEnvelopeSuccess = true
+)
+
+type FilterListParams struct {
+ // A case-insensitive string to find in the description.
+ Description param.Field[string] `query:"description"`
+ // A case-insensitive string to find in the expression.
+ Expression param.Field[string] `query:"expression"`
+ // Page number of paginated results.
+ Page param.Field[float64] `query:"page"`
+ // When true, indicates that the filter is currently paused.
+ Paused param.Field[bool] `query:"paused"`
+ // Number of filters per page.
+ PerPage param.Field[float64] `query:"per_page"`
+ // The filter ref (a short reference tag) to search for. Must be an exact match.
+ Ref param.Field[string] `query:"ref"`
+}
+
+// URLQuery serializes [FilterListParams]'s query parameters as `url.Values`.
+func (r FilterListParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type FilterDeleteResponseEnvelope struct {
+ Errors []FilterDeleteResponseEnvelopeErrors `json:"errors,required"`
+ Messages []FilterDeleteResponseEnvelopeMessages `json:"messages,required"`
+ Result LegacyJhsFilter `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success FilterDeleteResponseEnvelopeSuccess `json:"success,required"`
+ JSON filterDeleteResponseEnvelopeJSON `json:"-"`
+}
+
+// filterDeleteResponseEnvelopeJSON contains the JSON metadata for the struct
+// [FilterDeleteResponseEnvelope]
+type filterDeleteResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *FilterDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r filterDeleteResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type FilterDeleteResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON filterDeleteResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// filterDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [FilterDeleteResponseEnvelopeErrors]
+type filterDeleteResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *FilterDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r filterDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type FilterDeleteResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON filterDeleteResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// filterDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [FilterDeleteResponseEnvelopeMessages]
+type filterDeleteResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *FilterDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r filterDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type FilterDeleteResponseEnvelopeSuccess bool
+
+const (
+ FilterDeleteResponseEnvelopeSuccessTrue FilterDeleteResponseEnvelopeSuccess = true
+)
+
+type FilterGetResponseEnvelope struct {
+ Errors []FilterGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []FilterGetResponseEnvelopeMessages `json:"messages,required"`
+ Result LegacyJhsFilter `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success FilterGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON filterGetResponseEnvelopeJSON `json:"-"`
+}
+
+// filterGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [FilterGetResponseEnvelope]
+type filterGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *FilterGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r filterGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type FilterGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON filterGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// filterGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [FilterGetResponseEnvelopeErrors]
+type filterGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *FilterGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r filterGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type FilterGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON filterGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// filterGetResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [FilterGetResponseEnvelopeMessages]
+type filterGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *FilterGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r filterGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type FilterGetResponseEnvelopeSuccess bool
+
+const (
+ FilterGetResponseEnvelopeSuccessTrue FilterGetResponseEnvelopeSuccess = true
+)
diff --git a/filters/filter_test.go b/filters/filter_test.go
new file mode 100644
index 00000000000..4386b8b7951
--- /dev/null
+++ b/filters/filter_test.go
@@ -0,0 +1,167 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package filters_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/filters"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestFilterNew(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"),
+ )
+ _, err := client.Filters.New(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ filters.FilterNewParams{
+ Body: cloudflare.F[any](map[string]interface{}{}),
+ },
+ )
+ 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())
+ }
+}
+
+func TestFilterUpdate(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"),
+ )
+ _, err := client.Filters.Update(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ "372e67954025e0ba6aaa6d586b9e0b61",
+ filters.FilterUpdateParams{
+ Body: cloudflare.F[any](map[string]interface{}{}),
+ },
+ )
+ 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())
+ }
+}
+
+func TestFilterListWithOptionalParams(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"),
+ )
+ _, err := client.Filters.List(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ filters.FilterListParams{
+ Description: cloudflare.F("browsers"),
+ Expression: cloudflare.F("php"),
+ Page: cloudflare.F(1.000000),
+ Paused: cloudflare.F(false),
+ PerPage: cloudflare.F(5.000000),
+ Ref: cloudflare.F("FIL-100"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestFilterDelete(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"),
+ )
+ _, err := client.Filters.Delete(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ "372e67954025e0ba6aaa6d586b9e0b61",
+ )
+ 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())
+ }
+}
+
+func TestFilterGet(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"),
+ )
+ _, err := client.Filters.Get(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ "372e67954025e0ba6aaa6d586b9e0b61",
+ )
+ 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/firewall.go b/firewall.go
deleted file mode 100644
index 30c9d7f2928..00000000000
--- a/firewall.go
+++ /dev/null
@@ -1,34 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// FirewallService contains methods and other services that help with interacting
-// with the cloudflare API. Note, unlike clients, this service does not read
-// variables from the environment automatically. You should not instantiate this
-// service directly, and instead use the [NewFirewallService] method instead.
-type FirewallService struct {
- Options []option.RequestOption
- Lockdowns *FirewallLockdownService
- Rules *FirewallRuleService
- AccessRules *FirewallAccessRuleService
- UARules *FirewallUARuleService
- WAF *FirewallWAFService
-}
-
-// NewFirewallService generates a new service that applies the given options to
-// each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewFirewallService(opts ...option.RequestOption) (r *FirewallService) {
- r = &FirewallService{}
- r.Options = opts
- r.Lockdowns = NewFirewallLockdownService(opts...)
- r.Rules = NewFirewallRuleService(opts...)
- r.AccessRules = NewFirewallAccessRuleService(opts...)
- r.UARules = NewFirewallUARuleService(opts...)
- r.WAF = NewFirewallWAFService(opts...)
- return
-}
diff --git a/firewall/accessrule.go b/firewall/accessrule.go
new file mode 100644
index 00000000000..cefb9e0cfd8
--- /dev/null
+++ b/firewall/accessrule.go
@@ -0,0 +1,1027 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package firewall
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+ "reflect"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/tidwall/gjson"
+)
+
+// AccessRuleService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewAccessRuleService] method instead.
+type AccessRuleService struct {
+ Options []option.RequestOption
+}
+
+// NewAccessRuleService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewAccessRuleService(opts ...option.RequestOption) (r *AccessRuleService) {
+ r = &AccessRuleService{}
+ r.Options = opts
+ return
+}
+
+// Creates a new IP Access rule for an account or zone. The rule will apply to all
+// zones in the account or zone.
+//
+// Note: To create an IP Access rule that applies to a single zone, refer to the
+// [IP Access rules for a zone](#ip-access-rules-for-a-zone) endpoints.
+func (r *AccessRuleService) New(ctx context.Context, params AccessRuleNewParams, opts ...option.RequestOption) (res *AccessRuleNewResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AccessRuleNewResponseEnvelope
+ var accountOrZone string
+ var accountOrZoneID param.Field[string]
+ if params.AccountID.Present {
+ accountOrZone = "accounts"
+ accountOrZoneID = params.AccountID
+ } else {
+ accountOrZone = "zones"
+ accountOrZoneID = params.ZoneID
+ }
+ path := fmt.Sprintf("%s/%s/firewall/access_rules/rules", accountOrZone, accountOrZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Fetches IP Access rules of an account or zone. These rules apply to all the
+// zones in the account or zone. You can filter the results using several optional
+// parameters.
+func (r *AccessRuleService) List(ctx context.Context, params AccessRuleListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[AccessRuleListResponse], err error) {
+ var raw *http.Response
+ opts = append(r.Options, opts...)
+ opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
+ var accountOrZone string
+ var accountOrZoneID param.Field[string]
+ if params.AccountID.Present {
+ accountOrZone = "accounts"
+ accountOrZoneID = params.AccountID
+ } else {
+ accountOrZone = "zones"
+ accountOrZoneID = params.ZoneID
+ }
+ path := fmt.Sprintf("%s/%s/firewall/access_rules/rules", accountOrZone, accountOrZoneID)
+ cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, params, &res, opts...)
+ if err != nil {
+ return nil, err
+ }
+ err = cfg.Execute()
+ if err != nil {
+ return nil, err
+ }
+ res.SetPageConfig(cfg, raw)
+ return res, nil
+}
+
+// Fetches IP Access rules of an account or zone. These rules apply to all the
+// zones in the account or zone. You can filter the results using several optional
+// parameters.
+func (r *AccessRuleService) ListAutoPaging(ctx context.Context, params AccessRuleListParams, opts ...option.RequestOption) *shared.V4PagePaginationArrayAutoPager[AccessRuleListResponse] {
+ return shared.NewV4PagePaginationArrayAutoPager(r.List(ctx, params, opts...))
+}
+
+// Deletes an existing IP Access rule defined.
+//
+// Note: This operation will affect all zones in the account or zone.
+func (r *AccessRuleService) Delete(ctx context.Context, identifier interface{}, body AccessRuleDeleteParams, opts ...option.RequestOption) (res *AccessRuleDeleteResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AccessRuleDeleteResponseEnvelope
+ var accountOrZone string
+ var accountOrZoneID param.Field[string]
+ if body.AccountID.Present {
+ accountOrZone = "accounts"
+ accountOrZoneID = body.AccountID
+ } else {
+ accountOrZone = "zones"
+ accountOrZoneID = body.ZoneID
+ }
+ path := fmt.Sprintf("%s/%s/firewall/access_rules/rules/%v", accountOrZone, accountOrZoneID, identifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Updates an IP Access rule defined at the account level.
+//
+// Note: This operation will affect all zones in the account.
+func (r *AccessRuleService) Edit(ctx context.Context, identifier interface{}, params AccessRuleEditParams, opts ...option.RequestOption) (res *AccessRuleEditResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AccessRuleEditResponseEnvelope
+ var accountOrZone string
+ var accountOrZoneID param.Field[string]
+ if params.AccountID.Present {
+ accountOrZone = "accounts"
+ accountOrZoneID = params.AccountID
+ } else {
+ accountOrZone = "zones"
+ accountOrZoneID = params.ZoneID
+ }
+ path := fmt.Sprintf("%s/%s/firewall/access_rules/rules/%v", accountOrZone, accountOrZoneID, identifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Fetches the details of an IP Access rule defined.
+func (r *AccessRuleService) Get(ctx context.Context, identifier interface{}, query AccessRuleGetParams, opts ...option.RequestOption) (res *AccessRuleGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AccessRuleGetResponseEnvelope
+ var accountOrZone string
+ var accountOrZoneID param.Field[string]
+ if query.AccountID.Present {
+ accountOrZone = "accounts"
+ accountOrZoneID = query.AccountID
+ } else {
+ accountOrZone = "zones"
+ accountOrZoneID = query.ZoneID
+ }
+ path := fmt.Sprintf("%s/%s/firewall/access_rules/rules/%v", accountOrZone, accountOrZoneID, identifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Union satisfied by [firewall.AccessRuleNewResponseUnknown] or
+// [shared.UnionString].
+type AccessRuleNewResponse interface {
+ ImplementsFirewallAccessRuleNewResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*AccessRuleNewResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+type AccessRuleListResponse = interface{}
+
+type AccessRuleDeleteResponse struct {
+ // Identifier
+ ID string `json:"id,required"`
+ JSON accessRuleDeleteResponseJSON `json:"-"`
+}
+
+// accessRuleDeleteResponseJSON contains the JSON metadata for the struct
+// [AccessRuleDeleteResponse]
+type accessRuleDeleteResponseJSON struct {
+ ID apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AccessRuleDeleteResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r accessRuleDeleteResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+// Union satisfied by [firewall.AccessRuleEditResponseUnknown] or
+// [shared.UnionString].
+type AccessRuleEditResponse interface {
+ ImplementsFirewallAccessRuleEditResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*AccessRuleEditResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+// Union satisfied by [firewall.AccessRuleGetResponseUnknown] or
+// [shared.UnionString].
+type AccessRuleGetResponse interface {
+ ImplementsFirewallAccessRuleGetResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*AccessRuleGetResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+type AccessRuleNewParams struct {
+ // The rule configuration.
+ Configuration param.Field[AccessRuleNewParamsConfiguration] `json:"configuration,required"`
+ // The action to apply to a matched request.
+ Mode param.Field[AccessRuleNewParamsMode] `json:"mode,required"`
+ // The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+ AccountID param.Field[string] `path:"account_id"`
+ // The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+ ZoneID param.Field[string] `path:"zone_id"`
+ // An informative summary of the rule, typically used as a reminder or explanation.
+ Notes param.Field[string] `json:"notes"`
+}
+
+func (r AccessRuleNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The rule configuration.
+//
+// Satisfied by
+// [firewall.AccessRuleNewParamsConfigurationLegacyJhsIPConfiguration],
+// [firewall.AccessRuleNewParamsConfigurationLegacyJhsIPV6Configuration],
+// [firewall.AccessRuleNewParamsConfigurationLegacyJhsCidrConfiguration],
+// [firewall.AccessRuleNewParamsConfigurationLegacyJhsASNConfiguration],
+// [firewall.AccessRuleNewParamsConfigurationLegacyJhsCountryConfiguration].
+type AccessRuleNewParamsConfiguration interface {
+ implementsFirewallAccessRuleNewParamsConfiguration()
+}
+
+type AccessRuleNewParamsConfigurationLegacyJhsIPConfiguration struct {
+ // The configuration target. You must set the target to `ip` when specifying an IP
+ // address in the rule.
+ Target param.Field[AccessRuleNewParamsConfigurationLegacyJhsIPConfigurationTarget] `json:"target"`
+ // The IP address to match. This address will be compared to the IP address of
+ // incoming requests.
+ Value param.Field[string] `json:"value"`
+}
+
+func (r AccessRuleNewParamsConfigurationLegacyJhsIPConfiguration) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+func (r AccessRuleNewParamsConfigurationLegacyJhsIPConfiguration) implementsFirewallAccessRuleNewParamsConfiguration() {
+}
+
+// The configuration target. You must set the target to `ip` when specifying an IP
+// address in the rule.
+type AccessRuleNewParamsConfigurationLegacyJhsIPConfigurationTarget string
+
+const (
+ AccessRuleNewParamsConfigurationLegacyJhsIPConfigurationTargetIP AccessRuleNewParamsConfigurationLegacyJhsIPConfigurationTarget = "ip"
+)
+
+type AccessRuleNewParamsConfigurationLegacyJhsIPV6Configuration struct {
+ // The configuration target. You must set the target to `ip6` when specifying an
+ // IPv6 address in the rule.
+ Target param.Field[AccessRuleNewParamsConfigurationLegacyJhsIPV6ConfigurationTarget] `json:"target"`
+ // The IPv6 address to match.
+ Value param.Field[string] `json:"value"`
+}
+
+func (r AccessRuleNewParamsConfigurationLegacyJhsIPV6Configuration) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+func (r AccessRuleNewParamsConfigurationLegacyJhsIPV6Configuration) implementsFirewallAccessRuleNewParamsConfiguration() {
+}
+
+// The configuration target. You must set the target to `ip6` when specifying an
+// IPv6 address in the rule.
+type AccessRuleNewParamsConfigurationLegacyJhsIPV6ConfigurationTarget string
+
+const (
+ AccessRuleNewParamsConfigurationLegacyJhsIPV6ConfigurationTargetIp6 AccessRuleNewParamsConfigurationLegacyJhsIPV6ConfigurationTarget = "ip6"
+)
+
+type AccessRuleNewParamsConfigurationLegacyJhsCidrConfiguration struct {
+ // The configuration target. You must set the target to `ip_range` when specifying
+ // an IP address range in the rule.
+ Target param.Field[AccessRuleNewParamsConfigurationLegacyJhsCidrConfigurationTarget] `json:"target"`
+ // The IP address range to match. You can only use prefix lengths `/16` and `/24`
+ // for IPv4 ranges, and prefix lengths `/32`, `/48`, and `/64` for IPv6 ranges.
+ Value param.Field[string] `json:"value"`
+}
+
+func (r AccessRuleNewParamsConfigurationLegacyJhsCidrConfiguration) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+func (r AccessRuleNewParamsConfigurationLegacyJhsCidrConfiguration) implementsFirewallAccessRuleNewParamsConfiguration() {
+}
+
+// The configuration target. You must set the target to `ip_range` when specifying
+// an IP address range in the rule.
+type AccessRuleNewParamsConfigurationLegacyJhsCidrConfigurationTarget string
+
+const (
+ AccessRuleNewParamsConfigurationLegacyJhsCidrConfigurationTargetIPRange AccessRuleNewParamsConfigurationLegacyJhsCidrConfigurationTarget = "ip_range"
+)
+
+type AccessRuleNewParamsConfigurationLegacyJhsASNConfiguration struct {
+ // The configuration target. You must set the target to `asn` when specifying an
+ // Autonomous System Number (ASN) in the rule.
+ Target param.Field[AccessRuleNewParamsConfigurationLegacyJhsASNConfigurationTarget] `json:"target"`
+ // The AS number to match.
+ Value param.Field[string] `json:"value"`
+}
+
+func (r AccessRuleNewParamsConfigurationLegacyJhsASNConfiguration) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+func (r AccessRuleNewParamsConfigurationLegacyJhsASNConfiguration) implementsFirewallAccessRuleNewParamsConfiguration() {
+}
+
+// The configuration target. You must set the target to `asn` when specifying an
+// Autonomous System Number (ASN) in the rule.
+type AccessRuleNewParamsConfigurationLegacyJhsASNConfigurationTarget string
+
+const (
+ AccessRuleNewParamsConfigurationLegacyJhsASNConfigurationTargetASN AccessRuleNewParamsConfigurationLegacyJhsASNConfigurationTarget = "asn"
+)
+
+type AccessRuleNewParamsConfigurationLegacyJhsCountryConfiguration struct {
+ // The configuration target. You must set the target to `country` when specifying a
+ // country code in the rule.
+ Target param.Field[AccessRuleNewParamsConfigurationLegacyJhsCountryConfigurationTarget] `json:"target"`
+ // The two-letter ISO-3166-1 alpha-2 code to match. For more information, refer to
+ // [IP Access rules: Parameters](https://developers.cloudflare.com/waf/tools/ip-access-rules/parameters/#country).
+ Value param.Field[string] `json:"value"`
+}
+
+func (r AccessRuleNewParamsConfigurationLegacyJhsCountryConfiguration) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+func (r AccessRuleNewParamsConfigurationLegacyJhsCountryConfiguration) implementsFirewallAccessRuleNewParamsConfiguration() {
+}
+
+// The configuration target. You must set the target to `country` when specifying a
+// country code in the rule.
+type AccessRuleNewParamsConfigurationLegacyJhsCountryConfigurationTarget string
+
+const (
+ AccessRuleNewParamsConfigurationLegacyJhsCountryConfigurationTargetCountry AccessRuleNewParamsConfigurationLegacyJhsCountryConfigurationTarget = "country"
+)
+
+// The action to apply to a matched request.
+type AccessRuleNewParamsMode string
+
+const (
+ AccessRuleNewParamsModeBlock AccessRuleNewParamsMode = "block"
+ AccessRuleNewParamsModeChallenge AccessRuleNewParamsMode = "challenge"
+ AccessRuleNewParamsModeWhitelist AccessRuleNewParamsMode = "whitelist"
+ AccessRuleNewParamsModeJsChallenge AccessRuleNewParamsMode = "js_challenge"
+ AccessRuleNewParamsModeManagedChallenge AccessRuleNewParamsMode = "managed_challenge"
+)
+
+type AccessRuleNewResponseEnvelope struct {
+ Errors []AccessRuleNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []AccessRuleNewResponseEnvelopeMessages `json:"messages,required"`
+ Result AccessRuleNewResponse `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success AccessRuleNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON accessRuleNewResponseEnvelopeJSON `json:"-"`
+}
+
+// accessRuleNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [AccessRuleNewResponseEnvelope]
+type accessRuleNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AccessRuleNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r accessRuleNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AccessRuleNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON accessRuleNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// accessRuleNewResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [AccessRuleNewResponseEnvelopeErrors]
+type accessRuleNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AccessRuleNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r accessRuleNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type AccessRuleNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON accessRuleNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// accessRuleNewResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [AccessRuleNewResponseEnvelopeMessages]
+type accessRuleNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AccessRuleNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r accessRuleNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type AccessRuleNewResponseEnvelopeSuccess bool
+
+const (
+ AccessRuleNewResponseEnvelopeSuccessTrue AccessRuleNewResponseEnvelopeSuccess = true
+)
+
+type AccessRuleListParams struct {
+ // The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+ AccountID param.Field[string] `path:"account_id"`
+ // The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+ ZoneID param.Field[string] `path:"zone_id"`
+ // The direction used to sort returned rules.
+ Direction param.Field[AccessRuleListParamsDirection] `query:"direction"`
+ EgsPagination param.Field[AccessRuleListParamsEgsPagination] `query:"egs-pagination"`
+ Filters param.Field[AccessRuleListParamsFilters] `query:"filters"`
+ // The field used to sort returned rules.
+ Order param.Field[AccessRuleListParamsOrder] `query:"order"`
+ // Requested page within paginated list of results.
+ Page param.Field[float64] `query:"page"`
+ // Maximum number of results requested.
+ PerPage param.Field[float64] `query:"per_page"`
+}
+
+// URLQuery serializes [AccessRuleListParams]'s query parameters as `url.Values`.
+func (r AccessRuleListParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// The direction used to sort returned rules.
+type AccessRuleListParamsDirection string
+
+const (
+ AccessRuleListParamsDirectionAsc AccessRuleListParamsDirection = "asc"
+ AccessRuleListParamsDirectionDesc AccessRuleListParamsDirection = "desc"
+)
+
+type AccessRuleListParamsEgsPagination struct {
+ Json param.Field[AccessRuleListParamsEgsPaginationJson] `query:"json"`
+}
+
+// URLQuery serializes [AccessRuleListParamsEgsPagination]'s query parameters as
+// `url.Values`.
+func (r AccessRuleListParamsEgsPagination) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type AccessRuleListParamsEgsPaginationJson struct {
+ // The page number of paginated results.
+ Page param.Field[float64] `query:"page"`
+ // The maximum number of results per page. You can only set the value to `1` or to
+ // a multiple of 5 such as `5`, `10`, `15`, or `20`.
+ PerPage param.Field[float64] `query:"per_page"`
+}
+
+// URLQuery serializes [AccessRuleListParamsEgsPaginationJson]'s query parameters
+// as `url.Values`.
+func (r AccessRuleListParamsEgsPaginationJson) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type AccessRuleListParamsFilters struct {
+ // The target to search in existing rules.
+ ConfigurationTarget param.Field[AccessRuleListParamsFiltersConfigurationTarget] `query:"configuration.target"`
+ // The target value to search for in existing rules: an IP address, an IP address
+ // range, or a country code, depending on the provided `configuration.target`.
+ // Notes: You can search for a single IPv4 address, an IP address range with a
+ // subnet of '/16' or '/24', or a two-letter ISO-3166-1 alpha-2 country code.
+ ConfigurationValue param.Field[string] `query:"configuration.value"`
+ // When set to `all`, all the search requirements must match. When set to `any`,
+ // only one of the search requirements has to match.
+ Match param.Field[AccessRuleListParamsFiltersMatch] `query:"match"`
+ // The action to apply to a matched request.
+ Mode param.Field[AccessRuleListParamsFiltersMode] `query:"mode"`
+ // The string to search for in the notes of existing IP Access rules. Notes: For
+ // example, the string 'attack' would match IP Access rules with notes 'Attack
+ // 26/02' and 'Attack 27/02'. The search is case insensitive.
+ Notes param.Field[string] `query:"notes"`
+}
+
+// URLQuery serializes [AccessRuleListParamsFilters]'s query parameters as
+// `url.Values`.
+func (r AccessRuleListParamsFilters) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// The target to search in existing rules.
+type AccessRuleListParamsFiltersConfigurationTarget string
+
+const (
+ AccessRuleListParamsFiltersConfigurationTargetIP AccessRuleListParamsFiltersConfigurationTarget = "ip"
+ AccessRuleListParamsFiltersConfigurationTargetIPRange AccessRuleListParamsFiltersConfigurationTarget = "ip_range"
+ AccessRuleListParamsFiltersConfigurationTargetASN AccessRuleListParamsFiltersConfigurationTarget = "asn"
+ AccessRuleListParamsFiltersConfigurationTargetCountry AccessRuleListParamsFiltersConfigurationTarget = "country"
+)
+
+// When set to `all`, all the search requirements must match. When set to `any`,
+// only one of the search requirements has to match.
+type AccessRuleListParamsFiltersMatch string
+
+const (
+ AccessRuleListParamsFiltersMatchAny AccessRuleListParamsFiltersMatch = "any"
+ AccessRuleListParamsFiltersMatchAll AccessRuleListParamsFiltersMatch = "all"
+)
+
+// The action to apply to a matched request.
+type AccessRuleListParamsFiltersMode string
+
+const (
+ AccessRuleListParamsFiltersModeBlock AccessRuleListParamsFiltersMode = "block"
+ AccessRuleListParamsFiltersModeChallenge AccessRuleListParamsFiltersMode = "challenge"
+ AccessRuleListParamsFiltersModeWhitelist AccessRuleListParamsFiltersMode = "whitelist"
+ AccessRuleListParamsFiltersModeJsChallenge AccessRuleListParamsFiltersMode = "js_challenge"
+ AccessRuleListParamsFiltersModeManagedChallenge AccessRuleListParamsFiltersMode = "managed_challenge"
+)
+
+// The field used to sort returned rules.
+type AccessRuleListParamsOrder string
+
+const (
+ AccessRuleListParamsOrderConfigurationTarget AccessRuleListParamsOrder = "configuration.target"
+ AccessRuleListParamsOrderConfigurationValue AccessRuleListParamsOrder = "configuration.value"
+ AccessRuleListParamsOrderMode AccessRuleListParamsOrder = "mode"
+)
+
+type AccessRuleDeleteParams struct {
+ // The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+ AccountID param.Field[string] `path:"account_id"`
+ // The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+ ZoneID param.Field[string] `path:"zone_id"`
+}
+
+type AccessRuleDeleteResponseEnvelope struct {
+ Errors []AccessRuleDeleteResponseEnvelopeErrors `json:"errors,required"`
+ Messages []AccessRuleDeleteResponseEnvelopeMessages `json:"messages,required"`
+ Result AccessRuleDeleteResponse `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success AccessRuleDeleteResponseEnvelopeSuccess `json:"success,required"`
+ JSON accessRuleDeleteResponseEnvelopeJSON `json:"-"`
+}
+
+// accessRuleDeleteResponseEnvelopeJSON contains the JSON metadata for the struct
+// [AccessRuleDeleteResponseEnvelope]
+type accessRuleDeleteResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AccessRuleDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r accessRuleDeleteResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AccessRuleDeleteResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON accessRuleDeleteResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// accessRuleDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [AccessRuleDeleteResponseEnvelopeErrors]
+type accessRuleDeleteResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AccessRuleDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r accessRuleDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type AccessRuleDeleteResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON accessRuleDeleteResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// accessRuleDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [AccessRuleDeleteResponseEnvelopeMessages]
+type accessRuleDeleteResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AccessRuleDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r accessRuleDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type AccessRuleDeleteResponseEnvelopeSuccess bool
+
+const (
+ AccessRuleDeleteResponseEnvelopeSuccessTrue AccessRuleDeleteResponseEnvelopeSuccess = true
+)
+
+type AccessRuleEditParams struct {
+ // The rule configuration.
+ Configuration param.Field[AccessRuleEditParamsConfiguration] `json:"configuration,required"`
+ // The action to apply to a matched request.
+ Mode param.Field[AccessRuleEditParamsMode] `json:"mode,required"`
+ // The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+ AccountID param.Field[string] `path:"account_id"`
+ // The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+ ZoneID param.Field[string] `path:"zone_id"`
+ // An informative summary of the rule, typically used as a reminder or explanation.
+ Notes param.Field[string] `json:"notes"`
+}
+
+func (r AccessRuleEditParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The rule configuration.
+//
+// Satisfied by
+// [firewall.AccessRuleEditParamsConfigurationLegacyJhsIPConfiguration],
+// [firewall.AccessRuleEditParamsConfigurationLegacyJhsIPV6Configuration],
+// [firewall.AccessRuleEditParamsConfigurationLegacyJhsCidrConfiguration],
+// [firewall.AccessRuleEditParamsConfigurationLegacyJhsASNConfiguration],
+// [firewall.AccessRuleEditParamsConfigurationLegacyJhsCountryConfiguration].
+type AccessRuleEditParamsConfiguration interface {
+ implementsFirewallAccessRuleEditParamsConfiguration()
+}
+
+type AccessRuleEditParamsConfigurationLegacyJhsIPConfiguration struct {
+ // The configuration target. You must set the target to `ip` when specifying an IP
+ // address in the rule.
+ Target param.Field[AccessRuleEditParamsConfigurationLegacyJhsIPConfigurationTarget] `json:"target"`
+ // The IP address to match. This address will be compared to the IP address of
+ // incoming requests.
+ Value param.Field[string] `json:"value"`
+}
+
+func (r AccessRuleEditParamsConfigurationLegacyJhsIPConfiguration) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+func (r AccessRuleEditParamsConfigurationLegacyJhsIPConfiguration) implementsFirewallAccessRuleEditParamsConfiguration() {
+}
+
+// The configuration target. You must set the target to `ip` when specifying an IP
+// address in the rule.
+type AccessRuleEditParamsConfigurationLegacyJhsIPConfigurationTarget string
+
+const (
+ AccessRuleEditParamsConfigurationLegacyJhsIPConfigurationTargetIP AccessRuleEditParamsConfigurationLegacyJhsIPConfigurationTarget = "ip"
+)
+
+type AccessRuleEditParamsConfigurationLegacyJhsIPV6Configuration struct {
+ // The configuration target. You must set the target to `ip6` when specifying an
+ // IPv6 address in the rule.
+ Target param.Field[AccessRuleEditParamsConfigurationLegacyJhsIPV6ConfigurationTarget] `json:"target"`
+ // The IPv6 address to match.
+ Value param.Field[string] `json:"value"`
+}
+
+func (r AccessRuleEditParamsConfigurationLegacyJhsIPV6Configuration) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+func (r AccessRuleEditParamsConfigurationLegacyJhsIPV6Configuration) implementsFirewallAccessRuleEditParamsConfiguration() {
+}
+
+// The configuration target. You must set the target to `ip6` when specifying an
+// IPv6 address in the rule.
+type AccessRuleEditParamsConfigurationLegacyJhsIPV6ConfigurationTarget string
+
+const (
+ AccessRuleEditParamsConfigurationLegacyJhsIPV6ConfigurationTargetIp6 AccessRuleEditParamsConfigurationLegacyJhsIPV6ConfigurationTarget = "ip6"
+)
+
+type AccessRuleEditParamsConfigurationLegacyJhsCidrConfiguration struct {
+ // The configuration target. You must set the target to `ip_range` when specifying
+ // an IP address range in the rule.
+ Target param.Field[AccessRuleEditParamsConfigurationLegacyJhsCidrConfigurationTarget] `json:"target"`
+ // The IP address range to match. You can only use prefix lengths `/16` and `/24`
+ // for IPv4 ranges, and prefix lengths `/32`, `/48`, and `/64` for IPv6 ranges.
+ Value param.Field[string] `json:"value"`
+}
+
+func (r AccessRuleEditParamsConfigurationLegacyJhsCidrConfiguration) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+func (r AccessRuleEditParamsConfigurationLegacyJhsCidrConfiguration) implementsFirewallAccessRuleEditParamsConfiguration() {
+}
+
+// The configuration target. You must set the target to `ip_range` when specifying
+// an IP address range in the rule.
+type AccessRuleEditParamsConfigurationLegacyJhsCidrConfigurationTarget string
+
+const (
+ AccessRuleEditParamsConfigurationLegacyJhsCidrConfigurationTargetIPRange AccessRuleEditParamsConfigurationLegacyJhsCidrConfigurationTarget = "ip_range"
+)
+
+type AccessRuleEditParamsConfigurationLegacyJhsASNConfiguration struct {
+ // The configuration target. You must set the target to `asn` when specifying an
+ // Autonomous System Number (ASN) in the rule.
+ Target param.Field[AccessRuleEditParamsConfigurationLegacyJhsASNConfigurationTarget] `json:"target"`
+ // The AS number to match.
+ Value param.Field[string] `json:"value"`
+}
+
+func (r AccessRuleEditParamsConfigurationLegacyJhsASNConfiguration) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+func (r AccessRuleEditParamsConfigurationLegacyJhsASNConfiguration) implementsFirewallAccessRuleEditParamsConfiguration() {
+}
+
+// The configuration target. You must set the target to `asn` when specifying an
+// Autonomous System Number (ASN) in the rule.
+type AccessRuleEditParamsConfigurationLegacyJhsASNConfigurationTarget string
+
+const (
+ AccessRuleEditParamsConfigurationLegacyJhsASNConfigurationTargetASN AccessRuleEditParamsConfigurationLegacyJhsASNConfigurationTarget = "asn"
+)
+
+type AccessRuleEditParamsConfigurationLegacyJhsCountryConfiguration struct {
+ // The configuration target. You must set the target to `country` when specifying a
+ // country code in the rule.
+ Target param.Field[AccessRuleEditParamsConfigurationLegacyJhsCountryConfigurationTarget] `json:"target"`
+ // The two-letter ISO-3166-1 alpha-2 code to match. For more information, refer to
+ // [IP Access rules: Parameters](https://developers.cloudflare.com/waf/tools/ip-access-rules/parameters/#country).
+ Value param.Field[string] `json:"value"`
+}
+
+func (r AccessRuleEditParamsConfigurationLegacyJhsCountryConfiguration) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+func (r AccessRuleEditParamsConfigurationLegacyJhsCountryConfiguration) implementsFirewallAccessRuleEditParamsConfiguration() {
+}
+
+// The configuration target. You must set the target to `country` when specifying a
+// country code in the rule.
+type AccessRuleEditParamsConfigurationLegacyJhsCountryConfigurationTarget string
+
+const (
+ AccessRuleEditParamsConfigurationLegacyJhsCountryConfigurationTargetCountry AccessRuleEditParamsConfigurationLegacyJhsCountryConfigurationTarget = "country"
+)
+
+// The action to apply to a matched request.
+type AccessRuleEditParamsMode string
+
+const (
+ AccessRuleEditParamsModeBlock AccessRuleEditParamsMode = "block"
+ AccessRuleEditParamsModeChallenge AccessRuleEditParamsMode = "challenge"
+ AccessRuleEditParamsModeWhitelist AccessRuleEditParamsMode = "whitelist"
+ AccessRuleEditParamsModeJsChallenge AccessRuleEditParamsMode = "js_challenge"
+ AccessRuleEditParamsModeManagedChallenge AccessRuleEditParamsMode = "managed_challenge"
+)
+
+type AccessRuleEditResponseEnvelope struct {
+ Errors []AccessRuleEditResponseEnvelopeErrors `json:"errors,required"`
+ Messages []AccessRuleEditResponseEnvelopeMessages `json:"messages,required"`
+ Result AccessRuleEditResponse `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success AccessRuleEditResponseEnvelopeSuccess `json:"success,required"`
+ JSON accessRuleEditResponseEnvelopeJSON `json:"-"`
+}
+
+// accessRuleEditResponseEnvelopeJSON contains the JSON metadata for the struct
+// [AccessRuleEditResponseEnvelope]
+type accessRuleEditResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AccessRuleEditResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r accessRuleEditResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AccessRuleEditResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON accessRuleEditResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// accessRuleEditResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [AccessRuleEditResponseEnvelopeErrors]
+type accessRuleEditResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AccessRuleEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r accessRuleEditResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type AccessRuleEditResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON accessRuleEditResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// accessRuleEditResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [AccessRuleEditResponseEnvelopeMessages]
+type accessRuleEditResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AccessRuleEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r accessRuleEditResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type AccessRuleEditResponseEnvelopeSuccess bool
+
+const (
+ AccessRuleEditResponseEnvelopeSuccessTrue AccessRuleEditResponseEnvelopeSuccess = true
+)
+
+type AccessRuleGetParams struct {
+ // The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+ AccountID param.Field[string] `path:"account_id"`
+ // The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+ ZoneID param.Field[string] `path:"zone_id"`
+}
+
+type AccessRuleGetResponseEnvelope struct {
+ Errors []AccessRuleGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []AccessRuleGetResponseEnvelopeMessages `json:"messages,required"`
+ Result AccessRuleGetResponse `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success AccessRuleGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON accessRuleGetResponseEnvelopeJSON `json:"-"`
+}
+
+// accessRuleGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [AccessRuleGetResponseEnvelope]
+type accessRuleGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AccessRuleGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r accessRuleGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AccessRuleGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON accessRuleGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// accessRuleGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [AccessRuleGetResponseEnvelopeErrors]
+type accessRuleGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AccessRuleGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r accessRuleGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type AccessRuleGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON accessRuleGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// accessRuleGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [AccessRuleGetResponseEnvelopeMessages]
+type accessRuleGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AccessRuleGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r accessRuleGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type AccessRuleGetResponseEnvelopeSuccess bool
+
+const (
+ AccessRuleGetResponseEnvelopeSuccessTrue AccessRuleGetResponseEnvelopeSuccess = true
+)
diff --git a/firewall/accessrule_test.go b/firewall/accessrule_test.go
new file mode 100644
index 00000000000..65e1f8c063b
--- /dev/null
+++ b/firewall/accessrule_test.go
@@ -0,0 +1,191 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package firewall_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/firewall"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestAccessRuleNewWithOptionalParams(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"),
+ )
+ _, err := client.Firewall.AccessRules.New(context.TODO(), firewall.AccessRuleNewParams{
+ Configuration: cloudflare.F[firewall.AccessRuleNewParamsConfiguration](firewall.AccessRuleNewParamsConfigurationLegacyJhsIPConfiguration(firewall.AccessRuleNewParamsConfigurationLegacyJhsIPConfiguration{
+ Target: cloudflare.F(firewall.AccessRuleNewParamsConfigurationLegacyJhsIPConfigurationTargetIP),
+ Value: cloudflare.F("198.51.100.4"),
+ })),
+ Mode: cloudflare.F(firewall.AccessRuleNewParamsModeChallenge),
+ AccountID: cloudflare.F("string"),
+ ZoneID: cloudflare.F("string"),
+ Notes: cloudflare.F("This rule is enabled because of an event that occurred on date X."),
+ })
+ 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())
+ }
+}
+
+func TestAccessRuleListWithOptionalParams(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"),
+ )
+ _, err := client.Firewall.AccessRules.List(context.TODO(), firewall.AccessRuleListParams{
+ AccountID: cloudflare.F("string"),
+ ZoneID: cloudflare.F("string"),
+ Direction: cloudflare.F(firewall.AccessRuleListParamsDirectionDesc),
+ EgsPagination: cloudflare.F(firewall.AccessRuleListParamsEgsPagination{
+ Json: cloudflare.F(firewall.AccessRuleListParamsEgsPaginationJson{
+ Page: cloudflare.F(1.000000),
+ PerPage: cloudflare.F(1.000000),
+ }),
+ }),
+ Filters: cloudflare.F(firewall.AccessRuleListParamsFilters{
+ ConfigurationTarget: cloudflare.F(firewall.AccessRuleListParamsFiltersConfigurationTargetIP),
+ ConfigurationValue: cloudflare.F("198.51.100.4"),
+ Match: cloudflare.F(firewall.AccessRuleListParamsFiltersMatchAny),
+ Mode: cloudflare.F(firewall.AccessRuleListParamsFiltersModeChallenge),
+ Notes: cloudflare.F("my note"),
+ }),
+ Order: cloudflare.F(firewall.AccessRuleListParamsOrderMode),
+ Page: cloudflare.F(1.000000),
+ PerPage: cloudflare.F(20.000000),
+ })
+ 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())
+ }
+}
+
+func TestAccessRuleDeleteWithOptionalParams(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"),
+ )
+ _, err := client.Firewall.AccessRules.Delete(
+ context.TODO(),
+ map[string]interface{}{},
+ firewall.AccessRuleDeleteParams{
+ AccountID: cloudflare.F("string"),
+ ZoneID: cloudflare.F("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())
+ }
+}
+
+func TestAccessRuleEditWithOptionalParams(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"),
+ )
+ _, err := client.Firewall.AccessRules.Edit(
+ context.TODO(),
+ map[string]interface{}{},
+ firewall.AccessRuleEditParams{
+ Configuration: cloudflare.F[firewall.AccessRuleEditParamsConfiguration](firewall.AccessRuleEditParamsConfigurationLegacyJhsIPConfiguration(firewall.AccessRuleEditParamsConfigurationLegacyJhsIPConfiguration{
+ Target: cloudflare.F(firewall.AccessRuleEditParamsConfigurationLegacyJhsIPConfigurationTargetIP),
+ Value: cloudflare.F("198.51.100.4"),
+ })),
+ Mode: cloudflare.F(firewall.AccessRuleEditParamsModeChallenge),
+ AccountID: cloudflare.F("string"),
+ ZoneID: cloudflare.F("string"),
+ Notes: cloudflare.F("This rule is enabled because of an event that occurred on date X."),
+ },
+ )
+ 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())
+ }
+}
+
+func TestAccessRuleGetWithOptionalParams(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"),
+ )
+ _, err := client.Firewall.AccessRules.Get(
+ context.TODO(),
+ map[string]interface{}{},
+ firewall.AccessRuleGetParams{
+ AccountID: cloudflare.F("string"),
+ ZoneID: cloudflare.F("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/firewall/aliases.go b/firewall/aliases.go
new file mode 100644
index 00000000000..7773a76afe9
--- /dev/null
+++ b/firewall/aliases.go
@@ -0,0 +1,9 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package firewall
+
+import (
+ "github.com/cloudflare/cloudflare-go/internal/apierror"
+)
+
+type Error = apierror.Error
diff --git a/firewall/firewall.go b/firewall/firewall.go
new file mode 100644
index 00000000000..e38ff71749a
--- /dev/null
+++ b/firewall/firewall.go
@@ -0,0 +1,34 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package firewall
+
+import (
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// FirewallService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewFirewallService] method instead.
+type FirewallService struct {
+ Options []option.RequestOption
+ Lockdowns *LockdownService
+ Rules *RuleService
+ AccessRules *AccessRuleService
+ UARules *UARuleService
+ WAF *WAFService
+}
+
+// NewFirewallService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewFirewallService(opts ...option.RequestOption) (r *FirewallService) {
+ r = &FirewallService{}
+ r.Options = opts
+ r.Lockdowns = NewLockdownService(opts...)
+ r.Rules = NewRuleService(opts...)
+ r.AccessRules = NewAccessRuleService(opts...)
+ r.UARules = NewUARuleService(opts...)
+ r.WAF = NewWAFService(opts...)
+ return
+}
diff --git a/firewall/lockdown.go b/firewall/lockdown.go
new file mode 100644
index 00000000000..39dc0d186dc
--- /dev/null
+++ b/firewall/lockdown.go
@@ -0,0 +1,595 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package firewall
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+ "reflect"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/tidwall/gjson"
+)
+
+// LockdownService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewLockdownService] method instead.
+type LockdownService struct {
+ Options []option.RequestOption
+}
+
+// NewLockdownService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewLockdownService(opts ...option.RequestOption) (r *LockdownService) {
+ r = &LockdownService{}
+ r.Options = opts
+ return
+}
+
+// Creates a new Zone Lockdown rule.
+func (r *LockdownService) New(ctx context.Context, zoneIdentifier string, body LockdownNewParams, opts ...option.RequestOption) (res *LegacyJhsZonelockdown, err error) {
+ opts = append(r.Options[:], opts...)
+ var env LockdownNewResponseEnvelope
+ path := fmt.Sprintf("zones/%s/firewall/lockdowns", zoneIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Updates an existing Zone Lockdown rule.
+func (r *LockdownService) Update(ctx context.Context, zoneIdentifier string, id string, body LockdownUpdateParams, opts ...option.RequestOption) (res *LegacyJhsZonelockdown, err error) {
+ opts = append(r.Options[:], opts...)
+ var env LockdownUpdateResponseEnvelope
+ path := fmt.Sprintf("zones/%s/firewall/lockdowns/%s", zoneIdentifier, id)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Fetches Zone Lockdown rules. You can filter the results using several optional
+// parameters.
+func (r *LockdownService) List(ctx context.Context, zoneIdentifier string, query LockdownListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[LegacyJhsZonelockdown], err error) {
+ var raw *http.Response
+ opts = append(r.Options, opts...)
+ opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
+ path := fmt.Sprintf("zones/%s/firewall/lockdowns", zoneIdentifier)
+ cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...)
+ if err != nil {
+ return nil, err
+ }
+ err = cfg.Execute()
+ if err != nil {
+ return nil, err
+ }
+ res.SetPageConfig(cfg, raw)
+ return res, nil
+}
+
+// Fetches Zone Lockdown rules. You can filter the results using several optional
+// parameters.
+func (r *LockdownService) ListAutoPaging(ctx context.Context, zoneIdentifier string, query LockdownListParams, opts ...option.RequestOption) *shared.V4PagePaginationArrayAutoPager[LegacyJhsZonelockdown] {
+ return shared.NewV4PagePaginationArrayAutoPager(r.List(ctx, zoneIdentifier, query, opts...))
+}
+
+// Deletes an existing Zone Lockdown rule.
+func (r *LockdownService) Delete(ctx context.Context, zoneIdentifier string, id string, opts ...option.RequestOption) (res *LockdownDeleteResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env LockdownDeleteResponseEnvelope
+ path := fmt.Sprintf("zones/%s/firewall/lockdowns/%s", zoneIdentifier, id)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Fetches the details of a Zone Lockdown rule.
+func (r *LockdownService) Get(ctx context.Context, zoneIdentifier string, id string, opts ...option.RequestOption) (res *LegacyJhsZonelockdown, err error) {
+ opts = append(r.Options[:], opts...)
+ var env LockdownGetResponseEnvelope
+ path := fmt.Sprintf("zones/%s/firewall/lockdowns/%s", zoneIdentifier, id)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type LegacyJhsZonelockdown struct {
+ // The unique identifier of the Zone Lockdown rule.
+ ID string `json:"id,required"`
+ // A list of IP addresses or CIDR ranges that will be allowed to access the URLs
+ // specified in the Zone Lockdown rule. You can include any number of `ip` or
+ // `ip_range` configurations.
+ Configurations LegacyJhsZonelockdownConfigurations `json:"configurations,required"`
+ // The timestamp of when the rule was created.
+ CreatedOn time.Time `json:"created_on,required" format:"date-time"`
+ // An informative summary of the rule.
+ Description string `json:"description,required"`
+ // The timestamp of when the rule was last modified.
+ ModifiedOn time.Time `json:"modified_on,required" format:"date-time"`
+ // When true, indicates that the rule is currently paused.
+ Paused bool `json:"paused,required"`
+ // The URLs to include in the rule definition. You can use wildcards. Each entered
+ // URL will be escaped before use, which means you can only use simple wildcard
+ // patterns.
+ URLs []string `json:"urls,required"`
+ JSON legacyJhsZonelockdownJSON `json:"-"`
+}
+
+// legacyJhsZonelockdownJSON contains the JSON metadata for the struct
+// [LegacyJhsZonelockdown]
+type legacyJhsZonelockdownJSON struct {
+ ID apijson.Field
+ Configurations apijson.Field
+ CreatedOn apijson.Field
+ Description apijson.Field
+ ModifiedOn apijson.Field
+ Paused apijson.Field
+ URLs apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LegacyJhsZonelockdown) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r legacyJhsZonelockdownJSON) RawJSON() string {
+ return r.raw
+}
+
+// A list of IP addresses or CIDR ranges that will be allowed to access the URLs
+// specified in the Zone Lockdown rule. You can include any number of `ip` or
+// `ip_range` configurations.
+//
+// Union satisfied by
+// [firewall.LegacyJhsZonelockdownConfigurationsLegacyJhsSchemasIPConfiguration] or
+// [firewall.LegacyJhsZonelockdownConfigurationsLegacyJhsSchemasCidrConfiguration].
+type LegacyJhsZonelockdownConfigurations interface {
+ implementsFirewallLegacyJhsZonelockdownConfigurations()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*LegacyJhsZonelockdownConfigurations)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(LegacyJhsZonelockdownConfigurationsLegacyJhsSchemasIPConfiguration{}),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(LegacyJhsZonelockdownConfigurationsLegacyJhsSchemasCidrConfiguration{}),
+ },
+ )
+}
+
+type LegacyJhsZonelockdownConfigurationsLegacyJhsSchemasIPConfiguration struct {
+ // The configuration target. You must set the target to `ip` when specifying an IP
+ // address in the Zone Lockdown rule.
+ Target LegacyJhsZonelockdownConfigurationsLegacyJhsSchemasIPConfigurationTarget `json:"target"`
+ // The IP address to match. This address will be compared to the IP address of
+ // incoming requests.
+ Value string `json:"value"`
+ JSON legacyJhsZonelockdownConfigurationsLegacyJhsSchemasIPConfigurationJSON `json:"-"`
+}
+
+// legacyJhsZonelockdownConfigurationsLegacyJhsSchemasIPConfigurationJSON contains
+// the JSON metadata for the struct
+// [LegacyJhsZonelockdownConfigurationsLegacyJhsSchemasIPConfiguration]
+type legacyJhsZonelockdownConfigurationsLegacyJhsSchemasIPConfigurationJSON struct {
+ Target apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LegacyJhsZonelockdownConfigurationsLegacyJhsSchemasIPConfiguration) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r legacyJhsZonelockdownConfigurationsLegacyJhsSchemasIPConfigurationJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r LegacyJhsZonelockdownConfigurationsLegacyJhsSchemasIPConfiguration) implementsFirewallLegacyJhsZonelockdownConfigurations() {
+}
+
+// The configuration target. You must set the target to `ip` when specifying an IP
+// address in the Zone Lockdown rule.
+type LegacyJhsZonelockdownConfigurationsLegacyJhsSchemasIPConfigurationTarget string
+
+const (
+ LegacyJhsZonelockdownConfigurationsLegacyJhsSchemasIPConfigurationTargetIP LegacyJhsZonelockdownConfigurationsLegacyJhsSchemasIPConfigurationTarget = "ip"
+)
+
+type LegacyJhsZonelockdownConfigurationsLegacyJhsSchemasCidrConfiguration struct {
+ // The configuration target. You must set the target to `ip_range` when specifying
+ // an IP address range in the Zone Lockdown rule.
+ Target LegacyJhsZonelockdownConfigurationsLegacyJhsSchemasCidrConfigurationTarget `json:"target"`
+ // The IP address range to match. You can only use prefix lengths `/16` and `/24`.
+ Value string `json:"value"`
+ JSON legacyJhsZonelockdownConfigurationsLegacyJhsSchemasCidrConfigurationJSON `json:"-"`
+}
+
+// legacyJhsZonelockdownConfigurationsLegacyJhsSchemasCidrConfigurationJSON
+// contains the JSON metadata for the struct
+// [LegacyJhsZonelockdownConfigurationsLegacyJhsSchemasCidrConfiguration]
+type legacyJhsZonelockdownConfigurationsLegacyJhsSchemasCidrConfigurationJSON struct {
+ Target apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LegacyJhsZonelockdownConfigurationsLegacyJhsSchemasCidrConfiguration) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r legacyJhsZonelockdownConfigurationsLegacyJhsSchemasCidrConfigurationJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r LegacyJhsZonelockdownConfigurationsLegacyJhsSchemasCidrConfiguration) implementsFirewallLegacyJhsZonelockdownConfigurations() {
+}
+
+// The configuration target. You must set the target to `ip_range` when specifying
+// an IP address range in the Zone Lockdown rule.
+type LegacyJhsZonelockdownConfigurationsLegacyJhsSchemasCidrConfigurationTarget string
+
+const (
+ LegacyJhsZonelockdownConfigurationsLegacyJhsSchemasCidrConfigurationTargetIPRange LegacyJhsZonelockdownConfigurationsLegacyJhsSchemasCidrConfigurationTarget = "ip_range"
+)
+
+type LockdownDeleteResponse struct {
+ // The unique identifier of the Zone Lockdown rule.
+ ID string `json:"id"`
+ JSON lockdownDeleteResponseJSON `json:"-"`
+}
+
+// lockdownDeleteResponseJSON contains the JSON metadata for the struct
+// [LockdownDeleteResponse]
+type lockdownDeleteResponseJSON struct {
+ ID apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LockdownDeleteResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r lockdownDeleteResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type LockdownNewParams struct {
+ Body param.Field[interface{}] `json:"body,required"`
+}
+
+func (r LockdownNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r.Body)
+}
+
+type LockdownNewResponseEnvelope struct {
+ Errors []LockdownNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []LockdownNewResponseEnvelopeMessages `json:"messages,required"`
+ Result LegacyJhsZonelockdown `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success LockdownNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON lockdownNewResponseEnvelopeJSON `json:"-"`
+}
+
+// lockdownNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [LockdownNewResponseEnvelope]
+type lockdownNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LockdownNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r lockdownNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type LockdownNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON lockdownNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// lockdownNewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [LockdownNewResponseEnvelopeErrors]
+type lockdownNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LockdownNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r lockdownNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type LockdownNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON lockdownNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// lockdownNewResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [LockdownNewResponseEnvelopeMessages]
+type lockdownNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LockdownNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r lockdownNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type LockdownNewResponseEnvelopeSuccess bool
+
+const (
+ LockdownNewResponseEnvelopeSuccessTrue LockdownNewResponseEnvelopeSuccess = true
+)
+
+type LockdownUpdateParams struct {
+ Body param.Field[interface{}] `json:"body,required"`
+}
+
+func (r LockdownUpdateParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r.Body)
+}
+
+type LockdownUpdateResponseEnvelope struct {
+ Errors []LockdownUpdateResponseEnvelopeErrors `json:"errors,required"`
+ Messages []LockdownUpdateResponseEnvelopeMessages `json:"messages,required"`
+ Result LegacyJhsZonelockdown `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success LockdownUpdateResponseEnvelopeSuccess `json:"success,required"`
+ JSON lockdownUpdateResponseEnvelopeJSON `json:"-"`
+}
+
+// lockdownUpdateResponseEnvelopeJSON contains the JSON metadata for the struct
+// [LockdownUpdateResponseEnvelope]
+type lockdownUpdateResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LockdownUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r lockdownUpdateResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type LockdownUpdateResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON lockdownUpdateResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// lockdownUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [LockdownUpdateResponseEnvelopeErrors]
+type lockdownUpdateResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LockdownUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r lockdownUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type LockdownUpdateResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON lockdownUpdateResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// lockdownUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [LockdownUpdateResponseEnvelopeMessages]
+type lockdownUpdateResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LockdownUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r lockdownUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type LockdownUpdateResponseEnvelopeSuccess bool
+
+const (
+ LockdownUpdateResponseEnvelopeSuccessTrue LockdownUpdateResponseEnvelopeSuccess = true
+)
+
+type LockdownListParams struct {
+ // A string to search for in the description of existing rules.
+ Description param.Field[string] `query:"description"`
+ // A string to search for in the description of existing rules.
+ DescriptionSearch param.Field[string] `query:"description_search"`
+ // A single IP address to search for in existing rules.
+ IP param.Field[string] `query:"ip"`
+ // A single IP address range to search for in existing rules.
+ IPRangeSearch param.Field[string] `query:"ip_range_search"`
+ // A single IP address to search for in existing rules.
+ IPSearch param.Field[string] `query:"ip_search"`
+ // Page number of paginated results.
+ Page param.Field[float64] `query:"page"`
+ // The maximum number of results per page. You can only set the value to `1` or to
+ // a multiple of 5 such as `5`, `10`, `15`, or `20`.
+ PerPage param.Field[float64] `query:"per_page"`
+ // The priority of the rule to control the processing order. A lower number
+ // indicates higher priority. If not provided, any rules with a configured priority
+ // will be processed before rules without a priority.
+ Priority param.Field[float64] `query:"priority"`
+ // A single URI to search for in the list of URLs of existing rules.
+ URISearch param.Field[string] `query:"uri_search"`
+}
+
+// URLQuery serializes [LockdownListParams]'s query parameters as `url.Values`.
+func (r LockdownListParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type LockdownDeleteResponseEnvelope struct {
+ Result LockdownDeleteResponse `json:"result"`
+ JSON lockdownDeleteResponseEnvelopeJSON `json:"-"`
+}
+
+// lockdownDeleteResponseEnvelopeJSON contains the JSON metadata for the struct
+// [LockdownDeleteResponseEnvelope]
+type lockdownDeleteResponseEnvelopeJSON struct {
+ Result apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LockdownDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r lockdownDeleteResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type LockdownGetResponseEnvelope struct {
+ Errors []LockdownGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []LockdownGetResponseEnvelopeMessages `json:"messages,required"`
+ Result LegacyJhsZonelockdown `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success LockdownGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON lockdownGetResponseEnvelopeJSON `json:"-"`
+}
+
+// lockdownGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [LockdownGetResponseEnvelope]
+type lockdownGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LockdownGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r lockdownGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type LockdownGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON lockdownGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// lockdownGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [LockdownGetResponseEnvelopeErrors]
+type lockdownGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LockdownGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r lockdownGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type LockdownGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON lockdownGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// lockdownGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [LockdownGetResponseEnvelopeMessages]
+type lockdownGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LockdownGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r lockdownGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type LockdownGetResponseEnvelopeSuccess bool
+
+const (
+ LockdownGetResponseEnvelopeSuccessTrue LockdownGetResponseEnvelopeSuccess = true
+)
diff --git a/firewall/lockdown_test.go b/firewall/lockdown_test.go
new file mode 100644
index 00000000000..8a6d5a3c972
--- /dev/null
+++ b/firewall/lockdown_test.go
@@ -0,0 +1,170 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package firewall_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/firewall"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestLockdownNew(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"),
+ )
+ _, err := client.Firewall.Lockdowns.New(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ firewall.LockdownNewParams{
+ Body: cloudflare.F[any](map[string]interface{}{}),
+ },
+ )
+ 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())
+ }
+}
+
+func TestLockdownUpdate(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"),
+ )
+ _, err := client.Firewall.Lockdowns.Update(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ "372e67954025e0ba6aaa6d586b9e0b59",
+ firewall.LockdownUpdateParams{
+ Body: cloudflare.F[any](map[string]interface{}{}),
+ },
+ )
+ 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())
+ }
+}
+
+func TestLockdownListWithOptionalParams(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"),
+ )
+ _, err := client.Firewall.Lockdowns.List(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ firewall.LockdownListParams{
+ Description: cloudflare.F("endpoints"),
+ DescriptionSearch: cloudflare.F("endpoints"),
+ IP: cloudflare.F("1.2.3.4"),
+ IPRangeSearch: cloudflare.F("1.2.3.0/16"),
+ IPSearch: cloudflare.F("1.2.3.4"),
+ Page: cloudflare.F(1.000000),
+ PerPage: cloudflare.F(1.000000),
+ Priority: cloudflare.F(5.000000),
+ URISearch: cloudflare.F("/some/path"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestLockdownDelete(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"),
+ )
+ _, err := client.Firewall.Lockdowns.Delete(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ "372e67954025e0ba6aaa6d586b9e0b59",
+ )
+ 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())
+ }
+}
+
+func TestLockdownGet(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"),
+ )
+ _, err := client.Firewall.Lockdowns.Get(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ "372e67954025e0ba6aaa6d586b9e0b59",
+ )
+ 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/firewall/rule.go b/firewall/rule.go
new file mode 100644
index 00000000000..8d125253a7c
--- /dev/null
+++ b/firewall/rule.go
@@ -0,0 +1,776 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package firewall
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+ "reflect"
+
+ "github.com/cloudflare/cloudflare-go/filters"
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/tidwall/gjson"
+)
+
+// RuleService contains methods and other services that help with interacting with
+// the cloudflare API. Note, unlike clients, this service does not read variables
+// from the environment automatically. You should not instantiate this service
+// directly, and instead use the [NewRuleService] method instead.
+type RuleService struct {
+ Options []option.RequestOption
+}
+
+// NewRuleService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewRuleService(opts ...option.RequestOption) (r *RuleService) {
+ r = &RuleService{}
+ r.Options = opts
+ return
+}
+
+// Create one or more firewall rules.
+func (r *RuleService) New(ctx context.Context, zoneIdentifier string, body RuleNewParams, opts ...option.RequestOption) (res *[]LegacyJhsFilterRule, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RuleNewResponseEnvelope
+ path := fmt.Sprintf("zones/%s/firewall/rules", zoneIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Updates an existing firewall rule.
+func (r *RuleService) Update(ctx context.Context, zoneIdentifier string, id string, body RuleUpdateParams, opts ...option.RequestOption) (res *LegacyJhsFilterRule, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RuleUpdateResponseEnvelope
+ path := fmt.Sprintf("zones/%s/firewall/rules/%s", zoneIdentifier, id)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Fetches firewall rules in a zone. You can filter the results using several
+// optional parameters.
+func (r *RuleService) List(ctx context.Context, zoneIdentifier string, query RuleListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[LegacyJhsFilterRule], err error) {
+ var raw *http.Response
+ opts = append(r.Options, opts...)
+ opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
+ path := fmt.Sprintf("zones/%s/firewall/rules", zoneIdentifier)
+ cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...)
+ if err != nil {
+ return nil, err
+ }
+ err = cfg.Execute()
+ if err != nil {
+ return nil, err
+ }
+ res.SetPageConfig(cfg, raw)
+ return res, nil
+}
+
+// Fetches firewall rules in a zone. You can filter the results using several
+// optional parameters.
+func (r *RuleService) ListAutoPaging(ctx context.Context, zoneIdentifier string, query RuleListParams, opts ...option.RequestOption) *shared.V4PagePaginationArrayAutoPager[LegacyJhsFilterRule] {
+ return shared.NewV4PagePaginationArrayAutoPager(r.List(ctx, zoneIdentifier, query, opts...))
+}
+
+// Deletes an existing firewall rule.
+func (r *RuleService) Delete(ctx context.Context, zoneIdentifier string, id string, body RuleDeleteParams, opts ...option.RequestOption) (res *LegacyJhsFilterRule, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RuleDeleteResponseEnvelope
+ path := fmt.Sprintf("zones/%s/firewall/rules/%s", zoneIdentifier, id)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Updates the priority of an existing firewall rule.
+func (r *RuleService) Edit(ctx context.Context, zoneIdentifier string, id string, body RuleEditParams, opts ...option.RequestOption) (res *[]LegacyJhsFilterRule, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RuleEditResponseEnvelope
+ path := fmt.Sprintf("zones/%s/firewall/rules/%s", zoneIdentifier, id)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Fetches the details of a firewall rule.
+func (r *RuleService) Get(ctx context.Context, zoneIdentifier string, id string, query RuleGetParams, opts ...option.RequestOption) (res *LegacyJhsFilterRule, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RuleGetResponseEnvelope
+ path := fmt.Sprintf("zones/%s/firewall/rules/%s", zoneIdentifier, id)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type LegacyJhsFilterRule struct {
+ // The unique identifier of the firewall rule.
+ ID string `json:"id"`
+ // The action to apply to a matched request. The `log` action is only available on
+ // an Enterprise plan.
+ Action LegacyJhsFilterRuleAction `json:"action"`
+ // An informative summary of the firewall rule.
+ Description string `json:"description"`
+ Filter LegacyJhsFilterRuleFilter `json:"filter"`
+ // When true, indicates that the firewall rule is currently paused.
+ Paused bool `json:"paused"`
+ // The priority of the rule. Optional value used to define the processing order. A
+ // lower number indicates a higher priority. If not provided, rules with a defined
+ // priority will be processed before rules without a priority.
+ Priority float64 `json:"priority"`
+ Products []LegacyJhsFilterRuleProduct `json:"products"`
+ // A short reference tag. Allows you to select related firewall rules.
+ Ref string `json:"ref"`
+ JSON legacyJhsFilterRuleJSON `json:"-"`
+}
+
+// legacyJhsFilterRuleJSON contains the JSON metadata for the struct
+// [LegacyJhsFilterRule]
+type legacyJhsFilterRuleJSON struct {
+ ID apijson.Field
+ Action apijson.Field
+ Description apijson.Field
+ Filter apijson.Field
+ Paused apijson.Field
+ Priority apijson.Field
+ Products apijson.Field
+ Ref apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LegacyJhsFilterRule) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r legacyJhsFilterRuleJSON) RawJSON() string {
+ return r.raw
+}
+
+// The action to apply to a matched request. The `log` action is only available on
+// an Enterprise plan.
+type LegacyJhsFilterRuleAction string
+
+const (
+ LegacyJhsFilterRuleActionBlock LegacyJhsFilterRuleAction = "block"
+ LegacyJhsFilterRuleActionChallenge LegacyJhsFilterRuleAction = "challenge"
+ LegacyJhsFilterRuleActionJsChallenge LegacyJhsFilterRuleAction = "js_challenge"
+ LegacyJhsFilterRuleActionManagedChallenge LegacyJhsFilterRuleAction = "managed_challenge"
+ LegacyJhsFilterRuleActionAllow LegacyJhsFilterRuleAction = "allow"
+ LegacyJhsFilterRuleActionLog LegacyJhsFilterRuleAction = "log"
+ LegacyJhsFilterRuleActionBypass LegacyJhsFilterRuleAction = "bypass"
+)
+
+// Union satisfied by [filters.LegacyJhsFilter] or
+// [firewall.LegacyJhsFilterRuleFilterLegacyJhsDeletedFilter].
+type LegacyJhsFilterRuleFilter interface {
+ implementsFirewallLegacyJhsFilterRuleFilter()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*LegacyJhsFilterRuleFilter)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(filters.LegacyJhsFilter{}),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(LegacyJhsFilterRuleFilterLegacyJhsDeletedFilter{}),
+ },
+ )
+}
+
+type LegacyJhsFilterRuleFilterLegacyJhsDeletedFilter struct {
+ // The unique identifier of the filter.
+ ID string `json:"id,required"`
+ // When true, indicates that the firewall rule was deleted.
+ Deleted bool `json:"deleted,required"`
+ JSON legacyJhsFilterRuleFilterLegacyJhsDeletedFilterJSON `json:"-"`
+}
+
+// legacyJhsFilterRuleFilterLegacyJhsDeletedFilterJSON contains the JSON metadata
+// for the struct [LegacyJhsFilterRuleFilterLegacyJhsDeletedFilter]
+type legacyJhsFilterRuleFilterLegacyJhsDeletedFilterJSON struct {
+ ID apijson.Field
+ Deleted apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LegacyJhsFilterRuleFilterLegacyJhsDeletedFilter) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r legacyJhsFilterRuleFilterLegacyJhsDeletedFilterJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r LegacyJhsFilterRuleFilterLegacyJhsDeletedFilter) implementsFirewallLegacyJhsFilterRuleFilter() {
+}
+
+// A list of products to bypass for a request when using the `bypass` action.
+type LegacyJhsFilterRuleProduct string
+
+const (
+ LegacyJhsFilterRuleProductZoneLockdown LegacyJhsFilterRuleProduct = "zoneLockdown"
+ LegacyJhsFilterRuleProductUABlock LegacyJhsFilterRuleProduct = "uaBlock"
+ LegacyJhsFilterRuleProductBic LegacyJhsFilterRuleProduct = "bic"
+ LegacyJhsFilterRuleProductHot LegacyJhsFilterRuleProduct = "hot"
+ LegacyJhsFilterRuleProductSecurityLevel LegacyJhsFilterRuleProduct = "securityLevel"
+ LegacyJhsFilterRuleProductRateLimit LegacyJhsFilterRuleProduct = "rateLimit"
+ LegacyJhsFilterRuleProductWAF LegacyJhsFilterRuleProduct = "waf"
+)
+
+type RuleNewParams struct {
+ Body param.Field[interface{}] `json:"body,required"`
+}
+
+func (r RuleNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r.Body)
+}
+
+type RuleNewResponseEnvelope struct {
+ Errors []RuleNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []RuleNewResponseEnvelopeMessages `json:"messages,required"`
+ Result []LegacyJhsFilterRule `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success RuleNewResponseEnvelopeSuccess `json:"success,required"`
+ ResultInfo RuleNewResponseEnvelopeResultInfo `json:"result_info"`
+ JSON ruleNewResponseEnvelopeJSON `json:"-"`
+}
+
+// ruleNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [RuleNewResponseEnvelope]
+type ruleNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ ResultInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RuleNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ruleNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type RuleNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON ruleNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// ruleNewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [RuleNewResponseEnvelopeErrors]
+type ruleNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RuleNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ruleNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type RuleNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON ruleNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// ruleNewResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [RuleNewResponseEnvelopeMessages]
+type ruleNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RuleNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ruleNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type RuleNewResponseEnvelopeSuccess bool
+
+const (
+ RuleNewResponseEnvelopeSuccessTrue RuleNewResponseEnvelopeSuccess = true
+)
+
+type RuleNewResponseEnvelopeResultInfo struct {
+ // Total number of results for the requested service
+ Count float64 `json:"count"`
+ // Current page within paginated list of results
+ Page float64 `json:"page"`
+ // Number of results per page of results
+ PerPage float64 `json:"per_page"`
+ // Total results available without any search parameters
+ TotalCount float64 `json:"total_count"`
+ JSON ruleNewResponseEnvelopeResultInfoJSON `json:"-"`
+}
+
+// ruleNewResponseEnvelopeResultInfoJSON contains the JSON metadata for the struct
+// [RuleNewResponseEnvelopeResultInfo]
+type ruleNewResponseEnvelopeResultInfoJSON struct {
+ Count apijson.Field
+ Page apijson.Field
+ PerPage apijson.Field
+ TotalCount apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RuleNewResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ruleNewResponseEnvelopeResultInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type RuleUpdateParams struct {
+ Body param.Field[interface{}] `json:"body,required"`
+}
+
+func (r RuleUpdateParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r.Body)
+}
+
+type RuleUpdateResponseEnvelope struct {
+ Errors []RuleUpdateResponseEnvelopeErrors `json:"errors,required"`
+ Messages []RuleUpdateResponseEnvelopeMessages `json:"messages,required"`
+ Result LegacyJhsFilterRule `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success RuleUpdateResponseEnvelopeSuccess `json:"success,required"`
+ JSON ruleUpdateResponseEnvelopeJSON `json:"-"`
+}
+
+// ruleUpdateResponseEnvelopeJSON contains the JSON metadata for the struct
+// [RuleUpdateResponseEnvelope]
+type ruleUpdateResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RuleUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ruleUpdateResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type RuleUpdateResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON ruleUpdateResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// ruleUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [RuleUpdateResponseEnvelopeErrors]
+type ruleUpdateResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RuleUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ruleUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type RuleUpdateResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON ruleUpdateResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// ruleUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [RuleUpdateResponseEnvelopeMessages]
+type ruleUpdateResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RuleUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ruleUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type RuleUpdateResponseEnvelopeSuccess bool
+
+const (
+ RuleUpdateResponseEnvelopeSuccessTrue RuleUpdateResponseEnvelopeSuccess = true
+)
+
+type RuleListParams struct {
+ // The action to search for. Must be an exact match.
+ Action param.Field[string] `query:"action"`
+ // A case-insensitive string to find in the description.
+ Description param.Field[string] `query:"description"`
+ // Page number of paginated results.
+ Page param.Field[float64] `query:"page"`
+ // When true, indicates that the firewall rule is currently paused.
+ Paused param.Field[bool] `query:"paused"`
+ // Number of firewall rules per page.
+ PerPage param.Field[float64] `query:"per_page"`
+}
+
+// URLQuery serializes [RuleListParams]'s query parameters as `url.Values`.
+func (r RuleListParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type RuleDeleteParams struct {
+ // When true, indicates that Cloudflare should also delete the associated filter if
+ // there are no other firewall rules referencing the filter.
+ DeleteFilterIfUnused param.Field[bool] `json:"delete_filter_if_unused"`
+}
+
+func (r RuleDeleteParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type RuleDeleteResponseEnvelope struct {
+ Errors []RuleDeleteResponseEnvelopeErrors `json:"errors,required"`
+ Messages []RuleDeleteResponseEnvelopeMessages `json:"messages,required"`
+ Result LegacyJhsFilterRule `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success RuleDeleteResponseEnvelopeSuccess `json:"success,required"`
+ JSON ruleDeleteResponseEnvelopeJSON `json:"-"`
+}
+
+// ruleDeleteResponseEnvelopeJSON contains the JSON metadata for the struct
+// [RuleDeleteResponseEnvelope]
+type ruleDeleteResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RuleDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ruleDeleteResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type RuleDeleteResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON ruleDeleteResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// ruleDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [RuleDeleteResponseEnvelopeErrors]
+type ruleDeleteResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RuleDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ruleDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type RuleDeleteResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON ruleDeleteResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// ruleDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [RuleDeleteResponseEnvelopeMessages]
+type ruleDeleteResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RuleDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ruleDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type RuleDeleteResponseEnvelopeSuccess bool
+
+const (
+ RuleDeleteResponseEnvelopeSuccessTrue RuleDeleteResponseEnvelopeSuccess = true
+)
+
+type RuleEditParams struct {
+ Body param.Field[interface{}] `json:"body,required"`
+}
+
+func (r RuleEditParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r.Body)
+}
+
+type RuleEditResponseEnvelope struct {
+ Errors []RuleEditResponseEnvelopeErrors `json:"errors,required"`
+ Messages []RuleEditResponseEnvelopeMessages `json:"messages,required"`
+ Result []LegacyJhsFilterRule `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success RuleEditResponseEnvelopeSuccess `json:"success,required"`
+ ResultInfo RuleEditResponseEnvelopeResultInfo `json:"result_info"`
+ JSON ruleEditResponseEnvelopeJSON `json:"-"`
+}
+
+// ruleEditResponseEnvelopeJSON contains the JSON metadata for the struct
+// [RuleEditResponseEnvelope]
+type ruleEditResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ ResultInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RuleEditResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ruleEditResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type RuleEditResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON ruleEditResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// ruleEditResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [RuleEditResponseEnvelopeErrors]
+type ruleEditResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RuleEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ruleEditResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type RuleEditResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON ruleEditResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// ruleEditResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [RuleEditResponseEnvelopeMessages]
+type ruleEditResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RuleEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ruleEditResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type RuleEditResponseEnvelopeSuccess bool
+
+const (
+ RuleEditResponseEnvelopeSuccessTrue RuleEditResponseEnvelopeSuccess = true
+)
+
+type RuleEditResponseEnvelopeResultInfo struct {
+ // Total number of results for the requested service
+ Count float64 `json:"count"`
+ // Current page within paginated list of results
+ Page float64 `json:"page"`
+ // Number of results per page of results
+ PerPage float64 `json:"per_page"`
+ // Total results available without any search parameters
+ TotalCount float64 `json:"total_count"`
+ JSON ruleEditResponseEnvelopeResultInfoJSON `json:"-"`
+}
+
+// ruleEditResponseEnvelopeResultInfoJSON contains the JSON metadata for the struct
+// [RuleEditResponseEnvelopeResultInfo]
+type ruleEditResponseEnvelopeResultInfoJSON struct {
+ Count apijson.Field
+ Page apijson.Field
+ PerPage apijson.Field
+ TotalCount apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RuleEditResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ruleEditResponseEnvelopeResultInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type RuleGetParams struct {
+}
+
+type RuleGetResponseEnvelope struct {
+ Errors []RuleGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []RuleGetResponseEnvelopeMessages `json:"messages,required"`
+ Result LegacyJhsFilterRule `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success RuleGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON ruleGetResponseEnvelopeJSON `json:"-"`
+}
+
+// ruleGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [RuleGetResponseEnvelope]
+type ruleGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RuleGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ruleGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type RuleGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON ruleGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// ruleGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [RuleGetResponseEnvelopeErrors]
+type ruleGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RuleGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ruleGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type RuleGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON ruleGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// ruleGetResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [RuleGetResponseEnvelopeMessages]
+type ruleGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RuleGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ruleGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type RuleGetResponseEnvelopeSuccess bool
+
+const (
+ RuleGetResponseEnvelopeSuccessTrue RuleGetResponseEnvelopeSuccess = true
+)
diff --git a/firewall/rule_test.go b/firewall/rule_test.go
new file mode 100644
index 00000000000..e1af30c4b1f
--- /dev/null
+++ b/firewall/rule_test.go
@@ -0,0 +1,201 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package firewall_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/firewall"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestRuleNew(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"),
+ )
+ _, err := client.Firewall.Rules.New(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ firewall.RuleNewParams{
+ Body: cloudflare.F[any](map[string]interface{}{}),
+ },
+ )
+ 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())
+ }
+}
+
+func TestRuleUpdate(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"),
+ )
+ _, err := client.Firewall.Rules.Update(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ "372e67954025e0ba6aaa6d586b9e0b60",
+ firewall.RuleUpdateParams{
+ Body: cloudflare.F[any](map[string]interface{}{}),
+ },
+ )
+ 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())
+ }
+}
+
+func TestRuleListWithOptionalParams(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"),
+ )
+ _, err := client.Firewall.Rules.List(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ firewall.RuleListParams{
+ Action: cloudflare.F("block"),
+ Description: cloudflare.F("mir"),
+ Page: cloudflare.F(1.000000),
+ Paused: cloudflare.F(false),
+ PerPage: cloudflare.F(5.000000),
+ },
+ )
+ 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())
+ }
+}
+
+func TestRuleDeleteWithOptionalParams(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"),
+ )
+ _, err := client.Firewall.Rules.Delete(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ "372e67954025e0ba6aaa6d586b9e0b60",
+ firewall.RuleDeleteParams{
+ DeleteFilterIfUnused: cloudflare.F(true),
+ },
+ )
+ 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())
+ }
+}
+
+func TestRuleEdit(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"),
+ )
+ _, err := client.Firewall.Rules.Edit(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ "372e67954025e0ba6aaa6d586b9e0b60",
+ firewall.RuleEditParams{
+ Body: cloudflare.F[any](map[string]interface{}{}),
+ },
+ )
+ 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())
+ }
+}
+
+func TestRuleGet(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"),
+ )
+ _, err := client.Firewall.Rules.Get(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ "372e67954025e0ba6aaa6d586b9e0b60",
+ firewall.RuleGetParams{},
+ )
+ 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/firewall/uarule.go b/firewall/uarule.go
new file mode 100644
index 00000000000..fb03ee0a6c3
--- /dev/null
+++ b/firewall/uarule.go
@@ -0,0 +1,618 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package firewall
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+ "reflect"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/tidwall/gjson"
+)
+
+// UARuleService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewUARuleService] method instead.
+type UARuleService struct {
+ Options []option.RequestOption
+}
+
+// NewUARuleService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewUARuleService(opts ...option.RequestOption) (r *UARuleService) {
+ r = &UARuleService{}
+ r.Options = opts
+ return
+}
+
+// Creates a new User Agent Blocking rule in a zone.
+func (r *UARuleService) New(ctx context.Context, zoneIdentifier string, body UARuleNewParams, opts ...option.RequestOption) (res *UARuleNewResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env UARuleNewResponseEnvelope
+ path := fmt.Sprintf("zones/%s/firewall/ua_rules", zoneIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Updates an existing User Agent Blocking rule.
+func (r *UARuleService) Update(ctx context.Context, zoneIdentifier string, id string, body UARuleUpdateParams, opts ...option.RequestOption) (res *UARuleUpdateResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env UARuleUpdateResponseEnvelope
+ path := fmt.Sprintf("zones/%s/firewall/ua_rules/%s", zoneIdentifier, id)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Fetches User Agent Blocking rules in a zone. You can filter the results using
+// several optional parameters.
+func (r *UARuleService) List(ctx context.Context, zoneIdentifier string, query UARuleListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[UARuleListResponse], err error) {
+ var raw *http.Response
+ opts = append(r.Options, opts...)
+ opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
+ path := fmt.Sprintf("zones/%s/firewall/ua_rules", zoneIdentifier)
+ cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...)
+ if err != nil {
+ return nil, err
+ }
+ err = cfg.Execute()
+ if err != nil {
+ return nil, err
+ }
+ res.SetPageConfig(cfg, raw)
+ return res, nil
+}
+
+// Fetches User Agent Blocking rules in a zone. You can filter the results using
+// several optional parameters.
+func (r *UARuleService) ListAutoPaging(ctx context.Context, zoneIdentifier string, query UARuleListParams, opts ...option.RequestOption) *shared.V4PagePaginationArrayAutoPager[UARuleListResponse] {
+ return shared.NewV4PagePaginationArrayAutoPager(r.List(ctx, zoneIdentifier, query, opts...))
+}
+
+// Deletes an existing User Agent Blocking rule.
+func (r *UARuleService) Delete(ctx context.Context, zoneIdentifier string, id string, opts ...option.RequestOption) (res *UARuleDeleteResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env UARuleDeleteResponseEnvelope
+ path := fmt.Sprintf("zones/%s/firewall/ua_rules/%s", zoneIdentifier, id)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Fetches the details of a User Agent Blocking rule.
+func (r *UARuleService) Get(ctx context.Context, zoneIdentifier string, id string, opts ...option.RequestOption) (res *UARuleGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env UARuleGetResponseEnvelope
+ path := fmt.Sprintf("zones/%s/firewall/ua_rules/%s", zoneIdentifier, id)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Union satisfied by [firewall.UARuleNewResponseUnknown] or [shared.UnionString].
+type UARuleNewResponse interface {
+ ImplementsFirewallUARuleNewResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*UARuleNewResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+// Union satisfied by [firewall.UARuleUpdateResponseUnknown] or
+// [shared.UnionString].
+type UARuleUpdateResponse interface {
+ ImplementsFirewallUARuleUpdateResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*UARuleUpdateResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+type UARuleListResponse struct {
+ // The unique identifier of the User Agent Blocking rule.
+ ID string `json:"id"`
+ // The configuration object for the current rule.
+ Configuration UARuleListResponseConfiguration `json:"configuration"`
+ // An informative summary of the rule.
+ Description string `json:"description"`
+ // The action to apply to a matched request.
+ Mode UARuleListResponseMode `json:"mode"`
+ // When true, indicates that the rule is currently paused.
+ Paused bool `json:"paused"`
+ JSON uaRuleListResponseJSON `json:"-"`
+}
+
+// uaRuleListResponseJSON contains the JSON metadata for the struct
+// [UARuleListResponse]
+type uaRuleListResponseJSON struct {
+ ID apijson.Field
+ Configuration apijson.Field
+ Description apijson.Field
+ Mode apijson.Field
+ Paused apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *UARuleListResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r uaRuleListResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+// The configuration object for the current rule.
+type UARuleListResponseConfiguration struct {
+ // The configuration target for this rule. You must set the target to `ua` for User
+ // Agent Blocking rules.
+ Target string `json:"target"`
+ // The exact user agent string to match. This value will be compared to the
+ // received `User-Agent` HTTP header value.
+ Value string `json:"value"`
+ JSON uaRuleListResponseConfigurationJSON `json:"-"`
+}
+
+// uaRuleListResponseConfigurationJSON contains the JSON metadata for the struct
+// [UARuleListResponseConfiguration]
+type uaRuleListResponseConfigurationJSON struct {
+ Target apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *UARuleListResponseConfiguration) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r uaRuleListResponseConfigurationJSON) RawJSON() string {
+ return r.raw
+}
+
+// The action to apply to a matched request.
+type UARuleListResponseMode string
+
+const (
+ UARuleListResponseModeBlock UARuleListResponseMode = "block"
+ UARuleListResponseModeChallenge UARuleListResponseMode = "challenge"
+ UARuleListResponseModeJsChallenge UARuleListResponseMode = "js_challenge"
+ UARuleListResponseModeManagedChallenge UARuleListResponseMode = "managed_challenge"
+)
+
+type UARuleDeleteResponse struct {
+ // The unique identifier of the User Agent Blocking rule.
+ ID string `json:"id"`
+ JSON uaRuleDeleteResponseJSON `json:"-"`
+}
+
+// uaRuleDeleteResponseJSON contains the JSON metadata for the struct
+// [UARuleDeleteResponse]
+type uaRuleDeleteResponseJSON struct {
+ ID apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *UARuleDeleteResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r uaRuleDeleteResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+// Union satisfied by [firewall.UARuleGetResponseUnknown] or [shared.UnionString].
+type UARuleGetResponse interface {
+ ImplementsFirewallUARuleGetResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*UARuleGetResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+type UARuleNewParams struct {
+ Body param.Field[interface{}] `json:"body,required"`
+}
+
+func (r UARuleNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r.Body)
+}
+
+type UARuleNewResponseEnvelope struct {
+ Errors []UARuleNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []UARuleNewResponseEnvelopeMessages `json:"messages,required"`
+ Result UARuleNewResponse `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success UARuleNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON uaRuleNewResponseEnvelopeJSON `json:"-"`
+}
+
+// uaRuleNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [UARuleNewResponseEnvelope]
+type uaRuleNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *UARuleNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r uaRuleNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type UARuleNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON uaRuleNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// uaRuleNewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [UARuleNewResponseEnvelopeErrors]
+type uaRuleNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *UARuleNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r uaRuleNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type UARuleNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON uaRuleNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// uaRuleNewResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [UARuleNewResponseEnvelopeMessages]
+type uaRuleNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *UARuleNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r uaRuleNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type UARuleNewResponseEnvelopeSuccess bool
+
+const (
+ UARuleNewResponseEnvelopeSuccessTrue UARuleNewResponseEnvelopeSuccess = true
+)
+
+type UARuleUpdateParams struct {
+ Body param.Field[interface{}] `json:"body,required"`
+}
+
+func (r UARuleUpdateParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r.Body)
+}
+
+type UARuleUpdateResponseEnvelope struct {
+ Errors []UARuleUpdateResponseEnvelopeErrors `json:"errors,required"`
+ Messages []UARuleUpdateResponseEnvelopeMessages `json:"messages,required"`
+ Result UARuleUpdateResponse `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success UARuleUpdateResponseEnvelopeSuccess `json:"success,required"`
+ JSON uaRuleUpdateResponseEnvelopeJSON `json:"-"`
+}
+
+// uaRuleUpdateResponseEnvelopeJSON contains the JSON metadata for the struct
+// [UARuleUpdateResponseEnvelope]
+type uaRuleUpdateResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *UARuleUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r uaRuleUpdateResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type UARuleUpdateResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON uaRuleUpdateResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// uaRuleUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [UARuleUpdateResponseEnvelopeErrors]
+type uaRuleUpdateResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *UARuleUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r uaRuleUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type UARuleUpdateResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON uaRuleUpdateResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// uaRuleUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [UARuleUpdateResponseEnvelopeMessages]
+type uaRuleUpdateResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *UARuleUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r uaRuleUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type UARuleUpdateResponseEnvelopeSuccess bool
+
+const (
+ UARuleUpdateResponseEnvelopeSuccessTrue UARuleUpdateResponseEnvelopeSuccess = true
+)
+
+type UARuleListParams struct {
+ // A string to search for in the description of existing rules.
+ Description param.Field[string] `query:"description"`
+ // A string to search for in the description of existing rules.
+ DescriptionSearch param.Field[string] `query:"description_search"`
+ // Page number of paginated results.
+ Page param.Field[float64] `query:"page"`
+ // The maximum number of results per page. You can only set the value to `1` or to
+ // a multiple of 5 such as `5`, `10`, `15`, or `20`.
+ PerPage param.Field[float64] `query:"per_page"`
+ // A string to search for in the user agent values of existing rules.
+ UASearch param.Field[string] `query:"ua_search"`
+}
+
+// URLQuery serializes [UARuleListParams]'s query parameters as `url.Values`.
+func (r UARuleListParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type UARuleDeleteResponseEnvelope struct {
+ Errors []UARuleDeleteResponseEnvelopeErrors `json:"errors,required"`
+ Messages []UARuleDeleteResponseEnvelopeMessages `json:"messages,required"`
+ Result UARuleDeleteResponse `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success UARuleDeleteResponseEnvelopeSuccess `json:"success,required"`
+ JSON uaRuleDeleteResponseEnvelopeJSON `json:"-"`
+}
+
+// uaRuleDeleteResponseEnvelopeJSON contains the JSON metadata for the struct
+// [UARuleDeleteResponseEnvelope]
+type uaRuleDeleteResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *UARuleDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r uaRuleDeleteResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type UARuleDeleteResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON uaRuleDeleteResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// uaRuleDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [UARuleDeleteResponseEnvelopeErrors]
+type uaRuleDeleteResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *UARuleDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r uaRuleDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type UARuleDeleteResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON uaRuleDeleteResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// uaRuleDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [UARuleDeleteResponseEnvelopeMessages]
+type uaRuleDeleteResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *UARuleDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r uaRuleDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type UARuleDeleteResponseEnvelopeSuccess bool
+
+const (
+ UARuleDeleteResponseEnvelopeSuccessTrue UARuleDeleteResponseEnvelopeSuccess = true
+)
+
+type UARuleGetResponseEnvelope struct {
+ Errors []UARuleGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []UARuleGetResponseEnvelopeMessages `json:"messages,required"`
+ Result UARuleGetResponse `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success UARuleGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON uaRuleGetResponseEnvelopeJSON `json:"-"`
+}
+
+// uaRuleGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [UARuleGetResponseEnvelope]
+type uaRuleGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *UARuleGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r uaRuleGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type UARuleGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON uaRuleGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// uaRuleGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [UARuleGetResponseEnvelopeErrors]
+type uaRuleGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *UARuleGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r uaRuleGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type UARuleGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON uaRuleGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// uaRuleGetResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [UARuleGetResponseEnvelopeMessages]
+type uaRuleGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *UARuleGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r uaRuleGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type UARuleGetResponseEnvelopeSuccess bool
+
+const (
+ UARuleGetResponseEnvelopeSuccessTrue UARuleGetResponseEnvelopeSuccess = true
+)
diff --git a/firewall/uarule_test.go b/firewall/uarule_test.go
new file mode 100644
index 00000000000..658740f50a3
--- /dev/null
+++ b/firewall/uarule_test.go
@@ -0,0 +1,166 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package firewall_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/firewall"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestUARuleNew(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"),
+ )
+ _, err := client.Firewall.UARules.New(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ firewall.UARuleNewParams{
+ Body: cloudflare.F[any](map[string]interface{}{}),
+ },
+ )
+ 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())
+ }
+}
+
+func TestUARuleUpdate(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"),
+ )
+ _, err := client.Firewall.UARules.Update(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ "372e67954025e0ba6aaa6d586b9e0b59",
+ firewall.UARuleUpdateParams{
+ Body: cloudflare.F[any](map[string]interface{}{}),
+ },
+ )
+ 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())
+ }
+}
+
+func TestUARuleListWithOptionalParams(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"),
+ )
+ _, err := client.Firewall.UARules.List(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ firewall.UARuleListParams{
+ Description: cloudflare.F("abusive"),
+ DescriptionSearch: cloudflare.F("abusive"),
+ Page: cloudflare.F(1.000000),
+ PerPage: cloudflare.F(1.000000),
+ UASearch: cloudflare.F("Safari"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestUARuleDelete(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"),
+ )
+ _, err := client.Firewall.UARules.Delete(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ "372e67954025e0ba6aaa6d586b9e0b59",
+ )
+ 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())
+ }
+}
+
+func TestUARuleGet(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"),
+ )
+ _, err := client.Firewall.UARules.Get(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ "372e67954025e0ba6aaa6d586b9e0b59",
+ )
+ 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/firewall/waf.go b/firewall/waf.go
new file mode 100644
index 00000000000..6abdceada96
--- /dev/null
+++ b/firewall/waf.go
@@ -0,0 +1,28 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package firewall
+
+import (
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// WAFService contains methods and other services that help with interacting with
+// the cloudflare API. Note, unlike clients, this service does not read variables
+// from the environment automatically. You should not instantiate this service
+// directly, and instead use the [NewWAFService] method instead.
+type WAFService struct {
+ Options []option.RequestOption
+ Overrides *WAFOverrideService
+ Packages *WAFPackageService
+}
+
+// NewWAFService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewWAFService(opts ...option.RequestOption) (r *WAFService) {
+ r = &WAFService{}
+ r.Options = opts
+ r.Overrides = NewWAFOverrideService(opts...)
+ r.Packages = NewWAFPackageService(opts...)
+ return
+}
diff --git a/firewall/wafoverride.go b/firewall/wafoverride.go
new file mode 100644
index 00000000000..b9779f22c7e
--- /dev/null
+++ b/firewall/wafoverride.go
@@ -0,0 +1,567 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package firewall
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// WAFOverrideService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewWAFOverrideService] method
+// instead.
+type WAFOverrideService struct {
+ Options []option.RequestOption
+}
+
+// NewWAFOverrideService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewWAFOverrideService(opts ...option.RequestOption) (r *WAFOverrideService) {
+ r = &WAFOverrideService{}
+ r.Options = opts
+ return
+}
+
+// Creates a URI-based WAF override for a zone.
+//
+// **Note:** Applies only to the
+// [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).
+func (r *WAFOverrideService) New(ctx context.Context, zoneIdentifier string, body WAFOverrideNewParams, opts ...option.RequestOption) (res *LegacyJhsOverride, err error) {
+ opts = append(r.Options[:], opts...)
+ var env WAFOverrideNewResponseEnvelope
+ path := fmt.Sprintf("zones/%s/firewall/waf/overrides", zoneIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Updates an existing URI-based WAF override.
+//
+// **Note:** Applies only to the
+// [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).
+func (r *WAFOverrideService) Update(ctx context.Context, zoneIdentifier string, id string, body WAFOverrideUpdateParams, opts ...option.RequestOption) (res *LegacyJhsOverride, err error) {
+ opts = append(r.Options[:], opts...)
+ var env WAFOverrideUpdateResponseEnvelope
+ path := fmt.Sprintf("zones/%s/firewall/waf/overrides/%s", zoneIdentifier, id)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Fetches the URI-based WAF overrides in a zone.
+//
+// **Note:** Applies only to the
+// [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).
+func (r *WAFOverrideService) List(ctx context.Context, zoneIdentifier string, query WAFOverrideListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[LegacyJhsOverride], err error) {
+ var raw *http.Response
+ opts = append(r.Options, opts...)
+ opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
+ path := fmt.Sprintf("zones/%s/firewall/waf/overrides", zoneIdentifier)
+ cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...)
+ if err != nil {
+ return nil, err
+ }
+ err = cfg.Execute()
+ if err != nil {
+ return nil, err
+ }
+ res.SetPageConfig(cfg, raw)
+ return res, nil
+}
+
+// Fetches the URI-based WAF overrides in a zone.
+//
+// **Note:** Applies only to the
+// [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).
+func (r *WAFOverrideService) ListAutoPaging(ctx context.Context, zoneIdentifier string, query WAFOverrideListParams, opts ...option.RequestOption) *shared.V4PagePaginationArrayAutoPager[LegacyJhsOverride] {
+ return shared.NewV4PagePaginationArrayAutoPager(r.List(ctx, zoneIdentifier, query, opts...))
+}
+
+// Deletes an existing URI-based WAF override.
+//
+// **Note:** Applies only to the
+// [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).
+func (r *WAFOverrideService) Delete(ctx context.Context, zoneIdentifier string, id string, opts ...option.RequestOption) (res *WAFOverrideDeleteResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env WAFOverrideDeleteResponseEnvelope
+ path := fmt.Sprintf("zones/%s/firewall/waf/overrides/%s", zoneIdentifier, id)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Fetches the details of a URI-based WAF override.
+//
+// **Note:** Applies only to the
+// [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).
+func (r *WAFOverrideService) Get(ctx context.Context, zoneIdentifier string, id string, opts ...option.RequestOption) (res *LegacyJhsOverride, err error) {
+ opts = append(r.Options[:], opts...)
+ var env WAFOverrideGetResponseEnvelope
+ path := fmt.Sprintf("zones/%s/firewall/waf/overrides/%s", zoneIdentifier, id)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type LegacyJhsOverride struct {
+ // The unique identifier of the WAF override.
+ ID string `json:"id"`
+ // An informative summary of the current URI-based WAF override.
+ Description string `json:"description,nullable"`
+ // An object that allows you to enable or disable WAF rule groups for the current
+ // WAF override. Each key of this object must be the ID of a WAF rule group, and
+ // each value must be a valid WAF action (usually `default` or `disable`). When
+ // creating a new URI-based WAF override, you must provide a `groups` object or a
+ // `rules` object.
+ Groups map[string]interface{} `json:"groups"`
+ // When true, indicates that the WAF package is currently paused.
+ Paused bool `json:"paused"`
+ // The relative priority of the current URI-based WAF override when multiple
+ // overrides match a single URL. A lower number indicates higher priority. Higher
+ // priority overrides may overwrite values set by lower priority overrides.
+ Priority float64 `json:"priority"`
+ // Specifies that, when a WAF rule matches, its configured action will be replaced
+ // by the action configured in this object.
+ RewriteAction LegacyJhsOverrideRewriteAction `json:"rewrite_action"`
+ // An object that allows you to override the action of specific WAF rules. Each key
+ // of this object must be the ID of a WAF rule, and each value must be a valid WAF
+ // action. Unless you are disabling a rule, ensure that you also enable the rule
+ // group that this WAF rule belongs to. When creating a new URI-based WAF override,
+ // you must provide a `groups` object or a `rules` object.
+ Rules map[string]LegacyJhsOverrideRule `json:"rules"`
+ // The URLs to include in the current WAF override. You can use wildcards. Each
+ // entered URL will be escaped before use, which means you can only use simple
+ // wildcard patterns.
+ URLs []string `json:"urls"`
+ JSON legacyJhsOverrideJSON `json:"-"`
+}
+
+// legacyJhsOverrideJSON contains the JSON metadata for the struct
+// [LegacyJhsOverride]
+type legacyJhsOverrideJSON struct {
+ ID apijson.Field
+ Description apijson.Field
+ Groups apijson.Field
+ Paused apijson.Field
+ Priority apijson.Field
+ RewriteAction apijson.Field
+ Rules apijson.Field
+ URLs apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LegacyJhsOverride) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r legacyJhsOverrideJSON) RawJSON() string {
+ return r.raw
+}
+
+// Specifies that, when a WAF rule matches, its configured action will be replaced
+// by the action configured in this object.
+type LegacyJhsOverrideRewriteAction struct {
+ // The WAF rule action to apply.
+ Block LegacyJhsOverrideRewriteActionBlock `json:"block"`
+ Challenge interface{} `json:"challenge"`
+ Default interface{} `json:"default"`
+ // The WAF rule action to apply.
+ Disable LegacyJhsOverrideRewriteActionDisable `json:"disable"`
+ Simulate interface{} `json:"simulate"`
+ JSON legacyJhsOverrideRewriteActionJSON `json:"-"`
+}
+
+// legacyJhsOverrideRewriteActionJSON contains the JSON metadata for the struct
+// [LegacyJhsOverrideRewriteAction]
+type legacyJhsOverrideRewriteActionJSON struct {
+ Block apijson.Field
+ Challenge apijson.Field
+ Default apijson.Field
+ Disable apijson.Field
+ Simulate apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LegacyJhsOverrideRewriteAction) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r legacyJhsOverrideRewriteActionJSON) RawJSON() string {
+ return r.raw
+}
+
+// The WAF rule action to apply.
+type LegacyJhsOverrideRewriteActionBlock string
+
+const (
+ LegacyJhsOverrideRewriteActionBlockChallenge LegacyJhsOverrideRewriteActionBlock = "challenge"
+ LegacyJhsOverrideRewriteActionBlockBlock LegacyJhsOverrideRewriteActionBlock = "block"
+ LegacyJhsOverrideRewriteActionBlockSimulate LegacyJhsOverrideRewriteActionBlock = "simulate"
+ LegacyJhsOverrideRewriteActionBlockDisable LegacyJhsOverrideRewriteActionBlock = "disable"
+ LegacyJhsOverrideRewriteActionBlockDefault LegacyJhsOverrideRewriteActionBlock = "default"
+)
+
+// The WAF rule action to apply.
+type LegacyJhsOverrideRewriteActionDisable string
+
+const (
+ LegacyJhsOverrideRewriteActionDisableChallenge LegacyJhsOverrideRewriteActionDisable = "challenge"
+ LegacyJhsOverrideRewriteActionDisableBlock LegacyJhsOverrideRewriteActionDisable = "block"
+ LegacyJhsOverrideRewriteActionDisableSimulate LegacyJhsOverrideRewriteActionDisable = "simulate"
+ LegacyJhsOverrideRewriteActionDisableDisable LegacyJhsOverrideRewriteActionDisable = "disable"
+ LegacyJhsOverrideRewriteActionDisableDefault LegacyJhsOverrideRewriteActionDisable = "default"
+)
+
+// The WAF rule action to apply.
+type LegacyJhsOverrideRule string
+
+const (
+ LegacyJhsOverrideRuleChallenge LegacyJhsOverrideRule = "challenge"
+ LegacyJhsOverrideRuleBlock LegacyJhsOverrideRule = "block"
+ LegacyJhsOverrideRuleSimulate LegacyJhsOverrideRule = "simulate"
+ LegacyJhsOverrideRuleDisable LegacyJhsOverrideRule = "disable"
+ LegacyJhsOverrideRuleDefault LegacyJhsOverrideRule = "default"
+)
+
+type WAFOverrideDeleteResponse struct {
+ // The unique identifier of the WAF override.
+ ID string `json:"id"`
+ JSON wafOverrideDeleteResponseJSON `json:"-"`
+}
+
+// wafOverrideDeleteResponseJSON contains the JSON metadata for the struct
+// [WAFOverrideDeleteResponse]
+type wafOverrideDeleteResponseJSON struct {
+ ID apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WAFOverrideDeleteResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r wafOverrideDeleteResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type WAFOverrideNewParams struct {
+ Body param.Field[interface{}] `json:"body,required"`
+}
+
+func (r WAFOverrideNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r.Body)
+}
+
+type WAFOverrideNewResponseEnvelope struct {
+ Errors []WAFOverrideNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []WAFOverrideNewResponseEnvelopeMessages `json:"messages,required"`
+ Result LegacyJhsOverride `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success WAFOverrideNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON wafOverrideNewResponseEnvelopeJSON `json:"-"`
+}
+
+// wafOverrideNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [WAFOverrideNewResponseEnvelope]
+type wafOverrideNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WAFOverrideNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r wafOverrideNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type WAFOverrideNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON wafOverrideNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// wafOverrideNewResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [WAFOverrideNewResponseEnvelopeErrors]
+type wafOverrideNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WAFOverrideNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r wafOverrideNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type WAFOverrideNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON wafOverrideNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// wafOverrideNewResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [WAFOverrideNewResponseEnvelopeMessages]
+type wafOverrideNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WAFOverrideNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r wafOverrideNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type WAFOverrideNewResponseEnvelopeSuccess bool
+
+const (
+ WAFOverrideNewResponseEnvelopeSuccessTrue WAFOverrideNewResponseEnvelopeSuccess = true
+)
+
+type WAFOverrideUpdateParams struct {
+ Body param.Field[interface{}] `json:"body,required"`
+}
+
+func (r WAFOverrideUpdateParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r.Body)
+}
+
+type WAFOverrideUpdateResponseEnvelope struct {
+ Errors []WAFOverrideUpdateResponseEnvelopeErrors `json:"errors,required"`
+ Messages []WAFOverrideUpdateResponseEnvelopeMessages `json:"messages,required"`
+ Result LegacyJhsOverride `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success WAFOverrideUpdateResponseEnvelopeSuccess `json:"success,required"`
+ JSON wafOverrideUpdateResponseEnvelopeJSON `json:"-"`
+}
+
+// wafOverrideUpdateResponseEnvelopeJSON contains the JSON metadata for the struct
+// [WAFOverrideUpdateResponseEnvelope]
+type wafOverrideUpdateResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WAFOverrideUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r wafOverrideUpdateResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type WAFOverrideUpdateResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON wafOverrideUpdateResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// wafOverrideUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [WAFOverrideUpdateResponseEnvelopeErrors]
+type wafOverrideUpdateResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WAFOverrideUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r wafOverrideUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type WAFOverrideUpdateResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON wafOverrideUpdateResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// wafOverrideUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [WAFOverrideUpdateResponseEnvelopeMessages]
+type wafOverrideUpdateResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WAFOverrideUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r wafOverrideUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type WAFOverrideUpdateResponseEnvelopeSuccess bool
+
+const (
+ WAFOverrideUpdateResponseEnvelopeSuccessTrue WAFOverrideUpdateResponseEnvelopeSuccess = true
+)
+
+type WAFOverrideListParams struct {
+ // The page number of paginated results.
+ Page param.Field[float64] `query:"page"`
+ // The number of WAF overrides per page.
+ PerPage param.Field[float64] `query:"per_page"`
+}
+
+// URLQuery serializes [WAFOverrideListParams]'s query parameters as `url.Values`.
+func (r WAFOverrideListParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type WAFOverrideDeleteResponseEnvelope struct {
+ Result WAFOverrideDeleteResponse `json:"result"`
+ JSON wafOverrideDeleteResponseEnvelopeJSON `json:"-"`
+}
+
+// wafOverrideDeleteResponseEnvelopeJSON contains the JSON metadata for the struct
+// [WAFOverrideDeleteResponseEnvelope]
+type wafOverrideDeleteResponseEnvelopeJSON struct {
+ Result apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WAFOverrideDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r wafOverrideDeleteResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type WAFOverrideGetResponseEnvelope struct {
+ Errors []WAFOverrideGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []WAFOverrideGetResponseEnvelopeMessages `json:"messages,required"`
+ Result LegacyJhsOverride `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success WAFOverrideGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON wafOverrideGetResponseEnvelopeJSON `json:"-"`
+}
+
+// wafOverrideGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [WAFOverrideGetResponseEnvelope]
+type wafOverrideGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WAFOverrideGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r wafOverrideGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type WAFOverrideGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON wafOverrideGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// wafOverrideGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [WAFOverrideGetResponseEnvelopeErrors]
+type wafOverrideGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WAFOverrideGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r wafOverrideGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type WAFOverrideGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON wafOverrideGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// wafOverrideGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [WAFOverrideGetResponseEnvelopeMessages]
+type wafOverrideGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WAFOverrideGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r wafOverrideGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type WAFOverrideGetResponseEnvelopeSuccess bool
+
+const (
+ WAFOverrideGetResponseEnvelopeSuccessTrue WAFOverrideGetResponseEnvelopeSuccess = true
+)
diff --git a/firewall/wafoverride_test.go b/firewall/wafoverride_test.go
new file mode 100644
index 00000000000..06749e99f8f
--- /dev/null
+++ b/firewall/wafoverride_test.go
@@ -0,0 +1,163 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package firewall_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/firewall"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestWAFOverrideNew(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"),
+ )
+ _, err := client.Firewall.WAF.Overrides.New(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ firewall.WAFOverrideNewParams{
+ Body: cloudflare.F[any](map[string]interface{}{}),
+ },
+ )
+ 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())
+ }
+}
+
+func TestWAFOverrideUpdate(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"),
+ )
+ _, err := client.Firewall.WAF.Overrides.Update(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ "de677e5818985db1285d0e80225f06e5",
+ firewall.WAFOverrideUpdateParams{
+ Body: cloudflare.F[any](map[string]interface{}{}),
+ },
+ )
+ 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())
+ }
+}
+
+func TestWAFOverrideListWithOptionalParams(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"),
+ )
+ _, err := client.Firewall.WAF.Overrides.List(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ firewall.WAFOverrideListParams{
+ Page: cloudflare.F(1.000000),
+ PerPage: cloudflare.F(5.000000),
+ },
+ )
+ 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())
+ }
+}
+
+func TestWAFOverrideDelete(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"),
+ )
+ _, err := client.Firewall.WAF.Overrides.Delete(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ "de677e5818985db1285d0e80225f06e5",
+ )
+ 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())
+ }
+}
+
+func TestWAFOverrideGet(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"),
+ )
+ _, err := client.Firewall.WAF.Overrides.Get(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ "de677e5818985db1285d0e80225f06e5",
+ )
+ 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/firewall/wafpackage.go b/firewall/wafpackage.go
new file mode 100644
index 00000000000..68f83c89ec0
--- /dev/null
+++ b/firewall/wafpackage.go
@@ -0,0 +1,647 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package firewall
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+ "reflect"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/tidwall/gjson"
+)
+
+// WAFPackageService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewWAFPackageService] method instead.
+type WAFPackageService struct {
+ Options []option.RequestOption
+ Groups *WAFPackageGroupService
+ Rules *WAFPackageRuleService
+}
+
+// NewWAFPackageService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewWAFPackageService(opts ...option.RequestOption) (r *WAFPackageService) {
+ r = &WAFPackageService{}
+ r.Options = opts
+ r.Groups = NewWAFPackageGroupService(opts...)
+ r.Rules = NewWAFPackageRuleService(opts...)
+ return
+}
+
+// Fetches WAF packages for a zone.
+//
+// **Note:** Applies only to the
+// [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).
+func (r *WAFPackageService) List(ctx context.Context, zoneIdentifier string, query WAFPackageListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[WAFPackageListResponse], err error) {
+ var raw *http.Response
+ opts = append(r.Options, opts...)
+ opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
+ path := fmt.Sprintf("zones/%s/firewall/waf/packages", zoneIdentifier)
+ cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...)
+ if err != nil {
+ return nil, err
+ }
+ err = cfg.Execute()
+ if err != nil {
+ return nil, err
+ }
+ res.SetPageConfig(cfg, raw)
+ return res, nil
+}
+
+// Fetches WAF packages for a zone.
+//
+// **Note:** Applies only to the
+// [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).
+func (r *WAFPackageService) ListAutoPaging(ctx context.Context, zoneIdentifier string, query WAFPackageListParams, opts ...option.RequestOption) *shared.V4PagePaginationArrayAutoPager[WAFPackageListResponse] {
+ return shared.NewV4PagePaginationArrayAutoPager(r.List(ctx, zoneIdentifier, query, opts...))
+}
+
+// Fetches the details of a WAF package.
+//
+// **Note:** Applies only to the
+// [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).
+func (r *WAFPackageService) Get(ctx context.Context, zoneIdentifier string, identifier string, opts ...option.RequestOption) (res *WAFPackageGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ path := fmt.Sprintf("zones/%s/firewall/waf/packages/%s", zoneIdentifier, identifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &res, opts...)
+ return
+}
+
+// Union satisfied by
+// [firewall.WAFPackageListResponseLegacyJhsAPIResponseCollection] or
+// [firewall.WAFPackageListResponseObject].
+type WAFPackageListResponse interface {
+ implementsFirewallWAFPackageListResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*WAFPackageListResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(WAFPackageListResponseLegacyJhsAPIResponseCollection{}),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(WAFPackageListResponseObject{}),
+ },
+ )
+}
+
+type WAFPackageListResponseLegacyJhsAPIResponseCollection struct {
+ Errors []WAFPackageListResponseLegacyJhsAPIResponseCollectionError `json:"errors,required"`
+ Messages []WAFPackageListResponseLegacyJhsAPIResponseCollectionMessage `json:"messages,required"`
+ Result WAFPackageListResponseLegacyJhsAPIResponseCollectionResult `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success WAFPackageListResponseLegacyJhsAPIResponseCollectionSuccess `json:"success,required"`
+ ResultInfo WAFPackageListResponseLegacyJhsAPIResponseCollectionResultInfo `json:"result_info"`
+ JSON wafPackageListResponseLegacyJhsAPIResponseCollectionJSON `json:"-"`
+}
+
+// wafPackageListResponseLegacyJhsAPIResponseCollectionJSON contains the JSON
+// metadata for the struct [WAFPackageListResponseLegacyJhsAPIResponseCollection]
+type wafPackageListResponseLegacyJhsAPIResponseCollectionJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ ResultInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WAFPackageListResponseLegacyJhsAPIResponseCollection) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r wafPackageListResponseLegacyJhsAPIResponseCollectionJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r WAFPackageListResponseLegacyJhsAPIResponseCollection) implementsFirewallWAFPackageListResponse() {
+}
+
+type WAFPackageListResponseLegacyJhsAPIResponseCollectionError struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON wafPackageListResponseLegacyJhsAPIResponseCollectionErrorJSON `json:"-"`
+}
+
+// wafPackageListResponseLegacyJhsAPIResponseCollectionErrorJSON contains the JSON
+// metadata for the struct
+// [WAFPackageListResponseLegacyJhsAPIResponseCollectionError]
+type wafPackageListResponseLegacyJhsAPIResponseCollectionErrorJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WAFPackageListResponseLegacyJhsAPIResponseCollectionError) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r wafPackageListResponseLegacyJhsAPIResponseCollectionErrorJSON) RawJSON() string {
+ return r.raw
+}
+
+type WAFPackageListResponseLegacyJhsAPIResponseCollectionMessage struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON wafPackageListResponseLegacyJhsAPIResponseCollectionMessageJSON `json:"-"`
+}
+
+// wafPackageListResponseLegacyJhsAPIResponseCollectionMessageJSON contains the
+// JSON metadata for the struct
+// [WAFPackageListResponseLegacyJhsAPIResponseCollectionMessage]
+type wafPackageListResponseLegacyJhsAPIResponseCollectionMessageJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WAFPackageListResponseLegacyJhsAPIResponseCollectionMessage) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r wafPackageListResponseLegacyJhsAPIResponseCollectionMessageJSON) RawJSON() string {
+ return r.raw
+}
+
+// Union satisfied by
+// [firewall.WAFPackageListResponseLegacyJhsAPIResponseCollectionResultUnknown],
+// [firewall.WAFPackageListResponseLegacyJhsAPIResponseCollectionResultArray] or
+// [shared.UnionString].
+type WAFPackageListResponseLegacyJhsAPIResponseCollectionResult interface {
+ ImplementsFirewallWAFPackageListResponseLegacyJhsAPIResponseCollectionResult()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*WAFPackageListResponseLegacyJhsAPIResponseCollectionResult)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(WAFPackageListResponseLegacyJhsAPIResponseCollectionResultArray{}),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+type WAFPackageListResponseLegacyJhsAPIResponseCollectionResultArray []interface{}
+
+func (r WAFPackageListResponseLegacyJhsAPIResponseCollectionResultArray) ImplementsFirewallWAFPackageListResponseLegacyJhsAPIResponseCollectionResult() {
+}
+
+// Whether the API call was successful
+type WAFPackageListResponseLegacyJhsAPIResponseCollectionSuccess bool
+
+const (
+ WAFPackageListResponseLegacyJhsAPIResponseCollectionSuccessTrue WAFPackageListResponseLegacyJhsAPIResponseCollectionSuccess = true
+)
+
+type WAFPackageListResponseLegacyJhsAPIResponseCollectionResultInfo struct {
+ // Total number of results for the requested service
+ Count float64 `json:"count"`
+ // Current page within paginated list of results
+ Page float64 `json:"page"`
+ // Number of results per page of results
+ PerPage float64 `json:"per_page"`
+ // Total results available without any search parameters
+ TotalCount float64 `json:"total_count"`
+ JSON wafPackageListResponseLegacyJhsAPIResponseCollectionResultInfoJSON `json:"-"`
+}
+
+// wafPackageListResponseLegacyJhsAPIResponseCollectionResultInfoJSON contains the
+// JSON metadata for the struct
+// [WAFPackageListResponseLegacyJhsAPIResponseCollectionResultInfo]
+type wafPackageListResponseLegacyJhsAPIResponseCollectionResultInfoJSON struct {
+ Count apijson.Field
+ Page apijson.Field
+ PerPage apijson.Field
+ TotalCount apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WAFPackageListResponseLegacyJhsAPIResponseCollectionResultInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r wafPackageListResponseLegacyJhsAPIResponseCollectionResultInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type WAFPackageListResponseObject struct {
+ Result []WAFPackageListResponseObjectResult `json:"result"`
+ JSON wafPackageListResponseObjectJSON `json:"-"`
+}
+
+// wafPackageListResponseObjectJSON contains the JSON metadata for the struct
+// [WAFPackageListResponseObject]
+type wafPackageListResponseObjectJSON struct {
+ Result apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WAFPackageListResponseObject) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r wafPackageListResponseObjectJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r WAFPackageListResponseObject) implementsFirewallWAFPackageListResponse() {}
+
+// Union satisfied by
+// [firewall.WAFPackageListResponseObjectResultLegacyJhsPackageDefinition] or
+// [firewall.WAFPackageListResponseObjectResultLegacyJhsAnomalyPackage].
+type WAFPackageListResponseObjectResult interface {
+ implementsFirewallWAFPackageListResponseObjectResult()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*WAFPackageListResponseObjectResult)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(WAFPackageListResponseObjectResultLegacyJhsPackageDefinition{}),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(WAFPackageListResponseObjectResultLegacyJhsAnomalyPackage{}),
+ },
+ )
+}
+
+type WAFPackageListResponseObjectResultLegacyJhsPackageDefinition struct {
+ // The unique identifier of a WAF package.
+ ID string `json:"id,required"`
+ // A summary of the purpose/function of the WAF package.
+ Description string `json:"description,required"`
+ // The mode that defines how rules within the package are evaluated during the
+ // course of a request. When a package uses anomaly detection mode (`anomaly`
+ // value), each rule is given a score when triggered. If the total score of all
+ // triggered rules exceeds the sensitivity defined in the WAF package, the action
+ // configured in the package will be performed. Traditional detection mode
+ // (`traditional` value) will decide the action to take when it is triggered by the
+ // request. If multiple rules are triggered, the action providing the highest
+ // protection will be applied (for example, a 'block' action will win over a
+ // 'challenge' action).
+ DetectionMode WAFPackageListResponseObjectResultLegacyJhsPackageDefinitionDetectionMode `json:"detection_mode,required"`
+ // The name of the WAF package.
+ Name string `json:"name,required"`
+ // Identifier
+ ZoneID string `json:"zone_id,required"`
+ // When set to `active`, indicates that the WAF package will be applied to the
+ // zone.
+ Status WAFPackageListResponseObjectResultLegacyJhsPackageDefinitionStatus `json:"status"`
+ JSON wafPackageListResponseObjectResultLegacyJhsPackageDefinitionJSON `json:"-"`
+}
+
+// wafPackageListResponseObjectResultLegacyJhsPackageDefinitionJSON contains the
+// JSON metadata for the struct
+// [WAFPackageListResponseObjectResultLegacyJhsPackageDefinition]
+type wafPackageListResponseObjectResultLegacyJhsPackageDefinitionJSON struct {
+ ID apijson.Field
+ Description apijson.Field
+ DetectionMode apijson.Field
+ Name apijson.Field
+ ZoneID apijson.Field
+ Status apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WAFPackageListResponseObjectResultLegacyJhsPackageDefinition) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r wafPackageListResponseObjectResultLegacyJhsPackageDefinitionJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r WAFPackageListResponseObjectResultLegacyJhsPackageDefinition) implementsFirewallWAFPackageListResponseObjectResult() {
+}
+
+// The mode that defines how rules within the package are evaluated during the
+// course of a request. When a package uses anomaly detection mode (`anomaly`
+// value), each rule is given a score when triggered. If the total score of all
+// triggered rules exceeds the sensitivity defined in the WAF package, the action
+// configured in the package will be performed. Traditional detection mode
+// (`traditional` value) will decide the action to take when it is triggered by the
+// request. If multiple rules are triggered, the action providing the highest
+// protection will be applied (for example, a 'block' action will win over a
+// 'challenge' action).
+type WAFPackageListResponseObjectResultLegacyJhsPackageDefinitionDetectionMode string
+
+const (
+ WAFPackageListResponseObjectResultLegacyJhsPackageDefinitionDetectionModeAnomaly WAFPackageListResponseObjectResultLegacyJhsPackageDefinitionDetectionMode = "anomaly"
+ WAFPackageListResponseObjectResultLegacyJhsPackageDefinitionDetectionModeTraditional WAFPackageListResponseObjectResultLegacyJhsPackageDefinitionDetectionMode = "traditional"
+)
+
+// When set to `active`, indicates that the WAF package will be applied to the
+// zone.
+type WAFPackageListResponseObjectResultLegacyJhsPackageDefinitionStatus string
+
+const (
+ WAFPackageListResponseObjectResultLegacyJhsPackageDefinitionStatusActive WAFPackageListResponseObjectResultLegacyJhsPackageDefinitionStatus = "active"
+)
+
+type WAFPackageListResponseObjectResultLegacyJhsAnomalyPackage struct {
+ // The unique identifier of a WAF package.
+ ID string `json:"id,required"`
+ // A summary of the purpose/function of the WAF package.
+ Description string `json:"description,required"`
+ // When a WAF package uses anomaly detection, each rule is given a score when
+ // triggered. If the total score of all triggered rules exceeds the sensitivity
+ // defined on the WAF package, the action defined on the package will be taken.
+ DetectionMode WAFPackageListResponseObjectResultLegacyJhsAnomalyPackageDetectionMode `json:"detection_mode,required"`
+ // The name of the WAF package.
+ Name string `json:"name,required"`
+ // Identifier
+ ZoneID string `json:"zone_id,required"`
+ // The default action performed by the rules in the WAF package.
+ ActionMode WAFPackageListResponseObjectResultLegacyJhsAnomalyPackageActionMode `json:"action_mode"`
+ // The sensitivity of the WAF package.
+ Sensitivity WAFPackageListResponseObjectResultLegacyJhsAnomalyPackageSensitivity `json:"sensitivity"`
+ // When set to `active`, indicates that the WAF package will be applied to the
+ // zone.
+ Status WAFPackageListResponseObjectResultLegacyJhsAnomalyPackageStatus `json:"status"`
+ JSON wafPackageListResponseObjectResultLegacyJhsAnomalyPackageJSON `json:"-"`
+}
+
+// wafPackageListResponseObjectResultLegacyJhsAnomalyPackageJSON contains the JSON
+// metadata for the struct
+// [WAFPackageListResponseObjectResultLegacyJhsAnomalyPackage]
+type wafPackageListResponseObjectResultLegacyJhsAnomalyPackageJSON struct {
+ ID apijson.Field
+ Description apijson.Field
+ DetectionMode apijson.Field
+ Name apijson.Field
+ ZoneID apijson.Field
+ ActionMode apijson.Field
+ Sensitivity apijson.Field
+ Status apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WAFPackageListResponseObjectResultLegacyJhsAnomalyPackage) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r wafPackageListResponseObjectResultLegacyJhsAnomalyPackageJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r WAFPackageListResponseObjectResultLegacyJhsAnomalyPackage) implementsFirewallWAFPackageListResponseObjectResult() {
+}
+
+// When a WAF package uses anomaly detection, each rule is given a score when
+// triggered. If the total score of all triggered rules exceeds the sensitivity
+// defined on the WAF package, the action defined on the package will be taken.
+type WAFPackageListResponseObjectResultLegacyJhsAnomalyPackageDetectionMode string
+
+const (
+ WAFPackageListResponseObjectResultLegacyJhsAnomalyPackageDetectionModeAnomaly WAFPackageListResponseObjectResultLegacyJhsAnomalyPackageDetectionMode = "anomaly"
+ WAFPackageListResponseObjectResultLegacyJhsAnomalyPackageDetectionModeTraditional WAFPackageListResponseObjectResultLegacyJhsAnomalyPackageDetectionMode = "traditional"
+)
+
+// The default action performed by the rules in the WAF package.
+type WAFPackageListResponseObjectResultLegacyJhsAnomalyPackageActionMode string
+
+const (
+ WAFPackageListResponseObjectResultLegacyJhsAnomalyPackageActionModeSimulate WAFPackageListResponseObjectResultLegacyJhsAnomalyPackageActionMode = "simulate"
+ WAFPackageListResponseObjectResultLegacyJhsAnomalyPackageActionModeBlock WAFPackageListResponseObjectResultLegacyJhsAnomalyPackageActionMode = "block"
+ WAFPackageListResponseObjectResultLegacyJhsAnomalyPackageActionModeChallenge WAFPackageListResponseObjectResultLegacyJhsAnomalyPackageActionMode = "challenge"
+)
+
+// The sensitivity of the WAF package.
+type WAFPackageListResponseObjectResultLegacyJhsAnomalyPackageSensitivity string
+
+const (
+ WAFPackageListResponseObjectResultLegacyJhsAnomalyPackageSensitivityHigh WAFPackageListResponseObjectResultLegacyJhsAnomalyPackageSensitivity = "high"
+ WAFPackageListResponseObjectResultLegacyJhsAnomalyPackageSensitivityMedium WAFPackageListResponseObjectResultLegacyJhsAnomalyPackageSensitivity = "medium"
+ WAFPackageListResponseObjectResultLegacyJhsAnomalyPackageSensitivityLow WAFPackageListResponseObjectResultLegacyJhsAnomalyPackageSensitivity = "low"
+ WAFPackageListResponseObjectResultLegacyJhsAnomalyPackageSensitivityOff WAFPackageListResponseObjectResultLegacyJhsAnomalyPackageSensitivity = "off"
+)
+
+// When set to `active`, indicates that the WAF package will be applied to the
+// zone.
+type WAFPackageListResponseObjectResultLegacyJhsAnomalyPackageStatus string
+
+const (
+ WAFPackageListResponseObjectResultLegacyJhsAnomalyPackageStatusActive WAFPackageListResponseObjectResultLegacyJhsAnomalyPackageStatus = "active"
+)
+
+// Union satisfied by [firewall.WAFPackageGetResponseLegacyJhsAPIResponseSingle] or
+// [firewall.WAFPackageGetResponseObject].
+type WAFPackageGetResponse interface {
+ implementsFirewallWAFPackageGetResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*WAFPackageGetResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(WAFPackageGetResponseLegacyJhsAPIResponseSingle{}),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(WAFPackageGetResponseObject{}),
+ },
+ )
+}
+
+type WAFPackageGetResponseLegacyJhsAPIResponseSingle struct {
+ Errors []WAFPackageGetResponseLegacyJhsAPIResponseSingleError `json:"errors,required"`
+ Messages []WAFPackageGetResponseLegacyJhsAPIResponseSingleMessage `json:"messages,required"`
+ Result WAFPackageGetResponseLegacyJhsAPIResponseSingleResult `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success WAFPackageGetResponseLegacyJhsAPIResponseSingleSuccess `json:"success,required"`
+ JSON wafPackageGetResponseLegacyJhsAPIResponseSingleJSON `json:"-"`
+}
+
+// wafPackageGetResponseLegacyJhsAPIResponseSingleJSON contains the JSON metadata
+// for the struct [WAFPackageGetResponseLegacyJhsAPIResponseSingle]
+type wafPackageGetResponseLegacyJhsAPIResponseSingleJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WAFPackageGetResponseLegacyJhsAPIResponseSingle) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r wafPackageGetResponseLegacyJhsAPIResponseSingleJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r WAFPackageGetResponseLegacyJhsAPIResponseSingle) implementsFirewallWAFPackageGetResponse() {}
+
+type WAFPackageGetResponseLegacyJhsAPIResponseSingleError struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON wafPackageGetResponseLegacyJhsAPIResponseSingleErrorJSON `json:"-"`
+}
+
+// wafPackageGetResponseLegacyJhsAPIResponseSingleErrorJSON contains the JSON
+// metadata for the struct [WAFPackageGetResponseLegacyJhsAPIResponseSingleError]
+type wafPackageGetResponseLegacyJhsAPIResponseSingleErrorJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WAFPackageGetResponseLegacyJhsAPIResponseSingleError) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r wafPackageGetResponseLegacyJhsAPIResponseSingleErrorJSON) RawJSON() string {
+ return r.raw
+}
+
+type WAFPackageGetResponseLegacyJhsAPIResponseSingleMessage struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON wafPackageGetResponseLegacyJhsAPIResponseSingleMessageJSON `json:"-"`
+}
+
+// wafPackageGetResponseLegacyJhsAPIResponseSingleMessageJSON contains the JSON
+// metadata for the struct [WAFPackageGetResponseLegacyJhsAPIResponseSingleMessage]
+type wafPackageGetResponseLegacyJhsAPIResponseSingleMessageJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WAFPackageGetResponseLegacyJhsAPIResponseSingleMessage) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r wafPackageGetResponseLegacyJhsAPIResponseSingleMessageJSON) RawJSON() string {
+ return r.raw
+}
+
+// Union satisfied by
+// [firewall.WAFPackageGetResponseLegacyJhsAPIResponseSingleResultUnknown] or
+// [shared.UnionString].
+type WAFPackageGetResponseLegacyJhsAPIResponseSingleResult interface {
+ ImplementsFirewallWAFPackageGetResponseLegacyJhsAPIResponseSingleResult()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*WAFPackageGetResponseLegacyJhsAPIResponseSingleResult)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+// Whether the API call was successful
+type WAFPackageGetResponseLegacyJhsAPIResponseSingleSuccess bool
+
+const (
+ WAFPackageGetResponseLegacyJhsAPIResponseSingleSuccessTrue WAFPackageGetResponseLegacyJhsAPIResponseSingleSuccess = true
+)
+
+type WAFPackageGetResponseObject struct {
+ Result interface{} `json:"result"`
+ JSON wafPackageGetResponseObjectJSON `json:"-"`
+}
+
+// wafPackageGetResponseObjectJSON contains the JSON metadata for the struct
+// [WAFPackageGetResponseObject]
+type wafPackageGetResponseObjectJSON struct {
+ Result apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WAFPackageGetResponseObject) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r wafPackageGetResponseObjectJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r WAFPackageGetResponseObject) implementsFirewallWAFPackageGetResponse() {}
+
+type WAFPackageListParams struct {
+ // The direction used to sort returned packages.
+ Direction param.Field[WAFPackageListParamsDirection] `query:"direction"`
+ // When set to `all`, all the search requirements must match. When set to `any`,
+ // only one of the search requirements has to match.
+ Match param.Field[WAFPackageListParamsMatch] `query:"match"`
+ // The field used to sort returned packages.
+ Order param.Field[WAFPackageListParamsOrder] `query:"order"`
+ // The page number of paginated results.
+ Page param.Field[float64] `query:"page"`
+ // The number of packages per page.
+ PerPage param.Field[float64] `query:"per_page"`
+}
+
+// URLQuery serializes [WAFPackageListParams]'s query parameters as `url.Values`.
+func (r WAFPackageListParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// The direction used to sort returned packages.
+type WAFPackageListParamsDirection string
+
+const (
+ WAFPackageListParamsDirectionAsc WAFPackageListParamsDirection = "asc"
+ WAFPackageListParamsDirectionDesc WAFPackageListParamsDirection = "desc"
+)
+
+// When set to `all`, all the search requirements must match. When set to `any`,
+// only one of the search requirements has to match.
+type WAFPackageListParamsMatch string
+
+const (
+ WAFPackageListParamsMatchAny WAFPackageListParamsMatch = "any"
+ WAFPackageListParamsMatchAll WAFPackageListParamsMatch = "all"
+)
+
+// The field used to sort returned packages.
+type WAFPackageListParamsOrder string
+
+const (
+ WAFPackageListParamsOrderName WAFPackageListParamsOrder = "name"
+)
diff --git a/firewall/wafpackage_test.go b/firewall/wafpackage_test.go
new file mode 100644
index 00000000000..ef7308b0455
--- /dev/null
+++ b/firewall/wafpackage_test.go
@@ -0,0 +1,77 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package firewall_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/firewall"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestWAFPackageListWithOptionalParams(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"),
+ )
+ _, err := client.Firewall.WAF.Packages.List(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ firewall.WAFPackageListParams{
+ Direction: cloudflare.F(firewall.WAFPackageListParamsDirectionDesc),
+ Match: cloudflare.F(firewall.WAFPackageListParamsMatchAny),
+ Order: cloudflare.F(firewall.WAFPackageListParamsOrderName),
+ Page: cloudflare.F(1.000000),
+ PerPage: cloudflare.F(5.000000),
+ },
+ )
+ 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())
+ }
+}
+
+func TestWAFPackageGet(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"),
+ )
+ _, err := client.Firewall.WAF.Packages.Get(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ "a25a9a7e9c00afc1fb2e0245519d725b",
+ )
+ 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/firewall/wafpackagegroup.go b/firewall/wafpackagegroup.go
new file mode 100644
index 00000000000..16ba17c9c98
--- /dev/null
+++ b/firewall/wafpackagegroup.go
@@ -0,0 +1,462 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package firewall
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+ "reflect"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/tidwall/gjson"
+)
+
+// WAFPackageGroupService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewWAFPackageGroupService] method
+// instead.
+type WAFPackageGroupService struct {
+ Options []option.RequestOption
+}
+
+// NewWAFPackageGroupService generates a new service that applies the given options
+// to each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewWAFPackageGroupService(opts ...option.RequestOption) (r *WAFPackageGroupService) {
+ r = &WAFPackageGroupService{}
+ r.Options = opts
+ return
+}
+
+// Fetches the WAF rule groups in a WAF package.
+//
+// **Note:** Applies only to the
+// [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).
+func (r *WAFPackageGroupService) List(ctx context.Context, packageID string, params WAFPackageGroupListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[WAFManagedRulesSchemasGroup], err error) {
+ var raw *http.Response
+ opts = append(r.Options, opts...)
+ opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
+ path := fmt.Sprintf("zones/%s/firewall/waf/packages/%s/groups", params.ZoneID, packageID)
+ cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, params, &res, opts...)
+ if err != nil {
+ return nil, err
+ }
+ err = cfg.Execute()
+ if err != nil {
+ return nil, err
+ }
+ res.SetPageConfig(cfg, raw)
+ return res, nil
+}
+
+// Fetches the WAF rule groups in a WAF package.
+//
+// **Note:** Applies only to the
+// [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).
+func (r *WAFPackageGroupService) ListAutoPaging(ctx context.Context, packageID string, params WAFPackageGroupListParams, opts ...option.RequestOption) *shared.V4PagePaginationArrayAutoPager[WAFManagedRulesSchemasGroup] {
+ return shared.NewV4PagePaginationArrayAutoPager(r.List(ctx, packageID, params, opts...))
+}
+
+// Updates a WAF rule group. You can update the state (`mode` parameter) of a rule
+// group.
+//
+// **Note:** Applies only to the
+// [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).
+func (r *WAFPackageGroupService) Edit(ctx context.Context, packageID string, groupID string, params WAFPackageGroupEditParams, opts ...option.RequestOption) (res *WAFPackageGroupEditResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env WAFPackageGroupEditResponseEnvelope
+ path := fmt.Sprintf("zones/%s/firewall/waf/packages/%s/groups/%s", params.ZoneID, packageID, groupID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Fetches the details of a WAF rule group.
+//
+// **Note:** Applies only to the
+// [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).
+func (r *WAFPackageGroupService) Get(ctx context.Context, packageID string, groupID string, query WAFPackageGroupGetParams, opts ...option.RequestOption) (res *WAFPackageGroupGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env WAFPackageGroupGetResponseEnvelope
+ path := fmt.Sprintf("zones/%s/firewall/waf/packages/%s/groups/%s", query.ZoneID, packageID, groupID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type WAFManagedRulesSchemasGroup struct {
+ // The unique identifier of the rule group.
+ ID string `json:"id,required"`
+ // An informative summary of what the rule group does.
+ Description string `json:"description,required,nullable"`
+ // The state of the rules contained in the rule group. When `on`, the rules in the
+ // group are configurable/usable.
+ Mode WAFManagedRulesSchemasGroupMode `json:"mode,required"`
+ // The name of the rule group.
+ Name string `json:"name,required"`
+ // The number of rules in the current rule group.
+ RulesCount float64 `json:"rules_count,required"`
+ // The available states for the rule group.
+ AllowedModes []WAFManagedRulesSchemasGroupAllowedMode `json:"allowed_modes"`
+ // The number of rules within the group that have been modified from their default
+ // configuration.
+ ModifiedRulesCount float64 `json:"modified_rules_count"`
+ // The unique identifier of a WAF package.
+ PackageID string `json:"package_id"`
+ JSON wafManagedRulesSchemasGroupJSON `json:"-"`
+}
+
+// wafManagedRulesSchemasGroupJSON contains the JSON metadata for the struct
+// [WAFManagedRulesSchemasGroup]
+type wafManagedRulesSchemasGroupJSON struct {
+ ID apijson.Field
+ Description apijson.Field
+ Mode apijson.Field
+ Name apijson.Field
+ RulesCount apijson.Field
+ AllowedModes apijson.Field
+ ModifiedRulesCount apijson.Field
+ PackageID apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WAFManagedRulesSchemasGroup) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r wafManagedRulesSchemasGroupJSON) RawJSON() string {
+ return r.raw
+}
+
+// The state of the rules contained in the rule group. When `on`, the rules in the
+// group are configurable/usable.
+type WAFManagedRulesSchemasGroupMode string
+
+const (
+ WAFManagedRulesSchemasGroupModeOn WAFManagedRulesSchemasGroupMode = "on"
+ WAFManagedRulesSchemasGroupModeOff WAFManagedRulesSchemasGroupMode = "off"
+)
+
+// The state of the rules contained in the rule group. When `on`, the rules in the
+// group are configurable/usable.
+type WAFManagedRulesSchemasGroupAllowedMode string
+
+const (
+ WAFManagedRulesSchemasGroupAllowedModeOn WAFManagedRulesSchemasGroupAllowedMode = "on"
+ WAFManagedRulesSchemasGroupAllowedModeOff WAFManagedRulesSchemasGroupAllowedMode = "off"
+)
+
+// Union satisfied by [firewall.WAFPackageGroupEditResponseUnknown],
+// [firewall.WAFPackageGroupEditResponseArray] or [shared.UnionString].
+type WAFPackageGroupEditResponse interface {
+ ImplementsFirewallWAFPackageGroupEditResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*WAFPackageGroupEditResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(WAFPackageGroupEditResponseArray{}),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+type WAFPackageGroupEditResponseArray []interface{}
+
+func (r WAFPackageGroupEditResponseArray) ImplementsFirewallWAFPackageGroupEditResponse() {}
+
+// Union satisfied by [firewall.WAFPackageGroupGetResponseUnknown],
+// [firewall.WAFPackageGroupGetResponseArray] or [shared.UnionString].
+type WAFPackageGroupGetResponse interface {
+ ImplementsFirewallWAFPackageGroupGetResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*WAFPackageGroupGetResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(WAFPackageGroupGetResponseArray{}),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+type WAFPackageGroupGetResponseArray []interface{}
+
+func (r WAFPackageGroupGetResponseArray) ImplementsFirewallWAFPackageGroupGetResponse() {}
+
+type WAFPackageGroupListParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+ // The direction used to sort returned rule groups.
+ Direction param.Field[WAFPackageGroupListParamsDirection] `query:"direction"`
+ // When set to `all`, all the search requirements must match. When set to `any`,
+ // only one of the search requirements has to match.
+ Match param.Field[WAFPackageGroupListParamsMatch] `query:"match"`
+ // The state of the rules contained in the rule group. When `on`, the rules in the
+ // group are configurable/usable.
+ Mode param.Field[WAFPackageGroupListParamsMode] `query:"mode"`
+ // The field used to sort returned rule groups.
+ Order param.Field[WAFPackageGroupListParamsOrder] `query:"order"`
+ // The page number of paginated results.
+ Page param.Field[float64] `query:"page"`
+ // The number of rule groups per page.
+ PerPage param.Field[float64] `query:"per_page"`
+}
+
+// URLQuery serializes [WAFPackageGroupListParams]'s query parameters as
+// `url.Values`.
+func (r WAFPackageGroupListParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// The direction used to sort returned rule groups.
+type WAFPackageGroupListParamsDirection string
+
+const (
+ WAFPackageGroupListParamsDirectionAsc WAFPackageGroupListParamsDirection = "asc"
+ WAFPackageGroupListParamsDirectionDesc WAFPackageGroupListParamsDirection = "desc"
+)
+
+// When set to `all`, all the search requirements must match. When set to `any`,
+// only one of the search requirements has to match.
+type WAFPackageGroupListParamsMatch string
+
+const (
+ WAFPackageGroupListParamsMatchAny WAFPackageGroupListParamsMatch = "any"
+ WAFPackageGroupListParamsMatchAll WAFPackageGroupListParamsMatch = "all"
+)
+
+// The state of the rules contained in the rule group. When `on`, the rules in the
+// group are configurable/usable.
+type WAFPackageGroupListParamsMode string
+
+const (
+ WAFPackageGroupListParamsModeOn WAFPackageGroupListParamsMode = "on"
+ WAFPackageGroupListParamsModeOff WAFPackageGroupListParamsMode = "off"
+)
+
+// The field used to sort returned rule groups.
+type WAFPackageGroupListParamsOrder string
+
+const (
+ WAFPackageGroupListParamsOrderMode WAFPackageGroupListParamsOrder = "mode"
+ WAFPackageGroupListParamsOrderRulesCount WAFPackageGroupListParamsOrder = "rules_count"
+)
+
+type WAFPackageGroupEditParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+ // The state of the rules contained in the rule group. When `on`, the rules in the
+ // group are configurable/usable.
+ Mode param.Field[WAFPackageGroupEditParamsMode] `json:"mode"`
+}
+
+func (r WAFPackageGroupEditParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The state of the rules contained in the rule group. When `on`, the rules in the
+// group are configurable/usable.
+type WAFPackageGroupEditParamsMode string
+
+const (
+ WAFPackageGroupEditParamsModeOn WAFPackageGroupEditParamsMode = "on"
+ WAFPackageGroupEditParamsModeOff WAFPackageGroupEditParamsMode = "off"
+)
+
+type WAFPackageGroupEditResponseEnvelope struct {
+ Errors []WAFPackageGroupEditResponseEnvelopeErrors `json:"errors,required"`
+ Messages []WAFPackageGroupEditResponseEnvelopeMessages `json:"messages,required"`
+ Result WAFPackageGroupEditResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success WAFPackageGroupEditResponseEnvelopeSuccess `json:"success,required"`
+ JSON wafPackageGroupEditResponseEnvelopeJSON `json:"-"`
+}
+
+// wafPackageGroupEditResponseEnvelopeJSON contains the JSON metadata for the
+// struct [WAFPackageGroupEditResponseEnvelope]
+type wafPackageGroupEditResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WAFPackageGroupEditResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r wafPackageGroupEditResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type WAFPackageGroupEditResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON wafPackageGroupEditResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// wafPackageGroupEditResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [WAFPackageGroupEditResponseEnvelopeErrors]
+type wafPackageGroupEditResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WAFPackageGroupEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r wafPackageGroupEditResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type WAFPackageGroupEditResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON wafPackageGroupEditResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// wafPackageGroupEditResponseEnvelopeMessagesJSON contains the JSON metadata for
+// the struct [WAFPackageGroupEditResponseEnvelopeMessages]
+type wafPackageGroupEditResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WAFPackageGroupEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r wafPackageGroupEditResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type WAFPackageGroupEditResponseEnvelopeSuccess bool
+
+const (
+ WAFPackageGroupEditResponseEnvelopeSuccessTrue WAFPackageGroupEditResponseEnvelopeSuccess = true
+)
+
+type WAFPackageGroupGetParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+}
+
+type WAFPackageGroupGetResponseEnvelope struct {
+ Errors []WAFPackageGroupGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []WAFPackageGroupGetResponseEnvelopeMessages `json:"messages,required"`
+ Result WAFPackageGroupGetResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success WAFPackageGroupGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON wafPackageGroupGetResponseEnvelopeJSON `json:"-"`
+}
+
+// wafPackageGroupGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [WAFPackageGroupGetResponseEnvelope]
+type wafPackageGroupGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WAFPackageGroupGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r wafPackageGroupGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type WAFPackageGroupGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON wafPackageGroupGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// wafPackageGroupGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [WAFPackageGroupGetResponseEnvelopeErrors]
+type wafPackageGroupGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WAFPackageGroupGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r wafPackageGroupGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type WAFPackageGroupGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON wafPackageGroupGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// wafPackageGroupGetResponseEnvelopeMessagesJSON contains the JSON metadata for
+// the struct [WAFPackageGroupGetResponseEnvelopeMessages]
+type wafPackageGroupGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WAFPackageGroupGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r wafPackageGroupGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type WAFPackageGroupGetResponseEnvelopeSuccess bool
+
+const (
+ WAFPackageGroupGetResponseEnvelopeSuccessTrue WAFPackageGroupGetResponseEnvelopeSuccess = true
+)
diff --git a/firewall/wafpackagegroup_test.go b/firewall/wafpackagegroup_test.go
new file mode 100644
index 00000000000..6f4ae25c1dd
--- /dev/null
+++ b/firewall/wafpackagegroup_test.go
@@ -0,0 +1,114 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package firewall_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/firewall"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestWAFPackageGroupListWithOptionalParams(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"),
+ )
+ _, err := client.Firewall.WAF.Packages.Groups.List(
+ context.TODO(),
+ "a25a9a7e9c00afc1fb2e0245519d725b",
+ firewall.WAFPackageGroupListParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Direction: cloudflare.F(firewall.WAFPackageGroupListParamsDirectionDesc),
+ Match: cloudflare.F(firewall.WAFPackageGroupListParamsMatchAny),
+ Mode: cloudflare.F(firewall.WAFPackageGroupListParamsModeOn),
+ Order: cloudflare.F(firewall.WAFPackageGroupListParamsOrderMode),
+ Page: cloudflare.F(1.000000),
+ PerPage: cloudflare.F(5.000000),
+ },
+ )
+ 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())
+ }
+}
+
+func TestWAFPackageGroupEditWithOptionalParams(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"),
+ )
+ _, err := client.Firewall.WAF.Packages.Groups.Edit(
+ context.TODO(),
+ "a25a9a7e9c00afc1fb2e0245519d725b",
+ "a25a9a7e9c00afc1fb2e0245519d725b",
+ firewall.WAFPackageGroupEditParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Mode: cloudflare.F(firewall.WAFPackageGroupEditParamsModeOn),
+ },
+ )
+ 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())
+ }
+}
+
+func TestWAFPackageGroupGet(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"),
+ )
+ _, err := client.Firewall.WAF.Packages.Groups.Get(
+ context.TODO(),
+ "a25a9a7e9c00afc1fb2e0245519d725b",
+ "a25a9a7e9c00afc1fb2e0245519d725b",
+ firewall.WAFPackageGroupGetParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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/firewall/wafpackagerule.go b/firewall/wafpackagerule.go
new file mode 100644
index 00000000000..f122f305584
--- /dev/null
+++ b/firewall/wafpackagerule.go
@@ -0,0 +1,1042 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package firewall
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+ "reflect"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/tidwall/gjson"
+)
+
+// WAFPackageRuleService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewWAFPackageRuleService] method
+// instead.
+type WAFPackageRuleService struct {
+ Options []option.RequestOption
+}
+
+// NewWAFPackageRuleService generates a new service that applies the given options
+// to each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewWAFPackageRuleService(opts ...option.RequestOption) (r *WAFPackageRuleService) {
+ r = &WAFPackageRuleService{}
+ r.Options = opts
+ return
+}
+
+// Fetches WAF rules in a WAF package.
+//
+// **Note:** Applies only to the
+// [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).
+func (r *WAFPackageRuleService) List(ctx context.Context, packageID string, params WAFPackageRuleListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[WAFManagedRulesRule], err error) {
+ var raw *http.Response
+ opts = append(r.Options, opts...)
+ opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
+ path := fmt.Sprintf("zones/%s/firewall/waf/packages/%s/rules", params.ZoneID, packageID)
+ cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, params, &res, opts...)
+ if err != nil {
+ return nil, err
+ }
+ err = cfg.Execute()
+ if err != nil {
+ return nil, err
+ }
+ res.SetPageConfig(cfg, raw)
+ return res, nil
+}
+
+// Fetches WAF rules in a WAF package.
+//
+// **Note:** Applies only to the
+// [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).
+func (r *WAFPackageRuleService) ListAutoPaging(ctx context.Context, packageID string, params WAFPackageRuleListParams, opts ...option.RequestOption) *shared.V4PagePaginationArrayAutoPager[WAFManagedRulesRule] {
+ return shared.NewV4PagePaginationArrayAutoPager(r.List(ctx, packageID, params, opts...))
+}
+
+// Updates a WAF rule. You can only update the mode/action of the rule.
+//
+// **Note:** Applies only to the
+// [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).
+func (r *WAFPackageRuleService) Edit(ctx context.Context, packageID string, ruleID string, params WAFPackageRuleEditParams, opts ...option.RequestOption) (res *WAFPackageRuleEditResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env WAFPackageRuleEditResponseEnvelope
+ path := fmt.Sprintf("zones/%s/firewall/waf/packages/%s/rules/%s", params.ZoneID, packageID, ruleID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Fetches the details of a WAF rule in a WAF package.
+//
+// **Note:** Applies only to the
+// [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).
+func (r *WAFPackageRuleService) Get(ctx context.Context, packageID string, ruleID string, query WAFPackageRuleGetParams, opts ...option.RequestOption) (res *WAFPackageRuleGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env WAFPackageRuleGetResponseEnvelope
+ path := fmt.Sprintf("zones/%s/firewall/waf/packages/%s/rules/%s", query.ZoneID, packageID, ruleID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// When triggered, anomaly detection WAF rules contribute to an overall threat
+// score that will determine if a request is considered malicious. You can
+// configure the total scoring threshold through the 'sensitivity' property of the
+// WAF package.
+//
+// Union satisfied by [firewall.WAFManagedRulesRuleWAFManagedRulesAnomalyRule],
+// [firewall.WAFManagedRulesRuleWAFManagedRulesTraditionalDenyRule] or
+// [firewall.WAFManagedRulesRuleWAFManagedRulesTraditionalAllowRule].
+type WAFManagedRulesRule interface {
+ implementsFirewallWAFManagedRulesRule()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*WAFManagedRulesRule)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(WAFManagedRulesRuleWAFManagedRulesAnomalyRule{}),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(WAFManagedRulesRuleWAFManagedRulesTraditionalDenyRule{}),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(WAFManagedRulesRuleWAFManagedRulesTraditionalAllowRule{}),
+ },
+ )
+}
+
+// When triggered, anomaly detection WAF rules contribute to an overall threat
+// score that will determine if a request is considered malicious. You can
+// configure the total scoring threshold through the 'sensitivity' property of the
+// WAF package.
+type WAFManagedRulesRuleWAFManagedRulesAnomalyRule struct {
+ // The unique identifier of the WAF rule.
+ ID string `json:"id,required"`
+ // Defines the available modes for the current WAF rule. Applies to anomaly
+ // detection WAF rules.
+ AllowedModes []WAFManagedRulesRuleWAFManagedRulesAnomalyRuleAllowedMode `json:"allowed_modes,required"`
+ // The public description of the WAF rule.
+ Description string `json:"description,required"`
+ // The rule group to which the current WAF rule belongs.
+ Group WAFManagedRulesRuleWAFManagedRulesAnomalyRuleGroup `json:"group,required"`
+ // When set to `on`, the current WAF rule will be used when evaluating the request.
+ // Applies to anomaly detection WAF rules.
+ Mode WAFManagedRulesRuleWAFManagedRulesAnomalyRuleMode `json:"mode,required"`
+ // The unique identifier of a WAF package.
+ PackageID string `json:"package_id,required"`
+ // The order in which the individual WAF rule is executed within its rule group.
+ Priority string `json:"priority,required"`
+ JSON wafManagedRulesRuleWAFManagedRulesAnomalyRuleJSON `json:"-"`
+}
+
+// wafManagedRulesRuleWAFManagedRulesAnomalyRuleJSON contains the JSON metadata for
+// the struct [WAFManagedRulesRuleWAFManagedRulesAnomalyRule]
+type wafManagedRulesRuleWAFManagedRulesAnomalyRuleJSON struct {
+ ID apijson.Field
+ AllowedModes apijson.Field
+ Description apijson.Field
+ Group apijson.Field
+ Mode apijson.Field
+ PackageID apijson.Field
+ Priority apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WAFManagedRulesRuleWAFManagedRulesAnomalyRule) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r wafManagedRulesRuleWAFManagedRulesAnomalyRuleJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r WAFManagedRulesRuleWAFManagedRulesAnomalyRule) implementsFirewallWAFManagedRulesRule() {}
+
+// When set to `on`, the current WAF rule will be used when evaluating the request.
+// Applies to anomaly detection WAF rules.
+type WAFManagedRulesRuleWAFManagedRulesAnomalyRuleAllowedMode string
+
+const (
+ WAFManagedRulesRuleWAFManagedRulesAnomalyRuleAllowedModeOn WAFManagedRulesRuleWAFManagedRulesAnomalyRuleAllowedMode = "on"
+ WAFManagedRulesRuleWAFManagedRulesAnomalyRuleAllowedModeOff WAFManagedRulesRuleWAFManagedRulesAnomalyRuleAllowedMode = "off"
+)
+
+// The rule group to which the current WAF rule belongs.
+type WAFManagedRulesRuleWAFManagedRulesAnomalyRuleGroup struct {
+ // The unique identifier of the rule group.
+ ID string `json:"id"`
+ // The name of the rule group.
+ Name string `json:"name"`
+ JSON wafManagedRulesRuleWAFManagedRulesAnomalyRuleGroupJSON `json:"-"`
+}
+
+// wafManagedRulesRuleWAFManagedRulesAnomalyRuleGroupJSON contains the JSON
+// metadata for the struct [WAFManagedRulesRuleWAFManagedRulesAnomalyRuleGroup]
+type wafManagedRulesRuleWAFManagedRulesAnomalyRuleGroupJSON struct {
+ ID apijson.Field
+ Name apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WAFManagedRulesRuleWAFManagedRulesAnomalyRuleGroup) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r wafManagedRulesRuleWAFManagedRulesAnomalyRuleGroupJSON) RawJSON() string {
+ return r.raw
+}
+
+// When set to `on`, the current WAF rule will be used when evaluating the request.
+// Applies to anomaly detection WAF rules.
+type WAFManagedRulesRuleWAFManagedRulesAnomalyRuleMode string
+
+const (
+ WAFManagedRulesRuleWAFManagedRulesAnomalyRuleModeOn WAFManagedRulesRuleWAFManagedRulesAnomalyRuleMode = "on"
+ WAFManagedRulesRuleWAFManagedRulesAnomalyRuleModeOff WAFManagedRulesRuleWAFManagedRulesAnomalyRuleMode = "off"
+)
+
+// When triggered, traditional WAF rules cause the firewall to immediately act upon
+// the request based on the configuration of the rule. A 'deny' rule will
+// immediately respond to the request based on the configured rule action/mode (for
+// example, 'block') and no other rules will be processed.
+type WAFManagedRulesRuleWAFManagedRulesTraditionalDenyRule struct {
+ // The unique identifier of the WAF rule.
+ ID string `json:"id,required"`
+ // The list of possible actions of the WAF rule when it is triggered.
+ AllowedModes []WAFManagedRulesRuleWAFManagedRulesTraditionalDenyRuleAllowedMode `json:"allowed_modes,required"`
+ // The default action/mode of a rule.
+ DefaultMode WAFManagedRulesRuleWAFManagedRulesTraditionalDenyRuleDefaultMode `json:"default_mode,required"`
+ // The public description of the WAF rule.
+ Description string `json:"description,required"`
+ // The rule group to which the current WAF rule belongs.
+ Group WAFManagedRulesRuleWAFManagedRulesTraditionalDenyRuleGroup `json:"group,required"`
+ // The action that the current WAF rule will perform when triggered. Applies to
+ // traditional (deny) WAF rules.
+ Mode WAFManagedRulesRuleWAFManagedRulesTraditionalDenyRuleMode `json:"mode,required"`
+ // The unique identifier of a WAF package.
+ PackageID string `json:"package_id,required"`
+ // The order in which the individual WAF rule is executed within its rule group.
+ Priority string `json:"priority,required"`
+ JSON wafManagedRulesRuleWAFManagedRulesTraditionalDenyRuleJSON `json:"-"`
+}
+
+// wafManagedRulesRuleWAFManagedRulesTraditionalDenyRuleJSON contains the JSON
+// metadata for the struct [WAFManagedRulesRuleWAFManagedRulesTraditionalDenyRule]
+type wafManagedRulesRuleWAFManagedRulesTraditionalDenyRuleJSON struct {
+ ID apijson.Field
+ AllowedModes apijson.Field
+ DefaultMode apijson.Field
+ Description apijson.Field
+ Group apijson.Field
+ Mode apijson.Field
+ PackageID apijson.Field
+ Priority apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WAFManagedRulesRuleWAFManagedRulesTraditionalDenyRule) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r wafManagedRulesRuleWAFManagedRulesTraditionalDenyRuleJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r WAFManagedRulesRuleWAFManagedRulesTraditionalDenyRule) implementsFirewallWAFManagedRulesRule() {
+}
+
+// The action that the current WAF rule will perform when triggered. Applies to
+// traditional (deny) WAF rules.
+type WAFManagedRulesRuleWAFManagedRulesTraditionalDenyRuleAllowedMode string
+
+const (
+ WAFManagedRulesRuleWAFManagedRulesTraditionalDenyRuleAllowedModeDefault WAFManagedRulesRuleWAFManagedRulesTraditionalDenyRuleAllowedMode = "default"
+ WAFManagedRulesRuleWAFManagedRulesTraditionalDenyRuleAllowedModeDisable WAFManagedRulesRuleWAFManagedRulesTraditionalDenyRuleAllowedMode = "disable"
+ WAFManagedRulesRuleWAFManagedRulesTraditionalDenyRuleAllowedModeSimulate WAFManagedRulesRuleWAFManagedRulesTraditionalDenyRuleAllowedMode = "simulate"
+ WAFManagedRulesRuleWAFManagedRulesTraditionalDenyRuleAllowedModeBlock WAFManagedRulesRuleWAFManagedRulesTraditionalDenyRuleAllowedMode = "block"
+ WAFManagedRulesRuleWAFManagedRulesTraditionalDenyRuleAllowedModeChallenge WAFManagedRulesRuleWAFManagedRulesTraditionalDenyRuleAllowedMode = "challenge"
+)
+
+// The default action/mode of a rule.
+type WAFManagedRulesRuleWAFManagedRulesTraditionalDenyRuleDefaultMode string
+
+const (
+ WAFManagedRulesRuleWAFManagedRulesTraditionalDenyRuleDefaultModeDisable WAFManagedRulesRuleWAFManagedRulesTraditionalDenyRuleDefaultMode = "disable"
+ WAFManagedRulesRuleWAFManagedRulesTraditionalDenyRuleDefaultModeSimulate WAFManagedRulesRuleWAFManagedRulesTraditionalDenyRuleDefaultMode = "simulate"
+ WAFManagedRulesRuleWAFManagedRulesTraditionalDenyRuleDefaultModeBlock WAFManagedRulesRuleWAFManagedRulesTraditionalDenyRuleDefaultMode = "block"
+ WAFManagedRulesRuleWAFManagedRulesTraditionalDenyRuleDefaultModeChallenge WAFManagedRulesRuleWAFManagedRulesTraditionalDenyRuleDefaultMode = "challenge"
+)
+
+// The rule group to which the current WAF rule belongs.
+type WAFManagedRulesRuleWAFManagedRulesTraditionalDenyRuleGroup struct {
+ // The unique identifier of the rule group.
+ ID string `json:"id"`
+ // The name of the rule group.
+ Name string `json:"name"`
+ JSON wafManagedRulesRuleWAFManagedRulesTraditionalDenyRuleGroupJSON `json:"-"`
+}
+
+// wafManagedRulesRuleWAFManagedRulesTraditionalDenyRuleGroupJSON contains the JSON
+// metadata for the struct
+// [WAFManagedRulesRuleWAFManagedRulesTraditionalDenyRuleGroup]
+type wafManagedRulesRuleWAFManagedRulesTraditionalDenyRuleGroupJSON struct {
+ ID apijson.Field
+ Name apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WAFManagedRulesRuleWAFManagedRulesTraditionalDenyRuleGroup) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r wafManagedRulesRuleWAFManagedRulesTraditionalDenyRuleGroupJSON) RawJSON() string {
+ return r.raw
+}
+
+// The action that the current WAF rule will perform when triggered. Applies to
+// traditional (deny) WAF rules.
+type WAFManagedRulesRuleWAFManagedRulesTraditionalDenyRuleMode string
+
+const (
+ WAFManagedRulesRuleWAFManagedRulesTraditionalDenyRuleModeDefault WAFManagedRulesRuleWAFManagedRulesTraditionalDenyRuleMode = "default"
+ WAFManagedRulesRuleWAFManagedRulesTraditionalDenyRuleModeDisable WAFManagedRulesRuleWAFManagedRulesTraditionalDenyRuleMode = "disable"
+ WAFManagedRulesRuleWAFManagedRulesTraditionalDenyRuleModeSimulate WAFManagedRulesRuleWAFManagedRulesTraditionalDenyRuleMode = "simulate"
+ WAFManagedRulesRuleWAFManagedRulesTraditionalDenyRuleModeBlock WAFManagedRulesRuleWAFManagedRulesTraditionalDenyRuleMode = "block"
+ WAFManagedRulesRuleWAFManagedRulesTraditionalDenyRuleModeChallenge WAFManagedRulesRuleWAFManagedRulesTraditionalDenyRuleMode = "challenge"
+)
+
+// When triggered, traditional WAF rules cause the firewall to immediately act on
+// the request based on the rule configuration. An 'allow' rule will immediately
+// allow the request and no other rules will be processed.
+type WAFManagedRulesRuleWAFManagedRulesTraditionalAllowRule struct {
+ // The unique identifier of the WAF rule.
+ ID string `json:"id,required"`
+ // Defines the available modes for the current WAF rule.
+ AllowedModes []WAFManagedRulesRuleWAFManagedRulesTraditionalAllowRuleAllowedMode `json:"allowed_modes,required"`
+ // The public description of the WAF rule.
+ Description string `json:"description,required"`
+ // The rule group to which the current WAF rule belongs.
+ Group WAFManagedRulesRuleWAFManagedRulesTraditionalAllowRuleGroup `json:"group,required"`
+ // When set to `on`, the current rule will be used when evaluating the request.
+ // Applies to traditional (allow) WAF rules.
+ Mode WAFManagedRulesRuleWAFManagedRulesTraditionalAllowRuleMode `json:"mode,required"`
+ // The unique identifier of a WAF package.
+ PackageID string `json:"package_id,required"`
+ // The order in which the individual WAF rule is executed within its rule group.
+ Priority string `json:"priority,required"`
+ JSON wafManagedRulesRuleWAFManagedRulesTraditionalAllowRuleJSON `json:"-"`
+}
+
+// wafManagedRulesRuleWAFManagedRulesTraditionalAllowRuleJSON contains the JSON
+// metadata for the struct [WAFManagedRulesRuleWAFManagedRulesTraditionalAllowRule]
+type wafManagedRulesRuleWAFManagedRulesTraditionalAllowRuleJSON struct {
+ ID apijson.Field
+ AllowedModes apijson.Field
+ Description apijson.Field
+ Group apijson.Field
+ Mode apijson.Field
+ PackageID apijson.Field
+ Priority apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WAFManagedRulesRuleWAFManagedRulesTraditionalAllowRule) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r wafManagedRulesRuleWAFManagedRulesTraditionalAllowRuleJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r WAFManagedRulesRuleWAFManagedRulesTraditionalAllowRule) implementsFirewallWAFManagedRulesRule() {
+}
+
+// When set to `on`, the current rule will be used when evaluating the request.
+// Applies to traditional (allow) WAF rules.
+type WAFManagedRulesRuleWAFManagedRulesTraditionalAllowRuleAllowedMode string
+
+const (
+ WAFManagedRulesRuleWAFManagedRulesTraditionalAllowRuleAllowedModeOn WAFManagedRulesRuleWAFManagedRulesTraditionalAllowRuleAllowedMode = "on"
+ WAFManagedRulesRuleWAFManagedRulesTraditionalAllowRuleAllowedModeOff WAFManagedRulesRuleWAFManagedRulesTraditionalAllowRuleAllowedMode = "off"
+)
+
+// The rule group to which the current WAF rule belongs.
+type WAFManagedRulesRuleWAFManagedRulesTraditionalAllowRuleGroup struct {
+ // The unique identifier of the rule group.
+ ID string `json:"id"`
+ // The name of the rule group.
+ Name string `json:"name"`
+ JSON wafManagedRulesRuleWAFManagedRulesTraditionalAllowRuleGroupJSON `json:"-"`
+}
+
+// wafManagedRulesRuleWAFManagedRulesTraditionalAllowRuleGroupJSON contains the
+// JSON metadata for the struct
+// [WAFManagedRulesRuleWAFManagedRulesTraditionalAllowRuleGroup]
+type wafManagedRulesRuleWAFManagedRulesTraditionalAllowRuleGroupJSON struct {
+ ID apijson.Field
+ Name apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WAFManagedRulesRuleWAFManagedRulesTraditionalAllowRuleGroup) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r wafManagedRulesRuleWAFManagedRulesTraditionalAllowRuleGroupJSON) RawJSON() string {
+ return r.raw
+}
+
+// When set to `on`, the current rule will be used when evaluating the request.
+// Applies to traditional (allow) WAF rules.
+type WAFManagedRulesRuleWAFManagedRulesTraditionalAllowRuleMode string
+
+const (
+ WAFManagedRulesRuleWAFManagedRulesTraditionalAllowRuleModeOn WAFManagedRulesRuleWAFManagedRulesTraditionalAllowRuleMode = "on"
+ WAFManagedRulesRuleWAFManagedRulesTraditionalAllowRuleModeOff WAFManagedRulesRuleWAFManagedRulesTraditionalAllowRuleMode = "off"
+)
+
+// When triggered, anomaly detection WAF rules contribute to an overall threat
+// score that will determine if a request is considered malicious. You can
+// configure the total scoring threshold through the 'sensitivity' property of the
+// WAF package.
+//
+// Union satisfied by
+// [firewall.WAFPackageRuleEditResponseWAFManagedRulesAnomalyRule],
+// [firewall.WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRule] or
+// [firewall.WAFPackageRuleEditResponseWAFManagedRulesTraditionalAllowRule].
+type WAFPackageRuleEditResponse interface {
+ implementsFirewallWAFPackageRuleEditResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*WAFPackageRuleEditResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(WAFPackageRuleEditResponseWAFManagedRulesAnomalyRule{}),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRule{}),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(WAFPackageRuleEditResponseWAFManagedRulesTraditionalAllowRule{}),
+ },
+ )
+}
+
+// When triggered, anomaly detection WAF rules contribute to an overall threat
+// score that will determine if a request is considered malicious. You can
+// configure the total scoring threshold through the 'sensitivity' property of the
+// WAF package.
+type WAFPackageRuleEditResponseWAFManagedRulesAnomalyRule struct {
+ // The unique identifier of the WAF rule.
+ ID string `json:"id,required"`
+ // Defines the available modes for the current WAF rule. Applies to anomaly
+ // detection WAF rules.
+ AllowedModes []WAFPackageRuleEditResponseWAFManagedRulesAnomalyRuleAllowedMode `json:"allowed_modes,required"`
+ // The public description of the WAF rule.
+ Description string `json:"description,required"`
+ // The rule group to which the current WAF rule belongs.
+ Group WAFPackageRuleEditResponseWAFManagedRulesAnomalyRuleGroup `json:"group,required"`
+ // When set to `on`, the current WAF rule will be used when evaluating the request.
+ // Applies to anomaly detection WAF rules.
+ Mode WAFPackageRuleEditResponseWAFManagedRulesAnomalyRuleMode `json:"mode,required"`
+ // The unique identifier of a WAF package.
+ PackageID string `json:"package_id,required"`
+ // The order in which the individual WAF rule is executed within its rule group.
+ Priority string `json:"priority,required"`
+ JSON wafPackageRuleEditResponseWAFManagedRulesAnomalyRuleJSON `json:"-"`
+}
+
+// wafPackageRuleEditResponseWAFManagedRulesAnomalyRuleJSON contains the JSON
+// metadata for the struct [WAFPackageRuleEditResponseWAFManagedRulesAnomalyRule]
+type wafPackageRuleEditResponseWAFManagedRulesAnomalyRuleJSON struct {
+ ID apijson.Field
+ AllowedModes apijson.Field
+ Description apijson.Field
+ Group apijson.Field
+ Mode apijson.Field
+ PackageID apijson.Field
+ Priority apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WAFPackageRuleEditResponseWAFManagedRulesAnomalyRule) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r wafPackageRuleEditResponseWAFManagedRulesAnomalyRuleJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r WAFPackageRuleEditResponseWAFManagedRulesAnomalyRule) implementsFirewallWAFPackageRuleEditResponse() {
+}
+
+// When set to `on`, the current WAF rule will be used when evaluating the request.
+// Applies to anomaly detection WAF rules.
+type WAFPackageRuleEditResponseWAFManagedRulesAnomalyRuleAllowedMode string
+
+const (
+ WAFPackageRuleEditResponseWAFManagedRulesAnomalyRuleAllowedModeOn WAFPackageRuleEditResponseWAFManagedRulesAnomalyRuleAllowedMode = "on"
+ WAFPackageRuleEditResponseWAFManagedRulesAnomalyRuleAllowedModeOff WAFPackageRuleEditResponseWAFManagedRulesAnomalyRuleAllowedMode = "off"
+)
+
+// The rule group to which the current WAF rule belongs.
+type WAFPackageRuleEditResponseWAFManagedRulesAnomalyRuleGroup struct {
+ // The unique identifier of the rule group.
+ ID string `json:"id"`
+ // The name of the rule group.
+ Name string `json:"name"`
+ JSON wafPackageRuleEditResponseWAFManagedRulesAnomalyRuleGroupJSON `json:"-"`
+}
+
+// wafPackageRuleEditResponseWAFManagedRulesAnomalyRuleGroupJSON contains the JSON
+// metadata for the struct
+// [WAFPackageRuleEditResponseWAFManagedRulesAnomalyRuleGroup]
+type wafPackageRuleEditResponseWAFManagedRulesAnomalyRuleGroupJSON struct {
+ ID apijson.Field
+ Name apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WAFPackageRuleEditResponseWAFManagedRulesAnomalyRuleGroup) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r wafPackageRuleEditResponseWAFManagedRulesAnomalyRuleGroupJSON) RawJSON() string {
+ return r.raw
+}
+
+// When set to `on`, the current WAF rule will be used when evaluating the request.
+// Applies to anomaly detection WAF rules.
+type WAFPackageRuleEditResponseWAFManagedRulesAnomalyRuleMode string
+
+const (
+ WAFPackageRuleEditResponseWAFManagedRulesAnomalyRuleModeOn WAFPackageRuleEditResponseWAFManagedRulesAnomalyRuleMode = "on"
+ WAFPackageRuleEditResponseWAFManagedRulesAnomalyRuleModeOff WAFPackageRuleEditResponseWAFManagedRulesAnomalyRuleMode = "off"
+)
+
+// When triggered, traditional WAF rules cause the firewall to immediately act upon
+// the request based on the configuration of the rule. A 'deny' rule will
+// immediately respond to the request based on the configured rule action/mode (for
+// example, 'block') and no other rules will be processed.
+type WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRule struct {
+ // The unique identifier of the WAF rule.
+ ID string `json:"id,required"`
+ // The list of possible actions of the WAF rule when it is triggered.
+ AllowedModes []WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleAllowedMode `json:"allowed_modes,required"`
+ // The default action/mode of a rule.
+ DefaultMode WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleDefaultMode `json:"default_mode,required"`
+ // The public description of the WAF rule.
+ Description string `json:"description,required"`
+ // The rule group to which the current WAF rule belongs.
+ Group WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleGroup `json:"group,required"`
+ // The action that the current WAF rule will perform when triggered. Applies to
+ // traditional (deny) WAF rules.
+ Mode WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleMode `json:"mode,required"`
+ // The unique identifier of a WAF package.
+ PackageID string `json:"package_id,required"`
+ // The order in which the individual WAF rule is executed within its rule group.
+ Priority string `json:"priority,required"`
+ JSON wafPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleJSON `json:"-"`
+}
+
+// wafPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleJSON contains the
+// JSON metadata for the struct
+// [WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRule]
+type wafPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleJSON struct {
+ ID apijson.Field
+ AllowedModes apijson.Field
+ DefaultMode apijson.Field
+ Description apijson.Field
+ Group apijson.Field
+ Mode apijson.Field
+ PackageID apijson.Field
+ Priority apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRule) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r wafPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRule) implementsFirewallWAFPackageRuleEditResponse() {
+}
+
+// The action that the current WAF rule will perform when triggered. Applies to
+// traditional (deny) WAF rules.
+type WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleAllowedMode string
+
+const (
+ WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleAllowedModeDefault WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleAllowedMode = "default"
+ WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleAllowedModeDisable WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleAllowedMode = "disable"
+ WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleAllowedModeSimulate WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleAllowedMode = "simulate"
+ WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleAllowedModeBlock WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleAllowedMode = "block"
+ WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleAllowedModeChallenge WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleAllowedMode = "challenge"
+)
+
+// The default action/mode of a rule.
+type WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleDefaultMode string
+
+const (
+ WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleDefaultModeDisable WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleDefaultMode = "disable"
+ WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleDefaultModeSimulate WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleDefaultMode = "simulate"
+ WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleDefaultModeBlock WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleDefaultMode = "block"
+ WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleDefaultModeChallenge WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleDefaultMode = "challenge"
+)
+
+// The rule group to which the current WAF rule belongs.
+type WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleGroup struct {
+ // The unique identifier of the rule group.
+ ID string `json:"id"`
+ // The name of the rule group.
+ Name string `json:"name"`
+ JSON wafPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleGroupJSON `json:"-"`
+}
+
+// wafPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleGroupJSON contains
+// the JSON metadata for the struct
+// [WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleGroup]
+type wafPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleGroupJSON struct {
+ ID apijson.Field
+ Name apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleGroup) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r wafPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleGroupJSON) RawJSON() string {
+ return r.raw
+}
+
+// The action that the current WAF rule will perform when triggered. Applies to
+// traditional (deny) WAF rules.
+type WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleMode string
+
+const (
+ WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleModeDefault WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleMode = "default"
+ WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleModeDisable WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleMode = "disable"
+ WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleModeSimulate WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleMode = "simulate"
+ WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleModeBlock WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleMode = "block"
+ WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleModeChallenge WAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleMode = "challenge"
+)
+
+// When triggered, traditional WAF rules cause the firewall to immediately act on
+// the request based on the rule configuration. An 'allow' rule will immediately
+// allow the request and no other rules will be processed.
+type WAFPackageRuleEditResponseWAFManagedRulesTraditionalAllowRule struct {
+ // The unique identifier of the WAF rule.
+ ID string `json:"id,required"`
+ // Defines the available modes for the current WAF rule.
+ AllowedModes []WAFPackageRuleEditResponseWAFManagedRulesTraditionalAllowRuleAllowedMode `json:"allowed_modes,required"`
+ // The public description of the WAF rule.
+ Description string `json:"description,required"`
+ // The rule group to which the current WAF rule belongs.
+ Group WAFPackageRuleEditResponseWAFManagedRulesTraditionalAllowRuleGroup `json:"group,required"`
+ // When set to `on`, the current rule will be used when evaluating the request.
+ // Applies to traditional (allow) WAF rules.
+ Mode WAFPackageRuleEditResponseWAFManagedRulesTraditionalAllowRuleMode `json:"mode,required"`
+ // The unique identifier of a WAF package.
+ PackageID string `json:"package_id,required"`
+ // The order in which the individual WAF rule is executed within its rule group.
+ Priority string `json:"priority,required"`
+ JSON wafPackageRuleEditResponseWAFManagedRulesTraditionalAllowRuleJSON `json:"-"`
+}
+
+// wafPackageRuleEditResponseWAFManagedRulesTraditionalAllowRuleJSON contains the
+// JSON metadata for the struct
+// [WAFPackageRuleEditResponseWAFManagedRulesTraditionalAllowRule]
+type wafPackageRuleEditResponseWAFManagedRulesTraditionalAllowRuleJSON struct {
+ ID apijson.Field
+ AllowedModes apijson.Field
+ Description apijson.Field
+ Group apijson.Field
+ Mode apijson.Field
+ PackageID apijson.Field
+ Priority apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WAFPackageRuleEditResponseWAFManagedRulesTraditionalAllowRule) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r wafPackageRuleEditResponseWAFManagedRulesTraditionalAllowRuleJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r WAFPackageRuleEditResponseWAFManagedRulesTraditionalAllowRule) implementsFirewallWAFPackageRuleEditResponse() {
+}
+
+// When set to `on`, the current rule will be used when evaluating the request.
+// Applies to traditional (allow) WAF rules.
+type WAFPackageRuleEditResponseWAFManagedRulesTraditionalAllowRuleAllowedMode string
+
+const (
+ WAFPackageRuleEditResponseWAFManagedRulesTraditionalAllowRuleAllowedModeOn WAFPackageRuleEditResponseWAFManagedRulesTraditionalAllowRuleAllowedMode = "on"
+ WAFPackageRuleEditResponseWAFManagedRulesTraditionalAllowRuleAllowedModeOff WAFPackageRuleEditResponseWAFManagedRulesTraditionalAllowRuleAllowedMode = "off"
+)
+
+// The rule group to which the current WAF rule belongs.
+type WAFPackageRuleEditResponseWAFManagedRulesTraditionalAllowRuleGroup struct {
+ // The unique identifier of the rule group.
+ ID string `json:"id"`
+ // The name of the rule group.
+ Name string `json:"name"`
+ JSON wafPackageRuleEditResponseWAFManagedRulesTraditionalAllowRuleGroupJSON `json:"-"`
+}
+
+// wafPackageRuleEditResponseWAFManagedRulesTraditionalAllowRuleGroupJSON contains
+// the JSON metadata for the struct
+// [WAFPackageRuleEditResponseWAFManagedRulesTraditionalAllowRuleGroup]
+type wafPackageRuleEditResponseWAFManagedRulesTraditionalAllowRuleGroupJSON struct {
+ ID apijson.Field
+ Name apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WAFPackageRuleEditResponseWAFManagedRulesTraditionalAllowRuleGroup) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r wafPackageRuleEditResponseWAFManagedRulesTraditionalAllowRuleGroupJSON) RawJSON() string {
+ return r.raw
+}
+
+// When set to `on`, the current rule will be used when evaluating the request.
+// Applies to traditional (allow) WAF rules.
+type WAFPackageRuleEditResponseWAFManagedRulesTraditionalAllowRuleMode string
+
+const (
+ WAFPackageRuleEditResponseWAFManagedRulesTraditionalAllowRuleModeOn WAFPackageRuleEditResponseWAFManagedRulesTraditionalAllowRuleMode = "on"
+ WAFPackageRuleEditResponseWAFManagedRulesTraditionalAllowRuleModeOff WAFPackageRuleEditResponseWAFManagedRulesTraditionalAllowRuleMode = "off"
+)
+
+// Union satisfied by [firewall.WAFPackageRuleGetResponseUnknown],
+// [firewall.WAFPackageRuleGetResponseArray] or [shared.UnionString].
+type WAFPackageRuleGetResponse interface {
+ ImplementsFirewallWAFPackageRuleGetResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*WAFPackageRuleGetResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(WAFPackageRuleGetResponseArray{}),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+type WAFPackageRuleGetResponseArray []interface{}
+
+func (r WAFPackageRuleGetResponseArray) ImplementsFirewallWAFPackageRuleGetResponse() {}
+
+type WAFPackageRuleListParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+ // The direction used to sort returned rules.
+ Direction param.Field[WAFPackageRuleListParamsDirection] `query:"direction"`
+ // When set to `all`, all the search requirements must match. When set to `any`,
+ // only one of the search requirements has to match.
+ Match param.Field[WAFPackageRuleListParamsMatch] `query:"match"`
+ // The action/mode a rule has been overridden to perform.
+ Mode param.Field[WAFPackageRuleListParamsMode] `query:"mode"`
+ // The field used to sort returned rules.
+ Order param.Field[WAFPackageRuleListParamsOrder] `query:"order"`
+ // The page number of paginated results.
+ Page param.Field[float64] `query:"page"`
+ // The number of rules per page.
+ PerPage param.Field[float64] `query:"per_page"`
+}
+
+// URLQuery serializes [WAFPackageRuleListParams]'s query parameters as
+// `url.Values`.
+func (r WAFPackageRuleListParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// The direction used to sort returned rules.
+type WAFPackageRuleListParamsDirection string
+
+const (
+ WAFPackageRuleListParamsDirectionAsc WAFPackageRuleListParamsDirection = "asc"
+ WAFPackageRuleListParamsDirectionDesc WAFPackageRuleListParamsDirection = "desc"
+)
+
+// When set to `all`, all the search requirements must match. When set to `any`,
+// only one of the search requirements has to match.
+type WAFPackageRuleListParamsMatch string
+
+const (
+ WAFPackageRuleListParamsMatchAny WAFPackageRuleListParamsMatch = "any"
+ WAFPackageRuleListParamsMatchAll WAFPackageRuleListParamsMatch = "all"
+)
+
+// The action/mode a rule has been overridden to perform.
+type WAFPackageRuleListParamsMode string
+
+const (
+ WAFPackageRuleListParamsModeDis WAFPackageRuleListParamsMode = "DIS"
+ WAFPackageRuleListParamsModeChl WAFPackageRuleListParamsMode = "CHL"
+ WAFPackageRuleListParamsModeBlk WAFPackageRuleListParamsMode = "BLK"
+ WAFPackageRuleListParamsModeSim WAFPackageRuleListParamsMode = "SIM"
+)
+
+// The field used to sort returned rules.
+type WAFPackageRuleListParamsOrder string
+
+const (
+ WAFPackageRuleListParamsOrderPriority WAFPackageRuleListParamsOrder = "priority"
+ WAFPackageRuleListParamsOrderGroupID WAFPackageRuleListParamsOrder = "group_id"
+ WAFPackageRuleListParamsOrderDescription WAFPackageRuleListParamsOrder = "description"
+)
+
+type WAFPackageRuleEditParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+ // The mode/action of the rule when triggered. You must use a value from the
+ // `allowed_modes` array of the current rule.
+ Mode param.Field[WAFPackageRuleEditParamsMode] `json:"mode"`
+}
+
+func (r WAFPackageRuleEditParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The mode/action of the rule when triggered. You must use a value from the
+// `allowed_modes` array of the current rule.
+type WAFPackageRuleEditParamsMode string
+
+const (
+ WAFPackageRuleEditParamsModeDefault WAFPackageRuleEditParamsMode = "default"
+ WAFPackageRuleEditParamsModeDisable WAFPackageRuleEditParamsMode = "disable"
+ WAFPackageRuleEditParamsModeSimulate WAFPackageRuleEditParamsMode = "simulate"
+ WAFPackageRuleEditParamsModeBlock WAFPackageRuleEditParamsMode = "block"
+ WAFPackageRuleEditParamsModeChallenge WAFPackageRuleEditParamsMode = "challenge"
+ WAFPackageRuleEditParamsModeOn WAFPackageRuleEditParamsMode = "on"
+ WAFPackageRuleEditParamsModeOff WAFPackageRuleEditParamsMode = "off"
+)
+
+type WAFPackageRuleEditResponseEnvelope struct {
+ Errors []WAFPackageRuleEditResponseEnvelopeErrors `json:"errors,required"`
+ Messages []WAFPackageRuleEditResponseEnvelopeMessages `json:"messages,required"`
+ // When triggered, anomaly detection WAF rules contribute to an overall threat
+ // score that will determine if a request is considered malicious. You can
+ // configure the total scoring threshold through the 'sensitivity' property of the
+ // WAF package.
+ Result WAFPackageRuleEditResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success WAFPackageRuleEditResponseEnvelopeSuccess `json:"success,required"`
+ JSON wafPackageRuleEditResponseEnvelopeJSON `json:"-"`
+}
+
+// wafPackageRuleEditResponseEnvelopeJSON contains the JSON metadata for the struct
+// [WAFPackageRuleEditResponseEnvelope]
+type wafPackageRuleEditResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WAFPackageRuleEditResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r wafPackageRuleEditResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type WAFPackageRuleEditResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON wafPackageRuleEditResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// wafPackageRuleEditResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [WAFPackageRuleEditResponseEnvelopeErrors]
+type wafPackageRuleEditResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WAFPackageRuleEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r wafPackageRuleEditResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type WAFPackageRuleEditResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON wafPackageRuleEditResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// wafPackageRuleEditResponseEnvelopeMessagesJSON contains the JSON metadata for
+// the struct [WAFPackageRuleEditResponseEnvelopeMessages]
+type wafPackageRuleEditResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WAFPackageRuleEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r wafPackageRuleEditResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type WAFPackageRuleEditResponseEnvelopeSuccess bool
+
+const (
+ WAFPackageRuleEditResponseEnvelopeSuccessTrue WAFPackageRuleEditResponseEnvelopeSuccess = true
+)
+
+type WAFPackageRuleGetParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+}
+
+type WAFPackageRuleGetResponseEnvelope struct {
+ Errors []WAFPackageRuleGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []WAFPackageRuleGetResponseEnvelopeMessages `json:"messages,required"`
+ Result WAFPackageRuleGetResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success WAFPackageRuleGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON wafPackageRuleGetResponseEnvelopeJSON `json:"-"`
+}
+
+// wafPackageRuleGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [WAFPackageRuleGetResponseEnvelope]
+type wafPackageRuleGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WAFPackageRuleGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r wafPackageRuleGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type WAFPackageRuleGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON wafPackageRuleGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// wafPackageRuleGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [WAFPackageRuleGetResponseEnvelopeErrors]
+type wafPackageRuleGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WAFPackageRuleGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r wafPackageRuleGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type WAFPackageRuleGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON wafPackageRuleGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// wafPackageRuleGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [WAFPackageRuleGetResponseEnvelopeMessages]
+type wafPackageRuleGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WAFPackageRuleGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r wafPackageRuleGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type WAFPackageRuleGetResponseEnvelopeSuccess bool
+
+const (
+ WAFPackageRuleGetResponseEnvelopeSuccessTrue WAFPackageRuleGetResponseEnvelopeSuccess = true
+)
diff --git a/firewall/wafpackagerule_test.go b/firewall/wafpackagerule_test.go
new file mode 100644
index 00000000000..64577e3b446
--- /dev/null
+++ b/firewall/wafpackagerule_test.go
@@ -0,0 +1,114 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package firewall_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/firewall"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestWAFPackageRuleListWithOptionalParams(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"),
+ )
+ _, err := client.Firewall.WAF.Packages.Rules.List(
+ context.TODO(),
+ "a25a9a7e9c00afc1fb2e0245519d725b",
+ firewall.WAFPackageRuleListParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Direction: cloudflare.F(firewall.WAFPackageRuleListParamsDirectionDesc),
+ Match: cloudflare.F(firewall.WAFPackageRuleListParamsMatchAny),
+ Mode: cloudflare.F(firewall.WAFPackageRuleListParamsModeChl),
+ Order: cloudflare.F(firewall.WAFPackageRuleListParamsOrderPriority),
+ Page: cloudflare.F(1.000000),
+ PerPage: cloudflare.F(5.000000),
+ },
+ )
+ 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())
+ }
+}
+
+func TestWAFPackageRuleEditWithOptionalParams(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"),
+ )
+ _, err := client.Firewall.WAF.Packages.Rules.Edit(
+ context.TODO(),
+ "a25a9a7e9c00afc1fb2e0245519d725b",
+ "a25a9a7e9c00afc1fb2e0245519d725b",
+ firewall.WAFPackageRuleEditParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Mode: cloudflare.F(firewall.WAFPackageRuleEditParamsModeOn),
+ },
+ )
+ 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())
+ }
+}
+
+func TestWAFPackageRuleGet(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"),
+ )
+ _, err := client.Firewall.WAF.Packages.Rules.Get(
+ context.TODO(),
+ "a25a9a7e9c00afc1fb2e0245519d725b",
+ "a25a9a7e9c00afc1fb2e0245519d725b",
+ firewall.WAFPackageRuleGetParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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/firewallaccessrule.go b/firewallaccessrule.go
deleted file mode 100644
index bee1241d101..00000000000
--- a/firewallaccessrule.go
+++ /dev/null
@@ -1,1028 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
- "reflect"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/option"
- "github.com/tidwall/gjson"
-)
-
-// FirewallAccessRuleService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewFirewallAccessRuleService] method
-// instead.
-type FirewallAccessRuleService struct {
- Options []option.RequestOption
-}
-
-// NewFirewallAccessRuleService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewFirewallAccessRuleService(opts ...option.RequestOption) (r *FirewallAccessRuleService) {
- r = &FirewallAccessRuleService{}
- r.Options = opts
- return
-}
-
-// Creates a new IP Access rule for an account or zone. The rule will apply to all
-// zones in the account or zone.
-//
-// Note: To create an IP Access rule that applies to a single zone, refer to the
-// [IP Access rules for a zone](#ip-access-rules-for-a-zone) endpoints.
-func (r *FirewallAccessRuleService) New(ctx context.Context, params FirewallAccessRuleNewParams, opts ...option.RequestOption) (res *FirewallAccessRuleNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env FirewallAccessRuleNewResponseEnvelope
- var accountOrZone string
- var accountOrZoneID param.Field[string]
- if params.AccountID.Present {
- accountOrZone = "accounts"
- accountOrZoneID = params.AccountID
- } else {
- accountOrZone = "zones"
- accountOrZoneID = params.ZoneID
- }
- path := fmt.Sprintf("%s/%s/firewall/access_rules/rules", accountOrZone, accountOrZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Fetches IP Access rules of an account or zone. These rules apply to all the
-// zones in the account or zone. You can filter the results using several optional
-// parameters.
-func (r *FirewallAccessRuleService) List(ctx context.Context, params FirewallAccessRuleListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[FirewallAccessRuleListResponse], err error) {
- var raw *http.Response
- opts = append(r.Options, opts...)
- opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
- var accountOrZone string
- var accountOrZoneID param.Field[string]
- if params.AccountID.Present {
- accountOrZone = "accounts"
- accountOrZoneID = params.AccountID
- } else {
- accountOrZone = "zones"
- accountOrZoneID = params.ZoneID
- }
- path := fmt.Sprintf("%s/%s/firewall/access_rules/rules", accountOrZone, accountOrZoneID)
- cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, params, &res, opts...)
- if err != nil {
- return nil, err
- }
- err = cfg.Execute()
- if err != nil {
- return nil, err
- }
- res.SetPageConfig(cfg, raw)
- return res, nil
-}
-
-// Fetches IP Access rules of an account or zone. These rules apply to all the
-// zones in the account or zone. You can filter the results using several optional
-// parameters.
-func (r *FirewallAccessRuleService) ListAutoPaging(ctx context.Context, params FirewallAccessRuleListParams, opts ...option.RequestOption) *shared.V4PagePaginationArrayAutoPager[FirewallAccessRuleListResponse] {
- return shared.NewV4PagePaginationArrayAutoPager(r.List(ctx, params, opts...))
-}
-
-// Deletes an existing IP Access rule defined.
-//
-// Note: This operation will affect all zones in the account or zone.
-func (r *FirewallAccessRuleService) Delete(ctx context.Context, identifier interface{}, body FirewallAccessRuleDeleteParams, opts ...option.RequestOption) (res *FirewallAccessRuleDeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env FirewallAccessRuleDeleteResponseEnvelope
- var accountOrZone string
- var accountOrZoneID param.Field[string]
- if body.AccountID.Present {
- accountOrZone = "accounts"
- accountOrZoneID = body.AccountID
- } else {
- accountOrZone = "zones"
- accountOrZoneID = body.ZoneID
- }
- path := fmt.Sprintf("%s/%s/firewall/access_rules/rules/%v", accountOrZone, accountOrZoneID, identifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Updates an IP Access rule defined at the account level.
-//
-// Note: This operation will affect all zones in the account.
-func (r *FirewallAccessRuleService) Edit(ctx context.Context, identifier interface{}, params FirewallAccessRuleEditParams, opts ...option.RequestOption) (res *FirewallAccessRuleEditResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env FirewallAccessRuleEditResponseEnvelope
- var accountOrZone string
- var accountOrZoneID param.Field[string]
- if params.AccountID.Present {
- accountOrZone = "accounts"
- accountOrZoneID = params.AccountID
- } else {
- accountOrZone = "zones"
- accountOrZoneID = params.ZoneID
- }
- path := fmt.Sprintf("%s/%s/firewall/access_rules/rules/%v", accountOrZone, accountOrZoneID, identifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Fetches the details of an IP Access rule defined.
-func (r *FirewallAccessRuleService) Get(ctx context.Context, identifier interface{}, query FirewallAccessRuleGetParams, opts ...option.RequestOption) (res *FirewallAccessRuleGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env FirewallAccessRuleGetResponseEnvelope
- var accountOrZone string
- var accountOrZoneID param.Field[string]
- if query.AccountID.Present {
- accountOrZone = "accounts"
- accountOrZoneID = query.AccountID
- } else {
- accountOrZone = "zones"
- accountOrZoneID = query.ZoneID
- }
- path := fmt.Sprintf("%s/%s/firewall/access_rules/rules/%v", accountOrZone, accountOrZoneID, identifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Union satisfied by [FirewallAccessRuleNewResponseUnknown] or
-// [shared.UnionString].
-type FirewallAccessRuleNewResponse interface {
- ImplementsFirewallAccessRuleNewResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*FirewallAccessRuleNewResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-type FirewallAccessRuleListResponse = interface{}
-
-type FirewallAccessRuleDeleteResponse struct {
- // Identifier
- ID string `json:"id,required"`
- JSON firewallAccessRuleDeleteResponseJSON `json:"-"`
-}
-
-// firewallAccessRuleDeleteResponseJSON contains the JSON metadata for the struct
-// [FirewallAccessRuleDeleteResponse]
-type firewallAccessRuleDeleteResponseJSON struct {
- ID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallAccessRuleDeleteResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallAccessRuleDeleteResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// Union satisfied by [FirewallAccessRuleEditResponseUnknown] or
-// [shared.UnionString].
-type FirewallAccessRuleEditResponse interface {
- ImplementsFirewallAccessRuleEditResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*FirewallAccessRuleEditResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-// Union satisfied by [FirewallAccessRuleGetResponseUnknown] or
-// [shared.UnionString].
-type FirewallAccessRuleGetResponse interface {
- ImplementsFirewallAccessRuleGetResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*FirewallAccessRuleGetResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-type FirewallAccessRuleNewParams struct {
- // The rule configuration.
- Configuration param.Field[FirewallAccessRuleNewParamsConfiguration] `json:"configuration,required"`
- // The action to apply to a matched request.
- Mode param.Field[FirewallAccessRuleNewParamsMode] `json:"mode,required"`
- // The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
- AccountID param.Field[string] `path:"account_id"`
- // The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- ZoneID param.Field[string] `path:"zone_id"`
- // An informative summary of the rule, typically used as a reminder or explanation.
- Notes param.Field[string] `json:"notes"`
-}
-
-func (r FirewallAccessRuleNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The rule configuration.
-//
-// Satisfied by [FirewallAccessRuleNewParamsConfigurationLegacyJhsIPConfiguration],
-// [FirewallAccessRuleNewParamsConfigurationLegacyJhsIPV6Configuration],
-// [FirewallAccessRuleNewParamsConfigurationLegacyJhsCidrConfiguration],
-// [FirewallAccessRuleNewParamsConfigurationLegacyJhsASNConfiguration],
-// [FirewallAccessRuleNewParamsConfigurationLegacyJhsCountryConfiguration].
-type FirewallAccessRuleNewParamsConfiguration interface {
- implementsFirewallAccessRuleNewParamsConfiguration()
-}
-
-type FirewallAccessRuleNewParamsConfigurationLegacyJhsIPConfiguration struct {
- // The configuration target. You must set the target to `ip` when specifying an IP
- // address in the rule.
- Target param.Field[FirewallAccessRuleNewParamsConfigurationLegacyJhsIPConfigurationTarget] `json:"target"`
- // The IP address to match. This address will be compared to the IP address of
- // incoming requests.
- Value param.Field[string] `json:"value"`
-}
-
-func (r FirewallAccessRuleNewParamsConfigurationLegacyJhsIPConfiguration) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-func (r FirewallAccessRuleNewParamsConfigurationLegacyJhsIPConfiguration) implementsFirewallAccessRuleNewParamsConfiguration() {
-}
-
-// The configuration target. You must set the target to `ip` when specifying an IP
-// address in the rule.
-type FirewallAccessRuleNewParamsConfigurationLegacyJhsIPConfigurationTarget string
-
-const (
- FirewallAccessRuleNewParamsConfigurationLegacyJhsIPConfigurationTargetIP FirewallAccessRuleNewParamsConfigurationLegacyJhsIPConfigurationTarget = "ip"
-)
-
-type FirewallAccessRuleNewParamsConfigurationLegacyJhsIPV6Configuration struct {
- // The configuration target. You must set the target to `ip6` when specifying an
- // IPv6 address in the rule.
- Target param.Field[FirewallAccessRuleNewParamsConfigurationLegacyJhsIPV6ConfigurationTarget] `json:"target"`
- // The IPv6 address to match.
- Value param.Field[string] `json:"value"`
-}
-
-func (r FirewallAccessRuleNewParamsConfigurationLegacyJhsIPV6Configuration) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-func (r FirewallAccessRuleNewParamsConfigurationLegacyJhsIPV6Configuration) implementsFirewallAccessRuleNewParamsConfiguration() {
-}
-
-// The configuration target. You must set the target to `ip6` when specifying an
-// IPv6 address in the rule.
-type FirewallAccessRuleNewParamsConfigurationLegacyJhsIPV6ConfigurationTarget string
-
-const (
- FirewallAccessRuleNewParamsConfigurationLegacyJhsIPV6ConfigurationTargetIp6 FirewallAccessRuleNewParamsConfigurationLegacyJhsIPV6ConfigurationTarget = "ip6"
-)
-
-type FirewallAccessRuleNewParamsConfigurationLegacyJhsCidrConfiguration struct {
- // The configuration target. You must set the target to `ip_range` when specifying
- // an IP address range in the rule.
- Target param.Field[FirewallAccessRuleNewParamsConfigurationLegacyJhsCidrConfigurationTarget] `json:"target"`
- // The IP address range to match. You can only use prefix lengths `/16` and `/24`
- // for IPv4 ranges, and prefix lengths `/32`, `/48`, and `/64` for IPv6 ranges.
- Value param.Field[string] `json:"value"`
-}
-
-func (r FirewallAccessRuleNewParamsConfigurationLegacyJhsCidrConfiguration) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-func (r FirewallAccessRuleNewParamsConfigurationLegacyJhsCidrConfiguration) implementsFirewallAccessRuleNewParamsConfiguration() {
-}
-
-// The configuration target. You must set the target to `ip_range` when specifying
-// an IP address range in the rule.
-type FirewallAccessRuleNewParamsConfigurationLegacyJhsCidrConfigurationTarget string
-
-const (
- FirewallAccessRuleNewParamsConfigurationLegacyJhsCidrConfigurationTargetIPRange FirewallAccessRuleNewParamsConfigurationLegacyJhsCidrConfigurationTarget = "ip_range"
-)
-
-type FirewallAccessRuleNewParamsConfigurationLegacyJhsASNConfiguration struct {
- // The configuration target. You must set the target to `asn` when specifying an
- // Autonomous System Number (ASN) in the rule.
- Target param.Field[FirewallAccessRuleNewParamsConfigurationLegacyJhsASNConfigurationTarget] `json:"target"`
- // The AS number to match.
- Value param.Field[string] `json:"value"`
-}
-
-func (r FirewallAccessRuleNewParamsConfigurationLegacyJhsASNConfiguration) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-func (r FirewallAccessRuleNewParamsConfigurationLegacyJhsASNConfiguration) implementsFirewallAccessRuleNewParamsConfiguration() {
-}
-
-// The configuration target. You must set the target to `asn` when specifying an
-// Autonomous System Number (ASN) in the rule.
-type FirewallAccessRuleNewParamsConfigurationLegacyJhsASNConfigurationTarget string
-
-const (
- FirewallAccessRuleNewParamsConfigurationLegacyJhsASNConfigurationTargetASN FirewallAccessRuleNewParamsConfigurationLegacyJhsASNConfigurationTarget = "asn"
-)
-
-type FirewallAccessRuleNewParamsConfigurationLegacyJhsCountryConfiguration struct {
- // The configuration target. You must set the target to `country` when specifying a
- // country code in the rule.
- Target param.Field[FirewallAccessRuleNewParamsConfigurationLegacyJhsCountryConfigurationTarget] `json:"target"`
- // The two-letter ISO-3166-1 alpha-2 code to match. For more information, refer to
- // [IP Access rules: Parameters](https://developers.cloudflare.com/waf/tools/ip-access-rules/parameters/#country).
- Value param.Field[string] `json:"value"`
-}
-
-func (r FirewallAccessRuleNewParamsConfigurationLegacyJhsCountryConfiguration) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-func (r FirewallAccessRuleNewParamsConfigurationLegacyJhsCountryConfiguration) implementsFirewallAccessRuleNewParamsConfiguration() {
-}
-
-// The configuration target. You must set the target to `country` when specifying a
-// country code in the rule.
-type FirewallAccessRuleNewParamsConfigurationLegacyJhsCountryConfigurationTarget string
-
-const (
- FirewallAccessRuleNewParamsConfigurationLegacyJhsCountryConfigurationTargetCountry FirewallAccessRuleNewParamsConfigurationLegacyJhsCountryConfigurationTarget = "country"
-)
-
-// The action to apply to a matched request.
-type FirewallAccessRuleNewParamsMode string
-
-const (
- FirewallAccessRuleNewParamsModeBlock FirewallAccessRuleNewParamsMode = "block"
- FirewallAccessRuleNewParamsModeChallenge FirewallAccessRuleNewParamsMode = "challenge"
- FirewallAccessRuleNewParamsModeWhitelist FirewallAccessRuleNewParamsMode = "whitelist"
- FirewallAccessRuleNewParamsModeJsChallenge FirewallAccessRuleNewParamsMode = "js_challenge"
- FirewallAccessRuleNewParamsModeManagedChallenge FirewallAccessRuleNewParamsMode = "managed_challenge"
-)
-
-type FirewallAccessRuleNewResponseEnvelope struct {
- Errors []FirewallAccessRuleNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []FirewallAccessRuleNewResponseEnvelopeMessages `json:"messages,required"`
- Result FirewallAccessRuleNewResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success FirewallAccessRuleNewResponseEnvelopeSuccess `json:"success,required"`
- JSON firewallAccessRuleNewResponseEnvelopeJSON `json:"-"`
-}
-
-// firewallAccessRuleNewResponseEnvelopeJSON contains the JSON metadata for the
-// struct [FirewallAccessRuleNewResponseEnvelope]
-type firewallAccessRuleNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallAccessRuleNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallAccessRuleNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type FirewallAccessRuleNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON firewallAccessRuleNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// firewallAccessRuleNewResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [FirewallAccessRuleNewResponseEnvelopeErrors]
-type firewallAccessRuleNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallAccessRuleNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallAccessRuleNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type FirewallAccessRuleNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON firewallAccessRuleNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// firewallAccessRuleNewResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [FirewallAccessRuleNewResponseEnvelopeMessages]
-type firewallAccessRuleNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallAccessRuleNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallAccessRuleNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type FirewallAccessRuleNewResponseEnvelopeSuccess bool
-
-const (
- FirewallAccessRuleNewResponseEnvelopeSuccessTrue FirewallAccessRuleNewResponseEnvelopeSuccess = true
-)
-
-type FirewallAccessRuleListParams struct {
- // The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
- AccountID param.Field[string] `path:"account_id"`
- // The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- ZoneID param.Field[string] `path:"zone_id"`
- // The direction used to sort returned rules.
- Direction param.Field[FirewallAccessRuleListParamsDirection] `query:"direction"`
- EgsPagination param.Field[FirewallAccessRuleListParamsEgsPagination] `query:"egs-pagination"`
- Filters param.Field[FirewallAccessRuleListParamsFilters] `query:"filters"`
- // The field used to sort returned rules.
- Order param.Field[FirewallAccessRuleListParamsOrder] `query:"order"`
- // Requested page within paginated list of results.
- Page param.Field[float64] `query:"page"`
- // Maximum number of results requested.
- PerPage param.Field[float64] `query:"per_page"`
-}
-
-// URLQuery serializes [FirewallAccessRuleListParams]'s query parameters as
-// `url.Values`.
-func (r FirewallAccessRuleListParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// The direction used to sort returned rules.
-type FirewallAccessRuleListParamsDirection string
-
-const (
- FirewallAccessRuleListParamsDirectionAsc FirewallAccessRuleListParamsDirection = "asc"
- FirewallAccessRuleListParamsDirectionDesc FirewallAccessRuleListParamsDirection = "desc"
-)
-
-type FirewallAccessRuleListParamsEgsPagination struct {
- Json param.Field[FirewallAccessRuleListParamsEgsPaginationJson] `query:"json"`
-}
-
-// URLQuery serializes [FirewallAccessRuleListParamsEgsPagination]'s query
-// parameters as `url.Values`.
-func (r FirewallAccessRuleListParamsEgsPagination) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type FirewallAccessRuleListParamsEgsPaginationJson struct {
- // The page number of paginated results.
- Page param.Field[float64] `query:"page"`
- // The maximum number of results per page. You can only set the value to `1` or to
- // a multiple of 5 such as `5`, `10`, `15`, or `20`.
- PerPage param.Field[float64] `query:"per_page"`
-}
-
-// URLQuery serializes [FirewallAccessRuleListParamsEgsPaginationJson]'s query
-// parameters as `url.Values`.
-func (r FirewallAccessRuleListParamsEgsPaginationJson) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type FirewallAccessRuleListParamsFilters struct {
- // The target to search in existing rules.
- ConfigurationTarget param.Field[FirewallAccessRuleListParamsFiltersConfigurationTarget] `query:"configuration.target"`
- // The target value to search for in existing rules: an IP address, an IP address
- // range, or a country code, depending on the provided `configuration.target`.
- // Notes: You can search for a single IPv4 address, an IP address range with a
- // subnet of '/16' or '/24', or a two-letter ISO-3166-1 alpha-2 country code.
- ConfigurationValue param.Field[string] `query:"configuration.value"`
- // When set to `all`, all the search requirements must match. When set to `any`,
- // only one of the search requirements has to match.
- Match param.Field[FirewallAccessRuleListParamsFiltersMatch] `query:"match"`
- // The action to apply to a matched request.
- Mode param.Field[FirewallAccessRuleListParamsFiltersMode] `query:"mode"`
- // The string to search for in the notes of existing IP Access rules. Notes: For
- // example, the string 'attack' would match IP Access rules with notes 'Attack
- // 26/02' and 'Attack 27/02'. The search is case insensitive.
- Notes param.Field[string] `query:"notes"`
-}
-
-// URLQuery serializes [FirewallAccessRuleListParamsFilters]'s query parameters as
-// `url.Values`.
-func (r FirewallAccessRuleListParamsFilters) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// The target to search in existing rules.
-type FirewallAccessRuleListParamsFiltersConfigurationTarget string
-
-const (
- FirewallAccessRuleListParamsFiltersConfigurationTargetIP FirewallAccessRuleListParamsFiltersConfigurationTarget = "ip"
- FirewallAccessRuleListParamsFiltersConfigurationTargetIPRange FirewallAccessRuleListParamsFiltersConfigurationTarget = "ip_range"
- FirewallAccessRuleListParamsFiltersConfigurationTargetASN FirewallAccessRuleListParamsFiltersConfigurationTarget = "asn"
- FirewallAccessRuleListParamsFiltersConfigurationTargetCountry FirewallAccessRuleListParamsFiltersConfigurationTarget = "country"
-)
-
-// When set to `all`, all the search requirements must match. When set to `any`,
-// only one of the search requirements has to match.
-type FirewallAccessRuleListParamsFiltersMatch string
-
-const (
- FirewallAccessRuleListParamsFiltersMatchAny FirewallAccessRuleListParamsFiltersMatch = "any"
- FirewallAccessRuleListParamsFiltersMatchAll FirewallAccessRuleListParamsFiltersMatch = "all"
-)
-
-// The action to apply to a matched request.
-type FirewallAccessRuleListParamsFiltersMode string
-
-const (
- FirewallAccessRuleListParamsFiltersModeBlock FirewallAccessRuleListParamsFiltersMode = "block"
- FirewallAccessRuleListParamsFiltersModeChallenge FirewallAccessRuleListParamsFiltersMode = "challenge"
- FirewallAccessRuleListParamsFiltersModeWhitelist FirewallAccessRuleListParamsFiltersMode = "whitelist"
- FirewallAccessRuleListParamsFiltersModeJsChallenge FirewallAccessRuleListParamsFiltersMode = "js_challenge"
- FirewallAccessRuleListParamsFiltersModeManagedChallenge FirewallAccessRuleListParamsFiltersMode = "managed_challenge"
-)
-
-// The field used to sort returned rules.
-type FirewallAccessRuleListParamsOrder string
-
-const (
- FirewallAccessRuleListParamsOrderConfigurationTarget FirewallAccessRuleListParamsOrder = "configuration.target"
- FirewallAccessRuleListParamsOrderConfigurationValue FirewallAccessRuleListParamsOrder = "configuration.value"
- FirewallAccessRuleListParamsOrderMode FirewallAccessRuleListParamsOrder = "mode"
-)
-
-type FirewallAccessRuleDeleteParams struct {
- // The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
- AccountID param.Field[string] `path:"account_id"`
- // The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- ZoneID param.Field[string] `path:"zone_id"`
-}
-
-type FirewallAccessRuleDeleteResponseEnvelope struct {
- Errors []FirewallAccessRuleDeleteResponseEnvelopeErrors `json:"errors,required"`
- Messages []FirewallAccessRuleDeleteResponseEnvelopeMessages `json:"messages,required"`
- Result FirewallAccessRuleDeleteResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success FirewallAccessRuleDeleteResponseEnvelopeSuccess `json:"success,required"`
- JSON firewallAccessRuleDeleteResponseEnvelopeJSON `json:"-"`
-}
-
-// firewallAccessRuleDeleteResponseEnvelopeJSON contains the JSON metadata for the
-// struct [FirewallAccessRuleDeleteResponseEnvelope]
-type firewallAccessRuleDeleteResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallAccessRuleDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallAccessRuleDeleteResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type FirewallAccessRuleDeleteResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON firewallAccessRuleDeleteResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// firewallAccessRuleDeleteResponseEnvelopeErrorsJSON contains the JSON metadata
-// for the struct [FirewallAccessRuleDeleteResponseEnvelopeErrors]
-type firewallAccessRuleDeleteResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallAccessRuleDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallAccessRuleDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type FirewallAccessRuleDeleteResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON firewallAccessRuleDeleteResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// firewallAccessRuleDeleteResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [FirewallAccessRuleDeleteResponseEnvelopeMessages]
-type firewallAccessRuleDeleteResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallAccessRuleDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallAccessRuleDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type FirewallAccessRuleDeleteResponseEnvelopeSuccess bool
-
-const (
- FirewallAccessRuleDeleteResponseEnvelopeSuccessTrue FirewallAccessRuleDeleteResponseEnvelopeSuccess = true
-)
-
-type FirewallAccessRuleEditParams struct {
- // The rule configuration.
- Configuration param.Field[FirewallAccessRuleEditParamsConfiguration] `json:"configuration,required"`
- // The action to apply to a matched request.
- Mode param.Field[FirewallAccessRuleEditParamsMode] `json:"mode,required"`
- // The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
- AccountID param.Field[string] `path:"account_id"`
- // The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- ZoneID param.Field[string] `path:"zone_id"`
- // An informative summary of the rule, typically used as a reminder or explanation.
- Notes param.Field[string] `json:"notes"`
-}
-
-func (r FirewallAccessRuleEditParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The rule configuration.
-//
-// Satisfied by
-// [FirewallAccessRuleEditParamsConfigurationLegacyJhsIPConfiguration],
-// [FirewallAccessRuleEditParamsConfigurationLegacyJhsIPV6Configuration],
-// [FirewallAccessRuleEditParamsConfigurationLegacyJhsCidrConfiguration],
-// [FirewallAccessRuleEditParamsConfigurationLegacyJhsASNConfiguration],
-// [FirewallAccessRuleEditParamsConfigurationLegacyJhsCountryConfiguration].
-type FirewallAccessRuleEditParamsConfiguration interface {
- implementsFirewallAccessRuleEditParamsConfiguration()
-}
-
-type FirewallAccessRuleEditParamsConfigurationLegacyJhsIPConfiguration struct {
- // The configuration target. You must set the target to `ip` when specifying an IP
- // address in the rule.
- Target param.Field[FirewallAccessRuleEditParamsConfigurationLegacyJhsIPConfigurationTarget] `json:"target"`
- // The IP address to match. This address will be compared to the IP address of
- // incoming requests.
- Value param.Field[string] `json:"value"`
-}
-
-func (r FirewallAccessRuleEditParamsConfigurationLegacyJhsIPConfiguration) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-func (r FirewallAccessRuleEditParamsConfigurationLegacyJhsIPConfiguration) implementsFirewallAccessRuleEditParamsConfiguration() {
-}
-
-// The configuration target. You must set the target to `ip` when specifying an IP
-// address in the rule.
-type FirewallAccessRuleEditParamsConfigurationLegacyJhsIPConfigurationTarget string
-
-const (
- FirewallAccessRuleEditParamsConfigurationLegacyJhsIPConfigurationTargetIP FirewallAccessRuleEditParamsConfigurationLegacyJhsIPConfigurationTarget = "ip"
-)
-
-type FirewallAccessRuleEditParamsConfigurationLegacyJhsIPV6Configuration struct {
- // The configuration target. You must set the target to `ip6` when specifying an
- // IPv6 address in the rule.
- Target param.Field[FirewallAccessRuleEditParamsConfigurationLegacyJhsIPV6ConfigurationTarget] `json:"target"`
- // The IPv6 address to match.
- Value param.Field[string] `json:"value"`
-}
-
-func (r FirewallAccessRuleEditParamsConfigurationLegacyJhsIPV6Configuration) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-func (r FirewallAccessRuleEditParamsConfigurationLegacyJhsIPV6Configuration) implementsFirewallAccessRuleEditParamsConfiguration() {
-}
-
-// The configuration target. You must set the target to `ip6` when specifying an
-// IPv6 address in the rule.
-type FirewallAccessRuleEditParamsConfigurationLegacyJhsIPV6ConfigurationTarget string
-
-const (
- FirewallAccessRuleEditParamsConfigurationLegacyJhsIPV6ConfigurationTargetIp6 FirewallAccessRuleEditParamsConfigurationLegacyJhsIPV6ConfigurationTarget = "ip6"
-)
-
-type FirewallAccessRuleEditParamsConfigurationLegacyJhsCidrConfiguration struct {
- // The configuration target. You must set the target to `ip_range` when specifying
- // an IP address range in the rule.
- Target param.Field[FirewallAccessRuleEditParamsConfigurationLegacyJhsCidrConfigurationTarget] `json:"target"`
- // The IP address range to match. You can only use prefix lengths `/16` and `/24`
- // for IPv4 ranges, and prefix lengths `/32`, `/48`, and `/64` for IPv6 ranges.
- Value param.Field[string] `json:"value"`
-}
-
-func (r FirewallAccessRuleEditParamsConfigurationLegacyJhsCidrConfiguration) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-func (r FirewallAccessRuleEditParamsConfigurationLegacyJhsCidrConfiguration) implementsFirewallAccessRuleEditParamsConfiguration() {
-}
-
-// The configuration target. You must set the target to `ip_range` when specifying
-// an IP address range in the rule.
-type FirewallAccessRuleEditParamsConfigurationLegacyJhsCidrConfigurationTarget string
-
-const (
- FirewallAccessRuleEditParamsConfigurationLegacyJhsCidrConfigurationTargetIPRange FirewallAccessRuleEditParamsConfigurationLegacyJhsCidrConfigurationTarget = "ip_range"
-)
-
-type FirewallAccessRuleEditParamsConfigurationLegacyJhsASNConfiguration struct {
- // The configuration target. You must set the target to `asn` when specifying an
- // Autonomous System Number (ASN) in the rule.
- Target param.Field[FirewallAccessRuleEditParamsConfigurationLegacyJhsASNConfigurationTarget] `json:"target"`
- // The AS number to match.
- Value param.Field[string] `json:"value"`
-}
-
-func (r FirewallAccessRuleEditParamsConfigurationLegacyJhsASNConfiguration) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-func (r FirewallAccessRuleEditParamsConfigurationLegacyJhsASNConfiguration) implementsFirewallAccessRuleEditParamsConfiguration() {
-}
-
-// The configuration target. You must set the target to `asn` when specifying an
-// Autonomous System Number (ASN) in the rule.
-type FirewallAccessRuleEditParamsConfigurationLegacyJhsASNConfigurationTarget string
-
-const (
- FirewallAccessRuleEditParamsConfigurationLegacyJhsASNConfigurationTargetASN FirewallAccessRuleEditParamsConfigurationLegacyJhsASNConfigurationTarget = "asn"
-)
-
-type FirewallAccessRuleEditParamsConfigurationLegacyJhsCountryConfiguration struct {
- // The configuration target. You must set the target to `country` when specifying a
- // country code in the rule.
- Target param.Field[FirewallAccessRuleEditParamsConfigurationLegacyJhsCountryConfigurationTarget] `json:"target"`
- // The two-letter ISO-3166-1 alpha-2 code to match. For more information, refer to
- // [IP Access rules: Parameters](https://developers.cloudflare.com/waf/tools/ip-access-rules/parameters/#country).
- Value param.Field[string] `json:"value"`
-}
-
-func (r FirewallAccessRuleEditParamsConfigurationLegacyJhsCountryConfiguration) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-func (r FirewallAccessRuleEditParamsConfigurationLegacyJhsCountryConfiguration) implementsFirewallAccessRuleEditParamsConfiguration() {
-}
-
-// The configuration target. You must set the target to `country` when specifying a
-// country code in the rule.
-type FirewallAccessRuleEditParamsConfigurationLegacyJhsCountryConfigurationTarget string
-
-const (
- FirewallAccessRuleEditParamsConfigurationLegacyJhsCountryConfigurationTargetCountry FirewallAccessRuleEditParamsConfigurationLegacyJhsCountryConfigurationTarget = "country"
-)
-
-// The action to apply to a matched request.
-type FirewallAccessRuleEditParamsMode string
-
-const (
- FirewallAccessRuleEditParamsModeBlock FirewallAccessRuleEditParamsMode = "block"
- FirewallAccessRuleEditParamsModeChallenge FirewallAccessRuleEditParamsMode = "challenge"
- FirewallAccessRuleEditParamsModeWhitelist FirewallAccessRuleEditParamsMode = "whitelist"
- FirewallAccessRuleEditParamsModeJsChallenge FirewallAccessRuleEditParamsMode = "js_challenge"
- FirewallAccessRuleEditParamsModeManagedChallenge FirewallAccessRuleEditParamsMode = "managed_challenge"
-)
-
-type FirewallAccessRuleEditResponseEnvelope struct {
- Errors []FirewallAccessRuleEditResponseEnvelopeErrors `json:"errors,required"`
- Messages []FirewallAccessRuleEditResponseEnvelopeMessages `json:"messages,required"`
- Result FirewallAccessRuleEditResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success FirewallAccessRuleEditResponseEnvelopeSuccess `json:"success,required"`
- JSON firewallAccessRuleEditResponseEnvelopeJSON `json:"-"`
-}
-
-// firewallAccessRuleEditResponseEnvelopeJSON contains the JSON metadata for the
-// struct [FirewallAccessRuleEditResponseEnvelope]
-type firewallAccessRuleEditResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallAccessRuleEditResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallAccessRuleEditResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type FirewallAccessRuleEditResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON firewallAccessRuleEditResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// firewallAccessRuleEditResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [FirewallAccessRuleEditResponseEnvelopeErrors]
-type firewallAccessRuleEditResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallAccessRuleEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallAccessRuleEditResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type FirewallAccessRuleEditResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON firewallAccessRuleEditResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// firewallAccessRuleEditResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [FirewallAccessRuleEditResponseEnvelopeMessages]
-type firewallAccessRuleEditResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallAccessRuleEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallAccessRuleEditResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type FirewallAccessRuleEditResponseEnvelopeSuccess bool
-
-const (
- FirewallAccessRuleEditResponseEnvelopeSuccessTrue FirewallAccessRuleEditResponseEnvelopeSuccess = true
-)
-
-type FirewallAccessRuleGetParams struct {
- // The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
- AccountID param.Field[string] `path:"account_id"`
- // The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- ZoneID param.Field[string] `path:"zone_id"`
-}
-
-type FirewallAccessRuleGetResponseEnvelope struct {
- Errors []FirewallAccessRuleGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []FirewallAccessRuleGetResponseEnvelopeMessages `json:"messages,required"`
- Result FirewallAccessRuleGetResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success FirewallAccessRuleGetResponseEnvelopeSuccess `json:"success,required"`
- JSON firewallAccessRuleGetResponseEnvelopeJSON `json:"-"`
-}
-
-// firewallAccessRuleGetResponseEnvelopeJSON contains the JSON metadata for the
-// struct [FirewallAccessRuleGetResponseEnvelope]
-type firewallAccessRuleGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallAccessRuleGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallAccessRuleGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type FirewallAccessRuleGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON firewallAccessRuleGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// firewallAccessRuleGetResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [FirewallAccessRuleGetResponseEnvelopeErrors]
-type firewallAccessRuleGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallAccessRuleGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallAccessRuleGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type FirewallAccessRuleGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON firewallAccessRuleGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// firewallAccessRuleGetResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [FirewallAccessRuleGetResponseEnvelopeMessages]
-type firewallAccessRuleGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallAccessRuleGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallAccessRuleGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type FirewallAccessRuleGetResponseEnvelopeSuccess bool
-
-const (
- FirewallAccessRuleGetResponseEnvelopeSuccessTrue FirewallAccessRuleGetResponseEnvelopeSuccess = true
-)
diff --git a/firewallaccessrule_test.go b/firewallaccessrule_test.go
deleted file mode 100644
index ec73a395820..00000000000
--- a/firewallaccessrule_test.go
+++ /dev/null
@@ -1,190 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestFirewallAccessRuleNewWithOptionalParams(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"),
- )
- _, err := client.Firewall.AccessRules.New(context.TODO(), cloudflare.FirewallAccessRuleNewParams{
- Configuration: cloudflare.F[cloudflare.FirewallAccessRuleNewParamsConfiguration](cloudflare.FirewallAccessRuleNewParamsConfigurationLegacyJhsIPConfiguration(cloudflare.FirewallAccessRuleNewParamsConfigurationLegacyJhsIPConfiguration{
- Target: cloudflare.F(cloudflare.FirewallAccessRuleNewParamsConfigurationLegacyJhsIPConfigurationTargetIP),
- Value: cloudflare.F("198.51.100.4"),
- })),
- Mode: cloudflare.F(cloudflare.FirewallAccessRuleNewParamsModeChallenge),
- AccountID: cloudflare.F("string"),
- ZoneID: cloudflare.F("string"),
- Notes: cloudflare.F("This rule is enabled because of an event that occurred on date X."),
- })
- 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())
- }
-}
-
-func TestFirewallAccessRuleListWithOptionalParams(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"),
- )
- _, err := client.Firewall.AccessRules.List(context.TODO(), cloudflare.FirewallAccessRuleListParams{
- AccountID: cloudflare.F("string"),
- ZoneID: cloudflare.F("string"),
- Direction: cloudflare.F(cloudflare.FirewallAccessRuleListParamsDirectionDesc),
- EgsPagination: cloudflare.F(cloudflare.FirewallAccessRuleListParamsEgsPagination{
- Json: cloudflare.F(cloudflare.FirewallAccessRuleListParamsEgsPaginationJson{
- Page: cloudflare.F(1.000000),
- PerPage: cloudflare.F(1.000000),
- }),
- }),
- Filters: cloudflare.F(cloudflare.FirewallAccessRuleListParamsFilters{
- ConfigurationTarget: cloudflare.F(cloudflare.FirewallAccessRuleListParamsFiltersConfigurationTargetIP),
- ConfigurationValue: cloudflare.F("198.51.100.4"),
- Match: cloudflare.F(cloudflare.FirewallAccessRuleListParamsFiltersMatchAny),
- Mode: cloudflare.F(cloudflare.FirewallAccessRuleListParamsFiltersModeChallenge),
- Notes: cloudflare.F("my note"),
- }),
- Order: cloudflare.F(cloudflare.FirewallAccessRuleListParamsOrderMode),
- Page: cloudflare.F(1.000000),
- PerPage: cloudflare.F(20.000000),
- })
- 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())
- }
-}
-
-func TestFirewallAccessRuleDeleteWithOptionalParams(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"),
- )
- _, err := client.Firewall.AccessRules.Delete(
- context.TODO(),
- map[string]interface{}{},
- cloudflare.FirewallAccessRuleDeleteParams{
- AccountID: cloudflare.F("string"),
- ZoneID: cloudflare.F("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())
- }
-}
-
-func TestFirewallAccessRuleEditWithOptionalParams(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"),
- )
- _, err := client.Firewall.AccessRules.Edit(
- context.TODO(),
- map[string]interface{}{},
- cloudflare.FirewallAccessRuleEditParams{
- Configuration: cloudflare.F[cloudflare.FirewallAccessRuleEditParamsConfiguration](cloudflare.FirewallAccessRuleEditParamsConfigurationLegacyJhsIPConfiguration(cloudflare.FirewallAccessRuleEditParamsConfigurationLegacyJhsIPConfiguration{
- Target: cloudflare.F(cloudflare.FirewallAccessRuleEditParamsConfigurationLegacyJhsIPConfigurationTargetIP),
- Value: cloudflare.F("198.51.100.4"),
- })),
- Mode: cloudflare.F(cloudflare.FirewallAccessRuleEditParamsModeChallenge),
- AccountID: cloudflare.F("string"),
- ZoneID: cloudflare.F("string"),
- Notes: cloudflare.F("This rule is enabled because of an event that occurred on date X."),
- },
- )
- 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())
- }
-}
-
-func TestFirewallAccessRuleGetWithOptionalParams(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"),
- )
- _, err := client.Firewall.AccessRules.Get(
- context.TODO(),
- map[string]interface{}{},
- cloudflare.FirewallAccessRuleGetParams{
- AccountID: cloudflare.F("string"),
- ZoneID: cloudflare.F("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/firewalllockdown.go b/firewalllockdown.go
deleted file mode 100644
index 7a68416e406..00000000000
--- a/firewalllockdown.go
+++ /dev/null
@@ -1,1038 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
- "reflect"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/option"
- "github.com/tidwall/gjson"
-)
-
-// FirewallLockdownService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewFirewallLockdownService] method
-// instead.
-type FirewallLockdownService struct {
- Options []option.RequestOption
-}
-
-// NewFirewallLockdownService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewFirewallLockdownService(opts ...option.RequestOption) (r *FirewallLockdownService) {
- r = &FirewallLockdownService{}
- r.Options = opts
- return
-}
-
-// Creates a new Zone Lockdown rule.
-func (r *FirewallLockdownService) New(ctx context.Context, zoneIdentifier string, body FirewallLockdownNewParams, opts ...option.RequestOption) (res *FirewallLockdownNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env FirewallLockdownNewResponseEnvelope
- path := fmt.Sprintf("zones/%s/firewall/lockdowns", zoneIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Updates an existing Zone Lockdown rule.
-func (r *FirewallLockdownService) Update(ctx context.Context, zoneIdentifier string, id string, body FirewallLockdownUpdateParams, opts ...option.RequestOption) (res *FirewallLockdownUpdateResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env FirewallLockdownUpdateResponseEnvelope
- path := fmt.Sprintf("zones/%s/firewall/lockdowns/%s", zoneIdentifier, id)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Fetches Zone Lockdown rules. You can filter the results using several optional
-// parameters.
-func (r *FirewallLockdownService) List(ctx context.Context, zoneIdentifier string, query FirewallLockdownListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[FirewallLockdownListResponse], err error) {
- var raw *http.Response
- opts = append(r.Options, opts...)
- opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
- path := fmt.Sprintf("zones/%s/firewall/lockdowns", zoneIdentifier)
- cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...)
- if err != nil {
- return nil, err
- }
- err = cfg.Execute()
- if err != nil {
- return nil, err
- }
- res.SetPageConfig(cfg, raw)
- return res, nil
-}
-
-// Fetches Zone Lockdown rules. You can filter the results using several optional
-// parameters.
-func (r *FirewallLockdownService) ListAutoPaging(ctx context.Context, zoneIdentifier string, query FirewallLockdownListParams, opts ...option.RequestOption) *shared.V4PagePaginationArrayAutoPager[FirewallLockdownListResponse] {
- return shared.NewV4PagePaginationArrayAutoPager(r.List(ctx, zoneIdentifier, query, opts...))
-}
-
-// Deletes an existing Zone Lockdown rule.
-func (r *FirewallLockdownService) Delete(ctx context.Context, zoneIdentifier string, id string, opts ...option.RequestOption) (res *FirewallLockdownDeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env FirewallLockdownDeleteResponseEnvelope
- path := fmt.Sprintf("zones/%s/firewall/lockdowns/%s", zoneIdentifier, id)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Fetches the details of a Zone Lockdown rule.
-func (r *FirewallLockdownService) Get(ctx context.Context, zoneIdentifier string, id string, opts ...option.RequestOption) (res *FirewallLockdownGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env FirewallLockdownGetResponseEnvelope
- path := fmt.Sprintf("zones/%s/firewall/lockdowns/%s", zoneIdentifier, id)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type FirewallLockdownNewResponse struct {
- // The unique identifier of the Zone Lockdown rule.
- ID string `json:"id,required"`
- // A list of IP addresses or CIDR ranges that will be allowed to access the URLs
- // specified in the Zone Lockdown rule. You can include any number of `ip` or
- // `ip_range` configurations.
- Configurations FirewallLockdownNewResponseConfigurations `json:"configurations,required"`
- // The timestamp of when the rule was created.
- CreatedOn time.Time `json:"created_on,required" format:"date-time"`
- // An informative summary of the rule.
- Description string `json:"description,required"`
- // The timestamp of when the rule was last modified.
- ModifiedOn time.Time `json:"modified_on,required" format:"date-time"`
- // When true, indicates that the rule is currently paused.
- Paused bool `json:"paused,required"`
- // The URLs to include in the rule definition. You can use wildcards. Each entered
- // URL will be escaped before use, which means you can only use simple wildcard
- // patterns.
- URLs []string `json:"urls,required"`
- JSON firewallLockdownNewResponseJSON `json:"-"`
-}
-
-// firewallLockdownNewResponseJSON contains the JSON metadata for the struct
-// [FirewallLockdownNewResponse]
-type firewallLockdownNewResponseJSON struct {
- ID apijson.Field
- Configurations apijson.Field
- CreatedOn apijson.Field
- Description apijson.Field
- ModifiedOn apijson.Field
- Paused apijson.Field
- URLs apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallLockdownNewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallLockdownNewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// A list of IP addresses or CIDR ranges that will be allowed to access the URLs
-// specified in the Zone Lockdown rule. You can include any number of `ip` or
-// `ip_range` configurations.
-//
-// Union satisfied by
-// [FirewallLockdownNewResponseConfigurationsLegacyJhsSchemasIPConfiguration] or
-// [FirewallLockdownNewResponseConfigurationsLegacyJhsSchemasCidrConfiguration].
-type FirewallLockdownNewResponseConfigurations interface {
- implementsFirewallLockdownNewResponseConfigurations()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*FirewallLockdownNewResponseConfigurations)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(FirewallLockdownNewResponseConfigurationsLegacyJhsSchemasIPConfiguration{}),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(FirewallLockdownNewResponseConfigurationsLegacyJhsSchemasCidrConfiguration{}),
- },
- )
-}
-
-type FirewallLockdownNewResponseConfigurationsLegacyJhsSchemasIPConfiguration struct {
- // The configuration target. You must set the target to `ip` when specifying an IP
- // address in the Zone Lockdown rule.
- Target FirewallLockdownNewResponseConfigurationsLegacyJhsSchemasIPConfigurationTarget `json:"target"`
- // The IP address to match. This address will be compared to the IP address of
- // incoming requests.
- Value string `json:"value"`
- JSON firewallLockdownNewResponseConfigurationsLegacyJhsSchemasIPConfigurationJSON `json:"-"`
-}
-
-// firewallLockdownNewResponseConfigurationsLegacyJhsSchemasIPConfigurationJSON
-// contains the JSON metadata for the struct
-// [FirewallLockdownNewResponseConfigurationsLegacyJhsSchemasIPConfiguration]
-type firewallLockdownNewResponseConfigurationsLegacyJhsSchemasIPConfigurationJSON struct {
- Target apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallLockdownNewResponseConfigurationsLegacyJhsSchemasIPConfiguration) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallLockdownNewResponseConfigurationsLegacyJhsSchemasIPConfigurationJSON) RawJSON() string {
- return r.raw
-}
-
-func (r FirewallLockdownNewResponseConfigurationsLegacyJhsSchemasIPConfiguration) implementsFirewallLockdownNewResponseConfigurations() {
-}
-
-// The configuration target. You must set the target to `ip` when specifying an IP
-// address in the Zone Lockdown rule.
-type FirewallLockdownNewResponseConfigurationsLegacyJhsSchemasIPConfigurationTarget string
-
-const (
- FirewallLockdownNewResponseConfigurationsLegacyJhsSchemasIPConfigurationTargetIP FirewallLockdownNewResponseConfigurationsLegacyJhsSchemasIPConfigurationTarget = "ip"
-)
-
-type FirewallLockdownNewResponseConfigurationsLegacyJhsSchemasCidrConfiguration struct {
- // The configuration target. You must set the target to `ip_range` when specifying
- // an IP address range in the Zone Lockdown rule.
- Target FirewallLockdownNewResponseConfigurationsLegacyJhsSchemasCidrConfigurationTarget `json:"target"`
- // The IP address range to match. You can only use prefix lengths `/16` and `/24`.
- Value string `json:"value"`
- JSON firewallLockdownNewResponseConfigurationsLegacyJhsSchemasCidrConfigurationJSON `json:"-"`
-}
-
-// firewallLockdownNewResponseConfigurationsLegacyJhsSchemasCidrConfigurationJSON
-// contains the JSON metadata for the struct
-// [FirewallLockdownNewResponseConfigurationsLegacyJhsSchemasCidrConfiguration]
-type firewallLockdownNewResponseConfigurationsLegacyJhsSchemasCidrConfigurationJSON struct {
- Target apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallLockdownNewResponseConfigurationsLegacyJhsSchemasCidrConfiguration) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallLockdownNewResponseConfigurationsLegacyJhsSchemasCidrConfigurationJSON) RawJSON() string {
- return r.raw
-}
-
-func (r FirewallLockdownNewResponseConfigurationsLegacyJhsSchemasCidrConfiguration) implementsFirewallLockdownNewResponseConfigurations() {
-}
-
-// The configuration target. You must set the target to `ip_range` when specifying
-// an IP address range in the Zone Lockdown rule.
-type FirewallLockdownNewResponseConfigurationsLegacyJhsSchemasCidrConfigurationTarget string
-
-const (
- FirewallLockdownNewResponseConfigurationsLegacyJhsSchemasCidrConfigurationTargetIPRange FirewallLockdownNewResponseConfigurationsLegacyJhsSchemasCidrConfigurationTarget = "ip_range"
-)
-
-type FirewallLockdownUpdateResponse struct {
- // The unique identifier of the Zone Lockdown rule.
- ID string `json:"id,required"`
- // A list of IP addresses or CIDR ranges that will be allowed to access the URLs
- // specified in the Zone Lockdown rule. You can include any number of `ip` or
- // `ip_range` configurations.
- Configurations FirewallLockdownUpdateResponseConfigurations `json:"configurations,required"`
- // The timestamp of when the rule was created.
- CreatedOn time.Time `json:"created_on,required" format:"date-time"`
- // An informative summary of the rule.
- Description string `json:"description,required"`
- // The timestamp of when the rule was last modified.
- ModifiedOn time.Time `json:"modified_on,required" format:"date-time"`
- // When true, indicates that the rule is currently paused.
- Paused bool `json:"paused,required"`
- // The URLs to include in the rule definition. You can use wildcards. Each entered
- // URL will be escaped before use, which means you can only use simple wildcard
- // patterns.
- URLs []string `json:"urls,required"`
- JSON firewallLockdownUpdateResponseJSON `json:"-"`
-}
-
-// firewallLockdownUpdateResponseJSON contains the JSON metadata for the struct
-// [FirewallLockdownUpdateResponse]
-type firewallLockdownUpdateResponseJSON struct {
- ID apijson.Field
- Configurations apijson.Field
- CreatedOn apijson.Field
- Description apijson.Field
- ModifiedOn apijson.Field
- Paused apijson.Field
- URLs apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallLockdownUpdateResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallLockdownUpdateResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// A list of IP addresses or CIDR ranges that will be allowed to access the URLs
-// specified in the Zone Lockdown rule. You can include any number of `ip` or
-// `ip_range` configurations.
-//
-// Union satisfied by
-// [FirewallLockdownUpdateResponseConfigurationsLegacyJhsSchemasIPConfiguration] or
-// [FirewallLockdownUpdateResponseConfigurationsLegacyJhsSchemasCidrConfiguration].
-type FirewallLockdownUpdateResponseConfigurations interface {
- implementsFirewallLockdownUpdateResponseConfigurations()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*FirewallLockdownUpdateResponseConfigurations)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(FirewallLockdownUpdateResponseConfigurationsLegacyJhsSchemasIPConfiguration{}),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(FirewallLockdownUpdateResponseConfigurationsLegacyJhsSchemasCidrConfiguration{}),
- },
- )
-}
-
-type FirewallLockdownUpdateResponseConfigurationsLegacyJhsSchemasIPConfiguration struct {
- // The configuration target. You must set the target to `ip` when specifying an IP
- // address in the Zone Lockdown rule.
- Target FirewallLockdownUpdateResponseConfigurationsLegacyJhsSchemasIPConfigurationTarget `json:"target"`
- // The IP address to match. This address will be compared to the IP address of
- // incoming requests.
- Value string `json:"value"`
- JSON firewallLockdownUpdateResponseConfigurationsLegacyJhsSchemasIPConfigurationJSON `json:"-"`
-}
-
-// firewallLockdownUpdateResponseConfigurationsLegacyJhsSchemasIPConfigurationJSON
-// contains the JSON metadata for the struct
-// [FirewallLockdownUpdateResponseConfigurationsLegacyJhsSchemasIPConfiguration]
-type firewallLockdownUpdateResponseConfigurationsLegacyJhsSchemasIPConfigurationJSON struct {
- Target apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallLockdownUpdateResponseConfigurationsLegacyJhsSchemasIPConfiguration) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallLockdownUpdateResponseConfigurationsLegacyJhsSchemasIPConfigurationJSON) RawJSON() string {
- return r.raw
-}
-
-func (r FirewallLockdownUpdateResponseConfigurationsLegacyJhsSchemasIPConfiguration) implementsFirewallLockdownUpdateResponseConfigurations() {
-}
-
-// The configuration target. You must set the target to `ip` when specifying an IP
-// address in the Zone Lockdown rule.
-type FirewallLockdownUpdateResponseConfigurationsLegacyJhsSchemasIPConfigurationTarget string
-
-const (
- FirewallLockdownUpdateResponseConfigurationsLegacyJhsSchemasIPConfigurationTargetIP FirewallLockdownUpdateResponseConfigurationsLegacyJhsSchemasIPConfigurationTarget = "ip"
-)
-
-type FirewallLockdownUpdateResponseConfigurationsLegacyJhsSchemasCidrConfiguration struct {
- // The configuration target. You must set the target to `ip_range` when specifying
- // an IP address range in the Zone Lockdown rule.
- Target FirewallLockdownUpdateResponseConfigurationsLegacyJhsSchemasCidrConfigurationTarget `json:"target"`
- // The IP address range to match. You can only use prefix lengths `/16` and `/24`.
- Value string `json:"value"`
- JSON firewallLockdownUpdateResponseConfigurationsLegacyJhsSchemasCidrConfigurationJSON `json:"-"`
-}
-
-// firewallLockdownUpdateResponseConfigurationsLegacyJhsSchemasCidrConfigurationJSON
-// contains the JSON metadata for the struct
-// [FirewallLockdownUpdateResponseConfigurationsLegacyJhsSchemasCidrConfiguration]
-type firewallLockdownUpdateResponseConfigurationsLegacyJhsSchemasCidrConfigurationJSON struct {
- Target apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallLockdownUpdateResponseConfigurationsLegacyJhsSchemasCidrConfiguration) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallLockdownUpdateResponseConfigurationsLegacyJhsSchemasCidrConfigurationJSON) RawJSON() string {
- return r.raw
-}
-
-func (r FirewallLockdownUpdateResponseConfigurationsLegacyJhsSchemasCidrConfiguration) implementsFirewallLockdownUpdateResponseConfigurations() {
-}
-
-// The configuration target. You must set the target to `ip_range` when specifying
-// an IP address range in the Zone Lockdown rule.
-type FirewallLockdownUpdateResponseConfigurationsLegacyJhsSchemasCidrConfigurationTarget string
-
-const (
- FirewallLockdownUpdateResponseConfigurationsLegacyJhsSchemasCidrConfigurationTargetIPRange FirewallLockdownUpdateResponseConfigurationsLegacyJhsSchemasCidrConfigurationTarget = "ip_range"
-)
-
-type FirewallLockdownListResponse struct {
- // The unique identifier of the Zone Lockdown rule.
- ID string `json:"id,required"`
- // A list of IP addresses or CIDR ranges that will be allowed to access the URLs
- // specified in the Zone Lockdown rule. You can include any number of `ip` or
- // `ip_range` configurations.
- Configurations FirewallLockdownListResponseConfigurations `json:"configurations,required"`
- // The timestamp of when the rule was created.
- CreatedOn time.Time `json:"created_on,required" format:"date-time"`
- // An informative summary of the rule.
- Description string `json:"description,required"`
- // The timestamp of when the rule was last modified.
- ModifiedOn time.Time `json:"modified_on,required" format:"date-time"`
- // When true, indicates that the rule is currently paused.
- Paused bool `json:"paused,required"`
- // The URLs to include in the rule definition. You can use wildcards. Each entered
- // URL will be escaped before use, which means you can only use simple wildcard
- // patterns.
- URLs []string `json:"urls,required"`
- JSON firewallLockdownListResponseJSON `json:"-"`
-}
-
-// firewallLockdownListResponseJSON contains the JSON metadata for the struct
-// [FirewallLockdownListResponse]
-type firewallLockdownListResponseJSON struct {
- ID apijson.Field
- Configurations apijson.Field
- CreatedOn apijson.Field
- Description apijson.Field
- ModifiedOn apijson.Field
- Paused apijson.Field
- URLs apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallLockdownListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallLockdownListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// A list of IP addresses or CIDR ranges that will be allowed to access the URLs
-// specified in the Zone Lockdown rule. You can include any number of `ip` or
-// `ip_range` configurations.
-//
-// Union satisfied by
-// [FirewallLockdownListResponseConfigurationsLegacyJhsSchemasIPConfiguration] or
-// [FirewallLockdownListResponseConfigurationsLegacyJhsSchemasCidrConfiguration].
-type FirewallLockdownListResponseConfigurations interface {
- implementsFirewallLockdownListResponseConfigurations()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*FirewallLockdownListResponseConfigurations)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(FirewallLockdownListResponseConfigurationsLegacyJhsSchemasIPConfiguration{}),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(FirewallLockdownListResponseConfigurationsLegacyJhsSchemasCidrConfiguration{}),
- },
- )
-}
-
-type FirewallLockdownListResponseConfigurationsLegacyJhsSchemasIPConfiguration struct {
- // The configuration target. You must set the target to `ip` when specifying an IP
- // address in the Zone Lockdown rule.
- Target FirewallLockdownListResponseConfigurationsLegacyJhsSchemasIPConfigurationTarget `json:"target"`
- // The IP address to match. This address will be compared to the IP address of
- // incoming requests.
- Value string `json:"value"`
- JSON firewallLockdownListResponseConfigurationsLegacyJhsSchemasIPConfigurationJSON `json:"-"`
-}
-
-// firewallLockdownListResponseConfigurationsLegacyJhsSchemasIPConfigurationJSON
-// contains the JSON metadata for the struct
-// [FirewallLockdownListResponseConfigurationsLegacyJhsSchemasIPConfiguration]
-type firewallLockdownListResponseConfigurationsLegacyJhsSchemasIPConfigurationJSON struct {
- Target apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallLockdownListResponseConfigurationsLegacyJhsSchemasIPConfiguration) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallLockdownListResponseConfigurationsLegacyJhsSchemasIPConfigurationJSON) RawJSON() string {
- return r.raw
-}
-
-func (r FirewallLockdownListResponseConfigurationsLegacyJhsSchemasIPConfiguration) implementsFirewallLockdownListResponseConfigurations() {
-}
-
-// The configuration target. You must set the target to `ip` when specifying an IP
-// address in the Zone Lockdown rule.
-type FirewallLockdownListResponseConfigurationsLegacyJhsSchemasIPConfigurationTarget string
-
-const (
- FirewallLockdownListResponseConfigurationsLegacyJhsSchemasIPConfigurationTargetIP FirewallLockdownListResponseConfigurationsLegacyJhsSchemasIPConfigurationTarget = "ip"
-)
-
-type FirewallLockdownListResponseConfigurationsLegacyJhsSchemasCidrConfiguration struct {
- // The configuration target. You must set the target to `ip_range` when specifying
- // an IP address range in the Zone Lockdown rule.
- Target FirewallLockdownListResponseConfigurationsLegacyJhsSchemasCidrConfigurationTarget `json:"target"`
- // The IP address range to match. You can only use prefix lengths `/16` and `/24`.
- Value string `json:"value"`
- JSON firewallLockdownListResponseConfigurationsLegacyJhsSchemasCidrConfigurationJSON `json:"-"`
-}
-
-// firewallLockdownListResponseConfigurationsLegacyJhsSchemasCidrConfigurationJSON
-// contains the JSON metadata for the struct
-// [FirewallLockdownListResponseConfigurationsLegacyJhsSchemasCidrConfiguration]
-type firewallLockdownListResponseConfigurationsLegacyJhsSchemasCidrConfigurationJSON struct {
- Target apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallLockdownListResponseConfigurationsLegacyJhsSchemasCidrConfiguration) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallLockdownListResponseConfigurationsLegacyJhsSchemasCidrConfigurationJSON) RawJSON() string {
- return r.raw
-}
-
-func (r FirewallLockdownListResponseConfigurationsLegacyJhsSchemasCidrConfiguration) implementsFirewallLockdownListResponseConfigurations() {
-}
-
-// The configuration target. You must set the target to `ip_range` when specifying
-// an IP address range in the Zone Lockdown rule.
-type FirewallLockdownListResponseConfigurationsLegacyJhsSchemasCidrConfigurationTarget string
-
-const (
- FirewallLockdownListResponseConfigurationsLegacyJhsSchemasCidrConfigurationTargetIPRange FirewallLockdownListResponseConfigurationsLegacyJhsSchemasCidrConfigurationTarget = "ip_range"
-)
-
-type FirewallLockdownDeleteResponse struct {
- // The unique identifier of the Zone Lockdown rule.
- ID string `json:"id"`
- JSON firewallLockdownDeleteResponseJSON `json:"-"`
-}
-
-// firewallLockdownDeleteResponseJSON contains the JSON metadata for the struct
-// [FirewallLockdownDeleteResponse]
-type firewallLockdownDeleteResponseJSON struct {
- ID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallLockdownDeleteResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallLockdownDeleteResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type FirewallLockdownGetResponse struct {
- // The unique identifier of the Zone Lockdown rule.
- ID string `json:"id,required"`
- // A list of IP addresses or CIDR ranges that will be allowed to access the URLs
- // specified in the Zone Lockdown rule. You can include any number of `ip` or
- // `ip_range` configurations.
- Configurations FirewallLockdownGetResponseConfigurations `json:"configurations,required"`
- // The timestamp of when the rule was created.
- CreatedOn time.Time `json:"created_on,required" format:"date-time"`
- // An informative summary of the rule.
- Description string `json:"description,required"`
- // The timestamp of when the rule was last modified.
- ModifiedOn time.Time `json:"modified_on,required" format:"date-time"`
- // When true, indicates that the rule is currently paused.
- Paused bool `json:"paused,required"`
- // The URLs to include in the rule definition. You can use wildcards. Each entered
- // URL will be escaped before use, which means you can only use simple wildcard
- // patterns.
- URLs []string `json:"urls,required"`
- JSON firewallLockdownGetResponseJSON `json:"-"`
-}
-
-// firewallLockdownGetResponseJSON contains the JSON metadata for the struct
-// [FirewallLockdownGetResponse]
-type firewallLockdownGetResponseJSON struct {
- ID apijson.Field
- Configurations apijson.Field
- CreatedOn apijson.Field
- Description apijson.Field
- ModifiedOn apijson.Field
- Paused apijson.Field
- URLs apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallLockdownGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallLockdownGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// A list of IP addresses or CIDR ranges that will be allowed to access the URLs
-// specified in the Zone Lockdown rule. You can include any number of `ip` or
-// `ip_range` configurations.
-//
-// Union satisfied by
-// [FirewallLockdownGetResponseConfigurationsLegacyJhsSchemasIPConfiguration] or
-// [FirewallLockdownGetResponseConfigurationsLegacyJhsSchemasCidrConfiguration].
-type FirewallLockdownGetResponseConfigurations interface {
- implementsFirewallLockdownGetResponseConfigurations()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*FirewallLockdownGetResponseConfigurations)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(FirewallLockdownGetResponseConfigurationsLegacyJhsSchemasIPConfiguration{}),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(FirewallLockdownGetResponseConfigurationsLegacyJhsSchemasCidrConfiguration{}),
- },
- )
-}
-
-type FirewallLockdownGetResponseConfigurationsLegacyJhsSchemasIPConfiguration struct {
- // The configuration target. You must set the target to `ip` when specifying an IP
- // address in the Zone Lockdown rule.
- Target FirewallLockdownGetResponseConfigurationsLegacyJhsSchemasIPConfigurationTarget `json:"target"`
- // The IP address to match. This address will be compared to the IP address of
- // incoming requests.
- Value string `json:"value"`
- JSON firewallLockdownGetResponseConfigurationsLegacyJhsSchemasIPConfigurationJSON `json:"-"`
-}
-
-// firewallLockdownGetResponseConfigurationsLegacyJhsSchemasIPConfigurationJSON
-// contains the JSON metadata for the struct
-// [FirewallLockdownGetResponseConfigurationsLegacyJhsSchemasIPConfiguration]
-type firewallLockdownGetResponseConfigurationsLegacyJhsSchemasIPConfigurationJSON struct {
- Target apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallLockdownGetResponseConfigurationsLegacyJhsSchemasIPConfiguration) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallLockdownGetResponseConfigurationsLegacyJhsSchemasIPConfigurationJSON) RawJSON() string {
- return r.raw
-}
-
-func (r FirewallLockdownGetResponseConfigurationsLegacyJhsSchemasIPConfiguration) implementsFirewallLockdownGetResponseConfigurations() {
-}
-
-// The configuration target. You must set the target to `ip` when specifying an IP
-// address in the Zone Lockdown rule.
-type FirewallLockdownGetResponseConfigurationsLegacyJhsSchemasIPConfigurationTarget string
-
-const (
- FirewallLockdownGetResponseConfigurationsLegacyJhsSchemasIPConfigurationTargetIP FirewallLockdownGetResponseConfigurationsLegacyJhsSchemasIPConfigurationTarget = "ip"
-)
-
-type FirewallLockdownGetResponseConfigurationsLegacyJhsSchemasCidrConfiguration struct {
- // The configuration target. You must set the target to `ip_range` when specifying
- // an IP address range in the Zone Lockdown rule.
- Target FirewallLockdownGetResponseConfigurationsLegacyJhsSchemasCidrConfigurationTarget `json:"target"`
- // The IP address range to match. You can only use prefix lengths `/16` and `/24`.
- Value string `json:"value"`
- JSON firewallLockdownGetResponseConfigurationsLegacyJhsSchemasCidrConfigurationJSON `json:"-"`
-}
-
-// firewallLockdownGetResponseConfigurationsLegacyJhsSchemasCidrConfigurationJSON
-// contains the JSON metadata for the struct
-// [FirewallLockdownGetResponseConfigurationsLegacyJhsSchemasCidrConfiguration]
-type firewallLockdownGetResponseConfigurationsLegacyJhsSchemasCidrConfigurationJSON struct {
- Target apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallLockdownGetResponseConfigurationsLegacyJhsSchemasCidrConfiguration) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallLockdownGetResponseConfigurationsLegacyJhsSchemasCidrConfigurationJSON) RawJSON() string {
- return r.raw
-}
-
-func (r FirewallLockdownGetResponseConfigurationsLegacyJhsSchemasCidrConfiguration) implementsFirewallLockdownGetResponseConfigurations() {
-}
-
-// The configuration target. You must set the target to `ip_range` when specifying
-// an IP address range in the Zone Lockdown rule.
-type FirewallLockdownGetResponseConfigurationsLegacyJhsSchemasCidrConfigurationTarget string
-
-const (
- FirewallLockdownGetResponseConfigurationsLegacyJhsSchemasCidrConfigurationTargetIPRange FirewallLockdownGetResponseConfigurationsLegacyJhsSchemasCidrConfigurationTarget = "ip_range"
-)
-
-type FirewallLockdownNewParams struct {
- Body param.Field[interface{}] `json:"body,required"`
-}
-
-func (r FirewallLockdownNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r.Body)
-}
-
-type FirewallLockdownNewResponseEnvelope struct {
- Errors []FirewallLockdownNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []FirewallLockdownNewResponseEnvelopeMessages `json:"messages,required"`
- Result FirewallLockdownNewResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success FirewallLockdownNewResponseEnvelopeSuccess `json:"success,required"`
- JSON firewallLockdownNewResponseEnvelopeJSON `json:"-"`
-}
-
-// firewallLockdownNewResponseEnvelopeJSON contains the JSON metadata for the
-// struct [FirewallLockdownNewResponseEnvelope]
-type firewallLockdownNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallLockdownNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallLockdownNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type FirewallLockdownNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON firewallLockdownNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// firewallLockdownNewResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [FirewallLockdownNewResponseEnvelopeErrors]
-type firewallLockdownNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallLockdownNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallLockdownNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type FirewallLockdownNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON firewallLockdownNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// firewallLockdownNewResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [FirewallLockdownNewResponseEnvelopeMessages]
-type firewallLockdownNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallLockdownNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallLockdownNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type FirewallLockdownNewResponseEnvelopeSuccess bool
-
-const (
- FirewallLockdownNewResponseEnvelopeSuccessTrue FirewallLockdownNewResponseEnvelopeSuccess = true
-)
-
-type FirewallLockdownUpdateParams struct {
- Body param.Field[interface{}] `json:"body,required"`
-}
-
-func (r FirewallLockdownUpdateParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r.Body)
-}
-
-type FirewallLockdownUpdateResponseEnvelope struct {
- Errors []FirewallLockdownUpdateResponseEnvelopeErrors `json:"errors,required"`
- Messages []FirewallLockdownUpdateResponseEnvelopeMessages `json:"messages,required"`
- Result FirewallLockdownUpdateResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success FirewallLockdownUpdateResponseEnvelopeSuccess `json:"success,required"`
- JSON firewallLockdownUpdateResponseEnvelopeJSON `json:"-"`
-}
-
-// firewallLockdownUpdateResponseEnvelopeJSON contains the JSON metadata for the
-// struct [FirewallLockdownUpdateResponseEnvelope]
-type firewallLockdownUpdateResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallLockdownUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallLockdownUpdateResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type FirewallLockdownUpdateResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON firewallLockdownUpdateResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// firewallLockdownUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [FirewallLockdownUpdateResponseEnvelopeErrors]
-type firewallLockdownUpdateResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallLockdownUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallLockdownUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type FirewallLockdownUpdateResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON firewallLockdownUpdateResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// firewallLockdownUpdateResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [FirewallLockdownUpdateResponseEnvelopeMessages]
-type firewallLockdownUpdateResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallLockdownUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallLockdownUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type FirewallLockdownUpdateResponseEnvelopeSuccess bool
-
-const (
- FirewallLockdownUpdateResponseEnvelopeSuccessTrue FirewallLockdownUpdateResponseEnvelopeSuccess = true
-)
-
-type FirewallLockdownListParams struct {
- // A string to search for in the description of existing rules.
- Description param.Field[string] `query:"description"`
- // A string to search for in the description of existing rules.
- DescriptionSearch param.Field[string] `query:"description_search"`
- // A single IP address to search for in existing rules.
- IP param.Field[string] `query:"ip"`
- // A single IP address range to search for in existing rules.
- IPRangeSearch param.Field[string] `query:"ip_range_search"`
- // A single IP address to search for in existing rules.
- IPSearch param.Field[string] `query:"ip_search"`
- // Page number of paginated results.
- Page param.Field[float64] `query:"page"`
- // The maximum number of results per page. You can only set the value to `1` or to
- // a multiple of 5 such as `5`, `10`, `15`, or `20`.
- PerPage param.Field[float64] `query:"per_page"`
- // The priority of the rule to control the processing order. A lower number
- // indicates higher priority. If not provided, any rules with a configured priority
- // will be processed before rules without a priority.
- Priority param.Field[float64] `query:"priority"`
- // A single URI to search for in the list of URLs of existing rules.
- URISearch param.Field[string] `query:"uri_search"`
-}
-
-// URLQuery serializes [FirewallLockdownListParams]'s query parameters as
-// `url.Values`.
-func (r FirewallLockdownListParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type FirewallLockdownDeleteResponseEnvelope struct {
- Result FirewallLockdownDeleteResponse `json:"result"`
- JSON firewallLockdownDeleteResponseEnvelopeJSON `json:"-"`
-}
-
-// firewallLockdownDeleteResponseEnvelopeJSON contains the JSON metadata for the
-// struct [FirewallLockdownDeleteResponseEnvelope]
-type firewallLockdownDeleteResponseEnvelopeJSON struct {
- Result apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallLockdownDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallLockdownDeleteResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type FirewallLockdownGetResponseEnvelope struct {
- Errors []FirewallLockdownGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []FirewallLockdownGetResponseEnvelopeMessages `json:"messages,required"`
- Result FirewallLockdownGetResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success FirewallLockdownGetResponseEnvelopeSuccess `json:"success,required"`
- JSON firewallLockdownGetResponseEnvelopeJSON `json:"-"`
-}
-
-// firewallLockdownGetResponseEnvelopeJSON contains the JSON metadata for the
-// struct [FirewallLockdownGetResponseEnvelope]
-type firewallLockdownGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallLockdownGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallLockdownGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type FirewallLockdownGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON firewallLockdownGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// firewallLockdownGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [FirewallLockdownGetResponseEnvelopeErrors]
-type firewallLockdownGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallLockdownGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallLockdownGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type FirewallLockdownGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON firewallLockdownGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// firewallLockdownGetResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [FirewallLockdownGetResponseEnvelopeMessages]
-type firewallLockdownGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallLockdownGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallLockdownGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type FirewallLockdownGetResponseEnvelopeSuccess bool
-
-const (
- FirewallLockdownGetResponseEnvelopeSuccessTrue FirewallLockdownGetResponseEnvelopeSuccess = true
-)
diff --git a/firewalllockdown_test.go b/firewalllockdown_test.go
deleted file mode 100644
index aa3311681cf..00000000000
--- a/firewalllockdown_test.go
+++ /dev/null
@@ -1,169 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestFirewallLockdownNew(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"),
- )
- _, err := client.Firewall.Lockdowns.New(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.FirewallLockdownNewParams{
- Body: cloudflare.F[any](map[string]interface{}{}),
- },
- )
- 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())
- }
-}
-
-func TestFirewallLockdownUpdate(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"),
- )
- _, err := client.Firewall.Lockdowns.Update(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- "372e67954025e0ba6aaa6d586b9e0b59",
- cloudflare.FirewallLockdownUpdateParams{
- Body: cloudflare.F[any](map[string]interface{}{}),
- },
- )
- 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())
- }
-}
-
-func TestFirewallLockdownListWithOptionalParams(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"),
- )
- _, err := client.Firewall.Lockdowns.List(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.FirewallLockdownListParams{
- Description: cloudflare.F("endpoints"),
- DescriptionSearch: cloudflare.F("endpoints"),
- IP: cloudflare.F("1.2.3.4"),
- IPRangeSearch: cloudflare.F("1.2.3.0/16"),
- IPSearch: cloudflare.F("1.2.3.4"),
- Page: cloudflare.F(1.000000),
- PerPage: cloudflare.F(1.000000),
- Priority: cloudflare.F(5.000000),
- URISearch: cloudflare.F("/some/path"),
- },
- )
- 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())
- }
-}
-
-func TestFirewallLockdownDelete(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"),
- )
- _, err := client.Firewall.Lockdowns.Delete(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- "372e67954025e0ba6aaa6d586b9e0b59",
- )
- 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())
- }
-}
-
-func TestFirewallLockdownGet(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"),
- )
- _, err := client.Firewall.Lockdowns.Get(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- "372e67954025e0ba6aaa6d586b9e0b59",
- )
- 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/firewallrule.go b/firewallrule.go
deleted file mode 100644
index ea5d92b8428..00000000000
--- a/firewallrule.go
+++ /dev/null
@@ -1,1600 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
- "reflect"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/option"
- "github.com/tidwall/gjson"
-)
-
-// FirewallRuleService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewFirewallRuleService] method
-// instead.
-type FirewallRuleService struct {
- Options []option.RequestOption
-}
-
-// NewFirewallRuleService generates a new service that applies the given options to
-// each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewFirewallRuleService(opts ...option.RequestOption) (r *FirewallRuleService) {
- r = &FirewallRuleService{}
- r.Options = opts
- return
-}
-
-// Create one or more firewall rules.
-func (r *FirewallRuleService) New(ctx context.Context, zoneIdentifier string, body FirewallRuleNewParams, opts ...option.RequestOption) (res *[]FirewallRuleNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env FirewallRuleNewResponseEnvelope
- path := fmt.Sprintf("zones/%s/firewall/rules", zoneIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Updates an existing firewall rule.
-func (r *FirewallRuleService) Update(ctx context.Context, zoneIdentifier string, id string, body FirewallRuleUpdateParams, opts ...option.RequestOption) (res *FirewallRuleUpdateResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env FirewallRuleUpdateResponseEnvelope
- path := fmt.Sprintf("zones/%s/firewall/rules/%s", zoneIdentifier, id)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Fetches firewall rules in a zone. You can filter the results using several
-// optional parameters.
-func (r *FirewallRuleService) List(ctx context.Context, zoneIdentifier string, query FirewallRuleListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[FirewallRuleListResponse], err error) {
- var raw *http.Response
- opts = append(r.Options, opts...)
- opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
- path := fmt.Sprintf("zones/%s/firewall/rules", zoneIdentifier)
- cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...)
- if err != nil {
- return nil, err
- }
- err = cfg.Execute()
- if err != nil {
- return nil, err
- }
- res.SetPageConfig(cfg, raw)
- return res, nil
-}
-
-// Fetches firewall rules in a zone. You can filter the results using several
-// optional parameters.
-func (r *FirewallRuleService) ListAutoPaging(ctx context.Context, zoneIdentifier string, query FirewallRuleListParams, opts ...option.RequestOption) *shared.V4PagePaginationArrayAutoPager[FirewallRuleListResponse] {
- return shared.NewV4PagePaginationArrayAutoPager(r.List(ctx, zoneIdentifier, query, opts...))
-}
-
-// Deletes an existing firewall rule.
-func (r *FirewallRuleService) Delete(ctx context.Context, zoneIdentifier string, id string, body FirewallRuleDeleteParams, opts ...option.RequestOption) (res *FirewallRuleDeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env FirewallRuleDeleteResponseEnvelope
- path := fmt.Sprintf("zones/%s/firewall/rules/%s", zoneIdentifier, id)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Updates the priority of an existing firewall rule.
-func (r *FirewallRuleService) Edit(ctx context.Context, zoneIdentifier string, id string, body FirewallRuleEditParams, opts ...option.RequestOption) (res *[]FirewallRuleEditResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env FirewallRuleEditResponseEnvelope
- path := fmt.Sprintf("zones/%s/firewall/rules/%s", zoneIdentifier, id)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Fetches the details of a firewall rule.
-func (r *FirewallRuleService) Get(ctx context.Context, zoneIdentifier string, id string, query FirewallRuleGetParams, opts ...option.RequestOption) (res *FirewallRuleGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env FirewallRuleGetResponseEnvelope
- path := fmt.Sprintf("zones/%s/firewall/rules/%s", zoneIdentifier, id)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type FirewallRuleNewResponse struct {
- // The unique identifier of the firewall rule.
- ID string `json:"id,required"`
- // The action to apply to a matched request. The `log` action is only available on
- // an Enterprise plan.
- Action FirewallRuleNewResponseAction `json:"action,required"`
- Filter FirewallRuleNewResponseFilter `json:"filter,required"`
- // When true, indicates that the firewall rule is currently paused.
- Paused bool `json:"paused,required"`
- // An informative summary of the firewall rule.
- Description string `json:"description"`
- // The priority of the rule. Optional value used to define the processing order. A
- // lower number indicates a higher priority. If not provided, rules with a defined
- // priority will be processed before rules without a priority.
- Priority float64 `json:"priority"`
- Products []FirewallRuleNewResponseProduct `json:"products"`
- // A short reference tag. Allows you to select related firewall rules.
- Ref string `json:"ref"`
- JSON firewallRuleNewResponseJSON `json:"-"`
-}
-
-// firewallRuleNewResponseJSON contains the JSON metadata for the struct
-// [FirewallRuleNewResponse]
-type firewallRuleNewResponseJSON struct {
- ID apijson.Field
- Action apijson.Field
- Filter apijson.Field
- Paused apijson.Field
- Description apijson.Field
- Priority apijson.Field
- Products apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallRuleNewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallRuleNewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// The action to apply to a matched request. The `log` action is only available on
-// an Enterprise plan.
-type FirewallRuleNewResponseAction string
-
-const (
- FirewallRuleNewResponseActionBlock FirewallRuleNewResponseAction = "block"
- FirewallRuleNewResponseActionChallenge FirewallRuleNewResponseAction = "challenge"
- FirewallRuleNewResponseActionJsChallenge FirewallRuleNewResponseAction = "js_challenge"
- FirewallRuleNewResponseActionManagedChallenge FirewallRuleNewResponseAction = "managed_challenge"
- FirewallRuleNewResponseActionAllow FirewallRuleNewResponseAction = "allow"
- FirewallRuleNewResponseActionLog FirewallRuleNewResponseAction = "log"
- FirewallRuleNewResponseActionBypass FirewallRuleNewResponseAction = "bypass"
-)
-
-// Union satisfied by [FirewallRuleNewResponseFilterLegacyJhsFilter] or
-// [FirewallRuleNewResponseFilterLegacyJhsDeletedFilter].
-type FirewallRuleNewResponseFilter interface {
- implementsFirewallRuleNewResponseFilter()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*FirewallRuleNewResponseFilter)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(FirewallRuleNewResponseFilterLegacyJhsFilter{}),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(FirewallRuleNewResponseFilterLegacyJhsDeletedFilter{}),
- },
- )
-}
-
-type FirewallRuleNewResponseFilterLegacyJhsFilter struct {
- // The unique identifier of the filter.
- ID string `json:"id"`
- // An informative summary of the filter.
- Description string `json:"description"`
- // The filter expression. For more information, refer to
- // [Expressions](https://developers.cloudflare.com/ruleset-engine/rules-language/expressions/).
- Expression string `json:"expression"`
- // When true, indicates that the filter is currently paused.
- Paused bool `json:"paused"`
- // A short reference tag. Allows you to select related filters.
- Ref string `json:"ref"`
- JSON firewallRuleNewResponseFilterLegacyJhsFilterJSON `json:"-"`
-}
-
-// firewallRuleNewResponseFilterLegacyJhsFilterJSON contains the JSON metadata for
-// the struct [FirewallRuleNewResponseFilterLegacyJhsFilter]
-type firewallRuleNewResponseFilterLegacyJhsFilterJSON struct {
- ID apijson.Field
- Description apijson.Field
- Expression apijson.Field
- Paused apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallRuleNewResponseFilterLegacyJhsFilter) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallRuleNewResponseFilterLegacyJhsFilterJSON) RawJSON() string {
- return r.raw
-}
-
-func (r FirewallRuleNewResponseFilterLegacyJhsFilter) implementsFirewallRuleNewResponseFilter() {}
-
-type FirewallRuleNewResponseFilterLegacyJhsDeletedFilter struct {
- // The unique identifier of the filter.
- ID string `json:"id,required"`
- // When true, indicates that the firewall rule was deleted.
- Deleted bool `json:"deleted,required"`
- JSON firewallRuleNewResponseFilterLegacyJhsDeletedFilterJSON `json:"-"`
-}
-
-// firewallRuleNewResponseFilterLegacyJhsDeletedFilterJSON contains the JSON
-// metadata for the struct [FirewallRuleNewResponseFilterLegacyJhsDeletedFilter]
-type firewallRuleNewResponseFilterLegacyJhsDeletedFilterJSON struct {
- ID apijson.Field
- Deleted apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallRuleNewResponseFilterLegacyJhsDeletedFilter) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallRuleNewResponseFilterLegacyJhsDeletedFilterJSON) RawJSON() string {
- return r.raw
-}
-
-func (r FirewallRuleNewResponseFilterLegacyJhsDeletedFilter) implementsFirewallRuleNewResponseFilter() {
-}
-
-// A list of products to bypass for a request when using the `bypass` action.
-type FirewallRuleNewResponseProduct string
-
-const (
- FirewallRuleNewResponseProductZoneLockdown FirewallRuleNewResponseProduct = "zoneLockdown"
- FirewallRuleNewResponseProductUABlock FirewallRuleNewResponseProduct = "uaBlock"
- FirewallRuleNewResponseProductBic FirewallRuleNewResponseProduct = "bic"
- FirewallRuleNewResponseProductHot FirewallRuleNewResponseProduct = "hot"
- FirewallRuleNewResponseProductSecurityLevel FirewallRuleNewResponseProduct = "securityLevel"
- FirewallRuleNewResponseProductRateLimit FirewallRuleNewResponseProduct = "rateLimit"
- FirewallRuleNewResponseProductWAF FirewallRuleNewResponseProduct = "waf"
-)
-
-type FirewallRuleUpdateResponse struct {
- // The unique identifier of the firewall rule.
- ID string `json:"id,required"`
- // The action to apply to a matched request. The `log` action is only available on
- // an Enterprise plan.
- Action FirewallRuleUpdateResponseAction `json:"action,required"`
- Filter FirewallRuleUpdateResponseFilter `json:"filter,required"`
- // When true, indicates that the firewall rule is currently paused.
- Paused bool `json:"paused,required"`
- // An informative summary of the firewall rule.
- Description string `json:"description"`
- // The priority of the rule. Optional value used to define the processing order. A
- // lower number indicates a higher priority. If not provided, rules with a defined
- // priority will be processed before rules without a priority.
- Priority float64 `json:"priority"`
- Products []FirewallRuleUpdateResponseProduct `json:"products"`
- // A short reference tag. Allows you to select related firewall rules.
- Ref string `json:"ref"`
- JSON firewallRuleUpdateResponseJSON `json:"-"`
-}
-
-// firewallRuleUpdateResponseJSON contains the JSON metadata for the struct
-// [FirewallRuleUpdateResponse]
-type firewallRuleUpdateResponseJSON struct {
- ID apijson.Field
- Action apijson.Field
- Filter apijson.Field
- Paused apijson.Field
- Description apijson.Field
- Priority apijson.Field
- Products apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallRuleUpdateResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallRuleUpdateResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// The action to apply to a matched request. The `log` action is only available on
-// an Enterprise plan.
-type FirewallRuleUpdateResponseAction string
-
-const (
- FirewallRuleUpdateResponseActionBlock FirewallRuleUpdateResponseAction = "block"
- FirewallRuleUpdateResponseActionChallenge FirewallRuleUpdateResponseAction = "challenge"
- FirewallRuleUpdateResponseActionJsChallenge FirewallRuleUpdateResponseAction = "js_challenge"
- FirewallRuleUpdateResponseActionManagedChallenge FirewallRuleUpdateResponseAction = "managed_challenge"
- FirewallRuleUpdateResponseActionAllow FirewallRuleUpdateResponseAction = "allow"
- FirewallRuleUpdateResponseActionLog FirewallRuleUpdateResponseAction = "log"
- FirewallRuleUpdateResponseActionBypass FirewallRuleUpdateResponseAction = "bypass"
-)
-
-// Union satisfied by [FirewallRuleUpdateResponseFilterLegacyJhsFilter] or
-// [FirewallRuleUpdateResponseFilterLegacyJhsDeletedFilter].
-type FirewallRuleUpdateResponseFilter interface {
- implementsFirewallRuleUpdateResponseFilter()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*FirewallRuleUpdateResponseFilter)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(FirewallRuleUpdateResponseFilterLegacyJhsFilter{}),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(FirewallRuleUpdateResponseFilterLegacyJhsDeletedFilter{}),
- },
- )
-}
-
-type FirewallRuleUpdateResponseFilterLegacyJhsFilter struct {
- // The unique identifier of the filter.
- ID string `json:"id"`
- // An informative summary of the filter.
- Description string `json:"description"`
- // The filter expression. For more information, refer to
- // [Expressions](https://developers.cloudflare.com/ruleset-engine/rules-language/expressions/).
- Expression string `json:"expression"`
- // When true, indicates that the filter is currently paused.
- Paused bool `json:"paused"`
- // A short reference tag. Allows you to select related filters.
- Ref string `json:"ref"`
- JSON firewallRuleUpdateResponseFilterLegacyJhsFilterJSON `json:"-"`
-}
-
-// firewallRuleUpdateResponseFilterLegacyJhsFilterJSON contains the JSON metadata
-// for the struct [FirewallRuleUpdateResponseFilterLegacyJhsFilter]
-type firewallRuleUpdateResponseFilterLegacyJhsFilterJSON struct {
- ID apijson.Field
- Description apijson.Field
- Expression apijson.Field
- Paused apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallRuleUpdateResponseFilterLegacyJhsFilter) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallRuleUpdateResponseFilterLegacyJhsFilterJSON) RawJSON() string {
- return r.raw
-}
-
-func (r FirewallRuleUpdateResponseFilterLegacyJhsFilter) implementsFirewallRuleUpdateResponseFilter() {
-}
-
-type FirewallRuleUpdateResponseFilterLegacyJhsDeletedFilter struct {
- // The unique identifier of the filter.
- ID string `json:"id,required"`
- // When true, indicates that the firewall rule was deleted.
- Deleted bool `json:"deleted,required"`
- JSON firewallRuleUpdateResponseFilterLegacyJhsDeletedFilterJSON `json:"-"`
-}
-
-// firewallRuleUpdateResponseFilterLegacyJhsDeletedFilterJSON contains the JSON
-// metadata for the struct [FirewallRuleUpdateResponseFilterLegacyJhsDeletedFilter]
-type firewallRuleUpdateResponseFilterLegacyJhsDeletedFilterJSON struct {
- ID apijson.Field
- Deleted apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallRuleUpdateResponseFilterLegacyJhsDeletedFilter) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallRuleUpdateResponseFilterLegacyJhsDeletedFilterJSON) RawJSON() string {
- return r.raw
-}
-
-func (r FirewallRuleUpdateResponseFilterLegacyJhsDeletedFilter) implementsFirewallRuleUpdateResponseFilter() {
-}
-
-// A list of products to bypass for a request when using the `bypass` action.
-type FirewallRuleUpdateResponseProduct string
-
-const (
- FirewallRuleUpdateResponseProductZoneLockdown FirewallRuleUpdateResponseProduct = "zoneLockdown"
- FirewallRuleUpdateResponseProductUABlock FirewallRuleUpdateResponseProduct = "uaBlock"
- FirewallRuleUpdateResponseProductBic FirewallRuleUpdateResponseProduct = "bic"
- FirewallRuleUpdateResponseProductHot FirewallRuleUpdateResponseProduct = "hot"
- FirewallRuleUpdateResponseProductSecurityLevel FirewallRuleUpdateResponseProduct = "securityLevel"
- FirewallRuleUpdateResponseProductRateLimit FirewallRuleUpdateResponseProduct = "rateLimit"
- FirewallRuleUpdateResponseProductWAF FirewallRuleUpdateResponseProduct = "waf"
-)
-
-type FirewallRuleListResponse struct {
- // The unique identifier of the firewall rule.
- ID string `json:"id,required"`
- // The action to apply to a matched request. The `log` action is only available on
- // an Enterprise plan.
- Action FirewallRuleListResponseAction `json:"action,required"`
- Filter FirewallRuleListResponseFilter `json:"filter,required"`
- // When true, indicates that the firewall rule is currently paused.
- Paused bool `json:"paused,required"`
- // An informative summary of the firewall rule.
- Description string `json:"description"`
- // The priority of the rule. Optional value used to define the processing order. A
- // lower number indicates a higher priority. If not provided, rules with a defined
- // priority will be processed before rules without a priority.
- Priority float64 `json:"priority"`
- Products []FirewallRuleListResponseProduct `json:"products"`
- // A short reference tag. Allows you to select related firewall rules.
- Ref string `json:"ref"`
- JSON firewallRuleListResponseJSON `json:"-"`
-}
-
-// firewallRuleListResponseJSON contains the JSON metadata for the struct
-// [FirewallRuleListResponse]
-type firewallRuleListResponseJSON struct {
- ID apijson.Field
- Action apijson.Field
- Filter apijson.Field
- Paused apijson.Field
- Description apijson.Field
- Priority apijson.Field
- Products apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallRuleListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallRuleListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// The action to apply to a matched request. The `log` action is only available on
-// an Enterprise plan.
-type FirewallRuleListResponseAction string
-
-const (
- FirewallRuleListResponseActionBlock FirewallRuleListResponseAction = "block"
- FirewallRuleListResponseActionChallenge FirewallRuleListResponseAction = "challenge"
- FirewallRuleListResponseActionJsChallenge FirewallRuleListResponseAction = "js_challenge"
- FirewallRuleListResponseActionManagedChallenge FirewallRuleListResponseAction = "managed_challenge"
- FirewallRuleListResponseActionAllow FirewallRuleListResponseAction = "allow"
- FirewallRuleListResponseActionLog FirewallRuleListResponseAction = "log"
- FirewallRuleListResponseActionBypass FirewallRuleListResponseAction = "bypass"
-)
-
-// Union satisfied by [FirewallRuleListResponseFilterLegacyJhsFilter] or
-// [FirewallRuleListResponseFilterLegacyJhsDeletedFilter].
-type FirewallRuleListResponseFilter interface {
- implementsFirewallRuleListResponseFilter()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*FirewallRuleListResponseFilter)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(FirewallRuleListResponseFilterLegacyJhsFilter{}),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(FirewallRuleListResponseFilterLegacyJhsDeletedFilter{}),
- },
- )
-}
-
-type FirewallRuleListResponseFilterLegacyJhsFilter struct {
- // The unique identifier of the filter.
- ID string `json:"id"`
- // An informative summary of the filter.
- Description string `json:"description"`
- // The filter expression. For more information, refer to
- // [Expressions](https://developers.cloudflare.com/ruleset-engine/rules-language/expressions/).
- Expression string `json:"expression"`
- // When true, indicates that the filter is currently paused.
- Paused bool `json:"paused"`
- // A short reference tag. Allows you to select related filters.
- Ref string `json:"ref"`
- JSON firewallRuleListResponseFilterLegacyJhsFilterJSON `json:"-"`
-}
-
-// firewallRuleListResponseFilterLegacyJhsFilterJSON contains the JSON metadata for
-// the struct [FirewallRuleListResponseFilterLegacyJhsFilter]
-type firewallRuleListResponseFilterLegacyJhsFilterJSON struct {
- ID apijson.Field
- Description apijson.Field
- Expression apijson.Field
- Paused apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallRuleListResponseFilterLegacyJhsFilter) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallRuleListResponseFilterLegacyJhsFilterJSON) RawJSON() string {
- return r.raw
-}
-
-func (r FirewallRuleListResponseFilterLegacyJhsFilter) implementsFirewallRuleListResponseFilter() {}
-
-type FirewallRuleListResponseFilterLegacyJhsDeletedFilter struct {
- // The unique identifier of the filter.
- ID string `json:"id,required"`
- // When true, indicates that the firewall rule was deleted.
- Deleted bool `json:"deleted,required"`
- JSON firewallRuleListResponseFilterLegacyJhsDeletedFilterJSON `json:"-"`
-}
-
-// firewallRuleListResponseFilterLegacyJhsDeletedFilterJSON contains the JSON
-// metadata for the struct [FirewallRuleListResponseFilterLegacyJhsDeletedFilter]
-type firewallRuleListResponseFilterLegacyJhsDeletedFilterJSON struct {
- ID apijson.Field
- Deleted apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallRuleListResponseFilterLegacyJhsDeletedFilter) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallRuleListResponseFilterLegacyJhsDeletedFilterJSON) RawJSON() string {
- return r.raw
-}
-
-func (r FirewallRuleListResponseFilterLegacyJhsDeletedFilter) implementsFirewallRuleListResponseFilter() {
-}
-
-// A list of products to bypass for a request when using the `bypass` action.
-type FirewallRuleListResponseProduct string
-
-const (
- FirewallRuleListResponseProductZoneLockdown FirewallRuleListResponseProduct = "zoneLockdown"
- FirewallRuleListResponseProductUABlock FirewallRuleListResponseProduct = "uaBlock"
- FirewallRuleListResponseProductBic FirewallRuleListResponseProduct = "bic"
- FirewallRuleListResponseProductHot FirewallRuleListResponseProduct = "hot"
- FirewallRuleListResponseProductSecurityLevel FirewallRuleListResponseProduct = "securityLevel"
- FirewallRuleListResponseProductRateLimit FirewallRuleListResponseProduct = "rateLimit"
- FirewallRuleListResponseProductWAF FirewallRuleListResponseProduct = "waf"
-)
-
-type FirewallRuleDeleteResponse struct {
- // The unique identifier of the firewall rule.
- ID string `json:"id,required"`
- // The action to apply to a matched request. The `log` action is only available on
- // an Enterprise plan.
- Action FirewallRuleDeleteResponseAction `json:"action"`
- // An informative summary of the firewall rule.
- Description string `json:"description"`
- Filter FirewallRuleDeleteResponseFilter `json:"filter"`
- // When true, indicates that the firewall rule is currently paused.
- Paused bool `json:"paused"`
- // The priority of the rule. Optional value used to define the processing order. A
- // lower number indicates a higher priority. If not provided, rules with a defined
- // priority will be processed before rules without a priority.
- Priority float64 `json:"priority"`
- Products []FirewallRuleDeleteResponseProduct `json:"products"`
- // A short reference tag. Allows you to select related firewall rules.
- Ref string `json:"ref"`
- JSON firewallRuleDeleteResponseJSON `json:"-"`
-}
-
-// firewallRuleDeleteResponseJSON contains the JSON metadata for the struct
-// [FirewallRuleDeleteResponse]
-type firewallRuleDeleteResponseJSON struct {
- ID apijson.Field
- Action apijson.Field
- Description apijson.Field
- Filter apijson.Field
- Paused apijson.Field
- Priority apijson.Field
- Products apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallRuleDeleteResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallRuleDeleteResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// The action to apply to a matched request. The `log` action is only available on
-// an Enterprise plan.
-type FirewallRuleDeleteResponseAction string
-
-const (
- FirewallRuleDeleteResponseActionBlock FirewallRuleDeleteResponseAction = "block"
- FirewallRuleDeleteResponseActionChallenge FirewallRuleDeleteResponseAction = "challenge"
- FirewallRuleDeleteResponseActionJsChallenge FirewallRuleDeleteResponseAction = "js_challenge"
- FirewallRuleDeleteResponseActionManagedChallenge FirewallRuleDeleteResponseAction = "managed_challenge"
- FirewallRuleDeleteResponseActionAllow FirewallRuleDeleteResponseAction = "allow"
- FirewallRuleDeleteResponseActionLog FirewallRuleDeleteResponseAction = "log"
- FirewallRuleDeleteResponseActionBypass FirewallRuleDeleteResponseAction = "bypass"
-)
-
-// Union satisfied by [FirewallRuleDeleteResponseFilterLegacyJhsFilter] or
-// [FirewallRuleDeleteResponseFilterLegacyJhsDeletedFilter].
-type FirewallRuleDeleteResponseFilter interface {
- implementsFirewallRuleDeleteResponseFilter()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*FirewallRuleDeleteResponseFilter)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(FirewallRuleDeleteResponseFilterLegacyJhsFilter{}),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(FirewallRuleDeleteResponseFilterLegacyJhsDeletedFilter{}),
- },
- )
-}
-
-type FirewallRuleDeleteResponseFilterLegacyJhsFilter struct {
- // The unique identifier of the filter.
- ID string `json:"id"`
- // An informative summary of the filter.
- Description string `json:"description"`
- // The filter expression. For more information, refer to
- // [Expressions](https://developers.cloudflare.com/ruleset-engine/rules-language/expressions/).
- Expression string `json:"expression"`
- // When true, indicates that the filter is currently paused.
- Paused bool `json:"paused"`
- // A short reference tag. Allows you to select related filters.
- Ref string `json:"ref"`
- JSON firewallRuleDeleteResponseFilterLegacyJhsFilterJSON `json:"-"`
-}
-
-// firewallRuleDeleteResponseFilterLegacyJhsFilterJSON contains the JSON metadata
-// for the struct [FirewallRuleDeleteResponseFilterLegacyJhsFilter]
-type firewallRuleDeleteResponseFilterLegacyJhsFilterJSON struct {
- ID apijson.Field
- Description apijson.Field
- Expression apijson.Field
- Paused apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallRuleDeleteResponseFilterLegacyJhsFilter) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallRuleDeleteResponseFilterLegacyJhsFilterJSON) RawJSON() string {
- return r.raw
-}
-
-func (r FirewallRuleDeleteResponseFilterLegacyJhsFilter) implementsFirewallRuleDeleteResponseFilter() {
-}
-
-type FirewallRuleDeleteResponseFilterLegacyJhsDeletedFilter struct {
- // The unique identifier of the filter.
- ID string `json:"id,required"`
- // When true, indicates that the firewall rule was deleted.
- Deleted bool `json:"deleted,required"`
- JSON firewallRuleDeleteResponseFilterLegacyJhsDeletedFilterJSON `json:"-"`
-}
-
-// firewallRuleDeleteResponseFilterLegacyJhsDeletedFilterJSON contains the JSON
-// metadata for the struct [FirewallRuleDeleteResponseFilterLegacyJhsDeletedFilter]
-type firewallRuleDeleteResponseFilterLegacyJhsDeletedFilterJSON struct {
- ID apijson.Field
- Deleted apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallRuleDeleteResponseFilterLegacyJhsDeletedFilter) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallRuleDeleteResponseFilterLegacyJhsDeletedFilterJSON) RawJSON() string {
- return r.raw
-}
-
-func (r FirewallRuleDeleteResponseFilterLegacyJhsDeletedFilter) implementsFirewallRuleDeleteResponseFilter() {
-}
-
-// A list of products to bypass for a request when using the `bypass` action.
-type FirewallRuleDeleteResponseProduct string
-
-const (
- FirewallRuleDeleteResponseProductZoneLockdown FirewallRuleDeleteResponseProduct = "zoneLockdown"
- FirewallRuleDeleteResponseProductUABlock FirewallRuleDeleteResponseProduct = "uaBlock"
- FirewallRuleDeleteResponseProductBic FirewallRuleDeleteResponseProduct = "bic"
- FirewallRuleDeleteResponseProductHot FirewallRuleDeleteResponseProduct = "hot"
- FirewallRuleDeleteResponseProductSecurityLevel FirewallRuleDeleteResponseProduct = "securityLevel"
- FirewallRuleDeleteResponseProductRateLimit FirewallRuleDeleteResponseProduct = "rateLimit"
- FirewallRuleDeleteResponseProductWAF FirewallRuleDeleteResponseProduct = "waf"
-)
-
-type FirewallRuleEditResponse struct {
- // The unique identifier of the firewall rule.
- ID string `json:"id,required"`
- // The action to apply to a matched request. The `log` action is only available on
- // an Enterprise plan.
- Action FirewallRuleEditResponseAction `json:"action,required"`
- Filter FirewallRuleEditResponseFilter `json:"filter,required"`
- // When true, indicates that the firewall rule is currently paused.
- Paused bool `json:"paused,required"`
- // An informative summary of the firewall rule.
- Description string `json:"description"`
- // The priority of the rule. Optional value used to define the processing order. A
- // lower number indicates a higher priority. If not provided, rules with a defined
- // priority will be processed before rules without a priority.
- Priority float64 `json:"priority"`
- Products []FirewallRuleEditResponseProduct `json:"products"`
- // A short reference tag. Allows you to select related firewall rules.
- Ref string `json:"ref"`
- JSON firewallRuleEditResponseJSON `json:"-"`
-}
-
-// firewallRuleEditResponseJSON contains the JSON metadata for the struct
-// [FirewallRuleEditResponse]
-type firewallRuleEditResponseJSON struct {
- ID apijson.Field
- Action apijson.Field
- Filter apijson.Field
- Paused apijson.Field
- Description apijson.Field
- Priority apijson.Field
- Products apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallRuleEditResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallRuleEditResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// The action to apply to a matched request. The `log` action is only available on
-// an Enterprise plan.
-type FirewallRuleEditResponseAction string
-
-const (
- FirewallRuleEditResponseActionBlock FirewallRuleEditResponseAction = "block"
- FirewallRuleEditResponseActionChallenge FirewallRuleEditResponseAction = "challenge"
- FirewallRuleEditResponseActionJsChallenge FirewallRuleEditResponseAction = "js_challenge"
- FirewallRuleEditResponseActionManagedChallenge FirewallRuleEditResponseAction = "managed_challenge"
- FirewallRuleEditResponseActionAllow FirewallRuleEditResponseAction = "allow"
- FirewallRuleEditResponseActionLog FirewallRuleEditResponseAction = "log"
- FirewallRuleEditResponseActionBypass FirewallRuleEditResponseAction = "bypass"
-)
-
-// Union satisfied by [FirewallRuleEditResponseFilterLegacyJhsFilter] or
-// [FirewallRuleEditResponseFilterLegacyJhsDeletedFilter].
-type FirewallRuleEditResponseFilter interface {
- implementsFirewallRuleEditResponseFilter()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*FirewallRuleEditResponseFilter)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(FirewallRuleEditResponseFilterLegacyJhsFilter{}),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(FirewallRuleEditResponseFilterLegacyJhsDeletedFilter{}),
- },
- )
-}
-
-type FirewallRuleEditResponseFilterLegacyJhsFilter struct {
- // The unique identifier of the filter.
- ID string `json:"id"`
- // An informative summary of the filter.
- Description string `json:"description"`
- // The filter expression. For more information, refer to
- // [Expressions](https://developers.cloudflare.com/ruleset-engine/rules-language/expressions/).
- Expression string `json:"expression"`
- // When true, indicates that the filter is currently paused.
- Paused bool `json:"paused"`
- // A short reference tag. Allows you to select related filters.
- Ref string `json:"ref"`
- JSON firewallRuleEditResponseFilterLegacyJhsFilterJSON `json:"-"`
-}
-
-// firewallRuleEditResponseFilterLegacyJhsFilterJSON contains the JSON metadata for
-// the struct [FirewallRuleEditResponseFilterLegacyJhsFilter]
-type firewallRuleEditResponseFilterLegacyJhsFilterJSON struct {
- ID apijson.Field
- Description apijson.Field
- Expression apijson.Field
- Paused apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallRuleEditResponseFilterLegacyJhsFilter) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallRuleEditResponseFilterLegacyJhsFilterJSON) RawJSON() string {
- return r.raw
-}
-
-func (r FirewallRuleEditResponseFilterLegacyJhsFilter) implementsFirewallRuleEditResponseFilter() {}
-
-type FirewallRuleEditResponseFilterLegacyJhsDeletedFilter struct {
- // The unique identifier of the filter.
- ID string `json:"id,required"`
- // When true, indicates that the firewall rule was deleted.
- Deleted bool `json:"deleted,required"`
- JSON firewallRuleEditResponseFilterLegacyJhsDeletedFilterJSON `json:"-"`
-}
-
-// firewallRuleEditResponseFilterLegacyJhsDeletedFilterJSON contains the JSON
-// metadata for the struct [FirewallRuleEditResponseFilterLegacyJhsDeletedFilter]
-type firewallRuleEditResponseFilterLegacyJhsDeletedFilterJSON struct {
- ID apijson.Field
- Deleted apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallRuleEditResponseFilterLegacyJhsDeletedFilter) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallRuleEditResponseFilterLegacyJhsDeletedFilterJSON) RawJSON() string {
- return r.raw
-}
-
-func (r FirewallRuleEditResponseFilterLegacyJhsDeletedFilter) implementsFirewallRuleEditResponseFilter() {
-}
-
-// A list of products to bypass for a request when using the `bypass` action.
-type FirewallRuleEditResponseProduct string
-
-const (
- FirewallRuleEditResponseProductZoneLockdown FirewallRuleEditResponseProduct = "zoneLockdown"
- FirewallRuleEditResponseProductUABlock FirewallRuleEditResponseProduct = "uaBlock"
- FirewallRuleEditResponseProductBic FirewallRuleEditResponseProduct = "bic"
- FirewallRuleEditResponseProductHot FirewallRuleEditResponseProduct = "hot"
- FirewallRuleEditResponseProductSecurityLevel FirewallRuleEditResponseProduct = "securityLevel"
- FirewallRuleEditResponseProductRateLimit FirewallRuleEditResponseProduct = "rateLimit"
- FirewallRuleEditResponseProductWAF FirewallRuleEditResponseProduct = "waf"
-)
-
-type FirewallRuleGetResponse struct {
- // The unique identifier of the firewall rule.
- ID string `json:"id,required"`
- // The action to apply to a matched request. The `log` action is only available on
- // an Enterprise plan.
- Action FirewallRuleGetResponseAction `json:"action,required"`
- Filter FirewallRuleGetResponseFilter `json:"filter,required"`
- // When true, indicates that the firewall rule is currently paused.
- Paused bool `json:"paused,required"`
- // An informative summary of the firewall rule.
- Description string `json:"description"`
- // The priority of the rule. Optional value used to define the processing order. A
- // lower number indicates a higher priority. If not provided, rules with a defined
- // priority will be processed before rules without a priority.
- Priority float64 `json:"priority"`
- Products []FirewallRuleGetResponseProduct `json:"products"`
- // A short reference tag. Allows you to select related firewall rules.
- Ref string `json:"ref"`
- JSON firewallRuleGetResponseJSON `json:"-"`
-}
-
-// firewallRuleGetResponseJSON contains the JSON metadata for the struct
-// [FirewallRuleGetResponse]
-type firewallRuleGetResponseJSON struct {
- ID apijson.Field
- Action apijson.Field
- Filter apijson.Field
- Paused apijson.Field
- Description apijson.Field
- Priority apijson.Field
- Products apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallRuleGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallRuleGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// The action to apply to a matched request. The `log` action is only available on
-// an Enterprise plan.
-type FirewallRuleGetResponseAction string
-
-const (
- FirewallRuleGetResponseActionBlock FirewallRuleGetResponseAction = "block"
- FirewallRuleGetResponseActionChallenge FirewallRuleGetResponseAction = "challenge"
- FirewallRuleGetResponseActionJsChallenge FirewallRuleGetResponseAction = "js_challenge"
- FirewallRuleGetResponseActionManagedChallenge FirewallRuleGetResponseAction = "managed_challenge"
- FirewallRuleGetResponseActionAllow FirewallRuleGetResponseAction = "allow"
- FirewallRuleGetResponseActionLog FirewallRuleGetResponseAction = "log"
- FirewallRuleGetResponseActionBypass FirewallRuleGetResponseAction = "bypass"
-)
-
-// Union satisfied by [FirewallRuleGetResponseFilterLegacyJhsFilter] or
-// [FirewallRuleGetResponseFilterLegacyJhsDeletedFilter].
-type FirewallRuleGetResponseFilter interface {
- implementsFirewallRuleGetResponseFilter()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*FirewallRuleGetResponseFilter)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(FirewallRuleGetResponseFilterLegacyJhsFilter{}),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(FirewallRuleGetResponseFilterLegacyJhsDeletedFilter{}),
- },
- )
-}
-
-type FirewallRuleGetResponseFilterLegacyJhsFilter struct {
- // The unique identifier of the filter.
- ID string `json:"id"`
- // An informative summary of the filter.
- Description string `json:"description"`
- // The filter expression. For more information, refer to
- // [Expressions](https://developers.cloudflare.com/ruleset-engine/rules-language/expressions/).
- Expression string `json:"expression"`
- // When true, indicates that the filter is currently paused.
- Paused bool `json:"paused"`
- // A short reference tag. Allows you to select related filters.
- Ref string `json:"ref"`
- JSON firewallRuleGetResponseFilterLegacyJhsFilterJSON `json:"-"`
-}
-
-// firewallRuleGetResponseFilterLegacyJhsFilterJSON contains the JSON metadata for
-// the struct [FirewallRuleGetResponseFilterLegacyJhsFilter]
-type firewallRuleGetResponseFilterLegacyJhsFilterJSON struct {
- ID apijson.Field
- Description apijson.Field
- Expression apijson.Field
- Paused apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallRuleGetResponseFilterLegacyJhsFilter) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallRuleGetResponseFilterLegacyJhsFilterJSON) RawJSON() string {
- return r.raw
-}
-
-func (r FirewallRuleGetResponseFilterLegacyJhsFilter) implementsFirewallRuleGetResponseFilter() {}
-
-type FirewallRuleGetResponseFilterLegacyJhsDeletedFilter struct {
- // The unique identifier of the filter.
- ID string `json:"id,required"`
- // When true, indicates that the firewall rule was deleted.
- Deleted bool `json:"deleted,required"`
- JSON firewallRuleGetResponseFilterLegacyJhsDeletedFilterJSON `json:"-"`
-}
-
-// firewallRuleGetResponseFilterLegacyJhsDeletedFilterJSON contains the JSON
-// metadata for the struct [FirewallRuleGetResponseFilterLegacyJhsDeletedFilter]
-type firewallRuleGetResponseFilterLegacyJhsDeletedFilterJSON struct {
- ID apijson.Field
- Deleted apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallRuleGetResponseFilterLegacyJhsDeletedFilter) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallRuleGetResponseFilterLegacyJhsDeletedFilterJSON) RawJSON() string {
- return r.raw
-}
-
-func (r FirewallRuleGetResponseFilterLegacyJhsDeletedFilter) implementsFirewallRuleGetResponseFilter() {
-}
-
-// A list of products to bypass for a request when using the `bypass` action.
-type FirewallRuleGetResponseProduct string
-
-const (
- FirewallRuleGetResponseProductZoneLockdown FirewallRuleGetResponseProduct = "zoneLockdown"
- FirewallRuleGetResponseProductUABlock FirewallRuleGetResponseProduct = "uaBlock"
- FirewallRuleGetResponseProductBic FirewallRuleGetResponseProduct = "bic"
- FirewallRuleGetResponseProductHot FirewallRuleGetResponseProduct = "hot"
- FirewallRuleGetResponseProductSecurityLevel FirewallRuleGetResponseProduct = "securityLevel"
- FirewallRuleGetResponseProductRateLimit FirewallRuleGetResponseProduct = "rateLimit"
- FirewallRuleGetResponseProductWAF FirewallRuleGetResponseProduct = "waf"
-)
-
-type FirewallRuleNewParams struct {
- Body param.Field[interface{}] `json:"body,required"`
-}
-
-func (r FirewallRuleNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r.Body)
-}
-
-type FirewallRuleNewResponseEnvelope struct {
- Errors []FirewallRuleNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []FirewallRuleNewResponseEnvelopeMessages `json:"messages,required"`
- Result []FirewallRuleNewResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success FirewallRuleNewResponseEnvelopeSuccess `json:"success,required"`
- ResultInfo FirewallRuleNewResponseEnvelopeResultInfo `json:"result_info"`
- JSON firewallRuleNewResponseEnvelopeJSON `json:"-"`
-}
-
-// firewallRuleNewResponseEnvelopeJSON contains the JSON metadata for the struct
-// [FirewallRuleNewResponseEnvelope]
-type firewallRuleNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- ResultInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallRuleNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallRuleNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type FirewallRuleNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON firewallRuleNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// firewallRuleNewResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [FirewallRuleNewResponseEnvelopeErrors]
-type firewallRuleNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallRuleNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallRuleNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type FirewallRuleNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON firewallRuleNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// firewallRuleNewResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [FirewallRuleNewResponseEnvelopeMessages]
-type firewallRuleNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallRuleNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallRuleNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type FirewallRuleNewResponseEnvelopeSuccess bool
-
-const (
- FirewallRuleNewResponseEnvelopeSuccessTrue FirewallRuleNewResponseEnvelopeSuccess = true
-)
-
-type FirewallRuleNewResponseEnvelopeResultInfo struct {
- // Total number of results for the requested service
- Count float64 `json:"count"`
- // Current page within paginated list of results
- Page float64 `json:"page"`
- // Number of results per page of results
- PerPage float64 `json:"per_page"`
- // Total results available without any search parameters
- TotalCount float64 `json:"total_count"`
- JSON firewallRuleNewResponseEnvelopeResultInfoJSON `json:"-"`
-}
-
-// firewallRuleNewResponseEnvelopeResultInfoJSON contains the JSON metadata for the
-// struct [FirewallRuleNewResponseEnvelopeResultInfo]
-type firewallRuleNewResponseEnvelopeResultInfoJSON struct {
- Count apijson.Field
- Page apijson.Field
- PerPage apijson.Field
- TotalCount apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallRuleNewResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallRuleNewResponseEnvelopeResultInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type FirewallRuleUpdateParams struct {
- Body param.Field[interface{}] `json:"body,required"`
-}
-
-func (r FirewallRuleUpdateParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r.Body)
-}
-
-type FirewallRuleUpdateResponseEnvelope struct {
- Errors []FirewallRuleUpdateResponseEnvelopeErrors `json:"errors,required"`
- Messages []FirewallRuleUpdateResponseEnvelopeMessages `json:"messages,required"`
- Result FirewallRuleUpdateResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success FirewallRuleUpdateResponseEnvelopeSuccess `json:"success,required"`
- JSON firewallRuleUpdateResponseEnvelopeJSON `json:"-"`
-}
-
-// firewallRuleUpdateResponseEnvelopeJSON contains the JSON metadata for the struct
-// [FirewallRuleUpdateResponseEnvelope]
-type firewallRuleUpdateResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallRuleUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallRuleUpdateResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type FirewallRuleUpdateResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON firewallRuleUpdateResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// firewallRuleUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [FirewallRuleUpdateResponseEnvelopeErrors]
-type firewallRuleUpdateResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallRuleUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallRuleUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type FirewallRuleUpdateResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON firewallRuleUpdateResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// firewallRuleUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [FirewallRuleUpdateResponseEnvelopeMessages]
-type firewallRuleUpdateResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallRuleUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallRuleUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type FirewallRuleUpdateResponseEnvelopeSuccess bool
-
-const (
- FirewallRuleUpdateResponseEnvelopeSuccessTrue FirewallRuleUpdateResponseEnvelopeSuccess = true
-)
-
-type FirewallRuleListParams struct {
- // The action to search for. Must be an exact match.
- Action param.Field[string] `query:"action"`
- // A case-insensitive string to find in the description.
- Description param.Field[string] `query:"description"`
- // Page number of paginated results.
- Page param.Field[float64] `query:"page"`
- // When true, indicates that the firewall rule is currently paused.
- Paused param.Field[bool] `query:"paused"`
- // Number of firewall rules per page.
- PerPage param.Field[float64] `query:"per_page"`
-}
-
-// URLQuery serializes [FirewallRuleListParams]'s query parameters as `url.Values`.
-func (r FirewallRuleListParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type FirewallRuleDeleteParams struct {
- // When true, indicates that Cloudflare should also delete the associated filter if
- // there are no other firewall rules referencing the filter.
- DeleteFilterIfUnused param.Field[bool] `json:"delete_filter_if_unused"`
-}
-
-func (r FirewallRuleDeleteParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type FirewallRuleDeleteResponseEnvelope struct {
- Errors []FirewallRuleDeleteResponseEnvelopeErrors `json:"errors,required"`
- Messages []FirewallRuleDeleteResponseEnvelopeMessages `json:"messages,required"`
- Result FirewallRuleDeleteResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success FirewallRuleDeleteResponseEnvelopeSuccess `json:"success,required"`
- JSON firewallRuleDeleteResponseEnvelopeJSON `json:"-"`
-}
-
-// firewallRuleDeleteResponseEnvelopeJSON contains the JSON metadata for the struct
-// [FirewallRuleDeleteResponseEnvelope]
-type firewallRuleDeleteResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallRuleDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallRuleDeleteResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type FirewallRuleDeleteResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON firewallRuleDeleteResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// firewallRuleDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [FirewallRuleDeleteResponseEnvelopeErrors]
-type firewallRuleDeleteResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallRuleDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallRuleDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type FirewallRuleDeleteResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON firewallRuleDeleteResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// firewallRuleDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [FirewallRuleDeleteResponseEnvelopeMessages]
-type firewallRuleDeleteResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallRuleDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallRuleDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type FirewallRuleDeleteResponseEnvelopeSuccess bool
-
-const (
- FirewallRuleDeleteResponseEnvelopeSuccessTrue FirewallRuleDeleteResponseEnvelopeSuccess = true
-)
-
-type FirewallRuleEditParams struct {
- Body param.Field[interface{}] `json:"body,required"`
-}
-
-func (r FirewallRuleEditParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r.Body)
-}
-
-type FirewallRuleEditResponseEnvelope struct {
- Errors []FirewallRuleEditResponseEnvelopeErrors `json:"errors,required"`
- Messages []FirewallRuleEditResponseEnvelopeMessages `json:"messages,required"`
- Result []FirewallRuleEditResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success FirewallRuleEditResponseEnvelopeSuccess `json:"success,required"`
- ResultInfo FirewallRuleEditResponseEnvelopeResultInfo `json:"result_info"`
- JSON firewallRuleEditResponseEnvelopeJSON `json:"-"`
-}
-
-// firewallRuleEditResponseEnvelopeJSON contains the JSON metadata for the struct
-// [FirewallRuleEditResponseEnvelope]
-type firewallRuleEditResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- ResultInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallRuleEditResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallRuleEditResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type FirewallRuleEditResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON firewallRuleEditResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// firewallRuleEditResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [FirewallRuleEditResponseEnvelopeErrors]
-type firewallRuleEditResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallRuleEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallRuleEditResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type FirewallRuleEditResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON firewallRuleEditResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// firewallRuleEditResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [FirewallRuleEditResponseEnvelopeMessages]
-type firewallRuleEditResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallRuleEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallRuleEditResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type FirewallRuleEditResponseEnvelopeSuccess bool
-
-const (
- FirewallRuleEditResponseEnvelopeSuccessTrue FirewallRuleEditResponseEnvelopeSuccess = true
-)
-
-type FirewallRuleEditResponseEnvelopeResultInfo struct {
- // Total number of results for the requested service
- Count float64 `json:"count"`
- // Current page within paginated list of results
- Page float64 `json:"page"`
- // Number of results per page of results
- PerPage float64 `json:"per_page"`
- // Total results available without any search parameters
- TotalCount float64 `json:"total_count"`
- JSON firewallRuleEditResponseEnvelopeResultInfoJSON `json:"-"`
-}
-
-// firewallRuleEditResponseEnvelopeResultInfoJSON contains the JSON metadata for
-// the struct [FirewallRuleEditResponseEnvelopeResultInfo]
-type firewallRuleEditResponseEnvelopeResultInfoJSON struct {
- Count apijson.Field
- Page apijson.Field
- PerPage apijson.Field
- TotalCount apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallRuleEditResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallRuleEditResponseEnvelopeResultInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type FirewallRuleGetParams struct {
-}
-
-type FirewallRuleGetResponseEnvelope struct {
- Errors []FirewallRuleGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []FirewallRuleGetResponseEnvelopeMessages `json:"messages,required"`
- Result FirewallRuleGetResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success FirewallRuleGetResponseEnvelopeSuccess `json:"success,required"`
- JSON firewallRuleGetResponseEnvelopeJSON `json:"-"`
-}
-
-// firewallRuleGetResponseEnvelopeJSON contains the JSON metadata for the struct
-// [FirewallRuleGetResponseEnvelope]
-type firewallRuleGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallRuleGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallRuleGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type FirewallRuleGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON firewallRuleGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// firewallRuleGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [FirewallRuleGetResponseEnvelopeErrors]
-type firewallRuleGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallRuleGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallRuleGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type FirewallRuleGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON firewallRuleGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// firewallRuleGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [FirewallRuleGetResponseEnvelopeMessages]
-type firewallRuleGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallRuleGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallRuleGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type FirewallRuleGetResponseEnvelopeSuccess bool
-
-const (
- FirewallRuleGetResponseEnvelopeSuccessTrue FirewallRuleGetResponseEnvelopeSuccess = true
-)
diff --git a/firewallrule_test.go b/firewallrule_test.go
deleted file mode 100644
index 73d6c40e44f..00000000000
--- a/firewallrule_test.go
+++ /dev/null
@@ -1,200 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestFirewallRuleNew(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"),
- )
- _, err := client.Firewall.Rules.New(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.FirewallRuleNewParams{
- Body: cloudflare.F[any](map[string]interface{}{}),
- },
- )
- 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())
- }
-}
-
-func TestFirewallRuleUpdate(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"),
- )
- _, err := client.Firewall.Rules.Update(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- "372e67954025e0ba6aaa6d586b9e0b60",
- cloudflare.FirewallRuleUpdateParams{
- Body: cloudflare.F[any](map[string]interface{}{}),
- },
- )
- 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())
- }
-}
-
-func TestFirewallRuleListWithOptionalParams(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"),
- )
- _, err := client.Firewall.Rules.List(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.FirewallRuleListParams{
- Action: cloudflare.F("block"),
- Description: cloudflare.F("mir"),
- Page: cloudflare.F(1.000000),
- Paused: cloudflare.F(false),
- PerPage: cloudflare.F(5.000000),
- },
- )
- 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())
- }
-}
-
-func TestFirewallRuleDeleteWithOptionalParams(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"),
- )
- _, err := client.Firewall.Rules.Delete(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- "372e67954025e0ba6aaa6d586b9e0b60",
- cloudflare.FirewallRuleDeleteParams{
- DeleteFilterIfUnused: cloudflare.F(true),
- },
- )
- 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())
- }
-}
-
-func TestFirewallRuleEdit(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"),
- )
- _, err := client.Firewall.Rules.Edit(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- "372e67954025e0ba6aaa6d586b9e0b60",
- cloudflare.FirewallRuleEditParams{
- Body: cloudflare.F[any](map[string]interface{}{}),
- },
- )
- 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())
- }
-}
-
-func TestFirewallRuleGet(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"),
- )
- _, err := client.Firewall.Rules.Get(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- "372e67954025e0ba6aaa6d586b9e0b60",
- cloudflare.FirewallRuleGetParams{},
- )
- 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/firewalluarule.go b/firewalluarule.go
deleted file mode 100644
index 567f0fea098..00000000000
--- a/firewalluarule.go
+++ /dev/null
@@ -1,620 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
- "reflect"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/option"
- "github.com/tidwall/gjson"
-)
-
-// FirewallUARuleService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewFirewallUARuleService] method
-// instead.
-type FirewallUARuleService struct {
- Options []option.RequestOption
-}
-
-// NewFirewallUARuleService generates a new service that applies the given options
-// to each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewFirewallUARuleService(opts ...option.RequestOption) (r *FirewallUARuleService) {
- r = &FirewallUARuleService{}
- r.Options = opts
- return
-}
-
-// Creates a new User Agent Blocking rule in a zone.
-func (r *FirewallUARuleService) New(ctx context.Context, zoneIdentifier string, body FirewallUARuleNewParams, opts ...option.RequestOption) (res *FirewallUARuleNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env FirewallUARuleNewResponseEnvelope
- path := fmt.Sprintf("zones/%s/firewall/ua_rules", zoneIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Updates an existing User Agent Blocking rule.
-func (r *FirewallUARuleService) Update(ctx context.Context, zoneIdentifier string, id string, body FirewallUARuleUpdateParams, opts ...option.RequestOption) (res *FirewallUARuleUpdateResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env FirewallUARuleUpdateResponseEnvelope
- path := fmt.Sprintf("zones/%s/firewall/ua_rules/%s", zoneIdentifier, id)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Fetches User Agent Blocking rules in a zone. You can filter the results using
-// several optional parameters.
-func (r *FirewallUARuleService) List(ctx context.Context, zoneIdentifier string, query FirewallUARuleListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[FirewallUARuleListResponse], err error) {
- var raw *http.Response
- opts = append(r.Options, opts...)
- opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
- path := fmt.Sprintf("zones/%s/firewall/ua_rules", zoneIdentifier)
- cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...)
- if err != nil {
- return nil, err
- }
- err = cfg.Execute()
- if err != nil {
- return nil, err
- }
- res.SetPageConfig(cfg, raw)
- return res, nil
-}
-
-// Fetches User Agent Blocking rules in a zone. You can filter the results using
-// several optional parameters.
-func (r *FirewallUARuleService) ListAutoPaging(ctx context.Context, zoneIdentifier string, query FirewallUARuleListParams, opts ...option.RequestOption) *shared.V4PagePaginationArrayAutoPager[FirewallUARuleListResponse] {
- return shared.NewV4PagePaginationArrayAutoPager(r.List(ctx, zoneIdentifier, query, opts...))
-}
-
-// Deletes an existing User Agent Blocking rule.
-func (r *FirewallUARuleService) Delete(ctx context.Context, zoneIdentifier string, id string, opts ...option.RequestOption) (res *FirewallUARuleDeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env FirewallUARuleDeleteResponseEnvelope
- path := fmt.Sprintf("zones/%s/firewall/ua_rules/%s", zoneIdentifier, id)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Fetches the details of a User Agent Blocking rule.
-func (r *FirewallUARuleService) Get(ctx context.Context, zoneIdentifier string, id string, opts ...option.RequestOption) (res *FirewallUARuleGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env FirewallUARuleGetResponseEnvelope
- path := fmt.Sprintf("zones/%s/firewall/ua_rules/%s", zoneIdentifier, id)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Union satisfied by [FirewallUARuleNewResponseUnknown] or [shared.UnionString].
-type FirewallUARuleNewResponse interface {
- ImplementsFirewallUARuleNewResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*FirewallUARuleNewResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-// Union satisfied by [FirewallUARuleUpdateResponseUnknown] or
-// [shared.UnionString].
-type FirewallUARuleUpdateResponse interface {
- ImplementsFirewallUARuleUpdateResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*FirewallUARuleUpdateResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-type FirewallUARuleListResponse struct {
- // The unique identifier of the User Agent Blocking rule.
- ID string `json:"id"`
- // The configuration object for the current rule.
- Configuration FirewallUARuleListResponseConfiguration `json:"configuration"`
- // An informative summary of the rule.
- Description string `json:"description"`
- // The action to apply to a matched request.
- Mode FirewallUARuleListResponseMode `json:"mode"`
- // When true, indicates that the rule is currently paused.
- Paused bool `json:"paused"`
- JSON firewallUARuleListResponseJSON `json:"-"`
-}
-
-// firewallUARuleListResponseJSON contains the JSON metadata for the struct
-// [FirewallUARuleListResponse]
-type firewallUARuleListResponseJSON struct {
- ID apijson.Field
- Configuration apijson.Field
- Description apijson.Field
- Mode apijson.Field
- Paused apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallUARuleListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallUARuleListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// The configuration object for the current rule.
-type FirewallUARuleListResponseConfiguration struct {
- // The configuration target for this rule. You must set the target to `ua` for User
- // Agent Blocking rules.
- Target string `json:"target"`
- // The exact user agent string to match. This value will be compared to the
- // received `User-Agent` HTTP header value.
- Value string `json:"value"`
- JSON firewallUARuleListResponseConfigurationJSON `json:"-"`
-}
-
-// firewallUARuleListResponseConfigurationJSON contains the JSON metadata for the
-// struct [FirewallUARuleListResponseConfiguration]
-type firewallUARuleListResponseConfigurationJSON struct {
- Target apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallUARuleListResponseConfiguration) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallUARuleListResponseConfigurationJSON) RawJSON() string {
- return r.raw
-}
-
-// The action to apply to a matched request.
-type FirewallUARuleListResponseMode string
-
-const (
- FirewallUARuleListResponseModeBlock FirewallUARuleListResponseMode = "block"
- FirewallUARuleListResponseModeChallenge FirewallUARuleListResponseMode = "challenge"
- FirewallUARuleListResponseModeJsChallenge FirewallUARuleListResponseMode = "js_challenge"
- FirewallUARuleListResponseModeManagedChallenge FirewallUARuleListResponseMode = "managed_challenge"
-)
-
-type FirewallUARuleDeleteResponse struct {
- // The unique identifier of the User Agent Blocking rule.
- ID string `json:"id"`
- JSON firewallUARuleDeleteResponseJSON `json:"-"`
-}
-
-// firewallUARuleDeleteResponseJSON contains the JSON metadata for the struct
-// [FirewallUARuleDeleteResponse]
-type firewallUARuleDeleteResponseJSON struct {
- ID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallUARuleDeleteResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallUARuleDeleteResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// Union satisfied by [FirewallUARuleGetResponseUnknown] or [shared.UnionString].
-type FirewallUARuleGetResponse interface {
- ImplementsFirewallUARuleGetResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*FirewallUARuleGetResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-type FirewallUARuleNewParams struct {
- Body param.Field[interface{}] `json:"body,required"`
-}
-
-func (r FirewallUARuleNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r.Body)
-}
-
-type FirewallUARuleNewResponseEnvelope struct {
- Errors []FirewallUARuleNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []FirewallUARuleNewResponseEnvelopeMessages `json:"messages,required"`
- Result FirewallUARuleNewResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success FirewallUARuleNewResponseEnvelopeSuccess `json:"success,required"`
- JSON firewallUARuleNewResponseEnvelopeJSON `json:"-"`
-}
-
-// firewallUARuleNewResponseEnvelopeJSON contains the JSON metadata for the struct
-// [FirewallUARuleNewResponseEnvelope]
-type firewallUARuleNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallUARuleNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallUARuleNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type FirewallUARuleNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON firewallUARuleNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// firewallUARuleNewResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [FirewallUARuleNewResponseEnvelopeErrors]
-type firewallUARuleNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallUARuleNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallUARuleNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type FirewallUARuleNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON firewallUARuleNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// firewallUARuleNewResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [FirewallUARuleNewResponseEnvelopeMessages]
-type firewallUARuleNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallUARuleNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallUARuleNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type FirewallUARuleNewResponseEnvelopeSuccess bool
-
-const (
- FirewallUARuleNewResponseEnvelopeSuccessTrue FirewallUARuleNewResponseEnvelopeSuccess = true
-)
-
-type FirewallUARuleUpdateParams struct {
- Body param.Field[interface{}] `json:"body,required"`
-}
-
-func (r FirewallUARuleUpdateParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r.Body)
-}
-
-type FirewallUARuleUpdateResponseEnvelope struct {
- Errors []FirewallUARuleUpdateResponseEnvelopeErrors `json:"errors,required"`
- Messages []FirewallUARuleUpdateResponseEnvelopeMessages `json:"messages,required"`
- Result FirewallUARuleUpdateResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success FirewallUARuleUpdateResponseEnvelopeSuccess `json:"success,required"`
- JSON firewallUARuleUpdateResponseEnvelopeJSON `json:"-"`
-}
-
-// firewallUARuleUpdateResponseEnvelopeJSON contains the JSON metadata for the
-// struct [FirewallUARuleUpdateResponseEnvelope]
-type firewallUARuleUpdateResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallUARuleUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallUARuleUpdateResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type FirewallUARuleUpdateResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON firewallUARuleUpdateResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// firewallUARuleUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [FirewallUARuleUpdateResponseEnvelopeErrors]
-type firewallUARuleUpdateResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallUARuleUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallUARuleUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type FirewallUARuleUpdateResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON firewallUARuleUpdateResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// firewallUARuleUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [FirewallUARuleUpdateResponseEnvelopeMessages]
-type firewallUARuleUpdateResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallUARuleUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallUARuleUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type FirewallUARuleUpdateResponseEnvelopeSuccess bool
-
-const (
- FirewallUARuleUpdateResponseEnvelopeSuccessTrue FirewallUARuleUpdateResponseEnvelopeSuccess = true
-)
-
-type FirewallUARuleListParams struct {
- // A string to search for in the description of existing rules.
- Description param.Field[string] `query:"description"`
- // A string to search for in the description of existing rules.
- DescriptionSearch param.Field[string] `query:"description_search"`
- // Page number of paginated results.
- Page param.Field[float64] `query:"page"`
- // The maximum number of results per page. You can only set the value to `1` or to
- // a multiple of 5 such as `5`, `10`, `15`, or `20`.
- PerPage param.Field[float64] `query:"per_page"`
- // A string to search for in the user agent values of existing rules.
- UASearch param.Field[string] `query:"ua_search"`
-}
-
-// URLQuery serializes [FirewallUARuleListParams]'s query parameters as
-// `url.Values`.
-func (r FirewallUARuleListParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type FirewallUARuleDeleteResponseEnvelope struct {
- Errors []FirewallUARuleDeleteResponseEnvelopeErrors `json:"errors,required"`
- Messages []FirewallUARuleDeleteResponseEnvelopeMessages `json:"messages,required"`
- Result FirewallUARuleDeleteResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success FirewallUARuleDeleteResponseEnvelopeSuccess `json:"success,required"`
- JSON firewallUARuleDeleteResponseEnvelopeJSON `json:"-"`
-}
-
-// firewallUARuleDeleteResponseEnvelopeJSON contains the JSON metadata for the
-// struct [FirewallUARuleDeleteResponseEnvelope]
-type firewallUARuleDeleteResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallUARuleDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallUARuleDeleteResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type FirewallUARuleDeleteResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON firewallUARuleDeleteResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// firewallUARuleDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [FirewallUARuleDeleteResponseEnvelopeErrors]
-type firewallUARuleDeleteResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallUARuleDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallUARuleDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type FirewallUARuleDeleteResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON firewallUARuleDeleteResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// firewallUARuleDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [FirewallUARuleDeleteResponseEnvelopeMessages]
-type firewallUARuleDeleteResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallUARuleDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallUARuleDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type FirewallUARuleDeleteResponseEnvelopeSuccess bool
-
-const (
- FirewallUARuleDeleteResponseEnvelopeSuccessTrue FirewallUARuleDeleteResponseEnvelopeSuccess = true
-)
-
-type FirewallUARuleGetResponseEnvelope struct {
- Errors []FirewallUARuleGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []FirewallUARuleGetResponseEnvelopeMessages `json:"messages,required"`
- Result FirewallUARuleGetResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success FirewallUARuleGetResponseEnvelopeSuccess `json:"success,required"`
- JSON firewallUARuleGetResponseEnvelopeJSON `json:"-"`
-}
-
-// firewallUARuleGetResponseEnvelopeJSON contains the JSON metadata for the struct
-// [FirewallUARuleGetResponseEnvelope]
-type firewallUARuleGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallUARuleGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallUARuleGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type FirewallUARuleGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON firewallUARuleGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// firewallUARuleGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [FirewallUARuleGetResponseEnvelopeErrors]
-type firewallUARuleGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallUARuleGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallUARuleGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type FirewallUARuleGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON firewallUARuleGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// firewallUARuleGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [FirewallUARuleGetResponseEnvelopeMessages]
-type firewallUARuleGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallUARuleGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallUARuleGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type FirewallUARuleGetResponseEnvelopeSuccess bool
-
-const (
- FirewallUARuleGetResponseEnvelopeSuccessTrue FirewallUARuleGetResponseEnvelopeSuccess = true
-)
diff --git a/firewalluarule_test.go b/firewalluarule_test.go
deleted file mode 100644
index 75a42c56f85..00000000000
--- a/firewalluarule_test.go
+++ /dev/null
@@ -1,165 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestFirewallUARuleNew(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"),
- )
- _, err := client.Firewall.UARules.New(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.FirewallUARuleNewParams{
- Body: cloudflare.F[any](map[string]interface{}{}),
- },
- )
- 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())
- }
-}
-
-func TestFirewallUARuleUpdate(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"),
- )
- _, err := client.Firewall.UARules.Update(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- "372e67954025e0ba6aaa6d586b9e0b59",
- cloudflare.FirewallUARuleUpdateParams{
- Body: cloudflare.F[any](map[string]interface{}{}),
- },
- )
- 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())
- }
-}
-
-func TestFirewallUARuleListWithOptionalParams(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"),
- )
- _, err := client.Firewall.UARules.List(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.FirewallUARuleListParams{
- Description: cloudflare.F("abusive"),
- DescriptionSearch: cloudflare.F("abusive"),
- Page: cloudflare.F(1.000000),
- PerPage: cloudflare.F(1.000000),
- UASearch: cloudflare.F("Safari"),
- },
- )
- 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())
- }
-}
-
-func TestFirewallUARuleDelete(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"),
- )
- _, err := client.Firewall.UARules.Delete(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- "372e67954025e0ba6aaa6d586b9e0b59",
- )
- 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())
- }
-}
-
-func TestFirewallUARuleGet(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"),
- )
- _, err := client.Firewall.UARules.Get(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- "372e67954025e0ba6aaa6d586b9e0b59",
- )
- 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/firewallwaf.go b/firewallwaf.go
deleted file mode 100644
index f01b4f881e1..00000000000
--- a/firewallwaf.go
+++ /dev/null
@@ -1,29 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// FirewallWAFService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewFirewallWAFService] method
-// instead.
-type FirewallWAFService struct {
- Options []option.RequestOption
- Overrides *FirewallWAFOverrideService
- Packages *FirewallWAFPackageService
-}
-
-// NewFirewallWAFService generates a new service that applies the given options to
-// each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewFirewallWAFService(opts ...option.RequestOption) (r *FirewallWAFService) {
- r = &FirewallWAFService{}
- r.Options = opts
- r.Overrides = NewFirewallWAFOverrideService(opts...)
- r.Packages = NewFirewallWAFPackageService(opts...)
- return
-}
diff --git a/firewallwafoverride.go b/firewallwafoverride.go
deleted file mode 100644
index d6a7ac00599..00000000000
--- a/firewallwafoverride.go
+++ /dev/null
@@ -1,934 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// FirewallWAFOverrideService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewFirewallWAFOverrideService]
-// method instead.
-type FirewallWAFOverrideService struct {
- Options []option.RequestOption
-}
-
-// NewFirewallWAFOverrideService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewFirewallWAFOverrideService(opts ...option.RequestOption) (r *FirewallWAFOverrideService) {
- r = &FirewallWAFOverrideService{}
- r.Options = opts
- return
-}
-
-// Creates a URI-based WAF override for a zone.
-//
-// **Note:** Applies only to the
-// [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).
-func (r *FirewallWAFOverrideService) New(ctx context.Context, zoneIdentifier string, body FirewallWAFOverrideNewParams, opts ...option.RequestOption) (res *FirewallWAFOverrideNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env FirewallWAFOverrideNewResponseEnvelope
- path := fmt.Sprintf("zones/%s/firewall/waf/overrides", zoneIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Updates an existing URI-based WAF override.
-//
-// **Note:** Applies only to the
-// [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).
-func (r *FirewallWAFOverrideService) Update(ctx context.Context, zoneIdentifier string, id string, body FirewallWAFOverrideUpdateParams, opts ...option.RequestOption) (res *FirewallWAFOverrideUpdateResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env FirewallWAFOverrideUpdateResponseEnvelope
- path := fmt.Sprintf("zones/%s/firewall/waf/overrides/%s", zoneIdentifier, id)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Fetches the URI-based WAF overrides in a zone.
-//
-// **Note:** Applies only to the
-// [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).
-func (r *FirewallWAFOverrideService) List(ctx context.Context, zoneIdentifier string, query FirewallWAFOverrideListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[FirewallWAFOverrideListResponse], err error) {
- var raw *http.Response
- opts = append(r.Options, opts...)
- opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
- path := fmt.Sprintf("zones/%s/firewall/waf/overrides", zoneIdentifier)
- cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...)
- if err != nil {
- return nil, err
- }
- err = cfg.Execute()
- if err != nil {
- return nil, err
- }
- res.SetPageConfig(cfg, raw)
- return res, nil
-}
-
-// Fetches the URI-based WAF overrides in a zone.
-//
-// **Note:** Applies only to the
-// [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).
-func (r *FirewallWAFOverrideService) ListAutoPaging(ctx context.Context, zoneIdentifier string, query FirewallWAFOverrideListParams, opts ...option.RequestOption) *shared.V4PagePaginationArrayAutoPager[FirewallWAFOverrideListResponse] {
- return shared.NewV4PagePaginationArrayAutoPager(r.List(ctx, zoneIdentifier, query, opts...))
-}
-
-// Deletes an existing URI-based WAF override.
-//
-// **Note:** Applies only to the
-// [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).
-func (r *FirewallWAFOverrideService) Delete(ctx context.Context, zoneIdentifier string, id string, opts ...option.RequestOption) (res *FirewallWAFOverrideDeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env FirewallWAFOverrideDeleteResponseEnvelope
- path := fmt.Sprintf("zones/%s/firewall/waf/overrides/%s", zoneIdentifier, id)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Fetches the details of a URI-based WAF override.
-//
-// **Note:** Applies only to the
-// [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).
-func (r *FirewallWAFOverrideService) Get(ctx context.Context, zoneIdentifier string, id string, opts ...option.RequestOption) (res *FirewallWAFOverrideGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env FirewallWAFOverrideGetResponseEnvelope
- path := fmt.Sprintf("zones/%s/firewall/waf/overrides/%s", zoneIdentifier, id)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type FirewallWAFOverrideNewResponse struct {
- // The unique identifier of the WAF override.
- ID string `json:"id"`
- // An informative summary of the current URI-based WAF override.
- Description string `json:"description,nullable"`
- // An object that allows you to enable or disable WAF rule groups for the current
- // WAF override. Each key of this object must be the ID of a WAF rule group, and
- // each value must be a valid WAF action (usually `default` or `disable`). When
- // creating a new URI-based WAF override, you must provide a `groups` object or a
- // `rules` object.
- Groups map[string]interface{} `json:"groups"`
- // When true, indicates that the WAF package is currently paused.
- Paused bool `json:"paused"`
- // The relative priority of the current URI-based WAF override when multiple
- // overrides match a single URL. A lower number indicates higher priority. Higher
- // priority overrides may overwrite values set by lower priority overrides.
- Priority float64 `json:"priority"`
- // Specifies that, when a WAF rule matches, its configured action will be replaced
- // by the action configured in this object.
- RewriteAction FirewallWAFOverrideNewResponseRewriteAction `json:"rewrite_action"`
- // An object that allows you to override the action of specific WAF rules. Each key
- // of this object must be the ID of a WAF rule, and each value must be a valid WAF
- // action. Unless you are disabling a rule, ensure that you also enable the rule
- // group that this WAF rule belongs to. When creating a new URI-based WAF override,
- // you must provide a `groups` object or a `rules` object.
- Rules map[string]FirewallWAFOverrideNewResponseRule `json:"rules"`
- // The URLs to include in the current WAF override. You can use wildcards. Each
- // entered URL will be escaped before use, which means you can only use simple
- // wildcard patterns.
- URLs []string `json:"urls"`
- JSON firewallWAFOverrideNewResponseJSON `json:"-"`
-}
-
-// firewallWAFOverrideNewResponseJSON contains the JSON metadata for the struct
-// [FirewallWAFOverrideNewResponse]
-type firewallWAFOverrideNewResponseJSON struct {
- ID apijson.Field
- Description apijson.Field
- Groups apijson.Field
- Paused apijson.Field
- Priority apijson.Field
- RewriteAction apijson.Field
- Rules apijson.Field
- URLs apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallWAFOverrideNewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallWAFOverrideNewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// Specifies that, when a WAF rule matches, its configured action will be replaced
-// by the action configured in this object.
-type FirewallWAFOverrideNewResponseRewriteAction struct {
- // The WAF rule action to apply.
- Block FirewallWAFOverrideNewResponseRewriteActionBlock `json:"block"`
- Challenge interface{} `json:"challenge"`
- Default interface{} `json:"default"`
- // The WAF rule action to apply.
- Disable FirewallWAFOverrideNewResponseRewriteActionDisable `json:"disable"`
- Simulate interface{} `json:"simulate"`
- JSON firewallWAFOverrideNewResponseRewriteActionJSON `json:"-"`
-}
-
-// firewallWAFOverrideNewResponseRewriteActionJSON contains the JSON metadata for
-// the struct [FirewallWAFOverrideNewResponseRewriteAction]
-type firewallWAFOverrideNewResponseRewriteActionJSON struct {
- Block apijson.Field
- Challenge apijson.Field
- Default apijson.Field
- Disable apijson.Field
- Simulate apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallWAFOverrideNewResponseRewriteAction) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallWAFOverrideNewResponseRewriteActionJSON) RawJSON() string {
- return r.raw
-}
-
-// The WAF rule action to apply.
-type FirewallWAFOverrideNewResponseRewriteActionBlock string
-
-const (
- FirewallWAFOverrideNewResponseRewriteActionBlockChallenge FirewallWAFOverrideNewResponseRewriteActionBlock = "challenge"
- FirewallWAFOverrideNewResponseRewriteActionBlockBlock FirewallWAFOverrideNewResponseRewriteActionBlock = "block"
- FirewallWAFOverrideNewResponseRewriteActionBlockSimulate FirewallWAFOverrideNewResponseRewriteActionBlock = "simulate"
- FirewallWAFOverrideNewResponseRewriteActionBlockDisable FirewallWAFOverrideNewResponseRewriteActionBlock = "disable"
- FirewallWAFOverrideNewResponseRewriteActionBlockDefault FirewallWAFOverrideNewResponseRewriteActionBlock = "default"
-)
-
-// The WAF rule action to apply.
-type FirewallWAFOverrideNewResponseRewriteActionDisable string
-
-const (
- FirewallWAFOverrideNewResponseRewriteActionDisableChallenge FirewallWAFOverrideNewResponseRewriteActionDisable = "challenge"
- FirewallWAFOverrideNewResponseRewriteActionDisableBlock FirewallWAFOverrideNewResponseRewriteActionDisable = "block"
- FirewallWAFOverrideNewResponseRewriteActionDisableSimulate FirewallWAFOverrideNewResponseRewriteActionDisable = "simulate"
- FirewallWAFOverrideNewResponseRewriteActionDisableDisable FirewallWAFOverrideNewResponseRewriteActionDisable = "disable"
- FirewallWAFOverrideNewResponseRewriteActionDisableDefault FirewallWAFOverrideNewResponseRewriteActionDisable = "default"
-)
-
-// The WAF rule action to apply.
-type FirewallWAFOverrideNewResponseRule string
-
-const (
- FirewallWAFOverrideNewResponseRuleChallenge FirewallWAFOverrideNewResponseRule = "challenge"
- FirewallWAFOverrideNewResponseRuleBlock FirewallWAFOverrideNewResponseRule = "block"
- FirewallWAFOverrideNewResponseRuleSimulate FirewallWAFOverrideNewResponseRule = "simulate"
- FirewallWAFOverrideNewResponseRuleDisable FirewallWAFOverrideNewResponseRule = "disable"
- FirewallWAFOverrideNewResponseRuleDefault FirewallWAFOverrideNewResponseRule = "default"
-)
-
-type FirewallWAFOverrideUpdateResponse struct {
- // The unique identifier of the WAF override.
- ID string `json:"id"`
- // An informative summary of the current URI-based WAF override.
- Description string `json:"description,nullable"`
- // An object that allows you to enable or disable WAF rule groups for the current
- // WAF override. Each key of this object must be the ID of a WAF rule group, and
- // each value must be a valid WAF action (usually `default` or `disable`). When
- // creating a new URI-based WAF override, you must provide a `groups` object or a
- // `rules` object.
- Groups map[string]interface{} `json:"groups"`
- // When true, indicates that the WAF package is currently paused.
- Paused bool `json:"paused"`
- // The relative priority of the current URI-based WAF override when multiple
- // overrides match a single URL. A lower number indicates higher priority. Higher
- // priority overrides may overwrite values set by lower priority overrides.
- Priority float64 `json:"priority"`
- // Specifies that, when a WAF rule matches, its configured action will be replaced
- // by the action configured in this object.
- RewriteAction FirewallWAFOverrideUpdateResponseRewriteAction `json:"rewrite_action"`
- // An object that allows you to override the action of specific WAF rules. Each key
- // of this object must be the ID of a WAF rule, and each value must be a valid WAF
- // action. Unless you are disabling a rule, ensure that you also enable the rule
- // group that this WAF rule belongs to. When creating a new URI-based WAF override,
- // you must provide a `groups` object or a `rules` object.
- Rules map[string]FirewallWAFOverrideUpdateResponseRule `json:"rules"`
- // The URLs to include in the current WAF override. You can use wildcards. Each
- // entered URL will be escaped before use, which means you can only use simple
- // wildcard patterns.
- URLs []string `json:"urls"`
- JSON firewallWAFOverrideUpdateResponseJSON `json:"-"`
-}
-
-// firewallWAFOverrideUpdateResponseJSON contains the JSON metadata for the struct
-// [FirewallWAFOverrideUpdateResponse]
-type firewallWAFOverrideUpdateResponseJSON struct {
- ID apijson.Field
- Description apijson.Field
- Groups apijson.Field
- Paused apijson.Field
- Priority apijson.Field
- RewriteAction apijson.Field
- Rules apijson.Field
- URLs apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallWAFOverrideUpdateResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallWAFOverrideUpdateResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// Specifies that, when a WAF rule matches, its configured action will be replaced
-// by the action configured in this object.
-type FirewallWAFOverrideUpdateResponseRewriteAction struct {
- // The WAF rule action to apply.
- Block FirewallWAFOverrideUpdateResponseRewriteActionBlock `json:"block"`
- Challenge interface{} `json:"challenge"`
- Default interface{} `json:"default"`
- // The WAF rule action to apply.
- Disable FirewallWAFOverrideUpdateResponseRewriteActionDisable `json:"disable"`
- Simulate interface{} `json:"simulate"`
- JSON firewallWAFOverrideUpdateResponseRewriteActionJSON `json:"-"`
-}
-
-// firewallWAFOverrideUpdateResponseRewriteActionJSON contains the JSON metadata
-// for the struct [FirewallWAFOverrideUpdateResponseRewriteAction]
-type firewallWAFOverrideUpdateResponseRewriteActionJSON struct {
- Block apijson.Field
- Challenge apijson.Field
- Default apijson.Field
- Disable apijson.Field
- Simulate apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallWAFOverrideUpdateResponseRewriteAction) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallWAFOverrideUpdateResponseRewriteActionJSON) RawJSON() string {
- return r.raw
-}
-
-// The WAF rule action to apply.
-type FirewallWAFOverrideUpdateResponseRewriteActionBlock string
-
-const (
- FirewallWAFOverrideUpdateResponseRewriteActionBlockChallenge FirewallWAFOverrideUpdateResponseRewriteActionBlock = "challenge"
- FirewallWAFOverrideUpdateResponseRewriteActionBlockBlock FirewallWAFOverrideUpdateResponseRewriteActionBlock = "block"
- FirewallWAFOverrideUpdateResponseRewriteActionBlockSimulate FirewallWAFOverrideUpdateResponseRewriteActionBlock = "simulate"
- FirewallWAFOverrideUpdateResponseRewriteActionBlockDisable FirewallWAFOverrideUpdateResponseRewriteActionBlock = "disable"
- FirewallWAFOverrideUpdateResponseRewriteActionBlockDefault FirewallWAFOverrideUpdateResponseRewriteActionBlock = "default"
-)
-
-// The WAF rule action to apply.
-type FirewallWAFOverrideUpdateResponseRewriteActionDisable string
-
-const (
- FirewallWAFOverrideUpdateResponseRewriteActionDisableChallenge FirewallWAFOverrideUpdateResponseRewriteActionDisable = "challenge"
- FirewallWAFOverrideUpdateResponseRewriteActionDisableBlock FirewallWAFOverrideUpdateResponseRewriteActionDisable = "block"
- FirewallWAFOverrideUpdateResponseRewriteActionDisableSimulate FirewallWAFOverrideUpdateResponseRewriteActionDisable = "simulate"
- FirewallWAFOverrideUpdateResponseRewriteActionDisableDisable FirewallWAFOverrideUpdateResponseRewriteActionDisable = "disable"
- FirewallWAFOverrideUpdateResponseRewriteActionDisableDefault FirewallWAFOverrideUpdateResponseRewriteActionDisable = "default"
-)
-
-// The WAF rule action to apply.
-type FirewallWAFOverrideUpdateResponseRule string
-
-const (
- FirewallWAFOverrideUpdateResponseRuleChallenge FirewallWAFOverrideUpdateResponseRule = "challenge"
- FirewallWAFOverrideUpdateResponseRuleBlock FirewallWAFOverrideUpdateResponseRule = "block"
- FirewallWAFOverrideUpdateResponseRuleSimulate FirewallWAFOverrideUpdateResponseRule = "simulate"
- FirewallWAFOverrideUpdateResponseRuleDisable FirewallWAFOverrideUpdateResponseRule = "disable"
- FirewallWAFOverrideUpdateResponseRuleDefault FirewallWAFOverrideUpdateResponseRule = "default"
-)
-
-type FirewallWAFOverrideListResponse struct {
- // The unique identifier of the WAF override.
- ID string `json:"id,required"`
- // When true, indicates that the WAF package is currently paused.
- Paused bool `json:"paused,required"`
- // The relative priority of the current URI-based WAF override when multiple
- // overrides match a single URL. A lower number indicates higher priority. Higher
- // priority overrides may overwrite values set by lower priority overrides.
- Priority float64 `json:"priority,required"`
- // The URLs to include in the current WAF override. You can use wildcards. Each
- // entered URL will be escaped before use, which means you can only use simple
- // wildcard patterns.
- URLs []string `json:"urls,required"`
- // An informative summary of the current URI-based WAF override.
- Description string `json:"description,nullable"`
- // An object that allows you to enable or disable WAF rule groups for the current
- // WAF override. Each key of this object must be the ID of a WAF rule group, and
- // each value must be a valid WAF action (usually `default` or `disable`). When
- // creating a new URI-based WAF override, you must provide a `groups` object or a
- // `rules` object.
- Groups map[string]interface{} `json:"groups"`
- // Specifies that, when a WAF rule matches, its configured action will be replaced
- // by the action configured in this object.
- RewriteAction FirewallWAFOverrideListResponseRewriteAction `json:"rewrite_action"`
- // An object that allows you to override the action of specific WAF rules. Each key
- // of this object must be the ID of a WAF rule, and each value must be a valid WAF
- // action. Unless you are disabling a rule, ensure that you also enable the rule
- // group that this WAF rule belongs to. When creating a new URI-based WAF override,
- // you must provide a `groups` object or a `rules` object.
- Rules map[string]FirewallWAFOverrideListResponseRule `json:"rules"`
- JSON firewallWAFOverrideListResponseJSON `json:"-"`
-}
-
-// firewallWAFOverrideListResponseJSON contains the JSON metadata for the struct
-// [FirewallWAFOverrideListResponse]
-type firewallWAFOverrideListResponseJSON struct {
- ID apijson.Field
- Paused apijson.Field
- Priority apijson.Field
- URLs apijson.Field
- Description apijson.Field
- Groups apijson.Field
- RewriteAction apijson.Field
- Rules apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallWAFOverrideListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallWAFOverrideListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// Specifies that, when a WAF rule matches, its configured action will be replaced
-// by the action configured in this object.
-type FirewallWAFOverrideListResponseRewriteAction struct {
- // The WAF rule action to apply.
- Block FirewallWAFOverrideListResponseRewriteActionBlock `json:"block"`
- Challenge interface{} `json:"challenge"`
- Default interface{} `json:"default"`
- // The WAF rule action to apply.
- Disable FirewallWAFOverrideListResponseRewriteActionDisable `json:"disable"`
- Simulate interface{} `json:"simulate"`
- JSON firewallWAFOverrideListResponseRewriteActionJSON `json:"-"`
-}
-
-// firewallWAFOverrideListResponseRewriteActionJSON contains the JSON metadata for
-// the struct [FirewallWAFOverrideListResponseRewriteAction]
-type firewallWAFOverrideListResponseRewriteActionJSON struct {
- Block apijson.Field
- Challenge apijson.Field
- Default apijson.Field
- Disable apijson.Field
- Simulate apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallWAFOverrideListResponseRewriteAction) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallWAFOverrideListResponseRewriteActionJSON) RawJSON() string {
- return r.raw
-}
-
-// The WAF rule action to apply.
-type FirewallWAFOverrideListResponseRewriteActionBlock string
-
-const (
- FirewallWAFOverrideListResponseRewriteActionBlockChallenge FirewallWAFOverrideListResponseRewriteActionBlock = "challenge"
- FirewallWAFOverrideListResponseRewriteActionBlockBlock FirewallWAFOverrideListResponseRewriteActionBlock = "block"
- FirewallWAFOverrideListResponseRewriteActionBlockSimulate FirewallWAFOverrideListResponseRewriteActionBlock = "simulate"
- FirewallWAFOverrideListResponseRewriteActionBlockDisable FirewallWAFOverrideListResponseRewriteActionBlock = "disable"
- FirewallWAFOverrideListResponseRewriteActionBlockDefault FirewallWAFOverrideListResponseRewriteActionBlock = "default"
-)
-
-// The WAF rule action to apply.
-type FirewallWAFOverrideListResponseRewriteActionDisable string
-
-const (
- FirewallWAFOverrideListResponseRewriteActionDisableChallenge FirewallWAFOverrideListResponseRewriteActionDisable = "challenge"
- FirewallWAFOverrideListResponseRewriteActionDisableBlock FirewallWAFOverrideListResponseRewriteActionDisable = "block"
- FirewallWAFOverrideListResponseRewriteActionDisableSimulate FirewallWAFOverrideListResponseRewriteActionDisable = "simulate"
- FirewallWAFOverrideListResponseRewriteActionDisableDisable FirewallWAFOverrideListResponseRewriteActionDisable = "disable"
- FirewallWAFOverrideListResponseRewriteActionDisableDefault FirewallWAFOverrideListResponseRewriteActionDisable = "default"
-)
-
-// The WAF rule action to apply.
-type FirewallWAFOverrideListResponseRule string
-
-const (
- FirewallWAFOverrideListResponseRuleChallenge FirewallWAFOverrideListResponseRule = "challenge"
- FirewallWAFOverrideListResponseRuleBlock FirewallWAFOverrideListResponseRule = "block"
- FirewallWAFOverrideListResponseRuleSimulate FirewallWAFOverrideListResponseRule = "simulate"
- FirewallWAFOverrideListResponseRuleDisable FirewallWAFOverrideListResponseRule = "disable"
- FirewallWAFOverrideListResponseRuleDefault FirewallWAFOverrideListResponseRule = "default"
-)
-
-type FirewallWAFOverrideDeleteResponse struct {
- // The unique identifier of the WAF override.
- ID string `json:"id"`
- JSON firewallWAFOverrideDeleteResponseJSON `json:"-"`
-}
-
-// firewallWAFOverrideDeleteResponseJSON contains the JSON metadata for the struct
-// [FirewallWAFOverrideDeleteResponse]
-type firewallWAFOverrideDeleteResponseJSON struct {
- ID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallWAFOverrideDeleteResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallWAFOverrideDeleteResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type FirewallWAFOverrideGetResponse struct {
- // The unique identifier of the WAF override.
- ID string `json:"id"`
- // An informative summary of the current URI-based WAF override.
- Description string `json:"description,nullable"`
- // An object that allows you to enable or disable WAF rule groups for the current
- // WAF override. Each key of this object must be the ID of a WAF rule group, and
- // each value must be a valid WAF action (usually `default` or `disable`). When
- // creating a new URI-based WAF override, you must provide a `groups` object or a
- // `rules` object.
- Groups map[string]interface{} `json:"groups"`
- // When true, indicates that the WAF package is currently paused.
- Paused bool `json:"paused"`
- // The relative priority of the current URI-based WAF override when multiple
- // overrides match a single URL. A lower number indicates higher priority. Higher
- // priority overrides may overwrite values set by lower priority overrides.
- Priority float64 `json:"priority"`
- // Specifies that, when a WAF rule matches, its configured action will be replaced
- // by the action configured in this object.
- RewriteAction FirewallWAFOverrideGetResponseRewriteAction `json:"rewrite_action"`
- // An object that allows you to override the action of specific WAF rules. Each key
- // of this object must be the ID of a WAF rule, and each value must be a valid WAF
- // action. Unless you are disabling a rule, ensure that you also enable the rule
- // group that this WAF rule belongs to. When creating a new URI-based WAF override,
- // you must provide a `groups` object or a `rules` object.
- Rules map[string]FirewallWAFOverrideGetResponseRule `json:"rules"`
- // The URLs to include in the current WAF override. You can use wildcards. Each
- // entered URL will be escaped before use, which means you can only use simple
- // wildcard patterns.
- URLs []string `json:"urls"`
- JSON firewallWAFOverrideGetResponseJSON `json:"-"`
-}
-
-// firewallWAFOverrideGetResponseJSON contains the JSON metadata for the struct
-// [FirewallWAFOverrideGetResponse]
-type firewallWAFOverrideGetResponseJSON struct {
- ID apijson.Field
- Description apijson.Field
- Groups apijson.Field
- Paused apijson.Field
- Priority apijson.Field
- RewriteAction apijson.Field
- Rules apijson.Field
- URLs apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallWAFOverrideGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallWAFOverrideGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// Specifies that, when a WAF rule matches, its configured action will be replaced
-// by the action configured in this object.
-type FirewallWAFOverrideGetResponseRewriteAction struct {
- // The WAF rule action to apply.
- Block FirewallWAFOverrideGetResponseRewriteActionBlock `json:"block"`
- Challenge interface{} `json:"challenge"`
- Default interface{} `json:"default"`
- // The WAF rule action to apply.
- Disable FirewallWAFOverrideGetResponseRewriteActionDisable `json:"disable"`
- Simulate interface{} `json:"simulate"`
- JSON firewallWAFOverrideGetResponseRewriteActionJSON `json:"-"`
-}
-
-// firewallWAFOverrideGetResponseRewriteActionJSON contains the JSON metadata for
-// the struct [FirewallWAFOverrideGetResponseRewriteAction]
-type firewallWAFOverrideGetResponseRewriteActionJSON struct {
- Block apijson.Field
- Challenge apijson.Field
- Default apijson.Field
- Disable apijson.Field
- Simulate apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallWAFOverrideGetResponseRewriteAction) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallWAFOverrideGetResponseRewriteActionJSON) RawJSON() string {
- return r.raw
-}
-
-// The WAF rule action to apply.
-type FirewallWAFOverrideGetResponseRewriteActionBlock string
-
-const (
- FirewallWAFOverrideGetResponseRewriteActionBlockChallenge FirewallWAFOverrideGetResponseRewriteActionBlock = "challenge"
- FirewallWAFOverrideGetResponseRewriteActionBlockBlock FirewallWAFOverrideGetResponseRewriteActionBlock = "block"
- FirewallWAFOverrideGetResponseRewriteActionBlockSimulate FirewallWAFOverrideGetResponseRewriteActionBlock = "simulate"
- FirewallWAFOverrideGetResponseRewriteActionBlockDisable FirewallWAFOverrideGetResponseRewriteActionBlock = "disable"
- FirewallWAFOverrideGetResponseRewriteActionBlockDefault FirewallWAFOverrideGetResponseRewriteActionBlock = "default"
-)
-
-// The WAF rule action to apply.
-type FirewallWAFOverrideGetResponseRewriteActionDisable string
-
-const (
- FirewallWAFOverrideGetResponseRewriteActionDisableChallenge FirewallWAFOverrideGetResponseRewriteActionDisable = "challenge"
- FirewallWAFOverrideGetResponseRewriteActionDisableBlock FirewallWAFOverrideGetResponseRewriteActionDisable = "block"
- FirewallWAFOverrideGetResponseRewriteActionDisableSimulate FirewallWAFOverrideGetResponseRewriteActionDisable = "simulate"
- FirewallWAFOverrideGetResponseRewriteActionDisableDisable FirewallWAFOverrideGetResponseRewriteActionDisable = "disable"
- FirewallWAFOverrideGetResponseRewriteActionDisableDefault FirewallWAFOverrideGetResponseRewriteActionDisable = "default"
-)
-
-// The WAF rule action to apply.
-type FirewallWAFOverrideGetResponseRule string
-
-const (
- FirewallWAFOverrideGetResponseRuleChallenge FirewallWAFOverrideGetResponseRule = "challenge"
- FirewallWAFOverrideGetResponseRuleBlock FirewallWAFOverrideGetResponseRule = "block"
- FirewallWAFOverrideGetResponseRuleSimulate FirewallWAFOverrideGetResponseRule = "simulate"
- FirewallWAFOverrideGetResponseRuleDisable FirewallWAFOverrideGetResponseRule = "disable"
- FirewallWAFOverrideGetResponseRuleDefault FirewallWAFOverrideGetResponseRule = "default"
-)
-
-type FirewallWAFOverrideNewParams struct {
- Body param.Field[interface{}] `json:"body,required"`
-}
-
-func (r FirewallWAFOverrideNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r.Body)
-}
-
-type FirewallWAFOverrideNewResponseEnvelope struct {
- Errors []FirewallWAFOverrideNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []FirewallWAFOverrideNewResponseEnvelopeMessages `json:"messages,required"`
- Result FirewallWAFOverrideNewResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success FirewallWAFOverrideNewResponseEnvelopeSuccess `json:"success,required"`
- JSON firewallWAFOverrideNewResponseEnvelopeJSON `json:"-"`
-}
-
-// firewallWAFOverrideNewResponseEnvelopeJSON contains the JSON metadata for the
-// struct [FirewallWAFOverrideNewResponseEnvelope]
-type firewallWAFOverrideNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallWAFOverrideNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallWAFOverrideNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type FirewallWAFOverrideNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON firewallWAFOverrideNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// firewallWAFOverrideNewResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [FirewallWAFOverrideNewResponseEnvelopeErrors]
-type firewallWAFOverrideNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallWAFOverrideNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallWAFOverrideNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type FirewallWAFOverrideNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON firewallWAFOverrideNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// firewallWAFOverrideNewResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [FirewallWAFOverrideNewResponseEnvelopeMessages]
-type firewallWAFOverrideNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallWAFOverrideNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallWAFOverrideNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type FirewallWAFOverrideNewResponseEnvelopeSuccess bool
-
-const (
- FirewallWAFOverrideNewResponseEnvelopeSuccessTrue FirewallWAFOverrideNewResponseEnvelopeSuccess = true
-)
-
-type FirewallWAFOverrideUpdateParams struct {
- Body param.Field[interface{}] `json:"body,required"`
-}
-
-func (r FirewallWAFOverrideUpdateParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r.Body)
-}
-
-type FirewallWAFOverrideUpdateResponseEnvelope struct {
- Errors []FirewallWAFOverrideUpdateResponseEnvelopeErrors `json:"errors,required"`
- Messages []FirewallWAFOverrideUpdateResponseEnvelopeMessages `json:"messages,required"`
- Result FirewallWAFOverrideUpdateResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success FirewallWAFOverrideUpdateResponseEnvelopeSuccess `json:"success,required"`
- JSON firewallWAFOverrideUpdateResponseEnvelopeJSON `json:"-"`
-}
-
-// firewallWAFOverrideUpdateResponseEnvelopeJSON contains the JSON metadata for the
-// struct [FirewallWAFOverrideUpdateResponseEnvelope]
-type firewallWAFOverrideUpdateResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallWAFOverrideUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallWAFOverrideUpdateResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type FirewallWAFOverrideUpdateResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON firewallWAFOverrideUpdateResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// firewallWAFOverrideUpdateResponseEnvelopeErrorsJSON contains the JSON metadata
-// for the struct [FirewallWAFOverrideUpdateResponseEnvelopeErrors]
-type firewallWAFOverrideUpdateResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallWAFOverrideUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallWAFOverrideUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type FirewallWAFOverrideUpdateResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON firewallWAFOverrideUpdateResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// firewallWAFOverrideUpdateResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [FirewallWAFOverrideUpdateResponseEnvelopeMessages]
-type firewallWAFOverrideUpdateResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallWAFOverrideUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallWAFOverrideUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type FirewallWAFOverrideUpdateResponseEnvelopeSuccess bool
-
-const (
- FirewallWAFOverrideUpdateResponseEnvelopeSuccessTrue FirewallWAFOverrideUpdateResponseEnvelopeSuccess = true
-)
-
-type FirewallWAFOverrideListParams struct {
- // The page number of paginated results.
- Page param.Field[float64] `query:"page"`
- // The number of WAF overrides per page.
- PerPage param.Field[float64] `query:"per_page"`
-}
-
-// URLQuery serializes [FirewallWAFOverrideListParams]'s query parameters as
-// `url.Values`.
-func (r FirewallWAFOverrideListParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type FirewallWAFOverrideDeleteResponseEnvelope struct {
- Result FirewallWAFOverrideDeleteResponse `json:"result"`
- JSON firewallWAFOverrideDeleteResponseEnvelopeJSON `json:"-"`
-}
-
-// firewallWAFOverrideDeleteResponseEnvelopeJSON contains the JSON metadata for the
-// struct [FirewallWAFOverrideDeleteResponseEnvelope]
-type firewallWAFOverrideDeleteResponseEnvelopeJSON struct {
- Result apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallWAFOverrideDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallWAFOverrideDeleteResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type FirewallWAFOverrideGetResponseEnvelope struct {
- Errors []FirewallWAFOverrideGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []FirewallWAFOverrideGetResponseEnvelopeMessages `json:"messages,required"`
- Result FirewallWAFOverrideGetResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success FirewallWAFOverrideGetResponseEnvelopeSuccess `json:"success,required"`
- JSON firewallWAFOverrideGetResponseEnvelopeJSON `json:"-"`
-}
-
-// firewallWAFOverrideGetResponseEnvelopeJSON contains the JSON metadata for the
-// struct [FirewallWAFOverrideGetResponseEnvelope]
-type firewallWAFOverrideGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallWAFOverrideGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallWAFOverrideGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type FirewallWAFOverrideGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON firewallWAFOverrideGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// firewallWAFOverrideGetResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [FirewallWAFOverrideGetResponseEnvelopeErrors]
-type firewallWAFOverrideGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallWAFOverrideGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallWAFOverrideGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type FirewallWAFOverrideGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON firewallWAFOverrideGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// firewallWAFOverrideGetResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [FirewallWAFOverrideGetResponseEnvelopeMessages]
-type firewallWAFOverrideGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallWAFOverrideGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallWAFOverrideGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type FirewallWAFOverrideGetResponseEnvelopeSuccess bool
-
-const (
- FirewallWAFOverrideGetResponseEnvelopeSuccessTrue FirewallWAFOverrideGetResponseEnvelopeSuccess = true
-)
diff --git a/firewallwafoverride_test.go b/firewallwafoverride_test.go
deleted file mode 100644
index 7cb808c63e6..00000000000
--- a/firewallwafoverride_test.go
+++ /dev/null
@@ -1,162 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestFirewallWAFOverrideNew(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"),
- )
- _, err := client.Firewall.WAF.Overrides.New(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.FirewallWAFOverrideNewParams{
- Body: cloudflare.F[any](map[string]interface{}{}),
- },
- )
- 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())
- }
-}
-
-func TestFirewallWAFOverrideUpdate(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"),
- )
- _, err := client.Firewall.WAF.Overrides.Update(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- "de677e5818985db1285d0e80225f06e5",
- cloudflare.FirewallWAFOverrideUpdateParams{
- Body: cloudflare.F[any](map[string]interface{}{}),
- },
- )
- 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())
- }
-}
-
-func TestFirewallWAFOverrideListWithOptionalParams(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"),
- )
- _, err := client.Firewall.WAF.Overrides.List(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.FirewallWAFOverrideListParams{
- Page: cloudflare.F(1.000000),
- PerPage: cloudflare.F(5.000000),
- },
- )
- 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())
- }
-}
-
-func TestFirewallWAFOverrideDelete(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"),
- )
- _, err := client.Firewall.WAF.Overrides.Delete(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- "de677e5818985db1285d0e80225f06e5",
- )
- 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())
- }
-}
-
-func TestFirewallWAFOverrideGet(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"),
- )
- _, err := client.Firewall.WAF.Overrides.Get(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- "de677e5818985db1285d0e80225f06e5",
- )
- 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/firewallwafpackage.go b/firewallwafpackage.go
deleted file mode 100644
index 07ee56d166a..00000000000
--- a/firewallwafpackage.go
+++ /dev/null
@@ -1,654 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
- "reflect"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/option"
- "github.com/tidwall/gjson"
-)
-
-// FirewallWAFPackageService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewFirewallWAFPackageService] method
-// instead.
-type FirewallWAFPackageService struct {
- Options []option.RequestOption
- Groups *FirewallWAFPackageGroupService
- Rules *FirewallWAFPackageRuleService
-}
-
-// NewFirewallWAFPackageService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewFirewallWAFPackageService(opts ...option.RequestOption) (r *FirewallWAFPackageService) {
- r = &FirewallWAFPackageService{}
- r.Options = opts
- r.Groups = NewFirewallWAFPackageGroupService(opts...)
- r.Rules = NewFirewallWAFPackageRuleService(opts...)
- return
-}
-
-// Fetches WAF packages for a zone.
-//
-// **Note:** Applies only to the
-// [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).
-func (r *FirewallWAFPackageService) List(ctx context.Context, zoneIdentifier string, query FirewallWAFPackageListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[FirewallWAFPackageListResponse], err error) {
- var raw *http.Response
- opts = append(r.Options, opts...)
- opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
- path := fmt.Sprintf("zones/%s/firewall/waf/packages", zoneIdentifier)
- cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...)
- if err != nil {
- return nil, err
- }
- err = cfg.Execute()
- if err != nil {
- return nil, err
- }
- res.SetPageConfig(cfg, raw)
- return res, nil
-}
-
-// Fetches WAF packages for a zone.
-//
-// **Note:** Applies only to the
-// [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).
-func (r *FirewallWAFPackageService) ListAutoPaging(ctx context.Context, zoneIdentifier string, query FirewallWAFPackageListParams, opts ...option.RequestOption) *shared.V4PagePaginationArrayAutoPager[FirewallWAFPackageListResponse] {
- return shared.NewV4PagePaginationArrayAutoPager(r.List(ctx, zoneIdentifier, query, opts...))
-}
-
-// Fetches the details of a WAF package.
-//
-// **Note:** Applies only to the
-// [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).
-func (r *FirewallWAFPackageService) Get(ctx context.Context, zoneIdentifier string, identifier string, opts ...option.RequestOption) (res *FirewallWAFPackageGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- path := fmt.Sprintf("zones/%s/firewall/waf/packages/%s", zoneIdentifier, identifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &res, opts...)
- return
-}
-
-// Union satisfied by
-// [FirewallWAFPackageListResponseLegacyJhsAPIResponseCollection] or
-// [FirewallWAFPackageListResponseObject].
-type FirewallWAFPackageListResponse interface {
- implementsFirewallWAFPackageListResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*FirewallWAFPackageListResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(FirewallWAFPackageListResponseLegacyJhsAPIResponseCollection{}),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(FirewallWAFPackageListResponseObject{}),
- },
- )
-}
-
-type FirewallWAFPackageListResponseLegacyJhsAPIResponseCollection struct {
- Errors []FirewallWAFPackageListResponseLegacyJhsAPIResponseCollectionError `json:"errors,required"`
- Messages []FirewallWAFPackageListResponseLegacyJhsAPIResponseCollectionMessage `json:"messages,required"`
- Result FirewallWAFPackageListResponseLegacyJhsAPIResponseCollectionResult `json:"result,required,nullable"`
- // Whether the API call was successful
- Success FirewallWAFPackageListResponseLegacyJhsAPIResponseCollectionSuccess `json:"success,required"`
- ResultInfo FirewallWAFPackageListResponseLegacyJhsAPIResponseCollectionResultInfo `json:"result_info"`
- JSON firewallWAFPackageListResponseLegacyJhsAPIResponseCollectionJSON `json:"-"`
-}
-
-// firewallWAFPackageListResponseLegacyJhsAPIResponseCollectionJSON contains the
-// JSON metadata for the struct
-// [FirewallWAFPackageListResponseLegacyJhsAPIResponseCollection]
-type firewallWAFPackageListResponseLegacyJhsAPIResponseCollectionJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- ResultInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallWAFPackageListResponseLegacyJhsAPIResponseCollection) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallWAFPackageListResponseLegacyJhsAPIResponseCollectionJSON) RawJSON() string {
- return r.raw
-}
-
-func (r FirewallWAFPackageListResponseLegacyJhsAPIResponseCollection) implementsFirewallWAFPackageListResponse() {
-}
-
-type FirewallWAFPackageListResponseLegacyJhsAPIResponseCollectionError struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON firewallWAFPackageListResponseLegacyJhsAPIResponseCollectionErrorJSON `json:"-"`
-}
-
-// firewallWAFPackageListResponseLegacyJhsAPIResponseCollectionErrorJSON contains
-// the JSON metadata for the struct
-// [FirewallWAFPackageListResponseLegacyJhsAPIResponseCollectionError]
-type firewallWAFPackageListResponseLegacyJhsAPIResponseCollectionErrorJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallWAFPackageListResponseLegacyJhsAPIResponseCollectionError) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallWAFPackageListResponseLegacyJhsAPIResponseCollectionErrorJSON) RawJSON() string {
- return r.raw
-}
-
-type FirewallWAFPackageListResponseLegacyJhsAPIResponseCollectionMessage struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON firewallWAFPackageListResponseLegacyJhsAPIResponseCollectionMessageJSON `json:"-"`
-}
-
-// firewallWAFPackageListResponseLegacyJhsAPIResponseCollectionMessageJSON contains
-// the JSON metadata for the struct
-// [FirewallWAFPackageListResponseLegacyJhsAPIResponseCollectionMessage]
-type firewallWAFPackageListResponseLegacyJhsAPIResponseCollectionMessageJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallWAFPackageListResponseLegacyJhsAPIResponseCollectionMessage) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallWAFPackageListResponseLegacyJhsAPIResponseCollectionMessageJSON) RawJSON() string {
- return r.raw
-}
-
-// Union satisfied by
-// [FirewallWAFPackageListResponseLegacyJhsAPIResponseCollectionResultUnknown],
-// [FirewallWAFPackageListResponseLegacyJhsAPIResponseCollectionResultArray] or
-// [shared.UnionString].
-type FirewallWAFPackageListResponseLegacyJhsAPIResponseCollectionResult interface {
- ImplementsFirewallWAFPackageListResponseLegacyJhsAPIResponseCollectionResult()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*FirewallWAFPackageListResponseLegacyJhsAPIResponseCollectionResult)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(FirewallWAFPackageListResponseLegacyJhsAPIResponseCollectionResultArray{}),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-type FirewallWAFPackageListResponseLegacyJhsAPIResponseCollectionResultArray []interface{}
-
-func (r FirewallWAFPackageListResponseLegacyJhsAPIResponseCollectionResultArray) ImplementsFirewallWAFPackageListResponseLegacyJhsAPIResponseCollectionResult() {
-}
-
-// Whether the API call was successful
-type FirewallWAFPackageListResponseLegacyJhsAPIResponseCollectionSuccess bool
-
-const (
- FirewallWAFPackageListResponseLegacyJhsAPIResponseCollectionSuccessTrue FirewallWAFPackageListResponseLegacyJhsAPIResponseCollectionSuccess = true
-)
-
-type FirewallWAFPackageListResponseLegacyJhsAPIResponseCollectionResultInfo struct {
- // Total number of results for the requested service
- Count float64 `json:"count"`
- // Current page within paginated list of results
- Page float64 `json:"page"`
- // Number of results per page of results
- PerPage float64 `json:"per_page"`
- // Total results available without any search parameters
- TotalCount float64 `json:"total_count"`
- JSON firewallWAFPackageListResponseLegacyJhsAPIResponseCollectionResultInfoJSON `json:"-"`
-}
-
-// firewallWAFPackageListResponseLegacyJhsAPIResponseCollectionResultInfoJSON
-// contains the JSON metadata for the struct
-// [FirewallWAFPackageListResponseLegacyJhsAPIResponseCollectionResultInfo]
-type firewallWAFPackageListResponseLegacyJhsAPIResponseCollectionResultInfoJSON struct {
- Count apijson.Field
- Page apijson.Field
- PerPage apijson.Field
- TotalCount apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallWAFPackageListResponseLegacyJhsAPIResponseCollectionResultInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallWAFPackageListResponseLegacyJhsAPIResponseCollectionResultInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type FirewallWAFPackageListResponseObject struct {
- Result []FirewallWAFPackageListResponseObjectResult `json:"result"`
- JSON firewallWAFPackageListResponseObjectJSON `json:"-"`
-}
-
-// firewallWAFPackageListResponseObjectJSON contains the JSON metadata for the
-// struct [FirewallWAFPackageListResponseObject]
-type firewallWAFPackageListResponseObjectJSON struct {
- Result apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallWAFPackageListResponseObject) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallWAFPackageListResponseObjectJSON) RawJSON() string {
- return r.raw
-}
-
-func (r FirewallWAFPackageListResponseObject) implementsFirewallWAFPackageListResponse() {}
-
-// Union satisfied by
-// [FirewallWAFPackageListResponseObjectResultLegacyJhsPackageDefinition] or
-// [FirewallWAFPackageListResponseObjectResultLegacyJhsAnomalyPackage].
-type FirewallWAFPackageListResponseObjectResult interface {
- implementsFirewallWAFPackageListResponseObjectResult()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*FirewallWAFPackageListResponseObjectResult)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(FirewallWAFPackageListResponseObjectResultLegacyJhsPackageDefinition{}),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(FirewallWAFPackageListResponseObjectResultLegacyJhsAnomalyPackage{}),
- },
- )
-}
-
-type FirewallWAFPackageListResponseObjectResultLegacyJhsPackageDefinition struct {
- // The unique identifier of a WAF package.
- ID string `json:"id,required"`
- // A summary of the purpose/function of the WAF package.
- Description string `json:"description,required"`
- // The mode that defines how rules within the package are evaluated during the
- // course of a request. When a package uses anomaly detection mode (`anomaly`
- // value), each rule is given a score when triggered. If the total score of all
- // triggered rules exceeds the sensitivity defined in the WAF package, the action
- // configured in the package will be performed. Traditional detection mode
- // (`traditional` value) will decide the action to take when it is triggered by the
- // request. If multiple rules are triggered, the action providing the highest
- // protection will be applied (for example, a 'block' action will win over a
- // 'challenge' action).
- DetectionMode FirewallWAFPackageListResponseObjectResultLegacyJhsPackageDefinitionDetectionMode `json:"detection_mode,required"`
- // The name of the WAF package.
- Name string `json:"name,required"`
- // Identifier
- ZoneID string `json:"zone_id,required"`
- // When set to `active`, indicates that the WAF package will be applied to the
- // zone.
- Status FirewallWAFPackageListResponseObjectResultLegacyJhsPackageDefinitionStatus `json:"status"`
- JSON firewallWAFPackageListResponseObjectResultLegacyJhsPackageDefinitionJSON `json:"-"`
-}
-
-// firewallWAFPackageListResponseObjectResultLegacyJhsPackageDefinitionJSON
-// contains the JSON metadata for the struct
-// [FirewallWAFPackageListResponseObjectResultLegacyJhsPackageDefinition]
-type firewallWAFPackageListResponseObjectResultLegacyJhsPackageDefinitionJSON struct {
- ID apijson.Field
- Description apijson.Field
- DetectionMode apijson.Field
- Name apijson.Field
- ZoneID apijson.Field
- Status apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallWAFPackageListResponseObjectResultLegacyJhsPackageDefinition) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallWAFPackageListResponseObjectResultLegacyJhsPackageDefinitionJSON) RawJSON() string {
- return r.raw
-}
-
-func (r FirewallWAFPackageListResponseObjectResultLegacyJhsPackageDefinition) implementsFirewallWAFPackageListResponseObjectResult() {
-}
-
-// The mode that defines how rules within the package are evaluated during the
-// course of a request. When a package uses anomaly detection mode (`anomaly`
-// value), each rule is given a score when triggered. If the total score of all
-// triggered rules exceeds the sensitivity defined in the WAF package, the action
-// configured in the package will be performed. Traditional detection mode
-// (`traditional` value) will decide the action to take when it is triggered by the
-// request. If multiple rules are triggered, the action providing the highest
-// protection will be applied (for example, a 'block' action will win over a
-// 'challenge' action).
-type FirewallWAFPackageListResponseObjectResultLegacyJhsPackageDefinitionDetectionMode string
-
-const (
- FirewallWAFPackageListResponseObjectResultLegacyJhsPackageDefinitionDetectionModeAnomaly FirewallWAFPackageListResponseObjectResultLegacyJhsPackageDefinitionDetectionMode = "anomaly"
- FirewallWAFPackageListResponseObjectResultLegacyJhsPackageDefinitionDetectionModeTraditional FirewallWAFPackageListResponseObjectResultLegacyJhsPackageDefinitionDetectionMode = "traditional"
-)
-
-// When set to `active`, indicates that the WAF package will be applied to the
-// zone.
-type FirewallWAFPackageListResponseObjectResultLegacyJhsPackageDefinitionStatus string
-
-const (
- FirewallWAFPackageListResponseObjectResultLegacyJhsPackageDefinitionStatusActive FirewallWAFPackageListResponseObjectResultLegacyJhsPackageDefinitionStatus = "active"
-)
-
-type FirewallWAFPackageListResponseObjectResultLegacyJhsAnomalyPackage struct {
- // The unique identifier of a WAF package.
- ID string `json:"id,required"`
- // A summary of the purpose/function of the WAF package.
- Description string `json:"description,required"`
- // When a WAF package uses anomaly detection, each rule is given a score when
- // triggered. If the total score of all triggered rules exceeds the sensitivity
- // defined on the WAF package, the action defined on the package will be taken.
- DetectionMode FirewallWAFPackageListResponseObjectResultLegacyJhsAnomalyPackageDetectionMode `json:"detection_mode,required"`
- // The name of the WAF package.
- Name string `json:"name,required"`
- // Identifier
- ZoneID string `json:"zone_id,required"`
- // The default action performed by the rules in the WAF package.
- ActionMode FirewallWAFPackageListResponseObjectResultLegacyJhsAnomalyPackageActionMode `json:"action_mode"`
- // The sensitivity of the WAF package.
- Sensitivity FirewallWAFPackageListResponseObjectResultLegacyJhsAnomalyPackageSensitivity `json:"sensitivity"`
- // When set to `active`, indicates that the WAF package will be applied to the
- // zone.
- Status FirewallWAFPackageListResponseObjectResultLegacyJhsAnomalyPackageStatus `json:"status"`
- JSON firewallWAFPackageListResponseObjectResultLegacyJhsAnomalyPackageJSON `json:"-"`
-}
-
-// firewallWAFPackageListResponseObjectResultLegacyJhsAnomalyPackageJSON contains
-// the JSON metadata for the struct
-// [FirewallWAFPackageListResponseObjectResultLegacyJhsAnomalyPackage]
-type firewallWAFPackageListResponseObjectResultLegacyJhsAnomalyPackageJSON struct {
- ID apijson.Field
- Description apijson.Field
- DetectionMode apijson.Field
- Name apijson.Field
- ZoneID apijson.Field
- ActionMode apijson.Field
- Sensitivity apijson.Field
- Status apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallWAFPackageListResponseObjectResultLegacyJhsAnomalyPackage) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallWAFPackageListResponseObjectResultLegacyJhsAnomalyPackageJSON) RawJSON() string {
- return r.raw
-}
-
-func (r FirewallWAFPackageListResponseObjectResultLegacyJhsAnomalyPackage) implementsFirewallWAFPackageListResponseObjectResult() {
-}
-
-// When a WAF package uses anomaly detection, each rule is given a score when
-// triggered. If the total score of all triggered rules exceeds the sensitivity
-// defined on the WAF package, the action defined on the package will be taken.
-type FirewallWAFPackageListResponseObjectResultLegacyJhsAnomalyPackageDetectionMode string
-
-const (
- FirewallWAFPackageListResponseObjectResultLegacyJhsAnomalyPackageDetectionModeAnomaly FirewallWAFPackageListResponseObjectResultLegacyJhsAnomalyPackageDetectionMode = "anomaly"
- FirewallWAFPackageListResponseObjectResultLegacyJhsAnomalyPackageDetectionModeTraditional FirewallWAFPackageListResponseObjectResultLegacyJhsAnomalyPackageDetectionMode = "traditional"
-)
-
-// The default action performed by the rules in the WAF package.
-type FirewallWAFPackageListResponseObjectResultLegacyJhsAnomalyPackageActionMode string
-
-const (
- FirewallWAFPackageListResponseObjectResultLegacyJhsAnomalyPackageActionModeSimulate FirewallWAFPackageListResponseObjectResultLegacyJhsAnomalyPackageActionMode = "simulate"
- FirewallWAFPackageListResponseObjectResultLegacyJhsAnomalyPackageActionModeBlock FirewallWAFPackageListResponseObjectResultLegacyJhsAnomalyPackageActionMode = "block"
- FirewallWAFPackageListResponseObjectResultLegacyJhsAnomalyPackageActionModeChallenge FirewallWAFPackageListResponseObjectResultLegacyJhsAnomalyPackageActionMode = "challenge"
-)
-
-// The sensitivity of the WAF package.
-type FirewallWAFPackageListResponseObjectResultLegacyJhsAnomalyPackageSensitivity string
-
-const (
- FirewallWAFPackageListResponseObjectResultLegacyJhsAnomalyPackageSensitivityHigh FirewallWAFPackageListResponseObjectResultLegacyJhsAnomalyPackageSensitivity = "high"
- FirewallWAFPackageListResponseObjectResultLegacyJhsAnomalyPackageSensitivityMedium FirewallWAFPackageListResponseObjectResultLegacyJhsAnomalyPackageSensitivity = "medium"
- FirewallWAFPackageListResponseObjectResultLegacyJhsAnomalyPackageSensitivityLow FirewallWAFPackageListResponseObjectResultLegacyJhsAnomalyPackageSensitivity = "low"
- FirewallWAFPackageListResponseObjectResultLegacyJhsAnomalyPackageSensitivityOff FirewallWAFPackageListResponseObjectResultLegacyJhsAnomalyPackageSensitivity = "off"
-)
-
-// When set to `active`, indicates that the WAF package will be applied to the
-// zone.
-type FirewallWAFPackageListResponseObjectResultLegacyJhsAnomalyPackageStatus string
-
-const (
- FirewallWAFPackageListResponseObjectResultLegacyJhsAnomalyPackageStatusActive FirewallWAFPackageListResponseObjectResultLegacyJhsAnomalyPackageStatus = "active"
-)
-
-// Union satisfied by [FirewallWAFPackageGetResponseLegacyJhsAPIResponseSingle] or
-// [FirewallWAFPackageGetResponseObject].
-type FirewallWAFPackageGetResponse interface {
- implementsFirewallWAFPackageGetResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*FirewallWAFPackageGetResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(FirewallWAFPackageGetResponseLegacyJhsAPIResponseSingle{}),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(FirewallWAFPackageGetResponseObject{}),
- },
- )
-}
-
-type FirewallWAFPackageGetResponseLegacyJhsAPIResponseSingle struct {
- Errors []FirewallWAFPackageGetResponseLegacyJhsAPIResponseSingleError `json:"errors,required"`
- Messages []FirewallWAFPackageGetResponseLegacyJhsAPIResponseSingleMessage `json:"messages,required"`
- Result FirewallWAFPackageGetResponseLegacyJhsAPIResponseSingleResult `json:"result,required,nullable"`
- // Whether the API call was successful
- Success FirewallWAFPackageGetResponseLegacyJhsAPIResponseSingleSuccess `json:"success,required"`
- JSON firewallWAFPackageGetResponseLegacyJhsAPIResponseSingleJSON `json:"-"`
-}
-
-// firewallWAFPackageGetResponseLegacyJhsAPIResponseSingleJSON contains the JSON
-// metadata for the struct
-// [FirewallWAFPackageGetResponseLegacyJhsAPIResponseSingle]
-type firewallWAFPackageGetResponseLegacyJhsAPIResponseSingleJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallWAFPackageGetResponseLegacyJhsAPIResponseSingle) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallWAFPackageGetResponseLegacyJhsAPIResponseSingleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r FirewallWAFPackageGetResponseLegacyJhsAPIResponseSingle) implementsFirewallWAFPackageGetResponse() {
-}
-
-type FirewallWAFPackageGetResponseLegacyJhsAPIResponseSingleError struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON firewallWAFPackageGetResponseLegacyJhsAPIResponseSingleErrorJSON `json:"-"`
-}
-
-// firewallWAFPackageGetResponseLegacyJhsAPIResponseSingleErrorJSON contains the
-// JSON metadata for the struct
-// [FirewallWAFPackageGetResponseLegacyJhsAPIResponseSingleError]
-type firewallWAFPackageGetResponseLegacyJhsAPIResponseSingleErrorJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallWAFPackageGetResponseLegacyJhsAPIResponseSingleError) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallWAFPackageGetResponseLegacyJhsAPIResponseSingleErrorJSON) RawJSON() string {
- return r.raw
-}
-
-type FirewallWAFPackageGetResponseLegacyJhsAPIResponseSingleMessage struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON firewallWAFPackageGetResponseLegacyJhsAPIResponseSingleMessageJSON `json:"-"`
-}
-
-// firewallWAFPackageGetResponseLegacyJhsAPIResponseSingleMessageJSON contains the
-// JSON metadata for the struct
-// [FirewallWAFPackageGetResponseLegacyJhsAPIResponseSingleMessage]
-type firewallWAFPackageGetResponseLegacyJhsAPIResponseSingleMessageJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallWAFPackageGetResponseLegacyJhsAPIResponseSingleMessage) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallWAFPackageGetResponseLegacyJhsAPIResponseSingleMessageJSON) RawJSON() string {
- return r.raw
-}
-
-// Union satisfied by
-// [FirewallWAFPackageGetResponseLegacyJhsAPIResponseSingleResultUnknown] or
-// [shared.UnionString].
-type FirewallWAFPackageGetResponseLegacyJhsAPIResponseSingleResult interface {
- ImplementsFirewallWAFPackageGetResponseLegacyJhsAPIResponseSingleResult()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*FirewallWAFPackageGetResponseLegacyJhsAPIResponseSingleResult)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-// Whether the API call was successful
-type FirewallWAFPackageGetResponseLegacyJhsAPIResponseSingleSuccess bool
-
-const (
- FirewallWAFPackageGetResponseLegacyJhsAPIResponseSingleSuccessTrue FirewallWAFPackageGetResponseLegacyJhsAPIResponseSingleSuccess = true
-)
-
-type FirewallWAFPackageGetResponseObject struct {
- Result interface{} `json:"result"`
- JSON firewallWAFPackageGetResponseObjectJSON `json:"-"`
-}
-
-// firewallWAFPackageGetResponseObjectJSON contains the JSON metadata for the
-// struct [FirewallWAFPackageGetResponseObject]
-type firewallWAFPackageGetResponseObjectJSON struct {
- Result apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallWAFPackageGetResponseObject) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallWAFPackageGetResponseObjectJSON) RawJSON() string {
- return r.raw
-}
-
-func (r FirewallWAFPackageGetResponseObject) implementsFirewallWAFPackageGetResponse() {}
-
-type FirewallWAFPackageListParams struct {
- // The direction used to sort returned packages.
- Direction param.Field[FirewallWAFPackageListParamsDirection] `query:"direction"`
- // When set to `all`, all the search requirements must match. When set to `any`,
- // only one of the search requirements has to match.
- Match param.Field[FirewallWAFPackageListParamsMatch] `query:"match"`
- // The field used to sort returned packages.
- Order param.Field[FirewallWAFPackageListParamsOrder] `query:"order"`
- // The page number of paginated results.
- Page param.Field[float64] `query:"page"`
- // The number of packages per page.
- PerPage param.Field[float64] `query:"per_page"`
-}
-
-// URLQuery serializes [FirewallWAFPackageListParams]'s query parameters as
-// `url.Values`.
-func (r FirewallWAFPackageListParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// The direction used to sort returned packages.
-type FirewallWAFPackageListParamsDirection string
-
-const (
- FirewallWAFPackageListParamsDirectionAsc FirewallWAFPackageListParamsDirection = "asc"
- FirewallWAFPackageListParamsDirectionDesc FirewallWAFPackageListParamsDirection = "desc"
-)
-
-// When set to `all`, all the search requirements must match. When set to `any`,
-// only one of the search requirements has to match.
-type FirewallWAFPackageListParamsMatch string
-
-const (
- FirewallWAFPackageListParamsMatchAny FirewallWAFPackageListParamsMatch = "any"
- FirewallWAFPackageListParamsMatchAll FirewallWAFPackageListParamsMatch = "all"
-)
-
-// The field used to sort returned packages.
-type FirewallWAFPackageListParamsOrder string
-
-const (
- FirewallWAFPackageListParamsOrderName FirewallWAFPackageListParamsOrder = "name"
-)
diff --git a/firewallwafpackage_test.go b/firewallwafpackage_test.go
deleted file mode 100644
index 49923c49245..00000000000
--- a/firewallwafpackage_test.go
+++ /dev/null
@@ -1,76 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestFirewallWAFPackageListWithOptionalParams(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"),
- )
- _, err := client.Firewall.WAF.Packages.List(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.FirewallWAFPackageListParams{
- Direction: cloudflare.F(cloudflare.FirewallWAFPackageListParamsDirectionDesc),
- Match: cloudflare.F(cloudflare.FirewallWAFPackageListParamsMatchAny),
- Order: cloudflare.F(cloudflare.FirewallWAFPackageListParamsOrderName),
- Page: cloudflare.F(1.000000),
- PerPage: cloudflare.F(5.000000),
- },
- )
- 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())
- }
-}
-
-func TestFirewallWAFPackageGet(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"),
- )
- _, err := client.Firewall.WAF.Packages.Get(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- "a25a9a7e9c00afc1fb2e0245519d725b",
- )
- 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/firewallwafpackagegroup.go b/firewallwafpackagegroup.go
deleted file mode 100644
index bec77cd10db..00000000000
--- a/firewallwafpackagegroup.go
+++ /dev/null
@@ -1,462 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
- "reflect"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/option"
- "github.com/tidwall/gjson"
-)
-
-// FirewallWAFPackageGroupService contains methods and other services that help
-// with interacting with the cloudflare API. Note, unlike clients, this service
-// does not read variables from the environment automatically. You should not
-// instantiate this service directly, and instead use the
-// [NewFirewallWAFPackageGroupService] method instead.
-type FirewallWAFPackageGroupService struct {
- Options []option.RequestOption
-}
-
-// NewFirewallWAFPackageGroupService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewFirewallWAFPackageGroupService(opts ...option.RequestOption) (r *FirewallWAFPackageGroupService) {
- r = &FirewallWAFPackageGroupService{}
- r.Options = opts
- return
-}
-
-// Fetches the WAF rule groups in a WAF package.
-//
-// **Note:** Applies only to the
-// [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).
-func (r *FirewallWAFPackageGroupService) List(ctx context.Context, packageID string, params FirewallWAFPackageGroupListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[FirewallWAFPackageGroupListResponse], err error) {
- var raw *http.Response
- opts = append(r.Options, opts...)
- opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
- path := fmt.Sprintf("zones/%s/firewall/waf/packages/%s/groups", params.ZoneID, packageID)
- cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, params, &res, opts...)
- if err != nil {
- return nil, err
- }
- err = cfg.Execute()
- if err != nil {
- return nil, err
- }
- res.SetPageConfig(cfg, raw)
- return res, nil
-}
-
-// Fetches the WAF rule groups in a WAF package.
-//
-// **Note:** Applies only to the
-// [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).
-func (r *FirewallWAFPackageGroupService) ListAutoPaging(ctx context.Context, packageID string, params FirewallWAFPackageGroupListParams, opts ...option.RequestOption) *shared.V4PagePaginationArrayAutoPager[FirewallWAFPackageGroupListResponse] {
- return shared.NewV4PagePaginationArrayAutoPager(r.List(ctx, packageID, params, opts...))
-}
-
-// Updates a WAF rule group. You can update the state (`mode` parameter) of a rule
-// group.
-//
-// **Note:** Applies only to the
-// [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).
-func (r *FirewallWAFPackageGroupService) Edit(ctx context.Context, packageID string, groupID string, params FirewallWAFPackageGroupEditParams, opts ...option.RequestOption) (res *FirewallWAFPackageGroupEditResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env FirewallWAFPackageGroupEditResponseEnvelope
- path := fmt.Sprintf("zones/%s/firewall/waf/packages/%s/groups/%s", params.ZoneID, packageID, groupID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Fetches the details of a WAF rule group.
-//
-// **Note:** Applies only to the
-// [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).
-func (r *FirewallWAFPackageGroupService) Get(ctx context.Context, packageID string, groupID string, query FirewallWAFPackageGroupGetParams, opts ...option.RequestOption) (res *FirewallWAFPackageGroupGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env FirewallWAFPackageGroupGetResponseEnvelope
- path := fmt.Sprintf("zones/%s/firewall/waf/packages/%s/groups/%s", query.ZoneID, packageID, groupID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type FirewallWAFPackageGroupListResponse struct {
- // The unique identifier of the rule group.
- ID string `json:"id,required"`
- // An informative summary of what the rule group does.
- Description string `json:"description,required,nullable"`
- // The state of the rules contained in the rule group. When `on`, the rules in the
- // group are configurable/usable.
- Mode FirewallWAFPackageGroupListResponseMode `json:"mode,required"`
- // The name of the rule group.
- Name string `json:"name,required"`
- // The number of rules in the current rule group.
- RulesCount float64 `json:"rules_count,required"`
- // The available states for the rule group.
- AllowedModes []FirewallWAFPackageGroupListResponseAllowedMode `json:"allowed_modes"`
- // The number of rules within the group that have been modified from their default
- // configuration.
- ModifiedRulesCount float64 `json:"modified_rules_count"`
- // The unique identifier of a WAF package.
- PackageID string `json:"package_id"`
- JSON firewallWAFPackageGroupListResponseJSON `json:"-"`
-}
-
-// firewallWAFPackageGroupListResponseJSON contains the JSON metadata for the
-// struct [FirewallWAFPackageGroupListResponse]
-type firewallWAFPackageGroupListResponseJSON struct {
- ID apijson.Field
- Description apijson.Field
- Mode apijson.Field
- Name apijson.Field
- RulesCount apijson.Field
- AllowedModes apijson.Field
- ModifiedRulesCount apijson.Field
- PackageID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallWAFPackageGroupListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallWAFPackageGroupListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// The state of the rules contained in the rule group. When `on`, the rules in the
-// group are configurable/usable.
-type FirewallWAFPackageGroupListResponseMode string
-
-const (
- FirewallWAFPackageGroupListResponseModeOn FirewallWAFPackageGroupListResponseMode = "on"
- FirewallWAFPackageGroupListResponseModeOff FirewallWAFPackageGroupListResponseMode = "off"
-)
-
-// The state of the rules contained in the rule group. When `on`, the rules in the
-// group are configurable/usable.
-type FirewallWAFPackageGroupListResponseAllowedMode string
-
-const (
- FirewallWAFPackageGroupListResponseAllowedModeOn FirewallWAFPackageGroupListResponseAllowedMode = "on"
- FirewallWAFPackageGroupListResponseAllowedModeOff FirewallWAFPackageGroupListResponseAllowedMode = "off"
-)
-
-// Union satisfied by [FirewallWAFPackageGroupEditResponseUnknown],
-// [FirewallWAFPackageGroupEditResponseArray] or [shared.UnionString].
-type FirewallWAFPackageGroupEditResponse interface {
- ImplementsFirewallWAFPackageGroupEditResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*FirewallWAFPackageGroupEditResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(FirewallWAFPackageGroupEditResponseArray{}),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-type FirewallWAFPackageGroupEditResponseArray []interface{}
-
-func (r FirewallWAFPackageGroupEditResponseArray) ImplementsFirewallWAFPackageGroupEditResponse() {}
-
-// Union satisfied by [FirewallWAFPackageGroupGetResponseUnknown],
-// [FirewallWAFPackageGroupGetResponseArray] or [shared.UnionString].
-type FirewallWAFPackageGroupGetResponse interface {
- ImplementsFirewallWAFPackageGroupGetResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*FirewallWAFPackageGroupGetResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(FirewallWAFPackageGroupGetResponseArray{}),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-type FirewallWAFPackageGroupGetResponseArray []interface{}
-
-func (r FirewallWAFPackageGroupGetResponseArray) ImplementsFirewallWAFPackageGroupGetResponse() {}
-
-type FirewallWAFPackageGroupListParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
- // The direction used to sort returned rule groups.
- Direction param.Field[FirewallWAFPackageGroupListParamsDirection] `query:"direction"`
- // When set to `all`, all the search requirements must match. When set to `any`,
- // only one of the search requirements has to match.
- Match param.Field[FirewallWAFPackageGroupListParamsMatch] `query:"match"`
- // The state of the rules contained in the rule group. When `on`, the rules in the
- // group are configurable/usable.
- Mode param.Field[FirewallWAFPackageGroupListParamsMode] `query:"mode"`
- // The field used to sort returned rule groups.
- Order param.Field[FirewallWAFPackageGroupListParamsOrder] `query:"order"`
- // The page number of paginated results.
- Page param.Field[float64] `query:"page"`
- // The number of rule groups per page.
- PerPage param.Field[float64] `query:"per_page"`
-}
-
-// URLQuery serializes [FirewallWAFPackageGroupListParams]'s query parameters as
-// `url.Values`.
-func (r FirewallWAFPackageGroupListParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// The direction used to sort returned rule groups.
-type FirewallWAFPackageGroupListParamsDirection string
-
-const (
- FirewallWAFPackageGroupListParamsDirectionAsc FirewallWAFPackageGroupListParamsDirection = "asc"
- FirewallWAFPackageGroupListParamsDirectionDesc FirewallWAFPackageGroupListParamsDirection = "desc"
-)
-
-// When set to `all`, all the search requirements must match. When set to `any`,
-// only one of the search requirements has to match.
-type FirewallWAFPackageGroupListParamsMatch string
-
-const (
- FirewallWAFPackageGroupListParamsMatchAny FirewallWAFPackageGroupListParamsMatch = "any"
- FirewallWAFPackageGroupListParamsMatchAll FirewallWAFPackageGroupListParamsMatch = "all"
-)
-
-// The state of the rules contained in the rule group. When `on`, the rules in the
-// group are configurable/usable.
-type FirewallWAFPackageGroupListParamsMode string
-
-const (
- FirewallWAFPackageGroupListParamsModeOn FirewallWAFPackageGroupListParamsMode = "on"
- FirewallWAFPackageGroupListParamsModeOff FirewallWAFPackageGroupListParamsMode = "off"
-)
-
-// The field used to sort returned rule groups.
-type FirewallWAFPackageGroupListParamsOrder string
-
-const (
- FirewallWAFPackageGroupListParamsOrderMode FirewallWAFPackageGroupListParamsOrder = "mode"
- FirewallWAFPackageGroupListParamsOrderRulesCount FirewallWAFPackageGroupListParamsOrder = "rules_count"
-)
-
-type FirewallWAFPackageGroupEditParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
- // The state of the rules contained in the rule group. When `on`, the rules in the
- // group are configurable/usable.
- Mode param.Field[FirewallWAFPackageGroupEditParamsMode] `json:"mode"`
-}
-
-func (r FirewallWAFPackageGroupEditParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The state of the rules contained in the rule group. When `on`, the rules in the
-// group are configurable/usable.
-type FirewallWAFPackageGroupEditParamsMode string
-
-const (
- FirewallWAFPackageGroupEditParamsModeOn FirewallWAFPackageGroupEditParamsMode = "on"
- FirewallWAFPackageGroupEditParamsModeOff FirewallWAFPackageGroupEditParamsMode = "off"
-)
-
-type FirewallWAFPackageGroupEditResponseEnvelope struct {
- Errors []FirewallWAFPackageGroupEditResponseEnvelopeErrors `json:"errors,required"`
- Messages []FirewallWAFPackageGroupEditResponseEnvelopeMessages `json:"messages,required"`
- Result FirewallWAFPackageGroupEditResponse `json:"result,required"`
- // Whether the API call was successful
- Success FirewallWAFPackageGroupEditResponseEnvelopeSuccess `json:"success,required"`
- JSON firewallWAFPackageGroupEditResponseEnvelopeJSON `json:"-"`
-}
-
-// firewallWAFPackageGroupEditResponseEnvelopeJSON contains the JSON metadata for
-// the struct [FirewallWAFPackageGroupEditResponseEnvelope]
-type firewallWAFPackageGroupEditResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallWAFPackageGroupEditResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallWAFPackageGroupEditResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type FirewallWAFPackageGroupEditResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON firewallWAFPackageGroupEditResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// firewallWAFPackageGroupEditResponseEnvelopeErrorsJSON contains the JSON metadata
-// for the struct [FirewallWAFPackageGroupEditResponseEnvelopeErrors]
-type firewallWAFPackageGroupEditResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallWAFPackageGroupEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallWAFPackageGroupEditResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type FirewallWAFPackageGroupEditResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON firewallWAFPackageGroupEditResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// firewallWAFPackageGroupEditResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct [FirewallWAFPackageGroupEditResponseEnvelopeMessages]
-type firewallWAFPackageGroupEditResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallWAFPackageGroupEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallWAFPackageGroupEditResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type FirewallWAFPackageGroupEditResponseEnvelopeSuccess bool
-
-const (
- FirewallWAFPackageGroupEditResponseEnvelopeSuccessTrue FirewallWAFPackageGroupEditResponseEnvelopeSuccess = true
-)
-
-type FirewallWAFPackageGroupGetParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
-}
-
-type FirewallWAFPackageGroupGetResponseEnvelope struct {
- Errors []FirewallWAFPackageGroupGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []FirewallWAFPackageGroupGetResponseEnvelopeMessages `json:"messages,required"`
- Result FirewallWAFPackageGroupGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success FirewallWAFPackageGroupGetResponseEnvelopeSuccess `json:"success,required"`
- JSON firewallWAFPackageGroupGetResponseEnvelopeJSON `json:"-"`
-}
-
-// firewallWAFPackageGroupGetResponseEnvelopeJSON contains the JSON metadata for
-// the struct [FirewallWAFPackageGroupGetResponseEnvelope]
-type firewallWAFPackageGroupGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallWAFPackageGroupGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallWAFPackageGroupGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type FirewallWAFPackageGroupGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON firewallWAFPackageGroupGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// firewallWAFPackageGroupGetResponseEnvelopeErrorsJSON contains the JSON metadata
-// for the struct [FirewallWAFPackageGroupGetResponseEnvelopeErrors]
-type firewallWAFPackageGroupGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallWAFPackageGroupGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallWAFPackageGroupGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type FirewallWAFPackageGroupGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON firewallWAFPackageGroupGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// firewallWAFPackageGroupGetResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct [FirewallWAFPackageGroupGetResponseEnvelopeMessages]
-type firewallWAFPackageGroupGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallWAFPackageGroupGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallWAFPackageGroupGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type FirewallWAFPackageGroupGetResponseEnvelopeSuccess bool
-
-const (
- FirewallWAFPackageGroupGetResponseEnvelopeSuccessTrue FirewallWAFPackageGroupGetResponseEnvelopeSuccess = true
-)
diff --git a/firewallwafpackagegroup_test.go b/firewallwafpackagegroup_test.go
deleted file mode 100644
index 4a130103c98..00000000000
--- a/firewallwafpackagegroup_test.go
+++ /dev/null
@@ -1,113 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestFirewallWAFPackageGroupListWithOptionalParams(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"),
- )
- _, err := client.Firewall.WAF.Packages.Groups.List(
- context.TODO(),
- "a25a9a7e9c00afc1fb2e0245519d725b",
- cloudflare.FirewallWAFPackageGroupListParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Direction: cloudflare.F(cloudflare.FirewallWAFPackageGroupListParamsDirectionDesc),
- Match: cloudflare.F(cloudflare.FirewallWAFPackageGroupListParamsMatchAny),
- Mode: cloudflare.F(cloudflare.FirewallWAFPackageGroupListParamsModeOn),
- Order: cloudflare.F(cloudflare.FirewallWAFPackageGroupListParamsOrderMode),
- Page: cloudflare.F(1.000000),
- PerPage: cloudflare.F(5.000000),
- },
- )
- 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())
- }
-}
-
-func TestFirewallWAFPackageGroupEditWithOptionalParams(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"),
- )
- _, err := client.Firewall.WAF.Packages.Groups.Edit(
- context.TODO(),
- "a25a9a7e9c00afc1fb2e0245519d725b",
- "a25a9a7e9c00afc1fb2e0245519d725b",
- cloudflare.FirewallWAFPackageGroupEditParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Mode: cloudflare.F(cloudflare.FirewallWAFPackageGroupEditParamsModeOn),
- },
- )
- 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())
- }
-}
-
-func TestFirewallWAFPackageGroupGet(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"),
- )
- _, err := client.Firewall.WAF.Packages.Groups.Get(
- context.TODO(),
- "a25a9a7e9c00afc1fb2e0245519d725b",
- "a25a9a7e9c00afc1fb2e0245519d725b",
- cloudflare.FirewallWAFPackageGroupGetParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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/firewallwafpackagerule.go b/firewallwafpackagerule.go
deleted file mode 100644
index 3115ba7c3d4..00000000000
--- a/firewallwafpackagerule.go
+++ /dev/null
@@ -1,1049 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
- "reflect"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/option"
- "github.com/tidwall/gjson"
-)
-
-// FirewallWAFPackageRuleService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewFirewallWAFPackageRuleService]
-// method instead.
-type FirewallWAFPackageRuleService struct {
- Options []option.RequestOption
-}
-
-// NewFirewallWAFPackageRuleService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewFirewallWAFPackageRuleService(opts ...option.RequestOption) (r *FirewallWAFPackageRuleService) {
- r = &FirewallWAFPackageRuleService{}
- r.Options = opts
- return
-}
-
-// Fetches WAF rules in a WAF package.
-//
-// **Note:** Applies only to the
-// [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).
-func (r *FirewallWAFPackageRuleService) List(ctx context.Context, packageID string, params FirewallWAFPackageRuleListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[FirewallWAFPackageRuleListResponse], err error) {
- var raw *http.Response
- opts = append(r.Options, opts...)
- opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
- path := fmt.Sprintf("zones/%s/firewall/waf/packages/%s/rules", params.ZoneID, packageID)
- cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, params, &res, opts...)
- if err != nil {
- return nil, err
- }
- err = cfg.Execute()
- if err != nil {
- return nil, err
- }
- res.SetPageConfig(cfg, raw)
- return res, nil
-}
-
-// Fetches WAF rules in a WAF package.
-//
-// **Note:** Applies only to the
-// [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).
-func (r *FirewallWAFPackageRuleService) ListAutoPaging(ctx context.Context, packageID string, params FirewallWAFPackageRuleListParams, opts ...option.RequestOption) *shared.V4PagePaginationArrayAutoPager[FirewallWAFPackageRuleListResponse] {
- return shared.NewV4PagePaginationArrayAutoPager(r.List(ctx, packageID, params, opts...))
-}
-
-// Updates a WAF rule. You can only update the mode/action of the rule.
-//
-// **Note:** Applies only to the
-// [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).
-func (r *FirewallWAFPackageRuleService) Edit(ctx context.Context, packageID string, ruleID string, params FirewallWAFPackageRuleEditParams, opts ...option.RequestOption) (res *FirewallWAFPackageRuleEditResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env FirewallWAFPackageRuleEditResponseEnvelope
- path := fmt.Sprintf("zones/%s/firewall/waf/packages/%s/rules/%s", params.ZoneID, packageID, ruleID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Fetches the details of a WAF rule in a WAF package.
-//
-// **Note:** Applies only to the
-// [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).
-func (r *FirewallWAFPackageRuleService) Get(ctx context.Context, packageID string, ruleID string, query FirewallWAFPackageRuleGetParams, opts ...option.RequestOption) (res *FirewallWAFPackageRuleGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env FirewallWAFPackageRuleGetResponseEnvelope
- path := fmt.Sprintf("zones/%s/firewall/waf/packages/%s/rules/%s", query.ZoneID, packageID, ruleID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// When triggered, anomaly detection WAF rules contribute to an overall threat
-// score that will determine if a request is considered malicious. You can
-// configure the total scoring threshold through the 'sensitivity' property of the
-// WAF package.
-//
-// Union satisfied by
-// [FirewallWAFPackageRuleListResponseWAFManagedRulesAnomalyRule],
-// [FirewallWAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRule] or
-// [FirewallWAFPackageRuleListResponseWAFManagedRulesTraditionalAllowRule].
-type FirewallWAFPackageRuleListResponse interface {
- implementsFirewallWAFPackageRuleListResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*FirewallWAFPackageRuleListResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(FirewallWAFPackageRuleListResponseWAFManagedRulesAnomalyRule{}),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(FirewallWAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRule{}),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(FirewallWAFPackageRuleListResponseWAFManagedRulesTraditionalAllowRule{}),
- },
- )
-}
-
-// When triggered, anomaly detection WAF rules contribute to an overall threat
-// score that will determine if a request is considered malicious. You can
-// configure the total scoring threshold through the 'sensitivity' property of the
-// WAF package.
-type FirewallWAFPackageRuleListResponseWAFManagedRulesAnomalyRule struct {
- // The unique identifier of the WAF rule.
- ID string `json:"id,required"`
- // Defines the available modes for the current WAF rule. Applies to anomaly
- // detection WAF rules.
- AllowedModes []FirewallWAFPackageRuleListResponseWAFManagedRulesAnomalyRuleAllowedMode `json:"allowed_modes,required"`
- // The public description of the WAF rule.
- Description string `json:"description,required"`
- // The rule group to which the current WAF rule belongs.
- Group FirewallWAFPackageRuleListResponseWAFManagedRulesAnomalyRuleGroup `json:"group,required"`
- // When set to `on`, the current WAF rule will be used when evaluating the request.
- // Applies to anomaly detection WAF rules.
- Mode FirewallWAFPackageRuleListResponseWAFManagedRulesAnomalyRuleMode `json:"mode,required"`
- // The unique identifier of a WAF package.
- PackageID string `json:"package_id,required"`
- // The order in which the individual WAF rule is executed within its rule group.
- Priority string `json:"priority,required"`
- JSON firewallWAFPackageRuleListResponseWAFManagedRulesAnomalyRuleJSON `json:"-"`
-}
-
-// firewallWAFPackageRuleListResponseWAFManagedRulesAnomalyRuleJSON contains the
-// JSON metadata for the struct
-// [FirewallWAFPackageRuleListResponseWAFManagedRulesAnomalyRule]
-type firewallWAFPackageRuleListResponseWAFManagedRulesAnomalyRuleJSON struct {
- ID apijson.Field
- AllowedModes apijson.Field
- Description apijson.Field
- Group apijson.Field
- Mode apijson.Field
- PackageID apijson.Field
- Priority apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallWAFPackageRuleListResponseWAFManagedRulesAnomalyRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallWAFPackageRuleListResponseWAFManagedRulesAnomalyRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r FirewallWAFPackageRuleListResponseWAFManagedRulesAnomalyRule) implementsFirewallWAFPackageRuleListResponse() {
-}
-
-// When set to `on`, the current WAF rule will be used when evaluating the request.
-// Applies to anomaly detection WAF rules.
-type FirewallWAFPackageRuleListResponseWAFManagedRulesAnomalyRuleAllowedMode string
-
-const (
- FirewallWAFPackageRuleListResponseWAFManagedRulesAnomalyRuleAllowedModeOn FirewallWAFPackageRuleListResponseWAFManagedRulesAnomalyRuleAllowedMode = "on"
- FirewallWAFPackageRuleListResponseWAFManagedRulesAnomalyRuleAllowedModeOff FirewallWAFPackageRuleListResponseWAFManagedRulesAnomalyRuleAllowedMode = "off"
-)
-
-// The rule group to which the current WAF rule belongs.
-type FirewallWAFPackageRuleListResponseWAFManagedRulesAnomalyRuleGroup struct {
- // The unique identifier of the rule group.
- ID string `json:"id"`
- // The name of the rule group.
- Name string `json:"name"`
- JSON firewallWAFPackageRuleListResponseWAFManagedRulesAnomalyRuleGroupJSON `json:"-"`
-}
-
-// firewallWAFPackageRuleListResponseWAFManagedRulesAnomalyRuleGroupJSON contains
-// the JSON metadata for the struct
-// [FirewallWAFPackageRuleListResponseWAFManagedRulesAnomalyRuleGroup]
-type firewallWAFPackageRuleListResponseWAFManagedRulesAnomalyRuleGroupJSON struct {
- ID apijson.Field
- Name apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallWAFPackageRuleListResponseWAFManagedRulesAnomalyRuleGroup) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallWAFPackageRuleListResponseWAFManagedRulesAnomalyRuleGroupJSON) RawJSON() string {
- return r.raw
-}
-
-// When set to `on`, the current WAF rule will be used when evaluating the request.
-// Applies to anomaly detection WAF rules.
-type FirewallWAFPackageRuleListResponseWAFManagedRulesAnomalyRuleMode string
-
-const (
- FirewallWAFPackageRuleListResponseWAFManagedRulesAnomalyRuleModeOn FirewallWAFPackageRuleListResponseWAFManagedRulesAnomalyRuleMode = "on"
- FirewallWAFPackageRuleListResponseWAFManagedRulesAnomalyRuleModeOff FirewallWAFPackageRuleListResponseWAFManagedRulesAnomalyRuleMode = "off"
-)
-
-// When triggered, traditional WAF rules cause the firewall to immediately act upon
-// the request based on the configuration of the rule. A 'deny' rule will
-// immediately respond to the request based on the configured rule action/mode (for
-// example, 'block') and no other rules will be processed.
-type FirewallWAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRule struct {
- // The unique identifier of the WAF rule.
- ID string `json:"id,required"`
- // The list of possible actions of the WAF rule when it is triggered.
- AllowedModes []FirewallWAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleAllowedMode `json:"allowed_modes,required"`
- // The default action/mode of a rule.
- DefaultMode FirewallWAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleDefaultMode `json:"default_mode,required"`
- // The public description of the WAF rule.
- Description string `json:"description,required"`
- // The rule group to which the current WAF rule belongs.
- Group FirewallWAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleGroup `json:"group,required"`
- // The action that the current WAF rule will perform when triggered. Applies to
- // traditional (deny) WAF rules.
- Mode FirewallWAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleMode `json:"mode,required"`
- // The unique identifier of a WAF package.
- PackageID string `json:"package_id,required"`
- // The order in which the individual WAF rule is executed within its rule group.
- Priority string `json:"priority,required"`
- JSON firewallWAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleJSON `json:"-"`
-}
-
-// firewallWAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleJSON
-// contains the JSON metadata for the struct
-// [FirewallWAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRule]
-type firewallWAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleJSON struct {
- ID apijson.Field
- AllowedModes apijson.Field
- DefaultMode apijson.Field
- Description apijson.Field
- Group apijson.Field
- Mode apijson.Field
- PackageID apijson.Field
- Priority apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallWAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallWAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r FirewallWAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRule) implementsFirewallWAFPackageRuleListResponse() {
-}
-
-// The action that the current WAF rule will perform when triggered. Applies to
-// traditional (deny) WAF rules.
-type FirewallWAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleAllowedMode string
-
-const (
- FirewallWAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleAllowedModeDefault FirewallWAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleAllowedMode = "default"
- FirewallWAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleAllowedModeDisable FirewallWAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleAllowedMode = "disable"
- FirewallWAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleAllowedModeSimulate FirewallWAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleAllowedMode = "simulate"
- FirewallWAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleAllowedModeBlock FirewallWAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleAllowedMode = "block"
- FirewallWAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleAllowedModeChallenge FirewallWAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleAllowedMode = "challenge"
-)
-
-// The default action/mode of a rule.
-type FirewallWAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleDefaultMode string
-
-const (
- FirewallWAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleDefaultModeDisable FirewallWAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleDefaultMode = "disable"
- FirewallWAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleDefaultModeSimulate FirewallWAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleDefaultMode = "simulate"
- FirewallWAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleDefaultModeBlock FirewallWAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleDefaultMode = "block"
- FirewallWAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleDefaultModeChallenge FirewallWAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleDefaultMode = "challenge"
-)
-
-// The rule group to which the current WAF rule belongs.
-type FirewallWAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleGroup struct {
- // The unique identifier of the rule group.
- ID string `json:"id"`
- // The name of the rule group.
- Name string `json:"name"`
- JSON firewallWAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleGroupJSON `json:"-"`
-}
-
-// firewallWAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleGroupJSON
-// contains the JSON metadata for the struct
-// [FirewallWAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleGroup]
-type firewallWAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleGroupJSON struct {
- ID apijson.Field
- Name apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallWAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleGroup) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallWAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleGroupJSON) RawJSON() string {
- return r.raw
-}
-
-// The action that the current WAF rule will perform when triggered. Applies to
-// traditional (deny) WAF rules.
-type FirewallWAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleMode string
-
-const (
- FirewallWAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleModeDefault FirewallWAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleMode = "default"
- FirewallWAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleModeDisable FirewallWAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleMode = "disable"
- FirewallWAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleModeSimulate FirewallWAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleMode = "simulate"
- FirewallWAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleModeBlock FirewallWAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleMode = "block"
- FirewallWAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleModeChallenge FirewallWAFPackageRuleListResponseWAFManagedRulesTraditionalDenyRuleMode = "challenge"
-)
-
-// When triggered, traditional WAF rules cause the firewall to immediately act on
-// the request based on the rule configuration. An 'allow' rule will immediately
-// allow the request and no other rules will be processed.
-type FirewallWAFPackageRuleListResponseWAFManagedRulesTraditionalAllowRule struct {
- // The unique identifier of the WAF rule.
- ID string `json:"id,required"`
- // Defines the available modes for the current WAF rule.
- AllowedModes []FirewallWAFPackageRuleListResponseWAFManagedRulesTraditionalAllowRuleAllowedMode `json:"allowed_modes,required"`
- // The public description of the WAF rule.
- Description string `json:"description,required"`
- // The rule group to which the current WAF rule belongs.
- Group FirewallWAFPackageRuleListResponseWAFManagedRulesTraditionalAllowRuleGroup `json:"group,required"`
- // When set to `on`, the current rule will be used when evaluating the request.
- // Applies to traditional (allow) WAF rules.
- Mode FirewallWAFPackageRuleListResponseWAFManagedRulesTraditionalAllowRuleMode `json:"mode,required"`
- // The unique identifier of a WAF package.
- PackageID string `json:"package_id,required"`
- // The order in which the individual WAF rule is executed within its rule group.
- Priority string `json:"priority,required"`
- JSON firewallWAFPackageRuleListResponseWAFManagedRulesTraditionalAllowRuleJSON `json:"-"`
-}
-
-// firewallWAFPackageRuleListResponseWAFManagedRulesTraditionalAllowRuleJSON
-// contains the JSON metadata for the struct
-// [FirewallWAFPackageRuleListResponseWAFManagedRulesTraditionalAllowRule]
-type firewallWAFPackageRuleListResponseWAFManagedRulesTraditionalAllowRuleJSON struct {
- ID apijson.Field
- AllowedModes apijson.Field
- Description apijson.Field
- Group apijson.Field
- Mode apijson.Field
- PackageID apijson.Field
- Priority apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallWAFPackageRuleListResponseWAFManagedRulesTraditionalAllowRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallWAFPackageRuleListResponseWAFManagedRulesTraditionalAllowRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r FirewallWAFPackageRuleListResponseWAFManagedRulesTraditionalAllowRule) implementsFirewallWAFPackageRuleListResponse() {
-}
-
-// When set to `on`, the current rule will be used when evaluating the request.
-// Applies to traditional (allow) WAF rules.
-type FirewallWAFPackageRuleListResponseWAFManagedRulesTraditionalAllowRuleAllowedMode string
-
-const (
- FirewallWAFPackageRuleListResponseWAFManagedRulesTraditionalAllowRuleAllowedModeOn FirewallWAFPackageRuleListResponseWAFManagedRulesTraditionalAllowRuleAllowedMode = "on"
- FirewallWAFPackageRuleListResponseWAFManagedRulesTraditionalAllowRuleAllowedModeOff FirewallWAFPackageRuleListResponseWAFManagedRulesTraditionalAllowRuleAllowedMode = "off"
-)
-
-// The rule group to which the current WAF rule belongs.
-type FirewallWAFPackageRuleListResponseWAFManagedRulesTraditionalAllowRuleGroup struct {
- // The unique identifier of the rule group.
- ID string `json:"id"`
- // The name of the rule group.
- Name string `json:"name"`
- JSON firewallWAFPackageRuleListResponseWAFManagedRulesTraditionalAllowRuleGroupJSON `json:"-"`
-}
-
-// firewallWAFPackageRuleListResponseWAFManagedRulesTraditionalAllowRuleGroupJSON
-// contains the JSON metadata for the struct
-// [FirewallWAFPackageRuleListResponseWAFManagedRulesTraditionalAllowRuleGroup]
-type firewallWAFPackageRuleListResponseWAFManagedRulesTraditionalAllowRuleGroupJSON struct {
- ID apijson.Field
- Name apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallWAFPackageRuleListResponseWAFManagedRulesTraditionalAllowRuleGroup) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallWAFPackageRuleListResponseWAFManagedRulesTraditionalAllowRuleGroupJSON) RawJSON() string {
- return r.raw
-}
-
-// When set to `on`, the current rule will be used when evaluating the request.
-// Applies to traditional (allow) WAF rules.
-type FirewallWAFPackageRuleListResponseWAFManagedRulesTraditionalAllowRuleMode string
-
-const (
- FirewallWAFPackageRuleListResponseWAFManagedRulesTraditionalAllowRuleModeOn FirewallWAFPackageRuleListResponseWAFManagedRulesTraditionalAllowRuleMode = "on"
- FirewallWAFPackageRuleListResponseWAFManagedRulesTraditionalAllowRuleModeOff FirewallWAFPackageRuleListResponseWAFManagedRulesTraditionalAllowRuleMode = "off"
-)
-
-// When triggered, anomaly detection WAF rules contribute to an overall threat
-// score that will determine if a request is considered malicious. You can
-// configure the total scoring threshold through the 'sensitivity' property of the
-// WAF package.
-//
-// Union satisfied by
-// [FirewallWAFPackageRuleEditResponseWAFManagedRulesAnomalyRule],
-// [FirewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRule] or
-// [FirewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalAllowRule].
-type FirewallWAFPackageRuleEditResponse interface {
- implementsFirewallWAFPackageRuleEditResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*FirewallWAFPackageRuleEditResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(FirewallWAFPackageRuleEditResponseWAFManagedRulesAnomalyRule{}),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(FirewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRule{}),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(FirewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalAllowRule{}),
- },
- )
-}
-
-// When triggered, anomaly detection WAF rules contribute to an overall threat
-// score that will determine if a request is considered malicious. You can
-// configure the total scoring threshold through the 'sensitivity' property of the
-// WAF package.
-type FirewallWAFPackageRuleEditResponseWAFManagedRulesAnomalyRule struct {
- // The unique identifier of the WAF rule.
- ID string `json:"id,required"`
- // Defines the available modes for the current WAF rule. Applies to anomaly
- // detection WAF rules.
- AllowedModes []FirewallWAFPackageRuleEditResponseWAFManagedRulesAnomalyRuleAllowedMode `json:"allowed_modes,required"`
- // The public description of the WAF rule.
- Description string `json:"description,required"`
- // The rule group to which the current WAF rule belongs.
- Group FirewallWAFPackageRuleEditResponseWAFManagedRulesAnomalyRuleGroup `json:"group,required"`
- // When set to `on`, the current WAF rule will be used when evaluating the request.
- // Applies to anomaly detection WAF rules.
- Mode FirewallWAFPackageRuleEditResponseWAFManagedRulesAnomalyRuleMode `json:"mode,required"`
- // The unique identifier of a WAF package.
- PackageID string `json:"package_id,required"`
- // The order in which the individual WAF rule is executed within its rule group.
- Priority string `json:"priority,required"`
- JSON firewallWAFPackageRuleEditResponseWAFManagedRulesAnomalyRuleJSON `json:"-"`
-}
-
-// firewallWAFPackageRuleEditResponseWAFManagedRulesAnomalyRuleJSON contains the
-// JSON metadata for the struct
-// [FirewallWAFPackageRuleEditResponseWAFManagedRulesAnomalyRule]
-type firewallWAFPackageRuleEditResponseWAFManagedRulesAnomalyRuleJSON struct {
- ID apijson.Field
- AllowedModes apijson.Field
- Description apijson.Field
- Group apijson.Field
- Mode apijson.Field
- PackageID apijson.Field
- Priority apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallWAFPackageRuleEditResponseWAFManagedRulesAnomalyRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallWAFPackageRuleEditResponseWAFManagedRulesAnomalyRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r FirewallWAFPackageRuleEditResponseWAFManagedRulesAnomalyRule) implementsFirewallWAFPackageRuleEditResponse() {
-}
-
-// When set to `on`, the current WAF rule will be used when evaluating the request.
-// Applies to anomaly detection WAF rules.
-type FirewallWAFPackageRuleEditResponseWAFManagedRulesAnomalyRuleAllowedMode string
-
-const (
- FirewallWAFPackageRuleEditResponseWAFManagedRulesAnomalyRuleAllowedModeOn FirewallWAFPackageRuleEditResponseWAFManagedRulesAnomalyRuleAllowedMode = "on"
- FirewallWAFPackageRuleEditResponseWAFManagedRulesAnomalyRuleAllowedModeOff FirewallWAFPackageRuleEditResponseWAFManagedRulesAnomalyRuleAllowedMode = "off"
-)
-
-// The rule group to which the current WAF rule belongs.
-type FirewallWAFPackageRuleEditResponseWAFManagedRulesAnomalyRuleGroup struct {
- // The unique identifier of the rule group.
- ID string `json:"id"`
- // The name of the rule group.
- Name string `json:"name"`
- JSON firewallWAFPackageRuleEditResponseWAFManagedRulesAnomalyRuleGroupJSON `json:"-"`
-}
-
-// firewallWAFPackageRuleEditResponseWAFManagedRulesAnomalyRuleGroupJSON contains
-// the JSON metadata for the struct
-// [FirewallWAFPackageRuleEditResponseWAFManagedRulesAnomalyRuleGroup]
-type firewallWAFPackageRuleEditResponseWAFManagedRulesAnomalyRuleGroupJSON struct {
- ID apijson.Field
- Name apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallWAFPackageRuleEditResponseWAFManagedRulesAnomalyRuleGroup) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallWAFPackageRuleEditResponseWAFManagedRulesAnomalyRuleGroupJSON) RawJSON() string {
- return r.raw
-}
-
-// When set to `on`, the current WAF rule will be used when evaluating the request.
-// Applies to anomaly detection WAF rules.
-type FirewallWAFPackageRuleEditResponseWAFManagedRulesAnomalyRuleMode string
-
-const (
- FirewallWAFPackageRuleEditResponseWAFManagedRulesAnomalyRuleModeOn FirewallWAFPackageRuleEditResponseWAFManagedRulesAnomalyRuleMode = "on"
- FirewallWAFPackageRuleEditResponseWAFManagedRulesAnomalyRuleModeOff FirewallWAFPackageRuleEditResponseWAFManagedRulesAnomalyRuleMode = "off"
-)
-
-// When triggered, traditional WAF rules cause the firewall to immediately act upon
-// the request based on the configuration of the rule. A 'deny' rule will
-// immediately respond to the request based on the configured rule action/mode (for
-// example, 'block') and no other rules will be processed.
-type FirewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRule struct {
- // The unique identifier of the WAF rule.
- ID string `json:"id,required"`
- // The list of possible actions of the WAF rule when it is triggered.
- AllowedModes []FirewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleAllowedMode `json:"allowed_modes,required"`
- // The default action/mode of a rule.
- DefaultMode FirewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleDefaultMode `json:"default_mode,required"`
- // The public description of the WAF rule.
- Description string `json:"description,required"`
- // The rule group to which the current WAF rule belongs.
- Group FirewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleGroup `json:"group,required"`
- // The action that the current WAF rule will perform when triggered. Applies to
- // traditional (deny) WAF rules.
- Mode FirewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleMode `json:"mode,required"`
- // The unique identifier of a WAF package.
- PackageID string `json:"package_id,required"`
- // The order in which the individual WAF rule is executed within its rule group.
- Priority string `json:"priority,required"`
- JSON firewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleJSON `json:"-"`
-}
-
-// firewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleJSON
-// contains the JSON metadata for the struct
-// [FirewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRule]
-type firewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleJSON struct {
- ID apijson.Field
- AllowedModes apijson.Field
- DefaultMode apijson.Field
- Description apijson.Field
- Group apijson.Field
- Mode apijson.Field
- PackageID apijson.Field
- Priority apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r FirewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRule) implementsFirewallWAFPackageRuleEditResponse() {
-}
-
-// The action that the current WAF rule will perform when triggered. Applies to
-// traditional (deny) WAF rules.
-type FirewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleAllowedMode string
-
-const (
- FirewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleAllowedModeDefault FirewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleAllowedMode = "default"
- FirewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleAllowedModeDisable FirewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleAllowedMode = "disable"
- FirewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleAllowedModeSimulate FirewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleAllowedMode = "simulate"
- FirewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleAllowedModeBlock FirewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleAllowedMode = "block"
- FirewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleAllowedModeChallenge FirewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleAllowedMode = "challenge"
-)
-
-// The default action/mode of a rule.
-type FirewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleDefaultMode string
-
-const (
- FirewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleDefaultModeDisable FirewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleDefaultMode = "disable"
- FirewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleDefaultModeSimulate FirewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleDefaultMode = "simulate"
- FirewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleDefaultModeBlock FirewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleDefaultMode = "block"
- FirewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleDefaultModeChallenge FirewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleDefaultMode = "challenge"
-)
-
-// The rule group to which the current WAF rule belongs.
-type FirewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleGroup struct {
- // The unique identifier of the rule group.
- ID string `json:"id"`
- // The name of the rule group.
- Name string `json:"name"`
- JSON firewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleGroupJSON `json:"-"`
-}
-
-// firewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleGroupJSON
-// contains the JSON metadata for the struct
-// [FirewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleGroup]
-type firewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleGroupJSON struct {
- ID apijson.Field
- Name apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleGroup) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleGroupJSON) RawJSON() string {
- return r.raw
-}
-
-// The action that the current WAF rule will perform when triggered. Applies to
-// traditional (deny) WAF rules.
-type FirewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleMode string
-
-const (
- FirewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleModeDefault FirewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleMode = "default"
- FirewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleModeDisable FirewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleMode = "disable"
- FirewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleModeSimulate FirewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleMode = "simulate"
- FirewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleModeBlock FirewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleMode = "block"
- FirewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleModeChallenge FirewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalDenyRuleMode = "challenge"
-)
-
-// When triggered, traditional WAF rules cause the firewall to immediately act on
-// the request based on the rule configuration. An 'allow' rule will immediately
-// allow the request and no other rules will be processed.
-type FirewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalAllowRule struct {
- // The unique identifier of the WAF rule.
- ID string `json:"id,required"`
- // Defines the available modes for the current WAF rule.
- AllowedModes []FirewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalAllowRuleAllowedMode `json:"allowed_modes,required"`
- // The public description of the WAF rule.
- Description string `json:"description,required"`
- // The rule group to which the current WAF rule belongs.
- Group FirewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalAllowRuleGroup `json:"group,required"`
- // When set to `on`, the current rule will be used when evaluating the request.
- // Applies to traditional (allow) WAF rules.
- Mode FirewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalAllowRuleMode `json:"mode,required"`
- // The unique identifier of a WAF package.
- PackageID string `json:"package_id,required"`
- // The order in which the individual WAF rule is executed within its rule group.
- Priority string `json:"priority,required"`
- JSON firewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalAllowRuleJSON `json:"-"`
-}
-
-// firewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalAllowRuleJSON
-// contains the JSON metadata for the struct
-// [FirewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalAllowRule]
-type firewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalAllowRuleJSON struct {
- ID apijson.Field
- AllowedModes apijson.Field
- Description apijson.Field
- Group apijson.Field
- Mode apijson.Field
- PackageID apijson.Field
- Priority apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalAllowRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalAllowRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r FirewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalAllowRule) implementsFirewallWAFPackageRuleEditResponse() {
-}
-
-// When set to `on`, the current rule will be used when evaluating the request.
-// Applies to traditional (allow) WAF rules.
-type FirewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalAllowRuleAllowedMode string
-
-const (
- FirewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalAllowRuleAllowedModeOn FirewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalAllowRuleAllowedMode = "on"
- FirewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalAllowRuleAllowedModeOff FirewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalAllowRuleAllowedMode = "off"
-)
-
-// The rule group to which the current WAF rule belongs.
-type FirewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalAllowRuleGroup struct {
- // The unique identifier of the rule group.
- ID string `json:"id"`
- // The name of the rule group.
- Name string `json:"name"`
- JSON firewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalAllowRuleGroupJSON `json:"-"`
-}
-
-// firewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalAllowRuleGroupJSON
-// contains the JSON metadata for the struct
-// [FirewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalAllowRuleGroup]
-type firewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalAllowRuleGroupJSON struct {
- ID apijson.Field
- Name apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalAllowRuleGroup) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalAllowRuleGroupJSON) RawJSON() string {
- return r.raw
-}
-
-// When set to `on`, the current rule will be used when evaluating the request.
-// Applies to traditional (allow) WAF rules.
-type FirewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalAllowRuleMode string
-
-const (
- FirewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalAllowRuleModeOn FirewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalAllowRuleMode = "on"
- FirewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalAllowRuleModeOff FirewallWAFPackageRuleEditResponseWAFManagedRulesTraditionalAllowRuleMode = "off"
-)
-
-// Union satisfied by [FirewallWAFPackageRuleGetResponseUnknown],
-// [FirewallWAFPackageRuleGetResponseArray] or [shared.UnionString].
-type FirewallWAFPackageRuleGetResponse interface {
- ImplementsFirewallWAFPackageRuleGetResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*FirewallWAFPackageRuleGetResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(FirewallWAFPackageRuleGetResponseArray{}),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-type FirewallWAFPackageRuleGetResponseArray []interface{}
-
-func (r FirewallWAFPackageRuleGetResponseArray) ImplementsFirewallWAFPackageRuleGetResponse() {}
-
-type FirewallWAFPackageRuleListParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
- // The direction used to sort returned rules.
- Direction param.Field[FirewallWAFPackageRuleListParamsDirection] `query:"direction"`
- // When set to `all`, all the search requirements must match. When set to `any`,
- // only one of the search requirements has to match.
- Match param.Field[FirewallWAFPackageRuleListParamsMatch] `query:"match"`
- // The action/mode a rule has been overridden to perform.
- Mode param.Field[FirewallWAFPackageRuleListParamsMode] `query:"mode"`
- // The field used to sort returned rules.
- Order param.Field[FirewallWAFPackageRuleListParamsOrder] `query:"order"`
- // The page number of paginated results.
- Page param.Field[float64] `query:"page"`
- // The number of rules per page.
- PerPage param.Field[float64] `query:"per_page"`
-}
-
-// URLQuery serializes [FirewallWAFPackageRuleListParams]'s query parameters as
-// `url.Values`.
-func (r FirewallWAFPackageRuleListParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// The direction used to sort returned rules.
-type FirewallWAFPackageRuleListParamsDirection string
-
-const (
- FirewallWAFPackageRuleListParamsDirectionAsc FirewallWAFPackageRuleListParamsDirection = "asc"
- FirewallWAFPackageRuleListParamsDirectionDesc FirewallWAFPackageRuleListParamsDirection = "desc"
-)
-
-// When set to `all`, all the search requirements must match. When set to `any`,
-// only one of the search requirements has to match.
-type FirewallWAFPackageRuleListParamsMatch string
-
-const (
- FirewallWAFPackageRuleListParamsMatchAny FirewallWAFPackageRuleListParamsMatch = "any"
- FirewallWAFPackageRuleListParamsMatchAll FirewallWAFPackageRuleListParamsMatch = "all"
-)
-
-// The action/mode a rule has been overridden to perform.
-type FirewallWAFPackageRuleListParamsMode string
-
-const (
- FirewallWAFPackageRuleListParamsModeDis FirewallWAFPackageRuleListParamsMode = "DIS"
- FirewallWAFPackageRuleListParamsModeChl FirewallWAFPackageRuleListParamsMode = "CHL"
- FirewallWAFPackageRuleListParamsModeBlk FirewallWAFPackageRuleListParamsMode = "BLK"
- FirewallWAFPackageRuleListParamsModeSim FirewallWAFPackageRuleListParamsMode = "SIM"
-)
-
-// The field used to sort returned rules.
-type FirewallWAFPackageRuleListParamsOrder string
-
-const (
- FirewallWAFPackageRuleListParamsOrderPriority FirewallWAFPackageRuleListParamsOrder = "priority"
- FirewallWAFPackageRuleListParamsOrderGroupID FirewallWAFPackageRuleListParamsOrder = "group_id"
- FirewallWAFPackageRuleListParamsOrderDescription FirewallWAFPackageRuleListParamsOrder = "description"
-)
-
-type FirewallWAFPackageRuleEditParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
- // The mode/action of the rule when triggered. You must use a value from the
- // `allowed_modes` array of the current rule.
- Mode param.Field[FirewallWAFPackageRuleEditParamsMode] `json:"mode"`
-}
-
-func (r FirewallWAFPackageRuleEditParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The mode/action of the rule when triggered. You must use a value from the
-// `allowed_modes` array of the current rule.
-type FirewallWAFPackageRuleEditParamsMode string
-
-const (
- FirewallWAFPackageRuleEditParamsModeDefault FirewallWAFPackageRuleEditParamsMode = "default"
- FirewallWAFPackageRuleEditParamsModeDisable FirewallWAFPackageRuleEditParamsMode = "disable"
- FirewallWAFPackageRuleEditParamsModeSimulate FirewallWAFPackageRuleEditParamsMode = "simulate"
- FirewallWAFPackageRuleEditParamsModeBlock FirewallWAFPackageRuleEditParamsMode = "block"
- FirewallWAFPackageRuleEditParamsModeChallenge FirewallWAFPackageRuleEditParamsMode = "challenge"
- FirewallWAFPackageRuleEditParamsModeOn FirewallWAFPackageRuleEditParamsMode = "on"
- FirewallWAFPackageRuleEditParamsModeOff FirewallWAFPackageRuleEditParamsMode = "off"
-)
-
-type FirewallWAFPackageRuleEditResponseEnvelope struct {
- Errors []FirewallWAFPackageRuleEditResponseEnvelopeErrors `json:"errors,required"`
- Messages []FirewallWAFPackageRuleEditResponseEnvelopeMessages `json:"messages,required"`
- // When triggered, anomaly detection WAF rules contribute to an overall threat
- // score that will determine if a request is considered malicious. You can
- // configure the total scoring threshold through the 'sensitivity' property of the
- // WAF package.
- Result FirewallWAFPackageRuleEditResponse `json:"result,required"`
- // Whether the API call was successful
- Success FirewallWAFPackageRuleEditResponseEnvelopeSuccess `json:"success,required"`
- JSON firewallWAFPackageRuleEditResponseEnvelopeJSON `json:"-"`
-}
-
-// firewallWAFPackageRuleEditResponseEnvelopeJSON contains the JSON metadata for
-// the struct [FirewallWAFPackageRuleEditResponseEnvelope]
-type firewallWAFPackageRuleEditResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallWAFPackageRuleEditResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallWAFPackageRuleEditResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type FirewallWAFPackageRuleEditResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON firewallWAFPackageRuleEditResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// firewallWAFPackageRuleEditResponseEnvelopeErrorsJSON contains the JSON metadata
-// for the struct [FirewallWAFPackageRuleEditResponseEnvelopeErrors]
-type firewallWAFPackageRuleEditResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallWAFPackageRuleEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallWAFPackageRuleEditResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type FirewallWAFPackageRuleEditResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON firewallWAFPackageRuleEditResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// firewallWAFPackageRuleEditResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct [FirewallWAFPackageRuleEditResponseEnvelopeMessages]
-type firewallWAFPackageRuleEditResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallWAFPackageRuleEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallWAFPackageRuleEditResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type FirewallWAFPackageRuleEditResponseEnvelopeSuccess bool
-
-const (
- FirewallWAFPackageRuleEditResponseEnvelopeSuccessTrue FirewallWAFPackageRuleEditResponseEnvelopeSuccess = true
-)
-
-type FirewallWAFPackageRuleGetParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
-}
-
-type FirewallWAFPackageRuleGetResponseEnvelope struct {
- Errors []FirewallWAFPackageRuleGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []FirewallWAFPackageRuleGetResponseEnvelopeMessages `json:"messages,required"`
- Result FirewallWAFPackageRuleGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success FirewallWAFPackageRuleGetResponseEnvelopeSuccess `json:"success,required"`
- JSON firewallWAFPackageRuleGetResponseEnvelopeJSON `json:"-"`
-}
-
-// firewallWAFPackageRuleGetResponseEnvelopeJSON contains the JSON metadata for the
-// struct [FirewallWAFPackageRuleGetResponseEnvelope]
-type firewallWAFPackageRuleGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallWAFPackageRuleGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallWAFPackageRuleGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type FirewallWAFPackageRuleGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON firewallWAFPackageRuleGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// firewallWAFPackageRuleGetResponseEnvelopeErrorsJSON contains the JSON metadata
-// for the struct [FirewallWAFPackageRuleGetResponseEnvelopeErrors]
-type firewallWAFPackageRuleGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallWAFPackageRuleGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallWAFPackageRuleGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type FirewallWAFPackageRuleGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON firewallWAFPackageRuleGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// firewallWAFPackageRuleGetResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [FirewallWAFPackageRuleGetResponseEnvelopeMessages]
-type firewallWAFPackageRuleGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *FirewallWAFPackageRuleGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r firewallWAFPackageRuleGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type FirewallWAFPackageRuleGetResponseEnvelopeSuccess bool
-
-const (
- FirewallWAFPackageRuleGetResponseEnvelopeSuccessTrue FirewallWAFPackageRuleGetResponseEnvelopeSuccess = true
-)
diff --git a/firewallwafpackagerule_test.go b/firewallwafpackagerule_test.go
deleted file mode 100644
index ea8d45f111c..00000000000
--- a/firewallwafpackagerule_test.go
+++ /dev/null
@@ -1,113 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestFirewallWAFPackageRuleListWithOptionalParams(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"),
- )
- _, err := client.Firewall.WAF.Packages.Rules.List(
- context.TODO(),
- "a25a9a7e9c00afc1fb2e0245519d725b",
- cloudflare.FirewallWAFPackageRuleListParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Direction: cloudflare.F(cloudflare.FirewallWAFPackageRuleListParamsDirectionDesc),
- Match: cloudflare.F(cloudflare.FirewallWAFPackageRuleListParamsMatchAny),
- Mode: cloudflare.F(cloudflare.FirewallWAFPackageRuleListParamsModeChl),
- Order: cloudflare.F(cloudflare.FirewallWAFPackageRuleListParamsOrderPriority),
- Page: cloudflare.F(1.000000),
- PerPage: cloudflare.F(5.000000),
- },
- )
- 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())
- }
-}
-
-func TestFirewallWAFPackageRuleEditWithOptionalParams(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"),
- )
- _, err := client.Firewall.WAF.Packages.Rules.Edit(
- context.TODO(),
- "a25a9a7e9c00afc1fb2e0245519d725b",
- "a25a9a7e9c00afc1fb2e0245519d725b",
- cloudflare.FirewallWAFPackageRuleEditParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Mode: cloudflare.F(cloudflare.FirewallWAFPackageRuleEditParamsModeOn),
- },
- )
- 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())
- }
-}
-
-func TestFirewallWAFPackageRuleGet(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"),
- )
- _, err := client.Firewall.WAF.Packages.Rules.Get(
- context.TODO(),
- "a25a9a7e9c00afc1fb2e0245519d725b",
- "a25a9a7e9c00afc1fb2e0245519d725b",
- cloudflare.FirewallWAFPackageRuleGetParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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/healthcheck.go b/healthcheck.go
deleted file mode 100644
index da6bdf5f4fc..00000000000
--- a/healthcheck.go
+++ /dev/null
@@ -1,2024 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// HealthcheckService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewHealthcheckService] method
-// instead.
-type HealthcheckService struct {
- Options []option.RequestOption
- Previews *HealthcheckPreviewService
-}
-
-// NewHealthcheckService generates a new service that applies the given options to
-// each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewHealthcheckService(opts ...option.RequestOption) (r *HealthcheckService) {
- r = &HealthcheckService{}
- r.Options = opts
- r.Previews = NewHealthcheckPreviewService(opts...)
- return
-}
-
-// Create a new health check.
-func (r *HealthcheckService) New(ctx context.Context, zoneIdentifier string, body HealthcheckNewParams, opts ...option.RequestOption) (res *HealthcheckNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env HealthcheckNewResponseEnvelope
- path := fmt.Sprintf("zones/%s/healthchecks", zoneIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Update a configured health check.
-func (r *HealthcheckService) Update(ctx context.Context, zoneIdentifier string, identifier string, body HealthcheckUpdateParams, opts ...option.RequestOption) (res *HealthcheckUpdateResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env HealthcheckUpdateResponseEnvelope
- path := fmt.Sprintf("zones/%s/healthchecks/%s", zoneIdentifier, identifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// List configured health checks.
-func (r *HealthcheckService) List(ctx context.Context, zoneIdentifier string, opts ...option.RequestOption) (res *[]HealthcheckListResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env HealthcheckListResponseEnvelope
- path := fmt.Sprintf("zones/%s/healthchecks", zoneIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Delete a health check.
-func (r *HealthcheckService) Delete(ctx context.Context, zoneIdentifier string, identifier string, opts ...option.RequestOption) (res *HealthcheckDeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env HealthcheckDeleteResponseEnvelope
- path := fmt.Sprintf("zones/%s/healthchecks/%s", zoneIdentifier, identifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Patch a configured health check.
-func (r *HealthcheckService) Edit(ctx context.Context, zoneIdentifier string, identifier string, body HealthcheckEditParams, opts ...option.RequestOption) (res *HealthcheckEditResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env HealthcheckEditResponseEnvelope
- path := fmt.Sprintf("zones/%s/healthchecks/%s", zoneIdentifier, identifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Fetch a single configured health check.
-func (r *HealthcheckService) Get(ctx context.Context, zoneIdentifier string, identifier string, opts ...option.RequestOption) (res *HealthcheckGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env HealthcheckGetResponseEnvelope
- path := fmt.Sprintf("zones/%s/healthchecks/%s", zoneIdentifier, identifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type HealthcheckNewResponse struct {
- // Identifier
- ID string `json:"id"`
- // The hostname or IP address of the origin server to run health checks on.
- Address string `json:"address"`
- // A list of regions from which to run health checks. Null means Cloudflare will
- // pick a default region.
- CheckRegions []HealthcheckNewResponseCheckRegion `json:"check_regions,nullable"`
- // The number of consecutive fails required from a health check before changing the
- // health to unhealthy.
- ConsecutiveFails int64 `json:"consecutive_fails"`
- // The number of consecutive successes required from a health check before changing
- // the health to healthy.
- ConsecutiveSuccesses int64 `json:"consecutive_successes"`
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // A human-readable description of the health check.
- Description string `json:"description"`
- // The current failure reason if status is unhealthy.
- FailureReason string `json:"failure_reason"`
- // Parameters specific to an HTTP or HTTPS health check.
- HTTPConfig HealthcheckNewResponseHTTPConfig `json:"http_config,nullable"`
- // The interval between each health check. Shorter intervals may give quicker
- // notifications if the origin status changes, but will increase load on the origin
- // as we check from multiple locations.
- Interval int64 `json:"interval"`
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // A short name to identify the health check. Only alphanumeric characters, hyphens
- // and underscores are allowed.
- Name string `json:"name"`
- // The number of retries to attempt in case of a timeout before marking the origin
- // as unhealthy. Retries are attempted immediately.
- Retries int64 `json:"retries"`
- // The current status of the origin server according to the health check.
- Status HealthcheckNewResponseStatus `json:"status"`
- // If suspended, no health checks are sent to the origin.
- Suspended bool `json:"suspended"`
- // Parameters specific to TCP health check.
- TcpConfig HealthcheckNewResponseTcpConfig `json:"tcp_config,nullable"`
- // The timeout (in seconds) before marking the health check as failed.
- Timeout int64 `json:"timeout"`
- // The protocol to use for the health check. Currently supported protocols are
- // 'HTTP', 'HTTPS' and 'TCP'.
- Type string `json:"type"`
- JSON healthcheckNewResponseJSON `json:"-"`
-}
-
-// healthcheckNewResponseJSON contains the JSON metadata for the struct
-// [HealthcheckNewResponse]
-type healthcheckNewResponseJSON struct {
- ID apijson.Field
- Address apijson.Field
- CheckRegions apijson.Field
- ConsecutiveFails apijson.Field
- ConsecutiveSuccesses apijson.Field
- CreatedOn apijson.Field
- Description apijson.Field
- FailureReason apijson.Field
- HTTPConfig apijson.Field
- Interval apijson.Field
- ModifiedOn apijson.Field
- Name apijson.Field
- Retries apijson.Field
- Status apijson.Field
- Suspended apijson.Field
- TcpConfig apijson.Field
- Timeout apijson.Field
- Type apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HealthcheckNewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r healthcheckNewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// WNAM: Western North America, ENAM: Eastern North America, WEU: Western Europe,
-// EEU: Eastern Europe, NSAM: Northern South America, SSAM: Southern South America,
-// OC: Oceania, ME: Middle East, NAF: North Africa, SAF: South Africa, IN: India,
-// SEAS: South East Asia, NEAS: North East Asia, ALL_REGIONS: all regions (BUSINESS
-// and ENTERPRISE customers only).
-type HealthcheckNewResponseCheckRegion string
-
-const (
- HealthcheckNewResponseCheckRegionWnam HealthcheckNewResponseCheckRegion = "WNAM"
- HealthcheckNewResponseCheckRegionEnam HealthcheckNewResponseCheckRegion = "ENAM"
- HealthcheckNewResponseCheckRegionWeu HealthcheckNewResponseCheckRegion = "WEU"
- HealthcheckNewResponseCheckRegionEeu HealthcheckNewResponseCheckRegion = "EEU"
- HealthcheckNewResponseCheckRegionNsam HealthcheckNewResponseCheckRegion = "NSAM"
- HealthcheckNewResponseCheckRegionSsam HealthcheckNewResponseCheckRegion = "SSAM"
- HealthcheckNewResponseCheckRegionOc HealthcheckNewResponseCheckRegion = "OC"
- HealthcheckNewResponseCheckRegionMe HealthcheckNewResponseCheckRegion = "ME"
- HealthcheckNewResponseCheckRegionNaf HealthcheckNewResponseCheckRegion = "NAF"
- HealthcheckNewResponseCheckRegionSaf HealthcheckNewResponseCheckRegion = "SAF"
- HealthcheckNewResponseCheckRegionIn HealthcheckNewResponseCheckRegion = "IN"
- HealthcheckNewResponseCheckRegionSeas HealthcheckNewResponseCheckRegion = "SEAS"
- HealthcheckNewResponseCheckRegionNeas HealthcheckNewResponseCheckRegion = "NEAS"
- HealthcheckNewResponseCheckRegionAllRegions HealthcheckNewResponseCheckRegion = "ALL_REGIONS"
-)
-
-// Parameters specific to an HTTP or HTTPS health check.
-type HealthcheckNewResponseHTTPConfig struct {
- // Do not validate the certificate when the health check uses HTTPS.
- AllowInsecure bool `json:"allow_insecure"`
- // A case-insensitive sub-string to look for in the response body. If this string
- // is not found, the origin will be marked as unhealthy.
- ExpectedBody string `json:"expected_body"`
- // The expected HTTP response codes (e.g. "200") or code ranges (e.g. "2xx" for all
- // codes starting with 2) of the health check.
- ExpectedCodes []string `json:"expected_codes,nullable"`
- // Follow redirects if the origin returns a 3xx status code.
- FollowRedirects bool `json:"follow_redirects"`
- // The HTTP request headers to send in the health check. It is recommended you set
- // a Host header by default. The User-Agent header cannot be overridden.
- Header interface{} `json:"header,nullable"`
- // The HTTP method to use for the health check.
- Method HealthcheckNewResponseHTTPConfigMethod `json:"method"`
- // The endpoint path to health check against.
- Path string `json:"path"`
- // Port number to connect to for the health check. Defaults to 80 if type is HTTP
- // or 443 if type is HTTPS.
- Port int64 `json:"port"`
- JSON healthcheckNewResponseHTTPConfigJSON `json:"-"`
-}
-
-// healthcheckNewResponseHTTPConfigJSON contains the JSON metadata for the struct
-// [HealthcheckNewResponseHTTPConfig]
-type healthcheckNewResponseHTTPConfigJSON struct {
- AllowInsecure apijson.Field
- ExpectedBody apijson.Field
- ExpectedCodes apijson.Field
- FollowRedirects apijson.Field
- Header apijson.Field
- Method apijson.Field
- Path apijson.Field
- Port apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HealthcheckNewResponseHTTPConfig) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r healthcheckNewResponseHTTPConfigJSON) RawJSON() string {
- return r.raw
-}
-
-// The HTTP method to use for the health check.
-type HealthcheckNewResponseHTTPConfigMethod string
-
-const (
- HealthcheckNewResponseHTTPConfigMethodGet HealthcheckNewResponseHTTPConfigMethod = "GET"
- HealthcheckNewResponseHTTPConfigMethodHead HealthcheckNewResponseHTTPConfigMethod = "HEAD"
-)
-
-// The current status of the origin server according to the health check.
-type HealthcheckNewResponseStatus string
-
-const (
- HealthcheckNewResponseStatusUnknown HealthcheckNewResponseStatus = "unknown"
- HealthcheckNewResponseStatusHealthy HealthcheckNewResponseStatus = "healthy"
- HealthcheckNewResponseStatusUnhealthy HealthcheckNewResponseStatus = "unhealthy"
- HealthcheckNewResponseStatusSuspended HealthcheckNewResponseStatus = "suspended"
-)
-
-// Parameters specific to TCP health check.
-type HealthcheckNewResponseTcpConfig struct {
- // The TCP connection method to use for the health check.
- Method HealthcheckNewResponseTcpConfigMethod `json:"method"`
- // Port number to connect to for the health check. Defaults to 80.
- Port int64 `json:"port"`
- JSON healthcheckNewResponseTcpConfigJSON `json:"-"`
-}
-
-// healthcheckNewResponseTcpConfigJSON contains the JSON metadata for the struct
-// [HealthcheckNewResponseTcpConfig]
-type healthcheckNewResponseTcpConfigJSON struct {
- Method apijson.Field
- Port apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HealthcheckNewResponseTcpConfig) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r healthcheckNewResponseTcpConfigJSON) RawJSON() string {
- return r.raw
-}
-
-// The TCP connection method to use for the health check.
-type HealthcheckNewResponseTcpConfigMethod string
-
-const (
- HealthcheckNewResponseTcpConfigMethodConnectionEstablished HealthcheckNewResponseTcpConfigMethod = "connection_established"
-)
-
-type HealthcheckUpdateResponse struct {
- // Identifier
- ID string `json:"id"`
- // The hostname or IP address of the origin server to run health checks on.
- Address string `json:"address"`
- // A list of regions from which to run health checks. Null means Cloudflare will
- // pick a default region.
- CheckRegions []HealthcheckUpdateResponseCheckRegion `json:"check_regions,nullable"`
- // The number of consecutive fails required from a health check before changing the
- // health to unhealthy.
- ConsecutiveFails int64 `json:"consecutive_fails"`
- // The number of consecutive successes required from a health check before changing
- // the health to healthy.
- ConsecutiveSuccesses int64 `json:"consecutive_successes"`
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // A human-readable description of the health check.
- Description string `json:"description"`
- // The current failure reason if status is unhealthy.
- FailureReason string `json:"failure_reason"`
- // Parameters specific to an HTTP or HTTPS health check.
- HTTPConfig HealthcheckUpdateResponseHTTPConfig `json:"http_config,nullable"`
- // The interval between each health check. Shorter intervals may give quicker
- // notifications if the origin status changes, but will increase load on the origin
- // as we check from multiple locations.
- Interval int64 `json:"interval"`
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // A short name to identify the health check. Only alphanumeric characters, hyphens
- // and underscores are allowed.
- Name string `json:"name"`
- // The number of retries to attempt in case of a timeout before marking the origin
- // as unhealthy. Retries are attempted immediately.
- Retries int64 `json:"retries"`
- // The current status of the origin server according to the health check.
- Status HealthcheckUpdateResponseStatus `json:"status"`
- // If suspended, no health checks are sent to the origin.
- Suspended bool `json:"suspended"`
- // Parameters specific to TCP health check.
- TcpConfig HealthcheckUpdateResponseTcpConfig `json:"tcp_config,nullable"`
- // The timeout (in seconds) before marking the health check as failed.
- Timeout int64 `json:"timeout"`
- // The protocol to use for the health check. Currently supported protocols are
- // 'HTTP', 'HTTPS' and 'TCP'.
- Type string `json:"type"`
- JSON healthcheckUpdateResponseJSON `json:"-"`
-}
-
-// healthcheckUpdateResponseJSON contains the JSON metadata for the struct
-// [HealthcheckUpdateResponse]
-type healthcheckUpdateResponseJSON struct {
- ID apijson.Field
- Address apijson.Field
- CheckRegions apijson.Field
- ConsecutiveFails apijson.Field
- ConsecutiveSuccesses apijson.Field
- CreatedOn apijson.Field
- Description apijson.Field
- FailureReason apijson.Field
- HTTPConfig apijson.Field
- Interval apijson.Field
- ModifiedOn apijson.Field
- Name apijson.Field
- Retries apijson.Field
- Status apijson.Field
- Suspended apijson.Field
- TcpConfig apijson.Field
- Timeout apijson.Field
- Type apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HealthcheckUpdateResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r healthcheckUpdateResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// WNAM: Western North America, ENAM: Eastern North America, WEU: Western Europe,
-// EEU: Eastern Europe, NSAM: Northern South America, SSAM: Southern South America,
-// OC: Oceania, ME: Middle East, NAF: North Africa, SAF: South Africa, IN: India,
-// SEAS: South East Asia, NEAS: North East Asia, ALL_REGIONS: all regions (BUSINESS
-// and ENTERPRISE customers only).
-type HealthcheckUpdateResponseCheckRegion string
-
-const (
- HealthcheckUpdateResponseCheckRegionWnam HealthcheckUpdateResponseCheckRegion = "WNAM"
- HealthcheckUpdateResponseCheckRegionEnam HealthcheckUpdateResponseCheckRegion = "ENAM"
- HealthcheckUpdateResponseCheckRegionWeu HealthcheckUpdateResponseCheckRegion = "WEU"
- HealthcheckUpdateResponseCheckRegionEeu HealthcheckUpdateResponseCheckRegion = "EEU"
- HealthcheckUpdateResponseCheckRegionNsam HealthcheckUpdateResponseCheckRegion = "NSAM"
- HealthcheckUpdateResponseCheckRegionSsam HealthcheckUpdateResponseCheckRegion = "SSAM"
- HealthcheckUpdateResponseCheckRegionOc HealthcheckUpdateResponseCheckRegion = "OC"
- HealthcheckUpdateResponseCheckRegionMe HealthcheckUpdateResponseCheckRegion = "ME"
- HealthcheckUpdateResponseCheckRegionNaf HealthcheckUpdateResponseCheckRegion = "NAF"
- HealthcheckUpdateResponseCheckRegionSaf HealthcheckUpdateResponseCheckRegion = "SAF"
- HealthcheckUpdateResponseCheckRegionIn HealthcheckUpdateResponseCheckRegion = "IN"
- HealthcheckUpdateResponseCheckRegionSeas HealthcheckUpdateResponseCheckRegion = "SEAS"
- HealthcheckUpdateResponseCheckRegionNeas HealthcheckUpdateResponseCheckRegion = "NEAS"
- HealthcheckUpdateResponseCheckRegionAllRegions HealthcheckUpdateResponseCheckRegion = "ALL_REGIONS"
-)
-
-// Parameters specific to an HTTP or HTTPS health check.
-type HealthcheckUpdateResponseHTTPConfig struct {
- // Do not validate the certificate when the health check uses HTTPS.
- AllowInsecure bool `json:"allow_insecure"`
- // A case-insensitive sub-string to look for in the response body. If this string
- // is not found, the origin will be marked as unhealthy.
- ExpectedBody string `json:"expected_body"`
- // The expected HTTP response codes (e.g. "200") or code ranges (e.g. "2xx" for all
- // codes starting with 2) of the health check.
- ExpectedCodes []string `json:"expected_codes,nullable"`
- // Follow redirects if the origin returns a 3xx status code.
- FollowRedirects bool `json:"follow_redirects"`
- // The HTTP request headers to send in the health check. It is recommended you set
- // a Host header by default. The User-Agent header cannot be overridden.
- Header interface{} `json:"header,nullable"`
- // The HTTP method to use for the health check.
- Method HealthcheckUpdateResponseHTTPConfigMethod `json:"method"`
- // The endpoint path to health check against.
- Path string `json:"path"`
- // Port number to connect to for the health check. Defaults to 80 if type is HTTP
- // or 443 if type is HTTPS.
- Port int64 `json:"port"`
- JSON healthcheckUpdateResponseHTTPConfigJSON `json:"-"`
-}
-
-// healthcheckUpdateResponseHTTPConfigJSON contains the JSON metadata for the
-// struct [HealthcheckUpdateResponseHTTPConfig]
-type healthcheckUpdateResponseHTTPConfigJSON struct {
- AllowInsecure apijson.Field
- ExpectedBody apijson.Field
- ExpectedCodes apijson.Field
- FollowRedirects apijson.Field
- Header apijson.Field
- Method apijson.Field
- Path apijson.Field
- Port apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HealthcheckUpdateResponseHTTPConfig) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r healthcheckUpdateResponseHTTPConfigJSON) RawJSON() string {
- return r.raw
-}
-
-// The HTTP method to use for the health check.
-type HealthcheckUpdateResponseHTTPConfigMethod string
-
-const (
- HealthcheckUpdateResponseHTTPConfigMethodGet HealthcheckUpdateResponseHTTPConfigMethod = "GET"
- HealthcheckUpdateResponseHTTPConfigMethodHead HealthcheckUpdateResponseHTTPConfigMethod = "HEAD"
-)
-
-// The current status of the origin server according to the health check.
-type HealthcheckUpdateResponseStatus string
-
-const (
- HealthcheckUpdateResponseStatusUnknown HealthcheckUpdateResponseStatus = "unknown"
- HealthcheckUpdateResponseStatusHealthy HealthcheckUpdateResponseStatus = "healthy"
- HealthcheckUpdateResponseStatusUnhealthy HealthcheckUpdateResponseStatus = "unhealthy"
- HealthcheckUpdateResponseStatusSuspended HealthcheckUpdateResponseStatus = "suspended"
-)
-
-// Parameters specific to TCP health check.
-type HealthcheckUpdateResponseTcpConfig struct {
- // The TCP connection method to use for the health check.
- Method HealthcheckUpdateResponseTcpConfigMethod `json:"method"`
- // Port number to connect to for the health check. Defaults to 80.
- Port int64 `json:"port"`
- JSON healthcheckUpdateResponseTcpConfigJSON `json:"-"`
-}
-
-// healthcheckUpdateResponseTcpConfigJSON contains the JSON metadata for the struct
-// [HealthcheckUpdateResponseTcpConfig]
-type healthcheckUpdateResponseTcpConfigJSON struct {
- Method apijson.Field
- Port apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HealthcheckUpdateResponseTcpConfig) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r healthcheckUpdateResponseTcpConfigJSON) RawJSON() string {
- return r.raw
-}
-
-// The TCP connection method to use for the health check.
-type HealthcheckUpdateResponseTcpConfigMethod string
-
-const (
- HealthcheckUpdateResponseTcpConfigMethodConnectionEstablished HealthcheckUpdateResponseTcpConfigMethod = "connection_established"
-)
-
-type HealthcheckListResponse struct {
- // Identifier
- ID string `json:"id"`
- // The hostname or IP address of the origin server to run health checks on.
- Address string `json:"address"`
- // A list of regions from which to run health checks. Null means Cloudflare will
- // pick a default region.
- CheckRegions []HealthcheckListResponseCheckRegion `json:"check_regions,nullable"`
- // The number of consecutive fails required from a health check before changing the
- // health to unhealthy.
- ConsecutiveFails int64 `json:"consecutive_fails"`
- // The number of consecutive successes required from a health check before changing
- // the health to healthy.
- ConsecutiveSuccesses int64 `json:"consecutive_successes"`
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // A human-readable description of the health check.
- Description string `json:"description"`
- // The current failure reason if status is unhealthy.
- FailureReason string `json:"failure_reason"`
- // Parameters specific to an HTTP or HTTPS health check.
- HTTPConfig HealthcheckListResponseHTTPConfig `json:"http_config,nullable"`
- // The interval between each health check. Shorter intervals may give quicker
- // notifications if the origin status changes, but will increase load on the origin
- // as we check from multiple locations.
- Interval int64 `json:"interval"`
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // A short name to identify the health check. Only alphanumeric characters, hyphens
- // and underscores are allowed.
- Name string `json:"name"`
- // The number of retries to attempt in case of a timeout before marking the origin
- // as unhealthy. Retries are attempted immediately.
- Retries int64 `json:"retries"`
- // The current status of the origin server according to the health check.
- Status HealthcheckListResponseStatus `json:"status"`
- // If suspended, no health checks are sent to the origin.
- Suspended bool `json:"suspended"`
- // Parameters specific to TCP health check.
- TcpConfig HealthcheckListResponseTcpConfig `json:"tcp_config,nullable"`
- // The timeout (in seconds) before marking the health check as failed.
- Timeout int64 `json:"timeout"`
- // The protocol to use for the health check. Currently supported protocols are
- // 'HTTP', 'HTTPS' and 'TCP'.
- Type string `json:"type"`
- JSON healthcheckListResponseJSON `json:"-"`
-}
-
-// healthcheckListResponseJSON contains the JSON metadata for the struct
-// [HealthcheckListResponse]
-type healthcheckListResponseJSON struct {
- ID apijson.Field
- Address apijson.Field
- CheckRegions apijson.Field
- ConsecutiveFails apijson.Field
- ConsecutiveSuccesses apijson.Field
- CreatedOn apijson.Field
- Description apijson.Field
- FailureReason apijson.Field
- HTTPConfig apijson.Field
- Interval apijson.Field
- ModifiedOn apijson.Field
- Name apijson.Field
- Retries apijson.Field
- Status apijson.Field
- Suspended apijson.Field
- TcpConfig apijson.Field
- Timeout apijson.Field
- Type apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HealthcheckListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r healthcheckListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// WNAM: Western North America, ENAM: Eastern North America, WEU: Western Europe,
-// EEU: Eastern Europe, NSAM: Northern South America, SSAM: Southern South America,
-// OC: Oceania, ME: Middle East, NAF: North Africa, SAF: South Africa, IN: India,
-// SEAS: South East Asia, NEAS: North East Asia, ALL_REGIONS: all regions (BUSINESS
-// and ENTERPRISE customers only).
-type HealthcheckListResponseCheckRegion string
-
-const (
- HealthcheckListResponseCheckRegionWnam HealthcheckListResponseCheckRegion = "WNAM"
- HealthcheckListResponseCheckRegionEnam HealthcheckListResponseCheckRegion = "ENAM"
- HealthcheckListResponseCheckRegionWeu HealthcheckListResponseCheckRegion = "WEU"
- HealthcheckListResponseCheckRegionEeu HealthcheckListResponseCheckRegion = "EEU"
- HealthcheckListResponseCheckRegionNsam HealthcheckListResponseCheckRegion = "NSAM"
- HealthcheckListResponseCheckRegionSsam HealthcheckListResponseCheckRegion = "SSAM"
- HealthcheckListResponseCheckRegionOc HealthcheckListResponseCheckRegion = "OC"
- HealthcheckListResponseCheckRegionMe HealthcheckListResponseCheckRegion = "ME"
- HealthcheckListResponseCheckRegionNaf HealthcheckListResponseCheckRegion = "NAF"
- HealthcheckListResponseCheckRegionSaf HealthcheckListResponseCheckRegion = "SAF"
- HealthcheckListResponseCheckRegionIn HealthcheckListResponseCheckRegion = "IN"
- HealthcheckListResponseCheckRegionSeas HealthcheckListResponseCheckRegion = "SEAS"
- HealthcheckListResponseCheckRegionNeas HealthcheckListResponseCheckRegion = "NEAS"
- HealthcheckListResponseCheckRegionAllRegions HealthcheckListResponseCheckRegion = "ALL_REGIONS"
-)
-
-// Parameters specific to an HTTP or HTTPS health check.
-type HealthcheckListResponseHTTPConfig struct {
- // Do not validate the certificate when the health check uses HTTPS.
- AllowInsecure bool `json:"allow_insecure"`
- // A case-insensitive sub-string to look for in the response body. If this string
- // is not found, the origin will be marked as unhealthy.
- ExpectedBody string `json:"expected_body"`
- // The expected HTTP response codes (e.g. "200") or code ranges (e.g. "2xx" for all
- // codes starting with 2) of the health check.
- ExpectedCodes []string `json:"expected_codes,nullable"`
- // Follow redirects if the origin returns a 3xx status code.
- FollowRedirects bool `json:"follow_redirects"`
- // The HTTP request headers to send in the health check. It is recommended you set
- // a Host header by default. The User-Agent header cannot be overridden.
- Header interface{} `json:"header,nullable"`
- // The HTTP method to use for the health check.
- Method HealthcheckListResponseHTTPConfigMethod `json:"method"`
- // The endpoint path to health check against.
- Path string `json:"path"`
- // Port number to connect to for the health check. Defaults to 80 if type is HTTP
- // or 443 if type is HTTPS.
- Port int64 `json:"port"`
- JSON healthcheckListResponseHTTPConfigJSON `json:"-"`
-}
-
-// healthcheckListResponseHTTPConfigJSON contains the JSON metadata for the struct
-// [HealthcheckListResponseHTTPConfig]
-type healthcheckListResponseHTTPConfigJSON struct {
- AllowInsecure apijson.Field
- ExpectedBody apijson.Field
- ExpectedCodes apijson.Field
- FollowRedirects apijson.Field
- Header apijson.Field
- Method apijson.Field
- Path apijson.Field
- Port apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HealthcheckListResponseHTTPConfig) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r healthcheckListResponseHTTPConfigJSON) RawJSON() string {
- return r.raw
-}
-
-// The HTTP method to use for the health check.
-type HealthcheckListResponseHTTPConfigMethod string
-
-const (
- HealthcheckListResponseHTTPConfigMethodGet HealthcheckListResponseHTTPConfigMethod = "GET"
- HealthcheckListResponseHTTPConfigMethodHead HealthcheckListResponseHTTPConfigMethod = "HEAD"
-)
-
-// The current status of the origin server according to the health check.
-type HealthcheckListResponseStatus string
-
-const (
- HealthcheckListResponseStatusUnknown HealthcheckListResponseStatus = "unknown"
- HealthcheckListResponseStatusHealthy HealthcheckListResponseStatus = "healthy"
- HealthcheckListResponseStatusUnhealthy HealthcheckListResponseStatus = "unhealthy"
- HealthcheckListResponseStatusSuspended HealthcheckListResponseStatus = "suspended"
-)
-
-// Parameters specific to TCP health check.
-type HealthcheckListResponseTcpConfig struct {
- // The TCP connection method to use for the health check.
- Method HealthcheckListResponseTcpConfigMethod `json:"method"`
- // Port number to connect to for the health check. Defaults to 80.
- Port int64 `json:"port"`
- JSON healthcheckListResponseTcpConfigJSON `json:"-"`
-}
-
-// healthcheckListResponseTcpConfigJSON contains the JSON metadata for the struct
-// [HealthcheckListResponseTcpConfig]
-type healthcheckListResponseTcpConfigJSON struct {
- Method apijson.Field
- Port apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HealthcheckListResponseTcpConfig) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r healthcheckListResponseTcpConfigJSON) RawJSON() string {
- return r.raw
-}
-
-// The TCP connection method to use for the health check.
-type HealthcheckListResponseTcpConfigMethod string
-
-const (
- HealthcheckListResponseTcpConfigMethodConnectionEstablished HealthcheckListResponseTcpConfigMethod = "connection_established"
-)
-
-type HealthcheckDeleteResponse struct {
- // Identifier
- ID string `json:"id"`
- JSON healthcheckDeleteResponseJSON `json:"-"`
-}
-
-// healthcheckDeleteResponseJSON contains the JSON metadata for the struct
-// [HealthcheckDeleteResponse]
-type healthcheckDeleteResponseJSON struct {
- ID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HealthcheckDeleteResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r healthcheckDeleteResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type HealthcheckEditResponse struct {
- // Identifier
- ID string `json:"id"`
- // The hostname or IP address of the origin server to run health checks on.
- Address string `json:"address"`
- // A list of regions from which to run health checks. Null means Cloudflare will
- // pick a default region.
- CheckRegions []HealthcheckEditResponseCheckRegion `json:"check_regions,nullable"`
- // The number of consecutive fails required from a health check before changing the
- // health to unhealthy.
- ConsecutiveFails int64 `json:"consecutive_fails"`
- // The number of consecutive successes required from a health check before changing
- // the health to healthy.
- ConsecutiveSuccesses int64 `json:"consecutive_successes"`
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // A human-readable description of the health check.
- Description string `json:"description"`
- // The current failure reason if status is unhealthy.
- FailureReason string `json:"failure_reason"`
- // Parameters specific to an HTTP or HTTPS health check.
- HTTPConfig HealthcheckEditResponseHTTPConfig `json:"http_config,nullable"`
- // The interval between each health check. Shorter intervals may give quicker
- // notifications if the origin status changes, but will increase load on the origin
- // as we check from multiple locations.
- Interval int64 `json:"interval"`
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // A short name to identify the health check. Only alphanumeric characters, hyphens
- // and underscores are allowed.
- Name string `json:"name"`
- // The number of retries to attempt in case of a timeout before marking the origin
- // as unhealthy. Retries are attempted immediately.
- Retries int64 `json:"retries"`
- // The current status of the origin server according to the health check.
- Status HealthcheckEditResponseStatus `json:"status"`
- // If suspended, no health checks are sent to the origin.
- Suspended bool `json:"suspended"`
- // Parameters specific to TCP health check.
- TcpConfig HealthcheckEditResponseTcpConfig `json:"tcp_config,nullable"`
- // The timeout (in seconds) before marking the health check as failed.
- Timeout int64 `json:"timeout"`
- // The protocol to use for the health check. Currently supported protocols are
- // 'HTTP', 'HTTPS' and 'TCP'.
- Type string `json:"type"`
- JSON healthcheckEditResponseJSON `json:"-"`
-}
-
-// healthcheckEditResponseJSON contains the JSON metadata for the struct
-// [HealthcheckEditResponse]
-type healthcheckEditResponseJSON struct {
- ID apijson.Field
- Address apijson.Field
- CheckRegions apijson.Field
- ConsecutiveFails apijson.Field
- ConsecutiveSuccesses apijson.Field
- CreatedOn apijson.Field
- Description apijson.Field
- FailureReason apijson.Field
- HTTPConfig apijson.Field
- Interval apijson.Field
- ModifiedOn apijson.Field
- Name apijson.Field
- Retries apijson.Field
- Status apijson.Field
- Suspended apijson.Field
- TcpConfig apijson.Field
- Timeout apijson.Field
- Type apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HealthcheckEditResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r healthcheckEditResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// WNAM: Western North America, ENAM: Eastern North America, WEU: Western Europe,
-// EEU: Eastern Europe, NSAM: Northern South America, SSAM: Southern South America,
-// OC: Oceania, ME: Middle East, NAF: North Africa, SAF: South Africa, IN: India,
-// SEAS: South East Asia, NEAS: North East Asia, ALL_REGIONS: all regions (BUSINESS
-// and ENTERPRISE customers only).
-type HealthcheckEditResponseCheckRegion string
-
-const (
- HealthcheckEditResponseCheckRegionWnam HealthcheckEditResponseCheckRegion = "WNAM"
- HealthcheckEditResponseCheckRegionEnam HealthcheckEditResponseCheckRegion = "ENAM"
- HealthcheckEditResponseCheckRegionWeu HealthcheckEditResponseCheckRegion = "WEU"
- HealthcheckEditResponseCheckRegionEeu HealthcheckEditResponseCheckRegion = "EEU"
- HealthcheckEditResponseCheckRegionNsam HealthcheckEditResponseCheckRegion = "NSAM"
- HealthcheckEditResponseCheckRegionSsam HealthcheckEditResponseCheckRegion = "SSAM"
- HealthcheckEditResponseCheckRegionOc HealthcheckEditResponseCheckRegion = "OC"
- HealthcheckEditResponseCheckRegionMe HealthcheckEditResponseCheckRegion = "ME"
- HealthcheckEditResponseCheckRegionNaf HealthcheckEditResponseCheckRegion = "NAF"
- HealthcheckEditResponseCheckRegionSaf HealthcheckEditResponseCheckRegion = "SAF"
- HealthcheckEditResponseCheckRegionIn HealthcheckEditResponseCheckRegion = "IN"
- HealthcheckEditResponseCheckRegionSeas HealthcheckEditResponseCheckRegion = "SEAS"
- HealthcheckEditResponseCheckRegionNeas HealthcheckEditResponseCheckRegion = "NEAS"
- HealthcheckEditResponseCheckRegionAllRegions HealthcheckEditResponseCheckRegion = "ALL_REGIONS"
-)
-
-// Parameters specific to an HTTP or HTTPS health check.
-type HealthcheckEditResponseHTTPConfig struct {
- // Do not validate the certificate when the health check uses HTTPS.
- AllowInsecure bool `json:"allow_insecure"`
- // A case-insensitive sub-string to look for in the response body. If this string
- // is not found, the origin will be marked as unhealthy.
- ExpectedBody string `json:"expected_body"`
- // The expected HTTP response codes (e.g. "200") or code ranges (e.g. "2xx" for all
- // codes starting with 2) of the health check.
- ExpectedCodes []string `json:"expected_codes,nullable"`
- // Follow redirects if the origin returns a 3xx status code.
- FollowRedirects bool `json:"follow_redirects"`
- // The HTTP request headers to send in the health check. It is recommended you set
- // a Host header by default. The User-Agent header cannot be overridden.
- Header interface{} `json:"header,nullable"`
- // The HTTP method to use for the health check.
- Method HealthcheckEditResponseHTTPConfigMethod `json:"method"`
- // The endpoint path to health check against.
- Path string `json:"path"`
- // Port number to connect to for the health check. Defaults to 80 if type is HTTP
- // or 443 if type is HTTPS.
- Port int64 `json:"port"`
- JSON healthcheckEditResponseHTTPConfigJSON `json:"-"`
-}
-
-// healthcheckEditResponseHTTPConfigJSON contains the JSON metadata for the struct
-// [HealthcheckEditResponseHTTPConfig]
-type healthcheckEditResponseHTTPConfigJSON struct {
- AllowInsecure apijson.Field
- ExpectedBody apijson.Field
- ExpectedCodes apijson.Field
- FollowRedirects apijson.Field
- Header apijson.Field
- Method apijson.Field
- Path apijson.Field
- Port apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HealthcheckEditResponseHTTPConfig) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r healthcheckEditResponseHTTPConfigJSON) RawJSON() string {
- return r.raw
-}
-
-// The HTTP method to use for the health check.
-type HealthcheckEditResponseHTTPConfigMethod string
-
-const (
- HealthcheckEditResponseHTTPConfigMethodGet HealthcheckEditResponseHTTPConfigMethod = "GET"
- HealthcheckEditResponseHTTPConfigMethodHead HealthcheckEditResponseHTTPConfigMethod = "HEAD"
-)
-
-// The current status of the origin server according to the health check.
-type HealthcheckEditResponseStatus string
-
-const (
- HealthcheckEditResponseStatusUnknown HealthcheckEditResponseStatus = "unknown"
- HealthcheckEditResponseStatusHealthy HealthcheckEditResponseStatus = "healthy"
- HealthcheckEditResponseStatusUnhealthy HealthcheckEditResponseStatus = "unhealthy"
- HealthcheckEditResponseStatusSuspended HealthcheckEditResponseStatus = "suspended"
-)
-
-// Parameters specific to TCP health check.
-type HealthcheckEditResponseTcpConfig struct {
- // The TCP connection method to use for the health check.
- Method HealthcheckEditResponseTcpConfigMethod `json:"method"`
- // Port number to connect to for the health check. Defaults to 80.
- Port int64 `json:"port"`
- JSON healthcheckEditResponseTcpConfigJSON `json:"-"`
-}
-
-// healthcheckEditResponseTcpConfigJSON contains the JSON metadata for the struct
-// [HealthcheckEditResponseTcpConfig]
-type healthcheckEditResponseTcpConfigJSON struct {
- Method apijson.Field
- Port apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HealthcheckEditResponseTcpConfig) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r healthcheckEditResponseTcpConfigJSON) RawJSON() string {
- return r.raw
-}
-
-// The TCP connection method to use for the health check.
-type HealthcheckEditResponseTcpConfigMethod string
-
-const (
- HealthcheckEditResponseTcpConfigMethodConnectionEstablished HealthcheckEditResponseTcpConfigMethod = "connection_established"
-)
-
-type HealthcheckGetResponse struct {
- // Identifier
- ID string `json:"id"`
- // The hostname or IP address of the origin server to run health checks on.
- Address string `json:"address"`
- // A list of regions from which to run health checks. Null means Cloudflare will
- // pick a default region.
- CheckRegions []HealthcheckGetResponseCheckRegion `json:"check_regions,nullable"`
- // The number of consecutive fails required from a health check before changing the
- // health to unhealthy.
- ConsecutiveFails int64 `json:"consecutive_fails"`
- // The number of consecutive successes required from a health check before changing
- // the health to healthy.
- ConsecutiveSuccesses int64 `json:"consecutive_successes"`
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // A human-readable description of the health check.
- Description string `json:"description"`
- // The current failure reason if status is unhealthy.
- FailureReason string `json:"failure_reason"`
- // Parameters specific to an HTTP or HTTPS health check.
- HTTPConfig HealthcheckGetResponseHTTPConfig `json:"http_config,nullable"`
- // The interval between each health check. Shorter intervals may give quicker
- // notifications if the origin status changes, but will increase load on the origin
- // as we check from multiple locations.
- Interval int64 `json:"interval"`
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // A short name to identify the health check. Only alphanumeric characters, hyphens
- // and underscores are allowed.
- Name string `json:"name"`
- // The number of retries to attempt in case of a timeout before marking the origin
- // as unhealthy. Retries are attempted immediately.
- Retries int64 `json:"retries"`
- // The current status of the origin server according to the health check.
- Status HealthcheckGetResponseStatus `json:"status"`
- // If suspended, no health checks are sent to the origin.
- Suspended bool `json:"suspended"`
- // Parameters specific to TCP health check.
- TcpConfig HealthcheckGetResponseTcpConfig `json:"tcp_config,nullable"`
- // The timeout (in seconds) before marking the health check as failed.
- Timeout int64 `json:"timeout"`
- // The protocol to use for the health check. Currently supported protocols are
- // 'HTTP', 'HTTPS' and 'TCP'.
- Type string `json:"type"`
- JSON healthcheckGetResponseJSON `json:"-"`
-}
-
-// healthcheckGetResponseJSON contains the JSON metadata for the struct
-// [HealthcheckGetResponse]
-type healthcheckGetResponseJSON struct {
- ID apijson.Field
- Address apijson.Field
- CheckRegions apijson.Field
- ConsecutiveFails apijson.Field
- ConsecutiveSuccesses apijson.Field
- CreatedOn apijson.Field
- Description apijson.Field
- FailureReason apijson.Field
- HTTPConfig apijson.Field
- Interval apijson.Field
- ModifiedOn apijson.Field
- Name apijson.Field
- Retries apijson.Field
- Status apijson.Field
- Suspended apijson.Field
- TcpConfig apijson.Field
- Timeout apijson.Field
- Type apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HealthcheckGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r healthcheckGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// WNAM: Western North America, ENAM: Eastern North America, WEU: Western Europe,
-// EEU: Eastern Europe, NSAM: Northern South America, SSAM: Southern South America,
-// OC: Oceania, ME: Middle East, NAF: North Africa, SAF: South Africa, IN: India,
-// SEAS: South East Asia, NEAS: North East Asia, ALL_REGIONS: all regions (BUSINESS
-// and ENTERPRISE customers only).
-type HealthcheckGetResponseCheckRegion string
-
-const (
- HealthcheckGetResponseCheckRegionWnam HealthcheckGetResponseCheckRegion = "WNAM"
- HealthcheckGetResponseCheckRegionEnam HealthcheckGetResponseCheckRegion = "ENAM"
- HealthcheckGetResponseCheckRegionWeu HealthcheckGetResponseCheckRegion = "WEU"
- HealthcheckGetResponseCheckRegionEeu HealthcheckGetResponseCheckRegion = "EEU"
- HealthcheckGetResponseCheckRegionNsam HealthcheckGetResponseCheckRegion = "NSAM"
- HealthcheckGetResponseCheckRegionSsam HealthcheckGetResponseCheckRegion = "SSAM"
- HealthcheckGetResponseCheckRegionOc HealthcheckGetResponseCheckRegion = "OC"
- HealthcheckGetResponseCheckRegionMe HealthcheckGetResponseCheckRegion = "ME"
- HealthcheckGetResponseCheckRegionNaf HealthcheckGetResponseCheckRegion = "NAF"
- HealthcheckGetResponseCheckRegionSaf HealthcheckGetResponseCheckRegion = "SAF"
- HealthcheckGetResponseCheckRegionIn HealthcheckGetResponseCheckRegion = "IN"
- HealthcheckGetResponseCheckRegionSeas HealthcheckGetResponseCheckRegion = "SEAS"
- HealthcheckGetResponseCheckRegionNeas HealthcheckGetResponseCheckRegion = "NEAS"
- HealthcheckGetResponseCheckRegionAllRegions HealthcheckGetResponseCheckRegion = "ALL_REGIONS"
-)
-
-// Parameters specific to an HTTP or HTTPS health check.
-type HealthcheckGetResponseHTTPConfig struct {
- // Do not validate the certificate when the health check uses HTTPS.
- AllowInsecure bool `json:"allow_insecure"`
- // A case-insensitive sub-string to look for in the response body. If this string
- // is not found, the origin will be marked as unhealthy.
- ExpectedBody string `json:"expected_body"`
- // The expected HTTP response codes (e.g. "200") or code ranges (e.g. "2xx" for all
- // codes starting with 2) of the health check.
- ExpectedCodes []string `json:"expected_codes,nullable"`
- // Follow redirects if the origin returns a 3xx status code.
- FollowRedirects bool `json:"follow_redirects"`
- // The HTTP request headers to send in the health check. It is recommended you set
- // a Host header by default. The User-Agent header cannot be overridden.
- Header interface{} `json:"header,nullable"`
- // The HTTP method to use for the health check.
- Method HealthcheckGetResponseHTTPConfigMethod `json:"method"`
- // The endpoint path to health check against.
- Path string `json:"path"`
- // Port number to connect to for the health check. Defaults to 80 if type is HTTP
- // or 443 if type is HTTPS.
- Port int64 `json:"port"`
- JSON healthcheckGetResponseHTTPConfigJSON `json:"-"`
-}
-
-// healthcheckGetResponseHTTPConfigJSON contains the JSON metadata for the struct
-// [HealthcheckGetResponseHTTPConfig]
-type healthcheckGetResponseHTTPConfigJSON struct {
- AllowInsecure apijson.Field
- ExpectedBody apijson.Field
- ExpectedCodes apijson.Field
- FollowRedirects apijson.Field
- Header apijson.Field
- Method apijson.Field
- Path apijson.Field
- Port apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HealthcheckGetResponseHTTPConfig) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r healthcheckGetResponseHTTPConfigJSON) RawJSON() string {
- return r.raw
-}
-
-// The HTTP method to use for the health check.
-type HealthcheckGetResponseHTTPConfigMethod string
-
-const (
- HealthcheckGetResponseHTTPConfigMethodGet HealthcheckGetResponseHTTPConfigMethod = "GET"
- HealthcheckGetResponseHTTPConfigMethodHead HealthcheckGetResponseHTTPConfigMethod = "HEAD"
-)
-
-// The current status of the origin server according to the health check.
-type HealthcheckGetResponseStatus string
-
-const (
- HealthcheckGetResponseStatusUnknown HealthcheckGetResponseStatus = "unknown"
- HealthcheckGetResponseStatusHealthy HealthcheckGetResponseStatus = "healthy"
- HealthcheckGetResponseStatusUnhealthy HealthcheckGetResponseStatus = "unhealthy"
- HealthcheckGetResponseStatusSuspended HealthcheckGetResponseStatus = "suspended"
-)
-
-// Parameters specific to TCP health check.
-type HealthcheckGetResponseTcpConfig struct {
- // The TCP connection method to use for the health check.
- Method HealthcheckGetResponseTcpConfigMethod `json:"method"`
- // Port number to connect to for the health check. Defaults to 80.
- Port int64 `json:"port"`
- JSON healthcheckGetResponseTcpConfigJSON `json:"-"`
-}
-
-// healthcheckGetResponseTcpConfigJSON contains the JSON metadata for the struct
-// [HealthcheckGetResponseTcpConfig]
-type healthcheckGetResponseTcpConfigJSON struct {
- Method apijson.Field
- Port apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HealthcheckGetResponseTcpConfig) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r healthcheckGetResponseTcpConfigJSON) RawJSON() string {
- return r.raw
-}
-
-// The TCP connection method to use for the health check.
-type HealthcheckGetResponseTcpConfigMethod string
-
-const (
- HealthcheckGetResponseTcpConfigMethodConnectionEstablished HealthcheckGetResponseTcpConfigMethod = "connection_established"
-)
-
-type HealthcheckNewParams struct {
- // The hostname or IP address of the origin server to run health checks on.
- Address param.Field[string] `json:"address,required"`
- // A short name to identify the health check. Only alphanumeric characters, hyphens
- // and underscores are allowed.
- Name param.Field[string] `json:"name,required"`
- // A list of regions from which to run health checks. Null means Cloudflare will
- // pick a default region.
- CheckRegions param.Field[[]HealthcheckNewParamsCheckRegion] `json:"check_regions"`
- // The number of consecutive fails required from a health check before changing the
- // health to unhealthy.
- ConsecutiveFails param.Field[int64] `json:"consecutive_fails"`
- // The number of consecutive successes required from a health check before changing
- // the health to healthy.
- ConsecutiveSuccesses param.Field[int64] `json:"consecutive_successes"`
- // A human-readable description of the health check.
- Description param.Field[string] `json:"description"`
- // Parameters specific to an HTTP or HTTPS health check.
- HTTPConfig param.Field[HealthcheckNewParamsHTTPConfig] `json:"http_config"`
- // The interval between each health check. Shorter intervals may give quicker
- // notifications if the origin status changes, but will increase load on the origin
- // as we check from multiple locations.
- Interval param.Field[int64] `json:"interval"`
- // The number of retries to attempt in case of a timeout before marking the origin
- // as unhealthy. Retries are attempted immediately.
- Retries param.Field[int64] `json:"retries"`
- // If suspended, no health checks are sent to the origin.
- Suspended param.Field[bool] `json:"suspended"`
- // Parameters specific to TCP health check.
- TcpConfig param.Field[HealthcheckNewParamsTcpConfig] `json:"tcp_config"`
- // The timeout (in seconds) before marking the health check as failed.
- Timeout param.Field[int64] `json:"timeout"`
- // The protocol to use for the health check. Currently supported protocols are
- // 'HTTP', 'HTTPS' and 'TCP'.
- Type param.Field[string] `json:"type"`
-}
-
-func (r HealthcheckNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// WNAM: Western North America, ENAM: Eastern North America, WEU: Western Europe,
-// EEU: Eastern Europe, NSAM: Northern South America, SSAM: Southern South America,
-// OC: Oceania, ME: Middle East, NAF: North Africa, SAF: South Africa, IN: India,
-// SEAS: South East Asia, NEAS: North East Asia, ALL_REGIONS: all regions (BUSINESS
-// and ENTERPRISE customers only).
-type HealthcheckNewParamsCheckRegion string
-
-const (
- HealthcheckNewParamsCheckRegionWnam HealthcheckNewParamsCheckRegion = "WNAM"
- HealthcheckNewParamsCheckRegionEnam HealthcheckNewParamsCheckRegion = "ENAM"
- HealthcheckNewParamsCheckRegionWeu HealthcheckNewParamsCheckRegion = "WEU"
- HealthcheckNewParamsCheckRegionEeu HealthcheckNewParamsCheckRegion = "EEU"
- HealthcheckNewParamsCheckRegionNsam HealthcheckNewParamsCheckRegion = "NSAM"
- HealthcheckNewParamsCheckRegionSsam HealthcheckNewParamsCheckRegion = "SSAM"
- HealthcheckNewParamsCheckRegionOc HealthcheckNewParamsCheckRegion = "OC"
- HealthcheckNewParamsCheckRegionMe HealthcheckNewParamsCheckRegion = "ME"
- HealthcheckNewParamsCheckRegionNaf HealthcheckNewParamsCheckRegion = "NAF"
- HealthcheckNewParamsCheckRegionSaf HealthcheckNewParamsCheckRegion = "SAF"
- HealthcheckNewParamsCheckRegionIn HealthcheckNewParamsCheckRegion = "IN"
- HealthcheckNewParamsCheckRegionSeas HealthcheckNewParamsCheckRegion = "SEAS"
- HealthcheckNewParamsCheckRegionNeas HealthcheckNewParamsCheckRegion = "NEAS"
- HealthcheckNewParamsCheckRegionAllRegions HealthcheckNewParamsCheckRegion = "ALL_REGIONS"
-)
-
-// Parameters specific to an HTTP or HTTPS health check.
-type HealthcheckNewParamsHTTPConfig struct {
- // Do not validate the certificate when the health check uses HTTPS.
- AllowInsecure param.Field[bool] `json:"allow_insecure"`
- // A case-insensitive sub-string to look for in the response body. If this string
- // is not found, the origin will be marked as unhealthy.
- ExpectedBody param.Field[string] `json:"expected_body"`
- // The expected HTTP response codes (e.g. "200") or code ranges (e.g. "2xx" for all
- // codes starting with 2) of the health check.
- ExpectedCodes param.Field[[]string] `json:"expected_codes"`
- // Follow redirects if the origin returns a 3xx status code.
- FollowRedirects param.Field[bool] `json:"follow_redirects"`
- // The HTTP request headers to send in the health check. It is recommended you set
- // a Host header by default. The User-Agent header cannot be overridden.
- Header param.Field[interface{}] `json:"header"`
- // The HTTP method to use for the health check.
- Method param.Field[HealthcheckNewParamsHTTPConfigMethod] `json:"method"`
- // The endpoint path to health check against.
- Path param.Field[string] `json:"path"`
- // Port number to connect to for the health check. Defaults to 80 if type is HTTP
- // or 443 if type is HTTPS.
- Port param.Field[int64] `json:"port"`
-}
-
-func (r HealthcheckNewParamsHTTPConfig) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The HTTP method to use for the health check.
-type HealthcheckNewParamsHTTPConfigMethod string
-
-const (
- HealthcheckNewParamsHTTPConfigMethodGet HealthcheckNewParamsHTTPConfigMethod = "GET"
- HealthcheckNewParamsHTTPConfigMethodHead HealthcheckNewParamsHTTPConfigMethod = "HEAD"
-)
-
-// Parameters specific to TCP health check.
-type HealthcheckNewParamsTcpConfig struct {
- // The TCP connection method to use for the health check.
- Method param.Field[HealthcheckNewParamsTcpConfigMethod] `json:"method"`
- // Port number to connect to for the health check. Defaults to 80.
- Port param.Field[int64] `json:"port"`
-}
-
-func (r HealthcheckNewParamsTcpConfig) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The TCP connection method to use for the health check.
-type HealthcheckNewParamsTcpConfigMethod string
-
-const (
- HealthcheckNewParamsTcpConfigMethodConnectionEstablished HealthcheckNewParamsTcpConfigMethod = "connection_established"
-)
-
-type HealthcheckNewResponseEnvelope struct {
- Errors []HealthcheckNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []HealthcheckNewResponseEnvelopeMessages `json:"messages,required"`
- Result HealthcheckNewResponse `json:"result,required"`
- // Whether the API call was successful
- Success HealthcheckNewResponseEnvelopeSuccess `json:"success,required"`
- JSON healthcheckNewResponseEnvelopeJSON `json:"-"`
-}
-
-// healthcheckNewResponseEnvelopeJSON contains the JSON metadata for the struct
-// [HealthcheckNewResponseEnvelope]
-type healthcheckNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HealthcheckNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r healthcheckNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type HealthcheckNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON healthcheckNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// healthcheckNewResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [HealthcheckNewResponseEnvelopeErrors]
-type healthcheckNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HealthcheckNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r healthcheckNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type HealthcheckNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON healthcheckNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// healthcheckNewResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [HealthcheckNewResponseEnvelopeMessages]
-type healthcheckNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HealthcheckNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r healthcheckNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type HealthcheckNewResponseEnvelopeSuccess bool
-
-const (
- HealthcheckNewResponseEnvelopeSuccessTrue HealthcheckNewResponseEnvelopeSuccess = true
-)
-
-type HealthcheckUpdateParams struct {
- // The hostname or IP address of the origin server to run health checks on.
- Address param.Field[string] `json:"address,required"`
- // A short name to identify the health check. Only alphanumeric characters, hyphens
- // and underscores are allowed.
- Name param.Field[string] `json:"name,required"`
- // A list of regions from which to run health checks. Null means Cloudflare will
- // pick a default region.
- CheckRegions param.Field[[]HealthcheckUpdateParamsCheckRegion] `json:"check_regions"`
- // The number of consecutive fails required from a health check before changing the
- // health to unhealthy.
- ConsecutiveFails param.Field[int64] `json:"consecutive_fails"`
- // The number of consecutive successes required from a health check before changing
- // the health to healthy.
- ConsecutiveSuccesses param.Field[int64] `json:"consecutive_successes"`
- // A human-readable description of the health check.
- Description param.Field[string] `json:"description"`
- // Parameters specific to an HTTP or HTTPS health check.
- HTTPConfig param.Field[HealthcheckUpdateParamsHTTPConfig] `json:"http_config"`
- // The interval between each health check. Shorter intervals may give quicker
- // notifications if the origin status changes, but will increase load on the origin
- // as we check from multiple locations.
- Interval param.Field[int64] `json:"interval"`
- // The number of retries to attempt in case of a timeout before marking the origin
- // as unhealthy. Retries are attempted immediately.
- Retries param.Field[int64] `json:"retries"`
- // If suspended, no health checks are sent to the origin.
- Suspended param.Field[bool] `json:"suspended"`
- // Parameters specific to TCP health check.
- TcpConfig param.Field[HealthcheckUpdateParamsTcpConfig] `json:"tcp_config"`
- // The timeout (in seconds) before marking the health check as failed.
- Timeout param.Field[int64] `json:"timeout"`
- // The protocol to use for the health check. Currently supported protocols are
- // 'HTTP', 'HTTPS' and 'TCP'.
- Type param.Field[string] `json:"type"`
-}
-
-func (r HealthcheckUpdateParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// WNAM: Western North America, ENAM: Eastern North America, WEU: Western Europe,
-// EEU: Eastern Europe, NSAM: Northern South America, SSAM: Southern South America,
-// OC: Oceania, ME: Middle East, NAF: North Africa, SAF: South Africa, IN: India,
-// SEAS: South East Asia, NEAS: North East Asia, ALL_REGIONS: all regions (BUSINESS
-// and ENTERPRISE customers only).
-type HealthcheckUpdateParamsCheckRegion string
-
-const (
- HealthcheckUpdateParamsCheckRegionWnam HealthcheckUpdateParamsCheckRegion = "WNAM"
- HealthcheckUpdateParamsCheckRegionEnam HealthcheckUpdateParamsCheckRegion = "ENAM"
- HealthcheckUpdateParamsCheckRegionWeu HealthcheckUpdateParamsCheckRegion = "WEU"
- HealthcheckUpdateParamsCheckRegionEeu HealthcheckUpdateParamsCheckRegion = "EEU"
- HealthcheckUpdateParamsCheckRegionNsam HealthcheckUpdateParamsCheckRegion = "NSAM"
- HealthcheckUpdateParamsCheckRegionSsam HealthcheckUpdateParamsCheckRegion = "SSAM"
- HealthcheckUpdateParamsCheckRegionOc HealthcheckUpdateParamsCheckRegion = "OC"
- HealthcheckUpdateParamsCheckRegionMe HealthcheckUpdateParamsCheckRegion = "ME"
- HealthcheckUpdateParamsCheckRegionNaf HealthcheckUpdateParamsCheckRegion = "NAF"
- HealthcheckUpdateParamsCheckRegionSaf HealthcheckUpdateParamsCheckRegion = "SAF"
- HealthcheckUpdateParamsCheckRegionIn HealthcheckUpdateParamsCheckRegion = "IN"
- HealthcheckUpdateParamsCheckRegionSeas HealthcheckUpdateParamsCheckRegion = "SEAS"
- HealthcheckUpdateParamsCheckRegionNeas HealthcheckUpdateParamsCheckRegion = "NEAS"
- HealthcheckUpdateParamsCheckRegionAllRegions HealthcheckUpdateParamsCheckRegion = "ALL_REGIONS"
-)
-
-// Parameters specific to an HTTP or HTTPS health check.
-type HealthcheckUpdateParamsHTTPConfig struct {
- // Do not validate the certificate when the health check uses HTTPS.
- AllowInsecure param.Field[bool] `json:"allow_insecure"`
- // A case-insensitive sub-string to look for in the response body. If this string
- // is not found, the origin will be marked as unhealthy.
- ExpectedBody param.Field[string] `json:"expected_body"`
- // The expected HTTP response codes (e.g. "200") or code ranges (e.g. "2xx" for all
- // codes starting with 2) of the health check.
- ExpectedCodes param.Field[[]string] `json:"expected_codes"`
- // Follow redirects if the origin returns a 3xx status code.
- FollowRedirects param.Field[bool] `json:"follow_redirects"`
- // The HTTP request headers to send in the health check. It is recommended you set
- // a Host header by default. The User-Agent header cannot be overridden.
- Header param.Field[interface{}] `json:"header"`
- // The HTTP method to use for the health check.
- Method param.Field[HealthcheckUpdateParamsHTTPConfigMethod] `json:"method"`
- // The endpoint path to health check against.
- Path param.Field[string] `json:"path"`
- // Port number to connect to for the health check. Defaults to 80 if type is HTTP
- // or 443 if type is HTTPS.
- Port param.Field[int64] `json:"port"`
-}
-
-func (r HealthcheckUpdateParamsHTTPConfig) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The HTTP method to use for the health check.
-type HealthcheckUpdateParamsHTTPConfigMethod string
-
-const (
- HealthcheckUpdateParamsHTTPConfigMethodGet HealthcheckUpdateParamsHTTPConfigMethod = "GET"
- HealthcheckUpdateParamsHTTPConfigMethodHead HealthcheckUpdateParamsHTTPConfigMethod = "HEAD"
-)
-
-// Parameters specific to TCP health check.
-type HealthcheckUpdateParamsTcpConfig struct {
- // The TCP connection method to use for the health check.
- Method param.Field[HealthcheckUpdateParamsTcpConfigMethod] `json:"method"`
- // Port number to connect to for the health check. Defaults to 80.
- Port param.Field[int64] `json:"port"`
-}
-
-func (r HealthcheckUpdateParamsTcpConfig) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The TCP connection method to use for the health check.
-type HealthcheckUpdateParamsTcpConfigMethod string
-
-const (
- HealthcheckUpdateParamsTcpConfigMethodConnectionEstablished HealthcheckUpdateParamsTcpConfigMethod = "connection_established"
-)
-
-type HealthcheckUpdateResponseEnvelope struct {
- Errors []HealthcheckUpdateResponseEnvelopeErrors `json:"errors,required"`
- Messages []HealthcheckUpdateResponseEnvelopeMessages `json:"messages,required"`
- Result HealthcheckUpdateResponse `json:"result,required"`
- // Whether the API call was successful
- Success HealthcheckUpdateResponseEnvelopeSuccess `json:"success,required"`
- JSON healthcheckUpdateResponseEnvelopeJSON `json:"-"`
-}
-
-// healthcheckUpdateResponseEnvelopeJSON contains the JSON metadata for the struct
-// [HealthcheckUpdateResponseEnvelope]
-type healthcheckUpdateResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HealthcheckUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r healthcheckUpdateResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type HealthcheckUpdateResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON healthcheckUpdateResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// healthcheckUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [HealthcheckUpdateResponseEnvelopeErrors]
-type healthcheckUpdateResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HealthcheckUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r healthcheckUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type HealthcheckUpdateResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON healthcheckUpdateResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// healthcheckUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [HealthcheckUpdateResponseEnvelopeMessages]
-type healthcheckUpdateResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HealthcheckUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r healthcheckUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type HealthcheckUpdateResponseEnvelopeSuccess bool
-
-const (
- HealthcheckUpdateResponseEnvelopeSuccessTrue HealthcheckUpdateResponseEnvelopeSuccess = true
-)
-
-type HealthcheckListResponseEnvelope struct {
- Errors []HealthcheckListResponseEnvelopeErrors `json:"errors,required"`
- Messages []HealthcheckListResponseEnvelopeMessages `json:"messages,required"`
- Result []HealthcheckListResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success HealthcheckListResponseEnvelopeSuccess `json:"success,required"`
- ResultInfo HealthcheckListResponseEnvelopeResultInfo `json:"result_info"`
- JSON healthcheckListResponseEnvelopeJSON `json:"-"`
-}
-
-// healthcheckListResponseEnvelopeJSON contains the JSON metadata for the struct
-// [HealthcheckListResponseEnvelope]
-type healthcheckListResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- ResultInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HealthcheckListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r healthcheckListResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type HealthcheckListResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON healthcheckListResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// healthcheckListResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [HealthcheckListResponseEnvelopeErrors]
-type healthcheckListResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HealthcheckListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r healthcheckListResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type HealthcheckListResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON healthcheckListResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// healthcheckListResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [HealthcheckListResponseEnvelopeMessages]
-type healthcheckListResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HealthcheckListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r healthcheckListResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type HealthcheckListResponseEnvelopeSuccess bool
-
-const (
- HealthcheckListResponseEnvelopeSuccessTrue HealthcheckListResponseEnvelopeSuccess = true
-)
-
-type HealthcheckListResponseEnvelopeResultInfo struct {
- // Total number of results for the requested service
- Count float64 `json:"count"`
- // Current page within paginated list of results
- Page float64 `json:"page"`
- // Number of results per page of results
- PerPage float64 `json:"per_page"`
- // Total results available without any search parameters
- TotalCount float64 `json:"total_count"`
- JSON healthcheckListResponseEnvelopeResultInfoJSON `json:"-"`
-}
-
-// healthcheckListResponseEnvelopeResultInfoJSON contains the JSON metadata for the
-// struct [HealthcheckListResponseEnvelopeResultInfo]
-type healthcheckListResponseEnvelopeResultInfoJSON struct {
- Count apijson.Field
- Page apijson.Field
- PerPage apijson.Field
- TotalCount apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HealthcheckListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r healthcheckListResponseEnvelopeResultInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type HealthcheckDeleteResponseEnvelope struct {
- Errors []HealthcheckDeleteResponseEnvelopeErrors `json:"errors,required"`
- Messages []HealthcheckDeleteResponseEnvelopeMessages `json:"messages,required"`
- Result HealthcheckDeleteResponse `json:"result,required"`
- // Whether the API call was successful
- Success HealthcheckDeleteResponseEnvelopeSuccess `json:"success,required"`
- JSON healthcheckDeleteResponseEnvelopeJSON `json:"-"`
-}
-
-// healthcheckDeleteResponseEnvelopeJSON contains the JSON metadata for the struct
-// [HealthcheckDeleteResponseEnvelope]
-type healthcheckDeleteResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HealthcheckDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r healthcheckDeleteResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type HealthcheckDeleteResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON healthcheckDeleteResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// healthcheckDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [HealthcheckDeleteResponseEnvelopeErrors]
-type healthcheckDeleteResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HealthcheckDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r healthcheckDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type HealthcheckDeleteResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON healthcheckDeleteResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// healthcheckDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [HealthcheckDeleteResponseEnvelopeMessages]
-type healthcheckDeleteResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HealthcheckDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r healthcheckDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type HealthcheckDeleteResponseEnvelopeSuccess bool
-
-const (
- HealthcheckDeleteResponseEnvelopeSuccessTrue HealthcheckDeleteResponseEnvelopeSuccess = true
-)
-
-type HealthcheckEditParams struct {
- // The hostname or IP address of the origin server to run health checks on.
- Address param.Field[string] `json:"address,required"`
- // A short name to identify the health check. Only alphanumeric characters, hyphens
- // and underscores are allowed.
- Name param.Field[string] `json:"name,required"`
- // A list of regions from which to run health checks. Null means Cloudflare will
- // pick a default region.
- CheckRegions param.Field[[]HealthcheckEditParamsCheckRegion] `json:"check_regions"`
- // The number of consecutive fails required from a health check before changing the
- // health to unhealthy.
- ConsecutiveFails param.Field[int64] `json:"consecutive_fails"`
- // The number of consecutive successes required from a health check before changing
- // the health to healthy.
- ConsecutiveSuccesses param.Field[int64] `json:"consecutive_successes"`
- // A human-readable description of the health check.
- Description param.Field[string] `json:"description"`
- // Parameters specific to an HTTP or HTTPS health check.
- HTTPConfig param.Field[HealthcheckEditParamsHTTPConfig] `json:"http_config"`
- // The interval between each health check. Shorter intervals may give quicker
- // notifications if the origin status changes, but will increase load on the origin
- // as we check from multiple locations.
- Interval param.Field[int64] `json:"interval"`
- // The number of retries to attempt in case of a timeout before marking the origin
- // as unhealthy. Retries are attempted immediately.
- Retries param.Field[int64] `json:"retries"`
- // If suspended, no health checks are sent to the origin.
- Suspended param.Field[bool] `json:"suspended"`
- // Parameters specific to TCP health check.
- TcpConfig param.Field[HealthcheckEditParamsTcpConfig] `json:"tcp_config"`
- // The timeout (in seconds) before marking the health check as failed.
- Timeout param.Field[int64] `json:"timeout"`
- // The protocol to use for the health check. Currently supported protocols are
- // 'HTTP', 'HTTPS' and 'TCP'.
- Type param.Field[string] `json:"type"`
-}
-
-func (r HealthcheckEditParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// WNAM: Western North America, ENAM: Eastern North America, WEU: Western Europe,
-// EEU: Eastern Europe, NSAM: Northern South America, SSAM: Southern South America,
-// OC: Oceania, ME: Middle East, NAF: North Africa, SAF: South Africa, IN: India,
-// SEAS: South East Asia, NEAS: North East Asia, ALL_REGIONS: all regions (BUSINESS
-// and ENTERPRISE customers only).
-type HealthcheckEditParamsCheckRegion string
-
-const (
- HealthcheckEditParamsCheckRegionWnam HealthcheckEditParamsCheckRegion = "WNAM"
- HealthcheckEditParamsCheckRegionEnam HealthcheckEditParamsCheckRegion = "ENAM"
- HealthcheckEditParamsCheckRegionWeu HealthcheckEditParamsCheckRegion = "WEU"
- HealthcheckEditParamsCheckRegionEeu HealthcheckEditParamsCheckRegion = "EEU"
- HealthcheckEditParamsCheckRegionNsam HealthcheckEditParamsCheckRegion = "NSAM"
- HealthcheckEditParamsCheckRegionSsam HealthcheckEditParamsCheckRegion = "SSAM"
- HealthcheckEditParamsCheckRegionOc HealthcheckEditParamsCheckRegion = "OC"
- HealthcheckEditParamsCheckRegionMe HealthcheckEditParamsCheckRegion = "ME"
- HealthcheckEditParamsCheckRegionNaf HealthcheckEditParamsCheckRegion = "NAF"
- HealthcheckEditParamsCheckRegionSaf HealthcheckEditParamsCheckRegion = "SAF"
- HealthcheckEditParamsCheckRegionIn HealthcheckEditParamsCheckRegion = "IN"
- HealthcheckEditParamsCheckRegionSeas HealthcheckEditParamsCheckRegion = "SEAS"
- HealthcheckEditParamsCheckRegionNeas HealthcheckEditParamsCheckRegion = "NEAS"
- HealthcheckEditParamsCheckRegionAllRegions HealthcheckEditParamsCheckRegion = "ALL_REGIONS"
-)
-
-// Parameters specific to an HTTP or HTTPS health check.
-type HealthcheckEditParamsHTTPConfig struct {
- // Do not validate the certificate when the health check uses HTTPS.
- AllowInsecure param.Field[bool] `json:"allow_insecure"`
- // A case-insensitive sub-string to look for in the response body. If this string
- // is not found, the origin will be marked as unhealthy.
- ExpectedBody param.Field[string] `json:"expected_body"`
- // The expected HTTP response codes (e.g. "200") or code ranges (e.g. "2xx" for all
- // codes starting with 2) of the health check.
- ExpectedCodes param.Field[[]string] `json:"expected_codes"`
- // Follow redirects if the origin returns a 3xx status code.
- FollowRedirects param.Field[bool] `json:"follow_redirects"`
- // The HTTP request headers to send in the health check. It is recommended you set
- // a Host header by default. The User-Agent header cannot be overridden.
- Header param.Field[interface{}] `json:"header"`
- // The HTTP method to use for the health check.
- Method param.Field[HealthcheckEditParamsHTTPConfigMethod] `json:"method"`
- // The endpoint path to health check against.
- Path param.Field[string] `json:"path"`
- // Port number to connect to for the health check. Defaults to 80 if type is HTTP
- // or 443 if type is HTTPS.
- Port param.Field[int64] `json:"port"`
-}
-
-func (r HealthcheckEditParamsHTTPConfig) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The HTTP method to use for the health check.
-type HealthcheckEditParamsHTTPConfigMethod string
-
-const (
- HealthcheckEditParamsHTTPConfigMethodGet HealthcheckEditParamsHTTPConfigMethod = "GET"
- HealthcheckEditParamsHTTPConfigMethodHead HealthcheckEditParamsHTTPConfigMethod = "HEAD"
-)
-
-// Parameters specific to TCP health check.
-type HealthcheckEditParamsTcpConfig struct {
- // The TCP connection method to use for the health check.
- Method param.Field[HealthcheckEditParamsTcpConfigMethod] `json:"method"`
- // Port number to connect to for the health check. Defaults to 80.
- Port param.Field[int64] `json:"port"`
-}
-
-func (r HealthcheckEditParamsTcpConfig) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The TCP connection method to use for the health check.
-type HealthcheckEditParamsTcpConfigMethod string
-
-const (
- HealthcheckEditParamsTcpConfigMethodConnectionEstablished HealthcheckEditParamsTcpConfigMethod = "connection_established"
-)
-
-type HealthcheckEditResponseEnvelope struct {
- Errors []HealthcheckEditResponseEnvelopeErrors `json:"errors,required"`
- Messages []HealthcheckEditResponseEnvelopeMessages `json:"messages,required"`
- Result HealthcheckEditResponse `json:"result,required"`
- // Whether the API call was successful
- Success HealthcheckEditResponseEnvelopeSuccess `json:"success,required"`
- JSON healthcheckEditResponseEnvelopeJSON `json:"-"`
-}
-
-// healthcheckEditResponseEnvelopeJSON contains the JSON metadata for the struct
-// [HealthcheckEditResponseEnvelope]
-type healthcheckEditResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HealthcheckEditResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r healthcheckEditResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type HealthcheckEditResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON healthcheckEditResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// healthcheckEditResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [HealthcheckEditResponseEnvelopeErrors]
-type healthcheckEditResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HealthcheckEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r healthcheckEditResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type HealthcheckEditResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON healthcheckEditResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// healthcheckEditResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [HealthcheckEditResponseEnvelopeMessages]
-type healthcheckEditResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HealthcheckEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r healthcheckEditResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type HealthcheckEditResponseEnvelopeSuccess bool
-
-const (
- HealthcheckEditResponseEnvelopeSuccessTrue HealthcheckEditResponseEnvelopeSuccess = true
-)
-
-type HealthcheckGetResponseEnvelope struct {
- Errors []HealthcheckGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []HealthcheckGetResponseEnvelopeMessages `json:"messages,required"`
- Result HealthcheckGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success HealthcheckGetResponseEnvelopeSuccess `json:"success,required"`
- JSON healthcheckGetResponseEnvelopeJSON `json:"-"`
-}
-
-// healthcheckGetResponseEnvelopeJSON contains the JSON metadata for the struct
-// [HealthcheckGetResponseEnvelope]
-type healthcheckGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HealthcheckGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r healthcheckGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type HealthcheckGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON healthcheckGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// healthcheckGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [HealthcheckGetResponseEnvelopeErrors]
-type healthcheckGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HealthcheckGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r healthcheckGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type HealthcheckGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON healthcheckGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// healthcheckGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [HealthcheckGetResponseEnvelopeMessages]
-type healthcheckGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HealthcheckGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r healthcheckGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type HealthcheckGetResponseEnvelopeSuccess bool
-
-const (
- HealthcheckGetResponseEnvelopeSuccessTrue HealthcheckGetResponseEnvelopeSuccess = true
-)
diff --git a/healthcheckpreview.go b/healthcheckpreview.go
deleted file mode 100644
index fcdbaf4766b..00000000000
--- a/healthcheckpreview.go
+++ /dev/null
@@ -1,861 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// HealthcheckPreviewService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewHealthcheckPreviewService] method
-// instead.
-type HealthcheckPreviewService struct {
- Options []option.RequestOption
-}
-
-// NewHealthcheckPreviewService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewHealthcheckPreviewService(opts ...option.RequestOption) (r *HealthcheckPreviewService) {
- r = &HealthcheckPreviewService{}
- r.Options = opts
- return
-}
-
-// Create a new preview health check.
-func (r *HealthcheckPreviewService) New(ctx context.Context, zoneIdentifier string, body HealthcheckPreviewNewParams, opts ...option.RequestOption) (res *HealthcheckPreviewNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env HealthcheckPreviewNewResponseEnvelope
- path := fmt.Sprintf("zones/%s/healthchecks/preview", zoneIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Delete a health check.
-func (r *HealthcheckPreviewService) Delete(ctx context.Context, zoneIdentifier string, identifier string, opts ...option.RequestOption) (res *HealthcheckPreviewDeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env HealthcheckPreviewDeleteResponseEnvelope
- path := fmt.Sprintf("zones/%s/healthchecks/preview/%s", zoneIdentifier, identifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Fetch a single configured health check preview.
-func (r *HealthcheckPreviewService) Get(ctx context.Context, zoneIdentifier string, identifier string, opts ...option.RequestOption) (res *HealthcheckPreviewGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env HealthcheckPreviewGetResponseEnvelope
- path := fmt.Sprintf("zones/%s/healthchecks/preview/%s", zoneIdentifier, identifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type HealthcheckPreviewNewResponse struct {
- // Identifier
- ID string `json:"id"`
- // The hostname or IP address of the origin server to run health checks on.
- Address string `json:"address"`
- // A list of regions from which to run health checks. Null means Cloudflare will
- // pick a default region.
- CheckRegions []HealthcheckPreviewNewResponseCheckRegion `json:"check_regions,nullable"`
- // The number of consecutive fails required from a health check before changing the
- // health to unhealthy.
- ConsecutiveFails int64 `json:"consecutive_fails"`
- // The number of consecutive successes required from a health check before changing
- // the health to healthy.
- ConsecutiveSuccesses int64 `json:"consecutive_successes"`
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // A human-readable description of the health check.
- Description string `json:"description"`
- // The current failure reason if status is unhealthy.
- FailureReason string `json:"failure_reason"`
- // Parameters specific to an HTTP or HTTPS health check.
- HTTPConfig HealthcheckPreviewNewResponseHTTPConfig `json:"http_config,nullable"`
- // The interval between each health check. Shorter intervals may give quicker
- // notifications if the origin status changes, but will increase load on the origin
- // as we check from multiple locations.
- Interval int64 `json:"interval"`
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // A short name to identify the health check. Only alphanumeric characters, hyphens
- // and underscores are allowed.
- Name string `json:"name"`
- // The number of retries to attempt in case of a timeout before marking the origin
- // as unhealthy. Retries are attempted immediately.
- Retries int64 `json:"retries"`
- // The current status of the origin server according to the health check.
- Status HealthcheckPreviewNewResponseStatus `json:"status"`
- // If suspended, no health checks are sent to the origin.
- Suspended bool `json:"suspended"`
- // Parameters specific to TCP health check.
- TcpConfig HealthcheckPreviewNewResponseTcpConfig `json:"tcp_config,nullable"`
- // The timeout (in seconds) before marking the health check as failed.
- Timeout int64 `json:"timeout"`
- // The protocol to use for the health check. Currently supported protocols are
- // 'HTTP', 'HTTPS' and 'TCP'.
- Type string `json:"type"`
- JSON healthcheckPreviewNewResponseJSON `json:"-"`
-}
-
-// healthcheckPreviewNewResponseJSON contains the JSON metadata for the struct
-// [HealthcheckPreviewNewResponse]
-type healthcheckPreviewNewResponseJSON struct {
- ID apijson.Field
- Address apijson.Field
- CheckRegions apijson.Field
- ConsecutiveFails apijson.Field
- ConsecutiveSuccesses apijson.Field
- CreatedOn apijson.Field
- Description apijson.Field
- FailureReason apijson.Field
- HTTPConfig apijson.Field
- Interval apijson.Field
- ModifiedOn apijson.Field
- Name apijson.Field
- Retries apijson.Field
- Status apijson.Field
- Suspended apijson.Field
- TcpConfig apijson.Field
- Timeout apijson.Field
- Type apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HealthcheckPreviewNewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r healthcheckPreviewNewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// WNAM: Western North America, ENAM: Eastern North America, WEU: Western Europe,
-// EEU: Eastern Europe, NSAM: Northern South America, SSAM: Southern South America,
-// OC: Oceania, ME: Middle East, NAF: North Africa, SAF: South Africa, IN: India,
-// SEAS: South East Asia, NEAS: North East Asia, ALL_REGIONS: all regions (BUSINESS
-// and ENTERPRISE customers only).
-type HealthcheckPreviewNewResponseCheckRegion string
-
-const (
- HealthcheckPreviewNewResponseCheckRegionWnam HealthcheckPreviewNewResponseCheckRegion = "WNAM"
- HealthcheckPreviewNewResponseCheckRegionEnam HealthcheckPreviewNewResponseCheckRegion = "ENAM"
- HealthcheckPreviewNewResponseCheckRegionWeu HealthcheckPreviewNewResponseCheckRegion = "WEU"
- HealthcheckPreviewNewResponseCheckRegionEeu HealthcheckPreviewNewResponseCheckRegion = "EEU"
- HealthcheckPreviewNewResponseCheckRegionNsam HealthcheckPreviewNewResponseCheckRegion = "NSAM"
- HealthcheckPreviewNewResponseCheckRegionSsam HealthcheckPreviewNewResponseCheckRegion = "SSAM"
- HealthcheckPreviewNewResponseCheckRegionOc HealthcheckPreviewNewResponseCheckRegion = "OC"
- HealthcheckPreviewNewResponseCheckRegionMe HealthcheckPreviewNewResponseCheckRegion = "ME"
- HealthcheckPreviewNewResponseCheckRegionNaf HealthcheckPreviewNewResponseCheckRegion = "NAF"
- HealthcheckPreviewNewResponseCheckRegionSaf HealthcheckPreviewNewResponseCheckRegion = "SAF"
- HealthcheckPreviewNewResponseCheckRegionIn HealthcheckPreviewNewResponseCheckRegion = "IN"
- HealthcheckPreviewNewResponseCheckRegionSeas HealthcheckPreviewNewResponseCheckRegion = "SEAS"
- HealthcheckPreviewNewResponseCheckRegionNeas HealthcheckPreviewNewResponseCheckRegion = "NEAS"
- HealthcheckPreviewNewResponseCheckRegionAllRegions HealthcheckPreviewNewResponseCheckRegion = "ALL_REGIONS"
-)
-
-// Parameters specific to an HTTP or HTTPS health check.
-type HealthcheckPreviewNewResponseHTTPConfig struct {
- // Do not validate the certificate when the health check uses HTTPS.
- AllowInsecure bool `json:"allow_insecure"`
- // A case-insensitive sub-string to look for in the response body. If this string
- // is not found, the origin will be marked as unhealthy.
- ExpectedBody string `json:"expected_body"`
- // The expected HTTP response codes (e.g. "200") or code ranges (e.g. "2xx" for all
- // codes starting with 2) of the health check.
- ExpectedCodes []string `json:"expected_codes,nullable"`
- // Follow redirects if the origin returns a 3xx status code.
- FollowRedirects bool `json:"follow_redirects"`
- // The HTTP request headers to send in the health check. It is recommended you set
- // a Host header by default. The User-Agent header cannot be overridden.
- Header interface{} `json:"header,nullable"`
- // The HTTP method to use for the health check.
- Method HealthcheckPreviewNewResponseHTTPConfigMethod `json:"method"`
- // The endpoint path to health check against.
- Path string `json:"path"`
- // Port number to connect to for the health check. Defaults to 80 if type is HTTP
- // or 443 if type is HTTPS.
- Port int64 `json:"port"`
- JSON healthcheckPreviewNewResponseHTTPConfigJSON `json:"-"`
-}
-
-// healthcheckPreviewNewResponseHTTPConfigJSON contains the JSON metadata for the
-// struct [HealthcheckPreviewNewResponseHTTPConfig]
-type healthcheckPreviewNewResponseHTTPConfigJSON struct {
- AllowInsecure apijson.Field
- ExpectedBody apijson.Field
- ExpectedCodes apijson.Field
- FollowRedirects apijson.Field
- Header apijson.Field
- Method apijson.Field
- Path apijson.Field
- Port apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HealthcheckPreviewNewResponseHTTPConfig) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r healthcheckPreviewNewResponseHTTPConfigJSON) RawJSON() string {
- return r.raw
-}
-
-// The HTTP method to use for the health check.
-type HealthcheckPreviewNewResponseHTTPConfigMethod string
-
-const (
- HealthcheckPreviewNewResponseHTTPConfigMethodGet HealthcheckPreviewNewResponseHTTPConfigMethod = "GET"
- HealthcheckPreviewNewResponseHTTPConfigMethodHead HealthcheckPreviewNewResponseHTTPConfigMethod = "HEAD"
-)
-
-// The current status of the origin server according to the health check.
-type HealthcheckPreviewNewResponseStatus string
-
-const (
- HealthcheckPreviewNewResponseStatusUnknown HealthcheckPreviewNewResponseStatus = "unknown"
- HealthcheckPreviewNewResponseStatusHealthy HealthcheckPreviewNewResponseStatus = "healthy"
- HealthcheckPreviewNewResponseStatusUnhealthy HealthcheckPreviewNewResponseStatus = "unhealthy"
- HealthcheckPreviewNewResponseStatusSuspended HealthcheckPreviewNewResponseStatus = "suspended"
-)
-
-// Parameters specific to TCP health check.
-type HealthcheckPreviewNewResponseTcpConfig struct {
- // The TCP connection method to use for the health check.
- Method HealthcheckPreviewNewResponseTcpConfigMethod `json:"method"`
- // Port number to connect to for the health check. Defaults to 80.
- Port int64 `json:"port"`
- JSON healthcheckPreviewNewResponseTcpConfigJSON `json:"-"`
-}
-
-// healthcheckPreviewNewResponseTcpConfigJSON contains the JSON metadata for the
-// struct [HealthcheckPreviewNewResponseTcpConfig]
-type healthcheckPreviewNewResponseTcpConfigJSON struct {
- Method apijson.Field
- Port apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HealthcheckPreviewNewResponseTcpConfig) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r healthcheckPreviewNewResponseTcpConfigJSON) RawJSON() string {
- return r.raw
-}
-
-// The TCP connection method to use for the health check.
-type HealthcheckPreviewNewResponseTcpConfigMethod string
-
-const (
- HealthcheckPreviewNewResponseTcpConfigMethodConnectionEstablished HealthcheckPreviewNewResponseTcpConfigMethod = "connection_established"
-)
-
-type HealthcheckPreviewDeleteResponse struct {
- // Identifier
- ID string `json:"id"`
- JSON healthcheckPreviewDeleteResponseJSON `json:"-"`
-}
-
-// healthcheckPreviewDeleteResponseJSON contains the JSON metadata for the struct
-// [HealthcheckPreviewDeleteResponse]
-type healthcheckPreviewDeleteResponseJSON struct {
- ID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HealthcheckPreviewDeleteResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r healthcheckPreviewDeleteResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type HealthcheckPreviewGetResponse struct {
- // Identifier
- ID string `json:"id"`
- // The hostname or IP address of the origin server to run health checks on.
- Address string `json:"address"`
- // A list of regions from which to run health checks. Null means Cloudflare will
- // pick a default region.
- CheckRegions []HealthcheckPreviewGetResponseCheckRegion `json:"check_regions,nullable"`
- // The number of consecutive fails required from a health check before changing the
- // health to unhealthy.
- ConsecutiveFails int64 `json:"consecutive_fails"`
- // The number of consecutive successes required from a health check before changing
- // the health to healthy.
- ConsecutiveSuccesses int64 `json:"consecutive_successes"`
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // A human-readable description of the health check.
- Description string `json:"description"`
- // The current failure reason if status is unhealthy.
- FailureReason string `json:"failure_reason"`
- // Parameters specific to an HTTP or HTTPS health check.
- HTTPConfig HealthcheckPreviewGetResponseHTTPConfig `json:"http_config,nullable"`
- // The interval between each health check. Shorter intervals may give quicker
- // notifications if the origin status changes, but will increase load on the origin
- // as we check from multiple locations.
- Interval int64 `json:"interval"`
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // A short name to identify the health check. Only alphanumeric characters, hyphens
- // and underscores are allowed.
- Name string `json:"name"`
- // The number of retries to attempt in case of a timeout before marking the origin
- // as unhealthy. Retries are attempted immediately.
- Retries int64 `json:"retries"`
- // The current status of the origin server according to the health check.
- Status HealthcheckPreviewGetResponseStatus `json:"status"`
- // If suspended, no health checks are sent to the origin.
- Suspended bool `json:"suspended"`
- // Parameters specific to TCP health check.
- TcpConfig HealthcheckPreviewGetResponseTcpConfig `json:"tcp_config,nullable"`
- // The timeout (in seconds) before marking the health check as failed.
- Timeout int64 `json:"timeout"`
- // The protocol to use for the health check. Currently supported protocols are
- // 'HTTP', 'HTTPS' and 'TCP'.
- Type string `json:"type"`
- JSON healthcheckPreviewGetResponseJSON `json:"-"`
-}
-
-// healthcheckPreviewGetResponseJSON contains the JSON metadata for the struct
-// [HealthcheckPreviewGetResponse]
-type healthcheckPreviewGetResponseJSON struct {
- ID apijson.Field
- Address apijson.Field
- CheckRegions apijson.Field
- ConsecutiveFails apijson.Field
- ConsecutiveSuccesses apijson.Field
- CreatedOn apijson.Field
- Description apijson.Field
- FailureReason apijson.Field
- HTTPConfig apijson.Field
- Interval apijson.Field
- ModifiedOn apijson.Field
- Name apijson.Field
- Retries apijson.Field
- Status apijson.Field
- Suspended apijson.Field
- TcpConfig apijson.Field
- Timeout apijson.Field
- Type apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HealthcheckPreviewGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r healthcheckPreviewGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// WNAM: Western North America, ENAM: Eastern North America, WEU: Western Europe,
-// EEU: Eastern Europe, NSAM: Northern South America, SSAM: Southern South America,
-// OC: Oceania, ME: Middle East, NAF: North Africa, SAF: South Africa, IN: India,
-// SEAS: South East Asia, NEAS: North East Asia, ALL_REGIONS: all regions (BUSINESS
-// and ENTERPRISE customers only).
-type HealthcheckPreviewGetResponseCheckRegion string
-
-const (
- HealthcheckPreviewGetResponseCheckRegionWnam HealthcheckPreviewGetResponseCheckRegion = "WNAM"
- HealthcheckPreviewGetResponseCheckRegionEnam HealthcheckPreviewGetResponseCheckRegion = "ENAM"
- HealthcheckPreviewGetResponseCheckRegionWeu HealthcheckPreviewGetResponseCheckRegion = "WEU"
- HealthcheckPreviewGetResponseCheckRegionEeu HealthcheckPreviewGetResponseCheckRegion = "EEU"
- HealthcheckPreviewGetResponseCheckRegionNsam HealthcheckPreviewGetResponseCheckRegion = "NSAM"
- HealthcheckPreviewGetResponseCheckRegionSsam HealthcheckPreviewGetResponseCheckRegion = "SSAM"
- HealthcheckPreviewGetResponseCheckRegionOc HealthcheckPreviewGetResponseCheckRegion = "OC"
- HealthcheckPreviewGetResponseCheckRegionMe HealthcheckPreviewGetResponseCheckRegion = "ME"
- HealthcheckPreviewGetResponseCheckRegionNaf HealthcheckPreviewGetResponseCheckRegion = "NAF"
- HealthcheckPreviewGetResponseCheckRegionSaf HealthcheckPreviewGetResponseCheckRegion = "SAF"
- HealthcheckPreviewGetResponseCheckRegionIn HealthcheckPreviewGetResponseCheckRegion = "IN"
- HealthcheckPreviewGetResponseCheckRegionSeas HealthcheckPreviewGetResponseCheckRegion = "SEAS"
- HealthcheckPreviewGetResponseCheckRegionNeas HealthcheckPreviewGetResponseCheckRegion = "NEAS"
- HealthcheckPreviewGetResponseCheckRegionAllRegions HealthcheckPreviewGetResponseCheckRegion = "ALL_REGIONS"
-)
-
-// Parameters specific to an HTTP or HTTPS health check.
-type HealthcheckPreviewGetResponseHTTPConfig struct {
- // Do not validate the certificate when the health check uses HTTPS.
- AllowInsecure bool `json:"allow_insecure"`
- // A case-insensitive sub-string to look for in the response body. If this string
- // is not found, the origin will be marked as unhealthy.
- ExpectedBody string `json:"expected_body"`
- // The expected HTTP response codes (e.g. "200") or code ranges (e.g. "2xx" for all
- // codes starting with 2) of the health check.
- ExpectedCodes []string `json:"expected_codes,nullable"`
- // Follow redirects if the origin returns a 3xx status code.
- FollowRedirects bool `json:"follow_redirects"`
- // The HTTP request headers to send in the health check. It is recommended you set
- // a Host header by default. The User-Agent header cannot be overridden.
- Header interface{} `json:"header,nullable"`
- // The HTTP method to use for the health check.
- Method HealthcheckPreviewGetResponseHTTPConfigMethod `json:"method"`
- // The endpoint path to health check against.
- Path string `json:"path"`
- // Port number to connect to for the health check. Defaults to 80 if type is HTTP
- // or 443 if type is HTTPS.
- Port int64 `json:"port"`
- JSON healthcheckPreviewGetResponseHTTPConfigJSON `json:"-"`
-}
-
-// healthcheckPreviewGetResponseHTTPConfigJSON contains the JSON metadata for the
-// struct [HealthcheckPreviewGetResponseHTTPConfig]
-type healthcheckPreviewGetResponseHTTPConfigJSON struct {
- AllowInsecure apijson.Field
- ExpectedBody apijson.Field
- ExpectedCodes apijson.Field
- FollowRedirects apijson.Field
- Header apijson.Field
- Method apijson.Field
- Path apijson.Field
- Port apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HealthcheckPreviewGetResponseHTTPConfig) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r healthcheckPreviewGetResponseHTTPConfigJSON) RawJSON() string {
- return r.raw
-}
-
-// The HTTP method to use for the health check.
-type HealthcheckPreviewGetResponseHTTPConfigMethod string
-
-const (
- HealthcheckPreviewGetResponseHTTPConfigMethodGet HealthcheckPreviewGetResponseHTTPConfigMethod = "GET"
- HealthcheckPreviewGetResponseHTTPConfigMethodHead HealthcheckPreviewGetResponseHTTPConfigMethod = "HEAD"
-)
-
-// The current status of the origin server according to the health check.
-type HealthcheckPreviewGetResponseStatus string
-
-const (
- HealthcheckPreviewGetResponseStatusUnknown HealthcheckPreviewGetResponseStatus = "unknown"
- HealthcheckPreviewGetResponseStatusHealthy HealthcheckPreviewGetResponseStatus = "healthy"
- HealthcheckPreviewGetResponseStatusUnhealthy HealthcheckPreviewGetResponseStatus = "unhealthy"
- HealthcheckPreviewGetResponseStatusSuspended HealthcheckPreviewGetResponseStatus = "suspended"
-)
-
-// Parameters specific to TCP health check.
-type HealthcheckPreviewGetResponseTcpConfig struct {
- // The TCP connection method to use for the health check.
- Method HealthcheckPreviewGetResponseTcpConfigMethod `json:"method"`
- // Port number to connect to for the health check. Defaults to 80.
- Port int64 `json:"port"`
- JSON healthcheckPreviewGetResponseTcpConfigJSON `json:"-"`
-}
-
-// healthcheckPreviewGetResponseTcpConfigJSON contains the JSON metadata for the
-// struct [HealthcheckPreviewGetResponseTcpConfig]
-type healthcheckPreviewGetResponseTcpConfigJSON struct {
- Method apijson.Field
- Port apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HealthcheckPreviewGetResponseTcpConfig) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r healthcheckPreviewGetResponseTcpConfigJSON) RawJSON() string {
- return r.raw
-}
-
-// The TCP connection method to use for the health check.
-type HealthcheckPreviewGetResponseTcpConfigMethod string
-
-const (
- HealthcheckPreviewGetResponseTcpConfigMethodConnectionEstablished HealthcheckPreviewGetResponseTcpConfigMethod = "connection_established"
-)
-
-type HealthcheckPreviewNewParams struct {
- // The hostname or IP address of the origin server to run health checks on.
- Address param.Field[string] `json:"address,required"`
- // A short name to identify the health check. Only alphanumeric characters, hyphens
- // and underscores are allowed.
- Name param.Field[string] `json:"name,required"`
- // A list of regions from which to run health checks. Null means Cloudflare will
- // pick a default region.
- CheckRegions param.Field[[]HealthcheckPreviewNewParamsCheckRegion] `json:"check_regions"`
- // The number of consecutive fails required from a health check before changing the
- // health to unhealthy.
- ConsecutiveFails param.Field[int64] `json:"consecutive_fails"`
- // The number of consecutive successes required from a health check before changing
- // the health to healthy.
- ConsecutiveSuccesses param.Field[int64] `json:"consecutive_successes"`
- // A human-readable description of the health check.
- Description param.Field[string] `json:"description"`
- // Parameters specific to an HTTP or HTTPS health check.
- HTTPConfig param.Field[HealthcheckPreviewNewParamsHTTPConfig] `json:"http_config"`
- // The interval between each health check. Shorter intervals may give quicker
- // notifications if the origin status changes, but will increase load on the origin
- // as we check from multiple locations.
- Interval param.Field[int64] `json:"interval"`
- // The number of retries to attempt in case of a timeout before marking the origin
- // as unhealthy. Retries are attempted immediately.
- Retries param.Field[int64] `json:"retries"`
- // If suspended, no health checks are sent to the origin.
- Suspended param.Field[bool] `json:"suspended"`
- // Parameters specific to TCP health check.
- TcpConfig param.Field[HealthcheckPreviewNewParamsTcpConfig] `json:"tcp_config"`
- // The timeout (in seconds) before marking the health check as failed.
- Timeout param.Field[int64] `json:"timeout"`
- // The protocol to use for the health check. Currently supported protocols are
- // 'HTTP', 'HTTPS' and 'TCP'.
- Type param.Field[string] `json:"type"`
-}
-
-func (r HealthcheckPreviewNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// WNAM: Western North America, ENAM: Eastern North America, WEU: Western Europe,
-// EEU: Eastern Europe, NSAM: Northern South America, SSAM: Southern South America,
-// OC: Oceania, ME: Middle East, NAF: North Africa, SAF: South Africa, IN: India,
-// SEAS: South East Asia, NEAS: North East Asia, ALL_REGIONS: all regions (BUSINESS
-// and ENTERPRISE customers only).
-type HealthcheckPreviewNewParamsCheckRegion string
-
-const (
- HealthcheckPreviewNewParamsCheckRegionWnam HealthcheckPreviewNewParamsCheckRegion = "WNAM"
- HealthcheckPreviewNewParamsCheckRegionEnam HealthcheckPreviewNewParamsCheckRegion = "ENAM"
- HealthcheckPreviewNewParamsCheckRegionWeu HealthcheckPreviewNewParamsCheckRegion = "WEU"
- HealthcheckPreviewNewParamsCheckRegionEeu HealthcheckPreviewNewParamsCheckRegion = "EEU"
- HealthcheckPreviewNewParamsCheckRegionNsam HealthcheckPreviewNewParamsCheckRegion = "NSAM"
- HealthcheckPreviewNewParamsCheckRegionSsam HealthcheckPreviewNewParamsCheckRegion = "SSAM"
- HealthcheckPreviewNewParamsCheckRegionOc HealthcheckPreviewNewParamsCheckRegion = "OC"
- HealthcheckPreviewNewParamsCheckRegionMe HealthcheckPreviewNewParamsCheckRegion = "ME"
- HealthcheckPreviewNewParamsCheckRegionNaf HealthcheckPreviewNewParamsCheckRegion = "NAF"
- HealthcheckPreviewNewParamsCheckRegionSaf HealthcheckPreviewNewParamsCheckRegion = "SAF"
- HealthcheckPreviewNewParamsCheckRegionIn HealthcheckPreviewNewParamsCheckRegion = "IN"
- HealthcheckPreviewNewParamsCheckRegionSeas HealthcheckPreviewNewParamsCheckRegion = "SEAS"
- HealthcheckPreviewNewParamsCheckRegionNeas HealthcheckPreviewNewParamsCheckRegion = "NEAS"
- HealthcheckPreviewNewParamsCheckRegionAllRegions HealthcheckPreviewNewParamsCheckRegion = "ALL_REGIONS"
-)
-
-// Parameters specific to an HTTP or HTTPS health check.
-type HealthcheckPreviewNewParamsHTTPConfig struct {
- // Do not validate the certificate when the health check uses HTTPS.
- AllowInsecure param.Field[bool] `json:"allow_insecure"`
- // A case-insensitive sub-string to look for in the response body. If this string
- // is not found, the origin will be marked as unhealthy.
- ExpectedBody param.Field[string] `json:"expected_body"`
- // The expected HTTP response codes (e.g. "200") or code ranges (e.g. "2xx" for all
- // codes starting with 2) of the health check.
- ExpectedCodes param.Field[[]string] `json:"expected_codes"`
- // Follow redirects if the origin returns a 3xx status code.
- FollowRedirects param.Field[bool] `json:"follow_redirects"`
- // The HTTP request headers to send in the health check. It is recommended you set
- // a Host header by default. The User-Agent header cannot be overridden.
- Header param.Field[interface{}] `json:"header"`
- // The HTTP method to use for the health check.
- Method param.Field[HealthcheckPreviewNewParamsHTTPConfigMethod] `json:"method"`
- // The endpoint path to health check against.
- Path param.Field[string] `json:"path"`
- // Port number to connect to for the health check. Defaults to 80 if type is HTTP
- // or 443 if type is HTTPS.
- Port param.Field[int64] `json:"port"`
-}
-
-func (r HealthcheckPreviewNewParamsHTTPConfig) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The HTTP method to use for the health check.
-type HealthcheckPreviewNewParamsHTTPConfigMethod string
-
-const (
- HealthcheckPreviewNewParamsHTTPConfigMethodGet HealthcheckPreviewNewParamsHTTPConfigMethod = "GET"
- HealthcheckPreviewNewParamsHTTPConfigMethodHead HealthcheckPreviewNewParamsHTTPConfigMethod = "HEAD"
-)
-
-// Parameters specific to TCP health check.
-type HealthcheckPreviewNewParamsTcpConfig struct {
- // The TCP connection method to use for the health check.
- Method param.Field[HealthcheckPreviewNewParamsTcpConfigMethod] `json:"method"`
- // Port number to connect to for the health check. Defaults to 80.
- Port param.Field[int64] `json:"port"`
-}
-
-func (r HealthcheckPreviewNewParamsTcpConfig) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The TCP connection method to use for the health check.
-type HealthcheckPreviewNewParamsTcpConfigMethod string
-
-const (
- HealthcheckPreviewNewParamsTcpConfigMethodConnectionEstablished HealthcheckPreviewNewParamsTcpConfigMethod = "connection_established"
-)
-
-type HealthcheckPreviewNewResponseEnvelope struct {
- Errors []HealthcheckPreviewNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []HealthcheckPreviewNewResponseEnvelopeMessages `json:"messages,required"`
- Result HealthcheckPreviewNewResponse `json:"result,required"`
- // Whether the API call was successful
- Success HealthcheckPreviewNewResponseEnvelopeSuccess `json:"success,required"`
- JSON healthcheckPreviewNewResponseEnvelopeJSON `json:"-"`
-}
-
-// healthcheckPreviewNewResponseEnvelopeJSON contains the JSON metadata for the
-// struct [HealthcheckPreviewNewResponseEnvelope]
-type healthcheckPreviewNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HealthcheckPreviewNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r healthcheckPreviewNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type HealthcheckPreviewNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON healthcheckPreviewNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// healthcheckPreviewNewResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [HealthcheckPreviewNewResponseEnvelopeErrors]
-type healthcheckPreviewNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HealthcheckPreviewNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r healthcheckPreviewNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type HealthcheckPreviewNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON healthcheckPreviewNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// healthcheckPreviewNewResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [HealthcheckPreviewNewResponseEnvelopeMessages]
-type healthcheckPreviewNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HealthcheckPreviewNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r healthcheckPreviewNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type HealthcheckPreviewNewResponseEnvelopeSuccess bool
-
-const (
- HealthcheckPreviewNewResponseEnvelopeSuccessTrue HealthcheckPreviewNewResponseEnvelopeSuccess = true
-)
-
-type HealthcheckPreviewDeleteResponseEnvelope struct {
- Errors []HealthcheckPreviewDeleteResponseEnvelopeErrors `json:"errors,required"`
- Messages []HealthcheckPreviewDeleteResponseEnvelopeMessages `json:"messages,required"`
- Result HealthcheckPreviewDeleteResponse `json:"result,required"`
- // Whether the API call was successful
- Success HealthcheckPreviewDeleteResponseEnvelopeSuccess `json:"success,required"`
- JSON healthcheckPreviewDeleteResponseEnvelopeJSON `json:"-"`
-}
-
-// healthcheckPreviewDeleteResponseEnvelopeJSON contains the JSON metadata for the
-// struct [HealthcheckPreviewDeleteResponseEnvelope]
-type healthcheckPreviewDeleteResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HealthcheckPreviewDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r healthcheckPreviewDeleteResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type HealthcheckPreviewDeleteResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON healthcheckPreviewDeleteResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// healthcheckPreviewDeleteResponseEnvelopeErrorsJSON contains the JSON metadata
-// for the struct [HealthcheckPreviewDeleteResponseEnvelopeErrors]
-type healthcheckPreviewDeleteResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HealthcheckPreviewDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r healthcheckPreviewDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type HealthcheckPreviewDeleteResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON healthcheckPreviewDeleteResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// healthcheckPreviewDeleteResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [HealthcheckPreviewDeleteResponseEnvelopeMessages]
-type healthcheckPreviewDeleteResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HealthcheckPreviewDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r healthcheckPreviewDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type HealthcheckPreviewDeleteResponseEnvelopeSuccess bool
-
-const (
- HealthcheckPreviewDeleteResponseEnvelopeSuccessTrue HealthcheckPreviewDeleteResponseEnvelopeSuccess = true
-)
-
-type HealthcheckPreviewGetResponseEnvelope struct {
- Errors []HealthcheckPreviewGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []HealthcheckPreviewGetResponseEnvelopeMessages `json:"messages,required"`
- Result HealthcheckPreviewGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success HealthcheckPreviewGetResponseEnvelopeSuccess `json:"success,required"`
- JSON healthcheckPreviewGetResponseEnvelopeJSON `json:"-"`
-}
-
-// healthcheckPreviewGetResponseEnvelopeJSON contains the JSON metadata for the
-// struct [HealthcheckPreviewGetResponseEnvelope]
-type healthcheckPreviewGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HealthcheckPreviewGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r healthcheckPreviewGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type HealthcheckPreviewGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON healthcheckPreviewGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// healthcheckPreviewGetResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [HealthcheckPreviewGetResponseEnvelopeErrors]
-type healthcheckPreviewGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HealthcheckPreviewGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r healthcheckPreviewGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type HealthcheckPreviewGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON healthcheckPreviewGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// healthcheckPreviewGetResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [HealthcheckPreviewGetResponseEnvelopeMessages]
-type healthcheckPreviewGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HealthcheckPreviewGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r healthcheckPreviewGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type HealthcheckPreviewGetResponseEnvelopeSuccess bool
-
-const (
- HealthcheckPreviewGetResponseEnvelopeSuccessTrue HealthcheckPreviewGetResponseEnvelopeSuccess = true
-)
diff --git a/healthcheckpreview_test.go b/healthcheckpreview_test.go
deleted file mode 100644
index da41147a787..00000000000
--- a/healthcheckpreview_test.go
+++ /dev/null
@@ -1,131 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestHealthcheckPreviewNewWithOptionalParams(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"),
- )
- _, err := client.Healthchecks.Previews.New(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.HealthcheckPreviewNewParams{
- Address: cloudflare.F("www.example.com"),
- Name: cloudflare.F("server-1"),
- CheckRegions: cloudflare.F([]cloudflare.HealthcheckPreviewNewParamsCheckRegion{cloudflare.HealthcheckPreviewNewParamsCheckRegionWeu, cloudflare.HealthcheckPreviewNewParamsCheckRegionEnam}),
- ConsecutiveFails: cloudflare.F(int64(0)),
- ConsecutiveSuccesses: cloudflare.F(int64(0)),
- Description: cloudflare.F("Health check for www.example.com"),
- HTTPConfig: cloudflare.F(cloudflare.HealthcheckPreviewNewParamsHTTPConfig{
- AllowInsecure: cloudflare.F(true),
- ExpectedBody: cloudflare.F("success"),
- ExpectedCodes: cloudflare.F([]string{"2xx", "302"}),
- FollowRedirects: cloudflare.F(true),
- Header: cloudflare.F[any](map[string]interface{}{
- "Host": map[string]interface{}{
- "0": "example.com",
- },
- "X-App-ID": map[string]interface{}{
- "0": "abc123",
- },
- }),
- Method: cloudflare.F(cloudflare.HealthcheckPreviewNewParamsHTTPConfigMethodGet),
- Path: cloudflare.F("/health"),
- Port: cloudflare.F(int64(0)),
- }),
- Interval: cloudflare.F(int64(0)),
- Retries: cloudflare.F(int64(0)),
- Suspended: cloudflare.F(true),
- TcpConfig: cloudflare.F(cloudflare.HealthcheckPreviewNewParamsTcpConfig{
- Method: cloudflare.F(cloudflare.HealthcheckPreviewNewParamsTcpConfigMethodConnectionEstablished),
- Port: cloudflare.F(int64(0)),
- }),
- Timeout: cloudflare.F(int64(0)),
- Type: cloudflare.F("HTTPS"),
- },
- )
- 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())
- }
-}
-
-func TestHealthcheckPreviewDelete(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"),
- )
- _, err := client.Healthchecks.Previews.Delete(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- "023e105f4ecef8ad9ca31a8372d0c353",
- )
- 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())
- }
-}
-
-func TestHealthcheckPreviewGet(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"),
- )
- _, err := client.Healthchecks.Previews.Get(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- "023e105f4ecef8ad9ca31a8372d0c353",
- )
- 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/healthchecks/aliases.go b/healthchecks/aliases.go
new file mode 100644
index 00000000000..dc8ae3e590b
--- /dev/null
+++ b/healthchecks/aliases.go
@@ -0,0 +1,9 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package healthchecks
+
+import (
+ "github.com/cloudflare/cloudflare-go/internal/apierror"
+)
+
+type Error = apierror.Error
diff --git a/healthchecks/healthcheck.go b/healthchecks/healthcheck.go
new file mode 100644
index 00000000000..ff8c6ccf3fa
--- /dev/null
+++ b/healthchecks/healthcheck.go
@@ -0,0 +1,1216 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package healthchecks
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// HealthcheckService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewHealthcheckService] method
+// instead.
+type HealthcheckService struct {
+ Options []option.RequestOption
+ Previews *PreviewService
+}
+
+// NewHealthcheckService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewHealthcheckService(opts ...option.RequestOption) (r *HealthcheckService) {
+ r = &HealthcheckService{}
+ r.Options = opts
+ r.Previews = NewPreviewService(opts...)
+ return
+}
+
+// Create a new health check.
+func (r *HealthcheckService) New(ctx context.Context, zoneIdentifier string, body HealthcheckNewParams, opts ...option.RequestOption) (res *HealthchecksHealthchecks, err error) {
+ opts = append(r.Options[:], opts...)
+ var env HealthcheckNewResponseEnvelope
+ path := fmt.Sprintf("zones/%s/healthchecks", zoneIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Update a configured health check.
+func (r *HealthcheckService) Update(ctx context.Context, zoneIdentifier string, identifier string, body HealthcheckUpdateParams, opts ...option.RequestOption) (res *HealthchecksHealthchecks, err error) {
+ opts = append(r.Options[:], opts...)
+ var env HealthcheckUpdateResponseEnvelope
+ path := fmt.Sprintf("zones/%s/healthchecks/%s", zoneIdentifier, identifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// List configured health checks.
+func (r *HealthcheckService) List(ctx context.Context, zoneIdentifier string, opts ...option.RequestOption) (res *[]HealthchecksHealthchecks, err error) {
+ opts = append(r.Options[:], opts...)
+ var env HealthcheckListResponseEnvelope
+ path := fmt.Sprintf("zones/%s/healthchecks", zoneIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Delete a health check.
+func (r *HealthcheckService) Delete(ctx context.Context, zoneIdentifier string, identifier string, opts ...option.RequestOption) (res *HealthcheckDeleteResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env HealthcheckDeleteResponseEnvelope
+ path := fmt.Sprintf("zones/%s/healthchecks/%s", zoneIdentifier, identifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Patch a configured health check.
+func (r *HealthcheckService) Edit(ctx context.Context, zoneIdentifier string, identifier string, body HealthcheckEditParams, opts ...option.RequestOption) (res *HealthchecksHealthchecks, err error) {
+ opts = append(r.Options[:], opts...)
+ var env HealthcheckEditResponseEnvelope
+ path := fmt.Sprintf("zones/%s/healthchecks/%s", zoneIdentifier, identifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Fetch a single configured health check.
+func (r *HealthcheckService) Get(ctx context.Context, zoneIdentifier string, identifier string, opts ...option.RequestOption) (res *HealthchecksHealthchecks, err error) {
+ opts = append(r.Options[:], opts...)
+ var env HealthcheckGetResponseEnvelope
+ path := fmt.Sprintf("zones/%s/healthchecks/%s", zoneIdentifier, identifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type HealthchecksHealthchecks struct {
+ // Identifier
+ ID string `json:"id"`
+ // The hostname or IP address of the origin server to run health checks on.
+ Address string `json:"address"`
+ // A list of regions from which to run health checks. Null means Cloudflare will
+ // pick a default region.
+ CheckRegions []HealthchecksHealthchecksCheckRegion `json:"check_regions,nullable"`
+ // The number of consecutive fails required from a health check before changing the
+ // health to unhealthy.
+ ConsecutiveFails int64 `json:"consecutive_fails"`
+ // The number of consecutive successes required from a health check before changing
+ // the health to healthy.
+ ConsecutiveSuccesses int64 `json:"consecutive_successes"`
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // A human-readable description of the health check.
+ Description string `json:"description"`
+ // The current failure reason if status is unhealthy.
+ FailureReason string `json:"failure_reason"`
+ // Parameters specific to an HTTP or HTTPS health check.
+ HTTPConfig HealthchecksHealthchecksHTTPConfig `json:"http_config,nullable"`
+ // The interval between each health check. Shorter intervals may give quicker
+ // notifications if the origin status changes, but will increase load on the origin
+ // as we check from multiple locations.
+ Interval int64 `json:"interval"`
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // A short name to identify the health check. Only alphanumeric characters, hyphens
+ // and underscores are allowed.
+ Name string `json:"name"`
+ // The number of retries to attempt in case of a timeout before marking the origin
+ // as unhealthy. Retries are attempted immediately.
+ Retries int64 `json:"retries"`
+ // The current status of the origin server according to the health check.
+ Status HealthchecksHealthchecksStatus `json:"status"`
+ // If suspended, no health checks are sent to the origin.
+ Suspended bool `json:"suspended"`
+ // Parameters specific to TCP health check.
+ TcpConfig HealthchecksHealthchecksTcpConfig `json:"tcp_config,nullable"`
+ // The timeout (in seconds) before marking the health check as failed.
+ Timeout int64 `json:"timeout"`
+ // The protocol to use for the health check. Currently supported protocols are
+ // 'HTTP', 'HTTPS' and 'TCP'.
+ Type string `json:"type"`
+ JSON healthchecksHealthchecksJSON `json:"-"`
+}
+
+// healthchecksHealthchecksJSON contains the JSON metadata for the struct
+// [HealthchecksHealthchecks]
+type healthchecksHealthchecksJSON struct {
+ ID apijson.Field
+ Address apijson.Field
+ CheckRegions apijson.Field
+ ConsecutiveFails apijson.Field
+ ConsecutiveSuccesses apijson.Field
+ CreatedOn apijson.Field
+ Description apijson.Field
+ FailureReason apijson.Field
+ HTTPConfig apijson.Field
+ Interval apijson.Field
+ ModifiedOn apijson.Field
+ Name apijson.Field
+ Retries apijson.Field
+ Status apijson.Field
+ Suspended apijson.Field
+ TcpConfig apijson.Field
+ Timeout apijson.Field
+ Type apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HealthchecksHealthchecks) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r healthchecksHealthchecksJSON) RawJSON() string {
+ return r.raw
+}
+
+// WNAM: Western North America, ENAM: Eastern North America, WEU: Western Europe,
+// EEU: Eastern Europe, NSAM: Northern South America, SSAM: Southern South America,
+// OC: Oceania, ME: Middle East, NAF: North Africa, SAF: South Africa, IN: India,
+// SEAS: South East Asia, NEAS: North East Asia, ALL_REGIONS: all regions (BUSINESS
+// and ENTERPRISE customers only).
+type HealthchecksHealthchecksCheckRegion string
+
+const (
+ HealthchecksHealthchecksCheckRegionWnam HealthchecksHealthchecksCheckRegion = "WNAM"
+ HealthchecksHealthchecksCheckRegionEnam HealthchecksHealthchecksCheckRegion = "ENAM"
+ HealthchecksHealthchecksCheckRegionWeu HealthchecksHealthchecksCheckRegion = "WEU"
+ HealthchecksHealthchecksCheckRegionEeu HealthchecksHealthchecksCheckRegion = "EEU"
+ HealthchecksHealthchecksCheckRegionNsam HealthchecksHealthchecksCheckRegion = "NSAM"
+ HealthchecksHealthchecksCheckRegionSsam HealthchecksHealthchecksCheckRegion = "SSAM"
+ HealthchecksHealthchecksCheckRegionOc HealthchecksHealthchecksCheckRegion = "OC"
+ HealthchecksHealthchecksCheckRegionMe HealthchecksHealthchecksCheckRegion = "ME"
+ HealthchecksHealthchecksCheckRegionNaf HealthchecksHealthchecksCheckRegion = "NAF"
+ HealthchecksHealthchecksCheckRegionSaf HealthchecksHealthchecksCheckRegion = "SAF"
+ HealthchecksHealthchecksCheckRegionIn HealthchecksHealthchecksCheckRegion = "IN"
+ HealthchecksHealthchecksCheckRegionSeas HealthchecksHealthchecksCheckRegion = "SEAS"
+ HealthchecksHealthchecksCheckRegionNeas HealthchecksHealthchecksCheckRegion = "NEAS"
+ HealthchecksHealthchecksCheckRegionAllRegions HealthchecksHealthchecksCheckRegion = "ALL_REGIONS"
+)
+
+// Parameters specific to an HTTP or HTTPS health check.
+type HealthchecksHealthchecksHTTPConfig struct {
+ // Do not validate the certificate when the health check uses HTTPS.
+ AllowInsecure bool `json:"allow_insecure"`
+ // A case-insensitive sub-string to look for in the response body. If this string
+ // is not found, the origin will be marked as unhealthy.
+ ExpectedBody string `json:"expected_body"`
+ // The expected HTTP response codes (e.g. "200") or code ranges (e.g. "2xx" for all
+ // codes starting with 2) of the health check.
+ ExpectedCodes []string `json:"expected_codes,nullable"`
+ // Follow redirects if the origin returns a 3xx status code.
+ FollowRedirects bool `json:"follow_redirects"`
+ // The HTTP request headers to send in the health check. It is recommended you set
+ // a Host header by default. The User-Agent header cannot be overridden.
+ Header interface{} `json:"header,nullable"`
+ // The HTTP method to use for the health check.
+ Method HealthchecksHealthchecksHTTPConfigMethod `json:"method"`
+ // The endpoint path to health check against.
+ Path string `json:"path"`
+ // Port number to connect to for the health check. Defaults to 80 if type is HTTP
+ // or 443 if type is HTTPS.
+ Port int64 `json:"port"`
+ JSON healthchecksHealthchecksHTTPConfigJSON `json:"-"`
+}
+
+// healthchecksHealthchecksHTTPConfigJSON contains the JSON metadata for the struct
+// [HealthchecksHealthchecksHTTPConfig]
+type healthchecksHealthchecksHTTPConfigJSON struct {
+ AllowInsecure apijson.Field
+ ExpectedBody apijson.Field
+ ExpectedCodes apijson.Field
+ FollowRedirects apijson.Field
+ Header apijson.Field
+ Method apijson.Field
+ Path apijson.Field
+ Port apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HealthchecksHealthchecksHTTPConfig) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r healthchecksHealthchecksHTTPConfigJSON) RawJSON() string {
+ return r.raw
+}
+
+// The HTTP method to use for the health check.
+type HealthchecksHealthchecksHTTPConfigMethod string
+
+const (
+ HealthchecksHealthchecksHTTPConfigMethodGet HealthchecksHealthchecksHTTPConfigMethod = "GET"
+ HealthchecksHealthchecksHTTPConfigMethodHead HealthchecksHealthchecksHTTPConfigMethod = "HEAD"
+)
+
+// The current status of the origin server according to the health check.
+type HealthchecksHealthchecksStatus string
+
+const (
+ HealthchecksHealthchecksStatusUnknown HealthchecksHealthchecksStatus = "unknown"
+ HealthchecksHealthchecksStatusHealthy HealthchecksHealthchecksStatus = "healthy"
+ HealthchecksHealthchecksStatusUnhealthy HealthchecksHealthchecksStatus = "unhealthy"
+ HealthchecksHealthchecksStatusSuspended HealthchecksHealthchecksStatus = "suspended"
+)
+
+// Parameters specific to TCP health check.
+type HealthchecksHealthchecksTcpConfig struct {
+ // The TCP connection method to use for the health check.
+ Method HealthchecksHealthchecksTcpConfigMethod `json:"method"`
+ // Port number to connect to for the health check. Defaults to 80.
+ Port int64 `json:"port"`
+ JSON healthchecksHealthchecksTcpConfigJSON `json:"-"`
+}
+
+// healthchecksHealthchecksTcpConfigJSON contains the JSON metadata for the struct
+// [HealthchecksHealthchecksTcpConfig]
+type healthchecksHealthchecksTcpConfigJSON struct {
+ Method apijson.Field
+ Port apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HealthchecksHealthchecksTcpConfig) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r healthchecksHealthchecksTcpConfigJSON) RawJSON() string {
+ return r.raw
+}
+
+// The TCP connection method to use for the health check.
+type HealthchecksHealthchecksTcpConfigMethod string
+
+const (
+ HealthchecksHealthchecksTcpConfigMethodConnectionEstablished HealthchecksHealthchecksTcpConfigMethod = "connection_established"
+)
+
+type HealthcheckDeleteResponse struct {
+ // Identifier
+ ID string `json:"id"`
+ JSON healthcheckDeleteResponseJSON `json:"-"`
+}
+
+// healthcheckDeleteResponseJSON contains the JSON metadata for the struct
+// [HealthcheckDeleteResponse]
+type healthcheckDeleteResponseJSON struct {
+ ID apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HealthcheckDeleteResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r healthcheckDeleteResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type HealthcheckNewParams struct {
+ // The hostname or IP address of the origin server to run health checks on.
+ Address param.Field[string] `json:"address,required"`
+ // A short name to identify the health check. Only alphanumeric characters, hyphens
+ // and underscores are allowed.
+ Name param.Field[string] `json:"name,required"`
+ // A list of regions from which to run health checks. Null means Cloudflare will
+ // pick a default region.
+ CheckRegions param.Field[[]HealthcheckNewParamsCheckRegion] `json:"check_regions"`
+ // The number of consecutive fails required from a health check before changing the
+ // health to unhealthy.
+ ConsecutiveFails param.Field[int64] `json:"consecutive_fails"`
+ // The number of consecutive successes required from a health check before changing
+ // the health to healthy.
+ ConsecutiveSuccesses param.Field[int64] `json:"consecutive_successes"`
+ // A human-readable description of the health check.
+ Description param.Field[string] `json:"description"`
+ // Parameters specific to an HTTP or HTTPS health check.
+ HTTPConfig param.Field[HealthcheckNewParamsHTTPConfig] `json:"http_config"`
+ // The interval between each health check. Shorter intervals may give quicker
+ // notifications if the origin status changes, but will increase load on the origin
+ // as we check from multiple locations.
+ Interval param.Field[int64] `json:"interval"`
+ // The number of retries to attempt in case of a timeout before marking the origin
+ // as unhealthy. Retries are attempted immediately.
+ Retries param.Field[int64] `json:"retries"`
+ // If suspended, no health checks are sent to the origin.
+ Suspended param.Field[bool] `json:"suspended"`
+ // Parameters specific to TCP health check.
+ TcpConfig param.Field[HealthcheckNewParamsTcpConfig] `json:"tcp_config"`
+ // The timeout (in seconds) before marking the health check as failed.
+ Timeout param.Field[int64] `json:"timeout"`
+ // The protocol to use for the health check. Currently supported protocols are
+ // 'HTTP', 'HTTPS' and 'TCP'.
+ Type param.Field[string] `json:"type"`
+}
+
+func (r HealthcheckNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// WNAM: Western North America, ENAM: Eastern North America, WEU: Western Europe,
+// EEU: Eastern Europe, NSAM: Northern South America, SSAM: Southern South America,
+// OC: Oceania, ME: Middle East, NAF: North Africa, SAF: South Africa, IN: India,
+// SEAS: South East Asia, NEAS: North East Asia, ALL_REGIONS: all regions (BUSINESS
+// and ENTERPRISE customers only).
+type HealthcheckNewParamsCheckRegion string
+
+const (
+ HealthcheckNewParamsCheckRegionWnam HealthcheckNewParamsCheckRegion = "WNAM"
+ HealthcheckNewParamsCheckRegionEnam HealthcheckNewParamsCheckRegion = "ENAM"
+ HealthcheckNewParamsCheckRegionWeu HealthcheckNewParamsCheckRegion = "WEU"
+ HealthcheckNewParamsCheckRegionEeu HealthcheckNewParamsCheckRegion = "EEU"
+ HealthcheckNewParamsCheckRegionNsam HealthcheckNewParamsCheckRegion = "NSAM"
+ HealthcheckNewParamsCheckRegionSsam HealthcheckNewParamsCheckRegion = "SSAM"
+ HealthcheckNewParamsCheckRegionOc HealthcheckNewParamsCheckRegion = "OC"
+ HealthcheckNewParamsCheckRegionMe HealthcheckNewParamsCheckRegion = "ME"
+ HealthcheckNewParamsCheckRegionNaf HealthcheckNewParamsCheckRegion = "NAF"
+ HealthcheckNewParamsCheckRegionSaf HealthcheckNewParamsCheckRegion = "SAF"
+ HealthcheckNewParamsCheckRegionIn HealthcheckNewParamsCheckRegion = "IN"
+ HealthcheckNewParamsCheckRegionSeas HealthcheckNewParamsCheckRegion = "SEAS"
+ HealthcheckNewParamsCheckRegionNeas HealthcheckNewParamsCheckRegion = "NEAS"
+ HealthcheckNewParamsCheckRegionAllRegions HealthcheckNewParamsCheckRegion = "ALL_REGIONS"
+)
+
+// Parameters specific to an HTTP or HTTPS health check.
+type HealthcheckNewParamsHTTPConfig struct {
+ // Do not validate the certificate when the health check uses HTTPS.
+ AllowInsecure param.Field[bool] `json:"allow_insecure"`
+ // A case-insensitive sub-string to look for in the response body. If this string
+ // is not found, the origin will be marked as unhealthy.
+ ExpectedBody param.Field[string] `json:"expected_body"`
+ // The expected HTTP response codes (e.g. "200") or code ranges (e.g. "2xx" for all
+ // codes starting with 2) of the health check.
+ ExpectedCodes param.Field[[]string] `json:"expected_codes"`
+ // Follow redirects if the origin returns a 3xx status code.
+ FollowRedirects param.Field[bool] `json:"follow_redirects"`
+ // The HTTP request headers to send in the health check. It is recommended you set
+ // a Host header by default. The User-Agent header cannot be overridden.
+ Header param.Field[interface{}] `json:"header"`
+ // The HTTP method to use for the health check.
+ Method param.Field[HealthcheckNewParamsHTTPConfigMethod] `json:"method"`
+ // The endpoint path to health check against.
+ Path param.Field[string] `json:"path"`
+ // Port number to connect to for the health check. Defaults to 80 if type is HTTP
+ // or 443 if type is HTTPS.
+ Port param.Field[int64] `json:"port"`
+}
+
+func (r HealthcheckNewParamsHTTPConfig) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The HTTP method to use for the health check.
+type HealthcheckNewParamsHTTPConfigMethod string
+
+const (
+ HealthcheckNewParamsHTTPConfigMethodGet HealthcheckNewParamsHTTPConfigMethod = "GET"
+ HealthcheckNewParamsHTTPConfigMethodHead HealthcheckNewParamsHTTPConfigMethod = "HEAD"
+)
+
+// Parameters specific to TCP health check.
+type HealthcheckNewParamsTcpConfig struct {
+ // The TCP connection method to use for the health check.
+ Method param.Field[HealthcheckNewParamsTcpConfigMethod] `json:"method"`
+ // Port number to connect to for the health check. Defaults to 80.
+ Port param.Field[int64] `json:"port"`
+}
+
+func (r HealthcheckNewParamsTcpConfig) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The TCP connection method to use for the health check.
+type HealthcheckNewParamsTcpConfigMethod string
+
+const (
+ HealthcheckNewParamsTcpConfigMethodConnectionEstablished HealthcheckNewParamsTcpConfigMethod = "connection_established"
+)
+
+type HealthcheckNewResponseEnvelope struct {
+ Errors []HealthcheckNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []HealthcheckNewResponseEnvelopeMessages `json:"messages,required"`
+ Result HealthchecksHealthchecks `json:"result,required"`
+ // Whether the API call was successful
+ Success HealthcheckNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON healthcheckNewResponseEnvelopeJSON `json:"-"`
+}
+
+// healthcheckNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [HealthcheckNewResponseEnvelope]
+type healthcheckNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HealthcheckNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r healthcheckNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type HealthcheckNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON healthcheckNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// healthcheckNewResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [HealthcheckNewResponseEnvelopeErrors]
+type healthcheckNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HealthcheckNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r healthcheckNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type HealthcheckNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON healthcheckNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// healthcheckNewResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [HealthcheckNewResponseEnvelopeMessages]
+type healthcheckNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HealthcheckNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r healthcheckNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type HealthcheckNewResponseEnvelopeSuccess bool
+
+const (
+ HealthcheckNewResponseEnvelopeSuccessTrue HealthcheckNewResponseEnvelopeSuccess = true
+)
+
+type HealthcheckUpdateParams struct {
+ // The hostname or IP address of the origin server to run health checks on.
+ Address param.Field[string] `json:"address,required"`
+ // A short name to identify the health check. Only alphanumeric characters, hyphens
+ // and underscores are allowed.
+ Name param.Field[string] `json:"name,required"`
+ // A list of regions from which to run health checks. Null means Cloudflare will
+ // pick a default region.
+ CheckRegions param.Field[[]HealthcheckUpdateParamsCheckRegion] `json:"check_regions"`
+ // The number of consecutive fails required from a health check before changing the
+ // health to unhealthy.
+ ConsecutiveFails param.Field[int64] `json:"consecutive_fails"`
+ // The number of consecutive successes required from a health check before changing
+ // the health to healthy.
+ ConsecutiveSuccesses param.Field[int64] `json:"consecutive_successes"`
+ // A human-readable description of the health check.
+ Description param.Field[string] `json:"description"`
+ // Parameters specific to an HTTP or HTTPS health check.
+ HTTPConfig param.Field[HealthcheckUpdateParamsHTTPConfig] `json:"http_config"`
+ // The interval between each health check. Shorter intervals may give quicker
+ // notifications if the origin status changes, but will increase load on the origin
+ // as we check from multiple locations.
+ Interval param.Field[int64] `json:"interval"`
+ // The number of retries to attempt in case of a timeout before marking the origin
+ // as unhealthy. Retries are attempted immediately.
+ Retries param.Field[int64] `json:"retries"`
+ // If suspended, no health checks are sent to the origin.
+ Suspended param.Field[bool] `json:"suspended"`
+ // Parameters specific to TCP health check.
+ TcpConfig param.Field[HealthcheckUpdateParamsTcpConfig] `json:"tcp_config"`
+ // The timeout (in seconds) before marking the health check as failed.
+ Timeout param.Field[int64] `json:"timeout"`
+ // The protocol to use for the health check. Currently supported protocols are
+ // 'HTTP', 'HTTPS' and 'TCP'.
+ Type param.Field[string] `json:"type"`
+}
+
+func (r HealthcheckUpdateParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// WNAM: Western North America, ENAM: Eastern North America, WEU: Western Europe,
+// EEU: Eastern Europe, NSAM: Northern South America, SSAM: Southern South America,
+// OC: Oceania, ME: Middle East, NAF: North Africa, SAF: South Africa, IN: India,
+// SEAS: South East Asia, NEAS: North East Asia, ALL_REGIONS: all regions (BUSINESS
+// and ENTERPRISE customers only).
+type HealthcheckUpdateParamsCheckRegion string
+
+const (
+ HealthcheckUpdateParamsCheckRegionWnam HealthcheckUpdateParamsCheckRegion = "WNAM"
+ HealthcheckUpdateParamsCheckRegionEnam HealthcheckUpdateParamsCheckRegion = "ENAM"
+ HealthcheckUpdateParamsCheckRegionWeu HealthcheckUpdateParamsCheckRegion = "WEU"
+ HealthcheckUpdateParamsCheckRegionEeu HealthcheckUpdateParamsCheckRegion = "EEU"
+ HealthcheckUpdateParamsCheckRegionNsam HealthcheckUpdateParamsCheckRegion = "NSAM"
+ HealthcheckUpdateParamsCheckRegionSsam HealthcheckUpdateParamsCheckRegion = "SSAM"
+ HealthcheckUpdateParamsCheckRegionOc HealthcheckUpdateParamsCheckRegion = "OC"
+ HealthcheckUpdateParamsCheckRegionMe HealthcheckUpdateParamsCheckRegion = "ME"
+ HealthcheckUpdateParamsCheckRegionNaf HealthcheckUpdateParamsCheckRegion = "NAF"
+ HealthcheckUpdateParamsCheckRegionSaf HealthcheckUpdateParamsCheckRegion = "SAF"
+ HealthcheckUpdateParamsCheckRegionIn HealthcheckUpdateParamsCheckRegion = "IN"
+ HealthcheckUpdateParamsCheckRegionSeas HealthcheckUpdateParamsCheckRegion = "SEAS"
+ HealthcheckUpdateParamsCheckRegionNeas HealthcheckUpdateParamsCheckRegion = "NEAS"
+ HealthcheckUpdateParamsCheckRegionAllRegions HealthcheckUpdateParamsCheckRegion = "ALL_REGIONS"
+)
+
+// Parameters specific to an HTTP or HTTPS health check.
+type HealthcheckUpdateParamsHTTPConfig struct {
+ // Do not validate the certificate when the health check uses HTTPS.
+ AllowInsecure param.Field[bool] `json:"allow_insecure"`
+ // A case-insensitive sub-string to look for in the response body. If this string
+ // is not found, the origin will be marked as unhealthy.
+ ExpectedBody param.Field[string] `json:"expected_body"`
+ // The expected HTTP response codes (e.g. "200") or code ranges (e.g. "2xx" for all
+ // codes starting with 2) of the health check.
+ ExpectedCodes param.Field[[]string] `json:"expected_codes"`
+ // Follow redirects if the origin returns a 3xx status code.
+ FollowRedirects param.Field[bool] `json:"follow_redirects"`
+ // The HTTP request headers to send in the health check. It is recommended you set
+ // a Host header by default. The User-Agent header cannot be overridden.
+ Header param.Field[interface{}] `json:"header"`
+ // The HTTP method to use for the health check.
+ Method param.Field[HealthcheckUpdateParamsHTTPConfigMethod] `json:"method"`
+ // The endpoint path to health check against.
+ Path param.Field[string] `json:"path"`
+ // Port number to connect to for the health check. Defaults to 80 if type is HTTP
+ // or 443 if type is HTTPS.
+ Port param.Field[int64] `json:"port"`
+}
+
+func (r HealthcheckUpdateParamsHTTPConfig) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The HTTP method to use for the health check.
+type HealthcheckUpdateParamsHTTPConfigMethod string
+
+const (
+ HealthcheckUpdateParamsHTTPConfigMethodGet HealthcheckUpdateParamsHTTPConfigMethod = "GET"
+ HealthcheckUpdateParamsHTTPConfigMethodHead HealthcheckUpdateParamsHTTPConfigMethod = "HEAD"
+)
+
+// Parameters specific to TCP health check.
+type HealthcheckUpdateParamsTcpConfig struct {
+ // The TCP connection method to use for the health check.
+ Method param.Field[HealthcheckUpdateParamsTcpConfigMethod] `json:"method"`
+ // Port number to connect to for the health check. Defaults to 80.
+ Port param.Field[int64] `json:"port"`
+}
+
+func (r HealthcheckUpdateParamsTcpConfig) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The TCP connection method to use for the health check.
+type HealthcheckUpdateParamsTcpConfigMethod string
+
+const (
+ HealthcheckUpdateParamsTcpConfigMethodConnectionEstablished HealthcheckUpdateParamsTcpConfigMethod = "connection_established"
+)
+
+type HealthcheckUpdateResponseEnvelope struct {
+ Errors []HealthcheckUpdateResponseEnvelopeErrors `json:"errors,required"`
+ Messages []HealthcheckUpdateResponseEnvelopeMessages `json:"messages,required"`
+ Result HealthchecksHealthchecks `json:"result,required"`
+ // Whether the API call was successful
+ Success HealthcheckUpdateResponseEnvelopeSuccess `json:"success,required"`
+ JSON healthcheckUpdateResponseEnvelopeJSON `json:"-"`
+}
+
+// healthcheckUpdateResponseEnvelopeJSON contains the JSON metadata for the struct
+// [HealthcheckUpdateResponseEnvelope]
+type healthcheckUpdateResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HealthcheckUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r healthcheckUpdateResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type HealthcheckUpdateResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON healthcheckUpdateResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// healthcheckUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [HealthcheckUpdateResponseEnvelopeErrors]
+type healthcheckUpdateResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HealthcheckUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r healthcheckUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type HealthcheckUpdateResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON healthcheckUpdateResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// healthcheckUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [HealthcheckUpdateResponseEnvelopeMessages]
+type healthcheckUpdateResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HealthcheckUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r healthcheckUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type HealthcheckUpdateResponseEnvelopeSuccess bool
+
+const (
+ HealthcheckUpdateResponseEnvelopeSuccessTrue HealthcheckUpdateResponseEnvelopeSuccess = true
+)
+
+type HealthcheckListResponseEnvelope struct {
+ Errors []HealthcheckListResponseEnvelopeErrors `json:"errors,required"`
+ Messages []HealthcheckListResponseEnvelopeMessages `json:"messages,required"`
+ Result []HealthchecksHealthchecks `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success HealthcheckListResponseEnvelopeSuccess `json:"success,required"`
+ ResultInfo HealthcheckListResponseEnvelopeResultInfo `json:"result_info"`
+ JSON healthcheckListResponseEnvelopeJSON `json:"-"`
+}
+
+// healthcheckListResponseEnvelopeJSON contains the JSON metadata for the struct
+// [HealthcheckListResponseEnvelope]
+type healthcheckListResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ ResultInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HealthcheckListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r healthcheckListResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type HealthcheckListResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON healthcheckListResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// healthcheckListResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [HealthcheckListResponseEnvelopeErrors]
+type healthcheckListResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HealthcheckListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r healthcheckListResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type HealthcheckListResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON healthcheckListResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// healthcheckListResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [HealthcheckListResponseEnvelopeMessages]
+type healthcheckListResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HealthcheckListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r healthcheckListResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type HealthcheckListResponseEnvelopeSuccess bool
+
+const (
+ HealthcheckListResponseEnvelopeSuccessTrue HealthcheckListResponseEnvelopeSuccess = true
+)
+
+type HealthcheckListResponseEnvelopeResultInfo struct {
+ // Total number of results for the requested service
+ Count float64 `json:"count"`
+ // Current page within paginated list of results
+ Page float64 `json:"page"`
+ // Number of results per page of results
+ PerPage float64 `json:"per_page"`
+ // Total results available without any search parameters
+ TotalCount float64 `json:"total_count"`
+ JSON healthcheckListResponseEnvelopeResultInfoJSON `json:"-"`
+}
+
+// healthcheckListResponseEnvelopeResultInfoJSON contains the JSON metadata for the
+// struct [HealthcheckListResponseEnvelopeResultInfo]
+type healthcheckListResponseEnvelopeResultInfoJSON struct {
+ Count apijson.Field
+ Page apijson.Field
+ PerPage apijson.Field
+ TotalCount apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HealthcheckListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r healthcheckListResponseEnvelopeResultInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type HealthcheckDeleteResponseEnvelope struct {
+ Errors []HealthcheckDeleteResponseEnvelopeErrors `json:"errors,required"`
+ Messages []HealthcheckDeleteResponseEnvelopeMessages `json:"messages,required"`
+ Result HealthcheckDeleteResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success HealthcheckDeleteResponseEnvelopeSuccess `json:"success,required"`
+ JSON healthcheckDeleteResponseEnvelopeJSON `json:"-"`
+}
+
+// healthcheckDeleteResponseEnvelopeJSON contains the JSON metadata for the struct
+// [HealthcheckDeleteResponseEnvelope]
+type healthcheckDeleteResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HealthcheckDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r healthcheckDeleteResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type HealthcheckDeleteResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON healthcheckDeleteResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// healthcheckDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [HealthcheckDeleteResponseEnvelopeErrors]
+type healthcheckDeleteResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HealthcheckDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r healthcheckDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type HealthcheckDeleteResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON healthcheckDeleteResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// healthcheckDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [HealthcheckDeleteResponseEnvelopeMessages]
+type healthcheckDeleteResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HealthcheckDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r healthcheckDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type HealthcheckDeleteResponseEnvelopeSuccess bool
+
+const (
+ HealthcheckDeleteResponseEnvelopeSuccessTrue HealthcheckDeleteResponseEnvelopeSuccess = true
+)
+
+type HealthcheckEditParams struct {
+ // The hostname or IP address of the origin server to run health checks on.
+ Address param.Field[string] `json:"address,required"`
+ // A short name to identify the health check. Only alphanumeric characters, hyphens
+ // and underscores are allowed.
+ Name param.Field[string] `json:"name,required"`
+ // A list of regions from which to run health checks. Null means Cloudflare will
+ // pick a default region.
+ CheckRegions param.Field[[]HealthcheckEditParamsCheckRegion] `json:"check_regions"`
+ // The number of consecutive fails required from a health check before changing the
+ // health to unhealthy.
+ ConsecutiveFails param.Field[int64] `json:"consecutive_fails"`
+ // The number of consecutive successes required from a health check before changing
+ // the health to healthy.
+ ConsecutiveSuccesses param.Field[int64] `json:"consecutive_successes"`
+ // A human-readable description of the health check.
+ Description param.Field[string] `json:"description"`
+ // Parameters specific to an HTTP or HTTPS health check.
+ HTTPConfig param.Field[HealthcheckEditParamsHTTPConfig] `json:"http_config"`
+ // The interval between each health check. Shorter intervals may give quicker
+ // notifications if the origin status changes, but will increase load on the origin
+ // as we check from multiple locations.
+ Interval param.Field[int64] `json:"interval"`
+ // The number of retries to attempt in case of a timeout before marking the origin
+ // as unhealthy. Retries are attempted immediately.
+ Retries param.Field[int64] `json:"retries"`
+ // If suspended, no health checks are sent to the origin.
+ Suspended param.Field[bool] `json:"suspended"`
+ // Parameters specific to TCP health check.
+ TcpConfig param.Field[HealthcheckEditParamsTcpConfig] `json:"tcp_config"`
+ // The timeout (in seconds) before marking the health check as failed.
+ Timeout param.Field[int64] `json:"timeout"`
+ // The protocol to use for the health check. Currently supported protocols are
+ // 'HTTP', 'HTTPS' and 'TCP'.
+ Type param.Field[string] `json:"type"`
+}
+
+func (r HealthcheckEditParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// WNAM: Western North America, ENAM: Eastern North America, WEU: Western Europe,
+// EEU: Eastern Europe, NSAM: Northern South America, SSAM: Southern South America,
+// OC: Oceania, ME: Middle East, NAF: North Africa, SAF: South Africa, IN: India,
+// SEAS: South East Asia, NEAS: North East Asia, ALL_REGIONS: all regions (BUSINESS
+// and ENTERPRISE customers only).
+type HealthcheckEditParamsCheckRegion string
+
+const (
+ HealthcheckEditParamsCheckRegionWnam HealthcheckEditParamsCheckRegion = "WNAM"
+ HealthcheckEditParamsCheckRegionEnam HealthcheckEditParamsCheckRegion = "ENAM"
+ HealthcheckEditParamsCheckRegionWeu HealthcheckEditParamsCheckRegion = "WEU"
+ HealthcheckEditParamsCheckRegionEeu HealthcheckEditParamsCheckRegion = "EEU"
+ HealthcheckEditParamsCheckRegionNsam HealthcheckEditParamsCheckRegion = "NSAM"
+ HealthcheckEditParamsCheckRegionSsam HealthcheckEditParamsCheckRegion = "SSAM"
+ HealthcheckEditParamsCheckRegionOc HealthcheckEditParamsCheckRegion = "OC"
+ HealthcheckEditParamsCheckRegionMe HealthcheckEditParamsCheckRegion = "ME"
+ HealthcheckEditParamsCheckRegionNaf HealthcheckEditParamsCheckRegion = "NAF"
+ HealthcheckEditParamsCheckRegionSaf HealthcheckEditParamsCheckRegion = "SAF"
+ HealthcheckEditParamsCheckRegionIn HealthcheckEditParamsCheckRegion = "IN"
+ HealthcheckEditParamsCheckRegionSeas HealthcheckEditParamsCheckRegion = "SEAS"
+ HealthcheckEditParamsCheckRegionNeas HealthcheckEditParamsCheckRegion = "NEAS"
+ HealthcheckEditParamsCheckRegionAllRegions HealthcheckEditParamsCheckRegion = "ALL_REGIONS"
+)
+
+// Parameters specific to an HTTP or HTTPS health check.
+type HealthcheckEditParamsHTTPConfig struct {
+ // Do not validate the certificate when the health check uses HTTPS.
+ AllowInsecure param.Field[bool] `json:"allow_insecure"`
+ // A case-insensitive sub-string to look for in the response body. If this string
+ // is not found, the origin will be marked as unhealthy.
+ ExpectedBody param.Field[string] `json:"expected_body"`
+ // The expected HTTP response codes (e.g. "200") or code ranges (e.g. "2xx" for all
+ // codes starting with 2) of the health check.
+ ExpectedCodes param.Field[[]string] `json:"expected_codes"`
+ // Follow redirects if the origin returns a 3xx status code.
+ FollowRedirects param.Field[bool] `json:"follow_redirects"`
+ // The HTTP request headers to send in the health check. It is recommended you set
+ // a Host header by default. The User-Agent header cannot be overridden.
+ Header param.Field[interface{}] `json:"header"`
+ // The HTTP method to use for the health check.
+ Method param.Field[HealthcheckEditParamsHTTPConfigMethod] `json:"method"`
+ // The endpoint path to health check against.
+ Path param.Field[string] `json:"path"`
+ // Port number to connect to for the health check. Defaults to 80 if type is HTTP
+ // or 443 if type is HTTPS.
+ Port param.Field[int64] `json:"port"`
+}
+
+func (r HealthcheckEditParamsHTTPConfig) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The HTTP method to use for the health check.
+type HealthcheckEditParamsHTTPConfigMethod string
+
+const (
+ HealthcheckEditParamsHTTPConfigMethodGet HealthcheckEditParamsHTTPConfigMethod = "GET"
+ HealthcheckEditParamsHTTPConfigMethodHead HealthcheckEditParamsHTTPConfigMethod = "HEAD"
+)
+
+// Parameters specific to TCP health check.
+type HealthcheckEditParamsTcpConfig struct {
+ // The TCP connection method to use for the health check.
+ Method param.Field[HealthcheckEditParamsTcpConfigMethod] `json:"method"`
+ // Port number to connect to for the health check. Defaults to 80.
+ Port param.Field[int64] `json:"port"`
+}
+
+func (r HealthcheckEditParamsTcpConfig) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The TCP connection method to use for the health check.
+type HealthcheckEditParamsTcpConfigMethod string
+
+const (
+ HealthcheckEditParamsTcpConfigMethodConnectionEstablished HealthcheckEditParamsTcpConfigMethod = "connection_established"
+)
+
+type HealthcheckEditResponseEnvelope struct {
+ Errors []HealthcheckEditResponseEnvelopeErrors `json:"errors,required"`
+ Messages []HealthcheckEditResponseEnvelopeMessages `json:"messages,required"`
+ Result HealthchecksHealthchecks `json:"result,required"`
+ // Whether the API call was successful
+ Success HealthcheckEditResponseEnvelopeSuccess `json:"success,required"`
+ JSON healthcheckEditResponseEnvelopeJSON `json:"-"`
+}
+
+// healthcheckEditResponseEnvelopeJSON contains the JSON metadata for the struct
+// [HealthcheckEditResponseEnvelope]
+type healthcheckEditResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HealthcheckEditResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r healthcheckEditResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type HealthcheckEditResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON healthcheckEditResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// healthcheckEditResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [HealthcheckEditResponseEnvelopeErrors]
+type healthcheckEditResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HealthcheckEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r healthcheckEditResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type HealthcheckEditResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON healthcheckEditResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// healthcheckEditResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [HealthcheckEditResponseEnvelopeMessages]
+type healthcheckEditResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HealthcheckEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r healthcheckEditResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type HealthcheckEditResponseEnvelopeSuccess bool
+
+const (
+ HealthcheckEditResponseEnvelopeSuccessTrue HealthcheckEditResponseEnvelopeSuccess = true
+)
+
+type HealthcheckGetResponseEnvelope struct {
+ Errors []HealthcheckGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []HealthcheckGetResponseEnvelopeMessages `json:"messages,required"`
+ Result HealthchecksHealthchecks `json:"result,required"`
+ // Whether the API call was successful
+ Success HealthcheckGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON healthcheckGetResponseEnvelopeJSON `json:"-"`
+}
+
+// healthcheckGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [HealthcheckGetResponseEnvelope]
+type healthcheckGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HealthcheckGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r healthcheckGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type HealthcheckGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON healthcheckGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// healthcheckGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [HealthcheckGetResponseEnvelopeErrors]
+type healthcheckGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HealthcheckGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r healthcheckGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type HealthcheckGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON healthcheckGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// healthcheckGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [HealthcheckGetResponseEnvelopeMessages]
+type healthcheckGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HealthcheckGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r healthcheckGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type HealthcheckGetResponseEnvelopeSuccess bool
+
+const (
+ HealthcheckGetResponseEnvelopeSuccessTrue HealthcheckGetResponseEnvelopeSuccess = true
+)
diff --git a/healthcheck_test.go b/healthchecks/healthcheck_test.go
similarity index 82%
rename from healthcheck_test.go
rename to healthchecks/healthcheck_test.go
index d111599aad5..6e52ad68d98 100644
--- a/healthcheck_test.go
+++ b/healthchecks/healthcheck_test.go
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package cloudflare_test
+package healthchecks_test
import (
"context"
@@ -9,6 +9,7 @@ import (
"testing"
"github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/healthchecks"
"github.com/cloudflare/cloudflare-go/internal/testutil"
"github.com/cloudflare/cloudflare-go/option"
)
@@ -30,14 +31,14 @@ func TestHealthcheckNewWithOptionalParams(t *testing.T) {
_, err := client.Healthchecks.New(
context.TODO(),
"023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.HealthcheckNewParams{
+ healthchecks.HealthcheckNewParams{
Address: cloudflare.F("www.example.com"),
Name: cloudflare.F("server-1"),
- CheckRegions: cloudflare.F([]cloudflare.HealthcheckNewParamsCheckRegion{cloudflare.HealthcheckNewParamsCheckRegionWeu, cloudflare.HealthcheckNewParamsCheckRegionEnam}),
+ CheckRegions: cloudflare.F([]healthchecks.HealthcheckNewParamsCheckRegion{healthchecks.HealthcheckNewParamsCheckRegionWeu, healthchecks.HealthcheckNewParamsCheckRegionEnam}),
ConsecutiveFails: cloudflare.F(int64(0)),
ConsecutiveSuccesses: cloudflare.F(int64(0)),
Description: cloudflare.F("Health check for www.example.com"),
- HTTPConfig: cloudflare.F(cloudflare.HealthcheckNewParamsHTTPConfig{
+ HTTPConfig: cloudflare.F(healthchecks.HealthcheckNewParamsHTTPConfig{
AllowInsecure: cloudflare.F(true),
ExpectedBody: cloudflare.F("success"),
ExpectedCodes: cloudflare.F([]string{"2xx", "302"}),
@@ -50,15 +51,15 @@ func TestHealthcheckNewWithOptionalParams(t *testing.T) {
"0": "abc123",
},
}),
- Method: cloudflare.F(cloudflare.HealthcheckNewParamsHTTPConfigMethodGet),
+ Method: cloudflare.F(healthchecks.HealthcheckNewParamsHTTPConfigMethodGet),
Path: cloudflare.F("/health"),
Port: cloudflare.F(int64(0)),
}),
Interval: cloudflare.F(int64(0)),
Retries: cloudflare.F(int64(0)),
Suspended: cloudflare.F(true),
- TcpConfig: cloudflare.F(cloudflare.HealthcheckNewParamsTcpConfig{
- Method: cloudflare.F(cloudflare.HealthcheckNewParamsTcpConfigMethodConnectionEstablished),
+ TcpConfig: cloudflare.F(healthchecks.HealthcheckNewParamsTcpConfig{
+ Method: cloudflare.F(healthchecks.HealthcheckNewParamsTcpConfigMethodConnectionEstablished),
Port: cloudflare.F(int64(0)),
}),
Timeout: cloudflare.F(int64(0)),
@@ -92,14 +93,14 @@ func TestHealthcheckUpdateWithOptionalParams(t *testing.T) {
context.TODO(),
"023e105f4ecef8ad9ca31a8372d0c353",
"023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.HealthcheckUpdateParams{
+ healthchecks.HealthcheckUpdateParams{
Address: cloudflare.F("www.example.com"),
Name: cloudflare.F("server-1"),
- CheckRegions: cloudflare.F([]cloudflare.HealthcheckUpdateParamsCheckRegion{cloudflare.HealthcheckUpdateParamsCheckRegionWeu, cloudflare.HealthcheckUpdateParamsCheckRegionEnam}),
+ CheckRegions: cloudflare.F([]healthchecks.HealthcheckUpdateParamsCheckRegion{healthchecks.HealthcheckUpdateParamsCheckRegionWeu, healthchecks.HealthcheckUpdateParamsCheckRegionEnam}),
ConsecutiveFails: cloudflare.F(int64(0)),
ConsecutiveSuccesses: cloudflare.F(int64(0)),
Description: cloudflare.F("Health check for www.example.com"),
- HTTPConfig: cloudflare.F(cloudflare.HealthcheckUpdateParamsHTTPConfig{
+ HTTPConfig: cloudflare.F(healthchecks.HealthcheckUpdateParamsHTTPConfig{
AllowInsecure: cloudflare.F(true),
ExpectedBody: cloudflare.F("success"),
ExpectedCodes: cloudflare.F([]string{"2xx", "302"}),
@@ -112,15 +113,15 @@ func TestHealthcheckUpdateWithOptionalParams(t *testing.T) {
"0": "abc123",
},
}),
- Method: cloudflare.F(cloudflare.HealthcheckUpdateParamsHTTPConfigMethodGet),
+ Method: cloudflare.F(healthchecks.HealthcheckUpdateParamsHTTPConfigMethodGet),
Path: cloudflare.F("/health"),
Port: cloudflare.F(int64(0)),
}),
Interval: cloudflare.F(int64(0)),
Retries: cloudflare.F(int64(0)),
Suspended: cloudflare.F(true),
- TcpConfig: cloudflare.F(cloudflare.HealthcheckUpdateParamsTcpConfig{
- Method: cloudflare.F(cloudflare.HealthcheckUpdateParamsTcpConfigMethodConnectionEstablished),
+ TcpConfig: cloudflare.F(healthchecks.HealthcheckUpdateParamsTcpConfig{
+ Method: cloudflare.F(healthchecks.HealthcheckUpdateParamsTcpConfigMethodConnectionEstablished),
Port: cloudflare.F(int64(0)),
}),
Timeout: cloudflare.F(int64(0)),
@@ -206,14 +207,14 @@ func TestHealthcheckEditWithOptionalParams(t *testing.T) {
context.TODO(),
"023e105f4ecef8ad9ca31a8372d0c353",
"023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.HealthcheckEditParams{
+ healthchecks.HealthcheckEditParams{
Address: cloudflare.F("www.example.com"),
Name: cloudflare.F("server-1"),
- CheckRegions: cloudflare.F([]cloudflare.HealthcheckEditParamsCheckRegion{cloudflare.HealthcheckEditParamsCheckRegionWeu, cloudflare.HealthcheckEditParamsCheckRegionEnam}),
+ CheckRegions: cloudflare.F([]healthchecks.HealthcheckEditParamsCheckRegion{healthchecks.HealthcheckEditParamsCheckRegionWeu, healthchecks.HealthcheckEditParamsCheckRegionEnam}),
ConsecutiveFails: cloudflare.F(int64(0)),
ConsecutiveSuccesses: cloudflare.F(int64(0)),
Description: cloudflare.F("Health check for www.example.com"),
- HTTPConfig: cloudflare.F(cloudflare.HealthcheckEditParamsHTTPConfig{
+ HTTPConfig: cloudflare.F(healthchecks.HealthcheckEditParamsHTTPConfig{
AllowInsecure: cloudflare.F(true),
ExpectedBody: cloudflare.F("success"),
ExpectedCodes: cloudflare.F([]string{"2xx", "302"}),
@@ -226,15 +227,15 @@ func TestHealthcheckEditWithOptionalParams(t *testing.T) {
"0": "abc123",
},
}),
- Method: cloudflare.F(cloudflare.HealthcheckEditParamsHTTPConfigMethodGet),
+ Method: cloudflare.F(healthchecks.HealthcheckEditParamsHTTPConfigMethodGet),
Path: cloudflare.F("/health"),
Port: cloudflare.F(int64(0)),
}),
Interval: cloudflare.F(int64(0)),
Retries: cloudflare.F(int64(0)),
Suspended: cloudflare.F(true),
- TcpConfig: cloudflare.F(cloudflare.HealthcheckEditParamsTcpConfig{
- Method: cloudflare.F(cloudflare.HealthcheckEditParamsTcpConfigMethodConnectionEstablished),
+ TcpConfig: cloudflare.F(healthchecks.HealthcheckEditParamsTcpConfig{
+ Method: cloudflare.F(healthchecks.HealthcheckEditParamsTcpConfigMethodConnectionEstablished),
Port: cloudflare.F(int64(0)),
}),
Timeout: cloudflare.F(int64(0)),
diff --git a/healthchecks/preview.go b/healthchecks/preview.go
new file mode 100644
index 00000000000..3545965486c
--- /dev/null
+++ b/healthchecks/preview.go
@@ -0,0 +1,455 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package healthchecks
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// PreviewService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewPreviewService] method instead.
+type PreviewService struct {
+ Options []option.RequestOption
+}
+
+// NewPreviewService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewPreviewService(opts ...option.RequestOption) (r *PreviewService) {
+ r = &PreviewService{}
+ r.Options = opts
+ return
+}
+
+// Create a new preview health check.
+func (r *PreviewService) New(ctx context.Context, zoneIdentifier string, body PreviewNewParams, opts ...option.RequestOption) (res *HealthchecksHealthchecks, err error) {
+ opts = append(r.Options[:], opts...)
+ var env PreviewNewResponseEnvelope
+ path := fmt.Sprintf("zones/%s/healthchecks/preview", zoneIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Delete a health check.
+func (r *PreviewService) Delete(ctx context.Context, zoneIdentifier string, identifier string, opts ...option.RequestOption) (res *PreviewDeleteResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env PreviewDeleteResponseEnvelope
+ path := fmt.Sprintf("zones/%s/healthchecks/preview/%s", zoneIdentifier, identifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Fetch a single configured health check preview.
+func (r *PreviewService) Get(ctx context.Context, zoneIdentifier string, identifier string, opts ...option.RequestOption) (res *HealthchecksHealthchecks, err error) {
+ opts = append(r.Options[:], opts...)
+ var env PreviewGetResponseEnvelope
+ path := fmt.Sprintf("zones/%s/healthchecks/preview/%s", zoneIdentifier, identifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type PreviewDeleteResponse struct {
+ // Identifier
+ ID string `json:"id"`
+ JSON previewDeleteResponseJSON `json:"-"`
+}
+
+// previewDeleteResponseJSON contains the JSON metadata for the struct
+// [PreviewDeleteResponse]
+type previewDeleteResponseJSON struct {
+ ID apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PreviewDeleteResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r previewDeleteResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type PreviewNewParams struct {
+ // The hostname or IP address of the origin server to run health checks on.
+ Address param.Field[string] `json:"address,required"`
+ // A short name to identify the health check. Only alphanumeric characters, hyphens
+ // and underscores are allowed.
+ Name param.Field[string] `json:"name,required"`
+ // A list of regions from which to run health checks. Null means Cloudflare will
+ // pick a default region.
+ CheckRegions param.Field[[]PreviewNewParamsCheckRegion] `json:"check_regions"`
+ // The number of consecutive fails required from a health check before changing the
+ // health to unhealthy.
+ ConsecutiveFails param.Field[int64] `json:"consecutive_fails"`
+ // The number of consecutive successes required from a health check before changing
+ // the health to healthy.
+ ConsecutiveSuccesses param.Field[int64] `json:"consecutive_successes"`
+ // A human-readable description of the health check.
+ Description param.Field[string] `json:"description"`
+ // Parameters specific to an HTTP or HTTPS health check.
+ HTTPConfig param.Field[PreviewNewParamsHTTPConfig] `json:"http_config"`
+ // The interval between each health check. Shorter intervals may give quicker
+ // notifications if the origin status changes, but will increase load on the origin
+ // as we check from multiple locations.
+ Interval param.Field[int64] `json:"interval"`
+ // The number of retries to attempt in case of a timeout before marking the origin
+ // as unhealthy. Retries are attempted immediately.
+ Retries param.Field[int64] `json:"retries"`
+ // If suspended, no health checks are sent to the origin.
+ Suspended param.Field[bool] `json:"suspended"`
+ // Parameters specific to TCP health check.
+ TcpConfig param.Field[PreviewNewParamsTcpConfig] `json:"tcp_config"`
+ // The timeout (in seconds) before marking the health check as failed.
+ Timeout param.Field[int64] `json:"timeout"`
+ // The protocol to use for the health check. Currently supported protocols are
+ // 'HTTP', 'HTTPS' and 'TCP'.
+ Type param.Field[string] `json:"type"`
+}
+
+func (r PreviewNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// WNAM: Western North America, ENAM: Eastern North America, WEU: Western Europe,
+// EEU: Eastern Europe, NSAM: Northern South America, SSAM: Southern South America,
+// OC: Oceania, ME: Middle East, NAF: North Africa, SAF: South Africa, IN: India,
+// SEAS: South East Asia, NEAS: North East Asia, ALL_REGIONS: all regions (BUSINESS
+// and ENTERPRISE customers only).
+type PreviewNewParamsCheckRegion string
+
+const (
+ PreviewNewParamsCheckRegionWnam PreviewNewParamsCheckRegion = "WNAM"
+ PreviewNewParamsCheckRegionEnam PreviewNewParamsCheckRegion = "ENAM"
+ PreviewNewParamsCheckRegionWeu PreviewNewParamsCheckRegion = "WEU"
+ PreviewNewParamsCheckRegionEeu PreviewNewParamsCheckRegion = "EEU"
+ PreviewNewParamsCheckRegionNsam PreviewNewParamsCheckRegion = "NSAM"
+ PreviewNewParamsCheckRegionSsam PreviewNewParamsCheckRegion = "SSAM"
+ PreviewNewParamsCheckRegionOc PreviewNewParamsCheckRegion = "OC"
+ PreviewNewParamsCheckRegionMe PreviewNewParamsCheckRegion = "ME"
+ PreviewNewParamsCheckRegionNaf PreviewNewParamsCheckRegion = "NAF"
+ PreviewNewParamsCheckRegionSaf PreviewNewParamsCheckRegion = "SAF"
+ PreviewNewParamsCheckRegionIn PreviewNewParamsCheckRegion = "IN"
+ PreviewNewParamsCheckRegionSeas PreviewNewParamsCheckRegion = "SEAS"
+ PreviewNewParamsCheckRegionNeas PreviewNewParamsCheckRegion = "NEAS"
+ PreviewNewParamsCheckRegionAllRegions PreviewNewParamsCheckRegion = "ALL_REGIONS"
+)
+
+// Parameters specific to an HTTP or HTTPS health check.
+type PreviewNewParamsHTTPConfig struct {
+ // Do not validate the certificate when the health check uses HTTPS.
+ AllowInsecure param.Field[bool] `json:"allow_insecure"`
+ // A case-insensitive sub-string to look for in the response body. If this string
+ // is not found, the origin will be marked as unhealthy.
+ ExpectedBody param.Field[string] `json:"expected_body"`
+ // The expected HTTP response codes (e.g. "200") or code ranges (e.g. "2xx" for all
+ // codes starting with 2) of the health check.
+ ExpectedCodes param.Field[[]string] `json:"expected_codes"`
+ // Follow redirects if the origin returns a 3xx status code.
+ FollowRedirects param.Field[bool] `json:"follow_redirects"`
+ // The HTTP request headers to send in the health check. It is recommended you set
+ // a Host header by default. The User-Agent header cannot be overridden.
+ Header param.Field[interface{}] `json:"header"`
+ // The HTTP method to use for the health check.
+ Method param.Field[PreviewNewParamsHTTPConfigMethod] `json:"method"`
+ // The endpoint path to health check against.
+ Path param.Field[string] `json:"path"`
+ // Port number to connect to for the health check. Defaults to 80 if type is HTTP
+ // or 443 if type is HTTPS.
+ Port param.Field[int64] `json:"port"`
+}
+
+func (r PreviewNewParamsHTTPConfig) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The HTTP method to use for the health check.
+type PreviewNewParamsHTTPConfigMethod string
+
+const (
+ PreviewNewParamsHTTPConfigMethodGet PreviewNewParamsHTTPConfigMethod = "GET"
+ PreviewNewParamsHTTPConfigMethodHead PreviewNewParamsHTTPConfigMethod = "HEAD"
+)
+
+// Parameters specific to TCP health check.
+type PreviewNewParamsTcpConfig struct {
+ // The TCP connection method to use for the health check.
+ Method param.Field[PreviewNewParamsTcpConfigMethod] `json:"method"`
+ // Port number to connect to for the health check. Defaults to 80.
+ Port param.Field[int64] `json:"port"`
+}
+
+func (r PreviewNewParamsTcpConfig) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The TCP connection method to use for the health check.
+type PreviewNewParamsTcpConfigMethod string
+
+const (
+ PreviewNewParamsTcpConfigMethodConnectionEstablished PreviewNewParamsTcpConfigMethod = "connection_established"
+)
+
+type PreviewNewResponseEnvelope struct {
+ Errors []PreviewNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []PreviewNewResponseEnvelopeMessages `json:"messages,required"`
+ Result HealthchecksHealthchecks `json:"result,required"`
+ // Whether the API call was successful
+ Success PreviewNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON previewNewResponseEnvelopeJSON `json:"-"`
+}
+
+// previewNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [PreviewNewResponseEnvelope]
+type previewNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PreviewNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r previewNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type PreviewNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON previewNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// previewNewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [PreviewNewResponseEnvelopeErrors]
+type previewNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PreviewNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r previewNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type PreviewNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON previewNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// previewNewResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [PreviewNewResponseEnvelopeMessages]
+type previewNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PreviewNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r previewNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type PreviewNewResponseEnvelopeSuccess bool
+
+const (
+ PreviewNewResponseEnvelopeSuccessTrue PreviewNewResponseEnvelopeSuccess = true
+)
+
+type PreviewDeleteResponseEnvelope struct {
+ Errors []PreviewDeleteResponseEnvelopeErrors `json:"errors,required"`
+ Messages []PreviewDeleteResponseEnvelopeMessages `json:"messages,required"`
+ Result PreviewDeleteResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success PreviewDeleteResponseEnvelopeSuccess `json:"success,required"`
+ JSON previewDeleteResponseEnvelopeJSON `json:"-"`
+}
+
+// previewDeleteResponseEnvelopeJSON contains the JSON metadata for the struct
+// [PreviewDeleteResponseEnvelope]
+type previewDeleteResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PreviewDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r previewDeleteResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type PreviewDeleteResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON previewDeleteResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// previewDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [PreviewDeleteResponseEnvelopeErrors]
+type previewDeleteResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PreviewDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r previewDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type PreviewDeleteResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON previewDeleteResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// previewDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [PreviewDeleteResponseEnvelopeMessages]
+type previewDeleteResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PreviewDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r previewDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type PreviewDeleteResponseEnvelopeSuccess bool
+
+const (
+ PreviewDeleteResponseEnvelopeSuccessTrue PreviewDeleteResponseEnvelopeSuccess = true
+)
+
+type PreviewGetResponseEnvelope struct {
+ Errors []PreviewGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []PreviewGetResponseEnvelopeMessages `json:"messages,required"`
+ Result HealthchecksHealthchecks `json:"result,required"`
+ // Whether the API call was successful
+ Success PreviewGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON previewGetResponseEnvelopeJSON `json:"-"`
+}
+
+// previewGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [PreviewGetResponseEnvelope]
+type previewGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PreviewGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r previewGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type PreviewGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON previewGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// previewGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [PreviewGetResponseEnvelopeErrors]
+type previewGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PreviewGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r previewGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type PreviewGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON previewGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// previewGetResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [PreviewGetResponseEnvelopeMessages]
+type previewGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PreviewGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r previewGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type PreviewGetResponseEnvelopeSuccess bool
+
+const (
+ PreviewGetResponseEnvelopeSuccessTrue PreviewGetResponseEnvelopeSuccess = true
+)
diff --git a/healthchecks/preview_test.go b/healthchecks/preview_test.go
new file mode 100644
index 00000000000..1e701ac27ea
--- /dev/null
+++ b/healthchecks/preview_test.go
@@ -0,0 +1,132 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package healthchecks_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/healthchecks"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestPreviewNewWithOptionalParams(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"),
+ )
+ _, err := client.Healthchecks.Previews.New(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ healthchecks.PreviewNewParams{
+ Address: cloudflare.F("www.example.com"),
+ Name: cloudflare.F("server-1"),
+ CheckRegions: cloudflare.F([]healthchecks.PreviewNewParamsCheckRegion{healthchecks.PreviewNewParamsCheckRegionWeu, healthchecks.PreviewNewParamsCheckRegionEnam}),
+ ConsecutiveFails: cloudflare.F(int64(0)),
+ ConsecutiveSuccesses: cloudflare.F(int64(0)),
+ Description: cloudflare.F("Health check for www.example.com"),
+ HTTPConfig: cloudflare.F(healthchecks.PreviewNewParamsHTTPConfig{
+ AllowInsecure: cloudflare.F(true),
+ ExpectedBody: cloudflare.F("success"),
+ ExpectedCodes: cloudflare.F([]string{"2xx", "302"}),
+ FollowRedirects: cloudflare.F(true),
+ Header: cloudflare.F[any](map[string]interface{}{
+ "Host": map[string]interface{}{
+ "0": "example.com",
+ },
+ "X-App-ID": map[string]interface{}{
+ "0": "abc123",
+ },
+ }),
+ Method: cloudflare.F(healthchecks.PreviewNewParamsHTTPConfigMethodGet),
+ Path: cloudflare.F("/health"),
+ Port: cloudflare.F(int64(0)),
+ }),
+ Interval: cloudflare.F(int64(0)),
+ Retries: cloudflare.F(int64(0)),
+ Suspended: cloudflare.F(true),
+ TcpConfig: cloudflare.F(healthchecks.PreviewNewParamsTcpConfig{
+ Method: cloudflare.F(healthchecks.PreviewNewParamsTcpConfigMethodConnectionEstablished),
+ Port: cloudflare.F(int64(0)),
+ }),
+ Timeout: cloudflare.F(int64(0)),
+ Type: cloudflare.F("HTTPS"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestPreviewDelete(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"),
+ )
+ _, err := client.Healthchecks.Previews.Delete(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ )
+ 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())
+ }
+}
+
+func TestPreviewGet(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"),
+ )
+ _, err := client.Healthchecks.Previews.Get(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ )
+ 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/hostname.go b/hostname.go
deleted file mode 100644
index 7cad7428163..00000000000
--- a/hostname.go
+++ /dev/null
@@ -1,26 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// HostnameService contains methods and other services that help with interacting
-// with the cloudflare API. Note, unlike clients, this service does not read
-// variables from the environment automatically. You should not instantiate this
-// service directly, and instead use the [NewHostnameService] method instead.
-type HostnameService struct {
- Options []option.RequestOption
- Settings *HostnameSettingService
-}
-
-// NewHostnameService generates a new service that applies the given options to
-// each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewHostnameService(opts ...option.RequestOption) (r *HostnameService) {
- r = &HostnameService{}
- r.Options = opts
- r.Settings = NewHostnameSettingService(opts...)
- return
-}
diff --git a/hostnames/aliases.go b/hostnames/aliases.go
new file mode 100644
index 00000000000..2cb001a3093
--- /dev/null
+++ b/hostnames/aliases.go
@@ -0,0 +1,9 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package hostnames
+
+import (
+ "github.com/cloudflare/cloudflare-go/internal/apierror"
+)
+
+type Error = apierror.Error
diff --git a/hostnames/hostname.go b/hostnames/hostname.go
new file mode 100644
index 00000000000..c60c58541c9
--- /dev/null
+++ b/hostnames/hostname.go
@@ -0,0 +1,26 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package hostnames
+
+import (
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// HostnameService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewHostnameService] method instead.
+type HostnameService struct {
+ Options []option.RequestOption
+ Settings *SettingService
+}
+
+// NewHostnameService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewHostnameService(opts ...option.RequestOption) (r *HostnameService) {
+ r = &HostnameService{}
+ r.Options = opts
+ r.Settings = NewSettingService(opts...)
+ return
+}
diff --git a/hostnames/setting.go b/hostnames/setting.go
new file mode 100644
index 00000000000..cdfc677614c
--- /dev/null
+++ b/hostnames/setting.go
@@ -0,0 +1,26 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package hostnames
+
+import (
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// SettingService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewSettingService] method instead.
+type SettingService struct {
+ Options []option.RequestOption
+ TLS *SettingTLSService
+}
+
+// NewSettingService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewSettingService(opts ...option.RequestOption) (r *SettingService) {
+ r = &SettingService{}
+ r.Options = opts
+ r.TLS = NewSettingTLSService(opts...)
+ return
+}
diff --git a/hostnames/settingtls.go b/hostnames/settingtls.go
new file mode 100644
index 00000000000..9bb7fdeb1a2
--- /dev/null
+++ b/hostnames/settingtls.go
@@ -0,0 +1,576 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package hostnames
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "reflect"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/tidwall/gjson"
+)
+
+// SettingTLSService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewSettingTLSService] method instead.
+type SettingTLSService struct {
+ Options []option.RequestOption
+}
+
+// NewSettingTLSService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewSettingTLSService(opts ...option.RequestOption) (r *SettingTLSService) {
+ r = &SettingTLSService{}
+ r.Options = opts
+ return
+}
+
+// Update the tls setting value for the hostname.
+func (r *SettingTLSService) Update(ctx context.Context, settingID SettingTLSUpdateParamsSettingID, hostname string, params SettingTLSUpdateParams, opts ...option.RequestOption) (res *TLSCertificatesAndHostnamesSettingObject, err error) {
+ opts = append(r.Options[:], opts...)
+ var env SettingTLSUpdateResponseEnvelope
+ path := fmt.Sprintf("zones/%s/hostnames/settings/%v/%s", params.ZoneID, settingID, hostname)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Delete the tls setting value for the hostname.
+func (r *SettingTLSService) Delete(ctx context.Context, settingID SettingTLSDeleteParamsSettingID, hostname string, body SettingTLSDeleteParams, opts ...option.RequestOption) (res *TLSCertificatesAndHostnamesSettingObjectDelete, err error) {
+ opts = append(r.Options[:], opts...)
+ var env SettingTLSDeleteResponseEnvelope
+ path := fmt.Sprintf("zones/%s/hostnames/settings/%v/%s", body.ZoneID, settingID, hostname)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// List the requested TLS setting for the hostnames under this zone.
+func (r *SettingTLSService) Get(ctx context.Context, settingID SettingTLSGetParamsSettingID, query SettingTLSGetParams, opts ...option.RequestOption) (res *[]SettingTLSGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env SettingTLSGetResponseEnvelope
+ path := fmt.Sprintf("zones/%s/hostnames/settings/%v", query.ZoneID, settingID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type TLSCertificatesAndHostnamesSettingObject struct {
+ // This is the time the tls setting was originally created for this hostname.
+ CreatedAt time.Time `json:"created_at" format:"date-time"`
+ // The hostname for which the tls settings are set.
+ Hostname string `json:"hostname"`
+ // Deployment status for the given tls setting.
+ Status string `json:"status"`
+ // This is the time the tls setting was updated.
+ UpdatedAt time.Time `json:"updated_at" format:"date-time"`
+ // The tls setting value.
+ Value TLSCertificatesAndHostnamesSettingObjectValue `json:"value"`
+ JSON tlsCertificatesAndHostnamesSettingObjectJSON `json:"-"`
+}
+
+// tlsCertificatesAndHostnamesSettingObjectJSON contains the JSON metadata for the
+// struct [TLSCertificatesAndHostnamesSettingObject]
+type tlsCertificatesAndHostnamesSettingObjectJSON struct {
+ CreatedAt apijson.Field
+ Hostname apijson.Field
+ Status apijson.Field
+ UpdatedAt apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *TLSCertificatesAndHostnamesSettingObject) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r tlsCertificatesAndHostnamesSettingObjectJSON) RawJSON() string {
+ return r.raw
+}
+
+// The tls setting value.
+//
+// Union satisfied by [shared.UnionFloat], [shared.UnionString] or
+// [hostnames.TLSCertificatesAndHostnamesSettingObjectValueArray].
+type TLSCertificatesAndHostnamesSettingObjectValue interface {
+ ImplementsHostnamesTLSCertificatesAndHostnamesSettingObjectValue()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*TLSCertificatesAndHostnamesSettingObjectValue)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(TLSCertificatesAndHostnamesSettingObjectValueArray{}),
+ },
+ )
+}
+
+type TLSCertificatesAndHostnamesSettingObjectValueArray []string
+
+func (r TLSCertificatesAndHostnamesSettingObjectValueArray) ImplementsHostnamesTLSCertificatesAndHostnamesSettingObjectValue() {
+}
+
+type TLSCertificatesAndHostnamesSettingObjectDelete struct {
+ // This is the time the tls setting was originally created for this hostname.
+ CreatedAt time.Time `json:"created_at" format:"date-time"`
+ // The hostname for which the tls settings are set.
+ Hostname string `json:"hostname"`
+ Status interface{} `json:"status"`
+ // This is the time the tls setting was updated.
+ UpdatedAt time.Time `json:"updated_at" format:"date-time"`
+ Value interface{} `json:"value"`
+ JSON tlsCertificatesAndHostnamesSettingObjectDeleteJSON `json:"-"`
+}
+
+// tlsCertificatesAndHostnamesSettingObjectDeleteJSON contains the JSON metadata
+// for the struct [TLSCertificatesAndHostnamesSettingObjectDelete]
+type tlsCertificatesAndHostnamesSettingObjectDeleteJSON struct {
+ CreatedAt apijson.Field
+ Hostname apijson.Field
+ Status apijson.Field
+ UpdatedAt apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *TLSCertificatesAndHostnamesSettingObjectDelete) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r tlsCertificatesAndHostnamesSettingObjectDeleteJSON) RawJSON() string {
+ return r.raw
+}
+
+type SettingTLSGetResponse struct {
+ // This is the time the tls setting was originally created for this hostname.
+ CreatedAt time.Time `json:"created_at" format:"date-time"`
+ // The hostname for which the tls settings are set.
+ Hostname string `json:"hostname"`
+ // Deployment status for the given tls setting.
+ Status string `json:"status"`
+ // This is the time the tls setting was updated.
+ UpdatedAt time.Time `json:"updated_at" format:"date-time"`
+ // The tls setting value.
+ Value SettingTLSGetResponseValue `json:"value"`
+ JSON settingTLSGetResponseJSON `json:"-"`
+}
+
+// settingTLSGetResponseJSON contains the JSON metadata for the struct
+// [SettingTLSGetResponse]
+type settingTLSGetResponseJSON struct {
+ CreatedAt apijson.Field
+ Hostname apijson.Field
+ Status apijson.Field
+ UpdatedAt apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *SettingTLSGetResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r settingTLSGetResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+// The tls setting value.
+//
+// Union satisfied by [shared.UnionFloat], [shared.UnionString] or
+// [hostnames.SettingTLSGetResponseValueArray].
+type SettingTLSGetResponseValue interface {
+ ImplementsHostnamesSettingTLSGetResponseValue()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*SettingTLSGetResponseValue)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(SettingTLSGetResponseValueArray{}),
+ },
+ )
+}
+
+type SettingTLSGetResponseValueArray []string
+
+func (r SettingTLSGetResponseValueArray) ImplementsHostnamesSettingTLSGetResponseValue() {}
+
+type SettingTLSUpdateParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+ // The tls setting value.
+ Value param.Field[SettingTLSUpdateParamsValue] `json:"value,required"`
+}
+
+func (r SettingTLSUpdateParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The TLS Setting name.
+type SettingTLSUpdateParamsSettingID string
+
+const (
+ SettingTLSUpdateParamsSettingIDCiphers SettingTLSUpdateParamsSettingID = "ciphers"
+ SettingTLSUpdateParamsSettingIDMinTLSVersion SettingTLSUpdateParamsSettingID = "min_tls_version"
+ SettingTLSUpdateParamsSettingIDHTTP2 SettingTLSUpdateParamsSettingID = "http2"
+)
+
+// The tls setting value.
+//
+// Satisfied by [shared.UnionFloat], [shared.UnionString],
+// [hostnames.SettingTLSUpdateParamsValueArray].
+type SettingTLSUpdateParamsValue interface {
+ ImplementsHostnamesSettingTLSUpdateParamsValue()
+}
+
+type SettingTLSUpdateParamsValueArray []string
+
+func (r SettingTLSUpdateParamsValueArray) ImplementsHostnamesSettingTLSUpdateParamsValue() {}
+
+type SettingTLSUpdateResponseEnvelope struct {
+ Errors []SettingTLSUpdateResponseEnvelopeErrors `json:"errors,required"`
+ Messages []SettingTLSUpdateResponseEnvelopeMessages `json:"messages,required"`
+ Result TLSCertificatesAndHostnamesSettingObject `json:"result,required"`
+ // Whether the API call was successful
+ Success SettingTLSUpdateResponseEnvelopeSuccess `json:"success,required"`
+ JSON settingTLSUpdateResponseEnvelopeJSON `json:"-"`
+}
+
+// settingTLSUpdateResponseEnvelopeJSON contains the JSON metadata for the struct
+// [SettingTLSUpdateResponseEnvelope]
+type settingTLSUpdateResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *SettingTLSUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r settingTLSUpdateResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type SettingTLSUpdateResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON settingTLSUpdateResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// settingTLSUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [SettingTLSUpdateResponseEnvelopeErrors]
+type settingTLSUpdateResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *SettingTLSUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r settingTLSUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type SettingTLSUpdateResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON settingTLSUpdateResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// settingTLSUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [SettingTLSUpdateResponseEnvelopeMessages]
+type settingTLSUpdateResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *SettingTLSUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r settingTLSUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type SettingTLSUpdateResponseEnvelopeSuccess bool
+
+const (
+ SettingTLSUpdateResponseEnvelopeSuccessTrue SettingTLSUpdateResponseEnvelopeSuccess = true
+)
+
+type SettingTLSDeleteParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+}
+
+// The TLS Setting name.
+type SettingTLSDeleteParamsSettingID string
+
+const (
+ SettingTLSDeleteParamsSettingIDCiphers SettingTLSDeleteParamsSettingID = "ciphers"
+ SettingTLSDeleteParamsSettingIDMinTLSVersion SettingTLSDeleteParamsSettingID = "min_tls_version"
+ SettingTLSDeleteParamsSettingIDHTTP2 SettingTLSDeleteParamsSettingID = "http2"
+)
+
+type SettingTLSDeleteResponseEnvelope struct {
+ Errors []SettingTLSDeleteResponseEnvelopeErrors `json:"errors,required"`
+ Messages []SettingTLSDeleteResponseEnvelopeMessages `json:"messages,required"`
+ Result TLSCertificatesAndHostnamesSettingObjectDelete `json:"result,required"`
+ // Whether the API call was successful
+ Success SettingTLSDeleteResponseEnvelopeSuccess `json:"success,required"`
+ JSON settingTLSDeleteResponseEnvelopeJSON `json:"-"`
+}
+
+// settingTLSDeleteResponseEnvelopeJSON contains the JSON metadata for the struct
+// [SettingTLSDeleteResponseEnvelope]
+type settingTLSDeleteResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *SettingTLSDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r settingTLSDeleteResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type SettingTLSDeleteResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON settingTLSDeleteResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// settingTLSDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [SettingTLSDeleteResponseEnvelopeErrors]
+type settingTLSDeleteResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *SettingTLSDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r settingTLSDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type SettingTLSDeleteResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON settingTLSDeleteResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// settingTLSDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [SettingTLSDeleteResponseEnvelopeMessages]
+type settingTLSDeleteResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *SettingTLSDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r settingTLSDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type SettingTLSDeleteResponseEnvelopeSuccess bool
+
+const (
+ SettingTLSDeleteResponseEnvelopeSuccessTrue SettingTLSDeleteResponseEnvelopeSuccess = true
+)
+
+type SettingTLSGetParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+}
+
+// The TLS Setting name.
+type SettingTLSGetParamsSettingID string
+
+const (
+ SettingTLSGetParamsSettingIDCiphers SettingTLSGetParamsSettingID = "ciphers"
+ SettingTLSGetParamsSettingIDMinTLSVersion SettingTLSGetParamsSettingID = "min_tls_version"
+ SettingTLSGetParamsSettingIDHTTP2 SettingTLSGetParamsSettingID = "http2"
+)
+
+type SettingTLSGetResponseEnvelope struct {
+ Errors []SettingTLSGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []SettingTLSGetResponseEnvelopeMessages `json:"messages,required"`
+ Result []SettingTLSGetResponse `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success SettingTLSGetResponseEnvelopeSuccess `json:"success,required"`
+ ResultInfo SettingTLSGetResponseEnvelopeResultInfo `json:"result_info"`
+ JSON settingTLSGetResponseEnvelopeJSON `json:"-"`
+}
+
+// settingTLSGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [SettingTLSGetResponseEnvelope]
+type settingTLSGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ ResultInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *SettingTLSGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r settingTLSGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type SettingTLSGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON settingTLSGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// settingTLSGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [SettingTLSGetResponseEnvelopeErrors]
+type settingTLSGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *SettingTLSGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r settingTLSGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type SettingTLSGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON settingTLSGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// settingTLSGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [SettingTLSGetResponseEnvelopeMessages]
+type settingTLSGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *SettingTLSGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r settingTLSGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type SettingTLSGetResponseEnvelopeSuccess bool
+
+const (
+ SettingTLSGetResponseEnvelopeSuccessTrue SettingTLSGetResponseEnvelopeSuccess = true
+)
+
+type SettingTLSGetResponseEnvelopeResultInfo struct {
+ // Total number of results for the requested service
+ Count float64 `json:"count"`
+ // Current page within paginated list of results
+ Page float64 `json:"page"`
+ // Number of results per page of results
+ PerPage float64 `json:"per_page"`
+ // Total results available without any search parameters
+ TotalCount float64 `json:"total_count"`
+ // Total pages available of results
+ TotalPages float64 `json:"total_pages"`
+ JSON settingTLSGetResponseEnvelopeResultInfoJSON `json:"-"`
+}
+
+// settingTLSGetResponseEnvelopeResultInfoJSON contains the JSON metadata for the
+// struct [SettingTLSGetResponseEnvelopeResultInfo]
+type settingTLSGetResponseEnvelopeResultInfoJSON struct {
+ Count apijson.Field
+ Page apijson.Field
+ PerPage apijson.Field
+ TotalCount apijson.Field
+ TotalPages apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *SettingTLSGetResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r settingTLSGetResponseEnvelopeResultInfoJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/hostnames/settingtls_test.go b/hostnames/settingtls_test.go
new file mode 100644
index 00000000000..3870d2179c6
--- /dev/null
+++ b/hostnames/settingtls_test.go
@@ -0,0 +1,108 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package hostnames_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/hostnames"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestSettingTLSUpdate(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"),
+ )
+ _, err := client.Hostnames.Settings.TLS.Update(
+ context.TODO(),
+ hostnames.SettingTLSUpdateParamsSettingIDCiphers,
+ "app.example.com",
+ hostnames.SettingTLSUpdateParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Value: cloudflare.F[hostnames.SettingTLSUpdateParamsValue](hostnames.SettingTLSUpdateParamsValueArray([]string{"ECDHE-RSA-AES128-GCM-SHA256", "AES128-GCM-SHA256"})),
+ },
+ )
+ 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())
+ }
+}
+
+func TestSettingTLSDelete(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"),
+ )
+ _, err := client.Hostnames.Settings.TLS.Delete(
+ context.TODO(),
+ hostnames.SettingTLSDeleteParamsSettingIDCiphers,
+ "app.example.com",
+ hostnames.SettingTLSDeleteParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestSettingTLSGet(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"),
+ )
+ _, err := client.Hostnames.Settings.TLS.Get(
+ context.TODO(),
+ hostnames.SettingTLSGetParamsSettingIDCiphers,
+ hostnames.SettingTLSGetParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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/hostnamesetting.go b/hostnamesetting.go
deleted file mode 100644
index cd05f6a2700..00000000000
--- a/hostnamesetting.go
+++ /dev/null
@@ -1,27 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// HostnameSettingService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewHostnameSettingService] method
-// instead.
-type HostnameSettingService struct {
- Options []option.RequestOption
- TLS *HostnameSettingTLSService
-}
-
-// NewHostnameSettingService generates a new service that applies the given options
-// to each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewHostnameSettingService(opts ...option.RequestOption) (r *HostnameSettingService) {
- r = &HostnameSettingService{}
- r.Options = opts
- r.TLS = NewHostnameSettingTLSService(opts...)
- return
-}
diff --git a/hostnamesettingtls.go b/hostnamesettingtls.go
deleted file mode 100644
index 8457e6b6cba..00000000000
--- a/hostnamesettingtls.go
+++ /dev/null
@@ -1,577 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "reflect"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/option"
- "github.com/tidwall/gjson"
-)
-
-// HostnameSettingTLSService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewHostnameSettingTLSService] method
-// instead.
-type HostnameSettingTLSService struct {
- Options []option.RequestOption
-}
-
-// NewHostnameSettingTLSService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewHostnameSettingTLSService(opts ...option.RequestOption) (r *HostnameSettingTLSService) {
- r = &HostnameSettingTLSService{}
- r.Options = opts
- return
-}
-
-// Update the tls setting value for the hostname.
-func (r *HostnameSettingTLSService) Update(ctx context.Context, settingID HostnameSettingTLSUpdateParamsSettingID, hostname string, params HostnameSettingTLSUpdateParams, opts ...option.RequestOption) (res *HostnameSettingTLSUpdateResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env HostnameSettingTLSUpdateResponseEnvelope
- path := fmt.Sprintf("zones/%s/hostnames/settings/%v/%s", params.ZoneID, settingID, hostname)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Delete the tls setting value for the hostname.
-func (r *HostnameSettingTLSService) Delete(ctx context.Context, settingID HostnameSettingTLSDeleteParamsSettingID, hostname string, body HostnameSettingTLSDeleteParams, opts ...option.RequestOption) (res *HostnameSettingTLSDeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env HostnameSettingTLSDeleteResponseEnvelope
- path := fmt.Sprintf("zones/%s/hostnames/settings/%v/%s", body.ZoneID, settingID, hostname)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// List the requested TLS setting for the hostnames under this zone.
-func (r *HostnameSettingTLSService) Get(ctx context.Context, settingID HostnameSettingTLSGetParamsSettingID, query HostnameSettingTLSGetParams, opts ...option.RequestOption) (res *[]HostnameSettingTLSGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env HostnameSettingTLSGetResponseEnvelope
- path := fmt.Sprintf("zones/%s/hostnames/settings/%v", query.ZoneID, settingID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type HostnameSettingTLSUpdateResponse struct {
- // This is the time the tls setting was originally created for this hostname.
- CreatedAt time.Time `json:"created_at" format:"date-time"`
- // The hostname for which the tls settings are set.
- Hostname string `json:"hostname"`
- // Deployment status for the given tls setting.
- Status string `json:"status"`
- // This is the time the tls setting was updated.
- UpdatedAt time.Time `json:"updated_at" format:"date-time"`
- // The tls setting value.
- Value HostnameSettingTLSUpdateResponseValue `json:"value"`
- JSON hostnameSettingTLSUpdateResponseJSON `json:"-"`
-}
-
-// hostnameSettingTLSUpdateResponseJSON contains the JSON metadata for the struct
-// [HostnameSettingTLSUpdateResponse]
-type hostnameSettingTLSUpdateResponseJSON struct {
- CreatedAt apijson.Field
- Hostname apijson.Field
- Status apijson.Field
- UpdatedAt apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HostnameSettingTLSUpdateResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r hostnameSettingTLSUpdateResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// The tls setting value.
-//
-// Union satisfied by [shared.UnionFloat], [shared.UnionString] or
-// [HostnameSettingTLSUpdateResponseValueArray].
-type HostnameSettingTLSUpdateResponseValue interface {
- ImplementsHostnameSettingTLSUpdateResponseValue()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*HostnameSettingTLSUpdateResponseValue)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(HostnameSettingTLSUpdateResponseValueArray{}),
- },
- )
-}
-
-type HostnameSettingTLSUpdateResponseValueArray []string
-
-func (r HostnameSettingTLSUpdateResponseValueArray) ImplementsHostnameSettingTLSUpdateResponseValue() {
-}
-
-type HostnameSettingTLSDeleteResponse struct {
- // This is the time the tls setting was originally created for this hostname.
- CreatedAt time.Time `json:"created_at" format:"date-time"`
- // The hostname for which the tls settings are set.
- Hostname string `json:"hostname"`
- Status interface{} `json:"status"`
- // This is the time the tls setting was updated.
- UpdatedAt time.Time `json:"updated_at" format:"date-time"`
- Value interface{} `json:"value"`
- JSON hostnameSettingTLSDeleteResponseJSON `json:"-"`
-}
-
-// hostnameSettingTLSDeleteResponseJSON contains the JSON metadata for the struct
-// [HostnameSettingTLSDeleteResponse]
-type hostnameSettingTLSDeleteResponseJSON struct {
- CreatedAt apijson.Field
- Hostname apijson.Field
- Status apijson.Field
- UpdatedAt apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HostnameSettingTLSDeleteResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r hostnameSettingTLSDeleteResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type HostnameSettingTLSGetResponse struct {
- // This is the time the tls setting was originally created for this hostname.
- CreatedAt time.Time `json:"created_at" format:"date-time"`
- // The hostname for which the tls settings are set.
- Hostname string `json:"hostname"`
- // Deployment status for the given tls setting.
- Status string `json:"status"`
- // This is the time the tls setting was updated.
- UpdatedAt time.Time `json:"updated_at" format:"date-time"`
- // The tls setting value.
- Value HostnameSettingTLSGetResponseValue `json:"value"`
- JSON hostnameSettingTLSGetResponseJSON `json:"-"`
-}
-
-// hostnameSettingTLSGetResponseJSON contains the JSON metadata for the struct
-// [HostnameSettingTLSGetResponse]
-type hostnameSettingTLSGetResponseJSON struct {
- CreatedAt apijson.Field
- Hostname apijson.Field
- Status apijson.Field
- UpdatedAt apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HostnameSettingTLSGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r hostnameSettingTLSGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// The tls setting value.
-//
-// Union satisfied by [shared.UnionFloat], [shared.UnionString] or
-// [HostnameSettingTLSGetResponseValueArray].
-type HostnameSettingTLSGetResponseValue interface {
- ImplementsHostnameSettingTLSGetResponseValue()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*HostnameSettingTLSGetResponseValue)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionFloat(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(HostnameSettingTLSGetResponseValueArray{}),
- },
- )
-}
-
-type HostnameSettingTLSGetResponseValueArray []string
-
-func (r HostnameSettingTLSGetResponseValueArray) ImplementsHostnameSettingTLSGetResponseValue() {}
-
-type HostnameSettingTLSUpdateParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
- // The tls setting value.
- Value param.Field[HostnameSettingTLSUpdateParamsValue] `json:"value,required"`
-}
-
-func (r HostnameSettingTLSUpdateParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The TLS Setting name.
-type HostnameSettingTLSUpdateParamsSettingID string
-
-const (
- HostnameSettingTLSUpdateParamsSettingIDCiphers HostnameSettingTLSUpdateParamsSettingID = "ciphers"
- HostnameSettingTLSUpdateParamsSettingIDMinTLSVersion HostnameSettingTLSUpdateParamsSettingID = "min_tls_version"
- HostnameSettingTLSUpdateParamsSettingIDHTTP2 HostnameSettingTLSUpdateParamsSettingID = "http2"
-)
-
-// The tls setting value.
-//
-// Satisfied by [shared.UnionFloat], [shared.UnionString],
-// [HostnameSettingTLSUpdateParamsValueArray].
-type HostnameSettingTLSUpdateParamsValue interface {
- ImplementsHostnameSettingTLSUpdateParamsValue()
-}
-
-type HostnameSettingTLSUpdateParamsValueArray []string
-
-func (r HostnameSettingTLSUpdateParamsValueArray) ImplementsHostnameSettingTLSUpdateParamsValue() {}
-
-type HostnameSettingTLSUpdateResponseEnvelope struct {
- Errors []HostnameSettingTLSUpdateResponseEnvelopeErrors `json:"errors,required"`
- Messages []HostnameSettingTLSUpdateResponseEnvelopeMessages `json:"messages,required"`
- Result HostnameSettingTLSUpdateResponse `json:"result,required"`
- // Whether the API call was successful
- Success HostnameSettingTLSUpdateResponseEnvelopeSuccess `json:"success,required"`
- JSON hostnameSettingTLSUpdateResponseEnvelopeJSON `json:"-"`
-}
-
-// hostnameSettingTLSUpdateResponseEnvelopeJSON contains the JSON metadata for the
-// struct [HostnameSettingTLSUpdateResponseEnvelope]
-type hostnameSettingTLSUpdateResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HostnameSettingTLSUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r hostnameSettingTLSUpdateResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type HostnameSettingTLSUpdateResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON hostnameSettingTLSUpdateResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// hostnameSettingTLSUpdateResponseEnvelopeErrorsJSON contains the JSON metadata
-// for the struct [HostnameSettingTLSUpdateResponseEnvelopeErrors]
-type hostnameSettingTLSUpdateResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HostnameSettingTLSUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r hostnameSettingTLSUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type HostnameSettingTLSUpdateResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON hostnameSettingTLSUpdateResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// hostnameSettingTLSUpdateResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [HostnameSettingTLSUpdateResponseEnvelopeMessages]
-type hostnameSettingTLSUpdateResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HostnameSettingTLSUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r hostnameSettingTLSUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type HostnameSettingTLSUpdateResponseEnvelopeSuccess bool
-
-const (
- HostnameSettingTLSUpdateResponseEnvelopeSuccessTrue HostnameSettingTLSUpdateResponseEnvelopeSuccess = true
-)
-
-type HostnameSettingTLSDeleteParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
-}
-
-// The TLS Setting name.
-type HostnameSettingTLSDeleteParamsSettingID string
-
-const (
- HostnameSettingTLSDeleteParamsSettingIDCiphers HostnameSettingTLSDeleteParamsSettingID = "ciphers"
- HostnameSettingTLSDeleteParamsSettingIDMinTLSVersion HostnameSettingTLSDeleteParamsSettingID = "min_tls_version"
- HostnameSettingTLSDeleteParamsSettingIDHTTP2 HostnameSettingTLSDeleteParamsSettingID = "http2"
-)
-
-type HostnameSettingTLSDeleteResponseEnvelope struct {
- Errors []HostnameSettingTLSDeleteResponseEnvelopeErrors `json:"errors,required"`
- Messages []HostnameSettingTLSDeleteResponseEnvelopeMessages `json:"messages,required"`
- Result HostnameSettingTLSDeleteResponse `json:"result,required"`
- // Whether the API call was successful
- Success HostnameSettingTLSDeleteResponseEnvelopeSuccess `json:"success,required"`
- JSON hostnameSettingTLSDeleteResponseEnvelopeJSON `json:"-"`
-}
-
-// hostnameSettingTLSDeleteResponseEnvelopeJSON contains the JSON metadata for the
-// struct [HostnameSettingTLSDeleteResponseEnvelope]
-type hostnameSettingTLSDeleteResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HostnameSettingTLSDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r hostnameSettingTLSDeleteResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type HostnameSettingTLSDeleteResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON hostnameSettingTLSDeleteResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// hostnameSettingTLSDeleteResponseEnvelopeErrorsJSON contains the JSON metadata
-// for the struct [HostnameSettingTLSDeleteResponseEnvelopeErrors]
-type hostnameSettingTLSDeleteResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HostnameSettingTLSDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r hostnameSettingTLSDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type HostnameSettingTLSDeleteResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON hostnameSettingTLSDeleteResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// hostnameSettingTLSDeleteResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [HostnameSettingTLSDeleteResponseEnvelopeMessages]
-type hostnameSettingTLSDeleteResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HostnameSettingTLSDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r hostnameSettingTLSDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type HostnameSettingTLSDeleteResponseEnvelopeSuccess bool
-
-const (
- HostnameSettingTLSDeleteResponseEnvelopeSuccessTrue HostnameSettingTLSDeleteResponseEnvelopeSuccess = true
-)
-
-type HostnameSettingTLSGetParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
-}
-
-// The TLS Setting name.
-type HostnameSettingTLSGetParamsSettingID string
-
-const (
- HostnameSettingTLSGetParamsSettingIDCiphers HostnameSettingTLSGetParamsSettingID = "ciphers"
- HostnameSettingTLSGetParamsSettingIDMinTLSVersion HostnameSettingTLSGetParamsSettingID = "min_tls_version"
- HostnameSettingTLSGetParamsSettingIDHTTP2 HostnameSettingTLSGetParamsSettingID = "http2"
-)
-
-type HostnameSettingTLSGetResponseEnvelope struct {
- Errors []HostnameSettingTLSGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []HostnameSettingTLSGetResponseEnvelopeMessages `json:"messages,required"`
- Result []HostnameSettingTLSGetResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success HostnameSettingTLSGetResponseEnvelopeSuccess `json:"success,required"`
- ResultInfo HostnameSettingTLSGetResponseEnvelopeResultInfo `json:"result_info"`
- JSON hostnameSettingTLSGetResponseEnvelopeJSON `json:"-"`
-}
-
-// hostnameSettingTLSGetResponseEnvelopeJSON contains the JSON metadata for the
-// struct [HostnameSettingTLSGetResponseEnvelope]
-type hostnameSettingTLSGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- ResultInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HostnameSettingTLSGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r hostnameSettingTLSGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type HostnameSettingTLSGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON hostnameSettingTLSGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// hostnameSettingTLSGetResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [HostnameSettingTLSGetResponseEnvelopeErrors]
-type hostnameSettingTLSGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HostnameSettingTLSGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r hostnameSettingTLSGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type HostnameSettingTLSGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON hostnameSettingTLSGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// hostnameSettingTLSGetResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [HostnameSettingTLSGetResponseEnvelopeMessages]
-type hostnameSettingTLSGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HostnameSettingTLSGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r hostnameSettingTLSGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type HostnameSettingTLSGetResponseEnvelopeSuccess bool
-
-const (
- HostnameSettingTLSGetResponseEnvelopeSuccessTrue HostnameSettingTLSGetResponseEnvelopeSuccess = true
-)
-
-type HostnameSettingTLSGetResponseEnvelopeResultInfo struct {
- // Total number of results for the requested service
- Count float64 `json:"count"`
- // Current page within paginated list of results
- Page float64 `json:"page"`
- // Number of results per page of results
- PerPage float64 `json:"per_page"`
- // Total results available without any search parameters
- TotalCount float64 `json:"total_count"`
- // Total pages available of results
- TotalPages float64 `json:"total_pages"`
- JSON hostnameSettingTLSGetResponseEnvelopeResultInfoJSON `json:"-"`
-}
-
-// hostnameSettingTLSGetResponseEnvelopeResultInfoJSON contains the JSON metadata
-// for the struct [HostnameSettingTLSGetResponseEnvelopeResultInfo]
-type hostnameSettingTLSGetResponseEnvelopeResultInfoJSON struct {
- Count apijson.Field
- Page apijson.Field
- PerPage apijson.Field
- TotalCount apijson.Field
- TotalPages apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HostnameSettingTLSGetResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r hostnameSettingTLSGetResponseEnvelopeResultInfoJSON) RawJSON() string {
- return r.raw
-}
diff --git a/hostnamesettingtls_test.go b/hostnamesettingtls_test.go
deleted file mode 100644
index 470ef16779a..00000000000
--- a/hostnamesettingtls_test.go
+++ /dev/null
@@ -1,107 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestHostnameSettingTLSUpdate(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"),
- )
- _, err := client.Hostnames.Settings.TLS.Update(
- context.TODO(),
- cloudflare.HostnameSettingTLSUpdateParamsSettingIDCiphers,
- "app.example.com",
- cloudflare.HostnameSettingTLSUpdateParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Value: cloudflare.F[cloudflare.HostnameSettingTLSUpdateParamsValue](cloudflare.HostnameSettingTLSUpdateParamsValueArray([]string{"ECDHE-RSA-AES128-GCM-SHA256", "AES128-GCM-SHA256"})),
- },
- )
- 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())
- }
-}
-
-func TestHostnameSettingTLSDelete(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"),
- )
- _, err := client.Hostnames.Settings.TLS.Delete(
- context.TODO(),
- cloudflare.HostnameSettingTLSDeleteParamsSettingIDCiphers,
- "app.example.com",
- cloudflare.HostnameSettingTLSDeleteParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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())
- }
-}
-
-func TestHostnameSettingTLSGet(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"),
- )
- _, err := client.Hostnames.Settings.TLS.Get(
- context.TODO(),
- cloudflare.HostnameSettingTLSGetParamsSettingIDCiphers,
- cloudflare.HostnameSettingTLSGetParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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/hyperdrive/aliases.go b/hyperdrive/aliases.go
new file mode 100644
index 00000000000..d50d2cd6fae
--- /dev/null
+++ b/hyperdrive/aliases.go
@@ -0,0 +1,9 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package hyperdrive
+
+import (
+ "github.com/cloudflare/cloudflare-go/internal/apierror"
+)
+
+type Error = apierror.Error
diff --git a/hyperdrive/config.go b/hyperdrive/config.go
new file mode 100644
index 00000000000..d0ccc85a67e
--- /dev/null
+++ b/hyperdrive/config.go
@@ -0,0 +1,801 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package hyperdrive
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "reflect"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/tidwall/gjson"
+)
+
+// ConfigService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewConfigService] method instead.
+type ConfigService struct {
+ Options []option.RequestOption
+}
+
+// NewConfigService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewConfigService(opts ...option.RequestOption) (r *ConfigService) {
+ r = &ConfigService{}
+ r.Options = opts
+ return
+}
+
+// Creates and returns a new Hyperdrive configuration.
+func (r *ConfigService) New(ctx context.Context, params ConfigNewParams, opts ...option.RequestOption) (res *ConfigNewResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env ConfigNewResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/hyperdrive/configs", params.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Updates and returns the specified Hyperdrive configuration.
+func (r *ConfigService) Update(ctx context.Context, hyperdriveID string, params ConfigUpdateParams, opts ...option.RequestOption) (res *ConfigUpdateResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env ConfigUpdateResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/hyperdrive/configs/%s", params.AccountID, hyperdriveID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Returns a list of Hyperdrives
+func (r *ConfigService) List(ctx context.Context, query ConfigListParams, opts ...option.RequestOption) (res *[]ConfigListResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env ConfigListResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/hyperdrive/configs", query.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Deletes the specified Hyperdrive.
+func (r *ConfigService) Delete(ctx context.Context, hyperdriveID string, body ConfigDeleteParams, opts ...option.RequestOption) (res *ConfigDeleteResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env ConfigDeleteResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/hyperdrive/configs/%s", body.AccountID, hyperdriveID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Patches and returns the specified Hyperdrive configuration. Updates to the
+// origin and caching settings are applied with an all-or-nothing approach.
+func (r *ConfigService) Edit(ctx context.Context, hyperdriveID string, params ConfigEditParams, opts ...option.RequestOption) (res *ConfigEditResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env ConfigEditResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/hyperdrive/configs/%s", params.AccountID, hyperdriveID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Returns the specified Hyperdrive configuration.
+func (r *ConfigService) Get(ctx context.Context, hyperdriveID string, query ConfigGetParams, opts ...option.RequestOption) (res *ConfigGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env ConfigGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/hyperdrive/configs/%s", query.AccountID, hyperdriveID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type ConfigNewResponse struct {
+ // Identifier
+ ID string `json:"id"`
+ JSON configNewResponseJSON `json:"-"`
+}
+
+// configNewResponseJSON contains the JSON metadata for the struct
+// [ConfigNewResponse]
+type configNewResponseJSON struct {
+ ID apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ConfigNewResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r configNewResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type ConfigUpdateResponse struct {
+ // Identifier
+ ID string `json:"id"`
+ JSON configUpdateResponseJSON `json:"-"`
+}
+
+// configUpdateResponseJSON contains the JSON metadata for the struct
+// [ConfigUpdateResponse]
+type configUpdateResponseJSON struct {
+ ID apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ConfigUpdateResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r configUpdateResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type ConfigListResponse struct {
+ // Identifier
+ ID string `json:"id"`
+ JSON configListResponseJSON `json:"-"`
+}
+
+// configListResponseJSON contains the JSON metadata for the struct
+// [ConfigListResponse]
+type configListResponseJSON struct {
+ ID apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ConfigListResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r configListResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+// Union satisfied by [hyperdrive.ConfigDeleteResponseUnknown] or
+// [shared.UnionString].
+type ConfigDeleteResponse interface {
+ ImplementsHyperdriveConfigDeleteResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*ConfigDeleteResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+type ConfigEditResponse struct {
+ // Identifier
+ ID string `json:"id"`
+ JSON configEditResponseJSON `json:"-"`
+}
+
+// configEditResponseJSON contains the JSON metadata for the struct
+// [ConfigEditResponse]
+type configEditResponseJSON struct {
+ ID apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ConfigEditResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r configEditResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type ConfigGetResponse struct {
+ // Identifier
+ ID string `json:"id"`
+ JSON configGetResponseJSON `json:"-"`
+}
+
+// configGetResponseJSON contains the JSON metadata for the struct
+// [ConfigGetResponse]
+type configGetResponseJSON struct {
+ ID apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ConfigGetResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r configGetResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type ConfigNewParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ Origin param.Field[ConfigNewParamsOrigin] `json:"origin,required"`
+}
+
+func (r ConfigNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type ConfigNewParamsOrigin struct {
+ // The password required to access your origin database. This value is write-only
+ // and never returned by the API.
+ Password param.Field[string] `json:"password,required"`
+}
+
+func (r ConfigNewParamsOrigin) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type ConfigNewResponseEnvelope struct {
+ Errors []ConfigNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []ConfigNewResponseEnvelopeMessages `json:"messages,required"`
+ Result ConfigNewResponse `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success ConfigNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON configNewResponseEnvelopeJSON `json:"-"`
+}
+
+// configNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [ConfigNewResponseEnvelope]
+type configNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ConfigNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r configNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type ConfigNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON configNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// configNewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [ConfigNewResponseEnvelopeErrors]
+type configNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ConfigNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r configNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type ConfigNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON configNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// configNewResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [ConfigNewResponseEnvelopeMessages]
+type configNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ConfigNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r configNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type ConfigNewResponseEnvelopeSuccess bool
+
+const (
+ ConfigNewResponseEnvelopeSuccessTrue ConfigNewResponseEnvelopeSuccess = true
+)
+
+type ConfigUpdateParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ Origin param.Field[ConfigUpdateParamsOrigin] `json:"origin,required"`
+}
+
+func (r ConfigUpdateParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type ConfigUpdateParamsOrigin struct {
+ // The password required to access your origin database. This value is write-only
+ // and never returned by the API.
+ Password param.Field[string] `json:"password,required"`
+}
+
+func (r ConfigUpdateParamsOrigin) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type ConfigUpdateResponseEnvelope struct {
+ Errors []ConfigUpdateResponseEnvelopeErrors `json:"errors,required"`
+ Messages []ConfigUpdateResponseEnvelopeMessages `json:"messages,required"`
+ Result ConfigUpdateResponse `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success ConfigUpdateResponseEnvelopeSuccess `json:"success,required"`
+ JSON configUpdateResponseEnvelopeJSON `json:"-"`
+}
+
+// configUpdateResponseEnvelopeJSON contains the JSON metadata for the struct
+// [ConfigUpdateResponseEnvelope]
+type configUpdateResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ConfigUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r configUpdateResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type ConfigUpdateResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON configUpdateResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// configUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [ConfigUpdateResponseEnvelopeErrors]
+type configUpdateResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ConfigUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r configUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type ConfigUpdateResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON configUpdateResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// configUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [ConfigUpdateResponseEnvelopeMessages]
+type configUpdateResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ConfigUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r configUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type ConfigUpdateResponseEnvelopeSuccess bool
+
+const (
+ ConfigUpdateResponseEnvelopeSuccessTrue ConfigUpdateResponseEnvelopeSuccess = true
+)
+
+type ConfigListParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type ConfigListResponseEnvelope struct {
+ Errors []ConfigListResponseEnvelopeErrors `json:"errors,required"`
+ Messages []ConfigListResponseEnvelopeMessages `json:"messages,required"`
+ Result []ConfigListResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success ConfigListResponseEnvelopeSuccess `json:"success,required"`
+ JSON configListResponseEnvelopeJSON `json:"-"`
+}
+
+// configListResponseEnvelopeJSON contains the JSON metadata for the struct
+// [ConfigListResponseEnvelope]
+type configListResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ConfigListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r configListResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type ConfigListResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON configListResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// configListResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [ConfigListResponseEnvelopeErrors]
+type configListResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ConfigListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r configListResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type ConfigListResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON configListResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// configListResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [ConfigListResponseEnvelopeMessages]
+type configListResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ConfigListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r configListResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type ConfigListResponseEnvelopeSuccess bool
+
+const (
+ ConfigListResponseEnvelopeSuccessTrue ConfigListResponseEnvelopeSuccess = true
+)
+
+type ConfigDeleteParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type ConfigDeleteResponseEnvelope struct {
+ Errors []ConfigDeleteResponseEnvelopeErrors `json:"errors,required"`
+ Messages []ConfigDeleteResponseEnvelopeMessages `json:"messages,required"`
+ Result ConfigDeleteResponse `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success ConfigDeleteResponseEnvelopeSuccess `json:"success,required"`
+ JSON configDeleteResponseEnvelopeJSON `json:"-"`
+}
+
+// configDeleteResponseEnvelopeJSON contains the JSON metadata for the struct
+// [ConfigDeleteResponseEnvelope]
+type configDeleteResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ConfigDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r configDeleteResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type ConfigDeleteResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON configDeleteResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// configDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [ConfigDeleteResponseEnvelopeErrors]
+type configDeleteResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ConfigDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r configDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type ConfigDeleteResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON configDeleteResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// configDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [ConfigDeleteResponseEnvelopeMessages]
+type configDeleteResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ConfigDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r configDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type ConfigDeleteResponseEnvelopeSuccess bool
+
+const (
+ ConfigDeleteResponseEnvelopeSuccessTrue ConfigDeleteResponseEnvelopeSuccess = true
+)
+
+type ConfigEditParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ Origin param.Field[ConfigEditParamsOrigin] `json:"origin"`
+}
+
+func (r ConfigEditParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type ConfigEditParamsOrigin struct {
+ // The password required to access your origin database. This value is write-only
+ // and never returned by the API.
+ Password param.Field[string] `json:"password,required"`
+}
+
+func (r ConfigEditParamsOrigin) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type ConfigEditResponseEnvelope struct {
+ Errors []ConfigEditResponseEnvelopeErrors `json:"errors,required"`
+ Messages []ConfigEditResponseEnvelopeMessages `json:"messages,required"`
+ Result ConfigEditResponse `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success ConfigEditResponseEnvelopeSuccess `json:"success,required"`
+ JSON configEditResponseEnvelopeJSON `json:"-"`
+}
+
+// configEditResponseEnvelopeJSON contains the JSON metadata for the struct
+// [ConfigEditResponseEnvelope]
+type configEditResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ConfigEditResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r configEditResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type ConfigEditResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON configEditResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// configEditResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [ConfigEditResponseEnvelopeErrors]
+type configEditResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ConfigEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r configEditResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type ConfigEditResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON configEditResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// configEditResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [ConfigEditResponseEnvelopeMessages]
+type configEditResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ConfigEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r configEditResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type ConfigEditResponseEnvelopeSuccess bool
+
+const (
+ ConfigEditResponseEnvelopeSuccessTrue ConfigEditResponseEnvelopeSuccess = true
+)
+
+type ConfigGetParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type ConfigGetResponseEnvelope struct {
+ Errors []ConfigGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []ConfigGetResponseEnvelopeMessages `json:"messages,required"`
+ Result ConfigGetResponse `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success ConfigGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON configGetResponseEnvelopeJSON `json:"-"`
+}
+
+// configGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [ConfigGetResponseEnvelope]
+type configGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ConfigGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r configGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type ConfigGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON configGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// configGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [ConfigGetResponseEnvelopeErrors]
+type configGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ConfigGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r configGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type ConfigGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON configGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// configGetResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [ConfigGetResponseEnvelopeMessages]
+type configGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ConfigGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r configGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type ConfigGetResponseEnvelopeSuccess bool
+
+const (
+ ConfigGetResponseEnvelopeSuccessTrue ConfigGetResponseEnvelopeSuccess = true
+)
diff --git a/hyperdrive/config_test.go b/hyperdrive/config_test.go
new file mode 100644
index 00000000000..ec90e359c15
--- /dev/null
+++ b/hyperdrive/config_test.go
@@ -0,0 +1,196 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package hyperdrive_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/hyperdrive"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestConfigNew(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"),
+ )
+ _, err := client.Hyperdrive.Configs.New(context.TODO(), hyperdrive.ConfigNewParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Origin: cloudflare.F(hyperdrive.ConfigNewParamsOrigin{
+ Password: cloudflare.F("password1234!"),
+ }),
+ })
+ 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())
+ }
+}
+
+func TestConfigUpdate(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"),
+ )
+ _, err := client.Hyperdrive.Configs.Update(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ hyperdrive.ConfigUpdateParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Origin: cloudflare.F(hyperdrive.ConfigUpdateParamsOrigin{
+ Password: cloudflare.F("password1234!"),
+ }),
+ },
+ )
+ 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())
+ }
+}
+
+func TestConfigList(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"),
+ )
+ _, err := client.Hyperdrive.Configs.List(context.TODO(), hyperdrive.ConfigListParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ })
+ 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())
+ }
+}
+
+func TestConfigDelete(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"),
+ )
+ _, err := client.Hyperdrive.Configs.Delete(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ hyperdrive.ConfigDeleteParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestConfigEditWithOptionalParams(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"),
+ )
+ _, err := client.Hyperdrive.Configs.Edit(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ hyperdrive.ConfigEditParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Origin: cloudflare.F(hyperdrive.ConfigEditParamsOrigin{
+ Password: cloudflare.F("password1234!"),
+ }),
+ },
+ )
+ 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())
+ }
+}
+
+func TestConfigGet(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"),
+ )
+ _, err := client.Hyperdrive.Configs.Get(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ hyperdrive.ConfigGetParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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/hyperdrive.go b/hyperdrive/hyperdrive.go
similarity index 89%
rename from hyperdrive.go
rename to hyperdrive/hyperdrive.go
index 79eeb68ab8b..eedca3cbf4e 100644
--- a/hyperdrive.go
+++ b/hyperdrive/hyperdrive.go
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package cloudflare
+package hyperdrive
import (
"github.com/cloudflare/cloudflare-go/option"
@@ -12,7 +12,7 @@ import (
// service directly, and instead use the [NewHyperdriveService] method instead.
type HyperdriveService struct {
Options []option.RequestOption
- Configs *HyperdriveConfigService
+ Configs *ConfigService
}
// NewHyperdriveService generates a new service that applies the given options to
@@ -21,6 +21,6 @@ type HyperdriveService struct {
func NewHyperdriveService(opts ...option.RequestOption) (r *HyperdriveService) {
r = &HyperdriveService{}
r.Options = opts
- r.Configs = NewHyperdriveConfigService(opts...)
+ r.Configs = NewConfigService(opts...)
return
}
diff --git a/hyperdriveconfig.go b/hyperdriveconfig.go
deleted file mode 100644
index 4ef7d408b80..00000000000
--- a/hyperdriveconfig.go
+++ /dev/null
@@ -1,802 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "reflect"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/option"
- "github.com/tidwall/gjson"
-)
-
-// HyperdriveConfigService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewHyperdriveConfigService] method
-// instead.
-type HyperdriveConfigService struct {
- Options []option.RequestOption
-}
-
-// NewHyperdriveConfigService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewHyperdriveConfigService(opts ...option.RequestOption) (r *HyperdriveConfigService) {
- r = &HyperdriveConfigService{}
- r.Options = opts
- return
-}
-
-// Creates and returns a new Hyperdrive configuration.
-func (r *HyperdriveConfigService) New(ctx context.Context, params HyperdriveConfigNewParams, opts ...option.RequestOption) (res *HyperdriveConfigNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env HyperdriveConfigNewResponseEnvelope
- path := fmt.Sprintf("accounts/%s/hyperdrive/configs", params.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Updates and returns the specified Hyperdrive configuration.
-func (r *HyperdriveConfigService) Update(ctx context.Context, hyperdriveID string, params HyperdriveConfigUpdateParams, opts ...option.RequestOption) (res *HyperdriveConfigUpdateResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env HyperdriveConfigUpdateResponseEnvelope
- path := fmt.Sprintf("accounts/%s/hyperdrive/configs/%s", params.AccountID, hyperdriveID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Returns a list of Hyperdrives
-func (r *HyperdriveConfigService) List(ctx context.Context, query HyperdriveConfigListParams, opts ...option.RequestOption) (res *[]HyperdriveConfigListResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env HyperdriveConfigListResponseEnvelope
- path := fmt.Sprintf("accounts/%s/hyperdrive/configs", query.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Deletes the specified Hyperdrive.
-func (r *HyperdriveConfigService) Delete(ctx context.Context, hyperdriveID string, body HyperdriveConfigDeleteParams, opts ...option.RequestOption) (res *HyperdriveConfigDeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env HyperdriveConfigDeleteResponseEnvelope
- path := fmt.Sprintf("accounts/%s/hyperdrive/configs/%s", body.AccountID, hyperdriveID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Patches and returns the specified Hyperdrive configuration. Updates to the
-// origin and caching settings are applied with an all-or-nothing approach.
-func (r *HyperdriveConfigService) Edit(ctx context.Context, hyperdriveID string, params HyperdriveConfigEditParams, opts ...option.RequestOption) (res *HyperdriveConfigEditResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env HyperdriveConfigEditResponseEnvelope
- path := fmt.Sprintf("accounts/%s/hyperdrive/configs/%s", params.AccountID, hyperdriveID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Returns the specified Hyperdrive configuration.
-func (r *HyperdriveConfigService) Get(ctx context.Context, hyperdriveID string, query HyperdriveConfigGetParams, opts ...option.RequestOption) (res *HyperdriveConfigGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env HyperdriveConfigGetResponseEnvelope
- path := fmt.Sprintf("accounts/%s/hyperdrive/configs/%s", query.AccountID, hyperdriveID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type HyperdriveConfigNewResponse struct {
- // Identifier
- ID string `json:"id"`
- JSON hyperdriveConfigNewResponseJSON `json:"-"`
-}
-
-// hyperdriveConfigNewResponseJSON contains the JSON metadata for the struct
-// [HyperdriveConfigNewResponse]
-type hyperdriveConfigNewResponseJSON struct {
- ID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HyperdriveConfigNewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r hyperdriveConfigNewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type HyperdriveConfigUpdateResponse struct {
- // Identifier
- ID string `json:"id"`
- JSON hyperdriveConfigUpdateResponseJSON `json:"-"`
-}
-
-// hyperdriveConfigUpdateResponseJSON contains the JSON metadata for the struct
-// [HyperdriveConfigUpdateResponse]
-type hyperdriveConfigUpdateResponseJSON struct {
- ID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HyperdriveConfigUpdateResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r hyperdriveConfigUpdateResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type HyperdriveConfigListResponse struct {
- // Identifier
- ID string `json:"id"`
- JSON hyperdriveConfigListResponseJSON `json:"-"`
-}
-
-// hyperdriveConfigListResponseJSON contains the JSON metadata for the struct
-// [HyperdriveConfigListResponse]
-type hyperdriveConfigListResponseJSON struct {
- ID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HyperdriveConfigListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r hyperdriveConfigListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// Union satisfied by [HyperdriveConfigDeleteResponseUnknown] or
-// [shared.UnionString].
-type HyperdriveConfigDeleteResponse interface {
- ImplementsHyperdriveConfigDeleteResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*HyperdriveConfigDeleteResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-type HyperdriveConfigEditResponse struct {
- // Identifier
- ID string `json:"id"`
- JSON hyperdriveConfigEditResponseJSON `json:"-"`
-}
-
-// hyperdriveConfigEditResponseJSON contains the JSON metadata for the struct
-// [HyperdriveConfigEditResponse]
-type hyperdriveConfigEditResponseJSON struct {
- ID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HyperdriveConfigEditResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r hyperdriveConfigEditResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type HyperdriveConfigGetResponse struct {
- // Identifier
- ID string `json:"id"`
- JSON hyperdriveConfigGetResponseJSON `json:"-"`
-}
-
-// hyperdriveConfigGetResponseJSON contains the JSON metadata for the struct
-// [HyperdriveConfigGetResponse]
-type hyperdriveConfigGetResponseJSON struct {
- ID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HyperdriveConfigGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r hyperdriveConfigGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type HyperdriveConfigNewParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
- Origin param.Field[HyperdriveConfigNewParamsOrigin] `json:"origin,required"`
-}
-
-func (r HyperdriveConfigNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type HyperdriveConfigNewParamsOrigin struct {
- // The password required to access your origin database. This value is write-only
- // and never returned by the API.
- Password param.Field[string] `json:"password,required"`
-}
-
-func (r HyperdriveConfigNewParamsOrigin) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type HyperdriveConfigNewResponseEnvelope struct {
- Errors []HyperdriveConfigNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []HyperdriveConfigNewResponseEnvelopeMessages `json:"messages,required"`
- Result HyperdriveConfigNewResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success HyperdriveConfigNewResponseEnvelopeSuccess `json:"success,required"`
- JSON hyperdriveConfigNewResponseEnvelopeJSON `json:"-"`
-}
-
-// hyperdriveConfigNewResponseEnvelopeJSON contains the JSON metadata for the
-// struct [HyperdriveConfigNewResponseEnvelope]
-type hyperdriveConfigNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HyperdriveConfigNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r hyperdriveConfigNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type HyperdriveConfigNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON hyperdriveConfigNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// hyperdriveConfigNewResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [HyperdriveConfigNewResponseEnvelopeErrors]
-type hyperdriveConfigNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HyperdriveConfigNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r hyperdriveConfigNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type HyperdriveConfigNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON hyperdriveConfigNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// hyperdriveConfigNewResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [HyperdriveConfigNewResponseEnvelopeMessages]
-type hyperdriveConfigNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HyperdriveConfigNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r hyperdriveConfigNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type HyperdriveConfigNewResponseEnvelopeSuccess bool
-
-const (
- HyperdriveConfigNewResponseEnvelopeSuccessTrue HyperdriveConfigNewResponseEnvelopeSuccess = true
-)
-
-type HyperdriveConfigUpdateParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
- Origin param.Field[HyperdriveConfigUpdateParamsOrigin] `json:"origin,required"`
-}
-
-func (r HyperdriveConfigUpdateParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type HyperdriveConfigUpdateParamsOrigin struct {
- // The password required to access your origin database. This value is write-only
- // and never returned by the API.
- Password param.Field[string] `json:"password,required"`
-}
-
-func (r HyperdriveConfigUpdateParamsOrigin) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type HyperdriveConfigUpdateResponseEnvelope struct {
- Errors []HyperdriveConfigUpdateResponseEnvelopeErrors `json:"errors,required"`
- Messages []HyperdriveConfigUpdateResponseEnvelopeMessages `json:"messages,required"`
- Result HyperdriveConfigUpdateResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success HyperdriveConfigUpdateResponseEnvelopeSuccess `json:"success,required"`
- JSON hyperdriveConfigUpdateResponseEnvelopeJSON `json:"-"`
-}
-
-// hyperdriveConfigUpdateResponseEnvelopeJSON contains the JSON metadata for the
-// struct [HyperdriveConfigUpdateResponseEnvelope]
-type hyperdriveConfigUpdateResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HyperdriveConfigUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r hyperdriveConfigUpdateResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type HyperdriveConfigUpdateResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON hyperdriveConfigUpdateResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// hyperdriveConfigUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [HyperdriveConfigUpdateResponseEnvelopeErrors]
-type hyperdriveConfigUpdateResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HyperdriveConfigUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r hyperdriveConfigUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type HyperdriveConfigUpdateResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON hyperdriveConfigUpdateResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// hyperdriveConfigUpdateResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [HyperdriveConfigUpdateResponseEnvelopeMessages]
-type hyperdriveConfigUpdateResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HyperdriveConfigUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r hyperdriveConfigUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type HyperdriveConfigUpdateResponseEnvelopeSuccess bool
-
-const (
- HyperdriveConfigUpdateResponseEnvelopeSuccessTrue HyperdriveConfigUpdateResponseEnvelopeSuccess = true
-)
-
-type HyperdriveConfigListParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type HyperdriveConfigListResponseEnvelope struct {
- Errors []HyperdriveConfigListResponseEnvelopeErrors `json:"errors,required"`
- Messages []HyperdriveConfigListResponseEnvelopeMessages `json:"messages,required"`
- Result []HyperdriveConfigListResponse `json:"result,required"`
- // Whether the API call was successful
- Success HyperdriveConfigListResponseEnvelopeSuccess `json:"success,required"`
- JSON hyperdriveConfigListResponseEnvelopeJSON `json:"-"`
-}
-
-// hyperdriveConfigListResponseEnvelopeJSON contains the JSON metadata for the
-// struct [HyperdriveConfigListResponseEnvelope]
-type hyperdriveConfigListResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HyperdriveConfigListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r hyperdriveConfigListResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type HyperdriveConfigListResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON hyperdriveConfigListResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// hyperdriveConfigListResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [HyperdriveConfigListResponseEnvelopeErrors]
-type hyperdriveConfigListResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HyperdriveConfigListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r hyperdriveConfigListResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type HyperdriveConfigListResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON hyperdriveConfigListResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// hyperdriveConfigListResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [HyperdriveConfigListResponseEnvelopeMessages]
-type hyperdriveConfigListResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HyperdriveConfigListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r hyperdriveConfigListResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type HyperdriveConfigListResponseEnvelopeSuccess bool
-
-const (
- HyperdriveConfigListResponseEnvelopeSuccessTrue HyperdriveConfigListResponseEnvelopeSuccess = true
-)
-
-type HyperdriveConfigDeleteParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type HyperdriveConfigDeleteResponseEnvelope struct {
- Errors []HyperdriveConfigDeleteResponseEnvelopeErrors `json:"errors,required"`
- Messages []HyperdriveConfigDeleteResponseEnvelopeMessages `json:"messages,required"`
- Result HyperdriveConfigDeleteResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success HyperdriveConfigDeleteResponseEnvelopeSuccess `json:"success,required"`
- JSON hyperdriveConfigDeleteResponseEnvelopeJSON `json:"-"`
-}
-
-// hyperdriveConfigDeleteResponseEnvelopeJSON contains the JSON metadata for the
-// struct [HyperdriveConfigDeleteResponseEnvelope]
-type hyperdriveConfigDeleteResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HyperdriveConfigDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r hyperdriveConfigDeleteResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type HyperdriveConfigDeleteResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON hyperdriveConfigDeleteResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// hyperdriveConfigDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [HyperdriveConfigDeleteResponseEnvelopeErrors]
-type hyperdriveConfigDeleteResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HyperdriveConfigDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r hyperdriveConfigDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type HyperdriveConfigDeleteResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON hyperdriveConfigDeleteResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// hyperdriveConfigDeleteResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [HyperdriveConfigDeleteResponseEnvelopeMessages]
-type hyperdriveConfigDeleteResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HyperdriveConfigDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r hyperdriveConfigDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type HyperdriveConfigDeleteResponseEnvelopeSuccess bool
-
-const (
- HyperdriveConfigDeleteResponseEnvelopeSuccessTrue HyperdriveConfigDeleteResponseEnvelopeSuccess = true
-)
-
-type HyperdriveConfigEditParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
- Origin param.Field[HyperdriveConfigEditParamsOrigin] `json:"origin"`
-}
-
-func (r HyperdriveConfigEditParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type HyperdriveConfigEditParamsOrigin struct {
- // The password required to access your origin database. This value is write-only
- // and never returned by the API.
- Password param.Field[string] `json:"password,required"`
-}
-
-func (r HyperdriveConfigEditParamsOrigin) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type HyperdriveConfigEditResponseEnvelope struct {
- Errors []HyperdriveConfigEditResponseEnvelopeErrors `json:"errors,required"`
- Messages []HyperdriveConfigEditResponseEnvelopeMessages `json:"messages,required"`
- Result HyperdriveConfigEditResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success HyperdriveConfigEditResponseEnvelopeSuccess `json:"success,required"`
- JSON hyperdriveConfigEditResponseEnvelopeJSON `json:"-"`
-}
-
-// hyperdriveConfigEditResponseEnvelopeJSON contains the JSON metadata for the
-// struct [HyperdriveConfigEditResponseEnvelope]
-type hyperdriveConfigEditResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HyperdriveConfigEditResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r hyperdriveConfigEditResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type HyperdriveConfigEditResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON hyperdriveConfigEditResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// hyperdriveConfigEditResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [HyperdriveConfigEditResponseEnvelopeErrors]
-type hyperdriveConfigEditResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HyperdriveConfigEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r hyperdriveConfigEditResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type HyperdriveConfigEditResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON hyperdriveConfigEditResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// hyperdriveConfigEditResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [HyperdriveConfigEditResponseEnvelopeMessages]
-type hyperdriveConfigEditResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HyperdriveConfigEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r hyperdriveConfigEditResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type HyperdriveConfigEditResponseEnvelopeSuccess bool
-
-const (
- HyperdriveConfigEditResponseEnvelopeSuccessTrue HyperdriveConfigEditResponseEnvelopeSuccess = true
-)
-
-type HyperdriveConfigGetParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type HyperdriveConfigGetResponseEnvelope struct {
- Errors []HyperdriveConfigGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []HyperdriveConfigGetResponseEnvelopeMessages `json:"messages,required"`
- Result HyperdriveConfigGetResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success HyperdriveConfigGetResponseEnvelopeSuccess `json:"success,required"`
- JSON hyperdriveConfigGetResponseEnvelopeJSON `json:"-"`
-}
-
-// hyperdriveConfigGetResponseEnvelopeJSON contains the JSON metadata for the
-// struct [HyperdriveConfigGetResponseEnvelope]
-type hyperdriveConfigGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HyperdriveConfigGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r hyperdriveConfigGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type HyperdriveConfigGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON hyperdriveConfigGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// hyperdriveConfigGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [HyperdriveConfigGetResponseEnvelopeErrors]
-type hyperdriveConfigGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HyperdriveConfigGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r hyperdriveConfigGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type HyperdriveConfigGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON hyperdriveConfigGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// hyperdriveConfigGetResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [HyperdriveConfigGetResponseEnvelopeMessages]
-type hyperdriveConfigGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *HyperdriveConfigGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r hyperdriveConfigGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type HyperdriveConfigGetResponseEnvelopeSuccess bool
-
-const (
- HyperdriveConfigGetResponseEnvelopeSuccessTrue HyperdriveConfigGetResponseEnvelopeSuccess = true
-)
diff --git a/hyperdriveconfig_test.go b/hyperdriveconfig_test.go
deleted file mode 100644
index 1914973dfc4..00000000000
--- a/hyperdriveconfig_test.go
+++ /dev/null
@@ -1,195 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestHyperdriveConfigNew(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"),
- )
- _, err := client.Hyperdrive.Configs.New(context.TODO(), cloudflare.HyperdriveConfigNewParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Origin: cloudflare.F(cloudflare.HyperdriveConfigNewParamsOrigin{
- Password: cloudflare.F("password1234!"),
- }),
- })
- 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())
- }
-}
-
-func TestHyperdriveConfigUpdate(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"),
- )
- _, err := client.Hyperdrive.Configs.Update(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.HyperdriveConfigUpdateParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Origin: cloudflare.F(cloudflare.HyperdriveConfigUpdateParamsOrigin{
- Password: cloudflare.F("password1234!"),
- }),
- },
- )
- 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())
- }
-}
-
-func TestHyperdriveConfigList(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"),
- )
- _, err := client.Hyperdrive.Configs.List(context.TODO(), cloudflare.HyperdriveConfigListParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- })
- 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())
- }
-}
-
-func TestHyperdriveConfigDelete(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"),
- )
- _, err := client.Hyperdrive.Configs.Delete(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.HyperdriveConfigDeleteParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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())
- }
-}
-
-func TestHyperdriveConfigEditWithOptionalParams(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"),
- )
- _, err := client.Hyperdrive.Configs.Edit(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.HyperdriveConfigEditParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Origin: cloudflare.F(cloudflare.HyperdriveConfigEditParamsOrigin{
- Password: cloudflare.F("password1234!"),
- }),
- },
- )
- 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())
- }
-}
-
-func TestHyperdriveConfigGet(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"),
- )
- _, err := client.Hyperdrive.Configs.Get(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.HyperdriveConfigGetParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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/images/aliases.go b/images/aliases.go
new file mode 100644
index 00000000000..f8d1d209fc8
--- /dev/null
+++ b/images/aliases.go
@@ -0,0 +1,9 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package images
+
+import (
+ "github.com/cloudflare/cloudflare-go/internal/apierror"
+)
+
+type Error = apierror.Error
diff --git a/image.go b/images/image.go
similarity index 85%
rename from image.go
rename to images/image.go
index ec386bc9ae4..090fd2ebdf9 100644
--- a/image.go
+++ b/images/image.go
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package cloudflare
+package images
import (
"github.com/cloudflare/cloudflare-go/option"
@@ -12,8 +12,8 @@ import (
// directly, and instead use the [NewImageService] method instead.
type ImageService struct {
Options []option.RequestOption
- V1 *ImageV1Service
- V2 *ImageV2Service
+ V1 *V1Service
+ V2 *V2Service
}
// NewImageService generates a new service that applies the given options to each
@@ -22,7 +22,7 @@ type ImageService struct {
func NewImageService(opts ...option.RequestOption) (r *ImageService) {
r = &ImageService{}
r.Options = opts
- r.V1 = NewImageV1Service(opts...)
- r.V2 = NewImageV2Service(opts...)
+ r.V1 = NewV1Service(opts...)
+ r.V2 = NewV2Service(opts...)
return
}
diff --git a/images/v1.go b/images/v1.go
new file mode 100644
index 00000000000..97b8d98f264
--- /dev/null
+++ b/images/v1.go
@@ -0,0 +1,687 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package images
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+ "reflect"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/tidwall/gjson"
+)
+
+// V1Service contains methods and other services that help with interacting with
+// the cloudflare API. Note, unlike clients, this service does not read variables
+// from the environment automatically. You should not instantiate this service
+// directly, and instead use the [NewV1Service] method instead.
+type V1Service struct {
+ Options []option.RequestOption
+ Keys *V1KeyService
+ Stats *V1StatService
+ Variants *V1VariantService
+ Blobs *V1BlobService
+}
+
+// NewV1Service generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewV1Service(opts ...option.RequestOption) (r *V1Service) {
+ r = &V1Service{}
+ r.Options = opts
+ r.Keys = NewV1KeyService(opts...)
+ r.Stats = NewV1StatService(opts...)
+ r.Variants = NewV1VariantService(opts...)
+ r.Blobs = NewV1BlobService(opts...)
+ return
+}
+
+// Upload an image with up to 10 Megabytes using a single HTTP POST
+// (multipart/form-data) request. An image can be uploaded by sending an image file
+// or passing an accessible to an API url.
+func (r *V1Service) New(ctx context.Context, params V1NewParams, opts ...option.RequestOption) (res *ImagesImage, err error) {
+ opts = append(r.Options[:], opts...)
+ var env V1NewResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/images/v1", params.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// List up to 100 images with one request. Use the optional parameters below to get
+// a specific range of images.
+func (r *V1Service) List(ctx context.Context, params V1ListParams, opts ...option.RequestOption) (res *shared.V4PagePagination[V1ListResponse], err error) {
+ var raw *http.Response
+ opts = append(r.Options, opts...)
+ opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
+ path := fmt.Sprintf("accounts/%s/images/v1", params.AccountID)
+ cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, params, &res, opts...)
+ if err != nil {
+ return nil, err
+ }
+ err = cfg.Execute()
+ if err != nil {
+ return nil, err
+ }
+ res.SetPageConfig(cfg, raw)
+ return res, nil
+}
+
+// List up to 100 images with one request. Use the optional parameters below to get
+// a specific range of images.
+func (r *V1Service) ListAutoPaging(ctx context.Context, params V1ListParams, opts ...option.RequestOption) *shared.V4PagePaginationAutoPager[V1ListResponse] {
+ return shared.NewV4PagePaginationAutoPager(r.List(ctx, params, opts...))
+}
+
+// Delete an image on Cloudflare Images. On success, all copies of the image are
+// deleted and purged from cache.
+func (r *V1Service) Delete(ctx context.Context, imageID string, body V1DeleteParams, opts ...option.RequestOption) (res *V1DeleteResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env V1DeleteResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/images/v1/%s", body.AccountID, imageID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Update image access control. On access control change, all copies of the image
+// are purged from cache.
+func (r *V1Service) Edit(ctx context.Context, imageID string, params V1EditParams, opts ...option.RequestOption) (res *ImagesImage, err error) {
+ opts = append(r.Options[:], opts...)
+ var env V1EditResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/images/v1/%s", params.AccountID, imageID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Fetch details for a single image.
+func (r *V1Service) Get(ctx context.Context, imageID string, query V1GetParams, opts ...option.RequestOption) (res *ImagesImage, err error) {
+ opts = append(r.Options[:], opts...)
+ var env V1GetResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/images/v1/%s", query.AccountID, imageID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type ImagesImage struct {
+ // Image unique identifier.
+ ID string `json:"id"`
+ // Image file name.
+ Filename string `json:"filename"`
+ // User modifiable key-value store. Can be used for keeping references to another
+ // system of record for managing images. Metadata must not exceed 1024 bytes.
+ Meta interface{} `json:"meta"`
+ // Indicates whether the image can be a accessed only using it's UID. If set to
+ // true, a signed token needs to be generated with a signing key to view the image.
+ RequireSignedURLs bool `json:"requireSignedURLs"`
+ // When the media item was uploaded.
+ Uploaded time.Time `json:"uploaded" format:"date-time"`
+ // Object specifying available variants for an image.
+ Variants []ImagesImageVariant `json:"variants" format:"uri"`
+ JSON imagesImageJSON `json:"-"`
+}
+
+// imagesImageJSON contains the JSON metadata for the struct [ImagesImage]
+type imagesImageJSON struct {
+ ID apijson.Field
+ Filename apijson.Field
+ Meta apijson.Field
+ RequireSignedURLs apijson.Field
+ Uploaded apijson.Field
+ Variants apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ImagesImage) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r imagesImageJSON) RawJSON() string {
+ return r.raw
+}
+
+// URI to thumbnail variant for an image.
+//
+// Union satisfied by [shared.UnionString], [shared.UnionString] or
+// [shared.UnionString].
+type ImagesImageVariant interface {
+ ImplementsImagesImagesImageVariant()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*ImagesImageVariant)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+type V1ListResponse struct {
+ Errors []V1ListResponseError `json:"errors,required"`
+ Messages []V1ListResponseMessage `json:"messages,required"`
+ Result V1ListResponseResult `json:"result,required"`
+ // Whether the API call was successful
+ Success V1ListResponseSuccess `json:"success,required"`
+ JSON v1ListResponseJSON `json:"-"`
+}
+
+// v1ListResponseJSON contains the JSON metadata for the struct [V1ListResponse]
+type v1ListResponseJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V1ListResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v1ListResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type V1ListResponseError struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON v1ListResponseErrorJSON `json:"-"`
+}
+
+// v1ListResponseErrorJSON contains the JSON metadata for the struct
+// [V1ListResponseError]
+type v1ListResponseErrorJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V1ListResponseError) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v1ListResponseErrorJSON) RawJSON() string {
+ return r.raw
+}
+
+type V1ListResponseMessage struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON v1ListResponseMessageJSON `json:"-"`
+}
+
+// v1ListResponseMessageJSON contains the JSON metadata for the struct
+// [V1ListResponseMessage]
+type v1ListResponseMessageJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V1ListResponseMessage) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v1ListResponseMessageJSON) RawJSON() string {
+ return r.raw
+}
+
+type V1ListResponseResult struct {
+ Images []ImagesImage `json:"images"`
+ JSON v1ListResponseResultJSON `json:"-"`
+}
+
+// v1ListResponseResultJSON contains the JSON metadata for the struct
+// [V1ListResponseResult]
+type v1ListResponseResultJSON struct {
+ Images apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V1ListResponseResult) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v1ListResponseResultJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type V1ListResponseSuccess bool
+
+const (
+ V1ListResponseSuccessTrue V1ListResponseSuccess = true
+)
+
+// Union satisfied by [images.V1DeleteResponseUnknown] or [shared.UnionString].
+type V1DeleteResponse interface {
+ ImplementsImagesV1DeleteResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*V1DeleteResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+type V1NewParams struct {
+ // Account identifier tag.
+ AccountID param.Field[string] `path:"account_id,required"`
+ Metadata param.Field[interface{}] `json:"metadata"`
+ // Indicates whether the image requires a signature token for the access.
+ RequireSignedURLs param.Field[bool] `json:"requireSignedURLs"`
+}
+
+func (r V1NewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type V1NewResponseEnvelope struct {
+ Errors []V1NewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []V1NewResponseEnvelopeMessages `json:"messages,required"`
+ Result ImagesImage `json:"result,required"`
+ // Whether the API call was successful
+ Success V1NewResponseEnvelopeSuccess `json:"success,required"`
+ JSON v1NewResponseEnvelopeJSON `json:"-"`
+}
+
+// v1NewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [V1NewResponseEnvelope]
+type v1NewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V1NewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v1NewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type V1NewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON v1NewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// v1NewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [V1NewResponseEnvelopeErrors]
+type v1NewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V1NewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v1NewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type V1NewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON v1NewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// v1NewResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [V1NewResponseEnvelopeMessages]
+type v1NewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V1NewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v1NewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type V1NewResponseEnvelopeSuccess bool
+
+const (
+ V1NewResponseEnvelopeSuccessTrue V1NewResponseEnvelopeSuccess = true
+)
+
+type V1ListParams struct {
+ // Account identifier tag.
+ AccountID param.Field[string] `path:"account_id,required"`
+ // Page number of paginated results.
+ Page param.Field[float64] `query:"page"`
+ // Number of items per page.
+ PerPage param.Field[float64] `query:"per_page"`
+}
+
+// URLQuery serializes [V1ListParams]'s query parameters as `url.Values`.
+func (r V1ListParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type V1DeleteParams struct {
+ // Account identifier tag.
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type V1DeleteResponseEnvelope struct {
+ Errors []V1DeleteResponseEnvelopeErrors `json:"errors,required"`
+ Messages []V1DeleteResponseEnvelopeMessages `json:"messages,required"`
+ Result V1DeleteResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success V1DeleteResponseEnvelopeSuccess `json:"success,required"`
+ JSON v1DeleteResponseEnvelopeJSON `json:"-"`
+}
+
+// v1DeleteResponseEnvelopeJSON contains the JSON metadata for the struct
+// [V1DeleteResponseEnvelope]
+type v1DeleteResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V1DeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v1DeleteResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type V1DeleteResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON v1DeleteResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// v1DeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [V1DeleteResponseEnvelopeErrors]
+type v1DeleteResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V1DeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v1DeleteResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type V1DeleteResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON v1DeleteResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// v1DeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [V1DeleteResponseEnvelopeMessages]
+type v1DeleteResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V1DeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v1DeleteResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type V1DeleteResponseEnvelopeSuccess bool
+
+const (
+ V1DeleteResponseEnvelopeSuccessTrue V1DeleteResponseEnvelopeSuccess = true
+)
+
+type V1EditParams struct {
+ // Account identifier tag.
+ AccountID param.Field[string] `path:"account_id,required"`
+ // User modifiable key-value store. Can be used for keeping references to another
+ // system of record for managing images. No change if not specified.
+ Metadata param.Field[interface{}] `json:"metadata"`
+ // Indicates whether the image can be accessed using only its UID. If set to
+ // `true`, a signed token needs to be generated with a signing key to view the
+ // image. Returns a new UID on a change. No change if not specified.
+ RequireSignedURLs param.Field[bool] `json:"requireSignedURLs"`
+}
+
+func (r V1EditParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type V1EditResponseEnvelope struct {
+ Errors []V1EditResponseEnvelopeErrors `json:"errors,required"`
+ Messages []V1EditResponseEnvelopeMessages `json:"messages,required"`
+ Result ImagesImage `json:"result,required"`
+ // Whether the API call was successful
+ Success V1EditResponseEnvelopeSuccess `json:"success,required"`
+ JSON v1EditResponseEnvelopeJSON `json:"-"`
+}
+
+// v1EditResponseEnvelopeJSON contains the JSON metadata for the struct
+// [V1EditResponseEnvelope]
+type v1EditResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V1EditResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v1EditResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type V1EditResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON v1EditResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// v1EditResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [V1EditResponseEnvelopeErrors]
+type v1EditResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V1EditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v1EditResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type V1EditResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON v1EditResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// v1EditResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [V1EditResponseEnvelopeMessages]
+type v1EditResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V1EditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v1EditResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type V1EditResponseEnvelopeSuccess bool
+
+const (
+ V1EditResponseEnvelopeSuccessTrue V1EditResponseEnvelopeSuccess = true
+)
+
+type V1GetParams struct {
+ // Account identifier tag.
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type V1GetResponseEnvelope struct {
+ Errors []V1GetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []V1GetResponseEnvelopeMessages `json:"messages,required"`
+ Result ImagesImage `json:"result,required"`
+ // Whether the API call was successful
+ Success V1GetResponseEnvelopeSuccess `json:"success,required"`
+ JSON v1GetResponseEnvelopeJSON `json:"-"`
+}
+
+// v1GetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [V1GetResponseEnvelope]
+type v1GetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V1GetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v1GetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type V1GetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON v1GetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// v1GetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [V1GetResponseEnvelopeErrors]
+type v1GetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V1GetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v1GetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type V1GetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON v1GetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// v1GetResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [V1GetResponseEnvelopeMessages]
+type v1GetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V1GetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v1GetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type V1GetResponseEnvelopeSuccess bool
+
+const (
+ V1GetResponseEnvelopeSuccessTrue V1GetResponseEnvelopeSuccess = true
+)
diff --git a/images/v1_test.go b/images/v1_test.go
new file mode 100644
index 00000000000..5d474132b1e
--- /dev/null
+++ b/images/v1_test.go
@@ -0,0 +1,163 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package images_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/images"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestV1NewWithOptionalParams(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"),
+ )
+ _, err := client.Images.V1.New(context.TODO(), images.V1NewParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Metadata: cloudflare.F[any](map[string]interface{}{}),
+ RequireSignedURLs: cloudflare.F(true),
+ })
+ 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())
+ }
+}
+
+func TestV1ListWithOptionalParams(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"),
+ )
+ _, err := client.Images.V1.List(context.TODO(), images.V1ListParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Page: cloudflare.F(1.000000),
+ PerPage: cloudflare.F(10.000000),
+ })
+ 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())
+ }
+}
+
+func TestV1Delete(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"),
+ )
+ _, err := client.Images.V1.Delete(
+ context.TODO(),
+ "string",
+ images.V1DeleteParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestV1EditWithOptionalParams(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"),
+ )
+ _, err := client.Images.V1.Edit(
+ context.TODO(),
+ "string",
+ images.V1EditParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Metadata: cloudflare.F[any](map[string]interface{}{}),
+ RequireSignedURLs: cloudflare.F(true),
+ },
+ )
+ 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())
+ }
+}
+
+func TestV1Get(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"),
+ )
+ _, err := client.Images.V1.Get(
+ context.TODO(),
+ "string",
+ images.V1GetParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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/images/v1blob.go b/images/v1blob.go
new file mode 100644
index 00000000000..536a6b20c95
--- /dev/null
+++ b/images/v1blob.go
@@ -0,0 +1,45 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package images
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// V1BlobService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewV1BlobService] method instead.
+type V1BlobService struct {
+ Options []option.RequestOption
+}
+
+// NewV1BlobService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewV1BlobService(opts ...option.RequestOption) (r *V1BlobService) {
+ r = &V1BlobService{}
+ r.Options = opts
+ return
+}
+
+// Fetch base image. For most images this will be the originally uploaded file. For
+// larger images it can be a near-lossless version of the original.
+func (r *V1BlobService) Get(ctx context.Context, imageID string, query V1BlobGetParams, opts ...option.RequestOption) (res *http.Response, err error) {
+ opts = append(r.Options[:], opts...)
+ opts = append([]option.RequestOption{option.WithHeader("Accept", "image/*")}, opts...)
+ path := fmt.Sprintf("accounts/%s/images/v1/%s/blob", query.AccountID, imageID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &res, opts...)
+ return
+}
+
+type V1BlobGetParams struct {
+ // Account identifier tag.
+ AccountID param.Field[string] `path:"account_id,required"`
+}
diff --git a/images/v1blob_test.go b/images/v1blob_test.go
new file mode 100644
index 00000000000..8a1ce93e8fd
--- /dev/null
+++ b/images/v1blob_test.go
@@ -0,0 +1,59 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package images_test
+
+import (
+ "bytes"
+ "context"
+ "errors"
+ "io"
+ "net/http"
+ "net/http/httptest"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/images"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestV1BlobGet(t *testing.T) {
+ t.Skip("skipped: tests are disabled for the time being")
+ server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ w.WriteHeader(200)
+ w.Write([]byte("abc"))
+ }))
+ defer server.Close()
+ baseURL := server.URL
+ client := cloudflare.NewClient(
+ option.WithBaseURL(baseURL),
+ option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"),
+ option.WithAPIEmail("user@example.com"),
+ )
+ resp, err := client.Images.V1.Blobs.Get(
+ context.TODO(),
+ "string",
+ images.V1BlobGetParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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())
+ }
+ defer resp.Body.Close()
+
+ b, err := io.ReadAll(resp.Body)
+ 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())
+ }
+ if !bytes.Equal(b, []byte("abc")) {
+ t.Fatalf("return value not %s: %s", "abc", b)
+ }
+}
diff --git a/images/v1key.go b/images/v1key.go
new file mode 100644
index 00000000000..afa19abf08f
--- /dev/null
+++ b/images/v1key.go
@@ -0,0 +1,175 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package images
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// V1KeyService contains methods and other services that help with interacting with
+// the cloudflare API. Note, unlike clients, this service does not read variables
+// from the environment automatically. You should not instantiate this service
+// directly, and instead use the [NewV1KeyService] method instead.
+type V1KeyService struct {
+ Options []option.RequestOption
+}
+
+// NewV1KeyService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewV1KeyService(opts ...option.RequestOption) (r *V1KeyService) {
+ r = &V1KeyService{}
+ r.Options = opts
+ return
+}
+
+// Lists your signing keys. These can be found on your Cloudflare Images dashboard.
+func (r *V1KeyService) List(ctx context.Context, query V1KeyListParams, opts ...option.RequestOption) (res *ImagesImageKeys, err error) {
+ opts = append(r.Options[:], opts...)
+ var env V1KeyListResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/images/v1/keys", query.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type ImagesImageKeys struct {
+ Keys []ImagesImageKeysKey `json:"keys"`
+ JSON imagesImageKeysJSON `json:"-"`
+}
+
+// imagesImageKeysJSON contains the JSON metadata for the struct [ImagesImageKeys]
+type imagesImageKeysJSON struct {
+ Keys apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ImagesImageKeys) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r imagesImageKeysJSON) RawJSON() string {
+ return r.raw
+}
+
+type ImagesImageKeysKey struct {
+ // Key name.
+ Name string `json:"name"`
+ // Key value.
+ Value string `json:"value"`
+ JSON imagesImageKeysKeyJSON `json:"-"`
+}
+
+// imagesImageKeysKeyJSON contains the JSON metadata for the struct
+// [ImagesImageKeysKey]
+type imagesImageKeysKeyJSON struct {
+ Name apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ImagesImageKeysKey) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r imagesImageKeysKeyJSON) RawJSON() string {
+ return r.raw
+}
+
+type V1KeyListParams struct {
+ // Account identifier tag.
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type V1KeyListResponseEnvelope struct {
+ Errors []V1KeyListResponseEnvelopeErrors `json:"errors,required"`
+ Messages []V1KeyListResponseEnvelopeMessages `json:"messages,required"`
+ Result ImagesImageKeys `json:"result,required"`
+ // Whether the API call was successful
+ Success V1KeyListResponseEnvelopeSuccess `json:"success,required"`
+ JSON v1KeyListResponseEnvelopeJSON `json:"-"`
+}
+
+// v1KeyListResponseEnvelopeJSON contains the JSON metadata for the struct
+// [V1KeyListResponseEnvelope]
+type v1KeyListResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V1KeyListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v1KeyListResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type V1KeyListResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON v1KeyListResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// v1KeyListResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [V1KeyListResponseEnvelopeErrors]
+type v1KeyListResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V1KeyListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v1KeyListResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type V1KeyListResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON v1KeyListResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// v1KeyListResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [V1KeyListResponseEnvelopeMessages]
+type v1KeyListResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V1KeyListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v1KeyListResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type V1KeyListResponseEnvelopeSuccess bool
+
+const (
+ V1KeyListResponseEnvelopeSuccessTrue V1KeyListResponseEnvelopeSuccess = true
+)
diff --git a/images/v1key_test.go b/images/v1key_test.go
new file mode 100644
index 00000000000..87a1dc55b6a
--- /dev/null
+++ b/images/v1key_test.go
@@ -0,0 +1,41 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package images_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/images"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestV1KeyList(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"),
+ )
+ _, err := client.Images.V1.Keys.List(context.TODO(), images.V1KeyListParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ })
+ 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/images/v1stat.go b/images/v1stat.go
new file mode 100644
index 00000000000..08d468af7d2
--- /dev/null
+++ b/images/v1stat.go
@@ -0,0 +1,176 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package images
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// V1StatService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewV1StatService] method instead.
+type V1StatService struct {
+ Options []option.RequestOption
+}
+
+// NewV1StatService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewV1StatService(opts ...option.RequestOption) (r *V1StatService) {
+ r = &V1StatService{}
+ r.Options = opts
+ return
+}
+
+// Fetch usage statistics details for Cloudflare Images.
+func (r *V1StatService) Get(ctx context.Context, query V1StatGetParams, opts ...option.RequestOption) (res *ImagesImagesStats, err error) {
+ opts = append(r.Options[:], opts...)
+ var env V1StatGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/images/v1/stats", query.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type ImagesImagesStats struct {
+ Count ImagesImagesStatsCount `json:"count"`
+ JSON imagesImagesStatsJSON `json:"-"`
+}
+
+// imagesImagesStatsJSON contains the JSON metadata for the struct
+// [ImagesImagesStats]
+type imagesImagesStatsJSON struct {
+ Count apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ImagesImagesStats) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r imagesImagesStatsJSON) RawJSON() string {
+ return r.raw
+}
+
+type ImagesImagesStatsCount struct {
+ // Cloudflare Images allowed usage.
+ Allowed float64 `json:"allowed"`
+ // Cloudflare Images current usage.
+ Current float64 `json:"current"`
+ JSON imagesImagesStatsCountJSON `json:"-"`
+}
+
+// imagesImagesStatsCountJSON contains the JSON metadata for the struct
+// [ImagesImagesStatsCount]
+type imagesImagesStatsCountJSON struct {
+ Allowed apijson.Field
+ Current apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ImagesImagesStatsCount) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r imagesImagesStatsCountJSON) RawJSON() string {
+ return r.raw
+}
+
+type V1StatGetParams struct {
+ // Account identifier tag.
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type V1StatGetResponseEnvelope struct {
+ Errors []V1StatGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []V1StatGetResponseEnvelopeMessages `json:"messages,required"`
+ Result ImagesImagesStats `json:"result,required"`
+ // Whether the API call was successful
+ Success V1StatGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON v1StatGetResponseEnvelopeJSON `json:"-"`
+}
+
+// v1StatGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [V1StatGetResponseEnvelope]
+type v1StatGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V1StatGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v1StatGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type V1StatGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON v1StatGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// v1StatGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [V1StatGetResponseEnvelopeErrors]
+type v1StatGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V1StatGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v1StatGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type V1StatGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON v1StatGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// v1StatGetResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [V1StatGetResponseEnvelopeMessages]
+type v1StatGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V1StatGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v1StatGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type V1StatGetResponseEnvelopeSuccess bool
+
+const (
+ V1StatGetResponseEnvelopeSuccessTrue V1StatGetResponseEnvelopeSuccess = true
+)
diff --git a/images/v1stat_test.go b/images/v1stat_test.go
new file mode 100644
index 00000000000..f2d9d24d372
--- /dev/null
+++ b/images/v1stat_test.go
@@ -0,0 +1,41 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package images_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/images"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestV1StatGet(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"),
+ )
+ _, err := client.Images.V1.Stats.Get(context.TODO(), images.V1StatGetParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ })
+ 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/images/v1variant.go b/images/v1variant.go
new file mode 100644
index 00000000000..3bed6bf84ba
--- /dev/null
+++ b/images/v1variant.go
@@ -0,0 +1,866 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package images
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "reflect"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/tidwall/gjson"
+)
+
+// V1VariantService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewV1VariantService] method instead.
+type V1VariantService struct {
+ Options []option.RequestOption
+}
+
+// NewV1VariantService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewV1VariantService(opts ...option.RequestOption) (r *V1VariantService) {
+ r = &V1VariantService{}
+ r.Options = opts
+ return
+}
+
+// Specify variants that allow you to resize images for different use cases.
+func (r *V1VariantService) New(ctx context.Context, params V1VariantNewParams, opts ...option.RequestOption) (res *ImageVariant, err error) {
+ opts = append(r.Options[:], opts...)
+ var env V1VariantNewResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/images/v1/variants", params.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Lists existing variants.
+func (r *V1VariantService) List(ctx context.Context, query V1VariantListParams, opts ...option.RequestOption) (res *ImageVariants, err error) {
+ opts = append(r.Options[:], opts...)
+ var env V1VariantListResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/images/v1/variants", query.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Deleting a variant purges the cache for all images associated with the variant.
+func (r *V1VariantService) Delete(ctx context.Context, variantID interface{}, body V1VariantDeleteParams, opts ...option.RequestOption) (res *V1VariantDeleteResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env V1VariantDeleteResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/images/v1/variants/%v", body.AccountID, variantID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Updating a variant purges the cache for all images associated with the variant.
+func (r *V1VariantService) Edit(ctx context.Context, variantID interface{}, params V1VariantEditParams, opts ...option.RequestOption) (res *ImageVariant, err error) {
+ opts = append(r.Options[:], opts...)
+ var env V1VariantEditResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/images/v1/variants/%v", params.AccountID, variantID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Fetch details for a single variant.
+func (r *V1VariantService) Get(ctx context.Context, variantID interface{}, query V1VariantGetParams, opts ...option.RequestOption) (res *ImageVariant, err error) {
+ opts = append(r.Options[:], opts...)
+ var env V1VariantGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/images/v1/variants/%v", query.AccountID, variantID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type ImageVariant struct {
+ Variant ImageVariantVariant `json:"variant"`
+ JSON imageVariantJSON `json:"-"`
+}
+
+// imageVariantJSON contains the JSON metadata for the struct [ImageVariant]
+type imageVariantJSON struct {
+ Variant apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ImageVariant) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r imageVariantJSON) RawJSON() string {
+ return r.raw
+}
+
+type ImageVariantVariant struct {
+ ID interface{} `json:"id,required"`
+ // Allows you to define image resizing sizes for different use cases.
+ Options ImageVariantVariantOptions `json:"options,required"`
+ // Indicates whether the variant can access an image without a signature,
+ // regardless of image access control.
+ NeverRequireSignedURLs bool `json:"neverRequireSignedURLs"`
+ JSON imageVariantVariantJSON `json:"-"`
+}
+
+// imageVariantVariantJSON contains the JSON metadata for the struct
+// [ImageVariantVariant]
+type imageVariantVariantJSON struct {
+ ID apijson.Field
+ Options apijson.Field
+ NeverRequireSignedURLs apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ImageVariantVariant) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r imageVariantVariantJSON) RawJSON() string {
+ return r.raw
+}
+
+// Allows you to define image resizing sizes for different use cases.
+type ImageVariantVariantOptions struct {
+ // The fit property describes how the width and height dimensions should be
+ // interpreted.
+ Fit ImageVariantVariantOptionsFit `json:"fit,required"`
+ // Maximum height in image pixels.
+ Height float64 `json:"height,required"`
+ // What EXIF data should be preserved in the output image.
+ Metadata ImageVariantVariantOptionsMetadata `json:"metadata,required"`
+ // Maximum width in image pixels.
+ Width float64 `json:"width,required"`
+ JSON imageVariantVariantOptionsJSON `json:"-"`
+}
+
+// imageVariantVariantOptionsJSON contains the JSON metadata for the struct
+// [ImageVariantVariantOptions]
+type imageVariantVariantOptionsJSON struct {
+ Fit apijson.Field
+ Height apijson.Field
+ Metadata apijson.Field
+ Width apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ImageVariantVariantOptions) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r imageVariantVariantOptionsJSON) RawJSON() string {
+ return r.raw
+}
+
+// The fit property describes how the width and height dimensions should be
+// interpreted.
+type ImageVariantVariantOptionsFit string
+
+const (
+ ImageVariantVariantOptionsFitScaleDown ImageVariantVariantOptionsFit = "scale-down"
+ ImageVariantVariantOptionsFitContain ImageVariantVariantOptionsFit = "contain"
+ ImageVariantVariantOptionsFitCover ImageVariantVariantOptionsFit = "cover"
+ ImageVariantVariantOptionsFitCrop ImageVariantVariantOptionsFit = "crop"
+ ImageVariantVariantOptionsFitPad ImageVariantVariantOptionsFit = "pad"
+)
+
+// What EXIF data should be preserved in the output image.
+type ImageVariantVariantOptionsMetadata string
+
+const (
+ ImageVariantVariantOptionsMetadataKeep ImageVariantVariantOptionsMetadata = "keep"
+ ImageVariantVariantOptionsMetadataCopyright ImageVariantVariantOptionsMetadata = "copyright"
+ ImageVariantVariantOptionsMetadataNone ImageVariantVariantOptionsMetadata = "none"
+)
+
+type ImageVariants struct {
+ Variants ImageVariantsVariants `json:"variants"`
+ JSON imageVariantsJSON `json:"-"`
+}
+
+// imageVariantsJSON contains the JSON metadata for the struct [ImageVariants]
+type imageVariantsJSON struct {
+ Variants apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ImageVariants) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r imageVariantsJSON) RawJSON() string {
+ return r.raw
+}
+
+type ImageVariantsVariants struct {
+ Hero ImageVariantsVariantsHero `json:"hero"`
+ JSON imageVariantsVariantsJSON `json:"-"`
+}
+
+// imageVariantsVariantsJSON contains the JSON metadata for the struct
+// [ImageVariantsVariants]
+type imageVariantsVariantsJSON struct {
+ Hero apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ImageVariantsVariants) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r imageVariantsVariantsJSON) RawJSON() string {
+ return r.raw
+}
+
+type ImageVariantsVariantsHero struct {
+ ID interface{} `json:"id,required"`
+ // Allows you to define image resizing sizes for different use cases.
+ Options ImageVariantsVariantsHeroOptions `json:"options,required"`
+ // Indicates whether the variant can access an image without a signature,
+ // regardless of image access control.
+ NeverRequireSignedURLs bool `json:"neverRequireSignedURLs"`
+ JSON imageVariantsVariantsHeroJSON `json:"-"`
+}
+
+// imageVariantsVariantsHeroJSON contains the JSON metadata for the struct
+// [ImageVariantsVariantsHero]
+type imageVariantsVariantsHeroJSON struct {
+ ID apijson.Field
+ Options apijson.Field
+ NeverRequireSignedURLs apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ImageVariantsVariantsHero) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r imageVariantsVariantsHeroJSON) RawJSON() string {
+ return r.raw
+}
+
+// Allows you to define image resizing sizes for different use cases.
+type ImageVariantsVariantsHeroOptions struct {
+ // The fit property describes how the width and height dimensions should be
+ // interpreted.
+ Fit ImageVariantsVariantsHeroOptionsFit `json:"fit,required"`
+ // Maximum height in image pixels.
+ Height float64 `json:"height,required"`
+ // What EXIF data should be preserved in the output image.
+ Metadata ImageVariantsVariantsHeroOptionsMetadata `json:"metadata,required"`
+ // Maximum width in image pixels.
+ Width float64 `json:"width,required"`
+ JSON imageVariantsVariantsHeroOptionsJSON `json:"-"`
+}
+
+// imageVariantsVariantsHeroOptionsJSON contains the JSON metadata for the struct
+// [ImageVariantsVariantsHeroOptions]
+type imageVariantsVariantsHeroOptionsJSON struct {
+ Fit apijson.Field
+ Height apijson.Field
+ Metadata apijson.Field
+ Width apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ImageVariantsVariantsHeroOptions) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r imageVariantsVariantsHeroOptionsJSON) RawJSON() string {
+ return r.raw
+}
+
+// The fit property describes how the width and height dimensions should be
+// interpreted.
+type ImageVariantsVariantsHeroOptionsFit string
+
+const (
+ ImageVariantsVariantsHeroOptionsFitScaleDown ImageVariantsVariantsHeroOptionsFit = "scale-down"
+ ImageVariantsVariantsHeroOptionsFitContain ImageVariantsVariantsHeroOptionsFit = "contain"
+ ImageVariantsVariantsHeroOptionsFitCover ImageVariantsVariantsHeroOptionsFit = "cover"
+ ImageVariantsVariantsHeroOptionsFitCrop ImageVariantsVariantsHeroOptionsFit = "crop"
+ ImageVariantsVariantsHeroOptionsFitPad ImageVariantsVariantsHeroOptionsFit = "pad"
+)
+
+// What EXIF data should be preserved in the output image.
+type ImageVariantsVariantsHeroOptionsMetadata string
+
+const (
+ ImageVariantsVariantsHeroOptionsMetadataKeep ImageVariantsVariantsHeroOptionsMetadata = "keep"
+ ImageVariantsVariantsHeroOptionsMetadataCopyright ImageVariantsVariantsHeroOptionsMetadata = "copyright"
+ ImageVariantsVariantsHeroOptionsMetadataNone ImageVariantsVariantsHeroOptionsMetadata = "none"
+)
+
+// Union satisfied by [images.V1VariantDeleteResponseUnknown] or
+// [shared.UnionString].
+type V1VariantDeleteResponse interface {
+ ImplementsImagesV1VariantDeleteResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*V1VariantDeleteResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+type V1VariantNewParams struct {
+ // Account identifier tag.
+ AccountID param.Field[string] `path:"account_id,required"`
+ ID param.Field[interface{}] `json:"id,required"`
+ // Allows you to define image resizing sizes for different use cases.
+ Options param.Field[V1VariantNewParamsOptions] `json:"options,required"`
+ // Indicates whether the variant can access an image without a signature,
+ // regardless of image access control.
+ NeverRequireSignedURLs param.Field[bool] `json:"neverRequireSignedURLs"`
+}
+
+func (r V1VariantNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Allows you to define image resizing sizes for different use cases.
+type V1VariantNewParamsOptions struct {
+ // The fit property describes how the width and height dimensions should be
+ // interpreted.
+ Fit param.Field[V1VariantNewParamsOptionsFit] `json:"fit,required"`
+ // Maximum height in image pixels.
+ Height param.Field[float64] `json:"height,required"`
+ // What EXIF data should be preserved in the output image.
+ Metadata param.Field[V1VariantNewParamsOptionsMetadata] `json:"metadata,required"`
+ // Maximum width in image pixels.
+ Width param.Field[float64] `json:"width,required"`
+}
+
+func (r V1VariantNewParamsOptions) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The fit property describes how the width and height dimensions should be
+// interpreted.
+type V1VariantNewParamsOptionsFit string
+
+const (
+ V1VariantNewParamsOptionsFitScaleDown V1VariantNewParamsOptionsFit = "scale-down"
+ V1VariantNewParamsOptionsFitContain V1VariantNewParamsOptionsFit = "contain"
+ V1VariantNewParamsOptionsFitCover V1VariantNewParamsOptionsFit = "cover"
+ V1VariantNewParamsOptionsFitCrop V1VariantNewParamsOptionsFit = "crop"
+ V1VariantNewParamsOptionsFitPad V1VariantNewParamsOptionsFit = "pad"
+)
+
+// What EXIF data should be preserved in the output image.
+type V1VariantNewParamsOptionsMetadata string
+
+const (
+ V1VariantNewParamsOptionsMetadataKeep V1VariantNewParamsOptionsMetadata = "keep"
+ V1VariantNewParamsOptionsMetadataCopyright V1VariantNewParamsOptionsMetadata = "copyright"
+ V1VariantNewParamsOptionsMetadataNone V1VariantNewParamsOptionsMetadata = "none"
+)
+
+type V1VariantNewResponseEnvelope struct {
+ Errors []V1VariantNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []V1VariantNewResponseEnvelopeMessages `json:"messages,required"`
+ Result ImageVariant `json:"result,required"`
+ // Whether the API call was successful
+ Success V1VariantNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON v1VariantNewResponseEnvelopeJSON `json:"-"`
+}
+
+// v1VariantNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [V1VariantNewResponseEnvelope]
+type v1VariantNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V1VariantNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v1VariantNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type V1VariantNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON v1VariantNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// v1VariantNewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [V1VariantNewResponseEnvelopeErrors]
+type v1VariantNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V1VariantNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v1VariantNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type V1VariantNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON v1VariantNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// v1VariantNewResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [V1VariantNewResponseEnvelopeMessages]
+type v1VariantNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V1VariantNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v1VariantNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type V1VariantNewResponseEnvelopeSuccess bool
+
+const (
+ V1VariantNewResponseEnvelopeSuccessTrue V1VariantNewResponseEnvelopeSuccess = true
+)
+
+type V1VariantListParams struct {
+ // Account identifier tag.
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type V1VariantListResponseEnvelope struct {
+ Errors []V1VariantListResponseEnvelopeErrors `json:"errors,required"`
+ Messages []V1VariantListResponseEnvelopeMessages `json:"messages,required"`
+ Result ImageVariants `json:"result,required"`
+ // Whether the API call was successful
+ Success V1VariantListResponseEnvelopeSuccess `json:"success,required"`
+ JSON v1VariantListResponseEnvelopeJSON `json:"-"`
+}
+
+// v1VariantListResponseEnvelopeJSON contains the JSON metadata for the struct
+// [V1VariantListResponseEnvelope]
+type v1VariantListResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V1VariantListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v1VariantListResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type V1VariantListResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON v1VariantListResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// v1VariantListResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [V1VariantListResponseEnvelopeErrors]
+type v1VariantListResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V1VariantListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v1VariantListResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type V1VariantListResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON v1VariantListResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// v1VariantListResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [V1VariantListResponseEnvelopeMessages]
+type v1VariantListResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V1VariantListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v1VariantListResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type V1VariantListResponseEnvelopeSuccess bool
+
+const (
+ V1VariantListResponseEnvelopeSuccessTrue V1VariantListResponseEnvelopeSuccess = true
+)
+
+type V1VariantDeleteParams struct {
+ // Account identifier tag.
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type V1VariantDeleteResponseEnvelope struct {
+ Errors []V1VariantDeleteResponseEnvelopeErrors `json:"errors,required"`
+ Messages []V1VariantDeleteResponseEnvelopeMessages `json:"messages,required"`
+ Result V1VariantDeleteResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success V1VariantDeleteResponseEnvelopeSuccess `json:"success,required"`
+ JSON v1VariantDeleteResponseEnvelopeJSON `json:"-"`
+}
+
+// v1VariantDeleteResponseEnvelopeJSON contains the JSON metadata for the struct
+// [V1VariantDeleteResponseEnvelope]
+type v1VariantDeleteResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V1VariantDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v1VariantDeleteResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type V1VariantDeleteResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON v1VariantDeleteResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// v1VariantDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [V1VariantDeleteResponseEnvelopeErrors]
+type v1VariantDeleteResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V1VariantDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v1VariantDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type V1VariantDeleteResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON v1VariantDeleteResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// v1VariantDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [V1VariantDeleteResponseEnvelopeMessages]
+type v1VariantDeleteResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V1VariantDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v1VariantDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type V1VariantDeleteResponseEnvelopeSuccess bool
+
+const (
+ V1VariantDeleteResponseEnvelopeSuccessTrue V1VariantDeleteResponseEnvelopeSuccess = true
+)
+
+type V1VariantEditParams struct {
+ // Account identifier tag.
+ AccountID param.Field[string] `path:"account_id,required"`
+ // Allows you to define image resizing sizes for different use cases.
+ Options param.Field[V1VariantEditParamsOptions] `json:"options,required"`
+ // Indicates whether the variant can access an image without a signature,
+ // regardless of image access control.
+ NeverRequireSignedURLs param.Field[bool] `json:"neverRequireSignedURLs"`
+}
+
+func (r V1VariantEditParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Allows you to define image resizing sizes for different use cases.
+type V1VariantEditParamsOptions struct {
+ // The fit property describes how the width and height dimensions should be
+ // interpreted.
+ Fit param.Field[V1VariantEditParamsOptionsFit] `json:"fit,required"`
+ // Maximum height in image pixels.
+ Height param.Field[float64] `json:"height,required"`
+ // What EXIF data should be preserved in the output image.
+ Metadata param.Field[V1VariantEditParamsOptionsMetadata] `json:"metadata,required"`
+ // Maximum width in image pixels.
+ Width param.Field[float64] `json:"width,required"`
+}
+
+func (r V1VariantEditParamsOptions) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The fit property describes how the width and height dimensions should be
+// interpreted.
+type V1VariantEditParamsOptionsFit string
+
+const (
+ V1VariantEditParamsOptionsFitScaleDown V1VariantEditParamsOptionsFit = "scale-down"
+ V1VariantEditParamsOptionsFitContain V1VariantEditParamsOptionsFit = "contain"
+ V1VariantEditParamsOptionsFitCover V1VariantEditParamsOptionsFit = "cover"
+ V1VariantEditParamsOptionsFitCrop V1VariantEditParamsOptionsFit = "crop"
+ V1VariantEditParamsOptionsFitPad V1VariantEditParamsOptionsFit = "pad"
+)
+
+// What EXIF data should be preserved in the output image.
+type V1VariantEditParamsOptionsMetadata string
+
+const (
+ V1VariantEditParamsOptionsMetadataKeep V1VariantEditParamsOptionsMetadata = "keep"
+ V1VariantEditParamsOptionsMetadataCopyright V1VariantEditParamsOptionsMetadata = "copyright"
+ V1VariantEditParamsOptionsMetadataNone V1VariantEditParamsOptionsMetadata = "none"
+)
+
+type V1VariantEditResponseEnvelope struct {
+ Errors []V1VariantEditResponseEnvelopeErrors `json:"errors,required"`
+ Messages []V1VariantEditResponseEnvelopeMessages `json:"messages,required"`
+ Result ImageVariant `json:"result,required"`
+ // Whether the API call was successful
+ Success V1VariantEditResponseEnvelopeSuccess `json:"success,required"`
+ JSON v1VariantEditResponseEnvelopeJSON `json:"-"`
+}
+
+// v1VariantEditResponseEnvelopeJSON contains the JSON metadata for the struct
+// [V1VariantEditResponseEnvelope]
+type v1VariantEditResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V1VariantEditResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v1VariantEditResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type V1VariantEditResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON v1VariantEditResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// v1VariantEditResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [V1VariantEditResponseEnvelopeErrors]
+type v1VariantEditResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V1VariantEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v1VariantEditResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type V1VariantEditResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON v1VariantEditResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// v1VariantEditResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [V1VariantEditResponseEnvelopeMessages]
+type v1VariantEditResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V1VariantEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v1VariantEditResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type V1VariantEditResponseEnvelopeSuccess bool
+
+const (
+ V1VariantEditResponseEnvelopeSuccessTrue V1VariantEditResponseEnvelopeSuccess = true
+)
+
+type V1VariantGetParams struct {
+ // Account identifier tag.
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type V1VariantGetResponseEnvelope struct {
+ Errors []V1VariantGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []V1VariantGetResponseEnvelopeMessages `json:"messages,required"`
+ Result ImageVariant `json:"result,required"`
+ // Whether the API call was successful
+ Success V1VariantGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON v1VariantGetResponseEnvelopeJSON `json:"-"`
+}
+
+// v1VariantGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [V1VariantGetResponseEnvelope]
+type v1VariantGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V1VariantGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v1VariantGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type V1VariantGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON v1VariantGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// v1VariantGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [V1VariantGetResponseEnvelopeErrors]
+type v1VariantGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V1VariantGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v1VariantGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type V1VariantGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON v1VariantGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// v1VariantGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [V1VariantGetResponseEnvelopeMessages]
+type v1VariantGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V1VariantGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v1VariantGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type V1VariantGetResponseEnvelopeSuccess bool
+
+const (
+ V1VariantGetResponseEnvelopeSuccessTrue V1VariantGetResponseEnvelopeSuccess = true
+)
diff --git a/images/v1variant_test.go b/images/v1variant_test.go
new file mode 100644
index 00000000000..b9fe0bebf28
--- /dev/null
+++ b/images/v1variant_test.go
@@ -0,0 +1,172 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package images_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/images"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestV1VariantNewWithOptionalParams(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"),
+ )
+ _, err := client.Images.V1.Variants.New(context.TODO(), images.V1VariantNewParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ ID: cloudflare.F[any]("hero"),
+ Options: cloudflare.F(images.V1VariantNewParamsOptions{
+ Fit: cloudflare.F(images.V1VariantNewParamsOptionsFitScaleDown),
+ Height: cloudflare.F(768.000000),
+ Metadata: cloudflare.F(images.V1VariantNewParamsOptionsMetadataNone),
+ Width: cloudflare.F(1366.000000),
+ }),
+ NeverRequireSignedURLs: cloudflare.F(true),
+ })
+ 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())
+ }
+}
+
+func TestV1VariantList(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"),
+ )
+ _, err := client.Images.V1.Variants.List(context.TODO(), images.V1VariantListParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ })
+ 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())
+ }
+}
+
+func TestV1VariantDelete(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"),
+ )
+ _, err := client.Images.V1.Variants.Delete(
+ context.TODO(),
+ "hero",
+ images.V1VariantDeleteParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestV1VariantEditWithOptionalParams(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"),
+ )
+ _, err := client.Images.V1.Variants.Edit(
+ context.TODO(),
+ "hero",
+ images.V1VariantEditParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Options: cloudflare.F(images.V1VariantEditParamsOptions{
+ Fit: cloudflare.F(images.V1VariantEditParamsOptionsFitScaleDown),
+ Height: cloudflare.F(768.000000),
+ Metadata: cloudflare.F(images.V1VariantEditParamsOptionsMetadataNone),
+ Width: cloudflare.F(1366.000000),
+ }),
+ NeverRequireSignedURLs: cloudflare.F(true),
+ },
+ )
+ 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())
+ }
+}
+
+func TestV1VariantGet(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"),
+ )
+ _, err := client.Images.V1.Variants.Get(
+ context.TODO(),
+ "hero",
+ images.V1VariantGetParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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/images/v2.go b/images/v2.go
new file mode 100644
index 00000000000..a773830f6f6
--- /dev/null
+++ b/images/v2.go
@@ -0,0 +1,182 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package images
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// V2Service contains methods and other services that help with interacting with
+// the cloudflare API. Note, unlike clients, this service does not read variables
+// from the environment automatically. You should not instantiate this service
+// directly, and instead use the [NewV2Service] method instead.
+type V2Service struct {
+ Options []option.RequestOption
+ DirectUploads *V2DirectUploadService
+}
+
+// NewV2Service generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewV2Service(opts ...option.RequestOption) (r *V2Service) {
+ r = &V2Service{}
+ r.Options = opts
+ r.DirectUploads = NewV2DirectUploadService(opts...)
+ return
+}
+
+// List up to 10000 images with one request. Use the optional parameters below to
+// get a specific range of images. Endpoint returns continuation_token if more
+// images are present.
+func (r *V2Service) List(ctx context.Context, params V2ListParams, opts ...option.RequestOption) (res *V2ListResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env V2ListResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/images/v2", params.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type V2ListResponse struct {
+ // Continuation token to fetch next page. Passed as a query param when requesting
+ // List V2 api endpoint.
+ ContinuationToken string `json:"continuation_token,nullable"`
+ Images []ImagesImage `json:"images"`
+ JSON v2ListResponseJSON `json:"-"`
+}
+
+// v2ListResponseJSON contains the JSON metadata for the struct [V2ListResponse]
+type v2ListResponseJSON struct {
+ ContinuationToken apijson.Field
+ Images apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V2ListResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v2ListResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type V2ListParams struct {
+ // Account identifier tag.
+ AccountID param.Field[string] `path:"account_id,required"`
+ // Continuation token for a next page. List images V2 returns continuation_token
+ ContinuationToken param.Field[string] `query:"continuation_token"`
+ // Number of items per page.
+ PerPage param.Field[float64] `query:"per_page"`
+ // Sorting order by upload time.
+ SortOrder param.Field[V2ListParamsSortOrder] `query:"sort_order"`
+}
+
+// URLQuery serializes [V2ListParams]'s query parameters as `url.Values`.
+func (r V2ListParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Sorting order by upload time.
+type V2ListParamsSortOrder string
+
+const (
+ V2ListParamsSortOrderAsc V2ListParamsSortOrder = "asc"
+ V2ListParamsSortOrderDesc V2ListParamsSortOrder = "desc"
+)
+
+type V2ListResponseEnvelope struct {
+ Errors []V2ListResponseEnvelopeErrors `json:"errors,required"`
+ Messages []V2ListResponseEnvelopeMessages `json:"messages,required"`
+ Result V2ListResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success V2ListResponseEnvelopeSuccess `json:"success,required"`
+ JSON v2ListResponseEnvelopeJSON `json:"-"`
+}
+
+// v2ListResponseEnvelopeJSON contains the JSON metadata for the struct
+// [V2ListResponseEnvelope]
+type v2ListResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V2ListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v2ListResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type V2ListResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON v2ListResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// v2ListResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [V2ListResponseEnvelopeErrors]
+type v2ListResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V2ListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v2ListResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type V2ListResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON v2ListResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// v2ListResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [V2ListResponseEnvelopeMessages]
+type v2ListResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V2ListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v2ListResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type V2ListResponseEnvelopeSuccess bool
+
+const (
+ V2ListResponseEnvelopeSuccessTrue V2ListResponseEnvelopeSuccess = true
+)
diff --git a/images/v2_test.go b/images/v2_test.go
new file mode 100644
index 00000000000..9f239da6334
--- /dev/null
+++ b/images/v2_test.go
@@ -0,0 +1,44 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package images_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/images"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestV2ListWithOptionalParams(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"),
+ )
+ _, err := client.Images.V2.List(context.TODO(), images.V2ListParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ ContinuationToken: cloudflare.F("string"),
+ PerPage: cloudflare.F(10.000000),
+ SortOrder: cloudflare.F(images.V2ListParamsSortOrderAsc),
+ })
+ 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/images/v2directupload.go b/images/v2directupload.go
new file mode 100644
index 00000000000..25dc4514cb2
--- /dev/null
+++ b/images/v2directupload.go
@@ -0,0 +1,176 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package images
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// V2DirectUploadService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewV2DirectUploadService] method
+// instead.
+type V2DirectUploadService struct {
+ Options []option.RequestOption
+}
+
+// NewV2DirectUploadService generates a new service that applies the given options
+// to each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewV2DirectUploadService(opts ...option.RequestOption) (r *V2DirectUploadService) {
+ r = &V2DirectUploadService{}
+ r.Options = opts
+ return
+}
+
+// Direct uploads allow users to upload images without API keys. A common use case
+// are web apps, client-side applications, or mobile devices where users upload
+// content directly to Cloudflare Images. This method creates a draft record for a
+// future image. It returns an upload URL and an image identifier. To verify if the
+// image itself has been uploaded, send an image details request
+// (accounts/:account_identifier/images/v1/:identifier), and check that the
+// `draft: true` property is not present.
+func (r *V2DirectUploadService) New(ctx context.Context, params V2DirectUploadNewParams, opts ...option.RequestOption) (res *V2DirectUploadNewResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env V2DirectUploadNewResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/images/v2/direct_upload", params.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type V2DirectUploadNewResponse struct {
+ // Image unique identifier.
+ ID string `json:"id"`
+ // The URL the unauthenticated upload can be performed to using a single HTTP POST
+ // (multipart/form-data) request.
+ UploadURL string `json:"uploadURL"`
+ JSON v2DirectUploadNewResponseJSON `json:"-"`
+}
+
+// v2DirectUploadNewResponseJSON contains the JSON metadata for the struct
+// [V2DirectUploadNewResponse]
+type v2DirectUploadNewResponseJSON struct {
+ ID apijson.Field
+ UploadURL apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V2DirectUploadNewResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v2DirectUploadNewResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type V2DirectUploadNewParams struct {
+ // Account identifier tag.
+ AccountID param.Field[string] `path:"account_id,required"`
+ // The date after which the upload will not be accepted. Minimum: Now + 2 minutes.
+ // Maximum: Now + 6 hours.
+ Expiry param.Field[time.Time] `json:"expiry" format:"date-time"`
+ // User modifiable key-value store. Can be used for keeping references to another
+ // system of record, for managing images.
+ Metadata param.Field[interface{}] `json:"metadata"`
+ // Indicates whether the image requires a signature token to be accessed.
+ RequireSignedURLs param.Field[bool] `json:"requireSignedURLs"`
+}
+
+func (r V2DirectUploadNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type V2DirectUploadNewResponseEnvelope struct {
+ Errors []V2DirectUploadNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []V2DirectUploadNewResponseEnvelopeMessages `json:"messages,required"`
+ Result V2DirectUploadNewResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success V2DirectUploadNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON v2DirectUploadNewResponseEnvelopeJSON `json:"-"`
+}
+
+// v2DirectUploadNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [V2DirectUploadNewResponseEnvelope]
+type v2DirectUploadNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V2DirectUploadNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v2DirectUploadNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type V2DirectUploadNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON v2DirectUploadNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// v2DirectUploadNewResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [V2DirectUploadNewResponseEnvelopeErrors]
+type v2DirectUploadNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V2DirectUploadNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v2DirectUploadNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type V2DirectUploadNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON v2DirectUploadNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// v2DirectUploadNewResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [V2DirectUploadNewResponseEnvelopeMessages]
+type v2DirectUploadNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *V2DirectUploadNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r v2DirectUploadNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type V2DirectUploadNewResponseEnvelopeSuccess bool
+
+const (
+ V2DirectUploadNewResponseEnvelopeSuccessTrue V2DirectUploadNewResponseEnvelopeSuccess = true
+)
diff --git a/images/v2directupload_test.go b/images/v2directupload_test.go
new file mode 100644
index 00000000000..db32a3d8408
--- /dev/null
+++ b/images/v2directupload_test.go
@@ -0,0 +1,45 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package images_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/images"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestV2DirectUploadNewWithOptionalParams(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"),
+ )
+ _, err := client.Images.V2.DirectUploads.New(context.TODO(), images.V2DirectUploadNewParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Expiry: cloudflare.F(time.Now()),
+ Metadata: cloudflare.F[any](map[string]interface{}{}),
+ RequireSignedURLs: cloudflare.F(true),
+ })
+ 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/imagev1.go b/imagev1.go
deleted file mode 100644
index a942f102762..00000000000
--- a/imagev1.go
+++ /dev/null
@@ -1,887 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
- "reflect"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/option"
- "github.com/tidwall/gjson"
-)
-
-// ImageV1Service contains methods and other services that help with interacting
-// with the cloudflare API. Note, unlike clients, this service does not read
-// variables from the environment automatically. You should not instantiate this
-// service directly, and instead use the [NewImageV1Service] method instead.
-type ImageV1Service struct {
- Options []option.RequestOption
- Keys *ImageV1KeyService
- Stats *ImageV1StatService
- Variants *ImageV1VariantService
- Blobs *ImageV1BlobService
-}
-
-// NewImageV1Service generates a new service that applies the given options to each
-// request. These options are applied after the parent client's options (if there
-// is one), and before any request-specific options.
-func NewImageV1Service(opts ...option.RequestOption) (r *ImageV1Service) {
- r = &ImageV1Service{}
- r.Options = opts
- r.Keys = NewImageV1KeyService(opts...)
- r.Stats = NewImageV1StatService(opts...)
- r.Variants = NewImageV1VariantService(opts...)
- r.Blobs = NewImageV1BlobService(opts...)
- return
-}
-
-// Upload an image with up to 10 Megabytes using a single HTTP POST
-// (multipart/form-data) request. An image can be uploaded by sending an image file
-// or passing an accessible to an API url.
-func (r *ImageV1Service) New(ctx context.Context, params ImageV1NewParams, opts ...option.RequestOption) (res *ImageV1NewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env ImageV1NewResponseEnvelope
- path := fmt.Sprintf("accounts/%s/images/v1", params.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// List up to 100 images with one request. Use the optional parameters below to get
-// a specific range of images.
-func (r *ImageV1Service) List(ctx context.Context, params ImageV1ListParams, opts ...option.RequestOption) (res *shared.V4PagePagination[ImageV1ListResponse], err error) {
- var raw *http.Response
- opts = append(r.Options, opts...)
- opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
- path := fmt.Sprintf("accounts/%s/images/v1", params.AccountID)
- cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, params, &res, opts...)
- if err != nil {
- return nil, err
- }
- err = cfg.Execute()
- if err != nil {
- return nil, err
- }
- res.SetPageConfig(cfg, raw)
- return res, nil
-}
-
-// List up to 100 images with one request. Use the optional parameters below to get
-// a specific range of images.
-func (r *ImageV1Service) ListAutoPaging(ctx context.Context, params ImageV1ListParams, opts ...option.RequestOption) *shared.V4PagePaginationAutoPager[ImageV1ListResponse] {
- return shared.NewV4PagePaginationAutoPager(r.List(ctx, params, opts...))
-}
-
-// Delete an image on Cloudflare Images. On success, all copies of the image are
-// deleted and purged from cache.
-func (r *ImageV1Service) Delete(ctx context.Context, imageID string, body ImageV1DeleteParams, opts ...option.RequestOption) (res *ImageV1DeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env ImageV1DeleteResponseEnvelope
- path := fmt.Sprintf("accounts/%s/images/v1/%s", body.AccountID, imageID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Update image access control. On access control change, all copies of the image
-// are purged from cache.
-func (r *ImageV1Service) Edit(ctx context.Context, imageID string, params ImageV1EditParams, opts ...option.RequestOption) (res *ImageV1EditResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env ImageV1EditResponseEnvelope
- path := fmt.Sprintf("accounts/%s/images/v1/%s", params.AccountID, imageID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Fetch details for a single image.
-func (r *ImageV1Service) Get(ctx context.Context, imageID string, query ImageV1GetParams, opts ...option.RequestOption) (res *ImageV1GetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env ImageV1GetResponseEnvelope
- path := fmt.Sprintf("accounts/%s/images/v1/%s", query.AccountID, imageID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type ImageV1NewResponse struct {
- // Image unique identifier.
- ID string `json:"id"`
- // Image file name.
- Filename string `json:"filename"`
- // User modifiable key-value store. Can be used for keeping references to another
- // system of record for managing images. Metadata must not exceed 1024 bytes.
- Meta interface{} `json:"meta"`
- // Indicates whether the image can be a accessed only using it's UID. If set to
- // true, a signed token needs to be generated with a signing key to view the image.
- RequireSignedURLs bool `json:"requireSignedURLs"`
- // When the media item was uploaded.
- Uploaded time.Time `json:"uploaded" format:"date-time"`
- // Object specifying available variants for an image.
- Variants []ImageV1NewResponseVariant `json:"variants" format:"uri"`
- JSON imageV1NewResponseJSON `json:"-"`
-}
-
-// imageV1NewResponseJSON contains the JSON metadata for the struct
-// [ImageV1NewResponse]
-type imageV1NewResponseJSON struct {
- ID apijson.Field
- Filename apijson.Field
- Meta apijson.Field
- RequireSignedURLs apijson.Field
- Uploaded apijson.Field
- Variants apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ImageV1NewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r imageV1NewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// URI to thumbnail variant for an image.
-//
-// Union satisfied by [shared.UnionString], [shared.UnionString] or
-// [shared.UnionString].
-type ImageV1NewResponseVariant interface {
- ImplementsImageV1NewResponseVariant()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*ImageV1NewResponseVariant)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-type ImageV1ListResponse struct {
- Errors []ImageV1ListResponseError `json:"errors,required"`
- Messages []ImageV1ListResponseMessage `json:"messages,required"`
- Result ImageV1ListResponseResult `json:"result,required"`
- // Whether the API call was successful
- Success ImageV1ListResponseSuccess `json:"success,required"`
- JSON imageV1ListResponseJSON `json:"-"`
-}
-
-// imageV1ListResponseJSON contains the JSON metadata for the struct
-// [ImageV1ListResponse]
-type imageV1ListResponseJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ImageV1ListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r imageV1ListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type ImageV1ListResponseError struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON imageV1ListResponseErrorJSON `json:"-"`
-}
-
-// imageV1ListResponseErrorJSON contains the JSON metadata for the struct
-// [ImageV1ListResponseError]
-type imageV1ListResponseErrorJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ImageV1ListResponseError) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r imageV1ListResponseErrorJSON) RawJSON() string {
- return r.raw
-}
-
-type ImageV1ListResponseMessage struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON imageV1ListResponseMessageJSON `json:"-"`
-}
-
-// imageV1ListResponseMessageJSON contains the JSON metadata for the struct
-// [ImageV1ListResponseMessage]
-type imageV1ListResponseMessageJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ImageV1ListResponseMessage) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r imageV1ListResponseMessageJSON) RawJSON() string {
- return r.raw
-}
-
-type ImageV1ListResponseResult struct {
- Images []ImageV1ListResponseResultImage `json:"images"`
- JSON imageV1ListResponseResultJSON `json:"-"`
-}
-
-// imageV1ListResponseResultJSON contains the JSON metadata for the struct
-// [ImageV1ListResponseResult]
-type imageV1ListResponseResultJSON struct {
- Images apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ImageV1ListResponseResult) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r imageV1ListResponseResultJSON) RawJSON() string {
- return r.raw
-}
-
-type ImageV1ListResponseResultImage struct {
- // Image unique identifier.
- ID string `json:"id"`
- // Image file name.
- Filename string `json:"filename"`
- // User modifiable key-value store. Can be used for keeping references to another
- // system of record for managing images. Metadata must not exceed 1024 bytes.
- Meta interface{} `json:"meta"`
- // Indicates whether the image can be a accessed only using it's UID. If set to
- // true, a signed token needs to be generated with a signing key to view the image.
- RequireSignedURLs bool `json:"requireSignedURLs"`
- // When the media item was uploaded.
- Uploaded time.Time `json:"uploaded" format:"date-time"`
- // Object specifying available variants for an image.
- Variants []ImageV1ListResponseResultImagesVariant `json:"variants" format:"uri"`
- JSON imageV1ListResponseResultImageJSON `json:"-"`
-}
-
-// imageV1ListResponseResultImageJSON contains the JSON metadata for the struct
-// [ImageV1ListResponseResultImage]
-type imageV1ListResponseResultImageJSON struct {
- ID apijson.Field
- Filename apijson.Field
- Meta apijson.Field
- RequireSignedURLs apijson.Field
- Uploaded apijson.Field
- Variants apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ImageV1ListResponseResultImage) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r imageV1ListResponseResultImageJSON) RawJSON() string {
- return r.raw
-}
-
-// URI to thumbnail variant for an image.
-//
-// Union satisfied by [shared.UnionString], [shared.UnionString] or
-// [shared.UnionString].
-type ImageV1ListResponseResultImagesVariant interface {
- ImplementsImageV1ListResponseResultImagesVariant()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*ImageV1ListResponseResultImagesVariant)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-// Whether the API call was successful
-type ImageV1ListResponseSuccess bool
-
-const (
- ImageV1ListResponseSuccessTrue ImageV1ListResponseSuccess = true
-)
-
-// Union satisfied by [ImageV1DeleteResponseUnknown] or [shared.UnionString].
-type ImageV1DeleteResponse interface {
- ImplementsImageV1DeleteResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*ImageV1DeleteResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-type ImageV1EditResponse struct {
- // Image unique identifier.
- ID string `json:"id"`
- // Image file name.
- Filename string `json:"filename"`
- // User modifiable key-value store. Can be used for keeping references to another
- // system of record for managing images. Metadata must not exceed 1024 bytes.
- Meta interface{} `json:"meta"`
- // Indicates whether the image can be a accessed only using it's UID. If set to
- // true, a signed token needs to be generated with a signing key to view the image.
- RequireSignedURLs bool `json:"requireSignedURLs"`
- // When the media item was uploaded.
- Uploaded time.Time `json:"uploaded" format:"date-time"`
- // Object specifying available variants for an image.
- Variants []ImageV1EditResponseVariant `json:"variants" format:"uri"`
- JSON imageV1EditResponseJSON `json:"-"`
-}
-
-// imageV1EditResponseJSON contains the JSON metadata for the struct
-// [ImageV1EditResponse]
-type imageV1EditResponseJSON struct {
- ID apijson.Field
- Filename apijson.Field
- Meta apijson.Field
- RequireSignedURLs apijson.Field
- Uploaded apijson.Field
- Variants apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ImageV1EditResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r imageV1EditResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// URI to thumbnail variant for an image.
-//
-// Union satisfied by [shared.UnionString], [shared.UnionString] or
-// [shared.UnionString].
-type ImageV1EditResponseVariant interface {
- ImplementsImageV1EditResponseVariant()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*ImageV1EditResponseVariant)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-type ImageV1GetResponse struct {
- // Image unique identifier.
- ID string `json:"id"`
- // Image file name.
- Filename string `json:"filename"`
- // User modifiable key-value store. Can be used for keeping references to another
- // system of record for managing images. Metadata must not exceed 1024 bytes.
- Meta interface{} `json:"meta"`
- // Indicates whether the image can be a accessed only using it's UID. If set to
- // true, a signed token needs to be generated with a signing key to view the image.
- RequireSignedURLs bool `json:"requireSignedURLs"`
- // When the media item was uploaded.
- Uploaded time.Time `json:"uploaded" format:"date-time"`
- // Object specifying available variants for an image.
- Variants []ImageV1GetResponseVariant `json:"variants" format:"uri"`
- JSON imageV1GetResponseJSON `json:"-"`
-}
-
-// imageV1GetResponseJSON contains the JSON metadata for the struct
-// [ImageV1GetResponse]
-type imageV1GetResponseJSON struct {
- ID apijson.Field
- Filename apijson.Field
- Meta apijson.Field
- RequireSignedURLs apijson.Field
- Uploaded apijson.Field
- Variants apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ImageV1GetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r imageV1GetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// URI to thumbnail variant for an image.
-//
-// Union satisfied by [shared.UnionString], [shared.UnionString] or
-// [shared.UnionString].
-type ImageV1GetResponseVariant interface {
- ImplementsImageV1GetResponseVariant()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*ImageV1GetResponseVariant)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-type ImageV1NewParams struct {
- // Account identifier tag.
- AccountID param.Field[string] `path:"account_id,required"`
- Metadata param.Field[interface{}] `json:"metadata"`
- // Indicates whether the image requires a signature token for the access.
- RequireSignedURLs param.Field[bool] `json:"requireSignedURLs"`
-}
-
-func (r ImageV1NewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type ImageV1NewResponseEnvelope struct {
- Errors []ImageV1NewResponseEnvelopeErrors `json:"errors,required"`
- Messages []ImageV1NewResponseEnvelopeMessages `json:"messages,required"`
- Result ImageV1NewResponse `json:"result,required"`
- // Whether the API call was successful
- Success ImageV1NewResponseEnvelopeSuccess `json:"success,required"`
- JSON imageV1NewResponseEnvelopeJSON `json:"-"`
-}
-
-// imageV1NewResponseEnvelopeJSON contains the JSON metadata for the struct
-// [ImageV1NewResponseEnvelope]
-type imageV1NewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ImageV1NewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r imageV1NewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type ImageV1NewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON imageV1NewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// imageV1NewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
-// [ImageV1NewResponseEnvelopeErrors]
-type imageV1NewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ImageV1NewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r imageV1NewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type ImageV1NewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON imageV1NewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// imageV1NewResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
-// [ImageV1NewResponseEnvelopeMessages]
-type imageV1NewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ImageV1NewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r imageV1NewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type ImageV1NewResponseEnvelopeSuccess bool
-
-const (
- ImageV1NewResponseEnvelopeSuccessTrue ImageV1NewResponseEnvelopeSuccess = true
-)
-
-type ImageV1ListParams struct {
- // Account identifier tag.
- AccountID param.Field[string] `path:"account_id,required"`
- // Page number of paginated results.
- Page param.Field[float64] `query:"page"`
- // Number of items per page.
- PerPage param.Field[float64] `query:"per_page"`
-}
-
-// URLQuery serializes [ImageV1ListParams]'s query parameters as `url.Values`.
-func (r ImageV1ListParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type ImageV1DeleteParams struct {
- // Account identifier tag.
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type ImageV1DeleteResponseEnvelope struct {
- Errors []ImageV1DeleteResponseEnvelopeErrors `json:"errors,required"`
- Messages []ImageV1DeleteResponseEnvelopeMessages `json:"messages,required"`
- Result ImageV1DeleteResponse `json:"result,required"`
- // Whether the API call was successful
- Success ImageV1DeleteResponseEnvelopeSuccess `json:"success,required"`
- JSON imageV1DeleteResponseEnvelopeJSON `json:"-"`
-}
-
-// imageV1DeleteResponseEnvelopeJSON contains the JSON metadata for the struct
-// [ImageV1DeleteResponseEnvelope]
-type imageV1DeleteResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ImageV1DeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r imageV1DeleteResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type ImageV1DeleteResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON imageV1DeleteResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// imageV1DeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [ImageV1DeleteResponseEnvelopeErrors]
-type imageV1DeleteResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ImageV1DeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r imageV1DeleteResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type ImageV1DeleteResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON imageV1DeleteResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// imageV1DeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [ImageV1DeleteResponseEnvelopeMessages]
-type imageV1DeleteResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ImageV1DeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r imageV1DeleteResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type ImageV1DeleteResponseEnvelopeSuccess bool
-
-const (
- ImageV1DeleteResponseEnvelopeSuccessTrue ImageV1DeleteResponseEnvelopeSuccess = true
-)
-
-type ImageV1EditParams struct {
- // Account identifier tag.
- AccountID param.Field[string] `path:"account_id,required"`
- // User modifiable key-value store. Can be used for keeping references to another
- // system of record for managing images. No change if not specified.
- Metadata param.Field[interface{}] `json:"metadata"`
- // Indicates whether the image can be accessed using only its UID. If set to
- // `true`, a signed token needs to be generated with a signing key to view the
- // image. Returns a new UID on a change. No change if not specified.
- RequireSignedURLs param.Field[bool] `json:"requireSignedURLs"`
-}
-
-func (r ImageV1EditParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type ImageV1EditResponseEnvelope struct {
- Errors []ImageV1EditResponseEnvelopeErrors `json:"errors,required"`
- Messages []ImageV1EditResponseEnvelopeMessages `json:"messages,required"`
- Result ImageV1EditResponse `json:"result,required"`
- // Whether the API call was successful
- Success ImageV1EditResponseEnvelopeSuccess `json:"success,required"`
- JSON imageV1EditResponseEnvelopeJSON `json:"-"`
-}
-
-// imageV1EditResponseEnvelopeJSON contains the JSON metadata for the struct
-// [ImageV1EditResponseEnvelope]
-type imageV1EditResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ImageV1EditResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r imageV1EditResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type ImageV1EditResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON imageV1EditResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// imageV1EditResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
-// [ImageV1EditResponseEnvelopeErrors]
-type imageV1EditResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ImageV1EditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r imageV1EditResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type ImageV1EditResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON imageV1EditResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// imageV1EditResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [ImageV1EditResponseEnvelopeMessages]
-type imageV1EditResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ImageV1EditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r imageV1EditResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type ImageV1EditResponseEnvelopeSuccess bool
-
-const (
- ImageV1EditResponseEnvelopeSuccessTrue ImageV1EditResponseEnvelopeSuccess = true
-)
-
-type ImageV1GetParams struct {
- // Account identifier tag.
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type ImageV1GetResponseEnvelope struct {
- Errors []ImageV1GetResponseEnvelopeErrors `json:"errors,required"`
- Messages []ImageV1GetResponseEnvelopeMessages `json:"messages,required"`
- Result ImageV1GetResponse `json:"result,required"`
- // Whether the API call was successful
- Success ImageV1GetResponseEnvelopeSuccess `json:"success,required"`
- JSON imageV1GetResponseEnvelopeJSON `json:"-"`
-}
-
-// imageV1GetResponseEnvelopeJSON contains the JSON metadata for the struct
-// [ImageV1GetResponseEnvelope]
-type imageV1GetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ImageV1GetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r imageV1GetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type ImageV1GetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON imageV1GetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// imageV1GetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
-// [ImageV1GetResponseEnvelopeErrors]
-type imageV1GetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ImageV1GetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r imageV1GetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type ImageV1GetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON imageV1GetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// imageV1GetResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
-// [ImageV1GetResponseEnvelopeMessages]
-type imageV1GetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ImageV1GetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r imageV1GetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type ImageV1GetResponseEnvelopeSuccess bool
-
-const (
- ImageV1GetResponseEnvelopeSuccessTrue ImageV1GetResponseEnvelopeSuccess = true
-)
diff --git a/imagev1_test.go b/imagev1_test.go
deleted file mode 100644
index c206daf719b..00000000000
--- a/imagev1_test.go
+++ /dev/null
@@ -1,162 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestImageV1NewWithOptionalParams(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"),
- )
- _, err := client.Images.V1.New(context.TODO(), cloudflare.ImageV1NewParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Metadata: cloudflare.F[any](map[string]interface{}{}),
- RequireSignedURLs: cloudflare.F(true),
- })
- 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())
- }
-}
-
-func TestImageV1ListWithOptionalParams(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"),
- )
- _, err := client.Images.V1.List(context.TODO(), cloudflare.ImageV1ListParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Page: cloudflare.F(1.000000),
- PerPage: cloudflare.F(10.000000),
- })
- 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())
- }
-}
-
-func TestImageV1Delete(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"),
- )
- _, err := client.Images.V1.Delete(
- context.TODO(),
- "string",
- cloudflare.ImageV1DeleteParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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())
- }
-}
-
-func TestImageV1EditWithOptionalParams(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"),
- )
- _, err := client.Images.V1.Edit(
- context.TODO(),
- "string",
- cloudflare.ImageV1EditParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Metadata: cloudflare.F[any](map[string]interface{}{}),
- RequireSignedURLs: cloudflare.F(true),
- },
- )
- 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())
- }
-}
-
-func TestImageV1Get(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"),
- )
- _, err := client.Images.V1.Get(
- context.TODO(),
- "string",
- cloudflare.ImageV1GetParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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/imagev1blob.go b/imagev1blob.go
deleted file mode 100644
index 7cf964b5162..00000000000
--- a/imagev1blob.go
+++ /dev/null
@@ -1,46 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
-
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// ImageV1BlobService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewImageV1BlobService] method
-// instead.
-type ImageV1BlobService struct {
- Options []option.RequestOption
-}
-
-// NewImageV1BlobService generates a new service that applies the given options to
-// each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewImageV1BlobService(opts ...option.RequestOption) (r *ImageV1BlobService) {
- r = &ImageV1BlobService{}
- r.Options = opts
- return
-}
-
-// Fetch base image. For most images this will be the originally uploaded file. For
-// larger images it can be a near-lossless version of the original.
-func (r *ImageV1BlobService) Get(ctx context.Context, imageID string, query ImageV1BlobGetParams, opts ...option.RequestOption) (res *http.Response, err error) {
- opts = append(r.Options[:], opts...)
- opts = append([]option.RequestOption{option.WithHeader("Accept", "image/*")}, opts...)
- path := fmt.Sprintf("accounts/%s/images/v1/%s/blob", query.AccountID, imageID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &res, opts...)
- return
-}
-
-type ImageV1BlobGetParams struct {
- // Account identifier tag.
- AccountID param.Field[string] `path:"account_id,required"`
-}
diff --git a/imagev1blob_test.go b/imagev1blob_test.go
deleted file mode 100644
index 3ae7dabbcfe..00000000000
--- a/imagev1blob_test.go
+++ /dev/null
@@ -1,58 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "bytes"
- "context"
- "errors"
- "io"
- "net/http"
- "net/http/httptest"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestImageV1BlobGet(t *testing.T) {
- t.Skip("skipped: tests are disabled for the time being")
- server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
- w.WriteHeader(200)
- w.Write([]byte("abc"))
- }))
- defer server.Close()
- baseURL := server.URL
- client := cloudflare.NewClient(
- option.WithBaseURL(baseURL),
- option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"),
- option.WithAPIEmail("user@example.com"),
- )
- resp, err := client.Images.V1.Blobs.Get(
- context.TODO(),
- "string",
- cloudflare.ImageV1BlobGetParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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())
- }
- defer resp.Body.Close()
-
- b, err := io.ReadAll(resp.Body)
- 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())
- }
- if !bytes.Equal(b, []byte("abc")) {
- t.Fatalf("return value not %s: %s", "abc", b)
- }
-}
diff --git a/imagev1key.go b/imagev1key.go
deleted file mode 100644
index 8c73486211f..00000000000
--- a/imagev1key.go
+++ /dev/null
@@ -1,176 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// ImageV1KeyService contains methods and other services that help with interacting
-// with the cloudflare API. Note, unlike clients, this service does not read
-// variables from the environment automatically. You should not instantiate this
-// service directly, and instead use the [NewImageV1KeyService] method instead.
-type ImageV1KeyService struct {
- Options []option.RequestOption
-}
-
-// NewImageV1KeyService generates a new service that applies the given options to
-// each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewImageV1KeyService(opts ...option.RequestOption) (r *ImageV1KeyService) {
- r = &ImageV1KeyService{}
- r.Options = opts
- return
-}
-
-// Lists your signing keys. These can be found on your Cloudflare Images dashboard.
-func (r *ImageV1KeyService) List(ctx context.Context, query ImageV1KeyListParams, opts ...option.RequestOption) (res *ImageV1KeyListResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env ImageV1KeyListResponseEnvelope
- path := fmt.Sprintf("accounts/%s/images/v1/keys", query.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type ImageV1KeyListResponse struct {
- Keys []ImageV1KeyListResponseKey `json:"keys"`
- JSON imageV1KeyListResponseJSON `json:"-"`
-}
-
-// imageV1KeyListResponseJSON contains the JSON metadata for the struct
-// [ImageV1KeyListResponse]
-type imageV1KeyListResponseJSON struct {
- Keys apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ImageV1KeyListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r imageV1KeyListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type ImageV1KeyListResponseKey struct {
- // Key name.
- Name string `json:"name"`
- // Key value.
- Value string `json:"value"`
- JSON imageV1KeyListResponseKeyJSON `json:"-"`
-}
-
-// imageV1KeyListResponseKeyJSON contains the JSON metadata for the struct
-// [ImageV1KeyListResponseKey]
-type imageV1KeyListResponseKeyJSON struct {
- Name apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ImageV1KeyListResponseKey) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r imageV1KeyListResponseKeyJSON) RawJSON() string {
- return r.raw
-}
-
-type ImageV1KeyListParams struct {
- // Account identifier tag.
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type ImageV1KeyListResponseEnvelope struct {
- Errors []ImageV1KeyListResponseEnvelopeErrors `json:"errors,required"`
- Messages []ImageV1KeyListResponseEnvelopeMessages `json:"messages,required"`
- Result ImageV1KeyListResponse `json:"result,required"`
- // Whether the API call was successful
- Success ImageV1KeyListResponseEnvelopeSuccess `json:"success,required"`
- JSON imageV1KeyListResponseEnvelopeJSON `json:"-"`
-}
-
-// imageV1KeyListResponseEnvelopeJSON contains the JSON metadata for the struct
-// [ImageV1KeyListResponseEnvelope]
-type imageV1KeyListResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ImageV1KeyListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r imageV1KeyListResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type ImageV1KeyListResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON imageV1KeyListResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// imageV1KeyListResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [ImageV1KeyListResponseEnvelopeErrors]
-type imageV1KeyListResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ImageV1KeyListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r imageV1KeyListResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type ImageV1KeyListResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON imageV1KeyListResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// imageV1KeyListResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [ImageV1KeyListResponseEnvelopeMessages]
-type imageV1KeyListResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ImageV1KeyListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r imageV1KeyListResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type ImageV1KeyListResponseEnvelopeSuccess bool
-
-const (
- ImageV1KeyListResponseEnvelopeSuccessTrue ImageV1KeyListResponseEnvelopeSuccess = true
-)
diff --git a/imagev1key_test.go b/imagev1key_test.go
deleted file mode 100644
index f9bbe1819d4..00000000000
--- a/imagev1key_test.go
+++ /dev/null
@@ -1,40 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestImageV1KeyList(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"),
- )
- _, err := client.Images.V1.Keys.List(context.TODO(), cloudflare.ImageV1KeyListParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- })
- 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/imagev1stat.go b/imagev1stat.go
deleted file mode 100644
index fb9c3a1cee5..00000000000
--- a/imagev1stat.go
+++ /dev/null
@@ -1,177 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// ImageV1StatService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewImageV1StatService] method
-// instead.
-type ImageV1StatService struct {
- Options []option.RequestOption
-}
-
-// NewImageV1StatService generates a new service that applies the given options to
-// each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewImageV1StatService(opts ...option.RequestOption) (r *ImageV1StatService) {
- r = &ImageV1StatService{}
- r.Options = opts
- return
-}
-
-// Fetch usage statistics details for Cloudflare Images.
-func (r *ImageV1StatService) Get(ctx context.Context, query ImageV1StatGetParams, opts ...option.RequestOption) (res *ImageV1StatGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env ImageV1StatGetResponseEnvelope
- path := fmt.Sprintf("accounts/%s/images/v1/stats", query.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type ImageV1StatGetResponse struct {
- Count ImageV1StatGetResponseCount `json:"count"`
- JSON imageV1StatGetResponseJSON `json:"-"`
-}
-
-// imageV1StatGetResponseJSON contains the JSON metadata for the struct
-// [ImageV1StatGetResponse]
-type imageV1StatGetResponseJSON struct {
- Count apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ImageV1StatGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r imageV1StatGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type ImageV1StatGetResponseCount struct {
- // Cloudflare Images allowed usage.
- Allowed float64 `json:"allowed"`
- // Cloudflare Images current usage.
- Current float64 `json:"current"`
- JSON imageV1StatGetResponseCountJSON `json:"-"`
-}
-
-// imageV1StatGetResponseCountJSON contains the JSON metadata for the struct
-// [ImageV1StatGetResponseCount]
-type imageV1StatGetResponseCountJSON struct {
- Allowed apijson.Field
- Current apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ImageV1StatGetResponseCount) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r imageV1StatGetResponseCountJSON) RawJSON() string {
- return r.raw
-}
-
-type ImageV1StatGetParams struct {
- // Account identifier tag.
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type ImageV1StatGetResponseEnvelope struct {
- Errors []ImageV1StatGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []ImageV1StatGetResponseEnvelopeMessages `json:"messages,required"`
- Result ImageV1StatGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success ImageV1StatGetResponseEnvelopeSuccess `json:"success,required"`
- JSON imageV1StatGetResponseEnvelopeJSON `json:"-"`
-}
-
-// imageV1StatGetResponseEnvelopeJSON contains the JSON metadata for the struct
-// [ImageV1StatGetResponseEnvelope]
-type imageV1StatGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ImageV1StatGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r imageV1StatGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type ImageV1StatGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON imageV1StatGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// imageV1StatGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [ImageV1StatGetResponseEnvelopeErrors]
-type imageV1StatGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ImageV1StatGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r imageV1StatGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type ImageV1StatGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON imageV1StatGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// imageV1StatGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [ImageV1StatGetResponseEnvelopeMessages]
-type imageV1StatGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ImageV1StatGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r imageV1StatGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type ImageV1StatGetResponseEnvelopeSuccess bool
-
-const (
- ImageV1StatGetResponseEnvelopeSuccessTrue ImageV1StatGetResponseEnvelopeSuccess = true
-)
diff --git a/imagev1stat_test.go b/imagev1stat_test.go
deleted file mode 100644
index 100e138a255..00000000000
--- a/imagev1stat_test.go
+++ /dev/null
@@ -1,40 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestImageV1StatGet(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"),
- )
- _, err := client.Images.V1.Stats.Get(context.TODO(), cloudflare.ImageV1StatGetParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- })
- 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/imagev1variant.go b/imagev1variant.go
deleted file mode 100644
index 1e998bccf9a..00000000000
--- a/imagev1variant.go
+++ /dev/null
@@ -1,1075 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "reflect"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/option"
- "github.com/tidwall/gjson"
-)
-
-// ImageV1VariantService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewImageV1VariantService] method
-// instead.
-type ImageV1VariantService struct {
- Options []option.RequestOption
-}
-
-// NewImageV1VariantService generates a new service that applies the given options
-// to each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewImageV1VariantService(opts ...option.RequestOption) (r *ImageV1VariantService) {
- r = &ImageV1VariantService{}
- r.Options = opts
- return
-}
-
-// Specify variants that allow you to resize images for different use cases.
-func (r *ImageV1VariantService) New(ctx context.Context, params ImageV1VariantNewParams, opts ...option.RequestOption) (res *ImageV1VariantNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env ImageV1VariantNewResponseEnvelope
- path := fmt.Sprintf("accounts/%s/images/v1/variants", params.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Lists existing variants.
-func (r *ImageV1VariantService) List(ctx context.Context, query ImageV1VariantListParams, opts ...option.RequestOption) (res *ImageV1VariantListResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env ImageV1VariantListResponseEnvelope
- path := fmt.Sprintf("accounts/%s/images/v1/variants", query.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Deleting a variant purges the cache for all images associated with the variant.
-func (r *ImageV1VariantService) Delete(ctx context.Context, variantID interface{}, body ImageV1VariantDeleteParams, opts ...option.RequestOption) (res *ImageV1VariantDeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env ImageV1VariantDeleteResponseEnvelope
- path := fmt.Sprintf("accounts/%s/images/v1/variants/%v", body.AccountID, variantID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Updating a variant purges the cache for all images associated with the variant.
-func (r *ImageV1VariantService) Edit(ctx context.Context, variantID interface{}, params ImageV1VariantEditParams, opts ...option.RequestOption) (res *ImageV1VariantEditResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env ImageV1VariantEditResponseEnvelope
- path := fmt.Sprintf("accounts/%s/images/v1/variants/%v", params.AccountID, variantID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Fetch details for a single variant.
-func (r *ImageV1VariantService) Get(ctx context.Context, variantID interface{}, query ImageV1VariantGetParams, opts ...option.RequestOption) (res *ImageV1VariantGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env ImageV1VariantGetResponseEnvelope
- path := fmt.Sprintf("accounts/%s/images/v1/variants/%v", query.AccountID, variantID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type ImageV1VariantNewResponse struct {
- Variant ImageV1VariantNewResponseVariant `json:"variant"`
- JSON imageV1VariantNewResponseJSON `json:"-"`
-}
-
-// imageV1VariantNewResponseJSON contains the JSON metadata for the struct
-// [ImageV1VariantNewResponse]
-type imageV1VariantNewResponseJSON struct {
- Variant apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ImageV1VariantNewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r imageV1VariantNewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type ImageV1VariantNewResponseVariant struct {
- ID interface{} `json:"id,required"`
- // Allows you to define image resizing sizes for different use cases.
- Options ImageV1VariantNewResponseVariantOptions `json:"options,required"`
- // Indicates whether the variant can access an image without a signature,
- // regardless of image access control.
- NeverRequireSignedURLs bool `json:"neverRequireSignedURLs"`
- JSON imageV1VariantNewResponseVariantJSON `json:"-"`
-}
-
-// imageV1VariantNewResponseVariantJSON contains the JSON metadata for the struct
-// [ImageV1VariantNewResponseVariant]
-type imageV1VariantNewResponseVariantJSON struct {
- ID apijson.Field
- Options apijson.Field
- NeverRequireSignedURLs apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ImageV1VariantNewResponseVariant) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r imageV1VariantNewResponseVariantJSON) RawJSON() string {
- return r.raw
-}
-
-// Allows you to define image resizing sizes for different use cases.
-type ImageV1VariantNewResponseVariantOptions struct {
- // The fit property describes how the width and height dimensions should be
- // interpreted.
- Fit ImageV1VariantNewResponseVariantOptionsFit `json:"fit,required"`
- // Maximum height in image pixels.
- Height float64 `json:"height,required"`
- // What EXIF data should be preserved in the output image.
- Metadata ImageV1VariantNewResponseVariantOptionsMetadata `json:"metadata,required"`
- // Maximum width in image pixels.
- Width float64 `json:"width,required"`
- JSON imageV1VariantNewResponseVariantOptionsJSON `json:"-"`
-}
-
-// imageV1VariantNewResponseVariantOptionsJSON contains the JSON metadata for the
-// struct [ImageV1VariantNewResponseVariantOptions]
-type imageV1VariantNewResponseVariantOptionsJSON struct {
- Fit apijson.Field
- Height apijson.Field
- Metadata apijson.Field
- Width apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ImageV1VariantNewResponseVariantOptions) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r imageV1VariantNewResponseVariantOptionsJSON) RawJSON() string {
- return r.raw
-}
-
-// The fit property describes how the width and height dimensions should be
-// interpreted.
-type ImageV1VariantNewResponseVariantOptionsFit string
-
-const (
- ImageV1VariantNewResponseVariantOptionsFitScaleDown ImageV1VariantNewResponseVariantOptionsFit = "scale-down"
- ImageV1VariantNewResponseVariantOptionsFitContain ImageV1VariantNewResponseVariantOptionsFit = "contain"
- ImageV1VariantNewResponseVariantOptionsFitCover ImageV1VariantNewResponseVariantOptionsFit = "cover"
- ImageV1VariantNewResponseVariantOptionsFitCrop ImageV1VariantNewResponseVariantOptionsFit = "crop"
- ImageV1VariantNewResponseVariantOptionsFitPad ImageV1VariantNewResponseVariantOptionsFit = "pad"
-)
-
-// What EXIF data should be preserved in the output image.
-type ImageV1VariantNewResponseVariantOptionsMetadata string
-
-const (
- ImageV1VariantNewResponseVariantOptionsMetadataKeep ImageV1VariantNewResponseVariantOptionsMetadata = "keep"
- ImageV1VariantNewResponseVariantOptionsMetadataCopyright ImageV1VariantNewResponseVariantOptionsMetadata = "copyright"
- ImageV1VariantNewResponseVariantOptionsMetadataNone ImageV1VariantNewResponseVariantOptionsMetadata = "none"
-)
-
-type ImageV1VariantListResponse struct {
- Variants ImageV1VariantListResponseVariants `json:"variants"`
- JSON imageV1VariantListResponseJSON `json:"-"`
-}
-
-// imageV1VariantListResponseJSON contains the JSON metadata for the struct
-// [ImageV1VariantListResponse]
-type imageV1VariantListResponseJSON struct {
- Variants apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ImageV1VariantListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r imageV1VariantListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type ImageV1VariantListResponseVariants struct {
- Hero ImageV1VariantListResponseVariantsHero `json:"hero"`
- JSON imageV1VariantListResponseVariantsJSON `json:"-"`
-}
-
-// imageV1VariantListResponseVariantsJSON contains the JSON metadata for the struct
-// [ImageV1VariantListResponseVariants]
-type imageV1VariantListResponseVariantsJSON struct {
- Hero apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ImageV1VariantListResponseVariants) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r imageV1VariantListResponseVariantsJSON) RawJSON() string {
- return r.raw
-}
-
-type ImageV1VariantListResponseVariantsHero struct {
- ID interface{} `json:"id,required"`
- // Allows you to define image resizing sizes for different use cases.
- Options ImageV1VariantListResponseVariantsHeroOptions `json:"options,required"`
- // Indicates whether the variant can access an image without a signature,
- // regardless of image access control.
- NeverRequireSignedURLs bool `json:"neverRequireSignedURLs"`
- JSON imageV1VariantListResponseVariantsHeroJSON `json:"-"`
-}
-
-// imageV1VariantListResponseVariantsHeroJSON contains the JSON metadata for the
-// struct [ImageV1VariantListResponseVariantsHero]
-type imageV1VariantListResponseVariantsHeroJSON struct {
- ID apijson.Field
- Options apijson.Field
- NeverRequireSignedURLs apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ImageV1VariantListResponseVariantsHero) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r imageV1VariantListResponseVariantsHeroJSON) RawJSON() string {
- return r.raw
-}
-
-// Allows you to define image resizing sizes for different use cases.
-type ImageV1VariantListResponseVariantsHeroOptions struct {
- // The fit property describes how the width and height dimensions should be
- // interpreted.
- Fit ImageV1VariantListResponseVariantsHeroOptionsFit `json:"fit,required"`
- // Maximum height in image pixels.
- Height float64 `json:"height,required"`
- // What EXIF data should be preserved in the output image.
- Metadata ImageV1VariantListResponseVariantsHeroOptionsMetadata `json:"metadata,required"`
- // Maximum width in image pixels.
- Width float64 `json:"width,required"`
- JSON imageV1VariantListResponseVariantsHeroOptionsJSON `json:"-"`
-}
-
-// imageV1VariantListResponseVariantsHeroOptionsJSON contains the JSON metadata for
-// the struct [ImageV1VariantListResponseVariantsHeroOptions]
-type imageV1VariantListResponseVariantsHeroOptionsJSON struct {
- Fit apijson.Field
- Height apijson.Field
- Metadata apijson.Field
- Width apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ImageV1VariantListResponseVariantsHeroOptions) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r imageV1VariantListResponseVariantsHeroOptionsJSON) RawJSON() string {
- return r.raw
-}
-
-// The fit property describes how the width and height dimensions should be
-// interpreted.
-type ImageV1VariantListResponseVariantsHeroOptionsFit string
-
-const (
- ImageV1VariantListResponseVariantsHeroOptionsFitScaleDown ImageV1VariantListResponseVariantsHeroOptionsFit = "scale-down"
- ImageV1VariantListResponseVariantsHeroOptionsFitContain ImageV1VariantListResponseVariantsHeroOptionsFit = "contain"
- ImageV1VariantListResponseVariantsHeroOptionsFitCover ImageV1VariantListResponseVariantsHeroOptionsFit = "cover"
- ImageV1VariantListResponseVariantsHeroOptionsFitCrop ImageV1VariantListResponseVariantsHeroOptionsFit = "crop"
- ImageV1VariantListResponseVariantsHeroOptionsFitPad ImageV1VariantListResponseVariantsHeroOptionsFit = "pad"
-)
-
-// What EXIF data should be preserved in the output image.
-type ImageV1VariantListResponseVariantsHeroOptionsMetadata string
-
-const (
- ImageV1VariantListResponseVariantsHeroOptionsMetadataKeep ImageV1VariantListResponseVariantsHeroOptionsMetadata = "keep"
- ImageV1VariantListResponseVariantsHeroOptionsMetadataCopyright ImageV1VariantListResponseVariantsHeroOptionsMetadata = "copyright"
- ImageV1VariantListResponseVariantsHeroOptionsMetadataNone ImageV1VariantListResponseVariantsHeroOptionsMetadata = "none"
-)
-
-// Union satisfied by [ImageV1VariantDeleteResponseUnknown] or
-// [shared.UnionString].
-type ImageV1VariantDeleteResponse interface {
- ImplementsImageV1VariantDeleteResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*ImageV1VariantDeleteResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-type ImageV1VariantEditResponse struct {
- Variant ImageV1VariantEditResponseVariant `json:"variant"`
- JSON imageV1VariantEditResponseJSON `json:"-"`
-}
-
-// imageV1VariantEditResponseJSON contains the JSON metadata for the struct
-// [ImageV1VariantEditResponse]
-type imageV1VariantEditResponseJSON struct {
- Variant apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ImageV1VariantEditResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r imageV1VariantEditResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type ImageV1VariantEditResponseVariant struct {
- ID interface{} `json:"id,required"`
- // Allows you to define image resizing sizes for different use cases.
- Options ImageV1VariantEditResponseVariantOptions `json:"options,required"`
- // Indicates whether the variant can access an image without a signature,
- // regardless of image access control.
- NeverRequireSignedURLs bool `json:"neverRequireSignedURLs"`
- JSON imageV1VariantEditResponseVariantJSON `json:"-"`
-}
-
-// imageV1VariantEditResponseVariantJSON contains the JSON metadata for the struct
-// [ImageV1VariantEditResponseVariant]
-type imageV1VariantEditResponseVariantJSON struct {
- ID apijson.Field
- Options apijson.Field
- NeverRequireSignedURLs apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ImageV1VariantEditResponseVariant) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r imageV1VariantEditResponseVariantJSON) RawJSON() string {
- return r.raw
-}
-
-// Allows you to define image resizing sizes for different use cases.
-type ImageV1VariantEditResponseVariantOptions struct {
- // The fit property describes how the width and height dimensions should be
- // interpreted.
- Fit ImageV1VariantEditResponseVariantOptionsFit `json:"fit,required"`
- // Maximum height in image pixels.
- Height float64 `json:"height,required"`
- // What EXIF data should be preserved in the output image.
- Metadata ImageV1VariantEditResponseVariantOptionsMetadata `json:"metadata,required"`
- // Maximum width in image pixels.
- Width float64 `json:"width,required"`
- JSON imageV1VariantEditResponseVariantOptionsJSON `json:"-"`
-}
-
-// imageV1VariantEditResponseVariantOptionsJSON contains the JSON metadata for the
-// struct [ImageV1VariantEditResponseVariantOptions]
-type imageV1VariantEditResponseVariantOptionsJSON struct {
- Fit apijson.Field
- Height apijson.Field
- Metadata apijson.Field
- Width apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ImageV1VariantEditResponseVariantOptions) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r imageV1VariantEditResponseVariantOptionsJSON) RawJSON() string {
- return r.raw
-}
-
-// The fit property describes how the width and height dimensions should be
-// interpreted.
-type ImageV1VariantEditResponseVariantOptionsFit string
-
-const (
- ImageV1VariantEditResponseVariantOptionsFitScaleDown ImageV1VariantEditResponseVariantOptionsFit = "scale-down"
- ImageV1VariantEditResponseVariantOptionsFitContain ImageV1VariantEditResponseVariantOptionsFit = "contain"
- ImageV1VariantEditResponseVariantOptionsFitCover ImageV1VariantEditResponseVariantOptionsFit = "cover"
- ImageV1VariantEditResponseVariantOptionsFitCrop ImageV1VariantEditResponseVariantOptionsFit = "crop"
- ImageV1VariantEditResponseVariantOptionsFitPad ImageV1VariantEditResponseVariantOptionsFit = "pad"
-)
-
-// What EXIF data should be preserved in the output image.
-type ImageV1VariantEditResponseVariantOptionsMetadata string
-
-const (
- ImageV1VariantEditResponseVariantOptionsMetadataKeep ImageV1VariantEditResponseVariantOptionsMetadata = "keep"
- ImageV1VariantEditResponseVariantOptionsMetadataCopyright ImageV1VariantEditResponseVariantOptionsMetadata = "copyright"
- ImageV1VariantEditResponseVariantOptionsMetadataNone ImageV1VariantEditResponseVariantOptionsMetadata = "none"
-)
-
-type ImageV1VariantGetResponse struct {
- Variant ImageV1VariantGetResponseVariant `json:"variant"`
- JSON imageV1VariantGetResponseJSON `json:"-"`
-}
-
-// imageV1VariantGetResponseJSON contains the JSON metadata for the struct
-// [ImageV1VariantGetResponse]
-type imageV1VariantGetResponseJSON struct {
- Variant apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ImageV1VariantGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r imageV1VariantGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type ImageV1VariantGetResponseVariant struct {
- ID interface{} `json:"id,required"`
- // Allows you to define image resizing sizes for different use cases.
- Options ImageV1VariantGetResponseVariantOptions `json:"options,required"`
- // Indicates whether the variant can access an image without a signature,
- // regardless of image access control.
- NeverRequireSignedURLs bool `json:"neverRequireSignedURLs"`
- JSON imageV1VariantGetResponseVariantJSON `json:"-"`
-}
-
-// imageV1VariantGetResponseVariantJSON contains the JSON metadata for the struct
-// [ImageV1VariantGetResponseVariant]
-type imageV1VariantGetResponseVariantJSON struct {
- ID apijson.Field
- Options apijson.Field
- NeverRequireSignedURLs apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ImageV1VariantGetResponseVariant) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r imageV1VariantGetResponseVariantJSON) RawJSON() string {
- return r.raw
-}
-
-// Allows you to define image resizing sizes for different use cases.
-type ImageV1VariantGetResponseVariantOptions struct {
- // The fit property describes how the width and height dimensions should be
- // interpreted.
- Fit ImageV1VariantGetResponseVariantOptionsFit `json:"fit,required"`
- // Maximum height in image pixels.
- Height float64 `json:"height,required"`
- // What EXIF data should be preserved in the output image.
- Metadata ImageV1VariantGetResponseVariantOptionsMetadata `json:"metadata,required"`
- // Maximum width in image pixels.
- Width float64 `json:"width,required"`
- JSON imageV1VariantGetResponseVariantOptionsJSON `json:"-"`
-}
-
-// imageV1VariantGetResponseVariantOptionsJSON contains the JSON metadata for the
-// struct [ImageV1VariantGetResponseVariantOptions]
-type imageV1VariantGetResponseVariantOptionsJSON struct {
- Fit apijson.Field
- Height apijson.Field
- Metadata apijson.Field
- Width apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ImageV1VariantGetResponseVariantOptions) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r imageV1VariantGetResponseVariantOptionsJSON) RawJSON() string {
- return r.raw
-}
-
-// The fit property describes how the width and height dimensions should be
-// interpreted.
-type ImageV1VariantGetResponseVariantOptionsFit string
-
-const (
- ImageV1VariantGetResponseVariantOptionsFitScaleDown ImageV1VariantGetResponseVariantOptionsFit = "scale-down"
- ImageV1VariantGetResponseVariantOptionsFitContain ImageV1VariantGetResponseVariantOptionsFit = "contain"
- ImageV1VariantGetResponseVariantOptionsFitCover ImageV1VariantGetResponseVariantOptionsFit = "cover"
- ImageV1VariantGetResponseVariantOptionsFitCrop ImageV1VariantGetResponseVariantOptionsFit = "crop"
- ImageV1VariantGetResponseVariantOptionsFitPad ImageV1VariantGetResponseVariantOptionsFit = "pad"
-)
-
-// What EXIF data should be preserved in the output image.
-type ImageV1VariantGetResponseVariantOptionsMetadata string
-
-const (
- ImageV1VariantGetResponseVariantOptionsMetadataKeep ImageV1VariantGetResponseVariantOptionsMetadata = "keep"
- ImageV1VariantGetResponseVariantOptionsMetadataCopyright ImageV1VariantGetResponseVariantOptionsMetadata = "copyright"
- ImageV1VariantGetResponseVariantOptionsMetadataNone ImageV1VariantGetResponseVariantOptionsMetadata = "none"
-)
-
-type ImageV1VariantNewParams struct {
- // Account identifier tag.
- AccountID param.Field[string] `path:"account_id,required"`
- ID param.Field[interface{}] `json:"id,required"`
- // Allows you to define image resizing sizes for different use cases.
- Options param.Field[ImageV1VariantNewParamsOptions] `json:"options,required"`
- // Indicates whether the variant can access an image without a signature,
- // regardless of image access control.
- NeverRequireSignedURLs param.Field[bool] `json:"neverRequireSignedURLs"`
-}
-
-func (r ImageV1VariantNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Allows you to define image resizing sizes for different use cases.
-type ImageV1VariantNewParamsOptions struct {
- // The fit property describes how the width and height dimensions should be
- // interpreted.
- Fit param.Field[ImageV1VariantNewParamsOptionsFit] `json:"fit,required"`
- // Maximum height in image pixels.
- Height param.Field[float64] `json:"height,required"`
- // What EXIF data should be preserved in the output image.
- Metadata param.Field[ImageV1VariantNewParamsOptionsMetadata] `json:"metadata,required"`
- // Maximum width in image pixels.
- Width param.Field[float64] `json:"width,required"`
-}
-
-func (r ImageV1VariantNewParamsOptions) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The fit property describes how the width and height dimensions should be
-// interpreted.
-type ImageV1VariantNewParamsOptionsFit string
-
-const (
- ImageV1VariantNewParamsOptionsFitScaleDown ImageV1VariantNewParamsOptionsFit = "scale-down"
- ImageV1VariantNewParamsOptionsFitContain ImageV1VariantNewParamsOptionsFit = "contain"
- ImageV1VariantNewParamsOptionsFitCover ImageV1VariantNewParamsOptionsFit = "cover"
- ImageV1VariantNewParamsOptionsFitCrop ImageV1VariantNewParamsOptionsFit = "crop"
- ImageV1VariantNewParamsOptionsFitPad ImageV1VariantNewParamsOptionsFit = "pad"
-)
-
-// What EXIF data should be preserved in the output image.
-type ImageV1VariantNewParamsOptionsMetadata string
-
-const (
- ImageV1VariantNewParamsOptionsMetadataKeep ImageV1VariantNewParamsOptionsMetadata = "keep"
- ImageV1VariantNewParamsOptionsMetadataCopyright ImageV1VariantNewParamsOptionsMetadata = "copyright"
- ImageV1VariantNewParamsOptionsMetadataNone ImageV1VariantNewParamsOptionsMetadata = "none"
-)
-
-type ImageV1VariantNewResponseEnvelope struct {
- Errors []ImageV1VariantNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []ImageV1VariantNewResponseEnvelopeMessages `json:"messages,required"`
- Result ImageV1VariantNewResponse `json:"result,required"`
- // Whether the API call was successful
- Success ImageV1VariantNewResponseEnvelopeSuccess `json:"success,required"`
- JSON imageV1VariantNewResponseEnvelopeJSON `json:"-"`
-}
-
-// imageV1VariantNewResponseEnvelopeJSON contains the JSON metadata for the struct
-// [ImageV1VariantNewResponseEnvelope]
-type imageV1VariantNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ImageV1VariantNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r imageV1VariantNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type ImageV1VariantNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON imageV1VariantNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// imageV1VariantNewResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [ImageV1VariantNewResponseEnvelopeErrors]
-type imageV1VariantNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ImageV1VariantNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r imageV1VariantNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type ImageV1VariantNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON imageV1VariantNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// imageV1VariantNewResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [ImageV1VariantNewResponseEnvelopeMessages]
-type imageV1VariantNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ImageV1VariantNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r imageV1VariantNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type ImageV1VariantNewResponseEnvelopeSuccess bool
-
-const (
- ImageV1VariantNewResponseEnvelopeSuccessTrue ImageV1VariantNewResponseEnvelopeSuccess = true
-)
-
-type ImageV1VariantListParams struct {
- // Account identifier tag.
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type ImageV1VariantListResponseEnvelope struct {
- Errors []ImageV1VariantListResponseEnvelopeErrors `json:"errors,required"`
- Messages []ImageV1VariantListResponseEnvelopeMessages `json:"messages,required"`
- Result ImageV1VariantListResponse `json:"result,required"`
- // Whether the API call was successful
- Success ImageV1VariantListResponseEnvelopeSuccess `json:"success,required"`
- JSON imageV1VariantListResponseEnvelopeJSON `json:"-"`
-}
-
-// imageV1VariantListResponseEnvelopeJSON contains the JSON metadata for the struct
-// [ImageV1VariantListResponseEnvelope]
-type imageV1VariantListResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ImageV1VariantListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r imageV1VariantListResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type ImageV1VariantListResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON imageV1VariantListResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// imageV1VariantListResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [ImageV1VariantListResponseEnvelopeErrors]
-type imageV1VariantListResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ImageV1VariantListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r imageV1VariantListResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type ImageV1VariantListResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON imageV1VariantListResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// imageV1VariantListResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [ImageV1VariantListResponseEnvelopeMessages]
-type imageV1VariantListResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ImageV1VariantListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r imageV1VariantListResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type ImageV1VariantListResponseEnvelopeSuccess bool
-
-const (
- ImageV1VariantListResponseEnvelopeSuccessTrue ImageV1VariantListResponseEnvelopeSuccess = true
-)
-
-type ImageV1VariantDeleteParams struct {
- // Account identifier tag.
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type ImageV1VariantDeleteResponseEnvelope struct {
- Errors []ImageV1VariantDeleteResponseEnvelopeErrors `json:"errors,required"`
- Messages []ImageV1VariantDeleteResponseEnvelopeMessages `json:"messages,required"`
- Result ImageV1VariantDeleteResponse `json:"result,required"`
- // Whether the API call was successful
- Success ImageV1VariantDeleteResponseEnvelopeSuccess `json:"success,required"`
- JSON imageV1VariantDeleteResponseEnvelopeJSON `json:"-"`
-}
-
-// imageV1VariantDeleteResponseEnvelopeJSON contains the JSON metadata for the
-// struct [ImageV1VariantDeleteResponseEnvelope]
-type imageV1VariantDeleteResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ImageV1VariantDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r imageV1VariantDeleteResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type ImageV1VariantDeleteResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON imageV1VariantDeleteResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// imageV1VariantDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [ImageV1VariantDeleteResponseEnvelopeErrors]
-type imageV1VariantDeleteResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ImageV1VariantDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r imageV1VariantDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type ImageV1VariantDeleteResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON imageV1VariantDeleteResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// imageV1VariantDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [ImageV1VariantDeleteResponseEnvelopeMessages]
-type imageV1VariantDeleteResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ImageV1VariantDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r imageV1VariantDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type ImageV1VariantDeleteResponseEnvelopeSuccess bool
-
-const (
- ImageV1VariantDeleteResponseEnvelopeSuccessTrue ImageV1VariantDeleteResponseEnvelopeSuccess = true
-)
-
-type ImageV1VariantEditParams struct {
- // Account identifier tag.
- AccountID param.Field[string] `path:"account_id,required"`
- // Allows you to define image resizing sizes for different use cases.
- Options param.Field[ImageV1VariantEditParamsOptions] `json:"options,required"`
- // Indicates whether the variant can access an image without a signature,
- // regardless of image access control.
- NeverRequireSignedURLs param.Field[bool] `json:"neverRequireSignedURLs"`
-}
-
-func (r ImageV1VariantEditParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Allows you to define image resizing sizes for different use cases.
-type ImageV1VariantEditParamsOptions struct {
- // The fit property describes how the width and height dimensions should be
- // interpreted.
- Fit param.Field[ImageV1VariantEditParamsOptionsFit] `json:"fit,required"`
- // Maximum height in image pixels.
- Height param.Field[float64] `json:"height,required"`
- // What EXIF data should be preserved in the output image.
- Metadata param.Field[ImageV1VariantEditParamsOptionsMetadata] `json:"metadata,required"`
- // Maximum width in image pixels.
- Width param.Field[float64] `json:"width,required"`
-}
-
-func (r ImageV1VariantEditParamsOptions) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The fit property describes how the width and height dimensions should be
-// interpreted.
-type ImageV1VariantEditParamsOptionsFit string
-
-const (
- ImageV1VariantEditParamsOptionsFitScaleDown ImageV1VariantEditParamsOptionsFit = "scale-down"
- ImageV1VariantEditParamsOptionsFitContain ImageV1VariantEditParamsOptionsFit = "contain"
- ImageV1VariantEditParamsOptionsFitCover ImageV1VariantEditParamsOptionsFit = "cover"
- ImageV1VariantEditParamsOptionsFitCrop ImageV1VariantEditParamsOptionsFit = "crop"
- ImageV1VariantEditParamsOptionsFitPad ImageV1VariantEditParamsOptionsFit = "pad"
-)
-
-// What EXIF data should be preserved in the output image.
-type ImageV1VariantEditParamsOptionsMetadata string
-
-const (
- ImageV1VariantEditParamsOptionsMetadataKeep ImageV1VariantEditParamsOptionsMetadata = "keep"
- ImageV1VariantEditParamsOptionsMetadataCopyright ImageV1VariantEditParamsOptionsMetadata = "copyright"
- ImageV1VariantEditParamsOptionsMetadataNone ImageV1VariantEditParamsOptionsMetadata = "none"
-)
-
-type ImageV1VariantEditResponseEnvelope struct {
- Errors []ImageV1VariantEditResponseEnvelopeErrors `json:"errors,required"`
- Messages []ImageV1VariantEditResponseEnvelopeMessages `json:"messages,required"`
- Result ImageV1VariantEditResponse `json:"result,required"`
- // Whether the API call was successful
- Success ImageV1VariantEditResponseEnvelopeSuccess `json:"success,required"`
- JSON imageV1VariantEditResponseEnvelopeJSON `json:"-"`
-}
-
-// imageV1VariantEditResponseEnvelopeJSON contains the JSON metadata for the struct
-// [ImageV1VariantEditResponseEnvelope]
-type imageV1VariantEditResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ImageV1VariantEditResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r imageV1VariantEditResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type ImageV1VariantEditResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON imageV1VariantEditResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// imageV1VariantEditResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [ImageV1VariantEditResponseEnvelopeErrors]
-type imageV1VariantEditResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ImageV1VariantEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r imageV1VariantEditResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type ImageV1VariantEditResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON imageV1VariantEditResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// imageV1VariantEditResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [ImageV1VariantEditResponseEnvelopeMessages]
-type imageV1VariantEditResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ImageV1VariantEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r imageV1VariantEditResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type ImageV1VariantEditResponseEnvelopeSuccess bool
-
-const (
- ImageV1VariantEditResponseEnvelopeSuccessTrue ImageV1VariantEditResponseEnvelopeSuccess = true
-)
-
-type ImageV1VariantGetParams struct {
- // Account identifier tag.
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type ImageV1VariantGetResponseEnvelope struct {
- Errors []ImageV1VariantGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []ImageV1VariantGetResponseEnvelopeMessages `json:"messages,required"`
- Result ImageV1VariantGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success ImageV1VariantGetResponseEnvelopeSuccess `json:"success,required"`
- JSON imageV1VariantGetResponseEnvelopeJSON `json:"-"`
-}
-
-// imageV1VariantGetResponseEnvelopeJSON contains the JSON metadata for the struct
-// [ImageV1VariantGetResponseEnvelope]
-type imageV1VariantGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ImageV1VariantGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r imageV1VariantGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type ImageV1VariantGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON imageV1VariantGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// imageV1VariantGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [ImageV1VariantGetResponseEnvelopeErrors]
-type imageV1VariantGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ImageV1VariantGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r imageV1VariantGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type ImageV1VariantGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON imageV1VariantGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// imageV1VariantGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [ImageV1VariantGetResponseEnvelopeMessages]
-type imageV1VariantGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ImageV1VariantGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r imageV1VariantGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type ImageV1VariantGetResponseEnvelopeSuccess bool
-
-const (
- ImageV1VariantGetResponseEnvelopeSuccessTrue ImageV1VariantGetResponseEnvelopeSuccess = true
-)
diff --git a/imagev1variant_test.go b/imagev1variant_test.go
deleted file mode 100644
index 14ad686e1ab..00000000000
--- a/imagev1variant_test.go
+++ /dev/null
@@ -1,171 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestImageV1VariantNewWithOptionalParams(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"),
- )
- _, err := client.Images.V1.Variants.New(context.TODO(), cloudflare.ImageV1VariantNewParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- ID: cloudflare.F[any]("hero"),
- Options: cloudflare.F(cloudflare.ImageV1VariantNewParamsOptions{
- Fit: cloudflare.F(cloudflare.ImageV1VariantNewParamsOptionsFitScaleDown),
- Height: cloudflare.F(768.000000),
- Metadata: cloudflare.F(cloudflare.ImageV1VariantNewParamsOptionsMetadataNone),
- Width: cloudflare.F(1366.000000),
- }),
- NeverRequireSignedURLs: cloudflare.F(true),
- })
- 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())
- }
-}
-
-func TestImageV1VariantList(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"),
- )
- _, err := client.Images.V1.Variants.List(context.TODO(), cloudflare.ImageV1VariantListParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- })
- 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())
- }
-}
-
-func TestImageV1VariantDelete(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"),
- )
- _, err := client.Images.V1.Variants.Delete(
- context.TODO(),
- "hero",
- cloudflare.ImageV1VariantDeleteParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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())
- }
-}
-
-func TestImageV1VariantEditWithOptionalParams(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"),
- )
- _, err := client.Images.V1.Variants.Edit(
- context.TODO(),
- "hero",
- cloudflare.ImageV1VariantEditParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Options: cloudflare.F(cloudflare.ImageV1VariantEditParamsOptions{
- Fit: cloudflare.F(cloudflare.ImageV1VariantEditParamsOptionsFitScaleDown),
- Height: cloudflare.F(768.000000),
- Metadata: cloudflare.F(cloudflare.ImageV1VariantEditParamsOptionsMetadataNone),
- Width: cloudflare.F(1366.000000),
- }),
- NeverRequireSignedURLs: cloudflare.F(true),
- },
- )
- 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())
- }
-}
-
-func TestImageV1VariantGet(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"),
- )
- _, err := client.Images.V1.Variants.Get(
- context.TODO(),
- "hero",
- cloudflare.ImageV1VariantGetParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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/imagev2.go b/imagev2.go
deleted file mode 100644
index 784b9d4960a..00000000000
--- a/imagev2.go
+++ /dev/null
@@ -1,253 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
- "reflect"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/option"
- "github.com/tidwall/gjson"
-)
-
-// ImageV2Service contains methods and other services that help with interacting
-// with the cloudflare API. Note, unlike clients, this service does not read
-// variables from the environment automatically. You should not instantiate this
-// service directly, and instead use the [NewImageV2Service] method instead.
-type ImageV2Service struct {
- Options []option.RequestOption
- DirectUploads *ImageV2DirectUploadService
-}
-
-// NewImageV2Service generates a new service that applies the given options to each
-// request. These options are applied after the parent client's options (if there
-// is one), and before any request-specific options.
-func NewImageV2Service(opts ...option.RequestOption) (r *ImageV2Service) {
- r = &ImageV2Service{}
- r.Options = opts
- r.DirectUploads = NewImageV2DirectUploadService(opts...)
- return
-}
-
-// List up to 10000 images with one request. Use the optional parameters below to
-// get a specific range of images. Endpoint returns continuation_token if more
-// images are present.
-func (r *ImageV2Service) List(ctx context.Context, params ImageV2ListParams, opts ...option.RequestOption) (res *ImageV2ListResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env ImageV2ListResponseEnvelope
- path := fmt.Sprintf("accounts/%s/images/v2", params.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type ImageV2ListResponse struct {
- // Continuation token to fetch next page. Passed as a query param when requesting
- // List V2 api endpoint.
- ContinuationToken string `json:"continuation_token,nullable"`
- Images []ImageV2ListResponseImage `json:"images"`
- JSON imageV2ListResponseJSON `json:"-"`
-}
-
-// imageV2ListResponseJSON contains the JSON metadata for the struct
-// [ImageV2ListResponse]
-type imageV2ListResponseJSON struct {
- ContinuationToken apijson.Field
- Images apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ImageV2ListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r imageV2ListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type ImageV2ListResponseImage struct {
- // Image unique identifier.
- ID string `json:"id"`
- // Image file name.
- Filename string `json:"filename"`
- // User modifiable key-value store. Can be used for keeping references to another
- // system of record for managing images. Metadata must not exceed 1024 bytes.
- Meta interface{} `json:"meta"`
- // Indicates whether the image can be a accessed only using it's UID. If set to
- // true, a signed token needs to be generated with a signing key to view the image.
- RequireSignedURLs bool `json:"requireSignedURLs"`
- // When the media item was uploaded.
- Uploaded time.Time `json:"uploaded" format:"date-time"`
- // Object specifying available variants for an image.
- Variants []ImageV2ListResponseImagesVariant `json:"variants" format:"uri"`
- JSON imageV2ListResponseImageJSON `json:"-"`
-}
-
-// imageV2ListResponseImageJSON contains the JSON metadata for the struct
-// [ImageV2ListResponseImage]
-type imageV2ListResponseImageJSON struct {
- ID apijson.Field
- Filename apijson.Field
- Meta apijson.Field
- RequireSignedURLs apijson.Field
- Uploaded apijson.Field
- Variants apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ImageV2ListResponseImage) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r imageV2ListResponseImageJSON) RawJSON() string {
- return r.raw
-}
-
-// URI to thumbnail variant for an image.
-//
-// Union satisfied by [shared.UnionString], [shared.UnionString] or
-// [shared.UnionString].
-type ImageV2ListResponseImagesVariant interface {
- ImplementsImageV2ListResponseImagesVariant()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*ImageV2ListResponseImagesVariant)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-type ImageV2ListParams struct {
- // Account identifier tag.
- AccountID param.Field[string] `path:"account_id,required"`
- // Continuation token for a next page. List images V2 returns continuation_token
- ContinuationToken param.Field[string] `query:"continuation_token"`
- // Number of items per page.
- PerPage param.Field[float64] `query:"per_page"`
- // Sorting order by upload time.
- SortOrder param.Field[ImageV2ListParamsSortOrder] `query:"sort_order"`
-}
-
-// URLQuery serializes [ImageV2ListParams]'s query parameters as `url.Values`.
-func (r ImageV2ListParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Sorting order by upload time.
-type ImageV2ListParamsSortOrder string
-
-const (
- ImageV2ListParamsSortOrderAsc ImageV2ListParamsSortOrder = "asc"
- ImageV2ListParamsSortOrderDesc ImageV2ListParamsSortOrder = "desc"
-)
-
-type ImageV2ListResponseEnvelope struct {
- Errors []ImageV2ListResponseEnvelopeErrors `json:"errors,required"`
- Messages []ImageV2ListResponseEnvelopeMessages `json:"messages,required"`
- Result ImageV2ListResponse `json:"result,required"`
- // Whether the API call was successful
- Success ImageV2ListResponseEnvelopeSuccess `json:"success,required"`
- JSON imageV2ListResponseEnvelopeJSON `json:"-"`
-}
-
-// imageV2ListResponseEnvelopeJSON contains the JSON metadata for the struct
-// [ImageV2ListResponseEnvelope]
-type imageV2ListResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ImageV2ListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r imageV2ListResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type ImageV2ListResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON imageV2ListResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// imageV2ListResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
-// [ImageV2ListResponseEnvelopeErrors]
-type imageV2ListResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ImageV2ListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r imageV2ListResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type ImageV2ListResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON imageV2ListResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// imageV2ListResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [ImageV2ListResponseEnvelopeMessages]
-type imageV2ListResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ImageV2ListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r imageV2ListResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type ImageV2ListResponseEnvelopeSuccess bool
-
-const (
- ImageV2ListResponseEnvelopeSuccessTrue ImageV2ListResponseEnvelopeSuccess = true
-)
diff --git a/imagev2_test.go b/imagev2_test.go
deleted file mode 100644
index 2882b56d907..00000000000
--- a/imagev2_test.go
+++ /dev/null
@@ -1,43 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestImageV2ListWithOptionalParams(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"),
- )
- _, err := client.Images.V2.List(context.TODO(), cloudflare.ImageV2ListParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- ContinuationToken: cloudflare.F("string"),
- PerPage: cloudflare.F(10.000000),
- SortOrder: cloudflare.F(cloudflare.ImageV2ListParamsSortOrderAsc),
- })
- 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/imagev2directupload.go b/imagev2directupload.go
deleted file mode 100644
index a9811d897e6..00000000000
--- a/imagev2directupload.go
+++ /dev/null
@@ -1,176 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// ImageV2DirectUploadService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewImageV2DirectUploadService]
-// method instead.
-type ImageV2DirectUploadService struct {
- Options []option.RequestOption
-}
-
-// NewImageV2DirectUploadService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewImageV2DirectUploadService(opts ...option.RequestOption) (r *ImageV2DirectUploadService) {
- r = &ImageV2DirectUploadService{}
- r.Options = opts
- return
-}
-
-// Direct uploads allow users to upload images without API keys. A common use case
-// are web apps, client-side applications, or mobile devices where users upload
-// content directly to Cloudflare Images. This method creates a draft record for a
-// future image. It returns an upload URL and an image identifier. To verify if the
-// image itself has been uploaded, send an image details request
-// (accounts/:account_identifier/images/v1/:identifier), and check that the
-// `draft: true` property is not present.
-func (r *ImageV2DirectUploadService) New(ctx context.Context, params ImageV2DirectUploadNewParams, opts ...option.RequestOption) (res *ImageV2DirectUploadNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env ImageV2DirectUploadNewResponseEnvelope
- path := fmt.Sprintf("accounts/%s/images/v2/direct_upload", params.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type ImageV2DirectUploadNewResponse struct {
- // Image unique identifier.
- ID string `json:"id"`
- // The URL the unauthenticated upload can be performed to using a single HTTP POST
- // (multipart/form-data) request.
- UploadURL string `json:"uploadURL"`
- JSON imageV2DirectUploadNewResponseJSON `json:"-"`
-}
-
-// imageV2DirectUploadNewResponseJSON contains the JSON metadata for the struct
-// [ImageV2DirectUploadNewResponse]
-type imageV2DirectUploadNewResponseJSON struct {
- ID apijson.Field
- UploadURL apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ImageV2DirectUploadNewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r imageV2DirectUploadNewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type ImageV2DirectUploadNewParams struct {
- // Account identifier tag.
- AccountID param.Field[string] `path:"account_id,required"`
- // The date after which the upload will not be accepted. Minimum: Now + 2 minutes.
- // Maximum: Now + 6 hours.
- Expiry param.Field[time.Time] `json:"expiry" format:"date-time"`
- // User modifiable key-value store. Can be used for keeping references to another
- // system of record, for managing images.
- Metadata param.Field[interface{}] `json:"metadata"`
- // Indicates whether the image requires a signature token to be accessed.
- RequireSignedURLs param.Field[bool] `json:"requireSignedURLs"`
-}
-
-func (r ImageV2DirectUploadNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type ImageV2DirectUploadNewResponseEnvelope struct {
- Errors []ImageV2DirectUploadNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []ImageV2DirectUploadNewResponseEnvelopeMessages `json:"messages,required"`
- Result ImageV2DirectUploadNewResponse `json:"result,required"`
- // Whether the API call was successful
- Success ImageV2DirectUploadNewResponseEnvelopeSuccess `json:"success,required"`
- JSON imageV2DirectUploadNewResponseEnvelopeJSON `json:"-"`
-}
-
-// imageV2DirectUploadNewResponseEnvelopeJSON contains the JSON metadata for the
-// struct [ImageV2DirectUploadNewResponseEnvelope]
-type imageV2DirectUploadNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ImageV2DirectUploadNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r imageV2DirectUploadNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type ImageV2DirectUploadNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON imageV2DirectUploadNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// imageV2DirectUploadNewResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [ImageV2DirectUploadNewResponseEnvelopeErrors]
-type imageV2DirectUploadNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ImageV2DirectUploadNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r imageV2DirectUploadNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type ImageV2DirectUploadNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON imageV2DirectUploadNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// imageV2DirectUploadNewResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [ImageV2DirectUploadNewResponseEnvelopeMessages]
-type imageV2DirectUploadNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *ImageV2DirectUploadNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r imageV2DirectUploadNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type ImageV2DirectUploadNewResponseEnvelopeSuccess bool
-
-const (
- ImageV2DirectUploadNewResponseEnvelopeSuccessTrue ImageV2DirectUploadNewResponseEnvelopeSuccess = true
-)
diff --git a/imagev2directupload_test.go b/imagev2directupload_test.go
deleted file mode 100644
index d6f436aaf0e..00000000000
--- a/imagev2directupload_test.go
+++ /dev/null
@@ -1,44 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
- "time"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestImageV2DirectUploadNewWithOptionalParams(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"),
- )
- _, err := client.Images.V2.DirectUploads.New(context.TODO(), cloudflare.ImageV2DirectUploadNewParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Expiry: cloudflare.F(time.Now()),
- Metadata: cloudflare.F[any](map[string]interface{}{}),
- RequireSignedURLs: cloudflare.F(true),
- })
- 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/intel.go b/intel.go
deleted file mode 100644
index 3de1f057bf3..00000000000
--- a/intel.go
+++ /dev/null
@@ -1,44 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// IntelService contains methods and other services that help with interacting with
-// the cloudflare API. Note, unlike clients, this service does not read variables
-// from the environment automatically. You should not instantiate this service
-// directly, and instead use the [NewIntelService] method instead.
-type IntelService struct {
- Options []option.RequestOption
- ASN *IntelASNService
- DNS *IntelDNSService
- Domains *IntelDomainService
- DomainHistory *IntelDomainHistoryService
- IPs *IntelIPService
- IPLists *IntelIPListService
- Miscategorizations *IntelMiscategorizationService
- Whois *IntelWhoisService
- IndicatorFeeds *IntelIndicatorFeedService
- Sinkholes *IntelSinkholeService
-}
-
-// NewIntelService generates a new service that applies the given options to each
-// request. These options are applied after the parent client's options (if there
-// is one), and before any request-specific options.
-func NewIntelService(opts ...option.RequestOption) (r *IntelService) {
- r = &IntelService{}
- r.Options = opts
- r.ASN = NewIntelASNService(opts...)
- r.DNS = NewIntelDNSService(opts...)
- r.Domains = NewIntelDomainService(opts...)
- r.DomainHistory = NewIntelDomainHistoryService(opts...)
- r.IPs = NewIntelIPService(opts...)
- r.IPLists = NewIntelIPListService(opts...)
- r.Miscategorizations = NewIntelMiscategorizationService(opts...)
- r.Whois = NewIntelWhoisService(opts...)
- r.IndicatorFeeds = NewIntelIndicatorFeedService(opts...)
- r.Sinkholes = NewIntelSinkholeService(opts...)
- return
-}
diff --git a/intel/aliases.go b/intel/aliases.go
new file mode 100644
index 00000000000..0b28feeab32
--- /dev/null
+++ b/intel/aliases.go
@@ -0,0 +1,9 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package intel
+
+import (
+ "github.com/cloudflare/cloudflare-go/internal/apierror"
+)
+
+type Error = apierror.Error
diff --git a/intel/asn.go b/intel/asn.go
new file mode 100644
index 00000000000..a4016dba8da
--- /dev/null
+++ b/intel/asn.go
@@ -0,0 +1,136 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package intel
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// ASNService contains methods and other services that help with interacting with
+// the cloudflare API. Note, unlike clients, this service does not read variables
+// from the environment automatically. You should not instantiate this service
+// directly, and instead use the [NewASNService] method instead.
+type ASNService struct {
+ Options []option.RequestOption
+ Subnets *ASNSubnetService
+}
+
+// NewASNService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewASNService(opts ...option.RequestOption) (r *ASNService) {
+ r = &ASNService{}
+ r.Options = opts
+ r.Subnets = NewASNSubnetService(opts...)
+ return
+}
+
+// Get ASN Overview
+func (r *ASNService) Get(ctx context.Context, asn IntelASNParam, query ASNGetParams, opts ...option.RequestOption) (res *IntelASN, err error) {
+ opts = append(r.Options[:], opts...)
+ var env ASNGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/intel/asn/%v", query.AccountID, asn)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type IntelASN = int64
+
+type IntelASNParam = int64
+
+type ASNGetParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type ASNGetResponseEnvelope struct {
+ Errors []ASNGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []ASNGetResponseEnvelopeMessages `json:"messages,required"`
+ Result IntelASN `json:"result,required"`
+ // Whether the API call was successful
+ Success ASNGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON asnGetResponseEnvelopeJSON `json:"-"`
+}
+
+// asnGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [ASNGetResponseEnvelope]
+type asnGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ASNGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r asnGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type ASNGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON asnGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// asnGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [ASNGetResponseEnvelopeErrors]
+type asnGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ASNGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r asnGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type ASNGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON asnGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// asnGetResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [ASNGetResponseEnvelopeMessages]
+type asnGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ASNGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r asnGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type ASNGetResponseEnvelopeSuccess bool
+
+const (
+ ASNGetResponseEnvelopeSuccessTrue ASNGetResponseEnvelopeSuccess = true
+)
diff --git a/intel/asn_test.go b/intel/asn_test.go
new file mode 100644
index 00000000000..a622f35a442
--- /dev/null
+++ b/intel/asn_test.go
@@ -0,0 +1,45 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package intel_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/intel"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestASNGet(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"),
+ )
+ _, err := client.Intel.ASN.Get(
+ context.TODO(),
+ int64(0),
+ intel.ASNGetParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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/intel/asnsubnet.go b/intel/asnsubnet.go
new file mode 100644
index 00000000000..de8ebb43066
--- /dev/null
+++ b/intel/asnsubnet.go
@@ -0,0 +1,78 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package intel
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// ASNSubnetService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewASNSubnetService] method instead.
+type ASNSubnetService struct {
+ Options []option.RequestOption
+}
+
+// NewASNSubnetService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewASNSubnetService(opts ...option.RequestOption) (r *ASNSubnetService) {
+ r = &ASNSubnetService{}
+ r.Options = opts
+ return
+}
+
+// Get ASN Subnets
+func (r *ASNSubnetService) Get(ctx context.Context, asn IntelASNParam, query ASNSubnetGetParams, opts ...option.RequestOption) (res *ASNSubnetGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ path := fmt.Sprintf("accounts/%s/intel/asn/%v/subnets", query.AccountID, asn)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &res, opts...)
+ return
+}
+
+type ASNSubnetGetResponse struct {
+ ASN IntelASN `json:"asn"`
+ // Total results returned based on your search parameters.
+ Count float64 `json:"count"`
+ IPCountTotal int64 `json:"ip_count_total"`
+ // Current page within paginated list of results.
+ Page float64 `json:"page"`
+ // Number of results per page of results.
+ PerPage float64 `json:"per_page"`
+ Subnets []string `json:"subnets"`
+ JSON asnSubnetGetResponseJSON `json:"-"`
+}
+
+// asnSubnetGetResponseJSON contains the JSON metadata for the struct
+// [ASNSubnetGetResponse]
+type asnSubnetGetResponseJSON struct {
+ ASN apijson.Field
+ Count apijson.Field
+ IPCountTotal apijson.Field
+ Page apijson.Field
+ PerPage apijson.Field
+ Subnets apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ASNSubnetGetResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r asnSubnetGetResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type ASNSubnetGetParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
diff --git a/intel/asnsubnet_test.go b/intel/asnsubnet_test.go
new file mode 100644
index 00000000000..89a6bd7b079
--- /dev/null
+++ b/intel/asnsubnet_test.go
@@ -0,0 +1,45 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package intel_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/intel"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestASNSubnetGet(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"),
+ )
+ _, err := client.Intel.ASN.Subnets.Get(
+ context.TODO(),
+ int64(0),
+ intel.ASNSubnetGetParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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/intel/dns.go b/intel/dns.go
new file mode 100644
index 00000000000..610d084ac61
--- /dev/null
+++ b/intel/dns.go
@@ -0,0 +1,222 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package intel
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// DNSService contains methods and other services that help with interacting with
+// the cloudflare API. Note, unlike clients, this service does not read variables
+// from the environment automatically. You should not instantiate this service
+// directly, and instead use the [NewDNSService] method instead.
+type DNSService struct {
+ Options []option.RequestOption
+}
+
+// NewDNSService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewDNSService(opts ...option.RequestOption) (r *DNSService) {
+ r = &DNSService{}
+ r.Options = opts
+ return
+}
+
+// Get Passive DNS by IP
+func (r *DNSService) Get(ctx context.Context, params DNSGetParams, opts ...option.RequestOption) (res *IntelPassiveDNSByIP, err error) {
+ opts = append(r.Options[:], opts...)
+ var env DNSGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/intel/dns", params.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type IntelPassiveDNSByIP struct {
+ // Total results returned based on your search parameters.
+ Count float64 `json:"count"`
+ // Current page within paginated list of results.
+ Page float64 `json:"page"`
+ // Number of results per page of results.
+ PerPage float64 `json:"per_page"`
+ // Reverse DNS look-ups observed during the time period.
+ ReverseRecords []IntelPassiveDNSByIPReverseRecord `json:"reverse_records"`
+ JSON intelPassiveDNSByIPJSON `json:"-"`
+}
+
+// intelPassiveDNSByIPJSON contains the JSON metadata for the struct
+// [IntelPassiveDNSByIP]
+type intelPassiveDNSByIPJSON struct {
+ Count apijson.Field
+ Page apijson.Field
+ PerPage apijson.Field
+ ReverseRecords apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IntelPassiveDNSByIP) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r intelPassiveDNSByIPJSON) RawJSON() string {
+ return r.raw
+}
+
+type IntelPassiveDNSByIPReverseRecord struct {
+ // First seen date of the DNS record during the time period.
+ FirstSeen time.Time `json:"first_seen" format:"date"`
+ // Hostname that the IP was observed resolving to.
+ Hostname interface{} `json:"hostname"`
+ // Last seen date of the DNS record during the time period.
+ LastSeen time.Time `json:"last_seen" format:"date"`
+ JSON intelPassiveDNSByIPReverseRecordJSON `json:"-"`
+}
+
+// intelPassiveDNSByIPReverseRecordJSON contains the JSON metadata for the struct
+// [IntelPassiveDNSByIPReverseRecord]
+type intelPassiveDNSByIPReverseRecordJSON struct {
+ FirstSeen apijson.Field
+ Hostname apijson.Field
+ LastSeen apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IntelPassiveDNSByIPReverseRecord) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r intelPassiveDNSByIPReverseRecordJSON) RawJSON() string {
+ return r.raw
+}
+
+type DNSGetParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ IPV4 param.Field[string] `query:"ipv4"`
+ // Requested page within paginated list of results.
+ Page param.Field[float64] `query:"page"`
+ // Maximum number of results requested.
+ PerPage param.Field[float64] `query:"per_page"`
+ StartEndParams param.Field[DNSGetParamsStartEndParams] `query:"start_end_params"`
+}
+
+// URLQuery serializes [DNSGetParams]'s query parameters as `url.Values`.
+func (r DNSGetParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type DNSGetParamsStartEndParams struct {
+ // Defaults to the current date.
+ End param.Field[time.Time] `query:"end" format:"date"`
+ // Defaults to 30 days before the end parameter value.
+ Start param.Field[time.Time] `query:"start" format:"date"`
+}
+
+// URLQuery serializes [DNSGetParamsStartEndParams]'s query parameters as
+// `url.Values`.
+func (r DNSGetParamsStartEndParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type DNSGetResponseEnvelope struct {
+ Errors []DNSGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []DNSGetResponseEnvelopeMessages `json:"messages,required"`
+ Result IntelPassiveDNSByIP `json:"result,required"`
+ // Whether the API call was successful
+ Success DNSGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON dnsGetResponseEnvelopeJSON `json:"-"`
+}
+
+// dnsGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [DNSGetResponseEnvelope]
+type dnsGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DNSGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r dnsGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type DNSGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON dnsGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// dnsGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [DNSGetResponseEnvelopeErrors]
+type dnsGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DNSGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r dnsGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type DNSGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON dnsGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// dnsGetResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [DNSGetResponseEnvelopeMessages]
+type dnsGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DNSGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r dnsGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type DNSGetResponseEnvelopeSuccess bool
+
+const (
+ DNSGetResponseEnvelopeSuccessTrue DNSGetResponseEnvelopeSuccess = true
+)
diff --git a/intel/dns_test.go b/intel/dns_test.go
new file mode 100644
index 00000000000..3be346388ee
--- /dev/null
+++ b/intel/dns_test.go
@@ -0,0 +1,49 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package intel_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/intel"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestDNSGetWithOptionalParams(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"),
+ )
+ _, err := client.Intel.DNS.Get(context.TODO(), intel.DNSGetParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ IPV4: cloudflare.F("string"),
+ Page: cloudflare.F(1.000000),
+ PerPage: cloudflare.F(20.000000),
+ StartEndParams: cloudflare.F(intel.DNSGetParamsStartEndParams{
+ End: cloudflare.F(time.Now()),
+ Start: cloudflare.F(time.Now()),
+ }),
+ })
+ 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/intel/domain.go b/intel/domain.go
new file mode 100644
index 00000000000..b19cd74338b
--- /dev/null
+++ b/intel/domain.go
@@ -0,0 +1,317 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package intel
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// DomainService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewDomainService] method instead.
+type DomainService struct {
+ Options []option.RequestOption
+ Bulks *DomainBulkService
+}
+
+// NewDomainService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewDomainService(opts ...option.RequestOption) (r *DomainService) {
+ r = &DomainService{}
+ r.Options = opts
+ r.Bulks = NewDomainBulkService(opts...)
+ return
+}
+
+// Get Domain Details
+func (r *DomainService) Get(ctx context.Context, params DomainGetParams, opts ...option.RequestOption) (res *IntelDomain, err error) {
+ opts = append(r.Options[:], opts...)
+ var env DomainGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/intel/domain", params.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type IntelDomain struct {
+ // Additional information related to the host name.
+ AdditionalInformation IntelDomainAdditionalInformation `json:"additional_information"`
+ // Application that the hostname belongs to.
+ Application IntelDomainApplication `json:"application"`
+ // Current content categories.
+ ContentCategories interface{} `json:"content_categories"`
+ Domain string `json:"domain"`
+ InheritedContentCategories []IntelDomainInheritedContentCategory `json:"inherited_content_categories"`
+ // Domain from which `inherited_content_categories` and `inherited_risk_types` are
+ // inherited, if applicable.
+ InheritedFrom string `json:"inherited_from"`
+ InheritedRiskTypes []IntelDomainInheritedRiskType `json:"inherited_risk_types"`
+ // Global Cloudflare 100k ranking for the last 30 days, if available for the
+ // hostname. The top ranked domain is 1, the lowest ranked domain is 100,000.
+ PopularityRank int64 `json:"popularity_rank"`
+ // Specifies a list of references to one or more IP addresses or domain names that
+ // the domain name currently resolves to.
+ ResolvesToRefs []IntelDomainResolvesToRef `json:"resolves_to_refs"`
+ // Hostname risk score, which is a value between 0 (lowest risk) to 1 (highest
+ // risk).
+ RiskScore float64 `json:"risk_score"`
+ RiskTypes interface{} `json:"risk_types"`
+ JSON intelDomainJSON `json:"-"`
+}
+
+// intelDomainJSON contains the JSON metadata for the struct [IntelDomain]
+type intelDomainJSON struct {
+ AdditionalInformation apijson.Field
+ Application apijson.Field
+ ContentCategories apijson.Field
+ Domain apijson.Field
+ InheritedContentCategories apijson.Field
+ InheritedFrom apijson.Field
+ InheritedRiskTypes apijson.Field
+ PopularityRank apijson.Field
+ ResolvesToRefs apijson.Field
+ RiskScore apijson.Field
+ RiskTypes apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IntelDomain) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r intelDomainJSON) RawJSON() string {
+ return r.raw
+}
+
+// Additional information related to the host name.
+type IntelDomainAdditionalInformation struct {
+ // Suspected DGA malware family.
+ SuspectedMalwareFamily string `json:"suspected_malware_family"`
+ JSON intelDomainAdditionalInformationJSON `json:"-"`
+}
+
+// intelDomainAdditionalInformationJSON contains the JSON metadata for the struct
+// [IntelDomainAdditionalInformation]
+type intelDomainAdditionalInformationJSON struct {
+ SuspectedMalwareFamily apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IntelDomainAdditionalInformation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r intelDomainAdditionalInformationJSON) RawJSON() string {
+ return r.raw
+}
+
+// Application that the hostname belongs to.
+type IntelDomainApplication struct {
+ ID int64 `json:"id"`
+ Name string `json:"name"`
+ JSON intelDomainApplicationJSON `json:"-"`
+}
+
+// intelDomainApplicationJSON contains the JSON metadata for the struct
+// [IntelDomainApplication]
+type intelDomainApplicationJSON struct {
+ ID apijson.Field
+ Name apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IntelDomainApplication) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r intelDomainApplicationJSON) RawJSON() string {
+ return r.raw
+}
+
+type IntelDomainInheritedContentCategory struct {
+ ID int64 `json:"id"`
+ Name string `json:"name"`
+ SuperCategoryID int64 `json:"super_category_id"`
+ JSON intelDomainInheritedContentCategoryJSON `json:"-"`
+}
+
+// intelDomainInheritedContentCategoryJSON contains the JSON metadata for the
+// struct [IntelDomainInheritedContentCategory]
+type intelDomainInheritedContentCategoryJSON struct {
+ ID apijson.Field
+ Name apijson.Field
+ SuperCategoryID apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IntelDomainInheritedContentCategory) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r intelDomainInheritedContentCategoryJSON) RawJSON() string {
+ return r.raw
+}
+
+type IntelDomainInheritedRiskType struct {
+ ID int64 `json:"id"`
+ Name string `json:"name"`
+ SuperCategoryID int64 `json:"super_category_id"`
+ JSON intelDomainInheritedRiskTypeJSON `json:"-"`
+}
+
+// intelDomainInheritedRiskTypeJSON contains the JSON metadata for the struct
+// [IntelDomainInheritedRiskType]
+type intelDomainInheritedRiskTypeJSON struct {
+ ID apijson.Field
+ Name apijson.Field
+ SuperCategoryID apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IntelDomainInheritedRiskType) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r intelDomainInheritedRiskTypeJSON) RawJSON() string {
+ return r.raw
+}
+
+type IntelDomainResolvesToRef struct {
+ // STIX 2.1 identifier:
+ // https://docs.oasis-open.org/cti/stix/v2.1/cs02/stix-v2.1-cs02.html#_64yvzeku5a5c
+ ID string `json:"id"`
+ // IP address or domain name.
+ Value string `json:"value"`
+ JSON intelDomainResolvesToRefJSON `json:"-"`
+}
+
+// intelDomainResolvesToRefJSON contains the JSON metadata for the struct
+// [IntelDomainResolvesToRef]
+type intelDomainResolvesToRefJSON struct {
+ ID apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IntelDomainResolvesToRef) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r intelDomainResolvesToRefJSON) RawJSON() string {
+ return r.raw
+}
+
+type DomainGetParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ Domain param.Field[string] `query:"domain"`
+}
+
+// URLQuery serializes [DomainGetParams]'s query parameters as `url.Values`.
+func (r DomainGetParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type DomainGetResponseEnvelope struct {
+ Errors []DomainGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []DomainGetResponseEnvelopeMessages `json:"messages,required"`
+ Result IntelDomain `json:"result,required"`
+ // Whether the API call was successful
+ Success DomainGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON domainGetResponseEnvelopeJSON `json:"-"`
+}
+
+// domainGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [DomainGetResponseEnvelope]
+type domainGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DomainGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r domainGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type DomainGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON domainGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// domainGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [DomainGetResponseEnvelopeErrors]
+type domainGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DomainGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r domainGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type DomainGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON domainGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// domainGetResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [DomainGetResponseEnvelopeMessages]
+type domainGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DomainGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r domainGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type DomainGetResponseEnvelopeSuccess bool
+
+const (
+ DomainGetResponseEnvelopeSuccessTrue DomainGetResponseEnvelopeSuccess = true
+)
diff --git a/intel/domain_test.go b/intel/domain_test.go
new file mode 100644
index 00000000000..aa27b2d74b4
--- /dev/null
+++ b/intel/domain_test.go
@@ -0,0 +1,42 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package intel_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/intel"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestDomainGetWithOptionalParams(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"),
+ )
+ _, err := client.Intel.Domains.Get(context.TODO(), intel.DomainGetParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Domain: cloudflare.F("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/intel/domainbulk.go b/intel/domainbulk.go
new file mode 100644
index 00000000000..91fd05ebd7d
--- /dev/null
+++ b/intel/domainbulk.go
@@ -0,0 +1,320 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package intel
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// DomainBulkService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewDomainBulkService] method instead.
+type DomainBulkService struct {
+ Options []option.RequestOption
+}
+
+// NewDomainBulkService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewDomainBulkService(opts ...option.RequestOption) (r *DomainBulkService) {
+ r = &DomainBulkService{}
+ r.Options = opts
+ return
+}
+
+// Get Multiple Domain Details
+func (r *DomainBulkService) Get(ctx context.Context, params DomainBulkGetParams, opts ...option.RequestOption) (res *[]DomainBulkGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env DomainBulkGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/intel/domain/bulk", params.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type DomainBulkGetResponse struct {
+ // Additional information related to the host name.
+ AdditionalInformation DomainBulkGetResponseAdditionalInformation `json:"additional_information"`
+ // Application that the hostname belongs to.
+ Application DomainBulkGetResponseApplication `json:"application"`
+ // Current content categories.
+ ContentCategories interface{} `json:"content_categories"`
+ Domain string `json:"domain"`
+ InheritedContentCategories []DomainBulkGetResponseInheritedContentCategory `json:"inherited_content_categories"`
+ // Domain from which `inherited_content_categories` and `inherited_risk_types` are
+ // inherited, if applicable.
+ InheritedFrom string `json:"inherited_from"`
+ InheritedRiskTypes []DomainBulkGetResponseInheritedRiskType `json:"inherited_risk_types"`
+ // Global Cloudflare 100k ranking for the last 30 days, if available for the
+ // hostname. The top ranked domain is 1, the lowest ranked domain is 100,000.
+ PopularityRank int64 `json:"popularity_rank"`
+ // Hostname risk score, which is a value between 0 (lowest risk) to 1 (highest
+ // risk).
+ RiskScore float64 `json:"risk_score"`
+ RiskTypes interface{} `json:"risk_types"`
+ JSON domainBulkGetResponseJSON `json:"-"`
+}
+
+// domainBulkGetResponseJSON contains the JSON metadata for the struct
+// [DomainBulkGetResponse]
+type domainBulkGetResponseJSON struct {
+ AdditionalInformation apijson.Field
+ Application apijson.Field
+ ContentCategories apijson.Field
+ Domain apijson.Field
+ InheritedContentCategories apijson.Field
+ InheritedFrom apijson.Field
+ InheritedRiskTypes apijson.Field
+ PopularityRank apijson.Field
+ RiskScore apijson.Field
+ RiskTypes apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DomainBulkGetResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r domainBulkGetResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+// Additional information related to the host name.
+type DomainBulkGetResponseAdditionalInformation struct {
+ // Suspected DGA malware family.
+ SuspectedMalwareFamily string `json:"suspected_malware_family"`
+ JSON domainBulkGetResponseAdditionalInformationJSON `json:"-"`
+}
+
+// domainBulkGetResponseAdditionalInformationJSON contains the JSON metadata for
+// the struct [DomainBulkGetResponseAdditionalInformation]
+type domainBulkGetResponseAdditionalInformationJSON struct {
+ SuspectedMalwareFamily apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DomainBulkGetResponseAdditionalInformation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r domainBulkGetResponseAdditionalInformationJSON) RawJSON() string {
+ return r.raw
+}
+
+// Application that the hostname belongs to.
+type DomainBulkGetResponseApplication struct {
+ ID int64 `json:"id"`
+ Name string `json:"name"`
+ JSON domainBulkGetResponseApplicationJSON `json:"-"`
+}
+
+// domainBulkGetResponseApplicationJSON contains the JSON metadata for the struct
+// [DomainBulkGetResponseApplication]
+type domainBulkGetResponseApplicationJSON struct {
+ ID apijson.Field
+ Name apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DomainBulkGetResponseApplication) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r domainBulkGetResponseApplicationJSON) RawJSON() string {
+ return r.raw
+}
+
+type DomainBulkGetResponseInheritedContentCategory struct {
+ ID int64 `json:"id"`
+ Name string `json:"name"`
+ SuperCategoryID int64 `json:"super_category_id"`
+ JSON domainBulkGetResponseInheritedContentCategoryJSON `json:"-"`
+}
+
+// domainBulkGetResponseInheritedContentCategoryJSON contains the JSON metadata for
+// the struct [DomainBulkGetResponseInheritedContentCategory]
+type domainBulkGetResponseInheritedContentCategoryJSON struct {
+ ID apijson.Field
+ Name apijson.Field
+ SuperCategoryID apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DomainBulkGetResponseInheritedContentCategory) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r domainBulkGetResponseInheritedContentCategoryJSON) RawJSON() string {
+ return r.raw
+}
+
+type DomainBulkGetResponseInheritedRiskType struct {
+ ID int64 `json:"id"`
+ Name string `json:"name"`
+ SuperCategoryID int64 `json:"super_category_id"`
+ JSON domainBulkGetResponseInheritedRiskTypeJSON `json:"-"`
+}
+
+// domainBulkGetResponseInheritedRiskTypeJSON contains the JSON metadata for the
+// struct [DomainBulkGetResponseInheritedRiskType]
+type domainBulkGetResponseInheritedRiskTypeJSON struct {
+ ID apijson.Field
+ Name apijson.Field
+ SuperCategoryID apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DomainBulkGetResponseInheritedRiskType) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r domainBulkGetResponseInheritedRiskTypeJSON) RawJSON() string {
+ return r.raw
+}
+
+type DomainBulkGetParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ // Accepts multiple values, i.e. `?domain=cloudflare.com&domain=example.com`.
+ Domain param.Field[interface{}] `query:"domain"`
+}
+
+// URLQuery serializes [DomainBulkGetParams]'s query parameters as `url.Values`.
+func (r DomainBulkGetParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type DomainBulkGetResponseEnvelope struct {
+ Errors []DomainBulkGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []DomainBulkGetResponseEnvelopeMessages `json:"messages,required"`
+ Result []DomainBulkGetResponse `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success DomainBulkGetResponseEnvelopeSuccess `json:"success,required"`
+ ResultInfo DomainBulkGetResponseEnvelopeResultInfo `json:"result_info"`
+ JSON domainBulkGetResponseEnvelopeJSON `json:"-"`
+}
+
+// domainBulkGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [DomainBulkGetResponseEnvelope]
+type domainBulkGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ ResultInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DomainBulkGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r domainBulkGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type DomainBulkGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON domainBulkGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// domainBulkGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [DomainBulkGetResponseEnvelopeErrors]
+type domainBulkGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DomainBulkGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r domainBulkGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type DomainBulkGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON domainBulkGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// domainBulkGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [DomainBulkGetResponseEnvelopeMessages]
+type domainBulkGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DomainBulkGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r domainBulkGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type DomainBulkGetResponseEnvelopeSuccess bool
+
+const (
+ DomainBulkGetResponseEnvelopeSuccessTrue DomainBulkGetResponseEnvelopeSuccess = true
+)
+
+type DomainBulkGetResponseEnvelopeResultInfo struct {
+ // Total number of results for the requested service
+ Count float64 `json:"count"`
+ // Current page within paginated list of results
+ Page float64 `json:"page"`
+ // Number of results per page of results
+ PerPage float64 `json:"per_page"`
+ // Total results available without any search parameters
+ TotalCount float64 `json:"total_count"`
+ JSON domainBulkGetResponseEnvelopeResultInfoJSON `json:"-"`
+}
+
+// domainBulkGetResponseEnvelopeResultInfoJSON contains the JSON metadata for the
+// struct [DomainBulkGetResponseEnvelopeResultInfo]
+type domainBulkGetResponseEnvelopeResultInfoJSON struct {
+ Count apijson.Field
+ Page apijson.Field
+ PerPage apijson.Field
+ TotalCount apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DomainBulkGetResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r domainBulkGetResponseEnvelopeResultInfoJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/intel/domainbulk_test.go b/intel/domainbulk_test.go
new file mode 100644
index 00000000000..693e93ff3dd
--- /dev/null
+++ b/intel/domainbulk_test.go
@@ -0,0 +1,42 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package intel_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/intel"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestDomainBulkGetWithOptionalParams(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"),
+ )
+ _, err := client.Intel.Domains.Bulks.Get(context.TODO(), intel.DomainBulkGetParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Domain: cloudflare.F[any](map[string]interface{}{}),
+ })
+ 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/intel/domainhistory.go b/intel/domainhistory.go
new file mode 100644
index 00000000000..28fbf046299
--- /dev/null
+++ b/intel/domainhistory.go
@@ -0,0 +1,224 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package intel
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// DomainHistoryService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewDomainHistoryService] method
+// instead.
+type DomainHistoryService struct {
+ Options []option.RequestOption
+}
+
+// NewDomainHistoryService generates a new service that applies the given options
+// to each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewDomainHistoryService(opts ...option.RequestOption) (r *DomainHistoryService) {
+ r = &DomainHistoryService{}
+ r.Options = opts
+ return
+}
+
+// Get Domain History
+func (r *DomainHistoryService) Get(ctx context.Context, params DomainHistoryGetParams, opts ...option.RequestOption) (res *[]IntelDomainHistory, err error) {
+ opts = append(r.Options[:], opts...)
+ var env DomainHistoryGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/intel/domain-history", params.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type IntelDomainHistory struct {
+ Categorizations []IntelDomainHistoryCategorization `json:"categorizations"`
+ Domain string `json:"domain"`
+ JSON intelDomainHistoryJSON `json:"-"`
+}
+
+// intelDomainHistoryJSON contains the JSON metadata for the struct
+// [IntelDomainHistory]
+type intelDomainHistoryJSON struct {
+ Categorizations apijson.Field
+ Domain apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IntelDomainHistory) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r intelDomainHistoryJSON) RawJSON() string {
+ return r.raw
+}
+
+type IntelDomainHistoryCategorization struct {
+ Categories interface{} `json:"categories"`
+ End time.Time `json:"end" format:"date"`
+ Start time.Time `json:"start" format:"date"`
+ JSON intelDomainHistoryCategorizationJSON `json:"-"`
+}
+
+// intelDomainHistoryCategorizationJSON contains the JSON metadata for the struct
+// [IntelDomainHistoryCategorization]
+type intelDomainHistoryCategorizationJSON struct {
+ Categories apijson.Field
+ End apijson.Field
+ Start apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IntelDomainHistoryCategorization) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r intelDomainHistoryCategorizationJSON) RawJSON() string {
+ return r.raw
+}
+
+type DomainHistoryGetParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ Domain param.Field[interface{}] `query:"domain"`
+}
+
+// URLQuery serializes [DomainHistoryGetParams]'s query parameters as `url.Values`.
+func (r DomainHistoryGetParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type DomainHistoryGetResponseEnvelope struct {
+ Errors []DomainHistoryGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []DomainHistoryGetResponseEnvelopeMessages `json:"messages,required"`
+ Result []IntelDomainHistory `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success DomainHistoryGetResponseEnvelopeSuccess `json:"success,required"`
+ ResultInfo DomainHistoryGetResponseEnvelopeResultInfo `json:"result_info"`
+ JSON domainHistoryGetResponseEnvelopeJSON `json:"-"`
+}
+
+// domainHistoryGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [DomainHistoryGetResponseEnvelope]
+type domainHistoryGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ ResultInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DomainHistoryGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r domainHistoryGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type DomainHistoryGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON domainHistoryGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// domainHistoryGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [DomainHistoryGetResponseEnvelopeErrors]
+type domainHistoryGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DomainHistoryGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r domainHistoryGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type DomainHistoryGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON domainHistoryGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// domainHistoryGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [DomainHistoryGetResponseEnvelopeMessages]
+type domainHistoryGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DomainHistoryGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r domainHistoryGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type DomainHistoryGetResponseEnvelopeSuccess bool
+
+const (
+ DomainHistoryGetResponseEnvelopeSuccessTrue DomainHistoryGetResponseEnvelopeSuccess = true
+)
+
+type DomainHistoryGetResponseEnvelopeResultInfo struct {
+ // Total number of results for the requested service
+ Count float64 `json:"count"`
+ // Current page within paginated list of results
+ Page float64 `json:"page"`
+ // Number of results per page of results
+ PerPage float64 `json:"per_page"`
+ // Total results available without any search parameters
+ TotalCount float64 `json:"total_count"`
+ JSON domainHistoryGetResponseEnvelopeResultInfoJSON `json:"-"`
+}
+
+// domainHistoryGetResponseEnvelopeResultInfoJSON contains the JSON metadata for
+// the struct [DomainHistoryGetResponseEnvelopeResultInfo]
+type domainHistoryGetResponseEnvelopeResultInfoJSON struct {
+ Count apijson.Field
+ Page apijson.Field
+ PerPage apijson.Field
+ TotalCount apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DomainHistoryGetResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r domainHistoryGetResponseEnvelopeResultInfoJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/intel/domainhistory_test.go b/intel/domainhistory_test.go
new file mode 100644
index 00000000000..c1bc01caf6e
--- /dev/null
+++ b/intel/domainhistory_test.go
@@ -0,0 +1,42 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package intel_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/intel"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestDomainHistoryGetWithOptionalParams(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"),
+ )
+ _, err := client.Intel.DomainHistory.Get(context.TODO(), intel.DomainHistoryGetParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Domain: cloudflare.F[any]("example.com"),
+ })
+ 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/intel/indicatorfeed.go b/intel/indicatorfeed.go
new file mode 100644
index 00000000000..6ded7a5ee83
--- /dev/null
+++ b/intel/indicatorfeed.go
@@ -0,0 +1,569 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package intel
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// IndicatorFeedService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewIndicatorFeedService] method
+// instead.
+type IndicatorFeedService struct {
+ Options []option.RequestOption
+ Permissions *IndicatorFeedPermissionService
+}
+
+// NewIndicatorFeedService generates a new service that applies the given options
+// to each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewIndicatorFeedService(opts ...option.RequestOption) (r *IndicatorFeedService) {
+ r = &IndicatorFeedService{}
+ r.Options = opts
+ r.Permissions = NewIndicatorFeedPermissionService(opts...)
+ return
+}
+
+// Create new indicator feed
+func (r *IndicatorFeedService) New(ctx context.Context, params IndicatorFeedNewParams, opts ...option.RequestOption) (res *IntelIndicatorFeedItem, err error) {
+ opts = append(r.Options[:], opts...)
+ var env IndicatorFeedNewResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/intel/indicator-feeds", params.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Update indicator feed data
+func (r *IndicatorFeedService) Update(ctx context.Context, feedID int64, params IndicatorFeedUpdateParams, opts ...option.RequestOption) (res *IntelUpdateFeed, err error) {
+ opts = append(r.Options[:], opts...)
+ var env IndicatorFeedUpdateResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/intel/indicator-feeds/%v/snapshot", params.AccountID, feedID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Get indicator feeds owned by this account
+func (r *IndicatorFeedService) List(ctx context.Context, query IndicatorFeedListParams, opts ...option.RequestOption) (res *[]IntelIndicatorFeedItem, err error) {
+ opts = append(r.Options[:], opts...)
+ var env IndicatorFeedListResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/intel/indicator-feeds", query.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Get indicator feed data
+func (r *IndicatorFeedService) Data(ctx context.Context, feedID int64, query IndicatorFeedDataParams, opts ...option.RequestOption) (res *string, err error) {
+ opts = append(r.Options[:], opts...)
+ opts = append([]option.RequestOption{option.WithHeader("Accept", "text/csv")}, opts...)
+ path := fmt.Sprintf("accounts/%s/intel/indicator-feeds/%v/data", query.AccountID, feedID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &res, opts...)
+ return
+}
+
+// Get indicator feed metadata
+func (r *IndicatorFeedService) Get(ctx context.Context, feedID int64, query IndicatorFeedGetParams, opts ...option.RequestOption) (res *IntelIndicatorFeedMetadata, err error) {
+ opts = append(r.Options[:], opts...)
+ var env IndicatorFeedGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/intel/indicator-feeds/%v", query.AccountID, feedID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type IntelIndicatorFeedItem struct {
+ // The unique identifier for the indicator feed
+ ID int64 `json:"id"`
+ // The date and time when the data entry was created
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // The description of the example test
+ Description string `json:"description"`
+ // The date and time when the data entry was last modified
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // The name of the indicator feed
+ Name string `json:"name"`
+ JSON intelIndicatorFeedItemJSON `json:"-"`
+}
+
+// intelIndicatorFeedItemJSON contains the JSON metadata for the struct
+// [IntelIndicatorFeedItem]
+type intelIndicatorFeedItemJSON struct {
+ ID apijson.Field
+ CreatedOn apijson.Field
+ Description apijson.Field
+ ModifiedOn apijson.Field
+ Name apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IntelIndicatorFeedItem) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r intelIndicatorFeedItemJSON) RawJSON() string {
+ return r.raw
+}
+
+type IntelIndicatorFeedMetadata struct {
+ // The unique identifier for the indicator feed
+ ID int64 `json:"id"`
+ // The date and time when the data entry was created
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // The description of the example test
+ Description string `json:"description"`
+ // Status of the latest snapshot uploaded
+ LatestUploadStatus IntelIndicatorFeedMetadataLatestUploadStatus `json:"latest_upload_status"`
+ // The date and time when the data entry was last modified
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // The name of the indicator feed
+ Name string `json:"name"`
+ JSON intelIndicatorFeedMetadataJSON `json:"-"`
+}
+
+// intelIndicatorFeedMetadataJSON contains the JSON metadata for the struct
+// [IntelIndicatorFeedMetadata]
+type intelIndicatorFeedMetadataJSON struct {
+ ID apijson.Field
+ CreatedOn apijson.Field
+ Description apijson.Field
+ LatestUploadStatus apijson.Field
+ ModifiedOn apijson.Field
+ Name apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IntelIndicatorFeedMetadata) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r intelIndicatorFeedMetadataJSON) RawJSON() string {
+ return r.raw
+}
+
+// Status of the latest snapshot uploaded
+type IntelIndicatorFeedMetadataLatestUploadStatus string
+
+const (
+ IntelIndicatorFeedMetadataLatestUploadStatusMirroring IntelIndicatorFeedMetadataLatestUploadStatus = "Mirroring"
+ IntelIndicatorFeedMetadataLatestUploadStatusUnifying IntelIndicatorFeedMetadataLatestUploadStatus = "Unifying"
+ IntelIndicatorFeedMetadataLatestUploadStatusLoading IntelIndicatorFeedMetadataLatestUploadStatus = "Loading"
+ IntelIndicatorFeedMetadataLatestUploadStatusProvisioning IntelIndicatorFeedMetadataLatestUploadStatus = "Provisioning"
+ IntelIndicatorFeedMetadataLatestUploadStatusComplete IntelIndicatorFeedMetadataLatestUploadStatus = "Complete"
+ IntelIndicatorFeedMetadataLatestUploadStatusError IntelIndicatorFeedMetadataLatestUploadStatus = "Error"
+)
+
+type IntelUpdateFeed struct {
+ // Feed id
+ FileID int64 `json:"file_id"`
+ // Name of the file unified in our system
+ Filename string `json:"filename"`
+ // Current status of upload, should be unified
+ Status string `json:"status"`
+ JSON intelUpdateFeedJSON `json:"-"`
+}
+
+// intelUpdateFeedJSON contains the JSON metadata for the struct [IntelUpdateFeed]
+type intelUpdateFeedJSON struct {
+ FileID apijson.Field
+ Filename apijson.Field
+ Status apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IntelUpdateFeed) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r intelUpdateFeedJSON) RawJSON() string {
+ return r.raw
+}
+
+type IndicatorFeedNewParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ // The description of the example test
+ Description param.Field[string] `json:"description"`
+ // The name of the indicator feed
+ Name param.Field[string] `json:"name"`
+}
+
+func (r IndicatorFeedNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type IndicatorFeedNewResponseEnvelope struct {
+ Errors []IndicatorFeedNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []IndicatorFeedNewResponseEnvelopeMessages `json:"messages,required"`
+ Result IntelIndicatorFeedItem `json:"result,required"`
+ // Whether the API call was successful
+ Success IndicatorFeedNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON indicatorFeedNewResponseEnvelopeJSON `json:"-"`
+}
+
+// indicatorFeedNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [IndicatorFeedNewResponseEnvelope]
+type indicatorFeedNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IndicatorFeedNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r indicatorFeedNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type IndicatorFeedNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON indicatorFeedNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// indicatorFeedNewResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [IndicatorFeedNewResponseEnvelopeErrors]
+type indicatorFeedNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IndicatorFeedNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r indicatorFeedNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type IndicatorFeedNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON indicatorFeedNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// indicatorFeedNewResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [IndicatorFeedNewResponseEnvelopeMessages]
+type indicatorFeedNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IndicatorFeedNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r indicatorFeedNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type IndicatorFeedNewResponseEnvelopeSuccess bool
+
+const (
+ IndicatorFeedNewResponseEnvelopeSuccessTrue IndicatorFeedNewResponseEnvelopeSuccess = true
+)
+
+type IndicatorFeedUpdateParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ // The file to upload
+ Source param.Field[string] `json:"source"`
+}
+
+func (r IndicatorFeedUpdateParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type IndicatorFeedUpdateResponseEnvelope struct {
+ Errors []IndicatorFeedUpdateResponseEnvelopeErrors `json:"errors,required"`
+ Messages []IndicatorFeedUpdateResponseEnvelopeMessages `json:"messages,required"`
+ Result IntelUpdateFeed `json:"result,required"`
+ // Whether the API call was successful
+ Success IndicatorFeedUpdateResponseEnvelopeSuccess `json:"success,required"`
+ JSON indicatorFeedUpdateResponseEnvelopeJSON `json:"-"`
+}
+
+// indicatorFeedUpdateResponseEnvelopeJSON contains the JSON metadata for the
+// struct [IndicatorFeedUpdateResponseEnvelope]
+type indicatorFeedUpdateResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IndicatorFeedUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r indicatorFeedUpdateResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type IndicatorFeedUpdateResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON indicatorFeedUpdateResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// indicatorFeedUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [IndicatorFeedUpdateResponseEnvelopeErrors]
+type indicatorFeedUpdateResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IndicatorFeedUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r indicatorFeedUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type IndicatorFeedUpdateResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON indicatorFeedUpdateResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// indicatorFeedUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for
+// the struct [IndicatorFeedUpdateResponseEnvelopeMessages]
+type indicatorFeedUpdateResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IndicatorFeedUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r indicatorFeedUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type IndicatorFeedUpdateResponseEnvelopeSuccess bool
+
+const (
+ IndicatorFeedUpdateResponseEnvelopeSuccessTrue IndicatorFeedUpdateResponseEnvelopeSuccess = true
+)
+
+type IndicatorFeedListParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type IndicatorFeedListResponseEnvelope struct {
+ Errors []IndicatorFeedListResponseEnvelopeErrors `json:"errors,required"`
+ Messages []IndicatorFeedListResponseEnvelopeMessages `json:"messages,required"`
+ Result []IntelIndicatorFeedItem `json:"result,required"`
+ // Whether the API call was successful
+ Success IndicatorFeedListResponseEnvelopeSuccess `json:"success,required"`
+ JSON indicatorFeedListResponseEnvelopeJSON `json:"-"`
+}
+
+// indicatorFeedListResponseEnvelopeJSON contains the JSON metadata for the struct
+// [IndicatorFeedListResponseEnvelope]
+type indicatorFeedListResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IndicatorFeedListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r indicatorFeedListResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type IndicatorFeedListResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON indicatorFeedListResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// indicatorFeedListResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [IndicatorFeedListResponseEnvelopeErrors]
+type indicatorFeedListResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IndicatorFeedListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r indicatorFeedListResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type IndicatorFeedListResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON indicatorFeedListResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// indicatorFeedListResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [IndicatorFeedListResponseEnvelopeMessages]
+type indicatorFeedListResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IndicatorFeedListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r indicatorFeedListResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type IndicatorFeedListResponseEnvelopeSuccess bool
+
+const (
+ IndicatorFeedListResponseEnvelopeSuccessTrue IndicatorFeedListResponseEnvelopeSuccess = true
+)
+
+type IndicatorFeedDataParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type IndicatorFeedGetParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type IndicatorFeedGetResponseEnvelope struct {
+ Errors []IndicatorFeedGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []IndicatorFeedGetResponseEnvelopeMessages `json:"messages,required"`
+ Result IntelIndicatorFeedMetadata `json:"result,required"`
+ // Whether the API call was successful
+ Success IndicatorFeedGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON indicatorFeedGetResponseEnvelopeJSON `json:"-"`
+}
+
+// indicatorFeedGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [IndicatorFeedGetResponseEnvelope]
+type indicatorFeedGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IndicatorFeedGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r indicatorFeedGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type IndicatorFeedGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON indicatorFeedGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// indicatorFeedGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [IndicatorFeedGetResponseEnvelopeErrors]
+type indicatorFeedGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IndicatorFeedGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r indicatorFeedGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type IndicatorFeedGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON indicatorFeedGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// indicatorFeedGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [IndicatorFeedGetResponseEnvelopeMessages]
+type indicatorFeedGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IndicatorFeedGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r indicatorFeedGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type IndicatorFeedGetResponseEnvelopeSuccess bool
+
+const (
+ IndicatorFeedGetResponseEnvelopeSuccessTrue IndicatorFeedGetResponseEnvelopeSuccess = true
+)
diff --git a/intel/indicatorfeed_test.go b/intel/indicatorfeed_test.go
new file mode 100644
index 00000000000..83fe7e523ad
--- /dev/null
+++ b/intel/indicatorfeed_test.go
@@ -0,0 +1,160 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package intel_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/intel"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestIndicatorFeedNewWithOptionalParams(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"),
+ )
+ _, err := client.Intel.IndicatorFeeds.New(context.TODO(), intel.IndicatorFeedNewParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Description: cloudflare.F("example feed description"),
+ Name: cloudflare.F("example_feed_1"),
+ })
+ 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())
+ }
+}
+
+func TestIndicatorFeedUpdateWithOptionalParams(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"),
+ )
+ _, err := client.Intel.IndicatorFeeds.Update(
+ context.TODO(),
+ int64(12),
+ intel.IndicatorFeedUpdateParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Source: cloudflare.F("@/Users/me/test.stix2"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestIndicatorFeedList(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"),
+ )
+ _, err := client.Intel.IndicatorFeeds.List(context.TODO(), intel.IndicatorFeedListParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ })
+ 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())
+ }
+}
+
+func TestIndicatorFeedData(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"),
+ )
+ _, err := client.Intel.IndicatorFeeds.Data(
+ context.TODO(),
+ int64(12),
+ intel.IndicatorFeedDataParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestIndicatorFeedGet(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"),
+ )
+ _, err := client.Intel.IndicatorFeeds.Get(
+ context.TODO(),
+ int64(12),
+ intel.IndicatorFeedGetParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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/intel/indicatorfeedpermission.go b/intel/indicatorfeedpermission.go
new file mode 100644
index 00000000000..bb3e04be674
--- /dev/null
+++ b/intel/indicatorfeedpermission.go
@@ -0,0 +1,395 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package intel
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// IndicatorFeedPermissionService contains methods and other services that help
+// with interacting with the cloudflare API. Note, unlike clients, this service
+// does not read variables from the environment automatically. You should not
+// instantiate this service directly, and instead use the
+// [NewIndicatorFeedPermissionService] method instead.
+type IndicatorFeedPermissionService struct {
+ Options []option.RequestOption
+}
+
+// NewIndicatorFeedPermissionService generates a new service that applies the given
+// options to each request. These options are applied after the parent client's
+// options (if there is one), and before any request-specific options.
+func NewIndicatorFeedPermissionService(opts ...option.RequestOption) (r *IndicatorFeedPermissionService) {
+ r = &IndicatorFeedPermissionService{}
+ r.Options = opts
+ return
+}
+
+// Grant permission to indicator feed
+func (r *IndicatorFeedPermissionService) New(ctx context.Context, params IndicatorFeedPermissionNewParams, opts ...option.RequestOption) (res *IntelPermissionsUpdate, err error) {
+ opts = append(r.Options[:], opts...)
+ var env IndicatorFeedPermissionNewResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/intel/indicator-feeds/permissions/add", params.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// List indicator feed permissions
+func (r *IndicatorFeedPermissionService) List(ctx context.Context, query IndicatorFeedPermissionListParams, opts ...option.RequestOption) (res *[]IntelPermissionListItem, err error) {
+ opts = append(r.Options[:], opts...)
+ var env IndicatorFeedPermissionListResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/intel/indicator-feeds/permissions/view", query.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Revoke permission to indicator feed
+func (r *IndicatorFeedPermissionService) Delete(ctx context.Context, params IndicatorFeedPermissionDeleteParams, opts ...option.RequestOption) (res *IntelPermissionsUpdate, err error) {
+ opts = append(r.Options[:], opts...)
+ var env IndicatorFeedPermissionDeleteResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/intel/indicator-feeds/permissions/remove", params.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type IntelPermissionListItem struct {
+ // The unique identifier for the indicator feed
+ ID int64 `json:"id"`
+ // The description of the example test
+ Description string `json:"description"`
+ // The name of the indicator feed
+ Name string `json:"name"`
+ JSON intelPermissionListItemJSON `json:"-"`
+}
+
+// intelPermissionListItemJSON contains the JSON metadata for the struct
+// [IntelPermissionListItem]
+type intelPermissionListItemJSON struct {
+ ID apijson.Field
+ Description apijson.Field
+ Name apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IntelPermissionListItem) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r intelPermissionListItemJSON) RawJSON() string {
+ return r.raw
+}
+
+type IntelPermissionsUpdate struct {
+ // Whether the update succeeded or not
+ Success bool `json:"success"`
+ JSON intelPermissionsUpdateJSON `json:"-"`
+}
+
+// intelPermissionsUpdateJSON contains the JSON metadata for the struct
+// [IntelPermissionsUpdate]
+type intelPermissionsUpdateJSON struct {
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IntelPermissionsUpdate) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r intelPermissionsUpdateJSON) RawJSON() string {
+ return r.raw
+}
+
+type IndicatorFeedPermissionNewParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ // The Cloudflare account tag of the account to change permissions on
+ AccountTag param.Field[string] `json:"account_tag"`
+ // The ID of the feed to add/remove permissions on
+ FeedID param.Field[int64] `json:"feed_id"`
+}
+
+func (r IndicatorFeedPermissionNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type IndicatorFeedPermissionNewResponseEnvelope struct {
+ Errors []IndicatorFeedPermissionNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []IndicatorFeedPermissionNewResponseEnvelopeMessages `json:"messages,required"`
+ Result IntelPermissionsUpdate `json:"result,required"`
+ // Whether the API call was successful
+ Success IndicatorFeedPermissionNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON indicatorFeedPermissionNewResponseEnvelopeJSON `json:"-"`
+}
+
+// indicatorFeedPermissionNewResponseEnvelopeJSON contains the JSON metadata for
+// the struct [IndicatorFeedPermissionNewResponseEnvelope]
+type indicatorFeedPermissionNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IndicatorFeedPermissionNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r indicatorFeedPermissionNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type IndicatorFeedPermissionNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON indicatorFeedPermissionNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// indicatorFeedPermissionNewResponseEnvelopeErrorsJSON contains the JSON metadata
+// for the struct [IndicatorFeedPermissionNewResponseEnvelopeErrors]
+type indicatorFeedPermissionNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IndicatorFeedPermissionNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r indicatorFeedPermissionNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type IndicatorFeedPermissionNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON indicatorFeedPermissionNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// indicatorFeedPermissionNewResponseEnvelopeMessagesJSON contains the JSON
+// metadata for the struct [IndicatorFeedPermissionNewResponseEnvelopeMessages]
+type indicatorFeedPermissionNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IndicatorFeedPermissionNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r indicatorFeedPermissionNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type IndicatorFeedPermissionNewResponseEnvelopeSuccess bool
+
+const (
+ IndicatorFeedPermissionNewResponseEnvelopeSuccessTrue IndicatorFeedPermissionNewResponseEnvelopeSuccess = true
+)
+
+type IndicatorFeedPermissionListParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type IndicatorFeedPermissionListResponseEnvelope struct {
+ Errors []IndicatorFeedPermissionListResponseEnvelopeErrors `json:"errors,required"`
+ Messages []IndicatorFeedPermissionListResponseEnvelopeMessages `json:"messages,required"`
+ Result []IntelPermissionListItem `json:"result,required"`
+ // Whether the API call was successful
+ Success IndicatorFeedPermissionListResponseEnvelopeSuccess `json:"success,required"`
+ JSON indicatorFeedPermissionListResponseEnvelopeJSON `json:"-"`
+}
+
+// indicatorFeedPermissionListResponseEnvelopeJSON contains the JSON metadata for
+// the struct [IndicatorFeedPermissionListResponseEnvelope]
+type indicatorFeedPermissionListResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IndicatorFeedPermissionListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r indicatorFeedPermissionListResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type IndicatorFeedPermissionListResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON indicatorFeedPermissionListResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// indicatorFeedPermissionListResponseEnvelopeErrorsJSON contains the JSON metadata
+// for the struct [IndicatorFeedPermissionListResponseEnvelopeErrors]
+type indicatorFeedPermissionListResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IndicatorFeedPermissionListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r indicatorFeedPermissionListResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type IndicatorFeedPermissionListResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON indicatorFeedPermissionListResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// indicatorFeedPermissionListResponseEnvelopeMessagesJSON contains the JSON
+// metadata for the struct [IndicatorFeedPermissionListResponseEnvelopeMessages]
+type indicatorFeedPermissionListResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IndicatorFeedPermissionListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r indicatorFeedPermissionListResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type IndicatorFeedPermissionListResponseEnvelopeSuccess bool
+
+const (
+ IndicatorFeedPermissionListResponseEnvelopeSuccessTrue IndicatorFeedPermissionListResponseEnvelopeSuccess = true
+)
+
+type IndicatorFeedPermissionDeleteParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ // The Cloudflare account tag of the account to change permissions on
+ AccountTag param.Field[string] `json:"account_tag"`
+ // The ID of the feed to add/remove permissions on
+ FeedID param.Field[int64] `json:"feed_id"`
+}
+
+func (r IndicatorFeedPermissionDeleteParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type IndicatorFeedPermissionDeleteResponseEnvelope struct {
+ Errors []IndicatorFeedPermissionDeleteResponseEnvelopeErrors `json:"errors,required"`
+ Messages []IndicatorFeedPermissionDeleteResponseEnvelopeMessages `json:"messages,required"`
+ Result IntelPermissionsUpdate `json:"result,required"`
+ // Whether the API call was successful
+ Success IndicatorFeedPermissionDeleteResponseEnvelopeSuccess `json:"success,required"`
+ JSON indicatorFeedPermissionDeleteResponseEnvelopeJSON `json:"-"`
+}
+
+// indicatorFeedPermissionDeleteResponseEnvelopeJSON contains the JSON metadata for
+// the struct [IndicatorFeedPermissionDeleteResponseEnvelope]
+type indicatorFeedPermissionDeleteResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IndicatorFeedPermissionDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r indicatorFeedPermissionDeleteResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type IndicatorFeedPermissionDeleteResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON indicatorFeedPermissionDeleteResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// indicatorFeedPermissionDeleteResponseEnvelopeErrorsJSON contains the JSON
+// metadata for the struct [IndicatorFeedPermissionDeleteResponseEnvelopeErrors]
+type indicatorFeedPermissionDeleteResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IndicatorFeedPermissionDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r indicatorFeedPermissionDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type IndicatorFeedPermissionDeleteResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON indicatorFeedPermissionDeleteResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// indicatorFeedPermissionDeleteResponseEnvelopeMessagesJSON contains the JSON
+// metadata for the struct [IndicatorFeedPermissionDeleteResponseEnvelopeMessages]
+type indicatorFeedPermissionDeleteResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IndicatorFeedPermissionDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r indicatorFeedPermissionDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type IndicatorFeedPermissionDeleteResponseEnvelopeSuccess bool
+
+const (
+ IndicatorFeedPermissionDeleteResponseEnvelopeSuccessTrue IndicatorFeedPermissionDeleteResponseEnvelopeSuccess = true
+)
diff --git a/intel/indicatorfeedpermission_test.go b/intel/indicatorfeedpermission_test.go
new file mode 100644
index 00000000000..8df7a146b1c
--- /dev/null
+++ b/intel/indicatorfeedpermission_test.go
@@ -0,0 +1,97 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package intel_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/intel"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestIndicatorFeedPermissionNewWithOptionalParams(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"),
+ )
+ _, err := client.Intel.IndicatorFeeds.Permissions.New(context.TODO(), intel.IndicatorFeedPermissionNewParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ AccountTag: cloudflare.F("823f45f16fd2f7e21e1e054aga4d2859"),
+ FeedID: cloudflare.F(int64(1)),
+ })
+ 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())
+ }
+}
+
+func TestIndicatorFeedPermissionList(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"),
+ )
+ _, err := client.Intel.IndicatorFeeds.Permissions.List(context.TODO(), intel.IndicatorFeedPermissionListParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ })
+ 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())
+ }
+}
+
+func TestIndicatorFeedPermissionDeleteWithOptionalParams(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"),
+ )
+ _, err := client.Intel.IndicatorFeeds.Permissions.Delete(context.TODO(), intel.IndicatorFeedPermissionDeleteParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ AccountTag: cloudflare.F("823f45f16fd2f7e21e1e054aga4d2859"),
+ FeedID: cloudflare.F(int64(1)),
+ })
+ 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/intel/intel.go b/intel/intel.go
new file mode 100644
index 00000000000..ca970a3ebff
--- /dev/null
+++ b/intel/intel.go
@@ -0,0 +1,44 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package intel
+
+import (
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// IntelService contains methods and other services that help with interacting with
+// the cloudflare API. Note, unlike clients, this service does not read variables
+// from the environment automatically. You should not instantiate this service
+// directly, and instead use the [NewIntelService] method instead.
+type IntelService struct {
+ Options []option.RequestOption
+ ASN *ASNService
+ DNS *DNSService
+ Domains *DomainService
+ DomainHistory *DomainHistoryService
+ IPs *IPService
+ IPLists *IPListService
+ Miscategorizations *MiscategorizationService
+ Whois *WhoisService
+ IndicatorFeeds *IndicatorFeedService
+ Sinkholes *SinkholeService
+}
+
+// NewIntelService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewIntelService(opts ...option.RequestOption) (r *IntelService) {
+ r = &IntelService{}
+ r.Options = opts
+ r.ASN = NewASNService(opts...)
+ r.DNS = NewDNSService(opts...)
+ r.Domains = NewDomainService(opts...)
+ r.DomainHistory = NewDomainHistoryService(opts...)
+ r.IPs = NewIPService(opts...)
+ r.IPLists = NewIPListService(opts...)
+ r.Miscategorizations = NewMiscategorizationService(opts...)
+ r.Whois = NewWhoisService(opts...)
+ r.IndicatorFeeds = NewIndicatorFeedService(opts...)
+ r.Sinkholes = NewSinkholeService(opts...)
+ return
+}
diff --git a/intel/ip.go b/intel/ip.go
new file mode 100644
index 00000000000..255c0b75dfb
--- /dev/null
+++ b/intel/ip.go
@@ -0,0 +1,265 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package intel
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+ "reflect"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/tidwall/gjson"
+)
+
+// IPService contains methods and other services that help with interacting with
+// the cloudflare API. Note, unlike clients, this service does not read variables
+// from the environment automatically. You should not instantiate this service
+// directly, and instead use the [NewIPService] method instead.
+type IPService struct {
+ Options []option.RequestOption
+}
+
+// NewIPService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewIPService(opts ...option.RequestOption) (r *IPService) {
+ r = &IPService{}
+ r.Options = opts
+ return
+}
+
+// Get IP Overview
+func (r *IPService) Get(ctx context.Context, params IPGetParams, opts ...option.RequestOption) (res *[]IntelSchemasIP, err error) {
+ opts = append(r.Options[:], opts...)
+ var env IPGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/intel/ip", params.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type IntelSchemasIP struct {
+ // Specifies a reference to the autonomous systems (AS) that the IP address belongs
+ // to.
+ BelongsToRef IntelSchemasIPBelongsToRef `json:"belongs_to_ref"`
+ IP IntelSchemasIPIP `json:"ip" format:"ipv4"`
+ RiskTypes interface{} `json:"risk_types"`
+ JSON intelSchemasIPJSON `json:"-"`
+}
+
+// intelSchemasIPJSON contains the JSON metadata for the struct [IntelSchemasIP]
+type intelSchemasIPJSON struct {
+ BelongsToRef apijson.Field
+ IP apijson.Field
+ RiskTypes apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IntelSchemasIP) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r intelSchemasIPJSON) RawJSON() string {
+ return r.raw
+}
+
+// Specifies a reference to the autonomous systems (AS) that the IP address belongs
+// to.
+type IntelSchemasIPBelongsToRef struct {
+ ID interface{} `json:"id"`
+ Country string `json:"country"`
+ Description string `json:"description"`
+ // Infrastructure type of this ASN.
+ Type IntelSchemasIPBelongsToRefType `json:"type"`
+ Value string `json:"value"`
+ JSON intelSchemasIPBelongsToRefJSON `json:"-"`
+}
+
+// intelSchemasIPBelongsToRefJSON contains the JSON metadata for the struct
+// [IntelSchemasIPBelongsToRef]
+type intelSchemasIPBelongsToRefJSON struct {
+ ID apijson.Field
+ Country apijson.Field
+ Description apijson.Field
+ Type apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IntelSchemasIPBelongsToRef) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r intelSchemasIPBelongsToRefJSON) RawJSON() string {
+ return r.raw
+}
+
+// Infrastructure type of this ASN.
+type IntelSchemasIPBelongsToRefType string
+
+const (
+ IntelSchemasIPBelongsToRefTypeHostingProvider IntelSchemasIPBelongsToRefType = "hosting_provider"
+ IntelSchemasIPBelongsToRefTypeIsp IntelSchemasIPBelongsToRefType = "isp"
+ IntelSchemasIPBelongsToRefTypeOrganization IntelSchemasIPBelongsToRefType = "organization"
+)
+
+// Union satisfied by [shared.UnionString] or [shared.UnionString].
+type IntelSchemasIPIP interface {
+ ImplementsIntelIntelSchemasIpip()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*IntelSchemasIPIP)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+type IPGetParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ IPV4 param.Field[string] `query:"ipv4"`
+ IPV6 param.Field[string] `query:"ipv6"`
+}
+
+// URLQuery serializes [IPGetParams]'s query parameters as `url.Values`.
+func (r IPGetParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type IPGetResponseEnvelope struct {
+ Errors []IPGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []IPGetResponseEnvelopeMessages `json:"messages,required"`
+ Result []IntelSchemasIP `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success IPGetResponseEnvelopeSuccess `json:"success,required"`
+ ResultInfo IPGetResponseEnvelopeResultInfo `json:"result_info"`
+ JSON ipGetResponseEnvelopeJSON `json:"-"`
+}
+
+// ipGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [IPGetResponseEnvelope]
+type ipGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ ResultInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IPGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ipGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type IPGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON ipGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// ipGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [IPGetResponseEnvelopeErrors]
+type ipGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IPGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ipGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type IPGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON ipGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// ipGetResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [IPGetResponseEnvelopeMessages]
+type ipGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IPGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ipGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type IPGetResponseEnvelopeSuccess bool
+
+const (
+ IPGetResponseEnvelopeSuccessTrue IPGetResponseEnvelopeSuccess = true
+)
+
+type IPGetResponseEnvelopeResultInfo struct {
+ // Total number of results for the requested service
+ Count float64 `json:"count"`
+ // Current page within paginated list of results
+ Page float64 `json:"page"`
+ // Number of results per page of results
+ PerPage float64 `json:"per_page"`
+ // Total results available without any search parameters
+ TotalCount float64 `json:"total_count"`
+ JSON ipGetResponseEnvelopeResultInfoJSON `json:"-"`
+}
+
+// ipGetResponseEnvelopeResultInfoJSON contains the JSON metadata for the struct
+// [IPGetResponseEnvelopeResultInfo]
+type ipGetResponseEnvelopeResultInfoJSON struct {
+ Count apijson.Field
+ Page apijson.Field
+ PerPage apijson.Field
+ TotalCount apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IPGetResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ipGetResponseEnvelopeResultInfoJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/intel/ip_test.go b/intel/ip_test.go
new file mode 100644
index 00000000000..681857a0ea2
--- /dev/null
+++ b/intel/ip_test.go
@@ -0,0 +1,43 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package intel_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/intel"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestIPGetWithOptionalParams(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"),
+ )
+ _, err := client.Intel.IPs.Get(context.TODO(), intel.IPGetParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ IPV4: cloudflare.F("string"),
+ IPV6: cloudflare.F("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/intel/iplist.go b/intel/iplist.go
new file mode 100644
index 00000000000..cb669ac9090
--- /dev/null
+++ b/intel/iplist.go
@@ -0,0 +1,187 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package intel
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// IPListService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewIPListService] method instead.
+type IPListService struct {
+ Options []option.RequestOption
+}
+
+// NewIPListService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewIPListService(opts ...option.RequestOption) (r *IPListService) {
+ r = &IPListService{}
+ r.Options = opts
+ return
+}
+
+// Get IP Lists
+func (r *IPListService) Get(ctx context.Context, query IPListGetParams, opts ...option.RequestOption) (res *[]IntelIPList, err error) {
+ opts = append(r.Options[:], opts...)
+ var env IPListGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/intel/ip-list", query.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type IntelIPList struct {
+ ID int64 `json:"id"`
+ Description string `json:"description"`
+ Name string `json:"name"`
+ JSON intelIPListJSON `json:"-"`
+}
+
+// intelIPListJSON contains the JSON metadata for the struct [IntelIPList]
+type intelIPListJSON struct {
+ ID apijson.Field
+ Description apijson.Field
+ Name apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IntelIPList) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r intelIPListJSON) RawJSON() string {
+ return r.raw
+}
+
+type IPListGetParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type IPListGetResponseEnvelope struct {
+ Errors []IPListGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []IPListGetResponseEnvelopeMessages `json:"messages,required"`
+ Result []IntelIPList `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success IPListGetResponseEnvelopeSuccess `json:"success,required"`
+ ResultInfo IPListGetResponseEnvelopeResultInfo `json:"result_info"`
+ JSON ipListGetResponseEnvelopeJSON `json:"-"`
+}
+
+// ipListGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [IPListGetResponseEnvelope]
+type ipListGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ ResultInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IPListGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ipListGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type IPListGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON ipListGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// ipListGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [IPListGetResponseEnvelopeErrors]
+type ipListGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IPListGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ipListGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type IPListGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON ipListGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// ipListGetResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [IPListGetResponseEnvelopeMessages]
+type ipListGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IPListGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ipListGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type IPListGetResponseEnvelopeSuccess bool
+
+const (
+ IPListGetResponseEnvelopeSuccessTrue IPListGetResponseEnvelopeSuccess = true
+)
+
+type IPListGetResponseEnvelopeResultInfo struct {
+ // Total number of results for the requested service
+ Count float64 `json:"count"`
+ // Current page within paginated list of results
+ Page float64 `json:"page"`
+ // Number of results per page of results
+ PerPage float64 `json:"per_page"`
+ // Total results available without any search parameters
+ TotalCount float64 `json:"total_count"`
+ JSON ipListGetResponseEnvelopeResultInfoJSON `json:"-"`
+}
+
+// ipListGetResponseEnvelopeResultInfoJSON contains the JSON metadata for the
+// struct [IPListGetResponseEnvelopeResultInfo]
+type ipListGetResponseEnvelopeResultInfoJSON struct {
+ Count apijson.Field
+ Page apijson.Field
+ PerPage apijson.Field
+ TotalCount apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IPListGetResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ipListGetResponseEnvelopeResultInfoJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/intel/iplist_test.go b/intel/iplist_test.go
new file mode 100644
index 00000000000..90bdc8e1476
--- /dev/null
+++ b/intel/iplist_test.go
@@ -0,0 +1,41 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package intel_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/intel"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestIPListGet(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"),
+ )
+ _, err := client.Intel.IPLists.Get(context.TODO(), intel.IPListGetParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ })
+ 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/intel/miscategorization.go b/intel/miscategorization.go
new file mode 100644
index 00000000000..0666eeef030
--- /dev/null
+++ b/intel/miscategorization.go
@@ -0,0 +1,179 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package intel
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "reflect"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/tidwall/gjson"
+)
+
+// MiscategorizationService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewMiscategorizationService] method
+// instead.
+type MiscategorizationService struct {
+ Options []option.RequestOption
+}
+
+// NewMiscategorizationService generates a new service that applies the given
+// options to each request. These options are applied after the parent client's
+// options (if there is one), and before any request-specific options.
+func NewMiscategorizationService(opts ...option.RequestOption) (r *MiscategorizationService) {
+ r = &MiscategorizationService{}
+ r.Options = opts
+ return
+}
+
+// Create Miscategorization
+func (r *MiscategorizationService) New(ctx context.Context, params MiscategorizationNewParams, opts ...option.RequestOption) (res *MiscategorizationNewResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env MiscategorizationNewResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/intel/miscategorization", params.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Union satisfied by [intel.MiscategorizationNewResponseUnknown] or
+// [shared.UnionString].
+type MiscategorizationNewResponse interface {
+ ImplementsIntelMiscategorizationNewResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*MiscategorizationNewResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+type MiscategorizationNewParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ // Content category IDs to add.
+ ContentAdds param.Field[interface{}] `json:"content_adds"`
+ // Content category IDs to remove.
+ ContentRemoves param.Field[interface{}] `json:"content_removes"`
+ IndicatorType param.Field[MiscategorizationNewParamsIndicatorType] `json:"indicator_type"`
+ // Provide only if indicator_type is `ipv4` or `ipv6`.
+ IP param.Field[interface{}] `json:"ip"`
+ // Security category IDs to add.
+ SecurityAdds param.Field[interface{}] `json:"security_adds"`
+ // Security category IDs to remove.
+ SecurityRemoves param.Field[interface{}] `json:"security_removes"`
+ // Provide only if indicator_type is `domain` or `url`. Example if indicator_type
+ // is `domain`: `example.com`. Example if indicator_type is `url`:
+ // `https://example.com/news/`.
+ URL param.Field[string] `json:"url"`
+}
+
+func (r MiscategorizationNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type MiscategorizationNewParamsIndicatorType string
+
+const (
+ MiscategorizationNewParamsIndicatorTypeDomain MiscategorizationNewParamsIndicatorType = "domain"
+ MiscategorizationNewParamsIndicatorTypeIPV4 MiscategorizationNewParamsIndicatorType = "ipv4"
+ MiscategorizationNewParamsIndicatorTypeIPV6 MiscategorizationNewParamsIndicatorType = "ipv6"
+ MiscategorizationNewParamsIndicatorTypeURL MiscategorizationNewParamsIndicatorType = "url"
+)
+
+type MiscategorizationNewResponseEnvelope struct {
+ Errors []MiscategorizationNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []MiscategorizationNewResponseEnvelopeMessages `json:"messages,required"`
+ Result MiscategorizationNewResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success MiscategorizationNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON miscategorizationNewResponseEnvelopeJSON `json:"-"`
+}
+
+// miscategorizationNewResponseEnvelopeJSON contains the JSON metadata for the
+// struct [MiscategorizationNewResponseEnvelope]
+type miscategorizationNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *MiscategorizationNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r miscategorizationNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type MiscategorizationNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON miscategorizationNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// miscategorizationNewResponseEnvelopeErrorsJSON contains the JSON metadata for
+// the struct [MiscategorizationNewResponseEnvelopeErrors]
+type miscategorizationNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *MiscategorizationNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r miscategorizationNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type MiscategorizationNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON miscategorizationNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// miscategorizationNewResponseEnvelopeMessagesJSON contains the JSON metadata for
+// the struct [MiscategorizationNewResponseEnvelopeMessages]
+type miscategorizationNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *MiscategorizationNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r miscategorizationNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type MiscategorizationNewResponseEnvelopeSuccess bool
+
+const (
+ MiscategorizationNewResponseEnvelopeSuccessTrue MiscategorizationNewResponseEnvelopeSuccess = true
+)
diff --git a/intel/miscategorization_test.go b/intel/miscategorization_test.go
new file mode 100644
index 00000000000..72c9669e103
--- /dev/null
+++ b/intel/miscategorization_test.go
@@ -0,0 +1,57 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package intel_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/intel"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestMiscategorizationNewWithOptionalParams(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"),
+ )
+ _, err := client.Intel.Miscategorizations.New(context.TODO(), intel.MiscategorizationNewParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ ContentAdds: cloudflare.F[any](map[string]interface{}{
+ "0": int64(82),
+ }),
+ ContentRemoves: cloudflare.F[any](map[string]interface{}{
+ "0": int64(155),
+ }),
+ IndicatorType: cloudflare.F(intel.MiscategorizationNewParamsIndicatorTypeDomain),
+ IP: cloudflare.F[any](map[string]interface{}{}),
+ SecurityAdds: cloudflare.F[any](map[string]interface{}{
+ "0": int64(117),
+ "1": int64(131),
+ }),
+ SecurityRemoves: cloudflare.F[any](map[string]interface{}{
+ "0": int64(83),
+ }),
+ URL: cloudflare.F("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/intel/sinkhole.go b/intel/sinkhole.go
new file mode 100644
index 00000000000..66e53cb9c4a
--- /dev/null
+++ b/intel/sinkhole.go
@@ -0,0 +1,171 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package intel
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// SinkholeService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewSinkholeService] method instead.
+type SinkholeService struct {
+ Options []option.RequestOption
+}
+
+// NewSinkholeService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewSinkholeService(opts ...option.RequestOption) (r *SinkholeService) {
+ r = &SinkholeService{}
+ r.Options = opts
+ return
+}
+
+// List sinkholes owned by this account
+func (r *SinkholeService) List(ctx context.Context, query SinkholeListParams, opts ...option.RequestOption) (res *[]IntelSinkholesSinkholeItem, err error) {
+ opts = append(r.Options[:], opts...)
+ var env SinkholeListResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/intel/sinkholes", query.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type IntelSinkholesSinkholeItem struct {
+ // The unique identifier for the sinkhole
+ ID int64 `json:"id"`
+ // The account tag that owns this sinkhole
+ AccountTag string `json:"account_tag"`
+ // The date and time when the sinkhole was created
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // The date and time when the sinkhole was last modified
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // The name of the sinkhole
+ Name string `json:"name"`
+ // The name of the R2 bucket to store results
+ R2Bucket string `json:"r2_bucket"`
+ // The id of the R2 instance
+ R2ID string `json:"r2_id"`
+ JSON intelSinkholesSinkholeItemJSON `json:"-"`
+}
+
+// intelSinkholesSinkholeItemJSON contains the JSON metadata for the struct
+// [IntelSinkholesSinkholeItem]
+type intelSinkholesSinkholeItemJSON struct {
+ ID apijson.Field
+ AccountTag apijson.Field
+ CreatedOn apijson.Field
+ ModifiedOn apijson.Field
+ Name apijson.Field
+ R2Bucket apijson.Field
+ R2ID apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IntelSinkholesSinkholeItem) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r intelSinkholesSinkholeItemJSON) RawJSON() string {
+ return r.raw
+}
+
+type SinkholeListParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type SinkholeListResponseEnvelope struct {
+ Errors []SinkholeListResponseEnvelopeErrors `json:"errors,required"`
+ Messages []SinkholeListResponseEnvelopeMessages `json:"messages,required"`
+ Result []IntelSinkholesSinkholeItem `json:"result,required"`
+ // Whether the API call was successful
+ Success SinkholeListResponseEnvelopeSuccess `json:"success,required"`
+ JSON sinkholeListResponseEnvelopeJSON `json:"-"`
+}
+
+// sinkholeListResponseEnvelopeJSON contains the JSON metadata for the struct
+// [SinkholeListResponseEnvelope]
+type sinkholeListResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *SinkholeListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r sinkholeListResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type SinkholeListResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON sinkholeListResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// sinkholeListResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [SinkholeListResponseEnvelopeErrors]
+type sinkholeListResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *SinkholeListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r sinkholeListResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type SinkholeListResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON sinkholeListResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// sinkholeListResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [SinkholeListResponseEnvelopeMessages]
+type sinkholeListResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *SinkholeListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r sinkholeListResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type SinkholeListResponseEnvelopeSuccess bool
+
+const (
+ SinkholeListResponseEnvelopeSuccessTrue SinkholeListResponseEnvelopeSuccess = true
+)
diff --git a/intel/sinkhole_test.go b/intel/sinkhole_test.go
new file mode 100644
index 00000000000..7d4ae56cbec
--- /dev/null
+++ b/intel/sinkhole_test.go
@@ -0,0 +1,41 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package intel_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/intel"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestSinkholeList(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"),
+ )
+ _, err := client.Intel.Sinkholes.List(context.TODO(), intel.SinkholeListParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ })
+ 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/intel/whois.go b/intel/whois.go
new file mode 100644
index 00000000000..c7f9b5b0e62
--- /dev/null
+++ b/intel/whois.go
@@ -0,0 +1,178 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package intel
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// WhoisService contains methods and other services that help with interacting with
+// the cloudflare API. Note, unlike clients, this service does not read variables
+// from the environment automatically. You should not instantiate this service
+// directly, and instead use the [NewWhoisService] method instead.
+type WhoisService struct {
+ Options []option.RequestOption
+}
+
+// NewWhoisService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewWhoisService(opts ...option.RequestOption) (r *WhoisService) {
+ r = &WhoisService{}
+ r.Options = opts
+ return
+}
+
+// Get WHOIS Record
+func (r *WhoisService) Get(ctx context.Context, params WhoisGetParams, opts ...option.RequestOption) (res *IntelWhois, err error) {
+ opts = append(r.Options[:], opts...)
+ var env WhoisGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/intel/whois", params.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type IntelWhois struct {
+ CreatedDate time.Time `json:"created_date" format:"date"`
+ Domain string `json:"domain"`
+ Nameservers []string `json:"nameservers"`
+ Registrant string `json:"registrant"`
+ RegistrantCountry string `json:"registrant_country"`
+ RegistrantEmail string `json:"registrant_email"`
+ RegistrantOrg string `json:"registrant_org"`
+ Registrar string `json:"registrar"`
+ UpdatedDate time.Time `json:"updated_date" format:"date"`
+ JSON intelWhoisJSON `json:"-"`
+}
+
+// intelWhoisJSON contains the JSON metadata for the struct [IntelWhois]
+type intelWhoisJSON struct {
+ CreatedDate apijson.Field
+ Domain apijson.Field
+ Nameservers apijson.Field
+ Registrant apijson.Field
+ RegistrantCountry apijson.Field
+ RegistrantEmail apijson.Field
+ RegistrantOrg apijson.Field
+ Registrar apijson.Field
+ UpdatedDate apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IntelWhois) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r intelWhoisJSON) RawJSON() string {
+ return r.raw
+}
+
+type WhoisGetParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ Domain param.Field[string] `query:"domain"`
+}
+
+// URLQuery serializes [WhoisGetParams]'s query parameters as `url.Values`.
+func (r WhoisGetParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type WhoisGetResponseEnvelope struct {
+ Errors []WhoisGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []WhoisGetResponseEnvelopeMessages `json:"messages,required"`
+ Result IntelWhois `json:"result,required"`
+ // Whether the API call was successful
+ Success WhoisGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON whoisGetResponseEnvelopeJSON `json:"-"`
+}
+
+// whoisGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [WhoisGetResponseEnvelope]
+type whoisGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WhoisGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r whoisGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type WhoisGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON whoisGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// whoisGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [WhoisGetResponseEnvelopeErrors]
+type whoisGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WhoisGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r whoisGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type WhoisGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON whoisGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// whoisGetResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [WhoisGetResponseEnvelopeMessages]
+type whoisGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WhoisGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r whoisGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type WhoisGetResponseEnvelopeSuccess bool
+
+const (
+ WhoisGetResponseEnvelopeSuccessTrue WhoisGetResponseEnvelopeSuccess = true
+)
diff --git a/intel/whois_test.go b/intel/whois_test.go
new file mode 100644
index 00000000000..f5fb90f6d5d
--- /dev/null
+++ b/intel/whois_test.go
@@ -0,0 +1,42 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package intel_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/intel"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestWhoisGetWithOptionalParams(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"),
+ )
+ _, err := client.Intel.Whois.Get(context.TODO(), intel.WhoisGetParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Domain: cloudflare.F("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/intelasn.go b/intelasn.go
deleted file mode 100644
index 49c661aca10..00000000000
--- a/intelasn.go
+++ /dev/null
@@ -1,132 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// IntelASNService contains methods and other services that help with interacting
-// with the cloudflare API. Note, unlike clients, this service does not read
-// variables from the environment automatically. You should not instantiate this
-// service directly, and instead use the [NewIntelASNService] method instead.
-type IntelASNService struct {
- Options []option.RequestOption
- Subnets *IntelASNSubnetService
-}
-
-// NewIntelASNService generates a new service that applies the given options to
-// each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewIntelASNService(opts ...option.RequestOption) (r *IntelASNService) {
- r = &IntelASNService{}
- r.Options = opts
- r.Subnets = NewIntelASNSubnetService(opts...)
- return
-}
-
-// Get ASN Overview
-func (r *IntelASNService) Get(ctx context.Context, asn int64, query IntelASNGetParams, opts ...option.RequestOption) (res *int64, err error) {
- opts = append(r.Options[:], opts...)
- var env IntelASNGetResponseEnvelope
- path := fmt.Sprintf("accounts/%s/intel/asn/%v", query.AccountID, asn)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type IntelASNGetParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type IntelASNGetResponseEnvelope struct {
- Errors []IntelASNGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []IntelASNGetResponseEnvelopeMessages `json:"messages,required"`
- Result int64 `json:"result,required"`
- // Whether the API call was successful
- Success IntelASNGetResponseEnvelopeSuccess `json:"success,required"`
- JSON intelASNGetResponseEnvelopeJSON `json:"-"`
-}
-
-// intelASNGetResponseEnvelopeJSON contains the JSON metadata for the struct
-// [IntelASNGetResponseEnvelope]
-type intelASNGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelASNGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelASNGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type IntelASNGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON intelASNGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// intelASNGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
-// [IntelASNGetResponseEnvelopeErrors]
-type intelASNGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelASNGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelASNGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type IntelASNGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON intelASNGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// intelASNGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [IntelASNGetResponseEnvelopeMessages]
-type intelASNGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelASNGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelASNGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type IntelASNGetResponseEnvelopeSuccess bool
-
-const (
- IntelASNGetResponseEnvelopeSuccessTrue IntelASNGetResponseEnvelopeSuccess = true
-)
diff --git a/intelasn_test.go b/intelasn_test.go
deleted file mode 100644
index 93503791e46..00000000000
--- a/intelasn_test.go
+++ /dev/null
@@ -1,44 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestIntelASNGet(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"),
- )
- _, err := client.Intel.ASN.Get(
- context.TODO(),
- int64(0),
- cloudflare.IntelASNGetParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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/intelasnsubnet.go b/intelasnsubnet.go
deleted file mode 100644
index e30f373d4a6..00000000000
--- a/intelasnsubnet.go
+++ /dev/null
@@ -1,79 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// IntelASNSubnetService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewIntelASNSubnetService] method
-// instead.
-type IntelASNSubnetService struct {
- Options []option.RequestOption
-}
-
-// NewIntelASNSubnetService generates a new service that applies the given options
-// to each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewIntelASNSubnetService(opts ...option.RequestOption) (r *IntelASNSubnetService) {
- r = &IntelASNSubnetService{}
- r.Options = opts
- return
-}
-
-// Get ASN Subnets
-func (r *IntelASNSubnetService) Get(ctx context.Context, asn int64, query IntelASNSubnetGetParams, opts ...option.RequestOption) (res *IntelASNSubnetGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- path := fmt.Sprintf("accounts/%s/intel/asn/%v/subnets", query.AccountID, asn)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &res, opts...)
- return
-}
-
-type IntelASNSubnetGetResponse struct {
- ASN int64 `json:"asn"`
- // Total results returned based on your search parameters.
- Count float64 `json:"count"`
- IPCountTotal int64 `json:"ip_count_total"`
- // Current page within paginated list of results.
- Page float64 `json:"page"`
- // Number of results per page of results.
- PerPage float64 `json:"per_page"`
- Subnets []string `json:"subnets"`
- JSON intelASNSubnetGetResponseJSON `json:"-"`
-}
-
-// intelASNSubnetGetResponseJSON contains the JSON metadata for the struct
-// [IntelASNSubnetGetResponse]
-type intelASNSubnetGetResponseJSON struct {
- ASN apijson.Field
- Count apijson.Field
- IPCountTotal apijson.Field
- Page apijson.Field
- PerPage apijson.Field
- Subnets apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelASNSubnetGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelASNSubnetGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type IntelASNSubnetGetParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
diff --git a/intelasnsubnet_test.go b/intelasnsubnet_test.go
deleted file mode 100644
index bc88ead9c4f..00000000000
--- a/intelasnsubnet_test.go
+++ /dev/null
@@ -1,44 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestIntelASNSubnetGet(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"),
- )
- _, err := client.Intel.ASN.Subnets.Get(
- context.TODO(),
- int64(0),
- cloudflare.IntelASNSubnetGetParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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/inteldns.go b/inteldns.go
deleted file mode 100644
index 42fb6f5f49e..00000000000
--- a/inteldns.go
+++ /dev/null
@@ -1,222 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// IntelDNSService contains methods and other services that help with interacting
-// with the cloudflare API. Note, unlike clients, this service does not read
-// variables from the environment automatically. You should not instantiate this
-// service directly, and instead use the [NewIntelDNSService] method instead.
-type IntelDNSService struct {
- Options []option.RequestOption
-}
-
-// NewIntelDNSService generates a new service that applies the given options to
-// each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewIntelDNSService(opts ...option.RequestOption) (r *IntelDNSService) {
- r = &IntelDNSService{}
- r.Options = opts
- return
-}
-
-// Get Passive DNS by IP
-func (r *IntelDNSService) Get(ctx context.Context, params IntelDNSGetParams, opts ...option.RequestOption) (res *IntelDNSGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env IntelDNSGetResponseEnvelope
- path := fmt.Sprintf("accounts/%s/intel/dns", params.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type IntelDNSGetResponse struct {
- // Total results returned based on your search parameters.
- Count float64 `json:"count"`
- // Current page within paginated list of results.
- Page float64 `json:"page"`
- // Number of results per page of results.
- PerPage float64 `json:"per_page"`
- // Reverse DNS look-ups observed during the time period.
- ReverseRecords []IntelDNSGetResponseReverseRecord `json:"reverse_records"`
- JSON intelDNSGetResponseJSON `json:"-"`
-}
-
-// intelDNSGetResponseJSON contains the JSON metadata for the struct
-// [IntelDNSGetResponse]
-type intelDNSGetResponseJSON struct {
- Count apijson.Field
- Page apijson.Field
- PerPage apijson.Field
- ReverseRecords apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelDNSGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelDNSGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type IntelDNSGetResponseReverseRecord struct {
- // First seen date of the DNS record during the time period.
- FirstSeen time.Time `json:"first_seen" format:"date"`
- // Hostname that the IP was observed resolving to.
- Hostname interface{} `json:"hostname"`
- // Last seen date of the DNS record during the time period.
- LastSeen time.Time `json:"last_seen" format:"date"`
- JSON intelDNSGetResponseReverseRecordJSON `json:"-"`
-}
-
-// intelDNSGetResponseReverseRecordJSON contains the JSON metadata for the struct
-// [IntelDNSGetResponseReverseRecord]
-type intelDNSGetResponseReverseRecordJSON struct {
- FirstSeen apijson.Field
- Hostname apijson.Field
- LastSeen apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelDNSGetResponseReverseRecord) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelDNSGetResponseReverseRecordJSON) RawJSON() string {
- return r.raw
-}
-
-type IntelDNSGetParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
- IPV4 param.Field[string] `query:"ipv4"`
- // Requested page within paginated list of results.
- Page param.Field[float64] `query:"page"`
- // Maximum number of results requested.
- PerPage param.Field[float64] `query:"per_page"`
- StartEndParams param.Field[IntelDNSGetParamsStartEndParams] `query:"start_end_params"`
-}
-
-// URLQuery serializes [IntelDNSGetParams]'s query parameters as `url.Values`.
-func (r IntelDNSGetParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type IntelDNSGetParamsStartEndParams struct {
- // Defaults to the current date.
- End param.Field[time.Time] `query:"end" format:"date"`
- // Defaults to 30 days before the end parameter value.
- Start param.Field[time.Time] `query:"start" format:"date"`
-}
-
-// URLQuery serializes [IntelDNSGetParamsStartEndParams]'s query parameters as
-// `url.Values`.
-func (r IntelDNSGetParamsStartEndParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type IntelDNSGetResponseEnvelope struct {
- Errors []IntelDNSGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []IntelDNSGetResponseEnvelopeMessages `json:"messages,required"`
- Result IntelDNSGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success IntelDNSGetResponseEnvelopeSuccess `json:"success,required"`
- JSON intelDNSGetResponseEnvelopeJSON `json:"-"`
-}
-
-// intelDNSGetResponseEnvelopeJSON contains the JSON metadata for the struct
-// [IntelDNSGetResponseEnvelope]
-type intelDNSGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelDNSGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelDNSGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type IntelDNSGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON intelDNSGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// intelDNSGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
-// [IntelDNSGetResponseEnvelopeErrors]
-type intelDNSGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelDNSGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelDNSGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type IntelDNSGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON intelDNSGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// intelDNSGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [IntelDNSGetResponseEnvelopeMessages]
-type intelDNSGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelDNSGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelDNSGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type IntelDNSGetResponseEnvelopeSuccess bool
-
-const (
- IntelDNSGetResponseEnvelopeSuccessTrue IntelDNSGetResponseEnvelopeSuccess = true
-)
diff --git a/inteldns_test.go b/inteldns_test.go
deleted file mode 100644
index 761b686343e..00000000000
--- a/inteldns_test.go
+++ /dev/null
@@ -1,48 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
- "time"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestIntelDNSGetWithOptionalParams(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"),
- )
- _, err := client.Intel.DNS.Get(context.TODO(), cloudflare.IntelDNSGetParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- IPV4: cloudflare.F("string"),
- Page: cloudflare.F(1.000000),
- PerPage: cloudflare.F(20.000000),
- StartEndParams: cloudflare.F(cloudflare.IntelDNSGetParamsStartEndParams{
- End: cloudflare.F(time.Now()),
- Start: cloudflare.F(time.Now()),
- }),
- })
- 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/inteldomain.go b/inteldomain.go
deleted file mode 100644
index 86d86cba76c..00000000000
--- a/inteldomain.go
+++ /dev/null
@@ -1,319 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// IntelDomainService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewIntelDomainService] method
-// instead.
-type IntelDomainService struct {
- Options []option.RequestOption
- Bulks *IntelDomainBulkService
-}
-
-// NewIntelDomainService generates a new service that applies the given options to
-// each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewIntelDomainService(opts ...option.RequestOption) (r *IntelDomainService) {
- r = &IntelDomainService{}
- r.Options = opts
- r.Bulks = NewIntelDomainBulkService(opts...)
- return
-}
-
-// Get Domain Details
-func (r *IntelDomainService) Get(ctx context.Context, params IntelDomainGetParams, opts ...option.RequestOption) (res *IntelDomainGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env IntelDomainGetResponseEnvelope
- path := fmt.Sprintf("accounts/%s/intel/domain", params.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type IntelDomainGetResponse struct {
- // Additional information related to the host name.
- AdditionalInformation IntelDomainGetResponseAdditionalInformation `json:"additional_information"`
- // Application that the hostname belongs to.
- Application IntelDomainGetResponseApplication `json:"application"`
- // Current content categories.
- ContentCategories interface{} `json:"content_categories"`
- Domain string `json:"domain"`
- InheritedContentCategories []IntelDomainGetResponseInheritedContentCategory `json:"inherited_content_categories"`
- // Domain from which `inherited_content_categories` and `inherited_risk_types` are
- // inherited, if applicable.
- InheritedFrom string `json:"inherited_from"`
- InheritedRiskTypes []IntelDomainGetResponseInheritedRiskType `json:"inherited_risk_types"`
- // Global Cloudflare 100k ranking for the last 30 days, if available for the
- // hostname. The top ranked domain is 1, the lowest ranked domain is 100,000.
- PopularityRank int64 `json:"popularity_rank"`
- // Specifies a list of references to one or more IP addresses or domain names that
- // the domain name currently resolves to.
- ResolvesToRefs []IntelDomainGetResponseResolvesToRef `json:"resolves_to_refs"`
- // Hostname risk score, which is a value between 0 (lowest risk) to 1 (highest
- // risk).
- RiskScore float64 `json:"risk_score"`
- RiskTypes interface{} `json:"risk_types"`
- JSON intelDomainGetResponseJSON `json:"-"`
-}
-
-// intelDomainGetResponseJSON contains the JSON metadata for the struct
-// [IntelDomainGetResponse]
-type intelDomainGetResponseJSON struct {
- AdditionalInformation apijson.Field
- Application apijson.Field
- ContentCategories apijson.Field
- Domain apijson.Field
- InheritedContentCategories apijson.Field
- InheritedFrom apijson.Field
- InheritedRiskTypes apijson.Field
- PopularityRank apijson.Field
- ResolvesToRefs apijson.Field
- RiskScore apijson.Field
- RiskTypes apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelDomainGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelDomainGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// Additional information related to the host name.
-type IntelDomainGetResponseAdditionalInformation struct {
- // Suspected DGA malware family.
- SuspectedMalwareFamily string `json:"suspected_malware_family"`
- JSON intelDomainGetResponseAdditionalInformationJSON `json:"-"`
-}
-
-// intelDomainGetResponseAdditionalInformationJSON contains the JSON metadata for
-// the struct [IntelDomainGetResponseAdditionalInformation]
-type intelDomainGetResponseAdditionalInformationJSON struct {
- SuspectedMalwareFamily apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelDomainGetResponseAdditionalInformation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelDomainGetResponseAdditionalInformationJSON) RawJSON() string {
- return r.raw
-}
-
-// Application that the hostname belongs to.
-type IntelDomainGetResponseApplication struct {
- ID int64 `json:"id"`
- Name string `json:"name"`
- JSON intelDomainGetResponseApplicationJSON `json:"-"`
-}
-
-// intelDomainGetResponseApplicationJSON contains the JSON metadata for the struct
-// [IntelDomainGetResponseApplication]
-type intelDomainGetResponseApplicationJSON struct {
- ID apijson.Field
- Name apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelDomainGetResponseApplication) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelDomainGetResponseApplicationJSON) RawJSON() string {
- return r.raw
-}
-
-type IntelDomainGetResponseInheritedContentCategory struct {
- ID int64 `json:"id"`
- Name string `json:"name"`
- SuperCategoryID int64 `json:"super_category_id"`
- JSON intelDomainGetResponseInheritedContentCategoryJSON `json:"-"`
-}
-
-// intelDomainGetResponseInheritedContentCategoryJSON contains the JSON metadata
-// for the struct [IntelDomainGetResponseInheritedContentCategory]
-type intelDomainGetResponseInheritedContentCategoryJSON struct {
- ID apijson.Field
- Name apijson.Field
- SuperCategoryID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelDomainGetResponseInheritedContentCategory) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelDomainGetResponseInheritedContentCategoryJSON) RawJSON() string {
- return r.raw
-}
-
-type IntelDomainGetResponseInheritedRiskType struct {
- ID int64 `json:"id"`
- Name string `json:"name"`
- SuperCategoryID int64 `json:"super_category_id"`
- JSON intelDomainGetResponseInheritedRiskTypeJSON `json:"-"`
-}
-
-// intelDomainGetResponseInheritedRiskTypeJSON contains the JSON metadata for the
-// struct [IntelDomainGetResponseInheritedRiskType]
-type intelDomainGetResponseInheritedRiskTypeJSON struct {
- ID apijson.Field
- Name apijson.Field
- SuperCategoryID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelDomainGetResponseInheritedRiskType) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelDomainGetResponseInheritedRiskTypeJSON) RawJSON() string {
- return r.raw
-}
-
-type IntelDomainGetResponseResolvesToRef struct {
- // STIX 2.1 identifier:
- // https://docs.oasis-open.org/cti/stix/v2.1/cs02/stix-v2.1-cs02.html#_64yvzeku5a5c
- ID string `json:"id"`
- // IP address or domain name.
- Value string `json:"value"`
- JSON intelDomainGetResponseResolvesToRefJSON `json:"-"`
-}
-
-// intelDomainGetResponseResolvesToRefJSON contains the JSON metadata for the
-// struct [IntelDomainGetResponseResolvesToRef]
-type intelDomainGetResponseResolvesToRefJSON struct {
- ID apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelDomainGetResponseResolvesToRef) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelDomainGetResponseResolvesToRefJSON) RawJSON() string {
- return r.raw
-}
-
-type IntelDomainGetParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
- Domain param.Field[string] `query:"domain"`
-}
-
-// URLQuery serializes [IntelDomainGetParams]'s query parameters as `url.Values`.
-func (r IntelDomainGetParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type IntelDomainGetResponseEnvelope struct {
- Errors []IntelDomainGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []IntelDomainGetResponseEnvelopeMessages `json:"messages,required"`
- Result IntelDomainGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success IntelDomainGetResponseEnvelopeSuccess `json:"success,required"`
- JSON intelDomainGetResponseEnvelopeJSON `json:"-"`
-}
-
-// intelDomainGetResponseEnvelopeJSON contains the JSON metadata for the struct
-// [IntelDomainGetResponseEnvelope]
-type intelDomainGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelDomainGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelDomainGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type IntelDomainGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON intelDomainGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// intelDomainGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [IntelDomainGetResponseEnvelopeErrors]
-type intelDomainGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelDomainGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelDomainGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type IntelDomainGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON intelDomainGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// intelDomainGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [IntelDomainGetResponseEnvelopeMessages]
-type intelDomainGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelDomainGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelDomainGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type IntelDomainGetResponseEnvelopeSuccess bool
-
-const (
- IntelDomainGetResponseEnvelopeSuccessTrue IntelDomainGetResponseEnvelopeSuccess = true
-)
diff --git a/inteldomain_test.go b/inteldomain_test.go
deleted file mode 100644
index db6b5e668b8..00000000000
--- a/inteldomain_test.go
+++ /dev/null
@@ -1,41 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestIntelDomainGetWithOptionalParams(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"),
- )
- _, err := client.Intel.Domains.Get(context.TODO(), cloudflare.IntelDomainGetParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Domain: cloudflare.F("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/inteldomainbulk.go b/inteldomainbulk.go
deleted file mode 100644
index 8d277ff20f0..00000000000
--- a/inteldomainbulk.go
+++ /dev/null
@@ -1,322 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// IntelDomainBulkService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewIntelDomainBulkService] method
-// instead.
-type IntelDomainBulkService struct {
- Options []option.RequestOption
-}
-
-// NewIntelDomainBulkService generates a new service that applies the given options
-// to each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewIntelDomainBulkService(opts ...option.RequestOption) (r *IntelDomainBulkService) {
- r = &IntelDomainBulkService{}
- r.Options = opts
- return
-}
-
-// Get Multiple Domain Details
-func (r *IntelDomainBulkService) Get(ctx context.Context, params IntelDomainBulkGetParams, opts ...option.RequestOption) (res *[]IntelDomainBulkGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env IntelDomainBulkGetResponseEnvelope
- path := fmt.Sprintf("accounts/%s/intel/domain/bulk", params.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type IntelDomainBulkGetResponse struct {
- // Additional information related to the host name.
- AdditionalInformation IntelDomainBulkGetResponseAdditionalInformation `json:"additional_information"`
- // Application that the hostname belongs to.
- Application IntelDomainBulkGetResponseApplication `json:"application"`
- // Current content categories.
- ContentCategories interface{} `json:"content_categories"`
- Domain string `json:"domain"`
- InheritedContentCategories []IntelDomainBulkGetResponseInheritedContentCategory `json:"inherited_content_categories"`
- // Domain from which `inherited_content_categories` and `inherited_risk_types` are
- // inherited, if applicable.
- InheritedFrom string `json:"inherited_from"`
- InheritedRiskTypes []IntelDomainBulkGetResponseInheritedRiskType `json:"inherited_risk_types"`
- // Global Cloudflare 100k ranking for the last 30 days, if available for the
- // hostname. The top ranked domain is 1, the lowest ranked domain is 100,000.
- PopularityRank int64 `json:"popularity_rank"`
- // Hostname risk score, which is a value between 0 (lowest risk) to 1 (highest
- // risk).
- RiskScore float64 `json:"risk_score"`
- RiskTypes interface{} `json:"risk_types"`
- JSON intelDomainBulkGetResponseJSON `json:"-"`
-}
-
-// intelDomainBulkGetResponseJSON contains the JSON metadata for the struct
-// [IntelDomainBulkGetResponse]
-type intelDomainBulkGetResponseJSON struct {
- AdditionalInformation apijson.Field
- Application apijson.Field
- ContentCategories apijson.Field
- Domain apijson.Field
- InheritedContentCategories apijson.Field
- InheritedFrom apijson.Field
- InheritedRiskTypes apijson.Field
- PopularityRank apijson.Field
- RiskScore apijson.Field
- RiskTypes apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelDomainBulkGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelDomainBulkGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// Additional information related to the host name.
-type IntelDomainBulkGetResponseAdditionalInformation struct {
- // Suspected DGA malware family.
- SuspectedMalwareFamily string `json:"suspected_malware_family"`
- JSON intelDomainBulkGetResponseAdditionalInformationJSON `json:"-"`
-}
-
-// intelDomainBulkGetResponseAdditionalInformationJSON contains the JSON metadata
-// for the struct [IntelDomainBulkGetResponseAdditionalInformation]
-type intelDomainBulkGetResponseAdditionalInformationJSON struct {
- SuspectedMalwareFamily apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelDomainBulkGetResponseAdditionalInformation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelDomainBulkGetResponseAdditionalInformationJSON) RawJSON() string {
- return r.raw
-}
-
-// Application that the hostname belongs to.
-type IntelDomainBulkGetResponseApplication struct {
- ID int64 `json:"id"`
- Name string `json:"name"`
- JSON intelDomainBulkGetResponseApplicationJSON `json:"-"`
-}
-
-// intelDomainBulkGetResponseApplicationJSON contains the JSON metadata for the
-// struct [IntelDomainBulkGetResponseApplication]
-type intelDomainBulkGetResponseApplicationJSON struct {
- ID apijson.Field
- Name apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelDomainBulkGetResponseApplication) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelDomainBulkGetResponseApplicationJSON) RawJSON() string {
- return r.raw
-}
-
-type IntelDomainBulkGetResponseInheritedContentCategory struct {
- ID int64 `json:"id"`
- Name string `json:"name"`
- SuperCategoryID int64 `json:"super_category_id"`
- JSON intelDomainBulkGetResponseInheritedContentCategoryJSON `json:"-"`
-}
-
-// intelDomainBulkGetResponseInheritedContentCategoryJSON contains the JSON
-// metadata for the struct [IntelDomainBulkGetResponseInheritedContentCategory]
-type intelDomainBulkGetResponseInheritedContentCategoryJSON struct {
- ID apijson.Field
- Name apijson.Field
- SuperCategoryID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelDomainBulkGetResponseInheritedContentCategory) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelDomainBulkGetResponseInheritedContentCategoryJSON) RawJSON() string {
- return r.raw
-}
-
-type IntelDomainBulkGetResponseInheritedRiskType struct {
- ID int64 `json:"id"`
- Name string `json:"name"`
- SuperCategoryID int64 `json:"super_category_id"`
- JSON intelDomainBulkGetResponseInheritedRiskTypeJSON `json:"-"`
-}
-
-// intelDomainBulkGetResponseInheritedRiskTypeJSON contains the JSON metadata for
-// the struct [IntelDomainBulkGetResponseInheritedRiskType]
-type intelDomainBulkGetResponseInheritedRiskTypeJSON struct {
- ID apijson.Field
- Name apijson.Field
- SuperCategoryID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelDomainBulkGetResponseInheritedRiskType) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelDomainBulkGetResponseInheritedRiskTypeJSON) RawJSON() string {
- return r.raw
-}
-
-type IntelDomainBulkGetParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
- // Accepts multiple values, i.e. `?domain=cloudflare.com&domain=example.com`.
- Domain param.Field[interface{}] `query:"domain"`
-}
-
-// URLQuery serializes [IntelDomainBulkGetParams]'s query parameters as
-// `url.Values`.
-func (r IntelDomainBulkGetParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type IntelDomainBulkGetResponseEnvelope struct {
- Errors []IntelDomainBulkGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []IntelDomainBulkGetResponseEnvelopeMessages `json:"messages,required"`
- Result []IntelDomainBulkGetResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success IntelDomainBulkGetResponseEnvelopeSuccess `json:"success,required"`
- ResultInfo IntelDomainBulkGetResponseEnvelopeResultInfo `json:"result_info"`
- JSON intelDomainBulkGetResponseEnvelopeJSON `json:"-"`
-}
-
-// intelDomainBulkGetResponseEnvelopeJSON contains the JSON metadata for the struct
-// [IntelDomainBulkGetResponseEnvelope]
-type intelDomainBulkGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- ResultInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelDomainBulkGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelDomainBulkGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type IntelDomainBulkGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON intelDomainBulkGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// intelDomainBulkGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [IntelDomainBulkGetResponseEnvelopeErrors]
-type intelDomainBulkGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelDomainBulkGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelDomainBulkGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type IntelDomainBulkGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON intelDomainBulkGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// intelDomainBulkGetResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [IntelDomainBulkGetResponseEnvelopeMessages]
-type intelDomainBulkGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelDomainBulkGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelDomainBulkGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type IntelDomainBulkGetResponseEnvelopeSuccess bool
-
-const (
- IntelDomainBulkGetResponseEnvelopeSuccessTrue IntelDomainBulkGetResponseEnvelopeSuccess = true
-)
-
-type IntelDomainBulkGetResponseEnvelopeResultInfo struct {
- // Total number of results for the requested service
- Count float64 `json:"count"`
- // Current page within paginated list of results
- Page float64 `json:"page"`
- // Number of results per page of results
- PerPage float64 `json:"per_page"`
- // Total results available without any search parameters
- TotalCount float64 `json:"total_count"`
- JSON intelDomainBulkGetResponseEnvelopeResultInfoJSON `json:"-"`
-}
-
-// intelDomainBulkGetResponseEnvelopeResultInfoJSON contains the JSON metadata for
-// the struct [IntelDomainBulkGetResponseEnvelopeResultInfo]
-type intelDomainBulkGetResponseEnvelopeResultInfoJSON struct {
- Count apijson.Field
- Page apijson.Field
- PerPage apijson.Field
- TotalCount apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelDomainBulkGetResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelDomainBulkGetResponseEnvelopeResultInfoJSON) RawJSON() string {
- return r.raw
-}
diff --git a/inteldomainbulk_test.go b/inteldomainbulk_test.go
deleted file mode 100644
index 9451c18612d..00000000000
--- a/inteldomainbulk_test.go
+++ /dev/null
@@ -1,41 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestIntelDomainBulkGetWithOptionalParams(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"),
- )
- _, err := client.Intel.Domains.Bulks.Get(context.TODO(), cloudflare.IntelDomainBulkGetParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Domain: cloudflare.F[any](map[string]interface{}{}),
- })
- 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/inteldomainhistory.go b/inteldomainhistory.go
deleted file mode 100644
index 2a2d649cd1c..00000000000
--- a/inteldomainhistory.go
+++ /dev/null
@@ -1,225 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// IntelDomainHistoryService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewIntelDomainHistoryService] method
-// instead.
-type IntelDomainHistoryService struct {
- Options []option.RequestOption
-}
-
-// NewIntelDomainHistoryService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewIntelDomainHistoryService(opts ...option.RequestOption) (r *IntelDomainHistoryService) {
- r = &IntelDomainHistoryService{}
- r.Options = opts
- return
-}
-
-// Get Domain History
-func (r *IntelDomainHistoryService) Get(ctx context.Context, params IntelDomainHistoryGetParams, opts ...option.RequestOption) (res *[]IntelDomainHistoryGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env IntelDomainHistoryGetResponseEnvelope
- path := fmt.Sprintf("accounts/%s/intel/domain-history", params.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type IntelDomainHistoryGetResponse struct {
- Categorizations []IntelDomainHistoryGetResponseCategorization `json:"categorizations"`
- Domain string `json:"domain"`
- JSON intelDomainHistoryGetResponseJSON `json:"-"`
-}
-
-// intelDomainHistoryGetResponseJSON contains the JSON metadata for the struct
-// [IntelDomainHistoryGetResponse]
-type intelDomainHistoryGetResponseJSON struct {
- Categorizations apijson.Field
- Domain apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelDomainHistoryGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelDomainHistoryGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type IntelDomainHistoryGetResponseCategorization struct {
- Categories interface{} `json:"categories"`
- End time.Time `json:"end" format:"date"`
- Start time.Time `json:"start" format:"date"`
- JSON intelDomainHistoryGetResponseCategorizationJSON `json:"-"`
-}
-
-// intelDomainHistoryGetResponseCategorizationJSON contains the JSON metadata for
-// the struct [IntelDomainHistoryGetResponseCategorization]
-type intelDomainHistoryGetResponseCategorizationJSON struct {
- Categories apijson.Field
- End apijson.Field
- Start apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelDomainHistoryGetResponseCategorization) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelDomainHistoryGetResponseCategorizationJSON) RawJSON() string {
- return r.raw
-}
-
-type IntelDomainHistoryGetParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
- Domain param.Field[interface{}] `query:"domain"`
-}
-
-// URLQuery serializes [IntelDomainHistoryGetParams]'s query parameters as
-// `url.Values`.
-func (r IntelDomainHistoryGetParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type IntelDomainHistoryGetResponseEnvelope struct {
- Errors []IntelDomainHistoryGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []IntelDomainHistoryGetResponseEnvelopeMessages `json:"messages,required"`
- Result []IntelDomainHistoryGetResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success IntelDomainHistoryGetResponseEnvelopeSuccess `json:"success,required"`
- ResultInfo IntelDomainHistoryGetResponseEnvelopeResultInfo `json:"result_info"`
- JSON intelDomainHistoryGetResponseEnvelopeJSON `json:"-"`
-}
-
-// intelDomainHistoryGetResponseEnvelopeJSON contains the JSON metadata for the
-// struct [IntelDomainHistoryGetResponseEnvelope]
-type intelDomainHistoryGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- ResultInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelDomainHistoryGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelDomainHistoryGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type IntelDomainHistoryGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON intelDomainHistoryGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// intelDomainHistoryGetResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [IntelDomainHistoryGetResponseEnvelopeErrors]
-type intelDomainHistoryGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelDomainHistoryGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelDomainHistoryGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type IntelDomainHistoryGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON intelDomainHistoryGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// intelDomainHistoryGetResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [IntelDomainHistoryGetResponseEnvelopeMessages]
-type intelDomainHistoryGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelDomainHistoryGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelDomainHistoryGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type IntelDomainHistoryGetResponseEnvelopeSuccess bool
-
-const (
- IntelDomainHistoryGetResponseEnvelopeSuccessTrue IntelDomainHistoryGetResponseEnvelopeSuccess = true
-)
-
-type IntelDomainHistoryGetResponseEnvelopeResultInfo struct {
- // Total number of results for the requested service
- Count float64 `json:"count"`
- // Current page within paginated list of results
- Page float64 `json:"page"`
- // Number of results per page of results
- PerPage float64 `json:"per_page"`
- // Total results available without any search parameters
- TotalCount float64 `json:"total_count"`
- JSON intelDomainHistoryGetResponseEnvelopeResultInfoJSON `json:"-"`
-}
-
-// intelDomainHistoryGetResponseEnvelopeResultInfoJSON contains the JSON metadata
-// for the struct [IntelDomainHistoryGetResponseEnvelopeResultInfo]
-type intelDomainHistoryGetResponseEnvelopeResultInfoJSON struct {
- Count apijson.Field
- Page apijson.Field
- PerPage apijson.Field
- TotalCount apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelDomainHistoryGetResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelDomainHistoryGetResponseEnvelopeResultInfoJSON) RawJSON() string {
- return r.raw
-}
diff --git a/inteldomainhistory_test.go b/inteldomainhistory_test.go
deleted file mode 100644
index f791dbb1c35..00000000000
--- a/inteldomainhistory_test.go
+++ /dev/null
@@ -1,41 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestIntelDomainHistoryGetWithOptionalParams(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"),
- )
- _, err := client.Intel.DomainHistory.Get(context.TODO(), cloudflare.IntelDomainHistoryGetParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Domain: cloudflare.F[any]("example.com"),
- })
- 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/intelindicatorfeed.go b/intelindicatorfeed.go
deleted file mode 100644
index 5a314cca308..00000000000
--- a/intelindicatorfeed.go
+++ /dev/null
@@ -1,604 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// IntelIndicatorFeedService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewIntelIndicatorFeedService] method
-// instead.
-type IntelIndicatorFeedService struct {
- Options []option.RequestOption
- Permissions *IntelIndicatorFeedPermissionService
-}
-
-// NewIntelIndicatorFeedService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewIntelIndicatorFeedService(opts ...option.RequestOption) (r *IntelIndicatorFeedService) {
- r = &IntelIndicatorFeedService{}
- r.Options = opts
- r.Permissions = NewIntelIndicatorFeedPermissionService(opts...)
- return
-}
-
-// Create new indicator feed
-func (r *IntelIndicatorFeedService) New(ctx context.Context, params IntelIndicatorFeedNewParams, opts ...option.RequestOption) (res *IntelIndicatorFeedNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env IntelIndicatorFeedNewResponseEnvelope
- path := fmt.Sprintf("accounts/%s/intel/indicator-feeds", params.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Update indicator feed data
-func (r *IntelIndicatorFeedService) Update(ctx context.Context, feedID int64, params IntelIndicatorFeedUpdateParams, opts ...option.RequestOption) (res *IntelIndicatorFeedUpdateResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env IntelIndicatorFeedUpdateResponseEnvelope
- path := fmt.Sprintf("accounts/%s/intel/indicator-feeds/%v/snapshot", params.AccountID, feedID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Get indicator feeds owned by this account
-func (r *IntelIndicatorFeedService) List(ctx context.Context, query IntelIndicatorFeedListParams, opts ...option.RequestOption) (res *[]IntelIndicatorFeedListResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env IntelIndicatorFeedListResponseEnvelope
- path := fmt.Sprintf("accounts/%s/intel/indicator-feeds", query.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Get indicator feed data
-func (r *IntelIndicatorFeedService) Data(ctx context.Context, feedID int64, query IntelIndicatorFeedDataParams, opts ...option.RequestOption) (res *string, err error) {
- opts = append(r.Options[:], opts...)
- opts = append([]option.RequestOption{option.WithHeader("Accept", "text/csv")}, opts...)
- path := fmt.Sprintf("accounts/%s/intel/indicator-feeds/%v/data", query.AccountID, feedID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &res, opts...)
- return
-}
-
-// Get indicator feed metadata
-func (r *IntelIndicatorFeedService) Get(ctx context.Context, feedID int64, query IntelIndicatorFeedGetParams, opts ...option.RequestOption) (res *IntelIndicatorFeedGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env IntelIndicatorFeedGetResponseEnvelope
- path := fmt.Sprintf("accounts/%s/intel/indicator-feeds/%v", query.AccountID, feedID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type IntelIndicatorFeedNewResponse struct {
- // The unique identifier for the indicator feed
- ID int64 `json:"id"`
- // The date and time when the data entry was created
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // The description of the example test
- Description string `json:"description"`
- // The date and time when the data entry was last modified
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // The name of the indicator feed
- Name string `json:"name"`
- JSON intelIndicatorFeedNewResponseJSON `json:"-"`
-}
-
-// intelIndicatorFeedNewResponseJSON contains the JSON metadata for the struct
-// [IntelIndicatorFeedNewResponse]
-type intelIndicatorFeedNewResponseJSON struct {
- ID apijson.Field
- CreatedOn apijson.Field
- Description apijson.Field
- ModifiedOn apijson.Field
- Name apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelIndicatorFeedNewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelIndicatorFeedNewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type IntelIndicatorFeedUpdateResponse struct {
- // Feed id
- FileID int64 `json:"file_id"`
- // Name of the file unified in our system
- Filename string `json:"filename"`
- // Current status of upload, should be unified
- Status string `json:"status"`
- JSON intelIndicatorFeedUpdateResponseJSON `json:"-"`
-}
-
-// intelIndicatorFeedUpdateResponseJSON contains the JSON metadata for the struct
-// [IntelIndicatorFeedUpdateResponse]
-type intelIndicatorFeedUpdateResponseJSON struct {
- FileID apijson.Field
- Filename apijson.Field
- Status apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelIndicatorFeedUpdateResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelIndicatorFeedUpdateResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type IntelIndicatorFeedListResponse struct {
- // The unique identifier for the indicator feed
- ID int64 `json:"id"`
- // The date and time when the data entry was created
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // The description of the example test
- Description string `json:"description"`
- // The date and time when the data entry was last modified
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // The name of the indicator feed
- Name string `json:"name"`
- JSON intelIndicatorFeedListResponseJSON `json:"-"`
-}
-
-// intelIndicatorFeedListResponseJSON contains the JSON metadata for the struct
-// [IntelIndicatorFeedListResponse]
-type intelIndicatorFeedListResponseJSON struct {
- ID apijson.Field
- CreatedOn apijson.Field
- Description apijson.Field
- ModifiedOn apijson.Field
- Name apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelIndicatorFeedListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelIndicatorFeedListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type IntelIndicatorFeedGetResponse struct {
- // The unique identifier for the indicator feed
- ID int64 `json:"id"`
- // The date and time when the data entry was created
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // The description of the example test
- Description string `json:"description"`
- // Status of the latest snapshot uploaded
- LatestUploadStatus IntelIndicatorFeedGetResponseLatestUploadStatus `json:"latest_upload_status"`
- // The date and time when the data entry was last modified
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // The name of the indicator feed
- Name string `json:"name"`
- JSON intelIndicatorFeedGetResponseJSON `json:"-"`
-}
-
-// intelIndicatorFeedGetResponseJSON contains the JSON metadata for the struct
-// [IntelIndicatorFeedGetResponse]
-type intelIndicatorFeedGetResponseJSON struct {
- ID apijson.Field
- CreatedOn apijson.Field
- Description apijson.Field
- LatestUploadStatus apijson.Field
- ModifiedOn apijson.Field
- Name apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelIndicatorFeedGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelIndicatorFeedGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// Status of the latest snapshot uploaded
-type IntelIndicatorFeedGetResponseLatestUploadStatus string
-
-const (
- IntelIndicatorFeedGetResponseLatestUploadStatusMirroring IntelIndicatorFeedGetResponseLatestUploadStatus = "Mirroring"
- IntelIndicatorFeedGetResponseLatestUploadStatusUnifying IntelIndicatorFeedGetResponseLatestUploadStatus = "Unifying"
- IntelIndicatorFeedGetResponseLatestUploadStatusLoading IntelIndicatorFeedGetResponseLatestUploadStatus = "Loading"
- IntelIndicatorFeedGetResponseLatestUploadStatusProvisioning IntelIndicatorFeedGetResponseLatestUploadStatus = "Provisioning"
- IntelIndicatorFeedGetResponseLatestUploadStatusComplete IntelIndicatorFeedGetResponseLatestUploadStatus = "Complete"
- IntelIndicatorFeedGetResponseLatestUploadStatusError IntelIndicatorFeedGetResponseLatestUploadStatus = "Error"
-)
-
-type IntelIndicatorFeedNewParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
- // The description of the example test
- Description param.Field[string] `json:"description"`
- // The name of the indicator feed
- Name param.Field[string] `json:"name"`
-}
-
-func (r IntelIndicatorFeedNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type IntelIndicatorFeedNewResponseEnvelope struct {
- Errors []IntelIndicatorFeedNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []IntelIndicatorFeedNewResponseEnvelopeMessages `json:"messages,required"`
- Result IntelIndicatorFeedNewResponse `json:"result,required"`
- // Whether the API call was successful
- Success IntelIndicatorFeedNewResponseEnvelopeSuccess `json:"success,required"`
- JSON intelIndicatorFeedNewResponseEnvelopeJSON `json:"-"`
-}
-
-// intelIndicatorFeedNewResponseEnvelopeJSON contains the JSON metadata for the
-// struct [IntelIndicatorFeedNewResponseEnvelope]
-type intelIndicatorFeedNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelIndicatorFeedNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelIndicatorFeedNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type IntelIndicatorFeedNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON intelIndicatorFeedNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// intelIndicatorFeedNewResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [IntelIndicatorFeedNewResponseEnvelopeErrors]
-type intelIndicatorFeedNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelIndicatorFeedNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelIndicatorFeedNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type IntelIndicatorFeedNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON intelIndicatorFeedNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// intelIndicatorFeedNewResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [IntelIndicatorFeedNewResponseEnvelopeMessages]
-type intelIndicatorFeedNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelIndicatorFeedNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelIndicatorFeedNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type IntelIndicatorFeedNewResponseEnvelopeSuccess bool
-
-const (
- IntelIndicatorFeedNewResponseEnvelopeSuccessTrue IntelIndicatorFeedNewResponseEnvelopeSuccess = true
-)
-
-type IntelIndicatorFeedUpdateParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
- // The file to upload
- Source param.Field[string] `json:"source"`
-}
-
-func (r IntelIndicatorFeedUpdateParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type IntelIndicatorFeedUpdateResponseEnvelope struct {
- Errors []IntelIndicatorFeedUpdateResponseEnvelopeErrors `json:"errors,required"`
- Messages []IntelIndicatorFeedUpdateResponseEnvelopeMessages `json:"messages,required"`
- Result IntelIndicatorFeedUpdateResponse `json:"result,required"`
- // Whether the API call was successful
- Success IntelIndicatorFeedUpdateResponseEnvelopeSuccess `json:"success,required"`
- JSON intelIndicatorFeedUpdateResponseEnvelopeJSON `json:"-"`
-}
-
-// intelIndicatorFeedUpdateResponseEnvelopeJSON contains the JSON metadata for the
-// struct [IntelIndicatorFeedUpdateResponseEnvelope]
-type intelIndicatorFeedUpdateResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelIndicatorFeedUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelIndicatorFeedUpdateResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type IntelIndicatorFeedUpdateResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON intelIndicatorFeedUpdateResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// intelIndicatorFeedUpdateResponseEnvelopeErrorsJSON contains the JSON metadata
-// for the struct [IntelIndicatorFeedUpdateResponseEnvelopeErrors]
-type intelIndicatorFeedUpdateResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelIndicatorFeedUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelIndicatorFeedUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type IntelIndicatorFeedUpdateResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON intelIndicatorFeedUpdateResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// intelIndicatorFeedUpdateResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [IntelIndicatorFeedUpdateResponseEnvelopeMessages]
-type intelIndicatorFeedUpdateResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelIndicatorFeedUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelIndicatorFeedUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type IntelIndicatorFeedUpdateResponseEnvelopeSuccess bool
-
-const (
- IntelIndicatorFeedUpdateResponseEnvelopeSuccessTrue IntelIndicatorFeedUpdateResponseEnvelopeSuccess = true
-)
-
-type IntelIndicatorFeedListParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type IntelIndicatorFeedListResponseEnvelope struct {
- Errors []IntelIndicatorFeedListResponseEnvelopeErrors `json:"errors,required"`
- Messages []IntelIndicatorFeedListResponseEnvelopeMessages `json:"messages,required"`
- Result []IntelIndicatorFeedListResponse `json:"result,required"`
- // Whether the API call was successful
- Success IntelIndicatorFeedListResponseEnvelopeSuccess `json:"success,required"`
- JSON intelIndicatorFeedListResponseEnvelopeJSON `json:"-"`
-}
-
-// intelIndicatorFeedListResponseEnvelopeJSON contains the JSON metadata for the
-// struct [IntelIndicatorFeedListResponseEnvelope]
-type intelIndicatorFeedListResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelIndicatorFeedListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelIndicatorFeedListResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type IntelIndicatorFeedListResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON intelIndicatorFeedListResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// intelIndicatorFeedListResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [IntelIndicatorFeedListResponseEnvelopeErrors]
-type intelIndicatorFeedListResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelIndicatorFeedListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelIndicatorFeedListResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type IntelIndicatorFeedListResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON intelIndicatorFeedListResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// intelIndicatorFeedListResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [IntelIndicatorFeedListResponseEnvelopeMessages]
-type intelIndicatorFeedListResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelIndicatorFeedListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelIndicatorFeedListResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type IntelIndicatorFeedListResponseEnvelopeSuccess bool
-
-const (
- IntelIndicatorFeedListResponseEnvelopeSuccessTrue IntelIndicatorFeedListResponseEnvelopeSuccess = true
-)
-
-type IntelIndicatorFeedDataParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type IntelIndicatorFeedGetParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type IntelIndicatorFeedGetResponseEnvelope struct {
- Errors []IntelIndicatorFeedGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []IntelIndicatorFeedGetResponseEnvelopeMessages `json:"messages,required"`
- Result IntelIndicatorFeedGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success IntelIndicatorFeedGetResponseEnvelopeSuccess `json:"success,required"`
- JSON intelIndicatorFeedGetResponseEnvelopeJSON `json:"-"`
-}
-
-// intelIndicatorFeedGetResponseEnvelopeJSON contains the JSON metadata for the
-// struct [IntelIndicatorFeedGetResponseEnvelope]
-type intelIndicatorFeedGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelIndicatorFeedGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelIndicatorFeedGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type IntelIndicatorFeedGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON intelIndicatorFeedGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// intelIndicatorFeedGetResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [IntelIndicatorFeedGetResponseEnvelopeErrors]
-type intelIndicatorFeedGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelIndicatorFeedGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelIndicatorFeedGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type IntelIndicatorFeedGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON intelIndicatorFeedGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// intelIndicatorFeedGetResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [IntelIndicatorFeedGetResponseEnvelopeMessages]
-type intelIndicatorFeedGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelIndicatorFeedGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelIndicatorFeedGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type IntelIndicatorFeedGetResponseEnvelopeSuccess bool
-
-const (
- IntelIndicatorFeedGetResponseEnvelopeSuccessTrue IntelIndicatorFeedGetResponseEnvelopeSuccess = true
-)
diff --git a/intelindicatorfeed_test.go b/intelindicatorfeed_test.go
deleted file mode 100644
index 7684fe5fdea..00000000000
--- a/intelindicatorfeed_test.go
+++ /dev/null
@@ -1,159 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestIntelIndicatorFeedNewWithOptionalParams(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"),
- )
- _, err := client.Intel.IndicatorFeeds.New(context.TODO(), cloudflare.IntelIndicatorFeedNewParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Description: cloudflare.F("example feed description"),
- Name: cloudflare.F("example_feed_1"),
- })
- 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())
- }
-}
-
-func TestIntelIndicatorFeedUpdateWithOptionalParams(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"),
- )
- _, err := client.Intel.IndicatorFeeds.Update(
- context.TODO(),
- int64(12),
- cloudflare.IntelIndicatorFeedUpdateParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Source: cloudflare.F("@/Users/me/test.stix2"),
- },
- )
- 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())
- }
-}
-
-func TestIntelIndicatorFeedList(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"),
- )
- _, err := client.Intel.IndicatorFeeds.List(context.TODO(), cloudflare.IntelIndicatorFeedListParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- })
- 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())
- }
-}
-
-func TestIntelIndicatorFeedData(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"),
- )
- _, err := client.Intel.IndicatorFeeds.Data(
- context.TODO(),
- int64(12),
- cloudflare.IntelIndicatorFeedDataParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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())
- }
-}
-
-func TestIntelIndicatorFeedGet(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"),
- )
- _, err := client.Intel.IndicatorFeeds.Get(
- context.TODO(),
- int64(12),
- cloudflare.IntelIndicatorFeedGetParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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/intelindicatorfeedpermission.go b/intelindicatorfeedpermission.go
deleted file mode 100644
index 31eec85e259..00000000000
--- a/intelindicatorfeedpermission.go
+++ /dev/null
@@ -1,421 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// IntelIndicatorFeedPermissionService contains methods and other services that
-// help with interacting with the cloudflare API. Note, unlike clients, this
-// service does not read variables from the environment automatically. You should
-// not instantiate this service directly, and instead use the
-// [NewIntelIndicatorFeedPermissionService] method instead.
-type IntelIndicatorFeedPermissionService struct {
- Options []option.RequestOption
-}
-
-// NewIntelIndicatorFeedPermissionService generates a new service that applies the
-// given options to each request. These options are applied after the parent
-// client's options (if there is one), and before any request-specific options.
-func NewIntelIndicatorFeedPermissionService(opts ...option.RequestOption) (r *IntelIndicatorFeedPermissionService) {
- r = &IntelIndicatorFeedPermissionService{}
- r.Options = opts
- return
-}
-
-// Grant permission to indicator feed
-func (r *IntelIndicatorFeedPermissionService) New(ctx context.Context, params IntelIndicatorFeedPermissionNewParams, opts ...option.RequestOption) (res *IntelIndicatorFeedPermissionNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env IntelIndicatorFeedPermissionNewResponseEnvelope
- path := fmt.Sprintf("accounts/%s/intel/indicator-feeds/permissions/add", params.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// List indicator feed permissions
-func (r *IntelIndicatorFeedPermissionService) List(ctx context.Context, query IntelIndicatorFeedPermissionListParams, opts ...option.RequestOption) (res *[]IntelIndicatorFeedPermissionListResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env IntelIndicatorFeedPermissionListResponseEnvelope
- path := fmt.Sprintf("accounts/%s/intel/indicator-feeds/permissions/view", query.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Revoke permission to indicator feed
-func (r *IntelIndicatorFeedPermissionService) Delete(ctx context.Context, params IntelIndicatorFeedPermissionDeleteParams, opts ...option.RequestOption) (res *IntelIndicatorFeedPermissionDeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env IntelIndicatorFeedPermissionDeleteResponseEnvelope
- path := fmt.Sprintf("accounts/%s/intel/indicator-feeds/permissions/remove", params.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type IntelIndicatorFeedPermissionNewResponse struct {
- // Whether the update succeeded or not
- Success bool `json:"success"`
- JSON intelIndicatorFeedPermissionNewResponseJSON `json:"-"`
-}
-
-// intelIndicatorFeedPermissionNewResponseJSON contains the JSON metadata for the
-// struct [IntelIndicatorFeedPermissionNewResponse]
-type intelIndicatorFeedPermissionNewResponseJSON struct {
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelIndicatorFeedPermissionNewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelIndicatorFeedPermissionNewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type IntelIndicatorFeedPermissionListResponse struct {
- // The unique identifier for the indicator feed
- ID int64 `json:"id"`
- // The description of the example test
- Description string `json:"description"`
- // The name of the indicator feed
- Name string `json:"name"`
- JSON intelIndicatorFeedPermissionListResponseJSON `json:"-"`
-}
-
-// intelIndicatorFeedPermissionListResponseJSON contains the JSON metadata for the
-// struct [IntelIndicatorFeedPermissionListResponse]
-type intelIndicatorFeedPermissionListResponseJSON struct {
- ID apijson.Field
- Description apijson.Field
- Name apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelIndicatorFeedPermissionListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelIndicatorFeedPermissionListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type IntelIndicatorFeedPermissionDeleteResponse struct {
- // Whether the update succeeded or not
- Success bool `json:"success"`
- JSON intelIndicatorFeedPermissionDeleteResponseJSON `json:"-"`
-}
-
-// intelIndicatorFeedPermissionDeleteResponseJSON contains the JSON metadata for
-// the struct [IntelIndicatorFeedPermissionDeleteResponse]
-type intelIndicatorFeedPermissionDeleteResponseJSON struct {
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelIndicatorFeedPermissionDeleteResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelIndicatorFeedPermissionDeleteResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type IntelIndicatorFeedPermissionNewParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
- // The Cloudflare account tag of the account to change permissions on
- AccountTag param.Field[string] `json:"account_tag"`
- // The ID of the feed to add/remove permissions on
- FeedID param.Field[int64] `json:"feed_id"`
-}
-
-func (r IntelIndicatorFeedPermissionNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type IntelIndicatorFeedPermissionNewResponseEnvelope struct {
- Errors []IntelIndicatorFeedPermissionNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []IntelIndicatorFeedPermissionNewResponseEnvelopeMessages `json:"messages,required"`
- Result IntelIndicatorFeedPermissionNewResponse `json:"result,required"`
- // Whether the API call was successful
- Success IntelIndicatorFeedPermissionNewResponseEnvelopeSuccess `json:"success,required"`
- JSON intelIndicatorFeedPermissionNewResponseEnvelopeJSON `json:"-"`
-}
-
-// intelIndicatorFeedPermissionNewResponseEnvelopeJSON contains the JSON metadata
-// for the struct [IntelIndicatorFeedPermissionNewResponseEnvelope]
-type intelIndicatorFeedPermissionNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelIndicatorFeedPermissionNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelIndicatorFeedPermissionNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type IntelIndicatorFeedPermissionNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON intelIndicatorFeedPermissionNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// intelIndicatorFeedPermissionNewResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct [IntelIndicatorFeedPermissionNewResponseEnvelopeErrors]
-type intelIndicatorFeedPermissionNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelIndicatorFeedPermissionNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelIndicatorFeedPermissionNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type IntelIndicatorFeedPermissionNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON intelIndicatorFeedPermissionNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// intelIndicatorFeedPermissionNewResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct
-// [IntelIndicatorFeedPermissionNewResponseEnvelopeMessages]
-type intelIndicatorFeedPermissionNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelIndicatorFeedPermissionNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelIndicatorFeedPermissionNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type IntelIndicatorFeedPermissionNewResponseEnvelopeSuccess bool
-
-const (
- IntelIndicatorFeedPermissionNewResponseEnvelopeSuccessTrue IntelIndicatorFeedPermissionNewResponseEnvelopeSuccess = true
-)
-
-type IntelIndicatorFeedPermissionListParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type IntelIndicatorFeedPermissionListResponseEnvelope struct {
- Errors []IntelIndicatorFeedPermissionListResponseEnvelopeErrors `json:"errors,required"`
- Messages []IntelIndicatorFeedPermissionListResponseEnvelopeMessages `json:"messages,required"`
- Result []IntelIndicatorFeedPermissionListResponse `json:"result,required"`
- // Whether the API call was successful
- Success IntelIndicatorFeedPermissionListResponseEnvelopeSuccess `json:"success,required"`
- JSON intelIndicatorFeedPermissionListResponseEnvelopeJSON `json:"-"`
-}
-
-// intelIndicatorFeedPermissionListResponseEnvelopeJSON contains the JSON metadata
-// for the struct [IntelIndicatorFeedPermissionListResponseEnvelope]
-type intelIndicatorFeedPermissionListResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelIndicatorFeedPermissionListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelIndicatorFeedPermissionListResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type IntelIndicatorFeedPermissionListResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON intelIndicatorFeedPermissionListResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// intelIndicatorFeedPermissionListResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct [IntelIndicatorFeedPermissionListResponseEnvelopeErrors]
-type intelIndicatorFeedPermissionListResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelIndicatorFeedPermissionListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelIndicatorFeedPermissionListResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type IntelIndicatorFeedPermissionListResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON intelIndicatorFeedPermissionListResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// intelIndicatorFeedPermissionListResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct
-// [IntelIndicatorFeedPermissionListResponseEnvelopeMessages]
-type intelIndicatorFeedPermissionListResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelIndicatorFeedPermissionListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelIndicatorFeedPermissionListResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type IntelIndicatorFeedPermissionListResponseEnvelopeSuccess bool
-
-const (
- IntelIndicatorFeedPermissionListResponseEnvelopeSuccessTrue IntelIndicatorFeedPermissionListResponseEnvelopeSuccess = true
-)
-
-type IntelIndicatorFeedPermissionDeleteParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
- // The Cloudflare account tag of the account to change permissions on
- AccountTag param.Field[string] `json:"account_tag"`
- // The ID of the feed to add/remove permissions on
- FeedID param.Field[int64] `json:"feed_id"`
-}
-
-func (r IntelIndicatorFeedPermissionDeleteParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type IntelIndicatorFeedPermissionDeleteResponseEnvelope struct {
- Errors []IntelIndicatorFeedPermissionDeleteResponseEnvelopeErrors `json:"errors,required"`
- Messages []IntelIndicatorFeedPermissionDeleteResponseEnvelopeMessages `json:"messages,required"`
- Result IntelIndicatorFeedPermissionDeleteResponse `json:"result,required"`
- // Whether the API call was successful
- Success IntelIndicatorFeedPermissionDeleteResponseEnvelopeSuccess `json:"success,required"`
- JSON intelIndicatorFeedPermissionDeleteResponseEnvelopeJSON `json:"-"`
-}
-
-// intelIndicatorFeedPermissionDeleteResponseEnvelopeJSON contains the JSON
-// metadata for the struct [IntelIndicatorFeedPermissionDeleteResponseEnvelope]
-type intelIndicatorFeedPermissionDeleteResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelIndicatorFeedPermissionDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelIndicatorFeedPermissionDeleteResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type IntelIndicatorFeedPermissionDeleteResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON intelIndicatorFeedPermissionDeleteResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// intelIndicatorFeedPermissionDeleteResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct
-// [IntelIndicatorFeedPermissionDeleteResponseEnvelopeErrors]
-type intelIndicatorFeedPermissionDeleteResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelIndicatorFeedPermissionDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelIndicatorFeedPermissionDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type IntelIndicatorFeedPermissionDeleteResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON intelIndicatorFeedPermissionDeleteResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// intelIndicatorFeedPermissionDeleteResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct
-// [IntelIndicatorFeedPermissionDeleteResponseEnvelopeMessages]
-type intelIndicatorFeedPermissionDeleteResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelIndicatorFeedPermissionDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelIndicatorFeedPermissionDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type IntelIndicatorFeedPermissionDeleteResponseEnvelopeSuccess bool
-
-const (
- IntelIndicatorFeedPermissionDeleteResponseEnvelopeSuccessTrue IntelIndicatorFeedPermissionDeleteResponseEnvelopeSuccess = true
-)
diff --git a/intelindicatorfeedpermission_test.go b/intelindicatorfeedpermission_test.go
deleted file mode 100644
index aa1f8c04207..00000000000
--- a/intelindicatorfeedpermission_test.go
+++ /dev/null
@@ -1,96 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestIntelIndicatorFeedPermissionNewWithOptionalParams(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"),
- )
- _, err := client.Intel.IndicatorFeeds.Permissions.New(context.TODO(), cloudflare.IntelIndicatorFeedPermissionNewParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- AccountTag: cloudflare.F("823f45f16fd2f7e21e1e054aga4d2859"),
- FeedID: cloudflare.F(int64(1)),
- })
- 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())
- }
-}
-
-func TestIntelIndicatorFeedPermissionList(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"),
- )
- _, err := client.Intel.IndicatorFeeds.Permissions.List(context.TODO(), cloudflare.IntelIndicatorFeedPermissionListParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- })
- 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())
- }
-}
-
-func TestIntelIndicatorFeedPermissionDeleteWithOptionalParams(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"),
- )
- _, err := client.Intel.IndicatorFeeds.Permissions.Delete(context.TODO(), cloudflare.IntelIndicatorFeedPermissionDeleteParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- AccountTag: cloudflare.F("823f45f16fd2f7e21e1e054aga4d2859"),
- FeedID: cloudflare.F(int64(1)),
- })
- 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/intelip.go b/intelip.go
deleted file mode 100644
index 8d48ec5a40f..00000000000
--- a/intelip.go
+++ /dev/null
@@ -1,266 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
- "reflect"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/option"
- "github.com/tidwall/gjson"
-)
-
-// IntelIPService contains methods and other services that help with interacting
-// with the cloudflare API. Note, unlike clients, this service does not read
-// variables from the environment automatically. You should not instantiate this
-// service directly, and instead use the [NewIntelIPService] method instead.
-type IntelIPService struct {
- Options []option.RequestOption
-}
-
-// NewIntelIPService generates a new service that applies the given options to each
-// request. These options are applied after the parent client's options (if there
-// is one), and before any request-specific options.
-func NewIntelIPService(opts ...option.RequestOption) (r *IntelIPService) {
- r = &IntelIPService{}
- r.Options = opts
- return
-}
-
-// Get IP Overview
-func (r *IntelIPService) Get(ctx context.Context, params IntelIPGetParams, opts ...option.RequestOption) (res *[]IntelIPGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env IntelIPGetResponseEnvelope
- path := fmt.Sprintf("accounts/%s/intel/ip", params.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type IntelIPGetResponse struct {
- // Specifies a reference to the autonomous systems (AS) that the IP address belongs
- // to.
- BelongsToRef IntelIPGetResponseBelongsToRef `json:"belongs_to_ref"`
- IP IntelIPGetResponseIP `json:"ip" format:"ipv4"`
- RiskTypes interface{} `json:"risk_types"`
- JSON intelIPGetResponseJSON `json:"-"`
-}
-
-// intelIPGetResponseJSON contains the JSON metadata for the struct
-// [IntelIPGetResponse]
-type intelIPGetResponseJSON struct {
- BelongsToRef apijson.Field
- IP apijson.Field
- RiskTypes apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelIPGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelIPGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// Specifies a reference to the autonomous systems (AS) that the IP address belongs
-// to.
-type IntelIPGetResponseBelongsToRef struct {
- ID interface{} `json:"id"`
- Country string `json:"country"`
- Description string `json:"description"`
- // Infrastructure type of this ASN.
- Type IntelIPGetResponseBelongsToRefType `json:"type"`
- Value string `json:"value"`
- JSON intelIPGetResponseBelongsToRefJSON `json:"-"`
-}
-
-// intelIPGetResponseBelongsToRefJSON contains the JSON metadata for the struct
-// [IntelIPGetResponseBelongsToRef]
-type intelIPGetResponseBelongsToRefJSON struct {
- ID apijson.Field
- Country apijson.Field
- Description apijson.Field
- Type apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelIPGetResponseBelongsToRef) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelIPGetResponseBelongsToRefJSON) RawJSON() string {
- return r.raw
-}
-
-// Infrastructure type of this ASN.
-type IntelIPGetResponseBelongsToRefType string
-
-const (
- IntelIPGetResponseBelongsToRefTypeHostingProvider IntelIPGetResponseBelongsToRefType = "hosting_provider"
- IntelIPGetResponseBelongsToRefTypeIsp IntelIPGetResponseBelongsToRefType = "isp"
- IntelIPGetResponseBelongsToRefTypeOrganization IntelIPGetResponseBelongsToRefType = "organization"
-)
-
-// Union satisfied by [shared.UnionString] or [shared.UnionString].
-type IntelIPGetResponseIP interface {
- ImplementsIntelIPGetResponseIP()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*IntelIPGetResponseIP)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-type IntelIPGetParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
- IPV4 param.Field[string] `query:"ipv4"`
- IPV6 param.Field[string] `query:"ipv6"`
-}
-
-// URLQuery serializes [IntelIPGetParams]'s query parameters as `url.Values`.
-func (r IntelIPGetParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type IntelIPGetResponseEnvelope struct {
- Errors []IntelIPGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []IntelIPGetResponseEnvelopeMessages `json:"messages,required"`
- Result []IntelIPGetResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success IntelIPGetResponseEnvelopeSuccess `json:"success,required"`
- ResultInfo IntelIPGetResponseEnvelopeResultInfo `json:"result_info"`
- JSON intelIPGetResponseEnvelopeJSON `json:"-"`
-}
-
-// intelIPGetResponseEnvelopeJSON contains the JSON metadata for the struct
-// [IntelIPGetResponseEnvelope]
-type intelIPGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- ResultInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelIPGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelIPGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type IntelIPGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON intelIPGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// intelIPGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
-// [IntelIPGetResponseEnvelopeErrors]
-type intelIPGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelIPGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelIPGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type IntelIPGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON intelIPGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// intelIPGetResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
-// [IntelIPGetResponseEnvelopeMessages]
-type intelIPGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelIPGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelIPGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type IntelIPGetResponseEnvelopeSuccess bool
-
-const (
- IntelIPGetResponseEnvelopeSuccessTrue IntelIPGetResponseEnvelopeSuccess = true
-)
-
-type IntelIPGetResponseEnvelopeResultInfo struct {
- // Total number of results for the requested service
- Count float64 `json:"count"`
- // Current page within paginated list of results
- Page float64 `json:"page"`
- // Number of results per page of results
- PerPage float64 `json:"per_page"`
- // Total results available without any search parameters
- TotalCount float64 `json:"total_count"`
- JSON intelIPGetResponseEnvelopeResultInfoJSON `json:"-"`
-}
-
-// intelIPGetResponseEnvelopeResultInfoJSON contains the JSON metadata for the
-// struct [IntelIPGetResponseEnvelopeResultInfo]
-type intelIPGetResponseEnvelopeResultInfoJSON struct {
- Count apijson.Field
- Page apijson.Field
- PerPage apijson.Field
- TotalCount apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelIPGetResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelIPGetResponseEnvelopeResultInfoJSON) RawJSON() string {
- return r.raw
-}
diff --git a/intelip_test.go b/intelip_test.go
deleted file mode 100644
index 91cd42622c1..00000000000
--- a/intelip_test.go
+++ /dev/null
@@ -1,42 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestIntelIPGetWithOptionalParams(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"),
- )
- _, err := client.Intel.IPs.Get(context.TODO(), cloudflare.IntelIPGetParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- IPV4: cloudflare.F("string"),
- IPV6: cloudflare.F("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/inteliplist.go b/inteliplist.go
deleted file mode 100644
index 1d688c05a79..00000000000
--- a/inteliplist.go
+++ /dev/null
@@ -1,189 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// IntelIPListService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewIntelIPListService] method
-// instead.
-type IntelIPListService struct {
- Options []option.RequestOption
-}
-
-// NewIntelIPListService generates a new service that applies the given options to
-// each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewIntelIPListService(opts ...option.RequestOption) (r *IntelIPListService) {
- r = &IntelIPListService{}
- r.Options = opts
- return
-}
-
-// Get IP Lists
-func (r *IntelIPListService) Get(ctx context.Context, query IntelIPListGetParams, opts ...option.RequestOption) (res *[]IntelIPListGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env IntelIPListGetResponseEnvelope
- path := fmt.Sprintf("accounts/%s/intel/ip-list", query.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type IntelIPListGetResponse struct {
- ID int64 `json:"id"`
- Description string `json:"description"`
- Name string `json:"name"`
- JSON intelIPListGetResponseJSON `json:"-"`
-}
-
-// intelIPListGetResponseJSON contains the JSON metadata for the struct
-// [IntelIPListGetResponse]
-type intelIPListGetResponseJSON struct {
- ID apijson.Field
- Description apijson.Field
- Name apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelIPListGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelIPListGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type IntelIPListGetParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type IntelIPListGetResponseEnvelope struct {
- Errors []IntelIPListGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []IntelIPListGetResponseEnvelopeMessages `json:"messages,required"`
- Result []IntelIPListGetResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success IntelIPListGetResponseEnvelopeSuccess `json:"success,required"`
- ResultInfo IntelIPListGetResponseEnvelopeResultInfo `json:"result_info"`
- JSON intelIPListGetResponseEnvelopeJSON `json:"-"`
-}
-
-// intelIPListGetResponseEnvelopeJSON contains the JSON metadata for the struct
-// [IntelIPListGetResponseEnvelope]
-type intelIPListGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- ResultInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelIPListGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelIPListGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type IntelIPListGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON intelIPListGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// intelIPListGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [IntelIPListGetResponseEnvelopeErrors]
-type intelIPListGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelIPListGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelIPListGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type IntelIPListGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON intelIPListGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// intelIPListGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [IntelIPListGetResponseEnvelopeMessages]
-type intelIPListGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelIPListGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelIPListGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type IntelIPListGetResponseEnvelopeSuccess bool
-
-const (
- IntelIPListGetResponseEnvelopeSuccessTrue IntelIPListGetResponseEnvelopeSuccess = true
-)
-
-type IntelIPListGetResponseEnvelopeResultInfo struct {
- // Total number of results for the requested service
- Count float64 `json:"count"`
- // Current page within paginated list of results
- Page float64 `json:"page"`
- // Number of results per page of results
- PerPage float64 `json:"per_page"`
- // Total results available without any search parameters
- TotalCount float64 `json:"total_count"`
- JSON intelIPListGetResponseEnvelopeResultInfoJSON `json:"-"`
-}
-
-// intelIPListGetResponseEnvelopeResultInfoJSON contains the JSON metadata for the
-// struct [IntelIPListGetResponseEnvelopeResultInfo]
-type intelIPListGetResponseEnvelopeResultInfoJSON struct {
- Count apijson.Field
- Page apijson.Field
- PerPage apijson.Field
- TotalCount apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelIPListGetResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelIPListGetResponseEnvelopeResultInfoJSON) RawJSON() string {
- return r.raw
-}
diff --git a/inteliplist_test.go b/inteliplist_test.go
deleted file mode 100644
index 2a12f64dc48..00000000000
--- a/inteliplist_test.go
+++ /dev/null
@@ -1,40 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestIntelIPListGet(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"),
- )
- _, err := client.Intel.IPLists.Get(context.TODO(), cloudflare.IntelIPListGetParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- })
- 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/intelmiscategorization.go b/intelmiscategorization.go
deleted file mode 100644
index aa2b942ab2f..00000000000
--- a/intelmiscategorization.go
+++ /dev/null
@@ -1,179 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "reflect"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/option"
- "github.com/tidwall/gjson"
-)
-
-// IntelMiscategorizationService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewIntelMiscategorizationService]
-// method instead.
-type IntelMiscategorizationService struct {
- Options []option.RequestOption
-}
-
-// NewIntelMiscategorizationService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewIntelMiscategorizationService(opts ...option.RequestOption) (r *IntelMiscategorizationService) {
- r = &IntelMiscategorizationService{}
- r.Options = opts
- return
-}
-
-// Create Miscategorization
-func (r *IntelMiscategorizationService) New(ctx context.Context, params IntelMiscategorizationNewParams, opts ...option.RequestOption) (res *IntelMiscategorizationNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env IntelMiscategorizationNewResponseEnvelope
- path := fmt.Sprintf("accounts/%s/intel/miscategorization", params.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Union satisfied by [IntelMiscategorizationNewResponseUnknown] or
-// [shared.UnionString].
-type IntelMiscategorizationNewResponse interface {
- ImplementsIntelMiscategorizationNewResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*IntelMiscategorizationNewResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-type IntelMiscategorizationNewParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
- // Content category IDs to add.
- ContentAdds param.Field[interface{}] `json:"content_adds"`
- // Content category IDs to remove.
- ContentRemoves param.Field[interface{}] `json:"content_removes"`
- IndicatorType param.Field[IntelMiscategorizationNewParamsIndicatorType] `json:"indicator_type"`
- // Provide only if indicator_type is `ipv4` or `ipv6`.
- IP param.Field[interface{}] `json:"ip"`
- // Security category IDs to add.
- SecurityAdds param.Field[interface{}] `json:"security_adds"`
- // Security category IDs to remove.
- SecurityRemoves param.Field[interface{}] `json:"security_removes"`
- // Provide only if indicator_type is `domain` or `url`. Example if indicator_type
- // is `domain`: `example.com`. Example if indicator_type is `url`:
- // `https://example.com/news/`.
- URL param.Field[string] `json:"url"`
-}
-
-func (r IntelMiscategorizationNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type IntelMiscategorizationNewParamsIndicatorType string
-
-const (
- IntelMiscategorizationNewParamsIndicatorTypeDomain IntelMiscategorizationNewParamsIndicatorType = "domain"
- IntelMiscategorizationNewParamsIndicatorTypeIPV4 IntelMiscategorizationNewParamsIndicatorType = "ipv4"
- IntelMiscategorizationNewParamsIndicatorTypeIPV6 IntelMiscategorizationNewParamsIndicatorType = "ipv6"
- IntelMiscategorizationNewParamsIndicatorTypeURL IntelMiscategorizationNewParamsIndicatorType = "url"
-)
-
-type IntelMiscategorizationNewResponseEnvelope struct {
- Errors []IntelMiscategorizationNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []IntelMiscategorizationNewResponseEnvelopeMessages `json:"messages,required"`
- Result IntelMiscategorizationNewResponse `json:"result,required"`
- // Whether the API call was successful
- Success IntelMiscategorizationNewResponseEnvelopeSuccess `json:"success,required"`
- JSON intelMiscategorizationNewResponseEnvelopeJSON `json:"-"`
-}
-
-// intelMiscategorizationNewResponseEnvelopeJSON contains the JSON metadata for the
-// struct [IntelMiscategorizationNewResponseEnvelope]
-type intelMiscategorizationNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelMiscategorizationNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelMiscategorizationNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type IntelMiscategorizationNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON intelMiscategorizationNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// intelMiscategorizationNewResponseEnvelopeErrorsJSON contains the JSON metadata
-// for the struct [IntelMiscategorizationNewResponseEnvelopeErrors]
-type intelMiscategorizationNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelMiscategorizationNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelMiscategorizationNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type IntelMiscategorizationNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON intelMiscategorizationNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// intelMiscategorizationNewResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [IntelMiscategorizationNewResponseEnvelopeMessages]
-type intelMiscategorizationNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelMiscategorizationNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelMiscategorizationNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type IntelMiscategorizationNewResponseEnvelopeSuccess bool
-
-const (
- IntelMiscategorizationNewResponseEnvelopeSuccessTrue IntelMiscategorizationNewResponseEnvelopeSuccess = true
-)
diff --git a/intelmiscategorization_test.go b/intelmiscategorization_test.go
deleted file mode 100644
index a2452f803b4..00000000000
--- a/intelmiscategorization_test.go
+++ /dev/null
@@ -1,56 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestIntelMiscategorizationNewWithOptionalParams(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"),
- )
- _, err := client.Intel.Miscategorizations.New(context.TODO(), cloudflare.IntelMiscategorizationNewParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- ContentAdds: cloudflare.F[any](map[string]interface{}{
- "0": int64(82),
- }),
- ContentRemoves: cloudflare.F[any](map[string]interface{}{
- "0": int64(155),
- }),
- IndicatorType: cloudflare.F(cloudflare.IntelMiscategorizationNewParamsIndicatorTypeDomain),
- IP: cloudflare.F[any](map[string]interface{}{}),
- SecurityAdds: cloudflare.F[any](map[string]interface{}{
- "0": int64(117),
- "1": int64(131),
- }),
- SecurityRemoves: cloudflare.F[any](map[string]interface{}{
- "0": int64(83),
- }),
- URL: cloudflare.F("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/intelsinkhole.go b/intelsinkhole.go
deleted file mode 100644
index 6e92afa5b51..00000000000
--- a/intelsinkhole.go
+++ /dev/null
@@ -1,172 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// IntelSinkholeService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewIntelSinkholeService] method
-// instead.
-type IntelSinkholeService struct {
- Options []option.RequestOption
-}
-
-// NewIntelSinkholeService generates a new service that applies the given options
-// to each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewIntelSinkholeService(opts ...option.RequestOption) (r *IntelSinkholeService) {
- r = &IntelSinkholeService{}
- r.Options = opts
- return
-}
-
-// List sinkholes owned by this account
-func (r *IntelSinkholeService) List(ctx context.Context, query IntelSinkholeListParams, opts ...option.RequestOption) (res *[]IntelSinkholeListResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env IntelSinkholeListResponseEnvelope
- path := fmt.Sprintf("accounts/%s/intel/sinkholes", query.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type IntelSinkholeListResponse struct {
- // The unique identifier for the sinkhole
- ID int64 `json:"id"`
- // The account tag that owns this sinkhole
- AccountTag string `json:"account_tag"`
- // The date and time when the sinkhole was created
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // The date and time when the sinkhole was last modified
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // The name of the sinkhole
- Name string `json:"name"`
- // The name of the R2 bucket to store results
- R2Bucket string `json:"r2_bucket"`
- // The id of the R2 instance
- R2ID string `json:"r2_id"`
- JSON intelSinkholeListResponseJSON `json:"-"`
-}
-
-// intelSinkholeListResponseJSON contains the JSON metadata for the struct
-// [IntelSinkholeListResponse]
-type intelSinkholeListResponseJSON struct {
- ID apijson.Field
- AccountTag apijson.Field
- CreatedOn apijson.Field
- ModifiedOn apijson.Field
- Name apijson.Field
- R2Bucket apijson.Field
- R2ID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelSinkholeListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelSinkholeListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type IntelSinkholeListParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type IntelSinkholeListResponseEnvelope struct {
- Errors []IntelSinkholeListResponseEnvelopeErrors `json:"errors,required"`
- Messages []IntelSinkholeListResponseEnvelopeMessages `json:"messages,required"`
- Result []IntelSinkholeListResponse `json:"result,required"`
- // Whether the API call was successful
- Success IntelSinkholeListResponseEnvelopeSuccess `json:"success,required"`
- JSON intelSinkholeListResponseEnvelopeJSON `json:"-"`
-}
-
-// intelSinkholeListResponseEnvelopeJSON contains the JSON metadata for the struct
-// [IntelSinkholeListResponseEnvelope]
-type intelSinkholeListResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelSinkholeListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelSinkholeListResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type IntelSinkholeListResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON intelSinkholeListResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// intelSinkholeListResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [IntelSinkholeListResponseEnvelopeErrors]
-type intelSinkholeListResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelSinkholeListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelSinkholeListResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type IntelSinkholeListResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON intelSinkholeListResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// intelSinkholeListResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [IntelSinkholeListResponseEnvelopeMessages]
-type intelSinkholeListResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelSinkholeListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelSinkholeListResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type IntelSinkholeListResponseEnvelopeSuccess bool
-
-const (
- IntelSinkholeListResponseEnvelopeSuccessTrue IntelSinkholeListResponseEnvelopeSuccess = true
-)
diff --git a/intelsinkhole_test.go b/intelsinkhole_test.go
deleted file mode 100644
index ed074c5f1a5..00000000000
--- a/intelsinkhole_test.go
+++ /dev/null
@@ -1,40 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestIntelSinkholeList(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"),
- )
- _, err := client.Intel.Sinkholes.List(context.TODO(), cloudflare.IntelSinkholeListParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- })
- 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/intelwhois.go b/intelwhois.go
deleted file mode 100644
index b73dc233f68..00000000000
--- a/intelwhois.go
+++ /dev/null
@@ -1,179 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// IntelWhoisService contains methods and other services that help with interacting
-// with the cloudflare API. Note, unlike clients, this service does not read
-// variables from the environment automatically. You should not instantiate this
-// service directly, and instead use the [NewIntelWhoisService] method instead.
-type IntelWhoisService struct {
- Options []option.RequestOption
-}
-
-// NewIntelWhoisService generates a new service that applies the given options to
-// each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewIntelWhoisService(opts ...option.RequestOption) (r *IntelWhoisService) {
- r = &IntelWhoisService{}
- r.Options = opts
- return
-}
-
-// Get WHOIS Record
-func (r *IntelWhoisService) Get(ctx context.Context, params IntelWhoisGetParams, opts ...option.RequestOption) (res *IntelWhoisGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env IntelWhoisGetResponseEnvelope
- path := fmt.Sprintf("accounts/%s/intel/whois", params.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type IntelWhoisGetResponse struct {
- CreatedDate time.Time `json:"created_date" format:"date"`
- Domain string `json:"domain"`
- Nameservers []string `json:"nameservers"`
- Registrant string `json:"registrant"`
- RegistrantCountry string `json:"registrant_country"`
- RegistrantEmail string `json:"registrant_email"`
- RegistrantOrg string `json:"registrant_org"`
- Registrar string `json:"registrar"`
- UpdatedDate time.Time `json:"updated_date" format:"date"`
- JSON intelWhoisGetResponseJSON `json:"-"`
-}
-
-// intelWhoisGetResponseJSON contains the JSON metadata for the struct
-// [IntelWhoisGetResponse]
-type intelWhoisGetResponseJSON struct {
- CreatedDate apijson.Field
- Domain apijson.Field
- Nameservers apijson.Field
- Registrant apijson.Field
- RegistrantCountry apijson.Field
- RegistrantEmail apijson.Field
- RegistrantOrg apijson.Field
- Registrar apijson.Field
- UpdatedDate apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelWhoisGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelWhoisGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type IntelWhoisGetParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
- Domain param.Field[string] `query:"domain"`
-}
-
-// URLQuery serializes [IntelWhoisGetParams]'s query parameters as `url.Values`.
-func (r IntelWhoisGetParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type IntelWhoisGetResponseEnvelope struct {
- Errors []IntelWhoisGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []IntelWhoisGetResponseEnvelopeMessages `json:"messages,required"`
- Result IntelWhoisGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success IntelWhoisGetResponseEnvelopeSuccess `json:"success,required"`
- JSON intelWhoisGetResponseEnvelopeJSON `json:"-"`
-}
-
-// intelWhoisGetResponseEnvelopeJSON contains the JSON metadata for the struct
-// [IntelWhoisGetResponseEnvelope]
-type intelWhoisGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelWhoisGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelWhoisGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type IntelWhoisGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON intelWhoisGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// intelWhoisGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [IntelWhoisGetResponseEnvelopeErrors]
-type intelWhoisGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelWhoisGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelWhoisGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type IntelWhoisGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON intelWhoisGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// intelWhoisGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [IntelWhoisGetResponseEnvelopeMessages]
-type intelWhoisGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IntelWhoisGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r intelWhoisGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type IntelWhoisGetResponseEnvelopeSuccess bool
-
-const (
- IntelWhoisGetResponseEnvelopeSuccessTrue IntelWhoisGetResponseEnvelopeSuccess = true
-)
diff --git a/intelwhois_test.go b/intelwhois_test.go
deleted file mode 100644
index 27a9efe97b4..00000000000
--- a/intelwhois_test.go
+++ /dev/null
@@ -1,41 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestIntelWhoisGetWithOptionalParams(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"),
- )
- _, err := client.Intel.Whois.Get(context.TODO(), cloudflare.IntelWhoisGetParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Domain: cloudflare.F("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/internal/shared/union.go b/internal/shared/union.go
index 05058cf3277..90eee425f62 100644
--- a/internal/shared/union.go
+++ b/internal/shared/union.go
@@ -4,320 +4,309 @@ package shared
type UnionString string
-func (UnionString) ImplementsAccountUpdateResponse() {}
-func (UnionString) ImplementsAccountGetResponse() {}
-func (UnionString) ImplementsAccountRoleGetResponse() {}
-func (UnionString) ImplementsCertificateNewResponse() {}
-func (UnionString) ImplementsCertificateGetResponse() {}
-func (UnionString) ImplementsMembershipUpdateResponse() {}
-func (UnionString) ImplementsMembershipGetResponse() {}
-func (UnionString) ImplementsUserEditResponse() {}
-func (UnionString) ImplementsUserGetResponse() {}
-func (UnionString) ImplementsUserAuditLogListResponse() {}
-func (UnionString) ImplementsUserBillingProfileGetResponse() {}
-func (UnionString) ImplementsUserInviteEditResponse() {}
-func (UnionString) ImplementsUserInviteGetResponse() {}
-func (UnionString) ImplementsUserLoadBalancerPoolHealthResponse() {}
-func (UnionString) ImplementsUserOrganizationGetResponse() {}
-func (UnionString) ImplementsUserSubscriptionUpdateResponse() {}
-func (UnionString) ImplementsUserSubscriptionEditResponse() {}
-func (UnionString) ImplementsUserTokenUpdateResponse() {}
-func (UnionString) ImplementsUserTokenGetResponse() {}
-func (UnionString) ImplementsZoneCustomNameserverUpdateResponse() {}
-func (UnionString) ImplementsZoneCustomNameserverGetResponse() {}
-func (UnionString) ImplementsZoneWorkerScriptUpdateResponse() {}
-func (UnionString) ImplementsZoneSubscriptionNewResponse() {}
-func (UnionString) ImplementsZoneSubscriptionGetResponse() {}
-func (UnionString) ImplementsLoadBalancerPoolHealthGetResponse() {}
-func (UnionString) ImplementsLoadBalancerRegionListResponse() {}
-func (UnionString) ImplementsLoadBalancerRegionGetResponse() {}
-func (UnionString) ImplementsCachePurgeParamsFile() {}
-func (UnionString) ImplementsCacheSmartTieredCachedDeleteResponse() {}
-func (UnionString) ImplementsCacheSmartTieredCachedEditResponse() {}
-func (UnionString) ImplementsCacheSmartTieredCachedGetResponse() {}
-func (UnionString) ImplementsSSLAnalyzeNewResponse() {}
-func (UnionString) ImplementsSSLCertificatePackGetResponse() {}
-func (UnionString) ImplementsSubscriptionNewResponse() {}
-func (UnionString) ImplementsSubscriptionUpdateResponse() {}
-func (UnionString) ImplementsSubscriptionGetResponse() {}
-func (UnionString) ImplementsArgoSmartRoutingEditResponse() {}
-func (UnionString) ImplementsArgoSmartRoutingGetResponse() {}
-func (UnionString) ImplementsArgoTieredCachingEditResponse() {}
-func (UnionString) ImplementsArgoTieredCachingGetResponse() {}
-func (UnionString) ImplementsCustomCertificateNewResponse() {}
-func (UnionString) ImplementsCustomCertificateEditResponse() {}
-func (UnionString) ImplementsCustomCertificateGetResponse() {}
-func (UnionString) ImplementsCustomHostnameFallbackOriginUpdateResponse() {}
-func (UnionString) ImplementsCustomHostnameFallbackOriginDeleteResponse() {}
-func (UnionString) ImplementsCustomHostnameFallbackOriginGetResponse() {}
-func (UnionString) ImplementsCustomNameserverDeleteResponse() {}
-func (UnionString) ImplementsDNSFirewallNewResponseDNSFirewallIP() {}
-func (UnionString) ImplementsDNSFirewallNewResponseUpstreamIP() {}
-func (UnionString) ImplementsDNSFirewallListResponseDNSFirewallIP() {}
-func (UnionString) ImplementsDNSFirewallListResponseUpstreamIP() {}
-func (UnionString) ImplementsDNSFirewallEditResponseDNSFirewallIP() {}
-func (UnionString) ImplementsDNSFirewallEditResponseUpstreamIP() {}
-func (UnionString) ImplementsDNSFirewallGetResponseDNSFirewallIP() {}
-func (UnionString) ImplementsDNSFirewallGetResponseUpstreamIP() {}
-func (UnionString) ImplementsDNSFirewallNewParamsUpstreamIP() {}
-func (UnionString) ImplementsDNSFirewallEditParamsDNSFirewallIP() {}
-func (UnionString) ImplementsDNSFirewallEditParamsUpstreamIP() {}
-func (UnionString) ImplementsDNSSECDeleteResponse() {}
-func (UnionString) ImplementsFirewallAccessRuleNewResponse() {}
-func (UnionString) ImplementsFirewallAccessRuleEditResponse() {}
-func (UnionString) ImplementsFirewallAccessRuleGetResponse() {}
-func (UnionString) ImplementsFirewallUARuleNewResponse() {}
-func (UnionString) ImplementsFirewallUARuleUpdateResponse() {}
-func (UnionString) ImplementsFirewallUARuleGetResponse() {}
-func (UnionString) ImplementsFirewallWAFPackageListResponseLegacyJhsAPIResponseCollectionResult() {}
-func (UnionString) ImplementsFirewallWAFPackageGetResponseLegacyJhsAPIResponseSingleResult() {}
-func (UnionString) ImplementsFirewallWAFPackageGroupEditResponse() {}
-func (UnionString) ImplementsFirewallWAFPackageGroupGetResponse() {}
-func (UnionString) ImplementsFirewallWAFPackageRuleGetResponse() {}
-func (UnionString) ImplementsLogpushJobDeleteResponse() {}
-func (UnionString) ImplementsLogControlCmbConfigDeleteResponse() {}
-func (UnionString) ImplementsLogRayidGetResponse() {}
-func (UnionString) ImplementsLogReceivedGetResponse() {}
-func (UnionString) ImplementsLogReceivedGetParamsEnd() {}
-func (UnionString) ImplementsLogReceivedGetParamsStart() {}
-func (UnionString) ImplementsOriginTLSClientAuthNewResponse() {}
-func (UnionString) ImplementsOriginTLSClientAuthDeleteResponse() {}
-func (UnionString) ImplementsOriginTLSClientAuthGetResponse() {}
-func (UnionString) ImplementsPageruleNewResponse() {}
-func (UnionString) ImplementsPageruleUpdateResponse() {}
-func (UnionString) ImplementsPageruleEditResponse() {}
-func (UnionString) ImplementsPageruleGetResponse() {}
-func (UnionString) ImplementsRateLimitNewResponse() {}
-func (UnionString) ImplementsRateLimitEditResponse() {}
-func (UnionString) ImplementsRateLimitGetResponse() {}
-func (UnionString) ImplementsWorkerScriptTailDeleteResponse() {}
-func (UnionString) ImplementsWorkerRouteNewResponse() {}
-func (UnionString) ImplementsWorkerRouteDeleteResponse() {}
-func (UnionString) ImplementsKVNamespaceUpdateResponse() {}
-func (UnionString) ImplementsKVNamespaceDeleteResponse() {}
-func (UnionString) ImplementsKVNamespaceBulkUpdateResponse() {}
-func (UnionString) ImplementsKVNamespaceBulkDeleteResponse() {}
-func (UnionString) ImplementsKVNamespaceValueUpdateResponse() {}
-func (UnionString) ImplementsKVNamespaceValueDeleteResponse() {}
-func (UnionString) ImplementsQueueDeleteResponse() {}
-func (UnionString) ImplementsQueueConsumerDeleteResponse() {}
-func (UnionString) ImplementsSpectrumAnalyticsEventBytimeGetResponse() {}
-func (UnionString) ImplementsSpectrumAnalyticsEventSummaryGetResponse() {}
-func (UnionString) ImplementsSpectrumAppNewResponseOriginPort() {}
-func (UnionString) ImplementsSpectrumAppUpdateResponseOriginPort() {}
-func (UnionString) ImplementsSpectrumAppGetResponse() {}
-func (UnionString) ImplementsSpectrumAppNewParamsOriginPort() {}
-func (UnionString) ImplementsSpectrumAppUpdateParamsOriginPort() {}
-func (UnionString) ImplementsAddressingAddressMapDeleteResponse() {}
-func (UnionString) ImplementsAddressingAddressMapAccountUpdateResponse() {}
-func (UnionString) ImplementsAddressingAddressMapAccountDeleteResponse() {}
-func (UnionString) ImplementsAddressingAddressMapIPUpdateResponse() {}
-func (UnionString) ImplementsAddressingAddressMapIPDeleteResponse() {}
-func (UnionString) ImplementsAddressingAddressMapZoneUpdateResponse() {}
-func (UnionString) ImplementsAddressingAddressMapZoneDeleteResponse() {}
-func (UnionString) ImplementsAddressingPrefixDeleteResponse() {}
-func (UnionString) ImplementsAddressingPrefixBGPBindingDeleteResponse() {}
-func (UnionString) ImplementsAuditLogListResponse() {}
-func (UnionString) ImplementsBillingProfileGetResponse() {}
-func (UnionString) ImplementsImageV1NewResponseVariant() {}
-func (UnionString) ImplementsImageV1ListResponseResultImagesVariant() {}
-func (UnionString) ImplementsImageV1DeleteResponse() {}
-func (UnionString) ImplementsImageV1EditResponseVariant() {}
-func (UnionString) ImplementsImageV1GetResponseVariant() {}
-func (UnionString) ImplementsImageV1VariantDeleteResponse() {}
-func (UnionString) ImplementsImageV2ListResponseImagesVariant() {}
-func (UnionString) ImplementsIntelIPGetResponseIP() {}
-func (UnionString) ImplementsIntelMiscategorizationNewResponse() {}
-func (UnionString) ImplementsPageProjectNewResponse() {}
-func (UnionString) ImplementsPageProjectEditResponse() {}
-func (UnionString) ImplementsPageProjectDeploymentHistoryLogGetResponse() {}
-func (UnionString) ImplementsPageProjectDomainNewResponse() {}
-func (UnionString) ImplementsPageProjectDomainEditResponse() {}
-func (UnionString) ImplementsPageProjectDomainGetResponse() {}
-func (UnionString) ImplementsRegistrarDomainUpdateResponse() {}
-func (UnionString) ImplementsRegistrarDomainGetResponse() {}
-func (UnionString) ImplementsRuleListItemGetResponse() {}
-func (UnionString) ImplementsStreamAudioTrackDeleteResponse() {}
-func (UnionString) ImplementsStreamKeyDeleteResponse() {}
-func (UnionString) ImplementsStreamWatermarkNewResponse() {}
-func (UnionString) ImplementsStreamWatermarkDeleteResponse() {}
-func (UnionString) ImplementsStreamWatermarkGetResponse() {}
-func (UnionString) ImplementsStreamWebhookUpdateResponse() {}
-func (UnionString) ImplementsStreamWebhookDeleteResponse() {}
-func (UnionString) ImplementsStreamWebhookGetResponse() {}
-func (UnionString) ImplementsStreamCaptionUpdateResponse() {}
-func (UnionString) ImplementsStreamCaptionDeleteResponse() {}
-func (UnionString) ImplementsStreamDownloadNewResponse() {}
-func (UnionString) ImplementsStreamDownloadDeleteResponse() {}
-func (UnionString) ImplementsStreamDownloadGetResponse() {}
-func (UnionString) ImplementsAlertingV3ListResponse() {}
-func (UnionString) ImplementsAlertingV3DestinationEligibleGetResponse() {}
-func (UnionString) ImplementsAlertingV3DestinationPagerdutyDeleteResponse() {}
-func (UnionString) ImplementsAlertingV3DestinationWebhookDeleteResponse() {}
-func (UnionString) ImplementsAlertingV3PolicyListResponseMechanismsID() {}
-func (UnionString) ImplementsAlertingV3PolicyDeleteResponse() {}
-func (UnionString) ImplementsAlertingV3PolicyGetResponseMechanismsID() {}
-func (UnionString) ImplementsAlertingV3PolicyNewParamsMechanismsID() {}
-func (UnionString) ImplementsAlertingV3PolicyUpdateParamsMechanismsID() {}
-func (UnionString) ImplementsD1DatabaseDeleteResponse() {}
-func (UnionString) ImplementsWARPConnectorTokenResponse() {}
-func (UnionString) ImplementsZeroTrustDeviceGetResponse() {}
-func (UnionString) ImplementsZeroTrustDevicePostureIntegrationDeleteResponse() {}
-func (UnionString) ImplementsZeroTrustDeviceRevokeNewResponse() {}
-func (UnionString) ImplementsZeroTrustDeviceUnrevokeNewResponse() {}
-func (UnionString) ImplementsZeroTrustAccessApplicationUpdateParamsAppID() {}
-func (UnionString) ImplementsZeroTrustAccessApplicationDeleteParamsAppID() {}
-func (UnionString) ImplementsZeroTrustAccessApplicationGetParamsAppID() {}
-func (UnionString) ImplementsZeroTrustAccessApplicationRevokeTokensParamsAppID() {}
-func (UnionString) ImplementsZeroTrustAccessApplicationCANewResponse() {}
-func (UnionString) ImplementsZeroTrustAccessApplicationCAGetResponse() {}
-func (UnionString) ImplementsZeroTrustAccessApplicationUserPolicyCheckListParamsAppID() {}
-func (UnionString) ImplementsZeroTrustAccessKeyUpdateResponse() {}
-func (UnionString) ImplementsZeroTrustAccessKeyListResponse() {}
-func (UnionString) ImplementsZeroTrustAccessKeyRotateResponse() {}
-func (UnionString) ImplementsZeroTrustTunnelConfigurationUpdateResponse() {}
-func (UnionString) ImplementsZeroTrustTunnelConfigurationGetResponse() {}
-func (UnionString) ImplementsZeroTrustTunnelConnectionDeleteResponse() {}
-func (UnionString) ImplementsZeroTrustTunnelTokenGetResponse() {}
-func (UnionString) ImplementsZeroTrustTunnelManagementNewResponse() {}
-func (UnionString) ImplementsZeroTrustDLPProfileCustomDeleteResponse() {}
-func (UnionString) ImplementsZeroTrustGatewayListDeleteResponse() {}
-func (UnionString) ImplementsZeroTrustGatewayLocationDeleteResponse() {}
-func (UnionString) ImplementsZeroTrustGatewayProxyEndpointDeleteResponse() {}
-func (UnionString) ImplementsZeroTrustGatewayRuleDeleteResponse() {}
-func (UnionString) ImplementsZeroTrustNetworkVirtualNetworkNewResponse() {}
-func (UnionString) ImplementsZeroTrustNetworkVirtualNetworkDeleteResponse() {}
-func (UnionString) ImplementsZeroTrustNetworkVirtualNetworkEditResponse() {}
-func (UnionString) ImplementsHyperdriveConfigDeleteResponse() {}
-func (UnionString) ImplementsVectorizeIndexDeleteResponse() {}
-func (UnionString) ImplementsRadarRankingTimeseriesGroupsResponseSerie0() {}
-func (UnionString) ImplementsOriginPostQuantumEncryptionUpdateResponse() {}
-func (UnionString) ImplementsOriginPostQuantumEncryptionGetResponse() {}
-func (UnionString) ImplementsHostnameSettingTLSUpdateResponseValue() {}
-func (UnionString) ImplementsHostnameSettingTLSGetResponseValue() {}
-func (UnionString) ImplementsHostnameSettingTLSUpdateParamsValue() {}
-func (UnionString) ImplementsSnippetDeleteResponse() {}
-func (UnionString) ImplementsCloudforceOneRequestDeleteResponse() {}
-func (UnionString) ImplementsCloudforceOneRequestMessageDeleteResponse() {}
-func (UnionString) ImplementsCloudforceOneRequestPriorityDeleteResponse() {}
+func (UnionString) ImplementsAccountsAccountUpdateResponse() {}
+func (UnionString) ImplementsAccountsAccountGetResponse() {}
+func (UnionString) ImplementsAccountsRoleGetResponse() {}
+func (UnionString) ImplementsCertificatesCertificateNewResponse() {}
+func (UnionString) ImplementsCertificatesCertificateGetResponse() {}
+func (UnionString) ImplementsMembershipsMembershipUpdateResponse() {}
+func (UnionString) ImplementsMembershipsMembershipGetResponse() {}
+func (UnionString) ImplementsUserUserEditResponse() {}
+func (UnionString) ImplementsUserUserGetResponse() {}
+func (UnionString) ImplementsUserAuditLogListResponse() {}
+func (UnionString) ImplementsUserBillingProfileGetResponse() {}
+func (UnionString) ImplementsUserInviteEditResponse() {}
+func (UnionString) ImplementsUserInviteGetResponse() {}
+func (UnionString) ImplementsUserLoadBalancerPoolHealthResponse() {}
+func (UnionString) ImplementsUserOrganizationGetResponse() {}
+func (UnionString) ImplementsUserSubscriptionUpdateResponse() {}
+func (UnionString) ImplementsUserSubscriptionEditResponse() {}
+func (UnionString) ImplementsUserTokenUpdateResponse() {}
+func (UnionString) ImplementsUserTokenGetResponse() {}
+func (UnionString) ImplementsZonesCustomNameserverUpdateResponse() {}
+func (UnionString) ImplementsZonesCustomNameserverGetResponse() {}
+func (UnionString) ImplementsZonesWorkerScriptUpdateResponse() {}
+func (UnionString) ImplementsZonesSubscriptionNewResponse() {}
+func (UnionString) ImplementsZonesSubscriptionGetResponse() {}
+func (UnionString) ImplementsLoadBalancersPoolHealthGetResponse() {}
+func (UnionString) ImplementsLoadBalancersRegionListResponse() {}
+func (UnionString) ImplementsLoadBalancersRegionGetResponse() {}
+func (UnionString) ImplementsCacheCachePurgeParamsFile() {}
+func (UnionString) ImplementsCacheSmartTieredCachedDeleteResponse() {}
+func (UnionString) ImplementsCacheSmartTieredCachedEditResponse() {}
+func (UnionString) ImplementsCacheSmartTieredCachedGetResponse() {}
+func (UnionString) ImplementsSSLAnalyzeNewResponse() {}
+func (UnionString) ImplementsSSLCertificatePackGetResponse() {}
+func (UnionString) ImplementsSubscriptionsSubscriptionNewResponse() {}
+func (UnionString) ImplementsSubscriptionsSubscriptionUpdateResponse() {}
+func (UnionString) ImplementsSubscriptionsSubscriptionGetResponse() {}
+func (UnionString) ImplementsArgoSmartRoutingEditResponse() {}
+func (UnionString) ImplementsArgoSmartRoutingGetResponse() {}
+func (UnionString) ImplementsArgoTieredCachingEditResponse() {}
+func (UnionString) ImplementsArgoTieredCachingGetResponse() {}
+func (UnionString) ImplementsCustomCertificatesCustomCertificateNewResponse() {}
+func (UnionString) ImplementsCustomCertificatesCustomCertificateEditResponse() {}
+func (UnionString) ImplementsCustomCertificatesCustomCertificateGetResponse() {}
+func (UnionString) ImplementsCustomHostnamesFallbackOriginUpdateResponse() {}
+func (UnionString) ImplementsCustomHostnamesFallbackOriginDeleteResponse() {}
+func (UnionString) ImplementsCustomHostnamesFallbackOriginGetResponse() {}
+func (UnionString) ImplementsCustomNameserversCustomNameserverDeleteResponse() {}
+func (UnionString) ImplementsDNSDNSFirewallDNSFirewallDNSFirewallIP() {}
+func (UnionString) ImplementsDNSDNSFirewallDNSFirewallUpstreamIP() {}
+func (UnionString) ImplementsDNSFirewallNewParamsUpstreamIP() {}
+func (UnionString) ImplementsDNSFirewallEditParamsDNSFirewallIP() {}
+func (UnionString) ImplementsDNSFirewallEditParamsUpstreamIP() {}
+func (UnionString) ImplementsDNSSECDNSSECDeleteResponse() {}
+func (UnionString) ImplementsFirewallAccessRuleNewResponse() {}
+func (UnionString) ImplementsFirewallAccessRuleEditResponse() {}
+func (UnionString) ImplementsFirewallAccessRuleGetResponse() {}
+func (UnionString) ImplementsFirewallUARuleNewResponse() {}
+func (UnionString) ImplementsFirewallUARuleUpdateResponse() {}
+func (UnionString) ImplementsFirewallUARuleGetResponse() {}
+func (UnionString) ImplementsFirewallWAFPackageListResponseLegacyJhsAPIResponseCollectionResult() {}
+func (UnionString) ImplementsFirewallWAFPackageGetResponseLegacyJhsAPIResponseSingleResult() {}
+func (UnionString) ImplementsFirewallWAFPackageGroupEditResponse() {}
+func (UnionString) ImplementsFirewallWAFPackageGroupGetResponse() {}
+func (UnionString) ImplementsFirewallWAFPackageRuleGetResponse() {}
+func (UnionString) ImplementsLogpushJobDeleteResponse() {}
+func (UnionString) ImplementsLogsControlCmbConfigDeleteResponse() {}
+func (UnionString) ImplementsLogsRayidGetResponse() {}
+func (UnionString) ImplementsLogsReceivedGetResponse() {}
+func (UnionString) ImplementsLogsReceivedGetParamsEnd() {}
+func (UnionString) ImplementsLogsReceivedGetParamsStart() {}
+func (UnionString) ImplementsOriginTLSClientAuthOriginTLSClientAuthNewResponse() {}
+func (UnionString) ImplementsOriginTLSClientAuthOriginTLSClientAuthDeleteResponse() {}
+func (UnionString) ImplementsOriginTLSClientAuthOriginTLSClientAuthGetResponse() {}
+func (UnionString) ImplementsPagerulesPageruleNewResponse() {}
+func (UnionString) ImplementsPagerulesPageruleUpdateResponse() {}
+func (UnionString) ImplementsPagerulesPageruleEditResponse() {}
+func (UnionString) ImplementsPagerulesPageruleGetResponse() {}
+func (UnionString) ImplementsRateLimitsRateLimitNewResponse() {}
+func (UnionString) ImplementsRateLimitsRateLimitEditResponse() {}
+func (UnionString) ImplementsRateLimitsRateLimitGetResponse() {}
+func (UnionString) ImplementsWorkersScriptTailDeleteResponse() {}
+func (UnionString) ImplementsWorkersRouteNewResponse() {}
+func (UnionString) ImplementsWorkersRouteDeleteResponse() {}
+func (UnionString) ImplementsKVNamespaceUpdateResponse() {}
+func (UnionString) ImplementsKVNamespaceDeleteResponse() {}
+func (UnionString) ImplementsKVNamespaceBulkUpdateResponse() {}
+func (UnionString) ImplementsKVNamespaceBulkDeleteResponse() {}
+func (UnionString) ImplementsKVNamespaceValueUpdateResponse() {}
+func (UnionString) ImplementsKVNamespaceValueDeleteResponse() {}
+func (UnionString) ImplementsQueuesQueueDeleteResponse() {}
+func (UnionString) ImplementsQueuesConsumerDeleteResponse() {}
+func (UnionString) ImplementsSpectrumAnalyticsEventBytimeGetResponse() {}
+func (UnionString) ImplementsSpectrumAnalyticsEventSummaryGetResponse() {}
+func (UnionString) ImplementsSpectrumAppNewResponseOriginPort() {}
+func (UnionString) ImplementsSpectrumAppUpdateResponseOriginPort() {}
+func (UnionString) ImplementsSpectrumAppGetResponse() {}
+func (UnionString) ImplementsSpectrumAppNewParamsOriginPort() {}
+func (UnionString) ImplementsSpectrumAppUpdateParamsOriginPort() {}
+func (UnionString) ImplementsAddressingAddressMapDeleteResponse() {}
+func (UnionString) ImplementsAddressingAddressMapAccountUpdateResponse() {}
+func (UnionString) ImplementsAddressingAddressMapAccountDeleteResponse() {}
+func (UnionString) ImplementsAddressingAddressMapIPUpdateResponse() {}
+func (UnionString) ImplementsAddressingAddressMapIPDeleteResponse() {}
+func (UnionString) ImplementsAddressingAddressMapZoneUpdateResponse() {}
+func (UnionString) ImplementsAddressingAddressMapZoneDeleteResponse() {}
+func (UnionString) ImplementsAddressingPrefixDeleteResponse() {}
+func (UnionString) ImplementsAddressingPrefixBGPBindingDeleteResponse() {}
+func (UnionString) ImplementsAuditLogsAuditLogListResponse() {}
+func (UnionString) ImplementsBillingProfileGetResponse() {}
+func (UnionString) ImplementsImagesImagesImageVariant() {}
+func (UnionString) ImplementsImagesV1DeleteResponse() {}
+func (UnionString) ImplementsImagesV1VariantDeleteResponse() {}
+func (UnionString) ImplementsIntelIntelSchemasIpip() {}
+func (UnionString) ImplementsIntelMiscategorizationNewResponse() {}
+func (UnionString) ImplementsPagesProjectNewResponse() {}
+func (UnionString) ImplementsPagesProjectEditResponse() {}
+func (UnionString) ImplementsPagesProjectDeploymentHistoryLogGetResponse() {}
+func (UnionString) ImplementsPagesProjectDomainNewResponse() {}
+func (UnionString) ImplementsPagesProjectDomainEditResponse() {}
+func (UnionString) ImplementsPagesProjectDomainGetResponse() {}
+func (UnionString) ImplementsRegistrarDomainUpdateResponse() {}
+func (UnionString) ImplementsRegistrarDomainGetResponse() {}
+func (UnionString) ImplementsRulesListItemGetResponse() {}
+func (UnionString) ImplementsStreamAudioTrackDeleteResponse() {}
+func (UnionString) ImplementsStreamKeyDeleteResponse() {}
+func (UnionString) ImplementsStreamWatermarkNewResponse() {}
+func (UnionString) ImplementsStreamWatermarkDeleteResponse() {}
+func (UnionString) ImplementsStreamWatermarkGetResponse() {}
+func (UnionString) ImplementsStreamWebhookUpdateResponse() {}
+func (UnionString) ImplementsStreamWebhookDeleteResponse() {}
+func (UnionString) ImplementsStreamWebhookGetResponse() {}
+func (UnionString) ImplementsStreamCaptionUpdateResponse() {}
+func (UnionString) ImplementsStreamCaptionDeleteResponse() {}
+func (UnionString) ImplementsStreamDownloadNewResponse() {}
+func (UnionString) ImplementsStreamDownloadDeleteResponse() {}
+func (UnionString) ImplementsStreamDownloadGetResponse() {}
+func (UnionString) ImplementsAlertingV3ListResponse() {}
+func (UnionString) ImplementsAlertingV3DestinationEligibleGetResponse() {}
+func (UnionString) ImplementsAlertingV3DestinationPagerdutyDeleteResponse() {}
+func (UnionString) ImplementsAlertingV3DestinationWebhookDeleteResponse() {}
+func (UnionString) ImplementsAlertingAaaPoliciesMechanismsID() {}
+func (UnionString) ImplementsAlertingV3PolicyDeleteResponse() {}
+func (UnionString) ImplementsAlertingV3PolicyNewParamsMechanismsID() {}
+func (UnionString) ImplementsAlertingV3PolicyUpdateParamsMechanismsID() {}
+func (UnionString) ImplementsD1DatabaseDeleteResponse() {}
+func (UnionString) ImplementsWARPConnectorWARPConnectorTokenResponse() {}
+func (UnionString) ImplementsZeroTrustDeviceGetResponse() {}
+func (UnionString) ImplementsZeroTrustDevicePostureIntegrationDeleteResponse() {}
+func (UnionString) ImplementsZeroTrustDeviceRevokeNewResponse() {}
+func (UnionString) ImplementsZeroTrustDeviceUnrevokeNewResponse() {}
+func (UnionString) ImplementsZeroTrustAccessApplicationUpdateParamsAppID() {}
+func (UnionString) ImplementsZeroTrustAccessApplicationDeleteParamsAppID() {}
+func (UnionString) ImplementsZeroTrustAccessApplicationGetParamsAppID() {}
+func (UnionString) ImplementsZeroTrustAccessApplicationRevokeTokensParamsAppID() {}
+func (UnionString) ImplementsZeroTrustAccessApplicationCANewResponse() {}
+func (UnionString) ImplementsZeroTrustAccessApplicationCAGetResponse() {}
+func (UnionString) ImplementsZeroTrustAccessApplicationUserPolicyCheckListParamsAppID() {}
+func (UnionString) ImplementsZeroTrustAccessKeyUpdateResponse() {}
+func (UnionString) ImplementsZeroTrustAccessKeyListResponse() {}
+func (UnionString) ImplementsZeroTrustAccessKeyRotateResponse() {}
+func (UnionString) ImplementsZeroTrustTunnelConfigurationUpdateResponse() {}
+func (UnionString) ImplementsZeroTrustTunnelConfigurationGetResponse() {}
+func (UnionString) ImplementsZeroTrustTunnelConnectionDeleteResponse() {}
+func (UnionString) ImplementsZeroTrustTunnelTokenGetResponse() {}
+func (UnionString) ImplementsZeroTrustTunnelManagementNewResponse() {}
+func (UnionString) ImplementsZeroTrustDLPProfileCustomDeleteResponse() {}
+func (UnionString) ImplementsZeroTrustGatewayListDeleteResponse() {}
+func (UnionString) ImplementsZeroTrustGatewayLocationDeleteResponse() {}
+func (UnionString) ImplementsZeroTrustGatewayProxyEndpointDeleteResponse() {}
+func (UnionString) ImplementsZeroTrustGatewayRuleDeleteResponse() {}
+func (UnionString) ImplementsZeroTrustNetworkVirtualNetworkNewResponse() {}
+func (UnionString) ImplementsZeroTrustNetworkVirtualNetworkDeleteResponse() {}
+func (UnionString) ImplementsZeroTrustNetworkVirtualNetworkEditResponse() {}
+func (UnionString) ImplementsHyperdriveConfigDeleteResponse() {}
+func (UnionString) ImplementsVectorizeIndexDeleteResponse() {}
+func (UnionString) ImplementsRadarRankingTimeseriesGroupsResponseSerie0() {}
+func (UnionString) ImplementsOriginPostQuantumEncryptionOriginPostQuantumEncryptionUpdateResponse() {}
+func (UnionString) ImplementsOriginPostQuantumEncryptionOriginPostQuantumEncryptionGetResponse() {}
+func (UnionString) ImplementsHostnamesTLSCertificatesAndHostnamesSettingObjectValue() {}
+func (UnionString) ImplementsHostnamesSettingTLSGetResponseValue() {}
+func (UnionString) ImplementsHostnamesSettingTLSUpdateParamsValue() {}
+func (UnionString) ImplementsSnippetsSnippetDeleteResponse() {}
+func (UnionString) ImplementsCloudforceOneRequestDeleteResponse() {}
+func (UnionString) ImplementsCloudforceOneRequestMessageDeleteResponse() {}
+func (UnionString) ImplementsCloudforceOneRequestPriorityDeleteResponse() {}
type UnionInt int64
-func (UnionInt) ImplementsLogReceivedGetParamsEnd() {}
-func (UnionInt) ImplementsLogReceivedGetParamsStart() {}
+func (UnionInt) ImplementsLogsReceivedGetParamsEnd() {}
+func (UnionInt) ImplementsLogsReceivedGetParamsStart() {}
func (UnionInt) ImplementsSpectrumAppNewResponseOriginPort() {}
func (UnionInt) ImplementsSpectrumAppUpdateResponseOriginPort() {}
func (UnionInt) ImplementsSpectrumAppNewParamsOriginPort() {}
func (UnionInt) ImplementsSpectrumAppUpdateParamsOriginPort() {}
-func (UnionInt) ImplementsRuleListItemGetResponse() {}
+func (UnionInt) ImplementsRulesListItemGetResponse() {}
type UnionFloat float64
-func (UnionFloat) ImplementsDNSRecordNewResponseAttl() {}
-func (UnionFloat) ImplementsDNSRecordNewResponseAaaattl() {}
-func (UnionFloat) ImplementsDNSRecordNewResponseCaattl() {}
-func (UnionFloat) ImplementsDNSRecordNewResponseCertTTL() {}
-func (UnionFloat) ImplementsDNSRecordNewResponseCnamettl() {}
-func (UnionFloat) ImplementsDNSRecordNewResponseDnskeyttl() {}
-func (UnionFloat) ImplementsDNSRecordNewResponseDsttl() {}
-func (UnionFloat) ImplementsDNSRecordNewResponseHttpsttl() {}
-func (UnionFloat) ImplementsDNSRecordNewResponseLocttl() {}
-func (UnionFloat) ImplementsDNSRecordNewResponseMxttl() {}
-func (UnionFloat) ImplementsDNSRecordNewResponseNaptrttl() {}
-func (UnionFloat) ImplementsDNSRecordNewResponseNsttl() {}
-func (UnionFloat) ImplementsDNSRecordNewResponsePtrttl() {}
-func (UnionFloat) ImplementsDNSRecordNewResponseSmimeaTTL() {}
-func (UnionFloat) ImplementsDNSRecordNewResponseSrvttl() {}
-func (UnionFloat) ImplementsDNSRecordNewResponseSshfpttl() {}
-func (UnionFloat) ImplementsDNSRecordNewResponseSvcbttl() {}
-func (UnionFloat) ImplementsDNSRecordNewResponseTlsattl() {}
-func (UnionFloat) ImplementsDNSRecordNewResponseTxtttl() {}
-func (UnionFloat) ImplementsDNSRecordNewResponseUrittl() {}
-func (UnionFloat) ImplementsDNSRecordUpdateResponseAttl() {}
-func (UnionFloat) ImplementsDNSRecordUpdateResponseAaaattl() {}
-func (UnionFloat) ImplementsDNSRecordUpdateResponseCaattl() {}
-func (UnionFloat) ImplementsDNSRecordUpdateResponseCertTTL() {}
-func (UnionFloat) ImplementsDNSRecordUpdateResponseCnamettl() {}
-func (UnionFloat) ImplementsDNSRecordUpdateResponseDnskeyttl() {}
-func (UnionFloat) ImplementsDNSRecordUpdateResponseDsttl() {}
-func (UnionFloat) ImplementsDNSRecordUpdateResponseHttpsttl() {}
-func (UnionFloat) ImplementsDNSRecordUpdateResponseLocttl() {}
-func (UnionFloat) ImplementsDNSRecordUpdateResponseMxttl() {}
-func (UnionFloat) ImplementsDNSRecordUpdateResponseNaptrttl() {}
-func (UnionFloat) ImplementsDNSRecordUpdateResponseNsttl() {}
-func (UnionFloat) ImplementsDNSRecordUpdateResponsePtrttl() {}
-func (UnionFloat) ImplementsDNSRecordUpdateResponseSmimeaTTL() {}
-func (UnionFloat) ImplementsDNSRecordUpdateResponseSrvttl() {}
-func (UnionFloat) ImplementsDNSRecordUpdateResponseSshfpttl() {}
-func (UnionFloat) ImplementsDNSRecordUpdateResponseSvcbttl() {}
-func (UnionFloat) ImplementsDNSRecordUpdateResponseTlsattl() {}
-func (UnionFloat) ImplementsDNSRecordUpdateResponseTxtttl() {}
-func (UnionFloat) ImplementsDNSRecordUpdateResponseUrittl() {}
-func (UnionFloat) ImplementsDNSRecordListResponseAttl() {}
-func (UnionFloat) ImplementsDNSRecordListResponseAaaattl() {}
-func (UnionFloat) ImplementsDNSRecordListResponseCaattl() {}
-func (UnionFloat) ImplementsDNSRecordListResponseCertTTL() {}
-func (UnionFloat) ImplementsDNSRecordListResponseCnamettl() {}
-func (UnionFloat) ImplementsDNSRecordListResponseDnskeyttl() {}
-func (UnionFloat) ImplementsDNSRecordListResponseDsttl() {}
-func (UnionFloat) ImplementsDNSRecordListResponseHttpsttl() {}
-func (UnionFloat) ImplementsDNSRecordListResponseLocttl() {}
-func (UnionFloat) ImplementsDNSRecordListResponseMxttl() {}
-func (UnionFloat) ImplementsDNSRecordListResponseNaptrttl() {}
-func (UnionFloat) ImplementsDNSRecordListResponseNsttl() {}
-func (UnionFloat) ImplementsDNSRecordListResponsePtrttl() {}
-func (UnionFloat) ImplementsDNSRecordListResponseSmimeaTTL() {}
-func (UnionFloat) ImplementsDNSRecordListResponseSrvttl() {}
-func (UnionFloat) ImplementsDNSRecordListResponseSshfpttl() {}
-func (UnionFloat) ImplementsDNSRecordListResponseSvcbttl() {}
-func (UnionFloat) ImplementsDNSRecordListResponseTlsattl() {}
-func (UnionFloat) ImplementsDNSRecordListResponseTxtttl() {}
-func (UnionFloat) ImplementsDNSRecordListResponseUrittl() {}
-func (UnionFloat) ImplementsDNSRecordEditResponseAttl() {}
-func (UnionFloat) ImplementsDNSRecordEditResponseAaaattl() {}
-func (UnionFloat) ImplementsDNSRecordEditResponseCaattl() {}
-func (UnionFloat) ImplementsDNSRecordEditResponseCertTTL() {}
-func (UnionFloat) ImplementsDNSRecordEditResponseCnamettl() {}
-func (UnionFloat) ImplementsDNSRecordEditResponseDnskeyttl() {}
-func (UnionFloat) ImplementsDNSRecordEditResponseDsttl() {}
-func (UnionFloat) ImplementsDNSRecordEditResponseHttpsttl() {}
-func (UnionFloat) ImplementsDNSRecordEditResponseLocttl() {}
-func (UnionFloat) ImplementsDNSRecordEditResponseMxttl() {}
-func (UnionFloat) ImplementsDNSRecordEditResponseNaptrttl() {}
-func (UnionFloat) ImplementsDNSRecordEditResponseNsttl() {}
-func (UnionFloat) ImplementsDNSRecordEditResponsePtrttl() {}
-func (UnionFloat) ImplementsDNSRecordEditResponseSmimeaTTL() {}
-func (UnionFloat) ImplementsDNSRecordEditResponseSrvttl() {}
-func (UnionFloat) ImplementsDNSRecordEditResponseSshfpttl() {}
-func (UnionFloat) ImplementsDNSRecordEditResponseSvcbttl() {}
-func (UnionFloat) ImplementsDNSRecordEditResponseTlsattl() {}
-func (UnionFloat) ImplementsDNSRecordEditResponseTxtttl() {}
-func (UnionFloat) ImplementsDNSRecordEditResponseUrittl() {}
-func (UnionFloat) ImplementsDNSRecordGetResponseAttl() {}
-func (UnionFloat) ImplementsDNSRecordGetResponseAaaattl() {}
-func (UnionFloat) ImplementsDNSRecordGetResponseCaattl() {}
-func (UnionFloat) ImplementsDNSRecordGetResponseCertTTL() {}
-func (UnionFloat) ImplementsDNSRecordGetResponseCnamettl() {}
-func (UnionFloat) ImplementsDNSRecordGetResponseDnskeyttl() {}
-func (UnionFloat) ImplementsDNSRecordGetResponseDsttl() {}
-func (UnionFloat) ImplementsDNSRecordGetResponseHttpsttl() {}
-func (UnionFloat) ImplementsDNSRecordGetResponseLocttl() {}
-func (UnionFloat) ImplementsDNSRecordGetResponseMxttl() {}
-func (UnionFloat) ImplementsDNSRecordGetResponseNaptrttl() {}
-func (UnionFloat) ImplementsDNSRecordGetResponseNsttl() {}
-func (UnionFloat) ImplementsDNSRecordGetResponsePtrttl() {}
-func (UnionFloat) ImplementsDNSRecordGetResponseSmimeaTTL() {}
-func (UnionFloat) ImplementsDNSRecordGetResponseSrvttl() {}
-func (UnionFloat) ImplementsDNSRecordGetResponseSshfpttl() {}
-func (UnionFloat) ImplementsDNSRecordGetResponseSvcbttl() {}
-func (UnionFloat) ImplementsDNSRecordGetResponseTlsattl() {}
-func (UnionFloat) ImplementsDNSRecordGetResponseTxtttl() {}
-func (UnionFloat) ImplementsDNSRecordGetResponseUrittl() {}
-func (UnionFloat) ImplementsDNSRecordNewParamsTTL() {}
-func (UnionFloat) ImplementsDNSRecordUpdateParamsTTL() {}
-func (UnionFloat) ImplementsDNSRecordEditParamsTTL() {}
-func (UnionFloat) ImplementsEmailRoutingRoutingDNSGetResponseTTL() {}
-func (UnionFloat) ImplementsRadarRankingTimeseriesGroupsResponseSerie0() {}
-func (UnionFloat) ImplementsHostnameSettingTLSUpdateResponseValue() {}
-func (UnionFloat) ImplementsHostnameSettingTLSGetResponseValue() {}
-func (UnionFloat) ImplementsHostnameSettingTLSUpdateParamsValue() {}
+func (UnionFloat) ImplementsDNSRecordNewResponseAttl() {}
+func (UnionFloat) ImplementsDNSRecordNewResponseAaaattl() {}
+func (UnionFloat) ImplementsDNSRecordNewResponseCaattl() {}
+func (UnionFloat) ImplementsDNSRecordNewResponseCertTTL() {}
+func (UnionFloat) ImplementsDNSRecordNewResponseCnamettl() {}
+func (UnionFloat) ImplementsDNSRecordNewResponseDnskeyttl() {}
+func (UnionFloat) ImplementsDNSRecordNewResponseDsttl() {}
+func (UnionFloat) ImplementsDNSRecordNewResponseHttpsttl() {}
+func (UnionFloat) ImplementsDNSRecordNewResponseLocttl() {}
+func (UnionFloat) ImplementsDNSRecordNewResponseMxttl() {}
+func (UnionFloat) ImplementsDNSRecordNewResponseNaptrttl() {}
+func (UnionFloat) ImplementsDNSRecordNewResponseNsttl() {}
+func (UnionFloat) ImplementsDNSRecordNewResponsePtrttl() {}
+func (UnionFloat) ImplementsDNSRecordNewResponseSmimeaTTL() {}
+func (UnionFloat) ImplementsDNSRecordNewResponseSrvttl() {}
+func (UnionFloat) ImplementsDNSRecordNewResponseSshfpttl() {}
+func (UnionFloat) ImplementsDNSRecordNewResponseSvcbttl() {}
+func (UnionFloat) ImplementsDNSRecordNewResponseTlsattl() {}
+func (UnionFloat) ImplementsDNSRecordNewResponseTxtttl() {}
+func (UnionFloat) ImplementsDNSRecordNewResponseUrittl() {}
+func (UnionFloat) ImplementsDNSRecordUpdateResponseAttl() {}
+func (UnionFloat) ImplementsDNSRecordUpdateResponseAaaattl() {}
+func (UnionFloat) ImplementsDNSRecordUpdateResponseCaattl() {}
+func (UnionFloat) ImplementsDNSRecordUpdateResponseCertTTL() {}
+func (UnionFloat) ImplementsDNSRecordUpdateResponseCnamettl() {}
+func (UnionFloat) ImplementsDNSRecordUpdateResponseDnskeyttl() {}
+func (UnionFloat) ImplementsDNSRecordUpdateResponseDsttl() {}
+func (UnionFloat) ImplementsDNSRecordUpdateResponseHttpsttl() {}
+func (UnionFloat) ImplementsDNSRecordUpdateResponseLocttl() {}
+func (UnionFloat) ImplementsDNSRecordUpdateResponseMxttl() {}
+func (UnionFloat) ImplementsDNSRecordUpdateResponseNaptrttl() {}
+func (UnionFloat) ImplementsDNSRecordUpdateResponseNsttl() {}
+func (UnionFloat) ImplementsDNSRecordUpdateResponsePtrttl() {}
+func (UnionFloat) ImplementsDNSRecordUpdateResponseSmimeaTTL() {}
+func (UnionFloat) ImplementsDNSRecordUpdateResponseSrvttl() {}
+func (UnionFloat) ImplementsDNSRecordUpdateResponseSshfpttl() {}
+func (UnionFloat) ImplementsDNSRecordUpdateResponseSvcbttl() {}
+func (UnionFloat) ImplementsDNSRecordUpdateResponseTlsattl() {}
+func (UnionFloat) ImplementsDNSRecordUpdateResponseTxtttl() {}
+func (UnionFloat) ImplementsDNSRecordUpdateResponseUrittl() {}
+func (UnionFloat) ImplementsDNSRecordListResponseAttl() {}
+func (UnionFloat) ImplementsDNSRecordListResponseAaaattl() {}
+func (UnionFloat) ImplementsDNSRecordListResponseCaattl() {}
+func (UnionFloat) ImplementsDNSRecordListResponseCertTTL() {}
+func (UnionFloat) ImplementsDNSRecordListResponseCnamettl() {}
+func (UnionFloat) ImplementsDNSRecordListResponseDnskeyttl() {}
+func (UnionFloat) ImplementsDNSRecordListResponseDsttl() {}
+func (UnionFloat) ImplementsDNSRecordListResponseHttpsttl() {}
+func (UnionFloat) ImplementsDNSRecordListResponseLocttl() {}
+func (UnionFloat) ImplementsDNSRecordListResponseMxttl() {}
+func (UnionFloat) ImplementsDNSRecordListResponseNaptrttl() {}
+func (UnionFloat) ImplementsDNSRecordListResponseNsttl() {}
+func (UnionFloat) ImplementsDNSRecordListResponsePtrttl() {}
+func (UnionFloat) ImplementsDNSRecordListResponseSmimeaTTL() {}
+func (UnionFloat) ImplementsDNSRecordListResponseSrvttl() {}
+func (UnionFloat) ImplementsDNSRecordListResponseSshfpttl() {}
+func (UnionFloat) ImplementsDNSRecordListResponseSvcbttl() {}
+func (UnionFloat) ImplementsDNSRecordListResponseTlsattl() {}
+func (UnionFloat) ImplementsDNSRecordListResponseTxtttl() {}
+func (UnionFloat) ImplementsDNSRecordListResponseUrittl() {}
+func (UnionFloat) ImplementsDNSRecordEditResponseAttl() {}
+func (UnionFloat) ImplementsDNSRecordEditResponseAaaattl() {}
+func (UnionFloat) ImplementsDNSRecordEditResponseCaattl() {}
+func (UnionFloat) ImplementsDNSRecordEditResponseCertTTL() {}
+func (UnionFloat) ImplementsDNSRecordEditResponseCnamettl() {}
+func (UnionFloat) ImplementsDNSRecordEditResponseDnskeyttl() {}
+func (UnionFloat) ImplementsDNSRecordEditResponseDsttl() {}
+func (UnionFloat) ImplementsDNSRecordEditResponseHttpsttl() {}
+func (UnionFloat) ImplementsDNSRecordEditResponseLocttl() {}
+func (UnionFloat) ImplementsDNSRecordEditResponseMxttl() {}
+func (UnionFloat) ImplementsDNSRecordEditResponseNaptrttl() {}
+func (UnionFloat) ImplementsDNSRecordEditResponseNsttl() {}
+func (UnionFloat) ImplementsDNSRecordEditResponsePtrttl() {}
+func (UnionFloat) ImplementsDNSRecordEditResponseSmimeaTTL() {}
+func (UnionFloat) ImplementsDNSRecordEditResponseSrvttl() {}
+func (UnionFloat) ImplementsDNSRecordEditResponseSshfpttl() {}
+func (UnionFloat) ImplementsDNSRecordEditResponseSvcbttl() {}
+func (UnionFloat) ImplementsDNSRecordEditResponseTlsattl() {}
+func (UnionFloat) ImplementsDNSRecordEditResponseTxtttl() {}
+func (UnionFloat) ImplementsDNSRecordEditResponseUrittl() {}
+func (UnionFloat) ImplementsDNSRecordGetResponseAttl() {}
+func (UnionFloat) ImplementsDNSRecordGetResponseAaaattl() {}
+func (UnionFloat) ImplementsDNSRecordGetResponseCaattl() {}
+func (UnionFloat) ImplementsDNSRecordGetResponseCertTTL() {}
+func (UnionFloat) ImplementsDNSRecordGetResponseCnamettl() {}
+func (UnionFloat) ImplementsDNSRecordGetResponseDnskeyttl() {}
+func (UnionFloat) ImplementsDNSRecordGetResponseDsttl() {}
+func (UnionFloat) ImplementsDNSRecordGetResponseHttpsttl() {}
+func (UnionFloat) ImplementsDNSRecordGetResponseLocttl() {}
+func (UnionFloat) ImplementsDNSRecordGetResponseMxttl() {}
+func (UnionFloat) ImplementsDNSRecordGetResponseNaptrttl() {}
+func (UnionFloat) ImplementsDNSRecordGetResponseNsttl() {}
+func (UnionFloat) ImplementsDNSRecordGetResponsePtrttl() {}
+func (UnionFloat) ImplementsDNSRecordGetResponseSmimeaTTL() {}
+func (UnionFloat) ImplementsDNSRecordGetResponseSrvttl() {}
+func (UnionFloat) ImplementsDNSRecordGetResponseSshfpttl() {}
+func (UnionFloat) ImplementsDNSRecordGetResponseSvcbttl() {}
+func (UnionFloat) ImplementsDNSRecordGetResponseTlsattl() {}
+func (UnionFloat) ImplementsDNSRecordGetResponseTxtttl() {}
+func (UnionFloat) ImplementsDNSRecordGetResponseUrittl() {}
+func (UnionFloat) ImplementsDNSRecordNewParamsTTL() {}
+func (UnionFloat) ImplementsDNSRecordUpdateParamsTTL() {}
+func (UnionFloat) ImplementsDNSRecordEditParamsTTL() {}
+func (UnionFloat) ImplementsEmailRoutingEmailDNSRecordTTL() {}
+func (UnionFloat) ImplementsRadarRankingTimeseriesGroupsResponseSerie0() {}
+func (UnionFloat) ImplementsHostnamesTLSCertificatesAndHostnamesSettingObjectValue() {}
+func (UnionFloat) ImplementsHostnamesSettingTLSGetResponseValue() {}
+func (UnionFloat) ImplementsHostnamesSettingTLSUpdateParamsValue() {}
diff --git a/internal/version.go b/internal/version.go
index cd1452de975..13dfb6cd613 100644
--- a/internal/version.go
+++ b/internal/version.go
@@ -2,4 +2,4 @@
package internal
-const PackageVersion = "0.1.0" // x-release-please-version
+const PackageVersion = "2.0.0-beta.1" // x-release-please-version
diff --git a/ip.go b/ip.go
deleted file mode 100644
index 20114cad120..00000000000
--- a/ip.go
+++ /dev/null
@@ -1,225 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "net/http"
- "net/url"
- "reflect"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
- "github.com/tidwall/gjson"
-)
-
-// IPService contains methods and other services that help with interacting with
-// the cloudflare API. Note, unlike clients, this service does not read variables
-// from the environment automatically. You should not instantiate this service
-// directly, and instead use the [NewIPService] method instead.
-type IPService struct {
- Options []option.RequestOption
-}
-
-// NewIPService generates a new service that applies the given options to each
-// request. These options are applied after the parent client's options (if there
-// is one), and before any request-specific options.
-func NewIPService(opts ...option.RequestOption) (r *IPService) {
- r = &IPService{}
- r.Options = opts
- return
-}
-
-// Get IPs used on the Cloudflare/JD Cloud network, see
-// https://www.cloudflare.com/ips for Cloudflare IPs or
-// https://developers.cloudflare.com/china-network/reference/infrastructure/ for JD
-// Cloud IPs.
-func (r *IPService) List(ctx context.Context, query IPListParams, opts ...option.RequestOption) (res *IPListResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env IPListResponseEnvelope
- path := "ips"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type IPs struct {
- // A digest of the IP data. Useful for determining if the data has changed.
- Etag string `json:"etag"`
- // List of Cloudflare IPv4 CIDR addresses.
- IPV4Cidrs []string `json:"ipv4_cidrs"`
- // List of Cloudflare IPv6 CIDR addresses.
- IPV6Cidrs []string `json:"ipv6_cidrs"`
- JSON ipsJSON `json:"-"`
-}
-
-// ipsJSON contains the JSON metadata for the struct [IPs]
-type ipsJSON struct {
- Etag apijson.Field
- IPV4Cidrs apijson.Field
- IPV6Cidrs apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IPs) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ipsJSON) RawJSON() string {
- return r.raw
-}
-
-func (r IPs) implementsIPListResponse() {}
-
-type JdcloudIPs struct {
- // A digest of the IP data. Useful for determining if the data has changed.
- Etag string `json:"etag"`
- // List of Cloudflare IPv4 CIDR addresses.
- IPV4Cidrs []string `json:"ipv4_cidrs"`
- // List of Cloudflare IPv6 CIDR addresses.
- IPV6Cidrs []string `json:"ipv6_cidrs"`
- // List IPv4 and IPv6 CIDRs, only populated if `?networks=jdcloud` is used.
- JdcloudCidrs []string `json:"jdcloud_cidrs"`
- JSON jdcloudIPsJSON `json:"-"`
-}
-
-// jdcloudIPsJSON contains the JSON metadata for the struct [JdcloudIPs]
-type jdcloudIPsJSON struct {
- Etag apijson.Field
- IPV4Cidrs apijson.Field
- IPV6Cidrs apijson.Field
- JdcloudCidrs apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *JdcloudIPs) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r jdcloudIPsJSON) RawJSON() string {
- return r.raw
-}
-
-func (r JdcloudIPs) implementsIPListResponse() {}
-
-// Union satisfied by [IPs] or [JdcloudIPs].
-type IPListResponse interface {
- implementsIPListResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*IPListResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(IPs{}),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(JdcloudIPs{}),
- },
- )
-}
-
-type IPListParams struct {
- // Specified as `jdcloud` to list IPs used by JD Cloud data centers.
- Networks param.Field[string] `query:"networks"`
-}
-
-// URLQuery serializes [IPListParams]'s query parameters as `url.Values`.
-func (r IPListParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type IPListResponseEnvelope struct {
- Errors []IPListResponseEnvelopeErrors `json:"errors,required"`
- Messages []IPListResponseEnvelopeMessages `json:"messages,required"`
- Result IPListResponse `json:"result,required"`
- // Whether the API call was successful
- Success IPListResponseEnvelopeSuccess `json:"success,required"`
- JSON ipListResponseEnvelopeJSON `json:"-"`
-}
-
-// ipListResponseEnvelopeJSON contains the JSON metadata for the struct
-// [IPListResponseEnvelope]
-type ipListResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IPListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ipListResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type IPListResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON ipListResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// ipListResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
-// [IPListResponseEnvelopeErrors]
-type ipListResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IPListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ipListResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type IPListResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON ipListResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// ipListResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
-// [IPListResponseEnvelopeMessages]
-type ipListResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *IPListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ipListResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type IPListResponseEnvelopeSuccess bool
-
-const (
- IPListResponseEnvelopeSuccessTrue IPListResponseEnvelopeSuccess = true
-)
diff --git a/ip_test.go b/ip_test.go
deleted file mode 100644
index d200c7fbb47..00000000000
--- a/ip_test.go
+++ /dev/null
@@ -1,40 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestIPListWithOptionalParams(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"),
- )
- _, err := client.IPs.List(context.TODO(), cloudflare.IPListParams{
- Networks: cloudflare.F("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/ips/aliases.go b/ips/aliases.go
new file mode 100644
index 00000000000..668d73037fc
--- /dev/null
+++ b/ips/aliases.go
@@ -0,0 +1,9 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package ips
+
+import (
+ "github.com/cloudflare/cloudflare-go/internal/apierror"
+)
+
+type Error = apierror.Error
diff --git a/ips/ip.go b/ips/ip.go
new file mode 100644
index 00000000000..9eb454f2458
--- /dev/null
+++ b/ips/ip.go
@@ -0,0 +1,225 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package ips
+
+import (
+ "context"
+ "net/http"
+ "net/url"
+ "reflect"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/tidwall/gjson"
+)
+
+// IPService contains methods and other services that help with interacting with
+// the cloudflare API. Note, unlike clients, this service does not read variables
+// from the environment automatically. You should not instantiate this service
+// directly, and instead use the [NewIPService] method instead.
+type IPService struct {
+ Options []option.RequestOption
+}
+
+// NewIPService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewIPService(opts ...option.RequestOption) (r *IPService) {
+ r = &IPService{}
+ r.Options = opts
+ return
+}
+
+// Get IPs used on the Cloudflare/JD Cloud network, see
+// https://www.cloudflare.com/ips for Cloudflare IPs or
+// https://developers.cloudflare.com/china-network/reference/infrastructure/ for JD
+// Cloud IPs.
+func (r *IPService) List(ctx context.Context, query IPListParams, opts ...option.RequestOption) (res *IPListResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env IPListResponseEnvelope
+ path := "ips"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type IPs struct {
+ // A digest of the IP data. Useful for determining if the data has changed.
+ Etag string `json:"etag"`
+ // List of Cloudflare IPv4 CIDR addresses.
+ IPV4Cidrs []string `json:"ipv4_cidrs"`
+ // List of Cloudflare IPv6 CIDR addresses.
+ IPV6Cidrs []string `json:"ipv6_cidrs"`
+ JSON ipsJSON `json:"-"`
+}
+
+// ipsJSON contains the JSON metadata for the struct [IPs]
+type ipsJSON struct {
+ Etag apijson.Field
+ IPV4Cidrs apijson.Field
+ IPV6Cidrs apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IPs) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ipsJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r IPs) implementsIPsIPListResponse() {}
+
+type JdcloudIPs struct {
+ // A digest of the IP data. Useful for determining if the data has changed.
+ Etag string `json:"etag"`
+ // List of Cloudflare IPv4 CIDR addresses.
+ IPV4Cidrs []string `json:"ipv4_cidrs"`
+ // List of Cloudflare IPv6 CIDR addresses.
+ IPV6Cidrs []string `json:"ipv6_cidrs"`
+ // List IPv4 and IPv6 CIDRs, only populated if `?networks=jdcloud` is used.
+ JdcloudCidrs []string `json:"jdcloud_cidrs"`
+ JSON jdcloudIPsJSON `json:"-"`
+}
+
+// jdcloudIPsJSON contains the JSON metadata for the struct [JdcloudIPs]
+type jdcloudIPsJSON struct {
+ Etag apijson.Field
+ IPV4Cidrs apijson.Field
+ IPV6Cidrs apijson.Field
+ JdcloudCidrs apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *JdcloudIPs) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r jdcloudIPsJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r JdcloudIPs) implementsIPsIPListResponse() {}
+
+// Union satisfied by [ips.IPs] or [ips.JdcloudIPs].
+type IPListResponse interface {
+ implementsIPsIPListResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*IPListResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(IPs{}),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(JdcloudIPs{}),
+ },
+ )
+}
+
+type IPListParams struct {
+ // Specified as `jdcloud` to list IPs used by JD Cloud data centers.
+ Networks param.Field[string] `query:"networks"`
+}
+
+// URLQuery serializes [IPListParams]'s query parameters as `url.Values`.
+func (r IPListParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type IPListResponseEnvelope struct {
+ Errors []IPListResponseEnvelopeErrors `json:"errors,required"`
+ Messages []IPListResponseEnvelopeMessages `json:"messages,required"`
+ Result IPListResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success IPListResponseEnvelopeSuccess `json:"success,required"`
+ JSON ipListResponseEnvelopeJSON `json:"-"`
+}
+
+// ipListResponseEnvelopeJSON contains the JSON metadata for the struct
+// [IPListResponseEnvelope]
+type ipListResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IPListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ipListResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type IPListResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON ipListResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// ipListResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [IPListResponseEnvelopeErrors]
+type ipListResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IPListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ipListResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type IPListResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON ipListResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// ipListResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [IPListResponseEnvelopeMessages]
+type ipListResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IPListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ipListResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type IPListResponseEnvelopeSuccess bool
+
+const (
+ IPListResponseEnvelopeSuccessTrue IPListResponseEnvelopeSuccess = true
+)
diff --git a/ips/ip_test.go b/ips/ip_test.go
new file mode 100644
index 00000000000..8d96f7bfd36
--- /dev/null
+++ b/ips/ip_test.go
@@ -0,0 +1,41 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package ips_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/ips"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestIPListWithOptionalParams(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"),
+ )
+ _, err := client.IPs.List(context.TODO(), ips.IPListParams{
+ Networks: cloudflare.F("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/keyless_certificates/aliases.go b/keyless_certificates/aliases.go
new file mode 100644
index 00000000000..417a7eea0ee
--- /dev/null
+++ b/keyless_certificates/aliases.go
@@ -0,0 +1,9 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package keyless_certificates
+
+import (
+ "github.com/cloudflare/cloudflare-go/internal/apierror"
+)
+
+type Error = apierror.Error
diff --git a/keyless_certificates/keylesscertificate.go b/keyless_certificates/keylesscertificate.go
new file mode 100644
index 00000000000..aaa39f6ed22
--- /dev/null
+++ b/keyless_certificates/keylesscertificate.go
@@ -0,0 +1,740 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package keyless_certificates
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// KeylessCertificateService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewKeylessCertificateService] method
+// instead.
+type KeylessCertificateService struct {
+ Options []option.RequestOption
+}
+
+// NewKeylessCertificateService generates a new service that applies the given
+// options to each request. These options are applied after the parent client's
+// options (if there is one), and before any request-specific options.
+func NewKeylessCertificateService(opts ...option.RequestOption) (r *KeylessCertificateService) {
+ r = &KeylessCertificateService{}
+ r.Options = opts
+ return
+}
+
+// Create Keyless SSL Configuration
+func (r *KeylessCertificateService) New(ctx context.Context, params KeylessCertificateNewParams, opts ...option.RequestOption) (res *TLSCertificatesAndHostnamesBase, err error) {
+ opts = append(r.Options[:], opts...)
+ var env KeylessCertificateNewResponseEnvelope
+ path := fmt.Sprintf("zones/%s/keyless_certificates", params.ZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// List all Keyless SSL configurations for a given zone.
+func (r *KeylessCertificateService) List(ctx context.Context, query KeylessCertificateListParams, opts ...option.RequestOption) (res *[]TLSCertificatesAndHostnamesBase, err error) {
+ opts = append(r.Options[:], opts...)
+ var env KeylessCertificateListResponseEnvelope
+ path := fmt.Sprintf("zones/%s/keyless_certificates", query.ZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Delete Keyless SSL Configuration
+func (r *KeylessCertificateService) Delete(ctx context.Context, keylessCertificateID string, body KeylessCertificateDeleteParams, opts ...option.RequestOption) (res *KeylessCertificateDeleteResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env KeylessCertificateDeleteResponseEnvelope
+ path := fmt.Sprintf("zones/%s/keyless_certificates/%s", body.ZoneID, keylessCertificateID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// This will update attributes of a Keyless SSL. Consists of one or more of the
+// following: host,name,port.
+func (r *KeylessCertificateService) Edit(ctx context.Context, keylessCertificateID string, params KeylessCertificateEditParams, opts ...option.RequestOption) (res *TLSCertificatesAndHostnamesBase, err error) {
+ opts = append(r.Options[:], opts...)
+ var env KeylessCertificateEditResponseEnvelope
+ path := fmt.Sprintf("zones/%s/keyless_certificates/%s", params.ZoneID, keylessCertificateID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Get details for one Keyless SSL configuration.
+func (r *KeylessCertificateService) Get(ctx context.Context, keylessCertificateID string, query KeylessCertificateGetParams, opts ...option.RequestOption) (res *TLSCertificatesAndHostnamesBase, err error) {
+ opts = append(r.Options[:], opts...)
+ var env KeylessCertificateGetResponseEnvelope
+ path := fmt.Sprintf("zones/%s/keyless_certificates/%s", query.ZoneID, keylessCertificateID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type TLSCertificatesAndHostnamesBase struct {
+ // Keyless certificate identifier tag.
+ ID string `json:"id,required"`
+ // When the Keyless SSL was created.
+ CreatedOn time.Time `json:"created_on,required" format:"date-time"`
+ // Whether or not the Keyless SSL is on or off.
+ Enabled bool `json:"enabled,required"`
+ // The keyless SSL name.
+ Host string `json:"host,required" format:"hostname"`
+ // When the Keyless SSL was last modified.
+ ModifiedOn time.Time `json:"modified_on,required" format:"date-time"`
+ // The keyless SSL name.
+ Name string `json:"name,required"`
+ // Available permissions for the Keyless SSL for the current user requesting the
+ // item.
+ Permissions []interface{} `json:"permissions,required"`
+ // The keyless SSL port used to communicate between Cloudflare and the client's
+ // Keyless SSL server.
+ Port float64 `json:"port,required"`
+ // Status of the Keyless SSL.
+ Status TLSCertificatesAndHostnamesBaseStatus `json:"status,required"`
+ // Configuration for using Keyless SSL through a Cloudflare Tunnel
+ Tunnel TLSCertificatesAndHostnamesBaseTunnel `json:"tunnel"`
+ JSON tlsCertificatesAndHostnamesBaseJSON `json:"-"`
+}
+
+// tlsCertificatesAndHostnamesBaseJSON contains the JSON metadata for the struct
+// [TLSCertificatesAndHostnamesBase]
+type tlsCertificatesAndHostnamesBaseJSON struct {
+ ID apijson.Field
+ CreatedOn apijson.Field
+ Enabled apijson.Field
+ Host apijson.Field
+ ModifiedOn apijson.Field
+ Name apijson.Field
+ Permissions apijson.Field
+ Port apijson.Field
+ Status apijson.Field
+ Tunnel apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *TLSCertificatesAndHostnamesBase) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r tlsCertificatesAndHostnamesBaseJSON) RawJSON() string {
+ return r.raw
+}
+
+// Status of the Keyless SSL.
+type TLSCertificatesAndHostnamesBaseStatus string
+
+const (
+ TLSCertificatesAndHostnamesBaseStatusActive TLSCertificatesAndHostnamesBaseStatus = "active"
+ TLSCertificatesAndHostnamesBaseStatusDeleted TLSCertificatesAndHostnamesBaseStatus = "deleted"
+)
+
+// Configuration for using Keyless SSL through a Cloudflare Tunnel
+type TLSCertificatesAndHostnamesBaseTunnel struct {
+ // Private IP of the Key Server Host
+ PrivateIP string `json:"private_ip,required"`
+ // Cloudflare Tunnel Virtual Network ID
+ VnetID string `json:"vnet_id,required"`
+ JSON tlsCertificatesAndHostnamesBaseTunnelJSON `json:"-"`
+}
+
+// tlsCertificatesAndHostnamesBaseTunnelJSON contains the JSON metadata for the
+// struct [TLSCertificatesAndHostnamesBaseTunnel]
+type tlsCertificatesAndHostnamesBaseTunnelJSON struct {
+ PrivateIP apijson.Field
+ VnetID apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *TLSCertificatesAndHostnamesBaseTunnel) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r tlsCertificatesAndHostnamesBaseTunnelJSON) RawJSON() string {
+ return r.raw
+}
+
+type KeylessCertificateDeleteResponse struct {
+ // Identifier
+ ID string `json:"id"`
+ JSON keylessCertificateDeleteResponseJSON `json:"-"`
+}
+
+// keylessCertificateDeleteResponseJSON contains the JSON metadata for the struct
+// [KeylessCertificateDeleteResponse]
+type keylessCertificateDeleteResponseJSON struct {
+ ID apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *KeylessCertificateDeleteResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r keylessCertificateDeleteResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type KeylessCertificateNewParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+ // The zone's SSL certificate or SSL certificate and intermediate(s).
+ Certificate param.Field[string] `json:"certificate,required"`
+ // The keyless SSL name.
+ Host param.Field[string] `json:"host,required" format:"hostname"`
+ // The keyless SSL port used to communicate between Cloudflare and the client's
+ // Keyless SSL server.
+ Port param.Field[float64] `json:"port,required"`
+ // A ubiquitous bundle has the highest probability of being verified everywhere,
+ // even by clients using outdated or unusual trust stores. An optimal bundle uses
+ // the shortest chain and newest intermediates. And the force bundle verifies the
+ // chain, but does not otherwise modify it.
+ BundleMethod param.Field[KeylessCertificateNewParamsBundleMethod] `json:"bundle_method"`
+ // The keyless SSL name.
+ Name param.Field[string] `json:"name"`
+ // Configuration for using Keyless SSL through a Cloudflare Tunnel
+ Tunnel param.Field[KeylessCertificateNewParamsTunnel] `json:"tunnel"`
+}
+
+func (r KeylessCertificateNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// A ubiquitous bundle has the highest probability of being verified everywhere,
+// even by clients using outdated or unusual trust stores. An optimal bundle uses
+// the shortest chain and newest intermediates. And the force bundle verifies the
+// chain, but does not otherwise modify it.
+type KeylessCertificateNewParamsBundleMethod string
+
+const (
+ KeylessCertificateNewParamsBundleMethodUbiquitous KeylessCertificateNewParamsBundleMethod = "ubiquitous"
+ KeylessCertificateNewParamsBundleMethodOptimal KeylessCertificateNewParamsBundleMethod = "optimal"
+ KeylessCertificateNewParamsBundleMethodForce KeylessCertificateNewParamsBundleMethod = "force"
+)
+
+// Configuration for using Keyless SSL through a Cloudflare Tunnel
+type KeylessCertificateNewParamsTunnel struct {
+ // Private IP of the Key Server Host
+ PrivateIP param.Field[string] `json:"private_ip,required"`
+ // Cloudflare Tunnel Virtual Network ID
+ VnetID param.Field[string] `json:"vnet_id,required"`
+}
+
+func (r KeylessCertificateNewParamsTunnel) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type KeylessCertificateNewResponseEnvelope struct {
+ Errors []KeylessCertificateNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []KeylessCertificateNewResponseEnvelopeMessages `json:"messages,required"`
+ Result TLSCertificatesAndHostnamesBase `json:"result,required"`
+ // Whether the API call was successful
+ Success KeylessCertificateNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON keylessCertificateNewResponseEnvelopeJSON `json:"-"`
+}
+
+// keylessCertificateNewResponseEnvelopeJSON contains the JSON metadata for the
+// struct [KeylessCertificateNewResponseEnvelope]
+type keylessCertificateNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *KeylessCertificateNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r keylessCertificateNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type KeylessCertificateNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON keylessCertificateNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// keylessCertificateNewResponseEnvelopeErrorsJSON contains the JSON metadata for
+// the struct [KeylessCertificateNewResponseEnvelopeErrors]
+type keylessCertificateNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *KeylessCertificateNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r keylessCertificateNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type KeylessCertificateNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON keylessCertificateNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// keylessCertificateNewResponseEnvelopeMessagesJSON contains the JSON metadata for
+// the struct [KeylessCertificateNewResponseEnvelopeMessages]
+type keylessCertificateNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *KeylessCertificateNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r keylessCertificateNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type KeylessCertificateNewResponseEnvelopeSuccess bool
+
+const (
+ KeylessCertificateNewResponseEnvelopeSuccessTrue KeylessCertificateNewResponseEnvelopeSuccess = true
+)
+
+type KeylessCertificateListParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+}
+
+type KeylessCertificateListResponseEnvelope struct {
+ Errors []KeylessCertificateListResponseEnvelopeErrors `json:"errors,required"`
+ Messages []KeylessCertificateListResponseEnvelopeMessages `json:"messages,required"`
+ Result []TLSCertificatesAndHostnamesBase `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success KeylessCertificateListResponseEnvelopeSuccess `json:"success,required"`
+ ResultInfo KeylessCertificateListResponseEnvelopeResultInfo `json:"result_info"`
+ JSON keylessCertificateListResponseEnvelopeJSON `json:"-"`
+}
+
+// keylessCertificateListResponseEnvelopeJSON contains the JSON metadata for the
+// struct [KeylessCertificateListResponseEnvelope]
+type keylessCertificateListResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ ResultInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *KeylessCertificateListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r keylessCertificateListResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type KeylessCertificateListResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON keylessCertificateListResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// keylessCertificateListResponseEnvelopeErrorsJSON contains the JSON metadata for
+// the struct [KeylessCertificateListResponseEnvelopeErrors]
+type keylessCertificateListResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *KeylessCertificateListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r keylessCertificateListResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type KeylessCertificateListResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON keylessCertificateListResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// keylessCertificateListResponseEnvelopeMessagesJSON contains the JSON metadata
+// for the struct [KeylessCertificateListResponseEnvelopeMessages]
+type keylessCertificateListResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *KeylessCertificateListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r keylessCertificateListResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type KeylessCertificateListResponseEnvelopeSuccess bool
+
+const (
+ KeylessCertificateListResponseEnvelopeSuccessTrue KeylessCertificateListResponseEnvelopeSuccess = true
+)
+
+type KeylessCertificateListResponseEnvelopeResultInfo struct {
+ // Total number of results for the requested service
+ Count float64 `json:"count"`
+ // Current page within paginated list of results
+ Page float64 `json:"page"`
+ // Number of results per page of results
+ PerPage float64 `json:"per_page"`
+ // Total results available without any search parameters
+ TotalCount float64 `json:"total_count"`
+ JSON keylessCertificateListResponseEnvelopeResultInfoJSON `json:"-"`
+}
+
+// keylessCertificateListResponseEnvelopeResultInfoJSON contains the JSON metadata
+// for the struct [KeylessCertificateListResponseEnvelopeResultInfo]
+type keylessCertificateListResponseEnvelopeResultInfoJSON struct {
+ Count apijson.Field
+ Page apijson.Field
+ PerPage apijson.Field
+ TotalCount apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *KeylessCertificateListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r keylessCertificateListResponseEnvelopeResultInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type KeylessCertificateDeleteParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+}
+
+type KeylessCertificateDeleteResponseEnvelope struct {
+ Errors []KeylessCertificateDeleteResponseEnvelopeErrors `json:"errors,required"`
+ Messages []KeylessCertificateDeleteResponseEnvelopeMessages `json:"messages,required"`
+ Result KeylessCertificateDeleteResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success KeylessCertificateDeleteResponseEnvelopeSuccess `json:"success,required"`
+ JSON keylessCertificateDeleteResponseEnvelopeJSON `json:"-"`
+}
+
+// keylessCertificateDeleteResponseEnvelopeJSON contains the JSON metadata for the
+// struct [KeylessCertificateDeleteResponseEnvelope]
+type keylessCertificateDeleteResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *KeylessCertificateDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r keylessCertificateDeleteResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type KeylessCertificateDeleteResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON keylessCertificateDeleteResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// keylessCertificateDeleteResponseEnvelopeErrorsJSON contains the JSON metadata
+// for the struct [KeylessCertificateDeleteResponseEnvelopeErrors]
+type keylessCertificateDeleteResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *KeylessCertificateDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r keylessCertificateDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type KeylessCertificateDeleteResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON keylessCertificateDeleteResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// keylessCertificateDeleteResponseEnvelopeMessagesJSON contains the JSON metadata
+// for the struct [KeylessCertificateDeleteResponseEnvelopeMessages]
+type keylessCertificateDeleteResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *KeylessCertificateDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r keylessCertificateDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type KeylessCertificateDeleteResponseEnvelopeSuccess bool
+
+const (
+ KeylessCertificateDeleteResponseEnvelopeSuccessTrue KeylessCertificateDeleteResponseEnvelopeSuccess = true
+)
+
+type KeylessCertificateEditParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+ // Whether or not the Keyless SSL is on or off.
+ Enabled param.Field[bool] `json:"enabled"`
+ // The keyless SSL name.
+ Host param.Field[string] `json:"host" format:"hostname"`
+ // The keyless SSL name.
+ Name param.Field[string] `json:"name"`
+ // The keyless SSL port used to communicate between Cloudflare and the client's
+ // Keyless SSL server.
+ Port param.Field[float64] `json:"port"`
+ // Configuration for using Keyless SSL through a Cloudflare Tunnel
+ Tunnel param.Field[KeylessCertificateEditParamsTunnel] `json:"tunnel"`
+}
+
+func (r KeylessCertificateEditParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Configuration for using Keyless SSL through a Cloudflare Tunnel
+type KeylessCertificateEditParamsTunnel struct {
+ // Private IP of the Key Server Host
+ PrivateIP param.Field[string] `json:"private_ip,required"`
+ // Cloudflare Tunnel Virtual Network ID
+ VnetID param.Field[string] `json:"vnet_id,required"`
+}
+
+func (r KeylessCertificateEditParamsTunnel) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type KeylessCertificateEditResponseEnvelope struct {
+ Errors []KeylessCertificateEditResponseEnvelopeErrors `json:"errors,required"`
+ Messages []KeylessCertificateEditResponseEnvelopeMessages `json:"messages,required"`
+ Result TLSCertificatesAndHostnamesBase `json:"result,required"`
+ // Whether the API call was successful
+ Success KeylessCertificateEditResponseEnvelopeSuccess `json:"success,required"`
+ JSON keylessCertificateEditResponseEnvelopeJSON `json:"-"`
+}
+
+// keylessCertificateEditResponseEnvelopeJSON contains the JSON metadata for the
+// struct [KeylessCertificateEditResponseEnvelope]
+type keylessCertificateEditResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *KeylessCertificateEditResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r keylessCertificateEditResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type KeylessCertificateEditResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON keylessCertificateEditResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// keylessCertificateEditResponseEnvelopeErrorsJSON contains the JSON metadata for
+// the struct [KeylessCertificateEditResponseEnvelopeErrors]
+type keylessCertificateEditResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *KeylessCertificateEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r keylessCertificateEditResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type KeylessCertificateEditResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON keylessCertificateEditResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// keylessCertificateEditResponseEnvelopeMessagesJSON contains the JSON metadata
+// for the struct [KeylessCertificateEditResponseEnvelopeMessages]
+type keylessCertificateEditResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *KeylessCertificateEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r keylessCertificateEditResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type KeylessCertificateEditResponseEnvelopeSuccess bool
+
+const (
+ KeylessCertificateEditResponseEnvelopeSuccessTrue KeylessCertificateEditResponseEnvelopeSuccess = true
+)
+
+type KeylessCertificateGetParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+}
+
+type KeylessCertificateGetResponseEnvelope struct {
+ Errors []KeylessCertificateGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []KeylessCertificateGetResponseEnvelopeMessages `json:"messages,required"`
+ Result TLSCertificatesAndHostnamesBase `json:"result,required"`
+ // Whether the API call was successful
+ Success KeylessCertificateGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON keylessCertificateGetResponseEnvelopeJSON `json:"-"`
+}
+
+// keylessCertificateGetResponseEnvelopeJSON contains the JSON metadata for the
+// struct [KeylessCertificateGetResponseEnvelope]
+type keylessCertificateGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *KeylessCertificateGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r keylessCertificateGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type KeylessCertificateGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON keylessCertificateGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// keylessCertificateGetResponseEnvelopeErrorsJSON contains the JSON metadata for
+// the struct [KeylessCertificateGetResponseEnvelopeErrors]
+type keylessCertificateGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *KeylessCertificateGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r keylessCertificateGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type KeylessCertificateGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON keylessCertificateGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// keylessCertificateGetResponseEnvelopeMessagesJSON contains the JSON metadata for
+// the struct [KeylessCertificateGetResponseEnvelopeMessages]
+type keylessCertificateGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *KeylessCertificateGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r keylessCertificateGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type KeylessCertificateGetResponseEnvelopeSuccess bool
+
+const (
+ KeylessCertificateGetResponseEnvelopeSuccessTrue KeylessCertificateGetResponseEnvelopeSuccess = true
+)
diff --git a/keylesscertificate_test.go b/keyless_certificates/keylesscertificate_test.go
similarity index 89%
rename from keylesscertificate_test.go
rename to keyless_certificates/keylesscertificate_test.go
index a1e9c891da2..f1627872031 100644
--- a/keylesscertificate_test.go
+++ b/keyless_certificates/keylesscertificate_test.go
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package cloudflare_test
+package keyless_certificates_test
import (
"context"
@@ -10,6 +10,7 @@ import (
"github.com/cloudflare/cloudflare-go"
"github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/keyless_certificates"
"github.com/cloudflare/cloudflare-go/option"
)
@@ -27,14 +28,14 @@ func TestKeylessCertificateNewWithOptionalParams(t *testing.T) {
option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"),
option.WithAPIEmail("user@example.com"),
)
- _, err := client.KeylessCertificates.New(context.TODO(), cloudflare.KeylessCertificateNewParams{
+ _, err := client.KeylessCertificates.New(context.TODO(), keyless_certificates.KeylessCertificateNewParams{
ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
Certificate: cloudflare.F("-----BEGIN CERTIFICATE----- MIIDtTCCAp2gAwIBAgIJAM15n7fdxhRtMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNV BAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX aWRnaXRzIFB0eSBMdGQwHhcNMTQwMzExMTkyMTU5WhcNMTQwNDEwMTkyMTU5WjBF MQswCQYDVQQGEwJVUzETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50 ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB CgKCAQEAvq3sKsHpeduJHimOK+fvQdKsI8z8A05MZyyLp2/R/GE8FjNv+hkVY1WQ LIyTNNQH7CJecE1nbTfo8Y56S7x/rhxC6/DJ8MIulapFPnorq46KU6yRxiM0MQ3N nTJHlHA2ozZta6YBBfVfhHWl1F0IfNbXCLKvGwWWMbCx43OfW6KTkbRnE6gFWKuO fSO5h2u5TaWVuSIzBvYs7Vza6m+gtYAvKAJV2nSZ+eSEFPDo29corOy8+huEOUL8 5FAw4BFPsr1TlrlGPFitduQUHGrSL7skk1ESGza0to3bOtrodKei2s9bk5MXm7lZ qI+WZJX4Zu9+mzZhc9pCVi8r/qlXuQIDAQABo4GnMIGkMB0GA1UdDgQWBBRvavf+ sWM4IwKiH9X9w1vl6nUVRDB1BgNVHSMEbjBsgBRvavf+sWM4IwKiH9X9w1vl6nUV RKFJpEcwRTELMAkGA1UEBhMCVVMxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNV BAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAM15n7fdxhRtMAwGA1UdEwQF MAMBAf8wDQYJKoZIhvcNAQEFBQADggEBABY2ZzBaW0dMsAAT7tPJzrVWVzQx6KU4 UEBLudIlWPlkAwTnINCWR/8eNjCCmGA4heUdHmazdpPa8RzwOmc0NT1NQqzSyktt vTqb4iHD7+8f9MqJ9/FssCfTtqr/Qst/hGH4Wmdf1EJ/6FqYAAb5iRlPgshFZxU8 uXtA8hWn6fK6eISD9HBdcAFToUvKNZ1BIDPvh9f95Ine8ar6yGd56TUNrHR8eHBs ESxz5ddVR/oWRysNJ+aGAyYqHS8S/ttmC7r4XCAHqXptkHPCGRqkAhsterYhd4I8 /cBzejUobNCjjHFbtkAL/SjxZOLW+pNkZwfeYdM8iPkD54Uua1v2tdw= -----END CERTIFICATE-----"),
Host: cloudflare.F("example.com"),
Port: cloudflare.F(24008.000000),
- BundleMethod: cloudflare.F(cloudflare.KeylessCertificateNewParamsBundleMethodUbiquitous),
+ BundleMethod: cloudflare.F(keyless_certificates.KeylessCertificateNewParamsBundleMethodUbiquitous),
Name: cloudflare.F("example.com Keyless SSL"),
- Tunnel: cloudflare.F(cloudflare.KeylessCertificateNewParamsTunnel{
+ Tunnel: cloudflare.F(keyless_certificates.KeylessCertificateNewParamsTunnel{
PrivateIP: cloudflare.F("10.0.0.1"),
VnetID: cloudflare.F("7365377a-85a4-4390-9480-531ef7dc7a3c"),
}),
@@ -62,7 +63,7 @@ func TestKeylessCertificateList(t *testing.T) {
option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"),
option.WithAPIEmail("user@example.com"),
)
- _, err := client.KeylessCertificates.List(context.TODO(), cloudflare.KeylessCertificateListParams{
+ _, err := client.KeylessCertificates.List(context.TODO(), keyless_certificates.KeylessCertificateListParams{
ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
})
if err != nil {
@@ -91,7 +92,7 @@ func TestKeylessCertificateDelete(t *testing.T) {
_, err := client.KeylessCertificates.Delete(
context.TODO(),
"023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.KeylessCertificateDeleteParams{
+ keyless_certificates.KeylessCertificateDeleteParams{
ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
},
)
@@ -121,13 +122,13 @@ func TestKeylessCertificateEditWithOptionalParams(t *testing.T) {
_, err := client.KeylessCertificates.Edit(
context.TODO(),
"023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.KeylessCertificateEditParams{
+ keyless_certificates.KeylessCertificateEditParams{
ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
Enabled: cloudflare.F(false),
Host: cloudflare.F("example.com"),
Name: cloudflare.F("example.com Keyless SSL"),
Port: cloudflare.F(24008.000000),
- Tunnel: cloudflare.F(cloudflare.KeylessCertificateEditParamsTunnel{
+ Tunnel: cloudflare.F(keyless_certificates.KeylessCertificateEditParamsTunnel{
PrivateIP: cloudflare.F("10.0.0.1"),
VnetID: cloudflare.F("7365377a-85a4-4390-9480-531ef7dc7a3c"),
}),
@@ -159,7 +160,7 @@ func TestKeylessCertificateGet(t *testing.T) {
_, err := client.KeylessCertificates.Get(
context.TODO(),
"023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.KeylessCertificateGetParams{
+ keyless_certificates.KeylessCertificateGetParams{
ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
},
)
diff --git a/keylesscertificate.go b/keylesscertificate.go
deleted file mode 100644
index 1d1b8480db9..00000000000
--- a/keylesscertificate.go
+++ /dev/null
@@ -1,995 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// KeylessCertificateService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewKeylessCertificateService] method
-// instead.
-type KeylessCertificateService struct {
- Options []option.RequestOption
-}
-
-// NewKeylessCertificateService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewKeylessCertificateService(opts ...option.RequestOption) (r *KeylessCertificateService) {
- r = &KeylessCertificateService{}
- r.Options = opts
- return
-}
-
-// Create Keyless SSL Configuration
-func (r *KeylessCertificateService) New(ctx context.Context, params KeylessCertificateNewParams, opts ...option.RequestOption) (res *KeylessCertificateNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env KeylessCertificateNewResponseEnvelope
- path := fmt.Sprintf("zones/%s/keyless_certificates", params.ZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// List all Keyless SSL configurations for a given zone.
-func (r *KeylessCertificateService) List(ctx context.Context, query KeylessCertificateListParams, opts ...option.RequestOption) (res *[]KeylessCertificateListResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env KeylessCertificateListResponseEnvelope
- path := fmt.Sprintf("zones/%s/keyless_certificates", query.ZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Delete Keyless SSL Configuration
-func (r *KeylessCertificateService) Delete(ctx context.Context, keylessCertificateID string, body KeylessCertificateDeleteParams, opts ...option.RequestOption) (res *KeylessCertificateDeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env KeylessCertificateDeleteResponseEnvelope
- path := fmt.Sprintf("zones/%s/keyless_certificates/%s", body.ZoneID, keylessCertificateID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// This will update attributes of a Keyless SSL. Consists of one or more of the
-// following: host,name,port.
-func (r *KeylessCertificateService) Edit(ctx context.Context, keylessCertificateID string, params KeylessCertificateEditParams, opts ...option.RequestOption) (res *KeylessCertificateEditResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env KeylessCertificateEditResponseEnvelope
- path := fmt.Sprintf("zones/%s/keyless_certificates/%s", params.ZoneID, keylessCertificateID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Get details for one Keyless SSL configuration.
-func (r *KeylessCertificateService) Get(ctx context.Context, keylessCertificateID string, query KeylessCertificateGetParams, opts ...option.RequestOption) (res *KeylessCertificateGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env KeylessCertificateGetResponseEnvelope
- path := fmt.Sprintf("zones/%s/keyless_certificates/%s", query.ZoneID, keylessCertificateID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type KeylessCertificateNewResponse struct {
- // Keyless certificate identifier tag.
- ID string `json:"id,required"`
- // When the Keyless SSL was created.
- CreatedOn time.Time `json:"created_on,required" format:"date-time"`
- // Whether or not the Keyless SSL is on or off.
- Enabled bool `json:"enabled,required"`
- // The keyless SSL name.
- Host string `json:"host,required" format:"hostname"`
- // When the Keyless SSL was last modified.
- ModifiedOn time.Time `json:"modified_on,required" format:"date-time"`
- // The keyless SSL name.
- Name string `json:"name,required"`
- // Available permissions for the Keyless SSL for the current user requesting the
- // item.
- Permissions []interface{} `json:"permissions,required"`
- // The keyless SSL port used to communicate between Cloudflare and the client's
- // Keyless SSL server.
- Port float64 `json:"port,required"`
- // Status of the Keyless SSL.
- Status KeylessCertificateNewResponseStatus `json:"status,required"`
- // Configuration for using Keyless SSL through a Cloudflare Tunnel
- Tunnel KeylessCertificateNewResponseTunnel `json:"tunnel"`
- JSON keylessCertificateNewResponseJSON `json:"-"`
-}
-
-// keylessCertificateNewResponseJSON contains the JSON metadata for the struct
-// [KeylessCertificateNewResponse]
-type keylessCertificateNewResponseJSON struct {
- ID apijson.Field
- CreatedOn apijson.Field
- Enabled apijson.Field
- Host apijson.Field
- ModifiedOn apijson.Field
- Name apijson.Field
- Permissions apijson.Field
- Port apijson.Field
- Status apijson.Field
- Tunnel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *KeylessCertificateNewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r keylessCertificateNewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// Status of the Keyless SSL.
-type KeylessCertificateNewResponseStatus string
-
-const (
- KeylessCertificateNewResponseStatusActive KeylessCertificateNewResponseStatus = "active"
- KeylessCertificateNewResponseStatusDeleted KeylessCertificateNewResponseStatus = "deleted"
-)
-
-// Configuration for using Keyless SSL through a Cloudflare Tunnel
-type KeylessCertificateNewResponseTunnel struct {
- // Private IP of the Key Server Host
- PrivateIP string `json:"private_ip,required"`
- // Cloudflare Tunnel Virtual Network ID
- VnetID string `json:"vnet_id,required"`
- JSON keylessCertificateNewResponseTunnelJSON `json:"-"`
-}
-
-// keylessCertificateNewResponseTunnelJSON contains the JSON metadata for the
-// struct [KeylessCertificateNewResponseTunnel]
-type keylessCertificateNewResponseTunnelJSON struct {
- PrivateIP apijson.Field
- VnetID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *KeylessCertificateNewResponseTunnel) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r keylessCertificateNewResponseTunnelJSON) RawJSON() string {
- return r.raw
-}
-
-type KeylessCertificateListResponse struct {
- // Keyless certificate identifier tag.
- ID string `json:"id,required"`
- // When the Keyless SSL was created.
- CreatedOn time.Time `json:"created_on,required" format:"date-time"`
- // Whether or not the Keyless SSL is on or off.
- Enabled bool `json:"enabled,required"`
- // The keyless SSL name.
- Host string `json:"host,required" format:"hostname"`
- // When the Keyless SSL was last modified.
- ModifiedOn time.Time `json:"modified_on,required" format:"date-time"`
- // The keyless SSL name.
- Name string `json:"name,required"`
- // Available permissions for the Keyless SSL for the current user requesting the
- // item.
- Permissions []interface{} `json:"permissions,required"`
- // The keyless SSL port used to communicate between Cloudflare and the client's
- // Keyless SSL server.
- Port float64 `json:"port,required"`
- // Status of the Keyless SSL.
- Status KeylessCertificateListResponseStatus `json:"status,required"`
- // Configuration for using Keyless SSL through a Cloudflare Tunnel
- Tunnel KeylessCertificateListResponseTunnel `json:"tunnel"`
- JSON keylessCertificateListResponseJSON `json:"-"`
-}
-
-// keylessCertificateListResponseJSON contains the JSON metadata for the struct
-// [KeylessCertificateListResponse]
-type keylessCertificateListResponseJSON struct {
- ID apijson.Field
- CreatedOn apijson.Field
- Enabled apijson.Field
- Host apijson.Field
- ModifiedOn apijson.Field
- Name apijson.Field
- Permissions apijson.Field
- Port apijson.Field
- Status apijson.Field
- Tunnel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *KeylessCertificateListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r keylessCertificateListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// Status of the Keyless SSL.
-type KeylessCertificateListResponseStatus string
-
-const (
- KeylessCertificateListResponseStatusActive KeylessCertificateListResponseStatus = "active"
- KeylessCertificateListResponseStatusDeleted KeylessCertificateListResponseStatus = "deleted"
-)
-
-// Configuration for using Keyless SSL through a Cloudflare Tunnel
-type KeylessCertificateListResponseTunnel struct {
- // Private IP of the Key Server Host
- PrivateIP string `json:"private_ip,required"`
- // Cloudflare Tunnel Virtual Network ID
- VnetID string `json:"vnet_id,required"`
- JSON keylessCertificateListResponseTunnelJSON `json:"-"`
-}
-
-// keylessCertificateListResponseTunnelJSON contains the JSON metadata for the
-// struct [KeylessCertificateListResponseTunnel]
-type keylessCertificateListResponseTunnelJSON struct {
- PrivateIP apijson.Field
- VnetID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *KeylessCertificateListResponseTunnel) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r keylessCertificateListResponseTunnelJSON) RawJSON() string {
- return r.raw
-}
-
-type KeylessCertificateDeleteResponse struct {
- // Identifier
- ID string `json:"id"`
- JSON keylessCertificateDeleteResponseJSON `json:"-"`
-}
-
-// keylessCertificateDeleteResponseJSON contains the JSON metadata for the struct
-// [KeylessCertificateDeleteResponse]
-type keylessCertificateDeleteResponseJSON struct {
- ID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *KeylessCertificateDeleteResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r keylessCertificateDeleteResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type KeylessCertificateEditResponse struct {
- // Keyless certificate identifier tag.
- ID string `json:"id,required"`
- // When the Keyless SSL was created.
- CreatedOn time.Time `json:"created_on,required" format:"date-time"`
- // Whether or not the Keyless SSL is on or off.
- Enabled bool `json:"enabled,required"`
- // The keyless SSL name.
- Host string `json:"host,required" format:"hostname"`
- // When the Keyless SSL was last modified.
- ModifiedOn time.Time `json:"modified_on,required" format:"date-time"`
- // The keyless SSL name.
- Name string `json:"name,required"`
- // Available permissions for the Keyless SSL for the current user requesting the
- // item.
- Permissions []interface{} `json:"permissions,required"`
- // The keyless SSL port used to communicate between Cloudflare and the client's
- // Keyless SSL server.
- Port float64 `json:"port,required"`
- // Status of the Keyless SSL.
- Status KeylessCertificateEditResponseStatus `json:"status,required"`
- // Configuration for using Keyless SSL through a Cloudflare Tunnel
- Tunnel KeylessCertificateEditResponseTunnel `json:"tunnel"`
- JSON keylessCertificateEditResponseJSON `json:"-"`
-}
-
-// keylessCertificateEditResponseJSON contains the JSON metadata for the struct
-// [KeylessCertificateEditResponse]
-type keylessCertificateEditResponseJSON struct {
- ID apijson.Field
- CreatedOn apijson.Field
- Enabled apijson.Field
- Host apijson.Field
- ModifiedOn apijson.Field
- Name apijson.Field
- Permissions apijson.Field
- Port apijson.Field
- Status apijson.Field
- Tunnel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *KeylessCertificateEditResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r keylessCertificateEditResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// Status of the Keyless SSL.
-type KeylessCertificateEditResponseStatus string
-
-const (
- KeylessCertificateEditResponseStatusActive KeylessCertificateEditResponseStatus = "active"
- KeylessCertificateEditResponseStatusDeleted KeylessCertificateEditResponseStatus = "deleted"
-)
-
-// Configuration for using Keyless SSL through a Cloudflare Tunnel
-type KeylessCertificateEditResponseTunnel struct {
- // Private IP of the Key Server Host
- PrivateIP string `json:"private_ip,required"`
- // Cloudflare Tunnel Virtual Network ID
- VnetID string `json:"vnet_id,required"`
- JSON keylessCertificateEditResponseTunnelJSON `json:"-"`
-}
-
-// keylessCertificateEditResponseTunnelJSON contains the JSON metadata for the
-// struct [KeylessCertificateEditResponseTunnel]
-type keylessCertificateEditResponseTunnelJSON struct {
- PrivateIP apijson.Field
- VnetID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *KeylessCertificateEditResponseTunnel) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r keylessCertificateEditResponseTunnelJSON) RawJSON() string {
- return r.raw
-}
-
-type KeylessCertificateGetResponse struct {
- // Keyless certificate identifier tag.
- ID string `json:"id,required"`
- // When the Keyless SSL was created.
- CreatedOn time.Time `json:"created_on,required" format:"date-time"`
- // Whether or not the Keyless SSL is on or off.
- Enabled bool `json:"enabled,required"`
- // The keyless SSL name.
- Host string `json:"host,required" format:"hostname"`
- // When the Keyless SSL was last modified.
- ModifiedOn time.Time `json:"modified_on,required" format:"date-time"`
- // The keyless SSL name.
- Name string `json:"name,required"`
- // Available permissions for the Keyless SSL for the current user requesting the
- // item.
- Permissions []interface{} `json:"permissions,required"`
- // The keyless SSL port used to communicate between Cloudflare and the client's
- // Keyless SSL server.
- Port float64 `json:"port,required"`
- // Status of the Keyless SSL.
- Status KeylessCertificateGetResponseStatus `json:"status,required"`
- // Configuration for using Keyless SSL through a Cloudflare Tunnel
- Tunnel KeylessCertificateGetResponseTunnel `json:"tunnel"`
- JSON keylessCertificateGetResponseJSON `json:"-"`
-}
-
-// keylessCertificateGetResponseJSON contains the JSON metadata for the struct
-// [KeylessCertificateGetResponse]
-type keylessCertificateGetResponseJSON struct {
- ID apijson.Field
- CreatedOn apijson.Field
- Enabled apijson.Field
- Host apijson.Field
- ModifiedOn apijson.Field
- Name apijson.Field
- Permissions apijson.Field
- Port apijson.Field
- Status apijson.Field
- Tunnel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *KeylessCertificateGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r keylessCertificateGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// Status of the Keyless SSL.
-type KeylessCertificateGetResponseStatus string
-
-const (
- KeylessCertificateGetResponseStatusActive KeylessCertificateGetResponseStatus = "active"
- KeylessCertificateGetResponseStatusDeleted KeylessCertificateGetResponseStatus = "deleted"
-)
-
-// Configuration for using Keyless SSL through a Cloudflare Tunnel
-type KeylessCertificateGetResponseTunnel struct {
- // Private IP of the Key Server Host
- PrivateIP string `json:"private_ip,required"`
- // Cloudflare Tunnel Virtual Network ID
- VnetID string `json:"vnet_id,required"`
- JSON keylessCertificateGetResponseTunnelJSON `json:"-"`
-}
-
-// keylessCertificateGetResponseTunnelJSON contains the JSON metadata for the
-// struct [KeylessCertificateGetResponseTunnel]
-type keylessCertificateGetResponseTunnelJSON struct {
- PrivateIP apijson.Field
- VnetID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *KeylessCertificateGetResponseTunnel) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r keylessCertificateGetResponseTunnelJSON) RawJSON() string {
- return r.raw
-}
-
-type KeylessCertificateNewParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
- // The zone's SSL certificate or SSL certificate and intermediate(s).
- Certificate param.Field[string] `json:"certificate,required"`
- // The keyless SSL name.
- Host param.Field[string] `json:"host,required" format:"hostname"`
- // The keyless SSL port used to communicate between Cloudflare and the client's
- // Keyless SSL server.
- Port param.Field[float64] `json:"port,required"`
- // A ubiquitous bundle has the highest probability of being verified everywhere,
- // even by clients using outdated or unusual trust stores. An optimal bundle uses
- // the shortest chain and newest intermediates. And the force bundle verifies the
- // chain, but does not otherwise modify it.
- BundleMethod param.Field[KeylessCertificateNewParamsBundleMethod] `json:"bundle_method"`
- // The keyless SSL name.
- Name param.Field[string] `json:"name"`
- // Configuration for using Keyless SSL through a Cloudflare Tunnel
- Tunnel param.Field[KeylessCertificateNewParamsTunnel] `json:"tunnel"`
-}
-
-func (r KeylessCertificateNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// A ubiquitous bundle has the highest probability of being verified everywhere,
-// even by clients using outdated or unusual trust stores. An optimal bundle uses
-// the shortest chain and newest intermediates. And the force bundle verifies the
-// chain, but does not otherwise modify it.
-type KeylessCertificateNewParamsBundleMethod string
-
-const (
- KeylessCertificateNewParamsBundleMethodUbiquitous KeylessCertificateNewParamsBundleMethod = "ubiquitous"
- KeylessCertificateNewParamsBundleMethodOptimal KeylessCertificateNewParamsBundleMethod = "optimal"
- KeylessCertificateNewParamsBundleMethodForce KeylessCertificateNewParamsBundleMethod = "force"
-)
-
-// Configuration for using Keyless SSL through a Cloudflare Tunnel
-type KeylessCertificateNewParamsTunnel struct {
- // Private IP of the Key Server Host
- PrivateIP param.Field[string] `json:"private_ip,required"`
- // Cloudflare Tunnel Virtual Network ID
- VnetID param.Field[string] `json:"vnet_id,required"`
-}
-
-func (r KeylessCertificateNewParamsTunnel) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type KeylessCertificateNewResponseEnvelope struct {
- Errors []KeylessCertificateNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []KeylessCertificateNewResponseEnvelopeMessages `json:"messages,required"`
- Result KeylessCertificateNewResponse `json:"result,required"`
- // Whether the API call was successful
- Success KeylessCertificateNewResponseEnvelopeSuccess `json:"success,required"`
- JSON keylessCertificateNewResponseEnvelopeJSON `json:"-"`
-}
-
-// keylessCertificateNewResponseEnvelopeJSON contains the JSON metadata for the
-// struct [KeylessCertificateNewResponseEnvelope]
-type keylessCertificateNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *KeylessCertificateNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r keylessCertificateNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type KeylessCertificateNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON keylessCertificateNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// keylessCertificateNewResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [KeylessCertificateNewResponseEnvelopeErrors]
-type keylessCertificateNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *KeylessCertificateNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r keylessCertificateNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type KeylessCertificateNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON keylessCertificateNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// keylessCertificateNewResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [KeylessCertificateNewResponseEnvelopeMessages]
-type keylessCertificateNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *KeylessCertificateNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r keylessCertificateNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type KeylessCertificateNewResponseEnvelopeSuccess bool
-
-const (
- KeylessCertificateNewResponseEnvelopeSuccessTrue KeylessCertificateNewResponseEnvelopeSuccess = true
-)
-
-type KeylessCertificateListParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
-}
-
-type KeylessCertificateListResponseEnvelope struct {
- Errors []KeylessCertificateListResponseEnvelopeErrors `json:"errors,required"`
- Messages []KeylessCertificateListResponseEnvelopeMessages `json:"messages,required"`
- Result []KeylessCertificateListResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success KeylessCertificateListResponseEnvelopeSuccess `json:"success,required"`
- ResultInfo KeylessCertificateListResponseEnvelopeResultInfo `json:"result_info"`
- JSON keylessCertificateListResponseEnvelopeJSON `json:"-"`
-}
-
-// keylessCertificateListResponseEnvelopeJSON contains the JSON metadata for the
-// struct [KeylessCertificateListResponseEnvelope]
-type keylessCertificateListResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- ResultInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *KeylessCertificateListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r keylessCertificateListResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type KeylessCertificateListResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON keylessCertificateListResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// keylessCertificateListResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [KeylessCertificateListResponseEnvelopeErrors]
-type keylessCertificateListResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *KeylessCertificateListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r keylessCertificateListResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type KeylessCertificateListResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON keylessCertificateListResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// keylessCertificateListResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [KeylessCertificateListResponseEnvelopeMessages]
-type keylessCertificateListResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *KeylessCertificateListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r keylessCertificateListResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type KeylessCertificateListResponseEnvelopeSuccess bool
-
-const (
- KeylessCertificateListResponseEnvelopeSuccessTrue KeylessCertificateListResponseEnvelopeSuccess = true
-)
-
-type KeylessCertificateListResponseEnvelopeResultInfo struct {
- // Total number of results for the requested service
- Count float64 `json:"count"`
- // Current page within paginated list of results
- Page float64 `json:"page"`
- // Number of results per page of results
- PerPage float64 `json:"per_page"`
- // Total results available without any search parameters
- TotalCount float64 `json:"total_count"`
- JSON keylessCertificateListResponseEnvelopeResultInfoJSON `json:"-"`
-}
-
-// keylessCertificateListResponseEnvelopeResultInfoJSON contains the JSON metadata
-// for the struct [KeylessCertificateListResponseEnvelopeResultInfo]
-type keylessCertificateListResponseEnvelopeResultInfoJSON struct {
- Count apijson.Field
- Page apijson.Field
- PerPage apijson.Field
- TotalCount apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *KeylessCertificateListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r keylessCertificateListResponseEnvelopeResultInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type KeylessCertificateDeleteParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
-}
-
-type KeylessCertificateDeleteResponseEnvelope struct {
- Errors []KeylessCertificateDeleteResponseEnvelopeErrors `json:"errors,required"`
- Messages []KeylessCertificateDeleteResponseEnvelopeMessages `json:"messages,required"`
- Result KeylessCertificateDeleteResponse `json:"result,required"`
- // Whether the API call was successful
- Success KeylessCertificateDeleteResponseEnvelopeSuccess `json:"success,required"`
- JSON keylessCertificateDeleteResponseEnvelopeJSON `json:"-"`
-}
-
-// keylessCertificateDeleteResponseEnvelopeJSON contains the JSON metadata for the
-// struct [KeylessCertificateDeleteResponseEnvelope]
-type keylessCertificateDeleteResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *KeylessCertificateDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r keylessCertificateDeleteResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type KeylessCertificateDeleteResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON keylessCertificateDeleteResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// keylessCertificateDeleteResponseEnvelopeErrorsJSON contains the JSON metadata
-// for the struct [KeylessCertificateDeleteResponseEnvelopeErrors]
-type keylessCertificateDeleteResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *KeylessCertificateDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r keylessCertificateDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type KeylessCertificateDeleteResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON keylessCertificateDeleteResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// keylessCertificateDeleteResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [KeylessCertificateDeleteResponseEnvelopeMessages]
-type keylessCertificateDeleteResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *KeylessCertificateDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r keylessCertificateDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type KeylessCertificateDeleteResponseEnvelopeSuccess bool
-
-const (
- KeylessCertificateDeleteResponseEnvelopeSuccessTrue KeylessCertificateDeleteResponseEnvelopeSuccess = true
-)
-
-type KeylessCertificateEditParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
- // Whether or not the Keyless SSL is on or off.
- Enabled param.Field[bool] `json:"enabled"`
- // The keyless SSL name.
- Host param.Field[string] `json:"host" format:"hostname"`
- // The keyless SSL name.
- Name param.Field[string] `json:"name"`
- // The keyless SSL port used to communicate between Cloudflare and the client's
- // Keyless SSL server.
- Port param.Field[float64] `json:"port"`
- // Configuration for using Keyless SSL through a Cloudflare Tunnel
- Tunnel param.Field[KeylessCertificateEditParamsTunnel] `json:"tunnel"`
-}
-
-func (r KeylessCertificateEditParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Configuration for using Keyless SSL through a Cloudflare Tunnel
-type KeylessCertificateEditParamsTunnel struct {
- // Private IP of the Key Server Host
- PrivateIP param.Field[string] `json:"private_ip,required"`
- // Cloudflare Tunnel Virtual Network ID
- VnetID param.Field[string] `json:"vnet_id,required"`
-}
-
-func (r KeylessCertificateEditParamsTunnel) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type KeylessCertificateEditResponseEnvelope struct {
- Errors []KeylessCertificateEditResponseEnvelopeErrors `json:"errors,required"`
- Messages []KeylessCertificateEditResponseEnvelopeMessages `json:"messages,required"`
- Result KeylessCertificateEditResponse `json:"result,required"`
- // Whether the API call was successful
- Success KeylessCertificateEditResponseEnvelopeSuccess `json:"success,required"`
- JSON keylessCertificateEditResponseEnvelopeJSON `json:"-"`
-}
-
-// keylessCertificateEditResponseEnvelopeJSON contains the JSON metadata for the
-// struct [KeylessCertificateEditResponseEnvelope]
-type keylessCertificateEditResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *KeylessCertificateEditResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r keylessCertificateEditResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type KeylessCertificateEditResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON keylessCertificateEditResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// keylessCertificateEditResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [KeylessCertificateEditResponseEnvelopeErrors]
-type keylessCertificateEditResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *KeylessCertificateEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r keylessCertificateEditResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type KeylessCertificateEditResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON keylessCertificateEditResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// keylessCertificateEditResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [KeylessCertificateEditResponseEnvelopeMessages]
-type keylessCertificateEditResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *KeylessCertificateEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r keylessCertificateEditResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type KeylessCertificateEditResponseEnvelopeSuccess bool
-
-const (
- KeylessCertificateEditResponseEnvelopeSuccessTrue KeylessCertificateEditResponseEnvelopeSuccess = true
-)
-
-type KeylessCertificateGetParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
-}
-
-type KeylessCertificateGetResponseEnvelope struct {
- Errors []KeylessCertificateGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []KeylessCertificateGetResponseEnvelopeMessages `json:"messages,required"`
- Result KeylessCertificateGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success KeylessCertificateGetResponseEnvelopeSuccess `json:"success,required"`
- JSON keylessCertificateGetResponseEnvelopeJSON `json:"-"`
-}
-
-// keylessCertificateGetResponseEnvelopeJSON contains the JSON metadata for the
-// struct [KeylessCertificateGetResponseEnvelope]
-type keylessCertificateGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *KeylessCertificateGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r keylessCertificateGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type KeylessCertificateGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON keylessCertificateGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// keylessCertificateGetResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [KeylessCertificateGetResponseEnvelopeErrors]
-type keylessCertificateGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *KeylessCertificateGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r keylessCertificateGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type KeylessCertificateGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON keylessCertificateGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// keylessCertificateGetResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [KeylessCertificateGetResponseEnvelopeMessages]
-type keylessCertificateGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *KeylessCertificateGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r keylessCertificateGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type KeylessCertificateGetResponseEnvelopeSuccess bool
-
-const (
- KeylessCertificateGetResponseEnvelopeSuccessTrue KeylessCertificateGetResponseEnvelopeSuccess = true
-)
diff --git a/kv/aliases.go b/kv/aliases.go
new file mode 100644
index 00000000000..185fdcf5b12
--- /dev/null
+++ b/kv/aliases.go
@@ -0,0 +1,9 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package kv
+
+import (
+ "github.com/cloudflare/cloudflare-go/internal/apierror"
+)
+
+type Error = apierror.Error
diff --git a/kv.go b/kv/kv.go
similarity index 89%
rename from kv.go
rename to kv/kv.go
index 3daff08ab1a..78be8e7282e 100644
--- a/kv.go
+++ b/kv/kv.go
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package cloudflare
+package kv
import (
"github.com/cloudflare/cloudflare-go/option"
@@ -12,7 +12,7 @@ import (
// directly, and instead use the [NewKVService] method instead.
type KVService struct {
Options []option.RequestOption
- Namespaces *KVNamespaceService
+ Namespaces *NamespaceService
}
// NewKVService generates a new service that applies the given options to each
@@ -21,6 +21,6 @@ type KVService struct {
func NewKVService(opts ...option.RequestOption) (r *KVService) {
r = &KVService{}
r.Options = opts
- r.Namespaces = NewKVNamespaceService(opts...)
+ r.Namespaces = NewNamespaceService(opts...)
return
}
diff --git a/kv/namespace.go b/kv/namespace.go
new file mode 100644
index 00000000000..51b96c0d936
--- /dev/null
+++ b/kv/namespace.go
@@ -0,0 +1,476 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package kv
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+ "reflect"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/tidwall/gjson"
+)
+
+// NamespaceService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewNamespaceService] method instead.
+type NamespaceService struct {
+ Options []option.RequestOption
+ Bulk *NamespaceBulkService
+ Keys *NamespaceKeyService
+ Metadata *NamespaceMetadataService
+ Values *NamespaceValueService
+}
+
+// NewNamespaceService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewNamespaceService(opts ...option.RequestOption) (r *NamespaceService) {
+ r = &NamespaceService{}
+ r.Options = opts
+ r.Bulk = NewNamespaceBulkService(opts...)
+ r.Keys = NewNamespaceKeyService(opts...)
+ r.Metadata = NewNamespaceMetadataService(opts...)
+ r.Values = NewNamespaceValueService(opts...)
+ return
+}
+
+// Creates a namespace under the given title. A `400` is returned if the account
+// already owns a namespace with this title. A namespace must be explicitly deleted
+// to be replaced.
+func (r *NamespaceService) New(ctx context.Context, params NamespaceNewParams, opts ...option.RequestOption) (res *WorkersKVNamespace, err error) {
+ opts = append(r.Options[:], opts...)
+ var env NamespaceNewResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/storage/kv/namespaces", params.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Modifies a namespace's title.
+func (r *NamespaceService) Update(ctx context.Context, namespaceID string, params NamespaceUpdateParams, opts ...option.RequestOption) (res *NamespaceUpdateResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env NamespaceUpdateResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/storage/kv/namespaces/%s", params.AccountID, namespaceID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Returns the namespaces owned by an account.
+func (r *NamespaceService) List(ctx context.Context, params NamespaceListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[WorkersKVNamespace], err error) {
+ var raw *http.Response
+ opts = append(r.Options, opts...)
+ opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
+ path := fmt.Sprintf("accounts/%s/storage/kv/namespaces", params.AccountID)
+ cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, params, &res, opts...)
+ if err != nil {
+ return nil, err
+ }
+ err = cfg.Execute()
+ if err != nil {
+ return nil, err
+ }
+ res.SetPageConfig(cfg, raw)
+ return res, nil
+}
+
+// Returns the namespaces owned by an account.
+func (r *NamespaceService) ListAutoPaging(ctx context.Context, params NamespaceListParams, opts ...option.RequestOption) *shared.V4PagePaginationArrayAutoPager[WorkersKVNamespace] {
+ return shared.NewV4PagePaginationArrayAutoPager(r.List(ctx, params, opts...))
+}
+
+// Deletes the namespace corresponding to the given ID.
+func (r *NamespaceService) Delete(ctx context.Context, namespaceID string, body NamespaceDeleteParams, opts ...option.RequestOption) (res *NamespaceDeleteResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env NamespaceDeleteResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/storage/kv/namespaces/%s", body.AccountID, namespaceID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type WorkersKVNamespace struct {
+ // Namespace identifier tag.
+ ID string `json:"id,required"`
+ // A human-readable string name for a Namespace.
+ Title string `json:"title,required"`
+ // True if keys written on the URL will be URL-decoded before storing. For example,
+ // if set to "true", a key written on the URL as "%3F" will be stored as "?".
+ SupportsURLEncoding bool `json:"supports_url_encoding"`
+ JSON workersKVNamespaceJSON `json:"-"`
+}
+
+// workersKVNamespaceJSON contains the JSON metadata for the struct
+// [WorkersKVNamespace]
+type workersKVNamespaceJSON struct {
+ ID apijson.Field
+ Title apijson.Field
+ SupportsURLEncoding apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WorkersKVNamespace) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r workersKVNamespaceJSON) RawJSON() string {
+ return r.raw
+}
+
+// Union satisfied by [kv.NamespaceUpdateResponseUnknown] or [shared.UnionString].
+type NamespaceUpdateResponse interface {
+ ImplementsKVNamespaceUpdateResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*NamespaceUpdateResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+// Union satisfied by [kv.NamespaceDeleteResponseUnknown] or [shared.UnionString].
+type NamespaceDeleteResponse interface {
+ ImplementsKVNamespaceDeleteResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*NamespaceDeleteResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+type NamespaceNewParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ // A human-readable string name for a Namespace.
+ Title param.Field[string] `json:"title,required"`
+}
+
+func (r NamespaceNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type NamespaceNewResponseEnvelope struct {
+ Errors []NamespaceNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []NamespaceNewResponseEnvelopeMessages `json:"messages,required"`
+ Result WorkersKVNamespace `json:"result,required"`
+ // Whether the API call was successful
+ Success NamespaceNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON namespaceNewResponseEnvelopeJSON `json:"-"`
+}
+
+// namespaceNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [NamespaceNewResponseEnvelope]
+type namespaceNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *NamespaceNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r namespaceNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type NamespaceNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON namespaceNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// namespaceNewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [NamespaceNewResponseEnvelopeErrors]
+type namespaceNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *NamespaceNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r namespaceNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type NamespaceNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON namespaceNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// namespaceNewResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [NamespaceNewResponseEnvelopeMessages]
+type namespaceNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *NamespaceNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r namespaceNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type NamespaceNewResponseEnvelopeSuccess bool
+
+const (
+ NamespaceNewResponseEnvelopeSuccessTrue NamespaceNewResponseEnvelopeSuccess = true
+)
+
+type NamespaceUpdateParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ // A human-readable string name for a Namespace.
+ Title param.Field[string] `json:"title,required"`
+}
+
+func (r NamespaceUpdateParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type NamespaceUpdateResponseEnvelope struct {
+ Errors []NamespaceUpdateResponseEnvelopeErrors `json:"errors,required"`
+ Messages []NamespaceUpdateResponseEnvelopeMessages `json:"messages,required"`
+ Result NamespaceUpdateResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success NamespaceUpdateResponseEnvelopeSuccess `json:"success,required"`
+ JSON namespaceUpdateResponseEnvelopeJSON `json:"-"`
+}
+
+// namespaceUpdateResponseEnvelopeJSON contains the JSON metadata for the struct
+// [NamespaceUpdateResponseEnvelope]
+type namespaceUpdateResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *NamespaceUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r namespaceUpdateResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type NamespaceUpdateResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON namespaceUpdateResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// namespaceUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [NamespaceUpdateResponseEnvelopeErrors]
+type namespaceUpdateResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *NamespaceUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r namespaceUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type NamespaceUpdateResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON namespaceUpdateResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// namespaceUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [NamespaceUpdateResponseEnvelopeMessages]
+type namespaceUpdateResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *NamespaceUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r namespaceUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type NamespaceUpdateResponseEnvelopeSuccess bool
+
+const (
+ NamespaceUpdateResponseEnvelopeSuccessTrue NamespaceUpdateResponseEnvelopeSuccess = true
+)
+
+type NamespaceListParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ // Direction to order namespaces.
+ Direction param.Field[NamespaceListParamsDirection] `query:"direction"`
+ // Field to order results by.
+ Order param.Field[NamespaceListParamsOrder] `query:"order"`
+ // Page number of paginated results.
+ Page param.Field[float64] `query:"page"`
+ // Maximum number of results per page.
+ PerPage param.Field[float64] `query:"per_page"`
+}
+
+// URLQuery serializes [NamespaceListParams]'s query parameters as `url.Values`.
+func (r NamespaceListParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Direction to order namespaces.
+type NamespaceListParamsDirection string
+
+const (
+ NamespaceListParamsDirectionAsc NamespaceListParamsDirection = "asc"
+ NamespaceListParamsDirectionDesc NamespaceListParamsDirection = "desc"
+)
+
+// Field to order results by.
+type NamespaceListParamsOrder string
+
+const (
+ NamespaceListParamsOrderID NamespaceListParamsOrder = "id"
+ NamespaceListParamsOrderTitle NamespaceListParamsOrder = "title"
+)
+
+type NamespaceDeleteParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type NamespaceDeleteResponseEnvelope struct {
+ Errors []NamespaceDeleteResponseEnvelopeErrors `json:"errors,required"`
+ Messages []NamespaceDeleteResponseEnvelopeMessages `json:"messages,required"`
+ Result NamespaceDeleteResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success NamespaceDeleteResponseEnvelopeSuccess `json:"success,required"`
+ JSON namespaceDeleteResponseEnvelopeJSON `json:"-"`
+}
+
+// namespaceDeleteResponseEnvelopeJSON contains the JSON metadata for the struct
+// [NamespaceDeleteResponseEnvelope]
+type namespaceDeleteResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *NamespaceDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r namespaceDeleteResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type NamespaceDeleteResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON namespaceDeleteResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// namespaceDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [NamespaceDeleteResponseEnvelopeErrors]
+type namespaceDeleteResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *NamespaceDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r namespaceDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type NamespaceDeleteResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON namespaceDeleteResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// namespaceDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [NamespaceDeleteResponseEnvelopeMessages]
+type namespaceDeleteResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *NamespaceDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r namespaceDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type NamespaceDeleteResponseEnvelopeSuccess bool
+
+const (
+ NamespaceDeleteResponseEnvelopeSuccessTrue NamespaceDeleteResponseEnvelopeSuccess = true
+)
diff --git a/kv/namespace_test.go b/kv/namespace_test.go
new file mode 100644
index 00000000000..a9069e9f75f
--- /dev/null
+++ b/kv/namespace_test.go
@@ -0,0 +1,133 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package kv_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/kv"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestNamespaceNew(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"),
+ )
+ _, err := client.KV.Namespaces.New(context.TODO(), kv.NamespaceNewParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Title: cloudflare.F("My Own Namespace"),
+ })
+ 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())
+ }
+}
+
+func TestNamespaceUpdate(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"),
+ )
+ _, err := client.KV.Namespaces.Update(
+ context.TODO(),
+ "0f2ac74b498b48028cb68387c421e279",
+ kv.NamespaceUpdateParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Title: cloudflare.F("My Own Namespace"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestNamespaceListWithOptionalParams(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"),
+ )
+ _, err := client.KV.Namespaces.List(context.TODO(), kv.NamespaceListParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Direction: cloudflare.F(kv.NamespaceListParamsDirectionAsc),
+ Order: cloudflare.F(kv.NamespaceListParamsOrderID),
+ Page: cloudflare.F(1.000000),
+ PerPage: cloudflare.F(5.000000),
+ })
+ 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())
+ }
+}
+
+func TestNamespaceDelete(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"),
+ )
+ _, err := client.KV.Namespaces.Delete(
+ context.TODO(),
+ "0f2ac74b498b48028cb68387c421e279",
+ kv.NamespaceDeleteParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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/kv/namespacebulk.go b/kv/namespacebulk.go
new file mode 100644
index 00000000000..566b05e7bcd
--- /dev/null
+++ b/kv/namespacebulk.go
@@ -0,0 +1,307 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package kv
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "reflect"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/tidwall/gjson"
+)
+
+// NamespaceBulkService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewNamespaceBulkService] method
+// instead.
+type NamespaceBulkService struct {
+ Options []option.RequestOption
+}
+
+// NewNamespaceBulkService generates a new service that applies the given options
+// to each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewNamespaceBulkService(opts ...option.RequestOption) (r *NamespaceBulkService) {
+ r = &NamespaceBulkService{}
+ r.Options = opts
+ return
+}
+
+// Write multiple keys and values at once. Body should be an array of up to 10,000
+// key-value pairs to be stored, along with optional expiration information.
+// Existing values and expirations will be overwritten. If neither `expiration` nor
+// `expiration_ttl` is specified, the key-value pair will never expire. If both are
+// set, `expiration_ttl` is used and `expiration` is ignored. The entire request
+// size must be 100 megabytes or less.
+func (r *NamespaceBulkService) Update(ctx context.Context, namespaceID string, params NamespaceBulkUpdateParams, opts ...option.RequestOption) (res *NamespaceBulkUpdateResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env NamespaceBulkUpdateResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/storage/kv/namespaces/%s/bulk", params.AccountID, namespaceID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Remove multiple KV pairs from the namespace. Body should be an array of up to
+// 10,000 keys to be removed.
+func (r *NamespaceBulkService) Delete(ctx context.Context, namespaceID string, params NamespaceBulkDeleteParams, opts ...option.RequestOption) (res *NamespaceBulkDeleteResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env NamespaceBulkDeleteResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/storage/kv/namespaces/%s/bulk", params.AccountID, namespaceID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Union satisfied by [kv.NamespaceBulkUpdateResponseUnknown] or
+// [shared.UnionString].
+type NamespaceBulkUpdateResponse interface {
+ ImplementsKVNamespaceBulkUpdateResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*NamespaceBulkUpdateResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+// Union satisfied by [kv.NamespaceBulkDeleteResponseUnknown] or
+// [shared.UnionString].
+type NamespaceBulkDeleteResponse interface {
+ ImplementsKVNamespaceBulkDeleteResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*NamespaceBulkDeleteResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+type NamespaceBulkUpdateParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ Body param.Field[[]NamespaceBulkUpdateParamsBody] `json:"body,required"`
+}
+
+func (r NamespaceBulkUpdateParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r.Body)
+}
+
+type NamespaceBulkUpdateParamsBody struct {
+ // Whether or not the server should base64 decode the value before storing it.
+ // Useful for writing values that wouldn't otherwise be valid JSON strings, such as
+ // images.
+ Base64 param.Field[bool] `json:"base64"`
+ // The time, measured in number of seconds since the UNIX epoch, at which the key
+ // should expire.
+ Expiration param.Field[float64] `json:"expiration"`
+ // The number of seconds for which the key should be visible before it expires. At
+ // least 60.
+ ExpirationTTL param.Field[float64] `json:"expiration_ttl"`
+ // A key's name. The name may be at most 512 bytes. All printable, non-whitespace
+ // characters are valid.
+ Key param.Field[string] `json:"key"`
+ // Arbitrary JSON that is associated with a key.
+ Metadata param.Field[interface{}] `json:"metadata"`
+ // A UTF-8 encoded string to be stored, up to 25 MiB in length.
+ Value param.Field[string] `json:"value"`
+}
+
+func (r NamespaceBulkUpdateParamsBody) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type NamespaceBulkUpdateResponseEnvelope struct {
+ Errors []NamespaceBulkUpdateResponseEnvelopeErrors `json:"errors,required"`
+ Messages []NamespaceBulkUpdateResponseEnvelopeMessages `json:"messages,required"`
+ Result NamespaceBulkUpdateResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success NamespaceBulkUpdateResponseEnvelopeSuccess `json:"success,required"`
+ JSON namespaceBulkUpdateResponseEnvelopeJSON `json:"-"`
+}
+
+// namespaceBulkUpdateResponseEnvelopeJSON contains the JSON metadata for the
+// struct [NamespaceBulkUpdateResponseEnvelope]
+type namespaceBulkUpdateResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *NamespaceBulkUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r namespaceBulkUpdateResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type NamespaceBulkUpdateResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON namespaceBulkUpdateResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// namespaceBulkUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [NamespaceBulkUpdateResponseEnvelopeErrors]
+type namespaceBulkUpdateResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *NamespaceBulkUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r namespaceBulkUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type NamespaceBulkUpdateResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON namespaceBulkUpdateResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// namespaceBulkUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for
+// the struct [NamespaceBulkUpdateResponseEnvelopeMessages]
+type namespaceBulkUpdateResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *NamespaceBulkUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r namespaceBulkUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type NamespaceBulkUpdateResponseEnvelopeSuccess bool
+
+const (
+ NamespaceBulkUpdateResponseEnvelopeSuccessTrue NamespaceBulkUpdateResponseEnvelopeSuccess = true
+)
+
+type NamespaceBulkDeleteParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ Body param.Field[[]string] `json:"body,required"`
+}
+
+func (r NamespaceBulkDeleteParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r.Body)
+}
+
+type NamespaceBulkDeleteResponseEnvelope struct {
+ Errors []NamespaceBulkDeleteResponseEnvelopeErrors `json:"errors,required"`
+ Messages []NamespaceBulkDeleteResponseEnvelopeMessages `json:"messages,required"`
+ Result NamespaceBulkDeleteResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success NamespaceBulkDeleteResponseEnvelopeSuccess `json:"success,required"`
+ JSON namespaceBulkDeleteResponseEnvelopeJSON `json:"-"`
+}
+
+// namespaceBulkDeleteResponseEnvelopeJSON contains the JSON metadata for the
+// struct [NamespaceBulkDeleteResponseEnvelope]
+type namespaceBulkDeleteResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *NamespaceBulkDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r namespaceBulkDeleteResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type NamespaceBulkDeleteResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON namespaceBulkDeleteResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// namespaceBulkDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [NamespaceBulkDeleteResponseEnvelopeErrors]
+type namespaceBulkDeleteResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *NamespaceBulkDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r namespaceBulkDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type NamespaceBulkDeleteResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON namespaceBulkDeleteResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// namespaceBulkDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for
+// the struct [NamespaceBulkDeleteResponseEnvelopeMessages]
+type namespaceBulkDeleteResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *NamespaceBulkDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r namespaceBulkDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type NamespaceBulkDeleteResponseEnvelopeSuccess bool
+
+const (
+ NamespaceBulkDeleteResponseEnvelopeSuccessTrue NamespaceBulkDeleteResponseEnvelopeSuccess = true
+)
diff --git a/kv/namespacebulk_test.go b/kv/namespacebulk_test.go
new file mode 100644
index 00000000000..897245404dc
--- /dev/null
+++ b/kv/namespacebulk_test.go
@@ -0,0 +1,104 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package kv_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/kv"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestNamespaceBulkUpdate(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"),
+ )
+ _, err := client.KV.Namespaces.Bulk.Update(
+ context.TODO(),
+ "0f2ac74b498b48028cb68387c421e279",
+ kv.NamespaceBulkUpdateParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Body: cloudflare.F([]kv.NamespaceBulkUpdateParamsBody{{
+ Base64: cloudflare.F(true),
+ Expiration: cloudflare.F(1578435000.000000),
+ ExpirationTTL: cloudflare.F(300.000000),
+ Key: cloudflare.F("My-Key"),
+ Metadata: cloudflare.F[any](map[string]interface{}{
+ "someMetadataKey": "someMetadataValue",
+ }),
+ Value: cloudflare.F("Some string"),
+ }, {
+ Base64: cloudflare.F(true),
+ Expiration: cloudflare.F(1578435000.000000),
+ ExpirationTTL: cloudflare.F(300.000000),
+ Key: cloudflare.F("My-Key"),
+ Metadata: cloudflare.F[any](map[string]interface{}{
+ "someMetadataKey": "someMetadataValue",
+ }),
+ Value: cloudflare.F("Some string"),
+ }, {
+ Base64: cloudflare.F(true),
+ Expiration: cloudflare.F(1578435000.000000),
+ ExpirationTTL: cloudflare.F(300.000000),
+ Key: cloudflare.F("My-Key"),
+ Metadata: cloudflare.F[any](map[string]interface{}{
+ "someMetadataKey": "someMetadataValue",
+ }),
+ Value: cloudflare.F("Some 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())
+ }
+}
+
+func TestNamespaceBulkDelete(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"),
+ )
+ _, err := client.KV.Namespaces.Bulk.Delete(
+ context.TODO(),
+ "0f2ac74b498b48028cb68387c421e279",
+ kv.NamespaceBulkDeleteParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Body: cloudflare.F([]string{"My-Key", "My-Key", "My-Key"}),
+ },
+ )
+ 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/kv/namespacekey.go b/kv/namespacekey.go
new file mode 100644
index 00000000000..4927d304ded
--- /dev/null
+++ b/kv/namespacekey.go
@@ -0,0 +1,213 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package kv
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// NamespaceKeyService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewNamespaceKeyService] method
+// instead.
+type NamespaceKeyService struct {
+ Options []option.RequestOption
+}
+
+// NewNamespaceKeyService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewNamespaceKeyService(opts ...option.RequestOption) (r *NamespaceKeyService) {
+ r = &NamespaceKeyService{}
+ r.Options = opts
+ return
+}
+
+// Lists a namespace's keys.
+func (r *NamespaceKeyService) List(ctx context.Context, namespaceID string, params NamespaceKeyListParams, opts ...option.RequestOption) (res *[]WorkersKVKey, err error) {
+ opts = append(r.Options[:], opts...)
+ var env NamespaceKeyListResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/storage/kv/namespaces/%s/keys", params.AccountID, namespaceID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// A name for a value. A value stored under a given key may be retrieved via the
+// same key.
+type WorkersKVKey struct {
+ // A key's name. The name may be at most 512 bytes. All printable, non-whitespace
+ // characters are valid. Use percent-encoding to define key names as part of a URL.
+ Name string `json:"name,required"`
+ // The time, measured in number of seconds since the UNIX epoch, at which the key
+ // will expire. This property is omitted for keys that will not expire.
+ Expiration float64 `json:"expiration"`
+ // Arbitrary JSON that is associated with a key.
+ Metadata interface{} `json:"metadata"`
+ JSON workersKVKeyJSON `json:"-"`
+}
+
+// workersKVKeyJSON contains the JSON metadata for the struct [WorkersKVKey]
+type workersKVKeyJSON struct {
+ Name apijson.Field
+ Expiration apijson.Field
+ Metadata apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WorkersKVKey) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r workersKVKeyJSON) RawJSON() string {
+ return r.raw
+}
+
+type NamespaceKeyListParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ // Opaque token indicating the position from which to continue when requesting the
+ // next set of records if the amount of list results was limited by the limit
+ // parameter. A valid value for the cursor can be obtained from the `cursors`
+ // object in the `result_info` structure.
+ Cursor param.Field[string] `query:"cursor"`
+ // The number of keys to return. The cursor attribute may be used to iterate over
+ // the next batch of keys if there are more than the limit.
+ Limit param.Field[float64] `query:"limit"`
+ // A string prefix used to filter down which keys will be returned. Exact matches
+ // and any key names that begin with the prefix will be returned.
+ Prefix param.Field[string] `query:"prefix"`
+}
+
+// URLQuery serializes [NamespaceKeyListParams]'s query parameters as `url.Values`.
+func (r NamespaceKeyListParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type NamespaceKeyListResponseEnvelope struct {
+ Errors []NamespaceKeyListResponseEnvelopeErrors `json:"errors,required"`
+ Messages []NamespaceKeyListResponseEnvelopeMessages `json:"messages,required"`
+ Result []WorkersKVKey `json:"result,required"`
+ // Whether the API call was successful
+ Success NamespaceKeyListResponseEnvelopeSuccess `json:"success,required"`
+ ResultInfo NamespaceKeyListResponseEnvelopeResultInfo `json:"result_info"`
+ JSON namespaceKeyListResponseEnvelopeJSON `json:"-"`
+}
+
+// namespaceKeyListResponseEnvelopeJSON contains the JSON metadata for the struct
+// [NamespaceKeyListResponseEnvelope]
+type namespaceKeyListResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ ResultInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *NamespaceKeyListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r namespaceKeyListResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type NamespaceKeyListResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON namespaceKeyListResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// namespaceKeyListResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [NamespaceKeyListResponseEnvelopeErrors]
+type namespaceKeyListResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *NamespaceKeyListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r namespaceKeyListResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type NamespaceKeyListResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON namespaceKeyListResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// namespaceKeyListResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [NamespaceKeyListResponseEnvelopeMessages]
+type namespaceKeyListResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *NamespaceKeyListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r namespaceKeyListResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type NamespaceKeyListResponseEnvelopeSuccess bool
+
+const (
+ NamespaceKeyListResponseEnvelopeSuccessTrue NamespaceKeyListResponseEnvelopeSuccess = true
+)
+
+type NamespaceKeyListResponseEnvelopeResultInfo struct {
+ // Total results returned based on your list parameters.
+ Count float64 `json:"count"`
+ // Opaque token indicating the position from which to continue when requesting the
+ // next set of records if the amount of list results was limited by the limit
+ // parameter. A valid value for the cursor can be obtained from the cursors object
+ // in the result_info structure.
+ Cursor string `json:"cursor"`
+ JSON namespaceKeyListResponseEnvelopeResultInfoJSON `json:"-"`
+}
+
+// namespaceKeyListResponseEnvelopeResultInfoJSON contains the JSON metadata for
+// the struct [NamespaceKeyListResponseEnvelopeResultInfo]
+type namespaceKeyListResponseEnvelopeResultInfoJSON struct {
+ Count apijson.Field
+ Cursor apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *NamespaceKeyListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r namespaceKeyListResponseEnvelopeResultInfoJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/kv/namespacekey_test.go b/kv/namespacekey_test.go
new file mode 100644
index 00000000000..ceb73c479ef
--- /dev/null
+++ b/kv/namespacekey_test.go
@@ -0,0 +1,48 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package kv_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/kv"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestNamespaceKeyListWithOptionalParams(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"),
+ )
+ _, err := client.KV.Namespaces.Keys.List(
+ context.TODO(),
+ "0f2ac74b498b48028cb68387c421e279",
+ kv.NamespaceKeyListParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Cursor: cloudflare.F("6Ck1la0VxJ0djhidm1MdX2FyDGxLKVeeHZZmORS_8XeSuhz9SjIJRaSa2lnsF01tQOHrfTGAP3R5X1Kv5iVUuMbNKhWNAXHOl6ePB0TUL8nw"),
+ Limit: cloudflare.F(10.000000),
+ Prefix: cloudflare.F("My-Prefix"),
+ },
+ )
+ 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/kv/namespacemetadata.go b/kv/namespacemetadata.go
new file mode 100644
index 00000000000..8ecb072fe46
--- /dev/null
+++ b/kv/namespacemetadata.go
@@ -0,0 +1,136 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package kv
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// NamespaceMetadataService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewNamespaceMetadataService] method
+// instead.
+type NamespaceMetadataService struct {
+ Options []option.RequestOption
+}
+
+// NewNamespaceMetadataService generates a new service that applies the given
+// options to each request. These options are applied after the parent client's
+// options (if there is one), and before any request-specific options.
+func NewNamespaceMetadataService(opts ...option.RequestOption) (r *NamespaceMetadataService) {
+ r = &NamespaceMetadataService{}
+ r.Options = opts
+ return
+}
+
+// Returns the metadata associated with the given key in the given namespace. Use
+// URL-encoding to use special characters (for example, `:`, `!`, `%`) in the key
+// name.
+func (r *NamespaceMetadataService) Get(ctx context.Context, namespaceID string, keyName string, query NamespaceMetadataGetParams, opts ...option.RequestOption) (res *NamespaceMetadataGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env NamespaceMetadataGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/storage/kv/namespaces/%s/metadata/%s", query.AccountID, namespaceID, keyName)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type NamespaceMetadataGetResponse = interface{}
+
+type NamespaceMetadataGetParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type NamespaceMetadataGetResponseEnvelope struct {
+ Errors []NamespaceMetadataGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []NamespaceMetadataGetResponseEnvelopeMessages `json:"messages,required"`
+ // Arbitrary JSON that is associated with a key.
+ Result NamespaceMetadataGetResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success NamespaceMetadataGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON namespaceMetadataGetResponseEnvelopeJSON `json:"-"`
+}
+
+// namespaceMetadataGetResponseEnvelopeJSON contains the JSON metadata for the
+// struct [NamespaceMetadataGetResponseEnvelope]
+type namespaceMetadataGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *NamespaceMetadataGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r namespaceMetadataGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type NamespaceMetadataGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON namespaceMetadataGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// namespaceMetadataGetResponseEnvelopeErrorsJSON contains the JSON metadata for
+// the struct [NamespaceMetadataGetResponseEnvelopeErrors]
+type namespaceMetadataGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *NamespaceMetadataGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r namespaceMetadataGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type NamespaceMetadataGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON namespaceMetadataGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// namespaceMetadataGetResponseEnvelopeMessagesJSON contains the JSON metadata for
+// the struct [NamespaceMetadataGetResponseEnvelopeMessages]
+type namespaceMetadataGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *NamespaceMetadataGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r namespaceMetadataGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type NamespaceMetadataGetResponseEnvelopeSuccess bool
+
+const (
+ NamespaceMetadataGetResponseEnvelopeSuccessTrue NamespaceMetadataGetResponseEnvelopeSuccess = true
+)
diff --git a/kv/namespacemetadata_test.go b/kv/namespacemetadata_test.go
new file mode 100644
index 00000000000..d324f706aa5
--- /dev/null
+++ b/kv/namespacemetadata_test.go
@@ -0,0 +1,46 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package kv_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/kv"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestNamespaceMetadataGet(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"),
+ )
+ _, err := client.KV.Namespaces.Metadata.Get(
+ context.TODO(),
+ "0f2ac74b498b48028cb68387c421e279",
+ "My-Key",
+ kv.NamespaceMetadataGetParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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/kv/namespacevalue.go b/kv/namespacevalue.go
new file mode 100644
index 00000000000..148f9117e0d
--- /dev/null
+++ b/kv/namespacevalue.go
@@ -0,0 +1,298 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package kv
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "reflect"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/tidwall/gjson"
+)
+
+// NamespaceValueService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewNamespaceValueService] method
+// instead.
+type NamespaceValueService struct {
+ Options []option.RequestOption
+}
+
+// NewNamespaceValueService generates a new service that applies the given options
+// to each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewNamespaceValueService(opts ...option.RequestOption) (r *NamespaceValueService) {
+ r = &NamespaceValueService{}
+ r.Options = opts
+ return
+}
+
+// Write a value identified by a key. Use URL-encoding to use special characters
+// (for example, `:`, `!`, `%`) in the key name. Body should be the value to be
+// stored along with JSON metadata to be associated with the key/value pair.
+// Existing values, expirations, and metadata will be overwritten. If neither
+// `expiration` nor `expiration_ttl` is specified, the key-value pair will never
+// expire. If both are set, `expiration_ttl` is used and `expiration` is ignored.
+func (r *NamespaceValueService) Update(ctx context.Context, namespaceID string, keyName string, params NamespaceValueUpdateParams, opts ...option.RequestOption) (res *NamespaceValueUpdateResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env NamespaceValueUpdateResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/storage/kv/namespaces/%s/values/%s", params.AccountID, namespaceID, keyName)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Remove a KV pair from the namespace. Use URL-encoding to use special characters
+// (for example, `:`, `!`, `%`) in the key name.
+func (r *NamespaceValueService) Delete(ctx context.Context, namespaceID string, keyName string, body NamespaceValueDeleteParams, opts ...option.RequestOption) (res *NamespaceValueDeleteResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env NamespaceValueDeleteResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/storage/kv/namespaces/%s/values/%s", body.AccountID, namespaceID, keyName)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Returns the value associated with the given key in the given namespace. Use
+// URL-encoding to use special characters (for example, `:`, `!`, `%`) in the key
+// name. If the KV-pair is set to expire at some point, the expiration time as
+// measured in seconds since the UNIX epoch will be returned in the `expiration`
+// response header.
+func (r *NamespaceValueService) Get(ctx context.Context, namespaceID string, keyName string, query NamespaceValueGetParams, opts ...option.RequestOption) (res *string, err error) {
+ opts = append(r.Options[:], opts...)
+ path := fmt.Sprintf("accounts/%s/storage/kv/namespaces/%s/values/%s", query.AccountID, namespaceID, keyName)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &res, opts...)
+ return
+}
+
+// Union satisfied by [kv.NamespaceValueUpdateResponseUnknown] or
+// [shared.UnionString].
+type NamespaceValueUpdateResponse interface {
+ ImplementsKVNamespaceValueUpdateResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*NamespaceValueUpdateResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+// Union satisfied by [kv.NamespaceValueDeleteResponseUnknown] or
+// [shared.UnionString].
+type NamespaceValueDeleteResponse interface {
+ ImplementsKVNamespaceValueDeleteResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*NamespaceValueDeleteResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+type NamespaceValueUpdateParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ // Arbitrary JSON to be associated with a key/value pair.
+ Metadata param.Field[string] `json:"metadata,required"`
+ // A byte sequence to be stored, up to 25 MiB in length.
+ Value param.Field[string] `json:"value,required"`
+}
+
+func (r NamespaceValueUpdateParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type NamespaceValueUpdateResponseEnvelope struct {
+ Errors []NamespaceValueUpdateResponseEnvelopeErrors `json:"errors,required"`
+ Messages []NamespaceValueUpdateResponseEnvelopeMessages `json:"messages,required"`
+ Result NamespaceValueUpdateResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success NamespaceValueUpdateResponseEnvelopeSuccess `json:"success,required"`
+ JSON namespaceValueUpdateResponseEnvelopeJSON `json:"-"`
+}
+
+// namespaceValueUpdateResponseEnvelopeJSON contains the JSON metadata for the
+// struct [NamespaceValueUpdateResponseEnvelope]
+type namespaceValueUpdateResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *NamespaceValueUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r namespaceValueUpdateResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type NamespaceValueUpdateResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON namespaceValueUpdateResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// namespaceValueUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for
+// the struct [NamespaceValueUpdateResponseEnvelopeErrors]
+type namespaceValueUpdateResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *NamespaceValueUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r namespaceValueUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type NamespaceValueUpdateResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON namespaceValueUpdateResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// namespaceValueUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for
+// the struct [NamespaceValueUpdateResponseEnvelopeMessages]
+type namespaceValueUpdateResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *NamespaceValueUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r namespaceValueUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type NamespaceValueUpdateResponseEnvelopeSuccess bool
+
+const (
+ NamespaceValueUpdateResponseEnvelopeSuccessTrue NamespaceValueUpdateResponseEnvelopeSuccess = true
+)
+
+type NamespaceValueDeleteParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type NamespaceValueDeleteResponseEnvelope struct {
+ Errors []NamespaceValueDeleteResponseEnvelopeErrors `json:"errors,required"`
+ Messages []NamespaceValueDeleteResponseEnvelopeMessages `json:"messages,required"`
+ Result NamespaceValueDeleteResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success NamespaceValueDeleteResponseEnvelopeSuccess `json:"success,required"`
+ JSON namespaceValueDeleteResponseEnvelopeJSON `json:"-"`
+}
+
+// namespaceValueDeleteResponseEnvelopeJSON contains the JSON metadata for the
+// struct [NamespaceValueDeleteResponseEnvelope]
+type namespaceValueDeleteResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *NamespaceValueDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r namespaceValueDeleteResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type NamespaceValueDeleteResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON namespaceValueDeleteResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// namespaceValueDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for
+// the struct [NamespaceValueDeleteResponseEnvelopeErrors]
+type namespaceValueDeleteResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *NamespaceValueDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r namespaceValueDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type NamespaceValueDeleteResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON namespaceValueDeleteResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// namespaceValueDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for
+// the struct [NamespaceValueDeleteResponseEnvelopeMessages]
+type namespaceValueDeleteResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *NamespaceValueDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r namespaceValueDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type NamespaceValueDeleteResponseEnvelopeSuccess bool
+
+const (
+ NamespaceValueDeleteResponseEnvelopeSuccessTrue NamespaceValueDeleteResponseEnvelopeSuccess = true
+)
+
+type NamespaceValueGetParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
diff --git a/kv/namespacevalue_test.go b/kv/namespacevalue_test.go
new file mode 100644
index 00000000000..1779a8fcf22
--- /dev/null
+++ b/kv/namespacevalue_test.go
@@ -0,0 +1,110 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package kv_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/kv"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestNamespaceValueUpdate(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"),
+ )
+ _, err := client.KV.Namespaces.Values.Update(
+ context.TODO(),
+ "0f2ac74b498b48028cb68387c421e279",
+ "My-Key",
+ kv.NamespaceValueUpdateParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Metadata: cloudflare.F("{\"someMetadataKey\": \"someMetadataValue\"}"),
+ Value: cloudflare.F("Some Value"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestNamespaceValueDelete(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"),
+ )
+ _, err := client.KV.Namespaces.Values.Delete(
+ context.TODO(),
+ "0f2ac74b498b48028cb68387c421e279",
+ "My-Key",
+ kv.NamespaceValueDeleteParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestNamespaceValueGet(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"),
+ )
+ _, err := client.KV.Namespaces.Values.Get(
+ context.TODO(),
+ "0f2ac74b498b48028cb68387c421e279",
+ "My-Key",
+ kv.NamespaceValueGetParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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/kvnamespace.go b/kvnamespace.go
deleted file mode 100644
index 4a0a2fb112e..00000000000
--- a/kvnamespace.go
+++ /dev/null
@@ -1,506 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
- "reflect"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/option"
- "github.com/tidwall/gjson"
-)
-
-// KVNamespaceService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewKVNamespaceService] method
-// instead.
-type KVNamespaceService struct {
- Options []option.RequestOption
- Bulk *KVNamespaceBulkService
- Keys *KVNamespaceKeyService
- Metadata *KVNamespaceMetadataService
- Values *KVNamespaceValueService
-}
-
-// NewKVNamespaceService generates a new service that applies the given options to
-// each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewKVNamespaceService(opts ...option.RequestOption) (r *KVNamespaceService) {
- r = &KVNamespaceService{}
- r.Options = opts
- r.Bulk = NewKVNamespaceBulkService(opts...)
- r.Keys = NewKVNamespaceKeyService(opts...)
- r.Metadata = NewKVNamespaceMetadataService(opts...)
- r.Values = NewKVNamespaceValueService(opts...)
- return
-}
-
-// Creates a namespace under the given title. A `400` is returned if the account
-// already owns a namespace with this title. A namespace must be explicitly deleted
-// to be replaced.
-func (r *KVNamespaceService) New(ctx context.Context, params KVNamespaceNewParams, opts ...option.RequestOption) (res *KVNamespaceNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env KVNamespaceNewResponseEnvelope
- path := fmt.Sprintf("accounts/%s/storage/kv/namespaces", params.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Modifies a namespace's title.
-func (r *KVNamespaceService) Update(ctx context.Context, namespaceID string, params KVNamespaceUpdateParams, opts ...option.RequestOption) (res *KVNamespaceUpdateResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env KVNamespaceUpdateResponseEnvelope
- path := fmt.Sprintf("accounts/%s/storage/kv/namespaces/%s", params.AccountID, namespaceID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Returns the namespaces owned by an account.
-func (r *KVNamespaceService) List(ctx context.Context, params KVNamespaceListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[KVNamespaceListResponse], err error) {
- var raw *http.Response
- opts = append(r.Options, opts...)
- opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
- path := fmt.Sprintf("accounts/%s/storage/kv/namespaces", params.AccountID)
- cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, params, &res, opts...)
- if err != nil {
- return nil, err
- }
- err = cfg.Execute()
- if err != nil {
- return nil, err
- }
- res.SetPageConfig(cfg, raw)
- return res, nil
-}
-
-// Returns the namespaces owned by an account.
-func (r *KVNamespaceService) ListAutoPaging(ctx context.Context, params KVNamespaceListParams, opts ...option.RequestOption) *shared.V4PagePaginationArrayAutoPager[KVNamespaceListResponse] {
- return shared.NewV4PagePaginationArrayAutoPager(r.List(ctx, params, opts...))
-}
-
-// Deletes the namespace corresponding to the given ID.
-func (r *KVNamespaceService) Delete(ctx context.Context, namespaceID string, body KVNamespaceDeleteParams, opts ...option.RequestOption) (res *KVNamespaceDeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env KVNamespaceDeleteResponseEnvelope
- path := fmt.Sprintf("accounts/%s/storage/kv/namespaces/%s", body.AccountID, namespaceID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type KVNamespaceNewResponse struct {
- // Namespace identifier tag.
- ID string `json:"id,required"`
- // A human-readable string name for a Namespace.
- Title string `json:"title,required"`
- // True if keys written on the URL will be URL-decoded before storing. For example,
- // if set to "true", a key written on the URL as "%3F" will be stored as "?".
- SupportsURLEncoding bool `json:"supports_url_encoding"`
- JSON kvNamespaceNewResponseJSON `json:"-"`
-}
-
-// kvNamespaceNewResponseJSON contains the JSON metadata for the struct
-// [KVNamespaceNewResponse]
-type kvNamespaceNewResponseJSON struct {
- ID apijson.Field
- Title apijson.Field
- SupportsURLEncoding apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *KVNamespaceNewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r kvNamespaceNewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// Union satisfied by [KVNamespaceUpdateResponseUnknown] or [shared.UnionString].
-type KVNamespaceUpdateResponse interface {
- ImplementsKVNamespaceUpdateResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*KVNamespaceUpdateResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-type KVNamespaceListResponse struct {
- // Namespace identifier tag.
- ID string `json:"id,required"`
- // A human-readable string name for a Namespace.
- Title string `json:"title,required"`
- // True if keys written on the URL will be URL-decoded before storing. For example,
- // if set to "true", a key written on the URL as "%3F" will be stored as "?".
- SupportsURLEncoding bool `json:"supports_url_encoding"`
- JSON kvNamespaceListResponseJSON `json:"-"`
-}
-
-// kvNamespaceListResponseJSON contains the JSON metadata for the struct
-// [KVNamespaceListResponse]
-type kvNamespaceListResponseJSON struct {
- ID apijson.Field
- Title apijson.Field
- SupportsURLEncoding apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *KVNamespaceListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r kvNamespaceListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// Union satisfied by [KVNamespaceDeleteResponseUnknown] or [shared.UnionString].
-type KVNamespaceDeleteResponse interface {
- ImplementsKVNamespaceDeleteResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*KVNamespaceDeleteResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-type KVNamespaceNewParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
- // A human-readable string name for a Namespace.
- Title param.Field[string] `json:"title,required"`
-}
-
-func (r KVNamespaceNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type KVNamespaceNewResponseEnvelope struct {
- Errors []KVNamespaceNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []KVNamespaceNewResponseEnvelopeMessages `json:"messages,required"`
- Result KVNamespaceNewResponse `json:"result,required"`
- // Whether the API call was successful
- Success KVNamespaceNewResponseEnvelopeSuccess `json:"success,required"`
- JSON kvNamespaceNewResponseEnvelopeJSON `json:"-"`
-}
-
-// kvNamespaceNewResponseEnvelopeJSON contains the JSON metadata for the struct
-// [KVNamespaceNewResponseEnvelope]
-type kvNamespaceNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *KVNamespaceNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r kvNamespaceNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type KVNamespaceNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON kvNamespaceNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// kvNamespaceNewResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [KVNamespaceNewResponseEnvelopeErrors]
-type kvNamespaceNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *KVNamespaceNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r kvNamespaceNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type KVNamespaceNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON kvNamespaceNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// kvNamespaceNewResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [KVNamespaceNewResponseEnvelopeMessages]
-type kvNamespaceNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *KVNamespaceNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r kvNamespaceNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type KVNamespaceNewResponseEnvelopeSuccess bool
-
-const (
- KVNamespaceNewResponseEnvelopeSuccessTrue KVNamespaceNewResponseEnvelopeSuccess = true
-)
-
-type KVNamespaceUpdateParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
- // A human-readable string name for a Namespace.
- Title param.Field[string] `json:"title,required"`
-}
-
-func (r KVNamespaceUpdateParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type KVNamespaceUpdateResponseEnvelope struct {
- Errors []KVNamespaceUpdateResponseEnvelopeErrors `json:"errors,required"`
- Messages []KVNamespaceUpdateResponseEnvelopeMessages `json:"messages,required"`
- Result KVNamespaceUpdateResponse `json:"result,required"`
- // Whether the API call was successful
- Success KVNamespaceUpdateResponseEnvelopeSuccess `json:"success,required"`
- JSON kvNamespaceUpdateResponseEnvelopeJSON `json:"-"`
-}
-
-// kvNamespaceUpdateResponseEnvelopeJSON contains the JSON metadata for the struct
-// [KVNamespaceUpdateResponseEnvelope]
-type kvNamespaceUpdateResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *KVNamespaceUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r kvNamespaceUpdateResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type KVNamespaceUpdateResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON kvNamespaceUpdateResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// kvNamespaceUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [KVNamespaceUpdateResponseEnvelopeErrors]
-type kvNamespaceUpdateResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *KVNamespaceUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r kvNamespaceUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type KVNamespaceUpdateResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON kvNamespaceUpdateResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// kvNamespaceUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [KVNamespaceUpdateResponseEnvelopeMessages]
-type kvNamespaceUpdateResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *KVNamespaceUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r kvNamespaceUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type KVNamespaceUpdateResponseEnvelopeSuccess bool
-
-const (
- KVNamespaceUpdateResponseEnvelopeSuccessTrue KVNamespaceUpdateResponseEnvelopeSuccess = true
-)
-
-type KVNamespaceListParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
- // Direction to order namespaces.
- Direction param.Field[KVNamespaceListParamsDirection] `query:"direction"`
- // Field to order results by.
- Order param.Field[KVNamespaceListParamsOrder] `query:"order"`
- // Page number of paginated results.
- Page param.Field[float64] `query:"page"`
- // Maximum number of results per page.
- PerPage param.Field[float64] `query:"per_page"`
-}
-
-// URLQuery serializes [KVNamespaceListParams]'s query parameters as `url.Values`.
-func (r KVNamespaceListParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Direction to order namespaces.
-type KVNamespaceListParamsDirection string
-
-const (
- KVNamespaceListParamsDirectionAsc KVNamespaceListParamsDirection = "asc"
- KVNamespaceListParamsDirectionDesc KVNamespaceListParamsDirection = "desc"
-)
-
-// Field to order results by.
-type KVNamespaceListParamsOrder string
-
-const (
- KVNamespaceListParamsOrderID KVNamespaceListParamsOrder = "id"
- KVNamespaceListParamsOrderTitle KVNamespaceListParamsOrder = "title"
-)
-
-type KVNamespaceDeleteParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type KVNamespaceDeleteResponseEnvelope struct {
- Errors []KVNamespaceDeleteResponseEnvelopeErrors `json:"errors,required"`
- Messages []KVNamespaceDeleteResponseEnvelopeMessages `json:"messages,required"`
- Result KVNamespaceDeleteResponse `json:"result,required"`
- // Whether the API call was successful
- Success KVNamespaceDeleteResponseEnvelopeSuccess `json:"success,required"`
- JSON kvNamespaceDeleteResponseEnvelopeJSON `json:"-"`
-}
-
-// kvNamespaceDeleteResponseEnvelopeJSON contains the JSON metadata for the struct
-// [KVNamespaceDeleteResponseEnvelope]
-type kvNamespaceDeleteResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *KVNamespaceDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r kvNamespaceDeleteResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type KVNamespaceDeleteResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON kvNamespaceDeleteResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// kvNamespaceDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [KVNamespaceDeleteResponseEnvelopeErrors]
-type kvNamespaceDeleteResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *KVNamespaceDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r kvNamespaceDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type KVNamespaceDeleteResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON kvNamespaceDeleteResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// kvNamespaceDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [KVNamespaceDeleteResponseEnvelopeMessages]
-type kvNamespaceDeleteResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *KVNamespaceDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r kvNamespaceDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type KVNamespaceDeleteResponseEnvelopeSuccess bool
-
-const (
- KVNamespaceDeleteResponseEnvelopeSuccessTrue KVNamespaceDeleteResponseEnvelopeSuccess = true
-)
diff --git a/kvnamespace_test.go b/kvnamespace_test.go
deleted file mode 100644
index 7aad2d51a83..00000000000
--- a/kvnamespace_test.go
+++ /dev/null
@@ -1,132 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestKVNamespaceNew(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"),
- )
- _, err := client.KV.Namespaces.New(context.TODO(), cloudflare.KVNamespaceNewParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Title: cloudflare.F("My Own Namespace"),
- })
- 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())
- }
-}
-
-func TestKVNamespaceUpdate(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"),
- )
- _, err := client.KV.Namespaces.Update(
- context.TODO(),
- "0f2ac74b498b48028cb68387c421e279",
- cloudflare.KVNamespaceUpdateParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Title: cloudflare.F("My Own Namespace"),
- },
- )
- 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())
- }
-}
-
-func TestKVNamespaceListWithOptionalParams(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"),
- )
- _, err := client.KV.Namespaces.List(context.TODO(), cloudflare.KVNamespaceListParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Direction: cloudflare.F(cloudflare.KVNamespaceListParamsDirectionAsc),
- Order: cloudflare.F(cloudflare.KVNamespaceListParamsOrderID),
- Page: cloudflare.F(1.000000),
- PerPage: cloudflare.F(5.000000),
- })
- 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())
- }
-}
-
-func TestKVNamespaceDelete(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"),
- )
- _, err := client.KV.Namespaces.Delete(
- context.TODO(),
- "0f2ac74b498b48028cb68387c421e279",
- cloudflare.KVNamespaceDeleteParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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/kvnamespacebulk.go b/kvnamespacebulk.go
deleted file mode 100644
index e5796dbfa22..00000000000
--- a/kvnamespacebulk.go
+++ /dev/null
@@ -1,307 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "reflect"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/option"
- "github.com/tidwall/gjson"
-)
-
-// KVNamespaceBulkService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewKVNamespaceBulkService] method
-// instead.
-type KVNamespaceBulkService struct {
- Options []option.RequestOption
-}
-
-// NewKVNamespaceBulkService generates a new service that applies the given options
-// to each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewKVNamespaceBulkService(opts ...option.RequestOption) (r *KVNamespaceBulkService) {
- r = &KVNamespaceBulkService{}
- r.Options = opts
- return
-}
-
-// Write multiple keys and values at once. Body should be an array of up to 10,000
-// key-value pairs to be stored, along with optional expiration information.
-// Existing values and expirations will be overwritten. If neither `expiration` nor
-// `expiration_ttl` is specified, the key-value pair will never expire. If both are
-// set, `expiration_ttl` is used and `expiration` is ignored. The entire request
-// size must be 100 megabytes or less.
-func (r *KVNamespaceBulkService) Update(ctx context.Context, namespaceID string, params KVNamespaceBulkUpdateParams, opts ...option.RequestOption) (res *KVNamespaceBulkUpdateResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env KVNamespaceBulkUpdateResponseEnvelope
- path := fmt.Sprintf("accounts/%s/storage/kv/namespaces/%s/bulk", params.AccountID, namespaceID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Remove multiple KV pairs from the namespace. Body should be an array of up to
-// 10,000 keys to be removed.
-func (r *KVNamespaceBulkService) Delete(ctx context.Context, namespaceID string, params KVNamespaceBulkDeleteParams, opts ...option.RequestOption) (res *KVNamespaceBulkDeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env KVNamespaceBulkDeleteResponseEnvelope
- path := fmt.Sprintf("accounts/%s/storage/kv/namespaces/%s/bulk", params.AccountID, namespaceID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Union satisfied by [KVNamespaceBulkUpdateResponseUnknown] or
-// [shared.UnionString].
-type KVNamespaceBulkUpdateResponse interface {
- ImplementsKVNamespaceBulkUpdateResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*KVNamespaceBulkUpdateResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-// Union satisfied by [KVNamespaceBulkDeleteResponseUnknown] or
-// [shared.UnionString].
-type KVNamespaceBulkDeleteResponse interface {
- ImplementsKVNamespaceBulkDeleteResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*KVNamespaceBulkDeleteResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-type KVNamespaceBulkUpdateParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
- Body param.Field[[]KVNamespaceBulkUpdateParamsBody] `json:"body,required"`
-}
-
-func (r KVNamespaceBulkUpdateParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r.Body)
-}
-
-type KVNamespaceBulkUpdateParamsBody struct {
- // Whether or not the server should base64 decode the value before storing it.
- // Useful for writing values that wouldn't otherwise be valid JSON strings, such as
- // images.
- Base64 param.Field[bool] `json:"base64"`
- // The time, measured in number of seconds since the UNIX epoch, at which the key
- // should expire.
- Expiration param.Field[float64] `json:"expiration"`
- // The number of seconds for which the key should be visible before it expires. At
- // least 60.
- ExpirationTTL param.Field[float64] `json:"expiration_ttl"`
- // A key's name. The name may be at most 512 bytes. All printable, non-whitespace
- // characters are valid.
- Key param.Field[string] `json:"key"`
- // Arbitrary JSON that is associated with a key.
- Metadata param.Field[interface{}] `json:"metadata"`
- // A UTF-8 encoded string to be stored, up to 25 MiB in length.
- Value param.Field[string] `json:"value"`
-}
-
-func (r KVNamespaceBulkUpdateParamsBody) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type KVNamespaceBulkUpdateResponseEnvelope struct {
- Errors []KVNamespaceBulkUpdateResponseEnvelopeErrors `json:"errors,required"`
- Messages []KVNamespaceBulkUpdateResponseEnvelopeMessages `json:"messages,required"`
- Result KVNamespaceBulkUpdateResponse `json:"result,required"`
- // Whether the API call was successful
- Success KVNamespaceBulkUpdateResponseEnvelopeSuccess `json:"success,required"`
- JSON kvNamespaceBulkUpdateResponseEnvelopeJSON `json:"-"`
-}
-
-// kvNamespaceBulkUpdateResponseEnvelopeJSON contains the JSON metadata for the
-// struct [KVNamespaceBulkUpdateResponseEnvelope]
-type kvNamespaceBulkUpdateResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *KVNamespaceBulkUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r kvNamespaceBulkUpdateResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type KVNamespaceBulkUpdateResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON kvNamespaceBulkUpdateResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// kvNamespaceBulkUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [KVNamespaceBulkUpdateResponseEnvelopeErrors]
-type kvNamespaceBulkUpdateResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *KVNamespaceBulkUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r kvNamespaceBulkUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type KVNamespaceBulkUpdateResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON kvNamespaceBulkUpdateResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// kvNamespaceBulkUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [KVNamespaceBulkUpdateResponseEnvelopeMessages]
-type kvNamespaceBulkUpdateResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *KVNamespaceBulkUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r kvNamespaceBulkUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type KVNamespaceBulkUpdateResponseEnvelopeSuccess bool
-
-const (
- KVNamespaceBulkUpdateResponseEnvelopeSuccessTrue KVNamespaceBulkUpdateResponseEnvelopeSuccess = true
-)
-
-type KVNamespaceBulkDeleteParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
- Body param.Field[[]string] `json:"body,required"`
-}
-
-func (r KVNamespaceBulkDeleteParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r.Body)
-}
-
-type KVNamespaceBulkDeleteResponseEnvelope struct {
- Errors []KVNamespaceBulkDeleteResponseEnvelopeErrors `json:"errors,required"`
- Messages []KVNamespaceBulkDeleteResponseEnvelopeMessages `json:"messages,required"`
- Result KVNamespaceBulkDeleteResponse `json:"result,required"`
- // Whether the API call was successful
- Success KVNamespaceBulkDeleteResponseEnvelopeSuccess `json:"success,required"`
- JSON kvNamespaceBulkDeleteResponseEnvelopeJSON `json:"-"`
-}
-
-// kvNamespaceBulkDeleteResponseEnvelopeJSON contains the JSON metadata for the
-// struct [KVNamespaceBulkDeleteResponseEnvelope]
-type kvNamespaceBulkDeleteResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *KVNamespaceBulkDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r kvNamespaceBulkDeleteResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type KVNamespaceBulkDeleteResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON kvNamespaceBulkDeleteResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// kvNamespaceBulkDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [KVNamespaceBulkDeleteResponseEnvelopeErrors]
-type kvNamespaceBulkDeleteResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *KVNamespaceBulkDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r kvNamespaceBulkDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type KVNamespaceBulkDeleteResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON kvNamespaceBulkDeleteResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// kvNamespaceBulkDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [KVNamespaceBulkDeleteResponseEnvelopeMessages]
-type kvNamespaceBulkDeleteResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *KVNamespaceBulkDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r kvNamespaceBulkDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type KVNamespaceBulkDeleteResponseEnvelopeSuccess bool
-
-const (
- KVNamespaceBulkDeleteResponseEnvelopeSuccessTrue KVNamespaceBulkDeleteResponseEnvelopeSuccess = true
-)
diff --git a/kvnamespacebulk_test.go b/kvnamespacebulk_test.go
deleted file mode 100644
index e6ef144e882..00000000000
--- a/kvnamespacebulk_test.go
+++ /dev/null
@@ -1,103 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestKVNamespaceBulkUpdate(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"),
- )
- _, err := client.KV.Namespaces.Bulk.Update(
- context.TODO(),
- "0f2ac74b498b48028cb68387c421e279",
- cloudflare.KVNamespaceBulkUpdateParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Body: cloudflare.F([]cloudflare.KVNamespaceBulkUpdateParamsBody{{
- Base64: cloudflare.F(true),
- Expiration: cloudflare.F(1578435000.000000),
- ExpirationTTL: cloudflare.F(300.000000),
- Key: cloudflare.F("My-Key"),
- Metadata: cloudflare.F[any](map[string]interface{}{
- "someMetadataKey": "someMetadataValue",
- }),
- Value: cloudflare.F("Some string"),
- }, {
- Base64: cloudflare.F(true),
- Expiration: cloudflare.F(1578435000.000000),
- ExpirationTTL: cloudflare.F(300.000000),
- Key: cloudflare.F("My-Key"),
- Metadata: cloudflare.F[any](map[string]interface{}{
- "someMetadataKey": "someMetadataValue",
- }),
- Value: cloudflare.F("Some string"),
- }, {
- Base64: cloudflare.F(true),
- Expiration: cloudflare.F(1578435000.000000),
- ExpirationTTL: cloudflare.F(300.000000),
- Key: cloudflare.F("My-Key"),
- Metadata: cloudflare.F[any](map[string]interface{}{
- "someMetadataKey": "someMetadataValue",
- }),
- Value: cloudflare.F("Some 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())
- }
-}
-
-func TestKVNamespaceBulkDelete(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"),
- )
- _, err := client.KV.Namespaces.Bulk.Delete(
- context.TODO(),
- "0f2ac74b498b48028cb68387c421e279",
- cloudflare.KVNamespaceBulkDeleteParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Body: cloudflare.F([]string{"My-Key", "My-Key", "My-Key"}),
- },
- )
- 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/kvnamespacekey.go b/kvnamespacekey.go
deleted file mode 100644
index b28de6e34fe..00000000000
--- a/kvnamespacekey.go
+++ /dev/null
@@ -1,215 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// KVNamespaceKeyService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewKVNamespaceKeyService] method
-// instead.
-type KVNamespaceKeyService struct {
- Options []option.RequestOption
-}
-
-// NewKVNamespaceKeyService generates a new service that applies the given options
-// to each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewKVNamespaceKeyService(opts ...option.RequestOption) (r *KVNamespaceKeyService) {
- r = &KVNamespaceKeyService{}
- r.Options = opts
- return
-}
-
-// Lists a namespace's keys.
-func (r *KVNamespaceKeyService) List(ctx context.Context, namespaceID string, params KVNamespaceKeyListParams, opts ...option.RequestOption) (res *[]KVNamespaceKeyListResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env KVNamespaceKeyListResponseEnvelope
- path := fmt.Sprintf("accounts/%s/storage/kv/namespaces/%s/keys", params.AccountID, namespaceID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// A name for a value. A value stored under a given key may be retrieved via the
-// same key.
-type KVNamespaceKeyListResponse struct {
- // A key's name. The name may be at most 512 bytes. All printable, non-whitespace
- // characters are valid. Use percent-encoding to define key names as part of a URL.
- Name string `json:"name,required"`
- // The time, measured in number of seconds since the UNIX epoch, at which the key
- // will expire. This property is omitted for keys that will not expire.
- Expiration float64 `json:"expiration"`
- // Arbitrary JSON that is associated with a key.
- Metadata interface{} `json:"metadata"`
- JSON kvNamespaceKeyListResponseJSON `json:"-"`
-}
-
-// kvNamespaceKeyListResponseJSON contains the JSON metadata for the struct
-// [KVNamespaceKeyListResponse]
-type kvNamespaceKeyListResponseJSON struct {
- Name apijson.Field
- Expiration apijson.Field
- Metadata apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *KVNamespaceKeyListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r kvNamespaceKeyListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type KVNamespaceKeyListParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
- // Opaque token indicating the position from which to continue when requesting the
- // next set of records if the amount of list results was limited by the limit
- // parameter. A valid value for the cursor can be obtained from the `cursors`
- // object in the `result_info` structure.
- Cursor param.Field[string] `query:"cursor"`
- // The number of keys to return. The cursor attribute may be used to iterate over
- // the next batch of keys if there are more than the limit.
- Limit param.Field[float64] `query:"limit"`
- // A string prefix used to filter down which keys will be returned. Exact matches
- // and any key names that begin with the prefix will be returned.
- Prefix param.Field[string] `query:"prefix"`
-}
-
-// URLQuery serializes [KVNamespaceKeyListParams]'s query parameters as
-// `url.Values`.
-func (r KVNamespaceKeyListParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type KVNamespaceKeyListResponseEnvelope struct {
- Errors []KVNamespaceKeyListResponseEnvelopeErrors `json:"errors,required"`
- Messages []KVNamespaceKeyListResponseEnvelopeMessages `json:"messages,required"`
- Result []KVNamespaceKeyListResponse `json:"result,required"`
- // Whether the API call was successful
- Success KVNamespaceKeyListResponseEnvelopeSuccess `json:"success,required"`
- ResultInfo KVNamespaceKeyListResponseEnvelopeResultInfo `json:"result_info"`
- JSON kvNamespaceKeyListResponseEnvelopeJSON `json:"-"`
-}
-
-// kvNamespaceKeyListResponseEnvelopeJSON contains the JSON metadata for the struct
-// [KVNamespaceKeyListResponseEnvelope]
-type kvNamespaceKeyListResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- ResultInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *KVNamespaceKeyListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r kvNamespaceKeyListResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type KVNamespaceKeyListResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON kvNamespaceKeyListResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// kvNamespaceKeyListResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [KVNamespaceKeyListResponseEnvelopeErrors]
-type kvNamespaceKeyListResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *KVNamespaceKeyListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r kvNamespaceKeyListResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type KVNamespaceKeyListResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON kvNamespaceKeyListResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// kvNamespaceKeyListResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [KVNamespaceKeyListResponseEnvelopeMessages]
-type kvNamespaceKeyListResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *KVNamespaceKeyListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r kvNamespaceKeyListResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type KVNamespaceKeyListResponseEnvelopeSuccess bool
-
-const (
- KVNamespaceKeyListResponseEnvelopeSuccessTrue KVNamespaceKeyListResponseEnvelopeSuccess = true
-)
-
-type KVNamespaceKeyListResponseEnvelopeResultInfo struct {
- // Total results returned based on your list parameters.
- Count float64 `json:"count"`
- // Opaque token indicating the position from which to continue when requesting the
- // next set of records if the amount of list results was limited by the limit
- // parameter. A valid value for the cursor can be obtained from the cursors object
- // in the result_info structure.
- Cursor string `json:"cursor"`
- JSON kvNamespaceKeyListResponseEnvelopeResultInfoJSON `json:"-"`
-}
-
-// kvNamespaceKeyListResponseEnvelopeResultInfoJSON contains the JSON metadata for
-// the struct [KVNamespaceKeyListResponseEnvelopeResultInfo]
-type kvNamespaceKeyListResponseEnvelopeResultInfoJSON struct {
- Count apijson.Field
- Cursor apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *KVNamespaceKeyListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r kvNamespaceKeyListResponseEnvelopeResultInfoJSON) RawJSON() string {
- return r.raw
-}
diff --git a/kvnamespacekey_test.go b/kvnamespacekey_test.go
deleted file mode 100644
index 222c97439fb..00000000000
--- a/kvnamespacekey_test.go
+++ /dev/null
@@ -1,47 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestKVNamespaceKeyListWithOptionalParams(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"),
- )
- _, err := client.KV.Namespaces.Keys.List(
- context.TODO(),
- "0f2ac74b498b48028cb68387c421e279",
- cloudflare.KVNamespaceKeyListParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Cursor: cloudflare.F("6Ck1la0VxJ0djhidm1MdX2FyDGxLKVeeHZZmORS_8XeSuhz9SjIJRaSa2lnsF01tQOHrfTGAP3R5X1Kv5iVUuMbNKhWNAXHOl6ePB0TUL8nw"),
- Limit: cloudflare.F(10.000000),
- Prefix: cloudflare.F("My-Prefix"),
- },
- )
- 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/kvnamespacemetadata.go b/kvnamespacemetadata.go
deleted file mode 100644
index b1b0fbe4871..00000000000
--- a/kvnamespacemetadata.go
+++ /dev/null
@@ -1,136 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// KVNamespaceMetadataService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewKVNamespaceMetadataService]
-// method instead.
-type KVNamespaceMetadataService struct {
- Options []option.RequestOption
-}
-
-// NewKVNamespaceMetadataService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewKVNamespaceMetadataService(opts ...option.RequestOption) (r *KVNamespaceMetadataService) {
- r = &KVNamespaceMetadataService{}
- r.Options = opts
- return
-}
-
-// Returns the metadata associated with the given key in the given namespace. Use
-// URL-encoding to use special characters (for example, `:`, `!`, `%`) in the key
-// name.
-func (r *KVNamespaceMetadataService) Get(ctx context.Context, namespaceID string, keyName string, query KVNamespaceMetadataGetParams, opts ...option.RequestOption) (res *KVNamespaceMetadataGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env KVNamespaceMetadataGetResponseEnvelope
- path := fmt.Sprintf("accounts/%s/storage/kv/namespaces/%s/metadata/%s", query.AccountID, namespaceID, keyName)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type KVNamespaceMetadataGetResponse = interface{}
-
-type KVNamespaceMetadataGetParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type KVNamespaceMetadataGetResponseEnvelope struct {
- Errors []KVNamespaceMetadataGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []KVNamespaceMetadataGetResponseEnvelopeMessages `json:"messages,required"`
- // Arbitrary JSON that is associated with a key.
- Result KVNamespaceMetadataGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success KVNamespaceMetadataGetResponseEnvelopeSuccess `json:"success,required"`
- JSON kvNamespaceMetadataGetResponseEnvelopeJSON `json:"-"`
-}
-
-// kvNamespaceMetadataGetResponseEnvelopeJSON contains the JSON metadata for the
-// struct [KVNamespaceMetadataGetResponseEnvelope]
-type kvNamespaceMetadataGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *KVNamespaceMetadataGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r kvNamespaceMetadataGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type KVNamespaceMetadataGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON kvNamespaceMetadataGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// kvNamespaceMetadataGetResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [KVNamespaceMetadataGetResponseEnvelopeErrors]
-type kvNamespaceMetadataGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *KVNamespaceMetadataGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r kvNamespaceMetadataGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type KVNamespaceMetadataGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON kvNamespaceMetadataGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// kvNamespaceMetadataGetResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [KVNamespaceMetadataGetResponseEnvelopeMessages]
-type kvNamespaceMetadataGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *KVNamespaceMetadataGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r kvNamespaceMetadataGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type KVNamespaceMetadataGetResponseEnvelopeSuccess bool
-
-const (
- KVNamespaceMetadataGetResponseEnvelopeSuccessTrue KVNamespaceMetadataGetResponseEnvelopeSuccess = true
-)
diff --git a/kvnamespacemetadata_test.go b/kvnamespacemetadata_test.go
deleted file mode 100644
index 720e74ac93d..00000000000
--- a/kvnamespacemetadata_test.go
+++ /dev/null
@@ -1,45 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestKVNamespaceMetadataGet(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"),
- )
- _, err := client.KV.Namespaces.Metadata.Get(
- context.TODO(),
- "0f2ac74b498b48028cb68387c421e279",
- "My-Key",
- cloudflare.KVNamespaceMetadataGetParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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/kvnamespacevalue.go b/kvnamespacevalue.go
deleted file mode 100644
index 747460641d3..00000000000
--- a/kvnamespacevalue.go
+++ /dev/null
@@ -1,298 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "reflect"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/option"
- "github.com/tidwall/gjson"
-)
-
-// KVNamespaceValueService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewKVNamespaceValueService] method
-// instead.
-type KVNamespaceValueService struct {
- Options []option.RequestOption
-}
-
-// NewKVNamespaceValueService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewKVNamespaceValueService(opts ...option.RequestOption) (r *KVNamespaceValueService) {
- r = &KVNamespaceValueService{}
- r.Options = opts
- return
-}
-
-// Write a value identified by a key. Use URL-encoding to use special characters
-// (for example, `:`, `!`, `%`) in the key name. Body should be the value to be
-// stored along with JSON metadata to be associated with the key/value pair.
-// Existing values, expirations, and metadata will be overwritten. If neither
-// `expiration` nor `expiration_ttl` is specified, the key-value pair will never
-// expire. If both are set, `expiration_ttl` is used and `expiration` is ignored.
-func (r *KVNamespaceValueService) Update(ctx context.Context, namespaceID string, keyName string, params KVNamespaceValueUpdateParams, opts ...option.RequestOption) (res *KVNamespaceValueUpdateResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env KVNamespaceValueUpdateResponseEnvelope
- path := fmt.Sprintf("accounts/%s/storage/kv/namespaces/%s/values/%s", params.AccountID, namespaceID, keyName)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Remove a KV pair from the namespace. Use URL-encoding to use special characters
-// (for example, `:`, `!`, `%`) in the key name.
-func (r *KVNamespaceValueService) Delete(ctx context.Context, namespaceID string, keyName string, body KVNamespaceValueDeleteParams, opts ...option.RequestOption) (res *KVNamespaceValueDeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env KVNamespaceValueDeleteResponseEnvelope
- path := fmt.Sprintf("accounts/%s/storage/kv/namespaces/%s/values/%s", body.AccountID, namespaceID, keyName)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Returns the value associated with the given key in the given namespace. Use
-// URL-encoding to use special characters (for example, `:`, `!`, `%`) in the key
-// name. If the KV-pair is set to expire at some point, the expiration time as
-// measured in seconds since the UNIX epoch will be returned in the `expiration`
-// response header.
-func (r *KVNamespaceValueService) Get(ctx context.Context, namespaceID string, keyName string, query KVNamespaceValueGetParams, opts ...option.RequestOption) (res *string, err error) {
- opts = append(r.Options[:], opts...)
- path := fmt.Sprintf("accounts/%s/storage/kv/namespaces/%s/values/%s", query.AccountID, namespaceID, keyName)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &res, opts...)
- return
-}
-
-// Union satisfied by [KVNamespaceValueUpdateResponseUnknown] or
-// [shared.UnionString].
-type KVNamespaceValueUpdateResponse interface {
- ImplementsKVNamespaceValueUpdateResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*KVNamespaceValueUpdateResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-// Union satisfied by [KVNamespaceValueDeleteResponseUnknown] or
-// [shared.UnionString].
-type KVNamespaceValueDeleteResponse interface {
- ImplementsKVNamespaceValueDeleteResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*KVNamespaceValueDeleteResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-type KVNamespaceValueUpdateParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
- // Arbitrary JSON to be associated with a key/value pair.
- Metadata param.Field[string] `json:"metadata,required"`
- // A byte sequence to be stored, up to 25 MiB in length.
- Value param.Field[string] `json:"value,required"`
-}
-
-func (r KVNamespaceValueUpdateParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type KVNamespaceValueUpdateResponseEnvelope struct {
- Errors []KVNamespaceValueUpdateResponseEnvelopeErrors `json:"errors,required"`
- Messages []KVNamespaceValueUpdateResponseEnvelopeMessages `json:"messages,required"`
- Result KVNamespaceValueUpdateResponse `json:"result,required"`
- // Whether the API call was successful
- Success KVNamespaceValueUpdateResponseEnvelopeSuccess `json:"success,required"`
- JSON kvNamespaceValueUpdateResponseEnvelopeJSON `json:"-"`
-}
-
-// kvNamespaceValueUpdateResponseEnvelopeJSON contains the JSON metadata for the
-// struct [KVNamespaceValueUpdateResponseEnvelope]
-type kvNamespaceValueUpdateResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *KVNamespaceValueUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r kvNamespaceValueUpdateResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type KVNamespaceValueUpdateResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON kvNamespaceValueUpdateResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// kvNamespaceValueUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [KVNamespaceValueUpdateResponseEnvelopeErrors]
-type kvNamespaceValueUpdateResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *KVNamespaceValueUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r kvNamespaceValueUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type KVNamespaceValueUpdateResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON kvNamespaceValueUpdateResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// kvNamespaceValueUpdateResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [KVNamespaceValueUpdateResponseEnvelopeMessages]
-type kvNamespaceValueUpdateResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *KVNamespaceValueUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r kvNamespaceValueUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type KVNamespaceValueUpdateResponseEnvelopeSuccess bool
-
-const (
- KVNamespaceValueUpdateResponseEnvelopeSuccessTrue KVNamespaceValueUpdateResponseEnvelopeSuccess = true
-)
-
-type KVNamespaceValueDeleteParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type KVNamespaceValueDeleteResponseEnvelope struct {
- Errors []KVNamespaceValueDeleteResponseEnvelopeErrors `json:"errors,required"`
- Messages []KVNamespaceValueDeleteResponseEnvelopeMessages `json:"messages,required"`
- Result KVNamespaceValueDeleteResponse `json:"result,required"`
- // Whether the API call was successful
- Success KVNamespaceValueDeleteResponseEnvelopeSuccess `json:"success,required"`
- JSON kvNamespaceValueDeleteResponseEnvelopeJSON `json:"-"`
-}
-
-// kvNamespaceValueDeleteResponseEnvelopeJSON contains the JSON metadata for the
-// struct [KVNamespaceValueDeleteResponseEnvelope]
-type kvNamespaceValueDeleteResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *KVNamespaceValueDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r kvNamespaceValueDeleteResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type KVNamespaceValueDeleteResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON kvNamespaceValueDeleteResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// kvNamespaceValueDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [KVNamespaceValueDeleteResponseEnvelopeErrors]
-type kvNamespaceValueDeleteResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *KVNamespaceValueDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r kvNamespaceValueDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type KVNamespaceValueDeleteResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON kvNamespaceValueDeleteResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// kvNamespaceValueDeleteResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [KVNamespaceValueDeleteResponseEnvelopeMessages]
-type kvNamespaceValueDeleteResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *KVNamespaceValueDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r kvNamespaceValueDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type KVNamespaceValueDeleteResponseEnvelopeSuccess bool
-
-const (
- KVNamespaceValueDeleteResponseEnvelopeSuccessTrue KVNamespaceValueDeleteResponseEnvelopeSuccess = true
-)
-
-type KVNamespaceValueGetParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
diff --git a/kvnamespacevalue_test.go b/kvnamespacevalue_test.go
deleted file mode 100644
index 722dc1b565a..00000000000
--- a/kvnamespacevalue_test.go
+++ /dev/null
@@ -1,109 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestKVNamespaceValueUpdate(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"),
- )
- _, err := client.KV.Namespaces.Values.Update(
- context.TODO(),
- "0f2ac74b498b48028cb68387c421e279",
- "My-Key",
- cloudflare.KVNamespaceValueUpdateParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Metadata: cloudflare.F("{\"someMetadataKey\": \"someMetadataValue\"}"),
- Value: cloudflare.F("Some Value"),
- },
- )
- 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())
- }
-}
-
-func TestKVNamespaceValueDelete(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"),
- )
- _, err := client.KV.Namespaces.Values.Delete(
- context.TODO(),
- "0f2ac74b498b48028cb68387c421e279",
- "My-Key",
- cloudflare.KVNamespaceValueDeleteParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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())
- }
-}
-
-func TestKVNamespaceValueGet(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"),
- )
- _, err := client.KV.Namespaces.Values.Get(
- context.TODO(),
- "0f2ac74b498b48028cb68387c421e279",
- "My-Key",
- cloudflare.KVNamespaceValueGetParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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/load_balancers/aliases.go b/load_balancers/aliases.go
new file mode 100644
index 00000000000..90a73d005b9
--- /dev/null
+++ b/load_balancers/aliases.go
@@ -0,0 +1,9 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package load_balancers
+
+import (
+ "github.com/cloudflare/cloudflare-go/internal/apierror"
+)
+
+type Error = apierror.Error
diff --git a/load_balancers/loadbalancer.go b/load_balancers/loadbalancer.go
new file mode 100644
index 00000000000..be8ab70e1df
--- /dev/null
+++ b/load_balancers/loadbalancer.go
@@ -0,0 +1,4075 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package load_balancers
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// LoadBalancerService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewLoadBalancerService] method
+// instead.
+type LoadBalancerService struct {
+ Options []option.RequestOption
+ Monitors *MonitorService
+ Pools *PoolService
+ Previews *PreviewService
+ Regions *RegionService
+ Searches *SearchService
+}
+
+// NewLoadBalancerService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewLoadBalancerService(opts ...option.RequestOption) (r *LoadBalancerService) {
+ r = &LoadBalancerService{}
+ r.Options = opts
+ r.Monitors = NewMonitorService(opts...)
+ r.Pools = NewPoolService(opts...)
+ r.Previews = NewPreviewService(opts...)
+ r.Regions = NewRegionService(opts...)
+ r.Searches = NewSearchService(opts...)
+ return
+}
+
+// Create a new load balancer.
+func (r *LoadBalancerService) New(ctx context.Context, params LoadBalancerNewParams, opts ...option.RequestOption) (res *LoadBalancer, err error) {
+ opts = append(r.Options[:], opts...)
+ var env LoadBalancerNewResponseEnvelope
+ path := fmt.Sprintf("zones/%s/load_balancers", params.ZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Update a configured load balancer.
+func (r *LoadBalancerService) Update(ctx context.Context, loadBalancerID string, params LoadBalancerUpdateParams, opts ...option.RequestOption) (res *LoadBalancer, err error) {
+ opts = append(r.Options[:], opts...)
+ var env LoadBalancerUpdateResponseEnvelope
+ path := fmt.Sprintf("zones/%s/load_balancers/%s", params.ZoneID, loadBalancerID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// List configured load balancers.
+func (r *LoadBalancerService) List(ctx context.Context, query LoadBalancerListParams, opts ...option.RequestOption) (res *[]LoadBalancer, err error) {
+ opts = append(r.Options[:], opts...)
+ var env LoadBalancerListResponseEnvelope
+ path := fmt.Sprintf("zones/%s/load_balancers", query.ZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Delete a configured load balancer.
+func (r *LoadBalancerService) Delete(ctx context.Context, loadBalancerID string, body LoadBalancerDeleteParams, opts ...option.RequestOption) (res *LoadBalancerDeleteResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env LoadBalancerDeleteResponseEnvelope
+ path := fmt.Sprintf("zones/%s/load_balancers/%s", body.ZoneID, loadBalancerID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Apply changes to an existing load balancer, overwriting the supplied properties.
+func (r *LoadBalancerService) Edit(ctx context.Context, loadBalancerID string, params LoadBalancerEditParams, opts ...option.RequestOption) (res *LoadBalancer, err error) {
+ opts = append(r.Options[:], opts...)
+ var env LoadBalancerEditResponseEnvelope
+ path := fmt.Sprintf("zones/%s/load_balancers/%s", params.ZoneID, loadBalancerID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Fetch a single configured load balancer.
+func (r *LoadBalancerService) Get(ctx context.Context, loadBalancerID string, query LoadBalancerGetParams, opts ...option.RequestOption) (res *LoadBalancer, err error) {
+ opts = append(r.Options[:], opts...)
+ var env LoadBalancerGetResponseEnvelope
+ path := fmt.Sprintf("zones/%s/load_balancers/%s", query.ZoneID, loadBalancerID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type LoadBalancer struct {
+ ID string `json:"id"`
+ // Controls features that modify the routing of requests to pools and origins in
+ // response to dynamic conditions, such as during the interval between active
+ // health monitoring requests. For example, zero-downtime failover occurs
+ // immediately when an origin becomes unavailable due to HTTP 521, 522, or 523
+ // response codes. If there is another healthy origin in the same pool, the request
+ // is retried once against this alternate origin.
+ AdaptiveRouting LoadBalancerAdaptiveRouting `json:"adaptive_routing"`
+ // A mapping of country codes to a list of pool IDs (ordered by their failover
+ // priority) for the given country. Any country not explicitly defined will fall
+ // back to using the corresponding region_pool mapping if it exists else to
+ // default_pools.
+ CountryPools interface{} `json:"country_pools"`
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // A list of pool IDs ordered by their failover priority. Pools defined here are
+ // used by default, or when region_pools are not configured for a given region.
+ DefaultPools []string `json:"default_pools"`
+ // Object description.
+ Description string `json:"description"`
+ // Whether to enable (the default) this load balancer.
+ Enabled bool `json:"enabled"`
+ // The pool ID to use when all other pools are detected as unhealthy.
+ FallbackPool interface{} `json:"fallback_pool"`
+ // Controls location-based steering for non-proxied requests. See `steering_policy`
+ // to learn how steering is affected.
+ LocationStrategy LoadBalancerLocationStrategy `json:"location_strategy"`
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // The DNS hostname to associate with your Load Balancer. If this hostname already
+ // exists as a DNS record in Cloudflare's DNS, the Load Balancer will take
+ // precedence and the DNS record will not be used.
+ Name string `json:"name"`
+ // (Enterprise only): A mapping of Cloudflare PoP identifiers to a list of pool IDs
+ // (ordered by their failover priority) for the PoP (datacenter). Any PoPs not
+ // explicitly defined will fall back to using the corresponding country_pool, then
+ // region_pool mapping if it exists else to default_pools.
+ PopPools interface{} `json:"pop_pools"`
+ // Whether the hostname should be gray clouded (false) or orange clouded (true).
+ Proxied bool `json:"proxied"`
+ // Configures pool weights.
+ //
+ // - `steering_policy="random"`: A random pool is selected with probability
+ // proportional to pool weights.
+ // - `steering_policy="least_outstanding_requests"`: Use pool weights to scale each
+ // pool's outstanding requests.
+ // - `steering_policy="least_connections"`: Use pool weights to scale each pool's
+ // open connections.
+ RandomSteering LoadBalancerRandomSteering `json:"random_steering"`
+ // A mapping of region codes to a list of pool IDs (ordered by their failover
+ // priority) for the given region. Any regions not explicitly defined will fall
+ // back to using default_pools.
+ RegionPools interface{} `json:"region_pools"`
+ // BETA Field Not General Access: A list of rules for this load balancer to
+ // execute.
+ Rules []LoadBalancerRule `json:"rules"`
+ // Specifies the type of session affinity the load balancer should use unless
+ // specified as `"none"` or "" (default). The supported types are:
+ //
+ // - `"cookie"`: On the first request to a proxied load balancer, a cookie is
+ // generated, encoding information of which origin the request will be forwarded
+ // to. Subsequent requests, by the same client to the same load balancer, will be
+ // sent to the origin server the cookie encodes, for the duration of the cookie
+ // and as long as the origin server remains healthy. If the cookie has expired or
+ // the origin server is unhealthy, then a new origin server is calculated and
+ // used.
+ // - `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin
+ // selection is stable and based on the client's ip address.
+ // - `"header"`: On the first request to a proxied load balancer, a session key
+ // based on the configured HTTP headers (see
+ // `session_affinity_attributes.headers`) is generated, encoding the request
+ // headers used for storing in the load balancer session state which origin the
+ // request will be forwarded to. Subsequent requests to the load balancer with
+ // the same headers will be sent to the same origin server, for the duration of
+ // the session and as long as the origin server remains healthy. If the session
+ // has been idle for the duration of `session_affinity_ttl` seconds or the origin
+ // server is unhealthy, then a new origin server is calculated and used. See
+ // `headers` in `session_affinity_attributes` for additional required
+ // configuration.
+ SessionAffinity LoadBalancerSessionAffinity `json:"session_affinity"`
+ // Configures attributes for session affinity.
+ SessionAffinityAttributes LoadBalancerSessionAffinityAttributes `json:"session_affinity_attributes"`
+ // Time, in seconds, until a client's session expires after being created. Once the
+ // expiry time has been reached, subsequent requests may get sent to a different
+ // origin server. The accepted ranges per `session_affinity` policy are:
+ //
+ // - `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used
+ // unless explicitly set. The accepted range of values is between [1800, 604800].
+ // - `"header"`: The current default of 1800 seconds will be used unless explicitly
+ // set. The accepted range of values is between [30, 3600]. Note: With session
+ // affinity by header, sessions only expire after they haven't been used for the
+ // number of seconds specified.
+ SessionAffinityTTL float64 `json:"session_affinity_ttl"`
+ // Steering Policy for this load balancer.
+ //
+ // - `"off"`: Use `default_pools`.
+ // - `"geo"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied
+ // requests, the country for `country_pools` is determined by
+ // `location_strategy`.
+ // - `"random"`: Select a pool randomly.
+ // - `"dynamic_latency"`: Use round trip time to select the closest pool in
+ // default_pools (requires pool health checks).
+ // - `"proximity"`: Use the pools' latitude and longitude to select the closest
+ // pool using the Cloudflare PoP location for proxied requests or the location
+ // determined by `location_strategy` for non-proxied requests.
+ // - `"least_outstanding_requests"`: Select a pool by taking into consideration
+ // `random_steering` weights, as well as each pool's number of outstanding
+ // requests. Pools with more pending requests are weighted proportionately less
+ // relative to others.
+ // - `"least_connections"`: Select a pool by taking into consideration
+ // `random_steering` weights, as well as each pool's number of open connections.
+ // Pools with more open connections are weighted proportionately less relative to
+ // others. Supported for HTTP/1 and HTTP/2 connections.
+ // - `""`: Will map to `"geo"` if you use
+ // `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.
+ SteeringPolicy LoadBalancerSteeringPolicy `json:"steering_policy"`
+ // Time to live (TTL) of the DNS entry for the IP address returned by this load
+ // balancer. This only applies to gray-clouded (unproxied) load balancers.
+ TTL float64 `json:"ttl"`
+ JSON loadBalancerJSON `json:"-"`
+}
+
+// loadBalancerJSON contains the JSON metadata for the struct [LoadBalancer]
+type loadBalancerJSON struct {
+ ID apijson.Field
+ AdaptiveRouting apijson.Field
+ CountryPools apijson.Field
+ CreatedOn apijson.Field
+ DefaultPools apijson.Field
+ Description apijson.Field
+ Enabled apijson.Field
+ FallbackPool apijson.Field
+ LocationStrategy apijson.Field
+ ModifiedOn apijson.Field
+ Name apijson.Field
+ PopPools apijson.Field
+ Proxied apijson.Field
+ RandomSteering apijson.Field
+ RegionPools apijson.Field
+ Rules apijson.Field
+ SessionAffinity apijson.Field
+ SessionAffinityAttributes apijson.Field
+ SessionAffinityTTL apijson.Field
+ SteeringPolicy apijson.Field
+ TTL apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LoadBalancer) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r loadBalancerJSON) RawJSON() string {
+ return r.raw
+}
+
+// Controls features that modify the routing of requests to pools and origins in
+// response to dynamic conditions, such as during the interval between active
+// health monitoring requests. For example, zero-downtime failover occurs
+// immediately when an origin becomes unavailable due to HTTP 521, 522, or 523
+// response codes. If there is another healthy origin in the same pool, the request
+// is retried once against this alternate origin.
+type LoadBalancerAdaptiveRouting struct {
+ // Extends zero-downtime failover of requests to healthy origins from alternate
+ // pools, when no healthy alternate exists in the same pool, according to the
+ // failover order defined by traffic and origin steering. When set false (the
+ // default) zero-downtime failover will only occur between origins within the same
+ // pool. See `session_affinity_attributes` for control over when sessions are
+ // broken or reassigned.
+ FailoverAcrossPools bool `json:"failover_across_pools"`
+ JSON loadBalancerAdaptiveRoutingJSON `json:"-"`
+}
+
+// loadBalancerAdaptiveRoutingJSON contains the JSON metadata for the struct
+// [LoadBalancerAdaptiveRouting]
+type loadBalancerAdaptiveRoutingJSON struct {
+ FailoverAcrossPools apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LoadBalancerAdaptiveRouting) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r loadBalancerAdaptiveRoutingJSON) RawJSON() string {
+ return r.raw
+}
+
+// Controls location-based steering for non-proxied requests. See `steering_policy`
+// to learn how steering is affected.
+type LoadBalancerLocationStrategy struct {
+ // Determines the authoritative location when ECS is not preferred, does not exist
+ // in the request, or its GeoIP lookup is unsuccessful.
+ //
+ // - `"pop"`: Use the Cloudflare PoP location.
+ // - `"resolver_ip"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is
+ // unsuccessful, use the Cloudflare PoP location.
+ Mode LoadBalancerLocationStrategyMode `json:"mode"`
+ // Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the
+ // authoritative location.
+ //
+ // - `"always"`: Always prefer ECS.
+ // - `"never"`: Never prefer ECS.
+ // - `"proximity"`: Prefer ECS only when `steering_policy="proximity"`.
+ // - `"geo"`: Prefer ECS only when `steering_policy="geo"`.
+ PreferEcs LoadBalancerLocationStrategyPreferEcs `json:"prefer_ecs"`
+ JSON loadBalancerLocationStrategyJSON `json:"-"`
+}
+
+// loadBalancerLocationStrategyJSON contains the JSON metadata for the struct
+// [LoadBalancerLocationStrategy]
+type loadBalancerLocationStrategyJSON struct {
+ Mode apijson.Field
+ PreferEcs apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LoadBalancerLocationStrategy) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r loadBalancerLocationStrategyJSON) RawJSON() string {
+ return r.raw
+}
+
+// Determines the authoritative location when ECS is not preferred, does not exist
+// in the request, or its GeoIP lookup is unsuccessful.
+//
+// - `"pop"`: Use the Cloudflare PoP location.
+// - `"resolver_ip"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is
+// unsuccessful, use the Cloudflare PoP location.
+type LoadBalancerLocationStrategyMode string
+
+const (
+ LoadBalancerLocationStrategyModePop LoadBalancerLocationStrategyMode = "pop"
+ LoadBalancerLocationStrategyModeResolverIP LoadBalancerLocationStrategyMode = "resolver_ip"
+)
+
+// Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the
+// authoritative location.
+//
+// - `"always"`: Always prefer ECS.
+// - `"never"`: Never prefer ECS.
+// - `"proximity"`: Prefer ECS only when `steering_policy="proximity"`.
+// - `"geo"`: Prefer ECS only when `steering_policy="geo"`.
+type LoadBalancerLocationStrategyPreferEcs string
+
+const (
+ LoadBalancerLocationStrategyPreferEcsAlways LoadBalancerLocationStrategyPreferEcs = "always"
+ LoadBalancerLocationStrategyPreferEcsNever LoadBalancerLocationStrategyPreferEcs = "never"
+ LoadBalancerLocationStrategyPreferEcsProximity LoadBalancerLocationStrategyPreferEcs = "proximity"
+ LoadBalancerLocationStrategyPreferEcsGeo LoadBalancerLocationStrategyPreferEcs = "geo"
+)
+
+// Configures pool weights.
+//
+// - `steering_policy="random"`: A random pool is selected with probability
+// proportional to pool weights.
+// - `steering_policy="least_outstanding_requests"`: Use pool weights to scale each
+// pool's outstanding requests.
+// - `steering_policy="least_connections"`: Use pool weights to scale each pool's
+// open connections.
+type LoadBalancerRandomSteering struct {
+ // The default weight for pools in the load balancer that are not specified in the
+ // pool_weights map.
+ DefaultWeight float64 `json:"default_weight"`
+ // A mapping of pool IDs to custom weights. The weight is relative to other pools
+ // in the load balancer.
+ PoolWeights interface{} `json:"pool_weights"`
+ JSON loadBalancerRandomSteeringJSON `json:"-"`
+}
+
+// loadBalancerRandomSteeringJSON contains the JSON metadata for the struct
+// [LoadBalancerRandomSteering]
+type loadBalancerRandomSteeringJSON struct {
+ DefaultWeight apijson.Field
+ PoolWeights apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LoadBalancerRandomSteering) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r loadBalancerRandomSteeringJSON) RawJSON() string {
+ return r.raw
+}
+
+// A rule object containing conditions and overrides for this load balancer to
+// evaluate.
+type LoadBalancerRule struct {
+ // The condition expressions to evaluate. If the condition evaluates to true, the
+ // overrides or fixed_response in this rule will be applied. An empty condition is
+ // always true. For more details on condition expressions, please see
+ // https://developers.cloudflare.com/load-balancing/understand-basics/load-balancing-rules/expressions.
+ Condition string `json:"condition"`
+ // Disable this specific rule. It will no longer be evaluated by this load
+ // balancer.
+ Disabled bool `json:"disabled"`
+ // A collection of fields used to directly respond to the eyeball instead of
+ // routing to a pool. If a fixed_response is supplied the rule will be marked as
+ // terminates.
+ FixedResponse LoadBalancerRulesFixedResponse `json:"fixed_response"`
+ // Name of this rule. Only used for human readability.
+ Name string `json:"name"`
+ // A collection of overrides to apply to the load balancer when this rule's
+ // condition is true. All fields are optional.
+ Overrides LoadBalancerRulesOverrides `json:"overrides"`
+ // The order in which rules should be executed in relation to each other. Lower
+ // values are executed first. Values do not need to be sequential. If no value is
+ // provided for any rule the array order of the rules field will be used to assign
+ // a priority.
+ Priority int64 `json:"priority"`
+ // If this rule's condition is true, this causes rule evaluation to stop after
+ // processing this rule.
+ Terminates bool `json:"terminates"`
+ JSON loadBalancerRuleJSON `json:"-"`
+}
+
+// loadBalancerRuleJSON contains the JSON metadata for the struct
+// [LoadBalancerRule]
+type loadBalancerRuleJSON struct {
+ Condition apijson.Field
+ Disabled apijson.Field
+ FixedResponse apijson.Field
+ Name apijson.Field
+ Overrides apijson.Field
+ Priority apijson.Field
+ Terminates apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LoadBalancerRule) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r loadBalancerRuleJSON) RawJSON() string {
+ return r.raw
+}
+
+// A collection of fields used to directly respond to the eyeball instead of
+// routing to a pool. If a fixed_response is supplied the rule will be marked as
+// terminates.
+type LoadBalancerRulesFixedResponse struct {
+ // The http 'Content-Type' header to include in the response.
+ ContentType string `json:"content_type"`
+ // The http 'Location' header to include in the response.
+ Location string `json:"location"`
+ // Text to include as the http body.
+ MessageBody string `json:"message_body"`
+ // The http status code to respond with.
+ StatusCode int64 `json:"status_code"`
+ JSON loadBalancerRulesFixedResponseJSON `json:"-"`
+}
+
+// loadBalancerRulesFixedResponseJSON contains the JSON metadata for the struct
+// [LoadBalancerRulesFixedResponse]
+type loadBalancerRulesFixedResponseJSON struct {
+ ContentType apijson.Field
+ Location apijson.Field
+ MessageBody apijson.Field
+ StatusCode apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LoadBalancerRulesFixedResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r loadBalancerRulesFixedResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+// A collection of overrides to apply to the load balancer when this rule's
+// condition is true. All fields are optional.
+type LoadBalancerRulesOverrides struct {
+ // Controls features that modify the routing of requests to pools and origins in
+ // response to dynamic conditions, such as during the interval between active
+ // health monitoring requests. For example, zero-downtime failover occurs
+ // immediately when an origin becomes unavailable due to HTTP 521, 522, or 523
+ // response codes. If there is another healthy origin in the same pool, the request
+ // is retried once against this alternate origin.
+ AdaptiveRouting LoadBalancerRulesOverridesAdaptiveRouting `json:"adaptive_routing"`
+ // A mapping of country codes to a list of pool IDs (ordered by their failover
+ // priority) for the given country. Any country not explicitly defined will fall
+ // back to using the corresponding region_pool mapping if it exists else to
+ // default_pools.
+ CountryPools interface{} `json:"country_pools"`
+ // A list of pool IDs ordered by their failover priority. Pools defined here are
+ // used by default, or when region_pools are not configured for a given region.
+ DefaultPools []string `json:"default_pools"`
+ // The pool ID to use when all other pools are detected as unhealthy.
+ FallbackPool interface{} `json:"fallback_pool"`
+ // Controls location-based steering for non-proxied requests. See `steering_policy`
+ // to learn how steering is affected.
+ LocationStrategy LoadBalancerRulesOverridesLocationStrategy `json:"location_strategy"`
+ // (Enterprise only): A mapping of Cloudflare PoP identifiers to a list of pool IDs
+ // (ordered by their failover priority) for the PoP (datacenter). Any PoPs not
+ // explicitly defined will fall back to using the corresponding country_pool, then
+ // region_pool mapping if it exists else to default_pools.
+ PopPools interface{} `json:"pop_pools"`
+ // Configures pool weights.
+ //
+ // - `steering_policy="random"`: A random pool is selected with probability
+ // proportional to pool weights.
+ // - `steering_policy="least_outstanding_requests"`: Use pool weights to scale each
+ // pool's outstanding requests.
+ // - `steering_policy="least_connections"`: Use pool weights to scale each pool's
+ // open connections.
+ RandomSteering LoadBalancerRulesOverridesRandomSteering `json:"random_steering"`
+ // A mapping of region codes to a list of pool IDs (ordered by their failover
+ // priority) for the given region. Any regions not explicitly defined will fall
+ // back to using default_pools.
+ RegionPools interface{} `json:"region_pools"`
+ // Specifies the type of session affinity the load balancer should use unless
+ // specified as `"none"` or "" (default). The supported types are:
+ //
+ // - `"cookie"`: On the first request to a proxied load balancer, a cookie is
+ // generated, encoding information of which origin the request will be forwarded
+ // to. Subsequent requests, by the same client to the same load balancer, will be
+ // sent to the origin server the cookie encodes, for the duration of the cookie
+ // and as long as the origin server remains healthy. If the cookie has expired or
+ // the origin server is unhealthy, then a new origin server is calculated and
+ // used.
+ // - `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin
+ // selection is stable and based on the client's ip address.
+ // - `"header"`: On the first request to a proxied load balancer, a session key
+ // based on the configured HTTP headers (see
+ // `session_affinity_attributes.headers`) is generated, encoding the request
+ // headers used for storing in the load balancer session state which origin the
+ // request will be forwarded to. Subsequent requests to the load balancer with
+ // the same headers will be sent to the same origin server, for the duration of
+ // the session and as long as the origin server remains healthy. If the session
+ // has been idle for the duration of `session_affinity_ttl` seconds or the origin
+ // server is unhealthy, then a new origin server is calculated and used. See
+ // `headers` in `session_affinity_attributes` for additional required
+ // configuration.
+ SessionAffinity LoadBalancerRulesOverridesSessionAffinity `json:"session_affinity"`
+ // Configures attributes for session affinity.
+ SessionAffinityAttributes LoadBalancerRulesOverridesSessionAffinityAttributes `json:"session_affinity_attributes"`
+ // Time, in seconds, until a client's session expires after being created. Once the
+ // expiry time has been reached, subsequent requests may get sent to a different
+ // origin server. The accepted ranges per `session_affinity` policy are:
+ //
+ // - `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used
+ // unless explicitly set. The accepted range of values is between [1800, 604800].
+ // - `"header"`: The current default of 1800 seconds will be used unless explicitly
+ // set. The accepted range of values is between [30, 3600]. Note: With session
+ // affinity by header, sessions only expire after they haven't been used for the
+ // number of seconds specified.
+ SessionAffinityTTL float64 `json:"session_affinity_ttl"`
+ // Steering Policy for this load balancer.
+ //
+ // - `"off"`: Use `default_pools`.
+ // - `"geo"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied
+ // requests, the country for `country_pools` is determined by
+ // `location_strategy`.
+ // - `"random"`: Select a pool randomly.
+ // - `"dynamic_latency"`: Use round trip time to select the closest pool in
+ // default_pools (requires pool health checks).
+ // - `"proximity"`: Use the pools' latitude and longitude to select the closest
+ // pool using the Cloudflare PoP location for proxied requests or the location
+ // determined by `location_strategy` for non-proxied requests.
+ // - `"least_outstanding_requests"`: Select a pool by taking into consideration
+ // `random_steering` weights, as well as each pool's number of outstanding
+ // requests. Pools with more pending requests are weighted proportionately less
+ // relative to others.
+ // - `"least_connections"`: Select a pool by taking into consideration
+ // `random_steering` weights, as well as each pool's number of open connections.
+ // Pools with more open connections are weighted proportionately less relative to
+ // others. Supported for HTTP/1 and HTTP/2 connections.
+ // - `""`: Will map to `"geo"` if you use
+ // `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.
+ SteeringPolicy LoadBalancerRulesOverridesSteeringPolicy `json:"steering_policy"`
+ // Time to live (TTL) of the DNS entry for the IP address returned by this load
+ // balancer. This only applies to gray-clouded (unproxied) load balancers.
+ TTL float64 `json:"ttl"`
+ JSON loadBalancerRulesOverridesJSON `json:"-"`
+}
+
+// loadBalancerRulesOverridesJSON contains the JSON metadata for the struct
+// [LoadBalancerRulesOverrides]
+type loadBalancerRulesOverridesJSON struct {
+ AdaptiveRouting apijson.Field
+ CountryPools apijson.Field
+ DefaultPools apijson.Field
+ FallbackPool apijson.Field
+ LocationStrategy apijson.Field
+ PopPools apijson.Field
+ RandomSteering apijson.Field
+ RegionPools apijson.Field
+ SessionAffinity apijson.Field
+ SessionAffinityAttributes apijson.Field
+ SessionAffinityTTL apijson.Field
+ SteeringPolicy apijson.Field
+ TTL apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LoadBalancerRulesOverrides) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r loadBalancerRulesOverridesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Controls features that modify the routing of requests to pools and origins in
+// response to dynamic conditions, such as during the interval between active
+// health monitoring requests. For example, zero-downtime failover occurs
+// immediately when an origin becomes unavailable due to HTTP 521, 522, or 523
+// response codes. If there is another healthy origin in the same pool, the request
+// is retried once against this alternate origin.
+type LoadBalancerRulesOverridesAdaptiveRouting struct {
+ // Extends zero-downtime failover of requests to healthy origins from alternate
+ // pools, when no healthy alternate exists in the same pool, according to the
+ // failover order defined by traffic and origin steering. When set false (the
+ // default) zero-downtime failover will only occur between origins within the same
+ // pool. See `session_affinity_attributes` for control over when sessions are
+ // broken or reassigned.
+ FailoverAcrossPools bool `json:"failover_across_pools"`
+ JSON loadBalancerRulesOverridesAdaptiveRoutingJSON `json:"-"`
+}
+
+// loadBalancerRulesOverridesAdaptiveRoutingJSON contains the JSON metadata for the
+// struct [LoadBalancerRulesOverridesAdaptiveRouting]
+type loadBalancerRulesOverridesAdaptiveRoutingJSON struct {
+ FailoverAcrossPools apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LoadBalancerRulesOverridesAdaptiveRouting) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r loadBalancerRulesOverridesAdaptiveRoutingJSON) RawJSON() string {
+ return r.raw
+}
+
+// Controls location-based steering for non-proxied requests. See `steering_policy`
+// to learn how steering is affected.
+type LoadBalancerRulesOverridesLocationStrategy struct {
+ // Determines the authoritative location when ECS is not preferred, does not exist
+ // in the request, or its GeoIP lookup is unsuccessful.
+ //
+ // - `"pop"`: Use the Cloudflare PoP location.
+ // - `"resolver_ip"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is
+ // unsuccessful, use the Cloudflare PoP location.
+ Mode LoadBalancerRulesOverridesLocationStrategyMode `json:"mode"`
+ // Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the
+ // authoritative location.
+ //
+ // - `"always"`: Always prefer ECS.
+ // - `"never"`: Never prefer ECS.
+ // - `"proximity"`: Prefer ECS only when `steering_policy="proximity"`.
+ // - `"geo"`: Prefer ECS only when `steering_policy="geo"`.
+ PreferEcs LoadBalancerRulesOverridesLocationStrategyPreferEcs `json:"prefer_ecs"`
+ JSON loadBalancerRulesOverridesLocationStrategyJSON `json:"-"`
+}
+
+// loadBalancerRulesOverridesLocationStrategyJSON contains the JSON metadata for
+// the struct [LoadBalancerRulesOverridesLocationStrategy]
+type loadBalancerRulesOverridesLocationStrategyJSON struct {
+ Mode apijson.Field
+ PreferEcs apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LoadBalancerRulesOverridesLocationStrategy) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r loadBalancerRulesOverridesLocationStrategyJSON) RawJSON() string {
+ return r.raw
+}
+
+// Determines the authoritative location when ECS is not preferred, does not exist
+// in the request, or its GeoIP lookup is unsuccessful.
+//
+// - `"pop"`: Use the Cloudflare PoP location.
+// - `"resolver_ip"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is
+// unsuccessful, use the Cloudflare PoP location.
+type LoadBalancerRulesOverridesLocationStrategyMode string
+
+const (
+ LoadBalancerRulesOverridesLocationStrategyModePop LoadBalancerRulesOverridesLocationStrategyMode = "pop"
+ LoadBalancerRulesOverridesLocationStrategyModeResolverIP LoadBalancerRulesOverridesLocationStrategyMode = "resolver_ip"
+)
+
+// Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the
+// authoritative location.
+//
+// - `"always"`: Always prefer ECS.
+// - `"never"`: Never prefer ECS.
+// - `"proximity"`: Prefer ECS only when `steering_policy="proximity"`.
+// - `"geo"`: Prefer ECS only when `steering_policy="geo"`.
+type LoadBalancerRulesOverridesLocationStrategyPreferEcs string
+
+const (
+ LoadBalancerRulesOverridesLocationStrategyPreferEcsAlways LoadBalancerRulesOverridesLocationStrategyPreferEcs = "always"
+ LoadBalancerRulesOverridesLocationStrategyPreferEcsNever LoadBalancerRulesOverridesLocationStrategyPreferEcs = "never"
+ LoadBalancerRulesOverridesLocationStrategyPreferEcsProximity LoadBalancerRulesOverridesLocationStrategyPreferEcs = "proximity"
+ LoadBalancerRulesOverridesLocationStrategyPreferEcsGeo LoadBalancerRulesOverridesLocationStrategyPreferEcs = "geo"
+)
+
+// Configures pool weights.
+//
+// - `steering_policy="random"`: A random pool is selected with probability
+// proportional to pool weights.
+// - `steering_policy="least_outstanding_requests"`: Use pool weights to scale each
+// pool's outstanding requests.
+// - `steering_policy="least_connections"`: Use pool weights to scale each pool's
+// open connections.
+type LoadBalancerRulesOverridesRandomSteering struct {
+ // The default weight for pools in the load balancer that are not specified in the
+ // pool_weights map.
+ DefaultWeight float64 `json:"default_weight"`
+ // A mapping of pool IDs to custom weights. The weight is relative to other pools
+ // in the load balancer.
+ PoolWeights interface{} `json:"pool_weights"`
+ JSON loadBalancerRulesOverridesRandomSteeringJSON `json:"-"`
+}
+
+// loadBalancerRulesOverridesRandomSteeringJSON contains the JSON metadata for the
+// struct [LoadBalancerRulesOverridesRandomSteering]
+type loadBalancerRulesOverridesRandomSteeringJSON struct {
+ DefaultWeight apijson.Field
+ PoolWeights apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LoadBalancerRulesOverridesRandomSteering) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r loadBalancerRulesOverridesRandomSteeringJSON) RawJSON() string {
+ return r.raw
+}
+
+// Specifies the type of session affinity the load balancer should use unless
+// specified as `"none"` or "" (default). The supported types are:
+//
+// - `"cookie"`: On the first request to a proxied load balancer, a cookie is
+// generated, encoding information of which origin the request will be forwarded
+// to. Subsequent requests, by the same client to the same load balancer, will be
+// sent to the origin server the cookie encodes, for the duration of the cookie
+// and as long as the origin server remains healthy. If the cookie has expired or
+// the origin server is unhealthy, then a new origin server is calculated and
+// used.
+// - `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin
+// selection is stable and based on the client's ip address.
+// - `"header"`: On the first request to a proxied load balancer, a session key
+// based on the configured HTTP headers (see
+// `session_affinity_attributes.headers`) is generated, encoding the request
+// headers used for storing in the load balancer session state which origin the
+// request will be forwarded to. Subsequent requests to the load balancer with
+// the same headers will be sent to the same origin server, for the duration of
+// the session and as long as the origin server remains healthy. If the session
+// has been idle for the duration of `session_affinity_ttl` seconds or the origin
+// server is unhealthy, then a new origin server is calculated and used. See
+// `headers` in `session_affinity_attributes` for additional required
+// configuration.
+type LoadBalancerRulesOverridesSessionAffinity string
+
+const (
+ LoadBalancerRulesOverridesSessionAffinityNone LoadBalancerRulesOverridesSessionAffinity = "none"
+ LoadBalancerRulesOverridesSessionAffinityCookie LoadBalancerRulesOverridesSessionAffinity = "cookie"
+ LoadBalancerRulesOverridesSessionAffinityIPCookie LoadBalancerRulesOverridesSessionAffinity = "ip_cookie"
+ LoadBalancerRulesOverridesSessionAffinityHeader LoadBalancerRulesOverridesSessionAffinity = "header"
+ LoadBalancerRulesOverridesSessionAffinityEmpty LoadBalancerRulesOverridesSessionAffinity = "\"\""
+)
+
+// Configures attributes for session affinity.
+type LoadBalancerRulesOverridesSessionAffinityAttributes struct {
+ // Configures the drain duration in seconds. This field is only used when session
+ // affinity is enabled on the load balancer.
+ DrainDuration float64 `json:"drain_duration"`
+ // Configures the names of HTTP headers to base session affinity on when header
+ // `session_affinity` is enabled. At least one HTTP header name must be provided.
+ // To specify the exact cookies to be used, include an item in the following
+ // format: `"cookie:,"` (example) where everything
+ // after the colon is a comma-separated list of cookie names. Providing only
+ // `"cookie"` will result in all cookies being used. The default max number of HTTP
+ // header names that can be provided depends on your plan: 5 for Enterprise, 1 for
+ // all other plans.
+ Headers []string `json:"headers"`
+ // When header `session_affinity` is enabled, this option can be used to specify
+ // how HTTP headers on load balancing requests will be used. The supported values
+ // are:
+ //
+ // - `"true"`: Load balancing requests must contain _all_ of the HTTP headers
+ // specified by the `headers` session affinity attribute, otherwise sessions
+ // aren't created.
+ // - `"false"`: Load balancing requests must contain _at least one_ of the HTTP
+ // headers specified by the `headers` session affinity attribute, otherwise
+ // sessions aren't created.
+ RequireAllHeaders bool `json:"require_all_headers"`
+ // Configures the SameSite attribute on session affinity cookie. Value "Auto" will
+ // be translated to "Lax" or "None" depending if Always Use HTTPS is enabled. Note:
+ // when using value "None", the secure attribute can not be set to "Never".
+ Samesite LoadBalancerRulesOverridesSessionAffinityAttributesSamesite `json:"samesite"`
+ // Configures the Secure attribute on session affinity cookie. Value "Always"
+ // indicates the Secure attribute will be set in the Set-Cookie header, "Never"
+ // indicates the Secure attribute will not be set, and "Auto" will set the Secure
+ // attribute depending if Always Use HTTPS is enabled.
+ Secure LoadBalancerRulesOverridesSessionAffinityAttributesSecure `json:"secure"`
+ // Configures the zero-downtime failover between origins within a pool when session
+ // affinity is enabled. This feature is currently incompatible with Argo, Tiered
+ // Cache, and Bandwidth Alliance. The supported values are:
+ //
+ // - `"none"`: No failover takes place for sessions pinned to the origin (default).
+ // - `"temporary"`: Traffic will be sent to another other healthy origin until the
+ // originally pinned origin is available; note that this can potentially result
+ // in heavy origin flapping.
+ // - `"sticky"`: The session affinity cookie is updated and subsequent requests are
+ // sent to the new origin. Note: Zero-downtime failover with sticky sessions is
+ // currently not supported for session affinity by header.
+ ZeroDowntimeFailover LoadBalancerRulesOverridesSessionAffinityAttributesZeroDowntimeFailover `json:"zero_downtime_failover"`
+ JSON loadBalancerRulesOverridesSessionAffinityAttributesJSON `json:"-"`
+}
+
+// loadBalancerRulesOverridesSessionAffinityAttributesJSON contains the JSON
+// metadata for the struct [LoadBalancerRulesOverridesSessionAffinityAttributes]
+type loadBalancerRulesOverridesSessionAffinityAttributesJSON struct {
+ DrainDuration apijson.Field
+ Headers apijson.Field
+ RequireAllHeaders apijson.Field
+ Samesite apijson.Field
+ Secure apijson.Field
+ ZeroDowntimeFailover apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LoadBalancerRulesOverridesSessionAffinityAttributes) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r loadBalancerRulesOverridesSessionAffinityAttributesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Configures the SameSite attribute on session affinity cookie. Value "Auto" will
+// be translated to "Lax" or "None" depending if Always Use HTTPS is enabled. Note:
+// when using value "None", the secure attribute can not be set to "Never".
+type LoadBalancerRulesOverridesSessionAffinityAttributesSamesite string
+
+const (
+ LoadBalancerRulesOverridesSessionAffinityAttributesSamesiteAuto LoadBalancerRulesOverridesSessionAffinityAttributesSamesite = "Auto"
+ LoadBalancerRulesOverridesSessionAffinityAttributesSamesiteLax LoadBalancerRulesOverridesSessionAffinityAttributesSamesite = "Lax"
+ LoadBalancerRulesOverridesSessionAffinityAttributesSamesiteNone LoadBalancerRulesOverridesSessionAffinityAttributesSamesite = "None"
+ LoadBalancerRulesOverridesSessionAffinityAttributesSamesiteStrict LoadBalancerRulesOverridesSessionAffinityAttributesSamesite = "Strict"
+)
+
+// Configures the Secure attribute on session affinity cookie. Value "Always"
+// indicates the Secure attribute will be set in the Set-Cookie header, "Never"
+// indicates the Secure attribute will not be set, and "Auto" will set the Secure
+// attribute depending if Always Use HTTPS is enabled.
+type LoadBalancerRulesOverridesSessionAffinityAttributesSecure string
+
+const (
+ LoadBalancerRulesOverridesSessionAffinityAttributesSecureAuto LoadBalancerRulesOverridesSessionAffinityAttributesSecure = "Auto"
+ LoadBalancerRulesOverridesSessionAffinityAttributesSecureAlways LoadBalancerRulesOverridesSessionAffinityAttributesSecure = "Always"
+ LoadBalancerRulesOverridesSessionAffinityAttributesSecureNever LoadBalancerRulesOverridesSessionAffinityAttributesSecure = "Never"
+)
+
+// Configures the zero-downtime failover between origins within a pool when session
+// affinity is enabled. This feature is currently incompatible with Argo, Tiered
+// Cache, and Bandwidth Alliance. The supported values are:
+//
+// - `"none"`: No failover takes place for sessions pinned to the origin (default).
+// - `"temporary"`: Traffic will be sent to another other healthy origin until the
+// originally pinned origin is available; note that this can potentially result
+// in heavy origin flapping.
+// - `"sticky"`: The session affinity cookie is updated and subsequent requests are
+// sent to the new origin. Note: Zero-downtime failover with sticky sessions is
+// currently not supported for session affinity by header.
+type LoadBalancerRulesOverridesSessionAffinityAttributesZeroDowntimeFailover string
+
+const (
+ LoadBalancerRulesOverridesSessionAffinityAttributesZeroDowntimeFailoverNone LoadBalancerRulesOverridesSessionAffinityAttributesZeroDowntimeFailover = "none"
+ LoadBalancerRulesOverridesSessionAffinityAttributesZeroDowntimeFailoverTemporary LoadBalancerRulesOverridesSessionAffinityAttributesZeroDowntimeFailover = "temporary"
+ LoadBalancerRulesOverridesSessionAffinityAttributesZeroDowntimeFailoverSticky LoadBalancerRulesOverridesSessionAffinityAttributesZeroDowntimeFailover = "sticky"
+)
+
+// Steering Policy for this load balancer.
+//
+// - `"off"`: Use `default_pools`.
+// - `"geo"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied
+// requests, the country for `country_pools` is determined by
+// `location_strategy`.
+// - `"random"`: Select a pool randomly.
+// - `"dynamic_latency"`: Use round trip time to select the closest pool in
+// default_pools (requires pool health checks).
+// - `"proximity"`: Use the pools' latitude and longitude to select the closest
+// pool using the Cloudflare PoP location for proxied requests or the location
+// determined by `location_strategy` for non-proxied requests.
+// - `"least_outstanding_requests"`: Select a pool by taking into consideration
+// `random_steering` weights, as well as each pool's number of outstanding
+// requests. Pools with more pending requests are weighted proportionately less
+// relative to others.
+// - `"least_connections"`: Select a pool by taking into consideration
+// `random_steering` weights, as well as each pool's number of open connections.
+// Pools with more open connections are weighted proportionately less relative to
+// others. Supported for HTTP/1 and HTTP/2 connections.
+// - `""`: Will map to `"geo"` if you use
+// `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.
+type LoadBalancerRulesOverridesSteeringPolicy string
+
+const (
+ LoadBalancerRulesOverridesSteeringPolicyOff LoadBalancerRulesOverridesSteeringPolicy = "off"
+ LoadBalancerRulesOverridesSteeringPolicyGeo LoadBalancerRulesOverridesSteeringPolicy = "geo"
+ LoadBalancerRulesOverridesSteeringPolicyRandom LoadBalancerRulesOverridesSteeringPolicy = "random"
+ LoadBalancerRulesOverridesSteeringPolicyDynamicLatency LoadBalancerRulesOverridesSteeringPolicy = "dynamic_latency"
+ LoadBalancerRulesOverridesSteeringPolicyProximity LoadBalancerRulesOverridesSteeringPolicy = "proximity"
+ LoadBalancerRulesOverridesSteeringPolicyLeastOutstandingRequests LoadBalancerRulesOverridesSteeringPolicy = "least_outstanding_requests"
+ LoadBalancerRulesOverridesSteeringPolicyLeastConnections LoadBalancerRulesOverridesSteeringPolicy = "least_connections"
+ LoadBalancerRulesOverridesSteeringPolicyEmpty LoadBalancerRulesOverridesSteeringPolicy = "\"\""
+)
+
+// Specifies the type of session affinity the load balancer should use unless
+// specified as `"none"` or "" (default). The supported types are:
+//
+// - `"cookie"`: On the first request to a proxied load balancer, a cookie is
+// generated, encoding information of which origin the request will be forwarded
+// to. Subsequent requests, by the same client to the same load balancer, will be
+// sent to the origin server the cookie encodes, for the duration of the cookie
+// and as long as the origin server remains healthy. If the cookie has expired or
+// the origin server is unhealthy, then a new origin server is calculated and
+// used.
+// - `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin
+// selection is stable and based on the client's ip address.
+// - `"header"`: On the first request to a proxied load balancer, a session key
+// based on the configured HTTP headers (see
+// `session_affinity_attributes.headers`) is generated, encoding the request
+// headers used for storing in the load balancer session state which origin the
+// request will be forwarded to. Subsequent requests to the load balancer with
+// the same headers will be sent to the same origin server, for the duration of
+// the session and as long as the origin server remains healthy. If the session
+// has been idle for the duration of `session_affinity_ttl` seconds or the origin
+// server is unhealthy, then a new origin server is calculated and used. See
+// `headers` in `session_affinity_attributes` for additional required
+// configuration.
+type LoadBalancerSessionAffinity string
+
+const (
+ LoadBalancerSessionAffinityNone LoadBalancerSessionAffinity = "none"
+ LoadBalancerSessionAffinityCookie LoadBalancerSessionAffinity = "cookie"
+ LoadBalancerSessionAffinityIPCookie LoadBalancerSessionAffinity = "ip_cookie"
+ LoadBalancerSessionAffinityHeader LoadBalancerSessionAffinity = "header"
+ LoadBalancerSessionAffinityEmpty LoadBalancerSessionAffinity = "\"\""
+)
+
+// Configures attributes for session affinity.
+type LoadBalancerSessionAffinityAttributes struct {
+ // Configures the drain duration in seconds. This field is only used when session
+ // affinity is enabled on the load balancer.
+ DrainDuration float64 `json:"drain_duration"`
+ // Configures the names of HTTP headers to base session affinity on when header
+ // `session_affinity` is enabled. At least one HTTP header name must be provided.
+ // To specify the exact cookies to be used, include an item in the following
+ // format: `"cookie:,"` (example) where everything
+ // after the colon is a comma-separated list of cookie names. Providing only
+ // `"cookie"` will result in all cookies being used. The default max number of HTTP
+ // header names that can be provided depends on your plan: 5 for Enterprise, 1 for
+ // all other plans.
+ Headers []string `json:"headers"`
+ // When header `session_affinity` is enabled, this option can be used to specify
+ // how HTTP headers on load balancing requests will be used. The supported values
+ // are:
+ //
+ // - `"true"`: Load balancing requests must contain _all_ of the HTTP headers
+ // specified by the `headers` session affinity attribute, otherwise sessions
+ // aren't created.
+ // - `"false"`: Load balancing requests must contain _at least one_ of the HTTP
+ // headers specified by the `headers` session affinity attribute, otherwise
+ // sessions aren't created.
+ RequireAllHeaders bool `json:"require_all_headers"`
+ // Configures the SameSite attribute on session affinity cookie. Value "Auto" will
+ // be translated to "Lax" or "None" depending if Always Use HTTPS is enabled. Note:
+ // when using value "None", the secure attribute can not be set to "Never".
+ Samesite LoadBalancerSessionAffinityAttributesSamesite `json:"samesite"`
+ // Configures the Secure attribute on session affinity cookie. Value "Always"
+ // indicates the Secure attribute will be set in the Set-Cookie header, "Never"
+ // indicates the Secure attribute will not be set, and "Auto" will set the Secure
+ // attribute depending if Always Use HTTPS is enabled.
+ Secure LoadBalancerSessionAffinityAttributesSecure `json:"secure"`
+ // Configures the zero-downtime failover between origins within a pool when session
+ // affinity is enabled. This feature is currently incompatible with Argo, Tiered
+ // Cache, and Bandwidth Alliance. The supported values are:
+ //
+ // - `"none"`: No failover takes place for sessions pinned to the origin (default).
+ // - `"temporary"`: Traffic will be sent to another other healthy origin until the
+ // originally pinned origin is available; note that this can potentially result
+ // in heavy origin flapping.
+ // - `"sticky"`: The session affinity cookie is updated and subsequent requests are
+ // sent to the new origin. Note: Zero-downtime failover with sticky sessions is
+ // currently not supported for session affinity by header.
+ ZeroDowntimeFailover LoadBalancerSessionAffinityAttributesZeroDowntimeFailover `json:"zero_downtime_failover"`
+ JSON loadBalancerSessionAffinityAttributesJSON `json:"-"`
+}
+
+// loadBalancerSessionAffinityAttributesJSON contains the JSON metadata for the
+// struct [LoadBalancerSessionAffinityAttributes]
+type loadBalancerSessionAffinityAttributesJSON struct {
+ DrainDuration apijson.Field
+ Headers apijson.Field
+ RequireAllHeaders apijson.Field
+ Samesite apijson.Field
+ Secure apijson.Field
+ ZeroDowntimeFailover apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LoadBalancerSessionAffinityAttributes) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r loadBalancerSessionAffinityAttributesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Configures the SameSite attribute on session affinity cookie. Value "Auto" will
+// be translated to "Lax" or "None" depending if Always Use HTTPS is enabled. Note:
+// when using value "None", the secure attribute can not be set to "Never".
+type LoadBalancerSessionAffinityAttributesSamesite string
+
+const (
+ LoadBalancerSessionAffinityAttributesSamesiteAuto LoadBalancerSessionAffinityAttributesSamesite = "Auto"
+ LoadBalancerSessionAffinityAttributesSamesiteLax LoadBalancerSessionAffinityAttributesSamesite = "Lax"
+ LoadBalancerSessionAffinityAttributesSamesiteNone LoadBalancerSessionAffinityAttributesSamesite = "None"
+ LoadBalancerSessionAffinityAttributesSamesiteStrict LoadBalancerSessionAffinityAttributesSamesite = "Strict"
+)
+
+// Configures the Secure attribute on session affinity cookie. Value "Always"
+// indicates the Secure attribute will be set in the Set-Cookie header, "Never"
+// indicates the Secure attribute will not be set, and "Auto" will set the Secure
+// attribute depending if Always Use HTTPS is enabled.
+type LoadBalancerSessionAffinityAttributesSecure string
+
+const (
+ LoadBalancerSessionAffinityAttributesSecureAuto LoadBalancerSessionAffinityAttributesSecure = "Auto"
+ LoadBalancerSessionAffinityAttributesSecureAlways LoadBalancerSessionAffinityAttributesSecure = "Always"
+ LoadBalancerSessionAffinityAttributesSecureNever LoadBalancerSessionAffinityAttributesSecure = "Never"
+)
+
+// Configures the zero-downtime failover between origins within a pool when session
+// affinity is enabled. This feature is currently incompatible with Argo, Tiered
+// Cache, and Bandwidth Alliance. The supported values are:
+//
+// - `"none"`: No failover takes place for sessions pinned to the origin (default).
+// - `"temporary"`: Traffic will be sent to another other healthy origin until the
+// originally pinned origin is available; note that this can potentially result
+// in heavy origin flapping.
+// - `"sticky"`: The session affinity cookie is updated and subsequent requests are
+// sent to the new origin. Note: Zero-downtime failover with sticky sessions is
+// currently not supported for session affinity by header.
+type LoadBalancerSessionAffinityAttributesZeroDowntimeFailover string
+
+const (
+ LoadBalancerSessionAffinityAttributesZeroDowntimeFailoverNone LoadBalancerSessionAffinityAttributesZeroDowntimeFailover = "none"
+ LoadBalancerSessionAffinityAttributesZeroDowntimeFailoverTemporary LoadBalancerSessionAffinityAttributesZeroDowntimeFailover = "temporary"
+ LoadBalancerSessionAffinityAttributesZeroDowntimeFailoverSticky LoadBalancerSessionAffinityAttributesZeroDowntimeFailover = "sticky"
+)
+
+// Steering Policy for this load balancer.
+//
+// - `"off"`: Use `default_pools`.
+// - `"geo"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied
+// requests, the country for `country_pools` is determined by
+// `location_strategy`.
+// - `"random"`: Select a pool randomly.
+// - `"dynamic_latency"`: Use round trip time to select the closest pool in
+// default_pools (requires pool health checks).
+// - `"proximity"`: Use the pools' latitude and longitude to select the closest
+// pool using the Cloudflare PoP location for proxied requests or the location
+// determined by `location_strategy` for non-proxied requests.
+// - `"least_outstanding_requests"`: Select a pool by taking into consideration
+// `random_steering` weights, as well as each pool's number of outstanding
+// requests. Pools with more pending requests are weighted proportionately less
+// relative to others.
+// - `"least_connections"`: Select a pool by taking into consideration
+// `random_steering` weights, as well as each pool's number of open connections.
+// Pools with more open connections are weighted proportionately less relative to
+// others. Supported for HTTP/1 and HTTP/2 connections.
+// - `""`: Will map to `"geo"` if you use
+// `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.
+type LoadBalancerSteeringPolicy string
+
+const (
+ LoadBalancerSteeringPolicyOff LoadBalancerSteeringPolicy = "off"
+ LoadBalancerSteeringPolicyGeo LoadBalancerSteeringPolicy = "geo"
+ LoadBalancerSteeringPolicyRandom LoadBalancerSteeringPolicy = "random"
+ LoadBalancerSteeringPolicyDynamicLatency LoadBalancerSteeringPolicy = "dynamic_latency"
+ LoadBalancerSteeringPolicyProximity LoadBalancerSteeringPolicy = "proximity"
+ LoadBalancerSteeringPolicyLeastOutstandingRequests LoadBalancerSteeringPolicy = "least_outstanding_requests"
+ LoadBalancerSteeringPolicyLeastConnections LoadBalancerSteeringPolicy = "least_connections"
+ LoadBalancerSteeringPolicyEmpty LoadBalancerSteeringPolicy = "\"\""
+)
+
+type LoadBalancerDeleteResponse struct {
+ ID string `json:"id"`
+ JSON loadBalancerDeleteResponseJSON `json:"-"`
+}
+
+// loadBalancerDeleteResponseJSON contains the JSON metadata for the struct
+// [LoadBalancerDeleteResponse]
+type loadBalancerDeleteResponseJSON struct {
+ ID apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LoadBalancerDeleteResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r loadBalancerDeleteResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type LoadBalancerNewParams struct {
+ ZoneID param.Field[string] `path:"zone_id,required"`
+ // A list of pool IDs ordered by their failover priority. Pools defined here are
+ // used by default, or when region_pools are not configured for a given region.
+ DefaultPools param.Field[[]string] `json:"default_pools,required"`
+ // The pool ID to use when all other pools are detected as unhealthy.
+ FallbackPool param.Field[interface{}] `json:"fallback_pool,required"`
+ // The DNS hostname to associate with your Load Balancer. If this hostname already
+ // exists as a DNS record in Cloudflare's DNS, the Load Balancer will take
+ // precedence and the DNS record will not be used.
+ Name param.Field[string] `json:"name,required"`
+ // Controls features that modify the routing of requests to pools and origins in
+ // response to dynamic conditions, such as during the interval between active
+ // health monitoring requests. For example, zero-downtime failover occurs
+ // immediately when an origin becomes unavailable due to HTTP 521, 522, or 523
+ // response codes. If there is another healthy origin in the same pool, the request
+ // is retried once against this alternate origin.
+ AdaptiveRouting param.Field[LoadBalancerNewParamsAdaptiveRouting] `json:"adaptive_routing"`
+ // A mapping of country codes to a list of pool IDs (ordered by their failover
+ // priority) for the given country. Any country not explicitly defined will fall
+ // back to using the corresponding region_pool mapping if it exists else to
+ // default_pools.
+ CountryPools param.Field[interface{}] `json:"country_pools"`
+ // Object description.
+ Description param.Field[string] `json:"description"`
+ // Controls location-based steering for non-proxied requests. See `steering_policy`
+ // to learn how steering is affected.
+ LocationStrategy param.Field[LoadBalancerNewParamsLocationStrategy] `json:"location_strategy"`
+ // (Enterprise only): A mapping of Cloudflare PoP identifiers to a list of pool IDs
+ // (ordered by their failover priority) for the PoP (datacenter). Any PoPs not
+ // explicitly defined will fall back to using the corresponding country_pool, then
+ // region_pool mapping if it exists else to default_pools.
+ PopPools param.Field[interface{}] `json:"pop_pools"`
+ // Whether the hostname should be gray clouded (false) or orange clouded (true).
+ Proxied param.Field[bool] `json:"proxied"`
+ // Configures pool weights.
+ //
+ // - `steering_policy="random"`: A random pool is selected with probability
+ // proportional to pool weights.
+ // - `steering_policy="least_outstanding_requests"`: Use pool weights to scale each
+ // pool's outstanding requests.
+ // - `steering_policy="least_connections"`: Use pool weights to scale each pool's
+ // open connections.
+ RandomSteering param.Field[LoadBalancerNewParamsRandomSteering] `json:"random_steering"`
+ // A mapping of region codes to a list of pool IDs (ordered by their failover
+ // priority) for the given region. Any regions not explicitly defined will fall
+ // back to using default_pools.
+ RegionPools param.Field[interface{}] `json:"region_pools"`
+ // BETA Field Not General Access: A list of rules for this load balancer to
+ // execute.
+ Rules param.Field[[]LoadBalancerNewParamsRule] `json:"rules"`
+ // Specifies the type of session affinity the load balancer should use unless
+ // specified as `"none"` or "" (default). The supported types are:
+ //
+ // - `"cookie"`: On the first request to a proxied load balancer, a cookie is
+ // generated, encoding information of which origin the request will be forwarded
+ // to. Subsequent requests, by the same client to the same load balancer, will be
+ // sent to the origin server the cookie encodes, for the duration of the cookie
+ // and as long as the origin server remains healthy. If the cookie has expired or
+ // the origin server is unhealthy, then a new origin server is calculated and
+ // used.
+ // - `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin
+ // selection is stable and based on the client's ip address.
+ // - `"header"`: On the first request to a proxied load balancer, a session key
+ // based on the configured HTTP headers (see
+ // `session_affinity_attributes.headers`) is generated, encoding the request
+ // headers used for storing in the load balancer session state which origin the
+ // request will be forwarded to. Subsequent requests to the load balancer with
+ // the same headers will be sent to the same origin server, for the duration of
+ // the session and as long as the origin server remains healthy. If the session
+ // has been idle for the duration of `session_affinity_ttl` seconds or the origin
+ // server is unhealthy, then a new origin server is calculated and used. See
+ // `headers` in `session_affinity_attributes` for additional required
+ // configuration.
+ SessionAffinity param.Field[LoadBalancerNewParamsSessionAffinity] `json:"session_affinity"`
+ // Configures attributes for session affinity.
+ SessionAffinityAttributes param.Field[LoadBalancerNewParamsSessionAffinityAttributes] `json:"session_affinity_attributes"`
+ // Time, in seconds, until a client's session expires after being created. Once the
+ // expiry time has been reached, subsequent requests may get sent to a different
+ // origin server. The accepted ranges per `session_affinity` policy are:
+ //
+ // - `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used
+ // unless explicitly set. The accepted range of values is between [1800, 604800].
+ // - `"header"`: The current default of 1800 seconds will be used unless explicitly
+ // set. The accepted range of values is between [30, 3600]. Note: With session
+ // affinity by header, sessions only expire after they haven't been used for the
+ // number of seconds specified.
+ SessionAffinityTTL param.Field[float64] `json:"session_affinity_ttl"`
+ // Steering Policy for this load balancer.
+ //
+ // - `"off"`: Use `default_pools`.
+ // - `"geo"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied
+ // requests, the country for `country_pools` is determined by
+ // `location_strategy`.
+ // - `"random"`: Select a pool randomly.
+ // - `"dynamic_latency"`: Use round trip time to select the closest pool in
+ // default_pools (requires pool health checks).
+ // - `"proximity"`: Use the pools' latitude and longitude to select the closest
+ // pool using the Cloudflare PoP location for proxied requests or the location
+ // determined by `location_strategy` for non-proxied requests.
+ // - `"least_outstanding_requests"`: Select a pool by taking into consideration
+ // `random_steering` weights, as well as each pool's number of outstanding
+ // requests. Pools with more pending requests are weighted proportionately less
+ // relative to others.
+ // - `"least_connections"`: Select a pool by taking into consideration
+ // `random_steering` weights, as well as each pool's number of open connections.
+ // Pools with more open connections are weighted proportionately less relative to
+ // others. Supported for HTTP/1 and HTTP/2 connections.
+ // - `""`: Will map to `"geo"` if you use
+ // `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.
+ SteeringPolicy param.Field[LoadBalancerNewParamsSteeringPolicy] `json:"steering_policy"`
+ // Time to live (TTL) of the DNS entry for the IP address returned by this load
+ // balancer. This only applies to gray-clouded (unproxied) load balancers.
+ TTL param.Field[float64] `json:"ttl"`
+}
+
+func (r LoadBalancerNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Controls features that modify the routing of requests to pools and origins in
+// response to dynamic conditions, such as during the interval between active
+// health monitoring requests. For example, zero-downtime failover occurs
+// immediately when an origin becomes unavailable due to HTTP 521, 522, or 523
+// response codes. If there is another healthy origin in the same pool, the request
+// is retried once against this alternate origin.
+type LoadBalancerNewParamsAdaptiveRouting struct {
+ // Extends zero-downtime failover of requests to healthy origins from alternate
+ // pools, when no healthy alternate exists in the same pool, according to the
+ // failover order defined by traffic and origin steering. When set false (the
+ // default) zero-downtime failover will only occur between origins within the same
+ // pool. See `session_affinity_attributes` for control over when sessions are
+ // broken or reassigned.
+ FailoverAcrossPools param.Field[bool] `json:"failover_across_pools"`
+}
+
+func (r LoadBalancerNewParamsAdaptiveRouting) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Controls location-based steering for non-proxied requests. See `steering_policy`
+// to learn how steering is affected.
+type LoadBalancerNewParamsLocationStrategy struct {
+ // Determines the authoritative location when ECS is not preferred, does not exist
+ // in the request, or its GeoIP lookup is unsuccessful.
+ //
+ // - `"pop"`: Use the Cloudflare PoP location.
+ // - `"resolver_ip"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is
+ // unsuccessful, use the Cloudflare PoP location.
+ Mode param.Field[LoadBalancerNewParamsLocationStrategyMode] `json:"mode"`
+ // Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the
+ // authoritative location.
+ //
+ // - `"always"`: Always prefer ECS.
+ // - `"never"`: Never prefer ECS.
+ // - `"proximity"`: Prefer ECS only when `steering_policy="proximity"`.
+ // - `"geo"`: Prefer ECS only when `steering_policy="geo"`.
+ PreferEcs param.Field[LoadBalancerNewParamsLocationStrategyPreferEcs] `json:"prefer_ecs"`
+}
+
+func (r LoadBalancerNewParamsLocationStrategy) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Determines the authoritative location when ECS is not preferred, does not exist
+// in the request, or its GeoIP lookup is unsuccessful.
+//
+// - `"pop"`: Use the Cloudflare PoP location.
+// - `"resolver_ip"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is
+// unsuccessful, use the Cloudflare PoP location.
+type LoadBalancerNewParamsLocationStrategyMode string
+
+const (
+ LoadBalancerNewParamsLocationStrategyModePop LoadBalancerNewParamsLocationStrategyMode = "pop"
+ LoadBalancerNewParamsLocationStrategyModeResolverIP LoadBalancerNewParamsLocationStrategyMode = "resolver_ip"
+)
+
+// Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the
+// authoritative location.
+//
+// - `"always"`: Always prefer ECS.
+// - `"never"`: Never prefer ECS.
+// - `"proximity"`: Prefer ECS only when `steering_policy="proximity"`.
+// - `"geo"`: Prefer ECS only when `steering_policy="geo"`.
+type LoadBalancerNewParamsLocationStrategyPreferEcs string
+
+const (
+ LoadBalancerNewParamsLocationStrategyPreferEcsAlways LoadBalancerNewParamsLocationStrategyPreferEcs = "always"
+ LoadBalancerNewParamsLocationStrategyPreferEcsNever LoadBalancerNewParamsLocationStrategyPreferEcs = "never"
+ LoadBalancerNewParamsLocationStrategyPreferEcsProximity LoadBalancerNewParamsLocationStrategyPreferEcs = "proximity"
+ LoadBalancerNewParamsLocationStrategyPreferEcsGeo LoadBalancerNewParamsLocationStrategyPreferEcs = "geo"
+)
+
+// Configures pool weights.
+//
+// - `steering_policy="random"`: A random pool is selected with probability
+// proportional to pool weights.
+// - `steering_policy="least_outstanding_requests"`: Use pool weights to scale each
+// pool's outstanding requests.
+// - `steering_policy="least_connections"`: Use pool weights to scale each pool's
+// open connections.
+type LoadBalancerNewParamsRandomSteering struct {
+ // The default weight for pools in the load balancer that are not specified in the
+ // pool_weights map.
+ DefaultWeight param.Field[float64] `json:"default_weight"`
+ // A mapping of pool IDs to custom weights. The weight is relative to other pools
+ // in the load balancer.
+ PoolWeights param.Field[interface{}] `json:"pool_weights"`
+}
+
+func (r LoadBalancerNewParamsRandomSteering) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// A rule object containing conditions and overrides for this load balancer to
+// evaluate.
+type LoadBalancerNewParamsRule struct {
+ // The condition expressions to evaluate. If the condition evaluates to true, the
+ // overrides or fixed_response in this rule will be applied. An empty condition is
+ // always true. For more details on condition expressions, please see
+ // https://developers.cloudflare.com/load-balancing/understand-basics/load-balancing-rules/expressions.
+ Condition param.Field[string] `json:"condition"`
+ // Disable this specific rule. It will no longer be evaluated by this load
+ // balancer.
+ Disabled param.Field[bool] `json:"disabled"`
+ // A collection of fields used to directly respond to the eyeball instead of
+ // routing to a pool. If a fixed_response is supplied the rule will be marked as
+ // terminates.
+ FixedResponse param.Field[LoadBalancerNewParamsRulesFixedResponse] `json:"fixed_response"`
+ // Name of this rule. Only used for human readability.
+ Name param.Field[string] `json:"name"`
+ // A collection of overrides to apply to the load balancer when this rule's
+ // condition is true. All fields are optional.
+ Overrides param.Field[LoadBalancerNewParamsRulesOverrides] `json:"overrides"`
+ // The order in which rules should be executed in relation to each other. Lower
+ // values are executed first. Values do not need to be sequential. If no value is
+ // provided for any rule the array order of the rules field will be used to assign
+ // a priority.
+ Priority param.Field[int64] `json:"priority"`
+ // If this rule's condition is true, this causes rule evaluation to stop after
+ // processing this rule.
+ Terminates param.Field[bool] `json:"terminates"`
+}
+
+func (r LoadBalancerNewParamsRule) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// A collection of fields used to directly respond to the eyeball instead of
+// routing to a pool. If a fixed_response is supplied the rule will be marked as
+// terminates.
+type LoadBalancerNewParamsRulesFixedResponse struct {
+ // The http 'Content-Type' header to include in the response.
+ ContentType param.Field[string] `json:"content_type"`
+ // The http 'Location' header to include in the response.
+ Location param.Field[string] `json:"location"`
+ // Text to include as the http body.
+ MessageBody param.Field[string] `json:"message_body"`
+ // The http status code to respond with.
+ StatusCode param.Field[int64] `json:"status_code"`
+}
+
+func (r LoadBalancerNewParamsRulesFixedResponse) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// A collection of overrides to apply to the load balancer when this rule's
+// condition is true. All fields are optional.
+type LoadBalancerNewParamsRulesOverrides struct {
+ // Controls features that modify the routing of requests to pools and origins in
+ // response to dynamic conditions, such as during the interval between active
+ // health monitoring requests. For example, zero-downtime failover occurs
+ // immediately when an origin becomes unavailable due to HTTP 521, 522, or 523
+ // response codes. If there is another healthy origin in the same pool, the request
+ // is retried once against this alternate origin.
+ AdaptiveRouting param.Field[LoadBalancerNewParamsRulesOverridesAdaptiveRouting] `json:"adaptive_routing"`
+ // A mapping of country codes to a list of pool IDs (ordered by their failover
+ // priority) for the given country. Any country not explicitly defined will fall
+ // back to using the corresponding region_pool mapping if it exists else to
+ // default_pools.
+ CountryPools param.Field[interface{}] `json:"country_pools"`
+ // A list of pool IDs ordered by their failover priority. Pools defined here are
+ // used by default, or when region_pools are not configured for a given region.
+ DefaultPools param.Field[[]string] `json:"default_pools"`
+ // The pool ID to use when all other pools are detected as unhealthy.
+ FallbackPool param.Field[interface{}] `json:"fallback_pool"`
+ // Controls location-based steering for non-proxied requests. See `steering_policy`
+ // to learn how steering is affected.
+ LocationStrategy param.Field[LoadBalancerNewParamsRulesOverridesLocationStrategy] `json:"location_strategy"`
+ // (Enterprise only): A mapping of Cloudflare PoP identifiers to a list of pool IDs
+ // (ordered by their failover priority) for the PoP (datacenter). Any PoPs not
+ // explicitly defined will fall back to using the corresponding country_pool, then
+ // region_pool mapping if it exists else to default_pools.
+ PopPools param.Field[interface{}] `json:"pop_pools"`
+ // Configures pool weights.
+ //
+ // - `steering_policy="random"`: A random pool is selected with probability
+ // proportional to pool weights.
+ // - `steering_policy="least_outstanding_requests"`: Use pool weights to scale each
+ // pool's outstanding requests.
+ // - `steering_policy="least_connections"`: Use pool weights to scale each pool's
+ // open connections.
+ RandomSteering param.Field[LoadBalancerNewParamsRulesOverridesRandomSteering] `json:"random_steering"`
+ // A mapping of region codes to a list of pool IDs (ordered by their failover
+ // priority) for the given region. Any regions not explicitly defined will fall
+ // back to using default_pools.
+ RegionPools param.Field[interface{}] `json:"region_pools"`
+ // Specifies the type of session affinity the load balancer should use unless
+ // specified as `"none"` or "" (default). The supported types are:
+ //
+ // - `"cookie"`: On the first request to a proxied load balancer, a cookie is
+ // generated, encoding information of which origin the request will be forwarded
+ // to. Subsequent requests, by the same client to the same load balancer, will be
+ // sent to the origin server the cookie encodes, for the duration of the cookie
+ // and as long as the origin server remains healthy. If the cookie has expired or
+ // the origin server is unhealthy, then a new origin server is calculated and
+ // used.
+ // - `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin
+ // selection is stable and based on the client's ip address.
+ // - `"header"`: On the first request to a proxied load balancer, a session key
+ // based on the configured HTTP headers (see
+ // `session_affinity_attributes.headers`) is generated, encoding the request
+ // headers used for storing in the load balancer session state which origin the
+ // request will be forwarded to. Subsequent requests to the load balancer with
+ // the same headers will be sent to the same origin server, for the duration of
+ // the session and as long as the origin server remains healthy. If the session
+ // has been idle for the duration of `session_affinity_ttl` seconds or the origin
+ // server is unhealthy, then a new origin server is calculated and used. See
+ // `headers` in `session_affinity_attributes` for additional required
+ // configuration.
+ SessionAffinity param.Field[LoadBalancerNewParamsRulesOverridesSessionAffinity] `json:"session_affinity"`
+ // Configures attributes for session affinity.
+ SessionAffinityAttributes param.Field[LoadBalancerNewParamsRulesOverridesSessionAffinityAttributes] `json:"session_affinity_attributes"`
+ // Time, in seconds, until a client's session expires after being created. Once the
+ // expiry time has been reached, subsequent requests may get sent to a different
+ // origin server. The accepted ranges per `session_affinity` policy are:
+ //
+ // - `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used
+ // unless explicitly set. The accepted range of values is between [1800, 604800].
+ // - `"header"`: The current default of 1800 seconds will be used unless explicitly
+ // set. The accepted range of values is between [30, 3600]. Note: With session
+ // affinity by header, sessions only expire after they haven't been used for the
+ // number of seconds specified.
+ SessionAffinityTTL param.Field[float64] `json:"session_affinity_ttl"`
+ // Steering Policy for this load balancer.
+ //
+ // - `"off"`: Use `default_pools`.
+ // - `"geo"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied
+ // requests, the country for `country_pools` is determined by
+ // `location_strategy`.
+ // - `"random"`: Select a pool randomly.
+ // - `"dynamic_latency"`: Use round trip time to select the closest pool in
+ // default_pools (requires pool health checks).
+ // - `"proximity"`: Use the pools' latitude and longitude to select the closest
+ // pool using the Cloudflare PoP location for proxied requests or the location
+ // determined by `location_strategy` for non-proxied requests.
+ // - `"least_outstanding_requests"`: Select a pool by taking into consideration
+ // `random_steering` weights, as well as each pool's number of outstanding
+ // requests. Pools with more pending requests are weighted proportionately less
+ // relative to others.
+ // - `"least_connections"`: Select a pool by taking into consideration
+ // `random_steering` weights, as well as each pool's number of open connections.
+ // Pools with more open connections are weighted proportionately less relative to
+ // others. Supported for HTTP/1 and HTTP/2 connections.
+ // - `""`: Will map to `"geo"` if you use
+ // `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.
+ SteeringPolicy param.Field[LoadBalancerNewParamsRulesOverridesSteeringPolicy] `json:"steering_policy"`
+ // Time to live (TTL) of the DNS entry for the IP address returned by this load
+ // balancer. This only applies to gray-clouded (unproxied) load balancers.
+ TTL param.Field[float64] `json:"ttl"`
+}
+
+func (r LoadBalancerNewParamsRulesOverrides) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Controls features that modify the routing of requests to pools and origins in
+// response to dynamic conditions, such as during the interval between active
+// health monitoring requests. For example, zero-downtime failover occurs
+// immediately when an origin becomes unavailable due to HTTP 521, 522, or 523
+// response codes. If there is another healthy origin in the same pool, the request
+// is retried once against this alternate origin.
+type LoadBalancerNewParamsRulesOverridesAdaptiveRouting struct {
+ // Extends zero-downtime failover of requests to healthy origins from alternate
+ // pools, when no healthy alternate exists in the same pool, according to the
+ // failover order defined by traffic and origin steering. When set false (the
+ // default) zero-downtime failover will only occur between origins within the same
+ // pool. See `session_affinity_attributes` for control over when sessions are
+ // broken or reassigned.
+ FailoverAcrossPools param.Field[bool] `json:"failover_across_pools"`
+}
+
+func (r LoadBalancerNewParamsRulesOverridesAdaptiveRouting) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Controls location-based steering for non-proxied requests. See `steering_policy`
+// to learn how steering is affected.
+type LoadBalancerNewParamsRulesOverridesLocationStrategy struct {
+ // Determines the authoritative location when ECS is not preferred, does not exist
+ // in the request, or its GeoIP lookup is unsuccessful.
+ //
+ // - `"pop"`: Use the Cloudflare PoP location.
+ // - `"resolver_ip"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is
+ // unsuccessful, use the Cloudflare PoP location.
+ Mode param.Field[LoadBalancerNewParamsRulesOverridesLocationStrategyMode] `json:"mode"`
+ // Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the
+ // authoritative location.
+ //
+ // - `"always"`: Always prefer ECS.
+ // - `"never"`: Never prefer ECS.
+ // - `"proximity"`: Prefer ECS only when `steering_policy="proximity"`.
+ // - `"geo"`: Prefer ECS only when `steering_policy="geo"`.
+ PreferEcs param.Field[LoadBalancerNewParamsRulesOverridesLocationStrategyPreferEcs] `json:"prefer_ecs"`
+}
+
+func (r LoadBalancerNewParamsRulesOverridesLocationStrategy) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Determines the authoritative location when ECS is not preferred, does not exist
+// in the request, or its GeoIP lookup is unsuccessful.
+//
+// - `"pop"`: Use the Cloudflare PoP location.
+// - `"resolver_ip"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is
+// unsuccessful, use the Cloudflare PoP location.
+type LoadBalancerNewParamsRulesOverridesLocationStrategyMode string
+
+const (
+ LoadBalancerNewParamsRulesOverridesLocationStrategyModePop LoadBalancerNewParamsRulesOverridesLocationStrategyMode = "pop"
+ LoadBalancerNewParamsRulesOverridesLocationStrategyModeResolverIP LoadBalancerNewParamsRulesOverridesLocationStrategyMode = "resolver_ip"
+)
+
+// Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the
+// authoritative location.
+//
+// - `"always"`: Always prefer ECS.
+// - `"never"`: Never prefer ECS.
+// - `"proximity"`: Prefer ECS only when `steering_policy="proximity"`.
+// - `"geo"`: Prefer ECS only when `steering_policy="geo"`.
+type LoadBalancerNewParamsRulesOverridesLocationStrategyPreferEcs string
+
+const (
+ LoadBalancerNewParamsRulesOverridesLocationStrategyPreferEcsAlways LoadBalancerNewParamsRulesOverridesLocationStrategyPreferEcs = "always"
+ LoadBalancerNewParamsRulesOverridesLocationStrategyPreferEcsNever LoadBalancerNewParamsRulesOverridesLocationStrategyPreferEcs = "never"
+ LoadBalancerNewParamsRulesOverridesLocationStrategyPreferEcsProximity LoadBalancerNewParamsRulesOverridesLocationStrategyPreferEcs = "proximity"
+ LoadBalancerNewParamsRulesOverridesLocationStrategyPreferEcsGeo LoadBalancerNewParamsRulesOverridesLocationStrategyPreferEcs = "geo"
+)
+
+// Configures pool weights.
+//
+// - `steering_policy="random"`: A random pool is selected with probability
+// proportional to pool weights.
+// - `steering_policy="least_outstanding_requests"`: Use pool weights to scale each
+// pool's outstanding requests.
+// - `steering_policy="least_connections"`: Use pool weights to scale each pool's
+// open connections.
+type LoadBalancerNewParamsRulesOverridesRandomSteering struct {
+ // The default weight for pools in the load balancer that are not specified in the
+ // pool_weights map.
+ DefaultWeight param.Field[float64] `json:"default_weight"`
+ // A mapping of pool IDs to custom weights. The weight is relative to other pools
+ // in the load balancer.
+ PoolWeights param.Field[interface{}] `json:"pool_weights"`
+}
+
+func (r LoadBalancerNewParamsRulesOverridesRandomSteering) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Specifies the type of session affinity the load balancer should use unless
+// specified as `"none"` or "" (default). The supported types are:
+//
+// - `"cookie"`: On the first request to a proxied load balancer, a cookie is
+// generated, encoding information of which origin the request will be forwarded
+// to. Subsequent requests, by the same client to the same load balancer, will be
+// sent to the origin server the cookie encodes, for the duration of the cookie
+// and as long as the origin server remains healthy. If the cookie has expired or
+// the origin server is unhealthy, then a new origin server is calculated and
+// used.
+// - `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin
+// selection is stable and based on the client's ip address.
+// - `"header"`: On the first request to a proxied load balancer, a session key
+// based on the configured HTTP headers (see
+// `session_affinity_attributes.headers`) is generated, encoding the request
+// headers used for storing in the load balancer session state which origin the
+// request will be forwarded to. Subsequent requests to the load balancer with
+// the same headers will be sent to the same origin server, for the duration of
+// the session and as long as the origin server remains healthy. If the session
+// has been idle for the duration of `session_affinity_ttl` seconds or the origin
+// server is unhealthy, then a new origin server is calculated and used. See
+// `headers` in `session_affinity_attributes` for additional required
+// configuration.
+type LoadBalancerNewParamsRulesOverridesSessionAffinity string
+
+const (
+ LoadBalancerNewParamsRulesOverridesSessionAffinityNone LoadBalancerNewParamsRulesOverridesSessionAffinity = "none"
+ LoadBalancerNewParamsRulesOverridesSessionAffinityCookie LoadBalancerNewParamsRulesOverridesSessionAffinity = "cookie"
+ LoadBalancerNewParamsRulesOverridesSessionAffinityIPCookie LoadBalancerNewParamsRulesOverridesSessionAffinity = "ip_cookie"
+ LoadBalancerNewParamsRulesOverridesSessionAffinityHeader LoadBalancerNewParamsRulesOverridesSessionAffinity = "header"
+ LoadBalancerNewParamsRulesOverridesSessionAffinityEmpty LoadBalancerNewParamsRulesOverridesSessionAffinity = "\"\""
+)
+
+// Configures attributes for session affinity.
+type LoadBalancerNewParamsRulesOverridesSessionAffinityAttributes struct {
+ // Configures the drain duration in seconds. This field is only used when session
+ // affinity is enabled on the load balancer.
+ DrainDuration param.Field[float64] `json:"drain_duration"`
+ // Configures the names of HTTP headers to base session affinity on when header
+ // `session_affinity` is enabled. At least one HTTP header name must be provided.
+ // To specify the exact cookies to be used, include an item in the following
+ // format: `"cookie:,"` (example) where everything
+ // after the colon is a comma-separated list of cookie names. Providing only
+ // `"cookie"` will result in all cookies being used. The default max number of HTTP
+ // header names that can be provided depends on your plan: 5 for Enterprise, 1 for
+ // all other plans.
+ Headers param.Field[[]string] `json:"headers"`
+ // When header `session_affinity` is enabled, this option can be used to specify
+ // how HTTP headers on load balancing requests will be used. The supported values
+ // are:
+ //
+ // - `"true"`: Load balancing requests must contain _all_ of the HTTP headers
+ // specified by the `headers` session affinity attribute, otherwise sessions
+ // aren't created.
+ // - `"false"`: Load balancing requests must contain _at least one_ of the HTTP
+ // headers specified by the `headers` session affinity attribute, otherwise
+ // sessions aren't created.
+ RequireAllHeaders param.Field[bool] `json:"require_all_headers"`
+ // Configures the SameSite attribute on session affinity cookie. Value "Auto" will
+ // be translated to "Lax" or "None" depending if Always Use HTTPS is enabled. Note:
+ // when using value "None", the secure attribute can not be set to "Never".
+ Samesite param.Field[LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesSamesite] `json:"samesite"`
+ // Configures the Secure attribute on session affinity cookie. Value "Always"
+ // indicates the Secure attribute will be set in the Set-Cookie header, "Never"
+ // indicates the Secure attribute will not be set, and "Auto" will set the Secure
+ // attribute depending if Always Use HTTPS is enabled.
+ Secure param.Field[LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesSecure] `json:"secure"`
+ // Configures the zero-downtime failover between origins within a pool when session
+ // affinity is enabled. This feature is currently incompatible with Argo, Tiered
+ // Cache, and Bandwidth Alliance. The supported values are:
+ //
+ // - `"none"`: No failover takes place for sessions pinned to the origin (default).
+ // - `"temporary"`: Traffic will be sent to another other healthy origin until the
+ // originally pinned origin is available; note that this can potentially result
+ // in heavy origin flapping.
+ // - `"sticky"`: The session affinity cookie is updated and subsequent requests are
+ // sent to the new origin. Note: Zero-downtime failover with sticky sessions is
+ // currently not supported for session affinity by header.
+ ZeroDowntimeFailover param.Field[LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailover] `json:"zero_downtime_failover"`
+}
+
+func (r LoadBalancerNewParamsRulesOverridesSessionAffinityAttributes) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Configures the SameSite attribute on session affinity cookie. Value "Auto" will
+// be translated to "Lax" or "None" depending if Always Use HTTPS is enabled. Note:
+// when using value "None", the secure attribute can not be set to "Never".
+type LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesSamesite string
+
+const (
+ LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesSamesiteAuto LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesSamesite = "Auto"
+ LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesSamesiteLax LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesSamesite = "Lax"
+ LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesSamesiteNone LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesSamesite = "None"
+ LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesSamesiteStrict LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesSamesite = "Strict"
+)
+
+// Configures the Secure attribute on session affinity cookie. Value "Always"
+// indicates the Secure attribute will be set in the Set-Cookie header, "Never"
+// indicates the Secure attribute will not be set, and "Auto" will set the Secure
+// attribute depending if Always Use HTTPS is enabled.
+type LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesSecure string
+
+const (
+ LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesSecureAuto LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesSecure = "Auto"
+ LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesSecureAlways LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesSecure = "Always"
+ LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesSecureNever LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesSecure = "Never"
+)
+
+// Configures the zero-downtime failover between origins within a pool when session
+// affinity is enabled. This feature is currently incompatible with Argo, Tiered
+// Cache, and Bandwidth Alliance. The supported values are:
+//
+// - `"none"`: No failover takes place for sessions pinned to the origin (default).
+// - `"temporary"`: Traffic will be sent to another other healthy origin until the
+// originally pinned origin is available; note that this can potentially result
+// in heavy origin flapping.
+// - `"sticky"`: The session affinity cookie is updated and subsequent requests are
+// sent to the new origin. Note: Zero-downtime failover with sticky sessions is
+// currently not supported for session affinity by header.
+type LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailover string
+
+const (
+ LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailoverNone LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailover = "none"
+ LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailoverTemporary LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailover = "temporary"
+ LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailoverSticky LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailover = "sticky"
+)
+
+// Steering Policy for this load balancer.
+//
+// - `"off"`: Use `default_pools`.
+// - `"geo"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied
+// requests, the country for `country_pools` is determined by
+// `location_strategy`.
+// - `"random"`: Select a pool randomly.
+// - `"dynamic_latency"`: Use round trip time to select the closest pool in
+// default_pools (requires pool health checks).
+// - `"proximity"`: Use the pools' latitude and longitude to select the closest
+// pool using the Cloudflare PoP location for proxied requests or the location
+// determined by `location_strategy` for non-proxied requests.
+// - `"least_outstanding_requests"`: Select a pool by taking into consideration
+// `random_steering` weights, as well as each pool's number of outstanding
+// requests. Pools with more pending requests are weighted proportionately less
+// relative to others.
+// - `"least_connections"`: Select a pool by taking into consideration
+// `random_steering` weights, as well as each pool's number of open connections.
+// Pools with more open connections are weighted proportionately less relative to
+// others. Supported for HTTP/1 and HTTP/2 connections.
+// - `""`: Will map to `"geo"` if you use
+// `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.
+type LoadBalancerNewParamsRulesOverridesSteeringPolicy string
+
+const (
+ LoadBalancerNewParamsRulesOverridesSteeringPolicyOff LoadBalancerNewParamsRulesOverridesSteeringPolicy = "off"
+ LoadBalancerNewParamsRulesOverridesSteeringPolicyGeo LoadBalancerNewParamsRulesOverridesSteeringPolicy = "geo"
+ LoadBalancerNewParamsRulesOverridesSteeringPolicyRandom LoadBalancerNewParamsRulesOverridesSteeringPolicy = "random"
+ LoadBalancerNewParamsRulesOverridesSteeringPolicyDynamicLatency LoadBalancerNewParamsRulesOverridesSteeringPolicy = "dynamic_latency"
+ LoadBalancerNewParamsRulesOverridesSteeringPolicyProximity LoadBalancerNewParamsRulesOverridesSteeringPolicy = "proximity"
+ LoadBalancerNewParamsRulesOverridesSteeringPolicyLeastOutstandingRequests LoadBalancerNewParamsRulesOverridesSteeringPolicy = "least_outstanding_requests"
+ LoadBalancerNewParamsRulesOverridesSteeringPolicyLeastConnections LoadBalancerNewParamsRulesOverridesSteeringPolicy = "least_connections"
+ LoadBalancerNewParamsRulesOverridesSteeringPolicyEmpty LoadBalancerNewParamsRulesOverridesSteeringPolicy = "\"\""
+)
+
+// Specifies the type of session affinity the load balancer should use unless
+// specified as `"none"` or "" (default). The supported types are:
+//
+// - `"cookie"`: On the first request to a proxied load balancer, a cookie is
+// generated, encoding information of which origin the request will be forwarded
+// to. Subsequent requests, by the same client to the same load balancer, will be
+// sent to the origin server the cookie encodes, for the duration of the cookie
+// and as long as the origin server remains healthy. If the cookie has expired or
+// the origin server is unhealthy, then a new origin server is calculated and
+// used.
+// - `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin
+// selection is stable and based on the client's ip address.
+// - `"header"`: On the first request to a proxied load balancer, a session key
+// based on the configured HTTP headers (see
+// `session_affinity_attributes.headers`) is generated, encoding the request
+// headers used for storing in the load balancer session state which origin the
+// request will be forwarded to. Subsequent requests to the load balancer with
+// the same headers will be sent to the same origin server, for the duration of
+// the session and as long as the origin server remains healthy. If the session
+// has been idle for the duration of `session_affinity_ttl` seconds or the origin
+// server is unhealthy, then a new origin server is calculated and used. See
+// `headers` in `session_affinity_attributes` for additional required
+// configuration.
+type LoadBalancerNewParamsSessionAffinity string
+
+const (
+ LoadBalancerNewParamsSessionAffinityNone LoadBalancerNewParamsSessionAffinity = "none"
+ LoadBalancerNewParamsSessionAffinityCookie LoadBalancerNewParamsSessionAffinity = "cookie"
+ LoadBalancerNewParamsSessionAffinityIPCookie LoadBalancerNewParamsSessionAffinity = "ip_cookie"
+ LoadBalancerNewParamsSessionAffinityHeader LoadBalancerNewParamsSessionAffinity = "header"
+ LoadBalancerNewParamsSessionAffinityEmpty LoadBalancerNewParamsSessionAffinity = "\"\""
+)
+
+// Configures attributes for session affinity.
+type LoadBalancerNewParamsSessionAffinityAttributes struct {
+ // Configures the drain duration in seconds. This field is only used when session
+ // affinity is enabled on the load balancer.
+ DrainDuration param.Field[float64] `json:"drain_duration"`
+ // Configures the names of HTTP headers to base session affinity on when header
+ // `session_affinity` is enabled. At least one HTTP header name must be provided.
+ // To specify the exact cookies to be used, include an item in the following
+ // format: `"cookie:,"` (example) where everything
+ // after the colon is a comma-separated list of cookie names. Providing only
+ // `"cookie"` will result in all cookies being used. The default max number of HTTP
+ // header names that can be provided depends on your plan: 5 for Enterprise, 1 for
+ // all other plans.
+ Headers param.Field[[]string] `json:"headers"`
+ // When header `session_affinity` is enabled, this option can be used to specify
+ // how HTTP headers on load balancing requests will be used. The supported values
+ // are:
+ //
+ // - `"true"`: Load balancing requests must contain _all_ of the HTTP headers
+ // specified by the `headers` session affinity attribute, otherwise sessions
+ // aren't created.
+ // - `"false"`: Load balancing requests must contain _at least one_ of the HTTP
+ // headers specified by the `headers` session affinity attribute, otherwise
+ // sessions aren't created.
+ RequireAllHeaders param.Field[bool] `json:"require_all_headers"`
+ // Configures the SameSite attribute on session affinity cookie. Value "Auto" will
+ // be translated to "Lax" or "None" depending if Always Use HTTPS is enabled. Note:
+ // when using value "None", the secure attribute can not be set to "Never".
+ Samesite param.Field[LoadBalancerNewParamsSessionAffinityAttributesSamesite] `json:"samesite"`
+ // Configures the Secure attribute on session affinity cookie. Value "Always"
+ // indicates the Secure attribute will be set in the Set-Cookie header, "Never"
+ // indicates the Secure attribute will not be set, and "Auto" will set the Secure
+ // attribute depending if Always Use HTTPS is enabled.
+ Secure param.Field[LoadBalancerNewParamsSessionAffinityAttributesSecure] `json:"secure"`
+ // Configures the zero-downtime failover between origins within a pool when session
+ // affinity is enabled. This feature is currently incompatible with Argo, Tiered
+ // Cache, and Bandwidth Alliance. The supported values are:
+ //
+ // - `"none"`: No failover takes place for sessions pinned to the origin (default).
+ // - `"temporary"`: Traffic will be sent to another other healthy origin until the
+ // originally pinned origin is available; note that this can potentially result
+ // in heavy origin flapping.
+ // - `"sticky"`: The session affinity cookie is updated and subsequent requests are
+ // sent to the new origin. Note: Zero-downtime failover with sticky sessions is
+ // currently not supported for session affinity by header.
+ ZeroDowntimeFailover param.Field[LoadBalancerNewParamsSessionAffinityAttributesZeroDowntimeFailover] `json:"zero_downtime_failover"`
+}
+
+func (r LoadBalancerNewParamsSessionAffinityAttributes) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Configures the SameSite attribute on session affinity cookie. Value "Auto" will
+// be translated to "Lax" or "None" depending if Always Use HTTPS is enabled. Note:
+// when using value "None", the secure attribute can not be set to "Never".
+type LoadBalancerNewParamsSessionAffinityAttributesSamesite string
+
+const (
+ LoadBalancerNewParamsSessionAffinityAttributesSamesiteAuto LoadBalancerNewParamsSessionAffinityAttributesSamesite = "Auto"
+ LoadBalancerNewParamsSessionAffinityAttributesSamesiteLax LoadBalancerNewParamsSessionAffinityAttributesSamesite = "Lax"
+ LoadBalancerNewParamsSessionAffinityAttributesSamesiteNone LoadBalancerNewParamsSessionAffinityAttributesSamesite = "None"
+ LoadBalancerNewParamsSessionAffinityAttributesSamesiteStrict LoadBalancerNewParamsSessionAffinityAttributesSamesite = "Strict"
+)
+
+// Configures the Secure attribute on session affinity cookie. Value "Always"
+// indicates the Secure attribute will be set in the Set-Cookie header, "Never"
+// indicates the Secure attribute will not be set, and "Auto" will set the Secure
+// attribute depending if Always Use HTTPS is enabled.
+type LoadBalancerNewParamsSessionAffinityAttributesSecure string
+
+const (
+ LoadBalancerNewParamsSessionAffinityAttributesSecureAuto LoadBalancerNewParamsSessionAffinityAttributesSecure = "Auto"
+ LoadBalancerNewParamsSessionAffinityAttributesSecureAlways LoadBalancerNewParamsSessionAffinityAttributesSecure = "Always"
+ LoadBalancerNewParamsSessionAffinityAttributesSecureNever LoadBalancerNewParamsSessionAffinityAttributesSecure = "Never"
+)
+
+// Configures the zero-downtime failover between origins within a pool when session
+// affinity is enabled. This feature is currently incompatible with Argo, Tiered
+// Cache, and Bandwidth Alliance. The supported values are:
+//
+// - `"none"`: No failover takes place for sessions pinned to the origin (default).
+// - `"temporary"`: Traffic will be sent to another other healthy origin until the
+// originally pinned origin is available; note that this can potentially result
+// in heavy origin flapping.
+// - `"sticky"`: The session affinity cookie is updated and subsequent requests are
+// sent to the new origin. Note: Zero-downtime failover with sticky sessions is
+// currently not supported for session affinity by header.
+type LoadBalancerNewParamsSessionAffinityAttributesZeroDowntimeFailover string
+
+const (
+ LoadBalancerNewParamsSessionAffinityAttributesZeroDowntimeFailoverNone LoadBalancerNewParamsSessionAffinityAttributesZeroDowntimeFailover = "none"
+ LoadBalancerNewParamsSessionAffinityAttributesZeroDowntimeFailoverTemporary LoadBalancerNewParamsSessionAffinityAttributesZeroDowntimeFailover = "temporary"
+ LoadBalancerNewParamsSessionAffinityAttributesZeroDowntimeFailoverSticky LoadBalancerNewParamsSessionAffinityAttributesZeroDowntimeFailover = "sticky"
+)
+
+// Steering Policy for this load balancer.
+//
+// - `"off"`: Use `default_pools`.
+// - `"geo"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied
+// requests, the country for `country_pools` is determined by
+// `location_strategy`.
+// - `"random"`: Select a pool randomly.
+// - `"dynamic_latency"`: Use round trip time to select the closest pool in
+// default_pools (requires pool health checks).
+// - `"proximity"`: Use the pools' latitude and longitude to select the closest
+// pool using the Cloudflare PoP location for proxied requests or the location
+// determined by `location_strategy` for non-proxied requests.
+// - `"least_outstanding_requests"`: Select a pool by taking into consideration
+// `random_steering` weights, as well as each pool's number of outstanding
+// requests. Pools with more pending requests are weighted proportionately less
+// relative to others.
+// - `"least_connections"`: Select a pool by taking into consideration
+// `random_steering` weights, as well as each pool's number of open connections.
+// Pools with more open connections are weighted proportionately less relative to
+// others. Supported for HTTP/1 and HTTP/2 connections.
+// - `""`: Will map to `"geo"` if you use
+// `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.
+type LoadBalancerNewParamsSteeringPolicy string
+
+const (
+ LoadBalancerNewParamsSteeringPolicyOff LoadBalancerNewParamsSteeringPolicy = "off"
+ LoadBalancerNewParamsSteeringPolicyGeo LoadBalancerNewParamsSteeringPolicy = "geo"
+ LoadBalancerNewParamsSteeringPolicyRandom LoadBalancerNewParamsSteeringPolicy = "random"
+ LoadBalancerNewParamsSteeringPolicyDynamicLatency LoadBalancerNewParamsSteeringPolicy = "dynamic_latency"
+ LoadBalancerNewParamsSteeringPolicyProximity LoadBalancerNewParamsSteeringPolicy = "proximity"
+ LoadBalancerNewParamsSteeringPolicyLeastOutstandingRequests LoadBalancerNewParamsSteeringPolicy = "least_outstanding_requests"
+ LoadBalancerNewParamsSteeringPolicyLeastConnections LoadBalancerNewParamsSteeringPolicy = "least_connections"
+ LoadBalancerNewParamsSteeringPolicyEmpty LoadBalancerNewParamsSteeringPolicy = "\"\""
+)
+
+type LoadBalancerNewResponseEnvelope struct {
+ Errors []LoadBalancerNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []LoadBalancerNewResponseEnvelopeMessages `json:"messages,required"`
+ Result LoadBalancer `json:"result,required"`
+ // Whether the API call was successful
+ Success LoadBalancerNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON loadBalancerNewResponseEnvelopeJSON `json:"-"`
+}
+
+// loadBalancerNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [LoadBalancerNewResponseEnvelope]
+type loadBalancerNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LoadBalancerNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r loadBalancerNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type LoadBalancerNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON loadBalancerNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// loadBalancerNewResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [LoadBalancerNewResponseEnvelopeErrors]
+type loadBalancerNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LoadBalancerNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r loadBalancerNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type LoadBalancerNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON loadBalancerNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// loadBalancerNewResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [LoadBalancerNewResponseEnvelopeMessages]
+type loadBalancerNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LoadBalancerNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r loadBalancerNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type LoadBalancerNewResponseEnvelopeSuccess bool
+
+const (
+ LoadBalancerNewResponseEnvelopeSuccessTrue LoadBalancerNewResponseEnvelopeSuccess = true
+)
+
+type LoadBalancerUpdateParams struct {
+ ZoneID param.Field[string] `path:"zone_id,required"`
+ // A list of pool IDs ordered by their failover priority. Pools defined here are
+ // used by default, or when region_pools are not configured for a given region.
+ DefaultPools param.Field[[]string] `json:"default_pools,required"`
+ // The pool ID to use when all other pools are detected as unhealthy.
+ FallbackPool param.Field[interface{}] `json:"fallback_pool,required"`
+ // The DNS hostname to associate with your Load Balancer. If this hostname already
+ // exists as a DNS record in Cloudflare's DNS, the Load Balancer will take
+ // precedence and the DNS record will not be used.
+ Name param.Field[string] `json:"name,required"`
+ // Controls features that modify the routing of requests to pools and origins in
+ // response to dynamic conditions, such as during the interval between active
+ // health monitoring requests. For example, zero-downtime failover occurs
+ // immediately when an origin becomes unavailable due to HTTP 521, 522, or 523
+ // response codes. If there is another healthy origin in the same pool, the request
+ // is retried once against this alternate origin.
+ AdaptiveRouting param.Field[LoadBalancerUpdateParamsAdaptiveRouting] `json:"adaptive_routing"`
+ // A mapping of country codes to a list of pool IDs (ordered by their failover
+ // priority) for the given country. Any country not explicitly defined will fall
+ // back to using the corresponding region_pool mapping if it exists else to
+ // default_pools.
+ CountryPools param.Field[interface{}] `json:"country_pools"`
+ // Object description.
+ Description param.Field[string] `json:"description"`
+ // Whether to enable (the default) this load balancer.
+ Enabled param.Field[bool] `json:"enabled"`
+ // Controls location-based steering for non-proxied requests. See `steering_policy`
+ // to learn how steering is affected.
+ LocationStrategy param.Field[LoadBalancerUpdateParamsLocationStrategy] `json:"location_strategy"`
+ // (Enterprise only): A mapping of Cloudflare PoP identifiers to a list of pool IDs
+ // (ordered by their failover priority) for the PoP (datacenter). Any PoPs not
+ // explicitly defined will fall back to using the corresponding country_pool, then
+ // region_pool mapping if it exists else to default_pools.
+ PopPools param.Field[interface{}] `json:"pop_pools"`
+ // Whether the hostname should be gray clouded (false) or orange clouded (true).
+ Proxied param.Field[bool] `json:"proxied"`
+ // Configures pool weights.
+ //
+ // - `steering_policy="random"`: A random pool is selected with probability
+ // proportional to pool weights.
+ // - `steering_policy="least_outstanding_requests"`: Use pool weights to scale each
+ // pool's outstanding requests.
+ // - `steering_policy="least_connections"`: Use pool weights to scale each pool's
+ // open connections.
+ RandomSteering param.Field[LoadBalancerUpdateParamsRandomSteering] `json:"random_steering"`
+ // A mapping of region codes to a list of pool IDs (ordered by their failover
+ // priority) for the given region. Any regions not explicitly defined will fall
+ // back to using default_pools.
+ RegionPools param.Field[interface{}] `json:"region_pools"`
+ // BETA Field Not General Access: A list of rules for this load balancer to
+ // execute.
+ Rules param.Field[[]LoadBalancerUpdateParamsRule] `json:"rules"`
+ // Specifies the type of session affinity the load balancer should use unless
+ // specified as `"none"` or "" (default). The supported types are:
+ //
+ // - `"cookie"`: On the first request to a proxied load balancer, a cookie is
+ // generated, encoding information of which origin the request will be forwarded
+ // to. Subsequent requests, by the same client to the same load balancer, will be
+ // sent to the origin server the cookie encodes, for the duration of the cookie
+ // and as long as the origin server remains healthy. If the cookie has expired or
+ // the origin server is unhealthy, then a new origin server is calculated and
+ // used.
+ // - `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin
+ // selection is stable and based on the client's ip address.
+ // - `"header"`: On the first request to a proxied load balancer, a session key
+ // based on the configured HTTP headers (see
+ // `session_affinity_attributes.headers`) is generated, encoding the request
+ // headers used for storing in the load balancer session state which origin the
+ // request will be forwarded to. Subsequent requests to the load balancer with
+ // the same headers will be sent to the same origin server, for the duration of
+ // the session and as long as the origin server remains healthy. If the session
+ // has been idle for the duration of `session_affinity_ttl` seconds or the origin
+ // server is unhealthy, then a new origin server is calculated and used. See
+ // `headers` in `session_affinity_attributes` for additional required
+ // configuration.
+ SessionAffinity param.Field[LoadBalancerUpdateParamsSessionAffinity] `json:"session_affinity"`
+ // Configures attributes for session affinity.
+ SessionAffinityAttributes param.Field[LoadBalancerUpdateParamsSessionAffinityAttributes] `json:"session_affinity_attributes"`
+ // Time, in seconds, until a client's session expires after being created. Once the
+ // expiry time has been reached, subsequent requests may get sent to a different
+ // origin server. The accepted ranges per `session_affinity` policy are:
+ //
+ // - `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used
+ // unless explicitly set. The accepted range of values is between [1800, 604800].
+ // - `"header"`: The current default of 1800 seconds will be used unless explicitly
+ // set. The accepted range of values is between [30, 3600]. Note: With session
+ // affinity by header, sessions only expire after they haven't been used for the
+ // number of seconds specified.
+ SessionAffinityTTL param.Field[float64] `json:"session_affinity_ttl"`
+ // Steering Policy for this load balancer.
+ //
+ // - `"off"`: Use `default_pools`.
+ // - `"geo"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied
+ // requests, the country for `country_pools` is determined by
+ // `location_strategy`.
+ // - `"random"`: Select a pool randomly.
+ // - `"dynamic_latency"`: Use round trip time to select the closest pool in
+ // default_pools (requires pool health checks).
+ // - `"proximity"`: Use the pools' latitude and longitude to select the closest
+ // pool using the Cloudflare PoP location for proxied requests or the location
+ // determined by `location_strategy` for non-proxied requests.
+ // - `"least_outstanding_requests"`: Select a pool by taking into consideration
+ // `random_steering` weights, as well as each pool's number of outstanding
+ // requests. Pools with more pending requests are weighted proportionately less
+ // relative to others.
+ // - `"least_connections"`: Select a pool by taking into consideration
+ // `random_steering` weights, as well as each pool's number of open connections.
+ // Pools with more open connections are weighted proportionately less relative to
+ // others. Supported for HTTP/1 and HTTP/2 connections.
+ // - `""`: Will map to `"geo"` if you use
+ // `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.
+ SteeringPolicy param.Field[LoadBalancerUpdateParamsSteeringPolicy] `json:"steering_policy"`
+ // Time to live (TTL) of the DNS entry for the IP address returned by this load
+ // balancer. This only applies to gray-clouded (unproxied) load balancers.
+ TTL param.Field[float64] `json:"ttl"`
+}
+
+func (r LoadBalancerUpdateParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Controls features that modify the routing of requests to pools and origins in
+// response to dynamic conditions, such as during the interval between active
+// health monitoring requests. For example, zero-downtime failover occurs
+// immediately when an origin becomes unavailable due to HTTP 521, 522, or 523
+// response codes. If there is another healthy origin in the same pool, the request
+// is retried once against this alternate origin.
+type LoadBalancerUpdateParamsAdaptiveRouting struct {
+ // Extends zero-downtime failover of requests to healthy origins from alternate
+ // pools, when no healthy alternate exists in the same pool, according to the
+ // failover order defined by traffic and origin steering. When set false (the
+ // default) zero-downtime failover will only occur between origins within the same
+ // pool. See `session_affinity_attributes` for control over when sessions are
+ // broken or reassigned.
+ FailoverAcrossPools param.Field[bool] `json:"failover_across_pools"`
+}
+
+func (r LoadBalancerUpdateParamsAdaptiveRouting) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Controls location-based steering for non-proxied requests. See `steering_policy`
+// to learn how steering is affected.
+type LoadBalancerUpdateParamsLocationStrategy struct {
+ // Determines the authoritative location when ECS is not preferred, does not exist
+ // in the request, or its GeoIP lookup is unsuccessful.
+ //
+ // - `"pop"`: Use the Cloudflare PoP location.
+ // - `"resolver_ip"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is
+ // unsuccessful, use the Cloudflare PoP location.
+ Mode param.Field[LoadBalancerUpdateParamsLocationStrategyMode] `json:"mode"`
+ // Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the
+ // authoritative location.
+ //
+ // - `"always"`: Always prefer ECS.
+ // - `"never"`: Never prefer ECS.
+ // - `"proximity"`: Prefer ECS only when `steering_policy="proximity"`.
+ // - `"geo"`: Prefer ECS only when `steering_policy="geo"`.
+ PreferEcs param.Field[LoadBalancerUpdateParamsLocationStrategyPreferEcs] `json:"prefer_ecs"`
+}
+
+func (r LoadBalancerUpdateParamsLocationStrategy) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Determines the authoritative location when ECS is not preferred, does not exist
+// in the request, or its GeoIP lookup is unsuccessful.
+//
+// - `"pop"`: Use the Cloudflare PoP location.
+// - `"resolver_ip"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is
+// unsuccessful, use the Cloudflare PoP location.
+type LoadBalancerUpdateParamsLocationStrategyMode string
+
+const (
+ LoadBalancerUpdateParamsLocationStrategyModePop LoadBalancerUpdateParamsLocationStrategyMode = "pop"
+ LoadBalancerUpdateParamsLocationStrategyModeResolverIP LoadBalancerUpdateParamsLocationStrategyMode = "resolver_ip"
+)
+
+// Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the
+// authoritative location.
+//
+// - `"always"`: Always prefer ECS.
+// - `"never"`: Never prefer ECS.
+// - `"proximity"`: Prefer ECS only when `steering_policy="proximity"`.
+// - `"geo"`: Prefer ECS only when `steering_policy="geo"`.
+type LoadBalancerUpdateParamsLocationStrategyPreferEcs string
+
+const (
+ LoadBalancerUpdateParamsLocationStrategyPreferEcsAlways LoadBalancerUpdateParamsLocationStrategyPreferEcs = "always"
+ LoadBalancerUpdateParamsLocationStrategyPreferEcsNever LoadBalancerUpdateParamsLocationStrategyPreferEcs = "never"
+ LoadBalancerUpdateParamsLocationStrategyPreferEcsProximity LoadBalancerUpdateParamsLocationStrategyPreferEcs = "proximity"
+ LoadBalancerUpdateParamsLocationStrategyPreferEcsGeo LoadBalancerUpdateParamsLocationStrategyPreferEcs = "geo"
+)
+
+// Configures pool weights.
+//
+// - `steering_policy="random"`: A random pool is selected with probability
+// proportional to pool weights.
+// - `steering_policy="least_outstanding_requests"`: Use pool weights to scale each
+// pool's outstanding requests.
+// - `steering_policy="least_connections"`: Use pool weights to scale each pool's
+// open connections.
+type LoadBalancerUpdateParamsRandomSteering struct {
+ // The default weight for pools in the load balancer that are not specified in the
+ // pool_weights map.
+ DefaultWeight param.Field[float64] `json:"default_weight"`
+ // A mapping of pool IDs to custom weights. The weight is relative to other pools
+ // in the load balancer.
+ PoolWeights param.Field[interface{}] `json:"pool_weights"`
+}
+
+func (r LoadBalancerUpdateParamsRandomSteering) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// A rule object containing conditions and overrides for this load balancer to
+// evaluate.
+type LoadBalancerUpdateParamsRule struct {
+ // The condition expressions to evaluate. If the condition evaluates to true, the
+ // overrides or fixed_response in this rule will be applied. An empty condition is
+ // always true. For more details on condition expressions, please see
+ // https://developers.cloudflare.com/load-balancing/understand-basics/load-balancing-rules/expressions.
+ Condition param.Field[string] `json:"condition"`
+ // Disable this specific rule. It will no longer be evaluated by this load
+ // balancer.
+ Disabled param.Field[bool] `json:"disabled"`
+ // A collection of fields used to directly respond to the eyeball instead of
+ // routing to a pool. If a fixed_response is supplied the rule will be marked as
+ // terminates.
+ FixedResponse param.Field[LoadBalancerUpdateParamsRulesFixedResponse] `json:"fixed_response"`
+ // Name of this rule. Only used for human readability.
+ Name param.Field[string] `json:"name"`
+ // A collection of overrides to apply to the load balancer when this rule's
+ // condition is true. All fields are optional.
+ Overrides param.Field[LoadBalancerUpdateParamsRulesOverrides] `json:"overrides"`
+ // The order in which rules should be executed in relation to each other. Lower
+ // values are executed first. Values do not need to be sequential. If no value is
+ // provided for any rule the array order of the rules field will be used to assign
+ // a priority.
+ Priority param.Field[int64] `json:"priority"`
+ // If this rule's condition is true, this causes rule evaluation to stop after
+ // processing this rule.
+ Terminates param.Field[bool] `json:"terminates"`
+}
+
+func (r LoadBalancerUpdateParamsRule) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// A collection of fields used to directly respond to the eyeball instead of
+// routing to a pool. If a fixed_response is supplied the rule will be marked as
+// terminates.
+type LoadBalancerUpdateParamsRulesFixedResponse struct {
+ // The http 'Content-Type' header to include in the response.
+ ContentType param.Field[string] `json:"content_type"`
+ // The http 'Location' header to include in the response.
+ Location param.Field[string] `json:"location"`
+ // Text to include as the http body.
+ MessageBody param.Field[string] `json:"message_body"`
+ // The http status code to respond with.
+ StatusCode param.Field[int64] `json:"status_code"`
+}
+
+func (r LoadBalancerUpdateParamsRulesFixedResponse) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// A collection of overrides to apply to the load balancer when this rule's
+// condition is true. All fields are optional.
+type LoadBalancerUpdateParamsRulesOverrides struct {
+ // Controls features that modify the routing of requests to pools and origins in
+ // response to dynamic conditions, such as during the interval between active
+ // health monitoring requests. For example, zero-downtime failover occurs
+ // immediately when an origin becomes unavailable due to HTTP 521, 522, or 523
+ // response codes. If there is another healthy origin in the same pool, the request
+ // is retried once against this alternate origin.
+ AdaptiveRouting param.Field[LoadBalancerUpdateParamsRulesOverridesAdaptiveRouting] `json:"adaptive_routing"`
+ // A mapping of country codes to a list of pool IDs (ordered by their failover
+ // priority) for the given country. Any country not explicitly defined will fall
+ // back to using the corresponding region_pool mapping if it exists else to
+ // default_pools.
+ CountryPools param.Field[interface{}] `json:"country_pools"`
+ // A list of pool IDs ordered by their failover priority. Pools defined here are
+ // used by default, or when region_pools are not configured for a given region.
+ DefaultPools param.Field[[]string] `json:"default_pools"`
+ // The pool ID to use when all other pools are detected as unhealthy.
+ FallbackPool param.Field[interface{}] `json:"fallback_pool"`
+ // Controls location-based steering for non-proxied requests. See `steering_policy`
+ // to learn how steering is affected.
+ LocationStrategy param.Field[LoadBalancerUpdateParamsRulesOverridesLocationStrategy] `json:"location_strategy"`
+ // (Enterprise only): A mapping of Cloudflare PoP identifiers to a list of pool IDs
+ // (ordered by their failover priority) for the PoP (datacenter). Any PoPs not
+ // explicitly defined will fall back to using the corresponding country_pool, then
+ // region_pool mapping if it exists else to default_pools.
+ PopPools param.Field[interface{}] `json:"pop_pools"`
+ // Configures pool weights.
+ //
+ // - `steering_policy="random"`: A random pool is selected with probability
+ // proportional to pool weights.
+ // - `steering_policy="least_outstanding_requests"`: Use pool weights to scale each
+ // pool's outstanding requests.
+ // - `steering_policy="least_connections"`: Use pool weights to scale each pool's
+ // open connections.
+ RandomSteering param.Field[LoadBalancerUpdateParamsRulesOverridesRandomSteering] `json:"random_steering"`
+ // A mapping of region codes to a list of pool IDs (ordered by their failover
+ // priority) for the given region. Any regions not explicitly defined will fall
+ // back to using default_pools.
+ RegionPools param.Field[interface{}] `json:"region_pools"`
+ // Specifies the type of session affinity the load balancer should use unless
+ // specified as `"none"` or "" (default). The supported types are:
+ //
+ // - `"cookie"`: On the first request to a proxied load balancer, a cookie is
+ // generated, encoding information of which origin the request will be forwarded
+ // to. Subsequent requests, by the same client to the same load balancer, will be
+ // sent to the origin server the cookie encodes, for the duration of the cookie
+ // and as long as the origin server remains healthy. If the cookie has expired or
+ // the origin server is unhealthy, then a new origin server is calculated and
+ // used.
+ // - `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin
+ // selection is stable and based on the client's ip address.
+ // - `"header"`: On the first request to a proxied load balancer, a session key
+ // based on the configured HTTP headers (see
+ // `session_affinity_attributes.headers`) is generated, encoding the request
+ // headers used for storing in the load balancer session state which origin the
+ // request will be forwarded to. Subsequent requests to the load balancer with
+ // the same headers will be sent to the same origin server, for the duration of
+ // the session and as long as the origin server remains healthy. If the session
+ // has been idle for the duration of `session_affinity_ttl` seconds or the origin
+ // server is unhealthy, then a new origin server is calculated and used. See
+ // `headers` in `session_affinity_attributes` for additional required
+ // configuration.
+ SessionAffinity param.Field[LoadBalancerUpdateParamsRulesOverridesSessionAffinity] `json:"session_affinity"`
+ // Configures attributes for session affinity.
+ SessionAffinityAttributes param.Field[LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributes] `json:"session_affinity_attributes"`
+ // Time, in seconds, until a client's session expires after being created. Once the
+ // expiry time has been reached, subsequent requests may get sent to a different
+ // origin server. The accepted ranges per `session_affinity` policy are:
+ //
+ // - `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used
+ // unless explicitly set. The accepted range of values is between [1800, 604800].
+ // - `"header"`: The current default of 1800 seconds will be used unless explicitly
+ // set. The accepted range of values is between [30, 3600]. Note: With session
+ // affinity by header, sessions only expire after they haven't been used for the
+ // number of seconds specified.
+ SessionAffinityTTL param.Field[float64] `json:"session_affinity_ttl"`
+ // Steering Policy for this load balancer.
+ //
+ // - `"off"`: Use `default_pools`.
+ // - `"geo"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied
+ // requests, the country for `country_pools` is determined by
+ // `location_strategy`.
+ // - `"random"`: Select a pool randomly.
+ // - `"dynamic_latency"`: Use round trip time to select the closest pool in
+ // default_pools (requires pool health checks).
+ // - `"proximity"`: Use the pools' latitude and longitude to select the closest
+ // pool using the Cloudflare PoP location for proxied requests or the location
+ // determined by `location_strategy` for non-proxied requests.
+ // - `"least_outstanding_requests"`: Select a pool by taking into consideration
+ // `random_steering` weights, as well as each pool's number of outstanding
+ // requests. Pools with more pending requests are weighted proportionately less
+ // relative to others.
+ // - `"least_connections"`: Select a pool by taking into consideration
+ // `random_steering` weights, as well as each pool's number of open connections.
+ // Pools with more open connections are weighted proportionately less relative to
+ // others. Supported for HTTP/1 and HTTP/2 connections.
+ // - `""`: Will map to `"geo"` if you use
+ // `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.
+ SteeringPolicy param.Field[LoadBalancerUpdateParamsRulesOverridesSteeringPolicy] `json:"steering_policy"`
+ // Time to live (TTL) of the DNS entry for the IP address returned by this load
+ // balancer. This only applies to gray-clouded (unproxied) load balancers.
+ TTL param.Field[float64] `json:"ttl"`
+}
+
+func (r LoadBalancerUpdateParamsRulesOverrides) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Controls features that modify the routing of requests to pools and origins in
+// response to dynamic conditions, such as during the interval between active
+// health monitoring requests. For example, zero-downtime failover occurs
+// immediately when an origin becomes unavailable due to HTTP 521, 522, or 523
+// response codes. If there is another healthy origin in the same pool, the request
+// is retried once against this alternate origin.
+type LoadBalancerUpdateParamsRulesOverridesAdaptiveRouting struct {
+ // Extends zero-downtime failover of requests to healthy origins from alternate
+ // pools, when no healthy alternate exists in the same pool, according to the
+ // failover order defined by traffic and origin steering. When set false (the
+ // default) zero-downtime failover will only occur between origins within the same
+ // pool. See `session_affinity_attributes` for control over when sessions are
+ // broken or reassigned.
+ FailoverAcrossPools param.Field[bool] `json:"failover_across_pools"`
+}
+
+func (r LoadBalancerUpdateParamsRulesOverridesAdaptiveRouting) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Controls location-based steering for non-proxied requests. See `steering_policy`
+// to learn how steering is affected.
+type LoadBalancerUpdateParamsRulesOverridesLocationStrategy struct {
+ // Determines the authoritative location when ECS is not preferred, does not exist
+ // in the request, or its GeoIP lookup is unsuccessful.
+ //
+ // - `"pop"`: Use the Cloudflare PoP location.
+ // - `"resolver_ip"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is
+ // unsuccessful, use the Cloudflare PoP location.
+ Mode param.Field[LoadBalancerUpdateParamsRulesOverridesLocationStrategyMode] `json:"mode"`
+ // Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the
+ // authoritative location.
+ //
+ // - `"always"`: Always prefer ECS.
+ // - `"never"`: Never prefer ECS.
+ // - `"proximity"`: Prefer ECS only when `steering_policy="proximity"`.
+ // - `"geo"`: Prefer ECS only when `steering_policy="geo"`.
+ PreferEcs param.Field[LoadBalancerUpdateParamsRulesOverridesLocationStrategyPreferEcs] `json:"prefer_ecs"`
+}
+
+func (r LoadBalancerUpdateParamsRulesOverridesLocationStrategy) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Determines the authoritative location when ECS is not preferred, does not exist
+// in the request, or its GeoIP lookup is unsuccessful.
+//
+// - `"pop"`: Use the Cloudflare PoP location.
+// - `"resolver_ip"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is
+// unsuccessful, use the Cloudflare PoP location.
+type LoadBalancerUpdateParamsRulesOverridesLocationStrategyMode string
+
+const (
+ LoadBalancerUpdateParamsRulesOverridesLocationStrategyModePop LoadBalancerUpdateParamsRulesOverridesLocationStrategyMode = "pop"
+ LoadBalancerUpdateParamsRulesOverridesLocationStrategyModeResolverIP LoadBalancerUpdateParamsRulesOverridesLocationStrategyMode = "resolver_ip"
+)
+
+// Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the
+// authoritative location.
+//
+// - `"always"`: Always prefer ECS.
+// - `"never"`: Never prefer ECS.
+// - `"proximity"`: Prefer ECS only when `steering_policy="proximity"`.
+// - `"geo"`: Prefer ECS only when `steering_policy="geo"`.
+type LoadBalancerUpdateParamsRulesOverridesLocationStrategyPreferEcs string
+
+const (
+ LoadBalancerUpdateParamsRulesOverridesLocationStrategyPreferEcsAlways LoadBalancerUpdateParamsRulesOverridesLocationStrategyPreferEcs = "always"
+ LoadBalancerUpdateParamsRulesOverridesLocationStrategyPreferEcsNever LoadBalancerUpdateParamsRulesOverridesLocationStrategyPreferEcs = "never"
+ LoadBalancerUpdateParamsRulesOverridesLocationStrategyPreferEcsProximity LoadBalancerUpdateParamsRulesOverridesLocationStrategyPreferEcs = "proximity"
+ LoadBalancerUpdateParamsRulesOverridesLocationStrategyPreferEcsGeo LoadBalancerUpdateParamsRulesOverridesLocationStrategyPreferEcs = "geo"
+)
+
+// Configures pool weights.
+//
+// - `steering_policy="random"`: A random pool is selected with probability
+// proportional to pool weights.
+// - `steering_policy="least_outstanding_requests"`: Use pool weights to scale each
+// pool's outstanding requests.
+// - `steering_policy="least_connections"`: Use pool weights to scale each pool's
+// open connections.
+type LoadBalancerUpdateParamsRulesOverridesRandomSteering struct {
+ // The default weight for pools in the load balancer that are not specified in the
+ // pool_weights map.
+ DefaultWeight param.Field[float64] `json:"default_weight"`
+ // A mapping of pool IDs to custom weights. The weight is relative to other pools
+ // in the load balancer.
+ PoolWeights param.Field[interface{}] `json:"pool_weights"`
+}
+
+func (r LoadBalancerUpdateParamsRulesOverridesRandomSteering) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Specifies the type of session affinity the load balancer should use unless
+// specified as `"none"` or "" (default). The supported types are:
+//
+// - `"cookie"`: On the first request to a proxied load balancer, a cookie is
+// generated, encoding information of which origin the request will be forwarded
+// to. Subsequent requests, by the same client to the same load balancer, will be
+// sent to the origin server the cookie encodes, for the duration of the cookie
+// and as long as the origin server remains healthy. If the cookie has expired or
+// the origin server is unhealthy, then a new origin server is calculated and
+// used.
+// - `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin
+// selection is stable and based on the client's ip address.
+// - `"header"`: On the first request to a proxied load balancer, a session key
+// based on the configured HTTP headers (see
+// `session_affinity_attributes.headers`) is generated, encoding the request
+// headers used for storing in the load balancer session state which origin the
+// request will be forwarded to. Subsequent requests to the load balancer with
+// the same headers will be sent to the same origin server, for the duration of
+// the session and as long as the origin server remains healthy. If the session
+// has been idle for the duration of `session_affinity_ttl` seconds or the origin
+// server is unhealthy, then a new origin server is calculated and used. See
+// `headers` in `session_affinity_attributes` for additional required
+// configuration.
+type LoadBalancerUpdateParamsRulesOverridesSessionAffinity string
+
+const (
+ LoadBalancerUpdateParamsRulesOverridesSessionAffinityNone LoadBalancerUpdateParamsRulesOverridesSessionAffinity = "none"
+ LoadBalancerUpdateParamsRulesOverridesSessionAffinityCookie LoadBalancerUpdateParamsRulesOverridesSessionAffinity = "cookie"
+ LoadBalancerUpdateParamsRulesOverridesSessionAffinityIPCookie LoadBalancerUpdateParamsRulesOverridesSessionAffinity = "ip_cookie"
+ LoadBalancerUpdateParamsRulesOverridesSessionAffinityHeader LoadBalancerUpdateParamsRulesOverridesSessionAffinity = "header"
+ LoadBalancerUpdateParamsRulesOverridesSessionAffinityEmpty LoadBalancerUpdateParamsRulesOverridesSessionAffinity = "\"\""
+)
+
+// Configures attributes for session affinity.
+type LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributes struct {
+ // Configures the drain duration in seconds. This field is only used when session
+ // affinity is enabled on the load balancer.
+ DrainDuration param.Field[float64] `json:"drain_duration"`
+ // Configures the names of HTTP headers to base session affinity on when header
+ // `session_affinity` is enabled. At least one HTTP header name must be provided.
+ // To specify the exact cookies to be used, include an item in the following
+ // format: `"cookie:,"` (example) where everything
+ // after the colon is a comma-separated list of cookie names. Providing only
+ // `"cookie"` will result in all cookies being used. The default max number of HTTP
+ // header names that can be provided depends on your plan: 5 for Enterprise, 1 for
+ // all other plans.
+ Headers param.Field[[]string] `json:"headers"`
+ // When header `session_affinity` is enabled, this option can be used to specify
+ // how HTTP headers on load balancing requests will be used. The supported values
+ // are:
+ //
+ // - `"true"`: Load balancing requests must contain _all_ of the HTTP headers
+ // specified by the `headers` session affinity attribute, otherwise sessions
+ // aren't created.
+ // - `"false"`: Load balancing requests must contain _at least one_ of the HTTP
+ // headers specified by the `headers` session affinity attribute, otherwise
+ // sessions aren't created.
+ RequireAllHeaders param.Field[bool] `json:"require_all_headers"`
+ // Configures the SameSite attribute on session affinity cookie. Value "Auto" will
+ // be translated to "Lax" or "None" depending if Always Use HTTPS is enabled. Note:
+ // when using value "None", the secure attribute can not be set to "Never".
+ Samesite param.Field[LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesSamesite] `json:"samesite"`
+ // Configures the Secure attribute on session affinity cookie. Value "Always"
+ // indicates the Secure attribute will be set in the Set-Cookie header, "Never"
+ // indicates the Secure attribute will not be set, and "Auto" will set the Secure
+ // attribute depending if Always Use HTTPS is enabled.
+ Secure param.Field[LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesSecure] `json:"secure"`
+ // Configures the zero-downtime failover between origins within a pool when session
+ // affinity is enabled. This feature is currently incompatible with Argo, Tiered
+ // Cache, and Bandwidth Alliance. The supported values are:
+ //
+ // - `"none"`: No failover takes place for sessions pinned to the origin (default).
+ // - `"temporary"`: Traffic will be sent to another other healthy origin until the
+ // originally pinned origin is available; note that this can potentially result
+ // in heavy origin flapping.
+ // - `"sticky"`: The session affinity cookie is updated and subsequent requests are
+ // sent to the new origin. Note: Zero-downtime failover with sticky sessions is
+ // currently not supported for session affinity by header.
+ ZeroDowntimeFailover param.Field[LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailover] `json:"zero_downtime_failover"`
+}
+
+func (r LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributes) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Configures the SameSite attribute on session affinity cookie. Value "Auto" will
+// be translated to "Lax" or "None" depending if Always Use HTTPS is enabled. Note:
+// when using value "None", the secure attribute can not be set to "Never".
+type LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesSamesite string
+
+const (
+ LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesSamesiteAuto LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesSamesite = "Auto"
+ LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesSamesiteLax LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesSamesite = "Lax"
+ LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesSamesiteNone LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesSamesite = "None"
+ LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesSamesiteStrict LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesSamesite = "Strict"
+)
+
+// Configures the Secure attribute on session affinity cookie. Value "Always"
+// indicates the Secure attribute will be set in the Set-Cookie header, "Never"
+// indicates the Secure attribute will not be set, and "Auto" will set the Secure
+// attribute depending if Always Use HTTPS is enabled.
+type LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesSecure string
+
+const (
+ LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesSecureAuto LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesSecure = "Auto"
+ LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesSecureAlways LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesSecure = "Always"
+ LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesSecureNever LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesSecure = "Never"
+)
+
+// Configures the zero-downtime failover between origins within a pool when session
+// affinity is enabled. This feature is currently incompatible with Argo, Tiered
+// Cache, and Bandwidth Alliance. The supported values are:
+//
+// - `"none"`: No failover takes place for sessions pinned to the origin (default).
+// - `"temporary"`: Traffic will be sent to another other healthy origin until the
+// originally pinned origin is available; note that this can potentially result
+// in heavy origin flapping.
+// - `"sticky"`: The session affinity cookie is updated and subsequent requests are
+// sent to the new origin. Note: Zero-downtime failover with sticky sessions is
+// currently not supported for session affinity by header.
+type LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailover string
+
+const (
+ LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailoverNone LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailover = "none"
+ LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailoverTemporary LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailover = "temporary"
+ LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailoverSticky LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailover = "sticky"
+)
+
+// Steering Policy for this load balancer.
+//
+// - `"off"`: Use `default_pools`.
+// - `"geo"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied
+// requests, the country for `country_pools` is determined by
+// `location_strategy`.
+// - `"random"`: Select a pool randomly.
+// - `"dynamic_latency"`: Use round trip time to select the closest pool in
+// default_pools (requires pool health checks).
+// - `"proximity"`: Use the pools' latitude and longitude to select the closest
+// pool using the Cloudflare PoP location for proxied requests or the location
+// determined by `location_strategy` for non-proxied requests.
+// - `"least_outstanding_requests"`: Select a pool by taking into consideration
+// `random_steering` weights, as well as each pool's number of outstanding
+// requests. Pools with more pending requests are weighted proportionately less
+// relative to others.
+// - `"least_connections"`: Select a pool by taking into consideration
+// `random_steering` weights, as well as each pool's number of open connections.
+// Pools with more open connections are weighted proportionately less relative to
+// others. Supported for HTTP/1 and HTTP/2 connections.
+// - `""`: Will map to `"geo"` if you use
+// `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.
+type LoadBalancerUpdateParamsRulesOverridesSteeringPolicy string
+
+const (
+ LoadBalancerUpdateParamsRulesOverridesSteeringPolicyOff LoadBalancerUpdateParamsRulesOverridesSteeringPolicy = "off"
+ LoadBalancerUpdateParamsRulesOverridesSteeringPolicyGeo LoadBalancerUpdateParamsRulesOverridesSteeringPolicy = "geo"
+ LoadBalancerUpdateParamsRulesOverridesSteeringPolicyRandom LoadBalancerUpdateParamsRulesOverridesSteeringPolicy = "random"
+ LoadBalancerUpdateParamsRulesOverridesSteeringPolicyDynamicLatency LoadBalancerUpdateParamsRulesOverridesSteeringPolicy = "dynamic_latency"
+ LoadBalancerUpdateParamsRulesOverridesSteeringPolicyProximity LoadBalancerUpdateParamsRulesOverridesSteeringPolicy = "proximity"
+ LoadBalancerUpdateParamsRulesOverridesSteeringPolicyLeastOutstandingRequests LoadBalancerUpdateParamsRulesOverridesSteeringPolicy = "least_outstanding_requests"
+ LoadBalancerUpdateParamsRulesOverridesSteeringPolicyLeastConnections LoadBalancerUpdateParamsRulesOverridesSteeringPolicy = "least_connections"
+ LoadBalancerUpdateParamsRulesOverridesSteeringPolicyEmpty LoadBalancerUpdateParamsRulesOverridesSteeringPolicy = "\"\""
+)
+
+// Specifies the type of session affinity the load balancer should use unless
+// specified as `"none"` or "" (default). The supported types are:
+//
+// - `"cookie"`: On the first request to a proxied load balancer, a cookie is
+// generated, encoding information of which origin the request will be forwarded
+// to. Subsequent requests, by the same client to the same load balancer, will be
+// sent to the origin server the cookie encodes, for the duration of the cookie
+// and as long as the origin server remains healthy. If the cookie has expired or
+// the origin server is unhealthy, then a new origin server is calculated and
+// used.
+// - `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin
+// selection is stable and based on the client's ip address.
+// - `"header"`: On the first request to a proxied load balancer, a session key
+// based on the configured HTTP headers (see
+// `session_affinity_attributes.headers`) is generated, encoding the request
+// headers used for storing in the load balancer session state which origin the
+// request will be forwarded to. Subsequent requests to the load balancer with
+// the same headers will be sent to the same origin server, for the duration of
+// the session and as long as the origin server remains healthy. If the session
+// has been idle for the duration of `session_affinity_ttl` seconds or the origin
+// server is unhealthy, then a new origin server is calculated and used. See
+// `headers` in `session_affinity_attributes` for additional required
+// configuration.
+type LoadBalancerUpdateParamsSessionAffinity string
+
+const (
+ LoadBalancerUpdateParamsSessionAffinityNone LoadBalancerUpdateParamsSessionAffinity = "none"
+ LoadBalancerUpdateParamsSessionAffinityCookie LoadBalancerUpdateParamsSessionAffinity = "cookie"
+ LoadBalancerUpdateParamsSessionAffinityIPCookie LoadBalancerUpdateParamsSessionAffinity = "ip_cookie"
+ LoadBalancerUpdateParamsSessionAffinityHeader LoadBalancerUpdateParamsSessionAffinity = "header"
+ LoadBalancerUpdateParamsSessionAffinityEmpty LoadBalancerUpdateParamsSessionAffinity = "\"\""
+)
+
+// Configures attributes for session affinity.
+type LoadBalancerUpdateParamsSessionAffinityAttributes struct {
+ // Configures the drain duration in seconds. This field is only used when session
+ // affinity is enabled on the load balancer.
+ DrainDuration param.Field[float64] `json:"drain_duration"`
+ // Configures the names of HTTP headers to base session affinity on when header
+ // `session_affinity` is enabled. At least one HTTP header name must be provided.
+ // To specify the exact cookies to be used, include an item in the following
+ // format: `"cookie:,"` (example) where everything
+ // after the colon is a comma-separated list of cookie names. Providing only
+ // `"cookie"` will result in all cookies being used. The default max number of HTTP
+ // header names that can be provided depends on your plan: 5 for Enterprise, 1 for
+ // all other plans.
+ Headers param.Field[[]string] `json:"headers"`
+ // When header `session_affinity` is enabled, this option can be used to specify
+ // how HTTP headers on load balancing requests will be used. The supported values
+ // are:
+ //
+ // - `"true"`: Load balancing requests must contain _all_ of the HTTP headers
+ // specified by the `headers` session affinity attribute, otherwise sessions
+ // aren't created.
+ // - `"false"`: Load balancing requests must contain _at least one_ of the HTTP
+ // headers specified by the `headers` session affinity attribute, otherwise
+ // sessions aren't created.
+ RequireAllHeaders param.Field[bool] `json:"require_all_headers"`
+ // Configures the SameSite attribute on session affinity cookie. Value "Auto" will
+ // be translated to "Lax" or "None" depending if Always Use HTTPS is enabled. Note:
+ // when using value "None", the secure attribute can not be set to "Never".
+ Samesite param.Field[LoadBalancerUpdateParamsSessionAffinityAttributesSamesite] `json:"samesite"`
+ // Configures the Secure attribute on session affinity cookie. Value "Always"
+ // indicates the Secure attribute will be set in the Set-Cookie header, "Never"
+ // indicates the Secure attribute will not be set, and "Auto" will set the Secure
+ // attribute depending if Always Use HTTPS is enabled.
+ Secure param.Field[LoadBalancerUpdateParamsSessionAffinityAttributesSecure] `json:"secure"`
+ // Configures the zero-downtime failover between origins within a pool when session
+ // affinity is enabled. This feature is currently incompatible with Argo, Tiered
+ // Cache, and Bandwidth Alliance. The supported values are:
+ //
+ // - `"none"`: No failover takes place for sessions pinned to the origin (default).
+ // - `"temporary"`: Traffic will be sent to another other healthy origin until the
+ // originally pinned origin is available; note that this can potentially result
+ // in heavy origin flapping.
+ // - `"sticky"`: The session affinity cookie is updated and subsequent requests are
+ // sent to the new origin. Note: Zero-downtime failover with sticky sessions is
+ // currently not supported for session affinity by header.
+ ZeroDowntimeFailover param.Field[LoadBalancerUpdateParamsSessionAffinityAttributesZeroDowntimeFailover] `json:"zero_downtime_failover"`
+}
+
+func (r LoadBalancerUpdateParamsSessionAffinityAttributes) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Configures the SameSite attribute on session affinity cookie. Value "Auto" will
+// be translated to "Lax" or "None" depending if Always Use HTTPS is enabled. Note:
+// when using value "None", the secure attribute can not be set to "Never".
+type LoadBalancerUpdateParamsSessionAffinityAttributesSamesite string
+
+const (
+ LoadBalancerUpdateParamsSessionAffinityAttributesSamesiteAuto LoadBalancerUpdateParamsSessionAffinityAttributesSamesite = "Auto"
+ LoadBalancerUpdateParamsSessionAffinityAttributesSamesiteLax LoadBalancerUpdateParamsSessionAffinityAttributesSamesite = "Lax"
+ LoadBalancerUpdateParamsSessionAffinityAttributesSamesiteNone LoadBalancerUpdateParamsSessionAffinityAttributesSamesite = "None"
+ LoadBalancerUpdateParamsSessionAffinityAttributesSamesiteStrict LoadBalancerUpdateParamsSessionAffinityAttributesSamesite = "Strict"
+)
+
+// Configures the Secure attribute on session affinity cookie. Value "Always"
+// indicates the Secure attribute will be set in the Set-Cookie header, "Never"
+// indicates the Secure attribute will not be set, and "Auto" will set the Secure
+// attribute depending if Always Use HTTPS is enabled.
+type LoadBalancerUpdateParamsSessionAffinityAttributesSecure string
+
+const (
+ LoadBalancerUpdateParamsSessionAffinityAttributesSecureAuto LoadBalancerUpdateParamsSessionAffinityAttributesSecure = "Auto"
+ LoadBalancerUpdateParamsSessionAffinityAttributesSecureAlways LoadBalancerUpdateParamsSessionAffinityAttributesSecure = "Always"
+ LoadBalancerUpdateParamsSessionAffinityAttributesSecureNever LoadBalancerUpdateParamsSessionAffinityAttributesSecure = "Never"
+)
+
+// Configures the zero-downtime failover between origins within a pool when session
+// affinity is enabled. This feature is currently incompatible with Argo, Tiered
+// Cache, and Bandwidth Alliance. The supported values are:
+//
+// - `"none"`: No failover takes place for sessions pinned to the origin (default).
+// - `"temporary"`: Traffic will be sent to another other healthy origin until the
+// originally pinned origin is available; note that this can potentially result
+// in heavy origin flapping.
+// - `"sticky"`: The session affinity cookie is updated and subsequent requests are
+// sent to the new origin. Note: Zero-downtime failover with sticky sessions is
+// currently not supported for session affinity by header.
+type LoadBalancerUpdateParamsSessionAffinityAttributesZeroDowntimeFailover string
+
+const (
+ LoadBalancerUpdateParamsSessionAffinityAttributesZeroDowntimeFailoverNone LoadBalancerUpdateParamsSessionAffinityAttributesZeroDowntimeFailover = "none"
+ LoadBalancerUpdateParamsSessionAffinityAttributesZeroDowntimeFailoverTemporary LoadBalancerUpdateParamsSessionAffinityAttributesZeroDowntimeFailover = "temporary"
+ LoadBalancerUpdateParamsSessionAffinityAttributesZeroDowntimeFailoverSticky LoadBalancerUpdateParamsSessionAffinityAttributesZeroDowntimeFailover = "sticky"
+)
+
+// Steering Policy for this load balancer.
+//
+// - `"off"`: Use `default_pools`.
+// - `"geo"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied
+// requests, the country for `country_pools` is determined by
+// `location_strategy`.
+// - `"random"`: Select a pool randomly.
+// - `"dynamic_latency"`: Use round trip time to select the closest pool in
+// default_pools (requires pool health checks).
+// - `"proximity"`: Use the pools' latitude and longitude to select the closest
+// pool using the Cloudflare PoP location for proxied requests or the location
+// determined by `location_strategy` for non-proxied requests.
+// - `"least_outstanding_requests"`: Select a pool by taking into consideration
+// `random_steering` weights, as well as each pool's number of outstanding
+// requests. Pools with more pending requests are weighted proportionately less
+// relative to others.
+// - `"least_connections"`: Select a pool by taking into consideration
+// `random_steering` weights, as well as each pool's number of open connections.
+// Pools with more open connections are weighted proportionately less relative to
+// others. Supported for HTTP/1 and HTTP/2 connections.
+// - `""`: Will map to `"geo"` if you use
+// `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.
+type LoadBalancerUpdateParamsSteeringPolicy string
+
+const (
+ LoadBalancerUpdateParamsSteeringPolicyOff LoadBalancerUpdateParamsSteeringPolicy = "off"
+ LoadBalancerUpdateParamsSteeringPolicyGeo LoadBalancerUpdateParamsSteeringPolicy = "geo"
+ LoadBalancerUpdateParamsSteeringPolicyRandom LoadBalancerUpdateParamsSteeringPolicy = "random"
+ LoadBalancerUpdateParamsSteeringPolicyDynamicLatency LoadBalancerUpdateParamsSteeringPolicy = "dynamic_latency"
+ LoadBalancerUpdateParamsSteeringPolicyProximity LoadBalancerUpdateParamsSteeringPolicy = "proximity"
+ LoadBalancerUpdateParamsSteeringPolicyLeastOutstandingRequests LoadBalancerUpdateParamsSteeringPolicy = "least_outstanding_requests"
+ LoadBalancerUpdateParamsSteeringPolicyLeastConnections LoadBalancerUpdateParamsSteeringPolicy = "least_connections"
+ LoadBalancerUpdateParamsSteeringPolicyEmpty LoadBalancerUpdateParamsSteeringPolicy = "\"\""
+)
+
+type LoadBalancerUpdateResponseEnvelope struct {
+ Errors []LoadBalancerUpdateResponseEnvelopeErrors `json:"errors,required"`
+ Messages []LoadBalancerUpdateResponseEnvelopeMessages `json:"messages,required"`
+ Result LoadBalancer `json:"result,required"`
+ // Whether the API call was successful
+ Success LoadBalancerUpdateResponseEnvelopeSuccess `json:"success,required"`
+ JSON loadBalancerUpdateResponseEnvelopeJSON `json:"-"`
+}
+
+// loadBalancerUpdateResponseEnvelopeJSON contains the JSON metadata for the struct
+// [LoadBalancerUpdateResponseEnvelope]
+type loadBalancerUpdateResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LoadBalancerUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r loadBalancerUpdateResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type LoadBalancerUpdateResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON loadBalancerUpdateResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// loadBalancerUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [LoadBalancerUpdateResponseEnvelopeErrors]
+type loadBalancerUpdateResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LoadBalancerUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r loadBalancerUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type LoadBalancerUpdateResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON loadBalancerUpdateResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// loadBalancerUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for
+// the struct [LoadBalancerUpdateResponseEnvelopeMessages]
+type loadBalancerUpdateResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LoadBalancerUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r loadBalancerUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type LoadBalancerUpdateResponseEnvelopeSuccess bool
+
+const (
+ LoadBalancerUpdateResponseEnvelopeSuccessTrue LoadBalancerUpdateResponseEnvelopeSuccess = true
+)
+
+type LoadBalancerListParams struct {
+ ZoneID param.Field[string] `path:"zone_id,required"`
+}
+
+type LoadBalancerListResponseEnvelope struct {
+ Errors []LoadBalancerListResponseEnvelopeErrors `json:"errors,required"`
+ Messages []LoadBalancerListResponseEnvelopeMessages `json:"messages,required"`
+ Result []LoadBalancer `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success LoadBalancerListResponseEnvelopeSuccess `json:"success,required"`
+ ResultInfo LoadBalancerListResponseEnvelopeResultInfo `json:"result_info"`
+ JSON loadBalancerListResponseEnvelopeJSON `json:"-"`
+}
+
+// loadBalancerListResponseEnvelopeJSON contains the JSON metadata for the struct
+// [LoadBalancerListResponseEnvelope]
+type loadBalancerListResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ ResultInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LoadBalancerListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r loadBalancerListResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type LoadBalancerListResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON loadBalancerListResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// loadBalancerListResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [LoadBalancerListResponseEnvelopeErrors]
+type loadBalancerListResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LoadBalancerListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r loadBalancerListResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type LoadBalancerListResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON loadBalancerListResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// loadBalancerListResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [LoadBalancerListResponseEnvelopeMessages]
+type loadBalancerListResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LoadBalancerListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r loadBalancerListResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type LoadBalancerListResponseEnvelopeSuccess bool
+
+const (
+ LoadBalancerListResponseEnvelopeSuccessTrue LoadBalancerListResponseEnvelopeSuccess = true
+)
+
+type LoadBalancerListResponseEnvelopeResultInfo struct {
+ // Total number of results for the requested service
+ Count float64 `json:"count"`
+ // Current page within paginated list of results
+ Page float64 `json:"page"`
+ // Number of results per page of results
+ PerPage float64 `json:"per_page"`
+ // Total results available without any search parameters
+ TotalCount float64 `json:"total_count"`
+ JSON loadBalancerListResponseEnvelopeResultInfoJSON `json:"-"`
+}
+
+// loadBalancerListResponseEnvelopeResultInfoJSON contains the JSON metadata for
+// the struct [LoadBalancerListResponseEnvelopeResultInfo]
+type loadBalancerListResponseEnvelopeResultInfoJSON struct {
+ Count apijson.Field
+ Page apijson.Field
+ PerPage apijson.Field
+ TotalCount apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LoadBalancerListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r loadBalancerListResponseEnvelopeResultInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type LoadBalancerDeleteParams struct {
+ ZoneID param.Field[string] `path:"zone_id,required"`
+}
+
+type LoadBalancerDeleteResponseEnvelope struct {
+ Errors []LoadBalancerDeleteResponseEnvelopeErrors `json:"errors,required"`
+ Messages []LoadBalancerDeleteResponseEnvelopeMessages `json:"messages,required"`
+ Result LoadBalancerDeleteResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success LoadBalancerDeleteResponseEnvelopeSuccess `json:"success,required"`
+ JSON loadBalancerDeleteResponseEnvelopeJSON `json:"-"`
+}
+
+// loadBalancerDeleteResponseEnvelopeJSON contains the JSON metadata for the struct
+// [LoadBalancerDeleteResponseEnvelope]
+type loadBalancerDeleteResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LoadBalancerDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r loadBalancerDeleteResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type LoadBalancerDeleteResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON loadBalancerDeleteResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// loadBalancerDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [LoadBalancerDeleteResponseEnvelopeErrors]
+type loadBalancerDeleteResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LoadBalancerDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r loadBalancerDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type LoadBalancerDeleteResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON loadBalancerDeleteResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// loadBalancerDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for
+// the struct [LoadBalancerDeleteResponseEnvelopeMessages]
+type loadBalancerDeleteResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LoadBalancerDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r loadBalancerDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type LoadBalancerDeleteResponseEnvelopeSuccess bool
+
+const (
+ LoadBalancerDeleteResponseEnvelopeSuccessTrue LoadBalancerDeleteResponseEnvelopeSuccess = true
+)
+
+type LoadBalancerEditParams struct {
+ ZoneID param.Field[string] `path:"zone_id,required"`
+ // Controls features that modify the routing of requests to pools and origins in
+ // response to dynamic conditions, such as during the interval between active
+ // health monitoring requests. For example, zero-downtime failover occurs
+ // immediately when an origin becomes unavailable due to HTTP 521, 522, or 523
+ // response codes. If there is another healthy origin in the same pool, the request
+ // is retried once against this alternate origin.
+ AdaptiveRouting param.Field[LoadBalancerEditParamsAdaptiveRouting] `json:"adaptive_routing"`
+ // A mapping of country codes to a list of pool IDs (ordered by their failover
+ // priority) for the given country. Any country not explicitly defined will fall
+ // back to using the corresponding region_pool mapping if it exists else to
+ // default_pools.
+ CountryPools param.Field[interface{}] `json:"country_pools"`
+ // A list of pool IDs ordered by their failover priority. Pools defined here are
+ // used by default, or when region_pools are not configured for a given region.
+ DefaultPools param.Field[[]string] `json:"default_pools"`
+ // Object description.
+ Description param.Field[string] `json:"description"`
+ // Whether to enable (the default) this load balancer.
+ Enabled param.Field[bool] `json:"enabled"`
+ // The pool ID to use when all other pools are detected as unhealthy.
+ FallbackPool param.Field[interface{}] `json:"fallback_pool"`
+ // Controls location-based steering for non-proxied requests. See `steering_policy`
+ // to learn how steering is affected.
+ LocationStrategy param.Field[LoadBalancerEditParamsLocationStrategy] `json:"location_strategy"`
+ // The DNS hostname to associate with your Load Balancer. If this hostname already
+ // exists as a DNS record in Cloudflare's DNS, the Load Balancer will take
+ // precedence and the DNS record will not be used.
+ Name param.Field[string] `json:"name"`
+ // (Enterprise only): A mapping of Cloudflare PoP identifiers to a list of pool IDs
+ // (ordered by their failover priority) for the PoP (datacenter). Any PoPs not
+ // explicitly defined will fall back to using the corresponding country_pool, then
+ // region_pool mapping if it exists else to default_pools.
+ PopPools param.Field[interface{}] `json:"pop_pools"`
+ // Whether the hostname should be gray clouded (false) or orange clouded (true).
+ Proxied param.Field[bool] `json:"proxied"`
+ // Configures pool weights.
+ //
+ // - `steering_policy="random"`: A random pool is selected with probability
+ // proportional to pool weights.
+ // - `steering_policy="least_outstanding_requests"`: Use pool weights to scale each
+ // pool's outstanding requests.
+ // - `steering_policy="least_connections"`: Use pool weights to scale each pool's
+ // open connections.
+ RandomSteering param.Field[LoadBalancerEditParamsRandomSteering] `json:"random_steering"`
+ // A mapping of region codes to a list of pool IDs (ordered by their failover
+ // priority) for the given region. Any regions not explicitly defined will fall
+ // back to using default_pools.
+ RegionPools param.Field[interface{}] `json:"region_pools"`
+ // BETA Field Not General Access: A list of rules for this load balancer to
+ // execute.
+ Rules param.Field[[]LoadBalancerEditParamsRule] `json:"rules"`
+ // Specifies the type of session affinity the load balancer should use unless
+ // specified as `"none"` or "" (default). The supported types are:
+ //
+ // - `"cookie"`: On the first request to a proxied load balancer, a cookie is
+ // generated, encoding information of which origin the request will be forwarded
+ // to. Subsequent requests, by the same client to the same load balancer, will be
+ // sent to the origin server the cookie encodes, for the duration of the cookie
+ // and as long as the origin server remains healthy. If the cookie has expired or
+ // the origin server is unhealthy, then a new origin server is calculated and
+ // used.
+ // - `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin
+ // selection is stable and based on the client's ip address.
+ // - `"header"`: On the first request to a proxied load balancer, a session key
+ // based on the configured HTTP headers (see
+ // `session_affinity_attributes.headers`) is generated, encoding the request
+ // headers used for storing in the load balancer session state which origin the
+ // request will be forwarded to. Subsequent requests to the load balancer with
+ // the same headers will be sent to the same origin server, for the duration of
+ // the session and as long as the origin server remains healthy. If the session
+ // has been idle for the duration of `session_affinity_ttl` seconds or the origin
+ // server is unhealthy, then a new origin server is calculated and used. See
+ // `headers` in `session_affinity_attributes` for additional required
+ // configuration.
+ SessionAffinity param.Field[LoadBalancerEditParamsSessionAffinity] `json:"session_affinity"`
+ // Configures attributes for session affinity.
+ SessionAffinityAttributes param.Field[LoadBalancerEditParamsSessionAffinityAttributes] `json:"session_affinity_attributes"`
+ // Time, in seconds, until a client's session expires after being created. Once the
+ // expiry time has been reached, subsequent requests may get sent to a different
+ // origin server. The accepted ranges per `session_affinity` policy are:
+ //
+ // - `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used
+ // unless explicitly set. The accepted range of values is between [1800, 604800].
+ // - `"header"`: The current default of 1800 seconds will be used unless explicitly
+ // set. The accepted range of values is between [30, 3600]. Note: With session
+ // affinity by header, sessions only expire after they haven't been used for the
+ // number of seconds specified.
+ SessionAffinityTTL param.Field[float64] `json:"session_affinity_ttl"`
+ // Steering Policy for this load balancer.
+ //
+ // - `"off"`: Use `default_pools`.
+ // - `"geo"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied
+ // requests, the country for `country_pools` is determined by
+ // `location_strategy`.
+ // - `"random"`: Select a pool randomly.
+ // - `"dynamic_latency"`: Use round trip time to select the closest pool in
+ // default_pools (requires pool health checks).
+ // - `"proximity"`: Use the pools' latitude and longitude to select the closest
+ // pool using the Cloudflare PoP location for proxied requests or the location
+ // determined by `location_strategy` for non-proxied requests.
+ // - `"least_outstanding_requests"`: Select a pool by taking into consideration
+ // `random_steering` weights, as well as each pool's number of outstanding
+ // requests. Pools with more pending requests are weighted proportionately less
+ // relative to others.
+ // - `"least_connections"`: Select a pool by taking into consideration
+ // `random_steering` weights, as well as each pool's number of open connections.
+ // Pools with more open connections are weighted proportionately less relative to
+ // others. Supported for HTTP/1 and HTTP/2 connections.
+ // - `""`: Will map to `"geo"` if you use
+ // `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.
+ SteeringPolicy param.Field[LoadBalancerEditParamsSteeringPolicy] `json:"steering_policy"`
+ // Time to live (TTL) of the DNS entry for the IP address returned by this load
+ // balancer. This only applies to gray-clouded (unproxied) load balancers.
+ TTL param.Field[float64] `json:"ttl"`
+}
+
+func (r LoadBalancerEditParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Controls features that modify the routing of requests to pools and origins in
+// response to dynamic conditions, such as during the interval between active
+// health monitoring requests. For example, zero-downtime failover occurs
+// immediately when an origin becomes unavailable due to HTTP 521, 522, or 523
+// response codes. If there is another healthy origin in the same pool, the request
+// is retried once against this alternate origin.
+type LoadBalancerEditParamsAdaptiveRouting struct {
+ // Extends zero-downtime failover of requests to healthy origins from alternate
+ // pools, when no healthy alternate exists in the same pool, according to the
+ // failover order defined by traffic and origin steering. When set false (the
+ // default) zero-downtime failover will only occur between origins within the same
+ // pool. See `session_affinity_attributes` for control over when sessions are
+ // broken or reassigned.
+ FailoverAcrossPools param.Field[bool] `json:"failover_across_pools"`
+}
+
+func (r LoadBalancerEditParamsAdaptiveRouting) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Controls location-based steering for non-proxied requests. See `steering_policy`
+// to learn how steering is affected.
+type LoadBalancerEditParamsLocationStrategy struct {
+ // Determines the authoritative location when ECS is not preferred, does not exist
+ // in the request, or its GeoIP lookup is unsuccessful.
+ //
+ // - `"pop"`: Use the Cloudflare PoP location.
+ // - `"resolver_ip"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is
+ // unsuccessful, use the Cloudflare PoP location.
+ Mode param.Field[LoadBalancerEditParamsLocationStrategyMode] `json:"mode"`
+ // Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the
+ // authoritative location.
+ //
+ // - `"always"`: Always prefer ECS.
+ // - `"never"`: Never prefer ECS.
+ // - `"proximity"`: Prefer ECS only when `steering_policy="proximity"`.
+ // - `"geo"`: Prefer ECS only when `steering_policy="geo"`.
+ PreferEcs param.Field[LoadBalancerEditParamsLocationStrategyPreferEcs] `json:"prefer_ecs"`
+}
+
+func (r LoadBalancerEditParamsLocationStrategy) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Determines the authoritative location when ECS is not preferred, does not exist
+// in the request, or its GeoIP lookup is unsuccessful.
+//
+// - `"pop"`: Use the Cloudflare PoP location.
+// - `"resolver_ip"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is
+// unsuccessful, use the Cloudflare PoP location.
+type LoadBalancerEditParamsLocationStrategyMode string
+
+const (
+ LoadBalancerEditParamsLocationStrategyModePop LoadBalancerEditParamsLocationStrategyMode = "pop"
+ LoadBalancerEditParamsLocationStrategyModeResolverIP LoadBalancerEditParamsLocationStrategyMode = "resolver_ip"
+)
+
+// Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the
+// authoritative location.
+//
+// - `"always"`: Always prefer ECS.
+// - `"never"`: Never prefer ECS.
+// - `"proximity"`: Prefer ECS only when `steering_policy="proximity"`.
+// - `"geo"`: Prefer ECS only when `steering_policy="geo"`.
+type LoadBalancerEditParamsLocationStrategyPreferEcs string
+
+const (
+ LoadBalancerEditParamsLocationStrategyPreferEcsAlways LoadBalancerEditParamsLocationStrategyPreferEcs = "always"
+ LoadBalancerEditParamsLocationStrategyPreferEcsNever LoadBalancerEditParamsLocationStrategyPreferEcs = "never"
+ LoadBalancerEditParamsLocationStrategyPreferEcsProximity LoadBalancerEditParamsLocationStrategyPreferEcs = "proximity"
+ LoadBalancerEditParamsLocationStrategyPreferEcsGeo LoadBalancerEditParamsLocationStrategyPreferEcs = "geo"
+)
+
+// Configures pool weights.
+//
+// - `steering_policy="random"`: A random pool is selected with probability
+// proportional to pool weights.
+// - `steering_policy="least_outstanding_requests"`: Use pool weights to scale each
+// pool's outstanding requests.
+// - `steering_policy="least_connections"`: Use pool weights to scale each pool's
+// open connections.
+type LoadBalancerEditParamsRandomSteering struct {
+ // The default weight for pools in the load balancer that are not specified in the
+ // pool_weights map.
+ DefaultWeight param.Field[float64] `json:"default_weight"`
+ // A mapping of pool IDs to custom weights. The weight is relative to other pools
+ // in the load balancer.
+ PoolWeights param.Field[interface{}] `json:"pool_weights"`
+}
+
+func (r LoadBalancerEditParamsRandomSteering) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// A rule object containing conditions and overrides for this load balancer to
+// evaluate.
+type LoadBalancerEditParamsRule struct {
+ // The condition expressions to evaluate. If the condition evaluates to true, the
+ // overrides or fixed_response in this rule will be applied. An empty condition is
+ // always true. For more details on condition expressions, please see
+ // https://developers.cloudflare.com/load-balancing/understand-basics/load-balancing-rules/expressions.
+ Condition param.Field[string] `json:"condition"`
+ // Disable this specific rule. It will no longer be evaluated by this load
+ // balancer.
+ Disabled param.Field[bool] `json:"disabled"`
+ // A collection of fields used to directly respond to the eyeball instead of
+ // routing to a pool. If a fixed_response is supplied the rule will be marked as
+ // terminates.
+ FixedResponse param.Field[LoadBalancerEditParamsRulesFixedResponse] `json:"fixed_response"`
+ // Name of this rule. Only used for human readability.
+ Name param.Field[string] `json:"name"`
+ // A collection of overrides to apply to the load balancer when this rule's
+ // condition is true. All fields are optional.
+ Overrides param.Field[LoadBalancerEditParamsRulesOverrides] `json:"overrides"`
+ // The order in which rules should be executed in relation to each other. Lower
+ // values are executed first. Values do not need to be sequential. If no value is
+ // provided for any rule the array order of the rules field will be used to assign
+ // a priority.
+ Priority param.Field[int64] `json:"priority"`
+ // If this rule's condition is true, this causes rule evaluation to stop after
+ // processing this rule.
+ Terminates param.Field[bool] `json:"terminates"`
+}
+
+func (r LoadBalancerEditParamsRule) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// A collection of fields used to directly respond to the eyeball instead of
+// routing to a pool. If a fixed_response is supplied the rule will be marked as
+// terminates.
+type LoadBalancerEditParamsRulesFixedResponse struct {
+ // The http 'Content-Type' header to include in the response.
+ ContentType param.Field[string] `json:"content_type"`
+ // The http 'Location' header to include in the response.
+ Location param.Field[string] `json:"location"`
+ // Text to include as the http body.
+ MessageBody param.Field[string] `json:"message_body"`
+ // The http status code to respond with.
+ StatusCode param.Field[int64] `json:"status_code"`
+}
+
+func (r LoadBalancerEditParamsRulesFixedResponse) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// A collection of overrides to apply to the load balancer when this rule's
+// condition is true. All fields are optional.
+type LoadBalancerEditParamsRulesOverrides struct {
+ // Controls features that modify the routing of requests to pools and origins in
+ // response to dynamic conditions, such as during the interval between active
+ // health monitoring requests. For example, zero-downtime failover occurs
+ // immediately when an origin becomes unavailable due to HTTP 521, 522, or 523
+ // response codes. If there is another healthy origin in the same pool, the request
+ // is retried once against this alternate origin.
+ AdaptiveRouting param.Field[LoadBalancerEditParamsRulesOverridesAdaptiveRouting] `json:"adaptive_routing"`
+ // A mapping of country codes to a list of pool IDs (ordered by their failover
+ // priority) for the given country. Any country not explicitly defined will fall
+ // back to using the corresponding region_pool mapping if it exists else to
+ // default_pools.
+ CountryPools param.Field[interface{}] `json:"country_pools"`
+ // A list of pool IDs ordered by their failover priority. Pools defined here are
+ // used by default, or when region_pools are not configured for a given region.
+ DefaultPools param.Field[[]string] `json:"default_pools"`
+ // The pool ID to use when all other pools are detected as unhealthy.
+ FallbackPool param.Field[interface{}] `json:"fallback_pool"`
+ // Controls location-based steering for non-proxied requests. See `steering_policy`
+ // to learn how steering is affected.
+ LocationStrategy param.Field[LoadBalancerEditParamsRulesOverridesLocationStrategy] `json:"location_strategy"`
+ // (Enterprise only): A mapping of Cloudflare PoP identifiers to a list of pool IDs
+ // (ordered by their failover priority) for the PoP (datacenter). Any PoPs not
+ // explicitly defined will fall back to using the corresponding country_pool, then
+ // region_pool mapping if it exists else to default_pools.
+ PopPools param.Field[interface{}] `json:"pop_pools"`
+ // Configures pool weights.
+ //
+ // - `steering_policy="random"`: A random pool is selected with probability
+ // proportional to pool weights.
+ // - `steering_policy="least_outstanding_requests"`: Use pool weights to scale each
+ // pool's outstanding requests.
+ // - `steering_policy="least_connections"`: Use pool weights to scale each pool's
+ // open connections.
+ RandomSteering param.Field[LoadBalancerEditParamsRulesOverridesRandomSteering] `json:"random_steering"`
+ // A mapping of region codes to a list of pool IDs (ordered by their failover
+ // priority) for the given region. Any regions not explicitly defined will fall
+ // back to using default_pools.
+ RegionPools param.Field[interface{}] `json:"region_pools"`
+ // Specifies the type of session affinity the load balancer should use unless
+ // specified as `"none"` or "" (default). The supported types are:
+ //
+ // - `"cookie"`: On the first request to a proxied load balancer, a cookie is
+ // generated, encoding information of which origin the request will be forwarded
+ // to. Subsequent requests, by the same client to the same load balancer, will be
+ // sent to the origin server the cookie encodes, for the duration of the cookie
+ // and as long as the origin server remains healthy. If the cookie has expired or
+ // the origin server is unhealthy, then a new origin server is calculated and
+ // used.
+ // - `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin
+ // selection is stable and based on the client's ip address.
+ // - `"header"`: On the first request to a proxied load balancer, a session key
+ // based on the configured HTTP headers (see
+ // `session_affinity_attributes.headers`) is generated, encoding the request
+ // headers used for storing in the load balancer session state which origin the
+ // request will be forwarded to. Subsequent requests to the load balancer with
+ // the same headers will be sent to the same origin server, for the duration of
+ // the session and as long as the origin server remains healthy. If the session
+ // has been idle for the duration of `session_affinity_ttl` seconds or the origin
+ // server is unhealthy, then a new origin server is calculated and used. See
+ // `headers` in `session_affinity_attributes` for additional required
+ // configuration.
+ SessionAffinity param.Field[LoadBalancerEditParamsRulesOverridesSessionAffinity] `json:"session_affinity"`
+ // Configures attributes for session affinity.
+ SessionAffinityAttributes param.Field[LoadBalancerEditParamsRulesOverridesSessionAffinityAttributes] `json:"session_affinity_attributes"`
+ // Time, in seconds, until a client's session expires after being created. Once the
+ // expiry time has been reached, subsequent requests may get sent to a different
+ // origin server. The accepted ranges per `session_affinity` policy are:
+ //
+ // - `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used
+ // unless explicitly set. The accepted range of values is between [1800, 604800].
+ // - `"header"`: The current default of 1800 seconds will be used unless explicitly
+ // set. The accepted range of values is between [30, 3600]. Note: With session
+ // affinity by header, sessions only expire after they haven't been used for the
+ // number of seconds specified.
+ SessionAffinityTTL param.Field[float64] `json:"session_affinity_ttl"`
+ // Steering Policy for this load balancer.
+ //
+ // - `"off"`: Use `default_pools`.
+ // - `"geo"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied
+ // requests, the country for `country_pools` is determined by
+ // `location_strategy`.
+ // - `"random"`: Select a pool randomly.
+ // - `"dynamic_latency"`: Use round trip time to select the closest pool in
+ // default_pools (requires pool health checks).
+ // - `"proximity"`: Use the pools' latitude and longitude to select the closest
+ // pool using the Cloudflare PoP location for proxied requests or the location
+ // determined by `location_strategy` for non-proxied requests.
+ // - `"least_outstanding_requests"`: Select a pool by taking into consideration
+ // `random_steering` weights, as well as each pool's number of outstanding
+ // requests. Pools with more pending requests are weighted proportionately less
+ // relative to others.
+ // - `"least_connections"`: Select a pool by taking into consideration
+ // `random_steering` weights, as well as each pool's number of open connections.
+ // Pools with more open connections are weighted proportionately less relative to
+ // others. Supported for HTTP/1 and HTTP/2 connections.
+ // - `""`: Will map to `"geo"` if you use
+ // `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.
+ SteeringPolicy param.Field[LoadBalancerEditParamsRulesOverridesSteeringPolicy] `json:"steering_policy"`
+ // Time to live (TTL) of the DNS entry for the IP address returned by this load
+ // balancer. This only applies to gray-clouded (unproxied) load balancers.
+ TTL param.Field[float64] `json:"ttl"`
+}
+
+func (r LoadBalancerEditParamsRulesOverrides) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Controls features that modify the routing of requests to pools and origins in
+// response to dynamic conditions, such as during the interval between active
+// health monitoring requests. For example, zero-downtime failover occurs
+// immediately when an origin becomes unavailable due to HTTP 521, 522, or 523
+// response codes. If there is another healthy origin in the same pool, the request
+// is retried once against this alternate origin.
+type LoadBalancerEditParamsRulesOverridesAdaptiveRouting struct {
+ // Extends zero-downtime failover of requests to healthy origins from alternate
+ // pools, when no healthy alternate exists in the same pool, according to the
+ // failover order defined by traffic and origin steering. When set false (the
+ // default) zero-downtime failover will only occur between origins within the same
+ // pool. See `session_affinity_attributes` for control over when sessions are
+ // broken or reassigned.
+ FailoverAcrossPools param.Field[bool] `json:"failover_across_pools"`
+}
+
+func (r LoadBalancerEditParamsRulesOverridesAdaptiveRouting) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Controls location-based steering for non-proxied requests. See `steering_policy`
+// to learn how steering is affected.
+type LoadBalancerEditParamsRulesOverridesLocationStrategy struct {
+ // Determines the authoritative location when ECS is not preferred, does not exist
+ // in the request, or its GeoIP lookup is unsuccessful.
+ //
+ // - `"pop"`: Use the Cloudflare PoP location.
+ // - `"resolver_ip"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is
+ // unsuccessful, use the Cloudflare PoP location.
+ Mode param.Field[LoadBalancerEditParamsRulesOverridesLocationStrategyMode] `json:"mode"`
+ // Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the
+ // authoritative location.
+ //
+ // - `"always"`: Always prefer ECS.
+ // - `"never"`: Never prefer ECS.
+ // - `"proximity"`: Prefer ECS only when `steering_policy="proximity"`.
+ // - `"geo"`: Prefer ECS only when `steering_policy="geo"`.
+ PreferEcs param.Field[LoadBalancerEditParamsRulesOverridesLocationStrategyPreferEcs] `json:"prefer_ecs"`
+}
+
+func (r LoadBalancerEditParamsRulesOverridesLocationStrategy) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Determines the authoritative location when ECS is not preferred, does not exist
+// in the request, or its GeoIP lookup is unsuccessful.
+//
+// - `"pop"`: Use the Cloudflare PoP location.
+// - `"resolver_ip"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is
+// unsuccessful, use the Cloudflare PoP location.
+type LoadBalancerEditParamsRulesOverridesLocationStrategyMode string
+
+const (
+ LoadBalancerEditParamsRulesOverridesLocationStrategyModePop LoadBalancerEditParamsRulesOverridesLocationStrategyMode = "pop"
+ LoadBalancerEditParamsRulesOverridesLocationStrategyModeResolverIP LoadBalancerEditParamsRulesOverridesLocationStrategyMode = "resolver_ip"
+)
+
+// Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the
+// authoritative location.
+//
+// - `"always"`: Always prefer ECS.
+// - `"never"`: Never prefer ECS.
+// - `"proximity"`: Prefer ECS only when `steering_policy="proximity"`.
+// - `"geo"`: Prefer ECS only when `steering_policy="geo"`.
+type LoadBalancerEditParamsRulesOverridesLocationStrategyPreferEcs string
+
+const (
+ LoadBalancerEditParamsRulesOverridesLocationStrategyPreferEcsAlways LoadBalancerEditParamsRulesOverridesLocationStrategyPreferEcs = "always"
+ LoadBalancerEditParamsRulesOverridesLocationStrategyPreferEcsNever LoadBalancerEditParamsRulesOverridesLocationStrategyPreferEcs = "never"
+ LoadBalancerEditParamsRulesOverridesLocationStrategyPreferEcsProximity LoadBalancerEditParamsRulesOverridesLocationStrategyPreferEcs = "proximity"
+ LoadBalancerEditParamsRulesOverridesLocationStrategyPreferEcsGeo LoadBalancerEditParamsRulesOverridesLocationStrategyPreferEcs = "geo"
+)
+
+// Configures pool weights.
+//
+// - `steering_policy="random"`: A random pool is selected with probability
+// proportional to pool weights.
+// - `steering_policy="least_outstanding_requests"`: Use pool weights to scale each
+// pool's outstanding requests.
+// - `steering_policy="least_connections"`: Use pool weights to scale each pool's
+// open connections.
+type LoadBalancerEditParamsRulesOverridesRandomSteering struct {
+ // The default weight for pools in the load balancer that are not specified in the
+ // pool_weights map.
+ DefaultWeight param.Field[float64] `json:"default_weight"`
+ // A mapping of pool IDs to custom weights. The weight is relative to other pools
+ // in the load balancer.
+ PoolWeights param.Field[interface{}] `json:"pool_weights"`
+}
+
+func (r LoadBalancerEditParamsRulesOverridesRandomSteering) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Specifies the type of session affinity the load balancer should use unless
+// specified as `"none"` or "" (default). The supported types are:
+//
+// - `"cookie"`: On the first request to a proxied load balancer, a cookie is
+// generated, encoding information of which origin the request will be forwarded
+// to. Subsequent requests, by the same client to the same load balancer, will be
+// sent to the origin server the cookie encodes, for the duration of the cookie
+// and as long as the origin server remains healthy. If the cookie has expired or
+// the origin server is unhealthy, then a new origin server is calculated and
+// used.
+// - `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin
+// selection is stable and based on the client's ip address.
+// - `"header"`: On the first request to a proxied load balancer, a session key
+// based on the configured HTTP headers (see
+// `session_affinity_attributes.headers`) is generated, encoding the request
+// headers used for storing in the load balancer session state which origin the
+// request will be forwarded to. Subsequent requests to the load balancer with
+// the same headers will be sent to the same origin server, for the duration of
+// the session and as long as the origin server remains healthy. If the session
+// has been idle for the duration of `session_affinity_ttl` seconds or the origin
+// server is unhealthy, then a new origin server is calculated and used. See
+// `headers` in `session_affinity_attributes` for additional required
+// configuration.
+type LoadBalancerEditParamsRulesOverridesSessionAffinity string
+
+const (
+ LoadBalancerEditParamsRulesOverridesSessionAffinityNone LoadBalancerEditParamsRulesOverridesSessionAffinity = "none"
+ LoadBalancerEditParamsRulesOverridesSessionAffinityCookie LoadBalancerEditParamsRulesOverridesSessionAffinity = "cookie"
+ LoadBalancerEditParamsRulesOverridesSessionAffinityIPCookie LoadBalancerEditParamsRulesOverridesSessionAffinity = "ip_cookie"
+ LoadBalancerEditParamsRulesOverridesSessionAffinityHeader LoadBalancerEditParamsRulesOverridesSessionAffinity = "header"
+ LoadBalancerEditParamsRulesOverridesSessionAffinityEmpty LoadBalancerEditParamsRulesOverridesSessionAffinity = "\"\""
+)
+
+// Configures attributes for session affinity.
+type LoadBalancerEditParamsRulesOverridesSessionAffinityAttributes struct {
+ // Configures the drain duration in seconds. This field is only used when session
+ // affinity is enabled on the load balancer.
+ DrainDuration param.Field[float64] `json:"drain_duration"`
+ // Configures the names of HTTP headers to base session affinity on when header
+ // `session_affinity` is enabled. At least one HTTP header name must be provided.
+ // To specify the exact cookies to be used, include an item in the following
+ // format: `"cookie:,"` (example) where everything
+ // after the colon is a comma-separated list of cookie names. Providing only
+ // `"cookie"` will result in all cookies being used. The default max number of HTTP
+ // header names that can be provided depends on your plan: 5 for Enterprise, 1 for
+ // all other plans.
+ Headers param.Field[[]string] `json:"headers"`
+ // When header `session_affinity` is enabled, this option can be used to specify
+ // how HTTP headers on load balancing requests will be used. The supported values
+ // are:
+ //
+ // - `"true"`: Load balancing requests must contain _all_ of the HTTP headers
+ // specified by the `headers` session affinity attribute, otherwise sessions
+ // aren't created.
+ // - `"false"`: Load balancing requests must contain _at least one_ of the HTTP
+ // headers specified by the `headers` session affinity attribute, otherwise
+ // sessions aren't created.
+ RequireAllHeaders param.Field[bool] `json:"require_all_headers"`
+ // Configures the SameSite attribute on session affinity cookie. Value "Auto" will
+ // be translated to "Lax" or "None" depending if Always Use HTTPS is enabled. Note:
+ // when using value "None", the secure attribute can not be set to "Never".
+ Samesite param.Field[LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesSamesite] `json:"samesite"`
+ // Configures the Secure attribute on session affinity cookie. Value "Always"
+ // indicates the Secure attribute will be set in the Set-Cookie header, "Never"
+ // indicates the Secure attribute will not be set, and "Auto" will set the Secure
+ // attribute depending if Always Use HTTPS is enabled.
+ Secure param.Field[LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesSecure] `json:"secure"`
+ // Configures the zero-downtime failover between origins within a pool when session
+ // affinity is enabled. This feature is currently incompatible with Argo, Tiered
+ // Cache, and Bandwidth Alliance. The supported values are:
+ //
+ // - `"none"`: No failover takes place for sessions pinned to the origin (default).
+ // - `"temporary"`: Traffic will be sent to another other healthy origin until the
+ // originally pinned origin is available; note that this can potentially result
+ // in heavy origin flapping.
+ // - `"sticky"`: The session affinity cookie is updated and subsequent requests are
+ // sent to the new origin. Note: Zero-downtime failover with sticky sessions is
+ // currently not supported for session affinity by header.
+ ZeroDowntimeFailover param.Field[LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailover] `json:"zero_downtime_failover"`
+}
+
+func (r LoadBalancerEditParamsRulesOverridesSessionAffinityAttributes) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Configures the SameSite attribute on session affinity cookie. Value "Auto" will
+// be translated to "Lax" or "None" depending if Always Use HTTPS is enabled. Note:
+// when using value "None", the secure attribute can not be set to "Never".
+type LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesSamesite string
+
+const (
+ LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesSamesiteAuto LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesSamesite = "Auto"
+ LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesSamesiteLax LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesSamesite = "Lax"
+ LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesSamesiteNone LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesSamesite = "None"
+ LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesSamesiteStrict LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesSamesite = "Strict"
+)
+
+// Configures the Secure attribute on session affinity cookie. Value "Always"
+// indicates the Secure attribute will be set in the Set-Cookie header, "Never"
+// indicates the Secure attribute will not be set, and "Auto" will set the Secure
+// attribute depending if Always Use HTTPS is enabled.
+type LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesSecure string
+
+const (
+ LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesSecureAuto LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesSecure = "Auto"
+ LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesSecureAlways LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesSecure = "Always"
+ LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesSecureNever LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesSecure = "Never"
+)
+
+// Configures the zero-downtime failover between origins within a pool when session
+// affinity is enabled. This feature is currently incompatible with Argo, Tiered
+// Cache, and Bandwidth Alliance. The supported values are:
+//
+// - `"none"`: No failover takes place for sessions pinned to the origin (default).
+// - `"temporary"`: Traffic will be sent to another other healthy origin until the
+// originally pinned origin is available; note that this can potentially result
+// in heavy origin flapping.
+// - `"sticky"`: The session affinity cookie is updated and subsequent requests are
+// sent to the new origin. Note: Zero-downtime failover with sticky sessions is
+// currently not supported for session affinity by header.
+type LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailover string
+
+const (
+ LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailoverNone LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailover = "none"
+ LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailoverTemporary LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailover = "temporary"
+ LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailoverSticky LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailover = "sticky"
+)
+
+// Steering Policy for this load balancer.
+//
+// - `"off"`: Use `default_pools`.
+// - `"geo"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied
+// requests, the country for `country_pools` is determined by
+// `location_strategy`.
+// - `"random"`: Select a pool randomly.
+// - `"dynamic_latency"`: Use round trip time to select the closest pool in
+// default_pools (requires pool health checks).
+// - `"proximity"`: Use the pools' latitude and longitude to select the closest
+// pool using the Cloudflare PoP location for proxied requests or the location
+// determined by `location_strategy` for non-proxied requests.
+// - `"least_outstanding_requests"`: Select a pool by taking into consideration
+// `random_steering` weights, as well as each pool's number of outstanding
+// requests. Pools with more pending requests are weighted proportionately less
+// relative to others.
+// - `"least_connections"`: Select a pool by taking into consideration
+// `random_steering` weights, as well as each pool's number of open connections.
+// Pools with more open connections are weighted proportionately less relative to
+// others. Supported for HTTP/1 and HTTP/2 connections.
+// - `""`: Will map to `"geo"` if you use
+// `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.
+type LoadBalancerEditParamsRulesOverridesSteeringPolicy string
+
+const (
+ LoadBalancerEditParamsRulesOverridesSteeringPolicyOff LoadBalancerEditParamsRulesOverridesSteeringPolicy = "off"
+ LoadBalancerEditParamsRulesOverridesSteeringPolicyGeo LoadBalancerEditParamsRulesOverridesSteeringPolicy = "geo"
+ LoadBalancerEditParamsRulesOverridesSteeringPolicyRandom LoadBalancerEditParamsRulesOverridesSteeringPolicy = "random"
+ LoadBalancerEditParamsRulesOverridesSteeringPolicyDynamicLatency LoadBalancerEditParamsRulesOverridesSteeringPolicy = "dynamic_latency"
+ LoadBalancerEditParamsRulesOverridesSteeringPolicyProximity LoadBalancerEditParamsRulesOverridesSteeringPolicy = "proximity"
+ LoadBalancerEditParamsRulesOverridesSteeringPolicyLeastOutstandingRequests LoadBalancerEditParamsRulesOverridesSteeringPolicy = "least_outstanding_requests"
+ LoadBalancerEditParamsRulesOverridesSteeringPolicyLeastConnections LoadBalancerEditParamsRulesOverridesSteeringPolicy = "least_connections"
+ LoadBalancerEditParamsRulesOverridesSteeringPolicyEmpty LoadBalancerEditParamsRulesOverridesSteeringPolicy = "\"\""
+)
+
+// Specifies the type of session affinity the load balancer should use unless
+// specified as `"none"` or "" (default). The supported types are:
+//
+// - `"cookie"`: On the first request to a proxied load balancer, a cookie is
+// generated, encoding information of which origin the request will be forwarded
+// to. Subsequent requests, by the same client to the same load balancer, will be
+// sent to the origin server the cookie encodes, for the duration of the cookie
+// and as long as the origin server remains healthy. If the cookie has expired or
+// the origin server is unhealthy, then a new origin server is calculated and
+// used.
+// - `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin
+// selection is stable and based on the client's ip address.
+// - `"header"`: On the first request to a proxied load balancer, a session key
+// based on the configured HTTP headers (see
+// `session_affinity_attributes.headers`) is generated, encoding the request
+// headers used for storing in the load balancer session state which origin the
+// request will be forwarded to. Subsequent requests to the load balancer with
+// the same headers will be sent to the same origin server, for the duration of
+// the session and as long as the origin server remains healthy. If the session
+// has been idle for the duration of `session_affinity_ttl` seconds or the origin
+// server is unhealthy, then a new origin server is calculated and used. See
+// `headers` in `session_affinity_attributes` for additional required
+// configuration.
+type LoadBalancerEditParamsSessionAffinity string
+
+const (
+ LoadBalancerEditParamsSessionAffinityNone LoadBalancerEditParamsSessionAffinity = "none"
+ LoadBalancerEditParamsSessionAffinityCookie LoadBalancerEditParamsSessionAffinity = "cookie"
+ LoadBalancerEditParamsSessionAffinityIPCookie LoadBalancerEditParamsSessionAffinity = "ip_cookie"
+ LoadBalancerEditParamsSessionAffinityHeader LoadBalancerEditParamsSessionAffinity = "header"
+ LoadBalancerEditParamsSessionAffinityEmpty LoadBalancerEditParamsSessionAffinity = "\"\""
+)
+
+// Configures attributes for session affinity.
+type LoadBalancerEditParamsSessionAffinityAttributes struct {
+ // Configures the drain duration in seconds. This field is only used when session
+ // affinity is enabled on the load balancer.
+ DrainDuration param.Field[float64] `json:"drain_duration"`
+ // Configures the names of HTTP headers to base session affinity on when header
+ // `session_affinity` is enabled. At least one HTTP header name must be provided.
+ // To specify the exact cookies to be used, include an item in the following
+ // format: `"cookie:,"` (example) where everything
+ // after the colon is a comma-separated list of cookie names. Providing only
+ // `"cookie"` will result in all cookies being used. The default max number of HTTP
+ // header names that can be provided depends on your plan: 5 for Enterprise, 1 for
+ // all other plans.
+ Headers param.Field[[]string] `json:"headers"`
+ // When header `session_affinity` is enabled, this option can be used to specify
+ // how HTTP headers on load balancing requests will be used. The supported values
+ // are:
+ //
+ // - `"true"`: Load balancing requests must contain _all_ of the HTTP headers
+ // specified by the `headers` session affinity attribute, otherwise sessions
+ // aren't created.
+ // - `"false"`: Load balancing requests must contain _at least one_ of the HTTP
+ // headers specified by the `headers` session affinity attribute, otherwise
+ // sessions aren't created.
+ RequireAllHeaders param.Field[bool] `json:"require_all_headers"`
+ // Configures the SameSite attribute on session affinity cookie. Value "Auto" will
+ // be translated to "Lax" or "None" depending if Always Use HTTPS is enabled. Note:
+ // when using value "None", the secure attribute can not be set to "Never".
+ Samesite param.Field[LoadBalancerEditParamsSessionAffinityAttributesSamesite] `json:"samesite"`
+ // Configures the Secure attribute on session affinity cookie. Value "Always"
+ // indicates the Secure attribute will be set in the Set-Cookie header, "Never"
+ // indicates the Secure attribute will not be set, and "Auto" will set the Secure
+ // attribute depending if Always Use HTTPS is enabled.
+ Secure param.Field[LoadBalancerEditParamsSessionAffinityAttributesSecure] `json:"secure"`
+ // Configures the zero-downtime failover between origins within a pool when session
+ // affinity is enabled. This feature is currently incompatible with Argo, Tiered
+ // Cache, and Bandwidth Alliance. The supported values are:
+ //
+ // - `"none"`: No failover takes place for sessions pinned to the origin (default).
+ // - `"temporary"`: Traffic will be sent to another other healthy origin until the
+ // originally pinned origin is available; note that this can potentially result
+ // in heavy origin flapping.
+ // - `"sticky"`: The session affinity cookie is updated and subsequent requests are
+ // sent to the new origin. Note: Zero-downtime failover with sticky sessions is
+ // currently not supported for session affinity by header.
+ ZeroDowntimeFailover param.Field[LoadBalancerEditParamsSessionAffinityAttributesZeroDowntimeFailover] `json:"zero_downtime_failover"`
+}
+
+func (r LoadBalancerEditParamsSessionAffinityAttributes) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Configures the SameSite attribute on session affinity cookie. Value "Auto" will
+// be translated to "Lax" or "None" depending if Always Use HTTPS is enabled. Note:
+// when using value "None", the secure attribute can not be set to "Never".
+type LoadBalancerEditParamsSessionAffinityAttributesSamesite string
+
+const (
+ LoadBalancerEditParamsSessionAffinityAttributesSamesiteAuto LoadBalancerEditParamsSessionAffinityAttributesSamesite = "Auto"
+ LoadBalancerEditParamsSessionAffinityAttributesSamesiteLax LoadBalancerEditParamsSessionAffinityAttributesSamesite = "Lax"
+ LoadBalancerEditParamsSessionAffinityAttributesSamesiteNone LoadBalancerEditParamsSessionAffinityAttributesSamesite = "None"
+ LoadBalancerEditParamsSessionAffinityAttributesSamesiteStrict LoadBalancerEditParamsSessionAffinityAttributesSamesite = "Strict"
+)
+
+// Configures the Secure attribute on session affinity cookie. Value "Always"
+// indicates the Secure attribute will be set in the Set-Cookie header, "Never"
+// indicates the Secure attribute will not be set, and "Auto" will set the Secure
+// attribute depending if Always Use HTTPS is enabled.
+type LoadBalancerEditParamsSessionAffinityAttributesSecure string
+
+const (
+ LoadBalancerEditParamsSessionAffinityAttributesSecureAuto LoadBalancerEditParamsSessionAffinityAttributesSecure = "Auto"
+ LoadBalancerEditParamsSessionAffinityAttributesSecureAlways LoadBalancerEditParamsSessionAffinityAttributesSecure = "Always"
+ LoadBalancerEditParamsSessionAffinityAttributesSecureNever LoadBalancerEditParamsSessionAffinityAttributesSecure = "Never"
+)
+
+// Configures the zero-downtime failover between origins within a pool when session
+// affinity is enabled. This feature is currently incompatible with Argo, Tiered
+// Cache, and Bandwidth Alliance. The supported values are:
+//
+// - `"none"`: No failover takes place for sessions pinned to the origin (default).
+// - `"temporary"`: Traffic will be sent to another other healthy origin until the
+// originally pinned origin is available; note that this can potentially result
+// in heavy origin flapping.
+// - `"sticky"`: The session affinity cookie is updated and subsequent requests are
+// sent to the new origin. Note: Zero-downtime failover with sticky sessions is
+// currently not supported for session affinity by header.
+type LoadBalancerEditParamsSessionAffinityAttributesZeroDowntimeFailover string
+
+const (
+ LoadBalancerEditParamsSessionAffinityAttributesZeroDowntimeFailoverNone LoadBalancerEditParamsSessionAffinityAttributesZeroDowntimeFailover = "none"
+ LoadBalancerEditParamsSessionAffinityAttributesZeroDowntimeFailoverTemporary LoadBalancerEditParamsSessionAffinityAttributesZeroDowntimeFailover = "temporary"
+ LoadBalancerEditParamsSessionAffinityAttributesZeroDowntimeFailoverSticky LoadBalancerEditParamsSessionAffinityAttributesZeroDowntimeFailover = "sticky"
+)
+
+// Steering Policy for this load balancer.
+//
+// - `"off"`: Use `default_pools`.
+// - `"geo"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied
+// requests, the country for `country_pools` is determined by
+// `location_strategy`.
+// - `"random"`: Select a pool randomly.
+// - `"dynamic_latency"`: Use round trip time to select the closest pool in
+// default_pools (requires pool health checks).
+// - `"proximity"`: Use the pools' latitude and longitude to select the closest
+// pool using the Cloudflare PoP location for proxied requests or the location
+// determined by `location_strategy` for non-proxied requests.
+// - `"least_outstanding_requests"`: Select a pool by taking into consideration
+// `random_steering` weights, as well as each pool's number of outstanding
+// requests. Pools with more pending requests are weighted proportionately less
+// relative to others.
+// - `"least_connections"`: Select a pool by taking into consideration
+// `random_steering` weights, as well as each pool's number of open connections.
+// Pools with more open connections are weighted proportionately less relative to
+// others. Supported for HTTP/1 and HTTP/2 connections.
+// - `""`: Will map to `"geo"` if you use
+// `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.
+type LoadBalancerEditParamsSteeringPolicy string
+
+const (
+ LoadBalancerEditParamsSteeringPolicyOff LoadBalancerEditParamsSteeringPolicy = "off"
+ LoadBalancerEditParamsSteeringPolicyGeo LoadBalancerEditParamsSteeringPolicy = "geo"
+ LoadBalancerEditParamsSteeringPolicyRandom LoadBalancerEditParamsSteeringPolicy = "random"
+ LoadBalancerEditParamsSteeringPolicyDynamicLatency LoadBalancerEditParamsSteeringPolicy = "dynamic_latency"
+ LoadBalancerEditParamsSteeringPolicyProximity LoadBalancerEditParamsSteeringPolicy = "proximity"
+ LoadBalancerEditParamsSteeringPolicyLeastOutstandingRequests LoadBalancerEditParamsSteeringPolicy = "least_outstanding_requests"
+ LoadBalancerEditParamsSteeringPolicyLeastConnections LoadBalancerEditParamsSteeringPolicy = "least_connections"
+ LoadBalancerEditParamsSteeringPolicyEmpty LoadBalancerEditParamsSteeringPolicy = "\"\""
+)
+
+type LoadBalancerEditResponseEnvelope struct {
+ Errors []LoadBalancerEditResponseEnvelopeErrors `json:"errors,required"`
+ Messages []LoadBalancerEditResponseEnvelopeMessages `json:"messages,required"`
+ Result LoadBalancer `json:"result,required"`
+ // Whether the API call was successful
+ Success LoadBalancerEditResponseEnvelopeSuccess `json:"success,required"`
+ JSON loadBalancerEditResponseEnvelopeJSON `json:"-"`
+}
+
+// loadBalancerEditResponseEnvelopeJSON contains the JSON metadata for the struct
+// [LoadBalancerEditResponseEnvelope]
+type loadBalancerEditResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LoadBalancerEditResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r loadBalancerEditResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type LoadBalancerEditResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON loadBalancerEditResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// loadBalancerEditResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [LoadBalancerEditResponseEnvelopeErrors]
+type loadBalancerEditResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LoadBalancerEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r loadBalancerEditResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type LoadBalancerEditResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON loadBalancerEditResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// loadBalancerEditResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [LoadBalancerEditResponseEnvelopeMessages]
+type loadBalancerEditResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LoadBalancerEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r loadBalancerEditResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type LoadBalancerEditResponseEnvelopeSuccess bool
+
+const (
+ LoadBalancerEditResponseEnvelopeSuccessTrue LoadBalancerEditResponseEnvelopeSuccess = true
+)
+
+type LoadBalancerGetParams struct {
+ ZoneID param.Field[string] `path:"zone_id,required"`
+}
+
+type LoadBalancerGetResponseEnvelope struct {
+ Errors []LoadBalancerGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []LoadBalancerGetResponseEnvelopeMessages `json:"messages,required"`
+ Result LoadBalancer `json:"result,required"`
+ // Whether the API call was successful
+ Success LoadBalancerGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON loadBalancerGetResponseEnvelopeJSON `json:"-"`
+}
+
+// loadBalancerGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [LoadBalancerGetResponseEnvelope]
+type loadBalancerGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LoadBalancerGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r loadBalancerGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type LoadBalancerGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON loadBalancerGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// loadBalancerGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [LoadBalancerGetResponseEnvelopeErrors]
+type loadBalancerGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LoadBalancerGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r loadBalancerGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type LoadBalancerGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON loadBalancerGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// loadBalancerGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [LoadBalancerGetResponseEnvelopeMessages]
+type loadBalancerGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LoadBalancerGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r loadBalancerGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type LoadBalancerGetResponseEnvelopeSuccess bool
+
+const (
+ LoadBalancerGetResponseEnvelopeSuccessTrue LoadBalancerGetResponseEnvelopeSuccess = true
+)
diff --git a/load_balancers/loadbalancer_test.go b/load_balancers/loadbalancer_test.go
new file mode 100644
index 00000000000..32765d3d614
--- /dev/null
+++ b/load_balancers/loadbalancer_test.go
@@ -0,0 +1,1035 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package load_balancers_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/load_balancers"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestLoadBalancerNewWithOptionalParams(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"),
+ )
+ _, err := client.LoadBalancers.New(context.TODO(), load_balancers.LoadBalancerNewParams{
+ ZoneID: cloudflare.F("699d98642c564d2e855e9661899b7252"),
+ DefaultPools: cloudflare.F([]string{"17b5962d775c646f3f9725cbc7a53df4", "9290f38c5d07c2e2f4df57b1f61d4196", "00920f38ce07c2e2f4df50b1f61d4194"}),
+ FallbackPool: cloudflare.F[any](map[string]interface{}{}),
+ Name: cloudflare.F("www.example.com"),
+ AdaptiveRouting: cloudflare.F(load_balancers.LoadBalancerNewParamsAdaptiveRouting{
+ FailoverAcrossPools: cloudflare.F(true),
+ }),
+ CountryPools: cloudflare.F[any](map[string]interface{}{
+ "GB": map[string]interface{}{
+ "0": "abd90f38ced07c2e2f4df50b1f61d4194",
+ },
+ "US": map[string]interface{}{
+ "0": "de90f38ced07c2e2f4df50b1f61d4194",
+ "1": "00920f38ce07c2e2f4df50b1f61d4194",
+ },
+ }),
+ Description: cloudflare.F("Load Balancer for www.example.com"),
+ LocationStrategy: cloudflare.F(load_balancers.LoadBalancerNewParamsLocationStrategy{
+ Mode: cloudflare.F(load_balancers.LoadBalancerNewParamsLocationStrategyModeResolverIP),
+ PreferEcs: cloudflare.F(load_balancers.LoadBalancerNewParamsLocationStrategyPreferEcsAlways),
+ }),
+ PopPools: cloudflare.F[any](map[string]interface{}{
+ "LAX": map[string]interface{}{
+ "0": "de90f38ced07c2e2f4df50b1f61d4194",
+ "1": "9290f38c5d07c2e2f4df57b1f61d4196",
+ },
+ "LHR": map[string]interface{}{
+ "0": "abd90f38ced07c2e2f4df50b1f61d4194",
+ "1": "f9138c5d07c2e2f4df57b1f61d4196",
+ },
+ "SJC": map[string]interface{}{
+ "0": "00920f38ce07c2e2f4df50b1f61d4194",
+ },
+ }),
+ Proxied: cloudflare.F(true),
+ RandomSteering: cloudflare.F(load_balancers.LoadBalancerNewParamsRandomSteering{
+ DefaultWeight: cloudflare.F(0.200000),
+ PoolWeights: cloudflare.F[any](map[string]interface{}{
+ "9290f38c5d07c2e2f4df57b1f61d4196": 0.500000,
+ "de90f38ced07c2e2f4df50b1f61d4194": 0.300000,
+ }),
+ }),
+ RegionPools: cloudflare.F[any](map[string]interface{}{
+ "ENAM": map[string]interface{}{
+ "0": "00920f38ce07c2e2f4df50b1f61d4194",
+ },
+ "WNAM": map[string]interface{}{
+ "0": "de90f38ced07c2e2f4df50b1f61d4194",
+ "1": "9290f38c5d07c2e2f4df57b1f61d4196",
+ },
+ }),
+ Rules: cloudflare.F([]load_balancers.LoadBalancerNewParamsRule{{
+ Condition: cloudflare.F("http.request.uri.path contains \"/testing\""),
+ Disabled: cloudflare.F(true),
+ FixedResponse: cloudflare.F(load_balancers.LoadBalancerNewParamsRulesFixedResponse{
+ ContentType: cloudflare.F("application/json"),
+ Location: cloudflare.F("www.example.com"),
+ MessageBody: cloudflare.F("Testing Hello"),
+ StatusCode: cloudflare.F(int64(0)),
+ }),
+ Name: cloudflare.F("route the path /testing to testing datacenter."),
+ Overrides: cloudflare.F(load_balancers.LoadBalancerNewParamsRulesOverrides{
+ AdaptiveRouting: cloudflare.F(load_balancers.LoadBalancerNewParamsRulesOverridesAdaptiveRouting{
+ FailoverAcrossPools: cloudflare.F(true),
+ }),
+ CountryPools: cloudflare.F[any](map[string]interface{}{
+ "GB": map[string]interface{}{
+ "0": "abd90f38ced07c2e2f4df50b1f61d4194",
+ },
+ "US": map[string]interface{}{
+ "0": "de90f38ced07c2e2f4df50b1f61d4194",
+ "1": "00920f38ce07c2e2f4df50b1f61d4194",
+ },
+ }),
+ DefaultPools: cloudflare.F([]string{"17b5962d775c646f3f9725cbc7a53df4", "9290f38c5d07c2e2f4df57b1f61d4196", "00920f38ce07c2e2f4df50b1f61d4194"}),
+ FallbackPool: cloudflare.F[any](map[string]interface{}{}),
+ LocationStrategy: cloudflare.F(load_balancers.LoadBalancerNewParamsRulesOverridesLocationStrategy{
+ Mode: cloudflare.F(load_balancers.LoadBalancerNewParamsRulesOverridesLocationStrategyModeResolverIP),
+ PreferEcs: cloudflare.F(load_balancers.LoadBalancerNewParamsRulesOverridesLocationStrategyPreferEcsAlways),
+ }),
+ PopPools: cloudflare.F[any](map[string]interface{}{
+ "LAX": map[string]interface{}{
+ "0": "de90f38ced07c2e2f4df50b1f61d4194",
+ "1": "9290f38c5d07c2e2f4df57b1f61d4196",
+ },
+ "LHR": map[string]interface{}{
+ "0": "abd90f38ced07c2e2f4df50b1f61d4194",
+ "1": "f9138c5d07c2e2f4df57b1f61d4196",
+ },
+ "SJC": map[string]interface{}{
+ "0": "00920f38ce07c2e2f4df50b1f61d4194",
+ },
+ }),
+ RandomSteering: cloudflare.F(load_balancers.LoadBalancerNewParamsRulesOverridesRandomSteering{
+ DefaultWeight: cloudflare.F(0.200000),
+ PoolWeights: cloudflare.F[any](map[string]interface{}{
+ "9290f38c5d07c2e2f4df57b1f61d4196": 0.500000,
+ "de90f38ced07c2e2f4df50b1f61d4194": 0.300000,
+ }),
+ }),
+ RegionPools: cloudflare.F[any](map[string]interface{}{
+ "ENAM": map[string]interface{}{
+ "0": "00920f38ce07c2e2f4df50b1f61d4194",
+ },
+ "WNAM": map[string]interface{}{
+ "0": "de90f38ced07c2e2f4df50b1f61d4194",
+ "1": "9290f38c5d07c2e2f4df57b1f61d4196",
+ },
+ }),
+ SessionAffinity: cloudflare.F(load_balancers.LoadBalancerNewParamsRulesOverridesSessionAffinityCookie),
+ SessionAffinityAttributes: cloudflare.F(load_balancers.LoadBalancerNewParamsRulesOverridesSessionAffinityAttributes{
+ DrainDuration: cloudflare.F(100.000000),
+ Headers: cloudflare.F([]string{"x"}),
+ RequireAllHeaders: cloudflare.F(true),
+ Samesite: cloudflare.F(load_balancers.LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesSamesiteAuto),
+ Secure: cloudflare.F(load_balancers.LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesSecureAuto),
+ ZeroDowntimeFailover: cloudflare.F(load_balancers.LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailoverSticky),
+ }),
+ SessionAffinityTTL: cloudflare.F(1800.000000),
+ SteeringPolicy: cloudflare.F(load_balancers.LoadBalancerNewParamsRulesOverridesSteeringPolicyDynamicLatency),
+ TTL: cloudflare.F(30.000000),
+ }),
+ Priority: cloudflare.F(int64(0)),
+ Terminates: cloudflare.F(true),
+ }, {
+ Condition: cloudflare.F("http.request.uri.path contains \"/testing\""),
+ Disabled: cloudflare.F(true),
+ FixedResponse: cloudflare.F(load_balancers.LoadBalancerNewParamsRulesFixedResponse{
+ ContentType: cloudflare.F("application/json"),
+ Location: cloudflare.F("www.example.com"),
+ MessageBody: cloudflare.F("Testing Hello"),
+ StatusCode: cloudflare.F(int64(0)),
+ }),
+ Name: cloudflare.F("route the path /testing to testing datacenter."),
+ Overrides: cloudflare.F(load_balancers.LoadBalancerNewParamsRulesOverrides{
+ AdaptiveRouting: cloudflare.F(load_balancers.LoadBalancerNewParamsRulesOverridesAdaptiveRouting{
+ FailoverAcrossPools: cloudflare.F(true),
+ }),
+ CountryPools: cloudflare.F[any](map[string]interface{}{
+ "GB": map[string]interface{}{
+ "0": "abd90f38ced07c2e2f4df50b1f61d4194",
+ },
+ "US": map[string]interface{}{
+ "0": "de90f38ced07c2e2f4df50b1f61d4194",
+ "1": "00920f38ce07c2e2f4df50b1f61d4194",
+ },
+ }),
+ DefaultPools: cloudflare.F([]string{"17b5962d775c646f3f9725cbc7a53df4", "9290f38c5d07c2e2f4df57b1f61d4196", "00920f38ce07c2e2f4df50b1f61d4194"}),
+ FallbackPool: cloudflare.F[any](map[string]interface{}{}),
+ LocationStrategy: cloudflare.F(load_balancers.LoadBalancerNewParamsRulesOverridesLocationStrategy{
+ Mode: cloudflare.F(load_balancers.LoadBalancerNewParamsRulesOverridesLocationStrategyModeResolverIP),
+ PreferEcs: cloudflare.F(load_balancers.LoadBalancerNewParamsRulesOverridesLocationStrategyPreferEcsAlways),
+ }),
+ PopPools: cloudflare.F[any](map[string]interface{}{
+ "LAX": map[string]interface{}{
+ "0": "de90f38ced07c2e2f4df50b1f61d4194",
+ "1": "9290f38c5d07c2e2f4df57b1f61d4196",
+ },
+ "LHR": map[string]interface{}{
+ "0": "abd90f38ced07c2e2f4df50b1f61d4194",
+ "1": "f9138c5d07c2e2f4df57b1f61d4196",
+ },
+ "SJC": map[string]interface{}{
+ "0": "00920f38ce07c2e2f4df50b1f61d4194",
+ },
+ }),
+ RandomSteering: cloudflare.F(load_balancers.LoadBalancerNewParamsRulesOverridesRandomSteering{
+ DefaultWeight: cloudflare.F(0.200000),
+ PoolWeights: cloudflare.F[any](map[string]interface{}{
+ "9290f38c5d07c2e2f4df57b1f61d4196": 0.500000,
+ "de90f38ced07c2e2f4df50b1f61d4194": 0.300000,
+ }),
+ }),
+ RegionPools: cloudflare.F[any](map[string]interface{}{
+ "ENAM": map[string]interface{}{
+ "0": "00920f38ce07c2e2f4df50b1f61d4194",
+ },
+ "WNAM": map[string]interface{}{
+ "0": "de90f38ced07c2e2f4df50b1f61d4194",
+ "1": "9290f38c5d07c2e2f4df57b1f61d4196",
+ },
+ }),
+ SessionAffinity: cloudflare.F(load_balancers.LoadBalancerNewParamsRulesOverridesSessionAffinityCookie),
+ SessionAffinityAttributes: cloudflare.F(load_balancers.LoadBalancerNewParamsRulesOverridesSessionAffinityAttributes{
+ DrainDuration: cloudflare.F(100.000000),
+ Headers: cloudflare.F([]string{"x"}),
+ RequireAllHeaders: cloudflare.F(true),
+ Samesite: cloudflare.F(load_balancers.LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesSamesiteAuto),
+ Secure: cloudflare.F(load_balancers.LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesSecureAuto),
+ ZeroDowntimeFailover: cloudflare.F(load_balancers.LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailoverSticky),
+ }),
+ SessionAffinityTTL: cloudflare.F(1800.000000),
+ SteeringPolicy: cloudflare.F(load_balancers.LoadBalancerNewParamsRulesOverridesSteeringPolicyDynamicLatency),
+ TTL: cloudflare.F(30.000000),
+ }),
+ Priority: cloudflare.F(int64(0)),
+ Terminates: cloudflare.F(true),
+ }, {
+ Condition: cloudflare.F("http.request.uri.path contains \"/testing\""),
+ Disabled: cloudflare.F(true),
+ FixedResponse: cloudflare.F(load_balancers.LoadBalancerNewParamsRulesFixedResponse{
+ ContentType: cloudflare.F("application/json"),
+ Location: cloudflare.F("www.example.com"),
+ MessageBody: cloudflare.F("Testing Hello"),
+ StatusCode: cloudflare.F(int64(0)),
+ }),
+ Name: cloudflare.F("route the path /testing to testing datacenter."),
+ Overrides: cloudflare.F(load_balancers.LoadBalancerNewParamsRulesOverrides{
+ AdaptiveRouting: cloudflare.F(load_balancers.LoadBalancerNewParamsRulesOverridesAdaptiveRouting{
+ FailoverAcrossPools: cloudflare.F(true),
+ }),
+ CountryPools: cloudflare.F[any](map[string]interface{}{
+ "GB": map[string]interface{}{
+ "0": "abd90f38ced07c2e2f4df50b1f61d4194",
+ },
+ "US": map[string]interface{}{
+ "0": "de90f38ced07c2e2f4df50b1f61d4194",
+ "1": "00920f38ce07c2e2f4df50b1f61d4194",
+ },
+ }),
+ DefaultPools: cloudflare.F([]string{"17b5962d775c646f3f9725cbc7a53df4", "9290f38c5d07c2e2f4df57b1f61d4196", "00920f38ce07c2e2f4df50b1f61d4194"}),
+ FallbackPool: cloudflare.F[any](map[string]interface{}{}),
+ LocationStrategy: cloudflare.F(load_balancers.LoadBalancerNewParamsRulesOverridesLocationStrategy{
+ Mode: cloudflare.F(load_balancers.LoadBalancerNewParamsRulesOverridesLocationStrategyModeResolverIP),
+ PreferEcs: cloudflare.F(load_balancers.LoadBalancerNewParamsRulesOverridesLocationStrategyPreferEcsAlways),
+ }),
+ PopPools: cloudflare.F[any](map[string]interface{}{
+ "LAX": map[string]interface{}{
+ "0": "de90f38ced07c2e2f4df50b1f61d4194",
+ "1": "9290f38c5d07c2e2f4df57b1f61d4196",
+ },
+ "LHR": map[string]interface{}{
+ "0": "abd90f38ced07c2e2f4df50b1f61d4194",
+ "1": "f9138c5d07c2e2f4df57b1f61d4196",
+ },
+ "SJC": map[string]interface{}{
+ "0": "00920f38ce07c2e2f4df50b1f61d4194",
+ },
+ }),
+ RandomSteering: cloudflare.F(load_balancers.LoadBalancerNewParamsRulesOverridesRandomSteering{
+ DefaultWeight: cloudflare.F(0.200000),
+ PoolWeights: cloudflare.F[any](map[string]interface{}{
+ "9290f38c5d07c2e2f4df57b1f61d4196": 0.500000,
+ "de90f38ced07c2e2f4df50b1f61d4194": 0.300000,
+ }),
+ }),
+ RegionPools: cloudflare.F[any](map[string]interface{}{
+ "ENAM": map[string]interface{}{
+ "0": "00920f38ce07c2e2f4df50b1f61d4194",
+ },
+ "WNAM": map[string]interface{}{
+ "0": "de90f38ced07c2e2f4df50b1f61d4194",
+ "1": "9290f38c5d07c2e2f4df57b1f61d4196",
+ },
+ }),
+ SessionAffinity: cloudflare.F(load_balancers.LoadBalancerNewParamsRulesOverridesSessionAffinityCookie),
+ SessionAffinityAttributes: cloudflare.F(load_balancers.LoadBalancerNewParamsRulesOverridesSessionAffinityAttributes{
+ DrainDuration: cloudflare.F(100.000000),
+ Headers: cloudflare.F([]string{"x"}),
+ RequireAllHeaders: cloudflare.F(true),
+ Samesite: cloudflare.F(load_balancers.LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesSamesiteAuto),
+ Secure: cloudflare.F(load_balancers.LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesSecureAuto),
+ ZeroDowntimeFailover: cloudflare.F(load_balancers.LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailoverSticky),
+ }),
+ SessionAffinityTTL: cloudflare.F(1800.000000),
+ SteeringPolicy: cloudflare.F(load_balancers.LoadBalancerNewParamsRulesOverridesSteeringPolicyDynamicLatency),
+ TTL: cloudflare.F(30.000000),
+ }),
+ Priority: cloudflare.F(int64(0)),
+ Terminates: cloudflare.F(true),
+ }}),
+ SessionAffinity: cloudflare.F(load_balancers.LoadBalancerNewParamsSessionAffinityCookie),
+ SessionAffinityAttributes: cloudflare.F(load_balancers.LoadBalancerNewParamsSessionAffinityAttributes{
+ DrainDuration: cloudflare.F(100.000000),
+ Headers: cloudflare.F([]string{"x"}),
+ RequireAllHeaders: cloudflare.F(true),
+ Samesite: cloudflare.F(load_balancers.LoadBalancerNewParamsSessionAffinityAttributesSamesiteAuto),
+ Secure: cloudflare.F(load_balancers.LoadBalancerNewParamsSessionAffinityAttributesSecureAuto),
+ ZeroDowntimeFailover: cloudflare.F(load_balancers.LoadBalancerNewParamsSessionAffinityAttributesZeroDowntimeFailoverSticky),
+ }),
+ SessionAffinityTTL: cloudflare.F(1800.000000),
+ SteeringPolicy: cloudflare.F(load_balancers.LoadBalancerNewParamsSteeringPolicyDynamicLatency),
+ TTL: cloudflare.F(30.000000),
+ })
+ 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())
+ }
+}
+
+func TestLoadBalancerUpdateWithOptionalParams(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"),
+ )
+ _, err := client.LoadBalancers.Update(
+ context.TODO(),
+ "699d98642c564d2e855e9661899b7252",
+ load_balancers.LoadBalancerUpdateParams{
+ ZoneID: cloudflare.F("699d98642c564d2e855e9661899b7252"),
+ DefaultPools: cloudflare.F([]string{"17b5962d775c646f3f9725cbc7a53df4", "9290f38c5d07c2e2f4df57b1f61d4196", "00920f38ce07c2e2f4df50b1f61d4194"}),
+ FallbackPool: cloudflare.F[any](map[string]interface{}{}),
+ Name: cloudflare.F("www.example.com"),
+ AdaptiveRouting: cloudflare.F(load_balancers.LoadBalancerUpdateParamsAdaptiveRouting{
+ FailoverAcrossPools: cloudflare.F(true),
+ }),
+ CountryPools: cloudflare.F[any](map[string]interface{}{
+ "GB": map[string]interface{}{
+ "0": "abd90f38ced07c2e2f4df50b1f61d4194",
+ },
+ "US": map[string]interface{}{
+ "0": "de90f38ced07c2e2f4df50b1f61d4194",
+ "1": "00920f38ce07c2e2f4df50b1f61d4194",
+ },
+ }),
+ Description: cloudflare.F("Load Balancer for www.example.com"),
+ Enabled: cloudflare.F(true),
+ LocationStrategy: cloudflare.F(load_balancers.LoadBalancerUpdateParamsLocationStrategy{
+ Mode: cloudflare.F(load_balancers.LoadBalancerUpdateParamsLocationStrategyModeResolverIP),
+ PreferEcs: cloudflare.F(load_balancers.LoadBalancerUpdateParamsLocationStrategyPreferEcsAlways),
+ }),
+ PopPools: cloudflare.F[any](map[string]interface{}{
+ "LAX": map[string]interface{}{
+ "0": "de90f38ced07c2e2f4df50b1f61d4194",
+ "1": "9290f38c5d07c2e2f4df57b1f61d4196",
+ },
+ "LHR": map[string]interface{}{
+ "0": "abd90f38ced07c2e2f4df50b1f61d4194",
+ "1": "f9138c5d07c2e2f4df57b1f61d4196",
+ },
+ "SJC": map[string]interface{}{
+ "0": "00920f38ce07c2e2f4df50b1f61d4194",
+ },
+ }),
+ Proxied: cloudflare.F(true),
+ RandomSteering: cloudflare.F(load_balancers.LoadBalancerUpdateParamsRandomSteering{
+ DefaultWeight: cloudflare.F(0.200000),
+ PoolWeights: cloudflare.F[any](map[string]interface{}{
+ "9290f38c5d07c2e2f4df57b1f61d4196": 0.500000,
+ "de90f38ced07c2e2f4df50b1f61d4194": 0.300000,
+ }),
+ }),
+ RegionPools: cloudflare.F[any](map[string]interface{}{
+ "ENAM": map[string]interface{}{
+ "0": "00920f38ce07c2e2f4df50b1f61d4194",
+ },
+ "WNAM": map[string]interface{}{
+ "0": "de90f38ced07c2e2f4df50b1f61d4194",
+ "1": "9290f38c5d07c2e2f4df57b1f61d4196",
+ },
+ }),
+ Rules: cloudflare.F([]load_balancers.LoadBalancerUpdateParamsRule{{
+ Condition: cloudflare.F("http.request.uri.path contains \"/testing\""),
+ Disabled: cloudflare.F(true),
+ FixedResponse: cloudflare.F(load_balancers.LoadBalancerUpdateParamsRulesFixedResponse{
+ ContentType: cloudflare.F("application/json"),
+ Location: cloudflare.F("www.example.com"),
+ MessageBody: cloudflare.F("Testing Hello"),
+ StatusCode: cloudflare.F(int64(0)),
+ }),
+ Name: cloudflare.F("route the path /testing to testing datacenter."),
+ Overrides: cloudflare.F(load_balancers.LoadBalancerUpdateParamsRulesOverrides{
+ AdaptiveRouting: cloudflare.F(load_balancers.LoadBalancerUpdateParamsRulesOverridesAdaptiveRouting{
+ FailoverAcrossPools: cloudflare.F(true),
+ }),
+ CountryPools: cloudflare.F[any](map[string]interface{}{
+ "GB": map[string]interface{}{
+ "0": "abd90f38ced07c2e2f4df50b1f61d4194",
+ },
+ "US": map[string]interface{}{
+ "0": "de90f38ced07c2e2f4df50b1f61d4194",
+ "1": "00920f38ce07c2e2f4df50b1f61d4194",
+ },
+ }),
+ DefaultPools: cloudflare.F([]string{"17b5962d775c646f3f9725cbc7a53df4", "9290f38c5d07c2e2f4df57b1f61d4196", "00920f38ce07c2e2f4df50b1f61d4194"}),
+ FallbackPool: cloudflare.F[any](map[string]interface{}{}),
+ LocationStrategy: cloudflare.F(load_balancers.LoadBalancerUpdateParamsRulesOverridesLocationStrategy{
+ Mode: cloudflare.F(load_balancers.LoadBalancerUpdateParamsRulesOverridesLocationStrategyModeResolverIP),
+ PreferEcs: cloudflare.F(load_balancers.LoadBalancerUpdateParamsRulesOverridesLocationStrategyPreferEcsAlways),
+ }),
+ PopPools: cloudflare.F[any](map[string]interface{}{
+ "LAX": map[string]interface{}{
+ "0": "de90f38ced07c2e2f4df50b1f61d4194",
+ "1": "9290f38c5d07c2e2f4df57b1f61d4196",
+ },
+ "LHR": map[string]interface{}{
+ "0": "abd90f38ced07c2e2f4df50b1f61d4194",
+ "1": "f9138c5d07c2e2f4df57b1f61d4196",
+ },
+ "SJC": map[string]interface{}{
+ "0": "00920f38ce07c2e2f4df50b1f61d4194",
+ },
+ }),
+ RandomSteering: cloudflare.F(load_balancers.LoadBalancerUpdateParamsRulesOverridesRandomSteering{
+ DefaultWeight: cloudflare.F(0.200000),
+ PoolWeights: cloudflare.F[any](map[string]interface{}{
+ "9290f38c5d07c2e2f4df57b1f61d4196": 0.500000,
+ "de90f38ced07c2e2f4df50b1f61d4194": 0.300000,
+ }),
+ }),
+ RegionPools: cloudflare.F[any](map[string]interface{}{
+ "ENAM": map[string]interface{}{
+ "0": "00920f38ce07c2e2f4df50b1f61d4194",
+ },
+ "WNAM": map[string]interface{}{
+ "0": "de90f38ced07c2e2f4df50b1f61d4194",
+ "1": "9290f38c5d07c2e2f4df57b1f61d4196",
+ },
+ }),
+ SessionAffinity: cloudflare.F(load_balancers.LoadBalancerUpdateParamsRulesOverridesSessionAffinityCookie),
+ SessionAffinityAttributes: cloudflare.F(load_balancers.LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributes{
+ DrainDuration: cloudflare.F(100.000000),
+ Headers: cloudflare.F([]string{"x"}),
+ RequireAllHeaders: cloudflare.F(true),
+ Samesite: cloudflare.F(load_balancers.LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesSamesiteAuto),
+ Secure: cloudflare.F(load_balancers.LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesSecureAuto),
+ ZeroDowntimeFailover: cloudflare.F(load_balancers.LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailoverSticky),
+ }),
+ SessionAffinityTTL: cloudflare.F(1800.000000),
+ SteeringPolicy: cloudflare.F(load_balancers.LoadBalancerUpdateParamsRulesOverridesSteeringPolicyDynamicLatency),
+ TTL: cloudflare.F(30.000000),
+ }),
+ Priority: cloudflare.F(int64(0)),
+ Terminates: cloudflare.F(true),
+ }, {
+ Condition: cloudflare.F("http.request.uri.path contains \"/testing\""),
+ Disabled: cloudflare.F(true),
+ FixedResponse: cloudflare.F(load_balancers.LoadBalancerUpdateParamsRulesFixedResponse{
+ ContentType: cloudflare.F("application/json"),
+ Location: cloudflare.F("www.example.com"),
+ MessageBody: cloudflare.F("Testing Hello"),
+ StatusCode: cloudflare.F(int64(0)),
+ }),
+ Name: cloudflare.F("route the path /testing to testing datacenter."),
+ Overrides: cloudflare.F(load_balancers.LoadBalancerUpdateParamsRulesOverrides{
+ AdaptiveRouting: cloudflare.F(load_balancers.LoadBalancerUpdateParamsRulesOverridesAdaptiveRouting{
+ FailoverAcrossPools: cloudflare.F(true),
+ }),
+ CountryPools: cloudflare.F[any](map[string]interface{}{
+ "GB": map[string]interface{}{
+ "0": "abd90f38ced07c2e2f4df50b1f61d4194",
+ },
+ "US": map[string]interface{}{
+ "0": "de90f38ced07c2e2f4df50b1f61d4194",
+ "1": "00920f38ce07c2e2f4df50b1f61d4194",
+ },
+ }),
+ DefaultPools: cloudflare.F([]string{"17b5962d775c646f3f9725cbc7a53df4", "9290f38c5d07c2e2f4df57b1f61d4196", "00920f38ce07c2e2f4df50b1f61d4194"}),
+ FallbackPool: cloudflare.F[any](map[string]interface{}{}),
+ LocationStrategy: cloudflare.F(load_balancers.LoadBalancerUpdateParamsRulesOverridesLocationStrategy{
+ Mode: cloudflare.F(load_balancers.LoadBalancerUpdateParamsRulesOverridesLocationStrategyModeResolverIP),
+ PreferEcs: cloudflare.F(load_balancers.LoadBalancerUpdateParamsRulesOverridesLocationStrategyPreferEcsAlways),
+ }),
+ PopPools: cloudflare.F[any](map[string]interface{}{
+ "LAX": map[string]interface{}{
+ "0": "de90f38ced07c2e2f4df50b1f61d4194",
+ "1": "9290f38c5d07c2e2f4df57b1f61d4196",
+ },
+ "LHR": map[string]interface{}{
+ "0": "abd90f38ced07c2e2f4df50b1f61d4194",
+ "1": "f9138c5d07c2e2f4df57b1f61d4196",
+ },
+ "SJC": map[string]interface{}{
+ "0": "00920f38ce07c2e2f4df50b1f61d4194",
+ },
+ }),
+ RandomSteering: cloudflare.F(load_balancers.LoadBalancerUpdateParamsRulesOverridesRandomSteering{
+ DefaultWeight: cloudflare.F(0.200000),
+ PoolWeights: cloudflare.F[any](map[string]interface{}{
+ "9290f38c5d07c2e2f4df57b1f61d4196": 0.500000,
+ "de90f38ced07c2e2f4df50b1f61d4194": 0.300000,
+ }),
+ }),
+ RegionPools: cloudflare.F[any](map[string]interface{}{
+ "ENAM": map[string]interface{}{
+ "0": "00920f38ce07c2e2f4df50b1f61d4194",
+ },
+ "WNAM": map[string]interface{}{
+ "0": "de90f38ced07c2e2f4df50b1f61d4194",
+ "1": "9290f38c5d07c2e2f4df57b1f61d4196",
+ },
+ }),
+ SessionAffinity: cloudflare.F(load_balancers.LoadBalancerUpdateParamsRulesOverridesSessionAffinityCookie),
+ SessionAffinityAttributes: cloudflare.F(load_balancers.LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributes{
+ DrainDuration: cloudflare.F(100.000000),
+ Headers: cloudflare.F([]string{"x"}),
+ RequireAllHeaders: cloudflare.F(true),
+ Samesite: cloudflare.F(load_balancers.LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesSamesiteAuto),
+ Secure: cloudflare.F(load_balancers.LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesSecureAuto),
+ ZeroDowntimeFailover: cloudflare.F(load_balancers.LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailoverSticky),
+ }),
+ SessionAffinityTTL: cloudflare.F(1800.000000),
+ SteeringPolicy: cloudflare.F(load_balancers.LoadBalancerUpdateParamsRulesOverridesSteeringPolicyDynamicLatency),
+ TTL: cloudflare.F(30.000000),
+ }),
+ Priority: cloudflare.F(int64(0)),
+ Terminates: cloudflare.F(true),
+ }, {
+ Condition: cloudflare.F("http.request.uri.path contains \"/testing\""),
+ Disabled: cloudflare.F(true),
+ FixedResponse: cloudflare.F(load_balancers.LoadBalancerUpdateParamsRulesFixedResponse{
+ ContentType: cloudflare.F("application/json"),
+ Location: cloudflare.F("www.example.com"),
+ MessageBody: cloudflare.F("Testing Hello"),
+ StatusCode: cloudflare.F(int64(0)),
+ }),
+ Name: cloudflare.F("route the path /testing to testing datacenter."),
+ Overrides: cloudflare.F(load_balancers.LoadBalancerUpdateParamsRulesOverrides{
+ AdaptiveRouting: cloudflare.F(load_balancers.LoadBalancerUpdateParamsRulesOverridesAdaptiveRouting{
+ FailoverAcrossPools: cloudflare.F(true),
+ }),
+ CountryPools: cloudflare.F[any](map[string]interface{}{
+ "GB": map[string]interface{}{
+ "0": "abd90f38ced07c2e2f4df50b1f61d4194",
+ },
+ "US": map[string]interface{}{
+ "0": "de90f38ced07c2e2f4df50b1f61d4194",
+ "1": "00920f38ce07c2e2f4df50b1f61d4194",
+ },
+ }),
+ DefaultPools: cloudflare.F([]string{"17b5962d775c646f3f9725cbc7a53df4", "9290f38c5d07c2e2f4df57b1f61d4196", "00920f38ce07c2e2f4df50b1f61d4194"}),
+ FallbackPool: cloudflare.F[any](map[string]interface{}{}),
+ LocationStrategy: cloudflare.F(load_balancers.LoadBalancerUpdateParamsRulesOverridesLocationStrategy{
+ Mode: cloudflare.F(load_balancers.LoadBalancerUpdateParamsRulesOverridesLocationStrategyModeResolverIP),
+ PreferEcs: cloudflare.F(load_balancers.LoadBalancerUpdateParamsRulesOverridesLocationStrategyPreferEcsAlways),
+ }),
+ PopPools: cloudflare.F[any](map[string]interface{}{
+ "LAX": map[string]interface{}{
+ "0": "de90f38ced07c2e2f4df50b1f61d4194",
+ "1": "9290f38c5d07c2e2f4df57b1f61d4196",
+ },
+ "LHR": map[string]interface{}{
+ "0": "abd90f38ced07c2e2f4df50b1f61d4194",
+ "1": "f9138c5d07c2e2f4df57b1f61d4196",
+ },
+ "SJC": map[string]interface{}{
+ "0": "00920f38ce07c2e2f4df50b1f61d4194",
+ },
+ }),
+ RandomSteering: cloudflare.F(load_balancers.LoadBalancerUpdateParamsRulesOverridesRandomSteering{
+ DefaultWeight: cloudflare.F(0.200000),
+ PoolWeights: cloudflare.F[any](map[string]interface{}{
+ "9290f38c5d07c2e2f4df57b1f61d4196": 0.500000,
+ "de90f38ced07c2e2f4df50b1f61d4194": 0.300000,
+ }),
+ }),
+ RegionPools: cloudflare.F[any](map[string]interface{}{
+ "ENAM": map[string]interface{}{
+ "0": "00920f38ce07c2e2f4df50b1f61d4194",
+ },
+ "WNAM": map[string]interface{}{
+ "0": "de90f38ced07c2e2f4df50b1f61d4194",
+ "1": "9290f38c5d07c2e2f4df57b1f61d4196",
+ },
+ }),
+ SessionAffinity: cloudflare.F(load_balancers.LoadBalancerUpdateParamsRulesOverridesSessionAffinityCookie),
+ SessionAffinityAttributes: cloudflare.F(load_balancers.LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributes{
+ DrainDuration: cloudflare.F(100.000000),
+ Headers: cloudflare.F([]string{"x"}),
+ RequireAllHeaders: cloudflare.F(true),
+ Samesite: cloudflare.F(load_balancers.LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesSamesiteAuto),
+ Secure: cloudflare.F(load_balancers.LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesSecureAuto),
+ ZeroDowntimeFailover: cloudflare.F(load_balancers.LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailoverSticky),
+ }),
+ SessionAffinityTTL: cloudflare.F(1800.000000),
+ SteeringPolicy: cloudflare.F(load_balancers.LoadBalancerUpdateParamsRulesOverridesSteeringPolicyDynamicLatency),
+ TTL: cloudflare.F(30.000000),
+ }),
+ Priority: cloudflare.F(int64(0)),
+ Terminates: cloudflare.F(true),
+ }}),
+ SessionAffinity: cloudflare.F(load_balancers.LoadBalancerUpdateParamsSessionAffinityCookie),
+ SessionAffinityAttributes: cloudflare.F(load_balancers.LoadBalancerUpdateParamsSessionAffinityAttributes{
+ DrainDuration: cloudflare.F(100.000000),
+ Headers: cloudflare.F([]string{"x"}),
+ RequireAllHeaders: cloudflare.F(true),
+ Samesite: cloudflare.F(load_balancers.LoadBalancerUpdateParamsSessionAffinityAttributesSamesiteAuto),
+ Secure: cloudflare.F(load_balancers.LoadBalancerUpdateParamsSessionAffinityAttributesSecureAuto),
+ ZeroDowntimeFailover: cloudflare.F(load_balancers.LoadBalancerUpdateParamsSessionAffinityAttributesZeroDowntimeFailoverSticky),
+ }),
+ SessionAffinityTTL: cloudflare.F(1800.000000),
+ SteeringPolicy: cloudflare.F(load_balancers.LoadBalancerUpdateParamsSteeringPolicyDynamicLatency),
+ TTL: cloudflare.F(30.000000),
+ },
+ )
+ 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())
+ }
+}
+
+func TestLoadBalancerList(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"),
+ )
+ _, err := client.LoadBalancers.List(context.TODO(), load_balancers.LoadBalancerListParams{
+ ZoneID: cloudflare.F("699d98642c564d2e855e9661899b7252"),
+ })
+ 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())
+ }
+}
+
+func TestLoadBalancerDelete(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"),
+ )
+ _, err := client.LoadBalancers.Delete(
+ context.TODO(),
+ "699d98642c564d2e855e9661899b7252",
+ load_balancers.LoadBalancerDeleteParams{
+ ZoneID: cloudflare.F("699d98642c564d2e855e9661899b7252"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestLoadBalancerEditWithOptionalParams(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"),
+ )
+ _, err := client.LoadBalancers.Edit(
+ context.TODO(),
+ "699d98642c564d2e855e9661899b7252",
+ load_balancers.LoadBalancerEditParams{
+ ZoneID: cloudflare.F("699d98642c564d2e855e9661899b7252"),
+ AdaptiveRouting: cloudflare.F(load_balancers.LoadBalancerEditParamsAdaptiveRouting{
+ FailoverAcrossPools: cloudflare.F(true),
+ }),
+ CountryPools: cloudflare.F[any](map[string]interface{}{
+ "GB": map[string]interface{}{
+ "0": "abd90f38ced07c2e2f4df50b1f61d4194",
+ },
+ "US": map[string]interface{}{
+ "0": "de90f38ced07c2e2f4df50b1f61d4194",
+ "1": "00920f38ce07c2e2f4df50b1f61d4194",
+ },
+ }),
+ DefaultPools: cloudflare.F([]string{"17b5962d775c646f3f9725cbc7a53df4", "9290f38c5d07c2e2f4df57b1f61d4196", "00920f38ce07c2e2f4df50b1f61d4194"}),
+ Description: cloudflare.F("Load Balancer for www.example.com"),
+ Enabled: cloudflare.F(true),
+ FallbackPool: cloudflare.F[any](map[string]interface{}{}),
+ LocationStrategy: cloudflare.F(load_balancers.LoadBalancerEditParamsLocationStrategy{
+ Mode: cloudflare.F(load_balancers.LoadBalancerEditParamsLocationStrategyModeResolverIP),
+ PreferEcs: cloudflare.F(load_balancers.LoadBalancerEditParamsLocationStrategyPreferEcsAlways),
+ }),
+ Name: cloudflare.F("www.example.com"),
+ PopPools: cloudflare.F[any](map[string]interface{}{
+ "LAX": map[string]interface{}{
+ "0": "de90f38ced07c2e2f4df50b1f61d4194",
+ "1": "9290f38c5d07c2e2f4df57b1f61d4196",
+ },
+ "LHR": map[string]interface{}{
+ "0": "abd90f38ced07c2e2f4df50b1f61d4194",
+ "1": "f9138c5d07c2e2f4df57b1f61d4196",
+ },
+ "SJC": map[string]interface{}{
+ "0": "00920f38ce07c2e2f4df50b1f61d4194",
+ },
+ }),
+ Proxied: cloudflare.F(true),
+ RandomSteering: cloudflare.F(load_balancers.LoadBalancerEditParamsRandomSteering{
+ DefaultWeight: cloudflare.F(0.200000),
+ PoolWeights: cloudflare.F[any](map[string]interface{}{
+ "9290f38c5d07c2e2f4df57b1f61d4196": 0.500000,
+ "de90f38ced07c2e2f4df50b1f61d4194": 0.300000,
+ }),
+ }),
+ RegionPools: cloudflare.F[any](map[string]interface{}{
+ "ENAM": map[string]interface{}{
+ "0": "00920f38ce07c2e2f4df50b1f61d4194",
+ },
+ "WNAM": map[string]interface{}{
+ "0": "de90f38ced07c2e2f4df50b1f61d4194",
+ "1": "9290f38c5d07c2e2f4df57b1f61d4196",
+ },
+ }),
+ Rules: cloudflare.F([]load_balancers.LoadBalancerEditParamsRule{{
+ Condition: cloudflare.F("http.request.uri.path contains \"/testing\""),
+ Disabled: cloudflare.F(true),
+ FixedResponse: cloudflare.F(load_balancers.LoadBalancerEditParamsRulesFixedResponse{
+ ContentType: cloudflare.F("application/json"),
+ Location: cloudflare.F("www.example.com"),
+ MessageBody: cloudflare.F("Testing Hello"),
+ StatusCode: cloudflare.F(int64(0)),
+ }),
+ Name: cloudflare.F("route the path /testing to testing datacenter."),
+ Overrides: cloudflare.F(load_balancers.LoadBalancerEditParamsRulesOverrides{
+ AdaptiveRouting: cloudflare.F(load_balancers.LoadBalancerEditParamsRulesOverridesAdaptiveRouting{
+ FailoverAcrossPools: cloudflare.F(true),
+ }),
+ CountryPools: cloudflare.F[any](map[string]interface{}{
+ "GB": map[string]interface{}{
+ "0": "abd90f38ced07c2e2f4df50b1f61d4194",
+ },
+ "US": map[string]interface{}{
+ "0": "de90f38ced07c2e2f4df50b1f61d4194",
+ "1": "00920f38ce07c2e2f4df50b1f61d4194",
+ },
+ }),
+ DefaultPools: cloudflare.F([]string{"17b5962d775c646f3f9725cbc7a53df4", "9290f38c5d07c2e2f4df57b1f61d4196", "00920f38ce07c2e2f4df50b1f61d4194"}),
+ FallbackPool: cloudflare.F[any](map[string]interface{}{}),
+ LocationStrategy: cloudflare.F(load_balancers.LoadBalancerEditParamsRulesOverridesLocationStrategy{
+ Mode: cloudflare.F(load_balancers.LoadBalancerEditParamsRulesOverridesLocationStrategyModeResolverIP),
+ PreferEcs: cloudflare.F(load_balancers.LoadBalancerEditParamsRulesOverridesLocationStrategyPreferEcsAlways),
+ }),
+ PopPools: cloudflare.F[any](map[string]interface{}{
+ "LAX": map[string]interface{}{
+ "0": "de90f38ced07c2e2f4df50b1f61d4194",
+ "1": "9290f38c5d07c2e2f4df57b1f61d4196",
+ },
+ "LHR": map[string]interface{}{
+ "0": "abd90f38ced07c2e2f4df50b1f61d4194",
+ "1": "f9138c5d07c2e2f4df57b1f61d4196",
+ },
+ "SJC": map[string]interface{}{
+ "0": "00920f38ce07c2e2f4df50b1f61d4194",
+ },
+ }),
+ RandomSteering: cloudflare.F(load_balancers.LoadBalancerEditParamsRulesOverridesRandomSteering{
+ DefaultWeight: cloudflare.F(0.200000),
+ PoolWeights: cloudflare.F[any](map[string]interface{}{
+ "9290f38c5d07c2e2f4df57b1f61d4196": 0.500000,
+ "de90f38ced07c2e2f4df50b1f61d4194": 0.300000,
+ }),
+ }),
+ RegionPools: cloudflare.F[any](map[string]interface{}{
+ "ENAM": map[string]interface{}{
+ "0": "00920f38ce07c2e2f4df50b1f61d4194",
+ },
+ "WNAM": map[string]interface{}{
+ "0": "de90f38ced07c2e2f4df50b1f61d4194",
+ "1": "9290f38c5d07c2e2f4df57b1f61d4196",
+ },
+ }),
+ SessionAffinity: cloudflare.F(load_balancers.LoadBalancerEditParamsRulesOverridesSessionAffinityCookie),
+ SessionAffinityAttributes: cloudflare.F(load_balancers.LoadBalancerEditParamsRulesOverridesSessionAffinityAttributes{
+ DrainDuration: cloudflare.F(100.000000),
+ Headers: cloudflare.F([]string{"x"}),
+ RequireAllHeaders: cloudflare.F(true),
+ Samesite: cloudflare.F(load_balancers.LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesSamesiteAuto),
+ Secure: cloudflare.F(load_balancers.LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesSecureAuto),
+ ZeroDowntimeFailover: cloudflare.F(load_balancers.LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailoverSticky),
+ }),
+ SessionAffinityTTL: cloudflare.F(1800.000000),
+ SteeringPolicy: cloudflare.F(load_balancers.LoadBalancerEditParamsRulesOverridesSteeringPolicyDynamicLatency),
+ TTL: cloudflare.F(30.000000),
+ }),
+ Priority: cloudflare.F(int64(0)),
+ Terminates: cloudflare.F(true),
+ }, {
+ Condition: cloudflare.F("http.request.uri.path contains \"/testing\""),
+ Disabled: cloudflare.F(true),
+ FixedResponse: cloudflare.F(load_balancers.LoadBalancerEditParamsRulesFixedResponse{
+ ContentType: cloudflare.F("application/json"),
+ Location: cloudflare.F("www.example.com"),
+ MessageBody: cloudflare.F("Testing Hello"),
+ StatusCode: cloudflare.F(int64(0)),
+ }),
+ Name: cloudflare.F("route the path /testing to testing datacenter."),
+ Overrides: cloudflare.F(load_balancers.LoadBalancerEditParamsRulesOverrides{
+ AdaptiveRouting: cloudflare.F(load_balancers.LoadBalancerEditParamsRulesOverridesAdaptiveRouting{
+ FailoverAcrossPools: cloudflare.F(true),
+ }),
+ CountryPools: cloudflare.F[any](map[string]interface{}{
+ "GB": map[string]interface{}{
+ "0": "abd90f38ced07c2e2f4df50b1f61d4194",
+ },
+ "US": map[string]interface{}{
+ "0": "de90f38ced07c2e2f4df50b1f61d4194",
+ "1": "00920f38ce07c2e2f4df50b1f61d4194",
+ },
+ }),
+ DefaultPools: cloudflare.F([]string{"17b5962d775c646f3f9725cbc7a53df4", "9290f38c5d07c2e2f4df57b1f61d4196", "00920f38ce07c2e2f4df50b1f61d4194"}),
+ FallbackPool: cloudflare.F[any](map[string]interface{}{}),
+ LocationStrategy: cloudflare.F(load_balancers.LoadBalancerEditParamsRulesOverridesLocationStrategy{
+ Mode: cloudflare.F(load_balancers.LoadBalancerEditParamsRulesOverridesLocationStrategyModeResolverIP),
+ PreferEcs: cloudflare.F(load_balancers.LoadBalancerEditParamsRulesOverridesLocationStrategyPreferEcsAlways),
+ }),
+ PopPools: cloudflare.F[any](map[string]interface{}{
+ "LAX": map[string]interface{}{
+ "0": "de90f38ced07c2e2f4df50b1f61d4194",
+ "1": "9290f38c5d07c2e2f4df57b1f61d4196",
+ },
+ "LHR": map[string]interface{}{
+ "0": "abd90f38ced07c2e2f4df50b1f61d4194",
+ "1": "f9138c5d07c2e2f4df57b1f61d4196",
+ },
+ "SJC": map[string]interface{}{
+ "0": "00920f38ce07c2e2f4df50b1f61d4194",
+ },
+ }),
+ RandomSteering: cloudflare.F(load_balancers.LoadBalancerEditParamsRulesOverridesRandomSteering{
+ DefaultWeight: cloudflare.F(0.200000),
+ PoolWeights: cloudflare.F[any](map[string]interface{}{
+ "9290f38c5d07c2e2f4df57b1f61d4196": 0.500000,
+ "de90f38ced07c2e2f4df50b1f61d4194": 0.300000,
+ }),
+ }),
+ RegionPools: cloudflare.F[any](map[string]interface{}{
+ "ENAM": map[string]interface{}{
+ "0": "00920f38ce07c2e2f4df50b1f61d4194",
+ },
+ "WNAM": map[string]interface{}{
+ "0": "de90f38ced07c2e2f4df50b1f61d4194",
+ "1": "9290f38c5d07c2e2f4df57b1f61d4196",
+ },
+ }),
+ SessionAffinity: cloudflare.F(load_balancers.LoadBalancerEditParamsRulesOverridesSessionAffinityCookie),
+ SessionAffinityAttributes: cloudflare.F(load_balancers.LoadBalancerEditParamsRulesOverridesSessionAffinityAttributes{
+ DrainDuration: cloudflare.F(100.000000),
+ Headers: cloudflare.F([]string{"x"}),
+ RequireAllHeaders: cloudflare.F(true),
+ Samesite: cloudflare.F(load_balancers.LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesSamesiteAuto),
+ Secure: cloudflare.F(load_balancers.LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesSecureAuto),
+ ZeroDowntimeFailover: cloudflare.F(load_balancers.LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailoverSticky),
+ }),
+ SessionAffinityTTL: cloudflare.F(1800.000000),
+ SteeringPolicy: cloudflare.F(load_balancers.LoadBalancerEditParamsRulesOverridesSteeringPolicyDynamicLatency),
+ TTL: cloudflare.F(30.000000),
+ }),
+ Priority: cloudflare.F(int64(0)),
+ Terminates: cloudflare.F(true),
+ }, {
+ Condition: cloudflare.F("http.request.uri.path contains \"/testing\""),
+ Disabled: cloudflare.F(true),
+ FixedResponse: cloudflare.F(load_balancers.LoadBalancerEditParamsRulesFixedResponse{
+ ContentType: cloudflare.F("application/json"),
+ Location: cloudflare.F("www.example.com"),
+ MessageBody: cloudflare.F("Testing Hello"),
+ StatusCode: cloudflare.F(int64(0)),
+ }),
+ Name: cloudflare.F("route the path /testing to testing datacenter."),
+ Overrides: cloudflare.F(load_balancers.LoadBalancerEditParamsRulesOverrides{
+ AdaptiveRouting: cloudflare.F(load_balancers.LoadBalancerEditParamsRulesOverridesAdaptiveRouting{
+ FailoverAcrossPools: cloudflare.F(true),
+ }),
+ CountryPools: cloudflare.F[any](map[string]interface{}{
+ "GB": map[string]interface{}{
+ "0": "abd90f38ced07c2e2f4df50b1f61d4194",
+ },
+ "US": map[string]interface{}{
+ "0": "de90f38ced07c2e2f4df50b1f61d4194",
+ "1": "00920f38ce07c2e2f4df50b1f61d4194",
+ },
+ }),
+ DefaultPools: cloudflare.F([]string{"17b5962d775c646f3f9725cbc7a53df4", "9290f38c5d07c2e2f4df57b1f61d4196", "00920f38ce07c2e2f4df50b1f61d4194"}),
+ FallbackPool: cloudflare.F[any](map[string]interface{}{}),
+ LocationStrategy: cloudflare.F(load_balancers.LoadBalancerEditParamsRulesOverridesLocationStrategy{
+ Mode: cloudflare.F(load_balancers.LoadBalancerEditParamsRulesOverridesLocationStrategyModeResolverIP),
+ PreferEcs: cloudflare.F(load_balancers.LoadBalancerEditParamsRulesOverridesLocationStrategyPreferEcsAlways),
+ }),
+ PopPools: cloudflare.F[any](map[string]interface{}{
+ "LAX": map[string]interface{}{
+ "0": "de90f38ced07c2e2f4df50b1f61d4194",
+ "1": "9290f38c5d07c2e2f4df57b1f61d4196",
+ },
+ "LHR": map[string]interface{}{
+ "0": "abd90f38ced07c2e2f4df50b1f61d4194",
+ "1": "f9138c5d07c2e2f4df57b1f61d4196",
+ },
+ "SJC": map[string]interface{}{
+ "0": "00920f38ce07c2e2f4df50b1f61d4194",
+ },
+ }),
+ RandomSteering: cloudflare.F(load_balancers.LoadBalancerEditParamsRulesOverridesRandomSteering{
+ DefaultWeight: cloudflare.F(0.200000),
+ PoolWeights: cloudflare.F[any](map[string]interface{}{
+ "9290f38c5d07c2e2f4df57b1f61d4196": 0.500000,
+ "de90f38ced07c2e2f4df50b1f61d4194": 0.300000,
+ }),
+ }),
+ RegionPools: cloudflare.F[any](map[string]interface{}{
+ "ENAM": map[string]interface{}{
+ "0": "00920f38ce07c2e2f4df50b1f61d4194",
+ },
+ "WNAM": map[string]interface{}{
+ "0": "de90f38ced07c2e2f4df50b1f61d4194",
+ "1": "9290f38c5d07c2e2f4df57b1f61d4196",
+ },
+ }),
+ SessionAffinity: cloudflare.F(load_balancers.LoadBalancerEditParamsRulesOverridesSessionAffinityCookie),
+ SessionAffinityAttributes: cloudflare.F(load_balancers.LoadBalancerEditParamsRulesOverridesSessionAffinityAttributes{
+ DrainDuration: cloudflare.F(100.000000),
+ Headers: cloudflare.F([]string{"x"}),
+ RequireAllHeaders: cloudflare.F(true),
+ Samesite: cloudflare.F(load_balancers.LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesSamesiteAuto),
+ Secure: cloudflare.F(load_balancers.LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesSecureAuto),
+ ZeroDowntimeFailover: cloudflare.F(load_balancers.LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailoverSticky),
+ }),
+ SessionAffinityTTL: cloudflare.F(1800.000000),
+ SteeringPolicy: cloudflare.F(load_balancers.LoadBalancerEditParamsRulesOverridesSteeringPolicyDynamicLatency),
+ TTL: cloudflare.F(30.000000),
+ }),
+ Priority: cloudflare.F(int64(0)),
+ Terminates: cloudflare.F(true),
+ }}),
+ SessionAffinity: cloudflare.F(load_balancers.LoadBalancerEditParamsSessionAffinityCookie),
+ SessionAffinityAttributes: cloudflare.F(load_balancers.LoadBalancerEditParamsSessionAffinityAttributes{
+ DrainDuration: cloudflare.F(100.000000),
+ Headers: cloudflare.F([]string{"x"}),
+ RequireAllHeaders: cloudflare.F(true),
+ Samesite: cloudflare.F(load_balancers.LoadBalancerEditParamsSessionAffinityAttributesSamesiteAuto),
+ Secure: cloudflare.F(load_balancers.LoadBalancerEditParamsSessionAffinityAttributesSecureAuto),
+ ZeroDowntimeFailover: cloudflare.F(load_balancers.LoadBalancerEditParamsSessionAffinityAttributesZeroDowntimeFailoverSticky),
+ }),
+ SessionAffinityTTL: cloudflare.F(1800.000000),
+ SteeringPolicy: cloudflare.F(load_balancers.LoadBalancerEditParamsSteeringPolicyDynamicLatency),
+ TTL: cloudflare.F(30.000000),
+ },
+ )
+ 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())
+ }
+}
+
+func TestLoadBalancerGet(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"),
+ )
+ _, err := client.LoadBalancers.Get(
+ context.TODO(),
+ "699d98642c564d2e855e9661899b7252",
+ load_balancers.LoadBalancerGetParams{
+ ZoneID: cloudflare.F("699d98642c564d2e855e9661899b7252"),
+ },
+ )
+ 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/load_balancers/monitor.go b/load_balancers/monitor.go
new file mode 100644
index 00000000000..94e30272727
--- /dev/null
+++ b/load_balancers/monitor.go
@@ -0,0 +1,882 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package load_balancers
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/user"
+)
+
+// MonitorService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewMonitorService] method instead.
+type MonitorService struct {
+ Options []option.RequestOption
+ Previews *MonitorPreviewService
+ References *MonitorReferenceService
+}
+
+// NewMonitorService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewMonitorService(opts ...option.RequestOption) (r *MonitorService) {
+ r = &MonitorService{}
+ r.Options = opts
+ r.Previews = NewMonitorPreviewService(opts...)
+ r.References = NewMonitorReferenceService(opts...)
+ return
+}
+
+// Create a configured monitor.
+func (r *MonitorService) New(ctx context.Context, params MonitorNewParams, opts ...option.RequestOption) (res *user.LoadBalancingMonitor, err error) {
+ opts = append(r.Options[:], opts...)
+ var env MonitorNewResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/load_balancers/monitors", params.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Modify a configured monitor.
+func (r *MonitorService) Update(ctx context.Context, monitorID string, params MonitorUpdateParams, opts ...option.RequestOption) (res *user.LoadBalancingMonitor, err error) {
+ opts = append(r.Options[:], opts...)
+ var env MonitorUpdateResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/load_balancers/monitors/%s", params.AccountID, monitorID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// List configured monitors for an account.
+func (r *MonitorService) List(ctx context.Context, query MonitorListParams, opts ...option.RequestOption) (res *[]user.LoadBalancingMonitor, err error) {
+ opts = append(r.Options[:], opts...)
+ var env MonitorListResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/load_balancers/monitors", query.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Delete a configured monitor.
+func (r *MonitorService) Delete(ctx context.Context, monitorID string, body MonitorDeleteParams, opts ...option.RequestOption) (res *MonitorDeleteResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env MonitorDeleteResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/load_balancers/monitors/%s", body.AccountID, monitorID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Apply changes to an existing monitor, overwriting the supplied properties.
+func (r *MonitorService) Edit(ctx context.Context, monitorID string, params MonitorEditParams, opts ...option.RequestOption) (res *user.LoadBalancingMonitor, err error) {
+ opts = append(r.Options[:], opts...)
+ var env MonitorEditResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/load_balancers/monitors/%s", params.AccountID, monitorID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// List a single configured monitor for an account.
+func (r *MonitorService) Get(ctx context.Context, monitorID string, query MonitorGetParams, opts ...option.RequestOption) (res *user.LoadBalancingMonitor, err error) {
+ opts = append(r.Options[:], opts...)
+ var env MonitorGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/load_balancers/monitors/%s", query.AccountID, monitorID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type MonitorDeleteResponse struct {
+ ID string `json:"id"`
+ JSON monitorDeleteResponseJSON `json:"-"`
+}
+
+// monitorDeleteResponseJSON contains the JSON metadata for the struct
+// [MonitorDeleteResponse]
+type monitorDeleteResponseJSON struct {
+ ID apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *MonitorDeleteResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r monitorDeleteResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type MonitorNewParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ // The expected HTTP response code or code range of the health check. This
+ // parameter is only valid for HTTP and HTTPS monitors.
+ ExpectedCodes param.Field[string] `json:"expected_codes,required"`
+ // Do not validate the certificate when monitor use HTTPS. This parameter is
+ // currently only valid for HTTP and HTTPS monitors.
+ AllowInsecure param.Field[bool] `json:"allow_insecure"`
+ // To be marked unhealthy the monitored origin must fail this healthcheck N
+ // consecutive times.
+ ConsecutiveDown param.Field[int64] `json:"consecutive_down"`
+ // To be marked healthy the monitored origin must pass this healthcheck N
+ // consecutive times.
+ ConsecutiveUp param.Field[int64] `json:"consecutive_up"`
+ // Object description.
+ Description param.Field[string] `json:"description"`
+ // A case-insensitive sub-string to look for in the response body. If this string
+ // is not found, the origin will be marked as unhealthy. This parameter is only
+ // valid for HTTP and HTTPS monitors.
+ ExpectedBody param.Field[string] `json:"expected_body"`
+ // Follow redirects if returned by the origin. This parameter is only valid for
+ // HTTP and HTTPS monitors.
+ FollowRedirects param.Field[bool] `json:"follow_redirects"`
+ // The HTTP request headers to send in the health check. It is recommended you set
+ // a Host header by default. The User-Agent header cannot be overridden. This
+ // parameter is only valid for HTTP and HTTPS monitors.
+ Header param.Field[interface{}] `json:"header"`
+ // The interval between each health check. Shorter intervals may improve failover
+ // time, but will increase load on the origins as we check from multiple locations.
+ Interval param.Field[int64] `json:"interval"`
+ // The method to use for the health check. This defaults to 'GET' for HTTP/HTTPS
+ // based checks and 'connection_established' for TCP based health checks.
+ Method param.Field[string] `json:"method"`
+ // The endpoint path you want to conduct a health check against. This parameter is
+ // only valid for HTTP and HTTPS monitors.
+ Path param.Field[string] `json:"path"`
+ // The port number to connect to for the health check. Required for TCP, UDP, and
+ // SMTP checks. HTTP and HTTPS checks should only define the port when using a
+ // non-standard port (HTTP: default 80, HTTPS: default 443).
+ Port param.Field[int64] `json:"port"`
+ // Assign this monitor to emulate the specified zone while probing. This parameter
+ // is only valid for HTTP and HTTPS monitors.
+ ProbeZone param.Field[string] `json:"probe_zone"`
+ // The number of retries to attempt in case of a timeout before marking the origin
+ // as unhealthy. Retries are attempted immediately.
+ Retries param.Field[int64] `json:"retries"`
+ // The timeout (in seconds) before marking the health check as failed.
+ Timeout param.Field[int64] `json:"timeout"`
+ // The protocol to use for the health check. Currently supported protocols are
+ // 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.
+ Type param.Field[MonitorNewParamsType] `json:"type"`
+}
+
+func (r MonitorNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The protocol to use for the health check. Currently supported protocols are
+// 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.
+type MonitorNewParamsType string
+
+const (
+ MonitorNewParamsTypeHTTP MonitorNewParamsType = "http"
+ MonitorNewParamsTypeHTTPS MonitorNewParamsType = "https"
+ MonitorNewParamsTypeTcp MonitorNewParamsType = "tcp"
+ MonitorNewParamsTypeUdpIcmp MonitorNewParamsType = "udp_icmp"
+ MonitorNewParamsTypeIcmpPing MonitorNewParamsType = "icmp_ping"
+ MonitorNewParamsTypeSmtp MonitorNewParamsType = "smtp"
+)
+
+type MonitorNewResponseEnvelope struct {
+ Errors []MonitorNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []MonitorNewResponseEnvelopeMessages `json:"messages,required"`
+ Result user.LoadBalancingMonitor `json:"result,required"`
+ // Whether the API call was successful
+ Success MonitorNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON monitorNewResponseEnvelopeJSON `json:"-"`
+}
+
+// monitorNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [MonitorNewResponseEnvelope]
+type monitorNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *MonitorNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r monitorNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type MonitorNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON monitorNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// monitorNewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [MonitorNewResponseEnvelopeErrors]
+type monitorNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *MonitorNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r monitorNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type MonitorNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON monitorNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// monitorNewResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [MonitorNewResponseEnvelopeMessages]
+type monitorNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *MonitorNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r monitorNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type MonitorNewResponseEnvelopeSuccess bool
+
+const (
+ MonitorNewResponseEnvelopeSuccessTrue MonitorNewResponseEnvelopeSuccess = true
+)
+
+type MonitorUpdateParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ // The expected HTTP response code or code range of the health check. This
+ // parameter is only valid for HTTP and HTTPS monitors.
+ ExpectedCodes param.Field[string] `json:"expected_codes,required"`
+ // Do not validate the certificate when monitor use HTTPS. This parameter is
+ // currently only valid for HTTP and HTTPS monitors.
+ AllowInsecure param.Field[bool] `json:"allow_insecure"`
+ // To be marked unhealthy the monitored origin must fail this healthcheck N
+ // consecutive times.
+ ConsecutiveDown param.Field[int64] `json:"consecutive_down"`
+ // To be marked healthy the monitored origin must pass this healthcheck N
+ // consecutive times.
+ ConsecutiveUp param.Field[int64] `json:"consecutive_up"`
+ // Object description.
+ Description param.Field[string] `json:"description"`
+ // A case-insensitive sub-string to look for in the response body. If this string
+ // is not found, the origin will be marked as unhealthy. This parameter is only
+ // valid for HTTP and HTTPS monitors.
+ ExpectedBody param.Field[string] `json:"expected_body"`
+ // Follow redirects if returned by the origin. This parameter is only valid for
+ // HTTP and HTTPS monitors.
+ FollowRedirects param.Field[bool] `json:"follow_redirects"`
+ // The HTTP request headers to send in the health check. It is recommended you set
+ // a Host header by default. The User-Agent header cannot be overridden. This
+ // parameter is only valid for HTTP and HTTPS monitors.
+ Header param.Field[interface{}] `json:"header"`
+ // The interval between each health check. Shorter intervals may improve failover
+ // time, but will increase load on the origins as we check from multiple locations.
+ Interval param.Field[int64] `json:"interval"`
+ // The method to use for the health check. This defaults to 'GET' for HTTP/HTTPS
+ // based checks and 'connection_established' for TCP based health checks.
+ Method param.Field[string] `json:"method"`
+ // The endpoint path you want to conduct a health check against. This parameter is
+ // only valid for HTTP and HTTPS monitors.
+ Path param.Field[string] `json:"path"`
+ // The port number to connect to for the health check. Required for TCP, UDP, and
+ // SMTP checks. HTTP and HTTPS checks should only define the port when using a
+ // non-standard port (HTTP: default 80, HTTPS: default 443).
+ Port param.Field[int64] `json:"port"`
+ // Assign this monitor to emulate the specified zone while probing. This parameter
+ // is only valid for HTTP and HTTPS monitors.
+ ProbeZone param.Field[string] `json:"probe_zone"`
+ // The number of retries to attempt in case of a timeout before marking the origin
+ // as unhealthy. Retries are attempted immediately.
+ Retries param.Field[int64] `json:"retries"`
+ // The timeout (in seconds) before marking the health check as failed.
+ Timeout param.Field[int64] `json:"timeout"`
+ // The protocol to use for the health check. Currently supported protocols are
+ // 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.
+ Type param.Field[MonitorUpdateParamsType] `json:"type"`
+}
+
+func (r MonitorUpdateParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The protocol to use for the health check. Currently supported protocols are
+// 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.
+type MonitorUpdateParamsType string
+
+const (
+ MonitorUpdateParamsTypeHTTP MonitorUpdateParamsType = "http"
+ MonitorUpdateParamsTypeHTTPS MonitorUpdateParamsType = "https"
+ MonitorUpdateParamsTypeTcp MonitorUpdateParamsType = "tcp"
+ MonitorUpdateParamsTypeUdpIcmp MonitorUpdateParamsType = "udp_icmp"
+ MonitorUpdateParamsTypeIcmpPing MonitorUpdateParamsType = "icmp_ping"
+ MonitorUpdateParamsTypeSmtp MonitorUpdateParamsType = "smtp"
+)
+
+type MonitorUpdateResponseEnvelope struct {
+ Errors []MonitorUpdateResponseEnvelopeErrors `json:"errors,required"`
+ Messages []MonitorUpdateResponseEnvelopeMessages `json:"messages,required"`
+ Result user.LoadBalancingMonitor `json:"result,required"`
+ // Whether the API call was successful
+ Success MonitorUpdateResponseEnvelopeSuccess `json:"success,required"`
+ JSON monitorUpdateResponseEnvelopeJSON `json:"-"`
+}
+
+// monitorUpdateResponseEnvelopeJSON contains the JSON metadata for the struct
+// [MonitorUpdateResponseEnvelope]
+type monitorUpdateResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *MonitorUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r monitorUpdateResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type MonitorUpdateResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON monitorUpdateResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// monitorUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [MonitorUpdateResponseEnvelopeErrors]
+type monitorUpdateResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *MonitorUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r monitorUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type MonitorUpdateResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON monitorUpdateResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// monitorUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [MonitorUpdateResponseEnvelopeMessages]
+type monitorUpdateResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *MonitorUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r monitorUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type MonitorUpdateResponseEnvelopeSuccess bool
+
+const (
+ MonitorUpdateResponseEnvelopeSuccessTrue MonitorUpdateResponseEnvelopeSuccess = true
+)
+
+type MonitorListParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type MonitorListResponseEnvelope struct {
+ Errors []MonitorListResponseEnvelopeErrors `json:"errors,required"`
+ Messages []MonitorListResponseEnvelopeMessages `json:"messages,required"`
+ Result []user.LoadBalancingMonitor `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success MonitorListResponseEnvelopeSuccess `json:"success,required"`
+ ResultInfo MonitorListResponseEnvelopeResultInfo `json:"result_info"`
+ JSON monitorListResponseEnvelopeJSON `json:"-"`
+}
+
+// monitorListResponseEnvelopeJSON contains the JSON metadata for the struct
+// [MonitorListResponseEnvelope]
+type monitorListResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ ResultInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *MonitorListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r monitorListResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type MonitorListResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON monitorListResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// monitorListResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [MonitorListResponseEnvelopeErrors]
+type monitorListResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *MonitorListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r monitorListResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type MonitorListResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON monitorListResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// monitorListResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [MonitorListResponseEnvelopeMessages]
+type monitorListResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *MonitorListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r monitorListResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type MonitorListResponseEnvelopeSuccess bool
+
+const (
+ MonitorListResponseEnvelopeSuccessTrue MonitorListResponseEnvelopeSuccess = true
+)
+
+type MonitorListResponseEnvelopeResultInfo struct {
+ // Total number of results for the requested service
+ Count float64 `json:"count"`
+ // Current page within paginated list of results
+ Page float64 `json:"page"`
+ // Number of results per page of results
+ PerPage float64 `json:"per_page"`
+ // Total results available without any search parameters
+ TotalCount float64 `json:"total_count"`
+ JSON monitorListResponseEnvelopeResultInfoJSON `json:"-"`
+}
+
+// monitorListResponseEnvelopeResultInfoJSON contains the JSON metadata for the
+// struct [MonitorListResponseEnvelopeResultInfo]
+type monitorListResponseEnvelopeResultInfoJSON struct {
+ Count apijson.Field
+ Page apijson.Field
+ PerPage apijson.Field
+ TotalCount apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *MonitorListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r monitorListResponseEnvelopeResultInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type MonitorDeleteParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type MonitorDeleteResponseEnvelope struct {
+ Errors []MonitorDeleteResponseEnvelopeErrors `json:"errors,required"`
+ Messages []MonitorDeleteResponseEnvelopeMessages `json:"messages,required"`
+ Result MonitorDeleteResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success MonitorDeleteResponseEnvelopeSuccess `json:"success,required"`
+ JSON monitorDeleteResponseEnvelopeJSON `json:"-"`
+}
+
+// monitorDeleteResponseEnvelopeJSON contains the JSON metadata for the struct
+// [MonitorDeleteResponseEnvelope]
+type monitorDeleteResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *MonitorDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r monitorDeleteResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type MonitorDeleteResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON monitorDeleteResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// monitorDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [MonitorDeleteResponseEnvelopeErrors]
+type monitorDeleteResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *MonitorDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r monitorDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type MonitorDeleteResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON monitorDeleteResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// monitorDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [MonitorDeleteResponseEnvelopeMessages]
+type monitorDeleteResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *MonitorDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r monitorDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type MonitorDeleteResponseEnvelopeSuccess bool
+
+const (
+ MonitorDeleteResponseEnvelopeSuccessTrue MonitorDeleteResponseEnvelopeSuccess = true
+)
+
+type MonitorEditParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ // The expected HTTP response code or code range of the health check. This
+ // parameter is only valid for HTTP and HTTPS monitors.
+ ExpectedCodes param.Field[string] `json:"expected_codes,required"`
+ // Do not validate the certificate when monitor use HTTPS. This parameter is
+ // currently only valid for HTTP and HTTPS monitors.
+ AllowInsecure param.Field[bool] `json:"allow_insecure"`
+ // To be marked unhealthy the monitored origin must fail this healthcheck N
+ // consecutive times.
+ ConsecutiveDown param.Field[int64] `json:"consecutive_down"`
+ // To be marked healthy the monitored origin must pass this healthcheck N
+ // consecutive times.
+ ConsecutiveUp param.Field[int64] `json:"consecutive_up"`
+ // Object description.
+ Description param.Field[string] `json:"description"`
+ // A case-insensitive sub-string to look for in the response body. If this string
+ // is not found, the origin will be marked as unhealthy. This parameter is only
+ // valid for HTTP and HTTPS monitors.
+ ExpectedBody param.Field[string] `json:"expected_body"`
+ // Follow redirects if returned by the origin. This parameter is only valid for
+ // HTTP and HTTPS monitors.
+ FollowRedirects param.Field[bool] `json:"follow_redirects"`
+ // The HTTP request headers to send in the health check. It is recommended you set
+ // a Host header by default. The User-Agent header cannot be overridden. This
+ // parameter is only valid for HTTP and HTTPS monitors.
+ Header param.Field[interface{}] `json:"header"`
+ // The interval between each health check. Shorter intervals may improve failover
+ // time, but will increase load on the origins as we check from multiple locations.
+ Interval param.Field[int64] `json:"interval"`
+ // The method to use for the health check. This defaults to 'GET' for HTTP/HTTPS
+ // based checks and 'connection_established' for TCP based health checks.
+ Method param.Field[string] `json:"method"`
+ // The endpoint path you want to conduct a health check against. This parameter is
+ // only valid for HTTP and HTTPS monitors.
+ Path param.Field[string] `json:"path"`
+ // The port number to connect to for the health check. Required for TCP, UDP, and
+ // SMTP checks. HTTP and HTTPS checks should only define the port when using a
+ // non-standard port (HTTP: default 80, HTTPS: default 443).
+ Port param.Field[int64] `json:"port"`
+ // Assign this monitor to emulate the specified zone while probing. This parameter
+ // is only valid for HTTP and HTTPS monitors.
+ ProbeZone param.Field[string] `json:"probe_zone"`
+ // The number of retries to attempt in case of a timeout before marking the origin
+ // as unhealthy. Retries are attempted immediately.
+ Retries param.Field[int64] `json:"retries"`
+ // The timeout (in seconds) before marking the health check as failed.
+ Timeout param.Field[int64] `json:"timeout"`
+ // The protocol to use for the health check. Currently supported protocols are
+ // 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.
+ Type param.Field[MonitorEditParamsType] `json:"type"`
+}
+
+func (r MonitorEditParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The protocol to use for the health check. Currently supported protocols are
+// 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.
+type MonitorEditParamsType string
+
+const (
+ MonitorEditParamsTypeHTTP MonitorEditParamsType = "http"
+ MonitorEditParamsTypeHTTPS MonitorEditParamsType = "https"
+ MonitorEditParamsTypeTcp MonitorEditParamsType = "tcp"
+ MonitorEditParamsTypeUdpIcmp MonitorEditParamsType = "udp_icmp"
+ MonitorEditParamsTypeIcmpPing MonitorEditParamsType = "icmp_ping"
+ MonitorEditParamsTypeSmtp MonitorEditParamsType = "smtp"
+)
+
+type MonitorEditResponseEnvelope struct {
+ Errors []MonitorEditResponseEnvelopeErrors `json:"errors,required"`
+ Messages []MonitorEditResponseEnvelopeMessages `json:"messages,required"`
+ Result user.LoadBalancingMonitor `json:"result,required"`
+ // Whether the API call was successful
+ Success MonitorEditResponseEnvelopeSuccess `json:"success,required"`
+ JSON monitorEditResponseEnvelopeJSON `json:"-"`
+}
+
+// monitorEditResponseEnvelopeJSON contains the JSON metadata for the struct
+// [MonitorEditResponseEnvelope]
+type monitorEditResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *MonitorEditResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r monitorEditResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type MonitorEditResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON monitorEditResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// monitorEditResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [MonitorEditResponseEnvelopeErrors]
+type monitorEditResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *MonitorEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r monitorEditResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type MonitorEditResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON monitorEditResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// monitorEditResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [MonitorEditResponseEnvelopeMessages]
+type monitorEditResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *MonitorEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r monitorEditResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type MonitorEditResponseEnvelopeSuccess bool
+
+const (
+ MonitorEditResponseEnvelopeSuccessTrue MonitorEditResponseEnvelopeSuccess = true
+)
+
+type MonitorGetParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type MonitorGetResponseEnvelope struct {
+ Errors []MonitorGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []MonitorGetResponseEnvelopeMessages `json:"messages,required"`
+ Result user.LoadBalancingMonitor `json:"result,required"`
+ // Whether the API call was successful
+ Success MonitorGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON monitorGetResponseEnvelopeJSON `json:"-"`
+}
+
+// monitorGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [MonitorGetResponseEnvelope]
+type monitorGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *MonitorGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r monitorGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type MonitorGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON monitorGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// monitorGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [MonitorGetResponseEnvelopeErrors]
+type monitorGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *MonitorGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r monitorGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type MonitorGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON monitorGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// monitorGetResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [MonitorGetResponseEnvelopeMessages]
+type monitorGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *MonitorGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r monitorGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type MonitorGetResponseEnvelopeSuccess bool
+
+const (
+ MonitorGetResponseEnvelopeSuccessTrue MonitorGetResponseEnvelopeSuccess = true
+)
diff --git a/load_balancers/monitor_test.go b/load_balancers/monitor_test.go
new file mode 100644
index 00000000000..47619a6dc60
--- /dev/null
+++ b/load_balancers/monitor_test.go
@@ -0,0 +1,256 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package load_balancers_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/load_balancers"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestMonitorNewWithOptionalParams(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"),
+ )
+ _, err := client.LoadBalancers.Monitors.New(context.TODO(), load_balancers.MonitorNewParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ ExpectedCodes: cloudflare.F("2xx"),
+ AllowInsecure: cloudflare.F(true),
+ ConsecutiveDown: cloudflare.F(int64(0)),
+ ConsecutiveUp: cloudflare.F(int64(0)),
+ Description: cloudflare.F("Login page monitor"),
+ ExpectedBody: cloudflare.F("alive"),
+ FollowRedirects: cloudflare.F(true),
+ Header: cloudflare.F[any](map[string]interface{}{
+ "Host": map[string]interface{}{
+ "0": "example.com",
+ },
+ "X-App-ID": map[string]interface{}{
+ "0": "abc123",
+ },
+ }),
+ Interval: cloudflare.F(int64(0)),
+ Method: cloudflare.F("GET"),
+ Path: cloudflare.F("/health"),
+ Port: cloudflare.F(int64(0)),
+ ProbeZone: cloudflare.F("example.com"),
+ Retries: cloudflare.F(int64(0)),
+ Timeout: cloudflare.F(int64(0)),
+ Type: cloudflare.F(load_balancers.MonitorNewParamsTypeHTTPS),
+ })
+ 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())
+ }
+}
+
+func TestMonitorUpdateWithOptionalParams(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"),
+ )
+ _, err := client.LoadBalancers.Monitors.Update(
+ context.TODO(),
+ "f1aba936b94213e5b8dca0c0dbf1f9cc",
+ load_balancers.MonitorUpdateParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ ExpectedCodes: cloudflare.F("2xx"),
+ AllowInsecure: cloudflare.F(true),
+ ConsecutiveDown: cloudflare.F(int64(0)),
+ ConsecutiveUp: cloudflare.F(int64(0)),
+ Description: cloudflare.F("Login page monitor"),
+ ExpectedBody: cloudflare.F("alive"),
+ FollowRedirects: cloudflare.F(true),
+ Header: cloudflare.F[any](map[string]interface{}{
+ "Host": map[string]interface{}{
+ "0": "example.com",
+ },
+ "X-App-ID": map[string]interface{}{
+ "0": "abc123",
+ },
+ }),
+ Interval: cloudflare.F(int64(0)),
+ Method: cloudflare.F("GET"),
+ Path: cloudflare.F("/health"),
+ Port: cloudflare.F(int64(0)),
+ ProbeZone: cloudflare.F("example.com"),
+ Retries: cloudflare.F(int64(0)),
+ Timeout: cloudflare.F(int64(0)),
+ Type: cloudflare.F(load_balancers.MonitorUpdateParamsTypeHTTPS),
+ },
+ )
+ 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())
+ }
+}
+
+func TestMonitorList(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"),
+ )
+ _, err := client.LoadBalancers.Monitors.List(context.TODO(), load_balancers.MonitorListParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ })
+ 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())
+ }
+}
+
+func TestMonitorDelete(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"),
+ )
+ _, err := client.LoadBalancers.Monitors.Delete(
+ context.TODO(),
+ "f1aba936b94213e5b8dca0c0dbf1f9cc",
+ load_balancers.MonitorDeleteParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestMonitorEditWithOptionalParams(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"),
+ )
+ _, err := client.LoadBalancers.Monitors.Edit(
+ context.TODO(),
+ "f1aba936b94213e5b8dca0c0dbf1f9cc",
+ load_balancers.MonitorEditParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ ExpectedCodes: cloudflare.F("2xx"),
+ AllowInsecure: cloudflare.F(true),
+ ConsecutiveDown: cloudflare.F(int64(0)),
+ ConsecutiveUp: cloudflare.F(int64(0)),
+ Description: cloudflare.F("Login page monitor"),
+ ExpectedBody: cloudflare.F("alive"),
+ FollowRedirects: cloudflare.F(true),
+ Header: cloudflare.F[any](map[string]interface{}{
+ "Host": map[string]interface{}{
+ "0": "example.com",
+ },
+ "X-App-ID": map[string]interface{}{
+ "0": "abc123",
+ },
+ }),
+ Interval: cloudflare.F(int64(0)),
+ Method: cloudflare.F("GET"),
+ Path: cloudflare.F("/health"),
+ Port: cloudflare.F(int64(0)),
+ ProbeZone: cloudflare.F("example.com"),
+ Retries: cloudflare.F(int64(0)),
+ Timeout: cloudflare.F(int64(0)),
+ Type: cloudflare.F(load_balancers.MonitorEditParamsTypeHTTPS),
+ },
+ )
+ 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())
+ }
+}
+
+func TestMonitorGet(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"),
+ )
+ _, err := client.LoadBalancers.Monitors.Get(
+ context.TODO(),
+ "f1aba936b94213e5b8dca0c0dbf1f9cc",
+ load_balancers.MonitorGetParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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/load_balancers/monitorpreview.go b/load_balancers/monitorpreview.go
new file mode 100644
index 00000000000..253867d061b
--- /dev/null
+++ b/load_balancers/monitorpreview.go
@@ -0,0 +1,222 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package load_balancers
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// MonitorPreviewService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewMonitorPreviewService] method
+// instead.
+type MonitorPreviewService struct {
+ Options []option.RequestOption
+}
+
+// NewMonitorPreviewService generates a new service that applies the given options
+// to each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewMonitorPreviewService(opts ...option.RequestOption) (r *MonitorPreviewService) {
+ r = &MonitorPreviewService{}
+ r.Options = opts
+ return
+}
+
+// Preview pools using the specified monitor with provided monitor details. The
+// returned preview_id can be used in the preview endpoint to retrieve the results.
+func (r *MonitorPreviewService) New(ctx context.Context, monitorID string, params MonitorPreviewNewParams, opts ...option.RequestOption) (res *MonitorPreviewNewResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env MonitorPreviewNewResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/load_balancers/monitors/%s/preview", params.AccountID, monitorID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type MonitorPreviewNewResponse struct {
+ // Monitored pool IDs mapped to their respective names.
+ Pools map[string]string `json:"pools"`
+ PreviewID string `json:"preview_id"`
+ JSON monitorPreviewNewResponseJSON `json:"-"`
+}
+
+// monitorPreviewNewResponseJSON contains the JSON metadata for the struct
+// [MonitorPreviewNewResponse]
+type monitorPreviewNewResponseJSON struct {
+ Pools apijson.Field
+ PreviewID apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *MonitorPreviewNewResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r monitorPreviewNewResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type MonitorPreviewNewParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ // The expected HTTP response code or code range of the health check. This
+ // parameter is only valid for HTTP and HTTPS monitors.
+ ExpectedCodes param.Field[string] `json:"expected_codes,required"`
+ // Do not validate the certificate when monitor use HTTPS. This parameter is
+ // currently only valid for HTTP and HTTPS monitors.
+ AllowInsecure param.Field[bool] `json:"allow_insecure"`
+ // To be marked unhealthy the monitored origin must fail this healthcheck N
+ // consecutive times.
+ ConsecutiveDown param.Field[int64] `json:"consecutive_down"`
+ // To be marked healthy the monitored origin must pass this healthcheck N
+ // consecutive times.
+ ConsecutiveUp param.Field[int64] `json:"consecutive_up"`
+ // Object description.
+ Description param.Field[string] `json:"description"`
+ // A case-insensitive sub-string to look for in the response body. If this string
+ // is not found, the origin will be marked as unhealthy. This parameter is only
+ // valid for HTTP and HTTPS monitors.
+ ExpectedBody param.Field[string] `json:"expected_body"`
+ // Follow redirects if returned by the origin. This parameter is only valid for
+ // HTTP and HTTPS monitors.
+ FollowRedirects param.Field[bool] `json:"follow_redirects"`
+ // The HTTP request headers to send in the health check. It is recommended you set
+ // a Host header by default. The User-Agent header cannot be overridden. This
+ // parameter is only valid for HTTP and HTTPS monitors.
+ Header param.Field[interface{}] `json:"header"`
+ // The interval between each health check. Shorter intervals may improve failover
+ // time, but will increase load on the origins as we check from multiple locations.
+ Interval param.Field[int64] `json:"interval"`
+ // The method to use for the health check. This defaults to 'GET' for HTTP/HTTPS
+ // based checks and 'connection_established' for TCP based health checks.
+ Method param.Field[string] `json:"method"`
+ // The endpoint path you want to conduct a health check against. This parameter is
+ // only valid for HTTP and HTTPS monitors.
+ Path param.Field[string] `json:"path"`
+ // The port number to connect to for the health check. Required for TCP, UDP, and
+ // SMTP checks. HTTP and HTTPS checks should only define the port when using a
+ // non-standard port (HTTP: default 80, HTTPS: default 443).
+ Port param.Field[int64] `json:"port"`
+ // Assign this monitor to emulate the specified zone while probing. This parameter
+ // is only valid for HTTP and HTTPS monitors.
+ ProbeZone param.Field[string] `json:"probe_zone"`
+ // The number of retries to attempt in case of a timeout before marking the origin
+ // as unhealthy. Retries are attempted immediately.
+ Retries param.Field[int64] `json:"retries"`
+ // The timeout (in seconds) before marking the health check as failed.
+ Timeout param.Field[int64] `json:"timeout"`
+ // The protocol to use for the health check. Currently supported protocols are
+ // 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.
+ Type param.Field[MonitorPreviewNewParamsType] `json:"type"`
+}
+
+func (r MonitorPreviewNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The protocol to use for the health check. Currently supported protocols are
+// 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.
+type MonitorPreviewNewParamsType string
+
+const (
+ MonitorPreviewNewParamsTypeHTTP MonitorPreviewNewParamsType = "http"
+ MonitorPreviewNewParamsTypeHTTPS MonitorPreviewNewParamsType = "https"
+ MonitorPreviewNewParamsTypeTcp MonitorPreviewNewParamsType = "tcp"
+ MonitorPreviewNewParamsTypeUdpIcmp MonitorPreviewNewParamsType = "udp_icmp"
+ MonitorPreviewNewParamsTypeIcmpPing MonitorPreviewNewParamsType = "icmp_ping"
+ MonitorPreviewNewParamsTypeSmtp MonitorPreviewNewParamsType = "smtp"
+)
+
+type MonitorPreviewNewResponseEnvelope struct {
+ Errors []MonitorPreviewNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []MonitorPreviewNewResponseEnvelopeMessages `json:"messages,required"`
+ Result MonitorPreviewNewResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success MonitorPreviewNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON monitorPreviewNewResponseEnvelopeJSON `json:"-"`
+}
+
+// monitorPreviewNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [MonitorPreviewNewResponseEnvelope]
+type monitorPreviewNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *MonitorPreviewNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r monitorPreviewNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type MonitorPreviewNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON monitorPreviewNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// monitorPreviewNewResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [MonitorPreviewNewResponseEnvelopeErrors]
+type monitorPreviewNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *MonitorPreviewNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r monitorPreviewNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type MonitorPreviewNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON monitorPreviewNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// monitorPreviewNewResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [MonitorPreviewNewResponseEnvelopeMessages]
+type monitorPreviewNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *MonitorPreviewNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r monitorPreviewNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type MonitorPreviewNewResponseEnvelopeSuccess bool
+
+const (
+ MonitorPreviewNewResponseEnvelopeSuccessTrue MonitorPreviewNewResponseEnvelopeSuccess = true
+)
diff --git a/load_balancers/monitorpreview_test.go b/load_balancers/monitorpreview_test.go
new file mode 100644
index 00000000000..87b41a1202b
--- /dev/null
+++ b/load_balancers/monitorpreview_test.go
@@ -0,0 +1,68 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package load_balancers_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/load_balancers"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestMonitorPreviewNewWithOptionalParams(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"),
+ )
+ _, err := client.LoadBalancers.Monitors.Previews.New(
+ context.TODO(),
+ "f1aba936b94213e5b8dca0c0dbf1f9cc",
+ load_balancers.MonitorPreviewNewParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ ExpectedCodes: cloudflare.F("2xx"),
+ AllowInsecure: cloudflare.F(true),
+ ConsecutiveDown: cloudflare.F(int64(0)),
+ ConsecutiveUp: cloudflare.F(int64(0)),
+ Description: cloudflare.F("Login page monitor"),
+ ExpectedBody: cloudflare.F("alive"),
+ FollowRedirects: cloudflare.F(true),
+ Header: cloudflare.F[any](map[string]interface{}{
+ "Host": map[string]interface{}{
+ "0": "example.com",
+ },
+ "X-App-ID": map[string]interface{}{
+ "0": "abc123",
+ },
+ }),
+ Interval: cloudflare.F(int64(0)),
+ Method: cloudflare.F("GET"),
+ Path: cloudflare.F("/health"),
+ Port: cloudflare.F(int64(0)),
+ ProbeZone: cloudflare.F("example.com"),
+ Retries: cloudflare.F(int64(0)),
+ Timeout: cloudflare.F(int64(0)),
+ Type: cloudflare.F(load_balancers.MonitorPreviewNewParamsTypeHTTPS),
+ },
+ )
+ 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/load_balancers/monitorreference.go b/load_balancers/monitorreference.go
new file mode 100644
index 00000000000..ad16af7fd39
--- /dev/null
+++ b/load_balancers/monitorreference.go
@@ -0,0 +1,200 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package load_balancers
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// MonitorReferenceService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewMonitorReferenceService] method
+// instead.
+type MonitorReferenceService struct {
+ Options []option.RequestOption
+}
+
+// NewMonitorReferenceService generates a new service that applies the given
+// options to each request. These options are applied after the parent client's
+// options (if there is one), and before any request-specific options.
+func NewMonitorReferenceService(opts ...option.RequestOption) (r *MonitorReferenceService) {
+ r = &MonitorReferenceService{}
+ r.Options = opts
+ return
+}
+
+// Get the list of resources that reference the provided monitor.
+func (r *MonitorReferenceService) Get(ctx context.Context, monitorID string, query MonitorReferenceGetParams, opts ...option.RequestOption) (res *[]MonitorReferenceGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env MonitorReferenceGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/load_balancers/monitors/%s/references", query.AccountID, monitorID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type MonitorReferenceGetResponse struct {
+ ReferenceType MonitorReferenceGetResponseReferenceType `json:"reference_type"`
+ ResourceID string `json:"resource_id"`
+ ResourceName string `json:"resource_name"`
+ ResourceType string `json:"resource_type"`
+ JSON monitorReferenceGetResponseJSON `json:"-"`
+}
+
+// monitorReferenceGetResponseJSON contains the JSON metadata for the struct
+// [MonitorReferenceGetResponse]
+type monitorReferenceGetResponseJSON struct {
+ ReferenceType apijson.Field
+ ResourceID apijson.Field
+ ResourceName apijson.Field
+ ResourceType apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *MonitorReferenceGetResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r monitorReferenceGetResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type MonitorReferenceGetResponseReferenceType string
+
+const (
+ MonitorReferenceGetResponseReferenceTypeStar MonitorReferenceGetResponseReferenceType = "*"
+ MonitorReferenceGetResponseReferenceTypeReferral MonitorReferenceGetResponseReferenceType = "referral"
+ MonitorReferenceGetResponseReferenceTypeReferrer MonitorReferenceGetResponseReferenceType = "referrer"
+)
+
+type MonitorReferenceGetParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type MonitorReferenceGetResponseEnvelope struct {
+ Errors []MonitorReferenceGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []MonitorReferenceGetResponseEnvelopeMessages `json:"messages,required"`
+ // List of resources that reference a given monitor.
+ Result []MonitorReferenceGetResponse `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success MonitorReferenceGetResponseEnvelopeSuccess `json:"success,required"`
+ ResultInfo MonitorReferenceGetResponseEnvelopeResultInfo `json:"result_info"`
+ JSON monitorReferenceGetResponseEnvelopeJSON `json:"-"`
+}
+
+// monitorReferenceGetResponseEnvelopeJSON contains the JSON metadata for the
+// struct [MonitorReferenceGetResponseEnvelope]
+type monitorReferenceGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ ResultInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *MonitorReferenceGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r monitorReferenceGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type MonitorReferenceGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON monitorReferenceGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// monitorReferenceGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [MonitorReferenceGetResponseEnvelopeErrors]
+type monitorReferenceGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *MonitorReferenceGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r monitorReferenceGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type MonitorReferenceGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON monitorReferenceGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// monitorReferenceGetResponseEnvelopeMessagesJSON contains the JSON metadata for
+// the struct [MonitorReferenceGetResponseEnvelopeMessages]
+type monitorReferenceGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *MonitorReferenceGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r monitorReferenceGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type MonitorReferenceGetResponseEnvelopeSuccess bool
+
+const (
+ MonitorReferenceGetResponseEnvelopeSuccessTrue MonitorReferenceGetResponseEnvelopeSuccess = true
+)
+
+type MonitorReferenceGetResponseEnvelopeResultInfo struct {
+ // Total number of results for the requested service
+ Count float64 `json:"count"`
+ // Current page within paginated list of results
+ Page float64 `json:"page"`
+ // Number of results per page of results
+ PerPage float64 `json:"per_page"`
+ // Total results available without any search parameters
+ TotalCount float64 `json:"total_count"`
+ JSON monitorReferenceGetResponseEnvelopeResultInfoJSON `json:"-"`
+}
+
+// monitorReferenceGetResponseEnvelopeResultInfoJSON contains the JSON metadata for
+// the struct [MonitorReferenceGetResponseEnvelopeResultInfo]
+type monitorReferenceGetResponseEnvelopeResultInfoJSON struct {
+ Count apijson.Field
+ Page apijson.Field
+ PerPage apijson.Field
+ TotalCount apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *MonitorReferenceGetResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r monitorReferenceGetResponseEnvelopeResultInfoJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/load_balancers/monitorreference_test.go b/load_balancers/monitorreference_test.go
new file mode 100644
index 00000000000..7d322e783f5
--- /dev/null
+++ b/load_balancers/monitorreference_test.go
@@ -0,0 +1,45 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package load_balancers_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/load_balancers"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestMonitorReferenceGet(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"),
+ )
+ _, err := client.LoadBalancers.Monitors.References.Get(
+ context.TODO(),
+ "f1aba936b94213e5b8dca0c0dbf1f9cc",
+ load_balancers.MonitorReferenceGetParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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/load_balancers/pool.go b/load_balancers/pool.go
new file mode 100644
index 00000000000..db2090534a5
--- /dev/null
+++ b/load_balancers/pool.go
@@ -0,0 +1,1402 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package load_balancers
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/user"
+)
+
+// PoolService contains methods and other services that help with interacting with
+// the cloudflare API. Note, unlike clients, this service does not read variables
+// from the environment automatically. You should not instantiate this service
+// directly, and instead use the [NewPoolService] method instead.
+type PoolService struct {
+ Options []option.RequestOption
+ Health *PoolHealthService
+ References *PoolReferenceService
+}
+
+// NewPoolService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewPoolService(opts ...option.RequestOption) (r *PoolService) {
+ r = &PoolService{}
+ r.Options = opts
+ r.Health = NewPoolHealthService(opts...)
+ r.References = NewPoolReferenceService(opts...)
+ return
+}
+
+// Create a new pool.
+func (r *PoolService) New(ctx context.Context, params PoolNewParams, opts ...option.RequestOption) (res *user.LoadBalancingPool, err error) {
+ opts = append(r.Options[:], opts...)
+ var env PoolNewResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/load_balancers/pools", params.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Modify a configured pool.
+func (r *PoolService) Update(ctx context.Context, poolID string, params PoolUpdateParams, opts ...option.RequestOption) (res *user.LoadBalancingPool, err error) {
+ opts = append(r.Options[:], opts...)
+ var env PoolUpdateResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/load_balancers/pools/%s", params.AccountID, poolID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// List configured pools.
+func (r *PoolService) List(ctx context.Context, params PoolListParams, opts ...option.RequestOption) (res *[]user.LoadBalancingPool, err error) {
+ opts = append(r.Options[:], opts...)
+ var env PoolListResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/load_balancers/pools", params.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Delete a configured pool.
+func (r *PoolService) Delete(ctx context.Context, poolID string, body PoolDeleteParams, opts ...option.RequestOption) (res *PoolDeleteResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env PoolDeleteResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/load_balancers/pools/%s", body.AccountID, poolID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Apply changes to an existing pool, overwriting the supplied properties.
+func (r *PoolService) Edit(ctx context.Context, poolID string, params PoolEditParams, opts ...option.RequestOption) (res *user.LoadBalancingPool, err error) {
+ opts = append(r.Options[:], opts...)
+ var env PoolEditResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/load_balancers/pools/%s", params.AccountID, poolID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Fetch a single configured pool.
+func (r *PoolService) Get(ctx context.Context, poolID string, query PoolGetParams, opts ...option.RequestOption) (res *user.LoadBalancingPool, err error) {
+ opts = append(r.Options[:], opts...)
+ var env PoolGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/load_balancers/pools/%s", query.AccountID, poolID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type PoolDeleteResponse struct {
+ ID string `json:"id"`
+ JSON poolDeleteResponseJSON `json:"-"`
+}
+
+// poolDeleteResponseJSON contains the JSON metadata for the struct
+// [PoolDeleteResponse]
+type poolDeleteResponseJSON struct {
+ ID apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PoolDeleteResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r poolDeleteResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type PoolNewParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ // A short name (tag) for the pool. Only alphanumeric characters, hyphens, and
+ // underscores are allowed.
+ Name param.Field[string] `json:"name,required"`
+ // The list of origins within this pool. Traffic directed at this pool is balanced
+ // across all currently healthy origins, provided the pool itself is healthy.
+ Origins param.Field[[]PoolNewParamsOrigin] `json:"origins,required"`
+ // A human-readable description of the pool.
+ Description param.Field[string] `json:"description"`
+ // Whether to enable (the default) or disable this pool. Disabled pools will not
+ // receive traffic and are excluded from health checks. Disabling a pool will cause
+ // any load balancers using it to failover to the next pool (if any).
+ Enabled param.Field[bool] `json:"enabled"`
+ // The latitude of the data center containing the origins used in this pool in
+ // decimal degrees. If this is set, longitude must also be set.
+ Latitude param.Field[float64] `json:"latitude"`
+ // Configures load shedding policies and percentages for the pool.
+ LoadShedding param.Field[PoolNewParamsLoadShedding] `json:"load_shedding"`
+ // The longitude of the data center containing the origins used in this pool in
+ // decimal degrees. If this is set, latitude must also be set.
+ Longitude param.Field[float64] `json:"longitude"`
+ // The minimum number of origins that must be healthy for this pool to serve
+ // traffic. If the number of healthy origins falls below this number, the pool will
+ // be marked unhealthy and will failover to the next available pool.
+ MinimumOrigins param.Field[int64] `json:"minimum_origins"`
+ // The ID of the Monitor to use for checking the health of origins within this
+ // pool.
+ Monitor param.Field[interface{}] `json:"monitor"`
+ // This field is now deprecated. It has been moved to Cloudflare's Centralized
+ // Notification service
+ // https://developers.cloudflare.com/fundamentals/notifications/. The email address
+ // to send health status notifications to. This can be an individual mailbox or a
+ // mailing list. Multiple emails can be supplied as a comma delimited list.
+ NotificationEmail param.Field[string] `json:"notification_email"`
+ // Filter pool and origin health notifications by resource type or health status.
+ // Use null to reset.
+ NotificationFilter param.Field[PoolNewParamsNotificationFilter] `json:"notification_filter"`
+ // Configures origin steering for the pool. Controls how origins are selected for
+ // new sessions and traffic without session affinity.
+ OriginSteering param.Field[PoolNewParamsOriginSteering] `json:"origin_steering"`
+}
+
+func (r PoolNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type PoolNewParamsOrigin struct {
+ // The IP address (IPv4 or IPv6) of the origin, or its publicly addressable
+ // hostname. Hostnames entered here should resolve directly to the origin, and not
+ // be a hostname proxied by Cloudflare. To set an internal/reserved address,
+ // virtual_network_id must also be set.
+ Address param.Field[string] `json:"address"`
+ // Whether to enable (the default) this origin within the pool. Disabled origins
+ // will not receive traffic and are excluded from health checks. The origin will
+ // only be disabled for the current pool.
+ Enabled param.Field[bool] `json:"enabled"`
+ // The request header is used to pass additional information with an HTTP request.
+ // Currently supported header is 'Host'.
+ Header param.Field[PoolNewParamsOriginsHeader] `json:"header"`
+ // A human-identifiable name for the origin.
+ Name param.Field[string] `json:"name"`
+ // The virtual network subnet ID the origin belongs in. Virtual network must also
+ // belong to the account.
+ VirtualNetworkID param.Field[string] `json:"virtual_network_id"`
+ // The weight of this origin relative to other origins in the pool. Based on the
+ // configured weight the total traffic is distributed among origins within the
+ // pool.
+ //
+ // - `origin_steering.policy="least_outstanding_requests"`: Use weight to scale the
+ // origin's outstanding requests.
+ // - `origin_steering.policy="least_connections"`: Use weight to scale the origin's
+ // open connections.
+ Weight param.Field[float64] `json:"weight"`
+}
+
+func (r PoolNewParamsOrigin) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The request header is used to pass additional information with an HTTP request.
+// Currently supported header is 'Host'.
+type PoolNewParamsOriginsHeader struct {
+ // The 'Host' header allows to override the hostname set in the HTTP request.
+ // Current support is 1 'Host' header override per origin.
+ Host param.Field[[]string] `json:"Host"`
+}
+
+func (r PoolNewParamsOriginsHeader) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Configures load shedding policies and percentages for the pool.
+type PoolNewParamsLoadShedding struct {
+ // The percent of traffic to shed from the pool, according to the default policy.
+ // Applies to new sessions and traffic without session affinity.
+ DefaultPercent param.Field[float64] `json:"default_percent"`
+ // The default policy to use when load shedding. A random policy randomly sheds a
+ // given percent of requests. A hash policy computes a hash over the
+ // CF-Connecting-IP address and sheds all requests originating from a percent of
+ // IPs.
+ DefaultPolicy param.Field[PoolNewParamsLoadSheddingDefaultPolicy] `json:"default_policy"`
+ // The percent of existing sessions to shed from the pool, according to the session
+ // policy.
+ SessionPercent param.Field[float64] `json:"session_percent"`
+ // Only the hash policy is supported for existing sessions (to avoid exponential
+ // decay).
+ SessionPolicy param.Field[PoolNewParamsLoadSheddingSessionPolicy] `json:"session_policy"`
+}
+
+func (r PoolNewParamsLoadShedding) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The default policy to use when load shedding. A random policy randomly sheds a
+// given percent of requests. A hash policy computes a hash over the
+// CF-Connecting-IP address and sheds all requests originating from a percent of
+// IPs.
+type PoolNewParamsLoadSheddingDefaultPolicy string
+
+const (
+ PoolNewParamsLoadSheddingDefaultPolicyRandom PoolNewParamsLoadSheddingDefaultPolicy = "random"
+ PoolNewParamsLoadSheddingDefaultPolicyHash PoolNewParamsLoadSheddingDefaultPolicy = "hash"
+)
+
+// Only the hash policy is supported for existing sessions (to avoid exponential
+// decay).
+type PoolNewParamsLoadSheddingSessionPolicy string
+
+const (
+ PoolNewParamsLoadSheddingSessionPolicyHash PoolNewParamsLoadSheddingSessionPolicy = "hash"
+)
+
+// Filter pool and origin health notifications by resource type or health status.
+// Use null to reset.
+type PoolNewParamsNotificationFilter struct {
+ // Filter options for a particular resource type (pool or origin). Use null to
+ // reset.
+ Origin param.Field[PoolNewParamsNotificationFilterOrigin] `json:"origin"`
+ // Filter options for a particular resource type (pool or origin). Use null to
+ // reset.
+ Pool param.Field[PoolNewParamsNotificationFilterPool] `json:"pool"`
+}
+
+func (r PoolNewParamsNotificationFilter) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Filter options for a particular resource type (pool or origin). Use null to
+// reset.
+type PoolNewParamsNotificationFilterOrigin struct {
+ // If set true, disable notifications for this type of resource (pool or origin).
+ Disable param.Field[bool] `json:"disable"`
+ // If present, send notifications only for this health status (e.g. false for only
+ // DOWN events). Use null to reset (all events).
+ Healthy param.Field[bool] `json:"healthy"`
+}
+
+func (r PoolNewParamsNotificationFilterOrigin) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Filter options for a particular resource type (pool or origin). Use null to
+// reset.
+type PoolNewParamsNotificationFilterPool struct {
+ // If set true, disable notifications for this type of resource (pool or origin).
+ Disable param.Field[bool] `json:"disable"`
+ // If present, send notifications only for this health status (e.g. false for only
+ // DOWN events). Use null to reset (all events).
+ Healthy param.Field[bool] `json:"healthy"`
+}
+
+func (r PoolNewParamsNotificationFilterPool) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Configures origin steering for the pool. Controls how origins are selected for
+// new sessions and traffic without session affinity.
+type PoolNewParamsOriginSteering struct {
+ // The type of origin steering policy to use.
+ //
+ // - `"random"`: Select an origin randomly.
+ // - `"hash"`: Select an origin by computing a hash over the CF-Connecting-IP
+ // address.
+ // - `"least_outstanding_requests"`: Select an origin by taking into consideration
+ // origin weights, as well as each origin's number of outstanding requests.
+ // Origins with more pending requests are weighted proportionately less relative
+ // to others.
+ // - `"least_connections"`: Select an origin by taking into consideration origin
+ // weights, as well as each origin's number of open connections. Origins with
+ // more open connections are weighted proportionately less relative to others.
+ // Supported for HTTP/1 and HTTP/2 connections.
+ Policy param.Field[PoolNewParamsOriginSteeringPolicy] `json:"policy"`
+}
+
+func (r PoolNewParamsOriginSteering) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The type of origin steering policy to use.
+//
+// - `"random"`: Select an origin randomly.
+// - `"hash"`: Select an origin by computing a hash over the CF-Connecting-IP
+// address.
+// - `"least_outstanding_requests"`: Select an origin by taking into consideration
+// origin weights, as well as each origin's number of outstanding requests.
+// Origins with more pending requests are weighted proportionately less relative
+// to others.
+// - `"least_connections"`: Select an origin by taking into consideration origin
+// weights, as well as each origin's number of open connections. Origins with
+// more open connections are weighted proportionately less relative to others.
+// Supported for HTTP/1 and HTTP/2 connections.
+type PoolNewParamsOriginSteeringPolicy string
+
+const (
+ PoolNewParamsOriginSteeringPolicyRandom PoolNewParamsOriginSteeringPolicy = "random"
+ PoolNewParamsOriginSteeringPolicyHash PoolNewParamsOriginSteeringPolicy = "hash"
+ PoolNewParamsOriginSteeringPolicyLeastOutstandingRequests PoolNewParamsOriginSteeringPolicy = "least_outstanding_requests"
+ PoolNewParamsOriginSteeringPolicyLeastConnections PoolNewParamsOriginSteeringPolicy = "least_connections"
+)
+
+type PoolNewResponseEnvelope struct {
+ Errors []PoolNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []PoolNewResponseEnvelopeMessages `json:"messages,required"`
+ Result user.LoadBalancingPool `json:"result,required"`
+ // Whether the API call was successful
+ Success PoolNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON poolNewResponseEnvelopeJSON `json:"-"`
+}
+
+// poolNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [PoolNewResponseEnvelope]
+type poolNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PoolNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r poolNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type PoolNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON poolNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// poolNewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [PoolNewResponseEnvelopeErrors]
+type poolNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PoolNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r poolNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type PoolNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON poolNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// poolNewResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [PoolNewResponseEnvelopeMessages]
+type poolNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PoolNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r poolNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type PoolNewResponseEnvelopeSuccess bool
+
+const (
+ PoolNewResponseEnvelopeSuccessTrue PoolNewResponseEnvelopeSuccess = true
+)
+
+type PoolUpdateParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ // A short name (tag) for the pool. Only alphanumeric characters, hyphens, and
+ // underscores are allowed.
+ Name param.Field[string] `json:"name,required"`
+ // The list of origins within this pool. Traffic directed at this pool is balanced
+ // across all currently healthy origins, provided the pool itself is healthy.
+ Origins param.Field[[]PoolUpdateParamsOrigin] `json:"origins,required"`
+ // A list of regions from which to run health checks. Null means every Cloudflare
+ // data center.
+ CheckRegions param.Field[[]PoolUpdateParamsCheckRegion] `json:"check_regions"`
+ // A human-readable description of the pool.
+ Description param.Field[string] `json:"description"`
+ // Whether to enable (the default) or disable this pool. Disabled pools will not
+ // receive traffic and are excluded from health checks. Disabling a pool will cause
+ // any load balancers using it to failover to the next pool (if any).
+ Enabled param.Field[bool] `json:"enabled"`
+ // The latitude of the data center containing the origins used in this pool in
+ // decimal degrees. If this is set, longitude must also be set.
+ Latitude param.Field[float64] `json:"latitude"`
+ // Configures load shedding policies and percentages for the pool.
+ LoadShedding param.Field[PoolUpdateParamsLoadShedding] `json:"load_shedding"`
+ // The longitude of the data center containing the origins used in this pool in
+ // decimal degrees. If this is set, latitude must also be set.
+ Longitude param.Field[float64] `json:"longitude"`
+ // The minimum number of origins that must be healthy for this pool to serve
+ // traffic. If the number of healthy origins falls below this number, the pool will
+ // be marked unhealthy and will failover to the next available pool.
+ MinimumOrigins param.Field[int64] `json:"minimum_origins"`
+ // The ID of the Monitor to use for checking the health of origins within this
+ // pool.
+ Monitor param.Field[interface{}] `json:"monitor"`
+ // This field is now deprecated. It has been moved to Cloudflare's Centralized
+ // Notification service
+ // https://developers.cloudflare.com/fundamentals/notifications/. The email address
+ // to send health status notifications to. This can be an individual mailbox or a
+ // mailing list. Multiple emails can be supplied as a comma delimited list.
+ NotificationEmail param.Field[string] `json:"notification_email"`
+ // Filter pool and origin health notifications by resource type or health status.
+ // Use null to reset.
+ NotificationFilter param.Field[PoolUpdateParamsNotificationFilter] `json:"notification_filter"`
+ // Configures origin steering for the pool. Controls how origins are selected for
+ // new sessions and traffic without session affinity.
+ OriginSteering param.Field[PoolUpdateParamsOriginSteering] `json:"origin_steering"`
+}
+
+func (r PoolUpdateParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type PoolUpdateParamsOrigin struct {
+ // The IP address (IPv4 or IPv6) of the origin, or its publicly addressable
+ // hostname. Hostnames entered here should resolve directly to the origin, and not
+ // be a hostname proxied by Cloudflare. To set an internal/reserved address,
+ // virtual_network_id must also be set.
+ Address param.Field[string] `json:"address"`
+ // Whether to enable (the default) this origin within the pool. Disabled origins
+ // will not receive traffic and are excluded from health checks. The origin will
+ // only be disabled for the current pool.
+ Enabled param.Field[bool] `json:"enabled"`
+ // The request header is used to pass additional information with an HTTP request.
+ // Currently supported header is 'Host'.
+ Header param.Field[PoolUpdateParamsOriginsHeader] `json:"header"`
+ // A human-identifiable name for the origin.
+ Name param.Field[string] `json:"name"`
+ // The virtual network subnet ID the origin belongs in. Virtual network must also
+ // belong to the account.
+ VirtualNetworkID param.Field[string] `json:"virtual_network_id"`
+ // The weight of this origin relative to other origins in the pool. Based on the
+ // configured weight the total traffic is distributed among origins within the
+ // pool.
+ //
+ // - `origin_steering.policy="least_outstanding_requests"`: Use weight to scale the
+ // origin's outstanding requests.
+ // - `origin_steering.policy="least_connections"`: Use weight to scale the origin's
+ // open connections.
+ Weight param.Field[float64] `json:"weight"`
+}
+
+func (r PoolUpdateParamsOrigin) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The request header is used to pass additional information with an HTTP request.
+// Currently supported header is 'Host'.
+type PoolUpdateParamsOriginsHeader struct {
+ // The 'Host' header allows to override the hostname set in the HTTP request.
+ // Current support is 1 'Host' header override per origin.
+ Host param.Field[[]string] `json:"Host"`
+}
+
+func (r PoolUpdateParamsOriginsHeader) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// WNAM: Western North America, ENAM: Eastern North America, WEU: Western Europe,
+// EEU: Eastern Europe, NSAM: Northern South America, SSAM: Southern South America,
+// OC: Oceania, ME: Middle East, NAF: North Africa, SAF: South Africa, SAS:
+// Southern Asia, SEAS: South East Asia, NEAS: North East Asia, ALL_REGIONS: all
+// regions (ENTERPRISE customers only).
+type PoolUpdateParamsCheckRegion string
+
+const (
+ PoolUpdateParamsCheckRegionWnam PoolUpdateParamsCheckRegion = "WNAM"
+ PoolUpdateParamsCheckRegionEnam PoolUpdateParamsCheckRegion = "ENAM"
+ PoolUpdateParamsCheckRegionWeu PoolUpdateParamsCheckRegion = "WEU"
+ PoolUpdateParamsCheckRegionEeu PoolUpdateParamsCheckRegion = "EEU"
+ PoolUpdateParamsCheckRegionNsam PoolUpdateParamsCheckRegion = "NSAM"
+ PoolUpdateParamsCheckRegionSsam PoolUpdateParamsCheckRegion = "SSAM"
+ PoolUpdateParamsCheckRegionOc PoolUpdateParamsCheckRegion = "OC"
+ PoolUpdateParamsCheckRegionMe PoolUpdateParamsCheckRegion = "ME"
+ PoolUpdateParamsCheckRegionNaf PoolUpdateParamsCheckRegion = "NAF"
+ PoolUpdateParamsCheckRegionSaf PoolUpdateParamsCheckRegion = "SAF"
+ PoolUpdateParamsCheckRegionSas PoolUpdateParamsCheckRegion = "SAS"
+ PoolUpdateParamsCheckRegionSeas PoolUpdateParamsCheckRegion = "SEAS"
+ PoolUpdateParamsCheckRegionNeas PoolUpdateParamsCheckRegion = "NEAS"
+ PoolUpdateParamsCheckRegionAllRegions PoolUpdateParamsCheckRegion = "ALL_REGIONS"
+)
+
+// Configures load shedding policies and percentages for the pool.
+type PoolUpdateParamsLoadShedding struct {
+ // The percent of traffic to shed from the pool, according to the default policy.
+ // Applies to new sessions and traffic without session affinity.
+ DefaultPercent param.Field[float64] `json:"default_percent"`
+ // The default policy to use when load shedding. A random policy randomly sheds a
+ // given percent of requests. A hash policy computes a hash over the
+ // CF-Connecting-IP address and sheds all requests originating from a percent of
+ // IPs.
+ DefaultPolicy param.Field[PoolUpdateParamsLoadSheddingDefaultPolicy] `json:"default_policy"`
+ // The percent of existing sessions to shed from the pool, according to the session
+ // policy.
+ SessionPercent param.Field[float64] `json:"session_percent"`
+ // Only the hash policy is supported for existing sessions (to avoid exponential
+ // decay).
+ SessionPolicy param.Field[PoolUpdateParamsLoadSheddingSessionPolicy] `json:"session_policy"`
+}
+
+func (r PoolUpdateParamsLoadShedding) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The default policy to use when load shedding. A random policy randomly sheds a
+// given percent of requests. A hash policy computes a hash over the
+// CF-Connecting-IP address and sheds all requests originating from a percent of
+// IPs.
+type PoolUpdateParamsLoadSheddingDefaultPolicy string
+
+const (
+ PoolUpdateParamsLoadSheddingDefaultPolicyRandom PoolUpdateParamsLoadSheddingDefaultPolicy = "random"
+ PoolUpdateParamsLoadSheddingDefaultPolicyHash PoolUpdateParamsLoadSheddingDefaultPolicy = "hash"
+)
+
+// Only the hash policy is supported for existing sessions (to avoid exponential
+// decay).
+type PoolUpdateParamsLoadSheddingSessionPolicy string
+
+const (
+ PoolUpdateParamsLoadSheddingSessionPolicyHash PoolUpdateParamsLoadSheddingSessionPolicy = "hash"
+)
+
+// Filter pool and origin health notifications by resource type or health status.
+// Use null to reset.
+type PoolUpdateParamsNotificationFilter struct {
+ // Filter options for a particular resource type (pool or origin). Use null to
+ // reset.
+ Origin param.Field[PoolUpdateParamsNotificationFilterOrigin] `json:"origin"`
+ // Filter options for a particular resource type (pool or origin). Use null to
+ // reset.
+ Pool param.Field[PoolUpdateParamsNotificationFilterPool] `json:"pool"`
+}
+
+func (r PoolUpdateParamsNotificationFilter) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Filter options for a particular resource type (pool or origin). Use null to
+// reset.
+type PoolUpdateParamsNotificationFilterOrigin struct {
+ // If set true, disable notifications for this type of resource (pool or origin).
+ Disable param.Field[bool] `json:"disable"`
+ // If present, send notifications only for this health status (e.g. false for only
+ // DOWN events). Use null to reset (all events).
+ Healthy param.Field[bool] `json:"healthy"`
+}
+
+func (r PoolUpdateParamsNotificationFilterOrigin) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Filter options for a particular resource type (pool or origin). Use null to
+// reset.
+type PoolUpdateParamsNotificationFilterPool struct {
+ // If set true, disable notifications for this type of resource (pool or origin).
+ Disable param.Field[bool] `json:"disable"`
+ // If present, send notifications only for this health status (e.g. false for only
+ // DOWN events). Use null to reset (all events).
+ Healthy param.Field[bool] `json:"healthy"`
+}
+
+func (r PoolUpdateParamsNotificationFilterPool) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Configures origin steering for the pool. Controls how origins are selected for
+// new sessions and traffic without session affinity.
+type PoolUpdateParamsOriginSteering struct {
+ // The type of origin steering policy to use.
+ //
+ // - `"random"`: Select an origin randomly.
+ // - `"hash"`: Select an origin by computing a hash over the CF-Connecting-IP
+ // address.
+ // - `"least_outstanding_requests"`: Select an origin by taking into consideration
+ // origin weights, as well as each origin's number of outstanding requests.
+ // Origins with more pending requests are weighted proportionately less relative
+ // to others.
+ // - `"least_connections"`: Select an origin by taking into consideration origin
+ // weights, as well as each origin's number of open connections. Origins with
+ // more open connections are weighted proportionately less relative to others.
+ // Supported for HTTP/1 and HTTP/2 connections.
+ Policy param.Field[PoolUpdateParamsOriginSteeringPolicy] `json:"policy"`
+}
+
+func (r PoolUpdateParamsOriginSteering) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The type of origin steering policy to use.
+//
+// - `"random"`: Select an origin randomly.
+// - `"hash"`: Select an origin by computing a hash over the CF-Connecting-IP
+// address.
+// - `"least_outstanding_requests"`: Select an origin by taking into consideration
+// origin weights, as well as each origin's number of outstanding requests.
+// Origins with more pending requests are weighted proportionately less relative
+// to others.
+// - `"least_connections"`: Select an origin by taking into consideration origin
+// weights, as well as each origin's number of open connections. Origins with
+// more open connections are weighted proportionately less relative to others.
+// Supported for HTTP/1 and HTTP/2 connections.
+type PoolUpdateParamsOriginSteeringPolicy string
+
+const (
+ PoolUpdateParamsOriginSteeringPolicyRandom PoolUpdateParamsOriginSteeringPolicy = "random"
+ PoolUpdateParamsOriginSteeringPolicyHash PoolUpdateParamsOriginSteeringPolicy = "hash"
+ PoolUpdateParamsOriginSteeringPolicyLeastOutstandingRequests PoolUpdateParamsOriginSteeringPolicy = "least_outstanding_requests"
+ PoolUpdateParamsOriginSteeringPolicyLeastConnections PoolUpdateParamsOriginSteeringPolicy = "least_connections"
+)
+
+type PoolUpdateResponseEnvelope struct {
+ Errors []PoolUpdateResponseEnvelopeErrors `json:"errors,required"`
+ Messages []PoolUpdateResponseEnvelopeMessages `json:"messages,required"`
+ Result user.LoadBalancingPool `json:"result,required"`
+ // Whether the API call was successful
+ Success PoolUpdateResponseEnvelopeSuccess `json:"success,required"`
+ JSON poolUpdateResponseEnvelopeJSON `json:"-"`
+}
+
+// poolUpdateResponseEnvelopeJSON contains the JSON metadata for the struct
+// [PoolUpdateResponseEnvelope]
+type poolUpdateResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PoolUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r poolUpdateResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type PoolUpdateResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON poolUpdateResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// poolUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [PoolUpdateResponseEnvelopeErrors]
+type poolUpdateResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PoolUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r poolUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type PoolUpdateResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON poolUpdateResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// poolUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [PoolUpdateResponseEnvelopeMessages]
+type poolUpdateResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PoolUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r poolUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type PoolUpdateResponseEnvelopeSuccess bool
+
+const (
+ PoolUpdateResponseEnvelopeSuccessTrue PoolUpdateResponseEnvelopeSuccess = true
+)
+
+type PoolListParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ // The ID of the Monitor to use for checking the health of origins within this
+ // pool.
+ Monitor param.Field[interface{}] `query:"monitor"`
+}
+
+// URLQuery serializes [PoolListParams]'s query parameters as `url.Values`.
+func (r PoolListParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type PoolListResponseEnvelope struct {
+ Errors []PoolListResponseEnvelopeErrors `json:"errors,required"`
+ Messages []PoolListResponseEnvelopeMessages `json:"messages,required"`
+ Result []user.LoadBalancingPool `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success PoolListResponseEnvelopeSuccess `json:"success,required"`
+ ResultInfo PoolListResponseEnvelopeResultInfo `json:"result_info"`
+ JSON poolListResponseEnvelopeJSON `json:"-"`
+}
+
+// poolListResponseEnvelopeJSON contains the JSON metadata for the struct
+// [PoolListResponseEnvelope]
+type poolListResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ ResultInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PoolListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r poolListResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type PoolListResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON poolListResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// poolListResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [PoolListResponseEnvelopeErrors]
+type poolListResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PoolListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r poolListResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type PoolListResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON poolListResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// poolListResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [PoolListResponseEnvelopeMessages]
+type poolListResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PoolListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r poolListResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type PoolListResponseEnvelopeSuccess bool
+
+const (
+ PoolListResponseEnvelopeSuccessTrue PoolListResponseEnvelopeSuccess = true
+)
+
+type PoolListResponseEnvelopeResultInfo struct {
+ // Total number of results for the requested service
+ Count float64 `json:"count"`
+ // Current page within paginated list of results
+ Page float64 `json:"page"`
+ // Number of results per page of results
+ PerPage float64 `json:"per_page"`
+ // Total results available without any search parameters
+ TotalCount float64 `json:"total_count"`
+ JSON poolListResponseEnvelopeResultInfoJSON `json:"-"`
+}
+
+// poolListResponseEnvelopeResultInfoJSON contains the JSON metadata for the struct
+// [PoolListResponseEnvelopeResultInfo]
+type poolListResponseEnvelopeResultInfoJSON struct {
+ Count apijson.Field
+ Page apijson.Field
+ PerPage apijson.Field
+ TotalCount apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PoolListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r poolListResponseEnvelopeResultInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type PoolDeleteParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type PoolDeleteResponseEnvelope struct {
+ Errors []PoolDeleteResponseEnvelopeErrors `json:"errors,required"`
+ Messages []PoolDeleteResponseEnvelopeMessages `json:"messages,required"`
+ Result PoolDeleteResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success PoolDeleteResponseEnvelopeSuccess `json:"success,required"`
+ JSON poolDeleteResponseEnvelopeJSON `json:"-"`
+}
+
+// poolDeleteResponseEnvelopeJSON contains the JSON metadata for the struct
+// [PoolDeleteResponseEnvelope]
+type poolDeleteResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PoolDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r poolDeleteResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type PoolDeleteResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON poolDeleteResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// poolDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [PoolDeleteResponseEnvelopeErrors]
+type poolDeleteResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PoolDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r poolDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type PoolDeleteResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON poolDeleteResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// poolDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [PoolDeleteResponseEnvelopeMessages]
+type poolDeleteResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PoolDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r poolDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type PoolDeleteResponseEnvelopeSuccess bool
+
+const (
+ PoolDeleteResponseEnvelopeSuccessTrue PoolDeleteResponseEnvelopeSuccess = true
+)
+
+type PoolEditParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ // A list of regions from which to run health checks. Null means every Cloudflare
+ // data center.
+ CheckRegions param.Field[[]PoolEditParamsCheckRegion] `json:"check_regions"`
+ // A human-readable description of the pool.
+ Description param.Field[string] `json:"description"`
+ // Whether to enable (the default) or disable this pool. Disabled pools will not
+ // receive traffic and are excluded from health checks. Disabling a pool will cause
+ // any load balancers using it to failover to the next pool (if any).
+ Enabled param.Field[bool] `json:"enabled"`
+ // The latitude of the data center containing the origins used in this pool in
+ // decimal degrees. If this is set, longitude must also be set.
+ Latitude param.Field[float64] `json:"latitude"`
+ // Configures load shedding policies and percentages for the pool.
+ LoadShedding param.Field[PoolEditParamsLoadShedding] `json:"load_shedding"`
+ // The longitude of the data center containing the origins used in this pool in
+ // decimal degrees. If this is set, latitude must also be set.
+ Longitude param.Field[float64] `json:"longitude"`
+ // The minimum number of origins that must be healthy for this pool to serve
+ // traffic. If the number of healthy origins falls below this number, the pool will
+ // be marked unhealthy and will failover to the next available pool.
+ MinimumOrigins param.Field[int64] `json:"minimum_origins"`
+ // The ID of the Monitor to use for checking the health of origins within this
+ // pool.
+ Monitor param.Field[interface{}] `json:"monitor"`
+ // A short name (tag) for the pool. Only alphanumeric characters, hyphens, and
+ // underscores are allowed.
+ Name param.Field[string] `json:"name"`
+ // This field is now deprecated. It has been moved to Cloudflare's Centralized
+ // Notification service
+ // https://developers.cloudflare.com/fundamentals/notifications/. The email address
+ // to send health status notifications to. This can be an individual mailbox or a
+ // mailing list. Multiple emails can be supplied as a comma delimited list.
+ NotificationEmail param.Field[string] `json:"notification_email"`
+ // Filter pool and origin health notifications by resource type or health status.
+ // Use null to reset.
+ NotificationFilter param.Field[PoolEditParamsNotificationFilter] `json:"notification_filter"`
+ // Configures origin steering for the pool. Controls how origins are selected for
+ // new sessions and traffic without session affinity.
+ OriginSteering param.Field[PoolEditParamsOriginSteering] `json:"origin_steering"`
+ // The list of origins within this pool. Traffic directed at this pool is balanced
+ // across all currently healthy origins, provided the pool itself is healthy.
+ Origins param.Field[[]PoolEditParamsOrigin] `json:"origins"`
+}
+
+func (r PoolEditParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// WNAM: Western North America, ENAM: Eastern North America, WEU: Western Europe,
+// EEU: Eastern Europe, NSAM: Northern South America, SSAM: Southern South America,
+// OC: Oceania, ME: Middle East, NAF: North Africa, SAF: South Africa, SAS:
+// Southern Asia, SEAS: South East Asia, NEAS: North East Asia, ALL_REGIONS: all
+// regions (ENTERPRISE customers only).
+type PoolEditParamsCheckRegion string
+
+const (
+ PoolEditParamsCheckRegionWnam PoolEditParamsCheckRegion = "WNAM"
+ PoolEditParamsCheckRegionEnam PoolEditParamsCheckRegion = "ENAM"
+ PoolEditParamsCheckRegionWeu PoolEditParamsCheckRegion = "WEU"
+ PoolEditParamsCheckRegionEeu PoolEditParamsCheckRegion = "EEU"
+ PoolEditParamsCheckRegionNsam PoolEditParamsCheckRegion = "NSAM"
+ PoolEditParamsCheckRegionSsam PoolEditParamsCheckRegion = "SSAM"
+ PoolEditParamsCheckRegionOc PoolEditParamsCheckRegion = "OC"
+ PoolEditParamsCheckRegionMe PoolEditParamsCheckRegion = "ME"
+ PoolEditParamsCheckRegionNaf PoolEditParamsCheckRegion = "NAF"
+ PoolEditParamsCheckRegionSaf PoolEditParamsCheckRegion = "SAF"
+ PoolEditParamsCheckRegionSas PoolEditParamsCheckRegion = "SAS"
+ PoolEditParamsCheckRegionSeas PoolEditParamsCheckRegion = "SEAS"
+ PoolEditParamsCheckRegionNeas PoolEditParamsCheckRegion = "NEAS"
+ PoolEditParamsCheckRegionAllRegions PoolEditParamsCheckRegion = "ALL_REGIONS"
+)
+
+// Configures load shedding policies and percentages for the pool.
+type PoolEditParamsLoadShedding struct {
+ // The percent of traffic to shed from the pool, according to the default policy.
+ // Applies to new sessions and traffic without session affinity.
+ DefaultPercent param.Field[float64] `json:"default_percent"`
+ // The default policy to use when load shedding. A random policy randomly sheds a
+ // given percent of requests. A hash policy computes a hash over the
+ // CF-Connecting-IP address and sheds all requests originating from a percent of
+ // IPs.
+ DefaultPolicy param.Field[PoolEditParamsLoadSheddingDefaultPolicy] `json:"default_policy"`
+ // The percent of existing sessions to shed from the pool, according to the session
+ // policy.
+ SessionPercent param.Field[float64] `json:"session_percent"`
+ // Only the hash policy is supported for existing sessions (to avoid exponential
+ // decay).
+ SessionPolicy param.Field[PoolEditParamsLoadSheddingSessionPolicy] `json:"session_policy"`
+}
+
+func (r PoolEditParamsLoadShedding) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The default policy to use when load shedding. A random policy randomly sheds a
+// given percent of requests. A hash policy computes a hash over the
+// CF-Connecting-IP address and sheds all requests originating from a percent of
+// IPs.
+type PoolEditParamsLoadSheddingDefaultPolicy string
+
+const (
+ PoolEditParamsLoadSheddingDefaultPolicyRandom PoolEditParamsLoadSheddingDefaultPolicy = "random"
+ PoolEditParamsLoadSheddingDefaultPolicyHash PoolEditParamsLoadSheddingDefaultPolicy = "hash"
+)
+
+// Only the hash policy is supported for existing sessions (to avoid exponential
+// decay).
+type PoolEditParamsLoadSheddingSessionPolicy string
+
+const (
+ PoolEditParamsLoadSheddingSessionPolicyHash PoolEditParamsLoadSheddingSessionPolicy = "hash"
+)
+
+// Filter pool and origin health notifications by resource type or health status.
+// Use null to reset.
+type PoolEditParamsNotificationFilter struct {
+ // Filter options for a particular resource type (pool or origin). Use null to
+ // reset.
+ Origin param.Field[PoolEditParamsNotificationFilterOrigin] `json:"origin"`
+ // Filter options for a particular resource type (pool or origin). Use null to
+ // reset.
+ Pool param.Field[PoolEditParamsNotificationFilterPool] `json:"pool"`
+}
+
+func (r PoolEditParamsNotificationFilter) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Filter options for a particular resource type (pool or origin). Use null to
+// reset.
+type PoolEditParamsNotificationFilterOrigin struct {
+ // If set true, disable notifications for this type of resource (pool or origin).
+ Disable param.Field[bool] `json:"disable"`
+ // If present, send notifications only for this health status (e.g. false for only
+ // DOWN events). Use null to reset (all events).
+ Healthy param.Field[bool] `json:"healthy"`
+}
+
+func (r PoolEditParamsNotificationFilterOrigin) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Filter options for a particular resource type (pool or origin). Use null to
+// reset.
+type PoolEditParamsNotificationFilterPool struct {
+ // If set true, disable notifications for this type of resource (pool or origin).
+ Disable param.Field[bool] `json:"disable"`
+ // If present, send notifications only for this health status (e.g. false for only
+ // DOWN events). Use null to reset (all events).
+ Healthy param.Field[bool] `json:"healthy"`
+}
+
+func (r PoolEditParamsNotificationFilterPool) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Configures origin steering for the pool. Controls how origins are selected for
+// new sessions and traffic without session affinity.
+type PoolEditParamsOriginSteering struct {
+ // The type of origin steering policy to use.
+ //
+ // - `"random"`: Select an origin randomly.
+ // - `"hash"`: Select an origin by computing a hash over the CF-Connecting-IP
+ // address.
+ // - `"least_outstanding_requests"`: Select an origin by taking into consideration
+ // origin weights, as well as each origin's number of outstanding requests.
+ // Origins with more pending requests are weighted proportionately less relative
+ // to others.
+ // - `"least_connections"`: Select an origin by taking into consideration origin
+ // weights, as well as each origin's number of open connections. Origins with
+ // more open connections are weighted proportionately less relative to others.
+ // Supported for HTTP/1 and HTTP/2 connections.
+ Policy param.Field[PoolEditParamsOriginSteeringPolicy] `json:"policy"`
+}
+
+func (r PoolEditParamsOriginSteering) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The type of origin steering policy to use.
+//
+// - `"random"`: Select an origin randomly.
+// - `"hash"`: Select an origin by computing a hash over the CF-Connecting-IP
+// address.
+// - `"least_outstanding_requests"`: Select an origin by taking into consideration
+// origin weights, as well as each origin's number of outstanding requests.
+// Origins with more pending requests are weighted proportionately less relative
+// to others.
+// - `"least_connections"`: Select an origin by taking into consideration origin
+// weights, as well as each origin's number of open connections. Origins with
+// more open connections are weighted proportionately less relative to others.
+// Supported for HTTP/1 and HTTP/2 connections.
+type PoolEditParamsOriginSteeringPolicy string
+
+const (
+ PoolEditParamsOriginSteeringPolicyRandom PoolEditParamsOriginSteeringPolicy = "random"
+ PoolEditParamsOriginSteeringPolicyHash PoolEditParamsOriginSteeringPolicy = "hash"
+ PoolEditParamsOriginSteeringPolicyLeastOutstandingRequests PoolEditParamsOriginSteeringPolicy = "least_outstanding_requests"
+ PoolEditParamsOriginSteeringPolicyLeastConnections PoolEditParamsOriginSteeringPolicy = "least_connections"
+)
+
+type PoolEditParamsOrigin struct {
+ // The IP address (IPv4 or IPv6) of the origin, or its publicly addressable
+ // hostname. Hostnames entered here should resolve directly to the origin, and not
+ // be a hostname proxied by Cloudflare. To set an internal/reserved address,
+ // virtual_network_id must also be set.
+ Address param.Field[string] `json:"address"`
+ // Whether to enable (the default) this origin within the pool. Disabled origins
+ // will not receive traffic and are excluded from health checks. The origin will
+ // only be disabled for the current pool.
+ Enabled param.Field[bool] `json:"enabled"`
+ // The request header is used to pass additional information with an HTTP request.
+ // Currently supported header is 'Host'.
+ Header param.Field[PoolEditParamsOriginsHeader] `json:"header"`
+ // A human-identifiable name for the origin.
+ Name param.Field[string] `json:"name"`
+ // The virtual network subnet ID the origin belongs in. Virtual network must also
+ // belong to the account.
+ VirtualNetworkID param.Field[string] `json:"virtual_network_id"`
+ // The weight of this origin relative to other origins in the pool. Based on the
+ // configured weight the total traffic is distributed among origins within the
+ // pool.
+ //
+ // - `origin_steering.policy="least_outstanding_requests"`: Use weight to scale the
+ // origin's outstanding requests.
+ // - `origin_steering.policy="least_connections"`: Use weight to scale the origin's
+ // open connections.
+ Weight param.Field[float64] `json:"weight"`
+}
+
+func (r PoolEditParamsOrigin) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The request header is used to pass additional information with an HTTP request.
+// Currently supported header is 'Host'.
+type PoolEditParamsOriginsHeader struct {
+ // The 'Host' header allows to override the hostname set in the HTTP request.
+ // Current support is 1 'Host' header override per origin.
+ Host param.Field[[]string] `json:"Host"`
+}
+
+func (r PoolEditParamsOriginsHeader) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type PoolEditResponseEnvelope struct {
+ Errors []PoolEditResponseEnvelopeErrors `json:"errors,required"`
+ Messages []PoolEditResponseEnvelopeMessages `json:"messages,required"`
+ Result user.LoadBalancingPool `json:"result,required"`
+ // Whether the API call was successful
+ Success PoolEditResponseEnvelopeSuccess `json:"success,required"`
+ JSON poolEditResponseEnvelopeJSON `json:"-"`
+}
+
+// poolEditResponseEnvelopeJSON contains the JSON metadata for the struct
+// [PoolEditResponseEnvelope]
+type poolEditResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PoolEditResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r poolEditResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type PoolEditResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON poolEditResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// poolEditResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [PoolEditResponseEnvelopeErrors]
+type poolEditResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PoolEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r poolEditResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type PoolEditResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON poolEditResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// poolEditResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [PoolEditResponseEnvelopeMessages]
+type poolEditResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PoolEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r poolEditResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type PoolEditResponseEnvelopeSuccess bool
+
+const (
+ PoolEditResponseEnvelopeSuccessTrue PoolEditResponseEnvelopeSuccess = true
+)
+
+type PoolGetParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type PoolGetResponseEnvelope struct {
+ Errors []PoolGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []PoolGetResponseEnvelopeMessages `json:"messages,required"`
+ Result user.LoadBalancingPool `json:"result,required"`
+ // Whether the API call was successful
+ Success PoolGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON poolGetResponseEnvelopeJSON `json:"-"`
+}
+
+// poolGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [PoolGetResponseEnvelope]
+type poolGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PoolGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r poolGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type PoolGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON poolGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// poolGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [PoolGetResponseEnvelopeErrors]
+type poolGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PoolGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r poolGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type PoolGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON poolGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// poolGetResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [PoolGetResponseEnvelopeMessages]
+type poolGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PoolGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r poolGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type PoolGetResponseEnvelopeSuccess bool
+
+const (
+ PoolGetResponseEnvelopeSuccessTrue PoolGetResponseEnvelopeSuccess = true
+)
diff --git a/load_balancers/pool_test.go b/load_balancers/pool_test.go
new file mode 100644
index 00000000000..32da1569d1e
--- /dev/null
+++ b/load_balancers/pool_test.go
@@ -0,0 +1,355 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package load_balancers_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/load_balancers"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestPoolNewWithOptionalParams(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"),
+ )
+ _, err := client.LoadBalancers.Pools.New(context.TODO(), load_balancers.PoolNewParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Name: cloudflare.F("primary-dc-1"),
+ Origins: cloudflare.F([]load_balancers.PoolNewParamsOrigin{{
+ Address: cloudflare.F("0.0.0.0"),
+ Enabled: cloudflare.F(true),
+ Header: cloudflare.F(load_balancers.PoolNewParamsOriginsHeader{
+ Host: cloudflare.F([]string{"example.com", "example.com", "example.com"}),
+ }),
+ Name: cloudflare.F("app-server-1"),
+ VirtualNetworkID: cloudflare.F("a5624d4e-044a-4ff0-b3e1-e2465353d4b4"),
+ Weight: cloudflare.F(0.600000),
+ }, {
+ Address: cloudflare.F("0.0.0.0"),
+ Enabled: cloudflare.F(true),
+ Header: cloudflare.F(load_balancers.PoolNewParamsOriginsHeader{
+ Host: cloudflare.F([]string{"example.com", "example.com", "example.com"}),
+ }),
+ Name: cloudflare.F("app-server-1"),
+ VirtualNetworkID: cloudflare.F("a5624d4e-044a-4ff0-b3e1-e2465353d4b4"),
+ Weight: cloudflare.F(0.600000),
+ }, {
+ Address: cloudflare.F("0.0.0.0"),
+ Enabled: cloudflare.F(true),
+ Header: cloudflare.F(load_balancers.PoolNewParamsOriginsHeader{
+ Host: cloudflare.F([]string{"example.com", "example.com", "example.com"}),
+ }),
+ Name: cloudflare.F("app-server-1"),
+ VirtualNetworkID: cloudflare.F("a5624d4e-044a-4ff0-b3e1-e2465353d4b4"),
+ Weight: cloudflare.F(0.600000),
+ }}),
+ Description: cloudflare.F("Primary data center - Provider XYZ"),
+ Enabled: cloudflare.F(false),
+ Latitude: cloudflare.F(0.000000),
+ LoadShedding: cloudflare.F(load_balancers.PoolNewParamsLoadShedding{
+ DefaultPercent: cloudflare.F(0.000000),
+ DefaultPolicy: cloudflare.F(load_balancers.PoolNewParamsLoadSheddingDefaultPolicyRandom),
+ SessionPercent: cloudflare.F(0.000000),
+ SessionPolicy: cloudflare.F(load_balancers.PoolNewParamsLoadSheddingSessionPolicyHash),
+ }),
+ Longitude: cloudflare.F(0.000000),
+ MinimumOrigins: cloudflare.F(int64(0)),
+ Monitor: cloudflare.F[any](map[string]interface{}{}),
+ NotificationEmail: cloudflare.F("someone@example.com,sometwo@example.com"),
+ NotificationFilter: cloudflare.F(load_balancers.PoolNewParamsNotificationFilter{
+ Origin: cloudflare.F(load_balancers.PoolNewParamsNotificationFilterOrigin{
+ Disable: cloudflare.F(true),
+ Healthy: cloudflare.F(true),
+ }),
+ Pool: cloudflare.F(load_balancers.PoolNewParamsNotificationFilterPool{
+ Disable: cloudflare.F(true),
+ Healthy: cloudflare.F(false),
+ }),
+ }),
+ OriginSteering: cloudflare.F(load_balancers.PoolNewParamsOriginSteering{
+ Policy: cloudflare.F(load_balancers.PoolNewParamsOriginSteeringPolicyRandom),
+ }),
+ })
+ 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())
+ }
+}
+
+func TestPoolUpdateWithOptionalParams(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"),
+ )
+ _, err := client.LoadBalancers.Pools.Update(
+ context.TODO(),
+ "17b5962d775c646f3f9725cbc7a53df4",
+ load_balancers.PoolUpdateParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Name: cloudflare.F("primary-dc-1"),
+ Origins: cloudflare.F([]load_balancers.PoolUpdateParamsOrigin{{
+ Address: cloudflare.F("0.0.0.0"),
+ Enabled: cloudflare.F(true),
+ Header: cloudflare.F(load_balancers.PoolUpdateParamsOriginsHeader{
+ Host: cloudflare.F([]string{"example.com", "example.com", "example.com"}),
+ }),
+ Name: cloudflare.F("app-server-1"),
+ VirtualNetworkID: cloudflare.F("a5624d4e-044a-4ff0-b3e1-e2465353d4b4"),
+ Weight: cloudflare.F(0.600000),
+ }, {
+ Address: cloudflare.F("0.0.0.0"),
+ Enabled: cloudflare.F(true),
+ Header: cloudflare.F(load_balancers.PoolUpdateParamsOriginsHeader{
+ Host: cloudflare.F([]string{"example.com", "example.com", "example.com"}),
+ }),
+ Name: cloudflare.F("app-server-1"),
+ VirtualNetworkID: cloudflare.F("a5624d4e-044a-4ff0-b3e1-e2465353d4b4"),
+ Weight: cloudflare.F(0.600000),
+ }, {
+ Address: cloudflare.F("0.0.0.0"),
+ Enabled: cloudflare.F(true),
+ Header: cloudflare.F(load_balancers.PoolUpdateParamsOriginsHeader{
+ Host: cloudflare.F([]string{"example.com", "example.com", "example.com"}),
+ }),
+ Name: cloudflare.F("app-server-1"),
+ VirtualNetworkID: cloudflare.F("a5624d4e-044a-4ff0-b3e1-e2465353d4b4"),
+ Weight: cloudflare.F(0.600000),
+ }}),
+ CheckRegions: cloudflare.F([]load_balancers.PoolUpdateParamsCheckRegion{load_balancers.PoolUpdateParamsCheckRegionWeu, load_balancers.PoolUpdateParamsCheckRegionEnam}),
+ Description: cloudflare.F("Primary data center - Provider XYZ"),
+ Enabled: cloudflare.F(false),
+ Latitude: cloudflare.F(0.000000),
+ LoadShedding: cloudflare.F(load_balancers.PoolUpdateParamsLoadShedding{
+ DefaultPercent: cloudflare.F(0.000000),
+ DefaultPolicy: cloudflare.F(load_balancers.PoolUpdateParamsLoadSheddingDefaultPolicyRandom),
+ SessionPercent: cloudflare.F(0.000000),
+ SessionPolicy: cloudflare.F(load_balancers.PoolUpdateParamsLoadSheddingSessionPolicyHash),
+ }),
+ Longitude: cloudflare.F(0.000000),
+ MinimumOrigins: cloudflare.F(int64(0)),
+ Monitor: cloudflare.F[any](map[string]interface{}{}),
+ NotificationEmail: cloudflare.F("someone@example.com,sometwo@example.com"),
+ NotificationFilter: cloudflare.F(load_balancers.PoolUpdateParamsNotificationFilter{
+ Origin: cloudflare.F(load_balancers.PoolUpdateParamsNotificationFilterOrigin{
+ Disable: cloudflare.F(true),
+ Healthy: cloudflare.F(true),
+ }),
+ Pool: cloudflare.F(load_balancers.PoolUpdateParamsNotificationFilterPool{
+ Disable: cloudflare.F(true),
+ Healthy: cloudflare.F(false),
+ }),
+ }),
+ OriginSteering: cloudflare.F(load_balancers.PoolUpdateParamsOriginSteering{
+ Policy: cloudflare.F(load_balancers.PoolUpdateParamsOriginSteeringPolicyRandom),
+ }),
+ },
+ )
+ 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())
+ }
+}
+
+func TestPoolListWithOptionalParams(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"),
+ )
+ _, err := client.LoadBalancers.Pools.List(context.TODO(), load_balancers.PoolListParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Monitor: cloudflare.F[any](map[string]interface{}{}),
+ })
+ 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())
+ }
+}
+
+func TestPoolDelete(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"),
+ )
+ _, err := client.LoadBalancers.Pools.Delete(
+ context.TODO(),
+ "17b5962d775c646f3f9725cbc7a53df4",
+ load_balancers.PoolDeleteParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestPoolEditWithOptionalParams(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"),
+ )
+ _, err := client.LoadBalancers.Pools.Edit(
+ context.TODO(),
+ "17b5962d775c646f3f9725cbc7a53df4",
+ load_balancers.PoolEditParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ CheckRegions: cloudflare.F([]load_balancers.PoolEditParamsCheckRegion{load_balancers.PoolEditParamsCheckRegionWeu, load_balancers.PoolEditParamsCheckRegionEnam}),
+ Description: cloudflare.F("Primary data center - Provider XYZ"),
+ Enabled: cloudflare.F(false),
+ Latitude: cloudflare.F(0.000000),
+ LoadShedding: cloudflare.F(load_balancers.PoolEditParamsLoadShedding{
+ DefaultPercent: cloudflare.F(0.000000),
+ DefaultPolicy: cloudflare.F(load_balancers.PoolEditParamsLoadSheddingDefaultPolicyRandom),
+ SessionPercent: cloudflare.F(0.000000),
+ SessionPolicy: cloudflare.F(load_balancers.PoolEditParamsLoadSheddingSessionPolicyHash),
+ }),
+ Longitude: cloudflare.F(0.000000),
+ MinimumOrigins: cloudflare.F(int64(0)),
+ Monitor: cloudflare.F[any](map[string]interface{}{}),
+ Name: cloudflare.F("primary-dc-1"),
+ NotificationEmail: cloudflare.F("someone@example.com,sometwo@example.com"),
+ NotificationFilter: cloudflare.F(load_balancers.PoolEditParamsNotificationFilter{
+ Origin: cloudflare.F(load_balancers.PoolEditParamsNotificationFilterOrigin{
+ Disable: cloudflare.F(true),
+ Healthy: cloudflare.F(true),
+ }),
+ Pool: cloudflare.F(load_balancers.PoolEditParamsNotificationFilterPool{
+ Disable: cloudflare.F(true),
+ Healthy: cloudflare.F(false),
+ }),
+ }),
+ OriginSteering: cloudflare.F(load_balancers.PoolEditParamsOriginSteering{
+ Policy: cloudflare.F(load_balancers.PoolEditParamsOriginSteeringPolicyRandom),
+ }),
+ Origins: cloudflare.F([]load_balancers.PoolEditParamsOrigin{{
+ Address: cloudflare.F("0.0.0.0"),
+ Enabled: cloudflare.F(true),
+ Header: cloudflare.F(load_balancers.PoolEditParamsOriginsHeader{
+ Host: cloudflare.F([]string{"example.com", "example.com", "example.com"}),
+ }),
+ Name: cloudflare.F("app-server-1"),
+ VirtualNetworkID: cloudflare.F("a5624d4e-044a-4ff0-b3e1-e2465353d4b4"),
+ Weight: cloudflare.F(0.600000),
+ }, {
+ Address: cloudflare.F("0.0.0.0"),
+ Enabled: cloudflare.F(true),
+ Header: cloudflare.F(load_balancers.PoolEditParamsOriginsHeader{
+ Host: cloudflare.F([]string{"example.com", "example.com", "example.com"}),
+ }),
+ Name: cloudflare.F("app-server-1"),
+ VirtualNetworkID: cloudflare.F("a5624d4e-044a-4ff0-b3e1-e2465353d4b4"),
+ Weight: cloudflare.F(0.600000),
+ }, {
+ Address: cloudflare.F("0.0.0.0"),
+ Enabled: cloudflare.F(true),
+ Header: cloudflare.F(load_balancers.PoolEditParamsOriginsHeader{
+ Host: cloudflare.F([]string{"example.com", "example.com", "example.com"}),
+ }),
+ Name: cloudflare.F("app-server-1"),
+ VirtualNetworkID: cloudflare.F("a5624d4e-044a-4ff0-b3e1-e2465353d4b4"),
+ Weight: cloudflare.F(0.600000),
+ }}),
+ },
+ )
+ 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())
+ }
+}
+
+func TestPoolGet(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"),
+ )
+ _, err := client.LoadBalancers.Pools.Get(
+ context.TODO(),
+ "17b5962d775c646f3f9725cbc7a53df4",
+ load_balancers.PoolGetParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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/load_balancers/poolhealth.go b/load_balancers/poolhealth.go
new file mode 100644
index 00000000000..8d94ae95890
--- /dev/null
+++ b/load_balancers/poolhealth.go
@@ -0,0 +1,345 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package load_balancers
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "reflect"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/tidwall/gjson"
+)
+
+// PoolHealthService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewPoolHealthService] method instead.
+type PoolHealthService struct {
+ Options []option.RequestOption
+}
+
+// NewPoolHealthService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewPoolHealthService(opts ...option.RequestOption) (r *PoolHealthService) {
+ r = &PoolHealthService{}
+ r.Options = opts
+ return
+}
+
+// Preview pool health using provided monitor details. The returned preview_id can
+// be used in the preview endpoint to retrieve the results.
+func (r *PoolHealthService) New(ctx context.Context, poolID string, params PoolHealthNewParams, opts ...option.RequestOption) (res *PoolHealthNewResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env PoolHealthNewResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/load_balancers/pools/%s/preview", params.AccountID, poolID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Fetch the latest pool health status for a single pool.
+func (r *PoolHealthService) Get(ctx context.Context, poolID string, query PoolHealthGetParams, opts ...option.RequestOption) (res *PoolHealthGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env PoolHealthGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/load_balancers/pools/%s/health", query.AccountID, poolID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type PoolHealthNewResponse struct {
+ // Monitored pool IDs mapped to their respective names.
+ Pools map[string]string `json:"pools"`
+ PreviewID string `json:"preview_id"`
+ JSON poolHealthNewResponseJSON `json:"-"`
+}
+
+// poolHealthNewResponseJSON contains the JSON metadata for the struct
+// [PoolHealthNewResponse]
+type poolHealthNewResponseJSON struct {
+ Pools apijson.Field
+ PreviewID apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PoolHealthNewResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r poolHealthNewResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+// A list of regions from which to run health checks. Null means every Cloudflare
+// data center.
+//
+// Union satisfied by [load_balancers.PoolHealthGetResponseUnknown] or
+// [shared.UnionString].
+type PoolHealthGetResponse interface {
+ ImplementsLoadBalancersPoolHealthGetResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*PoolHealthGetResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+type PoolHealthNewParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ // The expected HTTP response code or code range of the health check. This
+ // parameter is only valid for HTTP and HTTPS monitors.
+ ExpectedCodes param.Field[string] `json:"expected_codes,required"`
+ // Do not validate the certificate when monitor use HTTPS. This parameter is
+ // currently only valid for HTTP and HTTPS monitors.
+ AllowInsecure param.Field[bool] `json:"allow_insecure"`
+ // To be marked unhealthy the monitored origin must fail this healthcheck N
+ // consecutive times.
+ ConsecutiveDown param.Field[int64] `json:"consecutive_down"`
+ // To be marked healthy the monitored origin must pass this healthcheck N
+ // consecutive times.
+ ConsecutiveUp param.Field[int64] `json:"consecutive_up"`
+ // Object description.
+ Description param.Field[string] `json:"description"`
+ // A case-insensitive sub-string to look for in the response body. If this string
+ // is not found, the origin will be marked as unhealthy. This parameter is only
+ // valid for HTTP and HTTPS monitors.
+ ExpectedBody param.Field[string] `json:"expected_body"`
+ // Follow redirects if returned by the origin. This parameter is only valid for
+ // HTTP and HTTPS monitors.
+ FollowRedirects param.Field[bool] `json:"follow_redirects"`
+ // The HTTP request headers to send in the health check. It is recommended you set
+ // a Host header by default. The User-Agent header cannot be overridden. This
+ // parameter is only valid for HTTP and HTTPS monitors.
+ Header param.Field[interface{}] `json:"header"`
+ // The interval between each health check. Shorter intervals may improve failover
+ // time, but will increase load on the origins as we check from multiple locations.
+ Interval param.Field[int64] `json:"interval"`
+ // The method to use for the health check. This defaults to 'GET' for HTTP/HTTPS
+ // based checks and 'connection_established' for TCP based health checks.
+ Method param.Field[string] `json:"method"`
+ // The endpoint path you want to conduct a health check against. This parameter is
+ // only valid for HTTP and HTTPS monitors.
+ Path param.Field[string] `json:"path"`
+ // The port number to connect to for the health check. Required for TCP, UDP, and
+ // SMTP checks. HTTP and HTTPS checks should only define the port when using a
+ // non-standard port (HTTP: default 80, HTTPS: default 443).
+ Port param.Field[int64] `json:"port"`
+ // Assign this monitor to emulate the specified zone while probing. This parameter
+ // is only valid for HTTP and HTTPS monitors.
+ ProbeZone param.Field[string] `json:"probe_zone"`
+ // The number of retries to attempt in case of a timeout before marking the origin
+ // as unhealthy. Retries are attempted immediately.
+ Retries param.Field[int64] `json:"retries"`
+ // The timeout (in seconds) before marking the health check as failed.
+ Timeout param.Field[int64] `json:"timeout"`
+ // The protocol to use for the health check. Currently supported protocols are
+ // 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.
+ Type param.Field[PoolHealthNewParamsType] `json:"type"`
+}
+
+func (r PoolHealthNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The protocol to use for the health check. Currently supported protocols are
+// 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.
+type PoolHealthNewParamsType string
+
+const (
+ PoolHealthNewParamsTypeHTTP PoolHealthNewParamsType = "http"
+ PoolHealthNewParamsTypeHTTPS PoolHealthNewParamsType = "https"
+ PoolHealthNewParamsTypeTcp PoolHealthNewParamsType = "tcp"
+ PoolHealthNewParamsTypeUdpIcmp PoolHealthNewParamsType = "udp_icmp"
+ PoolHealthNewParamsTypeIcmpPing PoolHealthNewParamsType = "icmp_ping"
+ PoolHealthNewParamsTypeSmtp PoolHealthNewParamsType = "smtp"
+)
+
+type PoolHealthNewResponseEnvelope struct {
+ Errors []PoolHealthNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []PoolHealthNewResponseEnvelopeMessages `json:"messages,required"`
+ Result PoolHealthNewResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success PoolHealthNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON poolHealthNewResponseEnvelopeJSON `json:"-"`
+}
+
+// poolHealthNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [PoolHealthNewResponseEnvelope]
+type poolHealthNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PoolHealthNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r poolHealthNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type PoolHealthNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON poolHealthNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// poolHealthNewResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [PoolHealthNewResponseEnvelopeErrors]
+type poolHealthNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PoolHealthNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r poolHealthNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type PoolHealthNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON poolHealthNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// poolHealthNewResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [PoolHealthNewResponseEnvelopeMessages]
+type poolHealthNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PoolHealthNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r poolHealthNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type PoolHealthNewResponseEnvelopeSuccess bool
+
+const (
+ PoolHealthNewResponseEnvelopeSuccessTrue PoolHealthNewResponseEnvelopeSuccess = true
+)
+
+type PoolHealthGetParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type PoolHealthGetResponseEnvelope struct {
+ Errors []PoolHealthGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []PoolHealthGetResponseEnvelopeMessages `json:"messages,required"`
+ // A list of regions from which to run health checks. Null means every Cloudflare
+ // data center.
+ Result PoolHealthGetResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success PoolHealthGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON poolHealthGetResponseEnvelopeJSON `json:"-"`
+}
+
+// poolHealthGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [PoolHealthGetResponseEnvelope]
+type poolHealthGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PoolHealthGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r poolHealthGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type PoolHealthGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON poolHealthGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// poolHealthGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [PoolHealthGetResponseEnvelopeErrors]
+type poolHealthGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PoolHealthGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r poolHealthGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type PoolHealthGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON poolHealthGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// poolHealthGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [PoolHealthGetResponseEnvelopeMessages]
+type poolHealthGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PoolHealthGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r poolHealthGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type PoolHealthGetResponseEnvelopeSuccess bool
+
+const (
+ PoolHealthGetResponseEnvelopeSuccessTrue PoolHealthGetResponseEnvelopeSuccess = true
+)
diff --git a/load_balancers/poolhealth_test.go b/load_balancers/poolhealth_test.go
new file mode 100644
index 00000000000..430b18c2a80
--- /dev/null
+++ b/load_balancers/poolhealth_test.go
@@ -0,0 +1,98 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package load_balancers_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/load_balancers"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestPoolHealthNewWithOptionalParams(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"),
+ )
+ _, err := client.LoadBalancers.Pools.Health.New(
+ context.TODO(),
+ "17b5962d775c646f3f9725cbc7a53df4",
+ load_balancers.PoolHealthNewParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ ExpectedCodes: cloudflare.F("2xx"),
+ AllowInsecure: cloudflare.F(true),
+ ConsecutiveDown: cloudflare.F(int64(0)),
+ ConsecutiveUp: cloudflare.F(int64(0)),
+ Description: cloudflare.F("Login page monitor"),
+ ExpectedBody: cloudflare.F("alive"),
+ FollowRedirects: cloudflare.F(true),
+ Header: cloudflare.F[any](map[string]interface{}{
+ "Host": map[string]interface{}{
+ "0": "example.com",
+ },
+ "X-App-ID": map[string]interface{}{
+ "0": "abc123",
+ },
+ }),
+ Interval: cloudflare.F(int64(0)),
+ Method: cloudflare.F("GET"),
+ Path: cloudflare.F("/health"),
+ Port: cloudflare.F(int64(0)),
+ ProbeZone: cloudflare.F("example.com"),
+ Retries: cloudflare.F(int64(0)),
+ Timeout: cloudflare.F(int64(0)),
+ Type: cloudflare.F(load_balancers.PoolHealthNewParamsTypeHTTPS),
+ },
+ )
+ 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())
+ }
+}
+
+func TestPoolHealthGet(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"),
+ )
+ _, err := client.LoadBalancers.Pools.Health.Get(
+ context.TODO(),
+ "17b5962d775c646f3f9725cbc7a53df4",
+ load_balancers.PoolHealthGetParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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/load_balancers/poolreference.go b/load_balancers/poolreference.go
new file mode 100644
index 00000000000..8b84ec78254
--- /dev/null
+++ b/load_balancers/poolreference.go
@@ -0,0 +1,200 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package load_balancers
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// PoolReferenceService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewPoolReferenceService] method
+// instead.
+type PoolReferenceService struct {
+ Options []option.RequestOption
+}
+
+// NewPoolReferenceService generates a new service that applies the given options
+// to each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewPoolReferenceService(opts ...option.RequestOption) (r *PoolReferenceService) {
+ r = &PoolReferenceService{}
+ r.Options = opts
+ return
+}
+
+// Get the list of resources that reference the provided pool.
+func (r *PoolReferenceService) Get(ctx context.Context, poolID string, query PoolReferenceGetParams, opts ...option.RequestOption) (res *[]PoolReferenceGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env PoolReferenceGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/load_balancers/pools/%s/references", query.AccountID, poolID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type PoolReferenceGetResponse struct {
+ ReferenceType PoolReferenceGetResponseReferenceType `json:"reference_type"`
+ ResourceID string `json:"resource_id"`
+ ResourceName string `json:"resource_name"`
+ ResourceType string `json:"resource_type"`
+ JSON poolReferenceGetResponseJSON `json:"-"`
+}
+
+// poolReferenceGetResponseJSON contains the JSON metadata for the struct
+// [PoolReferenceGetResponse]
+type poolReferenceGetResponseJSON struct {
+ ReferenceType apijson.Field
+ ResourceID apijson.Field
+ ResourceName apijson.Field
+ ResourceType apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PoolReferenceGetResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r poolReferenceGetResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type PoolReferenceGetResponseReferenceType string
+
+const (
+ PoolReferenceGetResponseReferenceTypeStar PoolReferenceGetResponseReferenceType = "*"
+ PoolReferenceGetResponseReferenceTypeReferral PoolReferenceGetResponseReferenceType = "referral"
+ PoolReferenceGetResponseReferenceTypeReferrer PoolReferenceGetResponseReferenceType = "referrer"
+)
+
+type PoolReferenceGetParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type PoolReferenceGetResponseEnvelope struct {
+ Errors []PoolReferenceGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []PoolReferenceGetResponseEnvelopeMessages `json:"messages,required"`
+ // List of resources that reference a given pool.
+ Result []PoolReferenceGetResponse `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success PoolReferenceGetResponseEnvelopeSuccess `json:"success,required"`
+ ResultInfo PoolReferenceGetResponseEnvelopeResultInfo `json:"result_info"`
+ JSON poolReferenceGetResponseEnvelopeJSON `json:"-"`
+}
+
+// poolReferenceGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [PoolReferenceGetResponseEnvelope]
+type poolReferenceGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ ResultInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PoolReferenceGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r poolReferenceGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type PoolReferenceGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON poolReferenceGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// poolReferenceGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [PoolReferenceGetResponseEnvelopeErrors]
+type poolReferenceGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PoolReferenceGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r poolReferenceGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type PoolReferenceGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON poolReferenceGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// poolReferenceGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [PoolReferenceGetResponseEnvelopeMessages]
+type poolReferenceGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PoolReferenceGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r poolReferenceGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type PoolReferenceGetResponseEnvelopeSuccess bool
+
+const (
+ PoolReferenceGetResponseEnvelopeSuccessTrue PoolReferenceGetResponseEnvelopeSuccess = true
+)
+
+type PoolReferenceGetResponseEnvelopeResultInfo struct {
+ // Total number of results for the requested service
+ Count float64 `json:"count"`
+ // Current page within paginated list of results
+ Page float64 `json:"page"`
+ // Number of results per page of results
+ PerPage float64 `json:"per_page"`
+ // Total results available without any search parameters
+ TotalCount float64 `json:"total_count"`
+ JSON poolReferenceGetResponseEnvelopeResultInfoJSON `json:"-"`
+}
+
+// poolReferenceGetResponseEnvelopeResultInfoJSON contains the JSON metadata for
+// the struct [PoolReferenceGetResponseEnvelopeResultInfo]
+type poolReferenceGetResponseEnvelopeResultInfoJSON struct {
+ Count apijson.Field
+ Page apijson.Field
+ PerPage apijson.Field
+ TotalCount apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PoolReferenceGetResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r poolReferenceGetResponseEnvelopeResultInfoJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/load_balancers/poolreference_test.go b/load_balancers/poolreference_test.go
new file mode 100644
index 00000000000..c24ed0096eb
--- /dev/null
+++ b/load_balancers/poolreference_test.go
@@ -0,0 +1,45 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package load_balancers_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/load_balancers"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestPoolReferenceGet(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"),
+ )
+ _, err := client.LoadBalancers.Pools.References.Get(
+ context.TODO(),
+ "17b5962d775c646f3f9725cbc7a53df4",
+ load_balancers.PoolReferenceGetParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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/load_balancers/preview.go b/load_balancers/preview.go
new file mode 100644
index 00000000000..a86f5c57785
--- /dev/null
+++ b/load_balancers/preview.go
@@ -0,0 +1,132 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package load_balancers
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/user"
+)
+
+// PreviewService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewPreviewService] method instead.
+type PreviewService struct {
+ Options []option.RequestOption
+}
+
+// NewPreviewService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewPreviewService(opts ...option.RequestOption) (r *PreviewService) {
+ r = &PreviewService{}
+ r.Options = opts
+ return
+}
+
+// Get the result of a previous preview operation using the provided preview_id.
+func (r *PreviewService) Get(ctx context.Context, previewID interface{}, query PreviewGetParams, opts ...option.RequestOption) (res *user.LoadBalancingPreviewResult, err error) {
+ opts = append(r.Options[:], opts...)
+ var env PreviewGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/load_balancers/preview/%v", query.AccountID, previewID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type PreviewGetParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type PreviewGetResponseEnvelope struct {
+ Errors []PreviewGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []PreviewGetResponseEnvelopeMessages `json:"messages,required"`
+ // Resulting health data from a preview operation.
+ Result user.LoadBalancingPreviewResult `json:"result,required"`
+ // Whether the API call was successful
+ Success PreviewGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON previewGetResponseEnvelopeJSON `json:"-"`
+}
+
+// previewGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [PreviewGetResponseEnvelope]
+type previewGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PreviewGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r previewGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type PreviewGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON previewGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// previewGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [PreviewGetResponseEnvelopeErrors]
+type previewGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PreviewGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r previewGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type PreviewGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON previewGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// previewGetResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [PreviewGetResponseEnvelopeMessages]
+type previewGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PreviewGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r previewGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type PreviewGetResponseEnvelopeSuccess bool
+
+const (
+ PreviewGetResponseEnvelopeSuccessTrue PreviewGetResponseEnvelopeSuccess = true
+)
diff --git a/load_balancers/preview_test.go b/load_balancers/preview_test.go
new file mode 100644
index 00000000000..37e10158728
--- /dev/null
+++ b/load_balancers/preview_test.go
@@ -0,0 +1,45 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package load_balancers_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/load_balancers"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestPreviewGet(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"),
+ )
+ _, err := client.LoadBalancers.Previews.Get(
+ context.TODO(),
+ "p1aba936b94213e5b8dca0c0dbf1f9cc",
+ load_balancers.PreviewGetParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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/load_balancers/region.go b/load_balancers/region.go
new file mode 100644
index 00000000000..9b99a3cc738
--- /dev/null
+++ b/load_balancers/region.go
@@ -0,0 +1,308 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package load_balancers
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+ "reflect"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/tidwall/gjson"
+)
+
+// RegionService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewRegionService] method instead.
+type RegionService struct {
+ Options []option.RequestOption
+}
+
+// NewRegionService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewRegionService(opts ...option.RequestOption) (r *RegionService) {
+ r = &RegionService{}
+ r.Options = opts
+ return
+}
+
+// List all region mappings.
+func (r *RegionService) List(ctx context.Context, params RegionListParams, opts ...option.RequestOption) (res *RegionListResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RegionListResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/load_balancers/regions", params.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Get a single region mapping.
+func (r *RegionService) Get(ctx context.Context, regionID RegionGetParamsRegionID, query RegionGetParams, opts ...option.RequestOption) (res *RegionGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RegionGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/load_balancers/regions/%v", query.AccountID, regionID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Union satisfied by [load_balancers.RegionListResponseUnknown] or
+// [shared.UnionString].
+type RegionListResponse interface {
+ ImplementsLoadBalancersRegionListResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RegionListResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+// A list of countries and subdivisions mapped to a region.
+//
+// Union satisfied by [load_balancers.RegionGetResponseUnknown] or
+// [shared.UnionString].
+type RegionGetResponse interface {
+ ImplementsLoadBalancersRegionGetResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RegionGetResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+type RegionListParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ // Two-letter alpha-2 country code followed in ISO 3166-1.
+ CountryCodeA2 param.Field[string] `query:"country_code_a2"`
+ // Two-letter subdivision code followed in ISO 3166-2.
+ SubdivisionCode param.Field[string] `query:"subdivision_code"`
+ // Two-letter subdivision code followed in ISO 3166-2.
+ SubdivisionCodeA2 param.Field[string] `query:"subdivision_code_a2"`
+}
+
+// URLQuery serializes [RegionListParams]'s query parameters as `url.Values`.
+func (r RegionListParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type RegionListResponseEnvelope struct {
+ Errors []RegionListResponseEnvelopeErrors `json:"errors,required"`
+ Messages []RegionListResponseEnvelopeMessages `json:"messages,required"`
+ Result RegionListResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success RegionListResponseEnvelopeSuccess `json:"success,required"`
+ JSON regionListResponseEnvelopeJSON `json:"-"`
+}
+
+// regionListResponseEnvelopeJSON contains the JSON metadata for the struct
+// [RegionListResponseEnvelope]
+type regionListResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RegionListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r regionListResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type RegionListResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON regionListResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// regionListResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [RegionListResponseEnvelopeErrors]
+type regionListResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RegionListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r regionListResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type RegionListResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON regionListResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// regionListResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [RegionListResponseEnvelopeMessages]
+type regionListResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RegionListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r regionListResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type RegionListResponseEnvelopeSuccess bool
+
+const (
+ RegionListResponseEnvelopeSuccessTrue RegionListResponseEnvelopeSuccess = true
+)
+
+type RegionGetParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+// A list of Cloudflare regions. WNAM: Western North America, ENAM: Eastern North
+// America, WEU: Western Europe, EEU: Eastern Europe, NSAM: Northern South America,
+// SSAM: Southern South America, OC: Oceania, ME: Middle East, NAF: North Africa,
+// SAF: South Africa, SAS: Southern Asia, SEAS: South East Asia, NEAS: North East
+// Asia).
+type RegionGetParamsRegionID string
+
+const (
+ RegionGetParamsRegionIDWnam RegionGetParamsRegionID = "WNAM"
+ RegionGetParamsRegionIDEnam RegionGetParamsRegionID = "ENAM"
+ RegionGetParamsRegionIDWeu RegionGetParamsRegionID = "WEU"
+ RegionGetParamsRegionIDEeu RegionGetParamsRegionID = "EEU"
+ RegionGetParamsRegionIDNsam RegionGetParamsRegionID = "NSAM"
+ RegionGetParamsRegionIDSsam RegionGetParamsRegionID = "SSAM"
+ RegionGetParamsRegionIDOc RegionGetParamsRegionID = "OC"
+ RegionGetParamsRegionIDMe RegionGetParamsRegionID = "ME"
+ RegionGetParamsRegionIDNaf RegionGetParamsRegionID = "NAF"
+ RegionGetParamsRegionIDSaf RegionGetParamsRegionID = "SAF"
+ RegionGetParamsRegionIDSas RegionGetParamsRegionID = "SAS"
+ RegionGetParamsRegionIDSeas RegionGetParamsRegionID = "SEAS"
+ RegionGetParamsRegionIDNeas RegionGetParamsRegionID = "NEAS"
+)
+
+type RegionGetResponseEnvelope struct {
+ Errors []RegionGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []RegionGetResponseEnvelopeMessages `json:"messages,required"`
+ // A list of countries and subdivisions mapped to a region.
+ Result RegionGetResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success RegionGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON regionGetResponseEnvelopeJSON `json:"-"`
+}
+
+// regionGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [RegionGetResponseEnvelope]
+type regionGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RegionGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r regionGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type RegionGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON regionGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// regionGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [RegionGetResponseEnvelopeErrors]
+type regionGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RegionGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r regionGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type RegionGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON regionGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// regionGetResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [RegionGetResponseEnvelopeMessages]
+type regionGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RegionGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r regionGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type RegionGetResponseEnvelopeSuccess bool
+
+const (
+ RegionGetResponseEnvelopeSuccessTrue RegionGetResponseEnvelopeSuccess = true
+)
diff --git a/load_balancers/region_test.go b/load_balancers/region_test.go
new file mode 100644
index 00000000000..c1ad0cc7f2c
--- /dev/null
+++ b/load_balancers/region_test.go
@@ -0,0 +1,74 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package load_balancers_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/load_balancers"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestRegionListWithOptionalParams(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"),
+ )
+ _, err := client.LoadBalancers.Regions.List(context.TODO(), load_balancers.RegionListParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ CountryCodeA2: cloudflare.F("US"),
+ SubdivisionCode: cloudflare.F("CA"),
+ SubdivisionCodeA2: cloudflare.F("CA"),
+ })
+ 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())
+ }
+}
+
+func TestRegionGet(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"),
+ )
+ _, err := client.LoadBalancers.Regions.Get(
+ context.TODO(),
+ load_balancers.RegionGetParamsRegionIDWnam,
+ load_balancers.RegionGetParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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/load_balancers/search.go b/load_balancers/search.go
new file mode 100644
index 00000000000..452aa1d0126
--- /dev/null
+++ b/load_balancers/search.go
@@ -0,0 +1,204 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package load_balancers
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// SearchService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewSearchService] method instead.
+type SearchService struct {
+ Options []option.RequestOption
+}
+
+// NewSearchService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewSearchService(opts ...option.RequestOption) (r *SearchService) {
+ r = &SearchService{}
+ r.Options = opts
+ return
+}
+
+// Search for Load Balancing resources.
+func (r *SearchService) Get(ctx context.Context, params SearchGetParams, opts ...option.RequestOption) (res *[]SearchGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env SearchGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/load_balancers/search", params.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type SearchGetResponse = interface{}
+
+type SearchGetParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ Page param.Field[interface{}] `query:"page"`
+ PerPage param.Field[interface{}] `query:"per_page"`
+ SearchParams param.Field[SearchGetParamsSearchParams] `query:"search_params"`
+}
+
+// URLQuery serializes [SearchGetParams]'s query parameters as `url.Values`.
+func (r SearchGetParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type SearchGetParamsSearchParams struct {
+ // Search query term.
+ Query param.Field[string] `query:"query"`
+ // The type of references to include ("\*" for all).
+ References param.Field[SearchGetParamsSearchParamsReferences] `query:"references"`
+}
+
+// URLQuery serializes [SearchGetParamsSearchParams]'s query parameters as
+// `url.Values`.
+func (r SearchGetParamsSearchParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// The type of references to include ("\*" for all).
+type SearchGetParamsSearchParamsReferences string
+
+const (
+ SearchGetParamsSearchParamsReferencesEmpty SearchGetParamsSearchParamsReferences = ""
+ SearchGetParamsSearchParamsReferencesStar SearchGetParamsSearchParamsReferences = "*"
+ SearchGetParamsSearchParamsReferencesReferral SearchGetParamsSearchParamsReferences = "referral"
+ SearchGetParamsSearchParamsReferencesReferrer SearchGetParamsSearchParamsReferences = "referrer"
+)
+
+type SearchGetResponseEnvelope struct {
+ Errors []SearchGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []SearchGetResponseEnvelopeMessages `json:"messages,required"`
+ Result []SearchGetResponse `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success SearchGetResponseEnvelopeSuccess `json:"success,required"`
+ ResultInfo SearchGetResponseEnvelopeResultInfo `json:"result_info"`
+ JSON searchGetResponseEnvelopeJSON `json:"-"`
+}
+
+// searchGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [SearchGetResponseEnvelope]
+type searchGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ ResultInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *SearchGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r searchGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type SearchGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON searchGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// searchGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [SearchGetResponseEnvelopeErrors]
+type searchGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *SearchGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r searchGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type SearchGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON searchGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// searchGetResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [SearchGetResponseEnvelopeMessages]
+type searchGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *SearchGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r searchGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type SearchGetResponseEnvelopeSuccess bool
+
+const (
+ SearchGetResponseEnvelopeSuccessTrue SearchGetResponseEnvelopeSuccess = true
+)
+
+type SearchGetResponseEnvelopeResultInfo struct {
+ // Total number of results for the requested service
+ Count float64 `json:"count"`
+ // Current page within paginated list of results
+ Page float64 `json:"page"`
+ // Number of results per page of results
+ PerPage float64 `json:"per_page"`
+ // Total results available without any search parameters
+ TotalCount float64 `json:"total_count"`
+ JSON searchGetResponseEnvelopeResultInfoJSON `json:"-"`
+}
+
+// searchGetResponseEnvelopeResultInfoJSON contains the JSON metadata for the
+// struct [SearchGetResponseEnvelopeResultInfo]
+type searchGetResponseEnvelopeResultInfoJSON struct {
+ Count apijson.Field
+ Page apijson.Field
+ PerPage apijson.Field
+ TotalCount apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *SearchGetResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r searchGetResponseEnvelopeResultInfoJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/load_balancers/search_test.go b/load_balancers/search_test.go
new file mode 100644
index 00000000000..3e139c9dbe6
--- /dev/null
+++ b/load_balancers/search_test.go
@@ -0,0 +1,47 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package load_balancers_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/load_balancers"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestSearchGetWithOptionalParams(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"),
+ )
+ _, err := client.LoadBalancers.Searches.Get(context.TODO(), load_balancers.SearchGetParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Page: cloudflare.F[any](map[string]interface{}{}),
+ PerPage: cloudflare.F[any](map[string]interface{}{}),
+ SearchParams: cloudflare.F(load_balancers.SearchGetParamsSearchParams{
+ Query: cloudflare.F("primary"),
+ References: cloudflare.F(load_balancers.SearchGetParamsSearchParamsReferencesStar),
+ }),
+ })
+ 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/loadbalancer.go b/loadbalancer.go
deleted file mode 100644
index 36f99ccedb3..00000000000
--- a/loadbalancer.go
+++ /dev/null
@@ -1,4075 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// LoadBalancerService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewLoadBalancerService] method
-// instead.
-type LoadBalancerService struct {
- Options []option.RequestOption
- Monitors *LoadBalancerMonitorService
- Pools *LoadBalancerPoolService
- Previews *LoadBalancerPreviewService
- Regions *LoadBalancerRegionService
- Searches *LoadBalancerSearchService
-}
-
-// NewLoadBalancerService generates a new service that applies the given options to
-// each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewLoadBalancerService(opts ...option.RequestOption) (r *LoadBalancerService) {
- r = &LoadBalancerService{}
- r.Options = opts
- r.Monitors = NewLoadBalancerMonitorService(opts...)
- r.Pools = NewLoadBalancerPoolService(opts...)
- r.Previews = NewLoadBalancerPreviewService(opts...)
- r.Regions = NewLoadBalancerRegionService(opts...)
- r.Searches = NewLoadBalancerSearchService(opts...)
- return
-}
-
-// Create a new load balancer.
-func (r *LoadBalancerService) New(ctx context.Context, params LoadBalancerNewParams, opts ...option.RequestOption) (res *LoadBalancer, err error) {
- opts = append(r.Options[:], opts...)
- var env LoadBalancerNewResponseEnvelope
- path := fmt.Sprintf("zones/%s/load_balancers", params.ZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Update a configured load balancer.
-func (r *LoadBalancerService) Update(ctx context.Context, loadBalancerID string, params LoadBalancerUpdateParams, opts ...option.RequestOption) (res *LoadBalancer, err error) {
- opts = append(r.Options[:], opts...)
- var env LoadBalancerUpdateResponseEnvelope
- path := fmt.Sprintf("zones/%s/load_balancers/%s", params.ZoneID, loadBalancerID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// List configured load balancers.
-func (r *LoadBalancerService) List(ctx context.Context, query LoadBalancerListParams, opts ...option.RequestOption) (res *[]LoadBalancer, err error) {
- opts = append(r.Options[:], opts...)
- var env LoadBalancerListResponseEnvelope
- path := fmt.Sprintf("zones/%s/load_balancers", query.ZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Delete a configured load balancer.
-func (r *LoadBalancerService) Delete(ctx context.Context, loadBalancerID string, body LoadBalancerDeleteParams, opts ...option.RequestOption) (res *LoadBalancerDeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env LoadBalancerDeleteResponseEnvelope
- path := fmt.Sprintf("zones/%s/load_balancers/%s", body.ZoneID, loadBalancerID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Apply changes to an existing load balancer, overwriting the supplied properties.
-func (r *LoadBalancerService) Edit(ctx context.Context, loadBalancerID string, params LoadBalancerEditParams, opts ...option.RequestOption) (res *LoadBalancer, err error) {
- opts = append(r.Options[:], opts...)
- var env LoadBalancerEditResponseEnvelope
- path := fmt.Sprintf("zones/%s/load_balancers/%s", params.ZoneID, loadBalancerID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Fetch a single configured load balancer.
-func (r *LoadBalancerService) Get(ctx context.Context, loadBalancerID string, query LoadBalancerGetParams, opts ...option.RequestOption) (res *LoadBalancer, err error) {
- opts = append(r.Options[:], opts...)
- var env LoadBalancerGetResponseEnvelope
- path := fmt.Sprintf("zones/%s/load_balancers/%s", query.ZoneID, loadBalancerID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type LoadBalancer struct {
- ID string `json:"id"`
- // Controls features that modify the routing of requests to pools and origins in
- // response to dynamic conditions, such as during the interval between active
- // health monitoring requests. For example, zero-downtime failover occurs
- // immediately when an origin becomes unavailable due to HTTP 521, 522, or 523
- // response codes. If there is another healthy origin in the same pool, the request
- // is retried once against this alternate origin.
- AdaptiveRouting LoadBalancerAdaptiveRouting `json:"adaptive_routing"`
- // A mapping of country codes to a list of pool IDs (ordered by their failover
- // priority) for the given country. Any country not explicitly defined will fall
- // back to using the corresponding region_pool mapping if it exists else to
- // default_pools.
- CountryPools interface{} `json:"country_pools"`
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // A list of pool IDs ordered by their failover priority. Pools defined here are
- // used by default, or when region_pools are not configured for a given region.
- DefaultPools []string `json:"default_pools"`
- // Object description.
- Description string `json:"description"`
- // Whether to enable (the default) this load balancer.
- Enabled bool `json:"enabled"`
- // The pool ID to use when all other pools are detected as unhealthy.
- FallbackPool interface{} `json:"fallback_pool"`
- // Controls location-based steering for non-proxied requests. See `steering_policy`
- // to learn how steering is affected.
- LocationStrategy LoadBalancerLocationStrategy `json:"location_strategy"`
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // The DNS hostname to associate with your Load Balancer. If this hostname already
- // exists as a DNS record in Cloudflare's DNS, the Load Balancer will take
- // precedence and the DNS record will not be used.
- Name string `json:"name"`
- // (Enterprise only): A mapping of Cloudflare PoP identifiers to a list of pool IDs
- // (ordered by their failover priority) for the PoP (datacenter). Any PoPs not
- // explicitly defined will fall back to using the corresponding country_pool, then
- // region_pool mapping if it exists else to default_pools.
- PopPools interface{} `json:"pop_pools"`
- // Whether the hostname should be gray clouded (false) or orange clouded (true).
- Proxied bool `json:"proxied"`
- // Configures pool weights.
- //
- // - `steering_policy="random"`: A random pool is selected with probability
- // proportional to pool weights.
- // - `steering_policy="least_outstanding_requests"`: Use pool weights to scale each
- // pool's outstanding requests.
- // - `steering_policy="least_connections"`: Use pool weights to scale each pool's
- // open connections.
- RandomSteering LoadBalancerRandomSteering `json:"random_steering"`
- // A mapping of region codes to a list of pool IDs (ordered by their failover
- // priority) for the given region. Any regions not explicitly defined will fall
- // back to using default_pools.
- RegionPools interface{} `json:"region_pools"`
- // BETA Field Not General Access: A list of rules for this load balancer to
- // execute.
- Rules []LoadBalancerRule `json:"rules"`
- // Specifies the type of session affinity the load balancer should use unless
- // specified as `"none"` or "" (default). The supported types are:
- //
- // - `"cookie"`: On the first request to a proxied load balancer, a cookie is
- // generated, encoding information of which origin the request will be forwarded
- // to. Subsequent requests, by the same client to the same load balancer, will be
- // sent to the origin server the cookie encodes, for the duration of the cookie
- // and as long as the origin server remains healthy. If the cookie has expired or
- // the origin server is unhealthy, then a new origin server is calculated and
- // used.
- // - `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin
- // selection is stable and based on the client's ip address.
- // - `"header"`: On the first request to a proxied load balancer, a session key
- // based on the configured HTTP headers (see
- // `session_affinity_attributes.headers`) is generated, encoding the request
- // headers used for storing in the load balancer session state which origin the
- // request will be forwarded to. Subsequent requests to the load balancer with
- // the same headers will be sent to the same origin server, for the duration of
- // the session and as long as the origin server remains healthy. If the session
- // has been idle for the duration of `session_affinity_ttl` seconds or the origin
- // server is unhealthy, then a new origin server is calculated and used. See
- // `headers` in `session_affinity_attributes` for additional required
- // configuration.
- SessionAffinity LoadBalancerSessionAffinity `json:"session_affinity"`
- // Configures attributes for session affinity.
- SessionAffinityAttributes LoadBalancerSessionAffinityAttributes `json:"session_affinity_attributes"`
- // Time, in seconds, until a client's session expires after being created. Once the
- // expiry time has been reached, subsequent requests may get sent to a different
- // origin server. The accepted ranges per `session_affinity` policy are:
- //
- // - `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used
- // unless explicitly set. The accepted range of values is between [1800, 604800].
- // - `"header"`: The current default of 1800 seconds will be used unless explicitly
- // set. The accepted range of values is between [30, 3600]. Note: With session
- // affinity by header, sessions only expire after they haven't been used for the
- // number of seconds specified.
- SessionAffinityTTL float64 `json:"session_affinity_ttl"`
- // Steering Policy for this load balancer.
- //
- // - `"off"`: Use `default_pools`.
- // - `"geo"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied
- // requests, the country for `country_pools` is determined by
- // `location_strategy`.
- // - `"random"`: Select a pool randomly.
- // - `"dynamic_latency"`: Use round trip time to select the closest pool in
- // default_pools (requires pool health checks).
- // - `"proximity"`: Use the pools' latitude and longitude to select the closest
- // pool using the Cloudflare PoP location for proxied requests or the location
- // determined by `location_strategy` for non-proxied requests.
- // - `"least_outstanding_requests"`: Select a pool by taking into consideration
- // `random_steering` weights, as well as each pool's number of outstanding
- // requests. Pools with more pending requests are weighted proportionately less
- // relative to others.
- // - `"least_connections"`: Select a pool by taking into consideration
- // `random_steering` weights, as well as each pool's number of open connections.
- // Pools with more open connections are weighted proportionately less relative to
- // others. Supported for HTTP/1 and HTTP/2 connections.
- // - `""`: Will map to `"geo"` if you use
- // `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.
- SteeringPolicy LoadBalancerSteeringPolicy `json:"steering_policy"`
- // Time to live (TTL) of the DNS entry for the IP address returned by this load
- // balancer. This only applies to gray-clouded (unproxied) load balancers.
- TTL float64 `json:"ttl"`
- JSON loadBalancerJSON `json:"-"`
-}
-
-// loadBalancerJSON contains the JSON metadata for the struct [LoadBalancer]
-type loadBalancerJSON struct {
- ID apijson.Field
- AdaptiveRouting apijson.Field
- CountryPools apijson.Field
- CreatedOn apijson.Field
- DefaultPools apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- FallbackPool apijson.Field
- LocationStrategy apijson.Field
- ModifiedOn apijson.Field
- Name apijson.Field
- PopPools apijson.Field
- Proxied apijson.Field
- RandomSteering apijson.Field
- RegionPools apijson.Field
- Rules apijson.Field
- SessionAffinity apijson.Field
- SessionAffinityAttributes apijson.Field
- SessionAffinityTTL apijson.Field
- SteeringPolicy apijson.Field
- TTL apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancer) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerJSON) RawJSON() string {
- return r.raw
-}
-
-// Controls features that modify the routing of requests to pools and origins in
-// response to dynamic conditions, such as during the interval between active
-// health monitoring requests. For example, zero-downtime failover occurs
-// immediately when an origin becomes unavailable due to HTTP 521, 522, or 523
-// response codes. If there is another healthy origin in the same pool, the request
-// is retried once against this alternate origin.
-type LoadBalancerAdaptiveRouting struct {
- // Extends zero-downtime failover of requests to healthy origins from alternate
- // pools, when no healthy alternate exists in the same pool, according to the
- // failover order defined by traffic and origin steering. When set false (the
- // default) zero-downtime failover will only occur between origins within the same
- // pool. See `session_affinity_attributes` for control over when sessions are
- // broken or reassigned.
- FailoverAcrossPools bool `json:"failover_across_pools"`
- JSON loadBalancerAdaptiveRoutingJSON `json:"-"`
-}
-
-// loadBalancerAdaptiveRoutingJSON contains the JSON metadata for the struct
-// [LoadBalancerAdaptiveRouting]
-type loadBalancerAdaptiveRoutingJSON struct {
- FailoverAcrossPools apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerAdaptiveRouting) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerAdaptiveRoutingJSON) RawJSON() string {
- return r.raw
-}
-
-// Controls location-based steering for non-proxied requests. See `steering_policy`
-// to learn how steering is affected.
-type LoadBalancerLocationStrategy struct {
- // Determines the authoritative location when ECS is not preferred, does not exist
- // in the request, or its GeoIP lookup is unsuccessful.
- //
- // - `"pop"`: Use the Cloudflare PoP location.
- // - `"resolver_ip"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is
- // unsuccessful, use the Cloudflare PoP location.
- Mode LoadBalancerLocationStrategyMode `json:"mode"`
- // Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the
- // authoritative location.
- //
- // - `"always"`: Always prefer ECS.
- // - `"never"`: Never prefer ECS.
- // - `"proximity"`: Prefer ECS only when `steering_policy="proximity"`.
- // - `"geo"`: Prefer ECS only when `steering_policy="geo"`.
- PreferEcs LoadBalancerLocationStrategyPreferEcs `json:"prefer_ecs"`
- JSON loadBalancerLocationStrategyJSON `json:"-"`
-}
-
-// loadBalancerLocationStrategyJSON contains the JSON metadata for the struct
-// [LoadBalancerLocationStrategy]
-type loadBalancerLocationStrategyJSON struct {
- Mode apijson.Field
- PreferEcs apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerLocationStrategy) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerLocationStrategyJSON) RawJSON() string {
- return r.raw
-}
-
-// Determines the authoritative location when ECS is not preferred, does not exist
-// in the request, or its GeoIP lookup is unsuccessful.
-//
-// - `"pop"`: Use the Cloudflare PoP location.
-// - `"resolver_ip"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is
-// unsuccessful, use the Cloudflare PoP location.
-type LoadBalancerLocationStrategyMode string
-
-const (
- LoadBalancerLocationStrategyModePop LoadBalancerLocationStrategyMode = "pop"
- LoadBalancerLocationStrategyModeResolverIP LoadBalancerLocationStrategyMode = "resolver_ip"
-)
-
-// Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the
-// authoritative location.
-//
-// - `"always"`: Always prefer ECS.
-// - `"never"`: Never prefer ECS.
-// - `"proximity"`: Prefer ECS only when `steering_policy="proximity"`.
-// - `"geo"`: Prefer ECS only when `steering_policy="geo"`.
-type LoadBalancerLocationStrategyPreferEcs string
-
-const (
- LoadBalancerLocationStrategyPreferEcsAlways LoadBalancerLocationStrategyPreferEcs = "always"
- LoadBalancerLocationStrategyPreferEcsNever LoadBalancerLocationStrategyPreferEcs = "never"
- LoadBalancerLocationStrategyPreferEcsProximity LoadBalancerLocationStrategyPreferEcs = "proximity"
- LoadBalancerLocationStrategyPreferEcsGeo LoadBalancerLocationStrategyPreferEcs = "geo"
-)
-
-// Configures pool weights.
-//
-// - `steering_policy="random"`: A random pool is selected with probability
-// proportional to pool weights.
-// - `steering_policy="least_outstanding_requests"`: Use pool weights to scale each
-// pool's outstanding requests.
-// - `steering_policy="least_connections"`: Use pool weights to scale each pool's
-// open connections.
-type LoadBalancerRandomSteering struct {
- // The default weight for pools in the load balancer that are not specified in the
- // pool_weights map.
- DefaultWeight float64 `json:"default_weight"`
- // A mapping of pool IDs to custom weights. The weight is relative to other pools
- // in the load balancer.
- PoolWeights interface{} `json:"pool_weights"`
- JSON loadBalancerRandomSteeringJSON `json:"-"`
-}
-
-// loadBalancerRandomSteeringJSON contains the JSON metadata for the struct
-// [LoadBalancerRandomSteering]
-type loadBalancerRandomSteeringJSON struct {
- DefaultWeight apijson.Field
- PoolWeights apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerRandomSteering) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerRandomSteeringJSON) RawJSON() string {
- return r.raw
-}
-
-// A rule object containing conditions and overrides for this load balancer to
-// evaluate.
-type LoadBalancerRule struct {
- // The condition expressions to evaluate. If the condition evaluates to true, the
- // overrides or fixed_response in this rule will be applied. An empty condition is
- // always true. For more details on condition expressions, please see
- // https://developers.cloudflare.com/load-balancing/understand-basics/load-balancing-rules/expressions.
- Condition string `json:"condition"`
- // Disable this specific rule. It will no longer be evaluated by this load
- // balancer.
- Disabled bool `json:"disabled"`
- // A collection of fields used to directly respond to the eyeball instead of
- // routing to a pool. If a fixed_response is supplied the rule will be marked as
- // terminates.
- FixedResponse LoadBalancerRulesFixedResponse `json:"fixed_response"`
- // Name of this rule. Only used for human readability.
- Name string `json:"name"`
- // A collection of overrides to apply to the load balancer when this rule's
- // condition is true. All fields are optional.
- Overrides LoadBalancerRulesOverrides `json:"overrides"`
- // The order in which rules should be executed in relation to each other. Lower
- // values are executed first. Values do not need to be sequential. If no value is
- // provided for any rule the array order of the rules field will be used to assign
- // a priority.
- Priority int64 `json:"priority"`
- // If this rule's condition is true, this causes rule evaluation to stop after
- // processing this rule.
- Terminates bool `json:"terminates"`
- JSON loadBalancerRuleJSON `json:"-"`
-}
-
-// loadBalancerRuleJSON contains the JSON metadata for the struct
-// [LoadBalancerRule]
-type loadBalancerRuleJSON struct {
- Condition apijson.Field
- Disabled apijson.Field
- FixedResponse apijson.Field
- Name apijson.Field
- Overrides apijson.Field
- Priority apijson.Field
- Terminates apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerRuleJSON) RawJSON() string {
- return r.raw
-}
-
-// A collection of fields used to directly respond to the eyeball instead of
-// routing to a pool. If a fixed_response is supplied the rule will be marked as
-// terminates.
-type LoadBalancerRulesFixedResponse struct {
- // The http 'Content-Type' header to include in the response.
- ContentType string `json:"content_type"`
- // The http 'Location' header to include in the response.
- Location string `json:"location"`
- // Text to include as the http body.
- MessageBody string `json:"message_body"`
- // The http status code to respond with.
- StatusCode int64 `json:"status_code"`
- JSON loadBalancerRulesFixedResponseJSON `json:"-"`
-}
-
-// loadBalancerRulesFixedResponseJSON contains the JSON metadata for the struct
-// [LoadBalancerRulesFixedResponse]
-type loadBalancerRulesFixedResponseJSON struct {
- ContentType apijson.Field
- Location apijson.Field
- MessageBody apijson.Field
- StatusCode apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerRulesFixedResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerRulesFixedResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// A collection of overrides to apply to the load balancer when this rule's
-// condition is true. All fields are optional.
-type LoadBalancerRulesOverrides struct {
- // Controls features that modify the routing of requests to pools and origins in
- // response to dynamic conditions, such as during the interval between active
- // health monitoring requests. For example, zero-downtime failover occurs
- // immediately when an origin becomes unavailable due to HTTP 521, 522, or 523
- // response codes. If there is another healthy origin in the same pool, the request
- // is retried once against this alternate origin.
- AdaptiveRouting LoadBalancerRulesOverridesAdaptiveRouting `json:"adaptive_routing"`
- // A mapping of country codes to a list of pool IDs (ordered by their failover
- // priority) for the given country. Any country not explicitly defined will fall
- // back to using the corresponding region_pool mapping if it exists else to
- // default_pools.
- CountryPools interface{} `json:"country_pools"`
- // A list of pool IDs ordered by their failover priority. Pools defined here are
- // used by default, or when region_pools are not configured for a given region.
- DefaultPools []string `json:"default_pools"`
- // The pool ID to use when all other pools are detected as unhealthy.
- FallbackPool interface{} `json:"fallback_pool"`
- // Controls location-based steering for non-proxied requests. See `steering_policy`
- // to learn how steering is affected.
- LocationStrategy LoadBalancerRulesOverridesLocationStrategy `json:"location_strategy"`
- // (Enterprise only): A mapping of Cloudflare PoP identifiers to a list of pool IDs
- // (ordered by their failover priority) for the PoP (datacenter). Any PoPs not
- // explicitly defined will fall back to using the corresponding country_pool, then
- // region_pool mapping if it exists else to default_pools.
- PopPools interface{} `json:"pop_pools"`
- // Configures pool weights.
- //
- // - `steering_policy="random"`: A random pool is selected with probability
- // proportional to pool weights.
- // - `steering_policy="least_outstanding_requests"`: Use pool weights to scale each
- // pool's outstanding requests.
- // - `steering_policy="least_connections"`: Use pool weights to scale each pool's
- // open connections.
- RandomSteering LoadBalancerRulesOverridesRandomSteering `json:"random_steering"`
- // A mapping of region codes to a list of pool IDs (ordered by their failover
- // priority) for the given region. Any regions not explicitly defined will fall
- // back to using default_pools.
- RegionPools interface{} `json:"region_pools"`
- // Specifies the type of session affinity the load balancer should use unless
- // specified as `"none"` or "" (default). The supported types are:
- //
- // - `"cookie"`: On the first request to a proxied load balancer, a cookie is
- // generated, encoding information of which origin the request will be forwarded
- // to. Subsequent requests, by the same client to the same load balancer, will be
- // sent to the origin server the cookie encodes, for the duration of the cookie
- // and as long as the origin server remains healthy. If the cookie has expired or
- // the origin server is unhealthy, then a new origin server is calculated and
- // used.
- // - `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin
- // selection is stable and based on the client's ip address.
- // - `"header"`: On the first request to a proxied load balancer, a session key
- // based on the configured HTTP headers (see
- // `session_affinity_attributes.headers`) is generated, encoding the request
- // headers used for storing in the load balancer session state which origin the
- // request will be forwarded to. Subsequent requests to the load balancer with
- // the same headers will be sent to the same origin server, for the duration of
- // the session and as long as the origin server remains healthy. If the session
- // has been idle for the duration of `session_affinity_ttl` seconds or the origin
- // server is unhealthy, then a new origin server is calculated and used. See
- // `headers` in `session_affinity_attributes` for additional required
- // configuration.
- SessionAffinity LoadBalancerRulesOverridesSessionAffinity `json:"session_affinity"`
- // Configures attributes for session affinity.
- SessionAffinityAttributes LoadBalancerRulesOverridesSessionAffinityAttributes `json:"session_affinity_attributes"`
- // Time, in seconds, until a client's session expires after being created. Once the
- // expiry time has been reached, subsequent requests may get sent to a different
- // origin server. The accepted ranges per `session_affinity` policy are:
- //
- // - `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used
- // unless explicitly set. The accepted range of values is between [1800, 604800].
- // - `"header"`: The current default of 1800 seconds will be used unless explicitly
- // set. The accepted range of values is between [30, 3600]. Note: With session
- // affinity by header, sessions only expire after they haven't been used for the
- // number of seconds specified.
- SessionAffinityTTL float64 `json:"session_affinity_ttl"`
- // Steering Policy for this load balancer.
- //
- // - `"off"`: Use `default_pools`.
- // - `"geo"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied
- // requests, the country for `country_pools` is determined by
- // `location_strategy`.
- // - `"random"`: Select a pool randomly.
- // - `"dynamic_latency"`: Use round trip time to select the closest pool in
- // default_pools (requires pool health checks).
- // - `"proximity"`: Use the pools' latitude and longitude to select the closest
- // pool using the Cloudflare PoP location for proxied requests or the location
- // determined by `location_strategy` for non-proxied requests.
- // - `"least_outstanding_requests"`: Select a pool by taking into consideration
- // `random_steering` weights, as well as each pool's number of outstanding
- // requests. Pools with more pending requests are weighted proportionately less
- // relative to others.
- // - `"least_connections"`: Select a pool by taking into consideration
- // `random_steering` weights, as well as each pool's number of open connections.
- // Pools with more open connections are weighted proportionately less relative to
- // others. Supported for HTTP/1 and HTTP/2 connections.
- // - `""`: Will map to `"geo"` if you use
- // `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.
- SteeringPolicy LoadBalancerRulesOverridesSteeringPolicy `json:"steering_policy"`
- // Time to live (TTL) of the DNS entry for the IP address returned by this load
- // balancer. This only applies to gray-clouded (unproxied) load balancers.
- TTL float64 `json:"ttl"`
- JSON loadBalancerRulesOverridesJSON `json:"-"`
-}
-
-// loadBalancerRulesOverridesJSON contains the JSON metadata for the struct
-// [LoadBalancerRulesOverrides]
-type loadBalancerRulesOverridesJSON struct {
- AdaptiveRouting apijson.Field
- CountryPools apijson.Field
- DefaultPools apijson.Field
- FallbackPool apijson.Field
- LocationStrategy apijson.Field
- PopPools apijson.Field
- RandomSteering apijson.Field
- RegionPools apijson.Field
- SessionAffinity apijson.Field
- SessionAffinityAttributes apijson.Field
- SessionAffinityTTL apijson.Field
- SteeringPolicy apijson.Field
- TTL apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerRulesOverrides) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerRulesOverridesJSON) RawJSON() string {
- return r.raw
-}
-
-// Controls features that modify the routing of requests to pools and origins in
-// response to dynamic conditions, such as during the interval between active
-// health monitoring requests. For example, zero-downtime failover occurs
-// immediately when an origin becomes unavailable due to HTTP 521, 522, or 523
-// response codes. If there is another healthy origin in the same pool, the request
-// is retried once against this alternate origin.
-type LoadBalancerRulesOverridesAdaptiveRouting struct {
- // Extends zero-downtime failover of requests to healthy origins from alternate
- // pools, when no healthy alternate exists in the same pool, according to the
- // failover order defined by traffic and origin steering. When set false (the
- // default) zero-downtime failover will only occur between origins within the same
- // pool. See `session_affinity_attributes` for control over when sessions are
- // broken or reassigned.
- FailoverAcrossPools bool `json:"failover_across_pools"`
- JSON loadBalancerRulesOverridesAdaptiveRoutingJSON `json:"-"`
-}
-
-// loadBalancerRulesOverridesAdaptiveRoutingJSON contains the JSON metadata for the
-// struct [LoadBalancerRulesOverridesAdaptiveRouting]
-type loadBalancerRulesOverridesAdaptiveRoutingJSON struct {
- FailoverAcrossPools apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerRulesOverridesAdaptiveRouting) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerRulesOverridesAdaptiveRoutingJSON) RawJSON() string {
- return r.raw
-}
-
-// Controls location-based steering for non-proxied requests. See `steering_policy`
-// to learn how steering is affected.
-type LoadBalancerRulesOverridesLocationStrategy struct {
- // Determines the authoritative location when ECS is not preferred, does not exist
- // in the request, or its GeoIP lookup is unsuccessful.
- //
- // - `"pop"`: Use the Cloudflare PoP location.
- // - `"resolver_ip"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is
- // unsuccessful, use the Cloudflare PoP location.
- Mode LoadBalancerRulesOverridesLocationStrategyMode `json:"mode"`
- // Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the
- // authoritative location.
- //
- // - `"always"`: Always prefer ECS.
- // - `"never"`: Never prefer ECS.
- // - `"proximity"`: Prefer ECS only when `steering_policy="proximity"`.
- // - `"geo"`: Prefer ECS only when `steering_policy="geo"`.
- PreferEcs LoadBalancerRulesOverridesLocationStrategyPreferEcs `json:"prefer_ecs"`
- JSON loadBalancerRulesOverridesLocationStrategyJSON `json:"-"`
-}
-
-// loadBalancerRulesOverridesLocationStrategyJSON contains the JSON metadata for
-// the struct [LoadBalancerRulesOverridesLocationStrategy]
-type loadBalancerRulesOverridesLocationStrategyJSON struct {
- Mode apijson.Field
- PreferEcs apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerRulesOverridesLocationStrategy) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerRulesOverridesLocationStrategyJSON) RawJSON() string {
- return r.raw
-}
-
-// Determines the authoritative location when ECS is not preferred, does not exist
-// in the request, or its GeoIP lookup is unsuccessful.
-//
-// - `"pop"`: Use the Cloudflare PoP location.
-// - `"resolver_ip"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is
-// unsuccessful, use the Cloudflare PoP location.
-type LoadBalancerRulesOverridesLocationStrategyMode string
-
-const (
- LoadBalancerRulesOverridesLocationStrategyModePop LoadBalancerRulesOverridesLocationStrategyMode = "pop"
- LoadBalancerRulesOverridesLocationStrategyModeResolverIP LoadBalancerRulesOverridesLocationStrategyMode = "resolver_ip"
-)
-
-// Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the
-// authoritative location.
-//
-// - `"always"`: Always prefer ECS.
-// - `"never"`: Never prefer ECS.
-// - `"proximity"`: Prefer ECS only when `steering_policy="proximity"`.
-// - `"geo"`: Prefer ECS only when `steering_policy="geo"`.
-type LoadBalancerRulesOverridesLocationStrategyPreferEcs string
-
-const (
- LoadBalancerRulesOverridesLocationStrategyPreferEcsAlways LoadBalancerRulesOverridesLocationStrategyPreferEcs = "always"
- LoadBalancerRulesOverridesLocationStrategyPreferEcsNever LoadBalancerRulesOverridesLocationStrategyPreferEcs = "never"
- LoadBalancerRulesOverridesLocationStrategyPreferEcsProximity LoadBalancerRulesOverridesLocationStrategyPreferEcs = "proximity"
- LoadBalancerRulesOverridesLocationStrategyPreferEcsGeo LoadBalancerRulesOverridesLocationStrategyPreferEcs = "geo"
-)
-
-// Configures pool weights.
-//
-// - `steering_policy="random"`: A random pool is selected with probability
-// proportional to pool weights.
-// - `steering_policy="least_outstanding_requests"`: Use pool weights to scale each
-// pool's outstanding requests.
-// - `steering_policy="least_connections"`: Use pool weights to scale each pool's
-// open connections.
-type LoadBalancerRulesOverridesRandomSteering struct {
- // The default weight for pools in the load balancer that are not specified in the
- // pool_weights map.
- DefaultWeight float64 `json:"default_weight"`
- // A mapping of pool IDs to custom weights. The weight is relative to other pools
- // in the load balancer.
- PoolWeights interface{} `json:"pool_weights"`
- JSON loadBalancerRulesOverridesRandomSteeringJSON `json:"-"`
-}
-
-// loadBalancerRulesOverridesRandomSteeringJSON contains the JSON metadata for the
-// struct [LoadBalancerRulesOverridesRandomSteering]
-type loadBalancerRulesOverridesRandomSteeringJSON struct {
- DefaultWeight apijson.Field
- PoolWeights apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerRulesOverridesRandomSteering) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerRulesOverridesRandomSteeringJSON) RawJSON() string {
- return r.raw
-}
-
-// Specifies the type of session affinity the load balancer should use unless
-// specified as `"none"` or "" (default). The supported types are:
-//
-// - `"cookie"`: On the first request to a proxied load balancer, a cookie is
-// generated, encoding information of which origin the request will be forwarded
-// to. Subsequent requests, by the same client to the same load balancer, will be
-// sent to the origin server the cookie encodes, for the duration of the cookie
-// and as long as the origin server remains healthy. If the cookie has expired or
-// the origin server is unhealthy, then a new origin server is calculated and
-// used.
-// - `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin
-// selection is stable and based on the client's ip address.
-// - `"header"`: On the first request to a proxied load balancer, a session key
-// based on the configured HTTP headers (see
-// `session_affinity_attributes.headers`) is generated, encoding the request
-// headers used for storing in the load balancer session state which origin the
-// request will be forwarded to. Subsequent requests to the load balancer with
-// the same headers will be sent to the same origin server, for the duration of
-// the session and as long as the origin server remains healthy. If the session
-// has been idle for the duration of `session_affinity_ttl` seconds or the origin
-// server is unhealthy, then a new origin server is calculated and used. See
-// `headers` in `session_affinity_attributes` for additional required
-// configuration.
-type LoadBalancerRulesOverridesSessionAffinity string
-
-const (
- LoadBalancerRulesOverridesSessionAffinityNone LoadBalancerRulesOverridesSessionAffinity = "none"
- LoadBalancerRulesOverridesSessionAffinityCookie LoadBalancerRulesOverridesSessionAffinity = "cookie"
- LoadBalancerRulesOverridesSessionAffinityIPCookie LoadBalancerRulesOverridesSessionAffinity = "ip_cookie"
- LoadBalancerRulesOverridesSessionAffinityHeader LoadBalancerRulesOverridesSessionAffinity = "header"
- LoadBalancerRulesOverridesSessionAffinityEmpty LoadBalancerRulesOverridesSessionAffinity = "\"\""
-)
-
-// Configures attributes for session affinity.
-type LoadBalancerRulesOverridesSessionAffinityAttributes struct {
- // Configures the drain duration in seconds. This field is only used when session
- // affinity is enabled on the load balancer.
- DrainDuration float64 `json:"drain_duration"`
- // Configures the names of HTTP headers to base session affinity on when header
- // `session_affinity` is enabled. At least one HTTP header name must be provided.
- // To specify the exact cookies to be used, include an item in the following
- // format: `"cookie:,"` (example) where everything
- // after the colon is a comma-separated list of cookie names. Providing only
- // `"cookie"` will result in all cookies being used. The default max number of HTTP
- // header names that can be provided depends on your plan: 5 for Enterprise, 1 for
- // all other plans.
- Headers []string `json:"headers"`
- // When header `session_affinity` is enabled, this option can be used to specify
- // how HTTP headers on load balancing requests will be used. The supported values
- // are:
- //
- // - `"true"`: Load balancing requests must contain _all_ of the HTTP headers
- // specified by the `headers` session affinity attribute, otherwise sessions
- // aren't created.
- // - `"false"`: Load balancing requests must contain _at least one_ of the HTTP
- // headers specified by the `headers` session affinity attribute, otherwise
- // sessions aren't created.
- RequireAllHeaders bool `json:"require_all_headers"`
- // Configures the SameSite attribute on session affinity cookie. Value "Auto" will
- // be translated to "Lax" or "None" depending if Always Use HTTPS is enabled. Note:
- // when using value "None", the secure attribute can not be set to "Never".
- Samesite LoadBalancerRulesOverridesSessionAffinityAttributesSamesite `json:"samesite"`
- // Configures the Secure attribute on session affinity cookie. Value "Always"
- // indicates the Secure attribute will be set in the Set-Cookie header, "Never"
- // indicates the Secure attribute will not be set, and "Auto" will set the Secure
- // attribute depending if Always Use HTTPS is enabled.
- Secure LoadBalancerRulesOverridesSessionAffinityAttributesSecure `json:"secure"`
- // Configures the zero-downtime failover between origins within a pool when session
- // affinity is enabled. This feature is currently incompatible with Argo, Tiered
- // Cache, and Bandwidth Alliance. The supported values are:
- //
- // - `"none"`: No failover takes place for sessions pinned to the origin (default).
- // - `"temporary"`: Traffic will be sent to another other healthy origin until the
- // originally pinned origin is available; note that this can potentially result
- // in heavy origin flapping.
- // - `"sticky"`: The session affinity cookie is updated and subsequent requests are
- // sent to the new origin. Note: Zero-downtime failover with sticky sessions is
- // currently not supported for session affinity by header.
- ZeroDowntimeFailover LoadBalancerRulesOverridesSessionAffinityAttributesZeroDowntimeFailover `json:"zero_downtime_failover"`
- JSON loadBalancerRulesOverridesSessionAffinityAttributesJSON `json:"-"`
-}
-
-// loadBalancerRulesOverridesSessionAffinityAttributesJSON contains the JSON
-// metadata for the struct [LoadBalancerRulesOverridesSessionAffinityAttributes]
-type loadBalancerRulesOverridesSessionAffinityAttributesJSON struct {
- DrainDuration apijson.Field
- Headers apijson.Field
- RequireAllHeaders apijson.Field
- Samesite apijson.Field
- Secure apijson.Field
- ZeroDowntimeFailover apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerRulesOverridesSessionAffinityAttributes) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerRulesOverridesSessionAffinityAttributesJSON) RawJSON() string {
- return r.raw
-}
-
-// Configures the SameSite attribute on session affinity cookie. Value "Auto" will
-// be translated to "Lax" or "None" depending if Always Use HTTPS is enabled. Note:
-// when using value "None", the secure attribute can not be set to "Never".
-type LoadBalancerRulesOverridesSessionAffinityAttributesSamesite string
-
-const (
- LoadBalancerRulesOverridesSessionAffinityAttributesSamesiteAuto LoadBalancerRulesOverridesSessionAffinityAttributesSamesite = "Auto"
- LoadBalancerRulesOverridesSessionAffinityAttributesSamesiteLax LoadBalancerRulesOverridesSessionAffinityAttributesSamesite = "Lax"
- LoadBalancerRulesOverridesSessionAffinityAttributesSamesiteNone LoadBalancerRulesOverridesSessionAffinityAttributesSamesite = "None"
- LoadBalancerRulesOverridesSessionAffinityAttributesSamesiteStrict LoadBalancerRulesOverridesSessionAffinityAttributesSamesite = "Strict"
-)
-
-// Configures the Secure attribute on session affinity cookie. Value "Always"
-// indicates the Secure attribute will be set in the Set-Cookie header, "Never"
-// indicates the Secure attribute will not be set, and "Auto" will set the Secure
-// attribute depending if Always Use HTTPS is enabled.
-type LoadBalancerRulesOverridesSessionAffinityAttributesSecure string
-
-const (
- LoadBalancerRulesOverridesSessionAffinityAttributesSecureAuto LoadBalancerRulesOverridesSessionAffinityAttributesSecure = "Auto"
- LoadBalancerRulesOverridesSessionAffinityAttributesSecureAlways LoadBalancerRulesOverridesSessionAffinityAttributesSecure = "Always"
- LoadBalancerRulesOverridesSessionAffinityAttributesSecureNever LoadBalancerRulesOverridesSessionAffinityAttributesSecure = "Never"
-)
-
-// Configures the zero-downtime failover between origins within a pool when session
-// affinity is enabled. This feature is currently incompatible with Argo, Tiered
-// Cache, and Bandwidth Alliance. The supported values are:
-//
-// - `"none"`: No failover takes place for sessions pinned to the origin (default).
-// - `"temporary"`: Traffic will be sent to another other healthy origin until the
-// originally pinned origin is available; note that this can potentially result
-// in heavy origin flapping.
-// - `"sticky"`: The session affinity cookie is updated and subsequent requests are
-// sent to the new origin. Note: Zero-downtime failover with sticky sessions is
-// currently not supported for session affinity by header.
-type LoadBalancerRulesOverridesSessionAffinityAttributesZeroDowntimeFailover string
-
-const (
- LoadBalancerRulesOverridesSessionAffinityAttributesZeroDowntimeFailoverNone LoadBalancerRulesOverridesSessionAffinityAttributesZeroDowntimeFailover = "none"
- LoadBalancerRulesOverridesSessionAffinityAttributesZeroDowntimeFailoverTemporary LoadBalancerRulesOverridesSessionAffinityAttributesZeroDowntimeFailover = "temporary"
- LoadBalancerRulesOverridesSessionAffinityAttributesZeroDowntimeFailoverSticky LoadBalancerRulesOverridesSessionAffinityAttributesZeroDowntimeFailover = "sticky"
-)
-
-// Steering Policy for this load balancer.
-//
-// - `"off"`: Use `default_pools`.
-// - `"geo"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied
-// requests, the country for `country_pools` is determined by
-// `location_strategy`.
-// - `"random"`: Select a pool randomly.
-// - `"dynamic_latency"`: Use round trip time to select the closest pool in
-// default_pools (requires pool health checks).
-// - `"proximity"`: Use the pools' latitude and longitude to select the closest
-// pool using the Cloudflare PoP location for proxied requests or the location
-// determined by `location_strategy` for non-proxied requests.
-// - `"least_outstanding_requests"`: Select a pool by taking into consideration
-// `random_steering` weights, as well as each pool's number of outstanding
-// requests. Pools with more pending requests are weighted proportionately less
-// relative to others.
-// - `"least_connections"`: Select a pool by taking into consideration
-// `random_steering` weights, as well as each pool's number of open connections.
-// Pools with more open connections are weighted proportionately less relative to
-// others. Supported for HTTP/1 and HTTP/2 connections.
-// - `""`: Will map to `"geo"` if you use
-// `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.
-type LoadBalancerRulesOverridesSteeringPolicy string
-
-const (
- LoadBalancerRulesOverridesSteeringPolicyOff LoadBalancerRulesOverridesSteeringPolicy = "off"
- LoadBalancerRulesOverridesSteeringPolicyGeo LoadBalancerRulesOverridesSteeringPolicy = "geo"
- LoadBalancerRulesOverridesSteeringPolicyRandom LoadBalancerRulesOverridesSteeringPolicy = "random"
- LoadBalancerRulesOverridesSteeringPolicyDynamicLatency LoadBalancerRulesOverridesSteeringPolicy = "dynamic_latency"
- LoadBalancerRulesOverridesSteeringPolicyProximity LoadBalancerRulesOverridesSteeringPolicy = "proximity"
- LoadBalancerRulesOverridesSteeringPolicyLeastOutstandingRequests LoadBalancerRulesOverridesSteeringPolicy = "least_outstanding_requests"
- LoadBalancerRulesOverridesSteeringPolicyLeastConnections LoadBalancerRulesOverridesSteeringPolicy = "least_connections"
- LoadBalancerRulesOverridesSteeringPolicyEmpty LoadBalancerRulesOverridesSteeringPolicy = "\"\""
-)
-
-// Specifies the type of session affinity the load balancer should use unless
-// specified as `"none"` or "" (default). The supported types are:
-//
-// - `"cookie"`: On the first request to a proxied load balancer, a cookie is
-// generated, encoding information of which origin the request will be forwarded
-// to. Subsequent requests, by the same client to the same load balancer, will be
-// sent to the origin server the cookie encodes, for the duration of the cookie
-// and as long as the origin server remains healthy. If the cookie has expired or
-// the origin server is unhealthy, then a new origin server is calculated and
-// used.
-// - `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin
-// selection is stable and based on the client's ip address.
-// - `"header"`: On the first request to a proxied load balancer, a session key
-// based on the configured HTTP headers (see
-// `session_affinity_attributes.headers`) is generated, encoding the request
-// headers used for storing in the load balancer session state which origin the
-// request will be forwarded to. Subsequent requests to the load balancer with
-// the same headers will be sent to the same origin server, for the duration of
-// the session and as long as the origin server remains healthy. If the session
-// has been idle for the duration of `session_affinity_ttl` seconds or the origin
-// server is unhealthy, then a new origin server is calculated and used. See
-// `headers` in `session_affinity_attributes` for additional required
-// configuration.
-type LoadBalancerSessionAffinity string
-
-const (
- LoadBalancerSessionAffinityNone LoadBalancerSessionAffinity = "none"
- LoadBalancerSessionAffinityCookie LoadBalancerSessionAffinity = "cookie"
- LoadBalancerSessionAffinityIPCookie LoadBalancerSessionAffinity = "ip_cookie"
- LoadBalancerSessionAffinityHeader LoadBalancerSessionAffinity = "header"
- LoadBalancerSessionAffinityEmpty LoadBalancerSessionAffinity = "\"\""
-)
-
-// Configures attributes for session affinity.
-type LoadBalancerSessionAffinityAttributes struct {
- // Configures the drain duration in seconds. This field is only used when session
- // affinity is enabled on the load balancer.
- DrainDuration float64 `json:"drain_duration"`
- // Configures the names of HTTP headers to base session affinity on when header
- // `session_affinity` is enabled. At least one HTTP header name must be provided.
- // To specify the exact cookies to be used, include an item in the following
- // format: `"cookie:,"` (example) where everything
- // after the colon is a comma-separated list of cookie names. Providing only
- // `"cookie"` will result in all cookies being used. The default max number of HTTP
- // header names that can be provided depends on your plan: 5 for Enterprise, 1 for
- // all other plans.
- Headers []string `json:"headers"`
- // When header `session_affinity` is enabled, this option can be used to specify
- // how HTTP headers on load balancing requests will be used. The supported values
- // are:
- //
- // - `"true"`: Load balancing requests must contain _all_ of the HTTP headers
- // specified by the `headers` session affinity attribute, otherwise sessions
- // aren't created.
- // - `"false"`: Load balancing requests must contain _at least one_ of the HTTP
- // headers specified by the `headers` session affinity attribute, otherwise
- // sessions aren't created.
- RequireAllHeaders bool `json:"require_all_headers"`
- // Configures the SameSite attribute on session affinity cookie. Value "Auto" will
- // be translated to "Lax" or "None" depending if Always Use HTTPS is enabled. Note:
- // when using value "None", the secure attribute can not be set to "Never".
- Samesite LoadBalancerSessionAffinityAttributesSamesite `json:"samesite"`
- // Configures the Secure attribute on session affinity cookie. Value "Always"
- // indicates the Secure attribute will be set in the Set-Cookie header, "Never"
- // indicates the Secure attribute will not be set, and "Auto" will set the Secure
- // attribute depending if Always Use HTTPS is enabled.
- Secure LoadBalancerSessionAffinityAttributesSecure `json:"secure"`
- // Configures the zero-downtime failover between origins within a pool when session
- // affinity is enabled. This feature is currently incompatible with Argo, Tiered
- // Cache, and Bandwidth Alliance. The supported values are:
- //
- // - `"none"`: No failover takes place for sessions pinned to the origin (default).
- // - `"temporary"`: Traffic will be sent to another other healthy origin until the
- // originally pinned origin is available; note that this can potentially result
- // in heavy origin flapping.
- // - `"sticky"`: The session affinity cookie is updated and subsequent requests are
- // sent to the new origin. Note: Zero-downtime failover with sticky sessions is
- // currently not supported for session affinity by header.
- ZeroDowntimeFailover LoadBalancerSessionAffinityAttributesZeroDowntimeFailover `json:"zero_downtime_failover"`
- JSON loadBalancerSessionAffinityAttributesJSON `json:"-"`
-}
-
-// loadBalancerSessionAffinityAttributesJSON contains the JSON metadata for the
-// struct [LoadBalancerSessionAffinityAttributes]
-type loadBalancerSessionAffinityAttributesJSON struct {
- DrainDuration apijson.Field
- Headers apijson.Field
- RequireAllHeaders apijson.Field
- Samesite apijson.Field
- Secure apijson.Field
- ZeroDowntimeFailover apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerSessionAffinityAttributes) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerSessionAffinityAttributesJSON) RawJSON() string {
- return r.raw
-}
-
-// Configures the SameSite attribute on session affinity cookie. Value "Auto" will
-// be translated to "Lax" or "None" depending if Always Use HTTPS is enabled. Note:
-// when using value "None", the secure attribute can not be set to "Never".
-type LoadBalancerSessionAffinityAttributesSamesite string
-
-const (
- LoadBalancerSessionAffinityAttributesSamesiteAuto LoadBalancerSessionAffinityAttributesSamesite = "Auto"
- LoadBalancerSessionAffinityAttributesSamesiteLax LoadBalancerSessionAffinityAttributesSamesite = "Lax"
- LoadBalancerSessionAffinityAttributesSamesiteNone LoadBalancerSessionAffinityAttributesSamesite = "None"
- LoadBalancerSessionAffinityAttributesSamesiteStrict LoadBalancerSessionAffinityAttributesSamesite = "Strict"
-)
-
-// Configures the Secure attribute on session affinity cookie. Value "Always"
-// indicates the Secure attribute will be set in the Set-Cookie header, "Never"
-// indicates the Secure attribute will not be set, and "Auto" will set the Secure
-// attribute depending if Always Use HTTPS is enabled.
-type LoadBalancerSessionAffinityAttributesSecure string
-
-const (
- LoadBalancerSessionAffinityAttributesSecureAuto LoadBalancerSessionAffinityAttributesSecure = "Auto"
- LoadBalancerSessionAffinityAttributesSecureAlways LoadBalancerSessionAffinityAttributesSecure = "Always"
- LoadBalancerSessionAffinityAttributesSecureNever LoadBalancerSessionAffinityAttributesSecure = "Never"
-)
-
-// Configures the zero-downtime failover between origins within a pool when session
-// affinity is enabled. This feature is currently incompatible with Argo, Tiered
-// Cache, and Bandwidth Alliance. The supported values are:
-//
-// - `"none"`: No failover takes place for sessions pinned to the origin (default).
-// - `"temporary"`: Traffic will be sent to another other healthy origin until the
-// originally pinned origin is available; note that this can potentially result
-// in heavy origin flapping.
-// - `"sticky"`: The session affinity cookie is updated and subsequent requests are
-// sent to the new origin. Note: Zero-downtime failover with sticky sessions is
-// currently not supported for session affinity by header.
-type LoadBalancerSessionAffinityAttributesZeroDowntimeFailover string
-
-const (
- LoadBalancerSessionAffinityAttributesZeroDowntimeFailoverNone LoadBalancerSessionAffinityAttributesZeroDowntimeFailover = "none"
- LoadBalancerSessionAffinityAttributesZeroDowntimeFailoverTemporary LoadBalancerSessionAffinityAttributesZeroDowntimeFailover = "temporary"
- LoadBalancerSessionAffinityAttributesZeroDowntimeFailoverSticky LoadBalancerSessionAffinityAttributesZeroDowntimeFailover = "sticky"
-)
-
-// Steering Policy for this load balancer.
-//
-// - `"off"`: Use `default_pools`.
-// - `"geo"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied
-// requests, the country for `country_pools` is determined by
-// `location_strategy`.
-// - `"random"`: Select a pool randomly.
-// - `"dynamic_latency"`: Use round trip time to select the closest pool in
-// default_pools (requires pool health checks).
-// - `"proximity"`: Use the pools' latitude and longitude to select the closest
-// pool using the Cloudflare PoP location for proxied requests or the location
-// determined by `location_strategy` for non-proxied requests.
-// - `"least_outstanding_requests"`: Select a pool by taking into consideration
-// `random_steering` weights, as well as each pool's number of outstanding
-// requests. Pools with more pending requests are weighted proportionately less
-// relative to others.
-// - `"least_connections"`: Select a pool by taking into consideration
-// `random_steering` weights, as well as each pool's number of open connections.
-// Pools with more open connections are weighted proportionately less relative to
-// others. Supported for HTTP/1 and HTTP/2 connections.
-// - `""`: Will map to `"geo"` if you use
-// `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.
-type LoadBalancerSteeringPolicy string
-
-const (
- LoadBalancerSteeringPolicyOff LoadBalancerSteeringPolicy = "off"
- LoadBalancerSteeringPolicyGeo LoadBalancerSteeringPolicy = "geo"
- LoadBalancerSteeringPolicyRandom LoadBalancerSteeringPolicy = "random"
- LoadBalancerSteeringPolicyDynamicLatency LoadBalancerSteeringPolicy = "dynamic_latency"
- LoadBalancerSteeringPolicyProximity LoadBalancerSteeringPolicy = "proximity"
- LoadBalancerSteeringPolicyLeastOutstandingRequests LoadBalancerSteeringPolicy = "least_outstanding_requests"
- LoadBalancerSteeringPolicyLeastConnections LoadBalancerSteeringPolicy = "least_connections"
- LoadBalancerSteeringPolicyEmpty LoadBalancerSteeringPolicy = "\"\""
-)
-
-type LoadBalancerDeleteResponse struct {
- ID string `json:"id"`
- JSON loadBalancerDeleteResponseJSON `json:"-"`
-}
-
-// loadBalancerDeleteResponseJSON contains the JSON metadata for the struct
-// [LoadBalancerDeleteResponse]
-type loadBalancerDeleteResponseJSON struct {
- ID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerDeleteResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerDeleteResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type LoadBalancerNewParams struct {
- ZoneID param.Field[string] `path:"zone_id,required"`
- // A list of pool IDs ordered by their failover priority. Pools defined here are
- // used by default, or when region_pools are not configured for a given region.
- DefaultPools param.Field[[]string] `json:"default_pools,required"`
- // The pool ID to use when all other pools are detected as unhealthy.
- FallbackPool param.Field[interface{}] `json:"fallback_pool,required"`
- // The DNS hostname to associate with your Load Balancer. If this hostname already
- // exists as a DNS record in Cloudflare's DNS, the Load Balancer will take
- // precedence and the DNS record will not be used.
- Name param.Field[string] `json:"name,required"`
- // Controls features that modify the routing of requests to pools and origins in
- // response to dynamic conditions, such as during the interval between active
- // health monitoring requests. For example, zero-downtime failover occurs
- // immediately when an origin becomes unavailable due to HTTP 521, 522, or 523
- // response codes. If there is another healthy origin in the same pool, the request
- // is retried once against this alternate origin.
- AdaptiveRouting param.Field[LoadBalancerNewParamsAdaptiveRouting] `json:"adaptive_routing"`
- // A mapping of country codes to a list of pool IDs (ordered by their failover
- // priority) for the given country. Any country not explicitly defined will fall
- // back to using the corresponding region_pool mapping if it exists else to
- // default_pools.
- CountryPools param.Field[interface{}] `json:"country_pools"`
- // Object description.
- Description param.Field[string] `json:"description"`
- // Controls location-based steering for non-proxied requests. See `steering_policy`
- // to learn how steering is affected.
- LocationStrategy param.Field[LoadBalancerNewParamsLocationStrategy] `json:"location_strategy"`
- // (Enterprise only): A mapping of Cloudflare PoP identifiers to a list of pool IDs
- // (ordered by their failover priority) for the PoP (datacenter). Any PoPs not
- // explicitly defined will fall back to using the corresponding country_pool, then
- // region_pool mapping if it exists else to default_pools.
- PopPools param.Field[interface{}] `json:"pop_pools"`
- // Whether the hostname should be gray clouded (false) or orange clouded (true).
- Proxied param.Field[bool] `json:"proxied"`
- // Configures pool weights.
- //
- // - `steering_policy="random"`: A random pool is selected with probability
- // proportional to pool weights.
- // - `steering_policy="least_outstanding_requests"`: Use pool weights to scale each
- // pool's outstanding requests.
- // - `steering_policy="least_connections"`: Use pool weights to scale each pool's
- // open connections.
- RandomSteering param.Field[LoadBalancerNewParamsRandomSteering] `json:"random_steering"`
- // A mapping of region codes to a list of pool IDs (ordered by their failover
- // priority) for the given region. Any regions not explicitly defined will fall
- // back to using default_pools.
- RegionPools param.Field[interface{}] `json:"region_pools"`
- // BETA Field Not General Access: A list of rules for this load balancer to
- // execute.
- Rules param.Field[[]LoadBalancerNewParamsRule] `json:"rules"`
- // Specifies the type of session affinity the load balancer should use unless
- // specified as `"none"` or "" (default). The supported types are:
- //
- // - `"cookie"`: On the first request to a proxied load balancer, a cookie is
- // generated, encoding information of which origin the request will be forwarded
- // to. Subsequent requests, by the same client to the same load balancer, will be
- // sent to the origin server the cookie encodes, for the duration of the cookie
- // and as long as the origin server remains healthy. If the cookie has expired or
- // the origin server is unhealthy, then a new origin server is calculated and
- // used.
- // - `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin
- // selection is stable and based on the client's ip address.
- // - `"header"`: On the first request to a proxied load balancer, a session key
- // based on the configured HTTP headers (see
- // `session_affinity_attributes.headers`) is generated, encoding the request
- // headers used for storing in the load balancer session state which origin the
- // request will be forwarded to. Subsequent requests to the load balancer with
- // the same headers will be sent to the same origin server, for the duration of
- // the session and as long as the origin server remains healthy. If the session
- // has been idle for the duration of `session_affinity_ttl` seconds or the origin
- // server is unhealthy, then a new origin server is calculated and used. See
- // `headers` in `session_affinity_attributes` for additional required
- // configuration.
- SessionAffinity param.Field[LoadBalancerNewParamsSessionAffinity] `json:"session_affinity"`
- // Configures attributes for session affinity.
- SessionAffinityAttributes param.Field[LoadBalancerNewParamsSessionAffinityAttributes] `json:"session_affinity_attributes"`
- // Time, in seconds, until a client's session expires after being created. Once the
- // expiry time has been reached, subsequent requests may get sent to a different
- // origin server. The accepted ranges per `session_affinity` policy are:
- //
- // - `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used
- // unless explicitly set. The accepted range of values is between [1800, 604800].
- // - `"header"`: The current default of 1800 seconds will be used unless explicitly
- // set. The accepted range of values is between [30, 3600]. Note: With session
- // affinity by header, sessions only expire after they haven't been used for the
- // number of seconds specified.
- SessionAffinityTTL param.Field[float64] `json:"session_affinity_ttl"`
- // Steering Policy for this load balancer.
- //
- // - `"off"`: Use `default_pools`.
- // - `"geo"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied
- // requests, the country for `country_pools` is determined by
- // `location_strategy`.
- // - `"random"`: Select a pool randomly.
- // - `"dynamic_latency"`: Use round trip time to select the closest pool in
- // default_pools (requires pool health checks).
- // - `"proximity"`: Use the pools' latitude and longitude to select the closest
- // pool using the Cloudflare PoP location for proxied requests or the location
- // determined by `location_strategy` for non-proxied requests.
- // - `"least_outstanding_requests"`: Select a pool by taking into consideration
- // `random_steering` weights, as well as each pool's number of outstanding
- // requests. Pools with more pending requests are weighted proportionately less
- // relative to others.
- // - `"least_connections"`: Select a pool by taking into consideration
- // `random_steering` weights, as well as each pool's number of open connections.
- // Pools with more open connections are weighted proportionately less relative to
- // others. Supported for HTTP/1 and HTTP/2 connections.
- // - `""`: Will map to `"geo"` if you use
- // `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.
- SteeringPolicy param.Field[LoadBalancerNewParamsSteeringPolicy] `json:"steering_policy"`
- // Time to live (TTL) of the DNS entry for the IP address returned by this load
- // balancer. This only applies to gray-clouded (unproxied) load balancers.
- TTL param.Field[float64] `json:"ttl"`
-}
-
-func (r LoadBalancerNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Controls features that modify the routing of requests to pools and origins in
-// response to dynamic conditions, such as during the interval between active
-// health monitoring requests. For example, zero-downtime failover occurs
-// immediately when an origin becomes unavailable due to HTTP 521, 522, or 523
-// response codes. If there is another healthy origin in the same pool, the request
-// is retried once against this alternate origin.
-type LoadBalancerNewParamsAdaptiveRouting struct {
- // Extends zero-downtime failover of requests to healthy origins from alternate
- // pools, when no healthy alternate exists in the same pool, according to the
- // failover order defined by traffic and origin steering. When set false (the
- // default) zero-downtime failover will only occur between origins within the same
- // pool. See `session_affinity_attributes` for control over when sessions are
- // broken or reassigned.
- FailoverAcrossPools param.Field[bool] `json:"failover_across_pools"`
-}
-
-func (r LoadBalancerNewParamsAdaptiveRouting) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Controls location-based steering for non-proxied requests. See `steering_policy`
-// to learn how steering is affected.
-type LoadBalancerNewParamsLocationStrategy struct {
- // Determines the authoritative location when ECS is not preferred, does not exist
- // in the request, or its GeoIP lookup is unsuccessful.
- //
- // - `"pop"`: Use the Cloudflare PoP location.
- // - `"resolver_ip"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is
- // unsuccessful, use the Cloudflare PoP location.
- Mode param.Field[LoadBalancerNewParamsLocationStrategyMode] `json:"mode"`
- // Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the
- // authoritative location.
- //
- // - `"always"`: Always prefer ECS.
- // - `"never"`: Never prefer ECS.
- // - `"proximity"`: Prefer ECS only when `steering_policy="proximity"`.
- // - `"geo"`: Prefer ECS only when `steering_policy="geo"`.
- PreferEcs param.Field[LoadBalancerNewParamsLocationStrategyPreferEcs] `json:"prefer_ecs"`
-}
-
-func (r LoadBalancerNewParamsLocationStrategy) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Determines the authoritative location when ECS is not preferred, does not exist
-// in the request, or its GeoIP lookup is unsuccessful.
-//
-// - `"pop"`: Use the Cloudflare PoP location.
-// - `"resolver_ip"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is
-// unsuccessful, use the Cloudflare PoP location.
-type LoadBalancerNewParamsLocationStrategyMode string
-
-const (
- LoadBalancerNewParamsLocationStrategyModePop LoadBalancerNewParamsLocationStrategyMode = "pop"
- LoadBalancerNewParamsLocationStrategyModeResolverIP LoadBalancerNewParamsLocationStrategyMode = "resolver_ip"
-)
-
-// Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the
-// authoritative location.
-//
-// - `"always"`: Always prefer ECS.
-// - `"never"`: Never prefer ECS.
-// - `"proximity"`: Prefer ECS only when `steering_policy="proximity"`.
-// - `"geo"`: Prefer ECS only when `steering_policy="geo"`.
-type LoadBalancerNewParamsLocationStrategyPreferEcs string
-
-const (
- LoadBalancerNewParamsLocationStrategyPreferEcsAlways LoadBalancerNewParamsLocationStrategyPreferEcs = "always"
- LoadBalancerNewParamsLocationStrategyPreferEcsNever LoadBalancerNewParamsLocationStrategyPreferEcs = "never"
- LoadBalancerNewParamsLocationStrategyPreferEcsProximity LoadBalancerNewParamsLocationStrategyPreferEcs = "proximity"
- LoadBalancerNewParamsLocationStrategyPreferEcsGeo LoadBalancerNewParamsLocationStrategyPreferEcs = "geo"
-)
-
-// Configures pool weights.
-//
-// - `steering_policy="random"`: A random pool is selected with probability
-// proportional to pool weights.
-// - `steering_policy="least_outstanding_requests"`: Use pool weights to scale each
-// pool's outstanding requests.
-// - `steering_policy="least_connections"`: Use pool weights to scale each pool's
-// open connections.
-type LoadBalancerNewParamsRandomSteering struct {
- // The default weight for pools in the load balancer that are not specified in the
- // pool_weights map.
- DefaultWeight param.Field[float64] `json:"default_weight"`
- // A mapping of pool IDs to custom weights. The weight is relative to other pools
- // in the load balancer.
- PoolWeights param.Field[interface{}] `json:"pool_weights"`
-}
-
-func (r LoadBalancerNewParamsRandomSteering) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// A rule object containing conditions and overrides for this load balancer to
-// evaluate.
-type LoadBalancerNewParamsRule struct {
- // The condition expressions to evaluate. If the condition evaluates to true, the
- // overrides or fixed_response in this rule will be applied. An empty condition is
- // always true. For more details on condition expressions, please see
- // https://developers.cloudflare.com/load-balancing/understand-basics/load-balancing-rules/expressions.
- Condition param.Field[string] `json:"condition"`
- // Disable this specific rule. It will no longer be evaluated by this load
- // balancer.
- Disabled param.Field[bool] `json:"disabled"`
- // A collection of fields used to directly respond to the eyeball instead of
- // routing to a pool. If a fixed_response is supplied the rule will be marked as
- // terminates.
- FixedResponse param.Field[LoadBalancerNewParamsRulesFixedResponse] `json:"fixed_response"`
- // Name of this rule. Only used for human readability.
- Name param.Field[string] `json:"name"`
- // A collection of overrides to apply to the load balancer when this rule's
- // condition is true. All fields are optional.
- Overrides param.Field[LoadBalancerNewParamsRulesOverrides] `json:"overrides"`
- // The order in which rules should be executed in relation to each other. Lower
- // values are executed first. Values do not need to be sequential. If no value is
- // provided for any rule the array order of the rules field will be used to assign
- // a priority.
- Priority param.Field[int64] `json:"priority"`
- // If this rule's condition is true, this causes rule evaluation to stop after
- // processing this rule.
- Terminates param.Field[bool] `json:"terminates"`
-}
-
-func (r LoadBalancerNewParamsRule) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// A collection of fields used to directly respond to the eyeball instead of
-// routing to a pool. If a fixed_response is supplied the rule will be marked as
-// terminates.
-type LoadBalancerNewParamsRulesFixedResponse struct {
- // The http 'Content-Type' header to include in the response.
- ContentType param.Field[string] `json:"content_type"`
- // The http 'Location' header to include in the response.
- Location param.Field[string] `json:"location"`
- // Text to include as the http body.
- MessageBody param.Field[string] `json:"message_body"`
- // The http status code to respond with.
- StatusCode param.Field[int64] `json:"status_code"`
-}
-
-func (r LoadBalancerNewParamsRulesFixedResponse) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// A collection of overrides to apply to the load balancer when this rule's
-// condition is true. All fields are optional.
-type LoadBalancerNewParamsRulesOverrides struct {
- // Controls features that modify the routing of requests to pools and origins in
- // response to dynamic conditions, such as during the interval between active
- // health monitoring requests. For example, zero-downtime failover occurs
- // immediately when an origin becomes unavailable due to HTTP 521, 522, or 523
- // response codes. If there is another healthy origin in the same pool, the request
- // is retried once against this alternate origin.
- AdaptiveRouting param.Field[LoadBalancerNewParamsRulesOverridesAdaptiveRouting] `json:"adaptive_routing"`
- // A mapping of country codes to a list of pool IDs (ordered by their failover
- // priority) for the given country. Any country not explicitly defined will fall
- // back to using the corresponding region_pool mapping if it exists else to
- // default_pools.
- CountryPools param.Field[interface{}] `json:"country_pools"`
- // A list of pool IDs ordered by their failover priority. Pools defined here are
- // used by default, or when region_pools are not configured for a given region.
- DefaultPools param.Field[[]string] `json:"default_pools"`
- // The pool ID to use when all other pools are detected as unhealthy.
- FallbackPool param.Field[interface{}] `json:"fallback_pool"`
- // Controls location-based steering for non-proxied requests. See `steering_policy`
- // to learn how steering is affected.
- LocationStrategy param.Field[LoadBalancerNewParamsRulesOverridesLocationStrategy] `json:"location_strategy"`
- // (Enterprise only): A mapping of Cloudflare PoP identifiers to a list of pool IDs
- // (ordered by their failover priority) for the PoP (datacenter). Any PoPs not
- // explicitly defined will fall back to using the corresponding country_pool, then
- // region_pool mapping if it exists else to default_pools.
- PopPools param.Field[interface{}] `json:"pop_pools"`
- // Configures pool weights.
- //
- // - `steering_policy="random"`: A random pool is selected with probability
- // proportional to pool weights.
- // - `steering_policy="least_outstanding_requests"`: Use pool weights to scale each
- // pool's outstanding requests.
- // - `steering_policy="least_connections"`: Use pool weights to scale each pool's
- // open connections.
- RandomSteering param.Field[LoadBalancerNewParamsRulesOverridesRandomSteering] `json:"random_steering"`
- // A mapping of region codes to a list of pool IDs (ordered by their failover
- // priority) for the given region. Any regions not explicitly defined will fall
- // back to using default_pools.
- RegionPools param.Field[interface{}] `json:"region_pools"`
- // Specifies the type of session affinity the load balancer should use unless
- // specified as `"none"` or "" (default). The supported types are:
- //
- // - `"cookie"`: On the first request to a proxied load balancer, a cookie is
- // generated, encoding information of which origin the request will be forwarded
- // to. Subsequent requests, by the same client to the same load balancer, will be
- // sent to the origin server the cookie encodes, for the duration of the cookie
- // and as long as the origin server remains healthy. If the cookie has expired or
- // the origin server is unhealthy, then a new origin server is calculated and
- // used.
- // - `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin
- // selection is stable and based on the client's ip address.
- // - `"header"`: On the first request to a proxied load balancer, a session key
- // based on the configured HTTP headers (see
- // `session_affinity_attributes.headers`) is generated, encoding the request
- // headers used for storing in the load balancer session state which origin the
- // request will be forwarded to. Subsequent requests to the load balancer with
- // the same headers will be sent to the same origin server, for the duration of
- // the session and as long as the origin server remains healthy. If the session
- // has been idle for the duration of `session_affinity_ttl` seconds or the origin
- // server is unhealthy, then a new origin server is calculated and used. See
- // `headers` in `session_affinity_attributes` for additional required
- // configuration.
- SessionAffinity param.Field[LoadBalancerNewParamsRulesOverridesSessionAffinity] `json:"session_affinity"`
- // Configures attributes for session affinity.
- SessionAffinityAttributes param.Field[LoadBalancerNewParamsRulesOverridesSessionAffinityAttributes] `json:"session_affinity_attributes"`
- // Time, in seconds, until a client's session expires after being created. Once the
- // expiry time has been reached, subsequent requests may get sent to a different
- // origin server. The accepted ranges per `session_affinity` policy are:
- //
- // - `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used
- // unless explicitly set. The accepted range of values is between [1800, 604800].
- // - `"header"`: The current default of 1800 seconds will be used unless explicitly
- // set. The accepted range of values is between [30, 3600]. Note: With session
- // affinity by header, sessions only expire after they haven't been used for the
- // number of seconds specified.
- SessionAffinityTTL param.Field[float64] `json:"session_affinity_ttl"`
- // Steering Policy for this load balancer.
- //
- // - `"off"`: Use `default_pools`.
- // - `"geo"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied
- // requests, the country for `country_pools` is determined by
- // `location_strategy`.
- // - `"random"`: Select a pool randomly.
- // - `"dynamic_latency"`: Use round trip time to select the closest pool in
- // default_pools (requires pool health checks).
- // - `"proximity"`: Use the pools' latitude and longitude to select the closest
- // pool using the Cloudflare PoP location for proxied requests or the location
- // determined by `location_strategy` for non-proxied requests.
- // - `"least_outstanding_requests"`: Select a pool by taking into consideration
- // `random_steering` weights, as well as each pool's number of outstanding
- // requests. Pools with more pending requests are weighted proportionately less
- // relative to others.
- // - `"least_connections"`: Select a pool by taking into consideration
- // `random_steering` weights, as well as each pool's number of open connections.
- // Pools with more open connections are weighted proportionately less relative to
- // others. Supported for HTTP/1 and HTTP/2 connections.
- // - `""`: Will map to `"geo"` if you use
- // `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.
- SteeringPolicy param.Field[LoadBalancerNewParamsRulesOverridesSteeringPolicy] `json:"steering_policy"`
- // Time to live (TTL) of the DNS entry for the IP address returned by this load
- // balancer. This only applies to gray-clouded (unproxied) load balancers.
- TTL param.Field[float64] `json:"ttl"`
-}
-
-func (r LoadBalancerNewParamsRulesOverrides) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Controls features that modify the routing of requests to pools and origins in
-// response to dynamic conditions, such as during the interval between active
-// health monitoring requests. For example, zero-downtime failover occurs
-// immediately when an origin becomes unavailable due to HTTP 521, 522, or 523
-// response codes. If there is another healthy origin in the same pool, the request
-// is retried once against this alternate origin.
-type LoadBalancerNewParamsRulesOverridesAdaptiveRouting struct {
- // Extends zero-downtime failover of requests to healthy origins from alternate
- // pools, when no healthy alternate exists in the same pool, according to the
- // failover order defined by traffic and origin steering. When set false (the
- // default) zero-downtime failover will only occur between origins within the same
- // pool. See `session_affinity_attributes` for control over when sessions are
- // broken or reassigned.
- FailoverAcrossPools param.Field[bool] `json:"failover_across_pools"`
-}
-
-func (r LoadBalancerNewParamsRulesOverridesAdaptiveRouting) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Controls location-based steering for non-proxied requests. See `steering_policy`
-// to learn how steering is affected.
-type LoadBalancerNewParamsRulesOverridesLocationStrategy struct {
- // Determines the authoritative location when ECS is not preferred, does not exist
- // in the request, or its GeoIP lookup is unsuccessful.
- //
- // - `"pop"`: Use the Cloudflare PoP location.
- // - `"resolver_ip"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is
- // unsuccessful, use the Cloudflare PoP location.
- Mode param.Field[LoadBalancerNewParamsRulesOverridesLocationStrategyMode] `json:"mode"`
- // Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the
- // authoritative location.
- //
- // - `"always"`: Always prefer ECS.
- // - `"never"`: Never prefer ECS.
- // - `"proximity"`: Prefer ECS only when `steering_policy="proximity"`.
- // - `"geo"`: Prefer ECS only when `steering_policy="geo"`.
- PreferEcs param.Field[LoadBalancerNewParamsRulesOverridesLocationStrategyPreferEcs] `json:"prefer_ecs"`
-}
-
-func (r LoadBalancerNewParamsRulesOverridesLocationStrategy) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Determines the authoritative location when ECS is not preferred, does not exist
-// in the request, or its GeoIP lookup is unsuccessful.
-//
-// - `"pop"`: Use the Cloudflare PoP location.
-// - `"resolver_ip"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is
-// unsuccessful, use the Cloudflare PoP location.
-type LoadBalancerNewParamsRulesOverridesLocationStrategyMode string
-
-const (
- LoadBalancerNewParamsRulesOverridesLocationStrategyModePop LoadBalancerNewParamsRulesOverridesLocationStrategyMode = "pop"
- LoadBalancerNewParamsRulesOverridesLocationStrategyModeResolverIP LoadBalancerNewParamsRulesOverridesLocationStrategyMode = "resolver_ip"
-)
-
-// Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the
-// authoritative location.
-//
-// - `"always"`: Always prefer ECS.
-// - `"never"`: Never prefer ECS.
-// - `"proximity"`: Prefer ECS only when `steering_policy="proximity"`.
-// - `"geo"`: Prefer ECS only when `steering_policy="geo"`.
-type LoadBalancerNewParamsRulesOverridesLocationStrategyPreferEcs string
-
-const (
- LoadBalancerNewParamsRulesOverridesLocationStrategyPreferEcsAlways LoadBalancerNewParamsRulesOverridesLocationStrategyPreferEcs = "always"
- LoadBalancerNewParamsRulesOverridesLocationStrategyPreferEcsNever LoadBalancerNewParamsRulesOverridesLocationStrategyPreferEcs = "never"
- LoadBalancerNewParamsRulesOverridesLocationStrategyPreferEcsProximity LoadBalancerNewParamsRulesOverridesLocationStrategyPreferEcs = "proximity"
- LoadBalancerNewParamsRulesOverridesLocationStrategyPreferEcsGeo LoadBalancerNewParamsRulesOverridesLocationStrategyPreferEcs = "geo"
-)
-
-// Configures pool weights.
-//
-// - `steering_policy="random"`: A random pool is selected with probability
-// proportional to pool weights.
-// - `steering_policy="least_outstanding_requests"`: Use pool weights to scale each
-// pool's outstanding requests.
-// - `steering_policy="least_connections"`: Use pool weights to scale each pool's
-// open connections.
-type LoadBalancerNewParamsRulesOverridesRandomSteering struct {
- // The default weight for pools in the load balancer that are not specified in the
- // pool_weights map.
- DefaultWeight param.Field[float64] `json:"default_weight"`
- // A mapping of pool IDs to custom weights. The weight is relative to other pools
- // in the load balancer.
- PoolWeights param.Field[interface{}] `json:"pool_weights"`
-}
-
-func (r LoadBalancerNewParamsRulesOverridesRandomSteering) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Specifies the type of session affinity the load balancer should use unless
-// specified as `"none"` or "" (default). The supported types are:
-//
-// - `"cookie"`: On the first request to a proxied load balancer, a cookie is
-// generated, encoding information of which origin the request will be forwarded
-// to. Subsequent requests, by the same client to the same load balancer, will be
-// sent to the origin server the cookie encodes, for the duration of the cookie
-// and as long as the origin server remains healthy. If the cookie has expired or
-// the origin server is unhealthy, then a new origin server is calculated and
-// used.
-// - `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin
-// selection is stable and based on the client's ip address.
-// - `"header"`: On the first request to a proxied load balancer, a session key
-// based on the configured HTTP headers (see
-// `session_affinity_attributes.headers`) is generated, encoding the request
-// headers used for storing in the load balancer session state which origin the
-// request will be forwarded to. Subsequent requests to the load balancer with
-// the same headers will be sent to the same origin server, for the duration of
-// the session and as long as the origin server remains healthy. If the session
-// has been idle for the duration of `session_affinity_ttl` seconds or the origin
-// server is unhealthy, then a new origin server is calculated and used. See
-// `headers` in `session_affinity_attributes` for additional required
-// configuration.
-type LoadBalancerNewParamsRulesOverridesSessionAffinity string
-
-const (
- LoadBalancerNewParamsRulesOverridesSessionAffinityNone LoadBalancerNewParamsRulesOverridesSessionAffinity = "none"
- LoadBalancerNewParamsRulesOverridesSessionAffinityCookie LoadBalancerNewParamsRulesOverridesSessionAffinity = "cookie"
- LoadBalancerNewParamsRulesOverridesSessionAffinityIPCookie LoadBalancerNewParamsRulesOverridesSessionAffinity = "ip_cookie"
- LoadBalancerNewParamsRulesOverridesSessionAffinityHeader LoadBalancerNewParamsRulesOverridesSessionAffinity = "header"
- LoadBalancerNewParamsRulesOverridesSessionAffinityEmpty LoadBalancerNewParamsRulesOverridesSessionAffinity = "\"\""
-)
-
-// Configures attributes for session affinity.
-type LoadBalancerNewParamsRulesOverridesSessionAffinityAttributes struct {
- // Configures the drain duration in seconds. This field is only used when session
- // affinity is enabled on the load balancer.
- DrainDuration param.Field[float64] `json:"drain_duration"`
- // Configures the names of HTTP headers to base session affinity on when header
- // `session_affinity` is enabled. At least one HTTP header name must be provided.
- // To specify the exact cookies to be used, include an item in the following
- // format: `"cookie:,"` (example) where everything
- // after the colon is a comma-separated list of cookie names. Providing only
- // `"cookie"` will result in all cookies being used. The default max number of HTTP
- // header names that can be provided depends on your plan: 5 for Enterprise, 1 for
- // all other plans.
- Headers param.Field[[]string] `json:"headers"`
- // When header `session_affinity` is enabled, this option can be used to specify
- // how HTTP headers on load balancing requests will be used. The supported values
- // are:
- //
- // - `"true"`: Load balancing requests must contain _all_ of the HTTP headers
- // specified by the `headers` session affinity attribute, otherwise sessions
- // aren't created.
- // - `"false"`: Load balancing requests must contain _at least one_ of the HTTP
- // headers specified by the `headers` session affinity attribute, otherwise
- // sessions aren't created.
- RequireAllHeaders param.Field[bool] `json:"require_all_headers"`
- // Configures the SameSite attribute on session affinity cookie. Value "Auto" will
- // be translated to "Lax" or "None" depending if Always Use HTTPS is enabled. Note:
- // when using value "None", the secure attribute can not be set to "Never".
- Samesite param.Field[LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesSamesite] `json:"samesite"`
- // Configures the Secure attribute on session affinity cookie. Value "Always"
- // indicates the Secure attribute will be set in the Set-Cookie header, "Never"
- // indicates the Secure attribute will not be set, and "Auto" will set the Secure
- // attribute depending if Always Use HTTPS is enabled.
- Secure param.Field[LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesSecure] `json:"secure"`
- // Configures the zero-downtime failover between origins within a pool when session
- // affinity is enabled. This feature is currently incompatible with Argo, Tiered
- // Cache, and Bandwidth Alliance. The supported values are:
- //
- // - `"none"`: No failover takes place for sessions pinned to the origin (default).
- // - `"temporary"`: Traffic will be sent to another other healthy origin until the
- // originally pinned origin is available; note that this can potentially result
- // in heavy origin flapping.
- // - `"sticky"`: The session affinity cookie is updated and subsequent requests are
- // sent to the new origin. Note: Zero-downtime failover with sticky sessions is
- // currently not supported for session affinity by header.
- ZeroDowntimeFailover param.Field[LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailover] `json:"zero_downtime_failover"`
-}
-
-func (r LoadBalancerNewParamsRulesOverridesSessionAffinityAttributes) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Configures the SameSite attribute on session affinity cookie. Value "Auto" will
-// be translated to "Lax" or "None" depending if Always Use HTTPS is enabled. Note:
-// when using value "None", the secure attribute can not be set to "Never".
-type LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesSamesite string
-
-const (
- LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesSamesiteAuto LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesSamesite = "Auto"
- LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesSamesiteLax LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesSamesite = "Lax"
- LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesSamesiteNone LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesSamesite = "None"
- LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesSamesiteStrict LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesSamesite = "Strict"
-)
-
-// Configures the Secure attribute on session affinity cookie. Value "Always"
-// indicates the Secure attribute will be set in the Set-Cookie header, "Never"
-// indicates the Secure attribute will not be set, and "Auto" will set the Secure
-// attribute depending if Always Use HTTPS is enabled.
-type LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesSecure string
-
-const (
- LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesSecureAuto LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesSecure = "Auto"
- LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesSecureAlways LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesSecure = "Always"
- LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesSecureNever LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesSecure = "Never"
-)
-
-// Configures the zero-downtime failover between origins within a pool when session
-// affinity is enabled. This feature is currently incompatible with Argo, Tiered
-// Cache, and Bandwidth Alliance. The supported values are:
-//
-// - `"none"`: No failover takes place for sessions pinned to the origin (default).
-// - `"temporary"`: Traffic will be sent to another other healthy origin until the
-// originally pinned origin is available; note that this can potentially result
-// in heavy origin flapping.
-// - `"sticky"`: The session affinity cookie is updated and subsequent requests are
-// sent to the new origin. Note: Zero-downtime failover with sticky sessions is
-// currently not supported for session affinity by header.
-type LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailover string
-
-const (
- LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailoverNone LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailover = "none"
- LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailoverTemporary LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailover = "temporary"
- LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailoverSticky LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailover = "sticky"
-)
-
-// Steering Policy for this load balancer.
-//
-// - `"off"`: Use `default_pools`.
-// - `"geo"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied
-// requests, the country for `country_pools` is determined by
-// `location_strategy`.
-// - `"random"`: Select a pool randomly.
-// - `"dynamic_latency"`: Use round trip time to select the closest pool in
-// default_pools (requires pool health checks).
-// - `"proximity"`: Use the pools' latitude and longitude to select the closest
-// pool using the Cloudflare PoP location for proxied requests or the location
-// determined by `location_strategy` for non-proxied requests.
-// - `"least_outstanding_requests"`: Select a pool by taking into consideration
-// `random_steering` weights, as well as each pool's number of outstanding
-// requests. Pools with more pending requests are weighted proportionately less
-// relative to others.
-// - `"least_connections"`: Select a pool by taking into consideration
-// `random_steering` weights, as well as each pool's number of open connections.
-// Pools with more open connections are weighted proportionately less relative to
-// others. Supported for HTTP/1 and HTTP/2 connections.
-// - `""`: Will map to `"geo"` if you use
-// `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.
-type LoadBalancerNewParamsRulesOverridesSteeringPolicy string
-
-const (
- LoadBalancerNewParamsRulesOverridesSteeringPolicyOff LoadBalancerNewParamsRulesOverridesSteeringPolicy = "off"
- LoadBalancerNewParamsRulesOverridesSteeringPolicyGeo LoadBalancerNewParamsRulesOverridesSteeringPolicy = "geo"
- LoadBalancerNewParamsRulesOverridesSteeringPolicyRandom LoadBalancerNewParamsRulesOverridesSteeringPolicy = "random"
- LoadBalancerNewParamsRulesOverridesSteeringPolicyDynamicLatency LoadBalancerNewParamsRulesOverridesSteeringPolicy = "dynamic_latency"
- LoadBalancerNewParamsRulesOverridesSteeringPolicyProximity LoadBalancerNewParamsRulesOverridesSteeringPolicy = "proximity"
- LoadBalancerNewParamsRulesOverridesSteeringPolicyLeastOutstandingRequests LoadBalancerNewParamsRulesOverridesSteeringPolicy = "least_outstanding_requests"
- LoadBalancerNewParamsRulesOverridesSteeringPolicyLeastConnections LoadBalancerNewParamsRulesOverridesSteeringPolicy = "least_connections"
- LoadBalancerNewParamsRulesOverridesSteeringPolicyEmpty LoadBalancerNewParamsRulesOverridesSteeringPolicy = "\"\""
-)
-
-// Specifies the type of session affinity the load balancer should use unless
-// specified as `"none"` or "" (default). The supported types are:
-//
-// - `"cookie"`: On the first request to a proxied load balancer, a cookie is
-// generated, encoding information of which origin the request will be forwarded
-// to. Subsequent requests, by the same client to the same load balancer, will be
-// sent to the origin server the cookie encodes, for the duration of the cookie
-// and as long as the origin server remains healthy. If the cookie has expired or
-// the origin server is unhealthy, then a new origin server is calculated and
-// used.
-// - `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin
-// selection is stable and based on the client's ip address.
-// - `"header"`: On the first request to a proxied load balancer, a session key
-// based on the configured HTTP headers (see
-// `session_affinity_attributes.headers`) is generated, encoding the request
-// headers used for storing in the load balancer session state which origin the
-// request will be forwarded to. Subsequent requests to the load balancer with
-// the same headers will be sent to the same origin server, for the duration of
-// the session and as long as the origin server remains healthy. If the session
-// has been idle for the duration of `session_affinity_ttl` seconds or the origin
-// server is unhealthy, then a new origin server is calculated and used. See
-// `headers` in `session_affinity_attributes` for additional required
-// configuration.
-type LoadBalancerNewParamsSessionAffinity string
-
-const (
- LoadBalancerNewParamsSessionAffinityNone LoadBalancerNewParamsSessionAffinity = "none"
- LoadBalancerNewParamsSessionAffinityCookie LoadBalancerNewParamsSessionAffinity = "cookie"
- LoadBalancerNewParamsSessionAffinityIPCookie LoadBalancerNewParamsSessionAffinity = "ip_cookie"
- LoadBalancerNewParamsSessionAffinityHeader LoadBalancerNewParamsSessionAffinity = "header"
- LoadBalancerNewParamsSessionAffinityEmpty LoadBalancerNewParamsSessionAffinity = "\"\""
-)
-
-// Configures attributes for session affinity.
-type LoadBalancerNewParamsSessionAffinityAttributes struct {
- // Configures the drain duration in seconds. This field is only used when session
- // affinity is enabled on the load balancer.
- DrainDuration param.Field[float64] `json:"drain_duration"`
- // Configures the names of HTTP headers to base session affinity on when header
- // `session_affinity` is enabled. At least one HTTP header name must be provided.
- // To specify the exact cookies to be used, include an item in the following
- // format: `"cookie:,"` (example) where everything
- // after the colon is a comma-separated list of cookie names. Providing only
- // `"cookie"` will result in all cookies being used. The default max number of HTTP
- // header names that can be provided depends on your plan: 5 for Enterprise, 1 for
- // all other plans.
- Headers param.Field[[]string] `json:"headers"`
- // When header `session_affinity` is enabled, this option can be used to specify
- // how HTTP headers on load balancing requests will be used. The supported values
- // are:
- //
- // - `"true"`: Load balancing requests must contain _all_ of the HTTP headers
- // specified by the `headers` session affinity attribute, otherwise sessions
- // aren't created.
- // - `"false"`: Load balancing requests must contain _at least one_ of the HTTP
- // headers specified by the `headers` session affinity attribute, otherwise
- // sessions aren't created.
- RequireAllHeaders param.Field[bool] `json:"require_all_headers"`
- // Configures the SameSite attribute on session affinity cookie. Value "Auto" will
- // be translated to "Lax" or "None" depending if Always Use HTTPS is enabled. Note:
- // when using value "None", the secure attribute can not be set to "Never".
- Samesite param.Field[LoadBalancerNewParamsSessionAffinityAttributesSamesite] `json:"samesite"`
- // Configures the Secure attribute on session affinity cookie. Value "Always"
- // indicates the Secure attribute will be set in the Set-Cookie header, "Never"
- // indicates the Secure attribute will not be set, and "Auto" will set the Secure
- // attribute depending if Always Use HTTPS is enabled.
- Secure param.Field[LoadBalancerNewParamsSessionAffinityAttributesSecure] `json:"secure"`
- // Configures the zero-downtime failover between origins within a pool when session
- // affinity is enabled. This feature is currently incompatible with Argo, Tiered
- // Cache, and Bandwidth Alliance. The supported values are:
- //
- // - `"none"`: No failover takes place for sessions pinned to the origin (default).
- // - `"temporary"`: Traffic will be sent to another other healthy origin until the
- // originally pinned origin is available; note that this can potentially result
- // in heavy origin flapping.
- // - `"sticky"`: The session affinity cookie is updated and subsequent requests are
- // sent to the new origin. Note: Zero-downtime failover with sticky sessions is
- // currently not supported for session affinity by header.
- ZeroDowntimeFailover param.Field[LoadBalancerNewParamsSessionAffinityAttributesZeroDowntimeFailover] `json:"zero_downtime_failover"`
-}
-
-func (r LoadBalancerNewParamsSessionAffinityAttributes) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Configures the SameSite attribute on session affinity cookie. Value "Auto" will
-// be translated to "Lax" or "None" depending if Always Use HTTPS is enabled. Note:
-// when using value "None", the secure attribute can not be set to "Never".
-type LoadBalancerNewParamsSessionAffinityAttributesSamesite string
-
-const (
- LoadBalancerNewParamsSessionAffinityAttributesSamesiteAuto LoadBalancerNewParamsSessionAffinityAttributesSamesite = "Auto"
- LoadBalancerNewParamsSessionAffinityAttributesSamesiteLax LoadBalancerNewParamsSessionAffinityAttributesSamesite = "Lax"
- LoadBalancerNewParamsSessionAffinityAttributesSamesiteNone LoadBalancerNewParamsSessionAffinityAttributesSamesite = "None"
- LoadBalancerNewParamsSessionAffinityAttributesSamesiteStrict LoadBalancerNewParamsSessionAffinityAttributesSamesite = "Strict"
-)
-
-// Configures the Secure attribute on session affinity cookie. Value "Always"
-// indicates the Secure attribute will be set in the Set-Cookie header, "Never"
-// indicates the Secure attribute will not be set, and "Auto" will set the Secure
-// attribute depending if Always Use HTTPS is enabled.
-type LoadBalancerNewParamsSessionAffinityAttributesSecure string
-
-const (
- LoadBalancerNewParamsSessionAffinityAttributesSecureAuto LoadBalancerNewParamsSessionAffinityAttributesSecure = "Auto"
- LoadBalancerNewParamsSessionAffinityAttributesSecureAlways LoadBalancerNewParamsSessionAffinityAttributesSecure = "Always"
- LoadBalancerNewParamsSessionAffinityAttributesSecureNever LoadBalancerNewParamsSessionAffinityAttributesSecure = "Never"
-)
-
-// Configures the zero-downtime failover between origins within a pool when session
-// affinity is enabled. This feature is currently incompatible with Argo, Tiered
-// Cache, and Bandwidth Alliance. The supported values are:
-//
-// - `"none"`: No failover takes place for sessions pinned to the origin (default).
-// - `"temporary"`: Traffic will be sent to another other healthy origin until the
-// originally pinned origin is available; note that this can potentially result
-// in heavy origin flapping.
-// - `"sticky"`: The session affinity cookie is updated and subsequent requests are
-// sent to the new origin. Note: Zero-downtime failover with sticky sessions is
-// currently not supported for session affinity by header.
-type LoadBalancerNewParamsSessionAffinityAttributesZeroDowntimeFailover string
-
-const (
- LoadBalancerNewParamsSessionAffinityAttributesZeroDowntimeFailoverNone LoadBalancerNewParamsSessionAffinityAttributesZeroDowntimeFailover = "none"
- LoadBalancerNewParamsSessionAffinityAttributesZeroDowntimeFailoverTemporary LoadBalancerNewParamsSessionAffinityAttributesZeroDowntimeFailover = "temporary"
- LoadBalancerNewParamsSessionAffinityAttributesZeroDowntimeFailoverSticky LoadBalancerNewParamsSessionAffinityAttributesZeroDowntimeFailover = "sticky"
-)
-
-// Steering Policy for this load balancer.
-//
-// - `"off"`: Use `default_pools`.
-// - `"geo"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied
-// requests, the country for `country_pools` is determined by
-// `location_strategy`.
-// - `"random"`: Select a pool randomly.
-// - `"dynamic_latency"`: Use round trip time to select the closest pool in
-// default_pools (requires pool health checks).
-// - `"proximity"`: Use the pools' latitude and longitude to select the closest
-// pool using the Cloudflare PoP location for proxied requests or the location
-// determined by `location_strategy` for non-proxied requests.
-// - `"least_outstanding_requests"`: Select a pool by taking into consideration
-// `random_steering` weights, as well as each pool's number of outstanding
-// requests. Pools with more pending requests are weighted proportionately less
-// relative to others.
-// - `"least_connections"`: Select a pool by taking into consideration
-// `random_steering` weights, as well as each pool's number of open connections.
-// Pools with more open connections are weighted proportionately less relative to
-// others. Supported for HTTP/1 and HTTP/2 connections.
-// - `""`: Will map to `"geo"` if you use
-// `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.
-type LoadBalancerNewParamsSteeringPolicy string
-
-const (
- LoadBalancerNewParamsSteeringPolicyOff LoadBalancerNewParamsSteeringPolicy = "off"
- LoadBalancerNewParamsSteeringPolicyGeo LoadBalancerNewParamsSteeringPolicy = "geo"
- LoadBalancerNewParamsSteeringPolicyRandom LoadBalancerNewParamsSteeringPolicy = "random"
- LoadBalancerNewParamsSteeringPolicyDynamicLatency LoadBalancerNewParamsSteeringPolicy = "dynamic_latency"
- LoadBalancerNewParamsSteeringPolicyProximity LoadBalancerNewParamsSteeringPolicy = "proximity"
- LoadBalancerNewParamsSteeringPolicyLeastOutstandingRequests LoadBalancerNewParamsSteeringPolicy = "least_outstanding_requests"
- LoadBalancerNewParamsSteeringPolicyLeastConnections LoadBalancerNewParamsSteeringPolicy = "least_connections"
- LoadBalancerNewParamsSteeringPolicyEmpty LoadBalancerNewParamsSteeringPolicy = "\"\""
-)
-
-type LoadBalancerNewResponseEnvelope struct {
- Errors []LoadBalancerNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []LoadBalancerNewResponseEnvelopeMessages `json:"messages,required"`
- Result LoadBalancer `json:"result,required"`
- // Whether the API call was successful
- Success LoadBalancerNewResponseEnvelopeSuccess `json:"success,required"`
- JSON loadBalancerNewResponseEnvelopeJSON `json:"-"`
-}
-
-// loadBalancerNewResponseEnvelopeJSON contains the JSON metadata for the struct
-// [LoadBalancerNewResponseEnvelope]
-type loadBalancerNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type LoadBalancerNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON loadBalancerNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// loadBalancerNewResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [LoadBalancerNewResponseEnvelopeErrors]
-type loadBalancerNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type LoadBalancerNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON loadBalancerNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// loadBalancerNewResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [LoadBalancerNewResponseEnvelopeMessages]
-type loadBalancerNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type LoadBalancerNewResponseEnvelopeSuccess bool
-
-const (
- LoadBalancerNewResponseEnvelopeSuccessTrue LoadBalancerNewResponseEnvelopeSuccess = true
-)
-
-type LoadBalancerUpdateParams struct {
- ZoneID param.Field[string] `path:"zone_id,required"`
- // A list of pool IDs ordered by their failover priority. Pools defined here are
- // used by default, or when region_pools are not configured for a given region.
- DefaultPools param.Field[[]string] `json:"default_pools,required"`
- // The pool ID to use when all other pools are detected as unhealthy.
- FallbackPool param.Field[interface{}] `json:"fallback_pool,required"`
- // The DNS hostname to associate with your Load Balancer. If this hostname already
- // exists as a DNS record in Cloudflare's DNS, the Load Balancer will take
- // precedence and the DNS record will not be used.
- Name param.Field[string] `json:"name,required"`
- // Controls features that modify the routing of requests to pools and origins in
- // response to dynamic conditions, such as during the interval between active
- // health monitoring requests. For example, zero-downtime failover occurs
- // immediately when an origin becomes unavailable due to HTTP 521, 522, or 523
- // response codes. If there is another healthy origin in the same pool, the request
- // is retried once against this alternate origin.
- AdaptiveRouting param.Field[LoadBalancerUpdateParamsAdaptiveRouting] `json:"adaptive_routing"`
- // A mapping of country codes to a list of pool IDs (ordered by their failover
- // priority) for the given country. Any country not explicitly defined will fall
- // back to using the corresponding region_pool mapping if it exists else to
- // default_pools.
- CountryPools param.Field[interface{}] `json:"country_pools"`
- // Object description.
- Description param.Field[string] `json:"description"`
- // Whether to enable (the default) this load balancer.
- Enabled param.Field[bool] `json:"enabled"`
- // Controls location-based steering for non-proxied requests. See `steering_policy`
- // to learn how steering is affected.
- LocationStrategy param.Field[LoadBalancerUpdateParamsLocationStrategy] `json:"location_strategy"`
- // (Enterprise only): A mapping of Cloudflare PoP identifiers to a list of pool IDs
- // (ordered by their failover priority) for the PoP (datacenter). Any PoPs not
- // explicitly defined will fall back to using the corresponding country_pool, then
- // region_pool mapping if it exists else to default_pools.
- PopPools param.Field[interface{}] `json:"pop_pools"`
- // Whether the hostname should be gray clouded (false) or orange clouded (true).
- Proxied param.Field[bool] `json:"proxied"`
- // Configures pool weights.
- //
- // - `steering_policy="random"`: A random pool is selected with probability
- // proportional to pool weights.
- // - `steering_policy="least_outstanding_requests"`: Use pool weights to scale each
- // pool's outstanding requests.
- // - `steering_policy="least_connections"`: Use pool weights to scale each pool's
- // open connections.
- RandomSteering param.Field[LoadBalancerUpdateParamsRandomSteering] `json:"random_steering"`
- // A mapping of region codes to a list of pool IDs (ordered by their failover
- // priority) for the given region. Any regions not explicitly defined will fall
- // back to using default_pools.
- RegionPools param.Field[interface{}] `json:"region_pools"`
- // BETA Field Not General Access: A list of rules for this load balancer to
- // execute.
- Rules param.Field[[]LoadBalancerUpdateParamsRule] `json:"rules"`
- // Specifies the type of session affinity the load balancer should use unless
- // specified as `"none"` or "" (default). The supported types are:
- //
- // - `"cookie"`: On the first request to a proxied load balancer, a cookie is
- // generated, encoding information of which origin the request will be forwarded
- // to. Subsequent requests, by the same client to the same load balancer, will be
- // sent to the origin server the cookie encodes, for the duration of the cookie
- // and as long as the origin server remains healthy. If the cookie has expired or
- // the origin server is unhealthy, then a new origin server is calculated and
- // used.
- // - `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin
- // selection is stable and based on the client's ip address.
- // - `"header"`: On the first request to a proxied load balancer, a session key
- // based on the configured HTTP headers (see
- // `session_affinity_attributes.headers`) is generated, encoding the request
- // headers used for storing in the load balancer session state which origin the
- // request will be forwarded to. Subsequent requests to the load balancer with
- // the same headers will be sent to the same origin server, for the duration of
- // the session and as long as the origin server remains healthy. If the session
- // has been idle for the duration of `session_affinity_ttl` seconds or the origin
- // server is unhealthy, then a new origin server is calculated and used. See
- // `headers` in `session_affinity_attributes` for additional required
- // configuration.
- SessionAffinity param.Field[LoadBalancerUpdateParamsSessionAffinity] `json:"session_affinity"`
- // Configures attributes for session affinity.
- SessionAffinityAttributes param.Field[LoadBalancerUpdateParamsSessionAffinityAttributes] `json:"session_affinity_attributes"`
- // Time, in seconds, until a client's session expires after being created. Once the
- // expiry time has been reached, subsequent requests may get sent to a different
- // origin server. The accepted ranges per `session_affinity` policy are:
- //
- // - `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used
- // unless explicitly set. The accepted range of values is between [1800, 604800].
- // - `"header"`: The current default of 1800 seconds will be used unless explicitly
- // set. The accepted range of values is between [30, 3600]. Note: With session
- // affinity by header, sessions only expire after they haven't been used for the
- // number of seconds specified.
- SessionAffinityTTL param.Field[float64] `json:"session_affinity_ttl"`
- // Steering Policy for this load balancer.
- //
- // - `"off"`: Use `default_pools`.
- // - `"geo"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied
- // requests, the country for `country_pools` is determined by
- // `location_strategy`.
- // - `"random"`: Select a pool randomly.
- // - `"dynamic_latency"`: Use round trip time to select the closest pool in
- // default_pools (requires pool health checks).
- // - `"proximity"`: Use the pools' latitude and longitude to select the closest
- // pool using the Cloudflare PoP location for proxied requests or the location
- // determined by `location_strategy` for non-proxied requests.
- // - `"least_outstanding_requests"`: Select a pool by taking into consideration
- // `random_steering` weights, as well as each pool's number of outstanding
- // requests. Pools with more pending requests are weighted proportionately less
- // relative to others.
- // - `"least_connections"`: Select a pool by taking into consideration
- // `random_steering` weights, as well as each pool's number of open connections.
- // Pools with more open connections are weighted proportionately less relative to
- // others. Supported for HTTP/1 and HTTP/2 connections.
- // - `""`: Will map to `"geo"` if you use
- // `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.
- SteeringPolicy param.Field[LoadBalancerUpdateParamsSteeringPolicy] `json:"steering_policy"`
- // Time to live (TTL) of the DNS entry for the IP address returned by this load
- // balancer. This only applies to gray-clouded (unproxied) load balancers.
- TTL param.Field[float64] `json:"ttl"`
-}
-
-func (r LoadBalancerUpdateParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Controls features that modify the routing of requests to pools and origins in
-// response to dynamic conditions, such as during the interval between active
-// health monitoring requests. For example, zero-downtime failover occurs
-// immediately when an origin becomes unavailable due to HTTP 521, 522, or 523
-// response codes. If there is another healthy origin in the same pool, the request
-// is retried once against this alternate origin.
-type LoadBalancerUpdateParamsAdaptiveRouting struct {
- // Extends zero-downtime failover of requests to healthy origins from alternate
- // pools, when no healthy alternate exists in the same pool, according to the
- // failover order defined by traffic and origin steering. When set false (the
- // default) zero-downtime failover will only occur between origins within the same
- // pool. See `session_affinity_attributes` for control over when sessions are
- // broken or reassigned.
- FailoverAcrossPools param.Field[bool] `json:"failover_across_pools"`
-}
-
-func (r LoadBalancerUpdateParamsAdaptiveRouting) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Controls location-based steering for non-proxied requests. See `steering_policy`
-// to learn how steering is affected.
-type LoadBalancerUpdateParamsLocationStrategy struct {
- // Determines the authoritative location when ECS is not preferred, does not exist
- // in the request, or its GeoIP lookup is unsuccessful.
- //
- // - `"pop"`: Use the Cloudflare PoP location.
- // - `"resolver_ip"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is
- // unsuccessful, use the Cloudflare PoP location.
- Mode param.Field[LoadBalancerUpdateParamsLocationStrategyMode] `json:"mode"`
- // Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the
- // authoritative location.
- //
- // - `"always"`: Always prefer ECS.
- // - `"never"`: Never prefer ECS.
- // - `"proximity"`: Prefer ECS only when `steering_policy="proximity"`.
- // - `"geo"`: Prefer ECS only when `steering_policy="geo"`.
- PreferEcs param.Field[LoadBalancerUpdateParamsLocationStrategyPreferEcs] `json:"prefer_ecs"`
-}
-
-func (r LoadBalancerUpdateParamsLocationStrategy) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Determines the authoritative location when ECS is not preferred, does not exist
-// in the request, or its GeoIP lookup is unsuccessful.
-//
-// - `"pop"`: Use the Cloudflare PoP location.
-// - `"resolver_ip"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is
-// unsuccessful, use the Cloudflare PoP location.
-type LoadBalancerUpdateParamsLocationStrategyMode string
-
-const (
- LoadBalancerUpdateParamsLocationStrategyModePop LoadBalancerUpdateParamsLocationStrategyMode = "pop"
- LoadBalancerUpdateParamsLocationStrategyModeResolverIP LoadBalancerUpdateParamsLocationStrategyMode = "resolver_ip"
-)
-
-// Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the
-// authoritative location.
-//
-// - `"always"`: Always prefer ECS.
-// - `"never"`: Never prefer ECS.
-// - `"proximity"`: Prefer ECS only when `steering_policy="proximity"`.
-// - `"geo"`: Prefer ECS only when `steering_policy="geo"`.
-type LoadBalancerUpdateParamsLocationStrategyPreferEcs string
-
-const (
- LoadBalancerUpdateParamsLocationStrategyPreferEcsAlways LoadBalancerUpdateParamsLocationStrategyPreferEcs = "always"
- LoadBalancerUpdateParamsLocationStrategyPreferEcsNever LoadBalancerUpdateParamsLocationStrategyPreferEcs = "never"
- LoadBalancerUpdateParamsLocationStrategyPreferEcsProximity LoadBalancerUpdateParamsLocationStrategyPreferEcs = "proximity"
- LoadBalancerUpdateParamsLocationStrategyPreferEcsGeo LoadBalancerUpdateParamsLocationStrategyPreferEcs = "geo"
-)
-
-// Configures pool weights.
-//
-// - `steering_policy="random"`: A random pool is selected with probability
-// proportional to pool weights.
-// - `steering_policy="least_outstanding_requests"`: Use pool weights to scale each
-// pool's outstanding requests.
-// - `steering_policy="least_connections"`: Use pool weights to scale each pool's
-// open connections.
-type LoadBalancerUpdateParamsRandomSteering struct {
- // The default weight for pools in the load balancer that are not specified in the
- // pool_weights map.
- DefaultWeight param.Field[float64] `json:"default_weight"`
- // A mapping of pool IDs to custom weights. The weight is relative to other pools
- // in the load balancer.
- PoolWeights param.Field[interface{}] `json:"pool_weights"`
-}
-
-func (r LoadBalancerUpdateParamsRandomSteering) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// A rule object containing conditions and overrides for this load balancer to
-// evaluate.
-type LoadBalancerUpdateParamsRule struct {
- // The condition expressions to evaluate. If the condition evaluates to true, the
- // overrides or fixed_response in this rule will be applied. An empty condition is
- // always true. For more details on condition expressions, please see
- // https://developers.cloudflare.com/load-balancing/understand-basics/load-balancing-rules/expressions.
- Condition param.Field[string] `json:"condition"`
- // Disable this specific rule. It will no longer be evaluated by this load
- // balancer.
- Disabled param.Field[bool] `json:"disabled"`
- // A collection of fields used to directly respond to the eyeball instead of
- // routing to a pool. If a fixed_response is supplied the rule will be marked as
- // terminates.
- FixedResponse param.Field[LoadBalancerUpdateParamsRulesFixedResponse] `json:"fixed_response"`
- // Name of this rule. Only used for human readability.
- Name param.Field[string] `json:"name"`
- // A collection of overrides to apply to the load balancer when this rule's
- // condition is true. All fields are optional.
- Overrides param.Field[LoadBalancerUpdateParamsRulesOverrides] `json:"overrides"`
- // The order in which rules should be executed in relation to each other. Lower
- // values are executed first. Values do not need to be sequential. If no value is
- // provided for any rule the array order of the rules field will be used to assign
- // a priority.
- Priority param.Field[int64] `json:"priority"`
- // If this rule's condition is true, this causes rule evaluation to stop after
- // processing this rule.
- Terminates param.Field[bool] `json:"terminates"`
-}
-
-func (r LoadBalancerUpdateParamsRule) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// A collection of fields used to directly respond to the eyeball instead of
-// routing to a pool. If a fixed_response is supplied the rule will be marked as
-// terminates.
-type LoadBalancerUpdateParamsRulesFixedResponse struct {
- // The http 'Content-Type' header to include in the response.
- ContentType param.Field[string] `json:"content_type"`
- // The http 'Location' header to include in the response.
- Location param.Field[string] `json:"location"`
- // Text to include as the http body.
- MessageBody param.Field[string] `json:"message_body"`
- // The http status code to respond with.
- StatusCode param.Field[int64] `json:"status_code"`
-}
-
-func (r LoadBalancerUpdateParamsRulesFixedResponse) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// A collection of overrides to apply to the load balancer when this rule's
-// condition is true. All fields are optional.
-type LoadBalancerUpdateParamsRulesOverrides struct {
- // Controls features that modify the routing of requests to pools and origins in
- // response to dynamic conditions, such as during the interval between active
- // health monitoring requests. For example, zero-downtime failover occurs
- // immediately when an origin becomes unavailable due to HTTP 521, 522, or 523
- // response codes. If there is another healthy origin in the same pool, the request
- // is retried once against this alternate origin.
- AdaptiveRouting param.Field[LoadBalancerUpdateParamsRulesOverridesAdaptiveRouting] `json:"adaptive_routing"`
- // A mapping of country codes to a list of pool IDs (ordered by their failover
- // priority) for the given country. Any country not explicitly defined will fall
- // back to using the corresponding region_pool mapping if it exists else to
- // default_pools.
- CountryPools param.Field[interface{}] `json:"country_pools"`
- // A list of pool IDs ordered by their failover priority. Pools defined here are
- // used by default, or when region_pools are not configured for a given region.
- DefaultPools param.Field[[]string] `json:"default_pools"`
- // The pool ID to use when all other pools are detected as unhealthy.
- FallbackPool param.Field[interface{}] `json:"fallback_pool"`
- // Controls location-based steering for non-proxied requests. See `steering_policy`
- // to learn how steering is affected.
- LocationStrategy param.Field[LoadBalancerUpdateParamsRulesOverridesLocationStrategy] `json:"location_strategy"`
- // (Enterprise only): A mapping of Cloudflare PoP identifiers to a list of pool IDs
- // (ordered by their failover priority) for the PoP (datacenter). Any PoPs not
- // explicitly defined will fall back to using the corresponding country_pool, then
- // region_pool mapping if it exists else to default_pools.
- PopPools param.Field[interface{}] `json:"pop_pools"`
- // Configures pool weights.
- //
- // - `steering_policy="random"`: A random pool is selected with probability
- // proportional to pool weights.
- // - `steering_policy="least_outstanding_requests"`: Use pool weights to scale each
- // pool's outstanding requests.
- // - `steering_policy="least_connections"`: Use pool weights to scale each pool's
- // open connections.
- RandomSteering param.Field[LoadBalancerUpdateParamsRulesOverridesRandomSteering] `json:"random_steering"`
- // A mapping of region codes to a list of pool IDs (ordered by their failover
- // priority) for the given region. Any regions not explicitly defined will fall
- // back to using default_pools.
- RegionPools param.Field[interface{}] `json:"region_pools"`
- // Specifies the type of session affinity the load balancer should use unless
- // specified as `"none"` or "" (default). The supported types are:
- //
- // - `"cookie"`: On the first request to a proxied load balancer, a cookie is
- // generated, encoding information of which origin the request will be forwarded
- // to. Subsequent requests, by the same client to the same load balancer, will be
- // sent to the origin server the cookie encodes, for the duration of the cookie
- // and as long as the origin server remains healthy. If the cookie has expired or
- // the origin server is unhealthy, then a new origin server is calculated and
- // used.
- // - `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin
- // selection is stable and based on the client's ip address.
- // - `"header"`: On the first request to a proxied load balancer, a session key
- // based on the configured HTTP headers (see
- // `session_affinity_attributes.headers`) is generated, encoding the request
- // headers used for storing in the load balancer session state which origin the
- // request will be forwarded to. Subsequent requests to the load balancer with
- // the same headers will be sent to the same origin server, for the duration of
- // the session and as long as the origin server remains healthy. If the session
- // has been idle for the duration of `session_affinity_ttl` seconds or the origin
- // server is unhealthy, then a new origin server is calculated and used. See
- // `headers` in `session_affinity_attributes` for additional required
- // configuration.
- SessionAffinity param.Field[LoadBalancerUpdateParamsRulesOverridesSessionAffinity] `json:"session_affinity"`
- // Configures attributes for session affinity.
- SessionAffinityAttributes param.Field[LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributes] `json:"session_affinity_attributes"`
- // Time, in seconds, until a client's session expires after being created. Once the
- // expiry time has been reached, subsequent requests may get sent to a different
- // origin server. The accepted ranges per `session_affinity` policy are:
- //
- // - `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used
- // unless explicitly set. The accepted range of values is between [1800, 604800].
- // - `"header"`: The current default of 1800 seconds will be used unless explicitly
- // set. The accepted range of values is between [30, 3600]. Note: With session
- // affinity by header, sessions only expire after they haven't been used for the
- // number of seconds specified.
- SessionAffinityTTL param.Field[float64] `json:"session_affinity_ttl"`
- // Steering Policy for this load balancer.
- //
- // - `"off"`: Use `default_pools`.
- // - `"geo"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied
- // requests, the country for `country_pools` is determined by
- // `location_strategy`.
- // - `"random"`: Select a pool randomly.
- // - `"dynamic_latency"`: Use round trip time to select the closest pool in
- // default_pools (requires pool health checks).
- // - `"proximity"`: Use the pools' latitude and longitude to select the closest
- // pool using the Cloudflare PoP location for proxied requests or the location
- // determined by `location_strategy` for non-proxied requests.
- // - `"least_outstanding_requests"`: Select a pool by taking into consideration
- // `random_steering` weights, as well as each pool's number of outstanding
- // requests. Pools with more pending requests are weighted proportionately less
- // relative to others.
- // - `"least_connections"`: Select a pool by taking into consideration
- // `random_steering` weights, as well as each pool's number of open connections.
- // Pools with more open connections are weighted proportionately less relative to
- // others. Supported for HTTP/1 and HTTP/2 connections.
- // - `""`: Will map to `"geo"` if you use
- // `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.
- SteeringPolicy param.Field[LoadBalancerUpdateParamsRulesOverridesSteeringPolicy] `json:"steering_policy"`
- // Time to live (TTL) of the DNS entry for the IP address returned by this load
- // balancer. This only applies to gray-clouded (unproxied) load balancers.
- TTL param.Field[float64] `json:"ttl"`
-}
-
-func (r LoadBalancerUpdateParamsRulesOverrides) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Controls features that modify the routing of requests to pools and origins in
-// response to dynamic conditions, such as during the interval between active
-// health monitoring requests. For example, zero-downtime failover occurs
-// immediately when an origin becomes unavailable due to HTTP 521, 522, or 523
-// response codes. If there is another healthy origin in the same pool, the request
-// is retried once against this alternate origin.
-type LoadBalancerUpdateParamsRulesOverridesAdaptiveRouting struct {
- // Extends zero-downtime failover of requests to healthy origins from alternate
- // pools, when no healthy alternate exists in the same pool, according to the
- // failover order defined by traffic and origin steering. When set false (the
- // default) zero-downtime failover will only occur between origins within the same
- // pool. See `session_affinity_attributes` for control over when sessions are
- // broken or reassigned.
- FailoverAcrossPools param.Field[bool] `json:"failover_across_pools"`
-}
-
-func (r LoadBalancerUpdateParamsRulesOverridesAdaptiveRouting) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Controls location-based steering for non-proxied requests. See `steering_policy`
-// to learn how steering is affected.
-type LoadBalancerUpdateParamsRulesOverridesLocationStrategy struct {
- // Determines the authoritative location when ECS is not preferred, does not exist
- // in the request, or its GeoIP lookup is unsuccessful.
- //
- // - `"pop"`: Use the Cloudflare PoP location.
- // - `"resolver_ip"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is
- // unsuccessful, use the Cloudflare PoP location.
- Mode param.Field[LoadBalancerUpdateParamsRulesOverridesLocationStrategyMode] `json:"mode"`
- // Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the
- // authoritative location.
- //
- // - `"always"`: Always prefer ECS.
- // - `"never"`: Never prefer ECS.
- // - `"proximity"`: Prefer ECS only when `steering_policy="proximity"`.
- // - `"geo"`: Prefer ECS only when `steering_policy="geo"`.
- PreferEcs param.Field[LoadBalancerUpdateParamsRulesOverridesLocationStrategyPreferEcs] `json:"prefer_ecs"`
-}
-
-func (r LoadBalancerUpdateParamsRulesOverridesLocationStrategy) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Determines the authoritative location when ECS is not preferred, does not exist
-// in the request, or its GeoIP lookup is unsuccessful.
-//
-// - `"pop"`: Use the Cloudflare PoP location.
-// - `"resolver_ip"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is
-// unsuccessful, use the Cloudflare PoP location.
-type LoadBalancerUpdateParamsRulesOverridesLocationStrategyMode string
-
-const (
- LoadBalancerUpdateParamsRulesOverridesLocationStrategyModePop LoadBalancerUpdateParamsRulesOverridesLocationStrategyMode = "pop"
- LoadBalancerUpdateParamsRulesOverridesLocationStrategyModeResolverIP LoadBalancerUpdateParamsRulesOverridesLocationStrategyMode = "resolver_ip"
-)
-
-// Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the
-// authoritative location.
-//
-// - `"always"`: Always prefer ECS.
-// - `"never"`: Never prefer ECS.
-// - `"proximity"`: Prefer ECS only when `steering_policy="proximity"`.
-// - `"geo"`: Prefer ECS only when `steering_policy="geo"`.
-type LoadBalancerUpdateParamsRulesOverridesLocationStrategyPreferEcs string
-
-const (
- LoadBalancerUpdateParamsRulesOverridesLocationStrategyPreferEcsAlways LoadBalancerUpdateParamsRulesOverridesLocationStrategyPreferEcs = "always"
- LoadBalancerUpdateParamsRulesOverridesLocationStrategyPreferEcsNever LoadBalancerUpdateParamsRulesOverridesLocationStrategyPreferEcs = "never"
- LoadBalancerUpdateParamsRulesOverridesLocationStrategyPreferEcsProximity LoadBalancerUpdateParamsRulesOverridesLocationStrategyPreferEcs = "proximity"
- LoadBalancerUpdateParamsRulesOverridesLocationStrategyPreferEcsGeo LoadBalancerUpdateParamsRulesOverridesLocationStrategyPreferEcs = "geo"
-)
-
-// Configures pool weights.
-//
-// - `steering_policy="random"`: A random pool is selected with probability
-// proportional to pool weights.
-// - `steering_policy="least_outstanding_requests"`: Use pool weights to scale each
-// pool's outstanding requests.
-// - `steering_policy="least_connections"`: Use pool weights to scale each pool's
-// open connections.
-type LoadBalancerUpdateParamsRulesOverridesRandomSteering struct {
- // The default weight for pools in the load balancer that are not specified in the
- // pool_weights map.
- DefaultWeight param.Field[float64] `json:"default_weight"`
- // A mapping of pool IDs to custom weights. The weight is relative to other pools
- // in the load balancer.
- PoolWeights param.Field[interface{}] `json:"pool_weights"`
-}
-
-func (r LoadBalancerUpdateParamsRulesOverridesRandomSteering) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Specifies the type of session affinity the load balancer should use unless
-// specified as `"none"` or "" (default). The supported types are:
-//
-// - `"cookie"`: On the first request to a proxied load balancer, a cookie is
-// generated, encoding information of which origin the request will be forwarded
-// to. Subsequent requests, by the same client to the same load balancer, will be
-// sent to the origin server the cookie encodes, for the duration of the cookie
-// and as long as the origin server remains healthy. If the cookie has expired or
-// the origin server is unhealthy, then a new origin server is calculated and
-// used.
-// - `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin
-// selection is stable and based on the client's ip address.
-// - `"header"`: On the first request to a proxied load balancer, a session key
-// based on the configured HTTP headers (see
-// `session_affinity_attributes.headers`) is generated, encoding the request
-// headers used for storing in the load balancer session state which origin the
-// request will be forwarded to. Subsequent requests to the load balancer with
-// the same headers will be sent to the same origin server, for the duration of
-// the session and as long as the origin server remains healthy. If the session
-// has been idle for the duration of `session_affinity_ttl` seconds or the origin
-// server is unhealthy, then a new origin server is calculated and used. See
-// `headers` in `session_affinity_attributes` for additional required
-// configuration.
-type LoadBalancerUpdateParamsRulesOverridesSessionAffinity string
-
-const (
- LoadBalancerUpdateParamsRulesOverridesSessionAffinityNone LoadBalancerUpdateParamsRulesOverridesSessionAffinity = "none"
- LoadBalancerUpdateParamsRulesOverridesSessionAffinityCookie LoadBalancerUpdateParamsRulesOverridesSessionAffinity = "cookie"
- LoadBalancerUpdateParamsRulesOverridesSessionAffinityIPCookie LoadBalancerUpdateParamsRulesOverridesSessionAffinity = "ip_cookie"
- LoadBalancerUpdateParamsRulesOverridesSessionAffinityHeader LoadBalancerUpdateParamsRulesOverridesSessionAffinity = "header"
- LoadBalancerUpdateParamsRulesOverridesSessionAffinityEmpty LoadBalancerUpdateParamsRulesOverridesSessionAffinity = "\"\""
-)
-
-// Configures attributes for session affinity.
-type LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributes struct {
- // Configures the drain duration in seconds. This field is only used when session
- // affinity is enabled on the load balancer.
- DrainDuration param.Field[float64] `json:"drain_duration"`
- // Configures the names of HTTP headers to base session affinity on when header
- // `session_affinity` is enabled. At least one HTTP header name must be provided.
- // To specify the exact cookies to be used, include an item in the following
- // format: `"cookie:,"` (example) where everything
- // after the colon is a comma-separated list of cookie names. Providing only
- // `"cookie"` will result in all cookies being used. The default max number of HTTP
- // header names that can be provided depends on your plan: 5 for Enterprise, 1 for
- // all other plans.
- Headers param.Field[[]string] `json:"headers"`
- // When header `session_affinity` is enabled, this option can be used to specify
- // how HTTP headers on load balancing requests will be used. The supported values
- // are:
- //
- // - `"true"`: Load balancing requests must contain _all_ of the HTTP headers
- // specified by the `headers` session affinity attribute, otherwise sessions
- // aren't created.
- // - `"false"`: Load balancing requests must contain _at least one_ of the HTTP
- // headers specified by the `headers` session affinity attribute, otherwise
- // sessions aren't created.
- RequireAllHeaders param.Field[bool] `json:"require_all_headers"`
- // Configures the SameSite attribute on session affinity cookie. Value "Auto" will
- // be translated to "Lax" or "None" depending if Always Use HTTPS is enabled. Note:
- // when using value "None", the secure attribute can not be set to "Never".
- Samesite param.Field[LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesSamesite] `json:"samesite"`
- // Configures the Secure attribute on session affinity cookie. Value "Always"
- // indicates the Secure attribute will be set in the Set-Cookie header, "Never"
- // indicates the Secure attribute will not be set, and "Auto" will set the Secure
- // attribute depending if Always Use HTTPS is enabled.
- Secure param.Field[LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesSecure] `json:"secure"`
- // Configures the zero-downtime failover between origins within a pool when session
- // affinity is enabled. This feature is currently incompatible with Argo, Tiered
- // Cache, and Bandwidth Alliance. The supported values are:
- //
- // - `"none"`: No failover takes place for sessions pinned to the origin (default).
- // - `"temporary"`: Traffic will be sent to another other healthy origin until the
- // originally pinned origin is available; note that this can potentially result
- // in heavy origin flapping.
- // - `"sticky"`: The session affinity cookie is updated and subsequent requests are
- // sent to the new origin. Note: Zero-downtime failover with sticky sessions is
- // currently not supported for session affinity by header.
- ZeroDowntimeFailover param.Field[LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailover] `json:"zero_downtime_failover"`
-}
-
-func (r LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributes) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Configures the SameSite attribute on session affinity cookie. Value "Auto" will
-// be translated to "Lax" or "None" depending if Always Use HTTPS is enabled. Note:
-// when using value "None", the secure attribute can not be set to "Never".
-type LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesSamesite string
-
-const (
- LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesSamesiteAuto LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesSamesite = "Auto"
- LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesSamesiteLax LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesSamesite = "Lax"
- LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesSamesiteNone LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesSamesite = "None"
- LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesSamesiteStrict LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesSamesite = "Strict"
-)
-
-// Configures the Secure attribute on session affinity cookie. Value "Always"
-// indicates the Secure attribute will be set in the Set-Cookie header, "Never"
-// indicates the Secure attribute will not be set, and "Auto" will set the Secure
-// attribute depending if Always Use HTTPS is enabled.
-type LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesSecure string
-
-const (
- LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesSecureAuto LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesSecure = "Auto"
- LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesSecureAlways LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesSecure = "Always"
- LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesSecureNever LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesSecure = "Never"
-)
-
-// Configures the zero-downtime failover between origins within a pool when session
-// affinity is enabled. This feature is currently incompatible with Argo, Tiered
-// Cache, and Bandwidth Alliance. The supported values are:
-//
-// - `"none"`: No failover takes place for sessions pinned to the origin (default).
-// - `"temporary"`: Traffic will be sent to another other healthy origin until the
-// originally pinned origin is available; note that this can potentially result
-// in heavy origin flapping.
-// - `"sticky"`: The session affinity cookie is updated and subsequent requests are
-// sent to the new origin. Note: Zero-downtime failover with sticky sessions is
-// currently not supported for session affinity by header.
-type LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailover string
-
-const (
- LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailoverNone LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailover = "none"
- LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailoverTemporary LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailover = "temporary"
- LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailoverSticky LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailover = "sticky"
-)
-
-// Steering Policy for this load balancer.
-//
-// - `"off"`: Use `default_pools`.
-// - `"geo"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied
-// requests, the country for `country_pools` is determined by
-// `location_strategy`.
-// - `"random"`: Select a pool randomly.
-// - `"dynamic_latency"`: Use round trip time to select the closest pool in
-// default_pools (requires pool health checks).
-// - `"proximity"`: Use the pools' latitude and longitude to select the closest
-// pool using the Cloudflare PoP location for proxied requests or the location
-// determined by `location_strategy` for non-proxied requests.
-// - `"least_outstanding_requests"`: Select a pool by taking into consideration
-// `random_steering` weights, as well as each pool's number of outstanding
-// requests. Pools with more pending requests are weighted proportionately less
-// relative to others.
-// - `"least_connections"`: Select a pool by taking into consideration
-// `random_steering` weights, as well as each pool's number of open connections.
-// Pools with more open connections are weighted proportionately less relative to
-// others. Supported for HTTP/1 and HTTP/2 connections.
-// - `""`: Will map to `"geo"` if you use
-// `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.
-type LoadBalancerUpdateParamsRulesOverridesSteeringPolicy string
-
-const (
- LoadBalancerUpdateParamsRulesOverridesSteeringPolicyOff LoadBalancerUpdateParamsRulesOverridesSteeringPolicy = "off"
- LoadBalancerUpdateParamsRulesOverridesSteeringPolicyGeo LoadBalancerUpdateParamsRulesOverridesSteeringPolicy = "geo"
- LoadBalancerUpdateParamsRulesOverridesSteeringPolicyRandom LoadBalancerUpdateParamsRulesOverridesSteeringPolicy = "random"
- LoadBalancerUpdateParamsRulesOverridesSteeringPolicyDynamicLatency LoadBalancerUpdateParamsRulesOverridesSteeringPolicy = "dynamic_latency"
- LoadBalancerUpdateParamsRulesOverridesSteeringPolicyProximity LoadBalancerUpdateParamsRulesOverridesSteeringPolicy = "proximity"
- LoadBalancerUpdateParamsRulesOverridesSteeringPolicyLeastOutstandingRequests LoadBalancerUpdateParamsRulesOverridesSteeringPolicy = "least_outstanding_requests"
- LoadBalancerUpdateParamsRulesOverridesSteeringPolicyLeastConnections LoadBalancerUpdateParamsRulesOverridesSteeringPolicy = "least_connections"
- LoadBalancerUpdateParamsRulesOverridesSteeringPolicyEmpty LoadBalancerUpdateParamsRulesOverridesSteeringPolicy = "\"\""
-)
-
-// Specifies the type of session affinity the load balancer should use unless
-// specified as `"none"` or "" (default). The supported types are:
-//
-// - `"cookie"`: On the first request to a proxied load balancer, a cookie is
-// generated, encoding information of which origin the request will be forwarded
-// to. Subsequent requests, by the same client to the same load balancer, will be
-// sent to the origin server the cookie encodes, for the duration of the cookie
-// and as long as the origin server remains healthy. If the cookie has expired or
-// the origin server is unhealthy, then a new origin server is calculated and
-// used.
-// - `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin
-// selection is stable and based on the client's ip address.
-// - `"header"`: On the first request to a proxied load balancer, a session key
-// based on the configured HTTP headers (see
-// `session_affinity_attributes.headers`) is generated, encoding the request
-// headers used for storing in the load balancer session state which origin the
-// request will be forwarded to. Subsequent requests to the load balancer with
-// the same headers will be sent to the same origin server, for the duration of
-// the session and as long as the origin server remains healthy. If the session
-// has been idle for the duration of `session_affinity_ttl` seconds or the origin
-// server is unhealthy, then a new origin server is calculated and used. See
-// `headers` in `session_affinity_attributes` for additional required
-// configuration.
-type LoadBalancerUpdateParamsSessionAffinity string
-
-const (
- LoadBalancerUpdateParamsSessionAffinityNone LoadBalancerUpdateParamsSessionAffinity = "none"
- LoadBalancerUpdateParamsSessionAffinityCookie LoadBalancerUpdateParamsSessionAffinity = "cookie"
- LoadBalancerUpdateParamsSessionAffinityIPCookie LoadBalancerUpdateParamsSessionAffinity = "ip_cookie"
- LoadBalancerUpdateParamsSessionAffinityHeader LoadBalancerUpdateParamsSessionAffinity = "header"
- LoadBalancerUpdateParamsSessionAffinityEmpty LoadBalancerUpdateParamsSessionAffinity = "\"\""
-)
-
-// Configures attributes for session affinity.
-type LoadBalancerUpdateParamsSessionAffinityAttributes struct {
- // Configures the drain duration in seconds. This field is only used when session
- // affinity is enabled on the load balancer.
- DrainDuration param.Field[float64] `json:"drain_duration"`
- // Configures the names of HTTP headers to base session affinity on when header
- // `session_affinity` is enabled. At least one HTTP header name must be provided.
- // To specify the exact cookies to be used, include an item in the following
- // format: `"cookie:,"` (example) where everything
- // after the colon is a comma-separated list of cookie names. Providing only
- // `"cookie"` will result in all cookies being used. The default max number of HTTP
- // header names that can be provided depends on your plan: 5 for Enterprise, 1 for
- // all other plans.
- Headers param.Field[[]string] `json:"headers"`
- // When header `session_affinity` is enabled, this option can be used to specify
- // how HTTP headers on load balancing requests will be used. The supported values
- // are:
- //
- // - `"true"`: Load balancing requests must contain _all_ of the HTTP headers
- // specified by the `headers` session affinity attribute, otherwise sessions
- // aren't created.
- // - `"false"`: Load balancing requests must contain _at least one_ of the HTTP
- // headers specified by the `headers` session affinity attribute, otherwise
- // sessions aren't created.
- RequireAllHeaders param.Field[bool] `json:"require_all_headers"`
- // Configures the SameSite attribute on session affinity cookie. Value "Auto" will
- // be translated to "Lax" or "None" depending if Always Use HTTPS is enabled. Note:
- // when using value "None", the secure attribute can not be set to "Never".
- Samesite param.Field[LoadBalancerUpdateParamsSessionAffinityAttributesSamesite] `json:"samesite"`
- // Configures the Secure attribute on session affinity cookie. Value "Always"
- // indicates the Secure attribute will be set in the Set-Cookie header, "Never"
- // indicates the Secure attribute will not be set, and "Auto" will set the Secure
- // attribute depending if Always Use HTTPS is enabled.
- Secure param.Field[LoadBalancerUpdateParamsSessionAffinityAttributesSecure] `json:"secure"`
- // Configures the zero-downtime failover between origins within a pool when session
- // affinity is enabled. This feature is currently incompatible with Argo, Tiered
- // Cache, and Bandwidth Alliance. The supported values are:
- //
- // - `"none"`: No failover takes place for sessions pinned to the origin (default).
- // - `"temporary"`: Traffic will be sent to another other healthy origin until the
- // originally pinned origin is available; note that this can potentially result
- // in heavy origin flapping.
- // - `"sticky"`: The session affinity cookie is updated and subsequent requests are
- // sent to the new origin. Note: Zero-downtime failover with sticky sessions is
- // currently not supported for session affinity by header.
- ZeroDowntimeFailover param.Field[LoadBalancerUpdateParamsSessionAffinityAttributesZeroDowntimeFailover] `json:"zero_downtime_failover"`
-}
-
-func (r LoadBalancerUpdateParamsSessionAffinityAttributes) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Configures the SameSite attribute on session affinity cookie. Value "Auto" will
-// be translated to "Lax" or "None" depending if Always Use HTTPS is enabled. Note:
-// when using value "None", the secure attribute can not be set to "Never".
-type LoadBalancerUpdateParamsSessionAffinityAttributesSamesite string
-
-const (
- LoadBalancerUpdateParamsSessionAffinityAttributesSamesiteAuto LoadBalancerUpdateParamsSessionAffinityAttributesSamesite = "Auto"
- LoadBalancerUpdateParamsSessionAffinityAttributesSamesiteLax LoadBalancerUpdateParamsSessionAffinityAttributesSamesite = "Lax"
- LoadBalancerUpdateParamsSessionAffinityAttributesSamesiteNone LoadBalancerUpdateParamsSessionAffinityAttributesSamesite = "None"
- LoadBalancerUpdateParamsSessionAffinityAttributesSamesiteStrict LoadBalancerUpdateParamsSessionAffinityAttributesSamesite = "Strict"
-)
-
-// Configures the Secure attribute on session affinity cookie. Value "Always"
-// indicates the Secure attribute will be set in the Set-Cookie header, "Never"
-// indicates the Secure attribute will not be set, and "Auto" will set the Secure
-// attribute depending if Always Use HTTPS is enabled.
-type LoadBalancerUpdateParamsSessionAffinityAttributesSecure string
-
-const (
- LoadBalancerUpdateParamsSessionAffinityAttributesSecureAuto LoadBalancerUpdateParamsSessionAffinityAttributesSecure = "Auto"
- LoadBalancerUpdateParamsSessionAffinityAttributesSecureAlways LoadBalancerUpdateParamsSessionAffinityAttributesSecure = "Always"
- LoadBalancerUpdateParamsSessionAffinityAttributesSecureNever LoadBalancerUpdateParamsSessionAffinityAttributesSecure = "Never"
-)
-
-// Configures the zero-downtime failover between origins within a pool when session
-// affinity is enabled. This feature is currently incompatible with Argo, Tiered
-// Cache, and Bandwidth Alliance. The supported values are:
-//
-// - `"none"`: No failover takes place for sessions pinned to the origin (default).
-// - `"temporary"`: Traffic will be sent to another other healthy origin until the
-// originally pinned origin is available; note that this can potentially result
-// in heavy origin flapping.
-// - `"sticky"`: The session affinity cookie is updated and subsequent requests are
-// sent to the new origin. Note: Zero-downtime failover with sticky sessions is
-// currently not supported for session affinity by header.
-type LoadBalancerUpdateParamsSessionAffinityAttributesZeroDowntimeFailover string
-
-const (
- LoadBalancerUpdateParamsSessionAffinityAttributesZeroDowntimeFailoverNone LoadBalancerUpdateParamsSessionAffinityAttributesZeroDowntimeFailover = "none"
- LoadBalancerUpdateParamsSessionAffinityAttributesZeroDowntimeFailoverTemporary LoadBalancerUpdateParamsSessionAffinityAttributesZeroDowntimeFailover = "temporary"
- LoadBalancerUpdateParamsSessionAffinityAttributesZeroDowntimeFailoverSticky LoadBalancerUpdateParamsSessionAffinityAttributesZeroDowntimeFailover = "sticky"
-)
-
-// Steering Policy for this load balancer.
-//
-// - `"off"`: Use `default_pools`.
-// - `"geo"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied
-// requests, the country for `country_pools` is determined by
-// `location_strategy`.
-// - `"random"`: Select a pool randomly.
-// - `"dynamic_latency"`: Use round trip time to select the closest pool in
-// default_pools (requires pool health checks).
-// - `"proximity"`: Use the pools' latitude and longitude to select the closest
-// pool using the Cloudflare PoP location for proxied requests or the location
-// determined by `location_strategy` for non-proxied requests.
-// - `"least_outstanding_requests"`: Select a pool by taking into consideration
-// `random_steering` weights, as well as each pool's number of outstanding
-// requests. Pools with more pending requests are weighted proportionately less
-// relative to others.
-// - `"least_connections"`: Select a pool by taking into consideration
-// `random_steering` weights, as well as each pool's number of open connections.
-// Pools with more open connections are weighted proportionately less relative to
-// others. Supported for HTTP/1 and HTTP/2 connections.
-// - `""`: Will map to `"geo"` if you use
-// `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.
-type LoadBalancerUpdateParamsSteeringPolicy string
-
-const (
- LoadBalancerUpdateParamsSteeringPolicyOff LoadBalancerUpdateParamsSteeringPolicy = "off"
- LoadBalancerUpdateParamsSteeringPolicyGeo LoadBalancerUpdateParamsSteeringPolicy = "geo"
- LoadBalancerUpdateParamsSteeringPolicyRandom LoadBalancerUpdateParamsSteeringPolicy = "random"
- LoadBalancerUpdateParamsSteeringPolicyDynamicLatency LoadBalancerUpdateParamsSteeringPolicy = "dynamic_latency"
- LoadBalancerUpdateParamsSteeringPolicyProximity LoadBalancerUpdateParamsSteeringPolicy = "proximity"
- LoadBalancerUpdateParamsSteeringPolicyLeastOutstandingRequests LoadBalancerUpdateParamsSteeringPolicy = "least_outstanding_requests"
- LoadBalancerUpdateParamsSteeringPolicyLeastConnections LoadBalancerUpdateParamsSteeringPolicy = "least_connections"
- LoadBalancerUpdateParamsSteeringPolicyEmpty LoadBalancerUpdateParamsSteeringPolicy = "\"\""
-)
-
-type LoadBalancerUpdateResponseEnvelope struct {
- Errors []LoadBalancerUpdateResponseEnvelopeErrors `json:"errors,required"`
- Messages []LoadBalancerUpdateResponseEnvelopeMessages `json:"messages,required"`
- Result LoadBalancer `json:"result,required"`
- // Whether the API call was successful
- Success LoadBalancerUpdateResponseEnvelopeSuccess `json:"success,required"`
- JSON loadBalancerUpdateResponseEnvelopeJSON `json:"-"`
-}
-
-// loadBalancerUpdateResponseEnvelopeJSON contains the JSON metadata for the struct
-// [LoadBalancerUpdateResponseEnvelope]
-type loadBalancerUpdateResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerUpdateResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type LoadBalancerUpdateResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON loadBalancerUpdateResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// loadBalancerUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [LoadBalancerUpdateResponseEnvelopeErrors]
-type loadBalancerUpdateResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type LoadBalancerUpdateResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON loadBalancerUpdateResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// loadBalancerUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [LoadBalancerUpdateResponseEnvelopeMessages]
-type loadBalancerUpdateResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type LoadBalancerUpdateResponseEnvelopeSuccess bool
-
-const (
- LoadBalancerUpdateResponseEnvelopeSuccessTrue LoadBalancerUpdateResponseEnvelopeSuccess = true
-)
-
-type LoadBalancerListParams struct {
- ZoneID param.Field[string] `path:"zone_id,required"`
-}
-
-type LoadBalancerListResponseEnvelope struct {
- Errors []LoadBalancerListResponseEnvelopeErrors `json:"errors,required"`
- Messages []LoadBalancerListResponseEnvelopeMessages `json:"messages,required"`
- Result []LoadBalancer `json:"result,required,nullable"`
- // Whether the API call was successful
- Success LoadBalancerListResponseEnvelopeSuccess `json:"success,required"`
- ResultInfo LoadBalancerListResponseEnvelopeResultInfo `json:"result_info"`
- JSON loadBalancerListResponseEnvelopeJSON `json:"-"`
-}
-
-// loadBalancerListResponseEnvelopeJSON contains the JSON metadata for the struct
-// [LoadBalancerListResponseEnvelope]
-type loadBalancerListResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- ResultInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerListResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type LoadBalancerListResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON loadBalancerListResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// loadBalancerListResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [LoadBalancerListResponseEnvelopeErrors]
-type loadBalancerListResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerListResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type LoadBalancerListResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON loadBalancerListResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// loadBalancerListResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [LoadBalancerListResponseEnvelopeMessages]
-type loadBalancerListResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerListResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type LoadBalancerListResponseEnvelopeSuccess bool
-
-const (
- LoadBalancerListResponseEnvelopeSuccessTrue LoadBalancerListResponseEnvelopeSuccess = true
-)
-
-type LoadBalancerListResponseEnvelopeResultInfo struct {
- // Total number of results for the requested service
- Count float64 `json:"count"`
- // Current page within paginated list of results
- Page float64 `json:"page"`
- // Number of results per page of results
- PerPage float64 `json:"per_page"`
- // Total results available without any search parameters
- TotalCount float64 `json:"total_count"`
- JSON loadBalancerListResponseEnvelopeResultInfoJSON `json:"-"`
-}
-
-// loadBalancerListResponseEnvelopeResultInfoJSON contains the JSON metadata for
-// the struct [LoadBalancerListResponseEnvelopeResultInfo]
-type loadBalancerListResponseEnvelopeResultInfoJSON struct {
- Count apijson.Field
- Page apijson.Field
- PerPage apijson.Field
- TotalCount apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerListResponseEnvelopeResultInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type LoadBalancerDeleteParams struct {
- ZoneID param.Field[string] `path:"zone_id,required"`
-}
-
-type LoadBalancerDeleteResponseEnvelope struct {
- Errors []LoadBalancerDeleteResponseEnvelopeErrors `json:"errors,required"`
- Messages []LoadBalancerDeleteResponseEnvelopeMessages `json:"messages,required"`
- Result LoadBalancerDeleteResponse `json:"result,required"`
- // Whether the API call was successful
- Success LoadBalancerDeleteResponseEnvelopeSuccess `json:"success,required"`
- JSON loadBalancerDeleteResponseEnvelopeJSON `json:"-"`
-}
-
-// loadBalancerDeleteResponseEnvelopeJSON contains the JSON metadata for the struct
-// [LoadBalancerDeleteResponseEnvelope]
-type loadBalancerDeleteResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerDeleteResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type LoadBalancerDeleteResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON loadBalancerDeleteResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// loadBalancerDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [LoadBalancerDeleteResponseEnvelopeErrors]
-type loadBalancerDeleteResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type LoadBalancerDeleteResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON loadBalancerDeleteResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// loadBalancerDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [LoadBalancerDeleteResponseEnvelopeMessages]
-type loadBalancerDeleteResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type LoadBalancerDeleteResponseEnvelopeSuccess bool
-
-const (
- LoadBalancerDeleteResponseEnvelopeSuccessTrue LoadBalancerDeleteResponseEnvelopeSuccess = true
-)
-
-type LoadBalancerEditParams struct {
- ZoneID param.Field[string] `path:"zone_id,required"`
- // Controls features that modify the routing of requests to pools and origins in
- // response to dynamic conditions, such as during the interval between active
- // health monitoring requests. For example, zero-downtime failover occurs
- // immediately when an origin becomes unavailable due to HTTP 521, 522, or 523
- // response codes. If there is another healthy origin in the same pool, the request
- // is retried once against this alternate origin.
- AdaptiveRouting param.Field[LoadBalancerEditParamsAdaptiveRouting] `json:"adaptive_routing"`
- // A mapping of country codes to a list of pool IDs (ordered by their failover
- // priority) for the given country. Any country not explicitly defined will fall
- // back to using the corresponding region_pool mapping if it exists else to
- // default_pools.
- CountryPools param.Field[interface{}] `json:"country_pools"`
- // A list of pool IDs ordered by their failover priority. Pools defined here are
- // used by default, or when region_pools are not configured for a given region.
- DefaultPools param.Field[[]string] `json:"default_pools"`
- // Object description.
- Description param.Field[string] `json:"description"`
- // Whether to enable (the default) this load balancer.
- Enabled param.Field[bool] `json:"enabled"`
- // The pool ID to use when all other pools are detected as unhealthy.
- FallbackPool param.Field[interface{}] `json:"fallback_pool"`
- // Controls location-based steering for non-proxied requests. See `steering_policy`
- // to learn how steering is affected.
- LocationStrategy param.Field[LoadBalancerEditParamsLocationStrategy] `json:"location_strategy"`
- // The DNS hostname to associate with your Load Balancer. If this hostname already
- // exists as a DNS record in Cloudflare's DNS, the Load Balancer will take
- // precedence and the DNS record will not be used.
- Name param.Field[string] `json:"name"`
- // (Enterprise only): A mapping of Cloudflare PoP identifiers to a list of pool IDs
- // (ordered by their failover priority) for the PoP (datacenter). Any PoPs not
- // explicitly defined will fall back to using the corresponding country_pool, then
- // region_pool mapping if it exists else to default_pools.
- PopPools param.Field[interface{}] `json:"pop_pools"`
- // Whether the hostname should be gray clouded (false) or orange clouded (true).
- Proxied param.Field[bool] `json:"proxied"`
- // Configures pool weights.
- //
- // - `steering_policy="random"`: A random pool is selected with probability
- // proportional to pool weights.
- // - `steering_policy="least_outstanding_requests"`: Use pool weights to scale each
- // pool's outstanding requests.
- // - `steering_policy="least_connections"`: Use pool weights to scale each pool's
- // open connections.
- RandomSteering param.Field[LoadBalancerEditParamsRandomSteering] `json:"random_steering"`
- // A mapping of region codes to a list of pool IDs (ordered by their failover
- // priority) for the given region. Any regions not explicitly defined will fall
- // back to using default_pools.
- RegionPools param.Field[interface{}] `json:"region_pools"`
- // BETA Field Not General Access: A list of rules for this load balancer to
- // execute.
- Rules param.Field[[]LoadBalancerEditParamsRule] `json:"rules"`
- // Specifies the type of session affinity the load balancer should use unless
- // specified as `"none"` or "" (default). The supported types are:
- //
- // - `"cookie"`: On the first request to a proxied load balancer, a cookie is
- // generated, encoding information of which origin the request will be forwarded
- // to. Subsequent requests, by the same client to the same load balancer, will be
- // sent to the origin server the cookie encodes, for the duration of the cookie
- // and as long as the origin server remains healthy. If the cookie has expired or
- // the origin server is unhealthy, then a new origin server is calculated and
- // used.
- // - `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin
- // selection is stable and based on the client's ip address.
- // - `"header"`: On the first request to a proxied load balancer, a session key
- // based on the configured HTTP headers (see
- // `session_affinity_attributes.headers`) is generated, encoding the request
- // headers used for storing in the load balancer session state which origin the
- // request will be forwarded to. Subsequent requests to the load balancer with
- // the same headers will be sent to the same origin server, for the duration of
- // the session and as long as the origin server remains healthy. If the session
- // has been idle for the duration of `session_affinity_ttl` seconds or the origin
- // server is unhealthy, then a new origin server is calculated and used. See
- // `headers` in `session_affinity_attributes` for additional required
- // configuration.
- SessionAffinity param.Field[LoadBalancerEditParamsSessionAffinity] `json:"session_affinity"`
- // Configures attributes for session affinity.
- SessionAffinityAttributes param.Field[LoadBalancerEditParamsSessionAffinityAttributes] `json:"session_affinity_attributes"`
- // Time, in seconds, until a client's session expires after being created. Once the
- // expiry time has been reached, subsequent requests may get sent to a different
- // origin server. The accepted ranges per `session_affinity` policy are:
- //
- // - `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used
- // unless explicitly set. The accepted range of values is between [1800, 604800].
- // - `"header"`: The current default of 1800 seconds will be used unless explicitly
- // set. The accepted range of values is between [30, 3600]. Note: With session
- // affinity by header, sessions only expire after they haven't been used for the
- // number of seconds specified.
- SessionAffinityTTL param.Field[float64] `json:"session_affinity_ttl"`
- // Steering Policy for this load balancer.
- //
- // - `"off"`: Use `default_pools`.
- // - `"geo"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied
- // requests, the country for `country_pools` is determined by
- // `location_strategy`.
- // - `"random"`: Select a pool randomly.
- // - `"dynamic_latency"`: Use round trip time to select the closest pool in
- // default_pools (requires pool health checks).
- // - `"proximity"`: Use the pools' latitude and longitude to select the closest
- // pool using the Cloudflare PoP location for proxied requests or the location
- // determined by `location_strategy` for non-proxied requests.
- // - `"least_outstanding_requests"`: Select a pool by taking into consideration
- // `random_steering` weights, as well as each pool's number of outstanding
- // requests. Pools with more pending requests are weighted proportionately less
- // relative to others.
- // - `"least_connections"`: Select a pool by taking into consideration
- // `random_steering` weights, as well as each pool's number of open connections.
- // Pools with more open connections are weighted proportionately less relative to
- // others. Supported for HTTP/1 and HTTP/2 connections.
- // - `""`: Will map to `"geo"` if you use
- // `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.
- SteeringPolicy param.Field[LoadBalancerEditParamsSteeringPolicy] `json:"steering_policy"`
- // Time to live (TTL) of the DNS entry for the IP address returned by this load
- // balancer. This only applies to gray-clouded (unproxied) load balancers.
- TTL param.Field[float64] `json:"ttl"`
-}
-
-func (r LoadBalancerEditParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Controls features that modify the routing of requests to pools and origins in
-// response to dynamic conditions, such as during the interval between active
-// health monitoring requests. For example, zero-downtime failover occurs
-// immediately when an origin becomes unavailable due to HTTP 521, 522, or 523
-// response codes. If there is another healthy origin in the same pool, the request
-// is retried once against this alternate origin.
-type LoadBalancerEditParamsAdaptiveRouting struct {
- // Extends zero-downtime failover of requests to healthy origins from alternate
- // pools, when no healthy alternate exists in the same pool, according to the
- // failover order defined by traffic and origin steering. When set false (the
- // default) zero-downtime failover will only occur between origins within the same
- // pool. See `session_affinity_attributes` for control over when sessions are
- // broken or reassigned.
- FailoverAcrossPools param.Field[bool] `json:"failover_across_pools"`
-}
-
-func (r LoadBalancerEditParamsAdaptiveRouting) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Controls location-based steering for non-proxied requests. See `steering_policy`
-// to learn how steering is affected.
-type LoadBalancerEditParamsLocationStrategy struct {
- // Determines the authoritative location when ECS is not preferred, does not exist
- // in the request, or its GeoIP lookup is unsuccessful.
- //
- // - `"pop"`: Use the Cloudflare PoP location.
- // - `"resolver_ip"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is
- // unsuccessful, use the Cloudflare PoP location.
- Mode param.Field[LoadBalancerEditParamsLocationStrategyMode] `json:"mode"`
- // Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the
- // authoritative location.
- //
- // - `"always"`: Always prefer ECS.
- // - `"never"`: Never prefer ECS.
- // - `"proximity"`: Prefer ECS only when `steering_policy="proximity"`.
- // - `"geo"`: Prefer ECS only when `steering_policy="geo"`.
- PreferEcs param.Field[LoadBalancerEditParamsLocationStrategyPreferEcs] `json:"prefer_ecs"`
-}
-
-func (r LoadBalancerEditParamsLocationStrategy) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Determines the authoritative location when ECS is not preferred, does not exist
-// in the request, or its GeoIP lookup is unsuccessful.
-//
-// - `"pop"`: Use the Cloudflare PoP location.
-// - `"resolver_ip"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is
-// unsuccessful, use the Cloudflare PoP location.
-type LoadBalancerEditParamsLocationStrategyMode string
-
-const (
- LoadBalancerEditParamsLocationStrategyModePop LoadBalancerEditParamsLocationStrategyMode = "pop"
- LoadBalancerEditParamsLocationStrategyModeResolverIP LoadBalancerEditParamsLocationStrategyMode = "resolver_ip"
-)
-
-// Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the
-// authoritative location.
-//
-// - `"always"`: Always prefer ECS.
-// - `"never"`: Never prefer ECS.
-// - `"proximity"`: Prefer ECS only when `steering_policy="proximity"`.
-// - `"geo"`: Prefer ECS only when `steering_policy="geo"`.
-type LoadBalancerEditParamsLocationStrategyPreferEcs string
-
-const (
- LoadBalancerEditParamsLocationStrategyPreferEcsAlways LoadBalancerEditParamsLocationStrategyPreferEcs = "always"
- LoadBalancerEditParamsLocationStrategyPreferEcsNever LoadBalancerEditParamsLocationStrategyPreferEcs = "never"
- LoadBalancerEditParamsLocationStrategyPreferEcsProximity LoadBalancerEditParamsLocationStrategyPreferEcs = "proximity"
- LoadBalancerEditParamsLocationStrategyPreferEcsGeo LoadBalancerEditParamsLocationStrategyPreferEcs = "geo"
-)
-
-// Configures pool weights.
-//
-// - `steering_policy="random"`: A random pool is selected with probability
-// proportional to pool weights.
-// - `steering_policy="least_outstanding_requests"`: Use pool weights to scale each
-// pool's outstanding requests.
-// - `steering_policy="least_connections"`: Use pool weights to scale each pool's
-// open connections.
-type LoadBalancerEditParamsRandomSteering struct {
- // The default weight for pools in the load balancer that are not specified in the
- // pool_weights map.
- DefaultWeight param.Field[float64] `json:"default_weight"`
- // A mapping of pool IDs to custom weights. The weight is relative to other pools
- // in the load balancer.
- PoolWeights param.Field[interface{}] `json:"pool_weights"`
-}
-
-func (r LoadBalancerEditParamsRandomSteering) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// A rule object containing conditions and overrides for this load balancer to
-// evaluate.
-type LoadBalancerEditParamsRule struct {
- // The condition expressions to evaluate. If the condition evaluates to true, the
- // overrides or fixed_response in this rule will be applied. An empty condition is
- // always true. For more details on condition expressions, please see
- // https://developers.cloudflare.com/load-balancing/understand-basics/load-balancing-rules/expressions.
- Condition param.Field[string] `json:"condition"`
- // Disable this specific rule. It will no longer be evaluated by this load
- // balancer.
- Disabled param.Field[bool] `json:"disabled"`
- // A collection of fields used to directly respond to the eyeball instead of
- // routing to a pool. If a fixed_response is supplied the rule will be marked as
- // terminates.
- FixedResponse param.Field[LoadBalancerEditParamsRulesFixedResponse] `json:"fixed_response"`
- // Name of this rule. Only used for human readability.
- Name param.Field[string] `json:"name"`
- // A collection of overrides to apply to the load balancer when this rule's
- // condition is true. All fields are optional.
- Overrides param.Field[LoadBalancerEditParamsRulesOverrides] `json:"overrides"`
- // The order in which rules should be executed in relation to each other. Lower
- // values are executed first. Values do not need to be sequential. If no value is
- // provided for any rule the array order of the rules field will be used to assign
- // a priority.
- Priority param.Field[int64] `json:"priority"`
- // If this rule's condition is true, this causes rule evaluation to stop after
- // processing this rule.
- Terminates param.Field[bool] `json:"terminates"`
-}
-
-func (r LoadBalancerEditParamsRule) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// A collection of fields used to directly respond to the eyeball instead of
-// routing to a pool. If a fixed_response is supplied the rule will be marked as
-// terminates.
-type LoadBalancerEditParamsRulesFixedResponse struct {
- // The http 'Content-Type' header to include in the response.
- ContentType param.Field[string] `json:"content_type"`
- // The http 'Location' header to include in the response.
- Location param.Field[string] `json:"location"`
- // Text to include as the http body.
- MessageBody param.Field[string] `json:"message_body"`
- // The http status code to respond with.
- StatusCode param.Field[int64] `json:"status_code"`
-}
-
-func (r LoadBalancerEditParamsRulesFixedResponse) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// A collection of overrides to apply to the load balancer when this rule's
-// condition is true. All fields are optional.
-type LoadBalancerEditParamsRulesOverrides struct {
- // Controls features that modify the routing of requests to pools and origins in
- // response to dynamic conditions, such as during the interval between active
- // health monitoring requests. For example, zero-downtime failover occurs
- // immediately when an origin becomes unavailable due to HTTP 521, 522, or 523
- // response codes. If there is another healthy origin in the same pool, the request
- // is retried once against this alternate origin.
- AdaptiveRouting param.Field[LoadBalancerEditParamsRulesOverridesAdaptiveRouting] `json:"adaptive_routing"`
- // A mapping of country codes to a list of pool IDs (ordered by their failover
- // priority) for the given country. Any country not explicitly defined will fall
- // back to using the corresponding region_pool mapping if it exists else to
- // default_pools.
- CountryPools param.Field[interface{}] `json:"country_pools"`
- // A list of pool IDs ordered by their failover priority. Pools defined here are
- // used by default, or when region_pools are not configured for a given region.
- DefaultPools param.Field[[]string] `json:"default_pools"`
- // The pool ID to use when all other pools are detected as unhealthy.
- FallbackPool param.Field[interface{}] `json:"fallback_pool"`
- // Controls location-based steering for non-proxied requests. See `steering_policy`
- // to learn how steering is affected.
- LocationStrategy param.Field[LoadBalancerEditParamsRulesOverridesLocationStrategy] `json:"location_strategy"`
- // (Enterprise only): A mapping of Cloudflare PoP identifiers to a list of pool IDs
- // (ordered by their failover priority) for the PoP (datacenter). Any PoPs not
- // explicitly defined will fall back to using the corresponding country_pool, then
- // region_pool mapping if it exists else to default_pools.
- PopPools param.Field[interface{}] `json:"pop_pools"`
- // Configures pool weights.
- //
- // - `steering_policy="random"`: A random pool is selected with probability
- // proportional to pool weights.
- // - `steering_policy="least_outstanding_requests"`: Use pool weights to scale each
- // pool's outstanding requests.
- // - `steering_policy="least_connections"`: Use pool weights to scale each pool's
- // open connections.
- RandomSteering param.Field[LoadBalancerEditParamsRulesOverridesRandomSteering] `json:"random_steering"`
- // A mapping of region codes to a list of pool IDs (ordered by their failover
- // priority) for the given region. Any regions not explicitly defined will fall
- // back to using default_pools.
- RegionPools param.Field[interface{}] `json:"region_pools"`
- // Specifies the type of session affinity the load balancer should use unless
- // specified as `"none"` or "" (default). The supported types are:
- //
- // - `"cookie"`: On the first request to a proxied load balancer, a cookie is
- // generated, encoding information of which origin the request will be forwarded
- // to. Subsequent requests, by the same client to the same load balancer, will be
- // sent to the origin server the cookie encodes, for the duration of the cookie
- // and as long as the origin server remains healthy. If the cookie has expired or
- // the origin server is unhealthy, then a new origin server is calculated and
- // used.
- // - `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin
- // selection is stable and based on the client's ip address.
- // - `"header"`: On the first request to a proxied load balancer, a session key
- // based on the configured HTTP headers (see
- // `session_affinity_attributes.headers`) is generated, encoding the request
- // headers used for storing in the load balancer session state which origin the
- // request will be forwarded to. Subsequent requests to the load balancer with
- // the same headers will be sent to the same origin server, for the duration of
- // the session and as long as the origin server remains healthy. If the session
- // has been idle for the duration of `session_affinity_ttl` seconds or the origin
- // server is unhealthy, then a new origin server is calculated and used. See
- // `headers` in `session_affinity_attributes` for additional required
- // configuration.
- SessionAffinity param.Field[LoadBalancerEditParamsRulesOverridesSessionAffinity] `json:"session_affinity"`
- // Configures attributes for session affinity.
- SessionAffinityAttributes param.Field[LoadBalancerEditParamsRulesOverridesSessionAffinityAttributes] `json:"session_affinity_attributes"`
- // Time, in seconds, until a client's session expires after being created. Once the
- // expiry time has been reached, subsequent requests may get sent to a different
- // origin server. The accepted ranges per `session_affinity` policy are:
- //
- // - `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used
- // unless explicitly set. The accepted range of values is between [1800, 604800].
- // - `"header"`: The current default of 1800 seconds will be used unless explicitly
- // set. The accepted range of values is between [30, 3600]. Note: With session
- // affinity by header, sessions only expire after they haven't been used for the
- // number of seconds specified.
- SessionAffinityTTL param.Field[float64] `json:"session_affinity_ttl"`
- // Steering Policy for this load balancer.
- //
- // - `"off"`: Use `default_pools`.
- // - `"geo"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied
- // requests, the country for `country_pools` is determined by
- // `location_strategy`.
- // - `"random"`: Select a pool randomly.
- // - `"dynamic_latency"`: Use round trip time to select the closest pool in
- // default_pools (requires pool health checks).
- // - `"proximity"`: Use the pools' latitude and longitude to select the closest
- // pool using the Cloudflare PoP location for proxied requests or the location
- // determined by `location_strategy` for non-proxied requests.
- // - `"least_outstanding_requests"`: Select a pool by taking into consideration
- // `random_steering` weights, as well as each pool's number of outstanding
- // requests. Pools with more pending requests are weighted proportionately less
- // relative to others.
- // - `"least_connections"`: Select a pool by taking into consideration
- // `random_steering` weights, as well as each pool's number of open connections.
- // Pools with more open connections are weighted proportionately less relative to
- // others. Supported for HTTP/1 and HTTP/2 connections.
- // - `""`: Will map to `"geo"` if you use
- // `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.
- SteeringPolicy param.Field[LoadBalancerEditParamsRulesOverridesSteeringPolicy] `json:"steering_policy"`
- // Time to live (TTL) of the DNS entry for the IP address returned by this load
- // balancer. This only applies to gray-clouded (unproxied) load balancers.
- TTL param.Field[float64] `json:"ttl"`
-}
-
-func (r LoadBalancerEditParamsRulesOverrides) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Controls features that modify the routing of requests to pools and origins in
-// response to dynamic conditions, such as during the interval between active
-// health monitoring requests. For example, zero-downtime failover occurs
-// immediately when an origin becomes unavailable due to HTTP 521, 522, or 523
-// response codes. If there is another healthy origin in the same pool, the request
-// is retried once against this alternate origin.
-type LoadBalancerEditParamsRulesOverridesAdaptiveRouting struct {
- // Extends zero-downtime failover of requests to healthy origins from alternate
- // pools, when no healthy alternate exists in the same pool, according to the
- // failover order defined by traffic and origin steering. When set false (the
- // default) zero-downtime failover will only occur between origins within the same
- // pool. See `session_affinity_attributes` for control over when sessions are
- // broken or reassigned.
- FailoverAcrossPools param.Field[bool] `json:"failover_across_pools"`
-}
-
-func (r LoadBalancerEditParamsRulesOverridesAdaptiveRouting) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Controls location-based steering for non-proxied requests. See `steering_policy`
-// to learn how steering is affected.
-type LoadBalancerEditParamsRulesOverridesLocationStrategy struct {
- // Determines the authoritative location when ECS is not preferred, does not exist
- // in the request, or its GeoIP lookup is unsuccessful.
- //
- // - `"pop"`: Use the Cloudflare PoP location.
- // - `"resolver_ip"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is
- // unsuccessful, use the Cloudflare PoP location.
- Mode param.Field[LoadBalancerEditParamsRulesOverridesLocationStrategyMode] `json:"mode"`
- // Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the
- // authoritative location.
- //
- // - `"always"`: Always prefer ECS.
- // - `"never"`: Never prefer ECS.
- // - `"proximity"`: Prefer ECS only when `steering_policy="proximity"`.
- // - `"geo"`: Prefer ECS only when `steering_policy="geo"`.
- PreferEcs param.Field[LoadBalancerEditParamsRulesOverridesLocationStrategyPreferEcs] `json:"prefer_ecs"`
-}
-
-func (r LoadBalancerEditParamsRulesOverridesLocationStrategy) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Determines the authoritative location when ECS is not preferred, does not exist
-// in the request, or its GeoIP lookup is unsuccessful.
-//
-// - `"pop"`: Use the Cloudflare PoP location.
-// - `"resolver_ip"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is
-// unsuccessful, use the Cloudflare PoP location.
-type LoadBalancerEditParamsRulesOverridesLocationStrategyMode string
-
-const (
- LoadBalancerEditParamsRulesOverridesLocationStrategyModePop LoadBalancerEditParamsRulesOverridesLocationStrategyMode = "pop"
- LoadBalancerEditParamsRulesOverridesLocationStrategyModeResolverIP LoadBalancerEditParamsRulesOverridesLocationStrategyMode = "resolver_ip"
-)
-
-// Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the
-// authoritative location.
-//
-// - `"always"`: Always prefer ECS.
-// - `"never"`: Never prefer ECS.
-// - `"proximity"`: Prefer ECS only when `steering_policy="proximity"`.
-// - `"geo"`: Prefer ECS only when `steering_policy="geo"`.
-type LoadBalancerEditParamsRulesOverridesLocationStrategyPreferEcs string
-
-const (
- LoadBalancerEditParamsRulesOverridesLocationStrategyPreferEcsAlways LoadBalancerEditParamsRulesOverridesLocationStrategyPreferEcs = "always"
- LoadBalancerEditParamsRulesOverridesLocationStrategyPreferEcsNever LoadBalancerEditParamsRulesOverridesLocationStrategyPreferEcs = "never"
- LoadBalancerEditParamsRulesOverridesLocationStrategyPreferEcsProximity LoadBalancerEditParamsRulesOverridesLocationStrategyPreferEcs = "proximity"
- LoadBalancerEditParamsRulesOverridesLocationStrategyPreferEcsGeo LoadBalancerEditParamsRulesOverridesLocationStrategyPreferEcs = "geo"
-)
-
-// Configures pool weights.
-//
-// - `steering_policy="random"`: A random pool is selected with probability
-// proportional to pool weights.
-// - `steering_policy="least_outstanding_requests"`: Use pool weights to scale each
-// pool's outstanding requests.
-// - `steering_policy="least_connections"`: Use pool weights to scale each pool's
-// open connections.
-type LoadBalancerEditParamsRulesOverridesRandomSteering struct {
- // The default weight for pools in the load balancer that are not specified in the
- // pool_weights map.
- DefaultWeight param.Field[float64] `json:"default_weight"`
- // A mapping of pool IDs to custom weights. The weight is relative to other pools
- // in the load balancer.
- PoolWeights param.Field[interface{}] `json:"pool_weights"`
-}
-
-func (r LoadBalancerEditParamsRulesOverridesRandomSteering) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Specifies the type of session affinity the load balancer should use unless
-// specified as `"none"` or "" (default). The supported types are:
-//
-// - `"cookie"`: On the first request to a proxied load balancer, a cookie is
-// generated, encoding information of which origin the request will be forwarded
-// to. Subsequent requests, by the same client to the same load balancer, will be
-// sent to the origin server the cookie encodes, for the duration of the cookie
-// and as long as the origin server remains healthy. If the cookie has expired or
-// the origin server is unhealthy, then a new origin server is calculated and
-// used.
-// - `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin
-// selection is stable and based on the client's ip address.
-// - `"header"`: On the first request to a proxied load balancer, a session key
-// based on the configured HTTP headers (see
-// `session_affinity_attributes.headers`) is generated, encoding the request
-// headers used for storing in the load balancer session state which origin the
-// request will be forwarded to. Subsequent requests to the load balancer with
-// the same headers will be sent to the same origin server, for the duration of
-// the session and as long as the origin server remains healthy. If the session
-// has been idle for the duration of `session_affinity_ttl` seconds or the origin
-// server is unhealthy, then a new origin server is calculated and used. See
-// `headers` in `session_affinity_attributes` for additional required
-// configuration.
-type LoadBalancerEditParamsRulesOverridesSessionAffinity string
-
-const (
- LoadBalancerEditParamsRulesOverridesSessionAffinityNone LoadBalancerEditParamsRulesOverridesSessionAffinity = "none"
- LoadBalancerEditParamsRulesOverridesSessionAffinityCookie LoadBalancerEditParamsRulesOverridesSessionAffinity = "cookie"
- LoadBalancerEditParamsRulesOverridesSessionAffinityIPCookie LoadBalancerEditParamsRulesOverridesSessionAffinity = "ip_cookie"
- LoadBalancerEditParamsRulesOverridesSessionAffinityHeader LoadBalancerEditParamsRulesOverridesSessionAffinity = "header"
- LoadBalancerEditParamsRulesOverridesSessionAffinityEmpty LoadBalancerEditParamsRulesOverridesSessionAffinity = "\"\""
-)
-
-// Configures attributes for session affinity.
-type LoadBalancerEditParamsRulesOverridesSessionAffinityAttributes struct {
- // Configures the drain duration in seconds. This field is only used when session
- // affinity is enabled on the load balancer.
- DrainDuration param.Field[float64] `json:"drain_duration"`
- // Configures the names of HTTP headers to base session affinity on when header
- // `session_affinity` is enabled. At least one HTTP header name must be provided.
- // To specify the exact cookies to be used, include an item in the following
- // format: `"cookie:,"` (example) where everything
- // after the colon is a comma-separated list of cookie names. Providing only
- // `"cookie"` will result in all cookies being used. The default max number of HTTP
- // header names that can be provided depends on your plan: 5 for Enterprise, 1 for
- // all other plans.
- Headers param.Field[[]string] `json:"headers"`
- // When header `session_affinity` is enabled, this option can be used to specify
- // how HTTP headers on load balancing requests will be used. The supported values
- // are:
- //
- // - `"true"`: Load balancing requests must contain _all_ of the HTTP headers
- // specified by the `headers` session affinity attribute, otherwise sessions
- // aren't created.
- // - `"false"`: Load balancing requests must contain _at least one_ of the HTTP
- // headers specified by the `headers` session affinity attribute, otherwise
- // sessions aren't created.
- RequireAllHeaders param.Field[bool] `json:"require_all_headers"`
- // Configures the SameSite attribute on session affinity cookie. Value "Auto" will
- // be translated to "Lax" or "None" depending if Always Use HTTPS is enabled. Note:
- // when using value "None", the secure attribute can not be set to "Never".
- Samesite param.Field[LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesSamesite] `json:"samesite"`
- // Configures the Secure attribute on session affinity cookie. Value "Always"
- // indicates the Secure attribute will be set in the Set-Cookie header, "Never"
- // indicates the Secure attribute will not be set, and "Auto" will set the Secure
- // attribute depending if Always Use HTTPS is enabled.
- Secure param.Field[LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesSecure] `json:"secure"`
- // Configures the zero-downtime failover between origins within a pool when session
- // affinity is enabled. This feature is currently incompatible with Argo, Tiered
- // Cache, and Bandwidth Alliance. The supported values are:
- //
- // - `"none"`: No failover takes place for sessions pinned to the origin (default).
- // - `"temporary"`: Traffic will be sent to another other healthy origin until the
- // originally pinned origin is available; note that this can potentially result
- // in heavy origin flapping.
- // - `"sticky"`: The session affinity cookie is updated and subsequent requests are
- // sent to the new origin. Note: Zero-downtime failover with sticky sessions is
- // currently not supported for session affinity by header.
- ZeroDowntimeFailover param.Field[LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailover] `json:"zero_downtime_failover"`
-}
-
-func (r LoadBalancerEditParamsRulesOverridesSessionAffinityAttributes) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Configures the SameSite attribute on session affinity cookie. Value "Auto" will
-// be translated to "Lax" or "None" depending if Always Use HTTPS is enabled. Note:
-// when using value "None", the secure attribute can not be set to "Never".
-type LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesSamesite string
-
-const (
- LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesSamesiteAuto LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesSamesite = "Auto"
- LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesSamesiteLax LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesSamesite = "Lax"
- LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesSamesiteNone LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesSamesite = "None"
- LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesSamesiteStrict LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesSamesite = "Strict"
-)
-
-// Configures the Secure attribute on session affinity cookie. Value "Always"
-// indicates the Secure attribute will be set in the Set-Cookie header, "Never"
-// indicates the Secure attribute will not be set, and "Auto" will set the Secure
-// attribute depending if Always Use HTTPS is enabled.
-type LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesSecure string
-
-const (
- LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesSecureAuto LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesSecure = "Auto"
- LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesSecureAlways LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesSecure = "Always"
- LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesSecureNever LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesSecure = "Never"
-)
-
-// Configures the zero-downtime failover between origins within a pool when session
-// affinity is enabled. This feature is currently incompatible with Argo, Tiered
-// Cache, and Bandwidth Alliance. The supported values are:
-//
-// - `"none"`: No failover takes place for sessions pinned to the origin (default).
-// - `"temporary"`: Traffic will be sent to another other healthy origin until the
-// originally pinned origin is available; note that this can potentially result
-// in heavy origin flapping.
-// - `"sticky"`: The session affinity cookie is updated and subsequent requests are
-// sent to the new origin. Note: Zero-downtime failover with sticky sessions is
-// currently not supported for session affinity by header.
-type LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailover string
-
-const (
- LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailoverNone LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailover = "none"
- LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailoverTemporary LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailover = "temporary"
- LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailoverSticky LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailover = "sticky"
-)
-
-// Steering Policy for this load balancer.
-//
-// - `"off"`: Use `default_pools`.
-// - `"geo"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied
-// requests, the country for `country_pools` is determined by
-// `location_strategy`.
-// - `"random"`: Select a pool randomly.
-// - `"dynamic_latency"`: Use round trip time to select the closest pool in
-// default_pools (requires pool health checks).
-// - `"proximity"`: Use the pools' latitude and longitude to select the closest
-// pool using the Cloudflare PoP location for proxied requests or the location
-// determined by `location_strategy` for non-proxied requests.
-// - `"least_outstanding_requests"`: Select a pool by taking into consideration
-// `random_steering` weights, as well as each pool's number of outstanding
-// requests. Pools with more pending requests are weighted proportionately less
-// relative to others.
-// - `"least_connections"`: Select a pool by taking into consideration
-// `random_steering` weights, as well as each pool's number of open connections.
-// Pools with more open connections are weighted proportionately less relative to
-// others. Supported for HTTP/1 and HTTP/2 connections.
-// - `""`: Will map to `"geo"` if you use
-// `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.
-type LoadBalancerEditParamsRulesOverridesSteeringPolicy string
-
-const (
- LoadBalancerEditParamsRulesOverridesSteeringPolicyOff LoadBalancerEditParamsRulesOverridesSteeringPolicy = "off"
- LoadBalancerEditParamsRulesOverridesSteeringPolicyGeo LoadBalancerEditParamsRulesOverridesSteeringPolicy = "geo"
- LoadBalancerEditParamsRulesOverridesSteeringPolicyRandom LoadBalancerEditParamsRulesOverridesSteeringPolicy = "random"
- LoadBalancerEditParamsRulesOverridesSteeringPolicyDynamicLatency LoadBalancerEditParamsRulesOverridesSteeringPolicy = "dynamic_latency"
- LoadBalancerEditParamsRulesOverridesSteeringPolicyProximity LoadBalancerEditParamsRulesOverridesSteeringPolicy = "proximity"
- LoadBalancerEditParamsRulesOverridesSteeringPolicyLeastOutstandingRequests LoadBalancerEditParamsRulesOverridesSteeringPolicy = "least_outstanding_requests"
- LoadBalancerEditParamsRulesOverridesSteeringPolicyLeastConnections LoadBalancerEditParamsRulesOverridesSteeringPolicy = "least_connections"
- LoadBalancerEditParamsRulesOverridesSteeringPolicyEmpty LoadBalancerEditParamsRulesOverridesSteeringPolicy = "\"\""
-)
-
-// Specifies the type of session affinity the load balancer should use unless
-// specified as `"none"` or "" (default). The supported types are:
-//
-// - `"cookie"`: On the first request to a proxied load balancer, a cookie is
-// generated, encoding information of which origin the request will be forwarded
-// to. Subsequent requests, by the same client to the same load balancer, will be
-// sent to the origin server the cookie encodes, for the duration of the cookie
-// and as long as the origin server remains healthy. If the cookie has expired or
-// the origin server is unhealthy, then a new origin server is calculated and
-// used.
-// - `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin
-// selection is stable and based on the client's ip address.
-// - `"header"`: On the first request to a proxied load balancer, a session key
-// based on the configured HTTP headers (see
-// `session_affinity_attributes.headers`) is generated, encoding the request
-// headers used for storing in the load balancer session state which origin the
-// request will be forwarded to. Subsequent requests to the load balancer with
-// the same headers will be sent to the same origin server, for the duration of
-// the session and as long as the origin server remains healthy. If the session
-// has been idle for the duration of `session_affinity_ttl` seconds or the origin
-// server is unhealthy, then a new origin server is calculated and used. See
-// `headers` in `session_affinity_attributes` for additional required
-// configuration.
-type LoadBalancerEditParamsSessionAffinity string
-
-const (
- LoadBalancerEditParamsSessionAffinityNone LoadBalancerEditParamsSessionAffinity = "none"
- LoadBalancerEditParamsSessionAffinityCookie LoadBalancerEditParamsSessionAffinity = "cookie"
- LoadBalancerEditParamsSessionAffinityIPCookie LoadBalancerEditParamsSessionAffinity = "ip_cookie"
- LoadBalancerEditParamsSessionAffinityHeader LoadBalancerEditParamsSessionAffinity = "header"
- LoadBalancerEditParamsSessionAffinityEmpty LoadBalancerEditParamsSessionAffinity = "\"\""
-)
-
-// Configures attributes for session affinity.
-type LoadBalancerEditParamsSessionAffinityAttributes struct {
- // Configures the drain duration in seconds. This field is only used when session
- // affinity is enabled on the load balancer.
- DrainDuration param.Field[float64] `json:"drain_duration"`
- // Configures the names of HTTP headers to base session affinity on when header
- // `session_affinity` is enabled. At least one HTTP header name must be provided.
- // To specify the exact cookies to be used, include an item in the following
- // format: `"cookie:,"` (example) where everything
- // after the colon is a comma-separated list of cookie names. Providing only
- // `"cookie"` will result in all cookies being used. The default max number of HTTP
- // header names that can be provided depends on your plan: 5 for Enterprise, 1 for
- // all other plans.
- Headers param.Field[[]string] `json:"headers"`
- // When header `session_affinity` is enabled, this option can be used to specify
- // how HTTP headers on load balancing requests will be used. The supported values
- // are:
- //
- // - `"true"`: Load balancing requests must contain _all_ of the HTTP headers
- // specified by the `headers` session affinity attribute, otherwise sessions
- // aren't created.
- // - `"false"`: Load balancing requests must contain _at least one_ of the HTTP
- // headers specified by the `headers` session affinity attribute, otherwise
- // sessions aren't created.
- RequireAllHeaders param.Field[bool] `json:"require_all_headers"`
- // Configures the SameSite attribute on session affinity cookie. Value "Auto" will
- // be translated to "Lax" or "None" depending if Always Use HTTPS is enabled. Note:
- // when using value "None", the secure attribute can not be set to "Never".
- Samesite param.Field[LoadBalancerEditParamsSessionAffinityAttributesSamesite] `json:"samesite"`
- // Configures the Secure attribute on session affinity cookie. Value "Always"
- // indicates the Secure attribute will be set in the Set-Cookie header, "Never"
- // indicates the Secure attribute will not be set, and "Auto" will set the Secure
- // attribute depending if Always Use HTTPS is enabled.
- Secure param.Field[LoadBalancerEditParamsSessionAffinityAttributesSecure] `json:"secure"`
- // Configures the zero-downtime failover between origins within a pool when session
- // affinity is enabled. This feature is currently incompatible with Argo, Tiered
- // Cache, and Bandwidth Alliance. The supported values are:
- //
- // - `"none"`: No failover takes place for sessions pinned to the origin (default).
- // - `"temporary"`: Traffic will be sent to another other healthy origin until the
- // originally pinned origin is available; note that this can potentially result
- // in heavy origin flapping.
- // - `"sticky"`: The session affinity cookie is updated and subsequent requests are
- // sent to the new origin. Note: Zero-downtime failover with sticky sessions is
- // currently not supported for session affinity by header.
- ZeroDowntimeFailover param.Field[LoadBalancerEditParamsSessionAffinityAttributesZeroDowntimeFailover] `json:"zero_downtime_failover"`
-}
-
-func (r LoadBalancerEditParamsSessionAffinityAttributes) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Configures the SameSite attribute on session affinity cookie. Value "Auto" will
-// be translated to "Lax" or "None" depending if Always Use HTTPS is enabled. Note:
-// when using value "None", the secure attribute can not be set to "Never".
-type LoadBalancerEditParamsSessionAffinityAttributesSamesite string
-
-const (
- LoadBalancerEditParamsSessionAffinityAttributesSamesiteAuto LoadBalancerEditParamsSessionAffinityAttributesSamesite = "Auto"
- LoadBalancerEditParamsSessionAffinityAttributesSamesiteLax LoadBalancerEditParamsSessionAffinityAttributesSamesite = "Lax"
- LoadBalancerEditParamsSessionAffinityAttributesSamesiteNone LoadBalancerEditParamsSessionAffinityAttributesSamesite = "None"
- LoadBalancerEditParamsSessionAffinityAttributesSamesiteStrict LoadBalancerEditParamsSessionAffinityAttributesSamesite = "Strict"
-)
-
-// Configures the Secure attribute on session affinity cookie. Value "Always"
-// indicates the Secure attribute will be set in the Set-Cookie header, "Never"
-// indicates the Secure attribute will not be set, and "Auto" will set the Secure
-// attribute depending if Always Use HTTPS is enabled.
-type LoadBalancerEditParamsSessionAffinityAttributesSecure string
-
-const (
- LoadBalancerEditParamsSessionAffinityAttributesSecureAuto LoadBalancerEditParamsSessionAffinityAttributesSecure = "Auto"
- LoadBalancerEditParamsSessionAffinityAttributesSecureAlways LoadBalancerEditParamsSessionAffinityAttributesSecure = "Always"
- LoadBalancerEditParamsSessionAffinityAttributesSecureNever LoadBalancerEditParamsSessionAffinityAttributesSecure = "Never"
-)
-
-// Configures the zero-downtime failover between origins within a pool when session
-// affinity is enabled. This feature is currently incompatible with Argo, Tiered
-// Cache, and Bandwidth Alliance. The supported values are:
-//
-// - `"none"`: No failover takes place for sessions pinned to the origin (default).
-// - `"temporary"`: Traffic will be sent to another other healthy origin until the
-// originally pinned origin is available; note that this can potentially result
-// in heavy origin flapping.
-// - `"sticky"`: The session affinity cookie is updated and subsequent requests are
-// sent to the new origin. Note: Zero-downtime failover with sticky sessions is
-// currently not supported for session affinity by header.
-type LoadBalancerEditParamsSessionAffinityAttributesZeroDowntimeFailover string
-
-const (
- LoadBalancerEditParamsSessionAffinityAttributesZeroDowntimeFailoverNone LoadBalancerEditParamsSessionAffinityAttributesZeroDowntimeFailover = "none"
- LoadBalancerEditParamsSessionAffinityAttributesZeroDowntimeFailoverTemporary LoadBalancerEditParamsSessionAffinityAttributesZeroDowntimeFailover = "temporary"
- LoadBalancerEditParamsSessionAffinityAttributesZeroDowntimeFailoverSticky LoadBalancerEditParamsSessionAffinityAttributesZeroDowntimeFailover = "sticky"
-)
-
-// Steering Policy for this load balancer.
-//
-// - `"off"`: Use `default_pools`.
-// - `"geo"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied
-// requests, the country for `country_pools` is determined by
-// `location_strategy`.
-// - `"random"`: Select a pool randomly.
-// - `"dynamic_latency"`: Use round trip time to select the closest pool in
-// default_pools (requires pool health checks).
-// - `"proximity"`: Use the pools' latitude and longitude to select the closest
-// pool using the Cloudflare PoP location for proxied requests or the location
-// determined by `location_strategy` for non-proxied requests.
-// - `"least_outstanding_requests"`: Select a pool by taking into consideration
-// `random_steering` weights, as well as each pool's number of outstanding
-// requests. Pools with more pending requests are weighted proportionately less
-// relative to others.
-// - `"least_connections"`: Select a pool by taking into consideration
-// `random_steering` weights, as well as each pool's number of open connections.
-// Pools with more open connections are weighted proportionately less relative to
-// others. Supported for HTTP/1 and HTTP/2 connections.
-// - `""`: Will map to `"geo"` if you use
-// `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.
-type LoadBalancerEditParamsSteeringPolicy string
-
-const (
- LoadBalancerEditParamsSteeringPolicyOff LoadBalancerEditParamsSteeringPolicy = "off"
- LoadBalancerEditParamsSteeringPolicyGeo LoadBalancerEditParamsSteeringPolicy = "geo"
- LoadBalancerEditParamsSteeringPolicyRandom LoadBalancerEditParamsSteeringPolicy = "random"
- LoadBalancerEditParamsSteeringPolicyDynamicLatency LoadBalancerEditParamsSteeringPolicy = "dynamic_latency"
- LoadBalancerEditParamsSteeringPolicyProximity LoadBalancerEditParamsSteeringPolicy = "proximity"
- LoadBalancerEditParamsSteeringPolicyLeastOutstandingRequests LoadBalancerEditParamsSteeringPolicy = "least_outstanding_requests"
- LoadBalancerEditParamsSteeringPolicyLeastConnections LoadBalancerEditParamsSteeringPolicy = "least_connections"
- LoadBalancerEditParamsSteeringPolicyEmpty LoadBalancerEditParamsSteeringPolicy = "\"\""
-)
-
-type LoadBalancerEditResponseEnvelope struct {
- Errors []LoadBalancerEditResponseEnvelopeErrors `json:"errors,required"`
- Messages []LoadBalancerEditResponseEnvelopeMessages `json:"messages,required"`
- Result LoadBalancer `json:"result,required"`
- // Whether the API call was successful
- Success LoadBalancerEditResponseEnvelopeSuccess `json:"success,required"`
- JSON loadBalancerEditResponseEnvelopeJSON `json:"-"`
-}
-
-// loadBalancerEditResponseEnvelopeJSON contains the JSON metadata for the struct
-// [LoadBalancerEditResponseEnvelope]
-type loadBalancerEditResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerEditResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerEditResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type LoadBalancerEditResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON loadBalancerEditResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// loadBalancerEditResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [LoadBalancerEditResponseEnvelopeErrors]
-type loadBalancerEditResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerEditResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type LoadBalancerEditResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON loadBalancerEditResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// loadBalancerEditResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [LoadBalancerEditResponseEnvelopeMessages]
-type loadBalancerEditResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerEditResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type LoadBalancerEditResponseEnvelopeSuccess bool
-
-const (
- LoadBalancerEditResponseEnvelopeSuccessTrue LoadBalancerEditResponseEnvelopeSuccess = true
-)
-
-type LoadBalancerGetParams struct {
- ZoneID param.Field[string] `path:"zone_id,required"`
-}
-
-type LoadBalancerGetResponseEnvelope struct {
- Errors []LoadBalancerGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []LoadBalancerGetResponseEnvelopeMessages `json:"messages,required"`
- Result LoadBalancer `json:"result,required"`
- // Whether the API call was successful
- Success LoadBalancerGetResponseEnvelopeSuccess `json:"success,required"`
- JSON loadBalancerGetResponseEnvelopeJSON `json:"-"`
-}
-
-// loadBalancerGetResponseEnvelopeJSON contains the JSON metadata for the struct
-// [LoadBalancerGetResponseEnvelope]
-type loadBalancerGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type LoadBalancerGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON loadBalancerGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// loadBalancerGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [LoadBalancerGetResponseEnvelopeErrors]
-type loadBalancerGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type LoadBalancerGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON loadBalancerGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// loadBalancerGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [LoadBalancerGetResponseEnvelopeMessages]
-type loadBalancerGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type LoadBalancerGetResponseEnvelopeSuccess bool
-
-const (
- LoadBalancerGetResponseEnvelopeSuccessTrue LoadBalancerGetResponseEnvelopeSuccess = true
-)
diff --git a/loadbalancer_test.go b/loadbalancer_test.go
deleted file mode 100644
index 7e90320656a..00000000000
--- a/loadbalancer_test.go
+++ /dev/null
@@ -1,1034 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestLoadBalancerNewWithOptionalParams(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"),
- )
- _, err := client.LoadBalancers.New(context.TODO(), cloudflare.LoadBalancerNewParams{
- ZoneID: cloudflare.F("699d98642c564d2e855e9661899b7252"),
- DefaultPools: cloudflare.F([]string{"17b5962d775c646f3f9725cbc7a53df4", "9290f38c5d07c2e2f4df57b1f61d4196", "00920f38ce07c2e2f4df50b1f61d4194"}),
- FallbackPool: cloudflare.F[any](map[string]interface{}{}),
- Name: cloudflare.F("www.example.com"),
- AdaptiveRouting: cloudflare.F(cloudflare.LoadBalancerNewParamsAdaptiveRouting{
- FailoverAcrossPools: cloudflare.F(true),
- }),
- CountryPools: cloudflare.F[any](map[string]interface{}{
- "GB": map[string]interface{}{
- "0": "abd90f38ced07c2e2f4df50b1f61d4194",
- },
- "US": map[string]interface{}{
- "0": "de90f38ced07c2e2f4df50b1f61d4194",
- "1": "00920f38ce07c2e2f4df50b1f61d4194",
- },
- }),
- Description: cloudflare.F("Load Balancer for www.example.com"),
- LocationStrategy: cloudflare.F(cloudflare.LoadBalancerNewParamsLocationStrategy{
- Mode: cloudflare.F(cloudflare.LoadBalancerNewParamsLocationStrategyModeResolverIP),
- PreferEcs: cloudflare.F(cloudflare.LoadBalancerNewParamsLocationStrategyPreferEcsAlways),
- }),
- PopPools: cloudflare.F[any](map[string]interface{}{
- "LAX": map[string]interface{}{
- "0": "de90f38ced07c2e2f4df50b1f61d4194",
- "1": "9290f38c5d07c2e2f4df57b1f61d4196",
- },
- "LHR": map[string]interface{}{
- "0": "abd90f38ced07c2e2f4df50b1f61d4194",
- "1": "f9138c5d07c2e2f4df57b1f61d4196",
- },
- "SJC": map[string]interface{}{
- "0": "00920f38ce07c2e2f4df50b1f61d4194",
- },
- }),
- Proxied: cloudflare.F(true),
- RandomSteering: cloudflare.F(cloudflare.LoadBalancerNewParamsRandomSteering{
- DefaultWeight: cloudflare.F(0.200000),
- PoolWeights: cloudflare.F[any](map[string]interface{}{
- "9290f38c5d07c2e2f4df57b1f61d4196": 0.500000,
- "de90f38ced07c2e2f4df50b1f61d4194": 0.300000,
- }),
- }),
- RegionPools: cloudflare.F[any](map[string]interface{}{
- "ENAM": map[string]interface{}{
- "0": "00920f38ce07c2e2f4df50b1f61d4194",
- },
- "WNAM": map[string]interface{}{
- "0": "de90f38ced07c2e2f4df50b1f61d4194",
- "1": "9290f38c5d07c2e2f4df57b1f61d4196",
- },
- }),
- Rules: cloudflare.F([]cloudflare.LoadBalancerNewParamsRule{{
- Condition: cloudflare.F("http.request.uri.path contains \"/testing\""),
- Disabled: cloudflare.F(true),
- FixedResponse: cloudflare.F(cloudflare.LoadBalancerNewParamsRulesFixedResponse{
- ContentType: cloudflare.F("application/json"),
- Location: cloudflare.F("www.example.com"),
- MessageBody: cloudflare.F("Testing Hello"),
- StatusCode: cloudflare.F(int64(0)),
- }),
- Name: cloudflare.F("route the path /testing to testing datacenter."),
- Overrides: cloudflare.F(cloudflare.LoadBalancerNewParamsRulesOverrides{
- AdaptiveRouting: cloudflare.F(cloudflare.LoadBalancerNewParamsRulesOverridesAdaptiveRouting{
- FailoverAcrossPools: cloudflare.F(true),
- }),
- CountryPools: cloudflare.F[any](map[string]interface{}{
- "GB": map[string]interface{}{
- "0": "abd90f38ced07c2e2f4df50b1f61d4194",
- },
- "US": map[string]interface{}{
- "0": "de90f38ced07c2e2f4df50b1f61d4194",
- "1": "00920f38ce07c2e2f4df50b1f61d4194",
- },
- }),
- DefaultPools: cloudflare.F([]string{"17b5962d775c646f3f9725cbc7a53df4", "9290f38c5d07c2e2f4df57b1f61d4196", "00920f38ce07c2e2f4df50b1f61d4194"}),
- FallbackPool: cloudflare.F[any](map[string]interface{}{}),
- LocationStrategy: cloudflare.F(cloudflare.LoadBalancerNewParamsRulesOverridesLocationStrategy{
- Mode: cloudflare.F(cloudflare.LoadBalancerNewParamsRulesOverridesLocationStrategyModeResolverIP),
- PreferEcs: cloudflare.F(cloudflare.LoadBalancerNewParamsRulesOverridesLocationStrategyPreferEcsAlways),
- }),
- PopPools: cloudflare.F[any](map[string]interface{}{
- "LAX": map[string]interface{}{
- "0": "de90f38ced07c2e2f4df50b1f61d4194",
- "1": "9290f38c5d07c2e2f4df57b1f61d4196",
- },
- "LHR": map[string]interface{}{
- "0": "abd90f38ced07c2e2f4df50b1f61d4194",
- "1": "f9138c5d07c2e2f4df57b1f61d4196",
- },
- "SJC": map[string]interface{}{
- "0": "00920f38ce07c2e2f4df50b1f61d4194",
- },
- }),
- RandomSteering: cloudflare.F(cloudflare.LoadBalancerNewParamsRulesOverridesRandomSteering{
- DefaultWeight: cloudflare.F(0.200000),
- PoolWeights: cloudflare.F[any](map[string]interface{}{
- "9290f38c5d07c2e2f4df57b1f61d4196": 0.500000,
- "de90f38ced07c2e2f4df50b1f61d4194": 0.300000,
- }),
- }),
- RegionPools: cloudflare.F[any](map[string]interface{}{
- "ENAM": map[string]interface{}{
- "0": "00920f38ce07c2e2f4df50b1f61d4194",
- },
- "WNAM": map[string]interface{}{
- "0": "de90f38ced07c2e2f4df50b1f61d4194",
- "1": "9290f38c5d07c2e2f4df57b1f61d4196",
- },
- }),
- SessionAffinity: cloudflare.F(cloudflare.LoadBalancerNewParamsRulesOverridesSessionAffinityCookie),
- SessionAffinityAttributes: cloudflare.F(cloudflare.LoadBalancerNewParamsRulesOverridesSessionAffinityAttributes{
- DrainDuration: cloudflare.F(100.000000),
- Headers: cloudflare.F([]string{"x"}),
- RequireAllHeaders: cloudflare.F(true),
- Samesite: cloudflare.F(cloudflare.LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesSamesiteAuto),
- Secure: cloudflare.F(cloudflare.LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesSecureAuto),
- ZeroDowntimeFailover: cloudflare.F(cloudflare.LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailoverSticky),
- }),
- SessionAffinityTTL: cloudflare.F(1800.000000),
- SteeringPolicy: cloudflare.F(cloudflare.LoadBalancerNewParamsRulesOverridesSteeringPolicyDynamicLatency),
- TTL: cloudflare.F(30.000000),
- }),
- Priority: cloudflare.F(int64(0)),
- Terminates: cloudflare.F(true),
- }, {
- Condition: cloudflare.F("http.request.uri.path contains \"/testing\""),
- Disabled: cloudflare.F(true),
- FixedResponse: cloudflare.F(cloudflare.LoadBalancerNewParamsRulesFixedResponse{
- ContentType: cloudflare.F("application/json"),
- Location: cloudflare.F("www.example.com"),
- MessageBody: cloudflare.F("Testing Hello"),
- StatusCode: cloudflare.F(int64(0)),
- }),
- Name: cloudflare.F("route the path /testing to testing datacenter."),
- Overrides: cloudflare.F(cloudflare.LoadBalancerNewParamsRulesOverrides{
- AdaptiveRouting: cloudflare.F(cloudflare.LoadBalancerNewParamsRulesOverridesAdaptiveRouting{
- FailoverAcrossPools: cloudflare.F(true),
- }),
- CountryPools: cloudflare.F[any](map[string]interface{}{
- "GB": map[string]interface{}{
- "0": "abd90f38ced07c2e2f4df50b1f61d4194",
- },
- "US": map[string]interface{}{
- "0": "de90f38ced07c2e2f4df50b1f61d4194",
- "1": "00920f38ce07c2e2f4df50b1f61d4194",
- },
- }),
- DefaultPools: cloudflare.F([]string{"17b5962d775c646f3f9725cbc7a53df4", "9290f38c5d07c2e2f4df57b1f61d4196", "00920f38ce07c2e2f4df50b1f61d4194"}),
- FallbackPool: cloudflare.F[any](map[string]interface{}{}),
- LocationStrategy: cloudflare.F(cloudflare.LoadBalancerNewParamsRulesOverridesLocationStrategy{
- Mode: cloudflare.F(cloudflare.LoadBalancerNewParamsRulesOverridesLocationStrategyModeResolverIP),
- PreferEcs: cloudflare.F(cloudflare.LoadBalancerNewParamsRulesOverridesLocationStrategyPreferEcsAlways),
- }),
- PopPools: cloudflare.F[any](map[string]interface{}{
- "LAX": map[string]interface{}{
- "0": "de90f38ced07c2e2f4df50b1f61d4194",
- "1": "9290f38c5d07c2e2f4df57b1f61d4196",
- },
- "LHR": map[string]interface{}{
- "0": "abd90f38ced07c2e2f4df50b1f61d4194",
- "1": "f9138c5d07c2e2f4df57b1f61d4196",
- },
- "SJC": map[string]interface{}{
- "0": "00920f38ce07c2e2f4df50b1f61d4194",
- },
- }),
- RandomSteering: cloudflare.F(cloudflare.LoadBalancerNewParamsRulesOverridesRandomSteering{
- DefaultWeight: cloudflare.F(0.200000),
- PoolWeights: cloudflare.F[any](map[string]interface{}{
- "9290f38c5d07c2e2f4df57b1f61d4196": 0.500000,
- "de90f38ced07c2e2f4df50b1f61d4194": 0.300000,
- }),
- }),
- RegionPools: cloudflare.F[any](map[string]interface{}{
- "ENAM": map[string]interface{}{
- "0": "00920f38ce07c2e2f4df50b1f61d4194",
- },
- "WNAM": map[string]interface{}{
- "0": "de90f38ced07c2e2f4df50b1f61d4194",
- "1": "9290f38c5d07c2e2f4df57b1f61d4196",
- },
- }),
- SessionAffinity: cloudflare.F(cloudflare.LoadBalancerNewParamsRulesOverridesSessionAffinityCookie),
- SessionAffinityAttributes: cloudflare.F(cloudflare.LoadBalancerNewParamsRulesOverridesSessionAffinityAttributes{
- DrainDuration: cloudflare.F(100.000000),
- Headers: cloudflare.F([]string{"x"}),
- RequireAllHeaders: cloudflare.F(true),
- Samesite: cloudflare.F(cloudflare.LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesSamesiteAuto),
- Secure: cloudflare.F(cloudflare.LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesSecureAuto),
- ZeroDowntimeFailover: cloudflare.F(cloudflare.LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailoverSticky),
- }),
- SessionAffinityTTL: cloudflare.F(1800.000000),
- SteeringPolicy: cloudflare.F(cloudflare.LoadBalancerNewParamsRulesOverridesSteeringPolicyDynamicLatency),
- TTL: cloudflare.F(30.000000),
- }),
- Priority: cloudflare.F(int64(0)),
- Terminates: cloudflare.F(true),
- }, {
- Condition: cloudflare.F("http.request.uri.path contains \"/testing\""),
- Disabled: cloudflare.F(true),
- FixedResponse: cloudflare.F(cloudflare.LoadBalancerNewParamsRulesFixedResponse{
- ContentType: cloudflare.F("application/json"),
- Location: cloudflare.F("www.example.com"),
- MessageBody: cloudflare.F("Testing Hello"),
- StatusCode: cloudflare.F(int64(0)),
- }),
- Name: cloudflare.F("route the path /testing to testing datacenter."),
- Overrides: cloudflare.F(cloudflare.LoadBalancerNewParamsRulesOverrides{
- AdaptiveRouting: cloudflare.F(cloudflare.LoadBalancerNewParamsRulesOverridesAdaptiveRouting{
- FailoverAcrossPools: cloudflare.F(true),
- }),
- CountryPools: cloudflare.F[any](map[string]interface{}{
- "GB": map[string]interface{}{
- "0": "abd90f38ced07c2e2f4df50b1f61d4194",
- },
- "US": map[string]interface{}{
- "0": "de90f38ced07c2e2f4df50b1f61d4194",
- "1": "00920f38ce07c2e2f4df50b1f61d4194",
- },
- }),
- DefaultPools: cloudflare.F([]string{"17b5962d775c646f3f9725cbc7a53df4", "9290f38c5d07c2e2f4df57b1f61d4196", "00920f38ce07c2e2f4df50b1f61d4194"}),
- FallbackPool: cloudflare.F[any](map[string]interface{}{}),
- LocationStrategy: cloudflare.F(cloudflare.LoadBalancerNewParamsRulesOverridesLocationStrategy{
- Mode: cloudflare.F(cloudflare.LoadBalancerNewParamsRulesOverridesLocationStrategyModeResolverIP),
- PreferEcs: cloudflare.F(cloudflare.LoadBalancerNewParamsRulesOverridesLocationStrategyPreferEcsAlways),
- }),
- PopPools: cloudflare.F[any](map[string]interface{}{
- "LAX": map[string]interface{}{
- "0": "de90f38ced07c2e2f4df50b1f61d4194",
- "1": "9290f38c5d07c2e2f4df57b1f61d4196",
- },
- "LHR": map[string]interface{}{
- "0": "abd90f38ced07c2e2f4df50b1f61d4194",
- "1": "f9138c5d07c2e2f4df57b1f61d4196",
- },
- "SJC": map[string]interface{}{
- "0": "00920f38ce07c2e2f4df50b1f61d4194",
- },
- }),
- RandomSteering: cloudflare.F(cloudflare.LoadBalancerNewParamsRulesOverridesRandomSteering{
- DefaultWeight: cloudflare.F(0.200000),
- PoolWeights: cloudflare.F[any](map[string]interface{}{
- "9290f38c5d07c2e2f4df57b1f61d4196": 0.500000,
- "de90f38ced07c2e2f4df50b1f61d4194": 0.300000,
- }),
- }),
- RegionPools: cloudflare.F[any](map[string]interface{}{
- "ENAM": map[string]interface{}{
- "0": "00920f38ce07c2e2f4df50b1f61d4194",
- },
- "WNAM": map[string]interface{}{
- "0": "de90f38ced07c2e2f4df50b1f61d4194",
- "1": "9290f38c5d07c2e2f4df57b1f61d4196",
- },
- }),
- SessionAffinity: cloudflare.F(cloudflare.LoadBalancerNewParamsRulesOverridesSessionAffinityCookie),
- SessionAffinityAttributes: cloudflare.F(cloudflare.LoadBalancerNewParamsRulesOverridesSessionAffinityAttributes{
- DrainDuration: cloudflare.F(100.000000),
- Headers: cloudflare.F([]string{"x"}),
- RequireAllHeaders: cloudflare.F(true),
- Samesite: cloudflare.F(cloudflare.LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesSamesiteAuto),
- Secure: cloudflare.F(cloudflare.LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesSecureAuto),
- ZeroDowntimeFailover: cloudflare.F(cloudflare.LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailoverSticky),
- }),
- SessionAffinityTTL: cloudflare.F(1800.000000),
- SteeringPolicy: cloudflare.F(cloudflare.LoadBalancerNewParamsRulesOverridesSteeringPolicyDynamicLatency),
- TTL: cloudflare.F(30.000000),
- }),
- Priority: cloudflare.F(int64(0)),
- Terminates: cloudflare.F(true),
- }}),
- SessionAffinity: cloudflare.F(cloudflare.LoadBalancerNewParamsSessionAffinityCookie),
- SessionAffinityAttributes: cloudflare.F(cloudflare.LoadBalancerNewParamsSessionAffinityAttributes{
- DrainDuration: cloudflare.F(100.000000),
- Headers: cloudflare.F([]string{"x"}),
- RequireAllHeaders: cloudflare.F(true),
- Samesite: cloudflare.F(cloudflare.LoadBalancerNewParamsSessionAffinityAttributesSamesiteAuto),
- Secure: cloudflare.F(cloudflare.LoadBalancerNewParamsSessionAffinityAttributesSecureAuto),
- ZeroDowntimeFailover: cloudflare.F(cloudflare.LoadBalancerNewParamsSessionAffinityAttributesZeroDowntimeFailoverSticky),
- }),
- SessionAffinityTTL: cloudflare.F(1800.000000),
- SteeringPolicy: cloudflare.F(cloudflare.LoadBalancerNewParamsSteeringPolicyDynamicLatency),
- TTL: cloudflare.F(30.000000),
- })
- 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())
- }
-}
-
-func TestLoadBalancerUpdateWithOptionalParams(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"),
- )
- _, err := client.LoadBalancers.Update(
- context.TODO(),
- "699d98642c564d2e855e9661899b7252",
- cloudflare.LoadBalancerUpdateParams{
- ZoneID: cloudflare.F("699d98642c564d2e855e9661899b7252"),
- DefaultPools: cloudflare.F([]string{"17b5962d775c646f3f9725cbc7a53df4", "9290f38c5d07c2e2f4df57b1f61d4196", "00920f38ce07c2e2f4df50b1f61d4194"}),
- FallbackPool: cloudflare.F[any](map[string]interface{}{}),
- Name: cloudflare.F("www.example.com"),
- AdaptiveRouting: cloudflare.F(cloudflare.LoadBalancerUpdateParamsAdaptiveRouting{
- FailoverAcrossPools: cloudflare.F(true),
- }),
- CountryPools: cloudflare.F[any](map[string]interface{}{
- "GB": map[string]interface{}{
- "0": "abd90f38ced07c2e2f4df50b1f61d4194",
- },
- "US": map[string]interface{}{
- "0": "de90f38ced07c2e2f4df50b1f61d4194",
- "1": "00920f38ce07c2e2f4df50b1f61d4194",
- },
- }),
- Description: cloudflare.F("Load Balancer for www.example.com"),
- Enabled: cloudflare.F(true),
- LocationStrategy: cloudflare.F(cloudflare.LoadBalancerUpdateParamsLocationStrategy{
- Mode: cloudflare.F(cloudflare.LoadBalancerUpdateParamsLocationStrategyModeResolverIP),
- PreferEcs: cloudflare.F(cloudflare.LoadBalancerUpdateParamsLocationStrategyPreferEcsAlways),
- }),
- PopPools: cloudflare.F[any](map[string]interface{}{
- "LAX": map[string]interface{}{
- "0": "de90f38ced07c2e2f4df50b1f61d4194",
- "1": "9290f38c5d07c2e2f4df57b1f61d4196",
- },
- "LHR": map[string]interface{}{
- "0": "abd90f38ced07c2e2f4df50b1f61d4194",
- "1": "f9138c5d07c2e2f4df57b1f61d4196",
- },
- "SJC": map[string]interface{}{
- "0": "00920f38ce07c2e2f4df50b1f61d4194",
- },
- }),
- Proxied: cloudflare.F(true),
- RandomSteering: cloudflare.F(cloudflare.LoadBalancerUpdateParamsRandomSteering{
- DefaultWeight: cloudflare.F(0.200000),
- PoolWeights: cloudflare.F[any](map[string]interface{}{
- "9290f38c5d07c2e2f4df57b1f61d4196": 0.500000,
- "de90f38ced07c2e2f4df50b1f61d4194": 0.300000,
- }),
- }),
- RegionPools: cloudflare.F[any](map[string]interface{}{
- "ENAM": map[string]interface{}{
- "0": "00920f38ce07c2e2f4df50b1f61d4194",
- },
- "WNAM": map[string]interface{}{
- "0": "de90f38ced07c2e2f4df50b1f61d4194",
- "1": "9290f38c5d07c2e2f4df57b1f61d4196",
- },
- }),
- Rules: cloudflare.F([]cloudflare.LoadBalancerUpdateParamsRule{{
- Condition: cloudflare.F("http.request.uri.path contains \"/testing\""),
- Disabled: cloudflare.F(true),
- FixedResponse: cloudflare.F(cloudflare.LoadBalancerUpdateParamsRulesFixedResponse{
- ContentType: cloudflare.F("application/json"),
- Location: cloudflare.F("www.example.com"),
- MessageBody: cloudflare.F("Testing Hello"),
- StatusCode: cloudflare.F(int64(0)),
- }),
- Name: cloudflare.F("route the path /testing to testing datacenter."),
- Overrides: cloudflare.F(cloudflare.LoadBalancerUpdateParamsRulesOverrides{
- AdaptiveRouting: cloudflare.F(cloudflare.LoadBalancerUpdateParamsRulesOverridesAdaptiveRouting{
- FailoverAcrossPools: cloudflare.F(true),
- }),
- CountryPools: cloudflare.F[any](map[string]interface{}{
- "GB": map[string]interface{}{
- "0": "abd90f38ced07c2e2f4df50b1f61d4194",
- },
- "US": map[string]interface{}{
- "0": "de90f38ced07c2e2f4df50b1f61d4194",
- "1": "00920f38ce07c2e2f4df50b1f61d4194",
- },
- }),
- DefaultPools: cloudflare.F([]string{"17b5962d775c646f3f9725cbc7a53df4", "9290f38c5d07c2e2f4df57b1f61d4196", "00920f38ce07c2e2f4df50b1f61d4194"}),
- FallbackPool: cloudflare.F[any](map[string]interface{}{}),
- LocationStrategy: cloudflare.F(cloudflare.LoadBalancerUpdateParamsRulesOverridesLocationStrategy{
- Mode: cloudflare.F(cloudflare.LoadBalancerUpdateParamsRulesOverridesLocationStrategyModeResolverIP),
- PreferEcs: cloudflare.F(cloudflare.LoadBalancerUpdateParamsRulesOverridesLocationStrategyPreferEcsAlways),
- }),
- PopPools: cloudflare.F[any](map[string]interface{}{
- "LAX": map[string]interface{}{
- "0": "de90f38ced07c2e2f4df50b1f61d4194",
- "1": "9290f38c5d07c2e2f4df57b1f61d4196",
- },
- "LHR": map[string]interface{}{
- "0": "abd90f38ced07c2e2f4df50b1f61d4194",
- "1": "f9138c5d07c2e2f4df57b1f61d4196",
- },
- "SJC": map[string]interface{}{
- "0": "00920f38ce07c2e2f4df50b1f61d4194",
- },
- }),
- RandomSteering: cloudflare.F(cloudflare.LoadBalancerUpdateParamsRulesOverridesRandomSteering{
- DefaultWeight: cloudflare.F(0.200000),
- PoolWeights: cloudflare.F[any](map[string]interface{}{
- "9290f38c5d07c2e2f4df57b1f61d4196": 0.500000,
- "de90f38ced07c2e2f4df50b1f61d4194": 0.300000,
- }),
- }),
- RegionPools: cloudflare.F[any](map[string]interface{}{
- "ENAM": map[string]interface{}{
- "0": "00920f38ce07c2e2f4df50b1f61d4194",
- },
- "WNAM": map[string]interface{}{
- "0": "de90f38ced07c2e2f4df50b1f61d4194",
- "1": "9290f38c5d07c2e2f4df57b1f61d4196",
- },
- }),
- SessionAffinity: cloudflare.F(cloudflare.LoadBalancerUpdateParamsRulesOverridesSessionAffinityCookie),
- SessionAffinityAttributes: cloudflare.F(cloudflare.LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributes{
- DrainDuration: cloudflare.F(100.000000),
- Headers: cloudflare.F([]string{"x"}),
- RequireAllHeaders: cloudflare.F(true),
- Samesite: cloudflare.F(cloudflare.LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesSamesiteAuto),
- Secure: cloudflare.F(cloudflare.LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesSecureAuto),
- ZeroDowntimeFailover: cloudflare.F(cloudflare.LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailoverSticky),
- }),
- SessionAffinityTTL: cloudflare.F(1800.000000),
- SteeringPolicy: cloudflare.F(cloudflare.LoadBalancerUpdateParamsRulesOverridesSteeringPolicyDynamicLatency),
- TTL: cloudflare.F(30.000000),
- }),
- Priority: cloudflare.F(int64(0)),
- Terminates: cloudflare.F(true),
- }, {
- Condition: cloudflare.F("http.request.uri.path contains \"/testing\""),
- Disabled: cloudflare.F(true),
- FixedResponse: cloudflare.F(cloudflare.LoadBalancerUpdateParamsRulesFixedResponse{
- ContentType: cloudflare.F("application/json"),
- Location: cloudflare.F("www.example.com"),
- MessageBody: cloudflare.F("Testing Hello"),
- StatusCode: cloudflare.F(int64(0)),
- }),
- Name: cloudflare.F("route the path /testing to testing datacenter."),
- Overrides: cloudflare.F(cloudflare.LoadBalancerUpdateParamsRulesOverrides{
- AdaptiveRouting: cloudflare.F(cloudflare.LoadBalancerUpdateParamsRulesOverridesAdaptiveRouting{
- FailoverAcrossPools: cloudflare.F(true),
- }),
- CountryPools: cloudflare.F[any](map[string]interface{}{
- "GB": map[string]interface{}{
- "0": "abd90f38ced07c2e2f4df50b1f61d4194",
- },
- "US": map[string]interface{}{
- "0": "de90f38ced07c2e2f4df50b1f61d4194",
- "1": "00920f38ce07c2e2f4df50b1f61d4194",
- },
- }),
- DefaultPools: cloudflare.F([]string{"17b5962d775c646f3f9725cbc7a53df4", "9290f38c5d07c2e2f4df57b1f61d4196", "00920f38ce07c2e2f4df50b1f61d4194"}),
- FallbackPool: cloudflare.F[any](map[string]interface{}{}),
- LocationStrategy: cloudflare.F(cloudflare.LoadBalancerUpdateParamsRulesOverridesLocationStrategy{
- Mode: cloudflare.F(cloudflare.LoadBalancerUpdateParamsRulesOverridesLocationStrategyModeResolverIP),
- PreferEcs: cloudflare.F(cloudflare.LoadBalancerUpdateParamsRulesOverridesLocationStrategyPreferEcsAlways),
- }),
- PopPools: cloudflare.F[any](map[string]interface{}{
- "LAX": map[string]interface{}{
- "0": "de90f38ced07c2e2f4df50b1f61d4194",
- "1": "9290f38c5d07c2e2f4df57b1f61d4196",
- },
- "LHR": map[string]interface{}{
- "0": "abd90f38ced07c2e2f4df50b1f61d4194",
- "1": "f9138c5d07c2e2f4df57b1f61d4196",
- },
- "SJC": map[string]interface{}{
- "0": "00920f38ce07c2e2f4df50b1f61d4194",
- },
- }),
- RandomSteering: cloudflare.F(cloudflare.LoadBalancerUpdateParamsRulesOverridesRandomSteering{
- DefaultWeight: cloudflare.F(0.200000),
- PoolWeights: cloudflare.F[any](map[string]interface{}{
- "9290f38c5d07c2e2f4df57b1f61d4196": 0.500000,
- "de90f38ced07c2e2f4df50b1f61d4194": 0.300000,
- }),
- }),
- RegionPools: cloudflare.F[any](map[string]interface{}{
- "ENAM": map[string]interface{}{
- "0": "00920f38ce07c2e2f4df50b1f61d4194",
- },
- "WNAM": map[string]interface{}{
- "0": "de90f38ced07c2e2f4df50b1f61d4194",
- "1": "9290f38c5d07c2e2f4df57b1f61d4196",
- },
- }),
- SessionAffinity: cloudflare.F(cloudflare.LoadBalancerUpdateParamsRulesOverridesSessionAffinityCookie),
- SessionAffinityAttributes: cloudflare.F(cloudflare.LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributes{
- DrainDuration: cloudflare.F(100.000000),
- Headers: cloudflare.F([]string{"x"}),
- RequireAllHeaders: cloudflare.F(true),
- Samesite: cloudflare.F(cloudflare.LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesSamesiteAuto),
- Secure: cloudflare.F(cloudflare.LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesSecureAuto),
- ZeroDowntimeFailover: cloudflare.F(cloudflare.LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailoverSticky),
- }),
- SessionAffinityTTL: cloudflare.F(1800.000000),
- SteeringPolicy: cloudflare.F(cloudflare.LoadBalancerUpdateParamsRulesOverridesSteeringPolicyDynamicLatency),
- TTL: cloudflare.F(30.000000),
- }),
- Priority: cloudflare.F(int64(0)),
- Terminates: cloudflare.F(true),
- }, {
- Condition: cloudflare.F("http.request.uri.path contains \"/testing\""),
- Disabled: cloudflare.F(true),
- FixedResponse: cloudflare.F(cloudflare.LoadBalancerUpdateParamsRulesFixedResponse{
- ContentType: cloudflare.F("application/json"),
- Location: cloudflare.F("www.example.com"),
- MessageBody: cloudflare.F("Testing Hello"),
- StatusCode: cloudflare.F(int64(0)),
- }),
- Name: cloudflare.F("route the path /testing to testing datacenter."),
- Overrides: cloudflare.F(cloudflare.LoadBalancerUpdateParamsRulesOverrides{
- AdaptiveRouting: cloudflare.F(cloudflare.LoadBalancerUpdateParamsRulesOverridesAdaptiveRouting{
- FailoverAcrossPools: cloudflare.F(true),
- }),
- CountryPools: cloudflare.F[any](map[string]interface{}{
- "GB": map[string]interface{}{
- "0": "abd90f38ced07c2e2f4df50b1f61d4194",
- },
- "US": map[string]interface{}{
- "0": "de90f38ced07c2e2f4df50b1f61d4194",
- "1": "00920f38ce07c2e2f4df50b1f61d4194",
- },
- }),
- DefaultPools: cloudflare.F([]string{"17b5962d775c646f3f9725cbc7a53df4", "9290f38c5d07c2e2f4df57b1f61d4196", "00920f38ce07c2e2f4df50b1f61d4194"}),
- FallbackPool: cloudflare.F[any](map[string]interface{}{}),
- LocationStrategy: cloudflare.F(cloudflare.LoadBalancerUpdateParamsRulesOverridesLocationStrategy{
- Mode: cloudflare.F(cloudflare.LoadBalancerUpdateParamsRulesOverridesLocationStrategyModeResolverIP),
- PreferEcs: cloudflare.F(cloudflare.LoadBalancerUpdateParamsRulesOverridesLocationStrategyPreferEcsAlways),
- }),
- PopPools: cloudflare.F[any](map[string]interface{}{
- "LAX": map[string]interface{}{
- "0": "de90f38ced07c2e2f4df50b1f61d4194",
- "1": "9290f38c5d07c2e2f4df57b1f61d4196",
- },
- "LHR": map[string]interface{}{
- "0": "abd90f38ced07c2e2f4df50b1f61d4194",
- "1": "f9138c5d07c2e2f4df57b1f61d4196",
- },
- "SJC": map[string]interface{}{
- "0": "00920f38ce07c2e2f4df50b1f61d4194",
- },
- }),
- RandomSteering: cloudflare.F(cloudflare.LoadBalancerUpdateParamsRulesOverridesRandomSteering{
- DefaultWeight: cloudflare.F(0.200000),
- PoolWeights: cloudflare.F[any](map[string]interface{}{
- "9290f38c5d07c2e2f4df57b1f61d4196": 0.500000,
- "de90f38ced07c2e2f4df50b1f61d4194": 0.300000,
- }),
- }),
- RegionPools: cloudflare.F[any](map[string]interface{}{
- "ENAM": map[string]interface{}{
- "0": "00920f38ce07c2e2f4df50b1f61d4194",
- },
- "WNAM": map[string]interface{}{
- "0": "de90f38ced07c2e2f4df50b1f61d4194",
- "1": "9290f38c5d07c2e2f4df57b1f61d4196",
- },
- }),
- SessionAffinity: cloudflare.F(cloudflare.LoadBalancerUpdateParamsRulesOverridesSessionAffinityCookie),
- SessionAffinityAttributes: cloudflare.F(cloudflare.LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributes{
- DrainDuration: cloudflare.F(100.000000),
- Headers: cloudflare.F([]string{"x"}),
- RequireAllHeaders: cloudflare.F(true),
- Samesite: cloudflare.F(cloudflare.LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesSamesiteAuto),
- Secure: cloudflare.F(cloudflare.LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesSecureAuto),
- ZeroDowntimeFailover: cloudflare.F(cloudflare.LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailoverSticky),
- }),
- SessionAffinityTTL: cloudflare.F(1800.000000),
- SteeringPolicy: cloudflare.F(cloudflare.LoadBalancerUpdateParamsRulesOverridesSteeringPolicyDynamicLatency),
- TTL: cloudflare.F(30.000000),
- }),
- Priority: cloudflare.F(int64(0)),
- Terminates: cloudflare.F(true),
- }}),
- SessionAffinity: cloudflare.F(cloudflare.LoadBalancerUpdateParamsSessionAffinityCookie),
- SessionAffinityAttributes: cloudflare.F(cloudflare.LoadBalancerUpdateParamsSessionAffinityAttributes{
- DrainDuration: cloudflare.F(100.000000),
- Headers: cloudflare.F([]string{"x"}),
- RequireAllHeaders: cloudflare.F(true),
- Samesite: cloudflare.F(cloudflare.LoadBalancerUpdateParamsSessionAffinityAttributesSamesiteAuto),
- Secure: cloudflare.F(cloudflare.LoadBalancerUpdateParamsSessionAffinityAttributesSecureAuto),
- ZeroDowntimeFailover: cloudflare.F(cloudflare.LoadBalancerUpdateParamsSessionAffinityAttributesZeroDowntimeFailoverSticky),
- }),
- SessionAffinityTTL: cloudflare.F(1800.000000),
- SteeringPolicy: cloudflare.F(cloudflare.LoadBalancerUpdateParamsSteeringPolicyDynamicLatency),
- TTL: cloudflare.F(30.000000),
- },
- )
- 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())
- }
-}
-
-func TestLoadBalancerList(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"),
- )
- _, err := client.LoadBalancers.List(context.TODO(), cloudflare.LoadBalancerListParams{
- ZoneID: cloudflare.F("699d98642c564d2e855e9661899b7252"),
- })
- 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())
- }
-}
-
-func TestLoadBalancerDelete(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"),
- )
- _, err := client.LoadBalancers.Delete(
- context.TODO(),
- "699d98642c564d2e855e9661899b7252",
- cloudflare.LoadBalancerDeleteParams{
- ZoneID: cloudflare.F("699d98642c564d2e855e9661899b7252"),
- },
- )
- 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())
- }
-}
-
-func TestLoadBalancerEditWithOptionalParams(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"),
- )
- _, err := client.LoadBalancers.Edit(
- context.TODO(),
- "699d98642c564d2e855e9661899b7252",
- cloudflare.LoadBalancerEditParams{
- ZoneID: cloudflare.F("699d98642c564d2e855e9661899b7252"),
- AdaptiveRouting: cloudflare.F(cloudflare.LoadBalancerEditParamsAdaptiveRouting{
- FailoverAcrossPools: cloudflare.F(true),
- }),
- CountryPools: cloudflare.F[any](map[string]interface{}{
- "GB": map[string]interface{}{
- "0": "abd90f38ced07c2e2f4df50b1f61d4194",
- },
- "US": map[string]interface{}{
- "0": "de90f38ced07c2e2f4df50b1f61d4194",
- "1": "00920f38ce07c2e2f4df50b1f61d4194",
- },
- }),
- DefaultPools: cloudflare.F([]string{"17b5962d775c646f3f9725cbc7a53df4", "9290f38c5d07c2e2f4df57b1f61d4196", "00920f38ce07c2e2f4df50b1f61d4194"}),
- Description: cloudflare.F("Load Balancer for www.example.com"),
- Enabled: cloudflare.F(true),
- FallbackPool: cloudflare.F[any](map[string]interface{}{}),
- LocationStrategy: cloudflare.F(cloudflare.LoadBalancerEditParamsLocationStrategy{
- Mode: cloudflare.F(cloudflare.LoadBalancerEditParamsLocationStrategyModeResolverIP),
- PreferEcs: cloudflare.F(cloudflare.LoadBalancerEditParamsLocationStrategyPreferEcsAlways),
- }),
- Name: cloudflare.F("www.example.com"),
- PopPools: cloudflare.F[any](map[string]interface{}{
- "LAX": map[string]interface{}{
- "0": "de90f38ced07c2e2f4df50b1f61d4194",
- "1": "9290f38c5d07c2e2f4df57b1f61d4196",
- },
- "LHR": map[string]interface{}{
- "0": "abd90f38ced07c2e2f4df50b1f61d4194",
- "1": "f9138c5d07c2e2f4df57b1f61d4196",
- },
- "SJC": map[string]interface{}{
- "0": "00920f38ce07c2e2f4df50b1f61d4194",
- },
- }),
- Proxied: cloudflare.F(true),
- RandomSteering: cloudflare.F(cloudflare.LoadBalancerEditParamsRandomSteering{
- DefaultWeight: cloudflare.F(0.200000),
- PoolWeights: cloudflare.F[any](map[string]interface{}{
- "9290f38c5d07c2e2f4df57b1f61d4196": 0.500000,
- "de90f38ced07c2e2f4df50b1f61d4194": 0.300000,
- }),
- }),
- RegionPools: cloudflare.F[any](map[string]interface{}{
- "ENAM": map[string]interface{}{
- "0": "00920f38ce07c2e2f4df50b1f61d4194",
- },
- "WNAM": map[string]interface{}{
- "0": "de90f38ced07c2e2f4df50b1f61d4194",
- "1": "9290f38c5d07c2e2f4df57b1f61d4196",
- },
- }),
- Rules: cloudflare.F([]cloudflare.LoadBalancerEditParamsRule{{
- Condition: cloudflare.F("http.request.uri.path contains \"/testing\""),
- Disabled: cloudflare.F(true),
- FixedResponse: cloudflare.F(cloudflare.LoadBalancerEditParamsRulesFixedResponse{
- ContentType: cloudflare.F("application/json"),
- Location: cloudflare.F("www.example.com"),
- MessageBody: cloudflare.F("Testing Hello"),
- StatusCode: cloudflare.F(int64(0)),
- }),
- Name: cloudflare.F("route the path /testing to testing datacenter."),
- Overrides: cloudflare.F(cloudflare.LoadBalancerEditParamsRulesOverrides{
- AdaptiveRouting: cloudflare.F(cloudflare.LoadBalancerEditParamsRulesOverridesAdaptiveRouting{
- FailoverAcrossPools: cloudflare.F(true),
- }),
- CountryPools: cloudflare.F[any](map[string]interface{}{
- "GB": map[string]interface{}{
- "0": "abd90f38ced07c2e2f4df50b1f61d4194",
- },
- "US": map[string]interface{}{
- "0": "de90f38ced07c2e2f4df50b1f61d4194",
- "1": "00920f38ce07c2e2f4df50b1f61d4194",
- },
- }),
- DefaultPools: cloudflare.F([]string{"17b5962d775c646f3f9725cbc7a53df4", "9290f38c5d07c2e2f4df57b1f61d4196", "00920f38ce07c2e2f4df50b1f61d4194"}),
- FallbackPool: cloudflare.F[any](map[string]interface{}{}),
- LocationStrategy: cloudflare.F(cloudflare.LoadBalancerEditParamsRulesOverridesLocationStrategy{
- Mode: cloudflare.F(cloudflare.LoadBalancerEditParamsRulesOverridesLocationStrategyModeResolverIP),
- PreferEcs: cloudflare.F(cloudflare.LoadBalancerEditParamsRulesOverridesLocationStrategyPreferEcsAlways),
- }),
- PopPools: cloudflare.F[any](map[string]interface{}{
- "LAX": map[string]interface{}{
- "0": "de90f38ced07c2e2f4df50b1f61d4194",
- "1": "9290f38c5d07c2e2f4df57b1f61d4196",
- },
- "LHR": map[string]interface{}{
- "0": "abd90f38ced07c2e2f4df50b1f61d4194",
- "1": "f9138c5d07c2e2f4df57b1f61d4196",
- },
- "SJC": map[string]interface{}{
- "0": "00920f38ce07c2e2f4df50b1f61d4194",
- },
- }),
- RandomSteering: cloudflare.F(cloudflare.LoadBalancerEditParamsRulesOverridesRandomSteering{
- DefaultWeight: cloudflare.F(0.200000),
- PoolWeights: cloudflare.F[any](map[string]interface{}{
- "9290f38c5d07c2e2f4df57b1f61d4196": 0.500000,
- "de90f38ced07c2e2f4df50b1f61d4194": 0.300000,
- }),
- }),
- RegionPools: cloudflare.F[any](map[string]interface{}{
- "ENAM": map[string]interface{}{
- "0": "00920f38ce07c2e2f4df50b1f61d4194",
- },
- "WNAM": map[string]interface{}{
- "0": "de90f38ced07c2e2f4df50b1f61d4194",
- "1": "9290f38c5d07c2e2f4df57b1f61d4196",
- },
- }),
- SessionAffinity: cloudflare.F(cloudflare.LoadBalancerEditParamsRulesOverridesSessionAffinityCookie),
- SessionAffinityAttributes: cloudflare.F(cloudflare.LoadBalancerEditParamsRulesOverridesSessionAffinityAttributes{
- DrainDuration: cloudflare.F(100.000000),
- Headers: cloudflare.F([]string{"x"}),
- RequireAllHeaders: cloudflare.F(true),
- Samesite: cloudflare.F(cloudflare.LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesSamesiteAuto),
- Secure: cloudflare.F(cloudflare.LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesSecureAuto),
- ZeroDowntimeFailover: cloudflare.F(cloudflare.LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailoverSticky),
- }),
- SessionAffinityTTL: cloudflare.F(1800.000000),
- SteeringPolicy: cloudflare.F(cloudflare.LoadBalancerEditParamsRulesOverridesSteeringPolicyDynamicLatency),
- TTL: cloudflare.F(30.000000),
- }),
- Priority: cloudflare.F(int64(0)),
- Terminates: cloudflare.F(true),
- }, {
- Condition: cloudflare.F("http.request.uri.path contains \"/testing\""),
- Disabled: cloudflare.F(true),
- FixedResponse: cloudflare.F(cloudflare.LoadBalancerEditParamsRulesFixedResponse{
- ContentType: cloudflare.F("application/json"),
- Location: cloudflare.F("www.example.com"),
- MessageBody: cloudflare.F("Testing Hello"),
- StatusCode: cloudflare.F(int64(0)),
- }),
- Name: cloudflare.F("route the path /testing to testing datacenter."),
- Overrides: cloudflare.F(cloudflare.LoadBalancerEditParamsRulesOverrides{
- AdaptiveRouting: cloudflare.F(cloudflare.LoadBalancerEditParamsRulesOverridesAdaptiveRouting{
- FailoverAcrossPools: cloudflare.F(true),
- }),
- CountryPools: cloudflare.F[any](map[string]interface{}{
- "GB": map[string]interface{}{
- "0": "abd90f38ced07c2e2f4df50b1f61d4194",
- },
- "US": map[string]interface{}{
- "0": "de90f38ced07c2e2f4df50b1f61d4194",
- "1": "00920f38ce07c2e2f4df50b1f61d4194",
- },
- }),
- DefaultPools: cloudflare.F([]string{"17b5962d775c646f3f9725cbc7a53df4", "9290f38c5d07c2e2f4df57b1f61d4196", "00920f38ce07c2e2f4df50b1f61d4194"}),
- FallbackPool: cloudflare.F[any](map[string]interface{}{}),
- LocationStrategy: cloudflare.F(cloudflare.LoadBalancerEditParamsRulesOverridesLocationStrategy{
- Mode: cloudflare.F(cloudflare.LoadBalancerEditParamsRulesOverridesLocationStrategyModeResolverIP),
- PreferEcs: cloudflare.F(cloudflare.LoadBalancerEditParamsRulesOverridesLocationStrategyPreferEcsAlways),
- }),
- PopPools: cloudflare.F[any](map[string]interface{}{
- "LAX": map[string]interface{}{
- "0": "de90f38ced07c2e2f4df50b1f61d4194",
- "1": "9290f38c5d07c2e2f4df57b1f61d4196",
- },
- "LHR": map[string]interface{}{
- "0": "abd90f38ced07c2e2f4df50b1f61d4194",
- "1": "f9138c5d07c2e2f4df57b1f61d4196",
- },
- "SJC": map[string]interface{}{
- "0": "00920f38ce07c2e2f4df50b1f61d4194",
- },
- }),
- RandomSteering: cloudflare.F(cloudflare.LoadBalancerEditParamsRulesOverridesRandomSteering{
- DefaultWeight: cloudflare.F(0.200000),
- PoolWeights: cloudflare.F[any](map[string]interface{}{
- "9290f38c5d07c2e2f4df57b1f61d4196": 0.500000,
- "de90f38ced07c2e2f4df50b1f61d4194": 0.300000,
- }),
- }),
- RegionPools: cloudflare.F[any](map[string]interface{}{
- "ENAM": map[string]interface{}{
- "0": "00920f38ce07c2e2f4df50b1f61d4194",
- },
- "WNAM": map[string]interface{}{
- "0": "de90f38ced07c2e2f4df50b1f61d4194",
- "1": "9290f38c5d07c2e2f4df57b1f61d4196",
- },
- }),
- SessionAffinity: cloudflare.F(cloudflare.LoadBalancerEditParamsRulesOverridesSessionAffinityCookie),
- SessionAffinityAttributes: cloudflare.F(cloudflare.LoadBalancerEditParamsRulesOverridesSessionAffinityAttributes{
- DrainDuration: cloudflare.F(100.000000),
- Headers: cloudflare.F([]string{"x"}),
- RequireAllHeaders: cloudflare.F(true),
- Samesite: cloudflare.F(cloudflare.LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesSamesiteAuto),
- Secure: cloudflare.F(cloudflare.LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesSecureAuto),
- ZeroDowntimeFailover: cloudflare.F(cloudflare.LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailoverSticky),
- }),
- SessionAffinityTTL: cloudflare.F(1800.000000),
- SteeringPolicy: cloudflare.F(cloudflare.LoadBalancerEditParamsRulesOverridesSteeringPolicyDynamicLatency),
- TTL: cloudflare.F(30.000000),
- }),
- Priority: cloudflare.F(int64(0)),
- Terminates: cloudflare.F(true),
- }, {
- Condition: cloudflare.F("http.request.uri.path contains \"/testing\""),
- Disabled: cloudflare.F(true),
- FixedResponse: cloudflare.F(cloudflare.LoadBalancerEditParamsRulesFixedResponse{
- ContentType: cloudflare.F("application/json"),
- Location: cloudflare.F("www.example.com"),
- MessageBody: cloudflare.F("Testing Hello"),
- StatusCode: cloudflare.F(int64(0)),
- }),
- Name: cloudflare.F("route the path /testing to testing datacenter."),
- Overrides: cloudflare.F(cloudflare.LoadBalancerEditParamsRulesOverrides{
- AdaptiveRouting: cloudflare.F(cloudflare.LoadBalancerEditParamsRulesOverridesAdaptiveRouting{
- FailoverAcrossPools: cloudflare.F(true),
- }),
- CountryPools: cloudflare.F[any](map[string]interface{}{
- "GB": map[string]interface{}{
- "0": "abd90f38ced07c2e2f4df50b1f61d4194",
- },
- "US": map[string]interface{}{
- "0": "de90f38ced07c2e2f4df50b1f61d4194",
- "1": "00920f38ce07c2e2f4df50b1f61d4194",
- },
- }),
- DefaultPools: cloudflare.F([]string{"17b5962d775c646f3f9725cbc7a53df4", "9290f38c5d07c2e2f4df57b1f61d4196", "00920f38ce07c2e2f4df50b1f61d4194"}),
- FallbackPool: cloudflare.F[any](map[string]interface{}{}),
- LocationStrategy: cloudflare.F(cloudflare.LoadBalancerEditParamsRulesOverridesLocationStrategy{
- Mode: cloudflare.F(cloudflare.LoadBalancerEditParamsRulesOverridesLocationStrategyModeResolverIP),
- PreferEcs: cloudflare.F(cloudflare.LoadBalancerEditParamsRulesOverridesLocationStrategyPreferEcsAlways),
- }),
- PopPools: cloudflare.F[any](map[string]interface{}{
- "LAX": map[string]interface{}{
- "0": "de90f38ced07c2e2f4df50b1f61d4194",
- "1": "9290f38c5d07c2e2f4df57b1f61d4196",
- },
- "LHR": map[string]interface{}{
- "0": "abd90f38ced07c2e2f4df50b1f61d4194",
- "1": "f9138c5d07c2e2f4df57b1f61d4196",
- },
- "SJC": map[string]interface{}{
- "0": "00920f38ce07c2e2f4df50b1f61d4194",
- },
- }),
- RandomSteering: cloudflare.F(cloudflare.LoadBalancerEditParamsRulesOverridesRandomSteering{
- DefaultWeight: cloudflare.F(0.200000),
- PoolWeights: cloudflare.F[any](map[string]interface{}{
- "9290f38c5d07c2e2f4df57b1f61d4196": 0.500000,
- "de90f38ced07c2e2f4df50b1f61d4194": 0.300000,
- }),
- }),
- RegionPools: cloudflare.F[any](map[string]interface{}{
- "ENAM": map[string]interface{}{
- "0": "00920f38ce07c2e2f4df50b1f61d4194",
- },
- "WNAM": map[string]interface{}{
- "0": "de90f38ced07c2e2f4df50b1f61d4194",
- "1": "9290f38c5d07c2e2f4df57b1f61d4196",
- },
- }),
- SessionAffinity: cloudflare.F(cloudflare.LoadBalancerEditParamsRulesOverridesSessionAffinityCookie),
- SessionAffinityAttributes: cloudflare.F(cloudflare.LoadBalancerEditParamsRulesOverridesSessionAffinityAttributes{
- DrainDuration: cloudflare.F(100.000000),
- Headers: cloudflare.F([]string{"x"}),
- RequireAllHeaders: cloudflare.F(true),
- Samesite: cloudflare.F(cloudflare.LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesSamesiteAuto),
- Secure: cloudflare.F(cloudflare.LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesSecureAuto),
- ZeroDowntimeFailover: cloudflare.F(cloudflare.LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailoverSticky),
- }),
- SessionAffinityTTL: cloudflare.F(1800.000000),
- SteeringPolicy: cloudflare.F(cloudflare.LoadBalancerEditParamsRulesOverridesSteeringPolicyDynamicLatency),
- TTL: cloudflare.F(30.000000),
- }),
- Priority: cloudflare.F(int64(0)),
- Terminates: cloudflare.F(true),
- }}),
- SessionAffinity: cloudflare.F(cloudflare.LoadBalancerEditParamsSessionAffinityCookie),
- SessionAffinityAttributes: cloudflare.F(cloudflare.LoadBalancerEditParamsSessionAffinityAttributes{
- DrainDuration: cloudflare.F(100.000000),
- Headers: cloudflare.F([]string{"x"}),
- RequireAllHeaders: cloudflare.F(true),
- Samesite: cloudflare.F(cloudflare.LoadBalancerEditParamsSessionAffinityAttributesSamesiteAuto),
- Secure: cloudflare.F(cloudflare.LoadBalancerEditParamsSessionAffinityAttributesSecureAuto),
- ZeroDowntimeFailover: cloudflare.F(cloudflare.LoadBalancerEditParamsSessionAffinityAttributesZeroDowntimeFailoverSticky),
- }),
- SessionAffinityTTL: cloudflare.F(1800.000000),
- SteeringPolicy: cloudflare.F(cloudflare.LoadBalancerEditParamsSteeringPolicyDynamicLatency),
- TTL: cloudflare.F(30.000000),
- },
- )
- 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())
- }
-}
-
-func TestLoadBalancerGet(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"),
- )
- _, err := client.LoadBalancers.Get(
- context.TODO(),
- "699d98642c564d2e855e9661899b7252",
- cloudflare.LoadBalancerGetParams{
- ZoneID: cloudflare.F("699d98642c564d2e855e9661899b7252"),
- },
- )
- 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/loadbalancermonitor.go b/loadbalancermonitor.go
deleted file mode 100644
index 938529223a8..00000000000
--- a/loadbalancermonitor.go
+++ /dev/null
@@ -1,1398 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// LoadBalancerMonitorService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewLoadBalancerMonitorService]
-// method instead.
-type LoadBalancerMonitorService struct {
- Options []option.RequestOption
- Previews *LoadBalancerMonitorPreviewService
- References *LoadBalancerMonitorReferenceService
-}
-
-// NewLoadBalancerMonitorService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewLoadBalancerMonitorService(opts ...option.RequestOption) (r *LoadBalancerMonitorService) {
- r = &LoadBalancerMonitorService{}
- r.Options = opts
- r.Previews = NewLoadBalancerMonitorPreviewService(opts...)
- r.References = NewLoadBalancerMonitorReferenceService(opts...)
- return
-}
-
-// Create a configured monitor.
-func (r *LoadBalancerMonitorService) New(ctx context.Context, params LoadBalancerMonitorNewParams, opts ...option.RequestOption) (res *LoadBalancerMonitorNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env LoadBalancerMonitorNewResponseEnvelope
- path := fmt.Sprintf("accounts/%s/load_balancers/monitors", params.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Modify a configured monitor.
-func (r *LoadBalancerMonitorService) Update(ctx context.Context, monitorID string, params LoadBalancerMonitorUpdateParams, opts ...option.RequestOption) (res *LoadBalancerMonitorUpdateResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env LoadBalancerMonitorUpdateResponseEnvelope
- path := fmt.Sprintf("accounts/%s/load_balancers/monitors/%s", params.AccountID, monitorID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// List configured monitors for an account.
-func (r *LoadBalancerMonitorService) List(ctx context.Context, query LoadBalancerMonitorListParams, opts ...option.RequestOption) (res *[]LoadBalancerMonitorListResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env LoadBalancerMonitorListResponseEnvelope
- path := fmt.Sprintf("accounts/%s/load_balancers/monitors", query.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Delete a configured monitor.
-func (r *LoadBalancerMonitorService) Delete(ctx context.Context, monitorID string, body LoadBalancerMonitorDeleteParams, opts ...option.RequestOption) (res *LoadBalancerMonitorDeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env LoadBalancerMonitorDeleteResponseEnvelope
- path := fmt.Sprintf("accounts/%s/load_balancers/monitors/%s", body.AccountID, monitorID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Apply changes to an existing monitor, overwriting the supplied properties.
-func (r *LoadBalancerMonitorService) Edit(ctx context.Context, monitorID string, params LoadBalancerMonitorEditParams, opts ...option.RequestOption) (res *LoadBalancerMonitorEditResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env LoadBalancerMonitorEditResponseEnvelope
- path := fmt.Sprintf("accounts/%s/load_balancers/monitors/%s", params.AccountID, monitorID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// List a single configured monitor for an account.
-func (r *LoadBalancerMonitorService) Get(ctx context.Context, monitorID string, query LoadBalancerMonitorGetParams, opts ...option.RequestOption) (res *LoadBalancerMonitorGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env LoadBalancerMonitorGetResponseEnvelope
- path := fmt.Sprintf("accounts/%s/load_balancers/monitors/%s", query.AccountID, monitorID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type LoadBalancerMonitorNewResponse struct {
- ID string `json:"id"`
- // Do not validate the certificate when monitor use HTTPS. This parameter is
- // currently only valid for HTTP and HTTPS monitors.
- AllowInsecure bool `json:"allow_insecure"`
- // To be marked unhealthy the monitored origin must fail this healthcheck N
- // consecutive times.
- ConsecutiveDown int64 `json:"consecutive_down"`
- // To be marked healthy the monitored origin must pass this healthcheck N
- // consecutive times.
- ConsecutiveUp int64 `json:"consecutive_up"`
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Object description.
- Description string `json:"description"`
- // A case-insensitive sub-string to look for in the response body. If this string
- // is not found, the origin will be marked as unhealthy. This parameter is only
- // valid for HTTP and HTTPS monitors.
- ExpectedBody string `json:"expected_body"`
- // The expected HTTP response code or code range of the health check. This
- // parameter is only valid for HTTP and HTTPS monitors.
- ExpectedCodes string `json:"expected_codes"`
- // Follow redirects if returned by the origin. This parameter is only valid for
- // HTTP and HTTPS monitors.
- FollowRedirects bool `json:"follow_redirects"`
- // The HTTP request headers to send in the health check. It is recommended you set
- // a Host header by default. The User-Agent header cannot be overridden. This
- // parameter is only valid for HTTP and HTTPS monitors.
- Header interface{} `json:"header"`
- // The interval between each health check. Shorter intervals may improve failover
- // time, but will increase load on the origins as we check from multiple locations.
- Interval int64 `json:"interval"`
- // The method to use for the health check. This defaults to 'GET' for HTTP/HTTPS
- // based checks and 'connection_established' for TCP based health checks.
- Method string `json:"method"`
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // The endpoint path you want to conduct a health check against. This parameter is
- // only valid for HTTP and HTTPS monitors.
- Path string `json:"path"`
- // The port number to connect to for the health check. Required for TCP, UDP, and
- // SMTP checks. HTTP and HTTPS checks should only define the port when using a
- // non-standard port (HTTP: default 80, HTTPS: default 443).
- Port int64 `json:"port"`
- // Assign this monitor to emulate the specified zone while probing. This parameter
- // is only valid for HTTP and HTTPS monitors.
- ProbeZone string `json:"probe_zone"`
- // The number of retries to attempt in case of a timeout before marking the origin
- // as unhealthy. Retries are attempted immediately.
- Retries int64 `json:"retries"`
- // The timeout (in seconds) before marking the health check as failed.
- Timeout int64 `json:"timeout"`
- // The protocol to use for the health check. Currently supported protocols are
- // 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.
- Type LoadBalancerMonitorNewResponseType `json:"type"`
- JSON loadBalancerMonitorNewResponseJSON `json:"-"`
-}
-
-// loadBalancerMonitorNewResponseJSON contains the JSON metadata for the struct
-// [LoadBalancerMonitorNewResponse]
-type loadBalancerMonitorNewResponseJSON struct {
- ID apijson.Field
- AllowInsecure apijson.Field
- ConsecutiveDown apijson.Field
- ConsecutiveUp apijson.Field
- CreatedOn apijson.Field
- Description apijson.Field
- ExpectedBody apijson.Field
- ExpectedCodes apijson.Field
- FollowRedirects apijson.Field
- Header apijson.Field
- Interval apijson.Field
- Method apijson.Field
- ModifiedOn apijson.Field
- Path apijson.Field
- Port apijson.Field
- ProbeZone apijson.Field
- Retries apijson.Field
- Timeout apijson.Field
- Type apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerMonitorNewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerMonitorNewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// The protocol to use for the health check. Currently supported protocols are
-// 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.
-type LoadBalancerMonitorNewResponseType string
-
-const (
- LoadBalancerMonitorNewResponseTypeHTTP LoadBalancerMonitorNewResponseType = "http"
- LoadBalancerMonitorNewResponseTypeHTTPS LoadBalancerMonitorNewResponseType = "https"
- LoadBalancerMonitorNewResponseTypeTcp LoadBalancerMonitorNewResponseType = "tcp"
- LoadBalancerMonitorNewResponseTypeUdpIcmp LoadBalancerMonitorNewResponseType = "udp_icmp"
- LoadBalancerMonitorNewResponseTypeIcmpPing LoadBalancerMonitorNewResponseType = "icmp_ping"
- LoadBalancerMonitorNewResponseTypeSmtp LoadBalancerMonitorNewResponseType = "smtp"
-)
-
-type LoadBalancerMonitorUpdateResponse struct {
- ID string `json:"id"`
- // Do not validate the certificate when monitor use HTTPS. This parameter is
- // currently only valid for HTTP and HTTPS monitors.
- AllowInsecure bool `json:"allow_insecure"`
- // To be marked unhealthy the monitored origin must fail this healthcheck N
- // consecutive times.
- ConsecutiveDown int64 `json:"consecutive_down"`
- // To be marked healthy the monitored origin must pass this healthcheck N
- // consecutive times.
- ConsecutiveUp int64 `json:"consecutive_up"`
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Object description.
- Description string `json:"description"`
- // A case-insensitive sub-string to look for in the response body. If this string
- // is not found, the origin will be marked as unhealthy. This parameter is only
- // valid for HTTP and HTTPS monitors.
- ExpectedBody string `json:"expected_body"`
- // The expected HTTP response code or code range of the health check. This
- // parameter is only valid for HTTP and HTTPS monitors.
- ExpectedCodes string `json:"expected_codes"`
- // Follow redirects if returned by the origin. This parameter is only valid for
- // HTTP and HTTPS monitors.
- FollowRedirects bool `json:"follow_redirects"`
- // The HTTP request headers to send in the health check. It is recommended you set
- // a Host header by default. The User-Agent header cannot be overridden. This
- // parameter is only valid for HTTP and HTTPS monitors.
- Header interface{} `json:"header"`
- // The interval between each health check. Shorter intervals may improve failover
- // time, but will increase load on the origins as we check from multiple locations.
- Interval int64 `json:"interval"`
- // The method to use for the health check. This defaults to 'GET' for HTTP/HTTPS
- // based checks and 'connection_established' for TCP based health checks.
- Method string `json:"method"`
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // The endpoint path you want to conduct a health check against. This parameter is
- // only valid for HTTP and HTTPS monitors.
- Path string `json:"path"`
- // The port number to connect to for the health check. Required for TCP, UDP, and
- // SMTP checks. HTTP and HTTPS checks should only define the port when using a
- // non-standard port (HTTP: default 80, HTTPS: default 443).
- Port int64 `json:"port"`
- // Assign this monitor to emulate the specified zone while probing. This parameter
- // is only valid for HTTP and HTTPS monitors.
- ProbeZone string `json:"probe_zone"`
- // The number of retries to attempt in case of a timeout before marking the origin
- // as unhealthy. Retries are attempted immediately.
- Retries int64 `json:"retries"`
- // The timeout (in seconds) before marking the health check as failed.
- Timeout int64 `json:"timeout"`
- // The protocol to use for the health check. Currently supported protocols are
- // 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.
- Type LoadBalancerMonitorUpdateResponseType `json:"type"`
- JSON loadBalancerMonitorUpdateResponseJSON `json:"-"`
-}
-
-// loadBalancerMonitorUpdateResponseJSON contains the JSON metadata for the struct
-// [LoadBalancerMonitorUpdateResponse]
-type loadBalancerMonitorUpdateResponseJSON struct {
- ID apijson.Field
- AllowInsecure apijson.Field
- ConsecutiveDown apijson.Field
- ConsecutiveUp apijson.Field
- CreatedOn apijson.Field
- Description apijson.Field
- ExpectedBody apijson.Field
- ExpectedCodes apijson.Field
- FollowRedirects apijson.Field
- Header apijson.Field
- Interval apijson.Field
- Method apijson.Field
- ModifiedOn apijson.Field
- Path apijson.Field
- Port apijson.Field
- ProbeZone apijson.Field
- Retries apijson.Field
- Timeout apijson.Field
- Type apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerMonitorUpdateResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerMonitorUpdateResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// The protocol to use for the health check. Currently supported protocols are
-// 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.
-type LoadBalancerMonitorUpdateResponseType string
-
-const (
- LoadBalancerMonitorUpdateResponseTypeHTTP LoadBalancerMonitorUpdateResponseType = "http"
- LoadBalancerMonitorUpdateResponseTypeHTTPS LoadBalancerMonitorUpdateResponseType = "https"
- LoadBalancerMonitorUpdateResponseTypeTcp LoadBalancerMonitorUpdateResponseType = "tcp"
- LoadBalancerMonitorUpdateResponseTypeUdpIcmp LoadBalancerMonitorUpdateResponseType = "udp_icmp"
- LoadBalancerMonitorUpdateResponseTypeIcmpPing LoadBalancerMonitorUpdateResponseType = "icmp_ping"
- LoadBalancerMonitorUpdateResponseTypeSmtp LoadBalancerMonitorUpdateResponseType = "smtp"
-)
-
-type LoadBalancerMonitorListResponse struct {
- ID string `json:"id"`
- // Do not validate the certificate when monitor use HTTPS. This parameter is
- // currently only valid for HTTP and HTTPS monitors.
- AllowInsecure bool `json:"allow_insecure"`
- // To be marked unhealthy the monitored origin must fail this healthcheck N
- // consecutive times.
- ConsecutiveDown int64 `json:"consecutive_down"`
- // To be marked healthy the monitored origin must pass this healthcheck N
- // consecutive times.
- ConsecutiveUp int64 `json:"consecutive_up"`
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Object description.
- Description string `json:"description"`
- // A case-insensitive sub-string to look for in the response body. If this string
- // is not found, the origin will be marked as unhealthy. This parameter is only
- // valid for HTTP and HTTPS monitors.
- ExpectedBody string `json:"expected_body"`
- // The expected HTTP response code or code range of the health check. This
- // parameter is only valid for HTTP and HTTPS monitors.
- ExpectedCodes string `json:"expected_codes"`
- // Follow redirects if returned by the origin. This parameter is only valid for
- // HTTP and HTTPS monitors.
- FollowRedirects bool `json:"follow_redirects"`
- // The HTTP request headers to send in the health check. It is recommended you set
- // a Host header by default. The User-Agent header cannot be overridden. This
- // parameter is only valid for HTTP and HTTPS monitors.
- Header interface{} `json:"header"`
- // The interval between each health check. Shorter intervals may improve failover
- // time, but will increase load on the origins as we check from multiple locations.
- Interval int64 `json:"interval"`
- // The method to use for the health check. This defaults to 'GET' for HTTP/HTTPS
- // based checks and 'connection_established' for TCP based health checks.
- Method string `json:"method"`
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // The endpoint path you want to conduct a health check against. This parameter is
- // only valid for HTTP and HTTPS monitors.
- Path string `json:"path"`
- // The port number to connect to for the health check. Required for TCP, UDP, and
- // SMTP checks. HTTP and HTTPS checks should only define the port when using a
- // non-standard port (HTTP: default 80, HTTPS: default 443).
- Port int64 `json:"port"`
- // Assign this monitor to emulate the specified zone while probing. This parameter
- // is only valid for HTTP and HTTPS monitors.
- ProbeZone string `json:"probe_zone"`
- // The number of retries to attempt in case of a timeout before marking the origin
- // as unhealthy. Retries are attempted immediately.
- Retries int64 `json:"retries"`
- // The timeout (in seconds) before marking the health check as failed.
- Timeout int64 `json:"timeout"`
- // The protocol to use for the health check. Currently supported protocols are
- // 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.
- Type LoadBalancerMonitorListResponseType `json:"type"`
- JSON loadBalancerMonitorListResponseJSON `json:"-"`
-}
-
-// loadBalancerMonitorListResponseJSON contains the JSON metadata for the struct
-// [LoadBalancerMonitorListResponse]
-type loadBalancerMonitorListResponseJSON struct {
- ID apijson.Field
- AllowInsecure apijson.Field
- ConsecutiveDown apijson.Field
- ConsecutiveUp apijson.Field
- CreatedOn apijson.Field
- Description apijson.Field
- ExpectedBody apijson.Field
- ExpectedCodes apijson.Field
- FollowRedirects apijson.Field
- Header apijson.Field
- Interval apijson.Field
- Method apijson.Field
- ModifiedOn apijson.Field
- Path apijson.Field
- Port apijson.Field
- ProbeZone apijson.Field
- Retries apijson.Field
- Timeout apijson.Field
- Type apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerMonitorListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerMonitorListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// The protocol to use for the health check. Currently supported protocols are
-// 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.
-type LoadBalancerMonitorListResponseType string
-
-const (
- LoadBalancerMonitorListResponseTypeHTTP LoadBalancerMonitorListResponseType = "http"
- LoadBalancerMonitorListResponseTypeHTTPS LoadBalancerMonitorListResponseType = "https"
- LoadBalancerMonitorListResponseTypeTcp LoadBalancerMonitorListResponseType = "tcp"
- LoadBalancerMonitorListResponseTypeUdpIcmp LoadBalancerMonitorListResponseType = "udp_icmp"
- LoadBalancerMonitorListResponseTypeIcmpPing LoadBalancerMonitorListResponseType = "icmp_ping"
- LoadBalancerMonitorListResponseTypeSmtp LoadBalancerMonitorListResponseType = "smtp"
-)
-
-type LoadBalancerMonitorDeleteResponse struct {
- ID string `json:"id"`
- JSON loadBalancerMonitorDeleteResponseJSON `json:"-"`
-}
-
-// loadBalancerMonitorDeleteResponseJSON contains the JSON metadata for the struct
-// [LoadBalancerMonitorDeleteResponse]
-type loadBalancerMonitorDeleteResponseJSON struct {
- ID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerMonitorDeleteResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerMonitorDeleteResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type LoadBalancerMonitorEditResponse struct {
- ID string `json:"id"`
- // Do not validate the certificate when monitor use HTTPS. This parameter is
- // currently only valid for HTTP and HTTPS monitors.
- AllowInsecure bool `json:"allow_insecure"`
- // To be marked unhealthy the monitored origin must fail this healthcheck N
- // consecutive times.
- ConsecutiveDown int64 `json:"consecutive_down"`
- // To be marked healthy the monitored origin must pass this healthcheck N
- // consecutive times.
- ConsecutiveUp int64 `json:"consecutive_up"`
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Object description.
- Description string `json:"description"`
- // A case-insensitive sub-string to look for in the response body. If this string
- // is not found, the origin will be marked as unhealthy. This parameter is only
- // valid for HTTP and HTTPS monitors.
- ExpectedBody string `json:"expected_body"`
- // The expected HTTP response code or code range of the health check. This
- // parameter is only valid for HTTP and HTTPS monitors.
- ExpectedCodes string `json:"expected_codes"`
- // Follow redirects if returned by the origin. This parameter is only valid for
- // HTTP and HTTPS monitors.
- FollowRedirects bool `json:"follow_redirects"`
- // The HTTP request headers to send in the health check. It is recommended you set
- // a Host header by default. The User-Agent header cannot be overridden. This
- // parameter is only valid for HTTP and HTTPS monitors.
- Header interface{} `json:"header"`
- // The interval between each health check. Shorter intervals may improve failover
- // time, but will increase load on the origins as we check from multiple locations.
- Interval int64 `json:"interval"`
- // The method to use for the health check. This defaults to 'GET' for HTTP/HTTPS
- // based checks and 'connection_established' for TCP based health checks.
- Method string `json:"method"`
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // The endpoint path you want to conduct a health check against. This parameter is
- // only valid for HTTP and HTTPS monitors.
- Path string `json:"path"`
- // The port number to connect to for the health check. Required for TCP, UDP, and
- // SMTP checks. HTTP and HTTPS checks should only define the port when using a
- // non-standard port (HTTP: default 80, HTTPS: default 443).
- Port int64 `json:"port"`
- // Assign this monitor to emulate the specified zone while probing. This parameter
- // is only valid for HTTP and HTTPS monitors.
- ProbeZone string `json:"probe_zone"`
- // The number of retries to attempt in case of a timeout before marking the origin
- // as unhealthy. Retries are attempted immediately.
- Retries int64 `json:"retries"`
- // The timeout (in seconds) before marking the health check as failed.
- Timeout int64 `json:"timeout"`
- // The protocol to use for the health check. Currently supported protocols are
- // 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.
- Type LoadBalancerMonitorEditResponseType `json:"type"`
- JSON loadBalancerMonitorEditResponseJSON `json:"-"`
-}
-
-// loadBalancerMonitorEditResponseJSON contains the JSON metadata for the struct
-// [LoadBalancerMonitorEditResponse]
-type loadBalancerMonitorEditResponseJSON struct {
- ID apijson.Field
- AllowInsecure apijson.Field
- ConsecutiveDown apijson.Field
- ConsecutiveUp apijson.Field
- CreatedOn apijson.Field
- Description apijson.Field
- ExpectedBody apijson.Field
- ExpectedCodes apijson.Field
- FollowRedirects apijson.Field
- Header apijson.Field
- Interval apijson.Field
- Method apijson.Field
- ModifiedOn apijson.Field
- Path apijson.Field
- Port apijson.Field
- ProbeZone apijson.Field
- Retries apijson.Field
- Timeout apijson.Field
- Type apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerMonitorEditResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerMonitorEditResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// The protocol to use for the health check. Currently supported protocols are
-// 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.
-type LoadBalancerMonitorEditResponseType string
-
-const (
- LoadBalancerMonitorEditResponseTypeHTTP LoadBalancerMonitorEditResponseType = "http"
- LoadBalancerMonitorEditResponseTypeHTTPS LoadBalancerMonitorEditResponseType = "https"
- LoadBalancerMonitorEditResponseTypeTcp LoadBalancerMonitorEditResponseType = "tcp"
- LoadBalancerMonitorEditResponseTypeUdpIcmp LoadBalancerMonitorEditResponseType = "udp_icmp"
- LoadBalancerMonitorEditResponseTypeIcmpPing LoadBalancerMonitorEditResponseType = "icmp_ping"
- LoadBalancerMonitorEditResponseTypeSmtp LoadBalancerMonitorEditResponseType = "smtp"
-)
-
-type LoadBalancerMonitorGetResponse struct {
- ID string `json:"id"`
- // Do not validate the certificate when monitor use HTTPS. This parameter is
- // currently only valid for HTTP and HTTPS monitors.
- AllowInsecure bool `json:"allow_insecure"`
- // To be marked unhealthy the monitored origin must fail this healthcheck N
- // consecutive times.
- ConsecutiveDown int64 `json:"consecutive_down"`
- // To be marked healthy the monitored origin must pass this healthcheck N
- // consecutive times.
- ConsecutiveUp int64 `json:"consecutive_up"`
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Object description.
- Description string `json:"description"`
- // A case-insensitive sub-string to look for in the response body. If this string
- // is not found, the origin will be marked as unhealthy. This parameter is only
- // valid for HTTP and HTTPS monitors.
- ExpectedBody string `json:"expected_body"`
- // The expected HTTP response code or code range of the health check. This
- // parameter is only valid for HTTP and HTTPS monitors.
- ExpectedCodes string `json:"expected_codes"`
- // Follow redirects if returned by the origin. This parameter is only valid for
- // HTTP and HTTPS monitors.
- FollowRedirects bool `json:"follow_redirects"`
- // The HTTP request headers to send in the health check. It is recommended you set
- // a Host header by default. The User-Agent header cannot be overridden. This
- // parameter is only valid for HTTP and HTTPS monitors.
- Header interface{} `json:"header"`
- // The interval between each health check. Shorter intervals may improve failover
- // time, but will increase load on the origins as we check from multiple locations.
- Interval int64 `json:"interval"`
- // The method to use for the health check. This defaults to 'GET' for HTTP/HTTPS
- // based checks and 'connection_established' for TCP based health checks.
- Method string `json:"method"`
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // The endpoint path you want to conduct a health check against. This parameter is
- // only valid for HTTP and HTTPS monitors.
- Path string `json:"path"`
- // The port number to connect to for the health check. Required for TCP, UDP, and
- // SMTP checks. HTTP and HTTPS checks should only define the port when using a
- // non-standard port (HTTP: default 80, HTTPS: default 443).
- Port int64 `json:"port"`
- // Assign this monitor to emulate the specified zone while probing. This parameter
- // is only valid for HTTP and HTTPS monitors.
- ProbeZone string `json:"probe_zone"`
- // The number of retries to attempt in case of a timeout before marking the origin
- // as unhealthy. Retries are attempted immediately.
- Retries int64 `json:"retries"`
- // The timeout (in seconds) before marking the health check as failed.
- Timeout int64 `json:"timeout"`
- // The protocol to use for the health check. Currently supported protocols are
- // 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.
- Type LoadBalancerMonitorGetResponseType `json:"type"`
- JSON loadBalancerMonitorGetResponseJSON `json:"-"`
-}
-
-// loadBalancerMonitorGetResponseJSON contains the JSON metadata for the struct
-// [LoadBalancerMonitorGetResponse]
-type loadBalancerMonitorGetResponseJSON struct {
- ID apijson.Field
- AllowInsecure apijson.Field
- ConsecutiveDown apijson.Field
- ConsecutiveUp apijson.Field
- CreatedOn apijson.Field
- Description apijson.Field
- ExpectedBody apijson.Field
- ExpectedCodes apijson.Field
- FollowRedirects apijson.Field
- Header apijson.Field
- Interval apijson.Field
- Method apijson.Field
- ModifiedOn apijson.Field
- Path apijson.Field
- Port apijson.Field
- ProbeZone apijson.Field
- Retries apijson.Field
- Timeout apijson.Field
- Type apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerMonitorGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerMonitorGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// The protocol to use for the health check. Currently supported protocols are
-// 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.
-type LoadBalancerMonitorGetResponseType string
-
-const (
- LoadBalancerMonitorGetResponseTypeHTTP LoadBalancerMonitorGetResponseType = "http"
- LoadBalancerMonitorGetResponseTypeHTTPS LoadBalancerMonitorGetResponseType = "https"
- LoadBalancerMonitorGetResponseTypeTcp LoadBalancerMonitorGetResponseType = "tcp"
- LoadBalancerMonitorGetResponseTypeUdpIcmp LoadBalancerMonitorGetResponseType = "udp_icmp"
- LoadBalancerMonitorGetResponseTypeIcmpPing LoadBalancerMonitorGetResponseType = "icmp_ping"
- LoadBalancerMonitorGetResponseTypeSmtp LoadBalancerMonitorGetResponseType = "smtp"
-)
-
-type LoadBalancerMonitorNewParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
- // The expected HTTP response code or code range of the health check. This
- // parameter is only valid for HTTP and HTTPS monitors.
- ExpectedCodes param.Field[string] `json:"expected_codes,required"`
- // Do not validate the certificate when monitor use HTTPS. This parameter is
- // currently only valid for HTTP and HTTPS monitors.
- AllowInsecure param.Field[bool] `json:"allow_insecure"`
- // To be marked unhealthy the monitored origin must fail this healthcheck N
- // consecutive times.
- ConsecutiveDown param.Field[int64] `json:"consecutive_down"`
- // To be marked healthy the monitored origin must pass this healthcheck N
- // consecutive times.
- ConsecutiveUp param.Field[int64] `json:"consecutive_up"`
- // Object description.
- Description param.Field[string] `json:"description"`
- // A case-insensitive sub-string to look for in the response body. If this string
- // is not found, the origin will be marked as unhealthy. This parameter is only
- // valid for HTTP and HTTPS monitors.
- ExpectedBody param.Field[string] `json:"expected_body"`
- // Follow redirects if returned by the origin. This parameter is only valid for
- // HTTP and HTTPS monitors.
- FollowRedirects param.Field[bool] `json:"follow_redirects"`
- // The HTTP request headers to send in the health check. It is recommended you set
- // a Host header by default. The User-Agent header cannot be overridden. This
- // parameter is only valid for HTTP and HTTPS monitors.
- Header param.Field[interface{}] `json:"header"`
- // The interval between each health check. Shorter intervals may improve failover
- // time, but will increase load on the origins as we check from multiple locations.
- Interval param.Field[int64] `json:"interval"`
- // The method to use for the health check. This defaults to 'GET' for HTTP/HTTPS
- // based checks and 'connection_established' for TCP based health checks.
- Method param.Field[string] `json:"method"`
- // The endpoint path you want to conduct a health check against. This parameter is
- // only valid for HTTP and HTTPS monitors.
- Path param.Field[string] `json:"path"`
- // The port number to connect to for the health check. Required for TCP, UDP, and
- // SMTP checks. HTTP and HTTPS checks should only define the port when using a
- // non-standard port (HTTP: default 80, HTTPS: default 443).
- Port param.Field[int64] `json:"port"`
- // Assign this monitor to emulate the specified zone while probing. This parameter
- // is only valid for HTTP and HTTPS monitors.
- ProbeZone param.Field[string] `json:"probe_zone"`
- // The number of retries to attempt in case of a timeout before marking the origin
- // as unhealthy. Retries are attempted immediately.
- Retries param.Field[int64] `json:"retries"`
- // The timeout (in seconds) before marking the health check as failed.
- Timeout param.Field[int64] `json:"timeout"`
- // The protocol to use for the health check. Currently supported protocols are
- // 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.
- Type param.Field[LoadBalancerMonitorNewParamsType] `json:"type"`
-}
-
-func (r LoadBalancerMonitorNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The protocol to use for the health check. Currently supported protocols are
-// 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.
-type LoadBalancerMonitorNewParamsType string
-
-const (
- LoadBalancerMonitorNewParamsTypeHTTP LoadBalancerMonitorNewParamsType = "http"
- LoadBalancerMonitorNewParamsTypeHTTPS LoadBalancerMonitorNewParamsType = "https"
- LoadBalancerMonitorNewParamsTypeTcp LoadBalancerMonitorNewParamsType = "tcp"
- LoadBalancerMonitorNewParamsTypeUdpIcmp LoadBalancerMonitorNewParamsType = "udp_icmp"
- LoadBalancerMonitorNewParamsTypeIcmpPing LoadBalancerMonitorNewParamsType = "icmp_ping"
- LoadBalancerMonitorNewParamsTypeSmtp LoadBalancerMonitorNewParamsType = "smtp"
-)
-
-type LoadBalancerMonitorNewResponseEnvelope struct {
- Errors []LoadBalancerMonitorNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []LoadBalancerMonitorNewResponseEnvelopeMessages `json:"messages,required"`
- Result LoadBalancerMonitorNewResponse `json:"result,required"`
- // Whether the API call was successful
- Success LoadBalancerMonitorNewResponseEnvelopeSuccess `json:"success,required"`
- JSON loadBalancerMonitorNewResponseEnvelopeJSON `json:"-"`
-}
-
-// loadBalancerMonitorNewResponseEnvelopeJSON contains the JSON metadata for the
-// struct [LoadBalancerMonitorNewResponseEnvelope]
-type loadBalancerMonitorNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerMonitorNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerMonitorNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type LoadBalancerMonitorNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON loadBalancerMonitorNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// loadBalancerMonitorNewResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [LoadBalancerMonitorNewResponseEnvelopeErrors]
-type loadBalancerMonitorNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerMonitorNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerMonitorNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type LoadBalancerMonitorNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON loadBalancerMonitorNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// loadBalancerMonitorNewResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [LoadBalancerMonitorNewResponseEnvelopeMessages]
-type loadBalancerMonitorNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerMonitorNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerMonitorNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type LoadBalancerMonitorNewResponseEnvelopeSuccess bool
-
-const (
- LoadBalancerMonitorNewResponseEnvelopeSuccessTrue LoadBalancerMonitorNewResponseEnvelopeSuccess = true
-)
-
-type LoadBalancerMonitorUpdateParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
- // The expected HTTP response code or code range of the health check. This
- // parameter is only valid for HTTP and HTTPS monitors.
- ExpectedCodes param.Field[string] `json:"expected_codes,required"`
- // Do not validate the certificate when monitor use HTTPS. This parameter is
- // currently only valid for HTTP and HTTPS monitors.
- AllowInsecure param.Field[bool] `json:"allow_insecure"`
- // To be marked unhealthy the monitored origin must fail this healthcheck N
- // consecutive times.
- ConsecutiveDown param.Field[int64] `json:"consecutive_down"`
- // To be marked healthy the monitored origin must pass this healthcheck N
- // consecutive times.
- ConsecutiveUp param.Field[int64] `json:"consecutive_up"`
- // Object description.
- Description param.Field[string] `json:"description"`
- // A case-insensitive sub-string to look for in the response body. If this string
- // is not found, the origin will be marked as unhealthy. This parameter is only
- // valid for HTTP and HTTPS monitors.
- ExpectedBody param.Field[string] `json:"expected_body"`
- // Follow redirects if returned by the origin. This parameter is only valid for
- // HTTP and HTTPS monitors.
- FollowRedirects param.Field[bool] `json:"follow_redirects"`
- // The HTTP request headers to send in the health check. It is recommended you set
- // a Host header by default. The User-Agent header cannot be overridden. This
- // parameter is only valid for HTTP and HTTPS monitors.
- Header param.Field[interface{}] `json:"header"`
- // The interval between each health check. Shorter intervals may improve failover
- // time, but will increase load on the origins as we check from multiple locations.
- Interval param.Field[int64] `json:"interval"`
- // The method to use for the health check. This defaults to 'GET' for HTTP/HTTPS
- // based checks and 'connection_established' for TCP based health checks.
- Method param.Field[string] `json:"method"`
- // The endpoint path you want to conduct a health check against. This parameter is
- // only valid for HTTP and HTTPS monitors.
- Path param.Field[string] `json:"path"`
- // The port number to connect to for the health check. Required for TCP, UDP, and
- // SMTP checks. HTTP and HTTPS checks should only define the port when using a
- // non-standard port (HTTP: default 80, HTTPS: default 443).
- Port param.Field[int64] `json:"port"`
- // Assign this monitor to emulate the specified zone while probing. This parameter
- // is only valid for HTTP and HTTPS monitors.
- ProbeZone param.Field[string] `json:"probe_zone"`
- // The number of retries to attempt in case of a timeout before marking the origin
- // as unhealthy. Retries are attempted immediately.
- Retries param.Field[int64] `json:"retries"`
- // The timeout (in seconds) before marking the health check as failed.
- Timeout param.Field[int64] `json:"timeout"`
- // The protocol to use for the health check. Currently supported protocols are
- // 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.
- Type param.Field[LoadBalancerMonitorUpdateParamsType] `json:"type"`
-}
-
-func (r LoadBalancerMonitorUpdateParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The protocol to use for the health check. Currently supported protocols are
-// 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.
-type LoadBalancerMonitorUpdateParamsType string
-
-const (
- LoadBalancerMonitorUpdateParamsTypeHTTP LoadBalancerMonitorUpdateParamsType = "http"
- LoadBalancerMonitorUpdateParamsTypeHTTPS LoadBalancerMonitorUpdateParamsType = "https"
- LoadBalancerMonitorUpdateParamsTypeTcp LoadBalancerMonitorUpdateParamsType = "tcp"
- LoadBalancerMonitorUpdateParamsTypeUdpIcmp LoadBalancerMonitorUpdateParamsType = "udp_icmp"
- LoadBalancerMonitorUpdateParamsTypeIcmpPing LoadBalancerMonitorUpdateParamsType = "icmp_ping"
- LoadBalancerMonitorUpdateParamsTypeSmtp LoadBalancerMonitorUpdateParamsType = "smtp"
-)
-
-type LoadBalancerMonitorUpdateResponseEnvelope struct {
- Errors []LoadBalancerMonitorUpdateResponseEnvelopeErrors `json:"errors,required"`
- Messages []LoadBalancerMonitorUpdateResponseEnvelopeMessages `json:"messages,required"`
- Result LoadBalancerMonitorUpdateResponse `json:"result,required"`
- // Whether the API call was successful
- Success LoadBalancerMonitorUpdateResponseEnvelopeSuccess `json:"success,required"`
- JSON loadBalancerMonitorUpdateResponseEnvelopeJSON `json:"-"`
-}
-
-// loadBalancerMonitorUpdateResponseEnvelopeJSON contains the JSON metadata for the
-// struct [LoadBalancerMonitorUpdateResponseEnvelope]
-type loadBalancerMonitorUpdateResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerMonitorUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerMonitorUpdateResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type LoadBalancerMonitorUpdateResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON loadBalancerMonitorUpdateResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// loadBalancerMonitorUpdateResponseEnvelopeErrorsJSON contains the JSON metadata
-// for the struct [LoadBalancerMonitorUpdateResponseEnvelopeErrors]
-type loadBalancerMonitorUpdateResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerMonitorUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerMonitorUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type LoadBalancerMonitorUpdateResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON loadBalancerMonitorUpdateResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// loadBalancerMonitorUpdateResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [LoadBalancerMonitorUpdateResponseEnvelopeMessages]
-type loadBalancerMonitorUpdateResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerMonitorUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerMonitorUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type LoadBalancerMonitorUpdateResponseEnvelopeSuccess bool
-
-const (
- LoadBalancerMonitorUpdateResponseEnvelopeSuccessTrue LoadBalancerMonitorUpdateResponseEnvelopeSuccess = true
-)
-
-type LoadBalancerMonitorListParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type LoadBalancerMonitorListResponseEnvelope struct {
- Errors []LoadBalancerMonitorListResponseEnvelopeErrors `json:"errors,required"`
- Messages []LoadBalancerMonitorListResponseEnvelopeMessages `json:"messages,required"`
- Result []LoadBalancerMonitorListResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success LoadBalancerMonitorListResponseEnvelopeSuccess `json:"success,required"`
- ResultInfo LoadBalancerMonitorListResponseEnvelopeResultInfo `json:"result_info"`
- JSON loadBalancerMonitorListResponseEnvelopeJSON `json:"-"`
-}
-
-// loadBalancerMonitorListResponseEnvelopeJSON contains the JSON metadata for the
-// struct [LoadBalancerMonitorListResponseEnvelope]
-type loadBalancerMonitorListResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- ResultInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerMonitorListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerMonitorListResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type LoadBalancerMonitorListResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON loadBalancerMonitorListResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// loadBalancerMonitorListResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [LoadBalancerMonitorListResponseEnvelopeErrors]
-type loadBalancerMonitorListResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerMonitorListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerMonitorListResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type LoadBalancerMonitorListResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON loadBalancerMonitorListResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// loadBalancerMonitorListResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [LoadBalancerMonitorListResponseEnvelopeMessages]
-type loadBalancerMonitorListResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerMonitorListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerMonitorListResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type LoadBalancerMonitorListResponseEnvelopeSuccess bool
-
-const (
- LoadBalancerMonitorListResponseEnvelopeSuccessTrue LoadBalancerMonitorListResponseEnvelopeSuccess = true
-)
-
-type LoadBalancerMonitorListResponseEnvelopeResultInfo struct {
- // Total number of results for the requested service
- Count float64 `json:"count"`
- // Current page within paginated list of results
- Page float64 `json:"page"`
- // Number of results per page of results
- PerPage float64 `json:"per_page"`
- // Total results available without any search parameters
- TotalCount float64 `json:"total_count"`
- JSON loadBalancerMonitorListResponseEnvelopeResultInfoJSON `json:"-"`
-}
-
-// loadBalancerMonitorListResponseEnvelopeResultInfoJSON contains the JSON metadata
-// for the struct [LoadBalancerMonitorListResponseEnvelopeResultInfo]
-type loadBalancerMonitorListResponseEnvelopeResultInfoJSON struct {
- Count apijson.Field
- Page apijson.Field
- PerPage apijson.Field
- TotalCount apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerMonitorListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerMonitorListResponseEnvelopeResultInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type LoadBalancerMonitorDeleteParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type LoadBalancerMonitorDeleteResponseEnvelope struct {
- Errors []LoadBalancerMonitorDeleteResponseEnvelopeErrors `json:"errors,required"`
- Messages []LoadBalancerMonitorDeleteResponseEnvelopeMessages `json:"messages,required"`
- Result LoadBalancerMonitorDeleteResponse `json:"result,required"`
- // Whether the API call was successful
- Success LoadBalancerMonitorDeleteResponseEnvelopeSuccess `json:"success,required"`
- JSON loadBalancerMonitorDeleteResponseEnvelopeJSON `json:"-"`
-}
-
-// loadBalancerMonitorDeleteResponseEnvelopeJSON contains the JSON metadata for the
-// struct [LoadBalancerMonitorDeleteResponseEnvelope]
-type loadBalancerMonitorDeleteResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerMonitorDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerMonitorDeleteResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type LoadBalancerMonitorDeleteResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON loadBalancerMonitorDeleteResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// loadBalancerMonitorDeleteResponseEnvelopeErrorsJSON contains the JSON metadata
-// for the struct [LoadBalancerMonitorDeleteResponseEnvelopeErrors]
-type loadBalancerMonitorDeleteResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerMonitorDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerMonitorDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type LoadBalancerMonitorDeleteResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON loadBalancerMonitorDeleteResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// loadBalancerMonitorDeleteResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [LoadBalancerMonitorDeleteResponseEnvelopeMessages]
-type loadBalancerMonitorDeleteResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerMonitorDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerMonitorDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type LoadBalancerMonitorDeleteResponseEnvelopeSuccess bool
-
-const (
- LoadBalancerMonitorDeleteResponseEnvelopeSuccessTrue LoadBalancerMonitorDeleteResponseEnvelopeSuccess = true
-)
-
-type LoadBalancerMonitorEditParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
- // The expected HTTP response code or code range of the health check. This
- // parameter is only valid for HTTP and HTTPS monitors.
- ExpectedCodes param.Field[string] `json:"expected_codes,required"`
- // Do not validate the certificate when monitor use HTTPS. This parameter is
- // currently only valid for HTTP and HTTPS monitors.
- AllowInsecure param.Field[bool] `json:"allow_insecure"`
- // To be marked unhealthy the monitored origin must fail this healthcheck N
- // consecutive times.
- ConsecutiveDown param.Field[int64] `json:"consecutive_down"`
- // To be marked healthy the monitored origin must pass this healthcheck N
- // consecutive times.
- ConsecutiveUp param.Field[int64] `json:"consecutive_up"`
- // Object description.
- Description param.Field[string] `json:"description"`
- // A case-insensitive sub-string to look for in the response body. If this string
- // is not found, the origin will be marked as unhealthy. This parameter is only
- // valid for HTTP and HTTPS monitors.
- ExpectedBody param.Field[string] `json:"expected_body"`
- // Follow redirects if returned by the origin. This parameter is only valid for
- // HTTP and HTTPS monitors.
- FollowRedirects param.Field[bool] `json:"follow_redirects"`
- // The HTTP request headers to send in the health check. It is recommended you set
- // a Host header by default. The User-Agent header cannot be overridden. This
- // parameter is only valid for HTTP and HTTPS monitors.
- Header param.Field[interface{}] `json:"header"`
- // The interval between each health check. Shorter intervals may improve failover
- // time, but will increase load on the origins as we check from multiple locations.
- Interval param.Field[int64] `json:"interval"`
- // The method to use for the health check. This defaults to 'GET' for HTTP/HTTPS
- // based checks and 'connection_established' for TCP based health checks.
- Method param.Field[string] `json:"method"`
- // The endpoint path you want to conduct a health check against. This parameter is
- // only valid for HTTP and HTTPS monitors.
- Path param.Field[string] `json:"path"`
- // The port number to connect to for the health check. Required for TCP, UDP, and
- // SMTP checks. HTTP and HTTPS checks should only define the port when using a
- // non-standard port (HTTP: default 80, HTTPS: default 443).
- Port param.Field[int64] `json:"port"`
- // Assign this monitor to emulate the specified zone while probing. This parameter
- // is only valid for HTTP and HTTPS monitors.
- ProbeZone param.Field[string] `json:"probe_zone"`
- // The number of retries to attempt in case of a timeout before marking the origin
- // as unhealthy. Retries are attempted immediately.
- Retries param.Field[int64] `json:"retries"`
- // The timeout (in seconds) before marking the health check as failed.
- Timeout param.Field[int64] `json:"timeout"`
- // The protocol to use for the health check. Currently supported protocols are
- // 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.
- Type param.Field[LoadBalancerMonitorEditParamsType] `json:"type"`
-}
-
-func (r LoadBalancerMonitorEditParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The protocol to use for the health check. Currently supported protocols are
-// 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.
-type LoadBalancerMonitorEditParamsType string
-
-const (
- LoadBalancerMonitorEditParamsTypeHTTP LoadBalancerMonitorEditParamsType = "http"
- LoadBalancerMonitorEditParamsTypeHTTPS LoadBalancerMonitorEditParamsType = "https"
- LoadBalancerMonitorEditParamsTypeTcp LoadBalancerMonitorEditParamsType = "tcp"
- LoadBalancerMonitorEditParamsTypeUdpIcmp LoadBalancerMonitorEditParamsType = "udp_icmp"
- LoadBalancerMonitorEditParamsTypeIcmpPing LoadBalancerMonitorEditParamsType = "icmp_ping"
- LoadBalancerMonitorEditParamsTypeSmtp LoadBalancerMonitorEditParamsType = "smtp"
-)
-
-type LoadBalancerMonitorEditResponseEnvelope struct {
- Errors []LoadBalancerMonitorEditResponseEnvelopeErrors `json:"errors,required"`
- Messages []LoadBalancerMonitorEditResponseEnvelopeMessages `json:"messages,required"`
- Result LoadBalancerMonitorEditResponse `json:"result,required"`
- // Whether the API call was successful
- Success LoadBalancerMonitorEditResponseEnvelopeSuccess `json:"success,required"`
- JSON loadBalancerMonitorEditResponseEnvelopeJSON `json:"-"`
-}
-
-// loadBalancerMonitorEditResponseEnvelopeJSON contains the JSON metadata for the
-// struct [LoadBalancerMonitorEditResponseEnvelope]
-type loadBalancerMonitorEditResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerMonitorEditResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerMonitorEditResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type LoadBalancerMonitorEditResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON loadBalancerMonitorEditResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// loadBalancerMonitorEditResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [LoadBalancerMonitorEditResponseEnvelopeErrors]
-type loadBalancerMonitorEditResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerMonitorEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerMonitorEditResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type LoadBalancerMonitorEditResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON loadBalancerMonitorEditResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// loadBalancerMonitorEditResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [LoadBalancerMonitorEditResponseEnvelopeMessages]
-type loadBalancerMonitorEditResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerMonitorEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerMonitorEditResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type LoadBalancerMonitorEditResponseEnvelopeSuccess bool
-
-const (
- LoadBalancerMonitorEditResponseEnvelopeSuccessTrue LoadBalancerMonitorEditResponseEnvelopeSuccess = true
-)
-
-type LoadBalancerMonitorGetParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type LoadBalancerMonitorGetResponseEnvelope struct {
- Errors []LoadBalancerMonitorGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []LoadBalancerMonitorGetResponseEnvelopeMessages `json:"messages,required"`
- Result LoadBalancerMonitorGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success LoadBalancerMonitorGetResponseEnvelopeSuccess `json:"success,required"`
- JSON loadBalancerMonitorGetResponseEnvelopeJSON `json:"-"`
-}
-
-// loadBalancerMonitorGetResponseEnvelopeJSON contains the JSON metadata for the
-// struct [LoadBalancerMonitorGetResponseEnvelope]
-type loadBalancerMonitorGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerMonitorGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerMonitorGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type LoadBalancerMonitorGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON loadBalancerMonitorGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// loadBalancerMonitorGetResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [LoadBalancerMonitorGetResponseEnvelopeErrors]
-type loadBalancerMonitorGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerMonitorGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerMonitorGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type LoadBalancerMonitorGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON loadBalancerMonitorGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// loadBalancerMonitorGetResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [LoadBalancerMonitorGetResponseEnvelopeMessages]
-type loadBalancerMonitorGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerMonitorGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerMonitorGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type LoadBalancerMonitorGetResponseEnvelopeSuccess bool
-
-const (
- LoadBalancerMonitorGetResponseEnvelopeSuccessTrue LoadBalancerMonitorGetResponseEnvelopeSuccess = true
-)
diff --git a/loadbalancermonitor_test.go b/loadbalancermonitor_test.go
deleted file mode 100644
index 11a11d31d7c..00000000000
--- a/loadbalancermonitor_test.go
+++ /dev/null
@@ -1,255 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestLoadBalancerMonitorNewWithOptionalParams(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"),
- )
- _, err := client.LoadBalancers.Monitors.New(context.TODO(), cloudflare.LoadBalancerMonitorNewParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- ExpectedCodes: cloudflare.F("2xx"),
- AllowInsecure: cloudflare.F(true),
- ConsecutiveDown: cloudflare.F(int64(0)),
- ConsecutiveUp: cloudflare.F(int64(0)),
- Description: cloudflare.F("Login page monitor"),
- ExpectedBody: cloudflare.F("alive"),
- FollowRedirects: cloudflare.F(true),
- Header: cloudflare.F[any](map[string]interface{}{
- "Host": map[string]interface{}{
- "0": "example.com",
- },
- "X-App-ID": map[string]interface{}{
- "0": "abc123",
- },
- }),
- Interval: cloudflare.F(int64(0)),
- Method: cloudflare.F("GET"),
- Path: cloudflare.F("/health"),
- Port: cloudflare.F(int64(0)),
- ProbeZone: cloudflare.F("example.com"),
- Retries: cloudflare.F(int64(0)),
- Timeout: cloudflare.F(int64(0)),
- Type: cloudflare.F(cloudflare.LoadBalancerMonitorNewParamsTypeHTTPS),
- })
- 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())
- }
-}
-
-func TestLoadBalancerMonitorUpdateWithOptionalParams(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"),
- )
- _, err := client.LoadBalancers.Monitors.Update(
- context.TODO(),
- "f1aba936b94213e5b8dca0c0dbf1f9cc",
- cloudflare.LoadBalancerMonitorUpdateParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- ExpectedCodes: cloudflare.F("2xx"),
- AllowInsecure: cloudflare.F(true),
- ConsecutiveDown: cloudflare.F(int64(0)),
- ConsecutiveUp: cloudflare.F(int64(0)),
- Description: cloudflare.F("Login page monitor"),
- ExpectedBody: cloudflare.F("alive"),
- FollowRedirects: cloudflare.F(true),
- Header: cloudflare.F[any](map[string]interface{}{
- "Host": map[string]interface{}{
- "0": "example.com",
- },
- "X-App-ID": map[string]interface{}{
- "0": "abc123",
- },
- }),
- Interval: cloudflare.F(int64(0)),
- Method: cloudflare.F("GET"),
- Path: cloudflare.F("/health"),
- Port: cloudflare.F(int64(0)),
- ProbeZone: cloudflare.F("example.com"),
- Retries: cloudflare.F(int64(0)),
- Timeout: cloudflare.F(int64(0)),
- Type: cloudflare.F(cloudflare.LoadBalancerMonitorUpdateParamsTypeHTTPS),
- },
- )
- 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())
- }
-}
-
-func TestLoadBalancerMonitorList(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"),
- )
- _, err := client.LoadBalancers.Monitors.List(context.TODO(), cloudflare.LoadBalancerMonitorListParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- })
- 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())
- }
-}
-
-func TestLoadBalancerMonitorDelete(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"),
- )
- _, err := client.LoadBalancers.Monitors.Delete(
- context.TODO(),
- "f1aba936b94213e5b8dca0c0dbf1f9cc",
- cloudflare.LoadBalancerMonitorDeleteParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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())
- }
-}
-
-func TestLoadBalancerMonitorEditWithOptionalParams(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"),
- )
- _, err := client.LoadBalancers.Monitors.Edit(
- context.TODO(),
- "f1aba936b94213e5b8dca0c0dbf1f9cc",
- cloudflare.LoadBalancerMonitorEditParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- ExpectedCodes: cloudflare.F("2xx"),
- AllowInsecure: cloudflare.F(true),
- ConsecutiveDown: cloudflare.F(int64(0)),
- ConsecutiveUp: cloudflare.F(int64(0)),
- Description: cloudflare.F("Login page monitor"),
- ExpectedBody: cloudflare.F("alive"),
- FollowRedirects: cloudflare.F(true),
- Header: cloudflare.F[any](map[string]interface{}{
- "Host": map[string]interface{}{
- "0": "example.com",
- },
- "X-App-ID": map[string]interface{}{
- "0": "abc123",
- },
- }),
- Interval: cloudflare.F(int64(0)),
- Method: cloudflare.F("GET"),
- Path: cloudflare.F("/health"),
- Port: cloudflare.F(int64(0)),
- ProbeZone: cloudflare.F("example.com"),
- Retries: cloudflare.F(int64(0)),
- Timeout: cloudflare.F(int64(0)),
- Type: cloudflare.F(cloudflare.LoadBalancerMonitorEditParamsTypeHTTPS),
- },
- )
- 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())
- }
-}
-
-func TestLoadBalancerMonitorGet(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"),
- )
- _, err := client.LoadBalancers.Monitors.Get(
- context.TODO(),
- "f1aba936b94213e5b8dca0c0dbf1f9cc",
- cloudflare.LoadBalancerMonitorGetParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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/loadbalancermonitorpreview.go b/loadbalancermonitorpreview.go
deleted file mode 100644
index 39d5be9e36c..00000000000
--- a/loadbalancermonitorpreview.go
+++ /dev/null
@@ -1,222 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// LoadBalancerMonitorPreviewService contains methods and other services that help
-// with interacting with the cloudflare API. Note, unlike clients, this service
-// does not read variables from the environment automatically. You should not
-// instantiate this service directly, and instead use the
-// [NewLoadBalancerMonitorPreviewService] method instead.
-type LoadBalancerMonitorPreviewService struct {
- Options []option.RequestOption
-}
-
-// NewLoadBalancerMonitorPreviewService generates a new service that applies the
-// given options to each request. These options are applied after the parent
-// client's options (if there is one), and before any request-specific options.
-func NewLoadBalancerMonitorPreviewService(opts ...option.RequestOption) (r *LoadBalancerMonitorPreviewService) {
- r = &LoadBalancerMonitorPreviewService{}
- r.Options = opts
- return
-}
-
-// Preview pools using the specified monitor with provided monitor details. The
-// returned preview_id can be used in the preview endpoint to retrieve the results.
-func (r *LoadBalancerMonitorPreviewService) New(ctx context.Context, monitorID string, params LoadBalancerMonitorPreviewNewParams, opts ...option.RequestOption) (res *LoadBalancerMonitorPreviewNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env LoadBalancerMonitorPreviewNewResponseEnvelope
- path := fmt.Sprintf("accounts/%s/load_balancers/monitors/%s/preview", params.AccountID, monitorID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type LoadBalancerMonitorPreviewNewResponse struct {
- // Monitored pool IDs mapped to their respective names.
- Pools map[string]string `json:"pools"`
- PreviewID string `json:"preview_id"`
- JSON loadBalancerMonitorPreviewNewResponseJSON `json:"-"`
-}
-
-// loadBalancerMonitorPreviewNewResponseJSON contains the JSON metadata for the
-// struct [LoadBalancerMonitorPreviewNewResponse]
-type loadBalancerMonitorPreviewNewResponseJSON struct {
- Pools apijson.Field
- PreviewID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerMonitorPreviewNewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerMonitorPreviewNewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type LoadBalancerMonitorPreviewNewParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
- // The expected HTTP response code or code range of the health check. This
- // parameter is only valid for HTTP and HTTPS monitors.
- ExpectedCodes param.Field[string] `json:"expected_codes,required"`
- // Do not validate the certificate when monitor use HTTPS. This parameter is
- // currently only valid for HTTP and HTTPS monitors.
- AllowInsecure param.Field[bool] `json:"allow_insecure"`
- // To be marked unhealthy the monitored origin must fail this healthcheck N
- // consecutive times.
- ConsecutiveDown param.Field[int64] `json:"consecutive_down"`
- // To be marked healthy the monitored origin must pass this healthcheck N
- // consecutive times.
- ConsecutiveUp param.Field[int64] `json:"consecutive_up"`
- // Object description.
- Description param.Field[string] `json:"description"`
- // A case-insensitive sub-string to look for in the response body. If this string
- // is not found, the origin will be marked as unhealthy. This parameter is only
- // valid for HTTP and HTTPS monitors.
- ExpectedBody param.Field[string] `json:"expected_body"`
- // Follow redirects if returned by the origin. This parameter is only valid for
- // HTTP and HTTPS monitors.
- FollowRedirects param.Field[bool] `json:"follow_redirects"`
- // The HTTP request headers to send in the health check. It is recommended you set
- // a Host header by default. The User-Agent header cannot be overridden. This
- // parameter is only valid for HTTP and HTTPS monitors.
- Header param.Field[interface{}] `json:"header"`
- // The interval between each health check. Shorter intervals may improve failover
- // time, but will increase load on the origins as we check from multiple locations.
- Interval param.Field[int64] `json:"interval"`
- // The method to use for the health check. This defaults to 'GET' for HTTP/HTTPS
- // based checks and 'connection_established' for TCP based health checks.
- Method param.Field[string] `json:"method"`
- // The endpoint path you want to conduct a health check against. This parameter is
- // only valid for HTTP and HTTPS monitors.
- Path param.Field[string] `json:"path"`
- // The port number to connect to for the health check. Required for TCP, UDP, and
- // SMTP checks. HTTP and HTTPS checks should only define the port when using a
- // non-standard port (HTTP: default 80, HTTPS: default 443).
- Port param.Field[int64] `json:"port"`
- // Assign this monitor to emulate the specified zone while probing. This parameter
- // is only valid for HTTP and HTTPS monitors.
- ProbeZone param.Field[string] `json:"probe_zone"`
- // The number of retries to attempt in case of a timeout before marking the origin
- // as unhealthy. Retries are attempted immediately.
- Retries param.Field[int64] `json:"retries"`
- // The timeout (in seconds) before marking the health check as failed.
- Timeout param.Field[int64] `json:"timeout"`
- // The protocol to use for the health check. Currently supported protocols are
- // 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.
- Type param.Field[LoadBalancerMonitorPreviewNewParamsType] `json:"type"`
-}
-
-func (r LoadBalancerMonitorPreviewNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The protocol to use for the health check. Currently supported protocols are
-// 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.
-type LoadBalancerMonitorPreviewNewParamsType string
-
-const (
- LoadBalancerMonitorPreviewNewParamsTypeHTTP LoadBalancerMonitorPreviewNewParamsType = "http"
- LoadBalancerMonitorPreviewNewParamsTypeHTTPS LoadBalancerMonitorPreviewNewParamsType = "https"
- LoadBalancerMonitorPreviewNewParamsTypeTcp LoadBalancerMonitorPreviewNewParamsType = "tcp"
- LoadBalancerMonitorPreviewNewParamsTypeUdpIcmp LoadBalancerMonitorPreviewNewParamsType = "udp_icmp"
- LoadBalancerMonitorPreviewNewParamsTypeIcmpPing LoadBalancerMonitorPreviewNewParamsType = "icmp_ping"
- LoadBalancerMonitorPreviewNewParamsTypeSmtp LoadBalancerMonitorPreviewNewParamsType = "smtp"
-)
-
-type LoadBalancerMonitorPreviewNewResponseEnvelope struct {
- Errors []LoadBalancerMonitorPreviewNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []LoadBalancerMonitorPreviewNewResponseEnvelopeMessages `json:"messages,required"`
- Result LoadBalancerMonitorPreviewNewResponse `json:"result,required"`
- // Whether the API call was successful
- Success LoadBalancerMonitorPreviewNewResponseEnvelopeSuccess `json:"success,required"`
- JSON loadBalancerMonitorPreviewNewResponseEnvelopeJSON `json:"-"`
-}
-
-// loadBalancerMonitorPreviewNewResponseEnvelopeJSON contains the JSON metadata for
-// the struct [LoadBalancerMonitorPreviewNewResponseEnvelope]
-type loadBalancerMonitorPreviewNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerMonitorPreviewNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerMonitorPreviewNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type LoadBalancerMonitorPreviewNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON loadBalancerMonitorPreviewNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// loadBalancerMonitorPreviewNewResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct [LoadBalancerMonitorPreviewNewResponseEnvelopeErrors]
-type loadBalancerMonitorPreviewNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerMonitorPreviewNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerMonitorPreviewNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type LoadBalancerMonitorPreviewNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON loadBalancerMonitorPreviewNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// loadBalancerMonitorPreviewNewResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct [LoadBalancerMonitorPreviewNewResponseEnvelopeMessages]
-type loadBalancerMonitorPreviewNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerMonitorPreviewNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerMonitorPreviewNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type LoadBalancerMonitorPreviewNewResponseEnvelopeSuccess bool
-
-const (
- LoadBalancerMonitorPreviewNewResponseEnvelopeSuccessTrue LoadBalancerMonitorPreviewNewResponseEnvelopeSuccess = true
-)
diff --git a/loadbalancermonitorpreview_test.go b/loadbalancermonitorpreview_test.go
deleted file mode 100644
index 93536406f40..00000000000
--- a/loadbalancermonitorpreview_test.go
+++ /dev/null
@@ -1,67 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestLoadBalancerMonitorPreviewNewWithOptionalParams(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"),
- )
- _, err := client.LoadBalancers.Monitors.Previews.New(
- context.TODO(),
- "f1aba936b94213e5b8dca0c0dbf1f9cc",
- cloudflare.LoadBalancerMonitorPreviewNewParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- ExpectedCodes: cloudflare.F("2xx"),
- AllowInsecure: cloudflare.F(true),
- ConsecutiveDown: cloudflare.F(int64(0)),
- ConsecutiveUp: cloudflare.F(int64(0)),
- Description: cloudflare.F("Login page monitor"),
- ExpectedBody: cloudflare.F("alive"),
- FollowRedirects: cloudflare.F(true),
- Header: cloudflare.F[any](map[string]interface{}{
- "Host": map[string]interface{}{
- "0": "example.com",
- },
- "X-App-ID": map[string]interface{}{
- "0": "abc123",
- },
- }),
- Interval: cloudflare.F(int64(0)),
- Method: cloudflare.F("GET"),
- Path: cloudflare.F("/health"),
- Port: cloudflare.F(int64(0)),
- ProbeZone: cloudflare.F("example.com"),
- Retries: cloudflare.F(int64(0)),
- Timeout: cloudflare.F(int64(0)),
- Type: cloudflare.F(cloudflare.LoadBalancerMonitorPreviewNewParamsTypeHTTPS),
- },
- )
- 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/loadbalancermonitorreference.go b/loadbalancermonitorreference.go
deleted file mode 100644
index a43cb73e718..00000000000
--- a/loadbalancermonitorreference.go
+++ /dev/null
@@ -1,202 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// LoadBalancerMonitorReferenceService contains methods and other services that
-// help with interacting with the cloudflare API. Note, unlike clients, this
-// service does not read variables from the environment automatically. You should
-// not instantiate this service directly, and instead use the
-// [NewLoadBalancerMonitorReferenceService] method instead.
-type LoadBalancerMonitorReferenceService struct {
- Options []option.RequestOption
-}
-
-// NewLoadBalancerMonitorReferenceService generates a new service that applies the
-// given options to each request. These options are applied after the parent
-// client's options (if there is one), and before any request-specific options.
-func NewLoadBalancerMonitorReferenceService(opts ...option.RequestOption) (r *LoadBalancerMonitorReferenceService) {
- r = &LoadBalancerMonitorReferenceService{}
- r.Options = opts
- return
-}
-
-// Get the list of resources that reference the provided monitor.
-func (r *LoadBalancerMonitorReferenceService) Get(ctx context.Context, monitorID string, query LoadBalancerMonitorReferenceGetParams, opts ...option.RequestOption) (res *[]LoadBalancerMonitorReferenceGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env LoadBalancerMonitorReferenceGetResponseEnvelope
- path := fmt.Sprintf("accounts/%s/load_balancers/monitors/%s/references", query.AccountID, monitorID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type LoadBalancerMonitorReferenceGetResponse struct {
- ReferenceType LoadBalancerMonitorReferenceGetResponseReferenceType `json:"reference_type"`
- ResourceID string `json:"resource_id"`
- ResourceName string `json:"resource_name"`
- ResourceType string `json:"resource_type"`
- JSON loadBalancerMonitorReferenceGetResponseJSON `json:"-"`
-}
-
-// loadBalancerMonitorReferenceGetResponseJSON contains the JSON metadata for the
-// struct [LoadBalancerMonitorReferenceGetResponse]
-type loadBalancerMonitorReferenceGetResponseJSON struct {
- ReferenceType apijson.Field
- ResourceID apijson.Field
- ResourceName apijson.Field
- ResourceType apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerMonitorReferenceGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerMonitorReferenceGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type LoadBalancerMonitorReferenceGetResponseReferenceType string
-
-const (
- LoadBalancerMonitorReferenceGetResponseReferenceTypeStar LoadBalancerMonitorReferenceGetResponseReferenceType = "*"
- LoadBalancerMonitorReferenceGetResponseReferenceTypeReferral LoadBalancerMonitorReferenceGetResponseReferenceType = "referral"
- LoadBalancerMonitorReferenceGetResponseReferenceTypeReferrer LoadBalancerMonitorReferenceGetResponseReferenceType = "referrer"
-)
-
-type LoadBalancerMonitorReferenceGetParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type LoadBalancerMonitorReferenceGetResponseEnvelope struct {
- Errors []LoadBalancerMonitorReferenceGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []LoadBalancerMonitorReferenceGetResponseEnvelopeMessages `json:"messages,required"`
- // List of resources that reference a given monitor.
- Result []LoadBalancerMonitorReferenceGetResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success LoadBalancerMonitorReferenceGetResponseEnvelopeSuccess `json:"success,required"`
- ResultInfo LoadBalancerMonitorReferenceGetResponseEnvelopeResultInfo `json:"result_info"`
- JSON loadBalancerMonitorReferenceGetResponseEnvelopeJSON `json:"-"`
-}
-
-// loadBalancerMonitorReferenceGetResponseEnvelopeJSON contains the JSON metadata
-// for the struct [LoadBalancerMonitorReferenceGetResponseEnvelope]
-type loadBalancerMonitorReferenceGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- ResultInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerMonitorReferenceGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerMonitorReferenceGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type LoadBalancerMonitorReferenceGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON loadBalancerMonitorReferenceGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// loadBalancerMonitorReferenceGetResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct [LoadBalancerMonitorReferenceGetResponseEnvelopeErrors]
-type loadBalancerMonitorReferenceGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerMonitorReferenceGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerMonitorReferenceGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type LoadBalancerMonitorReferenceGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON loadBalancerMonitorReferenceGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// loadBalancerMonitorReferenceGetResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct
-// [LoadBalancerMonitorReferenceGetResponseEnvelopeMessages]
-type loadBalancerMonitorReferenceGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerMonitorReferenceGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerMonitorReferenceGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type LoadBalancerMonitorReferenceGetResponseEnvelopeSuccess bool
-
-const (
- LoadBalancerMonitorReferenceGetResponseEnvelopeSuccessTrue LoadBalancerMonitorReferenceGetResponseEnvelopeSuccess = true
-)
-
-type LoadBalancerMonitorReferenceGetResponseEnvelopeResultInfo struct {
- // Total number of results for the requested service
- Count float64 `json:"count"`
- // Current page within paginated list of results
- Page float64 `json:"page"`
- // Number of results per page of results
- PerPage float64 `json:"per_page"`
- // Total results available without any search parameters
- TotalCount float64 `json:"total_count"`
- JSON loadBalancerMonitorReferenceGetResponseEnvelopeResultInfoJSON `json:"-"`
-}
-
-// loadBalancerMonitorReferenceGetResponseEnvelopeResultInfoJSON contains the JSON
-// metadata for the struct
-// [LoadBalancerMonitorReferenceGetResponseEnvelopeResultInfo]
-type loadBalancerMonitorReferenceGetResponseEnvelopeResultInfoJSON struct {
- Count apijson.Field
- Page apijson.Field
- PerPage apijson.Field
- TotalCount apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerMonitorReferenceGetResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerMonitorReferenceGetResponseEnvelopeResultInfoJSON) RawJSON() string {
- return r.raw
-}
diff --git a/loadbalancermonitorreference_test.go b/loadbalancermonitorreference_test.go
deleted file mode 100644
index 98db9de939c..00000000000
--- a/loadbalancermonitorreference_test.go
+++ /dev/null
@@ -1,44 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestLoadBalancerMonitorReferenceGet(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"),
- )
- _, err := client.LoadBalancers.Monitors.References.Get(
- context.TODO(),
- "f1aba936b94213e5b8dca0c0dbf1f9cc",
- cloudflare.LoadBalancerMonitorReferenceGetParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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/loadbalancerpool.go b/loadbalancerpool.go
deleted file mode 100644
index 3e30341e087..00000000000
--- a/loadbalancerpool.go
+++ /dev/null
@@ -1,3344 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// LoadBalancerPoolService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewLoadBalancerPoolService] method
-// instead.
-type LoadBalancerPoolService struct {
- Options []option.RequestOption
- Health *LoadBalancerPoolHealthService
- References *LoadBalancerPoolReferenceService
-}
-
-// NewLoadBalancerPoolService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewLoadBalancerPoolService(opts ...option.RequestOption) (r *LoadBalancerPoolService) {
- r = &LoadBalancerPoolService{}
- r.Options = opts
- r.Health = NewLoadBalancerPoolHealthService(opts...)
- r.References = NewLoadBalancerPoolReferenceService(opts...)
- return
-}
-
-// Create a new pool.
-func (r *LoadBalancerPoolService) New(ctx context.Context, params LoadBalancerPoolNewParams, opts ...option.RequestOption) (res *LoadBalancerPoolNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env LoadBalancerPoolNewResponseEnvelope
- path := fmt.Sprintf("accounts/%s/load_balancers/pools", params.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Modify a configured pool.
-func (r *LoadBalancerPoolService) Update(ctx context.Context, poolID string, params LoadBalancerPoolUpdateParams, opts ...option.RequestOption) (res *LoadBalancerPoolUpdateResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env LoadBalancerPoolUpdateResponseEnvelope
- path := fmt.Sprintf("accounts/%s/load_balancers/pools/%s", params.AccountID, poolID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// List configured pools.
-func (r *LoadBalancerPoolService) List(ctx context.Context, params LoadBalancerPoolListParams, opts ...option.RequestOption) (res *[]LoadBalancerPoolListResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env LoadBalancerPoolListResponseEnvelope
- path := fmt.Sprintf("accounts/%s/load_balancers/pools", params.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Delete a configured pool.
-func (r *LoadBalancerPoolService) Delete(ctx context.Context, poolID string, body LoadBalancerPoolDeleteParams, opts ...option.RequestOption) (res *LoadBalancerPoolDeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env LoadBalancerPoolDeleteResponseEnvelope
- path := fmt.Sprintf("accounts/%s/load_balancers/pools/%s", body.AccountID, poolID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Apply changes to an existing pool, overwriting the supplied properties.
-func (r *LoadBalancerPoolService) Edit(ctx context.Context, poolID string, params LoadBalancerPoolEditParams, opts ...option.RequestOption) (res *LoadBalancerPoolEditResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env LoadBalancerPoolEditResponseEnvelope
- path := fmt.Sprintf("accounts/%s/load_balancers/pools/%s", params.AccountID, poolID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Fetch a single configured pool.
-func (r *LoadBalancerPoolService) Get(ctx context.Context, poolID string, query LoadBalancerPoolGetParams, opts ...option.RequestOption) (res *LoadBalancerPoolGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env LoadBalancerPoolGetResponseEnvelope
- path := fmt.Sprintf("accounts/%s/load_balancers/pools/%s", query.AccountID, poolID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type LoadBalancerPoolNewResponse struct {
- ID string `json:"id"`
- // A list of regions from which to run health checks. Null means every Cloudflare
- // data center.
- CheckRegions []LoadBalancerPoolNewResponseCheckRegion `json:"check_regions,nullable"`
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // A human-readable description of the pool.
- Description string `json:"description"`
- // This field shows up only if the pool is disabled. This field is set with the
- // time the pool was disabled at.
- DisabledAt time.Time `json:"disabled_at" format:"date-time"`
- // Whether to enable (the default) or disable this pool. Disabled pools will not
- // receive traffic and are excluded from health checks. Disabling a pool will cause
- // any load balancers using it to failover to the next pool (if any).
- Enabled bool `json:"enabled"`
- // The latitude of the data center containing the origins used in this pool in
- // decimal degrees. If this is set, longitude must also be set.
- Latitude float64 `json:"latitude"`
- // Configures load shedding policies and percentages for the pool.
- LoadShedding LoadBalancerPoolNewResponseLoadShedding `json:"load_shedding"`
- // The longitude of the data center containing the origins used in this pool in
- // decimal degrees. If this is set, latitude must also be set.
- Longitude float64 `json:"longitude"`
- // The minimum number of origins that must be healthy for this pool to serve
- // traffic. If the number of healthy origins falls below this number, the pool will
- // be marked unhealthy and will failover to the next available pool.
- MinimumOrigins int64 `json:"minimum_origins"`
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // The ID of the Monitor to use for checking the health of origins within this
- // pool.
- Monitor interface{} `json:"monitor"`
- // A short name (tag) for the pool. Only alphanumeric characters, hyphens, and
- // underscores are allowed.
- Name string `json:"name"`
- // This field is now deprecated. It has been moved to Cloudflare's Centralized
- // Notification service
- // https://developers.cloudflare.com/fundamentals/notifications/. The email address
- // to send health status notifications to. This can be an individual mailbox or a
- // mailing list. Multiple emails can be supplied as a comma delimited list.
- NotificationEmail string `json:"notification_email"`
- // Filter pool and origin health notifications by resource type or health status.
- // Use null to reset.
- NotificationFilter LoadBalancerPoolNewResponseNotificationFilter `json:"notification_filter,nullable"`
- // Configures origin steering for the pool. Controls how origins are selected for
- // new sessions and traffic without session affinity.
- OriginSteering LoadBalancerPoolNewResponseOriginSteering `json:"origin_steering"`
- // The list of origins within this pool. Traffic directed at this pool is balanced
- // across all currently healthy origins, provided the pool itself is healthy.
- Origins []LoadBalancerPoolNewResponseOrigin `json:"origins"`
- JSON loadBalancerPoolNewResponseJSON `json:"-"`
-}
-
-// loadBalancerPoolNewResponseJSON contains the JSON metadata for the struct
-// [LoadBalancerPoolNewResponse]
-type loadBalancerPoolNewResponseJSON struct {
- ID apijson.Field
- CheckRegions apijson.Field
- CreatedOn apijson.Field
- Description apijson.Field
- DisabledAt apijson.Field
- Enabled apijson.Field
- Latitude apijson.Field
- LoadShedding apijson.Field
- Longitude apijson.Field
- MinimumOrigins apijson.Field
- ModifiedOn apijson.Field
- Monitor apijson.Field
- Name apijson.Field
- NotificationEmail apijson.Field
- NotificationFilter apijson.Field
- OriginSteering apijson.Field
- Origins apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerPoolNewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerPoolNewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// WNAM: Western North America, ENAM: Eastern North America, WEU: Western Europe,
-// EEU: Eastern Europe, NSAM: Northern South America, SSAM: Southern South America,
-// OC: Oceania, ME: Middle East, NAF: North Africa, SAF: South Africa, SAS:
-// Southern Asia, SEAS: South East Asia, NEAS: North East Asia, ALL_REGIONS: all
-// regions (ENTERPRISE customers only).
-type LoadBalancerPoolNewResponseCheckRegion string
-
-const (
- LoadBalancerPoolNewResponseCheckRegionWnam LoadBalancerPoolNewResponseCheckRegion = "WNAM"
- LoadBalancerPoolNewResponseCheckRegionEnam LoadBalancerPoolNewResponseCheckRegion = "ENAM"
- LoadBalancerPoolNewResponseCheckRegionWeu LoadBalancerPoolNewResponseCheckRegion = "WEU"
- LoadBalancerPoolNewResponseCheckRegionEeu LoadBalancerPoolNewResponseCheckRegion = "EEU"
- LoadBalancerPoolNewResponseCheckRegionNsam LoadBalancerPoolNewResponseCheckRegion = "NSAM"
- LoadBalancerPoolNewResponseCheckRegionSsam LoadBalancerPoolNewResponseCheckRegion = "SSAM"
- LoadBalancerPoolNewResponseCheckRegionOc LoadBalancerPoolNewResponseCheckRegion = "OC"
- LoadBalancerPoolNewResponseCheckRegionMe LoadBalancerPoolNewResponseCheckRegion = "ME"
- LoadBalancerPoolNewResponseCheckRegionNaf LoadBalancerPoolNewResponseCheckRegion = "NAF"
- LoadBalancerPoolNewResponseCheckRegionSaf LoadBalancerPoolNewResponseCheckRegion = "SAF"
- LoadBalancerPoolNewResponseCheckRegionSas LoadBalancerPoolNewResponseCheckRegion = "SAS"
- LoadBalancerPoolNewResponseCheckRegionSeas LoadBalancerPoolNewResponseCheckRegion = "SEAS"
- LoadBalancerPoolNewResponseCheckRegionNeas LoadBalancerPoolNewResponseCheckRegion = "NEAS"
- LoadBalancerPoolNewResponseCheckRegionAllRegions LoadBalancerPoolNewResponseCheckRegion = "ALL_REGIONS"
-)
-
-// Configures load shedding policies and percentages for the pool.
-type LoadBalancerPoolNewResponseLoadShedding struct {
- // The percent of traffic to shed from the pool, according to the default policy.
- // Applies to new sessions and traffic without session affinity.
- DefaultPercent float64 `json:"default_percent"`
- // The default policy to use when load shedding. A random policy randomly sheds a
- // given percent of requests. A hash policy computes a hash over the
- // CF-Connecting-IP address and sheds all requests originating from a percent of
- // IPs.
- DefaultPolicy LoadBalancerPoolNewResponseLoadSheddingDefaultPolicy `json:"default_policy"`
- // The percent of existing sessions to shed from the pool, according to the session
- // policy.
- SessionPercent float64 `json:"session_percent"`
- // Only the hash policy is supported for existing sessions (to avoid exponential
- // decay).
- SessionPolicy LoadBalancerPoolNewResponseLoadSheddingSessionPolicy `json:"session_policy"`
- JSON loadBalancerPoolNewResponseLoadSheddingJSON `json:"-"`
-}
-
-// loadBalancerPoolNewResponseLoadSheddingJSON contains the JSON metadata for the
-// struct [LoadBalancerPoolNewResponseLoadShedding]
-type loadBalancerPoolNewResponseLoadSheddingJSON struct {
- DefaultPercent apijson.Field
- DefaultPolicy apijson.Field
- SessionPercent apijson.Field
- SessionPolicy apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerPoolNewResponseLoadShedding) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerPoolNewResponseLoadSheddingJSON) RawJSON() string {
- return r.raw
-}
-
-// The default policy to use when load shedding. A random policy randomly sheds a
-// given percent of requests. A hash policy computes a hash over the
-// CF-Connecting-IP address and sheds all requests originating from a percent of
-// IPs.
-type LoadBalancerPoolNewResponseLoadSheddingDefaultPolicy string
-
-const (
- LoadBalancerPoolNewResponseLoadSheddingDefaultPolicyRandom LoadBalancerPoolNewResponseLoadSheddingDefaultPolicy = "random"
- LoadBalancerPoolNewResponseLoadSheddingDefaultPolicyHash LoadBalancerPoolNewResponseLoadSheddingDefaultPolicy = "hash"
-)
-
-// Only the hash policy is supported for existing sessions (to avoid exponential
-// decay).
-type LoadBalancerPoolNewResponseLoadSheddingSessionPolicy string
-
-const (
- LoadBalancerPoolNewResponseLoadSheddingSessionPolicyHash LoadBalancerPoolNewResponseLoadSheddingSessionPolicy = "hash"
-)
-
-// Filter pool and origin health notifications by resource type or health status.
-// Use null to reset.
-type LoadBalancerPoolNewResponseNotificationFilter struct {
- // Filter options for a particular resource type (pool or origin). Use null to
- // reset.
- Origin LoadBalancerPoolNewResponseNotificationFilterOrigin `json:"origin,nullable"`
- // Filter options for a particular resource type (pool or origin). Use null to
- // reset.
- Pool LoadBalancerPoolNewResponseNotificationFilterPool `json:"pool,nullable"`
- JSON loadBalancerPoolNewResponseNotificationFilterJSON `json:"-"`
-}
-
-// loadBalancerPoolNewResponseNotificationFilterJSON contains the JSON metadata for
-// the struct [LoadBalancerPoolNewResponseNotificationFilter]
-type loadBalancerPoolNewResponseNotificationFilterJSON struct {
- Origin apijson.Field
- Pool apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerPoolNewResponseNotificationFilter) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerPoolNewResponseNotificationFilterJSON) RawJSON() string {
- return r.raw
-}
-
-// Filter options for a particular resource type (pool or origin). Use null to
-// reset.
-type LoadBalancerPoolNewResponseNotificationFilterOrigin struct {
- // If set true, disable notifications for this type of resource (pool or origin).
- Disable bool `json:"disable"`
- // If present, send notifications only for this health status (e.g. false for only
- // DOWN events). Use null to reset (all events).
- Healthy bool `json:"healthy,nullable"`
- JSON loadBalancerPoolNewResponseNotificationFilterOriginJSON `json:"-"`
-}
-
-// loadBalancerPoolNewResponseNotificationFilterOriginJSON contains the JSON
-// metadata for the struct [LoadBalancerPoolNewResponseNotificationFilterOrigin]
-type loadBalancerPoolNewResponseNotificationFilterOriginJSON struct {
- Disable apijson.Field
- Healthy apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerPoolNewResponseNotificationFilterOrigin) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerPoolNewResponseNotificationFilterOriginJSON) RawJSON() string {
- return r.raw
-}
-
-// Filter options for a particular resource type (pool or origin). Use null to
-// reset.
-type LoadBalancerPoolNewResponseNotificationFilterPool struct {
- // If set true, disable notifications for this type of resource (pool or origin).
- Disable bool `json:"disable"`
- // If present, send notifications only for this health status (e.g. false for only
- // DOWN events). Use null to reset (all events).
- Healthy bool `json:"healthy,nullable"`
- JSON loadBalancerPoolNewResponseNotificationFilterPoolJSON `json:"-"`
-}
-
-// loadBalancerPoolNewResponseNotificationFilterPoolJSON contains the JSON metadata
-// for the struct [LoadBalancerPoolNewResponseNotificationFilterPool]
-type loadBalancerPoolNewResponseNotificationFilterPoolJSON struct {
- Disable apijson.Field
- Healthy apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerPoolNewResponseNotificationFilterPool) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerPoolNewResponseNotificationFilterPoolJSON) RawJSON() string {
- return r.raw
-}
-
-// Configures origin steering for the pool. Controls how origins are selected for
-// new sessions and traffic without session affinity.
-type LoadBalancerPoolNewResponseOriginSteering struct {
- // The type of origin steering policy to use.
- //
- // - `"random"`: Select an origin randomly.
- // - `"hash"`: Select an origin by computing a hash over the CF-Connecting-IP
- // address.
- // - `"least_outstanding_requests"`: Select an origin by taking into consideration
- // origin weights, as well as each origin's number of outstanding requests.
- // Origins with more pending requests are weighted proportionately less relative
- // to others.
- // - `"least_connections"`: Select an origin by taking into consideration origin
- // weights, as well as each origin's number of open connections. Origins with
- // more open connections are weighted proportionately less relative to others.
- // Supported for HTTP/1 and HTTP/2 connections.
- Policy LoadBalancerPoolNewResponseOriginSteeringPolicy `json:"policy"`
- JSON loadBalancerPoolNewResponseOriginSteeringJSON `json:"-"`
-}
-
-// loadBalancerPoolNewResponseOriginSteeringJSON contains the JSON metadata for the
-// struct [LoadBalancerPoolNewResponseOriginSteering]
-type loadBalancerPoolNewResponseOriginSteeringJSON struct {
- Policy apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerPoolNewResponseOriginSteering) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerPoolNewResponseOriginSteeringJSON) RawJSON() string {
- return r.raw
-}
-
-// The type of origin steering policy to use.
-//
-// - `"random"`: Select an origin randomly.
-// - `"hash"`: Select an origin by computing a hash over the CF-Connecting-IP
-// address.
-// - `"least_outstanding_requests"`: Select an origin by taking into consideration
-// origin weights, as well as each origin's number of outstanding requests.
-// Origins with more pending requests are weighted proportionately less relative
-// to others.
-// - `"least_connections"`: Select an origin by taking into consideration origin
-// weights, as well as each origin's number of open connections. Origins with
-// more open connections are weighted proportionately less relative to others.
-// Supported for HTTP/1 and HTTP/2 connections.
-type LoadBalancerPoolNewResponseOriginSteeringPolicy string
-
-const (
- LoadBalancerPoolNewResponseOriginSteeringPolicyRandom LoadBalancerPoolNewResponseOriginSteeringPolicy = "random"
- LoadBalancerPoolNewResponseOriginSteeringPolicyHash LoadBalancerPoolNewResponseOriginSteeringPolicy = "hash"
- LoadBalancerPoolNewResponseOriginSteeringPolicyLeastOutstandingRequests LoadBalancerPoolNewResponseOriginSteeringPolicy = "least_outstanding_requests"
- LoadBalancerPoolNewResponseOriginSteeringPolicyLeastConnections LoadBalancerPoolNewResponseOriginSteeringPolicy = "least_connections"
-)
-
-type LoadBalancerPoolNewResponseOrigin struct {
- // The IP address (IPv4 or IPv6) of the origin, or its publicly addressable
- // hostname. Hostnames entered here should resolve directly to the origin, and not
- // be a hostname proxied by Cloudflare. To set an internal/reserved address,
- // virtual_network_id must also be set.
- Address string `json:"address"`
- // This field shows up only if the origin is disabled. This field is set with the
- // time the origin was disabled.
- DisabledAt time.Time `json:"disabled_at" format:"date-time"`
- // Whether to enable (the default) this origin within the pool. Disabled origins
- // will not receive traffic and are excluded from health checks. The origin will
- // only be disabled for the current pool.
- Enabled bool `json:"enabled"`
- // The request header is used to pass additional information with an HTTP request.
- // Currently supported header is 'Host'.
- Header LoadBalancerPoolNewResponseOriginsHeader `json:"header"`
- // A human-identifiable name for the origin.
- Name string `json:"name"`
- // The virtual network subnet ID the origin belongs in. Virtual network must also
- // belong to the account.
- VirtualNetworkID string `json:"virtual_network_id"`
- // The weight of this origin relative to other origins in the pool. Based on the
- // configured weight the total traffic is distributed among origins within the
- // pool.
- //
- // - `origin_steering.policy="least_outstanding_requests"`: Use weight to scale the
- // origin's outstanding requests.
- // - `origin_steering.policy="least_connections"`: Use weight to scale the origin's
- // open connections.
- Weight float64 `json:"weight"`
- JSON loadBalancerPoolNewResponseOriginJSON `json:"-"`
-}
-
-// loadBalancerPoolNewResponseOriginJSON contains the JSON metadata for the struct
-// [LoadBalancerPoolNewResponseOrigin]
-type loadBalancerPoolNewResponseOriginJSON struct {
- Address apijson.Field
- DisabledAt apijson.Field
- Enabled apijson.Field
- Header apijson.Field
- Name apijson.Field
- VirtualNetworkID apijson.Field
- Weight apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerPoolNewResponseOrigin) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerPoolNewResponseOriginJSON) RawJSON() string {
- return r.raw
-}
-
-// The request header is used to pass additional information with an HTTP request.
-// Currently supported header is 'Host'.
-type LoadBalancerPoolNewResponseOriginsHeader struct {
- // The 'Host' header allows to override the hostname set in the HTTP request.
- // Current support is 1 'Host' header override per origin.
- Host []string `json:"Host"`
- JSON loadBalancerPoolNewResponseOriginsHeaderJSON `json:"-"`
-}
-
-// loadBalancerPoolNewResponseOriginsHeaderJSON contains the JSON metadata for the
-// struct [LoadBalancerPoolNewResponseOriginsHeader]
-type loadBalancerPoolNewResponseOriginsHeaderJSON struct {
- Host apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerPoolNewResponseOriginsHeader) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerPoolNewResponseOriginsHeaderJSON) RawJSON() string {
- return r.raw
-}
-
-type LoadBalancerPoolUpdateResponse struct {
- ID string `json:"id"`
- // A list of regions from which to run health checks. Null means every Cloudflare
- // data center.
- CheckRegions []LoadBalancerPoolUpdateResponseCheckRegion `json:"check_regions,nullable"`
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // A human-readable description of the pool.
- Description string `json:"description"`
- // This field shows up only if the pool is disabled. This field is set with the
- // time the pool was disabled at.
- DisabledAt time.Time `json:"disabled_at" format:"date-time"`
- // Whether to enable (the default) or disable this pool. Disabled pools will not
- // receive traffic and are excluded from health checks. Disabling a pool will cause
- // any load balancers using it to failover to the next pool (if any).
- Enabled bool `json:"enabled"`
- // The latitude of the data center containing the origins used in this pool in
- // decimal degrees. If this is set, longitude must also be set.
- Latitude float64 `json:"latitude"`
- // Configures load shedding policies and percentages for the pool.
- LoadShedding LoadBalancerPoolUpdateResponseLoadShedding `json:"load_shedding"`
- // The longitude of the data center containing the origins used in this pool in
- // decimal degrees. If this is set, latitude must also be set.
- Longitude float64 `json:"longitude"`
- // The minimum number of origins that must be healthy for this pool to serve
- // traffic. If the number of healthy origins falls below this number, the pool will
- // be marked unhealthy and will failover to the next available pool.
- MinimumOrigins int64 `json:"minimum_origins"`
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // The ID of the Monitor to use for checking the health of origins within this
- // pool.
- Monitor interface{} `json:"monitor"`
- // A short name (tag) for the pool. Only alphanumeric characters, hyphens, and
- // underscores are allowed.
- Name string `json:"name"`
- // This field is now deprecated. It has been moved to Cloudflare's Centralized
- // Notification service
- // https://developers.cloudflare.com/fundamentals/notifications/. The email address
- // to send health status notifications to. This can be an individual mailbox or a
- // mailing list. Multiple emails can be supplied as a comma delimited list.
- NotificationEmail string `json:"notification_email"`
- // Filter pool and origin health notifications by resource type or health status.
- // Use null to reset.
- NotificationFilter LoadBalancerPoolUpdateResponseNotificationFilter `json:"notification_filter,nullable"`
- // Configures origin steering for the pool. Controls how origins are selected for
- // new sessions and traffic without session affinity.
- OriginSteering LoadBalancerPoolUpdateResponseOriginSteering `json:"origin_steering"`
- // The list of origins within this pool. Traffic directed at this pool is balanced
- // across all currently healthy origins, provided the pool itself is healthy.
- Origins []LoadBalancerPoolUpdateResponseOrigin `json:"origins"`
- JSON loadBalancerPoolUpdateResponseJSON `json:"-"`
-}
-
-// loadBalancerPoolUpdateResponseJSON contains the JSON metadata for the struct
-// [LoadBalancerPoolUpdateResponse]
-type loadBalancerPoolUpdateResponseJSON struct {
- ID apijson.Field
- CheckRegions apijson.Field
- CreatedOn apijson.Field
- Description apijson.Field
- DisabledAt apijson.Field
- Enabled apijson.Field
- Latitude apijson.Field
- LoadShedding apijson.Field
- Longitude apijson.Field
- MinimumOrigins apijson.Field
- ModifiedOn apijson.Field
- Monitor apijson.Field
- Name apijson.Field
- NotificationEmail apijson.Field
- NotificationFilter apijson.Field
- OriginSteering apijson.Field
- Origins apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerPoolUpdateResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerPoolUpdateResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// WNAM: Western North America, ENAM: Eastern North America, WEU: Western Europe,
-// EEU: Eastern Europe, NSAM: Northern South America, SSAM: Southern South America,
-// OC: Oceania, ME: Middle East, NAF: North Africa, SAF: South Africa, SAS:
-// Southern Asia, SEAS: South East Asia, NEAS: North East Asia, ALL_REGIONS: all
-// regions (ENTERPRISE customers only).
-type LoadBalancerPoolUpdateResponseCheckRegion string
-
-const (
- LoadBalancerPoolUpdateResponseCheckRegionWnam LoadBalancerPoolUpdateResponseCheckRegion = "WNAM"
- LoadBalancerPoolUpdateResponseCheckRegionEnam LoadBalancerPoolUpdateResponseCheckRegion = "ENAM"
- LoadBalancerPoolUpdateResponseCheckRegionWeu LoadBalancerPoolUpdateResponseCheckRegion = "WEU"
- LoadBalancerPoolUpdateResponseCheckRegionEeu LoadBalancerPoolUpdateResponseCheckRegion = "EEU"
- LoadBalancerPoolUpdateResponseCheckRegionNsam LoadBalancerPoolUpdateResponseCheckRegion = "NSAM"
- LoadBalancerPoolUpdateResponseCheckRegionSsam LoadBalancerPoolUpdateResponseCheckRegion = "SSAM"
- LoadBalancerPoolUpdateResponseCheckRegionOc LoadBalancerPoolUpdateResponseCheckRegion = "OC"
- LoadBalancerPoolUpdateResponseCheckRegionMe LoadBalancerPoolUpdateResponseCheckRegion = "ME"
- LoadBalancerPoolUpdateResponseCheckRegionNaf LoadBalancerPoolUpdateResponseCheckRegion = "NAF"
- LoadBalancerPoolUpdateResponseCheckRegionSaf LoadBalancerPoolUpdateResponseCheckRegion = "SAF"
- LoadBalancerPoolUpdateResponseCheckRegionSas LoadBalancerPoolUpdateResponseCheckRegion = "SAS"
- LoadBalancerPoolUpdateResponseCheckRegionSeas LoadBalancerPoolUpdateResponseCheckRegion = "SEAS"
- LoadBalancerPoolUpdateResponseCheckRegionNeas LoadBalancerPoolUpdateResponseCheckRegion = "NEAS"
- LoadBalancerPoolUpdateResponseCheckRegionAllRegions LoadBalancerPoolUpdateResponseCheckRegion = "ALL_REGIONS"
-)
-
-// Configures load shedding policies and percentages for the pool.
-type LoadBalancerPoolUpdateResponseLoadShedding struct {
- // The percent of traffic to shed from the pool, according to the default policy.
- // Applies to new sessions and traffic without session affinity.
- DefaultPercent float64 `json:"default_percent"`
- // The default policy to use when load shedding. A random policy randomly sheds a
- // given percent of requests. A hash policy computes a hash over the
- // CF-Connecting-IP address and sheds all requests originating from a percent of
- // IPs.
- DefaultPolicy LoadBalancerPoolUpdateResponseLoadSheddingDefaultPolicy `json:"default_policy"`
- // The percent of existing sessions to shed from the pool, according to the session
- // policy.
- SessionPercent float64 `json:"session_percent"`
- // Only the hash policy is supported for existing sessions (to avoid exponential
- // decay).
- SessionPolicy LoadBalancerPoolUpdateResponseLoadSheddingSessionPolicy `json:"session_policy"`
- JSON loadBalancerPoolUpdateResponseLoadSheddingJSON `json:"-"`
-}
-
-// loadBalancerPoolUpdateResponseLoadSheddingJSON contains the JSON metadata for
-// the struct [LoadBalancerPoolUpdateResponseLoadShedding]
-type loadBalancerPoolUpdateResponseLoadSheddingJSON struct {
- DefaultPercent apijson.Field
- DefaultPolicy apijson.Field
- SessionPercent apijson.Field
- SessionPolicy apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerPoolUpdateResponseLoadShedding) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerPoolUpdateResponseLoadSheddingJSON) RawJSON() string {
- return r.raw
-}
-
-// The default policy to use when load shedding. A random policy randomly sheds a
-// given percent of requests. A hash policy computes a hash over the
-// CF-Connecting-IP address and sheds all requests originating from a percent of
-// IPs.
-type LoadBalancerPoolUpdateResponseLoadSheddingDefaultPolicy string
-
-const (
- LoadBalancerPoolUpdateResponseLoadSheddingDefaultPolicyRandom LoadBalancerPoolUpdateResponseLoadSheddingDefaultPolicy = "random"
- LoadBalancerPoolUpdateResponseLoadSheddingDefaultPolicyHash LoadBalancerPoolUpdateResponseLoadSheddingDefaultPolicy = "hash"
-)
-
-// Only the hash policy is supported for existing sessions (to avoid exponential
-// decay).
-type LoadBalancerPoolUpdateResponseLoadSheddingSessionPolicy string
-
-const (
- LoadBalancerPoolUpdateResponseLoadSheddingSessionPolicyHash LoadBalancerPoolUpdateResponseLoadSheddingSessionPolicy = "hash"
-)
-
-// Filter pool and origin health notifications by resource type or health status.
-// Use null to reset.
-type LoadBalancerPoolUpdateResponseNotificationFilter struct {
- // Filter options for a particular resource type (pool or origin). Use null to
- // reset.
- Origin LoadBalancerPoolUpdateResponseNotificationFilterOrigin `json:"origin,nullable"`
- // Filter options for a particular resource type (pool or origin). Use null to
- // reset.
- Pool LoadBalancerPoolUpdateResponseNotificationFilterPool `json:"pool,nullable"`
- JSON loadBalancerPoolUpdateResponseNotificationFilterJSON `json:"-"`
-}
-
-// loadBalancerPoolUpdateResponseNotificationFilterJSON contains the JSON metadata
-// for the struct [LoadBalancerPoolUpdateResponseNotificationFilter]
-type loadBalancerPoolUpdateResponseNotificationFilterJSON struct {
- Origin apijson.Field
- Pool apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerPoolUpdateResponseNotificationFilter) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerPoolUpdateResponseNotificationFilterJSON) RawJSON() string {
- return r.raw
-}
-
-// Filter options for a particular resource type (pool or origin). Use null to
-// reset.
-type LoadBalancerPoolUpdateResponseNotificationFilterOrigin struct {
- // If set true, disable notifications for this type of resource (pool or origin).
- Disable bool `json:"disable"`
- // If present, send notifications only for this health status (e.g. false for only
- // DOWN events). Use null to reset (all events).
- Healthy bool `json:"healthy,nullable"`
- JSON loadBalancerPoolUpdateResponseNotificationFilterOriginJSON `json:"-"`
-}
-
-// loadBalancerPoolUpdateResponseNotificationFilterOriginJSON contains the JSON
-// metadata for the struct [LoadBalancerPoolUpdateResponseNotificationFilterOrigin]
-type loadBalancerPoolUpdateResponseNotificationFilterOriginJSON struct {
- Disable apijson.Field
- Healthy apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerPoolUpdateResponseNotificationFilterOrigin) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerPoolUpdateResponseNotificationFilterOriginJSON) RawJSON() string {
- return r.raw
-}
-
-// Filter options for a particular resource type (pool or origin). Use null to
-// reset.
-type LoadBalancerPoolUpdateResponseNotificationFilterPool struct {
- // If set true, disable notifications for this type of resource (pool or origin).
- Disable bool `json:"disable"`
- // If present, send notifications only for this health status (e.g. false for only
- // DOWN events). Use null to reset (all events).
- Healthy bool `json:"healthy,nullable"`
- JSON loadBalancerPoolUpdateResponseNotificationFilterPoolJSON `json:"-"`
-}
-
-// loadBalancerPoolUpdateResponseNotificationFilterPoolJSON contains the JSON
-// metadata for the struct [LoadBalancerPoolUpdateResponseNotificationFilterPool]
-type loadBalancerPoolUpdateResponseNotificationFilterPoolJSON struct {
- Disable apijson.Field
- Healthy apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerPoolUpdateResponseNotificationFilterPool) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerPoolUpdateResponseNotificationFilterPoolJSON) RawJSON() string {
- return r.raw
-}
-
-// Configures origin steering for the pool. Controls how origins are selected for
-// new sessions and traffic without session affinity.
-type LoadBalancerPoolUpdateResponseOriginSteering struct {
- // The type of origin steering policy to use.
- //
- // - `"random"`: Select an origin randomly.
- // - `"hash"`: Select an origin by computing a hash over the CF-Connecting-IP
- // address.
- // - `"least_outstanding_requests"`: Select an origin by taking into consideration
- // origin weights, as well as each origin's number of outstanding requests.
- // Origins with more pending requests are weighted proportionately less relative
- // to others.
- // - `"least_connections"`: Select an origin by taking into consideration origin
- // weights, as well as each origin's number of open connections. Origins with
- // more open connections are weighted proportionately less relative to others.
- // Supported for HTTP/1 and HTTP/2 connections.
- Policy LoadBalancerPoolUpdateResponseOriginSteeringPolicy `json:"policy"`
- JSON loadBalancerPoolUpdateResponseOriginSteeringJSON `json:"-"`
-}
-
-// loadBalancerPoolUpdateResponseOriginSteeringJSON contains the JSON metadata for
-// the struct [LoadBalancerPoolUpdateResponseOriginSteering]
-type loadBalancerPoolUpdateResponseOriginSteeringJSON struct {
- Policy apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerPoolUpdateResponseOriginSteering) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerPoolUpdateResponseOriginSteeringJSON) RawJSON() string {
- return r.raw
-}
-
-// The type of origin steering policy to use.
-//
-// - `"random"`: Select an origin randomly.
-// - `"hash"`: Select an origin by computing a hash over the CF-Connecting-IP
-// address.
-// - `"least_outstanding_requests"`: Select an origin by taking into consideration
-// origin weights, as well as each origin's number of outstanding requests.
-// Origins with more pending requests are weighted proportionately less relative
-// to others.
-// - `"least_connections"`: Select an origin by taking into consideration origin
-// weights, as well as each origin's number of open connections. Origins with
-// more open connections are weighted proportionately less relative to others.
-// Supported for HTTP/1 and HTTP/2 connections.
-type LoadBalancerPoolUpdateResponseOriginSteeringPolicy string
-
-const (
- LoadBalancerPoolUpdateResponseOriginSteeringPolicyRandom LoadBalancerPoolUpdateResponseOriginSteeringPolicy = "random"
- LoadBalancerPoolUpdateResponseOriginSteeringPolicyHash LoadBalancerPoolUpdateResponseOriginSteeringPolicy = "hash"
- LoadBalancerPoolUpdateResponseOriginSteeringPolicyLeastOutstandingRequests LoadBalancerPoolUpdateResponseOriginSteeringPolicy = "least_outstanding_requests"
- LoadBalancerPoolUpdateResponseOriginSteeringPolicyLeastConnections LoadBalancerPoolUpdateResponseOriginSteeringPolicy = "least_connections"
-)
-
-type LoadBalancerPoolUpdateResponseOrigin struct {
- // The IP address (IPv4 or IPv6) of the origin, or its publicly addressable
- // hostname. Hostnames entered here should resolve directly to the origin, and not
- // be a hostname proxied by Cloudflare. To set an internal/reserved address,
- // virtual_network_id must also be set.
- Address string `json:"address"`
- // This field shows up only if the origin is disabled. This field is set with the
- // time the origin was disabled.
- DisabledAt time.Time `json:"disabled_at" format:"date-time"`
- // Whether to enable (the default) this origin within the pool. Disabled origins
- // will not receive traffic and are excluded from health checks. The origin will
- // only be disabled for the current pool.
- Enabled bool `json:"enabled"`
- // The request header is used to pass additional information with an HTTP request.
- // Currently supported header is 'Host'.
- Header LoadBalancerPoolUpdateResponseOriginsHeader `json:"header"`
- // A human-identifiable name for the origin.
- Name string `json:"name"`
- // The virtual network subnet ID the origin belongs in. Virtual network must also
- // belong to the account.
- VirtualNetworkID string `json:"virtual_network_id"`
- // The weight of this origin relative to other origins in the pool. Based on the
- // configured weight the total traffic is distributed among origins within the
- // pool.
- //
- // - `origin_steering.policy="least_outstanding_requests"`: Use weight to scale the
- // origin's outstanding requests.
- // - `origin_steering.policy="least_connections"`: Use weight to scale the origin's
- // open connections.
- Weight float64 `json:"weight"`
- JSON loadBalancerPoolUpdateResponseOriginJSON `json:"-"`
-}
-
-// loadBalancerPoolUpdateResponseOriginJSON contains the JSON metadata for the
-// struct [LoadBalancerPoolUpdateResponseOrigin]
-type loadBalancerPoolUpdateResponseOriginJSON struct {
- Address apijson.Field
- DisabledAt apijson.Field
- Enabled apijson.Field
- Header apijson.Field
- Name apijson.Field
- VirtualNetworkID apijson.Field
- Weight apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerPoolUpdateResponseOrigin) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerPoolUpdateResponseOriginJSON) RawJSON() string {
- return r.raw
-}
-
-// The request header is used to pass additional information with an HTTP request.
-// Currently supported header is 'Host'.
-type LoadBalancerPoolUpdateResponseOriginsHeader struct {
- // The 'Host' header allows to override the hostname set in the HTTP request.
- // Current support is 1 'Host' header override per origin.
- Host []string `json:"Host"`
- JSON loadBalancerPoolUpdateResponseOriginsHeaderJSON `json:"-"`
-}
-
-// loadBalancerPoolUpdateResponseOriginsHeaderJSON contains the JSON metadata for
-// the struct [LoadBalancerPoolUpdateResponseOriginsHeader]
-type loadBalancerPoolUpdateResponseOriginsHeaderJSON struct {
- Host apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerPoolUpdateResponseOriginsHeader) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerPoolUpdateResponseOriginsHeaderJSON) RawJSON() string {
- return r.raw
-}
-
-type LoadBalancerPoolListResponse struct {
- ID string `json:"id"`
- // A list of regions from which to run health checks. Null means every Cloudflare
- // data center.
- CheckRegions []LoadBalancerPoolListResponseCheckRegion `json:"check_regions,nullable"`
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // A human-readable description of the pool.
- Description string `json:"description"`
- // This field shows up only if the pool is disabled. This field is set with the
- // time the pool was disabled at.
- DisabledAt time.Time `json:"disabled_at" format:"date-time"`
- // Whether to enable (the default) or disable this pool. Disabled pools will not
- // receive traffic and are excluded from health checks. Disabling a pool will cause
- // any load balancers using it to failover to the next pool (if any).
- Enabled bool `json:"enabled"`
- // The latitude of the data center containing the origins used in this pool in
- // decimal degrees. If this is set, longitude must also be set.
- Latitude float64 `json:"latitude"`
- // Configures load shedding policies and percentages for the pool.
- LoadShedding LoadBalancerPoolListResponseLoadShedding `json:"load_shedding"`
- // The longitude of the data center containing the origins used in this pool in
- // decimal degrees. If this is set, latitude must also be set.
- Longitude float64 `json:"longitude"`
- // The minimum number of origins that must be healthy for this pool to serve
- // traffic. If the number of healthy origins falls below this number, the pool will
- // be marked unhealthy and will failover to the next available pool.
- MinimumOrigins int64 `json:"minimum_origins"`
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // The ID of the Monitor to use for checking the health of origins within this
- // pool.
- Monitor interface{} `json:"monitor"`
- // A short name (tag) for the pool. Only alphanumeric characters, hyphens, and
- // underscores are allowed.
- Name string `json:"name"`
- // This field is now deprecated. It has been moved to Cloudflare's Centralized
- // Notification service
- // https://developers.cloudflare.com/fundamentals/notifications/. The email address
- // to send health status notifications to. This can be an individual mailbox or a
- // mailing list. Multiple emails can be supplied as a comma delimited list.
- NotificationEmail string `json:"notification_email"`
- // Filter pool and origin health notifications by resource type or health status.
- // Use null to reset.
- NotificationFilter LoadBalancerPoolListResponseNotificationFilter `json:"notification_filter,nullable"`
- // Configures origin steering for the pool. Controls how origins are selected for
- // new sessions and traffic without session affinity.
- OriginSteering LoadBalancerPoolListResponseOriginSteering `json:"origin_steering"`
- // The list of origins within this pool. Traffic directed at this pool is balanced
- // across all currently healthy origins, provided the pool itself is healthy.
- Origins []LoadBalancerPoolListResponseOrigin `json:"origins"`
- JSON loadBalancerPoolListResponseJSON `json:"-"`
-}
-
-// loadBalancerPoolListResponseJSON contains the JSON metadata for the struct
-// [LoadBalancerPoolListResponse]
-type loadBalancerPoolListResponseJSON struct {
- ID apijson.Field
- CheckRegions apijson.Field
- CreatedOn apijson.Field
- Description apijson.Field
- DisabledAt apijson.Field
- Enabled apijson.Field
- Latitude apijson.Field
- LoadShedding apijson.Field
- Longitude apijson.Field
- MinimumOrigins apijson.Field
- ModifiedOn apijson.Field
- Monitor apijson.Field
- Name apijson.Field
- NotificationEmail apijson.Field
- NotificationFilter apijson.Field
- OriginSteering apijson.Field
- Origins apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerPoolListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerPoolListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// WNAM: Western North America, ENAM: Eastern North America, WEU: Western Europe,
-// EEU: Eastern Europe, NSAM: Northern South America, SSAM: Southern South America,
-// OC: Oceania, ME: Middle East, NAF: North Africa, SAF: South Africa, SAS:
-// Southern Asia, SEAS: South East Asia, NEAS: North East Asia, ALL_REGIONS: all
-// regions (ENTERPRISE customers only).
-type LoadBalancerPoolListResponseCheckRegion string
-
-const (
- LoadBalancerPoolListResponseCheckRegionWnam LoadBalancerPoolListResponseCheckRegion = "WNAM"
- LoadBalancerPoolListResponseCheckRegionEnam LoadBalancerPoolListResponseCheckRegion = "ENAM"
- LoadBalancerPoolListResponseCheckRegionWeu LoadBalancerPoolListResponseCheckRegion = "WEU"
- LoadBalancerPoolListResponseCheckRegionEeu LoadBalancerPoolListResponseCheckRegion = "EEU"
- LoadBalancerPoolListResponseCheckRegionNsam LoadBalancerPoolListResponseCheckRegion = "NSAM"
- LoadBalancerPoolListResponseCheckRegionSsam LoadBalancerPoolListResponseCheckRegion = "SSAM"
- LoadBalancerPoolListResponseCheckRegionOc LoadBalancerPoolListResponseCheckRegion = "OC"
- LoadBalancerPoolListResponseCheckRegionMe LoadBalancerPoolListResponseCheckRegion = "ME"
- LoadBalancerPoolListResponseCheckRegionNaf LoadBalancerPoolListResponseCheckRegion = "NAF"
- LoadBalancerPoolListResponseCheckRegionSaf LoadBalancerPoolListResponseCheckRegion = "SAF"
- LoadBalancerPoolListResponseCheckRegionSas LoadBalancerPoolListResponseCheckRegion = "SAS"
- LoadBalancerPoolListResponseCheckRegionSeas LoadBalancerPoolListResponseCheckRegion = "SEAS"
- LoadBalancerPoolListResponseCheckRegionNeas LoadBalancerPoolListResponseCheckRegion = "NEAS"
- LoadBalancerPoolListResponseCheckRegionAllRegions LoadBalancerPoolListResponseCheckRegion = "ALL_REGIONS"
-)
-
-// Configures load shedding policies and percentages for the pool.
-type LoadBalancerPoolListResponseLoadShedding struct {
- // The percent of traffic to shed from the pool, according to the default policy.
- // Applies to new sessions and traffic without session affinity.
- DefaultPercent float64 `json:"default_percent"`
- // The default policy to use when load shedding. A random policy randomly sheds a
- // given percent of requests. A hash policy computes a hash over the
- // CF-Connecting-IP address and sheds all requests originating from a percent of
- // IPs.
- DefaultPolicy LoadBalancerPoolListResponseLoadSheddingDefaultPolicy `json:"default_policy"`
- // The percent of existing sessions to shed from the pool, according to the session
- // policy.
- SessionPercent float64 `json:"session_percent"`
- // Only the hash policy is supported for existing sessions (to avoid exponential
- // decay).
- SessionPolicy LoadBalancerPoolListResponseLoadSheddingSessionPolicy `json:"session_policy"`
- JSON loadBalancerPoolListResponseLoadSheddingJSON `json:"-"`
-}
-
-// loadBalancerPoolListResponseLoadSheddingJSON contains the JSON metadata for the
-// struct [LoadBalancerPoolListResponseLoadShedding]
-type loadBalancerPoolListResponseLoadSheddingJSON struct {
- DefaultPercent apijson.Field
- DefaultPolicy apijson.Field
- SessionPercent apijson.Field
- SessionPolicy apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerPoolListResponseLoadShedding) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerPoolListResponseLoadSheddingJSON) RawJSON() string {
- return r.raw
-}
-
-// The default policy to use when load shedding. A random policy randomly sheds a
-// given percent of requests. A hash policy computes a hash over the
-// CF-Connecting-IP address and sheds all requests originating from a percent of
-// IPs.
-type LoadBalancerPoolListResponseLoadSheddingDefaultPolicy string
-
-const (
- LoadBalancerPoolListResponseLoadSheddingDefaultPolicyRandom LoadBalancerPoolListResponseLoadSheddingDefaultPolicy = "random"
- LoadBalancerPoolListResponseLoadSheddingDefaultPolicyHash LoadBalancerPoolListResponseLoadSheddingDefaultPolicy = "hash"
-)
-
-// Only the hash policy is supported for existing sessions (to avoid exponential
-// decay).
-type LoadBalancerPoolListResponseLoadSheddingSessionPolicy string
-
-const (
- LoadBalancerPoolListResponseLoadSheddingSessionPolicyHash LoadBalancerPoolListResponseLoadSheddingSessionPolicy = "hash"
-)
-
-// Filter pool and origin health notifications by resource type or health status.
-// Use null to reset.
-type LoadBalancerPoolListResponseNotificationFilter struct {
- // Filter options for a particular resource type (pool or origin). Use null to
- // reset.
- Origin LoadBalancerPoolListResponseNotificationFilterOrigin `json:"origin,nullable"`
- // Filter options for a particular resource type (pool or origin). Use null to
- // reset.
- Pool LoadBalancerPoolListResponseNotificationFilterPool `json:"pool,nullable"`
- JSON loadBalancerPoolListResponseNotificationFilterJSON `json:"-"`
-}
-
-// loadBalancerPoolListResponseNotificationFilterJSON contains the JSON metadata
-// for the struct [LoadBalancerPoolListResponseNotificationFilter]
-type loadBalancerPoolListResponseNotificationFilterJSON struct {
- Origin apijson.Field
- Pool apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerPoolListResponseNotificationFilter) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerPoolListResponseNotificationFilterJSON) RawJSON() string {
- return r.raw
-}
-
-// Filter options for a particular resource type (pool or origin). Use null to
-// reset.
-type LoadBalancerPoolListResponseNotificationFilterOrigin struct {
- // If set true, disable notifications for this type of resource (pool or origin).
- Disable bool `json:"disable"`
- // If present, send notifications only for this health status (e.g. false for only
- // DOWN events). Use null to reset (all events).
- Healthy bool `json:"healthy,nullable"`
- JSON loadBalancerPoolListResponseNotificationFilterOriginJSON `json:"-"`
-}
-
-// loadBalancerPoolListResponseNotificationFilterOriginJSON contains the JSON
-// metadata for the struct [LoadBalancerPoolListResponseNotificationFilterOrigin]
-type loadBalancerPoolListResponseNotificationFilterOriginJSON struct {
- Disable apijson.Field
- Healthy apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerPoolListResponseNotificationFilterOrigin) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerPoolListResponseNotificationFilterOriginJSON) RawJSON() string {
- return r.raw
-}
-
-// Filter options for a particular resource type (pool or origin). Use null to
-// reset.
-type LoadBalancerPoolListResponseNotificationFilterPool struct {
- // If set true, disable notifications for this type of resource (pool or origin).
- Disable bool `json:"disable"`
- // If present, send notifications only for this health status (e.g. false for only
- // DOWN events). Use null to reset (all events).
- Healthy bool `json:"healthy,nullable"`
- JSON loadBalancerPoolListResponseNotificationFilterPoolJSON `json:"-"`
-}
-
-// loadBalancerPoolListResponseNotificationFilterPoolJSON contains the JSON
-// metadata for the struct [LoadBalancerPoolListResponseNotificationFilterPool]
-type loadBalancerPoolListResponseNotificationFilterPoolJSON struct {
- Disable apijson.Field
- Healthy apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerPoolListResponseNotificationFilterPool) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerPoolListResponseNotificationFilterPoolJSON) RawJSON() string {
- return r.raw
-}
-
-// Configures origin steering for the pool. Controls how origins are selected for
-// new sessions and traffic without session affinity.
-type LoadBalancerPoolListResponseOriginSteering struct {
- // The type of origin steering policy to use.
- //
- // - `"random"`: Select an origin randomly.
- // - `"hash"`: Select an origin by computing a hash over the CF-Connecting-IP
- // address.
- // - `"least_outstanding_requests"`: Select an origin by taking into consideration
- // origin weights, as well as each origin's number of outstanding requests.
- // Origins with more pending requests are weighted proportionately less relative
- // to others.
- // - `"least_connections"`: Select an origin by taking into consideration origin
- // weights, as well as each origin's number of open connections. Origins with
- // more open connections are weighted proportionately less relative to others.
- // Supported for HTTP/1 and HTTP/2 connections.
- Policy LoadBalancerPoolListResponseOriginSteeringPolicy `json:"policy"`
- JSON loadBalancerPoolListResponseOriginSteeringJSON `json:"-"`
-}
-
-// loadBalancerPoolListResponseOriginSteeringJSON contains the JSON metadata for
-// the struct [LoadBalancerPoolListResponseOriginSteering]
-type loadBalancerPoolListResponseOriginSteeringJSON struct {
- Policy apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerPoolListResponseOriginSteering) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerPoolListResponseOriginSteeringJSON) RawJSON() string {
- return r.raw
-}
-
-// The type of origin steering policy to use.
-//
-// - `"random"`: Select an origin randomly.
-// - `"hash"`: Select an origin by computing a hash over the CF-Connecting-IP
-// address.
-// - `"least_outstanding_requests"`: Select an origin by taking into consideration
-// origin weights, as well as each origin's number of outstanding requests.
-// Origins with more pending requests are weighted proportionately less relative
-// to others.
-// - `"least_connections"`: Select an origin by taking into consideration origin
-// weights, as well as each origin's number of open connections. Origins with
-// more open connections are weighted proportionately less relative to others.
-// Supported for HTTP/1 and HTTP/2 connections.
-type LoadBalancerPoolListResponseOriginSteeringPolicy string
-
-const (
- LoadBalancerPoolListResponseOriginSteeringPolicyRandom LoadBalancerPoolListResponseOriginSteeringPolicy = "random"
- LoadBalancerPoolListResponseOriginSteeringPolicyHash LoadBalancerPoolListResponseOriginSteeringPolicy = "hash"
- LoadBalancerPoolListResponseOriginSteeringPolicyLeastOutstandingRequests LoadBalancerPoolListResponseOriginSteeringPolicy = "least_outstanding_requests"
- LoadBalancerPoolListResponseOriginSteeringPolicyLeastConnections LoadBalancerPoolListResponseOriginSteeringPolicy = "least_connections"
-)
-
-type LoadBalancerPoolListResponseOrigin struct {
- // The IP address (IPv4 or IPv6) of the origin, or its publicly addressable
- // hostname. Hostnames entered here should resolve directly to the origin, and not
- // be a hostname proxied by Cloudflare. To set an internal/reserved address,
- // virtual_network_id must also be set.
- Address string `json:"address"`
- // This field shows up only if the origin is disabled. This field is set with the
- // time the origin was disabled.
- DisabledAt time.Time `json:"disabled_at" format:"date-time"`
- // Whether to enable (the default) this origin within the pool. Disabled origins
- // will not receive traffic and are excluded from health checks. The origin will
- // only be disabled for the current pool.
- Enabled bool `json:"enabled"`
- // The request header is used to pass additional information with an HTTP request.
- // Currently supported header is 'Host'.
- Header LoadBalancerPoolListResponseOriginsHeader `json:"header"`
- // A human-identifiable name for the origin.
- Name string `json:"name"`
- // The virtual network subnet ID the origin belongs in. Virtual network must also
- // belong to the account.
- VirtualNetworkID string `json:"virtual_network_id"`
- // The weight of this origin relative to other origins in the pool. Based on the
- // configured weight the total traffic is distributed among origins within the
- // pool.
- //
- // - `origin_steering.policy="least_outstanding_requests"`: Use weight to scale the
- // origin's outstanding requests.
- // - `origin_steering.policy="least_connections"`: Use weight to scale the origin's
- // open connections.
- Weight float64 `json:"weight"`
- JSON loadBalancerPoolListResponseOriginJSON `json:"-"`
-}
-
-// loadBalancerPoolListResponseOriginJSON contains the JSON metadata for the struct
-// [LoadBalancerPoolListResponseOrigin]
-type loadBalancerPoolListResponseOriginJSON struct {
- Address apijson.Field
- DisabledAt apijson.Field
- Enabled apijson.Field
- Header apijson.Field
- Name apijson.Field
- VirtualNetworkID apijson.Field
- Weight apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerPoolListResponseOrigin) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerPoolListResponseOriginJSON) RawJSON() string {
- return r.raw
-}
-
-// The request header is used to pass additional information with an HTTP request.
-// Currently supported header is 'Host'.
-type LoadBalancerPoolListResponseOriginsHeader struct {
- // The 'Host' header allows to override the hostname set in the HTTP request.
- // Current support is 1 'Host' header override per origin.
- Host []string `json:"Host"`
- JSON loadBalancerPoolListResponseOriginsHeaderJSON `json:"-"`
-}
-
-// loadBalancerPoolListResponseOriginsHeaderJSON contains the JSON metadata for the
-// struct [LoadBalancerPoolListResponseOriginsHeader]
-type loadBalancerPoolListResponseOriginsHeaderJSON struct {
- Host apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerPoolListResponseOriginsHeader) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerPoolListResponseOriginsHeaderJSON) RawJSON() string {
- return r.raw
-}
-
-type LoadBalancerPoolDeleteResponse struct {
- ID string `json:"id"`
- JSON loadBalancerPoolDeleteResponseJSON `json:"-"`
-}
-
-// loadBalancerPoolDeleteResponseJSON contains the JSON metadata for the struct
-// [LoadBalancerPoolDeleteResponse]
-type loadBalancerPoolDeleteResponseJSON struct {
- ID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerPoolDeleteResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerPoolDeleteResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type LoadBalancerPoolEditResponse struct {
- ID string `json:"id"`
- // A list of regions from which to run health checks. Null means every Cloudflare
- // data center.
- CheckRegions []LoadBalancerPoolEditResponseCheckRegion `json:"check_regions,nullable"`
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // A human-readable description of the pool.
- Description string `json:"description"`
- // This field shows up only if the pool is disabled. This field is set with the
- // time the pool was disabled at.
- DisabledAt time.Time `json:"disabled_at" format:"date-time"`
- // Whether to enable (the default) or disable this pool. Disabled pools will not
- // receive traffic and are excluded from health checks. Disabling a pool will cause
- // any load balancers using it to failover to the next pool (if any).
- Enabled bool `json:"enabled"`
- // The latitude of the data center containing the origins used in this pool in
- // decimal degrees. If this is set, longitude must also be set.
- Latitude float64 `json:"latitude"`
- // Configures load shedding policies and percentages for the pool.
- LoadShedding LoadBalancerPoolEditResponseLoadShedding `json:"load_shedding"`
- // The longitude of the data center containing the origins used in this pool in
- // decimal degrees. If this is set, latitude must also be set.
- Longitude float64 `json:"longitude"`
- // The minimum number of origins that must be healthy for this pool to serve
- // traffic. If the number of healthy origins falls below this number, the pool will
- // be marked unhealthy and will failover to the next available pool.
- MinimumOrigins int64 `json:"minimum_origins"`
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // The ID of the Monitor to use for checking the health of origins within this
- // pool.
- Monitor interface{} `json:"monitor"`
- // A short name (tag) for the pool. Only alphanumeric characters, hyphens, and
- // underscores are allowed.
- Name string `json:"name"`
- // This field is now deprecated. It has been moved to Cloudflare's Centralized
- // Notification service
- // https://developers.cloudflare.com/fundamentals/notifications/. The email address
- // to send health status notifications to. This can be an individual mailbox or a
- // mailing list. Multiple emails can be supplied as a comma delimited list.
- NotificationEmail string `json:"notification_email"`
- // Filter pool and origin health notifications by resource type or health status.
- // Use null to reset.
- NotificationFilter LoadBalancerPoolEditResponseNotificationFilter `json:"notification_filter,nullable"`
- // Configures origin steering for the pool. Controls how origins are selected for
- // new sessions and traffic without session affinity.
- OriginSteering LoadBalancerPoolEditResponseOriginSteering `json:"origin_steering"`
- // The list of origins within this pool. Traffic directed at this pool is balanced
- // across all currently healthy origins, provided the pool itself is healthy.
- Origins []LoadBalancerPoolEditResponseOrigin `json:"origins"`
- JSON loadBalancerPoolEditResponseJSON `json:"-"`
-}
-
-// loadBalancerPoolEditResponseJSON contains the JSON metadata for the struct
-// [LoadBalancerPoolEditResponse]
-type loadBalancerPoolEditResponseJSON struct {
- ID apijson.Field
- CheckRegions apijson.Field
- CreatedOn apijson.Field
- Description apijson.Field
- DisabledAt apijson.Field
- Enabled apijson.Field
- Latitude apijson.Field
- LoadShedding apijson.Field
- Longitude apijson.Field
- MinimumOrigins apijson.Field
- ModifiedOn apijson.Field
- Monitor apijson.Field
- Name apijson.Field
- NotificationEmail apijson.Field
- NotificationFilter apijson.Field
- OriginSteering apijson.Field
- Origins apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerPoolEditResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerPoolEditResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// WNAM: Western North America, ENAM: Eastern North America, WEU: Western Europe,
-// EEU: Eastern Europe, NSAM: Northern South America, SSAM: Southern South America,
-// OC: Oceania, ME: Middle East, NAF: North Africa, SAF: South Africa, SAS:
-// Southern Asia, SEAS: South East Asia, NEAS: North East Asia, ALL_REGIONS: all
-// regions (ENTERPRISE customers only).
-type LoadBalancerPoolEditResponseCheckRegion string
-
-const (
- LoadBalancerPoolEditResponseCheckRegionWnam LoadBalancerPoolEditResponseCheckRegion = "WNAM"
- LoadBalancerPoolEditResponseCheckRegionEnam LoadBalancerPoolEditResponseCheckRegion = "ENAM"
- LoadBalancerPoolEditResponseCheckRegionWeu LoadBalancerPoolEditResponseCheckRegion = "WEU"
- LoadBalancerPoolEditResponseCheckRegionEeu LoadBalancerPoolEditResponseCheckRegion = "EEU"
- LoadBalancerPoolEditResponseCheckRegionNsam LoadBalancerPoolEditResponseCheckRegion = "NSAM"
- LoadBalancerPoolEditResponseCheckRegionSsam LoadBalancerPoolEditResponseCheckRegion = "SSAM"
- LoadBalancerPoolEditResponseCheckRegionOc LoadBalancerPoolEditResponseCheckRegion = "OC"
- LoadBalancerPoolEditResponseCheckRegionMe LoadBalancerPoolEditResponseCheckRegion = "ME"
- LoadBalancerPoolEditResponseCheckRegionNaf LoadBalancerPoolEditResponseCheckRegion = "NAF"
- LoadBalancerPoolEditResponseCheckRegionSaf LoadBalancerPoolEditResponseCheckRegion = "SAF"
- LoadBalancerPoolEditResponseCheckRegionSas LoadBalancerPoolEditResponseCheckRegion = "SAS"
- LoadBalancerPoolEditResponseCheckRegionSeas LoadBalancerPoolEditResponseCheckRegion = "SEAS"
- LoadBalancerPoolEditResponseCheckRegionNeas LoadBalancerPoolEditResponseCheckRegion = "NEAS"
- LoadBalancerPoolEditResponseCheckRegionAllRegions LoadBalancerPoolEditResponseCheckRegion = "ALL_REGIONS"
-)
-
-// Configures load shedding policies and percentages for the pool.
-type LoadBalancerPoolEditResponseLoadShedding struct {
- // The percent of traffic to shed from the pool, according to the default policy.
- // Applies to new sessions and traffic without session affinity.
- DefaultPercent float64 `json:"default_percent"`
- // The default policy to use when load shedding. A random policy randomly sheds a
- // given percent of requests. A hash policy computes a hash over the
- // CF-Connecting-IP address and sheds all requests originating from a percent of
- // IPs.
- DefaultPolicy LoadBalancerPoolEditResponseLoadSheddingDefaultPolicy `json:"default_policy"`
- // The percent of existing sessions to shed from the pool, according to the session
- // policy.
- SessionPercent float64 `json:"session_percent"`
- // Only the hash policy is supported for existing sessions (to avoid exponential
- // decay).
- SessionPolicy LoadBalancerPoolEditResponseLoadSheddingSessionPolicy `json:"session_policy"`
- JSON loadBalancerPoolEditResponseLoadSheddingJSON `json:"-"`
-}
-
-// loadBalancerPoolEditResponseLoadSheddingJSON contains the JSON metadata for the
-// struct [LoadBalancerPoolEditResponseLoadShedding]
-type loadBalancerPoolEditResponseLoadSheddingJSON struct {
- DefaultPercent apijson.Field
- DefaultPolicy apijson.Field
- SessionPercent apijson.Field
- SessionPolicy apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerPoolEditResponseLoadShedding) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerPoolEditResponseLoadSheddingJSON) RawJSON() string {
- return r.raw
-}
-
-// The default policy to use when load shedding. A random policy randomly sheds a
-// given percent of requests. A hash policy computes a hash over the
-// CF-Connecting-IP address and sheds all requests originating from a percent of
-// IPs.
-type LoadBalancerPoolEditResponseLoadSheddingDefaultPolicy string
-
-const (
- LoadBalancerPoolEditResponseLoadSheddingDefaultPolicyRandom LoadBalancerPoolEditResponseLoadSheddingDefaultPolicy = "random"
- LoadBalancerPoolEditResponseLoadSheddingDefaultPolicyHash LoadBalancerPoolEditResponseLoadSheddingDefaultPolicy = "hash"
-)
-
-// Only the hash policy is supported for existing sessions (to avoid exponential
-// decay).
-type LoadBalancerPoolEditResponseLoadSheddingSessionPolicy string
-
-const (
- LoadBalancerPoolEditResponseLoadSheddingSessionPolicyHash LoadBalancerPoolEditResponseLoadSheddingSessionPolicy = "hash"
-)
-
-// Filter pool and origin health notifications by resource type or health status.
-// Use null to reset.
-type LoadBalancerPoolEditResponseNotificationFilter struct {
- // Filter options for a particular resource type (pool or origin). Use null to
- // reset.
- Origin LoadBalancerPoolEditResponseNotificationFilterOrigin `json:"origin,nullable"`
- // Filter options for a particular resource type (pool or origin). Use null to
- // reset.
- Pool LoadBalancerPoolEditResponseNotificationFilterPool `json:"pool,nullable"`
- JSON loadBalancerPoolEditResponseNotificationFilterJSON `json:"-"`
-}
-
-// loadBalancerPoolEditResponseNotificationFilterJSON contains the JSON metadata
-// for the struct [LoadBalancerPoolEditResponseNotificationFilter]
-type loadBalancerPoolEditResponseNotificationFilterJSON struct {
- Origin apijson.Field
- Pool apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerPoolEditResponseNotificationFilter) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerPoolEditResponseNotificationFilterJSON) RawJSON() string {
- return r.raw
-}
-
-// Filter options for a particular resource type (pool or origin). Use null to
-// reset.
-type LoadBalancerPoolEditResponseNotificationFilterOrigin struct {
- // If set true, disable notifications for this type of resource (pool or origin).
- Disable bool `json:"disable"`
- // If present, send notifications only for this health status (e.g. false for only
- // DOWN events). Use null to reset (all events).
- Healthy bool `json:"healthy,nullable"`
- JSON loadBalancerPoolEditResponseNotificationFilterOriginJSON `json:"-"`
-}
-
-// loadBalancerPoolEditResponseNotificationFilterOriginJSON contains the JSON
-// metadata for the struct [LoadBalancerPoolEditResponseNotificationFilterOrigin]
-type loadBalancerPoolEditResponseNotificationFilterOriginJSON struct {
- Disable apijson.Field
- Healthy apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerPoolEditResponseNotificationFilterOrigin) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerPoolEditResponseNotificationFilterOriginJSON) RawJSON() string {
- return r.raw
-}
-
-// Filter options for a particular resource type (pool or origin). Use null to
-// reset.
-type LoadBalancerPoolEditResponseNotificationFilterPool struct {
- // If set true, disable notifications for this type of resource (pool or origin).
- Disable bool `json:"disable"`
- // If present, send notifications only for this health status (e.g. false for only
- // DOWN events). Use null to reset (all events).
- Healthy bool `json:"healthy,nullable"`
- JSON loadBalancerPoolEditResponseNotificationFilterPoolJSON `json:"-"`
-}
-
-// loadBalancerPoolEditResponseNotificationFilterPoolJSON contains the JSON
-// metadata for the struct [LoadBalancerPoolEditResponseNotificationFilterPool]
-type loadBalancerPoolEditResponseNotificationFilterPoolJSON struct {
- Disable apijson.Field
- Healthy apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerPoolEditResponseNotificationFilterPool) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerPoolEditResponseNotificationFilterPoolJSON) RawJSON() string {
- return r.raw
-}
-
-// Configures origin steering for the pool. Controls how origins are selected for
-// new sessions and traffic without session affinity.
-type LoadBalancerPoolEditResponseOriginSteering struct {
- // The type of origin steering policy to use.
- //
- // - `"random"`: Select an origin randomly.
- // - `"hash"`: Select an origin by computing a hash over the CF-Connecting-IP
- // address.
- // - `"least_outstanding_requests"`: Select an origin by taking into consideration
- // origin weights, as well as each origin's number of outstanding requests.
- // Origins with more pending requests are weighted proportionately less relative
- // to others.
- // - `"least_connections"`: Select an origin by taking into consideration origin
- // weights, as well as each origin's number of open connections. Origins with
- // more open connections are weighted proportionately less relative to others.
- // Supported for HTTP/1 and HTTP/2 connections.
- Policy LoadBalancerPoolEditResponseOriginSteeringPolicy `json:"policy"`
- JSON loadBalancerPoolEditResponseOriginSteeringJSON `json:"-"`
-}
-
-// loadBalancerPoolEditResponseOriginSteeringJSON contains the JSON metadata for
-// the struct [LoadBalancerPoolEditResponseOriginSteering]
-type loadBalancerPoolEditResponseOriginSteeringJSON struct {
- Policy apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerPoolEditResponseOriginSteering) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerPoolEditResponseOriginSteeringJSON) RawJSON() string {
- return r.raw
-}
-
-// The type of origin steering policy to use.
-//
-// - `"random"`: Select an origin randomly.
-// - `"hash"`: Select an origin by computing a hash over the CF-Connecting-IP
-// address.
-// - `"least_outstanding_requests"`: Select an origin by taking into consideration
-// origin weights, as well as each origin's number of outstanding requests.
-// Origins with more pending requests are weighted proportionately less relative
-// to others.
-// - `"least_connections"`: Select an origin by taking into consideration origin
-// weights, as well as each origin's number of open connections. Origins with
-// more open connections are weighted proportionately less relative to others.
-// Supported for HTTP/1 and HTTP/2 connections.
-type LoadBalancerPoolEditResponseOriginSteeringPolicy string
-
-const (
- LoadBalancerPoolEditResponseOriginSteeringPolicyRandom LoadBalancerPoolEditResponseOriginSteeringPolicy = "random"
- LoadBalancerPoolEditResponseOriginSteeringPolicyHash LoadBalancerPoolEditResponseOriginSteeringPolicy = "hash"
- LoadBalancerPoolEditResponseOriginSteeringPolicyLeastOutstandingRequests LoadBalancerPoolEditResponseOriginSteeringPolicy = "least_outstanding_requests"
- LoadBalancerPoolEditResponseOriginSteeringPolicyLeastConnections LoadBalancerPoolEditResponseOriginSteeringPolicy = "least_connections"
-)
-
-type LoadBalancerPoolEditResponseOrigin struct {
- // The IP address (IPv4 or IPv6) of the origin, or its publicly addressable
- // hostname. Hostnames entered here should resolve directly to the origin, and not
- // be a hostname proxied by Cloudflare. To set an internal/reserved address,
- // virtual_network_id must also be set.
- Address string `json:"address"`
- // This field shows up only if the origin is disabled. This field is set with the
- // time the origin was disabled.
- DisabledAt time.Time `json:"disabled_at" format:"date-time"`
- // Whether to enable (the default) this origin within the pool. Disabled origins
- // will not receive traffic and are excluded from health checks. The origin will
- // only be disabled for the current pool.
- Enabled bool `json:"enabled"`
- // The request header is used to pass additional information with an HTTP request.
- // Currently supported header is 'Host'.
- Header LoadBalancerPoolEditResponseOriginsHeader `json:"header"`
- // A human-identifiable name for the origin.
- Name string `json:"name"`
- // The virtual network subnet ID the origin belongs in. Virtual network must also
- // belong to the account.
- VirtualNetworkID string `json:"virtual_network_id"`
- // The weight of this origin relative to other origins in the pool. Based on the
- // configured weight the total traffic is distributed among origins within the
- // pool.
- //
- // - `origin_steering.policy="least_outstanding_requests"`: Use weight to scale the
- // origin's outstanding requests.
- // - `origin_steering.policy="least_connections"`: Use weight to scale the origin's
- // open connections.
- Weight float64 `json:"weight"`
- JSON loadBalancerPoolEditResponseOriginJSON `json:"-"`
-}
-
-// loadBalancerPoolEditResponseOriginJSON contains the JSON metadata for the struct
-// [LoadBalancerPoolEditResponseOrigin]
-type loadBalancerPoolEditResponseOriginJSON struct {
- Address apijson.Field
- DisabledAt apijson.Field
- Enabled apijson.Field
- Header apijson.Field
- Name apijson.Field
- VirtualNetworkID apijson.Field
- Weight apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerPoolEditResponseOrigin) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerPoolEditResponseOriginJSON) RawJSON() string {
- return r.raw
-}
-
-// The request header is used to pass additional information with an HTTP request.
-// Currently supported header is 'Host'.
-type LoadBalancerPoolEditResponseOriginsHeader struct {
- // The 'Host' header allows to override the hostname set in the HTTP request.
- // Current support is 1 'Host' header override per origin.
- Host []string `json:"Host"`
- JSON loadBalancerPoolEditResponseOriginsHeaderJSON `json:"-"`
-}
-
-// loadBalancerPoolEditResponseOriginsHeaderJSON contains the JSON metadata for the
-// struct [LoadBalancerPoolEditResponseOriginsHeader]
-type loadBalancerPoolEditResponseOriginsHeaderJSON struct {
- Host apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerPoolEditResponseOriginsHeader) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerPoolEditResponseOriginsHeaderJSON) RawJSON() string {
- return r.raw
-}
-
-type LoadBalancerPoolGetResponse struct {
- ID string `json:"id"`
- // A list of regions from which to run health checks. Null means every Cloudflare
- // data center.
- CheckRegions []LoadBalancerPoolGetResponseCheckRegion `json:"check_regions,nullable"`
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // A human-readable description of the pool.
- Description string `json:"description"`
- // This field shows up only if the pool is disabled. This field is set with the
- // time the pool was disabled at.
- DisabledAt time.Time `json:"disabled_at" format:"date-time"`
- // Whether to enable (the default) or disable this pool. Disabled pools will not
- // receive traffic and are excluded from health checks. Disabling a pool will cause
- // any load balancers using it to failover to the next pool (if any).
- Enabled bool `json:"enabled"`
- // The latitude of the data center containing the origins used in this pool in
- // decimal degrees. If this is set, longitude must also be set.
- Latitude float64 `json:"latitude"`
- // Configures load shedding policies and percentages for the pool.
- LoadShedding LoadBalancerPoolGetResponseLoadShedding `json:"load_shedding"`
- // The longitude of the data center containing the origins used in this pool in
- // decimal degrees. If this is set, latitude must also be set.
- Longitude float64 `json:"longitude"`
- // The minimum number of origins that must be healthy for this pool to serve
- // traffic. If the number of healthy origins falls below this number, the pool will
- // be marked unhealthy and will failover to the next available pool.
- MinimumOrigins int64 `json:"minimum_origins"`
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // The ID of the Monitor to use for checking the health of origins within this
- // pool.
- Monitor interface{} `json:"monitor"`
- // A short name (tag) for the pool. Only alphanumeric characters, hyphens, and
- // underscores are allowed.
- Name string `json:"name"`
- // This field is now deprecated. It has been moved to Cloudflare's Centralized
- // Notification service
- // https://developers.cloudflare.com/fundamentals/notifications/. The email address
- // to send health status notifications to. This can be an individual mailbox or a
- // mailing list. Multiple emails can be supplied as a comma delimited list.
- NotificationEmail string `json:"notification_email"`
- // Filter pool and origin health notifications by resource type or health status.
- // Use null to reset.
- NotificationFilter LoadBalancerPoolGetResponseNotificationFilter `json:"notification_filter,nullable"`
- // Configures origin steering for the pool. Controls how origins are selected for
- // new sessions and traffic without session affinity.
- OriginSteering LoadBalancerPoolGetResponseOriginSteering `json:"origin_steering"`
- // The list of origins within this pool. Traffic directed at this pool is balanced
- // across all currently healthy origins, provided the pool itself is healthy.
- Origins []LoadBalancerPoolGetResponseOrigin `json:"origins"`
- JSON loadBalancerPoolGetResponseJSON `json:"-"`
-}
-
-// loadBalancerPoolGetResponseJSON contains the JSON metadata for the struct
-// [LoadBalancerPoolGetResponse]
-type loadBalancerPoolGetResponseJSON struct {
- ID apijson.Field
- CheckRegions apijson.Field
- CreatedOn apijson.Field
- Description apijson.Field
- DisabledAt apijson.Field
- Enabled apijson.Field
- Latitude apijson.Field
- LoadShedding apijson.Field
- Longitude apijson.Field
- MinimumOrigins apijson.Field
- ModifiedOn apijson.Field
- Monitor apijson.Field
- Name apijson.Field
- NotificationEmail apijson.Field
- NotificationFilter apijson.Field
- OriginSteering apijson.Field
- Origins apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerPoolGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerPoolGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// WNAM: Western North America, ENAM: Eastern North America, WEU: Western Europe,
-// EEU: Eastern Europe, NSAM: Northern South America, SSAM: Southern South America,
-// OC: Oceania, ME: Middle East, NAF: North Africa, SAF: South Africa, SAS:
-// Southern Asia, SEAS: South East Asia, NEAS: North East Asia, ALL_REGIONS: all
-// regions (ENTERPRISE customers only).
-type LoadBalancerPoolGetResponseCheckRegion string
-
-const (
- LoadBalancerPoolGetResponseCheckRegionWnam LoadBalancerPoolGetResponseCheckRegion = "WNAM"
- LoadBalancerPoolGetResponseCheckRegionEnam LoadBalancerPoolGetResponseCheckRegion = "ENAM"
- LoadBalancerPoolGetResponseCheckRegionWeu LoadBalancerPoolGetResponseCheckRegion = "WEU"
- LoadBalancerPoolGetResponseCheckRegionEeu LoadBalancerPoolGetResponseCheckRegion = "EEU"
- LoadBalancerPoolGetResponseCheckRegionNsam LoadBalancerPoolGetResponseCheckRegion = "NSAM"
- LoadBalancerPoolGetResponseCheckRegionSsam LoadBalancerPoolGetResponseCheckRegion = "SSAM"
- LoadBalancerPoolGetResponseCheckRegionOc LoadBalancerPoolGetResponseCheckRegion = "OC"
- LoadBalancerPoolGetResponseCheckRegionMe LoadBalancerPoolGetResponseCheckRegion = "ME"
- LoadBalancerPoolGetResponseCheckRegionNaf LoadBalancerPoolGetResponseCheckRegion = "NAF"
- LoadBalancerPoolGetResponseCheckRegionSaf LoadBalancerPoolGetResponseCheckRegion = "SAF"
- LoadBalancerPoolGetResponseCheckRegionSas LoadBalancerPoolGetResponseCheckRegion = "SAS"
- LoadBalancerPoolGetResponseCheckRegionSeas LoadBalancerPoolGetResponseCheckRegion = "SEAS"
- LoadBalancerPoolGetResponseCheckRegionNeas LoadBalancerPoolGetResponseCheckRegion = "NEAS"
- LoadBalancerPoolGetResponseCheckRegionAllRegions LoadBalancerPoolGetResponseCheckRegion = "ALL_REGIONS"
-)
-
-// Configures load shedding policies and percentages for the pool.
-type LoadBalancerPoolGetResponseLoadShedding struct {
- // The percent of traffic to shed from the pool, according to the default policy.
- // Applies to new sessions and traffic without session affinity.
- DefaultPercent float64 `json:"default_percent"`
- // The default policy to use when load shedding. A random policy randomly sheds a
- // given percent of requests. A hash policy computes a hash over the
- // CF-Connecting-IP address and sheds all requests originating from a percent of
- // IPs.
- DefaultPolicy LoadBalancerPoolGetResponseLoadSheddingDefaultPolicy `json:"default_policy"`
- // The percent of existing sessions to shed from the pool, according to the session
- // policy.
- SessionPercent float64 `json:"session_percent"`
- // Only the hash policy is supported for existing sessions (to avoid exponential
- // decay).
- SessionPolicy LoadBalancerPoolGetResponseLoadSheddingSessionPolicy `json:"session_policy"`
- JSON loadBalancerPoolGetResponseLoadSheddingJSON `json:"-"`
-}
-
-// loadBalancerPoolGetResponseLoadSheddingJSON contains the JSON metadata for the
-// struct [LoadBalancerPoolGetResponseLoadShedding]
-type loadBalancerPoolGetResponseLoadSheddingJSON struct {
- DefaultPercent apijson.Field
- DefaultPolicy apijson.Field
- SessionPercent apijson.Field
- SessionPolicy apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerPoolGetResponseLoadShedding) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerPoolGetResponseLoadSheddingJSON) RawJSON() string {
- return r.raw
-}
-
-// The default policy to use when load shedding. A random policy randomly sheds a
-// given percent of requests. A hash policy computes a hash over the
-// CF-Connecting-IP address and sheds all requests originating from a percent of
-// IPs.
-type LoadBalancerPoolGetResponseLoadSheddingDefaultPolicy string
-
-const (
- LoadBalancerPoolGetResponseLoadSheddingDefaultPolicyRandom LoadBalancerPoolGetResponseLoadSheddingDefaultPolicy = "random"
- LoadBalancerPoolGetResponseLoadSheddingDefaultPolicyHash LoadBalancerPoolGetResponseLoadSheddingDefaultPolicy = "hash"
-)
-
-// Only the hash policy is supported for existing sessions (to avoid exponential
-// decay).
-type LoadBalancerPoolGetResponseLoadSheddingSessionPolicy string
-
-const (
- LoadBalancerPoolGetResponseLoadSheddingSessionPolicyHash LoadBalancerPoolGetResponseLoadSheddingSessionPolicy = "hash"
-)
-
-// Filter pool and origin health notifications by resource type or health status.
-// Use null to reset.
-type LoadBalancerPoolGetResponseNotificationFilter struct {
- // Filter options for a particular resource type (pool or origin). Use null to
- // reset.
- Origin LoadBalancerPoolGetResponseNotificationFilterOrigin `json:"origin,nullable"`
- // Filter options for a particular resource type (pool or origin). Use null to
- // reset.
- Pool LoadBalancerPoolGetResponseNotificationFilterPool `json:"pool,nullable"`
- JSON loadBalancerPoolGetResponseNotificationFilterJSON `json:"-"`
-}
-
-// loadBalancerPoolGetResponseNotificationFilterJSON contains the JSON metadata for
-// the struct [LoadBalancerPoolGetResponseNotificationFilter]
-type loadBalancerPoolGetResponseNotificationFilterJSON struct {
- Origin apijson.Field
- Pool apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerPoolGetResponseNotificationFilter) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerPoolGetResponseNotificationFilterJSON) RawJSON() string {
- return r.raw
-}
-
-// Filter options for a particular resource type (pool or origin). Use null to
-// reset.
-type LoadBalancerPoolGetResponseNotificationFilterOrigin struct {
- // If set true, disable notifications for this type of resource (pool or origin).
- Disable bool `json:"disable"`
- // If present, send notifications only for this health status (e.g. false for only
- // DOWN events). Use null to reset (all events).
- Healthy bool `json:"healthy,nullable"`
- JSON loadBalancerPoolGetResponseNotificationFilterOriginJSON `json:"-"`
-}
-
-// loadBalancerPoolGetResponseNotificationFilterOriginJSON contains the JSON
-// metadata for the struct [LoadBalancerPoolGetResponseNotificationFilterOrigin]
-type loadBalancerPoolGetResponseNotificationFilterOriginJSON struct {
- Disable apijson.Field
- Healthy apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerPoolGetResponseNotificationFilterOrigin) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerPoolGetResponseNotificationFilterOriginJSON) RawJSON() string {
- return r.raw
-}
-
-// Filter options for a particular resource type (pool or origin). Use null to
-// reset.
-type LoadBalancerPoolGetResponseNotificationFilterPool struct {
- // If set true, disable notifications for this type of resource (pool or origin).
- Disable bool `json:"disable"`
- // If present, send notifications only for this health status (e.g. false for only
- // DOWN events). Use null to reset (all events).
- Healthy bool `json:"healthy,nullable"`
- JSON loadBalancerPoolGetResponseNotificationFilterPoolJSON `json:"-"`
-}
-
-// loadBalancerPoolGetResponseNotificationFilterPoolJSON contains the JSON metadata
-// for the struct [LoadBalancerPoolGetResponseNotificationFilterPool]
-type loadBalancerPoolGetResponseNotificationFilterPoolJSON struct {
- Disable apijson.Field
- Healthy apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerPoolGetResponseNotificationFilterPool) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerPoolGetResponseNotificationFilterPoolJSON) RawJSON() string {
- return r.raw
-}
-
-// Configures origin steering for the pool. Controls how origins are selected for
-// new sessions and traffic without session affinity.
-type LoadBalancerPoolGetResponseOriginSteering struct {
- // The type of origin steering policy to use.
- //
- // - `"random"`: Select an origin randomly.
- // - `"hash"`: Select an origin by computing a hash over the CF-Connecting-IP
- // address.
- // - `"least_outstanding_requests"`: Select an origin by taking into consideration
- // origin weights, as well as each origin's number of outstanding requests.
- // Origins with more pending requests are weighted proportionately less relative
- // to others.
- // - `"least_connections"`: Select an origin by taking into consideration origin
- // weights, as well as each origin's number of open connections. Origins with
- // more open connections are weighted proportionately less relative to others.
- // Supported for HTTP/1 and HTTP/2 connections.
- Policy LoadBalancerPoolGetResponseOriginSteeringPolicy `json:"policy"`
- JSON loadBalancerPoolGetResponseOriginSteeringJSON `json:"-"`
-}
-
-// loadBalancerPoolGetResponseOriginSteeringJSON contains the JSON metadata for the
-// struct [LoadBalancerPoolGetResponseOriginSteering]
-type loadBalancerPoolGetResponseOriginSteeringJSON struct {
- Policy apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerPoolGetResponseOriginSteering) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerPoolGetResponseOriginSteeringJSON) RawJSON() string {
- return r.raw
-}
-
-// The type of origin steering policy to use.
-//
-// - `"random"`: Select an origin randomly.
-// - `"hash"`: Select an origin by computing a hash over the CF-Connecting-IP
-// address.
-// - `"least_outstanding_requests"`: Select an origin by taking into consideration
-// origin weights, as well as each origin's number of outstanding requests.
-// Origins with more pending requests are weighted proportionately less relative
-// to others.
-// - `"least_connections"`: Select an origin by taking into consideration origin
-// weights, as well as each origin's number of open connections. Origins with
-// more open connections are weighted proportionately less relative to others.
-// Supported for HTTP/1 and HTTP/2 connections.
-type LoadBalancerPoolGetResponseOriginSteeringPolicy string
-
-const (
- LoadBalancerPoolGetResponseOriginSteeringPolicyRandom LoadBalancerPoolGetResponseOriginSteeringPolicy = "random"
- LoadBalancerPoolGetResponseOriginSteeringPolicyHash LoadBalancerPoolGetResponseOriginSteeringPolicy = "hash"
- LoadBalancerPoolGetResponseOriginSteeringPolicyLeastOutstandingRequests LoadBalancerPoolGetResponseOriginSteeringPolicy = "least_outstanding_requests"
- LoadBalancerPoolGetResponseOriginSteeringPolicyLeastConnections LoadBalancerPoolGetResponseOriginSteeringPolicy = "least_connections"
-)
-
-type LoadBalancerPoolGetResponseOrigin struct {
- // The IP address (IPv4 or IPv6) of the origin, or its publicly addressable
- // hostname. Hostnames entered here should resolve directly to the origin, and not
- // be a hostname proxied by Cloudflare. To set an internal/reserved address,
- // virtual_network_id must also be set.
- Address string `json:"address"`
- // This field shows up only if the origin is disabled. This field is set with the
- // time the origin was disabled.
- DisabledAt time.Time `json:"disabled_at" format:"date-time"`
- // Whether to enable (the default) this origin within the pool. Disabled origins
- // will not receive traffic and are excluded from health checks. The origin will
- // only be disabled for the current pool.
- Enabled bool `json:"enabled"`
- // The request header is used to pass additional information with an HTTP request.
- // Currently supported header is 'Host'.
- Header LoadBalancerPoolGetResponseOriginsHeader `json:"header"`
- // A human-identifiable name for the origin.
- Name string `json:"name"`
- // The virtual network subnet ID the origin belongs in. Virtual network must also
- // belong to the account.
- VirtualNetworkID string `json:"virtual_network_id"`
- // The weight of this origin relative to other origins in the pool. Based on the
- // configured weight the total traffic is distributed among origins within the
- // pool.
- //
- // - `origin_steering.policy="least_outstanding_requests"`: Use weight to scale the
- // origin's outstanding requests.
- // - `origin_steering.policy="least_connections"`: Use weight to scale the origin's
- // open connections.
- Weight float64 `json:"weight"`
- JSON loadBalancerPoolGetResponseOriginJSON `json:"-"`
-}
-
-// loadBalancerPoolGetResponseOriginJSON contains the JSON metadata for the struct
-// [LoadBalancerPoolGetResponseOrigin]
-type loadBalancerPoolGetResponseOriginJSON struct {
- Address apijson.Field
- DisabledAt apijson.Field
- Enabled apijson.Field
- Header apijson.Field
- Name apijson.Field
- VirtualNetworkID apijson.Field
- Weight apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerPoolGetResponseOrigin) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerPoolGetResponseOriginJSON) RawJSON() string {
- return r.raw
-}
-
-// The request header is used to pass additional information with an HTTP request.
-// Currently supported header is 'Host'.
-type LoadBalancerPoolGetResponseOriginsHeader struct {
- // The 'Host' header allows to override the hostname set in the HTTP request.
- // Current support is 1 'Host' header override per origin.
- Host []string `json:"Host"`
- JSON loadBalancerPoolGetResponseOriginsHeaderJSON `json:"-"`
-}
-
-// loadBalancerPoolGetResponseOriginsHeaderJSON contains the JSON metadata for the
-// struct [LoadBalancerPoolGetResponseOriginsHeader]
-type loadBalancerPoolGetResponseOriginsHeaderJSON struct {
- Host apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerPoolGetResponseOriginsHeader) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerPoolGetResponseOriginsHeaderJSON) RawJSON() string {
- return r.raw
-}
-
-type LoadBalancerPoolNewParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
- // A short name (tag) for the pool. Only alphanumeric characters, hyphens, and
- // underscores are allowed.
- Name param.Field[string] `json:"name,required"`
- // The list of origins within this pool. Traffic directed at this pool is balanced
- // across all currently healthy origins, provided the pool itself is healthy.
- Origins param.Field[[]LoadBalancerPoolNewParamsOrigin] `json:"origins,required"`
- // A human-readable description of the pool.
- Description param.Field[string] `json:"description"`
- // Whether to enable (the default) or disable this pool. Disabled pools will not
- // receive traffic and are excluded from health checks. Disabling a pool will cause
- // any load balancers using it to failover to the next pool (if any).
- Enabled param.Field[bool] `json:"enabled"`
- // The latitude of the data center containing the origins used in this pool in
- // decimal degrees. If this is set, longitude must also be set.
- Latitude param.Field[float64] `json:"latitude"`
- // Configures load shedding policies and percentages for the pool.
- LoadShedding param.Field[LoadBalancerPoolNewParamsLoadShedding] `json:"load_shedding"`
- // The longitude of the data center containing the origins used in this pool in
- // decimal degrees. If this is set, latitude must also be set.
- Longitude param.Field[float64] `json:"longitude"`
- // The minimum number of origins that must be healthy for this pool to serve
- // traffic. If the number of healthy origins falls below this number, the pool will
- // be marked unhealthy and will failover to the next available pool.
- MinimumOrigins param.Field[int64] `json:"minimum_origins"`
- // The ID of the Monitor to use for checking the health of origins within this
- // pool.
- Monitor param.Field[interface{}] `json:"monitor"`
- // This field is now deprecated. It has been moved to Cloudflare's Centralized
- // Notification service
- // https://developers.cloudflare.com/fundamentals/notifications/. The email address
- // to send health status notifications to. This can be an individual mailbox or a
- // mailing list. Multiple emails can be supplied as a comma delimited list.
- NotificationEmail param.Field[string] `json:"notification_email"`
- // Filter pool and origin health notifications by resource type or health status.
- // Use null to reset.
- NotificationFilter param.Field[LoadBalancerPoolNewParamsNotificationFilter] `json:"notification_filter"`
- // Configures origin steering for the pool. Controls how origins are selected for
- // new sessions and traffic without session affinity.
- OriginSteering param.Field[LoadBalancerPoolNewParamsOriginSteering] `json:"origin_steering"`
-}
-
-func (r LoadBalancerPoolNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type LoadBalancerPoolNewParamsOrigin struct {
- // The IP address (IPv4 or IPv6) of the origin, or its publicly addressable
- // hostname. Hostnames entered here should resolve directly to the origin, and not
- // be a hostname proxied by Cloudflare. To set an internal/reserved address,
- // virtual_network_id must also be set.
- Address param.Field[string] `json:"address"`
- // Whether to enable (the default) this origin within the pool. Disabled origins
- // will not receive traffic and are excluded from health checks. The origin will
- // only be disabled for the current pool.
- Enabled param.Field[bool] `json:"enabled"`
- // The request header is used to pass additional information with an HTTP request.
- // Currently supported header is 'Host'.
- Header param.Field[LoadBalancerPoolNewParamsOriginsHeader] `json:"header"`
- // A human-identifiable name for the origin.
- Name param.Field[string] `json:"name"`
- // The virtual network subnet ID the origin belongs in. Virtual network must also
- // belong to the account.
- VirtualNetworkID param.Field[string] `json:"virtual_network_id"`
- // The weight of this origin relative to other origins in the pool. Based on the
- // configured weight the total traffic is distributed among origins within the
- // pool.
- //
- // - `origin_steering.policy="least_outstanding_requests"`: Use weight to scale the
- // origin's outstanding requests.
- // - `origin_steering.policy="least_connections"`: Use weight to scale the origin's
- // open connections.
- Weight param.Field[float64] `json:"weight"`
-}
-
-func (r LoadBalancerPoolNewParamsOrigin) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The request header is used to pass additional information with an HTTP request.
-// Currently supported header is 'Host'.
-type LoadBalancerPoolNewParamsOriginsHeader struct {
- // The 'Host' header allows to override the hostname set in the HTTP request.
- // Current support is 1 'Host' header override per origin.
- Host param.Field[[]string] `json:"Host"`
-}
-
-func (r LoadBalancerPoolNewParamsOriginsHeader) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Configures load shedding policies and percentages for the pool.
-type LoadBalancerPoolNewParamsLoadShedding struct {
- // The percent of traffic to shed from the pool, according to the default policy.
- // Applies to new sessions and traffic without session affinity.
- DefaultPercent param.Field[float64] `json:"default_percent"`
- // The default policy to use when load shedding. A random policy randomly sheds a
- // given percent of requests. A hash policy computes a hash over the
- // CF-Connecting-IP address and sheds all requests originating from a percent of
- // IPs.
- DefaultPolicy param.Field[LoadBalancerPoolNewParamsLoadSheddingDefaultPolicy] `json:"default_policy"`
- // The percent of existing sessions to shed from the pool, according to the session
- // policy.
- SessionPercent param.Field[float64] `json:"session_percent"`
- // Only the hash policy is supported for existing sessions (to avoid exponential
- // decay).
- SessionPolicy param.Field[LoadBalancerPoolNewParamsLoadSheddingSessionPolicy] `json:"session_policy"`
-}
-
-func (r LoadBalancerPoolNewParamsLoadShedding) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The default policy to use when load shedding. A random policy randomly sheds a
-// given percent of requests. A hash policy computes a hash over the
-// CF-Connecting-IP address and sheds all requests originating from a percent of
-// IPs.
-type LoadBalancerPoolNewParamsLoadSheddingDefaultPolicy string
-
-const (
- LoadBalancerPoolNewParamsLoadSheddingDefaultPolicyRandom LoadBalancerPoolNewParamsLoadSheddingDefaultPolicy = "random"
- LoadBalancerPoolNewParamsLoadSheddingDefaultPolicyHash LoadBalancerPoolNewParamsLoadSheddingDefaultPolicy = "hash"
-)
-
-// Only the hash policy is supported for existing sessions (to avoid exponential
-// decay).
-type LoadBalancerPoolNewParamsLoadSheddingSessionPolicy string
-
-const (
- LoadBalancerPoolNewParamsLoadSheddingSessionPolicyHash LoadBalancerPoolNewParamsLoadSheddingSessionPolicy = "hash"
-)
-
-// Filter pool and origin health notifications by resource type or health status.
-// Use null to reset.
-type LoadBalancerPoolNewParamsNotificationFilter struct {
- // Filter options for a particular resource type (pool or origin). Use null to
- // reset.
- Origin param.Field[LoadBalancerPoolNewParamsNotificationFilterOrigin] `json:"origin"`
- // Filter options for a particular resource type (pool or origin). Use null to
- // reset.
- Pool param.Field[LoadBalancerPoolNewParamsNotificationFilterPool] `json:"pool"`
-}
-
-func (r LoadBalancerPoolNewParamsNotificationFilter) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Filter options for a particular resource type (pool or origin). Use null to
-// reset.
-type LoadBalancerPoolNewParamsNotificationFilterOrigin struct {
- // If set true, disable notifications for this type of resource (pool or origin).
- Disable param.Field[bool] `json:"disable"`
- // If present, send notifications only for this health status (e.g. false for only
- // DOWN events). Use null to reset (all events).
- Healthy param.Field[bool] `json:"healthy"`
-}
-
-func (r LoadBalancerPoolNewParamsNotificationFilterOrigin) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Filter options for a particular resource type (pool or origin). Use null to
-// reset.
-type LoadBalancerPoolNewParamsNotificationFilterPool struct {
- // If set true, disable notifications for this type of resource (pool or origin).
- Disable param.Field[bool] `json:"disable"`
- // If present, send notifications only for this health status (e.g. false for only
- // DOWN events). Use null to reset (all events).
- Healthy param.Field[bool] `json:"healthy"`
-}
-
-func (r LoadBalancerPoolNewParamsNotificationFilterPool) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Configures origin steering for the pool. Controls how origins are selected for
-// new sessions and traffic without session affinity.
-type LoadBalancerPoolNewParamsOriginSteering struct {
- // The type of origin steering policy to use.
- //
- // - `"random"`: Select an origin randomly.
- // - `"hash"`: Select an origin by computing a hash over the CF-Connecting-IP
- // address.
- // - `"least_outstanding_requests"`: Select an origin by taking into consideration
- // origin weights, as well as each origin's number of outstanding requests.
- // Origins with more pending requests are weighted proportionately less relative
- // to others.
- // - `"least_connections"`: Select an origin by taking into consideration origin
- // weights, as well as each origin's number of open connections. Origins with
- // more open connections are weighted proportionately less relative to others.
- // Supported for HTTP/1 and HTTP/2 connections.
- Policy param.Field[LoadBalancerPoolNewParamsOriginSteeringPolicy] `json:"policy"`
-}
-
-func (r LoadBalancerPoolNewParamsOriginSteering) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The type of origin steering policy to use.
-//
-// - `"random"`: Select an origin randomly.
-// - `"hash"`: Select an origin by computing a hash over the CF-Connecting-IP
-// address.
-// - `"least_outstanding_requests"`: Select an origin by taking into consideration
-// origin weights, as well as each origin's number of outstanding requests.
-// Origins with more pending requests are weighted proportionately less relative
-// to others.
-// - `"least_connections"`: Select an origin by taking into consideration origin
-// weights, as well as each origin's number of open connections. Origins with
-// more open connections are weighted proportionately less relative to others.
-// Supported for HTTP/1 and HTTP/2 connections.
-type LoadBalancerPoolNewParamsOriginSteeringPolicy string
-
-const (
- LoadBalancerPoolNewParamsOriginSteeringPolicyRandom LoadBalancerPoolNewParamsOriginSteeringPolicy = "random"
- LoadBalancerPoolNewParamsOriginSteeringPolicyHash LoadBalancerPoolNewParamsOriginSteeringPolicy = "hash"
- LoadBalancerPoolNewParamsOriginSteeringPolicyLeastOutstandingRequests LoadBalancerPoolNewParamsOriginSteeringPolicy = "least_outstanding_requests"
- LoadBalancerPoolNewParamsOriginSteeringPolicyLeastConnections LoadBalancerPoolNewParamsOriginSteeringPolicy = "least_connections"
-)
-
-type LoadBalancerPoolNewResponseEnvelope struct {
- Errors []LoadBalancerPoolNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []LoadBalancerPoolNewResponseEnvelopeMessages `json:"messages,required"`
- Result LoadBalancerPoolNewResponse `json:"result,required"`
- // Whether the API call was successful
- Success LoadBalancerPoolNewResponseEnvelopeSuccess `json:"success,required"`
- JSON loadBalancerPoolNewResponseEnvelopeJSON `json:"-"`
-}
-
-// loadBalancerPoolNewResponseEnvelopeJSON contains the JSON metadata for the
-// struct [LoadBalancerPoolNewResponseEnvelope]
-type loadBalancerPoolNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerPoolNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerPoolNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type LoadBalancerPoolNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON loadBalancerPoolNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// loadBalancerPoolNewResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [LoadBalancerPoolNewResponseEnvelopeErrors]
-type loadBalancerPoolNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerPoolNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerPoolNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type LoadBalancerPoolNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON loadBalancerPoolNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// loadBalancerPoolNewResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [LoadBalancerPoolNewResponseEnvelopeMessages]
-type loadBalancerPoolNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerPoolNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerPoolNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type LoadBalancerPoolNewResponseEnvelopeSuccess bool
-
-const (
- LoadBalancerPoolNewResponseEnvelopeSuccessTrue LoadBalancerPoolNewResponseEnvelopeSuccess = true
-)
-
-type LoadBalancerPoolUpdateParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
- // A short name (tag) for the pool. Only alphanumeric characters, hyphens, and
- // underscores are allowed.
- Name param.Field[string] `json:"name,required"`
- // The list of origins within this pool. Traffic directed at this pool is balanced
- // across all currently healthy origins, provided the pool itself is healthy.
- Origins param.Field[[]LoadBalancerPoolUpdateParamsOrigin] `json:"origins,required"`
- // A list of regions from which to run health checks. Null means every Cloudflare
- // data center.
- CheckRegions param.Field[[]LoadBalancerPoolUpdateParamsCheckRegion] `json:"check_regions"`
- // A human-readable description of the pool.
- Description param.Field[string] `json:"description"`
- // Whether to enable (the default) or disable this pool. Disabled pools will not
- // receive traffic and are excluded from health checks. Disabling a pool will cause
- // any load balancers using it to failover to the next pool (if any).
- Enabled param.Field[bool] `json:"enabled"`
- // The latitude of the data center containing the origins used in this pool in
- // decimal degrees. If this is set, longitude must also be set.
- Latitude param.Field[float64] `json:"latitude"`
- // Configures load shedding policies and percentages for the pool.
- LoadShedding param.Field[LoadBalancerPoolUpdateParamsLoadShedding] `json:"load_shedding"`
- // The longitude of the data center containing the origins used in this pool in
- // decimal degrees. If this is set, latitude must also be set.
- Longitude param.Field[float64] `json:"longitude"`
- // The minimum number of origins that must be healthy for this pool to serve
- // traffic. If the number of healthy origins falls below this number, the pool will
- // be marked unhealthy and will failover to the next available pool.
- MinimumOrigins param.Field[int64] `json:"minimum_origins"`
- // The ID of the Monitor to use for checking the health of origins within this
- // pool.
- Monitor param.Field[interface{}] `json:"monitor"`
- // This field is now deprecated. It has been moved to Cloudflare's Centralized
- // Notification service
- // https://developers.cloudflare.com/fundamentals/notifications/. The email address
- // to send health status notifications to. This can be an individual mailbox or a
- // mailing list. Multiple emails can be supplied as a comma delimited list.
- NotificationEmail param.Field[string] `json:"notification_email"`
- // Filter pool and origin health notifications by resource type or health status.
- // Use null to reset.
- NotificationFilter param.Field[LoadBalancerPoolUpdateParamsNotificationFilter] `json:"notification_filter"`
- // Configures origin steering for the pool. Controls how origins are selected for
- // new sessions and traffic without session affinity.
- OriginSteering param.Field[LoadBalancerPoolUpdateParamsOriginSteering] `json:"origin_steering"`
-}
-
-func (r LoadBalancerPoolUpdateParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type LoadBalancerPoolUpdateParamsOrigin struct {
- // The IP address (IPv4 or IPv6) of the origin, or its publicly addressable
- // hostname. Hostnames entered here should resolve directly to the origin, and not
- // be a hostname proxied by Cloudflare. To set an internal/reserved address,
- // virtual_network_id must also be set.
- Address param.Field[string] `json:"address"`
- // Whether to enable (the default) this origin within the pool. Disabled origins
- // will not receive traffic and are excluded from health checks. The origin will
- // only be disabled for the current pool.
- Enabled param.Field[bool] `json:"enabled"`
- // The request header is used to pass additional information with an HTTP request.
- // Currently supported header is 'Host'.
- Header param.Field[LoadBalancerPoolUpdateParamsOriginsHeader] `json:"header"`
- // A human-identifiable name for the origin.
- Name param.Field[string] `json:"name"`
- // The virtual network subnet ID the origin belongs in. Virtual network must also
- // belong to the account.
- VirtualNetworkID param.Field[string] `json:"virtual_network_id"`
- // The weight of this origin relative to other origins in the pool. Based on the
- // configured weight the total traffic is distributed among origins within the
- // pool.
- //
- // - `origin_steering.policy="least_outstanding_requests"`: Use weight to scale the
- // origin's outstanding requests.
- // - `origin_steering.policy="least_connections"`: Use weight to scale the origin's
- // open connections.
- Weight param.Field[float64] `json:"weight"`
-}
-
-func (r LoadBalancerPoolUpdateParamsOrigin) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The request header is used to pass additional information with an HTTP request.
-// Currently supported header is 'Host'.
-type LoadBalancerPoolUpdateParamsOriginsHeader struct {
- // The 'Host' header allows to override the hostname set in the HTTP request.
- // Current support is 1 'Host' header override per origin.
- Host param.Field[[]string] `json:"Host"`
-}
-
-func (r LoadBalancerPoolUpdateParamsOriginsHeader) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// WNAM: Western North America, ENAM: Eastern North America, WEU: Western Europe,
-// EEU: Eastern Europe, NSAM: Northern South America, SSAM: Southern South America,
-// OC: Oceania, ME: Middle East, NAF: North Africa, SAF: South Africa, SAS:
-// Southern Asia, SEAS: South East Asia, NEAS: North East Asia, ALL_REGIONS: all
-// regions (ENTERPRISE customers only).
-type LoadBalancerPoolUpdateParamsCheckRegion string
-
-const (
- LoadBalancerPoolUpdateParamsCheckRegionWnam LoadBalancerPoolUpdateParamsCheckRegion = "WNAM"
- LoadBalancerPoolUpdateParamsCheckRegionEnam LoadBalancerPoolUpdateParamsCheckRegion = "ENAM"
- LoadBalancerPoolUpdateParamsCheckRegionWeu LoadBalancerPoolUpdateParamsCheckRegion = "WEU"
- LoadBalancerPoolUpdateParamsCheckRegionEeu LoadBalancerPoolUpdateParamsCheckRegion = "EEU"
- LoadBalancerPoolUpdateParamsCheckRegionNsam LoadBalancerPoolUpdateParamsCheckRegion = "NSAM"
- LoadBalancerPoolUpdateParamsCheckRegionSsam LoadBalancerPoolUpdateParamsCheckRegion = "SSAM"
- LoadBalancerPoolUpdateParamsCheckRegionOc LoadBalancerPoolUpdateParamsCheckRegion = "OC"
- LoadBalancerPoolUpdateParamsCheckRegionMe LoadBalancerPoolUpdateParamsCheckRegion = "ME"
- LoadBalancerPoolUpdateParamsCheckRegionNaf LoadBalancerPoolUpdateParamsCheckRegion = "NAF"
- LoadBalancerPoolUpdateParamsCheckRegionSaf LoadBalancerPoolUpdateParamsCheckRegion = "SAF"
- LoadBalancerPoolUpdateParamsCheckRegionSas LoadBalancerPoolUpdateParamsCheckRegion = "SAS"
- LoadBalancerPoolUpdateParamsCheckRegionSeas LoadBalancerPoolUpdateParamsCheckRegion = "SEAS"
- LoadBalancerPoolUpdateParamsCheckRegionNeas LoadBalancerPoolUpdateParamsCheckRegion = "NEAS"
- LoadBalancerPoolUpdateParamsCheckRegionAllRegions LoadBalancerPoolUpdateParamsCheckRegion = "ALL_REGIONS"
-)
-
-// Configures load shedding policies and percentages for the pool.
-type LoadBalancerPoolUpdateParamsLoadShedding struct {
- // The percent of traffic to shed from the pool, according to the default policy.
- // Applies to new sessions and traffic without session affinity.
- DefaultPercent param.Field[float64] `json:"default_percent"`
- // The default policy to use when load shedding. A random policy randomly sheds a
- // given percent of requests. A hash policy computes a hash over the
- // CF-Connecting-IP address and sheds all requests originating from a percent of
- // IPs.
- DefaultPolicy param.Field[LoadBalancerPoolUpdateParamsLoadSheddingDefaultPolicy] `json:"default_policy"`
- // The percent of existing sessions to shed from the pool, according to the session
- // policy.
- SessionPercent param.Field[float64] `json:"session_percent"`
- // Only the hash policy is supported for existing sessions (to avoid exponential
- // decay).
- SessionPolicy param.Field[LoadBalancerPoolUpdateParamsLoadSheddingSessionPolicy] `json:"session_policy"`
-}
-
-func (r LoadBalancerPoolUpdateParamsLoadShedding) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The default policy to use when load shedding. A random policy randomly sheds a
-// given percent of requests. A hash policy computes a hash over the
-// CF-Connecting-IP address and sheds all requests originating from a percent of
-// IPs.
-type LoadBalancerPoolUpdateParamsLoadSheddingDefaultPolicy string
-
-const (
- LoadBalancerPoolUpdateParamsLoadSheddingDefaultPolicyRandom LoadBalancerPoolUpdateParamsLoadSheddingDefaultPolicy = "random"
- LoadBalancerPoolUpdateParamsLoadSheddingDefaultPolicyHash LoadBalancerPoolUpdateParamsLoadSheddingDefaultPolicy = "hash"
-)
-
-// Only the hash policy is supported for existing sessions (to avoid exponential
-// decay).
-type LoadBalancerPoolUpdateParamsLoadSheddingSessionPolicy string
-
-const (
- LoadBalancerPoolUpdateParamsLoadSheddingSessionPolicyHash LoadBalancerPoolUpdateParamsLoadSheddingSessionPolicy = "hash"
-)
-
-// Filter pool and origin health notifications by resource type or health status.
-// Use null to reset.
-type LoadBalancerPoolUpdateParamsNotificationFilter struct {
- // Filter options for a particular resource type (pool or origin). Use null to
- // reset.
- Origin param.Field[LoadBalancerPoolUpdateParamsNotificationFilterOrigin] `json:"origin"`
- // Filter options for a particular resource type (pool or origin). Use null to
- // reset.
- Pool param.Field[LoadBalancerPoolUpdateParamsNotificationFilterPool] `json:"pool"`
-}
-
-func (r LoadBalancerPoolUpdateParamsNotificationFilter) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Filter options for a particular resource type (pool or origin). Use null to
-// reset.
-type LoadBalancerPoolUpdateParamsNotificationFilterOrigin struct {
- // If set true, disable notifications for this type of resource (pool or origin).
- Disable param.Field[bool] `json:"disable"`
- // If present, send notifications only for this health status (e.g. false for only
- // DOWN events). Use null to reset (all events).
- Healthy param.Field[bool] `json:"healthy"`
-}
-
-func (r LoadBalancerPoolUpdateParamsNotificationFilterOrigin) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Filter options for a particular resource type (pool or origin). Use null to
-// reset.
-type LoadBalancerPoolUpdateParamsNotificationFilterPool struct {
- // If set true, disable notifications for this type of resource (pool or origin).
- Disable param.Field[bool] `json:"disable"`
- // If present, send notifications only for this health status (e.g. false for only
- // DOWN events). Use null to reset (all events).
- Healthy param.Field[bool] `json:"healthy"`
-}
-
-func (r LoadBalancerPoolUpdateParamsNotificationFilterPool) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Configures origin steering for the pool. Controls how origins are selected for
-// new sessions and traffic without session affinity.
-type LoadBalancerPoolUpdateParamsOriginSteering struct {
- // The type of origin steering policy to use.
- //
- // - `"random"`: Select an origin randomly.
- // - `"hash"`: Select an origin by computing a hash over the CF-Connecting-IP
- // address.
- // - `"least_outstanding_requests"`: Select an origin by taking into consideration
- // origin weights, as well as each origin's number of outstanding requests.
- // Origins with more pending requests are weighted proportionately less relative
- // to others.
- // - `"least_connections"`: Select an origin by taking into consideration origin
- // weights, as well as each origin's number of open connections. Origins with
- // more open connections are weighted proportionately less relative to others.
- // Supported for HTTP/1 and HTTP/2 connections.
- Policy param.Field[LoadBalancerPoolUpdateParamsOriginSteeringPolicy] `json:"policy"`
-}
-
-func (r LoadBalancerPoolUpdateParamsOriginSteering) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The type of origin steering policy to use.
-//
-// - `"random"`: Select an origin randomly.
-// - `"hash"`: Select an origin by computing a hash over the CF-Connecting-IP
-// address.
-// - `"least_outstanding_requests"`: Select an origin by taking into consideration
-// origin weights, as well as each origin's number of outstanding requests.
-// Origins with more pending requests are weighted proportionately less relative
-// to others.
-// - `"least_connections"`: Select an origin by taking into consideration origin
-// weights, as well as each origin's number of open connections. Origins with
-// more open connections are weighted proportionately less relative to others.
-// Supported for HTTP/1 and HTTP/2 connections.
-type LoadBalancerPoolUpdateParamsOriginSteeringPolicy string
-
-const (
- LoadBalancerPoolUpdateParamsOriginSteeringPolicyRandom LoadBalancerPoolUpdateParamsOriginSteeringPolicy = "random"
- LoadBalancerPoolUpdateParamsOriginSteeringPolicyHash LoadBalancerPoolUpdateParamsOriginSteeringPolicy = "hash"
- LoadBalancerPoolUpdateParamsOriginSteeringPolicyLeastOutstandingRequests LoadBalancerPoolUpdateParamsOriginSteeringPolicy = "least_outstanding_requests"
- LoadBalancerPoolUpdateParamsOriginSteeringPolicyLeastConnections LoadBalancerPoolUpdateParamsOriginSteeringPolicy = "least_connections"
-)
-
-type LoadBalancerPoolUpdateResponseEnvelope struct {
- Errors []LoadBalancerPoolUpdateResponseEnvelopeErrors `json:"errors,required"`
- Messages []LoadBalancerPoolUpdateResponseEnvelopeMessages `json:"messages,required"`
- Result LoadBalancerPoolUpdateResponse `json:"result,required"`
- // Whether the API call was successful
- Success LoadBalancerPoolUpdateResponseEnvelopeSuccess `json:"success,required"`
- JSON loadBalancerPoolUpdateResponseEnvelopeJSON `json:"-"`
-}
-
-// loadBalancerPoolUpdateResponseEnvelopeJSON contains the JSON metadata for the
-// struct [LoadBalancerPoolUpdateResponseEnvelope]
-type loadBalancerPoolUpdateResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerPoolUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerPoolUpdateResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type LoadBalancerPoolUpdateResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON loadBalancerPoolUpdateResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// loadBalancerPoolUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [LoadBalancerPoolUpdateResponseEnvelopeErrors]
-type loadBalancerPoolUpdateResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerPoolUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerPoolUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type LoadBalancerPoolUpdateResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON loadBalancerPoolUpdateResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// loadBalancerPoolUpdateResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [LoadBalancerPoolUpdateResponseEnvelopeMessages]
-type loadBalancerPoolUpdateResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerPoolUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerPoolUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type LoadBalancerPoolUpdateResponseEnvelopeSuccess bool
-
-const (
- LoadBalancerPoolUpdateResponseEnvelopeSuccessTrue LoadBalancerPoolUpdateResponseEnvelopeSuccess = true
-)
-
-type LoadBalancerPoolListParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
- // The ID of the Monitor to use for checking the health of origins within this
- // pool.
- Monitor param.Field[interface{}] `query:"monitor"`
-}
-
-// URLQuery serializes [LoadBalancerPoolListParams]'s query parameters as
-// `url.Values`.
-func (r LoadBalancerPoolListParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type LoadBalancerPoolListResponseEnvelope struct {
- Errors []LoadBalancerPoolListResponseEnvelopeErrors `json:"errors,required"`
- Messages []LoadBalancerPoolListResponseEnvelopeMessages `json:"messages,required"`
- Result []LoadBalancerPoolListResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success LoadBalancerPoolListResponseEnvelopeSuccess `json:"success,required"`
- ResultInfo LoadBalancerPoolListResponseEnvelopeResultInfo `json:"result_info"`
- JSON loadBalancerPoolListResponseEnvelopeJSON `json:"-"`
-}
-
-// loadBalancerPoolListResponseEnvelopeJSON contains the JSON metadata for the
-// struct [LoadBalancerPoolListResponseEnvelope]
-type loadBalancerPoolListResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- ResultInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerPoolListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerPoolListResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type LoadBalancerPoolListResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON loadBalancerPoolListResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// loadBalancerPoolListResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [LoadBalancerPoolListResponseEnvelopeErrors]
-type loadBalancerPoolListResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerPoolListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerPoolListResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type LoadBalancerPoolListResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON loadBalancerPoolListResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// loadBalancerPoolListResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [LoadBalancerPoolListResponseEnvelopeMessages]
-type loadBalancerPoolListResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerPoolListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerPoolListResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type LoadBalancerPoolListResponseEnvelopeSuccess bool
-
-const (
- LoadBalancerPoolListResponseEnvelopeSuccessTrue LoadBalancerPoolListResponseEnvelopeSuccess = true
-)
-
-type LoadBalancerPoolListResponseEnvelopeResultInfo struct {
- // Total number of results for the requested service
- Count float64 `json:"count"`
- // Current page within paginated list of results
- Page float64 `json:"page"`
- // Number of results per page of results
- PerPage float64 `json:"per_page"`
- // Total results available without any search parameters
- TotalCount float64 `json:"total_count"`
- JSON loadBalancerPoolListResponseEnvelopeResultInfoJSON `json:"-"`
-}
-
-// loadBalancerPoolListResponseEnvelopeResultInfoJSON contains the JSON metadata
-// for the struct [LoadBalancerPoolListResponseEnvelopeResultInfo]
-type loadBalancerPoolListResponseEnvelopeResultInfoJSON struct {
- Count apijson.Field
- Page apijson.Field
- PerPage apijson.Field
- TotalCount apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerPoolListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerPoolListResponseEnvelopeResultInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type LoadBalancerPoolDeleteParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type LoadBalancerPoolDeleteResponseEnvelope struct {
- Errors []LoadBalancerPoolDeleteResponseEnvelopeErrors `json:"errors,required"`
- Messages []LoadBalancerPoolDeleteResponseEnvelopeMessages `json:"messages,required"`
- Result LoadBalancerPoolDeleteResponse `json:"result,required"`
- // Whether the API call was successful
- Success LoadBalancerPoolDeleteResponseEnvelopeSuccess `json:"success,required"`
- JSON loadBalancerPoolDeleteResponseEnvelopeJSON `json:"-"`
-}
-
-// loadBalancerPoolDeleteResponseEnvelopeJSON contains the JSON metadata for the
-// struct [LoadBalancerPoolDeleteResponseEnvelope]
-type loadBalancerPoolDeleteResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerPoolDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerPoolDeleteResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type LoadBalancerPoolDeleteResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON loadBalancerPoolDeleteResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// loadBalancerPoolDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [LoadBalancerPoolDeleteResponseEnvelopeErrors]
-type loadBalancerPoolDeleteResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerPoolDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerPoolDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type LoadBalancerPoolDeleteResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON loadBalancerPoolDeleteResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// loadBalancerPoolDeleteResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [LoadBalancerPoolDeleteResponseEnvelopeMessages]
-type loadBalancerPoolDeleteResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerPoolDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerPoolDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type LoadBalancerPoolDeleteResponseEnvelopeSuccess bool
-
-const (
- LoadBalancerPoolDeleteResponseEnvelopeSuccessTrue LoadBalancerPoolDeleteResponseEnvelopeSuccess = true
-)
-
-type LoadBalancerPoolEditParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
- // A list of regions from which to run health checks. Null means every Cloudflare
- // data center.
- CheckRegions param.Field[[]LoadBalancerPoolEditParamsCheckRegion] `json:"check_regions"`
- // A human-readable description of the pool.
- Description param.Field[string] `json:"description"`
- // Whether to enable (the default) or disable this pool. Disabled pools will not
- // receive traffic and are excluded from health checks. Disabling a pool will cause
- // any load balancers using it to failover to the next pool (if any).
- Enabled param.Field[bool] `json:"enabled"`
- // The latitude of the data center containing the origins used in this pool in
- // decimal degrees. If this is set, longitude must also be set.
- Latitude param.Field[float64] `json:"latitude"`
- // Configures load shedding policies and percentages for the pool.
- LoadShedding param.Field[LoadBalancerPoolEditParamsLoadShedding] `json:"load_shedding"`
- // The longitude of the data center containing the origins used in this pool in
- // decimal degrees. If this is set, latitude must also be set.
- Longitude param.Field[float64] `json:"longitude"`
- // The minimum number of origins that must be healthy for this pool to serve
- // traffic. If the number of healthy origins falls below this number, the pool will
- // be marked unhealthy and will failover to the next available pool.
- MinimumOrigins param.Field[int64] `json:"minimum_origins"`
- // The ID of the Monitor to use for checking the health of origins within this
- // pool.
- Monitor param.Field[interface{}] `json:"monitor"`
- // A short name (tag) for the pool. Only alphanumeric characters, hyphens, and
- // underscores are allowed.
- Name param.Field[string] `json:"name"`
- // This field is now deprecated. It has been moved to Cloudflare's Centralized
- // Notification service
- // https://developers.cloudflare.com/fundamentals/notifications/. The email address
- // to send health status notifications to. This can be an individual mailbox or a
- // mailing list. Multiple emails can be supplied as a comma delimited list.
- NotificationEmail param.Field[string] `json:"notification_email"`
- // Filter pool and origin health notifications by resource type or health status.
- // Use null to reset.
- NotificationFilter param.Field[LoadBalancerPoolEditParamsNotificationFilter] `json:"notification_filter"`
- // Configures origin steering for the pool. Controls how origins are selected for
- // new sessions and traffic without session affinity.
- OriginSteering param.Field[LoadBalancerPoolEditParamsOriginSteering] `json:"origin_steering"`
- // The list of origins within this pool. Traffic directed at this pool is balanced
- // across all currently healthy origins, provided the pool itself is healthy.
- Origins param.Field[[]LoadBalancerPoolEditParamsOrigin] `json:"origins"`
-}
-
-func (r LoadBalancerPoolEditParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// WNAM: Western North America, ENAM: Eastern North America, WEU: Western Europe,
-// EEU: Eastern Europe, NSAM: Northern South America, SSAM: Southern South America,
-// OC: Oceania, ME: Middle East, NAF: North Africa, SAF: South Africa, SAS:
-// Southern Asia, SEAS: South East Asia, NEAS: North East Asia, ALL_REGIONS: all
-// regions (ENTERPRISE customers only).
-type LoadBalancerPoolEditParamsCheckRegion string
-
-const (
- LoadBalancerPoolEditParamsCheckRegionWnam LoadBalancerPoolEditParamsCheckRegion = "WNAM"
- LoadBalancerPoolEditParamsCheckRegionEnam LoadBalancerPoolEditParamsCheckRegion = "ENAM"
- LoadBalancerPoolEditParamsCheckRegionWeu LoadBalancerPoolEditParamsCheckRegion = "WEU"
- LoadBalancerPoolEditParamsCheckRegionEeu LoadBalancerPoolEditParamsCheckRegion = "EEU"
- LoadBalancerPoolEditParamsCheckRegionNsam LoadBalancerPoolEditParamsCheckRegion = "NSAM"
- LoadBalancerPoolEditParamsCheckRegionSsam LoadBalancerPoolEditParamsCheckRegion = "SSAM"
- LoadBalancerPoolEditParamsCheckRegionOc LoadBalancerPoolEditParamsCheckRegion = "OC"
- LoadBalancerPoolEditParamsCheckRegionMe LoadBalancerPoolEditParamsCheckRegion = "ME"
- LoadBalancerPoolEditParamsCheckRegionNaf LoadBalancerPoolEditParamsCheckRegion = "NAF"
- LoadBalancerPoolEditParamsCheckRegionSaf LoadBalancerPoolEditParamsCheckRegion = "SAF"
- LoadBalancerPoolEditParamsCheckRegionSas LoadBalancerPoolEditParamsCheckRegion = "SAS"
- LoadBalancerPoolEditParamsCheckRegionSeas LoadBalancerPoolEditParamsCheckRegion = "SEAS"
- LoadBalancerPoolEditParamsCheckRegionNeas LoadBalancerPoolEditParamsCheckRegion = "NEAS"
- LoadBalancerPoolEditParamsCheckRegionAllRegions LoadBalancerPoolEditParamsCheckRegion = "ALL_REGIONS"
-)
-
-// Configures load shedding policies and percentages for the pool.
-type LoadBalancerPoolEditParamsLoadShedding struct {
- // The percent of traffic to shed from the pool, according to the default policy.
- // Applies to new sessions and traffic without session affinity.
- DefaultPercent param.Field[float64] `json:"default_percent"`
- // The default policy to use when load shedding. A random policy randomly sheds a
- // given percent of requests. A hash policy computes a hash over the
- // CF-Connecting-IP address and sheds all requests originating from a percent of
- // IPs.
- DefaultPolicy param.Field[LoadBalancerPoolEditParamsLoadSheddingDefaultPolicy] `json:"default_policy"`
- // The percent of existing sessions to shed from the pool, according to the session
- // policy.
- SessionPercent param.Field[float64] `json:"session_percent"`
- // Only the hash policy is supported for existing sessions (to avoid exponential
- // decay).
- SessionPolicy param.Field[LoadBalancerPoolEditParamsLoadSheddingSessionPolicy] `json:"session_policy"`
-}
-
-func (r LoadBalancerPoolEditParamsLoadShedding) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The default policy to use when load shedding. A random policy randomly sheds a
-// given percent of requests. A hash policy computes a hash over the
-// CF-Connecting-IP address and sheds all requests originating from a percent of
-// IPs.
-type LoadBalancerPoolEditParamsLoadSheddingDefaultPolicy string
-
-const (
- LoadBalancerPoolEditParamsLoadSheddingDefaultPolicyRandom LoadBalancerPoolEditParamsLoadSheddingDefaultPolicy = "random"
- LoadBalancerPoolEditParamsLoadSheddingDefaultPolicyHash LoadBalancerPoolEditParamsLoadSheddingDefaultPolicy = "hash"
-)
-
-// Only the hash policy is supported for existing sessions (to avoid exponential
-// decay).
-type LoadBalancerPoolEditParamsLoadSheddingSessionPolicy string
-
-const (
- LoadBalancerPoolEditParamsLoadSheddingSessionPolicyHash LoadBalancerPoolEditParamsLoadSheddingSessionPolicy = "hash"
-)
-
-// Filter pool and origin health notifications by resource type or health status.
-// Use null to reset.
-type LoadBalancerPoolEditParamsNotificationFilter struct {
- // Filter options for a particular resource type (pool or origin). Use null to
- // reset.
- Origin param.Field[LoadBalancerPoolEditParamsNotificationFilterOrigin] `json:"origin"`
- // Filter options for a particular resource type (pool or origin). Use null to
- // reset.
- Pool param.Field[LoadBalancerPoolEditParamsNotificationFilterPool] `json:"pool"`
-}
-
-func (r LoadBalancerPoolEditParamsNotificationFilter) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Filter options for a particular resource type (pool or origin). Use null to
-// reset.
-type LoadBalancerPoolEditParamsNotificationFilterOrigin struct {
- // If set true, disable notifications for this type of resource (pool or origin).
- Disable param.Field[bool] `json:"disable"`
- // If present, send notifications only for this health status (e.g. false for only
- // DOWN events). Use null to reset (all events).
- Healthy param.Field[bool] `json:"healthy"`
-}
-
-func (r LoadBalancerPoolEditParamsNotificationFilterOrigin) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Filter options for a particular resource type (pool or origin). Use null to
-// reset.
-type LoadBalancerPoolEditParamsNotificationFilterPool struct {
- // If set true, disable notifications for this type of resource (pool or origin).
- Disable param.Field[bool] `json:"disable"`
- // If present, send notifications only for this health status (e.g. false for only
- // DOWN events). Use null to reset (all events).
- Healthy param.Field[bool] `json:"healthy"`
-}
-
-func (r LoadBalancerPoolEditParamsNotificationFilterPool) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Configures origin steering for the pool. Controls how origins are selected for
-// new sessions and traffic without session affinity.
-type LoadBalancerPoolEditParamsOriginSteering struct {
- // The type of origin steering policy to use.
- //
- // - `"random"`: Select an origin randomly.
- // - `"hash"`: Select an origin by computing a hash over the CF-Connecting-IP
- // address.
- // - `"least_outstanding_requests"`: Select an origin by taking into consideration
- // origin weights, as well as each origin's number of outstanding requests.
- // Origins with more pending requests are weighted proportionately less relative
- // to others.
- // - `"least_connections"`: Select an origin by taking into consideration origin
- // weights, as well as each origin's number of open connections. Origins with
- // more open connections are weighted proportionately less relative to others.
- // Supported for HTTP/1 and HTTP/2 connections.
- Policy param.Field[LoadBalancerPoolEditParamsOriginSteeringPolicy] `json:"policy"`
-}
-
-func (r LoadBalancerPoolEditParamsOriginSteering) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The type of origin steering policy to use.
-//
-// - `"random"`: Select an origin randomly.
-// - `"hash"`: Select an origin by computing a hash over the CF-Connecting-IP
-// address.
-// - `"least_outstanding_requests"`: Select an origin by taking into consideration
-// origin weights, as well as each origin's number of outstanding requests.
-// Origins with more pending requests are weighted proportionately less relative
-// to others.
-// - `"least_connections"`: Select an origin by taking into consideration origin
-// weights, as well as each origin's number of open connections. Origins with
-// more open connections are weighted proportionately less relative to others.
-// Supported for HTTP/1 and HTTP/2 connections.
-type LoadBalancerPoolEditParamsOriginSteeringPolicy string
-
-const (
- LoadBalancerPoolEditParamsOriginSteeringPolicyRandom LoadBalancerPoolEditParamsOriginSteeringPolicy = "random"
- LoadBalancerPoolEditParamsOriginSteeringPolicyHash LoadBalancerPoolEditParamsOriginSteeringPolicy = "hash"
- LoadBalancerPoolEditParamsOriginSteeringPolicyLeastOutstandingRequests LoadBalancerPoolEditParamsOriginSteeringPolicy = "least_outstanding_requests"
- LoadBalancerPoolEditParamsOriginSteeringPolicyLeastConnections LoadBalancerPoolEditParamsOriginSteeringPolicy = "least_connections"
-)
-
-type LoadBalancerPoolEditParamsOrigin struct {
- // The IP address (IPv4 or IPv6) of the origin, or its publicly addressable
- // hostname. Hostnames entered here should resolve directly to the origin, and not
- // be a hostname proxied by Cloudflare. To set an internal/reserved address,
- // virtual_network_id must also be set.
- Address param.Field[string] `json:"address"`
- // Whether to enable (the default) this origin within the pool. Disabled origins
- // will not receive traffic and are excluded from health checks. The origin will
- // only be disabled for the current pool.
- Enabled param.Field[bool] `json:"enabled"`
- // The request header is used to pass additional information with an HTTP request.
- // Currently supported header is 'Host'.
- Header param.Field[LoadBalancerPoolEditParamsOriginsHeader] `json:"header"`
- // A human-identifiable name for the origin.
- Name param.Field[string] `json:"name"`
- // The virtual network subnet ID the origin belongs in. Virtual network must also
- // belong to the account.
- VirtualNetworkID param.Field[string] `json:"virtual_network_id"`
- // The weight of this origin relative to other origins in the pool. Based on the
- // configured weight the total traffic is distributed among origins within the
- // pool.
- //
- // - `origin_steering.policy="least_outstanding_requests"`: Use weight to scale the
- // origin's outstanding requests.
- // - `origin_steering.policy="least_connections"`: Use weight to scale the origin's
- // open connections.
- Weight param.Field[float64] `json:"weight"`
-}
-
-func (r LoadBalancerPoolEditParamsOrigin) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The request header is used to pass additional information with an HTTP request.
-// Currently supported header is 'Host'.
-type LoadBalancerPoolEditParamsOriginsHeader struct {
- // The 'Host' header allows to override the hostname set in the HTTP request.
- // Current support is 1 'Host' header override per origin.
- Host param.Field[[]string] `json:"Host"`
-}
-
-func (r LoadBalancerPoolEditParamsOriginsHeader) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type LoadBalancerPoolEditResponseEnvelope struct {
- Errors []LoadBalancerPoolEditResponseEnvelopeErrors `json:"errors,required"`
- Messages []LoadBalancerPoolEditResponseEnvelopeMessages `json:"messages,required"`
- Result LoadBalancerPoolEditResponse `json:"result,required"`
- // Whether the API call was successful
- Success LoadBalancerPoolEditResponseEnvelopeSuccess `json:"success,required"`
- JSON loadBalancerPoolEditResponseEnvelopeJSON `json:"-"`
-}
-
-// loadBalancerPoolEditResponseEnvelopeJSON contains the JSON metadata for the
-// struct [LoadBalancerPoolEditResponseEnvelope]
-type loadBalancerPoolEditResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerPoolEditResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerPoolEditResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type LoadBalancerPoolEditResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON loadBalancerPoolEditResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// loadBalancerPoolEditResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [LoadBalancerPoolEditResponseEnvelopeErrors]
-type loadBalancerPoolEditResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerPoolEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerPoolEditResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type LoadBalancerPoolEditResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON loadBalancerPoolEditResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// loadBalancerPoolEditResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [LoadBalancerPoolEditResponseEnvelopeMessages]
-type loadBalancerPoolEditResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerPoolEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerPoolEditResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type LoadBalancerPoolEditResponseEnvelopeSuccess bool
-
-const (
- LoadBalancerPoolEditResponseEnvelopeSuccessTrue LoadBalancerPoolEditResponseEnvelopeSuccess = true
-)
-
-type LoadBalancerPoolGetParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type LoadBalancerPoolGetResponseEnvelope struct {
- Errors []LoadBalancerPoolGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []LoadBalancerPoolGetResponseEnvelopeMessages `json:"messages,required"`
- Result LoadBalancerPoolGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success LoadBalancerPoolGetResponseEnvelopeSuccess `json:"success,required"`
- JSON loadBalancerPoolGetResponseEnvelopeJSON `json:"-"`
-}
-
-// loadBalancerPoolGetResponseEnvelopeJSON contains the JSON metadata for the
-// struct [LoadBalancerPoolGetResponseEnvelope]
-type loadBalancerPoolGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerPoolGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerPoolGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type LoadBalancerPoolGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON loadBalancerPoolGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// loadBalancerPoolGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [LoadBalancerPoolGetResponseEnvelopeErrors]
-type loadBalancerPoolGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerPoolGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerPoolGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type LoadBalancerPoolGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON loadBalancerPoolGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// loadBalancerPoolGetResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [LoadBalancerPoolGetResponseEnvelopeMessages]
-type loadBalancerPoolGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerPoolGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerPoolGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type LoadBalancerPoolGetResponseEnvelopeSuccess bool
-
-const (
- LoadBalancerPoolGetResponseEnvelopeSuccessTrue LoadBalancerPoolGetResponseEnvelopeSuccess = true
-)
diff --git a/loadbalancerpool_test.go b/loadbalancerpool_test.go
deleted file mode 100644
index 8545df99f6f..00000000000
--- a/loadbalancerpool_test.go
+++ /dev/null
@@ -1,354 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestLoadBalancerPoolNewWithOptionalParams(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"),
- )
- _, err := client.LoadBalancers.Pools.New(context.TODO(), cloudflare.LoadBalancerPoolNewParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Name: cloudflare.F("primary-dc-1"),
- Origins: cloudflare.F([]cloudflare.LoadBalancerPoolNewParamsOrigin{{
- Address: cloudflare.F("0.0.0.0"),
- Enabled: cloudflare.F(true),
- Header: cloudflare.F(cloudflare.LoadBalancerPoolNewParamsOriginsHeader{
- Host: cloudflare.F([]string{"example.com", "example.com", "example.com"}),
- }),
- Name: cloudflare.F("app-server-1"),
- VirtualNetworkID: cloudflare.F("a5624d4e-044a-4ff0-b3e1-e2465353d4b4"),
- Weight: cloudflare.F(0.600000),
- }, {
- Address: cloudflare.F("0.0.0.0"),
- Enabled: cloudflare.F(true),
- Header: cloudflare.F(cloudflare.LoadBalancerPoolNewParamsOriginsHeader{
- Host: cloudflare.F([]string{"example.com", "example.com", "example.com"}),
- }),
- Name: cloudflare.F("app-server-1"),
- VirtualNetworkID: cloudflare.F("a5624d4e-044a-4ff0-b3e1-e2465353d4b4"),
- Weight: cloudflare.F(0.600000),
- }, {
- Address: cloudflare.F("0.0.0.0"),
- Enabled: cloudflare.F(true),
- Header: cloudflare.F(cloudflare.LoadBalancerPoolNewParamsOriginsHeader{
- Host: cloudflare.F([]string{"example.com", "example.com", "example.com"}),
- }),
- Name: cloudflare.F("app-server-1"),
- VirtualNetworkID: cloudflare.F("a5624d4e-044a-4ff0-b3e1-e2465353d4b4"),
- Weight: cloudflare.F(0.600000),
- }}),
- Description: cloudflare.F("Primary data center - Provider XYZ"),
- Enabled: cloudflare.F(false),
- Latitude: cloudflare.F(0.000000),
- LoadShedding: cloudflare.F(cloudflare.LoadBalancerPoolNewParamsLoadShedding{
- DefaultPercent: cloudflare.F(0.000000),
- DefaultPolicy: cloudflare.F(cloudflare.LoadBalancerPoolNewParamsLoadSheddingDefaultPolicyRandom),
- SessionPercent: cloudflare.F(0.000000),
- SessionPolicy: cloudflare.F(cloudflare.LoadBalancerPoolNewParamsLoadSheddingSessionPolicyHash),
- }),
- Longitude: cloudflare.F(0.000000),
- MinimumOrigins: cloudflare.F(int64(0)),
- Monitor: cloudflare.F[any](map[string]interface{}{}),
- NotificationEmail: cloudflare.F("someone@example.com,sometwo@example.com"),
- NotificationFilter: cloudflare.F(cloudflare.LoadBalancerPoolNewParamsNotificationFilter{
- Origin: cloudflare.F(cloudflare.LoadBalancerPoolNewParamsNotificationFilterOrigin{
- Disable: cloudflare.F(true),
- Healthy: cloudflare.F(true),
- }),
- Pool: cloudflare.F(cloudflare.LoadBalancerPoolNewParamsNotificationFilterPool{
- Disable: cloudflare.F(true),
- Healthy: cloudflare.F(false),
- }),
- }),
- OriginSteering: cloudflare.F(cloudflare.LoadBalancerPoolNewParamsOriginSteering{
- Policy: cloudflare.F(cloudflare.LoadBalancerPoolNewParamsOriginSteeringPolicyRandom),
- }),
- })
- 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())
- }
-}
-
-func TestLoadBalancerPoolUpdateWithOptionalParams(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"),
- )
- _, err := client.LoadBalancers.Pools.Update(
- context.TODO(),
- "17b5962d775c646f3f9725cbc7a53df4",
- cloudflare.LoadBalancerPoolUpdateParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Name: cloudflare.F("primary-dc-1"),
- Origins: cloudflare.F([]cloudflare.LoadBalancerPoolUpdateParamsOrigin{{
- Address: cloudflare.F("0.0.0.0"),
- Enabled: cloudflare.F(true),
- Header: cloudflare.F(cloudflare.LoadBalancerPoolUpdateParamsOriginsHeader{
- Host: cloudflare.F([]string{"example.com", "example.com", "example.com"}),
- }),
- Name: cloudflare.F("app-server-1"),
- VirtualNetworkID: cloudflare.F("a5624d4e-044a-4ff0-b3e1-e2465353d4b4"),
- Weight: cloudflare.F(0.600000),
- }, {
- Address: cloudflare.F("0.0.0.0"),
- Enabled: cloudflare.F(true),
- Header: cloudflare.F(cloudflare.LoadBalancerPoolUpdateParamsOriginsHeader{
- Host: cloudflare.F([]string{"example.com", "example.com", "example.com"}),
- }),
- Name: cloudflare.F("app-server-1"),
- VirtualNetworkID: cloudflare.F("a5624d4e-044a-4ff0-b3e1-e2465353d4b4"),
- Weight: cloudflare.F(0.600000),
- }, {
- Address: cloudflare.F("0.0.0.0"),
- Enabled: cloudflare.F(true),
- Header: cloudflare.F(cloudflare.LoadBalancerPoolUpdateParamsOriginsHeader{
- Host: cloudflare.F([]string{"example.com", "example.com", "example.com"}),
- }),
- Name: cloudflare.F("app-server-1"),
- VirtualNetworkID: cloudflare.F("a5624d4e-044a-4ff0-b3e1-e2465353d4b4"),
- Weight: cloudflare.F(0.600000),
- }}),
- CheckRegions: cloudflare.F([]cloudflare.LoadBalancerPoolUpdateParamsCheckRegion{cloudflare.LoadBalancerPoolUpdateParamsCheckRegionWeu, cloudflare.LoadBalancerPoolUpdateParamsCheckRegionEnam}),
- Description: cloudflare.F("Primary data center - Provider XYZ"),
- Enabled: cloudflare.F(false),
- Latitude: cloudflare.F(0.000000),
- LoadShedding: cloudflare.F(cloudflare.LoadBalancerPoolUpdateParamsLoadShedding{
- DefaultPercent: cloudflare.F(0.000000),
- DefaultPolicy: cloudflare.F(cloudflare.LoadBalancerPoolUpdateParamsLoadSheddingDefaultPolicyRandom),
- SessionPercent: cloudflare.F(0.000000),
- SessionPolicy: cloudflare.F(cloudflare.LoadBalancerPoolUpdateParamsLoadSheddingSessionPolicyHash),
- }),
- Longitude: cloudflare.F(0.000000),
- MinimumOrigins: cloudflare.F(int64(0)),
- Monitor: cloudflare.F[any](map[string]interface{}{}),
- NotificationEmail: cloudflare.F("someone@example.com,sometwo@example.com"),
- NotificationFilter: cloudflare.F(cloudflare.LoadBalancerPoolUpdateParamsNotificationFilter{
- Origin: cloudflare.F(cloudflare.LoadBalancerPoolUpdateParamsNotificationFilterOrigin{
- Disable: cloudflare.F(true),
- Healthy: cloudflare.F(true),
- }),
- Pool: cloudflare.F(cloudflare.LoadBalancerPoolUpdateParamsNotificationFilterPool{
- Disable: cloudflare.F(true),
- Healthy: cloudflare.F(false),
- }),
- }),
- OriginSteering: cloudflare.F(cloudflare.LoadBalancerPoolUpdateParamsOriginSteering{
- Policy: cloudflare.F(cloudflare.LoadBalancerPoolUpdateParamsOriginSteeringPolicyRandom),
- }),
- },
- )
- 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())
- }
-}
-
-func TestLoadBalancerPoolListWithOptionalParams(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"),
- )
- _, err := client.LoadBalancers.Pools.List(context.TODO(), cloudflare.LoadBalancerPoolListParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Monitor: cloudflare.F[any](map[string]interface{}{}),
- })
- 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())
- }
-}
-
-func TestLoadBalancerPoolDelete(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"),
- )
- _, err := client.LoadBalancers.Pools.Delete(
- context.TODO(),
- "17b5962d775c646f3f9725cbc7a53df4",
- cloudflare.LoadBalancerPoolDeleteParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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())
- }
-}
-
-func TestLoadBalancerPoolEditWithOptionalParams(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"),
- )
- _, err := client.LoadBalancers.Pools.Edit(
- context.TODO(),
- "17b5962d775c646f3f9725cbc7a53df4",
- cloudflare.LoadBalancerPoolEditParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- CheckRegions: cloudflare.F([]cloudflare.LoadBalancerPoolEditParamsCheckRegion{cloudflare.LoadBalancerPoolEditParamsCheckRegionWeu, cloudflare.LoadBalancerPoolEditParamsCheckRegionEnam}),
- Description: cloudflare.F("Primary data center - Provider XYZ"),
- Enabled: cloudflare.F(false),
- Latitude: cloudflare.F(0.000000),
- LoadShedding: cloudflare.F(cloudflare.LoadBalancerPoolEditParamsLoadShedding{
- DefaultPercent: cloudflare.F(0.000000),
- DefaultPolicy: cloudflare.F(cloudflare.LoadBalancerPoolEditParamsLoadSheddingDefaultPolicyRandom),
- SessionPercent: cloudflare.F(0.000000),
- SessionPolicy: cloudflare.F(cloudflare.LoadBalancerPoolEditParamsLoadSheddingSessionPolicyHash),
- }),
- Longitude: cloudflare.F(0.000000),
- MinimumOrigins: cloudflare.F(int64(0)),
- Monitor: cloudflare.F[any](map[string]interface{}{}),
- Name: cloudflare.F("primary-dc-1"),
- NotificationEmail: cloudflare.F("someone@example.com,sometwo@example.com"),
- NotificationFilter: cloudflare.F(cloudflare.LoadBalancerPoolEditParamsNotificationFilter{
- Origin: cloudflare.F(cloudflare.LoadBalancerPoolEditParamsNotificationFilterOrigin{
- Disable: cloudflare.F(true),
- Healthy: cloudflare.F(true),
- }),
- Pool: cloudflare.F(cloudflare.LoadBalancerPoolEditParamsNotificationFilterPool{
- Disable: cloudflare.F(true),
- Healthy: cloudflare.F(false),
- }),
- }),
- OriginSteering: cloudflare.F(cloudflare.LoadBalancerPoolEditParamsOriginSteering{
- Policy: cloudflare.F(cloudflare.LoadBalancerPoolEditParamsOriginSteeringPolicyRandom),
- }),
- Origins: cloudflare.F([]cloudflare.LoadBalancerPoolEditParamsOrigin{{
- Address: cloudflare.F("0.0.0.0"),
- Enabled: cloudflare.F(true),
- Header: cloudflare.F(cloudflare.LoadBalancerPoolEditParamsOriginsHeader{
- Host: cloudflare.F([]string{"example.com", "example.com", "example.com"}),
- }),
- Name: cloudflare.F("app-server-1"),
- VirtualNetworkID: cloudflare.F("a5624d4e-044a-4ff0-b3e1-e2465353d4b4"),
- Weight: cloudflare.F(0.600000),
- }, {
- Address: cloudflare.F("0.0.0.0"),
- Enabled: cloudflare.F(true),
- Header: cloudflare.F(cloudflare.LoadBalancerPoolEditParamsOriginsHeader{
- Host: cloudflare.F([]string{"example.com", "example.com", "example.com"}),
- }),
- Name: cloudflare.F("app-server-1"),
- VirtualNetworkID: cloudflare.F("a5624d4e-044a-4ff0-b3e1-e2465353d4b4"),
- Weight: cloudflare.F(0.600000),
- }, {
- Address: cloudflare.F("0.0.0.0"),
- Enabled: cloudflare.F(true),
- Header: cloudflare.F(cloudflare.LoadBalancerPoolEditParamsOriginsHeader{
- Host: cloudflare.F([]string{"example.com", "example.com", "example.com"}),
- }),
- Name: cloudflare.F("app-server-1"),
- VirtualNetworkID: cloudflare.F("a5624d4e-044a-4ff0-b3e1-e2465353d4b4"),
- Weight: cloudflare.F(0.600000),
- }}),
- },
- )
- 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())
- }
-}
-
-func TestLoadBalancerPoolGet(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"),
- )
- _, err := client.LoadBalancers.Pools.Get(
- context.TODO(),
- "17b5962d775c646f3f9725cbc7a53df4",
- cloudflare.LoadBalancerPoolGetParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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/loadbalancerpoolhealth.go b/loadbalancerpoolhealth.go
deleted file mode 100644
index 40aa2a79a23..00000000000
--- a/loadbalancerpoolhealth.go
+++ /dev/null
@@ -1,346 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "reflect"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/option"
- "github.com/tidwall/gjson"
-)
-
-// LoadBalancerPoolHealthService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewLoadBalancerPoolHealthService]
-// method instead.
-type LoadBalancerPoolHealthService struct {
- Options []option.RequestOption
-}
-
-// NewLoadBalancerPoolHealthService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewLoadBalancerPoolHealthService(opts ...option.RequestOption) (r *LoadBalancerPoolHealthService) {
- r = &LoadBalancerPoolHealthService{}
- r.Options = opts
- return
-}
-
-// Preview pool health using provided monitor details. The returned preview_id can
-// be used in the preview endpoint to retrieve the results.
-func (r *LoadBalancerPoolHealthService) New(ctx context.Context, poolID string, params LoadBalancerPoolHealthNewParams, opts ...option.RequestOption) (res *LoadBalancerPoolHealthNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env LoadBalancerPoolHealthNewResponseEnvelope
- path := fmt.Sprintf("accounts/%s/load_balancers/pools/%s/preview", params.AccountID, poolID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Fetch the latest pool health status for a single pool.
-func (r *LoadBalancerPoolHealthService) Get(ctx context.Context, poolID string, query LoadBalancerPoolHealthGetParams, opts ...option.RequestOption) (res *LoadBalancerPoolHealthGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env LoadBalancerPoolHealthGetResponseEnvelope
- path := fmt.Sprintf("accounts/%s/load_balancers/pools/%s/health", query.AccountID, poolID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type LoadBalancerPoolHealthNewResponse struct {
- // Monitored pool IDs mapped to their respective names.
- Pools map[string]string `json:"pools"`
- PreviewID string `json:"preview_id"`
- JSON loadBalancerPoolHealthNewResponseJSON `json:"-"`
-}
-
-// loadBalancerPoolHealthNewResponseJSON contains the JSON metadata for the struct
-// [LoadBalancerPoolHealthNewResponse]
-type loadBalancerPoolHealthNewResponseJSON struct {
- Pools apijson.Field
- PreviewID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerPoolHealthNewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerPoolHealthNewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// A list of regions from which to run health checks. Null means every Cloudflare
-// data center.
-//
-// Union satisfied by [LoadBalancerPoolHealthGetResponseUnknown] or
-// [shared.UnionString].
-type LoadBalancerPoolHealthGetResponse interface {
- ImplementsLoadBalancerPoolHealthGetResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*LoadBalancerPoolHealthGetResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-type LoadBalancerPoolHealthNewParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
- // The expected HTTP response code or code range of the health check. This
- // parameter is only valid for HTTP and HTTPS monitors.
- ExpectedCodes param.Field[string] `json:"expected_codes,required"`
- // Do not validate the certificate when monitor use HTTPS. This parameter is
- // currently only valid for HTTP and HTTPS monitors.
- AllowInsecure param.Field[bool] `json:"allow_insecure"`
- // To be marked unhealthy the monitored origin must fail this healthcheck N
- // consecutive times.
- ConsecutiveDown param.Field[int64] `json:"consecutive_down"`
- // To be marked healthy the monitored origin must pass this healthcheck N
- // consecutive times.
- ConsecutiveUp param.Field[int64] `json:"consecutive_up"`
- // Object description.
- Description param.Field[string] `json:"description"`
- // A case-insensitive sub-string to look for in the response body. If this string
- // is not found, the origin will be marked as unhealthy. This parameter is only
- // valid for HTTP and HTTPS monitors.
- ExpectedBody param.Field[string] `json:"expected_body"`
- // Follow redirects if returned by the origin. This parameter is only valid for
- // HTTP and HTTPS monitors.
- FollowRedirects param.Field[bool] `json:"follow_redirects"`
- // The HTTP request headers to send in the health check. It is recommended you set
- // a Host header by default. The User-Agent header cannot be overridden. This
- // parameter is only valid for HTTP and HTTPS monitors.
- Header param.Field[interface{}] `json:"header"`
- // The interval between each health check. Shorter intervals may improve failover
- // time, but will increase load on the origins as we check from multiple locations.
- Interval param.Field[int64] `json:"interval"`
- // The method to use for the health check. This defaults to 'GET' for HTTP/HTTPS
- // based checks and 'connection_established' for TCP based health checks.
- Method param.Field[string] `json:"method"`
- // The endpoint path you want to conduct a health check against. This parameter is
- // only valid for HTTP and HTTPS monitors.
- Path param.Field[string] `json:"path"`
- // The port number to connect to for the health check. Required for TCP, UDP, and
- // SMTP checks. HTTP and HTTPS checks should only define the port when using a
- // non-standard port (HTTP: default 80, HTTPS: default 443).
- Port param.Field[int64] `json:"port"`
- // Assign this monitor to emulate the specified zone while probing. This parameter
- // is only valid for HTTP and HTTPS monitors.
- ProbeZone param.Field[string] `json:"probe_zone"`
- // The number of retries to attempt in case of a timeout before marking the origin
- // as unhealthy. Retries are attempted immediately.
- Retries param.Field[int64] `json:"retries"`
- // The timeout (in seconds) before marking the health check as failed.
- Timeout param.Field[int64] `json:"timeout"`
- // The protocol to use for the health check. Currently supported protocols are
- // 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.
- Type param.Field[LoadBalancerPoolHealthNewParamsType] `json:"type"`
-}
-
-func (r LoadBalancerPoolHealthNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The protocol to use for the health check. Currently supported protocols are
-// 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.
-type LoadBalancerPoolHealthNewParamsType string
-
-const (
- LoadBalancerPoolHealthNewParamsTypeHTTP LoadBalancerPoolHealthNewParamsType = "http"
- LoadBalancerPoolHealthNewParamsTypeHTTPS LoadBalancerPoolHealthNewParamsType = "https"
- LoadBalancerPoolHealthNewParamsTypeTcp LoadBalancerPoolHealthNewParamsType = "tcp"
- LoadBalancerPoolHealthNewParamsTypeUdpIcmp LoadBalancerPoolHealthNewParamsType = "udp_icmp"
- LoadBalancerPoolHealthNewParamsTypeIcmpPing LoadBalancerPoolHealthNewParamsType = "icmp_ping"
- LoadBalancerPoolHealthNewParamsTypeSmtp LoadBalancerPoolHealthNewParamsType = "smtp"
-)
-
-type LoadBalancerPoolHealthNewResponseEnvelope struct {
- Errors []LoadBalancerPoolHealthNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []LoadBalancerPoolHealthNewResponseEnvelopeMessages `json:"messages,required"`
- Result LoadBalancerPoolHealthNewResponse `json:"result,required"`
- // Whether the API call was successful
- Success LoadBalancerPoolHealthNewResponseEnvelopeSuccess `json:"success,required"`
- JSON loadBalancerPoolHealthNewResponseEnvelopeJSON `json:"-"`
-}
-
-// loadBalancerPoolHealthNewResponseEnvelopeJSON contains the JSON metadata for the
-// struct [LoadBalancerPoolHealthNewResponseEnvelope]
-type loadBalancerPoolHealthNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerPoolHealthNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerPoolHealthNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type LoadBalancerPoolHealthNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON loadBalancerPoolHealthNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// loadBalancerPoolHealthNewResponseEnvelopeErrorsJSON contains the JSON metadata
-// for the struct [LoadBalancerPoolHealthNewResponseEnvelopeErrors]
-type loadBalancerPoolHealthNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerPoolHealthNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerPoolHealthNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type LoadBalancerPoolHealthNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON loadBalancerPoolHealthNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// loadBalancerPoolHealthNewResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [LoadBalancerPoolHealthNewResponseEnvelopeMessages]
-type loadBalancerPoolHealthNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerPoolHealthNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerPoolHealthNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type LoadBalancerPoolHealthNewResponseEnvelopeSuccess bool
-
-const (
- LoadBalancerPoolHealthNewResponseEnvelopeSuccessTrue LoadBalancerPoolHealthNewResponseEnvelopeSuccess = true
-)
-
-type LoadBalancerPoolHealthGetParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type LoadBalancerPoolHealthGetResponseEnvelope struct {
- Errors []LoadBalancerPoolHealthGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []LoadBalancerPoolHealthGetResponseEnvelopeMessages `json:"messages,required"`
- // A list of regions from which to run health checks. Null means every Cloudflare
- // data center.
- Result LoadBalancerPoolHealthGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success LoadBalancerPoolHealthGetResponseEnvelopeSuccess `json:"success,required"`
- JSON loadBalancerPoolHealthGetResponseEnvelopeJSON `json:"-"`
-}
-
-// loadBalancerPoolHealthGetResponseEnvelopeJSON contains the JSON metadata for the
-// struct [LoadBalancerPoolHealthGetResponseEnvelope]
-type loadBalancerPoolHealthGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerPoolHealthGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerPoolHealthGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type LoadBalancerPoolHealthGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON loadBalancerPoolHealthGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// loadBalancerPoolHealthGetResponseEnvelopeErrorsJSON contains the JSON metadata
-// for the struct [LoadBalancerPoolHealthGetResponseEnvelopeErrors]
-type loadBalancerPoolHealthGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerPoolHealthGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerPoolHealthGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type LoadBalancerPoolHealthGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON loadBalancerPoolHealthGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// loadBalancerPoolHealthGetResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [LoadBalancerPoolHealthGetResponseEnvelopeMessages]
-type loadBalancerPoolHealthGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerPoolHealthGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerPoolHealthGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type LoadBalancerPoolHealthGetResponseEnvelopeSuccess bool
-
-const (
- LoadBalancerPoolHealthGetResponseEnvelopeSuccessTrue LoadBalancerPoolHealthGetResponseEnvelopeSuccess = true
-)
diff --git a/loadbalancerpoolhealth_test.go b/loadbalancerpoolhealth_test.go
deleted file mode 100644
index 1f144657e5d..00000000000
--- a/loadbalancerpoolhealth_test.go
+++ /dev/null
@@ -1,97 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestLoadBalancerPoolHealthNewWithOptionalParams(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"),
- )
- _, err := client.LoadBalancers.Pools.Health.New(
- context.TODO(),
- "17b5962d775c646f3f9725cbc7a53df4",
- cloudflare.LoadBalancerPoolHealthNewParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- ExpectedCodes: cloudflare.F("2xx"),
- AllowInsecure: cloudflare.F(true),
- ConsecutiveDown: cloudflare.F(int64(0)),
- ConsecutiveUp: cloudflare.F(int64(0)),
- Description: cloudflare.F("Login page monitor"),
- ExpectedBody: cloudflare.F("alive"),
- FollowRedirects: cloudflare.F(true),
- Header: cloudflare.F[any](map[string]interface{}{
- "Host": map[string]interface{}{
- "0": "example.com",
- },
- "X-App-ID": map[string]interface{}{
- "0": "abc123",
- },
- }),
- Interval: cloudflare.F(int64(0)),
- Method: cloudflare.F("GET"),
- Path: cloudflare.F("/health"),
- Port: cloudflare.F(int64(0)),
- ProbeZone: cloudflare.F("example.com"),
- Retries: cloudflare.F(int64(0)),
- Timeout: cloudflare.F(int64(0)),
- Type: cloudflare.F(cloudflare.LoadBalancerPoolHealthNewParamsTypeHTTPS),
- },
- )
- 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())
- }
-}
-
-func TestLoadBalancerPoolHealthGet(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"),
- )
- _, err := client.LoadBalancers.Pools.Health.Get(
- context.TODO(),
- "17b5962d775c646f3f9725cbc7a53df4",
- cloudflare.LoadBalancerPoolHealthGetParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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/loadbalancerpoolreference.go b/loadbalancerpoolreference.go
deleted file mode 100644
index f00c638a70f..00000000000
--- a/loadbalancerpoolreference.go
+++ /dev/null
@@ -1,200 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// LoadBalancerPoolReferenceService contains methods and other services that help
-// with interacting with the cloudflare API. Note, unlike clients, this service
-// does not read variables from the environment automatically. You should not
-// instantiate this service directly, and instead use the
-// [NewLoadBalancerPoolReferenceService] method instead.
-type LoadBalancerPoolReferenceService struct {
- Options []option.RequestOption
-}
-
-// NewLoadBalancerPoolReferenceService generates a new service that applies the
-// given options to each request. These options are applied after the parent
-// client's options (if there is one), and before any request-specific options.
-func NewLoadBalancerPoolReferenceService(opts ...option.RequestOption) (r *LoadBalancerPoolReferenceService) {
- r = &LoadBalancerPoolReferenceService{}
- r.Options = opts
- return
-}
-
-// Get the list of resources that reference the provided pool.
-func (r *LoadBalancerPoolReferenceService) Get(ctx context.Context, poolID string, query LoadBalancerPoolReferenceGetParams, opts ...option.RequestOption) (res *[]LoadBalancerPoolReferenceGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env LoadBalancerPoolReferenceGetResponseEnvelope
- path := fmt.Sprintf("accounts/%s/load_balancers/pools/%s/references", query.AccountID, poolID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type LoadBalancerPoolReferenceGetResponse struct {
- ReferenceType LoadBalancerPoolReferenceGetResponseReferenceType `json:"reference_type"`
- ResourceID string `json:"resource_id"`
- ResourceName string `json:"resource_name"`
- ResourceType string `json:"resource_type"`
- JSON loadBalancerPoolReferenceGetResponseJSON `json:"-"`
-}
-
-// loadBalancerPoolReferenceGetResponseJSON contains the JSON metadata for the
-// struct [LoadBalancerPoolReferenceGetResponse]
-type loadBalancerPoolReferenceGetResponseJSON struct {
- ReferenceType apijson.Field
- ResourceID apijson.Field
- ResourceName apijson.Field
- ResourceType apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerPoolReferenceGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerPoolReferenceGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type LoadBalancerPoolReferenceGetResponseReferenceType string
-
-const (
- LoadBalancerPoolReferenceGetResponseReferenceTypeStar LoadBalancerPoolReferenceGetResponseReferenceType = "*"
- LoadBalancerPoolReferenceGetResponseReferenceTypeReferral LoadBalancerPoolReferenceGetResponseReferenceType = "referral"
- LoadBalancerPoolReferenceGetResponseReferenceTypeReferrer LoadBalancerPoolReferenceGetResponseReferenceType = "referrer"
-)
-
-type LoadBalancerPoolReferenceGetParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type LoadBalancerPoolReferenceGetResponseEnvelope struct {
- Errors []LoadBalancerPoolReferenceGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []LoadBalancerPoolReferenceGetResponseEnvelopeMessages `json:"messages,required"`
- // List of resources that reference a given pool.
- Result []LoadBalancerPoolReferenceGetResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success LoadBalancerPoolReferenceGetResponseEnvelopeSuccess `json:"success,required"`
- ResultInfo LoadBalancerPoolReferenceGetResponseEnvelopeResultInfo `json:"result_info"`
- JSON loadBalancerPoolReferenceGetResponseEnvelopeJSON `json:"-"`
-}
-
-// loadBalancerPoolReferenceGetResponseEnvelopeJSON contains the JSON metadata for
-// the struct [LoadBalancerPoolReferenceGetResponseEnvelope]
-type loadBalancerPoolReferenceGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- ResultInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerPoolReferenceGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerPoolReferenceGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type LoadBalancerPoolReferenceGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON loadBalancerPoolReferenceGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// loadBalancerPoolReferenceGetResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct [LoadBalancerPoolReferenceGetResponseEnvelopeErrors]
-type loadBalancerPoolReferenceGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerPoolReferenceGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerPoolReferenceGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type LoadBalancerPoolReferenceGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON loadBalancerPoolReferenceGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// loadBalancerPoolReferenceGetResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct [LoadBalancerPoolReferenceGetResponseEnvelopeMessages]
-type loadBalancerPoolReferenceGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerPoolReferenceGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerPoolReferenceGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type LoadBalancerPoolReferenceGetResponseEnvelopeSuccess bool
-
-const (
- LoadBalancerPoolReferenceGetResponseEnvelopeSuccessTrue LoadBalancerPoolReferenceGetResponseEnvelopeSuccess = true
-)
-
-type LoadBalancerPoolReferenceGetResponseEnvelopeResultInfo struct {
- // Total number of results for the requested service
- Count float64 `json:"count"`
- // Current page within paginated list of results
- Page float64 `json:"page"`
- // Number of results per page of results
- PerPage float64 `json:"per_page"`
- // Total results available without any search parameters
- TotalCount float64 `json:"total_count"`
- JSON loadBalancerPoolReferenceGetResponseEnvelopeResultInfoJSON `json:"-"`
-}
-
-// loadBalancerPoolReferenceGetResponseEnvelopeResultInfoJSON contains the JSON
-// metadata for the struct [LoadBalancerPoolReferenceGetResponseEnvelopeResultInfo]
-type loadBalancerPoolReferenceGetResponseEnvelopeResultInfoJSON struct {
- Count apijson.Field
- Page apijson.Field
- PerPage apijson.Field
- TotalCount apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerPoolReferenceGetResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerPoolReferenceGetResponseEnvelopeResultInfoJSON) RawJSON() string {
- return r.raw
-}
diff --git a/loadbalancerpoolreference_test.go b/loadbalancerpoolreference_test.go
deleted file mode 100644
index 2f90b2befe9..00000000000
--- a/loadbalancerpoolreference_test.go
+++ /dev/null
@@ -1,44 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestLoadBalancerPoolReferenceGet(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"),
- )
- _, err := client.LoadBalancers.Pools.References.Get(
- context.TODO(),
- "17b5962d775c646f3f9725cbc7a53df4",
- cloudflare.LoadBalancerPoolReferenceGetParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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/loadbalancerpreview.go b/loadbalancerpreview.go
deleted file mode 100644
index 173fede7767..00000000000
--- a/loadbalancerpreview.go
+++ /dev/null
@@ -1,134 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// LoadBalancerPreviewService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewLoadBalancerPreviewService]
-// method instead.
-type LoadBalancerPreviewService struct {
- Options []option.RequestOption
-}
-
-// NewLoadBalancerPreviewService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewLoadBalancerPreviewService(opts ...option.RequestOption) (r *LoadBalancerPreviewService) {
- r = &LoadBalancerPreviewService{}
- r.Options = opts
- return
-}
-
-// Get the result of a previous preview operation using the provided preview_id.
-func (r *LoadBalancerPreviewService) Get(ctx context.Context, previewID interface{}, query LoadBalancerPreviewGetParams, opts ...option.RequestOption) (res *LoadBalancerPreviewGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env LoadBalancerPreviewGetResponseEnvelope
- path := fmt.Sprintf("accounts/%s/load_balancers/preview/%v", query.AccountID, previewID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type LoadBalancerPreviewGetResponse map[string]LoadBalancerPreviewGetResponse
-
-type LoadBalancerPreviewGetParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type LoadBalancerPreviewGetResponseEnvelope struct {
- Errors []LoadBalancerPreviewGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []LoadBalancerPreviewGetResponseEnvelopeMessages `json:"messages,required"`
- // Resulting health data from a preview operation.
- Result LoadBalancerPreviewGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success LoadBalancerPreviewGetResponseEnvelopeSuccess `json:"success,required"`
- JSON loadBalancerPreviewGetResponseEnvelopeJSON `json:"-"`
-}
-
-// loadBalancerPreviewGetResponseEnvelopeJSON contains the JSON metadata for the
-// struct [LoadBalancerPreviewGetResponseEnvelope]
-type loadBalancerPreviewGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerPreviewGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerPreviewGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type LoadBalancerPreviewGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON loadBalancerPreviewGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// loadBalancerPreviewGetResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [LoadBalancerPreviewGetResponseEnvelopeErrors]
-type loadBalancerPreviewGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerPreviewGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerPreviewGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type LoadBalancerPreviewGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON loadBalancerPreviewGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// loadBalancerPreviewGetResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [LoadBalancerPreviewGetResponseEnvelopeMessages]
-type loadBalancerPreviewGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerPreviewGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerPreviewGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type LoadBalancerPreviewGetResponseEnvelopeSuccess bool
-
-const (
- LoadBalancerPreviewGetResponseEnvelopeSuccessTrue LoadBalancerPreviewGetResponseEnvelopeSuccess = true
-)
diff --git a/loadbalancerregion.go b/loadbalancerregion.go
deleted file mode 100644
index 57c6d932303..00000000000
--- a/loadbalancerregion.go
+++ /dev/null
@@ -1,310 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
- "reflect"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/option"
- "github.com/tidwall/gjson"
-)
-
-// LoadBalancerRegionService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewLoadBalancerRegionService] method
-// instead.
-type LoadBalancerRegionService struct {
- Options []option.RequestOption
-}
-
-// NewLoadBalancerRegionService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewLoadBalancerRegionService(opts ...option.RequestOption) (r *LoadBalancerRegionService) {
- r = &LoadBalancerRegionService{}
- r.Options = opts
- return
-}
-
-// List all region mappings.
-func (r *LoadBalancerRegionService) List(ctx context.Context, params LoadBalancerRegionListParams, opts ...option.RequestOption) (res *LoadBalancerRegionListResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env LoadBalancerRegionListResponseEnvelope
- path := fmt.Sprintf("accounts/%s/load_balancers/regions", params.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Get a single region mapping.
-func (r *LoadBalancerRegionService) Get(ctx context.Context, regionID LoadBalancerRegionGetParamsRegionID, query LoadBalancerRegionGetParams, opts ...option.RequestOption) (res *LoadBalancerRegionGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env LoadBalancerRegionGetResponseEnvelope
- path := fmt.Sprintf("accounts/%s/load_balancers/regions/%v", query.AccountID, regionID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Union satisfied by [LoadBalancerRegionListResponseUnknown] or
-// [shared.UnionString].
-type LoadBalancerRegionListResponse interface {
- ImplementsLoadBalancerRegionListResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*LoadBalancerRegionListResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-// A list of countries and subdivisions mapped to a region.
-//
-// Union satisfied by [LoadBalancerRegionGetResponseUnknown] or
-// [shared.UnionString].
-type LoadBalancerRegionGetResponse interface {
- ImplementsLoadBalancerRegionGetResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*LoadBalancerRegionGetResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-type LoadBalancerRegionListParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
- // Two-letter alpha-2 country code followed in ISO 3166-1.
- CountryCodeA2 param.Field[string] `query:"country_code_a2"`
- // Two-letter subdivision code followed in ISO 3166-2.
- SubdivisionCode param.Field[string] `query:"subdivision_code"`
- // Two-letter subdivision code followed in ISO 3166-2.
- SubdivisionCodeA2 param.Field[string] `query:"subdivision_code_a2"`
-}
-
-// URLQuery serializes [LoadBalancerRegionListParams]'s query parameters as
-// `url.Values`.
-func (r LoadBalancerRegionListParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type LoadBalancerRegionListResponseEnvelope struct {
- Errors []LoadBalancerRegionListResponseEnvelopeErrors `json:"errors,required"`
- Messages []LoadBalancerRegionListResponseEnvelopeMessages `json:"messages,required"`
- Result LoadBalancerRegionListResponse `json:"result,required"`
- // Whether the API call was successful
- Success LoadBalancerRegionListResponseEnvelopeSuccess `json:"success,required"`
- JSON loadBalancerRegionListResponseEnvelopeJSON `json:"-"`
-}
-
-// loadBalancerRegionListResponseEnvelopeJSON contains the JSON metadata for the
-// struct [LoadBalancerRegionListResponseEnvelope]
-type loadBalancerRegionListResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerRegionListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerRegionListResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type LoadBalancerRegionListResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON loadBalancerRegionListResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// loadBalancerRegionListResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [LoadBalancerRegionListResponseEnvelopeErrors]
-type loadBalancerRegionListResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerRegionListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerRegionListResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type LoadBalancerRegionListResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON loadBalancerRegionListResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// loadBalancerRegionListResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [LoadBalancerRegionListResponseEnvelopeMessages]
-type loadBalancerRegionListResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerRegionListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerRegionListResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type LoadBalancerRegionListResponseEnvelopeSuccess bool
-
-const (
- LoadBalancerRegionListResponseEnvelopeSuccessTrue LoadBalancerRegionListResponseEnvelopeSuccess = true
-)
-
-type LoadBalancerRegionGetParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-// A list of Cloudflare regions. WNAM: Western North America, ENAM: Eastern North
-// America, WEU: Western Europe, EEU: Eastern Europe, NSAM: Northern South America,
-// SSAM: Southern South America, OC: Oceania, ME: Middle East, NAF: North Africa,
-// SAF: South Africa, SAS: Southern Asia, SEAS: South East Asia, NEAS: North East
-// Asia).
-type LoadBalancerRegionGetParamsRegionID string
-
-const (
- LoadBalancerRegionGetParamsRegionIDWnam LoadBalancerRegionGetParamsRegionID = "WNAM"
- LoadBalancerRegionGetParamsRegionIDEnam LoadBalancerRegionGetParamsRegionID = "ENAM"
- LoadBalancerRegionGetParamsRegionIDWeu LoadBalancerRegionGetParamsRegionID = "WEU"
- LoadBalancerRegionGetParamsRegionIDEeu LoadBalancerRegionGetParamsRegionID = "EEU"
- LoadBalancerRegionGetParamsRegionIDNsam LoadBalancerRegionGetParamsRegionID = "NSAM"
- LoadBalancerRegionGetParamsRegionIDSsam LoadBalancerRegionGetParamsRegionID = "SSAM"
- LoadBalancerRegionGetParamsRegionIDOc LoadBalancerRegionGetParamsRegionID = "OC"
- LoadBalancerRegionGetParamsRegionIDMe LoadBalancerRegionGetParamsRegionID = "ME"
- LoadBalancerRegionGetParamsRegionIDNaf LoadBalancerRegionGetParamsRegionID = "NAF"
- LoadBalancerRegionGetParamsRegionIDSaf LoadBalancerRegionGetParamsRegionID = "SAF"
- LoadBalancerRegionGetParamsRegionIDSas LoadBalancerRegionGetParamsRegionID = "SAS"
- LoadBalancerRegionGetParamsRegionIDSeas LoadBalancerRegionGetParamsRegionID = "SEAS"
- LoadBalancerRegionGetParamsRegionIDNeas LoadBalancerRegionGetParamsRegionID = "NEAS"
-)
-
-type LoadBalancerRegionGetResponseEnvelope struct {
- Errors []LoadBalancerRegionGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []LoadBalancerRegionGetResponseEnvelopeMessages `json:"messages,required"`
- // A list of countries and subdivisions mapped to a region.
- Result LoadBalancerRegionGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success LoadBalancerRegionGetResponseEnvelopeSuccess `json:"success,required"`
- JSON loadBalancerRegionGetResponseEnvelopeJSON `json:"-"`
-}
-
-// loadBalancerRegionGetResponseEnvelopeJSON contains the JSON metadata for the
-// struct [LoadBalancerRegionGetResponseEnvelope]
-type loadBalancerRegionGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerRegionGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerRegionGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type LoadBalancerRegionGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON loadBalancerRegionGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// loadBalancerRegionGetResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [LoadBalancerRegionGetResponseEnvelopeErrors]
-type loadBalancerRegionGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerRegionGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerRegionGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type LoadBalancerRegionGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON loadBalancerRegionGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// loadBalancerRegionGetResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [LoadBalancerRegionGetResponseEnvelopeMessages]
-type loadBalancerRegionGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerRegionGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerRegionGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type LoadBalancerRegionGetResponseEnvelopeSuccess bool
-
-const (
- LoadBalancerRegionGetResponseEnvelopeSuccessTrue LoadBalancerRegionGetResponseEnvelopeSuccess = true
-)
diff --git a/loadbalancerregion_test.go b/loadbalancerregion_test.go
deleted file mode 100644
index cba93fe1e9b..00000000000
--- a/loadbalancerregion_test.go
+++ /dev/null
@@ -1,73 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestLoadBalancerRegionListWithOptionalParams(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"),
- )
- _, err := client.LoadBalancers.Regions.List(context.TODO(), cloudflare.LoadBalancerRegionListParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- CountryCodeA2: cloudflare.F("US"),
- SubdivisionCode: cloudflare.F("CA"),
- SubdivisionCodeA2: cloudflare.F("CA"),
- })
- 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())
- }
-}
-
-func TestLoadBalancerRegionGet(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"),
- )
- _, err := client.LoadBalancers.Regions.Get(
- context.TODO(),
- cloudflare.LoadBalancerRegionGetParamsRegionIDWnam,
- cloudflare.LoadBalancerRegionGetParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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/loadbalancersearch.go b/loadbalancersearch.go
deleted file mode 100644
index 178bba8cc51..00000000000
--- a/loadbalancersearch.go
+++ /dev/null
@@ -1,206 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// LoadBalancerSearchService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewLoadBalancerSearchService] method
-// instead.
-type LoadBalancerSearchService struct {
- Options []option.RequestOption
-}
-
-// NewLoadBalancerSearchService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewLoadBalancerSearchService(opts ...option.RequestOption) (r *LoadBalancerSearchService) {
- r = &LoadBalancerSearchService{}
- r.Options = opts
- return
-}
-
-// Search for Load Balancing resources.
-func (r *LoadBalancerSearchService) Get(ctx context.Context, params LoadBalancerSearchGetParams, opts ...option.RequestOption) (res *[]LoadBalancerSearchGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env LoadBalancerSearchGetResponseEnvelope
- path := fmt.Sprintf("accounts/%s/load_balancers/search", params.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type LoadBalancerSearchGetResponse = interface{}
-
-type LoadBalancerSearchGetParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
- Page param.Field[interface{}] `query:"page"`
- PerPage param.Field[interface{}] `query:"per_page"`
- SearchParams param.Field[LoadBalancerSearchGetParamsSearchParams] `query:"search_params"`
-}
-
-// URLQuery serializes [LoadBalancerSearchGetParams]'s query parameters as
-// `url.Values`.
-func (r LoadBalancerSearchGetParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type LoadBalancerSearchGetParamsSearchParams struct {
- // Search query term.
- Query param.Field[string] `query:"query"`
- // The type of references to include ("\*" for all).
- References param.Field[LoadBalancerSearchGetParamsSearchParamsReferences] `query:"references"`
-}
-
-// URLQuery serializes [LoadBalancerSearchGetParamsSearchParams]'s query parameters
-// as `url.Values`.
-func (r LoadBalancerSearchGetParamsSearchParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// The type of references to include ("\*" for all).
-type LoadBalancerSearchGetParamsSearchParamsReferences string
-
-const (
- LoadBalancerSearchGetParamsSearchParamsReferencesEmpty LoadBalancerSearchGetParamsSearchParamsReferences = ""
- LoadBalancerSearchGetParamsSearchParamsReferencesStar LoadBalancerSearchGetParamsSearchParamsReferences = "*"
- LoadBalancerSearchGetParamsSearchParamsReferencesReferral LoadBalancerSearchGetParamsSearchParamsReferences = "referral"
- LoadBalancerSearchGetParamsSearchParamsReferencesReferrer LoadBalancerSearchGetParamsSearchParamsReferences = "referrer"
-)
-
-type LoadBalancerSearchGetResponseEnvelope struct {
- Errors []LoadBalancerSearchGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []LoadBalancerSearchGetResponseEnvelopeMessages `json:"messages,required"`
- Result []LoadBalancerSearchGetResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success LoadBalancerSearchGetResponseEnvelopeSuccess `json:"success,required"`
- ResultInfo LoadBalancerSearchGetResponseEnvelopeResultInfo `json:"result_info"`
- JSON loadBalancerSearchGetResponseEnvelopeJSON `json:"-"`
-}
-
-// loadBalancerSearchGetResponseEnvelopeJSON contains the JSON metadata for the
-// struct [LoadBalancerSearchGetResponseEnvelope]
-type loadBalancerSearchGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- ResultInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerSearchGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerSearchGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type LoadBalancerSearchGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON loadBalancerSearchGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// loadBalancerSearchGetResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [LoadBalancerSearchGetResponseEnvelopeErrors]
-type loadBalancerSearchGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerSearchGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerSearchGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type LoadBalancerSearchGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON loadBalancerSearchGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// loadBalancerSearchGetResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [LoadBalancerSearchGetResponseEnvelopeMessages]
-type loadBalancerSearchGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerSearchGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerSearchGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type LoadBalancerSearchGetResponseEnvelopeSuccess bool
-
-const (
- LoadBalancerSearchGetResponseEnvelopeSuccessTrue LoadBalancerSearchGetResponseEnvelopeSuccess = true
-)
-
-type LoadBalancerSearchGetResponseEnvelopeResultInfo struct {
- // Total number of results for the requested service
- Count float64 `json:"count"`
- // Current page within paginated list of results
- Page float64 `json:"page"`
- // Number of results per page of results
- PerPage float64 `json:"per_page"`
- // Total results available without any search parameters
- TotalCount float64 `json:"total_count"`
- JSON loadBalancerSearchGetResponseEnvelopeResultInfoJSON `json:"-"`
-}
-
-// loadBalancerSearchGetResponseEnvelopeResultInfoJSON contains the JSON metadata
-// for the struct [LoadBalancerSearchGetResponseEnvelopeResultInfo]
-type loadBalancerSearchGetResponseEnvelopeResultInfoJSON struct {
- Count apijson.Field
- Page apijson.Field
- PerPage apijson.Field
- TotalCount apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LoadBalancerSearchGetResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r loadBalancerSearchGetResponseEnvelopeResultInfoJSON) RawJSON() string {
- return r.raw
-}
diff --git a/loadbalancersearch_test.go b/loadbalancersearch_test.go
deleted file mode 100644
index 6a46c039b0e..00000000000
--- a/loadbalancersearch_test.go
+++ /dev/null
@@ -1,46 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestLoadBalancerSearchGetWithOptionalParams(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"),
- )
- _, err := client.LoadBalancers.Searches.Get(context.TODO(), cloudflare.LoadBalancerSearchGetParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Page: cloudflare.F[any](map[string]interface{}{}),
- PerPage: cloudflare.F[any](map[string]interface{}{}),
- SearchParams: cloudflare.F(cloudflare.LoadBalancerSearchGetParamsSearchParams{
- Query: cloudflare.F("primary"),
- References: cloudflare.F(cloudflare.LoadBalancerSearchGetParamsSearchParamsReferencesStar),
- }),
- })
- 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/logcontrol.go b/logcontrol.go
deleted file mode 100644
index 09819461f21..00000000000
--- a/logcontrol.go
+++ /dev/null
@@ -1,28 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// LogControlService contains methods and other services that help with interacting
-// with the cloudflare API. Note, unlike clients, this service does not read
-// variables from the environment automatically. You should not instantiate this
-// service directly, and instead use the [NewLogControlService] method instead.
-type LogControlService struct {
- Options []option.RequestOption
- Retention *LogControlRetentionService
- Cmb *LogControlCmbService
-}
-
-// NewLogControlService generates a new service that applies the given options to
-// each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewLogControlService(opts ...option.RequestOption) (r *LogControlService) {
- r = &LogControlService{}
- r.Options = opts
- r.Retention = NewLogControlRetentionService(opts...)
- r.Cmb = NewLogControlCmbService(opts...)
- return
-}
diff --git a/logcontrolcmb.go b/logcontrolcmb.go
deleted file mode 100644
index 8f823100eb8..00000000000
--- a/logcontrolcmb.go
+++ /dev/null
@@ -1,27 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// LogControlCmbService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewLogControlCmbService] method
-// instead.
-type LogControlCmbService struct {
- Options []option.RequestOption
- Config *LogControlCmbConfigService
-}
-
-// NewLogControlCmbService generates a new service that applies the given options
-// to each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewLogControlCmbService(opts ...option.RequestOption) (r *LogControlCmbService) {
- r = &LogControlCmbService{}
- r.Options = opts
- r.Config = NewLogControlCmbConfigService(opts...)
- return
-}
diff --git a/logcontrolcmbconfig.go b/logcontrolcmbconfig.go
deleted file mode 100644
index c184d6096de..00000000000
--- a/logcontrolcmbconfig.go
+++ /dev/null
@@ -1,407 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "reflect"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/option"
- "github.com/tidwall/gjson"
-)
-
-// LogControlCmbConfigService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewLogControlCmbConfigService]
-// method instead.
-type LogControlCmbConfigService struct {
- Options []option.RequestOption
-}
-
-// NewLogControlCmbConfigService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewLogControlCmbConfigService(opts ...option.RequestOption) (r *LogControlCmbConfigService) {
- r = &LogControlCmbConfigService{}
- r.Options = opts
- return
-}
-
-// Updates CMB config.
-func (r *LogControlCmbConfigService) New(ctx context.Context, params LogControlCmbConfigNewParams, opts ...option.RequestOption) (res *LogControlCmbConfigNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env LogControlCmbConfigNewResponseEnvelope
- path := fmt.Sprintf("accounts/%s/logs/control/cmb/config", params.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Deletes CMB config.
-func (r *LogControlCmbConfigService) Delete(ctx context.Context, body LogControlCmbConfigDeleteParams, opts ...option.RequestOption) (res *LogControlCmbConfigDeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env LogControlCmbConfigDeleteResponseEnvelope
- path := fmt.Sprintf("accounts/%s/logs/control/cmb/config", body.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Gets CMB config.
-func (r *LogControlCmbConfigService) Get(ctx context.Context, query LogControlCmbConfigGetParams, opts ...option.RequestOption) (res *LogControlCmbConfigGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env LogControlCmbConfigGetResponseEnvelope
- path := fmt.Sprintf("accounts/%s/logs/control/cmb/config", query.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type LogControlCmbConfigNewResponse struct {
- // Comma-separated list of regions.
- Regions string `json:"regions"`
- JSON logControlCmbConfigNewResponseJSON `json:"-"`
-}
-
-// logControlCmbConfigNewResponseJSON contains the JSON metadata for the struct
-// [LogControlCmbConfigNewResponse]
-type logControlCmbConfigNewResponseJSON struct {
- Regions apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LogControlCmbConfigNewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r logControlCmbConfigNewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// Union satisfied by [LogControlCmbConfigDeleteResponseUnknown],
-// [LogControlCmbConfigDeleteResponseArray] or [shared.UnionString].
-type LogControlCmbConfigDeleteResponse interface {
- ImplementsLogControlCmbConfigDeleteResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*LogControlCmbConfigDeleteResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(LogControlCmbConfigDeleteResponseArray{}),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-type LogControlCmbConfigDeleteResponseArray []interface{}
-
-func (r LogControlCmbConfigDeleteResponseArray) ImplementsLogControlCmbConfigDeleteResponse() {}
-
-type LogControlCmbConfigGetResponse struct {
- // Comma-separated list of regions.
- Regions string `json:"regions"`
- JSON logControlCmbConfigGetResponseJSON `json:"-"`
-}
-
-// logControlCmbConfigGetResponseJSON contains the JSON metadata for the struct
-// [LogControlCmbConfigGetResponse]
-type logControlCmbConfigGetResponseJSON struct {
- Regions apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LogControlCmbConfigGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r logControlCmbConfigGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type LogControlCmbConfigNewParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
- // Comma-separated list of regions.
- Regions param.Field[string] `json:"regions"`
-}
-
-func (r LogControlCmbConfigNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type LogControlCmbConfigNewResponseEnvelope struct {
- Errors []LogControlCmbConfigNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []LogControlCmbConfigNewResponseEnvelopeMessages `json:"messages,required"`
- Result LogControlCmbConfigNewResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success LogControlCmbConfigNewResponseEnvelopeSuccess `json:"success,required"`
- JSON logControlCmbConfigNewResponseEnvelopeJSON `json:"-"`
-}
-
-// logControlCmbConfigNewResponseEnvelopeJSON contains the JSON metadata for the
-// struct [LogControlCmbConfigNewResponseEnvelope]
-type logControlCmbConfigNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LogControlCmbConfigNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r logControlCmbConfigNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type LogControlCmbConfigNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON logControlCmbConfigNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// logControlCmbConfigNewResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [LogControlCmbConfigNewResponseEnvelopeErrors]
-type logControlCmbConfigNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LogControlCmbConfigNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r logControlCmbConfigNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type LogControlCmbConfigNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON logControlCmbConfigNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// logControlCmbConfigNewResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [LogControlCmbConfigNewResponseEnvelopeMessages]
-type logControlCmbConfigNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LogControlCmbConfigNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r logControlCmbConfigNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type LogControlCmbConfigNewResponseEnvelopeSuccess bool
-
-const (
- LogControlCmbConfigNewResponseEnvelopeSuccessTrue LogControlCmbConfigNewResponseEnvelopeSuccess = true
-)
-
-type LogControlCmbConfigDeleteParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type LogControlCmbConfigDeleteResponseEnvelope struct {
- Errors []LogControlCmbConfigDeleteResponseEnvelopeErrors `json:"errors,required"`
- Messages []LogControlCmbConfigDeleteResponseEnvelopeMessages `json:"messages,required"`
- Result LogControlCmbConfigDeleteResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success LogControlCmbConfigDeleteResponseEnvelopeSuccess `json:"success,required"`
- JSON logControlCmbConfigDeleteResponseEnvelopeJSON `json:"-"`
-}
-
-// logControlCmbConfigDeleteResponseEnvelopeJSON contains the JSON metadata for the
-// struct [LogControlCmbConfigDeleteResponseEnvelope]
-type logControlCmbConfigDeleteResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LogControlCmbConfigDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r logControlCmbConfigDeleteResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type LogControlCmbConfigDeleteResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON logControlCmbConfigDeleteResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// logControlCmbConfigDeleteResponseEnvelopeErrorsJSON contains the JSON metadata
-// for the struct [LogControlCmbConfigDeleteResponseEnvelopeErrors]
-type logControlCmbConfigDeleteResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LogControlCmbConfigDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r logControlCmbConfigDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type LogControlCmbConfigDeleteResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON logControlCmbConfigDeleteResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// logControlCmbConfigDeleteResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [LogControlCmbConfigDeleteResponseEnvelopeMessages]
-type logControlCmbConfigDeleteResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LogControlCmbConfigDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r logControlCmbConfigDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type LogControlCmbConfigDeleteResponseEnvelopeSuccess bool
-
-const (
- LogControlCmbConfigDeleteResponseEnvelopeSuccessTrue LogControlCmbConfigDeleteResponseEnvelopeSuccess = true
-)
-
-type LogControlCmbConfigGetParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type LogControlCmbConfigGetResponseEnvelope struct {
- Errors []LogControlCmbConfigGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []LogControlCmbConfigGetResponseEnvelopeMessages `json:"messages,required"`
- Result LogControlCmbConfigGetResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success LogControlCmbConfigGetResponseEnvelopeSuccess `json:"success,required"`
- JSON logControlCmbConfigGetResponseEnvelopeJSON `json:"-"`
-}
-
-// logControlCmbConfigGetResponseEnvelopeJSON contains the JSON metadata for the
-// struct [LogControlCmbConfigGetResponseEnvelope]
-type logControlCmbConfigGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LogControlCmbConfigGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r logControlCmbConfigGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type LogControlCmbConfigGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON logControlCmbConfigGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// logControlCmbConfigGetResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [LogControlCmbConfigGetResponseEnvelopeErrors]
-type logControlCmbConfigGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LogControlCmbConfigGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r logControlCmbConfigGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type LogControlCmbConfigGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON logControlCmbConfigGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// logControlCmbConfigGetResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [LogControlCmbConfigGetResponseEnvelopeMessages]
-type logControlCmbConfigGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LogControlCmbConfigGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r logControlCmbConfigGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type LogControlCmbConfigGetResponseEnvelopeSuccess bool
-
-const (
- LogControlCmbConfigGetResponseEnvelopeSuccessTrue LogControlCmbConfigGetResponseEnvelopeSuccess = true
-)
diff --git a/logcontrolcmbconfig_test.go b/logcontrolcmbconfig_test.go
deleted file mode 100644
index 61b21519a01..00000000000
--- a/logcontrolcmbconfig_test.go
+++ /dev/null
@@ -1,93 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestLogControlCmbConfigNewWithOptionalParams(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"),
- )
- _, err := client.Logs.Control.Cmb.Config.New(context.TODO(), cloudflare.LogControlCmbConfigNewParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Regions: cloudflare.F("eu"),
- })
- 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())
- }
-}
-
-func TestLogControlCmbConfigDelete(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"),
- )
- _, err := client.Logs.Control.Cmb.Config.Delete(context.TODO(), cloudflare.LogControlCmbConfigDeleteParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- })
- 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())
- }
-}
-
-func TestLogControlCmbConfigGet(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"),
- )
- _, err := client.Logs.Control.Cmb.Config.Get(context.TODO(), cloudflare.LogControlCmbConfigGetParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- })
- 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/logcontrolretention.go b/logcontrolretention.go
deleted file mode 100644
index 823ab21136a..00000000000
--- a/logcontrolretention.go
+++ /dev/null
@@ -1,27 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// LogControlRetentionService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewLogControlRetentionService]
-// method instead.
-type LogControlRetentionService struct {
- Options []option.RequestOption
- Flag *LogControlRetentionFlagService
-}
-
-// NewLogControlRetentionService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewLogControlRetentionService(opts ...option.RequestOption) (r *LogControlRetentionService) {
- r = &LogControlRetentionService{}
- r.Options = opts
- r.Flag = NewLogControlRetentionFlagService(opts...)
- return
-}
diff --git a/logcontrolretentionflag.go b/logcontrolretentionflag.go
deleted file mode 100644
index d091c6d0d9f..00000000000
--- a/logcontrolretentionflag.go
+++ /dev/null
@@ -1,271 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// LogControlRetentionFlagService contains methods and other services that help
-// with interacting with the cloudflare API. Note, unlike clients, this service
-// does not read variables from the environment automatically. You should not
-// instantiate this service directly, and instead use the
-// [NewLogControlRetentionFlagService] method instead.
-type LogControlRetentionFlagService struct {
- Options []option.RequestOption
-}
-
-// NewLogControlRetentionFlagService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewLogControlRetentionFlagService(opts ...option.RequestOption) (r *LogControlRetentionFlagService) {
- r = &LogControlRetentionFlagService{}
- r.Options = opts
- return
-}
-
-// Updates log retention flag for Logpull API.
-func (r *LogControlRetentionFlagService) New(ctx context.Context, zoneIdentifier string, body LogControlRetentionFlagNewParams, opts ...option.RequestOption) (res *LogControlRetentionFlagNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env LogControlRetentionFlagNewResponseEnvelope
- path := fmt.Sprintf("zones/%s/logs/control/retention/flag", zoneIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Gets log retention flag for Logpull API.
-func (r *LogControlRetentionFlagService) Get(ctx context.Context, zoneIdentifier string, opts ...option.RequestOption) (res *LogControlRetentionFlagGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env LogControlRetentionFlagGetResponseEnvelope
- path := fmt.Sprintf("zones/%s/logs/control/retention/flag", zoneIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type LogControlRetentionFlagNewResponse struct {
- Flag bool `json:"flag"`
- JSON logControlRetentionFlagNewResponseJSON `json:"-"`
-}
-
-// logControlRetentionFlagNewResponseJSON contains the JSON metadata for the struct
-// [LogControlRetentionFlagNewResponse]
-type logControlRetentionFlagNewResponseJSON struct {
- Flag apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LogControlRetentionFlagNewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r logControlRetentionFlagNewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type LogControlRetentionFlagGetResponse struct {
- Flag bool `json:"flag"`
- JSON logControlRetentionFlagGetResponseJSON `json:"-"`
-}
-
-// logControlRetentionFlagGetResponseJSON contains the JSON metadata for the struct
-// [LogControlRetentionFlagGetResponse]
-type logControlRetentionFlagGetResponseJSON struct {
- Flag apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LogControlRetentionFlagGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r logControlRetentionFlagGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type LogControlRetentionFlagNewParams struct {
- // The log retention flag for Logpull API.
- Flag param.Field[bool] `json:"flag,required"`
-}
-
-func (r LogControlRetentionFlagNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type LogControlRetentionFlagNewResponseEnvelope struct {
- Errors []LogControlRetentionFlagNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []LogControlRetentionFlagNewResponseEnvelopeMessages `json:"messages,required"`
- Result LogControlRetentionFlagNewResponse `json:"result,required"`
- // Whether the API call was successful
- Success LogControlRetentionFlagNewResponseEnvelopeSuccess `json:"success,required"`
- JSON logControlRetentionFlagNewResponseEnvelopeJSON `json:"-"`
-}
-
-// logControlRetentionFlagNewResponseEnvelopeJSON contains the JSON metadata for
-// the struct [LogControlRetentionFlagNewResponseEnvelope]
-type logControlRetentionFlagNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LogControlRetentionFlagNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r logControlRetentionFlagNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type LogControlRetentionFlagNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON logControlRetentionFlagNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// logControlRetentionFlagNewResponseEnvelopeErrorsJSON contains the JSON metadata
-// for the struct [LogControlRetentionFlagNewResponseEnvelopeErrors]
-type logControlRetentionFlagNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LogControlRetentionFlagNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r logControlRetentionFlagNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type LogControlRetentionFlagNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON logControlRetentionFlagNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// logControlRetentionFlagNewResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct [LogControlRetentionFlagNewResponseEnvelopeMessages]
-type logControlRetentionFlagNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LogControlRetentionFlagNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r logControlRetentionFlagNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type LogControlRetentionFlagNewResponseEnvelopeSuccess bool
-
-const (
- LogControlRetentionFlagNewResponseEnvelopeSuccessTrue LogControlRetentionFlagNewResponseEnvelopeSuccess = true
-)
-
-type LogControlRetentionFlagGetResponseEnvelope struct {
- Errors []LogControlRetentionFlagGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []LogControlRetentionFlagGetResponseEnvelopeMessages `json:"messages,required"`
- Result LogControlRetentionFlagGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success LogControlRetentionFlagGetResponseEnvelopeSuccess `json:"success,required"`
- JSON logControlRetentionFlagGetResponseEnvelopeJSON `json:"-"`
-}
-
-// logControlRetentionFlagGetResponseEnvelopeJSON contains the JSON metadata for
-// the struct [LogControlRetentionFlagGetResponseEnvelope]
-type logControlRetentionFlagGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LogControlRetentionFlagGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r logControlRetentionFlagGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type LogControlRetentionFlagGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON logControlRetentionFlagGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// logControlRetentionFlagGetResponseEnvelopeErrorsJSON contains the JSON metadata
-// for the struct [LogControlRetentionFlagGetResponseEnvelopeErrors]
-type logControlRetentionFlagGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LogControlRetentionFlagGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r logControlRetentionFlagGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type LogControlRetentionFlagGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON logControlRetentionFlagGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// logControlRetentionFlagGetResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct [LogControlRetentionFlagGetResponseEnvelopeMessages]
-type logControlRetentionFlagGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LogControlRetentionFlagGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r logControlRetentionFlagGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type LogControlRetentionFlagGetResponseEnvelopeSuccess bool
-
-const (
- LogControlRetentionFlagGetResponseEnvelopeSuccessTrue LogControlRetentionFlagGetResponseEnvelopeSuccess = true
-)
diff --git a/logcontrolretentionflag_test.go b/logcontrolretentionflag_test.go
deleted file mode 100644
index 1d64c2cefd2..00000000000
--- a/logcontrolretentionflag_test.go
+++ /dev/null
@@ -1,68 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestLogControlRetentionFlagNew(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"),
- )
- _, err := client.Logs.Control.Retention.Flag.New(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.LogControlRetentionFlagNewParams{
- Flag: cloudflare.F(true),
- },
- )
- 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())
- }
-}
-
-func TestLogControlRetentionFlagGet(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"),
- )
- _, err := client.Logs.Control.Retention.Flag.Get(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353")
- 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/logpush.go b/logpush.go
deleted file mode 100644
index abd62e5304c..00000000000
--- a/logpush.go
+++ /dev/null
@@ -1,34 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// LogpushService contains methods and other services that help with interacting
-// with the cloudflare API. Note, unlike clients, this service does not read
-// variables from the environment automatically. You should not instantiate this
-// service directly, and instead use the [NewLogpushService] method instead.
-type LogpushService struct {
- Options []option.RequestOption
- Datasets *LogpushDatasetService
- Edge *LogpushEdgeService
- Jobs *LogpushJobService
- Ownership *LogpushOwnershipService
- Validate *LogpushValidateService
-}
-
-// NewLogpushService generates a new service that applies the given options to each
-// request. These options are applied after the parent client's options (if there
-// is one), and before any request-specific options.
-func NewLogpushService(opts ...option.RequestOption) (r *LogpushService) {
- r = &LogpushService{}
- r.Options = opts
- r.Datasets = NewLogpushDatasetService(opts...)
- r.Edge = NewLogpushEdgeService(opts...)
- r.Jobs = NewLogpushJobService(opts...)
- r.Ownership = NewLogpushOwnershipService(opts...)
- r.Validate = NewLogpushValidateService(opts...)
- return
-}
diff --git a/logpush/aliases.go b/logpush/aliases.go
new file mode 100644
index 00000000000..a0a164e290b
--- /dev/null
+++ b/logpush/aliases.go
@@ -0,0 +1,9 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package logpush
+
+import (
+ "github.com/cloudflare/cloudflare-go/internal/apierror"
+)
+
+type Error = apierror.Error
diff --git a/logpush/dataset.go b/logpush/dataset.go
new file mode 100644
index 00000000000..4eb8afd2015
--- /dev/null
+++ b/logpush/dataset.go
@@ -0,0 +1,28 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package logpush
+
+import (
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// DatasetService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewDatasetService] method instead.
+type DatasetService struct {
+ Options []option.RequestOption
+ Fields *DatasetFieldService
+ Jobs *DatasetJobService
+}
+
+// NewDatasetService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewDatasetService(opts ...option.RequestOption) (r *DatasetService) {
+ r = &DatasetService{}
+ r.Options = opts
+ r.Fields = NewDatasetFieldService(opts...)
+ r.Jobs = NewDatasetJobService(opts...)
+ return
+}
diff --git a/logpush/datasetfield.go b/logpush/datasetfield.go
new file mode 100644
index 00000000000..4c2a36a4cd6
--- /dev/null
+++ b/logpush/datasetfield.go
@@ -0,0 +1,145 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package logpush
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// DatasetFieldService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewDatasetFieldService] method
+// instead.
+type DatasetFieldService struct {
+ Options []option.RequestOption
+}
+
+// NewDatasetFieldService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewDatasetFieldService(opts ...option.RequestOption) (r *DatasetFieldService) {
+ r = &DatasetFieldService{}
+ r.Options = opts
+ return
+}
+
+// Lists all fields available for a dataset. The response result is an object with
+// key-value pairs, where keys are field names, and values are descriptions.
+func (r *DatasetFieldService) Get(ctx context.Context, datasetID string, query DatasetFieldGetParams, opts ...option.RequestOption) (res *DatasetFieldGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env DatasetFieldGetResponseEnvelope
+ var accountOrZone string
+ var accountOrZoneID param.Field[string]
+ if query.AccountID.Present {
+ accountOrZone = "accounts"
+ accountOrZoneID = query.AccountID
+ } else {
+ accountOrZone = "zones"
+ accountOrZoneID = query.ZoneID
+ }
+ path := fmt.Sprintf("%s/%s/logpush/datasets/%s/fields", accountOrZone, accountOrZoneID, datasetID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type DatasetFieldGetResponse = interface{}
+
+type DatasetFieldGetParams struct {
+ // The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+ AccountID param.Field[string] `path:"account_id"`
+ // The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+ ZoneID param.Field[string] `path:"zone_id"`
+}
+
+type DatasetFieldGetResponseEnvelope struct {
+ Errors []DatasetFieldGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []DatasetFieldGetResponseEnvelopeMessages `json:"messages,required"`
+ Result DatasetFieldGetResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success DatasetFieldGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON datasetFieldGetResponseEnvelopeJSON `json:"-"`
+}
+
+// datasetFieldGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [DatasetFieldGetResponseEnvelope]
+type datasetFieldGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DatasetFieldGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r datasetFieldGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type DatasetFieldGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON datasetFieldGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// datasetFieldGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [DatasetFieldGetResponseEnvelopeErrors]
+type datasetFieldGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DatasetFieldGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r datasetFieldGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type DatasetFieldGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON datasetFieldGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// datasetFieldGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [DatasetFieldGetResponseEnvelopeMessages]
+type datasetFieldGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DatasetFieldGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r datasetFieldGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type DatasetFieldGetResponseEnvelopeSuccess bool
+
+const (
+ DatasetFieldGetResponseEnvelopeSuccessTrue DatasetFieldGetResponseEnvelopeSuccess = true
+)
diff --git a/logpush/datasetfield_test.go b/logpush/datasetfield_test.go
new file mode 100644
index 00000000000..58fdf8b14f3
--- /dev/null
+++ b/logpush/datasetfield_test.go
@@ -0,0 +1,46 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package logpush_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/logpush"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestDatasetFieldGetWithOptionalParams(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"),
+ )
+ _, err := client.Logpush.Datasets.Fields.Get(
+ context.TODO(),
+ "http_requests",
+ logpush.DatasetFieldGetParams{
+ AccountID: cloudflare.F("string"),
+ ZoneID: cloudflare.F("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/logpush/datasetjob.go b/logpush/datasetjob.go
new file mode 100644
index 00000000000..0ac4dba985b
--- /dev/null
+++ b/logpush/datasetjob.go
@@ -0,0 +1,310 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package logpush
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// DatasetJobService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewDatasetJobService] method instead.
+type DatasetJobService struct {
+ Options []option.RequestOption
+}
+
+// NewDatasetJobService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewDatasetJobService(opts ...option.RequestOption) (r *DatasetJobService) {
+ r = &DatasetJobService{}
+ r.Options = opts
+ return
+}
+
+// Lists Logpush jobs for an account or zone for a dataset.
+func (r *DatasetJobService) Get(ctx context.Context, datasetID string, query DatasetJobGetParams, opts ...option.RequestOption) (res *[]LogpushLogpushJob, err error) {
+ opts = append(r.Options[:], opts...)
+ var env DatasetJobGetResponseEnvelope
+ var accountOrZone string
+ var accountOrZoneID param.Field[string]
+ if query.AccountID.Present {
+ accountOrZone = "accounts"
+ accountOrZoneID = query.AccountID
+ } else {
+ accountOrZone = "zones"
+ accountOrZoneID = query.ZoneID
+ }
+ path := fmt.Sprintf("%s/%s/logpush/datasets/%s/jobs", accountOrZone, accountOrZoneID, datasetID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type LogpushLogpushJob struct {
+ // Unique id of the job.
+ ID int64 `json:"id"`
+ // Name of the dataset.
+ Dataset string `json:"dataset,nullable"`
+ // Uniquely identifies a resource (such as an s3 bucket) where data will be pushed.
+ // Additional configuration parameters supported by the destination may be
+ // included.
+ DestinationConf string `json:"destination_conf" format:"uri"`
+ // Flag that indicates if the job is enabled.
+ Enabled bool `json:"enabled"`
+ // If not null, the job is currently failing. Failures are usually repetitive
+ // (example: no permissions to write to destination bucket). Only the last failure
+ // is recorded. On successful execution of a job the error_message and last_error
+ // are set to null.
+ ErrorMessage time.Time `json:"error_message,nullable" format:"date-time"`
+ // The frequency at which Cloudflare sends batches of logs to your destination.
+ // Setting frequency to high sends your logs in larger quantities of smaller files.
+ // Setting frequency to low sends logs in smaller quantities of larger files.
+ Frequency LogpushLogpushJobFrequency `json:"frequency,nullable"`
+ // Records the last time for which logs have been successfully pushed. If the last
+ // successful push was for logs range 2018-07-23T10:00:00Z to 2018-07-23T10:01:00Z
+ // then the value of this field will be 2018-07-23T10:01:00Z. If the job has never
+ // run or has just been enabled and hasn't run yet then the field will be empty.
+ LastComplete time.Time `json:"last_complete,nullable" format:"date-time"`
+ // Records the last time the job failed. If not null, the job is currently failing.
+ // If null, the job has either never failed or has run successfully at least once
+ // since last failure. See also the error_message field.
+ LastError time.Time `json:"last_error,nullable" format:"date-time"`
+ // This field is deprecated. Use `output_options` instead. Configuration string. It
+ // specifies things like requested fields and timestamp formats. If migrating from
+ // the logpull api, copy the url (full url or just the query string) of your call
+ // here, and logpush will keep on making this call for you, setting start and end
+ // times appropriately.
+ LogpullOptions string `json:"logpull_options,nullable" format:"uri-reference"`
+ // Optional human readable job name. Not unique. Cloudflare suggests that you set
+ // this to a meaningful string, like the domain name, to make it easier to identify
+ // your job.
+ Name string `json:"name,nullable"`
+ // The structured replacement for `logpull_options`. When including this field, the
+ // `logpull_option` field will be ignored.
+ OutputOptions LogpushLogpushJobOutputOptions `json:"output_options,nullable"`
+ JSON logpushLogpushJobJSON `json:"-"`
+}
+
+// logpushLogpushJobJSON contains the JSON metadata for the struct
+// [LogpushLogpushJob]
+type logpushLogpushJobJSON struct {
+ ID apijson.Field
+ Dataset apijson.Field
+ DestinationConf apijson.Field
+ Enabled apijson.Field
+ ErrorMessage apijson.Field
+ Frequency apijson.Field
+ LastComplete apijson.Field
+ LastError apijson.Field
+ LogpullOptions apijson.Field
+ Name apijson.Field
+ OutputOptions apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LogpushLogpushJob) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r logpushLogpushJobJSON) RawJSON() string {
+ return r.raw
+}
+
+// The frequency at which Cloudflare sends batches of logs to your destination.
+// Setting frequency to high sends your logs in larger quantities of smaller files.
+// Setting frequency to low sends logs in smaller quantities of larger files.
+type LogpushLogpushJobFrequency string
+
+const (
+ LogpushLogpushJobFrequencyHigh LogpushLogpushJobFrequency = "high"
+ LogpushLogpushJobFrequencyLow LogpushLogpushJobFrequency = "low"
+)
+
+// The structured replacement for `logpull_options`. When including this field, the
+// `logpull_option` field will be ignored.
+type LogpushLogpushJobOutputOptions struct {
+ // String to be prepended before each batch.
+ BatchPrefix string `json:"batch_prefix,nullable"`
+ // String to be appended after each batch.
+ BatchSuffix string `json:"batch_suffix,nullable"`
+ // If set to true, will cause all occurrences of `${` in the generated files to be
+ // replaced with `x{`.
+ Cve2021_4428 bool `json:"CVE-2021-4428,nullable"`
+ // String to join fields. This field be ignored when `record_template` is set.
+ FieldDelimiter string `json:"field_delimiter,nullable"`
+ // List of field names to be included in the Logpush output. For the moment, there
+ // is no option to add all fields at once, so you must specify all the fields names
+ // you are interested in.
+ FieldNames []string `json:"field_names"`
+ // Specifies the output type, such as `ndjson` or `csv`. This sets default values
+ // for the rest of the settings, depending on the chosen output type. Some
+ // formatting rules, like string quoting, are different between output types.
+ OutputType LogpushLogpushJobOutputOptionsOutputType `json:"output_type"`
+ // String to be inserted in-between the records as separator.
+ RecordDelimiter string `json:"record_delimiter,nullable"`
+ // String to be prepended before each record.
+ RecordPrefix string `json:"record_prefix,nullable"`
+ // String to be appended after each record.
+ RecordSuffix string `json:"record_suffix,nullable"`
+ // String to use as template for each record instead of the default comma-separated
+ // list. All fields used in the template must be present in `field_names` as well,
+ // otherwise they will end up as null. Format as a Go `text/template` without any
+ // standard functions, like conditionals, loops, sub-templates, etc.
+ RecordTemplate string `json:"record_template,nullable"`
+ // Floating number to specify sampling rate. Sampling is applied on top of
+ // filtering, and regardless of the current `sample_interval` of the data.
+ SampleRate float64 `json:"sample_rate,nullable"`
+ // String to specify the format for timestamps, such as `unixnano`, `unix`, or
+ // `rfc3339`.
+ TimestampFormat LogpushLogpushJobOutputOptionsTimestampFormat `json:"timestamp_format"`
+ JSON logpushLogpushJobOutputOptionsJSON `json:"-"`
+}
+
+// logpushLogpushJobOutputOptionsJSON contains the JSON metadata for the struct
+// [LogpushLogpushJobOutputOptions]
+type logpushLogpushJobOutputOptionsJSON struct {
+ BatchPrefix apijson.Field
+ BatchSuffix apijson.Field
+ Cve2021_4428 apijson.Field
+ FieldDelimiter apijson.Field
+ FieldNames apijson.Field
+ OutputType apijson.Field
+ RecordDelimiter apijson.Field
+ RecordPrefix apijson.Field
+ RecordSuffix apijson.Field
+ RecordTemplate apijson.Field
+ SampleRate apijson.Field
+ TimestampFormat apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LogpushLogpushJobOutputOptions) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r logpushLogpushJobOutputOptionsJSON) RawJSON() string {
+ return r.raw
+}
+
+// Specifies the output type, such as `ndjson` or `csv`. This sets default values
+// for the rest of the settings, depending on the chosen output type. Some
+// formatting rules, like string quoting, are different between output types.
+type LogpushLogpushJobOutputOptionsOutputType string
+
+const (
+ LogpushLogpushJobOutputOptionsOutputTypeNdjson LogpushLogpushJobOutputOptionsOutputType = "ndjson"
+ LogpushLogpushJobOutputOptionsOutputTypeCsv LogpushLogpushJobOutputOptionsOutputType = "csv"
+)
+
+// String to specify the format for timestamps, such as `unixnano`, `unix`, or
+// `rfc3339`.
+type LogpushLogpushJobOutputOptionsTimestampFormat string
+
+const (
+ LogpushLogpushJobOutputOptionsTimestampFormatUnixnano LogpushLogpushJobOutputOptionsTimestampFormat = "unixnano"
+ LogpushLogpushJobOutputOptionsTimestampFormatUnix LogpushLogpushJobOutputOptionsTimestampFormat = "unix"
+ LogpushLogpushJobOutputOptionsTimestampFormatRfc3339 LogpushLogpushJobOutputOptionsTimestampFormat = "rfc3339"
+)
+
+type DatasetJobGetParams struct {
+ // The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+ AccountID param.Field[string] `path:"account_id"`
+ // The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+ ZoneID param.Field[string] `path:"zone_id"`
+}
+
+type DatasetJobGetResponseEnvelope struct {
+ Errors []DatasetJobGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []DatasetJobGetResponseEnvelopeMessages `json:"messages,required"`
+ Result []LogpushLogpushJob `json:"result,required"`
+ // Whether the API call was successful
+ Success DatasetJobGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON datasetJobGetResponseEnvelopeJSON `json:"-"`
+}
+
+// datasetJobGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [DatasetJobGetResponseEnvelope]
+type datasetJobGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DatasetJobGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r datasetJobGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type DatasetJobGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON datasetJobGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// datasetJobGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [DatasetJobGetResponseEnvelopeErrors]
+type datasetJobGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DatasetJobGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r datasetJobGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type DatasetJobGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON datasetJobGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// datasetJobGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [DatasetJobGetResponseEnvelopeMessages]
+type datasetJobGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DatasetJobGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r datasetJobGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type DatasetJobGetResponseEnvelopeSuccess bool
+
+const (
+ DatasetJobGetResponseEnvelopeSuccessTrue DatasetJobGetResponseEnvelopeSuccess = true
+)
diff --git a/logpush/datasetjob_test.go b/logpush/datasetjob_test.go
new file mode 100644
index 00000000000..0895c298eb6
--- /dev/null
+++ b/logpush/datasetjob_test.go
@@ -0,0 +1,46 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package logpush_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/logpush"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestDatasetJobGetWithOptionalParams(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"),
+ )
+ _, err := client.Logpush.Datasets.Jobs.Get(
+ context.TODO(),
+ "http_requests",
+ logpush.DatasetJobGetParams{
+ AccountID: cloudflare.F("string"),
+ ZoneID: cloudflare.F("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/logpush/edge.go b/logpush/edge.go
new file mode 100644
index 00000000000..4d9accb45e4
--- /dev/null
+++ b/logpush/edge.go
@@ -0,0 +1,275 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package logpush
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// EdgeService contains methods and other services that help with interacting with
+// the cloudflare API. Note, unlike clients, this service does not read variables
+// from the environment automatically. You should not instantiate this service
+// directly, and instead use the [NewEdgeService] method instead.
+type EdgeService struct {
+ Options []option.RequestOption
+}
+
+// NewEdgeService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewEdgeService(opts ...option.RequestOption) (r *EdgeService) {
+ r = &EdgeService{}
+ r.Options = opts
+ return
+}
+
+// Creates a new Instant Logs job for a zone.
+func (r *EdgeService) New(ctx context.Context, params EdgeNewParams, opts ...option.RequestOption) (res *LogpushInstantLogsJob, err error) {
+ opts = append(r.Options[:], opts...)
+ var env EdgeNewResponseEnvelope
+ path := fmt.Sprintf("zones/%s/logpush/edge", params.ZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Lists Instant Logs jobs for a zone.
+func (r *EdgeService) Get(ctx context.Context, query EdgeGetParams, opts ...option.RequestOption) (res *[]LogpushInstantLogsJob, err error) {
+ opts = append(r.Options[:], opts...)
+ var env EdgeGetResponseEnvelope
+ path := fmt.Sprintf("zones/%s/logpush/edge", query.ZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type LogpushInstantLogsJob struct {
+ // Unique WebSocket address that will receive messages from Cloudflare’s edge.
+ DestinationConf string `json:"destination_conf" format:"uri"`
+ // Comma-separated list of fields.
+ Fields string `json:"fields"`
+ // Filters to drill down into specific events.
+ Filter string `json:"filter"`
+ // The sample parameter is the sample rate of the records set by the client:
+ // "sample": 1 is 100% of records "sample": 10 is 10% and so on.
+ Sample int64 `json:"sample"`
+ // Unique session id of the job.
+ SessionID string `json:"session_id"`
+ JSON logpushInstantLogsJobJSON `json:"-"`
+}
+
+// logpushInstantLogsJobJSON contains the JSON metadata for the struct
+// [LogpushInstantLogsJob]
+type logpushInstantLogsJobJSON struct {
+ DestinationConf apijson.Field
+ Fields apijson.Field
+ Filter apijson.Field
+ Sample apijson.Field
+ SessionID apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LogpushInstantLogsJob) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r logpushInstantLogsJobJSON) RawJSON() string {
+ return r.raw
+}
+
+type EdgeNewParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+ // Comma-separated list of fields.
+ Fields param.Field[string] `json:"fields"`
+ // Filters to drill down into specific events.
+ Filter param.Field[string] `json:"filter"`
+ // The sample parameter is the sample rate of the records set by the client:
+ // "sample": 1 is 100% of records "sample": 10 is 10% and so on.
+ Sample param.Field[int64] `json:"sample"`
+}
+
+func (r EdgeNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type EdgeNewResponseEnvelope struct {
+ Errors []EdgeNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []EdgeNewResponseEnvelopeMessages `json:"messages,required"`
+ Result LogpushInstantLogsJob `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success EdgeNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON edgeNewResponseEnvelopeJSON `json:"-"`
+}
+
+// edgeNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [EdgeNewResponseEnvelope]
+type edgeNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EdgeNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r edgeNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type EdgeNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON edgeNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// edgeNewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [EdgeNewResponseEnvelopeErrors]
+type edgeNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EdgeNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r edgeNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type EdgeNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON edgeNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// edgeNewResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [EdgeNewResponseEnvelopeMessages]
+type edgeNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EdgeNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r edgeNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type EdgeNewResponseEnvelopeSuccess bool
+
+const (
+ EdgeNewResponseEnvelopeSuccessTrue EdgeNewResponseEnvelopeSuccess = true
+)
+
+type EdgeGetParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+}
+
+type EdgeGetResponseEnvelope struct {
+ Errors []EdgeGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []EdgeGetResponseEnvelopeMessages `json:"messages,required"`
+ Result []LogpushInstantLogsJob `json:"result,required"`
+ // Whether the API call was successful
+ Success EdgeGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON edgeGetResponseEnvelopeJSON `json:"-"`
+}
+
+// edgeGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [EdgeGetResponseEnvelope]
+type edgeGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EdgeGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r edgeGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type EdgeGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON edgeGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// edgeGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [EdgeGetResponseEnvelopeErrors]
+type edgeGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EdgeGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r edgeGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type EdgeGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON edgeGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// edgeGetResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [EdgeGetResponseEnvelopeMessages]
+type edgeGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EdgeGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r edgeGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type EdgeGetResponseEnvelopeSuccess bool
+
+const (
+ EdgeGetResponseEnvelopeSuccessTrue EdgeGetResponseEnvelopeSuccess = true
+)
diff --git a/logpush/edge_test.go b/logpush/edge_test.go
new file mode 100644
index 00000000000..e471ffc0947
--- /dev/null
+++ b/logpush/edge_test.go
@@ -0,0 +1,70 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package logpush_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/logpush"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestEdgeNewWithOptionalParams(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"),
+ )
+ _, err := client.Logpush.Edge.New(context.TODO(), logpush.EdgeNewParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Fields: cloudflare.F("ClientIP,ClientRequestHost,ClientRequestMethod,ClientRequestURI,EdgeEndTimestamp,EdgeResponseBytes,EdgeResponseStatus,EdgeStartTimestamp,RayID"),
+ Filter: cloudflare.F("{\"where\":{\"and\":[{\"key\":\"ClientCountry\",\"operator\":\"neq\",\"value\":\"ca\"}]}}"),
+ Sample: cloudflare.F(int64(1)),
+ })
+ 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())
+ }
+}
+
+func TestEdgeGet(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"),
+ )
+ _, err := client.Logpush.Edge.Get(context.TODO(), logpush.EdgeGetParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ })
+ 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/logpush/job.go b/logpush/job.go
new file mode 100644
index 00000000000..ccb5ac61294
--- /dev/null
+++ b/logpush/job.go
@@ -0,0 +1,811 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package logpush
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "reflect"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/tidwall/gjson"
+)
+
+// JobService contains methods and other services that help with interacting with
+// the cloudflare API. Note, unlike clients, this service does not read variables
+// from the environment automatically. You should not instantiate this service
+// directly, and instead use the [NewJobService] method instead.
+type JobService struct {
+ Options []option.RequestOption
+}
+
+// NewJobService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewJobService(opts ...option.RequestOption) (r *JobService) {
+ r = &JobService{}
+ r.Options = opts
+ return
+}
+
+// Creates a new Logpush job for an account or zone.
+func (r *JobService) New(ctx context.Context, params JobNewParams, opts ...option.RequestOption) (res *LogpushLogpushJob, err error) {
+ opts = append(r.Options[:], opts...)
+ var env JobNewResponseEnvelope
+ var accountOrZone string
+ var accountOrZoneID param.Field[string]
+ if params.AccountID.Present {
+ accountOrZone = "accounts"
+ accountOrZoneID = params.AccountID
+ } else {
+ accountOrZone = "zones"
+ accountOrZoneID = params.ZoneID
+ }
+ path := fmt.Sprintf("%s/%s/logpush/jobs", accountOrZone, accountOrZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Updates a Logpush job.
+func (r *JobService) Update(ctx context.Context, jobID int64, params JobUpdateParams, opts ...option.RequestOption) (res *LogpushLogpushJob, err error) {
+ opts = append(r.Options[:], opts...)
+ var env JobUpdateResponseEnvelope
+ var accountOrZone string
+ var accountOrZoneID param.Field[string]
+ if params.AccountID.Present {
+ accountOrZone = "accounts"
+ accountOrZoneID = params.AccountID
+ } else {
+ accountOrZone = "zones"
+ accountOrZoneID = params.ZoneID
+ }
+ path := fmt.Sprintf("%s/%s/logpush/jobs/%v", accountOrZone, accountOrZoneID, jobID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Lists Logpush jobs for an account or zone.
+func (r *JobService) List(ctx context.Context, query JobListParams, opts ...option.RequestOption) (res *[]LogpushLogpushJob, err error) {
+ opts = append(r.Options[:], opts...)
+ var env JobListResponseEnvelope
+ var accountOrZone string
+ var accountOrZoneID param.Field[string]
+ if query.AccountID.Present {
+ accountOrZone = "accounts"
+ accountOrZoneID = query.AccountID
+ } else {
+ accountOrZone = "zones"
+ accountOrZoneID = query.ZoneID
+ }
+ path := fmt.Sprintf("%s/%s/logpush/jobs", accountOrZone, accountOrZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Deletes a Logpush job.
+func (r *JobService) Delete(ctx context.Context, jobID int64, body JobDeleteParams, opts ...option.RequestOption) (res *JobDeleteResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env JobDeleteResponseEnvelope
+ var accountOrZone string
+ var accountOrZoneID param.Field[string]
+ if body.AccountID.Present {
+ accountOrZone = "accounts"
+ accountOrZoneID = body.AccountID
+ } else {
+ accountOrZone = "zones"
+ accountOrZoneID = body.ZoneID
+ }
+ path := fmt.Sprintf("%s/%s/logpush/jobs/%v", accountOrZone, accountOrZoneID, jobID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Gets the details of a Logpush job.
+func (r *JobService) Get(ctx context.Context, jobID int64, query JobGetParams, opts ...option.RequestOption) (res *LogpushLogpushJob, err error) {
+ opts = append(r.Options[:], opts...)
+ var env JobGetResponseEnvelope
+ var accountOrZone string
+ var accountOrZoneID param.Field[string]
+ if query.AccountID.Present {
+ accountOrZone = "accounts"
+ accountOrZoneID = query.AccountID
+ } else {
+ accountOrZone = "zones"
+ accountOrZoneID = query.ZoneID
+ }
+ path := fmt.Sprintf("%s/%s/logpush/jobs/%v", accountOrZone, accountOrZoneID, jobID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Union satisfied by [logpush.JobDeleteResponseUnknown],
+// [logpush.JobDeleteResponseArray] or [shared.UnionString].
+type JobDeleteResponse interface {
+ ImplementsLogpushJobDeleteResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*JobDeleteResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(JobDeleteResponseArray{}),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+type JobDeleteResponseArray []interface{}
+
+func (r JobDeleteResponseArray) ImplementsLogpushJobDeleteResponse() {}
+
+type JobNewParams struct {
+ // Uniquely identifies a resource (such as an s3 bucket) where data will be pushed.
+ // Additional configuration parameters supported by the destination may be
+ // included.
+ DestinationConf param.Field[string] `json:"destination_conf,required" format:"uri"`
+ // The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+ AccountID param.Field[string] `path:"account_id"`
+ // The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+ ZoneID param.Field[string] `path:"zone_id"`
+ // Name of the dataset.
+ Dataset param.Field[string] `json:"dataset"`
+ // Flag that indicates if the job is enabled.
+ Enabled param.Field[bool] `json:"enabled"`
+ // The frequency at which Cloudflare sends batches of logs to your destination.
+ // Setting frequency to high sends your logs in larger quantities of smaller files.
+ // Setting frequency to low sends logs in smaller quantities of larger files.
+ Frequency param.Field[JobNewParamsFrequency] `json:"frequency"`
+ // This field is deprecated. Use `output_options` instead. Configuration string. It
+ // specifies things like requested fields and timestamp formats. If migrating from
+ // the logpull api, copy the url (full url or just the query string) of your call
+ // here, and logpush will keep on making this call for you, setting start and end
+ // times appropriately.
+ LogpullOptions param.Field[string] `json:"logpull_options" format:"uri-reference"`
+ // Optional human readable job name. Not unique. Cloudflare suggests that you set
+ // this to a meaningful string, like the domain name, to make it easier to identify
+ // your job.
+ Name param.Field[string] `json:"name"`
+ // The structured replacement for `logpull_options`. When including this field, the
+ // `logpull_option` field will be ignored.
+ OutputOptions param.Field[JobNewParamsOutputOptions] `json:"output_options"`
+ // Ownership challenge token to prove destination ownership.
+ OwnershipChallenge param.Field[string] `json:"ownership_challenge"`
+}
+
+func (r JobNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The frequency at which Cloudflare sends batches of logs to your destination.
+// Setting frequency to high sends your logs in larger quantities of smaller files.
+// Setting frequency to low sends logs in smaller quantities of larger files.
+type JobNewParamsFrequency string
+
+const (
+ JobNewParamsFrequencyHigh JobNewParamsFrequency = "high"
+ JobNewParamsFrequencyLow JobNewParamsFrequency = "low"
+)
+
+// The structured replacement for `logpull_options`. When including this field, the
+// `logpull_option` field will be ignored.
+type JobNewParamsOutputOptions struct {
+ // String to be prepended before each batch.
+ BatchPrefix param.Field[string] `json:"batch_prefix"`
+ // String to be appended after each batch.
+ BatchSuffix param.Field[string] `json:"batch_suffix"`
+ // If set to true, will cause all occurrences of `${` in the generated files to be
+ // replaced with `x{`.
+ Cve2021_4428 param.Field[bool] `json:"CVE-2021-4428"`
+ // String to join fields. This field be ignored when `record_template` is set.
+ FieldDelimiter param.Field[string] `json:"field_delimiter"`
+ // List of field names to be included in the Logpush output. For the moment, there
+ // is no option to add all fields at once, so you must specify all the fields names
+ // you are interested in.
+ FieldNames param.Field[[]string] `json:"field_names"`
+ // Specifies the output type, such as `ndjson` or `csv`. This sets default values
+ // for the rest of the settings, depending on the chosen output type. Some
+ // formatting rules, like string quoting, are different between output types.
+ OutputType param.Field[JobNewParamsOutputOptionsOutputType] `json:"output_type"`
+ // String to be inserted in-between the records as separator.
+ RecordDelimiter param.Field[string] `json:"record_delimiter"`
+ // String to be prepended before each record.
+ RecordPrefix param.Field[string] `json:"record_prefix"`
+ // String to be appended after each record.
+ RecordSuffix param.Field[string] `json:"record_suffix"`
+ // String to use as template for each record instead of the default comma-separated
+ // list. All fields used in the template must be present in `field_names` as well,
+ // otherwise they will end up as null. Format as a Go `text/template` without any
+ // standard functions, like conditionals, loops, sub-templates, etc.
+ RecordTemplate param.Field[string] `json:"record_template"`
+ // Floating number to specify sampling rate. Sampling is applied on top of
+ // filtering, and regardless of the current `sample_interval` of the data.
+ SampleRate param.Field[float64] `json:"sample_rate"`
+ // String to specify the format for timestamps, such as `unixnano`, `unix`, or
+ // `rfc3339`.
+ TimestampFormat param.Field[JobNewParamsOutputOptionsTimestampFormat] `json:"timestamp_format"`
+}
+
+func (r JobNewParamsOutputOptions) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Specifies the output type, such as `ndjson` or `csv`. This sets default values
+// for the rest of the settings, depending on the chosen output type. Some
+// formatting rules, like string quoting, are different between output types.
+type JobNewParamsOutputOptionsOutputType string
+
+const (
+ JobNewParamsOutputOptionsOutputTypeNdjson JobNewParamsOutputOptionsOutputType = "ndjson"
+ JobNewParamsOutputOptionsOutputTypeCsv JobNewParamsOutputOptionsOutputType = "csv"
+)
+
+// String to specify the format for timestamps, such as `unixnano`, `unix`, or
+// `rfc3339`.
+type JobNewParamsOutputOptionsTimestampFormat string
+
+const (
+ JobNewParamsOutputOptionsTimestampFormatUnixnano JobNewParamsOutputOptionsTimestampFormat = "unixnano"
+ JobNewParamsOutputOptionsTimestampFormatUnix JobNewParamsOutputOptionsTimestampFormat = "unix"
+ JobNewParamsOutputOptionsTimestampFormatRfc3339 JobNewParamsOutputOptionsTimestampFormat = "rfc3339"
+)
+
+type JobNewResponseEnvelope struct {
+ Errors []JobNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []JobNewResponseEnvelopeMessages `json:"messages,required"`
+ Result LogpushLogpushJob `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success JobNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON jobNewResponseEnvelopeJSON `json:"-"`
+}
+
+// jobNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [JobNewResponseEnvelope]
+type jobNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *JobNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r jobNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type JobNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON jobNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// jobNewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [JobNewResponseEnvelopeErrors]
+type jobNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *JobNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r jobNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type JobNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON jobNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// jobNewResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [JobNewResponseEnvelopeMessages]
+type jobNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *JobNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r jobNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type JobNewResponseEnvelopeSuccess bool
+
+const (
+ JobNewResponseEnvelopeSuccessTrue JobNewResponseEnvelopeSuccess = true
+)
+
+type JobUpdateParams struct {
+ // The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+ AccountID param.Field[string] `path:"account_id"`
+ // The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+ ZoneID param.Field[string] `path:"zone_id"`
+ // Uniquely identifies a resource (such as an s3 bucket) where data will be pushed.
+ // Additional configuration parameters supported by the destination may be
+ // included.
+ DestinationConf param.Field[string] `json:"destination_conf" format:"uri"`
+ // Flag that indicates if the job is enabled.
+ Enabled param.Field[bool] `json:"enabled"`
+ // The frequency at which Cloudflare sends batches of logs to your destination.
+ // Setting frequency to high sends your logs in larger quantities of smaller files.
+ // Setting frequency to low sends logs in smaller quantities of larger files.
+ Frequency param.Field[JobUpdateParamsFrequency] `json:"frequency"`
+ // This field is deprecated. Use `output_options` instead. Configuration string. It
+ // specifies things like requested fields and timestamp formats. If migrating from
+ // the logpull api, copy the url (full url or just the query string) of your call
+ // here, and logpush will keep on making this call for you, setting start and end
+ // times appropriately.
+ LogpullOptions param.Field[string] `json:"logpull_options" format:"uri-reference"`
+ // The structured replacement for `logpull_options`. When including this field, the
+ // `logpull_option` field will be ignored.
+ OutputOptions param.Field[JobUpdateParamsOutputOptions] `json:"output_options"`
+ // Ownership challenge token to prove destination ownership.
+ OwnershipChallenge param.Field[string] `json:"ownership_challenge"`
+}
+
+func (r JobUpdateParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The frequency at which Cloudflare sends batches of logs to your destination.
+// Setting frequency to high sends your logs in larger quantities of smaller files.
+// Setting frequency to low sends logs in smaller quantities of larger files.
+type JobUpdateParamsFrequency string
+
+const (
+ JobUpdateParamsFrequencyHigh JobUpdateParamsFrequency = "high"
+ JobUpdateParamsFrequencyLow JobUpdateParamsFrequency = "low"
+)
+
+// The structured replacement for `logpull_options`. When including this field, the
+// `logpull_option` field will be ignored.
+type JobUpdateParamsOutputOptions struct {
+ // String to be prepended before each batch.
+ BatchPrefix param.Field[string] `json:"batch_prefix"`
+ // String to be appended after each batch.
+ BatchSuffix param.Field[string] `json:"batch_suffix"`
+ // If set to true, will cause all occurrences of `${` in the generated files to be
+ // replaced with `x{`.
+ Cve2021_4428 param.Field[bool] `json:"CVE-2021-4428"`
+ // String to join fields. This field be ignored when `record_template` is set.
+ FieldDelimiter param.Field[string] `json:"field_delimiter"`
+ // List of field names to be included in the Logpush output. For the moment, there
+ // is no option to add all fields at once, so you must specify all the fields names
+ // you are interested in.
+ FieldNames param.Field[[]string] `json:"field_names"`
+ // Specifies the output type, such as `ndjson` or `csv`. This sets default values
+ // for the rest of the settings, depending on the chosen output type. Some
+ // formatting rules, like string quoting, are different between output types.
+ OutputType param.Field[JobUpdateParamsOutputOptionsOutputType] `json:"output_type"`
+ // String to be inserted in-between the records as separator.
+ RecordDelimiter param.Field[string] `json:"record_delimiter"`
+ // String to be prepended before each record.
+ RecordPrefix param.Field[string] `json:"record_prefix"`
+ // String to be appended after each record.
+ RecordSuffix param.Field[string] `json:"record_suffix"`
+ // String to use as template for each record instead of the default comma-separated
+ // list. All fields used in the template must be present in `field_names` as well,
+ // otherwise they will end up as null. Format as a Go `text/template` without any
+ // standard functions, like conditionals, loops, sub-templates, etc.
+ RecordTemplate param.Field[string] `json:"record_template"`
+ // Floating number to specify sampling rate. Sampling is applied on top of
+ // filtering, and regardless of the current `sample_interval` of the data.
+ SampleRate param.Field[float64] `json:"sample_rate"`
+ // String to specify the format for timestamps, such as `unixnano`, `unix`, or
+ // `rfc3339`.
+ TimestampFormat param.Field[JobUpdateParamsOutputOptionsTimestampFormat] `json:"timestamp_format"`
+}
+
+func (r JobUpdateParamsOutputOptions) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Specifies the output type, such as `ndjson` or `csv`. This sets default values
+// for the rest of the settings, depending on the chosen output type. Some
+// formatting rules, like string quoting, are different between output types.
+type JobUpdateParamsOutputOptionsOutputType string
+
+const (
+ JobUpdateParamsOutputOptionsOutputTypeNdjson JobUpdateParamsOutputOptionsOutputType = "ndjson"
+ JobUpdateParamsOutputOptionsOutputTypeCsv JobUpdateParamsOutputOptionsOutputType = "csv"
+)
+
+// String to specify the format for timestamps, such as `unixnano`, `unix`, or
+// `rfc3339`.
+type JobUpdateParamsOutputOptionsTimestampFormat string
+
+const (
+ JobUpdateParamsOutputOptionsTimestampFormatUnixnano JobUpdateParamsOutputOptionsTimestampFormat = "unixnano"
+ JobUpdateParamsOutputOptionsTimestampFormatUnix JobUpdateParamsOutputOptionsTimestampFormat = "unix"
+ JobUpdateParamsOutputOptionsTimestampFormatRfc3339 JobUpdateParamsOutputOptionsTimestampFormat = "rfc3339"
+)
+
+type JobUpdateResponseEnvelope struct {
+ Errors []JobUpdateResponseEnvelopeErrors `json:"errors,required"`
+ Messages []JobUpdateResponseEnvelopeMessages `json:"messages,required"`
+ Result LogpushLogpushJob `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success JobUpdateResponseEnvelopeSuccess `json:"success,required"`
+ JSON jobUpdateResponseEnvelopeJSON `json:"-"`
+}
+
+// jobUpdateResponseEnvelopeJSON contains the JSON metadata for the struct
+// [JobUpdateResponseEnvelope]
+type jobUpdateResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *JobUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r jobUpdateResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type JobUpdateResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON jobUpdateResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// jobUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [JobUpdateResponseEnvelopeErrors]
+type jobUpdateResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *JobUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r jobUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type JobUpdateResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON jobUpdateResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// jobUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [JobUpdateResponseEnvelopeMessages]
+type jobUpdateResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *JobUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r jobUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type JobUpdateResponseEnvelopeSuccess bool
+
+const (
+ JobUpdateResponseEnvelopeSuccessTrue JobUpdateResponseEnvelopeSuccess = true
+)
+
+type JobListParams struct {
+ // The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+ AccountID param.Field[string] `path:"account_id"`
+ // The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+ ZoneID param.Field[string] `path:"zone_id"`
+}
+
+type JobListResponseEnvelope struct {
+ Errors []JobListResponseEnvelopeErrors `json:"errors,required"`
+ Messages []JobListResponseEnvelopeMessages `json:"messages,required"`
+ Result []LogpushLogpushJob `json:"result,required"`
+ // Whether the API call was successful
+ Success JobListResponseEnvelopeSuccess `json:"success,required"`
+ JSON jobListResponseEnvelopeJSON `json:"-"`
+}
+
+// jobListResponseEnvelopeJSON contains the JSON metadata for the struct
+// [JobListResponseEnvelope]
+type jobListResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *JobListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r jobListResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type JobListResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON jobListResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// jobListResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [JobListResponseEnvelopeErrors]
+type jobListResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *JobListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r jobListResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type JobListResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON jobListResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// jobListResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [JobListResponseEnvelopeMessages]
+type jobListResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *JobListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r jobListResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type JobListResponseEnvelopeSuccess bool
+
+const (
+ JobListResponseEnvelopeSuccessTrue JobListResponseEnvelopeSuccess = true
+)
+
+type JobDeleteParams struct {
+ // The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+ AccountID param.Field[string] `path:"account_id"`
+ // The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+ ZoneID param.Field[string] `path:"zone_id"`
+}
+
+type JobDeleteResponseEnvelope struct {
+ Errors []JobDeleteResponseEnvelopeErrors `json:"errors,required"`
+ Messages []JobDeleteResponseEnvelopeMessages `json:"messages,required"`
+ Result JobDeleteResponse `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success JobDeleteResponseEnvelopeSuccess `json:"success,required"`
+ JSON jobDeleteResponseEnvelopeJSON `json:"-"`
+}
+
+// jobDeleteResponseEnvelopeJSON contains the JSON metadata for the struct
+// [JobDeleteResponseEnvelope]
+type jobDeleteResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *JobDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r jobDeleteResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type JobDeleteResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON jobDeleteResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// jobDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [JobDeleteResponseEnvelopeErrors]
+type jobDeleteResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *JobDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r jobDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type JobDeleteResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON jobDeleteResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// jobDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [JobDeleteResponseEnvelopeMessages]
+type jobDeleteResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *JobDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r jobDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type JobDeleteResponseEnvelopeSuccess bool
+
+const (
+ JobDeleteResponseEnvelopeSuccessTrue JobDeleteResponseEnvelopeSuccess = true
+)
+
+type JobGetParams struct {
+ // The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+ AccountID param.Field[string] `path:"account_id"`
+ // The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+ ZoneID param.Field[string] `path:"zone_id"`
+}
+
+type JobGetResponseEnvelope struct {
+ Errors []JobGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []JobGetResponseEnvelopeMessages `json:"messages,required"`
+ Result LogpushLogpushJob `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success JobGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON jobGetResponseEnvelopeJSON `json:"-"`
+}
+
+// jobGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [JobGetResponseEnvelope]
+type jobGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *JobGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r jobGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type JobGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON jobGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// jobGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [JobGetResponseEnvelopeErrors]
+type jobGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *JobGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r jobGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type JobGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON jobGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// jobGetResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [JobGetResponseEnvelopeMessages]
+type jobGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *JobGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r jobGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type JobGetResponseEnvelopeSuccess bool
+
+const (
+ JobGetResponseEnvelopeSuccessTrue JobGetResponseEnvelopeSuccess = true
+)
diff --git a/logpush/job_test.go b/logpush/job_test.go
new file mode 100644
index 00000000000..fb55d8972ee
--- /dev/null
+++ b/logpush/job_test.go
@@ -0,0 +1,202 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package logpush_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/logpush"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestJobNewWithOptionalParams(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"),
+ )
+ _, err := client.Logpush.Jobs.New(context.TODO(), logpush.JobNewParams{
+ DestinationConf: cloudflare.F("s3://mybucket/logs?region=us-west-2"),
+ AccountID: cloudflare.F("string"),
+ ZoneID: cloudflare.F("string"),
+ Dataset: cloudflare.F("http_requests"),
+ Enabled: cloudflare.F(false),
+ Frequency: cloudflare.F(logpush.JobNewParamsFrequencyHigh),
+ LogpullOptions: cloudflare.F("fields=RayID,ClientIP,EdgeStartTimestamp×tamps=rfc3339"),
+ Name: cloudflare.F("example.com"),
+ OutputOptions: cloudflare.F(logpush.JobNewParamsOutputOptions{
+ Cve2021_4428: cloudflare.F(true),
+ BatchPrefix: cloudflare.F("string"),
+ BatchSuffix: cloudflare.F("string"),
+ FieldDelimiter: cloudflare.F("string"),
+ FieldNames: cloudflare.F([]string{"ClientIP", "EdgeStartTimestamp", "RayID"}),
+ OutputType: cloudflare.F(logpush.JobNewParamsOutputOptionsOutputTypeNdjson),
+ RecordDelimiter: cloudflare.F("string"),
+ RecordPrefix: cloudflare.F("string"),
+ RecordSuffix: cloudflare.F("string"),
+ RecordTemplate: cloudflare.F("string"),
+ SampleRate: cloudflare.F(0.000000),
+ TimestampFormat: cloudflare.F(logpush.JobNewParamsOutputOptionsTimestampFormatUnixnano),
+ }),
+ OwnershipChallenge: cloudflare.F("00000000000000000000"),
+ })
+ 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())
+ }
+}
+
+func TestJobUpdateWithOptionalParams(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"),
+ )
+ _, err := client.Logpush.Jobs.Update(
+ context.TODO(),
+ int64(1),
+ logpush.JobUpdateParams{
+ AccountID: cloudflare.F("string"),
+ ZoneID: cloudflare.F("string"),
+ DestinationConf: cloudflare.F("s3://mybucket/logs?region=us-west-2"),
+ Enabled: cloudflare.F(false),
+ Frequency: cloudflare.F(logpush.JobUpdateParamsFrequencyHigh),
+ LogpullOptions: cloudflare.F("fields=RayID,ClientIP,EdgeStartTimestamp×tamps=rfc3339"),
+ OutputOptions: cloudflare.F(logpush.JobUpdateParamsOutputOptions{
+ Cve2021_4428: cloudflare.F(true),
+ BatchPrefix: cloudflare.F("string"),
+ BatchSuffix: cloudflare.F("string"),
+ FieldDelimiter: cloudflare.F("string"),
+ FieldNames: cloudflare.F([]string{"ClientIP", "EdgeStartTimestamp", "RayID"}),
+ OutputType: cloudflare.F(logpush.JobUpdateParamsOutputOptionsOutputTypeNdjson),
+ RecordDelimiter: cloudflare.F("string"),
+ RecordPrefix: cloudflare.F("string"),
+ RecordSuffix: cloudflare.F("string"),
+ RecordTemplate: cloudflare.F("string"),
+ SampleRate: cloudflare.F(0.000000),
+ TimestampFormat: cloudflare.F(logpush.JobUpdateParamsOutputOptionsTimestampFormatUnixnano),
+ }),
+ OwnershipChallenge: cloudflare.F("00000000000000000000"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestJobListWithOptionalParams(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"),
+ )
+ _, err := client.Logpush.Jobs.List(context.TODO(), logpush.JobListParams{
+ AccountID: cloudflare.F("string"),
+ ZoneID: cloudflare.F("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())
+ }
+}
+
+func TestJobDeleteWithOptionalParams(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"),
+ )
+ _, err := client.Logpush.Jobs.Delete(
+ context.TODO(),
+ int64(1),
+ logpush.JobDeleteParams{
+ AccountID: cloudflare.F("string"),
+ ZoneID: cloudflare.F("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())
+ }
+}
+
+func TestJobGetWithOptionalParams(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"),
+ )
+ _, err := client.Logpush.Jobs.Get(
+ context.TODO(),
+ int64(1),
+ logpush.JobGetParams{
+ AccountID: cloudflare.F("string"),
+ ZoneID: cloudflare.F("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/logpush/logpush.go b/logpush/logpush.go
new file mode 100644
index 00000000000..b1d55a9957d
--- /dev/null
+++ b/logpush/logpush.go
@@ -0,0 +1,34 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package logpush
+
+import (
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// LogpushService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewLogpushService] method instead.
+type LogpushService struct {
+ Options []option.RequestOption
+ Datasets *DatasetService
+ Edge *EdgeService
+ Jobs *JobService
+ Ownership *OwnershipService
+ Validate *ValidateService
+}
+
+// NewLogpushService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewLogpushService(opts ...option.RequestOption) (r *LogpushService) {
+ r = &LogpushService{}
+ r.Options = opts
+ r.Datasets = NewDatasetService(opts...)
+ r.Edge = NewEdgeService(opts...)
+ r.Jobs = NewJobService(opts...)
+ r.Ownership = NewOwnershipService(opts...)
+ r.Validate = NewValidateService(opts...)
+ return
+}
diff --git a/logpush/ownership.go b/logpush/ownership.go
new file mode 100644
index 00000000000..4754133aab7
--- /dev/null
+++ b/logpush/ownership.go
@@ -0,0 +1,315 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package logpush
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// OwnershipService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewOwnershipService] method instead.
+type OwnershipService struct {
+ Options []option.RequestOption
+}
+
+// NewOwnershipService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewOwnershipService(opts ...option.RequestOption) (r *OwnershipService) {
+ r = &OwnershipService{}
+ r.Options = opts
+ return
+}
+
+// Gets a new ownership challenge sent to your destination.
+func (r *OwnershipService) New(ctx context.Context, params OwnershipNewParams, opts ...option.RequestOption) (res *OwnershipNewResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env OwnershipNewResponseEnvelope
+ var accountOrZone string
+ var accountOrZoneID param.Field[string]
+ if params.AccountID.Present {
+ accountOrZone = "accounts"
+ accountOrZoneID = params.AccountID
+ } else {
+ accountOrZone = "zones"
+ accountOrZoneID = params.ZoneID
+ }
+ path := fmt.Sprintf("%s/%s/logpush/ownership", accountOrZone, accountOrZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Validates ownership challenge of the destination.
+func (r *OwnershipService) Validate(ctx context.Context, params OwnershipValidateParams, opts ...option.RequestOption) (res *OwnershipValidateResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env OwnershipValidateResponseEnvelope
+ var accountOrZone string
+ var accountOrZoneID param.Field[string]
+ if params.AccountID.Present {
+ accountOrZone = "accounts"
+ accountOrZoneID = params.AccountID
+ } else {
+ accountOrZone = "zones"
+ accountOrZoneID = params.ZoneID
+ }
+ path := fmt.Sprintf("%s/%s/logpush/ownership/validate", accountOrZone, accountOrZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type OwnershipNewResponse struct {
+ Filename string `json:"filename"`
+ Message string `json:"message"`
+ Valid bool `json:"valid"`
+ JSON ownershipNewResponseJSON `json:"-"`
+}
+
+// ownershipNewResponseJSON contains the JSON metadata for the struct
+// [OwnershipNewResponse]
+type ownershipNewResponseJSON struct {
+ Filename apijson.Field
+ Message apijson.Field
+ Valid apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *OwnershipNewResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ownershipNewResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type OwnershipValidateResponse struct {
+ Valid bool `json:"valid"`
+ JSON ownershipValidateResponseJSON `json:"-"`
+}
+
+// ownershipValidateResponseJSON contains the JSON metadata for the struct
+// [OwnershipValidateResponse]
+type ownershipValidateResponseJSON struct {
+ Valid apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *OwnershipValidateResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ownershipValidateResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type OwnershipNewParams struct {
+ // Uniquely identifies a resource (such as an s3 bucket) where data will be pushed.
+ // Additional configuration parameters supported by the destination may be
+ // included.
+ DestinationConf param.Field[string] `json:"destination_conf,required" format:"uri"`
+ // The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+ AccountID param.Field[string] `path:"account_id"`
+ // The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+ ZoneID param.Field[string] `path:"zone_id"`
+}
+
+func (r OwnershipNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type OwnershipNewResponseEnvelope struct {
+ Errors []OwnershipNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []OwnershipNewResponseEnvelopeMessages `json:"messages,required"`
+ Result OwnershipNewResponse `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success OwnershipNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON ownershipNewResponseEnvelopeJSON `json:"-"`
+}
+
+// ownershipNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [OwnershipNewResponseEnvelope]
+type ownershipNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *OwnershipNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ownershipNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type OwnershipNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON ownershipNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// ownershipNewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [OwnershipNewResponseEnvelopeErrors]
+type ownershipNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *OwnershipNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ownershipNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type OwnershipNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON ownershipNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// ownershipNewResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [OwnershipNewResponseEnvelopeMessages]
+type ownershipNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *OwnershipNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ownershipNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type OwnershipNewResponseEnvelopeSuccess bool
+
+const (
+ OwnershipNewResponseEnvelopeSuccessTrue OwnershipNewResponseEnvelopeSuccess = true
+)
+
+type OwnershipValidateParams struct {
+ // Uniquely identifies a resource (such as an s3 bucket) where data will be pushed.
+ // Additional configuration parameters supported by the destination may be
+ // included.
+ DestinationConf param.Field[string] `json:"destination_conf,required" format:"uri"`
+ // Ownership challenge token to prove destination ownership.
+ OwnershipChallenge param.Field[string] `json:"ownership_challenge,required"`
+ // The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+ AccountID param.Field[string] `path:"account_id"`
+ // The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+ ZoneID param.Field[string] `path:"zone_id"`
+}
+
+func (r OwnershipValidateParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type OwnershipValidateResponseEnvelope struct {
+ Errors []OwnershipValidateResponseEnvelopeErrors `json:"errors,required"`
+ Messages []OwnershipValidateResponseEnvelopeMessages `json:"messages,required"`
+ Result OwnershipValidateResponse `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success OwnershipValidateResponseEnvelopeSuccess `json:"success,required"`
+ JSON ownershipValidateResponseEnvelopeJSON `json:"-"`
+}
+
+// ownershipValidateResponseEnvelopeJSON contains the JSON metadata for the struct
+// [OwnershipValidateResponseEnvelope]
+type ownershipValidateResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *OwnershipValidateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ownershipValidateResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type OwnershipValidateResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON ownershipValidateResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// ownershipValidateResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [OwnershipValidateResponseEnvelopeErrors]
+type ownershipValidateResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *OwnershipValidateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ownershipValidateResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type OwnershipValidateResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON ownershipValidateResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// ownershipValidateResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [OwnershipValidateResponseEnvelopeMessages]
+type ownershipValidateResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *OwnershipValidateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ownershipValidateResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type OwnershipValidateResponseEnvelopeSuccess bool
+
+const (
+ OwnershipValidateResponseEnvelopeSuccessTrue OwnershipValidateResponseEnvelopeSuccess = true
+)
diff --git a/logpush/ownership_test.go b/logpush/ownership_test.go
new file mode 100644
index 00000000000..36bcf0be51a
--- /dev/null
+++ b/logpush/ownership_test.go
@@ -0,0 +1,72 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package logpush_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/logpush"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestOwnershipNewWithOptionalParams(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"),
+ )
+ _, err := client.Logpush.Ownership.New(context.TODO(), logpush.OwnershipNewParams{
+ DestinationConf: cloudflare.F("s3://mybucket/logs?region=us-west-2"),
+ AccountID: cloudflare.F("string"),
+ ZoneID: cloudflare.F("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())
+ }
+}
+
+func TestOwnershipValidateWithOptionalParams(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"),
+ )
+ _, err := client.Logpush.Ownership.Validate(context.TODO(), logpush.OwnershipValidateParams{
+ DestinationConf: cloudflare.F("s3://mybucket/logs?region=us-west-2"),
+ OwnershipChallenge: cloudflare.F("00000000000000000000"),
+ AccountID: cloudflare.F("string"),
+ ZoneID: cloudflare.F("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/logpush/validate.go b/logpush/validate.go
new file mode 100644
index 00000000000..1af55f1234a
--- /dev/null
+++ b/logpush/validate.go
@@ -0,0 +1,313 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package logpush
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// ValidateService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewValidateService] method instead.
+type ValidateService struct {
+ Options []option.RequestOption
+}
+
+// NewValidateService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewValidateService(opts ...option.RequestOption) (r *ValidateService) {
+ r = &ValidateService{}
+ r.Options = opts
+ return
+}
+
+// Checks if there is an existing job with a destination.
+func (r *ValidateService) Destination(ctx context.Context, params ValidateDestinationParams, opts ...option.RequestOption) (res *ValidateDestinationResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env ValidateDestinationResponseEnvelope
+ var accountOrZone string
+ var accountOrZoneID param.Field[string]
+ if params.AccountID.Present {
+ accountOrZone = "accounts"
+ accountOrZoneID = params.AccountID
+ } else {
+ accountOrZone = "zones"
+ accountOrZoneID = params.ZoneID
+ }
+ path := fmt.Sprintf("%s/%s/logpush/validate/destination/exists", accountOrZone, accountOrZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Validates logpull origin with logpull_options.
+func (r *ValidateService) Origin(ctx context.Context, params ValidateOriginParams, opts ...option.RequestOption) (res *ValidateOriginResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env ValidateOriginResponseEnvelope
+ var accountOrZone string
+ var accountOrZoneID param.Field[string]
+ if params.AccountID.Present {
+ accountOrZone = "accounts"
+ accountOrZoneID = params.AccountID
+ } else {
+ accountOrZone = "zones"
+ accountOrZoneID = params.ZoneID
+ }
+ path := fmt.Sprintf("%s/%s/logpush/validate/origin", accountOrZone, accountOrZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type ValidateDestinationResponse struct {
+ Exists bool `json:"exists"`
+ JSON validateDestinationResponseJSON `json:"-"`
+}
+
+// validateDestinationResponseJSON contains the JSON metadata for the struct
+// [ValidateDestinationResponse]
+type validateDestinationResponseJSON struct {
+ Exists apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ValidateDestinationResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r validateDestinationResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type ValidateOriginResponse struct {
+ Message string `json:"message"`
+ Valid bool `json:"valid"`
+ JSON validateOriginResponseJSON `json:"-"`
+}
+
+// validateOriginResponseJSON contains the JSON metadata for the struct
+// [ValidateOriginResponse]
+type validateOriginResponseJSON struct {
+ Message apijson.Field
+ Valid apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ValidateOriginResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r validateOriginResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type ValidateDestinationParams struct {
+ // Uniquely identifies a resource (such as an s3 bucket) where data will be pushed.
+ // Additional configuration parameters supported by the destination may be
+ // included.
+ DestinationConf param.Field[string] `json:"destination_conf,required" format:"uri"`
+ // The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+ AccountID param.Field[string] `path:"account_id"`
+ // The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+ ZoneID param.Field[string] `path:"zone_id"`
+}
+
+func (r ValidateDestinationParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type ValidateDestinationResponseEnvelope struct {
+ Errors []ValidateDestinationResponseEnvelopeErrors `json:"errors,required"`
+ Messages []ValidateDestinationResponseEnvelopeMessages `json:"messages,required"`
+ Result ValidateDestinationResponse `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success ValidateDestinationResponseEnvelopeSuccess `json:"success,required"`
+ JSON validateDestinationResponseEnvelopeJSON `json:"-"`
+}
+
+// validateDestinationResponseEnvelopeJSON contains the JSON metadata for the
+// struct [ValidateDestinationResponseEnvelope]
+type validateDestinationResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ValidateDestinationResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r validateDestinationResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type ValidateDestinationResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON validateDestinationResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// validateDestinationResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [ValidateDestinationResponseEnvelopeErrors]
+type validateDestinationResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ValidateDestinationResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r validateDestinationResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type ValidateDestinationResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON validateDestinationResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// validateDestinationResponseEnvelopeMessagesJSON contains the JSON metadata for
+// the struct [ValidateDestinationResponseEnvelopeMessages]
+type validateDestinationResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ValidateDestinationResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r validateDestinationResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type ValidateDestinationResponseEnvelopeSuccess bool
+
+const (
+ ValidateDestinationResponseEnvelopeSuccessTrue ValidateDestinationResponseEnvelopeSuccess = true
+)
+
+type ValidateOriginParams struct {
+ // This field is deprecated. Use `output_options` instead. Configuration string. It
+ // specifies things like requested fields and timestamp formats. If migrating from
+ // the logpull api, copy the url (full url or just the query string) of your call
+ // here, and logpush will keep on making this call for you, setting start and end
+ // times appropriately.
+ LogpullOptions param.Field[string] `json:"logpull_options,required" format:"uri-reference"`
+ // The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+ AccountID param.Field[string] `path:"account_id"`
+ // The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+ ZoneID param.Field[string] `path:"zone_id"`
+}
+
+func (r ValidateOriginParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type ValidateOriginResponseEnvelope struct {
+ Errors []ValidateOriginResponseEnvelopeErrors `json:"errors,required"`
+ Messages []ValidateOriginResponseEnvelopeMessages `json:"messages,required"`
+ Result ValidateOriginResponse `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success ValidateOriginResponseEnvelopeSuccess `json:"success,required"`
+ JSON validateOriginResponseEnvelopeJSON `json:"-"`
+}
+
+// validateOriginResponseEnvelopeJSON contains the JSON metadata for the struct
+// [ValidateOriginResponseEnvelope]
+type validateOriginResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ValidateOriginResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r validateOriginResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type ValidateOriginResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON validateOriginResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// validateOriginResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [ValidateOriginResponseEnvelopeErrors]
+type validateOriginResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ValidateOriginResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r validateOriginResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type ValidateOriginResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON validateOriginResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// validateOriginResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [ValidateOriginResponseEnvelopeMessages]
+type validateOriginResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ValidateOriginResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r validateOriginResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type ValidateOriginResponseEnvelopeSuccess bool
+
+const (
+ ValidateOriginResponseEnvelopeSuccessTrue ValidateOriginResponseEnvelopeSuccess = true
+)
diff --git a/logpush/validate_test.go b/logpush/validate_test.go
new file mode 100644
index 00000000000..f915d3731c3
--- /dev/null
+++ b/logpush/validate_test.go
@@ -0,0 +1,71 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package logpush_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/logpush"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestValidateDestinationWithOptionalParams(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"),
+ )
+ _, err := client.Logpush.Validate.Destination(context.TODO(), logpush.ValidateDestinationParams{
+ DestinationConf: cloudflare.F("s3://mybucket/logs?region=us-west-2"),
+ AccountID: cloudflare.F("string"),
+ ZoneID: cloudflare.F("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())
+ }
+}
+
+func TestValidateOriginWithOptionalParams(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"),
+ )
+ _, err := client.Logpush.Validate.Origin(context.TODO(), logpush.ValidateOriginParams{
+ LogpullOptions: cloudflare.F("fields=RayID,ClientIP,EdgeStartTimestamp×tamps=rfc3339"),
+ AccountID: cloudflare.F("string"),
+ ZoneID: cloudflare.F("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/logpushdataset.go b/logpushdataset.go
deleted file mode 100644
index ae7e3df0d20..00000000000
--- a/logpushdataset.go
+++ /dev/null
@@ -1,29 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// LogpushDatasetService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewLogpushDatasetService] method
-// instead.
-type LogpushDatasetService struct {
- Options []option.RequestOption
- Fields *LogpushDatasetFieldService
- Jobs *LogpushDatasetJobService
-}
-
-// NewLogpushDatasetService generates a new service that applies the given options
-// to each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewLogpushDatasetService(opts ...option.RequestOption) (r *LogpushDatasetService) {
- r = &LogpushDatasetService{}
- r.Options = opts
- r.Fields = NewLogpushDatasetFieldService(opts...)
- r.Jobs = NewLogpushDatasetJobService(opts...)
- return
-}
diff --git a/logpushdatasetfield.go b/logpushdatasetfield.go
deleted file mode 100644
index cffe6d0f6a6..00000000000
--- a/logpushdatasetfield.go
+++ /dev/null
@@ -1,145 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// LogpushDatasetFieldService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewLogpushDatasetFieldService]
-// method instead.
-type LogpushDatasetFieldService struct {
- Options []option.RequestOption
-}
-
-// NewLogpushDatasetFieldService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewLogpushDatasetFieldService(opts ...option.RequestOption) (r *LogpushDatasetFieldService) {
- r = &LogpushDatasetFieldService{}
- r.Options = opts
- return
-}
-
-// Lists all fields available for a dataset. The response result is an object with
-// key-value pairs, where keys are field names, and values are descriptions.
-func (r *LogpushDatasetFieldService) Get(ctx context.Context, datasetID string, query LogpushDatasetFieldGetParams, opts ...option.RequestOption) (res *LogpushDatasetFieldGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env LogpushDatasetFieldGetResponseEnvelope
- var accountOrZone string
- var accountOrZoneID param.Field[string]
- if query.AccountID.Present {
- accountOrZone = "accounts"
- accountOrZoneID = query.AccountID
- } else {
- accountOrZone = "zones"
- accountOrZoneID = query.ZoneID
- }
- path := fmt.Sprintf("%s/%s/logpush/datasets/%s/fields", accountOrZone, accountOrZoneID, datasetID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type LogpushDatasetFieldGetResponse = interface{}
-
-type LogpushDatasetFieldGetParams struct {
- // The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
- AccountID param.Field[string] `path:"account_id"`
- // The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- ZoneID param.Field[string] `path:"zone_id"`
-}
-
-type LogpushDatasetFieldGetResponseEnvelope struct {
- Errors []LogpushDatasetFieldGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []LogpushDatasetFieldGetResponseEnvelopeMessages `json:"messages,required"`
- Result LogpushDatasetFieldGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success LogpushDatasetFieldGetResponseEnvelopeSuccess `json:"success,required"`
- JSON logpushDatasetFieldGetResponseEnvelopeJSON `json:"-"`
-}
-
-// logpushDatasetFieldGetResponseEnvelopeJSON contains the JSON metadata for the
-// struct [LogpushDatasetFieldGetResponseEnvelope]
-type logpushDatasetFieldGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LogpushDatasetFieldGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r logpushDatasetFieldGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type LogpushDatasetFieldGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON logpushDatasetFieldGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// logpushDatasetFieldGetResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [LogpushDatasetFieldGetResponseEnvelopeErrors]
-type logpushDatasetFieldGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LogpushDatasetFieldGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r logpushDatasetFieldGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type LogpushDatasetFieldGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON logpushDatasetFieldGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// logpushDatasetFieldGetResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [LogpushDatasetFieldGetResponseEnvelopeMessages]
-type logpushDatasetFieldGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LogpushDatasetFieldGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r logpushDatasetFieldGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type LogpushDatasetFieldGetResponseEnvelopeSuccess bool
-
-const (
- LogpushDatasetFieldGetResponseEnvelopeSuccessTrue LogpushDatasetFieldGetResponseEnvelopeSuccess = true
-)
diff --git a/logpushdatasetfield_test.go b/logpushdatasetfield_test.go
deleted file mode 100644
index 7b2c42af024..00000000000
--- a/logpushdatasetfield_test.go
+++ /dev/null
@@ -1,45 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestLogpushDatasetFieldGetWithOptionalParams(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"),
- )
- _, err := client.Logpush.Datasets.Fields.Get(
- context.TODO(),
- "http_requests",
- cloudflare.LogpushDatasetFieldGetParams{
- AccountID: cloudflare.F("string"),
- ZoneID: cloudflare.F("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/logpushdatasetjob.go b/logpushdatasetjob.go
deleted file mode 100644
index f1fb1ecc5ef..00000000000
--- a/logpushdatasetjob.go
+++ /dev/null
@@ -1,311 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// LogpushDatasetJobService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewLogpushDatasetJobService] method
-// instead.
-type LogpushDatasetJobService struct {
- Options []option.RequestOption
-}
-
-// NewLogpushDatasetJobService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewLogpushDatasetJobService(opts ...option.RequestOption) (r *LogpushDatasetJobService) {
- r = &LogpushDatasetJobService{}
- r.Options = opts
- return
-}
-
-// Lists Logpush jobs for an account or zone for a dataset.
-func (r *LogpushDatasetJobService) Get(ctx context.Context, datasetID string, query LogpushDatasetJobGetParams, opts ...option.RequestOption) (res *[]LogpushDatasetJobGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env LogpushDatasetJobGetResponseEnvelope
- var accountOrZone string
- var accountOrZoneID param.Field[string]
- if query.AccountID.Present {
- accountOrZone = "accounts"
- accountOrZoneID = query.AccountID
- } else {
- accountOrZone = "zones"
- accountOrZoneID = query.ZoneID
- }
- path := fmt.Sprintf("%s/%s/logpush/datasets/%s/jobs", accountOrZone, accountOrZoneID, datasetID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type LogpushDatasetJobGetResponse struct {
- // Unique id of the job.
- ID int64 `json:"id"`
- // Name of the dataset.
- Dataset string `json:"dataset,nullable"`
- // Uniquely identifies a resource (such as an s3 bucket) where data will be pushed.
- // Additional configuration parameters supported by the destination may be
- // included.
- DestinationConf string `json:"destination_conf" format:"uri"`
- // Flag that indicates if the job is enabled.
- Enabled bool `json:"enabled"`
- // If not null, the job is currently failing. Failures are usually repetitive
- // (example: no permissions to write to destination bucket). Only the last failure
- // is recorded. On successful execution of a job the error_message and last_error
- // are set to null.
- ErrorMessage time.Time `json:"error_message,nullable" format:"date-time"`
- // The frequency at which Cloudflare sends batches of logs to your destination.
- // Setting frequency to high sends your logs in larger quantities of smaller files.
- // Setting frequency to low sends logs in smaller quantities of larger files.
- Frequency LogpushDatasetJobGetResponseFrequency `json:"frequency,nullable"`
- // Records the last time for which logs have been successfully pushed. If the last
- // successful push was for logs range 2018-07-23T10:00:00Z to 2018-07-23T10:01:00Z
- // then the value of this field will be 2018-07-23T10:01:00Z. If the job has never
- // run or has just been enabled and hasn't run yet then the field will be empty.
- LastComplete time.Time `json:"last_complete,nullable" format:"date-time"`
- // Records the last time the job failed. If not null, the job is currently failing.
- // If null, the job has either never failed or has run successfully at least once
- // since last failure. See also the error_message field.
- LastError time.Time `json:"last_error,nullable" format:"date-time"`
- // This field is deprecated. Use `output_options` instead. Configuration string. It
- // specifies things like requested fields and timestamp formats. If migrating from
- // the logpull api, copy the url (full url or just the query string) of your call
- // here, and logpush will keep on making this call for you, setting start and end
- // times appropriately.
- LogpullOptions string `json:"logpull_options,nullable" format:"uri-reference"`
- // Optional human readable job name. Not unique. Cloudflare suggests that you set
- // this to a meaningful string, like the domain name, to make it easier to identify
- // your job.
- Name string `json:"name,nullable"`
- // The structured replacement for `logpull_options`. When including this field, the
- // `logpull_option` field will be ignored.
- OutputOptions LogpushDatasetJobGetResponseOutputOptions `json:"output_options,nullable"`
- JSON logpushDatasetJobGetResponseJSON `json:"-"`
-}
-
-// logpushDatasetJobGetResponseJSON contains the JSON metadata for the struct
-// [LogpushDatasetJobGetResponse]
-type logpushDatasetJobGetResponseJSON struct {
- ID apijson.Field
- Dataset apijson.Field
- DestinationConf apijson.Field
- Enabled apijson.Field
- ErrorMessage apijson.Field
- Frequency apijson.Field
- LastComplete apijson.Field
- LastError apijson.Field
- LogpullOptions apijson.Field
- Name apijson.Field
- OutputOptions apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LogpushDatasetJobGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r logpushDatasetJobGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// The frequency at which Cloudflare sends batches of logs to your destination.
-// Setting frequency to high sends your logs in larger quantities of smaller files.
-// Setting frequency to low sends logs in smaller quantities of larger files.
-type LogpushDatasetJobGetResponseFrequency string
-
-const (
- LogpushDatasetJobGetResponseFrequencyHigh LogpushDatasetJobGetResponseFrequency = "high"
- LogpushDatasetJobGetResponseFrequencyLow LogpushDatasetJobGetResponseFrequency = "low"
-)
-
-// The structured replacement for `logpull_options`. When including this field, the
-// `logpull_option` field will be ignored.
-type LogpushDatasetJobGetResponseOutputOptions struct {
- // String to be prepended before each batch.
- BatchPrefix string `json:"batch_prefix,nullable"`
- // String to be appended after each batch.
- BatchSuffix string `json:"batch_suffix,nullable"`
- // If set to true, will cause all occurrences of `${` in the generated files to be
- // replaced with `x{`.
- Cve2021_4428 bool `json:"CVE-2021-4428,nullable"`
- // String to join fields. This field be ignored when `record_template` is set.
- FieldDelimiter string `json:"field_delimiter,nullable"`
- // List of field names to be included in the Logpush output. For the moment, there
- // is no option to add all fields at once, so you must specify all the fields names
- // you are interested in.
- FieldNames []string `json:"field_names"`
- // Specifies the output type, such as `ndjson` or `csv`. This sets default values
- // for the rest of the settings, depending on the chosen output type. Some
- // formatting rules, like string quoting, are different between output types.
- OutputType LogpushDatasetJobGetResponseOutputOptionsOutputType `json:"output_type"`
- // String to be inserted in-between the records as separator.
- RecordDelimiter string `json:"record_delimiter,nullable"`
- // String to be prepended before each record.
- RecordPrefix string `json:"record_prefix,nullable"`
- // String to be appended after each record.
- RecordSuffix string `json:"record_suffix,nullable"`
- // String to use as template for each record instead of the default comma-separated
- // list. All fields used in the template must be present in `field_names` as well,
- // otherwise they will end up as null. Format as a Go `text/template` without any
- // standard functions, like conditionals, loops, sub-templates, etc.
- RecordTemplate string `json:"record_template,nullable"`
- // Floating number to specify sampling rate. Sampling is applied on top of
- // filtering, and regardless of the current `sample_interval` of the data.
- SampleRate float64 `json:"sample_rate,nullable"`
- // String to specify the format for timestamps, such as `unixnano`, `unix`, or
- // `rfc3339`.
- TimestampFormat LogpushDatasetJobGetResponseOutputOptionsTimestampFormat `json:"timestamp_format"`
- JSON logpushDatasetJobGetResponseOutputOptionsJSON `json:"-"`
-}
-
-// logpushDatasetJobGetResponseOutputOptionsJSON contains the JSON metadata for the
-// struct [LogpushDatasetJobGetResponseOutputOptions]
-type logpushDatasetJobGetResponseOutputOptionsJSON struct {
- BatchPrefix apijson.Field
- BatchSuffix apijson.Field
- Cve2021_4428 apijson.Field
- FieldDelimiter apijson.Field
- FieldNames apijson.Field
- OutputType apijson.Field
- RecordDelimiter apijson.Field
- RecordPrefix apijson.Field
- RecordSuffix apijson.Field
- RecordTemplate apijson.Field
- SampleRate apijson.Field
- TimestampFormat apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LogpushDatasetJobGetResponseOutputOptions) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r logpushDatasetJobGetResponseOutputOptionsJSON) RawJSON() string {
- return r.raw
-}
-
-// Specifies the output type, such as `ndjson` or `csv`. This sets default values
-// for the rest of the settings, depending on the chosen output type. Some
-// formatting rules, like string quoting, are different between output types.
-type LogpushDatasetJobGetResponseOutputOptionsOutputType string
-
-const (
- LogpushDatasetJobGetResponseOutputOptionsOutputTypeNdjson LogpushDatasetJobGetResponseOutputOptionsOutputType = "ndjson"
- LogpushDatasetJobGetResponseOutputOptionsOutputTypeCsv LogpushDatasetJobGetResponseOutputOptionsOutputType = "csv"
-)
-
-// String to specify the format for timestamps, such as `unixnano`, `unix`, or
-// `rfc3339`.
-type LogpushDatasetJobGetResponseOutputOptionsTimestampFormat string
-
-const (
- LogpushDatasetJobGetResponseOutputOptionsTimestampFormatUnixnano LogpushDatasetJobGetResponseOutputOptionsTimestampFormat = "unixnano"
- LogpushDatasetJobGetResponseOutputOptionsTimestampFormatUnix LogpushDatasetJobGetResponseOutputOptionsTimestampFormat = "unix"
- LogpushDatasetJobGetResponseOutputOptionsTimestampFormatRfc3339 LogpushDatasetJobGetResponseOutputOptionsTimestampFormat = "rfc3339"
-)
-
-type LogpushDatasetJobGetParams struct {
- // The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
- AccountID param.Field[string] `path:"account_id"`
- // The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- ZoneID param.Field[string] `path:"zone_id"`
-}
-
-type LogpushDatasetJobGetResponseEnvelope struct {
- Errors []LogpushDatasetJobGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []LogpushDatasetJobGetResponseEnvelopeMessages `json:"messages,required"`
- Result []LogpushDatasetJobGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success LogpushDatasetJobGetResponseEnvelopeSuccess `json:"success,required"`
- JSON logpushDatasetJobGetResponseEnvelopeJSON `json:"-"`
-}
-
-// logpushDatasetJobGetResponseEnvelopeJSON contains the JSON metadata for the
-// struct [LogpushDatasetJobGetResponseEnvelope]
-type logpushDatasetJobGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LogpushDatasetJobGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r logpushDatasetJobGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type LogpushDatasetJobGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON logpushDatasetJobGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// logpushDatasetJobGetResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [LogpushDatasetJobGetResponseEnvelopeErrors]
-type logpushDatasetJobGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LogpushDatasetJobGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r logpushDatasetJobGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type LogpushDatasetJobGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON logpushDatasetJobGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// logpushDatasetJobGetResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [LogpushDatasetJobGetResponseEnvelopeMessages]
-type logpushDatasetJobGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LogpushDatasetJobGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r logpushDatasetJobGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type LogpushDatasetJobGetResponseEnvelopeSuccess bool
-
-const (
- LogpushDatasetJobGetResponseEnvelopeSuccessTrue LogpushDatasetJobGetResponseEnvelopeSuccess = true
-)
diff --git a/logpushdatasetjob_test.go b/logpushdatasetjob_test.go
deleted file mode 100644
index 8440ef98bfc..00000000000
--- a/logpushdatasetjob_test.go
+++ /dev/null
@@ -1,45 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestLogpushDatasetJobGetWithOptionalParams(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"),
- )
- _, err := client.Logpush.Datasets.Jobs.Get(
- context.TODO(),
- "http_requests",
- cloudflare.LogpushDatasetJobGetParams{
- AccountID: cloudflare.F("string"),
- ZoneID: cloudflare.F("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/logpushedge.go b/logpushedge.go
deleted file mode 100644
index 637194eeae7..00000000000
--- a/logpushedge.go
+++ /dev/null
@@ -1,311 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// LogpushEdgeService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewLogpushEdgeService] method
-// instead.
-type LogpushEdgeService struct {
- Options []option.RequestOption
-}
-
-// NewLogpushEdgeService generates a new service that applies the given options to
-// each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewLogpushEdgeService(opts ...option.RequestOption) (r *LogpushEdgeService) {
- r = &LogpushEdgeService{}
- r.Options = opts
- return
-}
-
-// Creates a new Instant Logs job for a zone.
-func (r *LogpushEdgeService) New(ctx context.Context, params LogpushEdgeNewParams, opts ...option.RequestOption) (res *LogpushEdgeNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env LogpushEdgeNewResponseEnvelope
- path := fmt.Sprintf("zones/%s/logpush/edge", params.ZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Lists Instant Logs jobs for a zone.
-func (r *LogpushEdgeService) Get(ctx context.Context, query LogpushEdgeGetParams, opts ...option.RequestOption) (res *[]LogpushEdgeGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env LogpushEdgeGetResponseEnvelope
- path := fmt.Sprintf("zones/%s/logpush/edge", query.ZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type LogpushEdgeNewResponse struct {
- // Unique WebSocket address that will receive messages from Cloudflare’s edge.
- DestinationConf string `json:"destination_conf" format:"uri"`
- // Comma-separated list of fields.
- Fields string `json:"fields"`
- // Filters to drill down into specific events.
- Filter string `json:"filter"`
- // The sample parameter is the sample rate of the records set by the client:
- // "sample": 1 is 100% of records "sample": 10 is 10% and so on.
- Sample int64 `json:"sample"`
- // Unique session id of the job.
- SessionID string `json:"session_id"`
- JSON logpushEdgeNewResponseJSON `json:"-"`
-}
-
-// logpushEdgeNewResponseJSON contains the JSON metadata for the struct
-// [LogpushEdgeNewResponse]
-type logpushEdgeNewResponseJSON struct {
- DestinationConf apijson.Field
- Fields apijson.Field
- Filter apijson.Field
- Sample apijson.Field
- SessionID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LogpushEdgeNewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r logpushEdgeNewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type LogpushEdgeGetResponse struct {
- // Unique WebSocket address that will receive messages from Cloudflare’s edge.
- DestinationConf string `json:"destination_conf" format:"uri"`
- // Comma-separated list of fields.
- Fields string `json:"fields"`
- // Filters to drill down into specific events.
- Filter string `json:"filter"`
- // The sample parameter is the sample rate of the records set by the client:
- // "sample": 1 is 100% of records "sample": 10 is 10% and so on.
- Sample int64 `json:"sample"`
- // Unique session id of the job.
- SessionID string `json:"session_id"`
- JSON logpushEdgeGetResponseJSON `json:"-"`
-}
-
-// logpushEdgeGetResponseJSON contains the JSON metadata for the struct
-// [LogpushEdgeGetResponse]
-type logpushEdgeGetResponseJSON struct {
- DestinationConf apijson.Field
- Fields apijson.Field
- Filter apijson.Field
- Sample apijson.Field
- SessionID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LogpushEdgeGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r logpushEdgeGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type LogpushEdgeNewParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
- // Comma-separated list of fields.
- Fields param.Field[string] `json:"fields"`
- // Filters to drill down into specific events.
- Filter param.Field[string] `json:"filter"`
- // The sample parameter is the sample rate of the records set by the client:
- // "sample": 1 is 100% of records "sample": 10 is 10% and so on.
- Sample param.Field[int64] `json:"sample"`
-}
-
-func (r LogpushEdgeNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type LogpushEdgeNewResponseEnvelope struct {
- Errors []LogpushEdgeNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []LogpushEdgeNewResponseEnvelopeMessages `json:"messages,required"`
- Result LogpushEdgeNewResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success LogpushEdgeNewResponseEnvelopeSuccess `json:"success,required"`
- JSON logpushEdgeNewResponseEnvelopeJSON `json:"-"`
-}
-
-// logpushEdgeNewResponseEnvelopeJSON contains the JSON metadata for the struct
-// [LogpushEdgeNewResponseEnvelope]
-type logpushEdgeNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LogpushEdgeNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r logpushEdgeNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type LogpushEdgeNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON logpushEdgeNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// logpushEdgeNewResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [LogpushEdgeNewResponseEnvelopeErrors]
-type logpushEdgeNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LogpushEdgeNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r logpushEdgeNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type LogpushEdgeNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON logpushEdgeNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// logpushEdgeNewResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [LogpushEdgeNewResponseEnvelopeMessages]
-type logpushEdgeNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LogpushEdgeNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r logpushEdgeNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type LogpushEdgeNewResponseEnvelopeSuccess bool
-
-const (
- LogpushEdgeNewResponseEnvelopeSuccessTrue LogpushEdgeNewResponseEnvelopeSuccess = true
-)
-
-type LogpushEdgeGetParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
-}
-
-type LogpushEdgeGetResponseEnvelope struct {
- Errors []LogpushEdgeGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []LogpushEdgeGetResponseEnvelopeMessages `json:"messages,required"`
- Result []LogpushEdgeGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success LogpushEdgeGetResponseEnvelopeSuccess `json:"success,required"`
- JSON logpushEdgeGetResponseEnvelopeJSON `json:"-"`
-}
-
-// logpushEdgeGetResponseEnvelopeJSON contains the JSON metadata for the struct
-// [LogpushEdgeGetResponseEnvelope]
-type logpushEdgeGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LogpushEdgeGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r logpushEdgeGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type LogpushEdgeGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON logpushEdgeGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// logpushEdgeGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [LogpushEdgeGetResponseEnvelopeErrors]
-type logpushEdgeGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LogpushEdgeGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r logpushEdgeGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type LogpushEdgeGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON logpushEdgeGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// logpushEdgeGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [LogpushEdgeGetResponseEnvelopeMessages]
-type logpushEdgeGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LogpushEdgeGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r logpushEdgeGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type LogpushEdgeGetResponseEnvelopeSuccess bool
-
-const (
- LogpushEdgeGetResponseEnvelopeSuccessTrue LogpushEdgeGetResponseEnvelopeSuccess = true
-)
diff --git a/logpushedge_test.go b/logpushedge_test.go
deleted file mode 100644
index 7b2e83ee907..00000000000
--- a/logpushedge_test.go
+++ /dev/null
@@ -1,69 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestLogpushEdgeNewWithOptionalParams(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"),
- )
- _, err := client.Logpush.Edge.New(context.TODO(), cloudflare.LogpushEdgeNewParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Fields: cloudflare.F("ClientIP,ClientRequestHost,ClientRequestMethod,ClientRequestURI,EdgeEndTimestamp,EdgeResponseBytes,EdgeResponseStatus,EdgeStartTimestamp,RayID"),
- Filter: cloudflare.F("{\"where\":{\"and\":[{\"key\":\"ClientCountry\",\"operator\":\"neq\",\"value\":\"ca\"}]}}"),
- Sample: cloudflare.F(int64(1)),
- })
- 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())
- }
-}
-
-func TestLogpushEdgeGet(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"),
- )
- _, err := client.Logpush.Edge.Get(context.TODO(), cloudflare.LogpushEdgeGetParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- })
- 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/logpushjob.go b/logpushjob.go
deleted file mode 100644
index 5bf3588dbf5..00000000000
--- a/logpushjob.go
+++ /dev/null
@@ -1,1484 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "reflect"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/option"
- "github.com/tidwall/gjson"
-)
-
-// LogpushJobService contains methods and other services that help with interacting
-// with the cloudflare API. Note, unlike clients, this service does not read
-// variables from the environment automatically. You should not instantiate this
-// service directly, and instead use the [NewLogpushJobService] method instead.
-type LogpushJobService struct {
- Options []option.RequestOption
-}
-
-// NewLogpushJobService generates a new service that applies the given options to
-// each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewLogpushJobService(opts ...option.RequestOption) (r *LogpushJobService) {
- r = &LogpushJobService{}
- r.Options = opts
- return
-}
-
-// Creates a new Logpush job for an account or zone.
-func (r *LogpushJobService) New(ctx context.Context, params LogpushJobNewParams, opts ...option.RequestOption) (res *LogpushJobNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env LogpushJobNewResponseEnvelope
- var accountOrZone string
- var accountOrZoneID param.Field[string]
- if params.AccountID.Present {
- accountOrZone = "accounts"
- accountOrZoneID = params.AccountID
- } else {
- accountOrZone = "zones"
- accountOrZoneID = params.ZoneID
- }
- path := fmt.Sprintf("%s/%s/logpush/jobs", accountOrZone, accountOrZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Updates a Logpush job.
-func (r *LogpushJobService) Update(ctx context.Context, jobID int64, params LogpushJobUpdateParams, opts ...option.RequestOption) (res *LogpushJobUpdateResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env LogpushJobUpdateResponseEnvelope
- var accountOrZone string
- var accountOrZoneID param.Field[string]
- if params.AccountID.Present {
- accountOrZone = "accounts"
- accountOrZoneID = params.AccountID
- } else {
- accountOrZone = "zones"
- accountOrZoneID = params.ZoneID
- }
- path := fmt.Sprintf("%s/%s/logpush/jobs/%v", accountOrZone, accountOrZoneID, jobID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Lists Logpush jobs for an account or zone.
-func (r *LogpushJobService) List(ctx context.Context, query LogpushJobListParams, opts ...option.RequestOption) (res *[]LogpushJobListResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env LogpushJobListResponseEnvelope
- var accountOrZone string
- var accountOrZoneID param.Field[string]
- if query.AccountID.Present {
- accountOrZone = "accounts"
- accountOrZoneID = query.AccountID
- } else {
- accountOrZone = "zones"
- accountOrZoneID = query.ZoneID
- }
- path := fmt.Sprintf("%s/%s/logpush/jobs", accountOrZone, accountOrZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Deletes a Logpush job.
-func (r *LogpushJobService) Delete(ctx context.Context, jobID int64, body LogpushJobDeleteParams, opts ...option.RequestOption) (res *LogpushJobDeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env LogpushJobDeleteResponseEnvelope
- var accountOrZone string
- var accountOrZoneID param.Field[string]
- if body.AccountID.Present {
- accountOrZone = "accounts"
- accountOrZoneID = body.AccountID
- } else {
- accountOrZone = "zones"
- accountOrZoneID = body.ZoneID
- }
- path := fmt.Sprintf("%s/%s/logpush/jobs/%v", accountOrZone, accountOrZoneID, jobID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Gets the details of a Logpush job.
-func (r *LogpushJobService) Get(ctx context.Context, jobID int64, query LogpushJobGetParams, opts ...option.RequestOption) (res *LogpushJobGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env LogpushJobGetResponseEnvelope
- var accountOrZone string
- var accountOrZoneID param.Field[string]
- if query.AccountID.Present {
- accountOrZone = "accounts"
- accountOrZoneID = query.AccountID
- } else {
- accountOrZone = "zones"
- accountOrZoneID = query.ZoneID
- }
- path := fmt.Sprintf("%s/%s/logpush/jobs/%v", accountOrZone, accountOrZoneID, jobID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type LogpushJobNewResponse struct {
- // Unique id of the job.
- ID int64 `json:"id"`
- // Name of the dataset.
- Dataset string `json:"dataset,nullable"`
- // Uniquely identifies a resource (such as an s3 bucket) where data will be pushed.
- // Additional configuration parameters supported by the destination may be
- // included.
- DestinationConf string `json:"destination_conf" format:"uri"`
- // Flag that indicates if the job is enabled.
- Enabled bool `json:"enabled"`
- // If not null, the job is currently failing. Failures are usually repetitive
- // (example: no permissions to write to destination bucket). Only the last failure
- // is recorded. On successful execution of a job the error_message and last_error
- // are set to null.
- ErrorMessage time.Time `json:"error_message,nullable" format:"date-time"`
- // The frequency at which Cloudflare sends batches of logs to your destination.
- // Setting frequency to high sends your logs in larger quantities of smaller files.
- // Setting frequency to low sends logs in smaller quantities of larger files.
- Frequency LogpushJobNewResponseFrequency `json:"frequency,nullable"`
- // Records the last time for which logs have been successfully pushed. If the last
- // successful push was for logs range 2018-07-23T10:00:00Z to 2018-07-23T10:01:00Z
- // then the value of this field will be 2018-07-23T10:01:00Z. If the job has never
- // run or has just been enabled and hasn't run yet then the field will be empty.
- LastComplete time.Time `json:"last_complete,nullable" format:"date-time"`
- // Records the last time the job failed. If not null, the job is currently failing.
- // If null, the job has either never failed or has run successfully at least once
- // since last failure. See also the error_message field.
- LastError time.Time `json:"last_error,nullable" format:"date-time"`
- // This field is deprecated. Use `output_options` instead. Configuration string. It
- // specifies things like requested fields and timestamp formats. If migrating from
- // the logpull api, copy the url (full url or just the query string) of your call
- // here, and logpush will keep on making this call for you, setting start and end
- // times appropriately.
- LogpullOptions string `json:"logpull_options,nullable" format:"uri-reference"`
- // Optional human readable job name. Not unique. Cloudflare suggests that you set
- // this to a meaningful string, like the domain name, to make it easier to identify
- // your job.
- Name string `json:"name,nullable"`
- // The structured replacement for `logpull_options`. When including this field, the
- // `logpull_option` field will be ignored.
- OutputOptions LogpushJobNewResponseOutputOptions `json:"output_options,nullable"`
- JSON logpushJobNewResponseJSON `json:"-"`
-}
-
-// logpushJobNewResponseJSON contains the JSON metadata for the struct
-// [LogpushJobNewResponse]
-type logpushJobNewResponseJSON struct {
- ID apijson.Field
- Dataset apijson.Field
- DestinationConf apijson.Field
- Enabled apijson.Field
- ErrorMessage apijson.Field
- Frequency apijson.Field
- LastComplete apijson.Field
- LastError apijson.Field
- LogpullOptions apijson.Field
- Name apijson.Field
- OutputOptions apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LogpushJobNewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r logpushJobNewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// The frequency at which Cloudflare sends batches of logs to your destination.
-// Setting frequency to high sends your logs in larger quantities of smaller files.
-// Setting frequency to low sends logs in smaller quantities of larger files.
-type LogpushJobNewResponseFrequency string
-
-const (
- LogpushJobNewResponseFrequencyHigh LogpushJobNewResponseFrequency = "high"
- LogpushJobNewResponseFrequencyLow LogpushJobNewResponseFrequency = "low"
-)
-
-// The structured replacement for `logpull_options`. When including this field, the
-// `logpull_option` field will be ignored.
-type LogpushJobNewResponseOutputOptions struct {
- // String to be prepended before each batch.
- BatchPrefix string `json:"batch_prefix,nullable"`
- // String to be appended after each batch.
- BatchSuffix string `json:"batch_suffix,nullable"`
- // If set to true, will cause all occurrences of `${` in the generated files to be
- // replaced with `x{`.
- Cve2021_4428 bool `json:"CVE-2021-4428,nullable"`
- // String to join fields. This field be ignored when `record_template` is set.
- FieldDelimiter string `json:"field_delimiter,nullable"`
- // List of field names to be included in the Logpush output. For the moment, there
- // is no option to add all fields at once, so you must specify all the fields names
- // you are interested in.
- FieldNames []string `json:"field_names"`
- // Specifies the output type, such as `ndjson` or `csv`. This sets default values
- // for the rest of the settings, depending on the chosen output type. Some
- // formatting rules, like string quoting, are different between output types.
- OutputType LogpushJobNewResponseOutputOptionsOutputType `json:"output_type"`
- // String to be inserted in-between the records as separator.
- RecordDelimiter string `json:"record_delimiter,nullable"`
- // String to be prepended before each record.
- RecordPrefix string `json:"record_prefix,nullable"`
- // String to be appended after each record.
- RecordSuffix string `json:"record_suffix,nullable"`
- // String to use as template for each record instead of the default comma-separated
- // list. All fields used in the template must be present in `field_names` as well,
- // otherwise they will end up as null. Format as a Go `text/template` without any
- // standard functions, like conditionals, loops, sub-templates, etc.
- RecordTemplate string `json:"record_template,nullable"`
- // Floating number to specify sampling rate. Sampling is applied on top of
- // filtering, and regardless of the current `sample_interval` of the data.
- SampleRate float64 `json:"sample_rate,nullable"`
- // String to specify the format for timestamps, such as `unixnano`, `unix`, or
- // `rfc3339`.
- TimestampFormat LogpushJobNewResponseOutputOptionsTimestampFormat `json:"timestamp_format"`
- JSON logpushJobNewResponseOutputOptionsJSON `json:"-"`
-}
-
-// logpushJobNewResponseOutputOptionsJSON contains the JSON metadata for the struct
-// [LogpushJobNewResponseOutputOptions]
-type logpushJobNewResponseOutputOptionsJSON struct {
- BatchPrefix apijson.Field
- BatchSuffix apijson.Field
- Cve2021_4428 apijson.Field
- FieldDelimiter apijson.Field
- FieldNames apijson.Field
- OutputType apijson.Field
- RecordDelimiter apijson.Field
- RecordPrefix apijson.Field
- RecordSuffix apijson.Field
- RecordTemplate apijson.Field
- SampleRate apijson.Field
- TimestampFormat apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LogpushJobNewResponseOutputOptions) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r logpushJobNewResponseOutputOptionsJSON) RawJSON() string {
- return r.raw
-}
-
-// Specifies the output type, such as `ndjson` or `csv`. This sets default values
-// for the rest of the settings, depending on the chosen output type. Some
-// formatting rules, like string quoting, are different between output types.
-type LogpushJobNewResponseOutputOptionsOutputType string
-
-const (
- LogpushJobNewResponseOutputOptionsOutputTypeNdjson LogpushJobNewResponseOutputOptionsOutputType = "ndjson"
- LogpushJobNewResponseOutputOptionsOutputTypeCsv LogpushJobNewResponseOutputOptionsOutputType = "csv"
-)
-
-// String to specify the format for timestamps, such as `unixnano`, `unix`, or
-// `rfc3339`.
-type LogpushJobNewResponseOutputOptionsTimestampFormat string
-
-const (
- LogpushJobNewResponseOutputOptionsTimestampFormatUnixnano LogpushJobNewResponseOutputOptionsTimestampFormat = "unixnano"
- LogpushJobNewResponseOutputOptionsTimestampFormatUnix LogpushJobNewResponseOutputOptionsTimestampFormat = "unix"
- LogpushJobNewResponseOutputOptionsTimestampFormatRfc3339 LogpushJobNewResponseOutputOptionsTimestampFormat = "rfc3339"
-)
-
-type LogpushJobUpdateResponse struct {
- // Unique id of the job.
- ID int64 `json:"id"`
- // Name of the dataset.
- Dataset string `json:"dataset,nullable"`
- // Uniquely identifies a resource (such as an s3 bucket) where data will be pushed.
- // Additional configuration parameters supported by the destination may be
- // included.
- DestinationConf string `json:"destination_conf" format:"uri"`
- // Flag that indicates if the job is enabled.
- Enabled bool `json:"enabled"`
- // If not null, the job is currently failing. Failures are usually repetitive
- // (example: no permissions to write to destination bucket). Only the last failure
- // is recorded. On successful execution of a job the error_message and last_error
- // are set to null.
- ErrorMessage time.Time `json:"error_message,nullable" format:"date-time"`
- // The frequency at which Cloudflare sends batches of logs to your destination.
- // Setting frequency to high sends your logs in larger quantities of smaller files.
- // Setting frequency to low sends logs in smaller quantities of larger files.
- Frequency LogpushJobUpdateResponseFrequency `json:"frequency,nullable"`
- // Records the last time for which logs have been successfully pushed. If the last
- // successful push was for logs range 2018-07-23T10:00:00Z to 2018-07-23T10:01:00Z
- // then the value of this field will be 2018-07-23T10:01:00Z. If the job has never
- // run or has just been enabled and hasn't run yet then the field will be empty.
- LastComplete time.Time `json:"last_complete,nullable" format:"date-time"`
- // Records the last time the job failed. If not null, the job is currently failing.
- // If null, the job has either never failed or has run successfully at least once
- // since last failure. See also the error_message field.
- LastError time.Time `json:"last_error,nullable" format:"date-time"`
- // This field is deprecated. Use `output_options` instead. Configuration string. It
- // specifies things like requested fields and timestamp formats. If migrating from
- // the logpull api, copy the url (full url or just the query string) of your call
- // here, and logpush will keep on making this call for you, setting start and end
- // times appropriately.
- LogpullOptions string `json:"logpull_options,nullable" format:"uri-reference"`
- // Optional human readable job name. Not unique. Cloudflare suggests that you set
- // this to a meaningful string, like the domain name, to make it easier to identify
- // your job.
- Name string `json:"name,nullable"`
- // The structured replacement for `logpull_options`. When including this field, the
- // `logpull_option` field will be ignored.
- OutputOptions LogpushJobUpdateResponseOutputOptions `json:"output_options,nullable"`
- JSON logpushJobUpdateResponseJSON `json:"-"`
-}
-
-// logpushJobUpdateResponseJSON contains the JSON metadata for the struct
-// [LogpushJobUpdateResponse]
-type logpushJobUpdateResponseJSON struct {
- ID apijson.Field
- Dataset apijson.Field
- DestinationConf apijson.Field
- Enabled apijson.Field
- ErrorMessage apijson.Field
- Frequency apijson.Field
- LastComplete apijson.Field
- LastError apijson.Field
- LogpullOptions apijson.Field
- Name apijson.Field
- OutputOptions apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LogpushJobUpdateResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r logpushJobUpdateResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// The frequency at which Cloudflare sends batches of logs to your destination.
-// Setting frequency to high sends your logs in larger quantities of smaller files.
-// Setting frequency to low sends logs in smaller quantities of larger files.
-type LogpushJobUpdateResponseFrequency string
-
-const (
- LogpushJobUpdateResponseFrequencyHigh LogpushJobUpdateResponseFrequency = "high"
- LogpushJobUpdateResponseFrequencyLow LogpushJobUpdateResponseFrequency = "low"
-)
-
-// The structured replacement for `logpull_options`. When including this field, the
-// `logpull_option` field will be ignored.
-type LogpushJobUpdateResponseOutputOptions struct {
- // String to be prepended before each batch.
- BatchPrefix string `json:"batch_prefix,nullable"`
- // String to be appended after each batch.
- BatchSuffix string `json:"batch_suffix,nullable"`
- // If set to true, will cause all occurrences of `${` in the generated files to be
- // replaced with `x{`.
- Cve2021_4428 bool `json:"CVE-2021-4428,nullable"`
- // String to join fields. This field be ignored when `record_template` is set.
- FieldDelimiter string `json:"field_delimiter,nullable"`
- // List of field names to be included in the Logpush output. For the moment, there
- // is no option to add all fields at once, so you must specify all the fields names
- // you are interested in.
- FieldNames []string `json:"field_names"`
- // Specifies the output type, such as `ndjson` or `csv`. This sets default values
- // for the rest of the settings, depending on the chosen output type. Some
- // formatting rules, like string quoting, are different between output types.
- OutputType LogpushJobUpdateResponseOutputOptionsOutputType `json:"output_type"`
- // String to be inserted in-between the records as separator.
- RecordDelimiter string `json:"record_delimiter,nullable"`
- // String to be prepended before each record.
- RecordPrefix string `json:"record_prefix,nullable"`
- // String to be appended after each record.
- RecordSuffix string `json:"record_suffix,nullable"`
- // String to use as template for each record instead of the default comma-separated
- // list. All fields used in the template must be present in `field_names` as well,
- // otherwise they will end up as null. Format as a Go `text/template` without any
- // standard functions, like conditionals, loops, sub-templates, etc.
- RecordTemplate string `json:"record_template,nullable"`
- // Floating number to specify sampling rate. Sampling is applied on top of
- // filtering, and regardless of the current `sample_interval` of the data.
- SampleRate float64 `json:"sample_rate,nullable"`
- // String to specify the format for timestamps, such as `unixnano`, `unix`, or
- // `rfc3339`.
- TimestampFormat LogpushJobUpdateResponseOutputOptionsTimestampFormat `json:"timestamp_format"`
- JSON logpushJobUpdateResponseOutputOptionsJSON `json:"-"`
-}
-
-// logpushJobUpdateResponseOutputOptionsJSON contains the JSON metadata for the
-// struct [LogpushJobUpdateResponseOutputOptions]
-type logpushJobUpdateResponseOutputOptionsJSON struct {
- BatchPrefix apijson.Field
- BatchSuffix apijson.Field
- Cve2021_4428 apijson.Field
- FieldDelimiter apijson.Field
- FieldNames apijson.Field
- OutputType apijson.Field
- RecordDelimiter apijson.Field
- RecordPrefix apijson.Field
- RecordSuffix apijson.Field
- RecordTemplate apijson.Field
- SampleRate apijson.Field
- TimestampFormat apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LogpushJobUpdateResponseOutputOptions) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r logpushJobUpdateResponseOutputOptionsJSON) RawJSON() string {
- return r.raw
-}
-
-// Specifies the output type, such as `ndjson` or `csv`. This sets default values
-// for the rest of the settings, depending on the chosen output type. Some
-// formatting rules, like string quoting, are different between output types.
-type LogpushJobUpdateResponseOutputOptionsOutputType string
-
-const (
- LogpushJobUpdateResponseOutputOptionsOutputTypeNdjson LogpushJobUpdateResponseOutputOptionsOutputType = "ndjson"
- LogpushJobUpdateResponseOutputOptionsOutputTypeCsv LogpushJobUpdateResponseOutputOptionsOutputType = "csv"
-)
-
-// String to specify the format for timestamps, such as `unixnano`, `unix`, or
-// `rfc3339`.
-type LogpushJobUpdateResponseOutputOptionsTimestampFormat string
-
-const (
- LogpushJobUpdateResponseOutputOptionsTimestampFormatUnixnano LogpushJobUpdateResponseOutputOptionsTimestampFormat = "unixnano"
- LogpushJobUpdateResponseOutputOptionsTimestampFormatUnix LogpushJobUpdateResponseOutputOptionsTimestampFormat = "unix"
- LogpushJobUpdateResponseOutputOptionsTimestampFormatRfc3339 LogpushJobUpdateResponseOutputOptionsTimestampFormat = "rfc3339"
-)
-
-type LogpushJobListResponse struct {
- // Unique id of the job.
- ID int64 `json:"id"`
- // Name of the dataset.
- Dataset string `json:"dataset,nullable"`
- // Uniquely identifies a resource (such as an s3 bucket) where data will be pushed.
- // Additional configuration parameters supported by the destination may be
- // included.
- DestinationConf string `json:"destination_conf" format:"uri"`
- // Flag that indicates if the job is enabled.
- Enabled bool `json:"enabled"`
- // If not null, the job is currently failing. Failures are usually repetitive
- // (example: no permissions to write to destination bucket). Only the last failure
- // is recorded. On successful execution of a job the error_message and last_error
- // are set to null.
- ErrorMessage time.Time `json:"error_message,nullable" format:"date-time"`
- // The frequency at which Cloudflare sends batches of logs to your destination.
- // Setting frequency to high sends your logs in larger quantities of smaller files.
- // Setting frequency to low sends logs in smaller quantities of larger files.
- Frequency LogpushJobListResponseFrequency `json:"frequency,nullable"`
- // Records the last time for which logs have been successfully pushed. If the last
- // successful push was for logs range 2018-07-23T10:00:00Z to 2018-07-23T10:01:00Z
- // then the value of this field will be 2018-07-23T10:01:00Z. If the job has never
- // run or has just been enabled and hasn't run yet then the field will be empty.
- LastComplete time.Time `json:"last_complete,nullable" format:"date-time"`
- // Records the last time the job failed. If not null, the job is currently failing.
- // If null, the job has either never failed or has run successfully at least once
- // since last failure. See also the error_message field.
- LastError time.Time `json:"last_error,nullable" format:"date-time"`
- // This field is deprecated. Use `output_options` instead. Configuration string. It
- // specifies things like requested fields and timestamp formats. If migrating from
- // the logpull api, copy the url (full url or just the query string) of your call
- // here, and logpush will keep on making this call for you, setting start and end
- // times appropriately.
- LogpullOptions string `json:"logpull_options,nullable" format:"uri-reference"`
- // Optional human readable job name. Not unique. Cloudflare suggests that you set
- // this to a meaningful string, like the domain name, to make it easier to identify
- // your job.
- Name string `json:"name,nullable"`
- // The structured replacement for `logpull_options`. When including this field, the
- // `logpull_option` field will be ignored.
- OutputOptions LogpushJobListResponseOutputOptions `json:"output_options,nullable"`
- JSON logpushJobListResponseJSON `json:"-"`
-}
-
-// logpushJobListResponseJSON contains the JSON metadata for the struct
-// [LogpushJobListResponse]
-type logpushJobListResponseJSON struct {
- ID apijson.Field
- Dataset apijson.Field
- DestinationConf apijson.Field
- Enabled apijson.Field
- ErrorMessage apijson.Field
- Frequency apijson.Field
- LastComplete apijson.Field
- LastError apijson.Field
- LogpullOptions apijson.Field
- Name apijson.Field
- OutputOptions apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LogpushJobListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r logpushJobListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// The frequency at which Cloudflare sends batches of logs to your destination.
-// Setting frequency to high sends your logs in larger quantities of smaller files.
-// Setting frequency to low sends logs in smaller quantities of larger files.
-type LogpushJobListResponseFrequency string
-
-const (
- LogpushJobListResponseFrequencyHigh LogpushJobListResponseFrequency = "high"
- LogpushJobListResponseFrequencyLow LogpushJobListResponseFrequency = "low"
-)
-
-// The structured replacement for `logpull_options`. When including this field, the
-// `logpull_option` field will be ignored.
-type LogpushJobListResponseOutputOptions struct {
- // String to be prepended before each batch.
- BatchPrefix string `json:"batch_prefix,nullable"`
- // String to be appended after each batch.
- BatchSuffix string `json:"batch_suffix,nullable"`
- // If set to true, will cause all occurrences of `${` in the generated files to be
- // replaced with `x{`.
- Cve2021_4428 bool `json:"CVE-2021-4428,nullable"`
- // String to join fields. This field be ignored when `record_template` is set.
- FieldDelimiter string `json:"field_delimiter,nullable"`
- // List of field names to be included in the Logpush output. For the moment, there
- // is no option to add all fields at once, so you must specify all the fields names
- // you are interested in.
- FieldNames []string `json:"field_names"`
- // Specifies the output type, such as `ndjson` or `csv`. This sets default values
- // for the rest of the settings, depending on the chosen output type. Some
- // formatting rules, like string quoting, are different between output types.
- OutputType LogpushJobListResponseOutputOptionsOutputType `json:"output_type"`
- // String to be inserted in-between the records as separator.
- RecordDelimiter string `json:"record_delimiter,nullable"`
- // String to be prepended before each record.
- RecordPrefix string `json:"record_prefix,nullable"`
- // String to be appended after each record.
- RecordSuffix string `json:"record_suffix,nullable"`
- // String to use as template for each record instead of the default comma-separated
- // list. All fields used in the template must be present in `field_names` as well,
- // otherwise they will end up as null. Format as a Go `text/template` without any
- // standard functions, like conditionals, loops, sub-templates, etc.
- RecordTemplate string `json:"record_template,nullable"`
- // Floating number to specify sampling rate. Sampling is applied on top of
- // filtering, and regardless of the current `sample_interval` of the data.
- SampleRate float64 `json:"sample_rate,nullable"`
- // String to specify the format for timestamps, such as `unixnano`, `unix`, or
- // `rfc3339`.
- TimestampFormat LogpushJobListResponseOutputOptionsTimestampFormat `json:"timestamp_format"`
- JSON logpushJobListResponseOutputOptionsJSON `json:"-"`
-}
-
-// logpushJobListResponseOutputOptionsJSON contains the JSON metadata for the
-// struct [LogpushJobListResponseOutputOptions]
-type logpushJobListResponseOutputOptionsJSON struct {
- BatchPrefix apijson.Field
- BatchSuffix apijson.Field
- Cve2021_4428 apijson.Field
- FieldDelimiter apijson.Field
- FieldNames apijson.Field
- OutputType apijson.Field
- RecordDelimiter apijson.Field
- RecordPrefix apijson.Field
- RecordSuffix apijson.Field
- RecordTemplate apijson.Field
- SampleRate apijson.Field
- TimestampFormat apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LogpushJobListResponseOutputOptions) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r logpushJobListResponseOutputOptionsJSON) RawJSON() string {
- return r.raw
-}
-
-// Specifies the output type, such as `ndjson` or `csv`. This sets default values
-// for the rest of the settings, depending on the chosen output type. Some
-// formatting rules, like string quoting, are different between output types.
-type LogpushJobListResponseOutputOptionsOutputType string
-
-const (
- LogpushJobListResponseOutputOptionsOutputTypeNdjson LogpushJobListResponseOutputOptionsOutputType = "ndjson"
- LogpushJobListResponseOutputOptionsOutputTypeCsv LogpushJobListResponseOutputOptionsOutputType = "csv"
-)
-
-// String to specify the format for timestamps, such as `unixnano`, `unix`, or
-// `rfc3339`.
-type LogpushJobListResponseOutputOptionsTimestampFormat string
-
-const (
- LogpushJobListResponseOutputOptionsTimestampFormatUnixnano LogpushJobListResponseOutputOptionsTimestampFormat = "unixnano"
- LogpushJobListResponseOutputOptionsTimestampFormatUnix LogpushJobListResponseOutputOptionsTimestampFormat = "unix"
- LogpushJobListResponseOutputOptionsTimestampFormatRfc3339 LogpushJobListResponseOutputOptionsTimestampFormat = "rfc3339"
-)
-
-// Union satisfied by [LogpushJobDeleteResponseUnknown],
-// [LogpushJobDeleteResponseArray] or [shared.UnionString].
-type LogpushJobDeleteResponse interface {
- ImplementsLogpushJobDeleteResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*LogpushJobDeleteResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(LogpushJobDeleteResponseArray{}),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-type LogpushJobDeleteResponseArray []interface{}
-
-func (r LogpushJobDeleteResponseArray) ImplementsLogpushJobDeleteResponse() {}
-
-type LogpushJobGetResponse struct {
- // Unique id of the job.
- ID int64 `json:"id"`
- // Name of the dataset.
- Dataset string `json:"dataset,nullable"`
- // Uniquely identifies a resource (such as an s3 bucket) where data will be pushed.
- // Additional configuration parameters supported by the destination may be
- // included.
- DestinationConf string `json:"destination_conf" format:"uri"`
- // Flag that indicates if the job is enabled.
- Enabled bool `json:"enabled"`
- // If not null, the job is currently failing. Failures are usually repetitive
- // (example: no permissions to write to destination bucket). Only the last failure
- // is recorded. On successful execution of a job the error_message and last_error
- // are set to null.
- ErrorMessage time.Time `json:"error_message,nullable" format:"date-time"`
- // The frequency at which Cloudflare sends batches of logs to your destination.
- // Setting frequency to high sends your logs in larger quantities of smaller files.
- // Setting frequency to low sends logs in smaller quantities of larger files.
- Frequency LogpushJobGetResponseFrequency `json:"frequency,nullable"`
- // Records the last time for which logs have been successfully pushed. If the last
- // successful push was for logs range 2018-07-23T10:00:00Z to 2018-07-23T10:01:00Z
- // then the value of this field will be 2018-07-23T10:01:00Z. If the job has never
- // run or has just been enabled and hasn't run yet then the field will be empty.
- LastComplete time.Time `json:"last_complete,nullable" format:"date-time"`
- // Records the last time the job failed. If not null, the job is currently failing.
- // If null, the job has either never failed or has run successfully at least once
- // since last failure. See also the error_message field.
- LastError time.Time `json:"last_error,nullable" format:"date-time"`
- // This field is deprecated. Use `output_options` instead. Configuration string. It
- // specifies things like requested fields and timestamp formats. If migrating from
- // the logpull api, copy the url (full url or just the query string) of your call
- // here, and logpush will keep on making this call for you, setting start and end
- // times appropriately.
- LogpullOptions string `json:"logpull_options,nullable" format:"uri-reference"`
- // Optional human readable job name. Not unique. Cloudflare suggests that you set
- // this to a meaningful string, like the domain name, to make it easier to identify
- // your job.
- Name string `json:"name,nullable"`
- // The structured replacement for `logpull_options`. When including this field, the
- // `logpull_option` field will be ignored.
- OutputOptions LogpushJobGetResponseOutputOptions `json:"output_options,nullable"`
- JSON logpushJobGetResponseJSON `json:"-"`
-}
-
-// logpushJobGetResponseJSON contains the JSON metadata for the struct
-// [LogpushJobGetResponse]
-type logpushJobGetResponseJSON struct {
- ID apijson.Field
- Dataset apijson.Field
- DestinationConf apijson.Field
- Enabled apijson.Field
- ErrorMessage apijson.Field
- Frequency apijson.Field
- LastComplete apijson.Field
- LastError apijson.Field
- LogpullOptions apijson.Field
- Name apijson.Field
- OutputOptions apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LogpushJobGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r logpushJobGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// The frequency at which Cloudflare sends batches of logs to your destination.
-// Setting frequency to high sends your logs in larger quantities of smaller files.
-// Setting frequency to low sends logs in smaller quantities of larger files.
-type LogpushJobGetResponseFrequency string
-
-const (
- LogpushJobGetResponseFrequencyHigh LogpushJobGetResponseFrequency = "high"
- LogpushJobGetResponseFrequencyLow LogpushJobGetResponseFrequency = "low"
-)
-
-// The structured replacement for `logpull_options`. When including this field, the
-// `logpull_option` field will be ignored.
-type LogpushJobGetResponseOutputOptions struct {
- // String to be prepended before each batch.
- BatchPrefix string `json:"batch_prefix,nullable"`
- // String to be appended after each batch.
- BatchSuffix string `json:"batch_suffix,nullable"`
- // If set to true, will cause all occurrences of `${` in the generated files to be
- // replaced with `x{`.
- Cve2021_4428 bool `json:"CVE-2021-4428,nullable"`
- // String to join fields. This field be ignored when `record_template` is set.
- FieldDelimiter string `json:"field_delimiter,nullable"`
- // List of field names to be included in the Logpush output. For the moment, there
- // is no option to add all fields at once, so you must specify all the fields names
- // you are interested in.
- FieldNames []string `json:"field_names"`
- // Specifies the output type, such as `ndjson` or `csv`. This sets default values
- // for the rest of the settings, depending on the chosen output type. Some
- // formatting rules, like string quoting, are different between output types.
- OutputType LogpushJobGetResponseOutputOptionsOutputType `json:"output_type"`
- // String to be inserted in-between the records as separator.
- RecordDelimiter string `json:"record_delimiter,nullable"`
- // String to be prepended before each record.
- RecordPrefix string `json:"record_prefix,nullable"`
- // String to be appended after each record.
- RecordSuffix string `json:"record_suffix,nullable"`
- // String to use as template for each record instead of the default comma-separated
- // list. All fields used in the template must be present in `field_names` as well,
- // otherwise they will end up as null. Format as a Go `text/template` without any
- // standard functions, like conditionals, loops, sub-templates, etc.
- RecordTemplate string `json:"record_template,nullable"`
- // Floating number to specify sampling rate. Sampling is applied on top of
- // filtering, and regardless of the current `sample_interval` of the data.
- SampleRate float64 `json:"sample_rate,nullable"`
- // String to specify the format for timestamps, such as `unixnano`, `unix`, or
- // `rfc3339`.
- TimestampFormat LogpushJobGetResponseOutputOptionsTimestampFormat `json:"timestamp_format"`
- JSON logpushJobGetResponseOutputOptionsJSON `json:"-"`
-}
-
-// logpushJobGetResponseOutputOptionsJSON contains the JSON metadata for the struct
-// [LogpushJobGetResponseOutputOptions]
-type logpushJobGetResponseOutputOptionsJSON struct {
- BatchPrefix apijson.Field
- BatchSuffix apijson.Field
- Cve2021_4428 apijson.Field
- FieldDelimiter apijson.Field
- FieldNames apijson.Field
- OutputType apijson.Field
- RecordDelimiter apijson.Field
- RecordPrefix apijson.Field
- RecordSuffix apijson.Field
- RecordTemplate apijson.Field
- SampleRate apijson.Field
- TimestampFormat apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LogpushJobGetResponseOutputOptions) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r logpushJobGetResponseOutputOptionsJSON) RawJSON() string {
- return r.raw
-}
-
-// Specifies the output type, such as `ndjson` or `csv`. This sets default values
-// for the rest of the settings, depending on the chosen output type. Some
-// formatting rules, like string quoting, are different between output types.
-type LogpushJobGetResponseOutputOptionsOutputType string
-
-const (
- LogpushJobGetResponseOutputOptionsOutputTypeNdjson LogpushJobGetResponseOutputOptionsOutputType = "ndjson"
- LogpushJobGetResponseOutputOptionsOutputTypeCsv LogpushJobGetResponseOutputOptionsOutputType = "csv"
-)
-
-// String to specify the format for timestamps, such as `unixnano`, `unix`, or
-// `rfc3339`.
-type LogpushJobGetResponseOutputOptionsTimestampFormat string
-
-const (
- LogpushJobGetResponseOutputOptionsTimestampFormatUnixnano LogpushJobGetResponseOutputOptionsTimestampFormat = "unixnano"
- LogpushJobGetResponseOutputOptionsTimestampFormatUnix LogpushJobGetResponseOutputOptionsTimestampFormat = "unix"
- LogpushJobGetResponseOutputOptionsTimestampFormatRfc3339 LogpushJobGetResponseOutputOptionsTimestampFormat = "rfc3339"
-)
-
-type LogpushJobNewParams struct {
- // Uniquely identifies a resource (such as an s3 bucket) where data will be pushed.
- // Additional configuration parameters supported by the destination may be
- // included.
- DestinationConf param.Field[string] `json:"destination_conf,required" format:"uri"`
- // The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
- AccountID param.Field[string] `path:"account_id"`
- // The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- ZoneID param.Field[string] `path:"zone_id"`
- // Name of the dataset.
- Dataset param.Field[string] `json:"dataset"`
- // Flag that indicates if the job is enabled.
- Enabled param.Field[bool] `json:"enabled"`
- // The frequency at which Cloudflare sends batches of logs to your destination.
- // Setting frequency to high sends your logs in larger quantities of smaller files.
- // Setting frequency to low sends logs in smaller quantities of larger files.
- Frequency param.Field[LogpushJobNewParamsFrequency] `json:"frequency"`
- // This field is deprecated. Use `output_options` instead. Configuration string. It
- // specifies things like requested fields and timestamp formats. If migrating from
- // the logpull api, copy the url (full url or just the query string) of your call
- // here, and logpush will keep on making this call for you, setting start and end
- // times appropriately.
- LogpullOptions param.Field[string] `json:"logpull_options" format:"uri-reference"`
- // Optional human readable job name. Not unique. Cloudflare suggests that you set
- // this to a meaningful string, like the domain name, to make it easier to identify
- // your job.
- Name param.Field[string] `json:"name"`
- // The structured replacement for `logpull_options`. When including this field, the
- // `logpull_option` field will be ignored.
- OutputOptions param.Field[LogpushJobNewParamsOutputOptions] `json:"output_options"`
- // Ownership challenge token to prove destination ownership.
- OwnershipChallenge param.Field[string] `json:"ownership_challenge"`
-}
-
-func (r LogpushJobNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The frequency at which Cloudflare sends batches of logs to your destination.
-// Setting frequency to high sends your logs in larger quantities of smaller files.
-// Setting frequency to low sends logs in smaller quantities of larger files.
-type LogpushJobNewParamsFrequency string
-
-const (
- LogpushJobNewParamsFrequencyHigh LogpushJobNewParamsFrequency = "high"
- LogpushJobNewParamsFrequencyLow LogpushJobNewParamsFrequency = "low"
-)
-
-// The structured replacement for `logpull_options`. When including this field, the
-// `logpull_option` field will be ignored.
-type LogpushJobNewParamsOutputOptions struct {
- // String to be prepended before each batch.
- BatchPrefix param.Field[string] `json:"batch_prefix"`
- // String to be appended after each batch.
- BatchSuffix param.Field[string] `json:"batch_suffix"`
- // If set to true, will cause all occurrences of `${` in the generated files to be
- // replaced with `x{`.
- Cve2021_4428 param.Field[bool] `json:"CVE-2021-4428"`
- // String to join fields. This field be ignored when `record_template` is set.
- FieldDelimiter param.Field[string] `json:"field_delimiter"`
- // List of field names to be included in the Logpush output. For the moment, there
- // is no option to add all fields at once, so you must specify all the fields names
- // you are interested in.
- FieldNames param.Field[[]string] `json:"field_names"`
- // Specifies the output type, such as `ndjson` or `csv`. This sets default values
- // for the rest of the settings, depending on the chosen output type. Some
- // formatting rules, like string quoting, are different between output types.
- OutputType param.Field[LogpushJobNewParamsOutputOptionsOutputType] `json:"output_type"`
- // String to be inserted in-between the records as separator.
- RecordDelimiter param.Field[string] `json:"record_delimiter"`
- // String to be prepended before each record.
- RecordPrefix param.Field[string] `json:"record_prefix"`
- // String to be appended after each record.
- RecordSuffix param.Field[string] `json:"record_suffix"`
- // String to use as template for each record instead of the default comma-separated
- // list. All fields used in the template must be present in `field_names` as well,
- // otherwise they will end up as null. Format as a Go `text/template` without any
- // standard functions, like conditionals, loops, sub-templates, etc.
- RecordTemplate param.Field[string] `json:"record_template"`
- // Floating number to specify sampling rate. Sampling is applied on top of
- // filtering, and regardless of the current `sample_interval` of the data.
- SampleRate param.Field[float64] `json:"sample_rate"`
- // String to specify the format for timestamps, such as `unixnano`, `unix`, or
- // `rfc3339`.
- TimestampFormat param.Field[LogpushJobNewParamsOutputOptionsTimestampFormat] `json:"timestamp_format"`
-}
-
-func (r LogpushJobNewParamsOutputOptions) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Specifies the output type, such as `ndjson` or `csv`. This sets default values
-// for the rest of the settings, depending on the chosen output type. Some
-// formatting rules, like string quoting, are different between output types.
-type LogpushJobNewParamsOutputOptionsOutputType string
-
-const (
- LogpushJobNewParamsOutputOptionsOutputTypeNdjson LogpushJobNewParamsOutputOptionsOutputType = "ndjson"
- LogpushJobNewParamsOutputOptionsOutputTypeCsv LogpushJobNewParamsOutputOptionsOutputType = "csv"
-)
-
-// String to specify the format for timestamps, such as `unixnano`, `unix`, or
-// `rfc3339`.
-type LogpushJobNewParamsOutputOptionsTimestampFormat string
-
-const (
- LogpushJobNewParamsOutputOptionsTimestampFormatUnixnano LogpushJobNewParamsOutputOptionsTimestampFormat = "unixnano"
- LogpushJobNewParamsOutputOptionsTimestampFormatUnix LogpushJobNewParamsOutputOptionsTimestampFormat = "unix"
- LogpushJobNewParamsOutputOptionsTimestampFormatRfc3339 LogpushJobNewParamsOutputOptionsTimestampFormat = "rfc3339"
-)
-
-type LogpushJobNewResponseEnvelope struct {
- Errors []LogpushJobNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []LogpushJobNewResponseEnvelopeMessages `json:"messages,required"`
- Result LogpushJobNewResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success LogpushJobNewResponseEnvelopeSuccess `json:"success,required"`
- JSON logpushJobNewResponseEnvelopeJSON `json:"-"`
-}
-
-// logpushJobNewResponseEnvelopeJSON contains the JSON metadata for the struct
-// [LogpushJobNewResponseEnvelope]
-type logpushJobNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LogpushJobNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r logpushJobNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type LogpushJobNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON logpushJobNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// logpushJobNewResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [LogpushJobNewResponseEnvelopeErrors]
-type logpushJobNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LogpushJobNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r logpushJobNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type LogpushJobNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON logpushJobNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// logpushJobNewResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [LogpushJobNewResponseEnvelopeMessages]
-type logpushJobNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LogpushJobNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r logpushJobNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type LogpushJobNewResponseEnvelopeSuccess bool
-
-const (
- LogpushJobNewResponseEnvelopeSuccessTrue LogpushJobNewResponseEnvelopeSuccess = true
-)
-
-type LogpushJobUpdateParams struct {
- // The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
- AccountID param.Field[string] `path:"account_id"`
- // The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- ZoneID param.Field[string] `path:"zone_id"`
- // Uniquely identifies a resource (such as an s3 bucket) where data will be pushed.
- // Additional configuration parameters supported by the destination may be
- // included.
- DestinationConf param.Field[string] `json:"destination_conf" format:"uri"`
- // Flag that indicates if the job is enabled.
- Enabled param.Field[bool] `json:"enabled"`
- // The frequency at which Cloudflare sends batches of logs to your destination.
- // Setting frequency to high sends your logs in larger quantities of smaller files.
- // Setting frequency to low sends logs in smaller quantities of larger files.
- Frequency param.Field[LogpushJobUpdateParamsFrequency] `json:"frequency"`
- // This field is deprecated. Use `output_options` instead. Configuration string. It
- // specifies things like requested fields and timestamp formats. If migrating from
- // the logpull api, copy the url (full url or just the query string) of your call
- // here, and logpush will keep on making this call for you, setting start and end
- // times appropriately.
- LogpullOptions param.Field[string] `json:"logpull_options" format:"uri-reference"`
- // The structured replacement for `logpull_options`. When including this field, the
- // `logpull_option` field will be ignored.
- OutputOptions param.Field[LogpushJobUpdateParamsOutputOptions] `json:"output_options"`
- // Ownership challenge token to prove destination ownership.
- OwnershipChallenge param.Field[string] `json:"ownership_challenge"`
-}
-
-func (r LogpushJobUpdateParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The frequency at which Cloudflare sends batches of logs to your destination.
-// Setting frequency to high sends your logs in larger quantities of smaller files.
-// Setting frequency to low sends logs in smaller quantities of larger files.
-type LogpushJobUpdateParamsFrequency string
-
-const (
- LogpushJobUpdateParamsFrequencyHigh LogpushJobUpdateParamsFrequency = "high"
- LogpushJobUpdateParamsFrequencyLow LogpushJobUpdateParamsFrequency = "low"
-)
-
-// The structured replacement for `logpull_options`. When including this field, the
-// `logpull_option` field will be ignored.
-type LogpushJobUpdateParamsOutputOptions struct {
- // String to be prepended before each batch.
- BatchPrefix param.Field[string] `json:"batch_prefix"`
- // String to be appended after each batch.
- BatchSuffix param.Field[string] `json:"batch_suffix"`
- // If set to true, will cause all occurrences of `${` in the generated files to be
- // replaced with `x{`.
- Cve2021_4428 param.Field[bool] `json:"CVE-2021-4428"`
- // String to join fields. This field be ignored when `record_template` is set.
- FieldDelimiter param.Field[string] `json:"field_delimiter"`
- // List of field names to be included in the Logpush output. For the moment, there
- // is no option to add all fields at once, so you must specify all the fields names
- // you are interested in.
- FieldNames param.Field[[]string] `json:"field_names"`
- // Specifies the output type, such as `ndjson` or `csv`. This sets default values
- // for the rest of the settings, depending on the chosen output type. Some
- // formatting rules, like string quoting, are different between output types.
- OutputType param.Field[LogpushJobUpdateParamsOutputOptionsOutputType] `json:"output_type"`
- // String to be inserted in-between the records as separator.
- RecordDelimiter param.Field[string] `json:"record_delimiter"`
- // String to be prepended before each record.
- RecordPrefix param.Field[string] `json:"record_prefix"`
- // String to be appended after each record.
- RecordSuffix param.Field[string] `json:"record_suffix"`
- // String to use as template for each record instead of the default comma-separated
- // list. All fields used in the template must be present in `field_names` as well,
- // otherwise they will end up as null. Format as a Go `text/template` without any
- // standard functions, like conditionals, loops, sub-templates, etc.
- RecordTemplate param.Field[string] `json:"record_template"`
- // Floating number to specify sampling rate. Sampling is applied on top of
- // filtering, and regardless of the current `sample_interval` of the data.
- SampleRate param.Field[float64] `json:"sample_rate"`
- // String to specify the format for timestamps, such as `unixnano`, `unix`, or
- // `rfc3339`.
- TimestampFormat param.Field[LogpushJobUpdateParamsOutputOptionsTimestampFormat] `json:"timestamp_format"`
-}
-
-func (r LogpushJobUpdateParamsOutputOptions) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Specifies the output type, such as `ndjson` or `csv`. This sets default values
-// for the rest of the settings, depending on the chosen output type. Some
-// formatting rules, like string quoting, are different between output types.
-type LogpushJobUpdateParamsOutputOptionsOutputType string
-
-const (
- LogpushJobUpdateParamsOutputOptionsOutputTypeNdjson LogpushJobUpdateParamsOutputOptionsOutputType = "ndjson"
- LogpushJobUpdateParamsOutputOptionsOutputTypeCsv LogpushJobUpdateParamsOutputOptionsOutputType = "csv"
-)
-
-// String to specify the format for timestamps, such as `unixnano`, `unix`, or
-// `rfc3339`.
-type LogpushJobUpdateParamsOutputOptionsTimestampFormat string
-
-const (
- LogpushJobUpdateParamsOutputOptionsTimestampFormatUnixnano LogpushJobUpdateParamsOutputOptionsTimestampFormat = "unixnano"
- LogpushJobUpdateParamsOutputOptionsTimestampFormatUnix LogpushJobUpdateParamsOutputOptionsTimestampFormat = "unix"
- LogpushJobUpdateParamsOutputOptionsTimestampFormatRfc3339 LogpushJobUpdateParamsOutputOptionsTimestampFormat = "rfc3339"
-)
-
-type LogpushJobUpdateResponseEnvelope struct {
- Errors []LogpushJobUpdateResponseEnvelopeErrors `json:"errors,required"`
- Messages []LogpushJobUpdateResponseEnvelopeMessages `json:"messages,required"`
- Result LogpushJobUpdateResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success LogpushJobUpdateResponseEnvelopeSuccess `json:"success,required"`
- JSON logpushJobUpdateResponseEnvelopeJSON `json:"-"`
-}
-
-// logpushJobUpdateResponseEnvelopeJSON contains the JSON metadata for the struct
-// [LogpushJobUpdateResponseEnvelope]
-type logpushJobUpdateResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LogpushJobUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r logpushJobUpdateResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type LogpushJobUpdateResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON logpushJobUpdateResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// logpushJobUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [LogpushJobUpdateResponseEnvelopeErrors]
-type logpushJobUpdateResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LogpushJobUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r logpushJobUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type LogpushJobUpdateResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON logpushJobUpdateResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// logpushJobUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [LogpushJobUpdateResponseEnvelopeMessages]
-type logpushJobUpdateResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LogpushJobUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r logpushJobUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type LogpushJobUpdateResponseEnvelopeSuccess bool
-
-const (
- LogpushJobUpdateResponseEnvelopeSuccessTrue LogpushJobUpdateResponseEnvelopeSuccess = true
-)
-
-type LogpushJobListParams struct {
- // The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
- AccountID param.Field[string] `path:"account_id"`
- // The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- ZoneID param.Field[string] `path:"zone_id"`
-}
-
-type LogpushJobListResponseEnvelope struct {
- Errors []LogpushJobListResponseEnvelopeErrors `json:"errors,required"`
- Messages []LogpushJobListResponseEnvelopeMessages `json:"messages,required"`
- Result []LogpushJobListResponse `json:"result,required"`
- // Whether the API call was successful
- Success LogpushJobListResponseEnvelopeSuccess `json:"success,required"`
- JSON logpushJobListResponseEnvelopeJSON `json:"-"`
-}
-
-// logpushJobListResponseEnvelopeJSON contains the JSON metadata for the struct
-// [LogpushJobListResponseEnvelope]
-type logpushJobListResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LogpushJobListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r logpushJobListResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type LogpushJobListResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON logpushJobListResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// logpushJobListResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [LogpushJobListResponseEnvelopeErrors]
-type logpushJobListResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LogpushJobListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r logpushJobListResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type LogpushJobListResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON logpushJobListResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// logpushJobListResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [LogpushJobListResponseEnvelopeMessages]
-type logpushJobListResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LogpushJobListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r logpushJobListResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type LogpushJobListResponseEnvelopeSuccess bool
-
-const (
- LogpushJobListResponseEnvelopeSuccessTrue LogpushJobListResponseEnvelopeSuccess = true
-)
-
-type LogpushJobDeleteParams struct {
- // The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
- AccountID param.Field[string] `path:"account_id"`
- // The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- ZoneID param.Field[string] `path:"zone_id"`
-}
-
-type LogpushJobDeleteResponseEnvelope struct {
- Errors []LogpushJobDeleteResponseEnvelopeErrors `json:"errors,required"`
- Messages []LogpushJobDeleteResponseEnvelopeMessages `json:"messages,required"`
- Result LogpushJobDeleteResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success LogpushJobDeleteResponseEnvelopeSuccess `json:"success,required"`
- JSON logpushJobDeleteResponseEnvelopeJSON `json:"-"`
-}
-
-// logpushJobDeleteResponseEnvelopeJSON contains the JSON metadata for the struct
-// [LogpushJobDeleteResponseEnvelope]
-type logpushJobDeleteResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LogpushJobDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r logpushJobDeleteResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type LogpushJobDeleteResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON logpushJobDeleteResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// logpushJobDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [LogpushJobDeleteResponseEnvelopeErrors]
-type logpushJobDeleteResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LogpushJobDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r logpushJobDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type LogpushJobDeleteResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON logpushJobDeleteResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// logpushJobDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [LogpushJobDeleteResponseEnvelopeMessages]
-type logpushJobDeleteResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LogpushJobDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r logpushJobDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type LogpushJobDeleteResponseEnvelopeSuccess bool
-
-const (
- LogpushJobDeleteResponseEnvelopeSuccessTrue LogpushJobDeleteResponseEnvelopeSuccess = true
-)
-
-type LogpushJobGetParams struct {
- // The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
- AccountID param.Field[string] `path:"account_id"`
- // The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- ZoneID param.Field[string] `path:"zone_id"`
-}
-
-type LogpushJobGetResponseEnvelope struct {
- Errors []LogpushJobGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []LogpushJobGetResponseEnvelopeMessages `json:"messages,required"`
- Result LogpushJobGetResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success LogpushJobGetResponseEnvelopeSuccess `json:"success,required"`
- JSON logpushJobGetResponseEnvelopeJSON `json:"-"`
-}
-
-// logpushJobGetResponseEnvelopeJSON contains the JSON metadata for the struct
-// [LogpushJobGetResponseEnvelope]
-type logpushJobGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LogpushJobGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r logpushJobGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type LogpushJobGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON logpushJobGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// logpushJobGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [LogpushJobGetResponseEnvelopeErrors]
-type logpushJobGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LogpushJobGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r logpushJobGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type LogpushJobGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON logpushJobGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// logpushJobGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [LogpushJobGetResponseEnvelopeMessages]
-type logpushJobGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LogpushJobGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r logpushJobGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type LogpushJobGetResponseEnvelopeSuccess bool
-
-const (
- LogpushJobGetResponseEnvelopeSuccessTrue LogpushJobGetResponseEnvelopeSuccess = true
-)
diff --git a/logpushjob_test.go b/logpushjob_test.go
deleted file mode 100644
index ce060849299..00000000000
--- a/logpushjob_test.go
+++ /dev/null
@@ -1,201 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestLogpushJobNewWithOptionalParams(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"),
- )
- _, err := client.Logpush.Jobs.New(context.TODO(), cloudflare.LogpushJobNewParams{
- DestinationConf: cloudflare.F("s3://mybucket/logs?region=us-west-2"),
- AccountID: cloudflare.F("string"),
- ZoneID: cloudflare.F("string"),
- Dataset: cloudflare.F("http_requests"),
- Enabled: cloudflare.F(false),
- Frequency: cloudflare.F(cloudflare.LogpushJobNewParamsFrequencyHigh),
- LogpullOptions: cloudflare.F("fields=RayID,ClientIP,EdgeStartTimestamp×tamps=rfc3339"),
- Name: cloudflare.F("example.com"),
- OutputOptions: cloudflare.F(cloudflare.LogpushJobNewParamsOutputOptions{
- Cve2021_4428: cloudflare.F(true),
- BatchPrefix: cloudflare.F("string"),
- BatchSuffix: cloudflare.F("string"),
- FieldDelimiter: cloudflare.F("string"),
- FieldNames: cloudflare.F([]string{"ClientIP", "EdgeStartTimestamp", "RayID"}),
- OutputType: cloudflare.F(cloudflare.LogpushJobNewParamsOutputOptionsOutputTypeNdjson),
- RecordDelimiter: cloudflare.F("string"),
- RecordPrefix: cloudflare.F("string"),
- RecordSuffix: cloudflare.F("string"),
- RecordTemplate: cloudflare.F("string"),
- SampleRate: cloudflare.F(0.000000),
- TimestampFormat: cloudflare.F(cloudflare.LogpushJobNewParamsOutputOptionsTimestampFormatUnixnano),
- }),
- OwnershipChallenge: cloudflare.F("00000000000000000000"),
- })
- 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())
- }
-}
-
-func TestLogpushJobUpdateWithOptionalParams(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"),
- )
- _, err := client.Logpush.Jobs.Update(
- context.TODO(),
- int64(1),
- cloudflare.LogpushJobUpdateParams{
- AccountID: cloudflare.F("string"),
- ZoneID: cloudflare.F("string"),
- DestinationConf: cloudflare.F("s3://mybucket/logs?region=us-west-2"),
- Enabled: cloudflare.F(false),
- Frequency: cloudflare.F(cloudflare.LogpushJobUpdateParamsFrequencyHigh),
- LogpullOptions: cloudflare.F("fields=RayID,ClientIP,EdgeStartTimestamp×tamps=rfc3339"),
- OutputOptions: cloudflare.F(cloudflare.LogpushJobUpdateParamsOutputOptions{
- Cve2021_4428: cloudflare.F(true),
- BatchPrefix: cloudflare.F("string"),
- BatchSuffix: cloudflare.F("string"),
- FieldDelimiter: cloudflare.F("string"),
- FieldNames: cloudflare.F([]string{"ClientIP", "EdgeStartTimestamp", "RayID"}),
- OutputType: cloudflare.F(cloudflare.LogpushJobUpdateParamsOutputOptionsOutputTypeNdjson),
- RecordDelimiter: cloudflare.F("string"),
- RecordPrefix: cloudflare.F("string"),
- RecordSuffix: cloudflare.F("string"),
- RecordTemplate: cloudflare.F("string"),
- SampleRate: cloudflare.F(0.000000),
- TimestampFormat: cloudflare.F(cloudflare.LogpushJobUpdateParamsOutputOptionsTimestampFormatUnixnano),
- }),
- OwnershipChallenge: cloudflare.F("00000000000000000000"),
- },
- )
- 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())
- }
-}
-
-func TestLogpushJobListWithOptionalParams(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"),
- )
- _, err := client.Logpush.Jobs.List(context.TODO(), cloudflare.LogpushJobListParams{
- AccountID: cloudflare.F("string"),
- ZoneID: cloudflare.F("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())
- }
-}
-
-func TestLogpushJobDeleteWithOptionalParams(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"),
- )
- _, err := client.Logpush.Jobs.Delete(
- context.TODO(),
- int64(1),
- cloudflare.LogpushJobDeleteParams{
- AccountID: cloudflare.F("string"),
- ZoneID: cloudflare.F("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())
- }
-}
-
-func TestLogpushJobGetWithOptionalParams(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"),
- )
- _, err := client.Logpush.Jobs.Get(
- context.TODO(),
- int64(1),
- cloudflare.LogpushJobGetParams{
- AccountID: cloudflare.F("string"),
- ZoneID: cloudflare.F("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/logpushownership.go b/logpushownership.go
deleted file mode 100644
index d8ce46d7483..00000000000
--- a/logpushownership.go
+++ /dev/null
@@ -1,316 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// LogpushOwnershipService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewLogpushOwnershipService] method
-// instead.
-type LogpushOwnershipService struct {
- Options []option.RequestOption
-}
-
-// NewLogpushOwnershipService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewLogpushOwnershipService(opts ...option.RequestOption) (r *LogpushOwnershipService) {
- r = &LogpushOwnershipService{}
- r.Options = opts
- return
-}
-
-// Gets a new ownership challenge sent to your destination.
-func (r *LogpushOwnershipService) New(ctx context.Context, params LogpushOwnershipNewParams, opts ...option.RequestOption) (res *LogpushOwnershipNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env LogpushOwnershipNewResponseEnvelope
- var accountOrZone string
- var accountOrZoneID param.Field[string]
- if params.AccountID.Present {
- accountOrZone = "accounts"
- accountOrZoneID = params.AccountID
- } else {
- accountOrZone = "zones"
- accountOrZoneID = params.ZoneID
- }
- path := fmt.Sprintf("%s/%s/logpush/ownership", accountOrZone, accountOrZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Validates ownership challenge of the destination.
-func (r *LogpushOwnershipService) Validate(ctx context.Context, params LogpushOwnershipValidateParams, opts ...option.RequestOption) (res *LogpushOwnershipValidateResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env LogpushOwnershipValidateResponseEnvelope
- var accountOrZone string
- var accountOrZoneID param.Field[string]
- if params.AccountID.Present {
- accountOrZone = "accounts"
- accountOrZoneID = params.AccountID
- } else {
- accountOrZone = "zones"
- accountOrZoneID = params.ZoneID
- }
- path := fmt.Sprintf("%s/%s/logpush/ownership/validate", accountOrZone, accountOrZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type LogpushOwnershipNewResponse struct {
- Filename string `json:"filename"`
- Message string `json:"message"`
- Valid bool `json:"valid"`
- JSON logpushOwnershipNewResponseJSON `json:"-"`
-}
-
-// logpushOwnershipNewResponseJSON contains the JSON metadata for the struct
-// [LogpushOwnershipNewResponse]
-type logpushOwnershipNewResponseJSON struct {
- Filename apijson.Field
- Message apijson.Field
- Valid apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LogpushOwnershipNewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r logpushOwnershipNewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type LogpushOwnershipValidateResponse struct {
- Valid bool `json:"valid"`
- JSON logpushOwnershipValidateResponseJSON `json:"-"`
-}
-
-// logpushOwnershipValidateResponseJSON contains the JSON metadata for the struct
-// [LogpushOwnershipValidateResponse]
-type logpushOwnershipValidateResponseJSON struct {
- Valid apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LogpushOwnershipValidateResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r logpushOwnershipValidateResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type LogpushOwnershipNewParams struct {
- // Uniquely identifies a resource (such as an s3 bucket) where data will be pushed.
- // Additional configuration parameters supported by the destination may be
- // included.
- DestinationConf param.Field[string] `json:"destination_conf,required" format:"uri"`
- // The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
- AccountID param.Field[string] `path:"account_id"`
- // The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- ZoneID param.Field[string] `path:"zone_id"`
-}
-
-func (r LogpushOwnershipNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type LogpushOwnershipNewResponseEnvelope struct {
- Errors []LogpushOwnershipNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []LogpushOwnershipNewResponseEnvelopeMessages `json:"messages,required"`
- Result LogpushOwnershipNewResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success LogpushOwnershipNewResponseEnvelopeSuccess `json:"success,required"`
- JSON logpushOwnershipNewResponseEnvelopeJSON `json:"-"`
-}
-
-// logpushOwnershipNewResponseEnvelopeJSON contains the JSON metadata for the
-// struct [LogpushOwnershipNewResponseEnvelope]
-type logpushOwnershipNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LogpushOwnershipNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r logpushOwnershipNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type LogpushOwnershipNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON logpushOwnershipNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// logpushOwnershipNewResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [LogpushOwnershipNewResponseEnvelopeErrors]
-type logpushOwnershipNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LogpushOwnershipNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r logpushOwnershipNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type LogpushOwnershipNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON logpushOwnershipNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// logpushOwnershipNewResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [LogpushOwnershipNewResponseEnvelopeMessages]
-type logpushOwnershipNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LogpushOwnershipNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r logpushOwnershipNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type LogpushOwnershipNewResponseEnvelopeSuccess bool
-
-const (
- LogpushOwnershipNewResponseEnvelopeSuccessTrue LogpushOwnershipNewResponseEnvelopeSuccess = true
-)
-
-type LogpushOwnershipValidateParams struct {
- // Uniquely identifies a resource (such as an s3 bucket) where data will be pushed.
- // Additional configuration parameters supported by the destination may be
- // included.
- DestinationConf param.Field[string] `json:"destination_conf,required" format:"uri"`
- // Ownership challenge token to prove destination ownership.
- OwnershipChallenge param.Field[string] `json:"ownership_challenge,required"`
- // The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
- AccountID param.Field[string] `path:"account_id"`
- // The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- ZoneID param.Field[string] `path:"zone_id"`
-}
-
-func (r LogpushOwnershipValidateParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type LogpushOwnershipValidateResponseEnvelope struct {
- Errors []LogpushOwnershipValidateResponseEnvelopeErrors `json:"errors,required"`
- Messages []LogpushOwnershipValidateResponseEnvelopeMessages `json:"messages,required"`
- Result LogpushOwnershipValidateResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success LogpushOwnershipValidateResponseEnvelopeSuccess `json:"success,required"`
- JSON logpushOwnershipValidateResponseEnvelopeJSON `json:"-"`
-}
-
-// logpushOwnershipValidateResponseEnvelopeJSON contains the JSON metadata for the
-// struct [LogpushOwnershipValidateResponseEnvelope]
-type logpushOwnershipValidateResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LogpushOwnershipValidateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r logpushOwnershipValidateResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type LogpushOwnershipValidateResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON logpushOwnershipValidateResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// logpushOwnershipValidateResponseEnvelopeErrorsJSON contains the JSON metadata
-// for the struct [LogpushOwnershipValidateResponseEnvelopeErrors]
-type logpushOwnershipValidateResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LogpushOwnershipValidateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r logpushOwnershipValidateResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type LogpushOwnershipValidateResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON logpushOwnershipValidateResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// logpushOwnershipValidateResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [LogpushOwnershipValidateResponseEnvelopeMessages]
-type logpushOwnershipValidateResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LogpushOwnershipValidateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r logpushOwnershipValidateResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type LogpushOwnershipValidateResponseEnvelopeSuccess bool
-
-const (
- LogpushOwnershipValidateResponseEnvelopeSuccessTrue LogpushOwnershipValidateResponseEnvelopeSuccess = true
-)
diff --git a/logpushownership_test.go b/logpushownership_test.go
deleted file mode 100644
index 05ca2f9ff12..00000000000
--- a/logpushownership_test.go
+++ /dev/null
@@ -1,71 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestLogpushOwnershipNewWithOptionalParams(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"),
- )
- _, err := client.Logpush.Ownership.New(context.TODO(), cloudflare.LogpushOwnershipNewParams{
- DestinationConf: cloudflare.F("s3://mybucket/logs?region=us-west-2"),
- AccountID: cloudflare.F("string"),
- ZoneID: cloudflare.F("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())
- }
-}
-
-func TestLogpushOwnershipValidateWithOptionalParams(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"),
- )
- _, err := client.Logpush.Ownership.Validate(context.TODO(), cloudflare.LogpushOwnershipValidateParams{
- DestinationConf: cloudflare.F("s3://mybucket/logs?region=us-west-2"),
- OwnershipChallenge: cloudflare.F("00000000000000000000"),
- AccountID: cloudflare.F("string"),
- ZoneID: cloudflare.F("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/logpushvalidate.go b/logpushvalidate.go
deleted file mode 100644
index 2031d3f7201..00000000000
--- a/logpushvalidate.go
+++ /dev/null
@@ -1,314 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// LogpushValidateService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewLogpushValidateService] method
-// instead.
-type LogpushValidateService struct {
- Options []option.RequestOption
-}
-
-// NewLogpushValidateService generates a new service that applies the given options
-// to each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewLogpushValidateService(opts ...option.RequestOption) (r *LogpushValidateService) {
- r = &LogpushValidateService{}
- r.Options = opts
- return
-}
-
-// Checks if there is an existing job with a destination.
-func (r *LogpushValidateService) Destination(ctx context.Context, params LogpushValidateDestinationParams, opts ...option.RequestOption) (res *LogpushValidateDestinationResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env LogpushValidateDestinationResponseEnvelope
- var accountOrZone string
- var accountOrZoneID param.Field[string]
- if params.AccountID.Present {
- accountOrZone = "accounts"
- accountOrZoneID = params.AccountID
- } else {
- accountOrZone = "zones"
- accountOrZoneID = params.ZoneID
- }
- path := fmt.Sprintf("%s/%s/logpush/validate/destination/exists", accountOrZone, accountOrZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Validates logpull origin with logpull_options.
-func (r *LogpushValidateService) Origin(ctx context.Context, params LogpushValidateOriginParams, opts ...option.RequestOption) (res *LogpushValidateOriginResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env LogpushValidateOriginResponseEnvelope
- var accountOrZone string
- var accountOrZoneID param.Field[string]
- if params.AccountID.Present {
- accountOrZone = "accounts"
- accountOrZoneID = params.AccountID
- } else {
- accountOrZone = "zones"
- accountOrZoneID = params.ZoneID
- }
- path := fmt.Sprintf("%s/%s/logpush/validate/origin", accountOrZone, accountOrZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type LogpushValidateDestinationResponse struct {
- Exists bool `json:"exists"`
- JSON logpushValidateDestinationResponseJSON `json:"-"`
-}
-
-// logpushValidateDestinationResponseJSON contains the JSON metadata for the struct
-// [LogpushValidateDestinationResponse]
-type logpushValidateDestinationResponseJSON struct {
- Exists apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LogpushValidateDestinationResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r logpushValidateDestinationResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type LogpushValidateOriginResponse struct {
- Message string `json:"message"`
- Valid bool `json:"valid"`
- JSON logpushValidateOriginResponseJSON `json:"-"`
-}
-
-// logpushValidateOriginResponseJSON contains the JSON metadata for the struct
-// [LogpushValidateOriginResponse]
-type logpushValidateOriginResponseJSON struct {
- Message apijson.Field
- Valid apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LogpushValidateOriginResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r logpushValidateOriginResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type LogpushValidateDestinationParams struct {
- // Uniquely identifies a resource (such as an s3 bucket) where data will be pushed.
- // Additional configuration parameters supported by the destination may be
- // included.
- DestinationConf param.Field[string] `json:"destination_conf,required" format:"uri"`
- // The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
- AccountID param.Field[string] `path:"account_id"`
- // The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- ZoneID param.Field[string] `path:"zone_id"`
-}
-
-func (r LogpushValidateDestinationParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type LogpushValidateDestinationResponseEnvelope struct {
- Errors []LogpushValidateDestinationResponseEnvelopeErrors `json:"errors,required"`
- Messages []LogpushValidateDestinationResponseEnvelopeMessages `json:"messages,required"`
- Result LogpushValidateDestinationResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success LogpushValidateDestinationResponseEnvelopeSuccess `json:"success,required"`
- JSON logpushValidateDestinationResponseEnvelopeJSON `json:"-"`
-}
-
-// logpushValidateDestinationResponseEnvelopeJSON contains the JSON metadata for
-// the struct [LogpushValidateDestinationResponseEnvelope]
-type logpushValidateDestinationResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LogpushValidateDestinationResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r logpushValidateDestinationResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type LogpushValidateDestinationResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON logpushValidateDestinationResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// logpushValidateDestinationResponseEnvelopeErrorsJSON contains the JSON metadata
-// for the struct [LogpushValidateDestinationResponseEnvelopeErrors]
-type logpushValidateDestinationResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LogpushValidateDestinationResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r logpushValidateDestinationResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type LogpushValidateDestinationResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON logpushValidateDestinationResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// logpushValidateDestinationResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct [LogpushValidateDestinationResponseEnvelopeMessages]
-type logpushValidateDestinationResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LogpushValidateDestinationResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r logpushValidateDestinationResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type LogpushValidateDestinationResponseEnvelopeSuccess bool
-
-const (
- LogpushValidateDestinationResponseEnvelopeSuccessTrue LogpushValidateDestinationResponseEnvelopeSuccess = true
-)
-
-type LogpushValidateOriginParams struct {
- // This field is deprecated. Use `output_options` instead. Configuration string. It
- // specifies things like requested fields and timestamp formats. If migrating from
- // the logpull api, copy the url (full url or just the query string) of your call
- // here, and logpush will keep on making this call for you, setting start and end
- // times appropriately.
- LogpullOptions param.Field[string] `json:"logpull_options,required" format:"uri-reference"`
- // The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
- AccountID param.Field[string] `path:"account_id"`
- // The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- ZoneID param.Field[string] `path:"zone_id"`
-}
-
-func (r LogpushValidateOriginParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type LogpushValidateOriginResponseEnvelope struct {
- Errors []LogpushValidateOriginResponseEnvelopeErrors `json:"errors,required"`
- Messages []LogpushValidateOriginResponseEnvelopeMessages `json:"messages,required"`
- Result LogpushValidateOriginResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success LogpushValidateOriginResponseEnvelopeSuccess `json:"success,required"`
- JSON logpushValidateOriginResponseEnvelopeJSON `json:"-"`
-}
-
-// logpushValidateOriginResponseEnvelopeJSON contains the JSON metadata for the
-// struct [LogpushValidateOriginResponseEnvelope]
-type logpushValidateOriginResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LogpushValidateOriginResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r logpushValidateOriginResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type LogpushValidateOriginResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON logpushValidateOriginResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// logpushValidateOriginResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [LogpushValidateOriginResponseEnvelopeErrors]
-type logpushValidateOriginResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LogpushValidateOriginResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r logpushValidateOriginResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type LogpushValidateOriginResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON logpushValidateOriginResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// logpushValidateOriginResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [LogpushValidateOriginResponseEnvelopeMessages]
-type logpushValidateOriginResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LogpushValidateOriginResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r logpushValidateOriginResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type LogpushValidateOriginResponseEnvelopeSuccess bool
-
-const (
- LogpushValidateOriginResponseEnvelopeSuccessTrue LogpushValidateOriginResponseEnvelopeSuccess = true
-)
diff --git a/logpushvalidate_test.go b/logpushvalidate_test.go
deleted file mode 100644
index f236b99b201..00000000000
--- a/logpushvalidate_test.go
+++ /dev/null
@@ -1,70 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestLogpushValidateDestinationWithOptionalParams(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"),
- )
- _, err := client.Logpush.Validate.Destination(context.TODO(), cloudflare.LogpushValidateDestinationParams{
- DestinationConf: cloudflare.F("s3://mybucket/logs?region=us-west-2"),
- AccountID: cloudflare.F("string"),
- ZoneID: cloudflare.F("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())
- }
-}
-
-func TestLogpushValidateOriginWithOptionalParams(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"),
- )
- _, err := client.Logpush.Validate.Origin(context.TODO(), cloudflare.LogpushValidateOriginParams{
- LogpullOptions: cloudflare.F("fields=RayID,ClientIP,EdgeStartTimestamp×tamps=rfc3339"),
- AccountID: cloudflare.F("string"),
- ZoneID: cloudflare.F("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/lograyid.go b/lograyid.go
deleted file mode 100644
index 06d1bdfaf0c..00000000000
--- a/lograyid.go
+++ /dev/null
@@ -1,103 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
- "reflect"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/option"
- "github.com/tidwall/gjson"
-)
-
-// LogRayidService contains methods and other services that help with interacting
-// with the cloudflare API. Note, unlike clients, this service does not read
-// variables from the environment automatically. You should not instantiate this
-// service directly, and instead use the [NewLogRayidService] method instead.
-type LogRayidService struct {
- Options []option.RequestOption
-}
-
-// NewLogRayidService generates a new service that applies the given options to
-// each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewLogRayidService(opts ...option.RequestOption) (r *LogRayidService) {
- r = &LogRayidService{}
- r.Options = opts
- return
-}
-
-// The `/rayids` api route allows lookups by specific rayid. The rayids route will
-// return zero, one, or more records (ray ids are not unique).
-func (r *LogRayidService) Get(ctx context.Context, zoneIdentifier string, rayIdentifier string, query LogRayidGetParams, opts ...option.RequestOption) (res *LogRayidGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- path := fmt.Sprintf("zones/%s/logs/rayids/%s", zoneIdentifier, rayIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &res, opts...)
- return
-}
-
-// Union satisfied by [shared.UnionString] or [LogRayidGetResponseUnknown].
-type LogRayidGetResponse interface {
- ImplementsLogRayidGetResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*LogRayidGetResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-type LogRayidGetParams struct {
- // The `/received` route by default returns a limited set of fields, and allows
- // customers to override the default field set by specifying individual fields. The
- // reasons for this are: 1. Most customers require only a small subset of fields,
- // but that subset varies from customer to customer; 2. Flat schema is much easier
- // to work with downstream (importing into BigTable etc); 3. Performance (time to
- // process, file size). If `?fields=` is not specified, default field set is
- // returned. This default field set may change at any time. When `?fields=` is
- // provided, each record is returned with the specified fields. `fields` must be
- // specified as a comma separated list without any whitespaces, and all fields must
- // exist. The order in which fields are specified does not matter, and the order of
- // fields in the response is not specified.
- Fields param.Field[string] `query:"fields"`
- // By default, timestamps in responses are returned as Unix nanosecond integers.
- // The `?timestamps=` argument can be set to change the format in which response
- // timestamps are returned. Possible values are: `unix`, `unixnano`, `rfc3339`.
- // Note that `unix` and `unixnano` return timestamps as integers; `rfc3339` returns
- // timestamps as strings.
- Timestamps param.Field[LogRayidGetParamsTimestamps] `query:"timestamps"`
-}
-
-// URLQuery serializes [LogRayidGetParams]'s query parameters as `url.Values`.
-func (r LogRayidGetParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// By default, timestamps in responses are returned as Unix nanosecond integers.
-// The `?timestamps=` argument can be set to change the format in which response
-// timestamps are returned. Possible values are: `unix`, `unixnano`, `rfc3339`.
-// Note that `unix` and `unixnano` return timestamps as integers; `rfc3339` returns
-// timestamps as strings.
-type LogRayidGetParamsTimestamps string
-
-const (
- LogRayidGetParamsTimestampsUnix LogRayidGetParamsTimestamps = "unix"
- LogRayidGetParamsTimestampsUnixnano LogRayidGetParamsTimestamps = "unixnano"
- LogRayidGetParamsTimestampsRfc3339 LogRayidGetParamsTimestamps = "rfc3339"
-)
diff --git a/lograyid_test.go b/lograyid_test.go
deleted file mode 100644
index bf58bfda280..00000000000
--- a/lograyid_test.go
+++ /dev/null
@@ -1,46 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestLogRayidGetWithOptionalParams(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"),
- )
- _, err := client.Logs.Rayid.Get(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- "41ddf1740f67442d",
- cloudflare.LogRayidGetParams{
- Fields: cloudflare.F("ClientIP,RayID,EdgeStartTimestamp"),
- Timestamps: cloudflare.F(cloudflare.LogRayidGetParamsTimestampsUnixnano),
- },
- )
- 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/logreceived.go b/logreceived.go
deleted file mode 100644
index b7189a669d1..00000000000
--- a/logreceived.go
+++ /dev/null
@@ -1,157 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
- "reflect"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/option"
- "github.com/tidwall/gjson"
-)
-
-// LogReceivedService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewLogReceivedService] method
-// instead.
-type LogReceivedService struct {
- Options []option.RequestOption
- Fields *LogReceivedFieldService
-}
-
-// NewLogReceivedService generates a new service that applies the given options to
-// each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewLogReceivedService(opts ...option.RequestOption) (r *LogReceivedService) {
- r = &LogReceivedService{}
- r.Options = opts
- r.Fields = NewLogReceivedFieldService(opts...)
- return
-}
-
-// The `/received` api route allows customers to retrieve their edge HTTP logs. The
-// basic access pattern is "give me all the logs for zone Z for minute M", where
-// the minute M refers to the time records were received at Cloudflare's central
-// data center. `start` is inclusive, and `end` is exclusive. Because of that, to
-// get all data, at minutely cadence, starting at 10AM, the proper values are:
-// `start=2018-05-20T10:00:00Z&end=2018-05-20T10:01:00Z`, then
-// `start=2018-05-20T10:01:00Z&end=2018-05-20T10:02:00Z` and so on; the overlap
-// will be handled properly.
-func (r *LogReceivedService) Get(ctx context.Context, zoneIdentifier string, query LogReceivedGetParams, opts ...option.RequestOption) (res *LogReceivedGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- path := fmt.Sprintf("zones/%s/logs/received", zoneIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &res, opts...)
- return
-}
-
-// Union satisfied by [shared.UnionString] or [LogReceivedGetResponseUnknown].
-type LogReceivedGetResponse interface {
- ImplementsLogReceivedGetResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*LogReceivedGetResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-type LogReceivedGetParams struct {
- // Sets the (exclusive) end of the requested time frame. This can be a unix
- // timestamp (in seconds or nanoseconds), or an absolute timestamp that conforms to
- // RFC 3339. `end` must be at least five minutes earlier than now and must be later
- // than `start`. Difference between `start` and `end` must be not greater than one
- // hour.
- End param.Field[LogReceivedGetParamsEnd] `query:"end,required"`
- // When `?count=` is provided, the response will contain up to `count` results.
- // Since results are not sorted, you are likely to get different data for repeated
- // requests. `count` must be an integer > 0.
- Count param.Field[int64] `query:"count"`
- // The `/received` route by default returns a limited set of fields, and allows
- // customers to override the default field set by specifying individual fields. The
- // reasons for this are: 1. Most customers require only a small subset of fields,
- // but that subset varies from customer to customer; 2. Flat schema is much easier
- // to work with downstream (importing into BigTable etc); 3. Performance (time to
- // process, file size). If `?fields=` is not specified, default field set is
- // returned. This default field set may change at any time. When `?fields=` is
- // provided, each record is returned with the specified fields. `fields` must be
- // specified as a comma separated list without any whitespaces, and all fields must
- // exist. The order in which fields are specified does not matter, and the order of
- // fields in the response is not specified.
- Fields param.Field[string] `query:"fields"`
- // When `?sample=` is provided, a sample of matching records is returned. If
- // `sample=0.1` then 10% of records will be returned. Sampling is random: repeated
- // calls will not only return different records, but likely will also vary slightly
- // in number of returned records. When `?count=` is also specified, `count` is
- // applied to the number of returned records, not the sampled records. So, with
- // `sample=0.05` and `count=7`, when there is a total of 100 records available,
- // approximately five will be returned. When there are 1000 records, seven will be
- // returned. When there are 10,000 records, seven will be returned.
- Sample param.Field[float64] `query:"sample"`
- // Sets the (inclusive) beginning of the requested time frame. This can be a unix
- // timestamp (in seconds or nanoseconds), or an absolute timestamp that conforms to
- // RFC 3339. At this point in time, it cannot exceed a time in the past greater
- // than seven days.
- Start param.Field[LogReceivedGetParamsStart] `query:"start"`
- // By default, timestamps in responses are returned as Unix nanosecond integers.
- // The `?timestamps=` argument can be set to change the format in which response
- // timestamps are returned. Possible values are: `unix`, `unixnano`, `rfc3339`.
- // Note that `unix` and `unixnano` return timestamps as integers; `rfc3339` returns
- // timestamps as strings.
- Timestamps param.Field[LogReceivedGetParamsTimestamps] `query:"timestamps"`
-}
-
-// URLQuery serializes [LogReceivedGetParams]'s query parameters as `url.Values`.
-func (r LogReceivedGetParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Sets the (exclusive) end of the requested time frame. This can be a unix
-// timestamp (in seconds or nanoseconds), or an absolute timestamp that conforms to
-// RFC 3339. `end` must be at least five minutes earlier than now and must be later
-// than `start`. Difference between `start` and `end` must be not greater than one
-// hour.
-//
-// Satisfied by [shared.UnionString], [shared.UnionInt].
-type LogReceivedGetParamsEnd interface {
- ImplementsLogReceivedGetParamsEnd()
-}
-
-// Sets the (inclusive) beginning of the requested time frame. This can be a unix
-// timestamp (in seconds or nanoseconds), or an absolute timestamp that conforms to
-// RFC 3339. At this point in time, it cannot exceed a time in the past greater
-// than seven days.
-//
-// Satisfied by [shared.UnionString], [shared.UnionInt].
-type LogReceivedGetParamsStart interface {
- ImplementsLogReceivedGetParamsStart()
-}
-
-// By default, timestamps in responses are returned as Unix nanosecond integers.
-// The `?timestamps=` argument can be set to change the format in which response
-// timestamps are returned. Possible values are: `unix`, `unixnano`, `rfc3339`.
-// Note that `unix` and `unixnano` return timestamps as integers; `rfc3339` returns
-// timestamps as strings.
-type LogReceivedGetParamsTimestamps string
-
-const (
- LogReceivedGetParamsTimestampsUnix LogReceivedGetParamsTimestamps = "unix"
- LogReceivedGetParamsTimestampsUnixnano LogReceivedGetParamsTimestamps = "unixnano"
- LogReceivedGetParamsTimestampsRfc3339 LogReceivedGetParamsTimestamps = "rfc3339"
-)
diff --git a/logreceived_test.go b/logreceived_test.go
deleted file mode 100644
index 468a420f89f..00000000000
--- a/logreceived_test.go
+++ /dev/null
@@ -1,50 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestLogReceivedGetWithOptionalParams(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"),
- )
- _, err := client.Logs.Received.Get(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.LogReceivedGetParams{
- End: cloudflare.F[cloudflare.LogReceivedGetParamsEnd](shared.UnionString("2018-05-20T10:01:00Z")),
- Count: cloudflare.F(int64(1)),
- Fields: cloudflare.F("ClientIP,RayID,EdgeStartTimestamp"),
- Sample: cloudflare.F(0.100000),
- Start: cloudflare.F[cloudflare.LogReceivedGetParamsStart](shared.UnionString("2018-05-20T10:00:00Z")),
- Timestamps: cloudflare.F(cloudflare.LogReceivedGetParamsTimestampsUnixnano),
- },
- )
- 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/logreceivedfield.go b/logreceivedfield.go
deleted file mode 100644
index 139e1c85955..00000000000
--- a/logreceivedfield.go
+++ /dev/null
@@ -1,61 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// LogReceivedFieldService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewLogReceivedFieldService] method
-// instead.
-type LogReceivedFieldService struct {
- Options []option.RequestOption
-}
-
-// NewLogReceivedFieldService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewLogReceivedFieldService(opts ...option.RequestOption) (r *LogReceivedFieldService) {
- r = &LogReceivedFieldService{}
- r.Options = opts
- return
-}
-
-// Lists all fields available. The response is json object with key-value pairs,
-// where keys are field names, and values are descriptions.
-func (r *LogReceivedFieldService) Get(ctx context.Context, zoneIdentifier string, opts ...option.RequestOption) (res *LogReceivedFieldGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- path := fmt.Sprintf("zones/%s/logs/received/fields", zoneIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &res, opts...)
- return
-}
-
-type LogReceivedFieldGetResponse struct {
- Key string `json:"key"`
- JSON logReceivedFieldGetResponseJSON `json:"-"`
-}
-
-// logReceivedFieldGetResponseJSON contains the JSON metadata for the struct
-// [LogReceivedFieldGetResponse]
-type logReceivedFieldGetResponseJSON struct {
- Key apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *LogReceivedFieldGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r logReceivedFieldGetResponseJSON) RawJSON() string {
- return r.raw
-}
diff --git a/logreceivedfield_test.go b/logreceivedfield_test.go
deleted file mode 100644
index af048dcef1a..00000000000
--- a/logreceivedfield_test.go
+++ /dev/null
@@ -1,38 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestLogReceivedFieldGet(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"),
- )
- _, err := client.Logs.Received.Fields.Get(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353")
- 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/logs/aliases.go b/logs/aliases.go
new file mode 100644
index 00000000000..e89e5369627
--- /dev/null
+++ b/logs/aliases.go
@@ -0,0 +1,9 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package logs
+
+import (
+ "github.com/cloudflare/cloudflare-go/internal/apierror"
+)
+
+type Error = apierror.Error
diff --git a/logs/control.go b/logs/control.go
new file mode 100644
index 00000000000..b619a402658
--- /dev/null
+++ b/logs/control.go
@@ -0,0 +1,28 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package logs
+
+import (
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// ControlService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewControlService] method instead.
+type ControlService struct {
+ Options []option.RequestOption
+ Retention *ControlRetentionService
+ Cmb *ControlCmbService
+}
+
+// NewControlService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewControlService(opts ...option.RequestOption) (r *ControlService) {
+ r = &ControlService{}
+ r.Options = opts
+ r.Retention = NewControlRetentionService(opts...)
+ r.Cmb = NewControlCmbService(opts...)
+ return
+}
diff --git a/logs/controlcmb.go b/logs/controlcmb.go
new file mode 100644
index 00000000000..1e979de675c
--- /dev/null
+++ b/logs/controlcmb.go
@@ -0,0 +1,26 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package logs
+
+import (
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// ControlCmbService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewControlCmbService] method instead.
+type ControlCmbService struct {
+ Options []option.RequestOption
+ Config *ControlCmbConfigService
+}
+
+// NewControlCmbService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewControlCmbService(opts ...option.RequestOption) (r *ControlCmbService) {
+ r = &ControlCmbService{}
+ r.Options = opts
+ r.Config = NewControlCmbConfigService(opts...)
+ return
+}
diff --git a/logs/controlcmbconfig.go b/logs/controlcmbconfig.go
new file mode 100644
index 00000000000..1899e8b959f
--- /dev/null
+++ b/logs/controlcmbconfig.go
@@ -0,0 +1,385 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package logs
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "reflect"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/tidwall/gjson"
+)
+
+// ControlCmbConfigService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewControlCmbConfigService] method
+// instead.
+type ControlCmbConfigService struct {
+ Options []option.RequestOption
+}
+
+// NewControlCmbConfigService generates a new service that applies the given
+// options to each request. These options are applied after the parent client's
+// options (if there is one), and before any request-specific options.
+func NewControlCmbConfigService(opts ...option.RequestOption) (r *ControlCmbConfigService) {
+ r = &ControlCmbConfigService{}
+ r.Options = opts
+ return
+}
+
+// Updates CMB config.
+func (r *ControlCmbConfigService) New(ctx context.Context, params ControlCmbConfigNewParams, opts ...option.RequestOption) (res *LogcontrolCmbConfig, err error) {
+ opts = append(r.Options[:], opts...)
+ var env ControlCmbConfigNewResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/logs/control/cmb/config", params.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Deletes CMB config.
+func (r *ControlCmbConfigService) Delete(ctx context.Context, body ControlCmbConfigDeleteParams, opts ...option.RequestOption) (res *ControlCmbConfigDeleteResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env ControlCmbConfigDeleteResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/logs/control/cmb/config", body.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Gets CMB config.
+func (r *ControlCmbConfigService) Get(ctx context.Context, query ControlCmbConfigGetParams, opts ...option.RequestOption) (res *LogcontrolCmbConfig, err error) {
+ opts = append(r.Options[:], opts...)
+ var env ControlCmbConfigGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/logs/control/cmb/config", query.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type LogcontrolCmbConfig struct {
+ // Comma-separated list of regions.
+ Regions string `json:"regions"`
+ JSON logcontrolCmbConfigJSON `json:"-"`
+}
+
+// logcontrolCmbConfigJSON contains the JSON metadata for the struct
+// [LogcontrolCmbConfig]
+type logcontrolCmbConfigJSON struct {
+ Regions apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LogcontrolCmbConfig) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r logcontrolCmbConfigJSON) RawJSON() string {
+ return r.raw
+}
+
+// Union satisfied by [logs.ControlCmbConfigDeleteResponseUnknown],
+// [logs.ControlCmbConfigDeleteResponseArray] or [shared.UnionString].
+type ControlCmbConfigDeleteResponse interface {
+ ImplementsLogsControlCmbConfigDeleteResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*ControlCmbConfigDeleteResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(ControlCmbConfigDeleteResponseArray{}),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+type ControlCmbConfigDeleteResponseArray []interface{}
+
+func (r ControlCmbConfigDeleteResponseArray) ImplementsLogsControlCmbConfigDeleteResponse() {}
+
+type ControlCmbConfigNewParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ // Comma-separated list of regions.
+ Regions param.Field[string] `json:"regions"`
+}
+
+func (r ControlCmbConfigNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type ControlCmbConfigNewResponseEnvelope struct {
+ Errors []ControlCmbConfigNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []ControlCmbConfigNewResponseEnvelopeMessages `json:"messages,required"`
+ Result LogcontrolCmbConfig `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success ControlCmbConfigNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON controlCmbConfigNewResponseEnvelopeJSON `json:"-"`
+}
+
+// controlCmbConfigNewResponseEnvelopeJSON contains the JSON metadata for the
+// struct [ControlCmbConfigNewResponseEnvelope]
+type controlCmbConfigNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ControlCmbConfigNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r controlCmbConfigNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type ControlCmbConfigNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON controlCmbConfigNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// controlCmbConfigNewResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [ControlCmbConfigNewResponseEnvelopeErrors]
+type controlCmbConfigNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ControlCmbConfigNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r controlCmbConfigNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type ControlCmbConfigNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON controlCmbConfigNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// controlCmbConfigNewResponseEnvelopeMessagesJSON contains the JSON metadata for
+// the struct [ControlCmbConfigNewResponseEnvelopeMessages]
+type controlCmbConfigNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ControlCmbConfigNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r controlCmbConfigNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type ControlCmbConfigNewResponseEnvelopeSuccess bool
+
+const (
+ ControlCmbConfigNewResponseEnvelopeSuccessTrue ControlCmbConfigNewResponseEnvelopeSuccess = true
+)
+
+type ControlCmbConfigDeleteParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type ControlCmbConfigDeleteResponseEnvelope struct {
+ Errors []ControlCmbConfigDeleteResponseEnvelopeErrors `json:"errors,required"`
+ Messages []ControlCmbConfigDeleteResponseEnvelopeMessages `json:"messages,required"`
+ Result ControlCmbConfigDeleteResponse `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success ControlCmbConfigDeleteResponseEnvelopeSuccess `json:"success,required"`
+ JSON controlCmbConfigDeleteResponseEnvelopeJSON `json:"-"`
+}
+
+// controlCmbConfigDeleteResponseEnvelopeJSON contains the JSON metadata for the
+// struct [ControlCmbConfigDeleteResponseEnvelope]
+type controlCmbConfigDeleteResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ControlCmbConfigDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r controlCmbConfigDeleteResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type ControlCmbConfigDeleteResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON controlCmbConfigDeleteResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// controlCmbConfigDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for
+// the struct [ControlCmbConfigDeleteResponseEnvelopeErrors]
+type controlCmbConfigDeleteResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ControlCmbConfigDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r controlCmbConfigDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type ControlCmbConfigDeleteResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON controlCmbConfigDeleteResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// controlCmbConfigDeleteResponseEnvelopeMessagesJSON contains the JSON metadata
+// for the struct [ControlCmbConfigDeleteResponseEnvelopeMessages]
+type controlCmbConfigDeleteResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ControlCmbConfigDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r controlCmbConfigDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type ControlCmbConfigDeleteResponseEnvelopeSuccess bool
+
+const (
+ ControlCmbConfigDeleteResponseEnvelopeSuccessTrue ControlCmbConfigDeleteResponseEnvelopeSuccess = true
+)
+
+type ControlCmbConfigGetParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type ControlCmbConfigGetResponseEnvelope struct {
+ Errors []ControlCmbConfigGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []ControlCmbConfigGetResponseEnvelopeMessages `json:"messages,required"`
+ Result LogcontrolCmbConfig `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success ControlCmbConfigGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON controlCmbConfigGetResponseEnvelopeJSON `json:"-"`
+}
+
+// controlCmbConfigGetResponseEnvelopeJSON contains the JSON metadata for the
+// struct [ControlCmbConfigGetResponseEnvelope]
+type controlCmbConfigGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ControlCmbConfigGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r controlCmbConfigGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type ControlCmbConfigGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON controlCmbConfigGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// controlCmbConfigGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [ControlCmbConfigGetResponseEnvelopeErrors]
+type controlCmbConfigGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ControlCmbConfigGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r controlCmbConfigGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type ControlCmbConfigGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON controlCmbConfigGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// controlCmbConfigGetResponseEnvelopeMessagesJSON contains the JSON metadata for
+// the struct [ControlCmbConfigGetResponseEnvelopeMessages]
+type controlCmbConfigGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ControlCmbConfigGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r controlCmbConfigGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type ControlCmbConfigGetResponseEnvelopeSuccess bool
+
+const (
+ ControlCmbConfigGetResponseEnvelopeSuccessTrue ControlCmbConfigGetResponseEnvelopeSuccess = true
+)
diff --git a/logs/controlcmbconfig_test.go b/logs/controlcmbconfig_test.go
new file mode 100644
index 00000000000..5174fbcf9b9
--- /dev/null
+++ b/logs/controlcmbconfig_test.go
@@ -0,0 +1,94 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package logs_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/logs"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestControlCmbConfigNewWithOptionalParams(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"),
+ )
+ _, err := client.Logs.Control.Cmb.Config.New(context.TODO(), logs.ControlCmbConfigNewParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Regions: cloudflare.F("eu"),
+ })
+ 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())
+ }
+}
+
+func TestControlCmbConfigDelete(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"),
+ )
+ _, err := client.Logs.Control.Cmb.Config.Delete(context.TODO(), logs.ControlCmbConfigDeleteParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ })
+ 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())
+ }
+}
+
+func TestControlCmbConfigGet(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"),
+ )
+ _, err := client.Logs.Control.Cmb.Config.Get(context.TODO(), logs.ControlCmbConfigGetParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ })
+ 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/logs/controlretention.go b/logs/controlretention.go
new file mode 100644
index 00000000000..47cdeaa107d
--- /dev/null
+++ b/logs/controlretention.go
@@ -0,0 +1,27 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package logs
+
+import (
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// ControlRetentionService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewControlRetentionService] method
+// instead.
+type ControlRetentionService struct {
+ Options []option.RequestOption
+ Flag *ControlRetentionFlagService
+}
+
+// NewControlRetentionService generates a new service that applies the given
+// options to each request. These options are applied after the parent client's
+// options (if there is one), and before any request-specific options.
+func NewControlRetentionService(opts ...option.RequestOption) (r *ControlRetentionService) {
+ r = &ControlRetentionService{}
+ r.Options = opts
+ r.Flag = NewControlRetentionFlagService(opts...)
+ return
+}
diff --git a/logs/controlretentionflag.go b/logs/controlretentionflag.go
new file mode 100644
index 00000000000..6b805b5f640
--- /dev/null
+++ b/logs/controlretentionflag.go
@@ -0,0 +1,271 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package logs
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// ControlRetentionFlagService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewControlRetentionFlagService]
+// method instead.
+type ControlRetentionFlagService struct {
+ Options []option.RequestOption
+}
+
+// NewControlRetentionFlagService generates a new service that applies the given
+// options to each request. These options are applied after the parent client's
+// options (if there is one), and before any request-specific options.
+func NewControlRetentionFlagService(opts ...option.RequestOption) (r *ControlRetentionFlagService) {
+ r = &ControlRetentionFlagService{}
+ r.Options = opts
+ return
+}
+
+// Updates log retention flag for Logpull API.
+func (r *ControlRetentionFlagService) New(ctx context.Context, zoneIdentifier string, body ControlRetentionFlagNewParams, opts ...option.RequestOption) (res *ControlRetentionFlagNewResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env ControlRetentionFlagNewResponseEnvelope
+ path := fmt.Sprintf("zones/%s/logs/control/retention/flag", zoneIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Gets log retention flag for Logpull API.
+func (r *ControlRetentionFlagService) Get(ctx context.Context, zoneIdentifier string, opts ...option.RequestOption) (res *ControlRetentionFlagGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env ControlRetentionFlagGetResponseEnvelope
+ path := fmt.Sprintf("zones/%s/logs/control/retention/flag", zoneIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type ControlRetentionFlagNewResponse struct {
+ Flag bool `json:"flag"`
+ JSON controlRetentionFlagNewResponseJSON `json:"-"`
+}
+
+// controlRetentionFlagNewResponseJSON contains the JSON metadata for the struct
+// [ControlRetentionFlagNewResponse]
+type controlRetentionFlagNewResponseJSON struct {
+ Flag apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ControlRetentionFlagNewResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r controlRetentionFlagNewResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type ControlRetentionFlagGetResponse struct {
+ Flag bool `json:"flag"`
+ JSON controlRetentionFlagGetResponseJSON `json:"-"`
+}
+
+// controlRetentionFlagGetResponseJSON contains the JSON metadata for the struct
+// [ControlRetentionFlagGetResponse]
+type controlRetentionFlagGetResponseJSON struct {
+ Flag apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ControlRetentionFlagGetResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r controlRetentionFlagGetResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type ControlRetentionFlagNewParams struct {
+ // The log retention flag for Logpull API.
+ Flag param.Field[bool] `json:"flag,required"`
+}
+
+func (r ControlRetentionFlagNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type ControlRetentionFlagNewResponseEnvelope struct {
+ Errors []ControlRetentionFlagNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []ControlRetentionFlagNewResponseEnvelopeMessages `json:"messages,required"`
+ Result ControlRetentionFlagNewResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success ControlRetentionFlagNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON controlRetentionFlagNewResponseEnvelopeJSON `json:"-"`
+}
+
+// controlRetentionFlagNewResponseEnvelopeJSON contains the JSON metadata for the
+// struct [ControlRetentionFlagNewResponseEnvelope]
+type controlRetentionFlagNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ControlRetentionFlagNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r controlRetentionFlagNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type ControlRetentionFlagNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON controlRetentionFlagNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// controlRetentionFlagNewResponseEnvelopeErrorsJSON contains the JSON metadata for
+// the struct [ControlRetentionFlagNewResponseEnvelopeErrors]
+type controlRetentionFlagNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ControlRetentionFlagNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r controlRetentionFlagNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type ControlRetentionFlagNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON controlRetentionFlagNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// controlRetentionFlagNewResponseEnvelopeMessagesJSON contains the JSON metadata
+// for the struct [ControlRetentionFlagNewResponseEnvelopeMessages]
+type controlRetentionFlagNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ControlRetentionFlagNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r controlRetentionFlagNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type ControlRetentionFlagNewResponseEnvelopeSuccess bool
+
+const (
+ ControlRetentionFlagNewResponseEnvelopeSuccessTrue ControlRetentionFlagNewResponseEnvelopeSuccess = true
+)
+
+type ControlRetentionFlagGetResponseEnvelope struct {
+ Errors []ControlRetentionFlagGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []ControlRetentionFlagGetResponseEnvelopeMessages `json:"messages,required"`
+ Result ControlRetentionFlagGetResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success ControlRetentionFlagGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON controlRetentionFlagGetResponseEnvelopeJSON `json:"-"`
+}
+
+// controlRetentionFlagGetResponseEnvelopeJSON contains the JSON metadata for the
+// struct [ControlRetentionFlagGetResponseEnvelope]
+type controlRetentionFlagGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ControlRetentionFlagGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r controlRetentionFlagGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type ControlRetentionFlagGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON controlRetentionFlagGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// controlRetentionFlagGetResponseEnvelopeErrorsJSON contains the JSON metadata for
+// the struct [ControlRetentionFlagGetResponseEnvelopeErrors]
+type controlRetentionFlagGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ControlRetentionFlagGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r controlRetentionFlagGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type ControlRetentionFlagGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON controlRetentionFlagGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// controlRetentionFlagGetResponseEnvelopeMessagesJSON contains the JSON metadata
+// for the struct [ControlRetentionFlagGetResponseEnvelopeMessages]
+type controlRetentionFlagGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ControlRetentionFlagGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r controlRetentionFlagGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type ControlRetentionFlagGetResponseEnvelopeSuccess bool
+
+const (
+ ControlRetentionFlagGetResponseEnvelopeSuccessTrue ControlRetentionFlagGetResponseEnvelopeSuccess = true
+)
diff --git a/logs/controlretentionflag_test.go b/logs/controlretentionflag_test.go
new file mode 100644
index 00000000000..fa26ad3583f
--- /dev/null
+++ b/logs/controlretentionflag_test.go
@@ -0,0 +1,69 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package logs_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/logs"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestControlRetentionFlagNew(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"),
+ )
+ _, err := client.Logs.Control.Retention.Flag.New(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ logs.ControlRetentionFlagNewParams{
+ Flag: cloudflare.F(true),
+ },
+ )
+ 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())
+ }
+}
+
+func TestControlRetentionFlagGet(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"),
+ )
+ _, err := client.Logs.Control.Retention.Flag.Get(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353")
+ 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/log.go b/logs/log.go
similarity index 77%
rename from log.go
rename to logs/log.go
index 21a6c9732a6..d45cc915bfd 100644
--- a/log.go
+++ b/logs/log.go
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package cloudflare
+package logs
import (
"github.com/cloudflare/cloudflare-go/option"
@@ -12,9 +12,9 @@ import (
// directly, and instead use the [NewLogService] method instead.
type LogService struct {
Options []option.RequestOption
- Control *LogControlService
- Rayid *LogRayidService
- Received *LogReceivedService
+ Control *ControlService
+ Rayid *RayidService
+ Received *ReceivedService
}
// NewLogService generates a new service that applies the given options to each
@@ -23,8 +23,8 @@ type LogService struct {
func NewLogService(opts ...option.RequestOption) (r *LogService) {
r = &LogService{}
r.Options = opts
- r.Control = NewLogControlService(opts...)
- r.Rayid = NewLogRayidService(opts...)
- r.Received = NewLogReceivedService(opts...)
+ r.Control = NewControlService(opts...)
+ r.Rayid = NewRayidService(opts...)
+ r.Received = NewReceivedService(opts...)
return
}
diff --git a/logs/rayid.go b/logs/rayid.go
new file mode 100644
index 00000000000..25de94e3cb7
--- /dev/null
+++ b/logs/rayid.go
@@ -0,0 +1,103 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package logs
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+ "reflect"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/tidwall/gjson"
+)
+
+// RayidService contains methods and other services that help with interacting with
+// the cloudflare API. Note, unlike clients, this service does not read variables
+// from the environment automatically. You should not instantiate this service
+// directly, and instead use the [NewRayidService] method instead.
+type RayidService struct {
+ Options []option.RequestOption
+}
+
+// NewRayidService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewRayidService(opts ...option.RequestOption) (r *RayidService) {
+ r = &RayidService{}
+ r.Options = opts
+ return
+}
+
+// The `/rayids` api route allows lookups by specific rayid. The rayids route will
+// return zero, one, or more records (ray ids are not unique).
+func (r *RayidService) Get(ctx context.Context, zoneIdentifier string, rayIdentifier string, query RayidGetParams, opts ...option.RequestOption) (res *RayidGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ path := fmt.Sprintf("zones/%s/logs/rayids/%s", zoneIdentifier, rayIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &res, opts...)
+ return
+}
+
+// Union satisfied by [shared.UnionString] or [logs.RayidGetResponseUnknown].
+type RayidGetResponse interface {
+ ImplementsLogsRayidGetResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RayidGetResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+type RayidGetParams struct {
+ // The `/received` route by default returns a limited set of fields, and allows
+ // customers to override the default field set by specifying individual fields. The
+ // reasons for this are: 1. Most customers require only a small subset of fields,
+ // but that subset varies from customer to customer; 2. Flat schema is much easier
+ // to work with downstream (importing into BigTable etc); 3. Performance (time to
+ // process, file size). If `?fields=` is not specified, default field set is
+ // returned. This default field set may change at any time. When `?fields=` is
+ // provided, each record is returned with the specified fields. `fields` must be
+ // specified as a comma separated list without any whitespaces, and all fields must
+ // exist. The order in which fields are specified does not matter, and the order of
+ // fields in the response is not specified.
+ Fields param.Field[string] `query:"fields"`
+ // By default, timestamps in responses are returned as Unix nanosecond integers.
+ // The `?timestamps=` argument can be set to change the format in which response
+ // timestamps are returned. Possible values are: `unix`, `unixnano`, `rfc3339`.
+ // Note that `unix` and `unixnano` return timestamps as integers; `rfc3339` returns
+ // timestamps as strings.
+ Timestamps param.Field[RayidGetParamsTimestamps] `query:"timestamps"`
+}
+
+// URLQuery serializes [RayidGetParams]'s query parameters as `url.Values`.
+func (r RayidGetParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// By default, timestamps in responses are returned as Unix nanosecond integers.
+// The `?timestamps=` argument can be set to change the format in which response
+// timestamps are returned. Possible values are: `unix`, `unixnano`, `rfc3339`.
+// Note that `unix` and `unixnano` return timestamps as integers; `rfc3339` returns
+// timestamps as strings.
+type RayidGetParamsTimestamps string
+
+const (
+ RayidGetParamsTimestampsUnix RayidGetParamsTimestamps = "unix"
+ RayidGetParamsTimestampsUnixnano RayidGetParamsTimestamps = "unixnano"
+ RayidGetParamsTimestampsRfc3339 RayidGetParamsTimestamps = "rfc3339"
+)
diff --git a/logs/rayid_test.go b/logs/rayid_test.go
new file mode 100644
index 00000000000..4a1c0d531a0
--- /dev/null
+++ b/logs/rayid_test.go
@@ -0,0 +1,47 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package logs_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/logs"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestRayidGetWithOptionalParams(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"),
+ )
+ _, err := client.Logs.Rayid.Get(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ "41ddf1740f67442d",
+ logs.RayidGetParams{
+ Fields: cloudflare.F("ClientIP,RayID,EdgeStartTimestamp"),
+ Timestamps: cloudflare.F(logs.RayidGetParamsTimestampsUnixnano),
+ },
+ )
+ 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/logs/received.go b/logs/received.go
new file mode 100644
index 00000000000..daaa434826d
--- /dev/null
+++ b/logs/received.go
@@ -0,0 +1,156 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package logs
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+ "reflect"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/tidwall/gjson"
+)
+
+// ReceivedService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewReceivedService] method instead.
+type ReceivedService struct {
+ Options []option.RequestOption
+ Fields *ReceivedFieldService
+}
+
+// NewReceivedService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewReceivedService(opts ...option.RequestOption) (r *ReceivedService) {
+ r = &ReceivedService{}
+ r.Options = opts
+ r.Fields = NewReceivedFieldService(opts...)
+ return
+}
+
+// The `/received` api route allows customers to retrieve their edge HTTP logs. The
+// basic access pattern is "give me all the logs for zone Z for minute M", where
+// the minute M refers to the time records were received at Cloudflare's central
+// data center. `start` is inclusive, and `end` is exclusive. Because of that, to
+// get all data, at minutely cadence, starting at 10AM, the proper values are:
+// `start=2018-05-20T10:00:00Z&end=2018-05-20T10:01:00Z`, then
+// `start=2018-05-20T10:01:00Z&end=2018-05-20T10:02:00Z` and so on; the overlap
+// will be handled properly.
+func (r *ReceivedService) Get(ctx context.Context, zoneIdentifier string, query ReceivedGetParams, opts ...option.RequestOption) (res *ReceivedGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ path := fmt.Sprintf("zones/%s/logs/received", zoneIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &res, opts...)
+ return
+}
+
+// Union satisfied by [shared.UnionString] or [logs.ReceivedGetResponseUnknown].
+type ReceivedGetResponse interface {
+ ImplementsLogsReceivedGetResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*ReceivedGetResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+type ReceivedGetParams struct {
+ // Sets the (exclusive) end of the requested time frame. This can be a unix
+ // timestamp (in seconds or nanoseconds), or an absolute timestamp that conforms to
+ // RFC 3339. `end` must be at least five minutes earlier than now and must be later
+ // than `start`. Difference between `start` and `end` must be not greater than one
+ // hour.
+ End param.Field[ReceivedGetParamsEnd] `query:"end,required"`
+ // When `?count=` is provided, the response will contain up to `count` results.
+ // Since results are not sorted, you are likely to get different data for repeated
+ // requests. `count` must be an integer > 0.
+ Count param.Field[int64] `query:"count"`
+ // The `/received` route by default returns a limited set of fields, and allows
+ // customers to override the default field set by specifying individual fields. The
+ // reasons for this are: 1. Most customers require only a small subset of fields,
+ // but that subset varies from customer to customer; 2. Flat schema is much easier
+ // to work with downstream (importing into BigTable etc); 3. Performance (time to
+ // process, file size). If `?fields=` is not specified, default field set is
+ // returned. This default field set may change at any time. When `?fields=` is
+ // provided, each record is returned with the specified fields. `fields` must be
+ // specified as a comma separated list without any whitespaces, and all fields must
+ // exist. The order in which fields are specified does not matter, and the order of
+ // fields in the response is not specified.
+ Fields param.Field[string] `query:"fields"`
+ // When `?sample=` is provided, a sample of matching records is returned. If
+ // `sample=0.1` then 10% of records will be returned. Sampling is random: repeated
+ // calls will not only return different records, but likely will also vary slightly
+ // in number of returned records. When `?count=` is also specified, `count` is
+ // applied to the number of returned records, not the sampled records. So, with
+ // `sample=0.05` and `count=7`, when there is a total of 100 records available,
+ // approximately five will be returned. When there are 1000 records, seven will be
+ // returned. When there are 10,000 records, seven will be returned.
+ Sample param.Field[float64] `query:"sample"`
+ // Sets the (inclusive) beginning of the requested time frame. This can be a unix
+ // timestamp (in seconds or nanoseconds), or an absolute timestamp that conforms to
+ // RFC 3339. At this point in time, it cannot exceed a time in the past greater
+ // than seven days.
+ Start param.Field[ReceivedGetParamsStart] `query:"start"`
+ // By default, timestamps in responses are returned as Unix nanosecond integers.
+ // The `?timestamps=` argument can be set to change the format in which response
+ // timestamps are returned. Possible values are: `unix`, `unixnano`, `rfc3339`.
+ // Note that `unix` and `unixnano` return timestamps as integers; `rfc3339` returns
+ // timestamps as strings.
+ Timestamps param.Field[ReceivedGetParamsTimestamps] `query:"timestamps"`
+}
+
+// URLQuery serializes [ReceivedGetParams]'s query parameters as `url.Values`.
+func (r ReceivedGetParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Sets the (exclusive) end of the requested time frame. This can be a unix
+// timestamp (in seconds or nanoseconds), or an absolute timestamp that conforms to
+// RFC 3339. `end` must be at least five minutes earlier than now and must be later
+// than `start`. Difference between `start` and `end` must be not greater than one
+// hour.
+//
+// Satisfied by [shared.UnionString], [shared.UnionInt].
+type ReceivedGetParamsEnd interface {
+ ImplementsLogsReceivedGetParamsEnd()
+}
+
+// Sets the (inclusive) beginning of the requested time frame. This can be a unix
+// timestamp (in seconds or nanoseconds), or an absolute timestamp that conforms to
+// RFC 3339. At this point in time, it cannot exceed a time in the past greater
+// than seven days.
+//
+// Satisfied by [shared.UnionString], [shared.UnionInt].
+type ReceivedGetParamsStart interface {
+ ImplementsLogsReceivedGetParamsStart()
+}
+
+// By default, timestamps in responses are returned as Unix nanosecond integers.
+// The `?timestamps=` argument can be set to change the format in which response
+// timestamps are returned. Possible values are: `unix`, `unixnano`, `rfc3339`.
+// Note that `unix` and `unixnano` return timestamps as integers; `rfc3339` returns
+// timestamps as strings.
+type ReceivedGetParamsTimestamps string
+
+const (
+ ReceivedGetParamsTimestampsUnix ReceivedGetParamsTimestamps = "unix"
+ ReceivedGetParamsTimestampsUnixnano ReceivedGetParamsTimestamps = "unixnano"
+ ReceivedGetParamsTimestampsRfc3339 ReceivedGetParamsTimestamps = "rfc3339"
+)
diff --git a/logs/received_test.go b/logs/received_test.go
new file mode 100644
index 00000000000..17099206c62
--- /dev/null
+++ b/logs/received_test.go
@@ -0,0 +1,51 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package logs_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/logs"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestReceivedGetWithOptionalParams(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"),
+ )
+ _, err := client.Logs.Received.Get(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ logs.ReceivedGetParams{
+ End: cloudflare.F[logs.ReceivedGetParamsEnd](shared.UnionString("2018-05-20T10:01:00Z")),
+ Count: cloudflare.F(int64(1)),
+ Fields: cloudflare.F("ClientIP,RayID,EdgeStartTimestamp"),
+ Sample: cloudflare.F(0.100000),
+ Start: cloudflare.F[logs.ReceivedGetParamsStart](shared.UnionString("2018-05-20T10:00:00Z")),
+ Timestamps: cloudflare.F(logs.ReceivedGetParamsTimestampsUnixnano),
+ },
+ )
+ 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/logs/receivedfield.go b/logs/receivedfield.go
new file mode 100644
index 00000000000..e2932de1fc4
--- /dev/null
+++ b/logs/receivedfield.go
@@ -0,0 +1,61 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package logs
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// ReceivedFieldService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewReceivedFieldService] method
+// instead.
+type ReceivedFieldService struct {
+ Options []option.RequestOption
+}
+
+// NewReceivedFieldService generates a new service that applies the given options
+// to each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewReceivedFieldService(opts ...option.RequestOption) (r *ReceivedFieldService) {
+ r = &ReceivedFieldService{}
+ r.Options = opts
+ return
+}
+
+// Lists all fields available. The response is json object with key-value pairs,
+// where keys are field names, and values are descriptions.
+func (r *ReceivedFieldService) Get(ctx context.Context, zoneIdentifier string, opts ...option.RequestOption) (res *ReceivedFieldGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ path := fmt.Sprintf("zones/%s/logs/received/fields", zoneIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &res, opts...)
+ return
+}
+
+type ReceivedFieldGetResponse struct {
+ Key string `json:"key"`
+ JSON receivedFieldGetResponseJSON `json:"-"`
+}
+
+// receivedFieldGetResponseJSON contains the JSON metadata for the struct
+// [ReceivedFieldGetResponse]
+type receivedFieldGetResponseJSON struct {
+ Key apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ReceivedFieldGetResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r receivedFieldGetResponseJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/logs/receivedfield_test.go b/logs/receivedfield_test.go
new file mode 100644
index 00000000000..67099c56940
--- /dev/null
+++ b/logs/receivedfield_test.go
@@ -0,0 +1,38 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package logs_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestReceivedFieldGet(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"),
+ )
+ _, err := client.Logs.Received.Fields.Get(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353")
+ 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/magic_network_monitoring/aliases.go b/magic_network_monitoring/aliases.go
new file mode 100644
index 00000000000..96acec95921
--- /dev/null
+++ b/magic_network_monitoring/aliases.go
@@ -0,0 +1,9 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package magic_network_monitoring
+
+import (
+ "github.com/cloudflare/cloudflare-go/internal/apierror"
+)
+
+type Error = apierror.Error
diff --git a/magic_network_monitoring/config.go b/magic_network_monitoring/config.go
new file mode 100644
index 00000000000..c2ee1f15bb3
--- /dev/null
+++ b/magic_network_monitoring/config.go
@@ -0,0 +1,531 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package magic_network_monitoring
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// ConfigService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewConfigService] method instead.
+type ConfigService struct {
+ Options []option.RequestOption
+ Full *ConfigFullService
+}
+
+// NewConfigService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewConfigService(opts ...option.RequestOption) (r *ConfigService) {
+ r = &ConfigService{}
+ r.Options = opts
+ r.Full = NewConfigFullService(opts...)
+ return
+}
+
+// Create a new network monitoring configuration.
+func (r *ConfigService) New(ctx context.Context, accountIdentifier interface{}, opts ...option.RequestOption) (res *MagicVisibilityMNMConfig, err error) {
+ opts = append(r.Options[:], opts...)
+ var env ConfigNewResponseEnvelope
+ path := fmt.Sprintf("accounts/%v/mnm/config", accountIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Update an existing network monitoring configuration, requires the entire
+// configuration to be updated at once.
+func (r *ConfigService) Update(ctx context.Context, accountIdentifier interface{}, opts ...option.RequestOption) (res *MagicVisibilityMNMConfig, err error) {
+ opts = append(r.Options[:], opts...)
+ var env ConfigUpdateResponseEnvelope
+ path := fmt.Sprintf("accounts/%v/mnm/config", accountIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, nil, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Delete an existing network monitoring configuration.
+func (r *ConfigService) Delete(ctx context.Context, accountIdentifier interface{}, opts ...option.RequestOption) (res *MagicVisibilityMNMConfig, err error) {
+ opts = append(r.Options[:], opts...)
+ var env ConfigDeleteResponseEnvelope
+ path := fmt.Sprintf("accounts/%v/mnm/config", accountIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Update fields in an existing network monitoring configuration.
+func (r *ConfigService) Edit(ctx context.Context, accountIdentifier interface{}, opts ...option.RequestOption) (res *MagicVisibilityMNMConfig, err error) {
+ opts = append(r.Options[:], opts...)
+ var env ConfigEditResponseEnvelope
+ path := fmt.Sprintf("accounts/%v/mnm/config", accountIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, nil, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Lists default sampling and router IPs for account.
+func (r *ConfigService) Get(ctx context.Context, accountIdentifier interface{}, opts ...option.RequestOption) (res *MagicVisibilityMNMConfig, err error) {
+ opts = append(r.Options[:], opts...)
+ var env ConfigGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%v/mnm/config", accountIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type MagicVisibilityMNMConfig struct {
+ // Fallback sampling rate of flow messages being sent in packets per second. This
+ // should match the packet sampling rate configured on the router.
+ DefaultSampling float64 `json:"default_sampling,required"`
+ // The account name.
+ Name string `json:"name,required"`
+ RouterIPs []string `json:"router_ips,required"`
+ JSON magicVisibilityMNMConfigJSON `json:"-"`
+}
+
+// magicVisibilityMNMConfigJSON contains the JSON metadata for the struct
+// [MagicVisibilityMNMConfig]
+type magicVisibilityMNMConfigJSON struct {
+ DefaultSampling apijson.Field
+ Name apijson.Field
+ RouterIPs apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *MagicVisibilityMNMConfig) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r magicVisibilityMNMConfigJSON) RawJSON() string {
+ return r.raw
+}
+
+type ConfigNewResponseEnvelope struct {
+ Errors []ConfigNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []ConfigNewResponseEnvelopeMessages `json:"messages,required"`
+ Result MagicVisibilityMNMConfig `json:"result,required"`
+ // Whether the API call was successful
+ Success ConfigNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON configNewResponseEnvelopeJSON `json:"-"`
+}
+
+// configNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [ConfigNewResponseEnvelope]
+type configNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ConfigNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r configNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type ConfigNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON configNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// configNewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [ConfigNewResponseEnvelopeErrors]
+type configNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ConfigNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r configNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type ConfigNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON configNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// configNewResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [ConfigNewResponseEnvelopeMessages]
+type configNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ConfigNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r configNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type ConfigNewResponseEnvelopeSuccess bool
+
+const (
+ ConfigNewResponseEnvelopeSuccessTrue ConfigNewResponseEnvelopeSuccess = true
+)
+
+type ConfigUpdateResponseEnvelope struct {
+ Errors []ConfigUpdateResponseEnvelopeErrors `json:"errors,required"`
+ Messages []ConfigUpdateResponseEnvelopeMessages `json:"messages,required"`
+ Result MagicVisibilityMNMConfig `json:"result,required"`
+ // Whether the API call was successful
+ Success ConfigUpdateResponseEnvelopeSuccess `json:"success,required"`
+ JSON configUpdateResponseEnvelopeJSON `json:"-"`
+}
+
+// configUpdateResponseEnvelopeJSON contains the JSON metadata for the struct
+// [ConfigUpdateResponseEnvelope]
+type configUpdateResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ConfigUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r configUpdateResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type ConfigUpdateResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON configUpdateResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// configUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [ConfigUpdateResponseEnvelopeErrors]
+type configUpdateResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ConfigUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r configUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type ConfigUpdateResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON configUpdateResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// configUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [ConfigUpdateResponseEnvelopeMessages]
+type configUpdateResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ConfigUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r configUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type ConfigUpdateResponseEnvelopeSuccess bool
+
+const (
+ ConfigUpdateResponseEnvelopeSuccessTrue ConfigUpdateResponseEnvelopeSuccess = true
+)
+
+type ConfigDeleteResponseEnvelope struct {
+ Errors []ConfigDeleteResponseEnvelopeErrors `json:"errors,required"`
+ Messages []ConfigDeleteResponseEnvelopeMessages `json:"messages,required"`
+ Result MagicVisibilityMNMConfig `json:"result,required"`
+ // Whether the API call was successful
+ Success ConfigDeleteResponseEnvelopeSuccess `json:"success,required"`
+ JSON configDeleteResponseEnvelopeJSON `json:"-"`
+}
+
+// configDeleteResponseEnvelopeJSON contains the JSON metadata for the struct
+// [ConfigDeleteResponseEnvelope]
+type configDeleteResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ConfigDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r configDeleteResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type ConfigDeleteResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON configDeleteResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// configDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [ConfigDeleteResponseEnvelopeErrors]
+type configDeleteResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ConfigDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r configDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type ConfigDeleteResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON configDeleteResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// configDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [ConfigDeleteResponseEnvelopeMessages]
+type configDeleteResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ConfigDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r configDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type ConfigDeleteResponseEnvelopeSuccess bool
+
+const (
+ ConfigDeleteResponseEnvelopeSuccessTrue ConfigDeleteResponseEnvelopeSuccess = true
+)
+
+type ConfigEditResponseEnvelope struct {
+ Errors []ConfigEditResponseEnvelopeErrors `json:"errors,required"`
+ Messages []ConfigEditResponseEnvelopeMessages `json:"messages,required"`
+ Result MagicVisibilityMNMConfig `json:"result,required"`
+ // Whether the API call was successful
+ Success ConfigEditResponseEnvelopeSuccess `json:"success,required"`
+ JSON configEditResponseEnvelopeJSON `json:"-"`
+}
+
+// configEditResponseEnvelopeJSON contains the JSON metadata for the struct
+// [ConfigEditResponseEnvelope]
+type configEditResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ConfigEditResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r configEditResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type ConfigEditResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON configEditResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// configEditResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [ConfigEditResponseEnvelopeErrors]
+type configEditResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ConfigEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r configEditResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type ConfigEditResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON configEditResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// configEditResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [ConfigEditResponseEnvelopeMessages]
+type configEditResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ConfigEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r configEditResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type ConfigEditResponseEnvelopeSuccess bool
+
+const (
+ ConfigEditResponseEnvelopeSuccessTrue ConfigEditResponseEnvelopeSuccess = true
+)
+
+type ConfigGetResponseEnvelope struct {
+ Errors []ConfigGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []ConfigGetResponseEnvelopeMessages `json:"messages,required"`
+ Result MagicVisibilityMNMConfig `json:"result,required"`
+ // Whether the API call was successful
+ Success ConfigGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON configGetResponseEnvelopeJSON `json:"-"`
+}
+
+// configGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [ConfigGetResponseEnvelope]
+type configGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ConfigGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r configGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type ConfigGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON configGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// configGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [ConfigGetResponseEnvelopeErrors]
+type configGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ConfigGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r configGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type ConfigGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON configGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// configGetResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [ConfigGetResponseEnvelopeMessages]
+type configGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ConfigGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r configGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type ConfigGetResponseEnvelopeSuccess bool
+
+const (
+ ConfigGetResponseEnvelopeSuccessTrue ConfigGetResponseEnvelopeSuccess = true
+)
diff --git a/magic_network_monitoring/config_test.go b/magic_network_monitoring/config_test.go
new file mode 100644
index 00000000000..4fbed6223a2
--- /dev/null
+++ b/magic_network_monitoring/config_test.go
@@ -0,0 +1,134 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package magic_network_monitoring_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestConfigNew(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"),
+ )
+ _, err := client.MagicNetworkMonitoring.Configs.New(context.TODO(), "6f91088a406011ed95aed352566e8d4c")
+ 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())
+ }
+}
+
+func TestConfigUpdate(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"),
+ )
+ _, err := client.MagicNetworkMonitoring.Configs.Update(context.TODO(), "6f91088a406011ed95aed352566e8d4c")
+ 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())
+ }
+}
+
+func TestConfigDelete(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"),
+ )
+ _, err := client.MagicNetworkMonitoring.Configs.Delete(context.TODO(), "6f91088a406011ed95aed352566e8d4c")
+ 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())
+ }
+}
+
+func TestConfigEdit(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"),
+ )
+ _, err := client.MagicNetworkMonitoring.Configs.Edit(context.TODO(), "6f91088a406011ed95aed352566e8d4c")
+ 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())
+ }
+}
+
+func TestConfigGet(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"),
+ )
+ _, err := client.MagicNetworkMonitoring.Configs.Get(context.TODO(), "6f91088a406011ed95aed352566e8d4c")
+ 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/magic_network_monitoring/configfull.go b/magic_network_monitoring/configfull.go
new file mode 100644
index 00000000000..b3cd1a42884
--- /dev/null
+++ b/magic_network_monitoring/configfull.go
@@ -0,0 +1,124 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package magic_network_monitoring
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// ConfigFullService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewConfigFullService] method instead.
+type ConfigFullService struct {
+ Options []option.RequestOption
+}
+
+// NewConfigFullService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewConfigFullService(opts ...option.RequestOption) (r *ConfigFullService) {
+ r = &ConfigFullService{}
+ r.Options = opts
+ return
+}
+
+// Lists default sampling, router IPs, and rules for account.
+func (r *ConfigFullService) Get(ctx context.Context, accountIdentifier interface{}, opts ...option.RequestOption) (res *MagicVisibilityMNMConfig, err error) {
+ opts = append(r.Options[:], opts...)
+ var env ConfigFullGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%v/mnm/config/full", accountIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type ConfigFullGetResponseEnvelope struct {
+ Errors []ConfigFullGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []ConfigFullGetResponseEnvelopeMessages `json:"messages,required"`
+ Result MagicVisibilityMNMConfig `json:"result,required"`
+ // Whether the API call was successful
+ Success ConfigFullGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON configFullGetResponseEnvelopeJSON `json:"-"`
+}
+
+// configFullGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [ConfigFullGetResponseEnvelope]
+type configFullGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ConfigFullGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r configFullGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type ConfigFullGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON configFullGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// configFullGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [ConfigFullGetResponseEnvelopeErrors]
+type configFullGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ConfigFullGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r configFullGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type ConfigFullGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON configFullGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// configFullGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [ConfigFullGetResponseEnvelopeMessages]
+type configFullGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ConfigFullGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r configFullGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type ConfigFullGetResponseEnvelopeSuccess bool
+
+const (
+ ConfigFullGetResponseEnvelopeSuccessTrue ConfigFullGetResponseEnvelopeSuccess = true
+)
diff --git a/magic_network_monitoring/configfull_test.go b/magic_network_monitoring/configfull_test.go
new file mode 100644
index 00000000000..9b5dad569cb
--- /dev/null
+++ b/magic_network_monitoring/configfull_test.go
@@ -0,0 +1,38 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package magic_network_monitoring_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestConfigFullGet(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"),
+ )
+ _, err := client.MagicNetworkMonitoring.Configs.Full.Get(context.TODO(), "6f91088a406011ed95aed352566e8d4c")
+ 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/magicnetworkmonitoring.go b/magic_network_monitoring/magicnetworkmonitoring.go
similarity index 80%
rename from magicnetworkmonitoring.go
rename to magic_network_monitoring/magicnetworkmonitoring.go
index 8e2747fe250..39e67bfa191 100644
--- a/magicnetworkmonitoring.go
+++ b/magic_network_monitoring/magicnetworkmonitoring.go
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package cloudflare
+package magic_network_monitoring
import (
"github.com/cloudflare/cloudflare-go/option"
@@ -13,8 +13,8 @@ import (
// method instead.
type MagicNetworkMonitoringService struct {
Options []option.RequestOption
- Configs *MagicNetworkMonitoringConfigService
- Rules *MagicNetworkMonitoringRuleService
+ Configs *ConfigService
+ Rules *RuleService
}
// NewMagicNetworkMonitoringService generates a new service that applies the given
@@ -23,7 +23,7 @@ type MagicNetworkMonitoringService struct {
func NewMagicNetworkMonitoringService(opts ...option.RequestOption) (r *MagicNetworkMonitoringService) {
r = &MagicNetworkMonitoringService{}
r.Options = opts
- r.Configs = NewMagicNetworkMonitoringConfigService(opts...)
- r.Rules = NewMagicNetworkMonitoringRuleService(opts...)
+ r.Configs = NewConfigService(opts...)
+ r.Rules = NewRuleService(opts...)
return
}
diff --git a/magic_network_monitoring/rule.go b/magic_network_monitoring/rule.go
new file mode 100644
index 00000000000..9904058c022
--- /dev/null
+++ b/magic_network_monitoring/rule.go
@@ -0,0 +1,678 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package magic_network_monitoring
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// RuleService contains methods and other services that help with interacting with
+// the cloudflare API. Note, unlike clients, this service does not read variables
+// from the environment automatically. You should not instantiate this service
+// directly, and instead use the [NewRuleService] method instead.
+type RuleService struct {
+ Options []option.RequestOption
+ Advertisements *RuleAdvertisementService
+}
+
+// NewRuleService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewRuleService(opts ...option.RequestOption) (r *RuleService) {
+ r = &RuleService{}
+ r.Options = opts
+ r.Advertisements = NewRuleAdvertisementService(opts...)
+ return
+}
+
+// Create network monitoring rules for account. Currently only supports creating a
+// single rule per API request.
+func (r *RuleService) New(ctx context.Context, accountIdentifier interface{}, opts ...option.RequestOption) (res *MagicVisibilityMNMRule, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RuleNewResponseEnvelope
+ path := fmt.Sprintf("accounts/%v/mnm/rules", accountIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Update network monitoring rules for account.
+func (r *RuleService) Update(ctx context.Context, accountIdentifier interface{}, opts ...option.RequestOption) (res *MagicVisibilityMNMRule, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RuleUpdateResponseEnvelope
+ path := fmt.Sprintf("accounts/%v/mnm/rules", accountIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, nil, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Lists network monitoring rules for account.
+func (r *RuleService) List(ctx context.Context, accountIdentifier interface{}, opts ...option.RequestOption) (res *[]MagicVisibilityMNMRule, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RuleListResponseEnvelope
+ path := fmt.Sprintf("accounts/%v/mnm/rules", accountIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Delete a network monitoring rule for account.
+func (r *RuleService) Delete(ctx context.Context, accountIdentifier interface{}, ruleIdentifier interface{}, opts ...option.RequestOption) (res *MagicVisibilityMNMRule, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RuleDeleteResponseEnvelope
+ path := fmt.Sprintf("accounts/%v/mnm/rules/%v", accountIdentifier, ruleIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Update a network monitoring rule for account.
+func (r *RuleService) Edit(ctx context.Context, accountIdentifier interface{}, ruleIdentifier interface{}, opts ...option.RequestOption) (res *MagicVisibilityMNMRule, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RuleEditResponseEnvelope
+ path := fmt.Sprintf("accounts/%v/mnm/rules/%v", accountIdentifier, ruleIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, nil, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// List a single network monitoring rule for account.
+func (r *RuleService) Get(ctx context.Context, accountIdentifier interface{}, ruleIdentifier interface{}, opts ...option.RequestOption) (res *MagicVisibilityMNMRule, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RuleGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%v/mnm/rules/%v", accountIdentifier, ruleIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type MagicVisibilityMNMRule struct {
+ // Toggle on if you would like Cloudflare to automatically advertise the IP
+ // Prefixes within the rule via Magic Transit when the rule is triggered. Only
+ // available for users of Magic Transit.
+ AutomaticAdvertisement bool `json:"automatic_advertisement,required,nullable"`
+ // The amount of time that the rule threshold must be exceeded to send an alert
+ // notification. The final value must be equivalent to one of the following 8
+ // values ["1m","5m","10m","15m","20m","30m","45m","60m"]. The format is
+ // AhBmCsDmsEusFns where A, B, C, D, E and F durations are optional; however at
+ // least one unit must be provided.
+ Duration string `json:"duration,required"`
+ // The name of the rule. Must be unique. Supports characters A-Z, a-z, 0-9,
+ // underscore (\_), dash (-), period (.), and tilde (~). You can’t have a space in
+ // the rule name. Max 256 characters.
+ Name string `json:"name,required"`
+ Prefixes []string `json:"prefixes,required"`
+ ID interface{} `json:"id"`
+ // The number of bits per second for the rule. When this value is exceeded for the
+ // set duration, an alert notification is sent. Minimum of 1 and no maximum.
+ BandwidthThreshold float64 `json:"bandwidth_threshold"`
+ // The number of packets per second for the rule. When this value is exceeded for
+ // the set duration, an alert notification is sent. Minimum of 1 and no maximum.
+ PacketThreshold float64 `json:"packet_threshold"`
+ JSON magicVisibilityMNMRuleJSON `json:"-"`
+}
+
+// magicVisibilityMNMRuleJSON contains the JSON metadata for the struct
+// [MagicVisibilityMNMRule]
+type magicVisibilityMNMRuleJSON struct {
+ AutomaticAdvertisement apijson.Field
+ Duration apijson.Field
+ Name apijson.Field
+ Prefixes apijson.Field
+ ID apijson.Field
+ BandwidthThreshold apijson.Field
+ PacketThreshold apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *MagicVisibilityMNMRule) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r magicVisibilityMNMRuleJSON) RawJSON() string {
+ return r.raw
+}
+
+type RuleNewResponseEnvelope struct {
+ Errors []RuleNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []RuleNewResponseEnvelopeMessages `json:"messages,required"`
+ Result MagicVisibilityMNMRule `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success RuleNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON ruleNewResponseEnvelopeJSON `json:"-"`
+}
+
+// ruleNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [RuleNewResponseEnvelope]
+type ruleNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RuleNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ruleNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type RuleNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON ruleNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// ruleNewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [RuleNewResponseEnvelopeErrors]
+type ruleNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RuleNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ruleNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type RuleNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON ruleNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// ruleNewResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [RuleNewResponseEnvelopeMessages]
+type ruleNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RuleNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ruleNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type RuleNewResponseEnvelopeSuccess bool
+
+const (
+ RuleNewResponseEnvelopeSuccessTrue RuleNewResponseEnvelopeSuccess = true
+)
+
+type RuleUpdateResponseEnvelope struct {
+ Errors []RuleUpdateResponseEnvelopeErrors `json:"errors,required"`
+ Messages []RuleUpdateResponseEnvelopeMessages `json:"messages,required"`
+ Result MagicVisibilityMNMRule `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success RuleUpdateResponseEnvelopeSuccess `json:"success,required"`
+ JSON ruleUpdateResponseEnvelopeJSON `json:"-"`
+}
+
+// ruleUpdateResponseEnvelopeJSON contains the JSON metadata for the struct
+// [RuleUpdateResponseEnvelope]
+type ruleUpdateResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RuleUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ruleUpdateResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type RuleUpdateResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON ruleUpdateResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// ruleUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [RuleUpdateResponseEnvelopeErrors]
+type ruleUpdateResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RuleUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ruleUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type RuleUpdateResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON ruleUpdateResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// ruleUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [RuleUpdateResponseEnvelopeMessages]
+type ruleUpdateResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RuleUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ruleUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type RuleUpdateResponseEnvelopeSuccess bool
+
+const (
+ RuleUpdateResponseEnvelopeSuccessTrue RuleUpdateResponseEnvelopeSuccess = true
+)
+
+type RuleListResponseEnvelope struct {
+ Errors []RuleListResponseEnvelopeErrors `json:"errors,required"`
+ Messages []RuleListResponseEnvelopeMessages `json:"messages,required"`
+ Result []MagicVisibilityMNMRule `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success RuleListResponseEnvelopeSuccess `json:"success,required"`
+ ResultInfo RuleListResponseEnvelopeResultInfo `json:"result_info"`
+ JSON ruleListResponseEnvelopeJSON `json:"-"`
+}
+
+// ruleListResponseEnvelopeJSON contains the JSON metadata for the struct
+// [RuleListResponseEnvelope]
+type ruleListResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ ResultInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RuleListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ruleListResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type RuleListResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON ruleListResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// ruleListResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [RuleListResponseEnvelopeErrors]
+type ruleListResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RuleListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ruleListResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type RuleListResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON ruleListResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// ruleListResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [RuleListResponseEnvelopeMessages]
+type ruleListResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RuleListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ruleListResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type RuleListResponseEnvelopeSuccess bool
+
+const (
+ RuleListResponseEnvelopeSuccessTrue RuleListResponseEnvelopeSuccess = true
+)
+
+type RuleListResponseEnvelopeResultInfo struct {
+ // Total number of results for the requested service
+ Count float64 `json:"count"`
+ // Current page within paginated list of results
+ Page float64 `json:"page"`
+ // Number of results per page of results
+ PerPage float64 `json:"per_page"`
+ // Total results available without any search parameters
+ TotalCount float64 `json:"total_count"`
+ JSON ruleListResponseEnvelopeResultInfoJSON `json:"-"`
+}
+
+// ruleListResponseEnvelopeResultInfoJSON contains the JSON metadata for the struct
+// [RuleListResponseEnvelopeResultInfo]
+type ruleListResponseEnvelopeResultInfoJSON struct {
+ Count apijson.Field
+ Page apijson.Field
+ PerPage apijson.Field
+ TotalCount apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RuleListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ruleListResponseEnvelopeResultInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type RuleDeleteResponseEnvelope struct {
+ Errors []RuleDeleteResponseEnvelopeErrors `json:"errors,required"`
+ Messages []RuleDeleteResponseEnvelopeMessages `json:"messages,required"`
+ Result MagicVisibilityMNMRule `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success RuleDeleteResponseEnvelopeSuccess `json:"success,required"`
+ JSON ruleDeleteResponseEnvelopeJSON `json:"-"`
+}
+
+// ruleDeleteResponseEnvelopeJSON contains the JSON metadata for the struct
+// [RuleDeleteResponseEnvelope]
+type ruleDeleteResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RuleDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ruleDeleteResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type RuleDeleteResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON ruleDeleteResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// ruleDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [RuleDeleteResponseEnvelopeErrors]
+type ruleDeleteResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RuleDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ruleDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type RuleDeleteResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON ruleDeleteResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// ruleDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [RuleDeleteResponseEnvelopeMessages]
+type ruleDeleteResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RuleDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ruleDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type RuleDeleteResponseEnvelopeSuccess bool
+
+const (
+ RuleDeleteResponseEnvelopeSuccessTrue RuleDeleteResponseEnvelopeSuccess = true
+)
+
+type RuleEditResponseEnvelope struct {
+ Errors []RuleEditResponseEnvelopeErrors `json:"errors,required"`
+ Messages []RuleEditResponseEnvelopeMessages `json:"messages,required"`
+ Result MagicVisibilityMNMRule `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success RuleEditResponseEnvelopeSuccess `json:"success,required"`
+ JSON ruleEditResponseEnvelopeJSON `json:"-"`
+}
+
+// ruleEditResponseEnvelopeJSON contains the JSON metadata for the struct
+// [RuleEditResponseEnvelope]
+type ruleEditResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RuleEditResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ruleEditResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type RuleEditResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON ruleEditResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// ruleEditResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [RuleEditResponseEnvelopeErrors]
+type ruleEditResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RuleEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ruleEditResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type RuleEditResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON ruleEditResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// ruleEditResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [RuleEditResponseEnvelopeMessages]
+type ruleEditResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RuleEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ruleEditResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type RuleEditResponseEnvelopeSuccess bool
+
+const (
+ RuleEditResponseEnvelopeSuccessTrue RuleEditResponseEnvelopeSuccess = true
+)
+
+type RuleGetResponseEnvelope struct {
+ Errors []RuleGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []RuleGetResponseEnvelopeMessages `json:"messages,required"`
+ Result MagicVisibilityMNMRule `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success RuleGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON ruleGetResponseEnvelopeJSON `json:"-"`
+}
+
+// ruleGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [RuleGetResponseEnvelope]
+type ruleGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RuleGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ruleGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type RuleGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON ruleGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// ruleGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [RuleGetResponseEnvelopeErrors]
+type ruleGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RuleGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ruleGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type RuleGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON ruleGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// ruleGetResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [RuleGetResponseEnvelopeMessages]
+type ruleGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RuleGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ruleGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type RuleGetResponseEnvelopeSuccess bool
+
+const (
+ RuleGetResponseEnvelopeSuccessTrue RuleGetResponseEnvelopeSuccess = true
+)
diff --git a/magic_network_monitoring/rule_test.go b/magic_network_monitoring/rule_test.go
new file mode 100644
index 00000000000..36fc5c5fc20
--- /dev/null
+++ b/magic_network_monitoring/rule_test.go
@@ -0,0 +1,170 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package magic_network_monitoring_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestRuleNew(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"),
+ )
+ _, err := client.MagicNetworkMonitoring.Rules.New(context.TODO(), "6f91088a406011ed95aed352566e8d4c")
+ 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())
+ }
+}
+
+func TestRuleUpdate(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"),
+ )
+ _, err := client.MagicNetworkMonitoring.Rules.Update(context.TODO(), "6f91088a406011ed95aed352566e8d4c")
+ 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())
+ }
+}
+
+func TestRuleList(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"),
+ )
+ _, err := client.MagicNetworkMonitoring.Rules.List(context.TODO(), "6f91088a406011ed95aed352566e8d4c")
+ 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())
+ }
+}
+
+func TestRuleDelete(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"),
+ )
+ _, err := client.MagicNetworkMonitoring.Rules.Delete(
+ context.TODO(),
+ "6f91088a406011ed95aed352566e8d4c",
+ "2890e6fa406311ed9b5a23f70f6fb8cf",
+ )
+ 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())
+ }
+}
+
+func TestRuleEdit(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"),
+ )
+ _, err := client.MagicNetworkMonitoring.Rules.Edit(
+ context.TODO(),
+ "6f91088a406011ed95aed352566e8d4c",
+ "2890e6fa406311ed9b5a23f70f6fb8cf",
+ )
+ 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())
+ }
+}
+
+func TestRuleGet(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"),
+ )
+ _, err := client.MagicNetworkMonitoring.Rules.Get(
+ context.TODO(),
+ "6f91088a406011ed95aed352566e8d4c",
+ "2890e6fa406311ed9b5a23f70f6fb8cf",
+ )
+ 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/magic_network_monitoring/ruleadvertisement.go b/magic_network_monitoring/ruleadvertisement.go
new file mode 100644
index 00000000000..db517cd9ba7
--- /dev/null
+++ b/magic_network_monitoring/ruleadvertisement.go
@@ -0,0 +1,149 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package magic_network_monitoring
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// RuleAdvertisementService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewRuleAdvertisementService] method
+// instead.
+type RuleAdvertisementService struct {
+ Options []option.RequestOption
+}
+
+// NewRuleAdvertisementService generates a new service that applies the given
+// options to each request. These options are applied after the parent client's
+// options (if there is one), and before any request-specific options.
+func NewRuleAdvertisementService(opts ...option.RequestOption) (r *RuleAdvertisementService) {
+ r = &RuleAdvertisementService{}
+ r.Options = opts
+ return
+}
+
+// Update advertisement for rule.
+func (r *RuleAdvertisementService) Edit(ctx context.Context, accountIdentifier interface{}, ruleIdentifier interface{}, opts ...option.RequestOption) (res *MagicVisibilityMNMRuleAdvertisable, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RuleAdvertisementEditResponseEnvelope
+ path := fmt.Sprintf("accounts/%v/mnm/rules/%v/advertisement", accountIdentifier, ruleIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, nil, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type MagicVisibilityMNMRuleAdvertisable struct {
+ // Toggle on if you would like Cloudflare to automatically advertise the IP
+ // Prefixes within the rule via Magic Transit when the rule is triggered. Only
+ // available for users of Magic Transit.
+ AutomaticAdvertisement bool `json:"automatic_advertisement,required,nullable"`
+ JSON magicVisibilityMNMRuleAdvertisableJSON `json:"-"`
+}
+
+// magicVisibilityMNMRuleAdvertisableJSON contains the JSON metadata for the struct
+// [MagicVisibilityMNMRuleAdvertisable]
+type magicVisibilityMNMRuleAdvertisableJSON struct {
+ AutomaticAdvertisement apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *MagicVisibilityMNMRuleAdvertisable) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r magicVisibilityMNMRuleAdvertisableJSON) RawJSON() string {
+ return r.raw
+}
+
+type RuleAdvertisementEditResponseEnvelope struct {
+ Errors []RuleAdvertisementEditResponseEnvelopeErrors `json:"errors,required"`
+ Messages []RuleAdvertisementEditResponseEnvelopeMessages `json:"messages,required"`
+ Result MagicVisibilityMNMRuleAdvertisable `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success RuleAdvertisementEditResponseEnvelopeSuccess `json:"success,required"`
+ JSON ruleAdvertisementEditResponseEnvelopeJSON `json:"-"`
+}
+
+// ruleAdvertisementEditResponseEnvelopeJSON contains the JSON metadata for the
+// struct [RuleAdvertisementEditResponseEnvelope]
+type ruleAdvertisementEditResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RuleAdvertisementEditResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ruleAdvertisementEditResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type RuleAdvertisementEditResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON ruleAdvertisementEditResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// ruleAdvertisementEditResponseEnvelopeErrorsJSON contains the JSON metadata for
+// the struct [RuleAdvertisementEditResponseEnvelopeErrors]
+type ruleAdvertisementEditResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RuleAdvertisementEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ruleAdvertisementEditResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type RuleAdvertisementEditResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON ruleAdvertisementEditResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// ruleAdvertisementEditResponseEnvelopeMessagesJSON contains the JSON metadata for
+// the struct [RuleAdvertisementEditResponseEnvelopeMessages]
+type ruleAdvertisementEditResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RuleAdvertisementEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ruleAdvertisementEditResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type RuleAdvertisementEditResponseEnvelopeSuccess bool
+
+const (
+ RuleAdvertisementEditResponseEnvelopeSuccessTrue RuleAdvertisementEditResponseEnvelopeSuccess = true
+)
diff --git a/magic_network_monitoring/ruleadvertisement_test.go b/magic_network_monitoring/ruleadvertisement_test.go
new file mode 100644
index 00000000000..da4cefe21aa
--- /dev/null
+++ b/magic_network_monitoring/ruleadvertisement_test.go
@@ -0,0 +1,42 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package magic_network_monitoring_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestRuleAdvertisementEdit(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"),
+ )
+ _, err := client.MagicNetworkMonitoring.Rules.Advertisements.Edit(
+ context.TODO(),
+ "6f91088a406011ed95aed352566e8d4c",
+ "2890e6fa406311ed9b5a23f70f6fb8cf",
+ )
+ 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/magic_transit/aliases.go b/magic_transit/aliases.go
new file mode 100644
index 00000000000..877af154fd4
--- /dev/null
+++ b/magic_transit/aliases.go
@@ -0,0 +1,9 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package magic_transit
+
+import (
+ "github.com/cloudflare/cloudflare-go/internal/apierror"
+)
+
+type Error = apierror.Error
diff --git a/magic_transit/cfinterconnect.go b/magic_transit/cfinterconnect.go
new file mode 100644
index 00000000000..6a6a31f8a90
--- /dev/null
+++ b/magic_transit/cfinterconnect.go
@@ -0,0 +1,571 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package magic_transit
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// CfInterconnectService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewCfInterconnectService] method
+// instead.
+type CfInterconnectService struct {
+ Options []option.RequestOption
+}
+
+// NewCfInterconnectService generates a new service that applies the given options
+// to each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewCfInterconnectService(opts ...option.RequestOption) (r *CfInterconnectService) {
+ r = &CfInterconnectService{}
+ r.Options = opts
+ return
+}
+
+// Updates a specific interconnect associated with an account. Use
+// `?validate_only=true` as an optional query parameter to only run validation
+// without persisting changes.
+func (r *CfInterconnectService) Update(ctx context.Context, accountIdentifier string, tunnelIdentifier string, body CfInterconnectUpdateParams, opts ...option.RequestOption) (res *CfInterconnectUpdateResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env CfInterconnectUpdateResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/magic/cf_interconnects/%s", accountIdentifier, tunnelIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Lists interconnects associated with an account.
+func (r *CfInterconnectService) List(ctx context.Context, accountIdentifier string, opts ...option.RequestOption) (res *CfInterconnectListResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env CfInterconnectListResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/magic/cf_interconnects", accountIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Lists details for a specific interconnect.
+func (r *CfInterconnectService) Get(ctx context.Context, accountIdentifier string, tunnelIdentifier string, opts ...option.RequestOption) (res *CfInterconnectGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env CfInterconnectGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/magic/cf_interconnects/%s", accountIdentifier, tunnelIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type CfInterconnectUpdateResponse struct {
+ Modified bool `json:"modified"`
+ ModifiedInterconnect interface{} `json:"modified_interconnect"`
+ JSON cfInterconnectUpdateResponseJSON `json:"-"`
+}
+
+// cfInterconnectUpdateResponseJSON contains the JSON metadata for the struct
+// [CfInterconnectUpdateResponse]
+type cfInterconnectUpdateResponseJSON struct {
+ Modified apijson.Field
+ ModifiedInterconnect apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CfInterconnectUpdateResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r cfInterconnectUpdateResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type CfInterconnectListResponse struct {
+ Interconnects []CfInterconnectListResponseInterconnect `json:"interconnects"`
+ JSON cfInterconnectListResponseJSON `json:"-"`
+}
+
+// cfInterconnectListResponseJSON contains the JSON metadata for the struct
+// [CfInterconnectListResponse]
+type cfInterconnectListResponseJSON struct {
+ Interconnects apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CfInterconnectListResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r cfInterconnectListResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type CfInterconnectListResponseInterconnect struct {
+ // Tunnel identifier tag.
+ ID string `json:"id"`
+ // The name of the interconnect. The name cannot share a name with other tunnels.
+ ColoName string `json:"colo_name"`
+ // The date and time the tunnel was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // An optional description of the interconnect.
+ Description string `json:"description"`
+ // The configuration specific to GRE interconnects.
+ GRE CfInterconnectListResponseInterconnectsGRE `json:"gre"`
+ HealthCheck CfInterconnectListResponseInterconnectsHealthCheck `json:"health_check"`
+ // A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side
+ // of the tunnel. Select the subnet from the following private IP space:
+ // 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255.
+ InterfaceAddress string `json:"interface_address"`
+ // The date and time the tunnel was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // The Maximum Transmission Unit (MTU) in bytes for the interconnect. The minimum
+ // value is 576.
+ Mtu int64 `json:"mtu"`
+ // The name of the interconnect. The name cannot share a name with other tunnels.
+ Name string `json:"name"`
+ JSON cfInterconnectListResponseInterconnectJSON `json:"-"`
+}
+
+// cfInterconnectListResponseInterconnectJSON contains the JSON metadata for the
+// struct [CfInterconnectListResponseInterconnect]
+type cfInterconnectListResponseInterconnectJSON struct {
+ ID apijson.Field
+ ColoName apijson.Field
+ CreatedOn apijson.Field
+ Description apijson.Field
+ GRE apijson.Field
+ HealthCheck apijson.Field
+ InterfaceAddress apijson.Field
+ ModifiedOn apijson.Field
+ Mtu apijson.Field
+ Name apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CfInterconnectListResponseInterconnect) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r cfInterconnectListResponseInterconnectJSON) RawJSON() string {
+ return r.raw
+}
+
+// The configuration specific to GRE interconnects.
+type CfInterconnectListResponseInterconnectsGRE struct {
+ // The IP address assigned to the Cloudflare side of the GRE tunnel created as part
+ // of the Interconnect.
+ CloudflareEndpoint string `json:"cloudflare_endpoint"`
+ JSON cfInterconnectListResponseInterconnectsGREJSON `json:"-"`
+}
+
+// cfInterconnectListResponseInterconnectsGREJSON contains the JSON metadata for
+// the struct [CfInterconnectListResponseInterconnectsGRE]
+type cfInterconnectListResponseInterconnectsGREJSON struct {
+ CloudflareEndpoint apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CfInterconnectListResponseInterconnectsGRE) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r cfInterconnectListResponseInterconnectsGREJSON) RawJSON() string {
+ return r.raw
+}
+
+type CfInterconnectListResponseInterconnectsHealthCheck struct {
+ // Determines whether to run healthchecks for a tunnel.
+ Enabled bool `json:"enabled"`
+ // How frequent the health check is run. The default value is `mid`.
+ Rate CfInterconnectListResponseInterconnectsHealthCheckRate `json:"rate"`
+ // The destination address in a request type health check. After the healthcheck is
+ // decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded
+ // to this address. This field defaults to `customer_gre_endpoint address`.
+ Target string `json:"target"`
+ // The type of healthcheck to run, reply or request. The default value is `reply`.
+ Type CfInterconnectListResponseInterconnectsHealthCheckType `json:"type"`
+ JSON cfInterconnectListResponseInterconnectsHealthCheckJSON `json:"-"`
+}
+
+// cfInterconnectListResponseInterconnectsHealthCheckJSON contains the JSON
+// metadata for the struct [CfInterconnectListResponseInterconnectsHealthCheck]
+type cfInterconnectListResponseInterconnectsHealthCheckJSON struct {
+ Enabled apijson.Field
+ Rate apijson.Field
+ Target apijson.Field
+ Type apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CfInterconnectListResponseInterconnectsHealthCheck) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r cfInterconnectListResponseInterconnectsHealthCheckJSON) RawJSON() string {
+ return r.raw
+}
+
+// How frequent the health check is run. The default value is `mid`.
+type CfInterconnectListResponseInterconnectsHealthCheckRate string
+
+const (
+ CfInterconnectListResponseInterconnectsHealthCheckRateLow CfInterconnectListResponseInterconnectsHealthCheckRate = "low"
+ CfInterconnectListResponseInterconnectsHealthCheckRateMid CfInterconnectListResponseInterconnectsHealthCheckRate = "mid"
+ CfInterconnectListResponseInterconnectsHealthCheckRateHigh CfInterconnectListResponseInterconnectsHealthCheckRate = "high"
+)
+
+// The type of healthcheck to run, reply or request. The default value is `reply`.
+type CfInterconnectListResponseInterconnectsHealthCheckType string
+
+const (
+ CfInterconnectListResponseInterconnectsHealthCheckTypeReply CfInterconnectListResponseInterconnectsHealthCheckType = "reply"
+ CfInterconnectListResponseInterconnectsHealthCheckTypeRequest CfInterconnectListResponseInterconnectsHealthCheckType = "request"
+)
+
+type CfInterconnectGetResponse struct {
+ Interconnect interface{} `json:"interconnect"`
+ JSON cfInterconnectGetResponseJSON `json:"-"`
+}
+
+// cfInterconnectGetResponseJSON contains the JSON metadata for the struct
+// [CfInterconnectGetResponse]
+type cfInterconnectGetResponseJSON struct {
+ Interconnect apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CfInterconnectGetResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r cfInterconnectGetResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type CfInterconnectUpdateParams struct {
+ // An optional description of the interconnect.
+ Description param.Field[string] `json:"description"`
+ // The configuration specific to GRE interconnects.
+ GRE param.Field[CfInterconnectUpdateParamsGRE] `json:"gre"`
+ HealthCheck param.Field[CfInterconnectUpdateParamsHealthCheck] `json:"health_check"`
+ // A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side
+ // of the tunnel. Select the subnet from the following private IP space:
+ // 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255.
+ InterfaceAddress param.Field[string] `json:"interface_address"`
+ // The Maximum Transmission Unit (MTU) in bytes for the interconnect. The minimum
+ // value is 576.
+ Mtu param.Field[int64] `json:"mtu"`
+}
+
+func (r CfInterconnectUpdateParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The configuration specific to GRE interconnects.
+type CfInterconnectUpdateParamsGRE struct {
+ // The IP address assigned to the Cloudflare side of the GRE tunnel created as part
+ // of the Interconnect.
+ CloudflareEndpoint param.Field[string] `json:"cloudflare_endpoint"`
+}
+
+func (r CfInterconnectUpdateParamsGRE) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type CfInterconnectUpdateParamsHealthCheck struct {
+ // Determines whether to run healthchecks for a tunnel.
+ Enabled param.Field[bool] `json:"enabled"`
+ // How frequent the health check is run. The default value is `mid`.
+ Rate param.Field[CfInterconnectUpdateParamsHealthCheckRate] `json:"rate"`
+ // The destination address in a request type health check. After the healthcheck is
+ // decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded
+ // to this address. This field defaults to `customer_gre_endpoint address`.
+ Target param.Field[string] `json:"target"`
+ // The type of healthcheck to run, reply or request. The default value is `reply`.
+ Type param.Field[CfInterconnectUpdateParamsHealthCheckType] `json:"type"`
+}
+
+func (r CfInterconnectUpdateParamsHealthCheck) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// How frequent the health check is run. The default value is `mid`.
+type CfInterconnectUpdateParamsHealthCheckRate string
+
+const (
+ CfInterconnectUpdateParamsHealthCheckRateLow CfInterconnectUpdateParamsHealthCheckRate = "low"
+ CfInterconnectUpdateParamsHealthCheckRateMid CfInterconnectUpdateParamsHealthCheckRate = "mid"
+ CfInterconnectUpdateParamsHealthCheckRateHigh CfInterconnectUpdateParamsHealthCheckRate = "high"
+)
+
+// The type of healthcheck to run, reply or request. The default value is `reply`.
+type CfInterconnectUpdateParamsHealthCheckType string
+
+const (
+ CfInterconnectUpdateParamsHealthCheckTypeReply CfInterconnectUpdateParamsHealthCheckType = "reply"
+ CfInterconnectUpdateParamsHealthCheckTypeRequest CfInterconnectUpdateParamsHealthCheckType = "request"
+)
+
+type CfInterconnectUpdateResponseEnvelope struct {
+ Errors []CfInterconnectUpdateResponseEnvelopeErrors `json:"errors,required"`
+ Messages []CfInterconnectUpdateResponseEnvelopeMessages `json:"messages,required"`
+ Result CfInterconnectUpdateResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success CfInterconnectUpdateResponseEnvelopeSuccess `json:"success,required"`
+ JSON cfInterconnectUpdateResponseEnvelopeJSON `json:"-"`
+}
+
+// cfInterconnectUpdateResponseEnvelopeJSON contains the JSON metadata for the
+// struct [CfInterconnectUpdateResponseEnvelope]
+type cfInterconnectUpdateResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CfInterconnectUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r cfInterconnectUpdateResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type CfInterconnectUpdateResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON cfInterconnectUpdateResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// cfInterconnectUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for
+// the struct [CfInterconnectUpdateResponseEnvelopeErrors]
+type cfInterconnectUpdateResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CfInterconnectUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r cfInterconnectUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type CfInterconnectUpdateResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON cfInterconnectUpdateResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// cfInterconnectUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for
+// the struct [CfInterconnectUpdateResponseEnvelopeMessages]
+type cfInterconnectUpdateResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CfInterconnectUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r cfInterconnectUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type CfInterconnectUpdateResponseEnvelopeSuccess bool
+
+const (
+ CfInterconnectUpdateResponseEnvelopeSuccessTrue CfInterconnectUpdateResponseEnvelopeSuccess = true
+)
+
+type CfInterconnectListResponseEnvelope struct {
+ Errors []CfInterconnectListResponseEnvelopeErrors `json:"errors,required"`
+ Messages []CfInterconnectListResponseEnvelopeMessages `json:"messages,required"`
+ Result CfInterconnectListResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success CfInterconnectListResponseEnvelopeSuccess `json:"success,required"`
+ JSON cfInterconnectListResponseEnvelopeJSON `json:"-"`
+}
+
+// cfInterconnectListResponseEnvelopeJSON contains the JSON metadata for the struct
+// [CfInterconnectListResponseEnvelope]
+type cfInterconnectListResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CfInterconnectListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r cfInterconnectListResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type CfInterconnectListResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON cfInterconnectListResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// cfInterconnectListResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [CfInterconnectListResponseEnvelopeErrors]
+type cfInterconnectListResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CfInterconnectListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r cfInterconnectListResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type CfInterconnectListResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON cfInterconnectListResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// cfInterconnectListResponseEnvelopeMessagesJSON contains the JSON metadata for
+// the struct [CfInterconnectListResponseEnvelopeMessages]
+type cfInterconnectListResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CfInterconnectListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r cfInterconnectListResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type CfInterconnectListResponseEnvelopeSuccess bool
+
+const (
+ CfInterconnectListResponseEnvelopeSuccessTrue CfInterconnectListResponseEnvelopeSuccess = true
+)
+
+type CfInterconnectGetResponseEnvelope struct {
+ Errors []CfInterconnectGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []CfInterconnectGetResponseEnvelopeMessages `json:"messages,required"`
+ Result CfInterconnectGetResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success CfInterconnectGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON cfInterconnectGetResponseEnvelopeJSON `json:"-"`
+}
+
+// cfInterconnectGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [CfInterconnectGetResponseEnvelope]
+type cfInterconnectGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CfInterconnectGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r cfInterconnectGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type CfInterconnectGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON cfInterconnectGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// cfInterconnectGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [CfInterconnectGetResponseEnvelopeErrors]
+type cfInterconnectGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CfInterconnectGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r cfInterconnectGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type CfInterconnectGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON cfInterconnectGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// cfInterconnectGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [CfInterconnectGetResponseEnvelopeMessages]
+type cfInterconnectGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CfInterconnectGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r cfInterconnectGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type CfInterconnectGetResponseEnvelopeSuccess bool
+
+const (
+ CfInterconnectGetResponseEnvelopeSuccessTrue CfInterconnectGetResponseEnvelopeSuccess = true
+)
diff --git a/magic_transit/cfinterconnect_test.go b/magic_transit/cfinterconnect_test.go
new file mode 100644
index 00000000000..7e2895f7d93
--- /dev/null
+++ b/magic_transit/cfinterconnect_test.go
@@ -0,0 +1,109 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package magic_transit_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/magic_transit"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestCfInterconnectUpdateWithOptionalParams(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"),
+ )
+ _, err := client.MagicTransit.CfInterconnects.Update(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ magic_transit.CfInterconnectUpdateParams{
+ Description: cloudflare.F("Tunnel for Interconnect to ORD"),
+ GRE: cloudflare.F(magic_transit.CfInterconnectUpdateParamsGRE{
+ CloudflareEndpoint: cloudflare.F("203.0.113.1"),
+ }),
+ HealthCheck: cloudflare.F(magic_transit.CfInterconnectUpdateParamsHealthCheck{
+ Enabled: cloudflare.F(true),
+ Rate: cloudflare.F(magic_transit.CfInterconnectUpdateParamsHealthCheckRateLow),
+ Target: cloudflare.F("203.0.113.1"),
+ Type: cloudflare.F(magic_transit.CfInterconnectUpdateParamsHealthCheckTypeRequest),
+ }),
+ InterfaceAddress: cloudflare.F("192.0.2.0/31"),
+ Mtu: cloudflare.F(int64(0)),
+ },
+ )
+ 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())
+ }
+}
+
+func TestCfInterconnectList(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"),
+ )
+ _, err := client.MagicTransit.CfInterconnects.List(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353")
+ 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())
+ }
+}
+
+func TestCfInterconnectGet(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"),
+ )
+ _, err := client.MagicTransit.CfInterconnects.Get(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ )
+ 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/magic_transit/gretunnel.go b/magic_transit/gretunnel.go
new file mode 100644
index 00000000000..9e6a5a60f29
--- /dev/null
+++ b/magic_transit/gretunnel.go
@@ -0,0 +1,960 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package magic_transit
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// GRETunnelService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewGRETunnelService] method instead.
+type GRETunnelService struct {
+ Options []option.RequestOption
+}
+
+// NewGRETunnelService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewGRETunnelService(opts ...option.RequestOption) (r *GRETunnelService) {
+ r = &GRETunnelService{}
+ r.Options = opts
+ return
+}
+
+// Creates new GRE tunnels. Use `?validate_only=true` as an optional query
+// parameter to only run validation without persisting changes.
+func (r *GRETunnelService) New(ctx context.Context, accountIdentifier string, body GRETunnelNewParams, opts ...option.RequestOption) (res *GRETunnelNewResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env GRETunnelNewResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/magic/gre_tunnels", accountIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Updates a specific GRE tunnel. Use `?validate_only=true` as an optional query
+// parameter to only run validation without persisting changes.
+func (r *GRETunnelService) Update(ctx context.Context, accountIdentifier string, tunnelIdentifier string, body GRETunnelUpdateParams, opts ...option.RequestOption) (res *GRETunnelUpdateResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env GRETunnelUpdateResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/magic/gre_tunnels/%s", accountIdentifier, tunnelIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Lists GRE tunnels associated with an account.
+func (r *GRETunnelService) List(ctx context.Context, accountIdentifier string, opts ...option.RequestOption) (res *GRETunnelListResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env GRETunnelListResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/magic/gre_tunnels", accountIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Disables and removes a specific static GRE tunnel. Use `?validate_only=true` as
+// an optional query parameter to only run validation without persisting changes.
+func (r *GRETunnelService) Delete(ctx context.Context, accountIdentifier string, tunnelIdentifier string, opts ...option.RequestOption) (res *GRETunnelDeleteResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env GRETunnelDeleteResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/magic/gre_tunnels/%s", accountIdentifier, tunnelIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Lists informtion for a specific GRE tunnel.
+func (r *GRETunnelService) Get(ctx context.Context, accountIdentifier string, tunnelIdentifier string, opts ...option.RequestOption) (res *GRETunnelGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env GRETunnelGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/magic/gre_tunnels/%s", accountIdentifier, tunnelIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type GRETunnelNewResponse struct {
+ GRETunnels []GRETunnelNewResponseGRETunnel `json:"gre_tunnels"`
+ JSON greTunnelNewResponseJSON `json:"-"`
+}
+
+// greTunnelNewResponseJSON contains the JSON metadata for the struct
+// [GRETunnelNewResponse]
+type greTunnelNewResponseJSON struct {
+ GRETunnels apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *GRETunnelNewResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r greTunnelNewResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type GRETunnelNewResponseGRETunnel struct {
+ // The IP address assigned to the Cloudflare side of the GRE tunnel.
+ CloudflareGREEndpoint string `json:"cloudflare_gre_endpoint,required"`
+ // The IP address assigned to the customer side of the GRE tunnel.
+ CustomerGREEndpoint string `json:"customer_gre_endpoint,required"`
+ // A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side
+ // of the tunnel. Select the subnet from the following private IP space:
+ // 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255.
+ InterfaceAddress string `json:"interface_address,required"`
+ // The name of the tunnel. The name cannot contain spaces or special characters,
+ // must be 15 characters or less, and cannot share a name with another GRE tunnel.
+ Name string `json:"name,required"`
+ // Tunnel identifier tag.
+ ID string `json:"id"`
+ // The date and time the tunnel was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // An optional description of the GRE tunnel.
+ Description string `json:"description"`
+ HealthCheck GRETunnelNewResponseGRETunnelsHealthCheck `json:"health_check"`
+ // The date and time the tunnel was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Maximum Transmission Unit (MTU) in bytes for the GRE tunnel. The minimum value
+ // is 576.
+ Mtu int64 `json:"mtu"`
+ // Time To Live (TTL) in number of hops of the GRE tunnel.
+ TTL int64 `json:"ttl"`
+ JSON greTunnelNewResponseGRETunnelJSON `json:"-"`
+}
+
+// greTunnelNewResponseGRETunnelJSON contains the JSON metadata for the struct
+// [GRETunnelNewResponseGRETunnel]
+type greTunnelNewResponseGRETunnelJSON struct {
+ CloudflareGREEndpoint apijson.Field
+ CustomerGREEndpoint apijson.Field
+ InterfaceAddress apijson.Field
+ Name apijson.Field
+ ID apijson.Field
+ CreatedOn apijson.Field
+ Description apijson.Field
+ HealthCheck apijson.Field
+ ModifiedOn apijson.Field
+ Mtu apijson.Field
+ TTL apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *GRETunnelNewResponseGRETunnel) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r greTunnelNewResponseGRETunnelJSON) RawJSON() string {
+ return r.raw
+}
+
+type GRETunnelNewResponseGRETunnelsHealthCheck struct {
+ // The direction of the flow of the healthcheck. Either unidirectional, where the
+ // probe comes to you via the tunnel and the result comes back to Cloudflare via
+ // the open Internet, or bidirectional where both the probe and result come and go
+ // via the tunnel. Note in the case of bidirecitonal healthchecks, the target field
+ // in health_check is ignored as the interface_address is used to send traffic into
+ // the tunnel.
+ Direction GRETunnelNewResponseGRETunnelsHealthCheckDirection `json:"direction"`
+ // Determines whether to run healthchecks for a tunnel.
+ Enabled bool `json:"enabled"`
+ // How frequent the health check is run. The default value is `mid`.
+ Rate GRETunnelNewResponseGRETunnelsHealthCheckRate `json:"rate"`
+ // The destination address in a request type health check. After the healthcheck is
+ // decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded
+ // to this address. This field defaults to `customer_gre_endpoint address`. This
+ // field is ignored for bidirectional healthchecks as the interface_address (not
+ // assigned to the Cloudflare side of the tunnel) is used as the target.
+ Target string `json:"target"`
+ // The type of healthcheck to run, reply or request. The default value is `reply`.
+ Type GRETunnelNewResponseGRETunnelsHealthCheckType `json:"type"`
+ JSON greTunnelNewResponseGRETunnelsHealthCheckJSON `json:"-"`
+}
+
+// greTunnelNewResponseGRETunnelsHealthCheckJSON contains the JSON metadata for the
+// struct [GRETunnelNewResponseGRETunnelsHealthCheck]
+type greTunnelNewResponseGRETunnelsHealthCheckJSON struct {
+ Direction apijson.Field
+ Enabled apijson.Field
+ Rate apijson.Field
+ Target apijson.Field
+ Type apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *GRETunnelNewResponseGRETunnelsHealthCheck) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r greTunnelNewResponseGRETunnelsHealthCheckJSON) RawJSON() string {
+ return r.raw
+}
+
+// The direction of the flow of the healthcheck. Either unidirectional, where the
+// probe comes to you via the tunnel and the result comes back to Cloudflare via
+// the open Internet, or bidirectional where both the probe and result come and go
+// via the tunnel. Note in the case of bidirecitonal healthchecks, the target field
+// in health_check is ignored as the interface_address is used to send traffic into
+// the tunnel.
+type GRETunnelNewResponseGRETunnelsHealthCheckDirection string
+
+const (
+ GRETunnelNewResponseGRETunnelsHealthCheckDirectionUnidirectional GRETunnelNewResponseGRETunnelsHealthCheckDirection = "unidirectional"
+ GRETunnelNewResponseGRETunnelsHealthCheckDirectionBidirectional GRETunnelNewResponseGRETunnelsHealthCheckDirection = "bidirectional"
+)
+
+// How frequent the health check is run. The default value is `mid`.
+type GRETunnelNewResponseGRETunnelsHealthCheckRate string
+
+const (
+ GRETunnelNewResponseGRETunnelsHealthCheckRateLow GRETunnelNewResponseGRETunnelsHealthCheckRate = "low"
+ GRETunnelNewResponseGRETunnelsHealthCheckRateMid GRETunnelNewResponseGRETunnelsHealthCheckRate = "mid"
+ GRETunnelNewResponseGRETunnelsHealthCheckRateHigh GRETunnelNewResponseGRETunnelsHealthCheckRate = "high"
+)
+
+// The type of healthcheck to run, reply or request. The default value is `reply`.
+type GRETunnelNewResponseGRETunnelsHealthCheckType string
+
+const (
+ GRETunnelNewResponseGRETunnelsHealthCheckTypeReply GRETunnelNewResponseGRETunnelsHealthCheckType = "reply"
+ GRETunnelNewResponseGRETunnelsHealthCheckTypeRequest GRETunnelNewResponseGRETunnelsHealthCheckType = "request"
+)
+
+type GRETunnelUpdateResponse struct {
+ Modified bool `json:"modified"`
+ ModifiedGRETunnel interface{} `json:"modified_gre_tunnel"`
+ JSON greTunnelUpdateResponseJSON `json:"-"`
+}
+
+// greTunnelUpdateResponseJSON contains the JSON metadata for the struct
+// [GRETunnelUpdateResponse]
+type greTunnelUpdateResponseJSON struct {
+ Modified apijson.Field
+ ModifiedGRETunnel apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *GRETunnelUpdateResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r greTunnelUpdateResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type GRETunnelListResponse struct {
+ GRETunnels []GRETunnelListResponseGRETunnel `json:"gre_tunnels"`
+ JSON greTunnelListResponseJSON `json:"-"`
+}
+
+// greTunnelListResponseJSON contains the JSON metadata for the struct
+// [GRETunnelListResponse]
+type greTunnelListResponseJSON struct {
+ GRETunnels apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *GRETunnelListResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r greTunnelListResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type GRETunnelListResponseGRETunnel struct {
+ // The IP address assigned to the Cloudflare side of the GRE tunnel.
+ CloudflareGREEndpoint string `json:"cloudflare_gre_endpoint,required"`
+ // The IP address assigned to the customer side of the GRE tunnel.
+ CustomerGREEndpoint string `json:"customer_gre_endpoint,required"`
+ // A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side
+ // of the tunnel. Select the subnet from the following private IP space:
+ // 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255.
+ InterfaceAddress string `json:"interface_address,required"`
+ // The name of the tunnel. The name cannot contain spaces or special characters,
+ // must be 15 characters or less, and cannot share a name with another GRE tunnel.
+ Name string `json:"name,required"`
+ // Tunnel identifier tag.
+ ID string `json:"id"`
+ // The date and time the tunnel was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // An optional description of the GRE tunnel.
+ Description string `json:"description"`
+ HealthCheck GRETunnelListResponseGRETunnelsHealthCheck `json:"health_check"`
+ // The date and time the tunnel was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Maximum Transmission Unit (MTU) in bytes for the GRE tunnel. The minimum value
+ // is 576.
+ Mtu int64 `json:"mtu"`
+ // Time To Live (TTL) in number of hops of the GRE tunnel.
+ TTL int64 `json:"ttl"`
+ JSON greTunnelListResponseGRETunnelJSON `json:"-"`
+}
+
+// greTunnelListResponseGRETunnelJSON contains the JSON metadata for the struct
+// [GRETunnelListResponseGRETunnel]
+type greTunnelListResponseGRETunnelJSON struct {
+ CloudflareGREEndpoint apijson.Field
+ CustomerGREEndpoint apijson.Field
+ InterfaceAddress apijson.Field
+ Name apijson.Field
+ ID apijson.Field
+ CreatedOn apijson.Field
+ Description apijson.Field
+ HealthCheck apijson.Field
+ ModifiedOn apijson.Field
+ Mtu apijson.Field
+ TTL apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *GRETunnelListResponseGRETunnel) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r greTunnelListResponseGRETunnelJSON) RawJSON() string {
+ return r.raw
+}
+
+type GRETunnelListResponseGRETunnelsHealthCheck struct {
+ // The direction of the flow of the healthcheck. Either unidirectional, where the
+ // probe comes to you via the tunnel and the result comes back to Cloudflare via
+ // the open Internet, or bidirectional where both the probe and result come and go
+ // via the tunnel. Note in the case of bidirecitonal healthchecks, the target field
+ // in health_check is ignored as the interface_address is used to send traffic into
+ // the tunnel.
+ Direction GRETunnelListResponseGRETunnelsHealthCheckDirection `json:"direction"`
+ // Determines whether to run healthchecks for a tunnel.
+ Enabled bool `json:"enabled"`
+ // How frequent the health check is run. The default value is `mid`.
+ Rate GRETunnelListResponseGRETunnelsHealthCheckRate `json:"rate"`
+ // The destination address in a request type health check. After the healthcheck is
+ // decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded
+ // to this address. This field defaults to `customer_gre_endpoint address`. This
+ // field is ignored for bidirectional healthchecks as the interface_address (not
+ // assigned to the Cloudflare side of the tunnel) is used as the target.
+ Target string `json:"target"`
+ // The type of healthcheck to run, reply or request. The default value is `reply`.
+ Type GRETunnelListResponseGRETunnelsHealthCheckType `json:"type"`
+ JSON greTunnelListResponseGRETunnelsHealthCheckJSON `json:"-"`
+}
+
+// greTunnelListResponseGRETunnelsHealthCheckJSON contains the JSON metadata for
+// the struct [GRETunnelListResponseGRETunnelsHealthCheck]
+type greTunnelListResponseGRETunnelsHealthCheckJSON struct {
+ Direction apijson.Field
+ Enabled apijson.Field
+ Rate apijson.Field
+ Target apijson.Field
+ Type apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *GRETunnelListResponseGRETunnelsHealthCheck) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r greTunnelListResponseGRETunnelsHealthCheckJSON) RawJSON() string {
+ return r.raw
+}
+
+// The direction of the flow of the healthcheck. Either unidirectional, where the
+// probe comes to you via the tunnel and the result comes back to Cloudflare via
+// the open Internet, or bidirectional where both the probe and result come and go
+// via the tunnel. Note in the case of bidirecitonal healthchecks, the target field
+// in health_check is ignored as the interface_address is used to send traffic into
+// the tunnel.
+type GRETunnelListResponseGRETunnelsHealthCheckDirection string
+
+const (
+ GRETunnelListResponseGRETunnelsHealthCheckDirectionUnidirectional GRETunnelListResponseGRETunnelsHealthCheckDirection = "unidirectional"
+ GRETunnelListResponseGRETunnelsHealthCheckDirectionBidirectional GRETunnelListResponseGRETunnelsHealthCheckDirection = "bidirectional"
+)
+
+// How frequent the health check is run. The default value is `mid`.
+type GRETunnelListResponseGRETunnelsHealthCheckRate string
+
+const (
+ GRETunnelListResponseGRETunnelsHealthCheckRateLow GRETunnelListResponseGRETunnelsHealthCheckRate = "low"
+ GRETunnelListResponseGRETunnelsHealthCheckRateMid GRETunnelListResponseGRETunnelsHealthCheckRate = "mid"
+ GRETunnelListResponseGRETunnelsHealthCheckRateHigh GRETunnelListResponseGRETunnelsHealthCheckRate = "high"
+)
+
+// The type of healthcheck to run, reply or request. The default value is `reply`.
+type GRETunnelListResponseGRETunnelsHealthCheckType string
+
+const (
+ GRETunnelListResponseGRETunnelsHealthCheckTypeReply GRETunnelListResponseGRETunnelsHealthCheckType = "reply"
+ GRETunnelListResponseGRETunnelsHealthCheckTypeRequest GRETunnelListResponseGRETunnelsHealthCheckType = "request"
+)
+
+type GRETunnelDeleteResponse struct {
+ Deleted bool `json:"deleted"`
+ DeletedGRETunnel interface{} `json:"deleted_gre_tunnel"`
+ JSON greTunnelDeleteResponseJSON `json:"-"`
+}
+
+// greTunnelDeleteResponseJSON contains the JSON metadata for the struct
+// [GRETunnelDeleteResponse]
+type greTunnelDeleteResponseJSON struct {
+ Deleted apijson.Field
+ DeletedGRETunnel apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *GRETunnelDeleteResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r greTunnelDeleteResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type GRETunnelGetResponse struct {
+ GRETunnel interface{} `json:"gre_tunnel"`
+ JSON greTunnelGetResponseJSON `json:"-"`
+}
+
+// greTunnelGetResponseJSON contains the JSON metadata for the struct
+// [GRETunnelGetResponse]
+type greTunnelGetResponseJSON struct {
+ GRETunnel apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *GRETunnelGetResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r greTunnelGetResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type GRETunnelNewParams struct {
+ Body param.Field[interface{}] `json:"body,required"`
+}
+
+func (r GRETunnelNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r.Body)
+}
+
+type GRETunnelNewResponseEnvelope struct {
+ Errors []GRETunnelNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []GRETunnelNewResponseEnvelopeMessages `json:"messages,required"`
+ Result GRETunnelNewResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success GRETunnelNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON greTunnelNewResponseEnvelopeJSON `json:"-"`
+}
+
+// greTunnelNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [GRETunnelNewResponseEnvelope]
+type greTunnelNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *GRETunnelNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r greTunnelNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type GRETunnelNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON greTunnelNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// greTunnelNewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [GRETunnelNewResponseEnvelopeErrors]
+type greTunnelNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *GRETunnelNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r greTunnelNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type GRETunnelNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON greTunnelNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// greTunnelNewResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [GRETunnelNewResponseEnvelopeMessages]
+type greTunnelNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *GRETunnelNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r greTunnelNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type GRETunnelNewResponseEnvelopeSuccess bool
+
+const (
+ GRETunnelNewResponseEnvelopeSuccessTrue GRETunnelNewResponseEnvelopeSuccess = true
+)
+
+type GRETunnelUpdateParams struct {
+ // The IP address assigned to the Cloudflare side of the GRE tunnel.
+ CloudflareGREEndpoint param.Field[string] `json:"cloudflare_gre_endpoint,required"`
+ // The IP address assigned to the customer side of the GRE tunnel.
+ CustomerGREEndpoint param.Field[string] `json:"customer_gre_endpoint,required"`
+ // A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side
+ // of the tunnel. Select the subnet from the following private IP space:
+ // 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255.
+ InterfaceAddress param.Field[string] `json:"interface_address,required"`
+ // The name of the tunnel. The name cannot contain spaces or special characters,
+ // must be 15 characters or less, and cannot share a name with another GRE tunnel.
+ Name param.Field[string] `json:"name,required"`
+ // An optional description of the GRE tunnel.
+ Description param.Field[string] `json:"description"`
+ HealthCheck param.Field[GRETunnelUpdateParamsHealthCheck] `json:"health_check"`
+ // Maximum Transmission Unit (MTU) in bytes for the GRE tunnel. The minimum value
+ // is 576.
+ Mtu param.Field[int64] `json:"mtu"`
+ // Time To Live (TTL) in number of hops of the GRE tunnel.
+ TTL param.Field[int64] `json:"ttl"`
+}
+
+func (r GRETunnelUpdateParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type GRETunnelUpdateParamsHealthCheck struct {
+ // The direction of the flow of the healthcheck. Either unidirectional, where the
+ // probe comes to you via the tunnel and the result comes back to Cloudflare via
+ // the open Internet, or bidirectional where both the probe and result come and go
+ // via the tunnel. Note in the case of bidirecitonal healthchecks, the target field
+ // in health_check is ignored as the interface_address is used to send traffic into
+ // the tunnel.
+ Direction param.Field[GRETunnelUpdateParamsHealthCheckDirection] `json:"direction"`
+ // Determines whether to run healthchecks for a tunnel.
+ Enabled param.Field[bool] `json:"enabled"`
+ // How frequent the health check is run. The default value is `mid`.
+ Rate param.Field[GRETunnelUpdateParamsHealthCheckRate] `json:"rate"`
+ // The destination address in a request type health check. After the healthcheck is
+ // decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded
+ // to this address. This field defaults to `customer_gre_endpoint address`. This
+ // field is ignored for bidirectional healthchecks as the interface_address (not
+ // assigned to the Cloudflare side of the tunnel) is used as the target.
+ Target param.Field[string] `json:"target"`
+ // The type of healthcheck to run, reply or request. The default value is `reply`.
+ Type param.Field[GRETunnelUpdateParamsHealthCheckType] `json:"type"`
+}
+
+func (r GRETunnelUpdateParamsHealthCheck) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The direction of the flow of the healthcheck. Either unidirectional, where the
+// probe comes to you via the tunnel and the result comes back to Cloudflare via
+// the open Internet, or bidirectional where both the probe and result come and go
+// via the tunnel. Note in the case of bidirecitonal healthchecks, the target field
+// in health_check is ignored as the interface_address is used to send traffic into
+// the tunnel.
+type GRETunnelUpdateParamsHealthCheckDirection string
+
+const (
+ GRETunnelUpdateParamsHealthCheckDirectionUnidirectional GRETunnelUpdateParamsHealthCheckDirection = "unidirectional"
+ GRETunnelUpdateParamsHealthCheckDirectionBidirectional GRETunnelUpdateParamsHealthCheckDirection = "bidirectional"
+)
+
+// How frequent the health check is run. The default value is `mid`.
+type GRETunnelUpdateParamsHealthCheckRate string
+
+const (
+ GRETunnelUpdateParamsHealthCheckRateLow GRETunnelUpdateParamsHealthCheckRate = "low"
+ GRETunnelUpdateParamsHealthCheckRateMid GRETunnelUpdateParamsHealthCheckRate = "mid"
+ GRETunnelUpdateParamsHealthCheckRateHigh GRETunnelUpdateParamsHealthCheckRate = "high"
+)
+
+// The type of healthcheck to run, reply or request. The default value is `reply`.
+type GRETunnelUpdateParamsHealthCheckType string
+
+const (
+ GRETunnelUpdateParamsHealthCheckTypeReply GRETunnelUpdateParamsHealthCheckType = "reply"
+ GRETunnelUpdateParamsHealthCheckTypeRequest GRETunnelUpdateParamsHealthCheckType = "request"
+)
+
+type GRETunnelUpdateResponseEnvelope struct {
+ Errors []GRETunnelUpdateResponseEnvelopeErrors `json:"errors,required"`
+ Messages []GRETunnelUpdateResponseEnvelopeMessages `json:"messages,required"`
+ Result GRETunnelUpdateResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success GRETunnelUpdateResponseEnvelopeSuccess `json:"success,required"`
+ JSON greTunnelUpdateResponseEnvelopeJSON `json:"-"`
+}
+
+// greTunnelUpdateResponseEnvelopeJSON contains the JSON metadata for the struct
+// [GRETunnelUpdateResponseEnvelope]
+type greTunnelUpdateResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *GRETunnelUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r greTunnelUpdateResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type GRETunnelUpdateResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON greTunnelUpdateResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// greTunnelUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [GRETunnelUpdateResponseEnvelopeErrors]
+type greTunnelUpdateResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *GRETunnelUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r greTunnelUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type GRETunnelUpdateResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON greTunnelUpdateResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// greTunnelUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [GRETunnelUpdateResponseEnvelopeMessages]
+type greTunnelUpdateResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *GRETunnelUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r greTunnelUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type GRETunnelUpdateResponseEnvelopeSuccess bool
+
+const (
+ GRETunnelUpdateResponseEnvelopeSuccessTrue GRETunnelUpdateResponseEnvelopeSuccess = true
+)
+
+type GRETunnelListResponseEnvelope struct {
+ Errors []GRETunnelListResponseEnvelopeErrors `json:"errors,required"`
+ Messages []GRETunnelListResponseEnvelopeMessages `json:"messages,required"`
+ Result GRETunnelListResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success GRETunnelListResponseEnvelopeSuccess `json:"success,required"`
+ JSON greTunnelListResponseEnvelopeJSON `json:"-"`
+}
+
+// greTunnelListResponseEnvelopeJSON contains the JSON metadata for the struct
+// [GRETunnelListResponseEnvelope]
+type greTunnelListResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *GRETunnelListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r greTunnelListResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type GRETunnelListResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON greTunnelListResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// greTunnelListResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [GRETunnelListResponseEnvelopeErrors]
+type greTunnelListResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *GRETunnelListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r greTunnelListResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type GRETunnelListResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON greTunnelListResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// greTunnelListResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [GRETunnelListResponseEnvelopeMessages]
+type greTunnelListResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *GRETunnelListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r greTunnelListResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type GRETunnelListResponseEnvelopeSuccess bool
+
+const (
+ GRETunnelListResponseEnvelopeSuccessTrue GRETunnelListResponseEnvelopeSuccess = true
+)
+
+type GRETunnelDeleteResponseEnvelope struct {
+ Errors []GRETunnelDeleteResponseEnvelopeErrors `json:"errors,required"`
+ Messages []GRETunnelDeleteResponseEnvelopeMessages `json:"messages,required"`
+ Result GRETunnelDeleteResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success GRETunnelDeleteResponseEnvelopeSuccess `json:"success,required"`
+ JSON greTunnelDeleteResponseEnvelopeJSON `json:"-"`
+}
+
+// greTunnelDeleteResponseEnvelopeJSON contains the JSON metadata for the struct
+// [GRETunnelDeleteResponseEnvelope]
+type greTunnelDeleteResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *GRETunnelDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r greTunnelDeleteResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type GRETunnelDeleteResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON greTunnelDeleteResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// greTunnelDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [GRETunnelDeleteResponseEnvelopeErrors]
+type greTunnelDeleteResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *GRETunnelDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r greTunnelDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type GRETunnelDeleteResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON greTunnelDeleteResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// greTunnelDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [GRETunnelDeleteResponseEnvelopeMessages]
+type greTunnelDeleteResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *GRETunnelDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r greTunnelDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type GRETunnelDeleteResponseEnvelopeSuccess bool
+
+const (
+ GRETunnelDeleteResponseEnvelopeSuccessTrue GRETunnelDeleteResponseEnvelopeSuccess = true
+)
+
+type GRETunnelGetResponseEnvelope struct {
+ Errors []GRETunnelGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []GRETunnelGetResponseEnvelopeMessages `json:"messages,required"`
+ Result GRETunnelGetResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success GRETunnelGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON greTunnelGetResponseEnvelopeJSON `json:"-"`
+}
+
+// greTunnelGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [GRETunnelGetResponseEnvelope]
+type greTunnelGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *GRETunnelGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r greTunnelGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type GRETunnelGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON greTunnelGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// greTunnelGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [GRETunnelGetResponseEnvelopeErrors]
+type greTunnelGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *GRETunnelGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r greTunnelGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type GRETunnelGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON greTunnelGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// greTunnelGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [GRETunnelGetResponseEnvelopeMessages]
+type greTunnelGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *GRETunnelGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r greTunnelGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type GRETunnelGetResponseEnvelopeSuccess bool
+
+const (
+ GRETunnelGetResponseEnvelopeSuccessTrue GRETunnelGetResponseEnvelopeSuccess = true
+)
diff --git a/magic_transit/gretunnel_test.go b/magic_transit/gretunnel_test.go
new file mode 100644
index 00000000000..5b2c89f3438
--- /dev/null
+++ b/magic_transit/gretunnel_test.go
@@ -0,0 +1,169 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package magic_transit_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/magic_transit"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestGRETunnelNew(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"),
+ )
+ _, err := client.MagicTransit.GRETunnels.New(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ magic_transit.GRETunnelNewParams{
+ Body: cloudflare.F[any](map[string]interface{}{}),
+ },
+ )
+ 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())
+ }
+}
+
+func TestGRETunnelUpdateWithOptionalParams(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"),
+ )
+ _, err := client.MagicTransit.GRETunnels.Update(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ magic_transit.GRETunnelUpdateParams{
+ CloudflareGREEndpoint: cloudflare.F("203.0.113.1"),
+ CustomerGREEndpoint: cloudflare.F("203.0.113.1"),
+ InterfaceAddress: cloudflare.F("192.0.2.0/31"),
+ Name: cloudflare.F("GRE_1"),
+ Description: cloudflare.F("Tunnel for ISP X"),
+ HealthCheck: cloudflare.F(magic_transit.GRETunnelUpdateParamsHealthCheck{
+ Direction: cloudflare.F(magic_transit.GRETunnelUpdateParamsHealthCheckDirectionBidirectional),
+ Enabled: cloudflare.F(true),
+ Rate: cloudflare.F(magic_transit.GRETunnelUpdateParamsHealthCheckRateLow),
+ Target: cloudflare.F("203.0.113.1"),
+ Type: cloudflare.F(magic_transit.GRETunnelUpdateParamsHealthCheckTypeRequest),
+ }),
+ Mtu: cloudflare.F(int64(0)),
+ TTL: cloudflare.F(int64(0)),
+ },
+ )
+ 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())
+ }
+}
+
+func TestGRETunnelList(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"),
+ )
+ _, err := client.MagicTransit.GRETunnels.List(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353")
+ 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())
+ }
+}
+
+func TestGRETunnelDelete(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"),
+ )
+ _, err := client.MagicTransit.GRETunnels.Delete(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ )
+ 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())
+ }
+}
+
+func TestGRETunnelGet(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"),
+ )
+ _, err := client.MagicTransit.GRETunnels.Get(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ )
+ 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/magic_transit/ipsectunnel.go b/magic_transit/ipsectunnel.go
new file mode 100644
index 00000000000..88da5d376a3
--- /dev/null
+++ b/magic_transit/ipsectunnel.go
@@ -0,0 +1,1191 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package magic_transit
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// IPSECTunnelService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewIPSECTunnelService] method
+// instead.
+type IPSECTunnelService struct {
+ Options []option.RequestOption
+}
+
+// NewIPSECTunnelService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewIPSECTunnelService(opts ...option.RequestOption) (r *IPSECTunnelService) {
+ r = &IPSECTunnelService{}
+ r.Options = opts
+ return
+}
+
+// Creates new IPsec tunnels associated with an account. Use `?validate_only=true`
+// as an optional query parameter to only run validation without persisting
+// changes.
+func (r *IPSECTunnelService) New(ctx context.Context, accountIdentifier string, body IPSECTunnelNewParams, opts ...option.RequestOption) (res *IPSECTunnelNewResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env IPSECTunnelNewResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/magic/ipsec_tunnels", accountIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Updates a specific IPsec tunnel associated with an account. Use
+// `?validate_only=true` as an optional query parameter to only run validation
+// without persisting changes.
+func (r *IPSECTunnelService) Update(ctx context.Context, accountIdentifier string, tunnelIdentifier string, body IPSECTunnelUpdateParams, opts ...option.RequestOption) (res *IPSECTunnelUpdateResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env IPSECTunnelUpdateResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/magic/ipsec_tunnels/%s", accountIdentifier, tunnelIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Lists IPsec tunnels associated with an account.
+func (r *IPSECTunnelService) List(ctx context.Context, accountIdentifier string, opts ...option.RequestOption) (res *IPSECTunnelListResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env IPSECTunnelListResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/magic/ipsec_tunnels", accountIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Disables and removes a specific static IPsec Tunnel associated with an account.
+// Use `?validate_only=true` as an optional query parameter to only run validation
+// without persisting changes.
+func (r *IPSECTunnelService) Delete(ctx context.Context, accountIdentifier string, tunnelIdentifier string, opts ...option.RequestOption) (res *IPSECTunnelDeleteResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env IPSECTunnelDeleteResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/magic/ipsec_tunnels/%s", accountIdentifier, tunnelIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Lists details for a specific IPsec tunnel.
+func (r *IPSECTunnelService) Get(ctx context.Context, accountIdentifier string, tunnelIdentifier string, opts ...option.RequestOption) (res *IPSECTunnelGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env IPSECTunnelGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/magic/ipsec_tunnels/%s", accountIdentifier, tunnelIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Generates a Pre Shared Key for a specific IPsec tunnel used in the IKE session.
+// Use `?validate_only=true` as an optional query parameter to only run validation
+// without persisting changes. After a PSK is generated, the PSK is immediately
+// persisted to Cloudflare's edge and cannot be retrieved later. Note the PSK in a
+// safe place.
+func (r *IPSECTunnelService) PSKGenerate(ctx context.Context, accountIdentifier string, tunnelIdentifier string, opts ...option.RequestOption) (res *IPSECTunnelPSKGenerateResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env IPSECTunnelPSKGenerateResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/magic/ipsec_tunnels/%s/psk_generate", accountIdentifier, tunnelIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type IPSECTunnelNewResponse struct {
+ IPSECTunnels []IPSECTunnelNewResponseIPSECTunnel `json:"ipsec_tunnels"`
+ JSON ipsecTunnelNewResponseJSON `json:"-"`
+}
+
+// ipsecTunnelNewResponseJSON contains the JSON metadata for the struct
+// [IPSECTunnelNewResponse]
+type ipsecTunnelNewResponseJSON struct {
+ IPSECTunnels apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IPSECTunnelNewResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ipsecTunnelNewResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type IPSECTunnelNewResponseIPSECTunnel struct {
+ // The IP address assigned to the Cloudflare side of the IPsec tunnel.
+ CloudflareEndpoint string `json:"cloudflare_endpoint,required"`
+ // A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side
+ // of the tunnel. Select the subnet from the following private IP space:
+ // 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255.
+ InterfaceAddress string `json:"interface_address,required"`
+ // The name of the IPsec tunnel. The name cannot share a name with other tunnels.
+ Name string `json:"name,required"`
+ // Tunnel identifier tag.
+ ID string `json:"id"`
+ // When `true`, the tunnel can use a null-cipher (`ENCR_NULL`) in the ESP tunnel
+ // (Phase 2).
+ AllowNullCipher bool `json:"allow_null_cipher"`
+ // The date and time the tunnel was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // The IP address assigned to the customer side of the IPsec tunnel.
+ CustomerEndpoint string `json:"customer_endpoint"`
+ // An optional description forthe IPsec tunnel.
+ Description string `json:"description"`
+ // The date and time the tunnel was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // The PSK metadata that includes when the PSK was generated.
+ PSKMetadata IPSECTunnelNewResponseIPSECTunnelsPSKMetadata `json:"psk_metadata"`
+ // If `true`, then IPsec replay protection will be supported in the
+ // Cloudflare-to-customer direction.
+ ReplayProtection bool `json:"replay_protection"`
+ TunnelHealthCheck IPSECTunnelNewResponseIPSECTunnelsTunnelHealthCheck `json:"tunnel_health_check"`
+ JSON ipsecTunnelNewResponseIPSECTunnelJSON `json:"-"`
+}
+
+// ipsecTunnelNewResponseIPSECTunnelJSON contains the JSON metadata for the struct
+// [IPSECTunnelNewResponseIPSECTunnel]
+type ipsecTunnelNewResponseIPSECTunnelJSON struct {
+ CloudflareEndpoint apijson.Field
+ InterfaceAddress apijson.Field
+ Name apijson.Field
+ ID apijson.Field
+ AllowNullCipher apijson.Field
+ CreatedOn apijson.Field
+ CustomerEndpoint apijson.Field
+ Description apijson.Field
+ ModifiedOn apijson.Field
+ PSKMetadata apijson.Field
+ ReplayProtection apijson.Field
+ TunnelHealthCheck apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IPSECTunnelNewResponseIPSECTunnel) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ipsecTunnelNewResponseIPSECTunnelJSON) RawJSON() string {
+ return r.raw
+}
+
+// The PSK metadata that includes when the PSK was generated.
+type IPSECTunnelNewResponseIPSECTunnelsPSKMetadata struct {
+ // The date and time the tunnel was last modified.
+ LastGeneratedOn time.Time `json:"last_generated_on" format:"date-time"`
+ JSON ipsecTunnelNewResponseIPSECTunnelsPSKMetadataJSON `json:"-"`
+}
+
+// ipsecTunnelNewResponseIPSECTunnelsPSKMetadataJSON contains the JSON metadata for
+// the struct [IPSECTunnelNewResponseIPSECTunnelsPSKMetadata]
+type ipsecTunnelNewResponseIPSECTunnelsPSKMetadataJSON struct {
+ LastGeneratedOn apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IPSECTunnelNewResponseIPSECTunnelsPSKMetadata) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ipsecTunnelNewResponseIPSECTunnelsPSKMetadataJSON) RawJSON() string {
+ return r.raw
+}
+
+type IPSECTunnelNewResponseIPSECTunnelsTunnelHealthCheck struct {
+ // Determines whether to run healthchecks for a tunnel.
+ Enabled bool `json:"enabled"`
+ // How frequent the health check is run. The default value is `mid`.
+ Rate IPSECTunnelNewResponseIPSECTunnelsTunnelHealthCheckRate `json:"rate"`
+ // The destination address in a request type health check. After the healthcheck is
+ // decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded
+ // to this address. This field defaults to `customer_gre_endpoint address`.
+ Target string `json:"target"`
+ // The type of healthcheck to run, reply or request. The default value is `reply`.
+ Type IPSECTunnelNewResponseIPSECTunnelsTunnelHealthCheckType `json:"type"`
+ JSON ipsecTunnelNewResponseIPSECTunnelsTunnelHealthCheckJSON `json:"-"`
+}
+
+// ipsecTunnelNewResponseIPSECTunnelsTunnelHealthCheckJSON contains the JSON
+// metadata for the struct [IPSECTunnelNewResponseIPSECTunnelsTunnelHealthCheck]
+type ipsecTunnelNewResponseIPSECTunnelsTunnelHealthCheckJSON struct {
+ Enabled apijson.Field
+ Rate apijson.Field
+ Target apijson.Field
+ Type apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IPSECTunnelNewResponseIPSECTunnelsTunnelHealthCheck) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ipsecTunnelNewResponseIPSECTunnelsTunnelHealthCheckJSON) RawJSON() string {
+ return r.raw
+}
+
+// How frequent the health check is run. The default value is `mid`.
+type IPSECTunnelNewResponseIPSECTunnelsTunnelHealthCheckRate string
+
+const (
+ IPSECTunnelNewResponseIPSECTunnelsTunnelHealthCheckRateLow IPSECTunnelNewResponseIPSECTunnelsTunnelHealthCheckRate = "low"
+ IPSECTunnelNewResponseIPSECTunnelsTunnelHealthCheckRateMid IPSECTunnelNewResponseIPSECTunnelsTunnelHealthCheckRate = "mid"
+ IPSECTunnelNewResponseIPSECTunnelsTunnelHealthCheckRateHigh IPSECTunnelNewResponseIPSECTunnelsTunnelHealthCheckRate = "high"
+)
+
+// The type of healthcheck to run, reply or request. The default value is `reply`.
+type IPSECTunnelNewResponseIPSECTunnelsTunnelHealthCheckType string
+
+const (
+ IPSECTunnelNewResponseIPSECTunnelsTunnelHealthCheckTypeReply IPSECTunnelNewResponseIPSECTunnelsTunnelHealthCheckType = "reply"
+ IPSECTunnelNewResponseIPSECTunnelsTunnelHealthCheckTypeRequest IPSECTunnelNewResponseIPSECTunnelsTunnelHealthCheckType = "request"
+)
+
+type IPSECTunnelUpdateResponse struct {
+ Modified bool `json:"modified"`
+ ModifiedIPSECTunnel interface{} `json:"modified_ipsec_tunnel"`
+ JSON ipsecTunnelUpdateResponseJSON `json:"-"`
+}
+
+// ipsecTunnelUpdateResponseJSON contains the JSON metadata for the struct
+// [IPSECTunnelUpdateResponse]
+type ipsecTunnelUpdateResponseJSON struct {
+ Modified apijson.Field
+ ModifiedIPSECTunnel apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IPSECTunnelUpdateResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ipsecTunnelUpdateResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type IPSECTunnelListResponse struct {
+ IPSECTunnels []IPSECTunnelListResponseIPSECTunnel `json:"ipsec_tunnels"`
+ JSON ipsecTunnelListResponseJSON `json:"-"`
+}
+
+// ipsecTunnelListResponseJSON contains the JSON metadata for the struct
+// [IPSECTunnelListResponse]
+type ipsecTunnelListResponseJSON struct {
+ IPSECTunnels apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IPSECTunnelListResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ipsecTunnelListResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type IPSECTunnelListResponseIPSECTunnel struct {
+ // The IP address assigned to the Cloudflare side of the IPsec tunnel.
+ CloudflareEndpoint string `json:"cloudflare_endpoint,required"`
+ // A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side
+ // of the tunnel. Select the subnet from the following private IP space:
+ // 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255.
+ InterfaceAddress string `json:"interface_address,required"`
+ // The name of the IPsec tunnel. The name cannot share a name with other tunnels.
+ Name string `json:"name,required"`
+ // Tunnel identifier tag.
+ ID string `json:"id"`
+ // When `true`, the tunnel can use a null-cipher (`ENCR_NULL`) in the ESP tunnel
+ // (Phase 2).
+ AllowNullCipher bool `json:"allow_null_cipher"`
+ // The date and time the tunnel was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // The IP address assigned to the customer side of the IPsec tunnel.
+ CustomerEndpoint string `json:"customer_endpoint"`
+ // An optional description forthe IPsec tunnel.
+ Description string `json:"description"`
+ // The date and time the tunnel was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // The PSK metadata that includes when the PSK was generated.
+ PSKMetadata IPSECTunnelListResponseIPSECTunnelsPSKMetadata `json:"psk_metadata"`
+ // If `true`, then IPsec replay protection will be supported in the
+ // Cloudflare-to-customer direction.
+ ReplayProtection bool `json:"replay_protection"`
+ TunnelHealthCheck IPSECTunnelListResponseIPSECTunnelsTunnelHealthCheck `json:"tunnel_health_check"`
+ JSON ipsecTunnelListResponseIPSECTunnelJSON `json:"-"`
+}
+
+// ipsecTunnelListResponseIPSECTunnelJSON contains the JSON metadata for the struct
+// [IPSECTunnelListResponseIPSECTunnel]
+type ipsecTunnelListResponseIPSECTunnelJSON struct {
+ CloudflareEndpoint apijson.Field
+ InterfaceAddress apijson.Field
+ Name apijson.Field
+ ID apijson.Field
+ AllowNullCipher apijson.Field
+ CreatedOn apijson.Field
+ CustomerEndpoint apijson.Field
+ Description apijson.Field
+ ModifiedOn apijson.Field
+ PSKMetadata apijson.Field
+ ReplayProtection apijson.Field
+ TunnelHealthCheck apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IPSECTunnelListResponseIPSECTunnel) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ipsecTunnelListResponseIPSECTunnelJSON) RawJSON() string {
+ return r.raw
+}
+
+// The PSK metadata that includes when the PSK was generated.
+type IPSECTunnelListResponseIPSECTunnelsPSKMetadata struct {
+ // The date and time the tunnel was last modified.
+ LastGeneratedOn time.Time `json:"last_generated_on" format:"date-time"`
+ JSON ipsecTunnelListResponseIPSECTunnelsPSKMetadataJSON `json:"-"`
+}
+
+// ipsecTunnelListResponseIPSECTunnelsPSKMetadataJSON contains the JSON metadata
+// for the struct [IPSECTunnelListResponseIPSECTunnelsPSKMetadata]
+type ipsecTunnelListResponseIPSECTunnelsPSKMetadataJSON struct {
+ LastGeneratedOn apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IPSECTunnelListResponseIPSECTunnelsPSKMetadata) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ipsecTunnelListResponseIPSECTunnelsPSKMetadataJSON) RawJSON() string {
+ return r.raw
+}
+
+type IPSECTunnelListResponseIPSECTunnelsTunnelHealthCheck struct {
+ // Determines whether to run healthchecks for a tunnel.
+ Enabled bool `json:"enabled"`
+ // How frequent the health check is run. The default value is `mid`.
+ Rate IPSECTunnelListResponseIPSECTunnelsTunnelHealthCheckRate `json:"rate"`
+ // The destination address in a request type health check. After the healthcheck is
+ // decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded
+ // to this address. This field defaults to `customer_gre_endpoint address`.
+ Target string `json:"target"`
+ // The type of healthcheck to run, reply or request. The default value is `reply`.
+ Type IPSECTunnelListResponseIPSECTunnelsTunnelHealthCheckType `json:"type"`
+ JSON ipsecTunnelListResponseIPSECTunnelsTunnelHealthCheckJSON `json:"-"`
+}
+
+// ipsecTunnelListResponseIPSECTunnelsTunnelHealthCheckJSON contains the JSON
+// metadata for the struct [IPSECTunnelListResponseIPSECTunnelsTunnelHealthCheck]
+type ipsecTunnelListResponseIPSECTunnelsTunnelHealthCheckJSON struct {
+ Enabled apijson.Field
+ Rate apijson.Field
+ Target apijson.Field
+ Type apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IPSECTunnelListResponseIPSECTunnelsTunnelHealthCheck) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ipsecTunnelListResponseIPSECTunnelsTunnelHealthCheckJSON) RawJSON() string {
+ return r.raw
+}
+
+// How frequent the health check is run. The default value is `mid`.
+type IPSECTunnelListResponseIPSECTunnelsTunnelHealthCheckRate string
+
+const (
+ IPSECTunnelListResponseIPSECTunnelsTunnelHealthCheckRateLow IPSECTunnelListResponseIPSECTunnelsTunnelHealthCheckRate = "low"
+ IPSECTunnelListResponseIPSECTunnelsTunnelHealthCheckRateMid IPSECTunnelListResponseIPSECTunnelsTunnelHealthCheckRate = "mid"
+ IPSECTunnelListResponseIPSECTunnelsTunnelHealthCheckRateHigh IPSECTunnelListResponseIPSECTunnelsTunnelHealthCheckRate = "high"
+)
+
+// The type of healthcheck to run, reply or request. The default value is `reply`.
+type IPSECTunnelListResponseIPSECTunnelsTunnelHealthCheckType string
+
+const (
+ IPSECTunnelListResponseIPSECTunnelsTunnelHealthCheckTypeReply IPSECTunnelListResponseIPSECTunnelsTunnelHealthCheckType = "reply"
+ IPSECTunnelListResponseIPSECTunnelsTunnelHealthCheckTypeRequest IPSECTunnelListResponseIPSECTunnelsTunnelHealthCheckType = "request"
+)
+
+type IPSECTunnelDeleteResponse struct {
+ Deleted bool `json:"deleted"`
+ DeletedIPSECTunnel interface{} `json:"deleted_ipsec_tunnel"`
+ JSON ipsecTunnelDeleteResponseJSON `json:"-"`
+}
+
+// ipsecTunnelDeleteResponseJSON contains the JSON metadata for the struct
+// [IPSECTunnelDeleteResponse]
+type ipsecTunnelDeleteResponseJSON struct {
+ Deleted apijson.Field
+ DeletedIPSECTunnel apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IPSECTunnelDeleteResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ipsecTunnelDeleteResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type IPSECTunnelGetResponse struct {
+ IPSECTunnel interface{} `json:"ipsec_tunnel"`
+ JSON ipsecTunnelGetResponseJSON `json:"-"`
+}
+
+// ipsecTunnelGetResponseJSON contains the JSON metadata for the struct
+// [IPSECTunnelGetResponse]
+type ipsecTunnelGetResponseJSON struct {
+ IPSECTunnel apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IPSECTunnelGetResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ipsecTunnelGetResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type IPSECTunnelPSKGenerateResponse struct {
+ // Identifier
+ IPSECTunnelID string `json:"ipsec_tunnel_id"`
+ // A randomly generated or provided string for use in the IPsec tunnel.
+ PSK string `json:"psk"`
+ // The PSK metadata that includes when the PSK was generated.
+ PSKMetadata IPSECTunnelPSKGenerateResponsePSKMetadata `json:"psk_metadata"`
+ JSON ipsecTunnelPSKGenerateResponseJSON `json:"-"`
+}
+
+// ipsecTunnelPSKGenerateResponseJSON contains the JSON metadata for the struct
+// [IPSECTunnelPSKGenerateResponse]
+type ipsecTunnelPSKGenerateResponseJSON struct {
+ IPSECTunnelID apijson.Field
+ PSK apijson.Field
+ PSKMetadata apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IPSECTunnelPSKGenerateResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ipsecTunnelPSKGenerateResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+// The PSK metadata that includes when the PSK was generated.
+type IPSECTunnelPSKGenerateResponsePSKMetadata struct {
+ // The date and time the tunnel was last modified.
+ LastGeneratedOn time.Time `json:"last_generated_on" format:"date-time"`
+ JSON ipsecTunnelPSKGenerateResponsePSKMetadataJSON `json:"-"`
+}
+
+// ipsecTunnelPSKGenerateResponsePSKMetadataJSON contains the JSON metadata for the
+// struct [IPSECTunnelPSKGenerateResponsePSKMetadata]
+type ipsecTunnelPSKGenerateResponsePSKMetadataJSON struct {
+ LastGeneratedOn apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IPSECTunnelPSKGenerateResponsePSKMetadata) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ipsecTunnelPSKGenerateResponsePSKMetadataJSON) RawJSON() string {
+ return r.raw
+}
+
+type IPSECTunnelNewParams struct {
+ // The IP address assigned to the Cloudflare side of the IPsec tunnel.
+ CloudflareEndpoint param.Field[string] `json:"cloudflare_endpoint,required"`
+ // A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side
+ // of the tunnel. Select the subnet from the following private IP space:
+ // 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255.
+ InterfaceAddress param.Field[string] `json:"interface_address,required"`
+ // The name of the IPsec tunnel. The name cannot share a name with other tunnels.
+ Name param.Field[string] `json:"name,required"`
+ // The IP address assigned to the customer side of the IPsec tunnel.
+ CustomerEndpoint param.Field[string] `json:"customer_endpoint"`
+ // An optional description forthe IPsec tunnel.
+ Description param.Field[string] `json:"description"`
+ HealthCheck param.Field[IPSECTunnelNewParamsHealthCheck] `json:"health_check"`
+ // A randomly generated or provided string for use in the IPsec tunnel.
+ PSK param.Field[string] `json:"psk"`
+ // If `true`, then IPsec replay protection will be supported in the
+ // Cloudflare-to-customer direction.
+ ReplayProtection param.Field[bool] `json:"replay_protection"`
+}
+
+func (r IPSECTunnelNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type IPSECTunnelNewParamsHealthCheck struct {
+ // The direction of the flow of the healthcheck. Either unidirectional, where the
+ // probe comes to you via the tunnel and the result comes back to Cloudflare via
+ // the open Internet, or bidirectional where both the probe and result come and go
+ // via the tunnel. Note in the case of bidirecitonal healthchecks, the target field
+ // in health_check is ignored as the interface_address is used to send traffic into
+ // the tunnel.
+ Direction param.Field[IPSECTunnelNewParamsHealthCheckDirection] `json:"direction"`
+ // Determines whether to run healthchecks for a tunnel.
+ Enabled param.Field[bool] `json:"enabled"`
+ // How frequent the health check is run. The default value is `mid`.
+ Rate param.Field[IPSECTunnelNewParamsHealthCheckRate] `json:"rate"`
+ // The destination address in a request type health check. After the healthcheck is
+ // decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded
+ // to this address. This field defaults to `customer_gre_endpoint address`. This
+ // field is ignored for bidirectional healthchecks as the interface_address (not
+ // assigned to the Cloudflare side of the tunnel) is used as the target.
+ Target param.Field[string] `json:"target"`
+ // The type of healthcheck to run, reply or request. The default value is `reply`.
+ Type param.Field[IPSECTunnelNewParamsHealthCheckType] `json:"type"`
+}
+
+func (r IPSECTunnelNewParamsHealthCheck) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The direction of the flow of the healthcheck. Either unidirectional, where the
+// probe comes to you via the tunnel and the result comes back to Cloudflare via
+// the open Internet, or bidirectional where both the probe and result come and go
+// via the tunnel. Note in the case of bidirecitonal healthchecks, the target field
+// in health_check is ignored as the interface_address is used to send traffic into
+// the tunnel.
+type IPSECTunnelNewParamsHealthCheckDirection string
+
+const (
+ IPSECTunnelNewParamsHealthCheckDirectionUnidirectional IPSECTunnelNewParamsHealthCheckDirection = "unidirectional"
+ IPSECTunnelNewParamsHealthCheckDirectionBidirectional IPSECTunnelNewParamsHealthCheckDirection = "bidirectional"
+)
+
+// How frequent the health check is run. The default value is `mid`.
+type IPSECTunnelNewParamsHealthCheckRate string
+
+const (
+ IPSECTunnelNewParamsHealthCheckRateLow IPSECTunnelNewParamsHealthCheckRate = "low"
+ IPSECTunnelNewParamsHealthCheckRateMid IPSECTunnelNewParamsHealthCheckRate = "mid"
+ IPSECTunnelNewParamsHealthCheckRateHigh IPSECTunnelNewParamsHealthCheckRate = "high"
+)
+
+// The type of healthcheck to run, reply or request. The default value is `reply`.
+type IPSECTunnelNewParamsHealthCheckType string
+
+const (
+ IPSECTunnelNewParamsHealthCheckTypeReply IPSECTunnelNewParamsHealthCheckType = "reply"
+ IPSECTunnelNewParamsHealthCheckTypeRequest IPSECTunnelNewParamsHealthCheckType = "request"
+)
+
+type IPSECTunnelNewResponseEnvelope struct {
+ Errors []IPSECTunnelNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []IPSECTunnelNewResponseEnvelopeMessages `json:"messages,required"`
+ Result IPSECTunnelNewResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success IPSECTunnelNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON ipsecTunnelNewResponseEnvelopeJSON `json:"-"`
+}
+
+// ipsecTunnelNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [IPSECTunnelNewResponseEnvelope]
+type ipsecTunnelNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IPSECTunnelNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ipsecTunnelNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type IPSECTunnelNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON ipsecTunnelNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// ipsecTunnelNewResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [IPSECTunnelNewResponseEnvelopeErrors]
+type ipsecTunnelNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IPSECTunnelNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ipsecTunnelNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type IPSECTunnelNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON ipsecTunnelNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// ipsecTunnelNewResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [IPSECTunnelNewResponseEnvelopeMessages]
+type ipsecTunnelNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IPSECTunnelNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ipsecTunnelNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type IPSECTunnelNewResponseEnvelopeSuccess bool
+
+const (
+ IPSECTunnelNewResponseEnvelopeSuccessTrue IPSECTunnelNewResponseEnvelopeSuccess = true
+)
+
+type IPSECTunnelUpdateParams struct {
+ // The IP address assigned to the Cloudflare side of the IPsec tunnel.
+ CloudflareEndpoint param.Field[string] `json:"cloudflare_endpoint,required"`
+ // A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side
+ // of the tunnel. Select the subnet from the following private IP space:
+ // 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255.
+ InterfaceAddress param.Field[string] `json:"interface_address,required"`
+ // The name of the IPsec tunnel. The name cannot share a name with other tunnels.
+ Name param.Field[string] `json:"name,required"`
+ // The IP address assigned to the customer side of the IPsec tunnel.
+ CustomerEndpoint param.Field[string] `json:"customer_endpoint"`
+ // An optional description forthe IPsec tunnel.
+ Description param.Field[string] `json:"description"`
+ HealthCheck param.Field[IPSECTunnelUpdateParamsHealthCheck] `json:"health_check"`
+ // A randomly generated or provided string for use in the IPsec tunnel.
+ PSK param.Field[string] `json:"psk"`
+ // If `true`, then IPsec replay protection will be supported in the
+ // Cloudflare-to-customer direction.
+ ReplayProtection param.Field[bool] `json:"replay_protection"`
+}
+
+func (r IPSECTunnelUpdateParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type IPSECTunnelUpdateParamsHealthCheck struct {
+ // The direction of the flow of the healthcheck. Either unidirectional, where the
+ // probe comes to you via the tunnel and the result comes back to Cloudflare via
+ // the open Internet, or bidirectional where both the probe and result come and go
+ // via the tunnel. Note in the case of bidirecitonal healthchecks, the target field
+ // in health_check is ignored as the interface_address is used to send traffic into
+ // the tunnel.
+ Direction param.Field[IPSECTunnelUpdateParamsHealthCheckDirection] `json:"direction"`
+ // Determines whether to run healthchecks for a tunnel.
+ Enabled param.Field[bool] `json:"enabled"`
+ // How frequent the health check is run. The default value is `mid`.
+ Rate param.Field[IPSECTunnelUpdateParamsHealthCheckRate] `json:"rate"`
+ // The destination address in a request type health check. After the healthcheck is
+ // decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded
+ // to this address. This field defaults to `customer_gre_endpoint address`. This
+ // field is ignored for bidirectional healthchecks as the interface_address (not
+ // assigned to the Cloudflare side of the tunnel) is used as the target.
+ Target param.Field[string] `json:"target"`
+ // The type of healthcheck to run, reply or request. The default value is `reply`.
+ Type param.Field[IPSECTunnelUpdateParamsHealthCheckType] `json:"type"`
+}
+
+func (r IPSECTunnelUpdateParamsHealthCheck) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The direction of the flow of the healthcheck. Either unidirectional, where the
+// probe comes to you via the tunnel and the result comes back to Cloudflare via
+// the open Internet, or bidirectional where both the probe and result come and go
+// via the tunnel. Note in the case of bidirecitonal healthchecks, the target field
+// in health_check is ignored as the interface_address is used to send traffic into
+// the tunnel.
+type IPSECTunnelUpdateParamsHealthCheckDirection string
+
+const (
+ IPSECTunnelUpdateParamsHealthCheckDirectionUnidirectional IPSECTunnelUpdateParamsHealthCheckDirection = "unidirectional"
+ IPSECTunnelUpdateParamsHealthCheckDirectionBidirectional IPSECTunnelUpdateParamsHealthCheckDirection = "bidirectional"
+)
+
+// How frequent the health check is run. The default value is `mid`.
+type IPSECTunnelUpdateParamsHealthCheckRate string
+
+const (
+ IPSECTunnelUpdateParamsHealthCheckRateLow IPSECTunnelUpdateParamsHealthCheckRate = "low"
+ IPSECTunnelUpdateParamsHealthCheckRateMid IPSECTunnelUpdateParamsHealthCheckRate = "mid"
+ IPSECTunnelUpdateParamsHealthCheckRateHigh IPSECTunnelUpdateParamsHealthCheckRate = "high"
+)
+
+// The type of healthcheck to run, reply or request. The default value is `reply`.
+type IPSECTunnelUpdateParamsHealthCheckType string
+
+const (
+ IPSECTunnelUpdateParamsHealthCheckTypeReply IPSECTunnelUpdateParamsHealthCheckType = "reply"
+ IPSECTunnelUpdateParamsHealthCheckTypeRequest IPSECTunnelUpdateParamsHealthCheckType = "request"
+)
+
+type IPSECTunnelUpdateResponseEnvelope struct {
+ Errors []IPSECTunnelUpdateResponseEnvelopeErrors `json:"errors,required"`
+ Messages []IPSECTunnelUpdateResponseEnvelopeMessages `json:"messages,required"`
+ Result IPSECTunnelUpdateResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success IPSECTunnelUpdateResponseEnvelopeSuccess `json:"success,required"`
+ JSON ipsecTunnelUpdateResponseEnvelopeJSON `json:"-"`
+}
+
+// ipsecTunnelUpdateResponseEnvelopeJSON contains the JSON metadata for the struct
+// [IPSECTunnelUpdateResponseEnvelope]
+type ipsecTunnelUpdateResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IPSECTunnelUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ipsecTunnelUpdateResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type IPSECTunnelUpdateResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON ipsecTunnelUpdateResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// ipsecTunnelUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [IPSECTunnelUpdateResponseEnvelopeErrors]
+type ipsecTunnelUpdateResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IPSECTunnelUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ipsecTunnelUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type IPSECTunnelUpdateResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON ipsecTunnelUpdateResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// ipsecTunnelUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [IPSECTunnelUpdateResponseEnvelopeMessages]
+type ipsecTunnelUpdateResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IPSECTunnelUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ipsecTunnelUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type IPSECTunnelUpdateResponseEnvelopeSuccess bool
+
+const (
+ IPSECTunnelUpdateResponseEnvelopeSuccessTrue IPSECTunnelUpdateResponseEnvelopeSuccess = true
+)
+
+type IPSECTunnelListResponseEnvelope struct {
+ Errors []IPSECTunnelListResponseEnvelopeErrors `json:"errors,required"`
+ Messages []IPSECTunnelListResponseEnvelopeMessages `json:"messages,required"`
+ Result IPSECTunnelListResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success IPSECTunnelListResponseEnvelopeSuccess `json:"success,required"`
+ JSON ipsecTunnelListResponseEnvelopeJSON `json:"-"`
+}
+
+// ipsecTunnelListResponseEnvelopeJSON contains the JSON metadata for the struct
+// [IPSECTunnelListResponseEnvelope]
+type ipsecTunnelListResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IPSECTunnelListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ipsecTunnelListResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type IPSECTunnelListResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON ipsecTunnelListResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// ipsecTunnelListResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [IPSECTunnelListResponseEnvelopeErrors]
+type ipsecTunnelListResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IPSECTunnelListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ipsecTunnelListResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type IPSECTunnelListResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON ipsecTunnelListResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// ipsecTunnelListResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [IPSECTunnelListResponseEnvelopeMessages]
+type ipsecTunnelListResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IPSECTunnelListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ipsecTunnelListResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type IPSECTunnelListResponseEnvelopeSuccess bool
+
+const (
+ IPSECTunnelListResponseEnvelopeSuccessTrue IPSECTunnelListResponseEnvelopeSuccess = true
+)
+
+type IPSECTunnelDeleteResponseEnvelope struct {
+ Errors []IPSECTunnelDeleteResponseEnvelopeErrors `json:"errors,required"`
+ Messages []IPSECTunnelDeleteResponseEnvelopeMessages `json:"messages,required"`
+ Result IPSECTunnelDeleteResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success IPSECTunnelDeleteResponseEnvelopeSuccess `json:"success,required"`
+ JSON ipsecTunnelDeleteResponseEnvelopeJSON `json:"-"`
+}
+
+// ipsecTunnelDeleteResponseEnvelopeJSON contains the JSON metadata for the struct
+// [IPSECTunnelDeleteResponseEnvelope]
+type ipsecTunnelDeleteResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IPSECTunnelDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ipsecTunnelDeleteResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type IPSECTunnelDeleteResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON ipsecTunnelDeleteResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// ipsecTunnelDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [IPSECTunnelDeleteResponseEnvelopeErrors]
+type ipsecTunnelDeleteResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IPSECTunnelDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ipsecTunnelDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type IPSECTunnelDeleteResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON ipsecTunnelDeleteResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// ipsecTunnelDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [IPSECTunnelDeleteResponseEnvelopeMessages]
+type ipsecTunnelDeleteResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IPSECTunnelDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ipsecTunnelDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type IPSECTunnelDeleteResponseEnvelopeSuccess bool
+
+const (
+ IPSECTunnelDeleteResponseEnvelopeSuccessTrue IPSECTunnelDeleteResponseEnvelopeSuccess = true
+)
+
+type IPSECTunnelGetResponseEnvelope struct {
+ Errors []IPSECTunnelGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []IPSECTunnelGetResponseEnvelopeMessages `json:"messages,required"`
+ Result IPSECTunnelGetResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success IPSECTunnelGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON ipsecTunnelGetResponseEnvelopeJSON `json:"-"`
+}
+
+// ipsecTunnelGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [IPSECTunnelGetResponseEnvelope]
+type ipsecTunnelGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IPSECTunnelGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ipsecTunnelGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type IPSECTunnelGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON ipsecTunnelGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// ipsecTunnelGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [IPSECTunnelGetResponseEnvelopeErrors]
+type ipsecTunnelGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IPSECTunnelGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ipsecTunnelGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type IPSECTunnelGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON ipsecTunnelGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// ipsecTunnelGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [IPSECTunnelGetResponseEnvelopeMessages]
+type ipsecTunnelGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IPSECTunnelGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ipsecTunnelGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type IPSECTunnelGetResponseEnvelopeSuccess bool
+
+const (
+ IPSECTunnelGetResponseEnvelopeSuccessTrue IPSECTunnelGetResponseEnvelopeSuccess = true
+)
+
+type IPSECTunnelPSKGenerateResponseEnvelope struct {
+ Errors []IPSECTunnelPSKGenerateResponseEnvelopeErrors `json:"errors,required"`
+ Messages []IPSECTunnelPSKGenerateResponseEnvelopeMessages `json:"messages,required"`
+ Result IPSECTunnelPSKGenerateResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success IPSECTunnelPSKGenerateResponseEnvelopeSuccess `json:"success,required"`
+ JSON ipsecTunnelPSKGenerateResponseEnvelopeJSON `json:"-"`
+}
+
+// ipsecTunnelPSKGenerateResponseEnvelopeJSON contains the JSON metadata for the
+// struct [IPSECTunnelPSKGenerateResponseEnvelope]
+type ipsecTunnelPSKGenerateResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IPSECTunnelPSKGenerateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ipsecTunnelPSKGenerateResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type IPSECTunnelPSKGenerateResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON ipsecTunnelPSKGenerateResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// ipsecTunnelPSKGenerateResponseEnvelopeErrorsJSON contains the JSON metadata for
+// the struct [IPSECTunnelPSKGenerateResponseEnvelopeErrors]
+type ipsecTunnelPSKGenerateResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IPSECTunnelPSKGenerateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ipsecTunnelPSKGenerateResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type IPSECTunnelPSKGenerateResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON ipsecTunnelPSKGenerateResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// ipsecTunnelPSKGenerateResponseEnvelopeMessagesJSON contains the JSON metadata
+// for the struct [IPSECTunnelPSKGenerateResponseEnvelopeMessages]
+type ipsecTunnelPSKGenerateResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IPSECTunnelPSKGenerateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ipsecTunnelPSKGenerateResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type IPSECTunnelPSKGenerateResponseEnvelopeSuccess bool
+
+const (
+ IPSECTunnelPSKGenerateResponseEnvelopeSuccessTrue IPSECTunnelPSKGenerateResponseEnvelopeSuccess = true
+)
diff --git a/magic_transit/ipsectunnel_test.go b/magic_transit/ipsectunnel_test.go
new file mode 100644
index 00000000000..766eb54713d
--- /dev/null
+++ b/magic_transit/ipsectunnel_test.go
@@ -0,0 +1,210 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package magic_transit_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/magic_transit"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestIPSECTunnelNewWithOptionalParams(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"),
+ )
+ _, err := client.MagicTransit.IPSECTunnels.New(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ magic_transit.IPSECTunnelNewParams{
+ CloudflareEndpoint: cloudflare.F("203.0.113.1"),
+ InterfaceAddress: cloudflare.F("192.0.2.0/31"),
+ Name: cloudflare.F("IPsec_1"),
+ CustomerEndpoint: cloudflare.F("203.0.113.1"),
+ Description: cloudflare.F("Tunnel for ISP X"),
+ HealthCheck: cloudflare.F(magic_transit.IPSECTunnelNewParamsHealthCheck{
+ Direction: cloudflare.F(magic_transit.IPSECTunnelNewParamsHealthCheckDirectionBidirectional),
+ Enabled: cloudflare.F(true),
+ Rate: cloudflare.F(magic_transit.IPSECTunnelNewParamsHealthCheckRateLow),
+ Target: cloudflare.F("203.0.113.1"),
+ Type: cloudflare.F(magic_transit.IPSECTunnelNewParamsHealthCheckTypeRequest),
+ }),
+ PSK: cloudflare.F("O3bwKSjnaoCxDoUxjcq4Rk8ZKkezQUiy"),
+ ReplayProtection: cloudflare.F(false),
+ },
+ )
+ 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())
+ }
+}
+
+func TestIPSECTunnelUpdateWithOptionalParams(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"),
+ )
+ _, err := client.MagicTransit.IPSECTunnels.Update(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ magic_transit.IPSECTunnelUpdateParams{
+ CloudflareEndpoint: cloudflare.F("203.0.113.1"),
+ InterfaceAddress: cloudflare.F("192.0.2.0/31"),
+ Name: cloudflare.F("IPsec_1"),
+ CustomerEndpoint: cloudflare.F("203.0.113.1"),
+ Description: cloudflare.F("Tunnel for ISP X"),
+ HealthCheck: cloudflare.F(magic_transit.IPSECTunnelUpdateParamsHealthCheck{
+ Direction: cloudflare.F(magic_transit.IPSECTunnelUpdateParamsHealthCheckDirectionBidirectional),
+ Enabled: cloudflare.F(true),
+ Rate: cloudflare.F(magic_transit.IPSECTunnelUpdateParamsHealthCheckRateLow),
+ Target: cloudflare.F("203.0.113.1"),
+ Type: cloudflare.F(magic_transit.IPSECTunnelUpdateParamsHealthCheckTypeRequest),
+ }),
+ PSK: cloudflare.F("O3bwKSjnaoCxDoUxjcq4Rk8ZKkezQUiy"),
+ ReplayProtection: cloudflare.F(false),
+ },
+ )
+ 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())
+ }
+}
+
+func TestIPSECTunnelList(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"),
+ )
+ _, err := client.MagicTransit.IPSECTunnels.List(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353")
+ 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())
+ }
+}
+
+func TestIPSECTunnelDelete(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"),
+ )
+ _, err := client.MagicTransit.IPSECTunnels.Delete(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ )
+ 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())
+ }
+}
+
+func TestIPSECTunnelGet(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"),
+ )
+ _, err := client.MagicTransit.IPSECTunnels.Get(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ )
+ 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())
+ }
+}
+
+func TestIPSECTunnelPSKGenerate(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"),
+ )
+ _, err := client.MagicTransit.IPSECTunnels.PSKGenerate(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ )
+ 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/magic_transit/magictransit.go b/magic_transit/magictransit.go
new file mode 100644
index 00000000000..0f71406e6d7
--- /dev/null
+++ b/magic_transit/magictransit.go
@@ -0,0 +1,33 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package magic_transit
+
+import (
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// MagicTransitService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewMagicTransitService] method
+// instead.
+type MagicTransitService struct {
+ Options []option.RequestOption
+ CfInterconnects *CfInterconnectService
+ GRETunnels *GRETunnelService
+ IPSECTunnels *IPSECTunnelService
+ Routes *RouteService
+}
+
+// NewMagicTransitService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewMagicTransitService(opts ...option.RequestOption) (r *MagicTransitService) {
+ r = &MagicTransitService{}
+ r.Options = opts
+ r.CfInterconnects = NewCfInterconnectService(opts...)
+ r.GRETunnels = NewGRETunnelService(opts...)
+ r.IPSECTunnels = NewIPSECTunnelService(opts...)
+ r.Routes = NewRouteService(opts...)
+ return
+}
diff --git a/magic_transit/route.go b/magic_transit/route.go
new file mode 100644
index 00000000000..55f8ab49ad6
--- /dev/null
+++ b/magic_transit/route.go
@@ -0,0 +1,928 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package magic_transit
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// RouteService contains methods and other services that help with interacting with
+// the cloudflare API. Note, unlike clients, this service does not read variables
+// from the environment automatically. You should not instantiate this service
+// directly, and instead use the [NewRouteService] method instead.
+type RouteService struct {
+ Options []option.RequestOption
+}
+
+// NewRouteService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewRouteService(opts ...option.RequestOption) (r *RouteService) {
+ r = &RouteService{}
+ r.Options = opts
+ return
+}
+
+// Creates a new Magic static route. Use `?validate_only=true` as an optional query
+// parameter to run validation only without persisting changes.
+func (r *RouteService) New(ctx context.Context, accountIdentifier string, body RouteNewParams, opts ...option.RequestOption) (res *RouteNewResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RouteNewResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/magic/routes", accountIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Update a specific Magic static route. Use `?validate_only=true` as an optional
+// query parameter to run validation only without persisting changes.
+func (r *RouteService) Update(ctx context.Context, accountIdentifier string, routeIdentifier string, body RouteUpdateParams, opts ...option.RequestOption) (res *RouteUpdateResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RouteUpdateResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/magic/routes/%s", accountIdentifier, routeIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// List all Magic static routes.
+func (r *RouteService) List(ctx context.Context, accountIdentifier string, opts ...option.RequestOption) (res *RouteListResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RouteListResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/magic/routes", accountIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Disable and remove a specific Magic static route.
+func (r *RouteService) Delete(ctx context.Context, accountIdentifier string, routeIdentifier string, opts ...option.RequestOption) (res *RouteDeleteResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RouteDeleteResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/magic/routes/%s", accountIdentifier, routeIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Delete multiple Magic static routes.
+func (r *RouteService) Empty(ctx context.Context, accountIdentifier string, body RouteEmptyParams, opts ...option.RequestOption) (res *RouteEmptyResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RouteEmptyResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/magic/routes", accountIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Get a specific Magic static route.
+func (r *RouteService) Get(ctx context.Context, accountIdentifier string, routeIdentifier string, opts ...option.RequestOption) (res *RouteGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RouteGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/magic/routes/%s", accountIdentifier, routeIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type RouteNewResponse struct {
+ Routes []RouteNewResponseRoute `json:"routes"`
+ JSON routeNewResponseJSON `json:"-"`
+}
+
+// routeNewResponseJSON contains the JSON metadata for the struct
+// [RouteNewResponse]
+type routeNewResponseJSON struct {
+ Routes apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RouteNewResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routeNewResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type RouteNewResponseRoute struct {
+ // The next-hop IP Address for the static route.
+ Nexthop string `json:"nexthop,required"`
+ // IP Prefix in Classless Inter-Domain Routing format.
+ Prefix string `json:"prefix,required"`
+ // Priority of the static route.
+ Priority int64 `json:"priority,required"`
+ // Identifier
+ ID string `json:"id"`
+ // When the route was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // An optional human provided description of the static route.
+ Description string `json:"description"`
+ // When the route was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Used only for ECMP routes.
+ Scope RouteNewResponseRoutesScope `json:"scope"`
+ // Optional weight of the ECMP scope - if provided.
+ Weight int64 `json:"weight"`
+ JSON routeNewResponseRouteJSON `json:"-"`
+}
+
+// routeNewResponseRouteJSON contains the JSON metadata for the struct
+// [RouteNewResponseRoute]
+type routeNewResponseRouteJSON struct {
+ Nexthop apijson.Field
+ Prefix apijson.Field
+ Priority apijson.Field
+ ID apijson.Field
+ CreatedOn apijson.Field
+ Description apijson.Field
+ ModifiedOn apijson.Field
+ Scope apijson.Field
+ Weight apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RouteNewResponseRoute) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routeNewResponseRouteJSON) RawJSON() string {
+ return r.raw
+}
+
+// Used only for ECMP routes.
+type RouteNewResponseRoutesScope struct {
+ // List of colo names for the ECMP scope.
+ ColoNames []string `json:"colo_names"`
+ // List of colo regions for the ECMP scope.
+ ColoRegions []string `json:"colo_regions"`
+ JSON routeNewResponseRoutesScopeJSON `json:"-"`
+}
+
+// routeNewResponseRoutesScopeJSON contains the JSON metadata for the struct
+// [RouteNewResponseRoutesScope]
+type routeNewResponseRoutesScopeJSON struct {
+ ColoNames apijson.Field
+ ColoRegions apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RouteNewResponseRoutesScope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routeNewResponseRoutesScopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type RouteUpdateResponse struct {
+ Modified bool `json:"modified"`
+ ModifiedRoute interface{} `json:"modified_route"`
+ JSON routeUpdateResponseJSON `json:"-"`
+}
+
+// routeUpdateResponseJSON contains the JSON metadata for the struct
+// [RouteUpdateResponse]
+type routeUpdateResponseJSON struct {
+ Modified apijson.Field
+ ModifiedRoute apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RouteUpdateResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routeUpdateResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type RouteListResponse struct {
+ Routes []RouteListResponseRoute `json:"routes"`
+ JSON routeListResponseJSON `json:"-"`
+}
+
+// routeListResponseJSON contains the JSON metadata for the struct
+// [RouteListResponse]
+type routeListResponseJSON struct {
+ Routes apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RouteListResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routeListResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type RouteListResponseRoute struct {
+ // The next-hop IP Address for the static route.
+ Nexthop string `json:"nexthop,required"`
+ // IP Prefix in Classless Inter-Domain Routing format.
+ Prefix string `json:"prefix,required"`
+ // Priority of the static route.
+ Priority int64 `json:"priority,required"`
+ // Identifier
+ ID string `json:"id"`
+ // When the route was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // An optional human provided description of the static route.
+ Description string `json:"description"`
+ // When the route was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Used only for ECMP routes.
+ Scope RouteListResponseRoutesScope `json:"scope"`
+ // Optional weight of the ECMP scope - if provided.
+ Weight int64 `json:"weight"`
+ JSON routeListResponseRouteJSON `json:"-"`
+}
+
+// routeListResponseRouteJSON contains the JSON metadata for the struct
+// [RouteListResponseRoute]
+type routeListResponseRouteJSON struct {
+ Nexthop apijson.Field
+ Prefix apijson.Field
+ Priority apijson.Field
+ ID apijson.Field
+ CreatedOn apijson.Field
+ Description apijson.Field
+ ModifiedOn apijson.Field
+ Scope apijson.Field
+ Weight apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RouteListResponseRoute) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routeListResponseRouteJSON) RawJSON() string {
+ return r.raw
+}
+
+// Used only for ECMP routes.
+type RouteListResponseRoutesScope struct {
+ // List of colo names for the ECMP scope.
+ ColoNames []string `json:"colo_names"`
+ // List of colo regions for the ECMP scope.
+ ColoRegions []string `json:"colo_regions"`
+ JSON routeListResponseRoutesScopeJSON `json:"-"`
+}
+
+// routeListResponseRoutesScopeJSON contains the JSON metadata for the struct
+// [RouteListResponseRoutesScope]
+type routeListResponseRoutesScopeJSON struct {
+ ColoNames apijson.Field
+ ColoRegions apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RouteListResponseRoutesScope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routeListResponseRoutesScopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type RouteDeleteResponse struct {
+ Deleted bool `json:"deleted"`
+ DeletedRoute interface{} `json:"deleted_route"`
+ JSON routeDeleteResponseJSON `json:"-"`
+}
+
+// routeDeleteResponseJSON contains the JSON metadata for the struct
+// [RouteDeleteResponse]
+type routeDeleteResponseJSON struct {
+ Deleted apijson.Field
+ DeletedRoute apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RouteDeleteResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routeDeleteResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type RouteEmptyResponse struct {
+ Deleted bool `json:"deleted"`
+ DeletedRoutes interface{} `json:"deleted_routes"`
+ JSON routeEmptyResponseJSON `json:"-"`
+}
+
+// routeEmptyResponseJSON contains the JSON metadata for the struct
+// [RouteEmptyResponse]
+type routeEmptyResponseJSON struct {
+ Deleted apijson.Field
+ DeletedRoutes apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RouteEmptyResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routeEmptyResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type RouteGetResponse struct {
+ Route interface{} `json:"route"`
+ JSON routeGetResponseJSON `json:"-"`
+}
+
+// routeGetResponseJSON contains the JSON metadata for the struct
+// [RouteGetResponse]
+type routeGetResponseJSON struct {
+ Route apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RouteGetResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routeGetResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type RouteNewParams struct {
+ Body param.Field[interface{}] `json:"body,required"`
+}
+
+func (r RouteNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r.Body)
+}
+
+type RouteNewResponseEnvelope struct {
+ Errors []RouteNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []RouteNewResponseEnvelopeMessages `json:"messages,required"`
+ Result RouteNewResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success RouteNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON routeNewResponseEnvelopeJSON `json:"-"`
+}
+
+// routeNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [RouteNewResponseEnvelope]
+type routeNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RouteNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routeNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type RouteNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON routeNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// routeNewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [RouteNewResponseEnvelopeErrors]
+type routeNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RouteNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routeNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type RouteNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON routeNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// routeNewResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [RouteNewResponseEnvelopeMessages]
+type routeNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RouteNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routeNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type RouteNewResponseEnvelopeSuccess bool
+
+const (
+ RouteNewResponseEnvelopeSuccessTrue RouteNewResponseEnvelopeSuccess = true
+)
+
+type RouteUpdateParams struct {
+ // The next-hop IP Address for the static route.
+ Nexthop param.Field[string] `json:"nexthop,required"`
+ // IP Prefix in Classless Inter-Domain Routing format.
+ Prefix param.Field[string] `json:"prefix,required"`
+ // Priority of the static route.
+ Priority param.Field[int64] `json:"priority,required"`
+ // An optional human provided description of the static route.
+ Description param.Field[string] `json:"description"`
+ // Used only for ECMP routes.
+ Scope param.Field[RouteUpdateParamsScope] `json:"scope"`
+ // Optional weight of the ECMP scope - if provided.
+ Weight param.Field[int64] `json:"weight"`
+}
+
+func (r RouteUpdateParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Used only for ECMP routes.
+type RouteUpdateParamsScope struct {
+ // List of colo names for the ECMP scope.
+ ColoNames param.Field[[]string] `json:"colo_names"`
+ // List of colo regions for the ECMP scope.
+ ColoRegions param.Field[[]string] `json:"colo_regions"`
+}
+
+func (r RouteUpdateParamsScope) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type RouteUpdateResponseEnvelope struct {
+ Errors []RouteUpdateResponseEnvelopeErrors `json:"errors,required"`
+ Messages []RouteUpdateResponseEnvelopeMessages `json:"messages,required"`
+ Result RouteUpdateResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success RouteUpdateResponseEnvelopeSuccess `json:"success,required"`
+ JSON routeUpdateResponseEnvelopeJSON `json:"-"`
+}
+
+// routeUpdateResponseEnvelopeJSON contains the JSON metadata for the struct
+// [RouteUpdateResponseEnvelope]
+type routeUpdateResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RouteUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routeUpdateResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type RouteUpdateResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON routeUpdateResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// routeUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [RouteUpdateResponseEnvelopeErrors]
+type routeUpdateResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RouteUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routeUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type RouteUpdateResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON routeUpdateResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// routeUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [RouteUpdateResponseEnvelopeMessages]
+type routeUpdateResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RouteUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routeUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type RouteUpdateResponseEnvelopeSuccess bool
+
+const (
+ RouteUpdateResponseEnvelopeSuccessTrue RouteUpdateResponseEnvelopeSuccess = true
+)
+
+type RouteListResponseEnvelope struct {
+ Errors []RouteListResponseEnvelopeErrors `json:"errors,required"`
+ Messages []RouteListResponseEnvelopeMessages `json:"messages,required"`
+ Result RouteListResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success RouteListResponseEnvelopeSuccess `json:"success,required"`
+ JSON routeListResponseEnvelopeJSON `json:"-"`
+}
+
+// routeListResponseEnvelopeJSON contains the JSON metadata for the struct
+// [RouteListResponseEnvelope]
+type routeListResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RouteListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routeListResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type RouteListResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON routeListResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// routeListResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [RouteListResponseEnvelopeErrors]
+type routeListResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RouteListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routeListResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type RouteListResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON routeListResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// routeListResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [RouteListResponseEnvelopeMessages]
+type routeListResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RouteListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routeListResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type RouteListResponseEnvelopeSuccess bool
+
+const (
+ RouteListResponseEnvelopeSuccessTrue RouteListResponseEnvelopeSuccess = true
+)
+
+type RouteDeleteResponseEnvelope struct {
+ Errors []RouteDeleteResponseEnvelopeErrors `json:"errors,required"`
+ Messages []RouteDeleteResponseEnvelopeMessages `json:"messages,required"`
+ Result RouteDeleteResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success RouteDeleteResponseEnvelopeSuccess `json:"success,required"`
+ JSON routeDeleteResponseEnvelopeJSON `json:"-"`
+}
+
+// routeDeleteResponseEnvelopeJSON contains the JSON metadata for the struct
+// [RouteDeleteResponseEnvelope]
+type routeDeleteResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RouteDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routeDeleteResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type RouteDeleteResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON routeDeleteResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// routeDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [RouteDeleteResponseEnvelopeErrors]
+type routeDeleteResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RouteDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routeDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type RouteDeleteResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON routeDeleteResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// routeDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [RouteDeleteResponseEnvelopeMessages]
+type routeDeleteResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RouteDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routeDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type RouteDeleteResponseEnvelopeSuccess bool
+
+const (
+ RouteDeleteResponseEnvelopeSuccessTrue RouteDeleteResponseEnvelopeSuccess = true
+)
+
+type RouteEmptyParams struct {
+ Routes param.Field[[]RouteEmptyParamsRoute] `json:"routes,required"`
+}
+
+func (r RouteEmptyParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type RouteEmptyParamsRoute struct {
+}
+
+func (r RouteEmptyParamsRoute) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type RouteEmptyResponseEnvelope struct {
+ Errors []RouteEmptyResponseEnvelopeErrors `json:"errors,required"`
+ Messages []RouteEmptyResponseEnvelopeMessages `json:"messages,required"`
+ Result RouteEmptyResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success RouteEmptyResponseEnvelopeSuccess `json:"success,required"`
+ JSON routeEmptyResponseEnvelopeJSON `json:"-"`
+}
+
+// routeEmptyResponseEnvelopeJSON contains the JSON metadata for the struct
+// [RouteEmptyResponseEnvelope]
+type routeEmptyResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RouteEmptyResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routeEmptyResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type RouteEmptyResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON routeEmptyResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// routeEmptyResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [RouteEmptyResponseEnvelopeErrors]
+type routeEmptyResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RouteEmptyResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routeEmptyResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type RouteEmptyResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON routeEmptyResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// routeEmptyResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [RouteEmptyResponseEnvelopeMessages]
+type routeEmptyResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RouteEmptyResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routeEmptyResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type RouteEmptyResponseEnvelopeSuccess bool
+
+const (
+ RouteEmptyResponseEnvelopeSuccessTrue RouteEmptyResponseEnvelopeSuccess = true
+)
+
+type RouteGetResponseEnvelope struct {
+ Errors []RouteGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []RouteGetResponseEnvelopeMessages `json:"messages,required"`
+ Result RouteGetResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success RouteGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON routeGetResponseEnvelopeJSON `json:"-"`
+}
+
+// routeGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [RouteGetResponseEnvelope]
+type routeGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RouteGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routeGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type RouteGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON routeGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// routeGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [RouteGetResponseEnvelopeErrors]
+type routeGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RouteGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routeGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type RouteGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON routeGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// routeGetResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [RouteGetResponseEnvelopeMessages]
+type routeGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RouteGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r routeGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type RouteGetResponseEnvelopeSuccess bool
+
+const (
+ RouteGetResponseEnvelopeSuccessTrue RouteGetResponseEnvelopeSuccess = true
+)
diff --git a/magic_transit/route_test.go b/magic_transit/route_test.go
new file mode 100644
index 00000000000..178a0ff9d4d
--- /dev/null
+++ b/magic_transit/route_test.go
@@ -0,0 +1,194 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package magic_transit_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/magic_transit"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestRouteNew(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"),
+ )
+ _, err := client.MagicTransit.Routes.New(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ magic_transit.RouteNewParams{
+ Body: cloudflare.F[any](map[string]interface{}{}),
+ },
+ )
+ 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())
+ }
+}
+
+func TestRouteUpdateWithOptionalParams(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"),
+ )
+ _, err := client.MagicTransit.Routes.Update(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ magic_transit.RouteUpdateParams{
+ Nexthop: cloudflare.F("203.0.113.1"),
+ Prefix: cloudflare.F("192.0.2.0/24"),
+ Priority: cloudflare.F(int64(0)),
+ Description: cloudflare.F("New route for new prefix 203.0.113.1"),
+ Scope: cloudflare.F(magic_transit.RouteUpdateParamsScope{
+ ColoNames: cloudflare.F([]string{"den01", "den01", "den01"}),
+ ColoRegions: cloudflare.F([]string{"APAC", "APAC", "APAC"}),
+ }),
+ Weight: cloudflare.F(int64(0)),
+ },
+ )
+ 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())
+ }
+}
+
+func TestRouteList(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"),
+ )
+ _, err := client.MagicTransit.Routes.List(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353")
+ 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())
+ }
+}
+
+func TestRouteDelete(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"),
+ )
+ _, err := client.MagicTransit.Routes.Delete(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ )
+ 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())
+ }
+}
+
+func TestRouteEmpty(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"),
+ )
+ _, err := client.MagicTransit.Routes.Empty(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ magic_transit.RouteEmptyParams{
+ Routes: cloudflare.F([]magic_transit.RouteEmptyParamsRoute{{}, {}, {}}),
+ },
+ )
+ 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())
+ }
+}
+
+func TestRouteGet(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"),
+ )
+ _, err := client.MagicTransit.Routes.Get(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ )
+ 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/magicnetworkmonitoringconfig.go b/magicnetworkmonitoringconfig.go
deleted file mode 100644
index e9625f14619..00000000000
--- a/magicnetworkmonitoringconfig.go
+++ /dev/null
@@ -1,651 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// MagicNetworkMonitoringConfigService contains methods and other services that
-// help with interacting with the cloudflare API. Note, unlike clients, this
-// service does not read variables from the environment automatically. You should
-// not instantiate this service directly, and instead use the
-// [NewMagicNetworkMonitoringConfigService] method instead.
-type MagicNetworkMonitoringConfigService struct {
- Options []option.RequestOption
- Full *MagicNetworkMonitoringConfigFullService
-}
-
-// NewMagicNetworkMonitoringConfigService generates a new service that applies the
-// given options to each request. These options are applied after the parent
-// client's options (if there is one), and before any request-specific options.
-func NewMagicNetworkMonitoringConfigService(opts ...option.RequestOption) (r *MagicNetworkMonitoringConfigService) {
- r = &MagicNetworkMonitoringConfigService{}
- r.Options = opts
- r.Full = NewMagicNetworkMonitoringConfigFullService(opts...)
- return
-}
-
-// Create a new network monitoring configuration.
-func (r *MagicNetworkMonitoringConfigService) New(ctx context.Context, accountIdentifier interface{}, opts ...option.RequestOption) (res *MagicNetworkMonitoringConfigNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env MagicNetworkMonitoringConfigNewResponseEnvelope
- path := fmt.Sprintf("accounts/%v/mnm/config", accountIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Update an existing network monitoring configuration, requires the entire
-// configuration to be updated at once.
-func (r *MagicNetworkMonitoringConfigService) Update(ctx context.Context, accountIdentifier interface{}, opts ...option.RequestOption) (res *MagicNetworkMonitoringConfigUpdateResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env MagicNetworkMonitoringConfigUpdateResponseEnvelope
- path := fmt.Sprintf("accounts/%v/mnm/config", accountIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, nil, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Delete an existing network monitoring configuration.
-func (r *MagicNetworkMonitoringConfigService) Delete(ctx context.Context, accountIdentifier interface{}, opts ...option.RequestOption) (res *MagicNetworkMonitoringConfigDeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env MagicNetworkMonitoringConfigDeleteResponseEnvelope
- path := fmt.Sprintf("accounts/%v/mnm/config", accountIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Update fields in an existing network monitoring configuration.
-func (r *MagicNetworkMonitoringConfigService) Edit(ctx context.Context, accountIdentifier interface{}, opts ...option.RequestOption) (res *MagicNetworkMonitoringConfigEditResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env MagicNetworkMonitoringConfigEditResponseEnvelope
- path := fmt.Sprintf("accounts/%v/mnm/config", accountIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, nil, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Lists default sampling and router IPs for account.
-func (r *MagicNetworkMonitoringConfigService) Get(ctx context.Context, accountIdentifier interface{}, opts ...option.RequestOption) (res *MagicNetworkMonitoringConfigGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env MagicNetworkMonitoringConfigGetResponseEnvelope
- path := fmt.Sprintf("accounts/%v/mnm/config", accountIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type MagicNetworkMonitoringConfigNewResponse struct {
- // Fallback sampling rate of flow messages being sent in packets per second. This
- // should match the packet sampling rate configured on the router.
- DefaultSampling float64 `json:"default_sampling,required"`
- // The account name.
- Name string `json:"name,required"`
- RouterIPs []string `json:"router_ips,required"`
- JSON magicNetworkMonitoringConfigNewResponseJSON `json:"-"`
-}
-
-// magicNetworkMonitoringConfigNewResponseJSON contains the JSON metadata for the
-// struct [MagicNetworkMonitoringConfigNewResponse]
-type magicNetworkMonitoringConfigNewResponseJSON struct {
- DefaultSampling apijson.Field
- Name apijson.Field
- RouterIPs apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicNetworkMonitoringConfigNewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicNetworkMonitoringConfigNewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicNetworkMonitoringConfigUpdateResponse struct {
- // Fallback sampling rate of flow messages being sent in packets per second. This
- // should match the packet sampling rate configured on the router.
- DefaultSampling float64 `json:"default_sampling,required"`
- // The account name.
- Name string `json:"name,required"`
- RouterIPs []string `json:"router_ips,required"`
- JSON magicNetworkMonitoringConfigUpdateResponseJSON `json:"-"`
-}
-
-// magicNetworkMonitoringConfigUpdateResponseJSON contains the JSON metadata for
-// the struct [MagicNetworkMonitoringConfigUpdateResponse]
-type magicNetworkMonitoringConfigUpdateResponseJSON struct {
- DefaultSampling apijson.Field
- Name apijson.Field
- RouterIPs apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicNetworkMonitoringConfigUpdateResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicNetworkMonitoringConfigUpdateResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicNetworkMonitoringConfigDeleteResponse struct {
- // Fallback sampling rate of flow messages being sent in packets per second. This
- // should match the packet sampling rate configured on the router.
- DefaultSampling float64 `json:"default_sampling,required"`
- // The account name.
- Name string `json:"name,required"`
- RouterIPs []string `json:"router_ips,required"`
- JSON magicNetworkMonitoringConfigDeleteResponseJSON `json:"-"`
-}
-
-// magicNetworkMonitoringConfigDeleteResponseJSON contains the JSON metadata for
-// the struct [MagicNetworkMonitoringConfigDeleteResponse]
-type magicNetworkMonitoringConfigDeleteResponseJSON struct {
- DefaultSampling apijson.Field
- Name apijson.Field
- RouterIPs apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicNetworkMonitoringConfigDeleteResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicNetworkMonitoringConfigDeleteResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicNetworkMonitoringConfigEditResponse struct {
- // Fallback sampling rate of flow messages being sent in packets per second. This
- // should match the packet sampling rate configured on the router.
- DefaultSampling float64 `json:"default_sampling,required"`
- // The account name.
- Name string `json:"name,required"`
- RouterIPs []string `json:"router_ips,required"`
- JSON magicNetworkMonitoringConfigEditResponseJSON `json:"-"`
-}
-
-// magicNetworkMonitoringConfigEditResponseJSON contains the JSON metadata for the
-// struct [MagicNetworkMonitoringConfigEditResponse]
-type magicNetworkMonitoringConfigEditResponseJSON struct {
- DefaultSampling apijson.Field
- Name apijson.Field
- RouterIPs apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicNetworkMonitoringConfigEditResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicNetworkMonitoringConfigEditResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicNetworkMonitoringConfigGetResponse struct {
- // Fallback sampling rate of flow messages being sent in packets per second. This
- // should match the packet sampling rate configured on the router.
- DefaultSampling float64 `json:"default_sampling,required"`
- // The account name.
- Name string `json:"name,required"`
- RouterIPs []string `json:"router_ips,required"`
- JSON magicNetworkMonitoringConfigGetResponseJSON `json:"-"`
-}
-
-// magicNetworkMonitoringConfigGetResponseJSON contains the JSON metadata for the
-// struct [MagicNetworkMonitoringConfigGetResponse]
-type magicNetworkMonitoringConfigGetResponseJSON struct {
- DefaultSampling apijson.Field
- Name apijson.Field
- RouterIPs apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicNetworkMonitoringConfigGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicNetworkMonitoringConfigGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicNetworkMonitoringConfigNewResponseEnvelope struct {
- Errors []MagicNetworkMonitoringConfigNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []MagicNetworkMonitoringConfigNewResponseEnvelopeMessages `json:"messages,required"`
- Result MagicNetworkMonitoringConfigNewResponse `json:"result,required"`
- // Whether the API call was successful
- Success MagicNetworkMonitoringConfigNewResponseEnvelopeSuccess `json:"success,required"`
- JSON magicNetworkMonitoringConfigNewResponseEnvelopeJSON `json:"-"`
-}
-
-// magicNetworkMonitoringConfigNewResponseEnvelopeJSON contains the JSON metadata
-// for the struct [MagicNetworkMonitoringConfigNewResponseEnvelope]
-type magicNetworkMonitoringConfigNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicNetworkMonitoringConfigNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicNetworkMonitoringConfigNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicNetworkMonitoringConfigNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON magicNetworkMonitoringConfigNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// magicNetworkMonitoringConfigNewResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct [MagicNetworkMonitoringConfigNewResponseEnvelopeErrors]
-type magicNetworkMonitoringConfigNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicNetworkMonitoringConfigNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicNetworkMonitoringConfigNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicNetworkMonitoringConfigNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON magicNetworkMonitoringConfigNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// magicNetworkMonitoringConfigNewResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct
-// [MagicNetworkMonitoringConfigNewResponseEnvelopeMessages]
-type magicNetworkMonitoringConfigNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicNetworkMonitoringConfigNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicNetworkMonitoringConfigNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type MagicNetworkMonitoringConfigNewResponseEnvelopeSuccess bool
-
-const (
- MagicNetworkMonitoringConfigNewResponseEnvelopeSuccessTrue MagicNetworkMonitoringConfigNewResponseEnvelopeSuccess = true
-)
-
-type MagicNetworkMonitoringConfigUpdateResponseEnvelope struct {
- Errors []MagicNetworkMonitoringConfigUpdateResponseEnvelopeErrors `json:"errors,required"`
- Messages []MagicNetworkMonitoringConfigUpdateResponseEnvelopeMessages `json:"messages,required"`
- Result MagicNetworkMonitoringConfigUpdateResponse `json:"result,required"`
- // Whether the API call was successful
- Success MagicNetworkMonitoringConfigUpdateResponseEnvelopeSuccess `json:"success,required"`
- JSON magicNetworkMonitoringConfigUpdateResponseEnvelopeJSON `json:"-"`
-}
-
-// magicNetworkMonitoringConfigUpdateResponseEnvelopeJSON contains the JSON
-// metadata for the struct [MagicNetworkMonitoringConfigUpdateResponseEnvelope]
-type magicNetworkMonitoringConfigUpdateResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicNetworkMonitoringConfigUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicNetworkMonitoringConfigUpdateResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicNetworkMonitoringConfigUpdateResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON magicNetworkMonitoringConfigUpdateResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// magicNetworkMonitoringConfigUpdateResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct
-// [MagicNetworkMonitoringConfigUpdateResponseEnvelopeErrors]
-type magicNetworkMonitoringConfigUpdateResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicNetworkMonitoringConfigUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicNetworkMonitoringConfigUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicNetworkMonitoringConfigUpdateResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON magicNetworkMonitoringConfigUpdateResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// magicNetworkMonitoringConfigUpdateResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct
-// [MagicNetworkMonitoringConfigUpdateResponseEnvelopeMessages]
-type magicNetworkMonitoringConfigUpdateResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicNetworkMonitoringConfigUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicNetworkMonitoringConfigUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type MagicNetworkMonitoringConfigUpdateResponseEnvelopeSuccess bool
-
-const (
- MagicNetworkMonitoringConfigUpdateResponseEnvelopeSuccessTrue MagicNetworkMonitoringConfigUpdateResponseEnvelopeSuccess = true
-)
-
-type MagicNetworkMonitoringConfigDeleteResponseEnvelope struct {
- Errors []MagicNetworkMonitoringConfigDeleteResponseEnvelopeErrors `json:"errors,required"`
- Messages []MagicNetworkMonitoringConfigDeleteResponseEnvelopeMessages `json:"messages,required"`
- Result MagicNetworkMonitoringConfigDeleteResponse `json:"result,required"`
- // Whether the API call was successful
- Success MagicNetworkMonitoringConfigDeleteResponseEnvelopeSuccess `json:"success,required"`
- JSON magicNetworkMonitoringConfigDeleteResponseEnvelopeJSON `json:"-"`
-}
-
-// magicNetworkMonitoringConfigDeleteResponseEnvelopeJSON contains the JSON
-// metadata for the struct [MagicNetworkMonitoringConfigDeleteResponseEnvelope]
-type magicNetworkMonitoringConfigDeleteResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicNetworkMonitoringConfigDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicNetworkMonitoringConfigDeleteResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicNetworkMonitoringConfigDeleteResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON magicNetworkMonitoringConfigDeleteResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// magicNetworkMonitoringConfigDeleteResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct
-// [MagicNetworkMonitoringConfigDeleteResponseEnvelopeErrors]
-type magicNetworkMonitoringConfigDeleteResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicNetworkMonitoringConfigDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicNetworkMonitoringConfigDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicNetworkMonitoringConfigDeleteResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON magicNetworkMonitoringConfigDeleteResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// magicNetworkMonitoringConfigDeleteResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct
-// [MagicNetworkMonitoringConfigDeleteResponseEnvelopeMessages]
-type magicNetworkMonitoringConfigDeleteResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicNetworkMonitoringConfigDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicNetworkMonitoringConfigDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type MagicNetworkMonitoringConfigDeleteResponseEnvelopeSuccess bool
-
-const (
- MagicNetworkMonitoringConfigDeleteResponseEnvelopeSuccessTrue MagicNetworkMonitoringConfigDeleteResponseEnvelopeSuccess = true
-)
-
-type MagicNetworkMonitoringConfigEditResponseEnvelope struct {
- Errors []MagicNetworkMonitoringConfigEditResponseEnvelopeErrors `json:"errors,required"`
- Messages []MagicNetworkMonitoringConfigEditResponseEnvelopeMessages `json:"messages,required"`
- Result MagicNetworkMonitoringConfigEditResponse `json:"result,required"`
- // Whether the API call was successful
- Success MagicNetworkMonitoringConfigEditResponseEnvelopeSuccess `json:"success,required"`
- JSON magicNetworkMonitoringConfigEditResponseEnvelopeJSON `json:"-"`
-}
-
-// magicNetworkMonitoringConfigEditResponseEnvelopeJSON contains the JSON metadata
-// for the struct [MagicNetworkMonitoringConfigEditResponseEnvelope]
-type magicNetworkMonitoringConfigEditResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicNetworkMonitoringConfigEditResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicNetworkMonitoringConfigEditResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicNetworkMonitoringConfigEditResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON magicNetworkMonitoringConfigEditResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// magicNetworkMonitoringConfigEditResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct [MagicNetworkMonitoringConfigEditResponseEnvelopeErrors]
-type magicNetworkMonitoringConfigEditResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicNetworkMonitoringConfigEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicNetworkMonitoringConfigEditResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicNetworkMonitoringConfigEditResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON magicNetworkMonitoringConfigEditResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// magicNetworkMonitoringConfigEditResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct
-// [MagicNetworkMonitoringConfigEditResponseEnvelopeMessages]
-type magicNetworkMonitoringConfigEditResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicNetworkMonitoringConfigEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicNetworkMonitoringConfigEditResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type MagicNetworkMonitoringConfigEditResponseEnvelopeSuccess bool
-
-const (
- MagicNetworkMonitoringConfigEditResponseEnvelopeSuccessTrue MagicNetworkMonitoringConfigEditResponseEnvelopeSuccess = true
-)
-
-type MagicNetworkMonitoringConfigGetResponseEnvelope struct {
- Errors []MagicNetworkMonitoringConfigGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []MagicNetworkMonitoringConfigGetResponseEnvelopeMessages `json:"messages,required"`
- Result MagicNetworkMonitoringConfigGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success MagicNetworkMonitoringConfigGetResponseEnvelopeSuccess `json:"success,required"`
- JSON magicNetworkMonitoringConfigGetResponseEnvelopeJSON `json:"-"`
-}
-
-// magicNetworkMonitoringConfigGetResponseEnvelopeJSON contains the JSON metadata
-// for the struct [MagicNetworkMonitoringConfigGetResponseEnvelope]
-type magicNetworkMonitoringConfigGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicNetworkMonitoringConfigGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicNetworkMonitoringConfigGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicNetworkMonitoringConfigGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON magicNetworkMonitoringConfigGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// magicNetworkMonitoringConfigGetResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct [MagicNetworkMonitoringConfigGetResponseEnvelopeErrors]
-type magicNetworkMonitoringConfigGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicNetworkMonitoringConfigGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicNetworkMonitoringConfigGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicNetworkMonitoringConfigGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON magicNetworkMonitoringConfigGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// magicNetworkMonitoringConfigGetResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct
-// [MagicNetworkMonitoringConfigGetResponseEnvelopeMessages]
-type magicNetworkMonitoringConfigGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicNetworkMonitoringConfigGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicNetworkMonitoringConfigGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type MagicNetworkMonitoringConfigGetResponseEnvelopeSuccess bool
-
-const (
- MagicNetworkMonitoringConfigGetResponseEnvelopeSuccessTrue MagicNetworkMonitoringConfigGetResponseEnvelopeSuccess = true
-)
diff --git a/magicnetworkmonitoringconfig_test.go b/magicnetworkmonitoringconfig_test.go
deleted file mode 100644
index 32ba5a47b68..00000000000
--- a/magicnetworkmonitoringconfig_test.go
+++ /dev/null
@@ -1,134 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestMagicNetworkMonitoringConfigNew(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"),
- )
- _, err := client.MagicNetworkMonitoring.Configs.New(context.TODO(), "6f91088a406011ed95aed352566e8d4c")
- 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())
- }
-}
-
-func TestMagicNetworkMonitoringConfigUpdate(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"),
- )
- _, err := client.MagicNetworkMonitoring.Configs.Update(context.TODO(), "6f91088a406011ed95aed352566e8d4c")
- 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())
- }
-}
-
-func TestMagicNetworkMonitoringConfigDelete(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"),
- )
- _, err := client.MagicNetworkMonitoring.Configs.Delete(context.TODO(), "6f91088a406011ed95aed352566e8d4c")
- 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())
- }
-}
-
-func TestMagicNetworkMonitoringConfigEdit(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"),
- )
- _, err := client.MagicNetworkMonitoring.Configs.Edit(context.TODO(), "6f91088a406011ed95aed352566e8d4c")
- 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())
- }
-}
-
-func TestMagicNetworkMonitoringConfigGet(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"),
- )
- _, err := client.MagicNetworkMonitoring.Configs.Get(context.TODO(), "6f91088a406011ed95aed352566e8d4c")
- 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/magicnetworkmonitoringconfigfull.go b/magicnetworkmonitoringconfigfull.go
deleted file mode 100644
index 79cab14f53a..00000000000
--- a/magicnetworkmonitoringconfigfull.go
+++ /dev/null
@@ -1,155 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// MagicNetworkMonitoringConfigFullService contains methods and other services that
-// help with interacting with the cloudflare API. Note, unlike clients, this
-// service does not read variables from the environment automatically. You should
-// not instantiate this service directly, and instead use the
-// [NewMagicNetworkMonitoringConfigFullService] method instead.
-type MagicNetworkMonitoringConfigFullService struct {
- Options []option.RequestOption
-}
-
-// NewMagicNetworkMonitoringConfigFullService generates a new service that applies
-// the given options to each request. These options are applied after the parent
-// client's options (if there is one), and before any request-specific options.
-func NewMagicNetworkMonitoringConfigFullService(opts ...option.RequestOption) (r *MagicNetworkMonitoringConfigFullService) {
- r = &MagicNetworkMonitoringConfigFullService{}
- r.Options = opts
- return
-}
-
-// Lists default sampling, router IPs, and rules for account.
-func (r *MagicNetworkMonitoringConfigFullService) Get(ctx context.Context, accountIdentifier interface{}, opts ...option.RequestOption) (res *MagicNetworkMonitoringConfigFullGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env MagicNetworkMonitoringConfigFullGetResponseEnvelope
- path := fmt.Sprintf("accounts/%v/mnm/config/full", accountIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type MagicNetworkMonitoringConfigFullGetResponse struct {
- // Fallback sampling rate of flow messages being sent in packets per second. This
- // should match the packet sampling rate configured on the router.
- DefaultSampling float64 `json:"default_sampling,required"`
- // The account name.
- Name string `json:"name,required"`
- RouterIPs []string `json:"router_ips,required"`
- JSON magicNetworkMonitoringConfigFullGetResponseJSON `json:"-"`
-}
-
-// magicNetworkMonitoringConfigFullGetResponseJSON contains the JSON metadata for
-// the struct [MagicNetworkMonitoringConfigFullGetResponse]
-type magicNetworkMonitoringConfigFullGetResponseJSON struct {
- DefaultSampling apijson.Field
- Name apijson.Field
- RouterIPs apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicNetworkMonitoringConfigFullGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicNetworkMonitoringConfigFullGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicNetworkMonitoringConfigFullGetResponseEnvelope struct {
- Errors []MagicNetworkMonitoringConfigFullGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []MagicNetworkMonitoringConfigFullGetResponseEnvelopeMessages `json:"messages,required"`
- Result MagicNetworkMonitoringConfigFullGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success MagicNetworkMonitoringConfigFullGetResponseEnvelopeSuccess `json:"success,required"`
- JSON magicNetworkMonitoringConfigFullGetResponseEnvelopeJSON `json:"-"`
-}
-
-// magicNetworkMonitoringConfigFullGetResponseEnvelopeJSON contains the JSON
-// metadata for the struct [MagicNetworkMonitoringConfigFullGetResponseEnvelope]
-type magicNetworkMonitoringConfigFullGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicNetworkMonitoringConfigFullGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicNetworkMonitoringConfigFullGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicNetworkMonitoringConfigFullGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON magicNetworkMonitoringConfigFullGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// magicNetworkMonitoringConfigFullGetResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct
-// [MagicNetworkMonitoringConfigFullGetResponseEnvelopeErrors]
-type magicNetworkMonitoringConfigFullGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicNetworkMonitoringConfigFullGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicNetworkMonitoringConfigFullGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicNetworkMonitoringConfigFullGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON magicNetworkMonitoringConfigFullGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// magicNetworkMonitoringConfigFullGetResponseEnvelopeMessagesJSON contains the
-// JSON metadata for the struct
-// [MagicNetworkMonitoringConfigFullGetResponseEnvelopeMessages]
-type magicNetworkMonitoringConfigFullGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicNetworkMonitoringConfigFullGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicNetworkMonitoringConfigFullGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type MagicNetworkMonitoringConfigFullGetResponseEnvelopeSuccess bool
-
-const (
- MagicNetworkMonitoringConfigFullGetResponseEnvelopeSuccessTrue MagicNetworkMonitoringConfigFullGetResponseEnvelopeSuccess = true
-)
diff --git a/magicnetworkmonitoringconfigfull_test.go b/magicnetworkmonitoringconfigfull_test.go
deleted file mode 100644
index 1498385821a..00000000000
--- a/magicnetworkmonitoringconfigfull_test.go
+++ /dev/null
@@ -1,38 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestMagicNetworkMonitoringConfigFullGet(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"),
- )
- _, err := client.MagicNetworkMonitoring.Configs.Full.Get(context.TODO(), "6f91088a406011ed95aed352566e8d4c")
- 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/magicnetworkmonitoringrule.go b/magicnetworkmonitoringrule.go
deleted file mode 100644
index 04a75e9b554..00000000000
--- a/magicnetworkmonitoringrule.go
+++ /dev/null
@@ -1,922 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// MagicNetworkMonitoringRuleService contains methods and other services that help
-// with interacting with the cloudflare API. Note, unlike clients, this service
-// does not read variables from the environment automatically. You should not
-// instantiate this service directly, and instead use the
-// [NewMagicNetworkMonitoringRuleService] method instead.
-type MagicNetworkMonitoringRuleService struct {
- Options []option.RequestOption
- Advertisements *MagicNetworkMonitoringRuleAdvertisementService
-}
-
-// NewMagicNetworkMonitoringRuleService generates a new service that applies the
-// given options to each request. These options are applied after the parent
-// client's options (if there is one), and before any request-specific options.
-func NewMagicNetworkMonitoringRuleService(opts ...option.RequestOption) (r *MagicNetworkMonitoringRuleService) {
- r = &MagicNetworkMonitoringRuleService{}
- r.Options = opts
- r.Advertisements = NewMagicNetworkMonitoringRuleAdvertisementService(opts...)
- return
-}
-
-// Create network monitoring rules for account. Currently only supports creating a
-// single rule per API request.
-func (r *MagicNetworkMonitoringRuleService) New(ctx context.Context, accountIdentifier interface{}, opts ...option.RequestOption) (res *MagicNetworkMonitoringRuleNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env MagicNetworkMonitoringRuleNewResponseEnvelope
- path := fmt.Sprintf("accounts/%v/mnm/rules", accountIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Update network monitoring rules for account.
-func (r *MagicNetworkMonitoringRuleService) Update(ctx context.Context, accountIdentifier interface{}, opts ...option.RequestOption) (res *MagicNetworkMonitoringRuleUpdateResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env MagicNetworkMonitoringRuleUpdateResponseEnvelope
- path := fmt.Sprintf("accounts/%v/mnm/rules", accountIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, nil, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Lists network monitoring rules for account.
-func (r *MagicNetworkMonitoringRuleService) List(ctx context.Context, accountIdentifier interface{}, opts ...option.RequestOption) (res *[]MagicNetworkMonitoringRuleListResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env MagicNetworkMonitoringRuleListResponseEnvelope
- path := fmt.Sprintf("accounts/%v/mnm/rules", accountIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Delete a network monitoring rule for account.
-func (r *MagicNetworkMonitoringRuleService) Delete(ctx context.Context, accountIdentifier interface{}, ruleIdentifier interface{}, opts ...option.RequestOption) (res *MagicNetworkMonitoringRuleDeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env MagicNetworkMonitoringRuleDeleteResponseEnvelope
- path := fmt.Sprintf("accounts/%v/mnm/rules/%v", accountIdentifier, ruleIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Update a network monitoring rule for account.
-func (r *MagicNetworkMonitoringRuleService) Edit(ctx context.Context, accountIdentifier interface{}, ruleIdentifier interface{}, opts ...option.RequestOption) (res *MagicNetworkMonitoringRuleEditResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env MagicNetworkMonitoringRuleEditResponseEnvelope
- path := fmt.Sprintf("accounts/%v/mnm/rules/%v", accountIdentifier, ruleIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, nil, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// List a single network monitoring rule for account.
-func (r *MagicNetworkMonitoringRuleService) Get(ctx context.Context, accountIdentifier interface{}, ruleIdentifier interface{}, opts ...option.RequestOption) (res *MagicNetworkMonitoringRuleGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env MagicNetworkMonitoringRuleGetResponseEnvelope
- path := fmt.Sprintf("accounts/%v/mnm/rules/%v", accountIdentifier, ruleIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type MagicNetworkMonitoringRuleNewResponse struct {
- // Toggle on if you would like Cloudflare to automatically advertise the IP
- // Prefixes within the rule via Magic Transit when the rule is triggered. Only
- // available for users of Magic Transit.
- AutomaticAdvertisement bool `json:"automatic_advertisement,required,nullable"`
- // The amount of time that the rule threshold must be exceeded to send an alert
- // notification. The final value must be equivalent to one of the following 8
- // values ["1m","5m","10m","15m","20m","30m","45m","60m"]. The format is
- // AhBmCsDmsEusFns where A, B, C, D, E and F durations are optional; however at
- // least one unit must be provided.
- Duration string `json:"duration,required"`
- // The name of the rule. Must be unique. Supports characters A-Z, a-z, 0-9,
- // underscore (\_), dash (-), period (.), and tilde (~). You can’t have a space in
- // the rule name. Max 256 characters.
- Name string `json:"name,required"`
- Prefixes []string `json:"prefixes,required"`
- ID interface{} `json:"id"`
- // The number of bits per second for the rule. When this value is exceeded for the
- // set duration, an alert notification is sent. Minimum of 1 and no maximum.
- BandwidthThreshold float64 `json:"bandwidth_threshold"`
- // The number of packets per second for the rule. When this value is exceeded for
- // the set duration, an alert notification is sent. Minimum of 1 and no maximum.
- PacketThreshold float64 `json:"packet_threshold"`
- JSON magicNetworkMonitoringRuleNewResponseJSON `json:"-"`
-}
-
-// magicNetworkMonitoringRuleNewResponseJSON contains the JSON metadata for the
-// struct [MagicNetworkMonitoringRuleNewResponse]
-type magicNetworkMonitoringRuleNewResponseJSON struct {
- AutomaticAdvertisement apijson.Field
- Duration apijson.Field
- Name apijson.Field
- Prefixes apijson.Field
- ID apijson.Field
- BandwidthThreshold apijson.Field
- PacketThreshold apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicNetworkMonitoringRuleNewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicNetworkMonitoringRuleNewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicNetworkMonitoringRuleUpdateResponse struct {
- // Toggle on if you would like Cloudflare to automatically advertise the IP
- // Prefixes within the rule via Magic Transit when the rule is triggered. Only
- // available for users of Magic Transit.
- AutomaticAdvertisement bool `json:"automatic_advertisement,required,nullable"`
- // The amount of time that the rule threshold must be exceeded to send an alert
- // notification. The final value must be equivalent to one of the following 8
- // values ["1m","5m","10m","15m","20m","30m","45m","60m"]. The format is
- // AhBmCsDmsEusFns where A, B, C, D, E and F durations are optional; however at
- // least one unit must be provided.
- Duration string `json:"duration,required"`
- // The name of the rule. Must be unique. Supports characters A-Z, a-z, 0-9,
- // underscore (\_), dash (-), period (.), and tilde (~). You can’t have a space in
- // the rule name. Max 256 characters.
- Name string `json:"name,required"`
- Prefixes []string `json:"prefixes,required"`
- ID interface{} `json:"id"`
- // The number of bits per second for the rule. When this value is exceeded for the
- // set duration, an alert notification is sent. Minimum of 1 and no maximum.
- BandwidthThreshold float64 `json:"bandwidth_threshold"`
- // The number of packets per second for the rule. When this value is exceeded for
- // the set duration, an alert notification is sent. Minimum of 1 and no maximum.
- PacketThreshold float64 `json:"packet_threshold"`
- JSON magicNetworkMonitoringRuleUpdateResponseJSON `json:"-"`
-}
-
-// magicNetworkMonitoringRuleUpdateResponseJSON contains the JSON metadata for the
-// struct [MagicNetworkMonitoringRuleUpdateResponse]
-type magicNetworkMonitoringRuleUpdateResponseJSON struct {
- AutomaticAdvertisement apijson.Field
- Duration apijson.Field
- Name apijson.Field
- Prefixes apijson.Field
- ID apijson.Field
- BandwidthThreshold apijson.Field
- PacketThreshold apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicNetworkMonitoringRuleUpdateResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicNetworkMonitoringRuleUpdateResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicNetworkMonitoringRuleListResponse struct {
- // Toggle on if you would like Cloudflare to automatically advertise the IP
- // Prefixes within the rule via Magic Transit when the rule is triggered. Only
- // available for users of Magic Transit.
- AutomaticAdvertisement bool `json:"automatic_advertisement,required,nullable"`
- // The amount of time that the rule threshold must be exceeded to send an alert
- // notification. The final value must be equivalent to one of the following 8
- // values ["1m","5m","10m","15m","20m","30m","45m","60m"]. The format is
- // AhBmCsDmsEusFns where A, B, C, D, E and F durations are optional; however at
- // least one unit must be provided.
- Duration string `json:"duration,required"`
- // The name of the rule. Must be unique. Supports characters A-Z, a-z, 0-9,
- // underscore (\_), dash (-), period (.), and tilde (~). You can’t have a space in
- // the rule name. Max 256 characters.
- Name string `json:"name,required"`
- Prefixes []string `json:"prefixes,required"`
- ID interface{} `json:"id"`
- // The number of bits per second for the rule. When this value is exceeded for the
- // set duration, an alert notification is sent. Minimum of 1 and no maximum.
- BandwidthThreshold float64 `json:"bandwidth_threshold"`
- // The number of packets per second for the rule. When this value is exceeded for
- // the set duration, an alert notification is sent. Minimum of 1 and no maximum.
- PacketThreshold float64 `json:"packet_threshold"`
- JSON magicNetworkMonitoringRuleListResponseJSON `json:"-"`
-}
-
-// magicNetworkMonitoringRuleListResponseJSON contains the JSON metadata for the
-// struct [MagicNetworkMonitoringRuleListResponse]
-type magicNetworkMonitoringRuleListResponseJSON struct {
- AutomaticAdvertisement apijson.Field
- Duration apijson.Field
- Name apijson.Field
- Prefixes apijson.Field
- ID apijson.Field
- BandwidthThreshold apijson.Field
- PacketThreshold apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicNetworkMonitoringRuleListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicNetworkMonitoringRuleListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicNetworkMonitoringRuleDeleteResponse struct {
- // Toggle on if you would like Cloudflare to automatically advertise the IP
- // Prefixes within the rule via Magic Transit when the rule is triggered. Only
- // available for users of Magic Transit.
- AutomaticAdvertisement bool `json:"automatic_advertisement,required,nullable"`
- // The amount of time that the rule threshold must be exceeded to send an alert
- // notification. The final value must be equivalent to one of the following 8
- // values ["1m","5m","10m","15m","20m","30m","45m","60m"]. The format is
- // AhBmCsDmsEusFns where A, B, C, D, E and F durations are optional; however at
- // least one unit must be provided.
- Duration string `json:"duration,required"`
- // The name of the rule. Must be unique. Supports characters A-Z, a-z, 0-9,
- // underscore (\_), dash (-), period (.), and tilde (~). You can’t have a space in
- // the rule name. Max 256 characters.
- Name string `json:"name,required"`
- Prefixes []string `json:"prefixes,required"`
- ID interface{} `json:"id"`
- // The number of bits per second for the rule. When this value is exceeded for the
- // set duration, an alert notification is sent. Minimum of 1 and no maximum.
- BandwidthThreshold float64 `json:"bandwidth_threshold"`
- // The number of packets per second for the rule. When this value is exceeded for
- // the set duration, an alert notification is sent. Minimum of 1 and no maximum.
- PacketThreshold float64 `json:"packet_threshold"`
- JSON magicNetworkMonitoringRuleDeleteResponseJSON `json:"-"`
-}
-
-// magicNetworkMonitoringRuleDeleteResponseJSON contains the JSON metadata for the
-// struct [MagicNetworkMonitoringRuleDeleteResponse]
-type magicNetworkMonitoringRuleDeleteResponseJSON struct {
- AutomaticAdvertisement apijson.Field
- Duration apijson.Field
- Name apijson.Field
- Prefixes apijson.Field
- ID apijson.Field
- BandwidthThreshold apijson.Field
- PacketThreshold apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicNetworkMonitoringRuleDeleteResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicNetworkMonitoringRuleDeleteResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicNetworkMonitoringRuleEditResponse struct {
- // Toggle on if you would like Cloudflare to automatically advertise the IP
- // Prefixes within the rule via Magic Transit when the rule is triggered. Only
- // available for users of Magic Transit.
- AutomaticAdvertisement bool `json:"automatic_advertisement,required,nullable"`
- // The amount of time that the rule threshold must be exceeded to send an alert
- // notification. The final value must be equivalent to one of the following 8
- // values ["1m","5m","10m","15m","20m","30m","45m","60m"]. The format is
- // AhBmCsDmsEusFns where A, B, C, D, E and F durations are optional; however at
- // least one unit must be provided.
- Duration string `json:"duration,required"`
- // The name of the rule. Must be unique. Supports characters A-Z, a-z, 0-9,
- // underscore (\_), dash (-), period (.), and tilde (~). You can’t have a space in
- // the rule name. Max 256 characters.
- Name string `json:"name,required"`
- Prefixes []string `json:"prefixes,required"`
- ID interface{} `json:"id"`
- // The number of bits per second for the rule. When this value is exceeded for the
- // set duration, an alert notification is sent. Minimum of 1 and no maximum.
- BandwidthThreshold float64 `json:"bandwidth_threshold"`
- // The number of packets per second for the rule. When this value is exceeded for
- // the set duration, an alert notification is sent. Minimum of 1 and no maximum.
- PacketThreshold float64 `json:"packet_threshold"`
- JSON magicNetworkMonitoringRuleEditResponseJSON `json:"-"`
-}
-
-// magicNetworkMonitoringRuleEditResponseJSON contains the JSON metadata for the
-// struct [MagicNetworkMonitoringRuleEditResponse]
-type magicNetworkMonitoringRuleEditResponseJSON struct {
- AutomaticAdvertisement apijson.Field
- Duration apijson.Field
- Name apijson.Field
- Prefixes apijson.Field
- ID apijson.Field
- BandwidthThreshold apijson.Field
- PacketThreshold apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicNetworkMonitoringRuleEditResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicNetworkMonitoringRuleEditResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicNetworkMonitoringRuleGetResponse struct {
- // Toggle on if you would like Cloudflare to automatically advertise the IP
- // Prefixes within the rule via Magic Transit when the rule is triggered. Only
- // available for users of Magic Transit.
- AutomaticAdvertisement bool `json:"automatic_advertisement,required,nullable"`
- // The amount of time that the rule threshold must be exceeded to send an alert
- // notification. The final value must be equivalent to one of the following 8
- // values ["1m","5m","10m","15m","20m","30m","45m","60m"]. The format is
- // AhBmCsDmsEusFns where A, B, C, D, E and F durations are optional; however at
- // least one unit must be provided.
- Duration string `json:"duration,required"`
- // The name of the rule. Must be unique. Supports characters A-Z, a-z, 0-9,
- // underscore (\_), dash (-), period (.), and tilde (~). You can’t have a space in
- // the rule name. Max 256 characters.
- Name string `json:"name,required"`
- Prefixes []string `json:"prefixes,required"`
- ID interface{} `json:"id"`
- // The number of bits per second for the rule. When this value is exceeded for the
- // set duration, an alert notification is sent. Minimum of 1 and no maximum.
- BandwidthThreshold float64 `json:"bandwidth_threshold"`
- // The number of packets per second for the rule. When this value is exceeded for
- // the set duration, an alert notification is sent. Minimum of 1 and no maximum.
- PacketThreshold float64 `json:"packet_threshold"`
- JSON magicNetworkMonitoringRuleGetResponseJSON `json:"-"`
-}
-
-// magicNetworkMonitoringRuleGetResponseJSON contains the JSON metadata for the
-// struct [MagicNetworkMonitoringRuleGetResponse]
-type magicNetworkMonitoringRuleGetResponseJSON struct {
- AutomaticAdvertisement apijson.Field
- Duration apijson.Field
- Name apijson.Field
- Prefixes apijson.Field
- ID apijson.Field
- BandwidthThreshold apijson.Field
- PacketThreshold apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicNetworkMonitoringRuleGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicNetworkMonitoringRuleGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicNetworkMonitoringRuleNewResponseEnvelope struct {
- Errors []MagicNetworkMonitoringRuleNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []MagicNetworkMonitoringRuleNewResponseEnvelopeMessages `json:"messages,required"`
- Result MagicNetworkMonitoringRuleNewResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success MagicNetworkMonitoringRuleNewResponseEnvelopeSuccess `json:"success,required"`
- JSON magicNetworkMonitoringRuleNewResponseEnvelopeJSON `json:"-"`
-}
-
-// magicNetworkMonitoringRuleNewResponseEnvelopeJSON contains the JSON metadata for
-// the struct [MagicNetworkMonitoringRuleNewResponseEnvelope]
-type magicNetworkMonitoringRuleNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicNetworkMonitoringRuleNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicNetworkMonitoringRuleNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicNetworkMonitoringRuleNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON magicNetworkMonitoringRuleNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// magicNetworkMonitoringRuleNewResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct [MagicNetworkMonitoringRuleNewResponseEnvelopeErrors]
-type magicNetworkMonitoringRuleNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicNetworkMonitoringRuleNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicNetworkMonitoringRuleNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicNetworkMonitoringRuleNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON magicNetworkMonitoringRuleNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// magicNetworkMonitoringRuleNewResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct [MagicNetworkMonitoringRuleNewResponseEnvelopeMessages]
-type magicNetworkMonitoringRuleNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicNetworkMonitoringRuleNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicNetworkMonitoringRuleNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type MagicNetworkMonitoringRuleNewResponseEnvelopeSuccess bool
-
-const (
- MagicNetworkMonitoringRuleNewResponseEnvelopeSuccessTrue MagicNetworkMonitoringRuleNewResponseEnvelopeSuccess = true
-)
-
-type MagicNetworkMonitoringRuleUpdateResponseEnvelope struct {
- Errors []MagicNetworkMonitoringRuleUpdateResponseEnvelopeErrors `json:"errors,required"`
- Messages []MagicNetworkMonitoringRuleUpdateResponseEnvelopeMessages `json:"messages,required"`
- Result MagicNetworkMonitoringRuleUpdateResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success MagicNetworkMonitoringRuleUpdateResponseEnvelopeSuccess `json:"success,required"`
- JSON magicNetworkMonitoringRuleUpdateResponseEnvelopeJSON `json:"-"`
-}
-
-// magicNetworkMonitoringRuleUpdateResponseEnvelopeJSON contains the JSON metadata
-// for the struct [MagicNetworkMonitoringRuleUpdateResponseEnvelope]
-type magicNetworkMonitoringRuleUpdateResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicNetworkMonitoringRuleUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicNetworkMonitoringRuleUpdateResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicNetworkMonitoringRuleUpdateResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON magicNetworkMonitoringRuleUpdateResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// magicNetworkMonitoringRuleUpdateResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct [MagicNetworkMonitoringRuleUpdateResponseEnvelopeErrors]
-type magicNetworkMonitoringRuleUpdateResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicNetworkMonitoringRuleUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicNetworkMonitoringRuleUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicNetworkMonitoringRuleUpdateResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON magicNetworkMonitoringRuleUpdateResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// magicNetworkMonitoringRuleUpdateResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct
-// [MagicNetworkMonitoringRuleUpdateResponseEnvelopeMessages]
-type magicNetworkMonitoringRuleUpdateResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicNetworkMonitoringRuleUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicNetworkMonitoringRuleUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type MagicNetworkMonitoringRuleUpdateResponseEnvelopeSuccess bool
-
-const (
- MagicNetworkMonitoringRuleUpdateResponseEnvelopeSuccessTrue MagicNetworkMonitoringRuleUpdateResponseEnvelopeSuccess = true
-)
-
-type MagicNetworkMonitoringRuleListResponseEnvelope struct {
- Errors []MagicNetworkMonitoringRuleListResponseEnvelopeErrors `json:"errors,required"`
- Messages []MagicNetworkMonitoringRuleListResponseEnvelopeMessages `json:"messages,required"`
- Result []MagicNetworkMonitoringRuleListResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success MagicNetworkMonitoringRuleListResponseEnvelopeSuccess `json:"success,required"`
- ResultInfo MagicNetworkMonitoringRuleListResponseEnvelopeResultInfo `json:"result_info"`
- JSON magicNetworkMonitoringRuleListResponseEnvelopeJSON `json:"-"`
-}
-
-// magicNetworkMonitoringRuleListResponseEnvelopeJSON contains the JSON metadata
-// for the struct [MagicNetworkMonitoringRuleListResponseEnvelope]
-type magicNetworkMonitoringRuleListResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- ResultInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicNetworkMonitoringRuleListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicNetworkMonitoringRuleListResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicNetworkMonitoringRuleListResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON magicNetworkMonitoringRuleListResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// magicNetworkMonitoringRuleListResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct [MagicNetworkMonitoringRuleListResponseEnvelopeErrors]
-type magicNetworkMonitoringRuleListResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicNetworkMonitoringRuleListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicNetworkMonitoringRuleListResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicNetworkMonitoringRuleListResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON magicNetworkMonitoringRuleListResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// magicNetworkMonitoringRuleListResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct [MagicNetworkMonitoringRuleListResponseEnvelopeMessages]
-type magicNetworkMonitoringRuleListResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicNetworkMonitoringRuleListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicNetworkMonitoringRuleListResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type MagicNetworkMonitoringRuleListResponseEnvelopeSuccess bool
-
-const (
- MagicNetworkMonitoringRuleListResponseEnvelopeSuccessTrue MagicNetworkMonitoringRuleListResponseEnvelopeSuccess = true
-)
-
-type MagicNetworkMonitoringRuleListResponseEnvelopeResultInfo struct {
- // Total number of results for the requested service
- Count float64 `json:"count"`
- // Current page within paginated list of results
- Page float64 `json:"page"`
- // Number of results per page of results
- PerPage float64 `json:"per_page"`
- // Total results available without any search parameters
- TotalCount float64 `json:"total_count"`
- JSON magicNetworkMonitoringRuleListResponseEnvelopeResultInfoJSON `json:"-"`
-}
-
-// magicNetworkMonitoringRuleListResponseEnvelopeResultInfoJSON contains the JSON
-// metadata for the struct
-// [MagicNetworkMonitoringRuleListResponseEnvelopeResultInfo]
-type magicNetworkMonitoringRuleListResponseEnvelopeResultInfoJSON struct {
- Count apijson.Field
- Page apijson.Field
- PerPage apijson.Field
- TotalCount apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicNetworkMonitoringRuleListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicNetworkMonitoringRuleListResponseEnvelopeResultInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicNetworkMonitoringRuleDeleteResponseEnvelope struct {
- Errors []MagicNetworkMonitoringRuleDeleteResponseEnvelopeErrors `json:"errors,required"`
- Messages []MagicNetworkMonitoringRuleDeleteResponseEnvelopeMessages `json:"messages,required"`
- Result MagicNetworkMonitoringRuleDeleteResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success MagicNetworkMonitoringRuleDeleteResponseEnvelopeSuccess `json:"success,required"`
- JSON magicNetworkMonitoringRuleDeleteResponseEnvelopeJSON `json:"-"`
-}
-
-// magicNetworkMonitoringRuleDeleteResponseEnvelopeJSON contains the JSON metadata
-// for the struct [MagicNetworkMonitoringRuleDeleteResponseEnvelope]
-type magicNetworkMonitoringRuleDeleteResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicNetworkMonitoringRuleDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicNetworkMonitoringRuleDeleteResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicNetworkMonitoringRuleDeleteResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON magicNetworkMonitoringRuleDeleteResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// magicNetworkMonitoringRuleDeleteResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct [MagicNetworkMonitoringRuleDeleteResponseEnvelopeErrors]
-type magicNetworkMonitoringRuleDeleteResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicNetworkMonitoringRuleDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicNetworkMonitoringRuleDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicNetworkMonitoringRuleDeleteResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON magicNetworkMonitoringRuleDeleteResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// magicNetworkMonitoringRuleDeleteResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct
-// [MagicNetworkMonitoringRuleDeleteResponseEnvelopeMessages]
-type magicNetworkMonitoringRuleDeleteResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicNetworkMonitoringRuleDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicNetworkMonitoringRuleDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type MagicNetworkMonitoringRuleDeleteResponseEnvelopeSuccess bool
-
-const (
- MagicNetworkMonitoringRuleDeleteResponseEnvelopeSuccessTrue MagicNetworkMonitoringRuleDeleteResponseEnvelopeSuccess = true
-)
-
-type MagicNetworkMonitoringRuleEditResponseEnvelope struct {
- Errors []MagicNetworkMonitoringRuleEditResponseEnvelopeErrors `json:"errors,required"`
- Messages []MagicNetworkMonitoringRuleEditResponseEnvelopeMessages `json:"messages,required"`
- Result MagicNetworkMonitoringRuleEditResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success MagicNetworkMonitoringRuleEditResponseEnvelopeSuccess `json:"success,required"`
- JSON magicNetworkMonitoringRuleEditResponseEnvelopeJSON `json:"-"`
-}
-
-// magicNetworkMonitoringRuleEditResponseEnvelopeJSON contains the JSON metadata
-// for the struct [MagicNetworkMonitoringRuleEditResponseEnvelope]
-type magicNetworkMonitoringRuleEditResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicNetworkMonitoringRuleEditResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicNetworkMonitoringRuleEditResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicNetworkMonitoringRuleEditResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON magicNetworkMonitoringRuleEditResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// magicNetworkMonitoringRuleEditResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct [MagicNetworkMonitoringRuleEditResponseEnvelopeErrors]
-type magicNetworkMonitoringRuleEditResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicNetworkMonitoringRuleEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicNetworkMonitoringRuleEditResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicNetworkMonitoringRuleEditResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON magicNetworkMonitoringRuleEditResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// magicNetworkMonitoringRuleEditResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct [MagicNetworkMonitoringRuleEditResponseEnvelopeMessages]
-type magicNetworkMonitoringRuleEditResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicNetworkMonitoringRuleEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicNetworkMonitoringRuleEditResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type MagicNetworkMonitoringRuleEditResponseEnvelopeSuccess bool
-
-const (
- MagicNetworkMonitoringRuleEditResponseEnvelopeSuccessTrue MagicNetworkMonitoringRuleEditResponseEnvelopeSuccess = true
-)
-
-type MagicNetworkMonitoringRuleGetResponseEnvelope struct {
- Errors []MagicNetworkMonitoringRuleGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []MagicNetworkMonitoringRuleGetResponseEnvelopeMessages `json:"messages,required"`
- Result MagicNetworkMonitoringRuleGetResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success MagicNetworkMonitoringRuleGetResponseEnvelopeSuccess `json:"success,required"`
- JSON magicNetworkMonitoringRuleGetResponseEnvelopeJSON `json:"-"`
-}
-
-// magicNetworkMonitoringRuleGetResponseEnvelopeJSON contains the JSON metadata for
-// the struct [MagicNetworkMonitoringRuleGetResponseEnvelope]
-type magicNetworkMonitoringRuleGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicNetworkMonitoringRuleGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicNetworkMonitoringRuleGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicNetworkMonitoringRuleGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON magicNetworkMonitoringRuleGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// magicNetworkMonitoringRuleGetResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct [MagicNetworkMonitoringRuleGetResponseEnvelopeErrors]
-type magicNetworkMonitoringRuleGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicNetworkMonitoringRuleGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicNetworkMonitoringRuleGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicNetworkMonitoringRuleGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON magicNetworkMonitoringRuleGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// magicNetworkMonitoringRuleGetResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct [MagicNetworkMonitoringRuleGetResponseEnvelopeMessages]
-type magicNetworkMonitoringRuleGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicNetworkMonitoringRuleGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicNetworkMonitoringRuleGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type MagicNetworkMonitoringRuleGetResponseEnvelopeSuccess bool
-
-const (
- MagicNetworkMonitoringRuleGetResponseEnvelopeSuccessTrue MagicNetworkMonitoringRuleGetResponseEnvelopeSuccess = true
-)
diff --git a/magicnetworkmonitoringrule_test.go b/magicnetworkmonitoringrule_test.go
deleted file mode 100644
index 8722e3eb187..00000000000
--- a/magicnetworkmonitoringrule_test.go
+++ /dev/null
@@ -1,170 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestMagicNetworkMonitoringRuleNew(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"),
- )
- _, err := client.MagicNetworkMonitoring.Rules.New(context.TODO(), "6f91088a406011ed95aed352566e8d4c")
- 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())
- }
-}
-
-func TestMagicNetworkMonitoringRuleUpdate(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"),
- )
- _, err := client.MagicNetworkMonitoring.Rules.Update(context.TODO(), "6f91088a406011ed95aed352566e8d4c")
- 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())
- }
-}
-
-func TestMagicNetworkMonitoringRuleList(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"),
- )
- _, err := client.MagicNetworkMonitoring.Rules.List(context.TODO(), "6f91088a406011ed95aed352566e8d4c")
- 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())
- }
-}
-
-func TestMagicNetworkMonitoringRuleDelete(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"),
- )
- _, err := client.MagicNetworkMonitoring.Rules.Delete(
- context.TODO(),
- "6f91088a406011ed95aed352566e8d4c",
- "2890e6fa406311ed9b5a23f70f6fb8cf",
- )
- 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())
- }
-}
-
-func TestMagicNetworkMonitoringRuleEdit(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"),
- )
- _, err := client.MagicNetworkMonitoring.Rules.Edit(
- context.TODO(),
- "6f91088a406011ed95aed352566e8d4c",
- "2890e6fa406311ed9b5a23f70f6fb8cf",
- )
- 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())
- }
-}
-
-func TestMagicNetworkMonitoringRuleGet(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"),
- )
- _, err := client.MagicNetworkMonitoring.Rules.Get(
- context.TODO(),
- "6f91088a406011ed95aed352566e8d4c",
- "2890e6fa406311ed9b5a23f70f6fb8cf",
- )
- 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/magicnetworkmonitoringruleadvertisement.go b/magicnetworkmonitoringruleadvertisement.go
deleted file mode 100644
index 5365c0f173e..00000000000
--- a/magicnetworkmonitoringruleadvertisement.go
+++ /dev/null
@@ -1,153 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// MagicNetworkMonitoringRuleAdvertisementService contains methods and other
-// services that help with interacting with the cloudflare API. Note, unlike
-// clients, this service does not read variables from the environment
-// automatically. You should not instantiate this service directly, and instead use
-// the [NewMagicNetworkMonitoringRuleAdvertisementService] method instead.
-type MagicNetworkMonitoringRuleAdvertisementService struct {
- Options []option.RequestOption
-}
-
-// NewMagicNetworkMonitoringRuleAdvertisementService generates a new service that
-// applies the given options to each request. These options are applied after the
-// parent client's options (if there is one), and before any request-specific
-// options.
-func NewMagicNetworkMonitoringRuleAdvertisementService(opts ...option.RequestOption) (r *MagicNetworkMonitoringRuleAdvertisementService) {
- r = &MagicNetworkMonitoringRuleAdvertisementService{}
- r.Options = opts
- return
-}
-
-// Update advertisement for rule.
-func (r *MagicNetworkMonitoringRuleAdvertisementService) Edit(ctx context.Context, accountIdentifier interface{}, ruleIdentifier interface{}, opts ...option.RequestOption) (res *MagicNetworkMonitoringRuleAdvertisementEditResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env MagicNetworkMonitoringRuleAdvertisementEditResponseEnvelope
- path := fmt.Sprintf("accounts/%v/mnm/rules/%v/advertisement", accountIdentifier, ruleIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, nil, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type MagicNetworkMonitoringRuleAdvertisementEditResponse struct {
- // Toggle on if you would like Cloudflare to automatically advertise the IP
- // Prefixes within the rule via Magic Transit when the rule is triggered. Only
- // available for users of Magic Transit.
- AutomaticAdvertisement bool `json:"automatic_advertisement,required,nullable"`
- JSON magicNetworkMonitoringRuleAdvertisementEditResponseJSON `json:"-"`
-}
-
-// magicNetworkMonitoringRuleAdvertisementEditResponseJSON contains the JSON
-// metadata for the struct [MagicNetworkMonitoringRuleAdvertisementEditResponse]
-type magicNetworkMonitoringRuleAdvertisementEditResponseJSON struct {
- AutomaticAdvertisement apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicNetworkMonitoringRuleAdvertisementEditResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicNetworkMonitoringRuleAdvertisementEditResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicNetworkMonitoringRuleAdvertisementEditResponseEnvelope struct {
- Errors []MagicNetworkMonitoringRuleAdvertisementEditResponseEnvelopeErrors `json:"errors,required"`
- Messages []MagicNetworkMonitoringRuleAdvertisementEditResponseEnvelopeMessages `json:"messages,required"`
- Result MagicNetworkMonitoringRuleAdvertisementEditResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success MagicNetworkMonitoringRuleAdvertisementEditResponseEnvelopeSuccess `json:"success,required"`
- JSON magicNetworkMonitoringRuleAdvertisementEditResponseEnvelopeJSON `json:"-"`
-}
-
-// magicNetworkMonitoringRuleAdvertisementEditResponseEnvelopeJSON contains the
-// JSON metadata for the struct
-// [MagicNetworkMonitoringRuleAdvertisementEditResponseEnvelope]
-type magicNetworkMonitoringRuleAdvertisementEditResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicNetworkMonitoringRuleAdvertisementEditResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicNetworkMonitoringRuleAdvertisementEditResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicNetworkMonitoringRuleAdvertisementEditResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON magicNetworkMonitoringRuleAdvertisementEditResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// magicNetworkMonitoringRuleAdvertisementEditResponseEnvelopeErrorsJSON contains
-// the JSON metadata for the struct
-// [MagicNetworkMonitoringRuleAdvertisementEditResponseEnvelopeErrors]
-type magicNetworkMonitoringRuleAdvertisementEditResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicNetworkMonitoringRuleAdvertisementEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicNetworkMonitoringRuleAdvertisementEditResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicNetworkMonitoringRuleAdvertisementEditResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON magicNetworkMonitoringRuleAdvertisementEditResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// magicNetworkMonitoringRuleAdvertisementEditResponseEnvelopeMessagesJSON contains
-// the JSON metadata for the struct
-// [MagicNetworkMonitoringRuleAdvertisementEditResponseEnvelopeMessages]
-type magicNetworkMonitoringRuleAdvertisementEditResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicNetworkMonitoringRuleAdvertisementEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicNetworkMonitoringRuleAdvertisementEditResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type MagicNetworkMonitoringRuleAdvertisementEditResponseEnvelopeSuccess bool
-
-const (
- MagicNetworkMonitoringRuleAdvertisementEditResponseEnvelopeSuccessTrue MagicNetworkMonitoringRuleAdvertisementEditResponseEnvelopeSuccess = true
-)
diff --git a/magicnetworkmonitoringruleadvertisement_test.go b/magicnetworkmonitoringruleadvertisement_test.go
deleted file mode 100644
index ff901c1374d..00000000000
--- a/magicnetworkmonitoringruleadvertisement_test.go
+++ /dev/null
@@ -1,42 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestMagicNetworkMonitoringRuleAdvertisementEdit(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"),
- )
- _, err := client.MagicNetworkMonitoring.Rules.Advertisements.Edit(
- context.TODO(),
- "6f91088a406011ed95aed352566e8d4c",
- "2890e6fa406311ed9b5a23f70f6fb8cf",
- )
- 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/magictransit.go b/magictransit.go
deleted file mode 100644
index 56d27cd3ac4..00000000000
--- a/magictransit.go
+++ /dev/null
@@ -1,33 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// MagicTransitService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewMagicTransitService] method
-// instead.
-type MagicTransitService struct {
- Options []option.RequestOption
- CfInterconnects *MagicTransitCfInterconnectService
- GRETunnels *MagicTransitGRETunnelService
- IPSECTunnels *MagicTransitIPSECTunnelService
- Routes *MagicTransitRouteService
-}
-
-// NewMagicTransitService generates a new service that applies the given options to
-// each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewMagicTransitService(opts ...option.RequestOption) (r *MagicTransitService) {
- r = &MagicTransitService{}
- r.Options = opts
- r.CfInterconnects = NewMagicTransitCfInterconnectService(opts...)
- r.GRETunnels = NewMagicTransitGRETunnelService(opts...)
- r.IPSECTunnels = NewMagicTransitIPSECTunnelService(opts...)
- r.Routes = NewMagicTransitRouteService(opts...)
- return
-}
diff --git a/magictransitcfinterconnect.go b/magictransitcfinterconnect.go
deleted file mode 100644
index cc92ee14f98..00000000000
--- a/magictransitcfinterconnect.go
+++ /dev/null
@@ -1,573 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// MagicTransitCfInterconnectService contains methods and other services that help
-// with interacting with the cloudflare API. Note, unlike clients, this service
-// does not read variables from the environment automatically. You should not
-// instantiate this service directly, and instead use the
-// [NewMagicTransitCfInterconnectService] method instead.
-type MagicTransitCfInterconnectService struct {
- Options []option.RequestOption
-}
-
-// NewMagicTransitCfInterconnectService generates a new service that applies the
-// given options to each request. These options are applied after the parent
-// client's options (if there is one), and before any request-specific options.
-func NewMagicTransitCfInterconnectService(opts ...option.RequestOption) (r *MagicTransitCfInterconnectService) {
- r = &MagicTransitCfInterconnectService{}
- r.Options = opts
- return
-}
-
-// Updates a specific interconnect associated with an account. Use
-// `?validate_only=true` as an optional query parameter to only run validation
-// without persisting changes.
-func (r *MagicTransitCfInterconnectService) Update(ctx context.Context, accountIdentifier string, tunnelIdentifier string, body MagicTransitCfInterconnectUpdateParams, opts ...option.RequestOption) (res *MagicTransitCfInterconnectUpdateResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env MagicTransitCfInterconnectUpdateResponseEnvelope
- path := fmt.Sprintf("accounts/%s/magic/cf_interconnects/%s", accountIdentifier, tunnelIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Lists interconnects associated with an account.
-func (r *MagicTransitCfInterconnectService) List(ctx context.Context, accountIdentifier string, opts ...option.RequestOption) (res *MagicTransitCfInterconnectListResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env MagicTransitCfInterconnectListResponseEnvelope
- path := fmt.Sprintf("accounts/%s/magic/cf_interconnects", accountIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Lists details for a specific interconnect.
-func (r *MagicTransitCfInterconnectService) Get(ctx context.Context, accountIdentifier string, tunnelIdentifier string, opts ...option.RequestOption) (res *MagicTransitCfInterconnectGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env MagicTransitCfInterconnectGetResponseEnvelope
- path := fmt.Sprintf("accounts/%s/magic/cf_interconnects/%s", accountIdentifier, tunnelIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type MagicTransitCfInterconnectUpdateResponse struct {
- Modified bool `json:"modified"`
- ModifiedInterconnect interface{} `json:"modified_interconnect"`
- JSON magicTransitCfInterconnectUpdateResponseJSON `json:"-"`
-}
-
-// magicTransitCfInterconnectUpdateResponseJSON contains the JSON metadata for the
-// struct [MagicTransitCfInterconnectUpdateResponse]
-type magicTransitCfInterconnectUpdateResponseJSON struct {
- Modified apijson.Field
- ModifiedInterconnect apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitCfInterconnectUpdateResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitCfInterconnectUpdateResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicTransitCfInterconnectListResponse struct {
- Interconnects []MagicTransitCfInterconnectListResponseInterconnect `json:"interconnects"`
- JSON magicTransitCfInterconnectListResponseJSON `json:"-"`
-}
-
-// magicTransitCfInterconnectListResponseJSON contains the JSON metadata for the
-// struct [MagicTransitCfInterconnectListResponse]
-type magicTransitCfInterconnectListResponseJSON struct {
- Interconnects apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitCfInterconnectListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitCfInterconnectListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicTransitCfInterconnectListResponseInterconnect struct {
- // Tunnel identifier tag.
- ID string `json:"id"`
- // The name of the interconnect. The name cannot share a name with other tunnels.
- ColoName string `json:"colo_name"`
- // The date and time the tunnel was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // An optional description of the interconnect.
- Description string `json:"description"`
- // The configuration specific to GRE interconnects.
- GRE MagicTransitCfInterconnectListResponseInterconnectsGRE `json:"gre"`
- HealthCheck MagicTransitCfInterconnectListResponseInterconnectsHealthCheck `json:"health_check"`
- // A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side
- // of the tunnel. Select the subnet from the following private IP space:
- // 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255.
- InterfaceAddress string `json:"interface_address"`
- // The date and time the tunnel was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // The Maximum Transmission Unit (MTU) in bytes for the interconnect. The minimum
- // value is 576.
- Mtu int64 `json:"mtu"`
- // The name of the interconnect. The name cannot share a name with other tunnels.
- Name string `json:"name"`
- JSON magicTransitCfInterconnectListResponseInterconnectJSON `json:"-"`
-}
-
-// magicTransitCfInterconnectListResponseInterconnectJSON contains the JSON
-// metadata for the struct [MagicTransitCfInterconnectListResponseInterconnect]
-type magicTransitCfInterconnectListResponseInterconnectJSON struct {
- ID apijson.Field
- ColoName apijson.Field
- CreatedOn apijson.Field
- Description apijson.Field
- GRE apijson.Field
- HealthCheck apijson.Field
- InterfaceAddress apijson.Field
- ModifiedOn apijson.Field
- Mtu apijson.Field
- Name apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitCfInterconnectListResponseInterconnect) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitCfInterconnectListResponseInterconnectJSON) RawJSON() string {
- return r.raw
-}
-
-// The configuration specific to GRE interconnects.
-type MagicTransitCfInterconnectListResponseInterconnectsGRE struct {
- // The IP address assigned to the Cloudflare side of the GRE tunnel created as part
- // of the Interconnect.
- CloudflareEndpoint string `json:"cloudflare_endpoint"`
- JSON magicTransitCfInterconnectListResponseInterconnectsGREJSON `json:"-"`
-}
-
-// magicTransitCfInterconnectListResponseInterconnectsGREJSON contains the JSON
-// metadata for the struct [MagicTransitCfInterconnectListResponseInterconnectsGRE]
-type magicTransitCfInterconnectListResponseInterconnectsGREJSON struct {
- CloudflareEndpoint apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitCfInterconnectListResponseInterconnectsGRE) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitCfInterconnectListResponseInterconnectsGREJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicTransitCfInterconnectListResponseInterconnectsHealthCheck struct {
- // Determines whether to run healthchecks for a tunnel.
- Enabled bool `json:"enabled"`
- // How frequent the health check is run. The default value is `mid`.
- Rate MagicTransitCfInterconnectListResponseInterconnectsHealthCheckRate `json:"rate"`
- // The destination address in a request type health check. After the healthcheck is
- // decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded
- // to this address. This field defaults to `customer_gre_endpoint address`.
- Target string `json:"target"`
- // The type of healthcheck to run, reply or request. The default value is `reply`.
- Type MagicTransitCfInterconnectListResponseInterconnectsHealthCheckType `json:"type"`
- JSON magicTransitCfInterconnectListResponseInterconnectsHealthCheckJSON `json:"-"`
-}
-
-// magicTransitCfInterconnectListResponseInterconnectsHealthCheckJSON contains the
-// JSON metadata for the struct
-// [MagicTransitCfInterconnectListResponseInterconnectsHealthCheck]
-type magicTransitCfInterconnectListResponseInterconnectsHealthCheckJSON struct {
- Enabled apijson.Field
- Rate apijson.Field
- Target apijson.Field
- Type apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitCfInterconnectListResponseInterconnectsHealthCheck) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitCfInterconnectListResponseInterconnectsHealthCheckJSON) RawJSON() string {
- return r.raw
-}
-
-// How frequent the health check is run. The default value is `mid`.
-type MagicTransitCfInterconnectListResponseInterconnectsHealthCheckRate string
-
-const (
- MagicTransitCfInterconnectListResponseInterconnectsHealthCheckRateLow MagicTransitCfInterconnectListResponseInterconnectsHealthCheckRate = "low"
- MagicTransitCfInterconnectListResponseInterconnectsHealthCheckRateMid MagicTransitCfInterconnectListResponseInterconnectsHealthCheckRate = "mid"
- MagicTransitCfInterconnectListResponseInterconnectsHealthCheckRateHigh MagicTransitCfInterconnectListResponseInterconnectsHealthCheckRate = "high"
-)
-
-// The type of healthcheck to run, reply or request. The default value is `reply`.
-type MagicTransitCfInterconnectListResponseInterconnectsHealthCheckType string
-
-const (
- MagicTransitCfInterconnectListResponseInterconnectsHealthCheckTypeReply MagicTransitCfInterconnectListResponseInterconnectsHealthCheckType = "reply"
- MagicTransitCfInterconnectListResponseInterconnectsHealthCheckTypeRequest MagicTransitCfInterconnectListResponseInterconnectsHealthCheckType = "request"
-)
-
-type MagicTransitCfInterconnectGetResponse struct {
- Interconnect interface{} `json:"interconnect"`
- JSON magicTransitCfInterconnectGetResponseJSON `json:"-"`
-}
-
-// magicTransitCfInterconnectGetResponseJSON contains the JSON metadata for the
-// struct [MagicTransitCfInterconnectGetResponse]
-type magicTransitCfInterconnectGetResponseJSON struct {
- Interconnect apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitCfInterconnectGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitCfInterconnectGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicTransitCfInterconnectUpdateParams struct {
- // An optional description of the interconnect.
- Description param.Field[string] `json:"description"`
- // The configuration specific to GRE interconnects.
- GRE param.Field[MagicTransitCfInterconnectUpdateParamsGRE] `json:"gre"`
- HealthCheck param.Field[MagicTransitCfInterconnectUpdateParamsHealthCheck] `json:"health_check"`
- // A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side
- // of the tunnel. Select the subnet from the following private IP space:
- // 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255.
- InterfaceAddress param.Field[string] `json:"interface_address"`
- // The Maximum Transmission Unit (MTU) in bytes for the interconnect. The minimum
- // value is 576.
- Mtu param.Field[int64] `json:"mtu"`
-}
-
-func (r MagicTransitCfInterconnectUpdateParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The configuration specific to GRE interconnects.
-type MagicTransitCfInterconnectUpdateParamsGRE struct {
- // The IP address assigned to the Cloudflare side of the GRE tunnel created as part
- // of the Interconnect.
- CloudflareEndpoint param.Field[string] `json:"cloudflare_endpoint"`
-}
-
-func (r MagicTransitCfInterconnectUpdateParamsGRE) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type MagicTransitCfInterconnectUpdateParamsHealthCheck struct {
- // Determines whether to run healthchecks for a tunnel.
- Enabled param.Field[bool] `json:"enabled"`
- // How frequent the health check is run. The default value is `mid`.
- Rate param.Field[MagicTransitCfInterconnectUpdateParamsHealthCheckRate] `json:"rate"`
- // The destination address in a request type health check. After the healthcheck is
- // decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded
- // to this address. This field defaults to `customer_gre_endpoint address`.
- Target param.Field[string] `json:"target"`
- // The type of healthcheck to run, reply or request. The default value is `reply`.
- Type param.Field[MagicTransitCfInterconnectUpdateParamsHealthCheckType] `json:"type"`
-}
-
-func (r MagicTransitCfInterconnectUpdateParamsHealthCheck) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// How frequent the health check is run. The default value is `mid`.
-type MagicTransitCfInterconnectUpdateParamsHealthCheckRate string
-
-const (
- MagicTransitCfInterconnectUpdateParamsHealthCheckRateLow MagicTransitCfInterconnectUpdateParamsHealthCheckRate = "low"
- MagicTransitCfInterconnectUpdateParamsHealthCheckRateMid MagicTransitCfInterconnectUpdateParamsHealthCheckRate = "mid"
- MagicTransitCfInterconnectUpdateParamsHealthCheckRateHigh MagicTransitCfInterconnectUpdateParamsHealthCheckRate = "high"
-)
-
-// The type of healthcheck to run, reply or request. The default value is `reply`.
-type MagicTransitCfInterconnectUpdateParamsHealthCheckType string
-
-const (
- MagicTransitCfInterconnectUpdateParamsHealthCheckTypeReply MagicTransitCfInterconnectUpdateParamsHealthCheckType = "reply"
- MagicTransitCfInterconnectUpdateParamsHealthCheckTypeRequest MagicTransitCfInterconnectUpdateParamsHealthCheckType = "request"
-)
-
-type MagicTransitCfInterconnectUpdateResponseEnvelope struct {
- Errors []MagicTransitCfInterconnectUpdateResponseEnvelopeErrors `json:"errors,required"`
- Messages []MagicTransitCfInterconnectUpdateResponseEnvelopeMessages `json:"messages,required"`
- Result MagicTransitCfInterconnectUpdateResponse `json:"result,required"`
- // Whether the API call was successful
- Success MagicTransitCfInterconnectUpdateResponseEnvelopeSuccess `json:"success,required"`
- JSON magicTransitCfInterconnectUpdateResponseEnvelopeJSON `json:"-"`
-}
-
-// magicTransitCfInterconnectUpdateResponseEnvelopeJSON contains the JSON metadata
-// for the struct [MagicTransitCfInterconnectUpdateResponseEnvelope]
-type magicTransitCfInterconnectUpdateResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitCfInterconnectUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitCfInterconnectUpdateResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicTransitCfInterconnectUpdateResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON magicTransitCfInterconnectUpdateResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// magicTransitCfInterconnectUpdateResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct [MagicTransitCfInterconnectUpdateResponseEnvelopeErrors]
-type magicTransitCfInterconnectUpdateResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitCfInterconnectUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitCfInterconnectUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicTransitCfInterconnectUpdateResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON magicTransitCfInterconnectUpdateResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// magicTransitCfInterconnectUpdateResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct
-// [MagicTransitCfInterconnectUpdateResponseEnvelopeMessages]
-type magicTransitCfInterconnectUpdateResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitCfInterconnectUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitCfInterconnectUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type MagicTransitCfInterconnectUpdateResponseEnvelopeSuccess bool
-
-const (
- MagicTransitCfInterconnectUpdateResponseEnvelopeSuccessTrue MagicTransitCfInterconnectUpdateResponseEnvelopeSuccess = true
-)
-
-type MagicTransitCfInterconnectListResponseEnvelope struct {
- Errors []MagicTransitCfInterconnectListResponseEnvelopeErrors `json:"errors,required"`
- Messages []MagicTransitCfInterconnectListResponseEnvelopeMessages `json:"messages,required"`
- Result MagicTransitCfInterconnectListResponse `json:"result,required"`
- // Whether the API call was successful
- Success MagicTransitCfInterconnectListResponseEnvelopeSuccess `json:"success,required"`
- JSON magicTransitCfInterconnectListResponseEnvelopeJSON `json:"-"`
-}
-
-// magicTransitCfInterconnectListResponseEnvelopeJSON contains the JSON metadata
-// for the struct [MagicTransitCfInterconnectListResponseEnvelope]
-type magicTransitCfInterconnectListResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitCfInterconnectListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitCfInterconnectListResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicTransitCfInterconnectListResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON magicTransitCfInterconnectListResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// magicTransitCfInterconnectListResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct [MagicTransitCfInterconnectListResponseEnvelopeErrors]
-type magicTransitCfInterconnectListResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitCfInterconnectListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitCfInterconnectListResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicTransitCfInterconnectListResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON magicTransitCfInterconnectListResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// magicTransitCfInterconnectListResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct [MagicTransitCfInterconnectListResponseEnvelopeMessages]
-type magicTransitCfInterconnectListResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitCfInterconnectListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitCfInterconnectListResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type MagicTransitCfInterconnectListResponseEnvelopeSuccess bool
-
-const (
- MagicTransitCfInterconnectListResponseEnvelopeSuccessTrue MagicTransitCfInterconnectListResponseEnvelopeSuccess = true
-)
-
-type MagicTransitCfInterconnectGetResponseEnvelope struct {
- Errors []MagicTransitCfInterconnectGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []MagicTransitCfInterconnectGetResponseEnvelopeMessages `json:"messages,required"`
- Result MagicTransitCfInterconnectGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success MagicTransitCfInterconnectGetResponseEnvelopeSuccess `json:"success,required"`
- JSON magicTransitCfInterconnectGetResponseEnvelopeJSON `json:"-"`
-}
-
-// magicTransitCfInterconnectGetResponseEnvelopeJSON contains the JSON metadata for
-// the struct [MagicTransitCfInterconnectGetResponseEnvelope]
-type magicTransitCfInterconnectGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitCfInterconnectGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitCfInterconnectGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicTransitCfInterconnectGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON magicTransitCfInterconnectGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// magicTransitCfInterconnectGetResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct [MagicTransitCfInterconnectGetResponseEnvelopeErrors]
-type magicTransitCfInterconnectGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitCfInterconnectGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitCfInterconnectGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicTransitCfInterconnectGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON magicTransitCfInterconnectGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// magicTransitCfInterconnectGetResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct [MagicTransitCfInterconnectGetResponseEnvelopeMessages]
-type magicTransitCfInterconnectGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitCfInterconnectGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitCfInterconnectGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type MagicTransitCfInterconnectGetResponseEnvelopeSuccess bool
-
-const (
- MagicTransitCfInterconnectGetResponseEnvelopeSuccessTrue MagicTransitCfInterconnectGetResponseEnvelopeSuccess = true
-)
diff --git a/magictransitcfinterconnect_test.go b/magictransitcfinterconnect_test.go
deleted file mode 100644
index 50b2be4be74..00000000000
--- a/magictransitcfinterconnect_test.go
+++ /dev/null
@@ -1,108 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestMagicTransitCfInterconnectUpdateWithOptionalParams(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"),
- )
- _, err := client.MagicTransit.CfInterconnects.Update(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.MagicTransitCfInterconnectUpdateParams{
- Description: cloudflare.F("Tunnel for Interconnect to ORD"),
- GRE: cloudflare.F(cloudflare.MagicTransitCfInterconnectUpdateParamsGRE{
- CloudflareEndpoint: cloudflare.F("203.0.113.1"),
- }),
- HealthCheck: cloudflare.F(cloudflare.MagicTransitCfInterconnectUpdateParamsHealthCheck{
- Enabled: cloudflare.F(true),
- Rate: cloudflare.F(cloudflare.MagicTransitCfInterconnectUpdateParamsHealthCheckRateLow),
- Target: cloudflare.F("203.0.113.1"),
- Type: cloudflare.F(cloudflare.MagicTransitCfInterconnectUpdateParamsHealthCheckTypeRequest),
- }),
- InterfaceAddress: cloudflare.F("192.0.2.0/31"),
- Mtu: cloudflare.F(int64(0)),
- },
- )
- 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())
- }
-}
-
-func TestMagicTransitCfInterconnectList(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"),
- )
- _, err := client.MagicTransit.CfInterconnects.List(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353")
- 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())
- }
-}
-
-func TestMagicTransitCfInterconnectGet(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"),
- )
- _, err := client.MagicTransit.CfInterconnects.Get(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- "023e105f4ecef8ad9ca31a8372d0c353",
- )
- 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/magictransitgretunnel.go b/magictransitgretunnel.go
deleted file mode 100644
index b6a23489840..00000000000
--- a/magictransitgretunnel.go
+++ /dev/null
@@ -1,961 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// MagicTransitGRETunnelService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewMagicTransitGRETunnelService]
-// method instead.
-type MagicTransitGRETunnelService struct {
- Options []option.RequestOption
-}
-
-// NewMagicTransitGRETunnelService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewMagicTransitGRETunnelService(opts ...option.RequestOption) (r *MagicTransitGRETunnelService) {
- r = &MagicTransitGRETunnelService{}
- r.Options = opts
- return
-}
-
-// Creates new GRE tunnels. Use `?validate_only=true` as an optional query
-// parameter to only run validation without persisting changes.
-func (r *MagicTransitGRETunnelService) New(ctx context.Context, accountIdentifier string, body MagicTransitGRETunnelNewParams, opts ...option.RequestOption) (res *MagicTransitGRETunnelNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env MagicTransitGRETunnelNewResponseEnvelope
- path := fmt.Sprintf("accounts/%s/magic/gre_tunnels", accountIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Updates a specific GRE tunnel. Use `?validate_only=true` as an optional query
-// parameter to only run validation without persisting changes.
-func (r *MagicTransitGRETunnelService) Update(ctx context.Context, accountIdentifier string, tunnelIdentifier string, body MagicTransitGRETunnelUpdateParams, opts ...option.RequestOption) (res *MagicTransitGRETunnelUpdateResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env MagicTransitGRETunnelUpdateResponseEnvelope
- path := fmt.Sprintf("accounts/%s/magic/gre_tunnels/%s", accountIdentifier, tunnelIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Lists GRE tunnels associated with an account.
-func (r *MagicTransitGRETunnelService) List(ctx context.Context, accountIdentifier string, opts ...option.RequestOption) (res *MagicTransitGRETunnelListResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env MagicTransitGRETunnelListResponseEnvelope
- path := fmt.Sprintf("accounts/%s/magic/gre_tunnels", accountIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Disables and removes a specific static GRE tunnel. Use `?validate_only=true` as
-// an optional query parameter to only run validation without persisting changes.
-func (r *MagicTransitGRETunnelService) Delete(ctx context.Context, accountIdentifier string, tunnelIdentifier string, opts ...option.RequestOption) (res *MagicTransitGRETunnelDeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env MagicTransitGRETunnelDeleteResponseEnvelope
- path := fmt.Sprintf("accounts/%s/magic/gre_tunnels/%s", accountIdentifier, tunnelIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Lists informtion for a specific GRE tunnel.
-func (r *MagicTransitGRETunnelService) Get(ctx context.Context, accountIdentifier string, tunnelIdentifier string, opts ...option.RequestOption) (res *MagicTransitGRETunnelGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env MagicTransitGRETunnelGetResponseEnvelope
- path := fmt.Sprintf("accounts/%s/magic/gre_tunnels/%s", accountIdentifier, tunnelIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type MagicTransitGRETunnelNewResponse struct {
- GRETunnels []MagicTransitGRETunnelNewResponseGRETunnel `json:"gre_tunnels"`
- JSON magicTransitGRETunnelNewResponseJSON `json:"-"`
-}
-
-// magicTransitGRETunnelNewResponseJSON contains the JSON metadata for the struct
-// [MagicTransitGRETunnelNewResponse]
-type magicTransitGRETunnelNewResponseJSON struct {
- GRETunnels apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitGRETunnelNewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitGRETunnelNewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicTransitGRETunnelNewResponseGRETunnel struct {
- // The IP address assigned to the Cloudflare side of the GRE tunnel.
- CloudflareGREEndpoint string `json:"cloudflare_gre_endpoint,required"`
- // The IP address assigned to the customer side of the GRE tunnel.
- CustomerGREEndpoint string `json:"customer_gre_endpoint,required"`
- // A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side
- // of the tunnel. Select the subnet from the following private IP space:
- // 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255.
- InterfaceAddress string `json:"interface_address,required"`
- // The name of the tunnel. The name cannot contain spaces or special characters,
- // must be 15 characters or less, and cannot share a name with another GRE tunnel.
- Name string `json:"name,required"`
- // Tunnel identifier tag.
- ID string `json:"id"`
- // The date and time the tunnel was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // An optional description of the GRE tunnel.
- Description string `json:"description"`
- HealthCheck MagicTransitGRETunnelNewResponseGRETunnelsHealthCheck `json:"health_check"`
- // The date and time the tunnel was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Maximum Transmission Unit (MTU) in bytes for the GRE tunnel. The minimum value
- // is 576.
- Mtu int64 `json:"mtu"`
- // Time To Live (TTL) in number of hops of the GRE tunnel.
- TTL int64 `json:"ttl"`
- JSON magicTransitGRETunnelNewResponseGRETunnelJSON `json:"-"`
-}
-
-// magicTransitGRETunnelNewResponseGRETunnelJSON contains the JSON metadata for the
-// struct [MagicTransitGRETunnelNewResponseGRETunnel]
-type magicTransitGRETunnelNewResponseGRETunnelJSON struct {
- CloudflareGREEndpoint apijson.Field
- CustomerGREEndpoint apijson.Field
- InterfaceAddress apijson.Field
- Name apijson.Field
- ID apijson.Field
- CreatedOn apijson.Field
- Description apijson.Field
- HealthCheck apijson.Field
- ModifiedOn apijson.Field
- Mtu apijson.Field
- TTL apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitGRETunnelNewResponseGRETunnel) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitGRETunnelNewResponseGRETunnelJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicTransitGRETunnelNewResponseGRETunnelsHealthCheck struct {
- // The direction of the flow of the healthcheck. Either unidirectional, where the
- // probe comes to you via the tunnel and the result comes back to Cloudflare via
- // the open Internet, or bidirectional where both the probe and result come and go
- // via the tunnel. Note in the case of bidirecitonal healthchecks, the target field
- // in health_check is ignored as the interface_address is used to send traffic into
- // the tunnel.
- Direction MagicTransitGRETunnelNewResponseGRETunnelsHealthCheckDirection `json:"direction"`
- // Determines whether to run healthchecks for a tunnel.
- Enabled bool `json:"enabled"`
- // How frequent the health check is run. The default value is `mid`.
- Rate MagicTransitGRETunnelNewResponseGRETunnelsHealthCheckRate `json:"rate"`
- // The destination address in a request type health check. After the healthcheck is
- // decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded
- // to this address. This field defaults to `customer_gre_endpoint address`. This
- // field is ignored for bidirectional healthchecks as the interface_address (not
- // assigned to the Cloudflare side of the tunnel) is used as the target.
- Target string `json:"target"`
- // The type of healthcheck to run, reply or request. The default value is `reply`.
- Type MagicTransitGRETunnelNewResponseGRETunnelsHealthCheckType `json:"type"`
- JSON magicTransitGRETunnelNewResponseGRETunnelsHealthCheckJSON `json:"-"`
-}
-
-// magicTransitGRETunnelNewResponseGRETunnelsHealthCheckJSON contains the JSON
-// metadata for the struct [MagicTransitGRETunnelNewResponseGRETunnelsHealthCheck]
-type magicTransitGRETunnelNewResponseGRETunnelsHealthCheckJSON struct {
- Direction apijson.Field
- Enabled apijson.Field
- Rate apijson.Field
- Target apijson.Field
- Type apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitGRETunnelNewResponseGRETunnelsHealthCheck) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitGRETunnelNewResponseGRETunnelsHealthCheckJSON) RawJSON() string {
- return r.raw
-}
-
-// The direction of the flow of the healthcheck. Either unidirectional, where the
-// probe comes to you via the tunnel and the result comes back to Cloudflare via
-// the open Internet, or bidirectional where both the probe and result come and go
-// via the tunnel. Note in the case of bidirecitonal healthchecks, the target field
-// in health_check is ignored as the interface_address is used to send traffic into
-// the tunnel.
-type MagicTransitGRETunnelNewResponseGRETunnelsHealthCheckDirection string
-
-const (
- MagicTransitGRETunnelNewResponseGRETunnelsHealthCheckDirectionUnidirectional MagicTransitGRETunnelNewResponseGRETunnelsHealthCheckDirection = "unidirectional"
- MagicTransitGRETunnelNewResponseGRETunnelsHealthCheckDirectionBidirectional MagicTransitGRETunnelNewResponseGRETunnelsHealthCheckDirection = "bidirectional"
-)
-
-// How frequent the health check is run. The default value is `mid`.
-type MagicTransitGRETunnelNewResponseGRETunnelsHealthCheckRate string
-
-const (
- MagicTransitGRETunnelNewResponseGRETunnelsHealthCheckRateLow MagicTransitGRETunnelNewResponseGRETunnelsHealthCheckRate = "low"
- MagicTransitGRETunnelNewResponseGRETunnelsHealthCheckRateMid MagicTransitGRETunnelNewResponseGRETunnelsHealthCheckRate = "mid"
- MagicTransitGRETunnelNewResponseGRETunnelsHealthCheckRateHigh MagicTransitGRETunnelNewResponseGRETunnelsHealthCheckRate = "high"
-)
-
-// The type of healthcheck to run, reply or request. The default value is `reply`.
-type MagicTransitGRETunnelNewResponseGRETunnelsHealthCheckType string
-
-const (
- MagicTransitGRETunnelNewResponseGRETunnelsHealthCheckTypeReply MagicTransitGRETunnelNewResponseGRETunnelsHealthCheckType = "reply"
- MagicTransitGRETunnelNewResponseGRETunnelsHealthCheckTypeRequest MagicTransitGRETunnelNewResponseGRETunnelsHealthCheckType = "request"
-)
-
-type MagicTransitGRETunnelUpdateResponse struct {
- Modified bool `json:"modified"`
- ModifiedGRETunnel interface{} `json:"modified_gre_tunnel"`
- JSON magicTransitGRETunnelUpdateResponseJSON `json:"-"`
-}
-
-// magicTransitGRETunnelUpdateResponseJSON contains the JSON metadata for the
-// struct [MagicTransitGRETunnelUpdateResponse]
-type magicTransitGRETunnelUpdateResponseJSON struct {
- Modified apijson.Field
- ModifiedGRETunnel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitGRETunnelUpdateResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitGRETunnelUpdateResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicTransitGRETunnelListResponse struct {
- GRETunnels []MagicTransitGRETunnelListResponseGRETunnel `json:"gre_tunnels"`
- JSON magicTransitGRETunnelListResponseJSON `json:"-"`
-}
-
-// magicTransitGRETunnelListResponseJSON contains the JSON metadata for the struct
-// [MagicTransitGRETunnelListResponse]
-type magicTransitGRETunnelListResponseJSON struct {
- GRETunnels apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitGRETunnelListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitGRETunnelListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicTransitGRETunnelListResponseGRETunnel struct {
- // The IP address assigned to the Cloudflare side of the GRE tunnel.
- CloudflareGREEndpoint string `json:"cloudflare_gre_endpoint,required"`
- // The IP address assigned to the customer side of the GRE tunnel.
- CustomerGREEndpoint string `json:"customer_gre_endpoint,required"`
- // A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side
- // of the tunnel. Select the subnet from the following private IP space:
- // 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255.
- InterfaceAddress string `json:"interface_address,required"`
- // The name of the tunnel. The name cannot contain spaces or special characters,
- // must be 15 characters or less, and cannot share a name with another GRE tunnel.
- Name string `json:"name,required"`
- // Tunnel identifier tag.
- ID string `json:"id"`
- // The date and time the tunnel was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // An optional description of the GRE tunnel.
- Description string `json:"description"`
- HealthCheck MagicTransitGRETunnelListResponseGRETunnelsHealthCheck `json:"health_check"`
- // The date and time the tunnel was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Maximum Transmission Unit (MTU) in bytes for the GRE tunnel. The minimum value
- // is 576.
- Mtu int64 `json:"mtu"`
- // Time To Live (TTL) in number of hops of the GRE tunnel.
- TTL int64 `json:"ttl"`
- JSON magicTransitGRETunnelListResponseGRETunnelJSON `json:"-"`
-}
-
-// magicTransitGRETunnelListResponseGRETunnelJSON contains the JSON metadata for
-// the struct [MagicTransitGRETunnelListResponseGRETunnel]
-type magicTransitGRETunnelListResponseGRETunnelJSON struct {
- CloudflareGREEndpoint apijson.Field
- CustomerGREEndpoint apijson.Field
- InterfaceAddress apijson.Field
- Name apijson.Field
- ID apijson.Field
- CreatedOn apijson.Field
- Description apijson.Field
- HealthCheck apijson.Field
- ModifiedOn apijson.Field
- Mtu apijson.Field
- TTL apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitGRETunnelListResponseGRETunnel) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitGRETunnelListResponseGRETunnelJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicTransitGRETunnelListResponseGRETunnelsHealthCheck struct {
- // The direction of the flow of the healthcheck. Either unidirectional, where the
- // probe comes to you via the tunnel and the result comes back to Cloudflare via
- // the open Internet, or bidirectional where both the probe and result come and go
- // via the tunnel. Note in the case of bidirecitonal healthchecks, the target field
- // in health_check is ignored as the interface_address is used to send traffic into
- // the tunnel.
- Direction MagicTransitGRETunnelListResponseGRETunnelsHealthCheckDirection `json:"direction"`
- // Determines whether to run healthchecks for a tunnel.
- Enabled bool `json:"enabled"`
- // How frequent the health check is run. The default value is `mid`.
- Rate MagicTransitGRETunnelListResponseGRETunnelsHealthCheckRate `json:"rate"`
- // The destination address in a request type health check. After the healthcheck is
- // decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded
- // to this address. This field defaults to `customer_gre_endpoint address`. This
- // field is ignored for bidirectional healthchecks as the interface_address (not
- // assigned to the Cloudflare side of the tunnel) is used as the target.
- Target string `json:"target"`
- // The type of healthcheck to run, reply or request. The default value is `reply`.
- Type MagicTransitGRETunnelListResponseGRETunnelsHealthCheckType `json:"type"`
- JSON magicTransitGRETunnelListResponseGRETunnelsHealthCheckJSON `json:"-"`
-}
-
-// magicTransitGRETunnelListResponseGRETunnelsHealthCheckJSON contains the JSON
-// metadata for the struct [MagicTransitGRETunnelListResponseGRETunnelsHealthCheck]
-type magicTransitGRETunnelListResponseGRETunnelsHealthCheckJSON struct {
- Direction apijson.Field
- Enabled apijson.Field
- Rate apijson.Field
- Target apijson.Field
- Type apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitGRETunnelListResponseGRETunnelsHealthCheck) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitGRETunnelListResponseGRETunnelsHealthCheckJSON) RawJSON() string {
- return r.raw
-}
-
-// The direction of the flow of the healthcheck. Either unidirectional, where the
-// probe comes to you via the tunnel and the result comes back to Cloudflare via
-// the open Internet, or bidirectional where both the probe and result come and go
-// via the tunnel. Note in the case of bidirecitonal healthchecks, the target field
-// in health_check is ignored as the interface_address is used to send traffic into
-// the tunnel.
-type MagicTransitGRETunnelListResponseGRETunnelsHealthCheckDirection string
-
-const (
- MagicTransitGRETunnelListResponseGRETunnelsHealthCheckDirectionUnidirectional MagicTransitGRETunnelListResponseGRETunnelsHealthCheckDirection = "unidirectional"
- MagicTransitGRETunnelListResponseGRETunnelsHealthCheckDirectionBidirectional MagicTransitGRETunnelListResponseGRETunnelsHealthCheckDirection = "bidirectional"
-)
-
-// How frequent the health check is run. The default value is `mid`.
-type MagicTransitGRETunnelListResponseGRETunnelsHealthCheckRate string
-
-const (
- MagicTransitGRETunnelListResponseGRETunnelsHealthCheckRateLow MagicTransitGRETunnelListResponseGRETunnelsHealthCheckRate = "low"
- MagicTransitGRETunnelListResponseGRETunnelsHealthCheckRateMid MagicTransitGRETunnelListResponseGRETunnelsHealthCheckRate = "mid"
- MagicTransitGRETunnelListResponseGRETunnelsHealthCheckRateHigh MagicTransitGRETunnelListResponseGRETunnelsHealthCheckRate = "high"
-)
-
-// The type of healthcheck to run, reply or request. The default value is `reply`.
-type MagicTransitGRETunnelListResponseGRETunnelsHealthCheckType string
-
-const (
- MagicTransitGRETunnelListResponseGRETunnelsHealthCheckTypeReply MagicTransitGRETunnelListResponseGRETunnelsHealthCheckType = "reply"
- MagicTransitGRETunnelListResponseGRETunnelsHealthCheckTypeRequest MagicTransitGRETunnelListResponseGRETunnelsHealthCheckType = "request"
-)
-
-type MagicTransitGRETunnelDeleteResponse struct {
- Deleted bool `json:"deleted"`
- DeletedGRETunnel interface{} `json:"deleted_gre_tunnel"`
- JSON magicTransitGRETunnelDeleteResponseJSON `json:"-"`
-}
-
-// magicTransitGRETunnelDeleteResponseJSON contains the JSON metadata for the
-// struct [MagicTransitGRETunnelDeleteResponse]
-type magicTransitGRETunnelDeleteResponseJSON struct {
- Deleted apijson.Field
- DeletedGRETunnel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitGRETunnelDeleteResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitGRETunnelDeleteResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicTransitGRETunnelGetResponse struct {
- GRETunnel interface{} `json:"gre_tunnel"`
- JSON magicTransitGRETunnelGetResponseJSON `json:"-"`
-}
-
-// magicTransitGRETunnelGetResponseJSON contains the JSON metadata for the struct
-// [MagicTransitGRETunnelGetResponse]
-type magicTransitGRETunnelGetResponseJSON struct {
- GRETunnel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitGRETunnelGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitGRETunnelGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicTransitGRETunnelNewParams struct {
- Body param.Field[interface{}] `json:"body,required"`
-}
-
-func (r MagicTransitGRETunnelNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r.Body)
-}
-
-type MagicTransitGRETunnelNewResponseEnvelope struct {
- Errors []MagicTransitGRETunnelNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []MagicTransitGRETunnelNewResponseEnvelopeMessages `json:"messages,required"`
- Result MagicTransitGRETunnelNewResponse `json:"result,required"`
- // Whether the API call was successful
- Success MagicTransitGRETunnelNewResponseEnvelopeSuccess `json:"success,required"`
- JSON magicTransitGRETunnelNewResponseEnvelopeJSON `json:"-"`
-}
-
-// magicTransitGRETunnelNewResponseEnvelopeJSON contains the JSON metadata for the
-// struct [MagicTransitGRETunnelNewResponseEnvelope]
-type magicTransitGRETunnelNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitGRETunnelNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitGRETunnelNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicTransitGRETunnelNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON magicTransitGRETunnelNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// magicTransitGRETunnelNewResponseEnvelopeErrorsJSON contains the JSON metadata
-// for the struct [MagicTransitGRETunnelNewResponseEnvelopeErrors]
-type magicTransitGRETunnelNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitGRETunnelNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitGRETunnelNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicTransitGRETunnelNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON magicTransitGRETunnelNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// magicTransitGRETunnelNewResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [MagicTransitGRETunnelNewResponseEnvelopeMessages]
-type magicTransitGRETunnelNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitGRETunnelNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitGRETunnelNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type MagicTransitGRETunnelNewResponseEnvelopeSuccess bool
-
-const (
- MagicTransitGRETunnelNewResponseEnvelopeSuccessTrue MagicTransitGRETunnelNewResponseEnvelopeSuccess = true
-)
-
-type MagicTransitGRETunnelUpdateParams struct {
- // The IP address assigned to the Cloudflare side of the GRE tunnel.
- CloudflareGREEndpoint param.Field[string] `json:"cloudflare_gre_endpoint,required"`
- // The IP address assigned to the customer side of the GRE tunnel.
- CustomerGREEndpoint param.Field[string] `json:"customer_gre_endpoint,required"`
- // A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side
- // of the tunnel. Select the subnet from the following private IP space:
- // 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255.
- InterfaceAddress param.Field[string] `json:"interface_address,required"`
- // The name of the tunnel. The name cannot contain spaces or special characters,
- // must be 15 characters or less, and cannot share a name with another GRE tunnel.
- Name param.Field[string] `json:"name,required"`
- // An optional description of the GRE tunnel.
- Description param.Field[string] `json:"description"`
- HealthCheck param.Field[MagicTransitGRETunnelUpdateParamsHealthCheck] `json:"health_check"`
- // Maximum Transmission Unit (MTU) in bytes for the GRE tunnel. The minimum value
- // is 576.
- Mtu param.Field[int64] `json:"mtu"`
- // Time To Live (TTL) in number of hops of the GRE tunnel.
- TTL param.Field[int64] `json:"ttl"`
-}
-
-func (r MagicTransitGRETunnelUpdateParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type MagicTransitGRETunnelUpdateParamsHealthCheck struct {
- // The direction of the flow of the healthcheck. Either unidirectional, where the
- // probe comes to you via the tunnel and the result comes back to Cloudflare via
- // the open Internet, or bidirectional where both the probe and result come and go
- // via the tunnel. Note in the case of bidirecitonal healthchecks, the target field
- // in health_check is ignored as the interface_address is used to send traffic into
- // the tunnel.
- Direction param.Field[MagicTransitGRETunnelUpdateParamsHealthCheckDirection] `json:"direction"`
- // Determines whether to run healthchecks for a tunnel.
- Enabled param.Field[bool] `json:"enabled"`
- // How frequent the health check is run. The default value is `mid`.
- Rate param.Field[MagicTransitGRETunnelUpdateParamsHealthCheckRate] `json:"rate"`
- // The destination address in a request type health check. After the healthcheck is
- // decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded
- // to this address. This field defaults to `customer_gre_endpoint address`. This
- // field is ignored for bidirectional healthchecks as the interface_address (not
- // assigned to the Cloudflare side of the tunnel) is used as the target.
- Target param.Field[string] `json:"target"`
- // The type of healthcheck to run, reply or request. The default value is `reply`.
- Type param.Field[MagicTransitGRETunnelUpdateParamsHealthCheckType] `json:"type"`
-}
-
-func (r MagicTransitGRETunnelUpdateParamsHealthCheck) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The direction of the flow of the healthcheck. Either unidirectional, where the
-// probe comes to you via the tunnel and the result comes back to Cloudflare via
-// the open Internet, or bidirectional where both the probe and result come and go
-// via the tunnel. Note in the case of bidirecitonal healthchecks, the target field
-// in health_check is ignored as the interface_address is used to send traffic into
-// the tunnel.
-type MagicTransitGRETunnelUpdateParamsHealthCheckDirection string
-
-const (
- MagicTransitGRETunnelUpdateParamsHealthCheckDirectionUnidirectional MagicTransitGRETunnelUpdateParamsHealthCheckDirection = "unidirectional"
- MagicTransitGRETunnelUpdateParamsHealthCheckDirectionBidirectional MagicTransitGRETunnelUpdateParamsHealthCheckDirection = "bidirectional"
-)
-
-// How frequent the health check is run. The default value is `mid`.
-type MagicTransitGRETunnelUpdateParamsHealthCheckRate string
-
-const (
- MagicTransitGRETunnelUpdateParamsHealthCheckRateLow MagicTransitGRETunnelUpdateParamsHealthCheckRate = "low"
- MagicTransitGRETunnelUpdateParamsHealthCheckRateMid MagicTransitGRETunnelUpdateParamsHealthCheckRate = "mid"
- MagicTransitGRETunnelUpdateParamsHealthCheckRateHigh MagicTransitGRETunnelUpdateParamsHealthCheckRate = "high"
-)
-
-// The type of healthcheck to run, reply or request. The default value is `reply`.
-type MagicTransitGRETunnelUpdateParamsHealthCheckType string
-
-const (
- MagicTransitGRETunnelUpdateParamsHealthCheckTypeReply MagicTransitGRETunnelUpdateParamsHealthCheckType = "reply"
- MagicTransitGRETunnelUpdateParamsHealthCheckTypeRequest MagicTransitGRETunnelUpdateParamsHealthCheckType = "request"
-)
-
-type MagicTransitGRETunnelUpdateResponseEnvelope struct {
- Errors []MagicTransitGRETunnelUpdateResponseEnvelopeErrors `json:"errors,required"`
- Messages []MagicTransitGRETunnelUpdateResponseEnvelopeMessages `json:"messages,required"`
- Result MagicTransitGRETunnelUpdateResponse `json:"result,required"`
- // Whether the API call was successful
- Success MagicTransitGRETunnelUpdateResponseEnvelopeSuccess `json:"success,required"`
- JSON magicTransitGRETunnelUpdateResponseEnvelopeJSON `json:"-"`
-}
-
-// magicTransitGRETunnelUpdateResponseEnvelopeJSON contains the JSON metadata for
-// the struct [MagicTransitGRETunnelUpdateResponseEnvelope]
-type magicTransitGRETunnelUpdateResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitGRETunnelUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitGRETunnelUpdateResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicTransitGRETunnelUpdateResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON magicTransitGRETunnelUpdateResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// magicTransitGRETunnelUpdateResponseEnvelopeErrorsJSON contains the JSON metadata
-// for the struct [MagicTransitGRETunnelUpdateResponseEnvelopeErrors]
-type magicTransitGRETunnelUpdateResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitGRETunnelUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitGRETunnelUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicTransitGRETunnelUpdateResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON magicTransitGRETunnelUpdateResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// magicTransitGRETunnelUpdateResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct [MagicTransitGRETunnelUpdateResponseEnvelopeMessages]
-type magicTransitGRETunnelUpdateResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitGRETunnelUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitGRETunnelUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type MagicTransitGRETunnelUpdateResponseEnvelopeSuccess bool
-
-const (
- MagicTransitGRETunnelUpdateResponseEnvelopeSuccessTrue MagicTransitGRETunnelUpdateResponseEnvelopeSuccess = true
-)
-
-type MagicTransitGRETunnelListResponseEnvelope struct {
- Errors []MagicTransitGRETunnelListResponseEnvelopeErrors `json:"errors,required"`
- Messages []MagicTransitGRETunnelListResponseEnvelopeMessages `json:"messages,required"`
- Result MagicTransitGRETunnelListResponse `json:"result,required"`
- // Whether the API call was successful
- Success MagicTransitGRETunnelListResponseEnvelopeSuccess `json:"success,required"`
- JSON magicTransitGRETunnelListResponseEnvelopeJSON `json:"-"`
-}
-
-// magicTransitGRETunnelListResponseEnvelopeJSON contains the JSON metadata for the
-// struct [MagicTransitGRETunnelListResponseEnvelope]
-type magicTransitGRETunnelListResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitGRETunnelListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitGRETunnelListResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicTransitGRETunnelListResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON magicTransitGRETunnelListResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// magicTransitGRETunnelListResponseEnvelopeErrorsJSON contains the JSON metadata
-// for the struct [MagicTransitGRETunnelListResponseEnvelopeErrors]
-type magicTransitGRETunnelListResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitGRETunnelListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitGRETunnelListResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicTransitGRETunnelListResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON magicTransitGRETunnelListResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// magicTransitGRETunnelListResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [MagicTransitGRETunnelListResponseEnvelopeMessages]
-type magicTransitGRETunnelListResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitGRETunnelListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitGRETunnelListResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type MagicTransitGRETunnelListResponseEnvelopeSuccess bool
-
-const (
- MagicTransitGRETunnelListResponseEnvelopeSuccessTrue MagicTransitGRETunnelListResponseEnvelopeSuccess = true
-)
-
-type MagicTransitGRETunnelDeleteResponseEnvelope struct {
- Errors []MagicTransitGRETunnelDeleteResponseEnvelopeErrors `json:"errors,required"`
- Messages []MagicTransitGRETunnelDeleteResponseEnvelopeMessages `json:"messages,required"`
- Result MagicTransitGRETunnelDeleteResponse `json:"result,required"`
- // Whether the API call was successful
- Success MagicTransitGRETunnelDeleteResponseEnvelopeSuccess `json:"success,required"`
- JSON magicTransitGRETunnelDeleteResponseEnvelopeJSON `json:"-"`
-}
-
-// magicTransitGRETunnelDeleteResponseEnvelopeJSON contains the JSON metadata for
-// the struct [MagicTransitGRETunnelDeleteResponseEnvelope]
-type magicTransitGRETunnelDeleteResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitGRETunnelDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitGRETunnelDeleteResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicTransitGRETunnelDeleteResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON magicTransitGRETunnelDeleteResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// magicTransitGRETunnelDeleteResponseEnvelopeErrorsJSON contains the JSON metadata
-// for the struct [MagicTransitGRETunnelDeleteResponseEnvelopeErrors]
-type magicTransitGRETunnelDeleteResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitGRETunnelDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitGRETunnelDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicTransitGRETunnelDeleteResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON magicTransitGRETunnelDeleteResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// magicTransitGRETunnelDeleteResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct [MagicTransitGRETunnelDeleteResponseEnvelopeMessages]
-type magicTransitGRETunnelDeleteResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitGRETunnelDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitGRETunnelDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type MagicTransitGRETunnelDeleteResponseEnvelopeSuccess bool
-
-const (
- MagicTransitGRETunnelDeleteResponseEnvelopeSuccessTrue MagicTransitGRETunnelDeleteResponseEnvelopeSuccess = true
-)
-
-type MagicTransitGRETunnelGetResponseEnvelope struct {
- Errors []MagicTransitGRETunnelGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []MagicTransitGRETunnelGetResponseEnvelopeMessages `json:"messages,required"`
- Result MagicTransitGRETunnelGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success MagicTransitGRETunnelGetResponseEnvelopeSuccess `json:"success,required"`
- JSON magicTransitGRETunnelGetResponseEnvelopeJSON `json:"-"`
-}
-
-// magicTransitGRETunnelGetResponseEnvelopeJSON contains the JSON metadata for the
-// struct [MagicTransitGRETunnelGetResponseEnvelope]
-type magicTransitGRETunnelGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitGRETunnelGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitGRETunnelGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicTransitGRETunnelGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON magicTransitGRETunnelGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// magicTransitGRETunnelGetResponseEnvelopeErrorsJSON contains the JSON metadata
-// for the struct [MagicTransitGRETunnelGetResponseEnvelopeErrors]
-type magicTransitGRETunnelGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitGRETunnelGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitGRETunnelGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicTransitGRETunnelGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON magicTransitGRETunnelGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// magicTransitGRETunnelGetResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [MagicTransitGRETunnelGetResponseEnvelopeMessages]
-type magicTransitGRETunnelGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitGRETunnelGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitGRETunnelGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type MagicTransitGRETunnelGetResponseEnvelopeSuccess bool
-
-const (
- MagicTransitGRETunnelGetResponseEnvelopeSuccessTrue MagicTransitGRETunnelGetResponseEnvelopeSuccess = true
-)
diff --git a/magictransitgretunnel_test.go b/magictransitgretunnel_test.go
deleted file mode 100644
index 7d891f5af33..00000000000
--- a/magictransitgretunnel_test.go
+++ /dev/null
@@ -1,168 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestMagicTransitGRETunnelNew(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"),
- )
- _, err := client.MagicTransit.GRETunnels.New(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.MagicTransitGRETunnelNewParams{
- Body: cloudflare.F[any](map[string]interface{}{}),
- },
- )
- 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())
- }
-}
-
-func TestMagicTransitGRETunnelUpdateWithOptionalParams(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"),
- )
- _, err := client.MagicTransit.GRETunnels.Update(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.MagicTransitGRETunnelUpdateParams{
- CloudflareGREEndpoint: cloudflare.F("203.0.113.1"),
- CustomerGREEndpoint: cloudflare.F("203.0.113.1"),
- InterfaceAddress: cloudflare.F("192.0.2.0/31"),
- Name: cloudflare.F("GRE_1"),
- Description: cloudflare.F("Tunnel for ISP X"),
- HealthCheck: cloudflare.F(cloudflare.MagicTransitGRETunnelUpdateParamsHealthCheck{
- Direction: cloudflare.F(cloudflare.MagicTransitGRETunnelUpdateParamsHealthCheckDirectionBidirectional),
- Enabled: cloudflare.F(true),
- Rate: cloudflare.F(cloudflare.MagicTransitGRETunnelUpdateParamsHealthCheckRateLow),
- Target: cloudflare.F("203.0.113.1"),
- Type: cloudflare.F(cloudflare.MagicTransitGRETunnelUpdateParamsHealthCheckTypeRequest),
- }),
- Mtu: cloudflare.F(int64(0)),
- TTL: cloudflare.F(int64(0)),
- },
- )
- 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())
- }
-}
-
-func TestMagicTransitGRETunnelList(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"),
- )
- _, err := client.MagicTransit.GRETunnels.List(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353")
- 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())
- }
-}
-
-func TestMagicTransitGRETunnelDelete(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"),
- )
- _, err := client.MagicTransit.GRETunnels.Delete(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- "023e105f4ecef8ad9ca31a8372d0c353",
- )
- 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())
- }
-}
-
-func TestMagicTransitGRETunnelGet(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"),
- )
- _, err := client.MagicTransit.GRETunnels.Get(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- "023e105f4ecef8ad9ca31a8372d0c353",
- )
- 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/magictransitipsectunnel.go b/magictransitipsectunnel.go
deleted file mode 100644
index e7631df504c..00000000000
--- a/magictransitipsectunnel.go
+++ /dev/null
@@ -1,1197 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// MagicTransitIPSECTunnelService contains methods and other services that help
-// with interacting with the cloudflare API. Note, unlike clients, this service
-// does not read variables from the environment automatically. You should not
-// instantiate this service directly, and instead use the
-// [NewMagicTransitIPSECTunnelService] method instead.
-type MagicTransitIPSECTunnelService struct {
- Options []option.RequestOption
-}
-
-// NewMagicTransitIPSECTunnelService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewMagicTransitIPSECTunnelService(opts ...option.RequestOption) (r *MagicTransitIPSECTunnelService) {
- r = &MagicTransitIPSECTunnelService{}
- r.Options = opts
- return
-}
-
-// Creates new IPsec tunnels associated with an account. Use `?validate_only=true`
-// as an optional query parameter to only run validation without persisting
-// changes.
-func (r *MagicTransitIPSECTunnelService) New(ctx context.Context, accountIdentifier string, body MagicTransitIPSECTunnelNewParams, opts ...option.RequestOption) (res *MagicTransitIPSECTunnelNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env MagicTransitIPSECTunnelNewResponseEnvelope
- path := fmt.Sprintf("accounts/%s/magic/ipsec_tunnels", accountIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Updates a specific IPsec tunnel associated with an account. Use
-// `?validate_only=true` as an optional query parameter to only run validation
-// without persisting changes.
-func (r *MagicTransitIPSECTunnelService) Update(ctx context.Context, accountIdentifier string, tunnelIdentifier string, body MagicTransitIPSECTunnelUpdateParams, opts ...option.RequestOption) (res *MagicTransitIPSECTunnelUpdateResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env MagicTransitIPSECTunnelUpdateResponseEnvelope
- path := fmt.Sprintf("accounts/%s/magic/ipsec_tunnels/%s", accountIdentifier, tunnelIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Lists IPsec tunnels associated with an account.
-func (r *MagicTransitIPSECTunnelService) List(ctx context.Context, accountIdentifier string, opts ...option.RequestOption) (res *MagicTransitIPSECTunnelListResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env MagicTransitIPSECTunnelListResponseEnvelope
- path := fmt.Sprintf("accounts/%s/magic/ipsec_tunnels", accountIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Disables and removes a specific static IPsec Tunnel associated with an account.
-// Use `?validate_only=true` as an optional query parameter to only run validation
-// without persisting changes.
-func (r *MagicTransitIPSECTunnelService) Delete(ctx context.Context, accountIdentifier string, tunnelIdentifier string, opts ...option.RequestOption) (res *MagicTransitIPSECTunnelDeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env MagicTransitIPSECTunnelDeleteResponseEnvelope
- path := fmt.Sprintf("accounts/%s/magic/ipsec_tunnels/%s", accountIdentifier, tunnelIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Lists details for a specific IPsec tunnel.
-func (r *MagicTransitIPSECTunnelService) Get(ctx context.Context, accountIdentifier string, tunnelIdentifier string, opts ...option.RequestOption) (res *MagicTransitIPSECTunnelGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env MagicTransitIPSECTunnelGetResponseEnvelope
- path := fmt.Sprintf("accounts/%s/magic/ipsec_tunnels/%s", accountIdentifier, tunnelIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Generates a Pre Shared Key for a specific IPsec tunnel used in the IKE session.
-// Use `?validate_only=true` as an optional query parameter to only run validation
-// without persisting changes. After a PSK is generated, the PSK is immediately
-// persisted to Cloudflare's edge and cannot be retrieved later. Note the PSK in a
-// safe place.
-func (r *MagicTransitIPSECTunnelService) PSKGenerate(ctx context.Context, accountIdentifier string, tunnelIdentifier string, opts ...option.RequestOption) (res *MagicTransitIPSECTunnelPSKGenerateResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env MagicTransitIPSECTunnelPSKGenerateResponseEnvelope
- path := fmt.Sprintf("accounts/%s/magic/ipsec_tunnels/%s/psk_generate", accountIdentifier, tunnelIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type MagicTransitIPSECTunnelNewResponse struct {
- IPSECTunnels []MagicTransitIPSECTunnelNewResponseIPSECTunnel `json:"ipsec_tunnels"`
- JSON magicTransitIPSECTunnelNewResponseJSON `json:"-"`
-}
-
-// magicTransitIPSECTunnelNewResponseJSON contains the JSON metadata for the struct
-// [MagicTransitIPSECTunnelNewResponse]
-type magicTransitIPSECTunnelNewResponseJSON struct {
- IPSECTunnels apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitIPSECTunnelNewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitIPSECTunnelNewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicTransitIPSECTunnelNewResponseIPSECTunnel struct {
- // The IP address assigned to the Cloudflare side of the IPsec tunnel.
- CloudflareEndpoint string `json:"cloudflare_endpoint,required"`
- // A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side
- // of the tunnel. Select the subnet from the following private IP space:
- // 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255.
- InterfaceAddress string `json:"interface_address,required"`
- // The name of the IPsec tunnel. The name cannot share a name with other tunnels.
- Name string `json:"name,required"`
- // Tunnel identifier tag.
- ID string `json:"id"`
- // When `true`, the tunnel can use a null-cipher (`ENCR_NULL`) in the ESP tunnel
- // (Phase 2).
- AllowNullCipher bool `json:"allow_null_cipher"`
- // The date and time the tunnel was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // The IP address assigned to the customer side of the IPsec tunnel.
- CustomerEndpoint string `json:"customer_endpoint"`
- // An optional description forthe IPsec tunnel.
- Description string `json:"description"`
- // The date and time the tunnel was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // The PSK metadata that includes when the PSK was generated.
- PSKMetadata MagicTransitIPSECTunnelNewResponseIPSECTunnelsPSKMetadata `json:"psk_metadata"`
- // If `true`, then IPsec replay protection will be supported in the
- // Cloudflare-to-customer direction.
- ReplayProtection bool `json:"replay_protection"`
- TunnelHealthCheck MagicTransitIPSECTunnelNewResponseIPSECTunnelsTunnelHealthCheck `json:"tunnel_health_check"`
- JSON magicTransitIPSECTunnelNewResponseIPSECTunnelJSON `json:"-"`
-}
-
-// magicTransitIPSECTunnelNewResponseIPSECTunnelJSON contains the JSON metadata for
-// the struct [MagicTransitIPSECTunnelNewResponseIPSECTunnel]
-type magicTransitIPSECTunnelNewResponseIPSECTunnelJSON struct {
- CloudflareEndpoint apijson.Field
- InterfaceAddress apijson.Field
- Name apijson.Field
- ID apijson.Field
- AllowNullCipher apijson.Field
- CreatedOn apijson.Field
- CustomerEndpoint apijson.Field
- Description apijson.Field
- ModifiedOn apijson.Field
- PSKMetadata apijson.Field
- ReplayProtection apijson.Field
- TunnelHealthCheck apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitIPSECTunnelNewResponseIPSECTunnel) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitIPSECTunnelNewResponseIPSECTunnelJSON) RawJSON() string {
- return r.raw
-}
-
-// The PSK metadata that includes when the PSK was generated.
-type MagicTransitIPSECTunnelNewResponseIPSECTunnelsPSKMetadata struct {
- // The date and time the tunnel was last modified.
- LastGeneratedOn time.Time `json:"last_generated_on" format:"date-time"`
- JSON magicTransitIPSECTunnelNewResponseIPSECTunnelsPSKMetadataJSON `json:"-"`
-}
-
-// magicTransitIPSECTunnelNewResponseIPSECTunnelsPSKMetadataJSON contains the JSON
-// metadata for the struct
-// [MagicTransitIPSECTunnelNewResponseIPSECTunnelsPSKMetadata]
-type magicTransitIPSECTunnelNewResponseIPSECTunnelsPSKMetadataJSON struct {
- LastGeneratedOn apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitIPSECTunnelNewResponseIPSECTunnelsPSKMetadata) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitIPSECTunnelNewResponseIPSECTunnelsPSKMetadataJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicTransitIPSECTunnelNewResponseIPSECTunnelsTunnelHealthCheck struct {
- // Determines whether to run healthchecks for a tunnel.
- Enabled bool `json:"enabled"`
- // How frequent the health check is run. The default value is `mid`.
- Rate MagicTransitIPSECTunnelNewResponseIPSECTunnelsTunnelHealthCheckRate `json:"rate"`
- // The destination address in a request type health check. After the healthcheck is
- // decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded
- // to this address. This field defaults to `customer_gre_endpoint address`.
- Target string `json:"target"`
- // The type of healthcheck to run, reply or request. The default value is `reply`.
- Type MagicTransitIPSECTunnelNewResponseIPSECTunnelsTunnelHealthCheckType `json:"type"`
- JSON magicTransitIPSECTunnelNewResponseIPSECTunnelsTunnelHealthCheckJSON `json:"-"`
-}
-
-// magicTransitIPSECTunnelNewResponseIPSECTunnelsTunnelHealthCheckJSON contains the
-// JSON metadata for the struct
-// [MagicTransitIPSECTunnelNewResponseIPSECTunnelsTunnelHealthCheck]
-type magicTransitIPSECTunnelNewResponseIPSECTunnelsTunnelHealthCheckJSON struct {
- Enabled apijson.Field
- Rate apijson.Field
- Target apijson.Field
- Type apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitIPSECTunnelNewResponseIPSECTunnelsTunnelHealthCheck) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitIPSECTunnelNewResponseIPSECTunnelsTunnelHealthCheckJSON) RawJSON() string {
- return r.raw
-}
-
-// How frequent the health check is run. The default value is `mid`.
-type MagicTransitIPSECTunnelNewResponseIPSECTunnelsTunnelHealthCheckRate string
-
-const (
- MagicTransitIPSECTunnelNewResponseIPSECTunnelsTunnelHealthCheckRateLow MagicTransitIPSECTunnelNewResponseIPSECTunnelsTunnelHealthCheckRate = "low"
- MagicTransitIPSECTunnelNewResponseIPSECTunnelsTunnelHealthCheckRateMid MagicTransitIPSECTunnelNewResponseIPSECTunnelsTunnelHealthCheckRate = "mid"
- MagicTransitIPSECTunnelNewResponseIPSECTunnelsTunnelHealthCheckRateHigh MagicTransitIPSECTunnelNewResponseIPSECTunnelsTunnelHealthCheckRate = "high"
-)
-
-// The type of healthcheck to run, reply or request. The default value is `reply`.
-type MagicTransitIPSECTunnelNewResponseIPSECTunnelsTunnelHealthCheckType string
-
-const (
- MagicTransitIPSECTunnelNewResponseIPSECTunnelsTunnelHealthCheckTypeReply MagicTransitIPSECTunnelNewResponseIPSECTunnelsTunnelHealthCheckType = "reply"
- MagicTransitIPSECTunnelNewResponseIPSECTunnelsTunnelHealthCheckTypeRequest MagicTransitIPSECTunnelNewResponseIPSECTunnelsTunnelHealthCheckType = "request"
-)
-
-type MagicTransitIPSECTunnelUpdateResponse struct {
- Modified bool `json:"modified"`
- ModifiedIPSECTunnel interface{} `json:"modified_ipsec_tunnel"`
- JSON magicTransitIPSECTunnelUpdateResponseJSON `json:"-"`
-}
-
-// magicTransitIPSECTunnelUpdateResponseJSON contains the JSON metadata for the
-// struct [MagicTransitIPSECTunnelUpdateResponse]
-type magicTransitIPSECTunnelUpdateResponseJSON struct {
- Modified apijson.Field
- ModifiedIPSECTunnel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitIPSECTunnelUpdateResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitIPSECTunnelUpdateResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicTransitIPSECTunnelListResponse struct {
- IPSECTunnels []MagicTransitIPSECTunnelListResponseIPSECTunnel `json:"ipsec_tunnels"`
- JSON magicTransitIPSECTunnelListResponseJSON `json:"-"`
-}
-
-// magicTransitIPSECTunnelListResponseJSON contains the JSON metadata for the
-// struct [MagicTransitIPSECTunnelListResponse]
-type magicTransitIPSECTunnelListResponseJSON struct {
- IPSECTunnels apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitIPSECTunnelListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitIPSECTunnelListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicTransitIPSECTunnelListResponseIPSECTunnel struct {
- // The IP address assigned to the Cloudflare side of the IPsec tunnel.
- CloudflareEndpoint string `json:"cloudflare_endpoint,required"`
- // A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side
- // of the tunnel. Select the subnet from the following private IP space:
- // 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255.
- InterfaceAddress string `json:"interface_address,required"`
- // The name of the IPsec tunnel. The name cannot share a name with other tunnels.
- Name string `json:"name,required"`
- // Tunnel identifier tag.
- ID string `json:"id"`
- // When `true`, the tunnel can use a null-cipher (`ENCR_NULL`) in the ESP tunnel
- // (Phase 2).
- AllowNullCipher bool `json:"allow_null_cipher"`
- // The date and time the tunnel was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // The IP address assigned to the customer side of the IPsec tunnel.
- CustomerEndpoint string `json:"customer_endpoint"`
- // An optional description forthe IPsec tunnel.
- Description string `json:"description"`
- // The date and time the tunnel was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // The PSK metadata that includes when the PSK was generated.
- PSKMetadata MagicTransitIPSECTunnelListResponseIPSECTunnelsPSKMetadata `json:"psk_metadata"`
- // If `true`, then IPsec replay protection will be supported in the
- // Cloudflare-to-customer direction.
- ReplayProtection bool `json:"replay_protection"`
- TunnelHealthCheck MagicTransitIPSECTunnelListResponseIPSECTunnelsTunnelHealthCheck `json:"tunnel_health_check"`
- JSON magicTransitIPSECTunnelListResponseIPSECTunnelJSON `json:"-"`
-}
-
-// magicTransitIPSECTunnelListResponseIPSECTunnelJSON contains the JSON metadata
-// for the struct [MagicTransitIPSECTunnelListResponseIPSECTunnel]
-type magicTransitIPSECTunnelListResponseIPSECTunnelJSON struct {
- CloudflareEndpoint apijson.Field
- InterfaceAddress apijson.Field
- Name apijson.Field
- ID apijson.Field
- AllowNullCipher apijson.Field
- CreatedOn apijson.Field
- CustomerEndpoint apijson.Field
- Description apijson.Field
- ModifiedOn apijson.Field
- PSKMetadata apijson.Field
- ReplayProtection apijson.Field
- TunnelHealthCheck apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitIPSECTunnelListResponseIPSECTunnel) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitIPSECTunnelListResponseIPSECTunnelJSON) RawJSON() string {
- return r.raw
-}
-
-// The PSK metadata that includes when the PSK was generated.
-type MagicTransitIPSECTunnelListResponseIPSECTunnelsPSKMetadata struct {
- // The date and time the tunnel was last modified.
- LastGeneratedOn time.Time `json:"last_generated_on" format:"date-time"`
- JSON magicTransitIPSECTunnelListResponseIPSECTunnelsPSKMetadataJSON `json:"-"`
-}
-
-// magicTransitIPSECTunnelListResponseIPSECTunnelsPSKMetadataJSON contains the JSON
-// metadata for the struct
-// [MagicTransitIPSECTunnelListResponseIPSECTunnelsPSKMetadata]
-type magicTransitIPSECTunnelListResponseIPSECTunnelsPSKMetadataJSON struct {
- LastGeneratedOn apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitIPSECTunnelListResponseIPSECTunnelsPSKMetadata) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitIPSECTunnelListResponseIPSECTunnelsPSKMetadataJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicTransitIPSECTunnelListResponseIPSECTunnelsTunnelHealthCheck struct {
- // Determines whether to run healthchecks for a tunnel.
- Enabled bool `json:"enabled"`
- // How frequent the health check is run. The default value is `mid`.
- Rate MagicTransitIPSECTunnelListResponseIPSECTunnelsTunnelHealthCheckRate `json:"rate"`
- // The destination address in a request type health check. After the healthcheck is
- // decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded
- // to this address. This field defaults to `customer_gre_endpoint address`.
- Target string `json:"target"`
- // The type of healthcheck to run, reply or request. The default value is `reply`.
- Type MagicTransitIPSECTunnelListResponseIPSECTunnelsTunnelHealthCheckType `json:"type"`
- JSON magicTransitIPSECTunnelListResponseIPSECTunnelsTunnelHealthCheckJSON `json:"-"`
-}
-
-// magicTransitIPSECTunnelListResponseIPSECTunnelsTunnelHealthCheckJSON contains
-// the JSON metadata for the struct
-// [MagicTransitIPSECTunnelListResponseIPSECTunnelsTunnelHealthCheck]
-type magicTransitIPSECTunnelListResponseIPSECTunnelsTunnelHealthCheckJSON struct {
- Enabled apijson.Field
- Rate apijson.Field
- Target apijson.Field
- Type apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitIPSECTunnelListResponseIPSECTunnelsTunnelHealthCheck) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitIPSECTunnelListResponseIPSECTunnelsTunnelHealthCheckJSON) RawJSON() string {
- return r.raw
-}
-
-// How frequent the health check is run. The default value is `mid`.
-type MagicTransitIPSECTunnelListResponseIPSECTunnelsTunnelHealthCheckRate string
-
-const (
- MagicTransitIPSECTunnelListResponseIPSECTunnelsTunnelHealthCheckRateLow MagicTransitIPSECTunnelListResponseIPSECTunnelsTunnelHealthCheckRate = "low"
- MagicTransitIPSECTunnelListResponseIPSECTunnelsTunnelHealthCheckRateMid MagicTransitIPSECTunnelListResponseIPSECTunnelsTunnelHealthCheckRate = "mid"
- MagicTransitIPSECTunnelListResponseIPSECTunnelsTunnelHealthCheckRateHigh MagicTransitIPSECTunnelListResponseIPSECTunnelsTunnelHealthCheckRate = "high"
-)
-
-// The type of healthcheck to run, reply or request. The default value is `reply`.
-type MagicTransitIPSECTunnelListResponseIPSECTunnelsTunnelHealthCheckType string
-
-const (
- MagicTransitIPSECTunnelListResponseIPSECTunnelsTunnelHealthCheckTypeReply MagicTransitIPSECTunnelListResponseIPSECTunnelsTunnelHealthCheckType = "reply"
- MagicTransitIPSECTunnelListResponseIPSECTunnelsTunnelHealthCheckTypeRequest MagicTransitIPSECTunnelListResponseIPSECTunnelsTunnelHealthCheckType = "request"
-)
-
-type MagicTransitIPSECTunnelDeleteResponse struct {
- Deleted bool `json:"deleted"`
- DeletedIPSECTunnel interface{} `json:"deleted_ipsec_tunnel"`
- JSON magicTransitIPSECTunnelDeleteResponseJSON `json:"-"`
-}
-
-// magicTransitIPSECTunnelDeleteResponseJSON contains the JSON metadata for the
-// struct [MagicTransitIPSECTunnelDeleteResponse]
-type magicTransitIPSECTunnelDeleteResponseJSON struct {
- Deleted apijson.Field
- DeletedIPSECTunnel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitIPSECTunnelDeleteResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitIPSECTunnelDeleteResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicTransitIPSECTunnelGetResponse struct {
- IPSECTunnel interface{} `json:"ipsec_tunnel"`
- JSON magicTransitIPSECTunnelGetResponseJSON `json:"-"`
-}
-
-// magicTransitIPSECTunnelGetResponseJSON contains the JSON metadata for the struct
-// [MagicTransitIPSECTunnelGetResponse]
-type magicTransitIPSECTunnelGetResponseJSON struct {
- IPSECTunnel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitIPSECTunnelGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitIPSECTunnelGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicTransitIPSECTunnelPSKGenerateResponse struct {
- // Identifier
- IPSECTunnelID string `json:"ipsec_tunnel_id"`
- // A randomly generated or provided string for use in the IPsec tunnel.
- PSK string `json:"psk"`
- // The PSK metadata that includes when the PSK was generated.
- PSKMetadata MagicTransitIPSECTunnelPSKGenerateResponsePSKMetadata `json:"psk_metadata"`
- JSON magicTransitIPSECTunnelPSKGenerateResponseJSON `json:"-"`
-}
-
-// magicTransitIPSECTunnelPSKGenerateResponseJSON contains the JSON metadata for
-// the struct [MagicTransitIPSECTunnelPSKGenerateResponse]
-type magicTransitIPSECTunnelPSKGenerateResponseJSON struct {
- IPSECTunnelID apijson.Field
- PSK apijson.Field
- PSKMetadata apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitIPSECTunnelPSKGenerateResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitIPSECTunnelPSKGenerateResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// The PSK metadata that includes when the PSK was generated.
-type MagicTransitIPSECTunnelPSKGenerateResponsePSKMetadata struct {
- // The date and time the tunnel was last modified.
- LastGeneratedOn time.Time `json:"last_generated_on" format:"date-time"`
- JSON magicTransitIPSECTunnelPSKGenerateResponsePSKMetadataJSON `json:"-"`
-}
-
-// magicTransitIPSECTunnelPSKGenerateResponsePSKMetadataJSON contains the JSON
-// metadata for the struct [MagicTransitIPSECTunnelPSKGenerateResponsePSKMetadata]
-type magicTransitIPSECTunnelPSKGenerateResponsePSKMetadataJSON struct {
- LastGeneratedOn apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitIPSECTunnelPSKGenerateResponsePSKMetadata) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitIPSECTunnelPSKGenerateResponsePSKMetadataJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicTransitIPSECTunnelNewParams struct {
- // The IP address assigned to the Cloudflare side of the IPsec tunnel.
- CloudflareEndpoint param.Field[string] `json:"cloudflare_endpoint,required"`
- // A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side
- // of the tunnel. Select the subnet from the following private IP space:
- // 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255.
- InterfaceAddress param.Field[string] `json:"interface_address,required"`
- // The name of the IPsec tunnel. The name cannot share a name with other tunnels.
- Name param.Field[string] `json:"name,required"`
- // The IP address assigned to the customer side of the IPsec tunnel.
- CustomerEndpoint param.Field[string] `json:"customer_endpoint"`
- // An optional description forthe IPsec tunnel.
- Description param.Field[string] `json:"description"`
- HealthCheck param.Field[MagicTransitIPSECTunnelNewParamsHealthCheck] `json:"health_check"`
- // A randomly generated or provided string for use in the IPsec tunnel.
- PSK param.Field[string] `json:"psk"`
- // If `true`, then IPsec replay protection will be supported in the
- // Cloudflare-to-customer direction.
- ReplayProtection param.Field[bool] `json:"replay_protection"`
-}
-
-func (r MagicTransitIPSECTunnelNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type MagicTransitIPSECTunnelNewParamsHealthCheck struct {
- // The direction of the flow of the healthcheck. Either unidirectional, where the
- // probe comes to you via the tunnel and the result comes back to Cloudflare via
- // the open Internet, or bidirectional where both the probe and result come and go
- // via the tunnel. Note in the case of bidirecitonal healthchecks, the target field
- // in health_check is ignored as the interface_address is used to send traffic into
- // the tunnel.
- Direction param.Field[MagicTransitIPSECTunnelNewParamsHealthCheckDirection] `json:"direction"`
- // Determines whether to run healthchecks for a tunnel.
- Enabled param.Field[bool] `json:"enabled"`
- // How frequent the health check is run. The default value is `mid`.
- Rate param.Field[MagicTransitIPSECTunnelNewParamsHealthCheckRate] `json:"rate"`
- // The destination address in a request type health check. After the healthcheck is
- // decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded
- // to this address. This field defaults to `customer_gre_endpoint address`. This
- // field is ignored for bidirectional healthchecks as the interface_address (not
- // assigned to the Cloudflare side of the tunnel) is used as the target.
- Target param.Field[string] `json:"target"`
- // The type of healthcheck to run, reply or request. The default value is `reply`.
- Type param.Field[MagicTransitIPSECTunnelNewParamsHealthCheckType] `json:"type"`
-}
-
-func (r MagicTransitIPSECTunnelNewParamsHealthCheck) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The direction of the flow of the healthcheck. Either unidirectional, where the
-// probe comes to you via the tunnel and the result comes back to Cloudflare via
-// the open Internet, or bidirectional where both the probe and result come and go
-// via the tunnel. Note in the case of bidirecitonal healthchecks, the target field
-// in health_check is ignored as the interface_address is used to send traffic into
-// the tunnel.
-type MagicTransitIPSECTunnelNewParamsHealthCheckDirection string
-
-const (
- MagicTransitIPSECTunnelNewParamsHealthCheckDirectionUnidirectional MagicTransitIPSECTunnelNewParamsHealthCheckDirection = "unidirectional"
- MagicTransitIPSECTunnelNewParamsHealthCheckDirectionBidirectional MagicTransitIPSECTunnelNewParamsHealthCheckDirection = "bidirectional"
-)
-
-// How frequent the health check is run. The default value is `mid`.
-type MagicTransitIPSECTunnelNewParamsHealthCheckRate string
-
-const (
- MagicTransitIPSECTunnelNewParamsHealthCheckRateLow MagicTransitIPSECTunnelNewParamsHealthCheckRate = "low"
- MagicTransitIPSECTunnelNewParamsHealthCheckRateMid MagicTransitIPSECTunnelNewParamsHealthCheckRate = "mid"
- MagicTransitIPSECTunnelNewParamsHealthCheckRateHigh MagicTransitIPSECTunnelNewParamsHealthCheckRate = "high"
-)
-
-// The type of healthcheck to run, reply or request. The default value is `reply`.
-type MagicTransitIPSECTunnelNewParamsHealthCheckType string
-
-const (
- MagicTransitIPSECTunnelNewParamsHealthCheckTypeReply MagicTransitIPSECTunnelNewParamsHealthCheckType = "reply"
- MagicTransitIPSECTunnelNewParamsHealthCheckTypeRequest MagicTransitIPSECTunnelNewParamsHealthCheckType = "request"
-)
-
-type MagicTransitIPSECTunnelNewResponseEnvelope struct {
- Errors []MagicTransitIPSECTunnelNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []MagicTransitIPSECTunnelNewResponseEnvelopeMessages `json:"messages,required"`
- Result MagicTransitIPSECTunnelNewResponse `json:"result,required"`
- // Whether the API call was successful
- Success MagicTransitIPSECTunnelNewResponseEnvelopeSuccess `json:"success,required"`
- JSON magicTransitIPSECTunnelNewResponseEnvelopeJSON `json:"-"`
-}
-
-// magicTransitIPSECTunnelNewResponseEnvelopeJSON contains the JSON metadata for
-// the struct [MagicTransitIPSECTunnelNewResponseEnvelope]
-type magicTransitIPSECTunnelNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitIPSECTunnelNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitIPSECTunnelNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicTransitIPSECTunnelNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON magicTransitIPSECTunnelNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// magicTransitIPSECTunnelNewResponseEnvelopeErrorsJSON contains the JSON metadata
-// for the struct [MagicTransitIPSECTunnelNewResponseEnvelopeErrors]
-type magicTransitIPSECTunnelNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitIPSECTunnelNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitIPSECTunnelNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicTransitIPSECTunnelNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON magicTransitIPSECTunnelNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// magicTransitIPSECTunnelNewResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct [MagicTransitIPSECTunnelNewResponseEnvelopeMessages]
-type magicTransitIPSECTunnelNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitIPSECTunnelNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitIPSECTunnelNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type MagicTransitIPSECTunnelNewResponseEnvelopeSuccess bool
-
-const (
- MagicTransitIPSECTunnelNewResponseEnvelopeSuccessTrue MagicTransitIPSECTunnelNewResponseEnvelopeSuccess = true
-)
-
-type MagicTransitIPSECTunnelUpdateParams struct {
- // The IP address assigned to the Cloudflare side of the IPsec tunnel.
- CloudflareEndpoint param.Field[string] `json:"cloudflare_endpoint,required"`
- // A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side
- // of the tunnel. Select the subnet from the following private IP space:
- // 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255.
- InterfaceAddress param.Field[string] `json:"interface_address,required"`
- // The name of the IPsec tunnel. The name cannot share a name with other tunnels.
- Name param.Field[string] `json:"name,required"`
- // The IP address assigned to the customer side of the IPsec tunnel.
- CustomerEndpoint param.Field[string] `json:"customer_endpoint"`
- // An optional description forthe IPsec tunnel.
- Description param.Field[string] `json:"description"`
- HealthCheck param.Field[MagicTransitIPSECTunnelUpdateParamsHealthCheck] `json:"health_check"`
- // A randomly generated or provided string for use in the IPsec tunnel.
- PSK param.Field[string] `json:"psk"`
- // If `true`, then IPsec replay protection will be supported in the
- // Cloudflare-to-customer direction.
- ReplayProtection param.Field[bool] `json:"replay_protection"`
-}
-
-func (r MagicTransitIPSECTunnelUpdateParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type MagicTransitIPSECTunnelUpdateParamsHealthCheck struct {
- // The direction of the flow of the healthcheck. Either unidirectional, where the
- // probe comes to you via the tunnel and the result comes back to Cloudflare via
- // the open Internet, or bidirectional where both the probe and result come and go
- // via the tunnel. Note in the case of bidirecitonal healthchecks, the target field
- // in health_check is ignored as the interface_address is used to send traffic into
- // the tunnel.
- Direction param.Field[MagicTransitIPSECTunnelUpdateParamsHealthCheckDirection] `json:"direction"`
- // Determines whether to run healthchecks for a tunnel.
- Enabled param.Field[bool] `json:"enabled"`
- // How frequent the health check is run. The default value is `mid`.
- Rate param.Field[MagicTransitIPSECTunnelUpdateParamsHealthCheckRate] `json:"rate"`
- // The destination address in a request type health check. After the healthcheck is
- // decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded
- // to this address. This field defaults to `customer_gre_endpoint address`. This
- // field is ignored for bidirectional healthchecks as the interface_address (not
- // assigned to the Cloudflare side of the tunnel) is used as the target.
- Target param.Field[string] `json:"target"`
- // The type of healthcheck to run, reply or request. The default value is `reply`.
- Type param.Field[MagicTransitIPSECTunnelUpdateParamsHealthCheckType] `json:"type"`
-}
-
-func (r MagicTransitIPSECTunnelUpdateParamsHealthCheck) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The direction of the flow of the healthcheck. Either unidirectional, where the
-// probe comes to you via the tunnel and the result comes back to Cloudflare via
-// the open Internet, or bidirectional where both the probe and result come and go
-// via the tunnel. Note in the case of bidirecitonal healthchecks, the target field
-// in health_check is ignored as the interface_address is used to send traffic into
-// the tunnel.
-type MagicTransitIPSECTunnelUpdateParamsHealthCheckDirection string
-
-const (
- MagicTransitIPSECTunnelUpdateParamsHealthCheckDirectionUnidirectional MagicTransitIPSECTunnelUpdateParamsHealthCheckDirection = "unidirectional"
- MagicTransitIPSECTunnelUpdateParamsHealthCheckDirectionBidirectional MagicTransitIPSECTunnelUpdateParamsHealthCheckDirection = "bidirectional"
-)
-
-// How frequent the health check is run. The default value is `mid`.
-type MagicTransitIPSECTunnelUpdateParamsHealthCheckRate string
-
-const (
- MagicTransitIPSECTunnelUpdateParamsHealthCheckRateLow MagicTransitIPSECTunnelUpdateParamsHealthCheckRate = "low"
- MagicTransitIPSECTunnelUpdateParamsHealthCheckRateMid MagicTransitIPSECTunnelUpdateParamsHealthCheckRate = "mid"
- MagicTransitIPSECTunnelUpdateParamsHealthCheckRateHigh MagicTransitIPSECTunnelUpdateParamsHealthCheckRate = "high"
-)
-
-// The type of healthcheck to run, reply or request. The default value is `reply`.
-type MagicTransitIPSECTunnelUpdateParamsHealthCheckType string
-
-const (
- MagicTransitIPSECTunnelUpdateParamsHealthCheckTypeReply MagicTransitIPSECTunnelUpdateParamsHealthCheckType = "reply"
- MagicTransitIPSECTunnelUpdateParamsHealthCheckTypeRequest MagicTransitIPSECTunnelUpdateParamsHealthCheckType = "request"
-)
-
-type MagicTransitIPSECTunnelUpdateResponseEnvelope struct {
- Errors []MagicTransitIPSECTunnelUpdateResponseEnvelopeErrors `json:"errors,required"`
- Messages []MagicTransitIPSECTunnelUpdateResponseEnvelopeMessages `json:"messages,required"`
- Result MagicTransitIPSECTunnelUpdateResponse `json:"result,required"`
- // Whether the API call was successful
- Success MagicTransitIPSECTunnelUpdateResponseEnvelopeSuccess `json:"success,required"`
- JSON magicTransitIPSECTunnelUpdateResponseEnvelopeJSON `json:"-"`
-}
-
-// magicTransitIPSECTunnelUpdateResponseEnvelopeJSON contains the JSON metadata for
-// the struct [MagicTransitIPSECTunnelUpdateResponseEnvelope]
-type magicTransitIPSECTunnelUpdateResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitIPSECTunnelUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitIPSECTunnelUpdateResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicTransitIPSECTunnelUpdateResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON magicTransitIPSECTunnelUpdateResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// magicTransitIPSECTunnelUpdateResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct [MagicTransitIPSECTunnelUpdateResponseEnvelopeErrors]
-type magicTransitIPSECTunnelUpdateResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitIPSECTunnelUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitIPSECTunnelUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicTransitIPSECTunnelUpdateResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON magicTransitIPSECTunnelUpdateResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// magicTransitIPSECTunnelUpdateResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct [MagicTransitIPSECTunnelUpdateResponseEnvelopeMessages]
-type magicTransitIPSECTunnelUpdateResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitIPSECTunnelUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitIPSECTunnelUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type MagicTransitIPSECTunnelUpdateResponseEnvelopeSuccess bool
-
-const (
- MagicTransitIPSECTunnelUpdateResponseEnvelopeSuccessTrue MagicTransitIPSECTunnelUpdateResponseEnvelopeSuccess = true
-)
-
-type MagicTransitIPSECTunnelListResponseEnvelope struct {
- Errors []MagicTransitIPSECTunnelListResponseEnvelopeErrors `json:"errors,required"`
- Messages []MagicTransitIPSECTunnelListResponseEnvelopeMessages `json:"messages,required"`
- Result MagicTransitIPSECTunnelListResponse `json:"result,required"`
- // Whether the API call was successful
- Success MagicTransitIPSECTunnelListResponseEnvelopeSuccess `json:"success,required"`
- JSON magicTransitIPSECTunnelListResponseEnvelopeJSON `json:"-"`
-}
-
-// magicTransitIPSECTunnelListResponseEnvelopeJSON contains the JSON metadata for
-// the struct [MagicTransitIPSECTunnelListResponseEnvelope]
-type magicTransitIPSECTunnelListResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitIPSECTunnelListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitIPSECTunnelListResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicTransitIPSECTunnelListResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON magicTransitIPSECTunnelListResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// magicTransitIPSECTunnelListResponseEnvelopeErrorsJSON contains the JSON metadata
-// for the struct [MagicTransitIPSECTunnelListResponseEnvelopeErrors]
-type magicTransitIPSECTunnelListResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitIPSECTunnelListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitIPSECTunnelListResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicTransitIPSECTunnelListResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON magicTransitIPSECTunnelListResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// magicTransitIPSECTunnelListResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct [MagicTransitIPSECTunnelListResponseEnvelopeMessages]
-type magicTransitIPSECTunnelListResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitIPSECTunnelListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitIPSECTunnelListResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type MagicTransitIPSECTunnelListResponseEnvelopeSuccess bool
-
-const (
- MagicTransitIPSECTunnelListResponseEnvelopeSuccessTrue MagicTransitIPSECTunnelListResponseEnvelopeSuccess = true
-)
-
-type MagicTransitIPSECTunnelDeleteResponseEnvelope struct {
- Errors []MagicTransitIPSECTunnelDeleteResponseEnvelopeErrors `json:"errors,required"`
- Messages []MagicTransitIPSECTunnelDeleteResponseEnvelopeMessages `json:"messages,required"`
- Result MagicTransitIPSECTunnelDeleteResponse `json:"result,required"`
- // Whether the API call was successful
- Success MagicTransitIPSECTunnelDeleteResponseEnvelopeSuccess `json:"success,required"`
- JSON magicTransitIPSECTunnelDeleteResponseEnvelopeJSON `json:"-"`
-}
-
-// magicTransitIPSECTunnelDeleteResponseEnvelopeJSON contains the JSON metadata for
-// the struct [MagicTransitIPSECTunnelDeleteResponseEnvelope]
-type magicTransitIPSECTunnelDeleteResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitIPSECTunnelDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitIPSECTunnelDeleteResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicTransitIPSECTunnelDeleteResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON magicTransitIPSECTunnelDeleteResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// magicTransitIPSECTunnelDeleteResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct [MagicTransitIPSECTunnelDeleteResponseEnvelopeErrors]
-type magicTransitIPSECTunnelDeleteResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitIPSECTunnelDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitIPSECTunnelDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicTransitIPSECTunnelDeleteResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON magicTransitIPSECTunnelDeleteResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// magicTransitIPSECTunnelDeleteResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct [MagicTransitIPSECTunnelDeleteResponseEnvelopeMessages]
-type magicTransitIPSECTunnelDeleteResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitIPSECTunnelDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitIPSECTunnelDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type MagicTransitIPSECTunnelDeleteResponseEnvelopeSuccess bool
-
-const (
- MagicTransitIPSECTunnelDeleteResponseEnvelopeSuccessTrue MagicTransitIPSECTunnelDeleteResponseEnvelopeSuccess = true
-)
-
-type MagicTransitIPSECTunnelGetResponseEnvelope struct {
- Errors []MagicTransitIPSECTunnelGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []MagicTransitIPSECTunnelGetResponseEnvelopeMessages `json:"messages,required"`
- Result MagicTransitIPSECTunnelGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success MagicTransitIPSECTunnelGetResponseEnvelopeSuccess `json:"success,required"`
- JSON magicTransitIPSECTunnelGetResponseEnvelopeJSON `json:"-"`
-}
-
-// magicTransitIPSECTunnelGetResponseEnvelopeJSON contains the JSON metadata for
-// the struct [MagicTransitIPSECTunnelGetResponseEnvelope]
-type magicTransitIPSECTunnelGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitIPSECTunnelGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitIPSECTunnelGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicTransitIPSECTunnelGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON magicTransitIPSECTunnelGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// magicTransitIPSECTunnelGetResponseEnvelopeErrorsJSON contains the JSON metadata
-// for the struct [MagicTransitIPSECTunnelGetResponseEnvelopeErrors]
-type magicTransitIPSECTunnelGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitIPSECTunnelGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitIPSECTunnelGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicTransitIPSECTunnelGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON magicTransitIPSECTunnelGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// magicTransitIPSECTunnelGetResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct [MagicTransitIPSECTunnelGetResponseEnvelopeMessages]
-type magicTransitIPSECTunnelGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitIPSECTunnelGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitIPSECTunnelGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type MagicTransitIPSECTunnelGetResponseEnvelopeSuccess bool
-
-const (
- MagicTransitIPSECTunnelGetResponseEnvelopeSuccessTrue MagicTransitIPSECTunnelGetResponseEnvelopeSuccess = true
-)
-
-type MagicTransitIPSECTunnelPSKGenerateResponseEnvelope struct {
- Errors []MagicTransitIPSECTunnelPSKGenerateResponseEnvelopeErrors `json:"errors,required"`
- Messages []MagicTransitIPSECTunnelPSKGenerateResponseEnvelopeMessages `json:"messages,required"`
- Result MagicTransitIPSECTunnelPSKGenerateResponse `json:"result,required"`
- // Whether the API call was successful
- Success MagicTransitIPSECTunnelPSKGenerateResponseEnvelopeSuccess `json:"success,required"`
- JSON magicTransitIPSECTunnelPSKGenerateResponseEnvelopeJSON `json:"-"`
-}
-
-// magicTransitIPSECTunnelPSKGenerateResponseEnvelopeJSON contains the JSON
-// metadata for the struct [MagicTransitIPSECTunnelPSKGenerateResponseEnvelope]
-type magicTransitIPSECTunnelPSKGenerateResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitIPSECTunnelPSKGenerateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitIPSECTunnelPSKGenerateResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicTransitIPSECTunnelPSKGenerateResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON magicTransitIPSECTunnelPSKGenerateResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// magicTransitIPSECTunnelPSKGenerateResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct
-// [MagicTransitIPSECTunnelPSKGenerateResponseEnvelopeErrors]
-type magicTransitIPSECTunnelPSKGenerateResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitIPSECTunnelPSKGenerateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitIPSECTunnelPSKGenerateResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicTransitIPSECTunnelPSKGenerateResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON magicTransitIPSECTunnelPSKGenerateResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// magicTransitIPSECTunnelPSKGenerateResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct
-// [MagicTransitIPSECTunnelPSKGenerateResponseEnvelopeMessages]
-type magicTransitIPSECTunnelPSKGenerateResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitIPSECTunnelPSKGenerateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitIPSECTunnelPSKGenerateResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type MagicTransitIPSECTunnelPSKGenerateResponseEnvelopeSuccess bool
-
-const (
- MagicTransitIPSECTunnelPSKGenerateResponseEnvelopeSuccessTrue MagicTransitIPSECTunnelPSKGenerateResponseEnvelopeSuccess = true
-)
diff --git a/magictransitipsectunnel_test.go b/magictransitipsectunnel_test.go
deleted file mode 100644
index 82a2da20c5d..00000000000
--- a/magictransitipsectunnel_test.go
+++ /dev/null
@@ -1,209 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestMagicTransitIPSECTunnelNewWithOptionalParams(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"),
- )
- _, err := client.MagicTransit.IPSECTunnels.New(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.MagicTransitIPSECTunnelNewParams{
- CloudflareEndpoint: cloudflare.F("203.0.113.1"),
- InterfaceAddress: cloudflare.F("192.0.2.0/31"),
- Name: cloudflare.F("IPsec_1"),
- CustomerEndpoint: cloudflare.F("203.0.113.1"),
- Description: cloudflare.F("Tunnel for ISP X"),
- HealthCheck: cloudflare.F(cloudflare.MagicTransitIPSECTunnelNewParamsHealthCheck{
- Direction: cloudflare.F(cloudflare.MagicTransitIPSECTunnelNewParamsHealthCheckDirectionBidirectional),
- Enabled: cloudflare.F(true),
- Rate: cloudflare.F(cloudflare.MagicTransitIPSECTunnelNewParamsHealthCheckRateLow),
- Target: cloudflare.F("203.0.113.1"),
- Type: cloudflare.F(cloudflare.MagicTransitIPSECTunnelNewParamsHealthCheckTypeRequest),
- }),
- PSK: cloudflare.F("O3bwKSjnaoCxDoUxjcq4Rk8ZKkezQUiy"),
- ReplayProtection: cloudflare.F(false),
- },
- )
- 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())
- }
-}
-
-func TestMagicTransitIPSECTunnelUpdateWithOptionalParams(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"),
- )
- _, err := client.MagicTransit.IPSECTunnels.Update(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.MagicTransitIPSECTunnelUpdateParams{
- CloudflareEndpoint: cloudflare.F("203.0.113.1"),
- InterfaceAddress: cloudflare.F("192.0.2.0/31"),
- Name: cloudflare.F("IPsec_1"),
- CustomerEndpoint: cloudflare.F("203.0.113.1"),
- Description: cloudflare.F("Tunnel for ISP X"),
- HealthCheck: cloudflare.F(cloudflare.MagicTransitIPSECTunnelUpdateParamsHealthCheck{
- Direction: cloudflare.F(cloudflare.MagicTransitIPSECTunnelUpdateParamsHealthCheckDirectionBidirectional),
- Enabled: cloudflare.F(true),
- Rate: cloudflare.F(cloudflare.MagicTransitIPSECTunnelUpdateParamsHealthCheckRateLow),
- Target: cloudflare.F("203.0.113.1"),
- Type: cloudflare.F(cloudflare.MagicTransitIPSECTunnelUpdateParamsHealthCheckTypeRequest),
- }),
- PSK: cloudflare.F("O3bwKSjnaoCxDoUxjcq4Rk8ZKkezQUiy"),
- ReplayProtection: cloudflare.F(false),
- },
- )
- 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())
- }
-}
-
-func TestMagicTransitIPSECTunnelList(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"),
- )
- _, err := client.MagicTransit.IPSECTunnels.List(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353")
- 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())
- }
-}
-
-func TestMagicTransitIPSECTunnelDelete(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"),
- )
- _, err := client.MagicTransit.IPSECTunnels.Delete(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- "023e105f4ecef8ad9ca31a8372d0c353",
- )
- 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())
- }
-}
-
-func TestMagicTransitIPSECTunnelGet(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"),
- )
- _, err := client.MagicTransit.IPSECTunnels.Get(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- "023e105f4ecef8ad9ca31a8372d0c353",
- )
- 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())
- }
-}
-
-func TestMagicTransitIPSECTunnelPSKGenerate(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"),
- )
- _, err := client.MagicTransit.IPSECTunnels.PSKGenerate(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- "023e105f4ecef8ad9ca31a8372d0c353",
- )
- 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/magictransitroute.go b/magictransitroute.go
deleted file mode 100644
index 87a45b026ab..00000000000
--- a/magictransitroute.go
+++ /dev/null
@@ -1,929 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// MagicTransitRouteService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewMagicTransitRouteService] method
-// instead.
-type MagicTransitRouteService struct {
- Options []option.RequestOption
-}
-
-// NewMagicTransitRouteService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewMagicTransitRouteService(opts ...option.RequestOption) (r *MagicTransitRouteService) {
- r = &MagicTransitRouteService{}
- r.Options = opts
- return
-}
-
-// Creates a new Magic static route. Use `?validate_only=true` as an optional query
-// parameter to run validation only without persisting changes.
-func (r *MagicTransitRouteService) New(ctx context.Context, accountIdentifier string, body MagicTransitRouteNewParams, opts ...option.RequestOption) (res *MagicTransitRouteNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env MagicTransitRouteNewResponseEnvelope
- path := fmt.Sprintf("accounts/%s/magic/routes", accountIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Update a specific Magic static route. Use `?validate_only=true` as an optional
-// query parameter to run validation only without persisting changes.
-func (r *MagicTransitRouteService) Update(ctx context.Context, accountIdentifier string, routeIdentifier string, body MagicTransitRouteUpdateParams, opts ...option.RequestOption) (res *MagicTransitRouteUpdateResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env MagicTransitRouteUpdateResponseEnvelope
- path := fmt.Sprintf("accounts/%s/magic/routes/%s", accountIdentifier, routeIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// List all Magic static routes.
-func (r *MagicTransitRouteService) List(ctx context.Context, accountIdentifier string, opts ...option.RequestOption) (res *MagicTransitRouteListResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env MagicTransitRouteListResponseEnvelope
- path := fmt.Sprintf("accounts/%s/magic/routes", accountIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Disable and remove a specific Magic static route.
-func (r *MagicTransitRouteService) Delete(ctx context.Context, accountIdentifier string, routeIdentifier string, opts ...option.RequestOption) (res *MagicTransitRouteDeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env MagicTransitRouteDeleteResponseEnvelope
- path := fmt.Sprintf("accounts/%s/magic/routes/%s", accountIdentifier, routeIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Delete multiple Magic static routes.
-func (r *MagicTransitRouteService) Empty(ctx context.Context, accountIdentifier string, body MagicTransitRouteEmptyParams, opts ...option.RequestOption) (res *MagicTransitRouteEmptyResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env MagicTransitRouteEmptyResponseEnvelope
- path := fmt.Sprintf("accounts/%s/magic/routes", accountIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Get a specific Magic static route.
-func (r *MagicTransitRouteService) Get(ctx context.Context, accountIdentifier string, routeIdentifier string, opts ...option.RequestOption) (res *MagicTransitRouteGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env MagicTransitRouteGetResponseEnvelope
- path := fmt.Sprintf("accounts/%s/magic/routes/%s", accountIdentifier, routeIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type MagicTransitRouteNewResponse struct {
- Routes []MagicTransitRouteNewResponseRoute `json:"routes"`
- JSON magicTransitRouteNewResponseJSON `json:"-"`
-}
-
-// magicTransitRouteNewResponseJSON contains the JSON metadata for the struct
-// [MagicTransitRouteNewResponse]
-type magicTransitRouteNewResponseJSON struct {
- Routes apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitRouteNewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitRouteNewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicTransitRouteNewResponseRoute struct {
- // The next-hop IP Address for the static route.
- Nexthop string `json:"nexthop,required"`
- // IP Prefix in Classless Inter-Domain Routing format.
- Prefix string `json:"prefix,required"`
- // Priority of the static route.
- Priority int64 `json:"priority,required"`
- // Identifier
- ID string `json:"id"`
- // When the route was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // An optional human provided description of the static route.
- Description string `json:"description"`
- // When the route was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Used only for ECMP routes.
- Scope MagicTransitRouteNewResponseRoutesScope `json:"scope"`
- // Optional weight of the ECMP scope - if provided.
- Weight int64 `json:"weight"`
- JSON magicTransitRouteNewResponseRouteJSON `json:"-"`
-}
-
-// magicTransitRouteNewResponseRouteJSON contains the JSON metadata for the struct
-// [MagicTransitRouteNewResponseRoute]
-type magicTransitRouteNewResponseRouteJSON struct {
- Nexthop apijson.Field
- Prefix apijson.Field
- Priority apijson.Field
- ID apijson.Field
- CreatedOn apijson.Field
- Description apijson.Field
- ModifiedOn apijson.Field
- Scope apijson.Field
- Weight apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitRouteNewResponseRoute) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitRouteNewResponseRouteJSON) RawJSON() string {
- return r.raw
-}
-
-// Used only for ECMP routes.
-type MagicTransitRouteNewResponseRoutesScope struct {
- // List of colo names for the ECMP scope.
- ColoNames []string `json:"colo_names"`
- // List of colo regions for the ECMP scope.
- ColoRegions []string `json:"colo_regions"`
- JSON magicTransitRouteNewResponseRoutesScopeJSON `json:"-"`
-}
-
-// magicTransitRouteNewResponseRoutesScopeJSON contains the JSON metadata for the
-// struct [MagicTransitRouteNewResponseRoutesScope]
-type magicTransitRouteNewResponseRoutesScopeJSON struct {
- ColoNames apijson.Field
- ColoRegions apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitRouteNewResponseRoutesScope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitRouteNewResponseRoutesScopeJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicTransitRouteUpdateResponse struct {
- Modified bool `json:"modified"`
- ModifiedRoute interface{} `json:"modified_route"`
- JSON magicTransitRouteUpdateResponseJSON `json:"-"`
-}
-
-// magicTransitRouteUpdateResponseJSON contains the JSON metadata for the struct
-// [MagicTransitRouteUpdateResponse]
-type magicTransitRouteUpdateResponseJSON struct {
- Modified apijson.Field
- ModifiedRoute apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitRouteUpdateResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitRouteUpdateResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicTransitRouteListResponse struct {
- Routes []MagicTransitRouteListResponseRoute `json:"routes"`
- JSON magicTransitRouteListResponseJSON `json:"-"`
-}
-
-// magicTransitRouteListResponseJSON contains the JSON metadata for the struct
-// [MagicTransitRouteListResponse]
-type magicTransitRouteListResponseJSON struct {
- Routes apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitRouteListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitRouteListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicTransitRouteListResponseRoute struct {
- // The next-hop IP Address for the static route.
- Nexthop string `json:"nexthop,required"`
- // IP Prefix in Classless Inter-Domain Routing format.
- Prefix string `json:"prefix,required"`
- // Priority of the static route.
- Priority int64 `json:"priority,required"`
- // Identifier
- ID string `json:"id"`
- // When the route was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // An optional human provided description of the static route.
- Description string `json:"description"`
- // When the route was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Used only for ECMP routes.
- Scope MagicTransitRouteListResponseRoutesScope `json:"scope"`
- // Optional weight of the ECMP scope - if provided.
- Weight int64 `json:"weight"`
- JSON magicTransitRouteListResponseRouteJSON `json:"-"`
-}
-
-// magicTransitRouteListResponseRouteJSON contains the JSON metadata for the struct
-// [MagicTransitRouteListResponseRoute]
-type magicTransitRouteListResponseRouteJSON struct {
- Nexthop apijson.Field
- Prefix apijson.Field
- Priority apijson.Field
- ID apijson.Field
- CreatedOn apijson.Field
- Description apijson.Field
- ModifiedOn apijson.Field
- Scope apijson.Field
- Weight apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitRouteListResponseRoute) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitRouteListResponseRouteJSON) RawJSON() string {
- return r.raw
-}
-
-// Used only for ECMP routes.
-type MagicTransitRouteListResponseRoutesScope struct {
- // List of colo names for the ECMP scope.
- ColoNames []string `json:"colo_names"`
- // List of colo regions for the ECMP scope.
- ColoRegions []string `json:"colo_regions"`
- JSON magicTransitRouteListResponseRoutesScopeJSON `json:"-"`
-}
-
-// magicTransitRouteListResponseRoutesScopeJSON contains the JSON metadata for the
-// struct [MagicTransitRouteListResponseRoutesScope]
-type magicTransitRouteListResponseRoutesScopeJSON struct {
- ColoNames apijson.Field
- ColoRegions apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitRouteListResponseRoutesScope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitRouteListResponseRoutesScopeJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicTransitRouteDeleteResponse struct {
- Deleted bool `json:"deleted"`
- DeletedRoute interface{} `json:"deleted_route"`
- JSON magicTransitRouteDeleteResponseJSON `json:"-"`
-}
-
-// magicTransitRouteDeleteResponseJSON contains the JSON metadata for the struct
-// [MagicTransitRouteDeleteResponse]
-type magicTransitRouteDeleteResponseJSON struct {
- Deleted apijson.Field
- DeletedRoute apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitRouteDeleteResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitRouteDeleteResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicTransitRouteEmptyResponse struct {
- Deleted bool `json:"deleted"`
- DeletedRoutes interface{} `json:"deleted_routes"`
- JSON magicTransitRouteEmptyResponseJSON `json:"-"`
-}
-
-// magicTransitRouteEmptyResponseJSON contains the JSON metadata for the struct
-// [MagicTransitRouteEmptyResponse]
-type magicTransitRouteEmptyResponseJSON struct {
- Deleted apijson.Field
- DeletedRoutes apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitRouteEmptyResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitRouteEmptyResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicTransitRouteGetResponse struct {
- Route interface{} `json:"route"`
- JSON magicTransitRouteGetResponseJSON `json:"-"`
-}
-
-// magicTransitRouteGetResponseJSON contains the JSON metadata for the struct
-// [MagicTransitRouteGetResponse]
-type magicTransitRouteGetResponseJSON struct {
- Route apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitRouteGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitRouteGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicTransitRouteNewParams struct {
- Body param.Field[interface{}] `json:"body,required"`
-}
-
-func (r MagicTransitRouteNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r.Body)
-}
-
-type MagicTransitRouteNewResponseEnvelope struct {
- Errors []MagicTransitRouteNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []MagicTransitRouteNewResponseEnvelopeMessages `json:"messages,required"`
- Result MagicTransitRouteNewResponse `json:"result,required"`
- // Whether the API call was successful
- Success MagicTransitRouteNewResponseEnvelopeSuccess `json:"success,required"`
- JSON magicTransitRouteNewResponseEnvelopeJSON `json:"-"`
-}
-
-// magicTransitRouteNewResponseEnvelopeJSON contains the JSON metadata for the
-// struct [MagicTransitRouteNewResponseEnvelope]
-type magicTransitRouteNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitRouteNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitRouteNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicTransitRouteNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON magicTransitRouteNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// magicTransitRouteNewResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [MagicTransitRouteNewResponseEnvelopeErrors]
-type magicTransitRouteNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitRouteNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitRouteNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicTransitRouteNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON magicTransitRouteNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// magicTransitRouteNewResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [MagicTransitRouteNewResponseEnvelopeMessages]
-type magicTransitRouteNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitRouteNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitRouteNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type MagicTransitRouteNewResponseEnvelopeSuccess bool
-
-const (
- MagicTransitRouteNewResponseEnvelopeSuccessTrue MagicTransitRouteNewResponseEnvelopeSuccess = true
-)
-
-type MagicTransitRouteUpdateParams struct {
- // The next-hop IP Address for the static route.
- Nexthop param.Field[string] `json:"nexthop,required"`
- // IP Prefix in Classless Inter-Domain Routing format.
- Prefix param.Field[string] `json:"prefix,required"`
- // Priority of the static route.
- Priority param.Field[int64] `json:"priority,required"`
- // An optional human provided description of the static route.
- Description param.Field[string] `json:"description"`
- // Used only for ECMP routes.
- Scope param.Field[MagicTransitRouteUpdateParamsScope] `json:"scope"`
- // Optional weight of the ECMP scope - if provided.
- Weight param.Field[int64] `json:"weight"`
-}
-
-func (r MagicTransitRouteUpdateParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Used only for ECMP routes.
-type MagicTransitRouteUpdateParamsScope struct {
- // List of colo names for the ECMP scope.
- ColoNames param.Field[[]string] `json:"colo_names"`
- // List of colo regions for the ECMP scope.
- ColoRegions param.Field[[]string] `json:"colo_regions"`
-}
-
-func (r MagicTransitRouteUpdateParamsScope) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type MagicTransitRouteUpdateResponseEnvelope struct {
- Errors []MagicTransitRouteUpdateResponseEnvelopeErrors `json:"errors,required"`
- Messages []MagicTransitRouteUpdateResponseEnvelopeMessages `json:"messages,required"`
- Result MagicTransitRouteUpdateResponse `json:"result,required"`
- // Whether the API call was successful
- Success MagicTransitRouteUpdateResponseEnvelopeSuccess `json:"success,required"`
- JSON magicTransitRouteUpdateResponseEnvelopeJSON `json:"-"`
-}
-
-// magicTransitRouteUpdateResponseEnvelopeJSON contains the JSON metadata for the
-// struct [MagicTransitRouteUpdateResponseEnvelope]
-type magicTransitRouteUpdateResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitRouteUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitRouteUpdateResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicTransitRouteUpdateResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON magicTransitRouteUpdateResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// magicTransitRouteUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [MagicTransitRouteUpdateResponseEnvelopeErrors]
-type magicTransitRouteUpdateResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitRouteUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitRouteUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicTransitRouteUpdateResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON magicTransitRouteUpdateResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// magicTransitRouteUpdateResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [MagicTransitRouteUpdateResponseEnvelopeMessages]
-type magicTransitRouteUpdateResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitRouteUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitRouteUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type MagicTransitRouteUpdateResponseEnvelopeSuccess bool
-
-const (
- MagicTransitRouteUpdateResponseEnvelopeSuccessTrue MagicTransitRouteUpdateResponseEnvelopeSuccess = true
-)
-
-type MagicTransitRouteListResponseEnvelope struct {
- Errors []MagicTransitRouteListResponseEnvelopeErrors `json:"errors,required"`
- Messages []MagicTransitRouteListResponseEnvelopeMessages `json:"messages,required"`
- Result MagicTransitRouteListResponse `json:"result,required"`
- // Whether the API call was successful
- Success MagicTransitRouteListResponseEnvelopeSuccess `json:"success,required"`
- JSON magicTransitRouteListResponseEnvelopeJSON `json:"-"`
-}
-
-// magicTransitRouteListResponseEnvelopeJSON contains the JSON metadata for the
-// struct [MagicTransitRouteListResponseEnvelope]
-type magicTransitRouteListResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitRouteListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitRouteListResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicTransitRouteListResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON magicTransitRouteListResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// magicTransitRouteListResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [MagicTransitRouteListResponseEnvelopeErrors]
-type magicTransitRouteListResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitRouteListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitRouteListResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicTransitRouteListResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON magicTransitRouteListResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// magicTransitRouteListResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [MagicTransitRouteListResponseEnvelopeMessages]
-type magicTransitRouteListResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitRouteListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitRouteListResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type MagicTransitRouteListResponseEnvelopeSuccess bool
-
-const (
- MagicTransitRouteListResponseEnvelopeSuccessTrue MagicTransitRouteListResponseEnvelopeSuccess = true
-)
-
-type MagicTransitRouteDeleteResponseEnvelope struct {
- Errors []MagicTransitRouteDeleteResponseEnvelopeErrors `json:"errors,required"`
- Messages []MagicTransitRouteDeleteResponseEnvelopeMessages `json:"messages,required"`
- Result MagicTransitRouteDeleteResponse `json:"result,required"`
- // Whether the API call was successful
- Success MagicTransitRouteDeleteResponseEnvelopeSuccess `json:"success,required"`
- JSON magicTransitRouteDeleteResponseEnvelopeJSON `json:"-"`
-}
-
-// magicTransitRouteDeleteResponseEnvelopeJSON contains the JSON metadata for the
-// struct [MagicTransitRouteDeleteResponseEnvelope]
-type magicTransitRouteDeleteResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitRouteDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitRouteDeleteResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicTransitRouteDeleteResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON magicTransitRouteDeleteResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// magicTransitRouteDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [MagicTransitRouteDeleteResponseEnvelopeErrors]
-type magicTransitRouteDeleteResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitRouteDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitRouteDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicTransitRouteDeleteResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON magicTransitRouteDeleteResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// magicTransitRouteDeleteResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [MagicTransitRouteDeleteResponseEnvelopeMessages]
-type magicTransitRouteDeleteResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitRouteDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitRouteDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type MagicTransitRouteDeleteResponseEnvelopeSuccess bool
-
-const (
- MagicTransitRouteDeleteResponseEnvelopeSuccessTrue MagicTransitRouteDeleteResponseEnvelopeSuccess = true
-)
-
-type MagicTransitRouteEmptyParams struct {
- Routes param.Field[[]MagicTransitRouteEmptyParamsRoute] `json:"routes,required"`
-}
-
-func (r MagicTransitRouteEmptyParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type MagicTransitRouteEmptyParamsRoute struct {
-}
-
-func (r MagicTransitRouteEmptyParamsRoute) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type MagicTransitRouteEmptyResponseEnvelope struct {
- Errors []MagicTransitRouteEmptyResponseEnvelopeErrors `json:"errors,required"`
- Messages []MagicTransitRouteEmptyResponseEnvelopeMessages `json:"messages,required"`
- Result MagicTransitRouteEmptyResponse `json:"result,required"`
- // Whether the API call was successful
- Success MagicTransitRouteEmptyResponseEnvelopeSuccess `json:"success,required"`
- JSON magicTransitRouteEmptyResponseEnvelopeJSON `json:"-"`
-}
-
-// magicTransitRouteEmptyResponseEnvelopeJSON contains the JSON metadata for the
-// struct [MagicTransitRouteEmptyResponseEnvelope]
-type magicTransitRouteEmptyResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitRouteEmptyResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitRouteEmptyResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicTransitRouteEmptyResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON magicTransitRouteEmptyResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// magicTransitRouteEmptyResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [MagicTransitRouteEmptyResponseEnvelopeErrors]
-type magicTransitRouteEmptyResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitRouteEmptyResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitRouteEmptyResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicTransitRouteEmptyResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON magicTransitRouteEmptyResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// magicTransitRouteEmptyResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [MagicTransitRouteEmptyResponseEnvelopeMessages]
-type magicTransitRouteEmptyResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitRouteEmptyResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitRouteEmptyResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type MagicTransitRouteEmptyResponseEnvelopeSuccess bool
-
-const (
- MagicTransitRouteEmptyResponseEnvelopeSuccessTrue MagicTransitRouteEmptyResponseEnvelopeSuccess = true
-)
-
-type MagicTransitRouteGetResponseEnvelope struct {
- Errors []MagicTransitRouteGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []MagicTransitRouteGetResponseEnvelopeMessages `json:"messages,required"`
- Result MagicTransitRouteGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success MagicTransitRouteGetResponseEnvelopeSuccess `json:"success,required"`
- JSON magicTransitRouteGetResponseEnvelopeJSON `json:"-"`
-}
-
-// magicTransitRouteGetResponseEnvelopeJSON contains the JSON metadata for the
-// struct [MagicTransitRouteGetResponseEnvelope]
-type magicTransitRouteGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitRouteGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitRouteGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicTransitRouteGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON magicTransitRouteGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// magicTransitRouteGetResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [MagicTransitRouteGetResponseEnvelopeErrors]
-type magicTransitRouteGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitRouteGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitRouteGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type MagicTransitRouteGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON magicTransitRouteGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// magicTransitRouteGetResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [MagicTransitRouteGetResponseEnvelopeMessages]
-type magicTransitRouteGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MagicTransitRouteGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r magicTransitRouteGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type MagicTransitRouteGetResponseEnvelopeSuccess bool
-
-const (
- MagicTransitRouteGetResponseEnvelopeSuccessTrue MagicTransitRouteGetResponseEnvelopeSuccess = true
-)
diff --git a/magictransitroute_test.go b/magictransitroute_test.go
deleted file mode 100644
index 1f824122c9f..00000000000
--- a/magictransitroute_test.go
+++ /dev/null
@@ -1,193 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestMagicTransitRouteNew(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"),
- )
- _, err := client.MagicTransit.Routes.New(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.MagicTransitRouteNewParams{
- Body: cloudflare.F[any](map[string]interface{}{}),
- },
- )
- 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())
- }
-}
-
-func TestMagicTransitRouteUpdateWithOptionalParams(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"),
- )
- _, err := client.MagicTransit.Routes.Update(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.MagicTransitRouteUpdateParams{
- Nexthop: cloudflare.F("203.0.113.1"),
- Prefix: cloudflare.F("192.0.2.0/24"),
- Priority: cloudflare.F(int64(0)),
- Description: cloudflare.F("New route for new prefix 203.0.113.1"),
- Scope: cloudflare.F(cloudflare.MagicTransitRouteUpdateParamsScope{
- ColoNames: cloudflare.F([]string{"den01", "den01", "den01"}),
- ColoRegions: cloudflare.F([]string{"APAC", "APAC", "APAC"}),
- }),
- Weight: cloudflare.F(int64(0)),
- },
- )
- 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())
- }
-}
-
-func TestMagicTransitRouteList(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"),
- )
- _, err := client.MagicTransit.Routes.List(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353")
- 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())
- }
-}
-
-func TestMagicTransitRouteDelete(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"),
- )
- _, err := client.MagicTransit.Routes.Delete(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- "023e105f4ecef8ad9ca31a8372d0c353",
- )
- 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())
- }
-}
-
-func TestMagicTransitRouteEmpty(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"),
- )
- _, err := client.MagicTransit.Routes.Empty(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.MagicTransitRouteEmptyParams{
- Routes: cloudflare.F([]cloudflare.MagicTransitRouteEmptyParamsRoute{{}, {}, {}}),
- },
- )
- 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())
- }
-}
-
-func TestMagicTransitRouteGet(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"),
- )
- _, err := client.MagicTransit.Routes.Get(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- "023e105f4ecef8ad9ca31a8372d0c353",
- )
- 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/managed_headers/aliases.go b/managed_headers/aliases.go
new file mode 100644
index 00000000000..a45308dcea2
--- /dev/null
+++ b/managed_headers/aliases.go
@@ -0,0 +1,9 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package managed_headers
+
+import (
+ "github.com/cloudflare/cloudflare-go/internal/apierror"
+)
+
+type Error = apierror.Error
diff --git a/managedheader.go b/managed_headers/managedheader.go
similarity index 99%
rename from managedheader.go
rename to managed_headers/managedheader.go
index 896ad9da996..a84590f0a64 100644
--- a/managedheader.go
+++ b/managed_headers/managedheader.go
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package cloudflare
+package managed_headers
import (
"context"
diff --git a/managedheader_test.go b/managed_headers/managedheader_test.go
similarity index 81%
rename from managedheader_test.go
rename to managed_headers/managedheader_test.go
index 5cad0e04eac..a03e59a00bf 100644
--- a/managedheader_test.go
+++ b/managed_headers/managedheader_test.go
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package cloudflare_test
+package managed_headers_test
import (
"context"
@@ -10,6 +10,7 @@ import (
"github.com/cloudflare/cloudflare-go"
"github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/managed_headers"
"github.com/cloudflare/cloudflare-go/option"
)
@@ -27,7 +28,7 @@ func TestManagedHeaderList(t *testing.T) {
option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"),
option.WithAPIEmail("user@example.com"),
)
- _, err := client.ManagedHeaders.List(context.TODO(), cloudflare.ManagedHeaderListParams{
+ _, err := client.ManagedHeaders.List(context.TODO(), managed_headers.ManagedHeaderListParams{
ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
})
if err != nil {
@@ -53,9 +54,9 @@ func TestManagedHeaderEdit(t *testing.T) {
option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"),
option.WithAPIEmail("user@example.com"),
)
- _, err := client.ManagedHeaders.Edit(context.TODO(), cloudflare.ManagedHeaderEditParams{
+ _, err := client.ManagedHeaders.Edit(context.TODO(), managed_headers.ManagedHeaderEditParams{
ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- ManagedRequestHeaders: cloudflare.F([]cloudflare.ManagedHeaderEditParamsManagedRequestHeader{{
+ ManagedRequestHeaders: cloudflare.F([]managed_headers.ManagedHeaderEditParamsManagedRequestHeader{{
Enabled: cloudflare.F(true),
ID: cloudflare.F("add_cf-bot-score_header"),
}, {
@@ -65,7 +66,7 @@ func TestManagedHeaderEdit(t *testing.T) {
Enabled: cloudflare.F(true),
ID: cloudflare.F("add_cf-bot-score_header"),
}}),
- ManagedResponseHeaders: cloudflare.F([]cloudflare.ManagedHeaderEditParamsManagedResponseHeader{{
+ ManagedResponseHeaders: cloudflare.F([]managed_headers.ManagedHeaderEditParamsManagedResponseHeader{{
Enabled: cloudflare.F(true),
ID: cloudflare.F("add_cf-bot-score_header"),
}, {
diff --git a/memberships/aliases.go b/memberships/aliases.go
new file mode 100644
index 00000000000..ece7754be85
--- /dev/null
+++ b/memberships/aliases.go
@@ -0,0 +1,9 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package memberships
+
+import (
+ "github.com/cloudflare/cloudflare-go/internal/apierror"
+)
+
+type Error = apierror.Error
diff --git a/membership.go b/memberships/membership.go
similarity index 98%
rename from membership.go
rename to memberships/membership.go
index 4b0ec3339e3..af4663c3023 100644
--- a/membership.go
+++ b/memberships/membership.go
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package cloudflare
+package memberships
import (
"context"
@@ -9,6 +9,7 @@ import (
"net/url"
"reflect"
+ "github.com/cloudflare/cloudflare-go/accounts"
"github.com/cloudflare/cloudflare-go/internal/apijson"
"github.com/cloudflare/cloudflare-go/internal/apiquery"
"github.com/cloudflare/cloudflare-go/internal/param"
@@ -99,8 +100,8 @@ func (r *MembershipService) Get(ctx context.Context, membershipID string, opts .
type Membership struct {
// Membership identifier tag.
- ID string `json:"id"`
- Account Account `json:"account"`
+ ID string `json:"id"`
+ Account accounts.Account `json:"account"`
// Enterprise only. Indicates whether or not API access is enabled specifically for
// this user on a given account.
APIAccessEnabled bool `json:"api_access_enabled,nullable"`
@@ -465,9 +466,10 @@ const (
MembershipStatusRejected MembershipStatus = "rejected"
)
-// Union satisfied by [MembershipUpdateResponseUnknown] or [shared.UnionString].
+// Union satisfied by [memberships.MembershipUpdateResponseUnknown] or
+// [shared.UnionString].
type MembershipUpdateResponse interface {
- ImplementsMembershipUpdateResponse()
+ ImplementsMembershipsMembershipUpdateResponse()
}
func init() {
@@ -503,9 +505,10 @@ func (r membershipDeleteResponseJSON) RawJSON() string {
return r.raw
}
-// Union satisfied by [MembershipGetResponseUnknown] or [shared.UnionString].
+// Union satisfied by [memberships.MembershipGetResponseUnknown] or
+// [shared.UnionString].
type MembershipGetResponse interface {
- ImplementsMembershipGetResponse()
+ ImplementsMembershipsMembershipGetResponse()
}
func init() {
diff --git a/membership_test.go b/memberships/membership_test.go
similarity index 85%
rename from membership_test.go
rename to memberships/membership_test.go
index f95e2704a13..92dc38aae38 100644
--- a/membership_test.go
+++ b/memberships/membership_test.go
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package cloudflare_test
+package memberships_test
import (
"context"
@@ -10,6 +10,7 @@ import (
"github.com/cloudflare/cloudflare-go"
"github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/memberships"
"github.com/cloudflare/cloudflare-go/option"
)
@@ -30,8 +31,8 @@ func TestMembershipUpdate(t *testing.T) {
_, err := client.Memberships.Update(
context.TODO(),
"4536bcfad5faccb111b47003c79917fa",
- cloudflare.MembershipUpdateParams{
- Status: cloudflare.F(cloudflare.MembershipUpdateParamsStatusAccepted),
+ memberships.MembershipUpdateParams{
+ Status: cloudflare.F(memberships.MembershipUpdateParamsStatusAccepted),
},
)
if err != nil {
@@ -57,16 +58,16 @@ func TestMembershipListWithOptionalParams(t *testing.T) {
option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"),
option.WithAPIEmail("user@example.com"),
)
- _, err := client.Memberships.List(context.TODO(), cloudflare.MembershipListParams{
- Account: cloudflare.F(cloudflare.MembershipListParamsAccount{
+ _, err := client.Memberships.List(context.TODO(), memberships.MembershipListParams{
+ Account: cloudflare.F(memberships.MembershipListParamsAccount{
Name: cloudflare.F("Demo Account"),
}),
- Direction: cloudflare.F(cloudflare.MembershipListParamsDirectionDesc),
+ Direction: cloudflare.F(memberships.MembershipListParamsDirectionDesc),
Name: cloudflare.F("Demo Account"),
- Order: cloudflare.F(cloudflare.MembershipListParamsOrderStatus),
+ Order: cloudflare.F(memberships.MembershipListParamsOrderStatus),
Page: cloudflare.F(1.000000),
PerPage: cloudflare.F(5.000000),
- Status: cloudflare.F(cloudflare.MembershipListParamsStatusAccepted),
+ Status: cloudflare.F(memberships.MembershipListParamsStatusAccepted),
})
if err != nil {
var apierr *cloudflare.Error
diff --git a/mtls_certificates/aliases.go b/mtls_certificates/aliases.go
new file mode 100644
index 00000000000..625b8dda3bd
--- /dev/null
+++ b/mtls_certificates/aliases.go
@@ -0,0 +1,9 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package mtls_certificates
+
+import (
+ "github.com/cloudflare/cloudflare-go/internal/apierror"
+)
+
+type Error = apierror.Error
diff --git a/mtls_certificates/association.go b/mtls_certificates/association.go
new file mode 100644
index 00000000000..005edaefe71
--- /dev/null
+++ b/mtls_certificates/association.go
@@ -0,0 +1,189 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package mtls_certificates
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// AssociationService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewAssociationService] method
+// instead.
+type AssociationService struct {
+ Options []option.RequestOption
+}
+
+// NewAssociationService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewAssociationService(opts ...option.RequestOption) (r *AssociationService) {
+ r = &AssociationService{}
+ r.Options = opts
+ return
+}
+
+// Lists all active associations between the certificate and Cloudflare services.
+func (r *AssociationService) Get(ctx context.Context, mtlsCertificateID string, query AssociationGetParams, opts ...option.RequestOption) (res *[]TLSCertificatesAndHostnamesAssociationObject, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AssociationGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/mtls_certificates/%s/associations", query.AccountID, mtlsCertificateID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type TLSCertificatesAndHostnamesAssociationObject struct {
+ // The service using the certificate.
+ Service string `json:"service"`
+ // Certificate deployment status for the given service.
+ Status string `json:"status"`
+ JSON tlsCertificatesAndHostnamesAssociationObjectJSON `json:"-"`
+}
+
+// tlsCertificatesAndHostnamesAssociationObjectJSON contains the JSON metadata for
+// the struct [TLSCertificatesAndHostnamesAssociationObject]
+type tlsCertificatesAndHostnamesAssociationObjectJSON struct {
+ Service apijson.Field
+ Status apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *TLSCertificatesAndHostnamesAssociationObject) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r tlsCertificatesAndHostnamesAssociationObjectJSON) RawJSON() string {
+ return r.raw
+}
+
+type AssociationGetParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type AssociationGetResponseEnvelope struct {
+ Errors []AssociationGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []AssociationGetResponseEnvelopeMessages `json:"messages,required"`
+ Result []TLSCertificatesAndHostnamesAssociationObject `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success AssociationGetResponseEnvelopeSuccess `json:"success,required"`
+ ResultInfo AssociationGetResponseEnvelopeResultInfo `json:"result_info"`
+ JSON associationGetResponseEnvelopeJSON `json:"-"`
+}
+
+// associationGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [AssociationGetResponseEnvelope]
+type associationGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ ResultInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AssociationGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r associationGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AssociationGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON associationGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// associationGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [AssociationGetResponseEnvelopeErrors]
+type associationGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AssociationGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r associationGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type AssociationGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON associationGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// associationGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [AssociationGetResponseEnvelopeMessages]
+type associationGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AssociationGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r associationGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type AssociationGetResponseEnvelopeSuccess bool
+
+const (
+ AssociationGetResponseEnvelopeSuccessTrue AssociationGetResponseEnvelopeSuccess = true
+)
+
+type AssociationGetResponseEnvelopeResultInfo struct {
+ // Total number of results for the requested service
+ Count float64 `json:"count"`
+ // Current page within paginated list of results
+ Page float64 `json:"page"`
+ // Number of results per page of results
+ PerPage float64 `json:"per_page"`
+ // Total results available without any search parameters
+ TotalCount float64 `json:"total_count"`
+ JSON associationGetResponseEnvelopeResultInfoJSON `json:"-"`
+}
+
+// associationGetResponseEnvelopeResultInfoJSON contains the JSON metadata for the
+// struct [AssociationGetResponseEnvelopeResultInfo]
+type associationGetResponseEnvelopeResultInfoJSON struct {
+ Count apijson.Field
+ Page apijson.Field
+ PerPage apijson.Field
+ TotalCount apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AssociationGetResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r associationGetResponseEnvelopeResultInfoJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/mtls_certificates/association_test.go b/mtls_certificates/association_test.go
new file mode 100644
index 00000000000..05c4b7d74cb
--- /dev/null
+++ b/mtls_certificates/association_test.go
@@ -0,0 +1,45 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package mtls_certificates_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/mtls_certificates"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestAssociationGet(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"),
+ )
+ _, err := client.MTLSCertificates.Associations.Get(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ mtls_certificates.AssociationGetParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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/mtlscertificate.go b/mtls_certificates/mtlscertificate.go
similarity index 77%
rename from mtlscertificate.go
rename to mtls_certificates/mtlscertificate.go
index 12a30561891..2b6e4123355 100644
--- a/mtlscertificate.go
+++ b/mtls_certificates/mtlscertificate.go
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package cloudflare
+package mtls_certificates
import (
"context"
@@ -21,7 +21,7 @@ import (
// instead.
type MTLSCertificateService struct {
Options []option.RequestOption
- Associations *MTLSCertificateAssociationService
+ Associations *AssociationService
}
// NewMTLSCertificateService generates a new service that applies the given options
@@ -30,12 +30,12 @@ type MTLSCertificateService struct {
func NewMTLSCertificateService(opts ...option.RequestOption) (r *MTLSCertificateService) {
r = &MTLSCertificateService{}
r.Options = opts
- r.Associations = NewMTLSCertificateAssociationService(opts...)
+ r.Associations = NewAssociationService(opts...)
return
}
// Upload a certificate that you want to use with mTLS-enabled Cloudflare services.
-func (r *MTLSCertificateService) New(ctx context.Context, params MTLSCertificateNewParams, opts ...option.RequestOption) (res *MTLSCertificateNewResponse, err error) {
+func (r *MTLSCertificateService) New(ctx context.Context, params MTLSCertificateNewParams, opts ...option.RequestOption) (res *TLSCertificatesAndHostnamesCertificateObjectPost, err error) {
opts = append(r.Options[:], opts...)
var env MTLSCertificateNewResponseEnvelope
path := fmt.Sprintf("accounts/%s/mtls_certificates", params.AccountID)
@@ -48,7 +48,7 @@ func (r *MTLSCertificateService) New(ctx context.Context, params MTLSCertificate
}
// Lists all mTLS certificates.
-func (r *MTLSCertificateService) List(ctx context.Context, query MTLSCertificateListParams, opts ...option.RequestOption) (res *[]MTLSCertificateListResponse, err error) {
+func (r *MTLSCertificateService) List(ctx context.Context, query MTLSCertificateListParams, opts ...option.RequestOption) (res *[]TLSCertificatesAndHostnamesComponentsSchemasCertificateObject, err error) {
opts = append(r.Options[:], opts...)
var env MTLSCertificateListResponseEnvelope
path := fmt.Sprintf("accounts/%s/mtls_certificates", query.AccountID)
@@ -62,7 +62,7 @@ func (r *MTLSCertificateService) List(ctx context.Context, query MTLSCertificate
// Deletes the mTLS certificate unless the certificate is in use by one or more
// Cloudflare services.
-func (r *MTLSCertificateService) Delete(ctx context.Context, mtlsCertificateID string, body MTLSCertificateDeleteParams, opts ...option.RequestOption) (res *MTLSCertificateDeleteResponse, err error) {
+func (r *MTLSCertificateService) Delete(ctx context.Context, mtlsCertificateID string, body MTLSCertificateDeleteParams, opts ...option.RequestOption) (res *TLSCertificatesAndHostnamesComponentsSchemasCertificateObject, err error) {
opts = append(r.Options[:], opts...)
var env MTLSCertificateDeleteResponseEnvelope
path := fmt.Sprintf("accounts/%s/mtls_certificates/%s", body.AccountID, mtlsCertificateID)
@@ -75,7 +75,7 @@ func (r *MTLSCertificateService) Delete(ctx context.Context, mtlsCertificateID s
}
// Fetches a single mTLS certificate.
-func (r *MTLSCertificateService) Get(ctx context.Context, mtlsCertificateID string, query MTLSCertificateGetParams, opts ...option.RequestOption) (res *MTLSCertificateGetResponse, err error) {
+func (r *MTLSCertificateService) Get(ctx context.Context, mtlsCertificateID string, query MTLSCertificateGetParams, opts ...option.RequestOption) (res *TLSCertificatesAndHostnamesComponentsSchemasCertificateObject, err error) {
opts = append(r.Options[:], opts...)
var env MTLSCertificateGetResponseEnvelope
path := fmt.Sprintf("accounts/%s/mtls_certificates/%s", query.AccountID, mtlsCertificateID)
@@ -87,7 +87,7 @@ func (r *MTLSCertificateService) Get(ctx context.Context, mtlsCertificateID stri
return
}
-type MTLSCertificateNewResponse struct {
+type TLSCertificatesAndHostnamesCertificateObjectPost struct {
// Identifier
ID string `json:"id"`
// Indicates whether the certificate is a CA or leaf certificate.
@@ -107,13 +107,13 @@ type MTLSCertificateNewResponse struct {
// This is the time the certificate was updated.
UpdatedAt time.Time `json:"updated_at" format:"date-time"`
// This is the time the certificate was uploaded.
- UploadedOn time.Time `json:"uploaded_on" format:"date-time"`
- JSON mtlsCertificateNewResponseJSON `json:"-"`
+ UploadedOn time.Time `json:"uploaded_on" format:"date-time"`
+ JSON tlsCertificatesAndHostnamesCertificateObjectPostJSON `json:"-"`
}
-// mtlsCertificateNewResponseJSON contains the JSON metadata for the struct
-// [MTLSCertificateNewResponse]
-type mtlsCertificateNewResponseJSON struct {
+// tlsCertificatesAndHostnamesCertificateObjectPostJSON contains the JSON metadata
+// for the struct [TLSCertificatesAndHostnamesCertificateObjectPost]
+type tlsCertificatesAndHostnamesCertificateObjectPostJSON struct {
ID apijson.Field
CA apijson.Field
Certificates apijson.Field
@@ -128,15 +128,15 @@ type mtlsCertificateNewResponseJSON struct {
ExtraFields map[string]apijson.Field
}
-func (r *MTLSCertificateNewResponse) UnmarshalJSON(data []byte) (err error) {
+func (r *TLSCertificatesAndHostnamesCertificateObjectPost) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
-func (r mtlsCertificateNewResponseJSON) RawJSON() string {
+func (r tlsCertificatesAndHostnamesCertificateObjectPostJSON) RawJSON() string {
return r.raw
}
-type MTLSCertificateListResponse struct {
+type TLSCertificatesAndHostnamesComponentsSchemasCertificateObject struct {
// Identifier
ID string `json:"id"`
// Indicates whether the certificate is a CA or leaf certificate.
@@ -154,13 +154,14 @@ type MTLSCertificateListResponse struct {
// The type of hash used for the certificate.
Signature string `json:"signature"`
// This is the time the certificate was uploaded.
- UploadedOn time.Time `json:"uploaded_on" format:"date-time"`
- JSON mtlsCertificateListResponseJSON `json:"-"`
+ UploadedOn time.Time `json:"uploaded_on" format:"date-time"`
+ JSON tlsCertificatesAndHostnamesComponentsSchemasCertificateObjectJSON `json:"-"`
}
-// mtlsCertificateListResponseJSON contains the JSON metadata for the struct
-// [MTLSCertificateListResponse]
-type mtlsCertificateListResponseJSON struct {
+// tlsCertificatesAndHostnamesComponentsSchemasCertificateObjectJSON contains the
+// JSON metadata for the struct
+// [TLSCertificatesAndHostnamesComponentsSchemasCertificateObject]
+type tlsCertificatesAndHostnamesComponentsSchemasCertificateObjectJSON struct {
ID apijson.Field
CA apijson.Field
Certificates apijson.Field
@@ -174,103 +175,11 @@ type mtlsCertificateListResponseJSON struct {
ExtraFields map[string]apijson.Field
}
-func (r *MTLSCertificateListResponse) UnmarshalJSON(data []byte) (err error) {
+func (r *TLSCertificatesAndHostnamesComponentsSchemasCertificateObject) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
-func (r mtlsCertificateListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type MTLSCertificateDeleteResponse struct {
- // Identifier
- ID string `json:"id"`
- // Indicates whether the certificate is a CA or leaf certificate.
- CA bool `json:"ca"`
- // The uploaded root CA certificate.
- Certificates string `json:"certificates"`
- // When the certificate expires.
- ExpiresOn time.Time `json:"expires_on" format:"date-time"`
- // The certificate authority that issued the certificate.
- Issuer string `json:"issuer"`
- // Optional unique name for the certificate. Only used for human readability.
- Name string `json:"name"`
- // The certificate serial number.
- SerialNumber string `json:"serial_number"`
- // The type of hash used for the certificate.
- Signature string `json:"signature"`
- // This is the time the certificate was uploaded.
- UploadedOn time.Time `json:"uploaded_on" format:"date-time"`
- JSON mtlsCertificateDeleteResponseJSON `json:"-"`
-}
-
-// mtlsCertificateDeleteResponseJSON contains the JSON metadata for the struct
-// [MTLSCertificateDeleteResponse]
-type mtlsCertificateDeleteResponseJSON struct {
- ID apijson.Field
- CA apijson.Field
- Certificates apijson.Field
- ExpiresOn apijson.Field
- Issuer apijson.Field
- Name apijson.Field
- SerialNumber apijson.Field
- Signature apijson.Field
- UploadedOn apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MTLSCertificateDeleteResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r mtlsCertificateDeleteResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type MTLSCertificateGetResponse struct {
- // Identifier
- ID string `json:"id"`
- // Indicates whether the certificate is a CA or leaf certificate.
- CA bool `json:"ca"`
- // The uploaded root CA certificate.
- Certificates string `json:"certificates"`
- // When the certificate expires.
- ExpiresOn time.Time `json:"expires_on" format:"date-time"`
- // The certificate authority that issued the certificate.
- Issuer string `json:"issuer"`
- // Optional unique name for the certificate. Only used for human readability.
- Name string `json:"name"`
- // The certificate serial number.
- SerialNumber string `json:"serial_number"`
- // The type of hash used for the certificate.
- Signature string `json:"signature"`
- // This is the time the certificate was uploaded.
- UploadedOn time.Time `json:"uploaded_on" format:"date-time"`
- JSON mtlsCertificateGetResponseJSON `json:"-"`
-}
-
-// mtlsCertificateGetResponseJSON contains the JSON metadata for the struct
-// [MTLSCertificateGetResponse]
-type mtlsCertificateGetResponseJSON struct {
- ID apijson.Field
- CA apijson.Field
- Certificates apijson.Field
- ExpiresOn apijson.Field
- Issuer apijson.Field
- Name apijson.Field
- SerialNumber apijson.Field
- Signature apijson.Field
- UploadedOn apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MTLSCertificateGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r mtlsCertificateGetResponseJSON) RawJSON() string {
+func (r tlsCertificatesAndHostnamesComponentsSchemasCertificateObjectJSON) RawJSON() string {
return r.raw
}
@@ -292,9 +201,9 @@ func (r MTLSCertificateNewParams) MarshalJSON() (data []byte, err error) {
}
type MTLSCertificateNewResponseEnvelope struct {
- Errors []MTLSCertificateNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []MTLSCertificateNewResponseEnvelopeMessages `json:"messages,required"`
- Result MTLSCertificateNewResponse `json:"result,required"`
+ Errors []MTLSCertificateNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []MTLSCertificateNewResponseEnvelopeMessages `json:"messages,required"`
+ Result TLSCertificatesAndHostnamesCertificateObjectPost `json:"result,required"`
// Whether the API call was successful
Success MTLSCertificateNewResponseEnvelopeSuccess `json:"success,required"`
JSON mtlsCertificateNewResponseEnvelopeJSON `json:"-"`
@@ -378,9 +287,9 @@ type MTLSCertificateListParams struct {
}
type MTLSCertificateListResponseEnvelope struct {
- Errors []MTLSCertificateListResponseEnvelopeErrors `json:"errors,required"`
- Messages []MTLSCertificateListResponseEnvelopeMessages `json:"messages,required"`
- Result []MTLSCertificateListResponse `json:"result,required,nullable"`
+ Errors []MTLSCertificateListResponseEnvelopeErrors `json:"errors,required"`
+ Messages []MTLSCertificateListResponseEnvelopeMessages `json:"messages,required"`
+ Result []TLSCertificatesAndHostnamesComponentsSchemasCertificateObject `json:"result,required,nullable"`
// Whether the API call was successful
Success MTLSCertificateListResponseEnvelopeSuccess `json:"success,required"`
ResultInfo MTLSCertificateListResponseEnvelopeResultInfo `json:"result_info"`
@@ -499,9 +408,9 @@ type MTLSCertificateDeleteParams struct {
}
type MTLSCertificateDeleteResponseEnvelope struct {
- Errors []MTLSCertificateDeleteResponseEnvelopeErrors `json:"errors,required"`
- Messages []MTLSCertificateDeleteResponseEnvelopeMessages `json:"messages,required"`
- Result MTLSCertificateDeleteResponse `json:"result,required"`
+ Errors []MTLSCertificateDeleteResponseEnvelopeErrors `json:"errors,required"`
+ Messages []MTLSCertificateDeleteResponseEnvelopeMessages `json:"messages,required"`
+ Result TLSCertificatesAndHostnamesComponentsSchemasCertificateObject `json:"result,required"`
// Whether the API call was successful
Success MTLSCertificateDeleteResponseEnvelopeSuccess `json:"success,required"`
JSON mtlsCertificateDeleteResponseEnvelopeJSON `json:"-"`
@@ -585,9 +494,9 @@ type MTLSCertificateGetParams struct {
}
type MTLSCertificateGetResponseEnvelope struct {
- Errors []MTLSCertificateGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []MTLSCertificateGetResponseEnvelopeMessages `json:"messages,required"`
- Result MTLSCertificateGetResponse `json:"result,required"`
+ Errors []MTLSCertificateGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []MTLSCertificateGetResponseEnvelopeMessages `json:"messages,required"`
+ Result TLSCertificatesAndHostnamesComponentsSchemasCertificateObject `json:"result,required"`
// Whether the API call was successful
Success MTLSCertificateGetResponseEnvelopeSuccess `json:"success,required"`
JSON mtlsCertificateGetResponseEnvelopeJSON `json:"-"`
diff --git a/mtlscertificate_test.go b/mtls_certificates/mtlscertificate_test.go
similarity index 94%
rename from mtlscertificate_test.go
rename to mtls_certificates/mtlscertificate_test.go
index 44479e3e4f7..4859ecd76fc 100644
--- a/mtlscertificate_test.go
+++ b/mtls_certificates/mtlscertificate_test.go
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package cloudflare_test
+package mtls_certificates_test
import (
"context"
@@ -10,6 +10,7 @@ import (
"github.com/cloudflare/cloudflare-go"
"github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/mtls_certificates"
"github.com/cloudflare/cloudflare-go/option"
)
@@ -27,7 +28,7 @@ func TestMTLSCertificateNewWithOptionalParams(t *testing.T) {
option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"),
option.WithAPIEmail("user@example.com"),
)
- _, err := client.MTLSCertificates.New(context.TODO(), cloudflare.MTLSCertificateNewParams{
+ _, err := client.MTLSCertificates.New(context.TODO(), mtls_certificates.MTLSCertificateNewParams{
AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
CA: cloudflare.F(true),
Certificates: cloudflare.F("-----BEGIN CERTIFICATE-----\nMIIDmDCCAoCgAwIBAgIUKTOAZNjcXVZRj4oQt0SHsl1c1vMwDQYJKoZIhvcNAQELBQAwUTELMAkGA1UEBhMCVVMxFjAUBgNVBAgMDVNhbiBGcmFuY2lzY28xEzARBgNVBAcMCkNhbGlmb3JuaWExFTATBgNVBAoMDEV4YW1wbGUgSW5jLjAgFw0yMjExMjIxNjU5NDdaGA8yMTIyMTAyOTE2NTk0N1owUTELMAkGA1UEBhMCVVMxFjAUBgNVBAgMDVNhbiBGcmFuY2lzY28xEzARBgNVBAcMCkNhbGlmb3JuaWExFTATBgNVBAoMDEV4YW1wbGUgSW5jLjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMRcORwgJFTdcG/2GKI+cFYiOBNDKjCZUXEOvXWY42BkH9wxiMT869CO+enA1w5pIrXow6kCM1sQspHHaVmJUlotEMJxyoLFfA/8Kt1EKFyobOjuZs2SwyVyJ2sStvQuUQEosULZCNGZEqoH5g6zhMPxaxm7ZLrrsDZ9maNGVqo7EWLWHrZ57Q/5MtTrbxQL+eXjUmJ9K3kS+3uEwMdqR6Z3BluU1ivanpPc1CN2GNhdO0/hSY4YkGEnuLsqJyDd3cIiB1MxuCBJ4ZaqOd2viV1WcP3oU3dxVPm4MWyfYIldMWB14FahScxLhWdRnM9YZ/i9IFcLypXsuz7DjrJPtPUCAwEAAaNmMGQwHQYDVR0OBBYEFP5JzLUawNF+c3AXsYTEWHh7z2czMB8GA1UdIwQYMBaAFP5JzLUawNF+c3AXsYTEWHh7z2czMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMBAf8ECDAGAQH/AgEBMA0GCSqGSIb3DQEBCwUAA4IBAQBc+Be7NDhpE09y7hLPZGRPl1cSKBw4RI0XIv6rlbSTFs5EebpTGjhx/whNxwEZhB9HZ7111Oa1YlT8xkI9DshB78mjAHCKBAJ76moK8tkG0aqdYpJ4ZcJTVBB7l98Rvgc7zfTii7WemTy72deBbSeiEtXavm4EF0mWjHhQ5Nxpnp00Bqn5g1x8CyTDypgmugnep+xG+iFzNmTdsz7WI9T/7kDMXqB7M/FPWBORyS98OJqNDswCLF8bIZYwUBEe+bRHFomoShMzaC3tvim7WCb16noDkSTMlfKO4pnvKhpcVdSgwcruATV7y+W+Lvmz2OT/Gui4JhqeoTewsxndhDDE\n-----END CERTIFICATE-----"),
@@ -57,7 +58,7 @@ func TestMTLSCertificateList(t *testing.T) {
option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"),
option.WithAPIEmail("user@example.com"),
)
- _, err := client.MTLSCertificates.List(context.TODO(), cloudflare.MTLSCertificateListParams{
+ _, err := client.MTLSCertificates.List(context.TODO(), mtls_certificates.MTLSCertificateListParams{
AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
})
if err != nil {
@@ -86,7 +87,7 @@ func TestMTLSCertificateDelete(t *testing.T) {
_, err := client.MTLSCertificates.Delete(
context.TODO(),
"023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.MTLSCertificateDeleteParams{
+ mtls_certificates.MTLSCertificateDeleteParams{
AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
},
)
@@ -116,7 +117,7 @@ func TestMTLSCertificateGet(t *testing.T) {
_, err := client.MTLSCertificates.Get(
context.TODO(),
"023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.MTLSCertificateGetParams{
+ mtls_certificates.MTLSCertificateGetParams{
AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
},
)
diff --git a/mtlscertificateassociation.go b/mtlscertificateassociation.go
deleted file mode 100644
index 1ea013980ae..00000000000
--- a/mtlscertificateassociation.go
+++ /dev/null
@@ -1,190 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// MTLSCertificateAssociationService contains methods and other services that help
-// with interacting with the cloudflare API. Note, unlike clients, this service
-// does not read variables from the environment automatically. You should not
-// instantiate this service directly, and instead use the
-// [NewMTLSCertificateAssociationService] method instead.
-type MTLSCertificateAssociationService struct {
- Options []option.RequestOption
-}
-
-// NewMTLSCertificateAssociationService generates a new service that applies the
-// given options to each request. These options are applied after the parent
-// client's options (if there is one), and before any request-specific options.
-func NewMTLSCertificateAssociationService(opts ...option.RequestOption) (r *MTLSCertificateAssociationService) {
- r = &MTLSCertificateAssociationService{}
- r.Options = opts
- return
-}
-
-// Lists all active associations between the certificate and Cloudflare services.
-func (r *MTLSCertificateAssociationService) Get(ctx context.Context, mtlsCertificateID string, query MTLSCertificateAssociationGetParams, opts ...option.RequestOption) (res *[]MTLSCertificateAssociationGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env MTLSCertificateAssociationGetResponseEnvelope
- path := fmt.Sprintf("accounts/%s/mtls_certificates/%s/associations", query.AccountID, mtlsCertificateID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type MTLSCertificateAssociationGetResponse struct {
- // The service using the certificate.
- Service string `json:"service"`
- // Certificate deployment status for the given service.
- Status string `json:"status"`
- JSON mtlsCertificateAssociationGetResponseJSON `json:"-"`
-}
-
-// mtlsCertificateAssociationGetResponseJSON contains the JSON metadata for the
-// struct [MTLSCertificateAssociationGetResponse]
-type mtlsCertificateAssociationGetResponseJSON struct {
- Service apijson.Field
- Status apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MTLSCertificateAssociationGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r mtlsCertificateAssociationGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type MTLSCertificateAssociationGetParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type MTLSCertificateAssociationGetResponseEnvelope struct {
- Errors []MTLSCertificateAssociationGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []MTLSCertificateAssociationGetResponseEnvelopeMessages `json:"messages,required"`
- Result []MTLSCertificateAssociationGetResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success MTLSCertificateAssociationGetResponseEnvelopeSuccess `json:"success,required"`
- ResultInfo MTLSCertificateAssociationGetResponseEnvelopeResultInfo `json:"result_info"`
- JSON mtlsCertificateAssociationGetResponseEnvelopeJSON `json:"-"`
-}
-
-// mtlsCertificateAssociationGetResponseEnvelopeJSON contains the JSON metadata for
-// the struct [MTLSCertificateAssociationGetResponseEnvelope]
-type mtlsCertificateAssociationGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- ResultInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MTLSCertificateAssociationGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r mtlsCertificateAssociationGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type MTLSCertificateAssociationGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON mtlsCertificateAssociationGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// mtlsCertificateAssociationGetResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct [MTLSCertificateAssociationGetResponseEnvelopeErrors]
-type mtlsCertificateAssociationGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MTLSCertificateAssociationGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r mtlsCertificateAssociationGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type MTLSCertificateAssociationGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON mtlsCertificateAssociationGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// mtlsCertificateAssociationGetResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct [MTLSCertificateAssociationGetResponseEnvelopeMessages]
-type mtlsCertificateAssociationGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MTLSCertificateAssociationGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r mtlsCertificateAssociationGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type MTLSCertificateAssociationGetResponseEnvelopeSuccess bool
-
-const (
- MTLSCertificateAssociationGetResponseEnvelopeSuccessTrue MTLSCertificateAssociationGetResponseEnvelopeSuccess = true
-)
-
-type MTLSCertificateAssociationGetResponseEnvelopeResultInfo struct {
- // Total number of results for the requested service
- Count float64 `json:"count"`
- // Current page within paginated list of results
- Page float64 `json:"page"`
- // Number of results per page of results
- PerPage float64 `json:"per_page"`
- // Total results available without any search parameters
- TotalCount float64 `json:"total_count"`
- JSON mtlsCertificateAssociationGetResponseEnvelopeResultInfoJSON `json:"-"`
-}
-
-// mtlsCertificateAssociationGetResponseEnvelopeResultInfoJSON contains the JSON
-// metadata for the struct
-// [MTLSCertificateAssociationGetResponseEnvelopeResultInfo]
-type mtlsCertificateAssociationGetResponseEnvelopeResultInfoJSON struct {
- Count apijson.Field
- Page apijson.Field
- PerPage apijson.Field
- TotalCount apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *MTLSCertificateAssociationGetResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r mtlsCertificateAssociationGetResponseEnvelopeResultInfoJSON) RawJSON() string {
- return r.raw
-}
diff --git a/mtlscertificateassociation_test.go b/mtlscertificateassociation_test.go
deleted file mode 100644
index 2c4a02397ec..00000000000
--- a/mtlscertificateassociation_test.go
+++ /dev/null
@@ -1,44 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestMTLSCertificateAssociationGet(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"),
- )
- _, err := client.MTLSCertificates.Associations.Get(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.MTLSCertificateAssociationGetParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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/origin_post_quantum_encryption/aliases.go b/origin_post_quantum_encryption/aliases.go
new file mode 100644
index 00000000000..9ac9424f166
--- /dev/null
+++ b/origin_post_quantum_encryption/aliases.go
@@ -0,0 +1,9 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package origin_post_quantum_encryption
+
+import (
+ "github.com/cloudflare/cloudflare-go/internal/apierror"
+)
+
+type Error = apierror.Error
diff --git a/originpostquantumencryption.go b/origin_post_quantum_encryption/originpostquantumencryption.go
similarity index 96%
rename from originpostquantumencryption.go
rename to origin_post_quantum_encryption/originpostquantumencryption.go
index fb93ce9a442..17114c8615d 100644
--- a/originpostquantumencryption.go
+++ b/origin_post_quantum_encryption/originpostquantumencryption.go
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package cloudflare
+package origin_post_quantum_encryption
import (
"context"
@@ -70,10 +70,11 @@ func (r *OriginPostQuantumEncryptionService) Get(ctx context.Context, query Orig
return
}
-// Union satisfied by [OriginPostQuantumEncryptionUpdateResponseUnknown] or
-// [shared.UnionString].
+// Union satisfied by
+// [origin_post_quantum_encryption.OriginPostQuantumEncryptionUpdateResponseUnknown]
+// or [shared.UnionString].
type OriginPostQuantumEncryptionUpdateResponse interface {
- ImplementsOriginPostQuantumEncryptionUpdateResponse()
+ ImplementsOriginPostQuantumEncryptionOriginPostQuantumEncryptionUpdateResponse()
}
func init() {
@@ -87,10 +88,11 @@ func init() {
)
}
-// Union satisfied by [OriginPostQuantumEncryptionGetResponseUnknown] or
-// [shared.UnionString].
+// Union satisfied by
+// [origin_post_quantum_encryption.OriginPostQuantumEncryptionGetResponseUnknown]
+// or [shared.UnionString].
type OriginPostQuantumEncryptionGetResponse interface {
- ImplementsOriginPostQuantumEncryptionGetResponse()
+ ImplementsOriginPostQuantumEncryptionOriginPostQuantumEncryptionGetResponse()
}
func init() {
diff --git a/originpostquantumencryption_test.go b/origin_post_quantum_encryption/originpostquantumencryption_test.go
similarity index 82%
rename from originpostquantumencryption_test.go
rename to origin_post_quantum_encryption/originpostquantumencryption_test.go
index ba419d923c1..aca43188bf5 100644
--- a/originpostquantumencryption_test.go
+++ b/origin_post_quantum_encryption/originpostquantumencryption_test.go
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package cloudflare_test
+package origin_post_quantum_encryption_test
import (
"context"
@@ -11,6 +11,7 @@ import (
"github.com/cloudflare/cloudflare-go"
"github.com/cloudflare/cloudflare-go/internal/testutil"
"github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/origin_post_quantum_encryption"
)
func TestOriginPostQuantumEncryptionUpdate(t *testing.T) {
@@ -27,9 +28,9 @@ func TestOriginPostQuantumEncryptionUpdate(t *testing.T) {
option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"),
option.WithAPIEmail("user@example.com"),
)
- _, err := client.OriginPostQuantumEncryption.Update(context.TODO(), cloudflare.OriginPostQuantumEncryptionUpdateParams{
+ _, err := client.OriginPostQuantumEncryption.Update(context.TODO(), origin_post_quantum_encryption.OriginPostQuantumEncryptionUpdateParams{
ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Value: cloudflare.F(cloudflare.OriginPostQuantumEncryptionUpdateParamsValuePreferred),
+ Value: cloudflare.F(origin_post_quantum_encryption.OriginPostQuantumEncryptionUpdateParamsValuePreferred),
})
if err != nil {
var apierr *cloudflare.Error
@@ -54,7 +55,7 @@ func TestOriginPostQuantumEncryptionGet(t *testing.T) {
option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"),
option.WithAPIEmail("user@example.com"),
)
- _, err := client.OriginPostQuantumEncryption.Get(context.TODO(), cloudflare.OriginPostQuantumEncryptionGetParams{
+ _, err := client.OriginPostQuantumEncryption.Get(context.TODO(), origin_post_quantum_encryption.OriginPostQuantumEncryptionGetParams{
ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
})
if err != nil {
diff --git a/origin_tls_client_auth/aliases.go b/origin_tls_client_auth/aliases.go
new file mode 100644
index 00000000000..f0c651bb018
--- /dev/null
+++ b/origin_tls_client_auth/aliases.go
@@ -0,0 +1,9 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package origin_tls_client_auth
+
+import (
+ "github.com/cloudflare/cloudflare-go/internal/apierror"
+)
+
+type Error = apierror.Error
diff --git a/origin_tls_client_auth/hostname.go b/origin_tls_client_auth/hostname.go
new file mode 100644
index 00000000000..43bec803d00
--- /dev/null
+++ b/origin_tls_client_auth/hostname.go
@@ -0,0 +1,378 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package origin_tls_client_auth
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// HostnameService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewHostnameService] method instead.
+type HostnameService struct {
+ Options []option.RequestOption
+ Certificates *HostnameCertificateService
+}
+
+// NewHostnameService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewHostnameService(opts ...option.RequestOption) (r *HostnameService) {
+ r = &HostnameService{}
+ r.Options = opts
+ r.Certificates = NewHostnameCertificateService(opts...)
+ return
+}
+
+// Associate a hostname to a certificate and enable, disable or invalidate the
+// association. If disabled, client certificate will not be sent to the hostname
+// even if activated at the zone level. 100 maximum associations on a single
+// certificate are allowed. Note: Use a null value for parameter _enabled_ to
+// invalidate the association.
+func (r *HostnameService) Update(ctx context.Context, params HostnameUpdateParams, opts ...option.RequestOption) (res *[]TLSCertificatesAndHostnamesHostnameCertidObject, err error) {
+ opts = append(r.Options[:], opts...)
+ var env HostnameUpdateResponseEnvelope
+ path := fmt.Sprintf("zones/%s/origin_tls_client_auth/hostnames", params.ZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Get the Hostname Status for Client Authentication
+func (r *HostnameService) Get(ctx context.Context, hostname string, query HostnameGetParams, opts ...option.RequestOption) (res *TLSCertificatesAndHostnamesHostnameCertidObject, err error) {
+ opts = append(r.Options[:], opts...)
+ var env HostnameGetResponseEnvelope
+ path := fmt.Sprintf("zones/%s/origin_tls_client_auth/hostnames/%s", query.ZoneID, hostname)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type TLSCertificatesAndHostnamesHostnameCertidObject struct {
+ // Identifier
+ CertID string `json:"cert_id"`
+ // Status of the certificate or the association.
+ CertStatus TLSCertificatesAndHostnamesHostnameCertidObjectCertStatus `json:"cert_status"`
+ // The time when the certificate was updated.
+ CertUpdatedAt time.Time `json:"cert_updated_at" format:"date-time"`
+ // The time when the certificate was uploaded.
+ CertUploadedOn time.Time `json:"cert_uploaded_on" format:"date-time"`
+ // The hostname certificate.
+ Certificate string `json:"certificate"`
+ // The time when the certificate was created.
+ CreatedAt time.Time `json:"created_at" format:"date-time"`
+ // Indicates whether hostname-level authenticated origin pulls is enabled. A null
+ // value voids the association.
+ Enabled bool `json:"enabled,nullable"`
+ // The date when the certificate expires.
+ ExpiresOn time.Time `json:"expires_on" format:"date-time"`
+ // The hostname on the origin for which the client certificate uploaded will be
+ // used.
+ Hostname string `json:"hostname"`
+ // The certificate authority that issued the certificate.
+ Issuer string `json:"issuer"`
+ // The serial number on the uploaded certificate.
+ SerialNumber string `json:"serial_number"`
+ // The type of hash used for the certificate.
+ Signature string `json:"signature"`
+ // Status of the certificate or the association.
+ Status TLSCertificatesAndHostnamesHostnameCertidObjectStatus `json:"status"`
+ // The time when the certificate was updated.
+ UpdatedAt time.Time `json:"updated_at" format:"date-time"`
+ JSON tlsCertificatesAndHostnamesHostnameCertidObjectJSON `json:"-"`
+}
+
+// tlsCertificatesAndHostnamesHostnameCertidObjectJSON contains the JSON metadata
+// for the struct [TLSCertificatesAndHostnamesHostnameCertidObject]
+type tlsCertificatesAndHostnamesHostnameCertidObjectJSON struct {
+ CertID apijson.Field
+ CertStatus apijson.Field
+ CertUpdatedAt apijson.Field
+ CertUploadedOn apijson.Field
+ Certificate apijson.Field
+ CreatedAt apijson.Field
+ Enabled apijson.Field
+ ExpiresOn apijson.Field
+ Hostname apijson.Field
+ Issuer apijson.Field
+ SerialNumber apijson.Field
+ Signature apijson.Field
+ Status apijson.Field
+ UpdatedAt apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *TLSCertificatesAndHostnamesHostnameCertidObject) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r tlsCertificatesAndHostnamesHostnameCertidObjectJSON) RawJSON() string {
+ return r.raw
+}
+
+// Status of the certificate or the association.
+type TLSCertificatesAndHostnamesHostnameCertidObjectCertStatus string
+
+const (
+ TLSCertificatesAndHostnamesHostnameCertidObjectCertStatusInitializing TLSCertificatesAndHostnamesHostnameCertidObjectCertStatus = "initializing"
+ TLSCertificatesAndHostnamesHostnameCertidObjectCertStatusPendingDeployment TLSCertificatesAndHostnamesHostnameCertidObjectCertStatus = "pending_deployment"
+ TLSCertificatesAndHostnamesHostnameCertidObjectCertStatusPendingDeletion TLSCertificatesAndHostnamesHostnameCertidObjectCertStatus = "pending_deletion"
+ TLSCertificatesAndHostnamesHostnameCertidObjectCertStatusActive TLSCertificatesAndHostnamesHostnameCertidObjectCertStatus = "active"
+ TLSCertificatesAndHostnamesHostnameCertidObjectCertStatusDeleted TLSCertificatesAndHostnamesHostnameCertidObjectCertStatus = "deleted"
+ TLSCertificatesAndHostnamesHostnameCertidObjectCertStatusDeploymentTimedOut TLSCertificatesAndHostnamesHostnameCertidObjectCertStatus = "deployment_timed_out"
+ TLSCertificatesAndHostnamesHostnameCertidObjectCertStatusDeletionTimedOut TLSCertificatesAndHostnamesHostnameCertidObjectCertStatus = "deletion_timed_out"
+)
+
+// Status of the certificate or the association.
+type TLSCertificatesAndHostnamesHostnameCertidObjectStatus string
+
+const (
+ TLSCertificatesAndHostnamesHostnameCertidObjectStatusInitializing TLSCertificatesAndHostnamesHostnameCertidObjectStatus = "initializing"
+ TLSCertificatesAndHostnamesHostnameCertidObjectStatusPendingDeployment TLSCertificatesAndHostnamesHostnameCertidObjectStatus = "pending_deployment"
+ TLSCertificatesAndHostnamesHostnameCertidObjectStatusPendingDeletion TLSCertificatesAndHostnamesHostnameCertidObjectStatus = "pending_deletion"
+ TLSCertificatesAndHostnamesHostnameCertidObjectStatusActive TLSCertificatesAndHostnamesHostnameCertidObjectStatus = "active"
+ TLSCertificatesAndHostnamesHostnameCertidObjectStatusDeleted TLSCertificatesAndHostnamesHostnameCertidObjectStatus = "deleted"
+ TLSCertificatesAndHostnamesHostnameCertidObjectStatusDeploymentTimedOut TLSCertificatesAndHostnamesHostnameCertidObjectStatus = "deployment_timed_out"
+ TLSCertificatesAndHostnamesHostnameCertidObjectStatusDeletionTimedOut TLSCertificatesAndHostnamesHostnameCertidObjectStatus = "deletion_timed_out"
+)
+
+type HostnameUpdateParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+ Config param.Field[[]HostnameUpdateParamsConfig] `json:"config,required"`
+}
+
+func (r HostnameUpdateParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type HostnameUpdateParamsConfig struct {
+ // Certificate identifier tag.
+ CertID param.Field[string] `json:"cert_id"`
+ // Indicates whether hostname-level authenticated origin pulls is enabled. A null
+ // value voids the association.
+ Enabled param.Field[bool] `json:"enabled"`
+ // The hostname on the origin for which the client certificate uploaded will be
+ // used.
+ Hostname param.Field[string] `json:"hostname"`
+}
+
+func (r HostnameUpdateParamsConfig) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type HostnameUpdateResponseEnvelope struct {
+ Errors []HostnameUpdateResponseEnvelopeErrors `json:"errors,required"`
+ Messages []HostnameUpdateResponseEnvelopeMessages `json:"messages,required"`
+ Result []TLSCertificatesAndHostnamesHostnameCertidObject `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success HostnameUpdateResponseEnvelopeSuccess `json:"success,required"`
+ ResultInfo HostnameUpdateResponseEnvelopeResultInfo `json:"result_info"`
+ JSON hostnameUpdateResponseEnvelopeJSON `json:"-"`
+}
+
+// hostnameUpdateResponseEnvelopeJSON contains the JSON metadata for the struct
+// [HostnameUpdateResponseEnvelope]
+type hostnameUpdateResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ ResultInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HostnameUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r hostnameUpdateResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type HostnameUpdateResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON hostnameUpdateResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// hostnameUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [HostnameUpdateResponseEnvelopeErrors]
+type hostnameUpdateResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HostnameUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r hostnameUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type HostnameUpdateResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON hostnameUpdateResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// hostnameUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [HostnameUpdateResponseEnvelopeMessages]
+type hostnameUpdateResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HostnameUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r hostnameUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type HostnameUpdateResponseEnvelopeSuccess bool
+
+const (
+ HostnameUpdateResponseEnvelopeSuccessTrue HostnameUpdateResponseEnvelopeSuccess = true
+)
+
+type HostnameUpdateResponseEnvelopeResultInfo struct {
+ // Total number of results for the requested service
+ Count float64 `json:"count"`
+ // Current page within paginated list of results
+ Page float64 `json:"page"`
+ // Number of results per page of results
+ PerPage float64 `json:"per_page"`
+ // Total results available without any search parameters
+ TotalCount float64 `json:"total_count"`
+ JSON hostnameUpdateResponseEnvelopeResultInfoJSON `json:"-"`
+}
+
+// hostnameUpdateResponseEnvelopeResultInfoJSON contains the JSON metadata for the
+// struct [HostnameUpdateResponseEnvelopeResultInfo]
+type hostnameUpdateResponseEnvelopeResultInfoJSON struct {
+ Count apijson.Field
+ Page apijson.Field
+ PerPage apijson.Field
+ TotalCount apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HostnameUpdateResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r hostnameUpdateResponseEnvelopeResultInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type HostnameGetParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+}
+
+type HostnameGetResponseEnvelope struct {
+ Errors []HostnameGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []HostnameGetResponseEnvelopeMessages `json:"messages,required"`
+ Result TLSCertificatesAndHostnamesHostnameCertidObject `json:"result,required"`
+ // Whether the API call was successful
+ Success HostnameGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON hostnameGetResponseEnvelopeJSON `json:"-"`
+}
+
+// hostnameGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [HostnameGetResponseEnvelope]
+type hostnameGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HostnameGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r hostnameGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type HostnameGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON hostnameGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// hostnameGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [HostnameGetResponseEnvelopeErrors]
+type hostnameGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HostnameGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r hostnameGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type HostnameGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON hostnameGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// hostnameGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [HostnameGetResponseEnvelopeMessages]
+type hostnameGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HostnameGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r hostnameGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type HostnameGetResponseEnvelopeSuccess bool
+
+const (
+ HostnameGetResponseEnvelopeSuccessTrue HostnameGetResponseEnvelopeSuccess = true
+)
diff --git a/origin_tls_client_auth/hostname_test.go b/origin_tls_client_auth/hostname_test.go
new file mode 100644
index 00000000000..3d7c3db5258
--- /dev/null
+++ b/origin_tls_client_auth/hostname_test.go
@@ -0,0 +1,84 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package origin_tls_client_auth_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/origin_tls_client_auth"
+)
+
+func TestHostnameUpdate(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"),
+ )
+ _, err := client.OriginTLSClientAuth.Hostnames.Update(context.TODO(), origin_tls_client_auth.HostnameUpdateParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Config: cloudflare.F([]origin_tls_client_auth.HostnameUpdateParamsConfig{{
+ CertID: cloudflare.F("2458ce5a-0c35-4c7f-82c7-8e9487d3ff60"),
+ Enabled: cloudflare.F(true),
+ Hostname: cloudflare.F("app.example.com"),
+ }, {
+ CertID: cloudflare.F("2458ce5a-0c35-4c7f-82c7-8e9487d3ff60"),
+ Enabled: cloudflare.F(true),
+ Hostname: cloudflare.F("app.example.com"),
+ }, {
+ CertID: cloudflare.F("2458ce5a-0c35-4c7f-82c7-8e9487d3ff60"),
+ Enabled: cloudflare.F(true),
+ Hostname: cloudflare.F("app.example.com"),
+ }}),
+ })
+ 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())
+ }
+}
+
+func TestHostnameGet(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"),
+ )
+ _, err := client.OriginTLSClientAuth.Hostnames.Get(
+ context.TODO(),
+ "app.example.com",
+ origin_tls_client_auth.HostnameGetParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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/origin_tls_client_auth/hostnamecertificate.go b/origin_tls_client_auth/hostnamecertificate.go
new file mode 100644
index 00000000000..1d86b3787be
--- /dev/null
+++ b/origin_tls_client_auth/hostnamecertificate.go
@@ -0,0 +1,527 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package origin_tls_client_auth
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// HostnameCertificateService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewHostnameCertificateService]
+// method instead.
+type HostnameCertificateService struct {
+ Options []option.RequestOption
+}
+
+// NewHostnameCertificateService generates a new service that applies the given
+// options to each request. These options are applied after the parent client's
+// options (if there is one), and before any request-specific options.
+func NewHostnameCertificateService(opts ...option.RequestOption) (r *HostnameCertificateService) {
+ r = &HostnameCertificateService{}
+ r.Options = opts
+ return
+}
+
+// Upload a certificate to be used for client authentication on a hostname. 10
+// hostname certificates per zone are allowed.
+func (r *HostnameCertificateService) New(ctx context.Context, params HostnameCertificateNewParams, opts ...option.RequestOption) (res *TLSCertificatesAndHostnamesSchemasCertificateObject, err error) {
+ opts = append(r.Options[:], opts...)
+ var env HostnameCertificateNewResponseEnvelope
+ path := fmt.Sprintf("zones/%s/origin_tls_client_auth/hostnames/certificates", params.ZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// List Certificates
+func (r *HostnameCertificateService) List(ctx context.Context, query HostnameCertificateListParams, opts ...option.RequestOption) (res *[]TLSCertificatesAndHostnamesHostnameCertidObject, err error) {
+ opts = append(r.Options[:], opts...)
+ var env HostnameCertificateListResponseEnvelope
+ path := fmt.Sprintf("zones/%s/origin_tls_client_auth/hostnames/certificates", query.ZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Delete Hostname Client Certificate
+func (r *HostnameCertificateService) Delete(ctx context.Context, certificateID string, body HostnameCertificateDeleteParams, opts ...option.RequestOption) (res *TLSCertificatesAndHostnamesSchemasCertificateObject, err error) {
+ opts = append(r.Options[:], opts...)
+ var env HostnameCertificateDeleteResponseEnvelope
+ path := fmt.Sprintf("zones/%s/origin_tls_client_auth/hostnames/certificates/%s", body.ZoneID, certificateID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Get the certificate by ID to be used for client authentication on a hostname.
+func (r *HostnameCertificateService) Get(ctx context.Context, certificateID string, query HostnameCertificateGetParams, opts ...option.RequestOption) (res *TLSCertificatesAndHostnamesSchemasCertificateObject, err error) {
+ opts = append(r.Options[:], opts...)
+ var env HostnameCertificateGetResponseEnvelope
+ path := fmt.Sprintf("zones/%s/origin_tls_client_auth/hostnames/certificates/%s", query.ZoneID, certificateID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type TLSCertificatesAndHostnamesSchemasCertificateObject struct {
+ // Identifier
+ ID string `json:"id"`
+ // The hostname certificate.
+ Certificate string `json:"certificate"`
+ // The date when the certificate expires.
+ ExpiresOn time.Time `json:"expires_on" format:"date-time"`
+ // The certificate authority that issued the certificate.
+ Issuer string `json:"issuer"`
+ // The serial number on the uploaded certificate.
+ SerialNumber string `json:"serial_number"`
+ // The type of hash used for the certificate.
+ Signature string `json:"signature"`
+ // Status of the certificate or the association.
+ Status TLSCertificatesAndHostnamesSchemasCertificateObjectStatus `json:"status"`
+ // The time when the certificate was uploaded.
+ UploadedOn time.Time `json:"uploaded_on" format:"date-time"`
+ JSON tlsCertificatesAndHostnamesSchemasCertificateObjectJSON `json:"-"`
+}
+
+// tlsCertificatesAndHostnamesSchemasCertificateObjectJSON contains the JSON
+// metadata for the struct [TLSCertificatesAndHostnamesSchemasCertificateObject]
+type tlsCertificatesAndHostnamesSchemasCertificateObjectJSON struct {
+ ID apijson.Field
+ Certificate apijson.Field
+ ExpiresOn apijson.Field
+ Issuer apijson.Field
+ SerialNumber apijson.Field
+ Signature apijson.Field
+ Status apijson.Field
+ UploadedOn apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *TLSCertificatesAndHostnamesSchemasCertificateObject) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r tlsCertificatesAndHostnamesSchemasCertificateObjectJSON) RawJSON() string {
+ return r.raw
+}
+
+// Status of the certificate or the association.
+type TLSCertificatesAndHostnamesSchemasCertificateObjectStatus string
+
+const (
+ TLSCertificatesAndHostnamesSchemasCertificateObjectStatusInitializing TLSCertificatesAndHostnamesSchemasCertificateObjectStatus = "initializing"
+ TLSCertificatesAndHostnamesSchemasCertificateObjectStatusPendingDeployment TLSCertificatesAndHostnamesSchemasCertificateObjectStatus = "pending_deployment"
+ TLSCertificatesAndHostnamesSchemasCertificateObjectStatusPendingDeletion TLSCertificatesAndHostnamesSchemasCertificateObjectStatus = "pending_deletion"
+ TLSCertificatesAndHostnamesSchemasCertificateObjectStatusActive TLSCertificatesAndHostnamesSchemasCertificateObjectStatus = "active"
+ TLSCertificatesAndHostnamesSchemasCertificateObjectStatusDeleted TLSCertificatesAndHostnamesSchemasCertificateObjectStatus = "deleted"
+ TLSCertificatesAndHostnamesSchemasCertificateObjectStatusDeploymentTimedOut TLSCertificatesAndHostnamesSchemasCertificateObjectStatus = "deployment_timed_out"
+ TLSCertificatesAndHostnamesSchemasCertificateObjectStatusDeletionTimedOut TLSCertificatesAndHostnamesSchemasCertificateObjectStatus = "deletion_timed_out"
+)
+
+type HostnameCertificateNewParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+ // The hostname certificate.
+ Certificate param.Field[string] `json:"certificate,required"`
+ // The hostname certificate's private key.
+ PrivateKey param.Field[string] `json:"private_key,required"`
+}
+
+func (r HostnameCertificateNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type HostnameCertificateNewResponseEnvelope struct {
+ Errors []HostnameCertificateNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []HostnameCertificateNewResponseEnvelopeMessages `json:"messages,required"`
+ Result TLSCertificatesAndHostnamesSchemasCertificateObject `json:"result,required"`
+ // Whether the API call was successful
+ Success HostnameCertificateNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON hostnameCertificateNewResponseEnvelopeJSON `json:"-"`
+}
+
+// hostnameCertificateNewResponseEnvelopeJSON contains the JSON metadata for the
+// struct [HostnameCertificateNewResponseEnvelope]
+type hostnameCertificateNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HostnameCertificateNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r hostnameCertificateNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type HostnameCertificateNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON hostnameCertificateNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// hostnameCertificateNewResponseEnvelopeErrorsJSON contains the JSON metadata for
+// the struct [HostnameCertificateNewResponseEnvelopeErrors]
+type hostnameCertificateNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HostnameCertificateNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r hostnameCertificateNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type HostnameCertificateNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON hostnameCertificateNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// hostnameCertificateNewResponseEnvelopeMessagesJSON contains the JSON metadata
+// for the struct [HostnameCertificateNewResponseEnvelopeMessages]
+type hostnameCertificateNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HostnameCertificateNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r hostnameCertificateNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type HostnameCertificateNewResponseEnvelopeSuccess bool
+
+const (
+ HostnameCertificateNewResponseEnvelopeSuccessTrue HostnameCertificateNewResponseEnvelopeSuccess = true
+)
+
+type HostnameCertificateListParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+}
+
+type HostnameCertificateListResponseEnvelope struct {
+ Errors []HostnameCertificateListResponseEnvelopeErrors `json:"errors,required"`
+ Messages []HostnameCertificateListResponseEnvelopeMessages `json:"messages,required"`
+ Result []TLSCertificatesAndHostnamesHostnameCertidObject `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success HostnameCertificateListResponseEnvelopeSuccess `json:"success,required"`
+ ResultInfo HostnameCertificateListResponseEnvelopeResultInfo `json:"result_info"`
+ JSON hostnameCertificateListResponseEnvelopeJSON `json:"-"`
+}
+
+// hostnameCertificateListResponseEnvelopeJSON contains the JSON metadata for the
+// struct [HostnameCertificateListResponseEnvelope]
+type hostnameCertificateListResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ ResultInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HostnameCertificateListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r hostnameCertificateListResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type HostnameCertificateListResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON hostnameCertificateListResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// hostnameCertificateListResponseEnvelopeErrorsJSON contains the JSON metadata for
+// the struct [HostnameCertificateListResponseEnvelopeErrors]
+type hostnameCertificateListResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HostnameCertificateListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r hostnameCertificateListResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type HostnameCertificateListResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON hostnameCertificateListResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// hostnameCertificateListResponseEnvelopeMessagesJSON contains the JSON metadata
+// for the struct [HostnameCertificateListResponseEnvelopeMessages]
+type hostnameCertificateListResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HostnameCertificateListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r hostnameCertificateListResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type HostnameCertificateListResponseEnvelopeSuccess bool
+
+const (
+ HostnameCertificateListResponseEnvelopeSuccessTrue HostnameCertificateListResponseEnvelopeSuccess = true
+)
+
+type HostnameCertificateListResponseEnvelopeResultInfo struct {
+ // Total number of results for the requested service
+ Count float64 `json:"count"`
+ // Current page within paginated list of results
+ Page float64 `json:"page"`
+ // Number of results per page of results
+ PerPage float64 `json:"per_page"`
+ // Total results available without any search parameters
+ TotalCount float64 `json:"total_count"`
+ JSON hostnameCertificateListResponseEnvelopeResultInfoJSON `json:"-"`
+}
+
+// hostnameCertificateListResponseEnvelopeResultInfoJSON contains the JSON metadata
+// for the struct [HostnameCertificateListResponseEnvelopeResultInfo]
+type hostnameCertificateListResponseEnvelopeResultInfoJSON struct {
+ Count apijson.Field
+ Page apijson.Field
+ PerPage apijson.Field
+ TotalCount apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HostnameCertificateListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r hostnameCertificateListResponseEnvelopeResultInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type HostnameCertificateDeleteParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+}
+
+type HostnameCertificateDeleteResponseEnvelope struct {
+ Errors []HostnameCertificateDeleteResponseEnvelopeErrors `json:"errors,required"`
+ Messages []HostnameCertificateDeleteResponseEnvelopeMessages `json:"messages,required"`
+ Result TLSCertificatesAndHostnamesSchemasCertificateObject `json:"result,required"`
+ // Whether the API call was successful
+ Success HostnameCertificateDeleteResponseEnvelopeSuccess `json:"success,required"`
+ JSON hostnameCertificateDeleteResponseEnvelopeJSON `json:"-"`
+}
+
+// hostnameCertificateDeleteResponseEnvelopeJSON contains the JSON metadata for the
+// struct [HostnameCertificateDeleteResponseEnvelope]
+type hostnameCertificateDeleteResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HostnameCertificateDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r hostnameCertificateDeleteResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type HostnameCertificateDeleteResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON hostnameCertificateDeleteResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// hostnameCertificateDeleteResponseEnvelopeErrorsJSON contains the JSON metadata
+// for the struct [HostnameCertificateDeleteResponseEnvelopeErrors]
+type hostnameCertificateDeleteResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HostnameCertificateDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r hostnameCertificateDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type HostnameCertificateDeleteResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON hostnameCertificateDeleteResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// hostnameCertificateDeleteResponseEnvelopeMessagesJSON contains the JSON metadata
+// for the struct [HostnameCertificateDeleteResponseEnvelopeMessages]
+type hostnameCertificateDeleteResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HostnameCertificateDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r hostnameCertificateDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type HostnameCertificateDeleteResponseEnvelopeSuccess bool
+
+const (
+ HostnameCertificateDeleteResponseEnvelopeSuccessTrue HostnameCertificateDeleteResponseEnvelopeSuccess = true
+)
+
+type HostnameCertificateGetParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+}
+
+type HostnameCertificateGetResponseEnvelope struct {
+ Errors []HostnameCertificateGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []HostnameCertificateGetResponseEnvelopeMessages `json:"messages,required"`
+ Result TLSCertificatesAndHostnamesSchemasCertificateObject `json:"result,required"`
+ // Whether the API call was successful
+ Success HostnameCertificateGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON hostnameCertificateGetResponseEnvelopeJSON `json:"-"`
+}
+
+// hostnameCertificateGetResponseEnvelopeJSON contains the JSON metadata for the
+// struct [HostnameCertificateGetResponseEnvelope]
+type hostnameCertificateGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HostnameCertificateGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r hostnameCertificateGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type HostnameCertificateGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON hostnameCertificateGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// hostnameCertificateGetResponseEnvelopeErrorsJSON contains the JSON metadata for
+// the struct [HostnameCertificateGetResponseEnvelopeErrors]
+type hostnameCertificateGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HostnameCertificateGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r hostnameCertificateGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type HostnameCertificateGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON hostnameCertificateGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// hostnameCertificateGetResponseEnvelopeMessagesJSON contains the JSON metadata
+// for the struct [HostnameCertificateGetResponseEnvelopeMessages]
+type hostnameCertificateGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HostnameCertificateGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r hostnameCertificateGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type HostnameCertificateGetResponseEnvelopeSuccess bool
+
+const (
+ HostnameCertificateGetResponseEnvelopeSuccessTrue HostnameCertificateGetResponseEnvelopeSuccess = true
+)
diff --git a/origin_tls_client_auth/hostnamecertificate_test.go b/origin_tls_client_auth/hostnamecertificate_test.go
new file mode 100644
index 00000000000..bf541ffbb62
--- /dev/null
+++ b/origin_tls_client_auth/hostnamecertificate_test.go
@@ -0,0 +1,129 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package origin_tls_client_auth_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/origin_tls_client_auth"
+)
+
+func TestHostnameCertificateNew(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"),
+ )
+ _, err := client.OriginTLSClientAuth.Hostnames.Certificates.New(context.TODO(), origin_tls_client_auth.HostnameCertificateNewParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Certificate: cloudflare.F("-----BEGIN CERTIFICATE-----\nMIIDtTCCAp2gAwIBAgIJAMHAwfXZ5/PWMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV\nBAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX\naWRnaXRzIFB0eSBMdGQwHhcNMTYwODI0MTY0MzAxWhcNMTYxMTIyMTY0MzAxWjBF\nMQswCQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50\nZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB\nCgKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmGdtcGbg/1\nCGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKnabIRuGvB\nKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpidtnKX/a+5\n0GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+pyFxIXjbEI\ndZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pEewooaeO2\nizNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABo4GnMIGkMB0GA1UdDgQWBBT/LbE4\n9rWf288N6sJA5BRb6FJIGDB1BgNVHSMEbjBsgBT/LbE49rWf288N6sJA5BRb6FJI\nGKFJpEcwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNV\nBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAMHAwfXZ5/PWMAwGA1UdEwQF\nMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAHHFwl0tH0quUYZYO0dZYt4R7SJ0pCm2\n2satiyzHl4OnXcHDpekAo7/a09c6Lz6AU83cKy/+x3/djYHXWba7HpEu0dR3ugQP\nMlr4zrhd9xKZ0KZKiYmtJH+ak4OM4L3FbT0owUZPyjLSlhMtJVcoRp5CJsjAMBUG\nSvD8RX+T01wzox/Qb+lnnNnOlaWpqu8eoOenybxKp1a9ULzIVvN/LAcc+14vioFq\n2swRWtmocBAs8QR9n4uvbpiYvS8eYueDCWMM4fvFfBhaDZ3N9IbtySh3SpFdQDhw\nYbjM2rxXiyLGxB4Bol7QTv4zHif7Zt89FReT/NBy4rzaskDJY5L6xmY=\n-----END CERTIFICATE-----\n"),
+ PrivateKey: cloudflare.F("-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmG\ndtcGbg/1CGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKn\nabIRuGvBKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpid\ntnKX/a+50GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+py\nFxIXjbEIdZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pE\newooaeO2izNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABAoIBACbhTYXBZYKmYPCb\nHBR1IBlCQA2nLGf0qRuJNJZg5iEzXows/6tc8YymZkQE7nolapWsQ+upk2y5Xdp/\naxiuprIs9JzkYK8Ox0r+dlwCG1kSW+UAbX0bQ/qUqlsTvU6muVuMP8vZYHxJ3wmb\n+ufRBKztPTQ/rYWaYQcgC0RWI20HTFBMxlTAyNxYNWzX7RKFkGVVyB9RsAtmcc8g\n+j4OdosbfNoJPS0HeIfNpAznDfHKdxDk2Yc1tV6RHBrC1ynyLE9+TaflIAdo2MVv\nKLMLq51GqYKtgJFIlBRPQqKoyXdz3fGvXrTkf/WY9QNq0J1Vk5ERePZ54mN8iZB7\n9lwy/AkCgYEA6FXzosxswaJ2wQLeoYc7ceaweX/SwTvxHgXzRyJIIT0eJWgx13Wo\n/WA3Iziimsjf6qE+SI/8laxPp2A86VMaIt3Z3mJN/CqSVGw8LK2AQst+OwdPyDMu\niacE8lj/IFGC8mwNUAb9CzGU3JpU4PxxGFjS/eMtGeRXCWkK4NE+G08CgYEA1Kp9\nN2JrVlqUz+gAX+LPmE9OEMAS9WQSQsfCHGogIFDGGcNf7+uwBM7GAaSJIP01zcoe\nVAgWdzXCv3FLhsaZoJ6RyLOLay5phbu1iaTr4UNYm5WtYTzMzqh8l1+MFFDl9xDB\nvULuCIIrglM5MeS/qnSg1uMoH2oVPj9TVst/ir8CgYEAxrI7Ws9Zc4Bt70N1As+U\nlySjaEVZCMkqvHJ6TCuVZFfQoE0r0whdLdRLU2PsLFP+q7qaeZQqgBaNSKeVcDYR\n9B+nY/jOmQoPewPVsp/vQTCnE/R81spu0mp0YI6cIheT1Z9zAy322svcc43JaWB7\nmEbeqyLOP4Z4qSOcmghZBSECgYACvR9Xs0DGn+wCsW4vze/2ei77MD4OQvepPIFX\ndFZtlBy5ADcgE9z0cuVB6CiL8DbdK5kwY9pGNr8HUCI03iHkW6Zs+0L0YmihfEVe\nPG19PSzK9CaDdhD9KFZSbLyVFmWfxOt50H7YRTTiPMgjyFpfi5j2q348yVT0tEQS\nfhRqaQKBgAcWPokmJ7EbYQGeMbS7HC8eWO/RyamlnSffdCdSc7ue3zdVJxpAkQ8W\nqu80pEIF6raIQfAf8MXiiZ7auFOSnHQTXUbhCpvDLKi0Mwq3G8Pl07l+2s6dQG6T\nlv6XTQaMyf6n1yjzL+fzDrH3qXMxHMO/b13EePXpDMpY7HQpoLDi\n-----END RSA PRIVATE KEY-----\n"),
+ })
+ 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())
+ }
+}
+
+func TestHostnameCertificateList(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"),
+ )
+ _, err := client.OriginTLSClientAuth.Hostnames.Certificates.List(context.TODO(), origin_tls_client_auth.HostnameCertificateListParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ })
+ 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())
+ }
+}
+
+func TestHostnameCertificateDelete(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"),
+ )
+ _, err := client.OriginTLSClientAuth.Hostnames.Certificates.Delete(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ origin_tls_client_auth.HostnameCertificateDeleteParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestHostnameCertificateGet(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"),
+ )
+ _, err := client.OriginTLSClientAuth.Hostnames.Certificates.Get(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ origin_tls_client_auth.HostnameCertificateGetParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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/origintlsclientauth.go b/origin_tls_client_auth/origintlsclientauth.go
similarity index 96%
rename from origintlsclientauth.go
rename to origin_tls_client_auth/origintlsclientauth.go
index 13ffd200ac2..593e9f18697 100644
--- a/origintlsclientauth.go
+++ b/origin_tls_client_auth/origintlsclientauth.go
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package cloudflare
+package origin_tls_client_auth
import (
"context"
@@ -23,8 +23,8 @@ import (
// method instead.
type OriginTLSClientAuthService struct {
Options []option.RequestOption
- Hostnames *OriginTLSClientAuthHostnameService
- Settings *OriginTLSClientAuthSettingService
+ Hostnames *HostnameService
+ Settings *SettingService
}
// NewOriginTLSClientAuthService generates a new service that applies the given
@@ -33,8 +33,8 @@ type OriginTLSClientAuthService struct {
func NewOriginTLSClientAuthService(opts ...option.RequestOption) (r *OriginTLSClientAuthService) {
r = &OriginTLSClientAuthService{}
r.Options = opts
- r.Hostnames = NewOriginTLSClientAuthHostnameService(opts...)
- r.Settings = NewOriginTLSClientAuthSettingService(opts...)
+ r.Hostnames = NewHostnameService(opts...)
+ r.Settings = NewSettingService(opts...)
return
}
@@ -94,10 +94,11 @@ func (r *OriginTLSClientAuthService) Get(ctx context.Context, certificateID stri
return
}
-// Union satisfied by [OriginTLSClientAuthNewResponseUnknown] or
+// Union satisfied by
+// [origin_tls_client_auth.OriginTLSClientAuthNewResponseUnknown] or
// [shared.UnionString].
type OriginTLSClientAuthNewResponse interface {
- ImplementsOriginTLSClientAuthNewResponse()
+ ImplementsOriginTLSClientAuthOriginTLSClientAuthNewResponse()
}
func init() {
@@ -142,10 +143,11 @@ func (r originTLSClientAuthListResponseJSON) RawJSON() string {
return r.raw
}
-// Union satisfied by [OriginTLSClientAuthDeleteResponseUnknown] or
+// Union satisfied by
+// [origin_tls_client_auth.OriginTLSClientAuthDeleteResponseUnknown] or
// [shared.UnionString].
type OriginTLSClientAuthDeleteResponse interface {
- ImplementsOriginTLSClientAuthDeleteResponse()
+ ImplementsOriginTLSClientAuthOriginTLSClientAuthDeleteResponse()
}
func init() {
@@ -159,10 +161,11 @@ func init() {
)
}
-// Union satisfied by [OriginTLSClientAuthGetResponseUnknown] or
+// Union satisfied by
+// [origin_tls_client_auth.OriginTLSClientAuthGetResponseUnknown] or
// [shared.UnionString].
type OriginTLSClientAuthGetResponse interface {
- ImplementsOriginTLSClientAuthGetResponse()
+ ImplementsOriginTLSClientAuthOriginTLSClientAuthGetResponse()
}
func init() {
diff --git a/origintlsclientauth_test.go b/origin_tls_client_auth/origintlsclientauth_test.go
similarity index 93%
rename from origintlsclientauth_test.go
rename to origin_tls_client_auth/origintlsclientauth_test.go
index 64b3a948a31..7f866e219ed 100644
--- a/origintlsclientauth_test.go
+++ b/origin_tls_client_auth/origintlsclientauth_test.go
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package cloudflare_test
+package origin_tls_client_auth_test
import (
"context"
@@ -11,6 +11,7 @@ import (
"github.com/cloudflare/cloudflare-go"
"github.com/cloudflare/cloudflare-go/internal/testutil"
"github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/origin_tls_client_auth"
)
func TestOriginTLSClientAuthNew(t *testing.T) {
@@ -27,7 +28,7 @@ func TestOriginTLSClientAuthNew(t *testing.T) {
option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"),
option.WithAPIEmail("user@example.com"),
)
- _, err := client.OriginTLSClientAuth.New(context.TODO(), cloudflare.OriginTLSClientAuthNewParams{
+ _, err := client.OriginTLSClientAuth.New(context.TODO(), origin_tls_client_auth.OriginTLSClientAuthNewParams{
ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
Certificate: cloudflare.F("-----BEGIN CERTIFICATE-----\nMIIDtTCCAp2gAwIBAgIJAMHAwfXZ5/PWMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV\nBAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX\naWRnaXRzIFB0eSBMdGQwHhcNMTYwODI0MTY0MzAxWhcNMTYxMTIyMTY0MzAxWjBF\nMQswCQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50\nZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB\nCgKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmGdtcGbg/1\nCGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKnabIRuGvB\nKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpidtnKX/a+5\n0GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+pyFxIXjbEI\ndZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pEewooaeO2\nizNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABo4GnMIGkMB0GA1UdDgQWBBT/LbE4\n9rWf288N6sJA5BRb6FJIGDB1BgNVHSMEbjBsgBT/LbE49rWf288N6sJA5BRb6FJI\nGKFJpEcwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNV\nBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAMHAwfXZ5/PWMAwGA1UdEwQF\nMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAHHFwl0tH0quUYZYO0dZYt4R7SJ0pCm2\n2satiyzHl4OnXcHDpekAo7/a09c6Lz6AU83cKy/+x3/djYHXWba7HpEu0dR3ugQP\nMlr4zrhd9xKZ0KZKiYmtJH+ak4OM4L3FbT0owUZPyjLSlhMtJVcoRp5CJsjAMBUG\nSvD8RX+T01wzox/Qb+lnnNnOlaWpqu8eoOenybxKp1a9ULzIVvN/LAcc+14vioFq\n2swRWtmocBAs8QR9n4uvbpiYvS8eYueDCWMM4fvFfBhaDZ3N9IbtySh3SpFdQDhw\nYbjM2rxXiyLGxB4Bol7QTv4zHif7Zt89FReT/NBy4rzaskDJY5L6xmY=\n-----END CERTIFICATE-----\n"),
PrivateKey: cloudflare.F("-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmG\ndtcGbg/1CGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKn\nabIRuGvBKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpid\ntnKX/a+50GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+py\nFxIXjbEIdZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pE\newooaeO2izNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABAoIBACbhTYXBZYKmYPCb\nHBR1IBlCQA2nLGf0qRuJNJZg5iEzXows/6tc8YymZkQE7nolapWsQ+upk2y5Xdp/\naxiuprIs9JzkYK8Ox0r+dlwCG1kSW+UAbX0bQ/qUqlsTvU6muVuMP8vZYHxJ3wmb\n+ufRBKztPTQ/rYWaYQcgC0RWI20HTFBMxlTAyNxYNWzX7RKFkGVVyB9RsAtmcc8g\n+j4OdosbfNoJPS0HeIfNpAznDfHKdxDk2Yc1tV6RHBrC1ynyLE9+TaflIAdo2MVv\nKLMLq51GqYKtgJFIlBRPQqKoyXdz3fGvXrTkf/WY9QNq0J1Vk5ERePZ54mN8iZB7\n9lwy/AkCgYEA6FXzosxswaJ2wQLeoYc7ceaweX/SwTvxHgXzRyJIIT0eJWgx13Wo\n/WA3Iziimsjf6qE+SI/8laxPp2A86VMaIt3Z3mJN/CqSVGw8LK2AQst+OwdPyDMu\niacE8lj/IFGC8mwNUAb9CzGU3JpU4PxxGFjS/eMtGeRXCWkK4NE+G08CgYEA1Kp9\nN2JrVlqUz+gAX+LPmE9OEMAS9WQSQsfCHGogIFDGGcNf7+uwBM7GAaSJIP01zcoe\nVAgWdzXCv3FLhsaZoJ6RyLOLay5phbu1iaTr4UNYm5WtYTzMzqh8l1+MFFDl9xDB\nvULuCIIrglM5MeS/qnSg1uMoH2oVPj9TVst/ir8CgYEAxrI7Ws9Zc4Bt70N1As+U\nlySjaEVZCMkqvHJ6TCuVZFfQoE0r0whdLdRLU2PsLFP+q7qaeZQqgBaNSKeVcDYR\n9B+nY/jOmQoPewPVsp/vQTCnE/R81spu0mp0YI6cIheT1Z9zAy322svcc43JaWB7\nmEbeqyLOP4Z4qSOcmghZBSECgYACvR9Xs0DGn+wCsW4vze/2ei77MD4OQvepPIFX\ndFZtlBy5ADcgE9z0cuVB6CiL8DbdK5kwY9pGNr8HUCI03iHkW6Zs+0L0YmihfEVe\nPG19PSzK9CaDdhD9KFZSbLyVFmWfxOt50H7YRTTiPMgjyFpfi5j2q348yVT0tEQS\nfhRqaQKBgAcWPokmJ7EbYQGeMbS7HC8eWO/RyamlnSffdCdSc7ue3zdVJxpAkQ8W\nqu80pEIF6raIQfAf8MXiiZ7auFOSnHQTXUbhCpvDLKi0Mwq3G8Pl07l+2s6dQG6T\nlv6XTQaMyf6n1yjzL+fzDrH3qXMxHMO/b13EePXpDMpY7HQpoLDi\n-----END RSA PRIVATE KEY-----\n"),
@@ -55,7 +56,7 @@ func TestOriginTLSClientAuthList(t *testing.T) {
option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"),
option.WithAPIEmail("user@example.com"),
)
- _, err := client.OriginTLSClientAuth.List(context.TODO(), cloudflare.OriginTLSClientAuthListParams{
+ _, err := client.OriginTLSClientAuth.List(context.TODO(), origin_tls_client_auth.OriginTLSClientAuthListParams{
ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
})
if err != nil {
@@ -84,7 +85,7 @@ func TestOriginTLSClientAuthDelete(t *testing.T) {
_, err := client.OriginTLSClientAuth.Delete(
context.TODO(),
"023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.OriginTLSClientAuthDeleteParams{
+ origin_tls_client_auth.OriginTLSClientAuthDeleteParams{
ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
},
)
@@ -114,7 +115,7 @@ func TestOriginTLSClientAuthGet(t *testing.T) {
_, err := client.OriginTLSClientAuth.Get(
context.TODO(),
"023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.OriginTLSClientAuthGetParams{
+ origin_tls_client_auth.OriginTLSClientAuthGetParams{
ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
},
)
diff --git a/origin_tls_client_auth/setting.go b/origin_tls_client_auth/setting.go
new file mode 100644
index 00000000000..cc04ac7ce48
--- /dev/null
+++ b/origin_tls_client_auth/setting.go
@@ -0,0 +1,282 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package origin_tls_client_auth
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// SettingService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewSettingService] method instead.
+type SettingService struct {
+ Options []option.RequestOption
+}
+
+// NewSettingService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewSettingService(opts ...option.RequestOption) (r *SettingService) {
+ r = &SettingService{}
+ r.Options = opts
+ return
+}
+
+// Enable or disable zone-level authenticated origin pulls. 'enabled' should be set
+// true either before/after the certificate is uploaded to see the certificate in
+// use.
+func (r *SettingService) Update(ctx context.Context, params SettingUpdateParams, opts ...option.RequestOption) (res *SettingUpdateResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env SettingUpdateResponseEnvelope
+ path := fmt.Sprintf("zones/%s/origin_tls_client_auth/settings", params.ZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Get whether zone-level authenticated origin pulls is enabled or not. It is false
+// by default.
+func (r *SettingService) Get(ctx context.Context, query SettingGetParams, opts ...option.RequestOption) (res *SettingGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env SettingGetResponseEnvelope
+ path := fmt.Sprintf("zones/%s/origin_tls_client_auth/settings", query.ZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type SettingUpdateResponse struct {
+ // Indicates whether zone-level authenticated origin pulls is enabled.
+ Enabled bool `json:"enabled"`
+ JSON settingUpdateResponseJSON `json:"-"`
+}
+
+// settingUpdateResponseJSON contains the JSON metadata for the struct
+// [SettingUpdateResponse]
+type settingUpdateResponseJSON struct {
+ Enabled apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *SettingUpdateResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r settingUpdateResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type SettingGetResponse struct {
+ // Indicates whether zone-level authenticated origin pulls is enabled.
+ Enabled bool `json:"enabled"`
+ JSON settingGetResponseJSON `json:"-"`
+}
+
+// settingGetResponseJSON contains the JSON metadata for the struct
+// [SettingGetResponse]
+type settingGetResponseJSON struct {
+ Enabled apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *SettingGetResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r settingGetResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type SettingUpdateParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+ // Indicates whether zone-level authenticated origin pulls is enabled.
+ Enabled param.Field[bool] `json:"enabled,required"`
+}
+
+func (r SettingUpdateParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type SettingUpdateResponseEnvelope struct {
+ Errors []SettingUpdateResponseEnvelopeErrors `json:"errors,required"`
+ Messages []SettingUpdateResponseEnvelopeMessages `json:"messages,required"`
+ Result SettingUpdateResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success SettingUpdateResponseEnvelopeSuccess `json:"success,required"`
+ JSON settingUpdateResponseEnvelopeJSON `json:"-"`
+}
+
+// settingUpdateResponseEnvelopeJSON contains the JSON metadata for the struct
+// [SettingUpdateResponseEnvelope]
+type settingUpdateResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *SettingUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r settingUpdateResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type SettingUpdateResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON settingUpdateResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// settingUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [SettingUpdateResponseEnvelopeErrors]
+type settingUpdateResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *SettingUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r settingUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type SettingUpdateResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON settingUpdateResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// settingUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [SettingUpdateResponseEnvelopeMessages]
+type settingUpdateResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *SettingUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r settingUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type SettingUpdateResponseEnvelopeSuccess bool
+
+const (
+ SettingUpdateResponseEnvelopeSuccessTrue SettingUpdateResponseEnvelopeSuccess = true
+)
+
+type SettingGetParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+}
+
+type SettingGetResponseEnvelope struct {
+ Errors []SettingGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []SettingGetResponseEnvelopeMessages `json:"messages,required"`
+ Result SettingGetResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success SettingGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON settingGetResponseEnvelopeJSON `json:"-"`
+}
+
+// settingGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [SettingGetResponseEnvelope]
+type settingGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *SettingGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r settingGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type SettingGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON settingGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// settingGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [SettingGetResponseEnvelopeErrors]
+type settingGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *SettingGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r settingGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type SettingGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON settingGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// settingGetResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [SettingGetResponseEnvelopeMessages]
+type settingGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *SettingGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r settingGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type SettingGetResponseEnvelopeSuccess bool
+
+const (
+ SettingGetResponseEnvelopeSuccessTrue SettingGetResponseEnvelopeSuccess = true
+)
diff --git a/origin_tls_client_auth/setting_test.go b/origin_tls_client_auth/setting_test.go
new file mode 100644
index 00000000000..2ab7b0ba56a
--- /dev/null
+++ b/origin_tls_client_auth/setting_test.go
@@ -0,0 +1,68 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package origin_tls_client_auth_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/origin_tls_client_auth"
+)
+
+func TestSettingUpdate(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"),
+ )
+ _, err := client.OriginTLSClientAuth.Settings.Update(context.TODO(), origin_tls_client_auth.SettingUpdateParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Enabled: cloudflare.F(true),
+ })
+ 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())
+ }
+}
+
+func TestSettingGet(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"),
+ )
+ _, err := client.OriginTLSClientAuth.Settings.Get(context.TODO(), origin_tls_client_auth.SettingGetParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ })
+ 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/origintlsclientauthhostname.go b/origintlsclientauthhostname.go
deleted file mode 100644
index c66c53d78b4..00000000000
--- a/origintlsclientauthhostname.go
+++ /dev/null
@@ -1,421 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// OriginTLSClientAuthHostnameService contains methods and other services that help
-// with interacting with the cloudflare API. Note, unlike clients, this service
-// does not read variables from the environment automatically. You should not
-// instantiate this service directly, and instead use the
-// [NewOriginTLSClientAuthHostnameService] method instead.
-type OriginTLSClientAuthHostnameService struct {
- Options []option.RequestOption
- Certificates *OriginTLSClientAuthHostnameCertificateService
-}
-
-// NewOriginTLSClientAuthHostnameService generates a new service that applies the
-// given options to each request. These options are applied after the parent
-// client's options (if there is one), and before any request-specific options.
-func NewOriginTLSClientAuthHostnameService(opts ...option.RequestOption) (r *OriginTLSClientAuthHostnameService) {
- r = &OriginTLSClientAuthHostnameService{}
- r.Options = opts
- r.Certificates = NewOriginTLSClientAuthHostnameCertificateService(opts...)
- return
-}
-
-// Associate a hostname to a certificate and enable, disable or invalidate the
-// association. If disabled, client certificate will not be sent to the hostname
-// even if activated at the zone level. 100 maximum associations on a single
-// certificate are allowed. Note: Use a null value for parameter _enabled_ to
-// invalidate the association.
-func (r *OriginTLSClientAuthHostnameService) Update(ctx context.Context, params OriginTLSClientAuthHostnameUpdateParams, opts ...option.RequestOption) (res *[]OriginTLSClientAuthHostnameUpdateResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env OriginTLSClientAuthHostnameUpdateResponseEnvelope
- path := fmt.Sprintf("zones/%s/origin_tls_client_auth/hostnames", params.ZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Get the Hostname Status for Client Authentication
-func (r *OriginTLSClientAuthHostnameService) Get(ctx context.Context, hostname string, query OriginTLSClientAuthHostnameGetParams, opts ...option.RequestOption) (res *OriginTLSClientAuthHostnameGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env OriginTLSClientAuthHostnameGetResponseEnvelope
- path := fmt.Sprintf("zones/%s/origin_tls_client_auth/hostnames/%s", query.ZoneID, hostname)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type OriginTLSClientAuthHostnameUpdateResponse struct {
- // Identifier
- ID string `json:"id"`
- // Identifier
- CertID string `json:"cert_id"`
- // The hostname certificate.
- Certificate string `json:"certificate"`
- // Indicates whether hostname-level authenticated origin pulls is enabled. A null
- // value voids the association.
- Enabled bool `json:"enabled,nullable"`
- // The hostname on the origin for which the client certificate uploaded will be
- // used.
- Hostname string `json:"hostname"`
- // The hostname certificate's private key.
- PrivateKey string `json:"private_key"`
- JSON originTLSClientAuthHostnameUpdateResponseJSON `json:"-"`
-}
-
-// originTLSClientAuthHostnameUpdateResponseJSON contains the JSON metadata for the
-// struct [OriginTLSClientAuthHostnameUpdateResponse]
-type originTLSClientAuthHostnameUpdateResponseJSON struct {
- ID apijson.Field
- CertID apijson.Field
- Certificate apijson.Field
- Enabled apijson.Field
- Hostname apijson.Field
- PrivateKey apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *OriginTLSClientAuthHostnameUpdateResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r originTLSClientAuthHostnameUpdateResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type OriginTLSClientAuthHostnameGetResponse struct {
- // Identifier
- CertID string `json:"cert_id"`
- // Status of the certificate or the association.
- CertStatus OriginTLSClientAuthHostnameGetResponseCertStatus `json:"cert_status"`
- // The time when the certificate was updated.
- CertUpdatedAt time.Time `json:"cert_updated_at" format:"date-time"`
- // The time when the certificate was uploaded.
- CertUploadedOn time.Time `json:"cert_uploaded_on" format:"date-time"`
- // The hostname certificate.
- Certificate string `json:"certificate"`
- // The time when the certificate was created.
- CreatedAt time.Time `json:"created_at" format:"date-time"`
- // Indicates whether hostname-level authenticated origin pulls is enabled. A null
- // value voids the association.
- Enabled bool `json:"enabled,nullable"`
- // The date when the certificate expires.
- ExpiresOn time.Time `json:"expires_on" format:"date-time"`
- // The hostname on the origin for which the client certificate uploaded will be
- // used.
- Hostname string `json:"hostname"`
- // The certificate authority that issued the certificate.
- Issuer string `json:"issuer"`
- // The serial number on the uploaded certificate.
- SerialNumber string `json:"serial_number"`
- // The type of hash used for the certificate.
- Signature string `json:"signature"`
- // Status of the certificate or the association.
- Status OriginTLSClientAuthHostnameGetResponseStatus `json:"status"`
- // The time when the certificate was updated.
- UpdatedAt time.Time `json:"updated_at" format:"date-time"`
- JSON originTLSClientAuthHostnameGetResponseJSON `json:"-"`
-}
-
-// originTLSClientAuthHostnameGetResponseJSON contains the JSON metadata for the
-// struct [OriginTLSClientAuthHostnameGetResponse]
-type originTLSClientAuthHostnameGetResponseJSON struct {
- CertID apijson.Field
- CertStatus apijson.Field
- CertUpdatedAt apijson.Field
- CertUploadedOn apijson.Field
- Certificate apijson.Field
- CreatedAt apijson.Field
- Enabled apijson.Field
- ExpiresOn apijson.Field
- Hostname apijson.Field
- Issuer apijson.Field
- SerialNumber apijson.Field
- Signature apijson.Field
- Status apijson.Field
- UpdatedAt apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *OriginTLSClientAuthHostnameGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r originTLSClientAuthHostnameGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// Status of the certificate or the association.
-type OriginTLSClientAuthHostnameGetResponseCertStatus string
-
-const (
- OriginTLSClientAuthHostnameGetResponseCertStatusInitializing OriginTLSClientAuthHostnameGetResponseCertStatus = "initializing"
- OriginTLSClientAuthHostnameGetResponseCertStatusPendingDeployment OriginTLSClientAuthHostnameGetResponseCertStatus = "pending_deployment"
- OriginTLSClientAuthHostnameGetResponseCertStatusPendingDeletion OriginTLSClientAuthHostnameGetResponseCertStatus = "pending_deletion"
- OriginTLSClientAuthHostnameGetResponseCertStatusActive OriginTLSClientAuthHostnameGetResponseCertStatus = "active"
- OriginTLSClientAuthHostnameGetResponseCertStatusDeleted OriginTLSClientAuthHostnameGetResponseCertStatus = "deleted"
- OriginTLSClientAuthHostnameGetResponseCertStatusDeploymentTimedOut OriginTLSClientAuthHostnameGetResponseCertStatus = "deployment_timed_out"
- OriginTLSClientAuthHostnameGetResponseCertStatusDeletionTimedOut OriginTLSClientAuthHostnameGetResponseCertStatus = "deletion_timed_out"
-)
-
-// Status of the certificate or the association.
-type OriginTLSClientAuthHostnameGetResponseStatus string
-
-const (
- OriginTLSClientAuthHostnameGetResponseStatusInitializing OriginTLSClientAuthHostnameGetResponseStatus = "initializing"
- OriginTLSClientAuthHostnameGetResponseStatusPendingDeployment OriginTLSClientAuthHostnameGetResponseStatus = "pending_deployment"
- OriginTLSClientAuthHostnameGetResponseStatusPendingDeletion OriginTLSClientAuthHostnameGetResponseStatus = "pending_deletion"
- OriginTLSClientAuthHostnameGetResponseStatusActive OriginTLSClientAuthHostnameGetResponseStatus = "active"
- OriginTLSClientAuthHostnameGetResponseStatusDeleted OriginTLSClientAuthHostnameGetResponseStatus = "deleted"
- OriginTLSClientAuthHostnameGetResponseStatusDeploymentTimedOut OriginTLSClientAuthHostnameGetResponseStatus = "deployment_timed_out"
- OriginTLSClientAuthHostnameGetResponseStatusDeletionTimedOut OriginTLSClientAuthHostnameGetResponseStatus = "deletion_timed_out"
-)
-
-type OriginTLSClientAuthHostnameUpdateParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
- Config param.Field[[]OriginTLSClientAuthHostnameUpdateParamsConfig] `json:"config,required"`
-}
-
-func (r OriginTLSClientAuthHostnameUpdateParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type OriginTLSClientAuthHostnameUpdateParamsConfig struct {
- // Certificate identifier tag.
- CertID param.Field[string] `json:"cert_id"`
- // Indicates whether hostname-level authenticated origin pulls is enabled. A null
- // value voids the association.
- Enabled param.Field[bool] `json:"enabled"`
- // The hostname on the origin for which the client certificate uploaded will be
- // used.
- Hostname param.Field[string] `json:"hostname"`
-}
-
-func (r OriginTLSClientAuthHostnameUpdateParamsConfig) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type OriginTLSClientAuthHostnameUpdateResponseEnvelope struct {
- Errors []OriginTLSClientAuthHostnameUpdateResponseEnvelopeErrors `json:"errors,required"`
- Messages []OriginTLSClientAuthHostnameUpdateResponseEnvelopeMessages `json:"messages,required"`
- Result []OriginTLSClientAuthHostnameUpdateResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success OriginTLSClientAuthHostnameUpdateResponseEnvelopeSuccess `json:"success,required"`
- ResultInfo OriginTLSClientAuthHostnameUpdateResponseEnvelopeResultInfo `json:"result_info"`
- JSON originTLSClientAuthHostnameUpdateResponseEnvelopeJSON `json:"-"`
-}
-
-// originTLSClientAuthHostnameUpdateResponseEnvelopeJSON contains the JSON metadata
-// for the struct [OriginTLSClientAuthHostnameUpdateResponseEnvelope]
-type originTLSClientAuthHostnameUpdateResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- ResultInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *OriginTLSClientAuthHostnameUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r originTLSClientAuthHostnameUpdateResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type OriginTLSClientAuthHostnameUpdateResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON originTLSClientAuthHostnameUpdateResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// originTLSClientAuthHostnameUpdateResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct
-// [OriginTLSClientAuthHostnameUpdateResponseEnvelopeErrors]
-type originTLSClientAuthHostnameUpdateResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *OriginTLSClientAuthHostnameUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r originTLSClientAuthHostnameUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type OriginTLSClientAuthHostnameUpdateResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON originTLSClientAuthHostnameUpdateResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// originTLSClientAuthHostnameUpdateResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct
-// [OriginTLSClientAuthHostnameUpdateResponseEnvelopeMessages]
-type originTLSClientAuthHostnameUpdateResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *OriginTLSClientAuthHostnameUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r originTLSClientAuthHostnameUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type OriginTLSClientAuthHostnameUpdateResponseEnvelopeSuccess bool
-
-const (
- OriginTLSClientAuthHostnameUpdateResponseEnvelopeSuccessTrue OriginTLSClientAuthHostnameUpdateResponseEnvelopeSuccess = true
-)
-
-type OriginTLSClientAuthHostnameUpdateResponseEnvelopeResultInfo struct {
- // Total number of results for the requested service
- Count float64 `json:"count"`
- // Current page within paginated list of results
- Page float64 `json:"page"`
- // Number of results per page of results
- PerPage float64 `json:"per_page"`
- // Total results available without any search parameters
- TotalCount float64 `json:"total_count"`
- JSON originTLSClientAuthHostnameUpdateResponseEnvelopeResultInfoJSON `json:"-"`
-}
-
-// originTLSClientAuthHostnameUpdateResponseEnvelopeResultInfoJSON contains the
-// JSON metadata for the struct
-// [OriginTLSClientAuthHostnameUpdateResponseEnvelopeResultInfo]
-type originTLSClientAuthHostnameUpdateResponseEnvelopeResultInfoJSON struct {
- Count apijson.Field
- Page apijson.Field
- PerPage apijson.Field
- TotalCount apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *OriginTLSClientAuthHostnameUpdateResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r originTLSClientAuthHostnameUpdateResponseEnvelopeResultInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type OriginTLSClientAuthHostnameGetParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
-}
-
-type OriginTLSClientAuthHostnameGetResponseEnvelope struct {
- Errors []OriginTLSClientAuthHostnameGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []OriginTLSClientAuthHostnameGetResponseEnvelopeMessages `json:"messages,required"`
- Result OriginTLSClientAuthHostnameGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success OriginTLSClientAuthHostnameGetResponseEnvelopeSuccess `json:"success,required"`
- JSON originTLSClientAuthHostnameGetResponseEnvelopeJSON `json:"-"`
-}
-
-// originTLSClientAuthHostnameGetResponseEnvelopeJSON contains the JSON metadata
-// for the struct [OriginTLSClientAuthHostnameGetResponseEnvelope]
-type originTLSClientAuthHostnameGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *OriginTLSClientAuthHostnameGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r originTLSClientAuthHostnameGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type OriginTLSClientAuthHostnameGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON originTLSClientAuthHostnameGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// originTLSClientAuthHostnameGetResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct [OriginTLSClientAuthHostnameGetResponseEnvelopeErrors]
-type originTLSClientAuthHostnameGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *OriginTLSClientAuthHostnameGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r originTLSClientAuthHostnameGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type OriginTLSClientAuthHostnameGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON originTLSClientAuthHostnameGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// originTLSClientAuthHostnameGetResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct [OriginTLSClientAuthHostnameGetResponseEnvelopeMessages]
-type originTLSClientAuthHostnameGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *OriginTLSClientAuthHostnameGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r originTLSClientAuthHostnameGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type OriginTLSClientAuthHostnameGetResponseEnvelopeSuccess bool
-
-const (
- OriginTLSClientAuthHostnameGetResponseEnvelopeSuccessTrue OriginTLSClientAuthHostnameGetResponseEnvelopeSuccess = true
-)
diff --git a/origintlsclientauthhostname_test.go b/origintlsclientauthhostname_test.go
deleted file mode 100644
index cf9001ae8b7..00000000000
--- a/origintlsclientauthhostname_test.go
+++ /dev/null
@@ -1,83 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestOriginTLSClientAuthHostnameUpdate(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"),
- )
- _, err := client.OriginTLSClientAuth.Hostnames.Update(context.TODO(), cloudflare.OriginTLSClientAuthHostnameUpdateParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Config: cloudflare.F([]cloudflare.OriginTLSClientAuthHostnameUpdateParamsConfig{{
- CertID: cloudflare.F("2458ce5a-0c35-4c7f-82c7-8e9487d3ff60"),
- Enabled: cloudflare.F(true),
- Hostname: cloudflare.F("app.example.com"),
- }, {
- CertID: cloudflare.F("2458ce5a-0c35-4c7f-82c7-8e9487d3ff60"),
- Enabled: cloudflare.F(true),
- Hostname: cloudflare.F("app.example.com"),
- }, {
- CertID: cloudflare.F("2458ce5a-0c35-4c7f-82c7-8e9487d3ff60"),
- Enabled: cloudflare.F(true),
- Hostname: cloudflare.F("app.example.com"),
- }}),
- })
- 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())
- }
-}
-
-func TestOriginTLSClientAuthHostnameGet(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"),
- )
- _, err := client.OriginTLSClientAuth.Hostnames.Get(
- context.TODO(),
- "app.example.com",
- cloudflare.OriginTLSClientAuthHostnameGetParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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/origintlsclientauthhostnamecertificate.go b/origintlsclientauthhostnamecertificate.go
deleted file mode 100644
index d5c3f434c5c..00000000000
--- a/origintlsclientauthhostnamecertificate.go
+++ /dev/null
@@ -1,692 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// OriginTLSClientAuthHostnameCertificateService contains methods and other
-// services that help with interacting with the cloudflare API. Note, unlike
-// clients, this service does not read variables from the environment
-// automatically. You should not instantiate this service directly, and instead use
-// the [NewOriginTLSClientAuthHostnameCertificateService] method instead.
-type OriginTLSClientAuthHostnameCertificateService struct {
- Options []option.RequestOption
-}
-
-// NewOriginTLSClientAuthHostnameCertificateService generates a new service that
-// applies the given options to each request. These options are applied after the
-// parent client's options (if there is one), and before any request-specific
-// options.
-func NewOriginTLSClientAuthHostnameCertificateService(opts ...option.RequestOption) (r *OriginTLSClientAuthHostnameCertificateService) {
- r = &OriginTLSClientAuthHostnameCertificateService{}
- r.Options = opts
- return
-}
-
-// Upload a certificate to be used for client authentication on a hostname. 10
-// hostname certificates per zone are allowed.
-func (r *OriginTLSClientAuthHostnameCertificateService) New(ctx context.Context, params OriginTLSClientAuthHostnameCertificateNewParams, opts ...option.RequestOption) (res *OriginTLSClientAuthHostnameCertificateNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env OriginTLSClientAuthHostnameCertificateNewResponseEnvelope
- path := fmt.Sprintf("zones/%s/origin_tls_client_auth/hostnames/certificates", params.ZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// List Certificates
-func (r *OriginTLSClientAuthHostnameCertificateService) List(ctx context.Context, query OriginTLSClientAuthHostnameCertificateListParams, opts ...option.RequestOption) (res *[]OriginTLSClientAuthHostnameCertificateListResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env OriginTLSClientAuthHostnameCertificateListResponseEnvelope
- path := fmt.Sprintf("zones/%s/origin_tls_client_auth/hostnames/certificates", query.ZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Delete Hostname Client Certificate
-func (r *OriginTLSClientAuthHostnameCertificateService) Delete(ctx context.Context, certificateID string, body OriginTLSClientAuthHostnameCertificateDeleteParams, opts ...option.RequestOption) (res *OriginTLSClientAuthHostnameCertificateDeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env OriginTLSClientAuthHostnameCertificateDeleteResponseEnvelope
- path := fmt.Sprintf("zones/%s/origin_tls_client_auth/hostnames/certificates/%s", body.ZoneID, certificateID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Get the certificate by ID to be used for client authentication on a hostname.
-func (r *OriginTLSClientAuthHostnameCertificateService) Get(ctx context.Context, certificateID string, query OriginTLSClientAuthHostnameCertificateGetParams, opts ...option.RequestOption) (res *OriginTLSClientAuthHostnameCertificateGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env OriginTLSClientAuthHostnameCertificateGetResponseEnvelope
- path := fmt.Sprintf("zones/%s/origin_tls_client_auth/hostnames/certificates/%s", query.ZoneID, certificateID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type OriginTLSClientAuthHostnameCertificateNewResponse struct {
- // Identifier
- ID string `json:"id"`
- // The hostname certificate.
- Certificate string `json:"certificate"`
- // The date when the certificate expires.
- ExpiresOn time.Time `json:"expires_on" format:"date-time"`
- // The certificate authority that issued the certificate.
- Issuer string `json:"issuer"`
- // The serial number on the uploaded certificate.
- SerialNumber string `json:"serial_number"`
- // The type of hash used for the certificate.
- Signature string `json:"signature"`
- // Status of the certificate or the association.
- Status OriginTLSClientAuthHostnameCertificateNewResponseStatus `json:"status"`
- // The time when the certificate was uploaded.
- UploadedOn time.Time `json:"uploaded_on" format:"date-time"`
- JSON originTLSClientAuthHostnameCertificateNewResponseJSON `json:"-"`
-}
-
-// originTLSClientAuthHostnameCertificateNewResponseJSON contains the JSON metadata
-// for the struct [OriginTLSClientAuthHostnameCertificateNewResponse]
-type originTLSClientAuthHostnameCertificateNewResponseJSON struct {
- ID apijson.Field
- Certificate apijson.Field
- ExpiresOn apijson.Field
- Issuer apijson.Field
- SerialNumber apijson.Field
- Signature apijson.Field
- Status apijson.Field
- UploadedOn apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *OriginTLSClientAuthHostnameCertificateNewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r originTLSClientAuthHostnameCertificateNewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// Status of the certificate or the association.
-type OriginTLSClientAuthHostnameCertificateNewResponseStatus string
-
-const (
- OriginTLSClientAuthHostnameCertificateNewResponseStatusInitializing OriginTLSClientAuthHostnameCertificateNewResponseStatus = "initializing"
- OriginTLSClientAuthHostnameCertificateNewResponseStatusPendingDeployment OriginTLSClientAuthHostnameCertificateNewResponseStatus = "pending_deployment"
- OriginTLSClientAuthHostnameCertificateNewResponseStatusPendingDeletion OriginTLSClientAuthHostnameCertificateNewResponseStatus = "pending_deletion"
- OriginTLSClientAuthHostnameCertificateNewResponseStatusActive OriginTLSClientAuthHostnameCertificateNewResponseStatus = "active"
- OriginTLSClientAuthHostnameCertificateNewResponseStatusDeleted OriginTLSClientAuthHostnameCertificateNewResponseStatus = "deleted"
- OriginTLSClientAuthHostnameCertificateNewResponseStatusDeploymentTimedOut OriginTLSClientAuthHostnameCertificateNewResponseStatus = "deployment_timed_out"
- OriginTLSClientAuthHostnameCertificateNewResponseStatusDeletionTimedOut OriginTLSClientAuthHostnameCertificateNewResponseStatus = "deletion_timed_out"
-)
-
-type OriginTLSClientAuthHostnameCertificateListResponse struct {
- // Identifier
- ID string `json:"id"`
- // Identifier
- CertID string `json:"cert_id"`
- // The hostname certificate.
- Certificate string `json:"certificate"`
- // Indicates whether hostname-level authenticated origin pulls is enabled. A null
- // value voids the association.
- Enabled bool `json:"enabled,nullable"`
- // The hostname on the origin for which the client certificate uploaded will be
- // used.
- Hostname string `json:"hostname"`
- // The hostname certificate's private key.
- PrivateKey string `json:"private_key"`
- JSON originTLSClientAuthHostnameCertificateListResponseJSON `json:"-"`
-}
-
-// originTLSClientAuthHostnameCertificateListResponseJSON contains the JSON
-// metadata for the struct [OriginTLSClientAuthHostnameCertificateListResponse]
-type originTLSClientAuthHostnameCertificateListResponseJSON struct {
- ID apijson.Field
- CertID apijson.Field
- Certificate apijson.Field
- Enabled apijson.Field
- Hostname apijson.Field
- PrivateKey apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *OriginTLSClientAuthHostnameCertificateListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r originTLSClientAuthHostnameCertificateListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type OriginTLSClientAuthHostnameCertificateDeleteResponse struct {
- // Identifier
- ID string `json:"id"`
- // The hostname certificate.
- Certificate string `json:"certificate"`
- // The date when the certificate expires.
- ExpiresOn time.Time `json:"expires_on" format:"date-time"`
- // The certificate authority that issued the certificate.
- Issuer string `json:"issuer"`
- // The serial number on the uploaded certificate.
- SerialNumber string `json:"serial_number"`
- // The type of hash used for the certificate.
- Signature string `json:"signature"`
- // Status of the certificate or the association.
- Status OriginTLSClientAuthHostnameCertificateDeleteResponseStatus `json:"status"`
- // The time when the certificate was uploaded.
- UploadedOn time.Time `json:"uploaded_on" format:"date-time"`
- JSON originTLSClientAuthHostnameCertificateDeleteResponseJSON `json:"-"`
-}
-
-// originTLSClientAuthHostnameCertificateDeleteResponseJSON contains the JSON
-// metadata for the struct [OriginTLSClientAuthHostnameCertificateDeleteResponse]
-type originTLSClientAuthHostnameCertificateDeleteResponseJSON struct {
- ID apijson.Field
- Certificate apijson.Field
- ExpiresOn apijson.Field
- Issuer apijson.Field
- SerialNumber apijson.Field
- Signature apijson.Field
- Status apijson.Field
- UploadedOn apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *OriginTLSClientAuthHostnameCertificateDeleteResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r originTLSClientAuthHostnameCertificateDeleteResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// Status of the certificate or the association.
-type OriginTLSClientAuthHostnameCertificateDeleteResponseStatus string
-
-const (
- OriginTLSClientAuthHostnameCertificateDeleteResponseStatusInitializing OriginTLSClientAuthHostnameCertificateDeleteResponseStatus = "initializing"
- OriginTLSClientAuthHostnameCertificateDeleteResponseStatusPendingDeployment OriginTLSClientAuthHostnameCertificateDeleteResponseStatus = "pending_deployment"
- OriginTLSClientAuthHostnameCertificateDeleteResponseStatusPendingDeletion OriginTLSClientAuthHostnameCertificateDeleteResponseStatus = "pending_deletion"
- OriginTLSClientAuthHostnameCertificateDeleteResponseStatusActive OriginTLSClientAuthHostnameCertificateDeleteResponseStatus = "active"
- OriginTLSClientAuthHostnameCertificateDeleteResponseStatusDeleted OriginTLSClientAuthHostnameCertificateDeleteResponseStatus = "deleted"
- OriginTLSClientAuthHostnameCertificateDeleteResponseStatusDeploymentTimedOut OriginTLSClientAuthHostnameCertificateDeleteResponseStatus = "deployment_timed_out"
- OriginTLSClientAuthHostnameCertificateDeleteResponseStatusDeletionTimedOut OriginTLSClientAuthHostnameCertificateDeleteResponseStatus = "deletion_timed_out"
-)
-
-type OriginTLSClientAuthHostnameCertificateGetResponse struct {
- // Identifier
- ID string `json:"id"`
- // The hostname certificate.
- Certificate string `json:"certificate"`
- // The date when the certificate expires.
- ExpiresOn time.Time `json:"expires_on" format:"date-time"`
- // The certificate authority that issued the certificate.
- Issuer string `json:"issuer"`
- // The serial number on the uploaded certificate.
- SerialNumber string `json:"serial_number"`
- // The type of hash used for the certificate.
- Signature string `json:"signature"`
- // Status of the certificate or the association.
- Status OriginTLSClientAuthHostnameCertificateGetResponseStatus `json:"status"`
- // The time when the certificate was uploaded.
- UploadedOn time.Time `json:"uploaded_on" format:"date-time"`
- JSON originTLSClientAuthHostnameCertificateGetResponseJSON `json:"-"`
-}
-
-// originTLSClientAuthHostnameCertificateGetResponseJSON contains the JSON metadata
-// for the struct [OriginTLSClientAuthHostnameCertificateGetResponse]
-type originTLSClientAuthHostnameCertificateGetResponseJSON struct {
- ID apijson.Field
- Certificate apijson.Field
- ExpiresOn apijson.Field
- Issuer apijson.Field
- SerialNumber apijson.Field
- Signature apijson.Field
- Status apijson.Field
- UploadedOn apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *OriginTLSClientAuthHostnameCertificateGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r originTLSClientAuthHostnameCertificateGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// Status of the certificate or the association.
-type OriginTLSClientAuthHostnameCertificateGetResponseStatus string
-
-const (
- OriginTLSClientAuthHostnameCertificateGetResponseStatusInitializing OriginTLSClientAuthHostnameCertificateGetResponseStatus = "initializing"
- OriginTLSClientAuthHostnameCertificateGetResponseStatusPendingDeployment OriginTLSClientAuthHostnameCertificateGetResponseStatus = "pending_deployment"
- OriginTLSClientAuthHostnameCertificateGetResponseStatusPendingDeletion OriginTLSClientAuthHostnameCertificateGetResponseStatus = "pending_deletion"
- OriginTLSClientAuthHostnameCertificateGetResponseStatusActive OriginTLSClientAuthHostnameCertificateGetResponseStatus = "active"
- OriginTLSClientAuthHostnameCertificateGetResponseStatusDeleted OriginTLSClientAuthHostnameCertificateGetResponseStatus = "deleted"
- OriginTLSClientAuthHostnameCertificateGetResponseStatusDeploymentTimedOut OriginTLSClientAuthHostnameCertificateGetResponseStatus = "deployment_timed_out"
- OriginTLSClientAuthHostnameCertificateGetResponseStatusDeletionTimedOut OriginTLSClientAuthHostnameCertificateGetResponseStatus = "deletion_timed_out"
-)
-
-type OriginTLSClientAuthHostnameCertificateNewParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
- // The hostname certificate.
- Certificate param.Field[string] `json:"certificate,required"`
- // The hostname certificate's private key.
- PrivateKey param.Field[string] `json:"private_key,required"`
-}
-
-func (r OriginTLSClientAuthHostnameCertificateNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type OriginTLSClientAuthHostnameCertificateNewResponseEnvelope struct {
- Errors []OriginTLSClientAuthHostnameCertificateNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []OriginTLSClientAuthHostnameCertificateNewResponseEnvelopeMessages `json:"messages,required"`
- Result OriginTLSClientAuthHostnameCertificateNewResponse `json:"result,required"`
- // Whether the API call was successful
- Success OriginTLSClientAuthHostnameCertificateNewResponseEnvelopeSuccess `json:"success,required"`
- JSON originTLSClientAuthHostnameCertificateNewResponseEnvelopeJSON `json:"-"`
-}
-
-// originTLSClientAuthHostnameCertificateNewResponseEnvelopeJSON contains the JSON
-// metadata for the struct
-// [OriginTLSClientAuthHostnameCertificateNewResponseEnvelope]
-type originTLSClientAuthHostnameCertificateNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *OriginTLSClientAuthHostnameCertificateNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r originTLSClientAuthHostnameCertificateNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type OriginTLSClientAuthHostnameCertificateNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON originTLSClientAuthHostnameCertificateNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// originTLSClientAuthHostnameCertificateNewResponseEnvelopeErrorsJSON contains the
-// JSON metadata for the struct
-// [OriginTLSClientAuthHostnameCertificateNewResponseEnvelopeErrors]
-type originTLSClientAuthHostnameCertificateNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *OriginTLSClientAuthHostnameCertificateNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r originTLSClientAuthHostnameCertificateNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type OriginTLSClientAuthHostnameCertificateNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON originTLSClientAuthHostnameCertificateNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// originTLSClientAuthHostnameCertificateNewResponseEnvelopeMessagesJSON contains
-// the JSON metadata for the struct
-// [OriginTLSClientAuthHostnameCertificateNewResponseEnvelopeMessages]
-type originTLSClientAuthHostnameCertificateNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *OriginTLSClientAuthHostnameCertificateNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r originTLSClientAuthHostnameCertificateNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type OriginTLSClientAuthHostnameCertificateNewResponseEnvelopeSuccess bool
-
-const (
- OriginTLSClientAuthHostnameCertificateNewResponseEnvelopeSuccessTrue OriginTLSClientAuthHostnameCertificateNewResponseEnvelopeSuccess = true
-)
-
-type OriginTLSClientAuthHostnameCertificateListParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
-}
-
-type OriginTLSClientAuthHostnameCertificateListResponseEnvelope struct {
- Errors []OriginTLSClientAuthHostnameCertificateListResponseEnvelopeErrors `json:"errors,required"`
- Messages []OriginTLSClientAuthHostnameCertificateListResponseEnvelopeMessages `json:"messages,required"`
- Result []OriginTLSClientAuthHostnameCertificateListResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success OriginTLSClientAuthHostnameCertificateListResponseEnvelopeSuccess `json:"success,required"`
- ResultInfo OriginTLSClientAuthHostnameCertificateListResponseEnvelopeResultInfo `json:"result_info"`
- JSON originTLSClientAuthHostnameCertificateListResponseEnvelopeJSON `json:"-"`
-}
-
-// originTLSClientAuthHostnameCertificateListResponseEnvelopeJSON contains the JSON
-// metadata for the struct
-// [OriginTLSClientAuthHostnameCertificateListResponseEnvelope]
-type originTLSClientAuthHostnameCertificateListResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- ResultInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *OriginTLSClientAuthHostnameCertificateListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r originTLSClientAuthHostnameCertificateListResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type OriginTLSClientAuthHostnameCertificateListResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON originTLSClientAuthHostnameCertificateListResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// originTLSClientAuthHostnameCertificateListResponseEnvelopeErrorsJSON contains
-// the JSON metadata for the struct
-// [OriginTLSClientAuthHostnameCertificateListResponseEnvelopeErrors]
-type originTLSClientAuthHostnameCertificateListResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *OriginTLSClientAuthHostnameCertificateListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r originTLSClientAuthHostnameCertificateListResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type OriginTLSClientAuthHostnameCertificateListResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON originTLSClientAuthHostnameCertificateListResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// originTLSClientAuthHostnameCertificateListResponseEnvelopeMessagesJSON contains
-// the JSON metadata for the struct
-// [OriginTLSClientAuthHostnameCertificateListResponseEnvelopeMessages]
-type originTLSClientAuthHostnameCertificateListResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *OriginTLSClientAuthHostnameCertificateListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r originTLSClientAuthHostnameCertificateListResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type OriginTLSClientAuthHostnameCertificateListResponseEnvelopeSuccess bool
-
-const (
- OriginTLSClientAuthHostnameCertificateListResponseEnvelopeSuccessTrue OriginTLSClientAuthHostnameCertificateListResponseEnvelopeSuccess = true
-)
-
-type OriginTLSClientAuthHostnameCertificateListResponseEnvelopeResultInfo struct {
- // Total number of results for the requested service
- Count float64 `json:"count"`
- // Current page within paginated list of results
- Page float64 `json:"page"`
- // Number of results per page of results
- PerPage float64 `json:"per_page"`
- // Total results available without any search parameters
- TotalCount float64 `json:"total_count"`
- JSON originTLSClientAuthHostnameCertificateListResponseEnvelopeResultInfoJSON `json:"-"`
-}
-
-// originTLSClientAuthHostnameCertificateListResponseEnvelopeResultInfoJSON
-// contains the JSON metadata for the struct
-// [OriginTLSClientAuthHostnameCertificateListResponseEnvelopeResultInfo]
-type originTLSClientAuthHostnameCertificateListResponseEnvelopeResultInfoJSON struct {
- Count apijson.Field
- Page apijson.Field
- PerPage apijson.Field
- TotalCount apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *OriginTLSClientAuthHostnameCertificateListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r originTLSClientAuthHostnameCertificateListResponseEnvelopeResultInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type OriginTLSClientAuthHostnameCertificateDeleteParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
-}
-
-type OriginTLSClientAuthHostnameCertificateDeleteResponseEnvelope struct {
- Errors []OriginTLSClientAuthHostnameCertificateDeleteResponseEnvelopeErrors `json:"errors,required"`
- Messages []OriginTLSClientAuthHostnameCertificateDeleteResponseEnvelopeMessages `json:"messages,required"`
- Result OriginTLSClientAuthHostnameCertificateDeleteResponse `json:"result,required"`
- // Whether the API call was successful
- Success OriginTLSClientAuthHostnameCertificateDeleteResponseEnvelopeSuccess `json:"success,required"`
- JSON originTLSClientAuthHostnameCertificateDeleteResponseEnvelopeJSON `json:"-"`
-}
-
-// originTLSClientAuthHostnameCertificateDeleteResponseEnvelopeJSON contains the
-// JSON metadata for the struct
-// [OriginTLSClientAuthHostnameCertificateDeleteResponseEnvelope]
-type originTLSClientAuthHostnameCertificateDeleteResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *OriginTLSClientAuthHostnameCertificateDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r originTLSClientAuthHostnameCertificateDeleteResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type OriginTLSClientAuthHostnameCertificateDeleteResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON originTLSClientAuthHostnameCertificateDeleteResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// originTLSClientAuthHostnameCertificateDeleteResponseEnvelopeErrorsJSON contains
-// the JSON metadata for the struct
-// [OriginTLSClientAuthHostnameCertificateDeleteResponseEnvelopeErrors]
-type originTLSClientAuthHostnameCertificateDeleteResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *OriginTLSClientAuthHostnameCertificateDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r originTLSClientAuthHostnameCertificateDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type OriginTLSClientAuthHostnameCertificateDeleteResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON originTLSClientAuthHostnameCertificateDeleteResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// originTLSClientAuthHostnameCertificateDeleteResponseEnvelopeMessagesJSON
-// contains the JSON metadata for the struct
-// [OriginTLSClientAuthHostnameCertificateDeleteResponseEnvelopeMessages]
-type originTLSClientAuthHostnameCertificateDeleteResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *OriginTLSClientAuthHostnameCertificateDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r originTLSClientAuthHostnameCertificateDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type OriginTLSClientAuthHostnameCertificateDeleteResponseEnvelopeSuccess bool
-
-const (
- OriginTLSClientAuthHostnameCertificateDeleteResponseEnvelopeSuccessTrue OriginTLSClientAuthHostnameCertificateDeleteResponseEnvelopeSuccess = true
-)
-
-type OriginTLSClientAuthHostnameCertificateGetParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
-}
-
-type OriginTLSClientAuthHostnameCertificateGetResponseEnvelope struct {
- Errors []OriginTLSClientAuthHostnameCertificateGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []OriginTLSClientAuthHostnameCertificateGetResponseEnvelopeMessages `json:"messages,required"`
- Result OriginTLSClientAuthHostnameCertificateGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success OriginTLSClientAuthHostnameCertificateGetResponseEnvelopeSuccess `json:"success,required"`
- JSON originTLSClientAuthHostnameCertificateGetResponseEnvelopeJSON `json:"-"`
-}
-
-// originTLSClientAuthHostnameCertificateGetResponseEnvelopeJSON contains the JSON
-// metadata for the struct
-// [OriginTLSClientAuthHostnameCertificateGetResponseEnvelope]
-type originTLSClientAuthHostnameCertificateGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *OriginTLSClientAuthHostnameCertificateGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r originTLSClientAuthHostnameCertificateGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type OriginTLSClientAuthHostnameCertificateGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON originTLSClientAuthHostnameCertificateGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// originTLSClientAuthHostnameCertificateGetResponseEnvelopeErrorsJSON contains the
-// JSON metadata for the struct
-// [OriginTLSClientAuthHostnameCertificateGetResponseEnvelopeErrors]
-type originTLSClientAuthHostnameCertificateGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *OriginTLSClientAuthHostnameCertificateGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r originTLSClientAuthHostnameCertificateGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type OriginTLSClientAuthHostnameCertificateGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON originTLSClientAuthHostnameCertificateGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// originTLSClientAuthHostnameCertificateGetResponseEnvelopeMessagesJSON contains
-// the JSON metadata for the struct
-// [OriginTLSClientAuthHostnameCertificateGetResponseEnvelopeMessages]
-type originTLSClientAuthHostnameCertificateGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *OriginTLSClientAuthHostnameCertificateGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r originTLSClientAuthHostnameCertificateGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type OriginTLSClientAuthHostnameCertificateGetResponseEnvelopeSuccess bool
-
-const (
- OriginTLSClientAuthHostnameCertificateGetResponseEnvelopeSuccessTrue OriginTLSClientAuthHostnameCertificateGetResponseEnvelopeSuccess = true
-)
diff --git a/origintlsclientauthhostnamecertificate_test.go b/origintlsclientauthhostnamecertificate_test.go
deleted file mode 100644
index 26c600c7a13..00000000000
--- a/origintlsclientauthhostnamecertificate_test.go
+++ /dev/null
@@ -1,128 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestOriginTLSClientAuthHostnameCertificateNew(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"),
- )
- _, err := client.OriginTLSClientAuth.Hostnames.Certificates.New(context.TODO(), cloudflare.OriginTLSClientAuthHostnameCertificateNewParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Certificate: cloudflare.F("-----BEGIN CERTIFICATE-----\nMIIDtTCCAp2gAwIBAgIJAMHAwfXZ5/PWMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV\nBAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX\naWRnaXRzIFB0eSBMdGQwHhcNMTYwODI0MTY0MzAxWhcNMTYxMTIyMTY0MzAxWjBF\nMQswCQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50\nZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB\nCgKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmGdtcGbg/1\nCGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKnabIRuGvB\nKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpidtnKX/a+5\n0GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+pyFxIXjbEI\ndZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pEewooaeO2\nizNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABo4GnMIGkMB0GA1UdDgQWBBT/LbE4\n9rWf288N6sJA5BRb6FJIGDB1BgNVHSMEbjBsgBT/LbE49rWf288N6sJA5BRb6FJI\nGKFJpEcwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNV\nBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAMHAwfXZ5/PWMAwGA1UdEwQF\nMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAHHFwl0tH0quUYZYO0dZYt4R7SJ0pCm2\n2satiyzHl4OnXcHDpekAo7/a09c6Lz6AU83cKy/+x3/djYHXWba7HpEu0dR3ugQP\nMlr4zrhd9xKZ0KZKiYmtJH+ak4OM4L3FbT0owUZPyjLSlhMtJVcoRp5CJsjAMBUG\nSvD8RX+T01wzox/Qb+lnnNnOlaWpqu8eoOenybxKp1a9ULzIVvN/LAcc+14vioFq\n2swRWtmocBAs8QR9n4uvbpiYvS8eYueDCWMM4fvFfBhaDZ3N9IbtySh3SpFdQDhw\nYbjM2rxXiyLGxB4Bol7QTv4zHif7Zt89FReT/NBy4rzaskDJY5L6xmY=\n-----END CERTIFICATE-----\n"),
- PrivateKey: cloudflare.F("-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmG\ndtcGbg/1CGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKn\nabIRuGvBKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpid\ntnKX/a+50GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+py\nFxIXjbEIdZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pE\newooaeO2izNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABAoIBACbhTYXBZYKmYPCb\nHBR1IBlCQA2nLGf0qRuJNJZg5iEzXows/6tc8YymZkQE7nolapWsQ+upk2y5Xdp/\naxiuprIs9JzkYK8Ox0r+dlwCG1kSW+UAbX0bQ/qUqlsTvU6muVuMP8vZYHxJ3wmb\n+ufRBKztPTQ/rYWaYQcgC0RWI20HTFBMxlTAyNxYNWzX7RKFkGVVyB9RsAtmcc8g\n+j4OdosbfNoJPS0HeIfNpAznDfHKdxDk2Yc1tV6RHBrC1ynyLE9+TaflIAdo2MVv\nKLMLq51GqYKtgJFIlBRPQqKoyXdz3fGvXrTkf/WY9QNq0J1Vk5ERePZ54mN8iZB7\n9lwy/AkCgYEA6FXzosxswaJ2wQLeoYc7ceaweX/SwTvxHgXzRyJIIT0eJWgx13Wo\n/WA3Iziimsjf6qE+SI/8laxPp2A86VMaIt3Z3mJN/CqSVGw8LK2AQst+OwdPyDMu\niacE8lj/IFGC8mwNUAb9CzGU3JpU4PxxGFjS/eMtGeRXCWkK4NE+G08CgYEA1Kp9\nN2JrVlqUz+gAX+LPmE9OEMAS9WQSQsfCHGogIFDGGcNf7+uwBM7GAaSJIP01zcoe\nVAgWdzXCv3FLhsaZoJ6RyLOLay5phbu1iaTr4UNYm5WtYTzMzqh8l1+MFFDl9xDB\nvULuCIIrglM5MeS/qnSg1uMoH2oVPj9TVst/ir8CgYEAxrI7Ws9Zc4Bt70N1As+U\nlySjaEVZCMkqvHJ6TCuVZFfQoE0r0whdLdRLU2PsLFP+q7qaeZQqgBaNSKeVcDYR\n9B+nY/jOmQoPewPVsp/vQTCnE/R81spu0mp0YI6cIheT1Z9zAy322svcc43JaWB7\nmEbeqyLOP4Z4qSOcmghZBSECgYACvR9Xs0DGn+wCsW4vze/2ei77MD4OQvepPIFX\ndFZtlBy5ADcgE9z0cuVB6CiL8DbdK5kwY9pGNr8HUCI03iHkW6Zs+0L0YmihfEVe\nPG19PSzK9CaDdhD9KFZSbLyVFmWfxOt50H7YRTTiPMgjyFpfi5j2q348yVT0tEQS\nfhRqaQKBgAcWPokmJ7EbYQGeMbS7HC8eWO/RyamlnSffdCdSc7ue3zdVJxpAkQ8W\nqu80pEIF6raIQfAf8MXiiZ7auFOSnHQTXUbhCpvDLKi0Mwq3G8Pl07l+2s6dQG6T\nlv6XTQaMyf6n1yjzL+fzDrH3qXMxHMO/b13EePXpDMpY7HQpoLDi\n-----END RSA PRIVATE KEY-----\n"),
- })
- 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())
- }
-}
-
-func TestOriginTLSClientAuthHostnameCertificateList(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"),
- )
- _, err := client.OriginTLSClientAuth.Hostnames.Certificates.List(context.TODO(), cloudflare.OriginTLSClientAuthHostnameCertificateListParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- })
- 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())
- }
-}
-
-func TestOriginTLSClientAuthHostnameCertificateDelete(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"),
- )
- _, err := client.OriginTLSClientAuth.Hostnames.Certificates.Delete(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.OriginTLSClientAuthHostnameCertificateDeleteParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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())
- }
-}
-
-func TestOriginTLSClientAuthHostnameCertificateGet(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"),
- )
- _, err := client.OriginTLSClientAuth.Hostnames.Certificates.Get(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.OriginTLSClientAuthHostnameCertificateGetParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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/origintlsclientauthsetting.go b/origintlsclientauthsetting.go
deleted file mode 100644
index 2d8df850acb..00000000000
--- a/origintlsclientauthsetting.go
+++ /dev/null
@@ -1,284 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// OriginTLSClientAuthSettingService contains methods and other services that help
-// with interacting with the cloudflare API. Note, unlike clients, this service
-// does not read variables from the environment automatically. You should not
-// instantiate this service directly, and instead use the
-// [NewOriginTLSClientAuthSettingService] method instead.
-type OriginTLSClientAuthSettingService struct {
- Options []option.RequestOption
-}
-
-// NewOriginTLSClientAuthSettingService generates a new service that applies the
-// given options to each request. These options are applied after the parent
-// client's options (if there is one), and before any request-specific options.
-func NewOriginTLSClientAuthSettingService(opts ...option.RequestOption) (r *OriginTLSClientAuthSettingService) {
- r = &OriginTLSClientAuthSettingService{}
- r.Options = opts
- return
-}
-
-// Enable or disable zone-level authenticated origin pulls. 'enabled' should be set
-// true either before/after the certificate is uploaded to see the certificate in
-// use.
-func (r *OriginTLSClientAuthSettingService) Update(ctx context.Context, params OriginTLSClientAuthSettingUpdateParams, opts ...option.RequestOption) (res *OriginTLSClientAuthSettingUpdateResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env OriginTLSClientAuthSettingUpdateResponseEnvelope
- path := fmt.Sprintf("zones/%s/origin_tls_client_auth/settings", params.ZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Get whether zone-level authenticated origin pulls is enabled or not. It is false
-// by default.
-func (r *OriginTLSClientAuthSettingService) Get(ctx context.Context, query OriginTLSClientAuthSettingGetParams, opts ...option.RequestOption) (res *OriginTLSClientAuthSettingGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env OriginTLSClientAuthSettingGetResponseEnvelope
- path := fmt.Sprintf("zones/%s/origin_tls_client_auth/settings", query.ZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type OriginTLSClientAuthSettingUpdateResponse struct {
- // Indicates whether zone-level authenticated origin pulls is enabled.
- Enabled bool `json:"enabled"`
- JSON originTLSClientAuthSettingUpdateResponseJSON `json:"-"`
-}
-
-// originTLSClientAuthSettingUpdateResponseJSON contains the JSON metadata for the
-// struct [OriginTLSClientAuthSettingUpdateResponse]
-type originTLSClientAuthSettingUpdateResponseJSON struct {
- Enabled apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *OriginTLSClientAuthSettingUpdateResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r originTLSClientAuthSettingUpdateResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type OriginTLSClientAuthSettingGetResponse struct {
- // Indicates whether zone-level authenticated origin pulls is enabled.
- Enabled bool `json:"enabled"`
- JSON originTLSClientAuthSettingGetResponseJSON `json:"-"`
-}
-
-// originTLSClientAuthSettingGetResponseJSON contains the JSON metadata for the
-// struct [OriginTLSClientAuthSettingGetResponse]
-type originTLSClientAuthSettingGetResponseJSON struct {
- Enabled apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *OriginTLSClientAuthSettingGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r originTLSClientAuthSettingGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type OriginTLSClientAuthSettingUpdateParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
- // Indicates whether zone-level authenticated origin pulls is enabled.
- Enabled param.Field[bool] `json:"enabled,required"`
-}
-
-func (r OriginTLSClientAuthSettingUpdateParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type OriginTLSClientAuthSettingUpdateResponseEnvelope struct {
- Errors []OriginTLSClientAuthSettingUpdateResponseEnvelopeErrors `json:"errors,required"`
- Messages []OriginTLSClientAuthSettingUpdateResponseEnvelopeMessages `json:"messages,required"`
- Result OriginTLSClientAuthSettingUpdateResponse `json:"result,required"`
- // Whether the API call was successful
- Success OriginTLSClientAuthSettingUpdateResponseEnvelopeSuccess `json:"success,required"`
- JSON originTLSClientAuthSettingUpdateResponseEnvelopeJSON `json:"-"`
-}
-
-// originTLSClientAuthSettingUpdateResponseEnvelopeJSON contains the JSON metadata
-// for the struct [OriginTLSClientAuthSettingUpdateResponseEnvelope]
-type originTLSClientAuthSettingUpdateResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *OriginTLSClientAuthSettingUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r originTLSClientAuthSettingUpdateResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type OriginTLSClientAuthSettingUpdateResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON originTLSClientAuthSettingUpdateResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// originTLSClientAuthSettingUpdateResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct [OriginTLSClientAuthSettingUpdateResponseEnvelopeErrors]
-type originTLSClientAuthSettingUpdateResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *OriginTLSClientAuthSettingUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r originTLSClientAuthSettingUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type OriginTLSClientAuthSettingUpdateResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON originTLSClientAuthSettingUpdateResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// originTLSClientAuthSettingUpdateResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct
-// [OriginTLSClientAuthSettingUpdateResponseEnvelopeMessages]
-type originTLSClientAuthSettingUpdateResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *OriginTLSClientAuthSettingUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r originTLSClientAuthSettingUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type OriginTLSClientAuthSettingUpdateResponseEnvelopeSuccess bool
-
-const (
- OriginTLSClientAuthSettingUpdateResponseEnvelopeSuccessTrue OriginTLSClientAuthSettingUpdateResponseEnvelopeSuccess = true
-)
-
-type OriginTLSClientAuthSettingGetParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
-}
-
-type OriginTLSClientAuthSettingGetResponseEnvelope struct {
- Errors []OriginTLSClientAuthSettingGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []OriginTLSClientAuthSettingGetResponseEnvelopeMessages `json:"messages,required"`
- Result OriginTLSClientAuthSettingGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success OriginTLSClientAuthSettingGetResponseEnvelopeSuccess `json:"success,required"`
- JSON originTLSClientAuthSettingGetResponseEnvelopeJSON `json:"-"`
-}
-
-// originTLSClientAuthSettingGetResponseEnvelopeJSON contains the JSON metadata for
-// the struct [OriginTLSClientAuthSettingGetResponseEnvelope]
-type originTLSClientAuthSettingGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *OriginTLSClientAuthSettingGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r originTLSClientAuthSettingGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type OriginTLSClientAuthSettingGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON originTLSClientAuthSettingGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// originTLSClientAuthSettingGetResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct [OriginTLSClientAuthSettingGetResponseEnvelopeErrors]
-type originTLSClientAuthSettingGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *OriginTLSClientAuthSettingGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r originTLSClientAuthSettingGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type OriginTLSClientAuthSettingGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON originTLSClientAuthSettingGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// originTLSClientAuthSettingGetResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct [OriginTLSClientAuthSettingGetResponseEnvelopeMessages]
-type originTLSClientAuthSettingGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *OriginTLSClientAuthSettingGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r originTLSClientAuthSettingGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type OriginTLSClientAuthSettingGetResponseEnvelopeSuccess bool
-
-const (
- OriginTLSClientAuthSettingGetResponseEnvelopeSuccessTrue OriginTLSClientAuthSettingGetResponseEnvelopeSuccess = true
-)
diff --git a/origintlsclientauthsetting_test.go b/origintlsclientauthsetting_test.go
deleted file mode 100644
index be1d0dc4adf..00000000000
--- a/origintlsclientauthsetting_test.go
+++ /dev/null
@@ -1,67 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestOriginTLSClientAuthSettingUpdate(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"),
- )
- _, err := client.OriginTLSClientAuth.Settings.Update(context.TODO(), cloudflare.OriginTLSClientAuthSettingUpdateParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Enabled: cloudflare.F(true),
- })
- 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())
- }
-}
-
-func TestOriginTLSClientAuthSettingGet(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"),
- )
- _, err := client.OriginTLSClientAuth.Settings.Get(context.TODO(), cloudflare.OriginTLSClientAuthSettingGetParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- })
- 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/page.go b/page.go
deleted file mode 100644
index d3197aa79b2..00000000000
--- a/page.go
+++ /dev/null
@@ -1,26 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// PageService contains methods and other services that help with interacting with
-// the cloudflare API. Note, unlike clients, this service does not read variables
-// from the environment automatically. You should not instantiate this service
-// directly, and instead use the [NewPageService] method instead.
-type PageService struct {
- Options []option.RequestOption
- Projects *PageProjectService
-}
-
-// NewPageService generates a new service that applies the given options to each
-// request. These options are applied after the parent client's options (if there
-// is one), and before any request-specific options.
-func NewPageService(opts ...option.RequestOption) (r *PageService) {
- r = &PageService{}
- r.Options = opts
- r.Projects = NewPageProjectService(opts...)
- return
-}
diff --git a/page_shield/aliases.go b/page_shield/aliases.go
new file mode 100644
index 00000000000..53d99d7a368
--- /dev/null
+++ b/page_shield/aliases.go
@@ -0,0 +1,9 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package page_shield
+
+import (
+ "github.com/cloudflare/cloudflare-go/internal/apierror"
+)
+
+type Error = apierror.Error
diff --git a/page_shield/connection.go b/page_shield/connection.go
new file mode 100644
index 00000000000..f48a9377901
--- /dev/null
+++ b/page_shield/connection.go
@@ -0,0 +1,295 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package page_shield
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// ConnectionService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewConnectionService] method instead.
+type ConnectionService struct {
+ Options []option.RequestOption
+}
+
+// NewConnectionService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewConnectionService(opts ...option.RequestOption) (r *ConnectionService) {
+ r = &ConnectionService{}
+ r.Options = opts
+ return
+}
+
+// Lists all connections detected by Page Shield.
+func (r *ConnectionService) List(ctx context.Context, params ConnectionListParams, opts ...option.RequestOption) (res *[]PageShieldConnection, err error) {
+ opts = append(r.Options[:], opts...)
+ var env ConnectionListResponseEnvelope
+ path := fmt.Sprintf("zones/%s/page_shield/connections", params.ZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Fetches a connection detected by Page Shield by connection ID.
+func (r *ConnectionService) Get(ctx context.Context, connectionID string, query ConnectionGetParams, opts ...option.RequestOption) (res *PageShieldConnection, err error) {
+ opts = append(r.Options[:], opts...)
+ path := fmt.Sprintf("zones/%s/page_shield/connections/%s", query.ZoneID, connectionID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &res, opts...)
+ return
+}
+
+type PageShieldConnection struct {
+ ID interface{} `json:"id"`
+ AddedAt interface{} `json:"added_at"`
+ DomainReportedMalicious interface{} `json:"domain_reported_malicious"`
+ FirstPageURL interface{} `json:"first_page_url"`
+ FirstSeenAt interface{} `json:"first_seen_at"`
+ Host interface{} `json:"host"`
+ LastSeenAt interface{} `json:"last_seen_at"`
+ PageURLs interface{} `json:"page_urls"`
+ URL interface{} `json:"url"`
+ URLContainsCdnCgiPath interface{} `json:"url_contains_cdn_cgi_path"`
+ JSON pageShieldConnectionJSON `json:"-"`
+}
+
+// pageShieldConnectionJSON contains the JSON metadata for the struct
+// [PageShieldConnection]
+type pageShieldConnectionJSON struct {
+ ID apijson.Field
+ AddedAt apijson.Field
+ DomainReportedMalicious apijson.Field
+ FirstPageURL apijson.Field
+ FirstSeenAt apijson.Field
+ Host apijson.Field
+ LastSeenAt apijson.Field
+ PageURLs apijson.Field
+ URL apijson.Field
+ URLContainsCdnCgiPath apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PageShieldConnection) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r pageShieldConnectionJSON) RawJSON() string {
+ return r.raw
+}
+
+type ConnectionListParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+ // The direction used to sort returned connections.
+ Direction param.Field[ConnectionListParamsDirection] `query:"direction"`
+ // When true, excludes connections seen in a `/cdn-cgi` path from the returned
+ // connections. The default value is true.
+ ExcludeCdnCgi param.Field[bool] `query:"exclude_cdn_cgi"`
+ // Excludes connections whose URL contains one of the URL-encoded URLs separated by
+ // commas.
+ ExcludeURLs param.Field[string] `query:"exclude_urls"`
+ // Export the list of connections as a file. Cannot be used with per_page or page
+ // options.
+ Export param.Field[ConnectionListParamsExport] `query:"export"`
+ // Includes connections that match one or more URL-encoded hostnames separated by
+ // commas.
+ //
+ // Wildcards are supported at the start and end of each hostname to support starts
+ // with, ends with and contains. If no wildcards are used, results will be filtered
+ // by exact match
+ Hosts param.Field[string] `query:"hosts"`
+ // The field used to sort returned connections.
+ OrderBy param.Field[ConnectionListParamsOrderBy] `query:"order_by"`
+ // The current page number of the paginated results.
+ //
+ // We additionally support a special value "all". When "all" is used, the API will
+ // return all the connections with the applied filters in a single page.
+ // Additionally, when using this value, the API will not return the categorisation
+ // data for the URL and domain of the connections. This feature is best-effort and
+ // it may only work for zones with a low number of connections
+ Page param.Field[string] `query:"page"`
+ // Includes connections that match one or more page URLs (separated by commas)
+ // where they were last seen
+ //
+ // Wildcards are supported at the start and end of each page URL to support starts
+ // with, ends with and contains. If no wildcards are used, results will be filtered
+ // by exact match
+ PageURL param.Field[string] `query:"page_url"`
+ // The number of results per page.
+ PerPage param.Field[float64] `query:"per_page"`
+ // When true, malicious connections appear first in the returned connections.
+ PrioritizeMalicious param.Field[bool] `query:"prioritize_malicious"`
+ // Filters the returned connections using a comma-separated list of connection
+ // statuses. Accepted values: `active`, `infrequent`, and `inactive`. The default
+ // value is `active`.
+ Status param.Field[string] `query:"status"`
+ // Includes connections whose URL contain one or more URL-encoded URLs separated by
+ // commas.
+ URLs param.Field[string] `query:"urls"`
+}
+
+// URLQuery serializes [ConnectionListParams]'s query parameters as `url.Values`.
+func (r ConnectionListParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// The direction used to sort returned connections.
+type ConnectionListParamsDirection string
+
+const (
+ ConnectionListParamsDirectionAsc ConnectionListParamsDirection = "asc"
+ ConnectionListParamsDirectionDesc ConnectionListParamsDirection = "desc"
+)
+
+// Export the list of connections as a file. Cannot be used with per_page or page
+// options.
+type ConnectionListParamsExport string
+
+const (
+ ConnectionListParamsExportCsv ConnectionListParamsExport = "csv"
+)
+
+// The field used to sort returned connections.
+type ConnectionListParamsOrderBy string
+
+const (
+ ConnectionListParamsOrderByFirstSeenAt ConnectionListParamsOrderBy = "first_seen_at"
+ ConnectionListParamsOrderByLastSeenAt ConnectionListParamsOrderBy = "last_seen_at"
+)
+
+type ConnectionListResponseEnvelope struct {
+ Errors []ConnectionListResponseEnvelopeErrors `json:"errors,required"`
+ Messages []ConnectionListResponseEnvelopeMessages `json:"messages,required"`
+ Result []PageShieldConnection `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success ConnectionListResponseEnvelopeSuccess `json:"success,required"`
+ ResultInfo ConnectionListResponseEnvelopeResultInfo `json:"result_info"`
+ JSON connectionListResponseEnvelopeJSON `json:"-"`
+}
+
+// connectionListResponseEnvelopeJSON contains the JSON metadata for the struct
+// [ConnectionListResponseEnvelope]
+type connectionListResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ ResultInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ConnectionListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r connectionListResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type ConnectionListResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON connectionListResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// connectionListResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [ConnectionListResponseEnvelopeErrors]
+type connectionListResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ConnectionListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r connectionListResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type ConnectionListResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON connectionListResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// connectionListResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [ConnectionListResponseEnvelopeMessages]
+type connectionListResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ConnectionListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r connectionListResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type ConnectionListResponseEnvelopeSuccess bool
+
+const (
+ ConnectionListResponseEnvelopeSuccessTrue ConnectionListResponseEnvelopeSuccess = true
+)
+
+type ConnectionListResponseEnvelopeResultInfo struct {
+ // Total number of results for the requested service
+ Count float64 `json:"count"`
+ // Current page within paginated list of results
+ Page float64 `json:"page"`
+ // Number of results per page of results
+ PerPage float64 `json:"per_page"`
+ // Total results available without any search parameters
+ TotalCount float64 `json:"total_count"`
+ JSON connectionListResponseEnvelopeResultInfoJSON `json:"-"`
+}
+
+// connectionListResponseEnvelopeResultInfoJSON contains the JSON metadata for the
+// struct [ConnectionListResponseEnvelopeResultInfo]
+type connectionListResponseEnvelopeResultInfoJSON struct {
+ Count apijson.Field
+ Page apijson.Field
+ PerPage apijson.Field
+ TotalCount apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ConnectionListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r connectionListResponseEnvelopeResultInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type ConnectionGetParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+}
diff --git a/page_shield/connection_test.go b/page_shield/connection_test.go
new file mode 100644
index 00000000000..12898b9e741
--- /dev/null
+++ b/page_shield/connection_test.go
@@ -0,0 +1,83 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package page_shield_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/page_shield"
+)
+
+func TestConnectionListWithOptionalParams(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"),
+ )
+ _, err := client.PageShield.Connections.List(context.TODO(), page_shield.ConnectionListParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Direction: cloudflare.F(page_shield.ConnectionListParamsDirectionAsc),
+ ExcludeCdnCgi: cloudflare.F(true),
+ ExcludeURLs: cloudflare.F("blog.cloudflare.com,www.example"),
+ Export: cloudflare.F(page_shield.ConnectionListParamsExportCsv),
+ Hosts: cloudflare.F("blog.cloudflare.com,www.example*,*cloudflare.com"),
+ OrderBy: cloudflare.F(page_shield.ConnectionListParamsOrderByFirstSeenAt),
+ Page: cloudflare.F("string"),
+ PageURL: cloudflare.F("example.com/page,*/checkout,example.com/*,*checkout*"),
+ PerPage: cloudflare.F(100.000000),
+ PrioritizeMalicious: cloudflare.F(true),
+ Status: cloudflare.F("active,inactive"),
+ URLs: cloudflare.F("blog.cloudflare.com,www.example"),
+ })
+ 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())
+ }
+}
+
+func TestConnectionGet(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"),
+ )
+ _, err := client.PageShield.Connections.Get(
+ context.TODO(),
+ "c9ef84a6bf5e47138c75d95e2f933e8f",
+ page_shield.ConnectionGetParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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/pageshield.go b/page_shield/pageshield.go
similarity index 87%
rename from pageshield.go
rename to page_shield/pageshield.go
index d828e8a2a5e..6c8781750ff 100644
--- a/pageshield.go
+++ b/page_shield/pageshield.go
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package cloudflare
+package page_shield
import (
"context"
@@ -19,9 +19,9 @@ import (
// service directly, and instead use the [NewPageShieldService] method instead.
type PageShieldService struct {
Options []option.RequestOption
- Policies *PageShieldPolicyService
- Connections *PageShieldConnectionService
- Scripts *PageShieldScriptService
+ Policies *PolicyService
+ Connections *ConnectionService
+ Scripts *ScriptService
}
// NewPageShieldService generates a new service that applies the given options to
@@ -30,14 +30,14 @@ type PageShieldService struct {
func NewPageShieldService(opts ...option.RequestOption) (r *PageShieldService) {
r = &PageShieldService{}
r.Options = opts
- r.Policies = NewPageShieldPolicyService(opts...)
- r.Connections = NewPageShieldConnectionService(opts...)
- r.Scripts = NewPageShieldScriptService(opts...)
+ r.Policies = NewPolicyService(opts...)
+ r.Connections = NewConnectionService(opts...)
+ r.Scripts = NewScriptService(opts...)
return
}
// Updates Page Shield settings.
-func (r *PageShieldService) Update(ctx context.Context, params PageShieldUpdateParams, opts ...option.RequestOption) (res *PageShieldUpdateResponse, err error) {
+func (r *PageShieldService) Update(ctx context.Context, params PageShieldUpdateParams, opts ...option.RequestOption) (res *PageShieldUpdateZoneSettings, err error) {
opts = append(r.Options[:], opts...)
var env PageShieldUpdateResponseEnvelope
path := fmt.Sprintf("zones/%s/page_shield", params.ZoneID)
@@ -50,7 +50,7 @@ func (r *PageShieldService) Update(ctx context.Context, params PageShieldUpdateP
}
// Fetches the Page Shield settings.
-func (r *PageShieldService) List(ctx context.Context, query PageShieldListParams, opts ...option.RequestOption) (res *PageShieldListResponse, err error) {
+func (r *PageShieldService) List(ctx context.Context, query PageShieldListParams, opts ...option.RequestOption) (res *PageShieldGetZoneSettings, err error) {
opts = append(r.Options[:], opts...)
var env PageShieldListResponseEnvelope
path := fmt.Sprintf("zones/%s/page_shield", query.ZoneID)
@@ -62,7 +62,7 @@ func (r *PageShieldService) List(ctx context.Context, query PageShieldListParams
return
}
-type PageShieldUpdateResponse struct {
+type PageShieldGetZoneSettings struct {
// When true, indicates that Page Shield is enabled.
Enabled bool `json:"enabled"`
// The timestamp of when Page Shield was last updated.
@@ -71,13 +71,13 @@ type PageShieldUpdateResponse struct {
// https://csp-reporting.cloudflare.com/cdn-cgi/script_monitor/report
UseCloudflareReportingEndpoint bool `json:"use_cloudflare_reporting_endpoint"`
// When true, the paths associated with connections URLs will also be analyzed.
- UseConnectionURLPath bool `json:"use_connection_url_path"`
- JSON pageShieldUpdateResponseJSON `json:"-"`
+ UseConnectionURLPath bool `json:"use_connection_url_path"`
+ JSON pageShieldGetZoneSettingsJSON `json:"-"`
}
-// pageShieldUpdateResponseJSON contains the JSON metadata for the struct
-// [PageShieldUpdateResponse]
-type pageShieldUpdateResponseJSON struct {
+// pageShieldGetZoneSettingsJSON contains the JSON metadata for the struct
+// [PageShieldGetZoneSettings]
+type pageShieldGetZoneSettingsJSON struct {
Enabled apijson.Field
UpdatedAt apijson.Field
UseCloudflareReportingEndpoint apijson.Field
@@ -86,15 +86,15 @@ type pageShieldUpdateResponseJSON struct {
ExtraFields map[string]apijson.Field
}
-func (r *PageShieldUpdateResponse) UnmarshalJSON(data []byte) (err error) {
+func (r *PageShieldGetZoneSettings) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
-func (r pageShieldUpdateResponseJSON) RawJSON() string {
+func (r pageShieldGetZoneSettingsJSON) RawJSON() string {
return r.raw
}
-type PageShieldListResponse struct {
+type PageShieldUpdateZoneSettings struct {
// When true, indicates that Page Shield is enabled.
Enabled bool `json:"enabled"`
// The timestamp of when Page Shield was last updated.
@@ -103,13 +103,13 @@ type PageShieldListResponse struct {
// https://csp-reporting.cloudflare.com/cdn-cgi/script_monitor/report
UseCloudflareReportingEndpoint bool `json:"use_cloudflare_reporting_endpoint"`
// When true, the paths associated with connections URLs will also be analyzed.
- UseConnectionURLPath bool `json:"use_connection_url_path"`
- JSON pageShieldListResponseJSON `json:"-"`
+ UseConnectionURLPath bool `json:"use_connection_url_path"`
+ JSON pageShieldUpdateZoneSettingsJSON `json:"-"`
}
-// pageShieldListResponseJSON contains the JSON metadata for the struct
-// [PageShieldListResponse]
-type pageShieldListResponseJSON struct {
+// pageShieldUpdateZoneSettingsJSON contains the JSON metadata for the struct
+// [PageShieldUpdateZoneSettings]
+type pageShieldUpdateZoneSettingsJSON struct {
Enabled apijson.Field
UpdatedAt apijson.Field
UseCloudflareReportingEndpoint apijson.Field
@@ -118,11 +118,11 @@ type pageShieldListResponseJSON struct {
ExtraFields map[string]apijson.Field
}
-func (r *PageShieldListResponse) UnmarshalJSON(data []byte) (err error) {
+func (r *PageShieldUpdateZoneSettings) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
-func (r pageShieldListResponseJSON) RawJSON() string {
+func (r pageShieldUpdateZoneSettingsJSON) RawJSON() string {
return r.raw
}
@@ -145,7 +145,7 @@ func (r PageShieldUpdateParams) MarshalJSON() (data []byte, err error) {
type PageShieldUpdateResponseEnvelope struct {
Errors []PageShieldUpdateResponseEnvelopeErrors `json:"errors,required"`
Messages []PageShieldUpdateResponseEnvelopeMessages `json:"messages,required"`
- Result PageShieldUpdateResponse `json:"result,required"`
+ Result PageShieldUpdateZoneSettings `json:"result,required"`
// Whether the API call was successful
Success PageShieldUpdateResponseEnvelopeSuccess `json:"success,required"`
JSON pageShieldUpdateResponseEnvelopeJSON `json:"-"`
@@ -231,7 +231,7 @@ type PageShieldListParams struct {
type PageShieldListResponseEnvelope struct {
Errors []PageShieldListResponseEnvelopeErrors `json:"errors,required"`
Messages []PageShieldListResponseEnvelopeMessages `json:"messages,required"`
- Result PageShieldListResponse `json:"result,required"`
+ Result PageShieldGetZoneSettings `json:"result,required"`
// Whether the API call was successful
Success PageShieldListResponseEnvelopeSuccess `json:"success,required"`
JSON pageShieldListResponseEnvelopeJSON `json:"-"`
diff --git a/pageshield_test.go b/page_shield/pageshield_test.go
similarity index 87%
rename from pageshield_test.go
rename to page_shield/pageshield_test.go
index ebc3cf38ae3..3cb37f2bfd2 100644
--- a/pageshield_test.go
+++ b/page_shield/pageshield_test.go
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package cloudflare_test
+package page_shield_test
import (
"context"
@@ -11,6 +11,7 @@ import (
"github.com/cloudflare/cloudflare-go"
"github.com/cloudflare/cloudflare-go/internal/testutil"
"github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/page_shield"
)
func TestPageShieldUpdateWithOptionalParams(t *testing.T) {
@@ -27,7 +28,7 @@ func TestPageShieldUpdateWithOptionalParams(t *testing.T) {
option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"),
option.WithAPIEmail("user@example.com"),
)
- _, err := client.PageShield.Update(context.TODO(), cloudflare.PageShieldUpdateParams{
+ _, err := client.PageShield.Update(context.TODO(), page_shield.PageShieldUpdateParams{
ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
Enabled: cloudflare.F(true),
UseCloudflareReportingEndpoint: cloudflare.F(true),
@@ -56,7 +57,7 @@ func TestPageShieldList(t *testing.T) {
option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"),
option.WithAPIEmail("user@example.com"),
)
- _, err := client.PageShield.List(context.TODO(), cloudflare.PageShieldListParams{
+ _, err := client.PageShield.List(context.TODO(), page_shield.PageShieldListParams{
ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
})
if err != nil {
diff --git a/page_shield/policy.go b/page_shield/policy.go
new file mode 100644
index 00000000000..b944188f88e
--- /dev/null
+++ b/page_shield/policy.go
@@ -0,0 +1,308 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package page_shield
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// PolicyService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewPolicyService] method instead.
+type PolicyService struct {
+ Options []option.RequestOption
+}
+
+// NewPolicyService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewPolicyService(opts ...option.RequestOption) (r *PolicyService) {
+ r = &PolicyService{}
+ r.Options = opts
+ return
+}
+
+// Create a Page Shield policy.
+func (r *PolicyService) New(ctx context.Context, params PolicyNewParams, opts ...option.RequestOption) (res *PageShieldPageshieldPolicy, err error) {
+ opts = append(r.Options[:], opts...)
+ path := fmt.Sprintf("zones/%s/page_shield/policies", params.ZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &res, opts...)
+ return
+}
+
+// Update a Page Shield policy by ID.
+func (r *PolicyService) Update(ctx context.Context, policyID string, params PolicyUpdateParams, opts ...option.RequestOption) (res *PageShieldPageshieldPolicy, err error) {
+ opts = append(r.Options[:], opts...)
+ path := fmt.Sprintf("zones/%s/page_shield/policies/%s", params.ZoneID, policyID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &res, opts...)
+ return
+}
+
+// Lists all Page Shield policies.
+func (r *PolicyService) List(ctx context.Context, query PolicyListParams, opts ...option.RequestOption) (res *[]PageShieldPageshieldPolicy, err error) {
+ opts = append(r.Options[:], opts...)
+ var env PolicyListResponseEnvelope
+ path := fmt.Sprintf("zones/%s/page_shield/policies", query.ZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Delete a Page Shield policy by ID.
+func (r *PolicyService) Delete(ctx context.Context, policyID string, body PolicyDeleteParams, opts ...option.RequestOption) (err error) {
+ opts = append(r.Options[:], opts...)
+ opts = append([]option.RequestOption{option.WithHeader("Accept", "")}, opts...)
+ path := fmt.Sprintf("zones/%s/page_shield/policies/%s", body.ZoneID, policyID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, nil, opts...)
+ return
+}
+
+// Fetches a Page Shield policy by ID.
+func (r *PolicyService) Get(ctx context.Context, policyID string, query PolicyGetParams, opts ...option.RequestOption) (res *PageShieldPageshieldPolicy, err error) {
+ opts = append(r.Options[:], opts...)
+ path := fmt.Sprintf("zones/%s/page_shield/policies/%s", query.ZoneID, policyID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &res, opts...)
+ return
+}
+
+type PageShieldPageshieldPolicy struct {
+ // The ID of the policy
+ ID string `json:"id"`
+ // The action to take if the expression matches
+ Action PageShieldPageshieldPolicyAction `json:"action"`
+ // A description for the policy
+ Description string `json:"description"`
+ // Whether the policy is enabled
+ Enabled bool `json:"enabled"`
+ // The expression which must match for the policy to be applied, using the
+ // Cloudflare Firewall rule expression syntax
+ Expression string `json:"expression"`
+ // The policy which will be applied
+ Value string `json:"value"`
+ JSON pageShieldPageshieldPolicyJSON `json:"-"`
+}
+
+// pageShieldPageshieldPolicyJSON contains the JSON metadata for the struct
+// [PageShieldPageshieldPolicy]
+type pageShieldPageshieldPolicyJSON struct {
+ ID apijson.Field
+ Action apijson.Field
+ Description apijson.Field
+ Enabled apijson.Field
+ Expression apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PageShieldPageshieldPolicy) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r pageShieldPageshieldPolicyJSON) RawJSON() string {
+ return r.raw
+}
+
+// The action to take if the expression matches
+type PageShieldPageshieldPolicyAction string
+
+const (
+ PageShieldPageshieldPolicyActionAllow PageShieldPageshieldPolicyAction = "allow"
+ PageShieldPageshieldPolicyActionLog PageShieldPageshieldPolicyAction = "log"
+)
+
+type PolicyNewParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+ // The action to take if the expression matches
+ Action param.Field[PolicyNewParamsAction] `json:"action"`
+ // A description for the policy
+ Description param.Field[string] `json:"description"`
+ // Whether the policy is enabled
+ Enabled param.Field[bool] `json:"enabled"`
+ // The expression which must match for the policy to be applied, using the
+ // Cloudflare Firewall rule expression syntax
+ Expression param.Field[string] `json:"expression"`
+ // The policy which will be applied
+ Value param.Field[string] `json:"value"`
+}
+
+func (r PolicyNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The action to take if the expression matches
+type PolicyNewParamsAction string
+
+const (
+ PolicyNewParamsActionAllow PolicyNewParamsAction = "allow"
+ PolicyNewParamsActionLog PolicyNewParamsAction = "log"
+)
+
+type PolicyUpdateParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+ // The action to take if the expression matches
+ Action param.Field[PolicyUpdateParamsAction] `json:"action"`
+ // A description for the policy
+ Description param.Field[string] `json:"description"`
+ // Whether the policy is enabled
+ Enabled param.Field[bool] `json:"enabled"`
+ // The expression which must match for the policy to be applied, using the
+ // Cloudflare Firewall rule expression syntax
+ Expression param.Field[string] `json:"expression"`
+ // The policy which will be applied
+ Value param.Field[string] `json:"value"`
+}
+
+func (r PolicyUpdateParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The action to take if the expression matches
+type PolicyUpdateParamsAction string
+
+const (
+ PolicyUpdateParamsActionAllow PolicyUpdateParamsAction = "allow"
+ PolicyUpdateParamsActionLog PolicyUpdateParamsAction = "log"
+)
+
+type PolicyListParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+}
+
+type PolicyListResponseEnvelope struct {
+ Errors []PolicyListResponseEnvelopeErrors `json:"errors,required"`
+ Messages []PolicyListResponseEnvelopeMessages `json:"messages,required"`
+ Result []PageShieldPageshieldPolicy `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success PolicyListResponseEnvelopeSuccess `json:"success,required"`
+ ResultInfo PolicyListResponseEnvelopeResultInfo `json:"result_info"`
+ JSON policyListResponseEnvelopeJSON `json:"-"`
+}
+
+// policyListResponseEnvelopeJSON contains the JSON metadata for the struct
+// [PolicyListResponseEnvelope]
+type policyListResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ ResultInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PolicyListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r policyListResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type PolicyListResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON policyListResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// policyListResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [PolicyListResponseEnvelopeErrors]
+type policyListResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PolicyListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r policyListResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type PolicyListResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON policyListResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// policyListResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [PolicyListResponseEnvelopeMessages]
+type policyListResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PolicyListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r policyListResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type PolicyListResponseEnvelopeSuccess bool
+
+const (
+ PolicyListResponseEnvelopeSuccessTrue PolicyListResponseEnvelopeSuccess = true
+)
+
+type PolicyListResponseEnvelopeResultInfo struct {
+ // Total number of results for the requested service
+ Count float64 `json:"count"`
+ // Current page within paginated list of results
+ Page float64 `json:"page"`
+ // Number of results per page of results
+ PerPage float64 `json:"per_page"`
+ // Total results available without any search parameters
+ TotalCount float64 `json:"total_count"`
+ JSON policyListResponseEnvelopeResultInfoJSON `json:"-"`
+}
+
+// policyListResponseEnvelopeResultInfoJSON contains the JSON metadata for the
+// struct [PolicyListResponseEnvelopeResultInfo]
+type policyListResponseEnvelopeResultInfoJSON struct {
+ Count apijson.Field
+ Page apijson.Field
+ PerPage apijson.Field
+ TotalCount apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PolicyListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r policyListResponseEnvelopeResultInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type PolicyDeleteParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+}
+
+type PolicyGetParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+}
diff --git a/page_shield/policy_test.go b/page_shield/policy_test.go
new file mode 100644
index 00000000000..0a57a9004f3
--- /dev/null
+++ b/page_shield/policy_test.go
@@ -0,0 +1,167 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package page_shield_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/page_shield"
+)
+
+func TestPolicyNewWithOptionalParams(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"),
+ )
+ _, err := client.PageShield.Policies.New(context.TODO(), page_shield.PolicyNewParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Action: cloudflare.F(page_shield.PolicyNewParamsActionAllow),
+ Description: cloudflare.F("Checkout page CSP policy"),
+ Enabled: cloudflare.F(true),
+ Expression: cloudflare.F("ends_with(http.request.uri.path, \"/checkout\")"),
+ Value: cloudflare.F("script-src 'none';"),
+ })
+ 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())
+ }
+}
+
+func TestPolicyUpdateWithOptionalParams(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"),
+ )
+ _, err := client.PageShield.Policies.Update(
+ context.TODO(),
+ "c9ef84a6bf5e47138c75d95e2f933e8f",
+ page_shield.PolicyUpdateParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Action: cloudflare.F(page_shield.PolicyUpdateParamsActionAllow),
+ Description: cloudflare.F("Checkout page CSP policy"),
+ Enabled: cloudflare.F(true),
+ Expression: cloudflare.F("ends_with(http.request.uri.path, \"/checkout\")"),
+ Value: cloudflare.F("script-src 'none';"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestPolicyList(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"),
+ )
+ _, err := client.PageShield.Policies.List(context.TODO(), page_shield.PolicyListParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ })
+ 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())
+ }
+}
+
+func TestPolicyDelete(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"),
+ )
+ err := client.PageShield.Policies.Delete(
+ context.TODO(),
+ "c9ef84a6bf5e47138c75d95e2f933e8f",
+ page_shield.PolicyDeleteParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestPolicyGet(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"),
+ )
+ _, err := client.PageShield.Policies.Get(
+ context.TODO(),
+ "c9ef84a6bf5e47138c75d95e2f933e8f",
+ page_shield.PolicyGetParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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/page_shield/script.go b/page_shield/script.go
new file mode 100644
index 00000000000..296854670e7
--- /dev/null
+++ b/page_shield/script.go
@@ -0,0 +1,382 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package page_shield
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// ScriptService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewScriptService] method instead.
+type ScriptService struct {
+ Options []option.RequestOption
+}
+
+// NewScriptService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewScriptService(opts ...option.RequestOption) (r *ScriptService) {
+ r = &ScriptService{}
+ r.Options = opts
+ return
+}
+
+// Lists all scripts detected by Page Shield.
+func (r *ScriptService) List(ctx context.Context, params ScriptListParams, opts ...option.RequestOption) (res *[]PageShieldScript, err error) {
+ opts = append(r.Options[:], opts...)
+ var env ScriptListResponseEnvelope
+ path := fmt.Sprintf("zones/%s/page_shield/scripts", params.ZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Fetches a script detected by Page Shield by script ID.
+func (r *ScriptService) Get(ctx context.Context, scriptID string, query ScriptGetParams, opts ...option.RequestOption) (res *ScriptGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ path := fmt.Sprintf("zones/%s/page_shield/scripts/%s", query.ZoneID, scriptID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &res, opts...)
+ return
+}
+
+type PageShieldScript struct {
+ ID interface{} `json:"id"`
+ AddedAt interface{} `json:"added_at"`
+ DomainReportedMalicious interface{} `json:"domain_reported_malicious"`
+ FetchedAt interface{} `json:"fetched_at"`
+ FirstPageURL interface{} `json:"first_page_url"`
+ FirstSeenAt interface{} `json:"first_seen_at"`
+ Hash interface{} `json:"hash"`
+ Host interface{} `json:"host"`
+ JsIntegrityScore interface{} `json:"js_integrity_score"`
+ LastSeenAt interface{} `json:"last_seen_at"`
+ PageURLs interface{} `json:"page_urls"`
+ URL interface{} `json:"url"`
+ URLContainsCdnCgiPath interface{} `json:"url_contains_cdn_cgi_path"`
+ JSON pageShieldScriptJSON `json:"-"`
+}
+
+// pageShieldScriptJSON contains the JSON metadata for the struct
+// [PageShieldScript]
+type pageShieldScriptJSON struct {
+ ID apijson.Field
+ AddedAt apijson.Field
+ DomainReportedMalicious apijson.Field
+ FetchedAt apijson.Field
+ FirstPageURL apijson.Field
+ FirstSeenAt apijson.Field
+ Hash apijson.Field
+ Host apijson.Field
+ JsIntegrityScore apijson.Field
+ LastSeenAt apijson.Field
+ PageURLs apijson.Field
+ URL apijson.Field
+ URLContainsCdnCgiPath apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PageShieldScript) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r pageShieldScriptJSON) RawJSON() string {
+ return r.raw
+}
+
+type ScriptGetResponse struct {
+ ID interface{} `json:"id"`
+ AddedAt interface{} `json:"added_at"`
+ DomainReportedMalicious interface{} `json:"domain_reported_malicious"`
+ FetchedAt interface{} `json:"fetched_at"`
+ FirstPageURL interface{} `json:"first_page_url"`
+ FirstSeenAt interface{} `json:"first_seen_at"`
+ Hash interface{} `json:"hash"`
+ Host interface{} `json:"host"`
+ JsIntegrityScore interface{} `json:"js_integrity_score"`
+ LastSeenAt interface{} `json:"last_seen_at"`
+ PageURLs interface{} `json:"page_urls"`
+ URL interface{} `json:"url"`
+ URLContainsCdnCgiPath interface{} `json:"url_contains_cdn_cgi_path"`
+ Versions []ScriptGetResponseVersion `json:"versions,nullable"`
+ JSON scriptGetResponseJSON `json:"-"`
+}
+
+// scriptGetResponseJSON contains the JSON metadata for the struct
+// [ScriptGetResponse]
+type scriptGetResponseJSON struct {
+ ID apijson.Field
+ AddedAt apijson.Field
+ DomainReportedMalicious apijson.Field
+ FetchedAt apijson.Field
+ FirstPageURL apijson.Field
+ FirstSeenAt apijson.Field
+ Hash apijson.Field
+ Host apijson.Field
+ JsIntegrityScore apijson.Field
+ LastSeenAt apijson.Field
+ PageURLs apijson.Field
+ URL apijson.Field
+ URLContainsCdnCgiPath apijson.Field
+ Versions apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ScriptGetResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r scriptGetResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+// The version of the analyzed script.
+type ScriptGetResponseVersion struct {
+ // The timestamp of when the script was last fetched.
+ FetchedAt string `json:"fetched_at,nullable"`
+ // The computed hash of the analyzed script.
+ Hash string `json:"hash,nullable"`
+ // The integrity score of the JavaScript content.
+ JsIntegrityScore int64 `json:"js_integrity_score,nullable"`
+ JSON scriptGetResponseVersionJSON `json:"-"`
+}
+
+// scriptGetResponseVersionJSON contains the JSON metadata for the struct
+// [ScriptGetResponseVersion]
+type scriptGetResponseVersionJSON struct {
+ FetchedAt apijson.Field
+ Hash apijson.Field
+ JsIntegrityScore apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ScriptGetResponseVersion) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r scriptGetResponseVersionJSON) RawJSON() string {
+ return r.raw
+}
+
+type ScriptListParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+ // The direction used to sort returned scripts.
+ Direction param.Field[ScriptListParamsDirection] `query:"direction"`
+ // When true, excludes scripts seen in a `/cdn-cgi` path from the returned scripts.
+ // The default value is true.
+ ExcludeCdnCgi param.Field[bool] `query:"exclude_cdn_cgi"`
+ // When true, excludes duplicate scripts. We consider a script duplicate of another
+ // if their javascript content matches and they share the same url host and zone
+ // hostname. In such case, we return the most recent script for the URL host and
+ // zone hostname combination.
+ ExcludeDuplicates param.Field[bool] `query:"exclude_duplicates"`
+ // Excludes scripts whose URL contains one of the URL-encoded URLs separated by
+ // commas.
+ ExcludeURLs param.Field[string] `query:"exclude_urls"`
+ // Export the list of scripts as a file. Cannot be used with per_page or page
+ // options.
+ Export param.Field[ScriptListParamsExport] `query:"export"`
+ // Includes scripts that match one or more URL-encoded hostnames separated by
+ // commas.
+ //
+ // Wildcards are supported at the start and end of each hostname to support starts
+ // with, ends with and contains. If no wildcards are used, results will be filtered
+ // by exact match
+ Hosts param.Field[string] `query:"hosts"`
+ // The field used to sort returned scripts.
+ OrderBy param.Field[ScriptListParamsOrderBy] `query:"order_by"`
+ // The current page number of the paginated results.
+ //
+ // We additionally support a special value "all". When "all" is used, the API will
+ // return all the scripts with the applied filters in a single page. Additionally,
+ // when using this value, the API will not return the script versions or
+ // categorisation data for the URL and domain of the scripts. This feature is
+ // best-effort and it may only work for zones with a low number of scripts
+ Page param.Field[string] `query:"page"`
+ // Includes scripts that match one or more page URLs (separated by commas) where
+ // they were last seen
+ //
+ // Wildcards are supported at the start and end of each page URL to support starts
+ // with, ends with and contains. If no wildcards are used, results will be filtered
+ // by exact match
+ PageURL param.Field[string] `query:"page_url"`
+ // The number of results per page.
+ PerPage param.Field[float64] `query:"per_page"`
+ // When true, malicious scripts appear first in the returned scripts.
+ PrioritizeMalicious param.Field[bool] `query:"prioritize_malicious"`
+ // Filters the returned scripts using a comma-separated list of scripts statuses.
+ // Accepted values: `active`, `infrequent`, and `inactive`. The default value is
+ // `active`.
+ Status param.Field[string] `query:"status"`
+ // Includes scripts whose URL contain one or more URL-encoded URLs separated by
+ // commas.
+ URLs param.Field[string] `query:"urls"`
+}
+
+// URLQuery serializes [ScriptListParams]'s query parameters as `url.Values`.
+func (r ScriptListParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// The direction used to sort returned scripts.
+type ScriptListParamsDirection string
+
+const (
+ ScriptListParamsDirectionAsc ScriptListParamsDirection = "asc"
+ ScriptListParamsDirectionDesc ScriptListParamsDirection = "desc"
+)
+
+// Export the list of scripts as a file. Cannot be used with per_page or page
+// options.
+type ScriptListParamsExport string
+
+const (
+ ScriptListParamsExportCsv ScriptListParamsExport = "csv"
+)
+
+// The field used to sort returned scripts.
+type ScriptListParamsOrderBy string
+
+const (
+ ScriptListParamsOrderByFirstSeenAt ScriptListParamsOrderBy = "first_seen_at"
+ ScriptListParamsOrderByLastSeenAt ScriptListParamsOrderBy = "last_seen_at"
+)
+
+type ScriptListResponseEnvelope struct {
+ Errors []ScriptListResponseEnvelopeErrors `json:"errors,required"`
+ Messages []ScriptListResponseEnvelopeMessages `json:"messages,required"`
+ Result []PageShieldScript `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success ScriptListResponseEnvelopeSuccess `json:"success,required"`
+ ResultInfo ScriptListResponseEnvelopeResultInfo `json:"result_info"`
+ JSON scriptListResponseEnvelopeJSON `json:"-"`
+}
+
+// scriptListResponseEnvelopeJSON contains the JSON metadata for the struct
+// [ScriptListResponseEnvelope]
+type scriptListResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ ResultInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ScriptListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r scriptListResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type ScriptListResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON scriptListResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// scriptListResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [ScriptListResponseEnvelopeErrors]
+type scriptListResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ScriptListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r scriptListResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type ScriptListResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON scriptListResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// scriptListResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [ScriptListResponseEnvelopeMessages]
+type scriptListResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ScriptListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r scriptListResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type ScriptListResponseEnvelopeSuccess bool
+
+const (
+ ScriptListResponseEnvelopeSuccessTrue ScriptListResponseEnvelopeSuccess = true
+)
+
+type ScriptListResponseEnvelopeResultInfo struct {
+ // Total number of results for the requested service
+ Count float64 `json:"count"`
+ // Current page within paginated list of results
+ Page float64 `json:"page"`
+ // Number of results per page of results
+ PerPage float64 `json:"per_page"`
+ // Total results available without any search parameters
+ TotalCount float64 `json:"total_count"`
+ JSON scriptListResponseEnvelopeResultInfoJSON `json:"-"`
+}
+
+// scriptListResponseEnvelopeResultInfoJSON contains the JSON metadata for the
+// struct [ScriptListResponseEnvelopeResultInfo]
+type scriptListResponseEnvelopeResultInfoJSON struct {
+ Count apijson.Field
+ Page apijson.Field
+ PerPage apijson.Field
+ TotalCount apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ScriptListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r scriptListResponseEnvelopeResultInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type ScriptGetParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+}
diff --git a/page_shield/script_test.go b/page_shield/script_test.go
new file mode 100644
index 00000000000..cf5ad852349
--- /dev/null
+++ b/page_shield/script_test.go
@@ -0,0 +1,84 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package page_shield_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/page_shield"
+)
+
+func TestScriptListWithOptionalParams(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"),
+ )
+ _, err := client.PageShield.Scripts.List(context.TODO(), page_shield.ScriptListParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Direction: cloudflare.F(page_shield.ScriptListParamsDirectionAsc),
+ ExcludeCdnCgi: cloudflare.F(true),
+ ExcludeDuplicates: cloudflare.F(true),
+ ExcludeURLs: cloudflare.F("blog.cloudflare.com,www.example"),
+ Export: cloudflare.F(page_shield.ScriptListParamsExportCsv),
+ Hosts: cloudflare.F("blog.cloudflare.com,www.example*,*cloudflare.com"),
+ OrderBy: cloudflare.F(page_shield.ScriptListParamsOrderByFirstSeenAt),
+ Page: cloudflare.F("string"),
+ PageURL: cloudflare.F("example.com/page,*/checkout,example.com/*,*checkout*"),
+ PerPage: cloudflare.F(100.000000),
+ PrioritizeMalicious: cloudflare.F(true),
+ Status: cloudflare.F("active,inactive"),
+ URLs: cloudflare.F("blog.cloudflare.com,www.example"),
+ })
+ 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())
+ }
+}
+
+func TestScriptGet(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"),
+ )
+ _, err := client.PageShield.Scripts.Get(
+ context.TODO(),
+ "c9ef84a6bf5e47138c75d95e2f933e8f",
+ page_shield.ScriptGetParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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/pageproject.go b/pageproject.go
deleted file mode 100644
index a8896de9e28..00000000000
--- a/pageproject.go
+++ /dev/null
@@ -1,2752 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "reflect"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/option"
- "github.com/tidwall/gjson"
-)
-
-// PageProjectService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewPageProjectService] method
-// instead.
-type PageProjectService struct {
- Options []option.RequestOption
- Deployments *PageProjectDeploymentService
- Domains *PageProjectDomainService
-}
-
-// NewPageProjectService generates a new service that applies the given options to
-// each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewPageProjectService(opts ...option.RequestOption) (r *PageProjectService) {
- r = &PageProjectService{}
- r.Options = opts
- r.Deployments = NewPageProjectDeploymentService(opts...)
- r.Domains = NewPageProjectDomainService(opts...)
- return
-}
-
-// Create a new project.
-func (r *PageProjectService) New(ctx context.Context, params PageProjectNewParams, opts ...option.RequestOption) (res *PageProjectNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env PageProjectNewResponseEnvelope
- path := fmt.Sprintf("accounts/%s/pages/projects", params.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Fetch a list of all user projects.
-func (r *PageProjectService) List(ctx context.Context, query PageProjectListParams, opts ...option.RequestOption) (res *[]PageProjectListResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env PageProjectListResponseEnvelope
- path := fmt.Sprintf("accounts/%s/pages/projects", query.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Delete a project by name.
-func (r *PageProjectService) Delete(ctx context.Context, projectName string, body PageProjectDeleteParams, opts ...option.RequestOption) (res *PageProjectDeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- path := fmt.Sprintf("accounts/%s/pages/projects/%s", body.AccountID, projectName)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &res, opts...)
- return
-}
-
-// Set new attributes for an existing project. Modify environment variables. To
-// delete an environment variable, set the key to null.
-func (r *PageProjectService) Edit(ctx context.Context, projectName string, params PageProjectEditParams, opts ...option.RequestOption) (res *PageProjectEditResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env PageProjectEditResponseEnvelope
- path := fmt.Sprintf("accounts/%s/pages/projects/%s", params.AccountID, projectName)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Fetch a project by name.
-func (r *PageProjectService) Get(ctx context.Context, projectName string, query PageProjectGetParams, opts ...option.RequestOption) (res *PageProjectGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env PageProjectGetResponseEnvelope
- path := fmt.Sprintf("accounts/%s/pages/projects/%s", query.AccountID, projectName)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Purge all cached build artifacts for a Pages project
-func (r *PageProjectService) PurgeBuildCache(ctx context.Context, projectName string, body PageProjectPurgeBuildCacheParams, opts ...option.RequestOption) (res *PageProjectPurgeBuildCacheResponse, err error) {
- opts = append(r.Options[:], opts...)
- path := fmt.Sprintf("accounts/%s/pages/projects/%s/purge_build_cache", body.AccountID, projectName)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &res, opts...)
- return
-}
-
-// Union satisfied by [PageProjectNewResponseUnknown],
-// [PageProjectNewResponseArray] or [shared.UnionString].
-type PageProjectNewResponse interface {
- ImplementsPageProjectNewResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*PageProjectNewResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(PageProjectNewResponseArray{}),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-type PageProjectNewResponseArray []interface{}
-
-func (r PageProjectNewResponseArray) ImplementsPageProjectNewResponse() {}
-
-type PageProjectListResponse struct {
- // Id of the deployment.
- ID string `json:"id"`
- // A list of alias URLs pointing to this deployment.
- Aliases []interface{} `json:"aliases,nullable"`
- BuildConfig interface{} `json:"build_config"`
- // When the deployment was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Info about what caused the deployment.
- DeploymentTrigger PageProjectListResponseDeploymentTrigger `json:"deployment_trigger"`
- // A dict of env variables to build this deploy.
- EnvVars interface{} `json:"env_vars"`
- // Type of deploy.
- Environment string `json:"environment"`
- // If the deployment has been skipped.
- IsSkipped bool `json:"is_skipped"`
- LatestStage interface{} `json:"latest_stage"`
- // When the deployment was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Id of the project.
- ProjectID string `json:"project_id"`
- // Name of the project.
- ProjectName string `json:"project_name"`
- // Short Id (8 character) of the deployment.
- ShortID string `json:"short_id"`
- Source interface{} `json:"source"`
- // List of past stages.
- Stages []PageProjectListResponseStage `json:"stages"`
- // The live URL to view this deployment.
- URL string `json:"url"`
- JSON pageProjectListResponseJSON `json:"-"`
-}
-
-// pageProjectListResponseJSON contains the JSON metadata for the struct
-// [PageProjectListResponse]
-type pageProjectListResponseJSON struct {
- ID apijson.Field
- Aliases apijson.Field
- BuildConfig apijson.Field
- CreatedOn apijson.Field
- DeploymentTrigger apijson.Field
- EnvVars apijson.Field
- Environment apijson.Field
- IsSkipped apijson.Field
- LatestStage apijson.Field
- ModifiedOn apijson.Field
- ProjectID apijson.Field
- ProjectName apijson.Field
- ShortID apijson.Field
- Source apijson.Field
- Stages apijson.Field
- URL apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// Info about what caused the deployment.
-type PageProjectListResponseDeploymentTrigger struct {
- // Additional info about the trigger.
- Metadata PageProjectListResponseDeploymentTriggerMetadata `json:"metadata"`
- // What caused the deployment.
- Type string `json:"type"`
- JSON pageProjectListResponseDeploymentTriggerJSON `json:"-"`
-}
-
-// pageProjectListResponseDeploymentTriggerJSON contains the JSON metadata for the
-// struct [PageProjectListResponseDeploymentTrigger]
-type pageProjectListResponseDeploymentTriggerJSON struct {
- Metadata apijson.Field
- Type apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectListResponseDeploymentTrigger) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectListResponseDeploymentTriggerJSON) RawJSON() string {
- return r.raw
-}
-
-// Additional info about the trigger.
-type PageProjectListResponseDeploymentTriggerMetadata struct {
- // Where the trigger happened.
- Branch string `json:"branch"`
- // Hash of the deployment trigger commit.
- CommitHash string `json:"commit_hash"`
- // Message of the deployment trigger commit.
- CommitMessage string `json:"commit_message"`
- JSON pageProjectListResponseDeploymentTriggerMetadataJSON `json:"-"`
-}
-
-// pageProjectListResponseDeploymentTriggerMetadataJSON contains the JSON metadata
-// for the struct [PageProjectListResponseDeploymentTriggerMetadata]
-type pageProjectListResponseDeploymentTriggerMetadataJSON struct {
- Branch apijson.Field
- CommitHash apijson.Field
- CommitMessage apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectListResponseDeploymentTriggerMetadata) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectListResponseDeploymentTriggerMetadataJSON) RawJSON() string {
- return r.raw
-}
-
-// The status of the deployment.
-type PageProjectListResponseStage struct {
- // When the stage ended.
- EndedOn time.Time `json:"ended_on,nullable" format:"date-time"`
- // The current build stage.
- Name string `json:"name"`
- // When the stage started.
- StartedOn time.Time `json:"started_on,nullable" format:"date-time"`
- // State of the current stage.
- Status string `json:"status"`
- JSON pageProjectListResponseStageJSON `json:"-"`
-}
-
-// pageProjectListResponseStageJSON contains the JSON metadata for the struct
-// [PageProjectListResponseStage]
-type pageProjectListResponseStageJSON struct {
- EndedOn apijson.Field
- Name apijson.Field
- StartedOn apijson.Field
- Status apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectListResponseStage) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectListResponseStageJSON) RawJSON() string {
- return r.raw
-}
-
-type PageProjectDeleteResponse = interface{}
-
-// Union satisfied by [PageProjectEditResponseUnknown],
-// [PageProjectEditResponseArray] or [shared.UnionString].
-type PageProjectEditResponse interface {
- ImplementsPageProjectEditResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*PageProjectEditResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(PageProjectEditResponseArray{}),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-type PageProjectEditResponseArray []interface{}
-
-func (r PageProjectEditResponseArray) ImplementsPageProjectEditResponse() {}
-
-type PageProjectGetResponse struct {
- // Id of the project.
- ID string `json:"id"`
- // Configs for the project build process.
- BuildConfig PageProjectGetResponseBuildConfig `json:"build_config"`
- CanonicalDeployment PageProjectGetResponseCanonicalDeployment `json:"canonical_deployment"`
- // When the project was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Configs for deployments in a project.
- DeploymentConfigs PageProjectGetResponseDeploymentConfigs `json:"deployment_configs"`
- // A list of associated custom domains for the project.
- Domains []interface{} `json:"domains"`
- LatestDeployment PageProjectGetResponseLatestDeployment `json:"latest_deployment"`
- // Name of the project.
- Name string `json:"name"`
- // Production branch of the project. Used to identify production deployments.
- ProductionBranch string `json:"production_branch"`
- Source interface{} `json:"source"`
- // The Cloudflare subdomain associated with the project.
- Subdomain string `json:"subdomain"`
- JSON pageProjectGetResponseJSON `json:"-"`
-}
-
-// pageProjectGetResponseJSON contains the JSON metadata for the struct
-// [PageProjectGetResponse]
-type pageProjectGetResponseJSON struct {
- ID apijson.Field
- BuildConfig apijson.Field
- CanonicalDeployment apijson.Field
- CreatedOn apijson.Field
- DeploymentConfigs apijson.Field
- Domains apijson.Field
- LatestDeployment apijson.Field
- Name apijson.Field
- ProductionBranch apijson.Field
- Source apijson.Field
- Subdomain apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// Configs for the project build process.
-type PageProjectGetResponseBuildConfig struct {
- // Enable build caching for the project.
- BuildCaching bool `json:"build_caching,nullable"`
- // Command used to build project.
- BuildCommand string `json:"build_command,nullable"`
- // Output directory of the build.
- DestinationDir string `json:"destination_dir,nullable"`
- // Directory to run the command.
- RootDir string `json:"root_dir,nullable"`
- // The classifying tag for analytics.
- WebAnalyticsTag string `json:"web_analytics_tag,nullable"`
- // The auth token for analytics.
- WebAnalyticsToken string `json:"web_analytics_token,nullable"`
- JSON pageProjectGetResponseBuildConfigJSON `json:"-"`
-}
-
-// pageProjectGetResponseBuildConfigJSON contains the JSON metadata for the struct
-// [PageProjectGetResponseBuildConfig]
-type pageProjectGetResponseBuildConfigJSON struct {
- BuildCaching apijson.Field
- BuildCommand apijson.Field
- DestinationDir apijson.Field
- RootDir apijson.Field
- WebAnalyticsTag apijson.Field
- WebAnalyticsToken apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectGetResponseBuildConfig) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectGetResponseBuildConfigJSON) RawJSON() string {
- return r.raw
-}
-
-type PageProjectGetResponseCanonicalDeployment struct {
- // Id of the deployment.
- ID string `json:"id"`
- // A list of alias URLs pointing to this deployment.
- Aliases []interface{} `json:"aliases,nullable"`
- BuildConfig interface{} `json:"build_config"`
- // When the deployment was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Info about what caused the deployment.
- DeploymentTrigger PageProjectGetResponseCanonicalDeploymentDeploymentTrigger `json:"deployment_trigger"`
- // A dict of env variables to build this deploy.
- EnvVars interface{} `json:"env_vars"`
- // Type of deploy.
- Environment string `json:"environment"`
- // If the deployment has been skipped.
- IsSkipped bool `json:"is_skipped"`
- LatestStage interface{} `json:"latest_stage"`
- // When the deployment was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Id of the project.
- ProjectID string `json:"project_id"`
- // Name of the project.
- ProjectName string `json:"project_name"`
- // Short Id (8 character) of the deployment.
- ShortID string `json:"short_id"`
- Source interface{} `json:"source"`
- // List of past stages.
- Stages []PageProjectGetResponseCanonicalDeploymentStage `json:"stages"`
- // The live URL to view this deployment.
- URL string `json:"url"`
- JSON pageProjectGetResponseCanonicalDeploymentJSON `json:"-"`
-}
-
-// pageProjectGetResponseCanonicalDeploymentJSON contains the JSON metadata for the
-// struct [PageProjectGetResponseCanonicalDeployment]
-type pageProjectGetResponseCanonicalDeploymentJSON struct {
- ID apijson.Field
- Aliases apijson.Field
- BuildConfig apijson.Field
- CreatedOn apijson.Field
- DeploymentTrigger apijson.Field
- EnvVars apijson.Field
- Environment apijson.Field
- IsSkipped apijson.Field
- LatestStage apijson.Field
- ModifiedOn apijson.Field
- ProjectID apijson.Field
- ProjectName apijson.Field
- ShortID apijson.Field
- Source apijson.Field
- Stages apijson.Field
- URL apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectGetResponseCanonicalDeployment) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectGetResponseCanonicalDeploymentJSON) RawJSON() string {
- return r.raw
-}
-
-// Info about what caused the deployment.
-type PageProjectGetResponseCanonicalDeploymentDeploymentTrigger struct {
- // Additional info about the trigger.
- Metadata PageProjectGetResponseCanonicalDeploymentDeploymentTriggerMetadata `json:"metadata"`
- // What caused the deployment.
- Type string `json:"type"`
- JSON pageProjectGetResponseCanonicalDeploymentDeploymentTriggerJSON `json:"-"`
-}
-
-// pageProjectGetResponseCanonicalDeploymentDeploymentTriggerJSON contains the JSON
-// metadata for the struct
-// [PageProjectGetResponseCanonicalDeploymentDeploymentTrigger]
-type pageProjectGetResponseCanonicalDeploymentDeploymentTriggerJSON struct {
- Metadata apijson.Field
- Type apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectGetResponseCanonicalDeploymentDeploymentTrigger) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectGetResponseCanonicalDeploymentDeploymentTriggerJSON) RawJSON() string {
- return r.raw
-}
-
-// Additional info about the trigger.
-type PageProjectGetResponseCanonicalDeploymentDeploymentTriggerMetadata struct {
- // Where the trigger happened.
- Branch string `json:"branch"`
- // Hash of the deployment trigger commit.
- CommitHash string `json:"commit_hash"`
- // Message of the deployment trigger commit.
- CommitMessage string `json:"commit_message"`
- JSON pageProjectGetResponseCanonicalDeploymentDeploymentTriggerMetadataJSON `json:"-"`
-}
-
-// pageProjectGetResponseCanonicalDeploymentDeploymentTriggerMetadataJSON contains
-// the JSON metadata for the struct
-// [PageProjectGetResponseCanonicalDeploymentDeploymentTriggerMetadata]
-type pageProjectGetResponseCanonicalDeploymentDeploymentTriggerMetadataJSON struct {
- Branch apijson.Field
- CommitHash apijson.Field
- CommitMessage apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectGetResponseCanonicalDeploymentDeploymentTriggerMetadata) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectGetResponseCanonicalDeploymentDeploymentTriggerMetadataJSON) RawJSON() string {
- return r.raw
-}
-
-// The status of the deployment.
-type PageProjectGetResponseCanonicalDeploymentStage struct {
- // When the stage ended.
- EndedOn time.Time `json:"ended_on,nullable" format:"date-time"`
- // The current build stage.
- Name string `json:"name"`
- // When the stage started.
- StartedOn time.Time `json:"started_on,nullable" format:"date-time"`
- // State of the current stage.
- Status string `json:"status"`
- JSON pageProjectGetResponseCanonicalDeploymentStageJSON `json:"-"`
-}
-
-// pageProjectGetResponseCanonicalDeploymentStageJSON contains the JSON metadata
-// for the struct [PageProjectGetResponseCanonicalDeploymentStage]
-type pageProjectGetResponseCanonicalDeploymentStageJSON struct {
- EndedOn apijson.Field
- Name apijson.Field
- StartedOn apijson.Field
- Status apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectGetResponseCanonicalDeploymentStage) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectGetResponseCanonicalDeploymentStageJSON) RawJSON() string {
- return r.raw
-}
-
-// Configs for deployments in a project.
-type PageProjectGetResponseDeploymentConfigs struct {
- // Configs for preview deploys.
- Preview PageProjectGetResponseDeploymentConfigsPreview `json:"preview"`
- // Configs for production deploys.
- Production PageProjectGetResponseDeploymentConfigsProduction `json:"production"`
- JSON pageProjectGetResponseDeploymentConfigsJSON `json:"-"`
-}
-
-// pageProjectGetResponseDeploymentConfigsJSON contains the JSON metadata for the
-// struct [PageProjectGetResponseDeploymentConfigs]
-type pageProjectGetResponseDeploymentConfigsJSON struct {
- Preview apijson.Field
- Production apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectGetResponseDeploymentConfigs) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectGetResponseDeploymentConfigsJSON) RawJSON() string {
- return r.raw
-}
-
-// Configs for preview deploys.
-type PageProjectGetResponseDeploymentConfigsPreview struct {
- // Constellation bindings used for Pages Functions.
- AIBindings PageProjectGetResponseDeploymentConfigsPreviewAIBindings `json:"ai_bindings,nullable"`
- // Analytics Engine bindings used for Pages Functions.
- AnalyticsEngineDatasets PageProjectGetResponseDeploymentConfigsPreviewAnalyticsEngineDatasets `json:"analytics_engine_datasets,nullable"`
- // Compatibility date used for Pages Functions.
- CompatibilityDate string `json:"compatibility_date"`
- // Compatibility flags used for Pages Functions.
- CompatibilityFlags []interface{} `json:"compatibility_flags"`
- // D1 databases used for Pages Functions.
- D1Databases PageProjectGetResponseDeploymentConfigsPreviewD1Databases `json:"d1_databases,nullable"`
- // Durabble Object namespaces used for Pages Functions.
- DurableObjectNamespaces PageProjectGetResponseDeploymentConfigsPreviewDurableObjectNamespaces `json:"durable_object_namespaces,nullable"`
- // Environment variables for build configs.
- EnvVars PageProjectGetResponseDeploymentConfigsPreviewEnvVars `json:"env_vars,nullable"`
- // KV namespaces used for Pages Functions.
- KVNamespaces PageProjectGetResponseDeploymentConfigsPreviewKVNamespaces `json:"kv_namespaces"`
- // Placement setting used for Pages Functions.
- Placement PageProjectGetResponseDeploymentConfigsPreviewPlacement `json:"placement,nullable"`
- // Queue Producer bindings used for Pages Functions.
- QueueProducers PageProjectGetResponseDeploymentConfigsPreviewQueueProducers `json:"queue_producers,nullable"`
- // R2 buckets used for Pages Functions.
- R2Buckets PageProjectGetResponseDeploymentConfigsPreviewR2Buckets `json:"r2_buckets,nullable"`
- // Services used for Pages Functions.
- ServiceBindings PageProjectGetResponseDeploymentConfigsPreviewServiceBindings `json:"service_bindings,nullable"`
- JSON pageProjectGetResponseDeploymentConfigsPreviewJSON `json:"-"`
-}
-
-// pageProjectGetResponseDeploymentConfigsPreviewJSON contains the JSON metadata
-// for the struct [PageProjectGetResponseDeploymentConfigsPreview]
-type pageProjectGetResponseDeploymentConfigsPreviewJSON struct {
- AIBindings apijson.Field
- AnalyticsEngineDatasets apijson.Field
- CompatibilityDate apijson.Field
- CompatibilityFlags apijson.Field
- D1Databases apijson.Field
- DurableObjectNamespaces apijson.Field
- EnvVars apijson.Field
- KVNamespaces apijson.Field
- Placement apijson.Field
- QueueProducers apijson.Field
- R2Buckets apijson.Field
- ServiceBindings apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectGetResponseDeploymentConfigsPreview) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectGetResponseDeploymentConfigsPreviewJSON) RawJSON() string {
- return r.raw
-}
-
-// Constellation bindings used for Pages Functions.
-type PageProjectGetResponseDeploymentConfigsPreviewAIBindings struct {
- // AI binding.
- AIBinding PageProjectGetResponseDeploymentConfigsPreviewAIBindingsAIBinding `json:"AI_BINDING"`
- JSON pageProjectGetResponseDeploymentConfigsPreviewAIBindingsJSON `json:"-"`
-}
-
-// pageProjectGetResponseDeploymentConfigsPreviewAIBindingsJSON contains the JSON
-// metadata for the struct
-// [PageProjectGetResponseDeploymentConfigsPreviewAIBindings]
-type pageProjectGetResponseDeploymentConfigsPreviewAIBindingsJSON struct {
- AIBinding apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectGetResponseDeploymentConfigsPreviewAIBindings) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectGetResponseDeploymentConfigsPreviewAIBindingsJSON) RawJSON() string {
- return r.raw
-}
-
-// AI binding.
-type PageProjectGetResponseDeploymentConfigsPreviewAIBindingsAIBinding struct {
- ProjectID interface{} `json:"project_id"`
- JSON pageProjectGetResponseDeploymentConfigsPreviewAIBindingsAIBindingJSON `json:"-"`
-}
-
-// pageProjectGetResponseDeploymentConfigsPreviewAIBindingsAIBindingJSON contains
-// the JSON metadata for the struct
-// [PageProjectGetResponseDeploymentConfigsPreviewAIBindingsAIBinding]
-type pageProjectGetResponseDeploymentConfigsPreviewAIBindingsAIBindingJSON struct {
- ProjectID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectGetResponseDeploymentConfigsPreviewAIBindingsAIBinding) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectGetResponseDeploymentConfigsPreviewAIBindingsAIBindingJSON) RawJSON() string {
- return r.raw
-}
-
-// Analytics Engine bindings used for Pages Functions.
-type PageProjectGetResponseDeploymentConfigsPreviewAnalyticsEngineDatasets struct {
- // Analytics Engine binding.
- AnalyticsEngineBinding PageProjectGetResponseDeploymentConfigsPreviewAnalyticsEngineDatasetsAnalyticsEngineBinding `json:"ANALYTICS_ENGINE_BINDING"`
- JSON pageProjectGetResponseDeploymentConfigsPreviewAnalyticsEngineDatasetsJSON `json:"-"`
-}
-
-// pageProjectGetResponseDeploymentConfigsPreviewAnalyticsEngineDatasetsJSON
-// contains the JSON metadata for the struct
-// [PageProjectGetResponseDeploymentConfigsPreviewAnalyticsEngineDatasets]
-type pageProjectGetResponseDeploymentConfigsPreviewAnalyticsEngineDatasetsJSON struct {
- AnalyticsEngineBinding apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectGetResponseDeploymentConfigsPreviewAnalyticsEngineDatasets) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectGetResponseDeploymentConfigsPreviewAnalyticsEngineDatasetsJSON) RawJSON() string {
- return r.raw
-}
-
-// Analytics Engine binding.
-type PageProjectGetResponseDeploymentConfigsPreviewAnalyticsEngineDatasetsAnalyticsEngineBinding struct {
- // Name of the dataset.
- Dataset string `json:"dataset"`
- JSON pageProjectGetResponseDeploymentConfigsPreviewAnalyticsEngineDatasetsAnalyticsEngineBindingJSON `json:"-"`
-}
-
-// pageProjectGetResponseDeploymentConfigsPreviewAnalyticsEngineDatasetsAnalyticsEngineBindingJSON
-// contains the JSON metadata for the struct
-// [PageProjectGetResponseDeploymentConfigsPreviewAnalyticsEngineDatasetsAnalyticsEngineBinding]
-type pageProjectGetResponseDeploymentConfigsPreviewAnalyticsEngineDatasetsAnalyticsEngineBindingJSON struct {
- Dataset apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectGetResponseDeploymentConfigsPreviewAnalyticsEngineDatasetsAnalyticsEngineBinding) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectGetResponseDeploymentConfigsPreviewAnalyticsEngineDatasetsAnalyticsEngineBindingJSON) RawJSON() string {
- return r.raw
-}
-
-// D1 databases used for Pages Functions.
-type PageProjectGetResponseDeploymentConfigsPreviewD1Databases struct {
- // D1 binding.
- D1Binding PageProjectGetResponseDeploymentConfigsPreviewD1DatabasesD1Binding `json:"D1_BINDING"`
- JSON pageProjectGetResponseDeploymentConfigsPreviewD1DatabasesJSON `json:"-"`
-}
-
-// pageProjectGetResponseDeploymentConfigsPreviewD1DatabasesJSON contains the JSON
-// metadata for the struct
-// [PageProjectGetResponseDeploymentConfigsPreviewD1Databases]
-type pageProjectGetResponseDeploymentConfigsPreviewD1DatabasesJSON struct {
- D1Binding apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectGetResponseDeploymentConfigsPreviewD1Databases) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectGetResponseDeploymentConfigsPreviewD1DatabasesJSON) RawJSON() string {
- return r.raw
-}
-
-// D1 binding.
-type PageProjectGetResponseDeploymentConfigsPreviewD1DatabasesD1Binding struct {
- // UUID of the D1 database.
- ID string `json:"id"`
- JSON pageProjectGetResponseDeploymentConfigsPreviewD1DatabasesD1BindingJSON `json:"-"`
-}
-
-// pageProjectGetResponseDeploymentConfigsPreviewD1DatabasesD1BindingJSON contains
-// the JSON metadata for the struct
-// [PageProjectGetResponseDeploymentConfigsPreviewD1DatabasesD1Binding]
-type pageProjectGetResponseDeploymentConfigsPreviewD1DatabasesD1BindingJSON struct {
- ID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectGetResponseDeploymentConfigsPreviewD1DatabasesD1Binding) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectGetResponseDeploymentConfigsPreviewD1DatabasesD1BindingJSON) RawJSON() string {
- return r.raw
-}
-
-// Durabble Object namespaces used for Pages Functions.
-type PageProjectGetResponseDeploymentConfigsPreviewDurableObjectNamespaces struct {
- // Durabble Object binding.
- DoBinding PageProjectGetResponseDeploymentConfigsPreviewDurableObjectNamespacesDoBinding `json:"DO_BINDING"`
- JSON pageProjectGetResponseDeploymentConfigsPreviewDurableObjectNamespacesJSON `json:"-"`
-}
-
-// pageProjectGetResponseDeploymentConfigsPreviewDurableObjectNamespacesJSON
-// contains the JSON metadata for the struct
-// [PageProjectGetResponseDeploymentConfigsPreviewDurableObjectNamespaces]
-type pageProjectGetResponseDeploymentConfigsPreviewDurableObjectNamespacesJSON struct {
- DoBinding apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectGetResponseDeploymentConfigsPreviewDurableObjectNamespaces) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectGetResponseDeploymentConfigsPreviewDurableObjectNamespacesJSON) RawJSON() string {
- return r.raw
-}
-
-// Durabble Object binding.
-type PageProjectGetResponseDeploymentConfigsPreviewDurableObjectNamespacesDoBinding struct {
- // ID of the Durabble Object namespace.
- NamespaceID string `json:"namespace_id"`
- JSON pageProjectGetResponseDeploymentConfigsPreviewDurableObjectNamespacesDoBindingJSON `json:"-"`
-}
-
-// pageProjectGetResponseDeploymentConfigsPreviewDurableObjectNamespacesDoBindingJSON
-// contains the JSON metadata for the struct
-// [PageProjectGetResponseDeploymentConfigsPreviewDurableObjectNamespacesDoBinding]
-type pageProjectGetResponseDeploymentConfigsPreviewDurableObjectNamespacesDoBindingJSON struct {
- NamespaceID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectGetResponseDeploymentConfigsPreviewDurableObjectNamespacesDoBinding) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectGetResponseDeploymentConfigsPreviewDurableObjectNamespacesDoBindingJSON) RawJSON() string {
- return r.raw
-}
-
-// Environment variables for build configs.
-type PageProjectGetResponseDeploymentConfigsPreviewEnvVars struct {
- // Environment variable.
- EnvironmentVariable PageProjectGetResponseDeploymentConfigsPreviewEnvVarsEnvironmentVariable `json:"ENVIRONMENT_VARIABLE"`
- JSON pageProjectGetResponseDeploymentConfigsPreviewEnvVarsJSON `json:"-"`
-}
-
-// pageProjectGetResponseDeploymentConfigsPreviewEnvVarsJSON contains the JSON
-// metadata for the struct [PageProjectGetResponseDeploymentConfigsPreviewEnvVars]
-type pageProjectGetResponseDeploymentConfigsPreviewEnvVarsJSON struct {
- EnvironmentVariable apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectGetResponseDeploymentConfigsPreviewEnvVars) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectGetResponseDeploymentConfigsPreviewEnvVarsJSON) RawJSON() string {
- return r.raw
-}
-
-// Environment variable.
-type PageProjectGetResponseDeploymentConfigsPreviewEnvVarsEnvironmentVariable struct {
- // The type of environment variable (plain text or secret)
- Type PageProjectGetResponseDeploymentConfigsPreviewEnvVarsEnvironmentVariableType `json:"type"`
- // Environment variable value.
- Value string `json:"value"`
- JSON pageProjectGetResponseDeploymentConfigsPreviewEnvVarsEnvironmentVariableJSON `json:"-"`
-}
-
-// pageProjectGetResponseDeploymentConfigsPreviewEnvVarsEnvironmentVariableJSON
-// contains the JSON metadata for the struct
-// [PageProjectGetResponseDeploymentConfigsPreviewEnvVarsEnvironmentVariable]
-type pageProjectGetResponseDeploymentConfigsPreviewEnvVarsEnvironmentVariableJSON struct {
- Type apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectGetResponseDeploymentConfigsPreviewEnvVarsEnvironmentVariable) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectGetResponseDeploymentConfigsPreviewEnvVarsEnvironmentVariableJSON) RawJSON() string {
- return r.raw
-}
-
-// The type of environment variable (plain text or secret)
-type PageProjectGetResponseDeploymentConfigsPreviewEnvVarsEnvironmentVariableType string
-
-const (
- PageProjectGetResponseDeploymentConfigsPreviewEnvVarsEnvironmentVariableTypePlainText PageProjectGetResponseDeploymentConfigsPreviewEnvVarsEnvironmentVariableType = "plain_text"
- PageProjectGetResponseDeploymentConfigsPreviewEnvVarsEnvironmentVariableTypeSecretText PageProjectGetResponseDeploymentConfigsPreviewEnvVarsEnvironmentVariableType = "secret_text"
-)
-
-// KV namespaces used for Pages Functions.
-type PageProjectGetResponseDeploymentConfigsPreviewKVNamespaces struct {
- // KV binding.
- KVBinding PageProjectGetResponseDeploymentConfigsPreviewKVNamespacesKVBinding `json:"KV_BINDING"`
- JSON pageProjectGetResponseDeploymentConfigsPreviewKVNamespacesJSON `json:"-"`
-}
-
-// pageProjectGetResponseDeploymentConfigsPreviewKVNamespacesJSON contains the JSON
-// metadata for the struct
-// [PageProjectGetResponseDeploymentConfigsPreviewKVNamespaces]
-type pageProjectGetResponseDeploymentConfigsPreviewKVNamespacesJSON struct {
- KVBinding apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectGetResponseDeploymentConfigsPreviewKVNamespaces) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectGetResponseDeploymentConfigsPreviewKVNamespacesJSON) RawJSON() string {
- return r.raw
-}
-
-// KV binding.
-type PageProjectGetResponseDeploymentConfigsPreviewKVNamespacesKVBinding struct {
- // ID of the KV namespace.
- NamespaceID string `json:"namespace_id"`
- JSON pageProjectGetResponseDeploymentConfigsPreviewKVNamespacesKVBindingJSON `json:"-"`
-}
-
-// pageProjectGetResponseDeploymentConfigsPreviewKVNamespacesKVBindingJSON contains
-// the JSON metadata for the struct
-// [PageProjectGetResponseDeploymentConfigsPreviewKVNamespacesKVBinding]
-type pageProjectGetResponseDeploymentConfigsPreviewKVNamespacesKVBindingJSON struct {
- NamespaceID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectGetResponseDeploymentConfigsPreviewKVNamespacesKVBinding) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectGetResponseDeploymentConfigsPreviewKVNamespacesKVBindingJSON) RawJSON() string {
- return r.raw
-}
-
-// Placement setting used for Pages Functions.
-type PageProjectGetResponseDeploymentConfigsPreviewPlacement struct {
- // Placement mode.
- Mode string `json:"mode"`
- JSON pageProjectGetResponseDeploymentConfigsPreviewPlacementJSON `json:"-"`
-}
-
-// pageProjectGetResponseDeploymentConfigsPreviewPlacementJSON contains the JSON
-// metadata for the struct
-// [PageProjectGetResponseDeploymentConfigsPreviewPlacement]
-type pageProjectGetResponseDeploymentConfigsPreviewPlacementJSON struct {
- Mode apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectGetResponseDeploymentConfigsPreviewPlacement) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectGetResponseDeploymentConfigsPreviewPlacementJSON) RawJSON() string {
- return r.raw
-}
-
-// Queue Producer bindings used for Pages Functions.
-type PageProjectGetResponseDeploymentConfigsPreviewQueueProducers struct {
- // Queue Producer binding.
- QueueProducerBinding PageProjectGetResponseDeploymentConfigsPreviewQueueProducersQueueProducerBinding `json:"QUEUE_PRODUCER_BINDING"`
- JSON pageProjectGetResponseDeploymentConfigsPreviewQueueProducersJSON `json:"-"`
-}
-
-// pageProjectGetResponseDeploymentConfigsPreviewQueueProducersJSON contains the
-// JSON metadata for the struct
-// [PageProjectGetResponseDeploymentConfigsPreviewQueueProducers]
-type pageProjectGetResponseDeploymentConfigsPreviewQueueProducersJSON struct {
- QueueProducerBinding apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectGetResponseDeploymentConfigsPreviewQueueProducers) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectGetResponseDeploymentConfigsPreviewQueueProducersJSON) RawJSON() string {
- return r.raw
-}
-
-// Queue Producer binding.
-type PageProjectGetResponseDeploymentConfigsPreviewQueueProducersQueueProducerBinding struct {
- // Name of the Queue.
- Name string `json:"name"`
- JSON pageProjectGetResponseDeploymentConfigsPreviewQueueProducersQueueProducerBindingJSON `json:"-"`
-}
-
-// pageProjectGetResponseDeploymentConfigsPreviewQueueProducersQueueProducerBindingJSON
-// contains the JSON metadata for the struct
-// [PageProjectGetResponseDeploymentConfigsPreviewQueueProducersQueueProducerBinding]
-type pageProjectGetResponseDeploymentConfigsPreviewQueueProducersQueueProducerBindingJSON struct {
- Name apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectGetResponseDeploymentConfigsPreviewQueueProducersQueueProducerBinding) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectGetResponseDeploymentConfigsPreviewQueueProducersQueueProducerBindingJSON) RawJSON() string {
- return r.raw
-}
-
-// R2 buckets used for Pages Functions.
-type PageProjectGetResponseDeploymentConfigsPreviewR2Buckets struct {
- // R2 binding.
- R2Binding PageProjectGetResponseDeploymentConfigsPreviewR2BucketsR2Binding `json:"R2_BINDING"`
- JSON pageProjectGetResponseDeploymentConfigsPreviewR2BucketsJSON `json:"-"`
-}
-
-// pageProjectGetResponseDeploymentConfigsPreviewR2BucketsJSON contains the JSON
-// metadata for the struct
-// [PageProjectGetResponseDeploymentConfigsPreviewR2Buckets]
-type pageProjectGetResponseDeploymentConfigsPreviewR2BucketsJSON struct {
- R2Binding apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectGetResponseDeploymentConfigsPreviewR2Buckets) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectGetResponseDeploymentConfigsPreviewR2BucketsJSON) RawJSON() string {
- return r.raw
-}
-
-// R2 binding.
-type PageProjectGetResponseDeploymentConfigsPreviewR2BucketsR2Binding struct {
- // Name of the R2 bucket.
- Name string `json:"name"`
- JSON pageProjectGetResponseDeploymentConfigsPreviewR2BucketsR2BindingJSON `json:"-"`
-}
-
-// pageProjectGetResponseDeploymentConfigsPreviewR2BucketsR2BindingJSON contains
-// the JSON metadata for the struct
-// [PageProjectGetResponseDeploymentConfigsPreviewR2BucketsR2Binding]
-type pageProjectGetResponseDeploymentConfigsPreviewR2BucketsR2BindingJSON struct {
- Name apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectGetResponseDeploymentConfigsPreviewR2BucketsR2Binding) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectGetResponseDeploymentConfigsPreviewR2BucketsR2BindingJSON) RawJSON() string {
- return r.raw
-}
-
-// Services used for Pages Functions.
-type PageProjectGetResponseDeploymentConfigsPreviewServiceBindings struct {
- // Service binding.
- ServiceBinding PageProjectGetResponseDeploymentConfigsPreviewServiceBindingsServiceBinding `json:"SERVICE_BINDING"`
- JSON pageProjectGetResponseDeploymentConfigsPreviewServiceBindingsJSON `json:"-"`
-}
-
-// pageProjectGetResponseDeploymentConfigsPreviewServiceBindingsJSON contains the
-// JSON metadata for the struct
-// [PageProjectGetResponseDeploymentConfigsPreviewServiceBindings]
-type pageProjectGetResponseDeploymentConfigsPreviewServiceBindingsJSON struct {
- ServiceBinding apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectGetResponseDeploymentConfigsPreviewServiceBindings) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectGetResponseDeploymentConfigsPreviewServiceBindingsJSON) RawJSON() string {
- return r.raw
-}
-
-// Service binding.
-type PageProjectGetResponseDeploymentConfigsPreviewServiceBindingsServiceBinding struct {
- // The Service environment.
- Environment string `json:"environment"`
- // The Service name.
- Service string `json:"service"`
- JSON pageProjectGetResponseDeploymentConfigsPreviewServiceBindingsServiceBindingJSON `json:"-"`
-}
-
-// pageProjectGetResponseDeploymentConfigsPreviewServiceBindingsServiceBindingJSON
-// contains the JSON metadata for the struct
-// [PageProjectGetResponseDeploymentConfigsPreviewServiceBindingsServiceBinding]
-type pageProjectGetResponseDeploymentConfigsPreviewServiceBindingsServiceBindingJSON struct {
- Environment apijson.Field
- Service apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectGetResponseDeploymentConfigsPreviewServiceBindingsServiceBinding) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectGetResponseDeploymentConfigsPreviewServiceBindingsServiceBindingJSON) RawJSON() string {
- return r.raw
-}
-
-// Configs for production deploys.
-type PageProjectGetResponseDeploymentConfigsProduction struct {
- // Constellation bindings used for Pages Functions.
- AIBindings PageProjectGetResponseDeploymentConfigsProductionAIBindings `json:"ai_bindings,nullable"`
- // Analytics Engine bindings used for Pages Functions.
- AnalyticsEngineDatasets PageProjectGetResponseDeploymentConfigsProductionAnalyticsEngineDatasets `json:"analytics_engine_datasets,nullable"`
- // Compatibility date used for Pages Functions.
- CompatibilityDate string `json:"compatibility_date"`
- // Compatibility flags used for Pages Functions.
- CompatibilityFlags []interface{} `json:"compatibility_flags"`
- // D1 databases used for Pages Functions.
- D1Databases PageProjectGetResponseDeploymentConfigsProductionD1Databases `json:"d1_databases,nullable"`
- // Durabble Object namespaces used for Pages Functions.
- DurableObjectNamespaces PageProjectGetResponseDeploymentConfigsProductionDurableObjectNamespaces `json:"durable_object_namespaces,nullable"`
- // Environment variables for build configs.
- EnvVars PageProjectGetResponseDeploymentConfigsProductionEnvVars `json:"env_vars,nullable"`
- // KV namespaces used for Pages Functions.
- KVNamespaces PageProjectGetResponseDeploymentConfigsProductionKVNamespaces `json:"kv_namespaces"`
- // Placement setting used for Pages Functions.
- Placement PageProjectGetResponseDeploymentConfigsProductionPlacement `json:"placement,nullable"`
- // Queue Producer bindings used for Pages Functions.
- QueueProducers PageProjectGetResponseDeploymentConfigsProductionQueueProducers `json:"queue_producers,nullable"`
- // R2 buckets used for Pages Functions.
- R2Buckets PageProjectGetResponseDeploymentConfigsProductionR2Buckets `json:"r2_buckets,nullable"`
- // Services used for Pages Functions.
- ServiceBindings PageProjectGetResponseDeploymentConfigsProductionServiceBindings `json:"service_bindings,nullable"`
- JSON pageProjectGetResponseDeploymentConfigsProductionJSON `json:"-"`
-}
-
-// pageProjectGetResponseDeploymentConfigsProductionJSON contains the JSON metadata
-// for the struct [PageProjectGetResponseDeploymentConfigsProduction]
-type pageProjectGetResponseDeploymentConfigsProductionJSON struct {
- AIBindings apijson.Field
- AnalyticsEngineDatasets apijson.Field
- CompatibilityDate apijson.Field
- CompatibilityFlags apijson.Field
- D1Databases apijson.Field
- DurableObjectNamespaces apijson.Field
- EnvVars apijson.Field
- KVNamespaces apijson.Field
- Placement apijson.Field
- QueueProducers apijson.Field
- R2Buckets apijson.Field
- ServiceBindings apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectGetResponseDeploymentConfigsProduction) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectGetResponseDeploymentConfigsProductionJSON) RawJSON() string {
- return r.raw
-}
-
-// Constellation bindings used for Pages Functions.
-type PageProjectGetResponseDeploymentConfigsProductionAIBindings struct {
- // AI binding.
- AIBinding PageProjectGetResponseDeploymentConfigsProductionAIBindingsAIBinding `json:"AI_BINDING"`
- JSON pageProjectGetResponseDeploymentConfigsProductionAIBindingsJSON `json:"-"`
-}
-
-// pageProjectGetResponseDeploymentConfigsProductionAIBindingsJSON contains the
-// JSON metadata for the struct
-// [PageProjectGetResponseDeploymentConfigsProductionAIBindings]
-type pageProjectGetResponseDeploymentConfigsProductionAIBindingsJSON struct {
- AIBinding apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectGetResponseDeploymentConfigsProductionAIBindings) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectGetResponseDeploymentConfigsProductionAIBindingsJSON) RawJSON() string {
- return r.raw
-}
-
-// AI binding.
-type PageProjectGetResponseDeploymentConfigsProductionAIBindingsAIBinding struct {
- ProjectID interface{} `json:"project_id"`
- JSON pageProjectGetResponseDeploymentConfigsProductionAIBindingsAIBindingJSON `json:"-"`
-}
-
-// pageProjectGetResponseDeploymentConfigsProductionAIBindingsAIBindingJSON
-// contains the JSON metadata for the struct
-// [PageProjectGetResponseDeploymentConfigsProductionAIBindingsAIBinding]
-type pageProjectGetResponseDeploymentConfigsProductionAIBindingsAIBindingJSON struct {
- ProjectID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectGetResponseDeploymentConfigsProductionAIBindingsAIBinding) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectGetResponseDeploymentConfigsProductionAIBindingsAIBindingJSON) RawJSON() string {
- return r.raw
-}
-
-// Analytics Engine bindings used for Pages Functions.
-type PageProjectGetResponseDeploymentConfigsProductionAnalyticsEngineDatasets struct {
- // Analytics Engine binding.
- AnalyticsEngineBinding PageProjectGetResponseDeploymentConfigsProductionAnalyticsEngineDatasetsAnalyticsEngineBinding `json:"ANALYTICS_ENGINE_BINDING"`
- JSON pageProjectGetResponseDeploymentConfigsProductionAnalyticsEngineDatasetsJSON `json:"-"`
-}
-
-// pageProjectGetResponseDeploymentConfigsProductionAnalyticsEngineDatasetsJSON
-// contains the JSON metadata for the struct
-// [PageProjectGetResponseDeploymentConfigsProductionAnalyticsEngineDatasets]
-type pageProjectGetResponseDeploymentConfigsProductionAnalyticsEngineDatasetsJSON struct {
- AnalyticsEngineBinding apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectGetResponseDeploymentConfigsProductionAnalyticsEngineDatasets) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectGetResponseDeploymentConfigsProductionAnalyticsEngineDatasetsJSON) RawJSON() string {
- return r.raw
-}
-
-// Analytics Engine binding.
-type PageProjectGetResponseDeploymentConfigsProductionAnalyticsEngineDatasetsAnalyticsEngineBinding struct {
- // Name of the dataset.
- Dataset string `json:"dataset"`
- JSON pageProjectGetResponseDeploymentConfigsProductionAnalyticsEngineDatasetsAnalyticsEngineBindingJSON `json:"-"`
-}
-
-// pageProjectGetResponseDeploymentConfigsProductionAnalyticsEngineDatasetsAnalyticsEngineBindingJSON
-// contains the JSON metadata for the struct
-// [PageProjectGetResponseDeploymentConfigsProductionAnalyticsEngineDatasetsAnalyticsEngineBinding]
-type pageProjectGetResponseDeploymentConfigsProductionAnalyticsEngineDatasetsAnalyticsEngineBindingJSON struct {
- Dataset apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectGetResponseDeploymentConfigsProductionAnalyticsEngineDatasetsAnalyticsEngineBinding) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectGetResponseDeploymentConfigsProductionAnalyticsEngineDatasetsAnalyticsEngineBindingJSON) RawJSON() string {
- return r.raw
-}
-
-// D1 databases used for Pages Functions.
-type PageProjectGetResponseDeploymentConfigsProductionD1Databases struct {
- // D1 binding.
- D1Binding PageProjectGetResponseDeploymentConfigsProductionD1DatabasesD1Binding `json:"D1_BINDING"`
- JSON pageProjectGetResponseDeploymentConfigsProductionD1DatabasesJSON `json:"-"`
-}
-
-// pageProjectGetResponseDeploymentConfigsProductionD1DatabasesJSON contains the
-// JSON metadata for the struct
-// [PageProjectGetResponseDeploymentConfigsProductionD1Databases]
-type pageProjectGetResponseDeploymentConfigsProductionD1DatabasesJSON struct {
- D1Binding apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectGetResponseDeploymentConfigsProductionD1Databases) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectGetResponseDeploymentConfigsProductionD1DatabasesJSON) RawJSON() string {
- return r.raw
-}
-
-// D1 binding.
-type PageProjectGetResponseDeploymentConfigsProductionD1DatabasesD1Binding struct {
- // UUID of the D1 database.
- ID string `json:"id"`
- JSON pageProjectGetResponseDeploymentConfigsProductionD1DatabasesD1BindingJSON `json:"-"`
-}
-
-// pageProjectGetResponseDeploymentConfigsProductionD1DatabasesD1BindingJSON
-// contains the JSON metadata for the struct
-// [PageProjectGetResponseDeploymentConfigsProductionD1DatabasesD1Binding]
-type pageProjectGetResponseDeploymentConfigsProductionD1DatabasesD1BindingJSON struct {
- ID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectGetResponseDeploymentConfigsProductionD1DatabasesD1Binding) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectGetResponseDeploymentConfigsProductionD1DatabasesD1BindingJSON) RawJSON() string {
- return r.raw
-}
-
-// Durabble Object namespaces used for Pages Functions.
-type PageProjectGetResponseDeploymentConfigsProductionDurableObjectNamespaces struct {
- // Durabble Object binding.
- DoBinding PageProjectGetResponseDeploymentConfigsProductionDurableObjectNamespacesDoBinding `json:"DO_BINDING"`
- JSON pageProjectGetResponseDeploymentConfigsProductionDurableObjectNamespacesJSON `json:"-"`
-}
-
-// pageProjectGetResponseDeploymentConfigsProductionDurableObjectNamespacesJSON
-// contains the JSON metadata for the struct
-// [PageProjectGetResponseDeploymentConfigsProductionDurableObjectNamespaces]
-type pageProjectGetResponseDeploymentConfigsProductionDurableObjectNamespacesJSON struct {
- DoBinding apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectGetResponseDeploymentConfigsProductionDurableObjectNamespaces) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectGetResponseDeploymentConfigsProductionDurableObjectNamespacesJSON) RawJSON() string {
- return r.raw
-}
-
-// Durabble Object binding.
-type PageProjectGetResponseDeploymentConfigsProductionDurableObjectNamespacesDoBinding struct {
- // ID of the Durabble Object namespace.
- NamespaceID string `json:"namespace_id"`
- JSON pageProjectGetResponseDeploymentConfigsProductionDurableObjectNamespacesDoBindingJSON `json:"-"`
-}
-
-// pageProjectGetResponseDeploymentConfigsProductionDurableObjectNamespacesDoBindingJSON
-// contains the JSON metadata for the struct
-// [PageProjectGetResponseDeploymentConfigsProductionDurableObjectNamespacesDoBinding]
-type pageProjectGetResponseDeploymentConfigsProductionDurableObjectNamespacesDoBindingJSON struct {
- NamespaceID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectGetResponseDeploymentConfigsProductionDurableObjectNamespacesDoBinding) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectGetResponseDeploymentConfigsProductionDurableObjectNamespacesDoBindingJSON) RawJSON() string {
- return r.raw
-}
-
-// Environment variables for build configs.
-type PageProjectGetResponseDeploymentConfigsProductionEnvVars struct {
- // Environment variable.
- EnvironmentVariable PageProjectGetResponseDeploymentConfigsProductionEnvVarsEnvironmentVariable `json:"ENVIRONMENT_VARIABLE"`
- JSON pageProjectGetResponseDeploymentConfigsProductionEnvVarsJSON `json:"-"`
-}
-
-// pageProjectGetResponseDeploymentConfigsProductionEnvVarsJSON contains the JSON
-// metadata for the struct
-// [PageProjectGetResponseDeploymentConfigsProductionEnvVars]
-type pageProjectGetResponseDeploymentConfigsProductionEnvVarsJSON struct {
- EnvironmentVariable apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectGetResponseDeploymentConfigsProductionEnvVars) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectGetResponseDeploymentConfigsProductionEnvVarsJSON) RawJSON() string {
- return r.raw
-}
-
-// Environment variable.
-type PageProjectGetResponseDeploymentConfigsProductionEnvVarsEnvironmentVariable struct {
- // The type of environment variable (plain text or secret)
- Type PageProjectGetResponseDeploymentConfigsProductionEnvVarsEnvironmentVariableType `json:"type"`
- // Environment variable value.
- Value string `json:"value"`
- JSON pageProjectGetResponseDeploymentConfigsProductionEnvVarsEnvironmentVariableJSON `json:"-"`
-}
-
-// pageProjectGetResponseDeploymentConfigsProductionEnvVarsEnvironmentVariableJSON
-// contains the JSON metadata for the struct
-// [PageProjectGetResponseDeploymentConfigsProductionEnvVarsEnvironmentVariable]
-type pageProjectGetResponseDeploymentConfigsProductionEnvVarsEnvironmentVariableJSON struct {
- Type apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectGetResponseDeploymentConfigsProductionEnvVarsEnvironmentVariable) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectGetResponseDeploymentConfigsProductionEnvVarsEnvironmentVariableJSON) RawJSON() string {
- return r.raw
-}
-
-// The type of environment variable (plain text or secret)
-type PageProjectGetResponseDeploymentConfigsProductionEnvVarsEnvironmentVariableType string
-
-const (
- PageProjectGetResponseDeploymentConfigsProductionEnvVarsEnvironmentVariableTypePlainText PageProjectGetResponseDeploymentConfigsProductionEnvVarsEnvironmentVariableType = "plain_text"
- PageProjectGetResponseDeploymentConfigsProductionEnvVarsEnvironmentVariableTypeSecretText PageProjectGetResponseDeploymentConfigsProductionEnvVarsEnvironmentVariableType = "secret_text"
-)
-
-// KV namespaces used for Pages Functions.
-type PageProjectGetResponseDeploymentConfigsProductionKVNamespaces struct {
- // KV binding.
- KVBinding PageProjectGetResponseDeploymentConfigsProductionKVNamespacesKVBinding `json:"KV_BINDING"`
- JSON pageProjectGetResponseDeploymentConfigsProductionKVNamespacesJSON `json:"-"`
-}
-
-// pageProjectGetResponseDeploymentConfigsProductionKVNamespacesJSON contains the
-// JSON metadata for the struct
-// [PageProjectGetResponseDeploymentConfigsProductionKVNamespaces]
-type pageProjectGetResponseDeploymentConfigsProductionKVNamespacesJSON struct {
- KVBinding apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectGetResponseDeploymentConfigsProductionKVNamespaces) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectGetResponseDeploymentConfigsProductionKVNamespacesJSON) RawJSON() string {
- return r.raw
-}
-
-// KV binding.
-type PageProjectGetResponseDeploymentConfigsProductionKVNamespacesKVBinding struct {
- // ID of the KV namespace.
- NamespaceID string `json:"namespace_id"`
- JSON pageProjectGetResponseDeploymentConfigsProductionKVNamespacesKVBindingJSON `json:"-"`
-}
-
-// pageProjectGetResponseDeploymentConfigsProductionKVNamespacesKVBindingJSON
-// contains the JSON metadata for the struct
-// [PageProjectGetResponseDeploymentConfigsProductionKVNamespacesKVBinding]
-type pageProjectGetResponseDeploymentConfigsProductionKVNamespacesKVBindingJSON struct {
- NamespaceID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectGetResponseDeploymentConfigsProductionKVNamespacesKVBinding) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectGetResponseDeploymentConfigsProductionKVNamespacesKVBindingJSON) RawJSON() string {
- return r.raw
-}
-
-// Placement setting used for Pages Functions.
-type PageProjectGetResponseDeploymentConfigsProductionPlacement struct {
- // Placement mode.
- Mode string `json:"mode"`
- JSON pageProjectGetResponseDeploymentConfigsProductionPlacementJSON `json:"-"`
-}
-
-// pageProjectGetResponseDeploymentConfigsProductionPlacementJSON contains the JSON
-// metadata for the struct
-// [PageProjectGetResponseDeploymentConfigsProductionPlacement]
-type pageProjectGetResponseDeploymentConfigsProductionPlacementJSON struct {
- Mode apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectGetResponseDeploymentConfigsProductionPlacement) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectGetResponseDeploymentConfigsProductionPlacementJSON) RawJSON() string {
- return r.raw
-}
-
-// Queue Producer bindings used for Pages Functions.
-type PageProjectGetResponseDeploymentConfigsProductionQueueProducers struct {
- // Queue Producer binding.
- QueueProducerBinding PageProjectGetResponseDeploymentConfigsProductionQueueProducersQueueProducerBinding `json:"QUEUE_PRODUCER_BINDING"`
- JSON pageProjectGetResponseDeploymentConfigsProductionQueueProducersJSON `json:"-"`
-}
-
-// pageProjectGetResponseDeploymentConfigsProductionQueueProducersJSON contains the
-// JSON metadata for the struct
-// [PageProjectGetResponseDeploymentConfigsProductionQueueProducers]
-type pageProjectGetResponseDeploymentConfigsProductionQueueProducersJSON struct {
- QueueProducerBinding apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectGetResponseDeploymentConfigsProductionQueueProducers) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectGetResponseDeploymentConfigsProductionQueueProducersJSON) RawJSON() string {
- return r.raw
-}
-
-// Queue Producer binding.
-type PageProjectGetResponseDeploymentConfigsProductionQueueProducersQueueProducerBinding struct {
- // Name of the Queue.
- Name string `json:"name"`
- JSON pageProjectGetResponseDeploymentConfigsProductionQueueProducersQueueProducerBindingJSON `json:"-"`
-}
-
-// pageProjectGetResponseDeploymentConfigsProductionQueueProducersQueueProducerBindingJSON
-// contains the JSON metadata for the struct
-// [PageProjectGetResponseDeploymentConfigsProductionQueueProducersQueueProducerBinding]
-type pageProjectGetResponseDeploymentConfigsProductionQueueProducersQueueProducerBindingJSON struct {
- Name apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectGetResponseDeploymentConfigsProductionQueueProducersQueueProducerBinding) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectGetResponseDeploymentConfigsProductionQueueProducersQueueProducerBindingJSON) RawJSON() string {
- return r.raw
-}
-
-// R2 buckets used for Pages Functions.
-type PageProjectGetResponseDeploymentConfigsProductionR2Buckets struct {
- // R2 binding.
- R2Binding PageProjectGetResponseDeploymentConfigsProductionR2BucketsR2Binding `json:"R2_BINDING"`
- JSON pageProjectGetResponseDeploymentConfigsProductionR2BucketsJSON `json:"-"`
-}
-
-// pageProjectGetResponseDeploymentConfigsProductionR2BucketsJSON contains the JSON
-// metadata for the struct
-// [PageProjectGetResponseDeploymentConfigsProductionR2Buckets]
-type pageProjectGetResponseDeploymentConfigsProductionR2BucketsJSON struct {
- R2Binding apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectGetResponseDeploymentConfigsProductionR2Buckets) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectGetResponseDeploymentConfigsProductionR2BucketsJSON) RawJSON() string {
- return r.raw
-}
-
-// R2 binding.
-type PageProjectGetResponseDeploymentConfigsProductionR2BucketsR2Binding struct {
- // Name of the R2 bucket.
- Name string `json:"name"`
- JSON pageProjectGetResponseDeploymentConfigsProductionR2BucketsR2BindingJSON `json:"-"`
-}
-
-// pageProjectGetResponseDeploymentConfigsProductionR2BucketsR2BindingJSON contains
-// the JSON metadata for the struct
-// [PageProjectGetResponseDeploymentConfigsProductionR2BucketsR2Binding]
-type pageProjectGetResponseDeploymentConfigsProductionR2BucketsR2BindingJSON struct {
- Name apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectGetResponseDeploymentConfigsProductionR2BucketsR2Binding) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectGetResponseDeploymentConfigsProductionR2BucketsR2BindingJSON) RawJSON() string {
- return r.raw
-}
-
-// Services used for Pages Functions.
-type PageProjectGetResponseDeploymentConfigsProductionServiceBindings struct {
- // Service binding.
- ServiceBinding PageProjectGetResponseDeploymentConfigsProductionServiceBindingsServiceBinding `json:"SERVICE_BINDING"`
- JSON pageProjectGetResponseDeploymentConfigsProductionServiceBindingsJSON `json:"-"`
-}
-
-// pageProjectGetResponseDeploymentConfigsProductionServiceBindingsJSON contains
-// the JSON metadata for the struct
-// [PageProjectGetResponseDeploymentConfigsProductionServiceBindings]
-type pageProjectGetResponseDeploymentConfigsProductionServiceBindingsJSON struct {
- ServiceBinding apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectGetResponseDeploymentConfigsProductionServiceBindings) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectGetResponseDeploymentConfigsProductionServiceBindingsJSON) RawJSON() string {
- return r.raw
-}
-
-// Service binding.
-type PageProjectGetResponseDeploymentConfigsProductionServiceBindingsServiceBinding struct {
- // The Service environment.
- Environment string `json:"environment"`
- // The Service name.
- Service string `json:"service"`
- JSON pageProjectGetResponseDeploymentConfigsProductionServiceBindingsServiceBindingJSON `json:"-"`
-}
-
-// pageProjectGetResponseDeploymentConfigsProductionServiceBindingsServiceBindingJSON
-// contains the JSON metadata for the struct
-// [PageProjectGetResponseDeploymentConfigsProductionServiceBindingsServiceBinding]
-type pageProjectGetResponseDeploymentConfigsProductionServiceBindingsServiceBindingJSON struct {
- Environment apijson.Field
- Service apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectGetResponseDeploymentConfigsProductionServiceBindingsServiceBinding) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectGetResponseDeploymentConfigsProductionServiceBindingsServiceBindingJSON) RawJSON() string {
- return r.raw
-}
-
-type PageProjectGetResponseLatestDeployment struct {
- // Id of the deployment.
- ID string `json:"id"`
- // A list of alias URLs pointing to this deployment.
- Aliases []interface{} `json:"aliases,nullable"`
- BuildConfig interface{} `json:"build_config"`
- // When the deployment was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Info about what caused the deployment.
- DeploymentTrigger PageProjectGetResponseLatestDeploymentDeploymentTrigger `json:"deployment_trigger"`
- // A dict of env variables to build this deploy.
- EnvVars interface{} `json:"env_vars"`
- // Type of deploy.
- Environment string `json:"environment"`
- // If the deployment has been skipped.
- IsSkipped bool `json:"is_skipped"`
- LatestStage interface{} `json:"latest_stage"`
- // When the deployment was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Id of the project.
- ProjectID string `json:"project_id"`
- // Name of the project.
- ProjectName string `json:"project_name"`
- // Short Id (8 character) of the deployment.
- ShortID string `json:"short_id"`
- Source interface{} `json:"source"`
- // List of past stages.
- Stages []PageProjectGetResponseLatestDeploymentStage `json:"stages"`
- // The live URL to view this deployment.
- URL string `json:"url"`
- JSON pageProjectGetResponseLatestDeploymentJSON `json:"-"`
-}
-
-// pageProjectGetResponseLatestDeploymentJSON contains the JSON metadata for the
-// struct [PageProjectGetResponseLatestDeployment]
-type pageProjectGetResponseLatestDeploymentJSON struct {
- ID apijson.Field
- Aliases apijson.Field
- BuildConfig apijson.Field
- CreatedOn apijson.Field
- DeploymentTrigger apijson.Field
- EnvVars apijson.Field
- Environment apijson.Field
- IsSkipped apijson.Field
- LatestStage apijson.Field
- ModifiedOn apijson.Field
- ProjectID apijson.Field
- ProjectName apijson.Field
- ShortID apijson.Field
- Source apijson.Field
- Stages apijson.Field
- URL apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectGetResponseLatestDeployment) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectGetResponseLatestDeploymentJSON) RawJSON() string {
- return r.raw
-}
-
-// Info about what caused the deployment.
-type PageProjectGetResponseLatestDeploymentDeploymentTrigger struct {
- // Additional info about the trigger.
- Metadata PageProjectGetResponseLatestDeploymentDeploymentTriggerMetadata `json:"metadata"`
- // What caused the deployment.
- Type string `json:"type"`
- JSON pageProjectGetResponseLatestDeploymentDeploymentTriggerJSON `json:"-"`
-}
-
-// pageProjectGetResponseLatestDeploymentDeploymentTriggerJSON contains the JSON
-// metadata for the struct
-// [PageProjectGetResponseLatestDeploymentDeploymentTrigger]
-type pageProjectGetResponseLatestDeploymentDeploymentTriggerJSON struct {
- Metadata apijson.Field
- Type apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectGetResponseLatestDeploymentDeploymentTrigger) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectGetResponseLatestDeploymentDeploymentTriggerJSON) RawJSON() string {
- return r.raw
-}
-
-// Additional info about the trigger.
-type PageProjectGetResponseLatestDeploymentDeploymentTriggerMetadata struct {
- // Where the trigger happened.
- Branch string `json:"branch"`
- // Hash of the deployment trigger commit.
- CommitHash string `json:"commit_hash"`
- // Message of the deployment trigger commit.
- CommitMessage string `json:"commit_message"`
- JSON pageProjectGetResponseLatestDeploymentDeploymentTriggerMetadataJSON `json:"-"`
-}
-
-// pageProjectGetResponseLatestDeploymentDeploymentTriggerMetadataJSON contains the
-// JSON metadata for the struct
-// [PageProjectGetResponseLatestDeploymentDeploymentTriggerMetadata]
-type pageProjectGetResponseLatestDeploymentDeploymentTriggerMetadataJSON struct {
- Branch apijson.Field
- CommitHash apijson.Field
- CommitMessage apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectGetResponseLatestDeploymentDeploymentTriggerMetadata) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectGetResponseLatestDeploymentDeploymentTriggerMetadataJSON) RawJSON() string {
- return r.raw
-}
-
-// The status of the deployment.
-type PageProjectGetResponseLatestDeploymentStage struct {
- // When the stage ended.
- EndedOn time.Time `json:"ended_on,nullable" format:"date-time"`
- // The current build stage.
- Name string `json:"name"`
- // When the stage started.
- StartedOn time.Time `json:"started_on,nullable" format:"date-time"`
- // State of the current stage.
- Status string `json:"status"`
- JSON pageProjectGetResponseLatestDeploymentStageJSON `json:"-"`
-}
-
-// pageProjectGetResponseLatestDeploymentStageJSON contains the JSON metadata for
-// the struct [PageProjectGetResponseLatestDeploymentStage]
-type pageProjectGetResponseLatestDeploymentStageJSON struct {
- EndedOn apijson.Field
- Name apijson.Field
- StartedOn apijson.Field
- Status apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectGetResponseLatestDeploymentStage) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectGetResponseLatestDeploymentStageJSON) RawJSON() string {
- return r.raw
-}
-
-type PageProjectPurgeBuildCacheResponse = interface{}
-
-type PageProjectNewParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
- // Configs for the project build process.
- BuildConfig param.Field[PageProjectNewParamsBuildConfig] `json:"build_config"`
- CanonicalDeployment param.Field[PageProjectNewParamsCanonicalDeployment] `json:"canonical_deployment"`
- // Configs for deployments in a project.
- DeploymentConfigs param.Field[PageProjectNewParamsDeploymentConfigs] `json:"deployment_configs"`
- LatestDeployment param.Field[PageProjectNewParamsLatestDeployment] `json:"latest_deployment"`
- // Name of the project.
- Name param.Field[string] `json:"name"`
- // Production branch of the project. Used to identify production deployments.
- ProductionBranch param.Field[string] `json:"production_branch"`
-}
-
-func (r PageProjectNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Configs for the project build process.
-type PageProjectNewParamsBuildConfig struct {
- // Enable build caching for the project.
- BuildCaching param.Field[bool] `json:"build_caching"`
- // Command used to build project.
- BuildCommand param.Field[string] `json:"build_command"`
- // Output directory of the build.
- DestinationDir param.Field[string] `json:"destination_dir"`
- // Directory to run the command.
- RootDir param.Field[string] `json:"root_dir"`
- // The classifying tag for analytics.
- WebAnalyticsTag param.Field[string] `json:"web_analytics_tag"`
- // The auth token for analytics.
- WebAnalyticsToken param.Field[string] `json:"web_analytics_token"`
-}
-
-func (r PageProjectNewParamsBuildConfig) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type PageProjectNewParamsCanonicalDeployment struct {
-}
-
-func (r PageProjectNewParamsCanonicalDeployment) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Info about what caused the deployment.
-type PageProjectNewParamsCanonicalDeploymentDeploymentTrigger struct {
- // Additional info about the trigger.
- Metadata param.Field[PageProjectNewParamsCanonicalDeploymentDeploymentTriggerMetadata] `json:"metadata"`
-}
-
-func (r PageProjectNewParamsCanonicalDeploymentDeploymentTrigger) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Additional info about the trigger.
-type PageProjectNewParamsCanonicalDeploymentDeploymentTriggerMetadata struct {
-}
-
-func (r PageProjectNewParamsCanonicalDeploymentDeploymentTriggerMetadata) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The status of the deployment.
-type PageProjectNewParamsCanonicalDeploymentStage struct {
- // The current build stage.
- Name param.Field[string] `json:"name"`
-}
-
-func (r PageProjectNewParamsCanonicalDeploymentStage) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Configs for deployments in a project.
-type PageProjectNewParamsDeploymentConfigs struct {
- // Configs for preview deploys.
- Preview param.Field[PageProjectNewParamsDeploymentConfigsPreview] `json:"preview"`
- // Configs for production deploys.
- Production param.Field[PageProjectNewParamsDeploymentConfigsProduction] `json:"production"`
-}
-
-func (r PageProjectNewParamsDeploymentConfigs) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Configs for preview deploys.
-type PageProjectNewParamsDeploymentConfigsPreview struct {
- // Constellation bindings used for Pages Functions.
- AIBindings param.Field[PageProjectNewParamsDeploymentConfigsPreviewAIBindings] `json:"ai_bindings"`
- // Analytics Engine bindings used for Pages Functions.
- AnalyticsEngineDatasets param.Field[PageProjectNewParamsDeploymentConfigsPreviewAnalyticsEngineDatasets] `json:"analytics_engine_datasets"`
- // Compatibility date used for Pages Functions.
- CompatibilityDate param.Field[string] `json:"compatibility_date"`
- // Compatibility flags used for Pages Functions.
- CompatibilityFlags param.Field[[]interface{}] `json:"compatibility_flags"`
- // D1 databases used for Pages Functions.
- D1Databases param.Field[PageProjectNewParamsDeploymentConfigsPreviewD1Databases] `json:"d1_databases"`
- // Durabble Object namespaces used for Pages Functions.
- DurableObjectNamespaces param.Field[PageProjectNewParamsDeploymentConfigsPreviewDurableObjectNamespaces] `json:"durable_object_namespaces"`
- // Environment variables for build configs.
- EnvVars param.Field[PageProjectNewParamsDeploymentConfigsPreviewEnvVars] `json:"env_vars"`
- // KV namespaces used for Pages Functions.
- KVNamespaces param.Field[PageProjectNewParamsDeploymentConfigsPreviewKVNamespaces] `json:"kv_namespaces"`
- // Placement setting used for Pages Functions.
- Placement param.Field[PageProjectNewParamsDeploymentConfigsPreviewPlacement] `json:"placement"`
- // Queue Producer bindings used for Pages Functions.
- QueueProducers param.Field[PageProjectNewParamsDeploymentConfigsPreviewQueueProducers] `json:"queue_producers"`
- // R2 buckets used for Pages Functions.
- R2Buckets param.Field[PageProjectNewParamsDeploymentConfigsPreviewR2Buckets] `json:"r2_buckets"`
- // Services used for Pages Functions.
- ServiceBindings param.Field[PageProjectNewParamsDeploymentConfigsPreviewServiceBindings] `json:"service_bindings"`
-}
-
-func (r PageProjectNewParamsDeploymentConfigsPreview) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Constellation bindings used for Pages Functions.
-type PageProjectNewParamsDeploymentConfigsPreviewAIBindings struct {
- // AI binding.
- AIBinding param.Field[PageProjectNewParamsDeploymentConfigsPreviewAIBindingsAIBinding] `json:"AI_BINDING"`
-}
-
-func (r PageProjectNewParamsDeploymentConfigsPreviewAIBindings) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// AI binding.
-type PageProjectNewParamsDeploymentConfigsPreviewAIBindingsAIBinding struct {
- ProjectID param.Field[interface{}] `json:"project_id"`
-}
-
-func (r PageProjectNewParamsDeploymentConfigsPreviewAIBindingsAIBinding) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Analytics Engine bindings used for Pages Functions.
-type PageProjectNewParamsDeploymentConfigsPreviewAnalyticsEngineDatasets struct {
- // Analytics Engine binding.
- AnalyticsEngineBinding param.Field[PageProjectNewParamsDeploymentConfigsPreviewAnalyticsEngineDatasetsAnalyticsEngineBinding] `json:"ANALYTICS_ENGINE_BINDING"`
-}
-
-func (r PageProjectNewParamsDeploymentConfigsPreviewAnalyticsEngineDatasets) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Analytics Engine binding.
-type PageProjectNewParamsDeploymentConfigsPreviewAnalyticsEngineDatasetsAnalyticsEngineBinding struct {
- // Name of the dataset.
- Dataset param.Field[string] `json:"dataset"`
-}
-
-func (r PageProjectNewParamsDeploymentConfigsPreviewAnalyticsEngineDatasetsAnalyticsEngineBinding) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// D1 databases used for Pages Functions.
-type PageProjectNewParamsDeploymentConfigsPreviewD1Databases struct {
- // D1 binding.
- D1Binding param.Field[PageProjectNewParamsDeploymentConfigsPreviewD1DatabasesD1Binding] `json:"D1_BINDING"`
-}
-
-func (r PageProjectNewParamsDeploymentConfigsPreviewD1Databases) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// D1 binding.
-type PageProjectNewParamsDeploymentConfigsPreviewD1DatabasesD1Binding struct {
- // UUID of the D1 database.
- ID param.Field[string] `json:"id"`
-}
-
-func (r PageProjectNewParamsDeploymentConfigsPreviewD1DatabasesD1Binding) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Durabble Object namespaces used for Pages Functions.
-type PageProjectNewParamsDeploymentConfigsPreviewDurableObjectNamespaces struct {
- // Durabble Object binding.
- DoBinding param.Field[PageProjectNewParamsDeploymentConfigsPreviewDurableObjectNamespacesDoBinding] `json:"DO_BINDING"`
-}
-
-func (r PageProjectNewParamsDeploymentConfigsPreviewDurableObjectNamespaces) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Durabble Object binding.
-type PageProjectNewParamsDeploymentConfigsPreviewDurableObjectNamespacesDoBinding struct {
- // ID of the Durabble Object namespace.
- NamespaceID param.Field[string] `json:"namespace_id"`
-}
-
-func (r PageProjectNewParamsDeploymentConfigsPreviewDurableObjectNamespacesDoBinding) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Environment variables for build configs.
-type PageProjectNewParamsDeploymentConfigsPreviewEnvVars struct {
- // Environment variable.
- EnvironmentVariable param.Field[PageProjectNewParamsDeploymentConfigsPreviewEnvVarsEnvironmentVariable] `json:"ENVIRONMENT_VARIABLE"`
-}
-
-func (r PageProjectNewParamsDeploymentConfigsPreviewEnvVars) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Environment variable.
-type PageProjectNewParamsDeploymentConfigsPreviewEnvVarsEnvironmentVariable struct {
- // The type of environment variable (plain text or secret)
- Type param.Field[PageProjectNewParamsDeploymentConfigsPreviewEnvVarsEnvironmentVariableType] `json:"type"`
- // Environment variable value.
- Value param.Field[string] `json:"value"`
-}
-
-func (r PageProjectNewParamsDeploymentConfigsPreviewEnvVarsEnvironmentVariable) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The type of environment variable (plain text or secret)
-type PageProjectNewParamsDeploymentConfigsPreviewEnvVarsEnvironmentVariableType string
-
-const (
- PageProjectNewParamsDeploymentConfigsPreviewEnvVarsEnvironmentVariableTypePlainText PageProjectNewParamsDeploymentConfigsPreviewEnvVarsEnvironmentVariableType = "plain_text"
- PageProjectNewParamsDeploymentConfigsPreviewEnvVarsEnvironmentVariableTypeSecretText PageProjectNewParamsDeploymentConfigsPreviewEnvVarsEnvironmentVariableType = "secret_text"
-)
-
-// KV namespaces used for Pages Functions.
-type PageProjectNewParamsDeploymentConfigsPreviewKVNamespaces struct {
- // KV binding.
- KVBinding param.Field[PageProjectNewParamsDeploymentConfigsPreviewKVNamespacesKVBinding] `json:"KV_BINDING"`
-}
-
-func (r PageProjectNewParamsDeploymentConfigsPreviewKVNamespaces) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// KV binding.
-type PageProjectNewParamsDeploymentConfigsPreviewKVNamespacesKVBinding struct {
- // ID of the KV namespace.
- NamespaceID param.Field[string] `json:"namespace_id"`
-}
-
-func (r PageProjectNewParamsDeploymentConfigsPreviewKVNamespacesKVBinding) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Placement setting used for Pages Functions.
-type PageProjectNewParamsDeploymentConfigsPreviewPlacement struct {
- // Placement mode.
- Mode param.Field[string] `json:"mode"`
-}
-
-func (r PageProjectNewParamsDeploymentConfigsPreviewPlacement) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Queue Producer bindings used for Pages Functions.
-type PageProjectNewParamsDeploymentConfigsPreviewQueueProducers struct {
- // Queue Producer binding.
- QueueProducerBinding param.Field[PageProjectNewParamsDeploymentConfigsPreviewQueueProducersQueueProducerBinding] `json:"QUEUE_PRODUCER_BINDING"`
-}
-
-func (r PageProjectNewParamsDeploymentConfigsPreviewQueueProducers) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Queue Producer binding.
-type PageProjectNewParamsDeploymentConfigsPreviewQueueProducersQueueProducerBinding struct {
- // Name of the Queue.
- Name param.Field[string] `json:"name"`
-}
-
-func (r PageProjectNewParamsDeploymentConfigsPreviewQueueProducersQueueProducerBinding) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// R2 buckets used for Pages Functions.
-type PageProjectNewParamsDeploymentConfigsPreviewR2Buckets struct {
- // R2 binding.
- R2Binding param.Field[PageProjectNewParamsDeploymentConfigsPreviewR2BucketsR2Binding] `json:"R2_BINDING"`
-}
-
-func (r PageProjectNewParamsDeploymentConfigsPreviewR2Buckets) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// R2 binding.
-type PageProjectNewParamsDeploymentConfigsPreviewR2BucketsR2Binding struct {
- // Name of the R2 bucket.
- Name param.Field[string] `json:"name"`
-}
-
-func (r PageProjectNewParamsDeploymentConfigsPreviewR2BucketsR2Binding) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Services used for Pages Functions.
-type PageProjectNewParamsDeploymentConfigsPreviewServiceBindings struct {
- // Service binding.
- ServiceBinding param.Field[PageProjectNewParamsDeploymentConfigsPreviewServiceBindingsServiceBinding] `json:"SERVICE_BINDING"`
-}
-
-func (r PageProjectNewParamsDeploymentConfigsPreviewServiceBindings) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Service binding.
-type PageProjectNewParamsDeploymentConfigsPreviewServiceBindingsServiceBinding struct {
- // The Service environment.
- Environment param.Field[string] `json:"environment"`
- // The Service name.
- Service param.Field[string] `json:"service"`
-}
-
-func (r PageProjectNewParamsDeploymentConfigsPreviewServiceBindingsServiceBinding) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Configs for production deploys.
-type PageProjectNewParamsDeploymentConfigsProduction struct {
- // Constellation bindings used for Pages Functions.
- AIBindings param.Field[PageProjectNewParamsDeploymentConfigsProductionAIBindings] `json:"ai_bindings"`
- // Analytics Engine bindings used for Pages Functions.
- AnalyticsEngineDatasets param.Field[PageProjectNewParamsDeploymentConfigsProductionAnalyticsEngineDatasets] `json:"analytics_engine_datasets"`
- // Compatibility date used for Pages Functions.
- CompatibilityDate param.Field[string] `json:"compatibility_date"`
- // Compatibility flags used for Pages Functions.
- CompatibilityFlags param.Field[[]interface{}] `json:"compatibility_flags"`
- // D1 databases used for Pages Functions.
- D1Databases param.Field[PageProjectNewParamsDeploymentConfigsProductionD1Databases] `json:"d1_databases"`
- // Durabble Object namespaces used for Pages Functions.
- DurableObjectNamespaces param.Field[PageProjectNewParamsDeploymentConfigsProductionDurableObjectNamespaces] `json:"durable_object_namespaces"`
- // Environment variables for build configs.
- EnvVars param.Field[PageProjectNewParamsDeploymentConfigsProductionEnvVars] `json:"env_vars"`
- // KV namespaces used for Pages Functions.
- KVNamespaces param.Field[PageProjectNewParamsDeploymentConfigsProductionKVNamespaces] `json:"kv_namespaces"`
- // Placement setting used for Pages Functions.
- Placement param.Field[PageProjectNewParamsDeploymentConfigsProductionPlacement] `json:"placement"`
- // Queue Producer bindings used for Pages Functions.
- QueueProducers param.Field[PageProjectNewParamsDeploymentConfigsProductionQueueProducers] `json:"queue_producers"`
- // R2 buckets used for Pages Functions.
- R2Buckets param.Field[PageProjectNewParamsDeploymentConfigsProductionR2Buckets] `json:"r2_buckets"`
- // Services used for Pages Functions.
- ServiceBindings param.Field[PageProjectNewParamsDeploymentConfigsProductionServiceBindings] `json:"service_bindings"`
-}
-
-func (r PageProjectNewParamsDeploymentConfigsProduction) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Constellation bindings used for Pages Functions.
-type PageProjectNewParamsDeploymentConfigsProductionAIBindings struct {
- // AI binding.
- AIBinding param.Field[PageProjectNewParamsDeploymentConfigsProductionAIBindingsAIBinding] `json:"AI_BINDING"`
-}
-
-func (r PageProjectNewParamsDeploymentConfigsProductionAIBindings) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// AI binding.
-type PageProjectNewParamsDeploymentConfigsProductionAIBindingsAIBinding struct {
- ProjectID param.Field[interface{}] `json:"project_id"`
-}
-
-func (r PageProjectNewParamsDeploymentConfigsProductionAIBindingsAIBinding) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Analytics Engine bindings used for Pages Functions.
-type PageProjectNewParamsDeploymentConfigsProductionAnalyticsEngineDatasets struct {
- // Analytics Engine binding.
- AnalyticsEngineBinding param.Field[PageProjectNewParamsDeploymentConfigsProductionAnalyticsEngineDatasetsAnalyticsEngineBinding] `json:"ANALYTICS_ENGINE_BINDING"`
-}
-
-func (r PageProjectNewParamsDeploymentConfigsProductionAnalyticsEngineDatasets) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Analytics Engine binding.
-type PageProjectNewParamsDeploymentConfigsProductionAnalyticsEngineDatasetsAnalyticsEngineBinding struct {
- // Name of the dataset.
- Dataset param.Field[string] `json:"dataset"`
-}
-
-func (r PageProjectNewParamsDeploymentConfigsProductionAnalyticsEngineDatasetsAnalyticsEngineBinding) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// D1 databases used for Pages Functions.
-type PageProjectNewParamsDeploymentConfigsProductionD1Databases struct {
- // D1 binding.
- D1Binding param.Field[PageProjectNewParamsDeploymentConfigsProductionD1DatabasesD1Binding] `json:"D1_BINDING"`
-}
-
-func (r PageProjectNewParamsDeploymentConfigsProductionD1Databases) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// D1 binding.
-type PageProjectNewParamsDeploymentConfigsProductionD1DatabasesD1Binding struct {
- // UUID of the D1 database.
- ID param.Field[string] `json:"id"`
-}
-
-func (r PageProjectNewParamsDeploymentConfigsProductionD1DatabasesD1Binding) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Durabble Object namespaces used for Pages Functions.
-type PageProjectNewParamsDeploymentConfigsProductionDurableObjectNamespaces struct {
- // Durabble Object binding.
- DoBinding param.Field[PageProjectNewParamsDeploymentConfigsProductionDurableObjectNamespacesDoBinding] `json:"DO_BINDING"`
-}
-
-func (r PageProjectNewParamsDeploymentConfigsProductionDurableObjectNamespaces) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Durabble Object binding.
-type PageProjectNewParamsDeploymentConfigsProductionDurableObjectNamespacesDoBinding struct {
- // ID of the Durabble Object namespace.
- NamespaceID param.Field[string] `json:"namespace_id"`
-}
-
-func (r PageProjectNewParamsDeploymentConfigsProductionDurableObjectNamespacesDoBinding) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Environment variables for build configs.
-type PageProjectNewParamsDeploymentConfigsProductionEnvVars struct {
- // Environment variable.
- EnvironmentVariable param.Field[PageProjectNewParamsDeploymentConfigsProductionEnvVarsEnvironmentVariable] `json:"ENVIRONMENT_VARIABLE"`
-}
-
-func (r PageProjectNewParamsDeploymentConfigsProductionEnvVars) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Environment variable.
-type PageProjectNewParamsDeploymentConfigsProductionEnvVarsEnvironmentVariable struct {
- // The type of environment variable (plain text or secret)
- Type param.Field[PageProjectNewParamsDeploymentConfigsProductionEnvVarsEnvironmentVariableType] `json:"type"`
- // Environment variable value.
- Value param.Field[string] `json:"value"`
-}
-
-func (r PageProjectNewParamsDeploymentConfigsProductionEnvVarsEnvironmentVariable) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The type of environment variable (plain text or secret)
-type PageProjectNewParamsDeploymentConfigsProductionEnvVarsEnvironmentVariableType string
-
-const (
- PageProjectNewParamsDeploymentConfigsProductionEnvVarsEnvironmentVariableTypePlainText PageProjectNewParamsDeploymentConfigsProductionEnvVarsEnvironmentVariableType = "plain_text"
- PageProjectNewParamsDeploymentConfigsProductionEnvVarsEnvironmentVariableTypeSecretText PageProjectNewParamsDeploymentConfigsProductionEnvVarsEnvironmentVariableType = "secret_text"
-)
-
-// KV namespaces used for Pages Functions.
-type PageProjectNewParamsDeploymentConfigsProductionKVNamespaces struct {
- // KV binding.
- KVBinding param.Field[PageProjectNewParamsDeploymentConfigsProductionKVNamespacesKVBinding] `json:"KV_BINDING"`
-}
-
-func (r PageProjectNewParamsDeploymentConfigsProductionKVNamespaces) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// KV binding.
-type PageProjectNewParamsDeploymentConfigsProductionKVNamespacesKVBinding struct {
- // ID of the KV namespace.
- NamespaceID param.Field[string] `json:"namespace_id"`
-}
-
-func (r PageProjectNewParamsDeploymentConfigsProductionKVNamespacesKVBinding) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Placement setting used for Pages Functions.
-type PageProjectNewParamsDeploymentConfigsProductionPlacement struct {
- // Placement mode.
- Mode param.Field[string] `json:"mode"`
-}
-
-func (r PageProjectNewParamsDeploymentConfigsProductionPlacement) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Queue Producer bindings used for Pages Functions.
-type PageProjectNewParamsDeploymentConfigsProductionQueueProducers struct {
- // Queue Producer binding.
- QueueProducerBinding param.Field[PageProjectNewParamsDeploymentConfigsProductionQueueProducersQueueProducerBinding] `json:"QUEUE_PRODUCER_BINDING"`
-}
-
-func (r PageProjectNewParamsDeploymentConfigsProductionQueueProducers) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Queue Producer binding.
-type PageProjectNewParamsDeploymentConfigsProductionQueueProducersQueueProducerBinding struct {
- // Name of the Queue.
- Name param.Field[string] `json:"name"`
-}
-
-func (r PageProjectNewParamsDeploymentConfigsProductionQueueProducersQueueProducerBinding) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// R2 buckets used for Pages Functions.
-type PageProjectNewParamsDeploymentConfigsProductionR2Buckets struct {
- // R2 binding.
- R2Binding param.Field[PageProjectNewParamsDeploymentConfigsProductionR2BucketsR2Binding] `json:"R2_BINDING"`
-}
-
-func (r PageProjectNewParamsDeploymentConfigsProductionR2Buckets) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// R2 binding.
-type PageProjectNewParamsDeploymentConfigsProductionR2BucketsR2Binding struct {
- // Name of the R2 bucket.
- Name param.Field[string] `json:"name"`
-}
-
-func (r PageProjectNewParamsDeploymentConfigsProductionR2BucketsR2Binding) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Services used for Pages Functions.
-type PageProjectNewParamsDeploymentConfigsProductionServiceBindings struct {
- // Service binding.
- ServiceBinding param.Field[PageProjectNewParamsDeploymentConfigsProductionServiceBindingsServiceBinding] `json:"SERVICE_BINDING"`
-}
-
-func (r PageProjectNewParamsDeploymentConfigsProductionServiceBindings) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Service binding.
-type PageProjectNewParamsDeploymentConfigsProductionServiceBindingsServiceBinding struct {
- // The Service environment.
- Environment param.Field[string] `json:"environment"`
- // The Service name.
- Service param.Field[string] `json:"service"`
-}
-
-func (r PageProjectNewParamsDeploymentConfigsProductionServiceBindingsServiceBinding) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type PageProjectNewParamsLatestDeployment struct {
-}
-
-func (r PageProjectNewParamsLatestDeployment) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Info about what caused the deployment.
-type PageProjectNewParamsLatestDeploymentDeploymentTrigger struct {
- // Additional info about the trigger.
- Metadata param.Field[PageProjectNewParamsLatestDeploymentDeploymentTriggerMetadata] `json:"metadata"`
-}
-
-func (r PageProjectNewParamsLatestDeploymentDeploymentTrigger) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Additional info about the trigger.
-type PageProjectNewParamsLatestDeploymentDeploymentTriggerMetadata struct {
-}
-
-func (r PageProjectNewParamsLatestDeploymentDeploymentTriggerMetadata) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The status of the deployment.
-type PageProjectNewParamsLatestDeploymentStage struct {
- // The current build stage.
- Name param.Field[string] `json:"name"`
-}
-
-func (r PageProjectNewParamsLatestDeploymentStage) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type PageProjectNewResponseEnvelope struct {
- Errors []PageProjectNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []PageProjectNewResponseEnvelopeMessages `json:"messages,required"`
- Result PageProjectNewResponse `json:"result,required"`
- // Whether the API call was successful
- Success PageProjectNewResponseEnvelopeSuccess `json:"success,required"`
- JSON pageProjectNewResponseEnvelopeJSON `json:"-"`
-}
-
-// pageProjectNewResponseEnvelopeJSON contains the JSON metadata for the struct
-// [PageProjectNewResponseEnvelope]
-type pageProjectNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type PageProjectNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON pageProjectNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// pageProjectNewResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [PageProjectNewResponseEnvelopeErrors]
-type pageProjectNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type PageProjectNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON pageProjectNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// pageProjectNewResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [PageProjectNewResponseEnvelopeMessages]
-type pageProjectNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type PageProjectNewResponseEnvelopeSuccess bool
-
-const (
- PageProjectNewResponseEnvelopeSuccessTrue PageProjectNewResponseEnvelopeSuccess = true
-)
-
-type PageProjectListParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type PageProjectListResponseEnvelope struct {
- Errors []PageProjectListResponseEnvelopeErrors `json:"errors,required"`
- Messages []PageProjectListResponseEnvelopeMessages `json:"messages,required"`
- Result []PageProjectListResponse `json:"result,required"`
- // Whether the API call was successful
- Success PageProjectListResponseEnvelopeSuccess `json:"success,required"`
- ResultInfo PageProjectListResponseEnvelopeResultInfo `json:"result_info"`
- JSON pageProjectListResponseEnvelopeJSON `json:"-"`
-}
-
-// pageProjectListResponseEnvelopeJSON contains the JSON metadata for the struct
-// [PageProjectListResponseEnvelope]
-type pageProjectListResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- ResultInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectListResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type PageProjectListResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON pageProjectListResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// pageProjectListResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [PageProjectListResponseEnvelopeErrors]
-type pageProjectListResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectListResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type PageProjectListResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON pageProjectListResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// pageProjectListResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [PageProjectListResponseEnvelopeMessages]
-type pageProjectListResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectListResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type PageProjectListResponseEnvelopeSuccess bool
-
-const (
- PageProjectListResponseEnvelopeSuccessTrue PageProjectListResponseEnvelopeSuccess = true
-)
-
-type PageProjectListResponseEnvelopeResultInfo struct {
- Count interface{} `json:"count"`
- Page interface{} `json:"page"`
- PerPage interface{} `json:"per_page"`
- TotalCount interface{} `json:"total_count"`
- JSON pageProjectListResponseEnvelopeResultInfoJSON `json:"-"`
-}
-
-// pageProjectListResponseEnvelopeResultInfoJSON contains the JSON metadata for the
-// struct [PageProjectListResponseEnvelopeResultInfo]
-type pageProjectListResponseEnvelopeResultInfoJSON struct {
- Count apijson.Field
- Page apijson.Field
- PerPage apijson.Field
- TotalCount apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectListResponseEnvelopeResultInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type PageProjectDeleteParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type PageProjectEditParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
- Body param.Field[interface{}] `json:"body,required"`
-}
-
-func (r PageProjectEditParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r.Body)
-}
-
-type PageProjectEditResponseEnvelope struct {
- Errors []PageProjectEditResponseEnvelopeErrors `json:"errors,required"`
- Messages []PageProjectEditResponseEnvelopeMessages `json:"messages,required"`
- Result PageProjectEditResponse `json:"result,required"`
- // Whether the API call was successful
- Success PageProjectEditResponseEnvelopeSuccess `json:"success,required"`
- JSON pageProjectEditResponseEnvelopeJSON `json:"-"`
-}
-
-// pageProjectEditResponseEnvelopeJSON contains the JSON metadata for the struct
-// [PageProjectEditResponseEnvelope]
-type pageProjectEditResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectEditResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectEditResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type PageProjectEditResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON pageProjectEditResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// pageProjectEditResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [PageProjectEditResponseEnvelopeErrors]
-type pageProjectEditResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectEditResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type PageProjectEditResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON pageProjectEditResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// pageProjectEditResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [PageProjectEditResponseEnvelopeMessages]
-type pageProjectEditResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectEditResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type PageProjectEditResponseEnvelopeSuccess bool
-
-const (
- PageProjectEditResponseEnvelopeSuccessTrue PageProjectEditResponseEnvelopeSuccess = true
-)
-
-type PageProjectGetParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type PageProjectGetResponseEnvelope struct {
- Errors []PageProjectGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []PageProjectGetResponseEnvelopeMessages `json:"messages,required"`
- Result PageProjectGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success PageProjectGetResponseEnvelopeSuccess `json:"success,required"`
- JSON pageProjectGetResponseEnvelopeJSON `json:"-"`
-}
-
-// pageProjectGetResponseEnvelopeJSON contains the JSON metadata for the struct
-// [PageProjectGetResponseEnvelope]
-type pageProjectGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type PageProjectGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON pageProjectGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// pageProjectGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [PageProjectGetResponseEnvelopeErrors]
-type pageProjectGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type PageProjectGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON pageProjectGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// pageProjectGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [PageProjectGetResponseEnvelopeMessages]
-type pageProjectGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type PageProjectGetResponseEnvelopeSuccess bool
-
-const (
- PageProjectGetResponseEnvelopeSuccessTrue PageProjectGetResponseEnvelopeSuccess = true
-)
-
-type PageProjectPurgeBuildCacheParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
diff --git a/pageproject_test.go b/pageproject_test.go
deleted file mode 100644
index 2e06c4bd767..00000000000
--- a/pageproject_test.go
+++ /dev/null
@@ -1,328 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestPageProjectNewWithOptionalParams(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"),
- )
- _, err := client.Pages.Projects.New(context.TODO(), cloudflare.PageProjectNewParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- BuildConfig: cloudflare.F(cloudflare.PageProjectNewParamsBuildConfig{
- BuildCaching: cloudflare.F(true),
- BuildCommand: cloudflare.F("npm run build"),
- DestinationDir: cloudflare.F("build"),
- RootDir: cloudflare.F("/"),
- WebAnalyticsTag: cloudflare.F("cee1c73f6e4743d0b5e6bb1a0bcaabcc"),
- WebAnalyticsToken: cloudflare.F("021e1057c18547eca7b79f2516f06o7x"),
- }),
- CanonicalDeployment: cloudflare.F(cloudflare.PageProjectNewParamsCanonicalDeployment{}),
- DeploymentConfigs: cloudflare.F(cloudflare.PageProjectNewParamsDeploymentConfigs{
- Preview: cloudflare.F(cloudflare.PageProjectNewParamsDeploymentConfigsPreview{
- AIBindings: cloudflare.F(cloudflare.PageProjectNewParamsDeploymentConfigsPreviewAIBindings{
- AIBinding: cloudflare.F(cloudflare.PageProjectNewParamsDeploymentConfigsPreviewAIBindingsAIBinding{
- ProjectID: cloudflare.F[any](map[string]interface{}{}),
- }),
- }),
- AnalyticsEngineDatasets: cloudflare.F(cloudflare.PageProjectNewParamsDeploymentConfigsPreviewAnalyticsEngineDatasets{
- AnalyticsEngineBinding: cloudflare.F(cloudflare.PageProjectNewParamsDeploymentConfigsPreviewAnalyticsEngineDatasetsAnalyticsEngineBinding{
- Dataset: cloudflare.F("api_analytics"),
- }),
- }),
- CompatibilityDate: cloudflare.F("2022-01-01"),
- CompatibilityFlags: cloudflare.F([]interface{}{"url_standard"}),
- D1Databases: cloudflare.F(cloudflare.PageProjectNewParamsDeploymentConfigsPreviewD1Databases{
- D1Binding: cloudflare.F(cloudflare.PageProjectNewParamsDeploymentConfigsPreviewD1DatabasesD1Binding{
- ID: cloudflare.F("445e2955-951a-43f8-a35b-a4d0c8138f63"),
- }),
- }),
- DurableObjectNamespaces: cloudflare.F(cloudflare.PageProjectNewParamsDeploymentConfigsPreviewDurableObjectNamespaces{
- DoBinding: cloudflare.F(cloudflare.PageProjectNewParamsDeploymentConfigsPreviewDurableObjectNamespacesDoBinding{
- NamespaceID: cloudflare.F("5eb63bbbe01eeed093cb22bb8f5acdc3"),
- }),
- }),
- EnvVars: cloudflare.F(cloudflare.PageProjectNewParamsDeploymentConfigsPreviewEnvVars{
- EnvironmentVariable: cloudflare.F(cloudflare.PageProjectNewParamsDeploymentConfigsPreviewEnvVarsEnvironmentVariable{
- Type: cloudflare.F(cloudflare.PageProjectNewParamsDeploymentConfigsPreviewEnvVarsEnvironmentVariableTypePlainText),
- Value: cloudflare.F("hello world"),
- }),
- }),
- KVNamespaces: cloudflare.F(cloudflare.PageProjectNewParamsDeploymentConfigsPreviewKVNamespaces{
- KVBinding: cloudflare.F(cloudflare.PageProjectNewParamsDeploymentConfigsPreviewKVNamespacesKVBinding{
- NamespaceID: cloudflare.F("5eb63bbbe01eeed093cb22bb8f5acdc3"),
- }),
- }),
- Placement: cloudflare.F(cloudflare.PageProjectNewParamsDeploymentConfigsPreviewPlacement{
- Mode: cloudflare.F("smart"),
- }),
- QueueProducers: cloudflare.F(cloudflare.PageProjectNewParamsDeploymentConfigsPreviewQueueProducers{
- QueueProducerBinding: cloudflare.F(cloudflare.PageProjectNewParamsDeploymentConfigsPreviewQueueProducersQueueProducerBinding{
- Name: cloudflare.F("some-queue"),
- }),
- }),
- R2Buckets: cloudflare.F(cloudflare.PageProjectNewParamsDeploymentConfigsPreviewR2Buckets{
- R2Binding: cloudflare.F(cloudflare.PageProjectNewParamsDeploymentConfigsPreviewR2BucketsR2Binding{
- Name: cloudflare.F("some-bucket"),
- }),
- }),
- ServiceBindings: cloudflare.F(cloudflare.PageProjectNewParamsDeploymentConfigsPreviewServiceBindings{
- ServiceBinding: cloudflare.F(cloudflare.PageProjectNewParamsDeploymentConfigsPreviewServiceBindingsServiceBinding{
- Environment: cloudflare.F("production"),
- Service: cloudflare.F("example-worker"),
- }),
- }),
- }),
- Production: cloudflare.F(cloudflare.PageProjectNewParamsDeploymentConfigsProduction{
- AIBindings: cloudflare.F(cloudflare.PageProjectNewParamsDeploymentConfigsProductionAIBindings{
- AIBinding: cloudflare.F(cloudflare.PageProjectNewParamsDeploymentConfigsProductionAIBindingsAIBinding{
- ProjectID: cloudflare.F[any](map[string]interface{}{}),
- }),
- }),
- AnalyticsEngineDatasets: cloudflare.F(cloudflare.PageProjectNewParamsDeploymentConfigsProductionAnalyticsEngineDatasets{
- AnalyticsEngineBinding: cloudflare.F(cloudflare.PageProjectNewParamsDeploymentConfigsProductionAnalyticsEngineDatasetsAnalyticsEngineBinding{
- Dataset: cloudflare.F("api_analytics"),
- }),
- }),
- CompatibilityDate: cloudflare.F("2022-01-01"),
- CompatibilityFlags: cloudflare.F([]interface{}{"url_standard"}),
- D1Databases: cloudflare.F(cloudflare.PageProjectNewParamsDeploymentConfigsProductionD1Databases{
- D1Binding: cloudflare.F(cloudflare.PageProjectNewParamsDeploymentConfigsProductionD1DatabasesD1Binding{
- ID: cloudflare.F("445e2955-951a-43f8-a35b-a4d0c8138f63"),
- }),
- }),
- DurableObjectNamespaces: cloudflare.F(cloudflare.PageProjectNewParamsDeploymentConfigsProductionDurableObjectNamespaces{
- DoBinding: cloudflare.F(cloudflare.PageProjectNewParamsDeploymentConfigsProductionDurableObjectNamespacesDoBinding{
- NamespaceID: cloudflare.F("5eb63bbbe01eeed093cb22bb8f5acdc3"),
- }),
- }),
- EnvVars: cloudflare.F(cloudflare.PageProjectNewParamsDeploymentConfigsProductionEnvVars{
- EnvironmentVariable: cloudflare.F(cloudflare.PageProjectNewParamsDeploymentConfigsProductionEnvVarsEnvironmentVariable{
- Type: cloudflare.F(cloudflare.PageProjectNewParamsDeploymentConfigsProductionEnvVarsEnvironmentVariableTypePlainText),
- Value: cloudflare.F("hello world"),
- }),
- }),
- KVNamespaces: cloudflare.F(cloudflare.PageProjectNewParamsDeploymentConfigsProductionKVNamespaces{
- KVBinding: cloudflare.F(cloudflare.PageProjectNewParamsDeploymentConfigsProductionKVNamespacesKVBinding{
- NamespaceID: cloudflare.F("5eb63bbbe01eeed093cb22bb8f5acdc3"),
- }),
- }),
- Placement: cloudflare.F(cloudflare.PageProjectNewParamsDeploymentConfigsProductionPlacement{
- Mode: cloudflare.F("smart"),
- }),
- QueueProducers: cloudflare.F(cloudflare.PageProjectNewParamsDeploymentConfigsProductionQueueProducers{
- QueueProducerBinding: cloudflare.F(cloudflare.PageProjectNewParamsDeploymentConfigsProductionQueueProducersQueueProducerBinding{
- Name: cloudflare.F("some-queue"),
- }),
- }),
- R2Buckets: cloudflare.F(cloudflare.PageProjectNewParamsDeploymentConfigsProductionR2Buckets{
- R2Binding: cloudflare.F(cloudflare.PageProjectNewParamsDeploymentConfigsProductionR2BucketsR2Binding{
- Name: cloudflare.F("some-bucket"),
- }),
- }),
- ServiceBindings: cloudflare.F(cloudflare.PageProjectNewParamsDeploymentConfigsProductionServiceBindings{
- ServiceBinding: cloudflare.F(cloudflare.PageProjectNewParamsDeploymentConfigsProductionServiceBindingsServiceBinding{
- Environment: cloudflare.F("production"),
- Service: cloudflare.F("example-worker"),
- }),
- }),
- }),
- }),
- LatestDeployment: cloudflare.F(cloudflare.PageProjectNewParamsLatestDeployment{}),
- Name: cloudflare.F("NextJS Blog"),
- ProductionBranch: cloudflare.F("main"),
- })
- 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())
- }
-}
-
-func TestPageProjectList(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"),
- )
- _, err := client.Pages.Projects.List(context.TODO(), cloudflare.PageProjectListParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- })
- 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())
- }
-}
-
-func TestPageProjectDelete(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"),
- )
- _, err := client.Pages.Projects.Delete(
- context.TODO(),
- "this-is-my-project-01",
- cloudflare.PageProjectDeleteParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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())
- }
-}
-
-func TestPageProjectEdit(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"),
- )
- _, err := client.Pages.Projects.Edit(
- context.TODO(),
- "this-is-my-project-01",
- cloudflare.PageProjectEditParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Body: cloudflare.F[any](map[string]interface{}{
- "deployment_configs": map[string]interface{}{
- "production": map[string]interface{}{
- "compatibility_date": "2022-01-01",
- "compatibility_flags": map[string]interface{}{
- "0": "url_standard",
- },
- "env_vars": map[string]interface{}{
- "BUILD_VERSION": map[string]interface{}{
- "value": "3.3",
- },
- "delete_this_env_var": nil,
- "secret_var": map[string]interface{}{
- "type": "secret_text",
- "value": "A_CMS_API_TOKEN",
- },
- },
- },
- },
- }),
- },
- )
- 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())
- }
-}
-
-func TestPageProjectGet(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"),
- )
- _, err := client.Pages.Projects.Get(
- context.TODO(),
- "this-is-my-project-01",
- cloudflare.PageProjectGetParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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())
- }
-}
-
-func TestPageProjectPurgeBuildCache(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"),
- )
- _, err := client.Pages.Projects.PurgeBuildCache(
- context.TODO(),
- "this-is-my-project-01",
- cloudflare.PageProjectPurgeBuildCacheParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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/pageprojectdeployment.go b/pageprojectdeployment.go
deleted file mode 100644
index 76d17dc8176..00000000000
--- a/pageprojectdeployment.go
+++ /dev/null
@@ -1,1343 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// PageProjectDeploymentService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewPageProjectDeploymentService]
-// method instead.
-type PageProjectDeploymentService struct {
- Options []option.RequestOption
- History *PageProjectDeploymentHistoryService
-}
-
-// NewPageProjectDeploymentService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewPageProjectDeploymentService(opts ...option.RequestOption) (r *PageProjectDeploymentService) {
- r = &PageProjectDeploymentService{}
- r.Options = opts
- r.History = NewPageProjectDeploymentHistoryService(opts...)
- return
-}
-
-// Start a new deployment from production. The repository and account must have
-// already been authorized on the Cloudflare Pages dashboard.
-func (r *PageProjectDeploymentService) New(ctx context.Context, projectName string, params PageProjectDeploymentNewParams, opts ...option.RequestOption) (res *PageProjectDeploymentNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env PageProjectDeploymentNewResponseEnvelope
- path := fmt.Sprintf("accounts/%s/pages/projects/%s/deployments", params.AccountID, projectName)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Fetch a list of project deployments.
-func (r *PageProjectDeploymentService) List(ctx context.Context, projectName string, query PageProjectDeploymentListParams, opts ...option.RequestOption) (res *[]PageProjectDeploymentListResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env PageProjectDeploymentListResponseEnvelope
- path := fmt.Sprintf("accounts/%s/pages/projects/%s/deployments", query.AccountID, projectName)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Delete a deployment.
-func (r *PageProjectDeploymentService) Delete(ctx context.Context, projectName string, deploymentID string, body PageProjectDeploymentDeleteParams, opts ...option.RequestOption) (res *PageProjectDeploymentDeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- path := fmt.Sprintf("accounts/%s/pages/projects/%s/deployments/%s", body.AccountID, projectName, deploymentID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &res, opts...)
- return
-}
-
-// Fetch information about a deployment.
-func (r *PageProjectDeploymentService) Get(ctx context.Context, projectName string, deploymentID string, query PageProjectDeploymentGetParams, opts ...option.RequestOption) (res *PageProjectDeploymentGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env PageProjectDeploymentGetResponseEnvelope
- path := fmt.Sprintf("accounts/%s/pages/projects/%s/deployments/%s", query.AccountID, projectName, deploymentID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Retry a previous deployment.
-func (r *PageProjectDeploymentService) Retry(ctx context.Context, projectName string, deploymentID string, body PageProjectDeploymentRetryParams, opts ...option.RequestOption) (res *PageProjectDeploymentRetryResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env PageProjectDeploymentRetryResponseEnvelope
- path := fmt.Sprintf("accounts/%s/pages/projects/%s/deployments/%s/retry", body.AccountID, projectName, deploymentID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Rollback the production deployment to a previous deployment. You can only
-// rollback to succesful builds on production.
-func (r *PageProjectDeploymentService) Rollback(ctx context.Context, projectName string, deploymentID string, body PageProjectDeploymentRollbackParams, opts ...option.RequestOption) (res *PageProjectDeploymentRollbackResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env PageProjectDeploymentRollbackResponseEnvelope
- path := fmt.Sprintf("accounts/%s/pages/projects/%s/deployments/%s/rollback", body.AccountID, projectName, deploymentID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type PageProjectDeploymentNewResponse struct {
- // Id of the deployment.
- ID string `json:"id"`
- // A list of alias URLs pointing to this deployment.
- Aliases []interface{} `json:"aliases,nullable"`
- BuildConfig interface{} `json:"build_config"`
- // When the deployment was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Info about what caused the deployment.
- DeploymentTrigger PageProjectDeploymentNewResponseDeploymentTrigger `json:"deployment_trigger"`
- // A dict of env variables to build this deploy.
- EnvVars interface{} `json:"env_vars"`
- // Type of deploy.
- Environment string `json:"environment"`
- // If the deployment has been skipped.
- IsSkipped bool `json:"is_skipped"`
- LatestStage interface{} `json:"latest_stage"`
- // When the deployment was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Id of the project.
- ProjectID string `json:"project_id"`
- // Name of the project.
- ProjectName string `json:"project_name"`
- // Short Id (8 character) of the deployment.
- ShortID string `json:"short_id"`
- Source interface{} `json:"source"`
- // List of past stages.
- Stages []PageProjectDeploymentNewResponseStage `json:"stages"`
- // The live URL to view this deployment.
- URL string `json:"url"`
- JSON pageProjectDeploymentNewResponseJSON `json:"-"`
-}
-
-// pageProjectDeploymentNewResponseJSON contains the JSON metadata for the struct
-// [PageProjectDeploymentNewResponse]
-type pageProjectDeploymentNewResponseJSON struct {
- ID apijson.Field
- Aliases apijson.Field
- BuildConfig apijson.Field
- CreatedOn apijson.Field
- DeploymentTrigger apijson.Field
- EnvVars apijson.Field
- Environment apijson.Field
- IsSkipped apijson.Field
- LatestStage apijson.Field
- ModifiedOn apijson.Field
- ProjectID apijson.Field
- ProjectName apijson.Field
- ShortID apijson.Field
- Source apijson.Field
- Stages apijson.Field
- URL apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectDeploymentNewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectDeploymentNewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// Info about what caused the deployment.
-type PageProjectDeploymentNewResponseDeploymentTrigger struct {
- // Additional info about the trigger.
- Metadata PageProjectDeploymentNewResponseDeploymentTriggerMetadata `json:"metadata"`
- // What caused the deployment.
- Type string `json:"type"`
- JSON pageProjectDeploymentNewResponseDeploymentTriggerJSON `json:"-"`
-}
-
-// pageProjectDeploymentNewResponseDeploymentTriggerJSON contains the JSON metadata
-// for the struct [PageProjectDeploymentNewResponseDeploymentTrigger]
-type pageProjectDeploymentNewResponseDeploymentTriggerJSON struct {
- Metadata apijson.Field
- Type apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectDeploymentNewResponseDeploymentTrigger) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectDeploymentNewResponseDeploymentTriggerJSON) RawJSON() string {
- return r.raw
-}
-
-// Additional info about the trigger.
-type PageProjectDeploymentNewResponseDeploymentTriggerMetadata struct {
- // Where the trigger happened.
- Branch string `json:"branch"`
- // Hash of the deployment trigger commit.
- CommitHash string `json:"commit_hash"`
- // Message of the deployment trigger commit.
- CommitMessage string `json:"commit_message"`
- JSON pageProjectDeploymentNewResponseDeploymentTriggerMetadataJSON `json:"-"`
-}
-
-// pageProjectDeploymentNewResponseDeploymentTriggerMetadataJSON contains the JSON
-// metadata for the struct
-// [PageProjectDeploymentNewResponseDeploymentTriggerMetadata]
-type pageProjectDeploymentNewResponseDeploymentTriggerMetadataJSON struct {
- Branch apijson.Field
- CommitHash apijson.Field
- CommitMessage apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectDeploymentNewResponseDeploymentTriggerMetadata) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectDeploymentNewResponseDeploymentTriggerMetadataJSON) RawJSON() string {
- return r.raw
-}
-
-// The status of the deployment.
-type PageProjectDeploymentNewResponseStage struct {
- // When the stage ended.
- EndedOn time.Time `json:"ended_on,nullable" format:"date-time"`
- // The current build stage.
- Name string `json:"name"`
- // When the stage started.
- StartedOn time.Time `json:"started_on,nullable" format:"date-time"`
- // State of the current stage.
- Status string `json:"status"`
- JSON pageProjectDeploymentNewResponseStageJSON `json:"-"`
-}
-
-// pageProjectDeploymentNewResponseStageJSON contains the JSON metadata for the
-// struct [PageProjectDeploymentNewResponseStage]
-type pageProjectDeploymentNewResponseStageJSON struct {
- EndedOn apijson.Field
- Name apijson.Field
- StartedOn apijson.Field
- Status apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectDeploymentNewResponseStage) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectDeploymentNewResponseStageJSON) RawJSON() string {
- return r.raw
-}
-
-type PageProjectDeploymentListResponse struct {
- // Id of the deployment.
- ID string `json:"id"`
- // A list of alias URLs pointing to this deployment.
- Aliases []interface{} `json:"aliases,nullable"`
- BuildConfig interface{} `json:"build_config"`
- // When the deployment was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Info about what caused the deployment.
- DeploymentTrigger PageProjectDeploymentListResponseDeploymentTrigger `json:"deployment_trigger"`
- // A dict of env variables to build this deploy.
- EnvVars interface{} `json:"env_vars"`
- // Type of deploy.
- Environment string `json:"environment"`
- // If the deployment has been skipped.
- IsSkipped bool `json:"is_skipped"`
- LatestStage interface{} `json:"latest_stage"`
- // When the deployment was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Id of the project.
- ProjectID string `json:"project_id"`
- // Name of the project.
- ProjectName string `json:"project_name"`
- // Short Id (8 character) of the deployment.
- ShortID string `json:"short_id"`
- Source interface{} `json:"source"`
- // List of past stages.
- Stages []PageProjectDeploymentListResponseStage `json:"stages"`
- // The live URL to view this deployment.
- URL string `json:"url"`
- JSON pageProjectDeploymentListResponseJSON `json:"-"`
-}
-
-// pageProjectDeploymentListResponseJSON contains the JSON metadata for the struct
-// [PageProjectDeploymentListResponse]
-type pageProjectDeploymentListResponseJSON struct {
- ID apijson.Field
- Aliases apijson.Field
- BuildConfig apijson.Field
- CreatedOn apijson.Field
- DeploymentTrigger apijson.Field
- EnvVars apijson.Field
- Environment apijson.Field
- IsSkipped apijson.Field
- LatestStage apijson.Field
- ModifiedOn apijson.Field
- ProjectID apijson.Field
- ProjectName apijson.Field
- ShortID apijson.Field
- Source apijson.Field
- Stages apijson.Field
- URL apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectDeploymentListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectDeploymentListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// Info about what caused the deployment.
-type PageProjectDeploymentListResponseDeploymentTrigger struct {
- // Additional info about the trigger.
- Metadata PageProjectDeploymentListResponseDeploymentTriggerMetadata `json:"metadata"`
- // What caused the deployment.
- Type string `json:"type"`
- JSON pageProjectDeploymentListResponseDeploymentTriggerJSON `json:"-"`
-}
-
-// pageProjectDeploymentListResponseDeploymentTriggerJSON contains the JSON
-// metadata for the struct [PageProjectDeploymentListResponseDeploymentTrigger]
-type pageProjectDeploymentListResponseDeploymentTriggerJSON struct {
- Metadata apijson.Field
- Type apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectDeploymentListResponseDeploymentTrigger) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectDeploymentListResponseDeploymentTriggerJSON) RawJSON() string {
- return r.raw
-}
-
-// Additional info about the trigger.
-type PageProjectDeploymentListResponseDeploymentTriggerMetadata struct {
- // Where the trigger happened.
- Branch string `json:"branch"`
- // Hash of the deployment trigger commit.
- CommitHash string `json:"commit_hash"`
- // Message of the deployment trigger commit.
- CommitMessage string `json:"commit_message"`
- JSON pageProjectDeploymentListResponseDeploymentTriggerMetadataJSON `json:"-"`
-}
-
-// pageProjectDeploymentListResponseDeploymentTriggerMetadataJSON contains the JSON
-// metadata for the struct
-// [PageProjectDeploymentListResponseDeploymentTriggerMetadata]
-type pageProjectDeploymentListResponseDeploymentTriggerMetadataJSON struct {
- Branch apijson.Field
- CommitHash apijson.Field
- CommitMessage apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectDeploymentListResponseDeploymentTriggerMetadata) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectDeploymentListResponseDeploymentTriggerMetadataJSON) RawJSON() string {
- return r.raw
-}
-
-// The status of the deployment.
-type PageProjectDeploymentListResponseStage struct {
- // When the stage ended.
- EndedOn time.Time `json:"ended_on,nullable" format:"date-time"`
- // The current build stage.
- Name string `json:"name"`
- // When the stage started.
- StartedOn time.Time `json:"started_on,nullable" format:"date-time"`
- // State of the current stage.
- Status string `json:"status"`
- JSON pageProjectDeploymentListResponseStageJSON `json:"-"`
-}
-
-// pageProjectDeploymentListResponseStageJSON contains the JSON metadata for the
-// struct [PageProjectDeploymentListResponseStage]
-type pageProjectDeploymentListResponseStageJSON struct {
- EndedOn apijson.Field
- Name apijson.Field
- StartedOn apijson.Field
- Status apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectDeploymentListResponseStage) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectDeploymentListResponseStageJSON) RawJSON() string {
- return r.raw
-}
-
-type PageProjectDeploymentDeleteResponse = interface{}
-
-type PageProjectDeploymentGetResponse struct {
- // Id of the deployment.
- ID string `json:"id"`
- // A list of alias URLs pointing to this deployment.
- Aliases []interface{} `json:"aliases,nullable"`
- BuildConfig interface{} `json:"build_config"`
- // When the deployment was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Info about what caused the deployment.
- DeploymentTrigger PageProjectDeploymentGetResponseDeploymentTrigger `json:"deployment_trigger"`
- // A dict of env variables to build this deploy.
- EnvVars interface{} `json:"env_vars"`
- // Type of deploy.
- Environment string `json:"environment"`
- // If the deployment has been skipped.
- IsSkipped bool `json:"is_skipped"`
- LatestStage interface{} `json:"latest_stage"`
- // When the deployment was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Id of the project.
- ProjectID string `json:"project_id"`
- // Name of the project.
- ProjectName string `json:"project_name"`
- // Short Id (8 character) of the deployment.
- ShortID string `json:"short_id"`
- Source interface{} `json:"source"`
- // List of past stages.
- Stages []PageProjectDeploymentGetResponseStage `json:"stages"`
- // The live URL to view this deployment.
- URL string `json:"url"`
- JSON pageProjectDeploymentGetResponseJSON `json:"-"`
-}
-
-// pageProjectDeploymentGetResponseJSON contains the JSON metadata for the struct
-// [PageProjectDeploymentGetResponse]
-type pageProjectDeploymentGetResponseJSON struct {
- ID apijson.Field
- Aliases apijson.Field
- BuildConfig apijson.Field
- CreatedOn apijson.Field
- DeploymentTrigger apijson.Field
- EnvVars apijson.Field
- Environment apijson.Field
- IsSkipped apijson.Field
- LatestStage apijson.Field
- ModifiedOn apijson.Field
- ProjectID apijson.Field
- ProjectName apijson.Field
- ShortID apijson.Field
- Source apijson.Field
- Stages apijson.Field
- URL apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectDeploymentGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectDeploymentGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// Info about what caused the deployment.
-type PageProjectDeploymentGetResponseDeploymentTrigger struct {
- // Additional info about the trigger.
- Metadata PageProjectDeploymentGetResponseDeploymentTriggerMetadata `json:"metadata"`
- // What caused the deployment.
- Type string `json:"type"`
- JSON pageProjectDeploymentGetResponseDeploymentTriggerJSON `json:"-"`
-}
-
-// pageProjectDeploymentGetResponseDeploymentTriggerJSON contains the JSON metadata
-// for the struct [PageProjectDeploymentGetResponseDeploymentTrigger]
-type pageProjectDeploymentGetResponseDeploymentTriggerJSON struct {
- Metadata apijson.Field
- Type apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectDeploymentGetResponseDeploymentTrigger) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectDeploymentGetResponseDeploymentTriggerJSON) RawJSON() string {
- return r.raw
-}
-
-// Additional info about the trigger.
-type PageProjectDeploymentGetResponseDeploymentTriggerMetadata struct {
- // Where the trigger happened.
- Branch string `json:"branch"`
- // Hash of the deployment trigger commit.
- CommitHash string `json:"commit_hash"`
- // Message of the deployment trigger commit.
- CommitMessage string `json:"commit_message"`
- JSON pageProjectDeploymentGetResponseDeploymentTriggerMetadataJSON `json:"-"`
-}
-
-// pageProjectDeploymentGetResponseDeploymentTriggerMetadataJSON contains the JSON
-// metadata for the struct
-// [PageProjectDeploymentGetResponseDeploymentTriggerMetadata]
-type pageProjectDeploymentGetResponseDeploymentTriggerMetadataJSON struct {
- Branch apijson.Field
- CommitHash apijson.Field
- CommitMessage apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectDeploymentGetResponseDeploymentTriggerMetadata) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectDeploymentGetResponseDeploymentTriggerMetadataJSON) RawJSON() string {
- return r.raw
-}
-
-// The status of the deployment.
-type PageProjectDeploymentGetResponseStage struct {
- // When the stage ended.
- EndedOn time.Time `json:"ended_on,nullable" format:"date-time"`
- // The current build stage.
- Name string `json:"name"`
- // When the stage started.
- StartedOn time.Time `json:"started_on,nullable" format:"date-time"`
- // State of the current stage.
- Status string `json:"status"`
- JSON pageProjectDeploymentGetResponseStageJSON `json:"-"`
-}
-
-// pageProjectDeploymentGetResponseStageJSON contains the JSON metadata for the
-// struct [PageProjectDeploymentGetResponseStage]
-type pageProjectDeploymentGetResponseStageJSON struct {
- EndedOn apijson.Field
- Name apijson.Field
- StartedOn apijson.Field
- Status apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectDeploymentGetResponseStage) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectDeploymentGetResponseStageJSON) RawJSON() string {
- return r.raw
-}
-
-type PageProjectDeploymentRetryResponse struct {
- // Id of the deployment.
- ID string `json:"id"`
- // A list of alias URLs pointing to this deployment.
- Aliases []interface{} `json:"aliases,nullable"`
- BuildConfig interface{} `json:"build_config"`
- // When the deployment was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Info about what caused the deployment.
- DeploymentTrigger PageProjectDeploymentRetryResponseDeploymentTrigger `json:"deployment_trigger"`
- // A dict of env variables to build this deploy.
- EnvVars interface{} `json:"env_vars"`
- // Type of deploy.
- Environment string `json:"environment"`
- // If the deployment has been skipped.
- IsSkipped bool `json:"is_skipped"`
- LatestStage interface{} `json:"latest_stage"`
- // When the deployment was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Id of the project.
- ProjectID string `json:"project_id"`
- // Name of the project.
- ProjectName string `json:"project_name"`
- // Short Id (8 character) of the deployment.
- ShortID string `json:"short_id"`
- Source interface{} `json:"source"`
- // List of past stages.
- Stages []PageProjectDeploymentRetryResponseStage `json:"stages"`
- // The live URL to view this deployment.
- URL string `json:"url"`
- JSON pageProjectDeploymentRetryResponseJSON `json:"-"`
-}
-
-// pageProjectDeploymentRetryResponseJSON contains the JSON metadata for the struct
-// [PageProjectDeploymentRetryResponse]
-type pageProjectDeploymentRetryResponseJSON struct {
- ID apijson.Field
- Aliases apijson.Field
- BuildConfig apijson.Field
- CreatedOn apijson.Field
- DeploymentTrigger apijson.Field
- EnvVars apijson.Field
- Environment apijson.Field
- IsSkipped apijson.Field
- LatestStage apijson.Field
- ModifiedOn apijson.Field
- ProjectID apijson.Field
- ProjectName apijson.Field
- ShortID apijson.Field
- Source apijson.Field
- Stages apijson.Field
- URL apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectDeploymentRetryResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectDeploymentRetryResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// Info about what caused the deployment.
-type PageProjectDeploymentRetryResponseDeploymentTrigger struct {
- // Additional info about the trigger.
- Metadata PageProjectDeploymentRetryResponseDeploymentTriggerMetadata `json:"metadata"`
- // What caused the deployment.
- Type string `json:"type"`
- JSON pageProjectDeploymentRetryResponseDeploymentTriggerJSON `json:"-"`
-}
-
-// pageProjectDeploymentRetryResponseDeploymentTriggerJSON contains the JSON
-// metadata for the struct [PageProjectDeploymentRetryResponseDeploymentTrigger]
-type pageProjectDeploymentRetryResponseDeploymentTriggerJSON struct {
- Metadata apijson.Field
- Type apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectDeploymentRetryResponseDeploymentTrigger) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectDeploymentRetryResponseDeploymentTriggerJSON) RawJSON() string {
- return r.raw
-}
-
-// Additional info about the trigger.
-type PageProjectDeploymentRetryResponseDeploymentTriggerMetadata struct {
- // Where the trigger happened.
- Branch string `json:"branch"`
- // Hash of the deployment trigger commit.
- CommitHash string `json:"commit_hash"`
- // Message of the deployment trigger commit.
- CommitMessage string `json:"commit_message"`
- JSON pageProjectDeploymentRetryResponseDeploymentTriggerMetadataJSON `json:"-"`
-}
-
-// pageProjectDeploymentRetryResponseDeploymentTriggerMetadataJSON contains the
-// JSON metadata for the struct
-// [PageProjectDeploymentRetryResponseDeploymentTriggerMetadata]
-type pageProjectDeploymentRetryResponseDeploymentTriggerMetadataJSON struct {
- Branch apijson.Field
- CommitHash apijson.Field
- CommitMessage apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectDeploymentRetryResponseDeploymentTriggerMetadata) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectDeploymentRetryResponseDeploymentTriggerMetadataJSON) RawJSON() string {
- return r.raw
-}
-
-// The status of the deployment.
-type PageProjectDeploymentRetryResponseStage struct {
- // When the stage ended.
- EndedOn time.Time `json:"ended_on,nullable" format:"date-time"`
- // The current build stage.
- Name string `json:"name"`
- // When the stage started.
- StartedOn time.Time `json:"started_on,nullable" format:"date-time"`
- // State of the current stage.
- Status string `json:"status"`
- JSON pageProjectDeploymentRetryResponseStageJSON `json:"-"`
-}
-
-// pageProjectDeploymentRetryResponseStageJSON contains the JSON metadata for the
-// struct [PageProjectDeploymentRetryResponseStage]
-type pageProjectDeploymentRetryResponseStageJSON struct {
- EndedOn apijson.Field
- Name apijson.Field
- StartedOn apijson.Field
- Status apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectDeploymentRetryResponseStage) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectDeploymentRetryResponseStageJSON) RawJSON() string {
- return r.raw
-}
-
-type PageProjectDeploymentRollbackResponse struct {
- // Id of the deployment.
- ID string `json:"id"`
- // A list of alias URLs pointing to this deployment.
- Aliases []interface{} `json:"aliases,nullable"`
- BuildConfig interface{} `json:"build_config"`
- // When the deployment was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // Info about what caused the deployment.
- DeploymentTrigger PageProjectDeploymentRollbackResponseDeploymentTrigger `json:"deployment_trigger"`
- // A dict of env variables to build this deploy.
- EnvVars interface{} `json:"env_vars"`
- // Type of deploy.
- Environment string `json:"environment"`
- // If the deployment has been skipped.
- IsSkipped bool `json:"is_skipped"`
- LatestStage interface{} `json:"latest_stage"`
- // When the deployment was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // Id of the project.
- ProjectID string `json:"project_id"`
- // Name of the project.
- ProjectName string `json:"project_name"`
- // Short Id (8 character) of the deployment.
- ShortID string `json:"short_id"`
- Source interface{} `json:"source"`
- // List of past stages.
- Stages []PageProjectDeploymentRollbackResponseStage `json:"stages"`
- // The live URL to view this deployment.
- URL string `json:"url"`
- JSON pageProjectDeploymentRollbackResponseJSON `json:"-"`
-}
-
-// pageProjectDeploymentRollbackResponseJSON contains the JSON metadata for the
-// struct [PageProjectDeploymentRollbackResponse]
-type pageProjectDeploymentRollbackResponseJSON struct {
- ID apijson.Field
- Aliases apijson.Field
- BuildConfig apijson.Field
- CreatedOn apijson.Field
- DeploymentTrigger apijson.Field
- EnvVars apijson.Field
- Environment apijson.Field
- IsSkipped apijson.Field
- LatestStage apijson.Field
- ModifiedOn apijson.Field
- ProjectID apijson.Field
- ProjectName apijson.Field
- ShortID apijson.Field
- Source apijson.Field
- Stages apijson.Field
- URL apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectDeploymentRollbackResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectDeploymentRollbackResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// Info about what caused the deployment.
-type PageProjectDeploymentRollbackResponseDeploymentTrigger struct {
- // Additional info about the trigger.
- Metadata PageProjectDeploymentRollbackResponseDeploymentTriggerMetadata `json:"metadata"`
- // What caused the deployment.
- Type string `json:"type"`
- JSON pageProjectDeploymentRollbackResponseDeploymentTriggerJSON `json:"-"`
-}
-
-// pageProjectDeploymentRollbackResponseDeploymentTriggerJSON contains the JSON
-// metadata for the struct [PageProjectDeploymentRollbackResponseDeploymentTrigger]
-type pageProjectDeploymentRollbackResponseDeploymentTriggerJSON struct {
- Metadata apijson.Field
- Type apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectDeploymentRollbackResponseDeploymentTrigger) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectDeploymentRollbackResponseDeploymentTriggerJSON) RawJSON() string {
- return r.raw
-}
-
-// Additional info about the trigger.
-type PageProjectDeploymentRollbackResponseDeploymentTriggerMetadata struct {
- // Where the trigger happened.
- Branch string `json:"branch"`
- // Hash of the deployment trigger commit.
- CommitHash string `json:"commit_hash"`
- // Message of the deployment trigger commit.
- CommitMessage string `json:"commit_message"`
- JSON pageProjectDeploymentRollbackResponseDeploymentTriggerMetadataJSON `json:"-"`
-}
-
-// pageProjectDeploymentRollbackResponseDeploymentTriggerMetadataJSON contains the
-// JSON metadata for the struct
-// [PageProjectDeploymentRollbackResponseDeploymentTriggerMetadata]
-type pageProjectDeploymentRollbackResponseDeploymentTriggerMetadataJSON struct {
- Branch apijson.Field
- CommitHash apijson.Field
- CommitMessage apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectDeploymentRollbackResponseDeploymentTriggerMetadata) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectDeploymentRollbackResponseDeploymentTriggerMetadataJSON) RawJSON() string {
- return r.raw
-}
-
-// The status of the deployment.
-type PageProjectDeploymentRollbackResponseStage struct {
- // When the stage ended.
- EndedOn time.Time `json:"ended_on,nullable" format:"date-time"`
- // The current build stage.
- Name string `json:"name"`
- // When the stage started.
- StartedOn time.Time `json:"started_on,nullable" format:"date-time"`
- // State of the current stage.
- Status string `json:"status"`
- JSON pageProjectDeploymentRollbackResponseStageJSON `json:"-"`
-}
-
-// pageProjectDeploymentRollbackResponseStageJSON contains the JSON metadata for
-// the struct [PageProjectDeploymentRollbackResponseStage]
-type pageProjectDeploymentRollbackResponseStageJSON struct {
- EndedOn apijson.Field
- Name apijson.Field
- StartedOn apijson.Field
- Status apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectDeploymentRollbackResponseStage) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectDeploymentRollbackResponseStageJSON) RawJSON() string {
- return r.raw
-}
-
-type PageProjectDeploymentNewParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
- // The branch to build the new deployment from. The `HEAD` of the branch will be
- // used. If omitted, the production branch will be used by default.
- Branch param.Field[string] `json:"branch"`
-}
-
-func (r PageProjectDeploymentNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type PageProjectDeploymentNewResponseEnvelope struct {
- Errors []PageProjectDeploymentNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []PageProjectDeploymentNewResponseEnvelopeMessages `json:"messages,required"`
- Result PageProjectDeploymentNewResponse `json:"result,required"`
- // Whether the API call was successful
- Success PageProjectDeploymentNewResponseEnvelopeSuccess `json:"success,required"`
- JSON pageProjectDeploymentNewResponseEnvelopeJSON `json:"-"`
-}
-
-// pageProjectDeploymentNewResponseEnvelopeJSON contains the JSON metadata for the
-// struct [PageProjectDeploymentNewResponseEnvelope]
-type pageProjectDeploymentNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectDeploymentNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectDeploymentNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type PageProjectDeploymentNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON pageProjectDeploymentNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// pageProjectDeploymentNewResponseEnvelopeErrorsJSON contains the JSON metadata
-// for the struct [PageProjectDeploymentNewResponseEnvelopeErrors]
-type pageProjectDeploymentNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectDeploymentNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectDeploymentNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type PageProjectDeploymentNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON pageProjectDeploymentNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// pageProjectDeploymentNewResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [PageProjectDeploymentNewResponseEnvelopeMessages]
-type pageProjectDeploymentNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectDeploymentNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectDeploymentNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type PageProjectDeploymentNewResponseEnvelopeSuccess bool
-
-const (
- PageProjectDeploymentNewResponseEnvelopeSuccessTrue PageProjectDeploymentNewResponseEnvelopeSuccess = true
-)
-
-type PageProjectDeploymentListParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type PageProjectDeploymentListResponseEnvelope struct {
- Errors []PageProjectDeploymentListResponseEnvelopeErrors `json:"errors,required"`
- Messages []PageProjectDeploymentListResponseEnvelopeMessages `json:"messages,required"`
- Result []PageProjectDeploymentListResponse `json:"result,required"`
- // Whether the API call was successful
- Success PageProjectDeploymentListResponseEnvelopeSuccess `json:"success,required"`
- ResultInfo PageProjectDeploymentListResponseEnvelopeResultInfo `json:"result_info"`
- JSON pageProjectDeploymentListResponseEnvelopeJSON `json:"-"`
-}
-
-// pageProjectDeploymentListResponseEnvelopeJSON contains the JSON metadata for the
-// struct [PageProjectDeploymentListResponseEnvelope]
-type pageProjectDeploymentListResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- ResultInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectDeploymentListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectDeploymentListResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type PageProjectDeploymentListResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON pageProjectDeploymentListResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// pageProjectDeploymentListResponseEnvelopeErrorsJSON contains the JSON metadata
-// for the struct [PageProjectDeploymentListResponseEnvelopeErrors]
-type pageProjectDeploymentListResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectDeploymentListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectDeploymentListResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type PageProjectDeploymentListResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON pageProjectDeploymentListResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// pageProjectDeploymentListResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [PageProjectDeploymentListResponseEnvelopeMessages]
-type pageProjectDeploymentListResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectDeploymentListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectDeploymentListResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type PageProjectDeploymentListResponseEnvelopeSuccess bool
-
-const (
- PageProjectDeploymentListResponseEnvelopeSuccessTrue PageProjectDeploymentListResponseEnvelopeSuccess = true
-)
-
-type PageProjectDeploymentListResponseEnvelopeResultInfo struct {
- Count interface{} `json:"count"`
- Page interface{} `json:"page"`
- PerPage interface{} `json:"per_page"`
- TotalCount interface{} `json:"total_count"`
- JSON pageProjectDeploymentListResponseEnvelopeResultInfoJSON `json:"-"`
-}
-
-// pageProjectDeploymentListResponseEnvelopeResultInfoJSON contains the JSON
-// metadata for the struct [PageProjectDeploymentListResponseEnvelopeResultInfo]
-type pageProjectDeploymentListResponseEnvelopeResultInfoJSON struct {
- Count apijson.Field
- Page apijson.Field
- PerPage apijson.Field
- TotalCount apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectDeploymentListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectDeploymentListResponseEnvelopeResultInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type PageProjectDeploymentDeleteParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type PageProjectDeploymentGetParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type PageProjectDeploymentGetResponseEnvelope struct {
- Errors []PageProjectDeploymentGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []PageProjectDeploymentGetResponseEnvelopeMessages `json:"messages,required"`
- Result PageProjectDeploymentGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success PageProjectDeploymentGetResponseEnvelopeSuccess `json:"success,required"`
- JSON pageProjectDeploymentGetResponseEnvelopeJSON `json:"-"`
-}
-
-// pageProjectDeploymentGetResponseEnvelopeJSON contains the JSON metadata for the
-// struct [PageProjectDeploymentGetResponseEnvelope]
-type pageProjectDeploymentGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectDeploymentGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectDeploymentGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type PageProjectDeploymentGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON pageProjectDeploymentGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// pageProjectDeploymentGetResponseEnvelopeErrorsJSON contains the JSON metadata
-// for the struct [PageProjectDeploymentGetResponseEnvelopeErrors]
-type pageProjectDeploymentGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectDeploymentGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectDeploymentGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type PageProjectDeploymentGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON pageProjectDeploymentGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// pageProjectDeploymentGetResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [PageProjectDeploymentGetResponseEnvelopeMessages]
-type pageProjectDeploymentGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectDeploymentGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectDeploymentGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type PageProjectDeploymentGetResponseEnvelopeSuccess bool
-
-const (
- PageProjectDeploymentGetResponseEnvelopeSuccessTrue PageProjectDeploymentGetResponseEnvelopeSuccess = true
-)
-
-type PageProjectDeploymentRetryParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type PageProjectDeploymentRetryResponseEnvelope struct {
- Errors []PageProjectDeploymentRetryResponseEnvelopeErrors `json:"errors,required"`
- Messages []PageProjectDeploymentRetryResponseEnvelopeMessages `json:"messages,required"`
- Result PageProjectDeploymentRetryResponse `json:"result,required"`
- // Whether the API call was successful
- Success PageProjectDeploymentRetryResponseEnvelopeSuccess `json:"success,required"`
- JSON pageProjectDeploymentRetryResponseEnvelopeJSON `json:"-"`
-}
-
-// pageProjectDeploymentRetryResponseEnvelopeJSON contains the JSON metadata for
-// the struct [PageProjectDeploymentRetryResponseEnvelope]
-type pageProjectDeploymentRetryResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectDeploymentRetryResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectDeploymentRetryResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type PageProjectDeploymentRetryResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON pageProjectDeploymentRetryResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// pageProjectDeploymentRetryResponseEnvelopeErrorsJSON contains the JSON metadata
-// for the struct [PageProjectDeploymentRetryResponseEnvelopeErrors]
-type pageProjectDeploymentRetryResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectDeploymentRetryResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectDeploymentRetryResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type PageProjectDeploymentRetryResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON pageProjectDeploymentRetryResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// pageProjectDeploymentRetryResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct [PageProjectDeploymentRetryResponseEnvelopeMessages]
-type pageProjectDeploymentRetryResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectDeploymentRetryResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectDeploymentRetryResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type PageProjectDeploymentRetryResponseEnvelopeSuccess bool
-
-const (
- PageProjectDeploymentRetryResponseEnvelopeSuccessTrue PageProjectDeploymentRetryResponseEnvelopeSuccess = true
-)
-
-type PageProjectDeploymentRollbackParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type PageProjectDeploymentRollbackResponseEnvelope struct {
- Errors []PageProjectDeploymentRollbackResponseEnvelopeErrors `json:"errors,required"`
- Messages []PageProjectDeploymentRollbackResponseEnvelopeMessages `json:"messages,required"`
- Result PageProjectDeploymentRollbackResponse `json:"result,required"`
- // Whether the API call was successful
- Success PageProjectDeploymentRollbackResponseEnvelopeSuccess `json:"success,required"`
- JSON pageProjectDeploymentRollbackResponseEnvelopeJSON `json:"-"`
-}
-
-// pageProjectDeploymentRollbackResponseEnvelopeJSON contains the JSON metadata for
-// the struct [PageProjectDeploymentRollbackResponseEnvelope]
-type pageProjectDeploymentRollbackResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectDeploymentRollbackResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectDeploymentRollbackResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type PageProjectDeploymentRollbackResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON pageProjectDeploymentRollbackResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// pageProjectDeploymentRollbackResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct [PageProjectDeploymentRollbackResponseEnvelopeErrors]
-type pageProjectDeploymentRollbackResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectDeploymentRollbackResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectDeploymentRollbackResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type PageProjectDeploymentRollbackResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON pageProjectDeploymentRollbackResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// pageProjectDeploymentRollbackResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct [PageProjectDeploymentRollbackResponseEnvelopeMessages]
-type pageProjectDeploymentRollbackResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectDeploymentRollbackResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectDeploymentRollbackResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type PageProjectDeploymentRollbackResponseEnvelopeSuccess bool
-
-const (
- PageProjectDeploymentRollbackResponseEnvelopeSuccessTrue PageProjectDeploymentRollbackResponseEnvelopeSuccess = true
-)
diff --git a/pageprojectdeployment_test.go b/pageprojectdeployment_test.go
deleted file mode 100644
index ede9165dd1b..00000000000
--- a/pageprojectdeployment_test.go
+++ /dev/null
@@ -1,199 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestPageProjectDeploymentNewWithOptionalParams(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"),
- )
- _, err := client.Pages.Projects.Deployments.New(
- context.TODO(),
- "this-is-my-project-01",
- cloudflare.PageProjectDeploymentNewParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Branch: cloudflare.F("staging"),
- },
- )
- 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())
- }
-}
-
-func TestPageProjectDeploymentList(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"),
- )
- _, err := client.Pages.Projects.Deployments.List(
- context.TODO(),
- "this-is-my-project-01",
- cloudflare.PageProjectDeploymentListParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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())
- }
-}
-
-func TestPageProjectDeploymentDelete(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"),
- )
- _, err := client.Pages.Projects.Deployments.Delete(
- context.TODO(),
- "this-is-my-project-01",
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.PageProjectDeploymentDeleteParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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())
- }
-}
-
-func TestPageProjectDeploymentGet(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"),
- )
- _, err := client.Pages.Projects.Deployments.Get(
- context.TODO(),
- "this-is-my-project-01",
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.PageProjectDeploymentGetParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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())
- }
-}
-
-func TestPageProjectDeploymentRetry(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"),
- )
- _, err := client.Pages.Projects.Deployments.Retry(
- context.TODO(),
- "this-is-my-project-01",
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.PageProjectDeploymentRetryParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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())
- }
-}
-
-func TestPageProjectDeploymentRollback(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"),
- )
- _, err := client.Pages.Projects.Deployments.Rollback(
- context.TODO(),
- "this-is-my-project-01",
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.PageProjectDeploymentRollbackParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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/pageprojectdeploymenthistory.go b/pageprojectdeploymenthistory.go
deleted file mode 100644
index 8dfd3569f52..00000000000
--- a/pageprojectdeploymenthistory.go
+++ /dev/null
@@ -1,27 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// PageProjectDeploymentHistoryService contains methods and other services that
-// help with interacting with the cloudflare API. Note, unlike clients, this
-// service does not read variables from the environment automatically. You should
-// not instantiate this service directly, and instead use the
-// [NewPageProjectDeploymentHistoryService] method instead.
-type PageProjectDeploymentHistoryService struct {
- Options []option.RequestOption
- Logs *PageProjectDeploymentHistoryLogService
-}
-
-// NewPageProjectDeploymentHistoryService generates a new service that applies the
-// given options to each request. These options are applied after the parent
-// client's options (if there is one), and before any request-specific options.
-func NewPageProjectDeploymentHistoryService(opts ...option.RequestOption) (r *PageProjectDeploymentHistoryService) {
- r = &PageProjectDeploymentHistoryService{}
- r.Options = opts
- r.Logs = NewPageProjectDeploymentHistoryLogService(opts...)
- return
-}
diff --git a/pageprojectdeploymenthistorylog.go b/pageprojectdeploymenthistorylog.go
deleted file mode 100644
index 25cc6d71fe0..00000000000
--- a/pageprojectdeploymenthistorylog.go
+++ /dev/null
@@ -1,162 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "reflect"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/option"
- "github.com/tidwall/gjson"
-)
-
-// PageProjectDeploymentHistoryLogService contains methods and other services that
-// help with interacting with the cloudflare API. Note, unlike clients, this
-// service does not read variables from the environment automatically. You should
-// not instantiate this service directly, and instead use the
-// [NewPageProjectDeploymentHistoryLogService] method instead.
-type PageProjectDeploymentHistoryLogService struct {
- Options []option.RequestOption
-}
-
-// NewPageProjectDeploymentHistoryLogService generates a new service that applies
-// the given options to each request. These options are applied after the parent
-// client's options (if there is one), and before any request-specific options.
-func NewPageProjectDeploymentHistoryLogService(opts ...option.RequestOption) (r *PageProjectDeploymentHistoryLogService) {
- r = &PageProjectDeploymentHistoryLogService{}
- r.Options = opts
- return
-}
-
-// Fetch deployment logs for a project.
-func (r *PageProjectDeploymentHistoryLogService) Get(ctx context.Context, projectName string, deploymentID string, query PageProjectDeploymentHistoryLogGetParams, opts ...option.RequestOption) (res *PageProjectDeploymentHistoryLogGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env PageProjectDeploymentHistoryLogGetResponseEnvelope
- path := fmt.Sprintf("accounts/%s/pages/projects/%s/deployments/%s/history/logs", query.AccountID, projectName, deploymentID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Union satisfied by [PageProjectDeploymentHistoryLogGetResponseUnknown],
-// [PageProjectDeploymentHistoryLogGetResponseArray] or [shared.UnionString].
-type PageProjectDeploymentHistoryLogGetResponse interface {
- ImplementsPageProjectDeploymentHistoryLogGetResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*PageProjectDeploymentHistoryLogGetResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(PageProjectDeploymentHistoryLogGetResponseArray{}),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-type PageProjectDeploymentHistoryLogGetResponseArray []interface{}
-
-func (r PageProjectDeploymentHistoryLogGetResponseArray) ImplementsPageProjectDeploymentHistoryLogGetResponse() {
-}
-
-type PageProjectDeploymentHistoryLogGetParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type PageProjectDeploymentHistoryLogGetResponseEnvelope struct {
- Errors []PageProjectDeploymentHistoryLogGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []PageProjectDeploymentHistoryLogGetResponseEnvelopeMessages `json:"messages,required"`
- Result PageProjectDeploymentHistoryLogGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success PageProjectDeploymentHistoryLogGetResponseEnvelopeSuccess `json:"success,required"`
- JSON pageProjectDeploymentHistoryLogGetResponseEnvelopeJSON `json:"-"`
-}
-
-// pageProjectDeploymentHistoryLogGetResponseEnvelopeJSON contains the JSON
-// metadata for the struct [PageProjectDeploymentHistoryLogGetResponseEnvelope]
-type pageProjectDeploymentHistoryLogGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectDeploymentHistoryLogGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectDeploymentHistoryLogGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type PageProjectDeploymentHistoryLogGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON pageProjectDeploymentHistoryLogGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// pageProjectDeploymentHistoryLogGetResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct
-// [PageProjectDeploymentHistoryLogGetResponseEnvelopeErrors]
-type pageProjectDeploymentHistoryLogGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectDeploymentHistoryLogGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectDeploymentHistoryLogGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type PageProjectDeploymentHistoryLogGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON pageProjectDeploymentHistoryLogGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// pageProjectDeploymentHistoryLogGetResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct
-// [PageProjectDeploymentHistoryLogGetResponseEnvelopeMessages]
-type pageProjectDeploymentHistoryLogGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectDeploymentHistoryLogGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectDeploymentHistoryLogGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type PageProjectDeploymentHistoryLogGetResponseEnvelopeSuccess bool
-
-const (
- PageProjectDeploymentHistoryLogGetResponseEnvelopeSuccessTrue PageProjectDeploymentHistoryLogGetResponseEnvelopeSuccess = true
-)
diff --git a/pageprojectdeploymenthistorylog_test.go b/pageprojectdeploymenthistorylog_test.go
deleted file mode 100644
index a8158921b62..00000000000
--- a/pageprojectdeploymenthistorylog_test.go
+++ /dev/null
@@ -1,45 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestPageProjectDeploymentHistoryLogGet(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"),
- )
- _, err := client.Pages.Projects.Deployments.History.Logs.Get(
- context.TODO(),
- "this-is-my-project-01",
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.PageProjectDeploymentHistoryLogGetParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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/pageprojectdomain.go b/pageprojectdomain.go
deleted file mode 100644
index d3696d32efd..00000000000
--- a/pageprojectdomain.go
+++ /dev/null
@@ -1,557 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "reflect"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/option"
- "github.com/tidwall/gjson"
-)
-
-// PageProjectDomainService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewPageProjectDomainService] method
-// instead.
-type PageProjectDomainService struct {
- Options []option.RequestOption
-}
-
-// NewPageProjectDomainService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewPageProjectDomainService(opts ...option.RequestOption) (r *PageProjectDomainService) {
- r = &PageProjectDomainService{}
- r.Options = opts
- return
-}
-
-// Add a new domain for the Pages project.
-func (r *PageProjectDomainService) New(ctx context.Context, projectName string, params PageProjectDomainNewParams, opts ...option.RequestOption) (res *PageProjectDomainNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env PageProjectDomainNewResponseEnvelope
- path := fmt.Sprintf("accounts/%s/pages/projects/%s/domains", params.AccountID, projectName)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Fetch a list of all domains associated with a Pages project.
-func (r *PageProjectDomainService) List(ctx context.Context, projectName string, query PageProjectDomainListParams, opts ...option.RequestOption) (res *[]PageProjectDomainListResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env PageProjectDomainListResponseEnvelope
- path := fmt.Sprintf("accounts/%s/pages/projects/%s/domains", query.AccountID, projectName)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Delete a Pages project's domain.
-func (r *PageProjectDomainService) Delete(ctx context.Context, projectName string, domainName string, body PageProjectDomainDeleteParams, opts ...option.RequestOption) (res *PageProjectDomainDeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- path := fmt.Sprintf("accounts/%s/pages/projects/%s/domains/%s", body.AccountID, projectName, domainName)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &res, opts...)
- return
-}
-
-// Retry the validation status of a single domain.
-func (r *PageProjectDomainService) Edit(ctx context.Context, projectName string, domainName string, body PageProjectDomainEditParams, opts ...option.RequestOption) (res *PageProjectDomainEditResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env PageProjectDomainEditResponseEnvelope
- path := fmt.Sprintf("accounts/%s/pages/projects/%s/domains/%s", body.AccountID, projectName, domainName)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Fetch a single domain.
-func (r *PageProjectDomainService) Get(ctx context.Context, projectName string, domainName string, query PageProjectDomainGetParams, opts ...option.RequestOption) (res *PageProjectDomainGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env PageProjectDomainGetResponseEnvelope
- path := fmt.Sprintf("accounts/%s/pages/projects/%s/domains/%s", query.AccountID, projectName, domainName)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Union satisfied by [PageProjectDomainNewResponseUnknown],
-// [PageProjectDomainNewResponseArray] or [shared.UnionString].
-type PageProjectDomainNewResponse interface {
- ImplementsPageProjectDomainNewResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*PageProjectDomainNewResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(PageProjectDomainNewResponseArray{}),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-type PageProjectDomainNewResponseArray []interface{}
-
-func (r PageProjectDomainNewResponseArray) ImplementsPageProjectDomainNewResponse() {}
-
-type PageProjectDomainListResponse = interface{}
-
-type PageProjectDomainDeleteResponse = interface{}
-
-// Union satisfied by [PageProjectDomainEditResponseUnknown],
-// [PageProjectDomainEditResponseArray] or [shared.UnionString].
-type PageProjectDomainEditResponse interface {
- ImplementsPageProjectDomainEditResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*PageProjectDomainEditResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(PageProjectDomainEditResponseArray{}),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-type PageProjectDomainEditResponseArray []interface{}
-
-func (r PageProjectDomainEditResponseArray) ImplementsPageProjectDomainEditResponse() {}
-
-// Union satisfied by [PageProjectDomainGetResponseUnknown],
-// [PageProjectDomainGetResponseArray] or [shared.UnionString].
-type PageProjectDomainGetResponse interface {
- ImplementsPageProjectDomainGetResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*PageProjectDomainGetResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(PageProjectDomainGetResponseArray{}),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-type PageProjectDomainGetResponseArray []interface{}
-
-func (r PageProjectDomainGetResponseArray) ImplementsPageProjectDomainGetResponse() {}
-
-type PageProjectDomainNewParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
- Body param.Field[interface{}] `json:"body,required"`
-}
-
-func (r PageProjectDomainNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r.Body)
-}
-
-type PageProjectDomainNewResponseEnvelope struct {
- Errors []PageProjectDomainNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []PageProjectDomainNewResponseEnvelopeMessages `json:"messages,required"`
- Result PageProjectDomainNewResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success PageProjectDomainNewResponseEnvelopeSuccess `json:"success,required"`
- JSON pageProjectDomainNewResponseEnvelopeJSON `json:"-"`
-}
-
-// pageProjectDomainNewResponseEnvelopeJSON contains the JSON metadata for the
-// struct [PageProjectDomainNewResponseEnvelope]
-type pageProjectDomainNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectDomainNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectDomainNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type PageProjectDomainNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON pageProjectDomainNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// pageProjectDomainNewResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [PageProjectDomainNewResponseEnvelopeErrors]
-type pageProjectDomainNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectDomainNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectDomainNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type PageProjectDomainNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON pageProjectDomainNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// pageProjectDomainNewResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [PageProjectDomainNewResponseEnvelopeMessages]
-type pageProjectDomainNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectDomainNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectDomainNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type PageProjectDomainNewResponseEnvelopeSuccess bool
-
-const (
- PageProjectDomainNewResponseEnvelopeSuccessTrue PageProjectDomainNewResponseEnvelopeSuccess = true
-)
-
-type PageProjectDomainListParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type PageProjectDomainListResponseEnvelope struct {
- Errors []PageProjectDomainListResponseEnvelopeErrors `json:"errors,required"`
- Messages []PageProjectDomainListResponseEnvelopeMessages `json:"messages,required"`
- Result []PageProjectDomainListResponse `json:"result,required"`
- // Whether the API call was successful
- Success PageProjectDomainListResponseEnvelopeSuccess `json:"success,required"`
- ResultInfo PageProjectDomainListResponseEnvelopeResultInfo `json:"result_info"`
- JSON pageProjectDomainListResponseEnvelopeJSON `json:"-"`
-}
-
-// pageProjectDomainListResponseEnvelopeJSON contains the JSON metadata for the
-// struct [PageProjectDomainListResponseEnvelope]
-type pageProjectDomainListResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- ResultInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectDomainListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectDomainListResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type PageProjectDomainListResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON pageProjectDomainListResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// pageProjectDomainListResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [PageProjectDomainListResponseEnvelopeErrors]
-type pageProjectDomainListResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectDomainListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectDomainListResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type PageProjectDomainListResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON pageProjectDomainListResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// pageProjectDomainListResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [PageProjectDomainListResponseEnvelopeMessages]
-type pageProjectDomainListResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectDomainListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectDomainListResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type PageProjectDomainListResponseEnvelopeSuccess bool
-
-const (
- PageProjectDomainListResponseEnvelopeSuccessTrue PageProjectDomainListResponseEnvelopeSuccess = true
-)
-
-type PageProjectDomainListResponseEnvelopeResultInfo struct {
- Count interface{} `json:"count"`
- Page interface{} `json:"page"`
- PerPage interface{} `json:"per_page"`
- TotalCount interface{} `json:"total_count"`
- JSON pageProjectDomainListResponseEnvelopeResultInfoJSON `json:"-"`
-}
-
-// pageProjectDomainListResponseEnvelopeResultInfoJSON contains the JSON metadata
-// for the struct [PageProjectDomainListResponseEnvelopeResultInfo]
-type pageProjectDomainListResponseEnvelopeResultInfoJSON struct {
- Count apijson.Field
- Page apijson.Field
- PerPage apijson.Field
- TotalCount apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectDomainListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectDomainListResponseEnvelopeResultInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type PageProjectDomainDeleteParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type PageProjectDomainEditParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type PageProjectDomainEditResponseEnvelope struct {
- Errors []PageProjectDomainEditResponseEnvelopeErrors `json:"errors,required"`
- Messages []PageProjectDomainEditResponseEnvelopeMessages `json:"messages,required"`
- Result PageProjectDomainEditResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success PageProjectDomainEditResponseEnvelopeSuccess `json:"success,required"`
- JSON pageProjectDomainEditResponseEnvelopeJSON `json:"-"`
-}
-
-// pageProjectDomainEditResponseEnvelopeJSON contains the JSON metadata for the
-// struct [PageProjectDomainEditResponseEnvelope]
-type pageProjectDomainEditResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectDomainEditResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectDomainEditResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type PageProjectDomainEditResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON pageProjectDomainEditResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// pageProjectDomainEditResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [PageProjectDomainEditResponseEnvelopeErrors]
-type pageProjectDomainEditResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectDomainEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectDomainEditResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type PageProjectDomainEditResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON pageProjectDomainEditResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// pageProjectDomainEditResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [PageProjectDomainEditResponseEnvelopeMessages]
-type pageProjectDomainEditResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectDomainEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectDomainEditResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type PageProjectDomainEditResponseEnvelopeSuccess bool
-
-const (
- PageProjectDomainEditResponseEnvelopeSuccessTrue PageProjectDomainEditResponseEnvelopeSuccess = true
-)
-
-type PageProjectDomainGetParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type PageProjectDomainGetResponseEnvelope struct {
- Errors []PageProjectDomainGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []PageProjectDomainGetResponseEnvelopeMessages `json:"messages,required"`
- Result PageProjectDomainGetResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success PageProjectDomainGetResponseEnvelopeSuccess `json:"success,required"`
- JSON pageProjectDomainGetResponseEnvelopeJSON `json:"-"`
-}
-
-// pageProjectDomainGetResponseEnvelopeJSON contains the JSON metadata for the
-// struct [PageProjectDomainGetResponseEnvelope]
-type pageProjectDomainGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectDomainGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectDomainGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type PageProjectDomainGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON pageProjectDomainGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// pageProjectDomainGetResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [PageProjectDomainGetResponseEnvelopeErrors]
-type pageProjectDomainGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectDomainGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectDomainGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type PageProjectDomainGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON pageProjectDomainGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// pageProjectDomainGetResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [PageProjectDomainGetResponseEnvelopeMessages]
-type pageProjectDomainGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageProjectDomainGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageProjectDomainGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type PageProjectDomainGetResponseEnvelopeSuccess bool
-
-const (
- PageProjectDomainGetResponseEnvelopeSuccessTrue PageProjectDomainGetResponseEnvelopeSuccess = true
-)
diff --git a/pageprojectdomain_test.go b/pageprojectdomain_test.go
deleted file mode 100644
index c6961764f12..00000000000
--- a/pageprojectdomain_test.go
+++ /dev/null
@@ -1,170 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestPageProjectDomainNew(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"),
- )
- _, err := client.Pages.Projects.Domains.New(
- context.TODO(),
- "this-is-my-project-01",
- cloudflare.PageProjectDomainNewParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Body: cloudflare.F[any](map[string]interface{}{
- "name": "example.com",
- }),
- },
- )
- 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())
- }
-}
-
-func TestPageProjectDomainList(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"),
- )
- _, err := client.Pages.Projects.Domains.List(
- context.TODO(),
- "this-is-my-project-01",
- cloudflare.PageProjectDomainListParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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())
- }
-}
-
-func TestPageProjectDomainDelete(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"),
- )
- _, err := client.Pages.Projects.Domains.Delete(
- context.TODO(),
- "this-is-my-project-01",
- "string",
- cloudflare.PageProjectDomainDeleteParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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())
- }
-}
-
-func TestPageProjectDomainEdit(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"),
- )
- _, err := client.Pages.Projects.Domains.Edit(
- context.TODO(),
- "this-is-my-project-01",
- "string",
- cloudflare.PageProjectDomainEditParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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())
- }
-}
-
-func TestPageProjectDomainGet(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"),
- )
- _, err := client.Pages.Projects.Domains.Get(
- context.TODO(),
- "this-is-my-project-01",
- "string",
- cloudflare.PageProjectDomainGetParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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/pagerule_test.go b/pagerule_test.go
deleted file mode 100644
index ca19d9392bc..00000000000
--- a/pagerule_test.go
+++ /dev/null
@@ -1,238 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestPageruleNewWithOptionalParams(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"),
- )
- _, err := client.Pagerules.New(context.TODO(), cloudflare.PageruleNewParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Actions: cloudflare.F([]cloudflare.PageruleNewParamsAction{{
- Name: cloudflare.F(cloudflare.PageruleNewParamsActionsNameForwardURL),
- Value: cloudflare.F(cloudflare.PageruleNewParamsActionsValue{
- Type: cloudflare.F(cloudflare.PageruleNewParamsActionsValueTypeTemporary),
- URL: cloudflare.F("http://www.example.com/somewhere/$1/astring/$2/anotherstring/$3"),
- }),
- }}),
- Targets: cloudflare.F([]cloudflare.PageruleNewParamsTarget{{
- Constraint: cloudflare.F(cloudflare.PageruleNewParamsTargetsConstraint{
- Operator: cloudflare.F(cloudflare.PageruleNewParamsTargetsConstraintOperatorMatches),
- Value: cloudflare.F("*example.com/images/*"),
- }),
- Target: cloudflare.F(cloudflare.PageruleNewParamsTargetsTargetURL),
- }}),
- Priority: cloudflare.F(int64(0)),
- Status: cloudflare.F(cloudflare.PageruleNewParamsStatusActive),
- })
- 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())
- }
-}
-
-func TestPageruleUpdateWithOptionalParams(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"),
- )
- _, err := client.Pagerules.Update(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.PageruleUpdateParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Actions: cloudflare.F([]cloudflare.PageruleUpdateParamsAction{{
- Name: cloudflare.F(cloudflare.PageruleUpdateParamsActionsNameForwardURL),
- Value: cloudflare.F(cloudflare.PageruleUpdateParamsActionsValue{
- Type: cloudflare.F(cloudflare.PageruleUpdateParamsActionsValueTypeTemporary),
- URL: cloudflare.F("http://www.example.com/somewhere/$1/astring/$2/anotherstring/$3"),
- }),
- }}),
- Targets: cloudflare.F([]cloudflare.PageruleUpdateParamsTarget{{
- Constraint: cloudflare.F(cloudflare.PageruleUpdateParamsTargetsConstraint{
- Operator: cloudflare.F(cloudflare.PageruleUpdateParamsTargetsConstraintOperatorMatches),
- Value: cloudflare.F("*example.com/images/*"),
- }),
- Target: cloudflare.F(cloudflare.PageruleUpdateParamsTargetsTargetURL),
- }}),
- Priority: cloudflare.F(int64(0)),
- Status: cloudflare.F(cloudflare.PageruleUpdateParamsStatusActive),
- },
- )
- 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())
- }
-}
-
-func TestPageruleListWithOptionalParams(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"),
- )
- _, err := client.Pagerules.List(context.TODO(), cloudflare.PageruleListParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Direction: cloudflare.F(cloudflare.PageruleListParamsDirectionDesc),
- Match: cloudflare.F(cloudflare.PageruleListParamsMatchAny),
- Order: cloudflare.F(cloudflare.PageruleListParamsOrderStatus),
- Status: cloudflare.F(cloudflare.PageruleListParamsStatusActive),
- })
- 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())
- }
-}
-
-func TestPageruleDelete(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"),
- )
- _, err := client.Pagerules.Delete(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.PageruleDeleteParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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())
- }
-}
-
-func TestPageruleEditWithOptionalParams(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"),
- )
- _, err := client.Pagerules.Edit(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.PageruleEditParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Actions: cloudflare.F([]cloudflare.PageruleEditParamsAction{{
- Name: cloudflare.F(cloudflare.PageruleEditParamsActionsNameForwardURL),
- Value: cloudflare.F(cloudflare.PageruleEditParamsActionsValue{
- Type: cloudflare.F(cloudflare.PageruleEditParamsActionsValueTypeTemporary),
- URL: cloudflare.F("http://www.example.com/somewhere/$1/astring/$2/anotherstring/$3"),
- }),
- }}),
- Priority: cloudflare.F(int64(0)),
- Status: cloudflare.F(cloudflare.PageruleEditParamsStatusActive),
- Targets: cloudflare.F([]cloudflare.PageruleEditParamsTarget{{
- Constraint: cloudflare.F(cloudflare.PageruleEditParamsTargetsConstraint{
- Operator: cloudflare.F(cloudflare.PageruleEditParamsTargetsConstraintOperatorMatches),
- Value: cloudflare.F("*example.com/images/*"),
- }),
- Target: cloudflare.F(cloudflare.PageruleEditParamsTargetsTargetURL),
- }}),
- },
- )
- 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())
- }
-}
-
-func TestPageruleGet(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"),
- )
- _, err := client.Pagerules.Get(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.PageruleGetParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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/pagerules/aliases.go b/pagerules/aliases.go
new file mode 100644
index 00000000000..031338e7b65
--- /dev/null
+++ b/pagerules/aliases.go
@@ -0,0 +1,9 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package pagerules
+
+import (
+ "github.com/cloudflare/cloudflare-go/internal/apierror"
+)
+
+type Error = apierror.Error
diff --git a/pagerule.go b/pagerules/pagerule.go
similarity index 89%
rename from pagerule.go
rename to pagerules/pagerule.go
index a1def4a2cdf..c168bcbe41c 100644
--- a/pagerule.go
+++ b/pagerules/pagerule.go
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package cloudflare
+package pagerules
import (
"context"
@@ -25,7 +25,7 @@ import (
// service directly, and instead use the [NewPageruleService] method instead.
type PageruleService struct {
Options []option.RequestOption
- Settings *PageruleSettingService
+ Settings *SettingService
}
// NewPageruleService generates a new service that applies the given options to
@@ -34,7 +34,7 @@ type PageruleService struct {
func NewPageruleService(opts ...option.RequestOption) (r *PageruleService) {
r = &PageruleService{}
r.Options = opts
- r.Settings = NewPageruleSettingService(opts...)
+ r.Settings = NewSettingService(opts...)
return
}
@@ -66,7 +66,7 @@ func (r *PageruleService) Update(ctx context.Context, pageruleID string, params
}
// Fetches Page Rules in a zone.
-func (r *PageruleService) List(ctx context.Context, params PageruleListParams, opts ...option.RequestOption) (res *[]PageruleListResponse, err error) {
+func (r *PageruleService) List(ctx context.Context, params PageruleListParams, opts ...option.RequestOption) (res *[]ZonesPageRule, err error) {
opts = append(r.Options[:], opts...)
var env PageruleListResponseEnvelope
path := fmt.Sprintf("zones/%s/pagerules", params.ZoneID)
@@ -117,44 +117,12 @@ func (r *PageruleService) Get(ctx context.Context, pageruleID string, query Page
return
}
-// Union satisfied by [PageruleNewResponseUnknown] or [shared.UnionString].
-type PageruleNewResponse interface {
- ImplementsPageruleNewResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*PageruleNewResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-// Union satisfied by [PageruleUpdateResponseUnknown] or [shared.UnionString].
-type PageruleUpdateResponse interface {
- ImplementsPageruleUpdateResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*PageruleUpdateResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-type PageruleListResponse struct {
+type ZonesPageRule struct {
// Identifier
ID string `json:"id,required"`
// The set of actions to perform if the targets of this rule match the request.
// Actions can redirect to another URL or override settings, but not both.
- Actions []PageruleListResponseAction `json:"actions,required"`
+ Actions []ZonesPageRuleAction `json:"actions,required"`
// The timestamp of when the Page Rule was created.
CreatedOn time.Time `json:"created_on,required" format:"date-time"`
// The timestamp of when the Page Rule was last modified.
@@ -166,15 +134,14 @@ type PageruleListResponse struct {
// rule B so it overrides rule A.
Priority int64 `json:"priority,required"`
// The status of the Page Rule.
- Status PageruleListResponseStatus `json:"status,required"`
+ Status ZonesPageRuleStatus `json:"status,required"`
// The rule targets to evaluate on each request.
- Targets []PageruleListResponseTarget `json:"targets,required"`
- JSON pageruleListResponseJSON `json:"-"`
+ Targets []ZonesPageRuleTarget `json:"targets,required"`
+ JSON zonesPageRuleJSON `json:"-"`
}
-// pageruleListResponseJSON contains the JSON metadata for the struct
-// [PageruleListResponse]
-type pageruleListResponseJSON struct {
+// zonesPageRuleJSON contains the JSON metadata for the struct [ZonesPageRule]
+type zonesPageRuleJSON struct {
ID apijson.Field
Actions apijson.Field
CreatedOn apijson.Field
@@ -186,26 +153,26 @@ type pageruleListResponseJSON struct {
ExtraFields map[string]apijson.Field
}
-func (r *PageruleListResponse) UnmarshalJSON(data []byte) (err error) {
+func (r *ZonesPageRule) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
-func (r pageruleListResponseJSON) RawJSON() string {
+func (r zonesPageRuleJSON) RawJSON() string {
return r.raw
}
-type PageruleListResponseAction struct {
+type ZonesPageRuleAction struct {
// The timestamp of when the override was last modified.
ModifiedOn time.Time `json:"modified_on" format:"date-time"`
// The type of route.
- Name PageruleListResponseActionsName `json:"name"`
- Value PageruleListResponseActionsValue `json:"value"`
- JSON pageruleListResponseActionJSON `json:"-"`
+ Name ZonesPageRuleActionsName `json:"name"`
+ Value ZonesPageRuleActionsValue `json:"value"`
+ JSON zonesPageRuleActionJSON `json:"-"`
}
-// pageruleListResponseActionJSON contains the JSON metadata for the struct
-// [PageruleListResponseAction]
-type pageruleListResponseActionJSON struct {
+// zonesPageRuleActionJSON contains the JSON metadata for the struct
+// [ZonesPageRuleAction]
+type zonesPageRuleActionJSON struct {
ModifiedOn apijson.Field
Name apijson.Field
Value apijson.Field
@@ -213,134 +180,168 @@ type pageruleListResponseActionJSON struct {
ExtraFields map[string]apijson.Field
}
-func (r *PageruleListResponseAction) UnmarshalJSON(data []byte) (err error) {
+func (r *ZonesPageRuleAction) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
-func (r pageruleListResponseActionJSON) RawJSON() string {
+func (r zonesPageRuleActionJSON) RawJSON() string {
return r.raw
}
// The type of route.
-type PageruleListResponseActionsName string
+type ZonesPageRuleActionsName string
const (
- PageruleListResponseActionsNameForwardURL PageruleListResponseActionsName = "forward_url"
+ ZonesPageRuleActionsNameForwardURL ZonesPageRuleActionsName = "forward_url"
)
-type PageruleListResponseActionsValue struct {
+type ZonesPageRuleActionsValue struct {
// The response type for the URL redirect.
- Type PageruleListResponseActionsValueType `json:"type"`
+ Type ZonesPageRuleActionsValueType `json:"type"`
// The URL to redirect the request to. Notes: ${num} refers to the position of '\*'
// in the constraint value.
- URL string `json:"url"`
- JSON pageruleListResponseActionsValueJSON `json:"-"`
+ URL string `json:"url"`
+ JSON zonesPageRuleActionsValueJSON `json:"-"`
}
-// pageruleListResponseActionsValueJSON contains the JSON metadata for the struct
-// [PageruleListResponseActionsValue]
-type pageruleListResponseActionsValueJSON struct {
+// zonesPageRuleActionsValueJSON contains the JSON metadata for the struct
+// [ZonesPageRuleActionsValue]
+type zonesPageRuleActionsValueJSON struct {
Type apijson.Field
URL apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
-func (r *PageruleListResponseActionsValue) UnmarshalJSON(data []byte) (err error) {
+func (r *ZonesPageRuleActionsValue) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
-func (r pageruleListResponseActionsValueJSON) RawJSON() string {
+func (r zonesPageRuleActionsValueJSON) RawJSON() string {
return r.raw
}
// The response type for the URL redirect.
-type PageruleListResponseActionsValueType string
+type ZonesPageRuleActionsValueType string
const (
- PageruleListResponseActionsValueTypeTemporary PageruleListResponseActionsValueType = "temporary"
- PageruleListResponseActionsValueTypePermanent PageruleListResponseActionsValueType = "permanent"
+ ZonesPageRuleActionsValueTypeTemporary ZonesPageRuleActionsValueType = "temporary"
+ ZonesPageRuleActionsValueTypePermanent ZonesPageRuleActionsValueType = "permanent"
)
// The status of the Page Rule.
-type PageruleListResponseStatus string
+type ZonesPageRuleStatus string
const (
- PageruleListResponseStatusActive PageruleListResponseStatus = "active"
- PageruleListResponseStatusDisabled PageruleListResponseStatus = "disabled"
+ ZonesPageRuleStatusActive ZonesPageRuleStatus = "active"
+ ZonesPageRuleStatusDisabled ZonesPageRuleStatus = "disabled"
)
// A request condition target.
-type PageruleListResponseTarget struct {
+type ZonesPageRuleTarget struct {
// String constraint.
- Constraint PageruleListResponseTargetsConstraint `json:"constraint,required"`
+ Constraint ZonesPageRuleTargetsConstraint `json:"constraint,required"`
// A target based on the URL of the request.
- Target PageruleListResponseTargetsTarget `json:"target,required"`
- JSON pageruleListResponseTargetJSON `json:"-"`
+ Target ZonesPageRuleTargetsTarget `json:"target,required"`
+ JSON zonesPageRuleTargetJSON `json:"-"`
}
-// pageruleListResponseTargetJSON contains the JSON metadata for the struct
-// [PageruleListResponseTarget]
-type pageruleListResponseTargetJSON struct {
+// zonesPageRuleTargetJSON contains the JSON metadata for the struct
+// [ZonesPageRuleTarget]
+type zonesPageRuleTargetJSON struct {
Constraint apijson.Field
Target apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
-func (r *PageruleListResponseTarget) UnmarshalJSON(data []byte) (err error) {
+func (r *ZonesPageRuleTarget) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
-func (r pageruleListResponseTargetJSON) RawJSON() string {
+func (r zonesPageRuleTargetJSON) RawJSON() string {
return r.raw
}
// String constraint.
-type PageruleListResponseTargetsConstraint struct {
+type ZonesPageRuleTargetsConstraint struct {
// The matches operator can use asterisks and pipes as wildcard and 'or' operators.
- Operator PageruleListResponseTargetsConstraintOperator `json:"operator,required"`
+ Operator ZonesPageRuleTargetsConstraintOperator `json:"operator,required"`
// The URL pattern to match against the current request. The pattern may contain up
// to four asterisks ('\*') as placeholders.
- Value string `json:"value,required"`
- JSON pageruleListResponseTargetsConstraintJSON `json:"-"`
+ Value string `json:"value,required"`
+ JSON zonesPageRuleTargetsConstraintJSON `json:"-"`
}
-// pageruleListResponseTargetsConstraintJSON contains the JSON metadata for the
-// struct [PageruleListResponseTargetsConstraint]
-type pageruleListResponseTargetsConstraintJSON struct {
+// zonesPageRuleTargetsConstraintJSON contains the JSON metadata for the struct
+// [ZonesPageRuleTargetsConstraint]
+type zonesPageRuleTargetsConstraintJSON struct {
Operator apijson.Field
Value apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
-func (r *PageruleListResponseTargetsConstraint) UnmarshalJSON(data []byte) (err error) {
+func (r *ZonesPageRuleTargetsConstraint) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
-func (r pageruleListResponseTargetsConstraintJSON) RawJSON() string {
+func (r zonesPageRuleTargetsConstraintJSON) RawJSON() string {
return r.raw
}
// The matches operator can use asterisks and pipes as wildcard and 'or' operators.
-type PageruleListResponseTargetsConstraintOperator string
+type ZonesPageRuleTargetsConstraintOperator string
const (
- PageruleListResponseTargetsConstraintOperatorMatches PageruleListResponseTargetsConstraintOperator = "matches"
- PageruleListResponseTargetsConstraintOperatorContains PageruleListResponseTargetsConstraintOperator = "contains"
- PageruleListResponseTargetsConstraintOperatorEquals PageruleListResponseTargetsConstraintOperator = "equals"
- PageruleListResponseTargetsConstraintOperatorNotEqual PageruleListResponseTargetsConstraintOperator = "not_equal"
- PageruleListResponseTargetsConstraintOperatorNotContain PageruleListResponseTargetsConstraintOperator = "not_contain"
+ ZonesPageRuleTargetsConstraintOperatorMatches ZonesPageRuleTargetsConstraintOperator = "matches"
+ ZonesPageRuleTargetsConstraintOperatorContains ZonesPageRuleTargetsConstraintOperator = "contains"
+ ZonesPageRuleTargetsConstraintOperatorEquals ZonesPageRuleTargetsConstraintOperator = "equals"
+ ZonesPageRuleTargetsConstraintOperatorNotEqual ZonesPageRuleTargetsConstraintOperator = "not_equal"
+ ZonesPageRuleTargetsConstraintOperatorNotContain ZonesPageRuleTargetsConstraintOperator = "not_contain"
)
// A target based on the URL of the request.
-type PageruleListResponseTargetsTarget string
+type ZonesPageRuleTargetsTarget string
const (
- PageruleListResponseTargetsTargetURL PageruleListResponseTargetsTarget = "url"
+ ZonesPageRuleTargetsTargetURL ZonesPageRuleTargetsTarget = "url"
)
+// Union satisfied by [pagerules.PageruleNewResponseUnknown] or
+// [shared.UnionString].
+type PageruleNewResponse interface {
+ ImplementsPagerulesPageruleNewResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*PageruleNewResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+// Union satisfied by [pagerules.PageruleUpdateResponseUnknown] or
+// [shared.UnionString].
+type PageruleUpdateResponse interface {
+ ImplementsPagerulesPageruleUpdateResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*PageruleUpdateResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
type PageruleDeleteResponse struct {
// Identifier
ID string `json:"id,required"`
@@ -363,9 +364,10 @@ func (r pageruleDeleteResponseJSON) RawJSON() string {
return r.raw
}
-// Union satisfied by [PageruleEditResponseUnknown] or [shared.UnionString].
+// Union satisfied by [pagerules.PageruleEditResponseUnknown] or
+// [shared.UnionString].
type PageruleEditResponse interface {
- ImplementsPageruleEditResponse()
+ ImplementsPagerulesPageruleEditResponse()
}
func init() {
@@ -379,9 +381,10 @@ func init() {
)
}
-// Union satisfied by [PageruleGetResponseUnknown] or [shared.UnionString].
+// Union satisfied by [pagerules.PageruleGetResponseUnknown] or
+// [shared.UnionString].
type PageruleGetResponse interface {
- ImplementsPageruleGetResponse()
+ ImplementsPagerulesPageruleGetResponse()
}
func init() {
@@ -835,7 +838,7 @@ const (
type PageruleListResponseEnvelope struct {
Errors []PageruleListResponseEnvelopeErrors `json:"errors,required"`
Messages []PageruleListResponseEnvelopeMessages `json:"messages,required"`
- Result []PageruleListResponse `json:"result,required"`
+ Result []ZonesPageRule `json:"result,required"`
// Whether the API call was successful
Success PageruleListResponseEnvelopeSuccess `json:"success,required"`
JSON pageruleListResponseEnvelopeJSON `json:"-"`
diff --git a/pagerules/pagerule_test.go b/pagerules/pagerule_test.go
new file mode 100644
index 00000000000..d772bc213d8
--- /dev/null
+++ b/pagerules/pagerule_test.go
@@ -0,0 +1,239 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package pagerules_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/pagerules"
+)
+
+func TestPageruleNewWithOptionalParams(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"),
+ )
+ _, err := client.Pagerules.New(context.TODO(), pagerules.PageruleNewParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Actions: cloudflare.F([]pagerules.PageruleNewParamsAction{{
+ Name: cloudflare.F(pagerules.PageruleNewParamsActionsNameForwardURL),
+ Value: cloudflare.F(pagerules.PageruleNewParamsActionsValue{
+ Type: cloudflare.F(pagerules.PageruleNewParamsActionsValueTypeTemporary),
+ URL: cloudflare.F("http://www.example.com/somewhere/$1/astring/$2/anotherstring/$3"),
+ }),
+ }}),
+ Targets: cloudflare.F([]pagerules.PageruleNewParamsTarget{{
+ Constraint: cloudflare.F(pagerules.PageruleNewParamsTargetsConstraint{
+ Operator: cloudflare.F(pagerules.PageruleNewParamsTargetsConstraintOperatorMatches),
+ Value: cloudflare.F("*example.com/images/*"),
+ }),
+ Target: cloudflare.F(pagerules.PageruleNewParamsTargetsTargetURL),
+ }}),
+ Priority: cloudflare.F(int64(0)),
+ Status: cloudflare.F(pagerules.PageruleNewParamsStatusActive),
+ })
+ 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())
+ }
+}
+
+func TestPageruleUpdateWithOptionalParams(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"),
+ )
+ _, err := client.Pagerules.Update(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ pagerules.PageruleUpdateParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Actions: cloudflare.F([]pagerules.PageruleUpdateParamsAction{{
+ Name: cloudflare.F(pagerules.PageruleUpdateParamsActionsNameForwardURL),
+ Value: cloudflare.F(pagerules.PageruleUpdateParamsActionsValue{
+ Type: cloudflare.F(pagerules.PageruleUpdateParamsActionsValueTypeTemporary),
+ URL: cloudflare.F("http://www.example.com/somewhere/$1/astring/$2/anotherstring/$3"),
+ }),
+ }}),
+ Targets: cloudflare.F([]pagerules.PageruleUpdateParamsTarget{{
+ Constraint: cloudflare.F(pagerules.PageruleUpdateParamsTargetsConstraint{
+ Operator: cloudflare.F(pagerules.PageruleUpdateParamsTargetsConstraintOperatorMatches),
+ Value: cloudflare.F("*example.com/images/*"),
+ }),
+ Target: cloudflare.F(pagerules.PageruleUpdateParamsTargetsTargetURL),
+ }}),
+ Priority: cloudflare.F(int64(0)),
+ Status: cloudflare.F(pagerules.PageruleUpdateParamsStatusActive),
+ },
+ )
+ 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())
+ }
+}
+
+func TestPageruleListWithOptionalParams(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"),
+ )
+ _, err := client.Pagerules.List(context.TODO(), pagerules.PageruleListParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Direction: cloudflare.F(pagerules.PageruleListParamsDirectionDesc),
+ Match: cloudflare.F(pagerules.PageruleListParamsMatchAny),
+ Order: cloudflare.F(pagerules.PageruleListParamsOrderStatus),
+ Status: cloudflare.F(pagerules.PageruleListParamsStatusActive),
+ })
+ 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())
+ }
+}
+
+func TestPageruleDelete(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"),
+ )
+ _, err := client.Pagerules.Delete(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ pagerules.PageruleDeleteParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestPageruleEditWithOptionalParams(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"),
+ )
+ _, err := client.Pagerules.Edit(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ pagerules.PageruleEditParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Actions: cloudflare.F([]pagerules.PageruleEditParamsAction{{
+ Name: cloudflare.F(pagerules.PageruleEditParamsActionsNameForwardURL),
+ Value: cloudflare.F(pagerules.PageruleEditParamsActionsValue{
+ Type: cloudflare.F(pagerules.PageruleEditParamsActionsValueTypeTemporary),
+ URL: cloudflare.F("http://www.example.com/somewhere/$1/astring/$2/anotherstring/$3"),
+ }),
+ }}),
+ Priority: cloudflare.F(int64(0)),
+ Status: cloudflare.F(pagerules.PageruleEditParamsStatusActive),
+ Targets: cloudflare.F([]pagerules.PageruleEditParamsTarget{{
+ Constraint: cloudflare.F(pagerules.PageruleEditParamsTargetsConstraint{
+ Operator: cloudflare.F(pagerules.PageruleEditParamsTargetsConstraintOperatorMatches),
+ Value: cloudflare.F("*example.com/images/*"),
+ }),
+ Target: cloudflare.F(pagerules.PageruleEditParamsTargetsTargetURL),
+ }}),
+ },
+ )
+ 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())
+ }
+}
+
+func TestPageruleGet(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"),
+ )
+ _, err := client.Pagerules.Get(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ pagerules.PageruleGetParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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/pagerules/setting.go b/pagerules/setting.go
new file mode 100644
index 00000000000..de61a6e5e89
--- /dev/null
+++ b/pagerules/setting.go
@@ -0,0 +1,136 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package pagerules
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// SettingService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewSettingService] method instead.
+type SettingService struct {
+ Options []option.RequestOption
+}
+
+// NewSettingService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewSettingService(opts ...option.RequestOption) (r *SettingService) {
+ r = &SettingService{}
+ r.Options = opts
+ return
+}
+
+// Returns a list of settings (and their details) that Page Rules can apply to
+// matching requests.
+func (r *SettingService) List(ctx context.Context, query SettingListParams, opts ...option.RequestOption) (res *ZonesSettings, err error) {
+ opts = append(r.Options[:], opts...)
+ var env SettingListResponseEnvelope
+ path := fmt.Sprintf("zones/%s/pagerules/settings", query.ZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type ZonesSettings []interface{}
+
+type SettingListResponse = interface{}
+
+type SettingListParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+}
+
+type SettingListResponseEnvelope struct {
+ Errors []SettingListResponseEnvelopeErrors `json:"errors,required"`
+ Messages []SettingListResponseEnvelopeMessages `json:"messages,required"`
+ // Settings available for the zone.
+ Result ZonesSettings `json:"result,required"`
+ // Whether the API call was successful
+ Success SettingListResponseEnvelopeSuccess `json:"success,required"`
+ JSON settingListResponseEnvelopeJSON `json:"-"`
+}
+
+// settingListResponseEnvelopeJSON contains the JSON metadata for the struct
+// [SettingListResponseEnvelope]
+type settingListResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *SettingListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r settingListResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type SettingListResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON settingListResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// settingListResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [SettingListResponseEnvelopeErrors]
+type settingListResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *SettingListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r settingListResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type SettingListResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON settingListResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// settingListResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [SettingListResponseEnvelopeMessages]
+type settingListResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *SettingListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r settingListResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type SettingListResponseEnvelopeSuccess bool
+
+const (
+ SettingListResponseEnvelopeSuccessTrue SettingListResponseEnvelopeSuccess = true
+)
diff --git a/pagerules/setting_test.go b/pagerules/setting_test.go
new file mode 100644
index 00000000000..031e2733ed8
--- /dev/null
+++ b/pagerules/setting_test.go
@@ -0,0 +1,41 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package pagerules_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/pagerules"
+)
+
+func TestSettingList(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"),
+ )
+ _, err := client.Pagerules.Settings.List(context.TODO(), pagerules.SettingListParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ })
+ 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/pagerulesetting.go b/pagerulesetting.go
deleted file mode 100644
index d9024f01726..00000000000
--- a/pagerulesetting.go
+++ /dev/null
@@ -1,135 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// PageruleSettingService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewPageruleSettingService] method
-// instead.
-type PageruleSettingService struct {
- Options []option.RequestOption
-}
-
-// NewPageruleSettingService generates a new service that applies the given options
-// to each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewPageruleSettingService(opts ...option.RequestOption) (r *PageruleSettingService) {
- r = &PageruleSettingService{}
- r.Options = opts
- return
-}
-
-// Returns a list of settings (and their details) that Page Rules can apply to
-// matching requests.
-func (r *PageruleSettingService) List(ctx context.Context, query PageruleSettingListParams, opts ...option.RequestOption) (res *[]PageruleSettingListResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env PageruleSettingListResponseEnvelope
- path := fmt.Sprintf("zones/%s/pagerules/settings", query.ZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type PageruleSettingListResponse = interface{}
-
-type PageruleSettingListParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
-}
-
-type PageruleSettingListResponseEnvelope struct {
- Errors []PageruleSettingListResponseEnvelopeErrors `json:"errors,required"`
- Messages []PageruleSettingListResponseEnvelopeMessages `json:"messages,required"`
- // Settings available for the zone.
- Result []PageruleSettingListResponse `json:"result,required"`
- // Whether the API call was successful
- Success PageruleSettingListResponseEnvelopeSuccess `json:"success,required"`
- JSON pageruleSettingListResponseEnvelopeJSON `json:"-"`
-}
-
-// pageruleSettingListResponseEnvelopeJSON contains the JSON metadata for the
-// struct [PageruleSettingListResponseEnvelope]
-type pageruleSettingListResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageruleSettingListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageruleSettingListResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type PageruleSettingListResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON pageruleSettingListResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// pageruleSettingListResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [PageruleSettingListResponseEnvelopeErrors]
-type pageruleSettingListResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageruleSettingListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageruleSettingListResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type PageruleSettingListResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON pageruleSettingListResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// pageruleSettingListResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [PageruleSettingListResponseEnvelopeMessages]
-type pageruleSettingListResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageruleSettingListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageruleSettingListResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type PageruleSettingListResponseEnvelopeSuccess bool
-
-const (
- PageruleSettingListResponseEnvelopeSuccessTrue PageruleSettingListResponseEnvelopeSuccess = true
-)
diff --git a/pagerulesetting_test.go b/pagerulesetting_test.go
deleted file mode 100644
index b2dc8ddd347..00000000000
--- a/pagerulesetting_test.go
+++ /dev/null
@@ -1,40 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestPageruleSettingList(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"),
- )
- _, err := client.Pagerules.Settings.List(context.TODO(), cloudflare.PageruleSettingListParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- })
- 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/pages/aliases.go b/pages/aliases.go
new file mode 100644
index 00000000000..e6811c0adad
--- /dev/null
+++ b/pages/aliases.go
@@ -0,0 +1,9 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package pages
+
+import (
+ "github.com/cloudflare/cloudflare-go/internal/apierror"
+)
+
+type Error = apierror.Error
diff --git a/pages/page.go b/pages/page.go
new file mode 100644
index 00000000000..adacf85df62
--- /dev/null
+++ b/pages/page.go
@@ -0,0 +1,26 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package pages
+
+import (
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// PageService contains methods and other services that help with interacting with
+// the cloudflare API. Note, unlike clients, this service does not read variables
+// from the environment automatically. You should not instantiate this service
+// directly, and instead use the [NewPageService] method instead.
+type PageService struct {
+ Options []option.RequestOption
+ Projects *ProjectService
+}
+
+// NewPageService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewPageService(opts ...option.RequestOption) (r *PageService) {
+ r = &PageService{}
+ r.Options = opts
+ r.Projects = NewProjectService(opts...)
+ return
+}
diff --git a/pages/project.go b/pages/project.go
new file mode 100644
index 00000000000..1df55c9efa0
--- /dev/null
+++ b/pages/project.go
@@ -0,0 +1,2395 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package pages
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "reflect"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/tidwall/gjson"
+)
+
+// ProjectService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewProjectService] method instead.
+type ProjectService struct {
+ Options []option.RequestOption
+ Deployments *ProjectDeploymentService
+ Domains *ProjectDomainService
+}
+
+// NewProjectService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewProjectService(opts ...option.RequestOption) (r *ProjectService) {
+ r = &ProjectService{}
+ r.Options = opts
+ r.Deployments = NewProjectDeploymentService(opts...)
+ r.Domains = NewProjectDomainService(opts...)
+ return
+}
+
+// Create a new project.
+func (r *ProjectService) New(ctx context.Context, params ProjectNewParams, opts ...option.RequestOption) (res *ProjectNewResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env ProjectNewResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/pages/projects", params.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Fetch a list of all user projects.
+func (r *ProjectService) List(ctx context.Context, query ProjectListParams, opts ...option.RequestOption) (res *[]PagesDeployments, err error) {
+ opts = append(r.Options[:], opts...)
+ var env ProjectListResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/pages/projects", query.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Delete a project by name.
+func (r *ProjectService) Delete(ctx context.Context, projectName string, body ProjectDeleteParams, opts ...option.RequestOption) (res *ProjectDeleteResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ path := fmt.Sprintf("accounts/%s/pages/projects/%s", body.AccountID, projectName)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &res, opts...)
+ return
+}
+
+// Set new attributes for an existing project. Modify environment variables. To
+// delete an environment variable, set the key to null.
+func (r *ProjectService) Edit(ctx context.Context, projectName string, params ProjectEditParams, opts ...option.RequestOption) (res *ProjectEditResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env ProjectEditResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/pages/projects/%s", params.AccountID, projectName)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Fetch a project by name.
+func (r *ProjectService) Get(ctx context.Context, projectName string, query ProjectGetParams, opts ...option.RequestOption) (res *PagesProjects, err error) {
+ opts = append(r.Options[:], opts...)
+ var env ProjectGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/pages/projects/%s", query.AccountID, projectName)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Purge all cached build artifacts for a Pages project
+func (r *ProjectService) PurgeBuildCache(ctx context.Context, projectName string, body ProjectPurgeBuildCacheParams, opts ...option.RequestOption) (res *ProjectPurgeBuildCacheResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ path := fmt.Sprintf("accounts/%s/pages/projects/%s/purge_build_cache", body.AccountID, projectName)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &res, opts...)
+ return
+}
+
+type PagesDeployments struct {
+ // Id of the deployment.
+ ID string `json:"id"`
+ // A list of alias URLs pointing to this deployment.
+ Aliases []interface{} `json:"aliases,nullable"`
+ BuildConfig interface{} `json:"build_config"`
+ // When the deployment was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Info about what caused the deployment.
+ DeploymentTrigger PagesDeploymentsDeploymentTrigger `json:"deployment_trigger"`
+ // A dict of env variables to build this deploy.
+ EnvVars interface{} `json:"env_vars"`
+ // Type of deploy.
+ Environment string `json:"environment"`
+ // If the deployment has been skipped.
+ IsSkipped bool `json:"is_skipped"`
+ LatestStage interface{} `json:"latest_stage"`
+ // When the deployment was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // Id of the project.
+ ProjectID string `json:"project_id"`
+ // Name of the project.
+ ProjectName string `json:"project_name"`
+ // Short Id (8 character) of the deployment.
+ ShortID string `json:"short_id"`
+ Source interface{} `json:"source"`
+ // List of past stages.
+ Stages []PagesDeploymentsStage `json:"stages"`
+ // The live URL to view this deployment.
+ URL string `json:"url"`
+ JSON pagesDeploymentsJSON `json:"-"`
+}
+
+// pagesDeploymentsJSON contains the JSON metadata for the struct
+// [PagesDeployments]
+type pagesDeploymentsJSON struct {
+ ID apijson.Field
+ Aliases apijson.Field
+ BuildConfig apijson.Field
+ CreatedOn apijson.Field
+ DeploymentTrigger apijson.Field
+ EnvVars apijson.Field
+ Environment apijson.Field
+ IsSkipped apijson.Field
+ LatestStage apijson.Field
+ ModifiedOn apijson.Field
+ ProjectID apijson.Field
+ ProjectName apijson.Field
+ ShortID apijson.Field
+ Source apijson.Field
+ Stages apijson.Field
+ URL apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PagesDeployments) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r pagesDeploymentsJSON) RawJSON() string {
+ return r.raw
+}
+
+// Info about what caused the deployment.
+type PagesDeploymentsDeploymentTrigger struct {
+ // Additional info about the trigger.
+ Metadata PagesDeploymentsDeploymentTriggerMetadata `json:"metadata"`
+ // What caused the deployment.
+ Type string `json:"type"`
+ JSON pagesDeploymentsDeploymentTriggerJSON `json:"-"`
+}
+
+// pagesDeploymentsDeploymentTriggerJSON contains the JSON metadata for the struct
+// [PagesDeploymentsDeploymentTrigger]
+type pagesDeploymentsDeploymentTriggerJSON struct {
+ Metadata apijson.Field
+ Type apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PagesDeploymentsDeploymentTrigger) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r pagesDeploymentsDeploymentTriggerJSON) RawJSON() string {
+ return r.raw
+}
+
+// Additional info about the trigger.
+type PagesDeploymentsDeploymentTriggerMetadata struct {
+ // Where the trigger happened.
+ Branch string `json:"branch"`
+ // Hash of the deployment trigger commit.
+ CommitHash string `json:"commit_hash"`
+ // Message of the deployment trigger commit.
+ CommitMessage string `json:"commit_message"`
+ JSON pagesDeploymentsDeploymentTriggerMetadataJSON `json:"-"`
+}
+
+// pagesDeploymentsDeploymentTriggerMetadataJSON contains the JSON metadata for the
+// struct [PagesDeploymentsDeploymentTriggerMetadata]
+type pagesDeploymentsDeploymentTriggerMetadataJSON struct {
+ Branch apijson.Field
+ CommitHash apijson.Field
+ CommitMessage apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PagesDeploymentsDeploymentTriggerMetadata) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r pagesDeploymentsDeploymentTriggerMetadataJSON) RawJSON() string {
+ return r.raw
+}
+
+// The status of the deployment.
+type PagesDeploymentsStage struct {
+ // When the stage ended.
+ EndedOn time.Time `json:"ended_on,nullable" format:"date-time"`
+ // The current build stage.
+ Name string `json:"name"`
+ // When the stage started.
+ StartedOn time.Time `json:"started_on,nullable" format:"date-time"`
+ // State of the current stage.
+ Status string `json:"status"`
+ JSON pagesDeploymentsStageJSON `json:"-"`
+}
+
+// pagesDeploymentsStageJSON contains the JSON metadata for the struct
+// [PagesDeploymentsStage]
+type pagesDeploymentsStageJSON struct {
+ EndedOn apijson.Field
+ Name apijson.Field
+ StartedOn apijson.Field
+ Status apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PagesDeploymentsStage) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r pagesDeploymentsStageJSON) RawJSON() string {
+ return r.raw
+}
+
+type PagesDeploymentsParam struct {
+}
+
+func (r PagesDeploymentsParam) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Info about what caused the deployment.
+type PagesDeploymentsDeploymentTriggerParam struct {
+ // Additional info about the trigger.
+ Metadata param.Field[PagesDeploymentsDeploymentTriggerMetadataParam] `json:"metadata"`
+}
+
+func (r PagesDeploymentsDeploymentTriggerParam) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Additional info about the trigger.
+type PagesDeploymentsDeploymentTriggerMetadataParam struct {
+}
+
+func (r PagesDeploymentsDeploymentTriggerMetadataParam) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The status of the deployment.
+type PagesDeploymentsStageParam struct {
+ // The current build stage.
+ Name param.Field[string] `json:"name"`
+}
+
+func (r PagesDeploymentsStageParam) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type PagesProjects struct {
+ // Id of the project.
+ ID string `json:"id"`
+ // Configs for the project build process.
+ BuildConfig PagesProjectsBuildConfig `json:"build_config"`
+ CanonicalDeployment PagesDeployments `json:"canonical_deployment"`
+ // When the project was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // Configs for deployments in a project.
+ DeploymentConfigs PagesProjectsDeploymentConfigs `json:"deployment_configs"`
+ // A list of associated custom domains for the project.
+ Domains []interface{} `json:"domains"`
+ LatestDeployment PagesDeployments `json:"latest_deployment"`
+ // Name of the project.
+ Name string `json:"name"`
+ // Production branch of the project. Used to identify production deployments.
+ ProductionBranch string `json:"production_branch"`
+ Source interface{} `json:"source"`
+ // The Cloudflare subdomain associated with the project.
+ Subdomain string `json:"subdomain"`
+ JSON pagesProjectsJSON `json:"-"`
+}
+
+// pagesProjectsJSON contains the JSON metadata for the struct [PagesProjects]
+type pagesProjectsJSON struct {
+ ID apijson.Field
+ BuildConfig apijson.Field
+ CanonicalDeployment apijson.Field
+ CreatedOn apijson.Field
+ DeploymentConfigs apijson.Field
+ Domains apijson.Field
+ LatestDeployment apijson.Field
+ Name apijson.Field
+ ProductionBranch apijson.Field
+ Source apijson.Field
+ Subdomain apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PagesProjects) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r pagesProjectsJSON) RawJSON() string {
+ return r.raw
+}
+
+// Configs for the project build process.
+type PagesProjectsBuildConfig struct {
+ // Enable build caching for the project.
+ BuildCaching bool `json:"build_caching,nullable"`
+ // Command used to build project.
+ BuildCommand string `json:"build_command,nullable"`
+ // Output directory of the build.
+ DestinationDir string `json:"destination_dir,nullable"`
+ // Directory to run the command.
+ RootDir string `json:"root_dir,nullable"`
+ // The classifying tag for analytics.
+ WebAnalyticsTag string `json:"web_analytics_tag,nullable"`
+ // The auth token for analytics.
+ WebAnalyticsToken string `json:"web_analytics_token,nullable"`
+ JSON pagesProjectsBuildConfigJSON `json:"-"`
+}
+
+// pagesProjectsBuildConfigJSON contains the JSON metadata for the struct
+// [PagesProjectsBuildConfig]
+type pagesProjectsBuildConfigJSON struct {
+ BuildCaching apijson.Field
+ BuildCommand apijson.Field
+ DestinationDir apijson.Field
+ RootDir apijson.Field
+ WebAnalyticsTag apijson.Field
+ WebAnalyticsToken apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PagesProjectsBuildConfig) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r pagesProjectsBuildConfigJSON) RawJSON() string {
+ return r.raw
+}
+
+// Configs for deployments in a project.
+type PagesProjectsDeploymentConfigs struct {
+ // Configs for preview deploys.
+ Preview PagesProjectsDeploymentConfigsPreview `json:"preview"`
+ // Configs for production deploys.
+ Production PagesProjectsDeploymentConfigsProduction `json:"production"`
+ JSON pagesProjectsDeploymentConfigsJSON `json:"-"`
+}
+
+// pagesProjectsDeploymentConfigsJSON contains the JSON metadata for the struct
+// [PagesProjectsDeploymentConfigs]
+type pagesProjectsDeploymentConfigsJSON struct {
+ Preview apijson.Field
+ Production apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PagesProjectsDeploymentConfigs) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r pagesProjectsDeploymentConfigsJSON) RawJSON() string {
+ return r.raw
+}
+
+// Configs for preview deploys.
+type PagesProjectsDeploymentConfigsPreview struct {
+ // Constellation bindings used for Pages Functions.
+ AIBindings PagesProjectsDeploymentConfigsPreviewAIBindings `json:"ai_bindings,nullable"`
+ // Analytics Engine bindings used for Pages Functions.
+ AnalyticsEngineDatasets PagesProjectsDeploymentConfigsPreviewAnalyticsEngineDatasets `json:"analytics_engine_datasets,nullable"`
+ // Compatibility date used for Pages Functions.
+ CompatibilityDate string `json:"compatibility_date"`
+ // Compatibility flags used for Pages Functions.
+ CompatibilityFlags []interface{} `json:"compatibility_flags"`
+ // D1 databases used for Pages Functions.
+ D1Databases PagesProjectsDeploymentConfigsPreviewD1Databases `json:"d1_databases,nullable"`
+ // Durabble Object namespaces used for Pages Functions.
+ DurableObjectNamespaces PagesProjectsDeploymentConfigsPreviewDurableObjectNamespaces `json:"durable_object_namespaces,nullable"`
+ // Environment variables for build configs.
+ EnvVars PagesProjectsDeploymentConfigsPreviewEnvVars `json:"env_vars,nullable"`
+ // KV namespaces used for Pages Functions.
+ KVNamespaces PagesProjectsDeploymentConfigsPreviewKVNamespaces `json:"kv_namespaces"`
+ // Placement setting used for Pages Functions.
+ Placement PagesProjectsDeploymentConfigsPreviewPlacement `json:"placement,nullable"`
+ // Queue Producer bindings used for Pages Functions.
+ QueueProducers PagesProjectsDeploymentConfigsPreviewQueueProducers `json:"queue_producers,nullable"`
+ // R2 buckets used for Pages Functions.
+ R2Buckets PagesProjectsDeploymentConfigsPreviewR2Buckets `json:"r2_buckets,nullable"`
+ // Services used for Pages Functions.
+ ServiceBindings PagesProjectsDeploymentConfigsPreviewServiceBindings `json:"service_bindings,nullable"`
+ JSON pagesProjectsDeploymentConfigsPreviewJSON `json:"-"`
+}
+
+// pagesProjectsDeploymentConfigsPreviewJSON contains the JSON metadata for the
+// struct [PagesProjectsDeploymentConfigsPreview]
+type pagesProjectsDeploymentConfigsPreviewJSON struct {
+ AIBindings apijson.Field
+ AnalyticsEngineDatasets apijson.Field
+ CompatibilityDate apijson.Field
+ CompatibilityFlags apijson.Field
+ D1Databases apijson.Field
+ DurableObjectNamespaces apijson.Field
+ EnvVars apijson.Field
+ KVNamespaces apijson.Field
+ Placement apijson.Field
+ QueueProducers apijson.Field
+ R2Buckets apijson.Field
+ ServiceBindings apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PagesProjectsDeploymentConfigsPreview) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r pagesProjectsDeploymentConfigsPreviewJSON) RawJSON() string {
+ return r.raw
+}
+
+// Constellation bindings used for Pages Functions.
+type PagesProjectsDeploymentConfigsPreviewAIBindings struct {
+ // AI binding.
+ AIBinding PagesProjectsDeploymentConfigsPreviewAIBindingsAIBinding `json:"AI_BINDING"`
+ JSON pagesProjectsDeploymentConfigsPreviewAIBindingsJSON `json:"-"`
+}
+
+// pagesProjectsDeploymentConfigsPreviewAIBindingsJSON contains the JSON metadata
+// for the struct [PagesProjectsDeploymentConfigsPreviewAIBindings]
+type pagesProjectsDeploymentConfigsPreviewAIBindingsJSON struct {
+ AIBinding apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PagesProjectsDeploymentConfigsPreviewAIBindings) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r pagesProjectsDeploymentConfigsPreviewAIBindingsJSON) RawJSON() string {
+ return r.raw
+}
+
+// AI binding.
+type PagesProjectsDeploymentConfigsPreviewAIBindingsAIBinding struct {
+ ProjectID interface{} `json:"project_id"`
+ JSON pagesProjectsDeploymentConfigsPreviewAIBindingsAIBindingJSON `json:"-"`
+}
+
+// pagesProjectsDeploymentConfigsPreviewAIBindingsAIBindingJSON contains the JSON
+// metadata for the struct
+// [PagesProjectsDeploymentConfigsPreviewAIBindingsAIBinding]
+type pagesProjectsDeploymentConfigsPreviewAIBindingsAIBindingJSON struct {
+ ProjectID apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PagesProjectsDeploymentConfigsPreviewAIBindingsAIBinding) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r pagesProjectsDeploymentConfigsPreviewAIBindingsAIBindingJSON) RawJSON() string {
+ return r.raw
+}
+
+// Analytics Engine bindings used for Pages Functions.
+type PagesProjectsDeploymentConfigsPreviewAnalyticsEngineDatasets struct {
+ // Analytics Engine binding.
+ AnalyticsEngineBinding PagesProjectsDeploymentConfigsPreviewAnalyticsEngineDatasetsAnalyticsEngineBinding `json:"ANALYTICS_ENGINE_BINDING"`
+ JSON pagesProjectsDeploymentConfigsPreviewAnalyticsEngineDatasetsJSON `json:"-"`
+}
+
+// pagesProjectsDeploymentConfigsPreviewAnalyticsEngineDatasetsJSON contains the
+// JSON metadata for the struct
+// [PagesProjectsDeploymentConfigsPreviewAnalyticsEngineDatasets]
+type pagesProjectsDeploymentConfigsPreviewAnalyticsEngineDatasetsJSON struct {
+ AnalyticsEngineBinding apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PagesProjectsDeploymentConfigsPreviewAnalyticsEngineDatasets) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r pagesProjectsDeploymentConfigsPreviewAnalyticsEngineDatasetsJSON) RawJSON() string {
+ return r.raw
+}
+
+// Analytics Engine binding.
+type PagesProjectsDeploymentConfigsPreviewAnalyticsEngineDatasetsAnalyticsEngineBinding struct {
+ // Name of the dataset.
+ Dataset string `json:"dataset"`
+ JSON pagesProjectsDeploymentConfigsPreviewAnalyticsEngineDatasetsAnalyticsEngineBindingJSON `json:"-"`
+}
+
+// pagesProjectsDeploymentConfigsPreviewAnalyticsEngineDatasetsAnalyticsEngineBindingJSON
+// contains the JSON metadata for the struct
+// [PagesProjectsDeploymentConfigsPreviewAnalyticsEngineDatasetsAnalyticsEngineBinding]
+type pagesProjectsDeploymentConfigsPreviewAnalyticsEngineDatasetsAnalyticsEngineBindingJSON struct {
+ Dataset apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PagesProjectsDeploymentConfigsPreviewAnalyticsEngineDatasetsAnalyticsEngineBinding) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r pagesProjectsDeploymentConfigsPreviewAnalyticsEngineDatasetsAnalyticsEngineBindingJSON) RawJSON() string {
+ return r.raw
+}
+
+// D1 databases used for Pages Functions.
+type PagesProjectsDeploymentConfigsPreviewD1Databases struct {
+ // D1 binding.
+ D1Binding PagesProjectsDeploymentConfigsPreviewD1DatabasesD1Binding `json:"D1_BINDING"`
+ JSON pagesProjectsDeploymentConfigsPreviewD1DatabasesJSON `json:"-"`
+}
+
+// pagesProjectsDeploymentConfigsPreviewD1DatabasesJSON contains the JSON metadata
+// for the struct [PagesProjectsDeploymentConfigsPreviewD1Databases]
+type pagesProjectsDeploymentConfigsPreviewD1DatabasesJSON struct {
+ D1Binding apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PagesProjectsDeploymentConfigsPreviewD1Databases) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r pagesProjectsDeploymentConfigsPreviewD1DatabasesJSON) RawJSON() string {
+ return r.raw
+}
+
+// D1 binding.
+type PagesProjectsDeploymentConfigsPreviewD1DatabasesD1Binding struct {
+ // UUID of the D1 database.
+ ID string `json:"id"`
+ JSON pagesProjectsDeploymentConfigsPreviewD1DatabasesD1BindingJSON `json:"-"`
+}
+
+// pagesProjectsDeploymentConfigsPreviewD1DatabasesD1BindingJSON contains the JSON
+// metadata for the struct
+// [PagesProjectsDeploymentConfigsPreviewD1DatabasesD1Binding]
+type pagesProjectsDeploymentConfigsPreviewD1DatabasesD1BindingJSON struct {
+ ID apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PagesProjectsDeploymentConfigsPreviewD1DatabasesD1Binding) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r pagesProjectsDeploymentConfigsPreviewD1DatabasesD1BindingJSON) RawJSON() string {
+ return r.raw
+}
+
+// Durabble Object namespaces used for Pages Functions.
+type PagesProjectsDeploymentConfigsPreviewDurableObjectNamespaces struct {
+ // Durabble Object binding.
+ DoBinding PagesProjectsDeploymentConfigsPreviewDurableObjectNamespacesDoBinding `json:"DO_BINDING"`
+ JSON pagesProjectsDeploymentConfigsPreviewDurableObjectNamespacesJSON `json:"-"`
+}
+
+// pagesProjectsDeploymentConfigsPreviewDurableObjectNamespacesJSON contains the
+// JSON metadata for the struct
+// [PagesProjectsDeploymentConfigsPreviewDurableObjectNamespaces]
+type pagesProjectsDeploymentConfigsPreviewDurableObjectNamespacesJSON struct {
+ DoBinding apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PagesProjectsDeploymentConfigsPreviewDurableObjectNamespaces) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r pagesProjectsDeploymentConfigsPreviewDurableObjectNamespacesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Durabble Object binding.
+type PagesProjectsDeploymentConfigsPreviewDurableObjectNamespacesDoBinding struct {
+ // ID of the Durabble Object namespace.
+ NamespaceID string `json:"namespace_id"`
+ JSON pagesProjectsDeploymentConfigsPreviewDurableObjectNamespacesDoBindingJSON `json:"-"`
+}
+
+// pagesProjectsDeploymentConfigsPreviewDurableObjectNamespacesDoBindingJSON
+// contains the JSON metadata for the struct
+// [PagesProjectsDeploymentConfigsPreviewDurableObjectNamespacesDoBinding]
+type pagesProjectsDeploymentConfigsPreviewDurableObjectNamespacesDoBindingJSON struct {
+ NamespaceID apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PagesProjectsDeploymentConfigsPreviewDurableObjectNamespacesDoBinding) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r pagesProjectsDeploymentConfigsPreviewDurableObjectNamespacesDoBindingJSON) RawJSON() string {
+ return r.raw
+}
+
+// Environment variables for build configs.
+type PagesProjectsDeploymentConfigsPreviewEnvVars struct {
+ // Environment variable.
+ EnvironmentVariable PagesProjectsDeploymentConfigsPreviewEnvVarsEnvironmentVariable `json:"ENVIRONMENT_VARIABLE"`
+ JSON pagesProjectsDeploymentConfigsPreviewEnvVarsJSON `json:"-"`
+}
+
+// pagesProjectsDeploymentConfigsPreviewEnvVarsJSON contains the JSON metadata for
+// the struct [PagesProjectsDeploymentConfigsPreviewEnvVars]
+type pagesProjectsDeploymentConfigsPreviewEnvVarsJSON struct {
+ EnvironmentVariable apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PagesProjectsDeploymentConfigsPreviewEnvVars) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r pagesProjectsDeploymentConfigsPreviewEnvVarsJSON) RawJSON() string {
+ return r.raw
+}
+
+// Environment variable.
+type PagesProjectsDeploymentConfigsPreviewEnvVarsEnvironmentVariable struct {
+ // The type of environment variable (plain text or secret)
+ Type PagesProjectsDeploymentConfigsPreviewEnvVarsEnvironmentVariableType `json:"type"`
+ // Environment variable value.
+ Value string `json:"value"`
+ JSON pagesProjectsDeploymentConfigsPreviewEnvVarsEnvironmentVariableJSON `json:"-"`
+}
+
+// pagesProjectsDeploymentConfigsPreviewEnvVarsEnvironmentVariableJSON contains the
+// JSON metadata for the struct
+// [PagesProjectsDeploymentConfigsPreviewEnvVarsEnvironmentVariable]
+type pagesProjectsDeploymentConfigsPreviewEnvVarsEnvironmentVariableJSON struct {
+ Type apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PagesProjectsDeploymentConfigsPreviewEnvVarsEnvironmentVariable) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r pagesProjectsDeploymentConfigsPreviewEnvVarsEnvironmentVariableJSON) RawJSON() string {
+ return r.raw
+}
+
+// The type of environment variable (plain text or secret)
+type PagesProjectsDeploymentConfigsPreviewEnvVarsEnvironmentVariableType string
+
+const (
+ PagesProjectsDeploymentConfigsPreviewEnvVarsEnvironmentVariableTypePlainText PagesProjectsDeploymentConfigsPreviewEnvVarsEnvironmentVariableType = "plain_text"
+ PagesProjectsDeploymentConfigsPreviewEnvVarsEnvironmentVariableTypeSecretText PagesProjectsDeploymentConfigsPreviewEnvVarsEnvironmentVariableType = "secret_text"
+)
+
+// KV namespaces used for Pages Functions.
+type PagesProjectsDeploymentConfigsPreviewKVNamespaces struct {
+ // KV binding.
+ KVBinding PagesProjectsDeploymentConfigsPreviewKVNamespacesKVBinding `json:"KV_BINDING"`
+ JSON pagesProjectsDeploymentConfigsPreviewKVNamespacesJSON `json:"-"`
+}
+
+// pagesProjectsDeploymentConfigsPreviewKVNamespacesJSON contains the JSON metadata
+// for the struct [PagesProjectsDeploymentConfigsPreviewKVNamespaces]
+type pagesProjectsDeploymentConfigsPreviewKVNamespacesJSON struct {
+ KVBinding apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PagesProjectsDeploymentConfigsPreviewKVNamespaces) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r pagesProjectsDeploymentConfigsPreviewKVNamespacesJSON) RawJSON() string {
+ return r.raw
+}
+
+// KV binding.
+type PagesProjectsDeploymentConfigsPreviewKVNamespacesKVBinding struct {
+ // ID of the KV namespace.
+ NamespaceID string `json:"namespace_id"`
+ JSON pagesProjectsDeploymentConfigsPreviewKVNamespacesKVBindingJSON `json:"-"`
+}
+
+// pagesProjectsDeploymentConfigsPreviewKVNamespacesKVBindingJSON contains the JSON
+// metadata for the struct
+// [PagesProjectsDeploymentConfigsPreviewKVNamespacesKVBinding]
+type pagesProjectsDeploymentConfigsPreviewKVNamespacesKVBindingJSON struct {
+ NamespaceID apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PagesProjectsDeploymentConfigsPreviewKVNamespacesKVBinding) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r pagesProjectsDeploymentConfigsPreviewKVNamespacesKVBindingJSON) RawJSON() string {
+ return r.raw
+}
+
+// Placement setting used for Pages Functions.
+type PagesProjectsDeploymentConfigsPreviewPlacement struct {
+ // Placement mode.
+ Mode string `json:"mode"`
+ JSON pagesProjectsDeploymentConfigsPreviewPlacementJSON `json:"-"`
+}
+
+// pagesProjectsDeploymentConfigsPreviewPlacementJSON contains the JSON metadata
+// for the struct [PagesProjectsDeploymentConfigsPreviewPlacement]
+type pagesProjectsDeploymentConfigsPreviewPlacementJSON struct {
+ Mode apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PagesProjectsDeploymentConfigsPreviewPlacement) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r pagesProjectsDeploymentConfigsPreviewPlacementJSON) RawJSON() string {
+ return r.raw
+}
+
+// Queue Producer bindings used for Pages Functions.
+type PagesProjectsDeploymentConfigsPreviewQueueProducers struct {
+ // Queue Producer binding.
+ QueueProducerBinding PagesProjectsDeploymentConfigsPreviewQueueProducersQueueProducerBinding `json:"QUEUE_PRODUCER_BINDING"`
+ JSON pagesProjectsDeploymentConfigsPreviewQueueProducersJSON `json:"-"`
+}
+
+// pagesProjectsDeploymentConfigsPreviewQueueProducersJSON contains the JSON
+// metadata for the struct [PagesProjectsDeploymentConfigsPreviewQueueProducers]
+type pagesProjectsDeploymentConfigsPreviewQueueProducersJSON struct {
+ QueueProducerBinding apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PagesProjectsDeploymentConfigsPreviewQueueProducers) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r pagesProjectsDeploymentConfigsPreviewQueueProducersJSON) RawJSON() string {
+ return r.raw
+}
+
+// Queue Producer binding.
+type PagesProjectsDeploymentConfigsPreviewQueueProducersQueueProducerBinding struct {
+ // Name of the Queue.
+ Name string `json:"name"`
+ JSON pagesProjectsDeploymentConfigsPreviewQueueProducersQueueProducerBindingJSON `json:"-"`
+}
+
+// pagesProjectsDeploymentConfigsPreviewQueueProducersQueueProducerBindingJSON
+// contains the JSON metadata for the struct
+// [PagesProjectsDeploymentConfigsPreviewQueueProducersQueueProducerBinding]
+type pagesProjectsDeploymentConfigsPreviewQueueProducersQueueProducerBindingJSON struct {
+ Name apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PagesProjectsDeploymentConfigsPreviewQueueProducersQueueProducerBinding) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r pagesProjectsDeploymentConfigsPreviewQueueProducersQueueProducerBindingJSON) RawJSON() string {
+ return r.raw
+}
+
+// R2 buckets used for Pages Functions.
+type PagesProjectsDeploymentConfigsPreviewR2Buckets struct {
+ // R2 binding.
+ R2Binding PagesProjectsDeploymentConfigsPreviewR2BucketsR2Binding `json:"R2_BINDING"`
+ JSON pagesProjectsDeploymentConfigsPreviewR2BucketsJSON `json:"-"`
+}
+
+// pagesProjectsDeploymentConfigsPreviewR2BucketsJSON contains the JSON metadata
+// for the struct [PagesProjectsDeploymentConfigsPreviewR2Buckets]
+type pagesProjectsDeploymentConfigsPreviewR2BucketsJSON struct {
+ R2Binding apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PagesProjectsDeploymentConfigsPreviewR2Buckets) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r pagesProjectsDeploymentConfigsPreviewR2BucketsJSON) RawJSON() string {
+ return r.raw
+}
+
+// R2 binding.
+type PagesProjectsDeploymentConfigsPreviewR2BucketsR2Binding struct {
+ // Name of the R2 bucket.
+ Name string `json:"name"`
+ JSON pagesProjectsDeploymentConfigsPreviewR2BucketsR2BindingJSON `json:"-"`
+}
+
+// pagesProjectsDeploymentConfigsPreviewR2BucketsR2BindingJSON contains the JSON
+// metadata for the struct
+// [PagesProjectsDeploymentConfigsPreviewR2BucketsR2Binding]
+type pagesProjectsDeploymentConfigsPreviewR2BucketsR2BindingJSON struct {
+ Name apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PagesProjectsDeploymentConfigsPreviewR2BucketsR2Binding) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r pagesProjectsDeploymentConfigsPreviewR2BucketsR2BindingJSON) RawJSON() string {
+ return r.raw
+}
+
+// Services used for Pages Functions.
+type PagesProjectsDeploymentConfigsPreviewServiceBindings struct {
+ // Service binding.
+ ServiceBinding PagesProjectsDeploymentConfigsPreviewServiceBindingsServiceBinding `json:"SERVICE_BINDING"`
+ JSON pagesProjectsDeploymentConfigsPreviewServiceBindingsJSON `json:"-"`
+}
+
+// pagesProjectsDeploymentConfigsPreviewServiceBindingsJSON contains the JSON
+// metadata for the struct [PagesProjectsDeploymentConfigsPreviewServiceBindings]
+type pagesProjectsDeploymentConfigsPreviewServiceBindingsJSON struct {
+ ServiceBinding apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PagesProjectsDeploymentConfigsPreviewServiceBindings) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r pagesProjectsDeploymentConfigsPreviewServiceBindingsJSON) RawJSON() string {
+ return r.raw
+}
+
+// Service binding.
+type PagesProjectsDeploymentConfigsPreviewServiceBindingsServiceBinding struct {
+ // The Service environment.
+ Environment string `json:"environment"`
+ // The Service name.
+ Service string `json:"service"`
+ JSON pagesProjectsDeploymentConfigsPreviewServiceBindingsServiceBindingJSON `json:"-"`
+}
+
+// pagesProjectsDeploymentConfigsPreviewServiceBindingsServiceBindingJSON contains
+// the JSON metadata for the struct
+// [PagesProjectsDeploymentConfigsPreviewServiceBindingsServiceBinding]
+type pagesProjectsDeploymentConfigsPreviewServiceBindingsServiceBindingJSON struct {
+ Environment apijson.Field
+ Service apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PagesProjectsDeploymentConfigsPreviewServiceBindingsServiceBinding) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r pagesProjectsDeploymentConfigsPreviewServiceBindingsServiceBindingJSON) RawJSON() string {
+ return r.raw
+}
+
+// Configs for production deploys.
+type PagesProjectsDeploymentConfigsProduction struct {
+ // Constellation bindings used for Pages Functions.
+ AIBindings PagesProjectsDeploymentConfigsProductionAIBindings `json:"ai_bindings,nullable"`
+ // Analytics Engine bindings used for Pages Functions.
+ AnalyticsEngineDatasets PagesProjectsDeploymentConfigsProductionAnalyticsEngineDatasets `json:"analytics_engine_datasets,nullable"`
+ // Compatibility date used for Pages Functions.
+ CompatibilityDate string `json:"compatibility_date"`
+ // Compatibility flags used for Pages Functions.
+ CompatibilityFlags []interface{} `json:"compatibility_flags"`
+ // D1 databases used for Pages Functions.
+ D1Databases PagesProjectsDeploymentConfigsProductionD1Databases `json:"d1_databases,nullable"`
+ // Durabble Object namespaces used for Pages Functions.
+ DurableObjectNamespaces PagesProjectsDeploymentConfigsProductionDurableObjectNamespaces `json:"durable_object_namespaces,nullable"`
+ // Environment variables for build configs.
+ EnvVars PagesProjectsDeploymentConfigsProductionEnvVars `json:"env_vars,nullable"`
+ // KV namespaces used for Pages Functions.
+ KVNamespaces PagesProjectsDeploymentConfigsProductionKVNamespaces `json:"kv_namespaces"`
+ // Placement setting used for Pages Functions.
+ Placement PagesProjectsDeploymentConfigsProductionPlacement `json:"placement,nullable"`
+ // Queue Producer bindings used for Pages Functions.
+ QueueProducers PagesProjectsDeploymentConfigsProductionQueueProducers `json:"queue_producers,nullable"`
+ // R2 buckets used for Pages Functions.
+ R2Buckets PagesProjectsDeploymentConfigsProductionR2Buckets `json:"r2_buckets,nullable"`
+ // Services used for Pages Functions.
+ ServiceBindings PagesProjectsDeploymentConfigsProductionServiceBindings `json:"service_bindings,nullable"`
+ JSON pagesProjectsDeploymentConfigsProductionJSON `json:"-"`
+}
+
+// pagesProjectsDeploymentConfigsProductionJSON contains the JSON metadata for the
+// struct [PagesProjectsDeploymentConfigsProduction]
+type pagesProjectsDeploymentConfigsProductionJSON struct {
+ AIBindings apijson.Field
+ AnalyticsEngineDatasets apijson.Field
+ CompatibilityDate apijson.Field
+ CompatibilityFlags apijson.Field
+ D1Databases apijson.Field
+ DurableObjectNamespaces apijson.Field
+ EnvVars apijson.Field
+ KVNamespaces apijson.Field
+ Placement apijson.Field
+ QueueProducers apijson.Field
+ R2Buckets apijson.Field
+ ServiceBindings apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PagesProjectsDeploymentConfigsProduction) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r pagesProjectsDeploymentConfigsProductionJSON) RawJSON() string {
+ return r.raw
+}
+
+// Constellation bindings used for Pages Functions.
+type PagesProjectsDeploymentConfigsProductionAIBindings struct {
+ // AI binding.
+ AIBinding PagesProjectsDeploymentConfigsProductionAIBindingsAIBinding `json:"AI_BINDING"`
+ JSON pagesProjectsDeploymentConfigsProductionAIBindingsJSON `json:"-"`
+}
+
+// pagesProjectsDeploymentConfigsProductionAIBindingsJSON contains the JSON
+// metadata for the struct [PagesProjectsDeploymentConfigsProductionAIBindings]
+type pagesProjectsDeploymentConfigsProductionAIBindingsJSON struct {
+ AIBinding apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PagesProjectsDeploymentConfigsProductionAIBindings) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r pagesProjectsDeploymentConfigsProductionAIBindingsJSON) RawJSON() string {
+ return r.raw
+}
+
+// AI binding.
+type PagesProjectsDeploymentConfigsProductionAIBindingsAIBinding struct {
+ ProjectID interface{} `json:"project_id"`
+ JSON pagesProjectsDeploymentConfigsProductionAIBindingsAIBindingJSON `json:"-"`
+}
+
+// pagesProjectsDeploymentConfigsProductionAIBindingsAIBindingJSON contains the
+// JSON metadata for the struct
+// [PagesProjectsDeploymentConfigsProductionAIBindingsAIBinding]
+type pagesProjectsDeploymentConfigsProductionAIBindingsAIBindingJSON struct {
+ ProjectID apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PagesProjectsDeploymentConfigsProductionAIBindingsAIBinding) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r pagesProjectsDeploymentConfigsProductionAIBindingsAIBindingJSON) RawJSON() string {
+ return r.raw
+}
+
+// Analytics Engine bindings used for Pages Functions.
+type PagesProjectsDeploymentConfigsProductionAnalyticsEngineDatasets struct {
+ // Analytics Engine binding.
+ AnalyticsEngineBinding PagesProjectsDeploymentConfigsProductionAnalyticsEngineDatasetsAnalyticsEngineBinding `json:"ANALYTICS_ENGINE_BINDING"`
+ JSON pagesProjectsDeploymentConfigsProductionAnalyticsEngineDatasetsJSON `json:"-"`
+}
+
+// pagesProjectsDeploymentConfigsProductionAnalyticsEngineDatasetsJSON contains the
+// JSON metadata for the struct
+// [PagesProjectsDeploymentConfigsProductionAnalyticsEngineDatasets]
+type pagesProjectsDeploymentConfigsProductionAnalyticsEngineDatasetsJSON struct {
+ AnalyticsEngineBinding apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PagesProjectsDeploymentConfigsProductionAnalyticsEngineDatasets) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r pagesProjectsDeploymentConfigsProductionAnalyticsEngineDatasetsJSON) RawJSON() string {
+ return r.raw
+}
+
+// Analytics Engine binding.
+type PagesProjectsDeploymentConfigsProductionAnalyticsEngineDatasetsAnalyticsEngineBinding struct {
+ // Name of the dataset.
+ Dataset string `json:"dataset"`
+ JSON pagesProjectsDeploymentConfigsProductionAnalyticsEngineDatasetsAnalyticsEngineBindingJSON `json:"-"`
+}
+
+// pagesProjectsDeploymentConfigsProductionAnalyticsEngineDatasetsAnalyticsEngineBindingJSON
+// contains the JSON metadata for the struct
+// [PagesProjectsDeploymentConfigsProductionAnalyticsEngineDatasetsAnalyticsEngineBinding]
+type pagesProjectsDeploymentConfigsProductionAnalyticsEngineDatasetsAnalyticsEngineBindingJSON struct {
+ Dataset apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PagesProjectsDeploymentConfigsProductionAnalyticsEngineDatasetsAnalyticsEngineBinding) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r pagesProjectsDeploymentConfigsProductionAnalyticsEngineDatasetsAnalyticsEngineBindingJSON) RawJSON() string {
+ return r.raw
+}
+
+// D1 databases used for Pages Functions.
+type PagesProjectsDeploymentConfigsProductionD1Databases struct {
+ // D1 binding.
+ D1Binding PagesProjectsDeploymentConfigsProductionD1DatabasesD1Binding `json:"D1_BINDING"`
+ JSON pagesProjectsDeploymentConfigsProductionD1DatabasesJSON `json:"-"`
+}
+
+// pagesProjectsDeploymentConfigsProductionD1DatabasesJSON contains the JSON
+// metadata for the struct [PagesProjectsDeploymentConfigsProductionD1Databases]
+type pagesProjectsDeploymentConfigsProductionD1DatabasesJSON struct {
+ D1Binding apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PagesProjectsDeploymentConfigsProductionD1Databases) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r pagesProjectsDeploymentConfigsProductionD1DatabasesJSON) RawJSON() string {
+ return r.raw
+}
+
+// D1 binding.
+type PagesProjectsDeploymentConfigsProductionD1DatabasesD1Binding struct {
+ // UUID of the D1 database.
+ ID string `json:"id"`
+ JSON pagesProjectsDeploymentConfigsProductionD1DatabasesD1BindingJSON `json:"-"`
+}
+
+// pagesProjectsDeploymentConfigsProductionD1DatabasesD1BindingJSON contains the
+// JSON metadata for the struct
+// [PagesProjectsDeploymentConfigsProductionD1DatabasesD1Binding]
+type pagesProjectsDeploymentConfigsProductionD1DatabasesD1BindingJSON struct {
+ ID apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PagesProjectsDeploymentConfigsProductionD1DatabasesD1Binding) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r pagesProjectsDeploymentConfigsProductionD1DatabasesD1BindingJSON) RawJSON() string {
+ return r.raw
+}
+
+// Durabble Object namespaces used for Pages Functions.
+type PagesProjectsDeploymentConfigsProductionDurableObjectNamespaces struct {
+ // Durabble Object binding.
+ DoBinding PagesProjectsDeploymentConfigsProductionDurableObjectNamespacesDoBinding `json:"DO_BINDING"`
+ JSON pagesProjectsDeploymentConfigsProductionDurableObjectNamespacesJSON `json:"-"`
+}
+
+// pagesProjectsDeploymentConfigsProductionDurableObjectNamespacesJSON contains the
+// JSON metadata for the struct
+// [PagesProjectsDeploymentConfigsProductionDurableObjectNamespaces]
+type pagesProjectsDeploymentConfigsProductionDurableObjectNamespacesJSON struct {
+ DoBinding apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PagesProjectsDeploymentConfigsProductionDurableObjectNamespaces) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r pagesProjectsDeploymentConfigsProductionDurableObjectNamespacesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Durabble Object binding.
+type PagesProjectsDeploymentConfigsProductionDurableObjectNamespacesDoBinding struct {
+ // ID of the Durabble Object namespace.
+ NamespaceID string `json:"namespace_id"`
+ JSON pagesProjectsDeploymentConfigsProductionDurableObjectNamespacesDoBindingJSON `json:"-"`
+}
+
+// pagesProjectsDeploymentConfigsProductionDurableObjectNamespacesDoBindingJSON
+// contains the JSON metadata for the struct
+// [PagesProjectsDeploymentConfigsProductionDurableObjectNamespacesDoBinding]
+type pagesProjectsDeploymentConfigsProductionDurableObjectNamespacesDoBindingJSON struct {
+ NamespaceID apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PagesProjectsDeploymentConfigsProductionDurableObjectNamespacesDoBinding) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r pagesProjectsDeploymentConfigsProductionDurableObjectNamespacesDoBindingJSON) RawJSON() string {
+ return r.raw
+}
+
+// Environment variables for build configs.
+type PagesProjectsDeploymentConfigsProductionEnvVars struct {
+ // Environment variable.
+ EnvironmentVariable PagesProjectsDeploymentConfigsProductionEnvVarsEnvironmentVariable `json:"ENVIRONMENT_VARIABLE"`
+ JSON pagesProjectsDeploymentConfigsProductionEnvVarsJSON `json:"-"`
+}
+
+// pagesProjectsDeploymentConfigsProductionEnvVarsJSON contains the JSON metadata
+// for the struct [PagesProjectsDeploymentConfigsProductionEnvVars]
+type pagesProjectsDeploymentConfigsProductionEnvVarsJSON struct {
+ EnvironmentVariable apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PagesProjectsDeploymentConfigsProductionEnvVars) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r pagesProjectsDeploymentConfigsProductionEnvVarsJSON) RawJSON() string {
+ return r.raw
+}
+
+// Environment variable.
+type PagesProjectsDeploymentConfigsProductionEnvVarsEnvironmentVariable struct {
+ // The type of environment variable (plain text or secret)
+ Type PagesProjectsDeploymentConfigsProductionEnvVarsEnvironmentVariableType `json:"type"`
+ // Environment variable value.
+ Value string `json:"value"`
+ JSON pagesProjectsDeploymentConfigsProductionEnvVarsEnvironmentVariableJSON `json:"-"`
+}
+
+// pagesProjectsDeploymentConfigsProductionEnvVarsEnvironmentVariableJSON contains
+// the JSON metadata for the struct
+// [PagesProjectsDeploymentConfigsProductionEnvVarsEnvironmentVariable]
+type pagesProjectsDeploymentConfigsProductionEnvVarsEnvironmentVariableJSON struct {
+ Type apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PagesProjectsDeploymentConfigsProductionEnvVarsEnvironmentVariable) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r pagesProjectsDeploymentConfigsProductionEnvVarsEnvironmentVariableJSON) RawJSON() string {
+ return r.raw
+}
+
+// The type of environment variable (plain text or secret)
+type PagesProjectsDeploymentConfigsProductionEnvVarsEnvironmentVariableType string
+
+const (
+ PagesProjectsDeploymentConfigsProductionEnvVarsEnvironmentVariableTypePlainText PagesProjectsDeploymentConfigsProductionEnvVarsEnvironmentVariableType = "plain_text"
+ PagesProjectsDeploymentConfigsProductionEnvVarsEnvironmentVariableTypeSecretText PagesProjectsDeploymentConfigsProductionEnvVarsEnvironmentVariableType = "secret_text"
+)
+
+// KV namespaces used for Pages Functions.
+type PagesProjectsDeploymentConfigsProductionKVNamespaces struct {
+ // KV binding.
+ KVBinding PagesProjectsDeploymentConfigsProductionKVNamespacesKVBinding `json:"KV_BINDING"`
+ JSON pagesProjectsDeploymentConfigsProductionKVNamespacesJSON `json:"-"`
+}
+
+// pagesProjectsDeploymentConfigsProductionKVNamespacesJSON contains the JSON
+// metadata for the struct [PagesProjectsDeploymentConfigsProductionKVNamespaces]
+type pagesProjectsDeploymentConfigsProductionKVNamespacesJSON struct {
+ KVBinding apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PagesProjectsDeploymentConfigsProductionKVNamespaces) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r pagesProjectsDeploymentConfigsProductionKVNamespacesJSON) RawJSON() string {
+ return r.raw
+}
+
+// KV binding.
+type PagesProjectsDeploymentConfigsProductionKVNamespacesKVBinding struct {
+ // ID of the KV namespace.
+ NamespaceID string `json:"namespace_id"`
+ JSON pagesProjectsDeploymentConfigsProductionKVNamespacesKVBindingJSON `json:"-"`
+}
+
+// pagesProjectsDeploymentConfigsProductionKVNamespacesKVBindingJSON contains the
+// JSON metadata for the struct
+// [PagesProjectsDeploymentConfigsProductionKVNamespacesKVBinding]
+type pagesProjectsDeploymentConfigsProductionKVNamespacesKVBindingJSON struct {
+ NamespaceID apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PagesProjectsDeploymentConfigsProductionKVNamespacesKVBinding) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r pagesProjectsDeploymentConfigsProductionKVNamespacesKVBindingJSON) RawJSON() string {
+ return r.raw
+}
+
+// Placement setting used for Pages Functions.
+type PagesProjectsDeploymentConfigsProductionPlacement struct {
+ // Placement mode.
+ Mode string `json:"mode"`
+ JSON pagesProjectsDeploymentConfigsProductionPlacementJSON `json:"-"`
+}
+
+// pagesProjectsDeploymentConfigsProductionPlacementJSON contains the JSON metadata
+// for the struct [PagesProjectsDeploymentConfigsProductionPlacement]
+type pagesProjectsDeploymentConfigsProductionPlacementJSON struct {
+ Mode apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PagesProjectsDeploymentConfigsProductionPlacement) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r pagesProjectsDeploymentConfigsProductionPlacementJSON) RawJSON() string {
+ return r.raw
+}
+
+// Queue Producer bindings used for Pages Functions.
+type PagesProjectsDeploymentConfigsProductionQueueProducers struct {
+ // Queue Producer binding.
+ QueueProducerBinding PagesProjectsDeploymentConfigsProductionQueueProducersQueueProducerBinding `json:"QUEUE_PRODUCER_BINDING"`
+ JSON pagesProjectsDeploymentConfigsProductionQueueProducersJSON `json:"-"`
+}
+
+// pagesProjectsDeploymentConfigsProductionQueueProducersJSON contains the JSON
+// metadata for the struct [PagesProjectsDeploymentConfigsProductionQueueProducers]
+type pagesProjectsDeploymentConfigsProductionQueueProducersJSON struct {
+ QueueProducerBinding apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PagesProjectsDeploymentConfigsProductionQueueProducers) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r pagesProjectsDeploymentConfigsProductionQueueProducersJSON) RawJSON() string {
+ return r.raw
+}
+
+// Queue Producer binding.
+type PagesProjectsDeploymentConfigsProductionQueueProducersQueueProducerBinding struct {
+ // Name of the Queue.
+ Name string `json:"name"`
+ JSON pagesProjectsDeploymentConfigsProductionQueueProducersQueueProducerBindingJSON `json:"-"`
+}
+
+// pagesProjectsDeploymentConfigsProductionQueueProducersQueueProducerBindingJSON
+// contains the JSON metadata for the struct
+// [PagesProjectsDeploymentConfigsProductionQueueProducersQueueProducerBinding]
+type pagesProjectsDeploymentConfigsProductionQueueProducersQueueProducerBindingJSON struct {
+ Name apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PagesProjectsDeploymentConfigsProductionQueueProducersQueueProducerBinding) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r pagesProjectsDeploymentConfigsProductionQueueProducersQueueProducerBindingJSON) RawJSON() string {
+ return r.raw
+}
+
+// R2 buckets used for Pages Functions.
+type PagesProjectsDeploymentConfigsProductionR2Buckets struct {
+ // R2 binding.
+ R2Binding PagesProjectsDeploymentConfigsProductionR2BucketsR2Binding `json:"R2_BINDING"`
+ JSON pagesProjectsDeploymentConfigsProductionR2BucketsJSON `json:"-"`
+}
+
+// pagesProjectsDeploymentConfigsProductionR2BucketsJSON contains the JSON metadata
+// for the struct [PagesProjectsDeploymentConfigsProductionR2Buckets]
+type pagesProjectsDeploymentConfigsProductionR2BucketsJSON struct {
+ R2Binding apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PagesProjectsDeploymentConfigsProductionR2Buckets) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r pagesProjectsDeploymentConfigsProductionR2BucketsJSON) RawJSON() string {
+ return r.raw
+}
+
+// R2 binding.
+type PagesProjectsDeploymentConfigsProductionR2BucketsR2Binding struct {
+ // Name of the R2 bucket.
+ Name string `json:"name"`
+ JSON pagesProjectsDeploymentConfigsProductionR2BucketsR2BindingJSON `json:"-"`
+}
+
+// pagesProjectsDeploymentConfigsProductionR2BucketsR2BindingJSON contains the JSON
+// metadata for the struct
+// [PagesProjectsDeploymentConfigsProductionR2BucketsR2Binding]
+type pagesProjectsDeploymentConfigsProductionR2BucketsR2BindingJSON struct {
+ Name apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PagesProjectsDeploymentConfigsProductionR2BucketsR2Binding) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r pagesProjectsDeploymentConfigsProductionR2BucketsR2BindingJSON) RawJSON() string {
+ return r.raw
+}
+
+// Services used for Pages Functions.
+type PagesProjectsDeploymentConfigsProductionServiceBindings struct {
+ // Service binding.
+ ServiceBinding PagesProjectsDeploymentConfigsProductionServiceBindingsServiceBinding `json:"SERVICE_BINDING"`
+ JSON pagesProjectsDeploymentConfigsProductionServiceBindingsJSON `json:"-"`
+}
+
+// pagesProjectsDeploymentConfigsProductionServiceBindingsJSON contains the JSON
+// metadata for the struct
+// [PagesProjectsDeploymentConfigsProductionServiceBindings]
+type pagesProjectsDeploymentConfigsProductionServiceBindingsJSON struct {
+ ServiceBinding apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PagesProjectsDeploymentConfigsProductionServiceBindings) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r pagesProjectsDeploymentConfigsProductionServiceBindingsJSON) RawJSON() string {
+ return r.raw
+}
+
+// Service binding.
+type PagesProjectsDeploymentConfigsProductionServiceBindingsServiceBinding struct {
+ // The Service environment.
+ Environment string `json:"environment"`
+ // The Service name.
+ Service string `json:"service"`
+ JSON pagesProjectsDeploymentConfigsProductionServiceBindingsServiceBindingJSON `json:"-"`
+}
+
+// pagesProjectsDeploymentConfigsProductionServiceBindingsServiceBindingJSON
+// contains the JSON metadata for the struct
+// [PagesProjectsDeploymentConfigsProductionServiceBindingsServiceBinding]
+type pagesProjectsDeploymentConfigsProductionServiceBindingsServiceBindingJSON struct {
+ Environment apijson.Field
+ Service apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PagesProjectsDeploymentConfigsProductionServiceBindingsServiceBinding) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r pagesProjectsDeploymentConfigsProductionServiceBindingsServiceBindingJSON) RawJSON() string {
+ return r.raw
+}
+
+// Union satisfied by [pages.ProjectNewResponseUnknown],
+// [pages.ProjectNewResponseArray] or [shared.UnionString].
+type ProjectNewResponse interface {
+ ImplementsPagesProjectNewResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*ProjectNewResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(ProjectNewResponseArray{}),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+type ProjectNewResponseArray []interface{}
+
+func (r ProjectNewResponseArray) ImplementsPagesProjectNewResponse() {}
+
+type ProjectDeleteResponse = interface{}
+
+// Union satisfied by [pages.ProjectEditResponseUnknown],
+// [pages.ProjectEditResponseArray] or [shared.UnionString].
+type ProjectEditResponse interface {
+ ImplementsPagesProjectEditResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*ProjectEditResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(ProjectEditResponseArray{}),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+type ProjectEditResponseArray []interface{}
+
+func (r ProjectEditResponseArray) ImplementsPagesProjectEditResponse() {}
+
+type ProjectPurgeBuildCacheResponse = interface{}
+
+type ProjectNewParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ // Configs for the project build process.
+ BuildConfig param.Field[ProjectNewParamsBuildConfig] `json:"build_config"`
+ CanonicalDeployment param.Field[PagesDeploymentsParam] `json:"canonical_deployment"`
+ // Configs for deployments in a project.
+ DeploymentConfigs param.Field[ProjectNewParamsDeploymentConfigs] `json:"deployment_configs"`
+ LatestDeployment param.Field[PagesDeploymentsParam] `json:"latest_deployment"`
+ // Name of the project.
+ Name param.Field[string] `json:"name"`
+ // Production branch of the project. Used to identify production deployments.
+ ProductionBranch param.Field[string] `json:"production_branch"`
+}
+
+func (r ProjectNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Configs for the project build process.
+type ProjectNewParamsBuildConfig struct {
+ // Enable build caching for the project.
+ BuildCaching param.Field[bool] `json:"build_caching"`
+ // Command used to build project.
+ BuildCommand param.Field[string] `json:"build_command"`
+ // Output directory of the build.
+ DestinationDir param.Field[string] `json:"destination_dir"`
+ // Directory to run the command.
+ RootDir param.Field[string] `json:"root_dir"`
+ // The classifying tag for analytics.
+ WebAnalyticsTag param.Field[string] `json:"web_analytics_tag"`
+ // The auth token for analytics.
+ WebAnalyticsToken param.Field[string] `json:"web_analytics_token"`
+}
+
+func (r ProjectNewParamsBuildConfig) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Configs for deployments in a project.
+type ProjectNewParamsDeploymentConfigs struct {
+ // Configs for preview deploys.
+ Preview param.Field[ProjectNewParamsDeploymentConfigsPreview] `json:"preview"`
+ // Configs for production deploys.
+ Production param.Field[ProjectNewParamsDeploymentConfigsProduction] `json:"production"`
+}
+
+func (r ProjectNewParamsDeploymentConfigs) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Configs for preview deploys.
+type ProjectNewParamsDeploymentConfigsPreview struct {
+ // Constellation bindings used for Pages Functions.
+ AIBindings param.Field[ProjectNewParamsDeploymentConfigsPreviewAIBindings] `json:"ai_bindings"`
+ // Analytics Engine bindings used for Pages Functions.
+ AnalyticsEngineDatasets param.Field[ProjectNewParamsDeploymentConfigsPreviewAnalyticsEngineDatasets] `json:"analytics_engine_datasets"`
+ // Compatibility date used for Pages Functions.
+ CompatibilityDate param.Field[string] `json:"compatibility_date"`
+ // Compatibility flags used for Pages Functions.
+ CompatibilityFlags param.Field[[]interface{}] `json:"compatibility_flags"`
+ // D1 databases used for Pages Functions.
+ D1Databases param.Field[ProjectNewParamsDeploymentConfigsPreviewD1Databases] `json:"d1_databases"`
+ // Durabble Object namespaces used for Pages Functions.
+ DurableObjectNamespaces param.Field[ProjectNewParamsDeploymentConfigsPreviewDurableObjectNamespaces] `json:"durable_object_namespaces"`
+ // Environment variables for build configs.
+ EnvVars param.Field[ProjectNewParamsDeploymentConfigsPreviewEnvVars] `json:"env_vars"`
+ // KV namespaces used for Pages Functions.
+ KVNamespaces param.Field[ProjectNewParamsDeploymentConfigsPreviewKVNamespaces] `json:"kv_namespaces"`
+ // Placement setting used for Pages Functions.
+ Placement param.Field[ProjectNewParamsDeploymentConfigsPreviewPlacement] `json:"placement"`
+ // Queue Producer bindings used for Pages Functions.
+ QueueProducers param.Field[ProjectNewParamsDeploymentConfigsPreviewQueueProducers] `json:"queue_producers"`
+ // R2 buckets used for Pages Functions.
+ R2Buckets param.Field[ProjectNewParamsDeploymentConfigsPreviewR2Buckets] `json:"r2_buckets"`
+ // Services used for Pages Functions.
+ ServiceBindings param.Field[ProjectNewParamsDeploymentConfigsPreviewServiceBindings] `json:"service_bindings"`
+}
+
+func (r ProjectNewParamsDeploymentConfigsPreview) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Constellation bindings used for Pages Functions.
+type ProjectNewParamsDeploymentConfigsPreviewAIBindings struct {
+ // AI binding.
+ AIBinding param.Field[ProjectNewParamsDeploymentConfigsPreviewAIBindingsAIBinding] `json:"AI_BINDING"`
+}
+
+func (r ProjectNewParamsDeploymentConfigsPreviewAIBindings) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// AI binding.
+type ProjectNewParamsDeploymentConfigsPreviewAIBindingsAIBinding struct {
+ ProjectID param.Field[interface{}] `json:"project_id"`
+}
+
+func (r ProjectNewParamsDeploymentConfigsPreviewAIBindingsAIBinding) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Analytics Engine bindings used for Pages Functions.
+type ProjectNewParamsDeploymentConfigsPreviewAnalyticsEngineDatasets struct {
+ // Analytics Engine binding.
+ AnalyticsEngineBinding param.Field[ProjectNewParamsDeploymentConfigsPreviewAnalyticsEngineDatasetsAnalyticsEngineBinding] `json:"ANALYTICS_ENGINE_BINDING"`
+}
+
+func (r ProjectNewParamsDeploymentConfigsPreviewAnalyticsEngineDatasets) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Analytics Engine binding.
+type ProjectNewParamsDeploymentConfigsPreviewAnalyticsEngineDatasetsAnalyticsEngineBinding struct {
+ // Name of the dataset.
+ Dataset param.Field[string] `json:"dataset"`
+}
+
+func (r ProjectNewParamsDeploymentConfigsPreviewAnalyticsEngineDatasetsAnalyticsEngineBinding) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// D1 databases used for Pages Functions.
+type ProjectNewParamsDeploymentConfigsPreviewD1Databases struct {
+ // D1 binding.
+ D1Binding param.Field[ProjectNewParamsDeploymentConfigsPreviewD1DatabasesD1Binding] `json:"D1_BINDING"`
+}
+
+func (r ProjectNewParamsDeploymentConfigsPreviewD1Databases) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// D1 binding.
+type ProjectNewParamsDeploymentConfigsPreviewD1DatabasesD1Binding struct {
+ // UUID of the D1 database.
+ ID param.Field[string] `json:"id"`
+}
+
+func (r ProjectNewParamsDeploymentConfigsPreviewD1DatabasesD1Binding) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Durabble Object namespaces used for Pages Functions.
+type ProjectNewParamsDeploymentConfigsPreviewDurableObjectNamespaces struct {
+ // Durabble Object binding.
+ DoBinding param.Field[ProjectNewParamsDeploymentConfigsPreviewDurableObjectNamespacesDoBinding] `json:"DO_BINDING"`
+}
+
+func (r ProjectNewParamsDeploymentConfigsPreviewDurableObjectNamespaces) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Durabble Object binding.
+type ProjectNewParamsDeploymentConfigsPreviewDurableObjectNamespacesDoBinding struct {
+ // ID of the Durabble Object namespace.
+ NamespaceID param.Field[string] `json:"namespace_id"`
+}
+
+func (r ProjectNewParamsDeploymentConfigsPreviewDurableObjectNamespacesDoBinding) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Environment variables for build configs.
+type ProjectNewParamsDeploymentConfigsPreviewEnvVars struct {
+ // Environment variable.
+ EnvironmentVariable param.Field[ProjectNewParamsDeploymentConfigsPreviewEnvVarsEnvironmentVariable] `json:"ENVIRONMENT_VARIABLE"`
+}
+
+func (r ProjectNewParamsDeploymentConfigsPreviewEnvVars) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Environment variable.
+type ProjectNewParamsDeploymentConfigsPreviewEnvVarsEnvironmentVariable struct {
+ // The type of environment variable (plain text or secret)
+ Type param.Field[ProjectNewParamsDeploymentConfigsPreviewEnvVarsEnvironmentVariableType] `json:"type"`
+ // Environment variable value.
+ Value param.Field[string] `json:"value"`
+}
+
+func (r ProjectNewParamsDeploymentConfigsPreviewEnvVarsEnvironmentVariable) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The type of environment variable (plain text or secret)
+type ProjectNewParamsDeploymentConfigsPreviewEnvVarsEnvironmentVariableType string
+
+const (
+ ProjectNewParamsDeploymentConfigsPreviewEnvVarsEnvironmentVariableTypePlainText ProjectNewParamsDeploymentConfigsPreviewEnvVarsEnvironmentVariableType = "plain_text"
+ ProjectNewParamsDeploymentConfigsPreviewEnvVarsEnvironmentVariableTypeSecretText ProjectNewParamsDeploymentConfigsPreviewEnvVarsEnvironmentVariableType = "secret_text"
+)
+
+// KV namespaces used for Pages Functions.
+type ProjectNewParamsDeploymentConfigsPreviewKVNamespaces struct {
+ // KV binding.
+ KVBinding param.Field[ProjectNewParamsDeploymentConfigsPreviewKVNamespacesKVBinding] `json:"KV_BINDING"`
+}
+
+func (r ProjectNewParamsDeploymentConfigsPreviewKVNamespaces) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// KV binding.
+type ProjectNewParamsDeploymentConfigsPreviewKVNamespacesKVBinding struct {
+ // ID of the KV namespace.
+ NamespaceID param.Field[string] `json:"namespace_id"`
+}
+
+func (r ProjectNewParamsDeploymentConfigsPreviewKVNamespacesKVBinding) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Placement setting used for Pages Functions.
+type ProjectNewParamsDeploymentConfigsPreviewPlacement struct {
+ // Placement mode.
+ Mode param.Field[string] `json:"mode"`
+}
+
+func (r ProjectNewParamsDeploymentConfigsPreviewPlacement) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Queue Producer bindings used for Pages Functions.
+type ProjectNewParamsDeploymentConfigsPreviewQueueProducers struct {
+ // Queue Producer binding.
+ QueueProducerBinding param.Field[ProjectNewParamsDeploymentConfigsPreviewQueueProducersQueueProducerBinding] `json:"QUEUE_PRODUCER_BINDING"`
+}
+
+func (r ProjectNewParamsDeploymentConfigsPreviewQueueProducers) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Queue Producer binding.
+type ProjectNewParamsDeploymentConfigsPreviewQueueProducersQueueProducerBinding struct {
+ // Name of the Queue.
+ Name param.Field[string] `json:"name"`
+}
+
+func (r ProjectNewParamsDeploymentConfigsPreviewQueueProducersQueueProducerBinding) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// R2 buckets used for Pages Functions.
+type ProjectNewParamsDeploymentConfigsPreviewR2Buckets struct {
+ // R2 binding.
+ R2Binding param.Field[ProjectNewParamsDeploymentConfigsPreviewR2BucketsR2Binding] `json:"R2_BINDING"`
+}
+
+func (r ProjectNewParamsDeploymentConfigsPreviewR2Buckets) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// R2 binding.
+type ProjectNewParamsDeploymentConfigsPreviewR2BucketsR2Binding struct {
+ // Name of the R2 bucket.
+ Name param.Field[string] `json:"name"`
+}
+
+func (r ProjectNewParamsDeploymentConfigsPreviewR2BucketsR2Binding) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Services used for Pages Functions.
+type ProjectNewParamsDeploymentConfigsPreviewServiceBindings struct {
+ // Service binding.
+ ServiceBinding param.Field[ProjectNewParamsDeploymentConfigsPreviewServiceBindingsServiceBinding] `json:"SERVICE_BINDING"`
+}
+
+func (r ProjectNewParamsDeploymentConfigsPreviewServiceBindings) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Service binding.
+type ProjectNewParamsDeploymentConfigsPreviewServiceBindingsServiceBinding struct {
+ // The Service environment.
+ Environment param.Field[string] `json:"environment"`
+ // The Service name.
+ Service param.Field[string] `json:"service"`
+}
+
+func (r ProjectNewParamsDeploymentConfigsPreviewServiceBindingsServiceBinding) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Configs for production deploys.
+type ProjectNewParamsDeploymentConfigsProduction struct {
+ // Constellation bindings used for Pages Functions.
+ AIBindings param.Field[ProjectNewParamsDeploymentConfigsProductionAIBindings] `json:"ai_bindings"`
+ // Analytics Engine bindings used for Pages Functions.
+ AnalyticsEngineDatasets param.Field[ProjectNewParamsDeploymentConfigsProductionAnalyticsEngineDatasets] `json:"analytics_engine_datasets"`
+ // Compatibility date used for Pages Functions.
+ CompatibilityDate param.Field[string] `json:"compatibility_date"`
+ // Compatibility flags used for Pages Functions.
+ CompatibilityFlags param.Field[[]interface{}] `json:"compatibility_flags"`
+ // D1 databases used for Pages Functions.
+ D1Databases param.Field[ProjectNewParamsDeploymentConfigsProductionD1Databases] `json:"d1_databases"`
+ // Durabble Object namespaces used for Pages Functions.
+ DurableObjectNamespaces param.Field[ProjectNewParamsDeploymentConfigsProductionDurableObjectNamespaces] `json:"durable_object_namespaces"`
+ // Environment variables for build configs.
+ EnvVars param.Field[ProjectNewParamsDeploymentConfigsProductionEnvVars] `json:"env_vars"`
+ // KV namespaces used for Pages Functions.
+ KVNamespaces param.Field[ProjectNewParamsDeploymentConfigsProductionKVNamespaces] `json:"kv_namespaces"`
+ // Placement setting used for Pages Functions.
+ Placement param.Field[ProjectNewParamsDeploymentConfigsProductionPlacement] `json:"placement"`
+ // Queue Producer bindings used for Pages Functions.
+ QueueProducers param.Field[ProjectNewParamsDeploymentConfigsProductionQueueProducers] `json:"queue_producers"`
+ // R2 buckets used for Pages Functions.
+ R2Buckets param.Field[ProjectNewParamsDeploymentConfigsProductionR2Buckets] `json:"r2_buckets"`
+ // Services used for Pages Functions.
+ ServiceBindings param.Field[ProjectNewParamsDeploymentConfigsProductionServiceBindings] `json:"service_bindings"`
+}
+
+func (r ProjectNewParamsDeploymentConfigsProduction) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Constellation bindings used for Pages Functions.
+type ProjectNewParamsDeploymentConfigsProductionAIBindings struct {
+ // AI binding.
+ AIBinding param.Field[ProjectNewParamsDeploymentConfigsProductionAIBindingsAIBinding] `json:"AI_BINDING"`
+}
+
+func (r ProjectNewParamsDeploymentConfigsProductionAIBindings) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// AI binding.
+type ProjectNewParamsDeploymentConfigsProductionAIBindingsAIBinding struct {
+ ProjectID param.Field[interface{}] `json:"project_id"`
+}
+
+func (r ProjectNewParamsDeploymentConfigsProductionAIBindingsAIBinding) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Analytics Engine bindings used for Pages Functions.
+type ProjectNewParamsDeploymentConfigsProductionAnalyticsEngineDatasets struct {
+ // Analytics Engine binding.
+ AnalyticsEngineBinding param.Field[ProjectNewParamsDeploymentConfigsProductionAnalyticsEngineDatasetsAnalyticsEngineBinding] `json:"ANALYTICS_ENGINE_BINDING"`
+}
+
+func (r ProjectNewParamsDeploymentConfigsProductionAnalyticsEngineDatasets) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Analytics Engine binding.
+type ProjectNewParamsDeploymentConfigsProductionAnalyticsEngineDatasetsAnalyticsEngineBinding struct {
+ // Name of the dataset.
+ Dataset param.Field[string] `json:"dataset"`
+}
+
+func (r ProjectNewParamsDeploymentConfigsProductionAnalyticsEngineDatasetsAnalyticsEngineBinding) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// D1 databases used for Pages Functions.
+type ProjectNewParamsDeploymentConfigsProductionD1Databases struct {
+ // D1 binding.
+ D1Binding param.Field[ProjectNewParamsDeploymentConfigsProductionD1DatabasesD1Binding] `json:"D1_BINDING"`
+}
+
+func (r ProjectNewParamsDeploymentConfigsProductionD1Databases) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// D1 binding.
+type ProjectNewParamsDeploymentConfigsProductionD1DatabasesD1Binding struct {
+ // UUID of the D1 database.
+ ID param.Field[string] `json:"id"`
+}
+
+func (r ProjectNewParamsDeploymentConfigsProductionD1DatabasesD1Binding) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Durabble Object namespaces used for Pages Functions.
+type ProjectNewParamsDeploymentConfigsProductionDurableObjectNamespaces struct {
+ // Durabble Object binding.
+ DoBinding param.Field[ProjectNewParamsDeploymentConfigsProductionDurableObjectNamespacesDoBinding] `json:"DO_BINDING"`
+}
+
+func (r ProjectNewParamsDeploymentConfigsProductionDurableObjectNamespaces) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Durabble Object binding.
+type ProjectNewParamsDeploymentConfigsProductionDurableObjectNamespacesDoBinding struct {
+ // ID of the Durabble Object namespace.
+ NamespaceID param.Field[string] `json:"namespace_id"`
+}
+
+func (r ProjectNewParamsDeploymentConfigsProductionDurableObjectNamespacesDoBinding) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Environment variables for build configs.
+type ProjectNewParamsDeploymentConfigsProductionEnvVars struct {
+ // Environment variable.
+ EnvironmentVariable param.Field[ProjectNewParamsDeploymentConfigsProductionEnvVarsEnvironmentVariable] `json:"ENVIRONMENT_VARIABLE"`
+}
+
+func (r ProjectNewParamsDeploymentConfigsProductionEnvVars) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Environment variable.
+type ProjectNewParamsDeploymentConfigsProductionEnvVarsEnvironmentVariable struct {
+ // The type of environment variable (plain text or secret)
+ Type param.Field[ProjectNewParamsDeploymentConfigsProductionEnvVarsEnvironmentVariableType] `json:"type"`
+ // Environment variable value.
+ Value param.Field[string] `json:"value"`
+}
+
+func (r ProjectNewParamsDeploymentConfigsProductionEnvVarsEnvironmentVariable) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The type of environment variable (plain text or secret)
+type ProjectNewParamsDeploymentConfigsProductionEnvVarsEnvironmentVariableType string
+
+const (
+ ProjectNewParamsDeploymentConfigsProductionEnvVarsEnvironmentVariableTypePlainText ProjectNewParamsDeploymentConfigsProductionEnvVarsEnvironmentVariableType = "plain_text"
+ ProjectNewParamsDeploymentConfigsProductionEnvVarsEnvironmentVariableTypeSecretText ProjectNewParamsDeploymentConfigsProductionEnvVarsEnvironmentVariableType = "secret_text"
+)
+
+// KV namespaces used for Pages Functions.
+type ProjectNewParamsDeploymentConfigsProductionKVNamespaces struct {
+ // KV binding.
+ KVBinding param.Field[ProjectNewParamsDeploymentConfigsProductionKVNamespacesKVBinding] `json:"KV_BINDING"`
+}
+
+func (r ProjectNewParamsDeploymentConfigsProductionKVNamespaces) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// KV binding.
+type ProjectNewParamsDeploymentConfigsProductionKVNamespacesKVBinding struct {
+ // ID of the KV namespace.
+ NamespaceID param.Field[string] `json:"namespace_id"`
+}
+
+func (r ProjectNewParamsDeploymentConfigsProductionKVNamespacesKVBinding) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Placement setting used for Pages Functions.
+type ProjectNewParamsDeploymentConfigsProductionPlacement struct {
+ // Placement mode.
+ Mode param.Field[string] `json:"mode"`
+}
+
+func (r ProjectNewParamsDeploymentConfigsProductionPlacement) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Queue Producer bindings used for Pages Functions.
+type ProjectNewParamsDeploymentConfigsProductionQueueProducers struct {
+ // Queue Producer binding.
+ QueueProducerBinding param.Field[ProjectNewParamsDeploymentConfigsProductionQueueProducersQueueProducerBinding] `json:"QUEUE_PRODUCER_BINDING"`
+}
+
+func (r ProjectNewParamsDeploymentConfigsProductionQueueProducers) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Queue Producer binding.
+type ProjectNewParamsDeploymentConfigsProductionQueueProducersQueueProducerBinding struct {
+ // Name of the Queue.
+ Name param.Field[string] `json:"name"`
+}
+
+func (r ProjectNewParamsDeploymentConfigsProductionQueueProducersQueueProducerBinding) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// R2 buckets used for Pages Functions.
+type ProjectNewParamsDeploymentConfigsProductionR2Buckets struct {
+ // R2 binding.
+ R2Binding param.Field[ProjectNewParamsDeploymentConfigsProductionR2BucketsR2Binding] `json:"R2_BINDING"`
+}
+
+func (r ProjectNewParamsDeploymentConfigsProductionR2Buckets) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// R2 binding.
+type ProjectNewParamsDeploymentConfigsProductionR2BucketsR2Binding struct {
+ // Name of the R2 bucket.
+ Name param.Field[string] `json:"name"`
+}
+
+func (r ProjectNewParamsDeploymentConfigsProductionR2BucketsR2Binding) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Services used for Pages Functions.
+type ProjectNewParamsDeploymentConfigsProductionServiceBindings struct {
+ // Service binding.
+ ServiceBinding param.Field[ProjectNewParamsDeploymentConfigsProductionServiceBindingsServiceBinding] `json:"SERVICE_BINDING"`
+}
+
+func (r ProjectNewParamsDeploymentConfigsProductionServiceBindings) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Service binding.
+type ProjectNewParamsDeploymentConfigsProductionServiceBindingsServiceBinding struct {
+ // The Service environment.
+ Environment param.Field[string] `json:"environment"`
+ // The Service name.
+ Service param.Field[string] `json:"service"`
+}
+
+func (r ProjectNewParamsDeploymentConfigsProductionServiceBindingsServiceBinding) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type ProjectNewResponseEnvelope struct {
+ Errors []ProjectNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []ProjectNewResponseEnvelopeMessages `json:"messages,required"`
+ Result ProjectNewResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success ProjectNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON projectNewResponseEnvelopeJSON `json:"-"`
+}
+
+// projectNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [ProjectNewResponseEnvelope]
+type projectNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ProjectNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r projectNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type ProjectNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON projectNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// projectNewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [ProjectNewResponseEnvelopeErrors]
+type projectNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ProjectNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r projectNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type ProjectNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON projectNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// projectNewResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [ProjectNewResponseEnvelopeMessages]
+type projectNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ProjectNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r projectNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type ProjectNewResponseEnvelopeSuccess bool
+
+const (
+ ProjectNewResponseEnvelopeSuccessTrue ProjectNewResponseEnvelopeSuccess = true
+)
+
+type ProjectListParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type ProjectListResponseEnvelope struct {
+ Errors []ProjectListResponseEnvelopeErrors `json:"errors,required"`
+ Messages []ProjectListResponseEnvelopeMessages `json:"messages,required"`
+ Result []PagesDeployments `json:"result,required"`
+ // Whether the API call was successful
+ Success ProjectListResponseEnvelopeSuccess `json:"success,required"`
+ ResultInfo ProjectListResponseEnvelopeResultInfo `json:"result_info"`
+ JSON projectListResponseEnvelopeJSON `json:"-"`
+}
+
+// projectListResponseEnvelopeJSON contains the JSON metadata for the struct
+// [ProjectListResponseEnvelope]
+type projectListResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ ResultInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ProjectListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r projectListResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type ProjectListResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON projectListResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// projectListResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [ProjectListResponseEnvelopeErrors]
+type projectListResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ProjectListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r projectListResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type ProjectListResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON projectListResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// projectListResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [ProjectListResponseEnvelopeMessages]
+type projectListResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ProjectListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r projectListResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type ProjectListResponseEnvelopeSuccess bool
+
+const (
+ ProjectListResponseEnvelopeSuccessTrue ProjectListResponseEnvelopeSuccess = true
+)
+
+type ProjectListResponseEnvelopeResultInfo struct {
+ Count interface{} `json:"count"`
+ Page interface{} `json:"page"`
+ PerPage interface{} `json:"per_page"`
+ TotalCount interface{} `json:"total_count"`
+ JSON projectListResponseEnvelopeResultInfoJSON `json:"-"`
+}
+
+// projectListResponseEnvelopeResultInfoJSON contains the JSON metadata for the
+// struct [ProjectListResponseEnvelopeResultInfo]
+type projectListResponseEnvelopeResultInfoJSON struct {
+ Count apijson.Field
+ Page apijson.Field
+ PerPage apijson.Field
+ TotalCount apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ProjectListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r projectListResponseEnvelopeResultInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type ProjectDeleteParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type ProjectEditParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ Body param.Field[interface{}] `json:"body,required"`
+}
+
+func (r ProjectEditParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r.Body)
+}
+
+type ProjectEditResponseEnvelope struct {
+ Errors []ProjectEditResponseEnvelopeErrors `json:"errors,required"`
+ Messages []ProjectEditResponseEnvelopeMessages `json:"messages,required"`
+ Result ProjectEditResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success ProjectEditResponseEnvelopeSuccess `json:"success,required"`
+ JSON projectEditResponseEnvelopeJSON `json:"-"`
+}
+
+// projectEditResponseEnvelopeJSON contains the JSON metadata for the struct
+// [ProjectEditResponseEnvelope]
+type projectEditResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ProjectEditResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r projectEditResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type ProjectEditResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON projectEditResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// projectEditResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [ProjectEditResponseEnvelopeErrors]
+type projectEditResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ProjectEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r projectEditResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type ProjectEditResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON projectEditResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// projectEditResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [ProjectEditResponseEnvelopeMessages]
+type projectEditResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ProjectEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r projectEditResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type ProjectEditResponseEnvelopeSuccess bool
+
+const (
+ ProjectEditResponseEnvelopeSuccessTrue ProjectEditResponseEnvelopeSuccess = true
+)
+
+type ProjectGetParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type ProjectGetResponseEnvelope struct {
+ Errors []ProjectGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []ProjectGetResponseEnvelopeMessages `json:"messages,required"`
+ Result PagesProjects `json:"result,required"`
+ // Whether the API call was successful
+ Success ProjectGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON projectGetResponseEnvelopeJSON `json:"-"`
+}
+
+// projectGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [ProjectGetResponseEnvelope]
+type projectGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ProjectGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r projectGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type ProjectGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON projectGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// projectGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [ProjectGetResponseEnvelopeErrors]
+type projectGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ProjectGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r projectGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type ProjectGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON projectGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// projectGetResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [ProjectGetResponseEnvelopeMessages]
+type projectGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ProjectGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r projectGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type ProjectGetResponseEnvelopeSuccess bool
+
+const (
+ ProjectGetResponseEnvelopeSuccessTrue ProjectGetResponseEnvelopeSuccess = true
+)
+
+type ProjectPurgeBuildCacheParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
diff --git a/pages/project_test.go b/pages/project_test.go
new file mode 100644
index 00000000000..4e469f3b24c
--- /dev/null
+++ b/pages/project_test.go
@@ -0,0 +1,329 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package pages_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/pages"
+)
+
+func TestProjectNewWithOptionalParams(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"),
+ )
+ _, err := client.Pages.Projects.New(context.TODO(), pages.ProjectNewParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ BuildConfig: cloudflare.F(pages.ProjectNewParamsBuildConfig{
+ BuildCaching: cloudflare.F(true),
+ BuildCommand: cloudflare.F("npm run build"),
+ DestinationDir: cloudflare.F("build"),
+ RootDir: cloudflare.F("/"),
+ WebAnalyticsTag: cloudflare.F("cee1c73f6e4743d0b5e6bb1a0bcaabcc"),
+ WebAnalyticsToken: cloudflare.F("021e1057c18547eca7b79f2516f06o7x"),
+ }),
+ CanonicalDeployment: cloudflare.F(pages.PagesDeploymentsParam{}),
+ DeploymentConfigs: cloudflare.F(pages.ProjectNewParamsDeploymentConfigs{
+ Preview: cloudflare.F(pages.ProjectNewParamsDeploymentConfigsPreview{
+ AIBindings: cloudflare.F(pages.ProjectNewParamsDeploymentConfigsPreviewAIBindings{
+ AIBinding: cloudflare.F(pages.ProjectNewParamsDeploymentConfigsPreviewAIBindingsAIBinding{
+ ProjectID: cloudflare.F[any](map[string]interface{}{}),
+ }),
+ }),
+ AnalyticsEngineDatasets: cloudflare.F(pages.ProjectNewParamsDeploymentConfigsPreviewAnalyticsEngineDatasets{
+ AnalyticsEngineBinding: cloudflare.F(pages.ProjectNewParamsDeploymentConfigsPreviewAnalyticsEngineDatasetsAnalyticsEngineBinding{
+ Dataset: cloudflare.F("api_analytics"),
+ }),
+ }),
+ CompatibilityDate: cloudflare.F("2022-01-01"),
+ CompatibilityFlags: cloudflare.F([]interface{}{"url_standard"}),
+ D1Databases: cloudflare.F(pages.ProjectNewParamsDeploymentConfigsPreviewD1Databases{
+ D1Binding: cloudflare.F(pages.ProjectNewParamsDeploymentConfigsPreviewD1DatabasesD1Binding{
+ ID: cloudflare.F("445e2955-951a-43f8-a35b-a4d0c8138f63"),
+ }),
+ }),
+ DurableObjectNamespaces: cloudflare.F(pages.ProjectNewParamsDeploymentConfigsPreviewDurableObjectNamespaces{
+ DoBinding: cloudflare.F(pages.ProjectNewParamsDeploymentConfigsPreviewDurableObjectNamespacesDoBinding{
+ NamespaceID: cloudflare.F("5eb63bbbe01eeed093cb22bb8f5acdc3"),
+ }),
+ }),
+ EnvVars: cloudflare.F(pages.ProjectNewParamsDeploymentConfigsPreviewEnvVars{
+ EnvironmentVariable: cloudflare.F(pages.ProjectNewParamsDeploymentConfigsPreviewEnvVarsEnvironmentVariable{
+ Type: cloudflare.F(pages.ProjectNewParamsDeploymentConfigsPreviewEnvVarsEnvironmentVariableTypePlainText),
+ Value: cloudflare.F("hello world"),
+ }),
+ }),
+ KVNamespaces: cloudflare.F(pages.ProjectNewParamsDeploymentConfigsPreviewKVNamespaces{
+ KVBinding: cloudflare.F(pages.ProjectNewParamsDeploymentConfigsPreviewKVNamespacesKVBinding{
+ NamespaceID: cloudflare.F("5eb63bbbe01eeed093cb22bb8f5acdc3"),
+ }),
+ }),
+ Placement: cloudflare.F(pages.ProjectNewParamsDeploymentConfigsPreviewPlacement{
+ Mode: cloudflare.F("smart"),
+ }),
+ QueueProducers: cloudflare.F(pages.ProjectNewParamsDeploymentConfigsPreviewQueueProducers{
+ QueueProducerBinding: cloudflare.F(pages.ProjectNewParamsDeploymentConfigsPreviewQueueProducersQueueProducerBinding{
+ Name: cloudflare.F("some-queue"),
+ }),
+ }),
+ R2Buckets: cloudflare.F(pages.ProjectNewParamsDeploymentConfigsPreviewR2Buckets{
+ R2Binding: cloudflare.F(pages.ProjectNewParamsDeploymentConfigsPreviewR2BucketsR2Binding{
+ Name: cloudflare.F("some-bucket"),
+ }),
+ }),
+ ServiceBindings: cloudflare.F(pages.ProjectNewParamsDeploymentConfigsPreviewServiceBindings{
+ ServiceBinding: cloudflare.F(pages.ProjectNewParamsDeploymentConfigsPreviewServiceBindingsServiceBinding{
+ Environment: cloudflare.F("production"),
+ Service: cloudflare.F("example-worker"),
+ }),
+ }),
+ }),
+ Production: cloudflare.F(pages.ProjectNewParamsDeploymentConfigsProduction{
+ AIBindings: cloudflare.F(pages.ProjectNewParamsDeploymentConfigsProductionAIBindings{
+ AIBinding: cloudflare.F(pages.ProjectNewParamsDeploymentConfigsProductionAIBindingsAIBinding{
+ ProjectID: cloudflare.F[any](map[string]interface{}{}),
+ }),
+ }),
+ AnalyticsEngineDatasets: cloudflare.F(pages.ProjectNewParamsDeploymentConfigsProductionAnalyticsEngineDatasets{
+ AnalyticsEngineBinding: cloudflare.F(pages.ProjectNewParamsDeploymentConfigsProductionAnalyticsEngineDatasetsAnalyticsEngineBinding{
+ Dataset: cloudflare.F("api_analytics"),
+ }),
+ }),
+ CompatibilityDate: cloudflare.F("2022-01-01"),
+ CompatibilityFlags: cloudflare.F([]interface{}{"url_standard"}),
+ D1Databases: cloudflare.F(pages.ProjectNewParamsDeploymentConfigsProductionD1Databases{
+ D1Binding: cloudflare.F(pages.ProjectNewParamsDeploymentConfigsProductionD1DatabasesD1Binding{
+ ID: cloudflare.F("445e2955-951a-43f8-a35b-a4d0c8138f63"),
+ }),
+ }),
+ DurableObjectNamespaces: cloudflare.F(pages.ProjectNewParamsDeploymentConfigsProductionDurableObjectNamespaces{
+ DoBinding: cloudflare.F(pages.ProjectNewParamsDeploymentConfigsProductionDurableObjectNamespacesDoBinding{
+ NamespaceID: cloudflare.F("5eb63bbbe01eeed093cb22bb8f5acdc3"),
+ }),
+ }),
+ EnvVars: cloudflare.F(pages.ProjectNewParamsDeploymentConfigsProductionEnvVars{
+ EnvironmentVariable: cloudflare.F(pages.ProjectNewParamsDeploymentConfigsProductionEnvVarsEnvironmentVariable{
+ Type: cloudflare.F(pages.ProjectNewParamsDeploymentConfigsProductionEnvVarsEnvironmentVariableTypePlainText),
+ Value: cloudflare.F("hello world"),
+ }),
+ }),
+ KVNamespaces: cloudflare.F(pages.ProjectNewParamsDeploymentConfigsProductionKVNamespaces{
+ KVBinding: cloudflare.F(pages.ProjectNewParamsDeploymentConfigsProductionKVNamespacesKVBinding{
+ NamespaceID: cloudflare.F("5eb63bbbe01eeed093cb22bb8f5acdc3"),
+ }),
+ }),
+ Placement: cloudflare.F(pages.ProjectNewParamsDeploymentConfigsProductionPlacement{
+ Mode: cloudflare.F("smart"),
+ }),
+ QueueProducers: cloudflare.F(pages.ProjectNewParamsDeploymentConfigsProductionQueueProducers{
+ QueueProducerBinding: cloudflare.F(pages.ProjectNewParamsDeploymentConfigsProductionQueueProducersQueueProducerBinding{
+ Name: cloudflare.F("some-queue"),
+ }),
+ }),
+ R2Buckets: cloudflare.F(pages.ProjectNewParamsDeploymentConfigsProductionR2Buckets{
+ R2Binding: cloudflare.F(pages.ProjectNewParamsDeploymentConfigsProductionR2BucketsR2Binding{
+ Name: cloudflare.F("some-bucket"),
+ }),
+ }),
+ ServiceBindings: cloudflare.F(pages.ProjectNewParamsDeploymentConfigsProductionServiceBindings{
+ ServiceBinding: cloudflare.F(pages.ProjectNewParamsDeploymentConfigsProductionServiceBindingsServiceBinding{
+ Environment: cloudflare.F("production"),
+ Service: cloudflare.F("example-worker"),
+ }),
+ }),
+ }),
+ }),
+ LatestDeployment: cloudflare.F(pages.PagesDeploymentsParam{}),
+ Name: cloudflare.F("NextJS Blog"),
+ ProductionBranch: cloudflare.F("main"),
+ })
+ 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())
+ }
+}
+
+func TestProjectList(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"),
+ )
+ _, err := client.Pages.Projects.List(context.TODO(), pages.ProjectListParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ })
+ 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())
+ }
+}
+
+func TestProjectDelete(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"),
+ )
+ _, err := client.Pages.Projects.Delete(
+ context.TODO(),
+ "this-is-my-project-01",
+ pages.ProjectDeleteParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestProjectEdit(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"),
+ )
+ _, err := client.Pages.Projects.Edit(
+ context.TODO(),
+ "this-is-my-project-01",
+ pages.ProjectEditParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Body: cloudflare.F[any](map[string]interface{}{
+ "deployment_configs": map[string]interface{}{
+ "production": map[string]interface{}{
+ "compatibility_date": "2022-01-01",
+ "compatibility_flags": map[string]interface{}{
+ "0": "url_standard",
+ },
+ "env_vars": map[string]interface{}{
+ "BUILD_VERSION": map[string]interface{}{
+ "value": "3.3",
+ },
+ "delete_this_env_var": nil,
+ "secret_var": map[string]interface{}{
+ "type": "secret_text",
+ "value": "A_CMS_API_TOKEN",
+ },
+ },
+ },
+ },
+ }),
+ },
+ )
+ 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())
+ }
+}
+
+func TestProjectGet(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"),
+ )
+ _, err := client.Pages.Projects.Get(
+ context.TODO(),
+ "this-is-my-project-01",
+ pages.ProjectGetParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestProjectPurgeBuildCache(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"),
+ )
+ _, err := client.Pages.Projects.PurgeBuildCache(
+ context.TODO(),
+ "this-is-my-project-01",
+ pages.ProjectPurgeBuildCacheParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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/pages/projectdeployment.go b/pages/projectdeployment.go
new file mode 100644
index 00000000000..e25abe9ad6e
--- /dev/null
+++ b/pages/projectdeployment.go
@@ -0,0 +1,582 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package pages
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// ProjectDeploymentService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewProjectDeploymentService] method
+// instead.
+type ProjectDeploymentService struct {
+ Options []option.RequestOption
+ History *ProjectDeploymentHistoryService
+}
+
+// NewProjectDeploymentService generates a new service that applies the given
+// options to each request. These options are applied after the parent client's
+// options (if there is one), and before any request-specific options.
+func NewProjectDeploymentService(opts ...option.RequestOption) (r *ProjectDeploymentService) {
+ r = &ProjectDeploymentService{}
+ r.Options = opts
+ r.History = NewProjectDeploymentHistoryService(opts...)
+ return
+}
+
+// Start a new deployment from production. The repository and account must have
+// already been authorized on the Cloudflare Pages dashboard.
+func (r *ProjectDeploymentService) New(ctx context.Context, projectName string, params ProjectDeploymentNewParams, opts ...option.RequestOption) (res *PagesDeployments, err error) {
+ opts = append(r.Options[:], opts...)
+ var env ProjectDeploymentNewResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/pages/projects/%s/deployments", params.AccountID, projectName)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Fetch a list of project deployments.
+func (r *ProjectDeploymentService) List(ctx context.Context, projectName string, query ProjectDeploymentListParams, opts ...option.RequestOption) (res *[]PagesDeployments, err error) {
+ opts = append(r.Options[:], opts...)
+ var env ProjectDeploymentListResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/pages/projects/%s/deployments", query.AccountID, projectName)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Delete a deployment.
+func (r *ProjectDeploymentService) Delete(ctx context.Context, projectName string, deploymentID string, body ProjectDeploymentDeleteParams, opts ...option.RequestOption) (res *ProjectDeploymentDeleteResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ path := fmt.Sprintf("accounts/%s/pages/projects/%s/deployments/%s", body.AccountID, projectName, deploymentID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &res, opts...)
+ return
+}
+
+// Fetch information about a deployment.
+func (r *ProjectDeploymentService) Get(ctx context.Context, projectName string, deploymentID string, query ProjectDeploymentGetParams, opts ...option.RequestOption) (res *PagesDeployments, err error) {
+ opts = append(r.Options[:], opts...)
+ var env ProjectDeploymentGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/pages/projects/%s/deployments/%s", query.AccountID, projectName, deploymentID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Retry a previous deployment.
+func (r *ProjectDeploymentService) Retry(ctx context.Context, projectName string, deploymentID string, body ProjectDeploymentRetryParams, opts ...option.RequestOption) (res *PagesDeployments, err error) {
+ opts = append(r.Options[:], opts...)
+ var env ProjectDeploymentRetryResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/pages/projects/%s/deployments/%s/retry", body.AccountID, projectName, deploymentID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Rollback the production deployment to a previous deployment. You can only
+// rollback to succesful builds on production.
+func (r *ProjectDeploymentService) Rollback(ctx context.Context, projectName string, deploymentID string, body ProjectDeploymentRollbackParams, opts ...option.RequestOption) (res *PagesDeployments, err error) {
+ opts = append(r.Options[:], opts...)
+ var env ProjectDeploymentRollbackResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/pages/projects/%s/deployments/%s/rollback", body.AccountID, projectName, deploymentID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type ProjectDeploymentDeleteResponse = interface{}
+
+type ProjectDeploymentNewParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ // The branch to build the new deployment from. The `HEAD` of the branch will be
+ // used. If omitted, the production branch will be used by default.
+ Branch param.Field[string] `json:"branch"`
+}
+
+func (r ProjectDeploymentNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type ProjectDeploymentNewResponseEnvelope struct {
+ Errors []ProjectDeploymentNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []ProjectDeploymentNewResponseEnvelopeMessages `json:"messages,required"`
+ Result PagesDeployments `json:"result,required"`
+ // Whether the API call was successful
+ Success ProjectDeploymentNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON projectDeploymentNewResponseEnvelopeJSON `json:"-"`
+}
+
+// projectDeploymentNewResponseEnvelopeJSON contains the JSON metadata for the
+// struct [ProjectDeploymentNewResponseEnvelope]
+type projectDeploymentNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ProjectDeploymentNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r projectDeploymentNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type ProjectDeploymentNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON projectDeploymentNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// projectDeploymentNewResponseEnvelopeErrorsJSON contains the JSON metadata for
+// the struct [ProjectDeploymentNewResponseEnvelopeErrors]
+type projectDeploymentNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ProjectDeploymentNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r projectDeploymentNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type ProjectDeploymentNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON projectDeploymentNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// projectDeploymentNewResponseEnvelopeMessagesJSON contains the JSON metadata for
+// the struct [ProjectDeploymentNewResponseEnvelopeMessages]
+type projectDeploymentNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ProjectDeploymentNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r projectDeploymentNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type ProjectDeploymentNewResponseEnvelopeSuccess bool
+
+const (
+ ProjectDeploymentNewResponseEnvelopeSuccessTrue ProjectDeploymentNewResponseEnvelopeSuccess = true
+)
+
+type ProjectDeploymentListParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type ProjectDeploymentListResponseEnvelope struct {
+ Errors []ProjectDeploymentListResponseEnvelopeErrors `json:"errors,required"`
+ Messages []ProjectDeploymentListResponseEnvelopeMessages `json:"messages,required"`
+ Result []PagesDeployments `json:"result,required"`
+ // Whether the API call was successful
+ Success ProjectDeploymentListResponseEnvelopeSuccess `json:"success,required"`
+ ResultInfo ProjectDeploymentListResponseEnvelopeResultInfo `json:"result_info"`
+ JSON projectDeploymentListResponseEnvelopeJSON `json:"-"`
+}
+
+// projectDeploymentListResponseEnvelopeJSON contains the JSON metadata for the
+// struct [ProjectDeploymentListResponseEnvelope]
+type projectDeploymentListResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ ResultInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ProjectDeploymentListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r projectDeploymentListResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type ProjectDeploymentListResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON projectDeploymentListResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// projectDeploymentListResponseEnvelopeErrorsJSON contains the JSON metadata for
+// the struct [ProjectDeploymentListResponseEnvelopeErrors]
+type projectDeploymentListResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ProjectDeploymentListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r projectDeploymentListResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type ProjectDeploymentListResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON projectDeploymentListResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// projectDeploymentListResponseEnvelopeMessagesJSON contains the JSON metadata for
+// the struct [ProjectDeploymentListResponseEnvelopeMessages]
+type projectDeploymentListResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ProjectDeploymentListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r projectDeploymentListResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type ProjectDeploymentListResponseEnvelopeSuccess bool
+
+const (
+ ProjectDeploymentListResponseEnvelopeSuccessTrue ProjectDeploymentListResponseEnvelopeSuccess = true
+)
+
+type ProjectDeploymentListResponseEnvelopeResultInfo struct {
+ Count interface{} `json:"count"`
+ Page interface{} `json:"page"`
+ PerPage interface{} `json:"per_page"`
+ TotalCount interface{} `json:"total_count"`
+ JSON projectDeploymentListResponseEnvelopeResultInfoJSON `json:"-"`
+}
+
+// projectDeploymentListResponseEnvelopeResultInfoJSON contains the JSON metadata
+// for the struct [ProjectDeploymentListResponseEnvelopeResultInfo]
+type projectDeploymentListResponseEnvelopeResultInfoJSON struct {
+ Count apijson.Field
+ Page apijson.Field
+ PerPage apijson.Field
+ TotalCount apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ProjectDeploymentListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r projectDeploymentListResponseEnvelopeResultInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type ProjectDeploymentDeleteParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type ProjectDeploymentGetParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type ProjectDeploymentGetResponseEnvelope struct {
+ Errors []ProjectDeploymentGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []ProjectDeploymentGetResponseEnvelopeMessages `json:"messages,required"`
+ Result PagesDeployments `json:"result,required"`
+ // Whether the API call was successful
+ Success ProjectDeploymentGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON projectDeploymentGetResponseEnvelopeJSON `json:"-"`
+}
+
+// projectDeploymentGetResponseEnvelopeJSON contains the JSON metadata for the
+// struct [ProjectDeploymentGetResponseEnvelope]
+type projectDeploymentGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ProjectDeploymentGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r projectDeploymentGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type ProjectDeploymentGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON projectDeploymentGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// projectDeploymentGetResponseEnvelopeErrorsJSON contains the JSON metadata for
+// the struct [ProjectDeploymentGetResponseEnvelopeErrors]
+type projectDeploymentGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ProjectDeploymentGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r projectDeploymentGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type ProjectDeploymentGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON projectDeploymentGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// projectDeploymentGetResponseEnvelopeMessagesJSON contains the JSON metadata for
+// the struct [ProjectDeploymentGetResponseEnvelopeMessages]
+type projectDeploymentGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ProjectDeploymentGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r projectDeploymentGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type ProjectDeploymentGetResponseEnvelopeSuccess bool
+
+const (
+ ProjectDeploymentGetResponseEnvelopeSuccessTrue ProjectDeploymentGetResponseEnvelopeSuccess = true
+)
+
+type ProjectDeploymentRetryParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type ProjectDeploymentRetryResponseEnvelope struct {
+ Errors []ProjectDeploymentRetryResponseEnvelopeErrors `json:"errors,required"`
+ Messages []ProjectDeploymentRetryResponseEnvelopeMessages `json:"messages,required"`
+ Result PagesDeployments `json:"result,required"`
+ // Whether the API call was successful
+ Success ProjectDeploymentRetryResponseEnvelopeSuccess `json:"success,required"`
+ JSON projectDeploymentRetryResponseEnvelopeJSON `json:"-"`
+}
+
+// projectDeploymentRetryResponseEnvelopeJSON contains the JSON metadata for the
+// struct [ProjectDeploymentRetryResponseEnvelope]
+type projectDeploymentRetryResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ProjectDeploymentRetryResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r projectDeploymentRetryResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type ProjectDeploymentRetryResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON projectDeploymentRetryResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// projectDeploymentRetryResponseEnvelopeErrorsJSON contains the JSON metadata for
+// the struct [ProjectDeploymentRetryResponseEnvelopeErrors]
+type projectDeploymentRetryResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ProjectDeploymentRetryResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r projectDeploymentRetryResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type ProjectDeploymentRetryResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON projectDeploymentRetryResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// projectDeploymentRetryResponseEnvelopeMessagesJSON contains the JSON metadata
+// for the struct [ProjectDeploymentRetryResponseEnvelopeMessages]
+type projectDeploymentRetryResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ProjectDeploymentRetryResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r projectDeploymentRetryResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type ProjectDeploymentRetryResponseEnvelopeSuccess bool
+
+const (
+ ProjectDeploymentRetryResponseEnvelopeSuccessTrue ProjectDeploymentRetryResponseEnvelopeSuccess = true
+)
+
+type ProjectDeploymentRollbackParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type ProjectDeploymentRollbackResponseEnvelope struct {
+ Errors []ProjectDeploymentRollbackResponseEnvelopeErrors `json:"errors,required"`
+ Messages []ProjectDeploymentRollbackResponseEnvelopeMessages `json:"messages,required"`
+ Result PagesDeployments `json:"result,required"`
+ // Whether the API call was successful
+ Success ProjectDeploymentRollbackResponseEnvelopeSuccess `json:"success,required"`
+ JSON projectDeploymentRollbackResponseEnvelopeJSON `json:"-"`
+}
+
+// projectDeploymentRollbackResponseEnvelopeJSON contains the JSON metadata for the
+// struct [ProjectDeploymentRollbackResponseEnvelope]
+type projectDeploymentRollbackResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ProjectDeploymentRollbackResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r projectDeploymentRollbackResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type ProjectDeploymentRollbackResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON projectDeploymentRollbackResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// projectDeploymentRollbackResponseEnvelopeErrorsJSON contains the JSON metadata
+// for the struct [ProjectDeploymentRollbackResponseEnvelopeErrors]
+type projectDeploymentRollbackResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ProjectDeploymentRollbackResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r projectDeploymentRollbackResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type ProjectDeploymentRollbackResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON projectDeploymentRollbackResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// projectDeploymentRollbackResponseEnvelopeMessagesJSON contains the JSON metadata
+// for the struct [ProjectDeploymentRollbackResponseEnvelopeMessages]
+type projectDeploymentRollbackResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ProjectDeploymentRollbackResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r projectDeploymentRollbackResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type ProjectDeploymentRollbackResponseEnvelopeSuccess bool
+
+const (
+ ProjectDeploymentRollbackResponseEnvelopeSuccessTrue ProjectDeploymentRollbackResponseEnvelopeSuccess = true
+)
diff --git a/pages/projectdeployment_test.go b/pages/projectdeployment_test.go
new file mode 100644
index 00000000000..ca808b27fd2
--- /dev/null
+++ b/pages/projectdeployment_test.go
@@ -0,0 +1,200 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package pages_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/pages"
+)
+
+func TestProjectDeploymentNewWithOptionalParams(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"),
+ )
+ _, err := client.Pages.Projects.Deployments.New(
+ context.TODO(),
+ "this-is-my-project-01",
+ pages.ProjectDeploymentNewParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Branch: cloudflare.F("staging"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestProjectDeploymentList(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"),
+ )
+ _, err := client.Pages.Projects.Deployments.List(
+ context.TODO(),
+ "this-is-my-project-01",
+ pages.ProjectDeploymentListParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestProjectDeploymentDelete(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"),
+ )
+ _, err := client.Pages.Projects.Deployments.Delete(
+ context.TODO(),
+ "this-is-my-project-01",
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ pages.ProjectDeploymentDeleteParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestProjectDeploymentGet(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"),
+ )
+ _, err := client.Pages.Projects.Deployments.Get(
+ context.TODO(),
+ "this-is-my-project-01",
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ pages.ProjectDeploymentGetParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestProjectDeploymentRetry(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"),
+ )
+ _, err := client.Pages.Projects.Deployments.Retry(
+ context.TODO(),
+ "this-is-my-project-01",
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ pages.ProjectDeploymentRetryParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestProjectDeploymentRollback(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"),
+ )
+ _, err := client.Pages.Projects.Deployments.Rollback(
+ context.TODO(),
+ "this-is-my-project-01",
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ pages.ProjectDeploymentRollbackParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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/pages/projectdeploymenthistory.go b/pages/projectdeploymenthistory.go
new file mode 100644
index 00000000000..99e5f4dfd4f
--- /dev/null
+++ b/pages/projectdeploymenthistory.go
@@ -0,0 +1,27 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package pages
+
+import (
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// ProjectDeploymentHistoryService contains methods and other services that help
+// with interacting with the cloudflare API. Note, unlike clients, this service
+// does not read variables from the environment automatically. You should not
+// instantiate this service directly, and instead use the
+// [NewProjectDeploymentHistoryService] method instead.
+type ProjectDeploymentHistoryService struct {
+ Options []option.RequestOption
+ Logs *ProjectDeploymentHistoryLogService
+}
+
+// NewProjectDeploymentHistoryService generates a new service that applies the
+// given options to each request. These options are applied after the parent
+// client's options (if there is one), and before any request-specific options.
+func NewProjectDeploymentHistoryService(opts ...option.RequestOption) (r *ProjectDeploymentHistoryService) {
+ r = &ProjectDeploymentHistoryService{}
+ r.Options = opts
+ r.Logs = NewProjectDeploymentHistoryLogService(opts...)
+ return
+}
diff --git a/pages/projectdeploymenthistorylog.go b/pages/projectdeploymenthistorylog.go
new file mode 100644
index 00000000000..e056cf133a7
--- /dev/null
+++ b/pages/projectdeploymenthistorylog.go
@@ -0,0 +1,160 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package pages
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "reflect"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/tidwall/gjson"
+)
+
+// ProjectDeploymentHistoryLogService contains methods and other services that help
+// with interacting with the cloudflare API. Note, unlike clients, this service
+// does not read variables from the environment automatically. You should not
+// instantiate this service directly, and instead use the
+// [NewProjectDeploymentHistoryLogService] method instead.
+type ProjectDeploymentHistoryLogService struct {
+ Options []option.RequestOption
+}
+
+// NewProjectDeploymentHistoryLogService generates a new service that applies the
+// given options to each request. These options are applied after the parent
+// client's options (if there is one), and before any request-specific options.
+func NewProjectDeploymentHistoryLogService(opts ...option.RequestOption) (r *ProjectDeploymentHistoryLogService) {
+ r = &ProjectDeploymentHistoryLogService{}
+ r.Options = opts
+ return
+}
+
+// Fetch deployment logs for a project.
+func (r *ProjectDeploymentHistoryLogService) Get(ctx context.Context, projectName string, deploymentID string, query ProjectDeploymentHistoryLogGetParams, opts ...option.RequestOption) (res *ProjectDeploymentHistoryLogGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env ProjectDeploymentHistoryLogGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/pages/projects/%s/deployments/%s/history/logs", query.AccountID, projectName, deploymentID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Union satisfied by [pages.ProjectDeploymentHistoryLogGetResponseUnknown],
+// [pages.ProjectDeploymentHistoryLogGetResponseArray] or [shared.UnionString].
+type ProjectDeploymentHistoryLogGetResponse interface {
+ ImplementsPagesProjectDeploymentHistoryLogGetResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*ProjectDeploymentHistoryLogGetResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(ProjectDeploymentHistoryLogGetResponseArray{}),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+type ProjectDeploymentHistoryLogGetResponseArray []interface{}
+
+func (r ProjectDeploymentHistoryLogGetResponseArray) ImplementsPagesProjectDeploymentHistoryLogGetResponse() {
+}
+
+type ProjectDeploymentHistoryLogGetParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type ProjectDeploymentHistoryLogGetResponseEnvelope struct {
+ Errors []ProjectDeploymentHistoryLogGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []ProjectDeploymentHistoryLogGetResponseEnvelopeMessages `json:"messages,required"`
+ Result ProjectDeploymentHistoryLogGetResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success ProjectDeploymentHistoryLogGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON projectDeploymentHistoryLogGetResponseEnvelopeJSON `json:"-"`
+}
+
+// projectDeploymentHistoryLogGetResponseEnvelopeJSON contains the JSON metadata
+// for the struct [ProjectDeploymentHistoryLogGetResponseEnvelope]
+type projectDeploymentHistoryLogGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ProjectDeploymentHistoryLogGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r projectDeploymentHistoryLogGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type ProjectDeploymentHistoryLogGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON projectDeploymentHistoryLogGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// projectDeploymentHistoryLogGetResponseEnvelopeErrorsJSON contains the JSON
+// metadata for the struct [ProjectDeploymentHistoryLogGetResponseEnvelopeErrors]
+type projectDeploymentHistoryLogGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ProjectDeploymentHistoryLogGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r projectDeploymentHistoryLogGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type ProjectDeploymentHistoryLogGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON projectDeploymentHistoryLogGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// projectDeploymentHistoryLogGetResponseEnvelopeMessagesJSON contains the JSON
+// metadata for the struct [ProjectDeploymentHistoryLogGetResponseEnvelopeMessages]
+type projectDeploymentHistoryLogGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ProjectDeploymentHistoryLogGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r projectDeploymentHistoryLogGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type ProjectDeploymentHistoryLogGetResponseEnvelopeSuccess bool
+
+const (
+ ProjectDeploymentHistoryLogGetResponseEnvelopeSuccessTrue ProjectDeploymentHistoryLogGetResponseEnvelopeSuccess = true
+)
diff --git a/pages/projectdeploymenthistorylog_test.go b/pages/projectdeploymenthistorylog_test.go
new file mode 100644
index 00000000000..28968d6b0dc
--- /dev/null
+++ b/pages/projectdeploymenthistorylog_test.go
@@ -0,0 +1,46 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package pages_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/pages"
+)
+
+func TestProjectDeploymentHistoryLogGet(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"),
+ )
+ _, err := client.Pages.Projects.Deployments.History.Logs.Get(
+ context.TODO(),
+ "this-is-my-project-01",
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ pages.ProjectDeploymentHistoryLogGetParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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/pages/projectdomain.go b/pages/projectdomain.go
new file mode 100644
index 00000000000..216244244c0
--- /dev/null
+++ b/pages/projectdomain.go
@@ -0,0 +1,557 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package pages
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "reflect"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/tidwall/gjson"
+)
+
+// ProjectDomainService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewProjectDomainService] method
+// instead.
+type ProjectDomainService struct {
+ Options []option.RequestOption
+}
+
+// NewProjectDomainService generates a new service that applies the given options
+// to each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewProjectDomainService(opts ...option.RequestOption) (r *ProjectDomainService) {
+ r = &ProjectDomainService{}
+ r.Options = opts
+ return
+}
+
+// Add a new domain for the Pages project.
+func (r *ProjectDomainService) New(ctx context.Context, projectName string, params ProjectDomainNewParams, opts ...option.RequestOption) (res *ProjectDomainNewResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env ProjectDomainNewResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/pages/projects/%s/domains", params.AccountID, projectName)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Fetch a list of all domains associated with a Pages project.
+func (r *ProjectDomainService) List(ctx context.Context, projectName string, query ProjectDomainListParams, opts ...option.RequestOption) (res *[]ProjectDomainListResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env ProjectDomainListResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/pages/projects/%s/domains", query.AccountID, projectName)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Delete a Pages project's domain.
+func (r *ProjectDomainService) Delete(ctx context.Context, projectName string, domainName string, body ProjectDomainDeleteParams, opts ...option.RequestOption) (res *ProjectDomainDeleteResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ path := fmt.Sprintf("accounts/%s/pages/projects/%s/domains/%s", body.AccountID, projectName, domainName)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &res, opts...)
+ return
+}
+
+// Retry the validation status of a single domain.
+func (r *ProjectDomainService) Edit(ctx context.Context, projectName string, domainName string, body ProjectDomainEditParams, opts ...option.RequestOption) (res *ProjectDomainEditResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env ProjectDomainEditResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/pages/projects/%s/domains/%s", body.AccountID, projectName, domainName)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Fetch a single domain.
+func (r *ProjectDomainService) Get(ctx context.Context, projectName string, domainName string, query ProjectDomainGetParams, opts ...option.RequestOption) (res *ProjectDomainGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env ProjectDomainGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/pages/projects/%s/domains/%s", query.AccountID, projectName, domainName)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Union satisfied by [pages.ProjectDomainNewResponseUnknown],
+// [pages.ProjectDomainNewResponseArray] or [shared.UnionString].
+type ProjectDomainNewResponse interface {
+ ImplementsPagesProjectDomainNewResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*ProjectDomainNewResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(ProjectDomainNewResponseArray{}),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+type ProjectDomainNewResponseArray []interface{}
+
+func (r ProjectDomainNewResponseArray) ImplementsPagesProjectDomainNewResponse() {}
+
+type ProjectDomainListResponse = interface{}
+
+type ProjectDomainDeleteResponse = interface{}
+
+// Union satisfied by [pages.ProjectDomainEditResponseUnknown],
+// [pages.ProjectDomainEditResponseArray] or [shared.UnionString].
+type ProjectDomainEditResponse interface {
+ ImplementsPagesProjectDomainEditResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*ProjectDomainEditResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(ProjectDomainEditResponseArray{}),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+type ProjectDomainEditResponseArray []interface{}
+
+func (r ProjectDomainEditResponseArray) ImplementsPagesProjectDomainEditResponse() {}
+
+// Union satisfied by [pages.ProjectDomainGetResponseUnknown],
+// [pages.ProjectDomainGetResponseArray] or [shared.UnionString].
+type ProjectDomainGetResponse interface {
+ ImplementsPagesProjectDomainGetResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*ProjectDomainGetResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(ProjectDomainGetResponseArray{}),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+type ProjectDomainGetResponseArray []interface{}
+
+func (r ProjectDomainGetResponseArray) ImplementsPagesProjectDomainGetResponse() {}
+
+type ProjectDomainNewParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ Body param.Field[interface{}] `json:"body,required"`
+}
+
+func (r ProjectDomainNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r.Body)
+}
+
+type ProjectDomainNewResponseEnvelope struct {
+ Errors []ProjectDomainNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []ProjectDomainNewResponseEnvelopeMessages `json:"messages,required"`
+ Result ProjectDomainNewResponse `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success ProjectDomainNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON projectDomainNewResponseEnvelopeJSON `json:"-"`
+}
+
+// projectDomainNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [ProjectDomainNewResponseEnvelope]
+type projectDomainNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ProjectDomainNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r projectDomainNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type ProjectDomainNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON projectDomainNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// projectDomainNewResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [ProjectDomainNewResponseEnvelopeErrors]
+type projectDomainNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ProjectDomainNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r projectDomainNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type ProjectDomainNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON projectDomainNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// projectDomainNewResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [ProjectDomainNewResponseEnvelopeMessages]
+type projectDomainNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ProjectDomainNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r projectDomainNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type ProjectDomainNewResponseEnvelopeSuccess bool
+
+const (
+ ProjectDomainNewResponseEnvelopeSuccessTrue ProjectDomainNewResponseEnvelopeSuccess = true
+)
+
+type ProjectDomainListParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type ProjectDomainListResponseEnvelope struct {
+ Errors []ProjectDomainListResponseEnvelopeErrors `json:"errors,required"`
+ Messages []ProjectDomainListResponseEnvelopeMessages `json:"messages,required"`
+ Result []ProjectDomainListResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success ProjectDomainListResponseEnvelopeSuccess `json:"success,required"`
+ ResultInfo ProjectDomainListResponseEnvelopeResultInfo `json:"result_info"`
+ JSON projectDomainListResponseEnvelopeJSON `json:"-"`
+}
+
+// projectDomainListResponseEnvelopeJSON contains the JSON metadata for the struct
+// [ProjectDomainListResponseEnvelope]
+type projectDomainListResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ ResultInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ProjectDomainListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r projectDomainListResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type ProjectDomainListResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON projectDomainListResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// projectDomainListResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [ProjectDomainListResponseEnvelopeErrors]
+type projectDomainListResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ProjectDomainListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r projectDomainListResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type ProjectDomainListResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON projectDomainListResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// projectDomainListResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [ProjectDomainListResponseEnvelopeMessages]
+type projectDomainListResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ProjectDomainListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r projectDomainListResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type ProjectDomainListResponseEnvelopeSuccess bool
+
+const (
+ ProjectDomainListResponseEnvelopeSuccessTrue ProjectDomainListResponseEnvelopeSuccess = true
+)
+
+type ProjectDomainListResponseEnvelopeResultInfo struct {
+ Count interface{} `json:"count"`
+ Page interface{} `json:"page"`
+ PerPage interface{} `json:"per_page"`
+ TotalCount interface{} `json:"total_count"`
+ JSON projectDomainListResponseEnvelopeResultInfoJSON `json:"-"`
+}
+
+// projectDomainListResponseEnvelopeResultInfoJSON contains the JSON metadata for
+// the struct [ProjectDomainListResponseEnvelopeResultInfo]
+type projectDomainListResponseEnvelopeResultInfoJSON struct {
+ Count apijson.Field
+ Page apijson.Field
+ PerPage apijson.Field
+ TotalCount apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ProjectDomainListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r projectDomainListResponseEnvelopeResultInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type ProjectDomainDeleteParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type ProjectDomainEditParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type ProjectDomainEditResponseEnvelope struct {
+ Errors []ProjectDomainEditResponseEnvelopeErrors `json:"errors,required"`
+ Messages []ProjectDomainEditResponseEnvelopeMessages `json:"messages,required"`
+ Result ProjectDomainEditResponse `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success ProjectDomainEditResponseEnvelopeSuccess `json:"success,required"`
+ JSON projectDomainEditResponseEnvelopeJSON `json:"-"`
+}
+
+// projectDomainEditResponseEnvelopeJSON contains the JSON metadata for the struct
+// [ProjectDomainEditResponseEnvelope]
+type projectDomainEditResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ProjectDomainEditResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r projectDomainEditResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type ProjectDomainEditResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON projectDomainEditResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// projectDomainEditResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [ProjectDomainEditResponseEnvelopeErrors]
+type projectDomainEditResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ProjectDomainEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r projectDomainEditResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type ProjectDomainEditResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON projectDomainEditResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// projectDomainEditResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [ProjectDomainEditResponseEnvelopeMessages]
+type projectDomainEditResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ProjectDomainEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r projectDomainEditResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type ProjectDomainEditResponseEnvelopeSuccess bool
+
+const (
+ ProjectDomainEditResponseEnvelopeSuccessTrue ProjectDomainEditResponseEnvelopeSuccess = true
+)
+
+type ProjectDomainGetParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type ProjectDomainGetResponseEnvelope struct {
+ Errors []ProjectDomainGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []ProjectDomainGetResponseEnvelopeMessages `json:"messages,required"`
+ Result ProjectDomainGetResponse `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success ProjectDomainGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON projectDomainGetResponseEnvelopeJSON `json:"-"`
+}
+
+// projectDomainGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [ProjectDomainGetResponseEnvelope]
+type projectDomainGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ProjectDomainGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r projectDomainGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type ProjectDomainGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON projectDomainGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// projectDomainGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [ProjectDomainGetResponseEnvelopeErrors]
+type projectDomainGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ProjectDomainGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r projectDomainGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type ProjectDomainGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON projectDomainGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// projectDomainGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [ProjectDomainGetResponseEnvelopeMessages]
+type projectDomainGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ProjectDomainGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r projectDomainGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type ProjectDomainGetResponseEnvelopeSuccess bool
+
+const (
+ ProjectDomainGetResponseEnvelopeSuccessTrue ProjectDomainGetResponseEnvelopeSuccess = true
+)
diff --git a/pages/projectdomain_test.go b/pages/projectdomain_test.go
new file mode 100644
index 00000000000..3061e7c6fe2
--- /dev/null
+++ b/pages/projectdomain_test.go
@@ -0,0 +1,171 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package pages_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/pages"
+)
+
+func TestProjectDomainNew(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"),
+ )
+ _, err := client.Pages.Projects.Domains.New(
+ context.TODO(),
+ "this-is-my-project-01",
+ pages.ProjectDomainNewParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Body: cloudflare.F[any](map[string]interface{}{
+ "name": "example.com",
+ }),
+ },
+ )
+ 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())
+ }
+}
+
+func TestProjectDomainList(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"),
+ )
+ _, err := client.Pages.Projects.Domains.List(
+ context.TODO(),
+ "this-is-my-project-01",
+ pages.ProjectDomainListParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestProjectDomainDelete(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"),
+ )
+ _, err := client.Pages.Projects.Domains.Delete(
+ context.TODO(),
+ "this-is-my-project-01",
+ "string",
+ pages.ProjectDomainDeleteParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestProjectDomainEdit(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"),
+ )
+ _, err := client.Pages.Projects.Domains.Edit(
+ context.TODO(),
+ "this-is-my-project-01",
+ "string",
+ pages.ProjectDomainEditParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestProjectDomainGet(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"),
+ )
+ _, err := client.Pages.Projects.Domains.Get(
+ context.TODO(),
+ "this-is-my-project-01",
+ "string",
+ pages.ProjectDomainGetParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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/pageshieldconnection.go b/pageshieldconnection.go
deleted file mode 100644
index b3e182839cb..00000000000
--- a/pageshieldconnection.go
+++ /dev/null
@@ -1,336 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// PageShieldConnectionService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewPageShieldConnectionService]
-// method instead.
-type PageShieldConnectionService struct {
- Options []option.RequestOption
-}
-
-// NewPageShieldConnectionService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewPageShieldConnectionService(opts ...option.RequestOption) (r *PageShieldConnectionService) {
- r = &PageShieldConnectionService{}
- r.Options = opts
- return
-}
-
-// Lists all connections detected by Page Shield.
-func (r *PageShieldConnectionService) List(ctx context.Context, params PageShieldConnectionListParams, opts ...option.RequestOption) (res *[]PageShieldConnectionListResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env PageShieldConnectionListResponseEnvelope
- path := fmt.Sprintf("zones/%s/page_shield/connections", params.ZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Fetches a connection detected by Page Shield by connection ID.
-func (r *PageShieldConnectionService) Get(ctx context.Context, connectionID string, query PageShieldConnectionGetParams, opts ...option.RequestOption) (res *PageShieldConnectionGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- path := fmt.Sprintf("zones/%s/page_shield/connections/%s", query.ZoneID, connectionID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &res, opts...)
- return
-}
-
-type PageShieldConnectionListResponse struct {
- ID interface{} `json:"id"`
- AddedAt interface{} `json:"added_at"`
- DomainReportedMalicious interface{} `json:"domain_reported_malicious"`
- FirstPageURL interface{} `json:"first_page_url"`
- FirstSeenAt interface{} `json:"first_seen_at"`
- Host interface{} `json:"host"`
- LastSeenAt interface{} `json:"last_seen_at"`
- PageURLs interface{} `json:"page_urls"`
- URL interface{} `json:"url"`
- URLContainsCdnCgiPath interface{} `json:"url_contains_cdn_cgi_path"`
- JSON pageShieldConnectionListResponseJSON `json:"-"`
-}
-
-// pageShieldConnectionListResponseJSON contains the JSON metadata for the struct
-// [PageShieldConnectionListResponse]
-type pageShieldConnectionListResponseJSON struct {
- ID apijson.Field
- AddedAt apijson.Field
- DomainReportedMalicious apijson.Field
- FirstPageURL apijson.Field
- FirstSeenAt apijson.Field
- Host apijson.Field
- LastSeenAt apijson.Field
- PageURLs apijson.Field
- URL apijson.Field
- URLContainsCdnCgiPath apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageShieldConnectionListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageShieldConnectionListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type PageShieldConnectionGetResponse struct {
- ID interface{} `json:"id"`
- AddedAt interface{} `json:"added_at"`
- DomainReportedMalicious interface{} `json:"domain_reported_malicious"`
- FirstPageURL interface{} `json:"first_page_url"`
- FirstSeenAt interface{} `json:"first_seen_at"`
- Host interface{} `json:"host"`
- LastSeenAt interface{} `json:"last_seen_at"`
- PageURLs interface{} `json:"page_urls"`
- URL interface{} `json:"url"`
- URLContainsCdnCgiPath interface{} `json:"url_contains_cdn_cgi_path"`
- JSON pageShieldConnectionGetResponseJSON `json:"-"`
-}
-
-// pageShieldConnectionGetResponseJSON contains the JSON metadata for the struct
-// [PageShieldConnectionGetResponse]
-type pageShieldConnectionGetResponseJSON struct {
- ID apijson.Field
- AddedAt apijson.Field
- DomainReportedMalicious apijson.Field
- FirstPageURL apijson.Field
- FirstSeenAt apijson.Field
- Host apijson.Field
- LastSeenAt apijson.Field
- PageURLs apijson.Field
- URL apijson.Field
- URLContainsCdnCgiPath apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageShieldConnectionGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageShieldConnectionGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type PageShieldConnectionListParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
- // The direction used to sort returned connections.
- Direction param.Field[PageShieldConnectionListParamsDirection] `query:"direction"`
- // When true, excludes connections seen in a `/cdn-cgi` path from the returned
- // connections. The default value is true.
- ExcludeCdnCgi param.Field[bool] `query:"exclude_cdn_cgi"`
- // Excludes connections whose URL contains one of the URL-encoded URLs separated by
- // commas.
- ExcludeURLs param.Field[string] `query:"exclude_urls"`
- // Export the list of connections as a file. Cannot be used with per_page or page
- // options.
- Export param.Field[PageShieldConnectionListParamsExport] `query:"export"`
- // Includes connections that match one or more URL-encoded hostnames separated by
- // commas.
- //
- // Wildcards are supported at the start and end of each hostname to support starts
- // with, ends with and contains. If no wildcards are used, results will be filtered
- // by exact match
- Hosts param.Field[string] `query:"hosts"`
- // The field used to sort returned connections.
- OrderBy param.Field[PageShieldConnectionListParamsOrderBy] `query:"order_by"`
- // The current page number of the paginated results.
- //
- // We additionally support a special value "all". When "all" is used, the API will
- // return all the connections with the applied filters in a single page.
- // Additionally, when using this value, the API will not return the categorisation
- // data for the URL and domain of the connections. This feature is best-effort and
- // it may only work for zones with a low number of connections
- Page param.Field[string] `query:"page"`
- // Includes connections that match one or more page URLs (separated by commas)
- // where they were last seen
- //
- // Wildcards are supported at the start and end of each page URL to support starts
- // with, ends with and contains. If no wildcards are used, results will be filtered
- // by exact match
- PageURL param.Field[string] `query:"page_url"`
- // The number of results per page.
- PerPage param.Field[float64] `query:"per_page"`
- // When true, malicious connections appear first in the returned connections.
- PrioritizeMalicious param.Field[bool] `query:"prioritize_malicious"`
- // Filters the returned connections using a comma-separated list of connection
- // statuses. Accepted values: `active`, `infrequent`, and `inactive`. The default
- // value is `active`.
- Status param.Field[string] `query:"status"`
- // Includes connections whose URL contain one or more URL-encoded URLs separated by
- // commas.
- URLs param.Field[string] `query:"urls"`
-}
-
-// URLQuery serializes [PageShieldConnectionListParams]'s query parameters as
-// `url.Values`.
-func (r PageShieldConnectionListParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// The direction used to sort returned connections.
-type PageShieldConnectionListParamsDirection string
-
-const (
- PageShieldConnectionListParamsDirectionAsc PageShieldConnectionListParamsDirection = "asc"
- PageShieldConnectionListParamsDirectionDesc PageShieldConnectionListParamsDirection = "desc"
-)
-
-// Export the list of connections as a file. Cannot be used with per_page or page
-// options.
-type PageShieldConnectionListParamsExport string
-
-const (
- PageShieldConnectionListParamsExportCsv PageShieldConnectionListParamsExport = "csv"
-)
-
-// The field used to sort returned connections.
-type PageShieldConnectionListParamsOrderBy string
-
-const (
- PageShieldConnectionListParamsOrderByFirstSeenAt PageShieldConnectionListParamsOrderBy = "first_seen_at"
- PageShieldConnectionListParamsOrderByLastSeenAt PageShieldConnectionListParamsOrderBy = "last_seen_at"
-)
-
-type PageShieldConnectionListResponseEnvelope struct {
- Errors []PageShieldConnectionListResponseEnvelopeErrors `json:"errors,required"`
- Messages []PageShieldConnectionListResponseEnvelopeMessages `json:"messages,required"`
- Result []PageShieldConnectionListResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success PageShieldConnectionListResponseEnvelopeSuccess `json:"success,required"`
- ResultInfo PageShieldConnectionListResponseEnvelopeResultInfo `json:"result_info"`
- JSON pageShieldConnectionListResponseEnvelopeJSON `json:"-"`
-}
-
-// pageShieldConnectionListResponseEnvelopeJSON contains the JSON metadata for the
-// struct [PageShieldConnectionListResponseEnvelope]
-type pageShieldConnectionListResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- ResultInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageShieldConnectionListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageShieldConnectionListResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type PageShieldConnectionListResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON pageShieldConnectionListResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// pageShieldConnectionListResponseEnvelopeErrorsJSON contains the JSON metadata
-// for the struct [PageShieldConnectionListResponseEnvelopeErrors]
-type pageShieldConnectionListResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageShieldConnectionListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageShieldConnectionListResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type PageShieldConnectionListResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON pageShieldConnectionListResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// pageShieldConnectionListResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [PageShieldConnectionListResponseEnvelopeMessages]
-type pageShieldConnectionListResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageShieldConnectionListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageShieldConnectionListResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type PageShieldConnectionListResponseEnvelopeSuccess bool
-
-const (
- PageShieldConnectionListResponseEnvelopeSuccessTrue PageShieldConnectionListResponseEnvelopeSuccess = true
-)
-
-type PageShieldConnectionListResponseEnvelopeResultInfo struct {
- // Total number of results for the requested service
- Count float64 `json:"count"`
- // Current page within paginated list of results
- Page float64 `json:"page"`
- // Number of results per page of results
- PerPage float64 `json:"per_page"`
- // Total results available without any search parameters
- TotalCount float64 `json:"total_count"`
- JSON pageShieldConnectionListResponseEnvelopeResultInfoJSON `json:"-"`
-}
-
-// pageShieldConnectionListResponseEnvelopeResultInfoJSON contains the JSON
-// metadata for the struct [PageShieldConnectionListResponseEnvelopeResultInfo]
-type pageShieldConnectionListResponseEnvelopeResultInfoJSON struct {
- Count apijson.Field
- Page apijson.Field
- PerPage apijson.Field
- TotalCount apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageShieldConnectionListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageShieldConnectionListResponseEnvelopeResultInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type PageShieldConnectionGetParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
-}
diff --git a/pageshieldconnection_test.go b/pageshieldconnection_test.go
deleted file mode 100644
index 61b74d8bed4..00000000000
--- a/pageshieldconnection_test.go
+++ /dev/null
@@ -1,82 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestPageShieldConnectionListWithOptionalParams(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"),
- )
- _, err := client.PageShield.Connections.List(context.TODO(), cloudflare.PageShieldConnectionListParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Direction: cloudflare.F(cloudflare.PageShieldConnectionListParamsDirectionAsc),
- ExcludeCdnCgi: cloudflare.F(true),
- ExcludeURLs: cloudflare.F("blog.cloudflare.com,www.example"),
- Export: cloudflare.F(cloudflare.PageShieldConnectionListParamsExportCsv),
- Hosts: cloudflare.F("blog.cloudflare.com,www.example*,*cloudflare.com"),
- OrderBy: cloudflare.F(cloudflare.PageShieldConnectionListParamsOrderByFirstSeenAt),
- Page: cloudflare.F("string"),
- PageURL: cloudflare.F("example.com/page,*/checkout,example.com/*,*checkout*"),
- PerPage: cloudflare.F(100.000000),
- PrioritizeMalicious: cloudflare.F(true),
- Status: cloudflare.F("active,inactive"),
- URLs: cloudflare.F("blog.cloudflare.com,www.example"),
- })
- 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())
- }
-}
-
-func TestPageShieldConnectionGet(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"),
- )
- _, err := client.PageShield.Connections.Get(
- context.TODO(),
- "c9ef84a6bf5e47138c75d95e2f933e8f",
- cloudflare.PageShieldConnectionGetParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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/pageshieldpolicy.go b/pageshieldpolicy.go
deleted file mode 100644
index 8539a125870..00000000000
--- a/pageshieldpolicy.go
+++ /dev/null
@@ -1,447 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// PageShieldPolicyService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewPageShieldPolicyService] method
-// instead.
-type PageShieldPolicyService struct {
- Options []option.RequestOption
-}
-
-// NewPageShieldPolicyService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewPageShieldPolicyService(opts ...option.RequestOption) (r *PageShieldPolicyService) {
- r = &PageShieldPolicyService{}
- r.Options = opts
- return
-}
-
-// Create a Page Shield policy.
-func (r *PageShieldPolicyService) New(ctx context.Context, params PageShieldPolicyNewParams, opts ...option.RequestOption) (res *PageShieldPolicyNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- path := fmt.Sprintf("zones/%s/page_shield/policies", params.ZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &res, opts...)
- return
-}
-
-// Update a Page Shield policy by ID.
-func (r *PageShieldPolicyService) Update(ctx context.Context, policyID string, params PageShieldPolicyUpdateParams, opts ...option.RequestOption) (res *PageShieldPolicyUpdateResponse, err error) {
- opts = append(r.Options[:], opts...)
- path := fmt.Sprintf("zones/%s/page_shield/policies/%s", params.ZoneID, policyID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &res, opts...)
- return
-}
-
-// Lists all Page Shield policies.
-func (r *PageShieldPolicyService) List(ctx context.Context, query PageShieldPolicyListParams, opts ...option.RequestOption) (res *[]PageShieldPolicyListResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env PageShieldPolicyListResponseEnvelope
- path := fmt.Sprintf("zones/%s/page_shield/policies", query.ZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Delete a Page Shield policy by ID.
-func (r *PageShieldPolicyService) Delete(ctx context.Context, policyID string, body PageShieldPolicyDeleteParams, opts ...option.RequestOption) (err error) {
- opts = append(r.Options[:], opts...)
- opts = append([]option.RequestOption{option.WithHeader("Accept", "")}, opts...)
- path := fmt.Sprintf("zones/%s/page_shield/policies/%s", body.ZoneID, policyID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, nil, opts...)
- return
-}
-
-// Fetches a Page Shield policy by ID.
-func (r *PageShieldPolicyService) Get(ctx context.Context, policyID string, query PageShieldPolicyGetParams, opts ...option.RequestOption) (res *PageShieldPolicyGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- path := fmt.Sprintf("zones/%s/page_shield/policies/%s", query.ZoneID, policyID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &res, opts...)
- return
-}
-
-type PageShieldPolicyNewResponse struct {
- // The ID of the policy
- ID string `json:"id"`
- // The action to take if the expression matches
- Action PageShieldPolicyNewResponseAction `json:"action"`
- // A description for the policy
- Description string `json:"description"`
- // Whether the policy is enabled
- Enabled bool `json:"enabled"`
- // The expression which must match for the policy to be applied, using the
- // Cloudflare Firewall rule expression syntax
- Expression string `json:"expression"`
- // The policy which will be applied
- Value string `json:"value"`
- JSON pageShieldPolicyNewResponseJSON `json:"-"`
-}
-
-// pageShieldPolicyNewResponseJSON contains the JSON metadata for the struct
-// [PageShieldPolicyNewResponse]
-type pageShieldPolicyNewResponseJSON struct {
- ID apijson.Field
- Action apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageShieldPolicyNewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageShieldPolicyNewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// The action to take if the expression matches
-type PageShieldPolicyNewResponseAction string
-
-const (
- PageShieldPolicyNewResponseActionAllow PageShieldPolicyNewResponseAction = "allow"
- PageShieldPolicyNewResponseActionLog PageShieldPolicyNewResponseAction = "log"
-)
-
-type PageShieldPolicyUpdateResponse struct {
- // The ID of the policy
- ID string `json:"id"`
- // The action to take if the expression matches
- Action PageShieldPolicyUpdateResponseAction `json:"action"`
- // A description for the policy
- Description string `json:"description"`
- // Whether the policy is enabled
- Enabled bool `json:"enabled"`
- // The expression which must match for the policy to be applied, using the
- // Cloudflare Firewall rule expression syntax
- Expression string `json:"expression"`
- // The policy which will be applied
- Value string `json:"value"`
- JSON pageShieldPolicyUpdateResponseJSON `json:"-"`
-}
-
-// pageShieldPolicyUpdateResponseJSON contains the JSON metadata for the struct
-// [PageShieldPolicyUpdateResponse]
-type pageShieldPolicyUpdateResponseJSON struct {
- ID apijson.Field
- Action apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageShieldPolicyUpdateResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageShieldPolicyUpdateResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// The action to take if the expression matches
-type PageShieldPolicyUpdateResponseAction string
-
-const (
- PageShieldPolicyUpdateResponseActionAllow PageShieldPolicyUpdateResponseAction = "allow"
- PageShieldPolicyUpdateResponseActionLog PageShieldPolicyUpdateResponseAction = "log"
-)
-
-type PageShieldPolicyListResponse struct {
- // The ID of the policy
- ID string `json:"id"`
- // The action to take if the expression matches
- Action PageShieldPolicyListResponseAction `json:"action"`
- // A description for the policy
- Description string `json:"description"`
- // Whether the policy is enabled
- Enabled bool `json:"enabled"`
- // The expression which must match for the policy to be applied, using the
- // Cloudflare Firewall rule expression syntax
- Expression string `json:"expression"`
- // The policy which will be applied
- Value string `json:"value"`
- JSON pageShieldPolicyListResponseJSON `json:"-"`
-}
-
-// pageShieldPolicyListResponseJSON contains the JSON metadata for the struct
-// [PageShieldPolicyListResponse]
-type pageShieldPolicyListResponseJSON struct {
- ID apijson.Field
- Action apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageShieldPolicyListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageShieldPolicyListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// The action to take if the expression matches
-type PageShieldPolicyListResponseAction string
-
-const (
- PageShieldPolicyListResponseActionAllow PageShieldPolicyListResponseAction = "allow"
- PageShieldPolicyListResponseActionLog PageShieldPolicyListResponseAction = "log"
-)
-
-type PageShieldPolicyGetResponse struct {
- // The ID of the policy
- ID string `json:"id"`
- // The action to take if the expression matches
- Action PageShieldPolicyGetResponseAction `json:"action"`
- // A description for the policy
- Description string `json:"description"`
- // Whether the policy is enabled
- Enabled bool `json:"enabled"`
- // The expression which must match for the policy to be applied, using the
- // Cloudflare Firewall rule expression syntax
- Expression string `json:"expression"`
- // The policy which will be applied
- Value string `json:"value"`
- JSON pageShieldPolicyGetResponseJSON `json:"-"`
-}
-
-// pageShieldPolicyGetResponseJSON contains the JSON metadata for the struct
-// [PageShieldPolicyGetResponse]
-type pageShieldPolicyGetResponseJSON struct {
- ID apijson.Field
- Action apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageShieldPolicyGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageShieldPolicyGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// The action to take if the expression matches
-type PageShieldPolicyGetResponseAction string
-
-const (
- PageShieldPolicyGetResponseActionAllow PageShieldPolicyGetResponseAction = "allow"
- PageShieldPolicyGetResponseActionLog PageShieldPolicyGetResponseAction = "log"
-)
-
-type PageShieldPolicyNewParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
- // The action to take if the expression matches
- Action param.Field[PageShieldPolicyNewParamsAction] `json:"action"`
- // A description for the policy
- Description param.Field[string] `json:"description"`
- // Whether the policy is enabled
- Enabled param.Field[bool] `json:"enabled"`
- // The expression which must match for the policy to be applied, using the
- // Cloudflare Firewall rule expression syntax
- Expression param.Field[string] `json:"expression"`
- // The policy which will be applied
- Value param.Field[string] `json:"value"`
-}
-
-func (r PageShieldPolicyNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The action to take if the expression matches
-type PageShieldPolicyNewParamsAction string
-
-const (
- PageShieldPolicyNewParamsActionAllow PageShieldPolicyNewParamsAction = "allow"
- PageShieldPolicyNewParamsActionLog PageShieldPolicyNewParamsAction = "log"
-)
-
-type PageShieldPolicyUpdateParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
- // The action to take if the expression matches
- Action param.Field[PageShieldPolicyUpdateParamsAction] `json:"action"`
- // A description for the policy
- Description param.Field[string] `json:"description"`
- // Whether the policy is enabled
- Enabled param.Field[bool] `json:"enabled"`
- // The expression which must match for the policy to be applied, using the
- // Cloudflare Firewall rule expression syntax
- Expression param.Field[string] `json:"expression"`
- // The policy which will be applied
- Value param.Field[string] `json:"value"`
-}
-
-func (r PageShieldPolicyUpdateParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The action to take if the expression matches
-type PageShieldPolicyUpdateParamsAction string
-
-const (
- PageShieldPolicyUpdateParamsActionAllow PageShieldPolicyUpdateParamsAction = "allow"
- PageShieldPolicyUpdateParamsActionLog PageShieldPolicyUpdateParamsAction = "log"
-)
-
-type PageShieldPolicyListParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
-}
-
-type PageShieldPolicyListResponseEnvelope struct {
- Errors []PageShieldPolicyListResponseEnvelopeErrors `json:"errors,required"`
- Messages []PageShieldPolicyListResponseEnvelopeMessages `json:"messages,required"`
- Result []PageShieldPolicyListResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success PageShieldPolicyListResponseEnvelopeSuccess `json:"success,required"`
- ResultInfo PageShieldPolicyListResponseEnvelopeResultInfo `json:"result_info"`
- JSON pageShieldPolicyListResponseEnvelopeJSON `json:"-"`
-}
-
-// pageShieldPolicyListResponseEnvelopeJSON contains the JSON metadata for the
-// struct [PageShieldPolicyListResponseEnvelope]
-type pageShieldPolicyListResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- ResultInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageShieldPolicyListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageShieldPolicyListResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type PageShieldPolicyListResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON pageShieldPolicyListResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// pageShieldPolicyListResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [PageShieldPolicyListResponseEnvelopeErrors]
-type pageShieldPolicyListResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageShieldPolicyListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageShieldPolicyListResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type PageShieldPolicyListResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON pageShieldPolicyListResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// pageShieldPolicyListResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [PageShieldPolicyListResponseEnvelopeMessages]
-type pageShieldPolicyListResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageShieldPolicyListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageShieldPolicyListResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type PageShieldPolicyListResponseEnvelopeSuccess bool
-
-const (
- PageShieldPolicyListResponseEnvelopeSuccessTrue PageShieldPolicyListResponseEnvelopeSuccess = true
-)
-
-type PageShieldPolicyListResponseEnvelopeResultInfo struct {
- // Total number of results for the requested service
- Count float64 `json:"count"`
- // Current page within paginated list of results
- Page float64 `json:"page"`
- // Number of results per page of results
- PerPage float64 `json:"per_page"`
- // Total results available without any search parameters
- TotalCount float64 `json:"total_count"`
- JSON pageShieldPolicyListResponseEnvelopeResultInfoJSON `json:"-"`
-}
-
-// pageShieldPolicyListResponseEnvelopeResultInfoJSON contains the JSON metadata
-// for the struct [PageShieldPolicyListResponseEnvelopeResultInfo]
-type pageShieldPolicyListResponseEnvelopeResultInfoJSON struct {
- Count apijson.Field
- Page apijson.Field
- PerPage apijson.Field
- TotalCount apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageShieldPolicyListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageShieldPolicyListResponseEnvelopeResultInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type PageShieldPolicyDeleteParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
-}
-
-type PageShieldPolicyGetParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
-}
diff --git a/pageshieldpolicy_test.go b/pageshieldpolicy_test.go
deleted file mode 100644
index 6e727c26c55..00000000000
--- a/pageshieldpolicy_test.go
+++ /dev/null
@@ -1,166 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestPageShieldPolicyNewWithOptionalParams(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"),
- )
- _, err := client.PageShield.Policies.New(context.TODO(), cloudflare.PageShieldPolicyNewParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Action: cloudflare.F(cloudflare.PageShieldPolicyNewParamsActionAllow),
- Description: cloudflare.F("Checkout page CSP policy"),
- Enabled: cloudflare.F(true),
- Expression: cloudflare.F("ends_with(http.request.uri.path, \"/checkout\")"),
- Value: cloudflare.F("script-src 'none';"),
- })
- 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())
- }
-}
-
-func TestPageShieldPolicyUpdateWithOptionalParams(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"),
- )
- _, err := client.PageShield.Policies.Update(
- context.TODO(),
- "c9ef84a6bf5e47138c75d95e2f933e8f",
- cloudflare.PageShieldPolicyUpdateParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Action: cloudflare.F(cloudflare.PageShieldPolicyUpdateParamsActionAllow),
- Description: cloudflare.F("Checkout page CSP policy"),
- Enabled: cloudflare.F(true),
- Expression: cloudflare.F("ends_with(http.request.uri.path, \"/checkout\")"),
- Value: cloudflare.F("script-src 'none';"),
- },
- )
- 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())
- }
-}
-
-func TestPageShieldPolicyList(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"),
- )
- _, err := client.PageShield.Policies.List(context.TODO(), cloudflare.PageShieldPolicyListParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- })
- 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())
- }
-}
-
-func TestPageShieldPolicyDelete(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"),
- )
- err := client.PageShield.Policies.Delete(
- context.TODO(),
- "c9ef84a6bf5e47138c75d95e2f933e8f",
- cloudflare.PageShieldPolicyDeleteParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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())
- }
-}
-
-func TestPageShieldPolicyGet(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"),
- )
- _, err := client.PageShield.Policies.Get(
- context.TODO(),
- "c9ef84a6bf5e47138c75d95e2f933e8f",
- cloudflare.PageShieldPolicyGetParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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/pageshieldscript.go b/pageshieldscript.go
deleted file mode 100644
index 71bfc3601f7..00000000000
--- a/pageshieldscript.go
+++ /dev/null
@@ -1,384 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// PageShieldScriptService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewPageShieldScriptService] method
-// instead.
-type PageShieldScriptService struct {
- Options []option.RequestOption
-}
-
-// NewPageShieldScriptService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewPageShieldScriptService(opts ...option.RequestOption) (r *PageShieldScriptService) {
- r = &PageShieldScriptService{}
- r.Options = opts
- return
-}
-
-// Lists all scripts detected by Page Shield.
-func (r *PageShieldScriptService) List(ctx context.Context, params PageShieldScriptListParams, opts ...option.RequestOption) (res *[]PageShieldScriptListResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env PageShieldScriptListResponseEnvelope
- path := fmt.Sprintf("zones/%s/page_shield/scripts", params.ZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Fetches a script detected by Page Shield by script ID.
-func (r *PageShieldScriptService) Get(ctx context.Context, scriptID string, query PageShieldScriptGetParams, opts ...option.RequestOption) (res *PageShieldScriptGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- path := fmt.Sprintf("zones/%s/page_shield/scripts/%s", query.ZoneID, scriptID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &res, opts...)
- return
-}
-
-type PageShieldScriptListResponse struct {
- ID interface{} `json:"id"`
- AddedAt interface{} `json:"added_at"`
- DomainReportedMalicious interface{} `json:"domain_reported_malicious"`
- FetchedAt interface{} `json:"fetched_at"`
- FirstPageURL interface{} `json:"first_page_url"`
- FirstSeenAt interface{} `json:"first_seen_at"`
- Hash interface{} `json:"hash"`
- Host interface{} `json:"host"`
- JsIntegrityScore interface{} `json:"js_integrity_score"`
- LastSeenAt interface{} `json:"last_seen_at"`
- PageURLs interface{} `json:"page_urls"`
- URL interface{} `json:"url"`
- URLContainsCdnCgiPath interface{} `json:"url_contains_cdn_cgi_path"`
- JSON pageShieldScriptListResponseJSON `json:"-"`
-}
-
-// pageShieldScriptListResponseJSON contains the JSON metadata for the struct
-// [PageShieldScriptListResponse]
-type pageShieldScriptListResponseJSON struct {
- ID apijson.Field
- AddedAt apijson.Field
- DomainReportedMalicious apijson.Field
- FetchedAt apijson.Field
- FirstPageURL apijson.Field
- FirstSeenAt apijson.Field
- Hash apijson.Field
- Host apijson.Field
- JsIntegrityScore apijson.Field
- LastSeenAt apijson.Field
- PageURLs apijson.Field
- URL apijson.Field
- URLContainsCdnCgiPath apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageShieldScriptListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageShieldScriptListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type PageShieldScriptGetResponse struct {
- ID interface{} `json:"id"`
- AddedAt interface{} `json:"added_at"`
- DomainReportedMalicious interface{} `json:"domain_reported_malicious"`
- FetchedAt interface{} `json:"fetched_at"`
- FirstPageURL interface{} `json:"first_page_url"`
- FirstSeenAt interface{} `json:"first_seen_at"`
- Hash interface{} `json:"hash"`
- Host interface{} `json:"host"`
- JsIntegrityScore interface{} `json:"js_integrity_score"`
- LastSeenAt interface{} `json:"last_seen_at"`
- PageURLs interface{} `json:"page_urls"`
- URL interface{} `json:"url"`
- URLContainsCdnCgiPath interface{} `json:"url_contains_cdn_cgi_path"`
- Versions []PageShieldScriptGetResponseVersion `json:"versions,nullable"`
- JSON pageShieldScriptGetResponseJSON `json:"-"`
-}
-
-// pageShieldScriptGetResponseJSON contains the JSON metadata for the struct
-// [PageShieldScriptGetResponse]
-type pageShieldScriptGetResponseJSON struct {
- ID apijson.Field
- AddedAt apijson.Field
- DomainReportedMalicious apijson.Field
- FetchedAt apijson.Field
- FirstPageURL apijson.Field
- FirstSeenAt apijson.Field
- Hash apijson.Field
- Host apijson.Field
- JsIntegrityScore apijson.Field
- LastSeenAt apijson.Field
- PageURLs apijson.Field
- URL apijson.Field
- URLContainsCdnCgiPath apijson.Field
- Versions apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageShieldScriptGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageShieldScriptGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// The version of the analyzed script.
-type PageShieldScriptGetResponseVersion struct {
- // The timestamp of when the script was last fetched.
- FetchedAt string `json:"fetched_at,nullable"`
- // The computed hash of the analyzed script.
- Hash string `json:"hash,nullable"`
- // The integrity score of the JavaScript content.
- JsIntegrityScore int64 `json:"js_integrity_score,nullable"`
- JSON pageShieldScriptGetResponseVersionJSON `json:"-"`
-}
-
-// pageShieldScriptGetResponseVersionJSON contains the JSON metadata for the struct
-// [PageShieldScriptGetResponseVersion]
-type pageShieldScriptGetResponseVersionJSON struct {
- FetchedAt apijson.Field
- Hash apijson.Field
- JsIntegrityScore apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageShieldScriptGetResponseVersion) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageShieldScriptGetResponseVersionJSON) RawJSON() string {
- return r.raw
-}
-
-type PageShieldScriptListParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
- // The direction used to sort returned scripts.
- Direction param.Field[PageShieldScriptListParamsDirection] `query:"direction"`
- // When true, excludes scripts seen in a `/cdn-cgi` path from the returned scripts.
- // The default value is true.
- ExcludeCdnCgi param.Field[bool] `query:"exclude_cdn_cgi"`
- // When true, excludes duplicate scripts. We consider a script duplicate of another
- // if their javascript content matches and they share the same url host and zone
- // hostname. In such case, we return the most recent script for the URL host and
- // zone hostname combination.
- ExcludeDuplicates param.Field[bool] `query:"exclude_duplicates"`
- // Excludes scripts whose URL contains one of the URL-encoded URLs separated by
- // commas.
- ExcludeURLs param.Field[string] `query:"exclude_urls"`
- // Export the list of scripts as a file. Cannot be used with per_page or page
- // options.
- Export param.Field[PageShieldScriptListParamsExport] `query:"export"`
- // Includes scripts that match one or more URL-encoded hostnames separated by
- // commas.
- //
- // Wildcards are supported at the start and end of each hostname to support starts
- // with, ends with and contains. If no wildcards are used, results will be filtered
- // by exact match
- Hosts param.Field[string] `query:"hosts"`
- // The field used to sort returned scripts.
- OrderBy param.Field[PageShieldScriptListParamsOrderBy] `query:"order_by"`
- // The current page number of the paginated results.
- //
- // We additionally support a special value "all". When "all" is used, the API will
- // return all the scripts with the applied filters in a single page. Additionally,
- // when using this value, the API will not return the script versions or
- // categorisation data for the URL and domain of the scripts. This feature is
- // best-effort and it may only work for zones with a low number of scripts
- Page param.Field[string] `query:"page"`
- // Includes scripts that match one or more page URLs (separated by commas) where
- // they were last seen
- //
- // Wildcards are supported at the start and end of each page URL to support starts
- // with, ends with and contains. If no wildcards are used, results will be filtered
- // by exact match
- PageURL param.Field[string] `query:"page_url"`
- // The number of results per page.
- PerPage param.Field[float64] `query:"per_page"`
- // When true, malicious scripts appear first in the returned scripts.
- PrioritizeMalicious param.Field[bool] `query:"prioritize_malicious"`
- // Filters the returned scripts using a comma-separated list of scripts statuses.
- // Accepted values: `active`, `infrequent`, and `inactive`. The default value is
- // `active`.
- Status param.Field[string] `query:"status"`
- // Includes scripts whose URL contain one or more URL-encoded URLs separated by
- // commas.
- URLs param.Field[string] `query:"urls"`
-}
-
-// URLQuery serializes [PageShieldScriptListParams]'s query parameters as
-// `url.Values`.
-func (r PageShieldScriptListParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// The direction used to sort returned scripts.
-type PageShieldScriptListParamsDirection string
-
-const (
- PageShieldScriptListParamsDirectionAsc PageShieldScriptListParamsDirection = "asc"
- PageShieldScriptListParamsDirectionDesc PageShieldScriptListParamsDirection = "desc"
-)
-
-// Export the list of scripts as a file. Cannot be used with per_page or page
-// options.
-type PageShieldScriptListParamsExport string
-
-const (
- PageShieldScriptListParamsExportCsv PageShieldScriptListParamsExport = "csv"
-)
-
-// The field used to sort returned scripts.
-type PageShieldScriptListParamsOrderBy string
-
-const (
- PageShieldScriptListParamsOrderByFirstSeenAt PageShieldScriptListParamsOrderBy = "first_seen_at"
- PageShieldScriptListParamsOrderByLastSeenAt PageShieldScriptListParamsOrderBy = "last_seen_at"
-)
-
-type PageShieldScriptListResponseEnvelope struct {
- Errors []PageShieldScriptListResponseEnvelopeErrors `json:"errors,required"`
- Messages []PageShieldScriptListResponseEnvelopeMessages `json:"messages,required"`
- Result []PageShieldScriptListResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success PageShieldScriptListResponseEnvelopeSuccess `json:"success,required"`
- ResultInfo PageShieldScriptListResponseEnvelopeResultInfo `json:"result_info"`
- JSON pageShieldScriptListResponseEnvelopeJSON `json:"-"`
-}
-
-// pageShieldScriptListResponseEnvelopeJSON contains the JSON metadata for the
-// struct [PageShieldScriptListResponseEnvelope]
-type pageShieldScriptListResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- ResultInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageShieldScriptListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageShieldScriptListResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type PageShieldScriptListResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON pageShieldScriptListResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// pageShieldScriptListResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [PageShieldScriptListResponseEnvelopeErrors]
-type pageShieldScriptListResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageShieldScriptListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageShieldScriptListResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type PageShieldScriptListResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON pageShieldScriptListResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// pageShieldScriptListResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [PageShieldScriptListResponseEnvelopeMessages]
-type pageShieldScriptListResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageShieldScriptListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageShieldScriptListResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type PageShieldScriptListResponseEnvelopeSuccess bool
-
-const (
- PageShieldScriptListResponseEnvelopeSuccessTrue PageShieldScriptListResponseEnvelopeSuccess = true
-)
-
-type PageShieldScriptListResponseEnvelopeResultInfo struct {
- // Total number of results for the requested service
- Count float64 `json:"count"`
- // Current page within paginated list of results
- Page float64 `json:"page"`
- // Number of results per page of results
- PerPage float64 `json:"per_page"`
- // Total results available without any search parameters
- TotalCount float64 `json:"total_count"`
- JSON pageShieldScriptListResponseEnvelopeResultInfoJSON `json:"-"`
-}
-
-// pageShieldScriptListResponseEnvelopeResultInfoJSON contains the JSON metadata
-// for the struct [PageShieldScriptListResponseEnvelopeResultInfo]
-type pageShieldScriptListResponseEnvelopeResultInfoJSON struct {
- Count apijson.Field
- Page apijson.Field
- PerPage apijson.Field
- TotalCount apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PageShieldScriptListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pageShieldScriptListResponseEnvelopeResultInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type PageShieldScriptGetParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
-}
diff --git a/pageshieldscript_test.go b/pageshieldscript_test.go
deleted file mode 100644
index a1fa8eb3570..00000000000
--- a/pageshieldscript_test.go
+++ /dev/null
@@ -1,83 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestPageShieldScriptListWithOptionalParams(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"),
- )
- _, err := client.PageShield.Scripts.List(context.TODO(), cloudflare.PageShieldScriptListParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Direction: cloudflare.F(cloudflare.PageShieldScriptListParamsDirectionAsc),
- ExcludeCdnCgi: cloudflare.F(true),
- ExcludeDuplicates: cloudflare.F(true),
- ExcludeURLs: cloudflare.F("blog.cloudflare.com,www.example"),
- Export: cloudflare.F(cloudflare.PageShieldScriptListParamsExportCsv),
- Hosts: cloudflare.F("blog.cloudflare.com,www.example*,*cloudflare.com"),
- OrderBy: cloudflare.F(cloudflare.PageShieldScriptListParamsOrderByFirstSeenAt),
- Page: cloudflare.F("string"),
- PageURL: cloudflare.F("example.com/page,*/checkout,example.com/*,*checkout*"),
- PerPage: cloudflare.F(100.000000),
- PrioritizeMalicious: cloudflare.F(true),
- Status: cloudflare.F("active,inactive"),
- URLs: cloudflare.F("blog.cloudflare.com,www.example"),
- })
- 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())
- }
-}
-
-func TestPageShieldScriptGet(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"),
- )
- _, err := client.PageShield.Scripts.Get(
- context.TODO(),
- "c9ef84a6bf5e47138c75d95e2f933e8f",
- cloudflare.PageShieldScriptGetParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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/pcapdownload.go b/pcapdownload.go
deleted file mode 100644
index a354cfa21c3..00000000000
--- a/pcapdownload.go
+++ /dev/null
@@ -1,45 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
-
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// PCAPDownloadService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewPCAPDownloadService] method
-// instead.
-type PCAPDownloadService struct {
- Options []option.RequestOption
-}
-
-// NewPCAPDownloadService generates a new service that applies the given options to
-// each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewPCAPDownloadService(opts ...option.RequestOption) (r *PCAPDownloadService) {
- r = &PCAPDownloadService{}
- r.Options = opts
- return
-}
-
-// Download PCAP information into a file. Response is a binary PCAP file.
-func (r *PCAPDownloadService) Get(ctx context.Context, pcapID string, query PCAPDownloadGetParams, opts ...option.RequestOption) (res *http.Response, err error) {
- opts = append(r.Options[:], opts...)
- opts = append([]option.RequestOption{option.WithHeader("Accept", "application/vnd.tcpdump.pcap")}, opts...)
- path := fmt.Sprintf("accounts/%s/pcaps/%s/download", query.AccountID, pcapID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &res, opts...)
- return
-}
-
-type PCAPDownloadGetParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
diff --git a/pcapdownload_test.go b/pcapdownload_test.go
deleted file mode 100644
index 48550154a69..00000000000
--- a/pcapdownload_test.go
+++ /dev/null
@@ -1,58 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "bytes"
- "context"
- "errors"
- "io"
- "net/http"
- "net/http/httptest"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestPCAPDownloadGet(t *testing.T) {
- t.Skip("skipped: tests are disabled for the time being")
- server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
- w.WriteHeader(200)
- w.Write([]byte("abc"))
- }))
- defer server.Close()
- baseURL := server.URL
- client := cloudflare.NewClient(
- option.WithBaseURL(baseURL),
- option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"),
- option.WithAPIEmail("user@example.com"),
- )
- resp, err := client.PCAPs.Downloads.Get(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.PCAPDownloadGetParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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())
- }
- defer resp.Body.Close()
-
- b, err := io.ReadAll(resp.Body)
- 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())
- }
- if !bytes.Equal(b, []byte("abc")) {
- t.Fatalf("return value not %s: %s", "abc", b)
- }
-}
diff --git a/pcapownership.go b/pcapownership.go
deleted file mode 100644
index 6c1bf549096..00000000000
--- a/pcapownership.go
+++ /dev/null
@@ -1,528 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// PCAPOwnershipService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewPCAPOwnershipService] method
-// instead.
-type PCAPOwnershipService struct {
- Options []option.RequestOption
-}
-
-// NewPCAPOwnershipService generates a new service that applies the given options
-// to each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewPCAPOwnershipService(opts ...option.RequestOption) (r *PCAPOwnershipService) {
- r = &PCAPOwnershipService{}
- r.Options = opts
- return
-}
-
-// Adds an AWS or GCP bucket to use with full packet captures.
-func (r *PCAPOwnershipService) New(ctx context.Context, params PCAPOwnershipNewParams, opts ...option.RequestOption) (res *PCAPOwnershipNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env PCAPOwnershipNewResponseEnvelope
- path := fmt.Sprintf("accounts/%s/pcaps/ownership", params.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Deletes buckets added to the packet captures API.
-func (r *PCAPOwnershipService) Delete(ctx context.Context, ownershipID string, body PCAPOwnershipDeleteParams, opts ...option.RequestOption) (err error) {
- opts = append(r.Options[:], opts...)
- opts = append([]option.RequestOption{option.WithHeader("Accept", "")}, opts...)
- path := fmt.Sprintf("accounts/%s/pcaps/ownership/%s", body.AccountID, ownershipID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, nil, opts...)
- return
-}
-
-// List all buckets configured for use with PCAPs API.
-func (r *PCAPOwnershipService) Get(ctx context.Context, query PCAPOwnershipGetParams, opts ...option.RequestOption) (res *[]PCAPOwnershipGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env PCAPOwnershipGetResponseEnvelope
- path := fmt.Sprintf("accounts/%s/pcaps/ownership", query.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Validates buckets added to the packet captures API.
-func (r *PCAPOwnershipService) Validate(ctx context.Context, params PCAPOwnershipValidateParams, opts ...option.RequestOption) (res *PCAPOwnershipValidateResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env PCAPOwnershipValidateResponseEnvelope
- path := fmt.Sprintf("accounts/%s/pcaps/ownership/validate", params.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type PCAPOwnershipNewResponse struct {
- // The bucket ID associated with the packet captures API.
- ID string `json:"id,required"`
- // The full URI for the bucket. This field only applies to `full` packet captures.
- DestinationConf string `json:"destination_conf,required"`
- // The ownership challenge filename stored in the bucket.
- Filename string `json:"filename,required"`
- // The status of the ownership challenge. Can be pending, success or failed.
- Status PCAPOwnershipNewResponseStatus `json:"status,required"`
- // The RFC 3339 timestamp when the bucket was added to packet captures API.
- Submitted string `json:"submitted,required"`
- // The RFC 3339 timestamp when the bucket was validated.
- Validated string `json:"validated"`
- JSON pcapOwnershipNewResponseJSON `json:"-"`
-}
-
-// pcapOwnershipNewResponseJSON contains the JSON metadata for the struct
-// [PCAPOwnershipNewResponse]
-type pcapOwnershipNewResponseJSON struct {
- ID apijson.Field
- DestinationConf apijson.Field
- Filename apijson.Field
- Status apijson.Field
- Submitted apijson.Field
- Validated apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PCAPOwnershipNewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pcapOwnershipNewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// The status of the ownership challenge. Can be pending, success or failed.
-type PCAPOwnershipNewResponseStatus string
-
-const (
- PCAPOwnershipNewResponseStatusPending PCAPOwnershipNewResponseStatus = "pending"
- PCAPOwnershipNewResponseStatusSuccess PCAPOwnershipNewResponseStatus = "success"
- PCAPOwnershipNewResponseStatusFailed PCAPOwnershipNewResponseStatus = "failed"
-)
-
-type PCAPOwnershipGetResponse struct {
- // The bucket ID associated with the packet captures API.
- ID string `json:"id,required"`
- // The full URI for the bucket. This field only applies to `full` packet captures.
- DestinationConf string `json:"destination_conf,required"`
- // The ownership challenge filename stored in the bucket.
- Filename string `json:"filename,required"`
- // The status of the ownership challenge. Can be pending, success or failed.
- Status PCAPOwnershipGetResponseStatus `json:"status,required"`
- // The RFC 3339 timestamp when the bucket was added to packet captures API.
- Submitted string `json:"submitted,required"`
- // The RFC 3339 timestamp when the bucket was validated.
- Validated string `json:"validated"`
- JSON pcapOwnershipGetResponseJSON `json:"-"`
-}
-
-// pcapOwnershipGetResponseJSON contains the JSON metadata for the struct
-// [PCAPOwnershipGetResponse]
-type pcapOwnershipGetResponseJSON struct {
- ID apijson.Field
- DestinationConf apijson.Field
- Filename apijson.Field
- Status apijson.Field
- Submitted apijson.Field
- Validated apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PCAPOwnershipGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pcapOwnershipGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// The status of the ownership challenge. Can be pending, success or failed.
-type PCAPOwnershipGetResponseStatus string
-
-const (
- PCAPOwnershipGetResponseStatusPending PCAPOwnershipGetResponseStatus = "pending"
- PCAPOwnershipGetResponseStatusSuccess PCAPOwnershipGetResponseStatus = "success"
- PCAPOwnershipGetResponseStatusFailed PCAPOwnershipGetResponseStatus = "failed"
-)
-
-type PCAPOwnershipValidateResponse struct {
- // The bucket ID associated with the packet captures API.
- ID string `json:"id,required"`
- // The full URI for the bucket. This field only applies to `full` packet captures.
- DestinationConf string `json:"destination_conf,required"`
- // The ownership challenge filename stored in the bucket.
- Filename string `json:"filename,required"`
- // The status of the ownership challenge. Can be pending, success or failed.
- Status PCAPOwnershipValidateResponseStatus `json:"status,required"`
- // The RFC 3339 timestamp when the bucket was added to packet captures API.
- Submitted string `json:"submitted,required"`
- // The RFC 3339 timestamp when the bucket was validated.
- Validated string `json:"validated"`
- JSON pcapOwnershipValidateResponseJSON `json:"-"`
-}
-
-// pcapOwnershipValidateResponseJSON contains the JSON metadata for the struct
-// [PCAPOwnershipValidateResponse]
-type pcapOwnershipValidateResponseJSON struct {
- ID apijson.Field
- DestinationConf apijson.Field
- Filename apijson.Field
- Status apijson.Field
- Submitted apijson.Field
- Validated apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PCAPOwnershipValidateResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pcapOwnershipValidateResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// The status of the ownership challenge. Can be pending, success or failed.
-type PCAPOwnershipValidateResponseStatus string
-
-const (
- PCAPOwnershipValidateResponseStatusPending PCAPOwnershipValidateResponseStatus = "pending"
- PCAPOwnershipValidateResponseStatusSuccess PCAPOwnershipValidateResponseStatus = "success"
- PCAPOwnershipValidateResponseStatusFailed PCAPOwnershipValidateResponseStatus = "failed"
-)
-
-type PCAPOwnershipNewParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
- // The full URI for the bucket. This field only applies to `full` packet captures.
- DestinationConf param.Field[string] `json:"destination_conf,required"`
-}
-
-func (r PCAPOwnershipNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type PCAPOwnershipNewResponseEnvelope struct {
- Errors []PCAPOwnershipNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []PCAPOwnershipNewResponseEnvelopeMessages `json:"messages,required"`
- Result PCAPOwnershipNewResponse `json:"result,required"`
- // Whether the API call was successful
- Success PCAPOwnershipNewResponseEnvelopeSuccess `json:"success,required"`
- JSON pcapOwnershipNewResponseEnvelopeJSON `json:"-"`
-}
-
-// pcapOwnershipNewResponseEnvelopeJSON contains the JSON metadata for the struct
-// [PCAPOwnershipNewResponseEnvelope]
-type pcapOwnershipNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PCAPOwnershipNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pcapOwnershipNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type PCAPOwnershipNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON pcapOwnershipNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// pcapOwnershipNewResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [PCAPOwnershipNewResponseEnvelopeErrors]
-type pcapOwnershipNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PCAPOwnershipNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pcapOwnershipNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type PCAPOwnershipNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON pcapOwnershipNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// pcapOwnershipNewResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [PCAPOwnershipNewResponseEnvelopeMessages]
-type pcapOwnershipNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PCAPOwnershipNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pcapOwnershipNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type PCAPOwnershipNewResponseEnvelopeSuccess bool
-
-const (
- PCAPOwnershipNewResponseEnvelopeSuccessTrue PCAPOwnershipNewResponseEnvelopeSuccess = true
-)
-
-type PCAPOwnershipDeleteParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type PCAPOwnershipGetParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type PCAPOwnershipGetResponseEnvelope struct {
- Errors []PCAPOwnershipGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []PCAPOwnershipGetResponseEnvelopeMessages `json:"messages,required"`
- Result []PCAPOwnershipGetResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success PCAPOwnershipGetResponseEnvelopeSuccess `json:"success,required"`
- ResultInfo PCAPOwnershipGetResponseEnvelopeResultInfo `json:"result_info"`
- JSON pcapOwnershipGetResponseEnvelopeJSON `json:"-"`
-}
-
-// pcapOwnershipGetResponseEnvelopeJSON contains the JSON metadata for the struct
-// [PCAPOwnershipGetResponseEnvelope]
-type pcapOwnershipGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- ResultInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PCAPOwnershipGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pcapOwnershipGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type PCAPOwnershipGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON pcapOwnershipGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// pcapOwnershipGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [PCAPOwnershipGetResponseEnvelopeErrors]
-type pcapOwnershipGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PCAPOwnershipGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pcapOwnershipGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type PCAPOwnershipGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON pcapOwnershipGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// pcapOwnershipGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [PCAPOwnershipGetResponseEnvelopeMessages]
-type pcapOwnershipGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PCAPOwnershipGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pcapOwnershipGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type PCAPOwnershipGetResponseEnvelopeSuccess bool
-
-const (
- PCAPOwnershipGetResponseEnvelopeSuccessTrue PCAPOwnershipGetResponseEnvelopeSuccess = true
-)
-
-type PCAPOwnershipGetResponseEnvelopeResultInfo struct {
- // Total number of results for the requested service
- Count float64 `json:"count"`
- // Current page within paginated list of results
- Page float64 `json:"page"`
- // Number of results per page of results
- PerPage float64 `json:"per_page"`
- // Total results available without any search parameters
- TotalCount float64 `json:"total_count"`
- JSON pcapOwnershipGetResponseEnvelopeResultInfoJSON `json:"-"`
-}
-
-// pcapOwnershipGetResponseEnvelopeResultInfoJSON contains the JSON metadata for
-// the struct [PCAPOwnershipGetResponseEnvelopeResultInfo]
-type pcapOwnershipGetResponseEnvelopeResultInfoJSON struct {
- Count apijson.Field
- Page apijson.Field
- PerPage apijson.Field
- TotalCount apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PCAPOwnershipGetResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pcapOwnershipGetResponseEnvelopeResultInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type PCAPOwnershipValidateParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
- // The full URI for the bucket. This field only applies to `full` packet captures.
- DestinationConf param.Field[string] `json:"destination_conf,required"`
- // The ownership challenge filename stored in the bucket.
- OwnershipChallenge param.Field[string] `json:"ownership_challenge,required"`
-}
-
-func (r PCAPOwnershipValidateParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type PCAPOwnershipValidateResponseEnvelope struct {
- Errors []PCAPOwnershipValidateResponseEnvelopeErrors `json:"errors,required"`
- Messages []PCAPOwnershipValidateResponseEnvelopeMessages `json:"messages,required"`
- Result PCAPOwnershipValidateResponse `json:"result,required"`
- // Whether the API call was successful
- Success PCAPOwnershipValidateResponseEnvelopeSuccess `json:"success,required"`
- JSON pcapOwnershipValidateResponseEnvelopeJSON `json:"-"`
-}
-
-// pcapOwnershipValidateResponseEnvelopeJSON contains the JSON metadata for the
-// struct [PCAPOwnershipValidateResponseEnvelope]
-type pcapOwnershipValidateResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PCAPOwnershipValidateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pcapOwnershipValidateResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type PCAPOwnershipValidateResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON pcapOwnershipValidateResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// pcapOwnershipValidateResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [PCAPOwnershipValidateResponseEnvelopeErrors]
-type pcapOwnershipValidateResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PCAPOwnershipValidateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pcapOwnershipValidateResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type PCAPOwnershipValidateResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON pcapOwnershipValidateResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// pcapOwnershipValidateResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [PCAPOwnershipValidateResponseEnvelopeMessages]
-type pcapOwnershipValidateResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *PCAPOwnershipValidateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r pcapOwnershipValidateResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type PCAPOwnershipValidateResponseEnvelopeSuccess bool
-
-const (
- PCAPOwnershipValidateResponseEnvelopeSuccessTrue PCAPOwnershipValidateResponseEnvelopeSuccess = true
-)
diff --git a/pcapownership_test.go b/pcapownership_test.go
deleted file mode 100644
index d61815d02a7..00000000000
--- a/pcapownership_test.go
+++ /dev/null
@@ -1,125 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestPCAPOwnershipNew(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"),
- )
- _, err := client.PCAPs.Ownerships.New(context.TODO(), cloudflare.PCAPOwnershipNewParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- DestinationConf: cloudflare.F("s3://pcaps-bucket?region=us-east-1"),
- })
- 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())
- }
-}
-
-func TestPCAPOwnershipDelete(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"),
- )
- err := client.PCAPs.Ownerships.Delete(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.PCAPOwnershipDeleteParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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())
- }
-}
-
-func TestPCAPOwnershipGet(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"),
- )
- _, err := client.PCAPs.Ownerships.Get(context.TODO(), cloudflare.PCAPOwnershipGetParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- })
- 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())
- }
-}
-
-func TestPCAPOwnershipValidate(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"),
- )
- _, err := client.PCAPs.Ownerships.Validate(context.TODO(), cloudflare.PCAPOwnershipValidateParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- DestinationConf: cloudflare.F("s3://pcaps-bucket?region=us-east-1"),
- OwnershipChallenge: cloudflare.F("ownership-challenge-9883874ecac311ec8475433579a6bf5f.txt"),
- })
- 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/pcaps/aliases.go b/pcaps/aliases.go
new file mode 100644
index 00000000000..961dea82c4e
--- /dev/null
+++ b/pcaps/aliases.go
@@ -0,0 +1,9 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package pcaps
+
+import (
+ "github.com/cloudflare/cloudflare-go/internal/apierror"
+)
+
+type Error = apierror.Error
diff --git a/pcaps/download.go b/pcaps/download.go
new file mode 100644
index 00000000000..ab5985a6363
--- /dev/null
+++ b/pcaps/download.go
@@ -0,0 +1,44 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package pcaps
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// DownloadService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewDownloadService] method instead.
+type DownloadService struct {
+ Options []option.RequestOption
+}
+
+// NewDownloadService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewDownloadService(opts ...option.RequestOption) (r *DownloadService) {
+ r = &DownloadService{}
+ r.Options = opts
+ return
+}
+
+// Download PCAP information into a file. Response is a binary PCAP file.
+func (r *DownloadService) Get(ctx context.Context, pcapID string, query DownloadGetParams, opts ...option.RequestOption) (res *http.Response, err error) {
+ opts = append(r.Options[:], opts...)
+ opts = append([]option.RequestOption{option.WithHeader("Accept", "application/vnd.tcpdump.pcap")}, opts...)
+ path := fmt.Sprintf("accounts/%s/pcaps/%s/download", query.AccountID, pcapID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &res, opts...)
+ return
+}
+
+type DownloadGetParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
diff --git a/pcaps/download_test.go b/pcaps/download_test.go
new file mode 100644
index 00000000000..6d79fc9acd8
--- /dev/null
+++ b/pcaps/download_test.go
@@ -0,0 +1,59 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package pcaps_test
+
+import (
+ "bytes"
+ "context"
+ "errors"
+ "io"
+ "net/http"
+ "net/http/httptest"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/pcaps"
+)
+
+func TestDownloadGet(t *testing.T) {
+ t.Skip("skipped: tests are disabled for the time being")
+ server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ w.WriteHeader(200)
+ w.Write([]byte("abc"))
+ }))
+ defer server.Close()
+ baseURL := server.URL
+ client := cloudflare.NewClient(
+ option.WithBaseURL(baseURL),
+ option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"),
+ option.WithAPIEmail("user@example.com"),
+ )
+ resp, err := client.PCAPs.Downloads.Get(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ pcaps.DownloadGetParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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())
+ }
+ defer resp.Body.Close()
+
+ b, err := io.ReadAll(resp.Body)
+ 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())
+ }
+ if !bytes.Equal(b, []byte("abc")) {
+ t.Fatalf("return value not %s: %s", "abc", b)
+ }
+}
diff --git a/pcaps/ownership.go b/pcaps/ownership.go
new file mode 100644
index 00000000000..d8b88f7d549
--- /dev/null
+++ b/pcaps/ownership.go
@@ -0,0 +1,435 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package pcaps
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// OwnershipService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewOwnershipService] method instead.
+type OwnershipService struct {
+ Options []option.RequestOption
+}
+
+// NewOwnershipService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewOwnershipService(opts ...option.RequestOption) (r *OwnershipService) {
+ r = &OwnershipService{}
+ r.Options = opts
+ return
+}
+
+// Adds an AWS or GCP bucket to use with full packet captures.
+func (r *OwnershipService) New(ctx context.Context, params OwnershipNewParams, opts ...option.RequestOption) (res *MagicVisibilityPCAPsOwnership, err error) {
+ opts = append(r.Options[:], opts...)
+ var env OwnershipNewResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/pcaps/ownership", params.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Deletes buckets added to the packet captures API.
+func (r *OwnershipService) Delete(ctx context.Context, ownershipID string, body OwnershipDeleteParams, opts ...option.RequestOption) (err error) {
+ opts = append(r.Options[:], opts...)
+ opts = append([]option.RequestOption{option.WithHeader("Accept", "")}, opts...)
+ path := fmt.Sprintf("accounts/%s/pcaps/ownership/%s", body.AccountID, ownershipID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, nil, opts...)
+ return
+}
+
+// List all buckets configured for use with PCAPs API.
+func (r *OwnershipService) Get(ctx context.Context, query OwnershipGetParams, opts ...option.RequestOption) (res *[]MagicVisibilityPCAPsOwnership, err error) {
+ opts = append(r.Options[:], opts...)
+ var env OwnershipGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/pcaps/ownership", query.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Validates buckets added to the packet captures API.
+func (r *OwnershipService) Validate(ctx context.Context, params OwnershipValidateParams, opts ...option.RequestOption) (res *MagicVisibilityPCAPsOwnership, err error) {
+ opts = append(r.Options[:], opts...)
+ var env OwnershipValidateResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/pcaps/ownership/validate", params.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type MagicVisibilityPCAPsOwnership struct {
+ // The bucket ID associated with the packet captures API.
+ ID string `json:"id,required"`
+ // The full URI for the bucket. This field only applies to `full` packet captures.
+ DestinationConf string `json:"destination_conf,required"`
+ // The ownership challenge filename stored in the bucket.
+ Filename string `json:"filename,required"`
+ // The status of the ownership challenge. Can be pending, success or failed.
+ Status MagicVisibilityPCAPsOwnershipStatus `json:"status,required"`
+ // The RFC 3339 timestamp when the bucket was added to packet captures API.
+ Submitted string `json:"submitted,required"`
+ // The RFC 3339 timestamp when the bucket was validated.
+ Validated string `json:"validated"`
+ JSON magicVisibilityPCAPsOwnershipJSON `json:"-"`
+}
+
+// magicVisibilityPCAPsOwnershipJSON contains the JSON metadata for the struct
+// [MagicVisibilityPCAPsOwnership]
+type magicVisibilityPCAPsOwnershipJSON struct {
+ ID apijson.Field
+ DestinationConf apijson.Field
+ Filename apijson.Field
+ Status apijson.Field
+ Submitted apijson.Field
+ Validated apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *MagicVisibilityPCAPsOwnership) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r magicVisibilityPCAPsOwnershipJSON) RawJSON() string {
+ return r.raw
+}
+
+// The status of the ownership challenge. Can be pending, success or failed.
+type MagicVisibilityPCAPsOwnershipStatus string
+
+const (
+ MagicVisibilityPCAPsOwnershipStatusPending MagicVisibilityPCAPsOwnershipStatus = "pending"
+ MagicVisibilityPCAPsOwnershipStatusSuccess MagicVisibilityPCAPsOwnershipStatus = "success"
+ MagicVisibilityPCAPsOwnershipStatusFailed MagicVisibilityPCAPsOwnershipStatus = "failed"
+)
+
+type OwnershipNewParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ // The full URI for the bucket. This field only applies to `full` packet captures.
+ DestinationConf param.Field[string] `json:"destination_conf,required"`
+}
+
+func (r OwnershipNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type OwnershipNewResponseEnvelope struct {
+ Errors []OwnershipNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []OwnershipNewResponseEnvelopeMessages `json:"messages,required"`
+ Result MagicVisibilityPCAPsOwnership `json:"result,required"`
+ // Whether the API call was successful
+ Success OwnershipNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON ownershipNewResponseEnvelopeJSON `json:"-"`
+}
+
+// ownershipNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [OwnershipNewResponseEnvelope]
+type ownershipNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *OwnershipNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ownershipNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type OwnershipNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON ownershipNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// ownershipNewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [OwnershipNewResponseEnvelopeErrors]
+type ownershipNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *OwnershipNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ownershipNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type OwnershipNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON ownershipNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// ownershipNewResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [OwnershipNewResponseEnvelopeMessages]
+type ownershipNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *OwnershipNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ownershipNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type OwnershipNewResponseEnvelopeSuccess bool
+
+const (
+ OwnershipNewResponseEnvelopeSuccessTrue OwnershipNewResponseEnvelopeSuccess = true
+)
+
+type OwnershipDeleteParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type OwnershipGetParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type OwnershipGetResponseEnvelope struct {
+ Errors []OwnershipGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []OwnershipGetResponseEnvelopeMessages `json:"messages,required"`
+ Result []MagicVisibilityPCAPsOwnership `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success OwnershipGetResponseEnvelopeSuccess `json:"success,required"`
+ ResultInfo OwnershipGetResponseEnvelopeResultInfo `json:"result_info"`
+ JSON ownershipGetResponseEnvelopeJSON `json:"-"`
+}
+
+// ownershipGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [OwnershipGetResponseEnvelope]
+type ownershipGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ ResultInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *OwnershipGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ownershipGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type OwnershipGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON ownershipGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// ownershipGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [OwnershipGetResponseEnvelopeErrors]
+type ownershipGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *OwnershipGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ownershipGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type OwnershipGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON ownershipGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// ownershipGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [OwnershipGetResponseEnvelopeMessages]
+type ownershipGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *OwnershipGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ownershipGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type OwnershipGetResponseEnvelopeSuccess bool
+
+const (
+ OwnershipGetResponseEnvelopeSuccessTrue OwnershipGetResponseEnvelopeSuccess = true
+)
+
+type OwnershipGetResponseEnvelopeResultInfo struct {
+ // Total number of results for the requested service
+ Count float64 `json:"count"`
+ // Current page within paginated list of results
+ Page float64 `json:"page"`
+ // Number of results per page of results
+ PerPage float64 `json:"per_page"`
+ // Total results available without any search parameters
+ TotalCount float64 `json:"total_count"`
+ JSON ownershipGetResponseEnvelopeResultInfoJSON `json:"-"`
+}
+
+// ownershipGetResponseEnvelopeResultInfoJSON contains the JSON metadata for the
+// struct [OwnershipGetResponseEnvelopeResultInfo]
+type ownershipGetResponseEnvelopeResultInfoJSON struct {
+ Count apijson.Field
+ Page apijson.Field
+ PerPage apijson.Field
+ TotalCount apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *OwnershipGetResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ownershipGetResponseEnvelopeResultInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type OwnershipValidateParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ // The full URI for the bucket. This field only applies to `full` packet captures.
+ DestinationConf param.Field[string] `json:"destination_conf,required"`
+ // The ownership challenge filename stored in the bucket.
+ OwnershipChallenge param.Field[string] `json:"ownership_challenge,required"`
+}
+
+func (r OwnershipValidateParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type OwnershipValidateResponseEnvelope struct {
+ Errors []OwnershipValidateResponseEnvelopeErrors `json:"errors,required"`
+ Messages []OwnershipValidateResponseEnvelopeMessages `json:"messages,required"`
+ Result MagicVisibilityPCAPsOwnership `json:"result,required"`
+ // Whether the API call was successful
+ Success OwnershipValidateResponseEnvelopeSuccess `json:"success,required"`
+ JSON ownershipValidateResponseEnvelopeJSON `json:"-"`
+}
+
+// ownershipValidateResponseEnvelopeJSON contains the JSON metadata for the struct
+// [OwnershipValidateResponseEnvelope]
+type ownershipValidateResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *OwnershipValidateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ownershipValidateResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type OwnershipValidateResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON ownershipValidateResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// ownershipValidateResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [OwnershipValidateResponseEnvelopeErrors]
+type ownershipValidateResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *OwnershipValidateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ownershipValidateResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type OwnershipValidateResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON ownershipValidateResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// ownershipValidateResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [OwnershipValidateResponseEnvelopeMessages]
+type ownershipValidateResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *OwnershipValidateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ownershipValidateResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type OwnershipValidateResponseEnvelopeSuccess bool
+
+const (
+ OwnershipValidateResponseEnvelopeSuccessTrue OwnershipValidateResponseEnvelopeSuccess = true
+)
diff --git a/pcaps/ownership_test.go b/pcaps/ownership_test.go
new file mode 100644
index 00000000000..686b18ad440
--- /dev/null
+++ b/pcaps/ownership_test.go
@@ -0,0 +1,126 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package pcaps_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/pcaps"
+)
+
+func TestOwnershipNew(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"),
+ )
+ _, err := client.PCAPs.Ownerships.New(context.TODO(), pcaps.OwnershipNewParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ DestinationConf: cloudflare.F("s3://pcaps-bucket?region=us-east-1"),
+ })
+ 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())
+ }
+}
+
+func TestOwnershipDelete(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"),
+ )
+ err := client.PCAPs.Ownerships.Delete(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ pcaps.OwnershipDeleteParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestOwnershipGet(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"),
+ )
+ _, err := client.PCAPs.Ownerships.Get(context.TODO(), pcaps.OwnershipGetParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ })
+ 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())
+ }
+}
+
+func TestOwnershipValidate(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"),
+ )
+ _, err := client.PCAPs.Ownerships.Validate(context.TODO(), pcaps.OwnershipValidateParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ DestinationConf: cloudflare.F("s3://pcaps-bucket?region=us-east-1"),
+ OwnershipChallenge: cloudflare.F("ownership-challenge-9883874ecac311ec8475433579a6bf5f.txt"),
+ })
+ 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/pcap.go b/pcaps/pcap.go
similarity index 98%
rename from pcap.go
rename to pcaps/pcap.go
index 81d90ecdf83..fe8940eb32b 100644
--- a/pcap.go
+++ b/pcaps/pcap.go
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package cloudflare
+package pcaps
import (
"context"
@@ -21,8 +21,8 @@ import (
// directly, and instead use the [NewPCAPService] method instead.
type PCAPService struct {
Options []option.RequestOption
- Ownerships *PCAPOwnershipService
- Downloads *PCAPDownloadService
+ Ownerships *OwnershipService
+ Downloads *DownloadService
}
// NewPCAPService generates a new service that applies the given options to each
@@ -31,8 +31,8 @@ type PCAPService struct {
func NewPCAPService(opts ...option.RequestOption) (r *PCAPService) {
r = &PCAPService{}
r.Options = opts
- r.Ownerships = NewPCAPOwnershipService(opts...)
- r.Downloads = NewPCAPDownloadService(opts...)
+ r.Ownerships = NewOwnershipService(opts...)
+ r.Downloads = NewDownloadService(opts...)
return
}
@@ -75,10 +75,10 @@ func (r *PCAPService) Get(ctx context.Context, pcapID string, query PCAPGetParam
return
}
-// Union satisfied by [PCAPNewResponseMagicVisibilityPCAPsResponseSimple] or
-// [PCAPNewResponseMagicVisibilityPCAPsResponseFull].
+// Union satisfied by [pcaps.PCAPNewResponseMagicVisibilityPCAPsResponseSimple] or
+// [pcaps.PCAPNewResponseMagicVisibilityPCAPsResponseFull].
type PCAPNewResponse interface {
- implementsPCAPNewResponse()
+ implementsPCAPsPCAPNewResponse()
}
func init() {
@@ -137,7 +137,7 @@ func (r pcapNewResponseMagicVisibilityPCAPsResponseSimpleJSON) RawJSON() string
return r.raw
}
-func (r PCAPNewResponseMagicVisibilityPCAPsResponseSimple) implementsPCAPNewResponse() {}
+func (r PCAPNewResponseMagicVisibilityPCAPsResponseSimple) implementsPCAPsPCAPNewResponse() {}
// The packet capture filter. When this field is empty, all packets are captured.
type PCAPNewResponseMagicVisibilityPCAPsResponseSimpleFilterV1 struct {
@@ -262,7 +262,7 @@ func (r pcapNewResponseMagicVisibilityPCAPsResponseFullJSON) RawJSON() string {
return r.raw
}
-func (r PCAPNewResponseMagicVisibilityPCAPsResponseFull) implementsPCAPNewResponse() {}
+func (r PCAPNewResponseMagicVisibilityPCAPsResponseFull) implementsPCAPsPCAPNewResponse() {}
// The packet capture filter. When this field is empty, all packets are captured.
type PCAPNewResponseMagicVisibilityPCAPsResponseFullFilterV1 struct {
@@ -330,10 +330,10 @@ const (
PCAPNewResponseMagicVisibilityPCAPsResponseFullTypeFull PCAPNewResponseMagicVisibilityPCAPsResponseFullType = "full"
)
-// Union satisfied by [PCAPListResponseMagicVisibilityPCAPsResponseSimple] or
-// [PCAPListResponseMagicVisibilityPCAPsResponseFull].
+// Union satisfied by [pcaps.PCAPListResponseMagicVisibilityPCAPsResponseSimple] or
+// [pcaps.PCAPListResponseMagicVisibilityPCAPsResponseFull].
type PCAPListResponse interface {
- implementsPCAPListResponse()
+ implementsPCAPsPCAPListResponse()
}
func init() {
@@ -392,7 +392,7 @@ func (r pcapListResponseMagicVisibilityPCAPsResponseSimpleJSON) RawJSON() string
return r.raw
}
-func (r PCAPListResponseMagicVisibilityPCAPsResponseSimple) implementsPCAPListResponse() {}
+func (r PCAPListResponseMagicVisibilityPCAPsResponseSimple) implementsPCAPsPCAPListResponse() {}
// The packet capture filter. When this field is empty, all packets are captured.
type PCAPListResponseMagicVisibilityPCAPsResponseSimpleFilterV1 struct {
@@ -517,7 +517,7 @@ func (r pcapListResponseMagicVisibilityPCAPsResponseFullJSON) RawJSON() string {
return r.raw
}
-func (r PCAPListResponseMagicVisibilityPCAPsResponseFull) implementsPCAPListResponse() {}
+func (r PCAPListResponseMagicVisibilityPCAPsResponseFull) implementsPCAPsPCAPListResponse() {}
// The packet capture filter. When this field is empty, all packets are captured.
type PCAPListResponseMagicVisibilityPCAPsResponseFullFilterV1 struct {
@@ -585,10 +585,10 @@ const (
PCAPListResponseMagicVisibilityPCAPsResponseFullTypeFull PCAPListResponseMagicVisibilityPCAPsResponseFullType = "full"
)
-// Union satisfied by [PCAPGetResponseMagicVisibilityPCAPsResponseSimple] or
-// [PCAPGetResponseMagicVisibilityPCAPsResponseFull].
+// Union satisfied by [pcaps.PCAPGetResponseMagicVisibilityPCAPsResponseSimple] or
+// [pcaps.PCAPGetResponseMagicVisibilityPCAPsResponseFull].
type PCAPGetResponse interface {
- implementsPCAPGetResponse()
+ implementsPCAPsPCAPGetResponse()
}
func init() {
@@ -647,7 +647,7 @@ func (r pcapGetResponseMagicVisibilityPCAPsResponseSimpleJSON) RawJSON() string
return r.raw
}
-func (r PCAPGetResponseMagicVisibilityPCAPsResponseSimple) implementsPCAPGetResponse() {}
+func (r PCAPGetResponseMagicVisibilityPCAPsResponseSimple) implementsPCAPsPCAPGetResponse() {}
// The packet capture filter. When this field is empty, all packets are captured.
type PCAPGetResponseMagicVisibilityPCAPsResponseSimpleFilterV1 struct {
@@ -772,7 +772,7 @@ func (r pcapGetResponseMagicVisibilityPCAPsResponseFullJSON) RawJSON() string {
return r.raw
}
-func (r PCAPGetResponseMagicVisibilityPCAPsResponseFull) implementsPCAPGetResponse() {}
+func (r PCAPGetResponseMagicVisibilityPCAPsResponseFull) implementsPCAPsPCAPGetResponse() {}
// The packet capture filter. When this field is empty, all packets are captured.
type PCAPGetResponseMagicVisibilityPCAPsResponseFullFilterV1 struct {
diff --git a/pcap_test.go b/pcaps/pcap_test.go
similarity index 87%
rename from pcap_test.go
rename to pcaps/pcap_test.go
index 48d618d5a58..1b6afd869d6 100644
--- a/pcap_test.go
+++ b/pcaps/pcap_test.go
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package cloudflare_test
+package pcaps_test
import (
"context"
@@ -11,6 +11,7 @@ import (
"github.com/cloudflare/cloudflare-go"
"github.com/cloudflare/cloudflare-go/internal/testutil"
"github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/pcaps"
)
func TestPCAPNewWithOptionalParams(t *testing.T) {
@@ -27,15 +28,15 @@ func TestPCAPNewWithOptionalParams(t *testing.T) {
option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"),
option.WithAPIEmail("user@example.com"),
)
- _, err := client.PCAPs.New(context.TODO(), cloudflare.PCAPNewParams{
+ _, err := client.PCAPs.New(context.TODO(), pcaps.PCAPNewParams{
AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- System: cloudflare.F(cloudflare.PCAPNewParamsSystemMagicTransit),
+ System: cloudflare.F(pcaps.PCAPNewParamsSystemMagicTransit),
TimeLimit: cloudflare.F(300.000000),
- Type: cloudflare.F(cloudflare.PCAPNewParamsTypeSimple),
+ Type: cloudflare.F(pcaps.PCAPNewParamsTypeSimple),
ByteLimit: cloudflare.F(500000.000000),
ColoName: cloudflare.F("ord02"),
DestinationConf: cloudflare.F("s3://pcaps-bucket?region=us-east-1"),
- FilterV1: cloudflare.F(cloudflare.PCAPNewParamsFilterV1{
+ FilterV1: cloudflare.F(pcaps.PCAPNewParamsFilterV1{
DestinationAddress: cloudflare.F("1.2.3.4"),
DestinationPort: cloudflare.F(80.000000),
Protocol: cloudflare.F(6.000000),
@@ -67,7 +68,7 @@ func TestPCAPList(t *testing.T) {
option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"),
option.WithAPIEmail("user@example.com"),
)
- _, err := client.PCAPs.List(context.TODO(), cloudflare.PCAPListParams{
+ _, err := client.PCAPs.List(context.TODO(), pcaps.PCAPListParams{
AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
})
if err != nil {
@@ -96,7 +97,7 @@ func TestPCAPGet(t *testing.T) {
_, err := client.PCAPs.Get(
context.TODO(),
"023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.PCAPGetParams{
+ pcaps.PCAPGetParams{
AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
},
)
diff --git a/queueconsumer.go b/queueconsumer.go
deleted file mode 100644
index d5d4b5fe3e2..00000000000
--- a/queueconsumer.go
+++ /dev/null
@@ -1,720 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "reflect"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/option"
- "github.com/tidwall/gjson"
-)
-
-// QueueConsumerService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewQueueConsumerService] method
-// instead.
-type QueueConsumerService struct {
- Options []option.RequestOption
-}
-
-// NewQueueConsumerService generates a new service that applies the given options
-// to each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewQueueConsumerService(opts ...option.RequestOption) (r *QueueConsumerService) {
- r = &QueueConsumerService{}
- r.Options = opts
- return
-}
-
-// Creates a new consumer for a queue.
-func (r *QueueConsumerService) New(ctx context.Context, name string, params QueueConsumerNewParams, opts ...option.RequestOption) (res *QueueConsumerNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env QueueConsumerNewResponseEnvelope
- path := fmt.Sprintf("accounts/%s/workers/queues/%s/consumers", params.AccountID, name)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Updates the consumer for a queue, or creates one if it does not exist.
-func (r *QueueConsumerService) Update(ctx context.Context, name string, consumerName string, params QueueConsumerUpdateParams, opts ...option.RequestOption) (res *QueueConsumerUpdateResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env QueueConsumerUpdateResponseEnvelope
- path := fmt.Sprintf("accounts/%s/workers/queues/%s/consumers/%s", params.AccountID, name, consumerName)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Deletes the consumer for a queue.
-func (r *QueueConsumerService) Delete(ctx context.Context, name string, consumerName string, body QueueConsumerDeleteParams, opts ...option.RequestOption) (res *QueueConsumerDeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env QueueConsumerDeleteResponseEnvelope
- path := fmt.Sprintf("accounts/%s/workers/queues/%s/consumers/%s", body.AccountID, name, consumerName)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Returns the consumers for a queue.
-func (r *QueueConsumerService) Get(ctx context.Context, name string, query QueueConsumerGetParams, opts ...option.RequestOption) (res *[]QueueConsumerGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env QueueConsumerGetResponseEnvelope
- path := fmt.Sprintf("accounts/%s/workers/queues/%s/consumers", query.AccountID, name)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type QueueConsumerNewResponse struct {
- CreatedOn interface{} `json:"created_on"`
- DeadLetterQueue string `json:"dead_letter_queue"`
- Environment interface{} `json:"environment"`
- QueueName interface{} `json:"queue_name"`
- ScriptName interface{} `json:"script_name"`
- Settings QueueConsumerNewResponseSettings `json:"settings"`
- JSON queueConsumerNewResponseJSON `json:"-"`
-}
-
-// queueConsumerNewResponseJSON contains the JSON metadata for the struct
-// [QueueConsumerNewResponse]
-type queueConsumerNewResponseJSON struct {
- CreatedOn apijson.Field
- DeadLetterQueue apijson.Field
- Environment apijson.Field
- QueueName apijson.Field
- ScriptName apijson.Field
- Settings apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *QueueConsumerNewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r queueConsumerNewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type QueueConsumerNewResponseSettings struct {
- BatchSize float64 `json:"batch_size"`
- MaxRetries float64 `json:"max_retries"`
- MaxWaitTimeMs float64 `json:"max_wait_time_ms"`
- JSON queueConsumerNewResponseSettingsJSON `json:"-"`
-}
-
-// queueConsumerNewResponseSettingsJSON contains the JSON metadata for the struct
-// [QueueConsumerNewResponseSettings]
-type queueConsumerNewResponseSettingsJSON struct {
- BatchSize apijson.Field
- MaxRetries apijson.Field
- MaxWaitTimeMs apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *QueueConsumerNewResponseSettings) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r queueConsumerNewResponseSettingsJSON) RawJSON() string {
- return r.raw
-}
-
-type QueueConsumerUpdateResponse struct {
- CreatedOn interface{} `json:"created_on"`
- DeadLetterQueue interface{} `json:"dead_letter_queue"`
- Environment interface{} `json:"environment"`
- QueueName interface{} `json:"queue_name"`
- ScriptName interface{} `json:"script_name"`
- Settings QueueConsumerUpdateResponseSettings `json:"settings"`
- JSON queueConsumerUpdateResponseJSON `json:"-"`
-}
-
-// queueConsumerUpdateResponseJSON contains the JSON metadata for the struct
-// [QueueConsumerUpdateResponse]
-type queueConsumerUpdateResponseJSON struct {
- CreatedOn apijson.Field
- DeadLetterQueue apijson.Field
- Environment apijson.Field
- QueueName apijson.Field
- ScriptName apijson.Field
- Settings apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *QueueConsumerUpdateResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r queueConsumerUpdateResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type QueueConsumerUpdateResponseSettings struct {
- BatchSize float64 `json:"batch_size"`
- MaxRetries float64 `json:"max_retries"`
- MaxWaitTimeMs float64 `json:"max_wait_time_ms"`
- JSON queueConsumerUpdateResponseSettingsJSON `json:"-"`
-}
-
-// queueConsumerUpdateResponseSettingsJSON contains the JSON metadata for the
-// struct [QueueConsumerUpdateResponseSettings]
-type queueConsumerUpdateResponseSettingsJSON struct {
- BatchSize apijson.Field
- MaxRetries apijson.Field
- MaxWaitTimeMs apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *QueueConsumerUpdateResponseSettings) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r queueConsumerUpdateResponseSettingsJSON) RawJSON() string {
- return r.raw
-}
-
-// Union satisfied by [QueueConsumerDeleteResponseUnknown],
-// [QueueConsumerDeleteResponseArray] or [shared.UnionString].
-type QueueConsumerDeleteResponse interface {
- ImplementsQueueConsumerDeleteResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*QueueConsumerDeleteResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(QueueConsumerDeleteResponseArray{}),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-type QueueConsumerDeleteResponseArray []interface{}
-
-func (r QueueConsumerDeleteResponseArray) ImplementsQueueConsumerDeleteResponse() {}
-
-type QueueConsumerGetResponse struct {
- CreatedOn interface{} `json:"created_on"`
- Environment interface{} `json:"environment"`
- QueueName interface{} `json:"queue_name"`
- Service interface{} `json:"service"`
- Settings QueueConsumerGetResponseSettings `json:"settings"`
- JSON queueConsumerGetResponseJSON `json:"-"`
-}
-
-// queueConsumerGetResponseJSON contains the JSON metadata for the struct
-// [QueueConsumerGetResponse]
-type queueConsumerGetResponseJSON struct {
- CreatedOn apijson.Field
- Environment apijson.Field
- QueueName apijson.Field
- Service apijson.Field
- Settings apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *QueueConsumerGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r queueConsumerGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type QueueConsumerGetResponseSettings struct {
- BatchSize float64 `json:"batch_size"`
- MaxRetries float64 `json:"max_retries"`
- MaxWaitTimeMs float64 `json:"max_wait_time_ms"`
- JSON queueConsumerGetResponseSettingsJSON `json:"-"`
-}
-
-// queueConsumerGetResponseSettingsJSON contains the JSON metadata for the struct
-// [QueueConsumerGetResponseSettings]
-type queueConsumerGetResponseSettingsJSON struct {
- BatchSize apijson.Field
- MaxRetries apijson.Field
- MaxWaitTimeMs apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *QueueConsumerGetResponseSettings) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r queueConsumerGetResponseSettingsJSON) RawJSON() string {
- return r.raw
-}
-
-type QueueConsumerNewParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
- Body param.Field[interface{}] `json:"body,required"`
-}
-
-func (r QueueConsumerNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r.Body)
-}
-
-type QueueConsumerNewResponseEnvelope struct {
- Errors []QueueConsumerNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []QueueConsumerNewResponseEnvelopeMessages `json:"messages,required"`
- Result QueueConsumerNewResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success QueueConsumerNewResponseEnvelopeSuccess `json:"success,required"`
- ResultInfo QueueConsumerNewResponseEnvelopeResultInfo `json:"result_info"`
- JSON queueConsumerNewResponseEnvelopeJSON `json:"-"`
-}
-
-// queueConsumerNewResponseEnvelopeJSON contains the JSON metadata for the struct
-// [QueueConsumerNewResponseEnvelope]
-type queueConsumerNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- ResultInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *QueueConsumerNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r queueConsumerNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type QueueConsumerNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON queueConsumerNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// queueConsumerNewResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [QueueConsumerNewResponseEnvelopeErrors]
-type queueConsumerNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *QueueConsumerNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r queueConsumerNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type QueueConsumerNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON queueConsumerNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// queueConsumerNewResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [QueueConsumerNewResponseEnvelopeMessages]
-type queueConsumerNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *QueueConsumerNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r queueConsumerNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type QueueConsumerNewResponseEnvelopeSuccess bool
-
-const (
- QueueConsumerNewResponseEnvelopeSuccessTrue QueueConsumerNewResponseEnvelopeSuccess = true
-)
-
-type QueueConsumerNewResponseEnvelopeResultInfo struct {
- // Total number of results for the requested service
- Count float64 `json:"count"`
- // Current page within paginated list of results
- Page float64 `json:"page"`
- // Number of results per page of results
- PerPage float64 `json:"per_page"`
- // Total results available without any search parameters
- TotalCount float64 `json:"total_count"`
- JSON queueConsumerNewResponseEnvelopeResultInfoJSON `json:"-"`
-}
-
-// queueConsumerNewResponseEnvelopeResultInfoJSON contains the JSON metadata for
-// the struct [QueueConsumerNewResponseEnvelopeResultInfo]
-type queueConsumerNewResponseEnvelopeResultInfoJSON struct {
- Count apijson.Field
- Page apijson.Field
- PerPage apijson.Field
- TotalCount apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *QueueConsumerNewResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r queueConsumerNewResponseEnvelopeResultInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type QueueConsumerUpdateParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
- Body param.Field[interface{}] `json:"body,required"`
-}
-
-func (r QueueConsumerUpdateParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r.Body)
-}
-
-type QueueConsumerUpdateResponseEnvelope struct {
- Errors []QueueConsumerUpdateResponseEnvelopeErrors `json:"errors,required"`
- Messages []QueueConsumerUpdateResponseEnvelopeMessages `json:"messages,required"`
- Result QueueConsumerUpdateResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success QueueConsumerUpdateResponseEnvelopeSuccess `json:"success,required"`
- ResultInfo QueueConsumerUpdateResponseEnvelopeResultInfo `json:"result_info"`
- JSON queueConsumerUpdateResponseEnvelopeJSON `json:"-"`
-}
-
-// queueConsumerUpdateResponseEnvelopeJSON contains the JSON metadata for the
-// struct [QueueConsumerUpdateResponseEnvelope]
-type queueConsumerUpdateResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- ResultInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *QueueConsumerUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r queueConsumerUpdateResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type QueueConsumerUpdateResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON queueConsumerUpdateResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// queueConsumerUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [QueueConsumerUpdateResponseEnvelopeErrors]
-type queueConsumerUpdateResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *QueueConsumerUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r queueConsumerUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type QueueConsumerUpdateResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON queueConsumerUpdateResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// queueConsumerUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [QueueConsumerUpdateResponseEnvelopeMessages]
-type queueConsumerUpdateResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *QueueConsumerUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r queueConsumerUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type QueueConsumerUpdateResponseEnvelopeSuccess bool
-
-const (
- QueueConsumerUpdateResponseEnvelopeSuccessTrue QueueConsumerUpdateResponseEnvelopeSuccess = true
-)
-
-type QueueConsumerUpdateResponseEnvelopeResultInfo struct {
- // Total number of results for the requested service
- Count float64 `json:"count"`
- // Current page within paginated list of results
- Page float64 `json:"page"`
- // Number of results per page of results
- PerPage float64 `json:"per_page"`
- // Total results available without any search parameters
- TotalCount float64 `json:"total_count"`
- JSON queueConsumerUpdateResponseEnvelopeResultInfoJSON `json:"-"`
-}
-
-// queueConsumerUpdateResponseEnvelopeResultInfoJSON contains the JSON metadata for
-// the struct [QueueConsumerUpdateResponseEnvelopeResultInfo]
-type queueConsumerUpdateResponseEnvelopeResultInfoJSON struct {
- Count apijson.Field
- Page apijson.Field
- PerPage apijson.Field
- TotalCount apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *QueueConsumerUpdateResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r queueConsumerUpdateResponseEnvelopeResultInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type QueueConsumerDeleteParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type QueueConsumerDeleteResponseEnvelope struct {
- Errors []QueueConsumerDeleteResponseEnvelopeErrors `json:"errors,required"`
- Messages []QueueConsumerDeleteResponseEnvelopeMessages `json:"messages,required"`
- Result QueueConsumerDeleteResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success QueueConsumerDeleteResponseEnvelopeSuccess `json:"success,required"`
- ResultInfo QueueConsumerDeleteResponseEnvelopeResultInfo `json:"result_info"`
- JSON queueConsumerDeleteResponseEnvelopeJSON `json:"-"`
-}
-
-// queueConsumerDeleteResponseEnvelopeJSON contains the JSON metadata for the
-// struct [QueueConsumerDeleteResponseEnvelope]
-type queueConsumerDeleteResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- ResultInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *QueueConsumerDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r queueConsumerDeleteResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type QueueConsumerDeleteResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON queueConsumerDeleteResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// queueConsumerDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [QueueConsumerDeleteResponseEnvelopeErrors]
-type queueConsumerDeleteResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *QueueConsumerDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r queueConsumerDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type QueueConsumerDeleteResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON queueConsumerDeleteResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// queueConsumerDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [QueueConsumerDeleteResponseEnvelopeMessages]
-type queueConsumerDeleteResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *QueueConsumerDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r queueConsumerDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type QueueConsumerDeleteResponseEnvelopeSuccess bool
-
-const (
- QueueConsumerDeleteResponseEnvelopeSuccessTrue QueueConsumerDeleteResponseEnvelopeSuccess = true
-)
-
-type QueueConsumerDeleteResponseEnvelopeResultInfo struct {
- // Total number of results for the requested service
- Count float64 `json:"count"`
- // Current page within paginated list of results
- Page float64 `json:"page"`
- // Number of results per page of results
- PerPage float64 `json:"per_page"`
- // Total results available without any search parameters
- TotalCount float64 `json:"total_count"`
- JSON queueConsumerDeleteResponseEnvelopeResultInfoJSON `json:"-"`
-}
-
-// queueConsumerDeleteResponseEnvelopeResultInfoJSON contains the JSON metadata for
-// the struct [QueueConsumerDeleteResponseEnvelopeResultInfo]
-type queueConsumerDeleteResponseEnvelopeResultInfoJSON struct {
- Count apijson.Field
- Page apijson.Field
- PerPage apijson.Field
- TotalCount apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *QueueConsumerDeleteResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r queueConsumerDeleteResponseEnvelopeResultInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type QueueConsumerGetParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type QueueConsumerGetResponseEnvelope struct {
- Errors []interface{} `json:"errors,required,nullable"`
- Messages []interface{} `json:"messages,required,nullable"`
- Result []QueueConsumerGetResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success QueueConsumerGetResponseEnvelopeSuccess `json:"success,required"`
- ResultInfo QueueConsumerGetResponseEnvelopeResultInfo `json:"result_info"`
- JSON queueConsumerGetResponseEnvelopeJSON `json:"-"`
-}
-
-// queueConsumerGetResponseEnvelopeJSON contains the JSON metadata for the struct
-// [QueueConsumerGetResponseEnvelope]
-type queueConsumerGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- ResultInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *QueueConsumerGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r queueConsumerGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type QueueConsumerGetResponseEnvelopeSuccess bool
-
-const (
- QueueConsumerGetResponseEnvelopeSuccessTrue QueueConsumerGetResponseEnvelopeSuccess = true
-)
-
-type QueueConsumerGetResponseEnvelopeResultInfo struct {
- // Total number of results for the requested service
- Count float64 `json:"count"`
- // Current page within paginated list of results
- Page float64 `json:"page"`
- // Number of results per page of results
- PerPage float64 `json:"per_page"`
- // Total results available without any search parameters
- TotalCount float64 `json:"total_count"`
- TotalPages interface{} `json:"total_pages"`
- JSON queueConsumerGetResponseEnvelopeResultInfoJSON `json:"-"`
-}
-
-// queueConsumerGetResponseEnvelopeResultInfoJSON contains the JSON metadata for
-// the struct [QueueConsumerGetResponseEnvelopeResultInfo]
-type queueConsumerGetResponseEnvelopeResultInfoJSON struct {
- Count apijson.Field
- Page apijson.Field
- PerPage apijson.Field
- TotalCount apijson.Field
- TotalPages apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *QueueConsumerGetResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r queueConsumerGetResponseEnvelopeResultInfoJSON) RawJSON() string {
- return r.raw
-}
diff --git a/queueconsumer_test.go b/queueconsumer_test.go
deleted file mode 100644
index 7adbaaf489d..00000000000
--- a/queueconsumer_test.go
+++ /dev/null
@@ -1,154 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestQueueConsumerNew(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"),
- )
- _, err := client.Queues.Consumers.New(
- context.TODO(),
- "example-queue",
- cloudflare.QueueConsumerNewParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Body: cloudflare.F[any](map[string]interface{}{
- "dead_letter_queue": "example-dlq",
- "environment": "production",
- "script_name": "example-consumer",
- "settings": map[string]interface{}{
- "batch_size": int64(10),
- "max_retries": int64(3),
- "max_wait_time_ms": int64(5000),
- },
- }),
- },
- )
- 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())
- }
-}
-
-func TestQueueConsumerUpdate(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"),
- )
- _, err := client.Queues.Consumers.Update(
- context.TODO(),
- "example-queue",
- "example-consumer",
- cloudflare.QueueConsumerUpdateParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Body: cloudflare.F[any](map[string]interface{}{
- "dead_letter_queue": "updated-example-dlq",
- "environment": "production",
- "script_name": "example-consumer",
- "settings": map[string]interface{}{
- "batch_size": int64(100),
- },
- }),
- },
- )
- 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())
- }
-}
-
-func TestQueueConsumerDelete(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"),
- )
- _, err := client.Queues.Consumers.Delete(
- context.TODO(),
- "example-queue",
- "example-consumer",
- cloudflare.QueueConsumerDeleteParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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())
- }
-}
-
-func TestQueueConsumerGet(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"),
- )
- _, err := client.Queues.Consumers.Get(
- context.TODO(),
- "example-queue",
- cloudflare.QueueConsumerGetParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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/queues/aliases.go b/queues/aliases.go
new file mode 100644
index 00000000000..c295225f404
--- /dev/null
+++ b/queues/aliases.go
@@ -0,0 +1,9 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package queues
+
+import (
+ "github.com/cloudflare/cloudflare-go/internal/apierror"
+)
+
+type Error = apierror.Error
diff --git a/queues/consumer.go b/queues/consumer.go
new file mode 100644
index 00000000000..d5e1d274264
--- /dev/null
+++ b/queues/consumer.go
@@ -0,0 +1,718 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package queues
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "reflect"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/tidwall/gjson"
+)
+
+// ConsumerService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewConsumerService] method instead.
+type ConsumerService struct {
+ Options []option.RequestOption
+}
+
+// NewConsumerService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewConsumerService(opts ...option.RequestOption) (r *ConsumerService) {
+ r = &ConsumerService{}
+ r.Options = opts
+ return
+}
+
+// Creates a new consumer for a queue.
+func (r *ConsumerService) New(ctx context.Context, name string, params ConsumerNewParams, opts ...option.RequestOption) (res *WorkersConsumerCreated, err error) {
+ opts = append(r.Options[:], opts...)
+ var env ConsumerNewResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/workers/queues/%s/consumers", params.AccountID, name)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Updates the consumer for a queue, or creates one if it does not exist.
+func (r *ConsumerService) Update(ctx context.Context, name string, consumerName string, params ConsumerUpdateParams, opts ...option.RequestOption) (res *WorkersConsumerUpdated, err error) {
+ opts = append(r.Options[:], opts...)
+ var env ConsumerUpdateResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/workers/queues/%s/consumers/%s", params.AccountID, name, consumerName)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Deletes the consumer for a queue.
+func (r *ConsumerService) Delete(ctx context.Context, name string, consumerName string, body ConsumerDeleteParams, opts ...option.RequestOption) (res *ConsumerDeleteResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env ConsumerDeleteResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/workers/queues/%s/consumers/%s", body.AccountID, name, consumerName)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Returns the consumers for a queue.
+func (r *ConsumerService) Get(ctx context.Context, name string, query ConsumerGetParams, opts ...option.RequestOption) (res *[]WorkersConsumer, err error) {
+ opts = append(r.Options[:], opts...)
+ var env ConsumerGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/workers/queues/%s/consumers", query.AccountID, name)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type WorkersConsumer struct {
+ CreatedOn interface{} `json:"created_on"`
+ Environment interface{} `json:"environment"`
+ QueueName interface{} `json:"queue_name"`
+ Service interface{} `json:"service"`
+ Settings WorkersConsumerSettings `json:"settings"`
+ JSON workersConsumerJSON `json:"-"`
+}
+
+// workersConsumerJSON contains the JSON metadata for the struct [WorkersConsumer]
+type workersConsumerJSON struct {
+ CreatedOn apijson.Field
+ Environment apijson.Field
+ QueueName apijson.Field
+ Service apijson.Field
+ Settings apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WorkersConsumer) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r workersConsumerJSON) RawJSON() string {
+ return r.raw
+}
+
+type WorkersConsumerSettings struct {
+ BatchSize float64 `json:"batch_size"`
+ MaxRetries float64 `json:"max_retries"`
+ MaxWaitTimeMs float64 `json:"max_wait_time_ms"`
+ JSON workersConsumerSettingsJSON `json:"-"`
+}
+
+// workersConsumerSettingsJSON contains the JSON metadata for the struct
+// [WorkersConsumerSettings]
+type workersConsumerSettingsJSON struct {
+ BatchSize apijson.Field
+ MaxRetries apijson.Field
+ MaxWaitTimeMs apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WorkersConsumerSettings) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r workersConsumerSettingsJSON) RawJSON() string {
+ return r.raw
+}
+
+type WorkersConsumerCreated struct {
+ CreatedOn interface{} `json:"created_on"`
+ DeadLetterQueue string `json:"dead_letter_queue"`
+ Environment interface{} `json:"environment"`
+ QueueName interface{} `json:"queue_name"`
+ ScriptName interface{} `json:"script_name"`
+ Settings WorkersConsumerCreatedSettings `json:"settings"`
+ JSON workersConsumerCreatedJSON `json:"-"`
+}
+
+// workersConsumerCreatedJSON contains the JSON metadata for the struct
+// [WorkersConsumerCreated]
+type workersConsumerCreatedJSON struct {
+ CreatedOn apijson.Field
+ DeadLetterQueue apijson.Field
+ Environment apijson.Field
+ QueueName apijson.Field
+ ScriptName apijson.Field
+ Settings apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WorkersConsumerCreated) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r workersConsumerCreatedJSON) RawJSON() string {
+ return r.raw
+}
+
+type WorkersConsumerCreatedSettings struct {
+ BatchSize float64 `json:"batch_size"`
+ MaxRetries float64 `json:"max_retries"`
+ MaxWaitTimeMs float64 `json:"max_wait_time_ms"`
+ JSON workersConsumerCreatedSettingsJSON `json:"-"`
+}
+
+// workersConsumerCreatedSettingsJSON contains the JSON metadata for the struct
+// [WorkersConsumerCreatedSettings]
+type workersConsumerCreatedSettingsJSON struct {
+ BatchSize apijson.Field
+ MaxRetries apijson.Field
+ MaxWaitTimeMs apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WorkersConsumerCreatedSettings) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r workersConsumerCreatedSettingsJSON) RawJSON() string {
+ return r.raw
+}
+
+type WorkersConsumerUpdated struct {
+ CreatedOn interface{} `json:"created_on"`
+ DeadLetterQueue interface{} `json:"dead_letter_queue"`
+ Environment interface{} `json:"environment"`
+ QueueName interface{} `json:"queue_name"`
+ ScriptName interface{} `json:"script_name"`
+ Settings WorkersConsumerUpdatedSettings `json:"settings"`
+ JSON workersConsumerUpdatedJSON `json:"-"`
+}
+
+// workersConsumerUpdatedJSON contains the JSON metadata for the struct
+// [WorkersConsumerUpdated]
+type workersConsumerUpdatedJSON struct {
+ CreatedOn apijson.Field
+ DeadLetterQueue apijson.Field
+ Environment apijson.Field
+ QueueName apijson.Field
+ ScriptName apijson.Field
+ Settings apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WorkersConsumerUpdated) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r workersConsumerUpdatedJSON) RawJSON() string {
+ return r.raw
+}
+
+type WorkersConsumerUpdatedSettings struct {
+ BatchSize float64 `json:"batch_size"`
+ MaxRetries float64 `json:"max_retries"`
+ MaxWaitTimeMs float64 `json:"max_wait_time_ms"`
+ JSON workersConsumerUpdatedSettingsJSON `json:"-"`
+}
+
+// workersConsumerUpdatedSettingsJSON contains the JSON metadata for the struct
+// [WorkersConsumerUpdatedSettings]
+type workersConsumerUpdatedSettingsJSON struct {
+ BatchSize apijson.Field
+ MaxRetries apijson.Field
+ MaxWaitTimeMs apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WorkersConsumerUpdatedSettings) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r workersConsumerUpdatedSettingsJSON) RawJSON() string {
+ return r.raw
+}
+
+// Union satisfied by [queues.ConsumerDeleteResponseUnknown],
+// [queues.ConsumerDeleteResponseArray] or [shared.UnionString].
+type ConsumerDeleteResponse interface {
+ ImplementsQueuesConsumerDeleteResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*ConsumerDeleteResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(ConsumerDeleteResponseArray{}),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+type ConsumerDeleteResponseArray []interface{}
+
+func (r ConsumerDeleteResponseArray) ImplementsQueuesConsumerDeleteResponse() {}
+
+type ConsumerNewParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ Body param.Field[interface{}] `json:"body,required"`
+}
+
+func (r ConsumerNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r.Body)
+}
+
+type ConsumerNewResponseEnvelope struct {
+ Errors []ConsumerNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []ConsumerNewResponseEnvelopeMessages `json:"messages,required"`
+ Result WorkersConsumerCreated `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success ConsumerNewResponseEnvelopeSuccess `json:"success,required"`
+ ResultInfo ConsumerNewResponseEnvelopeResultInfo `json:"result_info"`
+ JSON consumerNewResponseEnvelopeJSON `json:"-"`
+}
+
+// consumerNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [ConsumerNewResponseEnvelope]
+type consumerNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ ResultInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ConsumerNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r consumerNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type ConsumerNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON consumerNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// consumerNewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [ConsumerNewResponseEnvelopeErrors]
+type consumerNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ConsumerNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r consumerNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type ConsumerNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON consumerNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// consumerNewResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [ConsumerNewResponseEnvelopeMessages]
+type consumerNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ConsumerNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r consumerNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type ConsumerNewResponseEnvelopeSuccess bool
+
+const (
+ ConsumerNewResponseEnvelopeSuccessTrue ConsumerNewResponseEnvelopeSuccess = true
+)
+
+type ConsumerNewResponseEnvelopeResultInfo struct {
+ // Total number of results for the requested service
+ Count float64 `json:"count"`
+ // Current page within paginated list of results
+ Page float64 `json:"page"`
+ // Number of results per page of results
+ PerPage float64 `json:"per_page"`
+ // Total results available without any search parameters
+ TotalCount float64 `json:"total_count"`
+ JSON consumerNewResponseEnvelopeResultInfoJSON `json:"-"`
+}
+
+// consumerNewResponseEnvelopeResultInfoJSON contains the JSON metadata for the
+// struct [ConsumerNewResponseEnvelopeResultInfo]
+type consumerNewResponseEnvelopeResultInfoJSON struct {
+ Count apijson.Field
+ Page apijson.Field
+ PerPage apijson.Field
+ TotalCount apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ConsumerNewResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r consumerNewResponseEnvelopeResultInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type ConsumerUpdateParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ Body param.Field[interface{}] `json:"body,required"`
+}
+
+func (r ConsumerUpdateParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r.Body)
+}
+
+type ConsumerUpdateResponseEnvelope struct {
+ Errors []ConsumerUpdateResponseEnvelopeErrors `json:"errors,required"`
+ Messages []ConsumerUpdateResponseEnvelopeMessages `json:"messages,required"`
+ Result WorkersConsumerUpdated `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success ConsumerUpdateResponseEnvelopeSuccess `json:"success,required"`
+ ResultInfo ConsumerUpdateResponseEnvelopeResultInfo `json:"result_info"`
+ JSON consumerUpdateResponseEnvelopeJSON `json:"-"`
+}
+
+// consumerUpdateResponseEnvelopeJSON contains the JSON metadata for the struct
+// [ConsumerUpdateResponseEnvelope]
+type consumerUpdateResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ ResultInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ConsumerUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r consumerUpdateResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type ConsumerUpdateResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON consumerUpdateResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// consumerUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [ConsumerUpdateResponseEnvelopeErrors]
+type consumerUpdateResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ConsumerUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r consumerUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type ConsumerUpdateResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON consumerUpdateResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// consumerUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [ConsumerUpdateResponseEnvelopeMessages]
+type consumerUpdateResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ConsumerUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r consumerUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type ConsumerUpdateResponseEnvelopeSuccess bool
+
+const (
+ ConsumerUpdateResponseEnvelopeSuccessTrue ConsumerUpdateResponseEnvelopeSuccess = true
+)
+
+type ConsumerUpdateResponseEnvelopeResultInfo struct {
+ // Total number of results for the requested service
+ Count float64 `json:"count"`
+ // Current page within paginated list of results
+ Page float64 `json:"page"`
+ // Number of results per page of results
+ PerPage float64 `json:"per_page"`
+ // Total results available without any search parameters
+ TotalCount float64 `json:"total_count"`
+ JSON consumerUpdateResponseEnvelopeResultInfoJSON `json:"-"`
+}
+
+// consumerUpdateResponseEnvelopeResultInfoJSON contains the JSON metadata for the
+// struct [ConsumerUpdateResponseEnvelopeResultInfo]
+type consumerUpdateResponseEnvelopeResultInfoJSON struct {
+ Count apijson.Field
+ Page apijson.Field
+ PerPage apijson.Field
+ TotalCount apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ConsumerUpdateResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r consumerUpdateResponseEnvelopeResultInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type ConsumerDeleteParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type ConsumerDeleteResponseEnvelope struct {
+ Errors []ConsumerDeleteResponseEnvelopeErrors `json:"errors,required"`
+ Messages []ConsumerDeleteResponseEnvelopeMessages `json:"messages,required"`
+ Result ConsumerDeleteResponse `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success ConsumerDeleteResponseEnvelopeSuccess `json:"success,required"`
+ ResultInfo ConsumerDeleteResponseEnvelopeResultInfo `json:"result_info"`
+ JSON consumerDeleteResponseEnvelopeJSON `json:"-"`
+}
+
+// consumerDeleteResponseEnvelopeJSON contains the JSON metadata for the struct
+// [ConsumerDeleteResponseEnvelope]
+type consumerDeleteResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ ResultInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ConsumerDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r consumerDeleteResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type ConsumerDeleteResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON consumerDeleteResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// consumerDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [ConsumerDeleteResponseEnvelopeErrors]
+type consumerDeleteResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ConsumerDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r consumerDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type ConsumerDeleteResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON consumerDeleteResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// consumerDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [ConsumerDeleteResponseEnvelopeMessages]
+type consumerDeleteResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ConsumerDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r consumerDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type ConsumerDeleteResponseEnvelopeSuccess bool
+
+const (
+ ConsumerDeleteResponseEnvelopeSuccessTrue ConsumerDeleteResponseEnvelopeSuccess = true
+)
+
+type ConsumerDeleteResponseEnvelopeResultInfo struct {
+ // Total number of results for the requested service
+ Count float64 `json:"count"`
+ // Current page within paginated list of results
+ Page float64 `json:"page"`
+ // Number of results per page of results
+ PerPage float64 `json:"per_page"`
+ // Total results available without any search parameters
+ TotalCount float64 `json:"total_count"`
+ JSON consumerDeleteResponseEnvelopeResultInfoJSON `json:"-"`
+}
+
+// consumerDeleteResponseEnvelopeResultInfoJSON contains the JSON metadata for the
+// struct [ConsumerDeleteResponseEnvelopeResultInfo]
+type consumerDeleteResponseEnvelopeResultInfoJSON struct {
+ Count apijson.Field
+ Page apijson.Field
+ PerPage apijson.Field
+ TotalCount apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ConsumerDeleteResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r consumerDeleteResponseEnvelopeResultInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type ConsumerGetParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type ConsumerGetResponseEnvelope struct {
+ Errors []interface{} `json:"errors,required,nullable"`
+ Messages []interface{} `json:"messages,required,nullable"`
+ Result []WorkersConsumer `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success ConsumerGetResponseEnvelopeSuccess `json:"success,required"`
+ ResultInfo ConsumerGetResponseEnvelopeResultInfo `json:"result_info"`
+ JSON consumerGetResponseEnvelopeJSON `json:"-"`
+}
+
+// consumerGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [ConsumerGetResponseEnvelope]
+type consumerGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ ResultInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ConsumerGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r consumerGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type ConsumerGetResponseEnvelopeSuccess bool
+
+const (
+ ConsumerGetResponseEnvelopeSuccessTrue ConsumerGetResponseEnvelopeSuccess = true
+)
+
+type ConsumerGetResponseEnvelopeResultInfo struct {
+ // Total number of results for the requested service
+ Count float64 `json:"count"`
+ // Current page within paginated list of results
+ Page float64 `json:"page"`
+ // Number of results per page of results
+ PerPage float64 `json:"per_page"`
+ // Total results available without any search parameters
+ TotalCount float64 `json:"total_count"`
+ TotalPages interface{} `json:"total_pages"`
+ JSON consumerGetResponseEnvelopeResultInfoJSON `json:"-"`
+}
+
+// consumerGetResponseEnvelopeResultInfoJSON contains the JSON metadata for the
+// struct [ConsumerGetResponseEnvelopeResultInfo]
+type consumerGetResponseEnvelopeResultInfoJSON struct {
+ Count apijson.Field
+ Page apijson.Field
+ PerPage apijson.Field
+ TotalCount apijson.Field
+ TotalPages apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ConsumerGetResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r consumerGetResponseEnvelopeResultInfoJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/queues/consumer_test.go b/queues/consumer_test.go
new file mode 100644
index 00000000000..ca03c0a7221
--- /dev/null
+++ b/queues/consumer_test.go
@@ -0,0 +1,155 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package queues_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/queues"
+)
+
+func TestConsumerNew(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"),
+ )
+ _, err := client.Queues.Consumers.New(
+ context.TODO(),
+ "example-queue",
+ queues.ConsumerNewParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Body: cloudflare.F[any](map[string]interface{}{
+ "dead_letter_queue": "example-dlq",
+ "environment": "production",
+ "script_name": "example-consumer",
+ "settings": map[string]interface{}{
+ "batch_size": int64(10),
+ "max_retries": int64(3),
+ "max_wait_time_ms": int64(5000),
+ },
+ }),
+ },
+ )
+ 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())
+ }
+}
+
+func TestConsumerUpdate(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"),
+ )
+ _, err := client.Queues.Consumers.Update(
+ context.TODO(),
+ "example-queue",
+ "example-consumer",
+ queues.ConsumerUpdateParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Body: cloudflare.F[any](map[string]interface{}{
+ "dead_letter_queue": "updated-example-dlq",
+ "environment": "production",
+ "script_name": "example-consumer",
+ "settings": map[string]interface{}{
+ "batch_size": int64(100),
+ },
+ }),
+ },
+ )
+ 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())
+ }
+}
+
+func TestConsumerDelete(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"),
+ )
+ _, err := client.Queues.Consumers.Delete(
+ context.TODO(),
+ "example-queue",
+ "example-consumer",
+ queues.ConsumerDeleteParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestConsumerGet(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"),
+ )
+ _, err := client.Queues.Consumers.Get(
+ context.TODO(),
+ "example-queue",
+ queues.ConsumerGetParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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/queue.go b/queues/queue.go
similarity index 85%
rename from queue.go
rename to queues/queue.go
index 91a1e5b4fc6..8d4bca98c23 100644
--- a/queue.go
+++ b/queues/queue.go
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package cloudflare
+package queues
import (
"context"
@@ -22,7 +22,7 @@ import (
// directly, and instead use the [NewQueueService] method instead.
type QueueService struct {
Options []option.RequestOption
- Consumers *QueueConsumerService
+ Consumers *ConsumerService
}
// NewQueueService generates a new service that applies the given options to each
@@ -31,12 +31,12 @@ type QueueService struct {
func NewQueueService(opts ...option.RequestOption) (r *QueueService) {
r = &QueueService{}
r.Options = opts
- r.Consumers = NewQueueConsumerService(opts...)
+ r.Consumers = NewConsumerService(opts...)
return
}
// Creates a new queue.
-func (r *QueueService) New(ctx context.Context, params QueueNewParams, opts ...option.RequestOption) (res *QueueNewResponse, err error) {
+func (r *QueueService) New(ctx context.Context, params QueueNewParams, opts ...option.RequestOption) (res *WorkersQueueCreated, err error) {
opts = append(r.Options[:], opts...)
var env QueueNewResponseEnvelope
path := fmt.Sprintf("accounts/%s/workers/queues", params.AccountID)
@@ -49,7 +49,7 @@ func (r *QueueService) New(ctx context.Context, params QueueNewParams, opts ...o
}
// Updates a queue.
-func (r *QueueService) Update(ctx context.Context, name string, params QueueUpdateParams, opts ...option.RequestOption) (res *QueueUpdateResponse, err error) {
+func (r *QueueService) Update(ctx context.Context, name string, params QueueUpdateParams, opts ...option.RequestOption) (res *WorkersQueueUpdated, err error) {
opts = append(r.Options[:], opts...)
var env QueueUpdateResponseEnvelope
path := fmt.Sprintf("accounts/%s/workers/queues/%s", params.AccountID, name)
@@ -62,7 +62,7 @@ func (r *QueueService) Update(ctx context.Context, name string, params QueueUpda
}
// Returns the queues owned by an account.
-func (r *QueueService) List(ctx context.Context, query QueueListParams, opts ...option.RequestOption) (res *[]QueueListResponse, err error) {
+func (r *QueueService) List(ctx context.Context, query QueueListParams, opts ...option.RequestOption) (res *[]WorkersQueue, err error) {
opts = append(r.Options[:], opts...)
var env QueueListResponseEnvelope
path := fmt.Sprintf("accounts/%s/workers/queues", query.AccountID)
@@ -88,7 +88,7 @@ func (r *QueueService) Delete(ctx context.Context, name string, body QueueDelete
}
// Get information about a specific queue.
-func (r *QueueService) Get(ctx context.Context, name string, query QueueGetParams, opts ...option.RequestOption) (res *QueueGetResponse, err error) {
+func (r *QueueService) Get(ctx context.Context, name string, query QueueGetParams, opts ...option.RequestOption) (res *WorkersQueue, err error) {
opts = append(r.Options[:], opts...)
var env QueueGetResponseEnvelope
path := fmt.Sprintf("accounts/%s/workers/queues/%s", query.AccountID, name)
@@ -100,44 +100,51 @@ func (r *QueueService) Get(ctx context.Context, name string, query QueueGetParam
return
}
-type QueueNewResponse struct {
- CreatedOn interface{} `json:"created_on"`
- ModifiedOn interface{} `json:"modified_on"`
- QueueID interface{} `json:"queue_id"`
- QueueName string `json:"queue_name"`
- JSON queueNewResponseJSON `json:"-"`
+type WorkersQueue struct {
+ Consumers interface{} `json:"consumers"`
+ ConsumersTotalCount interface{} `json:"consumers_total_count"`
+ CreatedOn interface{} `json:"created_on"`
+ ModifiedOn interface{} `json:"modified_on"`
+ Producers interface{} `json:"producers"`
+ ProducersTotalCount interface{} `json:"producers_total_count"`
+ QueueID interface{} `json:"queue_id"`
+ QueueName string `json:"queue_name"`
+ JSON workersQueueJSON `json:"-"`
}
-// queueNewResponseJSON contains the JSON metadata for the struct
-// [QueueNewResponse]
-type queueNewResponseJSON struct {
- CreatedOn apijson.Field
- ModifiedOn apijson.Field
- QueueID apijson.Field
- QueueName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
+// workersQueueJSON contains the JSON metadata for the struct [WorkersQueue]
+type workersQueueJSON struct {
+ Consumers apijson.Field
+ ConsumersTotalCount apijson.Field
+ CreatedOn apijson.Field
+ ModifiedOn apijson.Field
+ Producers apijson.Field
+ ProducersTotalCount apijson.Field
+ QueueID apijson.Field
+ QueueName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
}
-func (r *QueueNewResponse) UnmarshalJSON(data []byte) (err error) {
+func (r *WorkersQueue) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
-func (r queueNewResponseJSON) RawJSON() string {
+func (r workersQueueJSON) RawJSON() string {
return r.raw
}
-type QueueUpdateResponse struct {
+type WorkersQueueCreated struct {
CreatedOn interface{} `json:"created_on"`
ModifiedOn interface{} `json:"modified_on"`
QueueID interface{} `json:"queue_id"`
QueueName string `json:"queue_name"`
- JSON queueUpdateResponseJSON `json:"-"`
+ JSON workersQueueCreatedJSON `json:"-"`
}
-// queueUpdateResponseJSON contains the JSON metadata for the struct
-// [QueueUpdateResponse]
-type queueUpdateResponseJSON struct {
+// workersQueueCreatedJSON contains the JSON metadata for the struct
+// [WorkersQueueCreated]
+type workersQueueCreatedJSON struct {
CreatedOn apijson.Field
ModifiedOn apijson.Field
QueueID apijson.Field
@@ -146,53 +153,45 @@ type queueUpdateResponseJSON struct {
ExtraFields map[string]apijson.Field
}
-func (r *QueueUpdateResponse) UnmarshalJSON(data []byte) (err error) {
+func (r *WorkersQueueCreated) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
-func (r queueUpdateResponseJSON) RawJSON() string {
+func (r workersQueueCreatedJSON) RawJSON() string {
return r.raw
}
-type QueueListResponse struct {
- Consumers interface{} `json:"consumers"`
- ConsumersTotalCount interface{} `json:"consumers_total_count"`
- CreatedOn interface{} `json:"created_on"`
- ModifiedOn interface{} `json:"modified_on"`
- Producers interface{} `json:"producers"`
- ProducersTotalCount interface{} `json:"producers_total_count"`
- QueueID interface{} `json:"queue_id"`
- QueueName string `json:"queue_name"`
- JSON queueListResponseJSON `json:"-"`
+type WorkersQueueUpdated struct {
+ CreatedOn interface{} `json:"created_on"`
+ ModifiedOn interface{} `json:"modified_on"`
+ QueueID interface{} `json:"queue_id"`
+ QueueName string `json:"queue_name"`
+ JSON workersQueueUpdatedJSON `json:"-"`
}
-// queueListResponseJSON contains the JSON metadata for the struct
-// [QueueListResponse]
-type queueListResponseJSON struct {
- Consumers apijson.Field
- ConsumersTotalCount apijson.Field
- CreatedOn apijson.Field
- ModifiedOn apijson.Field
- Producers apijson.Field
- ProducersTotalCount apijson.Field
- QueueID apijson.Field
- QueueName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
+// workersQueueUpdatedJSON contains the JSON metadata for the struct
+// [WorkersQueueUpdated]
+type workersQueueUpdatedJSON struct {
+ CreatedOn apijson.Field
+ ModifiedOn apijson.Field
+ QueueID apijson.Field
+ QueueName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
}
-func (r *QueueListResponse) UnmarshalJSON(data []byte) (err error) {
+func (r *WorkersQueueUpdated) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
-func (r queueListResponseJSON) RawJSON() string {
+func (r workersQueueUpdatedJSON) RawJSON() string {
return r.raw
}
-// Union satisfied by [QueueDeleteResponseUnknown], [QueueDeleteResponseArray] or
-// [shared.UnionString].
+// Union satisfied by [queues.QueueDeleteResponseUnknown],
+// [queues.QueueDeleteResponseArray] or [shared.UnionString].
type QueueDeleteResponse interface {
- ImplementsQueueDeleteResponse()
+ ImplementsQueuesQueueDeleteResponse()
}
func init() {
@@ -212,42 +211,7 @@ func init() {
type QueueDeleteResponseArray []interface{}
-func (r QueueDeleteResponseArray) ImplementsQueueDeleteResponse() {}
-
-type QueueGetResponse struct {
- Consumers interface{} `json:"consumers"`
- ConsumersTotalCount interface{} `json:"consumers_total_count"`
- CreatedOn interface{} `json:"created_on"`
- ModifiedOn interface{} `json:"modified_on"`
- Producers interface{} `json:"producers"`
- ProducersTotalCount interface{} `json:"producers_total_count"`
- QueueID interface{} `json:"queue_id"`
- QueueName string `json:"queue_name"`
- JSON queueGetResponseJSON `json:"-"`
-}
-
-// queueGetResponseJSON contains the JSON metadata for the struct
-// [QueueGetResponse]
-type queueGetResponseJSON struct {
- Consumers apijson.Field
- ConsumersTotalCount apijson.Field
- CreatedOn apijson.Field
- ModifiedOn apijson.Field
- Producers apijson.Field
- ProducersTotalCount apijson.Field
- QueueID apijson.Field
- QueueName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *QueueGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r queueGetResponseJSON) RawJSON() string {
- return r.raw
-}
+func (r QueueDeleteResponseArray) ImplementsQueuesQueueDeleteResponse() {}
type QueueNewParams struct {
// Identifier
@@ -262,7 +226,7 @@ func (r QueueNewParams) MarshalJSON() (data []byte, err error) {
type QueueNewResponseEnvelope struct {
Errors []QueueNewResponseEnvelopeErrors `json:"errors,required"`
Messages []QueueNewResponseEnvelopeMessages `json:"messages,required"`
- Result QueueNewResponse `json:"result,required,nullable"`
+ Result WorkersQueueCreated `json:"result,required,nullable"`
// Whether the API call was successful
Success QueueNewResponseEnvelopeSuccess `json:"success,required"`
ResultInfo QueueNewResponseEnvelopeResultInfo `json:"result_info"`
@@ -386,7 +350,7 @@ func (r QueueUpdateParams) MarshalJSON() (data []byte, err error) {
type QueueUpdateResponseEnvelope struct {
Errors []QueueUpdateResponseEnvelopeErrors `json:"errors,required"`
Messages []QueueUpdateResponseEnvelopeMessages `json:"messages,required"`
- Result QueueUpdateResponse `json:"result,required,nullable"`
+ Result WorkersQueueUpdated `json:"result,required,nullable"`
// Whether the API call was successful
Success QueueUpdateResponseEnvelopeSuccess `json:"success,required"`
ResultInfo QueueUpdateResponseEnvelopeResultInfo `json:"result_info"`
@@ -503,9 +467,9 @@ type QueueListParams struct {
}
type QueueListResponseEnvelope struct {
- Errors []interface{} `json:"errors,required,nullable"`
- Messages []interface{} `json:"messages,required,nullable"`
- Result []QueueListResponse `json:"result,required,nullable"`
+ Errors []interface{} `json:"errors,required,nullable"`
+ Messages []interface{} `json:"messages,required,nullable"`
+ Result []WorkersQueue `json:"result,required,nullable"`
// Whether the API call was successful
Success QueueListResponseEnvelopeSuccess `json:"success,required"`
ResultInfo QueueListResponseEnvelopeResultInfo `json:"result_info"`
@@ -699,7 +663,7 @@ type QueueGetParams struct {
type QueueGetResponseEnvelope struct {
Errors []QueueGetResponseEnvelopeErrors `json:"errors,required"`
Messages []QueueGetResponseEnvelopeMessages `json:"messages,required"`
- Result QueueGetResponse `json:"result,required,nullable"`
+ Result WorkersQueue `json:"result,required,nullable"`
// Whether the API call was successful
Success QueueGetResponseEnvelopeSuccess `json:"success,required"`
ResultInfo QueueGetResponseEnvelopeResultInfo `json:"result_info"`
diff --git a/queue_test.go b/queues/queue_test.go
similarity index 93%
rename from queue_test.go
rename to queues/queue_test.go
index 3f65119f6e7..267b7b8c2fe 100644
--- a/queue_test.go
+++ b/queues/queue_test.go
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package cloudflare_test
+package queues_test
import (
"context"
@@ -11,6 +11,7 @@ import (
"github.com/cloudflare/cloudflare-go"
"github.com/cloudflare/cloudflare-go/internal/testutil"
"github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/queues"
)
func TestQueueNew(t *testing.T) {
@@ -27,7 +28,7 @@ func TestQueueNew(t *testing.T) {
option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"),
option.WithAPIEmail("user@example.com"),
)
- _, err := client.Queues.New(context.TODO(), cloudflare.QueueNewParams{
+ _, err := client.Queues.New(context.TODO(), queues.QueueNewParams{
AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
Body: cloudflare.F[any](map[string]interface{}{
"queue_name": "example-queue",
@@ -59,7 +60,7 @@ func TestQueueUpdate(t *testing.T) {
_, err := client.Queues.Update(
context.TODO(),
"example-queue",
- cloudflare.QueueUpdateParams{
+ queues.QueueUpdateParams{
AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
Body: cloudflare.F[any](map[string]interface{}{
"queue_name": "renamed-example-queue",
@@ -89,7 +90,7 @@ func TestQueueList(t *testing.T) {
option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"),
option.WithAPIEmail("user@example.com"),
)
- _, err := client.Queues.List(context.TODO(), cloudflare.QueueListParams{
+ _, err := client.Queues.List(context.TODO(), queues.QueueListParams{
AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
})
if err != nil {
@@ -118,7 +119,7 @@ func TestQueueDelete(t *testing.T) {
_, err := client.Queues.Delete(
context.TODO(),
"example-queue",
- cloudflare.QueueDeleteParams{
+ queues.QueueDeleteParams{
AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
},
)
@@ -148,7 +149,7 @@ func TestQueueGet(t *testing.T) {
_, err := client.Queues.Get(
context.TODO(),
"example-queue",
- cloudflare.QueueGetParams{
+ queues.QueueGetParams{
AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
},
)
diff --git a/r2/aliases.go b/r2/aliases.go
new file mode 100644
index 00000000000..8f76200b79c
--- /dev/null
+++ b/r2/aliases.go
@@ -0,0 +1,9 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package r2
+
+import (
+ "github.com/cloudflare/cloudflare-go/internal/apierror"
+)
+
+type Error = apierror.Error
diff --git a/r2/bucket.go b/r2/bucket.go
new file mode 100644
index 00000000000..367123a1d74
--- /dev/null
+++ b/r2/bucket.go
@@ -0,0 +1,463 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package r2
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// BucketService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewBucketService] method instead.
+type BucketService struct {
+ Options []option.RequestOption
+}
+
+// NewBucketService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewBucketService(opts ...option.RequestOption) (r *BucketService) {
+ r = &BucketService{}
+ r.Options = opts
+ return
+}
+
+// Creates a new R2 bucket.
+func (r *BucketService) New(ctx context.Context, params BucketNewParams, opts ...option.RequestOption) (res *R2Bucket, err error) {
+ opts = append(r.Options[:], opts...)
+ var env BucketNewResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/r2/buckets", params.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Lists all R2 buckets on your account
+func (r *BucketService) List(ctx context.Context, params BucketListParams, opts ...option.RequestOption) (res *[]R2Bucket, err error) {
+ opts = append(r.Options[:], opts...)
+ var env BucketListResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/r2/buckets", params.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Deletes an existing R2 bucket.
+func (r *BucketService) Delete(ctx context.Context, bucketName string, body BucketDeleteParams, opts ...option.RequestOption) (res *BucketDeleteResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env BucketDeleteResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/r2/buckets/%s", body.AccountID, bucketName)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Gets metadata for an existing R2 bucket.
+func (r *BucketService) Get(ctx context.Context, bucketName string, query BucketGetParams, opts ...option.RequestOption) (res *R2Bucket, err error) {
+ opts = append(r.Options[:], opts...)
+ var env BucketGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/r2/buckets/%s", query.AccountID, bucketName)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// A single R2 bucket
+type R2Bucket struct {
+ // Creation timestamp
+ CreationDate string `json:"creation_date"`
+ // Location of the bucket
+ Location R2BucketLocation `json:"location"`
+ // Name of the bucket
+ Name string `json:"name"`
+ JSON r2BucketJSON `json:"-"`
+}
+
+// r2BucketJSON contains the JSON metadata for the struct [R2Bucket]
+type r2BucketJSON struct {
+ CreationDate apijson.Field
+ Location apijson.Field
+ Name apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *R2Bucket) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r r2BucketJSON) RawJSON() string {
+ return r.raw
+}
+
+// Location of the bucket
+type R2BucketLocation string
+
+const (
+ R2BucketLocationApac R2BucketLocation = "apac"
+ R2BucketLocationEeur R2BucketLocation = "eeur"
+ R2BucketLocationEnam R2BucketLocation = "enam"
+ R2BucketLocationWeur R2BucketLocation = "weur"
+ R2BucketLocationWnam R2BucketLocation = "wnam"
+)
+
+type BucketDeleteResponse = interface{}
+
+type BucketNewParams struct {
+ // Account ID
+ AccountID param.Field[string] `path:"account_id,required"`
+ // Name of the bucket
+ Name param.Field[string] `json:"name,required"`
+ // Location of the bucket
+ LocationHint param.Field[BucketNewParamsLocationHint] `json:"locationHint"`
+}
+
+func (r BucketNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Location of the bucket
+type BucketNewParamsLocationHint string
+
+const (
+ BucketNewParamsLocationHintApac BucketNewParamsLocationHint = "apac"
+ BucketNewParamsLocationHintEeur BucketNewParamsLocationHint = "eeur"
+ BucketNewParamsLocationHintEnam BucketNewParamsLocationHint = "enam"
+ BucketNewParamsLocationHintWeur BucketNewParamsLocationHint = "weur"
+ BucketNewParamsLocationHintWnam BucketNewParamsLocationHint = "wnam"
+)
+
+type BucketNewResponseEnvelope struct {
+ Errors []BucketNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []string `json:"messages,required"`
+ // A single R2 bucket
+ Result R2Bucket `json:"result,required"`
+ // Whether the API call was successful
+ Success BucketNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON bucketNewResponseEnvelopeJSON `json:"-"`
+}
+
+// bucketNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [BucketNewResponseEnvelope]
+type bucketNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *BucketNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r bucketNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type BucketNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON bucketNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// bucketNewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [BucketNewResponseEnvelopeErrors]
+type bucketNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *BucketNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r bucketNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type BucketNewResponseEnvelopeSuccess bool
+
+const (
+ BucketNewResponseEnvelopeSuccessTrue BucketNewResponseEnvelopeSuccess = true
+)
+
+type BucketListParams struct {
+ // Account ID
+ AccountID param.Field[string] `path:"account_id,required"`
+ // Pagination cursor received during the last List Buckets call. R2 buckets are
+ // paginated using cursors instead of page numbers.
+ Cursor param.Field[string] `query:"cursor"`
+ // Direction to order buckets
+ Direction param.Field[BucketListParamsDirection] `query:"direction"`
+ // Bucket names to filter by. Only buckets with this phrase in their name will be
+ // returned.
+ NameContains param.Field[string] `query:"name_contains"`
+ // Field to order buckets by
+ Order param.Field[BucketListParamsOrder] `query:"order"`
+ // Maximum number of buckets to return in a single call
+ PerPage param.Field[float64] `query:"per_page"`
+ // Bucket name to start searching after. Buckets are ordered lexicographically.
+ StartAfter param.Field[string] `query:"start_after"`
+}
+
+// URLQuery serializes [BucketListParams]'s query parameters as `url.Values`.
+func (r BucketListParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Direction to order buckets
+type BucketListParamsDirection string
+
+const (
+ BucketListParamsDirectionAsc BucketListParamsDirection = "asc"
+ BucketListParamsDirectionDesc BucketListParamsDirection = "desc"
+)
+
+// Field to order buckets by
+type BucketListParamsOrder string
+
+const (
+ BucketListParamsOrderName BucketListParamsOrder = "name"
+)
+
+type BucketListResponseEnvelope struct {
+ Errors []BucketListResponseEnvelopeErrors `json:"errors,required"`
+ Messages []string `json:"messages,required"`
+ Result []R2Bucket `json:"result,required"`
+ // Whether the API call was successful
+ Success BucketListResponseEnvelopeSuccess `json:"success,required"`
+ ResultInfo BucketListResponseEnvelopeResultInfo `json:"result_info"`
+ JSON bucketListResponseEnvelopeJSON `json:"-"`
+}
+
+// bucketListResponseEnvelopeJSON contains the JSON metadata for the struct
+// [BucketListResponseEnvelope]
+type bucketListResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ ResultInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *BucketListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r bucketListResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type BucketListResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON bucketListResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// bucketListResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [BucketListResponseEnvelopeErrors]
+type bucketListResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *BucketListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r bucketListResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type BucketListResponseEnvelopeSuccess bool
+
+const (
+ BucketListResponseEnvelopeSuccessTrue BucketListResponseEnvelopeSuccess = true
+)
+
+type BucketListResponseEnvelopeResultInfo struct {
+ // A continuation token that should be used to fetch the next page of results
+ Cursor string `json:"cursor"`
+ // Maximum number of results on this page
+ PerPage float64 `json:"per_page"`
+ JSON bucketListResponseEnvelopeResultInfoJSON `json:"-"`
+}
+
+// bucketListResponseEnvelopeResultInfoJSON contains the JSON metadata for the
+// struct [BucketListResponseEnvelopeResultInfo]
+type bucketListResponseEnvelopeResultInfoJSON struct {
+ Cursor apijson.Field
+ PerPage apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *BucketListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r bucketListResponseEnvelopeResultInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type BucketDeleteParams struct {
+ // Account ID
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type BucketDeleteResponseEnvelope struct {
+ Errors []BucketDeleteResponseEnvelopeErrors `json:"errors,required"`
+ Messages []string `json:"messages,required"`
+ Result BucketDeleteResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success BucketDeleteResponseEnvelopeSuccess `json:"success,required"`
+ JSON bucketDeleteResponseEnvelopeJSON `json:"-"`
+}
+
+// bucketDeleteResponseEnvelopeJSON contains the JSON metadata for the struct
+// [BucketDeleteResponseEnvelope]
+type bucketDeleteResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *BucketDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r bucketDeleteResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type BucketDeleteResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON bucketDeleteResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// bucketDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [BucketDeleteResponseEnvelopeErrors]
+type bucketDeleteResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *BucketDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r bucketDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type BucketDeleteResponseEnvelopeSuccess bool
+
+const (
+ BucketDeleteResponseEnvelopeSuccessTrue BucketDeleteResponseEnvelopeSuccess = true
+)
+
+type BucketGetParams struct {
+ // Account ID
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type BucketGetResponseEnvelope struct {
+ Errors []BucketGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []string `json:"messages,required"`
+ // A single R2 bucket
+ Result R2Bucket `json:"result,required"`
+ // Whether the API call was successful
+ Success BucketGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON bucketGetResponseEnvelopeJSON `json:"-"`
+}
+
+// bucketGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [BucketGetResponseEnvelope]
+type bucketGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *BucketGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r bucketGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type BucketGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON bucketGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// bucketGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [BucketGetResponseEnvelopeErrors]
+type bucketGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *BucketGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r bucketGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type BucketGetResponseEnvelopeSuccess bool
+
+const (
+ BucketGetResponseEnvelopeSuccessTrue BucketGetResponseEnvelopeSuccess = true
+)
diff --git a/r2/bucket_test.go b/r2/bucket_test.go
new file mode 100644
index 00000000000..c063981cbf5
--- /dev/null
+++ b/r2/bucket_test.go
@@ -0,0 +1,135 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package r2_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/r2"
+)
+
+func TestBucketNewWithOptionalParams(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"),
+ )
+ _, err := client.R2.Buckets.New(context.TODO(), r2.BucketNewParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Name: cloudflare.F("example-bucket"),
+ LocationHint: cloudflare.F(r2.BucketNewParamsLocationHintApac),
+ })
+ 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())
+ }
+}
+
+func TestBucketListWithOptionalParams(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"),
+ )
+ _, err := client.R2.Buckets.List(context.TODO(), r2.BucketListParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Cursor: cloudflare.F("string"),
+ Direction: cloudflare.F(r2.BucketListParamsDirectionDesc),
+ NameContains: cloudflare.F("my-bucket"),
+ Order: cloudflare.F(r2.BucketListParamsOrderName),
+ PerPage: cloudflare.F(1.000000),
+ StartAfter: cloudflare.F("my-bucket"),
+ })
+ 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())
+ }
+}
+
+func TestBucketDelete(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"),
+ )
+ _, err := client.R2.Buckets.Delete(
+ context.TODO(),
+ "example-bucket",
+ r2.BucketDeleteParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestBucketGet(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"),
+ )
+ _, err := client.R2.Buckets.Get(
+ context.TODO(),
+ "example-bucket",
+ r2.BucketGetParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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/r2.go b/r2/r2.go
similarity index 84%
rename from r2.go
rename to r2/r2.go
index d446ca6e8de..133fec14f7c 100644
--- a/r2.go
+++ b/r2/r2.go
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package cloudflare
+package r2
import (
"github.com/cloudflare/cloudflare-go/option"
@@ -12,8 +12,8 @@ import (
// directly, and instead use the [NewR2Service] method instead.
type R2Service struct {
Options []option.RequestOption
- Buckets *R2BucketService
- Sippy *R2SippyService
+ Buckets *BucketService
+ Sippy *SippyService
}
// NewR2Service generates a new service that applies the given options to each
@@ -22,7 +22,7 @@ type R2Service struct {
func NewR2Service(opts ...option.RequestOption) (r *R2Service) {
r = &R2Service{}
r.Options = opts
- r.Buckets = NewR2BucketService(opts...)
- r.Sippy = NewR2SippyService(opts...)
+ r.Buckets = NewBucketService(opts...)
+ r.Sippy = NewSippyService(opts...)
return
}
diff --git a/r2/sippy.go b/r2/sippy.go
new file mode 100644
index 00000000000..9f1a0577133
--- /dev/null
+++ b/r2/sippy.go
@@ -0,0 +1,443 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package r2
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// SippyService contains methods and other services that help with interacting with
+// the cloudflare API. Note, unlike clients, this service does not read variables
+// from the environment automatically. You should not instantiate this service
+// directly, and instead use the [NewSippyService] method instead.
+type SippyService struct {
+ Options []option.RequestOption
+}
+
+// NewSippyService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewSippyService(opts ...option.RequestOption) (r *SippyService) {
+ r = &SippyService{}
+ r.Options = opts
+ return
+}
+
+// Sets configuration for Sippy for an existing R2 bucket.
+func (r *SippyService) Update(ctx context.Context, bucketName string, params SippyUpdateParams, opts ...option.RequestOption) (res *R2Sippy, err error) {
+ opts = append(r.Options[:], opts...)
+ var env SippyUpdateResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/r2/buckets/%s/sippy", params.AccountID, bucketName)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Disables Sippy on this bucket
+func (r *SippyService) Delete(ctx context.Context, bucketName string, body SippyDeleteParams, opts ...option.RequestOption) (res *SippyDeleteResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env SippyDeleteResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/r2/buckets/%s/sippy", body.AccountID, bucketName)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Gets configuration for Sippy for an existing R2 bucket.
+func (r *SippyService) Get(ctx context.Context, bucketName string, query SippyGetParams, opts ...option.RequestOption) (res *R2Sippy, err error) {
+ opts = append(r.Options[:], opts...)
+ var env SippyGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/r2/buckets/%s/sippy", query.AccountID, bucketName)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type R2Sippy struct {
+ // Details about the configured destination bucket
+ Destination R2SippyDestination `json:"destination"`
+ // State of Sippy for this bucket
+ Enabled bool `json:"enabled"`
+ // Details about the configured source bucket
+ Source R2SippySource `json:"source"`
+ JSON r2SippyJSON `json:"-"`
+}
+
+// r2SippyJSON contains the JSON metadata for the struct [R2Sippy]
+type r2SippyJSON struct {
+ Destination apijson.Field
+ Enabled apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *R2Sippy) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r r2SippyJSON) RawJSON() string {
+ return r.raw
+}
+
+// Details about the configured destination bucket
+type R2SippyDestination struct {
+ // ID of the Cloudflare API token used when writing objects to this bucket
+ AccessKeyID string `json:"accessKeyId"`
+ Account string `json:"account"`
+ // Name of the bucket on the provider
+ Bucket string `json:"bucket"`
+ Provider R2SippyDestinationProvider `json:"provider"`
+ JSON r2SippyDestinationJSON `json:"-"`
+}
+
+// r2SippyDestinationJSON contains the JSON metadata for the struct
+// [R2SippyDestination]
+type r2SippyDestinationJSON struct {
+ AccessKeyID apijson.Field
+ Account apijson.Field
+ Bucket apijson.Field
+ Provider apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *R2SippyDestination) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r r2SippyDestinationJSON) RawJSON() string {
+ return r.raw
+}
+
+type R2SippyDestinationProvider string
+
+const (
+ R2SippyDestinationProviderR2 R2SippyDestinationProvider = "r2"
+)
+
+// Details about the configured source bucket
+type R2SippySource struct {
+ // Name of the bucket on the provider
+ Bucket string `json:"bucket"`
+ Provider R2SippySourceProvider `json:"provider"`
+ // Region where the bucket resides (AWS only)
+ Region string `json:"region,nullable"`
+ JSON r2SippySourceJSON `json:"-"`
+}
+
+// r2SippySourceJSON contains the JSON metadata for the struct [R2SippySource]
+type r2SippySourceJSON struct {
+ Bucket apijson.Field
+ Provider apijson.Field
+ Region apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *R2SippySource) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r r2SippySourceJSON) RawJSON() string {
+ return r.raw
+}
+
+type R2SippySourceProvider string
+
+const (
+ R2SippySourceProviderAws R2SippySourceProvider = "aws"
+ R2SippySourceProviderGcs R2SippySourceProvider = "gcs"
+)
+
+type SippyDeleteResponse struct {
+ Enabled SippyDeleteResponseEnabled `json:"enabled"`
+ JSON sippyDeleteResponseJSON `json:"-"`
+}
+
+// sippyDeleteResponseJSON contains the JSON metadata for the struct
+// [SippyDeleteResponse]
+type sippyDeleteResponseJSON struct {
+ Enabled apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *SippyDeleteResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r sippyDeleteResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type SippyDeleteResponseEnabled bool
+
+const (
+ SippyDeleteResponseEnabledFalse SippyDeleteResponseEnabled = false
+)
+
+type SippyUpdateParams struct {
+ // Account ID
+ AccountID param.Field[string] `path:"account_id,required"`
+ Destination param.Field[SippyUpdateParamsDestination] `json:"destination"`
+ Source param.Field[SippyUpdateParamsSource] `json:"source"`
+}
+
+func (r SippyUpdateParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type SippyUpdateParamsDestination struct {
+ // ID of a Cloudflare API token. This is the value labelled "Access Key ID" when
+ // creating an API token from the
+ // [R2 dashboard](https://dash.cloudflare.com/?to=/:account/r2/api-tokens).
+ //
+ // Sippy will use this token when writing objects to R2, so it is best to scope
+ // this token to the bucket you're enabling Sippy for.
+ AccessKeyID param.Field[string] `json:"accessKeyId"`
+ Provider param.Field[SippyUpdateParamsDestinationProvider] `json:"provider"`
+ // Value of a Cloudflare API token. This is the value labelled "Secret Access Key"
+ // when creating an API token from the
+ // [R2 dashboard](https://dash.cloudflare.com/?to=/:account/r2/api-tokens).
+ //
+ // Sippy will use this token when writing objects to R2, so it is best to scope
+ // this token to the bucket you're enabling Sippy for.
+ SecretAccessKey param.Field[string] `json:"secretAccessKey"`
+}
+
+func (r SippyUpdateParamsDestination) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type SippyUpdateParamsDestinationProvider string
+
+const (
+ SippyUpdateParamsDestinationProviderR2 SippyUpdateParamsDestinationProvider = "r2"
+)
+
+type SippyUpdateParamsSource struct {
+ // Access Key ID of an IAM credential (ideally scoped to a single S3 bucket)
+ AccessKeyID param.Field[string] `json:"accessKeyId"`
+ // Name of the GCS bucket
+ Bucket param.Field[string] `json:"bucket"`
+ // Client email of an IAM credential (ideally scoped to a single GCS bucket)
+ ClientEmail param.Field[string] `json:"clientEmail"`
+ // Private Key of an IAM credential (ideally scoped to a single GCS bucket)
+ PrivateKey param.Field[string] `json:"privateKey"`
+ Provider param.Field[SippyUpdateParamsSourceProvider] `json:"provider"`
+ // Name of the AWS availability zone
+ Region param.Field[string] `json:"region"`
+ // Secret Access Key of an IAM credential (ideally scoped to a single S3 bucket)
+ SecretAccessKey param.Field[string] `json:"secretAccessKey"`
+}
+
+func (r SippyUpdateParamsSource) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type SippyUpdateParamsSourceProvider string
+
+const (
+ SippyUpdateParamsSourceProviderGcs SippyUpdateParamsSourceProvider = "gcs"
+)
+
+type SippyUpdateResponseEnvelope struct {
+ Errors []SippyUpdateResponseEnvelopeErrors `json:"errors,required"`
+ Messages []string `json:"messages,required"`
+ Result R2Sippy `json:"result,required"`
+ // Whether the API call was successful
+ Success SippyUpdateResponseEnvelopeSuccess `json:"success,required"`
+ JSON sippyUpdateResponseEnvelopeJSON `json:"-"`
+}
+
+// sippyUpdateResponseEnvelopeJSON contains the JSON metadata for the struct
+// [SippyUpdateResponseEnvelope]
+type sippyUpdateResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *SippyUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r sippyUpdateResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type SippyUpdateResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON sippyUpdateResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// sippyUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [SippyUpdateResponseEnvelopeErrors]
+type sippyUpdateResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *SippyUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r sippyUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type SippyUpdateResponseEnvelopeSuccess bool
+
+const (
+ SippyUpdateResponseEnvelopeSuccessTrue SippyUpdateResponseEnvelopeSuccess = true
+)
+
+type SippyDeleteParams struct {
+ // Account ID
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type SippyDeleteResponseEnvelope struct {
+ Errors []SippyDeleteResponseEnvelopeErrors `json:"errors,required"`
+ Messages []string `json:"messages,required"`
+ Result SippyDeleteResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success SippyDeleteResponseEnvelopeSuccess `json:"success,required"`
+ JSON sippyDeleteResponseEnvelopeJSON `json:"-"`
+}
+
+// sippyDeleteResponseEnvelopeJSON contains the JSON metadata for the struct
+// [SippyDeleteResponseEnvelope]
+type sippyDeleteResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *SippyDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r sippyDeleteResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type SippyDeleteResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON sippyDeleteResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// sippyDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [SippyDeleteResponseEnvelopeErrors]
+type sippyDeleteResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *SippyDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r sippyDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type SippyDeleteResponseEnvelopeSuccess bool
+
+const (
+ SippyDeleteResponseEnvelopeSuccessTrue SippyDeleteResponseEnvelopeSuccess = true
+)
+
+type SippyGetParams struct {
+ // Account ID
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type SippyGetResponseEnvelope struct {
+ Errors []SippyGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []string `json:"messages,required"`
+ Result R2Sippy `json:"result,required"`
+ // Whether the API call was successful
+ Success SippyGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON sippyGetResponseEnvelopeJSON `json:"-"`
+}
+
+// sippyGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [SippyGetResponseEnvelope]
+type sippyGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *SippyGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r sippyGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type SippyGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON sippyGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// sippyGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [SippyGetResponseEnvelopeErrors]
+type sippyGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *SippyGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r sippyGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type SippyGetResponseEnvelopeSuccess bool
+
+const (
+ SippyGetResponseEnvelopeSuccessTrue SippyGetResponseEnvelopeSuccess = true
+)
diff --git a/r2/sippy_test.go b/r2/sippy_test.go
new file mode 100644
index 00000000000..2e97b26aa56
--- /dev/null
+++ b/r2/sippy_test.go
@@ -0,0 +1,119 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package r2_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/r2"
+)
+
+func TestSippyUpdateWithOptionalParams(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"),
+ )
+ _, err := client.R2.Sippy.Update(
+ context.TODO(),
+ "example-bucket",
+ r2.SippyUpdateParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Destination: cloudflare.F(r2.SippyUpdateParamsDestination{
+ AccessKeyID: cloudflare.F("string"),
+ Provider: cloudflare.F(r2.SippyUpdateParamsDestinationProviderR2),
+ SecretAccessKey: cloudflare.F("string"),
+ }),
+ Source: cloudflare.F(r2.SippyUpdateParamsSource{
+ AccessKeyID: cloudflare.F("string"),
+ Bucket: cloudflare.F("string"),
+ Provider: cloudflare.F(r2.SippyUpdateParamsSourceProviderGcs),
+ Region: cloudflare.F("string"),
+ SecretAccessKey: cloudflare.F("string"),
+ ClientEmail: cloudflare.F("string"),
+ PrivateKey: cloudflare.F("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())
+ }
+}
+
+func TestSippyDelete(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"),
+ )
+ _, err := client.R2.Sippy.Delete(
+ context.TODO(),
+ "example-bucket",
+ r2.SippyDeleteParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestSippyGet(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"),
+ )
+ _, err := client.R2.Sippy.Get(
+ context.TODO(),
+ "example-bucket",
+ r2.SippyGetParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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/r2bucket.go b/r2bucket.go
deleted file mode 100644
index a383ad68281..00000000000
--- a/r2bucket.go
+++ /dev/null
@@ -1,544 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// R2BucketService contains methods and other services that help with interacting
-// with the cloudflare API. Note, unlike clients, this service does not read
-// variables from the environment automatically. You should not instantiate this
-// service directly, and instead use the [NewR2BucketService] method instead.
-type R2BucketService struct {
- Options []option.RequestOption
-}
-
-// NewR2BucketService generates a new service that applies the given options to
-// each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewR2BucketService(opts ...option.RequestOption) (r *R2BucketService) {
- r = &R2BucketService{}
- r.Options = opts
- return
-}
-
-// Creates a new R2 bucket.
-func (r *R2BucketService) New(ctx context.Context, params R2BucketNewParams, opts ...option.RequestOption) (res *R2BucketNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env R2BucketNewResponseEnvelope
- path := fmt.Sprintf("accounts/%s/r2/buckets", params.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Lists all R2 buckets on your account
-func (r *R2BucketService) List(ctx context.Context, params R2BucketListParams, opts ...option.RequestOption) (res *[]R2BucketListResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env R2BucketListResponseEnvelope
- path := fmt.Sprintf("accounts/%s/r2/buckets", params.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Deletes an existing R2 bucket.
-func (r *R2BucketService) Delete(ctx context.Context, bucketName string, body R2BucketDeleteParams, opts ...option.RequestOption) (res *R2BucketDeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env R2BucketDeleteResponseEnvelope
- path := fmt.Sprintf("accounts/%s/r2/buckets/%s", body.AccountID, bucketName)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Gets metadata for an existing R2 bucket.
-func (r *R2BucketService) Get(ctx context.Context, bucketName string, query R2BucketGetParams, opts ...option.RequestOption) (res *R2BucketGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env R2BucketGetResponseEnvelope
- path := fmt.Sprintf("accounts/%s/r2/buckets/%s", query.AccountID, bucketName)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// A single R2 bucket
-type R2BucketNewResponse struct {
- // Creation timestamp
- CreationDate string `json:"creation_date"`
- // Location of the bucket
- Location R2BucketNewResponseLocation `json:"location"`
- // Name of the bucket
- Name string `json:"name"`
- JSON r2BucketNewResponseJSON `json:"-"`
-}
-
-// r2BucketNewResponseJSON contains the JSON metadata for the struct
-// [R2BucketNewResponse]
-type r2BucketNewResponseJSON struct {
- CreationDate apijson.Field
- Location apijson.Field
- Name apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *R2BucketNewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r r2BucketNewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// Location of the bucket
-type R2BucketNewResponseLocation string
-
-const (
- R2BucketNewResponseLocationApac R2BucketNewResponseLocation = "apac"
- R2BucketNewResponseLocationEeur R2BucketNewResponseLocation = "eeur"
- R2BucketNewResponseLocationEnam R2BucketNewResponseLocation = "enam"
- R2BucketNewResponseLocationWeur R2BucketNewResponseLocation = "weur"
- R2BucketNewResponseLocationWnam R2BucketNewResponseLocation = "wnam"
-)
-
-// A single R2 bucket
-type R2BucketListResponse struct {
- // Creation timestamp
- CreationDate string `json:"creation_date"`
- // Location of the bucket
- Location R2BucketListResponseLocation `json:"location"`
- // Name of the bucket
- Name string `json:"name"`
- JSON r2BucketListResponseJSON `json:"-"`
-}
-
-// r2BucketListResponseJSON contains the JSON metadata for the struct
-// [R2BucketListResponse]
-type r2BucketListResponseJSON struct {
- CreationDate apijson.Field
- Location apijson.Field
- Name apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *R2BucketListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r r2BucketListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// Location of the bucket
-type R2BucketListResponseLocation string
-
-const (
- R2BucketListResponseLocationApac R2BucketListResponseLocation = "apac"
- R2BucketListResponseLocationEeur R2BucketListResponseLocation = "eeur"
- R2BucketListResponseLocationEnam R2BucketListResponseLocation = "enam"
- R2BucketListResponseLocationWeur R2BucketListResponseLocation = "weur"
- R2BucketListResponseLocationWnam R2BucketListResponseLocation = "wnam"
-)
-
-type R2BucketDeleteResponse = interface{}
-
-// A single R2 bucket
-type R2BucketGetResponse struct {
- // Creation timestamp
- CreationDate string `json:"creation_date"`
- // Location of the bucket
- Location R2BucketGetResponseLocation `json:"location"`
- // Name of the bucket
- Name string `json:"name"`
- JSON r2BucketGetResponseJSON `json:"-"`
-}
-
-// r2BucketGetResponseJSON contains the JSON metadata for the struct
-// [R2BucketGetResponse]
-type r2BucketGetResponseJSON struct {
- CreationDate apijson.Field
- Location apijson.Field
- Name apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *R2BucketGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r r2BucketGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// Location of the bucket
-type R2BucketGetResponseLocation string
-
-const (
- R2BucketGetResponseLocationApac R2BucketGetResponseLocation = "apac"
- R2BucketGetResponseLocationEeur R2BucketGetResponseLocation = "eeur"
- R2BucketGetResponseLocationEnam R2BucketGetResponseLocation = "enam"
- R2BucketGetResponseLocationWeur R2BucketGetResponseLocation = "weur"
- R2BucketGetResponseLocationWnam R2BucketGetResponseLocation = "wnam"
-)
-
-type R2BucketNewParams struct {
- // Account ID
- AccountID param.Field[string] `path:"account_id,required"`
- // Name of the bucket
- Name param.Field[string] `json:"name,required"`
- // Location of the bucket
- LocationHint param.Field[R2BucketNewParamsLocationHint] `json:"locationHint"`
-}
-
-func (r R2BucketNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Location of the bucket
-type R2BucketNewParamsLocationHint string
-
-const (
- R2BucketNewParamsLocationHintApac R2BucketNewParamsLocationHint = "apac"
- R2BucketNewParamsLocationHintEeur R2BucketNewParamsLocationHint = "eeur"
- R2BucketNewParamsLocationHintEnam R2BucketNewParamsLocationHint = "enam"
- R2BucketNewParamsLocationHintWeur R2BucketNewParamsLocationHint = "weur"
- R2BucketNewParamsLocationHintWnam R2BucketNewParamsLocationHint = "wnam"
-)
-
-type R2BucketNewResponseEnvelope struct {
- Errors []R2BucketNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []string `json:"messages,required"`
- // A single R2 bucket
- Result R2BucketNewResponse `json:"result,required"`
- // Whether the API call was successful
- Success R2BucketNewResponseEnvelopeSuccess `json:"success,required"`
- JSON r2BucketNewResponseEnvelopeJSON `json:"-"`
-}
-
-// r2BucketNewResponseEnvelopeJSON contains the JSON metadata for the struct
-// [R2BucketNewResponseEnvelope]
-type r2BucketNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *R2BucketNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r r2BucketNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type R2BucketNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON r2BucketNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// r2BucketNewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
-// [R2BucketNewResponseEnvelopeErrors]
-type r2BucketNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *R2BucketNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r r2BucketNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type R2BucketNewResponseEnvelopeSuccess bool
-
-const (
- R2BucketNewResponseEnvelopeSuccessTrue R2BucketNewResponseEnvelopeSuccess = true
-)
-
-type R2BucketListParams struct {
- // Account ID
- AccountID param.Field[string] `path:"account_id,required"`
- // Pagination cursor received during the last List Buckets call. R2 buckets are
- // paginated using cursors instead of page numbers.
- Cursor param.Field[string] `query:"cursor"`
- // Direction to order buckets
- Direction param.Field[R2BucketListParamsDirection] `query:"direction"`
- // Bucket names to filter by. Only buckets with this phrase in their name will be
- // returned.
- NameContains param.Field[string] `query:"name_contains"`
- // Field to order buckets by
- Order param.Field[R2BucketListParamsOrder] `query:"order"`
- // Maximum number of buckets to return in a single call
- PerPage param.Field[float64] `query:"per_page"`
- // Bucket name to start searching after. Buckets are ordered lexicographically.
- StartAfter param.Field[string] `query:"start_after"`
-}
-
-// URLQuery serializes [R2BucketListParams]'s query parameters as `url.Values`.
-func (r R2BucketListParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Direction to order buckets
-type R2BucketListParamsDirection string
-
-const (
- R2BucketListParamsDirectionAsc R2BucketListParamsDirection = "asc"
- R2BucketListParamsDirectionDesc R2BucketListParamsDirection = "desc"
-)
-
-// Field to order buckets by
-type R2BucketListParamsOrder string
-
-const (
- R2BucketListParamsOrderName R2BucketListParamsOrder = "name"
-)
-
-type R2BucketListResponseEnvelope struct {
- Errors []R2BucketListResponseEnvelopeErrors `json:"errors,required"`
- Messages []string `json:"messages,required"`
- Result []R2BucketListResponse `json:"result,required"`
- // Whether the API call was successful
- Success R2BucketListResponseEnvelopeSuccess `json:"success,required"`
- ResultInfo R2BucketListResponseEnvelopeResultInfo `json:"result_info"`
- JSON r2BucketListResponseEnvelopeJSON `json:"-"`
-}
-
-// r2BucketListResponseEnvelopeJSON contains the JSON metadata for the struct
-// [R2BucketListResponseEnvelope]
-type r2BucketListResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- ResultInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *R2BucketListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r r2BucketListResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type R2BucketListResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON r2BucketListResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// r2BucketListResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
-// [R2BucketListResponseEnvelopeErrors]
-type r2BucketListResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *R2BucketListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r r2BucketListResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type R2BucketListResponseEnvelopeSuccess bool
-
-const (
- R2BucketListResponseEnvelopeSuccessTrue R2BucketListResponseEnvelopeSuccess = true
-)
-
-type R2BucketListResponseEnvelopeResultInfo struct {
- // A continuation token that should be used to fetch the next page of results
- Cursor string `json:"cursor"`
- // Maximum number of results on this page
- PerPage float64 `json:"per_page"`
- JSON r2BucketListResponseEnvelopeResultInfoJSON `json:"-"`
-}
-
-// r2BucketListResponseEnvelopeResultInfoJSON contains the JSON metadata for the
-// struct [R2BucketListResponseEnvelopeResultInfo]
-type r2BucketListResponseEnvelopeResultInfoJSON struct {
- Cursor apijson.Field
- PerPage apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *R2BucketListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r r2BucketListResponseEnvelopeResultInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type R2BucketDeleteParams struct {
- // Account ID
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type R2BucketDeleteResponseEnvelope struct {
- Errors []R2BucketDeleteResponseEnvelopeErrors `json:"errors,required"`
- Messages []string `json:"messages,required"`
- Result R2BucketDeleteResponse `json:"result,required"`
- // Whether the API call was successful
- Success R2BucketDeleteResponseEnvelopeSuccess `json:"success,required"`
- JSON r2BucketDeleteResponseEnvelopeJSON `json:"-"`
-}
-
-// r2BucketDeleteResponseEnvelopeJSON contains the JSON metadata for the struct
-// [R2BucketDeleteResponseEnvelope]
-type r2BucketDeleteResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *R2BucketDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r r2BucketDeleteResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type R2BucketDeleteResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON r2BucketDeleteResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// r2BucketDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [R2BucketDeleteResponseEnvelopeErrors]
-type r2BucketDeleteResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *R2BucketDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r r2BucketDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type R2BucketDeleteResponseEnvelopeSuccess bool
-
-const (
- R2BucketDeleteResponseEnvelopeSuccessTrue R2BucketDeleteResponseEnvelopeSuccess = true
-)
-
-type R2BucketGetParams struct {
- // Account ID
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type R2BucketGetResponseEnvelope struct {
- Errors []R2BucketGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []string `json:"messages,required"`
- // A single R2 bucket
- Result R2BucketGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success R2BucketGetResponseEnvelopeSuccess `json:"success,required"`
- JSON r2BucketGetResponseEnvelopeJSON `json:"-"`
-}
-
-// r2BucketGetResponseEnvelopeJSON contains the JSON metadata for the struct
-// [R2BucketGetResponseEnvelope]
-type r2BucketGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *R2BucketGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r r2BucketGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type R2BucketGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON r2BucketGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// r2BucketGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
-// [R2BucketGetResponseEnvelopeErrors]
-type r2BucketGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *R2BucketGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r r2BucketGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type R2BucketGetResponseEnvelopeSuccess bool
-
-const (
- R2BucketGetResponseEnvelopeSuccessTrue R2BucketGetResponseEnvelopeSuccess = true
-)
diff --git a/r2bucket_test.go b/r2bucket_test.go
deleted file mode 100644
index b83fb3391f7..00000000000
--- a/r2bucket_test.go
+++ /dev/null
@@ -1,134 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestR2BucketNewWithOptionalParams(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"),
- )
- _, err := client.R2.Buckets.New(context.TODO(), cloudflare.R2BucketNewParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Name: cloudflare.F("example-bucket"),
- LocationHint: cloudflare.F(cloudflare.R2BucketNewParamsLocationHintApac),
- })
- 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())
- }
-}
-
-func TestR2BucketListWithOptionalParams(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"),
- )
- _, err := client.R2.Buckets.List(context.TODO(), cloudflare.R2BucketListParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Cursor: cloudflare.F("string"),
- Direction: cloudflare.F(cloudflare.R2BucketListParamsDirectionDesc),
- NameContains: cloudflare.F("my-bucket"),
- Order: cloudflare.F(cloudflare.R2BucketListParamsOrderName),
- PerPage: cloudflare.F(1.000000),
- StartAfter: cloudflare.F("my-bucket"),
- })
- 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())
- }
-}
-
-func TestR2BucketDelete(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"),
- )
- _, err := client.R2.Buckets.Delete(
- context.TODO(),
- "example-bucket",
- cloudflare.R2BucketDeleteParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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())
- }
-}
-
-func TestR2BucketGet(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"),
- )
- _, err := client.R2.Buckets.Get(
- context.TODO(),
- "example-bucket",
- cloudflare.R2BucketGetParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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/r2sippy.go b/r2sippy.go
deleted file mode 100644
index d161ff97488..00000000000
--- a/r2sippy.go
+++ /dev/null
@@ -1,544 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// R2SippyService contains methods and other services that help with interacting
-// with the cloudflare API. Note, unlike clients, this service does not read
-// variables from the environment automatically. You should not instantiate this
-// service directly, and instead use the [NewR2SippyService] method instead.
-type R2SippyService struct {
- Options []option.RequestOption
-}
-
-// NewR2SippyService generates a new service that applies the given options to each
-// request. These options are applied after the parent client's options (if there
-// is one), and before any request-specific options.
-func NewR2SippyService(opts ...option.RequestOption) (r *R2SippyService) {
- r = &R2SippyService{}
- r.Options = opts
- return
-}
-
-// Sets configuration for Sippy for an existing R2 bucket.
-func (r *R2SippyService) Update(ctx context.Context, bucketName string, params R2SippyUpdateParams, opts ...option.RequestOption) (res *R2SippyUpdateResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env R2SippyUpdateResponseEnvelope
- path := fmt.Sprintf("accounts/%s/r2/buckets/%s/sippy", params.AccountID, bucketName)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Disables Sippy on this bucket
-func (r *R2SippyService) Delete(ctx context.Context, bucketName string, body R2SippyDeleteParams, opts ...option.RequestOption) (res *R2SippyDeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env R2SippyDeleteResponseEnvelope
- path := fmt.Sprintf("accounts/%s/r2/buckets/%s/sippy", body.AccountID, bucketName)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Gets configuration for Sippy for an existing R2 bucket.
-func (r *R2SippyService) Get(ctx context.Context, bucketName string, query R2SippyGetParams, opts ...option.RequestOption) (res *R2SippyGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env R2SippyGetResponseEnvelope
- path := fmt.Sprintf("accounts/%s/r2/buckets/%s/sippy", query.AccountID, bucketName)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type R2SippyUpdateResponse struct {
- // Details about the configured destination bucket
- Destination R2SippyUpdateResponseDestination `json:"destination"`
- // State of Sippy for this bucket
- Enabled bool `json:"enabled"`
- // Details about the configured source bucket
- Source R2SippyUpdateResponseSource `json:"source"`
- JSON r2SippyUpdateResponseJSON `json:"-"`
-}
-
-// r2SippyUpdateResponseJSON contains the JSON metadata for the struct
-// [R2SippyUpdateResponse]
-type r2SippyUpdateResponseJSON struct {
- Destination apijson.Field
- Enabled apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *R2SippyUpdateResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r r2SippyUpdateResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// Details about the configured destination bucket
-type R2SippyUpdateResponseDestination struct {
- // ID of the Cloudflare API token used when writing objects to this bucket
- AccessKeyID string `json:"accessKeyId"`
- Account string `json:"account"`
- // Name of the bucket on the provider
- Bucket string `json:"bucket"`
- Provider R2SippyUpdateResponseDestinationProvider `json:"provider"`
- JSON r2SippyUpdateResponseDestinationJSON `json:"-"`
-}
-
-// r2SippyUpdateResponseDestinationJSON contains the JSON metadata for the struct
-// [R2SippyUpdateResponseDestination]
-type r2SippyUpdateResponseDestinationJSON struct {
- AccessKeyID apijson.Field
- Account apijson.Field
- Bucket apijson.Field
- Provider apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *R2SippyUpdateResponseDestination) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r r2SippyUpdateResponseDestinationJSON) RawJSON() string {
- return r.raw
-}
-
-type R2SippyUpdateResponseDestinationProvider string
-
-const (
- R2SippyUpdateResponseDestinationProviderR2 R2SippyUpdateResponseDestinationProvider = "r2"
-)
-
-// Details about the configured source bucket
-type R2SippyUpdateResponseSource struct {
- // Name of the bucket on the provider
- Bucket string `json:"bucket"`
- Provider R2SippyUpdateResponseSourceProvider `json:"provider"`
- // Region where the bucket resides (AWS only)
- Region string `json:"region,nullable"`
- JSON r2SippyUpdateResponseSourceJSON `json:"-"`
-}
-
-// r2SippyUpdateResponseSourceJSON contains the JSON metadata for the struct
-// [R2SippyUpdateResponseSource]
-type r2SippyUpdateResponseSourceJSON struct {
- Bucket apijson.Field
- Provider apijson.Field
- Region apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *R2SippyUpdateResponseSource) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r r2SippyUpdateResponseSourceJSON) RawJSON() string {
- return r.raw
-}
-
-type R2SippyUpdateResponseSourceProvider string
-
-const (
- R2SippyUpdateResponseSourceProviderAws R2SippyUpdateResponseSourceProvider = "aws"
- R2SippyUpdateResponseSourceProviderGcs R2SippyUpdateResponseSourceProvider = "gcs"
-)
-
-type R2SippyDeleteResponse struct {
- Enabled R2SippyDeleteResponseEnabled `json:"enabled"`
- JSON r2SippyDeleteResponseJSON `json:"-"`
-}
-
-// r2SippyDeleteResponseJSON contains the JSON metadata for the struct
-// [R2SippyDeleteResponse]
-type r2SippyDeleteResponseJSON struct {
- Enabled apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *R2SippyDeleteResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r r2SippyDeleteResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type R2SippyDeleteResponseEnabled bool
-
-const (
- R2SippyDeleteResponseEnabledFalse R2SippyDeleteResponseEnabled = false
-)
-
-type R2SippyGetResponse struct {
- // Details about the configured destination bucket
- Destination R2SippyGetResponseDestination `json:"destination"`
- // State of Sippy for this bucket
- Enabled bool `json:"enabled"`
- // Details about the configured source bucket
- Source R2SippyGetResponseSource `json:"source"`
- JSON r2SippyGetResponseJSON `json:"-"`
-}
-
-// r2SippyGetResponseJSON contains the JSON metadata for the struct
-// [R2SippyGetResponse]
-type r2SippyGetResponseJSON struct {
- Destination apijson.Field
- Enabled apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *R2SippyGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r r2SippyGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// Details about the configured destination bucket
-type R2SippyGetResponseDestination struct {
- // ID of the Cloudflare API token used when writing objects to this bucket
- AccessKeyID string `json:"accessKeyId"`
- Account string `json:"account"`
- // Name of the bucket on the provider
- Bucket string `json:"bucket"`
- Provider R2SippyGetResponseDestinationProvider `json:"provider"`
- JSON r2SippyGetResponseDestinationJSON `json:"-"`
-}
-
-// r2SippyGetResponseDestinationJSON contains the JSON metadata for the struct
-// [R2SippyGetResponseDestination]
-type r2SippyGetResponseDestinationJSON struct {
- AccessKeyID apijson.Field
- Account apijson.Field
- Bucket apijson.Field
- Provider apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *R2SippyGetResponseDestination) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r r2SippyGetResponseDestinationJSON) RawJSON() string {
- return r.raw
-}
-
-type R2SippyGetResponseDestinationProvider string
-
-const (
- R2SippyGetResponseDestinationProviderR2 R2SippyGetResponseDestinationProvider = "r2"
-)
-
-// Details about the configured source bucket
-type R2SippyGetResponseSource struct {
- // Name of the bucket on the provider
- Bucket string `json:"bucket"`
- Provider R2SippyGetResponseSourceProvider `json:"provider"`
- // Region where the bucket resides (AWS only)
- Region string `json:"region,nullable"`
- JSON r2SippyGetResponseSourceJSON `json:"-"`
-}
-
-// r2SippyGetResponseSourceJSON contains the JSON metadata for the struct
-// [R2SippyGetResponseSource]
-type r2SippyGetResponseSourceJSON struct {
- Bucket apijson.Field
- Provider apijson.Field
- Region apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *R2SippyGetResponseSource) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r r2SippyGetResponseSourceJSON) RawJSON() string {
- return r.raw
-}
-
-type R2SippyGetResponseSourceProvider string
-
-const (
- R2SippyGetResponseSourceProviderAws R2SippyGetResponseSourceProvider = "aws"
- R2SippyGetResponseSourceProviderGcs R2SippyGetResponseSourceProvider = "gcs"
-)
-
-type R2SippyUpdateParams struct {
- // Account ID
- AccountID param.Field[string] `path:"account_id,required"`
- Destination param.Field[R2SippyUpdateParamsDestination] `json:"destination"`
- Source param.Field[R2SippyUpdateParamsSource] `json:"source"`
-}
-
-func (r R2SippyUpdateParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type R2SippyUpdateParamsDestination struct {
- // ID of a Cloudflare API token. This is the value labelled "Access Key ID" when
- // creating an API token from the
- // [R2 dashboard](https://dash.cloudflare.com/?to=/:account/r2/api-tokens).
- //
- // Sippy will use this token when writing objects to R2, so it is best to scope
- // this token to the bucket you're enabling Sippy for.
- AccessKeyID param.Field[string] `json:"accessKeyId"`
- Provider param.Field[R2SippyUpdateParamsDestinationProvider] `json:"provider"`
- // Value of a Cloudflare API token. This is the value labelled "Secret Access Key"
- // when creating an API token from the
- // [R2 dashboard](https://dash.cloudflare.com/?to=/:account/r2/api-tokens).
- //
- // Sippy will use this token when writing objects to R2, so it is best to scope
- // this token to the bucket you're enabling Sippy for.
- SecretAccessKey param.Field[string] `json:"secretAccessKey"`
-}
-
-func (r R2SippyUpdateParamsDestination) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type R2SippyUpdateParamsDestinationProvider string
-
-const (
- R2SippyUpdateParamsDestinationProviderR2 R2SippyUpdateParamsDestinationProvider = "r2"
-)
-
-type R2SippyUpdateParamsSource struct {
- // Access Key ID of an IAM credential (ideally scoped to a single S3 bucket)
- AccessKeyID param.Field[string] `json:"accessKeyId"`
- // Name of the GCS bucket
- Bucket param.Field[string] `json:"bucket"`
- // Client email of an IAM credential (ideally scoped to a single GCS bucket)
- ClientEmail param.Field[string] `json:"clientEmail"`
- // Private Key of an IAM credential (ideally scoped to a single GCS bucket)
- PrivateKey param.Field[string] `json:"privateKey"`
- Provider param.Field[R2SippyUpdateParamsSourceProvider] `json:"provider"`
- // Name of the AWS availability zone
- Region param.Field[string] `json:"region"`
- // Secret Access Key of an IAM credential (ideally scoped to a single S3 bucket)
- SecretAccessKey param.Field[string] `json:"secretAccessKey"`
-}
-
-func (r R2SippyUpdateParamsSource) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type R2SippyUpdateParamsSourceProvider string
-
-const (
- R2SippyUpdateParamsSourceProviderGcs R2SippyUpdateParamsSourceProvider = "gcs"
-)
-
-type R2SippyUpdateResponseEnvelope struct {
- Errors []R2SippyUpdateResponseEnvelopeErrors `json:"errors,required"`
- Messages []string `json:"messages,required"`
- Result R2SippyUpdateResponse `json:"result,required"`
- // Whether the API call was successful
- Success R2SippyUpdateResponseEnvelopeSuccess `json:"success,required"`
- JSON r2SippyUpdateResponseEnvelopeJSON `json:"-"`
-}
-
-// r2SippyUpdateResponseEnvelopeJSON contains the JSON metadata for the struct
-// [R2SippyUpdateResponseEnvelope]
-type r2SippyUpdateResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *R2SippyUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r r2SippyUpdateResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type R2SippyUpdateResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON r2SippyUpdateResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// r2SippyUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [R2SippyUpdateResponseEnvelopeErrors]
-type r2SippyUpdateResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *R2SippyUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r r2SippyUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type R2SippyUpdateResponseEnvelopeSuccess bool
-
-const (
- R2SippyUpdateResponseEnvelopeSuccessTrue R2SippyUpdateResponseEnvelopeSuccess = true
-)
-
-type R2SippyDeleteParams struct {
- // Account ID
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type R2SippyDeleteResponseEnvelope struct {
- Errors []R2SippyDeleteResponseEnvelopeErrors `json:"errors,required"`
- Messages []string `json:"messages,required"`
- Result R2SippyDeleteResponse `json:"result,required"`
- // Whether the API call was successful
- Success R2SippyDeleteResponseEnvelopeSuccess `json:"success,required"`
- JSON r2SippyDeleteResponseEnvelopeJSON `json:"-"`
-}
-
-// r2SippyDeleteResponseEnvelopeJSON contains the JSON metadata for the struct
-// [R2SippyDeleteResponseEnvelope]
-type r2SippyDeleteResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *R2SippyDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r r2SippyDeleteResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type R2SippyDeleteResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON r2SippyDeleteResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// r2SippyDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [R2SippyDeleteResponseEnvelopeErrors]
-type r2SippyDeleteResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *R2SippyDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r r2SippyDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type R2SippyDeleteResponseEnvelopeSuccess bool
-
-const (
- R2SippyDeleteResponseEnvelopeSuccessTrue R2SippyDeleteResponseEnvelopeSuccess = true
-)
-
-type R2SippyGetParams struct {
- // Account ID
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type R2SippyGetResponseEnvelope struct {
- Errors []R2SippyGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []string `json:"messages,required"`
- Result R2SippyGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success R2SippyGetResponseEnvelopeSuccess `json:"success,required"`
- JSON r2SippyGetResponseEnvelopeJSON `json:"-"`
-}
-
-// r2SippyGetResponseEnvelopeJSON contains the JSON metadata for the struct
-// [R2SippyGetResponseEnvelope]
-type r2SippyGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *R2SippyGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r r2SippyGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type R2SippyGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON r2SippyGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// r2SippyGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
-// [R2SippyGetResponseEnvelopeErrors]
-type r2SippyGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *R2SippyGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r r2SippyGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type R2SippyGetResponseEnvelopeSuccess bool
-
-const (
- R2SippyGetResponseEnvelopeSuccessTrue R2SippyGetResponseEnvelopeSuccess = true
-)
diff --git a/r2sippy_test.go b/r2sippy_test.go
deleted file mode 100644
index bae58532c90..00000000000
--- a/r2sippy_test.go
+++ /dev/null
@@ -1,118 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestR2SippyUpdateWithOptionalParams(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"),
- )
- _, err := client.R2.Sippy.Update(
- context.TODO(),
- "example-bucket",
- cloudflare.R2SippyUpdateParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Destination: cloudflare.F(cloudflare.R2SippyUpdateParamsDestination{
- AccessKeyID: cloudflare.F("string"),
- Provider: cloudflare.F(cloudflare.R2SippyUpdateParamsDestinationProviderR2),
- SecretAccessKey: cloudflare.F("string"),
- }),
- Source: cloudflare.F(cloudflare.R2SippyUpdateParamsSource{
- AccessKeyID: cloudflare.F("string"),
- Bucket: cloudflare.F("string"),
- Provider: cloudflare.F(cloudflare.R2SippyUpdateParamsSourceProviderGcs),
- Region: cloudflare.F("string"),
- SecretAccessKey: cloudflare.F("string"),
- ClientEmail: cloudflare.F("string"),
- PrivateKey: cloudflare.F("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())
- }
-}
-
-func TestR2SippyDelete(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"),
- )
- _, err := client.R2.Sippy.Delete(
- context.TODO(),
- "example-bucket",
- cloudflare.R2SippyDeleteParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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())
- }
-}
-
-func TestR2SippyGet(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"),
- )
- _, err := client.R2.Sippy.Get(
- context.TODO(),
- "example-bucket",
- cloudflare.R2SippyGetParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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/radar.go b/radar.go
deleted file mode 100644
index 2209f6fe877..00000000000
--- a/radar.go
+++ /dev/null
@@ -1,56 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarService contains methods and other services that help with interacting with
-// the cloudflare API. Note, unlike clients, this service does not read variables
-// from the environment automatically. You should not instantiate this service
-// directly, and instead use the [NewRadarService] method instead.
-type RadarService struct {
- Options []option.RequestOption
- Annotations *RadarAnnotationService
- BGP *RadarBGPService
- Datasets *RadarDatasetService
- DNS *RadarDNSService
- Netflows *RadarNetflowService
- Search *RadarSearchService
- VerifiedBots *RadarVerifiedBotService
- AS112 *RadarAS112Service
- ConnectionTampering *RadarConnectionTamperingService
- Email *RadarEmailService
- Attacks *RadarAttackService
- Entities *RadarEntityService
- HTTP *RadarHTTPService
- Quality *RadarQualityService
- Ranking *RadarRankingService
- TrafficAnomalies *RadarTrafficAnomalyService
-}
-
-// NewRadarService generates a new service that applies the given options to each
-// request. These options are applied after the parent client's options (if there
-// is one), and before any request-specific options.
-func NewRadarService(opts ...option.RequestOption) (r *RadarService) {
- r = &RadarService{}
- r.Options = opts
- r.Annotations = NewRadarAnnotationService(opts...)
- r.BGP = NewRadarBGPService(opts...)
- r.Datasets = NewRadarDatasetService(opts...)
- r.DNS = NewRadarDNSService(opts...)
- r.Netflows = NewRadarNetflowService(opts...)
- r.Search = NewRadarSearchService(opts...)
- r.VerifiedBots = NewRadarVerifiedBotService(opts...)
- r.AS112 = NewRadarAS112Service(opts...)
- r.ConnectionTampering = NewRadarConnectionTamperingService(opts...)
- r.Email = NewRadarEmailService(opts...)
- r.Attacks = NewRadarAttackService(opts...)
- r.Entities = NewRadarEntityService(opts...)
- r.HTTP = NewRadarHTTPService(opts...)
- r.Quality = NewRadarQualityService(opts...)
- r.Ranking = NewRadarRankingService(opts...)
- r.TrafficAnomalies = NewRadarTrafficAnomalyService(opts...)
- return
-}
diff --git a/radar/aliases.go b/radar/aliases.go
new file mode 100644
index 00000000000..3aae5ffe93d
--- /dev/null
+++ b/radar/aliases.go
@@ -0,0 +1,9 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "github.com/cloudflare/cloudflare-go/internal/apierror"
+)
+
+type Error = apierror.Error
diff --git a/radar/annotation.go b/radar/annotation.go
new file mode 100644
index 00000000000..f54e077143b
--- /dev/null
+++ b/radar/annotation.go
@@ -0,0 +1,26 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// AnnotationService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewAnnotationService] method instead.
+type AnnotationService struct {
+ Options []option.RequestOption
+ Outages *AnnotationOutageService
+}
+
+// NewAnnotationService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewAnnotationService(opts ...option.RequestOption) (r *AnnotationService) {
+ r = &AnnotationService{}
+ r.Options = opts
+ r.Outages = NewAnnotationOutageService(opts...)
+ return
+}
diff --git a/radar/annotationoutage.go b/radar/annotationoutage.go
new file mode 100644
index 00000000000..65e6ba73f09
--- /dev/null
+++ b/radar/annotationoutage.go
@@ -0,0 +1,425 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "context"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// AnnotationOutageService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewAnnotationOutageService] method
+// instead.
+type AnnotationOutageService struct {
+ Options []option.RequestOption
+}
+
+// NewAnnotationOutageService generates a new service that applies the given
+// options to each request. These options are applied after the parent client's
+// options (if there is one), and before any request-specific options.
+func NewAnnotationOutageService(opts ...option.RequestOption) (r *AnnotationOutageService) {
+ r = &AnnotationOutageService{}
+ r.Options = opts
+ return
+}
+
+// Get latest Internet outages and anomalies.
+func (r *AnnotationOutageService) Get(ctx context.Context, query AnnotationOutageGetParams, opts ...option.RequestOption) (res *AnnotationOutageGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AnnotationOutageGetResponseEnvelope
+ path := "radar/annotations/outages"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Get the number of outages for locations.
+func (r *AnnotationOutageService) Locations(ctx context.Context, query AnnotationOutageLocationsParams, opts ...option.RequestOption) (res *AnnotationOutageLocationsResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AnnotationOutageLocationsResponseEnvelope
+ path := "radar/annotations/outages/locations"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type AnnotationOutageGetResponse struct {
+ Annotations []AnnotationOutageGetResponseAnnotation `json:"annotations,required"`
+ JSON annotationOutageGetResponseJSON `json:"-"`
+}
+
+// annotationOutageGetResponseJSON contains the JSON metadata for the struct
+// [AnnotationOutageGetResponse]
+type annotationOutageGetResponseJSON struct {
+ Annotations apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AnnotationOutageGetResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r annotationOutageGetResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type AnnotationOutageGetResponseAnnotation struct {
+ ID string `json:"id,required"`
+ ASNs []int64 `json:"asns,required"`
+ ASNsDetails []AnnotationOutageGetResponseAnnotationsASNsDetail `json:"asnsDetails,required"`
+ DataSource string `json:"dataSource,required"`
+ EventType string `json:"eventType,required"`
+ Locations []string `json:"locations,required"`
+ LocationsDetails []AnnotationOutageGetResponseAnnotationsLocationsDetail `json:"locationsDetails,required"`
+ Outage AnnotationOutageGetResponseAnnotationsOutage `json:"outage,required"`
+ StartDate string `json:"startDate,required"`
+ Description string `json:"description"`
+ EndDate string `json:"endDate"`
+ LinkedURL string `json:"linkedUrl"`
+ Scope string `json:"scope"`
+ JSON annotationOutageGetResponseAnnotationJSON `json:"-"`
+}
+
+// annotationOutageGetResponseAnnotationJSON contains the JSON metadata for the
+// struct [AnnotationOutageGetResponseAnnotation]
+type annotationOutageGetResponseAnnotationJSON struct {
+ ID apijson.Field
+ ASNs apijson.Field
+ ASNsDetails apijson.Field
+ DataSource apijson.Field
+ EventType apijson.Field
+ Locations apijson.Field
+ LocationsDetails apijson.Field
+ Outage apijson.Field
+ StartDate apijson.Field
+ Description apijson.Field
+ EndDate apijson.Field
+ LinkedURL apijson.Field
+ Scope apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AnnotationOutageGetResponseAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r annotationOutageGetResponseAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type AnnotationOutageGetResponseAnnotationsASNsDetail struct {
+ ASN string `json:"asn,required"`
+ Name string `json:"name,required"`
+ Locations AnnotationOutageGetResponseAnnotationsASNsDetailsLocations `json:"locations"`
+ JSON annotationOutageGetResponseAnnotationsASNsDetailJSON `json:"-"`
+}
+
+// annotationOutageGetResponseAnnotationsASNsDetailJSON contains the JSON metadata
+// for the struct [AnnotationOutageGetResponseAnnotationsASNsDetail]
+type annotationOutageGetResponseAnnotationsASNsDetailJSON struct {
+ ASN apijson.Field
+ Name apijson.Field
+ Locations apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AnnotationOutageGetResponseAnnotationsASNsDetail) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r annotationOutageGetResponseAnnotationsASNsDetailJSON) RawJSON() string {
+ return r.raw
+}
+
+type AnnotationOutageGetResponseAnnotationsASNsDetailsLocations struct {
+ Code string `json:"code,required"`
+ Name string `json:"name,required"`
+ JSON annotationOutageGetResponseAnnotationsASNsDetailsLocationsJSON `json:"-"`
+}
+
+// annotationOutageGetResponseAnnotationsASNsDetailsLocationsJSON contains the JSON
+// metadata for the struct
+// [AnnotationOutageGetResponseAnnotationsASNsDetailsLocations]
+type annotationOutageGetResponseAnnotationsASNsDetailsLocationsJSON struct {
+ Code apijson.Field
+ Name apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AnnotationOutageGetResponseAnnotationsASNsDetailsLocations) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r annotationOutageGetResponseAnnotationsASNsDetailsLocationsJSON) RawJSON() string {
+ return r.raw
+}
+
+type AnnotationOutageGetResponseAnnotationsLocationsDetail struct {
+ Code string `json:"code,required"`
+ Name string `json:"name,required"`
+ JSON annotationOutageGetResponseAnnotationsLocationsDetailJSON `json:"-"`
+}
+
+// annotationOutageGetResponseAnnotationsLocationsDetailJSON contains the JSON
+// metadata for the struct [AnnotationOutageGetResponseAnnotationsLocationsDetail]
+type annotationOutageGetResponseAnnotationsLocationsDetailJSON struct {
+ Code apijson.Field
+ Name apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AnnotationOutageGetResponseAnnotationsLocationsDetail) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r annotationOutageGetResponseAnnotationsLocationsDetailJSON) RawJSON() string {
+ return r.raw
+}
+
+type AnnotationOutageGetResponseAnnotationsOutage struct {
+ OutageCause string `json:"outageCause,required"`
+ OutageType string `json:"outageType,required"`
+ JSON annotationOutageGetResponseAnnotationsOutageJSON `json:"-"`
+}
+
+// annotationOutageGetResponseAnnotationsOutageJSON contains the JSON metadata for
+// the struct [AnnotationOutageGetResponseAnnotationsOutage]
+type annotationOutageGetResponseAnnotationsOutageJSON struct {
+ OutageCause apijson.Field
+ OutageType apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AnnotationOutageGetResponseAnnotationsOutage) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r annotationOutageGetResponseAnnotationsOutageJSON) RawJSON() string {
+ return r.raw
+}
+
+type AnnotationOutageLocationsResponse struct {
+ Annotations []AnnotationOutageLocationsResponseAnnotation `json:"annotations,required"`
+ JSON annotationOutageLocationsResponseJSON `json:"-"`
+}
+
+// annotationOutageLocationsResponseJSON contains the JSON metadata for the struct
+// [AnnotationOutageLocationsResponse]
+type annotationOutageLocationsResponseJSON struct {
+ Annotations apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AnnotationOutageLocationsResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r annotationOutageLocationsResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type AnnotationOutageLocationsResponseAnnotation struct {
+ ClientCountryAlpha2 string `json:"clientCountryAlpha2,required"`
+ ClientCountryName string `json:"clientCountryName,required"`
+ Value string `json:"value,required"`
+ JSON annotationOutageLocationsResponseAnnotationJSON `json:"-"`
+}
+
+// annotationOutageLocationsResponseAnnotationJSON contains the JSON metadata for
+// the struct [AnnotationOutageLocationsResponseAnnotation]
+type annotationOutageLocationsResponseAnnotationJSON struct {
+ ClientCountryAlpha2 apijson.Field
+ ClientCountryName apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AnnotationOutageLocationsResponseAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r annotationOutageLocationsResponseAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type AnnotationOutageGetParams struct {
+ // Single ASN as integer.
+ ASN param.Field[int64] `query:"asn"`
+ // End of the date range (inclusive).
+ DateEnd param.Field[time.Time] `query:"dateEnd" format:"date-time"`
+ // Shorthand date ranges for the last X days - use when you don't need specific
+ // start and end dates.
+ DateRange param.Field[AnnotationOutageGetParamsDateRange] `query:"dateRange"`
+ // Start of the date range (inclusive).
+ DateStart param.Field[time.Time] `query:"dateStart" format:"date-time"`
+ // Format results are returned in.
+ Format param.Field[AnnotationOutageGetParamsFormat] `query:"format"`
+ // Limit the number of objects in the response.
+ Limit param.Field[int64] `query:"limit"`
+ // Location Alpha2 code.
+ Location param.Field[string] `query:"location"`
+ // Number of objects to skip before grabbing results.
+ Offset param.Field[int64] `query:"offset"`
+}
+
+// URLQuery serializes [AnnotationOutageGetParams]'s query parameters as
+// `url.Values`.
+func (r AnnotationOutageGetParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Shorthand date ranges for the last X days - use when you don't need specific
+// start and end dates.
+type AnnotationOutageGetParamsDateRange string
+
+const (
+ AnnotationOutageGetParamsDateRange1d AnnotationOutageGetParamsDateRange = "1d"
+ AnnotationOutageGetParamsDateRange2d AnnotationOutageGetParamsDateRange = "2d"
+ AnnotationOutageGetParamsDateRange7d AnnotationOutageGetParamsDateRange = "7d"
+ AnnotationOutageGetParamsDateRange14d AnnotationOutageGetParamsDateRange = "14d"
+ AnnotationOutageGetParamsDateRange28d AnnotationOutageGetParamsDateRange = "28d"
+ AnnotationOutageGetParamsDateRange12w AnnotationOutageGetParamsDateRange = "12w"
+ AnnotationOutageGetParamsDateRange24w AnnotationOutageGetParamsDateRange = "24w"
+ AnnotationOutageGetParamsDateRange52w AnnotationOutageGetParamsDateRange = "52w"
+ AnnotationOutageGetParamsDateRange1dControl AnnotationOutageGetParamsDateRange = "1dControl"
+ AnnotationOutageGetParamsDateRange2dControl AnnotationOutageGetParamsDateRange = "2dControl"
+ AnnotationOutageGetParamsDateRange7dControl AnnotationOutageGetParamsDateRange = "7dControl"
+ AnnotationOutageGetParamsDateRange14dControl AnnotationOutageGetParamsDateRange = "14dControl"
+ AnnotationOutageGetParamsDateRange28dControl AnnotationOutageGetParamsDateRange = "28dControl"
+ AnnotationOutageGetParamsDateRange12wControl AnnotationOutageGetParamsDateRange = "12wControl"
+ AnnotationOutageGetParamsDateRange24wControl AnnotationOutageGetParamsDateRange = "24wControl"
+)
+
+// Format results are returned in.
+type AnnotationOutageGetParamsFormat string
+
+const (
+ AnnotationOutageGetParamsFormatJson AnnotationOutageGetParamsFormat = "JSON"
+ AnnotationOutageGetParamsFormatCsv AnnotationOutageGetParamsFormat = "CSV"
+)
+
+type AnnotationOutageGetResponseEnvelope struct {
+ Result AnnotationOutageGetResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON annotationOutageGetResponseEnvelopeJSON `json:"-"`
+}
+
+// annotationOutageGetResponseEnvelopeJSON contains the JSON metadata for the
+// struct [AnnotationOutageGetResponseEnvelope]
+type annotationOutageGetResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AnnotationOutageGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r annotationOutageGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AnnotationOutageLocationsParams struct {
+ // End of the date range (inclusive).
+ DateEnd param.Field[time.Time] `query:"dateEnd" format:"date-time"`
+ // Shorthand date ranges for the last X days - use when you don't need specific
+ // start and end dates.
+ DateRange param.Field[AnnotationOutageLocationsParamsDateRange] `query:"dateRange"`
+ // Start of the date range (inclusive).
+ DateStart param.Field[time.Time] `query:"dateStart" format:"date-time"`
+ // Format results are returned in.
+ Format param.Field[AnnotationOutageLocationsParamsFormat] `query:"format"`
+ // Limit the number of objects in the response.
+ Limit param.Field[int64] `query:"limit"`
+}
+
+// URLQuery serializes [AnnotationOutageLocationsParams]'s query parameters as
+// `url.Values`.
+func (r AnnotationOutageLocationsParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Shorthand date ranges for the last X days - use when you don't need specific
+// start and end dates.
+type AnnotationOutageLocationsParamsDateRange string
+
+const (
+ AnnotationOutageLocationsParamsDateRange1d AnnotationOutageLocationsParamsDateRange = "1d"
+ AnnotationOutageLocationsParamsDateRange2d AnnotationOutageLocationsParamsDateRange = "2d"
+ AnnotationOutageLocationsParamsDateRange7d AnnotationOutageLocationsParamsDateRange = "7d"
+ AnnotationOutageLocationsParamsDateRange14d AnnotationOutageLocationsParamsDateRange = "14d"
+ AnnotationOutageLocationsParamsDateRange28d AnnotationOutageLocationsParamsDateRange = "28d"
+ AnnotationOutageLocationsParamsDateRange12w AnnotationOutageLocationsParamsDateRange = "12w"
+ AnnotationOutageLocationsParamsDateRange24w AnnotationOutageLocationsParamsDateRange = "24w"
+ AnnotationOutageLocationsParamsDateRange52w AnnotationOutageLocationsParamsDateRange = "52w"
+ AnnotationOutageLocationsParamsDateRange1dControl AnnotationOutageLocationsParamsDateRange = "1dControl"
+ AnnotationOutageLocationsParamsDateRange2dControl AnnotationOutageLocationsParamsDateRange = "2dControl"
+ AnnotationOutageLocationsParamsDateRange7dControl AnnotationOutageLocationsParamsDateRange = "7dControl"
+ AnnotationOutageLocationsParamsDateRange14dControl AnnotationOutageLocationsParamsDateRange = "14dControl"
+ AnnotationOutageLocationsParamsDateRange28dControl AnnotationOutageLocationsParamsDateRange = "28dControl"
+ AnnotationOutageLocationsParamsDateRange12wControl AnnotationOutageLocationsParamsDateRange = "12wControl"
+ AnnotationOutageLocationsParamsDateRange24wControl AnnotationOutageLocationsParamsDateRange = "24wControl"
+)
+
+// Format results are returned in.
+type AnnotationOutageLocationsParamsFormat string
+
+const (
+ AnnotationOutageLocationsParamsFormatJson AnnotationOutageLocationsParamsFormat = "JSON"
+ AnnotationOutageLocationsParamsFormatCsv AnnotationOutageLocationsParamsFormat = "CSV"
+)
+
+type AnnotationOutageLocationsResponseEnvelope struct {
+ Result AnnotationOutageLocationsResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON annotationOutageLocationsResponseEnvelopeJSON `json:"-"`
+}
+
+// annotationOutageLocationsResponseEnvelopeJSON contains the JSON metadata for the
+// struct [AnnotationOutageLocationsResponseEnvelope]
+type annotationOutageLocationsResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AnnotationOutageLocationsResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r annotationOutageLocationsResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/radar/annotationoutage_test.go b/radar/annotationoutage_test.go
new file mode 100644
index 00000000000..f46a728a07e
--- /dev/null
+++ b/radar/annotationoutage_test.go
@@ -0,0 +1,79 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/radar"
+)
+
+func TestAnnotationOutageGetWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Annotations.Outages.Get(context.TODO(), radar.AnnotationOutageGetParams{
+ ASN: cloudflare.F(int64(0)),
+ DateEnd: cloudflare.F(time.Now()),
+ DateRange: cloudflare.F(radar.AnnotationOutageGetParamsDateRange7d),
+ DateStart: cloudflare.F(time.Now()),
+ Format: cloudflare.F(radar.AnnotationOutageGetParamsFormatJson),
+ Limit: cloudflare.F(int64(5)),
+ Location: cloudflare.F("US"),
+ Offset: cloudflare.F(int64(0)),
+ })
+ 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())
+ }
+}
+
+func TestAnnotationOutageLocationsWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Annotations.Outages.Locations(context.TODO(), radar.AnnotationOutageLocationsParams{
+ DateEnd: cloudflare.F(time.Now()),
+ DateRange: cloudflare.F(radar.AnnotationOutageLocationsParamsDateRange7d),
+ DateStart: cloudflare.F(time.Now()),
+ Format: cloudflare.F(radar.AnnotationOutageLocationsParamsFormatJson),
+ Limit: cloudflare.F(int64(5)),
+ })
+ 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/radar/as112.go b/radar/as112.go
new file mode 100644
index 00000000000..47a35fcd988
--- /dev/null
+++ b/radar/as112.go
@@ -0,0 +1,308 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "context"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// AS112Service contains methods and other services that help with interacting with
+// the cloudflare API. Note, unlike clients, this service does not read variables
+// from the environment automatically. You should not instantiate this service
+// directly, and instead use the [NewAS112Service] method instead.
+type AS112Service struct {
+ Options []option.RequestOption
+ Summary *AS112SummaryService
+ TimeseriesGroups *AS112TimeseriesGroupService
+ Top *AS112TopService
+}
+
+// NewAS112Service generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewAS112Service(opts ...option.RequestOption) (r *AS112Service) {
+ r = &AS112Service{}
+ r.Options = opts
+ r.Summary = NewAS112SummaryService(opts...)
+ r.TimeseriesGroups = NewAS112TimeseriesGroupService(opts...)
+ r.Top = NewAS112TopService(opts...)
+ return
+}
+
+// Get AS112 queries change over time.
+func (r *AS112Service) Timeseries(ctx context.Context, query AS112TimeseriesParams, opts ...option.RequestOption) (res *AS112TimeseriesResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AS112TimeseriesResponseEnvelope
+ path := "radar/as112/timeseries"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type AS112TimeseriesResponse struct {
+ Meta AS112TimeseriesResponseMeta `json:"meta,required"`
+ Serie0 AS112TimeseriesResponseSerie0 `json:"serie_0,required"`
+ JSON as112TimeseriesResponseJSON `json:"-"`
+}
+
+// as112TimeseriesResponseJSON contains the JSON metadata for the struct
+// [AS112TimeseriesResponse]
+type as112TimeseriesResponseJSON struct {
+ Meta apijson.Field
+ Serie0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112TimeseriesResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112TimeseriesResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112TimeseriesResponseMeta struct {
+ AggInterval string `json:"aggInterval,required"`
+ DateRange []AS112TimeseriesResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated time.Time `json:"lastUpdated,required" format:"date-time"`
+ ConfidenceInfo AS112TimeseriesResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON as112TimeseriesResponseMetaJSON `json:"-"`
+}
+
+// as112TimeseriesResponseMetaJSON contains the JSON metadata for the struct
+// [AS112TimeseriesResponseMeta]
+type as112TimeseriesResponseMetaJSON struct {
+ AggInterval apijson.Field
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112TimeseriesResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112TimeseriesResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112TimeseriesResponseMetaDateRange 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 as112TimeseriesResponseMetaDateRangeJSON `json:"-"`
+}
+
+// as112TimeseriesResponseMetaDateRangeJSON contains the JSON metadata for the
+// struct [AS112TimeseriesResponseMetaDateRange]
+type as112TimeseriesResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112TimeseriesResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112TimeseriesResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112TimeseriesResponseMetaConfidenceInfo struct {
+ Annotations []AS112TimeseriesResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON as112TimeseriesResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// as112TimeseriesResponseMetaConfidenceInfoJSON contains the JSON metadata for the
+// struct [AS112TimeseriesResponseMetaConfidenceInfo]
+type as112TimeseriesResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112TimeseriesResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112TimeseriesResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112TimeseriesResponseMetaConfidenceInfoAnnotation 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 as112TimeseriesResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// as112TimeseriesResponseMetaConfidenceInfoAnnotationJSON contains the JSON
+// metadata for the struct [AS112TimeseriesResponseMetaConfidenceInfoAnnotation]
+type as112TimeseriesResponseMetaConfidenceInfoAnnotationJSON 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 *AS112TimeseriesResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112TimeseriesResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112TimeseriesResponseSerie0 struct {
+ Timestamps []time.Time `json:"timestamps,required" format:"date-time"`
+ Values []string `json:"values,required"`
+ JSON as112TimeseriesResponseSerie0JSON `json:"-"`
+}
+
+// as112TimeseriesResponseSerie0JSON contains the JSON metadata for the struct
+// [AS112TimeseriesResponseSerie0]
+type as112TimeseriesResponseSerie0JSON struct {
+ Timestamps apijson.Field
+ Values apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112TimeseriesResponseSerie0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112TimeseriesResponseSerie0JSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112TimeseriesParams struct {
+ // Aggregation interval results should be returned in (for example, in 15 minutes
+ // or 1 hour intervals). Refer to
+ // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+ AggInterval param.Field[AS112TimeseriesParamsAggInterval] `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"`
+ // 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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]AS112TimeseriesParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Format results are returned in.
+ Format param.Field[AS112TimeseriesParamsFormat] `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"`
+}
+
+// URLQuery serializes [AS112TimeseriesParams]'s query parameters as `url.Values`.
+func (r AS112TimeseriesParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Aggregation interval results should be returned in (for example, in 15 minutes
+// or 1 hour intervals). Refer to
+// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+type AS112TimeseriesParamsAggInterval string
+
+const (
+ AS112TimeseriesParamsAggInterval15m AS112TimeseriesParamsAggInterval = "15m"
+ AS112TimeseriesParamsAggInterval1h AS112TimeseriesParamsAggInterval = "1h"
+ AS112TimeseriesParamsAggInterval1d AS112TimeseriesParamsAggInterval = "1d"
+ AS112TimeseriesParamsAggInterval1w AS112TimeseriesParamsAggInterval = "1w"
+)
+
+type AS112TimeseriesParamsDateRange string
+
+const (
+ AS112TimeseriesParamsDateRange1d AS112TimeseriesParamsDateRange = "1d"
+ AS112TimeseriesParamsDateRange2d AS112TimeseriesParamsDateRange = "2d"
+ AS112TimeseriesParamsDateRange7d AS112TimeseriesParamsDateRange = "7d"
+ AS112TimeseriesParamsDateRange14d AS112TimeseriesParamsDateRange = "14d"
+ AS112TimeseriesParamsDateRange28d AS112TimeseriesParamsDateRange = "28d"
+ AS112TimeseriesParamsDateRange12w AS112TimeseriesParamsDateRange = "12w"
+ AS112TimeseriesParamsDateRange24w AS112TimeseriesParamsDateRange = "24w"
+ AS112TimeseriesParamsDateRange52w AS112TimeseriesParamsDateRange = "52w"
+ AS112TimeseriesParamsDateRange1dControl AS112TimeseriesParamsDateRange = "1dControl"
+ AS112TimeseriesParamsDateRange2dControl AS112TimeseriesParamsDateRange = "2dControl"
+ AS112TimeseriesParamsDateRange7dControl AS112TimeseriesParamsDateRange = "7dControl"
+ AS112TimeseriesParamsDateRange14dControl AS112TimeseriesParamsDateRange = "14dControl"
+ AS112TimeseriesParamsDateRange28dControl AS112TimeseriesParamsDateRange = "28dControl"
+ AS112TimeseriesParamsDateRange12wControl AS112TimeseriesParamsDateRange = "12wControl"
+ AS112TimeseriesParamsDateRange24wControl AS112TimeseriesParamsDateRange = "24wControl"
+)
+
+// Format results are returned in.
+type AS112TimeseriesParamsFormat string
+
+const (
+ AS112TimeseriesParamsFormatJson AS112TimeseriesParamsFormat = "JSON"
+ AS112TimeseriesParamsFormatCsv AS112TimeseriesParamsFormat = "CSV"
+)
+
+type AS112TimeseriesResponseEnvelope struct {
+ Result AS112TimeseriesResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON as112TimeseriesResponseEnvelopeJSON `json:"-"`
+}
+
+// as112TimeseriesResponseEnvelopeJSON contains the JSON metadata for the struct
+// [AS112TimeseriesResponseEnvelope]
+type as112TimeseriesResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112TimeseriesResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112TimeseriesResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/radar/as112_test.go b/radar/as112_test.go
new file mode 100644
index 00000000000..b9980ee1df3
--- /dev/null
+++ b/radar/as112_test.go
@@ -0,0 +1,50 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/radar"
+)
+
+func TestAS112TimeseriesWithOptionalParams(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"),
+ )
+ _, err := client.Radar.AS112.Timeseries(context.TODO(), radar.AS112TimeseriesParams{
+ AggInterval: cloudflare.F(radar.AS112TimeseriesParamsAggInterval1h),
+ 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([]radar.AS112TimeseriesParamsDateRange{radar.AS112TimeseriesParamsDateRange1d, radar.AS112TimeseriesParamsDateRange2d, radar.AS112TimeseriesParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Format: cloudflare.F(radar.AS112TimeseriesParamsFormatJson),
+ 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/radar/as112summary.go b/radar/as112summary.go
new file mode 100644
index 00000000000..79f5eaa7797
--- /dev/null
+++ b/radar/as112summary.go
@@ -0,0 +1,1567 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "context"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// AS112SummaryService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewAS112SummaryService] method
+// instead.
+type AS112SummaryService struct {
+ Options []option.RequestOption
+}
+
+// NewAS112SummaryService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewAS112SummaryService(opts ...option.RequestOption) (r *AS112SummaryService) {
+ r = &AS112SummaryService{}
+ r.Options = opts
+ return
+}
+
+// Percentage distribution of DNS queries to AS112 by DNSSEC support.
+func (r *AS112SummaryService) DNSSEC(ctx context.Context, query AS112SummaryDNSSECParams, opts ...option.RequestOption) (res *AS112SummaryDNSSECResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AS112SummaryDNSSECResponseEnvelope
+ path := "radar/as112/summary/dnssec"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Percentage distribution of DNS queries, to AS112, by EDNS support.
+func (r *AS112SummaryService) Edns(ctx context.Context, query AS112SummaryEdnsParams, opts ...option.RequestOption) (res *AS112SummaryEdnsResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AS112SummaryEdnsResponseEnvelope
+ path := "radar/as112/summary/edns"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Percentage distribution of DNS queries to AS112 per IP Version.
+func (r *AS112SummaryService) IPVersion(ctx context.Context, query AS112SummaryIPVersionParams, opts ...option.RequestOption) (res *AS112SummaryIPVersionResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AS112SummaryIPVersionResponseEnvelope
+ path := "radar/as112/summary/ip_version"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Percentage distribution of DNS queries to AS112 per protocol.
+func (r *AS112SummaryService) Protocol(ctx context.Context, query AS112SummaryProtocolParams, opts ...option.RequestOption) (res *AS112SummaryProtocolResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AS112SummaryProtocolResponseEnvelope
+ path := "radar/as112/summary/protocol"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Percentage distribution of DNS queries to AS112 by Query Type.
+func (r *AS112SummaryService) QueryType(ctx context.Context, query AS112SummaryQueryTypeParams, opts ...option.RequestOption) (res *AS112SummaryQueryTypeResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AS112SummaryQueryTypeResponseEnvelope
+ path := "radar/as112/summary/query_type"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Percentage distribution of AS112 dns requests classified per Response Codes.
+func (r *AS112SummaryService) ResponseCodes(ctx context.Context, query AS112SummaryResponseCodesParams, opts ...option.RequestOption) (res *AS112SummaryResponseCodesResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AS112SummaryResponseCodesResponseEnvelope
+ path := "radar/as112/summary/response_codes"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type AS112SummaryDNSSECResponse struct {
+ Meta AS112SummaryDNSSECResponseMeta `json:"meta,required"`
+ Summary0 AS112SummaryDNSSECResponseSummary0 `json:"summary_0,required"`
+ JSON as112SummaryDNSSECResponseJSON `json:"-"`
+}
+
+// as112SummaryDNSSECResponseJSON contains the JSON metadata for the struct
+// [AS112SummaryDNSSECResponse]
+type as112SummaryDNSSECResponseJSON struct {
+ Meta apijson.Field
+ Summary0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112SummaryDNSSECResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112SummaryDNSSECResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112SummaryDNSSECResponseMeta struct {
+ DateRange []AS112SummaryDNSSECResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ Normalization string `json:"normalization,required"`
+ ConfidenceInfo AS112SummaryDNSSECResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON as112SummaryDNSSECResponseMetaJSON `json:"-"`
+}
+
+// as112SummaryDNSSECResponseMetaJSON contains the JSON metadata for the struct
+// [AS112SummaryDNSSECResponseMeta]
+type as112SummaryDNSSECResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ Normalization apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112SummaryDNSSECResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112SummaryDNSSECResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112SummaryDNSSECResponseMetaDateRange 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 as112SummaryDNSSECResponseMetaDateRangeJSON `json:"-"`
+}
+
+// as112SummaryDNSSECResponseMetaDateRangeJSON contains the JSON metadata for the
+// struct [AS112SummaryDNSSECResponseMetaDateRange]
+type as112SummaryDNSSECResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112SummaryDNSSECResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112SummaryDNSSECResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112SummaryDNSSECResponseMetaConfidenceInfo struct {
+ Annotations []AS112SummaryDNSSECResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON as112SummaryDNSSECResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// as112SummaryDNSSECResponseMetaConfidenceInfoJSON contains the JSON metadata for
+// the struct [AS112SummaryDNSSECResponseMetaConfidenceInfo]
+type as112SummaryDNSSECResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112SummaryDNSSECResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112SummaryDNSSECResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112SummaryDNSSECResponseMetaConfidenceInfoAnnotation 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 as112SummaryDNSSECResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// as112SummaryDNSSECResponseMetaConfidenceInfoAnnotationJSON contains the JSON
+// metadata for the struct [AS112SummaryDNSSECResponseMetaConfidenceInfoAnnotation]
+type as112SummaryDNSSECResponseMetaConfidenceInfoAnnotationJSON 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 *AS112SummaryDNSSECResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112SummaryDNSSECResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112SummaryDNSSECResponseSummary0 struct {
+ NotSupported string `json:"NOT_SUPPORTED,required"`
+ Supported string `json:"SUPPORTED,required"`
+ JSON as112SummaryDNSSECResponseSummary0JSON `json:"-"`
+}
+
+// as112SummaryDNSSECResponseSummary0JSON contains the JSON metadata for the struct
+// [AS112SummaryDNSSECResponseSummary0]
+type as112SummaryDNSSECResponseSummary0JSON struct {
+ NotSupported apijson.Field
+ Supported apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112SummaryDNSSECResponseSummary0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112SummaryDNSSECResponseSummary0JSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112SummaryEdnsResponse struct {
+ Meta AS112SummaryEdnsResponseMeta `json:"meta,required"`
+ Summary0 AS112SummaryEdnsResponseSummary0 `json:"summary_0,required"`
+ JSON as112SummaryEdnsResponseJSON `json:"-"`
+}
+
+// as112SummaryEdnsResponseJSON contains the JSON metadata for the struct
+// [AS112SummaryEdnsResponse]
+type as112SummaryEdnsResponseJSON struct {
+ Meta apijson.Field
+ Summary0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112SummaryEdnsResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112SummaryEdnsResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112SummaryEdnsResponseMeta struct {
+ DateRange []AS112SummaryEdnsResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ Normalization string `json:"normalization,required"`
+ ConfidenceInfo AS112SummaryEdnsResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON as112SummaryEdnsResponseMetaJSON `json:"-"`
+}
+
+// as112SummaryEdnsResponseMetaJSON contains the JSON metadata for the struct
+// [AS112SummaryEdnsResponseMeta]
+type as112SummaryEdnsResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ Normalization apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112SummaryEdnsResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112SummaryEdnsResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112SummaryEdnsResponseMetaDateRange 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 as112SummaryEdnsResponseMetaDateRangeJSON `json:"-"`
+}
+
+// as112SummaryEdnsResponseMetaDateRangeJSON contains the JSON metadata for the
+// struct [AS112SummaryEdnsResponseMetaDateRange]
+type as112SummaryEdnsResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112SummaryEdnsResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112SummaryEdnsResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112SummaryEdnsResponseMetaConfidenceInfo struct {
+ Annotations []AS112SummaryEdnsResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON as112SummaryEdnsResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// as112SummaryEdnsResponseMetaConfidenceInfoJSON contains the JSON metadata for
+// the struct [AS112SummaryEdnsResponseMetaConfidenceInfo]
+type as112SummaryEdnsResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112SummaryEdnsResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112SummaryEdnsResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112SummaryEdnsResponseMetaConfidenceInfoAnnotation 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 as112SummaryEdnsResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// as112SummaryEdnsResponseMetaConfidenceInfoAnnotationJSON contains the JSON
+// metadata for the struct [AS112SummaryEdnsResponseMetaConfidenceInfoAnnotation]
+type as112SummaryEdnsResponseMetaConfidenceInfoAnnotationJSON 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 *AS112SummaryEdnsResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112SummaryEdnsResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112SummaryEdnsResponseSummary0 struct {
+ NotSupported string `json:"NOT_SUPPORTED,required"`
+ Supported string `json:"SUPPORTED,required"`
+ JSON as112SummaryEdnsResponseSummary0JSON `json:"-"`
+}
+
+// as112SummaryEdnsResponseSummary0JSON contains the JSON metadata for the struct
+// [AS112SummaryEdnsResponseSummary0]
+type as112SummaryEdnsResponseSummary0JSON struct {
+ NotSupported apijson.Field
+ Supported apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112SummaryEdnsResponseSummary0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112SummaryEdnsResponseSummary0JSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112SummaryIPVersionResponse struct {
+ Meta AS112SummaryIPVersionResponseMeta `json:"meta,required"`
+ Summary0 AS112SummaryIPVersionResponseSummary0 `json:"summary_0,required"`
+ JSON as112SummaryIPVersionResponseJSON `json:"-"`
+}
+
+// as112SummaryIPVersionResponseJSON contains the JSON metadata for the struct
+// [AS112SummaryIPVersionResponse]
+type as112SummaryIPVersionResponseJSON struct {
+ Meta apijson.Field
+ Summary0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112SummaryIPVersionResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112SummaryIPVersionResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112SummaryIPVersionResponseMeta struct {
+ DateRange []AS112SummaryIPVersionResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ Normalization string `json:"normalization,required"`
+ ConfidenceInfo AS112SummaryIPVersionResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON as112SummaryIPVersionResponseMetaJSON `json:"-"`
+}
+
+// as112SummaryIPVersionResponseMetaJSON contains the JSON metadata for the struct
+// [AS112SummaryIPVersionResponseMeta]
+type as112SummaryIPVersionResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ Normalization apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112SummaryIPVersionResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112SummaryIPVersionResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112SummaryIPVersionResponseMetaDateRange 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 as112SummaryIPVersionResponseMetaDateRangeJSON `json:"-"`
+}
+
+// as112SummaryIPVersionResponseMetaDateRangeJSON contains the JSON metadata for
+// the struct [AS112SummaryIPVersionResponseMetaDateRange]
+type as112SummaryIPVersionResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112SummaryIPVersionResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112SummaryIPVersionResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112SummaryIPVersionResponseMetaConfidenceInfo struct {
+ Annotations []AS112SummaryIPVersionResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON as112SummaryIPVersionResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// as112SummaryIPVersionResponseMetaConfidenceInfoJSON contains the JSON metadata
+// for the struct [AS112SummaryIPVersionResponseMetaConfidenceInfo]
+type as112SummaryIPVersionResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112SummaryIPVersionResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112SummaryIPVersionResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112SummaryIPVersionResponseMetaConfidenceInfoAnnotation 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 as112SummaryIPVersionResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// as112SummaryIPVersionResponseMetaConfidenceInfoAnnotationJSON contains the JSON
+// metadata for the struct
+// [AS112SummaryIPVersionResponseMetaConfidenceInfoAnnotation]
+type as112SummaryIPVersionResponseMetaConfidenceInfoAnnotationJSON 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 *AS112SummaryIPVersionResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112SummaryIPVersionResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112SummaryIPVersionResponseSummary0 struct {
+ IPv4 string `json:"IPv4,required"`
+ IPv6 string `json:"IPv6,required"`
+ JSON as112SummaryIPVersionResponseSummary0JSON `json:"-"`
+}
+
+// as112SummaryIPVersionResponseSummary0JSON contains the JSON metadata for the
+// struct [AS112SummaryIPVersionResponseSummary0]
+type as112SummaryIPVersionResponseSummary0JSON struct {
+ IPv4 apijson.Field
+ IPv6 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112SummaryIPVersionResponseSummary0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112SummaryIPVersionResponseSummary0JSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112SummaryProtocolResponse struct {
+ Meta AS112SummaryProtocolResponseMeta `json:"meta,required"`
+ Summary0 AS112SummaryProtocolResponseSummary0 `json:"summary_0,required"`
+ JSON as112SummaryProtocolResponseJSON `json:"-"`
+}
+
+// as112SummaryProtocolResponseJSON contains the JSON metadata for the struct
+// [AS112SummaryProtocolResponse]
+type as112SummaryProtocolResponseJSON struct {
+ Meta apijson.Field
+ Summary0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112SummaryProtocolResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112SummaryProtocolResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112SummaryProtocolResponseMeta struct {
+ DateRange []AS112SummaryProtocolResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ Normalization string `json:"normalization,required"`
+ ConfidenceInfo AS112SummaryProtocolResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON as112SummaryProtocolResponseMetaJSON `json:"-"`
+}
+
+// as112SummaryProtocolResponseMetaJSON contains the JSON metadata for the struct
+// [AS112SummaryProtocolResponseMeta]
+type as112SummaryProtocolResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ Normalization apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112SummaryProtocolResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112SummaryProtocolResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112SummaryProtocolResponseMetaDateRange 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 as112SummaryProtocolResponseMetaDateRangeJSON `json:"-"`
+}
+
+// as112SummaryProtocolResponseMetaDateRangeJSON contains the JSON metadata for the
+// struct [AS112SummaryProtocolResponseMetaDateRange]
+type as112SummaryProtocolResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112SummaryProtocolResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112SummaryProtocolResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112SummaryProtocolResponseMetaConfidenceInfo struct {
+ Annotations []AS112SummaryProtocolResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON as112SummaryProtocolResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// as112SummaryProtocolResponseMetaConfidenceInfoJSON contains the JSON metadata
+// for the struct [AS112SummaryProtocolResponseMetaConfidenceInfo]
+type as112SummaryProtocolResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112SummaryProtocolResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112SummaryProtocolResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112SummaryProtocolResponseMetaConfidenceInfoAnnotation 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 as112SummaryProtocolResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// as112SummaryProtocolResponseMetaConfidenceInfoAnnotationJSON contains the JSON
+// metadata for the struct
+// [AS112SummaryProtocolResponseMetaConfidenceInfoAnnotation]
+type as112SummaryProtocolResponseMetaConfidenceInfoAnnotationJSON 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 *AS112SummaryProtocolResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112SummaryProtocolResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112SummaryProtocolResponseSummary0 struct {
+ Tcp string `json:"tcp,required"`
+ Udp string `json:"udp,required"`
+ JSON as112SummaryProtocolResponseSummary0JSON `json:"-"`
+}
+
+// as112SummaryProtocolResponseSummary0JSON contains the JSON metadata for the
+// struct [AS112SummaryProtocolResponseSummary0]
+type as112SummaryProtocolResponseSummary0JSON struct {
+ Tcp apijson.Field
+ Udp apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112SummaryProtocolResponseSummary0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112SummaryProtocolResponseSummary0JSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112SummaryQueryTypeResponse struct {
+ Meta AS112SummaryQueryTypeResponseMeta `json:"meta,required"`
+ Summary0 AS112SummaryQueryTypeResponseSummary0 `json:"summary_0,required"`
+ JSON as112SummaryQueryTypeResponseJSON `json:"-"`
+}
+
+// as112SummaryQueryTypeResponseJSON contains the JSON metadata for the struct
+// [AS112SummaryQueryTypeResponse]
+type as112SummaryQueryTypeResponseJSON struct {
+ Meta apijson.Field
+ Summary0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112SummaryQueryTypeResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112SummaryQueryTypeResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112SummaryQueryTypeResponseMeta struct {
+ DateRange []AS112SummaryQueryTypeResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ Normalization string `json:"normalization,required"`
+ ConfidenceInfo AS112SummaryQueryTypeResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON as112SummaryQueryTypeResponseMetaJSON `json:"-"`
+}
+
+// as112SummaryQueryTypeResponseMetaJSON contains the JSON metadata for the struct
+// [AS112SummaryQueryTypeResponseMeta]
+type as112SummaryQueryTypeResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ Normalization apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112SummaryQueryTypeResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112SummaryQueryTypeResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112SummaryQueryTypeResponseMetaDateRange 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 as112SummaryQueryTypeResponseMetaDateRangeJSON `json:"-"`
+}
+
+// as112SummaryQueryTypeResponseMetaDateRangeJSON contains the JSON metadata for
+// the struct [AS112SummaryQueryTypeResponseMetaDateRange]
+type as112SummaryQueryTypeResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112SummaryQueryTypeResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112SummaryQueryTypeResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112SummaryQueryTypeResponseMetaConfidenceInfo struct {
+ Annotations []AS112SummaryQueryTypeResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON as112SummaryQueryTypeResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// as112SummaryQueryTypeResponseMetaConfidenceInfoJSON contains the JSON metadata
+// for the struct [AS112SummaryQueryTypeResponseMetaConfidenceInfo]
+type as112SummaryQueryTypeResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112SummaryQueryTypeResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112SummaryQueryTypeResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112SummaryQueryTypeResponseMetaConfidenceInfoAnnotation 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 as112SummaryQueryTypeResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// as112SummaryQueryTypeResponseMetaConfidenceInfoAnnotationJSON contains the JSON
+// metadata for the struct
+// [AS112SummaryQueryTypeResponseMetaConfidenceInfoAnnotation]
+type as112SummaryQueryTypeResponseMetaConfidenceInfoAnnotationJSON 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 *AS112SummaryQueryTypeResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112SummaryQueryTypeResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112SummaryQueryTypeResponseSummary0 struct {
+ A string `json:"A,required"`
+ AAAA string `json:"AAAA,required"`
+ PTR string `json:"PTR,required"`
+ Soa string `json:"SOA,required"`
+ SRV string `json:"SRV,required"`
+ JSON as112SummaryQueryTypeResponseSummary0JSON `json:"-"`
+}
+
+// as112SummaryQueryTypeResponseSummary0JSON contains the JSON metadata for the
+// struct [AS112SummaryQueryTypeResponseSummary0]
+type as112SummaryQueryTypeResponseSummary0JSON struct {
+ A apijson.Field
+ AAAA apijson.Field
+ PTR apijson.Field
+ Soa apijson.Field
+ SRV apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112SummaryQueryTypeResponseSummary0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112SummaryQueryTypeResponseSummary0JSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112SummaryResponseCodesResponse struct {
+ Meta AS112SummaryResponseCodesResponseMeta `json:"meta,required"`
+ Summary0 AS112SummaryResponseCodesResponseSummary0 `json:"summary_0,required"`
+ JSON as112SummaryResponseCodesResponseJSON `json:"-"`
+}
+
+// as112SummaryResponseCodesResponseJSON contains the JSON metadata for the struct
+// [AS112SummaryResponseCodesResponse]
+type as112SummaryResponseCodesResponseJSON struct {
+ Meta apijson.Field
+ Summary0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112SummaryResponseCodesResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112SummaryResponseCodesResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112SummaryResponseCodesResponseMeta struct {
+ DateRange []AS112SummaryResponseCodesResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ Normalization string `json:"normalization,required"`
+ ConfidenceInfo AS112SummaryResponseCodesResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON as112SummaryResponseCodesResponseMetaJSON `json:"-"`
+}
+
+// as112SummaryResponseCodesResponseMetaJSON contains the JSON metadata for the
+// struct [AS112SummaryResponseCodesResponseMeta]
+type as112SummaryResponseCodesResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ Normalization apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112SummaryResponseCodesResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112SummaryResponseCodesResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112SummaryResponseCodesResponseMetaDateRange 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 as112SummaryResponseCodesResponseMetaDateRangeJSON `json:"-"`
+}
+
+// as112SummaryResponseCodesResponseMetaDateRangeJSON contains the JSON metadata
+// for the struct [AS112SummaryResponseCodesResponseMetaDateRange]
+type as112SummaryResponseCodesResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112SummaryResponseCodesResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112SummaryResponseCodesResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112SummaryResponseCodesResponseMetaConfidenceInfo struct {
+ Annotations []AS112SummaryResponseCodesResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON as112SummaryResponseCodesResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// as112SummaryResponseCodesResponseMetaConfidenceInfoJSON contains the JSON
+// metadata for the struct [AS112SummaryResponseCodesResponseMetaConfidenceInfo]
+type as112SummaryResponseCodesResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112SummaryResponseCodesResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112SummaryResponseCodesResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112SummaryResponseCodesResponseMetaConfidenceInfoAnnotation 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 as112SummaryResponseCodesResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// as112SummaryResponseCodesResponseMetaConfidenceInfoAnnotationJSON contains the
+// JSON metadata for the struct
+// [AS112SummaryResponseCodesResponseMetaConfidenceInfoAnnotation]
+type as112SummaryResponseCodesResponseMetaConfidenceInfoAnnotationJSON 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 *AS112SummaryResponseCodesResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112SummaryResponseCodesResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112SummaryResponseCodesResponseSummary0 struct {
+ Noerror string `json:"NOERROR,required"`
+ Nxdomain string `json:"NXDOMAIN,required"`
+ JSON as112SummaryResponseCodesResponseSummary0JSON `json:"-"`
+}
+
+// as112SummaryResponseCodesResponseSummary0JSON contains the JSON metadata for the
+// struct [AS112SummaryResponseCodesResponseSummary0]
+type as112SummaryResponseCodesResponseSummary0JSON struct {
+ Noerror apijson.Field
+ Nxdomain apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112SummaryResponseCodesResponseSummary0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112SummaryResponseCodesResponseSummary0JSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112SummaryDNSSECParams struct {
+ // Array of comma separated list of ASNs, start with `-` to exclude from results.
+ // For example, `-174, 3356` excludes results from AS174, but includes results from
+ // 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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]AS112SummaryDNSSECParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Format results are returned in.
+ Format param.Field[AS112SummaryDNSSECParamsFormat] `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"`
+}
+
+// URLQuery serializes [AS112SummaryDNSSECParams]'s query parameters as
+// `url.Values`.
+func (r AS112SummaryDNSSECParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type AS112SummaryDNSSECParamsDateRange string
+
+const (
+ AS112SummaryDNSSECParamsDateRange1d AS112SummaryDNSSECParamsDateRange = "1d"
+ AS112SummaryDNSSECParamsDateRange2d AS112SummaryDNSSECParamsDateRange = "2d"
+ AS112SummaryDNSSECParamsDateRange7d AS112SummaryDNSSECParamsDateRange = "7d"
+ AS112SummaryDNSSECParamsDateRange14d AS112SummaryDNSSECParamsDateRange = "14d"
+ AS112SummaryDNSSECParamsDateRange28d AS112SummaryDNSSECParamsDateRange = "28d"
+ AS112SummaryDNSSECParamsDateRange12w AS112SummaryDNSSECParamsDateRange = "12w"
+ AS112SummaryDNSSECParamsDateRange24w AS112SummaryDNSSECParamsDateRange = "24w"
+ AS112SummaryDNSSECParamsDateRange52w AS112SummaryDNSSECParamsDateRange = "52w"
+ AS112SummaryDNSSECParamsDateRange1dControl AS112SummaryDNSSECParamsDateRange = "1dControl"
+ AS112SummaryDNSSECParamsDateRange2dControl AS112SummaryDNSSECParamsDateRange = "2dControl"
+ AS112SummaryDNSSECParamsDateRange7dControl AS112SummaryDNSSECParamsDateRange = "7dControl"
+ AS112SummaryDNSSECParamsDateRange14dControl AS112SummaryDNSSECParamsDateRange = "14dControl"
+ AS112SummaryDNSSECParamsDateRange28dControl AS112SummaryDNSSECParamsDateRange = "28dControl"
+ AS112SummaryDNSSECParamsDateRange12wControl AS112SummaryDNSSECParamsDateRange = "12wControl"
+ AS112SummaryDNSSECParamsDateRange24wControl AS112SummaryDNSSECParamsDateRange = "24wControl"
+)
+
+// Format results are returned in.
+type AS112SummaryDNSSECParamsFormat string
+
+const (
+ AS112SummaryDNSSECParamsFormatJson AS112SummaryDNSSECParamsFormat = "JSON"
+ AS112SummaryDNSSECParamsFormatCsv AS112SummaryDNSSECParamsFormat = "CSV"
+)
+
+type AS112SummaryDNSSECResponseEnvelope struct {
+ Result AS112SummaryDNSSECResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON as112SummaryDNSSECResponseEnvelopeJSON `json:"-"`
+}
+
+// as112SummaryDNSSECResponseEnvelopeJSON contains the JSON metadata for the struct
+// [AS112SummaryDNSSECResponseEnvelope]
+type as112SummaryDNSSECResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112SummaryDNSSECResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112SummaryDNSSECResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112SummaryEdnsParams 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"`
+ // 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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]AS112SummaryEdnsParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Format results are returned in.
+ Format param.Field[AS112SummaryEdnsParamsFormat] `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"`
+}
+
+// URLQuery serializes [AS112SummaryEdnsParams]'s query parameters as `url.Values`.
+func (r AS112SummaryEdnsParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type AS112SummaryEdnsParamsDateRange string
+
+const (
+ AS112SummaryEdnsParamsDateRange1d AS112SummaryEdnsParamsDateRange = "1d"
+ AS112SummaryEdnsParamsDateRange2d AS112SummaryEdnsParamsDateRange = "2d"
+ AS112SummaryEdnsParamsDateRange7d AS112SummaryEdnsParamsDateRange = "7d"
+ AS112SummaryEdnsParamsDateRange14d AS112SummaryEdnsParamsDateRange = "14d"
+ AS112SummaryEdnsParamsDateRange28d AS112SummaryEdnsParamsDateRange = "28d"
+ AS112SummaryEdnsParamsDateRange12w AS112SummaryEdnsParamsDateRange = "12w"
+ AS112SummaryEdnsParamsDateRange24w AS112SummaryEdnsParamsDateRange = "24w"
+ AS112SummaryEdnsParamsDateRange52w AS112SummaryEdnsParamsDateRange = "52w"
+ AS112SummaryEdnsParamsDateRange1dControl AS112SummaryEdnsParamsDateRange = "1dControl"
+ AS112SummaryEdnsParamsDateRange2dControl AS112SummaryEdnsParamsDateRange = "2dControl"
+ AS112SummaryEdnsParamsDateRange7dControl AS112SummaryEdnsParamsDateRange = "7dControl"
+ AS112SummaryEdnsParamsDateRange14dControl AS112SummaryEdnsParamsDateRange = "14dControl"
+ AS112SummaryEdnsParamsDateRange28dControl AS112SummaryEdnsParamsDateRange = "28dControl"
+ AS112SummaryEdnsParamsDateRange12wControl AS112SummaryEdnsParamsDateRange = "12wControl"
+ AS112SummaryEdnsParamsDateRange24wControl AS112SummaryEdnsParamsDateRange = "24wControl"
+)
+
+// Format results are returned in.
+type AS112SummaryEdnsParamsFormat string
+
+const (
+ AS112SummaryEdnsParamsFormatJson AS112SummaryEdnsParamsFormat = "JSON"
+ AS112SummaryEdnsParamsFormatCsv AS112SummaryEdnsParamsFormat = "CSV"
+)
+
+type AS112SummaryEdnsResponseEnvelope struct {
+ Result AS112SummaryEdnsResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON as112SummaryEdnsResponseEnvelopeJSON `json:"-"`
+}
+
+// as112SummaryEdnsResponseEnvelopeJSON contains the JSON metadata for the struct
+// [AS112SummaryEdnsResponseEnvelope]
+type as112SummaryEdnsResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112SummaryEdnsResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112SummaryEdnsResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112SummaryIPVersionParams 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"`
+ // 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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]AS112SummaryIPVersionParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Format results are returned in.
+ Format param.Field[AS112SummaryIPVersionParamsFormat] `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"`
+}
+
+// URLQuery serializes [AS112SummaryIPVersionParams]'s query parameters as
+// `url.Values`.
+func (r AS112SummaryIPVersionParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type AS112SummaryIPVersionParamsDateRange string
+
+const (
+ AS112SummaryIPVersionParamsDateRange1d AS112SummaryIPVersionParamsDateRange = "1d"
+ AS112SummaryIPVersionParamsDateRange2d AS112SummaryIPVersionParamsDateRange = "2d"
+ AS112SummaryIPVersionParamsDateRange7d AS112SummaryIPVersionParamsDateRange = "7d"
+ AS112SummaryIPVersionParamsDateRange14d AS112SummaryIPVersionParamsDateRange = "14d"
+ AS112SummaryIPVersionParamsDateRange28d AS112SummaryIPVersionParamsDateRange = "28d"
+ AS112SummaryIPVersionParamsDateRange12w AS112SummaryIPVersionParamsDateRange = "12w"
+ AS112SummaryIPVersionParamsDateRange24w AS112SummaryIPVersionParamsDateRange = "24w"
+ AS112SummaryIPVersionParamsDateRange52w AS112SummaryIPVersionParamsDateRange = "52w"
+ AS112SummaryIPVersionParamsDateRange1dControl AS112SummaryIPVersionParamsDateRange = "1dControl"
+ AS112SummaryIPVersionParamsDateRange2dControl AS112SummaryIPVersionParamsDateRange = "2dControl"
+ AS112SummaryIPVersionParamsDateRange7dControl AS112SummaryIPVersionParamsDateRange = "7dControl"
+ AS112SummaryIPVersionParamsDateRange14dControl AS112SummaryIPVersionParamsDateRange = "14dControl"
+ AS112SummaryIPVersionParamsDateRange28dControl AS112SummaryIPVersionParamsDateRange = "28dControl"
+ AS112SummaryIPVersionParamsDateRange12wControl AS112SummaryIPVersionParamsDateRange = "12wControl"
+ AS112SummaryIPVersionParamsDateRange24wControl AS112SummaryIPVersionParamsDateRange = "24wControl"
+)
+
+// Format results are returned in.
+type AS112SummaryIPVersionParamsFormat string
+
+const (
+ AS112SummaryIPVersionParamsFormatJson AS112SummaryIPVersionParamsFormat = "JSON"
+ AS112SummaryIPVersionParamsFormatCsv AS112SummaryIPVersionParamsFormat = "CSV"
+)
+
+type AS112SummaryIPVersionResponseEnvelope struct {
+ Result AS112SummaryIPVersionResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON as112SummaryIPVersionResponseEnvelopeJSON `json:"-"`
+}
+
+// as112SummaryIPVersionResponseEnvelopeJSON contains the JSON metadata for the
+// struct [AS112SummaryIPVersionResponseEnvelope]
+type as112SummaryIPVersionResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112SummaryIPVersionResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112SummaryIPVersionResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112SummaryProtocolParams 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"`
+ // 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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]AS112SummaryProtocolParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Format results are returned in.
+ Format param.Field[AS112SummaryProtocolParamsFormat] `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"`
+}
+
+// URLQuery serializes [AS112SummaryProtocolParams]'s query parameters as
+// `url.Values`.
+func (r AS112SummaryProtocolParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type AS112SummaryProtocolParamsDateRange string
+
+const (
+ AS112SummaryProtocolParamsDateRange1d AS112SummaryProtocolParamsDateRange = "1d"
+ AS112SummaryProtocolParamsDateRange2d AS112SummaryProtocolParamsDateRange = "2d"
+ AS112SummaryProtocolParamsDateRange7d AS112SummaryProtocolParamsDateRange = "7d"
+ AS112SummaryProtocolParamsDateRange14d AS112SummaryProtocolParamsDateRange = "14d"
+ AS112SummaryProtocolParamsDateRange28d AS112SummaryProtocolParamsDateRange = "28d"
+ AS112SummaryProtocolParamsDateRange12w AS112SummaryProtocolParamsDateRange = "12w"
+ AS112SummaryProtocolParamsDateRange24w AS112SummaryProtocolParamsDateRange = "24w"
+ AS112SummaryProtocolParamsDateRange52w AS112SummaryProtocolParamsDateRange = "52w"
+ AS112SummaryProtocolParamsDateRange1dControl AS112SummaryProtocolParamsDateRange = "1dControl"
+ AS112SummaryProtocolParamsDateRange2dControl AS112SummaryProtocolParamsDateRange = "2dControl"
+ AS112SummaryProtocolParamsDateRange7dControl AS112SummaryProtocolParamsDateRange = "7dControl"
+ AS112SummaryProtocolParamsDateRange14dControl AS112SummaryProtocolParamsDateRange = "14dControl"
+ AS112SummaryProtocolParamsDateRange28dControl AS112SummaryProtocolParamsDateRange = "28dControl"
+ AS112SummaryProtocolParamsDateRange12wControl AS112SummaryProtocolParamsDateRange = "12wControl"
+ AS112SummaryProtocolParamsDateRange24wControl AS112SummaryProtocolParamsDateRange = "24wControl"
+)
+
+// Format results are returned in.
+type AS112SummaryProtocolParamsFormat string
+
+const (
+ AS112SummaryProtocolParamsFormatJson AS112SummaryProtocolParamsFormat = "JSON"
+ AS112SummaryProtocolParamsFormatCsv AS112SummaryProtocolParamsFormat = "CSV"
+)
+
+type AS112SummaryProtocolResponseEnvelope struct {
+ Result AS112SummaryProtocolResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON as112SummaryProtocolResponseEnvelopeJSON `json:"-"`
+}
+
+// as112SummaryProtocolResponseEnvelopeJSON contains the JSON metadata for the
+// struct [AS112SummaryProtocolResponseEnvelope]
+type as112SummaryProtocolResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112SummaryProtocolResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112SummaryProtocolResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112SummaryQueryTypeParams 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"`
+ // 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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]AS112SummaryQueryTypeParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Format results are returned in.
+ Format param.Field[AS112SummaryQueryTypeParamsFormat] `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"`
+}
+
+// URLQuery serializes [AS112SummaryQueryTypeParams]'s query parameters as
+// `url.Values`.
+func (r AS112SummaryQueryTypeParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type AS112SummaryQueryTypeParamsDateRange string
+
+const (
+ AS112SummaryQueryTypeParamsDateRange1d AS112SummaryQueryTypeParamsDateRange = "1d"
+ AS112SummaryQueryTypeParamsDateRange2d AS112SummaryQueryTypeParamsDateRange = "2d"
+ AS112SummaryQueryTypeParamsDateRange7d AS112SummaryQueryTypeParamsDateRange = "7d"
+ AS112SummaryQueryTypeParamsDateRange14d AS112SummaryQueryTypeParamsDateRange = "14d"
+ AS112SummaryQueryTypeParamsDateRange28d AS112SummaryQueryTypeParamsDateRange = "28d"
+ AS112SummaryQueryTypeParamsDateRange12w AS112SummaryQueryTypeParamsDateRange = "12w"
+ AS112SummaryQueryTypeParamsDateRange24w AS112SummaryQueryTypeParamsDateRange = "24w"
+ AS112SummaryQueryTypeParamsDateRange52w AS112SummaryQueryTypeParamsDateRange = "52w"
+ AS112SummaryQueryTypeParamsDateRange1dControl AS112SummaryQueryTypeParamsDateRange = "1dControl"
+ AS112SummaryQueryTypeParamsDateRange2dControl AS112SummaryQueryTypeParamsDateRange = "2dControl"
+ AS112SummaryQueryTypeParamsDateRange7dControl AS112SummaryQueryTypeParamsDateRange = "7dControl"
+ AS112SummaryQueryTypeParamsDateRange14dControl AS112SummaryQueryTypeParamsDateRange = "14dControl"
+ AS112SummaryQueryTypeParamsDateRange28dControl AS112SummaryQueryTypeParamsDateRange = "28dControl"
+ AS112SummaryQueryTypeParamsDateRange12wControl AS112SummaryQueryTypeParamsDateRange = "12wControl"
+ AS112SummaryQueryTypeParamsDateRange24wControl AS112SummaryQueryTypeParamsDateRange = "24wControl"
+)
+
+// Format results are returned in.
+type AS112SummaryQueryTypeParamsFormat string
+
+const (
+ AS112SummaryQueryTypeParamsFormatJson AS112SummaryQueryTypeParamsFormat = "JSON"
+ AS112SummaryQueryTypeParamsFormatCsv AS112SummaryQueryTypeParamsFormat = "CSV"
+)
+
+type AS112SummaryQueryTypeResponseEnvelope struct {
+ Result AS112SummaryQueryTypeResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON as112SummaryQueryTypeResponseEnvelopeJSON `json:"-"`
+}
+
+// as112SummaryQueryTypeResponseEnvelopeJSON contains the JSON metadata for the
+// struct [AS112SummaryQueryTypeResponseEnvelope]
+type as112SummaryQueryTypeResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112SummaryQueryTypeResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112SummaryQueryTypeResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112SummaryResponseCodesParams 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"`
+ // 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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]AS112SummaryResponseCodesParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Format results are returned in.
+ Format param.Field[AS112SummaryResponseCodesParamsFormat] `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"`
+}
+
+// URLQuery serializes [AS112SummaryResponseCodesParams]'s query parameters as
+// `url.Values`.
+func (r AS112SummaryResponseCodesParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type AS112SummaryResponseCodesParamsDateRange string
+
+const (
+ AS112SummaryResponseCodesParamsDateRange1d AS112SummaryResponseCodesParamsDateRange = "1d"
+ AS112SummaryResponseCodesParamsDateRange2d AS112SummaryResponseCodesParamsDateRange = "2d"
+ AS112SummaryResponseCodesParamsDateRange7d AS112SummaryResponseCodesParamsDateRange = "7d"
+ AS112SummaryResponseCodesParamsDateRange14d AS112SummaryResponseCodesParamsDateRange = "14d"
+ AS112SummaryResponseCodesParamsDateRange28d AS112SummaryResponseCodesParamsDateRange = "28d"
+ AS112SummaryResponseCodesParamsDateRange12w AS112SummaryResponseCodesParamsDateRange = "12w"
+ AS112SummaryResponseCodesParamsDateRange24w AS112SummaryResponseCodesParamsDateRange = "24w"
+ AS112SummaryResponseCodesParamsDateRange52w AS112SummaryResponseCodesParamsDateRange = "52w"
+ AS112SummaryResponseCodesParamsDateRange1dControl AS112SummaryResponseCodesParamsDateRange = "1dControl"
+ AS112SummaryResponseCodesParamsDateRange2dControl AS112SummaryResponseCodesParamsDateRange = "2dControl"
+ AS112SummaryResponseCodesParamsDateRange7dControl AS112SummaryResponseCodesParamsDateRange = "7dControl"
+ AS112SummaryResponseCodesParamsDateRange14dControl AS112SummaryResponseCodesParamsDateRange = "14dControl"
+ AS112SummaryResponseCodesParamsDateRange28dControl AS112SummaryResponseCodesParamsDateRange = "28dControl"
+ AS112SummaryResponseCodesParamsDateRange12wControl AS112SummaryResponseCodesParamsDateRange = "12wControl"
+ AS112SummaryResponseCodesParamsDateRange24wControl AS112SummaryResponseCodesParamsDateRange = "24wControl"
+)
+
+// Format results are returned in.
+type AS112SummaryResponseCodesParamsFormat string
+
+const (
+ AS112SummaryResponseCodesParamsFormatJson AS112SummaryResponseCodesParamsFormat = "JSON"
+ AS112SummaryResponseCodesParamsFormatCsv AS112SummaryResponseCodesParamsFormat = "CSV"
+)
+
+type AS112SummaryResponseCodesResponseEnvelope struct {
+ Result AS112SummaryResponseCodesResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON as112SummaryResponseCodesResponseEnvelopeJSON `json:"-"`
+}
+
+// as112SummaryResponseCodesResponseEnvelopeJSON contains the JSON metadata for the
+// struct [AS112SummaryResponseCodesResponseEnvelope]
+type as112SummaryResponseCodesResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112SummaryResponseCodesResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112SummaryResponseCodesResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/radar/as112summary_test.go b/radar/as112summary_test.go
new file mode 100644
index 00000000000..d7e1ca2cb00
--- /dev/null
+++ b/radar/as112summary_test.go
@@ -0,0 +1,214 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/radar"
+)
+
+func TestAS112SummaryDNSSECWithOptionalParams(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"),
+ )
+ _, err := client.Radar.AS112.Summary.DNSSEC(context.TODO(), radar.AS112SummaryDNSSECParams{
+ 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([]radar.AS112SummaryDNSSECParamsDateRange{radar.AS112SummaryDNSSECParamsDateRange1d, radar.AS112SummaryDNSSECParamsDateRange2d, radar.AS112SummaryDNSSECParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Format: cloudflare.F(radar.AS112SummaryDNSSECParamsFormatJson),
+ 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())
+ }
+}
+
+func TestAS112SummaryEdnsWithOptionalParams(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"),
+ )
+ _, err := client.Radar.AS112.Summary.Edns(context.TODO(), radar.AS112SummaryEdnsParams{
+ 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([]radar.AS112SummaryEdnsParamsDateRange{radar.AS112SummaryEdnsParamsDateRange1d, radar.AS112SummaryEdnsParamsDateRange2d, radar.AS112SummaryEdnsParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Format: cloudflare.F(radar.AS112SummaryEdnsParamsFormatJson),
+ 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())
+ }
+}
+
+func TestAS112SummaryIPVersionWithOptionalParams(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"),
+ )
+ _, err := client.Radar.AS112.Summary.IPVersion(context.TODO(), radar.AS112SummaryIPVersionParams{
+ 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([]radar.AS112SummaryIPVersionParamsDateRange{radar.AS112SummaryIPVersionParamsDateRange1d, radar.AS112SummaryIPVersionParamsDateRange2d, radar.AS112SummaryIPVersionParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Format: cloudflare.F(radar.AS112SummaryIPVersionParamsFormatJson),
+ 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())
+ }
+}
+
+func TestAS112SummaryProtocolWithOptionalParams(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"),
+ )
+ _, err := client.Radar.AS112.Summary.Protocol(context.TODO(), radar.AS112SummaryProtocolParams{
+ 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([]radar.AS112SummaryProtocolParamsDateRange{radar.AS112SummaryProtocolParamsDateRange1d, radar.AS112SummaryProtocolParamsDateRange2d, radar.AS112SummaryProtocolParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Format: cloudflare.F(radar.AS112SummaryProtocolParamsFormatJson),
+ 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())
+ }
+}
+
+func TestAS112SummaryQueryTypeWithOptionalParams(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"),
+ )
+ _, err := client.Radar.AS112.Summary.QueryType(context.TODO(), radar.AS112SummaryQueryTypeParams{
+ 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([]radar.AS112SummaryQueryTypeParamsDateRange{radar.AS112SummaryQueryTypeParamsDateRange1d, radar.AS112SummaryQueryTypeParamsDateRange2d, radar.AS112SummaryQueryTypeParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Format: cloudflare.F(radar.AS112SummaryQueryTypeParamsFormatJson),
+ 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())
+ }
+}
+
+func TestAS112SummaryResponseCodesWithOptionalParams(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"),
+ )
+ _, err := client.Radar.AS112.Summary.ResponseCodes(context.TODO(), radar.AS112SummaryResponseCodesParams{
+ 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([]radar.AS112SummaryResponseCodesParamsDateRange{radar.AS112SummaryResponseCodesParamsDateRange1d, radar.AS112SummaryResponseCodesParamsDateRange2d, radar.AS112SummaryResponseCodesParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Format: cloudflare.F(radar.AS112SummaryResponseCodesParamsFormatJson),
+ 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/radar/as112timeseriesgroup.go b/radar/as112timeseriesgroup.go
new file mode 100644
index 00000000000..6102f731088
--- /dev/null
+++ b/radar/as112timeseriesgroup.go
@@ -0,0 +1,1013 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "context"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// AS112TimeseriesGroupService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewAS112TimeseriesGroupService]
+// method instead.
+type AS112TimeseriesGroupService struct {
+ Options []option.RequestOption
+}
+
+// NewAS112TimeseriesGroupService generates a new service that applies the given
+// options to each request. These options are applied after the parent client's
+// options (if there is one), and before any request-specific options.
+func NewAS112TimeseriesGroupService(opts ...option.RequestOption) (r *AS112TimeseriesGroupService) {
+ r = &AS112TimeseriesGroupService{}
+ r.Options = opts
+ return
+}
+
+// Percentage distribution of DNS AS112 queries by DNSSEC support over time.
+func (r *AS112TimeseriesGroupService) DNSSEC(ctx context.Context, query AS112TimeseriesGroupDNSSECParams, opts ...option.RequestOption) (res *AS112TimeseriesGroupDNSSECResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AS112TimeseriesGroupDNSSECResponseEnvelope
+ path := "radar/as112/timeseries_groups/dnssec"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Percentage distribution of AS112 DNS queries by EDNS support over time.
+func (r *AS112TimeseriesGroupService) Edns(ctx context.Context, query AS112TimeseriesGroupEdnsParams, opts ...option.RequestOption) (res *AS112TimeseriesGroupEdnsResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AS112TimeseriesGroupEdnsResponseEnvelope
+ path := "radar/as112/timeseries_groups/edns"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Percentage distribution of AS112 DNS queries by IP Version over time.
+func (r *AS112TimeseriesGroupService) IPVersion(ctx context.Context, query AS112TimeseriesGroupIPVersionParams, opts ...option.RequestOption) (res *AS112TimeseriesGroupIPVersionResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AS112TimeseriesGroupIPVersionResponseEnvelope
+ path := "radar/as112/timeseries_groups/ip_version"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Percentage distribution of AS112 dns requests classified per Protocol over time.
+func (r *AS112TimeseriesGroupService) Protocol(ctx context.Context, query AS112TimeseriesGroupProtocolParams, opts ...option.RequestOption) (res *AS112TimeseriesGroupProtocolResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AS112TimeseriesGroupProtocolResponseEnvelope
+ path := "radar/as112/timeseries_groups/protocol"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Percentage distribution of AS112 DNS queries by Query Type over time.
+func (r *AS112TimeseriesGroupService) QueryType(ctx context.Context, query AS112TimeseriesGroupQueryTypeParams, opts ...option.RequestOption) (res *AS112TimeseriesGroupQueryTypeResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AS112TimeseriesGroupQueryTypeResponseEnvelope
+ path := "radar/as112/timeseries_groups/query_type"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Percentage distribution of AS112 dns requests classified per Response Codes over
+// time.
+func (r *AS112TimeseriesGroupService) ResponseCodes(ctx context.Context, query AS112TimeseriesGroupResponseCodesParams, opts ...option.RequestOption) (res *AS112TimeseriesGroupResponseCodesResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AS112TimeseriesGroupResponseCodesResponseEnvelope
+ path := "radar/as112/timeseries_groups/response_codes"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type AS112TimeseriesGroupDNSSECResponse struct {
+ Meta interface{} `json:"meta,required"`
+ Serie0 AS112TimeseriesGroupDNSSECResponseSerie0 `json:"serie_0,required"`
+ JSON as112TimeseriesGroupDNSSECResponseJSON `json:"-"`
+}
+
+// as112TimeseriesGroupDNSSECResponseJSON contains the JSON metadata for the struct
+// [AS112TimeseriesGroupDNSSECResponse]
+type as112TimeseriesGroupDNSSECResponseJSON struct {
+ Meta apijson.Field
+ Serie0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112TimeseriesGroupDNSSECResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112TimeseriesGroupDNSSECResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112TimeseriesGroupDNSSECResponseSerie0 struct {
+ NotSupported []string `json:"NOT_SUPPORTED,required"`
+ Supported []string `json:"SUPPORTED,required"`
+ JSON as112TimeseriesGroupDNSSECResponseSerie0JSON `json:"-"`
+}
+
+// as112TimeseriesGroupDNSSECResponseSerie0JSON contains the JSON metadata for the
+// struct [AS112TimeseriesGroupDNSSECResponseSerie0]
+type as112TimeseriesGroupDNSSECResponseSerie0JSON struct {
+ NotSupported apijson.Field
+ Supported apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112TimeseriesGroupDNSSECResponseSerie0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112TimeseriesGroupDNSSECResponseSerie0JSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112TimeseriesGroupEdnsResponse struct {
+ Meta interface{} `json:"meta,required"`
+ Serie0 AS112TimeseriesGroupEdnsResponseSerie0 `json:"serie_0,required"`
+ JSON as112TimeseriesGroupEdnsResponseJSON `json:"-"`
+}
+
+// as112TimeseriesGroupEdnsResponseJSON contains the JSON metadata for the struct
+// [AS112TimeseriesGroupEdnsResponse]
+type as112TimeseriesGroupEdnsResponseJSON struct {
+ Meta apijson.Field
+ Serie0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112TimeseriesGroupEdnsResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112TimeseriesGroupEdnsResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112TimeseriesGroupEdnsResponseSerie0 struct {
+ NotSupported []string `json:"NOT_SUPPORTED,required"`
+ Supported []string `json:"SUPPORTED,required"`
+ JSON as112TimeseriesGroupEdnsResponseSerie0JSON `json:"-"`
+}
+
+// as112TimeseriesGroupEdnsResponseSerie0JSON contains the JSON metadata for the
+// struct [AS112TimeseriesGroupEdnsResponseSerie0]
+type as112TimeseriesGroupEdnsResponseSerie0JSON struct {
+ NotSupported apijson.Field
+ Supported apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112TimeseriesGroupEdnsResponseSerie0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112TimeseriesGroupEdnsResponseSerie0JSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112TimeseriesGroupIPVersionResponse struct {
+ Meta interface{} `json:"meta,required"`
+ Serie0 AS112TimeseriesGroupIPVersionResponseSerie0 `json:"serie_0,required"`
+ JSON as112TimeseriesGroupIPVersionResponseJSON `json:"-"`
+}
+
+// as112TimeseriesGroupIPVersionResponseJSON contains the JSON metadata for the
+// struct [AS112TimeseriesGroupIPVersionResponse]
+type as112TimeseriesGroupIPVersionResponseJSON struct {
+ Meta apijson.Field
+ Serie0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112TimeseriesGroupIPVersionResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112TimeseriesGroupIPVersionResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112TimeseriesGroupIPVersionResponseSerie0 struct {
+ IPv4 []string `json:"IPv4,required"`
+ IPv6 []string `json:"IPv6,required"`
+ JSON as112TimeseriesGroupIPVersionResponseSerie0JSON `json:"-"`
+}
+
+// as112TimeseriesGroupIPVersionResponseSerie0JSON contains the JSON metadata for
+// the struct [AS112TimeseriesGroupIPVersionResponseSerie0]
+type as112TimeseriesGroupIPVersionResponseSerie0JSON struct {
+ IPv4 apijson.Field
+ IPv6 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112TimeseriesGroupIPVersionResponseSerie0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112TimeseriesGroupIPVersionResponseSerie0JSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112TimeseriesGroupProtocolResponse struct {
+ Meta interface{} `json:"meta,required"`
+ Serie0 AS112TimeseriesGroupProtocolResponseSerie0 `json:"serie_0,required"`
+ JSON as112TimeseriesGroupProtocolResponseJSON `json:"-"`
+}
+
+// as112TimeseriesGroupProtocolResponseJSON contains the JSON metadata for the
+// struct [AS112TimeseriesGroupProtocolResponse]
+type as112TimeseriesGroupProtocolResponseJSON struct {
+ Meta apijson.Field
+ Serie0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112TimeseriesGroupProtocolResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112TimeseriesGroupProtocolResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112TimeseriesGroupProtocolResponseSerie0 struct {
+ Tcp []string `json:"tcp,required"`
+ Udp []string `json:"udp,required"`
+ JSON as112TimeseriesGroupProtocolResponseSerie0JSON `json:"-"`
+}
+
+// as112TimeseriesGroupProtocolResponseSerie0JSON contains the JSON metadata for
+// the struct [AS112TimeseriesGroupProtocolResponseSerie0]
+type as112TimeseriesGroupProtocolResponseSerie0JSON struct {
+ Tcp apijson.Field
+ Udp apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112TimeseriesGroupProtocolResponseSerie0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112TimeseriesGroupProtocolResponseSerie0JSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112TimeseriesGroupQueryTypeResponse struct {
+ Meta interface{} `json:"meta,required"`
+ Serie0 AS112TimeseriesGroupQueryTypeResponseSerie0 `json:"serie_0,required"`
+ JSON as112TimeseriesGroupQueryTypeResponseJSON `json:"-"`
+}
+
+// as112TimeseriesGroupQueryTypeResponseJSON contains the JSON metadata for the
+// struct [AS112TimeseriesGroupQueryTypeResponse]
+type as112TimeseriesGroupQueryTypeResponseJSON struct {
+ Meta apijson.Field
+ Serie0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112TimeseriesGroupQueryTypeResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112TimeseriesGroupQueryTypeResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112TimeseriesGroupQueryTypeResponseSerie0 struct {
+ A []string `json:"A,required"`
+ AAAA []string `json:"AAAA,required"`
+ PTR []string `json:"PTR,required"`
+ Soa []string `json:"SOA,required"`
+ SRV []string `json:"SRV,required"`
+ JSON as112TimeseriesGroupQueryTypeResponseSerie0JSON `json:"-"`
+}
+
+// as112TimeseriesGroupQueryTypeResponseSerie0JSON contains the JSON metadata for
+// the struct [AS112TimeseriesGroupQueryTypeResponseSerie0]
+type as112TimeseriesGroupQueryTypeResponseSerie0JSON struct {
+ A apijson.Field
+ AAAA apijson.Field
+ PTR apijson.Field
+ Soa apijson.Field
+ SRV apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112TimeseriesGroupQueryTypeResponseSerie0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112TimeseriesGroupQueryTypeResponseSerie0JSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112TimeseriesGroupResponseCodesResponse struct {
+ Meta interface{} `json:"meta,required"`
+ Serie0 AS112TimeseriesGroupResponseCodesResponseSerie0 `json:"serie_0,required"`
+ JSON as112TimeseriesGroupResponseCodesResponseJSON `json:"-"`
+}
+
+// as112TimeseriesGroupResponseCodesResponseJSON contains the JSON metadata for the
+// struct [AS112TimeseriesGroupResponseCodesResponse]
+type as112TimeseriesGroupResponseCodesResponseJSON struct {
+ Meta apijson.Field
+ Serie0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112TimeseriesGroupResponseCodesResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112TimeseriesGroupResponseCodesResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112TimeseriesGroupResponseCodesResponseSerie0 struct {
+ Noerror []string `json:"NOERROR,required"`
+ Nxdomain []string `json:"NXDOMAIN,required"`
+ JSON as112TimeseriesGroupResponseCodesResponseSerie0JSON `json:"-"`
+}
+
+// as112TimeseriesGroupResponseCodesResponseSerie0JSON contains the JSON metadata
+// for the struct [AS112TimeseriesGroupResponseCodesResponseSerie0]
+type as112TimeseriesGroupResponseCodesResponseSerie0JSON struct {
+ Noerror apijson.Field
+ Nxdomain apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112TimeseriesGroupResponseCodesResponseSerie0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112TimeseriesGroupResponseCodesResponseSerie0JSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112TimeseriesGroupDNSSECParams struct {
+ // Aggregation interval results should be returned in (for example, in 15 minutes
+ // or 1 hour intervals). Refer to
+ // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+ AggInterval param.Field[AS112TimeseriesGroupDNSSECParamsAggInterval] `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"`
+ // 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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]AS112TimeseriesGroupDNSSECParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Format results are returned in.
+ Format param.Field[AS112TimeseriesGroupDNSSECParamsFormat] `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"`
+}
+
+// URLQuery serializes [AS112TimeseriesGroupDNSSECParams]'s query parameters as
+// `url.Values`.
+func (r AS112TimeseriesGroupDNSSECParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Aggregation interval results should be returned in (for example, in 15 minutes
+// or 1 hour intervals). Refer to
+// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+type AS112TimeseriesGroupDNSSECParamsAggInterval string
+
+const (
+ AS112TimeseriesGroupDNSSECParamsAggInterval15m AS112TimeseriesGroupDNSSECParamsAggInterval = "15m"
+ AS112TimeseriesGroupDNSSECParamsAggInterval1h AS112TimeseriesGroupDNSSECParamsAggInterval = "1h"
+ AS112TimeseriesGroupDNSSECParamsAggInterval1d AS112TimeseriesGroupDNSSECParamsAggInterval = "1d"
+ AS112TimeseriesGroupDNSSECParamsAggInterval1w AS112TimeseriesGroupDNSSECParamsAggInterval = "1w"
+)
+
+type AS112TimeseriesGroupDNSSECParamsDateRange string
+
+const (
+ AS112TimeseriesGroupDNSSECParamsDateRange1d AS112TimeseriesGroupDNSSECParamsDateRange = "1d"
+ AS112TimeseriesGroupDNSSECParamsDateRange2d AS112TimeseriesGroupDNSSECParamsDateRange = "2d"
+ AS112TimeseriesGroupDNSSECParamsDateRange7d AS112TimeseriesGroupDNSSECParamsDateRange = "7d"
+ AS112TimeseriesGroupDNSSECParamsDateRange14d AS112TimeseriesGroupDNSSECParamsDateRange = "14d"
+ AS112TimeseriesGroupDNSSECParamsDateRange28d AS112TimeseriesGroupDNSSECParamsDateRange = "28d"
+ AS112TimeseriesGroupDNSSECParamsDateRange12w AS112TimeseriesGroupDNSSECParamsDateRange = "12w"
+ AS112TimeseriesGroupDNSSECParamsDateRange24w AS112TimeseriesGroupDNSSECParamsDateRange = "24w"
+ AS112TimeseriesGroupDNSSECParamsDateRange52w AS112TimeseriesGroupDNSSECParamsDateRange = "52w"
+ AS112TimeseriesGroupDNSSECParamsDateRange1dControl AS112TimeseriesGroupDNSSECParamsDateRange = "1dControl"
+ AS112TimeseriesGroupDNSSECParamsDateRange2dControl AS112TimeseriesGroupDNSSECParamsDateRange = "2dControl"
+ AS112TimeseriesGroupDNSSECParamsDateRange7dControl AS112TimeseriesGroupDNSSECParamsDateRange = "7dControl"
+ AS112TimeseriesGroupDNSSECParamsDateRange14dControl AS112TimeseriesGroupDNSSECParamsDateRange = "14dControl"
+ AS112TimeseriesGroupDNSSECParamsDateRange28dControl AS112TimeseriesGroupDNSSECParamsDateRange = "28dControl"
+ AS112TimeseriesGroupDNSSECParamsDateRange12wControl AS112TimeseriesGroupDNSSECParamsDateRange = "12wControl"
+ AS112TimeseriesGroupDNSSECParamsDateRange24wControl AS112TimeseriesGroupDNSSECParamsDateRange = "24wControl"
+)
+
+// Format results are returned in.
+type AS112TimeseriesGroupDNSSECParamsFormat string
+
+const (
+ AS112TimeseriesGroupDNSSECParamsFormatJson AS112TimeseriesGroupDNSSECParamsFormat = "JSON"
+ AS112TimeseriesGroupDNSSECParamsFormatCsv AS112TimeseriesGroupDNSSECParamsFormat = "CSV"
+)
+
+type AS112TimeseriesGroupDNSSECResponseEnvelope struct {
+ Result AS112TimeseriesGroupDNSSECResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON as112TimeseriesGroupDNSSECResponseEnvelopeJSON `json:"-"`
+}
+
+// as112TimeseriesGroupDNSSECResponseEnvelopeJSON contains the JSON metadata for
+// the struct [AS112TimeseriesGroupDNSSECResponseEnvelope]
+type as112TimeseriesGroupDNSSECResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112TimeseriesGroupDNSSECResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112TimeseriesGroupDNSSECResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112TimeseriesGroupEdnsParams struct {
+ // Aggregation interval results should be returned in (for example, in 15 minutes
+ // or 1 hour intervals). Refer to
+ // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+ AggInterval param.Field[AS112TimeseriesGroupEdnsParamsAggInterval] `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"`
+ // 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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]AS112TimeseriesGroupEdnsParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Format results are returned in.
+ Format param.Field[AS112TimeseriesGroupEdnsParamsFormat] `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"`
+}
+
+// URLQuery serializes [AS112TimeseriesGroupEdnsParams]'s query parameters as
+// `url.Values`.
+func (r AS112TimeseriesGroupEdnsParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Aggregation interval results should be returned in (for example, in 15 minutes
+// or 1 hour intervals). Refer to
+// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+type AS112TimeseriesGroupEdnsParamsAggInterval string
+
+const (
+ AS112TimeseriesGroupEdnsParamsAggInterval15m AS112TimeseriesGroupEdnsParamsAggInterval = "15m"
+ AS112TimeseriesGroupEdnsParamsAggInterval1h AS112TimeseriesGroupEdnsParamsAggInterval = "1h"
+ AS112TimeseriesGroupEdnsParamsAggInterval1d AS112TimeseriesGroupEdnsParamsAggInterval = "1d"
+ AS112TimeseriesGroupEdnsParamsAggInterval1w AS112TimeseriesGroupEdnsParamsAggInterval = "1w"
+)
+
+type AS112TimeseriesGroupEdnsParamsDateRange string
+
+const (
+ AS112TimeseriesGroupEdnsParamsDateRange1d AS112TimeseriesGroupEdnsParamsDateRange = "1d"
+ AS112TimeseriesGroupEdnsParamsDateRange2d AS112TimeseriesGroupEdnsParamsDateRange = "2d"
+ AS112TimeseriesGroupEdnsParamsDateRange7d AS112TimeseriesGroupEdnsParamsDateRange = "7d"
+ AS112TimeseriesGroupEdnsParamsDateRange14d AS112TimeseriesGroupEdnsParamsDateRange = "14d"
+ AS112TimeseriesGroupEdnsParamsDateRange28d AS112TimeseriesGroupEdnsParamsDateRange = "28d"
+ AS112TimeseriesGroupEdnsParamsDateRange12w AS112TimeseriesGroupEdnsParamsDateRange = "12w"
+ AS112TimeseriesGroupEdnsParamsDateRange24w AS112TimeseriesGroupEdnsParamsDateRange = "24w"
+ AS112TimeseriesGroupEdnsParamsDateRange52w AS112TimeseriesGroupEdnsParamsDateRange = "52w"
+ AS112TimeseriesGroupEdnsParamsDateRange1dControl AS112TimeseriesGroupEdnsParamsDateRange = "1dControl"
+ AS112TimeseriesGroupEdnsParamsDateRange2dControl AS112TimeseriesGroupEdnsParamsDateRange = "2dControl"
+ AS112TimeseriesGroupEdnsParamsDateRange7dControl AS112TimeseriesGroupEdnsParamsDateRange = "7dControl"
+ AS112TimeseriesGroupEdnsParamsDateRange14dControl AS112TimeseriesGroupEdnsParamsDateRange = "14dControl"
+ AS112TimeseriesGroupEdnsParamsDateRange28dControl AS112TimeseriesGroupEdnsParamsDateRange = "28dControl"
+ AS112TimeseriesGroupEdnsParamsDateRange12wControl AS112TimeseriesGroupEdnsParamsDateRange = "12wControl"
+ AS112TimeseriesGroupEdnsParamsDateRange24wControl AS112TimeseriesGroupEdnsParamsDateRange = "24wControl"
+)
+
+// Format results are returned in.
+type AS112TimeseriesGroupEdnsParamsFormat string
+
+const (
+ AS112TimeseriesGroupEdnsParamsFormatJson AS112TimeseriesGroupEdnsParamsFormat = "JSON"
+ AS112TimeseriesGroupEdnsParamsFormatCsv AS112TimeseriesGroupEdnsParamsFormat = "CSV"
+)
+
+type AS112TimeseriesGroupEdnsResponseEnvelope struct {
+ Result AS112TimeseriesGroupEdnsResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON as112TimeseriesGroupEdnsResponseEnvelopeJSON `json:"-"`
+}
+
+// as112TimeseriesGroupEdnsResponseEnvelopeJSON contains the JSON metadata for the
+// struct [AS112TimeseriesGroupEdnsResponseEnvelope]
+type as112TimeseriesGroupEdnsResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112TimeseriesGroupEdnsResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112TimeseriesGroupEdnsResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112TimeseriesGroupIPVersionParams struct {
+ // Aggregation interval results should be returned in (for example, in 15 minutes
+ // or 1 hour intervals). Refer to
+ // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+ AggInterval param.Field[AS112TimeseriesGroupIPVersionParamsAggInterval] `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"`
+ // 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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]AS112TimeseriesGroupIPVersionParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Format results are returned in.
+ Format param.Field[AS112TimeseriesGroupIPVersionParamsFormat] `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"`
+}
+
+// URLQuery serializes [AS112TimeseriesGroupIPVersionParams]'s query parameters as
+// `url.Values`.
+func (r AS112TimeseriesGroupIPVersionParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Aggregation interval results should be returned in (for example, in 15 minutes
+// or 1 hour intervals). Refer to
+// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+type AS112TimeseriesGroupIPVersionParamsAggInterval string
+
+const (
+ AS112TimeseriesGroupIPVersionParamsAggInterval15m AS112TimeseriesGroupIPVersionParamsAggInterval = "15m"
+ AS112TimeseriesGroupIPVersionParamsAggInterval1h AS112TimeseriesGroupIPVersionParamsAggInterval = "1h"
+ AS112TimeseriesGroupIPVersionParamsAggInterval1d AS112TimeseriesGroupIPVersionParamsAggInterval = "1d"
+ AS112TimeseriesGroupIPVersionParamsAggInterval1w AS112TimeseriesGroupIPVersionParamsAggInterval = "1w"
+)
+
+type AS112TimeseriesGroupIPVersionParamsDateRange string
+
+const (
+ AS112TimeseriesGroupIPVersionParamsDateRange1d AS112TimeseriesGroupIPVersionParamsDateRange = "1d"
+ AS112TimeseriesGroupIPVersionParamsDateRange2d AS112TimeseriesGroupIPVersionParamsDateRange = "2d"
+ AS112TimeseriesGroupIPVersionParamsDateRange7d AS112TimeseriesGroupIPVersionParamsDateRange = "7d"
+ AS112TimeseriesGroupIPVersionParamsDateRange14d AS112TimeseriesGroupIPVersionParamsDateRange = "14d"
+ AS112TimeseriesGroupIPVersionParamsDateRange28d AS112TimeseriesGroupIPVersionParamsDateRange = "28d"
+ AS112TimeseriesGroupIPVersionParamsDateRange12w AS112TimeseriesGroupIPVersionParamsDateRange = "12w"
+ AS112TimeseriesGroupIPVersionParamsDateRange24w AS112TimeseriesGroupIPVersionParamsDateRange = "24w"
+ AS112TimeseriesGroupIPVersionParamsDateRange52w AS112TimeseriesGroupIPVersionParamsDateRange = "52w"
+ AS112TimeseriesGroupIPVersionParamsDateRange1dControl AS112TimeseriesGroupIPVersionParamsDateRange = "1dControl"
+ AS112TimeseriesGroupIPVersionParamsDateRange2dControl AS112TimeseriesGroupIPVersionParamsDateRange = "2dControl"
+ AS112TimeseriesGroupIPVersionParamsDateRange7dControl AS112TimeseriesGroupIPVersionParamsDateRange = "7dControl"
+ AS112TimeseriesGroupIPVersionParamsDateRange14dControl AS112TimeseriesGroupIPVersionParamsDateRange = "14dControl"
+ AS112TimeseriesGroupIPVersionParamsDateRange28dControl AS112TimeseriesGroupIPVersionParamsDateRange = "28dControl"
+ AS112TimeseriesGroupIPVersionParamsDateRange12wControl AS112TimeseriesGroupIPVersionParamsDateRange = "12wControl"
+ AS112TimeseriesGroupIPVersionParamsDateRange24wControl AS112TimeseriesGroupIPVersionParamsDateRange = "24wControl"
+)
+
+// Format results are returned in.
+type AS112TimeseriesGroupIPVersionParamsFormat string
+
+const (
+ AS112TimeseriesGroupIPVersionParamsFormatJson AS112TimeseriesGroupIPVersionParamsFormat = "JSON"
+ AS112TimeseriesGroupIPVersionParamsFormatCsv AS112TimeseriesGroupIPVersionParamsFormat = "CSV"
+)
+
+type AS112TimeseriesGroupIPVersionResponseEnvelope struct {
+ Result AS112TimeseriesGroupIPVersionResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON as112TimeseriesGroupIPVersionResponseEnvelopeJSON `json:"-"`
+}
+
+// as112TimeseriesGroupIPVersionResponseEnvelopeJSON contains the JSON metadata for
+// the struct [AS112TimeseriesGroupIPVersionResponseEnvelope]
+type as112TimeseriesGroupIPVersionResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112TimeseriesGroupIPVersionResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112TimeseriesGroupIPVersionResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112TimeseriesGroupProtocolParams struct {
+ // Aggregation interval results should be returned in (for example, in 15 minutes
+ // or 1 hour intervals). Refer to
+ // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+ AggInterval param.Field[AS112TimeseriesGroupProtocolParamsAggInterval] `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"`
+ // 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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]AS112TimeseriesGroupProtocolParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Format results are returned in.
+ Format param.Field[AS112TimeseriesGroupProtocolParamsFormat] `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"`
+}
+
+// URLQuery serializes [AS112TimeseriesGroupProtocolParams]'s query parameters as
+// `url.Values`.
+func (r AS112TimeseriesGroupProtocolParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Aggregation interval results should be returned in (for example, in 15 minutes
+// or 1 hour intervals). Refer to
+// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+type AS112TimeseriesGroupProtocolParamsAggInterval string
+
+const (
+ AS112TimeseriesGroupProtocolParamsAggInterval15m AS112TimeseriesGroupProtocolParamsAggInterval = "15m"
+ AS112TimeseriesGroupProtocolParamsAggInterval1h AS112TimeseriesGroupProtocolParamsAggInterval = "1h"
+ AS112TimeseriesGroupProtocolParamsAggInterval1d AS112TimeseriesGroupProtocolParamsAggInterval = "1d"
+ AS112TimeseriesGroupProtocolParamsAggInterval1w AS112TimeseriesGroupProtocolParamsAggInterval = "1w"
+)
+
+type AS112TimeseriesGroupProtocolParamsDateRange string
+
+const (
+ AS112TimeseriesGroupProtocolParamsDateRange1d AS112TimeseriesGroupProtocolParamsDateRange = "1d"
+ AS112TimeseriesGroupProtocolParamsDateRange2d AS112TimeseriesGroupProtocolParamsDateRange = "2d"
+ AS112TimeseriesGroupProtocolParamsDateRange7d AS112TimeseriesGroupProtocolParamsDateRange = "7d"
+ AS112TimeseriesGroupProtocolParamsDateRange14d AS112TimeseriesGroupProtocolParamsDateRange = "14d"
+ AS112TimeseriesGroupProtocolParamsDateRange28d AS112TimeseriesGroupProtocolParamsDateRange = "28d"
+ AS112TimeseriesGroupProtocolParamsDateRange12w AS112TimeseriesGroupProtocolParamsDateRange = "12w"
+ AS112TimeseriesGroupProtocolParamsDateRange24w AS112TimeseriesGroupProtocolParamsDateRange = "24w"
+ AS112TimeseriesGroupProtocolParamsDateRange52w AS112TimeseriesGroupProtocolParamsDateRange = "52w"
+ AS112TimeseriesGroupProtocolParamsDateRange1dControl AS112TimeseriesGroupProtocolParamsDateRange = "1dControl"
+ AS112TimeseriesGroupProtocolParamsDateRange2dControl AS112TimeseriesGroupProtocolParamsDateRange = "2dControl"
+ AS112TimeseriesGroupProtocolParamsDateRange7dControl AS112TimeseriesGroupProtocolParamsDateRange = "7dControl"
+ AS112TimeseriesGroupProtocolParamsDateRange14dControl AS112TimeseriesGroupProtocolParamsDateRange = "14dControl"
+ AS112TimeseriesGroupProtocolParamsDateRange28dControl AS112TimeseriesGroupProtocolParamsDateRange = "28dControl"
+ AS112TimeseriesGroupProtocolParamsDateRange12wControl AS112TimeseriesGroupProtocolParamsDateRange = "12wControl"
+ AS112TimeseriesGroupProtocolParamsDateRange24wControl AS112TimeseriesGroupProtocolParamsDateRange = "24wControl"
+)
+
+// Format results are returned in.
+type AS112TimeseriesGroupProtocolParamsFormat string
+
+const (
+ AS112TimeseriesGroupProtocolParamsFormatJson AS112TimeseriesGroupProtocolParamsFormat = "JSON"
+ AS112TimeseriesGroupProtocolParamsFormatCsv AS112TimeseriesGroupProtocolParamsFormat = "CSV"
+)
+
+type AS112TimeseriesGroupProtocolResponseEnvelope struct {
+ Result AS112TimeseriesGroupProtocolResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON as112TimeseriesGroupProtocolResponseEnvelopeJSON `json:"-"`
+}
+
+// as112TimeseriesGroupProtocolResponseEnvelopeJSON contains the JSON metadata for
+// the struct [AS112TimeseriesGroupProtocolResponseEnvelope]
+type as112TimeseriesGroupProtocolResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112TimeseriesGroupProtocolResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112TimeseriesGroupProtocolResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112TimeseriesGroupQueryTypeParams struct {
+ // Aggregation interval results should be returned in (for example, in 15 minutes
+ // or 1 hour intervals). Refer to
+ // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+ AggInterval param.Field[AS112TimeseriesGroupQueryTypeParamsAggInterval] `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"`
+ // 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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]AS112TimeseriesGroupQueryTypeParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Format results are returned in.
+ Format param.Field[AS112TimeseriesGroupQueryTypeParamsFormat] `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"`
+}
+
+// URLQuery serializes [AS112TimeseriesGroupQueryTypeParams]'s query parameters as
+// `url.Values`.
+func (r AS112TimeseriesGroupQueryTypeParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Aggregation interval results should be returned in (for example, in 15 minutes
+// or 1 hour intervals). Refer to
+// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+type AS112TimeseriesGroupQueryTypeParamsAggInterval string
+
+const (
+ AS112TimeseriesGroupQueryTypeParamsAggInterval15m AS112TimeseriesGroupQueryTypeParamsAggInterval = "15m"
+ AS112TimeseriesGroupQueryTypeParamsAggInterval1h AS112TimeseriesGroupQueryTypeParamsAggInterval = "1h"
+ AS112TimeseriesGroupQueryTypeParamsAggInterval1d AS112TimeseriesGroupQueryTypeParamsAggInterval = "1d"
+ AS112TimeseriesGroupQueryTypeParamsAggInterval1w AS112TimeseriesGroupQueryTypeParamsAggInterval = "1w"
+)
+
+type AS112TimeseriesGroupQueryTypeParamsDateRange string
+
+const (
+ AS112TimeseriesGroupQueryTypeParamsDateRange1d AS112TimeseriesGroupQueryTypeParamsDateRange = "1d"
+ AS112TimeseriesGroupQueryTypeParamsDateRange2d AS112TimeseriesGroupQueryTypeParamsDateRange = "2d"
+ AS112TimeseriesGroupQueryTypeParamsDateRange7d AS112TimeseriesGroupQueryTypeParamsDateRange = "7d"
+ AS112TimeseriesGroupQueryTypeParamsDateRange14d AS112TimeseriesGroupQueryTypeParamsDateRange = "14d"
+ AS112TimeseriesGroupQueryTypeParamsDateRange28d AS112TimeseriesGroupQueryTypeParamsDateRange = "28d"
+ AS112TimeseriesGroupQueryTypeParamsDateRange12w AS112TimeseriesGroupQueryTypeParamsDateRange = "12w"
+ AS112TimeseriesGroupQueryTypeParamsDateRange24w AS112TimeseriesGroupQueryTypeParamsDateRange = "24w"
+ AS112TimeseriesGroupQueryTypeParamsDateRange52w AS112TimeseriesGroupQueryTypeParamsDateRange = "52w"
+ AS112TimeseriesGroupQueryTypeParamsDateRange1dControl AS112TimeseriesGroupQueryTypeParamsDateRange = "1dControl"
+ AS112TimeseriesGroupQueryTypeParamsDateRange2dControl AS112TimeseriesGroupQueryTypeParamsDateRange = "2dControl"
+ AS112TimeseriesGroupQueryTypeParamsDateRange7dControl AS112TimeseriesGroupQueryTypeParamsDateRange = "7dControl"
+ AS112TimeseriesGroupQueryTypeParamsDateRange14dControl AS112TimeseriesGroupQueryTypeParamsDateRange = "14dControl"
+ AS112TimeseriesGroupQueryTypeParamsDateRange28dControl AS112TimeseriesGroupQueryTypeParamsDateRange = "28dControl"
+ AS112TimeseriesGroupQueryTypeParamsDateRange12wControl AS112TimeseriesGroupQueryTypeParamsDateRange = "12wControl"
+ AS112TimeseriesGroupQueryTypeParamsDateRange24wControl AS112TimeseriesGroupQueryTypeParamsDateRange = "24wControl"
+)
+
+// Format results are returned in.
+type AS112TimeseriesGroupQueryTypeParamsFormat string
+
+const (
+ AS112TimeseriesGroupQueryTypeParamsFormatJson AS112TimeseriesGroupQueryTypeParamsFormat = "JSON"
+ AS112TimeseriesGroupQueryTypeParamsFormatCsv AS112TimeseriesGroupQueryTypeParamsFormat = "CSV"
+)
+
+type AS112TimeseriesGroupQueryTypeResponseEnvelope struct {
+ Result AS112TimeseriesGroupQueryTypeResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON as112TimeseriesGroupQueryTypeResponseEnvelopeJSON `json:"-"`
+}
+
+// as112TimeseriesGroupQueryTypeResponseEnvelopeJSON contains the JSON metadata for
+// the struct [AS112TimeseriesGroupQueryTypeResponseEnvelope]
+type as112TimeseriesGroupQueryTypeResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112TimeseriesGroupQueryTypeResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112TimeseriesGroupQueryTypeResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112TimeseriesGroupResponseCodesParams struct {
+ // Aggregation interval results should be returned in (for example, in 15 minutes
+ // or 1 hour intervals). Refer to
+ // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+ AggInterval param.Field[AS112TimeseriesGroupResponseCodesParamsAggInterval] `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"`
+ // 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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]AS112TimeseriesGroupResponseCodesParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Format results are returned in.
+ Format param.Field[AS112TimeseriesGroupResponseCodesParamsFormat] `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"`
+}
+
+// URLQuery serializes [AS112TimeseriesGroupResponseCodesParams]'s query parameters
+// as `url.Values`.
+func (r AS112TimeseriesGroupResponseCodesParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Aggregation interval results should be returned in (for example, in 15 minutes
+// or 1 hour intervals). Refer to
+// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+type AS112TimeseriesGroupResponseCodesParamsAggInterval string
+
+const (
+ AS112TimeseriesGroupResponseCodesParamsAggInterval15m AS112TimeseriesGroupResponseCodesParamsAggInterval = "15m"
+ AS112TimeseriesGroupResponseCodesParamsAggInterval1h AS112TimeseriesGroupResponseCodesParamsAggInterval = "1h"
+ AS112TimeseriesGroupResponseCodesParamsAggInterval1d AS112TimeseriesGroupResponseCodesParamsAggInterval = "1d"
+ AS112TimeseriesGroupResponseCodesParamsAggInterval1w AS112TimeseriesGroupResponseCodesParamsAggInterval = "1w"
+)
+
+type AS112TimeseriesGroupResponseCodesParamsDateRange string
+
+const (
+ AS112TimeseriesGroupResponseCodesParamsDateRange1d AS112TimeseriesGroupResponseCodesParamsDateRange = "1d"
+ AS112TimeseriesGroupResponseCodesParamsDateRange2d AS112TimeseriesGroupResponseCodesParamsDateRange = "2d"
+ AS112TimeseriesGroupResponseCodesParamsDateRange7d AS112TimeseriesGroupResponseCodesParamsDateRange = "7d"
+ AS112TimeseriesGroupResponseCodesParamsDateRange14d AS112TimeseriesGroupResponseCodesParamsDateRange = "14d"
+ AS112TimeseriesGroupResponseCodesParamsDateRange28d AS112TimeseriesGroupResponseCodesParamsDateRange = "28d"
+ AS112TimeseriesGroupResponseCodesParamsDateRange12w AS112TimeseriesGroupResponseCodesParamsDateRange = "12w"
+ AS112TimeseriesGroupResponseCodesParamsDateRange24w AS112TimeseriesGroupResponseCodesParamsDateRange = "24w"
+ AS112TimeseriesGroupResponseCodesParamsDateRange52w AS112TimeseriesGroupResponseCodesParamsDateRange = "52w"
+ AS112TimeseriesGroupResponseCodesParamsDateRange1dControl AS112TimeseriesGroupResponseCodesParamsDateRange = "1dControl"
+ AS112TimeseriesGroupResponseCodesParamsDateRange2dControl AS112TimeseriesGroupResponseCodesParamsDateRange = "2dControl"
+ AS112TimeseriesGroupResponseCodesParamsDateRange7dControl AS112TimeseriesGroupResponseCodesParamsDateRange = "7dControl"
+ AS112TimeseriesGroupResponseCodesParamsDateRange14dControl AS112TimeseriesGroupResponseCodesParamsDateRange = "14dControl"
+ AS112TimeseriesGroupResponseCodesParamsDateRange28dControl AS112TimeseriesGroupResponseCodesParamsDateRange = "28dControl"
+ AS112TimeseriesGroupResponseCodesParamsDateRange12wControl AS112TimeseriesGroupResponseCodesParamsDateRange = "12wControl"
+ AS112TimeseriesGroupResponseCodesParamsDateRange24wControl AS112TimeseriesGroupResponseCodesParamsDateRange = "24wControl"
+)
+
+// Format results are returned in.
+type AS112TimeseriesGroupResponseCodesParamsFormat string
+
+const (
+ AS112TimeseriesGroupResponseCodesParamsFormatJson AS112TimeseriesGroupResponseCodesParamsFormat = "JSON"
+ AS112TimeseriesGroupResponseCodesParamsFormatCsv AS112TimeseriesGroupResponseCodesParamsFormat = "CSV"
+)
+
+type AS112TimeseriesGroupResponseCodesResponseEnvelope struct {
+ Result AS112TimeseriesGroupResponseCodesResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON as112TimeseriesGroupResponseCodesResponseEnvelopeJSON `json:"-"`
+}
+
+// as112TimeseriesGroupResponseCodesResponseEnvelopeJSON contains the JSON metadata
+// for the struct [AS112TimeseriesGroupResponseCodesResponseEnvelope]
+type as112TimeseriesGroupResponseCodesResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112TimeseriesGroupResponseCodesResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112TimeseriesGroupResponseCodesResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/radar/as112timeseriesgroup_test.go b/radar/as112timeseriesgroup_test.go
new file mode 100644
index 00000000000..c82b910ddcd
--- /dev/null
+++ b/radar/as112timeseriesgroup_test.go
@@ -0,0 +1,220 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/radar"
+)
+
+func TestAS112TimeseriesGroupDNSSECWithOptionalParams(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"),
+ )
+ _, err := client.Radar.AS112.TimeseriesGroups.DNSSEC(context.TODO(), radar.AS112TimeseriesGroupDNSSECParams{
+ AggInterval: cloudflare.F(radar.AS112TimeseriesGroupDNSSECParamsAggInterval1h),
+ 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([]radar.AS112TimeseriesGroupDNSSECParamsDateRange{radar.AS112TimeseriesGroupDNSSECParamsDateRange1d, radar.AS112TimeseriesGroupDNSSECParamsDateRange2d, radar.AS112TimeseriesGroupDNSSECParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Format: cloudflare.F(radar.AS112TimeseriesGroupDNSSECParamsFormatJson),
+ 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())
+ }
+}
+
+func TestAS112TimeseriesGroupEdnsWithOptionalParams(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"),
+ )
+ _, err := client.Radar.AS112.TimeseriesGroups.Edns(context.TODO(), radar.AS112TimeseriesGroupEdnsParams{
+ AggInterval: cloudflare.F(radar.AS112TimeseriesGroupEdnsParamsAggInterval1h),
+ 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([]radar.AS112TimeseriesGroupEdnsParamsDateRange{radar.AS112TimeseriesGroupEdnsParamsDateRange1d, radar.AS112TimeseriesGroupEdnsParamsDateRange2d, radar.AS112TimeseriesGroupEdnsParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Format: cloudflare.F(radar.AS112TimeseriesGroupEdnsParamsFormatJson),
+ 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())
+ }
+}
+
+func TestAS112TimeseriesGroupIPVersionWithOptionalParams(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"),
+ )
+ _, err := client.Radar.AS112.TimeseriesGroups.IPVersion(context.TODO(), radar.AS112TimeseriesGroupIPVersionParams{
+ AggInterval: cloudflare.F(radar.AS112TimeseriesGroupIPVersionParamsAggInterval1h),
+ 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([]radar.AS112TimeseriesGroupIPVersionParamsDateRange{radar.AS112TimeseriesGroupIPVersionParamsDateRange1d, radar.AS112TimeseriesGroupIPVersionParamsDateRange2d, radar.AS112TimeseriesGroupIPVersionParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Format: cloudflare.F(radar.AS112TimeseriesGroupIPVersionParamsFormatJson),
+ 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())
+ }
+}
+
+func TestAS112TimeseriesGroupProtocolWithOptionalParams(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"),
+ )
+ _, err := client.Radar.AS112.TimeseriesGroups.Protocol(context.TODO(), radar.AS112TimeseriesGroupProtocolParams{
+ AggInterval: cloudflare.F(radar.AS112TimeseriesGroupProtocolParamsAggInterval1h),
+ 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([]radar.AS112TimeseriesGroupProtocolParamsDateRange{radar.AS112TimeseriesGroupProtocolParamsDateRange1d, radar.AS112TimeseriesGroupProtocolParamsDateRange2d, radar.AS112TimeseriesGroupProtocolParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Format: cloudflare.F(radar.AS112TimeseriesGroupProtocolParamsFormatJson),
+ 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())
+ }
+}
+
+func TestAS112TimeseriesGroupQueryTypeWithOptionalParams(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"),
+ )
+ _, err := client.Radar.AS112.TimeseriesGroups.QueryType(context.TODO(), radar.AS112TimeseriesGroupQueryTypeParams{
+ AggInterval: cloudflare.F(radar.AS112TimeseriesGroupQueryTypeParamsAggInterval1h),
+ 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([]radar.AS112TimeseriesGroupQueryTypeParamsDateRange{radar.AS112TimeseriesGroupQueryTypeParamsDateRange1d, radar.AS112TimeseriesGroupQueryTypeParamsDateRange2d, radar.AS112TimeseriesGroupQueryTypeParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Format: cloudflare.F(radar.AS112TimeseriesGroupQueryTypeParamsFormatJson),
+ 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())
+ }
+}
+
+func TestAS112TimeseriesGroupResponseCodesWithOptionalParams(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"),
+ )
+ _, err := client.Radar.AS112.TimeseriesGroups.ResponseCodes(context.TODO(), radar.AS112TimeseriesGroupResponseCodesParams{
+ AggInterval: cloudflare.F(radar.AS112TimeseriesGroupResponseCodesParamsAggInterval1h),
+ 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([]radar.AS112TimeseriesGroupResponseCodesParamsDateRange{radar.AS112TimeseriesGroupResponseCodesParamsDateRange1d, radar.AS112TimeseriesGroupResponseCodesParamsDateRange2d, radar.AS112TimeseriesGroupResponseCodesParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Format: cloudflare.F(radar.AS112TimeseriesGroupResponseCodesParamsFormatJson),
+ 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/radar/as112top.go b/radar/as112top.go
new file mode 100644
index 00000000000..a525957ae8f
--- /dev/null
+++ b/radar/as112top.go
@@ -0,0 +1,1081 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// AS112TopService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewAS112TopService] method instead.
+type AS112TopService struct {
+ Options []option.RequestOption
+}
+
+// NewAS112TopService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewAS112TopService(opts ...option.RequestOption) (r *AS112TopService) {
+ r = &AS112TopService{}
+ r.Options = opts
+ return
+}
+
+// Get the top locations by DNS queries DNSSEC support to AS112.
+func (r *AS112TopService) DNSSEC(ctx context.Context, dnssec AS112TopDNSSECParamsDNSSEC, query AS112TopDNSSECParams, opts ...option.RequestOption) (res *AS112TopDNSSECResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AS112TopDNSSECResponseEnvelope
+ path := fmt.Sprintf("radar/as112/top/locations/dnssec/%v", dnssec)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Get the top locations, by DNS queries EDNS support to AS112.
+func (r *AS112TopService) Edns(ctx context.Context, edns AS112TopEdnsParamsEdns, query AS112TopEdnsParams, opts ...option.RequestOption) (res *AS112TopEdnsResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AS112TopEdnsResponseEnvelope
+ path := fmt.Sprintf("radar/as112/top/locations/edns/%v", edns)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Get the top locations by DNS queries IP version to AS112.
+func (r *AS112TopService) IPVersion(ctx context.Context, ipVersion AS112TopIPVersionParamsIPVersion, query AS112TopIPVersionParams, opts ...option.RequestOption) (res *AS112TopIPVersionResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AS112TopIPVersionResponseEnvelope
+ path := fmt.Sprintf("radar/as112/top/locations/ip_version/%v", ipVersion)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Get the top locations by AS112 DNS queries. Values are a percentage out of the
+// total queries.
+func (r *AS112TopService) Locations(ctx context.Context, query AS112TopLocationsParams, opts ...option.RequestOption) (res *AS112TopLocationsResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AS112TopLocationsResponseEnvelope
+ path := "radar/as112/top/locations"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type AS112TopDNSSECResponse struct {
+ Meta AS112TopDNSSECResponseMeta `json:"meta,required"`
+ Top0 []AS112TopDNSSECResponseTop0 `json:"top_0,required"`
+ JSON as112TopDNSSECResponseJSON `json:"-"`
+}
+
+// as112TopDNSSECResponseJSON contains the JSON metadata for the struct
+// [AS112TopDNSSECResponse]
+type as112TopDNSSECResponseJSON struct {
+ Meta apijson.Field
+ Top0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112TopDNSSECResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112TopDNSSECResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112TopDNSSECResponseMeta struct {
+ DateRange []AS112TopDNSSECResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ ConfidenceInfo AS112TopDNSSECResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON as112TopDNSSECResponseMetaJSON `json:"-"`
+}
+
+// as112TopDNSSECResponseMetaJSON contains the JSON metadata for the struct
+// [AS112TopDNSSECResponseMeta]
+type as112TopDNSSECResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112TopDNSSECResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112TopDNSSECResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112TopDNSSECResponseMetaDateRange 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 as112TopDNSSECResponseMetaDateRangeJSON `json:"-"`
+}
+
+// as112TopDNSSECResponseMetaDateRangeJSON contains the JSON metadata for the
+// struct [AS112TopDNSSECResponseMetaDateRange]
+type as112TopDNSSECResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112TopDNSSECResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112TopDNSSECResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112TopDNSSECResponseMetaConfidenceInfo struct {
+ Annotations []AS112TopDNSSECResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON as112TopDNSSECResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// as112TopDNSSECResponseMetaConfidenceInfoJSON contains the JSON metadata for the
+// struct [AS112TopDNSSECResponseMetaConfidenceInfo]
+type as112TopDNSSECResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112TopDNSSECResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112TopDNSSECResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112TopDNSSECResponseMetaConfidenceInfoAnnotation 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 as112TopDNSSECResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// as112TopDNSSECResponseMetaConfidenceInfoAnnotationJSON contains the JSON
+// metadata for the struct [AS112TopDNSSECResponseMetaConfidenceInfoAnnotation]
+type as112TopDNSSECResponseMetaConfidenceInfoAnnotationJSON 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 *AS112TopDNSSECResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112TopDNSSECResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112TopDNSSECResponseTop0 struct {
+ ClientCountryAlpha2 string `json:"clientCountryAlpha2,required"`
+ ClientCountryName string `json:"clientCountryName,required"`
+ Value string `json:"value,required"`
+ JSON as112TopDNSSECResponseTop0JSON `json:"-"`
+}
+
+// as112TopDNSSECResponseTop0JSON contains the JSON metadata for the struct
+// [AS112TopDNSSECResponseTop0]
+type as112TopDNSSECResponseTop0JSON struct {
+ ClientCountryAlpha2 apijson.Field
+ ClientCountryName apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112TopDNSSECResponseTop0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112TopDNSSECResponseTop0JSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112TopEdnsResponse struct {
+ Meta AS112TopEdnsResponseMeta `json:"meta,required"`
+ Top0 []AS112TopEdnsResponseTop0 `json:"top_0,required"`
+ JSON as112TopEdnsResponseJSON `json:"-"`
+}
+
+// as112TopEdnsResponseJSON contains the JSON metadata for the struct
+// [AS112TopEdnsResponse]
+type as112TopEdnsResponseJSON struct {
+ Meta apijson.Field
+ Top0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112TopEdnsResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112TopEdnsResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112TopEdnsResponseMeta struct {
+ DateRange []AS112TopEdnsResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ ConfidenceInfo AS112TopEdnsResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON as112TopEdnsResponseMetaJSON `json:"-"`
+}
+
+// as112TopEdnsResponseMetaJSON contains the JSON metadata for the struct
+// [AS112TopEdnsResponseMeta]
+type as112TopEdnsResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112TopEdnsResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112TopEdnsResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112TopEdnsResponseMetaDateRange 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 as112TopEdnsResponseMetaDateRangeJSON `json:"-"`
+}
+
+// as112TopEdnsResponseMetaDateRangeJSON contains the JSON metadata for the struct
+// [AS112TopEdnsResponseMetaDateRange]
+type as112TopEdnsResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112TopEdnsResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112TopEdnsResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112TopEdnsResponseMetaConfidenceInfo struct {
+ Annotations []AS112TopEdnsResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON as112TopEdnsResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// as112TopEdnsResponseMetaConfidenceInfoJSON contains the JSON metadata for the
+// struct [AS112TopEdnsResponseMetaConfidenceInfo]
+type as112TopEdnsResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112TopEdnsResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112TopEdnsResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112TopEdnsResponseMetaConfidenceInfoAnnotation 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 as112TopEdnsResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// as112TopEdnsResponseMetaConfidenceInfoAnnotationJSON contains the JSON metadata
+// for the struct [AS112TopEdnsResponseMetaConfidenceInfoAnnotation]
+type as112TopEdnsResponseMetaConfidenceInfoAnnotationJSON 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 *AS112TopEdnsResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112TopEdnsResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112TopEdnsResponseTop0 struct {
+ ClientCountryAlpha2 string `json:"clientCountryAlpha2,required"`
+ ClientCountryName string `json:"clientCountryName,required"`
+ Value string `json:"value,required"`
+ JSON as112TopEdnsResponseTop0JSON `json:"-"`
+}
+
+// as112TopEdnsResponseTop0JSON contains the JSON metadata for the struct
+// [AS112TopEdnsResponseTop0]
+type as112TopEdnsResponseTop0JSON struct {
+ ClientCountryAlpha2 apijson.Field
+ ClientCountryName apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112TopEdnsResponseTop0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112TopEdnsResponseTop0JSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112TopIPVersionResponse struct {
+ Meta AS112TopIPVersionResponseMeta `json:"meta,required"`
+ Top0 []AS112TopIPVersionResponseTop0 `json:"top_0,required"`
+ JSON as112TopIPVersionResponseJSON `json:"-"`
+}
+
+// as112TopIPVersionResponseJSON contains the JSON metadata for the struct
+// [AS112TopIPVersionResponse]
+type as112TopIPVersionResponseJSON struct {
+ Meta apijson.Field
+ Top0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112TopIPVersionResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112TopIPVersionResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112TopIPVersionResponseMeta struct {
+ DateRange []AS112TopIPVersionResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ ConfidenceInfo AS112TopIPVersionResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON as112TopIPVersionResponseMetaJSON `json:"-"`
+}
+
+// as112TopIPVersionResponseMetaJSON contains the JSON metadata for the struct
+// [AS112TopIPVersionResponseMeta]
+type as112TopIPVersionResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112TopIPVersionResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112TopIPVersionResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112TopIPVersionResponseMetaDateRange 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 as112TopIPVersionResponseMetaDateRangeJSON `json:"-"`
+}
+
+// as112TopIPVersionResponseMetaDateRangeJSON contains the JSON metadata for the
+// struct [AS112TopIPVersionResponseMetaDateRange]
+type as112TopIPVersionResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112TopIPVersionResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112TopIPVersionResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112TopIPVersionResponseMetaConfidenceInfo struct {
+ Annotations []AS112TopIPVersionResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON as112TopIPVersionResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// as112TopIPVersionResponseMetaConfidenceInfoJSON contains the JSON metadata for
+// the struct [AS112TopIPVersionResponseMetaConfidenceInfo]
+type as112TopIPVersionResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112TopIPVersionResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112TopIPVersionResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112TopIPVersionResponseMetaConfidenceInfoAnnotation 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 as112TopIPVersionResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// as112TopIPVersionResponseMetaConfidenceInfoAnnotationJSON contains the JSON
+// metadata for the struct [AS112TopIPVersionResponseMetaConfidenceInfoAnnotation]
+type as112TopIPVersionResponseMetaConfidenceInfoAnnotationJSON 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 *AS112TopIPVersionResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112TopIPVersionResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112TopIPVersionResponseTop0 struct {
+ ClientCountryAlpha2 string `json:"clientCountryAlpha2,required"`
+ ClientCountryName string `json:"clientCountryName,required"`
+ Value string `json:"value,required"`
+ JSON as112TopIPVersionResponseTop0JSON `json:"-"`
+}
+
+// as112TopIPVersionResponseTop0JSON contains the JSON metadata for the struct
+// [AS112TopIPVersionResponseTop0]
+type as112TopIPVersionResponseTop0JSON struct {
+ ClientCountryAlpha2 apijson.Field
+ ClientCountryName apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112TopIPVersionResponseTop0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112TopIPVersionResponseTop0JSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112TopLocationsResponse struct {
+ Meta AS112TopLocationsResponseMeta `json:"meta,required"`
+ Top0 []AS112TopLocationsResponseTop0 `json:"top_0,required"`
+ JSON as112TopLocationsResponseJSON `json:"-"`
+}
+
+// as112TopLocationsResponseJSON contains the JSON metadata for the struct
+// [AS112TopLocationsResponse]
+type as112TopLocationsResponseJSON struct {
+ Meta apijson.Field
+ Top0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112TopLocationsResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112TopLocationsResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112TopLocationsResponseMeta struct {
+ DateRange []AS112TopLocationsResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ ConfidenceInfo AS112TopLocationsResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON as112TopLocationsResponseMetaJSON `json:"-"`
+}
+
+// as112TopLocationsResponseMetaJSON contains the JSON metadata for the struct
+// [AS112TopLocationsResponseMeta]
+type as112TopLocationsResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112TopLocationsResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112TopLocationsResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112TopLocationsResponseMetaDateRange 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 as112TopLocationsResponseMetaDateRangeJSON `json:"-"`
+}
+
+// as112TopLocationsResponseMetaDateRangeJSON contains the JSON metadata for the
+// struct [AS112TopLocationsResponseMetaDateRange]
+type as112TopLocationsResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112TopLocationsResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112TopLocationsResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112TopLocationsResponseMetaConfidenceInfo struct {
+ Annotations []AS112TopLocationsResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON as112TopLocationsResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// as112TopLocationsResponseMetaConfidenceInfoJSON contains the JSON metadata for
+// the struct [AS112TopLocationsResponseMetaConfidenceInfo]
+type as112TopLocationsResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112TopLocationsResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112TopLocationsResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112TopLocationsResponseMetaConfidenceInfoAnnotation 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 as112TopLocationsResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// as112TopLocationsResponseMetaConfidenceInfoAnnotationJSON contains the JSON
+// metadata for the struct [AS112TopLocationsResponseMetaConfidenceInfoAnnotation]
+type as112TopLocationsResponseMetaConfidenceInfoAnnotationJSON 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 *AS112TopLocationsResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112TopLocationsResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112TopLocationsResponseTop0 struct {
+ ClientCountryAlpha2 string `json:"clientCountryAlpha2,required"`
+ ClientCountryName string `json:"clientCountryName,required"`
+ Value string `json:"value,required"`
+ JSON as112TopLocationsResponseTop0JSON `json:"-"`
+}
+
+// as112TopLocationsResponseTop0JSON contains the JSON metadata for the struct
+// [AS112TopLocationsResponseTop0]
+type as112TopLocationsResponseTop0JSON struct {
+ ClientCountryAlpha2 apijson.Field
+ ClientCountryName apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112TopLocationsResponseTop0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112TopLocationsResponseTop0JSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112TopDNSSECParams 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"`
+ // 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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]AS112TopDNSSECParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Format results are returned in.
+ Format param.Field[AS112TopDNSSECParamsFormat] `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 [AS112TopDNSSECParams]'s query parameters as `url.Values`.
+func (r AS112TopDNSSECParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// DNSSEC.
+type AS112TopDNSSECParamsDNSSEC string
+
+const (
+ AS112TopDNSSECParamsDNSSECSupported AS112TopDNSSECParamsDNSSEC = "SUPPORTED"
+ AS112TopDNSSECParamsDNSSECNotSupported AS112TopDNSSECParamsDNSSEC = "NOT_SUPPORTED"
+)
+
+type AS112TopDNSSECParamsDateRange string
+
+const (
+ AS112TopDNSSECParamsDateRange1d AS112TopDNSSECParamsDateRange = "1d"
+ AS112TopDNSSECParamsDateRange2d AS112TopDNSSECParamsDateRange = "2d"
+ AS112TopDNSSECParamsDateRange7d AS112TopDNSSECParamsDateRange = "7d"
+ AS112TopDNSSECParamsDateRange14d AS112TopDNSSECParamsDateRange = "14d"
+ AS112TopDNSSECParamsDateRange28d AS112TopDNSSECParamsDateRange = "28d"
+ AS112TopDNSSECParamsDateRange12w AS112TopDNSSECParamsDateRange = "12w"
+ AS112TopDNSSECParamsDateRange24w AS112TopDNSSECParamsDateRange = "24w"
+ AS112TopDNSSECParamsDateRange52w AS112TopDNSSECParamsDateRange = "52w"
+ AS112TopDNSSECParamsDateRange1dControl AS112TopDNSSECParamsDateRange = "1dControl"
+ AS112TopDNSSECParamsDateRange2dControl AS112TopDNSSECParamsDateRange = "2dControl"
+ AS112TopDNSSECParamsDateRange7dControl AS112TopDNSSECParamsDateRange = "7dControl"
+ AS112TopDNSSECParamsDateRange14dControl AS112TopDNSSECParamsDateRange = "14dControl"
+ AS112TopDNSSECParamsDateRange28dControl AS112TopDNSSECParamsDateRange = "28dControl"
+ AS112TopDNSSECParamsDateRange12wControl AS112TopDNSSECParamsDateRange = "12wControl"
+ AS112TopDNSSECParamsDateRange24wControl AS112TopDNSSECParamsDateRange = "24wControl"
+)
+
+// Format results are returned in.
+type AS112TopDNSSECParamsFormat string
+
+const (
+ AS112TopDNSSECParamsFormatJson AS112TopDNSSECParamsFormat = "JSON"
+ AS112TopDNSSECParamsFormatCsv AS112TopDNSSECParamsFormat = "CSV"
+)
+
+type AS112TopDNSSECResponseEnvelope struct {
+ Result AS112TopDNSSECResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON as112TopDNSSECResponseEnvelopeJSON `json:"-"`
+}
+
+// as112TopDNSSECResponseEnvelopeJSON contains the JSON metadata for the struct
+// [AS112TopDNSSECResponseEnvelope]
+type as112TopDNSSECResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112TopDNSSECResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112TopDNSSECResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112TopEdnsParams 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"`
+ // 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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]AS112TopEdnsParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Format results are returned in.
+ Format param.Field[AS112TopEdnsParamsFormat] `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 [AS112TopEdnsParams]'s query parameters as `url.Values`.
+func (r AS112TopEdnsParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// EDNS.
+type AS112TopEdnsParamsEdns string
+
+const (
+ AS112TopEdnsParamsEdnsSupported AS112TopEdnsParamsEdns = "SUPPORTED"
+ AS112TopEdnsParamsEdnsNotSupported AS112TopEdnsParamsEdns = "NOT_SUPPORTED"
+)
+
+type AS112TopEdnsParamsDateRange string
+
+const (
+ AS112TopEdnsParamsDateRange1d AS112TopEdnsParamsDateRange = "1d"
+ AS112TopEdnsParamsDateRange2d AS112TopEdnsParamsDateRange = "2d"
+ AS112TopEdnsParamsDateRange7d AS112TopEdnsParamsDateRange = "7d"
+ AS112TopEdnsParamsDateRange14d AS112TopEdnsParamsDateRange = "14d"
+ AS112TopEdnsParamsDateRange28d AS112TopEdnsParamsDateRange = "28d"
+ AS112TopEdnsParamsDateRange12w AS112TopEdnsParamsDateRange = "12w"
+ AS112TopEdnsParamsDateRange24w AS112TopEdnsParamsDateRange = "24w"
+ AS112TopEdnsParamsDateRange52w AS112TopEdnsParamsDateRange = "52w"
+ AS112TopEdnsParamsDateRange1dControl AS112TopEdnsParamsDateRange = "1dControl"
+ AS112TopEdnsParamsDateRange2dControl AS112TopEdnsParamsDateRange = "2dControl"
+ AS112TopEdnsParamsDateRange7dControl AS112TopEdnsParamsDateRange = "7dControl"
+ AS112TopEdnsParamsDateRange14dControl AS112TopEdnsParamsDateRange = "14dControl"
+ AS112TopEdnsParamsDateRange28dControl AS112TopEdnsParamsDateRange = "28dControl"
+ AS112TopEdnsParamsDateRange12wControl AS112TopEdnsParamsDateRange = "12wControl"
+ AS112TopEdnsParamsDateRange24wControl AS112TopEdnsParamsDateRange = "24wControl"
+)
+
+// Format results are returned in.
+type AS112TopEdnsParamsFormat string
+
+const (
+ AS112TopEdnsParamsFormatJson AS112TopEdnsParamsFormat = "JSON"
+ AS112TopEdnsParamsFormatCsv AS112TopEdnsParamsFormat = "CSV"
+)
+
+type AS112TopEdnsResponseEnvelope struct {
+ Result AS112TopEdnsResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON as112TopEdnsResponseEnvelopeJSON `json:"-"`
+}
+
+// as112TopEdnsResponseEnvelopeJSON contains the JSON metadata for the struct
+// [AS112TopEdnsResponseEnvelope]
+type as112TopEdnsResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112TopEdnsResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112TopEdnsResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112TopIPVersionParams 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"`
+ // 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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]AS112TopIPVersionParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Format results are returned in.
+ Format param.Field[AS112TopIPVersionParamsFormat] `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 [AS112TopIPVersionParams]'s query parameters as
+// `url.Values`.
+func (r AS112TopIPVersionParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// IP Version.
+type AS112TopIPVersionParamsIPVersion string
+
+const (
+ AS112TopIPVersionParamsIPVersionIPv4 AS112TopIPVersionParamsIPVersion = "IPv4"
+ AS112TopIPVersionParamsIPVersionIPv6 AS112TopIPVersionParamsIPVersion = "IPv6"
+)
+
+type AS112TopIPVersionParamsDateRange string
+
+const (
+ AS112TopIPVersionParamsDateRange1d AS112TopIPVersionParamsDateRange = "1d"
+ AS112TopIPVersionParamsDateRange2d AS112TopIPVersionParamsDateRange = "2d"
+ AS112TopIPVersionParamsDateRange7d AS112TopIPVersionParamsDateRange = "7d"
+ AS112TopIPVersionParamsDateRange14d AS112TopIPVersionParamsDateRange = "14d"
+ AS112TopIPVersionParamsDateRange28d AS112TopIPVersionParamsDateRange = "28d"
+ AS112TopIPVersionParamsDateRange12w AS112TopIPVersionParamsDateRange = "12w"
+ AS112TopIPVersionParamsDateRange24w AS112TopIPVersionParamsDateRange = "24w"
+ AS112TopIPVersionParamsDateRange52w AS112TopIPVersionParamsDateRange = "52w"
+ AS112TopIPVersionParamsDateRange1dControl AS112TopIPVersionParamsDateRange = "1dControl"
+ AS112TopIPVersionParamsDateRange2dControl AS112TopIPVersionParamsDateRange = "2dControl"
+ AS112TopIPVersionParamsDateRange7dControl AS112TopIPVersionParamsDateRange = "7dControl"
+ AS112TopIPVersionParamsDateRange14dControl AS112TopIPVersionParamsDateRange = "14dControl"
+ AS112TopIPVersionParamsDateRange28dControl AS112TopIPVersionParamsDateRange = "28dControl"
+ AS112TopIPVersionParamsDateRange12wControl AS112TopIPVersionParamsDateRange = "12wControl"
+ AS112TopIPVersionParamsDateRange24wControl AS112TopIPVersionParamsDateRange = "24wControl"
+)
+
+// Format results are returned in.
+type AS112TopIPVersionParamsFormat string
+
+const (
+ AS112TopIPVersionParamsFormatJson AS112TopIPVersionParamsFormat = "JSON"
+ AS112TopIPVersionParamsFormatCsv AS112TopIPVersionParamsFormat = "CSV"
+)
+
+type AS112TopIPVersionResponseEnvelope struct {
+ Result AS112TopIPVersionResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON as112TopIPVersionResponseEnvelopeJSON `json:"-"`
+}
+
+// as112TopIPVersionResponseEnvelopeJSON contains the JSON metadata for the struct
+// [AS112TopIPVersionResponseEnvelope]
+type as112TopIPVersionResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112TopIPVersionResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112TopIPVersionResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AS112TopLocationsParams 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"`
+ // 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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]AS112TopLocationsParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Format results are returned in.
+ Format param.Field[AS112TopLocationsParamsFormat] `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 [AS112TopLocationsParams]'s query parameters as
+// `url.Values`.
+func (r AS112TopLocationsParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type AS112TopLocationsParamsDateRange string
+
+const (
+ AS112TopLocationsParamsDateRange1d AS112TopLocationsParamsDateRange = "1d"
+ AS112TopLocationsParamsDateRange2d AS112TopLocationsParamsDateRange = "2d"
+ AS112TopLocationsParamsDateRange7d AS112TopLocationsParamsDateRange = "7d"
+ AS112TopLocationsParamsDateRange14d AS112TopLocationsParamsDateRange = "14d"
+ AS112TopLocationsParamsDateRange28d AS112TopLocationsParamsDateRange = "28d"
+ AS112TopLocationsParamsDateRange12w AS112TopLocationsParamsDateRange = "12w"
+ AS112TopLocationsParamsDateRange24w AS112TopLocationsParamsDateRange = "24w"
+ AS112TopLocationsParamsDateRange52w AS112TopLocationsParamsDateRange = "52w"
+ AS112TopLocationsParamsDateRange1dControl AS112TopLocationsParamsDateRange = "1dControl"
+ AS112TopLocationsParamsDateRange2dControl AS112TopLocationsParamsDateRange = "2dControl"
+ AS112TopLocationsParamsDateRange7dControl AS112TopLocationsParamsDateRange = "7dControl"
+ AS112TopLocationsParamsDateRange14dControl AS112TopLocationsParamsDateRange = "14dControl"
+ AS112TopLocationsParamsDateRange28dControl AS112TopLocationsParamsDateRange = "28dControl"
+ AS112TopLocationsParamsDateRange12wControl AS112TopLocationsParamsDateRange = "12wControl"
+ AS112TopLocationsParamsDateRange24wControl AS112TopLocationsParamsDateRange = "24wControl"
+)
+
+// Format results are returned in.
+type AS112TopLocationsParamsFormat string
+
+const (
+ AS112TopLocationsParamsFormatJson AS112TopLocationsParamsFormat = "JSON"
+ AS112TopLocationsParamsFormatCsv AS112TopLocationsParamsFormat = "CSV"
+)
+
+type AS112TopLocationsResponseEnvelope struct {
+ Result AS112TopLocationsResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON as112TopLocationsResponseEnvelopeJSON `json:"-"`
+}
+
+// as112TopLocationsResponseEnvelopeJSON contains the JSON metadata for the struct
+// [AS112TopLocationsResponseEnvelope]
+type as112TopLocationsResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AS112TopLocationsResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r as112TopLocationsResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/radar/as112top_test.go b/radar/as112top_test.go
new file mode 100644
index 00000000000..bfd139cb4e4
--- /dev/null
+++ b/radar/as112top_test.go
@@ -0,0 +1,164 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/radar"
+)
+
+func TestAS112TopDNSSECWithOptionalParams(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"),
+ )
+ _, err := client.Radar.AS112.Top.DNSSEC(
+ context.TODO(),
+ radar.AS112TopDNSSECParamsDNSSECSupported,
+ radar.AS112TopDNSSECParams{
+ 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([]radar.AS112TopDNSSECParamsDateRange{radar.AS112TopDNSSECParamsDateRange1d, radar.AS112TopDNSSECParamsDateRange2d, radar.AS112TopDNSSECParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Format: cloudflare.F(radar.AS112TopDNSSECParamsFormatJson),
+ 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())
+ }
+}
+
+func TestAS112TopEdnsWithOptionalParams(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"),
+ )
+ _, err := client.Radar.AS112.Top.Edns(
+ context.TODO(),
+ radar.AS112TopEdnsParamsEdnsSupported,
+ radar.AS112TopEdnsParams{
+ 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([]radar.AS112TopEdnsParamsDateRange{radar.AS112TopEdnsParamsDateRange1d, radar.AS112TopEdnsParamsDateRange2d, radar.AS112TopEdnsParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Format: cloudflare.F(radar.AS112TopEdnsParamsFormatJson),
+ 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())
+ }
+}
+
+func TestAS112TopIPVersionWithOptionalParams(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"),
+ )
+ _, err := client.Radar.AS112.Top.IPVersion(
+ context.TODO(),
+ radar.AS112TopIPVersionParamsIPVersionIPv4,
+ radar.AS112TopIPVersionParams{
+ 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([]radar.AS112TopIPVersionParamsDateRange{radar.AS112TopIPVersionParamsDateRange1d, radar.AS112TopIPVersionParamsDateRange2d, radar.AS112TopIPVersionParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Format: cloudflare.F(radar.AS112TopIPVersionParamsFormatJson),
+ 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())
+ }
+}
+
+func TestAS112TopLocationsWithOptionalParams(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"),
+ )
+ _, err := client.Radar.AS112.Top.Locations(context.TODO(), radar.AS112TopLocationsParams{
+ 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([]radar.AS112TopLocationsParamsDateRange{radar.AS112TopLocationsParamsDateRange1d, radar.AS112TopLocationsParamsDateRange2d, radar.AS112TopLocationsParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Format: cloudflare.F(radar.AS112TopLocationsParamsFormatJson),
+ 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/radar/attack.go b/radar/attack.go
new file mode 100644
index 00000000000..c3a6d34bbe0
--- /dev/null
+++ b/radar/attack.go
@@ -0,0 +1,28 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// AttackService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewAttackService] method instead.
+type AttackService struct {
+ Options []option.RequestOption
+ Layer3 *AttackLayer3Service
+ Layer7 *AttackLayer7Service
+}
+
+// NewAttackService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewAttackService(opts ...option.RequestOption) (r *AttackService) {
+ r = &AttackService{}
+ r.Options = opts
+ r.Layer3 = NewAttackLayer3Service(opts...)
+ r.Layer7 = NewAttackLayer7Service(opts...)
+ return
+}
diff --git a/radar/attacklayer3.go b/radar/attacklayer3.go
new file mode 100644
index 00000000000..914a2af70c5
--- /dev/null
+++ b/radar/attacklayer3.go
@@ -0,0 +1,256 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "context"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// AttackLayer3Service contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewAttackLayer3Service] method
+// instead.
+type AttackLayer3Service struct {
+ Options []option.RequestOption
+ Summary *AttackLayer3SummaryService
+ TimeseriesGroups *AttackLayer3TimeseriesGroupService
+ Top *AttackLayer3TopService
+}
+
+// NewAttackLayer3Service generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewAttackLayer3Service(opts ...option.RequestOption) (r *AttackLayer3Service) {
+ r = &AttackLayer3Service{}
+ r.Options = opts
+ r.Summary = NewAttackLayer3SummaryService(opts...)
+ r.TimeseriesGroups = NewAttackLayer3TimeseriesGroupService(opts...)
+ r.Top = NewAttackLayer3TopService(opts...)
+ return
+}
+
+// Get attacks change over time by bytes.
+func (r *AttackLayer3Service) Timeseries(ctx context.Context, query AttackLayer3TimeseriesParams, opts ...option.RequestOption) (res *AttackLayer3TimeseriesResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AttackLayer3TimeseriesResponseEnvelope
+ path := "radar/attacks/layer3/timeseries"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type AttackLayer3TimeseriesResponse struct {
+ Meta interface{} `json:"meta,required"`
+ Serie0 AttackLayer3TimeseriesResponseSerie0 `json:"serie_0,required"`
+ JSON attackLayer3TimeseriesResponseJSON `json:"-"`
+}
+
+// attackLayer3TimeseriesResponseJSON contains the JSON metadata for the struct
+// [AttackLayer3TimeseriesResponse]
+type attackLayer3TimeseriesResponseJSON struct {
+ Meta apijson.Field
+ Serie0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3TimeseriesResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3TimeseriesResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3TimeseriesResponseSerie0 struct {
+ Timestamps []string `json:"timestamps,required"`
+ Values []string `json:"values,required"`
+ JSON attackLayer3TimeseriesResponseSerie0JSON `json:"-"`
+}
+
+// attackLayer3TimeseriesResponseSerie0JSON contains the JSON metadata for the
+// struct [AttackLayer3TimeseriesResponseSerie0]
+type attackLayer3TimeseriesResponseSerie0JSON struct {
+ Timestamps apijson.Field
+ Values apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3TimeseriesResponseSerie0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3TimeseriesResponseSerie0JSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3TimeseriesParams struct {
+ // Aggregation interval results should be returned in (for example, in 15 minutes
+ // or 1 hour intervals). Refer to
+ // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+ AggInterval param.Field[AttackLayer3TimeseriesParamsAggInterval] `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"`
+ // 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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]AttackLayer3TimeseriesParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Together with the `location` parameter, will apply the filter to origin or
+ // target location.
+ Direction param.Field[AttackLayer3TimeseriesParamsDirection] `query:"direction"`
+ // Format results are returned in.
+ Format param.Field[AttackLayer3TimeseriesParamsFormat] `query:"format"`
+ // Filter for ip version.
+ IPVersion param.Field[[]AttackLayer3TimeseriesParamsIPVersion] `query:"ipVersion"`
+ // 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"`
+ // Measurement units, eg. bytes.
+ Metric param.Field[AttackLayer3TimeseriesParamsMetric] `query:"metric"`
+ // Array of names that will be used to name the series in responses.
+ Name param.Field[[]string] `query:"name"`
+ // Normalization method applied. Refer to
+ // [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/).
+ Normalization param.Field[AttackLayer3TimeseriesParamsNormalization] `query:"normalization"`
+ // Array of L3/4 attack types.
+ Protocol param.Field[[]AttackLayer3TimeseriesParamsProtocol] `query:"protocol"`
+}
+
+// URLQuery serializes [AttackLayer3TimeseriesParams]'s query parameters as
+// `url.Values`.
+func (r AttackLayer3TimeseriesParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Aggregation interval results should be returned in (for example, in 15 minutes
+// or 1 hour intervals). Refer to
+// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+type AttackLayer3TimeseriesParamsAggInterval string
+
+const (
+ AttackLayer3TimeseriesParamsAggInterval15m AttackLayer3TimeseriesParamsAggInterval = "15m"
+ AttackLayer3TimeseriesParamsAggInterval1h AttackLayer3TimeseriesParamsAggInterval = "1h"
+ AttackLayer3TimeseriesParamsAggInterval1d AttackLayer3TimeseriesParamsAggInterval = "1d"
+ AttackLayer3TimeseriesParamsAggInterval1w AttackLayer3TimeseriesParamsAggInterval = "1w"
+)
+
+type AttackLayer3TimeseriesParamsDateRange string
+
+const (
+ AttackLayer3TimeseriesParamsDateRange1d AttackLayer3TimeseriesParamsDateRange = "1d"
+ AttackLayer3TimeseriesParamsDateRange2d AttackLayer3TimeseriesParamsDateRange = "2d"
+ AttackLayer3TimeseriesParamsDateRange7d AttackLayer3TimeseriesParamsDateRange = "7d"
+ AttackLayer3TimeseriesParamsDateRange14d AttackLayer3TimeseriesParamsDateRange = "14d"
+ AttackLayer3TimeseriesParamsDateRange28d AttackLayer3TimeseriesParamsDateRange = "28d"
+ AttackLayer3TimeseriesParamsDateRange12w AttackLayer3TimeseriesParamsDateRange = "12w"
+ AttackLayer3TimeseriesParamsDateRange24w AttackLayer3TimeseriesParamsDateRange = "24w"
+ AttackLayer3TimeseriesParamsDateRange52w AttackLayer3TimeseriesParamsDateRange = "52w"
+ AttackLayer3TimeseriesParamsDateRange1dControl AttackLayer3TimeseriesParamsDateRange = "1dControl"
+ AttackLayer3TimeseriesParamsDateRange2dControl AttackLayer3TimeseriesParamsDateRange = "2dControl"
+ AttackLayer3TimeseriesParamsDateRange7dControl AttackLayer3TimeseriesParamsDateRange = "7dControl"
+ AttackLayer3TimeseriesParamsDateRange14dControl AttackLayer3TimeseriesParamsDateRange = "14dControl"
+ AttackLayer3TimeseriesParamsDateRange28dControl AttackLayer3TimeseriesParamsDateRange = "28dControl"
+ AttackLayer3TimeseriesParamsDateRange12wControl AttackLayer3TimeseriesParamsDateRange = "12wControl"
+ AttackLayer3TimeseriesParamsDateRange24wControl AttackLayer3TimeseriesParamsDateRange = "24wControl"
+)
+
+// Together with the `location` parameter, will apply the filter to origin or
+// target location.
+type AttackLayer3TimeseriesParamsDirection string
+
+const (
+ AttackLayer3TimeseriesParamsDirectionOrigin AttackLayer3TimeseriesParamsDirection = "ORIGIN"
+ AttackLayer3TimeseriesParamsDirectionTarget AttackLayer3TimeseriesParamsDirection = "TARGET"
+)
+
+// Format results are returned in.
+type AttackLayer3TimeseriesParamsFormat string
+
+const (
+ AttackLayer3TimeseriesParamsFormatJson AttackLayer3TimeseriesParamsFormat = "JSON"
+ AttackLayer3TimeseriesParamsFormatCsv AttackLayer3TimeseriesParamsFormat = "CSV"
+)
+
+type AttackLayer3TimeseriesParamsIPVersion string
+
+const (
+ AttackLayer3TimeseriesParamsIPVersionIPv4 AttackLayer3TimeseriesParamsIPVersion = "IPv4"
+ AttackLayer3TimeseriesParamsIPVersionIPv6 AttackLayer3TimeseriesParamsIPVersion = "IPv6"
+)
+
+// Measurement units, eg. bytes.
+type AttackLayer3TimeseriesParamsMetric string
+
+const (
+ AttackLayer3TimeseriesParamsMetricBytes AttackLayer3TimeseriesParamsMetric = "BYTES"
+ AttackLayer3TimeseriesParamsMetricBytesOld AttackLayer3TimeseriesParamsMetric = "BYTES_OLD"
+)
+
+// Normalization method applied. Refer to
+// [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/).
+type AttackLayer3TimeseriesParamsNormalization string
+
+const (
+ AttackLayer3TimeseriesParamsNormalizationPercentageChange AttackLayer3TimeseriesParamsNormalization = "PERCENTAGE_CHANGE"
+ AttackLayer3TimeseriesParamsNormalizationMin0Max AttackLayer3TimeseriesParamsNormalization = "MIN0_MAX"
+)
+
+type AttackLayer3TimeseriesParamsProtocol string
+
+const (
+ AttackLayer3TimeseriesParamsProtocolUdp AttackLayer3TimeseriesParamsProtocol = "UDP"
+ AttackLayer3TimeseriesParamsProtocolTcp AttackLayer3TimeseriesParamsProtocol = "TCP"
+ AttackLayer3TimeseriesParamsProtocolIcmp AttackLayer3TimeseriesParamsProtocol = "ICMP"
+ AttackLayer3TimeseriesParamsProtocolGRE AttackLayer3TimeseriesParamsProtocol = "GRE"
+)
+
+type AttackLayer3TimeseriesResponseEnvelope struct {
+ Result AttackLayer3TimeseriesResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON attackLayer3TimeseriesResponseEnvelopeJSON `json:"-"`
+}
+
+// attackLayer3TimeseriesResponseEnvelopeJSON contains the JSON metadata for the
+// struct [AttackLayer3TimeseriesResponseEnvelope]
+type attackLayer3TimeseriesResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3TimeseriesResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3TimeseriesResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/radar/attacklayer3_test.go b/radar/attacklayer3_test.go
new file mode 100644
index 00000000000..723b598e7c7
--- /dev/null
+++ b/radar/attacklayer3_test.go
@@ -0,0 +1,55 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/radar"
+)
+
+func TestAttackLayer3TimeseriesWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Attacks.Layer3.Timeseries(context.TODO(), radar.AttackLayer3TimeseriesParams{
+ AggInterval: cloudflare.F(radar.AttackLayer3TimeseriesParamsAggInterval1h),
+ 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([]radar.AttackLayer3TimeseriesParamsDateRange{radar.AttackLayer3TimeseriesParamsDateRange1d, radar.AttackLayer3TimeseriesParamsDateRange2d, radar.AttackLayer3TimeseriesParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Direction: cloudflare.F(radar.AttackLayer3TimeseriesParamsDirectionOrigin),
+ Format: cloudflare.F(radar.AttackLayer3TimeseriesParamsFormatJson),
+ IPVersion: cloudflare.F([]radar.AttackLayer3TimeseriesParamsIPVersion{radar.AttackLayer3TimeseriesParamsIPVersionIPv4, radar.AttackLayer3TimeseriesParamsIPVersionIPv6}),
+ Location: cloudflare.F([]string{"string", "string", "string"}),
+ Metric: cloudflare.F(radar.AttackLayer3TimeseriesParamsMetricBytes),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ Normalization: cloudflare.F(radar.AttackLayer3TimeseriesParamsNormalizationMin0Max),
+ Protocol: cloudflare.F([]radar.AttackLayer3TimeseriesParamsProtocol{radar.AttackLayer3TimeseriesParamsProtocolUdp, radar.AttackLayer3TimeseriesParamsProtocolTcp, radar.AttackLayer3TimeseriesParamsProtocolIcmp}),
+ })
+ 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/radar/attacklayer3summary.go b/radar/attacklayer3summary.go
new file mode 100644
index 00000000000..01a3b66aabf
--- /dev/null
+++ b/radar/attacklayer3summary.go
@@ -0,0 +1,1680 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "context"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// AttackLayer3SummaryService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewAttackLayer3SummaryService]
+// method instead.
+type AttackLayer3SummaryService struct {
+ Options []option.RequestOption
+}
+
+// NewAttackLayer3SummaryService generates a new service that applies the given
+// options to each request. These options are applied after the parent client's
+// options (if there is one), and before any request-specific options.
+func NewAttackLayer3SummaryService(opts ...option.RequestOption) (r *AttackLayer3SummaryService) {
+ r = &AttackLayer3SummaryService{}
+ r.Options = opts
+ return
+}
+
+// Percentage distribution of attacks by bitrate.
+func (r *AttackLayer3SummaryService) Bitrate(ctx context.Context, query AttackLayer3SummaryBitrateParams, opts ...option.RequestOption) (res *AttackLayer3SummaryBitrateResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AttackLayer3SummaryBitrateResponseEnvelope
+ path := "radar/attacks/layer3/summary/bitrate"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Percentage distribution of attacks by duration.
+func (r *AttackLayer3SummaryService) Duration(ctx context.Context, query AttackLayer3SummaryDurationParams, opts ...option.RequestOption) (res *AttackLayer3SummaryDurationResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AttackLayer3SummaryDurationResponseEnvelope
+ path := "radar/attacks/layer3/summary/duration"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Percentage distribution of network protocols in layer 3/4 attacks over a given
+// time period.
+func (r *AttackLayer3SummaryService) Get(ctx context.Context, query AttackLayer3SummaryGetParams, opts ...option.RequestOption) (res *AttackLayer3SummaryGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AttackLayer3SummaryGetResponseEnvelope
+ path := "radar/attacks/layer3/summary"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Percentage distribution of attacks by ip version used.
+func (r *AttackLayer3SummaryService) IPVersion(ctx context.Context, query AttackLayer3SummaryIPVersionParams, opts ...option.RequestOption) (res *AttackLayer3SummaryIPVersionResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AttackLayer3SummaryIPVersionResponseEnvelope
+ path := "radar/attacks/layer3/summary/ip_version"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Percentage distribution of attacks by protocol used.
+func (r *AttackLayer3SummaryService) Protocol(ctx context.Context, query AttackLayer3SummaryProtocolParams, opts ...option.RequestOption) (res *AttackLayer3SummaryProtocolResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AttackLayer3SummaryProtocolResponseEnvelope
+ path := "radar/attacks/layer3/summary/protocol"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Percentage distribution of attacks by vector.
+func (r *AttackLayer3SummaryService) Vector(ctx context.Context, query AttackLayer3SummaryVectorParams, opts ...option.RequestOption) (res *AttackLayer3SummaryVectorResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AttackLayer3SummaryVectorResponseEnvelope
+ path := "radar/attacks/layer3/summary/vector"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type AttackLayer3SummaryBitrateResponse struct {
+ Meta AttackLayer3SummaryBitrateResponseMeta `json:"meta,required"`
+ Summary0 AttackLayer3SummaryBitrateResponseSummary0 `json:"summary_0,required"`
+ JSON attackLayer3SummaryBitrateResponseJSON `json:"-"`
+}
+
+// attackLayer3SummaryBitrateResponseJSON contains the JSON metadata for the struct
+// [AttackLayer3SummaryBitrateResponse]
+type attackLayer3SummaryBitrateResponseJSON struct {
+ Meta apijson.Field
+ Summary0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3SummaryBitrateResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3SummaryBitrateResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3SummaryBitrateResponseMeta struct {
+ DateRange []AttackLayer3SummaryBitrateResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ Normalization string `json:"normalization,required"`
+ ConfidenceInfo AttackLayer3SummaryBitrateResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON attackLayer3SummaryBitrateResponseMetaJSON `json:"-"`
+}
+
+// attackLayer3SummaryBitrateResponseMetaJSON contains the JSON metadata for the
+// struct [AttackLayer3SummaryBitrateResponseMeta]
+type attackLayer3SummaryBitrateResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ Normalization apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3SummaryBitrateResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3SummaryBitrateResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3SummaryBitrateResponseMetaDateRange 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 attackLayer3SummaryBitrateResponseMetaDateRangeJSON `json:"-"`
+}
+
+// attackLayer3SummaryBitrateResponseMetaDateRangeJSON contains the JSON metadata
+// for the struct [AttackLayer3SummaryBitrateResponseMetaDateRange]
+type attackLayer3SummaryBitrateResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3SummaryBitrateResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3SummaryBitrateResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3SummaryBitrateResponseMetaConfidenceInfo struct {
+ Annotations []AttackLayer3SummaryBitrateResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON attackLayer3SummaryBitrateResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// attackLayer3SummaryBitrateResponseMetaConfidenceInfoJSON contains the JSON
+// metadata for the struct [AttackLayer3SummaryBitrateResponseMetaConfidenceInfo]
+type attackLayer3SummaryBitrateResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3SummaryBitrateResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3SummaryBitrateResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3SummaryBitrateResponseMetaConfidenceInfoAnnotation 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 attackLayer3SummaryBitrateResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// attackLayer3SummaryBitrateResponseMetaConfidenceInfoAnnotationJSON contains the
+// JSON metadata for the struct
+// [AttackLayer3SummaryBitrateResponseMetaConfidenceInfoAnnotation]
+type attackLayer3SummaryBitrateResponseMetaConfidenceInfoAnnotationJSON 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 *AttackLayer3SummaryBitrateResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3SummaryBitrateResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3SummaryBitrateResponseSummary0 struct {
+ Number1GbpsTo10Gbps string `json:"_1_GBPS_TO_10_GBPS,required"`
+ Number10GbpsTo100Gbps string `json:"_10_GBPS_TO_100_GBPS,required"`
+ Number500MbpsTo1Gbps string `json:"_500_MBPS_TO_1_GBPS,required"`
+ Over100Gbps string `json:"OVER_100_GBPS,required"`
+ Under500Mbps string `json:"UNDER_500_MBPS,required"`
+ JSON attackLayer3SummaryBitrateResponseSummary0JSON `json:"-"`
+}
+
+// attackLayer3SummaryBitrateResponseSummary0JSON contains the JSON metadata for
+// the struct [AttackLayer3SummaryBitrateResponseSummary0]
+type attackLayer3SummaryBitrateResponseSummary0JSON struct {
+ Number1GbpsTo10Gbps apijson.Field
+ Number10GbpsTo100Gbps apijson.Field
+ Number500MbpsTo1Gbps apijson.Field
+ Over100Gbps apijson.Field
+ Under500Mbps apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3SummaryBitrateResponseSummary0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3SummaryBitrateResponseSummary0JSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3SummaryDurationResponse struct {
+ Meta AttackLayer3SummaryDurationResponseMeta `json:"meta,required"`
+ Summary0 AttackLayer3SummaryDurationResponseSummary0 `json:"summary_0,required"`
+ JSON attackLayer3SummaryDurationResponseJSON `json:"-"`
+}
+
+// attackLayer3SummaryDurationResponseJSON contains the JSON metadata for the
+// struct [AttackLayer3SummaryDurationResponse]
+type attackLayer3SummaryDurationResponseJSON struct {
+ Meta apijson.Field
+ Summary0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3SummaryDurationResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3SummaryDurationResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3SummaryDurationResponseMeta struct {
+ DateRange []AttackLayer3SummaryDurationResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ Normalization string `json:"normalization,required"`
+ ConfidenceInfo AttackLayer3SummaryDurationResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON attackLayer3SummaryDurationResponseMetaJSON `json:"-"`
+}
+
+// attackLayer3SummaryDurationResponseMetaJSON contains the JSON metadata for the
+// struct [AttackLayer3SummaryDurationResponseMeta]
+type attackLayer3SummaryDurationResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ Normalization apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3SummaryDurationResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3SummaryDurationResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3SummaryDurationResponseMetaDateRange 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 attackLayer3SummaryDurationResponseMetaDateRangeJSON `json:"-"`
+}
+
+// attackLayer3SummaryDurationResponseMetaDateRangeJSON contains the JSON metadata
+// for the struct [AttackLayer3SummaryDurationResponseMetaDateRange]
+type attackLayer3SummaryDurationResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3SummaryDurationResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3SummaryDurationResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3SummaryDurationResponseMetaConfidenceInfo struct {
+ Annotations []AttackLayer3SummaryDurationResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON attackLayer3SummaryDurationResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// attackLayer3SummaryDurationResponseMetaConfidenceInfoJSON contains the JSON
+// metadata for the struct [AttackLayer3SummaryDurationResponseMetaConfidenceInfo]
+type attackLayer3SummaryDurationResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3SummaryDurationResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3SummaryDurationResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3SummaryDurationResponseMetaConfidenceInfoAnnotation 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 attackLayer3SummaryDurationResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// attackLayer3SummaryDurationResponseMetaConfidenceInfoAnnotationJSON contains the
+// JSON metadata for the struct
+// [AttackLayer3SummaryDurationResponseMetaConfidenceInfoAnnotation]
+type attackLayer3SummaryDurationResponseMetaConfidenceInfoAnnotationJSON 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 *AttackLayer3SummaryDurationResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3SummaryDurationResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3SummaryDurationResponseSummary0 struct {
+ Number1HourTo3Hours string `json:"_1_HOUR_TO_3_HOURS,required"`
+ Number10MinsTo20Mins string `json:"_10_MINS_TO_20_MINS,required"`
+ Number20MinsTo40Mins string `json:"_20_MINS_TO_40_MINS,required"`
+ Number40MinsTo1Hour string `json:"_40_MINS_TO_1_HOUR,required"`
+ Over3Hours string `json:"OVER_3_HOURS,required"`
+ Under10Mins string `json:"UNDER_10_MINS,required"`
+ JSON attackLayer3SummaryDurationResponseSummary0JSON `json:"-"`
+}
+
+// attackLayer3SummaryDurationResponseSummary0JSON contains the JSON metadata for
+// the struct [AttackLayer3SummaryDurationResponseSummary0]
+type attackLayer3SummaryDurationResponseSummary0JSON struct {
+ Number1HourTo3Hours apijson.Field
+ Number10MinsTo20Mins apijson.Field
+ Number20MinsTo40Mins apijson.Field
+ Number40MinsTo1Hour apijson.Field
+ Over3Hours apijson.Field
+ Under10Mins apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3SummaryDurationResponseSummary0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3SummaryDurationResponseSummary0JSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3SummaryGetResponse struct {
+ Meta AttackLayer3SummaryGetResponseMeta `json:"meta,required"`
+ Summary0 AttackLayer3SummaryGetResponseSummary0 `json:"summary_0,required"`
+ JSON attackLayer3SummaryGetResponseJSON `json:"-"`
+}
+
+// attackLayer3SummaryGetResponseJSON contains the JSON metadata for the struct
+// [AttackLayer3SummaryGetResponse]
+type attackLayer3SummaryGetResponseJSON struct {
+ Meta apijson.Field
+ Summary0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3SummaryGetResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3SummaryGetResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3SummaryGetResponseMeta struct {
+ DateRange []AttackLayer3SummaryGetResponseMetaDateRange `json:"dateRange,required"`
+ ConfidenceInfo AttackLayer3SummaryGetResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON attackLayer3SummaryGetResponseMetaJSON `json:"-"`
+}
+
+// attackLayer3SummaryGetResponseMetaJSON contains the JSON metadata for the struct
+// [AttackLayer3SummaryGetResponseMeta]
+type attackLayer3SummaryGetResponseMetaJSON struct {
+ DateRange apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3SummaryGetResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3SummaryGetResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3SummaryGetResponseMetaDateRange 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 attackLayer3SummaryGetResponseMetaDateRangeJSON `json:"-"`
+}
+
+// attackLayer3SummaryGetResponseMetaDateRangeJSON contains the JSON metadata for
+// the struct [AttackLayer3SummaryGetResponseMetaDateRange]
+type attackLayer3SummaryGetResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3SummaryGetResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3SummaryGetResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3SummaryGetResponseMetaConfidenceInfo struct {
+ Annotations []AttackLayer3SummaryGetResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON attackLayer3SummaryGetResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// attackLayer3SummaryGetResponseMetaConfidenceInfoJSON contains the JSON metadata
+// for the struct [AttackLayer3SummaryGetResponseMetaConfidenceInfo]
+type attackLayer3SummaryGetResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3SummaryGetResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3SummaryGetResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3SummaryGetResponseMetaConfidenceInfoAnnotation 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 attackLayer3SummaryGetResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// attackLayer3SummaryGetResponseMetaConfidenceInfoAnnotationJSON contains the JSON
+// metadata for the struct
+// [AttackLayer3SummaryGetResponseMetaConfidenceInfoAnnotation]
+type attackLayer3SummaryGetResponseMetaConfidenceInfoAnnotationJSON 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 *AttackLayer3SummaryGetResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3SummaryGetResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3SummaryGetResponseSummary0 struct {
+ GRE string `json:"gre,required"`
+ Icmp string `json:"icmp,required"`
+ Tcp string `json:"tcp,required"`
+ Udp string `json:"udp,required"`
+ JSON attackLayer3SummaryGetResponseSummary0JSON `json:"-"`
+}
+
+// attackLayer3SummaryGetResponseSummary0JSON contains the JSON metadata for the
+// struct [AttackLayer3SummaryGetResponseSummary0]
+type attackLayer3SummaryGetResponseSummary0JSON struct {
+ GRE apijson.Field
+ Icmp apijson.Field
+ Tcp apijson.Field
+ Udp apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3SummaryGetResponseSummary0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3SummaryGetResponseSummary0JSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3SummaryIPVersionResponse struct {
+ Meta AttackLayer3SummaryIPVersionResponseMeta `json:"meta,required"`
+ Summary0 AttackLayer3SummaryIPVersionResponseSummary0 `json:"summary_0,required"`
+ JSON attackLayer3SummaryIPVersionResponseJSON `json:"-"`
+}
+
+// attackLayer3SummaryIPVersionResponseJSON contains the JSON metadata for the
+// struct [AttackLayer3SummaryIPVersionResponse]
+type attackLayer3SummaryIPVersionResponseJSON struct {
+ Meta apijson.Field
+ Summary0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3SummaryIPVersionResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3SummaryIPVersionResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3SummaryIPVersionResponseMeta struct {
+ DateRange []AttackLayer3SummaryIPVersionResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ Normalization string `json:"normalization,required"`
+ ConfidenceInfo AttackLayer3SummaryIPVersionResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON attackLayer3SummaryIPVersionResponseMetaJSON `json:"-"`
+}
+
+// attackLayer3SummaryIPVersionResponseMetaJSON contains the JSON metadata for the
+// struct [AttackLayer3SummaryIPVersionResponseMeta]
+type attackLayer3SummaryIPVersionResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ Normalization apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3SummaryIPVersionResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3SummaryIPVersionResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3SummaryIPVersionResponseMetaDateRange 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 attackLayer3SummaryIPVersionResponseMetaDateRangeJSON `json:"-"`
+}
+
+// attackLayer3SummaryIPVersionResponseMetaDateRangeJSON contains the JSON metadata
+// for the struct [AttackLayer3SummaryIPVersionResponseMetaDateRange]
+type attackLayer3SummaryIPVersionResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3SummaryIPVersionResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3SummaryIPVersionResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3SummaryIPVersionResponseMetaConfidenceInfo struct {
+ Annotations []AttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON attackLayer3SummaryIPVersionResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// attackLayer3SummaryIPVersionResponseMetaConfidenceInfoJSON contains the JSON
+// metadata for the struct [AttackLayer3SummaryIPVersionResponseMetaConfidenceInfo]
+type attackLayer3SummaryIPVersionResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3SummaryIPVersionResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3SummaryIPVersionResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotation 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 attackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// attackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotationJSON contains
+// the JSON metadata for the struct
+// [AttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotation]
+type attackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotationJSON 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 *AttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3SummaryIPVersionResponseSummary0 struct {
+ IPv4 string `json:"IPv4,required"`
+ IPv6 string `json:"IPv6,required"`
+ JSON attackLayer3SummaryIPVersionResponseSummary0JSON `json:"-"`
+}
+
+// attackLayer3SummaryIPVersionResponseSummary0JSON contains the JSON metadata for
+// the struct [AttackLayer3SummaryIPVersionResponseSummary0]
+type attackLayer3SummaryIPVersionResponseSummary0JSON struct {
+ IPv4 apijson.Field
+ IPv6 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3SummaryIPVersionResponseSummary0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3SummaryIPVersionResponseSummary0JSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3SummaryProtocolResponse struct {
+ Meta AttackLayer3SummaryProtocolResponseMeta `json:"meta,required"`
+ Summary0 AttackLayer3SummaryProtocolResponseSummary0 `json:"summary_0,required"`
+ JSON attackLayer3SummaryProtocolResponseJSON `json:"-"`
+}
+
+// attackLayer3SummaryProtocolResponseJSON contains the JSON metadata for the
+// struct [AttackLayer3SummaryProtocolResponse]
+type attackLayer3SummaryProtocolResponseJSON struct {
+ Meta apijson.Field
+ Summary0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3SummaryProtocolResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3SummaryProtocolResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3SummaryProtocolResponseMeta struct {
+ DateRange []AttackLayer3SummaryProtocolResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ Normalization string `json:"normalization,required"`
+ ConfidenceInfo AttackLayer3SummaryProtocolResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON attackLayer3SummaryProtocolResponseMetaJSON `json:"-"`
+}
+
+// attackLayer3SummaryProtocolResponseMetaJSON contains the JSON metadata for the
+// struct [AttackLayer3SummaryProtocolResponseMeta]
+type attackLayer3SummaryProtocolResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ Normalization apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3SummaryProtocolResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3SummaryProtocolResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3SummaryProtocolResponseMetaDateRange 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 attackLayer3SummaryProtocolResponseMetaDateRangeJSON `json:"-"`
+}
+
+// attackLayer3SummaryProtocolResponseMetaDateRangeJSON contains the JSON metadata
+// for the struct [AttackLayer3SummaryProtocolResponseMetaDateRange]
+type attackLayer3SummaryProtocolResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3SummaryProtocolResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3SummaryProtocolResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3SummaryProtocolResponseMetaConfidenceInfo struct {
+ Annotations []AttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON attackLayer3SummaryProtocolResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// attackLayer3SummaryProtocolResponseMetaConfidenceInfoJSON contains the JSON
+// metadata for the struct [AttackLayer3SummaryProtocolResponseMetaConfidenceInfo]
+type attackLayer3SummaryProtocolResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3SummaryProtocolResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3SummaryProtocolResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotation 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 attackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// attackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotationJSON contains the
+// JSON metadata for the struct
+// [AttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotation]
+type attackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotationJSON 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 *AttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3SummaryProtocolResponseSummary0 struct {
+ GRE string `json:"GRE,required"`
+ Icmp string `json:"ICMP,required"`
+ Tcp string `json:"TCP,required"`
+ Udp string `json:"UDP,required"`
+ JSON attackLayer3SummaryProtocolResponseSummary0JSON `json:"-"`
+}
+
+// attackLayer3SummaryProtocolResponseSummary0JSON contains the JSON metadata for
+// the struct [AttackLayer3SummaryProtocolResponseSummary0]
+type attackLayer3SummaryProtocolResponseSummary0JSON struct {
+ GRE apijson.Field
+ Icmp apijson.Field
+ Tcp apijson.Field
+ Udp apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3SummaryProtocolResponseSummary0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3SummaryProtocolResponseSummary0JSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3SummaryVectorResponse struct {
+ Meta AttackLayer3SummaryVectorResponseMeta `json:"meta,required"`
+ Summary0 map[string][]string `json:"summary_0,required"`
+ JSON attackLayer3SummaryVectorResponseJSON `json:"-"`
+}
+
+// attackLayer3SummaryVectorResponseJSON contains the JSON metadata for the struct
+// [AttackLayer3SummaryVectorResponse]
+type attackLayer3SummaryVectorResponseJSON struct {
+ Meta apijson.Field
+ Summary0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3SummaryVectorResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3SummaryVectorResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3SummaryVectorResponseMeta struct {
+ DateRange []AttackLayer3SummaryVectorResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ Normalization string `json:"normalization,required"`
+ ConfidenceInfo AttackLayer3SummaryVectorResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON attackLayer3SummaryVectorResponseMetaJSON `json:"-"`
+}
+
+// attackLayer3SummaryVectorResponseMetaJSON contains the JSON metadata for the
+// struct [AttackLayer3SummaryVectorResponseMeta]
+type attackLayer3SummaryVectorResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ Normalization apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3SummaryVectorResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3SummaryVectorResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3SummaryVectorResponseMetaDateRange 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 attackLayer3SummaryVectorResponseMetaDateRangeJSON `json:"-"`
+}
+
+// attackLayer3SummaryVectorResponseMetaDateRangeJSON contains the JSON metadata
+// for the struct [AttackLayer3SummaryVectorResponseMetaDateRange]
+type attackLayer3SummaryVectorResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3SummaryVectorResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3SummaryVectorResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3SummaryVectorResponseMetaConfidenceInfo struct {
+ Annotations []AttackLayer3SummaryVectorResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON attackLayer3SummaryVectorResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// attackLayer3SummaryVectorResponseMetaConfidenceInfoJSON contains the JSON
+// metadata for the struct [AttackLayer3SummaryVectorResponseMetaConfidenceInfo]
+type attackLayer3SummaryVectorResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3SummaryVectorResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3SummaryVectorResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3SummaryVectorResponseMetaConfidenceInfoAnnotation 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 attackLayer3SummaryVectorResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// attackLayer3SummaryVectorResponseMetaConfidenceInfoAnnotationJSON contains the
+// JSON metadata for the struct
+// [AttackLayer3SummaryVectorResponseMetaConfidenceInfoAnnotation]
+type attackLayer3SummaryVectorResponseMetaConfidenceInfoAnnotationJSON 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 *AttackLayer3SummaryVectorResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3SummaryVectorResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3SummaryBitrateParams 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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]AttackLayer3SummaryBitrateParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Together with the `location` parameter, will apply the filter to origin or
+ // target location.
+ Direction param.Field[AttackLayer3SummaryBitrateParamsDirection] `query:"direction"`
+ // Format results are returned in.
+ Format param.Field[AttackLayer3SummaryBitrateParamsFormat] `query:"format"`
+ // Filter for ip version.
+ IPVersion param.Field[[]AttackLayer3SummaryBitrateParamsIPVersion] `query:"ipVersion"`
+ // 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"`
+ // Array of L3/4 attack types.
+ Protocol param.Field[[]AttackLayer3SummaryBitrateParamsProtocol] `query:"protocol"`
+}
+
+// URLQuery serializes [AttackLayer3SummaryBitrateParams]'s query parameters as
+// `url.Values`.
+func (r AttackLayer3SummaryBitrateParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type AttackLayer3SummaryBitrateParamsDateRange string
+
+const (
+ AttackLayer3SummaryBitrateParamsDateRange1d AttackLayer3SummaryBitrateParamsDateRange = "1d"
+ AttackLayer3SummaryBitrateParamsDateRange2d AttackLayer3SummaryBitrateParamsDateRange = "2d"
+ AttackLayer3SummaryBitrateParamsDateRange7d AttackLayer3SummaryBitrateParamsDateRange = "7d"
+ AttackLayer3SummaryBitrateParamsDateRange14d AttackLayer3SummaryBitrateParamsDateRange = "14d"
+ AttackLayer3SummaryBitrateParamsDateRange28d AttackLayer3SummaryBitrateParamsDateRange = "28d"
+ AttackLayer3SummaryBitrateParamsDateRange12w AttackLayer3SummaryBitrateParamsDateRange = "12w"
+ AttackLayer3SummaryBitrateParamsDateRange24w AttackLayer3SummaryBitrateParamsDateRange = "24w"
+ AttackLayer3SummaryBitrateParamsDateRange52w AttackLayer3SummaryBitrateParamsDateRange = "52w"
+ AttackLayer3SummaryBitrateParamsDateRange1dControl AttackLayer3SummaryBitrateParamsDateRange = "1dControl"
+ AttackLayer3SummaryBitrateParamsDateRange2dControl AttackLayer3SummaryBitrateParamsDateRange = "2dControl"
+ AttackLayer3SummaryBitrateParamsDateRange7dControl AttackLayer3SummaryBitrateParamsDateRange = "7dControl"
+ AttackLayer3SummaryBitrateParamsDateRange14dControl AttackLayer3SummaryBitrateParamsDateRange = "14dControl"
+ AttackLayer3SummaryBitrateParamsDateRange28dControl AttackLayer3SummaryBitrateParamsDateRange = "28dControl"
+ AttackLayer3SummaryBitrateParamsDateRange12wControl AttackLayer3SummaryBitrateParamsDateRange = "12wControl"
+ AttackLayer3SummaryBitrateParamsDateRange24wControl AttackLayer3SummaryBitrateParamsDateRange = "24wControl"
+)
+
+// Together with the `location` parameter, will apply the filter to origin or
+// target location.
+type AttackLayer3SummaryBitrateParamsDirection string
+
+const (
+ AttackLayer3SummaryBitrateParamsDirectionOrigin AttackLayer3SummaryBitrateParamsDirection = "ORIGIN"
+ AttackLayer3SummaryBitrateParamsDirectionTarget AttackLayer3SummaryBitrateParamsDirection = "TARGET"
+)
+
+// Format results are returned in.
+type AttackLayer3SummaryBitrateParamsFormat string
+
+const (
+ AttackLayer3SummaryBitrateParamsFormatJson AttackLayer3SummaryBitrateParamsFormat = "JSON"
+ AttackLayer3SummaryBitrateParamsFormatCsv AttackLayer3SummaryBitrateParamsFormat = "CSV"
+)
+
+type AttackLayer3SummaryBitrateParamsIPVersion string
+
+const (
+ AttackLayer3SummaryBitrateParamsIPVersionIPv4 AttackLayer3SummaryBitrateParamsIPVersion = "IPv4"
+ AttackLayer3SummaryBitrateParamsIPVersionIPv6 AttackLayer3SummaryBitrateParamsIPVersion = "IPv6"
+)
+
+type AttackLayer3SummaryBitrateParamsProtocol string
+
+const (
+ AttackLayer3SummaryBitrateParamsProtocolUdp AttackLayer3SummaryBitrateParamsProtocol = "UDP"
+ AttackLayer3SummaryBitrateParamsProtocolTcp AttackLayer3SummaryBitrateParamsProtocol = "TCP"
+ AttackLayer3SummaryBitrateParamsProtocolIcmp AttackLayer3SummaryBitrateParamsProtocol = "ICMP"
+ AttackLayer3SummaryBitrateParamsProtocolGRE AttackLayer3SummaryBitrateParamsProtocol = "GRE"
+)
+
+type AttackLayer3SummaryBitrateResponseEnvelope struct {
+ Result AttackLayer3SummaryBitrateResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON attackLayer3SummaryBitrateResponseEnvelopeJSON `json:"-"`
+}
+
+// attackLayer3SummaryBitrateResponseEnvelopeJSON contains the JSON metadata for
+// the struct [AttackLayer3SummaryBitrateResponseEnvelope]
+type attackLayer3SummaryBitrateResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3SummaryBitrateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3SummaryBitrateResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3SummaryDurationParams 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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]AttackLayer3SummaryDurationParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Together with the `location` parameter, will apply the filter to origin or
+ // target location.
+ Direction param.Field[AttackLayer3SummaryDurationParamsDirection] `query:"direction"`
+ // Format results are returned in.
+ Format param.Field[AttackLayer3SummaryDurationParamsFormat] `query:"format"`
+ // Filter for ip version.
+ IPVersion param.Field[[]AttackLayer3SummaryDurationParamsIPVersion] `query:"ipVersion"`
+ // 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"`
+ // Array of L3/4 attack types.
+ Protocol param.Field[[]AttackLayer3SummaryDurationParamsProtocol] `query:"protocol"`
+}
+
+// URLQuery serializes [AttackLayer3SummaryDurationParams]'s query parameters as
+// `url.Values`.
+func (r AttackLayer3SummaryDurationParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type AttackLayer3SummaryDurationParamsDateRange string
+
+const (
+ AttackLayer3SummaryDurationParamsDateRange1d AttackLayer3SummaryDurationParamsDateRange = "1d"
+ AttackLayer3SummaryDurationParamsDateRange2d AttackLayer3SummaryDurationParamsDateRange = "2d"
+ AttackLayer3SummaryDurationParamsDateRange7d AttackLayer3SummaryDurationParamsDateRange = "7d"
+ AttackLayer3SummaryDurationParamsDateRange14d AttackLayer3SummaryDurationParamsDateRange = "14d"
+ AttackLayer3SummaryDurationParamsDateRange28d AttackLayer3SummaryDurationParamsDateRange = "28d"
+ AttackLayer3SummaryDurationParamsDateRange12w AttackLayer3SummaryDurationParamsDateRange = "12w"
+ AttackLayer3SummaryDurationParamsDateRange24w AttackLayer3SummaryDurationParamsDateRange = "24w"
+ AttackLayer3SummaryDurationParamsDateRange52w AttackLayer3SummaryDurationParamsDateRange = "52w"
+ AttackLayer3SummaryDurationParamsDateRange1dControl AttackLayer3SummaryDurationParamsDateRange = "1dControl"
+ AttackLayer3SummaryDurationParamsDateRange2dControl AttackLayer3SummaryDurationParamsDateRange = "2dControl"
+ AttackLayer3SummaryDurationParamsDateRange7dControl AttackLayer3SummaryDurationParamsDateRange = "7dControl"
+ AttackLayer3SummaryDurationParamsDateRange14dControl AttackLayer3SummaryDurationParamsDateRange = "14dControl"
+ AttackLayer3SummaryDurationParamsDateRange28dControl AttackLayer3SummaryDurationParamsDateRange = "28dControl"
+ AttackLayer3SummaryDurationParamsDateRange12wControl AttackLayer3SummaryDurationParamsDateRange = "12wControl"
+ AttackLayer3SummaryDurationParamsDateRange24wControl AttackLayer3SummaryDurationParamsDateRange = "24wControl"
+)
+
+// Together with the `location` parameter, will apply the filter to origin or
+// target location.
+type AttackLayer3SummaryDurationParamsDirection string
+
+const (
+ AttackLayer3SummaryDurationParamsDirectionOrigin AttackLayer3SummaryDurationParamsDirection = "ORIGIN"
+ AttackLayer3SummaryDurationParamsDirectionTarget AttackLayer3SummaryDurationParamsDirection = "TARGET"
+)
+
+// Format results are returned in.
+type AttackLayer3SummaryDurationParamsFormat string
+
+const (
+ AttackLayer3SummaryDurationParamsFormatJson AttackLayer3SummaryDurationParamsFormat = "JSON"
+ AttackLayer3SummaryDurationParamsFormatCsv AttackLayer3SummaryDurationParamsFormat = "CSV"
+)
+
+type AttackLayer3SummaryDurationParamsIPVersion string
+
+const (
+ AttackLayer3SummaryDurationParamsIPVersionIPv4 AttackLayer3SummaryDurationParamsIPVersion = "IPv4"
+ AttackLayer3SummaryDurationParamsIPVersionIPv6 AttackLayer3SummaryDurationParamsIPVersion = "IPv6"
+)
+
+type AttackLayer3SummaryDurationParamsProtocol string
+
+const (
+ AttackLayer3SummaryDurationParamsProtocolUdp AttackLayer3SummaryDurationParamsProtocol = "UDP"
+ AttackLayer3SummaryDurationParamsProtocolTcp AttackLayer3SummaryDurationParamsProtocol = "TCP"
+ AttackLayer3SummaryDurationParamsProtocolIcmp AttackLayer3SummaryDurationParamsProtocol = "ICMP"
+ AttackLayer3SummaryDurationParamsProtocolGRE AttackLayer3SummaryDurationParamsProtocol = "GRE"
+)
+
+type AttackLayer3SummaryDurationResponseEnvelope struct {
+ Result AttackLayer3SummaryDurationResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON attackLayer3SummaryDurationResponseEnvelopeJSON `json:"-"`
+}
+
+// attackLayer3SummaryDurationResponseEnvelopeJSON contains the JSON metadata for
+// the struct [AttackLayer3SummaryDurationResponseEnvelope]
+type attackLayer3SummaryDurationResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3SummaryDurationResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3SummaryDurationResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3SummaryGetParams 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"`
+ // 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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]AttackLayer3SummaryGetParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Format results are returned in.
+ Format param.Field[AttackLayer3SummaryGetParamsFormat] `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"`
+}
+
+// URLQuery serializes [AttackLayer3SummaryGetParams]'s query parameters as
+// `url.Values`.
+func (r AttackLayer3SummaryGetParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type AttackLayer3SummaryGetParamsDateRange string
+
+const (
+ AttackLayer3SummaryGetParamsDateRange1d AttackLayer3SummaryGetParamsDateRange = "1d"
+ AttackLayer3SummaryGetParamsDateRange2d AttackLayer3SummaryGetParamsDateRange = "2d"
+ AttackLayer3SummaryGetParamsDateRange7d AttackLayer3SummaryGetParamsDateRange = "7d"
+ AttackLayer3SummaryGetParamsDateRange14d AttackLayer3SummaryGetParamsDateRange = "14d"
+ AttackLayer3SummaryGetParamsDateRange28d AttackLayer3SummaryGetParamsDateRange = "28d"
+ AttackLayer3SummaryGetParamsDateRange12w AttackLayer3SummaryGetParamsDateRange = "12w"
+ AttackLayer3SummaryGetParamsDateRange24w AttackLayer3SummaryGetParamsDateRange = "24w"
+ AttackLayer3SummaryGetParamsDateRange52w AttackLayer3SummaryGetParamsDateRange = "52w"
+ AttackLayer3SummaryGetParamsDateRange1dControl AttackLayer3SummaryGetParamsDateRange = "1dControl"
+ AttackLayer3SummaryGetParamsDateRange2dControl AttackLayer3SummaryGetParamsDateRange = "2dControl"
+ AttackLayer3SummaryGetParamsDateRange7dControl AttackLayer3SummaryGetParamsDateRange = "7dControl"
+ AttackLayer3SummaryGetParamsDateRange14dControl AttackLayer3SummaryGetParamsDateRange = "14dControl"
+ AttackLayer3SummaryGetParamsDateRange28dControl AttackLayer3SummaryGetParamsDateRange = "28dControl"
+ AttackLayer3SummaryGetParamsDateRange12wControl AttackLayer3SummaryGetParamsDateRange = "12wControl"
+ AttackLayer3SummaryGetParamsDateRange24wControl AttackLayer3SummaryGetParamsDateRange = "24wControl"
+)
+
+// Format results are returned in.
+type AttackLayer3SummaryGetParamsFormat string
+
+const (
+ AttackLayer3SummaryGetParamsFormatJson AttackLayer3SummaryGetParamsFormat = "JSON"
+ AttackLayer3SummaryGetParamsFormatCsv AttackLayer3SummaryGetParamsFormat = "CSV"
+)
+
+type AttackLayer3SummaryGetResponseEnvelope struct {
+ Result AttackLayer3SummaryGetResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON attackLayer3SummaryGetResponseEnvelopeJSON `json:"-"`
+}
+
+// attackLayer3SummaryGetResponseEnvelopeJSON contains the JSON metadata for the
+// struct [AttackLayer3SummaryGetResponseEnvelope]
+type attackLayer3SummaryGetResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3SummaryGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3SummaryGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3SummaryIPVersionParams 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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]AttackLayer3SummaryIPVersionParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Together with the `location` parameter, will apply the filter to origin or
+ // target location.
+ Direction param.Field[AttackLayer3SummaryIPVersionParamsDirection] `query:"direction"`
+ // Format results are returned in.
+ Format param.Field[AttackLayer3SummaryIPVersionParamsFormat] `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"`
+ // Array of L3/4 attack types.
+ Protocol param.Field[[]AttackLayer3SummaryIPVersionParamsProtocol] `query:"protocol"`
+}
+
+// URLQuery serializes [AttackLayer3SummaryIPVersionParams]'s query parameters as
+// `url.Values`.
+func (r AttackLayer3SummaryIPVersionParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type AttackLayer3SummaryIPVersionParamsDateRange string
+
+const (
+ AttackLayer3SummaryIPVersionParamsDateRange1d AttackLayer3SummaryIPVersionParamsDateRange = "1d"
+ AttackLayer3SummaryIPVersionParamsDateRange2d AttackLayer3SummaryIPVersionParamsDateRange = "2d"
+ AttackLayer3SummaryIPVersionParamsDateRange7d AttackLayer3SummaryIPVersionParamsDateRange = "7d"
+ AttackLayer3SummaryIPVersionParamsDateRange14d AttackLayer3SummaryIPVersionParamsDateRange = "14d"
+ AttackLayer3SummaryIPVersionParamsDateRange28d AttackLayer3SummaryIPVersionParamsDateRange = "28d"
+ AttackLayer3SummaryIPVersionParamsDateRange12w AttackLayer3SummaryIPVersionParamsDateRange = "12w"
+ AttackLayer3SummaryIPVersionParamsDateRange24w AttackLayer3SummaryIPVersionParamsDateRange = "24w"
+ AttackLayer3SummaryIPVersionParamsDateRange52w AttackLayer3SummaryIPVersionParamsDateRange = "52w"
+ AttackLayer3SummaryIPVersionParamsDateRange1dControl AttackLayer3SummaryIPVersionParamsDateRange = "1dControl"
+ AttackLayer3SummaryIPVersionParamsDateRange2dControl AttackLayer3SummaryIPVersionParamsDateRange = "2dControl"
+ AttackLayer3SummaryIPVersionParamsDateRange7dControl AttackLayer3SummaryIPVersionParamsDateRange = "7dControl"
+ AttackLayer3SummaryIPVersionParamsDateRange14dControl AttackLayer3SummaryIPVersionParamsDateRange = "14dControl"
+ AttackLayer3SummaryIPVersionParamsDateRange28dControl AttackLayer3SummaryIPVersionParamsDateRange = "28dControl"
+ AttackLayer3SummaryIPVersionParamsDateRange12wControl AttackLayer3SummaryIPVersionParamsDateRange = "12wControl"
+ AttackLayer3SummaryIPVersionParamsDateRange24wControl AttackLayer3SummaryIPVersionParamsDateRange = "24wControl"
+)
+
+// Together with the `location` parameter, will apply the filter to origin or
+// target location.
+type AttackLayer3SummaryIPVersionParamsDirection string
+
+const (
+ AttackLayer3SummaryIPVersionParamsDirectionOrigin AttackLayer3SummaryIPVersionParamsDirection = "ORIGIN"
+ AttackLayer3SummaryIPVersionParamsDirectionTarget AttackLayer3SummaryIPVersionParamsDirection = "TARGET"
+)
+
+// Format results are returned in.
+type AttackLayer3SummaryIPVersionParamsFormat string
+
+const (
+ AttackLayer3SummaryIPVersionParamsFormatJson AttackLayer3SummaryIPVersionParamsFormat = "JSON"
+ AttackLayer3SummaryIPVersionParamsFormatCsv AttackLayer3SummaryIPVersionParamsFormat = "CSV"
+)
+
+type AttackLayer3SummaryIPVersionParamsProtocol string
+
+const (
+ AttackLayer3SummaryIPVersionParamsProtocolUdp AttackLayer3SummaryIPVersionParamsProtocol = "UDP"
+ AttackLayer3SummaryIPVersionParamsProtocolTcp AttackLayer3SummaryIPVersionParamsProtocol = "TCP"
+ AttackLayer3SummaryIPVersionParamsProtocolIcmp AttackLayer3SummaryIPVersionParamsProtocol = "ICMP"
+ AttackLayer3SummaryIPVersionParamsProtocolGRE AttackLayer3SummaryIPVersionParamsProtocol = "GRE"
+)
+
+type AttackLayer3SummaryIPVersionResponseEnvelope struct {
+ Result AttackLayer3SummaryIPVersionResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON attackLayer3SummaryIPVersionResponseEnvelopeJSON `json:"-"`
+}
+
+// attackLayer3SummaryIPVersionResponseEnvelopeJSON contains the JSON metadata for
+// the struct [AttackLayer3SummaryIPVersionResponseEnvelope]
+type attackLayer3SummaryIPVersionResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3SummaryIPVersionResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3SummaryIPVersionResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3SummaryProtocolParams 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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]AttackLayer3SummaryProtocolParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Together with the `location` parameter, will apply the filter to origin or
+ // target location.
+ Direction param.Field[AttackLayer3SummaryProtocolParamsDirection] `query:"direction"`
+ // Format results are returned in.
+ Format param.Field[AttackLayer3SummaryProtocolParamsFormat] `query:"format"`
+ // Filter for ip version.
+ IPVersion param.Field[[]AttackLayer3SummaryProtocolParamsIPVersion] `query:"ipVersion"`
+ // 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 [AttackLayer3SummaryProtocolParams]'s query parameters as
+// `url.Values`.
+func (r AttackLayer3SummaryProtocolParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type AttackLayer3SummaryProtocolParamsDateRange string
+
+const (
+ AttackLayer3SummaryProtocolParamsDateRange1d AttackLayer3SummaryProtocolParamsDateRange = "1d"
+ AttackLayer3SummaryProtocolParamsDateRange2d AttackLayer3SummaryProtocolParamsDateRange = "2d"
+ AttackLayer3SummaryProtocolParamsDateRange7d AttackLayer3SummaryProtocolParamsDateRange = "7d"
+ AttackLayer3SummaryProtocolParamsDateRange14d AttackLayer3SummaryProtocolParamsDateRange = "14d"
+ AttackLayer3SummaryProtocolParamsDateRange28d AttackLayer3SummaryProtocolParamsDateRange = "28d"
+ AttackLayer3SummaryProtocolParamsDateRange12w AttackLayer3SummaryProtocolParamsDateRange = "12w"
+ AttackLayer3SummaryProtocolParamsDateRange24w AttackLayer3SummaryProtocolParamsDateRange = "24w"
+ AttackLayer3SummaryProtocolParamsDateRange52w AttackLayer3SummaryProtocolParamsDateRange = "52w"
+ AttackLayer3SummaryProtocolParamsDateRange1dControl AttackLayer3SummaryProtocolParamsDateRange = "1dControl"
+ AttackLayer3SummaryProtocolParamsDateRange2dControl AttackLayer3SummaryProtocolParamsDateRange = "2dControl"
+ AttackLayer3SummaryProtocolParamsDateRange7dControl AttackLayer3SummaryProtocolParamsDateRange = "7dControl"
+ AttackLayer3SummaryProtocolParamsDateRange14dControl AttackLayer3SummaryProtocolParamsDateRange = "14dControl"
+ AttackLayer3SummaryProtocolParamsDateRange28dControl AttackLayer3SummaryProtocolParamsDateRange = "28dControl"
+ AttackLayer3SummaryProtocolParamsDateRange12wControl AttackLayer3SummaryProtocolParamsDateRange = "12wControl"
+ AttackLayer3SummaryProtocolParamsDateRange24wControl AttackLayer3SummaryProtocolParamsDateRange = "24wControl"
+)
+
+// Together with the `location` parameter, will apply the filter to origin or
+// target location.
+type AttackLayer3SummaryProtocolParamsDirection string
+
+const (
+ AttackLayer3SummaryProtocolParamsDirectionOrigin AttackLayer3SummaryProtocolParamsDirection = "ORIGIN"
+ AttackLayer3SummaryProtocolParamsDirectionTarget AttackLayer3SummaryProtocolParamsDirection = "TARGET"
+)
+
+// Format results are returned in.
+type AttackLayer3SummaryProtocolParamsFormat string
+
+const (
+ AttackLayer3SummaryProtocolParamsFormatJson AttackLayer3SummaryProtocolParamsFormat = "JSON"
+ AttackLayer3SummaryProtocolParamsFormatCsv AttackLayer3SummaryProtocolParamsFormat = "CSV"
+)
+
+type AttackLayer3SummaryProtocolParamsIPVersion string
+
+const (
+ AttackLayer3SummaryProtocolParamsIPVersionIPv4 AttackLayer3SummaryProtocolParamsIPVersion = "IPv4"
+ AttackLayer3SummaryProtocolParamsIPVersionIPv6 AttackLayer3SummaryProtocolParamsIPVersion = "IPv6"
+)
+
+type AttackLayer3SummaryProtocolResponseEnvelope struct {
+ Result AttackLayer3SummaryProtocolResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON attackLayer3SummaryProtocolResponseEnvelopeJSON `json:"-"`
+}
+
+// attackLayer3SummaryProtocolResponseEnvelopeJSON contains the JSON metadata for
+// the struct [AttackLayer3SummaryProtocolResponseEnvelope]
+type attackLayer3SummaryProtocolResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3SummaryProtocolResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3SummaryProtocolResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3SummaryVectorParams 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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]AttackLayer3SummaryVectorParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Together with the `location` parameter, will apply the filter to origin or
+ // target location.
+ Direction param.Field[AttackLayer3SummaryVectorParamsDirection] `query:"direction"`
+ // Format results are returned in.
+ Format param.Field[AttackLayer3SummaryVectorParamsFormat] `query:"format"`
+ // Filter for ip version.
+ IPVersion param.Field[[]AttackLayer3SummaryVectorParamsIPVersion] `query:"ipVersion"`
+ // 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"`
+ // Array of L3/4 attack types.
+ Protocol param.Field[[]AttackLayer3SummaryVectorParamsProtocol] `query:"protocol"`
+}
+
+// URLQuery serializes [AttackLayer3SummaryVectorParams]'s query parameters as
+// `url.Values`.
+func (r AttackLayer3SummaryVectorParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type AttackLayer3SummaryVectorParamsDateRange string
+
+const (
+ AttackLayer3SummaryVectorParamsDateRange1d AttackLayer3SummaryVectorParamsDateRange = "1d"
+ AttackLayer3SummaryVectorParamsDateRange2d AttackLayer3SummaryVectorParamsDateRange = "2d"
+ AttackLayer3SummaryVectorParamsDateRange7d AttackLayer3SummaryVectorParamsDateRange = "7d"
+ AttackLayer3SummaryVectorParamsDateRange14d AttackLayer3SummaryVectorParamsDateRange = "14d"
+ AttackLayer3SummaryVectorParamsDateRange28d AttackLayer3SummaryVectorParamsDateRange = "28d"
+ AttackLayer3SummaryVectorParamsDateRange12w AttackLayer3SummaryVectorParamsDateRange = "12w"
+ AttackLayer3SummaryVectorParamsDateRange24w AttackLayer3SummaryVectorParamsDateRange = "24w"
+ AttackLayer3SummaryVectorParamsDateRange52w AttackLayer3SummaryVectorParamsDateRange = "52w"
+ AttackLayer3SummaryVectorParamsDateRange1dControl AttackLayer3SummaryVectorParamsDateRange = "1dControl"
+ AttackLayer3SummaryVectorParamsDateRange2dControl AttackLayer3SummaryVectorParamsDateRange = "2dControl"
+ AttackLayer3SummaryVectorParamsDateRange7dControl AttackLayer3SummaryVectorParamsDateRange = "7dControl"
+ AttackLayer3SummaryVectorParamsDateRange14dControl AttackLayer3SummaryVectorParamsDateRange = "14dControl"
+ AttackLayer3SummaryVectorParamsDateRange28dControl AttackLayer3SummaryVectorParamsDateRange = "28dControl"
+ AttackLayer3SummaryVectorParamsDateRange12wControl AttackLayer3SummaryVectorParamsDateRange = "12wControl"
+ AttackLayer3SummaryVectorParamsDateRange24wControl AttackLayer3SummaryVectorParamsDateRange = "24wControl"
+)
+
+// Together with the `location` parameter, will apply the filter to origin or
+// target location.
+type AttackLayer3SummaryVectorParamsDirection string
+
+const (
+ AttackLayer3SummaryVectorParamsDirectionOrigin AttackLayer3SummaryVectorParamsDirection = "ORIGIN"
+ AttackLayer3SummaryVectorParamsDirectionTarget AttackLayer3SummaryVectorParamsDirection = "TARGET"
+)
+
+// Format results are returned in.
+type AttackLayer3SummaryVectorParamsFormat string
+
+const (
+ AttackLayer3SummaryVectorParamsFormatJson AttackLayer3SummaryVectorParamsFormat = "JSON"
+ AttackLayer3SummaryVectorParamsFormatCsv AttackLayer3SummaryVectorParamsFormat = "CSV"
+)
+
+type AttackLayer3SummaryVectorParamsIPVersion string
+
+const (
+ AttackLayer3SummaryVectorParamsIPVersionIPv4 AttackLayer3SummaryVectorParamsIPVersion = "IPv4"
+ AttackLayer3SummaryVectorParamsIPVersionIPv6 AttackLayer3SummaryVectorParamsIPVersion = "IPv6"
+)
+
+type AttackLayer3SummaryVectorParamsProtocol string
+
+const (
+ AttackLayer3SummaryVectorParamsProtocolUdp AttackLayer3SummaryVectorParamsProtocol = "UDP"
+ AttackLayer3SummaryVectorParamsProtocolTcp AttackLayer3SummaryVectorParamsProtocol = "TCP"
+ AttackLayer3SummaryVectorParamsProtocolIcmp AttackLayer3SummaryVectorParamsProtocol = "ICMP"
+ AttackLayer3SummaryVectorParamsProtocolGRE AttackLayer3SummaryVectorParamsProtocol = "GRE"
+)
+
+type AttackLayer3SummaryVectorResponseEnvelope struct {
+ Result AttackLayer3SummaryVectorResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON attackLayer3SummaryVectorResponseEnvelopeJSON `json:"-"`
+}
+
+// attackLayer3SummaryVectorResponseEnvelopeJSON contains the JSON metadata for the
+// struct [AttackLayer3SummaryVectorResponseEnvelope]
+type attackLayer3SummaryVectorResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3SummaryVectorResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3SummaryVectorResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/radar/attacklayer3summary_test.go b/radar/attacklayer3summary_test.go
new file mode 100644
index 00000000000..ec150c7e951
--- /dev/null
+++ b/radar/attacklayer3summary_test.go
@@ -0,0 +1,222 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/radar"
+)
+
+func TestAttackLayer3SummaryBitrateWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Attacks.Layer3.Summary.Bitrate(context.TODO(), radar.AttackLayer3SummaryBitrateParams{
+ Continent: cloudflare.F([]string{"string", "string", "string"}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.AttackLayer3SummaryBitrateParamsDateRange{radar.AttackLayer3SummaryBitrateParamsDateRange1d, radar.AttackLayer3SummaryBitrateParamsDateRange2d, radar.AttackLayer3SummaryBitrateParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Direction: cloudflare.F(radar.AttackLayer3SummaryBitrateParamsDirectionOrigin),
+ Format: cloudflare.F(radar.AttackLayer3SummaryBitrateParamsFormatJson),
+ IPVersion: cloudflare.F([]radar.AttackLayer3SummaryBitrateParamsIPVersion{radar.AttackLayer3SummaryBitrateParamsIPVersionIPv4, radar.AttackLayer3SummaryBitrateParamsIPVersionIPv6}),
+ Location: cloudflare.F([]string{"string", "string", "string"}),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ Protocol: cloudflare.F([]radar.AttackLayer3SummaryBitrateParamsProtocol{radar.AttackLayer3SummaryBitrateParamsProtocolUdp, radar.AttackLayer3SummaryBitrateParamsProtocolTcp, radar.AttackLayer3SummaryBitrateParamsProtocolIcmp}),
+ })
+ 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())
+ }
+}
+
+func TestAttackLayer3SummaryDurationWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Attacks.Layer3.Summary.Duration(context.TODO(), radar.AttackLayer3SummaryDurationParams{
+ Continent: cloudflare.F([]string{"string", "string", "string"}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.AttackLayer3SummaryDurationParamsDateRange{radar.AttackLayer3SummaryDurationParamsDateRange1d, radar.AttackLayer3SummaryDurationParamsDateRange2d, radar.AttackLayer3SummaryDurationParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Direction: cloudflare.F(radar.AttackLayer3SummaryDurationParamsDirectionOrigin),
+ Format: cloudflare.F(radar.AttackLayer3SummaryDurationParamsFormatJson),
+ IPVersion: cloudflare.F([]radar.AttackLayer3SummaryDurationParamsIPVersion{radar.AttackLayer3SummaryDurationParamsIPVersionIPv4, radar.AttackLayer3SummaryDurationParamsIPVersionIPv6}),
+ Location: cloudflare.F([]string{"string", "string", "string"}),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ Protocol: cloudflare.F([]radar.AttackLayer3SummaryDurationParamsProtocol{radar.AttackLayer3SummaryDurationParamsProtocolUdp, radar.AttackLayer3SummaryDurationParamsProtocolTcp, radar.AttackLayer3SummaryDurationParamsProtocolIcmp}),
+ })
+ 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())
+ }
+}
+
+func TestAttackLayer3SummaryGetWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Attacks.Layer3.Summary.Get(context.TODO(), radar.AttackLayer3SummaryGetParams{
+ 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([]radar.AttackLayer3SummaryGetParamsDateRange{radar.AttackLayer3SummaryGetParamsDateRange1d, radar.AttackLayer3SummaryGetParamsDateRange2d, radar.AttackLayer3SummaryGetParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Format: cloudflare.F(radar.AttackLayer3SummaryGetParamsFormatJson),
+ 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())
+ }
+}
+
+func TestAttackLayer3SummaryIPVersionWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Attacks.Layer3.Summary.IPVersion(context.TODO(), radar.AttackLayer3SummaryIPVersionParams{
+ Continent: cloudflare.F([]string{"string", "string", "string"}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.AttackLayer3SummaryIPVersionParamsDateRange{radar.AttackLayer3SummaryIPVersionParamsDateRange1d, radar.AttackLayer3SummaryIPVersionParamsDateRange2d, radar.AttackLayer3SummaryIPVersionParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Direction: cloudflare.F(radar.AttackLayer3SummaryIPVersionParamsDirectionOrigin),
+ Format: cloudflare.F(radar.AttackLayer3SummaryIPVersionParamsFormatJson),
+ Location: cloudflare.F([]string{"string", "string", "string"}),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ Protocol: cloudflare.F([]radar.AttackLayer3SummaryIPVersionParamsProtocol{radar.AttackLayer3SummaryIPVersionParamsProtocolUdp, radar.AttackLayer3SummaryIPVersionParamsProtocolTcp, radar.AttackLayer3SummaryIPVersionParamsProtocolIcmp}),
+ })
+ 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())
+ }
+}
+
+func TestAttackLayer3SummaryProtocolWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Attacks.Layer3.Summary.Protocol(context.TODO(), radar.AttackLayer3SummaryProtocolParams{
+ Continent: cloudflare.F([]string{"string", "string", "string"}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.AttackLayer3SummaryProtocolParamsDateRange{radar.AttackLayer3SummaryProtocolParamsDateRange1d, radar.AttackLayer3SummaryProtocolParamsDateRange2d, radar.AttackLayer3SummaryProtocolParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Direction: cloudflare.F(radar.AttackLayer3SummaryProtocolParamsDirectionOrigin),
+ Format: cloudflare.F(radar.AttackLayer3SummaryProtocolParamsFormatJson),
+ IPVersion: cloudflare.F([]radar.AttackLayer3SummaryProtocolParamsIPVersion{radar.AttackLayer3SummaryProtocolParamsIPVersionIPv4, radar.AttackLayer3SummaryProtocolParamsIPVersionIPv6}),
+ 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())
+ }
+}
+
+func TestAttackLayer3SummaryVectorWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Attacks.Layer3.Summary.Vector(context.TODO(), radar.AttackLayer3SummaryVectorParams{
+ Continent: cloudflare.F([]string{"string", "string", "string"}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.AttackLayer3SummaryVectorParamsDateRange{radar.AttackLayer3SummaryVectorParamsDateRange1d, radar.AttackLayer3SummaryVectorParamsDateRange2d, radar.AttackLayer3SummaryVectorParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Direction: cloudflare.F(radar.AttackLayer3SummaryVectorParamsDirectionOrigin),
+ Format: cloudflare.F(radar.AttackLayer3SummaryVectorParamsFormatJson),
+ IPVersion: cloudflare.F([]radar.AttackLayer3SummaryVectorParamsIPVersion{radar.AttackLayer3SummaryVectorParamsIPVersionIPv4, radar.AttackLayer3SummaryVectorParamsIPVersionIPv6}),
+ Location: cloudflare.F([]string{"string", "string", "string"}),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ Protocol: cloudflare.F([]radar.AttackLayer3SummaryVectorParamsProtocol{radar.AttackLayer3SummaryVectorParamsProtocolUdp, radar.AttackLayer3SummaryVectorParamsProtocolTcp, radar.AttackLayer3SummaryVectorParamsProtocolIcmp}),
+ })
+ 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/radar/attacklayer3timeseriesgroup.go b/radar/attacklayer3timeseriesgroup.go
new file mode 100644
index 00000000000..bb1a2fe330f
--- /dev/null
+++ b/radar/attacklayer3timeseriesgroup.go
@@ -0,0 +1,1717 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "context"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// AttackLayer3TimeseriesGroupService contains methods and other services that help
+// with interacting with the cloudflare API. Note, unlike clients, this service
+// does not read variables from the environment automatically. You should not
+// instantiate this service directly, and instead use the
+// [NewAttackLayer3TimeseriesGroupService] method instead.
+type AttackLayer3TimeseriesGroupService struct {
+ Options []option.RequestOption
+}
+
+// NewAttackLayer3TimeseriesGroupService generates a new service that applies the
+// given options to each request. These options are applied after the parent
+// client's options (if there is one), and before any request-specific options.
+func NewAttackLayer3TimeseriesGroupService(opts ...option.RequestOption) (r *AttackLayer3TimeseriesGroupService) {
+ r = &AttackLayer3TimeseriesGroupService{}
+ r.Options = opts
+ return
+}
+
+// Percentage distribution of attacks by bitrate over time.
+func (r *AttackLayer3TimeseriesGroupService) Bitrate(ctx context.Context, query AttackLayer3TimeseriesGroupBitrateParams, opts ...option.RequestOption) (res *AttackLayer3TimeseriesGroupBitrateResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AttackLayer3TimeseriesGroupBitrateResponseEnvelope
+ path := "radar/attacks/layer3/timeseries_groups/bitrate"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Percentage distribution of attacks by duration over time.
+func (r *AttackLayer3TimeseriesGroupService) Duration(ctx context.Context, query AttackLayer3TimeseriesGroupDurationParams, opts ...option.RequestOption) (res *AttackLayer3TimeseriesGroupDurationResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AttackLayer3TimeseriesGroupDurationResponseEnvelope
+ path := "radar/attacks/layer3/timeseries_groups/duration"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Get a timeseries of the percentage distribution of network protocols in Layer
+// 3/4 attacks.
+func (r *AttackLayer3TimeseriesGroupService) Get(ctx context.Context, query AttackLayer3TimeseriesGroupGetParams, opts ...option.RequestOption) (res *AttackLayer3TimeseriesGroupGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AttackLayer3TimeseriesGroupGetResponseEnvelope
+ path := "radar/attacks/layer3/timeseries_groups"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Percentage distribution of attacks by industry used over time.
+func (r *AttackLayer3TimeseriesGroupService) Industry(ctx context.Context, query AttackLayer3TimeseriesGroupIndustryParams, opts ...option.RequestOption) (res *AttackLayer3TimeseriesGroupIndustryResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AttackLayer3TimeseriesGroupIndustryResponseEnvelope
+ path := "radar/attacks/layer3/timeseries_groups/industry"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Percentage distribution of attacks by ip version used over time.
+func (r *AttackLayer3TimeseriesGroupService) IPVersion(ctx context.Context, query AttackLayer3TimeseriesGroupIPVersionParams, opts ...option.RequestOption) (res *AttackLayer3TimeseriesGroupIPVersionResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AttackLayer3TimeseriesGroupIPVersionResponseEnvelope
+ path := "radar/attacks/layer3/timeseries_groups/ip_version"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Percentage distribution of attacks by protocol used over time.
+func (r *AttackLayer3TimeseriesGroupService) Protocol(ctx context.Context, query AttackLayer3TimeseriesGroupProtocolParams, opts ...option.RequestOption) (res *AttackLayer3TimeseriesGroupProtocolResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AttackLayer3TimeseriesGroupProtocolResponseEnvelope
+ path := "radar/attacks/layer3/timeseries_groups/protocol"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Percentage distribution of attacks by vector used over time.
+func (r *AttackLayer3TimeseriesGroupService) Vector(ctx context.Context, query AttackLayer3TimeseriesGroupVectorParams, opts ...option.RequestOption) (res *AttackLayer3TimeseriesGroupVectorResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AttackLayer3TimeseriesGroupVectorResponseEnvelope
+ path := "radar/attacks/layer3/timeseries_groups/vector"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Percentage distribution of attacks by vertical used over time.
+func (r *AttackLayer3TimeseriesGroupService) Vertical(ctx context.Context, query AttackLayer3TimeseriesGroupVerticalParams, opts ...option.RequestOption) (res *AttackLayer3TimeseriesGroupVerticalResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AttackLayer3TimeseriesGroupVerticalResponseEnvelope
+ path := "radar/attacks/layer3/timeseries_groups/vertical"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type AttackLayer3TimeseriesGroupBitrateResponse struct {
+ Meta interface{} `json:"meta,required"`
+ Serie0 AttackLayer3TimeseriesGroupBitrateResponseSerie0 `json:"serie_0,required"`
+ JSON attackLayer3TimeseriesGroupBitrateResponseJSON `json:"-"`
+}
+
+// attackLayer3TimeseriesGroupBitrateResponseJSON contains the JSON metadata for
+// the struct [AttackLayer3TimeseriesGroupBitrateResponse]
+type attackLayer3TimeseriesGroupBitrateResponseJSON struct {
+ Meta apijson.Field
+ Serie0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3TimeseriesGroupBitrateResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3TimeseriesGroupBitrateResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3TimeseriesGroupBitrateResponseSerie0 struct {
+ Number1GbpsTo10Gbps []string `json:"_1_GBPS_TO_10_GBPS,required"`
+ Number10GbpsTo100Gbps []string `json:"_10_GBPS_TO_100_GBPS,required"`
+ Number500MbpsTo1Gbps []string `json:"_500_MBPS_TO_1_GBPS,required"`
+ Over100Gbps []string `json:"OVER_100_GBPS,required"`
+ Timestamps []string `json:"timestamps,required"`
+ Under500Mbps []string `json:"UNDER_500_MBPS,required"`
+ JSON attackLayer3TimeseriesGroupBitrateResponseSerie0JSON `json:"-"`
+}
+
+// attackLayer3TimeseriesGroupBitrateResponseSerie0JSON contains the JSON metadata
+// for the struct [AttackLayer3TimeseriesGroupBitrateResponseSerie0]
+type attackLayer3TimeseriesGroupBitrateResponseSerie0JSON struct {
+ Number1GbpsTo10Gbps apijson.Field
+ Number10GbpsTo100Gbps apijson.Field
+ Number500MbpsTo1Gbps apijson.Field
+ Over100Gbps apijson.Field
+ Timestamps apijson.Field
+ Under500Mbps apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3TimeseriesGroupBitrateResponseSerie0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3TimeseriesGroupBitrateResponseSerie0JSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3TimeseriesGroupDurationResponse struct {
+ Meta interface{} `json:"meta,required"`
+ Serie0 AttackLayer3TimeseriesGroupDurationResponseSerie0 `json:"serie_0,required"`
+ JSON attackLayer3TimeseriesGroupDurationResponseJSON `json:"-"`
+}
+
+// attackLayer3TimeseriesGroupDurationResponseJSON contains the JSON metadata for
+// the struct [AttackLayer3TimeseriesGroupDurationResponse]
+type attackLayer3TimeseriesGroupDurationResponseJSON struct {
+ Meta apijson.Field
+ Serie0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3TimeseriesGroupDurationResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3TimeseriesGroupDurationResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3TimeseriesGroupDurationResponseSerie0 struct {
+ Number1HourTo3Hours []string `json:"_1_HOUR_TO_3_HOURS,required"`
+ Number10MinsTo20Mins []string `json:"_10_MINS_TO_20_MINS,required"`
+ Number20MinsTo40Mins []string `json:"_20_MINS_TO_40_MINS,required"`
+ Number40MinsTo1Hour []string `json:"_40_MINS_TO_1_HOUR,required"`
+ Over3Hours []string `json:"OVER_3_HOURS,required"`
+ Timestamps []string `json:"timestamps,required"`
+ Under10Mins []string `json:"UNDER_10_MINS,required"`
+ JSON attackLayer3TimeseriesGroupDurationResponseSerie0JSON `json:"-"`
+}
+
+// attackLayer3TimeseriesGroupDurationResponseSerie0JSON contains the JSON metadata
+// for the struct [AttackLayer3TimeseriesGroupDurationResponseSerie0]
+type attackLayer3TimeseriesGroupDurationResponseSerie0JSON struct {
+ Number1HourTo3Hours apijson.Field
+ Number10MinsTo20Mins apijson.Field
+ Number20MinsTo40Mins apijson.Field
+ Number40MinsTo1Hour apijson.Field
+ Over3Hours apijson.Field
+ Timestamps apijson.Field
+ Under10Mins apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3TimeseriesGroupDurationResponseSerie0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3TimeseriesGroupDurationResponseSerie0JSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3TimeseriesGroupGetResponse struct {
+ Meta AttackLayer3TimeseriesGroupGetResponseMeta `json:"meta,required"`
+ Serie0 AttackLayer3TimeseriesGroupGetResponseSerie0 `json:"serie_0,required"`
+ JSON attackLayer3TimeseriesGroupGetResponseJSON `json:"-"`
+}
+
+// attackLayer3TimeseriesGroupGetResponseJSON contains the JSON metadata for the
+// struct [AttackLayer3TimeseriesGroupGetResponse]
+type attackLayer3TimeseriesGroupGetResponseJSON struct {
+ Meta apijson.Field
+ Serie0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3TimeseriesGroupGetResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3TimeseriesGroupGetResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3TimeseriesGroupGetResponseMeta struct {
+ AggInterval string `json:"aggInterval,required"`
+ DateRange []AttackLayer3TimeseriesGroupGetResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated time.Time `json:"lastUpdated,required" format:"date-time"`
+ ConfidenceInfo AttackLayer3TimeseriesGroupGetResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON attackLayer3TimeseriesGroupGetResponseMetaJSON `json:"-"`
+}
+
+// attackLayer3TimeseriesGroupGetResponseMetaJSON contains the JSON metadata for
+// the struct [AttackLayer3TimeseriesGroupGetResponseMeta]
+type attackLayer3TimeseriesGroupGetResponseMetaJSON struct {
+ AggInterval apijson.Field
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3TimeseriesGroupGetResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3TimeseriesGroupGetResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3TimeseriesGroupGetResponseMetaDateRange 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 attackLayer3TimeseriesGroupGetResponseMetaDateRangeJSON `json:"-"`
+}
+
+// attackLayer3TimeseriesGroupGetResponseMetaDateRangeJSON contains the JSON
+// metadata for the struct [AttackLayer3TimeseriesGroupGetResponseMetaDateRange]
+type attackLayer3TimeseriesGroupGetResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3TimeseriesGroupGetResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3TimeseriesGroupGetResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3TimeseriesGroupGetResponseMetaConfidenceInfo struct {
+ Annotations []AttackLayer3TimeseriesGroupGetResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON attackLayer3TimeseriesGroupGetResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// attackLayer3TimeseriesGroupGetResponseMetaConfidenceInfoJSON contains the JSON
+// metadata for the struct
+// [AttackLayer3TimeseriesGroupGetResponseMetaConfidenceInfo]
+type attackLayer3TimeseriesGroupGetResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3TimeseriesGroupGetResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3TimeseriesGroupGetResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3TimeseriesGroupGetResponseMetaConfidenceInfoAnnotation 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 attackLayer3TimeseriesGroupGetResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// attackLayer3TimeseriesGroupGetResponseMetaConfidenceInfoAnnotationJSON contains
+// the JSON metadata for the struct
+// [AttackLayer3TimeseriesGroupGetResponseMetaConfidenceInfoAnnotation]
+type attackLayer3TimeseriesGroupGetResponseMetaConfidenceInfoAnnotationJSON 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 *AttackLayer3TimeseriesGroupGetResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3TimeseriesGroupGetResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3TimeseriesGroupGetResponseSerie0 struct {
+ GRE []string `json:"gre,required"`
+ Icmp []string `json:"icmp,required"`
+ Tcp []string `json:"tcp,required"`
+ Timestamps []string `json:"timestamps,required"`
+ Udp []string `json:"udp,required"`
+ JSON attackLayer3TimeseriesGroupGetResponseSerie0JSON `json:"-"`
+}
+
+// attackLayer3TimeseriesGroupGetResponseSerie0JSON contains the JSON metadata for
+// the struct [AttackLayer3TimeseriesGroupGetResponseSerie0]
+type attackLayer3TimeseriesGroupGetResponseSerie0JSON struct {
+ GRE apijson.Field
+ Icmp apijson.Field
+ Tcp apijson.Field
+ Timestamps apijson.Field
+ Udp apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3TimeseriesGroupGetResponseSerie0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3TimeseriesGroupGetResponseSerie0JSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3TimeseriesGroupIndustryResponse struct {
+ Meta interface{} `json:"meta,required"`
+ Serie0 AttackLayer3TimeseriesGroupIndustryResponseSerie0 `json:"serie_0,required"`
+ JSON attackLayer3TimeseriesGroupIndustryResponseJSON `json:"-"`
+}
+
+// attackLayer3TimeseriesGroupIndustryResponseJSON contains the JSON metadata for
+// the struct [AttackLayer3TimeseriesGroupIndustryResponse]
+type attackLayer3TimeseriesGroupIndustryResponseJSON struct {
+ Meta apijson.Field
+ Serie0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3TimeseriesGroupIndustryResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3TimeseriesGroupIndustryResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3TimeseriesGroupIndustryResponseSerie0 struct {
+ Timestamps []string `json:"timestamps,required"`
+ ExtraFields map[string][]string `json:"-,extras"`
+ JSON attackLayer3TimeseriesGroupIndustryResponseSerie0JSON `json:"-"`
+}
+
+// attackLayer3TimeseriesGroupIndustryResponseSerie0JSON contains the JSON metadata
+// for the struct [AttackLayer3TimeseriesGroupIndustryResponseSerie0]
+type attackLayer3TimeseriesGroupIndustryResponseSerie0JSON struct {
+ Timestamps apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3TimeseriesGroupIndustryResponseSerie0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3TimeseriesGroupIndustryResponseSerie0JSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3TimeseriesGroupIPVersionResponse struct {
+ Meta interface{} `json:"meta,required"`
+ Serie0 AttackLayer3TimeseriesGroupIPVersionResponseSerie0 `json:"serie_0,required"`
+ JSON attackLayer3TimeseriesGroupIPVersionResponseJSON `json:"-"`
+}
+
+// attackLayer3TimeseriesGroupIPVersionResponseJSON contains the JSON metadata for
+// the struct [AttackLayer3TimeseriesGroupIPVersionResponse]
+type attackLayer3TimeseriesGroupIPVersionResponseJSON struct {
+ Meta apijson.Field
+ Serie0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3TimeseriesGroupIPVersionResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3TimeseriesGroupIPVersionResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3TimeseriesGroupIPVersionResponseSerie0 struct {
+ IPv4 []string `json:"IPv4,required"`
+ IPv6 []string `json:"IPv6,required"`
+ Timestamps []string `json:"timestamps,required"`
+ JSON attackLayer3TimeseriesGroupIPVersionResponseSerie0JSON `json:"-"`
+}
+
+// attackLayer3TimeseriesGroupIPVersionResponseSerie0JSON contains the JSON
+// metadata for the struct [AttackLayer3TimeseriesGroupIPVersionResponseSerie0]
+type attackLayer3TimeseriesGroupIPVersionResponseSerie0JSON struct {
+ IPv4 apijson.Field
+ IPv6 apijson.Field
+ Timestamps apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3TimeseriesGroupIPVersionResponseSerie0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3TimeseriesGroupIPVersionResponseSerie0JSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3TimeseriesGroupProtocolResponse struct {
+ Meta interface{} `json:"meta,required"`
+ Serie0 AttackLayer3TimeseriesGroupProtocolResponseSerie0 `json:"serie_0,required"`
+ JSON attackLayer3TimeseriesGroupProtocolResponseJSON `json:"-"`
+}
+
+// attackLayer3TimeseriesGroupProtocolResponseJSON contains the JSON metadata for
+// the struct [AttackLayer3TimeseriesGroupProtocolResponse]
+type attackLayer3TimeseriesGroupProtocolResponseJSON struct {
+ Meta apijson.Field
+ Serie0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3TimeseriesGroupProtocolResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3TimeseriesGroupProtocolResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3TimeseriesGroupProtocolResponseSerie0 struct {
+ GRE []string `json:"GRE,required"`
+ Icmp []string `json:"ICMP,required"`
+ Tcp []string `json:"TCP,required"`
+ Timestamps []string `json:"timestamps,required"`
+ Udp []string `json:"UDP,required"`
+ JSON attackLayer3TimeseriesGroupProtocolResponseSerie0JSON `json:"-"`
+}
+
+// attackLayer3TimeseriesGroupProtocolResponseSerie0JSON contains the JSON metadata
+// for the struct [AttackLayer3TimeseriesGroupProtocolResponseSerie0]
+type attackLayer3TimeseriesGroupProtocolResponseSerie0JSON struct {
+ GRE apijson.Field
+ Icmp apijson.Field
+ Tcp apijson.Field
+ Timestamps apijson.Field
+ Udp apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3TimeseriesGroupProtocolResponseSerie0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3TimeseriesGroupProtocolResponseSerie0JSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3TimeseriesGroupVectorResponse struct {
+ Meta interface{} `json:"meta,required"`
+ Serie0 AttackLayer3TimeseriesGroupVectorResponseSerie0 `json:"serie_0,required"`
+ JSON attackLayer3TimeseriesGroupVectorResponseJSON `json:"-"`
+}
+
+// attackLayer3TimeseriesGroupVectorResponseJSON contains the JSON metadata for the
+// struct [AttackLayer3TimeseriesGroupVectorResponse]
+type attackLayer3TimeseriesGroupVectorResponseJSON struct {
+ Meta apijson.Field
+ Serie0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3TimeseriesGroupVectorResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3TimeseriesGroupVectorResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3TimeseriesGroupVectorResponseSerie0 struct {
+ Timestamps []string `json:"timestamps,required"`
+ ExtraFields map[string][]string `json:"-,extras"`
+ JSON attackLayer3TimeseriesGroupVectorResponseSerie0JSON `json:"-"`
+}
+
+// attackLayer3TimeseriesGroupVectorResponseSerie0JSON contains the JSON metadata
+// for the struct [AttackLayer3TimeseriesGroupVectorResponseSerie0]
+type attackLayer3TimeseriesGroupVectorResponseSerie0JSON struct {
+ Timestamps apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3TimeseriesGroupVectorResponseSerie0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3TimeseriesGroupVectorResponseSerie0JSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3TimeseriesGroupVerticalResponse struct {
+ Meta interface{} `json:"meta,required"`
+ Serie0 AttackLayer3TimeseriesGroupVerticalResponseSerie0 `json:"serie_0,required"`
+ JSON attackLayer3TimeseriesGroupVerticalResponseJSON `json:"-"`
+}
+
+// attackLayer3TimeseriesGroupVerticalResponseJSON contains the JSON metadata for
+// the struct [AttackLayer3TimeseriesGroupVerticalResponse]
+type attackLayer3TimeseriesGroupVerticalResponseJSON struct {
+ Meta apijson.Field
+ Serie0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3TimeseriesGroupVerticalResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3TimeseriesGroupVerticalResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3TimeseriesGroupVerticalResponseSerie0 struct {
+ Timestamps []string `json:"timestamps,required"`
+ ExtraFields map[string][]string `json:"-,extras"`
+ JSON attackLayer3TimeseriesGroupVerticalResponseSerie0JSON `json:"-"`
+}
+
+// attackLayer3TimeseriesGroupVerticalResponseSerie0JSON contains the JSON metadata
+// for the struct [AttackLayer3TimeseriesGroupVerticalResponseSerie0]
+type attackLayer3TimeseriesGroupVerticalResponseSerie0JSON struct {
+ Timestamps apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3TimeseriesGroupVerticalResponseSerie0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3TimeseriesGroupVerticalResponseSerie0JSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3TimeseriesGroupBitrateParams struct {
+ // Aggregation interval results should be returned in (for example, in 15 minutes
+ // or 1 hour intervals). Refer to
+ // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+ AggInterval param.Field[AttackLayer3TimeseriesGroupBitrateParamsAggInterval] `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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]AttackLayer3TimeseriesGroupBitrateParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Together with the `location` parameter, will apply the filter to origin or
+ // target location.
+ Direction param.Field[AttackLayer3TimeseriesGroupBitrateParamsDirection] `query:"direction"`
+ // Format results are returned in.
+ Format param.Field[AttackLayer3TimeseriesGroupBitrateParamsFormat] `query:"format"`
+ // Filter for ip version.
+ IPVersion param.Field[[]AttackLayer3TimeseriesGroupBitrateParamsIPVersion] `query:"ipVersion"`
+ // 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"`
+ // Normalization method applied. Refer to
+ // [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/).
+ Normalization param.Field[AttackLayer3TimeseriesGroupBitrateParamsNormalization] `query:"normalization"`
+ // Array of L3/4 attack types.
+ Protocol param.Field[[]AttackLayer3TimeseriesGroupBitrateParamsProtocol] `query:"protocol"`
+}
+
+// URLQuery serializes [AttackLayer3TimeseriesGroupBitrateParams]'s query
+// parameters as `url.Values`.
+func (r AttackLayer3TimeseriesGroupBitrateParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Aggregation interval results should be returned in (for example, in 15 minutes
+// or 1 hour intervals). Refer to
+// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+type AttackLayer3TimeseriesGroupBitrateParamsAggInterval string
+
+const (
+ AttackLayer3TimeseriesGroupBitrateParamsAggInterval15m AttackLayer3TimeseriesGroupBitrateParamsAggInterval = "15m"
+ AttackLayer3TimeseriesGroupBitrateParamsAggInterval1h AttackLayer3TimeseriesGroupBitrateParamsAggInterval = "1h"
+ AttackLayer3TimeseriesGroupBitrateParamsAggInterval1d AttackLayer3TimeseriesGroupBitrateParamsAggInterval = "1d"
+ AttackLayer3TimeseriesGroupBitrateParamsAggInterval1w AttackLayer3TimeseriesGroupBitrateParamsAggInterval = "1w"
+)
+
+type AttackLayer3TimeseriesGroupBitrateParamsDateRange string
+
+const (
+ AttackLayer3TimeseriesGroupBitrateParamsDateRange1d AttackLayer3TimeseriesGroupBitrateParamsDateRange = "1d"
+ AttackLayer3TimeseriesGroupBitrateParamsDateRange2d AttackLayer3TimeseriesGroupBitrateParamsDateRange = "2d"
+ AttackLayer3TimeseriesGroupBitrateParamsDateRange7d AttackLayer3TimeseriesGroupBitrateParamsDateRange = "7d"
+ AttackLayer3TimeseriesGroupBitrateParamsDateRange14d AttackLayer3TimeseriesGroupBitrateParamsDateRange = "14d"
+ AttackLayer3TimeseriesGroupBitrateParamsDateRange28d AttackLayer3TimeseriesGroupBitrateParamsDateRange = "28d"
+ AttackLayer3TimeseriesGroupBitrateParamsDateRange12w AttackLayer3TimeseriesGroupBitrateParamsDateRange = "12w"
+ AttackLayer3TimeseriesGroupBitrateParamsDateRange24w AttackLayer3TimeseriesGroupBitrateParamsDateRange = "24w"
+ AttackLayer3TimeseriesGroupBitrateParamsDateRange52w AttackLayer3TimeseriesGroupBitrateParamsDateRange = "52w"
+ AttackLayer3TimeseriesGroupBitrateParamsDateRange1dControl AttackLayer3TimeseriesGroupBitrateParamsDateRange = "1dControl"
+ AttackLayer3TimeseriesGroupBitrateParamsDateRange2dControl AttackLayer3TimeseriesGroupBitrateParamsDateRange = "2dControl"
+ AttackLayer3TimeseriesGroupBitrateParamsDateRange7dControl AttackLayer3TimeseriesGroupBitrateParamsDateRange = "7dControl"
+ AttackLayer3TimeseriesGroupBitrateParamsDateRange14dControl AttackLayer3TimeseriesGroupBitrateParamsDateRange = "14dControl"
+ AttackLayer3TimeseriesGroupBitrateParamsDateRange28dControl AttackLayer3TimeseriesGroupBitrateParamsDateRange = "28dControl"
+ AttackLayer3TimeseriesGroupBitrateParamsDateRange12wControl AttackLayer3TimeseriesGroupBitrateParamsDateRange = "12wControl"
+ AttackLayer3TimeseriesGroupBitrateParamsDateRange24wControl AttackLayer3TimeseriesGroupBitrateParamsDateRange = "24wControl"
+)
+
+// Together with the `location` parameter, will apply the filter to origin or
+// target location.
+type AttackLayer3TimeseriesGroupBitrateParamsDirection string
+
+const (
+ AttackLayer3TimeseriesGroupBitrateParamsDirectionOrigin AttackLayer3TimeseriesGroupBitrateParamsDirection = "ORIGIN"
+ AttackLayer3TimeseriesGroupBitrateParamsDirectionTarget AttackLayer3TimeseriesGroupBitrateParamsDirection = "TARGET"
+)
+
+// Format results are returned in.
+type AttackLayer3TimeseriesGroupBitrateParamsFormat string
+
+const (
+ AttackLayer3TimeseriesGroupBitrateParamsFormatJson AttackLayer3TimeseriesGroupBitrateParamsFormat = "JSON"
+ AttackLayer3TimeseriesGroupBitrateParamsFormatCsv AttackLayer3TimeseriesGroupBitrateParamsFormat = "CSV"
+)
+
+type AttackLayer3TimeseriesGroupBitrateParamsIPVersion string
+
+const (
+ AttackLayer3TimeseriesGroupBitrateParamsIPVersionIPv4 AttackLayer3TimeseriesGroupBitrateParamsIPVersion = "IPv4"
+ AttackLayer3TimeseriesGroupBitrateParamsIPVersionIPv6 AttackLayer3TimeseriesGroupBitrateParamsIPVersion = "IPv6"
+)
+
+// Normalization method applied. Refer to
+// [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/).
+type AttackLayer3TimeseriesGroupBitrateParamsNormalization string
+
+const (
+ AttackLayer3TimeseriesGroupBitrateParamsNormalizationPercentage AttackLayer3TimeseriesGroupBitrateParamsNormalization = "PERCENTAGE"
+ AttackLayer3TimeseriesGroupBitrateParamsNormalizationMin0Max AttackLayer3TimeseriesGroupBitrateParamsNormalization = "MIN0_MAX"
+)
+
+type AttackLayer3TimeseriesGroupBitrateParamsProtocol string
+
+const (
+ AttackLayer3TimeseriesGroupBitrateParamsProtocolUdp AttackLayer3TimeseriesGroupBitrateParamsProtocol = "UDP"
+ AttackLayer3TimeseriesGroupBitrateParamsProtocolTcp AttackLayer3TimeseriesGroupBitrateParamsProtocol = "TCP"
+ AttackLayer3TimeseriesGroupBitrateParamsProtocolIcmp AttackLayer3TimeseriesGroupBitrateParamsProtocol = "ICMP"
+ AttackLayer3TimeseriesGroupBitrateParamsProtocolGRE AttackLayer3TimeseriesGroupBitrateParamsProtocol = "GRE"
+)
+
+type AttackLayer3TimeseriesGroupBitrateResponseEnvelope struct {
+ Result AttackLayer3TimeseriesGroupBitrateResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON attackLayer3TimeseriesGroupBitrateResponseEnvelopeJSON `json:"-"`
+}
+
+// attackLayer3TimeseriesGroupBitrateResponseEnvelopeJSON contains the JSON
+// metadata for the struct [AttackLayer3TimeseriesGroupBitrateResponseEnvelope]
+type attackLayer3TimeseriesGroupBitrateResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3TimeseriesGroupBitrateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3TimeseriesGroupBitrateResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3TimeseriesGroupDurationParams struct {
+ // Aggregation interval results should be returned in (for example, in 15 minutes
+ // or 1 hour intervals). Refer to
+ // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+ AggInterval param.Field[AttackLayer3TimeseriesGroupDurationParamsAggInterval] `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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]AttackLayer3TimeseriesGroupDurationParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Together with the `location` parameter, will apply the filter to origin or
+ // target location.
+ Direction param.Field[AttackLayer3TimeseriesGroupDurationParamsDirection] `query:"direction"`
+ // Format results are returned in.
+ Format param.Field[AttackLayer3TimeseriesGroupDurationParamsFormat] `query:"format"`
+ // Filter for ip version.
+ IPVersion param.Field[[]AttackLayer3TimeseriesGroupDurationParamsIPVersion] `query:"ipVersion"`
+ // 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"`
+ // Normalization method applied. Refer to
+ // [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/).
+ Normalization param.Field[AttackLayer3TimeseriesGroupDurationParamsNormalization] `query:"normalization"`
+ // Array of L3/4 attack types.
+ Protocol param.Field[[]AttackLayer3TimeseriesGroupDurationParamsProtocol] `query:"protocol"`
+}
+
+// URLQuery serializes [AttackLayer3TimeseriesGroupDurationParams]'s query
+// parameters as `url.Values`.
+func (r AttackLayer3TimeseriesGroupDurationParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Aggregation interval results should be returned in (for example, in 15 minutes
+// or 1 hour intervals). Refer to
+// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+type AttackLayer3TimeseriesGroupDurationParamsAggInterval string
+
+const (
+ AttackLayer3TimeseriesGroupDurationParamsAggInterval15m AttackLayer3TimeseriesGroupDurationParamsAggInterval = "15m"
+ AttackLayer3TimeseriesGroupDurationParamsAggInterval1h AttackLayer3TimeseriesGroupDurationParamsAggInterval = "1h"
+ AttackLayer3TimeseriesGroupDurationParamsAggInterval1d AttackLayer3TimeseriesGroupDurationParamsAggInterval = "1d"
+ AttackLayer3TimeseriesGroupDurationParamsAggInterval1w AttackLayer3TimeseriesGroupDurationParamsAggInterval = "1w"
+)
+
+type AttackLayer3TimeseriesGroupDurationParamsDateRange string
+
+const (
+ AttackLayer3TimeseriesGroupDurationParamsDateRange1d AttackLayer3TimeseriesGroupDurationParamsDateRange = "1d"
+ AttackLayer3TimeseriesGroupDurationParamsDateRange2d AttackLayer3TimeseriesGroupDurationParamsDateRange = "2d"
+ AttackLayer3TimeseriesGroupDurationParamsDateRange7d AttackLayer3TimeseriesGroupDurationParamsDateRange = "7d"
+ AttackLayer3TimeseriesGroupDurationParamsDateRange14d AttackLayer3TimeseriesGroupDurationParamsDateRange = "14d"
+ AttackLayer3TimeseriesGroupDurationParamsDateRange28d AttackLayer3TimeseriesGroupDurationParamsDateRange = "28d"
+ AttackLayer3TimeseriesGroupDurationParamsDateRange12w AttackLayer3TimeseriesGroupDurationParamsDateRange = "12w"
+ AttackLayer3TimeseriesGroupDurationParamsDateRange24w AttackLayer3TimeseriesGroupDurationParamsDateRange = "24w"
+ AttackLayer3TimeseriesGroupDurationParamsDateRange52w AttackLayer3TimeseriesGroupDurationParamsDateRange = "52w"
+ AttackLayer3TimeseriesGroupDurationParamsDateRange1dControl AttackLayer3TimeseriesGroupDurationParamsDateRange = "1dControl"
+ AttackLayer3TimeseriesGroupDurationParamsDateRange2dControl AttackLayer3TimeseriesGroupDurationParamsDateRange = "2dControl"
+ AttackLayer3TimeseriesGroupDurationParamsDateRange7dControl AttackLayer3TimeseriesGroupDurationParamsDateRange = "7dControl"
+ AttackLayer3TimeseriesGroupDurationParamsDateRange14dControl AttackLayer3TimeseriesGroupDurationParamsDateRange = "14dControl"
+ AttackLayer3TimeseriesGroupDurationParamsDateRange28dControl AttackLayer3TimeseriesGroupDurationParamsDateRange = "28dControl"
+ AttackLayer3TimeseriesGroupDurationParamsDateRange12wControl AttackLayer3TimeseriesGroupDurationParamsDateRange = "12wControl"
+ AttackLayer3TimeseriesGroupDurationParamsDateRange24wControl AttackLayer3TimeseriesGroupDurationParamsDateRange = "24wControl"
+)
+
+// Together with the `location` parameter, will apply the filter to origin or
+// target location.
+type AttackLayer3TimeseriesGroupDurationParamsDirection string
+
+const (
+ AttackLayer3TimeseriesGroupDurationParamsDirectionOrigin AttackLayer3TimeseriesGroupDurationParamsDirection = "ORIGIN"
+ AttackLayer3TimeseriesGroupDurationParamsDirectionTarget AttackLayer3TimeseriesGroupDurationParamsDirection = "TARGET"
+)
+
+// Format results are returned in.
+type AttackLayer3TimeseriesGroupDurationParamsFormat string
+
+const (
+ AttackLayer3TimeseriesGroupDurationParamsFormatJson AttackLayer3TimeseriesGroupDurationParamsFormat = "JSON"
+ AttackLayer3TimeseriesGroupDurationParamsFormatCsv AttackLayer3TimeseriesGroupDurationParamsFormat = "CSV"
+)
+
+type AttackLayer3TimeseriesGroupDurationParamsIPVersion string
+
+const (
+ AttackLayer3TimeseriesGroupDurationParamsIPVersionIPv4 AttackLayer3TimeseriesGroupDurationParamsIPVersion = "IPv4"
+ AttackLayer3TimeseriesGroupDurationParamsIPVersionIPv6 AttackLayer3TimeseriesGroupDurationParamsIPVersion = "IPv6"
+)
+
+// Normalization method applied. Refer to
+// [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/).
+type AttackLayer3TimeseriesGroupDurationParamsNormalization string
+
+const (
+ AttackLayer3TimeseriesGroupDurationParamsNormalizationPercentage AttackLayer3TimeseriesGroupDurationParamsNormalization = "PERCENTAGE"
+ AttackLayer3TimeseriesGroupDurationParamsNormalizationMin0Max AttackLayer3TimeseriesGroupDurationParamsNormalization = "MIN0_MAX"
+)
+
+type AttackLayer3TimeseriesGroupDurationParamsProtocol string
+
+const (
+ AttackLayer3TimeseriesGroupDurationParamsProtocolUdp AttackLayer3TimeseriesGroupDurationParamsProtocol = "UDP"
+ AttackLayer3TimeseriesGroupDurationParamsProtocolTcp AttackLayer3TimeseriesGroupDurationParamsProtocol = "TCP"
+ AttackLayer3TimeseriesGroupDurationParamsProtocolIcmp AttackLayer3TimeseriesGroupDurationParamsProtocol = "ICMP"
+ AttackLayer3TimeseriesGroupDurationParamsProtocolGRE AttackLayer3TimeseriesGroupDurationParamsProtocol = "GRE"
+)
+
+type AttackLayer3TimeseriesGroupDurationResponseEnvelope struct {
+ Result AttackLayer3TimeseriesGroupDurationResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON attackLayer3TimeseriesGroupDurationResponseEnvelopeJSON `json:"-"`
+}
+
+// attackLayer3TimeseriesGroupDurationResponseEnvelopeJSON contains the JSON
+// metadata for the struct [AttackLayer3TimeseriesGroupDurationResponseEnvelope]
+type attackLayer3TimeseriesGroupDurationResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3TimeseriesGroupDurationResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3TimeseriesGroupDurationResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3TimeseriesGroupGetParams struct {
+ // Aggregation interval results should be returned in (for example, in 15 minutes
+ // or 1 hour intervals). Refer to
+ // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+ AggInterval param.Field[AttackLayer3TimeseriesGroupGetParamsAggInterval] `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"`
+ // 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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]AttackLayer3TimeseriesGroupGetParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Format results are returned in.
+ Format param.Field[AttackLayer3TimeseriesGroupGetParamsFormat] `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"`
+}
+
+// URLQuery serializes [AttackLayer3TimeseriesGroupGetParams]'s query parameters as
+// `url.Values`.
+func (r AttackLayer3TimeseriesGroupGetParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Aggregation interval results should be returned in (for example, in 15 minutes
+// or 1 hour intervals). Refer to
+// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+type AttackLayer3TimeseriesGroupGetParamsAggInterval string
+
+const (
+ AttackLayer3TimeseriesGroupGetParamsAggInterval15m AttackLayer3TimeseriesGroupGetParamsAggInterval = "15m"
+ AttackLayer3TimeseriesGroupGetParamsAggInterval1h AttackLayer3TimeseriesGroupGetParamsAggInterval = "1h"
+ AttackLayer3TimeseriesGroupGetParamsAggInterval1d AttackLayer3TimeseriesGroupGetParamsAggInterval = "1d"
+ AttackLayer3TimeseriesGroupGetParamsAggInterval1w AttackLayer3TimeseriesGroupGetParamsAggInterval = "1w"
+)
+
+type AttackLayer3TimeseriesGroupGetParamsDateRange string
+
+const (
+ AttackLayer3TimeseriesGroupGetParamsDateRange1d AttackLayer3TimeseriesGroupGetParamsDateRange = "1d"
+ AttackLayer3TimeseriesGroupGetParamsDateRange2d AttackLayer3TimeseriesGroupGetParamsDateRange = "2d"
+ AttackLayer3TimeseriesGroupGetParamsDateRange7d AttackLayer3TimeseriesGroupGetParamsDateRange = "7d"
+ AttackLayer3TimeseriesGroupGetParamsDateRange14d AttackLayer3TimeseriesGroupGetParamsDateRange = "14d"
+ AttackLayer3TimeseriesGroupGetParamsDateRange28d AttackLayer3TimeseriesGroupGetParamsDateRange = "28d"
+ AttackLayer3TimeseriesGroupGetParamsDateRange12w AttackLayer3TimeseriesGroupGetParamsDateRange = "12w"
+ AttackLayer3TimeseriesGroupGetParamsDateRange24w AttackLayer3TimeseriesGroupGetParamsDateRange = "24w"
+ AttackLayer3TimeseriesGroupGetParamsDateRange52w AttackLayer3TimeseriesGroupGetParamsDateRange = "52w"
+ AttackLayer3TimeseriesGroupGetParamsDateRange1dControl AttackLayer3TimeseriesGroupGetParamsDateRange = "1dControl"
+ AttackLayer3TimeseriesGroupGetParamsDateRange2dControl AttackLayer3TimeseriesGroupGetParamsDateRange = "2dControl"
+ AttackLayer3TimeseriesGroupGetParamsDateRange7dControl AttackLayer3TimeseriesGroupGetParamsDateRange = "7dControl"
+ AttackLayer3TimeseriesGroupGetParamsDateRange14dControl AttackLayer3TimeseriesGroupGetParamsDateRange = "14dControl"
+ AttackLayer3TimeseriesGroupGetParamsDateRange28dControl AttackLayer3TimeseriesGroupGetParamsDateRange = "28dControl"
+ AttackLayer3TimeseriesGroupGetParamsDateRange12wControl AttackLayer3TimeseriesGroupGetParamsDateRange = "12wControl"
+ AttackLayer3TimeseriesGroupGetParamsDateRange24wControl AttackLayer3TimeseriesGroupGetParamsDateRange = "24wControl"
+)
+
+// Format results are returned in.
+type AttackLayer3TimeseriesGroupGetParamsFormat string
+
+const (
+ AttackLayer3TimeseriesGroupGetParamsFormatJson AttackLayer3TimeseriesGroupGetParamsFormat = "JSON"
+ AttackLayer3TimeseriesGroupGetParamsFormatCsv AttackLayer3TimeseriesGroupGetParamsFormat = "CSV"
+)
+
+type AttackLayer3TimeseriesGroupGetResponseEnvelope struct {
+ Result AttackLayer3TimeseriesGroupGetResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON attackLayer3TimeseriesGroupGetResponseEnvelopeJSON `json:"-"`
+}
+
+// attackLayer3TimeseriesGroupGetResponseEnvelopeJSON contains the JSON metadata
+// for the struct [AttackLayer3TimeseriesGroupGetResponseEnvelope]
+type attackLayer3TimeseriesGroupGetResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3TimeseriesGroupGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3TimeseriesGroupGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3TimeseriesGroupIndustryParams struct {
+ // Aggregation interval results should be returned in (for example, in 15 minutes
+ // or 1 hour intervals). Refer to
+ // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+ AggInterval param.Field[AttackLayer3TimeseriesGroupIndustryParamsAggInterval] `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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]AttackLayer3TimeseriesGroupIndustryParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Together with the `location` parameter, will apply the filter to origin or
+ // target location.
+ Direction param.Field[AttackLayer3TimeseriesGroupIndustryParamsDirection] `query:"direction"`
+ // Format results are returned in.
+ Format param.Field[AttackLayer3TimeseriesGroupIndustryParamsFormat] `query:"format"`
+ // Filter for ip version.
+ IPVersion param.Field[[]AttackLayer3TimeseriesGroupIndustryParamsIPVersion] `query:"ipVersion"`
+ // Limit the number of objects (eg browsers, verticals, etc) to the top items over
+ // the time range.
+ LimitPerGroup param.Field[int64] `query:"limitPerGroup"`
+ // Array of comma separated list of locations (alpha-2 country codes). Start with
+ // `-` to exclude from results. For example, `-US,PT` excludes results from the US,
+ // but includes results from PT.
+ 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"`
+ // Normalization method applied. Refer to
+ // [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/).
+ Normalization param.Field[AttackLayer3TimeseriesGroupIndustryParamsNormalization] `query:"normalization"`
+}
+
+// URLQuery serializes [AttackLayer3TimeseriesGroupIndustryParams]'s query
+// parameters as `url.Values`.
+func (r AttackLayer3TimeseriesGroupIndustryParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Aggregation interval results should be returned in (for example, in 15 minutes
+// or 1 hour intervals). Refer to
+// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+type AttackLayer3TimeseriesGroupIndustryParamsAggInterval string
+
+const (
+ AttackLayer3TimeseriesGroupIndustryParamsAggInterval15m AttackLayer3TimeseriesGroupIndustryParamsAggInterval = "15m"
+ AttackLayer3TimeseriesGroupIndustryParamsAggInterval1h AttackLayer3TimeseriesGroupIndustryParamsAggInterval = "1h"
+ AttackLayer3TimeseriesGroupIndustryParamsAggInterval1d AttackLayer3TimeseriesGroupIndustryParamsAggInterval = "1d"
+ AttackLayer3TimeseriesGroupIndustryParamsAggInterval1w AttackLayer3TimeseriesGroupIndustryParamsAggInterval = "1w"
+)
+
+type AttackLayer3TimeseriesGroupIndustryParamsDateRange string
+
+const (
+ AttackLayer3TimeseriesGroupIndustryParamsDateRange1d AttackLayer3TimeseriesGroupIndustryParamsDateRange = "1d"
+ AttackLayer3TimeseriesGroupIndustryParamsDateRange2d AttackLayer3TimeseriesGroupIndustryParamsDateRange = "2d"
+ AttackLayer3TimeseriesGroupIndustryParamsDateRange7d AttackLayer3TimeseriesGroupIndustryParamsDateRange = "7d"
+ AttackLayer3TimeseriesGroupIndustryParamsDateRange14d AttackLayer3TimeseriesGroupIndustryParamsDateRange = "14d"
+ AttackLayer3TimeseriesGroupIndustryParamsDateRange28d AttackLayer3TimeseriesGroupIndustryParamsDateRange = "28d"
+ AttackLayer3TimeseriesGroupIndustryParamsDateRange12w AttackLayer3TimeseriesGroupIndustryParamsDateRange = "12w"
+ AttackLayer3TimeseriesGroupIndustryParamsDateRange24w AttackLayer3TimeseriesGroupIndustryParamsDateRange = "24w"
+ AttackLayer3TimeseriesGroupIndustryParamsDateRange52w AttackLayer3TimeseriesGroupIndustryParamsDateRange = "52w"
+ AttackLayer3TimeseriesGroupIndustryParamsDateRange1dControl AttackLayer3TimeseriesGroupIndustryParamsDateRange = "1dControl"
+ AttackLayer3TimeseriesGroupIndustryParamsDateRange2dControl AttackLayer3TimeseriesGroupIndustryParamsDateRange = "2dControl"
+ AttackLayer3TimeseriesGroupIndustryParamsDateRange7dControl AttackLayer3TimeseriesGroupIndustryParamsDateRange = "7dControl"
+ AttackLayer3TimeseriesGroupIndustryParamsDateRange14dControl AttackLayer3TimeseriesGroupIndustryParamsDateRange = "14dControl"
+ AttackLayer3TimeseriesGroupIndustryParamsDateRange28dControl AttackLayer3TimeseriesGroupIndustryParamsDateRange = "28dControl"
+ AttackLayer3TimeseriesGroupIndustryParamsDateRange12wControl AttackLayer3TimeseriesGroupIndustryParamsDateRange = "12wControl"
+ AttackLayer3TimeseriesGroupIndustryParamsDateRange24wControl AttackLayer3TimeseriesGroupIndustryParamsDateRange = "24wControl"
+)
+
+// Together with the `location` parameter, will apply the filter to origin or
+// target location.
+type AttackLayer3TimeseriesGroupIndustryParamsDirection string
+
+const (
+ AttackLayer3TimeseriesGroupIndustryParamsDirectionOrigin AttackLayer3TimeseriesGroupIndustryParamsDirection = "ORIGIN"
+ AttackLayer3TimeseriesGroupIndustryParamsDirectionTarget AttackLayer3TimeseriesGroupIndustryParamsDirection = "TARGET"
+)
+
+// Format results are returned in.
+type AttackLayer3TimeseriesGroupIndustryParamsFormat string
+
+const (
+ AttackLayer3TimeseriesGroupIndustryParamsFormatJson AttackLayer3TimeseriesGroupIndustryParamsFormat = "JSON"
+ AttackLayer3TimeseriesGroupIndustryParamsFormatCsv AttackLayer3TimeseriesGroupIndustryParamsFormat = "CSV"
+)
+
+type AttackLayer3TimeseriesGroupIndustryParamsIPVersion string
+
+const (
+ AttackLayer3TimeseriesGroupIndustryParamsIPVersionIPv4 AttackLayer3TimeseriesGroupIndustryParamsIPVersion = "IPv4"
+ AttackLayer3TimeseriesGroupIndustryParamsIPVersionIPv6 AttackLayer3TimeseriesGroupIndustryParamsIPVersion = "IPv6"
+)
+
+// Normalization method applied. Refer to
+// [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/).
+type AttackLayer3TimeseriesGroupIndustryParamsNormalization string
+
+const (
+ AttackLayer3TimeseriesGroupIndustryParamsNormalizationPercentage AttackLayer3TimeseriesGroupIndustryParamsNormalization = "PERCENTAGE"
+ AttackLayer3TimeseriesGroupIndustryParamsNormalizationMin0Max AttackLayer3TimeseriesGroupIndustryParamsNormalization = "MIN0_MAX"
+)
+
+type AttackLayer3TimeseriesGroupIndustryResponseEnvelope struct {
+ Result AttackLayer3TimeseriesGroupIndustryResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON attackLayer3TimeseriesGroupIndustryResponseEnvelopeJSON `json:"-"`
+}
+
+// attackLayer3TimeseriesGroupIndustryResponseEnvelopeJSON contains the JSON
+// metadata for the struct [AttackLayer3TimeseriesGroupIndustryResponseEnvelope]
+type attackLayer3TimeseriesGroupIndustryResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3TimeseriesGroupIndustryResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3TimeseriesGroupIndustryResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3TimeseriesGroupIPVersionParams struct {
+ // Aggregation interval results should be returned in (for example, in 15 minutes
+ // or 1 hour intervals). Refer to
+ // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+ AggInterval param.Field[AttackLayer3TimeseriesGroupIPVersionParamsAggInterval] `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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]AttackLayer3TimeseriesGroupIPVersionParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Together with the `location` parameter, will apply the filter to origin or
+ // target location.
+ Direction param.Field[AttackLayer3TimeseriesGroupIPVersionParamsDirection] `query:"direction"`
+ // Format results are returned in.
+ Format param.Field[AttackLayer3TimeseriesGroupIPVersionParamsFormat] `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"`
+ // Normalization method applied. Refer to
+ // [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/).
+ Normalization param.Field[AttackLayer3TimeseriesGroupIPVersionParamsNormalization] `query:"normalization"`
+ // Array of L3/4 attack types.
+ Protocol param.Field[[]AttackLayer3TimeseriesGroupIPVersionParamsProtocol] `query:"protocol"`
+}
+
+// URLQuery serializes [AttackLayer3TimeseriesGroupIPVersionParams]'s query
+// parameters as `url.Values`.
+func (r AttackLayer3TimeseriesGroupIPVersionParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Aggregation interval results should be returned in (for example, in 15 minutes
+// or 1 hour intervals). Refer to
+// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+type AttackLayer3TimeseriesGroupIPVersionParamsAggInterval string
+
+const (
+ AttackLayer3TimeseriesGroupIPVersionParamsAggInterval15m AttackLayer3TimeseriesGroupIPVersionParamsAggInterval = "15m"
+ AttackLayer3TimeseriesGroupIPVersionParamsAggInterval1h AttackLayer3TimeseriesGroupIPVersionParamsAggInterval = "1h"
+ AttackLayer3TimeseriesGroupIPVersionParamsAggInterval1d AttackLayer3TimeseriesGroupIPVersionParamsAggInterval = "1d"
+ AttackLayer3TimeseriesGroupIPVersionParamsAggInterval1w AttackLayer3TimeseriesGroupIPVersionParamsAggInterval = "1w"
+)
+
+type AttackLayer3TimeseriesGroupIPVersionParamsDateRange string
+
+const (
+ AttackLayer3TimeseriesGroupIPVersionParamsDateRange1d AttackLayer3TimeseriesGroupIPVersionParamsDateRange = "1d"
+ AttackLayer3TimeseriesGroupIPVersionParamsDateRange2d AttackLayer3TimeseriesGroupIPVersionParamsDateRange = "2d"
+ AttackLayer3TimeseriesGroupIPVersionParamsDateRange7d AttackLayer3TimeseriesGroupIPVersionParamsDateRange = "7d"
+ AttackLayer3TimeseriesGroupIPVersionParamsDateRange14d AttackLayer3TimeseriesGroupIPVersionParamsDateRange = "14d"
+ AttackLayer3TimeseriesGroupIPVersionParamsDateRange28d AttackLayer3TimeseriesGroupIPVersionParamsDateRange = "28d"
+ AttackLayer3TimeseriesGroupIPVersionParamsDateRange12w AttackLayer3TimeseriesGroupIPVersionParamsDateRange = "12w"
+ AttackLayer3TimeseriesGroupIPVersionParamsDateRange24w AttackLayer3TimeseriesGroupIPVersionParamsDateRange = "24w"
+ AttackLayer3TimeseriesGroupIPVersionParamsDateRange52w AttackLayer3TimeseriesGroupIPVersionParamsDateRange = "52w"
+ AttackLayer3TimeseriesGroupIPVersionParamsDateRange1dControl AttackLayer3TimeseriesGroupIPVersionParamsDateRange = "1dControl"
+ AttackLayer3TimeseriesGroupIPVersionParamsDateRange2dControl AttackLayer3TimeseriesGroupIPVersionParamsDateRange = "2dControl"
+ AttackLayer3TimeseriesGroupIPVersionParamsDateRange7dControl AttackLayer3TimeseriesGroupIPVersionParamsDateRange = "7dControl"
+ AttackLayer3TimeseriesGroupIPVersionParamsDateRange14dControl AttackLayer3TimeseriesGroupIPVersionParamsDateRange = "14dControl"
+ AttackLayer3TimeseriesGroupIPVersionParamsDateRange28dControl AttackLayer3TimeseriesGroupIPVersionParamsDateRange = "28dControl"
+ AttackLayer3TimeseriesGroupIPVersionParamsDateRange12wControl AttackLayer3TimeseriesGroupIPVersionParamsDateRange = "12wControl"
+ AttackLayer3TimeseriesGroupIPVersionParamsDateRange24wControl AttackLayer3TimeseriesGroupIPVersionParamsDateRange = "24wControl"
+)
+
+// Together with the `location` parameter, will apply the filter to origin or
+// target location.
+type AttackLayer3TimeseriesGroupIPVersionParamsDirection string
+
+const (
+ AttackLayer3TimeseriesGroupIPVersionParamsDirectionOrigin AttackLayer3TimeseriesGroupIPVersionParamsDirection = "ORIGIN"
+ AttackLayer3TimeseriesGroupIPVersionParamsDirectionTarget AttackLayer3TimeseriesGroupIPVersionParamsDirection = "TARGET"
+)
+
+// Format results are returned in.
+type AttackLayer3TimeseriesGroupIPVersionParamsFormat string
+
+const (
+ AttackLayer3TimeseriesGroupIPVersionParamsFormatJson AttackLayer3TimeseriesGroupIPVersionParamsFormat = "JSON"
+ AttackLayer3TimeseriesGroupIPVersionParamsFormatCsv AttackLayer3TimeseriesGroupIPVersionParamsFormat = "CSV"
+)
+
+// Normalization method applied. Refer to
+// [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/).
+type AttackLayer3TimeseriesGroupIPVersionParamsNormalization string
+
+const (
+ AttackLayer3TimeseriesGroupIPVersionParamsNormalizationPercentage AttackLayer3TimeseriesGroupIPVersionParamsNormalization = "PERCENTAGE"
+ AttackLayer3TimeseriesGroupIPVersionParamsNormalizationMin0Max AttackLayer3TimeseriesGroupIPVersionParamsNormalization = "MIN0_MAX"
+)
+
+type AttackLayer3TimeseriesGroupIPVersionParamsProtocol string
+
+const (
+ AttackLayer3TimeseriesGroupIPVersionParamsProtocolUdp AttackLayer3TimeseriesGroupIPVersionParamsProtocol = "UDP"
+ AttackLayer3TimeseriesGroupIPVersionParamsProtocolTcp AttackLayer3TimeseriesGroupIPVersionParamsProtocol = "TCP"
+ AttackLayer3TimeseriesGroupIPVersionParamsProtocolIcmp AttackLayer3TimeseriesGroupIPVersionParamsProtocol = "ICMP"
+ AttackLayer3TimeseriesGroupIPVersionParamsProtocolGRE AttackLayer3TimeseriesGroupIPVersionParamsProtocol = "GRE"
+)
+
+type AttackLayer3TimeseriesGroupIPVersionResponseEnvelope struct {
+ Result AttackLayer3TimeseriesGroupIPVersionResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON attackLayer3TimeseriesGroupIPVersionResponseEnvelopeJSON `json:"-"`
+}
+
+// attackLayer3TimeseriesGroupIPVersionResponseEnvelopeJSON contains the JSON
+// metadata for the struct [AttackLayer3TimeseriesGroupIPVersionResponseEnvelope]
+type attackLayer3TimeseriesGroupIPVersionResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3TimeseriesGroupIPVersionResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3TimeseriesGroupIPVersionResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3TimeseriesGroupProtocolParams struct {
+ // Aggregation interval results should be returned in (for example, in 15 minutes
+ // or 1 hour intervals). Refer to
+ // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+ AggInterval param.Field[AttackLayer3TimeseriesGroupProtocolParamsAggInterval] `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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]AttackLayer3TimeseriesGroupProtocolParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Together with the `location` parameter, will apply the filter to origin or
+ // target location.
+ Direction param.Field[AttackLayer3TimeseriesGroupProtocolParamsDirection] `query:"direction"`
+ // Format results are returned in.
+ Format param.Field[AttackLayer3TimeseriesGroupProtocolParamsFormat] `query:"format"`
+ // Filter for ip version.
+ IPVersion param.Field[[]AttackLayer3TimeseriesGroupProtocolParamsIPVersion] `query:"ipVersion"`
+ // 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"`
+ // Normalization method applied. Refer to
+ // [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/).
+ Normalization param.Field[AttackLayer3TimeseriesGroupProtocolParamsNormalization] `query:"normalization"`
+}
+
+// URLQuery serializes [AttackLayer3TimeseriesGroupProtocolParams]'s query
+// parameters as `url.Values`.
+func (r AttackLayer3TimeseriesGroupProtocolParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Aggregation interval results should be returned in (for example, in 15 minutes
+// or 1 hour intervals). Refer to
+// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+type AttackLayer3TimeseriesGroupProtocolParamsAggInterval string
+
+const (
+ AttackLayer3TimeseriesGroupProtocolParamsAggInterval15m AttackLayer3TimeseriesGroupProtocolParamsAggInterval = "15m"
+ AttackLayer3TimeseriesGroupProtocolParamsAggInterval1h AttackLayer3TimeseriesGroupProtocolParamsAggInterval = "1h"
+ AttackLayer3TimeseriesGroupProtocolParamsAggInterval1d AttackLayer3TimeseriesGroupProtocolParamsAggInterval = "1d"
+ AttackLayer3TimeseriesGroupProtocolParamsAggInterval1w AttackLayer3TimeseriesGroupProtocolParamsAggInterval = "1w"
+)
+
+type AttackLayer3TimeseriesGroupProtocolParamsDateRange string
+
+const (
+ AttackLayer3TimeseriesGroupProtocolParamsDateRange1d AttackLayer3TimeseriesGroupProtocolParamsDateRange = "1d"
+ AttackLayer3TimeseriesGroupProtocolParamsDateRange2d AttackLayer3TimeseriesGroupProtocolParamsDateRange = "2d"
+ AttackLayer3TimeseriesGroupProtocolParamsDateRange7d AttackLayer3TimeseriesGroupProtocolParamsDateRange = "7d"
+ AttackLayer3TimeseriesGroupProtocolParamsDateRange14d AttackLayer3TimeseriesGroupProtocolParamsDateRange = "14d"
+ AttackLayer3TimeseriesGroupProtocolParamsDateRange28d AttackLayer3TimeseriesGroupProtocolParamsDateRange = "28d"
+ AttackLayer3TimeseriesGroupProtocolParamsDateRange12w AttackLayer3TimeseriesGroupProtocolParamsDateRange = "12w"
+ AttackLayer3TimeseriesGroupProtocolParamsDateRange24w AttackLayer3TimeseriesGroupProtocolParamsDateRange = "24w"
+ AttackLayer3TimeseriesGroupProtocolParamsDateRange52w AttackLayer3TimeseriesGroupProtocolParamsDateRange = "52w"
+ AttackLayer3TimeseriesGroupProtocolParamsDateRange1dControl AttackLayer3TimeseriesGroupProtocolParamsDateRange = "1dControl"
+ AttackLayer3TimeseriesGroupProtocolParamsDateRange2dControl AttackLayer3TimeseriesGroupProtocolParamsDateRange = "2dControl"
+ AttackLayer3TimeseriesGroupProtocolParamsDateRange7dControl AttackLayer3TimeseriesGroupProtocolParamsDateRange = "7dControl"
+ AttackLayer3TimeseriesGroupProtocolParamsDateRange14dControl AttackLayer3TimeseriesGroupProtocolParamsDateRange = "14dControl"
+ AttackLayer3TimeseriesGroupProtocolParamsDateRange28dControl AttackLayer3TimeseriesGroupProtocolParamsDateRange = "28dControl"
+ AttackLayer3TimeseriesGroupProtocolParamsDateRange12wControl AttackLayer3TimeseriesGroupProtocolParamsDateRange = "12wControl"
+ AttackLayer3TimeseriesGroupProtocolParamsDateRange24wControl AttackLayer3TimeseriesGroupProtocolParamsDateRange = "24wControl"
+)
+
+// Together with the `location` parameter, will apply the filter to origin or
+// target location.
+type AttackLayer3TimeseriesGroupProtocolParamsDirection string
+
+const (
+ AttackLayer3TimeseriesGroupProtocolParamsDirectionOrigin AttackLayer3TimeseriesGroupProtocolParamsDirection = "ORIGIN"
+ AttackLayer3TimeseriesGroupProtocolParamsDirectionTarget AttackLayer3TimeseriesGroupProtocolParamsDirection = "TARGET"
+)
+
+// Format results are returned in.
+type AttackLayer3TimeseriesGroupProtocolParamsFormat string
+
+const (
+ AttackLayer3TimeseriesGroupProtocolParamsFormatJson AttackLayer3TimeseriesGroupProtocolParamsFormat = "JSON"
+ AttackLayer3TimeseriesGroupProtocolParamsFormatCsv AttackLayer3TimeseriesGroupProtocolParamsFormat = "CSV"
+)
+
+type AttackLayer3TimeseriesGroupProtocolParamsIPVersion string
+
+const (
+ AttackLayer3TimeseriesGroupProtocolParamsIPVersionIPv4 AttackLayer3TimeseriesGroupProtocolParamsIPVersion = "IPv4"
+ AttackLayer3TimeseriesGroupProtocolParamsIPVersionIPv6 AttackLayer3TimeseriesGroupProtocolParamsIPVersion = "IPv6"
+)
+
+// Normalization method applied. Refer to
+// [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/).
+type AttackLayer3TimeseriesGroupProtocolParamsNormalization string
+
+const (
+ AttackLayer3TimeseriesGroupProtocolParamsNormalizationPercentage AttackLayer3TimeseriesGroupProtocolParamsNormalization = "PERCENTAGE"
+ AttackLayer3TimeseriesGroupProtocolParamsNormalizationMin0Max AttackLayer3TimeseriesGroupProtocolParamsNormalization = "MIN0_MAX"
+)
+
+type AttackLayer3TimeseriesGroupProtocolResponseEnvelope struct {
+ Result AttackLayer3TimeseriesGroupProtocolResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON attackLayer3TimeseriesGroupProtocolResponseEnvelopeJSON `json:"-"`
+}
+
+// attackLayer3TimeseriesGroupProtocolResponseEnvelopeJSON contains the JSON
+// metadata for the struct [AttackLayer3TimeseriesGroupProtocolResponseEnvelope]
+type attackLayer3TimeseriesGroupProtocolResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3TimeseriesGroupProtocolResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3TimeseriesGroupProtocolResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3TimeseriesGroupVectorParams struct {
+ // Aggregation interval results should be returned in (for example, in 15 minutes
+ // or 1 hour intervals). Refer to
+ // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+ AggInterval param.Field[AttackLayer3TimeseriesGroupVectorParamsAggInterval] `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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]AttackLayer3TimeseriesGroupVectorParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Together with the `location` parameter, will apply the filter to origin or
+ // target location.
+ Direction param.Field[AttackLayer3TimeseriesGroupVectorParamsDirection] `query:"direction"`
+ // Format results are returned in.
+ Format param.Field[AttackLayer3TimeseriesGroupVectorParamsFormat] `query:"format"`
+ // Filter for ip version.
+ IPVersion param.Field[[]AttackLayer3TimeseriesGroupVectorParamsIPVersion] `query:"ipVersion"`
+ // Limit the number of objects (eg browsers, verticals, etc) to the top items over
+ // the time range.
+ LimitPerGroup param.Field[int64] `query:"limitPerGroup"`
+ // Array of comma separated list of locations (alpha-2 country codes). Start with
+ // `-` to exclude from results. For example, `-US,PT` excludes results from the US,
+ // but includes results from PT.
+ 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"`
+ // Normalization method applied. Refer to
+ // [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/).
+ Normalization param.Field[AttackLayer3TimeseriesGroupVectorParamsNormalization] `query:"normalization"`
+ // Array of L3/4 attack types.
+ Protocol param.Field[[]AttackLayer3TimeseriesGroupVectorParamsProtocol] `query:"protocol"`
+}
+
+// URLQuery serializes [AttackLayer3TimeseriesGroupVectorParams]'s query parameters
+// as `url.Values`.
+func (r AttackLayer3TimeseriesGroupVectorParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Aggregation interval results should be returned in (for example, in 15 minutes
+// or 1 hour intervals). Refer to
+// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+type AttackLayer3TimeseriesGroupVectorParamsAggInterval string
+
+const (
+ AttackLayer3TimeseriesGroupVectorParamsAggInterval15m AttackLayer3TimeseriesGroupVectorParamsAggInterval = "15m"
+ AttackLayer3TimeseriesGroupVectorParamsAggInterval1h AttackLayer3TimeseriesGroupVectorParamsAggInterval = "1h"
+ AttackLayer3TimeseriesGroupVectorParamsAggInterval1d AttackLayer3TimeseriesGroupVectorParamsAggInterval = "1d"
+ AttackLayer3TimeseriesGroupVectorParamsAggInterval1w AttackLayer3TimeseriesGroupVectorParamsAggInterval = "1w"
+)
+
+type AttackLayer3TimeseriesGroupVectorParamsDateRange string
+
+const (
+ AttackLayer3TimeseriesGroupVectorParamsDateRange1d AttackLayer3TimeseriesGroupVectorParamsDateRange = "1d"
+ AttackLayer3TimeseriesGroupVectorParamsDateRange2d AttackLayer3TimeseriesGroupVectorParamsDateRange = "2d"
+ AttackLayer3TimeseriesGroupVectorParamsDateRange7d AttackLayer3TimeseriesGroupVectorParamsDateRange = "7d"
+ AttackLayer3TimeseriesGroupVectorParamsDateRange14d AttackLayer3TimeseriesGroupVectorParamsDateRange = "14d"
+ AttackLayer3TimeseriesGroupVectorParamsDateRange28d AttackLayer3TimeseriesGroupVectorParamsDateRange = "28d"
+ AttackLayer3TimeseriesGroupVectorParamsDateRange12w AttackLayer3TimeseriesGroupVectorParamsDateRange = "12w"
+ AttackLayer3TimeseriesGroupVectorParamsDateRange24w AttackLayer3TimeseriesGroupVectorParamsDateRange = "24w"
+ AttackLayer3TimeseriesGroupVectorParamsDateRange52w AttackLayer3TimeseriesGroupVectorParamsDateRange = "52w"
+ AttackLayer3TimeseriesGroupVectorParamsDateRange1dControl AttackLayer3TimeseriesGroupVectorParamsDateRange = "1dControl"
+ AttackLayer3TimeseriesGroupVectorParamsDateRange2dControl AttackLayer3TimeseriesGroupVectorParamsDateRange = "2dControl"
+ AttackLayer3TimeseriesGroupVectorParamsDateRange7dControl AttackLayer3TimeseriesGroupVectorParamsDateRange = "7dControl"
+ AttackLayer3TimeseriesGroupVectorParamsDateRange14dControl AttackLayer3TimeseriesGroupVectorParamsDateRange = "14dControl"
+ AttackLayer3TimeseriesGroupVectorParamsDateRange28dControl AttackLayer3TimeseriesGroupVectorParamsDateRange = "28dControl"
+ AttackLayer3TimeseriesGroupVectorParamsDateRange12wControl AttackLayer3TimeseriesGroupVectorParamsDateRange = "12wControl"
+ AttackLayer3TimeseriesGroupVectorParamsDateRange24wControl AttackLayer3TimeseriesGroupVectorParamsDateRange = "24wControl"
+)
+
+// Together with the `location` parameter, will apply the filter to origin or
+// target location.
+type AttackLayer3TimeseriesGroupVectorParamsDirection string
+
+const (
+ AttackLayer3TimeseriesGroupVectorParamsDirectionOrigin AttackLayer3TimeseriesGroupVectorParamsDirection = "ORIGIN"
+ AttackLayer3TimeseriesGroupVectorParamsDirectionTarget AttackLayer3TimeseriesGroupVectorParamsDirection = "TARGET"
+)
+
+// Format results are returned in.
+type AttackLayer3TimeseriesGroupVectorParamsFormat string
+
+const (
+ AttackLayer3TimeseriesGroupVectorParamsFormatJson AttackLayer3TimeseriesGroupVectorParamsFormat = "JSON"
+ AttackLayer3TimeseriesGroupVectorParamsFormatCsv AttackLayer3TimeseriesGroupVectorParamsFormat = "CSV"
+)
+
+type AttackLayer3TimeseriesGroupVectorParamsIPVersion string
+
+const (
+ AttackLayer3TimeseriesGroupVectorParamsIPVersionIPv4 AttackLayer3TimeseriesGroupVectorParamsIPVersion = "IPv4"
+ AttackLayer3TimeseriesGroupVectorParamsIPVersionIPv6 AttackLayer3TimeseriesGroupVectorParamsIPVersion = "IPv6"
+)
+
+// Normalization method applied. Refer to
+// [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/).
+type AttackLayer3TimeseriesGroupVectorParamsNormalization string
+
+const (
+ AttackLayer3TimeseriesGroupVectorParamsNormalizationPercentage AttackLayer3TimeseriesGroupVectorParamsNormalization = "PERCENTAGE"
+ AttackLayer3TimeseriesGroupVectorParamsNormalizationMin0Max AttackLayer3TimeseriesGroupVectorParamsNormalization = "MIN0_MAX"
+)
+
+type AttackLayer3TimeseriesGroupVectorParamsProtocol string
+
+const (
+ AttackLayer3TimeseriesGroupVectorParamsProtocolUdp AttackLayer3TimeseriesGroupVectorParamsProtocol = "UDP"
+ AttackLayer3TimeseriesGroupVectorParamsProtocolTcp AttackLayer3TimeseriesGroupVectorParamsProtocol = "TCP"
+ AttackLayer3TimeseriesGroupVectorParamsProtocolIcmp AttackLayer3TimeseriesGroupVectorParamsProtocol = "ICMP"
+ AttackLayer3TimeseriesGroupVectorParamsProtocolGRE AttackLayer3TimeseriesGroupVectorParamsProtocol = "GRE"
+)
+
+type AttackLayer3TimeseriesGroupVectorResponseEnvelope struct {
+ Result AttackLayer3TimeseriesGroupVectorResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON attackLayer3TimeseriesGroupVectorResponseEnvelopeJSON `json:"-"`
+}
+
+// attackLayer3TimeseriesGroupVectorResponseEnvelopeJSON contains the JSON metadata
+// for the struct [AttackLayer3TimeseriesGroupVectorResponseEnvelope]
+type attackLayer3TimeseriesGroupVectorResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3TimeseriesGroupVectorResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3TimeseriesGroupVectorResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3TimeseriesGroupVerticalParams struct {
+ // Aggregation interval results should be returned in (for example, in 15 minutes
+ // or 1 hour intervals). Refer to
+ // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+ AggInterval param.Field[AttackLayer3TimeseriesGroupVerticalParamsAggInterval] `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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]AttackLayer3TimeseriesGroupVerticalParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Together with the `location` parameter, will apply the filter to origin or
+ // target location.
+ Direction param.Field[AttackLayer3TimeseriesGroupVerticalParamsDirection] `query:"direction"`
+ // Format results are returned in.
+ Format param.Field[AttackLayer3TimeseriesGroupVerticalParamsFormat] `query:"format"`
+ // Filter for ip version.
+ IPVersion param.Field[[]AttackLayer3TimeseriesGroupVerticalParamsIPVersion] `query:"ipVersion"`
+ // Limit the number of objects (eg browsers, verticals, etc) to the top items over
+ // the time range.
+ LimitPerGroup param.Field[int64] `query:"limitPerGroup"`
+ // Array of comma separated list of locations (alpha-2 country codes). Start with
+ // `-` to exclude from results. For example, `-US,PT` excludes results from the US,
+ // but includes results from PT.
+ 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"`
+ // Normalization method applied. Refer to
+ // [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/).
+ Normalization param.Field[AttackLayer3TimeseriesGroupVerticalParamsNormalization] `query:"normalization"`
+}
+
+// URLQuery serializes [AttackLayer3TimeseriesGroupVerticalParams]'s query
+// parameters as `url.Values`.
+func (r AttackLayer3TimeseriesGroupVerticalParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Aggregation interval results should be returned in (for example, in 15 minutes
+// or 1 hour intervals). Refer to
+// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+type AttackLayer3TimeseriesGroupVerticalParamsAggInterval string
+
+const (
+ AttackLayer3TimeseriesGroupVerticalParamsAggInterval15m AttackLayer3TimeseriesGroupVerticalParamsAggInterval = "15m"
+ AttackLayer3TimeseriesGroupVerticalParamsAggInterval1h AttackLayer3TimeseriesGroupVerticalParamsAggInterval = "1h"
+ AttackLayer3TimeseriesGroupVerticalParamsAggInterval1d AttackLayer3TimeseriesGroupVerticalParamsAggInterval = "1d"
+ AttackLayer3TimeseriesGroupVerticalParamsAggInterval1w AttackLayer3TimeseriesGroupVerticalParamsAggInterval = "1w"
+)
+
+type AttackLayer3TimeseriesGroupVerticalParamsDateRange string
+
+const (
+ AttackLayer3TimeseriesGroupVerticalParamsDateRange1d AttackLayer3TimeseriesGroupVerticalParamsDateRange = "1d"
+ AttackLayer3TimeseriesGroupVerticalParamsDateRange2d AttackLayer3TimeseriesGroupVerticalParamsDateRange = "2d"
+ AttackLayer3TimeseriesGroupVerticalParamsDateRange7d AttackLayer3TimeseriesGroupVerticalParamsDateRange = "7d"
+ AttackLayer3TimeseriesGroupVerticalParamsDateRange14d AttackLayer3TimeseriesGroupVerticalParamsDateRange = "14d"
+ AttackLayer3TimeseriesGroupVerticalParamsDateRange28d AttackLayer3TimeseriesGroupVerticalParamsDateRange = "28d"
+ AttackLayer3TimeseriesGroupVerticalParamsDateRange12w AttackLayer3TimeseriesGroupVerticalParamsDateRange = "12w"
+ AttackLayer3TimeseriesGroupVerticalParamsDateRange24w AttackLayer3TimeseriesGroupVerticalParamsDateRange = "24w"
+ AttackLayer3TimeseriesGroupVerticalParamsDateRange52w AttackLayer3TimeseriesGroupVerticalParamsDateRange = "52w"
+ AttackLayer3TimeseriesGroupVerticalParamsDateRange1dControl AttackLayer3TimeseriesGroupVerticalParamsDateRange = "1dControl"
+ AttackLayer3TimeseriesGroupVerticalParamsDateRange2dControl AttackLayer3TimeseriesGroupVerticalParamsDateRange = "2dControl"
+ AttackLayer3TimeseriesGroupVerticalParamsDateRange7dControl AttackLayer3TimeseriesGroupVerticalParamsDateRange = "7dControl"
+ AttackLayer3TimeseriesGroupVerticalParamsDateRange14dControl AttackLayer3TimeseriesGroupVerticalParamsDateRange = "14dControl"
+ AttackLayer3TimeseriesGroupVerticalParamsDateRange28dControl AttackLayer3TimeseriesGroupVerticalParamsDateRange = "28dControl"
+ AttackLayer3TimeseriesGroupVerticalParamsDateRange12wControl AttackLayer3TimeseriesGroupVerticalParamsDateRange = "12wControl"
+ AttackLayer3TimeseriesGroupVerticalParamsDateRange24wControl AttackLayer3TimeseriesGroupVerticalParamsDateRange = "24wControl"
+)
+
+// Together with the `location` parameter, will apply the filter to origin or
+// target location.
+type AttackLayer3TimeseriesGroupVerticalParamsDirection string
+
+const (
+ AttackLayer3TimeseriesGroupVerticalParamsDirectionOrigin AttackLayer3TimeseriesGroupVerticalParamsDirection = "ORIGIN"
+ AttackLayer3TimeseriesGroupVerticalParamsDirectionTarget AttackLayer3TimeseriesGroupVerticalParamsDirection = "TARGET"
+)
+
+// Format results are returned in.
+type AttackLayer3TimeseriesGroupVerticalParamsFormat string
+
+const (
+ AttackLayer3TimeseriesGroupVerticalParamsFormatJson AttackLayer3TimeseriesGroupVerticalParamsFormat = "JSON"
+ AttackLayer3TimeseriesGroupVerticalParamsFormatCsv AttackLayer3TimeseriesGroupVerticalParamsFormat = "CSV"
+)
+
+type AttackLayer3TimeseriesGroupVerticalParamsIPVersion string
+
+const (
+ AttackLayer3TimeseriesGroupVerticalParamsIPVersionIPv4 AttackLayer3TimeseriesGroupVerticalParamsIPVersion = "IPv4"
+ AttackLayer3TimeseriesGroupVerticalParamsIPVersionIPv6 AttackLayer3TimeseriesGroupVerticalParamsIPVersion = "IPv6"
+)
+
+// Normalization method applied. Refer to
+// [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/).
+type AttackLayer3TimeseriesGroupVerticalParamsNormalization string
+
+const (
+ AttackLayer3TimeseriesGroupVerticalParamsNormalizationPercentage AttackLayer3TimeseriesGroupVerticalParamsNormalization = "PERCENTAGE"
+ AttackLayer3TimeseriesGroupVerticalParamsNormalizationMin0Max AttackLayer3TimeseriesGroupVerticalParamsNormalization = "MIN0_MAX"
+)
+
+type AttackLayer3TimeseriesGroupVerticalResponseEnvelope struct {
+ Result AttackLayer3TimeseriesGroupVerticalResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON attackLayer3TimeseriesGroupVerticalResponseEnvelopeJSON `json:"-"`
+}
+
+// attackLayer3TimeseriesGroupVerticalResponseEnvelopeJSON contains the JSON
+// metadata for the struct [AttackLayer3TimeseriesGroupVerticalResponseEnvelope]
+type attackLayer3TimeseriesGroupVerticalResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3TimeseriesGroupVerticalResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3TimeseriesGroupVerticalResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/radar/attacklayer3timeseriesgroup_test.go b/radar/attacklayer3timeseriesgroup_test.go
new file mode 100644
index 00000000000..e4264ad8fc7
--- /dev/null
+++ b/radar/attacklayer3timeseriesgroup_test.go
@@ -0,0 +1,308 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/radar"
+)
+
+func TestAttackLayer3TimeseriesGroupBitrateWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Attacks.Layer3.TimeseriesGroups.Bitrate(context.TODO(), radar.AttackLayer3TimeseriesGroupBitrateParams{
+ AggInterval: cloudflare.F(radar.AttackLayer3TimeseriesGroupBitrateParamsAggInterval1h),
+ Continent: cloudflare.F([]string{"string", "string", "string"}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.AttackLayer3TimeseriesGroupBitrateParamsDateRange{radar.AttackLayer3TimeseriesGroupBitrateParamsDateRange1d, radar.AttackLayer3TimeseriesGroupBitrateParamsDateRange2d, radar.AttackLayer3TimeseriesGroupBitrateParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Direction: cloudflare.F(radar.AttackLayer3TimeseriesGroupBitrateParamsDirectionOrigin),
+ Format: cloudflare.F(radar.AttackLayer3TimeseriesGroupBitrateParamsFormatJson),
+ IPVersion: cloudflare.F([]radar.AttackLayer3TimeseriesGroupBitrateParamsIPVersion{radar.AttackLayer3TimeseriesGroupBitrateParamsIPVersionIPv4, radar.AttackLayer3TimeseriesGroupBitrateParamsIPVersionIPv6}),
+ Location: cloudflare.F([]string{"string", "string", "string"}),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ Normalization: cloudflare.F(radar.AttackLayer3TimeseriesGroupBitrateParamsNormalizationPercentage),
+ Protocol: cloudflare.F([]radar.AttackLayer3TimeseriesGroupBitrateParamsProtocol{radar.AttackLayer3TimeseriesGroupBitrateParamsProtocolUdp, radar.AttackLayer3TimeseriesGroupBitrateParamsProtocolTcp, radar.AttackLayer3TimeseriesGroupBitrateParamsProtocolIcmp}),
+ })
+ 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())
+ }
+}
+
+func TestAttackLayer3TimeseriesGroupDurationWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Attacks.Layer3.TimeseriesGroups.Duration(context.TODO(), radar.AttackLayer3TimeseriesGroupDurationParams{
+ AggInterval: cloudflare.F(radar.AttackLayer3TimeseriesGroupDurationParamsAggInterval1h),
+ Continent: cloudflare.F([]string{"string", "string", "string"}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.AttackLayer3TimeseriesGroupDurationParamsDateRange{radar.AttackLayer3TimeseriesGroupDurationParamsDateRange1d, radar.AttackLayer3TimeseriesGroupDurationParamsDateRange2d, radar.AttackLayer3TimeseriesGroupDurationParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Direction: cloudflare.F(radar.AttackLayer3TimeseriesGroupDurationParamsDirectionOrigin),
+ Format: cloudflare.F(radar.AttackLayer3TimeseriesGroupDurationParamsFormatJson),
+ IPVersion: cloudflare.F([]radar.AttackLayer3TimeseriesGroupDurationParamsIPVersion{radar.AttackLayer3TimeseriesGroupDurationParamsIPVersionIPv4, radar.AttackLayer3TimeseriesGroupDurationParamsIPVersionIPv6}),
+ Location: cloudflare.F([]string{"string", "string", "string"}),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ Normalization: cloudflare.F(radar.AttackLayer3TimeseriesGroupDurationParamsNormalizationPercentage),
+ Protocol: cloudflare.F([]radar.AttackLayer3TimeseriesGroupDurationParamsProtocol{radar.AttackLayer3TimeseriesGroupDurationParamsProtocolUdp, radar.AttackLayer3TimeseriesGroupDurationParamsProtocolTcp, radar.AttackLayer3TimeseriesGroupDurationParamsProtocolIcmp}),
+ })
+ 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())
+ }
+}
+
+func TestAttackLayer3TimeseriesGroupGetWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Attacks.Layer3.TimeseriesGroups.Get(context.TODO(), radar.AttackLayer3TimeseriesGroupGetParams{
+ AggInterval: cloudflare.F(radar.AttackLayer3TimeseriesGroupGetParamsAggInterval1h),
+ 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([]radar.AttackLayer3TimeseriesGroupGetParamsDateRange{radar.AttackLayer3TimeseriesGroupGetParamsDateRange1d, radar.AttackLayer3TimeseriesGroupGetParamsDateRange2d, radar.AttackLayer3TimeseriesGroupGetParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Format: cloudflare.F(radar.AttackLayer3TimeseriesGroupGetParamsFormatJson),
+ 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())
+ }
+}
+
+func TestAttackLayer3TimeseriesGroupIndustryWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Attacks.Layer3.TimeseriesGroups.Industry(context.TODO(), radar.AttackLayer3TimeseriesGroupIndustryParams{
+ AggInterval: cloudflare.F(radar.AttackLayer3TimeseriesGroupIndustryParamsAggInterval1h),
+ Continent: cloudflare.F([]string{"string", "string", "string"}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.AttackLayer3TimeseriesGroupIndustryParamsDateRange{radar.AttackLayer3TimeseriesGroupIndustryParamsDateRange1d, radar.AttackLayer3TimeseriesGroupIndustryParamsDateRange2d, radar.AttackLayer3TimeseriesGroupIndustryParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Direction: cloudflare.F(radar.AttackLayer3TimeseriesGroupIndustryParamsDirectionOrigin),
+ Format: cloudflare.F(radar.AttackLayer3TimeseriesGroupIndustryParamsFormatJson),
+ IPVersion: cloudflare.F([]radar.AttackLayer3TimeseriesGroupIndustryParamsIPVersion{radar.AttackLayer3TimeseriesGroupIndustryParamsIPVersionIPv4, radar.AttackLayer3TimeseriesGroupIndustryParamsIPVersionIPv6}),
+ LimitPerGroup: cloudflare.F(int64(4)),
+ Location: cloudflare.F([]string{"string", "string", "string"}),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ Normalization: cloudflare.F(radar.AttackLayer3TimeseriesGroupIndustryParamsNormalizationPercentage),
+ })
+ 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())
+ }
+}
+
+func TestAttackLayer3TimeseriesGroupIPVersionWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Attacks.Layer3.TimeseriesGroups.IPVersion(context.TODO(), radar.AttackLayer3TimeseriesGroupIPVersionParams{
+ AggInterval: cloudflare.F(radar.AttackLayer3TimeseriesGroupIPVersionParamsAggInterval1h),
+ Continent: cloudflare.F([]string{"string", "string", "string"}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.AttackLayer3TimeseriesGroupIPVersionParamsDateRange{radar.AttackLayer3TimeseriesGroupIPVersionParamsDateRange1d, radar.AttackLayer3TimeseriesGroupIPVersionParamsDateRange2d, radar.AttackLayer3TimeseriesGroupIPVersionParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Direction: cloudflare.F(radar.AttackLayer3TimeseriesGroupIPVersionParamsDirectionOrigin),
+ Format: cloudflare.F(radar.AttackLayer3TimeseriesGroupIPVersionParamsFormatJson),
+ Location: cloudflare.F([]string{"string", "string", "string"}),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ Normalization: cloudflare.F(radar.AttackLayer3TimeseriesGroupIPVersionParamsNormalizationPercentage),
+ Protocol: cloudflare.F([]radar.AttackLayer3TimeseriesGroupIPVersionParamsProtocol{radar.AttackLayer3TimeseriesGroupIPVersionParamsProtocolUdp, radar.AttackLayer3TimeseriesGroupIPVersionParamsProtocolTcp, radar.AttackLayer3TimeseriesGroupIPVersionParamsProtocolIcmp}),
+ })
+ 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())
+ }
+}
+
+func TestAttackLayer3TimeseriesGroupProtocolWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Attacks.Layer3.TimeseriesGroups.Protocol(context.TODO(), radar.AttackLayer3TimeseriesGroupProtocolParams{
+ AggInterval: cloudflare.F(radar.AttackLayer3TimeseriesGroupProtocolParamsAggInterval1h),
+ Continent: cloudflare.F([]string{"string", "string", "string"}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.AttackLayer3TimeseriesGroupProtocolParamsDateRange{radar.AttackLayer3TimeseriesGroupProtocolParamsDateRange1d, radar.AttackLayer3TimeseriesGroupProtocolParamsDateRange2d, radar.AttackLayer3TimeseriesGroupProtocolParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Direction: cloudflare.F(radar.AttackLayer3TimeseriesGroupProtocolParamsDirectionOrigin),
+ Format: cloudflare.F(radar.AttackLayer3TimeseriesGroupProtocolParamsFormatJson),
+ IPVersion: cloudflare.F([]radar.AttackLayer3TimeseriesGroupProtocolParamsIPVersion{radar.AttackLayer3TimeseriesGroupProtocolParamsIPVersionIPv4, radar.AttackLayer3TimeseriesGroupProtocolParamsIPVersionIPv6}),
+ Location: cloudflare.F([]string{"string", "string", "string"}),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ Normalization: cloudflare.F(radar.AttackLayer3TimeseriesGroupProtocolParamsNormalizationPercentage),
+ })
+ 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())
+ }
+}
+
+func TestAttackLayer3TimeseriesGroupVectorWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Attacks.Layer3.TimeseriesGroups.Vector(context.TODO(), radar.AttackLayer3TimeseriesGroupVectorParams{
+ AggInterval: cloudflare.F(radar.AttackLayer3TimeseriesGroupVectorParamsAggInterval1h),
+ Continent: cloudflare.F([]string{"string", "string", "string"}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.AttackLayer3TimeseriesGroupVectorParamsDateRange{radar.AttackLayer3TimeseriesGroupVectorParamsDateRange1d, radar.AttackLayer3TimeseriesGroupVectorParamsDateRange2d, radar.AttackLayer3TimeseriesGroupVectorParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Direction: cloudflare.F(radar.AttackLayer3TimeseriesGroupVectorParamsDirectionOrigin),
+ Format: cloudflare.F(radar.AttackLayer3TimeseriesGroupVectorParamsFormatJson),
+ IPVersion: cloudflare.F([]radar.AttackLayer3TimeseriesGroupVectorParamsIPVersion{radar.AttackLayer3TimeseriesGroupVectorParamsIPVersionIPv4, radar.AttackLayer3TimeseriesGroupVectorParamsIPVersionIPv6}),
+ LimitPerGroup: cloudflare.F(int64(4)),
+ Location: cloudflare.F([]string{"string", "string", "string"}),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ Normalization: cloudflare.F(radar.AttackLayer3TimeseriesGroupVectorParamsNormalizationPercentage),
+ Protocol: cloudflare.F([]radar.AttackLayer3TimeseriesGroupVectorParamsProtocol{radar.AttackLayer3TimeseriesGroupVectorParamsProtocolUdp, radar.AttackLayer3TimeseriesGroupVectorParamsProtocolTcp, radar.AttackLayer3TimeseriesGroupVectorParamsProtocolIcmp}),
+ })
+ 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())
+ }
+}
+
+func TestAttackLayer3TimeseriesGroupVerticalWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Attacks.Layer3.TimeseriesGroups.Vertical(context.TODO(), radar.AttackLayer3TimeseriesGroupVerticalParams{
+ AggInterval: cloudflare.F(radar.AttackLayer3TimeseriesGroupVerticalParamsAggInterval1h),
+ Continent: cloudflare.F([]string{"string", "string", "string"}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.AttackLayer3TimeseriesGroupVerticalParamsDateRange{radar.AttackLayer3TimeseriesGroupVerticalParamsDateRange1d, radar.AttackLayer3TimeseriesGroupVerticalParamsDateRange2d, radar.AttackLayer3TimeseriesGroupVerticalParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Direction: cloudflare.F(radar.AttackLayer3TimeseriesGroupVerticalParamsDirectionOrigin),
+ Format: cloudflare.F(radar.AttackLayer3TimeseriesGroupVerticalParamsFormatJson),
+ IPVersion: cloudflare.F([]radar.AttackLayer3TimeseriesGroupVerticalParamsIPVersion{radar.AttackLayer3TimeseriesGroupVerticalParamsIPVersionIPv4, radar.AttackLayer3TimeseriesGroupVerticalParamsIPVersionIPv6}),
+ LimitPerGroup: cloudflare.F(int64(4)),
+ Location: cloudflare.F([]string{"string", "string", "string"}),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ Normalization: cloudflare.F(radar.AttackLayer3TimeseriesGroupVerticalParamsNormalizationPercentage),
+ })
+ 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/radar/attacklayer3top.go b/radar/attacklayer3top.go
new file mode 100644
index 00000000000..c62582630ac
--- /dev/null
+++ b/radar/attacklayer3top.go
@@ -0,0 +1,871 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "context"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// AttackLayer3TopService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewAttackLayer3TopService] method
+// instead.
+type AttackLayer3TopService struct {
+ Options []option.RequestOption
+ Locations *AttackLayer3TopLocationService
+}
+
+// NewAttackLayer3TopService generates a new service that applies the given options
+// to each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewAttackLayer3TopService(opts ...option.RequestOption) (r *AttackLayer3TopService) {
+ r = &AttackLayer3TopService{}
+ r.Options = opts
+ r.Locations = NewAttackLayer3TopLocationService(opts...)
+ return
+}
+
+// Get the top attacks from origin to target location. Values are a percentage out
+// of the total layer 3 attacks (with billing country). You can optionally limit
+// the number of attacks per origin/target location (useful if all the top attacks
+// are from or to the same location).
+func (r *AttackLayer3TopService) Attacks(ctx context.Context, query AttackLayer3TopAttacksParams, opts ...option.RequestOption) (res *AttackLayer3TopAttacksResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AttackLayer3TopAttacksResponseEnvelope
+ path := "radar/attacks/layer3/top/attacks"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Get the Industry of attacks.
+func (r *AttackLayer3TopService) Industry(ctx context.Context, query AttackLayer3TopIndustryParams, opts ...option.RequestOption) (res *AttackLayer3TopIndustryResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AttackLayer3TopIndustryResponseEnvelope
+ path := "radar/attacks/layer3/top/industry"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Get the Verticals of attacks.
+func (r *AttackLayer3TopService) Vertical(ctx context.Context, query AttackLayer3TopVerticalParams, opts ...option.RequestOption) (res *AttackLayer3TopVerticalResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AttackLayer3TopVerticalResponseEnvelope
+ path := "radar/attacks/layer3/top/vertical"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type AttackLayer3TopAttacksResponse struct {
+ Meta AttackLayer3TopAttacksResponseMeta `json:"meta,required"`
+ Top0 []AttackLayer3TopAttacksResponseTop0 `json:"top_0,required"`
+ JSON attackLayer3TopAttacksResponseJSON `json:"-"`
+}
+
+// attackLayer3TopAttacksResponseJSON contains the JSON metadata for the struct
+// [AttackLayer3TopAttacksResponse]
+type attackLayer3TopAttacksResponseJSON struct {
+ Meta apijson.Field
+ Top0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3TopAttacksResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3TopAttacksResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3TopAttacksResponseMeta struct {
+ DateRange []AttackLayer3TopAttacksResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ ConfidenceInfo AttackLayer3TopAttacksResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON attackLayer3TopAttacksResponseMetaJSON `json:"-"`
+}
+
+// attackLayer3TopAttacksResponseMetaJSON contains the JSON metadata for the struct
+// [AttackLayer3TopAttacksResponseMeta]
+type attackLayer3TopAttacksResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3TopAttacksResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3TopAttacksResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3TopAttacksResponseMetaDateRange 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 attackLayer3TopAttacksResponseMetaDateRangeJSON `json:"-"`
+}
+
+// attackLayer3TopAttacksResponseMetaDateRangeJSON contains the JSON metadata for
+// the struct [AttackLayer3TopAttacksResponseMetaDateRange]
+type attackLayer3TopAttacksResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3TopAttacksResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3TopAttacksResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3TopAttacksResponseMetaConfidenceInfo struct {
+ Annotations []AttackLayer3TopAttacksResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON attackLayer3TopAttacksResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// attackLayer3TopAttacksResponseMetaConfidenceInfoJSON contains the JSON metadata
+// for the struct [AttackLayer3TopAttacksResponseMetaConfidenceInfo]
+type attackLayer3TopAttacksResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3TopAttacksResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3TopAttacksResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3TopAttacksResponseMetaConfidenceInfoAnnotation 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 attackLayer3TopAttacksResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// attackLayer3TopAttacksResponseMetaConfidenceInfoAnnotationJSON contains the JSON
+// metadata for the struct
+// [AttackLayer3TopAttacksResponseMetaConfidenceInfoAnnotation]
+type attackLayer3TopAttacksResponseMetaConfidenceInfoAnnotationJSON 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 *AttackLayer3TopAttacksResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3TopAttacksResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3TopAttacksResponseTop0 struct {
+ OriginCountryAlpha2 string `json:"originCountryAlpha2,required"`
+ OriginCountryName string `json:"originCountryName,required"`
+ Value string `json:"value,required"`
+ JSON attackLayer3TopAttacksResponseTop0JSON `json:"-"`
+}
+
+// attackLayer3TopAttacksResponseTop0JSON contains the JSON metadata for the struct
+// [AttackLayer3TopAttacksResponseTop0]
+type attackLayer3TopAttacksResponseTop0JSON struct {
+ OriginCountryAlpha2 apijson.Field
+ OriginCountryName apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3TopAttacksResponseTop0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3TopAttacksResponseTop0JSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3TopIndustryResponse struct {
+ Meta AttackLayer3TopIndustryResponseMeta `json:"meta,required"`
+ Top0 []AttackLayer3TopIndustryResponseTop0 `json:"top_0,required"`
+ JSON attackLayer3TopIndustryResponseJSON `json:"-"`
+}
+
+// attackLayer3TopIndustryResponseJSON contains the JSON metadata for the struct
+// [AttackLayer3TopIndustryResponse]
+type attackLayer3TopIndustryResponseJSON struct {
+ Meta apijson.Field
+ Top0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3TopIndustryResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3TopIndustryResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3TopIndustryResponseMeta struct {
+ DateRange []AttackLayer3TopIndustryResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ ConfidenceInfo AttackLayer3TopIndustryResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON attackLayer3TopIndustryResponseMetaJSON `json:"-"`
+}
+
+// attackLayer3TopIndustryResponseMetaJSON contains the JSON metadata for the
+// struct [AttackLayer3TopIndustryResponseMeta]
+type attackLayer3TopIndustryResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3TopIndustryResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3TopIndustryResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3TopIndustryResponseMetaDateRange 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 attackLayer3TopIndustryResponseMetaDateRangeJSON `json:"-"`
+}
+
+// attackLayer3TopIndustryResponseMetaDateRangeJSON contains the JSON metadata for
+// the struct [AttackLayer3TopIndustryResponseMetaDateRange]
+type attackLayer3TopIndustryResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3TopIndustryResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3TopIndustryResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3TopIndustryResponseMetaConfidenceInfo struct {
+ Annotations []AttackLayer3TopIndustryResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON attackLayer3TopIndustryResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// attackLayer3TopIndustryResponseMetaConfidenceInfoJSON contains the JSON metadata
+// for the struct [AttackLayer3TopIndustryResponseMetaConfidenceInfo]
+type attackLayer3TopIndustryResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3TopIndustryResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3TopIndustryResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3TopIndustryResponseMetaConfidenceInfoAnnotation 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 attackLayer3TopIndustryResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// attackLayer3TopIndustryResponseMetaConfidenceInfoAnnotationJSON contains the
+// JSON metadata for the struct
+// [AttackLayer3TopIndustryResponseMetaConfidenceInfoAnnotation]
+type attackLayer3TopIndustryResponseMetaConfidenceInfoAnnotationJSON 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 *AttackLayer3TopIndustryResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3TopIndustryResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3TopIndustryResponseTop0 struct {
+ Name string `json:"name,required"`
+ Value string `json:"value,required"`
+ JSON attackLayer3TopIndustryResponseTop0JSON `json:"-"`
+}
+
+// attackLayer3TopIndustryResponseTop0JSON contains the JSON metadata for the
+// struct [AttackLayer3TopIndustryResponseTop0]
+type attackLayer3TopIndustryResponseTop0JSON struct {
+ Name apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3TopIndustryResponseTop0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3TopIndustryResponseTop0JSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3TopVerticalResponse struct {
+ Meta AttackLayer3TopVerticalResponseMeta `json:"meta,required"`
+ Top0 []AttackLayer3TopVerticalResponseTop0 `json:"top_0,required"`
+ JSON attackLayer3TopVerticalResponseJSON `json:"-"`
+}
+
+// attackLayer3TopVerticalResponseJSON contains the JSON metadata for the struct
+// [AttackLayer3TopVerticalResponse]
+type attackLayer3TopVerticalResponseJSON struct {
+ Meta apijson.Field
+ Top0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3TopVerticalResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3TopVerticalResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3TopVerticalResponseMeta struct {
+ DateRange []AttackLayer3TopVerticalResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ ConfidenceInfo AttackLayer3TopVerticalResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON attackLayer3TopVerticalResponseMetaJSON `json:"-"`
+}
+
+// attackLayer3TopVerticalResponseMetaJSON contains the JSON metadata for the
+// struct [AttackLayer3TopVerticalResponseMeta]
+type attackLayer3TopVerticalResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3TopVerticalResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3TopVerticalResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3TopVerticalResponseMetaDateRange 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 attackLayer3TopVerticalResponseMetaDateRangeJSON `json:"-"`
+}
+
+// attackLayer3TopVerticalResponseMetaDateRangeJSON contains the JSON metadata for
+// the struct [AttackLayer3TopVerticalResponseMetaDateRange]
+type attackLayer3TopVerticalResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3TopVerticalResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3TopVerticalResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3TopVerticalResponseMetaConfidenceInfo struct {
+ Annotations []AttackLayer3TopVerticalResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON attackLayer3TopVerticalResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// attackLayer3TopVerticalResponseMetaConfidenceInfoJSON contains the JSON metadata
+// for the struct [AttackLayer3TopVerticalResponseMetaConfidenceInfo]
+type attackLayer3TopVerticalResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3TopVerticalResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3TopVerticalResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3TopVerticalResponseMetaConfidenceInfoAnnotation 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 attackLayer3TopVerticalResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// attackLayer3TopVerticalResponseMetaConfidenceInfoAnnotationJSON contains the
+// JSON metadata for the struct
+// [AttackLayer3TopVerticalResponseMetaConfidenceInfoAnnotation]
+type attackLayer3TopVerticalResponseMetaConfidenceInfoAnnotationJSON 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 *AttackLayer3TopVerticalResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3TopVerticalResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3TopVerticalResponseTop0 struct {
+ Name string `json:"name,required"`
+ Value string `json:"value,required"`
+ JSON attackLayer3TopVerticalResponseTop0JSON `json:"-"`
+}
+
+// attackLayer3TopVerticalResponseTop0JSON contains the JSON metadata for the
+// struct [AttackLayer3TopVerticalResponseTop0]
+type attackLayer3TopVerticalResponseTop0JSON struct {
+ Name apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3TopVerticalResponseTop0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3TopVerticalResponseTop0JSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3TopAttacksParams 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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]AttackLayer3TopAttacksParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Format results are returned in.
+ Format param.Field[AttackLayer3TopAttacksParamsFormat] `query:"format"`
+ // Filter for ip version.
+ IPVersion param.Field[[]AttackLayer3TopAttacksParamsIPVersion] `query:"ipVersion"`
+ // Limit the number of objects in the response.
+ Limit param.Field[int64] `query:"limit"`
+ // Array of attack origin/target location attack limits. Together with
+ // `limitPerLocation`, limits how many objects will be fetched per origin/target
+ // location.
+ LimitDirection param.Field[AttackLayer3TopAttacksParamsLimitDirection] `query:"limitDirection"`
+ // Limit the number of attacks per origin/target (refer to `limitDirection`
+ // parameter) location.
+ LimitPerLocation param.Field[int64] `query:"limitPerLocation"`
+ // 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"`
+ // Array of L3/4 attack types.
+ Protocol param.Field[[]AttackLayer3TopAttacksParamsProtocol] `query:"protocol"`
+}
+
+// URLQuery serializes [AttackLayer3TopAttacksParams]'s query parameters as
+// `url.Values`.
+func (r AttackLayer3TopAttacksParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type AttackLayer3TopAttacksParamsDateRange string
+
+const (
+ AttackLayer3TopAttacksParamsDateRange1d AttackLayer3TopAttacksParamsDateRange = "1d"
+ AttackLayer3TopAttacksParamsDateRange2d AttackLayer3TopAttacksParamsDateRange = "2d"
+ AttackLayer3TopAttacksParamsDateRange7d AttackLayer3TopAttacksParamsDateRange = "7d"
+ AttackLayer3TopAttacksParamsDateRange14d AttackLayer3TopAttacksParamsDateRange = "14d"
+ AttackLayer3TopAttacksParamsDateRange28d AttackLayer3TopAttacksParamsDateRange = "28d"
+ AttackLayer3TopAttacksParamsDateRange12w AttackLayer3TopAttacksParamsDateRange = "12w"
+ AttackLayer3TopAttacksParamsDateRange24w AttackLayer3TopAttacksParamsDateRange = "24w"
+ AttackLayer3TopAttacksParamsDateRange52w AttackLayer3TopAttacksParamsDateRange = "52w"
+ AttackLayer3TopAttacksParamsDateRange1dControl AttackLayer3TopAttacksParamsDateRange = "1dControl"
+ AttackLayer3TopAttacksParamsDateRange2dControl AttackLayer3TopAttacksParamsDateRange = "2dControl"
+ AttackLayer3TopAttacksParamsDateRange7dControl AttackLayer3TopAttacksParamsDateRange = "7dControl"
+ AttackLayer3TopAttacksParamsDateRange14dControl AttackLayer3TopAttacksParamsDateRange = "14dControl"
+ AttackLayer3TopAttacksParamsDateRange28dControl AttackLayer3TopAttacksParamsDateRange = "28dControl"
+ AttackLayer3TopAttacksParamsDateRange12wControl AttackLayer3TopAttacksParamsDateRange = "12wControl"
+ AttackLayer3TopAttacksParamsDateRange24wControl AttackLayer3TopAttacksParamsDateRange = "24wControl"
+)
+
+// Format results are returned in.
+type AttackLayer3TopAttacksParamsFormat string
+
+const (
+ AttackLayer3TopAttacksParamsFormatJson AttackLayer3TopAttacksParamsFormat = "JSON"
+ AttackLayer3TopAttacksParamsFormatCsv AttackLayer3TopAttacksParamsFormat = "CSV"
+)
+
+type AttackLayer3TopAttacksParamsIPVersion string
+
+const (
+ AttackLayer3TopAttacksParamsIPVersionIPv4 AttackLayer3TopAttacksParamsIPVersion = "IPv4"
+ AttackLayer3TopAttacksParamsIPVersionIPv6 AttackLayer3TopAttacksParamsIPVersion = "IPv6"
+)
+
+// Array of attack origin/target location attack limits. Together with
+// `limitPerLocation`, limits how many objects will be fetched per origin/target
+// location.
+type AttackLayer3TopAttacksParamsLimitDirection string
+
+const (
+ AttackLayer3TopAttacksParamsLimitDirectionOrigin AttackLayer3TopAttacksParamsLimitDirection = "ORIGIN"
+ AttackLayer3TopAttacksParamsLimitDirectionTarget AttackLayer3TopAttacksParamsLimitDirection = "TARGET"
+)
+
+type AttackLayer3TopAttacksParamsProtocol string
+
+const (
+ AttackLayer3TopAttacksParamsProtocolUdp AttackLayer3TopAttacksParamsProtocol = "UDP"
+ AttackLayer3TopAttacksParamsProtocolTcp AttackLayer3TopAttacksParamsProtocol = "TCP"
+ AttackLayer3TopAttacksParamsProtocolIcmp AttackLayer3TopAttacksParamsProtocol = "ICMP"
+ AttackLayer3TopAttacksParamsProtocolGRE AttackLayer3TopAttacksParamsProtocol = "GRE"
+)
+
+type AttackLayer3TopAttacksResponseEnvelope struct {
+ Result AttackLayer3TopAttacksResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON attackLayer3TopAttacksResponseEnvelopeJSON `json:"-"`
+}
+
+// attackLayer3TopAttacksResponseEnvelopeJSON contains the JSON metadata for the
+// struct [AttackLayer3TopAttacksResponseEnvelope]
+type attackLayer3TopAttacksResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3TopAttacksResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3TopAttacksResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3TopIndustryParams 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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]AttackLayer3TopIndustryParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Format results are returned in.
+ Format param.Field[AttackLayer3TopIndustryParamsFormat] `query:"format"`
+ // Filter for ip version.
+ IPVersion param.Field[[]AttackLayer3TopIndustryParamsIPVersion] `query:"ipVersion"`
+ // 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"`
+ // Array of L3/4 attack types.
+ Protocol param.Field[[]AttackLayer3TopIndustryParamsProtocol] `query:"protocol"`
+}
+
+// URLQuery serializes [AttackLayer3TopIndustryParams]'s query parameters as
+// `url.Values`.
+func (r AttackLayer3TopIndustryParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type AttackLayer3TopIndustryParamsDateRange string
+
+const (
+ AttackLayer3TopIndustryParamsDateRange1d AttackLayer3TopIndustryParamsDateRange = "1d"
+ AttackLayer3TopIndustryParamsDateRange2d AttackLayer3TopIndustryParamsDateRange = "2d"
+ AttackLayer3TopIndustryParamsDateRange7d AttackLayer3TopIndustryParamsDateRange = "7d"
+ AttackLayer3TopIndustryParamsDateRange14d AttackLayer3TopIndustryParamsDateRange = "14d"
+ AttackLayer3TopIndustryParamsDateRange28d AttackLayer3TopIndustryParamsDateRange = "28d"
+ AttackLayer3TopIndustryParamsDateRange12w AttackLayer3TopIndustryParamsDateRange = "12w"
+ AttackLayer3TopIndustryParamsDateRange24w AttackLayer3TopIndustryParamsDateRange = "24w"
+ AttackLayer3TopIndustryParamsDateRange52w AttackLayer3TopIndustryParamsDateRange = "52w"
+ AttackLayer3TopIndustryParamsDateRange1dControl AttackLayer3TopIndustryParamsDateRange = "1dControl"
+ AttackLayer3TopIndustryParamsDateRange2dControl AttackLayer3TopIndustryParamsDateRange = "2dControl"
+ AttackLayer3TopIndustryParamsDateRange7dControl AttackLayer3TopIndustryParamsDateRange = "7dControl"
+ AttackLayer3TopIndustryParamsDateRange14dControl AttackLayer3TopIndustryParamsDateRange = "14dControl"
+ AttackLayer3TopIndustryParamsDateRange28dControl AttackLayer3TopIndustryParamsDateRange = "28dControl"
+ AttackLayer3TopIndustryParamsDateRange12wControl AttackLayer3TopIndustryParamsDateRange = "12wControl"
+ AttackLayer3TopIndustryParamsDateRange24wControl AttackLayer3TopIndustryParamsDateRange = "24wControl"
+)
+
+// Format results are returned in.
+type AttackLayer3TopIndustryParamsFormat string
+
+const (
+ AttackLayer3TopIndustryParamsFormatJson AttackLayer3TopIndustryParamsFormat = "JSON"
+ AttackLayer3TopIndustryParamsFormatCsv AttackLayer3TopIndustryParamsFormat = "CSV"
+)
+
+type AttackLayer3TopIndustryParamsIPVersion string
+
+const (
+ AttackLayer3TopIndustryParamsIPVersionIPv4 AttackLayer3TopIndustryParamsIPVersion = "IPv4"
+ AttackLayer3TopIndustryParamsIPVersionIPv6 AttackLayer3TopIndustryParamsIPVersion = "IPv6"
+)
+
+type AttackLayer3TopIndustryParamsProtocol string
+
+const (
+ AttackLayer3TopIndustryParamsProtocolUdp AttackLayer3TopIndustryParamsProtocol = "UDP"
+ AttackLayer3TopIndustryParamsProtocolTcp AttackLayer3TopIndustryParamsProtocol = "TCP"
+ AttackLayer3TopIndustryParamsProtocolIcmp AttackLayer3TopIndustryParamsProtocol = "ICMP"
+ AttackLayer3TopIndustryParamsProtocolGRE AttackLayer3TopIndustryParamsProtocol = "GRE"
+)
+
+type AttackLayer3TopIndustryResponseEnvelope struct {
+ Result AttackLayer3TopIndustryResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON attackLayer3TopIndustryResponseEnvelopeJSON `json:"-"`
+}
+
+// attackLayer3TopIndustryResponseEnvelopeJSON contains the JSON metadata for the
+// struct [AttackLayer3TopIndustryResponseEnvelope]
+type attackLayer3TopIndustryResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3TopIndustryResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3TopIndustryResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3TopVerticalParams 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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]AttackLayer3TopVerticalParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Format results are returned in.
+ Format param.Field[AttackLayer3TopVerticalParamsFormat] `query:"format"`
+ // Filter for ip version.
+ IPVersion param.Field[[]AttackLayer3TopVerticalParamsIPVersion] `query:"ipVersion"`
+ // 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"`
+ // Array of L3/4 attack types.
+ Protocol param.Field[[]AttackLayer3TopVerticalParamsProtocol] `query:"protocol"`
+}
+
+// URLQuery serializes [AttackLayer3TopVerticalParams]'s query parameters as
+// `url.Values`.
+func (r AttackLayer3TopVerticalParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type AttackLayer3TopVerticalParamsDateRange string
+
+const (
+ AttackLayer3TopVerticalParamsDateRange1d AttackLayer3TopVerticalParamsDateRange = "1d"
+ AttackLayer3TopVerticalParamsDateRange2d AttackLayer3TopVerticalParamsDateRange = "2d"
+ AttackLayer3TopVerticalParamsDateRange7d AttackLayer3TopVerticalParamsDateRange = "7d"
+ AttackLayer3TopVerticalParamsDateRange14d AttackLayer3TopVerticalParamsDateRange = "14d"
+ AttackLayer3TopVerticalParamsDateRange28d AttackLayer3TopVerticalParamsDateRange = "28d"
+ AttackLayer3TopVerticalParamsDateRange12w AttackLayer3TopVerticalParamsDateRange = "12w"
+ AttackLayer3TopVerticalParamsDateRange24w AttackLayer3TopVerticalParamsDateRange = "24w"
+ AttackLayer3TopVerticalParamsDateRange52w AttackLayer3TopVerticalParamsDateRange = "52w"
+ AttackLayer3TopVerticalParamsDateRange1dControl AttackLayer3TopVerticalParamsDateRange = "1dControl"
+ AttackLayer3TopVerticalParamsDateRange2dControl AttackLayer3TopVerticalParamsDateRange = "2dControl"
+ AttackLayer3TopVerticalParamsDateRange7dControl AttackLayer3TopVerticalParamsDateRange = "7dControl"
+ AttackLayer3TopVerticalParamsDateRange14dControl AttackLayer3TopVerticalParamsDateRange = "14dControl"
+ AttackLayer3TopVerticalParamsDateRange28dControl AttackLayer3TopVerticalParamsDateRange = "28dControl"
+ AttackLayer3TopVerticalParamsDateRange12wControl AttackLayer3TopVerticalParamsDateRange = "12wControl"
+ AttackLayer3TopVerticalParamsDateRange24wControl AttackLayer3TopVerticalParamsDateRange = "24wControl"
+)
+
+// Format results are returned in.
+type AttackLayer3TopVerticalParamsFormat string
+
+const (
+ AttackLayer3TopVerticalParamsFormatJson AttackLayer3TopVerticalParamsFormat = "JSON"
+ AttackLayer3TopVerticalParamsFormatCsv AttackLayer3TopVerticalParamsFormat = "CSV"
+)
+
+type AttackLayer3TopVerticalParamsIPVersion string
+
+const (
+ AttackLayer3TopVerticalParamsIPVersionIPv4 AttackLayer3TopVerticalParamsIPVersion = "IPv4"
+ AttackLayer3TopVerticalParamsIPVersionIPv6 AttackLayer3TopVerticalParamsIPVersion = "IPv6"
+)
+
+type AttackLayer3TopVerticalParamsProtocol string
+
+const (
+ AttackLayer3TopVerticalParamsProtocolUdp AttackLayer3TopVerticalParamsProtocol = "UDP"
+ AttackLayer3TopVerticalParamsProtocolTcp AttackLayer3TopVerticalParamsProtocol = "TCP"
+ AttackLayer3TopVerticalParamsProtocolIcmp AttackLayer3TopVerticalParamsProtocol = "ICMP"
+ AttackLayer3TopVerticalParamsProtocolGRE AttackLayer3TopVerticalParamsProtocol = "GRE"
+)
+
+type AttackLayer3TopVerticalResponseEnvelope struct {
+ Result AttackLayer3TopVerticalResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON attackLayer3TopVerticalResponseEnvelopeJSON `json:"-"`
+}
+
+// attackLayer3TopVerticalResponseEnvelopeJSON contains the JSON metadata for the
+// struct [AttackLayer3TopVerticalResponseEnvelope]
+type attackLayer3TopVerticalResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3TopVerticalResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3TopVerticalResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/radar/attacklayer3top_test.go b/radar/attacklayer3top_test.go
new file mode 100644
index 00000000000..ece75af4187
--- /dev/null
+++ b/radar/attacklayer3top_test.go
@@ -0,0 +1,123 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/radar"
+)
+
+func TestAttackLayer3TopAttacksWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Attacks.Layer3.Top.Attacks(context.TODO(), radar.AttackLayer3TopAttacksParams{
+ Continent: cloudflare.F([]string{"string", "string", "string"}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.AttackLayer3TopAttacksParamsDateRange{radar.AttackLayer3TopAttacksParamsDateRange1d, radar.AttackLayer3TopAttacksParamsDateRange2d, radar.AttackLayer3TopAttacksParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Format: cloudflare.F(radar.AttackLayer3TopAttacksParamsFormatJson),
+ IPVersion: cloudflare.F([]radar.AttackLayer3TopAttacksParamsIPVersion{radar.AttackLayer3TopAttacksParamsIPVersionIPv4, radar.AttackLayer3TopAttacksParamsIPVersionIPv6}),
+ Limit: cloudflare.F(int64(5)),
+ LimitDirection: cloudflare.F(radar.AttackLayer3TopAttacksParamsLimitDirectionOrigin),
+ LimitPerLocation: cloudflare.F(int64(10)),
+ Location: cloudflare.F([]string{"string", "string", "string"}),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ Protocol: cloudflare.F([]radar.AttackLayer3TopAttacksParamsProtocol{radar.AttackLayer3TopAttacksParamsProtocolUdp, radar.AttackLayer3TopAttacksParamsProtocolTcp, radar.AttackLayer3TopAttacksParamsProtocolIcmp}),
+ })
+ 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())
+ }
+}
+
+func TestAttackLayer3TopIndustryWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Attacks.Layer3.Top.Industry(context.TODO(), radar.AttackLayer3TopIndustryParams{
+ Continent: cloudflare.F([]string{"string", "string", "string"}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.AttackLayer3TopIndustryParamsDateRange{radar.AttackLayer3TopIndustryParamsDateRange1d, radar.AttackLayer3TopIndustryParamsDateRange2d, radar.AttackLayer3TopIndustryParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Format: cloudflare.F(radar.AttackLayer3TopIndustryParamsFormatJson),
+ IPVersion: cloudflare.F([]radar.AttackLayer3TopIndustryParamsIPVersion{radar.AttackLayer3TopIndustryParamsIPVersionIPv4, radar.AttackLayer3TopIndustryParamsIPVersionIPv6}),
+ Limit: cloudflare.F(int64(5)),
+ Location: cloudflare.F([]string{"string", "string", "string"}),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ Protocol: cloudflare.F([]radar.AttackLayer3TopIndustryParamsProtocol{radar.AttackLayer3TopIndustryParamsProtocolUdp, radar.AttackLayer3TopIndustryParamsProtocolTcp, radar.AttackLayer3TopIndustryParamsProtocolIcmp}),
+ })
+ 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())
+ }
+}
+
+func TestAttackLayer3TopVerticalWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Attacks.Layer3.Top.Vertical(context.TODO(), radar.AttackLayer3TopVerticalParams{
+ Continent: cloudflare.F([]string{"string", "string", "string"}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.AttackLayer3TopVerticalParamsDateRange{radar.AttackLayer3TopVerticalParamsDateRange1d, radar.AttackLayer3TopVerticalParamsDateRange2d, radar.AttackLayer3TopVerticalParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Format: cloudflare.F(radar.AttackLayer3TopVerticalParamsFormatJson),
+ IPVersion: cloudflare.F([]radar.AttackLayer3TopVerticalParamsIPVersion{radar.AttackLayer3TopVerticalParamsIPVersionIPv4, radar.AttackLayer3TopVerticalParamsIPVersionIPv6}),
+ Limit: cloudflare.F(int64(5)),
+ Location: cloudflare.F([]string{"string", "string", "string"}),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ Protocol: cloudflare.F([]radar.AttackLayer3TopVerticalParamsProtocol{radar.AttackLayer3TopVerticalParamsProtocolUdp, radar.AttackLayer3TopVerticalParamsProtocolTcp, radar.AttackLayer3TopVerticalParamsProtocolIcmp}),
+ })
+ 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/radar/attacklayer3toplocation.go b/radar/attacklayer3toplocation.go
new file mode 100644
index 00000000000..0bc886e53ad
--- /dev/null
+++ b/radar/attacklayer3toplocation.go
@@ -0,0 +1,586 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "context"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// AttackLayer3TopLocationService contains methods and other services that help
+// with interacting with the cloudflare API. Note, unlike clients, this service
+// does not read variables from the environment automatically. You should not
+// instantiate this service directly, and instead use the
+// [NewAttackLayer3TopLocationService] method instead.
+type AttackLayer3TopLocationService struct {
+ Options []option.RequestOption
+}
+
+// NewAttackLayer3TopLocationService generates a new service that applies the given
+// options to each request. These options are applied after the parent client's
+// options (if there is one), and before any request-specific options.
+func NewAttackLayer3TopLocationService(opts ...option.RequestOption) (r *AttackLayer3TopLocationService) {
+ r = &AttackLayer3TopLocationService{}
+ r.Options = opts
+ return
+}
+
+// Get the origin locations of attacks.
+func (r *AttackLayer3TopLocationService) Origin(ctx context.Context, query AttackLayer3TopLocationOriginParams, opts ...option.RequestOption) (res *AttackLayer3TopLocationOriginResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AttackLayer3TopLocationOriginResponseEnvelope
+ path := "radar/attacks/layer3/top/locations/origin"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Get the target locations of attacks.
+func (r *AttackLayer3TopLocationService) Target(ctx context.Context, query AttackLayer3TopLocationTargetParams, opts ...option.RequestOption) (res *AttackLayer3TopLocationTargetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AttackLayer3TopLocationTargetResponseEnvelope
+ path := "radar/attacks/layer3/top/locations/target"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type AttackLayer3TopLocationOriginResponse struct {
+ Meta AttackLayer3TopLocationOriginResponseMeta `json:"meta,required"`
+ Top0 []AttackLayer3TopLocationOriginResponseTop0 `json:"top_0,required"`
+ JSON attackLayer3TopLocationOriginResponseJSON `json:"-"`
+}
+
+// attackLayer3TopLocationOriginResponseJSON contains the JSON metadata for the
+// struct [AttackLayer3TopLocationOriginResponse]
+type attackLayer3TopLocationOriginResponseJSON struct {
+ Meta apijson.Field
+ Top0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3TopLocationOriginResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3TopLocationOriginResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3TopLocationOriginResponseMeta struct {
+ DateRange []AttackLayer3TopLocationOriginResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ ConfidenceInfo AttackLayer3TopLocationOriginResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON attackLayer3TopLocationOriginResponseMetaJSON `json:"-"`
+}
+
+// attackLayer3TopLocationOriginResponseMetaJSON contains the JSON metadata for the
+// struct [AttackLayer3TopLocationOriginResponseMeta]
+type attackLayer3TopLocationOriginResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3TopLocationOriginResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3TopLocationOriginResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3TopLocationOriginResponseMetaDateRange 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 attackLayer3TopLocationOriginResponseMetaDateRangeJSON `json:"-"`
+}
+
+// attackLayer3TopLocationOriginResponseMetaDateRangeJSON contains the JSON
+// metadata for the struct [AttackLayer3TopLocationOriginResponseMetaDateRange]
+type attackLayer3TopLocationOriginResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3TopLocationOriginResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3TopLocationOriginResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3TopLocationOriginResponseMetaConfidenceInfo struct {
+ Annotations []AttackLayer3TopLocationOriginResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON attackLayer3TopLocationOriginResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// attackLayer3TopLocationOriginResponseMetaConfidenceInfoJSON contains the JSON
+// metadata for the struct
+// [AttackLayer3TopLocationOriginResponseMetaConfidenceInfo]
+type attackLayer3TopLocationOriginResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3TopLocationOriginResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3TopLocationOriginResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3TopLocationOriginResponseMetaConfidenceInfoAnnotation 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 attackLayer3TopLocationOriginResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// attackLayer3TopLocationOriginResponseMetaConfidenceInfoAnnotationJSON contains
+// the JSON metadata for the struct
+// [AttackLayer3TopLocationOriginResponseMetaConfidenceInfoAnnotation]
+type attackLayer3TopLocationOriginResponseMetaConfidenceInfoAnnotationJSON 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 *AttackLayer3TopLocationOriginResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3TopLocationOriginResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3TopLocationOriginResponseTop0 struct {
+ OriginCountryAlpha2 string `json:"originCountryAlpha2,required"`
+ OriginCountryName string `json:"originCountryName,required"`
+ Rank float64 `json:"rank,required"`
+ Value string `json:"value,required"`
+ JSON attackLayer3TopLocationOriginResponseTop0JSON `json:"-"`
+}
+
+// attackLayer3TopLocationOriginResponseTop0JSON contains the JSON metadata for the
+// struct [AttackLayer3TopLocationOriginResponseTop0]
+type attackLayer3TopLocationOriginResponseTop0JSON struct {
+ OriginCountryAlpha2 apijson.Field
+ OriginCountryName apijson.Field
+ Rank apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3TopLocationOriginResponseTop0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3TopLocationOriginResponseTop0JSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3TopLocationTargetResponse struct {
+ Meta AttackLayer3TopLocationTargetResponseMeta `json:"meta,required"`
+ Top0 []AttackLayer3TopLocationTargetResponseTop0 `json:"top_0,required"`
+ JSON attackLayer3TopLocationTargetResponseJSON `json:"-"`
+}
+
+// attackLayer3TopLocationTargetResponseJSON contains the JSON metadata for the
+// struct [AttackLayer3TopLocationTargetResponse]
+type attackLayer3TopLocationTargetResponseJSON struct {
+ Meta apijson.Field
+ Top0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3TopLocationTargetResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3TopLocationTargetResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3TopLocationTargetResponseMeta struct {
+ DateRange []AttackLayer3TopLocationTargetResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ ConfidenceInfo AttackLayer3TopLocationTargetResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON attackLayer3TopLocationTargetResponseMetaJSON `json:"-"`
+}
+
+// attackLayer3TopLocationTargetResponseMetaJSON contains the JSON metadata for the
+// struct [AttackLayer3TopLocationTargetResponseMeta]
+type attackLayer3TopLocationTargetResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3TopLocationTargetResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3TopLocationTargetResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3TopLocationTargetResponseMetaDateRange 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 attackLayer3TopLocationTargetResponseMetaDateRangeJSON `json:"-"`
+}
+
+// attackLayer3TopLocationTargetResponseMetaDateRangeJSON contains the JSON
+// metadata for the struct [AttackLayer3TopLocationTargetResponseMetaDateRange]
+type attackLayer3TopLocationTargetResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3TopLocationTargetResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3TopLocationTargetResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3TopLocationTargetResponseMetaConfidenceInfo struct {
+ Annotations []AttackLayer3TopLocationTargetResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON attackLayer3TopLocationTargetResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// attackLayer3TopLocationTargetResponseMetaConfidenceInfoJSON contains the JSON
+// metadata for the struct
+// [AttackLayer3TopLocationTargetResponseMetaConfidenceInfo]
+type attackLayer3TopLocationTargetResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3TopLocationTargetResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3TopLocationTargetResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3TopLocationTargetResponseMetaConfidenceInfoAnnotation 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 attackLayer3TopLocationTargetResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// attackLayer3TopLocationTargetResponseMetaConfidenceInfoAnnotationJSON contains
+// the JSON metadata for the struct
+// [AttackLayer3TopLocationTargetResponseMetaConfidenceInfoAnnotation]
+type attackLayer3TopLocationTargetResponseMetaConfidenceInfoAnnotationJSON 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 *AttackLayer3TopLocationTargetResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3TopLocationTargetResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3TopLocationTargetResponseTop0 struct {
+ Rank float64 `json:"rank,required"`
+ TargetCountryAlpha2 string `json:"targetCountryAlpha2,required"`
+ TargetCountryName string `json:"targetCountryName,required"`
+ Value string `json:"value,required"`
+ JSON attackLayer3TopLocationTargetResponseTop0JSON `json:"-"`
+}
+
+// attackLayer3TopLocationTargetResponseTop0JSON contains the JSON metadata for the
+// struct [AttackLayer3TopLocationTargetResponseTop0]
+type attackLayer3TopLocationTargetResponseTop0JSON struct {
+ Rank apijson.Field
+ TargetCountryAlpha2 apijson.Field
+ TargetCountryName apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3TopLocationTargetResponseTop0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3TopLocationTargetResponseTop0JSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3TopLocationOriginParams 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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]AttackLayer3TopLocationOriginParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Format results are returned in.
+ Format param.Field[AttackLayer3TopLocationOriginParamsFormat] `query:"format"`
+ // Filter for ip version.
+ IPVersion param.Field[[]AttackLayer3TopLocationOriginParamsIPVersion] `query:"ipVersion"`
+ // 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"`
+ // Array of L3/4 attack types.
+ Protocol param.Field[[]AttackLayer3TopLocationOriginParamsProtocol] `query:"protocol"`
+}
+
+// URLQuery serializes [AttackLayer3TopLocationOriginParams]'s query parameters as
+// `url.Values`.
+func (r AttackLayer3TopLocationOriginParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type AttackLayer3TopLocationOriginParamsDateRange string
+
+const (
+ AttackLayer3TopLocationOriginParamsDateRange1d AttackLayer3TopLocationOriginParamsDateRange = "1d"
+ AttackLayer3TopLocationOriginParamsDateRange2d AttackLayer3TopLocationOriginParamsDateRange = "2d"
+ AttackLayer3TopLocationOriginParamsDateRange7d AttackLayer3TopLocationOriginParamsDateRange = "7d"
+ AttackLayer3TopLocationOriginParamsDateRange14d AttackLayer3TopLocationOriginParamsDateRange = "14d"
+ AttackLayer3TopLocationOriginParamsDateRange28d AttackLayer3TopLocationOriginParamsDateRange = "28d"
+ AttackLayer3TopLocationOriginParamsDateRange12w AttackLayer3TopLocationOriginParamsDateRange = "12w"
+ AttackLayer3TopLocationOriginParamsDateRange24w AttackLayer3TopLocationOriginParamsDateRange = "24w"
+ AttackLayer3TopLocationOriginParamsDateRange52w AttackLayer3TopLocationOriginParamsDateRange = "52w"
+ AttackLayer3TopLocationOriginParamsDateRange1dControl AttackLayer3TopLocationOriginParamsDateRange = "1dControl"
+ AttackLayer3TopLocationOriginParamsDateRange2dControl AttackLayer3TopLocationOriginParamsDateRange = "2dControl"
+ AttackLayer3TopLocationOriginParamsDateRange7dControl AttackLayer3TopLocationOriginParamsDateRange = "7dControl"
+ AttackLayer3TopLocationOriginParamsDateRange14dControl AttackLayer3TopLocationOriginParamsDateRange = "14dControl"
+ AttackLayer3TopLocationOriginParamsDateRange28dControl AttackLayer3TopLocationOriginParamsDateRange = "28dControl"
+ AttackLayer3TopLocationOriginParamsDateRange12wControl AttackLayer3TopLocationOriginParamsDateRange = "12wControl"
+ AttackLayer3TopLocationOriginParamsDateRange24wControl AttackLayer3TopLocationOriginParamsDateRange = "24wControl"
+)
+
+// Format results are returned in.
+type AttackLayer3TopLocationOriginParamsFormat string
+
+const (
+ AttackLayer3TopLocationOriginParamsFormatJson AttackLayer3TopLocationOriginParamsFormat = "JSON"
+ AttackLayer3TopLocationOriginParamsFormatCsv AttackLayer3TopLocationOriginParamsFormat = "CSV"
+)
+
+type AttackLayer3TopLocationOriginParamsIPVersion string
+
+const (
+ AttackLayer3TopLocationOriginParamsIPVersionIPv4 AttackLayer3TopLocationOriginParamsIPVersion = "IPv4"
+ AttackLayer3TopLocationOriginParamsIPVersionIPv6 AttackLayer3TopLocationOriginParamsIPVersion = "IPv6"
+)
+
+type AttackLayer3TopLocationOriginParamsProtocol string
+
+const (
+ AttackLayer3TopLocationOriginParamsProtocolUdp AttackLayer3TopLocationOriginParamsProtocol = "UDP"
+ AttackLayer3TopLocationOriginParamsProtocolTcp AttackLayer3TopLocationOriginParamsProtocol = "TCP"
+ AttackLayer3TopLocationOriginParamsProtocolIcmp AttackLayer3TopLocationOriginParamsProtocol = "ICMP"
+ AttackLayer3TopLocationOriginParamsProtocolGRE AttackLayer3TopLocationOriginParamsProtocol = "GRE"
+)
+
+type AttackLayer3TopLocationOriginResponseEnvelope struct {
+ Result AttackLayer3TopLocationOriginResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON attackLayer3TopLocationOriginResponseEnvelopeJSON `json:"-"`
+}
+
+// attackLayer3TopLocationOriginResponseEnvelopeJSON contains the JSON metadata for
+// the struct [AttackLayer3TopLocationOriginResponseEnvelope]
+type attackLayer3TopLocationOriginResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3TopLocationOriginResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3TopLocationOriginResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer3TopLocationTargetParams 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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]AttackLayer3TopLocationTargetParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Format results are returned in.
+ Format param.Field[AttackLayer3TopLocationTargetParamsFormat] `query:"format"`
+ // Filter for ip version.
+ IPVersion param.Field[[]AttackLayer3TopLocationTargetParamsIPVersion] `query:"ipVersion"`
+ // 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"`
+ // Array of L3/4 attack types.
+ Protocol param.Field[[]AttackLayer3TopLocationTargetParamsProtocol] `query:"protocol"`
+}
+
+// URLQuery serializes [AttackLayer3TopLocationTargetParams]'s query parameters as
+// `url.Values`.
+func (r AttackLayer3TopLocationTargetParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type AttackLayer3TopLocationTargetParamsDateRange string
+
+const (
+ AttackLayer3TopLocationTargetParamsDateRange1d AttackLayer3TopLocationTargetParamsDateRange = "1d"
+ AttackLayer3TopLocationTargetParamsDateRange2d AttackLayer3TopLocationTargetParamsDateRange = "2d"
+ AttackLayer3TopLocationTargetParamsDateRange7d AttackLayer3TopLocationTargetParamsDateRange = "7d"
+ AttackLayer3TopLocationTargetParamsDateRange14d AttackLayer3TopLocationTargetParamsDateRange = "14d"
+ AttackLayer3TopLocationTargetParamsDateRange28d AttackLayer3TopLocationTargetParamsDateRange = "28d"
+ AttackLayer3TopLocationTargetParamsDateRange12w AttackLayer3TopLocationTargetParamsDateRange = "12w"
+ AttackLayer3TopLocationTargetParamsDateRange24w AttackLayer3TopLocationTargetParamsDateRange = "24w"
+ AttackLayer3TopLocationTargetParamsDateRange52w AttackLayer3TopLocationTargetParamsDateRange = "52w"
+ AttackLayer3TopLocationTargetParamsDateRange1dControl AttackLayer3TopLocationTargetParamsDateRange = "1dControl"
+ AttackLayer3TopLocationTargetParamsDateRange2dControl AttackLayer3TopLocationTargetParamsDateRange = "2dControl"
+ AttackLayer3TopLocationTargetParamsDateRange7dControl AttackLayer3TopLocationTargetParamsDateRange = "7dControl"
+ AttackLayer3TopLocationTargetParamsDateRange14dControl AttackLayer3TopLocationTargetParamsDateRange = "14dControl"
+ AttackLayer3TopLocationTargetParamsDateRange28dControl AttackLayer3TopLocationTargetParamsDateRange = "28dControl"
+ AttackLayer3TopLocationTargetParamsDateRange12wControl AttackLayer3TopLocationTargetParamsDateRange = "12wControl"
+ AttackLayer3TopLocationTargetParamsDateRange24wControl AttackLayer3TopLocationTargetParamsDateRange = "24wControl"
+)
+
+// Format results are returned in.
+type AttackLayer3TopLocationTargetParamsFormat string
+
+const (
+ AttackLayer3TopLocationTargetParamsFormatJson AttackLayer3TopLocationTargetParamsFormat = "JSON"
+ AttackLayer3TopLocationTargetParamsFormatCsv AttackLayer3TopLocationTargetParamsFormat = "CSV"
+)
+
+type AttackLayer3TopLocationTargetParamsIPVersion string
+
+const (
+ AttackLayer3TopLocationTargetParamsIPVersionIPv4 AttackLayer3TopLocationTargetParamsIPVersion = "IPv4"
+ AttackLayer3TopLocationTargetParamsIPVersionIPv6 AttackLayer3TopLocationTargetParamsIPVersion = "IPv6"
+)
+
+type AttackLayer3TopLocationTargetParamsProtocol string
+
+const (
+ AttackLayer3TopLocationTargetParamsProtocolUdp AttackLayer3TopLocationTargetParamsProtocol = "UDP"
+ AttackLayer3TopLocationTargetParamsProtocolTcp AttackLayer3TopLocationTargetParamsProtocol = "TCP"
+ AttackLayer3TopLocationTargetParamsProtocolIcmp AttackLayer3TopLocationTargetParamsProtocol = "ICMP"
+ AttackLayer3TopLocationTargetParamsProtocolGRE AttackLayer3TopLocationTargetParamsProtocol = "GRE"
+)
+
+type AttackLayer3TopLocationTargetResponseEnvelope struct {
+ Result AttackLayer3TopLocationTargetResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON attackLayer3TopLocationTargetResponseEnvelopeJSON `json:"-"`
+}
+
+// attackLayer3TopLocationTargetResponseEnvelopeJSON contains the JSON metadata for
+// the struct [AttackLayer3TopLocationTargetResponseEnvelope]
+type attackLayer3TopLocationTargetResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer3TopLocationTargetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer3TopLocationTargetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/radar/attacklayer3toplocation_test.go b/radar/attacklayer3toplocation_test.go
new file mode 100644
index 00000000000..c3d95d66974
--- /dev/null
+++ b/radar/attacklayer3toplocation_test.go
@@ -0,0 +1,86 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/radar"
+)
+
+func TestAttackLayer3TopLocationOriginWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Attacks.Layer3.Top.Locations.Origin(context.TODO(), radar.AttackLayer3TopLocationOriginParams{
+ Continent: cloudflare.F([]string{"string", "string", "string"}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.AttackLayer3TopLocationOriginParamsDateRange{radar.AttackLayer3TopLocationOriginParamsDateRange1d, radar.AttackLayer3TopLocationOriginParamsDateRange2d, radar.AttackLayer3TopLocationOriginParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Format: cloudflare.F(radar.AttackLayer3TopLocationOriginParamsFormatJson),
+ IPVersion: cloudflare.F([]radar.AttackLayer3TopLocationOriginParamsIPVersion{radar.AttackLayer3TopLocationOriginParamsIPVersionIPv4, radar.AttackLayer3TopLocationOriginParamsIPVersionIPv6}),
+ Limit: cloudflare.F(int64(5)),
+ Location: cloudflare.F([]string{"string", "string", "string"}),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ Protocol: cloudflare.F([]radar.AttackLayer3TopLocationOriginParamsProtocol{radar.AttackLayer3TopLocationOriginParamsProtocolUdp, radar.AttackLayer3TopLocationOriginParamsProtocolTcp, radar.AttackLayer3TopLocationOriginParamsProtocolIcmp}),
+ })
+ 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())
+ }
+}
+
+func TestAttackLayer3TopLocationTargetWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Attacks.Layer3.Top.Locations.Target(context.TODO(), radar.AttackLayer3TopLocationTargetParams{
+ Continent: cloudflare.F([]string{"string", "string", "string"}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.AttackLayer3TopLocationTargetParamsDateRange{radar.AttackLayer3TopLocationTargetParamsDateRange1d, radar.AttackLayer3TopLocationTargetParamsDateRange2d, radar.AttackLayer3TopLocationTargetParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Format: cloudflare.F(radar.AttackLayer3TopLocationTargetParamsFormatJson),
+ IPVersion: cloudflare.F([]radar.AttackLayer3TopLocationTargetParamsIPVersion{radar.AttackLayer3TopLocationTargetParamsIPVersionIPv4, radar.AttackLayer3TopLocationTargetParamsIPVersionIPv6}),
+ Limit: cloudflare.F(int64(5)),
+ Location: cloudflare.F([]string{"string", "string", "string"}),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ Protocol: cloudflare.F([]radar.AttackLayer3TopLocationTargetParamsProtocol{radar.AttackLayer3TopLocationTargetParamsProtocolUdp, radar.AttackLayer3TopLocationTargetParamsProtocolTcp, radar.AttackLayer3TopLocationTargetParamsProtocolIcmp}),
+ })
+ 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/radar/attacklayer7.go b/radar/attacklayer7.go
new file mode 100644
index 00000000000..d4a6a0abdab
--- /dev/null
+++ b/radar/attacklayer7.go
@@ -0,0 +1,338 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "context"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// AttackLayer7Service contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewAttackLayer7Service] method
+// instead.
+type AttackLayer7Service struct {
+ Options []option.RequestOption
+ Summary *AttackLayer7SummaryService
+ TimeseriesGroups *AttackLayer7TimeseriesGroupService
+ Top *AttackLayer7TopService
+}
+
+// NewAttackLayer7Service generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewAttackLayer7Service(opts ...option.RequestOption) (r *AttackLayer7Service) {
+ r = &AttackLayer7Service{}
+ r.Options = opts
+ r.Summary = NewAttackLayer7SummaryService(opts...)
+ r.TimeseriesGroups = NewAttackLayer7TimeseriesGroupService(opts...)
+ r.Top = NewAttackLayer7TopService(opts...)
+ return
+}
+
+// Get a timeseries of Layer 7 attacks. Values represent HTTP requests and are
+// normalized using min-max by default.
+func (r *AttackLayer7Service) Timeseries(ctx context.Context, query AttackLayer7TimeseriesParams, opts ...option.RequestOption) (res *AttackLayer7TimeseriesResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AttackLayer7TimeseriesResponseEnvelope
+ path := "radar/attacks/layer7/timeseries"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type AttackLayer7TimeseriesResponse struct {
+ Meta AttackLayer7TimeseriesResponseMeta `json:"meta,required"`
+ Serie0 AttackLayer7TimeseriesResponseSerie0 `json:"serie_0,required"`
+ JSON attackLayer7TimeseriesResponseJSON `json:"-"`
+}
+
+// attackLayer7TimeseriesResponseJSON contains the JSON metadata for the struct
+// [AttackLayer7TimeseriesResponse]
+type attackLayer7TimeseriesResponseJSON struct {
+ Meta apijson.Field
+ Serie0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7TimeseriesResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TimeseriesResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7TimeseriesResponseMeta struct {
+ AggInterval string `json:"aggInterval,required"`
+ DateRange []AttackLayer7TimeseriesResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated time.Time `json:"lastUpdated,required" format:"date-time"`
+ ConfidenceInfo AttackLayer7TimeseriesResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON attackLayer7TimeseriesResponseMetaJSON `json:"-"`
+}
+
+// attackLayer7TimeseriesResponseMetaJSON contains the JSON metadata for the struct
+// [AttackLayer7TimeseriesResponseMeta]
+type attackLayer7TimeseriesResponseMetaJSON struct {
+ AggInterval apijson.Field
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7TimeseriesResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TimeseriesResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7TimeseriesResponseMetaDateRange 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 attackLayer7TimeseriesResponseMetaDateRangeJSON `json:"-"`
+}
+
+// attackLayer7TimeseriesResponseMetaDateRangeJSON contains the JSON metadata for
+// the struct [AttackLayer7TimeseriesResponseMetaDateRange]
+type attackLayer7TimeseriesResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7TimeseriesResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TimeseriesResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7TimeseriesResponseMetaConfidenceInfo struct {
+ Annotations []AttackLayer7TimeseriesResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON attackLayer7TimeseriesResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// attackLayer7TimeseriesResponseMetaConfidenceInfoJSON contains the JSON metadata
+// for the struct [AttackLayer7TimeseriesResponseMetaConfidenceInfo]
+type attackLayer7TimeseriesResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7TimeseriesResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TimeseriesResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7TimeseriesResponseMetaConfidenceInfoAnnotation 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 attackLayer7TimeseriesResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// attackLayer7TimeseriesResponseMetaConfidenceInfoAnnotationJSON contains the JSON
+// metadata for the struct
+// [AttackLayer7TimeseriesResponseMetaConfidenceInfoAnnotation]
+type attackLayer7TimeseriesResponseMetaConfidenceInfoAnnotationJSON 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 *AttackLayer7TimeseriesResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TimeseriesResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7TimeseriesResponseSerie0 struct {
+ Timestamps []time.Time `json:"timestamps,required" format:"date-time"`
+ Values []string `json:"values,required"`
+ JSON attackLayer7TimeseriesResponseSerie0JSON `json:"-"`
+}
+
+// attackLayer7TimeseriesResponseSerie0JSON contains the JSON metadata for the
+// struct [AttackLayer7TimeseriesResponseSerie0]
+type attackLayer7TimeseriesResponseSerie0JSON struct {
+ Timestamps apijson.Field
+ Values apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7TimeseriesResponseSerie0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TimeseriesResponseSerie0JSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7TimeseriesParams struct {
+ // Aggregation interval results should be returned in (for example, in 15 minutes
+ // or 1 hour intervals). Refer to
+ // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+ AggInterval param.Field[AttackLayer7TimeseriesParamsAggInterval] `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"`
+ // Array of L7 attack types.
+ Attack param.Field[[]AttackLayer7TimeseriesParamsAttack] `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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]AttackLayer7TimeseriesParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Format results are returned in.
+ Format param.Field[AttackLayer7TimeseriesParamsFormat] `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"`
+ // Normalization method applied. Refer to
+ // [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/).
+ Normalization param.Field[AttackLayer7TimeseriesParamsNormalization] `query:"normalization"`
+}
+
+// URLQuery serializes [AttackLayer7TimeseriesParams]'s query parameters as
+// `url.Values`.
+func (r AttackLayer7TimeseriesParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Aggregation interval results should be returned in (for example, in 15 minutes
+// or 1 hour intervals). Refer to
+// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+type AttackLayer7TimeseriesParamsAggInterval string
+
+const (
+ AttackLayer7TimeseriesParamsAggInterval15m AttackLayer7TimeseriesParamsAggInterval = "15m"
+ AttackLayer7TimeseriesParamsAggInterval1h AttackLayer7TimeseriesParamsAggInterval = "1h"
+ AttackLayer7TimeseriesParamsAggInterval1d AttackLayer7TimeseriesParamsAggInterval = "1d"
+ AttackLayer7TimeseriesParamsAggInterval1w AttackLayer7TimeseriesParamsAggInterval = "1w"
+)
+
+type AttackLayer7TimeseriesParamsAttack string
+
+const (
+ AttackLayer7TimeseriesParamsAttackDDOS AttackLayer7TimeseriesParamsAttack = "DDOS"
+ AttackLayer7TimeseriesParamsAttackWAF AttackLayer7TimeseriesParamsAttack = "WAF"
+ AttackLayer7TimeseriesParamsAttackBotManagement AttackLayer7TimeseriesParamsAttack = "BOT_MANAGEMENT"
+ AttackLayer7TimeseriesParamsAttackAccessRules AttackLayer7TimeseriesParamsAttack = "ACCESS_RULES"
+ AttackLayer7TimeseriesParamsAttackIPReputation AttackLayer7TimeseriesParamsAttack = "IP_REPUTATION"
+ AttackLayer7TimeseriesParamsAttackAPIShield AttackLayer7TimeseriesParamsAttack = "API_SHIELD"
+ AttackLayer7TimeseriesParamsAttackDataLossPrevention AttackLayer7TimeseriesParamsAttack = "DATA_LOSS_PREVENTION"
+)
+
+type AttackLayer7TimeseriesParamsDateRange string
+
+const (
+ AttackLayer7TimeseriesParamsDateRange1d AttackLayer7TimeseriesParamsDateRange = "1d"
+ AttackLayer7TimeseriesParamsDateRange2d AttackLayer7TimeseriesParamsDateRange = "2d"
+ AttackLayer7TimeseriesParamsDateRange7d AttackLayer7TimeseriesParamsDateRange = "7d"
+ AttackLayer7TimeseriesParamsDateRange14d AttackLayer7TimeseriesParamsDateRange = "14d"
+ AttackLayer7TimeseriesParamsDateRange28d AttackLayer7TimeseriesParamsDateRange = "28d"
+ AttackLayer7TimeseriesParamsDateRange12w AttackLayer7TimeseriesParamsDateRange = "12w"
+ AttackLayer7TimeseriesParamsDateRange24w AttackLayer7TimeseriesParamsDateRange = "24w"
+ AttackLayer7TimeseriesParamsDateRange52w AttackLayer7TimeseriesParamsDateRange = "52w"
+ AttackLayer7TimeseriesParamsDateRange1dControl AttackLayer7TimeseriesParamsDateRange = "1dControl"
+ AttackLayer7TimeseriesParamsDateRange2dControl AttackLayer7TimeseriesParamsDateRange = "2dControl"
+ AttackLayer7TimeseriesParamsDateRange7dControl AttackLayer7TimeseriesParamsDateRange = "7dControl"
+ AttackLayer7TimeseriesParamsDateRange14dControl AttackLayer7TimeseriesParamsDateRange = "14dControl"
+ AttackLayer7TimeseriesParamsDateRange28dControl AttackLayer7TimeseriesParamsDateRange = "28dControl"
+ AttackLayer7TimeseriesParamsDateRange12wControl AttackLayer7TimeseriesParamsDateRange = "12wControl"
+ AttackLayer7TimeseriesParamsDateRange24wControl AttackLayer7TimeseriesParamsDateRange = "24wControl"
+)
+
+// Format results are returned in.
+type AttackLayer7TimeseriesParamsFormat string
+
+const (
+ AttackLayer7TimeseriesParamsFormatJson AttackLayer7TimeseriesParamsFormat = "JSON"
+ AttackLayer7TimeseriesParamsFormatCsv AttackLayer7TimeseriesParamsFormat = "CSV"
+)
+
+// Normalization method applied. Refer to
+// [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/).
+type AttackLayer7TimeseriesParamsNormalization string
+
+const (
+ AttackLayer7TimeseriesParamsNormalizationPercentageChange AttackLayer7TimeseriesParamsNormalization = "PERCENTAGE_CHANGE"
+ AttackLayer7TimeseriesParamsNormalizationMin0Max AttackLayer7TimeseriesParamsNormalization = "MIN0_MAX"
+)
+
+type AttackLayer7TimeseriesResponseEnvelope struct {
+ Result AttackLayer7TimeseriesResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON attackLayer7TimeseriesResponseEnvelopeJSON `json:"-"`
+}
+
+// attackLayer7TimeseriesResponseEnvelopeJSON contains the JSON metadata for the
+// struct [AttackLayer7TimeseriesResponseEnvelope]
+type attackLayer7TimeseriesResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7TimeseriesResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TimeseriesResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/radar/attacklayer7_test.go b/radar/attacklayer7_test.go
new file mode 100644
index 00000000000..6b850ca49d1
--- /dev/null
+++ b/radar/attacklayer7_test.go
@@ -0,0 +1,52 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/radar"
+)
+
+func TestAttackLayer7TimeseriesWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Attacks.Layer7.Timeseries(context.TODO(), radar.AttackLayer7TimeseriesParams{
+ AggInterval: cloudflare.F(radar.AttackLayer7TimeseriesParamsAggInterval1h),
+ ASN: cloudflare.F([]string{"string", "string", "string"}),
+ Attack: cloudflare.F([]radar.AttackLayer7TimeseriesParamsAttack{radar.AttackLayer7TimeseriesParamsAttackDDOS, radar.AttackLayer7TimeseriesParamsAttackWAF, radar.AttackLayer7TimeseriesParamsAttackBotManagement}),
+ Continent: cloudflare.F([]string{"string", "string", "string"}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.AttackLayer7TimeseriesParamsDateRange{radar.AttackLayer7TimeseriesParamsDateRange1d, radar.AttackLayer7TimeseriesParamsDateRange2d, radar.AttackLayer7TimeseriesParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Format: cloudflare.F(radar.AttackLayer7TimeseriesParamsFormatJson),
+ Location: cloudflare.F([]string{"string", "string", "string"}),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ Normalization: cloudflare.F(radar.AttackLayer7TimeseriesParamsNormalizationMin0Max),
+ })
+ 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/radar/attacklayer7summary.go b/radar/attacklayer7summary.go
new file mode 100644
index 00000000000..40ebcd5734d
--- /dev/null
+++ b/radar/attacklayer7summary.go
@@ -0,0 +1,1921 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "context"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// AttackLayer7SummaryService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewAttackLayer7SummaryService]
+// method instead.
+type AttackLayer7SummaryService struct {
+ Options []option.RequestOption
+}
+
+// NewAttackLayer7SummaryService generates a new service that applies the given
+// options to each request. These options are applied after the parent client's
+// options (if there is one), and before any request-specific options.
+func NewAttackLayer7SummaryService(opts ...option.RequestOption) (r *AttackLayer7SummaryService) {
+ r = &AttackLayer7SummaryService{}
+ r.Options = opts
+ return
+}
+
+// Percentage distribution of mitigation techniques in Layer 7 attacks.
+func (r *AttackLayer7SummaryService) Get(ctx context.Context, query AttackLayer7SummaryGetParams, opts ...option.RequestOption) (res *AttackLayer7SummaryGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AttackLayer7SummaryGetResponseEnvelope
+ path := "radar/attacks/layer7/summary"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Percentage distribution of attacks by http method used.
+func (r *AttackLayer7SummaryService) HTTPMethod(ctx context.Context, query AttackLayer7SummaryHTTPMethodParams, opts ...option.RequestOption) (res *AttackLayer7SummaryHTTPMethodResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AttackLayer7SummaryHTTPMethodResponseEnvelope
+ path := "radar/attacks/layer7/summary/http_method"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Percentage distribution of attacks by http version used.
+func (r *AttackLayer7SummaryService) HTTPVersion(ctx context.Context, query AttackLayer7SummaryHTTPVersionParams, opts ...option.RequestOption) (res *AttackLayer7SummaryHTTPVersionResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AttackLayer7SummaryHTTPVersionResponseEnvelope
+ path := "radar/attacks/layer7/summary/http_version"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Percentage distribution of attacks by ip version used.
+func (r *AttackLayer7SummaryService) IPVersion(ctx context.Context, query AttackLayer7SummaryIPVersionParams, opts ...option.RequestOption) (res *AttackLayer7SummaryIPVersionResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AttackLayer7SummaryIPVersionResponseEnvelope
+ path := "radar/attacks/layer7/summary/ip_version"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Percentage distribution of attacks by managed rules used.
+func (r *AttackLayer7SummaryService) ManagedRules(ctx context.Context, query AttackLayer7SummaryManagedRulesParams, opts ...option.RequestOption) (res *AttackLayer7SummaryManagedRulesResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AttackLayer7SummaryManagedRulesResponseEnvelope
+ path := "radar/attacks/layer7/summary/managed_rules"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Percentage distribution of attacks by mitigation product used.
+func (r *AttackLayer7SummaryService) MitigationProduct(ctx context.Context, query AttackLayer7SummaryMitigationProductParams, opts ...option.RequestOption) (res *AttackLayer7SummaryMitigationProductResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AttackLayer7SummaryMitigationProductResponseEnvelope
+ path := "radar/attacks/layer7/summary/mitigation_product"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type AttackLayer7SummaryGetResponse struct {
+ Meta AttackLayer7SummaryGetResponseMeta `json:"meta,required"`
+ Summary0 AttackLayer7SummaryGetResponseSummary0 `json:"summary_0,required"`
+ JSON attackLayer7SummaryGetResponseJSON `json:"-"`
+}
+
+// attackLayer7SummaryGetResponseJSON contains the JSON metadata for the struct
+// [AttackLayer7SummaryGetResponse]
+type attackLayer7SummaryGetResponseJSON struct {
+ Meta apijson.Field
+ Summary0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7SummaryGetResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7SummaryGetResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7SummaryGetResponseMeta struct {
+ DateRange []AttackLayer7SummaryGetResponseMetaDateRange `json:"dateRange,required"`
+ ConfidenceInfo AttackLayer7SummaryGetResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON attackLayer7SummaryGetResponseMetaJSON `json:"-"`
+}
+
+// attackLayer7SummaryGetResponseMetaJSON contains the JSON metadata for the struct
+// [AttackLayer7SummaryGetResponseMeta]
+type attackLayer7SummaryGetResponseMetaJSON struct {
+ DateRange apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7SummaryGetResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7SummaryGetResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7SummaryGetResponseMetaDateRange 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 attackLayer7SummaryGetResponseMetaDateRangeJSON `json:"-"`
+}
+
+// attackLayer7SummaryGetResponseMetaDateRangeJSON contains the JSON metadata for
+// the struct [AttackLayer7SummaryGetResponseMetaDateRange]
+type attackLayer7SummaryGetResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7SummaryGetResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7SummaryGetResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7SummaryGetResponseMetaConfidenceInfo struct {
+ Annotations []AttackLayer7SummaryGetResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON attackLayer7SummaryGetResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// attackLayer7SummaryGetResponseMetaConfidenceInfoJSON contains the JSON metadata
+// for the struct [AttackLayer7SummaryGetResponseMetaConfidenceInfo]
+type attackLayer7SummaryGetResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7SummaryGetResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7SummaryGetResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7SummaryGetResponseMetaConfidenceInfoAnnotation 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 attackLayer7SummaryGetResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// attackLayer7SummaryGetResponseMetaConfidenceInfoAnnotationJSON contains the JSON
+// metadata for the struct
+// [AttackLayer7SummaryGetResponseMetaConfidenceInfoAnnotation]
+type attackLayer7SummaryGetResponseMetaConfidenceInfoAnnotationJSON 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 *AttackLayer7SummaryGetResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7SummaryGetResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7SummaryGetResponseSummary0 struct {
+ AccessRules string `json:"ACCESS_RULES,required"`
+ APIShield string `json:"API_SHIELD,required"`
+ BotManagement string `json:"BOT_MANAGEMENT,required"`
+ DataLossPrevention string `json:"DATA_LOSS_PREVENTION,required"`
+ DDOS string `json:"DDOS,required"`
+ IPReputation string `json:"IP_REPUTATION,required"`
+ WAF string `json:"WAF,required"`
+ JSON attackLayer7SummaryGetResponseSummary0JSON `json:"-"`
+}
+
+// attackLayer7SummaryGetResponseSummary0JSON contains the JSON metadata for the
+// struct [AttackLayer7SummaryGetResponseSummary0]
+type attackLayer7SummaryGetResponseSummary0JSON struct {
+ AccessRules apijson.Field
+ APIShield apijson.Field
+ BotManagement apijson.Field
+ DataLossPrevention apijson.Field
+ DDOS apijson.Field
+ IPReputation apijson.Field
+ WAF apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7SummaryGetResponseSummary0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7SummaryGetResponseSummary0JSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7SummaryHTTPMethodResponse struct {
+ Meta AttackLayer7SummaryHTTPMethodResponseMeta `json:"meta,required"`
+ Summary0 AttackLayer7SummaryHTTPMethodResponseSummary0 `json:"summary_0,required"`
+ JSON attackLayer7SummaryHTTPMethodResponseJSON `json:"-"`
+}
+
+// attackLayer7SummaryHTTPMethodResponseJSON contains the JSON metadata for the
+// struct [AttackLayer7SummaryHTTPMethodResponse]
+type attackLayer7SummaryHTTPMethodResponseJSON struct {
+ Meta apijson.Field
+ Summary0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7SummaryHTTPMethodResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7SummaryHTTPMethodResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7SummaryHTTPMethodResponseMeta struct {
+ DateRange []AttackLayer7SummaryHTTPMethodResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ Normalization string `json:"normalization,required"`
+ ConfidenceInfo AttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON attackLayer7SummaryHTTPMethodResponseMetaJSON `json:"-"`
+}
+
+// attackLayer7SummaryHTTPMethodResponseMetaJSON contains the JSON metadata for the
+// struct [AttackLayer7SummaryHTTPMethodResponseMeta]
+type attackLayer7SummaryHTTPMethodResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ Normalization apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7SummaryHTTPMethodResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7SummaryHTTPMethodResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7SummaryHTTPMethodResponseMetaDateRange 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 attackLayer7SummaryHTTPMethodResponseMetaDateRangeJSON `json:"-"`
+}
+
+// attackLayer7SummaryHTTPMethodResponseMetaDateRangeJSON contains the JSON
+// metadata for the struct [AttackLayer7SummaryHTTPMethodResponseMetaDateRange]
+type attackLayer7SummaryHTTPMethodResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7SummaryHTTPMethodResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7SummaryHTTPMethodResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfo struct {
+ Annotations []AttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON attackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// attackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoJSON contains the JSON
+// metadata for the struct
+// [AttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfo]
+type attackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotation 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 attackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// attackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotationJSON contains
+// the JSON metadata for the struct
+// [AttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotation]
+type attackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotationJSON 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 *AttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7SummaryHTTPMethodResponseSummary0 struct {
+ Get string `json:"GET,required"`
+ Post string `json:"POST,required"`
+ JSON attackLayer7SummaryHTTPMethodResponseSummary0JSON `json:"-"`
+}
+
+// attackLayer7SummaryHTTPMethodResponseSummary0JSON contains the JSON metadata for
+// the struct [AttackLayer7SummaryHTTPMethodResponseSummary0]
+type attackLayer7SummaryHTTPMethodResponseSummary0JSON struct {
+ Get apijson.Field
+ Post apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7SummaryHTTPMethodResponseSummary0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7SummaryHTTPMethodResponseSummary0JSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7SummaryHTTPVersionResponse struct {
+ Meta AttackLayer7SummaryHTTPVersionResponseMeta `json:"meta,required"`
+ Summary0 AttackLayer7SummaryHTTPVersionResponseSummary0 `json:"summary_0,required"`
+ JSON attackLayer7SummaryHTTPVersionResponseJSON `json:"-"`
+}
+
+// attackLayer7SummaryHTTPVersionResponseJSON contains the JSON metadata for the
+// struct [AttackLayer7SummaryHTTPVersionResponse]
+type attackLayer7SummaryHTTPVersionResponseJSON struct {
+ Meta apijson.Field
+ Summary0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7SummaryHTTPVersionResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7SummaryHTTPVersionResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7SummaryHTTPVersionResponseMeta struct {
+ DateRange []AttackLayer7SummaryHTTPVersionResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ Normalization string `json:"normalization,required"`
+ ConfidenceInfo AttackLayer7SummaryHTTPVersionResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON attackLayer7SummaryHTTPVersionResponseMetaJSON `json:"-"`
+}
+
+// attackLayer7SummaryHTTPVersionResponseMetaJSON contains the JSON metadata for
+// the struct [AttackLayer7SummaryHTTPVersionResponseMeta]
+type attackLayer7SummaryHTTPVersionResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ Normalization apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7SummaryHTTPVersionResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7SummaryHTTPVersionResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7SummaryHTTPVersionResponseMetaDateRange 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 attackLayer7SummaryHTTPVersionResponseMetaDateRangeJSON `json:"-"`
+}
+
+// attackLayer7SummaryHTTPVersionResponseMetaDateRangeJSON contains the JSON
+// metadata for the struct [AttackLayer7SummaryHTTPVersionResponseMetaDateRange]
+type attackLayer7SummaryHTTPVersionResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7SummaryHTTPVersionResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7SummaryHTTPVersionResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7SummaryHTTPVersionResponseMetaConfidenceInfo struct {
+ Annotations []AttackLayer7SummaryHTTPVersionResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON attackLayer7SummaryHTTPVersionResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// attackLayer7SummaryHTTPVersionResponseMetaConfidenceInfoJSON contains the JSON
+// metadata for the struct
+// [AttackLayer7SummaryHTTPVersionResponseMetaConfidenceInfo]
+type attackLayer7SummaryHTTPVersionResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7SummaryHTTPVersionResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7SummaryHTTPVersionResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7SummaryHTTPVersionResponseMetaConfidenceInfoAnnotation 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 attackLayer7SummaryHTTPVersionResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// attackLayer7SummaryHTTPVersionResponseMetaConfidenceInfoAnnotationJSON contains
+// the JSON metadata for the struct
+// [AttackLayer7SummaryHTTPVersionResponseMetaConfidenceInfoAnnotation]
+type attackLayer7SummaryHTTPVersionResponseMetaConfidenceInfoAnnotationJSON 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 *AttackLayer7SummaryHTTPVersionResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7SummaryHTTPVersionResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7SummaryHTTPVersionResponseSummary0 struct {
+ HTTP1X string `json:"HTTP/1.x,required"`
+ HTTP2 string `json:"HTTP/2,required"`
+ HTTP3 string `json:"HTTP/3,required"`
+ JSON attackLayer7SummaryHTTPVersionResponseSummary0JSON `json:"-"`
+}
+
+// attackLayer7SummaryHTTPVersionResponseSummary0JSON contains the JSON metadata
+// for the struct [AttackLayer7SummaryHTTPVersionResponseSummary0]
+type attackLayer7SummaryHTTPVersionResponseSummary0JSON struct {
+ HTTP1X apijson.Field
+ HTTP2 apijson.Field
+ HTTP3 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7SummaryHTTPVersionResponseSummary0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7SummaryHTTPVersionResponseSummary0JSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7SummaryIPVersionResponse struct {
+ Meta AttackLayer7SummaryIPVersionResponseMeta `json:"meta,required"`
+ Summary0 AttackLayer7SummaryIPVersionResponseSummary0 `json:"summary_0,required"`
+ JSON attackLayer7SummaryIPVersionResponseJSON `json:"-"`
+}
+
+// attackLayer7SummaryIPVersionResponseJSON contains the JSON metadata for the
+// struct [AttackLayer7SummaryIPVersionResponse]
+type attackLayer7SummaryIPVersionResponseJSON struct {
+ Meta apijson.Field
+ Summary0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7SummaryIPVersionResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7SummaryIPVersionResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7SummaryIPVersionResponseMeta struct {
+ DateRange []AttackLayer7SummaryIPVersionResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ Normalization string `json:"normalization,required"`
+ ConfidenceInfo AttackLayer7SummaryIPVersionResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON attackLayer7SummaryIPVersionResponseMetaJSON `json:"-"`
+}
+
+// attackLayer7SummaryIPVersionResponseMetaJSON contains the JSON metadata for the
+// struct [AttackLayer7SummaryIPVersionResponseMeta]
+type attackLayer7SummaryIPVersionResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ Normalization apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7SummaryIPVersionResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7SummaryIPVersionResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7SummaryIPVersionResponseMetaDateRange 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 attackLayer7SummaryIPVersionResponseMetaDateRangeJSON `json:"-"`
+}
+
+// attackLayer7SummaryIPVersionResponseMetaDateRangeJSON contains the JSON metadata
+// for the struct [AttackLayer7SummaryIPVersionResponseMetaDateRange]
+type attackLayer7SummaryIPVersionResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7SummaryIPVersionResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7SummaryIPVersionResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7SummaryIPVersionResponseMetaConfidenceInfo struct {
+ Annotations []AttackLayer7SummaryIPVersionResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON attackLayer7SummaryIPVersionResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// attackLayer7SummaryIPVersionResponseMetaConfidenceInfoJSON contains the JSON
+// metadata for the struct [AttackLayer7SummaryIPVersionResponseMetaConfidenceInfo]
+type attackLayer7SummaryIPVersionResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7SummaryIPVersionResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7SummaryIPVersionResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7SummaryIPVersionResponseMetaConfidenceInfoAnnotation 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 attackLayer7SummaryIPVersionResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// attackLayer7SummaryIPVersionResponseMetaConfidenceInfoAnnotationJSON contains
+// the JSON metadata for the struct
+// [AttackLayer7SummaryIPVersionResponseMetaConfidenceInfoAnnotation]
+type attackLayer7SummaryIPVersionResponseMetaConfidenceInfoAnnotationJSON 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 *AttackLayer7SummaryIPVersionResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7SummaryIPVersionResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7SummaryIPVersionResponseSummary0 struct {
+ IPv4 string `json:"IPv4,required"`
+ IPv6 string `json:"IPv6,required"`
+ JSON attackLayer7SummaryIPVersionResponseSummary0JSON `json:"-"`
+}
+
+// attackLayer7SummaryIPVersionResponseSummary0JSON contains the JSON metadata for
+// the struct [AttackLayer7SummaryIPVersionResponseSummary0]
+type attackLayer7SummaryIPVersionResponseSummary0JSON struct {
+ IPv4 apijson.Field
+ IPv6 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7SummaryIPVersionResponseSummary0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7SummaryIPVersionResponseSummary0JSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7SummaryManagedRulesResponse struct {
+ Meta AttackLayer7SummaryManagedRulesResponseMeta `json:"meta,required"`
+ Summary0 AttackLayer7SummaryManagedRulesResponseSummary0 `json:"summary_0,required"`
+ JSON attackLayer7SummaryManagedRulesResponseJSON `json:"-"`
+}
+
+// attackLayer7SummaryManagedRulesResponseJSON contains the JSON metadata for the
+// struct [AttackLayer7SummaryManagedRulesResponse]
+type attackLayer7SummaryManagedRulesResponseJSON struct {
+ Meta apijson.Field
+ Summary0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7SummaryManagedRulesResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7SummaryManagedRulesResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7SummaryManagedRulesResponseMeta struct {
+ DateRange []AttackLayer7SummaryManagedRulesResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ Normalization string `json:"normalization,required"`
+ ConfidenceInfo AttackLayer7SummaryManagedRulesResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON attackLayer7SummaryManagedRulesResponseMetaJSON `json:"-"`
+}
+
+// attackLayer7SummaryManagedRulesResponseMetaJSON contains the JSON metadata for
+// the struct [AttackLayer7SummaryManagedRulesResponseMeta]
+type attackLayer7SummaryManagedRulesResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ Normalization apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7SummaryManagedRulesResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7SummaryManagedRulesResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7SummaryManagedRulesResponseMetaDateRange 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 attackLayer7SummaryManagedRulesResponseMetaDateRangeJSON `json:"-"`
+}
+
+// attackLayer7SummaryManagedRulesResponseMetaDateRangeJSON contains the JSON
+// metadata for the struct [AttackLayer7SummaryManagedRulesResponseMetaDateRange]
+type attackLayer7SummaryManagedRulesResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7SummaryManagedRulesResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7SummaryManagedRulesResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7SummaryManagedRulesResponseMetaConfidenceInfo struct {
+ Annotations []AttackLayer7SummaryManagedRulesResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON attackLayer7SummaryManagedRulesResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// attackLayer7SummaryManagedRulesResponseMetaConfidenceInfoJSON contains the JSON
+// metadata for the struct
+// [AttackLayer7SummaryManagedRulesResponseMetaConfidenceInfo]
+type attackLayer7SummaryManagedRulesResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7SummaryManagedRulesResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7SummaryManagedRulesResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7SummaryManagedRulesResponseMetaConfidenceInfoAnnotation 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 attackLayer7SummaryManagedRulesResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// attackLayer7SummaryManagedRulesResponseMetaConfidenceInfoAnnotationJSON contains
+// the JSON metadata for the struct
+// [AttackLayer7SummaryManagedRulesResponseMetaConfidenceInfoAnnotation]
+type attackLayer7SummaryManagedRulesResponseMetaConfidenceInfoAnnotationJSON 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 *AttackLayer7SummaryManagedRulesResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7SummaryManagedRulesResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7SummaryManagedRulesResponseSummary0 struct {
+ Bot string `json:"Bot,required"`
+ HTTPAnomaly string `json:"HTTP Anomaly,required"`
+ JSON attackLayer7SummaryManagedRulesResponseSummary0JSON `json:"-"`
+}
+
+// attackLayer7SummaryManagedRulesResponseSummary0JSON contains the JSON metadata
+// for the struct [AttackLayer7SummaryManagedRulesResponseSummary0]
+type attackLayer7SummaryManagedRulesResponseSummary0JSON struct {
+ Bot apijson.Field
+ HTTPAnomaly apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7SummaryManagedRulesResponseSummary0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7SummaryManagedRulesResponseSummary0JSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7SummaryMitigationProductResponse struct {
+ Meta AttackLayer7SummaryMitigationProductResponseMeta `json:"meta,required"`
+ Summary0 AttackLayer7SummaryMitigationProductResponseSummary0 `json:"summary_0,required"`
+ JSON attackLayer7SummaryMitigationProductResponseJSON `json:"-"`
+}
+
+// attackLayer7SummaryMitigationProductResponseJSON contains the JSON metadata for
+// the struct [AttackLayer7SummaryMitigationProductResponse]
+type attackLayer7SummaryMitigationProductResponseJSON struct {
+ Meta apijson.Field
+ Summary0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7SummaryMitigationProductResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7SummaryMitigationProductResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7SummaryMitigationProductResponseMeta struct {
+ DateRange []AttackLayer7SummaryMitigationProductResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ Normalization string `json:"normalization,required"`
+ ConfidenceInfo AttackLayer7SummaryMitigationProductResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON attackLayer7SummaryMitigationProductResponseMetaJSON `json:"-"`
+}
+
+// attackLayer7SummaryMitigationProductResponseMetaJSON contains the JSON metadata
+// for the struct [AttackLayer7SummaryMitigationProductResponseMeta]
+type attackLayer7SummaryMitigationProductResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ Normalization apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7SummaryMitigationProductResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7SummaryMitigationProductResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7SummaryMitigationProductResponseMetaDateRange 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 attackLayer7SummaryMitigationProductResponseMetaDateRangeJSON `json:"-"`
+}
+
+// attackLayer7SummaryMitigationProductResponseMetaDateRangeJSON contains the JSON
+// metadata for the struct
+// [AttackLayer7SummaryMitigationProductResponseMetaDateRange]
+type attackLayer7SummaryMitigationProductResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7SummaryMitigationProductResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7SummaryMitigationProductResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7SummaryMitigationProductResponseMetaConfidenceInfo struct {
+ Annotations []AttackLayer7SummaryMitigationProductResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON attackLayer7SummaryMitigationProductResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// attackLayer7SummaryMitigationProductResponseMetaConfidenceInfoJSON contains the
+// JSON metadata for the struct
+// [AttackLayer7SummaryMitigationProductResponseMetaConfidenceInfo]
+type attackLayer7SummaryMitigationProductResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7SummaryMitigationProductResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7SummaryMitigationProductResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7SummaryMitigationProductResponseMetaConfidenceInfoAnnotation 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 attackLayer7SummaryMitigationProductResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// attackLayer7SummaryMitigationProductResponseMetaConfidenceInfoAnnotationJSON
+// contains the JSON metadata for the struct
+// [AttackLayer7SummaryMitigationProductResponseMetaConfidenceInfoAnnotation]
+type attackLayer7SummaryMitigationProductResponseMetaConfidenceInfoAnnotationJSON 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 *AttackLayer7SummaryMitigationProductResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7SummaryMitigationProductResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7SummaryMitigationProductResponseSummary0 struct {
+ DDOS string `json:"DDOS,required"`
+ WAF string `json:"WAF,required"`
+ JSON attackLayer7SummaryMitigationProductResponseSummary0JSON `json:"-"`
+}
+
+// attackLayer7SummaryMitigationProductResponseSummary0JSON contains the JSON
+// metadata for the struct [AttackLayer7SummaryMitigationProductResponseSummary0]
+type attackLayer7SummaryMitigationProductResponseSummary0JSON struct {
+ DDOS apijson.Field
+ WAF apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7SummaryMitigationProductResponseSummary0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7SummaryMitigationProductResponseSummary0JSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7SummaryGetParams 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"`
+ // 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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]AttackLayer7SummaryGetParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Format results are returned in.
+ Format param.Field[AttackLayer7SummaryGetParamsFormat] `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"`
+}
+
+// URLQuery serializes [AttackLayer7SummaryGetParams]'s query parameters as
+// `url.Values`.
+func (r AttackLayer7SummaryGetParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type AttackLayer7SummaryGetParamsDateRange string
+
+const (
+ AttackLayer7SummaryGetParamsDateRange1d AttackLayer7SummaryGetParamsDateRange = "1d"
+ AttackLayer7SummaryGetParamsDateRange2d AttackLayer7SummaryGetParamsDateRange = "2d"
+ AttackLayer7SummaryGetParamsDateRange7d AttackLayer7SummaryGetParamsDateRange = "7d"
+ AttackLayer7SummaryGetParamsDateRange14d AttackLayer7SummaryGetParamsDateRange = "14d"
+ AttackLayer7SummaryGetParamsDateRange28d AttackLayer7SummaryGetParamsDateRange = "28d"
+ AttackLayer7SummaryGetParamsDateRange12w AttackLayer7SummaryGetParamsDateRange = "12w"
+ AttackLayer7SummaryGetParamsDateRange24w AttackLayer7SummaryGetParamsDateRange = "24w"
+ AttackLayer7SummaryGetParamsDateRange52w AttackLayer7SummaryGetParamsDateRange = "52w"
+ AttackLayer7SummaryGetParamsDateRange1dControl AttackLayer7SummaryGetParamsDateRange = "1dControl"
+ AttackLayer7SummaryGetParamsDateRange2dControl AttackLayer7SummaryGetParamsDateRange = "2dControl"
+ AttackLayer7SummaryGetParamsDateRange7dControl AttackLayer7SummaryGetParamsDateRange = "7dControl"
+ AttackLayer7SummaryGetParamsDateRange14dControl AttackLayer7SummaryGetParamsDateRange = "14dControl"
+ AttackLayer7SummaryGetParamsDateRange28dControl AttackLayer7SummaryGetParamsDateRange = "28dControl"
+ AttackLayer7SummaryGetParamsDateRange12wControl AttackLayer7SummaryGetParamsDateRange = "12wControl"
+ AttackLayer7SummaryGetParamsDateRange24wControl AttackLayer7SummaryGetParamsDateRange = "24wControl"
+)
+
+// Format results are returned in.
+type AttackLayer7SummaryGetParamsFormat string
+
+const (
+ AttackLayer7SummaryGetParamsFormatJson AttackLayer7SummaryGetParamsFormat = "JSON"
+ AttackLayer7SummaryGetParamsFormatCsv AttackLayer7SummaryGetParamsFormat = "CSV"
+)
+
+type AttackLayer7SummaryGetResponseEnvelope struct {
+ Result AttackLayer7SummaryGetResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON attackLayer7SummaryGetResponseEnvelopeJSON `json:"-"`
+}
+
+// attackLayer7SummaryGetResponseEnvelopeJSON contains the JSON metadata for the
+// struct [AttackLayer7SummaryGetResponseEnvelope]
+type attackLayer7SummaryGetResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7SummaryGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7SummaryGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7SummaryHTTPMethodParams 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"`
+ // 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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]AttackLayer7SummaryHTTPMethodParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Format results are returned in.
+ Format param.Field[AttackLayer7SummaryHTTPMethodParamsFormat] `query:"format"`
+ // Filter for http version.
+ HTTPVersion param.Field[[]AttackLayer7SummaryHTTPMethodParamsHTTPVersion] `query:"httpVersion"`
+ // Filter for ip version.
+ IPVersion param.Field[[]AttackLayer7SummaryHTTPMethodParamsIPVersion] `query:"ipVersion"`
+ // 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 L7 mitigation products.
+ MitigationProduct param.Field[[]AttackLayer7SummaryHTTPMethodParamsMitigationProduct] `query:"mitigationProduct"`
+ // Array of names that will be used to name the series in responses.
+ Name param.Field[[]string] `query:"name"`
+}
+
+// URLQuery serializes [AttackLayer7SummaryHTTPMethodParams]'s query parameters as
+// `url.Values`.
+func (r AttackLayer7SummaryHTTPMethodParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type AttackLayer7SummaryHTTPMethodParamsDateRange string
+
+const (
+ AttackLayer7SummaryHTTPMethodParamsDateRange1d AttackLayer7SummaryHTTPMethodParamsDateRange = "1d"
+ AttackLayer7SummaryHTTPMethodParamsDateRange2d AttackLayer7SummaryHTTPMethodParamsDateRange = "2d"
+ AttackLayer7SummaryHTTPMethodParamsDateRange7d AttackLayer7SummaryHTTPMethodParamsDateRange = "7d"
+ AttackLayer7SummaryHTTPMethodParamsDateRange14d AttackLayer7SummaryHTTPMethodParamsDateRange = "14d"
+ AttackLayer7SummaryHTTPMethodParamsDateRange28d AttackLayer7SummaryHTTPMethodParamsDateRange = "28d"
+ AttackLayer7SummaryHTTPMethodParamsDateRange12w AttackLayer7SummaryHTTPMethodParamsDateRange = "12w"
+ AttackLayer7SummaryHTTPMethodParamsDateRange24w AttackLayer7SummaryHTTPMethodParamsDateRange = "24w"
+ AttackLayer7SummaryHTTPMethodParamsDateRange52w AttackLayer7SummaryHTTPMethodParamsDateRange = "52w"
+ AttackLayer7SummaryHTTPMethodParamsDateRange1dControl AttackLayer7SummaryHTTPMethodParamsDateRange = "1dControl"
+ AttackLayer7SummaryHTTPMethodParamsDateRange2dControl AttackLayer7SummaryHTTPMethodParamsDateRange = "2dControl"
+ AttackLayer7SummaryHTTPMethodParamsDateRange7dControl AttackLayer7SummaryHTTPMethodParamsDateRange = "7dControl"
+ AttackLayer7SummaryHTTPMethodParamsDateRange14dControl AttackLayer7SummaryHTTPMethodParamsDateRange = "14dControl"
+ AttackLayer7SummaryHTTPMethodParamsDateRange28dControl AttackLayer7SummaryHTTPMethodParamsDateRange = "28dControl"
+ AttackLayer7SummaryHTTPMethodParamsDateRange12wControl AttackLayer7SummaryHTTPMethodParamsDateRange = "12wControl"
+ AttackLayer7SummaryHTTPMethodParamsDateRange24wControl AttackLayer7SummaryHTTPMethodParamsDateRange = "24wControl"
+)
+
+// Format results are returned in.
+type AttackLayer7SummaryHTTPMethodParamsFormat string
+
+const (
+ AttackLayer7SummaryHTTPMethodParamsFormatJson AttackLayer7SummaryHTTPMethodParamsFormat = "JSON"
+ AttackLayer7SummaryHTTPMethodParamsFormatCsv AttackLayer7SummaryHTTPMethodParamsFormat = "CSV"
+)
+
+type AttackLayer7SummaryHTTPMethodParamsHTTPVersion string
+
+const (
+ AttackLayer7SummaryHTTPMethodParamsHTTPVersionHttPv1 AttackLayer7SummaryHTTPMethodParamsHTTPVersion = "HTTPv1"
+ AttackLayer7SummaryHTTPMethodParamsHTTPVersionHttPv2 AttackLayer7SummaryHTTPMethodParamsHTTPVersion = "HTTPv2"
+ AttackLayer7SummaryHTTPMethodParamsHTTPVersionHttPv3 AttackLayer7SummaryHTTPMethodParamsHTTPVersion = "HTTPv3"
+)
+
+type AttackLayer7SummaryHTTPMethodParamsIPVersion string
+
+const (
+ AttackLayer7SummaryHTTPMethodParamsIPVersionIPv4 AttackLayer7SummaryHTTPMethodParamsIPVersion = "IPv4"
+ AttackLayer7SummaryHTTPMethodParamsIPVersionIPv6 AttackLayer7SummaryHTTPMethodParamsIPVersion = "IPv6"
+)
+
+type AttackLayer7SummaryHTTPMethodParamsMitigationProduct string
+
+const (
+ AttackLayer7SummaryHTTPMethodParamsMitigationProductDDOS AttackLayer7SummaryHTTPMethodParamsMitigationProduct = "DDOS"
+ AttackLayer7SummaryHTTPMethodParamsMitigationProductWAF AttackLayer7SummaryHTTPMethodParamsMitigationProduct = "WAF"
+ AttackLayer7SummaryHTTPMethodParamsMitigationProductBotManagement AttackLayer7SummaryHTTPMethodParamsMitigationProduct = "BOT_MANAGEMENT"
+ AttackLayer7SummaryHTTPMethodParamsMitigationProductAccessRules AttackLayer7SummaryHTTPMethodParamsMitigationProduct = "ACCESS_RULES"
+ AttackLayer7SummaryHTTPMethodParamsMitigationProductIPReputation AttackLayer7SummaryHTTPMethodParamsMitigationProduct = "IP_REPUTATION"
+ AttackLayer7SummaryHTTPMethodParamsMitigationProductAPIShield AttackLayer7SummaryHTTPMethodParamsMitigationProduct = "API_SHIELD"
+ AttackLayer7SummaryHTTPMethodParamsMitigationProductDataLossPrevention AttackLayer7SummaryHTTPMethodParamsMitigationProduct = "DATA_LOSS_PREVENTION"
+)
+
+type AttackLayer7SummaryHTTPMethodResponseEnvelope struct {
+ Result AttackLayer7SummaryHTTPMethodResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON attackLayer7SummaryHTTPMethodResponseEnvelopeJSON `json:"-"`
+}
+
+// attackLayer7SummaryHTTPMethodResponseEnvelopeJSON contains the JSON metadata for
+// the struct [AttackLayer7SummaryHTTPMethodResponseEnvelope]
+type attackLayer7SummaryHTTPMethodResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7SummaryHTTPMethodResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7SummaryHTTPMethodResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7SummaryHTTPVersionParams 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"`
+ // 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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]AttackLayer7SummaryHTTPVersionParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Format results are returned in.
+ Format param.Field[AttackLayer7SummaryHTTPVersionParamsFormat] `query:"format"`
+ // Filter for http method.
+ HTTPMethod param.Field[[]AttackLayer7SummaryHTTPVersionParamsHTTPMethod] `query:"httpMethod"`
+ // Filter for ip version.
+ IPVersion param.Field[[]AttackLayer7SummaryHTTPVersionParamsIPVersion] `query:"ipVersion"`
+ // 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 L7 mitigation products.
+ MitigationProduct param.Field[[]AttackLayer7SummaryHTTPVersionParamsMitigationProduct] `query:"mitigationProduct"`
+ // Array of names that will be used to name the series in responses.
+ Name param.Field[[]string] `query:"name"`
+}
+
+// URLQuery serializes [AttackLayer7SummaryHTTPVersionParams]'s query parameters as
+// `url.Values`.
+func (r AttackLayer7SummaryHTTPVersionParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type AttackLayer7SummaryHTTPVersionParamsDateRange string
+
+const (
+ AttackLayer7SummaryHTTPVersionParamsDateRange1d AttackLayer7SummaryHTTPVersionParamsDateRange = "1d"
+ AttackLayer7SummaryHTTPVersionParamsDateRange2d AttackLayer7SummaryHTTPVersionParamsDateRange = "2d"
+ AttackLayer7SummaryHTTPVersionParamsDateRange7d AttackLayer7SummaryHTTPVersionParamsDateRange = "7d"
+ AttackLayer7SummaryHTTPVersionParamsDateRange14d AttackLayer7SummaryHTTPVersionParamsDateRange = "14d"
+ AttackLayer7SummaryHTTPVersionParamsDateRange28d AttackLayer7SummaryHTTPVersionParamsDateRange = "28d"
+ AttackLayer7SummaryHTTPVersionParamsDateRange12w AttackLayer7SummaryHTTPVersionParamsDateRange = "12w"
+ AttackLayer7SummaryHTTPVersionParamsDateRange24w AttackLayer7SummaryHTTPVersionParamsDateRange = "24w"
+ AttackLayer7SummaryHTTPVersionParamsDateRange52w AttackLayer7SummaryHTTPVersionParamsDateRange = "52w"
+ AttackLayer7SummaryHTTPVersionParamsDateRange1dControl AttackLayer7SummaryHTTPVersionParamsDateRange = "1dControl"
+ AttackLayer7SummaryHTTPVersionParamsDateRange2dControl AttackLayer7SummaryHTTPVersionParamsDateRange = "2dControl"
+ AttackLayer7SummaryHTTPVersionParamsDateRange7dControl AttackLayer7SummaryHTTPVersionParamsDateRange = "7dControl"
+ AttackLayer7SummaryHTTPVersionParamsDateRange14dControl AttackLayer7SummaryHTTPVersionParamsDateRange = "14dControl"
+ AttackLayer7SummaryHTTPVersionParamsDateRange28dControl AttackLayer7SummaryHTTPVersionParamsDateRange = "28dControl"
+ AttackLayer7SummaryHTTPVersionParamsDateRange12wControl AttackLayer7SummaryHTTPVersionParamsDateRange = "12wControl"
+ AttackLayer7SummaryHTTPVersionParamsDateRange24wControl AttackLayer7SummaryHTTPVersionParamsDateRange = "24wControl"
+)
+
+// Format results are returned in.
+type AttackLayer7SummaryHTTPVersionParamsFormat string
+
+const (
+ AttackLayer7SummaryHTTPVersionParamsFormatJson AttackLayer7SummaryHTTPVersionParamsFormat = "JSON"
+ AttackLayer7SummaryHTTPVersionParamsFormatCsv AttackLayer7SummaryHTTPVersionParamsFormat = "CSV"
+)
+
+type AttackLayer7SummaryHTTPVersionParamsHTTPMethod string
+
+const (
+ AttackLayer7SummaryHTTPVersionParamsHTTPMethodGet AttackLayer7SummaryHTTPVersionParamsHTTPMethod = "GET"
+ AttackLayer7SummaryHTTPVersionParamsHTTPMethodPost AttackLayer7SummaryHTTPVersionParamsHTTPMethod = "POST"
+ AttackLayer7SummaryHTTPVersionParamsHTTPMethodDelete AttackLayer7SummaryHTTPVersionParamsHTTPMethod = "DELETE"
+ AttackLayer7SummaryHTTPVersionParamsHTTPMethodPut AttackLayer7SummaryHTTPVersionParamsHTTPMethod = "PUT"
+ AttackLayer7SummaryHTTPVersionParamsHTTPMethodHead AttackLayer7SummaryHTTPVersionParamsHTTPMethod = "HEAD"
+ AttackLayer7SummaryHTTPVersionParamsHTTPMethodPurge AttackLayer7SummaryHTTPVersionParamsHTTPMethod = "PURGE"
+ AttackLayer7SummaryHTTPVersionParamsHTTPMethodOptions AttackLayer7SummaryHTTPVersionParamsHTTPMethod = "OPTIONS"
+ AttackLayer7SummaryHTTPVersionParamsHTTPMethodPropfind AttackLayer7SummaryHTTPVersionParamsHTTPMethod = "PROPFIND"
+ AttackLayer7SummaryHTTPVersionParamsHTTPMethodMkcol AttackLayer7SummaryHTTPVersionParamsHTTPMethod = "MKCOL"
+ AttackLayer7SummaryHTTPVersionParamsHTTPMethodPatch AttackLayer7SummaryHTTPVersionParamsHTTPMethod = "PATCH"
+ AttackLayer7SummaryHTTPVersionParamsHTTPMethodACL AttackLayer7SummaryHTTPVersionParamsHTTPMethod = "ACL"
+ AttackLayer7SummaryHTTPVersionParamsHTTPMethodBcopy AttackLayer7SummaryHTTPVersionParamsHTTPMethod = "BCOPY"
+ AttackLayer7SummaryHTTPVersionParamsHTTPMethodBdelete AttackLayer7SummaryHTTPVersionParamsHTTPMethod = "BDELETE"
+ AttackLayer7SummaryHTTPVersionParamsHTTPMethodBmove AttackLayer7SummaryHTTPVersionParamsHTTPMethod = "BMOVE"
+ AttackLayer7SummaryHTTPVersionParamsHTTPMethodBpropfind AttackLayer7SummaryHTTPVersionParamsHTTPMethod = "BPROPFIND"
+ AttackLayer7SummaryHTTPVersionParamsHTTPMethodBproppatch AttackLayer7SummaryHTTPVersionParamsHTTPMethod = "BPROPPATCH"
+ AttackLayer7SummaryHTTPVersionParamsHTTPMethodCheckin AttackLayer7SummaryHTTPVersionParamsHTTPMethod = "CHECKIN"
+ AttackLayer7SummaryHTTPVersionParamsHTTPMethodCheckout AttackLayer7SummaryHTTPVersionParamsHTTPMethod = "CHECKOUT"
+ AttackLayer7SummaryHTTPVersionParamsHTTPMethodConnect AttackLayer7SummaryHTTPVersionParamsHTTPMethod = "CONNECT"
+ AttackLayer7SummaryHTTPVersionParamsHTTPMethodCopy AttackLayer7SummaryHTTPVersionParamsHTTPMethod = "COPY"
+ AttackLayer7SummaryHTTPVersionParamsHTTPMethodLabel AttackLayer7SummaryHTTPVersionParamsHTTPMethod = "LABEL"
+ AttackLayer7SummaryHTTPVersionParamsHTTPMethodLock AttackLayer7SummaryHTTPVersionParamsHTTPMethod = "LOCK"
+ AttackLayer7SummaryHTTPVersionParamsHTTPMethodMerge AttackLayer7SummaryHTTPVersionParamsHTTPMethod = "MERGE"
+ AttackLayer7SummaryHTTPVersionParamsHTTPMethodMkactivity AttackLayer7SummaryHTTPVersionParamsHTTPMethod = "MKACTIVITY"
+ AttackLayer7SummaryHTTPVersionParamsHTTPMethodMkworkspace AttackLayer7SummaryHTTPVersionParamsHTTPMethod = "MKWORKSPACE"
+ AttackLayer7SummaryHTTPVersionParamsHTTPMethodMove AttackLayer7SummaryHTTPVersionParamsHTTPMethod = "MOVE"
+ AttackLayer7SummaryHTTPVersionParamsHTTPMethodNotify AttackLayer7SummaryHTTPVersionParamsHTTPMethod = "NOTIFY"
+ AttackLayer7SummaryHTTPVersionParamsHTTPMethodOrderpatch AttackLayer7SummaryHTTPVersionParamsHTTPMethod = "ORDERPATCH"
+ AttackLayer7SummaryHTTPVersionParamsHTTPMethodPoll AttackLayer7SummaryHTTPVersionParamsHTTPMethod = "POLL"
+ AttackLayer7SummaryHTTPVersionParamsHTTPMethodProppatch AttackLayer7SummaryHTTPVersionParamsHTTPMethod = "PROPPATCH"
+ AttackLayer7SummaryHTTPVersionParamsHTTPMethodReport AttackLayer7SummaryHTTPVersionParamsHTTPMethod = "REPORT"
+ AttackLayer7SummaryHTTPVersionParamsHTTPMethodSearch AttackLayer7SummaryHTTPVersionParamsHTTPMethod = "SEARCH"
+ AttackLayer7SummaryHTTPVersionParamsHTTPMethodSubscribe AttackLayer7SummaryHTTPVersionParamsHTTPMethod = "SUBSCRIBE"
+ AttackLayer7SummaryHTTPVersionParamsHTTPMethodTrace AttackLayer7SummaryHTTPVersionParamsHTTPMethod = "TRACE"
+ AttackLayer7SummaryHTTPVersionParamsHTTPMethodUncheckout AttackLayer7SummaryHTTPVersionParamsHTTPMethod = "UNCHECKOUT"
+ AttackLayer7SummaryHTTPVersionParamsHTTPMethodUnlock AttackLayer7SummaryHTTPVersionParamsHTTPMethod = "UNLOCK"
+ AttackLayer7SummaryHTTPVersionParamsHTTPMethodUnsubscribe AttackLayer7SummaryHTTPVersionParamsHTTPMethod = "UNSUBSCRIBE"
+ AttackLayer7SummaryHTTPVersionParamsHTTPMethodUpdate AttackLayer7SummaryHTTPVersionParamsHTTPMethod = "UPDATE"
+ AttackLayer7SummaryHTTPVersionParamsHTTPMethodVersioncontrol AttackLayer7SummaryHTTPVersionParamsHTTPMethod = "VERSIONCONTROL"
+ AttackLayer7SummaryHTTPVersionParamsHTTPMethodBaselinecontrol AttackLayer7SummaryHTTPVersionParamsHTTPMethod = "BASELINECONTROL"
+ AttackLayer7SummaryHTTPVersionParamsHTTPMethodXmsenumatts AttackLayer7SummaryHTTPVersionParamsHTTPMethod = "XMSENUMATTS"
+ AttackLayer7SummaryHTTPVersionParamsHTTPMethodRpcOutData AttackLayer7SummaryHTTPVersionParamsHTTPMethod = "RPC_OUT_DATA"
+ AttackLayer7SummaryHTTPVersionParamsHTTPMethodRpcInData AttackLayer7SummaryHTTPVersionParamsHTTPMethod = "RPC_IN_DATA"
+ AttackLayer7SummaryHTTPVersionParamsHTTPMethodJson AttackLayer7SummaryHTTPVersionParamsHTTPMethod = "JSON"
+ AttackLayer7SummaryHTTPVersionParamsHTTPMethodCook AttackLayer7SummaryHTTPVersionParamsHTTPMethod = "COOK"
+ AttackLayer7SummaryHTTPVersionParamsHTTPMethodTrack AttackLayer7SummaryHTTPVersionParamsHTTPMethod = "TRACK"
+)
+
+type AttackLayer7SummaryHTTPVersionParamsIPVersion string
+
+const (
+ AttackLayer7SummaryHTTPVersionParamsIPVersionIPv4 AttackLayer7SummaryHTTPVersionParamsIPVersion = "IPv4"
+ AttackLayer7SummaryHTTPVersionParamsIPVersionIPv6 AttackLayer7SummaryHTTPVersionParamsIPVersion = "IPv6"
+)
+
+type AttackLayer7SummaryHTTPVersionParamsMitigationProduct string
+
+const (
+ AttackLayer7SummaryHTTPVersionParamsMitigationProductDDOS AttackLayer7SummaryHTTPVersionParamsMitigationProduct = "DDOS"
+ AttackLayer7SummaryHTTPVersionParamsMitigationProductWAF AttackLayer7SummaryHTTPVersionParamsMitigationProduct = "WAF"
+ AttackLayer7SummaryHTTPVersionParamsMitigationProductBotManagement AttackLayer7SummaryHTTPVersionParamsMitigationProduct = "BOT_MANAGEMENT"
+ AttackLayer7SummaryHTTPVersionParamsMitigationProductAccessRules AttackLayer7SummaryHTTPVersionParamsMitigationProduct = "ACCESS_RULES"
+ AttackLayer7SummaryHTTPVersionParamsMitigationProductIPReputation AttackLayer7SummaryHTTPVersionParamsMitigationProduct = "IP_REPUTATION"
+ AttackLayer7SummaryHTTPVersionParamsMitigationProductAPIShield AttackLayer7SummaryHTTPVersionParamsMitigationProduct = "API_SHIELD"
+ AttackLayer7SummaryHTTPVersionParamsMitigationProductDataLossPrevention AttackLayer7SummaryHTTPVersionParamsMitigationProduct = "DATA_LOSS_PREVENTION"
+)
+
+type AttackLayer7SummaryHTTPVersionResponseEnvelope struct {
+ Result AttackLayer7SummaryHTTPVersionResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON attackLayer7SummaryHTTPVersionResponseEnvelopeJSON `json:"-"`
+}
+
+// attackLayer7SummaryHTTPVersionResponseEnvelopeJSON contains the JSON metadata
+// for the struct [AttackLayer7SummaryHTTPVersionResponseEnvelope]
+type attackLayer7SummaryHTTPVersionResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7SummaryHTTPVersionResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7SummaryHTTPVersionResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7SummaryIPVersionParams 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"`
+ // 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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]AttackLayer7SummaryIPVersionParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Format results are returned in.
+ Format param.Field[AttackLayer7SummaryIPVersionParamsFormat] `query:"format"`
+ // Filter for http method.
+ HTTPMethod param.Field[[]AttackLayer7SummaryIPVersionParamsHTTPMethod] `query:"httpMethod"`
+ // Filter for http version.
+ HTTPVersion param.Field[[]AttackLayer7SummaryIPVersionParamsHTTPVersion] `query:"httpVersion"`
+ // 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 L7 mitigation products.
+ MitigationProduct param.Field[[]AttackLayer7SummaryIPVersionParamsMitigationProduct] `query:"mitigationProduct"`
+ // Array of names that will be used to name the series in responses.
+ Name param.Field[[]string] `query:"name"`
+}
+
+// URLQuery serializes [AttackLayer7SummaryIPVersionParams]'s query parameters as
+// `url.Values`.
+func (r AttackLayer7SummaryIPVersionParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type AttackLayer7SummaryIPVersionParamsDateRange string
+
+const (
+ AttackLayer7SummaryIPVersionParamsDateRange1d AttackLayer7SummaryIPVersionParamsDateRange = "1d"
+ AttackLayer7SummaryIPVersionParamsDateRange2d AttackLayer7SummaryIPVersionParamsDateRange = "2d"
+ AttackLayer7SummaryIPVersionParamsDateRange7d AttackLayer7SummaryIPVersionParamsDateRange = "7d"
+ AttackLayer7SummaryIPVersionParamsDateRange14d AttackLayer7SummaryIPVersionParamsDateRange = "14d"
+ AttackLayer7SummaryIPVersionParamsDateRange28d AttackLayer7SummaryIPVersionParamsDateRange = "28d"
+ AttackLayer7SummaryIPVersionParamsDateRange12w AttackLayer7SummaryIPVersionParamsDateRange = "12w"
+ AttackLayer7SummaryIPVersionParamsDateRange24w AttackLayer7SummaryIPVersionParamsDateRange = "24w"
+ AttackLayer7SummaryIPVersionParamsDateRange52w AttackLayer7SummaryIPVersionParamsDateRange = "52w"
+ AttackLayer7SummaryIPVersionParamsDateRange1dControl AttackLayer7SummaryIPVersionParamsDateRange = "1dControl"
+ AttackLayer7SummaryIPVersionParamsDateRange2dControl AttackLayer7SummaryIPVersionParamsDateRange = "2dControl"
+ AttackLayer7SummaryIPVersionParamsDateRange7dControl AttackLayer7SummaryIPVersionParamsDateRange = "7dControl"
+ AttackLayer7SummaryIPVersionParamsDateRange14dControl AttackLayer7SummaryIPVersionParamsDateRange = "14dControl"
+ AttackLayer7SummaryIPVersionParamsDateRange28dControl AttackLayer7SummaryIPVersionParamsDateRange = "28dControl"
+ AttackLayer7SummaryIPVersionParamsDateRange12wControl AttackLayer7SummaryIPVersionParamsDateRange = "12wControl"
+ AttackLayer7SummaryIPVersionParamsDateRange24wControl AttackLayer7SummaryIPVersionParamsDateRange = "24wControl"
+)
+
+// Format results are returned in.
+type AttackLayer7SummaryIPVersionParamsFormat string
+
+const (
+ AttackLayer7SummaryIPVersionParamsFormatJson AttackLayer7SummaryIPVersionParamsFormat = "JSON"
+ AttackLayer7SummaryIPVersionParamsFormatCsv AttackLayer7SummaryIPVersionParamsFormat = "CSV"
+)
+
+type AttackLayer7SummaryIPVersionParamsHTTPMethod string
+
+const (
+ AttackLayer7SummaryIPVersionParamsHTTPMethodGet AttackLayer7SummaryIPVersionParamsHTTPMethod = "GET"
+ AttackLayer7SummaryIPVersionParamsHTTPMethodPost AttackLayer7SummaryIPVersionParamsHTTPMethod = "POST"
+ AttackLayer7SummaryIPVersionParamsHTTPMethodDelete AttackLayer7SummaryIPVersionParamsHTTPMethod = "DELETE"
+ AttackLayer7SummaryIPVersionParamsHTTPMethodPut AttackLayer7SummaryIPVersionParamsHTTPMethod = "PUT"
+ AttackLayer7SummaryIPVersionParamsHTTPMethodHead AttackLayer7SummaryIPVersionParamsHTTPMethod = "HEAD"
+ AttackLayer7SummaryIPVersionParamsHTTPMethodPurge AttackLayer7SummaryIPVersionParamsHTTPMethod = "PURGE"
+ AttackLayer7SummaryIPVersionParamsHTTPMethodOptions AttackLayer7SummaryIPVersionParamsHTTPMethod = "OPTIONS"
+ AttackLayer7SummaryIPVersionParamsHTTPMethodPropfind AttackLayer7SummaryIPVersionParamsHTTPMethod = "PROPFIND"
+ AttackLayer7SummaryIPVersionParamsHTTPMethodMkcol AttackLayer7SummaryIPVersionParamsHTTPMethod = "MKCOL"
+ AttackLayer7SummaryIPVersionParamsHTTPMethodPatch AttackLayer7SummaryIPVersionParamsHTTPMethod = "PATCH"
+ AttackLayer7SummaryIPVersionParamsHTTPMethodACL AttackLayer7SummaryIPVersionParamsHTTPMethod = "ACL"
+ AttackLayer7SummaryIPVersionParamsHTTPMethodBcopy AttackLayer7SummaryIPVersionParamsHTTPMethod = "BCOPY"
+ AttackLayer7SummaryIPVersionParamsHTTPMethodBdelete AttackLayer7SummaryIPVersionParamsHTTPMethod = "BDELETE"
+ AttackLayer7SummaryIPVersionParamsHTTPMethodBmove AttackLayer7SummaryIPVersionParamsHTTPMethod = "BMOVE"
+ AttackLayer7SummaryIPVersionParamsHTTPMethodBpropfind AttackLayer7SummaryIPVersionParamsHTTPMethod = "BPROPFIND"
+ AttackLayer7SummaryIPVersionParamsHTTPMethodBproppatch AttackLayer7SummaryIPVersionParamsHTTPMethod = "BPROPPATCH"
+ AttackLayer7SummaryIPVersionParamsHTTPMethodCheckin AttackLayer7SummaryIPVersionParamsHTTPMethod = "CHECKIN"
+ AttackLayer7SummaryIPVersionParamsHTTPMethodCheckout AttackLayer7SummaryIPVersionParamsHTTPMethod = "CHECKOUT"
+ AttackLayer7SummaryIPVersionParamsHTTPMethodConnect AttackLayer7SummaryIPVersionParamsHTTPMethod = "CONNECT"
+ AttackLayer7SummaryIPVersionParamsHTTPMethodCopy AttackLayer7SummaryIPVersionParamsHTTPMethod = "COPY"
+ AttackLayer7SummaryIPVersionParamsHTTPMethodLabel AttackLayer7SummaryIPVersionParamsHTTPMethod = "LABEL"
+ AttackLayer7SummaryIPVersionParamsHTTPMethodLock AttackLayer7SummaryIPVersionParamsHTTPMethod = "LOCK"
+ AttackLayer7SummaryIPVersionParamsHTTPMethodMerge AttackLayer7SummaryIPVersionParamsHTTPMethod = "MERGE"
+ AttackLayer7SummaryIPVersionParamsHTTPMethodMkactivity AttackLayer7SummaryIPVersionParamsHTTPMethod = "MKACTIVITY"
+ AttackLayer7SummaryIPVersionParamsHTTPMethodMkworkspace AttackLayer7SummaryIPVersionParamsHTTPMethod = "MKWORKSPACE"
+ AttackLayer7SummaryIPVersionParamsHTTPMethodMove AttackLayer7SummaryIPVersionParamsHTTPMethod = "MOVE"
+ AttackLayer7SummaryIPVersionParamsHTTPMethodNotify AttackLayer7SummaryIPVersionParamsHTTPMethod = "NOTIFY"
+ AttackLayer7SummaryIPVersionParamsHTTPMethodOrderpatch AttackLayer7SummaryIPVersionParamsHTTPMethod = "ORDERPATCH"
+ AttackLayer7SummaryIPVersionParamsHTTPMethodPoll AttackLayer7SummaryIPVersionParamsHTTPMethod = "POLL"
+ AttackLayer7SummaryIPVersionParamsHTTPMethodProppatch AttackLayer7SummaryIPVersionParamsHTTPMethod = "PROPPATCH"
+ AttackLayer7SummaryIPVersionParamsHTTPMethodReport AttackLayer7SummaryIPVersionParamsHTTPMethod = "REPORT"
+ AttackLayer7SummaryIPVersionParamsHTTPMethodSearch AttackLayer7SummaryIPVersionParamsHTTPMethod = "SEARCH"
+ AttackLayer7SummaryIPVersionParamsHTTPMethodSubscribe AttackLayer7SummaryIPVersionParamsHTTPMethod = "SUBSCRIBE"
+ AttackLayer7SummaryIPVersionParamsHTTPMethodTrace AttackLayer7SummaryIPVersionParamsHTTPMethod = "TRACE"
+ AttackLayer7SummaryIPVersionParamsHTTPMethodUncheckout AttackLayer7SummaryIPVersionParamsHTTPMethod = "UNCHECKOUT"
+ AttackLayer7SummaryIPVersionParamsHTTPMethodUnlock AttackLayer7SummaryIPVersionParamsHTTPMethod = "UNLOCK"
+ AttackLayer7SummaryIPVersionParamsHTTPMethodUnsubscribe AttackLayer7SummaryIPVersionParamsHTTPMethod = "UNSUBSCRIBE"
+ AttackLayer7SummaryIPVersionParamsHTTPMethodUpdate AttackLayer7SummaryIPVersionParamsHTTPMethod = "UPDATE"
+ AttackLayer7SummaryIPVersionParamsHTTPMethodVersioncontrol AttackLayer7SummaryIPVersionParamsHTTPMethod = "VERSIONCONTROL"
+ AttackLayer7SummaryIPVersionParamsHTTPMethodBaselinecontrol AttackLayer7SummaryIPVersionParamsHTTPMethod = "BASELINECONTROL"
+ AttackLayer7SummaryIPVersionParamsHTTPMethodXmsenumatts AttackLayer7SummaryIPVersionParamsHTTPMethod = "XMSENUMATTS"
+ AttackLayer7SummaryIPVersionParamsHTTPMethodRpcOutData AttackLayer7SummaryIPVersionParamsHTTPMethod = "RPC_OUT_DATA"
+ AttackLayer7SummaryIPVersionParamsHTTPMethodRpcInData AttackLayer7SummaryIPVersionParamsHTTPMethod = "RPC_IN_DATA"
+ AttackLayer7SummaryIPVersionParamsHTTPMethodJson AttackLayer7SummaryIPVersionParamsHTTPMethod = "JSON"
+ AttackLayer7SummaryIPVersionParamsHTTPMethodCook AttackLayer7SummaryIPVersionParamsHTTPMethod = "COOK"
+ AttackLayer7SummaryIPVersionParamsHTTPMethodTrack AttackLayer7SummaryIPVersionParamsHTTPMethod = "TRACK"
+)
+
+type AttackLayer7SummaryIPVersionParamsHTTPVersion string
+
+const (
+ AttackLayer7SummaryIPVersionParamsHTTPVersionHttPv1 AttackLayer7SummaryIPVersionParamsHTTPVersion = "HTTPv1"
+ AttackLayer7SummaryIPVersionParamsHTTPVersionHttPv2 AttackLayer7SummaryIPVersionParamsHTTPVersion = "HTTPv2"
+ AttackLayer7SummaryIPVersionParamsHTTPVersionHttPv3 AttackLayer7SummaryIPVersionParamsHTTPVersion = "HTTPv3"
+)
+
+type AttackLayer7SummaryIPVersionParamsMitigationProduct string
+
+const (
+ AttackLayer7SummaryIPVersionParamsMitigationProductDDOS AttackLayer7SummaryIPVersionParamsMitigationProduct = "DDOS"
+ AttackLayer7SummaryIPVersionParamsMitigationProductWAF AttackLayer7SummaryIPVersionParamsMitigationProduct = "WAF"
+ AttackLayer7SummaryIPVersionParamsMitigationProductBotManagement AttackLayer7SummaryIPVersionParamsMitigationProduct = "BOT_MANAGEMENT"
+ AttackLayer7SummaryIPVersionParamsMitigationProductAccessRules AttackLayer7SummaryIPVersionParamsMitigationProduct = "ACCESS_RULES"
+ AttackLayer7SummaryIPVersionParamsMitigationProductIPReputation AttackLayer7SummaryIPVersionParamsMitigationProduct = "IP_REPUTATION"
+ AttackLayer7SummaryIPVersionParamsMitigationProductAPIShield AttackLayer7SummaryIPVersionParamsMitigationProduct = "API_SHIELD"
+ AttackLayer7SummaryIPVersionParamsMitigationProductDataLossPrevention AttackLayer7SummaryIPVersionParamsMitigationProduct = "DATA_LOSS_PREVENTION"
+)
+
+type AttackLayer7SummaryIPVersionResponseEnvelope struct {
+ Result AttackLayer7SummaryIPVersionResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON attackLayer7SummaryIPVersionResponseEnvelopeJSON `json:"-"`
+}
+
+// attackLayer7SummaryIPVersionResponseEnvelopeJSON contains the JSON metadata for
+// the struct [AttackLayer7SummaryIPVersionResponseEnvelope]
+type attackLayer7SummaryIPVersionResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7SummaryIPVersionResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7SummaryIPVersionResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7SummaryManagedRulesParams 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"`
+ // 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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]AttackLayer7SummaryManagedRulesParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Format results are returned in.
+ Format param.Field[AttackLayer7SummaryManagedRulesParamsFormat] `query:"format"`
+ // Filter for http method.
+ HTTPMethod param.Field[[]AttackLayer7SummaryManagedRulesParamsHTTPMethod] `query:"httpMethod"`
+ // Filter for http version.
+ HTTPVersion param.Field[[]AttackLayer7SummaryManagedRulesParamsHTTPVersion] `query:"httpVersion"`
+ // Filter for ip version.
+ IPVersion param.Field[[]AttackLayer7SummaryManagedRulesParamsIPVersion] `query:"ipVersion"`
+ // 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 L7 mitigation products.
+ MitigationProduct param.Field[[]AttackLayer7SummaryManagedRulesParamsMitigationProduct] `query:"mitigationProduct"`
+ // Array of names that will be used to name the series in responses.
+ Name param.Field[[]string] `query:"name"`
+}
+
+// URLQuery serializes [AttackLayer7SummaryManagedRulesParams]'s query parameters
+// as `url.Values`.
+func (r AttackLayer7SummaryManagedRulesParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type AttackLayer7SummaryManagedRulesParamsDateRange string
+
+const (
+ AttackLayer7SummaryManagedRulesParamsDateRange1d AttackLayer7SummaryManagedRulesParamsDateRange = "1d"
+ AttackLayer7SummaryManagedRulesParamsDateRange2d AttackLayer7SummaryManagedRulesParamsDateRange = "2d"
+ AttackLayer7SummaryManagedRulesParamsDateRange7d AttackLayer7SummaryManagedRulesParamsDateRange = "7d"
+ AttackLayer7SummaryManagedRulesParamsDateRange14d AttackLayer7SummaryManagedRulesParamsDateRange = "14d"
+ AttackLayer7SummaryManagedRulesParamsDateRange28d AttackLayer7SummaryManagedRulesParamsDateRange = "28d"
+ AttackLayer7SummaryManagedRulesParamsDateRange12w AttackLayer7SummaryManagedRulesParamsDateRange = "12w"
+ AttackLayer7SummaryManagedRulesParamsDateRange24w AttackLayer7SummaryManagedRulesParamsDateRange = "24w"
+ AttackLayer7SummaryManagedRulesParamsDateRange52w AttackLayer7SummaryManagedRulesParamsDateRange = "52w"
+ AttackLayer7SummaryManagedRulesParamsDateRange1dControl AttackLayer7SummaryManagedRulesParamsDateRange = "1dControl"
+ AttackLayer7SummaryManagedRulesParamsDateRange2dControl AttackLayer7SummaryManagedRulesParamsDateRange = "2dControl"
+ AttackLayer7SummaryManagedRulesParamsDateRange7dControl AttackLayer7SummaryManagedRulesParamsDateRange = "7dControl"
+ AttackLayer7SummaryManagedRulesParamsDateRange14dControl AttackLayer7SummaryManagedRulesParamsDateRange = "14dControl"
+ AttackLayer7SummaryManagedRulesParamsDateRange28dControl AttackLayer7SummaryManagedRulesParamsDateRange = "28dControl"
+ AttackLayer7SummaryManagedRulesParamsDateRange12wControl AttackLayer7SummaryManagedRulesParamsDateRange = "12wControl"
+ AttackLayer7SummaryManagedRulesParamsDateRange24wControl AttackLayer7SummaryManagedRulesParamsDateRange = "24wControl"
+)
+
+// Format results are returned in.
+type AttackLayer7SummaryManagedRulesParamsFormat string
+
+const (
+ AttackLayer7SummaryManagedRulesParamsFormatJson AttackLayer7SummaryManagedRulesParamsFormat = "JSON"
+ AttackLayer7SummaryManagedRulesParamsFormatCsv AttackLayer7SummaryManagedRulesParamsFormat = "CSV"
+)
+
+type AttackLayer7SummaryManagedRulesParamsHTTPMethod string
+
+const (
+ AttackLayer7SummaryManagedRulesParamsHTTPMethodGet AttackLayer7SummaryManagedRulesParamsHTTPMethod = "GET"
+ AttackLayer7SummaryManagedRulesParamsHTTPMethodPost AttackLayer7SummaryManagedRulesParamsHTTPMethod = "POST"
+ AttackLayer7SummaryManagedRulesParamsHTTPMethodDelete AttackLayer7SummaryManagedRulesParamsHTTPMethod = "DELETE"
+ AttackLayer7SummaryManagedRulesParamsHTTPMethodPut AttackLayer7SummaryManagedRulesParamsHTTPMethod = "PUT"
+ AttackLayer7SummaryManagedRulesParamsHTTPMethodHead AttackLayer7SummaryManagedRulesParamsHTTPMethod = "HEAD"
+ AttackLayer7SummaryManagedRulesParamsHTTPMethodPurge AttackLayer7SummaryManagedRulesParamsHTTPMethod = "PURGE"
+ AttackLayer7SummaryManagedRulesParamsHTTPMethodOptions AttackLayer7SummaryManagedRulesParamsHTTPMethod = "OPTIONS"
+ AttackLayer7SummaryManagedRulesParamsHTTPMethodPropfind AttackLayer7SummaryManagedRulesParamsHTTPMethod = "PROPFIND"
+ AttackLayer7SummaryManagedRulesParamsHTTPMethodMkcol AttackLayer7SummaryManagedRulesParamsHTTPMethod = "MKCOL"
+ AttackLayer7SummaryManagedRulesParamsHTTPMethodPatch AttackLayer7SummaryManagedRulesParamsHTTPMethod = "PATCH"
+ AttackLayer7SummaryManagedRulesParamsHTTPMethodACL AttackLayer7SummaryManagedRulesParamsHTTPMethod = "ACL"
+ AttackLayer7SummaryManagedRulesParamsHTTPMethodBcopy AttackLayer7SummaryManagedRulesParamsHTTPMethod = "BCOPY"
+ AttackLayer7SummaryManagedRulesParamsHTTPMethodBdelete AttackLayer7SummaryManagedRulesParamsHTTPMethod = "BDELETE"
+ AttackLayer7SummaryManagedRulesParamsHTTPMethodBmove AttackLayer7SummaryManagedRulesParamsHTTPMethod = "BMOVE"
+ AttackLayer7SummaryManagedRulesParamsHTTPMethodBpropfind AttackLayer7SummaryManagedRulesParamsHTTPMethod = "BPROPFIND"
+ AttackLayer7SummaryManagedRulesParamsHTTPMethodBproppatch AttackLayer7SummaryManagedRulesParamsHTTPMethod = "BPROPPATCH"
+ AttackLayer7SummaryManagedRulesParamsHTTPMethodCheckin AttackLayer7SummaryManagedRulesParamsHTTPMethod = "CHECKIN"
+ AttackLayer7SummaryManagedRulesParamsHTTPMethodCheckout AttackLayer7SummaryManagedRulesParamsHTTPMethod = "CHECKOUT"
+ AttackLayer7SummaryManagedRulesParamsHTTPMethodConnect AttackLayer7SummaryManagedRulesParamsHTTPMethod = "CONNECT"
+ AttackLayer7SummaryManagedRulesParamsHTTPMethodCopy AttackLayer7SummaryManagedRulesParamsHTTPMethod = "COPY"
+ AttackLayer7SummaryManagedRulesParamsHTTPMethodLabel AttackLayer7SummaryManagedRulesParamsHTTPMethod = "LABEL"
+ AttackLayer7SummaryManagedRulesParamsHTTPMethodLock AttackLayer7SummaryManagedRulesParamsHTTPMethod = "LOCK"
+ AttackLayer7SummaryManagedRulesParamsHTTPMethodMerge AttackLayer7SummaryManagedRulesParamsHTTPMethod = "MERGE"
+ AttackLayer7SummaryManagedRulesParamsHTTPMethodMkactivity AttackLayer7SummaryManagedRulesParamsHTTPMethod = "MKACTIVITY"
+ AttackLayer7SummaryManagedRulesParamsHTTPMethodMkworkspace AttackLayer7SummaryManagedRulesParamsHTTPMethod = "MKWORKSPACE"
+ AttackLayer7SummaryManagedRulesParamsHTTPMethodMove AttackLayer7SummaryManagedRulesParamsHTTPMethod = "MOVE"
+ AttackLayer7SummaryManagedRulesParamsHTTPMethodNotify AttackLayer7SummaryManagedRulesParamsHTTPMethod = "NOTIFY"
+ AttackLayer7SummaryManagedRulesParamsHTTPMethodOrderpatch AttackLayer7SummaryManagedRulesParamsHTTPMethod = "ORDERPATCH"
+ AttackLayer7SummaryManagedRulesParamsHTTPMethodPoll AttackLayer7SummaryManagedRulesParamsHTTPMethod = "POLL"
+ AttackLayer7SummaryManagedRulesParamsHTTPMethodProppatch AttackLayer7SummaryManagedRulesParamsHTTPMethod = "PROPPATCH"
+ AttackLayer7SummaryManagedRulesParamsHTTPMethodReport AttackLayer7SummaryManagedRulesParamsHTTPMethod = "REPORT"
+ AttackLayer7SummaryManagedRulesParamsHTTPMethodSearch AttackLayer7SummaryManagedRulesParamsHTTPMethod = "SEARCH"
+ AttackLayer7SummaryManagedRulesParamsHTTPMethodSubscribe AttackLayer7SummaryManagedRulesParamsHTTPMethod = "SUBSCRIBE"
+ AttackLayer7SummaryManagedRulesParamsHTTPMethodTrace AttackLayer7SummaryManagedRulesParamsHTTPMethod = "TRACE"
+ AttackLayer7SummaryManagedRulesParamsHTTPMethodUncheckout AttackLayer7SummaryManagedRulesParamsHTTPMethod = "UNCHECKOUT"
+ AttackLayer7SummaryManagedRulesParamsHTTPMethodUnlock AttackLayer7SummaryManagedRulesParamsHTTPMethod = "UNLOCK"
+ AttackLayer7SummaryManagedRulesParamsHTTPMethodUnsubscribe AttackLayer7SummaryManagedRulesParamsHTTPMethod = "UNSUBSCRIBE"
+ AttackLayer7SummaryManagedRulesParamsHTTPMethodUpdate AttackLayer7SummaryManagedRulesParamsHTTPMethod = "UPDATE"
+ AttackLayer7SummaryManagedRulesParamsHTTPMethodVersioncontrol AttackLayer7SummaryManagedRulesParamsHTTPMethod = "VERSIONCONTROL"
+ AttackLayer7SummaryManagedRulesParamsHTTPMethodBaselinecontrol AttackLayer7SummaryManagedRulesParamsHTTPMethod = "BASELINECONTROL"
+ AttackLayer7SummaryManagedRulesParamsHTTPMethodXmsenumatts AttackLayer7SummaryManagedRulesParamsHTTPMethod = "XMSENUMATTS"
+ AttackLayer7SummaryManagedRulesParamsHTTPMethodRpcOutData AttackLayer7SummaryManagedRulesParamsHTTPMethod = "RPC_OUT_DATA"
+ AttackLayer7SummaryManagedRulesParamsHTTPMethodRpcInData AttackLayer7SummaryManagedRulesParamsHTTPMethod = "RPC_IN_DATA"
+ AttackLayer7SummaryManagedRulesParamsHTTPMethodJson AttackLayer7SummaryManagedRulesParamsHTTPMethod = "JSON"
+ AttackLayer7SummaryManagedRulesParamsHTTPMethodCook AttackLayer7SummaryManagedRulesParamsHTTPMethod = "COOK"
+ AttackLayer7SummaryManagedRulesParamsHTTPMethodTrack AttackLayer7SummaryManagedRulesParamsHTTPMethod = "TRACK"
+)
+
+type AttackLayer7SummaryManagedRulesParamsHTTPVersion string
+
+const (
+ AttackLayer7SummaryManagedRulesParamsHTTPVersionHttPv1 AttackLayer7SummaryManagedRulesParamsHTTPVersion = "HTTPv1"
+ AttackLayer7SummaryManagedRulesParamsHTTPVersionHttPv2 AttackLayer7SummaryManagedRulesParamsHTTPVersion = "HTTPv2"
+ AttackLayer7SummaryManagedRulesParamsHTTPVersionHttPv3 AttackLayer7SummaryManagedRulesParamsHTTPVersion = "HTTPv3"
+)
+
+type AttackLayer7SummaryManagedRulesParamsIPVersion string
+
+const (
+ AttackLayer7SummaryManagedRulesParamsIPVersionIPv4 AttackLayer7SummaryManagedRulesParamsIPVersion = "IPv4"
+ AttackLayer7SummaryManagedRulesParamsIPVersionIPv6 AttackLayer7SummaryManagedRulesParamsIPVersion = "IPv6"
+)
+
+type AttackLayer7SummaryManagedRulesParamsMitigationProduct string
+
+const (
+ AttackLayer7SummaryManagedRulesParamsMitigationProductDDOS AttackLayer7SummaryManagedRulesParamsMitigationProduct = "DDOS"
+ AttackLayer7SummaryManagedRulesParamsMitigationProductWAF AttackLayer7SummaryManagedRulesParamsMitigationProduct = "WAF"
+ AttackLayer7SummaryManagedRulesParamsMitigationProductBotManagement AttackLayer7SummaryManagedRulesParamsMitigationProduct = "BOT_MANAGEMENT"
+ AttackLayer7SummaryManagedRulesParamsMitigationProductAccessRules AttackLayer7SummaryManagedRulesParamsMitigationProduct = "ACCESS_RULES"
+ AttackLayer7SummaryManagedRulesParamsMitigationProductIPReputation AttackLayer7SummaryManagedRulesParamsMitigationProduct = "IP_REPUTATION"
+ AttackLayer7SummaryManagedRulesParamsMitigationProductAPIShield AttackLayer7SummaryManagedRulesParamsMitigationProduct = "API_SHIELD"
+ AttackLayer7SummaryManagedRulesParamsMitigationProductDataLossPrevention AttackLayer7SummaryManagedRulesParamsMitigationProduct = "DATA_LOSS_PREVENTION"
+)
+
+type AttackLayer7SummaryManagedRulesResponseEnvelope struct {
+ Result AttackLayer7SummaryManagedRulesResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON attackLayer7SummaryManagedRulesResponseEnvelopeJSON `json:"-"`
+}
+
+// attackLayer7SummaryManagedRulesResponseEnvelopeJSON contains the JSON metadata
+// for the struct [AttackLayer7SummaryManagedRulesResponseEnvelope]
+type attackLayer7SummaryManagedRulesResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7SummaryManagedRulesResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7SummaryManagedRulesResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7SummaryMitigationProductParams 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"`
+ // 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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]AttackLayer7SummaryMitigationProductParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Format results are returned in.
+ Format param.Field[AttackLayer7SummaryMitigationProductParamsFormat] `query:"format"`
+ // Filter for http method.
+ HTTPMethod param.Field[[]AttackLayer7SummaryMitigationProductParamsHTTPMethod] `query:"httpMethod"`
+ // Filter for http version.
+ HTTPVersion param.Field[[]AttackLayer7SummaryMitigationProductParamsHTTPVersion] `query:"httpVersion"`
+ // Filter for ip version.
+ IPVersion param.Field[[]AttackLayer7SummaryMitigationProductParamsIPVersion] `query:"ipVersion"`
+ // 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 [AttackLayer7SummaryMitigationProductParams]'s query
+// parameters as `url.Values`.
+func (r AttackLayer7SummaryMitigationProductParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type AttackLayer7SummaryMitigationProductParamsDateRange string
+
+const (
+ AttackLayer7SummaryMitigationProductParamsDateRange1d AttackLayer7SummaryMitigationProductParamsDateRange = "1d"
+ AttackLayer7SummaryMitigationProductParamsDateRange2d AttackLayer7SummaryMitigationProductParamsDateRange = "2d"
+ AttackLayer7SummaryMitigationProductParamsDateRange7d AttackLayer7SummaryMitigationProductParamsDateRange = "7d"
+ AttackLayer7SummaryMitigationProductParamsDateRange14d AttackLayer7SummaryMitigationProductParamsDateRange = "14d"
+ AttackLayer7SummaryMitigationProductParamsDateRange28d AttackLayer7SummaryMitigationProductParamsDateRange = "28d"
+ AttackLayer7SummaryMitigationProductParamsDateRange12w AttackLayer7SummaryMitigationProductParamsDateRange = "12w"
+ AttackLayer7SummaryMitigationProductParamsDateRange24w AttackLayer7SummaryMitigationProductParamsDateRange = "24w"
+ AttackLayer7SummaryMitigationProductParamsDateRange52w AttackLayer7SummaryMitigationProductParamsDateRange = "52w"
+ AttackLayer7SummaryMitigationProductParamsDateRange1dControl AttackLayer7SummaryMitigationProductParamsDateRange = "1dControl"
+ AttackLayer7SummaryMitigationProductParamsDateRange2dControl AttackLayer7SummaryMitigationProductParamsDateRange = "2dControl"
+ AttackLayer7SummaryMitigationProductParamsDateRange7dControl AttackLayer7SummaryMitigationProductParamsDateRange = "7dControl"
+ AttackLayer7SummaryMitigationProductParamsDateRange14dControl AttackLayer7SummaryMitigationProductParamsDateRange = "14dControl"
+ AttackLayer7SummaryMitigationProductParamsDateRange28dControl AttackLayer7SummaryMitigationProductParamsDateRange = "28dControl"
+ AttackLayer7SummaryMitigationProductParamsDateRange12wControl AttackLayer7SummaryMitigationProductParamsDateRange = "12wControl"
+ AttackLayer7SummaryMitigationProductParamsDateRange24wControl AttackLayer7SummaryMitigationProductParamsDateRange = "24wControl"
+)
+
+// Format results are returned in.
+type AttackLayer7SummaryMitigationProductParamsFormat string
+
+const (
+ AttackLayer7SummaryMitigationProductParamsFormatJson AttackLayer7SummaryMitigationProductParamsFormat = "JSON"
+ AttackLayer7SummaryMitigationProductParamsFormatCsv AttackLayer7SummaryMitigationProductParamsFormat = "CSV"
+)
+
+type AttackLayer7SummaryMitigationProductParamsHTTPMethod string
+
+const (
+ AttackLayer7SummaryMitigationProductParamsHTTPMethodGet AttackLayer7SummaryMitigationProductParamsHTTPMethod = "GET"
+ AttackLayer7SummaryMitigationProductParamsHTTPMethodPost AttackLayer7SummaryMitigationProductParamsHTTPMethod = "POST"
+ AttackLayer7SummaryMitigationProductParamsHTTPMethodDelete AttackLayer7SummaryMitigationProductParamsHTTPMethod = "DELETE"
+ AttackLayer7SummaryMitigationProductParamsHTTPMethodPut AttackLayer7SummaryMitigationProductParamsHTTPMethod = "PUT"
+ AttackLayer7SummaryMitigationProductParamsHTTPMethodHead AttackLayer7SummaryMitigationProductParamsHTTPMethod = "HEAD"
+ AttackLayer7SummaryMitigationProductParamsHTTPMethodPurge AttackLayer7SummaryMitigationProductParamsHTTPMethod = "PURGE"
+ AttackLayer7SummaryMitigationProductParamsHTTPMethodOptions AttackLayer7SummaryMitigationProductParamsHTTPMethod = "OPTIONS"
+ AttackLayer7SummaryMitigationProductParamsHTTPMethodPropfind AttackLayer7SummaryMitigationProductParamsHTTPMethod = "PROPFIND"
+ AttackLayer7SummaryMitigationProductParamsHTTPMethodMkcol AttackLayer7SummaryMitigationProductParamsHTTPMethod = "MKCOL"
+ AttackLayer7SummaryMitigationProductParamsHTTPMethodPatch AttackLayer7SummaryMitigationProductParamsHTTPMethod = "PATCH"
+ AttackLayer7SummaryMitigationProductParamsHTTPMethodACL AttackLayer7SummaryMitigationProductParamsHTTPMethod = "ACL"
+ AttackLayer7SummaryMitigationProductParamsHTTPMethodBcopy AttackLayer7SummaryMitigationProductParamsHTTPMethod = "BCOPY"
+ AttackLayer7SummaryMitigationProductParamsHTTPMethodBdelete AttackLayer7SummaryMitigationProductParamsHTTPMethod = "BDELETE"
+ AttackLayer7SummaryMitigationProductParamsHTTPMethodBmove AttackLayer7SummaryMitigationProductParamsHTTPMethod = "BMOVE"
+ AttackLayer7SummaryMitigationProductParamsHTTPMethodBpropfind AttackLayer7SummaryMitigationProductParamsHTTPMethod = "BPROPFIND"
+ AttackLayer7SummaryMitigationProductParamsHTTPMethodBproppatch AttackLayer7SummaryMitigationProductParamsHTTPMethod = "BPROPPATCH"
+ AttackLayer7SummaryMitigationProductParamsHTTPMethodCheckin AttackLayer7SummaryMitigationProductParamsHTTPMethod = "CHECKIN"
+ AttackLayer7SummaryMitigationProductParamsHTTPMethodCheckout AttackLayer7SummaryMitigationProductParamsHTTPMethod = "CHECKOUT"
+ AttackLayer7SummaryMitigationProductParamsHTTPMethodConnect AttackLayer7SummaryMitigationProductParamsHTTPMethod = "CONNECT"
+ AttackLayer7SummaryMitigationProductParamsHTTPMethodCopy AttackLayer7SummaryMitigationProductParamsHTTPMethod = "COPY"
+ AttackLayer7SummaryMitigationProductParamsHTTPMethodLabel AttackLayer7SummaryMitigationProductParamsHTTPMethod = "LABEL"
+ AttackLayer7SummaryMitigationProductParamsHTTPMethodLock AttackLayer7SummaryMitigationProductParamsHTTPMethod = "LOCK"
+ AttackLayer7SummaryMitigationProductParamsHTTPMethodMerge AttackLayer7SummaryMitigationProductParamsHTTPMethod = "MERGE"
+ AttackLayer7SummaryMitigationProductParamsHTTPMethodMkactivity AttackLayer7SummaryMitigationProductParamsHTTPMethod = "MKACTIVITY"
+ AttackLayer7SummaryMitigationProductParamsHTTPMethodMkworkspace AttackLayer7SummaryMitigationProductParamsHTTPMethod = "MKWORKSPACE"
+ AttackLayer7SummaryMitigationProductParamsHTTPMethodMove AttackLayer7SummaryMitigationProductParamsHTTPMethod = "MOVE"
+ AttackLayer7SummaryMitigationProductParamsHTTPMethodNotify AttackLayer7SummaryMitigationProductParamsHTTPMethod = "NOTIFY"
+ AttackLayer7SummaryMitigationProductParamsHTTPMethodOrderpatch AttackLayer7SummaryMitigationProductParamsHTTPMethod = "ORDERPATCH"
+ AttackLayer7SummaryMitigationProductParamsHTTPMethodPoll AttackLayer7SummaryMitigationProductParamsHTTPMethod = "POLL"
+ AttackLayer7SummaryMitigationProductParamsHTTPMethodProppatch AttackLayer7SummaryMitigationProductParamsHTTPMethod = "PROPPATCH"
+ AttackLayer7SummaryMitigationProductParamsHTTPMethodReport AttackLayer7SummaryMitigationProductParamsHTTPMethod = "REPORT"
+ AttackLayer7SummaryMitigationProductParamsHTTPMethodSearch AttackLayer7SummaryMitigationProductParamsHTTPMethod = "SEARCH"
+ AttackLayer7SummaryMitigationProductParamsHTTPMethodSubscribe AttackLayer7SummaryMitigationProductParamsHTTPMethod = "SUBSCRIBE"
+ AttackLayer7SummaryMitigationProductParamsHTTPMethodTrace AttackLayer7SummaryMitigationProductParamsHTTPMethod = "TRACE"
+ AttackLayer7SummaryMitigationProductParamsHTTPMethodUncheckout AttackLayer7SummaryMitigationProductParamsHTTPMethod = "UNCHECKOUT"
+ AttackLayer7SummaryMitigationProductParamsHTTPMethodUnlock AttackLayer7SummaryMitigationProductParamsHTTPMethod = "UNLOCK"
+ AttackLayer7SummaryMitigationProductParamsHTTPMethodUnsubscribe AttackLayer7SummaryMitigationProductParamsHTTPMethod = "UNSUBSCRIBE"
+ AttackLayer7SummaryMitigationProductParamsHTTPMethodUpdate AttackLayer7SummaryMitigationProductParamsHTTPMethod = "UPDATE"
+ AttackLayer7SummaryMitigationProductParamsHTTPMethodVersioncontrol AttackLayer7SummaryMitigationProductParamsHTTPMethod = "VERSIONCONTROL"
+ AttackLayer7SummaryMitigationProductParamsHTTPMethodBaselinecontrol AttackLayer7SummaryMitigationProductParamsHTTPMethod = "BASELINECONTROL"
+ AttackLayer7SummaryMitigationProductParamsHTTPMethodXmsenumatts AttackLayer7SummaryMitigationProductParamsHTTPMethod = "XMSENUMATTS"
+ AttackLayer7SummaryMitigationProductParamsHTTPMethodRpcOutData AttackLayer7SummaryMitigationProductParamsHTTPMethod = "RPC_OUT_DATA"
+ AttackLayer7SummaryMitigationProductParamsHTTPMethodRpcInData AttackLayer7SummaryMitigationProductParamsHTTPMethod = "RPC_IN_DATA"
+ AttackLayer7SummaryMitigationProductParamsHTTPMethodJson AttackLayer7SummaryMitigationProductParamsHTTPMethod = "JSON"
+ AttackLayer7SummaryMitigationProductParamsHTTPMethodCook AttackLayer7SummaryMitigationProductParamsHTTPMethod = "COOK"
+ AttackLayer7SummaryMitigationProductParamsHTTPMethodTrack AttackLayer7SummaryMitigationProductParamsHTTPMethod = "TRACK"
+)
+
+type AttackLayer7SummaryMitigationProductParamsHTTPVersion string
+
+const (
+ AttackLayer7SummaryMitigationProductParamsHTTPVersionHttPv1 AttackLayer7SummaryMitigationProductParamsHTTPVersion = "HTTPv1"
+ AttackLayer7SummaryMitigationProductParamsHTTPVersionHttPv2 AttackLayer7SummaryMitigationProductParamsHTTPVersion = "HTTPv2"
+ AttackLayer7SummaryMitigationProductParamsHTTPVersionHttPv3 AttackLayer7SummaryMitigationProductParamsHTTPVersion = "HTTPv3"
+)
+
+type AttackLayer7SummaryMitigationProductParamsIPVersion string
+
+const (
+ AttackLayer7SummaryMitigationProductParamsIPVersionIPv4 AttackLayer7SummaryMitigationProductParamsIPVersion = "IPv4"
+ AttackLayer7SummaryMitigationProductParamsIPVersionIPv6 AttackLayer7SummaryMitigationProductParamsIPVersion = "IPv6"
+)
+
+type AttackLayer7SummaryMitigationProductResponseEnvelope struct {
+ Result AttackLayer7SummaryMitigationProductResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON attackLayer7SummaryMitigationProductResponseEnvelopeJSON `json:"-"`
+}
+
+// attackLayer7SummaryMitigationProductResponseEnvelopeJSON contains the JSON
+// metadata for the struct [AttackLayer7SummaryMitigationProductResponseEnvelope]
+type attackLayer7SummaryMitigationProductResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7SummaryMitigationProductResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7SummaryMitigationProductResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/radar/attacklayer7summary_test.go b/radar/attacklayer7summary_test.go
new file mode 100644
index 00000000000..b15f4c2d571
--- /dev/null
+++ b/radar/attacklayer7summary_test.go
@@ -0,0 +1,230 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/radar"
+)
+
+func TestAttackLayer7SummaryGetWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Attacks.Layer7.Summary.Get(context.TODO(), radar.AttackLayer7SummaryGetParams{
+ 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([]radar.AttackLayer7SummaryGetParamsDateRange{radar.AttackLayer7SummaryGetParamsDateRange1d, radar.AttackLayer7SummaryGetParamsDateRange2d, radar.AttackLayer7SummaryGetParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Format: cloudflare.F(radar.AttackLayer7SummaryGetParamsFormatJson),
+ 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())
+ }
+}
+
+func TestAttackLayer7SummaryHTTPMethodWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Attacks.Layer7.Summary.HTTPMethod(context.TODO(), radar.AttackLayer7SummaryHTTPMethodParams{
+ 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([]radar.AttackLayer7SummaryHTTPMethodParamsDateRange{radar.AttackLayer7SummaryHTTPMethodParamsDateRange1d, radar.AttackLayer7SummaryHTTPMethodParamsDateRange2d, radar.AttackLayer7SummaryHTTPMethodParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Format: cloudflare.F(radar.AttackLayer7SummaryHTTPMethodParamsFormatJson),
+ HTTPVersion: cloudflare.F([]radar.AttackLayer7SummaryHTTPMethodParamsHTTPVersion{radar.AttackLayer7SummaryHTTPMethodParamsHTTPVersionHttPv1, radar.AttackLayer7SummaryHTTPMethodParamsHTTPVersionHttPv2, radar.AttackLayer7SummaryHTTPMethodParamsHTTPVersionHttPv3}),
+ IPVersion: cloudflare.F([]radar.AttackLayer7SummaryHTTPMethodParamsIPVersion{radar.AttackLayer7SummaryHTTPMethodParamsIPVersionIPv4, radar.AttackLayer7SummaryHTTPMethodParamsIPVersionIPv6}),
+ Location: cloudflare.F([]string{"string", "string", "string"}),
+ MitigationProduct: cloudflare.F([]radar.AttackLayer7SummaryHTTPMethodParamsMitigationProduct{radar.AttackLayer7SummaryHTTPMethodParamsMitigationProductDDOS, radar.AttackLayer7SummaryHTTPMethodParamsMitigationProductWAF, radar.AttackLayer7SummaryHTTPMethodParamsMitigationProductBotManagement}),
+ 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())
+ }
+}
+
+func TestAttackLayer7SummaryHTTPVersionWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Attacks.Layer7.Summary.HTTPVersion(context.TODO(), radar.AttackLayer7SummaryHTTPVersionParams{
+ 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([]radar.AttackLayer7SummaryHTTPVersionParamsDateRange{radar.AttackLayer7SummaryHTTPVersionParamsDateRange1d, radar.AttackLayer7SummaryHTTPVersionParamsDateRange2d, radar.AttackLayer7SummaryHTTPVersionParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Format: cloudflare.F(radar.AttackLayer7SummaryHTTPVersionParamsFormatJson),
+ HTTPMethod: cloudflare.F([]radar.AttackLayer7SummaryHTTPVersionParamsHTTPMethod{radar.AttackLayer7SummaryHTTPVersionParamsHTTPMethodGet, radar.AttackLayer7SummaryHTTPVersionParamsHTTPMethodPost, radar.AttackLayer7SummaryHTTPVersionParamsHTTPMethodDelete}),
+ IPVersion: cloudflare.F([]radar.AttackLayer7SummaryHTTPVersionParamsIPVersion{radar.AttackLayer7SummaryHTTPVersionParamsIPVersionIPv4, radar.AttackLayer7SummaryHTTPVersionParamsIPVersionIPv6}),
+ Location: cloudflare.F([]string{"string", "string", "string"}),
+ MitigationProduct: cloudflare.F([]radar.AttackLayer7SummaryHTTPVersionParamsMitigationProduct{radar.AttackLayer7SummaryHTTPVersionParamsMitigationProductDDOS, radar.AttackLayer7SummaryHTTPVersionParamsMitigationProductWAF, radar.AttackLayer7SummaryHTTPVersionParamsMitigationProductBotManagement}),
+ 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())
+ }
+}
+
+func TestAttackLayer7SummaryIPVersionWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Attacks.Layer7.Summary.IPVersion(context.TODO(), radar.AttackLayer7SummaryIPVersionParams{
+ 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([]radar.AttackLayer7SummaryIPVersionParamsDateRange{radar.AttackLayer7SummaryIPVersionParamsDateRange1d, radar.AttackLayer7SummaryIPVersionParamsDateRange2d, radar.AttackLayer7SummaryIPVersionParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Format: cloudflare.F(radar.AttackLayer7SummaryIPVersionParamsFormatJson),
+ HTTPMethod: cloudflare.F([]radar.AttackLayer7SummaryIPVersionParamsHTTPMethod{radar.AttackLayer7SummaryIPVersionParamsHTTPMethodGet, radar.AttackLayer7SummaryIPVersionParamsHTTPMethodPost, radar.AttackLayer7SummaryIPVersionParamsHTTPMethodDelete}),
+ HTTPVersion: cloudflare.F([]radar.AttackLayer7SummaryIPVersionParamsHTTPVersion{radar.AttackLayer7SummaryIPVersionParamsHTTPVersionHttPv1, radar.AttackLayer7SummaryIPVersionParamsHTTPVersionHttPv2, radar.AttackLayer7SummaryIPVersionParamsHTTPVersionHttPv3}),
+ Location: cloudflare.F([]string{"string", "string", "string"}),
+ MitigationProduct: cloudflare.F([]radar.AttackLayer7SummaryIPVersionParamsMitigationProduct{radar.AttackLayer7SummaryIPVersionParamsMitigationProductDDOS, radar.AttackLayer7SummaryIPVersionParamsMitigationProductWAF, radar.AttackLayer7SummaryIPVersionParamsMitigationProductBotManagement}),
+ 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())
+ }
+}
+
+func TestAttackLayer7SummaryManagedRulesWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Attacks.Layer7.Summary.ManagedRules(context.TODO(), radar.AttackLayer7SummaryManagedRulesParams{
+ 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([]radar.AttackLayer7SummaryManagedRulesParamsDateRange{radar.AttackLayer7SummaryManagedRulesParamsDateRange1d, radar.AttackLayer7SummaryManagedRulesParamsDateRange2d, radar.AttackLayer7SummaryManagedRulesParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Format: cloudflare.F(radar.AttackLayer7SummaryManagedRulesParamsFormatJson),
+ HTTPMethod: cloudflare.F([]radar.AttackLayer7SummaryManagedRulesParamsHTTPMethod{radar.AttackLayer7SummaryManagedRulesParamsHTTPMethodGet, radar.AttackLayer7SummaryManagedRulesParamsHTTPMethodPost, radar.AttackLayer7SummaryManagedRulesParamsHTTPMethodDelete}),
+ HTTPVersion: cloudflare.F([]radar.AttackLayer7SummaryManagedRulesParamsHTTPVersion{radar.AttackLayer7SummaryManagedRulesParamsHTTPVersionHttPv1, radar.AttackLayer7SummaryManagedRulesParamsHTTPVersionHttPv2, radar.AttackLayer7SummaryManagedRulesParamsHTTPVersionHttPv3}),
+ IPVersion: cloudflare.F([]radar.AttackLayer7SummaryManagedRulesParamsIPVersion{radar.AttackLayer7SummaryManagedRulesParamsIPVersionIPv4, radar.AttackLayer7SummaryManagedRulesParamsIPVersionIPv6}),
+ Location: cloudflare.F([]string{"string", "string", "string"}),
+ MitigationProduct: cloudflare.F([]radar.AttackLayer7SummaryManagedRulesParamsMitigationProduct{radar.AttackLayer7SummaryManagedRulesParamsMitigationProductDDOS, radar.AttackLayer7SummaryManagedRulesParamsMitigationProductWAF, radar.AttackLayer7SummaryManagedRulesParamsMitigationProductBotManagement}),
+ 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())
+ }
+}
+
+func TestAttackLayer7SummaryMitigationProductWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Attacks.Layer7.Summary.MitigationProduct(context.TODO(), radar.AttackLayer7SummaryMitigationProductParams{
+ 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([]radar.AttackLayer7SummaryMitigationProductParamsDateRange{radar.AttackLayer7SummaryMitigationProductParamsDateRange1d, radar.AttackLayer7SummaryMitigationProductParamsDateRange2d, radar.AttackLayer7SummaryMitigationProductParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Format: cloudflare.F(radar.AttackLayer7SummaryMitigationProductParamsFormatJson),
+ HTTPMethod: cloudflare.F([]radar.AttackLayer7SummaryMitigationProductParamsHTTPMethod{radar.AttackLayer7SummaryMitigationProductParamsHTTPMethodGet, radar.AttackLayer7SummaryMitigationProductParamsHTTPMethodPost, radar.AttackLayer7SummaryMitigationProductParamsHTTPMethodDelete}),
+ HTTPVersion: cloudflare.F([]radar.AttackLayer7SummaryMitigationProductParamsHTTPVersion{radar.AttackLayer7SummaryMitigationProductParamsHTTPVersionHttPv1, radar.AttackLayer7SummaryMitigationProductParamsHTTPVersionHttPv2, radar.AttackLayer7SummaryMitigationProductParamsHTTPVersionHttPv3}),
+ IPVersion: cloudflare.F([]radar.AttackLayer7SummaryMitigationProductParamsIPVersion{radar.AttackLayer7SummaryMitigationProductParamsIPVersionIPv4, radar.AttackLayer7SummaryMitigationProductParamsIPVersionIPv6}),
+ 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/radar/attacklayer7timeseriesgroup.go b/radar/attacklayer7timeseriesgroup.go
new file mode 100644
index 00000000000..e2ea7f3fbe6
--- /dev/null
+++ b/radar/attacklayer7timeseriesgroup.go
@@ -0,0 +1,2062 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "context"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// AttackLayer7TimeseriesGroupService contains methods and other services that help
+// with interacting with the cloudflare API. Note, unlike clients, this service
+// does not read variables from the environment automatically. You should not
+// instantiate this service directly, and instead use the
+// [NewAttackLayer7TimeseriesGroupService] method instead.
+type AttackLayer7TimeseriesGroupService struct {
+ Options []option.RequestOption
+}
+
+// NewAttackLayer7TimeseriesGroupService generates a new service that applies the
+// given options to each request. These options are applied after the parent
+// client's options (if there is one), and before any request-specific options.
+func NewAttackLayer7TimeseriesGroupService(opts ...option.RequestOption) (r *AttackLayer7TimeseriesGroupService) {
+ r = &AttackLayer7TimeseriesGroupService{}
+ r.Options = opts
+ return
+}
+
+// Get a time series of the percentual distribution of mitigation techniques, over
+// time.
+func (r *AttackLayer7TimeseriesGroupService) Get(ctx context.Context, query AttackLayer7TimeseriesGroupGetParams, opts ...option.RequestOption) (res *AttackLayer7TimeseriesGroupGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AttackLayer7TimeseriesGroupGetResponseEnvelope
+ path := "radar/attacks/layer7/timeseries_groups"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Percentage distribution of attacks by http method used over time.
+func (r *AttackLayer7TimeseriesGroupService) HTTPMethod(ctx context.Context, query AttackLayer7TimeseriesGroupHTTPMethodParams, opts ...option.RequestOption) (res *AttackLayer7TimeseriesGroupHTTPMethodResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AttackLayer7TimeseriesGroupHTTPMethodResponseEnvelope
+ path := "radar/attacks/layer7/timeseries_groups/http_method"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Percentage distribution of attacks by http version used over time.
+func (r *AttackLayer7TimeseriesGroupService) HTTPVersion(ctx context.Context, query AttackLayer7TimeseriesGroupHTTPVersionParams, opts ...option.RequestOption) (res *AttackLayer7TimeseriesGroupHTTPVersionResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AttackLayer7TimeseriesGroupHTTPVersionResponseEnvelope
+ path := "radar/attacks/layer7/timeseries_groups/http_version"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Percentage distribution of attacks by industry used over time.
+func (r *AttackLayer7TimeseriesGroupService) Industry(ctx context.Context, query AttackLayer7TimeseriesGroupIndustryParams, opts ...option.RequestOption) (res *AttackLayer7TimeseriesGroupIndustryResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AttackLayer7TimeseriesGroupIndustryResponseEnvelope
+ path := "radar/attacks/layer7/timeseries_groups/industry"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Percentage distribution of attacks by ip version used over time.
+func (r *AttackLayer7TimeseriesGroupService) IPVersion(ctx context.Context, query AttackLayer7TimeseriesGroupIPVersionParams, opts ...option.RequestOption) (res *AttackLayer7TimeseriesGroupIPVersionResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AttackLayer7TimeseriesGroupIPVersionResponseEnvelope
+ path := "radar/attacks/layer7/timeseries_groups/ip_version"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Percentage distribution of attacks by managed rules used over time.
+func (r *AttackLayer7TimeseriesGroupService) ManagedRules(ctx context.Context, query AttackLayer7TimeseriesGroupManagedRulesParams, opts ...option.RequestOption) (res *AttackLayer7TimeseriesGroupManagedRulesResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AttackLayer7TimeseriesGroupManagedRulesResponseEnvelope
+ path := "radar/attacks/layer7/timeseries_groups/managed_rules"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Percentage distribution of attacks by mitigation product used over time.
+func (r *AttackLayer7TimeseriesGroupService) MitigationProduct(ctx context.Context, query AttackLayer7TimeseriesGroupMitigationProductParams, opts ...option.RequestOption) (res *AttackLayer7TimeseriesGroupMitigationProductResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AttackLayer7TimeseriesGroupMitigationProductResponseEnvelope
+ path := "radar/attacks/layer7/timeseries_groups/mitigation_product"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Percentage distribution of attacks by vertical used over time.
+func (r *AttackLayer7TimeseriesGroupService) Vertical(ctx context.Context, query AttackLayer7TimeseriesGroupVerticalParams, opts ...option.RequestOption) (res *AttackLayer7TimeseriesGroupVerticalResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AttackLayer7TimeseriesGroupVerticalResponseEnvelope
+ path := "radar/attacks/layer7/timeseries_groups/vertical"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type AttackLayer7TimeseriesGroupGetResponse struct {
+ Meta AttackLayer7TimeseriesGroupGetResponseMeta `json:"meta,required"`
+ Serie0 AttackLayer7TimeseriesGroupGetResponseSerie0 `json:"serie_0,required"`
+ JSON attackLayer7TimeseriesGroupGetResponseJSON `json:"-"`
+}
+
+// attackLayer7TimeseriesGroupGetResponseJSON contains the JSON metadata for the
+// struct [AttackLayer7TimeseriesGroupGetResponse]
+type attackLayer7TimeseriesGroupGetResponseJSON struct {
+ Meta apijson.Field
+ Serie0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7TimeseriesGroupGetResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TimeseriesGroupGetResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7TimeseriesGroupGetResponseMeta struct {
+ AggInterval string `json:"aggInterval,required"`
+ DateRange []AttackLayer7TimeseriesGroupGetResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated time.Time `json:"lastUpdated,required" format:"date-time"`
+ ConfidenceInfo AttackLayer7TimeseriesGroupGetResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON attackLayer7TimeseriesGroupGetResponseMetaJSON `json:"-"`
+}
+
+// attackLayer7TimeseriesGroupGetResponseMetaJSON contains the JSON metadata for
+// the struct [AttackLayer7TimeseriesGroupGetResponseMeta]
+type attackLayer7TimeseriesGroupGetResponseMetaJSON struct {
+ AggInterval apijson.Field
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7TimeseriesGroupGetResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TimeseriesGroupGetResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7TimeseriesGroupGetResponseMetaDateRange 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 attackLayer7TimeseriesGroupGetResponseMetaDateRangeJSON `json:"-"`
+}
+
+// attackLayer7TimeseriesGroupGetResponseMetaDateRangeJSON contains the JSON
+// metadata for the struct [AttackLayer7TimeseriesGroupGetResponseMetaDateRange]
+type attackLayer7TimeseriesGroupGetResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7TimeseriesGroupGetResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TimeseriesGroupGetResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7TimeseriesGroupGetResponseMetaConfidenceInfo struct {
+ Annotations []AttackLayer7TimeseriesGroupGetResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON attackLayer7TimeseriesGroupGetResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// attackLayer7TimeseriesGroupGetResponseMetaConfidenceInfoJSON contains the JSON
+// metadata for the struct
+// [AttackLayer7TimeseriesGroupGetResponseMetaConfidenceInfo]
+type attackLayer7TimeseriesGroupGetResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7TimeseriesGroupGetResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TimeseriesGroupGetResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7TimeseriesGroupGetResponseMetaConfidenceInfoAnnotation 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 attackLayer7TimeseriesGroupGetResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// attackLayer7TimeseriesGroupGetResponseMetaConfidenceInfoAnnotationJSON contains
+// the JSON metadata for the struct
+// [AttackLayer7TimeseriesGroupGetResponseMetaConfidenceInfoAnnotation]
+type attackLayer7TimeseriesGroupGetResponseMetaConfidenceInfoAnnotationJSON 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 *AttackLayer7TimeseriesGroupGetResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TimeseriesGroupGetResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7TimeseriesGroupGetResponseSerie0 struct {
+ AccessRules []string `json:"ACCESS_RULES,required"`
+ APIShield []string `json:"API_SHIELD,required"`
+ BotManagement []string `json:"BOT_MANAGEMENT,required"`
+ DataLossPrevention []string `json:"DATA_LOSS_PREVENTION,required"`
+ DDOS []string `json:"DDOS,required"`
+ IPReputation []string `json:"IP_REPUTATION,required"`
+ Timestamps []time.Time `json:"timestamps,required" format:"date-time"`
+ WAF []string `json:"WAF,required"`
+ JSON attackLayer7TimeseriesGroupGetResponseSerie0JSON `json:"-"`
+}
+
+// attackLayer7TimeseriesGroupGetResponseSerie0JSON contains the JSON metadata for
+// the struct [AttackLayer7TimeseriesGroupGetResponseSerie0]
+type attackLayer7TimeseriesGroupGetResponseSerie0JSON struct {
+ AccessRules apijson.Field
+ APIShield apijson.Field
+ BotManagement apijson.Field
+ DataLossPrevention apijson.Field
+ DDOS apijson.Field
+ IPReputation apijson.Field
+ Timestamps apijson.Field
+ WAF apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7TimeseriesGroupGetResponseSerie0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TimeseriesGroupGetResponseSerie0JSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7TimeseriesGroupHTTPMethodResponse struct {
+ Meta interface{} `json:"meta,required"`
+ Serie0 AttackLayer7TimeseriesGroupHTTPMethodResponseSerie0 `json:"serie_0,required"`
+ JSON attackLayer7TimeseriesGroupHTTPMethodResponseJSON `json:"-"`
+}
+
+// attackLayer7TimeseriesGroupHTTPMethodResponseJSON contains the JSON metadata for
+// the struct [AttackLayer7TimeseriesGroupHTTPMethodResponse]
+type attackLayer7TimeseriesGroupHTTPMethodResponseJSON struct {
+ Meta apijson.Field
+ Serie0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7TimeseriesGroupHTTPMethodResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TimeseriesGroupHTTPMethodResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7TimeseriesGroupHTTPMethodResponseSerie0 struct {
+ Get []string `json:"GET,required"`
+ Timestamps []string `json:"timestamps,required"`
+ JSON attackLayer7TimeseriesGroupHTTPMethodResponseSerie0JSON `json:"-"`
+}
+
+// attackLayer7TimeseriesGroupHTTPMethodResponseSerie0JSON contains the JSON
+// metadata for the struct [AttackLayer7TimeseriesGroupHTTPMethodResponseSerie0]
+type attackLayer7TimeseriesGroupHTTPMethodResponseSerie0JSON struct {
+ Get apijson.Field
+ Timestamps apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7TimeseriesGroupHTTPMethodResponseSerie0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TimeseriesGroupHTTPMethodResponseSerie0JSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7TimeseriesGroupHTTPVersionResponse struct {
+ Meta interface{} `json:"meta,required"`
+ Serie0 AttackLayer7TimeseriesGroupHTTPVersionResponseSerie0 `json:"serie_0,required"`
+ JSON attackLayer7TimeseriesGroupHTTPVersionResponseJSON `json:"-"`
+}
+
+// attackLayer7TimeseriesGroupHTTPVersionResponseJSON contains the JSON metadata
+// for the struct [AttackLayer7TimeseriesGroupHTTPVersionResponse]
+type attackLayer7TimeseriesGroupHTTPVersionResponseJSON struct {
+ Meta apijson.Field
+ Serie0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7TimeseriesGroupHTTPVersionResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TimeseriesGroupHTTPVersionResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7TimeseriesGroupHTTPVersionResponseSerie0 struct {
+ HTTP1X []string `json:"HTTP/1.x,required"`
+ Timestamps []string `json:"timestamps,required"`
+ JSON attackLayer7TimeseriesGroupHTTPVersionResponseSerie0JSON `json:"-"`
+}
+
+// attackLayer7TimeseriesGroupHTTPVersionResponseSerie0JSON contains the JSON
+// metadata for the struct [AttackLayer7TimeseriesGroupHTTPVersionResponseSerie0]
+type attackLayer7TimeseriesGroupHTTPVersionResponseSerie0JSON struct {
+ HTTP1X apijson.Field
+ Timestamps apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7TimeseriesGroupHTTPVersionResponseSerie0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TimeseriesGroupHTTPVersionResponseSerie0JSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7TimeseriesGroupIndustryResponse struct {
+ Meta interface{} `json:"meta,required"`
+ Serie0 AttackLayer7TimeseriesGroupIndustryResponseSerie0 `json:"serie_0,required"`
+ JSON attackLayer7TimeseriesGroupIndustryResponseJSON `json:"-"`
+}
+
+// attackLayer7TimeseriesGroupIndustryResponseJSON contains the JSON metadata for
+// the struct [AttackLayer7TimeseriesGroupIndustryResponse]
+type attackLayer7TimeseriesGroupIndustryResponseJSON struct {
+ Meta apijson.Field
+ Serie0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7TimeseriesGroupIndustryResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TimeseriesGroupIndustryResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7TimeseriesGroupIndustryResponseSerie0 struct {
+ Timestamps []string `json:"timestamps,required"`
+ ExtraFields map[string][]string `json:"-,extras"`
+ JSON attackLayer7TimeseriesGroupIndustryResponseSerie0JSON `json:"-"`
+}
+
+// attackLayer7TimeseriesGroupIndustryResponseSerie0JSON contains the JSON metadata
+// for the struct [AttackLayer7TimeseriesGroupIndustryResponseSerie0]
+type attackLayer7TimeseriesGroupIndustryResponseSerie0JSON struct {
+ Timestamps apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7TimeseriesGroupIndustryResponseSerie0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TimeseriesGroupIndustryResponseSerie0JSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7TimeseriesGroupIPVersionResponse struct {
+ Meta interface{} `json:"meta,required"`
+ Serie0 AttackLayer7TimeseriesGroupIPVersionResponseSerie0 `json:"serie_0,required"`
+ JSON attackLayer7TimeseriesGroupIPVersionResponseJSON `json:"-"`
+}
+
+// attackLayer7TimeseriesGroupIPVersionResponseJSON contains the JSON metadata for
+// the struct [AttackLayer7TimeseriesGroupIPVersionResponse]
+type attackLayer7TimeseriesGroupIPVersionResponseJSON struct {
+ Meta apijson.Field
+ Serie0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7TimeseriesGroupIPVersionResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TimeseriesGroupIPVersionResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7TimeseriesGroupIPVersionResponseSerie0 struct {
+ IPv4 []string `json:"IPv4,required"`
+ IPv6 []string `json:"IPv6,required"`
+ Timestamps []string `json:"timestamps,required"`
+ JSON attackLayer7TimeseriesGroupIPVersionResponseSerie0JSON `json:"-"`
+}
+
+// attackLayer7TimeseriesGroupIPVersionResponseSerie0JSON contains the JSON
+// metadata for the struct [AttackLayer7TimeseriesGroupIPVersionResponseSerie0]
+type attackLayer7TimeseriesGroupIPVersionResponseSerie0JSON struct {
+ IPv4 apijson.Field
+ IPv6 apijson.Field
+ Timestamps apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7TimeseriesGroupIPVersionResponseSerie0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TimeseriesGroupIPVersionResponseSerie0JSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7TimeseriesGroupManagedRulesResponse struct {
+ Meta interface{} `json:"meta,required"`
+ Serie0 AttackLayer7TimeseriesGroupManagedRulesResponseSerie0 `json:"serie_0,required"`
+ JSON attackLayer7TimeseriesGroupManagedRulesResponseJSON `json:"-"`
+}
+
+// attackLayer7TimeseriesGroupManagedRulesResponseJSON contains the JSON metadata
+// for the struct [AttackLayer7TimeseriesGroupManagedRulesResponse]
+type attackLayer7TimeseriesGroupManagedRulesResponseJSON struct {
+ Meta apijson.Field
+ Serie0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7TimeseriesGroupManagedRulesResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TimeseriesGroupManagedRulesResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7TimeseriesGroupManagedRulesResponseSerie0 struct {
+ Bot []string `json:"Bot,required"`
+ Timestamps []string `json:"timestamps,required"`
+ JSON attackLayer7TimeseriesGroupManagedRulesResponseSerie0JSON `json:"-"`
+}
+
+// attackLayer7TimeseriesGroupManagedRulesResponseSerie0JSON contains the JSON
+// metadata for the struct [AttackLayer7TimeseriesGroupManagedRulesResponseSerie0]
+type attackLayer7TimeseriesGroupManagedRulesResponseSerie0JSON struct {
+ Bot apijson.Field
+ Timestamps apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7TimeseriesGroupManagedRulesResponseSerie0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TimeseriesGroupManagedRulesResponseSerie0JSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7TimeseriesGroupMitigationProductResponse struct {
+ Meta interface{} `json:"meta,required"`
+ Serie0 AttackLayer7TimeseriesGroupMitigationProductResponseSerie0 `json:"serie_0,required"`
+ JSON attackLayer7TimeseriesGroupMitigationProductResponseJSON `json:"-"`
+}
+
+// attackLayer7TimeseriesGroupMitigationProductResponseJSON contains the JSON
+// metadata for the struct [AttackLayer7TimeseriesGroupMitigationProductResponse]
+type attackLayer7TimeseriesGroupMitigationProductResponseJSON struct {
+ Meta apijson.Field
+ Serie0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7TimeseriesGroupMitigationProductResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TimeseriesGroupMitigationProductResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7TimeseriesGroupMitigationProductResponseSerie0 struct {
+ DDOS []string `json:"DDOS,required"`
+ Timestamps []string `json:"timestamps,required"`
+ JSON attackLayer7TimeseriesGroupMitigationProductResponseSerie0JSON `json:"-"`
+}
+
+// attackLayer7TimeseriesGroupMitigationProductResponseSerie0JSON contains the JSON
+// metadata for the struct
+// [AttackLayer7TimeseriesGroupMitigationProductResponseSerie0]
+type attackLayer7TimeseriesGroupMitigationProductResponseSerie0JSON struct {
+ DDOS apijson.Field
+ Timestamps apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7TimeseriesGroupMitigationProductResponseSerie0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TimeseriesGroupMitigationProductResponseSerie0JSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7TimeseriesGroupVerticalResponse struct {
+ Meta interface{} `json:"meta,required"`
+ Serie0 AttackLayer7TimeseriesGroupVerticalResponseSerie0 `json:"serie_0,required"`
+ JSON attackLayer7TimeseriesGroupVerticalResponseJSON `json:"-"`
+}
+
+// attackLayer7TimeseriesGroupVerticalResponseJSON contains the JSON metadata for
+// the struct [AttackLayer7TimeseriesGroupVerticalResponse]
+type attackLayer7TimeseriesGroupVerticalResponseJSON struct {
+ Meta apijson.Field
+ Serie0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7TimeseriesGroupVerticalResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TimeseriesGroupVerticalResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7TimeseriesGroupVerticalResponseSerie0 struct {
+ Timestamps []string `json:"timestamps,required"`
+ ExtraFields map[string][]string `json:"-,extras"`
+ JSON attackLayer7TimeseriesGroupVerticalResponseSerie0JSON `json:"-"`
+}
+
+// attackLayer7TimeseriesGroupVerticalResponseSerie0JSON contains the JSON metadata
+// for the struct [AttackLayer7TimeseriesGroupVerticalResponseSerie0]
+type attackLayer7TimeseriesGroupVerticalResponseSerie0JSON struct {
+ Timestamps apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7TimeseriesGroupVerticalResponseSerie0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TimeseriesGroupVerticalResponseSerie0JSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7TimeseriesGroupGetParams struct {
+ // Aggregation interval results should be returned in (for example, in 15 minutes
+ // or 1 hour intervals). Refer to
+ // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+ AggInterval param.Field[AttackLayer7TimeseriesGroupGetParamsAggInterval] `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"`
+ // 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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]AttackLayer7TimeseriesGroupGetParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Format results are returned in.
+ Format param.Field[AttackLayer7TimeseriesGroupGetParamsFormat] `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"`
+}
+
+// URLQuery serializes [AttackLayer7TimeseriesGroupGetParams]'s query parameters as
+// `url.Values`.
+func (r AttackLayer7TimeseriesGroupGetParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Aggregation interval results should be returned in (for example, in 15 minutes
+// or 1 hour intervals). Refer to
+// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+type AttackLayer7TimeseriesGroupGetParamsAggInterval string
+
+const (
+ AttackLayer7TimeseriesGroupGetParamsAggInterval15m AttackLayer7TimeseriesGroupGetParamsAggInterval = "15m"
+ AttackLayer7TimeseriesGroupGetParamsAggInterval1h AttackLayer7TimeseriesGroupGetParamsAggInterval = "1h"
+ AttackLayer7TimeseriesGroupGetParamsAggInterval1d AttackLayer7TimeseriesGroupGetParamsAggInterval = "1d"
+ AttackLayer7TimeseriesGroupGetParamsAggInterval1w AttackLayer7TimeseriesGroupGetParamsAggInterval = "1w"
+)
+
+type AttackLayer7TimeseriesGroupGetParamsDateRange string
+
+const (
+ AttackLayer7TimeseriesGroupGetParamsDateRange1d AttackLayer7TimeseriesGroupGetParamsDateRange = "1d"
+ AttackLayer7TimeseriesGroupGetParamsDateRange2d AttackLayer7TimeseriesGroupGetParamsDateRange = "2d"
+ AttackLayer7TimeseriesGroupGetParamsDateRange7d AttackLayer7TimeseriesGroupGetParamsDateRange = "7d"
+ AttackLayer7TimeseriesGroupGetParamsDateRange14d AttackLayer7TimeseriesGroupGetParamsDateRange = "14d"
+ AttackLayer7TimeseriesGroupGetParamsDateRange28d AttackLayer7TimeseriesGroupGetParamsDateRange = "28d"
+ AttackLayer7TimeseriesGroupGetParamsDateRange12w AttackLayer7TimeseriesGroupGetParamsDateRange = "12w"
+ AttackLayer7TimeseriesGroupGetParamsDateRange24w AttackLayer7TimeseriesGroupGetParamsDateRange = "24w"
+ AttackLayer7TimeseriesGroupGetParamsDateRange52w AttackLayer7TimeseriesGroupGetParamsDateRange = "52w"
+ AttackLayer7TimeseriesGroupGetParamsDateRange1dControl AttackLayer7TimeseriesGroupGetParamsDateRange = "1dControl"
+ AttackLayer7TimeseriesGroupGetParamsDateRange2dControl AttackLayer7TimeseriesGroupGetParamsDateRange = "2dControl"
+ AttackLayer7TimeseriesGroupGetParamsDateRange7dControl AttackLayer7TimeseriesGroupGetParamsDateRange = "7dControl"
+ AttackLayer7TimeseriesGroupGetParamsDateRange14dControl AttackLayer7TimeseriesGroupGetParamsDateRange = "14dControl"
+ AttackLayer7TimeseriesGroupGetParamsDateRange28dControl AttackLayer7TimeseriesGroupGetParamsDateRange = "28dControl"
+ AttackLayer7TimeseriesGroupGetParamsDateRange12wControl AttackLayer7TimeseriesGroupGetParamsDateRange = "12wControl"
+ AttackLayer7TimeseriesGroupGetParamsDateRange24wControl AttackLayer7TimeseriesGroupGetParamsDateRange = "24wControl"
+)
+
+// Format results are returned in.
+type AttackLayer7TimeseriesGroupGetParamsFormat string
+
+const (
+ AttackLayer7TimeseriesGroupGetParamsFormatJson AttackLayer7TimeseriesGroupGetParamsFormat = "JSON"
+ AttackLayer7TimeseriesGroupGetParamsFormatCsv AttackLayer7TimeseriesGroupGetParamsFormat = "CSV"
+)
+
+type AttackLayer7TimeseriesGroupGetResponseEnvelope struct {
+ Result AttackLayer7TimeseriesGroupGetResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON attackLayer7TimeseriesGroupGetResponseEnvelopeJSON `json:"-"`
+}
+
+// attackLayer7TimeseriesGroupGetResponseEnvelopeJSON contains the JSON metadata
+// for the struct [AttackLayer7TimeseriesGroupGetResponseEnvelope]
+type attackLayer7TimeseriesGroupGetResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7TimeseriesGroupGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TimeseriesGroupGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7TimeseriesGroupHTTPMethodParams struct {
+ // Aggregation interval results should be returned in (for example, in 15 minutes
+ // or 1 hour intervals). Refer to
+ // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+ AggInterval param.Field[AttackLayer7TimeseriesGroupHTTPMethodParamsAggInterval] `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"`
+ // 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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]AttackLayer7TimeseriesGroupHTTPMethodParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Format results are returned in.
+ Format param.Field[AttackLayer7TimeseriesGroupHTTPMethodParamsFormat] `query:"format"`
+ // Filter for http version.
+ HTTPVersion param.Field[[]AttackLayer7TimeseriesGroupHTTPMethodParamsHTTPVersion] `query:"httpVersion"`
+ // Filter for ip version.
+ IPVersion param.Field[[]AttackLayer7TimeseriesGroupHTTPMethodParamsIPVersion] `query:"ipVersion"`
+ // 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 L7 mitigation products.
+ MitigationProduct param.Field[[]AttackLayer7TimeseriesGroupHTTPMethodParamsMitigationProduct] `query:"mitigationProduct"`
+ // Array of names that will be used to name the series in responses.
+ Name param.Field[[]string] `query:"name"`
+ // Normalization method applied. Refer to
+ // [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/).
+ Normalization param.Field[AttackLayer7TimeseriesGroupHTTPMethodParamsNormalization] `query:"normalization"`
+}
+
+// URLQuery serializes [AttackLayer7TimeseriesGroupHTTPMethodParams]'s query
+// parameters as `url.Values`.
+func (r AttackLayer7TimeseriesGroupHTTPMethodParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Aggregation interval results should be returned in (for example, in 15 minutes
+// or 1 hour intervals). Refer to
+// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+type AttackLayer7TimeseriesGroupHTTPMethodParamsAggInterval string
+
+const (
+ AttackLayer7TimeseriesGroupHTTPMethodParamsAggInterval15m AttackLayer7TimeseriesGroupHTTPMethodParamsAggInterval = "15m"
+ AttackLayer7TimeseriesGroupHTTPMethodParamsAggInterval1h AttackLayer7TimeseriesGroupHTTPMethodParamsAggInterval = "1h"
+ AttackLayer7TimeseriesGroupHTTPMethodParamsAggInterval1d AttackLayer7TimeseriesGroupHTTPMethodParamsAggInterval = "1d"
+ AttackLayer7TimeseriesGroupHTTPMethodParamsAggInterval1w AttackLayer7TimeseriesGroupHTTPMethodParamsAggInterval = "1w"
+)
+
+type AttackLayer7TimeseriesGroupHTTPMethodParamsDateRange string
+
+const (
+ AttackLayer7TimeseriesGroupHTTPMethodParamsDateRange1d AttackLayer7TimeseriesGroupHTTPMethodParamsDateRange = "1d"
+ AttackLayer7TimeseriesGroupHTTPMethodParamsDateRange2d AttackLayer7TimeseriesGroupHTTPMethodParamsDateRange = "2d"
+ AttackLayer7TimeseriesGroupHTTPMethodParamsDateRange7d AttackLayer7TimeseriesGroupHTTPMethodParamsDateRange = "7d"
+ AttackLayer7TimeseriesGroupHTTPMethodParamsDateRange14d AttackLayer7TimeseriesGroupHTTPMethodParamsDateRange = "14d"
+ AttackLayer7TimeseriesGroupHTTPMethodParamsDateRange28d AttackLayer7TimeseriesGroupHTTPMethodParamsDateRange = "28d"
+ AttackLayer7TimeseriesGroupHTTPMethodParamsDateRange12w AttackLayer7TimeseriesGroupHTTPMethodParamsDateRange = "12w"
+ AttackLayer7TimeseriesGroupHTTPMethodParamsDateRange24w AttackLayer7TimeseriesGroupHTTPMethodParamsDateRange = "24w"
+ AttackLayer7TimeseriesGroupHTTPMethodParamsDateRange52w AttackLayer7TimeseriesGroupHTTPMethodParamsDateRange = "52w"
+ AttackLayer7TimeseriesGroupHTTPMethodParamsDateRange1dControl AttackLayer7TimeseriesGroupHTTPMethodParamsDateRange = "1dControl"
+ AttackLayer7TimeseriesGroupHTTPMethodParamsDateRange2dControl AttackLayer7TimeseriesGroupHTTPMethodParamsDateRange = "2dControl"
+ AttackLayer7TimeseriesGroupHTTPMethodParamsDateRange7dControl AttackLayer7TimeseriesGroupHTTPMethodParamsDateRange = "7dControl"
+ AttackLayer7TimeseriesGroupHTTPMethodParamsDateRange14dControl AttackLayer7TimeseriesGroupHTTPMethodParamsDateRange = "14dControl"
+ AttackLayer7TimeseriesGroupHTTPMethodParamsDateRange28dControl AttackLayer7TimeseriesGroupHTTPMethodParamsDateRange = "28dControl"
+ AttackLayer7TimeseriesGroupHTTPMethodParamsDateRange12wControl AttackLayer7TimeseriesGroupHTTPMethodParamsDateRange = "12wControl"
+ AttackLayer7TimeseriesGroupHTTPMethodParamsDateRange24wControl AttackLayer7TimeseriesGroupHTTPMethodParamsDateRange = "24wControl"
+)
+
+// Format results are returned in.
+type AttackLayer7TimeseriesGroupHTTPMethodParamsFormat string
+
+const (
+ AttackLayer7TimeseriesGroupHTTPMethodParamsFormatJson AttackLayer7TimeseriesGroupHTTPMethodParamsFormat = "JSON"
+ AttackLayer7TimeseriesGroupHTTPMethodParamsFormatCsv AttackLayer7TimeseriesGroupHTTPMethodParamsFormat = "CSV"
+)
+
+type AttackLayer7TimeseriesGroupHTTPMethodParamsHTTPVersion string
+
+const (
+ AttackLayer7TimeseriesGroupHTTPMethodParamsHTTPVersionHttPv1 AttackLayer7TimeseriesGroupHTTPMethodParamsHTTPVersion = "HTTPv1"
+ AttackLayer7TimeseriesGroupHTTPMethodParamsHTTPVersionHttPv2 AttackLayer7TimeseriesGroupHTTPMethodParamsHTTPVersion = "HTTPv2"
+ AttackLayer7TimeseriesGroupHTTPMethodParamsHTTPVersionHttPv3 AttackLayer7TimeseriesGroupHTTPMethodParamsHTTPVersion = "HTTPv3"
+)
+
+type AttackLayer7TimeseriesGroupHTTPMethodParamsIPVersion string
+
+const (
+ AttackLayer7TimeseriesGroupHTTPMethodParamsIPVersionIPv4 AttackLayer7TimeseriesGroupHTTPMethodParamsIPVersion = "IPv4"
+ AttackLayer7TimeseriesGroupHTTPMethodParamsIPVersionIPv6 AttackLayer7TimeseriesGroupHTTPMethodParamsIPVersion = "IPv6"
+)
+
+type AttackLayer7TimeseriesGroupHTTPMethodParamsMitigationProduct string
+
+const (
+ AttackLayer7TimeseriesGroupHTTPMethodParamsMitigationProductDDOS AttackLayer7TimeseriesGroupHTTPMethodParamsMitigationProduct = "DDOS"
+ AttackLayer7TimeseriesGroupHTTPMethodParamsMitigationProductWAF AttackLayer7TimeseriesGroupHTTPMethodParamsMitigationProduct = "WAF"
+ AttackLayer7TimeseriesGroupHTTPMethodParamsMitigationProductBotManagement AttackLayer7TimeseriesGroupHTTPMethodParamsMitigationProduct = "BOT_MANAGEMENT"
+ AttackLayer7TimeseriesGroupHTTPMethodParamsMitigationProductAccessRules AttackLayer7TimeseriesGroupHTTPMethodParamsMitigationProduct = "ACCESS_RULES"
+ AttackLayer7TimeseriesGroupHTTPMethodParamsMitigationProductIPReputation AttackLayer7TimeseriesGroupHTTPMethodParamsMitigationProduct = "IP_REPUTATION"
+ AttackLayer7TimeseriesGroupHTTPMethodParamsMitigationProductAPIShield AttackLayer7TimeseriesGroupHTTPMethodParamsMitigationProduct = "API_SHIELD"
+ AttackLayer7TimeseriesGroupHTTPMethodParamsMitigationProductDataLossPrevention AttackLayer7TimeseriesGroupHTTPMethodParamsMitigationProduct = "DATA_LOSS_PREVENTION"
+)
+
+// Normalization method applied. Refer to
+// [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/).
+type AttackLayer7TimeseriesGroupHTTPMethodParamsNormalization string
+
+const (
+ AttackLayer7TimeseriesGroupHTTPMethodParamsNormalizationPercentage AttackLayer7TimeseriesGroupHTTPMethodParamsNormalization = "PERCENTAGE"
+ AttackLayer7TimeseriesGroupHTTPMethodParamsNormalizationMin0Max AttackLayer7TimeseriesGroupHTTPMethodParamsNormalization = "MIN0_MAX"
+)
+
+type AttackLayer7TimeseriesGroupHTTPMethodResponseEnvelope struct {
+ Result AttackLayer7TimeseriesGroupHTTPMethodResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON attackLayer7TimeseriesGroupHTTPMethodResponseEnvelopeJSON `json:"-"`
+}
+
+// attackLayer7TimeseriesGroupHTTPMethodResponseEnvelopeJSON contains the JSON
+// metadata for the struct [AttackLayer7TimeseriesGroupHTTPMethodResponseEnvelope]
+type attackLayer7TimeseriesGroupHTTPMethodResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7TimeseriesGroupHTTPMethodResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TimeseriesGroupHTTPMethodResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7TimeseriesGroupHTTPVersionParams struct {
+ // Aggregation interval results should be returned in (for example, in 15 minutes
+ // or 1 hour intervals). Refer to
+ // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+ AggInterval param.Field[AttackLayer7TimeseriesGroupHTTPVersionParamsAggInterval] `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"`
+ // 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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]AttackLayer7TimeseriesGroupHTTPVersionParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Format results are returned in.
+ Format param.Field[AttackLayer7TimeseriesGroupHTTPVersionParamsFormat] `query:"format"`
+ // Filter for http method.
+ HTTPMethod param.Field[[]AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod] `query:"httpMethod"`
+ // Filter for ip version.
+ IPVersion param.Field[[]AttackLayer7TimeseriesGroupHTTPVersionParamsIPVersion] `query:"ipVersion"`
+ // 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 L7 mitigation products.
+ MitigationProduct param.Field[[]AttackLayer7TimeseriesGroupHTTPVersionParamsMitigationProduct] `query:"mitigationProduct"`
+ // Array of names that will be used to name the series in responses.
+ Name param.Field[[]string] `query:"name"`
+ // Normalization method applied. Refer to
+ // [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/).
+ Normalization param.Field[AttackLayer7TimeseriesGroupHTTPVersionParamsNormalization] `query:"normalization"`
+}
+
+// URLQuery serializes [AttackLayer7TimeseriesGroupHTTPVersionParams]'s query
+// parameters as `url.Values`.
+func (r AttackLayer7TimeseriesGroupHTTPVersionParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Aggregation interval results should be returned in (for example, in 15 minutes
+// or 1 hour intervals). Refer to
+// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+type AttackLayer7TimeseriesGroupHTTPVersionParamsAggInterval string
+
+const (
+ AttackLayer7TimeseriesGroupHTTPVersionParamsAggInterval15m AttackLayer7TimeseriesGroupHTTPVersionParamsAggInterval = "15m"
+ AttackLayer7TimeseriesGroupHTTPVersionParamsAggInterval1h AttackLayer7TimeseriesGroupHTTPVersionParamsAggInterval = "1h"
+ AttackLayer7TimeseriesGroupHTTPVersionParamsAggInterval1d AttackLayer7TimeseriesGroupHTTPVersionParamsAggInterval = "1d"
+ AttackLayer7TimeseriesGroupHTTPVersionParamsAggInterval1w AttackLayer7TimeseriesGroupHTTPVersionParamsAggInterval = "1w"
+)
+
+type AttackLayer7TimeseriesGroupHTTPVersionParamsDateRange string
+
+const (
+ AttackLayer7TimeseriesGroupHTTPVersionParamsDateRange1d AttackLayer7TimeseriesGroupHTTPVersionParamsDateRange = "1d"
+ AttackLayer7TimeseriesGroupHTTPVersionParamsDateRange2d AttackLayer7TimeseriesGroupHTTPVersionParamsDateRange = "2d"
+ AttackLayer7TimeseriesGroupHTTPVersionParamsDateRange7d AttackLayer7TimeseriesGroupHTTPVersionParamsDateRange = "7d"
+ AttackLayer7TimeseriesGroupHTTPVersionParamsDateRange14d AttackLayer7TimeseriesGroupHTTPVersionParamsDateRange = "14d"
+ AttackLayer7TimeseriesGroupHTTPVersionParamsDateRange28d AttackLayer7TimeseriesGroupHTTPVersionParamsDateRange = "28d"
+ AttackLayer7TimeseriesGroupHTTPVersionParamsDateRange12w AttackLayer7TimeseriesGroupHTTPVersionParamsDateRange = "12w"
+ AttackLayer7TimeseriesGroupHTTPVersionParamsDateRange24w AttackLayer7TimeseriesGroupHTTPVersionParamsDateRange = "24w"
+ AttackLayer7TimeseriesGroupHTTPVersionParamsDateRange52w AttackLayer7TimeseriesGroupHTTPVersionParamsDateRange = "52w"
+ AttackLayer7TimeseriesGroupHTTPVersionParamsDateRange1dControl AttackLayer7TimeseriesGroupHTTPVersionParamsDateRange = "1dControl"
+ AttackLayer7TimeseriesGroupHTTPVersionParamsDateRange2dControl AttackLayer7TimeseriesGroupHTTPVersionParamsDateRange = "2dControl"
+ AttackLayer7TimeseriesGroupHTTPVersionParamsDateRange7dControl AttackLayer7TimeseriesGroupHTTPVersionParamsDateRange = "7dControl"
+ AttackLayer7TimeseriesGroupHTTPVersionParamsDateRange14dControl AttackLayer7TimeseriesGroupHTTPVersionParamsDateRange = "14dControl"
+ AttackLayer7TimeseriesGroupHTTPVersionParamsDateRange28dControl AttackLayer7TimeseriesGroupHTTPVersionParamsDateRange = "28dControl"
+ AttackLayer7TimeseriesGroupHTTPVersionParamsDateRange12wControl AttackLayer7TimeseriesGroupHTTPVersionParamsDateRange = "12wControl"
+ AttackLayer7TimeseriesGroupHTTPVersionParamsDateRange24wControl AttackLayer7TimeseriesGroupHTTPVersionParamsDateRange = "24wControl"
+)
+
+// Format results are returned in.
+type AttackLayer7TimeseriesGroupHTTPVersionParamsFormat string
+
+const (
+ AttackLayer7TimeseriesGroupHTTPVersionParamsFormatJson AttackLayer7TimeseriesGroupHTTPVersionParamsFormat = "JSON"
+ AttackLayer7TimeseriesGroupHTTPVersionParamsFormatCsv AttackLayer7TimeseriesGroupHTTPVersionParamsFormat = "CSV"
+)
+
+type AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod string
+
+const (
+ AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodGet AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "GET"
+ AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodPost AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "POST"
+ AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodDelete AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "DELETE"
+ AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodPut AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "PUT"
+ AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodHead AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "HEAD"
+ AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodPurge AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "PURGE"
+ AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodOptions AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "OPTIONS"
+ AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodPropfind AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "PROPFIND"
+ AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodMkcol AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "MKCOL"
+ AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodPatch AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "PATCH"
+ AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodACL AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "ACL"
+ AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodBcopy AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "BCOPY"
+ AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodBdelete AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "BDELETE"
+ AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodBmove AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "BMOVE"
+ AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodBpropfind AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "BPROPFIND"
+ AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodBproppatch AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "BPROPPATCH"
+ AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodCheckin AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "CHECKIN"
+ AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodCheckout AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "CHECKOUT"
+ AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodConnect AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "CONNECT"
+ AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodCopy AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "COPY"
+ AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodLabel AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "LABEL"
+ AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodLock AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "LOCK"
+ AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodMerge AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "MERGE"
+ AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodMkactivity AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "MKACTIVITY"
+ AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodMkworkspace AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "MKWORKSPACE"
+ AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodMove AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "MOVE"
+ AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodNotify AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "NOTIFY"
+ AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodOrderpatch AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "ORDERPATCH"
+ AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodPoll AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "POLL"
+ AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodProppatch AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "PROPPATCH"
+ AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodReport AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "REPORT"
+ AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodSearch AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "SEARCH"
+ AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodSubscribe AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "SUBSCRIBE"
+ AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodTrace AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "TRACE"
+ AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodUncheckout AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "UNCHECKOUT"
+ AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodUnlock AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "UNLOCK"
+ AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodUnsubscribe AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "UNSUBSCRIBE"
+ AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodUpdate AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "UPDATE"
+ AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodVersioncontrol AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "VERSIONCONTROL"
+ AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodBaselinecontrol AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "BASELINECONTROL"
+ AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodXmsenumatts AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "XMSENUMATTS"
+ AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodRpcOutData AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "RPC_OUT_DATA"
+ AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodRpcInData AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "RPC_IN_DATA"
+ AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodJson AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "JSON"
+ AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodCook AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "COOK"
+ AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodTrack AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "TRACK"
+)
+
+type AttackLayer7TimeseriesGroupHTTPVersionParamsIPVersion string
+
+const (
+ AttackLayer7TimeseriesGroupHTTPVersionParamsIPVersionIPv4 AttackLayer7TimeseriesGroupHTTPVersionParamsIPVersion = "IPv4"
+ AttackLayer7TimeseriesGroupHTTPVersionParamsIPVersionIPv6 AttackLayer7TimeseriesGroupHTTPVersionParamsIPVersion = "IPv6"
+)
+
+type AttackLayer7TimeseriesGroupHTTPVersionParamsMitigationProduct string
+
+const (
+ AttackLayer7TimeseriesGroupHTTPVersionParamsMitigationProductDDOS AttackLayer7TimeseriesGroupHTTPVersionParamsMitigationProduct = "DDOS"
+ AttackLayer7TimeseriesGroupHTTPVersionParamsMitigationProductWAF AttackLayer7TimeseriesGroupHTTPVersionParamsMitigationProduct = "WAF"
+ AttackLayer7TimeseriesGroupHTTPVersionParamsMitigationProductBotManagement AttackLayer7TimeseriesGroupHTTPVersionParamsMitigationProduct = "BOT_MANAGEMENT"
+ AttackLayer7TimeseriesGroupHTTPVersionParamsMitigationProductAccessRules AttackLayer7TimeseriesGroupHTTPVersionParamsMitigationProduct = "ACCESS_RULES"
+ AttackLayer7TimeseriesGroupHTTPVersionParamsMitigationProductIPReputation AttackLayer7TimeseriesGroupHTTPVersionParamsMitigationProduct = "IP_REPUTATION"
+ AttackLayer7TimeseriesGroupHTTPVersionParamsMitigationProductAPIShield AttackLayer7TimeseriesGroupHTTPVersionParamsMitigationProduct = "API_SHIELD"
+ AttackLayer7TimeseriesGroupHTTPVersionParamsMitigationProductDataLossPrevention AttackLayer7TimeseriesGroupHTTPVersionParamsMitigationProduct = "DATA_LOSS_PREVENTION"
+)
+
+// Normalization method applied. Refer to
+// [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/).
+type AttackLayer7TimeseriesGroupHTTPVersionParamsNormalization string
+
+const (
+ AttackLayer7TimeseriesGroupHTTPVersionParamsNormalizationPercentage AttackLayer7TimeseriesGroupHTTPVersionParamsNormalization = "PERCENTAGE"
+ AttackLayer7TimeseriesGroupHTTPVersionParamsNormalizationMin0Max AttackLayer7TimeseriesGroupHTTPVersionParamsNormalization = "MIN0_MAX"
+)
+
+type AttackLayer7TimeseriesGroupHTTPVersionResponseEnvelope struct {
+ Result AttackLayer7TimeseriesGroupHTTPVersionResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON attackLayer7TimeseriesGroupHTTPVersionResponseEnvelopeJSON `json:"-"`
+}
+
+// attackLayer7TimeseriesGroupHTTPVersionResponseEnvelopeJSON contains the JSON
+// metadata for the struct [AttackLayer7TimeseriesGroupHTTPVersionResponseEnvelope]
+type attackLayer7TimeseriesGroupHTTPVersionResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7TimeseriesGroupHTTPVersionResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TimeseriesGroupHTTPVersionResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7TimeseriesGroupIndustryParams struct {
+ // Aggregation interval results should be returned in (for example, in 15 minutes
+ // or 1 hour intervals). Refer to
+ // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+ AggInterval param.Field[AttackLayer7TimeseriesGroupIndustryParamsAggInterval] `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"`
+ // 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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]AttackLayer7TimeseriesGroupIndustryParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Format results are returned in.
+ Format param.Field[AttackLayer7TimeseriesGroupIndustryParamsFormat] `query:"format"`
+ // Filter for http method.
+ HTTPMethod param.Field[[]AttackLayer7TimeseriesGroupIndustryParamsHTTPMethod] `query:"httpMethod"`
+ // Filter for http version.
+ HTTPVersion param.Field[[]AttackLayer7TimeseriesGroupIndustryParamsHTTPVersion] `query:"httpVersion"`
+ // Filter for ip version.
+ IPVersion param.Field[[]AttackLayer7TimeseriesGroupIndustryParamsIPVersion] `query:"ipVersion"`
+ // Limit the number of objects (eg browsers, verticals, etc) to the top items over
+ // the time range.
+ LimitPerGroup param.Field[int64] `query:"limitPerGroup"`
+ // Array of comma separated list of locations (alpha-2 country codes). Start with
+ // `-` to exclude from results. For example, `-US,PT` excludes results from the US,
+ // but includes results from PT.
+ Location param.Field[[]string] `query:"location"`
+ // Array of L7 mitigation products.
+ MitigationProduct param.Field[[]AttackLayer7TimeseriesGroupIndustryParamsMitigationProduct] `query:"mitigationProduct"`
+ // Array of names that will be used to name the series in responses.
+ Name param.Field[[]string] `query:"name"`
+ // Normalization method applied. Refer to
+ // [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/).
+ Normalization param.Field[AttackLayer7TimeseriesGroupIndustryParamsNormalization] `query:"normalization"`
+}
+
+// URLQuery serializes [AttackLayer7TimeseriesGroupIndustryParams]'s query
+// parameters as `url.Values`.
+func (r AttackLayer7TimeseriesGroupIndustryParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Aggregation interval results should be returned in (for example, in 15 minutes
+// or 1 hour intervals). Refer to
+// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+type AttackLayer7TimeseriesGroupIndustryParamsAggInterval string
+
+const (
+ AttackLayer7TimeseriesGroupIndustryParamsAggInterval15m AttackLayer7TimeseriesGroupIndustryParamsAggInterval = "15m"
+ AttackLayer7TimeseriesGroupIndustryParamsAggInterval1h AttackLayer7TimeseriesGroupIndustryParamsAggInterval = "1h"
+ AttackLayer7TimeseriesGroupIndustryParamsAggInterval1d AttackLayer7TimeseriesGroupIndustryParamsAggInterval = "1d"
+ AttackLayer7TimeseriesGroupIndustryParamsAggInterval1w AttackLayer7TimeseriesGroupIndustryParamsAggInterval = "1w"
+)
+
+type AttackLayer7TimeseriesGroupIndustryParamsDateRange string
+
+const (
+ AttackLayer7TimeseriesGroupIndustryParamsDateRange1d AttackLayer7TimeseriesGroupIndustryParamsDateRange = "1d"
+ AttackLayer7TimeseriesGroupIndustryParamsDateRange2d AttackLayer7TimeseriesGroupIndustryParamsDateRange = "2d"
+ AttackLayer7TimeseriesGroupIndustryParamsDateRange7d AttackLayer7TimeseriesGroupIndustryParamsDateRange = "7d"
+ AttackLayer7TimeseriesGroupIndustryParamsDateRange14d AttackLayer7TimeseriesGroupIndustryParamsDateRange = "14d"
+ AttackLayer7TimeseriesGroupIndustryParamsDateRange28d AttackLayer7TimeseriesGroupIndustryParamsDateRange = "28d"
+ AttackLayer7TimeseriesGroupIndustryParamsDateRange12w AttackLayer7TimeseriesGroupIndustryParamsDateRange = "12w"
+ AttackLayer7TimeseriesGroupIndustryParamsDateRange24w AttackLayer7TimeseriesGroupIndustryParamsDateRange = "24w"
+ AttackLayer7TimeseriesGroupIndustryParamsDateRange52w AttackLayer7TimeseriesGroupIndustryParamsDateRange = "52w"
+ AttackLayer7TimeseriesGroupIndustryParamsDateRange1dControl AttackLayer7TimeseriesGroupIndustryParamsDateRange = "1dControl"
+ AttackLayer7TimeseriesGroupIndustryParamsDateRange2dControl AttackLayer7TimeseriesGroupIndustryParamsDateRange = "2dControl"
+ AttackLayer7TimeseriesGroupIndustryParamsDateRange7dControl AttackLayer7TimeseriesGroupIndustryParamsDateRange = "7dControl"
+ AttackLayer7TimeseriesGroupIndustryParamsDateRange14dControl AttackLayer7TimeseriesGroupIndustryParamsDateRange = "14dControl"
+ AttackLayer7TimeseriesGroupIndustryParamsDateRange28dControl AttackLayer7TimeseriesGroupIndustryParamsDateRange = "28dControl"
+ AttackLayer7TimeseriesGroupIndustryParamsDateRange12wControl AttackLayer7TimeseriesGroupIndustryParamsDateRange = "12wControl"
+ AttackLayer7TimeseriesGroupIndustryParamsDateRange24wControl AttackLayer7TimeseriesGroupIndustryParamsDateRange = "24wControl"
+)
+
+// Format results are returned in.
+type AttackLayer7TimeseriesGroupIndustryParamsFormat string
+
+const (
+ AttackLayer7TimeseriesGroupIndustryParamsFormatJson AttackLayer7TimeseriesGroupIndustryParamsFormat = "JSON"
+ AttackLayer7TimeseriesGroupIndustryParamsFormatCsv AttackLayer7TimeseriesGroupIndustryParamsFormat = "CSV"
+)
+
+type AttackLayer7TimeseriesGroupIndustryParamsHTTPMethod string
+
+const (
+ AttackLayer7TimeseriesGroupIndustryParamsHTTPMethodGet AttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "GET"
+ AttackLayer7TimeseriesGroupIndustryParamsHTTPMethodPost AttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "POST"
+ AttackLayer7TimeseriesGroupIndustryParamsHTTPMethodDelete AttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "DELETE"
+ AttackLayer7TimeseriesGroupIndustryParamsHTTPMethodPut AttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "PUT"
+ AttackLayer7TimeseriesGroupIndustryParamsHTTPMethodHead AttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "HEAD"
+ AttackLayer7TimeseriesGroupIndustryParamsHTTPMethodPurge AttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "PURGE"
+ AttackLayer7TimeseriesGroupIndustryParamsHTTPMethodOptions AttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "OPTIONS"
+ AttackLayer7TimeseriesGroupIndustryParamsHTTPMethodPropfind AttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "PROPFIND"
+ AttackLayer7TimeseriesGroupIndustryParamsHTTPMethodMkcol AttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "MKCOL"
+ AttackLayer7TimeseriesGroupIndustryParamsHTTPMethodPatch AttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "PATCH"
+ AttackLayer7TimeseriesGroupIndustryParamsHTTPMethodACL AttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "ACL"
+ AttackLayer7TimeseriesGroupIndustryParamsHTTPMethodBcopy AttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "BCOPY"
+ AttackLayer7TimeseriesGroupIndustryParamsHTTPMethodBdelete AttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "BDELETE"
+ AttackLayer7TimeseriesGroupIndustryParamsHTTPMethodBmove AttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "BMOVE"
+ AttackLayer7TimeseriesGroupIndustryParamsHTTPMethodBpropfind AttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "BPROPFIND"
+ AttackLayer7TimeseriesGroupIndustryParamsHTTPMethodBproppatch AttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "BPROPPATCH"
+ AttackLayer7TimeseriesGroupIndustryParamsHTTPMethodCheckin AttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "CHECKIN"
+ AttackLayer7TimeseriesGroupIndustryParamsHTTPMethodCheckout AttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "CHECKOUT"
+ AttackLayer7TimeseriesGroupIndustryParamsHTTPMethodConnect AttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "CONNECT"
+ AttackLayer7TimeseriesGroupIndustryParamsHTTPMethodCopy AttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "COPY"
+ AttackLayer7TimeseriesGroupIndustryParamsHTTPMethodLabel AttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "LABEL"
+ AttackLayer7TimeseriesGroupIndustryParamsHTTPMethodLock AttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "LOCK"
+ AttackLayer7TimeseriesGroupIndustryParamsHTTPMethodMerge AttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "MERGE"
+ AttackLayer7TimeseriesGroupIndustryParamsHTTPMethodMkactivity AttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "MKACTIVITY"
+ AttackLayer7TimeseriesGroupIndustryParamsHTTPMethodMkworkspace AttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "MKWORKSPACE"
+ AttackLayer7TimeseriesGroupIndustryParamsHTTPMethodMove AttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "MOVE"
+ AttackLayer7TimeseriesGroupIndustryParamsHTTPMethodNotify AttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "NOTIFY"
+ AttackLayer7TimeseriesGroupIndustryParamsHTTPMethodOrderpatch AttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "ORDERPATCH"
+ AttackLayer7TimeseriesGroupIndustryParamsHTTPMethodPoll AttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "POLL"
+ AttackLayer7TimeseriesGroupIndustryParamsHTTPMethodProppatch AttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "PROPPATCH"
+ AttackLayer7TimeseriesGroupIndustryParamsHTTPMethodReport AttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "REPORT"
+ AttackLayer7TimeseriesGroupIndustryParamsHTTPMethodSearch AttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "SEARCH"
+ AttackLayer7TimeseriesGroupIndustryParamsHTTPMethodSubscribe AttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "SUBSCRIBE"
+ AttackLayer7TimeseriesGroupIndustryParamsHTTPMethodTrace AttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "TRACE"
+ AttackLayer7TimeseriesGroupIndustryParamsHTTPMethodUncheckout AttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "UNCHECKOUT"
+ AttackLayer7TimeseriesGroupIndustryParamsHTTPMethodUnlock AttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "UNLOCK"
+ AttackLayer7TimeseriesGroupIndustryParamsHTTPMethodUnsubscribe AttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "UNSUBSCRIBE"
+ AttackLayer7TimeseriesGroupIndustryParamsHTTPMethodUpdate AttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "UPDATE"
+ AttackLayer7TimeseriesGroupIndustryParamsHTTPMethodVersioncontrol AttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "VERSIONCONTROL"
+ AttackLayer7TimeseriesGroupIndustryParamsHTTPMethodBaselinecontrol AttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "BASELINECONTROL"
+ AttackLayer7TimeseriesGroupIndustryParamsHTTPMethodXmsenumatts AttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "XMSENUMATTS"
+ AttackLayer7TimeseriesGroupIndustryParamsHTTPMethodRpcOutData AttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "RPC_OUT_DATA"
+ AttackLayer7TimeseriesGroupIndustryParamsHTTPMethodRpcInData AttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "RPC_IN_DATA"
+ AttackLayer7TimeseriesGroupIndustryParamsHTTPMethodJson AttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "JSON"
+ AttackLayer7TimeseriesGroupIndustryParamsHTTPMethodCook AttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "COOK"
+ AttackLayer7TimeseriesGroupIndustryParamsHTTPMethodTrack AttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "TRACK"
+)
+
+type AttackLayer7TimeseriesGroupIndustryParamsHTTPVersion string
+
+const (
+ AttackLayer7TimeseriesGroupIndustryParamsHTTPVersionHttPv1 AttackLayer7TimeseriesGroupIndustryParamsHTTPVersion = "HTTPv1"
+ AttackLayer7TimeseriesGroupIndustryParamsHTTPVersionHttPv2 AttackLayer7TimeseriesGroupIndustryParamsHTTPVersion = "HTTPv2"
+ AttackLayer7TimeseriesGroupIndustryParamsHTTPVersionHttPv3 AttackLayer7TimeseriesGroupIndustryParamsHTTPVersion = "HTTPv3"
+)
+
+type AttackLayer7TimeseriesGroupIndustryParamsIPVersion string
+
+const (
+ AttackLayer7TimeseriesGroupIndustryParamsIPVersionIPv4 AttackLayer7TimeseriesGroupIndustryParamsIPVersion = "IPv4"
+ AttackLayer7TimeseriesGroupIndustryParamsIPVersionIPv6 AttackLayer7TimeseriesGroupIndustryParamsIPVersion = "IPv6"
+)
+
+type AttackLayer7TimeseriesGroupIndustryParamsMitigationProduct string
+
+const (
+ AttackLayer7TimeseriesGroupIndustryParamsMitigationProductDDOS AttackLayer7TimeseriesGroupIndustryParamsMitigationProduct = "DDOS"
+ AttackLayer7TimeseriesGroupIndustryParamsMitigationProductWAF AttackLayer7TimeseriesGroupIndustryParamsMitigationProduct = "WAF"
+ AttackLayer7TimeseriesGroupIndustryParamsMitigationProductBotManagement AttackLayer7TimeseriesGroupIndustryParamsMitigationProduct = "BOT_MANAGEMENT"
+ AttackLayer7TimeseriesGroupIndustryParamsMitigationProductAccessRules AttackLayer7TimeseriesGroupIndustryParamsMitigationProduct = "ACCESS_RULES"
+ AttackLayer7TimeseriesGroupIndustryParamsMitigationProductIPReputation AttackLayer7TimeseriesGroupIndustryParamsMitigationProduct = "IP_REPUTATION"
+ AttackLayer7TimeseriesGroupIndustryParamsMitigationProductAPIShield AttackLayer7TimeseriesGroupIndustryParamsMitigationProduct = "API_SHIELD"
+ AttackLayer7TimeseriesGroupIndustryParamsMitigationProductDataLossPrevention AttackLayer7TimeseriesGroupIndustryParamsMitigationProduct = "DATA_LOSS_PREVENTION"
+)
+
+// Normalization method applied. Refer to
+// [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/).
+type AttackLayer7TimeseriesGroupIndustryParamsNormalization string
+
+const (
+ AttackLayer7TimeseriesGroupIndustryParamsNormalizationPercentage AttackLayer7TimeseriesGroupIndustryParamsNormalization = "PERCENTAGE"
+ AttackLayer7TimeseriesGroupIndustryParamsNormalizationMin0Max AttackLayer7TimeseriesGroupIndustryParamsNormalization = "MIN0_MAX"
+)
+
+type AttackLayer7TimeseriesGroupIndustryResponseEnvelope struct {
+ Result AttackLayer7TimeseriesGroupIndustryResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON attackLayer7TimeseriesGroupIndustryResponseEnvelopeJSON `json:"-"`
+}
+
+// attackLayer7TimeseriesGroupIndustryResponseEnvelopeJSON contains the JSON
+// metadata for the struct [AttackLayer7TimeseriesGroupIndustryResponseEnvelope]
+type attackLayer7TimeseriesGroupIndustryResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7TimeseriesGroupIndustryResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TimeseriesGroupIndustryResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7TimeseriesGroupIPVersionParams struct {
+ // Aggregation interval results should be returned in (for example, in 15 minutes
+ // or 1 hour intervals). Refer to
+ // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+ AggInterval param.Field[AttackLayer7TimeseriesGroupIPVersionParamsAggInterval] `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"`
+ // 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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]AttackLayer7TimeseriesGroupIPVersionParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Format results are returned in.
+ Format param.Field[AttackLayer7TimeseriesGroupIPVersionParamsFormat] `query:"format"`
+ // Filter for http method.
+ HTTPMethod param.Field[[]AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod] `query:"httpMethod"`
+ // Filter for http version.
+ HTTPVersion param.Field[[]AttackLayer7TimeseriesGroupIPVersionParamsHTTPVersion] `query:"httpVersion"`
+ // 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 L7 mitigation products.
+ MitigationProduct param.Field[[]AttackLayer7TimeseriesGroupIPVersionParamsMitigationProduct] `query:"mitigationProduct"`
+ // Array of names that will be used to name the series in responses.
+ Name param.Field[[]string] `query:"name"`
+ // Normalization method applied. Refer to
+ // [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/).
+ Normalization param.Field[AttackLayer7TimeseriesGroupIPVersionParamsNormalization] `query:"normalization"`
+}
+
+// URLQuery serializes [AttackLayer7TimeseriesGroupIPVersionParams]'s query
+// parameters as `url.Values`.
+func (r AttackLayer7TimeseriesGroupIPVersionParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Aggregation interval results should be returned in (for example, in 15 minutes
+// or 1 hour intervals). Refer to
+// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+type AttackLayer7TimeseriesGroupIPVersionParamsAggInterval string
+
+const (
+ AttackLayer7TimeseriesGroupIPVersionParamsAggInterval15m AttackLayer7TimeseriesGroupIPVersionParamsAggInterval = "15m"
+ AttackLayer7TimeseriesGroupIPVersionParamsAggInterval1h AttackLayer7TimeseriesGroupIPVersionParamsAggInterval = "1h"
+ AttackLayer7TimeseriesGroupIPVersionParamsAggInterval1d AttackLayer7TimeseriesGroupIPVersionParamsAggInterval = "1d"
+ AttackLayer7TimeseriesGroupIPVersionParamsAggInterval1w AttackLayer7TimeseriesGroupIPVersionParamsAggInterval = "1w"
+)
+
+type AttackLayer7TimeseriesGroupIPVersionParamsDateRange string
+
+const (
+ AttackLayer7TimeseriesGroupIPVersionParamsDateRange1d AttackLayer7TimeseriesGroupIPVersionParamsDateRange = "1d"
+ AttackLayer7TimeseriesGroupIPVersionParamsDateRange2d AttackLayer7TimeseriesGroupIPVersionParamsDateRange = "2d"
+ AttackLayer7TimeseriesGroupIPVersionParamsDateRange7d AttackLayer7TimeseriesGroupIPVersionParamsDateRange = "7d"
+ AttackLayer7TimeseriesGroupIPVersionParamsDateRange14d AttackLayer7TimeseriesGroupIPVersionParamsDateRange = "14d"
+ AttackLayer7TimeseriesGroupIPVersionParamsDateRange28d AttackLayer7TimeseriesGroupIPVersionParamsDateRange = "28d"
+ AttackLayer7TimeseriesGroupIPVersionParamsDateRange12w AttackLayer7TimeseriesGroupIPVersionParamsDateRange = "12w"
+ AttackLayer7TimeseriesGroupIPVersionParamsDateRange24w AttackLayer7TimeseriesGroupIPVersionParamsDateRange = "24w"
+ AttackLayer7TimeseriesGroupIPVersionParamsDateRange52w AttackLayer7TimeseriesGroupIPVersionParamsDateRange = "52w"
+ AttackLayer7TimeseriesGroupIPVersionParamsDateRange1dControl AttackLayer7TimeseriesGroupIPVersionParamsDateRange = "1dControl"
+ AttackLayer7TimeseriesGroupIPVersionParamsDateRange2dControl AttackLayer7TimeseriesGroupIPVersionParamsDateRange = "2dControl"
+ AttackLayer7TimeseriesGroupIPVersionParamsDateRange7dControl AttackLayer7TimeseriesGroupIPVersionParamsDateRange = "7dControl"
+ AttackLayer7TimeseriesGroupIPVersionParamsDateRange14dControl AttackLayer7TimeseriesGroupIPVersionParamsDateRange = "14dControl"
+ AttackLayer7TimeseriesGroupIPVersionParamsDateRange28dControl AttackLayer7TimeseriesGroupIPVersionParamsDateRange = "28dControl"
+ AttackLayer7TimeseriesGroupIPVersionParamsDateRange12wControl AttackLayer7TimeseriesGroupIPVersionParamsDateRange = "12wControl"
+ AttackLayer7TimeseriesGroupIPVersionParamsDateRange24wControl AttackLayer7TimeseriesGroupIPVersionParamsDateRange = "24wControl"
+)
+
+// Format results are returned in.
+type AttackLayer7TimeseriesGroupIPVersionParamsFormat string
+
+const (
+ AttackLayer7TimeseriesGroupIPVersionParamsFormatJson AttackLayer7TimeseriesGroupIPVersionParamsFormat = "JSON"
+ AttackLayer7TimeseriesGroupIPVersionParamsFormatCsv AttackLayer7TimeseriesGroupIPVersionParamsFormat = "CSV"
+)
+
+type AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod string
+
+const (
+ AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodGet AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "GET"
+ AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodPost AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "POST"
+ AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodDelete AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "DELETE"
+ AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodPut AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "PUT"
+ AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodHead AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "HEAD"
+ AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodPurge AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "PURGE"
+ AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodOptions AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "OPTIONS"
+ AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodPropfind AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "PROPFIND"
+ AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodMkcol AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "MKCOL"
+ AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodPatch AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "PATCH"
+ AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodACL AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "ACL"
+ AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodBcopy AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "BCOPY"
+ AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodBdelete AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "BDELETE"
+ AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodBmove AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "BMOVE"
+ AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodBpropfind AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "BPROPFIND"
+ AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodBproppatch AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "BPROPPATCH"
+ AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodCheckin AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "CHECKIN"
+ AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodCheckout AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "CHECKOUT"
+ AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodConnect AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "CONNECT"
+ AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodCopy AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "COPY"
+ AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodLabel AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "LABEL"
+ AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodLock AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "LOCK"
+ AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodMerge AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "MERGE"
+ AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodMkactivity AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "MKACTIVITY"
+ AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodMkworkspace AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "MKWORKSPACE"
+ AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodMove AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "MOVE"
+ AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodNotify AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "NOTIFY"
+ AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodOrderpatch AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "ORDERPATCH"
+ AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodPoll AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "POLL"
+ AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodProppatch AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "PROPPATCH"
+ AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodReport AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "REPORT"
+ AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodSearch AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "SEARCH"
+ AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodSubscribe AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "SUBSCRIBE"
+ AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodTrace AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "TRACE"
+ AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodUncheckout AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "UNCHECKOUT"
+ AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodUnlock AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "UNLOCK"
+ AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodUnsubscribe AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "UNSUBSCRIBE"
+ AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodUpdate AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "UPDATE"
+ AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodVersioncontrol AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "VERSIONCONTROL"
+ AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodBaselinecontrol AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "BASELINECONTROL"
+ AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodXmsenumatts AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "XMSENUMATTS"
+ AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodRpcOutData AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "RPC_OUT_DATA"
+ AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodRpcInData AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "RPC_IN_DATA"
+ AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodJson AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "JSON"
+ AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodCook AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "COOK"
+ AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodTrack AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "TRACK"
+)
+
+type AttackLayer7TimeseriesGroupIPVersionParamsHTTPVersion string
+
+const (
+ AttackLayer7TimeseriesGroupIPVersionParamsHTTPVersionHttPv1 AttackLayer7TimeseriesGroupIPVersionParamsHTTPVersion = "HTTPv1"
+ AttackLayer7TimeseriesGroupIPVersionParamsHTTPVersionHttPv2 AttackLayer7TimeseriesGroupIPVersionParamsHTTPVersion = "HTTPv2"
+ AttackLayer7TimeseriesGroupIPVersionParamsHTTPVersionHttPv3 AttackLayer7TimeseriesGroupIPVersionParamsHTTPVersion = "HTTPv3"
+)
+
+type AttackLayer7TimeseriesGroupIPVersionParamsMitigationProduct string
+
+const (
+ AttackLayer7TimeseriesGroupIPVersionParamsMitigationProductDDOS AttackLayer7TimeseriesGroupIPVersionParamsMitigationProduct = "DDOS"
+ AttackLayer7TimeseriesGroupIPVersionParamsMitigationProductWAF AttackLayer7TimeseriesGroupIPVersionParamsMitigationProduct = "WAF"
+ AttackLayer7TimeseriesGroupIPVersionParamsMitigationProductBotManagement AttackLayer7TimeseriesGroupIPVersionParamsMitigationProduct = "BOT_MANAGEMENT"
+ AttackLayer7TimeseriesGroupIPVersionParamsMitigationProductAccessRules AttackLayer7TimeseriesGroupIPVersionParamsMitigationProduct = "ACCESS_RULES"
+ AttackLayer7TimeseriesGroupIPVersionParamsMitigationProductIPReputation AttackLayer7TimeseriesGroupIPVersionParamsMitigationProduct = "IP_REPUTATION"
+ AttackLayer7TimeseriesGroupIPVersionParamsMitigationProductAPIShield AttackLayer7TimeseriesGroupIPVersionParamsMitigationProduct = "API_SHIELD"
+ AttackLayer7TimeseriesGroupIPVersionParamsMitigationProductDataLossPrevention AttackLayer7TimeseriesGroupIPVersionParamsMitigationProduct = "DATA_LOSS_PREVENTION"
+)
+
+// Normalization method applied. Refer to
+// [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/).
+type AttackLayer7TimeseriesGroupIPVersionParamsNormalization string
+
+const (
+ AttackLayer7TimeseriesGroupIPVersionParamsNormalizationPercentage AttackLayer7TimeseriesGroupIPVersionParamsNormalization = "PERCENTAGE"
+ AttackLayer7TimeseriesGroupIPVersionParamsNormalizationMin0Max AttackLayer7TimeseriesGroupIPVersionParamsNormalization = "MIN0_MAX"
+)
+
+type AttackLayer7TimeseriesGroupIPVersionResponseEnvelope struct {
+ Result AttackLayer7TimeseriesGroupIPVersionResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON attackLayer7TimeseriesGroupIPVersionResponseEnvelopeJSON `json:"-"`
+}
+
+// attackLayer7TimeseriesGroupIPVersionResponseEnvelopeJSON contains the JSON
+// metadata for the struct [AttackLayer7TimeseriesGroupIPVersionResponseEnvelope]
+type attackLayer7TimeseriesGroupIPVersionResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7TimeseriesGroupIPVersionResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TimeseriesGroupIPVersionResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7TimeseriesGroupManagedRulesParams struct {
+ // Aggregation interval results should be returned in (for example, in 15 minutes
+ // or 1 hour intervals). Refer to
+ // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+ AggInterval param.Field[AttackLayer7TimeseriesGroupManagedRulesParamsAggInterval] `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"`
+ // 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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]AttackLayer7TimeseriesGroupManagedRulesParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Format results are returned in.
+ Format param.Field[AttackLayer7TimeseriesGroupManagedRulesParamsFormat] `query:"format"`
+ // Filter for http method.
+ HTTPMethod param.Field[[]AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod] `query:"httpMethod"`
+ // Filter for http version.
+ HTTPVersion param.Field[[]AttackLayer7TimeseriesGroupManagedRulesParamsHTTPVersion] `query:"httpVersion"`
+ // Filter for ip version.
+ IPVersion param.Field[[]AttackLayer7TimeseriesGroupManagedRulesParamsIPVersion] `query:"ipVersion"`
+ // 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 L7 mitigation products.
+ MitigationProduct param.Field[[]AttackLayer7TimeseriesGroupManagedRulesParamsMitigationProduct] `query:"mitigationProduct"`
+ // Array of names that will be used to name the series in responses.
+ Name param.Field[[]string] `query:"name"`
+ // Normalization method applied. Refer to
+ // [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/).
+ Normalization param.Field[AttackLayer7TimeseriesGroupManagedRulesParamsNormalization] `query:"normalization"`
+}
+
+// URLQuery serializes [AttackLayer7TimeseriesGroupManagedRulesParams]'s query
+// parameters as `url.Values`.
+func (r AttackLayer7TimeseriesGroupManagedRulesParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Aggregation interval results should be returned in (for example, in 15 minutes
+// or 1 hour intervals). Refer to
+// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+type AttackLayer7TimeseriesGroupManagedRulesParamsAggInterval string
+
+const (
+ AttackLayer7TimeseriesGroupManagedRulesParamsAggInterval15m AttackLayer7TimeseriesGroupManagedRulesParamsAggInterval = "15m"
+ AttackLayer7TimeseriesGroupManagedRulesParamsAggInterval1h AttackLayer7TimeseriesGroupManagedRulesParamsAggInterval = "1h"
+ AttackLayer7TimeseriesGroupManagedRulesParamsAggInterval1d AttackLayer7TimeseriesGroupManagedRulesParamsAggInterval = "1d"
+ AttackLayer7TimeseriesGroupManagedRulesParamsAggInterval1w AttackLayer7TimeseriesGroupManagedRulesParamsAggInterval = "1w"
+)
+
+type AttackLayer7TimeseriesGroupManagedRulesParamsDateRange string
+
+const (
+ AttackLayer7TimeseriesGroupManagedRulesParamsDateRange1d AttackLayer7TimeseriesGroupManagedRulesParamsDateRange = "1d"
+ AttackLayer7TimeseriesGroupManagedRulesParamsDateRange2d AttackLayer7TimeseriesGroupManagedRulesParamsDateRange = "2d"
+ AttackLayer7TimeseriesGroupManagedRulesParamsDateRange7d AttackLayer7TimeseriesGroupManagedRulesParamsDateRange = "7d"
+ AttackLayer7TimeseriesGroupManagedRulesParamsDateRange14d AttackLayer7TimeseriesGroupManagedRulesParamsDateRange = "14d"
+ AttackLayer7TimeseriesGroupManagedRulesParamsDateRange28d AttackLayer7TimeseriesGroupManagedRulesParamsDateRange = "28d"
+ AttackLayer7TimeseriesGroupManagedRulesParamsDateRange12w AttackLayer7TimeseriesGroupManagedRulesParamsDateRange = "12w"
+ AttackLayer7TimeseriesGroupManagedRulesParamsDateRange24w AttackLayer7TimeseriesGroupManagedRulesParamsDateRange = "24w"
+ AttackLayer7TimeseriesGroupManagedRulesParamsDateRange52w AttackLayer7TimeseriesGroupManagedRulesParamsDateRange = "52w"
+ AttackLayer7TimeseriesGroupManagedRulesParamsDateRange1dControl AttackLayer7TimeseriesGroupManagedRulesParamsDateRange = "1dControl"
+ AttackLayer7TimeseriesGroupManagedRulesParamsDateRange2dControl AttackLayer7TimeseriesGroupManagedRulesParamsDateRange = "2dControl"
+ AttackLayer7TimeseriesGroupManagedRulesParamsDateRange7dControl AttackLayer7TimeseriesGroupManagedRulesParamsDateRange = "7dControl"
+ AttackLayer7TimeseriesGroupManagedRulesParamsDateRange14dControl AttackLayer7TimeseriesGroupManagedRulesParamsDateRange = "14dControl"
+ AttackLayer7TimeseriesGroupManagedRulesParamsDateRange28dControl AttackLayer7TimeseriesGroupManagedRulesParamsDateRange = "28dControl"
+ AttackLayer7TimeseriesGroupManagedRulesParamsDateRange12wControl AttackLayer7TimeseriesGroupManagedRulesParamsDateRange = "12wControl"
+ AttackLayer7TimeseriesGroupManagedRulesParamsDateRange24wControl AttackLayer7TimeseriesGroupManagedRulesParamsDateRange = "24wControl"
+)
+
+// Format results are returned in.
+type AttackLayer7TimeseriesGroupManagedRulesParamsFormat string
+
+const (
+ AttackLayer7TimeseriesGroupManagedRulesParamsFormatJson AttackLayer7TimeseriesGroupManagedRulesParamsFormat = "JSON"
+ AttackLayer7TimeseriesGroupManagedRulesParamsFormatCsv AttackLayer7TimeseriesGroupManagedRulesParamsFormat = "CSV"
+)
+
+type AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod string
+
+const (
+ AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodGet AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "GET"
+ AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodPost AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "POST"
+ AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodDelete AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "DELETE"
+ AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodPut AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "PUT"
+ AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodHead AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "HEAD"
+ AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodPurge AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "PURGE"
+ AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodOptions AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "OPTIONS"
+ AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodPropfind AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "PROPFIND"
+ AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodMkcol AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "MKCOL"
+ AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodPatch AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "PATCH"
+ AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodACL AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "ACL"
+ AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodBcopy AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "BCOPY"
+ AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodBdelete AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "BDELETE"
+ AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodBmove AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "BMOVE"
+ AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodBpropfind AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "BPROPFIND"
+ AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodBproppatch AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "BPROPPATCH"
+ AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodCheckin AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "CHECKIN"
+ AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodCheckout AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "CHECKOUT"
+ AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodConnect AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "CONNECT"
+ AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodCopy AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "COPY"
+ AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodLabel AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "LABEL"
+ AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodLock AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "LOCK"
+ AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodMerge AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "MERGE"
+ AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodMkactivity AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "MKACTIVITY"
+ AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodMkworkspace AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "MKWORKSPACE"
+ AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodMove AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "MOVE"
+ AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodNotify AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "NOTIFY"
+ AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodOrderpatch AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "ORDERPATCH"
+ AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodPoll AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "POLL"
+ AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodProppatch AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "PROPPATCH"
+ AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodReport AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "REPORT"
+ AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodSearch AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "SEARCH"
+ AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodSubscribe AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "SUBSCRIBE"
+ AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodTrace AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "TRACE"
+ AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodUncheckout AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "UNCHECKOUT"
+ AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodUnlock AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "UNLOCK"
+ AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodUnsubscribe AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "UNSUBSCRIBE"
+ AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodUpdate AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "UPDATE"
+ AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodVersioncontrol AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "VERSIONCONTROL"
+ AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodBaselinecontrol AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "BASELINECONTROL"
+ AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodXmsenumatts AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "XMSENUMATTS"
+ AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodRpcOutData AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "RPC_OUT_DATA"
+ AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodRpcInData AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "RPC_IN_DATA"
+ AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodJson AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "JSON"
+ AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodCook AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "COOK"
+ AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodTrack AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "TRACK"
+)
+
+type AttackLayer7TimeseriesGroupManagedRulesParamsHTTPVersion string
+
+const (
+ AttackLayer7TimeseriesGroupManagedRulesParamsHTTPVersionHttPv1 AttackLayer7TimeseriesGroupManagedRulesParamsHTTPVersion = "HTTPv1"
+ AttackLayer7TimeseriesGroupManagedRulesParamsHTTPVersionHttPv2 AttackLayer7TimeseriesGroupManagedRulesParamsHTTPVersion = "HTTPv2"
+ AttackLayer7TimeseriesGroupManagedRulesParamsHTTPVersionHttPv3 AttackLayer7TimeseriesGroupManagedRulesParamsHTTPVersion = "HTTPv3"
+)
+
+type AttackLayer7TimeseriesGroupManagedRulesParamsIPVersion string
+
+const (
+ AttackLayer7TimeseriesGroupManagedRulesParamsIPVersionIPv4 AttackLayer7TimeseriesGroupManagedRulesParamsIPVersion = "IPv4"
+ AttackLayer7TimeseriesGroupManagedRulesParamsIPVersionIPv6 AttackLayer7TimeseriesGroupManagedRulesParamsIPVersion = "IPv6"
+)
+
+type AttackLayer7TimeseriesGroupManagedRulesParamsMitigationProduct string
+
+const (
+ AttackLayer7TimeseriesGroupManagedRulesParamsMitigationProductDDOS AttackLayer7TimeseriesGroupManagedRulesParamsMitigationProduct = "DDOS"
+ AttackLayer7TimeseriesGroupManagedRulesParamsMitigationProductWAF AttackLayer7TimeseriesGroupManagedRulesParamsMitigationProduct = "WAF"
+ AttackLayer7TimeseriesGroupManagedRulesParamsMitigationProductBotManagement AttackLayer7TimeseriesGroupManagedRulesParamsMitigationProduct = "BOT_MANAGEMENT"
+ AttackLayer7TimeseriesGroupManagedRulesParamsMitigationProductAccessRules AttackLayer7TimeseriesGroupManagedRulesParamsMitigationProduct = "ACCESS_RULES"
+ AttackLayer7TimeseriesGroupManagedRulesParamsMitigationProductIPReputation AttackLayer7TimeseriesGroupManagedRulesParamsMitigationProduct = "IP_REPUTATION"
+ AttackLayer7TimeseriesGroupManagedRulesParamsMitigationProductAPIShield AttackLayer7TimeseriesGroupManagedRulesParamsMitigationProduct = "API_SHIELD"
+ AttackLayer7TimeseriesGroupManagedRulesParamsMitigationProductDataLossPrevention AttackLayer7TimeseriesGroupManagedRulesParamsMitigationProduct = "DATA_LOSS_PREVENTION"
+)
+
+// Normalization method applied. Refer to
+// [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/).
+type AttackLayer7TimeseriesGroupManagedRulesParamsNormalization string
+
+const (
+ AttackLayer7TimeseriesGroupManagedRulesParamsNormalizationPercentage AttackLayer7TimeseriesGroupManagedRulesParamsNormalization = "PERCENTAGE"
+ AttackLayer7TimeseriesGroupManagedRulesParamsNormalizationMin0Max AttackLayer7TimeseriesGroupManagedRulesParamsNormalization = "MIN0_MAX"
+)
+
+type AttackLayer7TimeseriesGroupManagedRulesResponseEnvelope struct {
+ Result AttackLayer7TimeseriesGroupManagedRulesResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON attackLayer7TimeseriesGroupManagedRulesResponseEnvelopeJSON `json:"-"`
+}
+
+// attackLayer7TimeseriesGroupManagedRulesResponseEnvelopeJSON contains the JSON
+// metadata for the struct
+// [AttackLayer7TimeseriesGroupManagedRulesResponseEnvelope]
+type attackLayer7TimeseriesGroupManagedRulesResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7TimeseriesGroupManagedRulesResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TimeseriesGroupManagedRulesResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7TimeseriesGroupMitigationProductParams struct {
+ // Aggregation interval results should be returned in (for example, in 15 minutes
+ // or 1 hour intervals). Refer to
+ // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+ AggInterval param.Field[AttackLayer7TimeseriesGroupMitigationProductParamsAggInterval] `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"`
+ // 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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]AttackLayer7TimeseriesGroupMitigationProductParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Format results are returned in.
+ Format param.Field[AttackLayer7TimeseriesGroupMitigationProductParamsFormat] `query:"format"`
+ // Filter for http method.
+ HTTPMethod param.Field[[]AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod] `query:"httpMethod"`
+ // Filter for http version.
+ HTTPVersion param.Field[[]AttackLayer7TimeseriesGroupMitigationProductParamsHTTPVersion] `query:"httpVersion"`
+ // Filter for ip version.
+ IPVersion param.Field[[]AttackLayer7TimeseriesGroupMitigationProductParamsIPVersion] `query:"ipVersion"`
+ // 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"`
+ // Normalization method applied. Refer to
+ // [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/).
+ Normalization param.Field[AttackLayer7TimeseriesGroupMitigationProductParamsNormalization] `query:"normalization"`
+}
+
+// URLQuery serializes [AttackLayer7TimeseriesGroupMitigationProductParams]'s query
+// parameters as `url.Values`.
+func (r AttackLayer7TimeseriesGroupMitigationProductParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Aggregation interval results should be returned in (for example, in 15 minutes
+// or 1 hour intervals). Refer to
+// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+type AttackLayer7TimeseriesGroupMitigationProductParamsAggInterval string
+
+const (
+ AttackLayer7TimeseriesGroupMitigationProductParamsAggInterval15m AttackLayer7TimeseriesGroupMitigationProductParamsAggInterval = "15m"
+ AttackLayer7TimeseriesGroupMitigationProductParamsAggInterval1h AttackLayer7TimeseriesGroupMitigationProductParamsAggInterval = "1h"
+ AttackLayer7TimeseriesGroupMitigationProductParamsAggInterval1d AttackLayer7TimeseriesGroupMitigationProductParamsAggInterval = "1d"
+ AttackLayer7TimeseriesGroupMitigationProductParamsAggInterval1w AttackLayer7TimeseriesGroupMitigationProductParamsAggInterval = "1w"
+)
+
+type AttackLayer7TimeseriesGroupMitigationProductParamsDateRange string
+
+const (
+ AttackLayer7TimeseriesGroupMitigationProductParamsDateRange1d AttackLayer7TimeseriesGroupMitigationProductParamsDateRange = "1d"
+ AttackLayer7TimeseriesGroupMitigationProductParamsDateRange2d AttackLayer7TimeseriesGroupMitigationProductParamsDateRange = "2d"
+ AttackLayer7TimeseriesGroupMitigationProductParamsDateRange7d AttackLayer7TimeseriesGroupMitigationProductParamsDateRange = "7d"
+ AttackLayer7TimeseriesGroupMitigationProductParamsDateRange14d AttackLayer7TimeseriesGroupMitigationProductParamsDateRange = "14d"
+ AttackLayer7TimeseriesGroupMitigationProductParamsDateRange28d AttackLayer7TimeseriesGroupMitigationProductParamsDateRange = "28d"
+ AttackLayer7TimeseriesGroupMitigationProductParamsDateRange12w AttackLayer7TimeseriesGroupMitigationProductParamsDateRange = "12w"
+ AttackLayer7TimeseriesGroupMitigationProductParamsDateRange24w AttackLayer7TimeseriesGroupMitigationProductParamsDateRange = "24w"
+ AttackLayer7TimeseriesGroupMitigationProductParamsDateRange52w AttackLayer7TimeseriesGroupMitigationProductParamsDateRange = "52w"
+ AttackLayer7TimeseriesGroupMitigationProductParamsDateRange1dControl AttackLayer7TimeseriesGroupMitigationProductParamsDateRange = "1dControl"
+ AttackLayer7TimeseriesGroupMitigationProductParamsDateRange2dControl AttackLayer7TimeseriesGroupMitigationProductParamsDateRange = "2dControl"
+ AttackLayer7TimeseriesGroupMitigationProductParamsDateRange7dControl AttackLayer7TimeseriesGroupMitigationProductParamsDateRange = "7dControl"
+ AttackLayer7TimeseriesGroupMitigationProductParamsDateRange14dControl AttackLayer7TimeseriesGroupMitigationProductParamsDateRange = "14dControl"
+ AttackLayer7TimeseriesGroupMitigationProductParamsDateRange28dControl AttackLayer7TimeseriesGroupMitigationProductParamsDateRange = "28dControl"
+ AttackLayer7TimeseriesGroupMitigationProductParamsDateRange12wControl AttackLayer7TimeseriesGroupMitigationProductParamsDateRange = "12wControl"
+ AttackLayer7TimeseriesGroupMitigationProductParamsDateRange24wControl AttackLayer7TimeseriesGroupMitigationProductParamsDateRange = "24wControl"
+)
+
+// Format results are returned in.
+type AttackLayer7TimeseriesGroupMitigationProductParamsFormat string
+
+const (
+ AttackLayer7TimeseriesGroupMitigationProductParamsFormatJson AttackLayer7TimeseriesGroupMitigationProductParamsFormat = "JSON"
+ AttackLayer7TimeseriesGroupMitigationProductParamsFormatCsv AttackLayer7TimeseriesGroupMitigationProductParamsFormat = "CSV"
+)
+
+type AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod string
+
+const (
+ AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodGet AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "GET"
+ AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodPost AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "POST"
+ AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodDelete AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "DELETE"
+ AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodPut AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "PUT"
+ AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodHead AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "HEAD"
+ AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodPurge AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "PURGE"
+ AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodOptions AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "OPTIONS"
+ AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodPropfind AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "PROPFIND"
+ AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodMkcol AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "MKCOL"
+ AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodPatch AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "PATCH"
+ AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodACL AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "ACL"
+ AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodBcopy AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "BCOPY"
+ AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodBdelete AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "BDELETE"
+ AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodBmove AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "BMOVE"
+ AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodBpropfind AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "BPROPFIND"
+ AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodBproppatch AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "BPROPPATCH"
+ AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodCheckin AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "CHECKIN"
+ AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodCheckout AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "CHECKOUT"
+ AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodConnect AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "CONNECT"
+ AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodCopy AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "COPY"
+ AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodLabel AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "LABEL"
+ AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodLock AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "LOCK"
+ AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodMerge AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "MERGE"
+ AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodMkactivity AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "MKACTIVITY"
+ AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodMkworkspace AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "MKWORKSPACE"
+ AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodMove AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "MOVE"
+ AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodNotify AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "NOTIFY"
+ AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodOrderpatch AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "ORDERPATCH"
+ AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodPoll AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "POLL"
+ AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodProppatch AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "PROPPATCH"
+ AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodReport AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "REPORT"
+ AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodSearch AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "SEARCH"
+ AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodSubscribe AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "SUBSCRIBE"
+ AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodTrace AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "TRACE"
+ AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodUncheckout AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "UNCHECKOUT"
+ AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodUnlock AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "UNLOCK"
+ AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodUnsubscribe AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "UNSUBSCRIBE"
+ AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodUpdate AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "UPDATE"
+ AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodVersioncontrol AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "VERSIONCONTROL"
+ AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodBaselinecontrol AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "BASELINECONTROL"
+ AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodXmsenumatts AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "XMSENUMATTS"
+ AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodRpcOutData AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "RPC_OUT_DATA"
+ AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodRpcInData AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "RPC_IN_DATA"
+ AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodJson AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "JSON"
+ AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodCook AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "COOK"
+ AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodTrack AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "TRACK"
+)
+
+type AttackLayer7TimeseriesGroupMitigationProductParamsHTTPVersion string
+
+const (
+ AttackLayer7TimeseriesGroupMitigationProductParamsHTTPVersionHttPv1 AttackLayer7TimeseriesGroupMitigationProductParamsHTTPVersion = "HTTPv1"
+ AttackLayer7TimeseriesGroupMitigationProductParamsHTTPVersionHttPv2 AttackLayer7TimeseriesGroupMitigationProductParamsHTTPVersion = "HTTPv2"
+ AttackLayer7TimeseriesGroupMitigationProductParamsHTTPVersionHttPv3 AttackLayer7TimeseriesGroupMitigationProductParamsHTTPVersion = "HTTPv3"
+)
+
+type AttackLayer7TimeseriesGroupMitigationProductParamsIPVersion string
+
+const (
+ AttackLayer7TimeseriesGroupMitigationProductParamsIPVersionIPv4 AttackLayer7TimeseriesGroupMitigationProductParamsIPVersion = "IPv4"
+ AttackLayer7TimeseriesGroupMitigationProductParamsIPVersionIPv6 AttackLayer7TimeseriesGroupMitigationProductParamsIPVersion = "IPv6"
+)
+
+// Normalization method applied. Refer to
+// [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/).
+type AttackLayer7TimeseriesGroupMitigationProductParamsNormalization string
+
+const (
+ AttackLayer7TimeseriesGroupMitigationProductParamsNormalizationPercentage AttackLayer7TimeseriesGroupMitigationProductParamsNormalization = "PERCENTAGE"
+ AttackLayer7TimeseriesGroupMitigationProductParamsNormalizationMin0Max AttackLayer7TimeseriesGroupMitigationProductParamsNormalization = "MIN0_MAX"
+)
+
+type AttackLayer7TimeseriesGroupMitigationProductResponseEnvelope struct {
+ Result AttackLayer7TimeseriesGroupMitigationProductResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON attackLayer7TimeseriesGroupMitigationProductResponseEnvelopeJSON `json:"-"`
+}
+
+// attackLayer7TimeseriesGroupMitigationProductResponseEnvelopeJSON contains the
+// JSON metadata for the struct
+// [AttackLayer7TimeseriesGroupMitigationProductResponseEnvelope]
+type attackLayer7TimeseriesGroupMitigationProductResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7TimeseriesGroupMitigationProductResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TimeseriesGroupMitigationProductResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7TimeseriesGroupVerticalParams struct {
+ // Aggregation interval results should be returned in (for example, in 15 minutes
+ // or 1 hour intervals). Refer to
+ // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+ AggInterval param.Field[AttackLayer7TimeseriesGroupVerticalParamsAggInterval] `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"`
+ // 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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]AttackLayer7TimeseriesGroupVerticalParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Format results are returned in.
+ Format param.Field[AttackLayer7TimeseriesGroupVerticalParamsFormat] `query:"format"`
+ // Filter for http method.
+ HTTPMethod param.Field[[]AttackLayer7TimeseriesGroupVerticalParamsHTTPMethod] `query:"httpMethod"`
+ // Filter for http version.
+ HTTPVersion param.Field[[]AttackLayer7TimeseriesGroupVerticalParamsHTTPVersion] `query:"httpVersion"`
+ // Filter for ip version.
+ IPVersion param.Field[[]AttackLayer7TimeseriesGroupVerticalParamsIPVersion] `query:"ipVersion"`
+ // Limit the number of objects (eg browsers, verticals, etc) to the top items over
+ // the time range.
+ LimitPerGroup param.Field[int64] `query:"limitPerGroup"`
+ // Array of comma separated list of locations (alpha-2 country codes). Start with
+ // `-` to exclude from results. For example, `-US,PT` excludes results from the US,
+ // but includes results from PT.
+ Location param.Field[[]string] `query:"location"`
+ // Array of L7 mitigation products.
+ MitigationProduct param.Field[[]AttackLayer7TimeseriesGroupVerticalParamsMitigationProduct] `query:"mitigationProduct"`
+ // Array of names that will be used to name the series in responses.
+ Name param.Field[[]string] `query:"name"`
+ // Normalization method applied. Refer to
+ // [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/).
+ Normalization param.Field[AttackLayer7TimeseriesGroupVerticalParamsNormalization] `query:"normalization"`
+}
+
+// URLQuery serializes [AttackLayer7TimeseriesGroupVerticalParams]'s query
+// parameters as `url.Values`.
+func (r AttackLayer7TimeseriesGroupVerticalParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Aggregation interval results should be returned in (for example, in 15 minutes
+// or 1 hour intervals). Refer to
+// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+type AttackLayer7TimeseriesGroupVerticalParamsAggInterval string
+
+const (
+ AttackLayer7TimeseriesGroupVerticalParamsAggInterval15m AttackLayer7TimeseriesGroupVerticalParamsAggInterval = "15m"
+ AttackLayer7TimeseriesGroupVerticalParamsAggInterval1h AttackLayer7TimeseriesGroupVerticalParamsAggInterval = "1h"
+ AttackLayer7TimeseriesGroupVerticalParamsAggInterval1d AttackLayer7TimeseriesGroupVerticalParamsAggInterval = "1d"
+ AttackLayer7TimeseriesGroupVerticalParamsAggInterval1w AttackLayer7TimeseriesGroupVerticalParamsAggInterval = "1w"
+)
+
+type AttackLayer7TimeseriesGroupVerticalParamsDateRange string
+
+const (
+ AttackLayer7TimeseriesGroupVerticalParamsDateRange1d AttackLayer7TimeseriesGroupVerticalParamsDateRange = "1d"
+ AttackLayer7TimeseriesGroupVerticalParamsDateRange2d AttackLayer7TimeseriesGroupVerticalParamsDateRange = "2d"
+ AttackLayer7TimeseriesGroupVerticalParamsDateRange7d AttackLayer7TimeseriesGroupVerticalParamsDateRange = "7d"
+ AttackLayer7TimeseriesGroupVerticalParamsDateRange14d AttackLayer7TimeseriesGroupVerticalParamsDateRange = "14d"
+ AttackLayer7TimeseriesGroupVerticalParamsDateRange28d AttackLayer7TimeseriesGroupVerticalParamsDateRange = "28d"
+ AttackLayer7TimeseriesGroupVerticalParamsDateRange12w AttackLayer7TimeseriesGroupVerticalParamsDateRange = "12w"
+ AttackLayer7TimeseriesGroupVerticalParamsDateRange24w AttackLayer7TimeseriesGroupVerticalParamsDateRange = "24w"
+ AttackLayer7TimeseriesGroupVerticalParamsDateRange52w AttackLayer7TimeseriesGroupVerticalParamsDateRange = "52w"
+ AttackLayer7TimeseriesGroupVerticalParamsDateRange1dControl AttackLayer7TimeseriesGroupVerticalParamsDateRange = "1dControl"
+ AttackLayer7TimeseriesGroupVerticalParamsDateRange2dControl AttackLayer7TimeseriesGroupVerticalParamsDateRange = "2dControl"
+ AttackLayer7TimeseriesGroupVerticalParamsDateRange7dControl AttackLayer7TimeseriesGroupVerticalParamsDateRange = "7dControl"
+ AttackLayer7TimeseriesGroupVerticalParamsDateRange14dControl AttackLayer7TimeseriesGroupVerticalParamsDateRange = "14dControl"
+ AttackLayer7TimeseriesGroupVerticalParamsDateRange28dControl AttackLayer7TimeseriesGroupVerticalParamsDateRange = "28dControl"
+ AttackLayer7TimeseriesGroupVerticalParamsDateRange12wControl AttackLayer7TimeseriesGroupVerticalParamsDateRange = "12wControl"
+ AttackLayer7TimeseriesGroupVerticalParamsDateRange24wControl AttackLayer7TimeseriesGroupVerticalParamsDateRange = "24wControl"
+)
+
+// Format results are returned in.
+type AttackLayer7TimeseriesGroupVerticalParamsFormat string
+
+const (
+ AttackLayer7TimeseriesGroupVerticalParamsFormatJson AttackLayer7TimeseriesGroupVerticalParamsFormat = "JSON"
+ AttackLayer7TimeseriesGroupVerticalParamsFormatCsv AttackLayer7TimeseriesGroupVerticalParamsFormat = "CSV"
+)
+
+type AttackLayer7TimeseriesGroupVerticalParamsHTTPMethod string
+
+const (
+ AttackLayer7TimeseriesGroupVerticalParamsHTTPMethodGet AttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "GET"
+ AttackLayer7TimeseriesGroupVerticalParamsHTTPMethodPost AttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "POST"
+ AttackLayer7TimeseriesGroupVerticalParamsHTTPMethodDelete AttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "DELETE"
+ AttackLayer7TimeseriesGroupVerticalParamsHTTPMethodPut AttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "PUT"
+ AttackLayer7TimeseriesGroupVerticalParamsHTTPMethodHead AttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "HEAD"
+ AttackLayer7TimeseriesGroupVerticalParamsHTTPMethodPurge AttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "PURGE"
+ AttackLayer7TimeseriesGroupVerticalParamsHTTPMethodOptions AttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "OPTIONS"
+ AttackLayer7TimeseriesGroupVerticalParamsHTTPMethodPropfind AttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "PROPFIND"
+ AttackLayer7TimeseriesGroupVerticalParamsHTTPMethodMkcol AttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "MKCOL"
+ AttackLayer7TimeseriesGroupVerticalParamsHTTPMethodPatch AttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "PATCH"
+ AttackLayer7TimeseriesGroupVerticalParamsHTTPMethodACL AttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "ACL"
+ AttackLayer7TimeseriesGroupVerticalParamsHTTPMethodBcopy AttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "BCOPY"
+ AttackLayer7TimeseriesGroupVerticalParamsHTTPMethodBdelete AttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "BDELETE"
+ AttackLayer7TimeseriesGroupVerticalParamsHTTPMethodBmove AttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "BMOVE"
+ AttackLayer7TimeseriesGroupVerticalParamsHTTPMethodBpropfind AttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "BPROPFIND"
+ AttackLayer7TimeseriesGroupVerticalParamsHTTPMethodBproppatch AttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "BPROPPATCH"
+ AttackLayer7TimeseriesGroupVerticalParamsHTTPMethodCheckin AttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "CHECKIN"
+ AttackLayer7TimeseriesGroupVerticalParamsHTTPMethodCheckout AttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "CHECKOUT"
+ AttackLayer7TimeseriesGroupVerticalParamsHTTPMethodConnect AttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "CONNECT"
+ AttackLayer7TimeseriesGroupVerticalParamsHTTPMethodCopy AttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "COPY"
+ AttackLayer7TimeseriesGroupVerticalParamsHTTPMethodLabel AttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "LABEL"
+ AttackLayer7TimeseriesGroupVerticalParamsHTTPMethodLock AttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "LOCK"
+ AttackLayer7TimeseriesGroupVerticalParamsHTTPMethodMerge AttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "MERGE"
+ AttackLayer7TimeseriesGroupVerticalParamsHTTPMethodMkactivity AttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "MKACTIVITY"
+ AttackLayer7TimeseriesGroupVerticalParamsHTTPMethodMkworkspace AttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "MKWORKSPACE"
+ AttackLayer7TimeseriesGroupVerticalParamsHTTPMethodMove AttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "MOVE"
+ AttackLayer7TimeseriesGroupVerticalParamsHTTPMethodNotify AttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "NOTIFY"
+ AttackLayer7TimeseriesGroupVerticalParamsHTTPMethodOrderpatch AttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "ORDERPATCH"
+ AttackLayer7TimeseriesGroupVerticalParamsHTTPMethodPoll AttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "POLL"
+ AttackLayer7TimeseriesGroupVerticalParamsHTTPMethodProppatch AttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "PROPPATCH"
+ AttackLayer7TimeseriesGroupVerticalParamsHTTPMethodReport AttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "REPORT"
+ AttackLayer7TimeseriesGroupVerticalParamsHTTPMethodSearch AttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "SEARCH"
+ AttackLayer7TimeseriesGroupVerticalParamsHTTPMethodSubscribe AttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "SUBSCRIBE"
+ AttackLayer7TimeseriesGroupVerticalParamsHTTPMethodTrace AttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "TRACE"
+ AttackLayer7TimeseriesGroupVerticalParamsHTTPMethodUncheckout AttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "UNCHECKOUT"
+ AttackLayer7TimeseriesGroupVerticalParamsHTTPMethodUnlock AttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "UNLOCK"
+ AttackLayer7TimeseriesGroupVerticalParamsHTTPMethodUnsubscribe AttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "UNSUBSCRIBE"
+ AttackLayer7TimeseriesGroupVerticalParamsHTTPMethodUpdate AttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "UPDATE"
+ AttackLayer7TimeseriesGroupVerticalParamsHTTPMethodVersioncontrol AttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "VERSIONCONTROL"
+ AttackLayer7TimeseriesGroupVerticalParamsHTTPMethodBaselinecontrol AttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "BASELINECONTROL"
+ AttackLayer7TimeseriesGroupVerticalParamsHTTPMethodXmsenumatts AttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "XMSENUMATTS"
+ AttackLayer7TimeseriesGroupVerticalParamsHTTPMethodRpcOutData AttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "RPC_OUT_DATA"
+ AttackLayer7TimeseriesGroupVerticalParamsHTTPMethodRpcInData AttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "RPC_IN_DATA"
+ AttackLayer7TimeseriesGroupVerticalParamsHTTPMethodJson AttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "JSON"
+ AttackLayer7TimeseriesGroupVerticalParamsHTTPMethodCook AttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "COOK"
+ AttackLayer7TimeseriesGroupVerticalParamsHTTPMethodTrack AttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "TRACK"
+)
+
+type AttackLayer7TimeseriesGroupVerticalParamsHTTPVersion string
+
+const (
+ AttackLayer7TimeseriesGroupVerticalParamsHTTPVersionHttPv1 AttackLayer7TimeseriesGroupVerticalParamsHTTPVersion = "HTTPv1"
+ AttackLayer7TimeseriesGroupVerticalParamsHTTPVersionHttPv2 AttackLayer7TimeseriesGroupVerticalParamsHTTPVersion = "HTTPv2"
+ AttackLayer7TimeseriesGroupVerticalParamsHTTPVersionHttPv3 AttackLayer7TimeseriesGroupVerticalParamsHTTPVersion = "HTTPv3"
+)
+
+type AttackLayer7TimeseriesGroupVerticalParamsIPVersion string
+
+const (
+ AttackLayer7TimeseriesGroupVerticalParamsIPVersionIPv4 AttackLayer7TimeseriesGroupVerticalParamsIPVersion = "IPv4"
+ AttackLayer7TimeseriesGroupVerticalParamsIPVersionIPv6 AttackLayer7TimeseriesGroupVerticalParamsIPVersion = "IPv6"
+)
+
+type AttackLayer7TimeseriesGroupVerticalParamsMitigationProduct string
+
+const (
+ AttackLayer7TimeseriesGroupVerticalParamsMitigationProductDDOS AttackLayer7TimeseriesGroupVerticalParamsMitigationProduct = "DDOS"
+ AttackLayer7TimeseriesGroupVerticalParamsMitigationProductWAF AttackLayer7TimeseriesGroupVerticalParamsMitigationProduct = "WAF"
+ AttackLayer7TimeseriesGroupVerticalParamsMitigationProductBotManagement AttackLayer7TimeseriesGroupVerticalParamsMitigationProduct = "BOT_MANAGEMENT"
+ AttackLayer7TimeseriesGroupVerticalParamsMitigationProductAccessRules AttackLayer7TimeseriesGroupVerticalParamsMitigationProduct = "ACCESS_RULES"
+ AttackLayer7TimeseriesGroupVerticalParamsMitigationProductIPReputation AttackLayer7TimeseriesGroupVerticalParamsMitigationProduct = "IP_REPUTATION"
+ AttackLayer7TimeseriesGroupVerticalParamsMitigationProductAPIShield AttackLayer7TimeseriesGroupVerticalParamsMitigationProduct = "API_SHIELD"
+ AttackLayer7TimeseriesGroupVerticalParamsMitigationProductDataLossPrevention AttackLayer7TimeseriesGroupVerticalParamsMitigationProduct = "DATA_LOSS_PREVENTION"
+)
+
+// Normalization method applied. Refer to
+// [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/).
+type AttackLayer7TimeseriesGroupVerticalParamsNormalization string
+
+const (
+ AttackLayer7TimeseriesGroupVerticalParamsNormalizationPercentage AttackLayer7TimeseriesGroupVerticalParamsNormalization = "PERCENTAGE"
+ AttackLayer7TimeseriesGroupVerticalParamsNormalizationMin0Max AttackLayer7TimeseriesGroupVerticalParamsNormalization = "MIN0_MAX"
+)
+
+type AttackLayer7TimeseriesGroupVerticalResponseEnvelope struct {
+ Result AttackLayer7TimeseriesGroupVerticalResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON attackLayer7TimeseriesGroupVerticalResponseEnvelopeJSON `json:"-"`
+}
+
+// attackLayer7TimeseriesGroupVerticalResponseEnvelopeJSON contains the JSON
+// metadata for the struct [AttackLayer7TimeseriesGroupVerticalResponseEnvelope]
+type attackLayer7TimeseriesGroupVerticalResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7TimeseriesGroupVerticalResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TimeseriesGroupVerticalResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/radar/attacklayer7timeseriesgroup_test.go b/radar/attacklayer7timeseriesgroup_test.go
new file mode 100644
index 00000000000..85a32c5bd82
--- /dev/null
+++ b/radar/attacklayer7timeseriesgroup_test.go
@@ -0,0 +1,321 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/radar"
+)
+
+func TestAttackLayer7TimeseriesGroupGetWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Attacks.Layer7.TimeseriesGroups.Get(context.TODO(), radar.AttackLayer7TimeseriesGroupGetParams{
+ AggInterval: cloudflare.F(radar.AttackLayer7TimeseriesGroupGetParamsAggInterval1h),
+ 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([]radar.AttackLayer7TimeseriesGroupGetParamsDateRange{radar.AttackLayer7TimeseriesGroupGetParamsDateRange1d, radar.AttackLayer7TimeseriesGroupGetParamsDateRange2d, radar.AttackLayer7TimeseriesGroupGetParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Format: cloudflare.F(radar.AttackLayer7TimeseriesGroupGetParamsFormatJson),
+ 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())
+ }
+}
+
+func TestAttackLayer7TimeseriesGroupHTTPMethodWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Attacks.Layer7.TimeseriesGroups.HTTPMethod(context.TODO(), radar.AttackLayer7TimeseriesGroupHTTPMethodParams{
+ AggInterval: cloudflare.F(radar.AttackLayer7TimeseriesGroupHTTPMethodParamsAggInterval1h),
+ 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([]radar.AttackLayer7TimeseriesGroupHTTPMethodParamsDateRange{radar.AttackLayer7TimeseriesGroupHTTPMethodParamsDateRange1d, radar.AttackLayer7TimeseriesGroupHTTPMethodParamsDateRange2d, radar.AttackLayer7TimeseriesGroupHTTPMethodParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Format: cloudflare.F(radar.AttackLayer7TimeseriesGroupHTTPMethodParamsFormatJson),
+ HTTPVersion: cloudflare.F([]radar.AttackLayer7TimeseriesGroupHTTPMethodParamsHTTPVersion{radar.AttackLayer7TimeseriesGroupHTTPMethodParamsHTTPVersionHttPv1, radar.AttackLayer7TimeseriesGroupHTTPMethodParamsHTTPVersionHttPv2, radar.AttackLayer7TimeseriesGroupHTTPMethodParamsHTTPVersionHttPv3}),
+ IPVersion: cloudflare.F([]radar.AttackLayer7TimeseriesGroupHTTPMethodParamsIPVersion{radar.AttackLayer7TimeseriesGroupHTTPMethodParamsIPVersionIPv4, radar.AttackLayer7TimeseriesGroupHTTPMethodParamsIPVersionIPv6}),
+ Location: cloudflare.F([]string{"string", "string", "string"}),
+ MitigationProduct: cloudflare.F([]radar.AttackLayer7TimeseriesGroupHTTPMethodParamsMitigationProduct{radar.AttackLayer7TimeseriesGroupHTTPMethodParamsMitigationProductDDOS, radar.AttackLayer7TimeseriesGroupHTTPMethodParamsMitigationProductWAF, radar.AttackLayer7TimeseriesGroupHTTPMethodParamsMitigationProductBotManagement}),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ Normalization: cloudflare.F(radar.AttackLayer7TimeseriesGroupHTTPMethodParamsNormalizationPercentage),
+ })
+ 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())
+ }
+}
+
+func TestAttackLayer7TimeseriesGroupHTTPVersionWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Attacks.Layer7.TimeseriesGroups.HTTPVersion(context.TODO(), radar.AttackLayer7TimeseriesGroupHTTPVersionParams{
+ AggInterval: cloudflare.F(radar.AttackLayer7TimeseriesGroupHTTPVersionParamsAggInterval1h),
+ 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([]radar.AttackLayer7TimeseriesGroupHTTPVersionParamsDateRange{radar.AttackLayer7TimeseriesGroupHTTPVersionParamsDateRange1d, radar.AttackLayer7TimeseriesGroupHTTPVersionParamsDateRange2d, radar.AttackLayer7TimeseriesGroupHTTPVersionParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Format: cloudflare.F(radar.AttackLayer7TimeseriesGroupHTTPVersionParamsFormatJson),
+ HTTPMethod: cloudflare.F([]radar.AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod{radar.AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodGet, radar.AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodPost, radar.AttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodDelete}),
+ IPVersion: cloudflare.F([]radar.AttackLayer7TimeseriesGroupHTTPVersionParamsIPVersion{radar.AttackLayer7TimeseriesGroupHTTPVersionParamsIPVersionIPv4, radar.AttackLayer7TimeseriesGroupHTTPVersionParamsIPVersionIPv6}),
+ Location: cloudflare.F([]string{"string", "string", "string"}),
+ MitigationProduct: cloudflare.F([]radar.AttackLayer7TimeseriesGroupHTTPVersionParamsMitigationProduct{radar.AttackLayer7TimeseriesGroupHTTPVersionParamsMitigationProductDDOS, radar.AttackLayer7TimeseriesGroupHTTPVersionParamsMitigationProductWAF, radar.AttackLayer7TimeseriesGroupHTTPVersionParamsMitigationProductBotManagement}),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ Normalization: cloudflare.F(radar.AttackLayer7TimeseriesGroupHTTPVersionParamsNormalizationPercentage),
+ })
+ 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())
+ }
+}
+
+func TestAttackLayer7TimeseriesGroupIndustryWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Attacks.Layer7.TimeseriesGroups.Industry(context.TODO(), radar.AttackLayer7TimeseriesGroupIndustryParams{
+ AggInterval: cloudflare.F(radar.AttackLayer7TimeseriesGroupIndustryParamsAggInterval1h),
+ 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([]radar.AttackLayer7TimeseriesGroupIndustryParamsDateRange{radar.AttackLayer7TimeseriesGroupIndustryParamsDateRange1d, radar.AttackLayer7TimeseriesGroupIndustryParamsDateRange2d, radar.AttackLayer7TimeseriesGroupIndustryParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Format: cloudflare.F(radar.AttackLayer7TimeseriesGroupIndustryParamsFormatJson),
+ HTTPMethod: cloudflare.F([]radar.AttackLayer7TimeseriesGroupIndustryParamsHTTPMethod{radar.AttackLayer7TimeseriesGroupIndustryParamsHTTPMethodGet, radar.AttackLayer7TimeseriesGroupIndustryParamsHTTPMethodPost, radar.AttackLayer7TimeseriesGroupIndustryParamsHTTPMethodDelete}),
+ HTTPVersion: cloudflare.F([]radar.AttackLayer7TimeseriesGroupIndustryParamsHTTPVersion{radar.AttackLayer7TimeseriesGroupIndustryParamsHTTPVersionHttPv1, radar.AttackLayer7TimeseriesGroupIndustryParamsHTTPVersionHttPv2, radar.AttackLayer7TimeseriesGroupIndustryParamsHTTPVersionHttPv3}),
+ IPVersion: cloudflare.F([]radar.AttackLayer7TimeseriesGroupIndustryParamsIPVersion{radar.AttackLayer7TimeseriesGroupIndustryParamsIPVersionIPv4, radar.AttackLayer7TimeseriesGroupIndustryParamsIPVersionIPv6}),
+ LimitPerGroup: cloudflare.F(int64(4)),
+ Location: cloudflare.F([]string{"string", "string", "string"}),
+ MitigationProduct: cloudflare.F([]radar.AttackLayer7TimeseriesGroupIndustryParamsMitigationProduct{radar.AttackLayer7TimeseriesGroupIndustryParamsMitigationProductDDOS, radar.AttackLayer7TimeseriesGroupIndustryParamsMitigationProductWAF, radar.AttackLayer7TimeseriesGroupIndustryParamsMitigationProductBotManagement}),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ Normalization: cloudflare.F(radar.AttackLayer7TimeseriesGroupIndustryParamsNormalizationPercentage),
+ })
+ 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())
+ }
+}
+
+func TestAttackLayer7TimeseriesGroupIPVersionWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Attacks.Layer7.TimeseriesGroups.IPVersion(context.TODO(), radar.AttackLayer7TimeseriesGroupIPVersionParams{
+ AggInterval: cloudflare.F(radar.AttackLayer7TimeseriesGroupIPVersionParamsAggInterval1h),
+ 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([]radar.AttackLayer7TimeseriesGroupIPVersionParamsDateRange{radar.AttackLayer7TimeseriesGroupIPVersionParamsDateRange1d, radar.AttackLayer7TimeseriesGroupIPVersionParamsDateRange2d, radar.AttackLayer7TimeseriesGroupIPVersionParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Format: cloudflare.F(radar.AttackLayer7TimeseriesGroupIPVersionParamsFormatJson),
+ HTTPMethod: cloudflare.F([]radar.AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod{radar.AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodGet, radar.AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodPost, radar.AttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodDelete}),
+ HTTPVersion: cloudflare.F([]radar.AttackLayer7TimeseriesGroupIPVersionParamsHTTPVersion{radar.AttackLayer7TimeseriesGroupIPVersionParamsHTTPVersionHttPv1, radar.AttackLayer7TimeseriesGroupIPVersionParamsHTTPVersionHttPv2, radar.AttackLayer7TimeseriesGroupIPVersionParamsHTTPVersionHttPv3}),
+ Location: cloudflare.F([]string{"string", "string", "string"}),
+ MitigationProduct: cloudflare.F([]radar.AttackLayer7TimeseriesGroupIPVersionParamsMitigationProduct{radar.AttackLayer7TimeseriesGroupIPVersionParamsMitigationProductDDOS, radar.AttackLayer7TimeseriesGroupIPVersionParamsMitigationProductWAF, radar.AttackLayer7TimeseriesGroupIPVersionParamsMitigationProductBotManagement}),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ Normalization: cloudflare.F(radar.AttackLayer7TimeseriesGroupIPVersionParamsNormalizationPercentage),
+ })
+ 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())
+ }
+}
+
+func TestAttackLayer7TimeseriesGroupManagedRulesWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Attacks.Layer7.TimeseriesGroups.ManagedRules(context.TODO(), radar.AttackLayer7TimeseriesGroupManagedRulesParams{
+ AggInterval: cloudflare.F(radar.AttackLayer7TimeseriesGroupManagedRulesParamsAggInterval1h),
+ 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([]radar.AttackLayer7TimeseriesGroupManagedRulesParamsDateRange{radar.AttackLayer7TimeseriesGroupManagedRulesParamsDateRange1d, radar.AttackLayer7TimeseriesGroupManagedRulesParamsDateRange2d, radar.AttackLayer7TimeseriesGroupManagedRulesParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Format: cloudflare.F(radar.AttackLayer7TimeseriesGroupManagedRulesParamsFormatJson),
+ HTTPMethod: cloudflare.F([]radar.AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod{radar.AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodGet, radar.AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodPost, radar.AttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodDelete}),
+ HTTPVersion: cloudflare.F([]radar.AttackLayer7TimeseriesGroupManagedRulesParamsHTTPVersion{radar.AttackLayer7TimeseriesGroupManagedRulesParamsHTTPVersionHttPv1, radar.AttackLayer7TimeseriesGroupManagedRulesParamsHTTPVersionHttPv2, radar.AttackLayer7TimeseriesGroupManagedRulesParamsHTTPVersionHttPv3}),
+ IPVersion: cloudflare.F([]radar.AttackLayer7TimeseriesGroupManagedRulesParamsIPVersion{radar.AttackLayer7TimeseriesGroupManagedRulesParamsIPVersionIPv4, radar.AttackLayer7TimeseriesGroupManagedRulesParamsIPVersionIPv6}),
+ Location: cloudflare.F([]string{"string", "string", "string"}),
+ MitigationProduct: cloudflare.F([]radar.AttackLayer7TimeseriesGroupManagedRulesParamsMitigationProduct{radar.AttackLayer7TimeseriesGroupManagedRulesParamsMitigationProductDDOS, radar.AttackLayer7TimeseriesGroupManagedRulesParamsMitigationProductWAF, radar.AttackLayer7TimeseriesGroupManagedRulesParamsMitigationProductBotManagement}),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ Normalization: cloudflare.F(radar.AttackLayer7TimeseriesGroupManagedRulesParamsNormalizationPercentage),
+ })
+ 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())
+ }
+}
+
+func TestAttackLayer7TimeseriesGroupMitigationProductWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Attacks.Layer7.TimeseriesGroups.MitigationProduct(context.TODO(), radar.AttackLayer7TimeseriesGroupMitigationProductParams{
+ AggInterval: cloudflare.F(radar.AttackLayer7TimeseriesGroupMitigationProductParamsAggInterval1h),
+ 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([]radar.AttackLayer7TimeseriesGroupMitigationProductParamsDateRange{radar.AttackLayer7TimeseriesGroupMitigationProductParamsDateRange1d, radar.AttackLayer7TimeseriesGroupMitigationProductParamsDateRange2d, radar.AttackLayer7TimeseriesGroupMitigationProductParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Format: cloudflare.F(radar.AttackLayer7TimeseriesGroupMitigationProductParamsFormatJson),
+ HTTPMethod: cloudflare.F([]radar.AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod{radar.AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodGet, radar.AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodPost, radar.AttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodDelete}),
+ HTTPVersion: cloudflare.F([]radar.AttackLayer7TimeseriesGroupMitigationProductParamsHTTPVersion{radar.AttackLayer7TimeseriesGroupMitigationProductParamsHTTPVersionHttPv1, radar.AttackLayer7TimeseriesGroupMitigationProductParamsHTTPVersionHttPv2, radar.AttackLayer7TimeseriesGroupMitigationProductParamsHTTPVersionHttPv3}),
+ IPVersion: cloudflare.F([]radar.AttackLayer7TimeseriesGroupMitigationProductParamsIPVersion{radar.AttackLayer7TimeseriesGroupMitigationProductParamsIPVersionIPv4, radar.AttackLayer7TimeseriesGroupMitigationProductParamsIPVersionIPv6}),
+ Location: cloudflare.F([]string{"string", "string", "string"}),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ Normalization: cloudflare.F(radar.AttackLayer7TimeseriesGroupMitigationProductParamsNormalizationPercentage),
+ })
+ 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())
+ }
+}
+
+func TestAttackLayer7TimeseriesGroupVerticalWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Attacks.Layer7.TimeseriesGroups.Vertical(context.TODO(), radar.AttackLayer7TimeseriesGroupVerticalParams{
+ AggInterval: cloudflare.F(radar.AttackLayer7TimeseriesGroupVerticalParamsAggInterval1h),
+ 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([]radar.AttackLayer7TimeseriesGroupVerticalParamsDateRange{radar.AttackLayer7TimeseriesGroupVerticalParamsDateRange1d, radar.AttackLayer7TimeseriesGroupVerticalParamsDateRange2d, radar.AttackLayer7TimeseriesGroupVerticalParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Format: cloudflare.F(radar.AttackLayer7TimeseriesGroupVerticalParamsFormatJson),
+ HTTPMethod: cloudflare.F([]radar.AttackLayer7TimeseriesGroupVerticalParamsHTTPMethod{radar.AttackLayer7TimeseriesGroupVerticalParamsHTTPMethodGet, radar.AttackLayer7TimeseriesGroupVerticalParamsHTTPMethodPost, radar.AttackLayer7TimeseriesGroupVerticalParamsHTTPMethodDelete}),
+ HTTPVersion: cloudflare.F([]radar.AttackLayer7TimeseriesGroupVerticalParamsHTTPVersion{radar.AttackLayer7TimeseriesGroupVerticalParamsHTTPVersionHttPv1, radar.AttackLayer7TimeseriesGroupVerticalParamsHTTPVersionHttPv2, radar.AttackLayer7TimeseriesGroupVerticalParamsHTTPVersionHttPv3}),
+ IPVersion: cloudflare.F([]radar.AttackLayer7TimeseriesGroupVerticalParamsIPVersion{radar.AttackLayer7TimeseriesGroupVerticalParamsIPVersionIPv4, radar.AttackLayer7TimeseriesGroupVerticalParamsIPVersionIPv6}),
+ LimitPerGroup: cloudflare.F(int64(4)),
+ Location: cloudflare.F([]string{"string", "string", "string"}),
+ MitigationProduct: cloudflare.F([]radar.AttackLayer7TimeseriesGroupVerticalParamsMitigationProduct{radar.AttackLayer7TimeseriesGroupVerticalParamsMitigationProductDDOS, radar.AttackLayer7TimeseriesGroupVerticalParamsMitigationProductWAF, radar.AttackLayer7TimeseriesGroupVerticalParamsMitigationProductBotManagement}),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ Normalization: cloudflare.F(radar.AttackLayer7TimeseriesGroupVerticalParamsNormalizationPercentage),
+ })
+ 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/radar/attacklayer7top.go b/radar/attacklayer7top.go
new file mode 100644
index 00000000000..2071fd8bf01
--- /dev/null
+++ b/radar/attacklayer7top.go
@@ -0,0 +1,842 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "context"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// AttackLayer7TopService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewAttackLayer7TopService] method
+// instead.
+type AttackLayer7TopService struct {
+ Options []option.RequestOption
+ Locations *AttackLayer7TopLocationService
+ Ases *AttackLayer7TopAseService
+}
+
+// NewAttackLayer7TopService generates a new service that applies the given options
+// to each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewAttackLayer7TopService(opts ...option.RequestOption) (r *AttackLayer7TopService) {
+ r = &AttackLayer7TopService{}
+ r.Options = opts
+ r.Locations = NewAttackLayer7TopLocationService(opts...)
+ r.Ases = NewAttackLayer7TopAseService(opts...)
+ return
+}
+
+// Get the top attacks from origin to target location. Values are a percentage out
+// of the total layer 7 attacks (with billing country). The attack magnitude can be
+// defined by the number of mitigated requests or by the number of zones affected.
+// You can optionally limit the number of attacks per origin/target location
+// (useful if all the top attacks are from or to the same location).
+func (r *AttackLayer7TopService) Attacks(ctx context.Context, query AttackLayer7TopAttacksParams, opts ...option.RequestOption) (res *AttackLayer7TopAttacksResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AttackLayer7TopAttacksResponseEnvelope
+ path := "radar/attacks/layer7/top/attacks"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Get the Industry of attacks.
+func (r *AttackLayer7TopService) Industry(ctx context.Context, query AttackLayer7TopIndustryParams, opts ...option.RequestOption) (res *AttackLayer7TopIndustryResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AttackLayer7TopIndustryResponseEnvelope
+ path := "radar/attacks/layer7/top/industry"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Get the Verticals of attacks.
+func (r *AttackLayer7TopService) Vertical(ctx context.Context, query AttackLayer7TopVerticalParams, opts ...option.RequestOption) (res *AttackLayer7TopVerticalResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AttackLayer7TopVerticalResponseEnvelope
+ path := "radar/attacks/layer7/top/vertical"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type AttackLayer7TopAttacksResponse struct {
+ Meta AttackLayer7TopAttacksResponseMeta `json:"meta,required"`
+ Top0 []AttackLayer7TopAttacksResponseTop0 `json:"top_0,required"`
+ JSON attackLayer7TopAttacksResponseJSON `json:"-"`
+}
+
+// attackLayer7TopAttacksResponseJSON contains the JSON metadata for the struct
+// [AttackLayer7TopAttacksResponse]
+type attackLayer7TopAttacksResponseJSON struct {
+ Meta apijson.Field
+ Top0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7TopAttacksResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TopAttacksResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7TopAttacksResponseMeta struct {
+ DateRange []AttackLayer7TopAttacksResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ ConfidenceInfo AttackLayer7TopAttacksResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON attackLayer7TopAttacksResponseMetaJSON `json:"-"`
+}
+
+// attackLayer7TopAttacksResponseMetaJSON contains the JSON metadata for the struct
+// [AttackLayer7TopAttacksResponseMeta]
+type attackLayer7TopAttacksResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7TopAttacksResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TopAttacksResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7TopAttacksResponseMetaDateRange 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 attackLayer7TopAttacksResponseMetaDateRangeJSON `json:"-"`
+}
+
+// attackLayer7TopAttacksResponseMetaDateRangeJSON contains the JSON metadata for
+// the struct [AttackLayer7TopAttacksResponseMetaDateRange]
+type attackLayer7TopAttacksResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7TopAttacksResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TopAttacksResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7TopAttacksResponseMetaConfidenceInfo struct {
+ Annotations []AttackLayer7TopAttacksResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON attackLayer7TopAttacksResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// attackLayer7TopAttacksResponseMetaConfidenceInfoJSON contains the JSON metadata
+// for the struct [AttackLayer7TopAttacksResponseMetaConfidenceInfo]
+type attackLayer7TopAttacksResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7TopAttacksResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TopAttacksResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7TopAttacksResponseMetaConfidenceInfoAnnotation 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 attackLayer7TopAttacksResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// attackLayer7TopAttacksResponseMetaConfidenceInfoAnnotationJSON contains the JSON
+// metadata for the struct
+// [AttackLayer7TopAttacksResponseMetaConfidenceInfoAnnotation]
+type attackLayer7TopAttacksResponseMetaConfidenceInfoAnnotationJSON 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 *AttackLayer7TopAttacksResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TopAttacksResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7TopAttacksResponseTop0 struct {
+ OriginCountryAlpha2 string `json:"originCountryAlpha2,required"`
+ OriginCountryName string `json:"originCountryName,required"`
+ TargetCountryAlpha2 string `json:"targetCountryAlpha2,required"`
+ TargetCountryName string `json:"targetCountryName,required"`
+ Value string `json:"value,required"`
+ JSON attackLayer7TopAttacksResponseTop0JSON `json:"-"`
+}
+
+// attackLayer7TopAttacksResponseTop0JSON contains the JSON metadata for the struct
+// [AttackLayer7TopAttacksResponseTop0]
+type attackLayer7TopAttacksResponseTop0JSON struct {
+ OriginCountryAlpha2 apijson.Field
+ OriginCountryName apijson.Field
+ TargetCountryAlpha2 apijson.Field
+ TargetCountryName apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7TopAttacksResponseTop0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TopAttacksResponseTop0JSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7TopIndustryResponse struct {
+ Meta AttackLayer7TopIndustryResponseMeta `json:"meta,required"`
+ Top0 []AttackLayer7TopIndustryResponseTop0 `json:"top_0,required"`
+ JSON attackLayer7TopIndustryResponseJSON `json:"-"`
+}
+
+// attackLayer7TopIndustryResponseJSON contains the JSON metadata for the struct
+// [AttackLayer7TopIndustryResponse]
+type attackLayer7TopIndustryResponseJSON struct {
+ Meta apijson.Field
+ Top0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7TopIndustryResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TopIndustryResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7TopIndustryResponseMeta struct {
+ DateRange []AttackLayer7TopIndustryResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ ConfidenceInfo AttackLayer7TopIndustryResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON attackLayer7TopIndustryResponseMetaJSON `json:"-"`
+}
+
+// attackLayer7TopIndustryResponseMetaJSON contains the JSON metadata for the
+// struct [AttackLayer7TopIndustryResponseMeta]
+type attackLayer7TopIndustryResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7TopIndustryResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TopIndustryResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7TopIndustryResponseMetaDateRange 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 attackLayer7TopIndustryResponseMetaDateRangeJSON `json:"-"`
+}
+
+// attackLayer7TopIndustryResponseMetaDateRangeJSON contains the JSON metadata for
+// the struct [AttackLayer7TopIndustryResponseMetaDateRange]
+type attackLayer7TopIndustryResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7TopIndustryResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TopIndustryResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7TopIndustryResponseMetaConfidenceInfo struct {
+ Annotations []AttackLayer7TopIndustryResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON attackLayer7TopIndustryResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// attackLayer7TopIndustryResponseMetaConfidenceInfoJSON contains the JSON metadata
+// for the struct [AttackLayer7TopIndustryResponseMetaConfidenceInfo]
+type attackLayer7TopIndustryResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7TopIndustryResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TopIndustryResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7TopIndustryResponseMetaConfidenceInfoAnnotation 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 attackLayer7TopIndustryResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// attackLayer7TopIndustryResponseMetaConfidenceInfoAnnotationJSON contains the
+// JSON metadata for the struct
+// [AttackLayer7TopIndustryResponseMetaConfidenceInfoAnnotation]
+type attackLayer7TopIndustryResponseMetaConfidenceInfoAnnotationJSON 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 *AttackLayer7TopIndustryResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TopIndustryResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7TopIndustryResponseTop0 struct {
+ Name string `json:"name,required"`
+ Value string `json:"value,required"`
+ JSON attackLayer7TopIndustryResponseTop0JSON `json:"-"`
+}
+
+// attackLayer7TopIndustryResponseTop0JSON contains the JSON metadata for the
+// struct [AttackLayer7TopIndustryResponseTop0]
+type attackLayer7TopIndustryResponseTop0JSON struct {
+ Name apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7TopIndustryResponseTop0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TopIndustryResponseTop0JSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7TopVerticalResponse struct {
+ Meta AttackLayer7TopVerticalResponseMeta `json:"meta,required"`
+ Top0 []AttackLayer7TopVerticalResponseTop0 `json:"top_0,required"`
+ JSON attackLayer7TopVerticalResponseJSON `json:"-"`
+}
+
+// attackLayer7TopVerticalResponseJSON contains the JSON metadata for the struct
+// [AttackLayer7TopVerticalResponse]
+type attackLayer7TopVerticalResponseJSON struct {
+ Meta apijson.Field
+ Top0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7TopVerticalResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TopVerticalResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7TopVerticalResponseMeta struct {
+ DateRange []AttackLayer7TopVerticalResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ ConfidenceInfo AttackLayer7TopVerticalResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON attackLayer7TopVerticalResponseMetaJSON `json:"-"`
+}
+
+// attackLayer7TopVerticalResponseMetaJSON contains the JSON metadata for the
+// struct [AttackLayer7TopVerticalResponseMeta]
+type attackLayer7TopVerticalResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7TopVerticalResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TopVerticalResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7TopVerticalResponseMetaDateRange 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 attackLayer7TopVerticalResponseMetaDateRangeJSON `json:"-"`
+}
+
+// attackLayer7TopVerticalResponseMetaDateRangeJSON contains the JSON metadata for
+// the struct [AttackLayer7TopVerticalResponseMetaDateRange]
+type attackLayer7TopVerticalResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7TopVerticalResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TopVerticalResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7TopVerticalResponseMetaConfidenceInfo struct {
+ Annotations []AttackLayer7TopVerticalResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON attackLayer7TopVerticalResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// attackLayer7TopVerticalResponseMetaConfidenceInfoJSON contains the JSON metadata
+// for the struct [AttackLayer7TopVerticalResponseMetaConfidenceInfo]
+type attackLayer7TopVerticalResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7TopVerticalResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TopVerticalResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7TopVerticalResponseMetaConfidenceInfoAnnotation 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 attackLayer7TopVerticalResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// attackLayer7TopVerticalResponseMetaConfidenceInfoAnnotationJSON contains the
+// JSON metadata for the struct
+// [AttackLayer7TopVerticalResponseMetaConfidenceInfoAnnotation]
+type attackLayer7TopVerticalResponseMetaConfidenceInfoAnnotationJSON 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 *AttackLayer7TopVerticalResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TopVerticalResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7TopVerticalResponseTop0 struct {
+ Name string `json:"name,required"`
+ Value string `json:"value,required"`
+ JSON attackLayer7TopVerticalResponseTop0JSON `json:"-"`
+}
+
+// attackLayer7TopVerticalResponseTop0JSON contains the JSON metadata for the
+// struct [AttackLayer7TopVerticalResponseTop0]
+type attackLayer7TopVerticalResponseTop0JSON struct {
+ Name apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7TopVerticalResponseTop0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TopVerticalResponseTop0JSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7TopAttacksParams 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"`
+ // 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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]AttackLayer7TopAttacksParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Format results are returned in.
+ Format param.Field[AttackLayer7TopAttacksParamsFormat] `query:"format"`
+ // Limit the number of objects in the response.
+ Limit param.Field[int64] `query:"limit"`
+ // Array of attack origin/target location attack limits. Together with
+ // `limitPerLocation`, limits how many objects will be fetched per origin/target
+ // location.
+ LimitDirection param.Field[AttackLayer7TopAttacksParamsLimitDirection] `query:"limitDirection"`
+ // Limit the number of attacks per origin/target (refer to `limitDirection`
+ // parameter) location.
+ LimitPerLocation param.Field[int64] `query:"limitPerLocation"`
+ // 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"`
+ // Attack magnitude can be defined by total requests mitigated or by total zones
+ // attacked.
+ Magnitude param.Field[AttackLayer7TopAttacksParamsMagnitude] `query:"magnitude"`
+ // Array of names that will be used to name the series in responses.
+ Name param.Field[[]string] `query:"name"`
+}
+
+// URLQuery serializes [AttackLayer7TopAttacksParams]'s query parameters as
+// `url.Values`.
+func (r AttackLayer7TopAttacksParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type AttackLayer7TopAttacksParamsDateRange string
+
+const (
+ AttackLayer7TopAttacksParamsDateRange1d AttackLayer7TopAttacksParamsDateRange = "1d"
+ AttackLayer7TopAttacksParamsDateRange2d AttackLayer7TopAttacksParamsDateRange = "2d"
+ AttackLayer7TopAttacksParamsDateRange7d AttackLayer7TopAttacksParamsDateRange = "7d"
+ AttackLayer7TopAttacksParamsDateRange14d AttackLayer7TopAttacksParamsDateRange = "14d"
+ AttackLayer7TopAttacksParamsDateRange28d AttackLayer7TopAttacksParamsDateRange = "28d"
+ AttackLayer7TopAttacksParamsDateRange12w AttackLayer7TopAttacksParamsDateRange = "12w"
+ AttackLayer7TopAttacksParamsDateRange24w AttackLayer7TopAttacksParamsDateRange = "24w"
+ AttackLayer7TopAttacksParamsDateRange52w AttackLayer7TopAttacksParamsDateRange = "52w"
+ AttackLayer7TopAttacksParamsDateRange1dControl AttackLayer7TopAttacksParamsDateRange = "1dControl"
+ AttackLayer7TopAttacksParamsDateRange2dControl AttackLayer7TopAttacksParamsDateRange = "2dControl"
+ AttackLayer7TopAttacksParamsDateRange7dControl AttackLayer7TopAttacksParamsDateRange = "7dControl"
+ AttackLayer7TopAttacksParamsDateRange14dControl AttackLayer7TopAttacksParamsDateRange = "14dControl"
+ AttackLayer7TopAttacksParamsDateRange28dControl AttackLayer7TopAttacksParamsDateRange = "28dControl"
+ AttackLayer7TopAttacksParamsDateRange12wControl AttackLayer7TopAttacksParamsDateRange = "12wControl"
+ AttackLayer7TopAttacksParamsDateRange24wControl AttackLayer7TopAttacksParamsDateRange = "24wControl"
+)
+
+// Format results are returned in.
+type AttackLayer7TopAttacksParamsFormat string
+
+const (
+ AttackLayer7TopAttacksParamsFormatJson AttackLayer7TopAttacksParamsFormat = "JSON"
+ AttackLayer7TopAttacksParamsFormatCsv AttackLayer7TopAttacksParamsFormat = "CSV"
+)
+
+// Array of attack origin/target location attack limits. Together with
+// `limitPerLocation`, limits how many objects will be fetched per origin/target
+// location.
+type AttackLayer7TopAttacksParamsLimitDirection string
+
+const (
+ AttackLayer7TopAttacksParamsLimitDirectionOrigin AttackLayer7TopAttacksParamsLimitDirection = "ORIGIN"
+ AttackLayer7TopAttacksParamsLimitDirectionTarget AttackLayer7TopAttacksParamsLimitDirection = "TARGET"
+)
+
+// Attack magnitude can be defined by total requests mitigated or by total zones
+// attacked.
+type AttackLayer7TopAttacksParamsMagnitude string
+
+const (
+ AttackLayer7TopAttacksParamsMagnitudeAffectedZones AttackLayer7TopAttacksParamsMagnitude = "AFFECTED_ZONES"
+ AttackLayer7TopAttacksParamsMagnitudeMitigatedRequests AttackLayer7TopAttacksParamsMagnitude = "MITIGATED_REQUESTS"
+)
+
+type AttackLayer7TopAttacksResponseEnvelope struct {
+ Result AttackLayer7TopAttacksResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON attackLayer7TopAttacksResponseEnvelopeJSON `json:"-"`
+}
+
+// attackLayer7TopAttacksResponseEnvelopeJSON contains the JSON metadata for the
+// struct [AttackLayer7TopAttacksResponseEnvelope]
+type attackLayer7TopAttacksResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7TopAttacksResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TopAttacksResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7TopIndustryParams 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"`
+ // 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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]AttackLayer7TopIndustryParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Format results are returned in.
+ Format param.Field[AttackLayer7TopIndustryParamsFormat] `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 [AttackLayer7TopIndustryParams]'s query parameters as
+// `url.Values`.
+func (r AttackLayer7TopIndustryParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type AttackLayer7TopIndustryParamsDateRange string
+
+const (
+ AttackLayer7TopIndustryParamsDateRange1d AttackLayer7TopIndustryParamsDateRange = "1d"
+ AttackLayer7TopIndustryParamsDateRange2d AttackLayer7TopIndustryParamsDateRange = "2d"
+ AttackLayer7TopIndustryParamsDateRange7d AttackLayer7TopIndustryParamsDateRange = "7d"
+ AttackLayer7TopIndustryParamsDateRange14d AttackLayer7TopIndustryParamsDateRange = "14d"
+ AttackLayer7TopIndustryParamsDateRange28d AttackLayer7TopIndustryParamsDateRange = "28d"
+ AttackLayer7TopIndustryParamsDateRange12w AttackLayer7TopIndustryParamsDateRange = "12w"
+ AttackLayer7TopIndustryParamsDateRange24w AttackLayer7TopIndustryParamsDateRange = "24w"
+ AttackLayer7TopIndustryParamsDateRange52w AttackLayer7TopIndustryParamsDateRange = "52w"
+ AttackLayer7TopIndustryParamsDateRange1dControl AttackLayer7TopIndustryParamsDateRange = "1dControl"
+ AttackLayer7TopIndustryParamsDateRange2dControl AttackLayer7TopIndustryParamsDateRange = "2dControl"
+ AttackLayer7TopIndustryParamsDateRange7dControl AttackLayer7TopIndustryParamsDateRange = "7dControl"
+ AttackLayer7TopIndustryParamsDateRange14dControl AttackLayer7TopIndustryParamsDateRange = "14dControl"
+ AttackLayer7TopIndustryParamsDateRange28dControl AttackLayer7TopIndustryParamsDateRange = "28dControl"
+ AttackLayer7TopIndustryParamsDateRange12wControl AttackLayer7TopIndustryParamsDateRange = "12wControl"
+ AttackLayer7TopIndustryParamsDateRange24wControl AttackLayer7TopIndustryParamsDateRange = "24wControl"
+)
+
+// Format results are returned in.
+type AttackLayer7TopIndustryParamsFormat string
+
+const (
+ AttackLayer7TopIndustryParamsFormatJson AttackLayer7TopIndustryParamsFormat = "JSON"
+ AttackLayer7TopIndustryParamsFormatCsv AttackLayer7TopIndustryParamsFormat = "CSV"
+)
+
+type AttackLayer7TopIndustryResponseEnvelope struct {
+ Result AttackLayer7TopIndustryResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON attackLayer7TopIndustryResponseEnvelopeJSON `json:"-"`
+}
+
+// attackLayer7TopIndustryResponseEnvelopeJSON contains the JSON metadata for the
+// struct [AttackLayer7TopIndustryResponseEnvelope]
+type attackLayer7TopIndustryResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7TopIndustryResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TopIndustryResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7TopVerticalParams 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"`
+ // 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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]AttackLayer7TopVerticalParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Format results are returned in.
+ Format param.Field[AttackLayer7TopVerticalParamsFormat] `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 [AttackLayer7TopVerticalParams]'s query parameters as
+// `url.Values`.
+func (r AttackLayer7TopVerticalParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type AttackLayer7TopVerticalParamsDateRange string
+
+const (
+ AttackLayer7TopVerticalParamsDateRange1d AttackLayer7TopVerticalParamsDateRange = "1d"
+ AttackLayer7TopVerticalParamsDateRange2d AttackLayer7TopVerticalParamsDateRange = "2d"
+ AttackLayer7TopVerticalParamsDateRange7d AttackLayer7TopVerticalParamsDateRange = "7d"
+ AttackLayer7TopVerticalParamsDateRange14d AttackLayer7TopVerticalParamsDateRange = "14d"
+ AttackLayer7TopVerticalParamsDateRange28d AttackLayer7TopVerticalParamsDateRange = "28d"
+ AttackLayer7TopVerticalParamsDateRange12w AttackLayer7TopVerticalParamsDateRange = "12w"
+ AttackLayer7TopVerticalParamsDateRange24w AttackLayer7TopVerticalParamsDateRange = "24w"
+ AttackLayer7TopVerticalParamsDateRange52w AttackLayer7TopVerticalParamsDateRange = "52w"
+ AttackLayer7TopVerticalParamsDateRange1dControl AttackLayer7TopVerticalParamsDateRange = "1dControl"
+ AttackLayer7TopVerticalParamsDateRange2dControl AttackLayer7TopVerticalParamsDateRange = "2dControl"
+ AttackLayer7TopVerticalParamsDateRange7dControl AttackLayer7TopVerticalParamsDateRange = "7dControl"
+ AttackLayer7TopVerticalParamsDateRange14dControl AttackLayer7TopVerticalParamsDateRange = "14dControl"
+ AttackLayer7TopVerticalParamsDateRange28dControl AttackLayer7TopVerticalParamsDateRange = "28dControl"
+ AttackLayer7TopVerticalParamsDateRange12wControl AttackLayer7TopVerticalParamsDateRange = "12wControl"
+ AttackLayer7TopVerticalParamsDateRange24wControl AttackLayer7TopVerticalParamsDateRange = "24wControl"
+)
+
+// Format results are returned in.
+type AttackLayer7TopVerticalParamsFormat string
+
+const (
+ AttackLayer7TopVerticalParamsFormatJson AttackLayer7TopVerticalParamsFormat = "JSON"
+ AttackLayer7TopVerticalParamsFormatCsv AttackLayer7TopVerticalParamsFormat = "CSV"
+)
+
+type AttackLayer7TopVerticalResponseEnvelope struct {
+ Result AttackLayer7TopVerticalResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON attackLayer7TopVerticalResponseEnvelopeJSON `json:"-"`
+}
+
+// attackLayer7TopVerticalResponseEnvelopeJSON contains the JSON metadata for the
+// struct [AttackLayer7TopVerticalResponseEnvelope]
+type attackLayer7TopVerticalResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7TopVerticalResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TopVerticalResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/radar/attacklayer7top_test.go b/radar/attacklayer7top_test.go
new file mode 100644
index 00000000000..d642741dac8
--- /dev/null
+++ b/radar/attacklayer7top_test.go
@@ -0,0 +1,121 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/radar"
+)
+
+func TestAttackLayer7TopAttacksWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Attacks.Layer7.Top.Attacks(context.TODO(), radar.AttackLayer7TopAttacksParams{
+ 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([]radar.AttackLayer7TopAttacksParamsDateRange{radar.AttackLayer7TopAttacksParamsDateRange1d, radar.AttackLayer7TopAttacksParamsDateRange2d, radar.AttackLayer7TopAttacksParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Format: cloudflare.F(radar.AttackLayer7TopAttacksParamsFormatJson),
+ Limit: cloudflare.F(int64(5)),
+ LimitDirection: cloudflare.F(radar.AttackLayer7TopAttacksParamsLimitDirectionOrigin),
+ LimitPerLocation: cloudflare.F(int64(10)),
+ Location: cloudflare.F([]string{"string", "string", "string"}),
+ Magnitude: cloudflare.F(radar.AttackLayer7TopAttacksParamsMagnitudeMitigatedRequests),
+ 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())
+ }
+}
+
+func TestAttackLayer7TopIndustryWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Attacks.Layer7.Top.Industry(context.TODO(), radar.AttackLayer7TopIndustryParams{
+ 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([]radar.AttackLayer7TopIndustryParamsDateRange{radar.AttackLayer7TopIndustryParamsDateRange1d, radar.AttackLayer7TopIndustryParamsDateRange2d, radar.AttackLayer7TopIndustryParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Format: cloudflare.F(radar.AttackLayer7TopIndustryParamsFormatJson),
+ 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())
+ }
+}
+
+func TestAttackLayer7TopVerticalWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Attacks.Layer7.Top.Vertical(context.TODO(), radar.AttackLayer7TopVerticalParams{
+ 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([]radar.AttackLayer7TopVerticalParamsDateRange{radar.AttackLayer7TopVerticalParamsDateRange1d, radar.AttackLayer7TopVerticalParamsDateRange2d, radar.AttackLayer7TopVerticalParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Format: cloudflare.F(radar.AttackLayer7TopVerticalParamsFormatJson),
+ 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/radar/attacklayer7topase.go b/radar/attacklayer7topase.go
new file mode 100644
index 00000000000..05d41c96092
--- /dev/null
+++ b/radar/attacklayer7topase.go
@@ -0,0 +1,291 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "context"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// AttackLayer7TopAseService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewAttackLayer7TopAseService] method
+// instead.
+type AttackLayer7TopAseService struct {
+ Options []option.RequestOption
+}
+
+// NewAttackLayer7TopAseService generates a new service that applies the given
+// options to each request. These options are applied after the parent client's
+// options (if there is one), and before any request-specific options.
+func NewAttackLayer7TopAseService(opts ...option.RequestOption) (r *AttackLayer7TopAseService) {
+ r = &AttackLayer7TopAseService{}
+ r.Options = opts
+ return
+}
+
+// Get the top origin Autonomous Systems of and by layer 7 attacks. Values are a
+// percentage out of the total layer 7 attacks. The origin Autonomous Systems is
+// determined by the client IP.
+func (r *AttackLayer7TopAseService) Origin(ctx context.Context, query AttackLayer7TopAseOriginParams, opts ...option.RequestOption) (res *AttackLayer7TopAseOriginResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AttackLayer7TopAseOriginResponseEnvelope
+ path := "radar/attacks/layer7/top/ases/origin"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type AttackLayer7TopAseOriginResponse struct {
+ Meta AttackLayer7TopAseOriginResponseMeta `json:"meta,required"`
+ Top0 []AttackLayer7TopAseOriginResponseTop0 `json:"top_0,required"`
+ JSON attackLayer7TopAseOriginResponseJSON `json:"-"`
+}
+
+// attackLayer7TopAseOriginResponseJSON contains the JSON metadata for the struct
+// [AttackLayer7TopAseOriginResponse]
+type attackLayer7TopAseOriginResponseJSON struct {
+ Meta apijson.Field
+ Top0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7TopAseOriginResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TopAseOriginResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7TopAseOriginResponseMeta struct {
+ DateRange []AttackLayer7TopAseOriginResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ ConfidenceInfo AttackLayer7TopAseOriginResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON attackLayer7TopAseOriginResponseMetaJSON `json:"-"`
+}
+
+// attackLayer7TopAseOriginResponseMetaJSON contains the JSON metadata for the
+// struct [AttackLayer7TopAseOriginResponseMeta]
+type attackLayer7TopAseOriginResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7TopAseOriginResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TopAseOriginResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7TopAseOriginResponseMetaDateRange 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 attackLayer7TopAseOriginResponseMetaDateRangeJSON `json:"-"`
+}
+
+// attackLayer7TopAseOriginResponseMetaDateRangeJSON contains the JSON metadata for
+// the struct [AttackLayer7TopAseOriginResponseMetaDateRange]
+type attackLayer7TopAseOriginResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7TopAseOriginResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TopAseOriginResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7TopAseOriginResponseMetaConfidenceInfo struct {
+ Annotations []AttackLayer7TopAseOriginResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON attackLayer7TopAseOriginResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// attackLayer7TopAseOriginResponseMetaConfidenceInfoJSON contains the JSON
+// metadata for the struct [AttackLayer7TopAseOriginResponseMetaConfidenceInfo]
+type attackLayer7TopAseOriginResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7TopAseOriginResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TopAseOriginResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7TopAseOriginResponseMetaConfidenceInfoAnnotation 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 attackLayer7TopAseOriginResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// attackLayer7TopAseOriginResponseMetaConfidenceInfoAnnotationJSON contains the
+// JSON metadata for the struct
+// [AttackLayer7TopAseOriginResponseMetaConfidenceInfoAnnotation]
+type attackLayer7TopAseOriginResponseMetaConfidenceInfoAnnotationJSON 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 *AttackLayer7TopAseOriginResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TopAseOriginResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7TopAseOriginResponseTop0 struct {
+ OriginASN string `json:"originAsn,required"`
+ OriginASNName string `json:"originAsnName,required"`
+ Rank float64 `json:"rank,required"`
+ Value string `json:"value,required"`
+ JSON attackLayer7TopAseOriginResponseTop0JSON `json:"-"`
+}
+
+// attackLayer7TopAseOriginResponseTop0JSON contains the JSON metadata for the
+// struct [AttackLayer7TopAseOriginResponseTop0]
+type attackLayer7TopAseOriginResponseTop0JSON struct {
+ OriginASN apijson.Field
+ OriginASNName apijson.Field
+ Rank apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7TopAseOriginResponseTop0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TopAseOriginResponseTop0JSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7TopAseOriginParams 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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]AttackLayer7TopAseOriginParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Format results are returned in.
+ Format param.Field[AttackLayer7TopAseOriginParamsFormat] `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 [AttackLayer7TopAseOriginParams]'s query parameters as
+// `url.Values`.
+func (r AttackLayer7TopAseOriginParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type AttackLayer7TopAseOriginParamsDateRange string
+
+const (
+ AttackLayer7TopAseOriginParamsDateRange1d AttackLayer7TopAseOriginParamsDateRange = "1d"
+ AttackLayer7TopAseOriginParamsDateRange2d AttackLayer7TopAseOriginParamsDateRange = "2d"
+ AttackLayer7TopAseOriginParamsDateRange7d AttackLayer7TopAseOriginParamsDateRange = "7d"
+ AttackLayer7TopAseOriginParamsDateRange14d AttackLayer7TopAseOriginParamsDateRange = "14d"
+ AttackLayer7TopAseOriginParamsDateRange28d AttackLayer7TopAseOriginParamsDateRange = "28d"
+ AttackLayer7TopAseOriginParamsDateRange12w AttackLayer7TopAseOriginParamsDateRange = "12w"
+ AttackLayer7TopAseOriginParamsDateRange24w AttackLayer7TopAseOriginParamsDateRange = "24w"
+ AttackLayer7TopAseOriginParamsDateRange52w AttackLayer7TopAseOriginParamsDateRange = "52w"
+ AttackLayer7TopAseOriginParamsDateRange1dControl AttackLayer7TopAseOriginParamsDateRange = "1dControl"
+ AttackLayer7TopAseOriginParamsDateRange2dControl AttackLayer7TopAseOriginParamsDateRange = "2dControl"
+ AttackLayer7TopAseOriginParamsDateRange7dControl AttackLayer7TopAseOriginParamsDateRange = "7dControl"
+ AttackLayer7TopAseOriginParamsDateRange14dControl AttackLayer7TopAseOriginParamsDateRange = "14dControl"
+ AttackLayer7TopAseOriginParamsDateRange28dControl AttackLayer7TopAseOriginParamsDateRange = "28dControl"
+ AttackLayer7TopAseOriginParamsDateRange12wControl AttackLayer7TopAseOriginParamsDateRange = "12wControl"
+ AttackLayer7TopAseOriginParamsDateRange24wControl AttackLayer7TopAseOriginParamsDateRange = "24wControl"
+)
+
+// Format results are returned in.
+type AttackLayer7TopAseOriginParamsFormat string
+
+const (
+ AttackLayer7TopAseOriginParamsFormatJson AttackLayer7TopAseOriginParamsFormat = "JSON"
+ AttackLayer7TopAseOriginParamsFormatCsv AttackLayer7TopAseOriginParamsFormat = "CSV"
+)
+
+type AttackLayer7TopAseOriginResponseEnvelope struct {
+ Result AttackLayer7TopAseOriginResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON attackLayer7TopAseOriginResponseEnvelopeJSON `json:"-"`
+}
+
+// attackLayer7TopAseOriginResponseEnvelopeJSON contains the JSON metadata for the
+// struct [AttackLayer7TopAseOriginResponseEnvelope]
+type attackLayer7TopAseOriginResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7TopAseOriginResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TopAseOriginResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/radar/attacklayer7topase_test.go b/radar/attacklayer7topase_test.go
new file mode 100644
index 00000000000..a6e6ba6ba4d
--- /dev/null
+++ b/radar/attacklayer7topase_test.go
@@ -0,0 +1,49 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/radar"
+)
+
+func TestAttackLayer7TopAseOriginWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Attacks.Layer7.Top.Ases.Origin(context.TODO(), radar.AttackLayer7TopAseOriginParams{
+ Continent: cloudflare.F([]string{"string", "string", "string"}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.AttackLayer7TopAseOriginParamsDateRange{radar.AttackLayer7TopAseOriginParamsDateRange1d, radar.AttackLayer7TopAseOriginParamsDateRange2d, radar.AttackLayer7TopAseOriginParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Format: cloudflare.F(radar.AttackLayer7TopAseOriginParamsFormatJson),
+ 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/radar/attacklayer7toplocation.go b/radar/attacklayer7toplocation.go
new file mode 100644
index 00000000000..f5b848c4e3c
--- /dev/null
+++ b/radar/attacklayer7toplocation.go
@@ -0,0 +1,546 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "context"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// AttackLayer7TopLocationService contains methods and other services that help
+// with interacting with the cloudflare API. Note, unlike clients, this service
+// does not read variables from the environment automatically. You should not
+// instantiate this service directly, and instead use the
+// [NewAttackLayer7TopLocationService] method instead.
+type AttackLayer7TopLocationService struct {
+ Options []option.RequestOption
+}
+
+// NewAttackLayer7TopLocationService generates a new service that applies the given
+// options to each request. These options are applied after the parent client's
+// options (if there is one), and before any request-specific options.
+func NewAttackLayer7TopLocationService(opts ...option.RequestOption) (r *AttackLayer7TopLocationService) {
+ r = &AttackLayer7TopLocationService{}
+ r.Options = opts
+ return
+}
+
+// Get the top origin locations of and by layer 7 attacks. Values are a percentage
+// out of the total layer 7 attacks. The origin location is determined by the
+// client IP.
+func (r *AttackLayer7TopLocationService) Origin(ctx context.Context, query AttackLayer7TopLocationOriginParams, opts ...option.RequestOption) (res *AttackLayer7TopLocationOriginResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AttackLayer7TopLocationOriginResponseEnvelope
+ path := "radar/attacks/layer7/top/locations/origin"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Get the top target locations of and by layer 7 attacks. Values are a percentage
+// out of the total layer 7 attacks. The target location is determined by the
+// attacked zone's billing country, when available.
+func (r *AttackLayer7TopLocationService) Target(ctx context.Context, query AttackLayer7TopLocationTargetParams, opts ...option.RequestOption) (res *AttackLayer7TopLocationTargetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AttackLayer7TopLocationTargetResponseEnvelope
+ path := "radar/attacks/layer7/top/locations/target"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type AttackLayer7TopLocationOriginResponse struct {
+ Meta AttackLayer7TopLocationOriginResponseMeta `json:"meta,required"`
+ Top0 []AttackLayer7TopLocationOriginResponseTop0 `json:"top_0,required"`
+ JSON attackLayer7TopLocationOriginResponseJSON `json:"-"`
+}
+
+// attackLayer7TopLocationOriginResponseJSON contains the JSON metadata for the
+// struct [AttackLayer7TopLocationOriginResponse]
+type attackLayer7TopLocationOriginResponseJSON struct {
+ Meta apijson.Field
+ Top0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7TopLocationOriginResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TopLocationOriginResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7TopLocationOriginResponseMeta struct {
+ DateRange []AttackLayer7TopLocationOriginResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ ConfidenceInfo AttackLayer7TopLocationOriginResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON attackLayer7TopLocationOriginResponseMetaJSON `json:"-"`
+}
+
+// attackLayer7TopLocationOriginResponseMetaJSON contains the JSON metadata for the
+// struct [AttackLayer7TopLocationOriginResponseMeta]
+type attackLayer7TopLocationOriginResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7TopLocationOriginResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TopLocationOriginResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7TopLocationOriginResponseMetaDateRange 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 attackLayer7TopLocationOriginResponseMetaDateRangeJSON `json:"-"`
+}
+
+// attackLayer7TopLocationOriginResponseMetaDateRangeJSON contains the JSON
+// metadata for the struct [AttackLayer7TopLocationOriginResponseMetaDateRange]
+type attackLayer7TopLocationOriginResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7TopLocationOriginResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TopLocationOriginResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7TopLocationOriginResponseMetaConfidenceInfo struct {
+ Annotations []AttackLayer7TopLocationOriginResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON attackLayer7TopLocationOriginResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// attackLayer7TopLocationOriginResponseMetaConfidenceInfoJSON contains the JSON
+// metadata for the struct
+// [AttackLayer7TopLocationOriginResponseMetaConfidenceInfo]
+type attackLayer7TopLocationOriginResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7TopLocationOriginResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TopLocationOriginResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7TopLocationOriginResponseMetaConfidenceInfoAnnotation 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 attackLayer7TopLocationOriginResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// attackLayer7TopLocationOriginResponseMetaConfidenceInfoAnnotationJSON contains
+// the JSON metadata for the struct
+// [AttackLayer7TopLocationOriginResponseMetaConfidenceInfoAnnotation]
+type attackLayer7TopLocationOriginResponseMetaConfidenceInfoAnnotationJSON 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 *AttackLayer7TopLocationOriginResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TopLocationOriginResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7TopLocationOriginResponseTop0 struct {
+ OriginCountryAlpha2 string `json:"originCountryAlpha2,required"`
+ OriginCountryName string `json:"originCountryName,required"`
+ Rank float64 `json:"rank,required"`
+ Value string `json:"value,required"`
+ JSON attackLayer7TopLocationOriginResponseTop0JSON `json:"-"`
+}
+
+// attackLayer7TopLocationOriginResponseTop0JSON contains the JSON metadata for the
+// struct [AttackLayer7TopLocationOriginResponseTop0]
+type attackLayer7TopLocationOriginResponseTop0JSON struct {
+ OriginCountryAlpha2 apijson.Field
+ OriginCountryName apijson.Field
+ Rank apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7TopLocationOriginResponseTop0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TopLocationOriginResponseTop0JSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7TopLocationTargetResponse struct {
+ Meta AttackLayer7TopLocationTargetResponseMeta `json:"meta,required"`
+ Top0 []AttackLayer7TopLocationTargetResponseTop0 `json:"top_0,required"`
+ JSON attackLayer7TopLocationTargetResponseJSON `json:"-"`
+}
+
+// attackLayer7TopLocationTargetResponseJSON contains the JSON metadata for the
+// struct [AttackLayer7TopLocationTargetResponse]
+type attackLayer7TopLocationTargetResponseJSON struct {
+ Meta apijson.Field
+ Top0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7TopLocationTargetResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TopLocationTargetResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7TopLocationTargetResponseMeta struct {
+ DateRange []AttackLayer7TopLocationTargetResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ ConfidenceInfo AttackLayer7TopLocationTargetResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON attackLayer7TopLocationTargetResponseMetaJSON `json:"-"`
+}
+
+// attackLayer7TopLocationTargetResponseMetaJSON contains the JSON metadata for the
+// struct [AttackLayer7TopLocationTargetResponseMeta]
+type attackLayer7TopLocationTargetResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7TopLocationTargetResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TopLocationTargetResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7TopLocationTargetResponseMetaDateRange 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 attackLayer7TopLocationTargetResponseMetaDateRangeJSON `json:"-"`
+}
+
+// attackLayer7TopLocationTargetResponseMetaDateRangeJSON contains the JSON
+// metadata for the struct [AttackLayer7TopLocationTargetResponseMetaDateRange]
+type attackLayer7TopLocationTargetResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7TopLocationTargetResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TopLocationTargetResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7TopLocationTargetResponseMetaConfidenceInfo struct {
+ Annotations []AttackLayer7TopLocationTargetResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON attackLayer7TopLocationTargetResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// attackLayer7TopLocationTargetResponseMetaConfidenceInfoJSON contains the JSON
+// metadata for the struct
+// [AttackLayer7TopLocationTargetResponseMetaConfidenceInfo]
+type attackLayer7TopLocationTargetResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7TopLocationTargetResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TopLocationTargetResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7TopLocationTargetResponseMetaConfidenceInfoAnnotation 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 attackLayer7TopLocationTargetResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// attackLayer7TopLocationTargetResponseMetaConfidenceInfoAnnotationJSON contains
+// the JSON metadata for the struct
+// [AttackLayer7TopLocationTargetResponseMetaConfidenceInfoAnnotation]
+type attackLayer7TopLocationTargetResponseMetaConfidenceInfoAnnotationJSON 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 *AttackLayer7TopLocationTargetResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TopLocationTargetResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7TopLocationTargetResponseTop0 struct {
+ Rank float64 `json:"rank,required"`
+ TargetCountryAlpha2 string `json:"targetCountryAlpha2,required"`
+ TargetCountryName string `json:"targetCountryName,required"`
+ Value string `json:"value,required"`
+ JSON attackLayer7TopLocationTargetResponseTop0JSON `json:"-"`
+}
+
+// attackLayer7TopLocationTargetResponseTop0JSON contains the JSON metadata for the
+// struct [AttackLayer7TopLocationTargetResponseTop0]
+type attackLayer7TopLocationTargetResponseTop0JSON struct {
+ Rank apijson.Field
+ TargetCountryAlpha2 apijson.Field
+ TargetCountryName apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7TopLocationTargetResponseTop0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TopLocationTargetResponseTop0JSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7TopLocationOriginParams 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"`
+ // 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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]AttackLayer7TopLocationOriginParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Format results are returned in.
+ Format param.Field[AttackLayer7TopLocationOriginParamsFormat] `query:"format"`
+ // Limit the number of objects in the response.
+ Limit param.Field[int64] `query:"limit"`
+ // Array of names that will be used to name the series in responses.
+ Name param.Field[[]string] `query:"name"`
+}
+
+// URLQuery serializes [AttackLayer7TopLocationOriginParams]'s query parameters as
+// `url.Values`.
+func (r AttackLayer7TopLocationOriginParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type AttackLayer7TopLocationOriginParamsDateRange string
+
+const (
+ AttackLayer7TopLocationOriginParamsDateRange1d AttackLayer7TopLocationOriginParamsDateRange = "1d"
+ AttackLayer7TopLocationOriginParamsDateRange2d AttackLayer7TopLocationOriginParamsDateRange = "2d"
+ AttackLayer7TopLocationOriginParamsDateRange7d AttackLayer7TopLocationOriginParamsDateRange = "7d"
+ AttackLayer7TopLocationOriginParamsDateRange14d AttackLayer7TopLocationOriginParamsDateRange = "14d"
+ AttackLayer7TopLocationOriginParamsDateRange28d AttackLayer7TopLocationOriginParamsDateRange = "28d"
+ AttackLayer7TopLocationOriginParamsDateRange12w AttackLayer7TopLocationOriginParamsDateRange = "12w"
+ AttackLayer7TopLocationOriginParamsDateRange24w AttackLayer7TopLocationOriginParamsDateRange = "24w"
+ AttackLayer7TopLocationOriginParamsDateRange52w AttackLayer7TopLocationOriginParamsDateRange = "52w"
+ AttackLayer7TopLocationOriginParamsDateRange1dControl AttackLayer7TopLocationOriginParamsDateRange = "1dControl"
+ AttackLayer7TopLocationOriginParamsDateRange2dControl AttackLayer7TopLocationOriginParamsDateRange = "2dControl"
+ AttackLayer7TopLocationOriginParamsDateRange7dControl AttackLayer7TopLocationOriginParamsDateRange = "7dControl"
+ AttackLayer7TopLocationOriginParamsDateRange14dControl AttackLayer7TopLocationOriginParamsDateRange = "14dControl"
+ AttackLayer7TopLocationOriginParamsDateRange28dControl AttackLayer7TopLocationOriginParamsDateRange = "28dControl"
+ AttackLayer7TopLocationOriginParamsDateRange12wControl AttackLayer7TopLocationOriginParamsDateRange = "12wControl"
+ AttackLayer7TopLocationOriginParamsDateRange24wControl AttackLayer7TopLocationOriginParamsDateRange = "24wControl"
+)
+
+// Format results are returned in.
+type AttackLayer7TopLocationOriginParamsFormat string
+
+const (
+ AttackLayer7TopLocationOriginParamsFormatJson AttackLayer7TopLocationOriginParamsFormat = "JSON"
+ AttackLayer7TopLocationOriginParamsFormatCsv AttackLayer7TopLocationOriginParamsFormat = "CSV"
+)
+
+type AttackLayer7TopLocationOriginResponseEnvelope struct {
+ Result AttackLayer7TopLocationOriginResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON attackLayer7TopLocationOriginResponseEnvelopeJSON `json:"-"`
+}
+
+// attackLayer7TopLocationOriginResponseEnvelopeJSON contains the JSON metadata for
+// the struct [AttackLayer7TopLocationOriginResponseEnvelope]
+type attackLayer7TopLocationOriginResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7TopLocationOriginResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TopLocationOriginResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AttackLayer7TopLocationTargetParams 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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]AttackLayer7TopLocationTargetParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Format results are returned in.
+ Format param.Field[AttackLayer7TopLocationTargetParamsFormat] `query:"format"`
+ // Limit the number of objects in the response.
+ Limit param.Field[int64] `query:"limit"`
+ // Array of names that will be used to name the series in responses.
+ Name param.Field[[]string] `query:"name"`
+}
+
+// URLQuery serializes [AttackLayer7TopLocationTargetParams]'s query parameters as
+// `url.Values`.
+func (r AttackLayer7TopLocationTargetParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type AttackLayer7TopLocationTargetParamsDateRange string
+
+const (
+ AttackLayer7TopLocationTargetParamsDateRange1d AttackLayer7TopLocationTargetParamsDateRange = "1d"
+ AttackLayer7TopLocationTargetParamsDateRange2d AttackLayer7TopLocationTargetParamsDateRange = "2d"
+ AttackLayer7TopLocationTargetParamsDateRange7d AttackLayer7TopLocationTargetParamsDateRange = "7d"
+ AttackLayer7TopLocationTargetParamsDateRange14d AttackLayer7TopLocationTargetParamsDateRange = "14d"
+ AttackLayer7TopLocationTargetParamsDateRange28d AttackLayer7TopLocationTargetParamsDateRange = "28d"
+ AttackLayer7TopLocationTargetParamsDateRange12w AttackLayer7TopLocationTargetParamsDateRange = "12w"
+ AttackLayer7TopLocationTargetParamsDateRange24w AttackLayer7TopLocationTargetParamsDateRange = "24w"
+ AttackLayer7TopLocationTargetParamsDateRange52w AttackLayer7TopLocationTargetParamsDateRange = "52w"
+ AttackLayer7TopLocationTargetParamsDateRange1dControl AttackLayer7TopLocationTargetParamsDateRange = "1dControl"
+ AttackLayer7TopLocationTargetParamsDateRange2dControl AttackLayer7TopLocationTargetParamsDateRange = "2dControl"
+ AttackLayer7TopLocationTargetParamsDateRange7dControl AttackLayer7TopLocationTargetParamsDateRange = "7dControl"
+ AttackLayer7TopLocationTargetParamsDateRange14dControl AttackLayer7TopLocationTargetParamsDateRange = "14dControl"
+ AttackLayer7TopLocationTargetParamsDateRange28dControl AttackLayer7TopLocationTargetParamsDateRange = "28dControl"
+ AttackLayer7TopLocationTargetParamsDateRange12wControl AttackLayer7TopLocationTargetParamsDateRange = "12wControl"
+ AttackLayer7TopLocationTargetParamsDateRange24wControl AttackLayer7TopLocationTargetParamsDateRange = "24wControl"
+)
+
+// Format results are returned in.
+type AttackLayer7TopLocationTargetParamsFormat string
+
+const (
+ AttackLayer7TopLocationTargetParamsFormatJson AttackLayer7TopLocationTargetParamsFormat = "JSON"
+ AttackLayer7TopLocationTargetParamsFormatCsv AttackLayer7TopLocationTargetParamsFormat = "CSV"
+)
+
+type AttackLayer7TopLocationTargetResponseEnvelope struct {
+ Result AttackLayer7TopLocationTargetResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON attackLayer7TopLocationTargetResponseEnvelopeJSON `json:"-"`
+}
+
+// attackLayer7TopLocationTargetResponseEnvelopeJSON contains the JSON metadata for
+// the struct [AttackLayer7TopLocationTargetResponseEnvelope]
+type attackLayer7TopLocationTargetResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AttackLayer7TopLocationTargetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r attackLayer7TopLocationTargetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/radar/attacklayer7toplocation_test.go b/radar/attacklayer7toplocation_test.go
new file mode 100644
index 00000000000..8d2f66665ae
--- /dev/null
+++ b/radar/attacklayer7toplocation_test.go
@@ -0,0 +1,81 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/radar"
+)
+
+func TestAttackLayer7TopLocationOriginWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Attacks.Layer7.Top.Locations.Origin(context.TODO(), radar.AttackLayer7TopLocationOriginParams{
+ 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([]radar.AttackLayer7TopLocationOriginParamsDateRange{radar.AttackLayer7TopLocationOriginParamsDateRange1d, radar.AttackLayer7TopLocationOriginParamsDateRange2d, radar.AttackLayer7TopLocationOriginParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Format: cloudflare.F(radar.AttackLayer7TopLocationOriginParamsFormatJson),
+ Limit: cloudflare.F(int64(5)),
+ 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())
+ }
+}
+
+func TestAttackLayer7TopLocationTargetWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Attacks.Layer7.Top.Locations.Target(context.TODO(), radar.AttackLayer7TopLocationTargetParams{
+ Continent: cloudflare.F([]string{"string", "string", "string"}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.AttackLayer7TopLocationTargetParamsDateRange{radar.AttackLayer7TopLocationTargetParamsDateRange1d, radar.AttackLayer7TopLocationTargetParamsDateRange2d, radar.AttackLayer7TopLocationTargetParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Format: cloudflare.F(radar.AttackLayer7TopLocationTargetParamsFormatJson),
+ Limit: cloudflare.F(int64(5)),
+ 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/radar/bgp.go b/radar/bgp.go
new file mode 100644
index 00000000000..dd359835e67
--- /dev/null
+++ b/radar/bgp.go
@@ -0,0 +1,315 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "context"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// BGPService contains methods and other services that help with interacting with
+// the cloudflare API. Note, unlike clients, this service does not read variables
+// from the environment automatically. You should not instantiate this service
+// directly, and instead use the [NewBGPService] method instead.
+type BGPService struct {
+ Options []option.RequestOption
+ Leaks *BGPLeakService
+ Top *BGPTopService
+ Hijacks *BGPHijackService
+ Routes *BGPRouteService
+}
+
+// NewBGPService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewBGPService(opts ...option.RequestOption) (r *BGPService) {
+ r = &BGPService{}
+ r.Options = opts
+ r.Leaks = NewBGPLeakService(opts...)
+ r.Top = NewBGPTopService(opts...)
+ r.Hijacks = NewBGPHijackService(opts...)
+ r.Routes = NewBGPRouteService(opts...)
+ return
+}
+
+// Gets BGP updates change over time. Raw values are returned. When requesting
+// updates of an autonomous system (AS), only BGP updates of type announcement are
+// returned.
+func (r *BGPService) Timeseries(ctx context.Context, query BGPTimeseriesParams, opts ...option.RequestOption) (res *BGPTimeseriesResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env BGPTimeseriesResponseEnvelope
+ path := "radar/bgp/timeseries"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type BGPTimeseriesResponse struct {
+ Meta BGPTimeseriesResponseMeta `json:"meta,required"`
+ Serie0 BGPTimeseriesResponseSerie0 `json:"serie_0,required"`
+ JSON bgpTimeseriesResponseJSON `json:"-"`
+}
+
+// bgpTimeseriesResponseJSON contains the JSON metadata for the struct
+// [BGPTimeseriesResponse]
+type bgpTimeseriesResponseJSON struct {
+ Meta apijson.Field
+ Serie0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *BGPTimeseriesResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r bgpTimeseriesResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type BGPTimeseriesResponseMeta struct {
+ AggInterval string `json:"aggInterval,required"`
+ DateRange []BGPTimeseriesResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated time.Time `json:"lastUpdated,required" format:"date-time"`
+ ConfidenceInfo BGPTimeseriesResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON bgpTimeseriesResponseMetaJSON `json:"-"`
+}
+
+// bgpTimeseriesResponseMetaJSON contains the JSON metadata for the struct
+// [BGPTimeseriesResponseMeta]
+type bgpTimeseriesResponseMetaJSON struct {
+ AggInterval apijson.Field
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *BGPTimeseriesResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r bgpTimeseriesResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type BGPTimeseriesResponseMetaDateRange 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 bgpTimeseriesResponseMetaDateRangeJSON `json:"-"`
+}
+
+// bgpTimeseriesResponseMetaDateRangeJSON contains the JSON metadata for the struct
+// [BGPTimeseriesResponseMetaDateRange]
+type bgpTimeseriesResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *BGPTimeseriesResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r bgpTimeseriesResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type BGPTimeseriesResponseMetaConfidenceInfo struct {
+ Annotations []BGPTimeseriesResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON bgpTimeseriesResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// bgpTimeseriesResponseMetaConfidenceInfoJSON contains the JSON metadata for the
+// struct [BGPTimeseriesResponseMetaConfidenceInfo]
+type bgpTimeseriesResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *BGPTimeseriesResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r bgpTimeseriesResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type BGPTimeseriesResponseMetaConfidenceInfoAnnotation 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 bgpTimeseriesResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// bgpTimeseriesResponseMetaConfidenceInfoAnnotationJSON contains the JSON metadata
+// for the struct [BGPTimeseriesResponseMetaConfidenceInfoAnnotation]
+type bgpTimeseriesResponseMetaConfidenceInfoAnnotationJSON 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 *BGPTimeseriesResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r bgpTimeseriesResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type BGPTimeseriesResponseSerie0 struct {
+ Timestamps []time.Time `json:"timestamps,required" format:"date-time"`
+ Values []string `json:"values,required"`
+ JSON bgpTimeseriesResponseSerie0JSON `json:"-"`
+}
+
+// bgpTimeseriesResponseSerie0JSON contains the JSON metadata for the struct
+// [BGPTimeseriesResponseSerie0]
+type bgpTimeseriesResponseSerie0JSON struct {
+ Timestamps apijson.Field
+ Values apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *BGPTimeseriesResponseSerie0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r bgpTimeseriesResponseSerie0JSON) RawJSON() string {
+ return r.raw
+}
+
+type BGPTimeseriesParams struct {
+ // Aggregation interval results should be returned in (for example, in 15 minutes
+ // or 1 hour intervals). Refer to
+ // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+ AggInterval param.Field[BGPTimeseriesParamsAggInterval] `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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]BGPTimeseriesParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Format results are returned in.
+ Format param.Field[BGPTimeseriesParamsFormat] `query:"format"`
+ // Array of names that will be used to name the series in responses.
+ Name param.Field[[]string] `query:"name"`
+ // Array of BGP network prefixes.
+ Prefix param.Field[[]string] `query:"prefix"`
+ // Array of BGP update types.
+ UpdateType param.Field[[]BGPTimeseriesParamsUpdateType] `query:"updateType"`
+}
+
+// URLQuery serializes [BGPTimeseriesParams]'s query parameters as `url.Values`.
+func (r BGPTimeseriesParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Aggregation interval results should be returned in (for example, in 15 minutes
+// or 1 hour intervals). Refer to
+// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+type BGPTimeseriesParamsAggInterval string
+
+const (
+ BGPTimeseriesParamsAggInterval15m BGPTimeseriesParamsAggInterval = "15m"
+ BGPTimeseriesParamsAggInterval1h BGPTimeseriesParamsAggInterval = "1h"
+ BGPTimeseriesParamsAggInterval1d BGPTimeseriesParamsAggInterval = "1d"
+ BGPTimeseriesParamsAggInterval1w BGPTimeseriesParamsAggInterval = "1w"
+)
+
+type BGPTimeseriesParamsDateRange string
+
+const (
+ BGPTimeseriesParamsDateRange1d BGPTimeseriesParamsDateRange = "1d"
+ BGPTimeseriesParamsDateRange2d BGPTimeseriesParamsDateRange = "2d"
+ BGPTimeseriesParamsDateRange7d BGPTimeseriesParamsDateRange = "7d"
+ BGPTimeseriesParamsDateRange14d BGPTimeseriesParamsDateRange = "14d"
+ BGPTimeseriesParamsDateRange28d BGPTimeseriesParamsDateRange = "28d"
+ BGPTimeseriesParamsDateRange12w BGPTimeseriesParamsDateRange = "12w"
+ BGPTimeseriesParamsDateRange24w BGPTimeseriesParamsDateRange = "24w"
+ BGPTimeseriesParamsDateRange52w BGPTimeseriesParamsDateRange = "52w"
+ BGPTimeseriesParamsDateRange1dControl BGPTimeseriesParamsDateRange = "1dControl"
+ BGPTimeseriesParamsDateRange2dControl BGPTimeseriesParamsDateRange = "2dControl"
+ BGPTimeseriesParamsDateRange7dControl BGPTimeseriesParamsDateRange = "7dControl"
+ BGPTimeseriesParamsDateRange14dControl BGPTimeseriesParamsDateRange = "14dControl"
+ BGPTimeseriesParamsDateRange28dControl BGPTimeseriesParamsDateRange = "28dControl"
+ BGPTimeseriesParamsDateRange12wControl BGPTimeseriesParamsDateRange = "12wControl"
+ BGPTimeseriesParamsDateRange24wControl BGPTimeseriesParamsDateRange = "24wControl"
+)
+
+// Format results are returned in.
+type BGPTimeseriesParamsFormat string
+
+const (
+ BGPTimeseriesParamsFormatJson BGPTimeseriesParamsFormat = "JSON"
+ BGPTimeseriesParamsFormatCsv BGPTimeseriesParamsFormat = "CSV"
+)
+
+type BGPTimeseriesParamsUpdateType string
+
+const (
+ BGPTimeseriesParamsUpdateTypeAnnouncement BGPTimeseriesParamsUpdateType = "ANNOUNCEMENT"
+ BGPTimeseriesParamsUpdateTypeWithdrawal BGPTimeseriesParamsUpdateType = "WITHDRAWAL"
+)
+
+type BGPTimeseriesResponseEnvelope struct {
+ Result BGPTimeseriesResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON bgpTimeseriesResponseEnvelopeJSON `json:"-"`
+}
+
+// bgpTimeseriesResponseEnvelopeJSON contains the JSON metadata for the struct
+// [BGPTimeseriesResponseEnvelope]
+type bgpTimeseriesResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *BGPTimeseriesResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r bgpTimeseriesResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/radar/bgp_test.go b/radar/bgp_test.go
new file mode 100644
index 00000000000..ff2f9ce9fc4
--- /dev/null
+++ b/radar/bgp_test.go
@@ -0,0 +1,50 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/radar"
+)
+
+func TestBGPTimeseriesWithOptionalParams(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"),
+ )
+ _, err := client.Radar.BGP.Timeseries(context.TODO(), radar.BGPTimeseriesParams{
+ AggInterval: cloudflare.F(radar.BGPTimeseriesParamsAggInterval1h),
+ ASN: cloudflare.F([]string{"string", "string", "string"}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.BGPTimeseriesParamsDateRange{radar.BGPTimeseriesParamsDateRange1d, radar.BGPTimeseriesParamsDateRange2d, radar.BGPTimeseriesParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Format: cloudflare.F(radar.BGPTimeseriesParamsFormatJson),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ Prefix: cloudflare.F([]string{"string", "string", "string"}),
+ UpdateType: cloudflare.F([]radar.BGPTimeseriesParamsUpdateType{radar.BGPTimeseriesParamsUpdateTypeAnnouncement, radar.BGPTimeseriesParamsUpdateTypeWithdrawal}),
+ })
+ 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/radar/bgphijack.go b/radar/bgphijack.go
new file mode 100644
index 00000000000..0594985eaa7
--- /dev/null
+++ b/radar/bgphijack.go
@@ -0,0 +1,317 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "context"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// BGPHijackService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewBGPHijackService] method instead.
+type BGPHijackService struct {
+ Options []option.RequestOption
+}
+
+// NewBGPHijackService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewBGPHijackService(opts ...option.RequestOption) (r *BGPHijackService) {
+ r = &BGPHijackService{}
+ r.Options = opts
+ return
+}
+
+// Get the BGP hijack events. (Beta)
+func (r *BGPHijackService) Events(ctx context.Context, query BGPHijackEventsParams, opts ...option.RequestOption) (res *BGPHijackEventsResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env BGPHijackEventsResponseEnvelope
+ path := "radar/bgp/hijacks/events"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type BGPHijackEventsResponse struct {
+ ASNInfo []BGPHijackEventsResponseASNInfo `json:"asn_info,required"`
+ Events []BGPHijackEventsResponseEvent `json:"events,required"`
+ TotalMonitors int64 `json:"total_monitors,required"`
+ JSON bgpHijackEventsResponseJSON `json:"-"`
+}
+
+// bgpHijackEventsResponseJSON contains the JSON metadata for the struct
+// [BGPHijackEventsResponse]
+type bgpHijackEventsResponseJSON struct {
+ ASNInfo apijson.Field
+ Events apijson.Field
+ TotalMonitors apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *BGPHijackEventsResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r bgpHijackEventsResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type BGPHijackEventsResponseASNInfo struct {
+ ASN int64 `json:"asn,required"`
+ CountryCode string `json:"country_code,required"`
+ OrgName string `json:"org_name,required"`
+ JSON bgpHijackEventsResponseASNInfoJSON `json:"-"`
+}
+
+// bgpHijackEventsResponseASNInfoJSON contains the JSON metadata for the struct
+// [BGPHijackEventsResponseASNInfo]
+type bgpHijackEventsResponseASNInfoJSON struct {
+ ASN apijson.Field
+ CountryCode apijson.Field
+ OrgName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *BGPHijackEventsResponseASNInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r bgpHijackEventsResponseASNInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type BGPHijackEventsResponseEvent struct {
+ ID int64 `json:"id,required"`
+ ConfidenceScore int64 `json:"confidence_score,required"`
+ Duration int64 `json:"duration,required"`
+ EventType int64 `json:"event_type,required"`
+ HijackMsgsCount int64 `json:"hijack_msgs_count,required"`
+ HijackerASN int64 `json:"hijacker_asn,required"`
+ HijackerCountry string `json:"hijacker_country,required"`
+ IsStale bool `json:"is_stale,required"`
+ MaxHijackTs string `json:"max_hijack_ts,required"`
+ MaxMsgTs string `json:"max_msg_ts,required"`
+ MinHijackTs string `json:"min_hijack_ts,required"`
+ OnGoingCount int64 `json:"on_going_count,required"`
+ PeerASNs []int64 `json:"peer_asns,required"`
+ PeerIPCount int64 `json:"peer_ip_count,required"`
+ Prefixes []string `json:"prefixes,required"`
+ Tags []BGPHijackEventsResponseEventsTag `json:"tags,required"`
+ VictimASNs []int64 `json:"victim_asns,required"`
+ VictimCountries []string `json:"victim_countries,required"`
+ JSON bgpHijackEventsResponseEventJSON `json:"-"`
+}
+
+// bgpHijackEventsResponseEventJSON contains the JSON metadata for the struct
+// [BGPHijackEventsResponseEvent]
+type bgpHijackEventsResponseEventJSON struct {
+ ID apijson.Field
+ ConfidenceScore apijson.Field
+ Duration apijson.Field
+ EventType apijson.Field
+ HijackMsgsCount apijson.Field
+ HijackerASN apijson.Field
+ HijackerCountry apijson.Field
+ IsStale apijson.Field
+ MaxHijackTs apijson.Field
+ MaxMsgTs apijson.Field
+ MinHijackTs apijson.Field
+ OnGoingCount apijson.Field
+ PeerASNs apijson.Field
+ PeerIPCount apijson.Field
+ Prefixes apijson.Field
+ Tags apijson.Field
+ VictimASNs apijson.Field
+ VictimCountries apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *BGPHijackEventsResponseEvent) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r bgpHijackEventsResponseEventJSON) RawJSON() string {
+ return r.raw
+}
+
+type BGPHijackEventsResponseEventsTag struct {
+ Name string `json:"name,required"`
+ Score int64 `json:"score,required"`
+ JSON bgpHijackEventsResponseEventsTagJSON `json:"-"`
+}
+
+// bgpHijackEventsResponseEventsTagJSON contains the JSON metadata for the struct
+// [BGPHijackEventsResponseEventsTag]
+type bgpHijackEventsResponseEventsTagJSON struct {
+ Name apijson.Field
+ Score apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *BGPHijackEventsResponseEventsTag) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r bgpHijackEventsResponseEventsTagJSON) RawJSON() string {
+ return r.raw
+}
+
+type BGPHijackEventsParams struct {
+ // End of the date range (inclusive).
+ DateEnd param.Field[time.Time] `query:"dateEnd" format:"date-time"`
+ // Shorthand date ranges for the last X days - use when you don't need specific
+ // start and end dates.
+ DateRange param.Field[BGPHijackEventsParamsDateRange] `query:"dateRange"`
+ // Start of the date range (inclusive).
+ DateStart param.Field[time.Time] `query:"dateStart" format:"date-time"`
+ // The unique identifier of a event
+ EventID param.Field[int64] `query:"eventId"`
+ // Format results are returned in.
+ Format param.Field[BGPHijackEventsParamsFormat] `query:"format"`
+ // The potential hijacker AS of a BGP hijack event
+ HijackerASN param.Field[int64] `query:"hijackerAsn"`
+ // The potential hijacker or victim AS of a BGP hijack event
+ InvolvedASN param.Field[int64] `query:"involvedAsn"`
+ // The country code of the potential hijacker or victim AS of a BGP hijack event
+ InvolvedCountry param.Field[string] `query:"involvedCountry"`
+ // The maximum confidence score to filter events (1-4 low, 5-7 mid, 8+ high)
+ MaxConfidence param.Field[int64] `query:"maxConfidence"`
+ // The minimum confidence score to filter events (1-4 low, 5-7 mid, 8+ high)
+ MinConfidence param.Field[int64] `query:"minConfidence"`
+ // Current page number, starting from 1
+ Page param.Field[int64] `query:"page"`
+ // Number of entries per page
+ PerPage param.Field[int64] `query:"per_page"`
+ // The prefix hijacked during a BGP hijack event
+ Prefix param.Field[string] `query:"prefix"`
+ // Sort events by field
+ SortBy param.Field[BGPHijackEventsParamsSortBy] `query:"sortBy"`
+ // Sort order
+ SortOrder param.Field[BGPHijackEventsParamsSortOrder] `query:"sortOrder"`
+ // The potential victim AS of a BGP hijack event
+ VictimASN param.Field[int64] `query:"victimAsn"`
+}
+
+// URLQuery serializes [BGPHijackEventsParams]'s query parameters as `url.Values`.
+func (r BGPHijackEventsParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Shorthand date ranges for the last X days - use when you don't need specific
+// start and end dates.
+type BGPHijackEventsParamsDateRange string
+
+const (
+ BGPHijackEventsParamsDateRange1d BGPHijackEventsParamsDateRange = "1d"
+ BGPHijackEventsParamsDateRange2d BGPHijackEventsParamsDateRange = "2d"
+ BGPHijackEventsParamsDateRange7d BGPHijackEventsParamsDateRange = "7d"
+ BGPHijackEventsParamsDateRange14d BGPHijackEventsParamsDateRange = "14d"
+ BGPHijackEventsParamsDateRange28d BGPHijackEventsParamsDateRange = "28d"
+ BGPHijackEventsParamsDateRange12w BGPHijackEventsParamsDateRange = "12w"
+ BGPHijackEventsParamsDateRange24w BGPHijackEventsParamsDateRange = "24w"
+ BGPHijackEventsParamsDateRange52w BGPHijackEventsParamsDateRange = "52w"
+ BGPHijackEventsParamsDateRange1dControl BGPHijackEventsParamsDateRange = "1dControl"
+ BGPHijackEventsParamsDateRange2dControl BGPHijackEventsParamsDateRange = "2dControl"
+ BGPHijackEventsParamsDateRange7dControl BGPHijackEventsParamsDateRange = "7dControl"
+ BGPHijackEventsParamsDateRange14dControl BGPHijackEventsParamsDateRange = "14dControl"
+ BGPHijackEventsParamsDateRange28dControl BGPHijackEventsParamsDateRange = "28dControl"
+ BGPHijackEventsParamsDateRange12wControl BGPHijackEventsParamsDateRange = "12wControl"
+ BGPHijackEventsParamsDateRange24wControl BGPHijackEventsParamsDateRange = "24wControl"
+)
+
+// Format results are returned in.
+type BGPHijackEventsParamsFormat string
+
+const (
+ BGPHijackEventsParamsFormatJson BGPHijackEventsParamsFormat = "JSON"
+ BGPHijackEventsParamsFormatCsv BGPHijackEventsParamsFormat = "CSV"
+)
+
+// Sort events by field
+type BGPHijackEventsParamsSortBy string
+
+const (
+ BGPHijackEventsParamsSortByID BGPHijackEventsParamsSortBy = "ID"
+ BGPHijackEventsParamsSortByTime BGPHijackEventsParamsSortBy = "TIME"
+ BGPHijackEventsParamsSortByConfidence BGPHijackEventsParamsSortBy = "CONFIDENCE"
+)
+
+// Sort order
+type BGPHijackEventsParamsSortOrder string
+
+const (
+ BGPHijackEventsParamsSortOrderAsc BGPHijackEventsParamsSortOrder = "ASC"
+ BGPHijackEventsParamsSortOrderDesc BGPHijackEventsParamsSortOrder = "DESC"
+)
+
+type BGPHijackEventsResponseEnvelope struct {
+ Result BGPHijackEventsResponse `json:"result,required"`
+ ResultInfo BGPHijackEventsResponseEnvelopeResultInfo `json:"result_info,required"`
+ Success bool `json:"success,required"`
+ JSON bgpHijackEventsResponseEnvelopeJSON `json:"-"`
+}
+
+// bgpHijackEventsResponseEnvelopeJSON contains the JSON metadata for the struct
+// [BGPHijackEventsResponseEnvelope]
+type bgpHijackEventsResponseEnvelopeJSON struct {
+ Result apijson.Field
+ ResultInfo apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *BGPHijackEventsResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r bgpHijackEventsResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type BGPHijackEventsResponseEnvelopeResultInfo struct {
+ Count int64 `json:"count,required"`
+ Page int64 `json:"page,required"`
+ PerPage int64 `json:"per_page,required"`
+ TotalCount int64 `json:"total_count,required"`
+ JSON bgpHijackEventsResponseEnvelopeResultInfoJSON `json:"-"`
+}
+
+// bgpHijackEventsResponseEnvelopeResultInfoJSON contains the JSON metadata for the
+// struct [BGPHijackEventsResponseEnvelopeResultInfo]
+type bgpHijackEventsResponseEnvelopeResultInfoJSON struct {
+ Count apijson.Field
+ Page apijson.Field
+ PerPage apijson.Field
+ TotalCount apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *BGPHijackEventsResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r bgpHijackEventsResponseEnvelopeResultInfoJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/radar/bgphijack_test.go b/radar/bgphijack_test.go
new file mode 100644
index 00000000000..395da2731ae
--- /dev/null
+++ b/radar/bgphijack_test.go
@@ -0,0 +1,57 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/radar"
+)
+
+func TestBGPHijackEventsWithOptionalParams(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"),
+ )
+ _, err := client.Radar.BGP.Hijacks.Events(context.TODO(), radar.BGPHijackEventsParams{
+ DateEnd: cloudflare.F(time.Now()),
+ DateRange: cloudflare.F(radar.BGPHijackEventsParamsDateRange7d),
+ DateStart: cloudflare.F(time.Now()),
+ EventID: cloudflare.F(int64(0)),
+ Format: cloudflare.F(radar.BGPHijackEventsParamsFormatJson),
+ HijackerASN: cloudflare.F(int64(0)),
+ InvolvedASN: cloudflare.F(int64(0)),
+ InvolvedCountry: cloudflare.F("string"),
+ MaxConfidence: cloudflare.F(int64(0)),
+ MinConfidence: cloudflare.F(int64(0)),
+ Page: cloudflare.F(int64(0)),
+ PerPage: cloudflare.F(int64(0)),
+ Prefix: cloudflare.F("string"),
+ SortBy: cloudflare.F(radar.BGPHijackEventsParamsSortByTime),
+ SortOrder: cloudflare.F(radar.BGPHijackEventsParamsSortOrderDesc),
+ VictimASN: cloudflare.F(int64(0)),
+ })
+ 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/radar/bgpleak.go b/radar/bgpleak.go
new file mode 100644
index 00000000000..aadbb995e55
--- /dev/null
+++ b/radar/bgpleak.go
@@ -0,0 +1,277 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "context"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// BGPLeakService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewBGPLeakService] method instead.
+type BGPLeakService struct {
+ Options []option.RequestOption
+}
+
+// NewBGPLeakService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewBGPLeakService(opts ...option.RequestOption) (r *BGPLeakService) {
+ r = &BGPLeakService{}
+ r.Options = opts
+ return
+}
+
+// Get the BGP route leak events (Beta).
+func (r *BGPLeakService) Events(ctx context.Context, query BGPLeakEventsParams, opts ...option.RequestOption) (res *BGPLeakEventsResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env BGPLeakEventsResponseEnvelope
+ path := "radar/bgp/leaks/events"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type BGPLeakEventsResponse struct {
+ ASNInfo []BGPLeakEventsResponseASNInfo `json:"asn_info,required"`
+ Events []BGPLeakEventsResponseEvent `json:"events,required"`
+ JSON bgpLeakEventsResponseJSON `json:"-"`
+}
+
+// bgpLeakEventsResponseJSON contains the JSON metadata for the struct
+// [BGPLeakEventsResponse]
+type bgpLeakEventsResponseJSON struct {
+ ASNInfo apijson.Field
+ Events apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *BGPLeakEventsResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r bgpLeakEventsResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type BGPLeakEventsResponseASNInfo struct {
+ ASN int64 `json:"asn,required"`
+ CountryCode string `json:"country_code,required"`
+ OrgName string `json:"org_name,required"`
+ JSON bgpLeakEventsResponseASNInfoJSON `json:"-"`
+}
+
+// bgpLeakEventsResponseASNInfoJSON contains the JSON metadata for the struct
+// [BGPLeakEventsResponseASNInfo]
+type bgpLeakEventsResponseASNInfoJSON struct {
+ ASN apijson.Field
+ CountryCode apijson.Field
+ OrgName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *BGPLeakEventsResponseASNInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r bgpLeakEventsResponseASNInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type BGPLeakEventsResponseEvent struct {
+ ID int64 `json:"id,required"`
+ Countries []string `json:"countries,required"`
+ DetectedTs string `json:"detected_ts,required"`
+ Finished bool `json:"finished,required"`
+ LeakASN int64 `json:"leak_asn,required"`
+ LeakCount int64 `json:"leak_count,required"`
+ LeakSeg []int64 `json:"leak_seg,required"`
+ LeakType int64 `json:"leak_type,required"`
+ MaxTs string `json:"max_ts,required"`
+ MinTs string `json:"min_ts,required"`
+ OriginCount int64 `json:"origin_count,required"`
+ PeerCount int64 `json:"peer_count,required"`
+ PrefixCount int64 `json:"prefix_count,required"`
+ JSON bgpLeakEventsResponseEventJSON `json:"-"`
+}
+
+// bgpLeakEventsResponseEventJSON contains the JSON metadata for the struct
+// [BGPLeakEventsResponseEvent]
+type bgpLeakEventsResponseEventJSON struct {
+ ID apijson.Field
+ Countries apijson.Field
+ DetectedTs apijson.Field
+ Finished apijson.Field
+ LeakASN apijson.Field
+ LeakCount apijson.Field
+ LeakSeg apijson.Field
+ LeakType apijson.Field
+ MaxTs apijson.Field
+ MinTs apijson.Field
+ OriginCount apijson.Field
+ PeerCount apijson.Field
+ PrefixCount apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *BGPLeakEventsResponseEvent) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r bgpLeakEventsResponseEventJSON) RawJSON() string {
+ return r.raw
+}
+
+type BGPLeakEventsParams struct {
+ // End of the date range (inclusive).
+ DateEnd param.Field[time.Time] `query:"dateEnd" format:"date-time"`
+ // Shorthand date ranges for the last X days - use when you don't need specific
+ // start and end dates.
+ DateRange param.Field[BGPLeakEventsParamsDateRange] `query:"dateRange"`
+ // Start of the date range (inclusive).
+ DateStart param.Field[time.Time] `query:"dateStart" format:"date-time"`
+ // The unique identifier of a event
+ EventID param.Field[int64] `query:"eventId"`
+ // Format results are returned in.
+ Format param.Field[BGPLeakEventsParamsFormat] `query:"format"`
+ // ASN that is causing or affected by a route leak event
+ InvolvedASN param.Field[int64] `query:"involvedAsn"`
+ // Country code of a involved ASN in a route leak event
+ InvolvedCountry param.Field[string] `query:"involvedCountry"`
+ // The leaking AS of a route leak event
+ LeakASN param.Field[int64] `query:"leakAsn"`
+ // Current page number, starting from 1
+ Page param.Field[int64] `query:"page"`
+ // Number of entries per page
+ PerPage param.Field[int64] `query:"per_page"`
+ // Sort events by field
+ SortBy param.Field[BGPLeakEventsParamsSortBy] `query:"sortBy"`
+ // Sort order
+ SortOrder param.Field[BGPLeakEventsParamsSortOrder] `query:"sortOrder"`
+}
+
+// URLQuery serializes [BGPLeakEventsParams]'s query parameters as `url.Values`.
+func (r BGPLeakEventsParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Shorthand date ranges for the last X days - use when you don't need specific
+// start and end dates.
+type BGPLeakEventsParamsDateRange string
+
+const (
+ BGPLeakEventsParamsDateRange1d BGPLeakEventsParamsDateRange = "1d"
+ BGPLeakEventsParamsDateRange2d BGPLeakEventsParamsDateRange = "2d"
+ BGPLeakEventsParamsDateRange7d BGPLeakEventsParamsDateRange = "7d"
+ BGPLeakEventsParamsDateRange14d BGPLeakEventsParamsDateRange = "14d"
+ BGPLeakEventsParamsDateRange28d BGPLeakEventsParamsDateRange = "28d"
+ BGPLeakEventsParamsDateRange12w BGPLeakEventsParamsDateRange = "12w"
+ BGPLeakEventsParamsDateRange24w BGPLeakEventsParamsDateRange = "24w"
+ BGPLeakEventsParamsDateRange52w BGPLeakEventsParamsDateRange = "52w"
+ BGPLeakEventsParamsDateRange1dControl BGPLeakEventsParamsDateRange = "1dControl"
+ BGPLeakEventsParamsDateRange2dControl BGPLeakEventsParamsDateRange = "2dControl"
+ BGPLeakEventsParamsDateRange7dControl BGPLeakEventsParamsDateRange = "7dControl"
+ BGPLeakEventsParamsDateRange14dControl BGPLeakEventsParamsDateRange = "14dControl"
+ BGPLeakEventsParamsDateRange28dControl BGPLeakEventsParamsDateRange = "28dControl"
+ BGPLeakEventsParamsDateRange12wControl BGPLeakEventsParamsDateRange = "12wControl"
+ BGPLeakEventsParamsDateRange24wControl BGPLeakEventsParamsDateRange = "24wControl"
+)
+
+// Format results are returned in.
+type BGPLeakEventsParamsFormat string
+
+const (
+ BGPLeakEventsParamsFormatJson BGPLeakEventsParamsFormat = "JSON"
+ BGPLeakEventsParamsFormatCsv BGPLeakEventsParamsFormat = "CSV"
+)
+
+// Sort events by field
+type BGPLeakEventsParamsSortBy string
+
+const (
+ BGPLeakEventsParamsSortByID BGPLeakEventsParamsSortBy = "ID"
+ BGPLeakEventsParamsSortByLeaks BGPLeakEventsParamsSortBy = "LEAKS"
+ BGPLeakEventsParamsSortByPeers BGPLeakEventsParamsSortBy = "PEERS"
+ BGPLeakEventsParamsSortByPrefixes BGPLeakEventsParamsSortBy = "PREFIXES"
+ BGPLeakEventsParamsSortByOrigins BGPLeakEventsParamsSortBy = "ORIGINS"
+ BGPLeakEventsParamsSortByTime BGPLeakEventsParamsSortBy = "TIME"
+)
+
+// Sort order
+type BGPLeakEventsParamsSortOrder string
+
+const (
+ BGPLeakEventsParamsSortOrderAsc BGPLeakEventsParamsSortOrder = "ASC"
+ BGPLeakEventsParamsSortOrderDesc BGPLeakEventsParamsSortOrder = "DESC"
+)
+
+type BGPLeakEventsResponseEnvelope struct {
+ Result BGPLeakEventsResponse `json:"result,required"`
+ ResultInfo BGPLeakEventsResponseEnvelopeResultInfo `json:"result_info,required"`
+ Success bool `json:"success,required"`
+ JSON bgpLeakEventsResponseEnvelopeJSON `json:"-"`
+}
+
+// bgpLeakEventsResponseEnvelopeJSON contains the JSON metadata for the struct
+// [BGPLeakEventsResponseEnvelope]
+type bgpLeakEventsResponseEnvelopeJSON struct {
+ Result apijson.Field
+ ResultInfo apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *BGPLeakEventsResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r bgpLeakEventsResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type BGPLeakEventsResponseEnvelopeResultInfo struct {
+ Count int64 `json:"count,required"`
+ Page int64 `json:"page,required"`
+ PerPage int64 `json:"per_page,required"`
+ TotalCount int64 `json:"total_count,required"`
+ JSON bgpLeakEventsResponseEnvelopeResultInfoJSON `json:"-"`
+}
+
+// bgpLeakEventsResponseEnvelopeResultInfoJSON contains the JSON metadata for the
+// struct [BGPLeakEventsResponseEnvelopeResultInfo]
+type bgpLeakEventsResponseEnvelopeResultInfoJSON struct {
+ Count apijson.Field
+ Page apijson.Field
+ PerPage apijson.Field
+ TotalCount apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *BGPLeakEventsResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r bgpLeakEventsResponseEnvelopeResultInfoJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/radar/bgpleak_test.go b/radar/bgpleak_test.go
new file mode 100644
index 00000000000..3486a8e9d69
--- /dev/null
+++ b/radar/bgpleak_test.go
@@ -0,0 +1,53 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/radar"
+)
+
+func TestBGPLeakEventsWithOptionalParams(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"),
+ )
+ _, err := client.Radar.BGP.Leaks.Events(context.TODO(), radar.BGPLeakEventsParams{
+ DateEnd: cloudflare.F(time.Now()),
+ DateRange: cloudflare.F(radar.BGPLeakEventsParamsDateRange7d),
+ DateStart: cloudflare.F(time.Now()),
+ EventID: cloudflare.F(int64(0)),
+ Format: cloudflare.F(radar.BGPLeakEventsParamsFormatJson),
+ InvolvedASN: cloudflare.F(int64(0)),
+ InvolvedCountry: cloudflare.F("string"),
+ LeakASN: cloudflare.F(int64(0)),
+ Page: cloudflare.F(int64(0)),
+ PerPage: cloudflare.F(int64(0)),
+ SortBy: cloudflare.F(radar.BGPLeakEventsParamsSortByTime),
+ SortOrder: cloudflare.F(radar.BGPLeakEventsParamsSortOrderDesc),
+ })
+ 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/radar/bgproute.go b/radar/bgproute.go
new file mode 100644
index 00000000000..947ace63ecc
--- /dev/null
+++ b/radar/bgproute.go
@@ -0,0 +1,710 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "context"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// BGPRouteService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewBGPRouteService] method instead.
+type BGPRouteService struct {
+ Options []option.RequestOption
+}
+
+// NewBGPRouteService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewBGPRouteService(opts ...option.RequestOption) (r *BGPRouteService) {
+ r = &BGPRouteService{}
+ r.Options = opts
+ return
+}
+
+// List all Multi-origin AS (MOAS) prefixes on the global routing tables.
+func (r *BGPRouteService) Moas(ctx context.Context, query BGPRouteMoasParams, opts ...option.RequestOption) (res *BGPRouteMoasResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env BGPRouteMoasResponseEnvelope
+ path := "radar/bgp/routes/moas"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Lookup prefix-to-origin mapping on global routing tables.
+func (r *BGPRouteService) Pfx2as(ctx context.Context, query BGPRoutePfx2asParams, opts ...option.RequestOption) (res *BGPRoutePfx2asResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env BGPRoutePfx2asResponseEnvelope
+ path := "radar/bgp/routes/pfx2as"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Get the BGP routing table stats (Beta).
+func (r *BGPRouteService) Stats(ctx context.Context, query BGPRouteStatsParams, opts ...option.RequestOption) (res *BGPRouteStatsResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env BGPRouteStatsResponseEnvelope
+ path := "radar/bgp/routes/stats"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Gets time-series data for the announced IP space count, represented as the
+// number of IPv4 /24s and IPv6 /48s, for a given ASN.
+func (r *BGPRouteService) Timeseries(ctx context.Context, query BGPRouteTimeseriesParams, opts ...option.RequestOption) (res *BGPRouteTimeseriesResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env BGPRouteTimeseriesResponseEnvelope
+ path := "radar/bgp/routes/timeseries"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type BGPRouteMoasResponse struct {
+ Meta BGPRouteMoasResponseMeta `json:"meta,required"`
+ Moas []BGPRouteMoasResponseMoa `json:"moas,required"`
+ JSON bgpRouteMoasResponseJSON `json:"-"`
+}
+
+// bgpRouteMoasResponseJSON contains the JSON metadata for the struct
+// [BGPRouteMoasResponse]
+type bgpRouteMoasResponseJSON struct {
+ Meta apijson.Field
+ Moas apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *BGPRouteMoasResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r bgpRouteMoasResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type BGPRouteMoasResponseMeta struct {
+ DataTime string `json:"data_time,required"`
+ QueryTime string `json:"query_time,required"`
+ TotalPeers int64 `json:"total_peers,required"`
+ JSON bgpRouteMoasResponseMetaJSON `json:"-"`
+}
+
+// bgpRouteMoasResponseMetaJSON contains the JSON metadata for the struct
+// [BGPRouteMoasResponseMeta]
+type bgpRouteMoasResponseMetaJSON struct {
+ DataTime apijson.Field
+ QueryTime apijson.Field
+ TotalPeers apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *BGPRouteMoasResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r bgpRouteMoasResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type BGPRouteMoasResponseMoa struct {
+ Origins []BGPRouteMoasResponseMoasOrigin `json:"origins,required"`
+ Prefix string `json:"prefix,required"`
+ JSON bgpRouteMoasResponseMoaJSON `json:"-"`
+}
+
+// bgpRouteMoasResponseMoaJSON contains the JSON metadata for the struct
+// [BGPRouteMoasResponseMoa]
+type bgpRouteMoasResponseMoaJSON struct {
+ Origins apijson.Field
+ Prefix apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *BGPRouteMoasResponseMoa) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r bgpRouteMoasResponseMoaJSON) RawJSON() string {
+ return r.raw
+}
+
+type BGPRouteMoasResponseMoasOrigin struct {
+ Origin int64 `json:"origin,required"`
+ PeerCount int64 `json:"peer_count,required"`
+ RpkiValidation string `json:"rpki_validation,required"`
+ JSON bgpRouteMoasResponseMoasOriginJSON `json:"-"`
+}
+
+// bgpRouteMoasResponseMoasOriginJSON contains the JSON metadata for the struct
+// [BGPRouteMoasResponseMoasOrigin]
+type bgpRouteMoasResponseMoasOriginJSON struct {
+ Origin apijson.Field
+ PeerCount apijson.Field
+ RpkiValidation apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *BGPRouteMoasResponseMoasOrigin) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r bgpRouteMoasResponseMoasOriginJSON) RawJSON() string {
+ return r.raw
+}
+
+type BGPRoutePfx2asResponse struct {
+ Meta BGPRoutePfx2asResponseMeta `json:"meta,required"`
+ PrefixOrigins []BGPRoutePfx2asResponsePrefixOrigin `json:"prefix_origins,required"`
+ JSON bgpRoutePfx2asResponseJSON `json:"-"`
+}
+
+// bgpRoutePfx2asResponseJSON contains the JSON metadata for the struct
+// [BGPRoutePfx2asResponse]
+type bgpRoutePfx2asResponseJSON struct {
+ Meta apijson.Field
+ PrefixOrigins apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *BGPRoutePfx2asResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r bgpRoutePfx2asResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type BGPRoutePfx2asResponseMeta struct {
+ DataTime string `json:"data_time,required"`
+ QueryTime string `json:"query_time,required"`
+ TotalPeers int64 `json:"total_peers,required"`
+ JSON bgpRoutePfx2asResponseMetaJSON `json:"-"`
+}
+
+// bgpRoutePfx2asResponseMetaJSON contains the JSON metadata for the struct
+// [BGPRoutePfx2asResponseMeta]
+type bgpRoutePfx2asResponseMetaJSON struct {
+ DataTime apijson.Field
+ QueryTime apijson.Field
+ TotalPeers apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *BGPRoutePfx2asResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r bgpRoutePfx2asResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type BGPRoutePfx2asResponsePrefixOrigin struct {
+ Origin int64 `json:"origin,required"`
+ PeerCount int64 `json:"peer_count,required"`
+ Prefix string `json:"prefix,required"`
+ RpkiValidation string `json:"rpki_validation,required"`
+ JSON bgpRoutePfx2asResponsePrefixOriginJSON `json:"-"`
+}
+
+// bgpRoutePfx2asResponsePrefixOriginJSON contains the JSON metadata for the struct
+// [BGPRoutePfx2asResponsePrefixOrigin]
+type bgpRoutePfx2asResponsePrefixOriginJSON struct {
+ Origin apijson.Field
+ PeerCount apijson.Field
+ Prefix apijson.Field
+ RpkiValidation apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *BGPRoutePfx2asResponsePrefixOrigin) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r bgpRoutePfx2asResponsePrefixOriginJSON) RawJSON() string {
+ return r.raw
+}
+
+type BGPRouteStatsResponse struct {
+ Meta BGPRouteStatsResponseMeta `json:"meta,required"`
+ Stats BGPRouteStatsResponseStats `json:"stats,required"`
+ JSON bgpRouteStatsResponseJSON `json:"-"`
+}
+
+// bgpRouteStatsResponseJSON contains the JSON metadata for the struct
+// [BGPRouteStatsResponse]
+type bgpRouteStatsResponseJSON struct {
+ Meta apijson.Field
+ Stats apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *BGPRouteStatsResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r bgpRouteStatsResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type BGPRouteStatsResponseMeta struct {
+ DataTime string `json:"data_time,required"`
+ QueryTime string `json:"query_time,required"`
+ TotalPeers int64 `json:"total_peers,required"`
+ JSON bgpRouteStatsResponseMetaJSON `json:"-"`
+}
+
+// bgpRouteStatsResponseMetaJSON contains the JSON metadata for the struct
+// [BGPRouteStatsResponseMeta]
+type bgpRouteStatsResponseMetaJSON struct {
+ DataTime apijson.Field
+ QueryTime apijson.Field
+ TotalPeers apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *BGPRouteStatsResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r bgpRouteStatsResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type BGPRouteStatsResponseStats struct {
+ DistinctOrigins int64 `json:"distinct_origins,required"`
+ DistinctOriginsIPV4 int64 `json:"distinct_origins_ipv4,required"`
+ DistinctOriginsIPV6 int64 `json:"distinct_origins_ipv6,required"`
+ DistinctPrefixes int64 `json:"distinct_prefixes,required"`
+ DistinctPrefixesIPV4 int64 `json:"distinct_prefixes_ipv4,required"`
+ DistinctPrefixesIPV6 int64 `json:"distinct_prefixes_ipv6,required"`
+ RoutesInvalid int64 `json:"routes_invalid,required"`
+ RoutesInvalidIPV4 int64 `json:"routes_invalid_ipv4,required"`
+ RoutesInvalidIPV6 int64 `json:"routes_invalid_ipv6,required"`
+ RoutesTotal int64 `json:"routes_total,required"`
+ RoutesTotalIPV4 int64 `json:"routes_total_ipv4,required"`
+ RoutesTotalIPV6 int64 `json:"routes_total_ipv6,required"`
+ RoutesUnknown int64 `json:"routes_unknown,required"`
+ RoutesUnknownIPV4 int64 `json:"routes_unknown_ipv4,required"`
+ RoutesUnknownIPV6 int64 `json:"routes_unknown_ipv6,required"`
+ RoutesValid int64 `json:"routes_valid,required"`
+ RoutesValidIPV4 int64 `json:"routes_valid_ipv4,required"`
+ RoutesValidIPV6 int64 `json:"routes_valid_ipv6,required"`
+ JSON bgpRouteStatsResponseStatsJSON `json:"-"`
+}
+
+// bgpRouteStatsResponseStatsJSON contains the JSON metadata for the struct
+// [BGPRouteStatsResponseStats]
+type bgpRouteStatsResponseStatsJSON struct {
+ DistinctOrigins apijson.Field
+ DistinctOriginsIPV4 apijson.Field
+ DistinctOriginsIPV6 apijson.Field
+ DistinctPrefixes apijson.Field
+ DistinctPrefixesIPV4 apijson.Field
+ DistinctPrefixesIPV6 apijson.Field
+ RoutesInvalid apijson.Field
+ RoutesInvalidIPV4 apijson.Field
+ RoutesInvalidIPV6 apijson.Field
+ RoutesTotal apijson.Field
+ RoutesTotalIPV4 apijson.Field
+ RoutesTotalIPV6 apijson.Field
+ RoutesUnknown apijson.Field
+ RoutesUnknownIPV4 apijson.Field
+ RoutesUnknownIPV6 apijson.Field
+ RoutesValid apijson.Field
+ RoutesValidIPV4 apijson.Field
+ RoutesValidIPV6 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *BGPRouteStatsResponseStats) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r bgpRouteStatsResponseStatsJSON) RawJSON() string {
+ return r.raw
+}
+
+type BGPRouteTimeseriesResponse struct {
+ Meta BGPRouteTimeseriesResponseMeta `json:"meta,required"`
+ SerieIPV4_24s BGPRouteTimeseriesResponseSerieIPV4_24s `json:"serie_ipv4_24s,required"`
+ SerieIPV6_48s BGPRouteTimeseriesResponseSerieIPV6_48s `json:"serie_ipv6_48s,required"`
+ JSON bgpRouteTimeseriesResponseJSON `json:"-"`
+}
+
+// bgpRouteTimeseriesResponseJSON contains the JSON metadata for the struct
+// [BGPRouteTimeseriesResponse]
+type bgpRouteTimeseriesResponseJSON struct {
+ Meta apijson.Field
+ SerieIPV4_24s apijson.Field
+ SerieIPV6_48s apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *BGPRouteTimeseriesResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r bgpRouteTimeseriesResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type BGPRouteTimeseriesResponseMeta struct {
+ DateRange []BGPRouteTimeseriesResponseMetaDateRange `json:"dateRange,required"`
+ JSON bgpRouteTimeseriesResponseMetaJSON `json:"-"`
+}
+
+// bgpRouteTimeseriesResponseMetaJSON contains the JSON metadata for the struct
+// [BGPRouteTimeseriesResponseMeta]
+type bgpRouteTimeseriesResponseMetaJSON struct {
+ DateRange apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *BGPRouteTimeseriesResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r bgpRouteTimeseriesResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type BGPRouteTimeseriesResponseMetaDateRange 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 bgpRouteTimeseriesResponseMetaDateRangeJSON `json:"-"`
+}
+
+// bgpRouteTimeseriesResponseMetaDateRangeJSON contains the JSON metadata for the
+// struct [BGPRouteTimeseriesResponseMetaDateRange]
+type bgpRouteTimeseriesResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *BGPRouteTimeseriesResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r bgpRouteTimeseriesResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type BGPRouteTimeseriesResponseSerieIPV4_24s struct {
+ Timestamps []time.Time `json:"timestamps,required" format:"date-time"`
+ Values []int64 `json:"values,required"`
+ JSON bgpRouteTimeseriesResponseSerieIPV4_24sJSON `json:"-"`
+}
+
+// bgpRouteTimeseriesResponseSerieIPV4_24sJSON contains the JSON metadata for the
+// struct [BGPRouteTimeseriesResponseSerieIPV4_24s]
+type bgpRouteTimeseriesResponseSerieIPV4_24sJSON struct {
+ Timestamps apijson.Field
+ Values apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *BGPRouteTimeseriesResponseSerieIPV4_24s) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r bgpRouteTimeseriesResponseSerieIPV4_24sJSON) RawJSON() string {
+ return r.raw
+}
+
+type BGPRouteTimeseriesResponseSerieIPV6_48s struct {
+ Timestamps []time.Time `json:"timestamps,required" format:"date-time"`
+ Values []int64 `json:"values,required"`
+ JSON bgpRouteTimeseriesResponseSerieIPV6_48sJSON `json:"-"`
+}
+
+// bgpRouteTimeseriesResponseSerieIPV6_48sJSON contains the JSON metadata for the
+// struct [BGPRouteTimeseriesResponseSerieIPV6_48s]
+type bgpRouteTimeseriesResponseSerieIPV6_48sJSON struct {
+ Timestamps apijson.Field
+ Values apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *BGPRouteTimeseriesResponseSerieIPV6_48s) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r bgpRouteTimeseriesResponseSerieIPV6_48sJSON) RawJSON() string {
+ return r.raw
+}
+
+type BGPRouteMoasParams struct {
+ // Format results are returned in.
+ Format param.Field[BGPRouteMoasParamsFormat] `query:"format"`
+ // Lookup only RPKI invalid MOASes
+ InvalidOnly param.Field[bool] `query:"invalid_only"`
+ // Lookup MOASes originated by the given ASN
+ Origin param.Field[int64] `query:"origin"`
+ // Lookup MOASes by prefix
+ Prefix param.Field[string] `query:"prefix"`
+}
+
+// URLQuery serializes [BGPRouteMoasParams]'s query parameters as `url.Values`.
+func (r BGPRouteMoasParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Format results are returned in.
+type BGPRouteMoasParamsFormat string
+
+const (
+ BGPRouteMoasParamsFormatJson BGPRouteMoasParamsFormat = "JSON"
+ BGPRouteMoasParamsFormatCsv BGPRouteMoasParamsFormat = "CSV"
+)
+
+type BGPRouteMoasResponseEnvelope struct {
+ Result BGPRouteMoasResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON bgpRouteMoasResponseEnvelopeJSON `json:"-"`
+}
+
+// bgpRouteMoasResponseEnvelopeJSON contains the JSON metadata for the struct
+// [BGPRouteMoasResponseEnvelope]
+type bgpRouteMoasResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *BGPRouteMoasResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r bgpRouteMoasResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type BGPRoutePfx2asParams struct {
+ // Format results are returned in.
+ Format param.Field[BGPRoutePfx2asParamsFormat] `query:"format"`
+ // Lookup prefixes originated by the given ASN
+ Origin param.Field[int64] `query:"origin"`
+ // Lookup origins of the given prefix
+ Prefix param.Field[string] `query:"prefix"`
+ // Return only results with matching rpki status: valid, invalid or unknown
+ RpkiStatus param.Field[BGPRoutePfx2asParamsRpkiStatus] `query:"rpkiStatus"`
+}
+
+// URLQuery serializes [BGPRoutePfx2asParams]'s query parameters as `url.Values`.
+func (r BGPRoutePfx2asParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Format results are returned in.
+type BGPRoutePfx2asParamsFormat string
+
+const (
+ BGPRoutePfx2asParamsFormatJson BGPRoutePfx2asParamsFormat = "JSON"
+ BGPRoutePfx2asParamsFormatCsv BGPRoutePfx2asParamsFormat = "CSV"
+)
+
+// Return only results with matching rpki status: valid, invalid or unknown
+type BGPRoutePfx2asParamsRpkiStatus string
+
+const (
+ BGPRoutePfx2asParamsRpkiStatusValid BGPRoutePfx2asParamsRpkiStatus = "VALID"
+ BGPRoutePfx2asParamsRpkiStatusInvalid BGPRoutePfx2asParamsRpkiStatus = "INVALID"
+ BGPRoutePfx2asParamsRpkiStatusUnknown BGPRoutePfx2asParamsRpkiStatus = "UNKNOWN"
+)
+
+type BGPRoutePfx2asResponseEnvelope struct {
+ Result BGPRoutePfx2asResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON bgpRoutePfx2asResponseEnvelopeJSON `json:"-"`
+}
+
+// bgpRoutePfx2asResponseEnvelopeJSON contains the JSON metadata for the struct
+// [BGPRoutePfx2asResponseEnvelope]
+type bgpRoutePfx2asResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *BGPRoutePfx2asResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r bgpRoutePfx2asResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type BGPRouteStatsParams struct {
+ // Single ASN as integer.
+ ASN param.Field[int64] `query:"asn"`
+ // Format results are returned in.
+ Format param.Field[BGPRouteStatsParamsFormat] `query:"format"`
+ // Location Alpha2 code.
+ Location param.Field[string] `query:"location"`
+}
+
+// URLQuery serializes [BGPRouteStatsParams]'s query parameters as `url.Values`.
+func (r BGPRouteStatsParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Format results are returned in.
+type BGPRouteStatsParamsFormat string
+
+const (
+ BGPRouteStatsParamsFormatJson BGPRouteStatsParamsFormat = "JSON"
+ BGPRouteStatsParamsFormatCsv BGPRouteStatsParamsFormat = "CSV"
+)
+
+type BGPRouteStatsResponseEnvelope struct {
+ Result BGPRouteStatsResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON bgpRouteStatsResponseEnvelopeJSON `json:"-"`
+}
+
+// bgpRouteStatsResponseEnvelopeJSON contains the JSON metadata for the struct
+// [BGPRouteStatsResponseEnvelope]
+type bgpRouteStatsResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *BGPRouteStatsResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r bgpRouteStatsResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type BGPRouteTimeseriesParams struct {
+ // Single ASN as integer.
+ ASN param.Field[int64] `query:"asn"`
+ // End of the date range (inclusive).
+ DateEnd param.Field[time.Time] `query:"dateEnd" format:"date-time"`
+ // Shorthand date ranges for the last X days - use when you don't need specific
+ // start and end dates.
+ DateRange param.Field[BGPRouteTimeseriesParamsDateRange] `query:"dateRange"`
+ // Start of the date range (inclusive).
+ DateStart param.Field[time.Time] `query:"dateStart" format:"date-time"`
+ // Format results are returned in.
+ Format param.Field[BGPRouteTimeseriesParamsFormat] `query:"format"`
+}
+
+// URLQuery serializes [BGPRouteTimeseriesParams]'s query parameters as
+// `url.Values`.
+func (r BGPRouteTimeseriesParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Shorthand date ranges for the last X days - use when you don't need specific
+// start and end dates.
+type BGPRouteTimeseriesParamsDateRange string
+
+const (
+ BGPRouteTimeseriesParamsDateRange1d BGPRouteTimeseriesParamsDateRange = "1d"
+ BGPRouteTimeseriesParamsDateRange2d BGPRouteTimeseriesParamsDateRange = "2d"
+ BGPRouteTimeseriesParamsDateRange7d BGPRouteTimeseriesParamsDateRange = "7d"
+ BGPRouteTimeseriesParamsDateRange14d BGPRouteTimeseriesParamsDateRange = "14d"
+ BGPRouteTimeseriesParamsDateRange28d BGPRouteTimeseriesParamsDateRange = "28d"
+ BGPRouteTimeseriesParamsDateRange12w BGPRouteTimeseriesParamsDateRange = "12w"
+ BGPRouteTimeseriesParamsDateRange24w BGPRouteTimeseriesParamsDateRange = "24w"
+ BGPRouteTimeseriesParamsDateRange52w BGPRouteTimeseriesParamsDateRange = "52w"
+ BGPRouteTimeseriesParamsDateRange1dControl BGPRouteTimeseriesParamsDateRange = "1dControl"
+ BGPRouteTimeseriesParamsDateRange2dControl BGPRouteTimeseriesParamsDateRange = "2dControl"
+ BGPRouteTimeseriesParamsDateRange7dControl BGPRouteTimeseriesParamsDateRange = "7dControl"
+ BGPRouteTimeseriesParamsDateRange14dControl BGPRouteTimeseriesParamsDateRange = "14dControl"
+ BGPRouteTimeseriesParamsDateRange28dControl BGPRouteTimeseriesParamsDateRange = "28dControl"
+ BGPRouteTimeseriesParamsDateRange12wControl BGPRouteTimeseriesParamsDateRange = "12wControl"
+ BGPRouteTimeseriesParamsDateRange24wControl BGPRouteTimeseriesParamsDateRange = "24wControl"
+)
+
+// Format results are returned in.
+type BGPRouteTimeseriesParamsFormat string
+
+const (
+ BGPRouteTimeseriesParamsFormatJson BGPRouteTimeseriesParamsFormat = "JSON"
+ BGPRouteTimeseriesParamsFormatCsv BGPRouteTimeseriesParamsFormat = "CSV"
+)
+
+type BGPRouteTimeseriesResponseEnvelope struct {
+ Result BGPRouteTimeseriesResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON bgpRouteTimeseriesResponseEnvelopeJSON `json:"-"`
+}
+
+// bgpRouteTimeseriesResponseEnvelopeJSON contains the JSON metadata for the struct
+// [BGPRouteTimeseriesResponseEnvelope]
+type bgpRouteTimeseriesResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *BGPRouteTimeseriesResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r bgpRouteTimeseriesResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/radar/bgproute_test.go b/radar/bgproute_test.go
new file mode 100644
index 00000000000..1fc6a108e24
--- /dev/null
+++ b/radar/bgproute_test.go
@@ -0,0 +1,132 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/radar"
+)
+
+func TestBGPRouteMoasWithOptionalParams(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"),
+ )
+ _, err := client.Radar.BGP.Routes.Moas(context.TODO(), radar.BGPRouteMoasParams{
+ Format: cloudflare.F(radar.BGPRouteMoasParamsFormatJson),
+ InvalidOnly: cloudflare.F(true),
+ Origin: cloudflare.F(int64(0)),
+ Prefix: cloudflare.F("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())
+ }
+}
+
+func TestBGPRoutePfx2asWithOptionalParams(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"),
+ )
+ _, err := client.Radar.BGP.Routes.Pfx2as(context.TODO(), radar.BGPRoutePfx2asParams{
+ Format: cloudflare.F(radar.BGPRoutePfx2asParamsFormatJson),
+ Origin: cloudflare.F(int64(0)),
+ Prefix: cloudflare.F("1.1.1.0/24"),
+ RpkiStatus: cloudflare.F(radar.BGPRoutePfx2asParamsRpkiStatusInvalid),
+ })
+ 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())
+ }
+}
+
+func TestBGPRouteStatsWithOptionalParams(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"),
+ )
+ _, err := client.Radar.BGP.Routes.Stats(context.TODO(), radar.BGPRouteStatsParams{
+ ASN: cloudflare.F(int64(0)),
+ Format: cloudflare.F(radar.BGPRouteStatsParamsFormatJson),
+ Location: cloudflare.F("US"),
+ })
+ 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())
+ }
+}
+
+func TestBGPRouteTimeseriesWithOptionalParams(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"),
+ )
+ _, err := client.Radar.BGP.Routes.Timeseries(context.TODO(), radar.BGPRouteTimeseriesParams{
+ ASN: cloudflare.F(int64(0)),
+ DateEnd: cloudflare.F(time.Now()),
+ DateRange: cloudflare.F(radar.BGPRouteTimeseriesParamsDateRange7d),
+ DateStart: cloudflare.F(time.Now()),
+ Format: cloudflare.F(radar.BGPRouteTimeseriesParamsFormatJson),
+ })
+ 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/radar/bgptop.go b/radar/bgptop.go
new file mode 100644
index 00000000000..b4bddace264
--- /dev/null
+++ b/radar/bgptop.go
@@ -0,0 +1,230 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "context"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// BGPTopService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewBGPTopService] method instead.
+type BGPTopService struct {
+ Options []option.RequestOption
+ Ases *BGPTopAseService
+}
+
+// NewBGPTopService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewBGPTopService(opts ...option.RequestOption) (r *BGPTopService) {
+ r = &BGPTopService{}
+ r.Options = opts
+ r.Ases = NewBGPTopAseService(opts...)
+ return
+}
+
+// Get the top network prefixes by BGP updates. Values are a percentage out of the
+// total BGP updates.
+func (r *BGPTopService) Prefixes(ctx context.Context, query BGPTopPrefixesParams, opts ...option.RequestOption) (res *BGPTopPrefixesResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env BGPTopPrefixesResponseEnvelope
+ path := "radar/bgp/top/prefixes"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type BGPTopPrefixesResponse struct {
+ Meta BGPTopPrefixesResponseMeta `json:"meta,required"`
+ Top0 []BGPTopPrefixesResponseTop0 `json:"top_0,required"`
+ JSON bgpTopPrefixesResponseJSON `json:"-"`
+}
+
+// bgpTopPrefixesResponseJSON contains the JSON metadata for the struct
+// [BGPTopPrefixesResponse]
+type bgpTopPrefixesResponseJSON struct {
+ Meta apijson.Field
+ Top0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *BGPTopPrefixesResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r bgpTopPrefixesResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type BGPTopPrefixesResponseMeta struct {
+ DateRange []BGPTopPrefixesResponseMetaDateRange `json:"dateRange,required"`
+ JSON bgpTopPrefixesResponseMetaJSON `json:"-"`
+}
+
+// bgpTopPrefixesResponseMetaJSON contains the JSON metadata for the struct
+// [BGPTopPrefixesResponseMeta]
+type bgpTopPrefixesResponseMetaJSON struct {
+ DateRange apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *BGPTopPrefixesResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r bgpTopPrefixesResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type BGPTopPrefixesResponseMetaDateRange 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 bgpTopPrefixesResponseMetaDateRangeJSON `json:"-"`
+}
+
+// bgpTopPrefixesResponseMetaDateRangeJSON contains the JSON metadata for the
+// struct [BGPTopPrefixesResponseMetaDateRange]
+type bgpTopPrefixesResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *BGPTopPrefixesResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r bgpTopPrefixesResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type BGPTopPrefixesResponseTop0 struct {
+ Prefix string `json:"prefix,required"`
+ Value string `json:"value,required"`
+ JSON bgpTopPrefixesResponseTop0JSON `json:"-"`
+}
+
+// bgpTopPrefixesResponseTop0JSON contains the JSON metadata for the struct
+// [BGPTopPrefixesResponseTop0]
+type bgpTopPrefixesResponseTop0JSON struct {
+ Prefix apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *BGPTopPrefixesResponseTop0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r bgpTopPrefixesResponseTop0JSON) RawJSON() string {
+ return r.raw
+}
+
+type BGPTopPrefixesParams 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[[]BGPTopPrefixesParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Format results are returned in.
+ Format param.Field[BGPTopPrefixesParamsFormat] `query:"format"`
+ // Limit the number of objects in the response.
+ Limit param.Field[int64] `query:"limit"`
+ // Array of names that will be used to name the series in responses.
+ Name param.Field[[]string] `query:"name"`
+ // Array of BGP update types.
+ UpdateType param.Field[[]BGPTopPrefixesParamsUpdateType] `query:"updateType"`
+}
+
+// URLQuery serializes [BGPTopPrefixesParams]'s query parameters as `url.Values`.
+func (r BGPTopPrefixesParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type BGPTopPrefixesParamsDateRange string
+
+const (
+ BGPTopPrefixesParamsDateRange1d BGPTopPrefixesParamsDateRange = "1d"
+ BGPTopPrefixesParamsDateRange2d BGPTopPrefixesParamsDateRange = "2d"
+ BGPTopPrefixesParamsDateRange7d BGPTopPrefixesParamsDateRange = "7d"
+ BGPTopPrefixesParamsDateRange14d BGPTopPrefixesParamsDateRange = "14d"
+ BGPTopPrefixesParamsDateRange28d BGPTopPrefixesParamsDateRange = "28d"
+ BGPTopPrefixesParamsDateRange12w BGPTopPrefixesParamsDateRange = "12w"
+ BGPTopPrefixesParamsDateRange24w BGPTopPrefixesParamsDateRange = "24w"
+ BGPTopPrefixesParamsDateRange52w BGPTopPrefixesParamsDateRange = "52w"
+ BGPTopPrefixesParamsDateRange1dControl BGPTopPrefixesParamsDateRange = "1dControl"
+ BGPTopPrefixesParamsDateRange2dControl BGPTopPrefixesParamsDateRange = "2dControl"
+ BGPTopPrefixesParamsDateRange7dControl BGPTopPrefixesParamsDateRange = "7dControl"
+ BGPTopPrefixesParamsDateRange14dControl BGPTopPrefixesParamsDateRange = "14dControl"
+ BGPTopPrefixesParamsDateRange28dControl BGPTopPrefixesParamsDateRange = "28dControl"
+ BGPTopPrefixesParamsDateRange12wControl BGPTopPrefixesParamsDateRange = "12wControl"
+ BGPTopPrefixesParamsDateRange24wControl BGPTopPrefixesParamsDateRange = "24wControl"
+)
+
+// Format results are returned in.
+type BGPTopPrefixesParamsFormat string
+
+const (
+ BGPTopPrefixesParamsFormatJson BGPTopPrefixesParamsFormat = "JSON"
+ BGPTopPrefixesParamsFormatCsv BGPTopPrefixesParamsFormat = "CSV"
+)
+
+type BGPTopPrefixesParamsUpdateType string
+
+const (
+ BGPTopPrefixesParamsUpdateTypeAnnouncement BGPTopPrefixesParamsUpdateType = "ANNOUNCEMENT"
+ BGPTopPrefixesParamsUpdateTypeWithdrawal BGPTopPrefixesParamsUpdateType = "WITHDRAWAL"
+)
+
+type BGPTopPrefixesResponseEnvelope struct {
+ Result BGPTopPrefixesResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON bgpTopPrefixesResponseEnvelopeJSON `json:"-"`
+}
+
+// bgpTopPrefixesResponseEnvelopeJSON contains the JSON metadata for the struct
+// [BGPTopPrefixesResponseEnvelope]
+type bgpTopPrefixesResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *BGPTopPrefixesResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r bgpTopPrefixesResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/radar/bgptop_test.go b/radar/bgptop_test.go
new file mode 100644
index 00000000000..e85729f73bc
--- /dev/null
+++ b/radar/bgptop_test.go
@@ -0,0 +1,49 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/radar"
+)
+
+func TestBGPTopPrefixesWithOptionalParams(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"),
+ )
+ _, err := client.Radar.BGP.Top.Prefixes(context.TODO(), radar.BGPTopPrefixesParams{
+ ASN: cloudflare.F([]string{"string", "string", "string"}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.BGPTopPrefixesParamsDateRange{radar.BGPTopPrefixesParamsDateRange1d, radar.BGPTopPrefixesParamsDateRange2d, radar.BGPTopPrefixesParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Format: cloudflare.F(radar.BGPTopPrefixesParamsFormatJson),
+ Limit: cloudflare.F(int64(5)),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ UpdateType: cloudflare.F([]radar.BGPTopPrefixesParamsUpdateType{radar.BGPTopPrefixesParamsUpdateTypeAnnouncement, radar.BGPTopPrefixesParamsUpdateTypeWithdrawal}),
+ })
+ 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/radar/bgptopase.go b/radar/bgptopase.go
new file mode 100644
index 00000000000..b7a89763fbe
--- /dev/null
+++ b/radar/bgptopase.go
@@ -0,0 +1,373 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "context"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// BGPTopAseService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewBGPTopAseService] method instead.
+type BGPTopAseService struct {
+ Options []option.RequestOption
+}
+
+// NewBGPTopAseService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewBGPTopAseService(opts ...option.RequestOption) (r *BGPTopAseService) {
+ r = &BGPTopAseService{}
+ r.Options = opts
+ return
+}
+
+// Get the top autonomous systems (AS) by BGP updates (announcements only). Values
+// are a percentage out of the total updates.
+func (r *BGPTopAseService) Get(ctx context.Context, query BGPTopAseGetParams, opts ...option.RequestOption) (res *BGPTopAseGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env BGPTopAseGetResponseEnvelope
+ path := "radar/bgp/top/ases"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Get the full list of autonomous systems on the global routing table ordered by
+// announced prefixes count. The data comes from public BGP MRT data archives and
+// updates every 2 hours.
+func (r *BGPTopAseService) Prefixes(ctx context.Context, query BGPTopAsePrefixesParams, opts ...option.RequestOption) (res *BGPTopAsePrefixesResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env BGPTopAsePrefixesResponseEnvelope
+ path := "radar/bgp/top/ases/prefixes"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type BGPTopAseGetResponse struct {
+ Meta BGPTopAseGetResponseMeta `json:"meta,required"`
+ Top0 []BGPTopAseGetResponseTop0 `json:"top_0,required"`
+ JSON bgpTopAseGetResponseJSON `json:"-"`
+}
+
+// bgpTopAseGetResponseJSON contains the JSON metadata for the struct
+// [BGPTopAseGetResponse]
+type bgpTopAseGetResponseJSON struct {
+ Meta apijson.Field
+ Top0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *BGPTopAseGetResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r bgpTopAseGetResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type BGPTopAseGetResponseMeta struct {
+ DateRange []BGPTopAseGetResponseMetaDateRange `json:"dateRange,required"`
+ JSON bgpTopAseGetResponseMetaJSON `json:"-"`
+}
+
+// bgpTopAseGetResponseMetaJSON contains the JSON metadata for the struct
+// [BGPTopAseGetResponseMeta]
+type bgpTopAseGetResponseMetaJSON struct {
+ DateRange apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *BGPTopAseGetResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r bgpTopAseGetResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type BGPTopAseGetResponseMetaDateRange 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 bgpTopAseGetResponseMetaDateRangeJSON `json:"-"`
+}
+
+// bgpTopAseGetResponseMetaDateRangeJSON contains the JSON metadata for the struct
+// [BGPTopAseGetResponseMetaDateRange]
+type bgpTopAseGetResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *BGPTopAseGetResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r bgpTopAseGetResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type BGPTopAseGetResponseTop0 struct {
+ ASN int64 `json:"asn,required"`
+ AsName string `json:"ASName,required"`
+ // Percentage of updates by this AS out of the total updates by all autonomous
+ // systems.
+ Value string `json:"value,required"`
+ JSON bgpTopAseGetResponseTop0JSON `json:"-"`
+}
+
+// bgpTopAseGetResponseTop0JSON contains the JSON metadata for the struct
+// [BGPTopAseGetResponseTop0]
+type bgpTopAseGetResponseTop0JSON struct {
+ ASN apijson.Field
+ AsName apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *BGPTopAseGetResponseTop0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r bgpTopAseGetResponseTop0JSON) RawJSON() string {
+ return r.raw
+}
+
+type BGPTopAsePrefixesResponse struct {
+ ASNs []BGPTopAsePrefixesResponseASN `json:"asns,required"`
+ Meta BGPTopAsePrefixesResponseMeta `json:"meta,required"`
+ JSON bgpTopAsePrefixesResponseJSON `json:"-"`
+}
+
+// bgpTopAsePrefixesResponseJSON contains the JSON metadata for the struct
+// [BGPTopAsePrefixesResponse]
+type bgpTopAsePrefixesResponseJSON struct {
+ ASNs apijson.Field
+ Meta apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *BGPTopAsePrefixesResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r bgpTopAsePrefixesResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type BGPTopAsePrefixesResponseASN struct {
+ ASN int64 `json:"asn,required"`
+ Country string `json:"country,required"`
+ Name string `json:"name,required"`
+ PfxsCount int64 `json:"pfxs_count,required"`
+ JSON bgpTopAsePrefixesResponseASNJSON `json:"-"`
+}
+
+// bgpTopAsePrefixesResponseASNJSON contains the JSON metadata for the struct
+// [BGPTopAsePrefixesResponseASN]
+type bgpTopAsePrefixesResponseASNJSON struct {
+ ASN apijson.Field
+ Country apijson.Field
+ Name apijson.Field
+ PfxsCount apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *BGPTopAsePrefixesResponseASN) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r bgpTopAsePrefixesResponseASNJSON) RawJSON() string {
+ return r.raw
+}
+
+type BGPTopAsePrefixesResponseMeta struct {
+ DataTime string `json:"data_time,required"`
+ QueryTime string `json:"query_time,required"`
+ TotalPeers int64 `json:"total_peers,required"`
+ JSON bgpTopAsePrefixesResponseMetaJSON `json:"-"`
+}
+
+// bgpTopAsePrefixesResponseMetaJSON contains the JSON metadata for the struct
+// [BGPTopAsePrefixesResponseMeta]
+type bgpTopAsePrefixesResponseMetaJSON struct {
+ DataTime apijson.Field
+ QueryTime apijson.Field
+ TotalPeers apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *BGPTopAsePrefixesResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r bgpTopAsePrefixesResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type BGPTopAseGetParams 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[[]BGPTopAseGetParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Format results are returned in.
+ Format param.Field[BGPTopAseGetParamsFormat] `query:"format"`
+ // Limit the number of objects in the response.
+ Limit param.Field[int64] `query:"limit"`
+ // Array of names that will be used to name the series in responses.
+ Name param.Field[[]string] `query:"name"`
+ // Array of BGP network prefixes.
+ Prefix param.Field[[]string] `query:"prefix"`
+ // Array of BGP update types.
+ UpdateType param.Field[[]BGPTopAseGetParamsUpdateType] `query:"updateType"`
+}
+
+// URLQuery serializes [BGPTopAseGetParams]'s query parameters as `url.Values`.
+func (r BGPTopAseGetParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type BGPTopAseGetParamsDateRange string
+
+const (
+ BGPTopAseGetParamsDateRange1d BGPTopAseGetParamsDateRange = "1d"
+ BGPTopAseGetParamsDateRange2d BGPTopAseGetParamsDateRange = "2d"
+ BGPTopAseGetParamsDateRange7d BGPTopAseGetParamsDateRange = "7d"
+ BGPTopAseGetParamsDateRange14d BGPTopAseGetParamsDateRange = "14d"
+ BGPTopAseGetParamsDateRange28d BGPTopAseGetParamsDateRange = "28d"
+ BGPTopAseGetParamsDateRange12w BGPTopAseGetParamsDateRange = "12w"
+ BGPTopAseGetParamsDateRange24w BGPTopAseGetParamsDateRange = "24w"
+ BGPTopAseGetParamsDateRange52w BGPTopAseGetParamsDateRange = "52w"
+ BGPTopAseGetParamsDateRange1dControl BGPTopAseGetParamsDateRange = "1dControl"
+ BGPTopAseGetParamsDateRange2dControl BGPTopAseGetParamsDateRange = "2dControl"
+ BGPTopAseGetParamsDateRange7dControl BGPTopAseGetParamsDateRange = "7dControl"
+ BGPTopAseGetParamsDateRange14dControl BGPTopAseGetParamsDateRange = "14dControl"
+ BGPTopAseGetParamsDateRange28dControl BGPTopAseGetParamsDateRange = "28dControl"
+ BGPTopAseGetParamsDateRange12wControl BGPTopAseGetParamsDateRange = "12wControl"
+ BGPTopAseGetParamsDateRange24wControl BGPTopAseGetParamsDateRange = "24wControl"
+)
+
+// Format results are returned in.
+type BGPTopAseGetParamsFormat string
+
+const (
+ BGPTopAseGetParamsFormatJson BGPTopAseGetParamsFormat = "JSON"
+ BGPTopAseGetParamsFormatCsv BGPTopAseGetParamsFormat = "CSV"
+)
+
+type BGPTopAseGetParamsUpdateType string
+
+const (
+ BGPTopAseGetParamsUpdateTypeAnnouncement BGPTopAseGetParamsUpdateType = "ANNOUNCEMENT"
+ BGPTopAseGetParamsUpdateTypeWithdrawal BGPTopAseGetParamsUpdateType = "WITHDRAWAL"
+)
+
+type BGPTopAseGetResponseEnvelope struct {
+ Result BGPTopAseGetResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON bgpTopAseGetResponseEnvelopeJSON `json:"-"`
+}
+
+// bgpTopAseGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [BGPTopAseGetResponseEnvelope]
+type bgpTopAseGetResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *BGPTopAseGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r bgpTopAseGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type BGPTopAsePrefixesParams struct {
+ // Alpha-2 country code.
+ Country param.Field[string] `query:"country"`
+ // Format results are returned in.
+ Format param.Field[BGPTopAsePrefixesParamsFormat] `query:"format"`
+ // Maximum number of ASes to return
+ Limit param.Field[int64] `query:"limit"`
+}
+
+// URLQuery serializes [BGPTopAsePrefixesParams]'s query parameters as
+// `url.Values`.
+func (r BGPTopAsePrefixesParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Format results are returned in.
+type BGPTopAsePrefixesParamsFormat string
+
+const (
+ BGPTopAsePrefixesParamsFormatJson BGPTopAsePrefixesParamsFormat = "JSON"
+ BGPTopAsePrefixesParamsFormatCsv BGPTopAsePrefixesParamsFormat = "CSV"
+)
+
+type BGPTopAsePrefixesResponseEnvelope struct {
+ Result BGPTopAsePrefixesResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON bgpTopAsePrefixesResponseEnvelopeJSON `json:"-"`
+}
+
+// bgpTopAsePrefixesResponseEnvelopeJSON contains the JSON metadata for the struct
+// [BGPTopAsePrefixesResponseEnvelope]
+type bgpTopAsePrefixesResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *BGPTopAsePrefixesResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r bgpTopAsePrefixesResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/radar/bgptopase_test.go b/radar/bgptopase_test.go
new file mode 100644
index 00000000000..84ed23c0e70
--- /dev/null
+++ b/radar/bgptopase_test.go
@@ -0,0 +1,78 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/radar"
+)
+
+func TestBGPTopAseGetWithOptionalParams(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"),
+ )
+ _, err := client.Radar.BGP.Top.Ases.Get(context.TODO(), radar.BGPTopAseGetParams{
+ ASN: cloudflare.F([]string{"string", "string", "string"}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.BGPTopAseGetParamsDateRange{radar.BGPTopAseGetParamsDateRange1d, radar.BGPTopAseGetParamsDateRange2d, radar.BGPTopAseGetParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Format: cloudflare.F(radar.BGPTopAseGetParamsFormatJson),
+ Limit: cloudflare.F(int64(5)),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ Prefix: cloudflare.F([]string{"string", "string", "string"}),
+ UpdateType: cloudflare.F([]radar.BGPTopAseGetParamsUpdateType{radar.BGPTopAseGetParamsUpdateTypeAnnouncement, radar.BGPTopAseGetParamsUpdateTypeWithdrawal}),
+ })
+ 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())
+ }
+}
+
+func TestBGPTopAsePrefixesWithOptionalParams(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"),
+ )
+ _, err := client.Radar.BGP.Top.Ases.Prefixes(context.TODO(), radar.BGPTopAsePrefixesParams{
+ Country: cloudflare.F("NZ"),
+ Format: cloudflare.F(radar.BGPTopAsePrefixesParamsFormatJson),
+ Limit: cloudflare.F(int64(10)),
+ })
+ 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/radar/connectiontampering.go b/radar/connectiontampering.go
new file mode 100644
index 00000000000..b6945cc0eb1
--- /dev/null
+++ b/radar/connectiontampering.go
@@ -0,0 +1,592 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "context"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// ConnectionTamperingService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewConnectionTamperingService]
+// method instead.
+type ConnectionTamperingService struct {
+ Options []option.RequestOption
+}
+
+// NewConnectionTamperingService generates a new service that applies the given
+// options to each request. These options are applied after the parent client's
+// options (if there is one), and before any request-specific options.
+func NewConnectionTamperingService(opts ...option.RequestOption) (r *ConnectionTamperingService) {
+ r = &ConnectionTamperingService{}
+ r.Options = opts
+ return
+}
+
+// Distribution of connection tampering types over a given time period.
+func (r *ConnectionTamperingService) Summary(ctx context.Context, query ConnectionTamperingSummaryParams, opts ...option.RequestOption) (res *ConnectionTamperingSummaryResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env ConnectionTamperingSummaryResponseEnvelope
+ path := "radar/connection_tampering/summary"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Distribution of connection tampering types over time.
+func (r *ConnectionTamperingService) TimeseriesGroups(ctx context.Context, query ConnectionTamperingTimeseriesGroupsParams, opts ...option.RequestOption) (res *ConnectionTamperingTimeseriesGroupsResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env ConnectionTamperingTimeseriesGroupsResponseEnvelope
+ path := "radar/connection_tampering/timeseries_groups"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type ConnectionTamperingSummaryResponse struct {
+ Meta ConnectionTamperingSummaryResponseMeta `json:"meta,required"`
+ Summary0 ConnectionTamperingSummaryResponseSummary0 `json:"summary_0,required"`
+ JSON connectionTamperingSummaryResponseJSON `json:"-"`
+}
+
+// connectionTamperingSummaryResponseJSON contains the JSON metadata for the struct
+// [ConnectionTamperingSummaryResponse]
+type connectionTamperingSummaryResponseJSON struct {
+ Meta apijson.Field
+ Summary0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ConnectionTamperingSummaryResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r connectionTamperingSummaryResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type ConnectionTamperingSummaryResponseMeta struct {
+ DateRange []ConnectionTamperingSummaryResponseMetaDateRange `json:"dateRange,required"`
+ ConfidenceInfo ConnectionTamperingSummaryResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON connectionTamperingSummaryResponseMetaJSON `json:"-"`
+}
+
+// connectionTamperingSummaryResponseMetaJSON contains the JSON metadata for the
+// struct [ConnectionTamperingSummaryResponseMeta]
+type connectionTamperingSummaryResponseMetaJSON struct {
+ DateRange apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ConnectionTamperingSummaryResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r connectionTamperingSummaryResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type ConnectionTamperingSummaryResponseMetaDateRange 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 connectionTamperingSummaryResponseMetaDateRangeJSON `json:"-"`
+}
+
+// connectionTamperingSummaryResponseMetaDateRangeJSON contains the JSON metadata
+// for the struct [ConnectionTamperingSummaryResponseMetaDateRange]
+type connectionTamperingSummaryResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ConnectionTamperingSummaryResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r connectionTamperingSummaryResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type ConnectionTamperingSummaryResponseMetaConfidenceInfo struct {
+ Annotations []ConnectionTamperingSummaryResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON connectionTamperingSummaryResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// connectionTamperingSummaryResponseMetaConfidenceInfoJSON contains the JSON
+// metadata for the struct [ConnectionTamperingSummaryResponseMetaConfidenceInfo]
+type connectionTamperingSummaryResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ConnectionTamperingSummaryResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r connectionTamperingSummaryResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type ConnectionTamperingSummaryResponseMetaConfidenceInfoAnnotation 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 connectionTamperingSummaryResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// connectionTamperingSummaryResponseMetaConfidenceInfoAnnotationJSON contains the
+// JSON metadata for the struct
+// [ConnectionTamperingSummaryResponseMetaConfidenceInfoAnnotation]
+type connectionTamperingSummaryResponseMetaConfidenceInfoAnnotationJSON 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 *ConnectionTamperingSummaryResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r connectionTamperingSummaryResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type ConnectionTamperingSummaryResponseSummary0 struct {
+ // Connections matching signatures for tampering later in the connection, after the
+ // transfer of multiple data packets.
+ LaterInFlow string `json:"later_in_flow,required"`
+ // Connections that do not match any tampering signatures.
+ NoMatch string `json:"no_match,required"`
+ // Connections matching signatures for tampering after the receipt of a SYN packet
+ // and ACK packet, meaning the TCP connection was successfully established but the
+ // server did not receive any subsequent packets.
+ PostAck string `json:"post_ack,required"`
+ // Connections matching signatures for tampering after the receipt of a packet with
+ // PSH flag set, following connection establishment.
+ PostPsh string `json:"post_psh,required"`
+ // Connections matching signatures for tampering after the receipt of only a single
+ // SYN packet, and before the handshake completes.
+ PostSyn string `json:"post_syn,required"`
+ JSON connectionTamperingSummaryResponseSummary0JSON `json:"-"`
+}
+
+// connectionTamperingSummaryResponseSummary0JSON contains the JSON metadata for
+// the struct [ConnectionTamperingSummaryResponseSummary0]
+type connectionTamperingSummaryResponseSummary0JSON struct {
+ LaterInFlow apijson.Field
+ NoMatch apijson.Field
+ PostAck apijson.Field
+ PostPsh apijson.Field
+ PostSyn apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ConnectionTamperingSummaryResponseSummary0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r connectionTamperingSummaryResponseSummary0JSON) RawJSON() string {
+ return r.raw
+}
+
+type ConnectionTamperingTimeseriesGroupsResponse struct {
+ Meta ConnectionTamperingTimeseriesGroupsResponseMeta `json:"meta,required"`
+ Serie0 ConnectionTamperingTimeseriesGroupsResponseSerie0 `json:"serie_0,required"`
+ JSON connectionTamperingTimeseriesGroupsResponseJSON `json:"-"`
+}
+
+// connectionTamperingTimeseriesGroupsResponseJSON contains the JSON metadata for
+// the struct [ConnectionTamperingTimeseriesGroupsResponse]
+type connectionTamperingTimeseriesGroupsResponseJSON struct {
+ Meta apijson.Field
+ Serie0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ConnectionTamperingTimeseriesGroupsResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r connectionTamperingTimeseriesGroupsResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type ConnectionTamperingTimeseriesGroupsResponseMeta struct {
+ AggInterval string `json:"aggInterval,required"`
+ DateRange []ConnectionTamperingTimeseriesGroupsResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated time.Time `json:"lastUpdated,required" format:"date-time"`
+ ConfidenceInfo ConnectionTamperingTimeseriesGroupsResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON connectionTamperingTimeseriesGroupsResponseMetaJSON `json:"-"`
+}
+
+// connectionTamperingTimeseriesGroupsResponseMetaJSON contains the JSON metadata
+// for the struct [ConnectionTamperingTimeseriesGroupsResponseMeta]
+type connectionTamperingTimeseriesGroupsResponseMetaJSON struct {
+ AggInterval apijson.Field
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ConnectionTamperingTimeseriesGroupsResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r connectionTamperingTimeseriesGroupsResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type ConnectionTamperingTimeseriesGroupsResponseMetaDateRange 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 connectionTamperingTimeseriesGroupsResponseMetaDateRangeJSON `json:"-"`
+}
+
+// connectionTamperingTimeseriesGroupsResponseMetaDateRangeJSON contains the JSON
+// metadata for the struct
+// [ConnectionTamperingTimeseriesGroupsResponseMetaDateRange]
+type connectionTamperingTimeseriesGroupsResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ConnectionTamperingTimeseriesGroupsResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r connectionTamperingTimeseriesGroupsResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type ConnectionTamperingTimeseriesGroupsResponseMetaConfidenceInfo struct {
+ Annotations []ConnectionTamperingTimeseriesGroupsResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON connectionTamperingTimeseriesGroupsResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// connectionTamperingTimeseriesGroupsResponseMetaConfidenceInfoJSON contains the
+// JSON metadata for the struct
+// [ConnectionTamperingTimeseriesGroupsResponseMetaConfidenceInfo]
+type connectionTamperingTimeseriesGroupsResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ConnectionTamperingTimeseriesGroupsResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r connectionTamperingTimeseriesGroupsResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type ConnectionTamperingTimeseriesGroupsResponseMetaConfidenceInfoAnnotation 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 connectionTamperingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// connectionTamperingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationJSON
+// contains the JSON metadata for the struct
+// [ConnectionTamperingTimeseriesGroupsResponseMetaConfidenceInfoAnnotation]
+type connectionTamperingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationJSON 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 *ConnectionTamperingTimeseriesGroupsResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r connectionTamperingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type ConnectionTamperingTimeseriesGroupsResponseSerie0 struct {
+ // Connections matching signatures for tampering later in the connection, after the
+ // transfer of multiple data packets.
+ LaterInFlow []string `json:"later_in_flow,required"`
+ // Connections that do not match any tampering signatures.
+ NoMatch []string `json:"no_match,required"`
+ // Connections matching signatures for tampering after the receipt of a SYN packet
+ // and ACK packet, meaning the TCP connection was successfully established but the
+ // server did not receive any subsequent packets.
+ PostAck []string `json:"post_ack,required"`
+ // Connections matching signatures for tampering after the receipt of a packet with
+ // PSH flag set, following connection establishment.
+ PostPsh []string `json:"post_psh,required"`
+ // Connections matching signatures for tampering after the receipt of only a single
+ // SYN packet, and before the handshake completes.
+ PostSyn []string `json:"post_syn,required"`
+ Timestamps []time.Time `json:"timestamps,required" format:"date-time"`
+ JSON connectionTamperingTimeseriesGroupsResponseSerie0JSON `json:"-"`
+}
+
+// connectionTamperingTimeseriesGroupsResponseSerie0JSON contains the JSON metadata
+// for the struct [ConnectionTamperingTimeseriesGroupsResponseSerie0]
+type connectionTamperingTimeseriesGroupsResponseSerie0JSON struct {
+ LaterInFlow apijson.Field
+ NoMatch apijson.Field
+ PostAck apijson.Field
+ PostPsh apijson.Field
+ PostSyn apijson.Field
+ Timestamps apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ConnectionTamperingTimeseriesGroupsResponseSerie0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r connectionTamperingTimeseriesGroupsResponseSerie0JSON) RawJSON() string {
+ return r.raw
+}
+
+type ConnectionTamperingSummaryParams 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"`
+ // 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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]ConnectionTamperingSummaryParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Format results are returned in.
+ Format param.Field[ConnectionTamperingSummaryParamsFormat] `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"`
+}
+
+// URLQuery serializes [ConnectionTamperingSummaryParams]'s query parameters as
+// `url.Values`.
+func (r ConnectionTamperingSummaryParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type ConnectionTamperingSummaryParamsDateRange string
+
+const (
+ ConnectionTamperingSummaryParamsDateRange1d ConnectionTamperingSummaryParamsDateRange = "1d"
+ ConnectionTamperingSummaryParamsDateRange2d ConnectionTamperingSummaryParamsDateRange = "2d"
+ ConnectionTamperingSummaryParamsDateRange7d ConnectionTamperingSummaryParamsDateRange = "7d"
+ ConnectionTamperingSummaryParamsDateRange14d ConnectionTamperingSummaryParamsDateRange = "14d"
+ ConnectionTamperingSummaryParamsDateRange28d ConnectionTamperingSummaryParamsDateRange = "28d"
+ ConnectionTamperingSummaryParamsDateRange12w ConnectionTamperingSummaryParamsDateRange = "12w"
+ ConnectionTamperingSummaryParamsDateRange24w ConnectionTamperingSummaryParamsDateRange = "24w"
+ ConnectionTamperingSummaryParamsDateRange52w ConnectionTamperingSummaryParamsDateRange = "52w"
+ ConnectionTamperingSummaryParamsDateRange1dControl ConnectionTamperingSummaryParamsDateRange = "1dControl"
+ ConnectionTamperingSummaryParamsDateRange2dControl ConnectionTamperingSummaryParamsDateRange = "2dControl"
+ ConnectionTamperingSummaryParamsDateRange7dControl ConnectionTamperingSummaryParamsDateRange = "7dControl"
+ ConnectionTamperingSummaryParamsDateRange14dControl ConnectionTamperingSummaryParamsDateRange = "14dControl"
+ ConnectionTamperingSummaryParamsDateRange28dControl ConnectionTamperingSummaryParamsDateRange = "28dControl"
+ ConnectionTamperingSummaryParamsDateRange12wControl ConnectionTamperingSummaryParamsDateRange = "12wControl"
+ ConnectionTamperingSummaryParamsDateRange24wControl ConnectionTamperingSummaryParamsDateRange = "24wControl"
+)
+
+// Format results are returned in.
+type ConnectionTamperingSummaryParamsFormat string
+
+const (
+ ConnectionTamperingSummaryParamsFormatJson ConnectionTamperingSummaryParamsFormat = "JSON"
+ ConnectionTamperingSummaryParamsFormatCsv ConnectionTamperingSummaryParamsFormat = "CSV"
+)
+
+type ConnectionTamperingSummaryResponseEnvelope struct {
+ Result ConnectionTamperingSummaryResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON connectionTamperingSummaryResponseEnvelopeJSON `json:"-"`
+}
+
+// connectionTamperingSummaryResponseEnvelopeJSON contains the JSON metadata for
+// the struct [ConnectionTamperingSummaryResponseEnvelope]
+type connectionTamperingSummaryResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ConnectionTamperingSummaryResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r connectionTamperingSummaryResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type ConnectionTamperingTimeseriesGroupsParams struct {
+ // Aggregation interval results should be returned in (for example, in 15 minutes
+ // or 1 hour intervals). Refer to
+ // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+ AggInterval param.Field[ConnectionTamperingTimeseriesGroupsParamsAggInterval] `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"`
+ // 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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]ConnectionTamperingTimeseriesGroupsParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Format results are returned in.
+ Format param.Field[ConnectionTamperingTimeseriesGroupsParamsFormat] `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"`
+}
+
+// URLQuery serializes [ConnectionTamperingTimeseriesGroupsParams]'s query
+// parameters as `url.Values`.
+func (r ConnectionTamperingTimeseriesGroupsParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Aggregation interval results should be returned in (for example, in 15 minutes
+// or 1 hour intervals). Refer to
+// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+type ConnectionTamperingTimeseriesGroupsParamsAggInterval string
+
+const (
+ ConnectionTamperingTimeseriesGroupsParamsAggInterval15m ConnectionTamperingTimeseriesGroupsParamsAggInterval = "15m"
+ ConnectionTamperingTimeseriesGroupsParamsAggInterval1h ConnectionTamperingTimeseriesGroupsParamsAggInterval = "1h"
+ ConnectionTamperingTimeseriesGroupsParamsAggInterval1d ConnectionTamperingTimeseriesGroupsParamsAggInterval = "1d"
+ ConnectionTamperingTimeseriesGroupsParamsAggInterval1w ConnectionTamperingTimeseriesGroupsParamsAggInterval = "1w"
+)
+
+type ConnectionTamperingTimeseriesGroupsParamsDateRange string
+
+const (
+ ConnectionTamperingTimeseriesGroupsParamsDateRange1d ConnectionTamperingTimeseriesGroupsParamsDateRange = "1d"
+ ConnectionTamperingTimeseriesGroupsParamsDateRange2d ConnectionTamperingTimeseriesGroupsParamsDateRange = "2d"
+ ConnectionTamperingTimeseriesGroupsParamsDateRange7d ConnectionTamperingTimeseriesGroupsParamsDateRange = "7d"
+ ConnectionTamperingTimeseriesGroupsParamsDateRange14d ConnectionTamperingTimeseriesGroupsParamsDateRange = "14d"
+ ConnectionTamperingTimeseriesGroupsParamsDateRange28d ConnectionTamperingTimeseriesGroupsParamsDateRange = "28d"
+ ConnectionTamperingTimeseriesGroupsParamsDateRange12w ConnectionTamperingTimeseriesGroupsParamsDateRange = "12w"
+ ConnectionTamperingTimeseriesGroupsParamsDateRange24w ConnectionTamperingTimeseriesGroupsParamsDateRange = "24w"
+ ConnectionTamperingTimeseriesGroupsParamsDateRange52w ConnectionTamperingTimeseriesGroupsParamsDateRange = "52w"
+ ConnectionTamperingTimeseriesGroupsParamsDateRange1dControl ConnectionTamperingTimeseriesGroupsParamsDateRange = "1dControl"
+ ConnectionTamperingTimeseriesGroupsParamsDateRange2dControl ConnectionTamperingTimeseriesGroupsParamsDateRange = "2dControl"
+ ConnectionTamperingTimeseriesGroupsParamsDateRange7dControl ConnectionTamperingTimeseriesGroupsParamsDateRange = "7dControl"
+ ConnectionTamperingTimeseriesGroupsParamsDateRange14dControl ConnectionTamperingTimeseriesGroupsParamsDateRange = "14dControl"
+ ConnectionTamperingTimeseriesGroupsParamsDateRange28dControl ConnectionTamperingTimeseriesGroupsParamsDateRange = "28dControl"
+ ConnectionTamperingTimeseriesGroupsParamsDateRange12wControl ConnectionTamperingTimeseriesGroupsParamsDateRange = "12wControl"
+ ConnectionTamperingTimeseriesGroupsParamsDateRange24wControl ConnectionTamperingTimeseriesGroupsParamsDateRange = "24wControl"
+)
+
+// Format results are returned in.
+type ConnectionTamperingTimeseriesGroupsParamsFormat string
+
+const (
+ ConnectionTamperingTimeseriesGroupsParamsFormatJson ConnectionTamperingTimeseriesGroupsParamsFormat = "JSON"
+ ConnectionTamperingTimeseriesGroupsParamsFormatCsv ConnectionTamperingTimeseriesGroupsParamsFormat = "CSV"
+)
+
+type ConnectionTamperingTimeseriesGroupsResponseEnvelope struct {
+ Result ConnectionTamperingTimeseriesGroupsResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON connectionTamperingTimeseriesGroupsResponseEnvelopeJSON `json:"-"`
+}
+
+// connectionTamperingTimeseriesGroupsResponseEnvelopeJSON contains the JSON
+// metadata for the struct [ConnectionTamperingTimeseriesGroupsResponseEnvelope]
+type connectionTamperingTimeseriesGroupsResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ConnectionTamperingTimeseriesGroupsResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r connectionTamperingTimeseriesGroupsResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/radar/connectiontampering_test.go b/radar/connectiontampering_test.go
new file mode 100644
index 00000000000..202bbfe6653
--- /dev/null
+++ b/radar/connectiontampering_test.go
@@ -0,0 +1,83 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/radar"
+)
+
+func TestConnectionTamperingSummaryWithOptionalParams(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"),
+ )
+ _, err := client.Radar.ConnectionTampering.Summary(context.TODO(), radar.ConnectionTamperingSummaryParams{
+ 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([]radar.ConnectionTamperingSummaryParamsDateRange{radar.ConnectionTamperingSummaryParamsDateRange1d, radar.ConnectionTamperingSummaryParamsDateRange2d, radar.ConnectionTamperingSummaryParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Format: cloudflare.F(radar.ConnectionTamperingSummaryParamsFormatJson),
+ 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())
+ }
+}
+
+func TestConnectionTamperingTimeseriesGroupsWithOptionalParams(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"),
+ )
+ _, err := client.Radar.ConnectionTampering.TimeseriesGroups(context.TODO(), radar.ConnectionTamperingTimeseriesGroupsParams{
+ AggInterval: cloudflare.F(radar.ConnectionTamperingTimeseriesGroupsParamsAggInterval1h),
+ 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([]radar.ConnectionTamperingTimeseriesGroupsParamsDateRange{radar.ConnectionTamperingTimeseriesGroupsParamsDateRange1d, radar.ConnectionTamperingTimeseriesGroupsParamsDateRange2d, radar.ConnectionTamperingTimeseriesGroupsParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Format: cloudflare.F(radar.ConnectionTamperingTimeseriesGroupsParamsFormatJson),
+ 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/radar/dataset.go b/radar/dataset.go
new file mode 100644
index 00000000000..62f56de151e
--- /dev/null
+++ b/radar/dataset.go
@@ -0,0 +1,284 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// DatasetService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewDatasetService] method instead.
+type DatasetService struct {
+ Options []option.RequestOption
+}
+
+// NewDatasetService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewDatasetService(opts ...option.RequestOption) (r *DatasetService) {
+ r = &DatasetService{}
+ r.Options = opts
+ return
+}
+
+// Get a list of datasets.
+func (r *DatasetService) List(ctx context.Context, query DatasetListParams, opts ...option.RequestOption) (res *DatasetListResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env DatasetListResponseEnvelope
+ path := "radar/datasets"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Get a url to download a single dataset.
+func (r *DatasetService) Download(ctx context.Context, params DatasetDownloadParams, opts ...option.RequestOption) (res *DatasetDownloadResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env DatasetDownloadResponseEnvelope
+ path := "radar/datasets/download"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Get the csv content of a given dataset by alias or id. When getting the content
+// by alias the latest dataset is returned, optionally filtered by the latest
+// available at a given date.
+func (r *DatasetService) Get(ctx context.Context, alias string, query DatasetGetParams, opts ...option.RequestOption) (res *string, err error) {
+ opts = append(r.Options[:], opts...)
+ opts = append([]option.RequestOption{option.WithHeader("Accept", "text/csv")}, opts...)
+ path := fmt.Sprintf("radar/datasets/%s", alias)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &res, opts...)
+ return
+}
+
+type DatasetListResponse struct {
+ Datasets []DatasetListResponseDataset `json:"datasets,required"`
+ JSON datasetListResponseJSON `json:"-"`
+}
+
+// datasetListResponseJSON contains the JSON metadata for the struct
+// [DatasetListResponse]
+type datasetListResponseJSON struct {
+ Datasets apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DatasetListResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r datasetListResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type DatasetListResponseDataset struct {
+ ID int64 `json:"id,required"`
+ Description string `json:"description,required"`
+ Meta interface{} `json:"meta,required"`
+ Tags []string `json:"tags,required"`
+ Title string `json:"title,required"`
+ Type string `json:"type,required"`
+ JSON datasetListResponseDatasetJSON `json:"-"`
+}
+
+// datasetListResponseDatasetJSON contains the JSON metadata for the struct
+// [DatasetListResponseDataset]
+type datasetListResponseDatasetJSON struct {
+ ID apijson.Field
+ Description apijson.Field
+ Meta apijson.Field
+ Tags apijson.Field
+ Title apijson.Field
+ Type apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DatasetListResponseDataset) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r datasetListResponseDatasetJSON) RawJSON() string {
+ return r.raw
+}
+
+type DatasetDownloadResponse struct {
+ Dataset DatasetDownloadResponseDataset `json:"dataset,required"`
+ JSON datasetDownloadResponseJSON `json:"-"`
+}
+
+// datasetDownloadResponseJSON contains the JSON metadata for the struct
+// [DatasetDownloadResponse]
+type datasetDownloadResponseJSON struct {
+ Dataset apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DatasetDownloadResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r datasetDownloadResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type DatasetDownloadResponseDataset struct {
+ URL string `json:"url,required"`
+ JSON datasetDownloadResponseDatasetJSON `json:"-"`
+}
+
+// datasetDownloadResponseDatasetJSON contains the JSON metadata for the struct
+// [DatasetDownloadResponseDataset]
+type datasetDownloadResponseDatasetJSON struct {
+ URL apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DatasetDownloadResponseDataset) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r datasetDownloadResponseDatasetJSON) RawJSON() string {
+ return r.raw
+}
+
+type DatasetListParams struct {
+ // Dataset type.
+ DatasetType param.Field[DatasetListParamsDatasetType] `query:"datasetType"`
+ // Format results are returned in.
+ Format param.Field[DatasetListParamsFormat] `query:"format"`
+ // Limit the number of objects in the response.
+ Limit param.Field[int64] `query:"limit"`
+ // Number of objects to skip before grabbing results.
+ Offset param.Field[int64] `query:"offset"`
+}
+
+// URLQuery serializes [DatasetListParams]'s query parameters as `url.Values`.
+func (r DatasetListParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Dataset type.
+type DatasetListParamsDatasetType string
+
+const (
+ DatasetListParamsDatasetTypeRankingBucket DatasetListParamsDatasetType = "RANKING_BUCKET"
+ DatasetListParamsDatasetTypeReport DatasetListParamsDatasetType = "REPORT"
+)
+
+// Format results are returned in.
+type DatasetListParamsFormat string
+
+const (
+ DatasetListParamsFormatJson DatasetListParamsFormat = "JSON"
+ DatasetListParamsFormatCsv DatasetListParamsFormat = "CSV"
+)
+
+type DatasetListResponseEnvelope struct {
+ Result DatasetListResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON datasetListResponseEnvelopeJSON `json:"-"`
+}
+
+// datasetListResponseEnvelopeJSON contains the JSON metadata for the struct
+// [DatasetListResponseEnvelope]
+type datasetListResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DatasetListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r datasetListResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type DatasetDownloadParams struct {
+ DatasetID param.Field[int64] `json:"datasetId,required"`
+ // Format results are returned in.
+ Format param.Field[DatasetDownloadParamsFormat] `query:"format"`
+}
+
+func (r DatasetDownloadParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// URLQuery serializes [DatasetDownloadParams]'s query parameters as `url.Values`.
+func (r DatasetDownloadParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Format results are returned in.
+type DatasetDownloadParamsFormat string
+
+const (
+ DatasetDownloadParamsFormatJson DatasetDownloadParamsFormat = "JSON"
+ DatasetDownloadParamsFormatCsv DatasetDownloadParamsFormat = "CSV"
+)
+
+type DatasetDownloadResponseEnvelope struct {
+ Result DatasetDownloadResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON datasetDownloadResponseEnvelopeJSON `json:"-"`
+}
+
+// datasetDownloadResponseEnvelopeJSON contains the JSON metadata for the struct
+// [DatasetDownloadResponseEnvelope]
+type datasetDownloadResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DatasetDownloadResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r datasetDownloadResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type DatasetGetParams struct {
+ // Filter dataset alias by date
+ Date param.Field[string] `query:"date"`
+}
+
+// URLQuery serializes [DatasetGetParams]'s query parameters as `url.Values`.
+func (r DatasetGetParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
diff --git a/radar/dataset_test.go b/radar/dataset_test.go
new file mode 100644
index 00000000000..8c9d265c101
--- /dev/null
+++ b/radar/dataset_test.go
@@ -0,0 +1,101 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/radar"
+)
+
+func TestDatasetListWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Datasets.List(context.TODO(), radar.DatasetListParams{
+ DatasetType: cloudflare.F(radar.DatasetListParamsDatasetTypeRankingBucket),
+ Format: cloudflare.F(radar.DatasetListParamsFormatJson),
+ Limit: cloudflare.F(int64(5)),
+ Offset: cloudflare.F(int64(0)),
+ })
+ 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())
+ }
+}
+
+func TestDatasetDownloadWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Datasets.Download(context.TODO(), radar.DatasetDownloadParams{
+ DatasetID: cloudflare.F(int64(3)),
+ Format: cloudflare.F(radar.DatasetDownloadParamsFormatJson),
+ })
+ 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())
+ }
+}
+
+func TestDatasetGetWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Datasets.Get(
+ context.TODO(),
+ "ranking_top_1000",
+ radar.DatasetGetParams{
+ Date: cloudflare.F("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/radar/dns.go b/radar/dns.go
new file mode 100644
index 00000000000..192db4f7bba
--- /dev/null
+++ b/radar/dns.go
@@ -0,0 +1,26 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// DNSService contains methods and other services that help with interacting with
+// the cloudflare API. Note, unlike clients, this service does not read variables
+// from the environment automatically. You should not instantiate this service
+// directly, and instead use the [NewDNSService] method instead.
+type DNSService struct {
+ Options []option.RequestOption
+ Top *DNSTopService
+}
+
+// NewDNSService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewDNSService(opts ...option.RequestOption) (r *DNSService) {
+ r = &DNSService{}
+ r.Options = opts
+ r.Top = NewDNSTopService(opts...)
+ return
+}
diff --git a/radar/dnstop.go b/radar/dnstop.go
new file mode 100644
index 00000000000..e9f348e928c
--- /dev/null
+++ b/radar/dnstop.go
@@ -0,0 +1,544 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "context"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// DNSTopService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewDNSTopService] method instead.
+type DNSTopService struct {
+ Options []option.RequestOption
+}
+
+// NewDNSTopService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewDNSTopService(opts ...option.RequestOption) (r *DNSTopService) {
+ r = &DNSTopService{}
+ r.Options = opts
+ return
+}
+
+// Get top autonomous systems by DNS queries made to Cloudflare's public DNS
+// resolver.
+func (r *DNSTopService) Ases(ctx context.Context, query DNSTopAsesParams, opts ...option.RequestOption) (res *DNSTopAsesResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env DNSTopAsesResponseEnvelope
+ path := "radar/dns/top/ases"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Get top locations by DNS queries made to Cloudflare's public DNS resolver.
+func (r *DNSTopService) Locations(ctx context.Context, query DNSTopLocationsParams, opts ...option.RequestOption) (res *DNSTopLocationsResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env DNSTopLocationsResponseEnvelope
+ path := "radar/dns/top/locations"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type DNSTopAsesResponse struct {
+ Meta DNSTopAsesResponseMeta `json:"meta,required"`
+ Top0 []DNSTopAsesResponseTop0 `json:"top_0,required"`
+ JSON dnsTopAsesResponseJSON `json:"-"`
+}
+
+// dnsTopAsesResponseJSON contains the JSON metadata for the struct
+// [DNSTopAsesResponse]
+type dnsTopAsesResponseJSON struct {
+ Meta apijson.Field
+ Top0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DNSTopAsesResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r dnsTopAsesResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type DNSTopAsesResponseMeta struct {
+ DateRange []DNSTopAsesResponseMetaDateRange `json:"dateRange,required"`
+ ConfidenceInfo DNSTopAsesResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON dnsTopAsesResponseMetaJSON `json:"-"`
+}
+
+// dnsTopAsesResponseMetaJSON contains the JSON metadata for the struct
+// [DNSTopAsesResponseMeta]
+type dnsTopAsesResponseMetaJSON struct {
+ DateRange apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DNSTopAsesResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r dnsTopAsesResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type DNSTopAsesResponseMetaDateRange 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 dnsTopAsesResponseMetaDateRangeJSON `json:"-"`
+}
+
+// dnsTopAsesResponseMetaDateRangeJSON contains the JSON metadata for the struct
+// [DNSTopAsesResponseMetaDateRange]
+type dnsTopAsesResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DNSTopAsesResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r dnsTopAsesResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type DNSTopAsesResponseMetaConfidenceInfo struct {
+ Annotations []DNSTopAsesResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON dnsTopAsesResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// dnsTopAsesResponseMetaConfidenceInfoJSON contains the JSON metadata for the
+// struct [DNSTopAsesResponseMetaConfidenceInfo]
+type dnsTopAsesResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DNSTopAsesResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r dnsTopAsesResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type DNSTopAsesResponseMetaConfidenceInfoAnnotation 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 dnsTopAsesResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// dnsTopAsesResponseMetaConfidenceInfoAnnotationJSON contains the JSON metadata
+// for the struct [DNSTopAsesResponseMetaConfidenceInfoAnnotation]
+type dnsTopAsesResponseMetaConfidenceInfoAnnotationJSON 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 *DNSTopAsesResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r dnsTopAsesResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type DNSTopAsesResponseTop0 struct {
+ ClientASN int64 `json:"clientASN,required"`
+ ClientAsName string `json:"clientASName,required"`
+ Value string `json:"value,required"`
+ JSON dnsTopAsesResponseTop0JSON `json:"-"`
+}
+
+// dnsTopAsesResponseTop0JSON contains the JSON metadata for the struct
+// [DNSTopAsesResponseTop0]
+type dnsTopAsesResponseTop0JSON struct {
+ ClientASN apijson.Field
+ ClientAsName apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DNSTopAsesResponseTop0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r dnsTopAsesResponseTop0JSON) RawJSON() string {
+ return r.raw
+}
+
+type DNSTopLocationsResponse struct {
+ Meta DNSTopLocationsResponseMeta `json:"meta,required"`
+ Top0 []DNSTopLocationsResponseTop0 `json:"top_0,required"`
+ JSON dnsTopLocationsResponseJSON `json:"-"`
+}
+
+// dnsTopLocationsResponseJSON contains the JSON metadata for the struct
+// [DNSTopLocationsResponse]
+type dnsTopLocationsResponseJSON struct {
+ Meta apijson.Field
+ Top0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DNSTopLocationsResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r dnsTopLocationsResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type DNSTopLocationsResponseMeta struct {
+ DateRange []DNSTopLocationsResponseMetaDateRange `json:"dateRange,required"`
+ ConfidenceInfo DNSTopLocationsResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON dnsTopLocationsResponseMetaJSON `json:"-"`
+}
+
+// dnsTopLocationsResponseMetaJSON contains the JSON metadata for the struct
+// [DNSTopLocationsResponseMeta]
+type dnsTopLocationsResponseMetaJSON struct {
+ DateRange apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DNSTopLocationsResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r dnsTopLocationsResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type DNSTopLocationsResponseMetaDateRange 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 dnsTopLocationsResponseMetaDateRangeJSON `json:"-"`
+}
+
+// dnsTopLocationsResponseMetaDateRangeJSON contains the JSON metadata for the
+// struct [DNSTopLocationsResponseMetaDateRange]
+type dnsTopLocationsResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DNSTopLocationsResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r dnsTopLocationsResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type DNSTopLocationsResponseMetaConfidenceInfo struct {
+ Annotations []DNSTopLocationsResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON dnsTopLocationsResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// dnsTopLocationsResponseMetaConfidenceInfoJSON contains the JSON metadata for the
+// struct [DNSTopLocationsResponseMetaConfidenceInfo]
+type dnsTopLocationsResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DNSTopLocationsResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r dnsTopLocationsResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type DNSTopLocationsResponseMetaConfidenceInfoAnnotation 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 dnsTopLocationsResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// dnsTopLocationsResponseMetaConfidenceInfoAnnotationJSON contains the JSON
+// metadata for the struct [DNSTopLocationsResponseMetaConfidenceInfoAnnotation]
+type dnsTopLocationsResponseMetaConfidenceInfoAnnotationJSON 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 *DNSTopLocationsResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r dnsTopLocationsResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type DNSTopLocationsResponseTop0 struct {
+ ClientCountryAlpha2 string `json:"clientCountryAlpha2,required"`
+ ClientCountryName string `json:"clientCountryName,required"`
+ Value string `json:"value,required"`
+ JSON dnsTopLocationsResponseTop0JSON `json:"-"`
+}
+
+// dnsTopLocationsResponseTop0JSON contains the JSON metadata for the struct
+// [DNSTopLocationsResponseTop0]
+type dnsTopLocationsResponseTop0JSON struct {
+ ClientCountryAlpha2 apijson.Field
+ ClientCountryName apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DNSTopLocationsResponseTop0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r dnsTopLocationsResponseTop0JSON) RawJSON() string {
+ return r.raw
+}
+
+type DNSTopAsesParams struct {
+ // Array of domain names.
+ Domain param.Field[[]string] `query:"domain,required"`
+ // 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"`
+ // 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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]DNSTopAsesParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Format results are returned in.
+ Format param.Field[DNSTopAsesParamsFormat] `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 [DNSTopAsesParams]'s query parameters as `url.Values`.
+func (r DNSTopAsesParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type DNSTopAsesParamsDateRange string
+
+const (
+ DNSTopAsesParamsDateRange1d DNSTopAsesParamsDateRange = "1d"
+ DNSTopAsesParamsDateRange2d DNSTopAsesParamsDateRange = "2d"
+ DNSTopAsesParamsDateRange7d DNSTopAsesParamsDateRange = "7d"
+ DNSTopAsesParamsDateRange14d DNSTopAsesParamsDateRange = "14d"
+ DNSTopAsesParamsDateRange28d DNSTopAsesParamsDateRange = "28d"
+ DNSTopAsesParamsDateRange12w DNSTopAsesParamsDateRange = "12w"
+ DNSTopAsesParamsDateRange24w DNSTopAsesParamsDateRange = "24w"
+ DNSTopAsesParamsDateRange52w DNSTopAsesParamsDateRange = "52w"
+ DNSTopAsesParamsDateRange1dControl DNSTopAsesParamsDateRange = "1dControl"
+ DNSTopAsesParamsDateRange2dControl DNSTopAsesParamsDateRange = "2dControl"
+ DNSTopAsesParamsDateRange7dControl DNSTopAsesParamsDateRange = "7dControl"
+ DNSTopAsesParamsDateRange14dControl DNSTopAsesParamsDateRange = "14dControl"
+ DNSTopAsesParamsDateRange28dControl DNSTopAsesParamsDateRange = "28dControl"
+ DNSTopAsesParamsDateRange12wControl DNSTopAsesParamsDateRange = "12wControl"
+ DNSTopAsesParamsDateRange24wControl DNSTopAsesParamsDateRange = "24wControl"
+)
+
+// Format results are returned in.
+type DNSTopAsesParamsFormat string
+
+const (
+ DNSTopAsesParamsFormatJson DNSTopAsesParamsFormat = "JSON"
+ DNSTopAsesParamsFormatCsv DNSTopAsesParamsFormat = "CSV"
+)
+
+type DNSTopAsesResponseEnvelope struct {
+ Result DNSTopAsesResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON dnsTopAsesResponseEnvelopeJSON `json:"-"`
+}
+
+// dnsTopAsesResponseEnvelopeJSON contains the JSON metadata for the struct
+// [DNSTopAsesResponseEnvelope]
+type dnsTopAsesResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DNSTopAsesResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r dnsTopAsesResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type DNSTopLocationsParams struct {
+ // Array of domain names.
+ Domain param.Field[[]string] `query:"domain,required"`
+ // 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"`
+ // 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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]DNSTopLocationsParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Format results are returned in.
+ Format param.Field[DNSTopLocationsParamsFormat] `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 [DNSTopLocationsParams]'s query parameters as `url.Values`.
+func (r DNSTopLocationsParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type DNSTopLocationsParamsDateRange string
+
+const (
+ DNSTopLocationsParamsDateRange1d DNSTopLocationsParamsDateRange = "1d"
+ DNSTopLocationsParamsDateRange2d DNSTopLocationsParamsDateRange = "2d"
+ DNSTopLocationsParamsDateRange7d DNSTopLocationsParamsDateRange = "7d"
+ DNSTopLocationsParamsDateRange14d DNSTopLocationsParamsDateRange = "14d"
+ DNSTopLocationsParamsDateRange28d DNSTopLocationsParamsDateRange = "28d"
+ DNSTopLocationsParamsDateRange12w DNSTopLocationsParamsDateRange = "12w"
+ DNSTopLocationsParamsDateRange24w DNSTopLocationsParamsDateRange = "24w"
+ DNSTopLocationsParamsDateRange52w DNSTopLocationsParamsDateRange = "52w"
+ DNSTopLocationsParamsDateRange1dControl DNSTopLocationsParamsDateRange = "1dControl"
+ DNSTopLocationsParamsDateRange2dControl DNSTopLocationsParamsDateRange = "2dControl"
+ DNSTopLocationsParamsDateRange7dControl DNSTopLocationsParamsDateRange = "7dControl"
+ DNSTopLocationsParamsDateRange14dControl DNSTopLocationsParamsDateRange = "14dControl"
+ DNSTopLocationsParamsDateRange28dControl DNSTopLocationsParamsDateRange = "28dControl"
+ DNSTopLocationsParamsDateRange12wControl DNSTopLocationsParamsDateRange = "12wControl"
+ DNSTopLocationsParamsDateRange24wControl DNSTopLocationsParamsDateRange = "24wControl"
+)
+
+// Format results are returned in.
+type DNSTopLocationsParamsFormat string
+
+const (
+ DNSTopLocationsParamsFormatJson DNSTopLocationsParamsFormat = "JSON"
+ DNSTopLocationsParamsFormatCsv DNSTopLocationsParamsFormat = "CSV"
+)
+
+type DNSTopLocationsResponseEnvelope struct {
+ Result DNSTopLocationsResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON dnsTopLocationsResponseEnvelopeJSON `json:"-"`
+}
+
+// dnsTopLocationsResponseEnvelopeJSON contains the JSON metadata for the struct
+// [DNSTopLocationsResponseEnvelope]
+type dnsTopLocationsResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DNSTopLocationsResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r dnsTopLocationsResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/radar/dnstop_test.go b/radar/dnstop_test.go
new file mode 100644
index 00000000000..d975173e193
--- /dev/null
+++ b/radar/dnstop_test.go
@@ -0,0 +1,86 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/radar"
+)
+
+func TestDNSTopAsesWithOptionalParams(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"),
+ )
+ _, err := client.Radar.DNS.Top.Ases(context.TODO(), radar.DNSTopAsesParams{
+ 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([]radar.DNSTopAsesParamsDateRange{radar.DNSTopAsesParamsDateRange1d, radar.DNSTopAsesParamsDateRange2d, radar.DNSTopAsesParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Format: cloudflare.F(radar.DNSTopAsesParamsFormatJson),
+ 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())
+ }
+}
+
+func TestDNSTopLocationsWithOptionalParams(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"),
+ )
+ _, err := client.Radar.DNS.Top.Locations(context.TODO(), radar.DNSTopLocationsParams{
+ 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([]radar.DNSTopLocationsParamsDateRange{radar.DNSTopLocationsParamsDateRange1d, radar.DNSTopLocationsParamsDateRange2d, radar.DNSTopLocationsParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Format: cloudflare.F(radar.DNSTopLocationsParamsFormatJson),
+ 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/radar/email.go b/radar/email.go
new file mode 100644
index 00000000000..0fff4979a23
--- /dev/null
+++ b/radar/email.go
@@ -0,0 +1,28 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// EmailService contains methods and other services that help with interacting with
+// the cloudflare API. Note, unlike clients, this service does not read variables
+// from the environment automatically. You should not instantiate this service
+// directly, and instead use the [NewEmailService] method instead.
+type EmailService struct {
+ Options []option.RequestOption
+ Routing *EmailRoutingService
+ Security *EmailSecurityService
+}
+
+// NewEmailService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewEmailService(opts ...option.RequestOption) (r *EmailService) {
+ r = &EmailService{}
+ r.Options = opts
+ r.Routing = NewEmailRoutingService(opts...)
+ r.Security = NewEmailSecurityService(opts...)
+ return
+}
diff --git a/radar/emailrouting.go b/radar/emailrouting.go
new file mode 100644
index 00000000000..9d2a3adc7ae
--- /dev/null
+++ b/radar/emailrouting.go
@@ -0,0 +1,29 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// EmailRoutingService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewEmailRoutingService] method
+// instead.
+type EmailRoutingService struct {
+ Options []option.RequestOption
+ Summary *EmailRoutingSummaryService
+ TimeseriesGroups *EmailRoutingTimeseriesGroupService
+}
+
+// NewEmailRoutingService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewEmailRoutingService(opts ...option.RequestOption) (r *EmailRoutingService) {
+ r = &EmailRoutingService{}
+ r.Options = opts
+ r.Summary = NewEmailRoutingSummaryService(opts...)
+ r.TimeseriesGroups = NewEmailRoutingTimeseriesGroupService(opts...)
+ return
+}
diff --git a/radar/emailroutingsummary.go b/radar/emailroutingsummary.go
new file mode 100644
index 00000000000..cd46ec106fc
--- /dev/null
+++ b/radar/emailroutingsummary.go
@@ -0,0 +1,1790 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "context"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// EmailRoutingSummaryService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewEmailRoutingSummaryService]
+// method instead.
+type EmailRoutingSummaryService struct {
+ Options []option.RequestOption
+}
+
+// NewEmailRoutingSummaryService generates a new service that applies the given
+// options to each request. These options are applied after the parent client's
+// options (if there is one), and before any request-specific options.
+func NewEmailRoutingSummaryService(opts ...option.RequestOption) (r *EmailRoutingSummaryService) {
+ r = &EmailRoutingSummaryService{}
+ r.Options = opts
+ return
+}
+
+// Percentage distribution of emails classified per ARC validation.
+func (r *EmailRoutingSummaryService) ARC(ctx context.Context, query EmailRoutingSummaryARCParams, opts ...option.RequestOption) (res *EmailRoutingSummaryARCResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env EmailRoutingSummaryARCResponseEnvelope
+ path := "radar/email/routing/summary/arc"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Percentage distribution of emails classified per DKIM validation.
+func (r *EmailRoutingSummaryService) DKIM(ctx context.Context, query EmailRoutingSummaryDKIMParams, opts ...option.RequestOption) (res *EmailRoutingSummaryDKIMResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env EmailRoutingSummaryDKIMResponseEnvelope
+ path := "radar/email/routing/summary/dkim"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Percentage distribution of emails classified per DMARC validation.
+func (r *EmailRoutingSummaryService) DMARC(ctx context.Context, query EmailRoutingSummaryDMARCParams, opts ...option.RequestOption) (res *EmailRoutingSummaryDMARCResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env EmailRoutingSummaryDMARCResponseEnvelope
+ path := "radar/email/routing/summary/dmarc"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Percentage distribution of emails by Encrypted
+func (r *EmailRoutingSummaryService) Encrypted(ctx context.Context, query EmailRoutingSummaryEncryptedParams, opts ...option.RequestOption) (res *EmailRoutingSummaryEncryptedResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env EmailRoutingSummaryEncryptedResponseEnvelope
+ path := "radar/email/routing/summary/encrypted"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Percentage distribution of emails by Ip Version.
+func (r *EmailRoutingSummaryService) IPVersion(ctx context.Context, query EmailRoutingSummaryIPVersionParams, opts ...option.RequestOption) (res *EmailRoutingSummaryIPVersionResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env EmailRoutingSummaryIPVersionResponseEnvelope
+ path := "radar/email/routing/summary/ip_version"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Percentage distribution of emails classified per SPF validation.
+func (r *EmailRoutingSummaryService) SPF(ctx context.Context, query EmailRoutingSummarySPFParams, opts ...option.RequestOption) (res *EmailRoutingSummarySPFResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env EmailRoutingSummarySPFResponseEnvelope
+ path := "radar/email/routing/summary/spf"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type EmailRoutingSummaryARCResponse struct {
+ Meta EmailRoutingSummaryARCResponseMeta `json:"meta,required"`
+ Summary0 EmailRoutingSummaryARCResponseSummary0 `json:"summary_0,required"`
+ JSON emailRoutingSummaryARCResponseJSON `json:"-"`
+}
+
+// emailRoutingSummaryARCResponseJSON contains the JSON metadata for the struct
+// [EmailRoutingSummaryARCResponse]
+type emailRoutingSummaryARCResponseJSON struct {
+ Meta apijson.Field
+ Summary0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailRoutingSummaryARCResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailRoutingSummaryARCResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailRoutingSummaryARCResponseMeta struct {
+ DateRange []EmailRoutingSummaryARCResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ Normalization string `json:"normalization,required"`
+ ConfidenceInfo EmailRoutingSummaryARCResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON emailRoutingSummaryARCResponseMetaJSON `json:"-"`
+}
+
+// emailRoutingSummaryARCResponseMetaJSON contains the JSON metadata for the struct
+// [EmailRoutingSummaryARCResponseMeta]
+type emailRoutingSummaryARCResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ Normalization apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailRoutingSummaryARCResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailRoutingSummaryARCResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailRoutingSummaryARCResponseMetaDateRange 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 emailRoutingSummaryARCResponseMetaDateRangeJSON `json:"-"`
+}
+
+// emailRoutingSummaryARCResponseMetaDateRangeJSON contains the JSON metadata for
+// the struct [EmailRoutingSummaryARCResponseMetaDateRange]
+type emailRoutingSummaryARCResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailRoutingSummaryARCResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailRoutingSummaryARCResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailRoutingSummaryARCResponseMetaConfidenceInfo struct {
+ Annotations []EmailRoutingSummaryARCResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON emailRoutingSummaryARCResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// emailRoutingSummaryARCResponseMetaConfidenceInfoJSON contains the JSON metadata
+// for the struct [EmailRoutingSummaryARCResponseMetaConfidenceInfo]
+type emailRoutingSummaryARCResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailRoutingSummaryARCResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailRoutingSummaryARCResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailRoutingSummaryARCResponseMetaConfidenceInfoAnnotation 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 emailRoutingSummaryARCResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// emailRoutingSummaryARCResponseMetaConfidenceInfoAnnotationJSON contains the JSON
+// metadata for the struct
+// [EmailRoutingSummaryARCResponseMetaConfidenceInfoAnnotation]
+type emailRoutingSummaryARCResponseMetaConfidenceInfoAnnotationJSON 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 *EmailRoutingSummaryARCResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailRoutingSummaryARCResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailRoutingSummaryARCResponseSummary0 struct {
+ Fail string `json:"FAIL,required"`
+ None string `json:"NONE,required"`
+ Pass string `json:"PASS,required"`
+ JSON emailRoutingSummaryARCResponseSummary0JSON `json:"-"`
+}
+
+// emailRoutingSummaryARCResponseSummary0JSON contains the JSON metadata for the
+// struct [EmailRoutingSummaryARCResponseSummary0]
+type emailRoutingSummaryARCResponseSummary0JSON struct {
+ Fail apijson.Field
+ None apijson.Field
+ Pass apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailRoutingSummaryARCResponseSummary0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailRoutingSummaryARCResponseSummary0JSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailRoutingSummaryDKIMResponse struct {
+ Meta EmailRoutingSummaryDKIMResponseMeta `json:"meta,required"`
+ Summary0 EmailRoutingSummaryDKIMResponseSummary0 `json:"summary_0,required"`
+ JSON emailRoutingSummaryDKIMResponseJSON `json:"-"`
+}
+
+// emailRoutingSummaryDKIMResponseJSON contains the JSON metadata for the struct
+// [EmailRoutingSummaryDKIMResponse]
+type emailRoutingSummaryDKIMResponseJSON struct {
+ Meta apijson.Field
+ Summary0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailRoutingSummaryDKIMResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailRoutingSummaryDKIMResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailRoutingSummaryDKIMResponseMeta struct {
+ DateRange []EmailRoutingSummaryDKIMResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ Normalization string `json:"normalization,required"`
+ ConfidenceInfo EmailRoutingSummaryDKIMResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON emailRoutingSummaryDKIMResponseMetaJSON `json:"-"`
+}
+
+// emailRoutingSummaryDKIMResponseMetaJSON contains the JSON metadata for the
+// struct [EmailRoutingSummaryDKIMResponseMeta]
+type emailRoutingSummaryDKIMResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ Normalization apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailRoutingSummaryDKIMResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailRoutingSummaryDKIMResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailRoutingSummaryDKIMResponseMetaDateRange 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 emailRoutingSummaryDKIMResponseMetaDateRangeJSON `json:"-"`
+}
+
+// emailRoutingSummaryDKIMResponseMetaDateRangeJSON contains the JSON metadata for
+// the struct [EmailRoutingSummaryDKIMResponseMetaDateRange]
+type emailRoutingSummaryDKIMResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailRoutingSummaryDKIMResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailRoutingSummaryDKIMResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailRoutingSummaryDKIMResponseMetaConfidenceInfo struct {
+ Annotations []EmailRoutingSummaryDKIMResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON emailRoutingSummaryDKIMResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// emailRoutingSummaryDKIMResponseMetaConfidenceInfoJSON contains the JSON metadata
+// for the struct [EmailRoutingSummaryDKIMResponseMetaConfidenceInfo]
+type emailRoutingSummaryDKIMResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailRoutingSummaryDKIMResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailRoutingSummaryDKIMResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailRoutingSummaryDKIMResponseMetaConfidenceInfoAnnotation 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 emailRoutingSummaryDKIMResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// emailRoutingSummaryDKIMResponseMetaConfidenceInfoAnnotationJSON contains the
+// JSON metadata for the struct
+// [EmailRoutingSummaryDKIMResponseMetaConfidenceInfoAnnotation]
+type emailRoutingSummaryDKIMResponseMetaConfidenceInfoAnnotationJSON 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 *EmailRoutingSummaryDKIMResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailRoutingSummaryDKIMResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailRoutingSummaryDKIMResponseSummary0 struct {
+ Fail string `json:"FAIL,required"`
+ None string `json:"NONE,required"`
+ Pass string `json:"PASS,required"`
+ JSON emailRoutingSummaryDKIMResponseSummary0JSON `json:"-"`
+}
+
+// emailRoutingSummaryDKIMResponseSummary0JSON contains the JSON metadata for the
+// struct [EmailRoutingSummaryDKIMResponseSummary0]
+type emailRoutingSummaryDKIMResponseSummary0JSON struct {
+ Fail apijson.Field
+ None apijson.Field
+ Pass apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailRoutingSummaryDKIMResponseSummary0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailRoutingSummaryDKIMResponseSummary0JSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailRoutingSummaryDMARCResponse struct {
+ Meta EmailRoutingSummaryDMARCResponseMeta `json:"meta,required"`
+ Summary0 EmailRoutingSummaryDMARCResponseSummary0 `json:"summary_0,required"`
+ JSON emailRoutingSummaryDMARCResponseJSON `json:"-"`
+}
+
+// emailRoutingSummaryDMARCResponseJSON contains the JSON metadata for the struct
+// [EmailRoutingSummaryDMARCResponse]
+type emailRoutingSummaryDMARCResponseJSON struct {
+ Meta apijson.Field
+ Summary0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailRoutingSummaryDMARCResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailRoutingSummaryDMARCResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailRoutingSummaryDMARCResponseMeta struct {
+ DateRange []EmailRoutingSummaryDMARCResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ Normalization string `json:"normalization,required"`
+ ConfidenceInfo EmailRoutingSummaryDMARCResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON emailRoutingSummaryDMARCResponseMetaJSON `json:"-"`
+}
+
+// emailRoutingSummaryDMARCResponseMetaJSON contains the JSON metadata for the
+// struct [EmailRoutingSummaryDMARCResponseMeta]
+type emailRoutingSummaryDMARCResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ Normalization apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailRoutingSummaryDMARCResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailRoutingSummaryDMARCResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailRoutingSummaryDMARCResponseMetaDateRange 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 emailRoutingSummaryDMARCResponseMetaDateRangeJSON `json:"-"`
+}
+
+// emailRoutingSummaryDMARCResponseMetaDateRangeJSON contains the JSON metadata for
+// the struct [EmailRoutingSummaryDMARCResponseMetaDateRange]
+type emailRoutingSummaryDMARCResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailRoutingSummaryDMARCResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailRoutingSummaryDMARCResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailRoutingSummaryDMARCResponseMetaConfidenceInfo struct {
+ Annotations []EmailRoutingSummaryDMARCResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON emailRoutingSummaryDMARCResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// emailRoutingSummaryDMARCResponseMetaConfidenceInfoJSON contains the JSON
+// metadata for the struct [EmailRoutingSummaryDMARCResponseMetaConfidenceInfo]
+type emailRoutingSummaryDMARCResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailRoutingSummaryDMARCResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailRoutingSummaryDMARCResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailRoutingSummaryDMARCResponseMetaConfidenceInfoAnnotation 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 emailRoutingSummaryDMARCResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// emailRoutingSummaryDMARCResponseMetaConfidenceInfoAnnotationJSON contains the
+// JSON metadata for the struct
+// [EmailRoutingSummaryDMARCResponseMetaConfidenceInfoAnnotation]
+type emailRoutingSummaryDMARCResponseMetaConfidenceInfoAnnotationJSON 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 *EmailRoutingSummaryDMARCResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailRoutingSummaryDMARCResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailRoutingSummaryDMARCResponseSummary0 struct {
+ Fail string `json:"FAIL,required"`
+ None string `json:"NONE,required"`
+ Pass string `json:"PASS,required"`
+ JSON emailRoutingSummaryDMARCResponseSummary0JSON `json:"-"`
+}
+
+// emailRoutingSummaryDMARCResponseSummary0JSON contains the JSON metadata for the
+// struct [EmailRoutingSummaryDMARCResponseSummary0]
+type emailRoutingSummaryDMARCResponseSummary0JSON struct {
+ Fail apijson.Field
+ None apijson.Field
+ Pass apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailRoutingSummaryDMARCResponseSummary0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailRoutingSummaryDMARCResponseSummary0JSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailRoutingSummaryEncryptedResponse struct {
+ Meta EmailRoutingSummaryEncryptedResponseMeta `json:"meta,required"`
+ Summary0 EmailRoutingSummaryEncryptedResponseSummary0 `json:"summary_0,required"`
+ JSON emailRoutingSummaryEncryptedResponseJSON `json:"-"`
+}
+
+// emailRoutingSummaryEncryptedResponseJSON contains the JSON metadata for the
+// struct [EmailRoutingSummaryEncryptedResponse]
+type emailRoutingSummaryEncryptedResponseJSON struct {
+ Meta apijson.Field
+ Summary0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailRoutingSummaryEncryptedResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailRoutingSummaryEncryptedResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailRoutingSummaryEncryptedResponseMeta struct {
+ DateRange []EmailRoutingSummaryEncryptedResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ Normalization string `json:"normalization,required"`
+ ConfidenceInfo EmailRoutingSummaryEncryptedResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON emailRoutingSummaryEncryptedResponseMetaJSON `json:"-"`
+}
+
+// emailRoutingSummaryEncryptedResponseMetaJSON contains the JSON metadata for the
+// struct [EmailRoutingSummaryEncryptedResponseMeta]
+type emailRoutingSummaryEncryptedResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ Normalization apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailRoutingSummaryEncryptedResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailRoutingSummaryEncryptedResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailRoutingSummaryEncryptedResponseMetaDateRange 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 emailRoutingSummaryEncryptedResponseMetaDateRangeJSON `json:"-"`
+}
+
+// emailRoutingSummaryEncryptedResponseMetaDateRangeJSON contains the JSON metadata
+// for the struct [EmailRoutingSummaryEncryptedResponseMetaDateRange]
+type emailRoutingSummaryEncryptedResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailRoutingSummaryEncryptedResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailRoutingSummaryEncryptedResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailRoutingSummaryEncryptedResponseMetaConfidenceInfo struct {
+ Annotations []EmailRoutingSummaryEncryptedResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON emailRoutingSummaryEncryptedResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// emailRoutingSummaryEncryptedResponseMetaConfidenceInfoJSON contains the JSON
+// metadata for the struct [EmailRoutingSummaryEncryptedResponseMetaConfidenceInfo]
+type emailRoutingSummaryEncryptedResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailRoutingSummaryEncryptedResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailRoutingSummaryEncryptedResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailRoutingSummaryEncryptedResponseMetaConfidenceInfoAnnotation 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 emailRoutingSummaryEncryptedResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// emailRoutingSummaryEncryptedResponseMetaConfidenceInfoAnnotationJSON contains
+// the JSON metadata for the struct
+// [EmailRoutingSummaryEncryptedResponseMetaConfidenceInfoAnnotation]
+type emailRoutingSummaryEncryptedResponseMetaConfidenceInfoAnnotationJSON 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 *EmailRoutingSummaryEncryptedResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailRoutingSummaryEncryptedResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailRoutingSummaryEncryptedResponseSummary0 struct {
+ Encrypted string `json:"ENCRYPTED,required"`
+ NotEncrypted string `json:"NOT_ENCRYPTED,required"`
+ JSON emailRoutingSummaryEncryptedResponseSummary0JSON `json:"-"`
+}
+
+// emailRoutingSummaryEncryptedResponseSummary0JSON contains the JSON metadata for
+// the struct [EmailRoutingSummaryEncryptedResponseSummary0]
+type emailRoutingSummaryEncryptedResponseSummary0JSON struct {
+ Encrypted apijson.Field
+ NotEncrypted apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailRoutingSummaryEncryptedResponseSummary0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailRoutingSummaryEncryptedResponseSummary0JSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailRoutingSummaryIPVersionResponse struct {
+ Meta EmailRoutingSummaryIPVersionResponseMeta `json:"meta,required"`
+ Summary0 EmailRoutingSummaryIPVersionResponseSummary0 `json:"summary_0,required"`
+ JSON emailRoutingSummaryIPVersionResponseJSON `json:"-"`
+}
+
+// emailRoutingSummaryIPVersionResponseJSON contains the JSON metadata for the
+// struct [EmailRoutingSummaryIPVersionResponse]
+type emailRoutingSummaryIPVersionResponseJSON struct {
+ Meta apijson.Field
+ Summary0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailRoutingSummaryIPVersionResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailRoutingSummaryIPVersionResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailRoutingSummaryIPVersionResponseMeta struct {
+ DateRange []EmailRoutingSummaryIPVersionResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ Normalization string `json:"normalization,required"`
+ ConfidenceInfo EmailRoutingSummaryIPVersionResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON emailRoutingSummaryIPVersionResponseMetaJSON `json:"-"`
+}
+
+// emailRoutingSummaryIPVersionResponseMetaJSON contains the JSON metadata for the
+// struct [EmailRoutingSummaryIPVersionResponseMeta]
+type emailRoutingSummaryIPVersionResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ Normalization apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailRoutingSummaryIPVersionResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailRoutingSummaryIPVersionResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailRoutingSummaryIPVersionResponseMetaDateRange 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 emailRoutingSummaryIPVersionResponseMetaDateRangeJSON `json:"-"`
+}
+
+// emailRoutingSummaryIPVersionResponseMetaDateRangeJSON contains the JSON metadata
+// for the struct [EmailRoutingSummaryIPVersionResponseMetaDateRange]
+type emailRoutingSummaryIPVersionResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailRoutingSummaryIPVersionResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailRoutingSummaryIPVersionResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailRoutingSummaryIPVersionResponseMetaConfidenceInfo struct {
+ Annotations []EmailRoutingSummaryIPVersionResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON emailRoutingSummaryIPVersionResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// emailRoutingSummaryIPVersionResponseMetaConfidenceInfoJSON contains the JSON
+// metadata for the struct [EmailRoutingSummaryIPVersionResponseMetaConfidenceInfo]
+type emailRoutingSummaryIPVersionResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailRoutingSummaryIPVersionResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailRoutingSummaryIPVersionResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailRoutingSummaryIPVersionResponseMetaConfidenceInfoAnnotation 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 emailRoutingSummaryIPVersionResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// emailRoutingSummaryIPVersionResponseMetaConfidenceInfoAnnotationJSON contains
+// the JSON metadata for the struct
+// [EmailRoutingSummaryIPVersionResponseMetaConfidenceInfoAnnotation]
+type emailRoutingSummaryIPVersionResponseMetaConfidenceInfoAnnotationJSON 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 *EmailRoutingSummaryIPVersionResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailRoutingSummaryIPVersionResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailRoutingSummaryIPVersionResponseSummary0 struct {
+ IPv4 string `json:"IPv4,required"`
+ IPv6 string `json:"IPv6,required"`
+ JSON emailRoutingSummaryIPVersionResponseSummary0JSON `json:"-"`
+}
+
+// emailRoutingSummaryIPVersionResponseSummary0JSON contains the JSON metadata for
+// the struct [EmailRoutingSummaryIPVersionResponseSummary0]
+type emailRoutingSummaryIPVersionResponseSummary0JSON struct {
+ IPv4 apijson.Field
+ IPv6 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailRoutingSummaryIPVersionResponseSummary0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailRoutingSummaryIPVersionResponseSummary0JSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailRoutingSummarySPFResponse struct {
+ Meta EmailRoutingSummarySPFResponseMeta `json:"meta,required"`
+ Summary0 EmailRoutingSummarySPFResponseSummary0 `json:"summary_0,required"`
+ JSON emailRoutingSummarySPFResponseJSON `json:"-"`
+}
+
+// emailRoutingSummarySPFResponseJSON contains the JSON metadata for the struct
+// [EmailRoutingSummarySPFResponse]
+type emailRoutingSummarySPFResponseJSON struct {
+ Meta apijson.Field
+ Summary0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailRoutingSummarySPFResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailRoutingSummarySPFResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailRoutingSummarySPFResponseMeta struct {
+ DateRange []EmailRoutingSummarySPFResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ Normalization string `json:"normalization,required"`
+ ConfidenceInfo EmailRoutingSummarySPFResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON emailRoutingSummarySPFResponseMetaJSON `json:"-"`
+}
+
+// emailRoutingSummarySPFResponseMetaJSON contains the JSON metadata for the struct
+// [EmailRoutingSummarySPFResponseMeta]
+type emailRoutingSummarySPFResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ Normalization apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailRoutingSummarySPFResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailRoutingSummarySPFResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailRoutingSummarySPFResponseMetaDateRange 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 emailRoutingSummarySPFResponseMetaDateRangeJSON `json:"-"`
+}
+
+// emailRoutingSummarySPFResponseMetaDateRangeJSON contains the JSON metadata for
+// the struct [EmailRoutingSummarySPFResponseMetaDateRange]
+type emailRoutingSummarySPFResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailRoutingSummarySPFResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailRoutingSummarySPFResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailRoutingSummarySPFResponseMetaConfidenceInfo struct {
+ Annotations []EmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON emailRoutingSummarySPFResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// emailRoutingSummarySPFResponseMetaConfidenceInfoJSON contains the JSON metadata
+// for the struct [EmailRoutingSummarySPFResponseMetaConfidenceInfo]
+type emailRoutingSummarySPFResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailRoutingSummarySPFResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailRoutingSummarySPFResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotation 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 emailRoutingSummarySPFResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// emailRoutingSummarySPFResponseMetaConfidenceInfoAnnotationJSON contains the JSON
+// metadata for the struct
+// [EmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotation]
+type emailRoutingSummarySPFResponseMetaConfidenceInfoAnnotationJSON 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 *EmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailRoutingSummarySPFResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailRoutingSummarySPFResponseSummary0 struct {
+ Fail string `json:"FAIL,required"`
+ None string `json:"NONE,required"`
+ Pass string `json:"PASS,required"`
+ JSON emailRoutingSummarySPFResponseSummary0JSON `json:"-"`
+}
+
+// emailRoutingSummarySPFResponseSummary0JSON contains the JSON metadata for the
+// struct [EmailRoutingSummarySPFResponseSummary0]
+type emailRoutingSummarySPFResponseSummary0JSON struct {
+ Fail apijson.Field
+ None apijson.Field
+ Pass apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailRoutingSummarySPFResponseSummary0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailRoutingSummarySPFResponseSummary0JSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailRoutingSummaryARCParams struct {
+ // 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[[]EmailRoutingSummaryARCParamsDateRange] `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[[]EmailRoutingSummaryARCParamsDKIM] `query:"dkim"`
+ // Filter for dmarc.
+ DMARC param.Field[[]EmailRoutingSummaryARCParamsDMARC] `query:"dmarc"`
+ // Filter for encrypted emails.
+ Encrypted param.Field[[]EmailRoutingSummaryARCParamsEncrypted] `query:"encrypted"`
+ // Format results are returned in.
+ Format param.Field[EmailRoutingSummaryARCParamsFormat] `query:"format"`
+ // Filter for ip version.
+ IPVersion param.Field[[]EmailRoutingSummaryARCParamsIPVersion] `query:"ipVersion"`
+ // 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[[]EmailRoutingSummaryARCParamsSPF] `query:"spf"`
+}
+
+// URLQuery serializes [EmailRoutingSummaryARCParams]'s query parameters as
+// `url.Values`.
+func (r EmailRoutingSummaryARCParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type EmailRoutingSummaryARCParamsDateRange string
+
+const (
+ EmailRoutingSummaryARCParamsDateRange1d EmailRoutingSummaryARCParamsDateRange = "1d"
+ EmailRoutingSummaryARCParamsDateRange2d EmailRoutingSummaryARCParamsDateRange = "2d"
+ EmailRoutingSummaryARCParamsDateRange7d EmailRoutingSummaryARCParamsDateRange = "7d"
+ EmailRoutingSummaryARCParamsDateRange14d EmailRoutingSummaryARCParamsDateRange = "14d"
+ EmailRoutingSummaryARCParamsDateRange28d EmailRoutingSummaryARCParamsDateRange = "28d"
+ EmailRoutingSummaryARCParamsDateRange12w EmailRoutingSummaryARCParamsDateRange = "12w"
+ EmailRoutingSummaryARCParamsDateRange24w EmailRoutingSummaryARCParamsDateRange = "24w"
+ EmailRoutingSummaryARCParamsDateRange52w EmailRoutingSummaryARCParamsDateRange = "52w"
+ EmailRoutingSummaryARCParamsDateRange1dControl EmailRoutingSummaryARCParamsDateRange = "1dControl"
+ EmailRoutingSummaryARCParamsDateRange2dControl EmailRoutingSummaryARCParamsDateRange = "2dControl"
+ EmailRoutingSummaryARCParamsDateRange7dControl EmailRoutingSummaryARCParamsDateRange = "7dControl"
+ EmailRoutingSummaryARCParamsDateRange14dControl EmailRoutingSummaryARCParamsDateRange = "14dControl"
+ EmailRoutingSummaryARCParamsDateRange28dControl EmailRoutingSummaryARCParamsDateRange = "28dControl"
+ EmailRoutingSummaryARCParamsDateRange12wControl EmailRoutingSummaryARCParamsDateRange = "12wControl"
+ EmailRoutingSummaryARCParamsDateRange24wControl EmailRoutingSummaryARCParamsDateRange = "24wControl"
+)
+
+type EmailRoutingSummaryARCParamsDKIM string
+
+const (
+ EmailRoutingSummaryARCParamsDKIMPass EmailRoutingSummaryARCParamsDKIM = "PASS"
+ EmailRoutingSummaryARCParamsDKIMNone EmailRoutingSummaryARCParamsDKIM = "NONE"
+ EmailRoutingSummaryARCParamsDKIMFail EmailRoutingSummaryARCParamsDKIM = "FAIL"
+)
+
+type EmailRoutingSummaryARCParamsDMARC string
+
+const (
+ EmailRoutingSummaryARCParamsDMARCPass EmailRoutingSummaryARCParamsDMARC = "PASS"
+ EmailRoutingSummaryARCParamsDMARCNone EmailRoutingSummaryARCParamsDMARC = "NONE"
+ EmailRoutingSummaryARCParamsDMARCFail EmailRoutingSummaryARCParamsDMARC = "FAIL"
+)
+
+type EmailRoutingSummaryARCParamsEncrypted string
+
+const (
+ EmailRoutingSummaryARCParamsEncryptedEncrypted EmailRoutingSummaryARCParamsEncrypted = "ENCRYPTED"
+ EmailRoutingSummaryARCParamsEncryptedNotEncrypted EmailRoutingSummaryARCParamsEncrypted = "NOT_ENCRYPTED"
+)
+
+// Format results are returned in.
+type EmailRoutingSummaryARCParamsFormat string
+
+const (
+ EmailRoutingSummaryARCParamsFormatJson EmailRoutingSummaryARCParamsFormat = "JSON"
+ EmailRoutingSummaryARCParamsFormatCsv EmailRoutingSummaryARCParamsFormat = "CSV"
+)
+
+type EmailRoutingSummaryARCParamsIPVersion string
+
+const (
+ EmailRoutingSummaryARCParamsIPVersionIPv4 EmailRoutingSummaryARCParamsIPVersion = "IPv4"
+ EmailRoutingSummaryARCParamsIPVersionIPv6 EmailRoutingSummaryARCParamsIPVersion = "IPv6"
+)
+
+type EmailRoutingSummaryARCParamsSPF string
+
+const (
+ EmailRoutingSummaryARCParamsSPFPass EmailRoutingSummaryARCParamsSPF = "PASS"
+ EmailRoutingSummaryARCParamsSPFNone EmailRoutingSummaryARCParamsSPF = "NONE"
+ EmailRoutingSummaryARCParamsSPFFail EmailRoutingSummaryARCParamsSPF = "FAIL"
+)
+
+type EmailRoutingSummaryARCResponseEnvelope struct {
+ Result EmailRoutingSummaryARCResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON emailRoutingSummaryARCResponseEnvelopeJSON `json:"-"`
+}
+
+// emailRoutingSummaryARCResponseEnvelopeJSON contains the JSON metadata for the
+// struct [EmailRoutingSummaryARCResponseEnvelope]
+type emailRoutingSummaryARCResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailRoutingSummaryARCResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailRoutingSummaryARCResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailRoutingSummaryDKIMParams struct {
+ // Filter for arc (Authenticated Received Chain).
+ ARC param.Field[[]EmailRoutingSummaryDKIMParamsARC] `query:"arc"`
+ // 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[[]EmailRoutingSummaryDKIMParamsDateRange] `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[[]EmailRoutingSummaryDKIMParamsDMARC] `query:"dmarc"`
+ // Filter for encrypted emails.
+ Encrypted param.Field[[]EmailRoutingSummaryDKIMParamsEncrypted] `query:"encrypted"`
+ // Format results are returned in.
+ Format param.Field[EmailRoutingSummaryDKIMParamsFormat] `query:"format"`
+ // Filter for ip version.
+ IPVersion param.Field[[]EmailRoutingSummaryDKIMParamsIPVersion] `query:"ipVersion"`
+ // 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[[]EmailRoutingSummaryDKIMParamsSPF] `query:"spf"`
+}
+
+// URLQuery serializes [EmailRoutingSummaryDKIMParams]'s query parameters as
+// `url.Values`.
+func (r EmailRoutingSummaryDKIMParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type EmailRoutingSummaryDKIMParamsARC string
+
+const (
+ EmailRoutingSummaryDKIMParamsARCPass EmailRoutingSummaryDKIMParamsARC = "PASS"
+ EmailRoutingSummaryDKIMParamsARCNone EmailRoutingSummaryDKIMParamsARC = "NONE"
+ EmailRoutingSummaryDKIMParamsARCFail EmailRoutingSummaryDKIMParamsARC = "FAIL"
+)
+
+type EmailRoutingSummaryDKIMParamsDateRange string
+
+const (
+ EmailRoutingSummaryDKIMParamsDateRange1d EmailRoutingSummaryDKIMParamsDateRange = "1d"
+ EmailRoutingSummaryDKIMParamsDateRange2d EmailRoutingSummaryDKIMParamsDateRange = "2d"
+ EmailRoutingSummaryDKIMParamsDateRange7d EmailRoutingSummaryDKIMParamsDateRange = "7d"
+ EmailRoutingSummaryDKIMParamsDateRange14d EmailRoutingSummaryDKIMParamsDateRange = "14d"
+ EmailRoutingSummaryDKIMParamsDateRange28d EmailRoutingSummaryDKIMParamsDateRange = "28d"
+ EmailRoutingSummaryDKIMParamsDateRange12w EmailRoutingSummaryDKIMParamsDateRange = "12w"
+ EmailRoutingSummaryDKIMParamsDateRange24w EmailRoutingSummaryDKIMParamsDateRange = "24w"
+ EmailRoutingSummaryDKIMParamsDateRange52w EmailRoutingSummaryDKIMParamsDateRange = "52w"
+ EmailRoutingSummaryDKIMParamsDateRange1dControl EmailRoutingSummaryDKIMParamsDateRange = "1dControl"
+ EmailRoutingSummaryDKIMParamsDateRange2dControl EmailRoutingSummaryDKIMParamsDateRange = "2dControl"
+ EmailRoutingSummaryDKIMParamsDateRange7dControl EmailRoutingSummaryDKIMParamsDateRange = "7dControl"
+ EmailRoutingSummaryDKIMParamsDateRange14dControl EmailRoutingSummaryDKIMParamsDateRange = "14dControl"
+ EmailRoutingSummaryDKIMParamsDateRange28dControl EmailRoutingSummaryDKIMParamsDateRange = "28dControl"
+ EmailRoutingSummaryDKIMParamsDateRange12wControl EmailRoutingSummaryDKIMParamsDateRange = "12wControl"
+ EmailRoutingSummaryDKIMParamsDateRange24wControl EmailRoutingSummaryDKIMParamsDateRange = "24wControl"
+)
+
+type EmailRoutingSummaryDKIMParamsDMARC string
+
+const (
+ EmailRoutingSummaryDKIMParamsDMARCPass EmailRoutingSummaryDKIMParamsDMARC = "PASS"
+ EmailRoutingSummaryDKIMParamsDMARCNone EmailRoutingSummaryDKIMParamsDMARC = "NONE"
+ EmailRoutingSummaryDKIMParamsDMARCFail EmailRoutingSummaryDKIMParamsDMARC = "FAIL"
+)
+
+type EmailRoutingSummaryDKIMParamsEncrypted string
+
+const (
+ EmailRoutingSummaryDKIMParamsEncryptedEncrypted EmailRoutingSummaryDKIMParamsEncrypted = "ENCRYPTED"
+ EmailRoutingSummaryDKIMParamsEncryptedNotEncrypted EmailRoutingSummaryDKIMParamsEncrypted = "NOT_ENCRYPTED"
+)
+
+// Format results are returned in.
+type EmailRoutingSummaryDKIMParamsFormat string
+
+const (
+ EmailRoutingSummaryDKIMParamsFormatJson EmailRoutingSummaryDKIMParamsFormat = "JSON"
+ EmailRoutingSummaryDKIMParamsFormatCsv EmailRoutingSummaryDKIMParamsFormat = "CSV"
+)
+
+type EmailRoutingSummaryDKIMParamsIPVersion string
+
+const (
+ EmailRoutingSummaryDKIMParamsIPVersionIPv4 EmailRoutingSummaryDKIMParamsIPVersion = "IPv4"
+ EmailRoutingSummaryDKIMParamsIPVersionIPv6 EmailRoutingSummaryDKIMParamsIPVersion = "IPv6"
+)
+
+type EmailRoutingSummaryDKIMParamsSPF string
+
+const (
+ EmailRoutingSummaryDKIMParamsSPFPass EmailRoutingSummaryDKIMParamsSPF = "PASS"
+ EmailRoutingSummaryDKIMParamsSPFNone EmailRoutingSummaryDKIMParamsSPF = "NONE"
+ EmailRoutingSummaryDKIMParamsSPFFail EmailRoutingSummaryDKIMParamsSPF = "FAIL"
+)
+
+type EmailRoutingSummaryDKIMResponseEnvelope struct {
+ Result EmailRoutingSummaryDKIMResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON emailRoutingSummaryDKIMResponseEnvelopeJSON `json:"-"`
+}
+
+// emailRoutingSummaryDKIMResponseEnvelopeJSON contains the JSON metadata for the
+// struct [EmailRoutingSummaryDKIMResponseEnvelope]
+type emailRoutingSummaryDKIMResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailRoutingSummaryDKIMResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailRoutingSummaryDKIMResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailRoutingSummaryDMARCParams struct {
+ // Filter for arc (Authenticated Received Chain).
+ ARC param.Field[[]EmailRoutingSummaryDMARCParamsARC] `query:"arc"`
+ // 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[[]EmailRoutingSummaryDMARCParamsDateRange] `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[[]EmailRoutingSummaryDMARCParamsDKIM] `query:"dkim"`
+ // Filter for encrypted emails.
+ Encrypted param.Field[[]EmailRoutingSummaryDMARCParamsEncrypted] `query:"encrypted"`
+ // Format results are returned in.
+ Format param.Field[EmailRoutingSummaryDMARCParamsFormat] `query:"format"`
+ // Filter for ip version.
+ IPVersion param.Field[[]EmailRoutingSummaryDMARCParamsIPVersion] `query:"ipVersion"`
+ // 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[[]EmailRoutingSummaryDMARCParamsSPF] `query:"spf"`
+}
+
+// URLQuery serializes [EmailRoutingSummaryDMARCParams]'s query parameters as
+// `url.Values`.
+func (r EmailRoutingSummaryDMARCParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type EmailRoutingSummaryDMARCParamsARC string
+
+const (
+ EmailRoutingSummaryDMARCParamsARCPass EmailRoutingSummaryDMARCParamsARC = "PASS"
+ EmailRoutingSummaryDMARCParamsARCNone EmailRoutingSummaryDMARCParamsARC = "NONE"
+ EmailRoutingSummaryDMARCParamsARCFail EmailRoutingSummaryDMARCParamsARC = "FAIL"
+)
+
+type EmailRoutingSummaryDMARCParamsDateRange string
+
+const (
+ EmailRoutingSummaryDMARCParamsDateRange1d EmailRoutingSummaryDMARCParamsDateRange = "1d"
+ EmailRoutingSummaryDMARCParamsDateRange2d EmailRoutingSummaryDMARCParamsDateRange = "2d"
+ EmailRoutingSummaryDMARCParamsDateRange7d EmailRoutingSummaryDMARCParamsDateRange = "7d"
+ EmailRoutingSummaryDMARCParamsDateRange14d EmailRoutingSummaryDMARCParamsDateRange = "14d"
+ EmailRoutingSummaryDMARCParamsDateRange28d EmailRoutingSummaryDMARCParamsDateRange = "28d"
+ EmailRoutingSummaryDMARCParamsDateRange12w EmailRoutingSummaryDMARCParamsDateRange = "12w"
+ EmailRoutingSummaryDMARCParamsDateRange24w EmailRoutingSummaryDMARCParamsDateRange = "24w"
+ EmailRoutingSummaryDMARCParamsDateRange52w EmailRoutingSummaryDMARCParamsDateRange = "52w"
+ EmailRoutingSummaryDMARCParamsDateRange1dControl EmailRoutingSummaryDMARCParamsDateRange = "1dControl"
+ EmailRoutingSummaryDMARCParamsDateRange2dControl EmailRoutingSummaryDMARCParamsDateRange = "2dControl"
+ EmailRoutingSummaryDMARCParamsDateRange7dControl EmailRoutingSummaryDMARCParamsDateRange = "7dControl"
+ EmailRoutingSummaryDMARCParamsDateRange14dControl EmailRoutingSummaryDMARCParamsDateRange = "14dControl"
+ EmailRoutingSummaryDMARCParamsDateRange28dControl EmailRoutingSummaryDMARCParamsDateRange = "28dControl"
+ EmailRoutingSummaryDMARCParamsDateRange12wControl EmailRoutingSummaryDMARCParamsDateRange = "12wControl"
+ EmailRoutingSummaryDMARCParamsDateRange24wControl EmailRoutingSummaryDMARCParamsDateRange = "24wControl"
+)
+
+type EmailRoutingSummaryDMARCParamsDKIM string
+
+const (
+ EmailRoutingSummaryDMARCParamsDKIMPass EmailRoutingSummaryDMARCParamsDKIM = "PASS"
+ EmailRoutingSummaryDMARCParamsDKIMNone EmailRoutingSummaryDMARCParamsDKIM = "NONE"
+ EmailRoutingSummaryDMARCParamsDKIMFail EmailRoutingSummaryDMARCParamsDKIM = "FAIL"
+)
+
+type EmailRoutingSummaryDMARCParamsEncrypted string
+
+const (
+ EmailRoutingSummaryDMARCParamsEncryptedEncrypted EmailRoutingSummaryDMARCParamsEncrypted = "ENCRYPTED"
+ EmailRoutingSummaryDMARCParamsEncryptedNotEncrypted EmailRoutingSummaryDMARCParamsEncrypted = "NOT_ENCRYPTED"
+)
+
+// Format results are returned in.
+type EmailRoutingSummaryDMARCParamsFormat string
+
+const (
+ EmailRoutingSummaryDMARCParamsFormatJson EmailRoutingSummaryDMARCParamsFormat = "JSON"
+ EmailRoutingSummaryDMARCParamsFormatCsv EmailRoutingSummaryDMARCParamsFormat = "CSV"
+)
+
+type EmailRoutingSummaryDMARCParamsIPVersion string
+
+const (
+ EmailRoutingSummaryDMARCParamsIPVersionIPv4 EmailRoutingSummaryDMARCParamsIPVersion = "IPv4"
+ EmailRoutingSummaryDMARCParamsIPVersionIPv6 EmailRoutingSummaryDMARCParamsIPVersion = "IPv6"
+)
+
+type EmailRoutingSummaryDMARCParamsSPF string
+
+const (
+ EmailRoutingSummaryDMARCParamsSPFPass EmailRoutingSummaryDMARCParamsSPF = "PASS"
+ EmailRoutingSummaryDMARCParamsSPFNone EmailRoutingSummaryDMARCParamsSPF = "NONE"
+ EmailRoutingSummaryDMARCParamsSPFFail EmailRoutingSummaryDMARCParamsSPF = "FAIL"
+)
+
+type EmailRoutingSummaryDMARCResponseEnvelope struct {
+ Result EmailRoutingSummaryDMARCResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON emailRoutingSummaryDMARCResponseEnvelopeJSON `json:"-"`
+}
+
+// emailRoutingSummaryDMARCResponseEnvelopeJSON contains the JSON metadata for the
+// struct [EmailRoutingSummaryDMARCResponseEnvelope]
+type emailRoutingSummaryDMARCResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailRoutingSummaryDMARCResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailRoutingSummaryDMARCResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailRoutingSummaryEncryptedParams struct {
+ // Filter for arc (Authenticated Received Chain).
+ ARC param.Field[[]EmailRoutingSummaryEncryptedParamsARC] `query:"arc"`
+ // 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[[]EmailRoutingSummaryEncryptedParamsDateRange] `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[[]EmailRoutingSummaryEncryptedParamsDKIM] `query:"dkim"`
+ // Filter for dmarc.
+ DMARC param.Field[[]EmailRoutingSummaryEncryptedParamsDMARC] `query:"dmarc"`
+ // Format results are returned in.
+ Format param.Field[EmailRoutingSummaryEncryptedParamsFormat] `query:"format"`
+ // Filter for ip version.
+ IPVersion param.Field[[]EmailRoutingSummaryEncryptedParamsIPVersion] `query:"ipVersion"`
+ // 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[[]EmailRoutingSummaryEncryptedParamsSPF] `query:"spf"`
+}
+
+// URLQuery serializes [EmailRoutingSummaryEncryptedParams]'s query parameters as
+// `url.Values`.
+func (r EmailRoutingSummaryEncryptedParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type EmailRoutingSummaryEncryptedParamsARC string
+
+const (
+ EmailRoutingSummaryEncryptedParamsARCPass EmailRoutingSummaryEncryptedParamsARC = "PASS"
+ EmailRoutingSummaryEncryptedParamsARCNone EmailRoutingSummaryEncryptedParamsARC = "NONE"
+ EmailRoutingSummaryEncryptedParamsARCFail EmailRoutingSummaryEncryptedParamsARC = "FAIL"
+)
+
+type EmailRoutingSummaryEncryptedParamsDateRange string
+
+const (
+ EmailRoutingSummaryEncryptedParamsDateRange1d EmailRoutingSummaryEncryptedParamsDateRange = "1d"
+ EmailRoutingSummaryEncryptedParamsDateRange2d EmailRoutingSummaryEncryptedParamsDateRange = "2d"
+ EmailRoutingSummaryEncryptedParamsDateRange7d EmailRoutingSummaryEncryptedParamsDateRange = "7d"
+ EmailRoutingSummaryEncryptedParamsDateRange14d EmailRoutingSummaryEncryptedParamsDateRange = "14d"
+ EmailRoutingSummaryEncryptedParamsDateRange28d EmailRoutingSummaryEncryptedParamsDateRange = "28d"
+ EmailRoutingSummaryEncryptedParamsDateRange12w EmailRoutingSummaryEncryptedParamsDateRange = "12w"
+ EmailRoutingSummaryEncryptedParamsDateRange24w EmailRoutingSummaryEncryptedParamsDateRange = "24w"
+ EmailRoutingSummaryEncryptedParamsDateRange52w EmailRoutingSummaryEncryptedParamsDateRange = "52w"
+ EmailRoutingSummaryEncryptedParamsDateRange1dControl EmailRoutingSummaryEncryptedParamsDateRange = "1dControl"
+ EmailRoutingSummaryEncryptedParamsDateRange2dControl EmailRoutingSummaryEncryptedParamsDateRange = "2dControl"
+ EmailRoutingSummaryEncryptedParamsDateRange7dControl EmailRoutingSummaryEncryptedParamsDateRange = "7dControl"
+ EmailRoutingSummaryEncryptedParamsDateRange14dControl EmailRoutingSummaryEncryptedParamsDateRange = "14dControl"
+ EmailRoutingSummaryEncryptedParamsDateRange28dControl EmailRoutingSummaryEncryptedParamsDateRange = "28dControl"
+ EmailRoutingSummaryEncryptedParamsDateRange12wControl EmailRoutingSummaryEncryptedParamsDateRange = "12wControl"
+ EmailRoutingSummaryEncryptedParamsDateRange24wControl EmailRoutingSummaryEncryptedParamsDateRange = "24wControl"
+)
+
+type EmailRoutingSummaryEncryptedParamsDKIM string
+
+const (
+ EmailRoutingSummaryEncryptedParamsDKIMPass EmailRoutingSummaryEncryptedParamsDKIM = "PASS"
+ EmailRoutingSummaryEncryptedParamsDKIMNone EmailRoutingSummaryEncryptedParamsDKIM = "NONE"
+ EmailRoutingSummaryEncryptedParamsDKIMFail EmailRoutingSummaryEncryptedParamsDKIM = "FAIL"
+)
+
+type EmailRoutingSummaryEncryptedParamsDMARC string
+
+const (
+ EmailRoutingSummaryEncryptedParamsDMARCPass EmailRoutingSummaryEncryptedParamsDMARC = "PASS"
+ EmailRoutingSummaryEncryptedParamsDMARCNone EmailRoutingSummaryEncryptedParamsDMARC = "NONE"
+ EmailRoutingSummaryEncryptedParamsDMARCFail EmailRoutingSummaryEncryptedParamsDMARC = "FAIL"
+)
+
+// Format results are returned in.
+type EmailRoutingSummaryEncryptedParamsFormat string
+
+const (
+ EmailRoutingSummaryEncryptedParamsFormatJson EmailRoutingSummaryEncryptedParamsFormat = "JSON"
+ EmailRoutingSummaryEncryptedParamsFormatCsv EmailRoutingSummaryEncryptedParamsFormat = "CSV"
+)
+
+type EmailRoutingSummaryEncryptedParamsIPVersion string
+
+const (
+ EmailRoutingSummaryEncryptedParamsIPVersionIPv4 EmailRoutingSummaryEncryptedParamsIPVersion = "IPv4"
+ EmailRoutingSummaryEncryptedParamsIPVersionIPv6 EmailRoutingSummaryEncryptedParamsIPVersion = "IPv6"
+)
+
+type EmailRoutingSummaryEncryptedParamsSPF string
+
+const (
+ EmailRoutingSummaryEncryptedParamsSPFPass EmailRoutingSummaryEncryptedParamsSPF = "PASS"
+ EmailRoutingSummaryEncryptedParamsSPFNone EmailRoutingSummaryEncryptedParamsSPF = "NONE"
+ EmailRoutingSummaryEncryptedParamsSPFFail EmailRoutingSummaryEncryptedParamsSPF = "FAIL"
+)
+
+type EmailRoutingSummaryEncryptedResponseEnvelope struct {
+ Result EmailRoutingSummaryEncryptedResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON emailRoutingSummaryEncryptedResponseEnvelopeJSON `json:"-"`
+}
+
+// emailRoutingSummaryEncryptedResponseEnvelopeJSON contains the JSON metadata for
+// the struct [EmailRoutingSummaryEncryptedResponseEnvelope]
+type emailRoutingSummaryEncryptedResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailRoutingSummaryEncryptedResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailRoutingSummaryEncryptedResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailRoutingSummaryIPVersionParams struct {
+ // Filter for arc (Authenticated Received Chain).
+ ARC param.Field[[]EmailRoutingSummaryIPVersionParamsARC] `query:"arc"`
+ // 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[[]EmailRoutingSummaryIPVersionParamsDateRange] `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[[]EmailRoutingSummaryIPVersionParamsDKIM] `query:"dkim"`
+ // Filter for dmarc.
+ DMARC param.Field[[]EmailRoutingSummaryIPVersionParamsDMARC] `query:"dmarc"`
+ // Filter for encrypted emails.
+ Encrypted param.Field[[]EmailRoutingSummaryIPVersionParamsEncrypted] `query:"encrypted"`
+ // Format results are returned in.
+ Format param.Field[EmailRoutingSummaryIPVersionParamsFormat] `query:"format"`
+ // 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[[]EmailRoutingSummaryIPVersionParamsSPF] `query:"spf"`
+}
+
+// URLQuery serializes [EmailRoutingSummaryIPVersionParams]'s query parameters as
+// `url.Values`.
+func (r EmailRoutingSummaryIPVersionParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type EmailRoutingSummaryIPVersionParamsARC string
+
+const (
+ EmailRoutingSummaryIPVersionParamsARCPass EmailRoutingSummaryIPVersionParamsARC = "PASS"
+ EmailRoutingSummaryIPVersionParamsARCNone EmailRoutingSummaryIPVersionParamsARC = "NONE"
+ EmailRoutingSummaryIPVersionParamsARCFail EmailRoutingSummaryIPVersionParamsARC = "FAIL"
+)
+
+type EmailRoutingSummaryIPVersionParamsDateRange string
+
+const (
+ EmailRoutingSummaryIPVersionParamsDateRange1d EmailRoutingSummaryIPVersionParamsDateRange = "1d"
+ EmailRoutingSummaryIPVersionParamsDateRange2d EmailRoutingSummaryIPVersionParamsDateRange = "2d"
+ EmailRoutingSummaryIPVersionParamsDateRange7d EmailRoutingSummaryIPVersionParamsDateRange = "7d"
+ EmailRoutingSummaryIPVersionParamsDateRange14d EmailRoutingSummaryIPVersionParamsDateRange = "14d"
+ EmailRoutingSummaryIPVersionParamsDateRange28d EmailRoutingSummaryIPVersionParamsDateRange = "28d"
+ EmailRoutingSummaryIPVersionParamsDateRange12w EmailRoutingSummaryIPVersionParamsDateRange = "12w"
+ EmailRoutingSummaryIPVersionParamsDateRange24w EmailRoutingSummaryIPVersionParamsDateRange = "24w"
+ EmailRoutingSummaryIPVersionParamsDateRange52w EmailRoutingSummaryIPVersionParamsDateRange = "52w"
+ EmailRoutingSummaryIPVersionParamsDateRange1dControl EmailRoutingSummaryIPVersionParamsDateRange = "1dControl"
+ EmailRoutingSummaryIPVersionParamsDateRange2dControl EmailRoutingSummaryIPVersionParamsDateRange = "2dControl"
+ EmailRoutingSummaryIPVersionParamsDateRange7dControl EmailRoutingSummaryIPVersionParamsDateRange = "7dControl"
+ EmailRoutingSummaryIPVersionParamsDateRange14dControl EmailRoutingSummaryIPVersionParamsDateRange = "14dControl"
+ EmailRoutingSummaryIPVersionParamsDateRange28dControl EmailRoutingSummaryIPVersionParamsDateRange = "28dControl"
+ EmailRoutingSummaryIPVersionParamsDateRange12wControl EmailRoutingSummaryIPVersionParamsDateRange = "12wControl"
+ EmailRoutingSummaryIPVersionParamsDateRange24wControl EmailRoutingSummaryIPVersionParamsDateRange = "24wControl"
+)
+
+type EmailRoutingSummaryIPVersionParamsDKIM string
+
+const (
+ EmailRoutingSummaryIPVersionParamsDKIMPass EmailRoutingSummaryIPVersionParamsDKIM = "PASS"
+ EmailRoutingSummaryIPVersionParamsDKIMNone EmailRoutingSummaryIPVersionParamsDKIM = "NONE"
+ EmailRoutingSummaryIPVersionParamsDKIMFail EmailRoutingSummaryIPVersionParamsDKIM = "FAIL"
+)
+
+type EmailRoutingSummaryIPVersionParamsDMARC string
+
+const (
+ EmailRoutingSummaryIPVersionParamsDMARCPass EmailRoutingSummaryIPVersionParamsDMARC = "PASS"
+ EmailRoutingSummaryIPVersionParamsDMARCNone EmailRoutingSummaryIPVersionParamsDMARC = "NONE"
+ EmailRoutingSummaryIPVersionParamsDMARCFail EmailRoutingSummaryIPVersionParamsDMARC = "FAIL"
+)
+
+type EmailRoutingSummaryIPVersionParamsEncrypted string
+
+const (
+ EmailRoutingSummaryIPVersionParamsEncryptedEncrypted EmailRoutingSummaryIPVersionParamsEncrypted = "ENCRYPTED"
+ EmailRoutingSummaryIPVersionParamsEncryptedNotEncrypted EmailRoutingSummaryIPVersionParamsEncrypted = "NOT_ENCRYPTED"
+)
+
+// Format results are returned in.
+type EmailRoutingSummaryIPVersionParamsFormat string
+
+const (
+ EmailRoutingSummaryIPVersionParamsFormatJson EmailRoutingSummaryIPVersionParamsFormat = "JSON"
+ EmailRoutingSummaryIPVersionParamsFormatCsv EmailRoutingSummaryIPVersionParamsFormat = "CSV"
+)
+
+type EmailRoutingSummaryIPVersionParamsSPF string
+
+const (
+ EmailRoutingSummaryIPVersionParamsSPFPass EmailRoutingSummaryIPVersionParamsSPF = "PASS"
+ EmailRoutingSummaryIPVersionParamsSPFNone EmailRoutingSummaryIPVersionParamsSPF = "NONE"
+ EmailRoutingSummaryIPVersionParamsSPFFail EmailRoutingSummaryIPVersionParamsSPF = "FAIL"
+)
+
+type EmailRoutingSummaryIPVersionResponseEnvelope struct {
+ Result EmailRoutingSummaryIPVersionResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON emailRoutingSummaryIPVersionResponseEnvelopeJSON `json:"-"`
+}
+
+// emailRoutingSummaryIPVersionResponseEnvelopeJSON contains the JSON metadata for
+// the struct [EmailRoutingSummaryIPVersionResponseEnvelope]
+type emailRoutingSummaryIPVersionResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailRoutingSummaryIPVersionResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailRoutingSummaryIPVersionResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailRoutingSummarySPFParams struct {
+ // Filter for arc (Authenticated Received Chain).
+ ARC param.Field[[]EmailRoutingSummarySPFParamsARC] `query:"arc"`
+ // 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[[]EmailRoutingSummarySPFParamsDateRange] `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[[]EmailRoutingSummarySPFParamsDKIM] `query:"dkim"`
+ // Filter for dmarc.
+ DMARC param.Field[[]EmailRoutingSummarySPFParamsDMARC] `query:"dmarc"`
+ // Filter for encrypted emails.
+ Encrypted param.Field[[]EmailRoutingSummarySPFParamsEncrypted] `query:"encrypted"`
+ // Format results are returned in.
+ Format param.Field[EmailRoutingSummarySPFParamsFormat] `query:"format"`
+ // Filter for ip version.
+ IPVersion param.Field[[]EmailRoutingSummarySPFParamsIPVersion] `query:"ipVersion"`
+ // Array of names that will be used to name the series in responses.
+ Name param.Field[[]string] `query:"name"`
+}
+
+// URLQuery serializes [EmailRoutingSummarySPFParams]'s query parameters as
+// `url.Values`.
+func (r EmailRoutingSummarySPFParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type EmailRoutingSummarySPFParamsARC string
+
+const (
+ EmailRoutingSummarySPFParamsARCPass EmailRoutingSummarySPFParamsARC = "PASS"
+ EmailRoutingSummarySPFParamsARCNone EmailRoutingSummarySPFParamsARC = "NONE"
+ EmailRoutingSummarySPFParamsARCFail EmailRoutingSummarySPFParamsARC = "FAIL"
+)
+
+type EmailRoutingSummarySPFParamsDateRange string
+
+const (
+ EmailRoutingSummarySPFParamsDateRange1d EmailRoutingSummarySPFParamsDateRange = "1d"
+ EmailRoutingSummarySPFParamsDateRange2d EmailRoutingSummarySPFParamsDateRange = "2d"
+ EmailRoutingSummarySPFParamsDateRange7d EmailRoutingSummarySPFParamsDateRange = "7d"
+ EmailRoutingSummarySPFParamsDateRange14d EmailRoutingSummarySPFParamsDateRange = "14d"
+ EmailRoutingSummarySPFParamsDateRange28d EmailRoutingSummarySPFParamsDateRange = "28d"
+ EmailRoutingSummarySPFParamsDateRange12w EmailRoutingSummarySPFParamsDateRange = "12w"
+ EmailRoutingSummarySPFParamsDateRange24w EmailRoutingSummarySPFParamsDateRange = "24w"
+ EmailRoutingSummarySPFParamsDateRange52w EmailRoutingSummarySPFParamsDateRange = "52w"
+ EmailRoutingSummarySPFParamsDateRange1dControl EmailRoutingSummarySPFParamsDateRange = "1dControl"
+ EmailRoutingSummarySPFParamsDateRange2dControl EmailRoutingSummarySPFParamsDateRange = "2dControl"
+ EmailRoutingSummarySPFParamsDateRange7dControl EmailRoutingSummarySPFParamsDateRange = "7dControl"
+ EmailRoutingSummarySPFParamsDateRange14dControl EmailRoutingSummarySPFParamsDateRange = "14dControl"
+ EmailRoutingSummarySPFParamsDateRange28dControl EmailRoutingSummarySPFParamsDateRange = "28dControl"
+ EmailRoutingSummarySPFParamsDateRange12wControl EmailRoutingSummarySPFParamsDateRange = "12wControl"
+ EmailRoutingSummarySPFParamsDateRange24wControl EmailRoutingSummarySPFParamsDateRange = "24wControl"
+)
+
+type EmailRoutingSummarySPFParamsDKIM string
+
+const (
+ EmailRoutingSummarySPFParamsDKIMPass EmailRoutingSummarySPFParamsDKIM = "PASS"
+ EmailRoutingSummarySPFParamsDKIMNone EmailRoutingSummarySPFParamsDKIM = "NONE"
+ EmailRoutingSummarySPFParamsDKIMFail EmailRoutingSummarySPFParamsDKIM = "FAIL"
+)
+
+type EmailRoutingSummarySPFParamsDMARC string
+
+const (
+ EmailRoutingSummarySPFParamsDMARCPass EmailRoutingSummarySPFParamsDMARC = "PASS"
+ EmailRoutingSummarySPFParamsDMARCNone EmailRoutingSummarySPFParamsDMARC = "NONE"
+ EmailRoutingSummarySPFParamsDMARCFail EmailRoutingSummarySPFParamsDMARC = "FAIL"
+)
+
+type EmailRoutingSummarySPFParamsEncrypted string
+
+const (
+ EmailRoutingSummarySPFParamsEncryptedEncrypted EmailRoutingSummarySPFParamsEncrypted = "ENCRYPTED"
+ EmailRoutingSummarySPFParamsEncryptedNotEncrypted EmailRoutingSummarySPFParamsEncrypted = "NOT_ENCRYPTED"
+)
+
+// Format results are returned in.
+type EmailRoutingSummarySPFParamsFormat string
+
+const (
+ EmailRoutingSummarySPFParamsFormatJson EmailRoutingSummarySPFParamsFormat = "JSON"
+ EmailRoutingSummarySPFParamsFormatCsv EmailRoutingSummarySPFParamsFormat = "CSV"
+)
+
+type EmailRoutingSummarySPFParamsIPVersion string
+
+const (
+ EmailRoutingSummarySPFParamsIPVersionIPv4 EmailRoutingSummarySPFParamsIPVersion = "IPv4"
+ EmailRoutingSummarySPFParamsIPVersionIPv6 EmailRoutingSummarySPFParamsIPVersion = "IPv6"
+)
+
+type EmailRoutingSummarySPFResponseEnvelope struct {
+ Result EmailRoutingSummarySPFResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON emailRoutingSummarySPFResponseEnvelopeJSON `json:"-"`
+}
+
+// emailRoutingSummarySPFResponseEnvelopeJSON contains the JSON metadata for the
+// struct [EmailRoutingSummarySPFResponseEnvelope]
+type emailRoutingSummarySPFResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailRoutingSummarySPFResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailRoutingSummarySPFResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/radar/emailroutingsummary_test.go b/radar/emailroutingsummary_test.go
new file mode 100644
index 00000000000..2cf82c1200d
--- /dev/null
+++ b/radar/emailroutingsummary_test.go
@@ -0,0 +1,226 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/radar"
+)
+
+func TestEmailRoutingSummaryARCWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Email.Routing.Summary.ARC(context.TODO(), radar.EmailRoutingSummaryARCParams{
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.EmailRoutingSummaryARCParamsDateRange{radar.EmailRoutingSummaryARCParamsDateRange1d, radar.EmailRoutingSummaryARCParamsDateRange2d, radar.EmailRoutingSummaryARCParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DKIM: cloudflare.F([]radar.EmailRoutingSummaryARCParamsDKIM{radar.EmailRoutingSummaryARCParamsDKIMPass, radar.EmailRoutingSummaryARCParamsDKIMNone, radar.EmailRoutingSummaryARCParamsDKIMFail}),
+ DMARC: cloudflare.F([]radar.EmailRoutingSummaryARCParamsDMARC{radar.EmailRoutingSummaryARCParamsDMARCPass, radar.EmailRoutingSummaryARCParamsDMARCNone, radar.EmailRoutingSummaryARCParamsDMARCFail}),
+ Encrypted: cloudflare.F([]radar.EmailRoutingSummaryARCParamsEncrypted{radar.EmailRoutingSummaryARCParamsEncryptedEncrypted, radar.EmailRoutingSummaryARCParamsEncryptedNotEncrypted}),
+ Format: cloudflare.F(radar.EmailRoutingSummaryARCParamsFormatJson),
+ IPVersion: cloudflare.F([]radar.EmailRoutingSummaryARCParamsIPVersion{radar.EmailRoutingSummaryARCParamsIPVersionIPv4, radar.EmailRoutingSummaryARCParamsIPVersionIPv6}),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ SPF: cloudflare.F([]radar.EmailRoutingSummaryARCParamsSPF{radar.EmailRoutingSummaryARCParamsSPFPass, radar.EmailRoutingSummaryARCParamsSPFNone, radar.EmailRoutingSummaryARCParamsSPFFail}),
+ })
+ 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())
+ }
+}
+
+func TestEmailRoutingSummaryDKIMWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Email.Routing.Summary.DKIM(context.TODO(), radar.EmailRoutingSummaryDKIMParams{
+ ARC: cloudflare.F([]radar.EmailRoutingSummaryDKIMParamsARC{radar.EmailRoutingSummaryDKIMParamsARCPass, radar.EmailRoutingSummaryDKIMParamsARCNone, radar.EmailRoutingSummaryDKIMParamsARCFail}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.EmailRoutingSummaryDKIMParamsDateRange{radar.EmailRoutingSummaryDKIMParamsDateRange1d, radar.EmailRoutingSummaryDKIMParamsDateRange2d, radar.EmailRoutingSummaryDKIMParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DMARC: cloudflare.F([]radar.EmailRoutingSummaryDKIMParamsDMARC{radar.EmailRoutingSummaryDKIMParamsDMARCPass, radar.EmailRoutingSummaryDKIMParamsDMARCNone, radar.EmailRoutingSummaryDKIMParamsDMARCFail}),
+ Encrypted: cloudflare.F([]radar.EmailRoutingSummaryDKIMParamsEncrypted{radar.EmailRoutingSummaryDKIMParamsEncryptedEncrypted, radar.EmailRoutingSummaryDKIMParamsEncryptedNotEncrypted}),
+ Format: cloudflare.F(radar.EmailRoutingSummaryDKIMParamsFormatJson),
+ IPVersion: cloudflare.F([]radar.EmailRoutingSummaryDKIMParamsIPVersion{radar.EmailRoutingSummaryDKIMParamsIPVersionIPv4, radar.EmailRoutingSummaryDKIMParamsIPVersionIPv6}),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ SPF: cloudflare.F([]radar.EmailRoutingSummaryDKIMParamsSPF{radar.EmailRoutingSummaryDKIMParamsSPFPass, radar.EmailRoutingSummaryDKIMParamsSPFNone, radar.EmailRoutingSummaryDKIMParamsSPFFail}),
+ })
+ 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())
+ }
+}
+
+func TestEmailRoutingSummaryDMARCWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Email.Routing.Summary.DMARC(context.TODO(), radar.EmailRoutingSummaryDMARCParams{
+ ARC: cloudflare.F([]radar.EmailRoutingSummaryDMARCParamsARC{radar.EmailRoutingSummaryDMARCParamsARCPass, radar.EmailRoutingSummaryDMARCParamsARCNone, radar.EmailRoutingSummaryDMARCParamsARCFail}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.EmailRoutingSummaryDMARCParamsDateRange{radar.EmailRoutingSummaryDMARCParamsDateRange1d, radar.EmailRoutingSummaryDMARCParamsDateRange2d, radar.EmailRoutingSummaryDMARCParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DKIM: cloudflare.F([]radar.EmailRoutingSummaryDMARCParamsDKIM{radar.EmailRoutingSummaryDMARCParamsDKIMPass, radar.EmailRoutingSummaryDMARCParamsDKIMNone, radar.EmailRoutingSummaryDMARCParamsDKIMFail}),
+ Encrypted: cloudflare.F([]radar.EmailRoutingSummaryDMARCParamsEncrypted{radar.EmailRoutingSummaryDMARCParamsEncryptedEncrypted, radar.EmailRoutingSummaryDMARCParamsEncryptedNotEncrypted}),
+ Format: cloudflare.F(radar.EmailRoutingSummaryDMARCParamsFormatJson),
+ IPVersion: cloudflare.F([]radar.EmailRoutingSummaryDMARCParamsIPVersion{radar.EmailRoutingSummaryDMARCParamsIPVersionIPv4, radar.EmailRoutingSummaryDMARCParamsIPVersionIPv6}),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ SPF: cloudflare.F([]radar.EmailRoutingSummaryDMARCParamsSPF{radar.EmailRoutingSummaryDMARCParamsSPFPass, radar.EmailRoutingSummaryDMARCParamsSPFNone, radar.EmailRoutingSummaryDMARCParamsSPFFail}),
+ })
+ 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())
+ }
+}
+
+func TestEmailRoutingSummaryEncryptedWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Email.Routing.Summary.Encrypted(context.TODO(), radar.EmailRoutingSummaryEncryptedParams{
+ ARC: cloudflare.F([]radar.EmailRoutingSummaryEncryptedParamsARC{radar.EmailRoutingSummaryEncryptedParamsARCPass, radar.EmailRoutingSummaryEncryptedParamsARCNone, radar.EmailRoutingSummaryEncryptedParamsARCFail}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.EmailRoutingSummaryEncryptedParamsDateRange{radar.EmailRoutingSummaryEncryptedParamsDateRange1d, radar.EmailRoutingSummaryEncryptedParamsDateRange2d, radar.EmailRoutingSummaryEncryptedParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DKIM: cloudflare.F([]radar.EmailRoutingSummaryEncryptedParamsDKIM{radar.EmailRoutingSummaryEncryptedParamsDKIMPass, radar.EmailRoutingSummaryEncryptedParamsDKIMNone, radar.EmailRoutingSummaryEncryptedParamsDKIMFail}),
+ DMARC: cloudflare.F([]radar.EmailRoutingSummaryEncryptedParamsDMARC{radar.EmailRoutingSummaryEncryptedParamsDMARCPass, radar.EmailRoutingSummaryEncryptedParamsDMARCNone, radar.EmailRoutingSummaryEncryptedParamsDMARCFail}),
+ Format: cloudflare.F(radar.EmailRoutingSummaryEncryptedParamsFormatJson),
+ IPVersion: cloudflare.F([]radar.EmailRoutingSummaryEncryptedParamsIPVersion{radar.EmailRoutingSummaryEncryptedParamsIPVersionIPv4, radar.EmailRoutingSummaryEncryptedParamsIPVersionIPv6}),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ SPF: cloudflare.F([]radar.EmailRoutingSummaryEncryptedParamsSPF{radar.EmailRoutingSummaryEncryptedParamsSPFPass, radar.EmailRoutingSummaryEncryptedParamsSPFNone, radar.EmailRoutingSummaryEncryptedParamsSPFFail}),
+ })
+ 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())
+ }
+}
+
+func TestEmailRoutingSummaryIPVersionWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Email.Routing.Summary.IPVersion(context.TODO(), radar.EmailRoutingSummaryIPVersionParams{
+ ARC: cloudflare.F([]radar.EmailRoutingSummaryIPVersionParamsARC{radar.EmailRoutingSummaryIPVersionParamsARCPass, radar.EmailRoutingSummaryIPVersionParamsARCNone, radar.EmailRoutingSummaryIPVersionParamsARCFail}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.EmailRoutingSummaryIPVersionParamsDateRange{radar.EmailRoutingSummaryIPVersionParamsDateRange1d, radar.EmailRoutingSummaryIPVersionParamsDateRange2d, radar.EmailRoutingSummaryIPVersionParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DKIM: cloudflare.F([]radar.EmailRoutingSummaryIPVersionParamsDKIM{radar.EmailRoutingSummaryIPVersionParamsDKIMPass, radar.EmailRoutingSummaryIPVersionParamsDKIMNone, radar.EmailRoutingSummaryIPVersionParamsDKIMFail}),
+ DMARC: cloudflare.F([]radar.EmailRoutingSummaryIPVersionParamsDMARC{radar.EmailRoutingSummaryIPVersionParamsDMARCPass, radar.EmailRoutingSummaryIPVersionParamsDMARCNone, radar.EmailRoutingSummaryIPVersionParamsDMARCFail}),
+ Encrypted: cloudflare.F([]radar.EmailRoutingSummaryIPVersionParamsEncrypted{radar.EmailRoutingSummaryIPVersionParamsEncryptedEncrypted, radar.EmailRoutingSummaryIPVersionParamsEncryptedNotEncrypted}),
+ Format: cloudflare.F(radar.EmailRoutingSummaryIPVersionParamsFormatJson),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ SPF: cloudflare.F([]radar.EmailRoutingSummaryIPVersionParamsSPF{radar.EmailRoutingSummaryIPVersionParamsSPFPass, radar.EmailRoutingSummaryIPVersionParamsSPFNone, radar.EmailRoutingSummaryIPVersionParamsSPFFail}),
+ })
+ 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())
+ }
+}
+
+func TestEmailRoutingSummarySPFWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Email.Routing.Summary.SPF(context.TODO(), radar.EmailRoutingSummarySPFParams{
+ ARC: cloudflare.F([]radar.EmailRoutingSummarySPFParamsARC{radar.EmailRoutingSummarySPFParamsARCPass, radar.EmailRoutingSummarySPFParamsARCNone, radar.EmailRoutingSummarySPFParamsARCFail}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.EmailRoutingSummarySPFParamsDateRange{radar.EmailRoutingSummarySPFParamsDateRange1d, radar.EmailRoutingSummarySPFParamsDateRange2d, radar.EmailRoutingSummarySPFParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DKIM: cloudflare.F([]radar.EmailRoutingSummarySPFParamsDKIM{radar.EmailRoutingSummarySPFParamsDKIMPass, radar.EmailRoutingSummarySPFParamsDKIMNone, radar.EmailRoutingSummarySPFParamsDKIMFail}),
+ DMARC: cloudflare.F([]radar.EmailRoutingSummarySPFParamsDMARC{radar.EmailRoutingSummarySPFParamsDMARCPass, radar.EmailRoutingSummarySPFParamsDMARCNone, radar.EmailRoutingSummarySPFParamsDMARCFail}),
+ Encrypted: cloudflare.F([]radar.EmailRoutingSummarySPFParamsEncrypted{radar.EmailRoutingSummarySPFParamsEncryptedEncrypted, radar.EmailRoutingSummarySPFParamsEncryptedNotEncrypted}),
+ Format: cloudflare.F(radar.EmailRoutingSummarySPFParamsFormatJson),
+ IPVersion: cloudflare.F([]radar.EmailRoutingSummarySPFParamsIPVersion{radar.EmailRoutingSummarySPFParamsIPVersionIPv4, radar.EmailRoutingSummarySPFParamsIPVersionIPv6}),
+ 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/radar/emailroutingtimeseriesgroup.go b/radar/emailroutingtimeseriesgroup.go
new file mode 100644
index 00000000000..61c850796eb
--- /dev/null
+++ b/radar/emailroutingtimeseriesgroup.go
@@ -0,0 +1,1232 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "context"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// EmailRoutingTimeseriesGroupService contains methods and other services that help
+// with interacting with the cloudflare API. Note, unlike clients, this service
+// does not read variables from the environment automatically. You should not
+// instantiate this service directly, and instead use the
+// [NewEmailRoutingTimeseriesGroupService] method instead.
+type EmailRoutingTimeseriesGroupService struct {
+ Options []option.RequestOption
+}
+
+// NewEmailRoutingTimeseriesGroupService generates a new service that applies the
+// given options to each request. These options are applied after the parent
+// client's options (if there is one), and before any request-specific options.
+func NewEmailRoutingTimeseriesGroupService(opts ...option.RequestOption) (r *EmailRoutingTimeseriesGroupService) {
+ r = &EmailRoutingTimeseriesGroupService{}
+ r.Options = opts
+ return
+}
+
+// Percentage distribution of emails classified per Arc validation over time.
+func (r *EmailRoutingTimeseriesGroupService) ARC(ctx context.Context, query EmailRoutingTimeseriesGroupARCParams, opts ...option.RequestOption) (res *EmailRoutingTimeseriesGroupARCResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env EmailRoutingTimeseriesGroupARCResponseEnvelope
+ path := "radar/email/routing/timeseries_groups/arc"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Percentage distribution of emails classified per DKIM validation over time.
+func (r *EmailRoutingTimeseriesGroupService) DKIM(ctx context.Context, query EmailRoutingTimeseriesGroupDKIMParams, opts ...option.RequestOption) (res *EmailRoutingTimeseriesGroupDKIMResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env EmailRoutingTimeseriesGroupDKIMResponseEnvelope
+ path := "radar/email/routing/timeseries_groups/dkim"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Percentage distribution of emails classified per DMARC validation over time.
+func (r *EmailRoutingTimeseriesGroupService) DMARC(ctx context.Context, query EmailRoutingTimeseriesGroupDMARCParams, opts ...option.RequestOption) (res *EmailRoutingTimeseriesGroupDMARCResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env EmailRoutingTimeseriesGroupDMARCResponseEnvelope
+ path := "radar/email/routing/timeseries_groups/dmarc"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Percentage distribution of emails by Encrypted over time.
+func (r *EmailRoutingTimeseriesGroupService) Encrypted(ctx context.Context, query EmailRoutingTimeseriesGroupEncryptedParams, opts ...option.RequestOption) (res *EmailRoutingTimeseriesGroupEncryptedResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env EmailRoutingTimeseriesGroupEncryptedResponseEnvelope
+ path := "radar/email/routing/timeseries_groups/encrypted"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Percentage distribution of emails by Ip Version over time.
+func (r *EmailRoutingTimeseriesGroupService) IPVersion(ctx context.Context, query EmailRoutingTimeseriesGroupIPVersionParams, opts ...option.RequestOption) (res *EmailRoutingTimeseriesGroupIPVersionResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env EmailRoutingTimeseriesGroupIPVersionResponseEnvelope
+ path := "radar/email/routing/timeseries_groups/ip_version"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Percentage distribution of emails classified per SPF validation over time.
+func (r *EmailRoutingTimeseriesGroupService) SPF(ctx context.Context, query EmailRoutingTimeseriesGroupSPFParams, opts ...option.RequestOption) (res *EmailRoutingTimeseriesGroupSPFResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env EmailRoutingTimeseriesGroupSPFResponseEnvelope
+ path := "radar/email/routing/timeseries_groups/spf"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type EmailRoutingTimeseriesGroupARCResponse struct {
+ Meta interface{} `json:"meta,required"`
+ Serie0 EmailRoutingTimeseriesGroupARCResponseSerie0 `json:"serie_0,required"`
+ JSON emailRoutingTimeseriesGroupARCResponseJSON `json:"-"`
+}
+
+// emailRoutingTimeseriesGroupARCResponseJSON contains the JSON metadata for the
+// struct [EmailRoutingTimeseriesGroupARCResponse]
+type emailRoutingTimeseriesGroupARCResponseJSON struct {
+ Meta apijson.Field
+ Serie0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailRoutingTimeseriesGroupARCResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailRoutingTimeseriesGroupARCResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailRoutingTimeseriesGroupARCResponseSerie0 struct {
+ Fail []string `json:"FAIL,required"`
+ None []string `json:"NONE,required"`
+ Pass []string `json:"PASS,required"`
+ JSON emailRoutingTimeseriesGroupARCResponseSerie0JSON `json:"-"`
+}
+
+// emailRoutingTimeseriesGroupARCResponseSerie0JSON contains the JSON metadata for
+// the struct [EmailRoutingTimeseriesGroupARCResponseSerie0]
+type emailRoutingTimeseriesGroupARCResponseSerie0JSON struct {
+ Fail apijson.Field
+ None apijson.Field
+ Pass apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailRoutingTimeseriesGroupARCResponseSerie0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailRoutingTimeseriesGroupARCResponseSerie0JSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailRoutingTimeseriesGroupDKIMResponse struct {
+ Meta interface{} `json:"meta,required"`
+ Serie0 EmailRoutingTimeseriesGroupDKIMResponseSerie0 `json:"serie_0,required"`
+ JSON emailRoutingTimeseriesGroupDKIMResponseJSON `json:"-"`
+}
+
+// emailRoutingTimeseriesGroupDKIMResponseJSON contains the JSON metadata for the
+// struct [EmailRoutingTimeseriesGroupDKIMResponse]
+type emailRoutingTimeseriesGroupDKIMResponseJSON struct {
+ Meta apijson.Field
+ Serie0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailRoutingTimeseriesGroupDKIMResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailRoutingTimeseriesGroupDKIMResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailRoutingTimeseriesGroupDKIMResponseSerie0 struct {
+ Fail []string `json:"FAIL,required"`
+ None []string `json:"NONE,required"`
+ Pass []string `json:"PASS,required"`
+ JSON emailRoutingTimeseriesGroupDKIMResponseSerie0JSON `json:"-"`
+}
+
+// emailRoutingTimeseriesGroupDKIMResponseSerie0JSON contains the JSON metadata for
+// the struct [EmailRoutingTimeseriesGroupDKIMResponseSerie0]
+type emailRoutingTimeseriesGroupDKIMResponseSerie0JSON struct {
+ Fail apijson.Field
+ None apijson.Field
+ Pass apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailRoutingTimeseriesGroupDKIMResponseSerie0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailRoutingTimeseriesGroupDKIMResponseSerie0JSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailRoutingTimeseriesGroupDMARCResponse struct {
+ Meta interface{} `json:"meta,required"`
+ Serie0 EmailRoutingTimeseriesGroupDMARCResponseSerie0 `json:"serie_0,required"`
+ JSON emailRoutingTimeseriesGroupDMARCResponseJSON `json:"-"`
+}
+
+// emailRoutingTimeseriesGroupDMARCResponseJSON contains the JSON metadata for the
+// struct [EmailRoutingTimeseriesGroupDMARCResponse]
+type emailRoutingTimeseriesGroupDMARCResponseJSON struct {
+ Meta apijson.Field
+ Serie0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailRoutingTimeseriesGroupDMARCResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailRoutingTimeseriesGroupDMARCResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailRoutingTimeseriesGroupDMARCResponseSerie0 struct {
+ Fail []string `json:"FAIL,required"`
+ None []string `json:"NONE,required"`
+ Pass []string `json:"PASS,required"`
+ JSON emailRoutingTimeseriesGroupDMARCResponseSerie0JSON `json:"-"`
+}
+
+// emailRoutingTimeseriesGroupDMARCResponseSerie0JSON contains the JSON metadata
+// for the struct [EmailRoutingTimeseriesGroupDMARCResponseSerie0]
+type emailRoutingTimeseriesGroupDMARCResponseSerie0JSON struct {
+ Fail apijson.Field
+ None apijson.Field
+ Pass apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailRoutingTimeseriesGroupDMARCResponseSerie0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailRoutingTimeseriesGroupDMARCResponseSerie0JSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailRoutingTimeseriesGroupEncryptedResponse struct {
+ Meta interface{} `json:"meta,required"`
+ Serie0 EmailRoutingTimeseriesGroupEncryptedResponseSerie0 `json:"serie_0,required"`
+ JSON emailRoutingTimeseriesGroupEncryptedResponseJSON `json:"-"`
+}
+
+// emailRoutingTimeseriesGroupEncryptedResponseJSON contains the JSON metadata for
+// the struct [EmailRoutingTimeseriesGroupEncryptedResponse]
+type emailRoutingTimeseriesGroupEncryptedResponseJSON struct {
+ Meta apijson.Field
+ Serie0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailRoutingTimeseriesGroupEncryptedResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailRoutingTimeseriesGroupEncryptedResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailRoutingTimeseriesGroupEncryptedResponseSerie0 struct {
+ Encrypted []string `json:"ENCRYPTED,required"`
+ NotEncrypted []string `json:"NOT_ENCRYPTED,required"`
+ JSON emailRoutingTimeseriesGroupEncryptedResponseSerie0JSON `json:"-"`
+}
+
+// emailRoutingTimeseriesGroupEncryptedResponseSerie0JSON contains the JSON
+// metadata for the struct [EmailRoutingTimeseriesGroupEncryptedResponseSerie0]
+type emailRoutingTimeseriesGroupEncryptedResponseSerie0JSON struct {
+ Encrypted apijson.Field
+ NotEncrypted apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailRoutingTimeseriesGroupEncryptedResponseSerie0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailRoutingTimeseriesGroupEncryptedResponseSerie0JSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailRoutingTimeseriesGroupIPVersionResponse struct {
+ Meta interface{} `json:"meta,required"`
+ Serie0 EmailRoutingTimeseriesGroupIPVersionResponseSerie0 `json:"serie_0,required"`
+ JSON emailRoutingTimeseriesGroupIPVersionResponseJSON `json:"-"`
+}
+
+// emailRoutingTimeseriesGroupIPVersionResponseJSON contains the JSON metadata for
+// the struct [EmailRoutingTimeseriesGroupIPVersionResponse]
+type emailRoutingTimeseriesGroupIPVersionResponseJSON struct {
+ Meta apijson.Field
+ Serie0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailRoutingTimeseriesGroupIPVersionResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailRoutingTimeseriesGroupIPVersionResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailRoutingTimeseriesGroupIPVersionResponseSerie0 struct {
+ IPv4 []string `json:"IPv4,required"`
+ IPv6 []string `json:"IPv6,required"`
+ JSON emailRoutingTimeseriesGroupIPVersionResponseSerie0JSON `json:"-"`
+}
+
+// emailRoutingTimeseriesGroupIPVersionResponseSerie0JSON contains the JSON
+// metadata for the struct [EmailRoutingTimeseriesGroupIPVersionResponseSerie0]
+type emailRoutingTimeseriesGroupIPVersionResponseSerie0JSON struct {
+ IPv4 apijson.Field
+ IPv6 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailRoutingTimeseriesGroupIPVersionResponseSerie0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailRoutingTimeseriesGroupIPVersionResponseSerie0JSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailRoutingTimeseriesGroupSPFResponse struct {
+ Meta interface{} `json:"meta,required"`
+ Serie0 EmailRoutingTimeseriesGroupSPFResponseSerie0 `json:"serie_0,required"`
+ JSON emailRoutingTimeseriesGroupSPFResponseJSON `json:"-"`
+}
+
+// emailRoutingTimeseriesGroupSPFResponseJSON contains the JSON metadata for the
+// struct [EmailRoutingTimeseriesGroupSPFResponse]
+type emailRoutingTimeseriesGroupSPFResponseJSON struct {
+ Meta apijson.Field
+ Serie0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailRoutingTimeseriesGroupSPFResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailRoutingTimeseriesGroupSPFResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailRoutingTimeseriesGroupSPFResponseSerie0 struct {
+ Fail []string `json:"FAIL,required"`
+ None []string `json:"NONE,required"`
+ Pass []string `json:"PASS,required"`
+ JSON emailRoutingTimeseriesGroupSPFResponseSerie0JSON `json:"-"`
+}
+
+// emailRoutingTimeseriesGroupSPFResponseSerie0JSON contains the JSON metadata for
+// the struct [EmailRoutingTimeseriesGroupSPFResponseSerie0]
+type emailRoutingTimeseriesGroupSPFResponseSerie0JSON struct {
+ Fail apijson.Field
+ None apijson.Field
+ Pass apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailRoutingTimeseriesGroupSPFResponseSerie0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailRoutingTimeseriesGroupSPFResponseSerie0JSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailRoutingTimeseriesGroupARCParams struct {
+ // Aggregation interval results should be returned in (for example, in 15 minutes
+ // or 1 hour intervals). Refer to
+ // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+ AggInterval param.Field[EmailRoutingTimeseriesGroupARCParamsAggInterval] `query:"aggInterval"`
+ // 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[[]EmailRoutingTimeseriesGroupARCParamsDateRange] `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[[]EmailRoutingTimeseriesGroupARCParamsDKIM] `query:"dkim"`
+ // Filter for dmarc.
+ DMARC param.Field[[]EmailRoutingTimeseriesGroupARCParamsDMARC] `query:"dmarc"`
+ // Filter for encrypted emails.
+ Encrypted param.Field[[]EmailRoutingTimeseriesGroupARCParamsEncrypted] `query:"encrypted"`
+ // Format results are returned in.
+ Format param.Field[EmailRoutingTimeseriesGroupARCParamsFormat] `query:"format"`
+ // Filter for ip version.
+ IPVersion param.Field[[]EmailRoutingTimeseriesGroupARCParamsIPVersion] `query:"ipVersion"`
+ // 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[[]EmailRoutingTimeseriesGroupARCParamsSPF] `query:"spf"`
+}
+
+// URLQuery serializes [EmailRoutingTimeseriesGroupARCParams]'s query parameters as
+// `url.Values`.
+func (r EmailRoutingTimeseriesGroupARCParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Aggregation interval results should be returned in (for example, in 15 minutes
+// or 1 hour intervals). Refer to
+// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+type EmailRoutingTimeseriesGroupARCParamsAggInterval string
+
+const (
+ EmailRoutingTimeseriesGroupARCParamsAggInterval15m EmailRoutingTimeseriesGroupARCParamsAggInterval = "15m"
+ EmailRoutingTimeseriesGroupARCParamsAggInterval1h EmailRoutingTimeseriesGroupARCParamsAggInterval = "1h"
+ EmailRoutingTimeseriesGroupARCParamsAggInterval1d EmailRoutingTimeseriesGroupARCParamsAggInterval = "1d"
+ EmailRoutingTimeseriesGroupARCParamsAggInterval1w EmailRoutingTimeseriesGroupARCParamsAggInterval = "1w"
+)
+
+type EmailRoutingTimeseriesGroupARCParamsDateRange string
+
+const (
+ EmailRoutingTimeseriesGroupARCParamsDateRange1d EmailRoutingTimeseriesGroupARCParamsDateRange = "1d"
+ EmailRoutingTimeseriesGroupARCParamsDateRange2d EmailRoutingTimeseriesGroupARCParamsDateRange = "2d"
+ EmailRoutingTimeseriesGroupARCParamsDateRange7d EmailRoutingTimeseriesGroupARCParamsDateRange = "7d"
+ EmailRoutingTimeseriesGroupARCParamsDateRange14d EmailRoutingTimeseriesGroupARCParamsDateRange = "14d"
+ EmailRoutingTimeseriesGroupARCParamsDateRange28d EmailRoutingTimeseriesGroupARCParamsDateRange = "28d"
+ EmailRoutingTimeseriesGroupARCParamsDateRange12w EmailRoutingTimeseriesGroupARCParamsDateRange = "12w"
+ EmailRoutingTimeseriesGroupARCParamsDateRange24w EmailRoutingTimeseriesGroupARCParamsDateRange = "24w"
+ EmailRoutingTimeseriesGroupARCParamsDateRange52w EmailRoutingTimeseriesGroupARCParamsDateRange = "52w"
+ EmailRoutingTimeseriesGroupARCParamsDateRange1dControl EmailRoutingTimeseriesGroupARCParamsDateRange = "1dControl"
+ EmailRoutingTimeseriesGroupARCParamsDateRange2dControl EmailRoutingTimeseriesGroupARCParamsDateRange = "2dControl"
+ EmailRoutingTimeseriesGroupARCParamsDateRange7dControl EmailRoutingTimeseriesGroupARCParamsDateRange = "7dControl"
+ EmailRoutingTimeseriesGroupARCParamsDateRange14dControl EmailRoutingTimeseriesGroupARCParamsDateRange = "14dControl"
+ EmailRoutingTimeseriesGroupARCParamsDateRange28dControl EmailRoutingTimeseriesGroupARCParamsDateRange = "28dControl"
+ EmailRoutingTimeseriesGroupARCParamsDateRange12wControl EmailRoutingTimeseriesGroupARCParamsDateRange = "12wControl"
+ EmailRoutingTimeseriesGroupARCParamsDateRange24wControl EmailRoutingTimeseriesGroupARCParamsDateRange = "24wControl"
+)
+
+type EmailRoutingTimeseriesGroupARCParamsDKIM string
+
+const (
+ EmailRoutingTimeseriesGroupARCParamsDKIMPass EmailRoutingTimeseriesGroupARCParamsDKIM = "PASS"
+ EmailRoutingTimeseriesGroupARCParamsDKIMNone EmailRoutingTimeseriesGroupARCParamsDKIM = "NONE"
+ EmailRoutingTimeseriesGroupARCParamsDKIMFail EmailRoutingTimeseriesGroupARCParamsDKIM = "FAIL"
+)
+
+type EmailRoutingTimeseriesGroupARCParamsDMARC string
+
+const (
+ EmailRoutingTimeseriesGroupARCParamsDMARCPass EmailRoutingTimeseriesGroupARCParamsDMARC = "PASS"
+ EmailRoutingTimeseriesGroupARCParamsDMARCNone EmailRoutingTimeseriesGroupARCParamsDMARC = "NONE"
+ EmailRoutingTimeseriesGroupARCParamsDMARCFail EmailRoutingTimeseriesGroupARCParamsDMARC = "FAIL"
+)
+
+type EmailRoutingTimeseriesGroupARCParamsEncrypted string
+
+const (
+ EmailRoutingTimeseriesGroupARCParamsEncryptedEncrypted EmailRoutingTimeseriesGroupARCParamsEncrypted = "ENCRYPTED"
+ EmailRoutingTimeseriesGroupARCParamsEncryptedNotEncrypted EmailRoutingTimeseriesGroupARCParamsEncrypted = "NOT_ENCRYPTED"
+)
+
+// Format results are returned in.
+type EmailRoutingTimeseriesGroupARCParamsFormat string
+
+const (
+ EmailRoutingTimeseriesGroupARCParamsFormatJson EmailRoutingTimeseriesGroupARCParamsFormat = "JSON"
+ EmailRoutingTimeseriesGroupARCParamsFormatCsv EmailRoutingTimeseriesGroupARCParamsFormat = "CSV"
+)
+
+type EmailRoutingTimeseriesGroupARCParamsIPVersion string
+
+const (
+ EmailRoutingTimeseriesGroupARCParamsIPVersionIPv4 EmailRoutingTimeseriesGroupARCParamsIPVersion = "IPv4"
+ EmailRoutingTimeseriesGroupARCParamsIPVersionIPv6 EmailRoutingTimeseriesGroupARCParamsIPVersion = "IPv6"
+)
+
+type EmailRoutingTimeseriesGroupARCParamsSPF string
+
+const (
+ EmailRoutingTimeseriesGroupARCParamsSPFPass EmailRoutingTimeseriesGroupARCParamsSPF = "PASS"
+ EmailRoutingTimeseriesGroupARCParamsSPFNone EmailRoutingTimeseriesGroupARCParamsSPF = "NONE"
+ EmailRoutingTimeseriesGroupARCParamsSPFFail EmailRoutingTimeseriesGroupARCParamsSPF = "FAIL"
+)
+
+type EmailRoutingTimeseriesGroupARCResponseEnvelope struct {
+ Result EmailRoutingTimeseriesGroupARCResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON emailRoutingTimeseriesGroupARCResponseEnvelopeJSON `json:"-"`
+}
+
+// emailRoutingTimeseriesGroupARCResponseEnvelopeJSON contains the JSON metadata
+// for the struct [EmailRoutingTimeseriesGroupARCResponseEnvelope]
+type emailRoutingTimeseriesGroupARCResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailRoutingTimeseriesGroupARCResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailRoutingTimeseriesGroupARCResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailRoutingTimeseriesGroupDKIMParams struct {
+ // Aggregation interval results should be returned in (for example, in 15 minutes
+ // or 1 hour intervals). Refer to
+ // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+ AggInterval param.Field[EmailRoutingTimeseriesGroupDKIMParamsAggInterval] `query:"aggInterval"`
+ // Filter for arc (Authenticated Received Chain).
+ ARC param.Field[[]EmailRoutingTimeseriesGroupDKIMParamsARC] `query:"arc"`
+ // 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[[]EmailRoutingTimeseriesGroupDKIMParamsDateRange] `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[[]EmailRoutingTimeseriesGroupDKIMParamsDMARC] `query:"dmarc"`
+ // Filter for encrypted emails.
+ Encrypted param.Field[[]EmailRoutingTimeseriesGroupDKIMParamsEncrypted] `query:"encrypted"`
+ // Format results are returned in.
+ Format param.Field[EmailRoutingTimeseriesGroupDKIMParamsFormat] `query:"format"`
+ // Filter for ip version.
+ IPVersion param.Field[[]EmailRoutingTimeseriesGroupDKIMParamsIPVersion] `query:"ipVersion"`
+ // 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[[]EmailRoutingTimeseriesGroupDKIMParamsSPF] `query:"spf"`
+}
+
+// URLQuery serializes [EmailRoutingTimeseriesGroupDKIMParams]'s query parameters
+// as `url.Values`.
+func (r EmailRoutingTimeseriesGroupDKIMParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Aggregation interval results should be returned in (for example, in 15 minutes
+// or 1 hour intervals). Refer to
+// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+type EmailRoutingTimeseriesGroupDKIMParamsAggInterval string
+
+const (
+ EmailRoutingTimeseriesGroupDKIMParamsAggInterval15m EmailRoutingTimeseriesGroupDKIMParamsAggInterval = "15m"
+ EmailRoutingTimeseriesGroupDKIMParamsAggInterval1h EmailRoutingTimeseriesGroupDKIMParamsAggInterval = "1h"
+ EmailRoutingTimeseriesGroupDKIMParamsAggInterval1d EmailRoutingTimeseriesGroupDKIMParamsAggInterval = "1d"
+ EmailRoutingTimeseriesGroupDKIMParamsAggInterval1w EmailRoutingTimeseriesGroupDKIMParamsAggInterval = "1w"
+)
+
+type EmailRoutingTimeseriesGroupDKIMParamsARC string
+
+const (
+ EmailRoutingTimeseriesGroupDKIMParamsARCPass EmailRoutingTimeseriesGroupDKIMParamsARC = "PASS"
+ EmailRoutingTimeseriesGroupDKIMParamsARCNone EmailRoutingTimeseriesGroupDKIMParamsARC = "NONE"
+ EmailRoutingTimeseriesGroupDKIMParamsARCFail EmailRoutingTimeseriesGroupDKIMParamsARC = "FAIL"
+)
+
+type EmailRoutingTimeseriesGroupDKIMParamsDateRange string
+
+const (
+ EmailRoutingTimeseriesGroupDKIMParamsDateRange1d EmailRoutingTimeseriesGroupDKIMParamsDateRange = "1d"
+ EmailRoutingTimeseriesGroupDKIMParamsDateRange2d EmailRoutingTimeseriesGroupDKIMParamsDateRange = "2d"
+ EmailRoutingTimeseriesGroupDKIMParamsDateRange7d EmailRoutingTimeseriesGroupDKIMParamsDateRange = "7d"
+ EmailRoutingTimeseriesGroupDKIMParamsDateRange14d EmailRoutingTimeseriesGroupDKIMParamsDateRange = "14d"
+ EmailRoutingTimeseriesGroupDKIMParamsDateRange28d EmailRoutingTimeseriesGroupDKIMParamsDateRange = "28d"
+ EmailRoutingTimeseriesGroupDKIMParamsDateRange12w EmailRoutingTimeseriesGroupDKIMParamsDateRange = "12w"
+ EmailRoutingTimeseriesGroupDKIMParamsDateRange24w EmailRoutingTimeseriesGroupDKIMParamsDateRange = "24w"
+ EmailRoutingTimeseriesGroupDKIMParamsDateRange52w EmailRoutingTimeseriesGroupDKIMParamsDateRange = "52w"
+ EmailRoutingTimeseriesGroupDKIMParamsDateRange1dControl EmailRoutingTimeseriesGroupDKIMParamsDateRange = "1dControl"
+ EmailRoutingTimeseriesGroupDKIMParamsDateRange2dControl EmailRoutingTimeseriesGroupDKIMParamsDateRange = "2dControl"
+ EmailRoutingTimeseriesGroupDKIMParamsDateRange7dControl EmailRoutingTimeseriesGroupDKIMParamsDateRange = "7dControl"
+ EmailRoutingTimeseriesGroupDKIMParamsDateRange14dControl EmailRoutingTimeseriesGroupDKIMParamsDateRange = "14dControl"
+ EmailRoutingTimeseriesGroupDKIMParamsDateRange28dControl EmailRoutingTimeseriesGroupDKIMParamsDateRange = "28dControl"
+ EmailRoutingTimeseriesGroupDKIMParamsDateRange12wControl EmailRoutingTimeseriesGroupDKIMParamsDateRange = "12wControl"
+ EmailRoutingTimeseriesGroupDKIMParamsDateRange24wControl EmailRoutingTimeseriesGroupDKIMParamsDateRange = "24wControl"
+)
+
+type EmailRoutingTimeseriesGroupDKIMParamsDMARC string
+
+const (
+ EmailRoutingTimeseriesGroupDKIMParamsDMARCPass EmailRoutingTimeseriesGroupDKIMParamsDMARC = "PASS"
+ EmailRoutingTimeseriesGroupDKIMParamsDMARCNone EmailRoutingTimeseriesGroupDKIMParamsDMARC = "NONE"
+ EmailRoutingTimeseriesGroupDKIMParamsDMARCFail EmailRoutingTimeseriesGroupDKIMParamsDMARC = "FAIL"
+)
+
+type EmailRoutingTimeseriesGroupDKIMParamsEncrypted string
+
+const (
+ EmailRoutingTimeseriesGroupDKIMParamsEncryptedEncrypted EmailRoutingTimeseriesGroupDKIMParamsEncrypted = "ENCRYPTED"
+ EmailRoutingTimeseriesGroupDKIMParamsEncryptedNotEncrypted EmailRoutingTimeseriesGroupDKIMParamsEncrypted = "NOT_ENCRYPTED"
+)
+
+// Format results are returned in.
+type EmailRoutingTimeseriesGroupDKIMParamsFormat string
+
+const (
+ EmailRoutingTimeseriesGroupDKIMParamsFormatJson EmailRoutingTimeseriesGroupDKIMParamsFormat = "JSON"
+ EmailRoutingTimeseriesGroupDKIMParamsFormatCsv EmailRoutingTimeseriesGroupDKIMParamsFormat = "CSV"
+)
+
+type EmailRoutingTimeseriesGroupDKIMParamsIPVersion string
+
+const (
+ EmailRoutingTimeseriesGroupDKIMParamsIPVersionIPv4 EmailRoutingTimeseriesGroupDKIMParamsIPVersion = "IPv4"
+ EmailRoutingTimeseriesGroupDKIMParamsIPVersionIPv6 EmailRoutingTimeseriesGroupDKIMParamsIPVersion = "IPv6"
+)
+
+type EmailRoutingTimeseriesGroupDKIMParamsSPF string
+
+const (
+ EmailRoutingTimeseriesGroupDKIMParamsSPFPass EmailRoutingTimeseriesGroupDKIMParamsSPF = "PASS"
+ EmailRoutingTimeseriesGroupDKIMParamsSPFNone EmailRoutingTimeseriesGroupDKIMParamsSPF = "NONE"
+ EmailRoutingTimeseriesGroupDKIMParamsSPFFail EmailRoutingTimeseriesGroupDKIMParamsSPF = "FAIL"
+)
+
+type EmailRoutingTimeseriesGroupDKIMResponseEnvelope struct {
+ Result EmailRoutingTimeseriesGroupDKIMResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON emailRoutingTimeseriesGroupDKIMResponseEnvelopeJSON `json:"-"`
+}
+
+// emailRoutingTimeseriesGroupDKIMResponseEnvelopeJSON contains the JSON metadata
+// for the struct [EmailRoutingTimeseriesGroupDKIMResponseEnvelope]
+type emailRoutingTimeseriesGroupDKIMResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailRoutingTimeseriesGroupDKIMResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailRoutingTimeseriesGroupDKIMResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailRoutingTimeseriesGroupDMARCParams struct {
+ // Aggregation interval results should be returned in (for example, in 15 minutes
+ // or 1 hour intervals). Refer to
+ // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+ AggInterval param.Field[EmailRoutingTimeseriesGroupDMARCParamsAggInterval] `query:"aggInterval"`
+ // Filter for arc (Authenticated Received Chain).
+ ARC param.Field[[]EmailRoutingTimeseriesGroupDMARCParamsARC] `query:"arc"`
+ // 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[[]EmailRoutingTimeseriesGroupDMARCParamsDateRange] `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[[]EmailRoutingTimeseriesGroupDMARCParamsDKIM] `query:"dkim"`
+ // Filter for encrypted emails.
+ Encrypted param.Field[[]EmailRoutingTimeseriesGroupDMARCParamsEncrypted] `query:"encrypted"`
+ // Format results are returned in.
+ Format param.Field[EmailRoutingTimeseriesGroupDMARCParamsFormat] `query:"format"`
+ // Filter for ip version.
+ IPVersion param.Field[[]EmailRoutingTimeseriesGroupDMARCParamsIPVersion] `query:"ipVersion"`
+ // 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[[]EmailRoutingTimeseriesGroupDMARCParamsSPF] `query:"spf"`
+}
+
+// URLQuery serializes [EmailRoutingTimeseriesGroupDMARCParams]'s query parameters
+// as `url.Values`.
+func (r EmailRoutingTimeseriesGroupDMARCParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Aggregation interval results should be returned in (for example, in 15 minutes
+// or 1 hour intervals). Refer to
+// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+type EmailRoutingTimeseriesGroupDMARCParamsAggInterval string
+
+const (
+ EmailRoutingTimeseriesGroupDMARCParamsAggInterval15m EmailRoutingTimeseriesGroupDMARCParamsAggInterval = "15m"
+ EmailRoutingTimeseriesGroupDMARCParamsAggInterval1h EmailRoutingTimeseriesGroupDMARCParamsAggInterval = "1h"
+ EmailRoutingTimeseriesGroupDMARCParamsAggInterval1d EmailRoutingTimeseriesGroupDMARCParamsAggInterval = "1d"
+ EmailRoutingTimeseriesGroupDMARCParamsAggInterval1w EmailRoutingTimeseriesGroupDMARCParamsAggInterval = "1w"
+)
+
+type EmailRoutingTimeseriesGroupDMARCParamsARC string
+
+const (
+ EmailRoutingTimeseriesGroupDMARCParamsARCPass EmailRoutingTimeseriesGroupDMARCParamsARC = "PASS"
+ EmailRoutingTimeseriesGroupDMARCParamsARCNone EmailRoutingTimeseriesGroupDMARCParamsARC = "NONE"
+ EmailRoutingTimeseriesGroupDMARCParamsARCFail EmailRoutingTimeseriesGroupDMARCParamsARC = "FAIL"
+)
+
+type EmailRoutingTimeseriesGroupDMARCParamsDateRange string
+
+const (
+ EmailRoutingTimeseriesGroupDMARCParamsDateRange1d EmailRoutingTimeseriesGroupDMARCParamsDateRange = "1d"
+ EmailRoutingTimeseriesGroupDMARCParamsDateRange2d EmailRoutingTimeseriesGroupDMARCParamsDateRange = "2d"
+ EmailRoutingTimeseriesGroupDMARCParamsDateRange7d EmailRoutingTimeseriesGroupDMARCParamsDateRange = "7d"
+ EmailRoutingTimeseriesGroupDMARCParamsDateRange14d EmailRoutingTimeseriesGroupDMARCParamsDateRange = "14d"
+ EmailRoutingTimeseriesGroupDMARCParamsDateRange28d EmailRoutingTimeseriesGroupDMARCParamsDateRange = "28d"
+ EmailRoutingTimeseriesGroupDMARCParamsDateRange12w EmailRoutingTimeseriesGroupDMARCParamsDateRange = "12w"
+ EmailRoutingTimeseriesGroupDMARCParamsDateRange24w EmailRoutingTimeseriesGroupDMARCParamsDateRange = "24w"
+ EmailRoutingTimeseriesGroupDMARCParamsDateRange52w EmailRoutingTimeseriesGroupDMARCParamsDateRange = "52w"
+ EmailRoutingTimeseriesGroupDMARCParamsDateRange1dControl EmailRoutingTimeseriesGroupDMARCParamsDateRange = "1dControl"
+ EmailRoutingTimeseriesGroupDMARCParamsDateRange2dControl EmailRoutingTimeseriesGroupDMARCParamsDateRange = "2dControl"
+ EmailRoutingTimeseriesGroupDMARCParamsDateRange7dControl EmailRoutingTimeseriesGroupDMARCParamsDateRange = "7dControl"
+ EmailRoutingTimeseriesGroupDMARCParamsDateRange14dControl EmailRoutingTimeseriesGroupDMARCParamsDateRange = "14dControl"
+ EmailRoutingTimeseriesGroupDMARCParamsDateRange28dControl EmailRoutingTimeseriesGroupDMARCParamsDateRange = "28dControl"
+ EmailRoutingTimeseriesGroupDMARCParamsDateRange12wControl EmailRoutingTimeseriesGroupDMARCParamsDateRange = "12wControl"
+ EmailRoutingTimeseriesGroupDMARCParamsDateRange24wControl EmailRoutingTimeseriesGroupDMARCParamsDateRange = "24wControl"
+)
+
+type EmailRoutingTimeseriesGroupDMARCParamsDKIM string
+
+const (
+ EmailRoutingTimeseriesGroupDMARCParamsDKIMPass EmailRoutingTimeseriesGroupDMARCParamsDKIM = "PASS"
+ EmailRoutingTimeseriesGroupDMARCParamsDKIMNone EmailRoutingTimeseriesGroupDMARCParamsDKIM = "NONE"
+ EmailRoutingTimeseriesGroupDMARCParamsDKIMFail EmailRoutingTimeseriesGroupDMARCParamsDKIM = "FAIL"
+)
+
+type EmailRoutingTimeseriesGroupDMARCParamsEncrypted string
+
+const (
+ EmailRoutingTimeseriesGroupDMARCParamsEncryptedEncrypted EmailRoutingTimeseriesGroupDMARCParamsEncrypted = "ENCRYPTED"
+ EmailRoutingTimeseriesGroupDMARCParamsEncryptedNotEncrypted EmailRoutingTimeseriesGroupDMARCParamsEncrypted = "NOT_ENCRYPTED"
+)
+
+// Format results are returned in.
+type EmailRoutingTimeseriesGroupDMARCParamsFormat string
+
+const (
+ EmailRoutingTimeseriesGroupDMARCParamsFormatJson EmailRoutingTimeseriesGroupDMARCParamsFormat = "JSON"
+ EmailRoutingTimeseriesGroupDMARCParamsFormatCsv EmailRoutingTimeseriesGroupDMARCParamsFormat = "CSV"
+)
+
+type EmailRoutingTimeseriesGroupDMARCParamsIPVersion string
+
+const (
+ EmailRoutingTimeseriesGroupDMARCParamsIPVersionIPv4 EmailRoutingTimeseriesGroupDMARCParamsIPVersion = "IPv4"
+ EmailRoutingTimeseriesGroupDMARCParamsIPVersionIPv6 EmailRoutingTimeseriesGroupDMARCParamsIPVersion = "IPv6"
+)
+
+type EmailRoutingTimeseriesGroupDMARCParamsSPF string
+
+const (
+ EmailRoutingTimeseriesGroupDMARCParamsSPFPass EmailRoutingTimeseriesGroupDMARCParamsSPF = "PASS"
+ EmailRoutingTimeseriesGroupDMARCParamsSPFNone EmailRoutingTimeseriesGroupDMARCParamsSPF = "NONE"
+ EmailRoutingTimeseriesGroupDMARCParamsSPFFail EmailRoutingTimeseriesGroupDMARCParamsSPF = "FAIL"
+)
+
+type EmailRoutingTimeseriesGroupDMARCResponseEnvelope struct {
+ Result EmailRoutingTimeseriesGroupDMARCResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON emailRoutingTimeseriesGroupDMARCResponseEnvelopeJSON `json:"-"`
+}
+
+// emailRoutingTimeseriesGroupDMARCResponseEnvelopeJSON contains the JSON metadata
+// for the struct [EmailRoutingTimeseriesGroupDMARCResponseEnvelope]
+type emailRoutingTimeseriesGroupDMARCResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailRoutingTimeseriesGroupDMARCResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailRoutingTimeseriesGroupDMARCResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailRoutingTimeseriesGroupEncryptedParams struct {
+ // Aggregation interval results should be returned in (for example, in 15 minutes
+ // or 1 hour intervals). Refer to
+ // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+ AggInterval param.Field[EmailRoutingTimeseriesGroupEncryptedParamsAggInterval] `query:"aggInterval"`
+ // Filter for arc (Authenticated Received Chain).
+ ARC param.Field[[]EmailRoutingTimeseriesGroupEncryptedParamsARC] `query:"arc"`
+ // 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[[]EmailRoutingTimeseriesGroupEncryptedParamsDateRange] `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[[]EmailRoutingTimeseriesGroupEncryptedParamsDKIM] `query:"dkim"`
+ // Filter for dmarc.
+ DMARC param.Field[[]EmailRoutingTimeseriesGroupEncryptedParamsDMARC] `query:"dmarc"`
+ // Format results are returned in.
+ Format param.Field[EmailRoutingTimeseriesGroupEncryptedParamsFormat] `query:"format"`
+ // Filter for ip version.
+ IPVersion param.Field[[]EmailRoutingTimeseriesGroupEncryptedParamsIPVersion] `query:"ipVersion"`
+ // 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[[]EmailRoutingTimeseriesGroupEncryptedParamsSPF] `query:"spf"`
+}
+
+// URLQuery serializes [EmailRoutingTimeseriesGroupEncryptedParams]'s query
+// parameters as `url.Values`.
+func (r EmailRoutingTimeseriesGroupEncryptedParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Aggregation interval results should be returned in (for example, in 15 minutes
+// or 1 hour intervals). Refer to
+// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+type EmailRoutingTimeseriesGroupEncryptedParamsAggInterval string
+
+const (
+ EmailRoutingTimeseriesGroupEncryptedParamsAggInterval15m EmailRoutingTimeseriesGroupEncryptedParamsAggInterval = "15m"
+ EmailRoutingTimeseriesGroupEncryptedParamsAggInterval1h EmailRoutingTimeseriesGroupEncryptedParamsAggInterval = "1h"
+ EmailRoutingTimeseriesGroupEncryptedParamsAggInterval1d EmailRoutingTimeseriesGroupEncryptedParamsAggInterval = "1d"
+ EmailRoutingTimeseriesGroupEncryptedParamsAggInterval1w EmailRoutingTimeseriesGroupEncryptedParamsAggInterval = "1w"
+)
+
+type EmailRoutingTimeseriesGroupEncryptedParamsARC string
+
+const (
+ EmailRoutingTimeseriesGroupEncryptedParamsARCPass EmailRoutingTimeseriesGroupEncryptedParamsARC = "PASS"
+ EmailRoutingTimeseriesGroupEncryptedParamsARCNone EmailRoutingTimeseriesGroupEncryptedParamsARC = "NONE"
+ EmailRoutingTimeseriesGroupEncryptedParamsARCFail EmailRoutingTimeseriesGroupEncryptedParamsARC = "FAIL"
+)
+
+type EmailRoutingTimeseriesGroupEncryptedParamsDateRange string
+
+const (
+ EmailRoutingTimeseriesGroupEncryptedParamsDateRange1d EmailRoutingTimeseriesGroupEncryptedParamsDateRange = "1d"
+ EmailRoutingTimeseriesGroupEncryptedParamsDateRange2d EmailRoutingTimeseriesGroupEncryptedParamsDateRange = "2d"
+ EmailRoutingTimeseriesGroupEncryptedParamsDateRange7d EmailRoutingTimeseriesGroupEncryptedParamsDateRange = "7d"
+ EmailRoutingTimeseriesGroupEncryptedParamsDateRange14d EmailRoutingTimeseriesGroupEncryptedParamsDateRange = "14d"
+ EmailRoutingTimeseriesGroupEncryptedParamsDateRange28d EmailRoutingTimeseriesGroupEncryptedParamsDateRange = "28d"
+ EmailRoutingTimeseriesGroupEncryptedParamsDateRange12w EmailRoutingTimeseriesGroupEncryptedParamsDateRange = "12w"
+ EmailRoutingTimeseriesGroupEncryptedParamsDateRange24w EmailRoutingTimeseriesGroupEncryptedParamsDateRange = "24w"
+ EmailRoutingTimeseriesGroupEncryptedParamsDateRange52w EmailRoutingTimeseriesGroupEncryptedParamsDateRange = "52w"
+ EmailRoutingTimeseriesGroupEncryptedParamsDateRange1dControl EmailRoutingTimeseriesGroupEncryptedParamsDateRange = "1dControl"
+ EmailRoutingTimeseriesGroupEncryptedParamsDateRange2dControl EmailRoutingTimeseriesGroupEncryptedParamsDateRange = "2dControl"
+ EmailRoutingTimeseriesGroupEncryptedParamsDateRange7dControl EmailRoutingTimeseriesGroupEncryptedParamsDateRange = "7dControl"
+ EmailRoutingTimeseriesGroupEncryptedParamsDateRange14dControl EmailRoutingTimeseriesGroupEncryptedParamsDateRange = "14dControl"
+ EmailRoutingTimeseriesGroupEncryptedParamsDateRange28dControl EmailRoutingTimeseriesGroupEncryptedParamsDateRange = "28dControl"
+ EmailRoutingTimeseriesGroupEncryptedParamsDateRange12wControl EmailRoutingTimeseriesGroupEncryptedParamsDateRange = "12wControl"
+ EmailRoutingTimeseriesGroupEncryptedParamsDateRange24wControl EmailRoutingTimeseriesGroupEncryptedParamsDateRange = "24wControl"
+)
+
+type EmailRoutingTimeseriesGroupEncryptedParamsDKIM string
+
+const (
+ EmailRoutingTimeseriesGroupEncryptedParamsDKIMPass EmailRoutingTimeseriesGroupEncryptedParamsDKIM = "PASS"
+ EmailRoutingTimeseriesGroupEncryptedParamsDKIMNone EmailRoutingTimeseriesGroupEncryptedParamsDKIM = "NONE"
+ EmailRoutingTimeseriesGroupEncryptedParamsDKIMFail EmailRoutingTimeseriesGroupEncryptedParamsDKIM = "FAIL"
+)
+
+type EmailRoutingTimeseriesGroupEncryptedParamsDMARC string
+
+const (
+ EmailRoutingTimeseriesGroupEncryptedParamsDMARCPass EmailRoutingTimeseriesGroupEncryptedParamsDMARC = "PASS"
+ EmailRoutingTimeseriesGroupEncryptedParamsDMARCNone EmailRoutingTimeseriesGroupEncryptedParamsDMARC = "NONE"
+ EmailRoutingTimeseriesGroupEncryptedParamsDMARCFail EmailRoutingTimeseriesGroupEncryptedParamsDMARC = "FAIL"
+)
+
+// Format results are returned in.
+type EmailRoutingTimeseriesGroupEncryptedParamsFormat string
+
+const (
+ EmailRoutingTimeseriesGroupEncryptedParamsFormatJson EmailRoutingTimeseriesGroupEncryptedParamsFormat = "JSON"
+ EmailRoutingTimeseriesGroupEncryptedParamsFormatCsv EmailRoutingTimeseriesGroupEncryptedParamsFormat = "CSV"
+)
+
+type EmailRoutingTimeseriesGroupEncryptedParamsIPVersion string
+
+const (
+ EmailRoutingTimeseriesGroupEncryptedParamsIPVersionIPv4 EmailRoutingTimeseriesGroupEncryptedParamsIPVersion = "IPv4"
+ EmailRoutingTimeseriesGroupEncryptedParamsIPVersionIPv6 EmailRoutingTimeseriesGroupEncryptedParamsIPVersion = "IPv6"
+)
+
+type EmailRoutingTimeseriesGroupEncryptedParamsSPF string
+
+const (
+ EmailRoutingTimeseriesGroupEncryptedParamsSPFPass EmailRoutingTimeseriesGroupEncryptedParamsSPF = "PASS"
+ EmailRoutingTimeseriesGroupEncryptedParamsSPFNone EmailRoutingTimeseriesGroupEncryptedParamsSPF = "NONE"
+ EmailRoutingTimeseriesGroupEncryptedParamsSPFFail EmailRoutingTimeseriesGroupEncryptedParamsSPF = "FAIL"
+)
+
+type EmailRoutingTimeseriesGroupEncryptedResponseEnvelope struct {
+ Result EmailRoutingTimeseriesGroupEncryptedResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON emailRoutingTimeseriesGroupEncryptedResponseEnvelopeJSON `json:"-"`
+}
+
+// emailRoutingTimeseriesGroupEncryptedResponseEnvelopeJSON contains the JSON
+// metadata for the struct [EmailRoutingTimeseriesGroupEncryptedResponseEnvelope]
+type emailRoutingTimeseriesGroupEncryptedResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailRoutingTimeseriesGroupEncryptedResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailRoutingTimeseriesGroupEncryptedResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailRoutingTimeseriesGroupIPVersionParams struct {
+ // Aggregation interval results should be returned in (for example, in 15 minutes
+ // or 1 hour intervals). Refer to
+ // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+ AggInterval param.Field[EmailRoutingTimeseriesGroupIPVersionParamsAggInterval] `query:"aggInterval"`
+ // Filter for arc (Authenticated Received Chain).
+ ARC param.Field[[]EmailRoutingTimeseriesGroupIPVersionParamsARC] `query:"arc"`
+ // 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[[]EmailRoutingTimeseriesGroupIPVersionParamsDateRange] `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[[]EmailRoutingTimeseriesGroupIPVersionParamsDKIM] `query:"dkim"`
+ // Filter for dmarc.
+ DMARC param.Field[[]EmailRoutingTimeseriesGroupIPVersionParamsDMARC] `query:"dmarc"`
+ // Filter for encrypted emails.
+ Encrypted param.Field[[]EmailRoutingTimeseriesGroupIPVersionParamsEncrypted] `query:"encrypted"`
+ // Format results are returned in.
+ Format param.Field[EmailRoutingTimeseriesGroupIPVersionParamsFormat] `query:"format"`
+ // 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[[]EmailRoutingTimeseriesGroupIPVersionParamsSPF] `query:"spf"`
+}
+
+// URLQuery serializes [EmailRoutingTimeseriesGroupIPVersionParams]'s query
+// parameters as `url.Values`.
+func (r EmailRoutingTimeseriesGroupIPVersionParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Aggregation interval results should be returned in (for example, in 15 minutes
+// or 1 hour intervals). Refer to
+// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+type EmailRoutingTimeseriesGroupIPVersionParamsAggInterval string
+
+const (
+ EmailRoutingTimeseriesGroupIPVersionParamsAggInterval15m EmailRoutingTimeseriesGroupIPVersionParamsAggInterval = "15m"
+ EmailRoutingTimeseriesGroupIPVersionParamsAggInterval1h EmailRoutingTimeseriesGroupIPVersionParamsAggInterval = "1h"
+ EmailRoutingTimeseriesGroupIPVersionParamsAggInterval1d EmailRoutingTimeseriesGroupIPVersionParamsAggInterval = "1d"
+ EmailRoutingTimeseriesGroupIPVersionParamsAggInterval1w EmailRoutingTimeseriesGroupIPVersionParamsAggInterval = "1w"
+)
+
+type EmailRoutingTimeseriesGroupIPVersionParamsARC string
+
+const (
+ EmailRoutingTimeseriesGroupIPVersionParamsARCPass EmailRoutingTimeseriesGroupIPVersionParamsARC = "PASS"
+ EmailRoutingTimeseriesGroupIPVersionParamsARCNone EmailRoutingTimeseriesGroupIPVersionParamsARC = "NONE"
+ EmailRoutingTimeseriesGroupIPVersionParamsARCFail EmailRoutingTimeseriesGroupIPVersionParamsARC = "FAIL"
+)
+
+type EmailRoutingTimeseriesGroupIPVersionParamsDateRange string
+
+const (
+ EmailRoutingTimeseriesGroupIPVersionParamsDateRange1d EmailRoutingTimeseriesGroupIPVersionParamsDateRange = "1d"
+ EmailRoutingTimeseriesGroupIPVersionParamsDateRange2d EmailRoutingTimeseriesGroupIPVersionParamsDateRange = "2d"
+ EmailRoutingTimeseriesGroupIPVersionParamsDateRange7d EmailRoutingTimeseriesGroupIPVersionParamsDateRange = "7d"
+ EmailRoutingTimeseriesGroupIPVersionParamsDateRange14d EmailRoutingTimeseriesGroupIPVersionParamsDateRange = "14d"
+ EmailRoutingTimeseriesGroupIPVersionParamsDateRange28d EmailRoutingTimeseriesGroupIPVersionParamsDateRange = "28d"
+ EmailRoutingTimeseriesGroupIPVersionParamsDateRange12w EmailRoutingTimeseriesGroupIPVersionParamsDateRange = "12w"
+ EmailRoutingTimeseriesGroupIPVersionParamsDateRange24w EmailRoutingTimeseriesGroupIPVersionParamsDateRange = "24w"
+ EmailRoutingTimeseriesGroupIPVersionParamsDateRange52w EmailRoutingTimeseriesGroupIPVersionParamsDateRange = "52w"
+ EmailRoutingTimeseriesGroupIPVersionParamsDateRange1dControl EmailRoutingTimeseriesGroupIPVersionParamsDateRange = "1dControl"
+ EmailRoutingTimeseriesGroupIPVersionParamsDateRange2dControl EmailRoutingTimeseriesGroupIPVersionParamsDateRange = "2dControl"
+ EmailRoutingTimeseriesGroupIPVersionParamsDateRange7dControl EmailRoutingTimeseriesGroupIPVersionParamsDateRange = "7dControl"
+ EmailRoutingTimeseriesGroupIPVersionParamsDateRange14dControl EmailRoutingTimeseriesGroupIPVersionParamsDateRange = "14dControl"
+ EmailRoutingTimeseriesGroupIPVersionParamsDateRange28dControl EmailRoutingTimeseriesGroupIPVersionParamsDateRange = "28dControl"
+ EmailRoutingTimeseriesGroupIPVersionParamsDateRange12wControl EmailRoutingTimeseriesGroupIPVersionParamsDateRange = "12wControl"
+ EmailRoutingTimeseriesGroupIPVersionParamsDateRange24wControl EmailRoutingTimeseriesGroupIPVersionParamsDateRange = "24wControl"
+)
+
+type EmailRoutingTimeseriesGroupIPVersionParamsDKIM string
+
+const (
+ EmailRoutingTimeseriesGroupIPVersionParamsDKIMPass EmailRoutingTimeseriesGroupIPVersionParamsDKIM = "PASS"
+ EmailRoutingTimeseriesGroupIPVersionParamsDKIMNone EmailRoutingTimeseriesGroupIPVersionParamsDKIM = "NONE"
+ EmailRoutingTimeseriesGroupIPVersionParamsDKIMFail EmailRoutingTimeseriesGroupIPVersionParamsDKIM = "FAIL"
+)
+
+type EmailRoutingTimeseriesGroupIPVersionParamsDMARC string
+
+const (
+ EmailRoutingTimeseriesGroupIPVersionParamsDMARCPass EmailRoutingTimeseriesGroupIPVersionParamsDMARC = "PASS"
+ EmailRoutingTimeseriesGroupIPVersionParamsDMARCNone EmailRoutingTimeseriesGroupIPVersionParamsDMARC = "NONE"
+ EmailRoutingTimeseriesGroupIPVersionParamsDMARCFail EmailRoutingTimeseriesGroupIPVersionParamsDMARC = "FAIL"
+)
+
+type EmailRoutingTimeseriesGroupIPVersionParamsEncrypted string
+
+const (
+ EmailRoutingTimeseriesGroupIPVersionParamsEncryptedEncrypted EmailRoutingTimeseriesGroupIPVersionParamsEncrypted = "ENCRYPTED"
+ EmailRoutingTimeseriesGroupIPVersionParamsEncryptedNotEncrypted EmailRoutingTimeseriesGroupIPVersionParamsEncrypted = "NOT_ENCRYPTED"
+)
+
+// Format results are returned in.
+type EmailRoutingTimeseriesGroupIPVersionParamsFormat string
+
+const (
+ EmailRoutingTimeseriesGroupIPVersionParamsFormatJson EmailRoutingTimeseriesGroupIPVersionParamsFormat = "JSON"
+ EmailRoutingTimeseriesGroupIPVersionParamsFormatCsv EmailRoutingTimeseriesGroupIPVersionParamsFormat = "CSV"
+)
+
+type EmailRoutingTimeseriesGroupIPVersionParamsSPF string
+
+const (
+ EmailRoutingTimeseriesGroupIPVersionParamsSPFPass EmailRoutingTimeseriesGroupIPVersionParamsSPF = "PASS"
+ EmailRoutingTimeseriesGroupIPVersionParamsSPFNone EmailRoutingTimeseriesGroupIPVersionParamsSPF = "NONE"
+ EmailRoutingTimeseriesGroupIPVersionParamsSPFFail EmailRoutingTimeseriesGroupIPVersionParamsSPF = "FAIL"
+)
+
+type EmailRoutingTimeseriesGroupIPVersionResponseEnvelope struct {
+ Result EmailRoutingTimeseriesGroupIPVersionResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON emailRoutingTimeseriesGroupIPVersionResponseEnvelopeJSON `json:"-"`
+}
+
+// emailRoutingTimeseriesGroupIPVersionResponseEnvelopeJSON contains the JSON
+// metadata for the struct [EmailRoutingTimeseriesGroupIPVersionResponseEnvelope]
+type emailRoutingTimeseriesGroupIPVersionResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailRoutingTimeseriesGroupIPVersionResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailRoutingTimeseriesGroupIPVersionResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailRoutingTimeseriesGroupSPFParams struct {
+ // Aggregation interval results should be returned in (for example, in 15 minutes
+ // or 1 hour intervals). Refer to
+ // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+ AggInterval param.Field[EmailRoutingTimeseriesGroupSPFParamsAggInterval] `query:"aggInterval"`
+ // Filter for arc (Authenticated Received Chain).
+ ARC param.Field[[]EmailRoutingTimeseriesGroupSPFParamsARC] `query:"arc"`
+ // 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[[]EmailRoutingTimeseriesGroupSPFParamsDateRange] `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[[]EmailRoutingTimeseriesGroupSPFParamsDKIM] `query:"dkim"`
+ // Filter for dmarc.
+ DMARC param.Field[[]EmailRoutingTimeseriesGroupSPFParamsDMARC] `query:"dmarc"`
+ // Filter for encrypted emails.
+ Encrypted param.Field[[]EmailRoutingTimeseriesGroupSPFParamsEncrypted] `query:"encrypted"`
+ // Format results are returned in.
+ Format param.Field[EmailRoutingTimeseriesGroupSPFParamsFormat] `query:"format"`
+ // Filter for ip version.
+ IPVersion param.Field[[]EmailRoutingTimeseriesGroupSPFParamsIPVersion] `query:"ipVersion"`
+ // Array of names that will be used to name the series in responses.
+ Name param.Field[[]string] `query:"name"`
+}
+
+// URLQuery serializes [EmailRoutingTimeseriesGroupSPFParams]'s query parameters as
+// `url.Values`.
+func (r EmailRoutingTimeseriesGroupSPFParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Aggregation interval results should be returned in (for example, in 15 minutes
+// or 1 hour intervals). Refer to
+// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+type EmailRoutingTimeseriesGroupSPFParamsAggInterval string
+
+const (
+ EmailRoutingTimeseriesGroupSPFParamsAggInterval15m EmailRoutingTimeseriesGroupSPFParamsAggInterval = "15m"
+ EmailRoutingTimeseriesGroupSPFParamsAggInterval1h EmailRoutingTimeseriesGroupSPFParamsAggInterval = "1h"
+ EmailRoutingTimeseriesGroupSPFParamsAggInterval1d EmailRoutingTimeseriesGroupSPFParamsAggInterval = "1d"
+ EmailRoutingTimeseriesGroupSPFParamsAggInterval1w EmailRoutingTimeseriesGroupSPFParamsAggInterval = "1w"
+)
+
+type EmailRoutingTimeseriesGroupSPFParamsARC string
+
+const (
+ EmailRoutingTimeseriesGroupSPFParamsARCPass EmailRoutingTimeseriesGroupSPFParamsARC = "PASS"
+ EmailRoutingTimeseriesGroupSPFParamsARCNone EmailRoutingTimeseriesGroupSPFParamsARC = "NONE"
+ EmailRoutingTimeseriesGroupSPFParamsARCFail EmailRoutingTimeseriesGroupSPFParamsARC = "FAIL"
+)
+
+type EmailRoutingTimeseriesGroupSPFParamsDateRange string
+
+const (
+ EmailRoutingTimeseriesGroupSPFParamsDateRange1d EmailRoutingTimeseriesGroupSPFParamsDateRange = "1d"
+ EmailRoutingTimeseriesGroupSPFParamsDateRange2d EmailRoutingTimeseriesGroupSPFParamsDateRange = "2d"
+ EmailRoutingTimeseriesGroupSPFParamsDateRange7d EmailRoutingTimeseriesGroupSPFParamsDateRange = "7d"
+ EmailRoutingTimeseriesGroupSPFParamsDateRange14d EmailRoutingTimeseriesGroupSPFParamsDateRange = "14d"
+ EmailRoutingTimeseriesGroupSPFParamsDateRange28d EmailRoutingTimeseriesGroupSPFParamsDateRange = "28d"
+ EmailRoutingTimeseriesGroupSPFParamsDateRange12w EmailRoutingTimeseriesGroupSPFParamsDateRange = "12w"
+ EmailRoutingTimeseriesGroupSPFParamsDateRange24w EmailRoutingTimeseriesGroupSPFParamsDateRange = "24w"
+ EmailRoutingTimeseriesGroupSPFParamsDateRange52w EmailRoutingTimeseriesGroupSPFParamsDateRange = "52w"
+ EmailRoutingTimeseriesGroupSPFParamsDateRange1dControl EmailRoutingTimeseriesGroupSPFParamsDateRange = "1dControl"
+ EmailRoutingTimeseriesGroupSPFParamsDateRange2dControl EmailRoutingTimeseriesGroupSPFParamsDateRange = "2dControl"
+ EmailRoutingTimeseriesGroupSPFParamsDateRange7dControl EmailRoutingTimeseriesGroupSPFParamsDateRange = "7dControl"
+ EmailRoutingTimeseriesGroupSPFParamsDateRange14dControl EmailRoutingTimeseriesGroupSPFParamsDateRange = "14dControl"
+ EmailRoutingTimeseriesGroupSPFParamsDateRange28dControl EmailRoutingTimeseriesGroupSPFParamsDateRange = "28dControl"
+ EmailRoutingTimeseriesGroupSPFParamsDateRange12wControl EmailRoutingTimeseriesGroupSPFParamsDateRange = "12wControl"
+ EmailRoutingTimeseriesGroupSPFParamsDateRange24wControl EmailRoutingTimeseriesGroupSPFParamsDateRange = "24wControl"
+)
+
+type EmailRoutingTimeseriesGroupSPFParamsDKIM string
+
+const (
+ EmailRoutingTimeseriesGroupSPFParamsDKIMPass EmailRoutingTimeseriesGroupSPFParamsDKIM = "PASS"
+ EmailRoutingTimeseriesGroupSPFParamsDKIMNone EmailRoutingTimeseriesGroupSPFParamsDKIM = "NONE"
+ EmailRoutingTimeseriesGroupSPFParamsDKIMFail EmailRoutingTimeseriesGroupSPFParamsDKIM = "FAIL"
+)
+
+type EmailRoutingTimeseriesGroupSPFParamsDMARC string
+
+const (
+ EmailRoutingTimeseriesGroupSPFParamsDMARCPass EmailRoutingTimeseriesGroupSPFParamsDMARC = "PASS"
+ EmailRoutingTimeseriesGroupSPFParamsDMARCNone EmailRoutingTimeseriesGroupSPFParamsDMARC = "NONE"
+ EmailRoutingTimeseriesGroupSPFParamsDMARCFail EmailRoutingTimeseriesGroupSPFParamsDMARC = "FAIL"
+)
+
+type EmailRoutingTimeseriesGroupSPFParamsEncrypted string
+
+const (
+ EmailRoutingTimeseriesGroupSPFParamsEncryptedEncrypted EmailRoutingTimeseriesGroupSPFParamsEncrypted = "ENCRYPTED"
+ EmailRoutingTimeseriesGroupSPFParamsEncryptedNotEncrypted EmailRoutingTimeseriesGroupSPFParamsEncrypted = "NOT_ENCRYPTED"
+)
+
+// Format results are returned in.
+type EmailRoutingTimeseriesGroupSPFParamsFormat string
+
+const (
+ EmailRoutingTimeseriesGroupSPFParamsFormatJson EmailRoutingTimeseriesGroupSPFParamsFormat = "JSON"
+ EmailRoutingTimeseriesGroupSPFParamsFormatCsv EmailRoutingTimeseriesGroupSPFParamsFormat = "CSV"
+)
+
+type EmailRoutingTimeseriesGroupSPFParamsIPVersion string
+
+const (
+ EmailRoutingTimeseriesGroupSPFParamsIPVersionIPv4 EmailRoutingTimeseriesGroupSPFParamsIPVersion = "IPv4"
+ EmailRoutingTimeseriesGroupSPFParamsIPVersionIPv6 EmailRoutingTimeseriesGroupSPFParamsIPVersion = "IPv6"
+)
+
+type EmailRoutingTimeseriesGroupSPFResponseEnvelope struct {
+ Result EmailRoutingTimeseriesGroupSPFResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON emailRoutingTimeseriesGroupSPFResponseEnvelopeJSON `json:"-"`
+}
+
+// emailRoutingTimeseriesGroupSPFResponseEnvelopeJSON contains the JSON metadata
+// for the struct [EmailRoutingTimeseriesGroupSPFResponseEnvelope]
+type emailRoutingTimeseriesGroupSPFResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailRoutingTimeseriesGroupSPFResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailRoutingTimeseriesGroupSPFResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/radar/emailroutingtimeseriesgroup_test.go b/radar/emailroutingtimeseriesgroup_test.go
new file mode 100644
index 00000000000..c40c608b321
--- /dev/null
+++ b/radar/emailroutingtimeseriesgroup_test.go
@@ -0,0 +1,232 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/radar"
+)
+
+func TestEmailRoutingTimeseriesGroupARCWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Email.Routing.TimeseriesGroups.ARC(context.TODO(), radar.EmailRoutingTimeseriesGroupARCParams{
+ AggInterval: cloudflare.F(radar.EmailRoutingTimeseriesGroupARCParamsAggInterval1h),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.EmailRoutingTimeseriesGroupARCParamsDateRange{radar.EmailRoutingTimeseriesGroupARCParamsDateRange1d, radar.EmailRoutingTimeseriesGroupARCParamsDateRange2d, radar.EmailRoutingTimeseriesGroupARCParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DKIM: cloudflare.F([]radar.EmailRoutingTimeseriesGroupARCParamsDKIM{radar.EmailRoutingTimeseriesGroupARCParamsDKIMPass, radar.EmailRoutingTimeseriesGroupARCParamsDKIMNone, radar.EmailRoutingTimeseriesGroupARCParamsDKIMFail}),
+ DMARC: cloudflare.F([]radar.EmailRoutingTimeseriesGroupARCParamsDMARC{radar.EmailRoutingTimeseriesGroupARCParamsDMARCPass, radar.EmailRoutingTimeseriesGroupARCParamsDMARCNone, radar.EmailRoutingTimeseriesGroupARCParamsDMARCFail}),
+ Encrypted: cloudflare.F([]radar.EmailRoutingTimeseriesGroupARCParamsEncrypted{radar.EmailRoutingTimeseriesGroupARCParamsEncryptedEncrypted, radar.EmailRoutingTimeseriesGroupARCParamsEncryptedNotEncrypted}),
+ Format: cloudflare.F(radar.EmailRoutingTimeseriesGroupARCParamsFormatJson),
+ IPVersion: cloudflare.F([]radar.EmailRoutingTimeseriesGroupARCParamsIPVersion{radar.EmailRoutingTimeseriesGroupARCParamsIPVersionIPv4, radar.EmailRoutingTimeseriesGroupARCParamsIPVersionIPv6}),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ SPF: cloudflare.F([]radar.EmailRoutingTimeseriesGroupARCParamsSPF{radar.EmailRoutingTimeseriesGroupARCParamsSPFPass, radar.EmailRoutingTimeseriesGroupARCParamsSPFNone, radar.EmailRoutingTimeseriesGroupARCParamsSPFFail}),
+ })
+ 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())
+ }
+}
+
+func TestEmailRoutingTimeseriesGroupDKIMWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Email.Routing.TimeseriesGroups.DKIM(context.TODO(), radar.EmailRoutingTimeseriesGroupDKIMParams{
+ AggInterval: cloudflare.F(radar.EmailRoutingTimeseriesGroupDKIMParamsAggInterval1h),
+ ARC: cloudflare.F([]radar.EmailRoutingTimeseriesGroupDKIMParamsARC{radar.EmailRoutingTimeseriesGroupDKIMParamsARCPass, radar.EmailRoutingTimeseriesGroupDKIMParamsARCNone, radar.EmailRoutingTimeseriesGroupDKIMParamsARCFail}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.EmailRoutingTimeseriesGroupDKIMParamsDateRange{radar.EmailRoutingTimeseriesGroupDKIMParamsDateRange1d, radar.EmailRoutingTimeseriesGroupDKIMParamsDateRange2d, radar.EmailRoutingTimeseriesGroupDKIMParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DMARC: cloudflare.F([]radar.EmailRoutingTimeseriesGroupDKIMParamsDMARC{radar.EmailRoutingTimeseriesGroupDKIMParamsDMARCPass, radar.EmailRoutingTimeseriesGroupDKIMParamsDMARCNone, radar.EmailRoutingTimeseriesGroupDKIMParamsDMARCFail}),
+ Encrypted: cloudflare.F([]radar.EmailRoutingTimeseriesGroupDKIMParamsEncrypted{radar.EmailRoutingTimeseriesGroupDKIMParamsEncryptedEncrypted, radar.EmailRoutingTimeseriesGroupDKIMParamsEncryptedNotEncrypted}),
+ Format: cloudflare.F(radar.EmailRoutingTimeseriesGroupDKIMParamsFormatJson),
+ IPVersion: cloudflare.F([]radar.EmailRoutingTimeseriesGroupDKIMParamsIPVersion{radar.EmailRoutingTimeseriesGroupDKIMParamsIPVersionIPv4, radar.EmailRoutingTimeseriesGroupDKIMParamsIPVersionIPv6}),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ SPF: cloudflare.F([]radar.EmailRoutingTimeseriesGroupDKIMParamsSPF{radar.EmailRoutingTimeseriesGroupDKIMParamsSPFPass, radar.EmailRoutingTimeseriesGroupDKIMParamsSPFNone, radar.EmailRoutingTimeseriesGroupDKIMParamsSPFFail}),
+ })
+ 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())
+ }
+}
+
+func TestEmailRoutingTimeseriesGroupDMARCWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Email.Routing.TimeseriesGroups.DMARC(context.TODO(), radar.EmailRoutingTimeseriesGroupDMARCParams{
+ AggInterval: cloudflare.F(radar.EmailRoutingTimeseriesGroupDMARCParamsAggInterval1h),
+ ARC: cloudflare.F([]radar.EmailRoutingTimeseriesGroupDMARCParamsARC{radar.EmailRoutingTimeseriesGroupDMARCParamsARCPass, radar.EmailRoutingTimeseriesGroupDMARCParamsARCNone, radar.EmailRoutingTimeseriesGroupDMARCParamsARCFail}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.EmailRoutingTimeseriesGroupDMARCParamsDateRange{radar.EmailRoutingTimeseriesGroupDMARCParamsDateRange1d, radar.EmailRoutingTimeseriesGroupDMARCParamsDateRange2d, radar.EmailRoutingTimeseriesGroupDMARCParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DKIM: cloudflare.F([]radar.EmailRoutingTimeseriesGroupDMARCParamsDKIM{radar.EmailRoutingTimeseriesGroupDMARCParamsDKIMPass, radar.EmailRoutingTimeseriesGroupDMARCParamsDKIMNone, radar.EmailRoutingTimeseriesGroupDMARCParamsDKIMFail}),
+ Encrypted: cloudflare.F([]radar.EmailRoutingTimeseriesGroupDMARCParamsEncrypted{radar.EmailRoutingTimeseriesGroupDMARCParamsEncryptedEncrypted, radar.EmailRoutingTimeseriesGroupDMARCParamsEncryptedNotEncrypted}),
+ Format: cloudflare.F(radar.EmailRoutingTimeseriesGroupDMARCParamsFormatJson),
+ IPVersion: cloudflare.F([]radar.EmailRoutingTimeseriesGroupDMARCParamsIPVersion{radar.EmailRoutingTimeseriesGroupDMARCParamsIPVersionIPv4, radar.EmailRoutingTimeseriesGroupDMARCParamsIPVersionIPv6}),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ SPF: cloudflare.F([]radar.EmailRoutingTimeseriesGroupDMARCParamsSPF{radar.EmailRoutingTimeseriesGroupDMARCParamsSPFPass, radar.EmailRoutingTimeseriesGroupDMARCParamsSPFNone, radar.EmailRoutingTimeseriesGroupDMARCParamsSPFFail}),
+ })
+ 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())
+ }
+}
+
+func TestEmailRoutingTimeseriesGroupEncryptedWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Email.Routing.TimeseriesGroups.Encrypted(context.TODO(), radar.EmailRoutingTimeseriesGroupEncryptedParams{
+ AggInterval: cloudflare.F(radar.EmailRoutingTimeseriesGroupEncryptedParamsAggInterval1h),
+ ARC: cloudflare.F([]radar.EmailRoutingTimeseriesGroupEncryptedParamsARC{radar.EmailRoutingTimeseriesGroupEncryptedParamsARCPass, radar.EmailRoutingTimeseriesGroupEncryptedParamsARCNone, radar.EmailRoutingTimeseriesGroupEncryptedParamsARCFail}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.EmailRoutingTimeseriesGroupEncryptedParamsDateRange{radar.EmailRoutingTimeseriesGroupEncryptedParamsDateRange1d, radar.EmailRoutingTimeseriesGroupEncryptedParamsDateRange2d, radar.EmailRoutingTimeseriesGroupEncryptedParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DKIM: cloudflare.F([]radar.EmailRoutingTimeseriesGroupEncryptedParamsDKIM{radar.EmailRoutingTimeseriesGroupEncryptedParamsDKIMPass, radar.EmailRoutingTimeseriesGroupEncryptedParamsDKIMNone, radar.EmailRoutingTimeseriesGroupEncryptedParamsDKIMFail}),
+ DMARC: cloudflare.F([]radar.EmailRoutingTimeseriesGroupEncryptedParamsDMARC{radar.EmailRoutingTimeseriesGroupEncryptedParamsDMARCPass, radar.EmailRoutingTimeseriesGroupEncryptedParamsDMARCNone, radar.EmailRoutingTimeseriesGroupEncryptedParamsDMARCFail}),
+ Format: cloudflare.F(radar.EmailRoutingTimeseriesGroupEncryptedParamsFormatJson),
+ IPVersion: cloudflare.F([]radar.EmailRoutingTimeseriesGroupEncryptedParamsIPVersion{radar.EmailRoutingTimeseriesGroupEncryptedParamsIPVersionIPv4, radar.EmailRoutingTimeseriesGroupEncryptedParamsIPVersionIPv6}),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ SPF: cloudflare.F([]radar.EmailRoutingTimeseriesGroupEncryptedParamsSPF{radar.EmailRoutingTimeseriesGroupEncryptedParamsSPFPass, radar.EmailRoutingTimeseriesGroupEncryptedParamsSPFNone, radar.EmailRoutingTimeseriesGroupEncryptedParamsSPFFail}),
+ })
+ 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())
+ }
+}
+
+func TestEmailRoutingTimeseriesGroupIPVersionWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Email.Routing.TimeseriesGroups.IPVersion(context.TODO(), radar.EmailRoutingTimeseriesGroupIPVersionParams{
+ AggInterval: cloudflare.F(radar.EmailRoutingTimeseriesGroupIPVersionParamsAggInterval1h),
+ ARC: cloudflare.F([]radar.EmailRoutingTimeseriesGroupIPVersionParamsARC{radar.EmailRoutingTimeseriesGroupIPVersionParamsARCPass, radar.EmailRoutingTimeseriesGroupIPVersionParamsARCNone, radar.EmailRoutingTimeseriesGroupIPVersionParamsARCFail}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.EmailRoutingTimeseriesGroupIPVersionParamsDateRange{radar.EmailRoutingTimeseriesGroupIPVersionParamsDateRange1d, radar.EmailRoutingTimeseriesGroupIPVersionParamsDateRange2d, radar.EmailRoutingTimeseriesGroupIPVersionParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DKIM: cloudflare.F([]radar.EmailRoutingTimeseriesGroupIPVersionParamsDKIM{radar.EmailRoutingTimeseriesGroupIPVersionParamsDKIMPass, radar.EmailRoutingTimeseriesGroupIPVersionParamsDKIMNone, radar.EmailRoutingTimeseriesGroupIPVersionParamsDKIMFail}),
+ DMARC: cloudflare.F([]radar.EmailRoutingTimeseriesGroupIPVersionParamsDMARC{radar.EmailRoutingTimeseriesGroupIPVersionParamsDMARCPass, radar.EmailRoutingTimeseriesGroupIPVersionParamsDMARCNone, radar.EmailRoutingTimeseriesGroupIPVersionParamsDMARCFail}),
+ Encrypted: cloudflare.F([]radar.EmailRoutingTimeseriesGroupIPVersionParamsEncrypted{radar.EmailRoutingTimeseriesGroupIPVersionParamsEncryptedEncrypted, radar.EmailRoutingTimeseriesGroupIPVersionParamsEncryptedNotEncrypted}),
+ Format: cloudflare.F(radar.EmailRoutingTimeseriesGroupIPVersionParamsFormatJson),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ SPF: cloudflare.F([]radar.EmailRoutingTimeseriesGroupIPVersionParamsSPF{radar.EmailRoutingTimeseriesGroupIPVersionParamsSPFPass, radar.EmailRoutingTimeseriesGroupIPVersionParamsSPFNone, radar.EmailRoutingTimeseriesGroupIPVersionParamsSPFFail}),
+ })
+ 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())
+ }
+}
+
+func TestEmailRoutingTimeseriesGroupSPFWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Email.Routing.TimeseriesGroups.SPF(context.TODO(), radar.EmailRoutingTimeseriesGroupSPFParams{
+ AggInterval: cloudflare.F(radar.EmailRoutingTimeseriesGroupSPFParamsAggInterval1h),
+ ARC: cloudflare.F([]radar.EmailRoutingTimeseriesGroupSPFParamsARC{radar.EmailRoutingTimeseriesGroupSPFParamsARCPass, radar.EmailRoutingTimeseriesGroupSPFParamsARCNone, radar.EmailRoutingTimeseriesGroupSPFParamsARCFail}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.EmailRoutingTimeseriesGroupSPFParamsDateRange{radar.EmailRoutingTimeseriesGroupSPFParamsDateRange1d, radar.EmailRoutingTimeseriesGroupSPFParamsDateRange2d, radar.EmailRoutingTimeseriesGroupSPFParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DKIM: cloudflare.F([]radar.EmailRoutingTimeseriesGroupSPFParamsDKIM{radar.EmailRoutingTimeseriesGroupSPFParamsDKIMPass, radar.EmailRoutingTimeseriesGroupSPFParamsDKIMNone, radar.EmailRoutingTimeseriesGroupSPFParamsDKIMFail}),
+ DMARC: cloudflare.F([]radar.EmailRoutingTimeseriesGroupSPFParamsDMARC{radar.EmailRoutingTimeseriesGroupSPFParamsDMARCPass, radar.EmailRoutingTimeseriesGroupSPFParamsDMARCNone, radar.EmailRoutingTimeseriesGroupSPFParamsDMARCFail}),
+ Encrypted: cloudflare.F([]radar.EmailRoutingTimeseriesGroupSPFParamsEncrypted{radar.EmailRoutingTimeseriesGroupSPFParamsEncryptedEncrypted, radar.EmailRoutingTimeseriesGroupSPFParamsEncryptedNotEncrypted}),
+ Format: cloudflare.F(radar.EmailRoutingTimeseriesGroupSPFParamsFormatJson),
+ IPVersion: cloudflare.F([]radar.EmailRoutingTimeseriesGroupSPFParamsIPVersion{radar.EmailRoutingTimeseriesGroupSPFParamsIPVersionIPv4, radar.EmailRoutingTimeseriesGroupSPFParamsIPVersionIPv6}),
+ 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/radar/emailsecurity.go b/radar/emailsecurity.go
new file mode 100644
index 00000000000..ab087b9d280
--- /dev/null
+++ b/radar/emailsecurity.go
@@ -0,0 +1,31 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// EmailSecurityService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewEmailSecurityService] method
+// instead.
+type EmailSecurityService struct {
+ Options []option.RequestOption
+ Top *EmailSecurityTopService
+ Summary *EmailSecuritySummaryService
+ TimeseriesGroups *EmailSecurityTimeseriesGroupService
+}
+
+// NewEmailSecurityService generates a new service that applies the given options
+// to each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewEmailSecurityService(opts ...option.RequestOption) (r *EmailSecurityService) {
+ r = &EmailSecurityService{}
+ r.Options = opts
+ r.Top = NewEmailSecurityTopService(opts...)
+ r.Summary = NewEmailSecuritySummaryService(opts...)
+ r.TimeseriesGroups = NewEmailSecurityTimeseriesGroupService(opts...)
+ return
+}
diff --git a/radar/emailsecuritysummary.go b/radar/emailsecuritysummary.go
new file mode 100644
index 00000000000..7a544ada3d1
--- /dev/null
+++ b/radar/emailsecuritysummary.go
@@ -0,0 +1,2649 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "context"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// EmailSecuritySummaryService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewEmailSecuritySummaryService]
+// method instead.
+type EmailSecuritySummaryService struct {
+ Options []option.RequestOption
+}
+
+// NewEmailSecuritySummaryService generates a new service that applies the given
+// options to each request. These options are applied after the parent client's
+// options (if there is one), and before any request-specific options.
+func NewEmailSecuritySummaryService(opts ...option.RequestOption) (r *EmailSecuritySummaryService) {
+ r = &EmailSecuritySummaryService{}
+ r.Options = opts
+ return
+}
+
+// Percentage distribution of emails classified per ARC validation.
+func (r *EmailSecuritySummaryService) ARC(ctx context.Context, query EmailSecuritySummaryARCParams, opts ...option.RequestOption) (res *EmailSecuritySummaryARCResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env EmailSecuritySummaryARCResponseEnvelope
+ path := "radar/email/security/summary/arc"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Percentage distribution of emails classified per DKIM validation.
+func (r *EmailSecuritySummaryService) DKIM(ctx context.Context, query EmailSecuritySummaryDKIMParams, opts ...option.RequestOption) (res *EmailSecuritySummaryDKIMResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env EmailSecuritySummaryDKIMResponseEnvelope
+ path := "radar/email/security/summary/dkim"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Percentage distribution of emails classified per DMARC validation.
+func (r *EmailSecuritySummaryService) DMARC(ctx context.Context, query EmailSecuritySummaryDMARCParams, opts ...option.RequestOption) (res *EmailSecuritySummaryDMARCResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env EmailSecuritySummaryDMARCResponseEnvelope
+ path := "radar/email/security/summary/dmarc"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Percentage distribution of emails classified as MALICIOUS.
+func (r *EmailSecuritySummaryService) Malicious(ctx context.Context, query EmailSecuritySummaryMaliciousParams, opts ...option.RequestOption) (res *EmailSecuritySummaryMaliciousResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env EmailSecuritySummaryMaliciousResponseEnvelope
+ path := "radar/email/security/summary/malicious"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Proportion of emails categorized as either spam or legitimate (non-spam).
+func (r *EmailSecuritySummaryService) Spam(ctx context.Context, query EmailSecuritySummarySpamParams, opts ...option.RequestOption) (res *EmailSecuritySummarySpamResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env EmailSecuritySummarySpamResponseEnvelope
+ path := "radar/email/security/summary/spam"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Percentage distribution of emails classified per SPF validation.
+func (r *EmailSecuritySummaryService) SPF(ctx context.Context, query EmailSecuritySummarySPFParams, opts ...option.RequestOption) (res *EmailSecuritySummarySPFResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env EmailSecuritySummarySPFResponseEnvelope
+ path := "radar/email/security/summary/spf"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Proportion of emails categorized as either spoof or legitimate (non-spoof).
+func (r *EmailSecuritySummaryService) Spoof(ctx context.Context, query EmailSecuritySummarySpoofParams, opts ...option.RequestOption) (res *EmailSecuritySummarySpoofResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env EmailSecuritySummarySpoofResponseEnvelope
+ path := "radar/email/security/summary/spoof"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Percentage distribution of emails classified in Threat Categories.
+func (r *EmailSecuritySummaryService) ThreatCategory(ctx context.Context, query EmailSecuritySummaryThreatCategoryParams, opts ...option.RequestOption) (res *EmailSecuritySummaryThreatCategoryResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env EmailSecuritySummaryThreatCategoryResponseEnvelope
+ path := "radar/email/security/summary/threat_category"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Percentage distribution of emails classified per TLS Version.
+func (r *EmailSecuritySummaryService) TLSVersion(ctx context.Context, query EmailSecuritySummaryTLSVersionParams, opts ...option.RequestOption) (res *EmailSecuritySummaryTLSVersionResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env EmailSecuritySummaryTLSVersionResponseEnvelope
+ path := "radar/email/security/summary/tls_version"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type EmailSecuritySummaryARCResponse struct {
+ Meta EmailSecuritySummaryARCResponseMeta `json:"meta,required"`
+ Summary0 EmailSecuritySummaryARCResponseSummary0 `json:"summary_0,required"`
+ JSON emailSecuritySummaryARCResponseJSON `json:"-"`
+}
+
+// emailSecuritySummaryARCResponseJSON contains the JSON metadata for the struct
+// [EmailSecuritySummaryARCResponse]
+type emailSecuritySummaryARCResponseJSON struct {
+ Meta apijson.Field
+ Summary0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecuritySummaryARCResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecuritySummaryARCResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecuritySummaryARCResponseMeta struct {
+ DateRange []EmailSecuritySummaryARCResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ Normalization string `json:"normalization,required"`
+ ConfidenceInfo EmailSecuritySummaryARCResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON emailSecuritySummaryARCResponseMetaJSON `json:"-"`
+}
+
+// emailSecuritySummaryARCResponseMetaJSON contains the JSON metadata for the
+// struct [EmailSecuritySummaryARCResponseMeta]
+type emailSecuritySummaryARCResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ Normalization apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecuritySummaryARCResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecuritySummaryARCResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecuritySummaryARCResponseMetaDateRange 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 emailSecuritySummaryARCResponseMetaDateRangeJSON `json:"-"`
+}
+
+// emailSecuritySummaryARCResponseMetaDateRangeJSON contains the JSON metadata for
+// the struct [EmailSecuritySummaryARCResponseMetaDateRange]
+type emailSecuritySummaryARCResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecuritySummaryARCResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecuritySummaryARCResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecuritySummaryARCResponseMetaConfidenceInfo struct {
+ Annotations []EmailSecuritySummaryARCResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON emailSecuritySummaryARCResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// emailSecuritySummaryARCResponseMetaConfidenceInfoJSON contains the JSON metadata
+// for the struct [EmailSecuritySummaryARCResponseMetaConfidenceInfo]
+type emailSecuritySummaryARCResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecuritySummaryARCResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecuritySummaryARCResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecuritySummaryARCResponseMetaConfidenceInfoAnnotation 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 emailSecuritySummaryARCResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// emailSecuritySummaryARCResponseMetaConfidenceInfoAnnotationJSON contains the
+// JSON metadata for the struct
+// [EmailSecuritySummaryARCResponseMetaConfidenceInfoAnnotation]
+type emailSecuritySummaryARCResponseMetaConfidenceInfoAnnotationJSON 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 *EmailSecuritySummaryARCResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecuritySummaryARCResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecuritySummaryARCResponseSummary0 struct {
+ Fail string `json:"FAIL,required"`
+ None string `json:"NONE,required"`
+ Pass string `json:"PASS,required"`
+ JSON emailSecuritySummaryARCResponseSummary0JSON `json:"-"`
+}
+
+// emailSecuritySummaryARCResponseSummary0JSON contains the JSON metadata for the
+// struct [EmailSecuritySummaryARCResponseSummary0]
+type emailSecuritySummaryARCResponseSummary0JSON struct {
+ Fail apijson.Field
+ None apijson.Field
+ Pass apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecuritySummaryARCResponseSummary0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecuritySummaryARCResponseSummary0JSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecuritySummaryDKIMResponse struct {
+ Meta EmailSecuritySummaryDKIMResponseMeta `json:"meta,required"`
+ Summary0 EmailSecuritySummaryDKIMResponseSummary0 `json:"summary_0,required"`
+ JSON emailSecuritySummaryDKIMResponseJSON `json:"-"`
+}
+
+// emailSecuritySummaryDKIMResponseJSON contains the JSON metadata for the struct
+// [EmailSecuritySummaryDKIMResponse]
+type emailSecuritySummaryDKIMResponseJSON struct {
+ Meta apijson.Field
+ Summary0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecuritySummaryDKIMResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecuritySummaryDKIMResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecuritySummaryDKIMResponseMeta struct {
+ DateRange []EmailSecuritySummaryDKIMResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ Normalization string `json:"normalization,required"`
+ ConfidenceInfo EmailSecuritySummaryDKIMResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON emailSecuritySummaryDKIMResponseMetaJSON `json:"-"`
+}
+
+// emailSecuritySummaryDKIMResponseMetaJSON contains the JSON metadata for the
+// struct [EmailSecuritySummaryDKIMResponseMeta]
+type emailSecuritySummaryDKIMResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ Normalization apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecuritySummaryDKIMResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecuritySummaryDKIMResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecuritySummaryDKIMResponseMetaDateRange 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 emailSecuritySummaryDKIMResponseMetaDateRangeJSON `json:"-"`
+}
+
+// emailSecuritySummaryDKIMResponseMetaDateRangeJSON contains the JSON metadata for
+// the struct [EmailSecuritySummaryDKIMResponseMetaDateRange]
+type emailSecuritySummaryDKIMResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecuritySummaryDKIMResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecuritySummaryDKIMResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecuritySummaryDKIMResponseMetaConfidenceInfo struct {
+ Annotations []EmailSecuritySummaryDKIMResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON emailSecuritySummaryDKIMResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// emailSecuritySummaryDKIMResponseMetaConfidenceInfoJSON contains the JSON
+// metadata for the struct [EmailSecuritySummaryDKIMResponseMetaConfidenceInfo]
+type emailSecuritySummaryDKIMResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecuritySummaryDKIMResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecuritySummaryDKIMResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecuritySummaryDKIMResponseMetaConfidenceInfoAnnotation 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 emailSecuritySummaryDKIMResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// emailSecuritySummaryDKIMResponseMetaConfidenceInfoAnnotationJSON contains the
+// JSON metadata for the struct
+// [EmailSecuritySummaryDKIMResponseMetaConfidenceInfoAnnotation]
+type emailSecuritySummaryDKIMResponseMetaConfidenceInfoAnnotationJSON 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 *EmailSecuritySummaryDKIMResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecuritySummaryDKIMResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecuritySummaryDKIMResponseSummary0 struct {
+ Fail string `json:"FAIL,required"`
+ None string `json:"NONE,required"`
+ Pass string `json:"PASS,required"`
+ JSON emailSecuritySummaryDKIMResponseSummary0JSON `json:"-"`
+}
+
+// emailSecuritySummaryDKIMResponseSummary0JSON contains the JSON metadata for the
+// struct [EmailSecuritySummaryDKIMResponseSummary0]
+type emailSecuritySummaryDKIMResponseSummary0JSON struct {
+ Fail apijson.Field
+ None apijson.Field
+ Pass apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecuritySummaryDKIMResponseSummary0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecuritySummaryDKIMResponseSummary0JSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecuritySummaryDMARCResponse struct {
+ Meta EmailSecuritySummaryDMARCResponseMeta `json:"meta,required"`
+ Summary0 EmailSecuritySummaryDMARCResponseSummary0 `json:"summary_0,required"`
+ JSON emailSecuritySummaryDMARCResponseJSON `json:"-"`
+}
+
+// emailSecuritySummaryDMARCResponseJSON contains the JSON metadata for the struct
+// [EmailSecuritySummaryDMARCResponse]
+type emailSecuritySummaryDMARCResponseJSON struct {
+ Meta apijson.Field
+ Summary0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecuritySummaryDMARCResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecuritySummaryDMARCResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecuritySummaryDMARCResponseMeta struct {
+ DateRange []EmailSecuritySummaryDMARCResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ Normalization string `json:"normalization,required"`
+ ConfidenceInfo EmailSecuritySummaryDMARCResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON emailSecuritySummaryDMARCResponseMetaJSON `json:"-"`
+}
+
+// emailSecuritySummaryDMARCResponseMetaJSON contains the JSON metadata for the
+// struct [EmailSecuritySummaryDMARCResponseMeta]
+type emailSecuritySummaryDMARCResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ Normalization apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecuritySummaryDMARCResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecuritySummaryDMARCResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecuritySummaryDMARCResponseMetaDateRange 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 emailSecuritySummaryDMARCResponseMetaDateRangeJSON `json:"-"`
+}
+
+// emailSecuritySummaryDMARCResponseMetaDateRangeJSON contains the JSON metadata
+// for the struct [EmailSecuritySummaryDMARCResponseMetaDateRange]
+type emailSecuritySummaryDMARCResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecuritySummaryDMARCResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecuritySummaryDMARCResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecuritySummaryDMARCResponseMetaConfidenceInfo struct {
+ Annotations []EmailSecuritySummaryDMARCResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON emailSecuritySummaryDMARCResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// emailSecuritySummaryDMARCResponseMetaConfidenceInfoJSON contains the JSON
+// metadata for the struct [EmailSecuritySummaryDMARCResponseMetaConfidenceInfo]
+type emailSecuritySummaryDMARCResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecuritySummaryDMARCResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecuritySummaryDMARCResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecuritySummaryDMARCResponseMetaConfidenceInfoAnnotation 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 emailSecuritySummaryDMARCResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// emailSecuritySummaryDMARCResponseMetaConfidenceInfoAnnotationJSON contains the
+// JSON metadata for the struct
+// [EmailSecuritySummaryDMARCResponseMetaConfidenceInfoAnnotation]
+type emailSecuritySummaryDMARCResponseMetaConfidenceInfoAnnotationJSON 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 *EmailSecuritySummaryDMARCResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecuritySummaryDMARCResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecuritySummaryDMARCResponseSummary0 struct {
+ Fail string `json:"FAIL,required"`
+ None string `json:"NONE,required"`
+ Pass string `json:"PASS,required"`
+ JSON emailSecuritySummaryDMARCResponseSummary0JSON `json:"-"`
+}
+
+// emailSecuritySummaryDMARCResponseSummary0JSON contains the JSON metadata for the
+// struct [EmailSecuritySummaryDMARCResponseSummary0]
+type emailSecuritySummaryDMARCResponseSummary0JSON struct {
+ Fail apijson.Field
+ None apijson.Field
+ Pass apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecuritySummaryDMARCResponseSummary0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecuritySummaryDMARCResponseSummary0JSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecuritySummaryMaliciousResponse struct {
+ Meta EmailSecuritySummaryMaliciousResponseMeta `json:"meta,required"`
+ Summary0 EmailSecuritySummaryMaliciousResponseSummary0 `json:"summary_0,required"`
+ JSON emailSecuritySummaryMaliciousResponseJSON `json:"-"`
+}
+
+// emailSecuritySummaryMaliciousResponseJSON contains the JSON metadata for the
+// struct [EmailSecuritySummaryMaliciousResponse]
+type emailSecuritySummaryMaliciousResponseJSON struct {
+ Meta apijson.Field
+ Summary0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecuritySummaryMaliciousResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecuritySummaryMaliciousResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecuritySummaryMaliciousResponseMeta struct {
+ DateRange []EmailSecuritySummaryMaliciousResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ Normalization string `json:"normalization,required"`
+ ConfidenceInfo EmailSecuritySummaryMaliciousResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON emailSecuritySummaryMaliciousResponseMetaJSON `json:"-"`
+}
+
+// emailSecuritySummaryMaliciousResponseMetaJSON contains the JSON metadata for the
+// struct [EmailSecuritySummaryMaliciousResponseMeta]
+type emailSecuritySummaryMaliciousResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ Normalization apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecuritySummaryMaliciousResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecuritySummaryMaliciousResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecuritySummaryMaliciousResponseMetaDateRange 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 emailSecuritySummaryMaliciousResponseMetaDateRangeJSON `json:"-"`
+}
+
+// emailSecuritySummaryMaliciousResponseMetaDateRangeJSON contains the JSON
+// metadata for the struct [EmailSecuritySummaryMaliciousResponseMetaDateRange]
+type emailSecuritySummaryMaliciousResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecuritySummaryMaliciousResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecuritySummaryMaliciousResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecuritySummaryMaliciousResponseMetaConfidenceInfo struct {
+ Annotations []EmailSecuritySummaryMaliciousResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON emailSecuritySummaryMaliciousResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// emailSecuritySummaryMaliciousResponseMetaConfidenceInfoJSON contains the JSON
+// metadata for the struct
+// [EmailSecuritySummaryMaliciousResponseMetaConfidenceInfo]
+type emailSecuritySummaryMaliciousResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecuritySummaryMaliciousResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecuritySummaryMaliciousResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecuritySummaryMaliciousResponseMetaConfidenceInfoAnnotation 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 emailSecuritySummaryMaliciousResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// emailSecuritySummaryMaliciousResponseMetaConfidenceInfoAnnotationJSON contains
+// the JSON metadata for the struct
+// [EmailSecuritySummaryMaliciousResponseMetaConfidenceInfoAnnotation]
+type emailSecuritySummaryMaliciousResponseMetaConfidenceInfoAnnotationJSON 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 *EmailSecuritySummaryMaliciousResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecuritySummaryMaliciousResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecuritySummaryMaliciousResponseSummary0 struct {
+ Malicious string `json:"MALICIOUS,required"`
+ NotMalicious string `json:"NOT_MALICIOUS,required"`
+ JSON emailSecuritySummaryMaliciousResponseSummary0JSON `json:"-"`
+}
+
+// emailSecuritySummaryMaliciousResponseSummary0JSON contains the JSON metadata for
+// the struct [EmailSecuritySummaryMaliciousResponseSummary0]
+type emailSecuritySummaryMaliciousResponseSummary0JSON struct {
+ Malicious apijson.Field
+ NotMalicious apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecuritySummaryMaliciousResponseSummary0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecuritySummaryMaliciousResponseSummary0JSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecuritySummarySpamResponse struct {
+ Meta EmailSecuritySummarySpamResponseMeta `json:"meta,required"`
+ Summary0 EmailSecuritySummarySpamResponseSummary0 `json:"summary_0,required"`
+ JSON emailSecuritySummarySpamResponseJSON `json:"-"`
+}
+
+// emailSecuritySummarySpamResponseJSON contains the JSON metadata for the struct
+// [EmailSecuritySummarySpamResponse]
+type emailSecuritySummarySpamResponseJSON struct {
+ Meta apijson.Field
+ Summary0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecuritySummarySpamResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecuritySummarySpamResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecuritySummarySpamResponseMeta struct {
+ DateRange []EmailSecuritySummarySpamResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ Normalization string `json:"normalization,required"`
+ ConfidenceInfo EmailSecuritySummarySpamResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON emailSecuritySummarySpamResponseMetaJSON `json:"-"`
+}
+
+// emailSecuritySummarySpamResponseMetaJSON contains the JSON metadata for the
+// struct [EmailSecuritySummarySpamResponseMeta]
+type emailSecuritySummarySpamResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ Normalization apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecuritySummarySpamResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecuritySummarySpamResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecuritySummarySpamResponseMetaDateRange 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 emailSecuritySummarySpamResponseMetaDateRangeJSON `json:"-"`
+}
+
+// emailSecuritySummarySpamResponseMetaDateRangeJSON contains the JSON metadata for
+// the struct [EmailSecuritySummarySpamResponseMetaDateRange]
+type emailSecuritySummarySpamResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecuritySummarySpamResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecuritySummarySpamResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecuritySummarySpamResponseMetaConfidenceInfo struct {
+ Annotations []EmailSecuritySummarySpamResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON emailSecuritySummarySpamResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// emailSecuritySummarySpamResponseMetaConfidenceInfoJSON contains the JSON
+// metadata for the struct [EmailSecuritySummarySpamResponseMetaConfidenceInfo]
+type emailSecuritySummarySpamResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecuritySummarySpamResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecuritySummarySpamResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecuritySummarySpamResponseMetaConfidenceInfoAnnotation 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 emailSecuritySummarySpamResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// emailSecuritySummarySpamResponseMetaConfidenceInfoAnnotationJSON contains the
+// JSON metadata for the struct
+// [EmailSecuritySummarySpamResponseMetaConfidenceInfoAnnotation]
+type emailSecuritySummarySpamResponseMetaConfidenceInfoAnnotationJSON 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 *EmailSecuritySummarySpamResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecuritySummarySpamResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecuritySummarySpamResponseSummary0 struct {
+ NotSpam string `json:"NOT_SPAM,required"`
+ Spam string `json:"SPAM,required"`
+ JSON emailSecuritySummarySpamResponseSummary0JSON `json:"-"`
+}
+
+// emailSecuritySummarySpamResponseSummary0JSON contains the JSON metadata for the
+// struct [EmailSecuritySummarySpamResponseSummary0]
+type emailSecuritySummarySpamResponseSummary0JSON struct {
+ NotSpam apijson.Field
+ Spam apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecuritySummarySpamResponseSummary0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecuritySummarySpamResponseSummary0JSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecuritySummarySPFResponse struct {
+ Meta EmailSecuritySummarySPFResponseMeta `json:"meta,required"`
+ Summary0 EmailSecuritySummarySPFResponseSummary0 `json:"summary_0,required"`
+ JSON emailSecuritySummarySPFResponseJSON `json:"-"`
+}
+
+// emailSecuritySummarySPFResponseJSON contains the JSON metadata for the struct
+// [EmailSecuritySummarySPFResponse]
+type emailSecuritySummarySPFResponseJSON struct {
+ Meta apijson.Field
+ Summary0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecuritySummarySPFResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecuritySummarySPFResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecuritySummarySPFResponseMeta struct {
+ DateRange []EmailSecuritySummarySPFResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ Normalization string `json:"normalization,required"`
+ ConfidenceInfo EmailSecuritySummarySPFResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON emailSecuritySummarySPFResponseMetaJSON `json:"-"`
+}
+
+// emailSecuritySummarySPFResponseMetaJSON contains the JSON metadata for the
+// struct [EmailSecuritySummarySPFResponseMeta]
+type emailSecuritySummarySPFResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ Normalization apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecuritySummarySPFResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecuritySummarySPFResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecuritySummarySPFResponseMetaDateRange 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 emailSecuritySummarySPFResponseMetaDateRangeJSON `json:"-"`
+}
+
+// emailSecuritySummarySPFResponseMetaDateRangeJSON contains the JSON metadata for
+// the struct [EmailSecuritySummarySPFResponseMetaDateRange]
+type emailSecuritySummarySPFResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecuritySummarySPFResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecuritySummarySPFResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecuritySummarySPFResponseMetaConfidenceInfo struct {
+ Annotations []EmailSecuritySummarySPFResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON emailSecuritySummarySPFResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// emailSecuritySummarySPFResponseMetaConfidenceInfoJSON contains the JSON metadata
+// for the struct [EmailSecuritySummarySPFResponseMetaConfidenceInfo]
+type emailSecuritySummarySPFResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecuritySummarySPFResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecuritySummarySPFResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecuritySummarySPFResponseMetaConfidenceInfoAnnotation 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 emailSecuritySummarySPFResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// emailSecuritySummarySPFResponseMetaConfidenceInfoAnnotationJSON contains the
+// JSON metadata for the struct
+// [EmailSecuritySummarySPFResponseMetaConfidenceInfoAnnotation]
+type emailSecuritySummarySPFResponseMetaConfidenceInfoAnnotationJSON 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 *EmailSecuritySummarySPFResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecuritySummarySPFResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecuritySummarySPFResponseSummary0 struct {
+ Fail string `json:"FAIL,required"`
+ None string `json:"NONE,required"`
+ Pass string `json:"PASS,required"`
+ JSON emailSecuritySummarySPFResponseSummary0JSON `json:"-"`
+}
+
+// emailSecuritySummarySPFResponseSummary0JSON contains the JSON metadata for the
+// struct [EmailSecuritySummarySPFResponseSummary0]
+type emailSecuritySummarySPFResponseSummary0JSON struct {
+ Fail apijson.Field
+ None apijson.Field
+ Pass apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecuritySummarySPFResponseSummary0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecuritySummarySPFResponseSummary0JSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecuritySummarySpoofResponse struct {
+ Meta EmailSecuritySummarySpoofResponseMeta `json:"meta,required"`
+ Summary0 EmailSecuritySummarySpoofResponseSummary0 `json:"summary_0,required"`
+ JSON emailSecuritySummarySpoofResponseJSON `json:"-"`
+}
+
+// emailSecuritySummarySpoofResponseJSON contains the JSON metadata for the struct
+// [EmailSecuritySummarySpoofResponse]
+type emailSecuritySummarySpoofResponseJSON struct {
+ Meta apijson.Field
+ Summary0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecuritySummarySpoofResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecuritySummarySpoofResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecuritySummarySpoofResponseMeta struct {
+ DateRange []EmailSecuritySummarySpoofResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ Normalization string `json:"normalization,required"`
+ ConfidenceInfo EmailSecuritySummarySpoofResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON emailSecuritySummarySpoofResponseMetaJSON `json:"-"`
+}
+
+// emailSecuritySummarySpoofResponseMetaJSON contains the JSON metadata for the
+// struct [EmailSecuritySummarySpoofResponseMeta]
+type emailSecuritySummarySpoofResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ Normalization apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecuritySummarySpoofResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecuritySummarySpoofResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecuritySummarySpoofResponseMetaDateRange 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 emailSecuritySummarySpoofResponseMetaDateRangeJSON `json:"-"`
+}
+
+// emailSecuritySummarySpoofResponseMetaDateRangeJSON contains the JSON metadata
+// for the struct [EmailSecuritySummarySpoofResponseMetaDateRange]
+type emailSecuritySummarySpoofResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecuritySummarySpoofResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecuritySummarySpoofResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecuritySummarySpoofResponseMetaConfidenceInfo struct {
+ Annotations []EmailSecuritySummarySpoofResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON emailSecuritySummarySpoofResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// emailSecuritySummarySpoofResponseMetaConfidenceInfoJSON contains the JSON
+// metadata for the struct [EmailSecuritySummarySpoofResponseMetaConfidenceInfo]
+type emailSecuritySummarySpoofResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecuritySummarySpoofResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecuritySummarySpoofResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecuritySummarySpoofResponseMetaConfidenceInfoAnnotation 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 emailSecuritySummarySpoofResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// emailSecuritySummarySpoofResponseMetaConfidenceInfoAnnotationJSON contains the
+// JSON metadata for the struct
+// [EmailSecuritySummarySpoofResponseMetaConfidenceInfoAnnotation]
+type emailSecuritySummarySpoofResponseMetaConfidenceInfoAnnotationJSON 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 *EmailSecuritySummarySpoofResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecuritySummarySpoofResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecuritySummarySpoofResponseSummary0 struct {
+ NotSpoof string `json:"NOT_SPOOF,required"`
+ Spoof string `json:"SPOOF,required"`
+ JSON emailSecuritySummarySpoofResponseSummary0JSON `json:"-"`
+}
+
+// emailSecuritySummarySpoofResponseSummary0JSON contains the JSON metadata for the
+// struct [EmailSecuritySummarySpoofResponseSummary0]
+type emailSecuritySummarySpoofResponseSummary0JSON struct {
+ NotSpoof apijson.Field
+ Spoof apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecuritySummarySpoofResponseSummary0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecuritySummarySpoofResponseSummary0JSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecuritySummaryThreatCategoryResponse struct {
+ Meta EmailSecuritySummaryThreatCategoryResponseMeta `json:"meta,required"`
+ Summary0 EmailSecuritySummaryThreatCategoryResponseSummary0 `json:"summary_0,required"`
+ JSON emailSecuritySummaryThreatCategoryResponseJSON `json:"-"`
+}
+
+// emailSecuritySummaryThreatCategoryResponseJSON contains the JSON metadata for
+// the struct [EmailSecuritySummaryThreatCategoryResponse]
+type emailSecuritySummaryThreatCategoryResponseJSON struct {
+ Meta apijson.Field
+ Summary0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecuritySummaryThreatCategoryResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecuritySummaryThreatCategoryResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecuritySummaryThreatCategoryResponseMeta struct {
+ DateRange []EmailSecuritySummaryThreatCategoryResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ Normalization string `json:"normalization,required"`
+ ConfidenceInfo EmailSecuritySummaryThreatCategoryResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON emailSecuritySummaryThreatCategoryResponseMetaJSON `json:"-"`
+}
+
+// emailSecuritySummaryThreatCategoryResponseMetaJSON contains the JSON metadata
+// for the struct [EmailSecuritySummaryThreatCategoryResponseMeta]
+type emailSecuritySummaryThreatCategoryResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ Normalization apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecuritySummaryThreatCategoryResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecuritySummaryThreatCategoryResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecuritySummaryThreatCategoryResponseMetaDateRange 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 emailSecuritySummaryThreatCategoryResponseMetaDateRangeJSON `json:"-"`
+}
+
+// emailSecuritySummaryThreatCategoryResponseMetaDateRangeJSON contains the JSON
+// metadata for the struct
+// [EmailSecuritySummaryThreatCategoryResponseMetaDateRange]
+type emailSecuritySummaryThreatCategoryResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecuritySummaryThreatCategoryResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecuritySummaryThreatCategoryResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecuritySummaryThreatCategoryResponseMetaConfidenceInfo struct {
+ Annotations []EmailSecuritySummaryThreatCategoryResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON emailSecuritySummaryThreatCategoryResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// emailSecuritySummaryThreatCategoryResponseMetaConfidenceInfoJSON contains the
+// JSON metadata for the struct
+// [EmailSecuritySummaryThreatCategoryResponseMetaConfidenceInfo]
+type emailSecuritySummaryThreatCategoryResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecuritySummaryThreatCategoryResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecuritySummaryThreatCategoryResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecuritySummaryThreatCategoryResponseMetaConfidenceInfoAnnotation 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 emailSecuritySummaryThreatCategoryResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// emailSecuritySummaryThreatCategoryResponseMetaConfidenceInfoAnnotationJSON
+// contains the JSON metadata for the struct
+// [EmailSecuritySummaryThreatCategoryResponseMetaConfidenceInfoAnnotation]
+type emailSecuritySummaryThreatCategoryResponseMetaConfidenceInfoAnnotationJSON 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 *EmailSecuritySummaryThreatCategoryResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecuritySummaryThreatCategoryResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecuritySummaryThreatCategoryResponseSummary0 struct {
+ BrandImpersonation string `json:"BrandImpersonation,required"`
+ CredentialHarvester string `json:"CredentialHarvester,required"`
+ IdentityDeception string `json:"IdentityDeception,required"`
+ Link string `json:"Link,required"`
+ JSON emailSecuritySummaryThreatCategoryResponseSummary0JSON `json:"-"`
+}
+
+// emailSecuritySummaryThreatCategoryResponseSummary0JSON contains the JSON
+// metadata for the struct [EmailSecuritySummaryThreatCategoryResponseSummary0]
+type emailSecuritySummaryThreatCategoryResponseSummary0JSON struct {
+ BrandImpersonation apijson.Field
+ CredentialHarvester apijson.Field
+ IdentityDeception apijson.Field
+ Link apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecuritySummaryThreatCategoryResponseSummary0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecuritySummaryThreatCategoryResponseSummary0JSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecuritySummaryTLSVersionResponse struct {
+ Meta EmailSecuritySummaryTLSVersionResponseMeta `json:"meta,required"`
+ Summary0 EmailSecuritySummaryTLSVersionResponseSummary0 `json:"summary_0,required"`
+ JSON emailSecuritySummaryTLSVersionResponseJSON `json:"-"`
+}
+
+// emailSecuritySummaryTLSVersionResponseJSON contains the JSON metadata for the
+// struct [EmailSecuritySummaryTLSVersionResponse]
+type emailSecuritySummaryTLSVersionResponseJSON struct {
+ Meta apijson.Field
+ Summary0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecuritySummaryTLSVersionResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecuritySummaryTLSVersionResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecuritySummaryTLSVersionResponseMeta struct {
+ DateRange []EmailSecuritySummaryTLSVersionResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ Normalization string `json:"normalization,required"`
+ ConfidenceInfo EmailSecuritySummaryTLSVersionResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON emailSecuritySummaryTLSVersionResponseMetaJSON `json:"-"`
+}
+
+// emailSecuritySummaryTLSVersionResponseMetaJSON contains the JSON metadata for
+// the struct [EmailSecuritySummaryTLSVersionResponseMeta]
+type emailSecuritySummaryTLSVersionResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ Normalization apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecuritySummaryTLSVersionResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecuritySummaryTLSVersionResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecuritySummaryTLSVersionResponseMetaDateRange 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 emailSecuritySummaryTLSVersionResponseMetaDateRangeJSON `json:"-"`
+}
+
+// emailSecuritySummaryTLSVersionResponseMetaDateRangeJSON contains the JSON
+// metadata for the struct [EmailSecuritySummaryTLSVersionResponseMetaDateRange]
+type emailSecuritySummaryTLSVersionResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecuritySummaryTLSVersionResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecuritySummaryTLSVersionResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecuritySummaryTLSVersionResponseMetaConfidenceInfo struct {
+ Annotations []EmailSecuritySummaryTLSVersionResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON emailSecuritySummaryTLSVersionResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// emailSecuritySummaryTLSVersionResponseMetaConfidenceInfoJSON contains the JSON
+// metadata for the struct
+// [EmailSecuritySummaryTLSVersionResponseMetaConfidenceInfo]
+type emailSecuritySummaryTLSVersionResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecuritySummaryTLSVersionResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecuritySummaryTLSVersionResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecuritySummaryTLSVersionResponseMetaConfidenceInfoAnnotation 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 emailSecuritySummaryTLSVersionResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// emailSecuritySummaryTLSVersionResponseMetaConfidenceInfoAnnotationJSON contains
+// the JSON metadata for the struct
+// [EmailSecuritySummaryTLSVersionResponseMetaConfidenceInfoAnnotation]
+type emailSecuritySummaryTLSVersionResponseMetaConfidenceInfoAnnotationJSON 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 *EmailSecuritySummaryTLSVersionResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecuritySummaryTLSVersionResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecuritySummaryTLSVersionResponseSummary0 struct {
+ TLS1_0 string `json:"TLS 1.0,required"`
+ TLS1_1 string `json:"TLS 1.1,required"`
+ TLS1_2 string `json:"TLS 1.2,required"`
+ TLS1_3 string `json:"TLS 1.3,required"`
+ JSON emailSecuritySummaryTLSVersionResponseSummary0JSON `json:"-"`
+}
+
+// emailSecuritySummaryTLSVersionResponseSummary0JSON contains the JSON metadata
+// for the struct [EmailSecuritySummaryTLSVersionResponseSummary0]
+type emailSecuritySummaryTLSVersionResponseSummary0JSON struct {
+ TLS1_0 apijson.Field
+ TLS1_1 apijson.Field
+ TLS1_2 apijson.Field
+ TLS1_3 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecuritySummaryTLSVersionResponseSummary0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecuritySummaryTLSVersionResponseSummary0JSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecuritySummaryARCParams struct {
+ // 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[[]EmailSecuritySummaryARCParamsDateRange] `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[[]EmailSecuritySummaryARCParamsDKIM] `query:"dkim"`
+ // Filter for dmarc.
+ DMARC param.Field[[]EmailSecuritySummaryARCParamsDMARC] `query:"dmarc"`
+ // Format results are returned in.
+ Format param.Field[EmailSecuritySummaryARCParamsFormat] `query:"format"`
+ // 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[[]EmailSecuritySummaryARCParamsSPF] `query:"spf"`
+ // Filter for tls version.
+ TLSVersion param.Field[[]EmailSecuritySummaryARCParamsTLSVersion] `query:"tlsVersion"`
+}
+
+// URLQuery serializes [EmailSecuritySummaryARCParams]'s query parameters as
+// `url.Values`.
+func (r EmailSecuritySummaryARCParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type EmailSecuritySummaryARCParamsDateRange string
+
+const (
+ EmailSecuritySummaryARCParamsDateRange1d EmailSecuritySummaryARCParamsDateRange = "1d"
+ EmailSecuritySummaryARCParamsDateRange2d EmailSecuritySummaryARCParamsDateRange = "2d"
+ EmailSecuritySummaryARCParamsDateRange7d EmailSecuritySummaryARCParamsDateRange = "7d"
+ EmailSecuritySummaryARCParamsDateRange14d EmailSecuritySummaryARCParamsDateRange = "14d"
+ EmailSecuritySummaryARCParamsDateRange28d EmailSecuritySummaryARCParamsDateRange = "28d"
+ EmailSecuritySummaryARCParamsDateRange12w EmailSecuritySummaryARCParamsDateRange = "12w"
+ EmailSecuritySummaryARCParamsDateRange24w EmailSecuritySummaryARCParamsDateRange = "24w"
+ EmailSecuritySummaryARCParamsDateRange52w EmailSecuritySummaryARCParamsDateRange = "52w"
+ EmailSecuritySummaryARCParamsDateRange1dControl EmailSecuritySummaryARCParamsDateRange = "1dControl"
+ EmailSecuritySummaryARCParamsDateRange2dControl EmailSecuritySummaryARCParamsDateRange = "2dControl"
+ EmailSecuritySummaryARCParamsDateRange7dControl EmailSecuritySummaryARCParamsDateRange = "7dControl"
+ EmailSecuritySummaryARCParamsDateRange14dControl EmailSecuritySummaryARCParamsDateRange = "14dControl"
+ EmailSecuritySummaryARCParamsDateRange28dControl EmailSecuritySummaryARCParamsDateRange = "28dControl"
+ EmailSecuritySummaryARCParamsDateRange12wControl EmailSecuritySummaryARCParamsDateRange = "12wControl"
+ EmailSecuritySummaryARCParamsDateRange24wControl EmailSecuritySummaryARCParamsDateRange = "24wControl"
+)
+
+type EmailSecuritySummaryARCParamsDKIM string
+
+const (
+ EmailSecuritySummaryARCParamsDKIMPass EmailSecuritySummaryARCParamsDKIM = "PASS"
+ EmailSecuritySummaryARCParamsDKIMNone EmailSecuritySummaryARCParamsDKIM = "NONE"
+ EmailSecuritySummaryARCParamsDKIMFail EmailSecuritySummaryARCParamsDKIM = "FAIL"
+)
+
+type EmailSecuritySummaryARCParamsDMARC string
+
+const (
+ EmailSecuritySummaryARCParamsDMARCPass EmailSecuritySummaryARCParamsDMARC = "PASS"
+ EmailSecuritySummaryARCParamsDMARCNone EmailSecuritySummaryARCParamsDMARC = "NONE"
+ EmailSecuritySummaryARCParamsDMARCFail EmailSecuritySummaryARCParamsDMARC = "FAIL"
+)
+
+// Format results are returned in.
+type EmailSecuritySummaryARCParamsFormat string
+
+const (
+ EmailSecuritySummaryARCParamsFormatJson EmailSecuritySummaryARCParamsFormat = "JSON"
+ EmailSecuritySummaryARCParamsFormatCsv EmailSecuritySummaryARCParamsFormat = "CSV"
+)
+
+type EmailSecuritySummaryARCParamsSPF string
+
+const (
+ EmailSecuritySummaryARCParamsSPFPass EmailSecuritySummaryARCParamsSPF = "PASS"
+ EmailSecuritySummaryARCParamsSPFNone EmailSecuritySummaryARCParamsSPF = "NONE"
+ EmailSecuritySummaryARCParamsSPFFail EmailSecuritySummaryARCParamsSPF = "FAIL"
+)
+
+type EmailSecuritySummaryARCParamsTLSVersion string
+
+const (
+ EmailSecuritySummaryARCParamsTLSVersionTlSv1_0 EmailSecuritySummaryARCParamsTLSVersion = "TLSv1_0"
+ EmailSecuritySummaryARCParamsTLSVersionTlSv1_1 EmailSecuritySummaryARCParamsTLSVersion = "TLSv1_1"
+ EmailSecuritySummaryARCParamsTLSVersionTlSv1_2 EmailSecuritySummaryARCParamsTLSVersion = "TLSv1_2"
+ EmailSecuritySummaryARCParamsTLSVersionTlSv1_3 EmailSecuritySummaryARCParamsTLSVersion = "TLSv1_3"
+)
+
+type EmailSecuritySummaryARCResponseEnvelope struct {
+ Result EmailSecuritySummaryARCResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON emailSecuritySummaryARCResponseEnvelopeJSON `json:"-"`
+}
+
+// emailSecuritySummaryARCResponseEnvelopeJSON contains the JSON metadata for the
+// struct [EmailSecuritySummaryARCResponseEnvelope]
+type emailSecuritySummaryARCResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecuritySummaryARCResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecuritySummaryARCResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecuritySummaryDKIMParams struct {
+ // Filter for arc (Authenticated Received Chain).
+ ARC param.Field[[]EmailSecuritySummaryDKIMParamsARC] `query:"arc"`
+ // 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[[]EmailSecuritySummaryDKIMParamsDateRange] `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[[]EmailSecuritySummaryDKIMParamsDMARC] `query:"dmarc"`
+ // Format results are returned in.
+ Format param.Field[EmailSecuritySummaryDKIMParamsFormat] `query:"format"`
+ // 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[[]EmailSecuritySummaryDKIMParamsSPF] `query:"spf"`
+ // Filter for tls version.
+ TLSVersion param.Field[[]EmailSecuritySummaryDKIMParamsTLSVersion] `query:"tlsVersion"`
+}
+
+// URLQuery serializes [EmailSecuritySummaryDKIMParams]'s query parameters as
+// `url.Values`.
+func (r EmailSecuritySummaryDKIMParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type EmailSecuritySummaryDKIMParamsARC string
+
+const (
+ EmailSecuritySummaryDKIMParamsARCPass EmailSecuritySummaryDKIMParamsARC = "PASS"
+ EmailSecuritySummaryDKIMParamsARCNone EmailSecuritySummaryDKIMParamsARC = "NONE"
+ EmailSecuritySummaryDKIMParamsARCFail EmailSecuritySummaryDKIMParamsARC = "FAIL"
+)
+
+type EmailSecuritySummaryDKIMParamsDateRange string
+
+const (
+ EmailSecuritySummaryDKIMParamsDateRange1d EmailSecuritySummaryDKIMParamsDateRange = "1d"
+ EmailSecuritySummaryDKIMParamsDateRange2d EmailSecuritySummaryDKIMParamsDateRange = "2d"
+ EmailSecuritySummaryDKIMParamsDateRange7d EmailSecuritySummaryDKIMParamsDateRange = "7d"
+ EmailSecuritySummaryDKIMParamsDateRange14d EmailSecuritySummaryDKIMParamsDateRange = "14d"
+ EmailSecuritySummaryDKIMParamsDateRange28d EmailSecuritySummaryDKIMParamsDateRange = "28d"
+ EmailSecuritySummaryDKIMParamsDateRange12w EmailSecuritySummaryDKIMParamsDateRange = "12w"
+ EmailSecuritySummaryDKIMParamsDateRange24w EmailSecuritySummaryDKIMParamsDateRange = "24w"
+ EmailSecuritySummaryDKIMParamsDateRange52w EmailSecuritySummaryDKIMParamsDateRange = "52w"
+ EmailSecuritySummaryDKIMParamsDateRange1dControl EmailSecuritySummaryDKIMParamsDateRange = "1dControl"
+ EmailSecuritySummaryDKIMParamsDateRange2dControl EmailSecuritySummaryDKIMParamsDateRange = "2dControl"
+ EmailSecuritySummaryDKIMParamsDateRange7dControl EmailSecuritySummaryDKIMParamsDateRange = "7dControl"
+ EmailSecuritySummaryDKIMParamsDateRange14dControl EmailSecuritySummaryDKIMParamsDateRange = "14dControl"
+ EmailSecuritySummaryDKIMParamsDateRange28dControl EmailSecuritySummaryDKIMParamsDateRange = "28dControl"
+ EmailSecuritySummaryDKIMParamsDateRange12wControl EmailSecuritySummaryDKIMParamsDateRange = "12wControl"
+ EmailSecuritySummaryDKIMParamsDateRange24wControl EmailSecuritySummaryDKIMParamsDateRange = "24wControl"
+)
+
+type EmailSecuritySummaryDKIMParamsDMARC string
+
+const (
+ EmailSecuritySummaryDKIMParamsDMARCPass EmailSecuritySummaryDKIMParamsDMARC = "PASS"
+ EmailSecuritySummaryDKIMParamsDMARCNone EmailSecuritySummaryDKIMParamsDMARC = "NONE"
+ EmailSecuritySummaryDKIMParamsDMARCFail EmailSecuritySummaryDKIMParamsDMARC = "FAIL"
+)
+
+// Format results are returned in.
+type EmailSecuritySummaryDKIMParamsFormat string
+
+const (
+ EmailSecuritySummaryDKIMParamsFormatJson EmailSecuritySummaryDKIMParamsFormat = "JSON"
+ EmailSecuritySummaryDKIMParamsFormatCsv EmailSecuritySummaryDKIMParamsFormat = "CSV"
+)
+
+type EmailSecuritySummaryDKIMParamsSPF string
+
+const (
+ EmailSecuritySummaryDKIMParamsSPFPass EmailSecuritySummaryDKIMParamsSPF = "PASS"
+ EmailSecuritySummaryDKIMParamsSPFNone EmailSecuritySummaryDKIMParamsSPF = "NONE"
+ EmailSecuritySummaryDKIMParamsSPFFail EmailSecuritySummaryDKIMParamsSPF = "FAIL"
+)
+
+type EmailSecuritySummaryDKIMParamsTLSVersion string
+
+const (
+ EmailSecuritySummaryDKIMParamsTLSVersionTlSv1_0 EmailSecuritySummaryDKIMParamsTLSVersion = "TLSv1_0"
+ EmailSecuritySummaryDKIMParamsTLSVersionTlSv1_1 EmailSecuritySummaryDKIMParamsTLSVersion = "TLSv1_1"
+ EmailSecuritySummaryDKIMParamsTLSVersionTlSv1_2 EmailSecuritySummaryDKIMParamsTLSVersion = "TLSv1_2"
+ EmailSecuritySummaryDKIMParamsTLSVersionTlSv1_3 EmailSecuritySummaryDKIMParamsTLSVersion = "TLSv1_3"
+)
+
+type EmailSecuritySummaryDKIMResponseEnvelope struct {
+ Result EmailSecuritySummaryDKIMResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON emailSecuritySummaryDKIMResponseEnvelopeJSON `json:"-"`
+}
+
+// emailSecuritySummaryDKIMResponseEnvelopeJSON contains the JSON metadata for the
+// struct [EmailSecuritySummaryDKIMResponseEnvelope]
+type emailSecuritySummaryDKIMResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecuritySummaryDKIMResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecuritySummaryDKIMResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecuritySummaryDMARCParams struct {
+ // Filter for arc (Authenticated Received Chain).
+ ARC param.Field[[]EmailSecuritySummaryDMARCParamsARC] `query:"arc"`
+ // 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[[]EmailSecuritySummaryDMARCParamsDateRange] `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[[]EmailSecuritySummaryDMARCParamsDKIM] `query:"dkim"`
+ // Format results are returned in.
+ Format param.Field[EmailSecuritySummaryDMARCParamsFormat] `query:"format"`
+ // 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[[]EmailSecuritySummaryDMARCParamsSPF] `query:"spf"`
+ // Filter for tls version.
+ TLSVersion param.Field[[]EmailSecuritySummaryDMARCParamsTLSVersion] `query:"tlsVersion"`
+}
+
+// URLQuery serializes [EmailSecuritySummaryDMARCParams]'s query parameters as
+// `url.Values`.
+func (r EmailSecuritySummaryDMARCParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type EmailSecuritySummaryDMARCParamsARC string
+
+const (
+ EmailSecuritySummaryDMARCParamsARCPass EmailSecuritySummaryDMARCParamsARC = "PASS"
+ EmailSecuritySummaryDMARCParamsARCNone EmailSecuritySummaryDMARCParamsARC = "NONE"
+ EmailSecuritySummaryDMARCParamsARCFail EmailSecuritySummaryDMARCParamsARC = "FAIL"
+)
+
+type EmailSecuritySummaryDMARCParamsDateRange string
+
+const (
+ EmailSecuritySummaryDMARCParamsDateRange1d EmailSecuritySummaryDMARCParamsDateRange = "1d"
+ EmailSecuritySummaryDMARCParamsDateRange2d EmailSecuritySummaryDMARCParamsDateRange = "2d"
+ EmailSecuritySummaryDMARCParamsDateRange7d EmailSecuritySummaryDMARCParamsDateRange = "7d"
+ EmailSecuritySummaryDMARCParamsDateRange14d EmailSecuritySummaryDMARCParamsDateRange = "14d"
+ EmailSecuritySummaryDMARCParamsDateRange28d EmailSecuritySummaryDMARCParamsDateRange = "28d"
+ EmailSecuritySummaryDMARCParamsDateRange12w EmailSecuritySummaryDMARCParamsDateRange = "12w"
+ EmailSecuritySummaryDMARCParamsDateRange24w EmailSecuritySummaryDMARCParamsDateRange = "24w"
+ EmailSecuritySummaryDMARCParamsDateRange52w EmailSecuritySummaryDMARCParamsDateRange = "52w"
+ EmailSecuritySummaryDMARCParamsDateRange1dControl EmailSecuritySummaryDMARCParamsDateRange = "1dControl"
+ EmailSecuritySummaryDMARCParamsDateRange2dControl EmailSecuritySummaryDMARCParamsDateRange = "2dControl"
+ EmailSecuritySummaryDMARCParamsDateRange7dControl EmailSecuritySummaryDMARCParamsDateRange = "7dControl"
+ EmailSecuritySummaryDMARCParamsDateRange14dControl EmailSecuritySummaryDMARCParamsDateRange = "14dControl"
+ EmailSecuritySummaryDMARCParamsDateRange28dControl EmailSecuritySummaryDMARCParamsDateRange = "28dControl"
+ EmailSecuritySummaryDMARCParamsDateRange12wControl EmailSecuritySummaryDMARCParamsDateRange = "12wControl"
+ EmailSecuritySummaryDMARCParamsDateRange24wControl EmailSecuritySummaryDMARCParamsDateRange = "24wControl"
+)
+
+type EmailSecuritySummaryDMARCParamsDKIM string
+
+const (
+ EmailSecuritySummaryDMARCParamsDKIMPass EmailSecuritySummaryDMARCParamsDKIM = "PASS"
+ EmailSecuritySummaryDMARCParamsDKIMNone EmailSecuritySummaryDMARCParamsDKIM = "NONE"
+ EmailSecuritySummaryDMARCParamsDKIMFail EmailSecuritySummaryDMARCParamsDKIM = "FAIL"
+)
+
+// Format results are returned in.
+type EmailSecuritySummaryDMARCParamsFormat string
+
+const (
+ EmailSecuritySummaryDMARCParamsFormatJson EmailSecuritySummaryDMARCParamsFormat = "JSON"
+ EmailSecuritySummaryDMARCParamsFormatCsv EmailSecuritySummaryDMARCParamsFormat = "CSV"
+)
+
+type EmailSecuritySummaryDMARCParamsSPF string
+
+const (
+ EmailSecuritySummaryDMARCParamsSPFPass EmailSecuritySummaryDMARCParamsSPF = "PASS"
+ EmailSecuritySummaryDMARCParamsSPFNone EmailSecuritySummaryDMARCParamsSPF = "NONE"
+ EmailSecuritySummaryDMARCParamsSPFFail EmailSecuritySummaryDMARCParamsSPF = "FAIL"
+)
+
+type EmailSecuritySummaryDMARCParamsTLSVersion string
+
+const (
+ EmailSecuritySummaryDMARCParamsTLSVersionTlSv1_0 EmailSecuritySummaryDMARCParamsTLSVersion = "TLSv1_0"
+ EmailSecuritySummaryDMARCParamsTLSVersionTlSv1_1 EmailSecuritySummaryDMARCParamsTLSVersion = "TLSv1_1"
+ EmailSecuritySummaryDMARCParamsTLSVersionTlSv1_2 EmailSecuritySummaryDMARCParamsTLSVersion = "TLSv1_2"
+ EmailSecuritySummaryDMARCParamsTLSVersionTlSv1_3 EmailSecuritySummaryDMARCParamsTLSVersion = "TLSv1_3"
+)
+
+type EmailSecuritySummaryDMARCResponseEnvelope struct {
+ Result EmailSecuritySummaryDMARCResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON emailSecuritySummaryDMARCResponseEnvelopeJSON `json:"-"`
+}
+
+// emailSecuritySummaryDMARCResponseEnvelopeJSON contains the JSON metadata for the
+// struct [EmailSecuritySummaryDMARCResponseEnvelope]
+type emailSecuritySummaryDMARCResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecuritySummaryDMARCResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecuritySummaryDMARCResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecuritySummaryMaliciousParams struct {
+ // Filter for arc (Authenticated Received Chain).
+ ARC param.Field[[]EmailSecuritySummaryMaliciousParamsARC] `query:"arc"`
+ // 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[[]EmailSecuritySummaryMaliciousParamsDateRange] `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[[]EmailSecuritySummaryMaliciousParamsDKIM] `query:"dkim"`
+ // Filter for dmarc.
+ DMARC param.Field[[]EmailSecuritySummaryMaliciousParamsDMARC] `query:"dmarc"`
+ // Format results are returned in.
+ Format param.Field[EmailSecuritySummaryMaliciousParamsFormat] `query:"format"`
+ // 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[[]EmailSecuritySummaryMaliciousParamsSPF] `query:"spf"`
+ // Filter for tls version.
+ TLSVersion param.Field[[]EmailSecuritySummaryMaliciousParamsTLSVersion] `query:"tlsVersion"`
+}
+
+// URLQuery serializes [EmailSecuritySummaryMaliciousParams]'s query parameters as
+// `url.Values`.
+func (r EmailSecuritySummaryMaliciousParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type EmailSecuritySummaryMaliciousParamsARC string
+
+const (
+ EmailSecuritySummaryMaliciousParamsARCPass EmailSecuritySummaryMaliciousParamsARC = "PASS"
+ EmailSecuritySummaryMaliciousParamsARCNone EmailSecuritySummaryMaliciousParamsARC = "NONE"
+ EmailSecuritySummaryMaliciousParamsARCFail EmailSecuritySummaryMaliciousParamsARC = "FAIL"
+)
+
+type EmailSecuritySummaryMaliciousParamsDateRange string
+
+const (
+ EmailSecuritySummaryMaliciousParamsDateRange1d EmailSecuritySummaryMaliciousParamsDateRange = "1d"
+ EmailSecuritySummaryMaliciousParamsDateRange2d EmailSecuritySummaryMaliciousParamsDateRange = "2d"
+ EmailSecuritySummaryMaliciousParamsDateRange7d EmailSecuritySummaryMaliciousParamsDateRange = "7d"
+ EmailSecuritySummaryMaliciousParamsDateRange14d EmailSecuritySummaryMaliciousParamsDateRange = "14d"
+ EmailSecuritySummaryMaliciousParamsDateRange28d EmailSecuritySummaryMaliciousParamsDateRange = "28d"
+ EmailSecuritySummaryMaliciousParamsDateRange12w EmailSecuritySummaryMaliciousParamsDateRange = "12w"
+ EmailSecuritySummaryMaliciousParamsDateRange24w EmailSecuritySummaryMaliciousParamsDateRange = "24w"
+ EmailSecuritySummaryMaliciousParamsDateRange52w EmailSecuritySummaryMaliciousParamsDateRange = "52w"
+ EmailSecuritySummaryMaliciousParamsDateRange1dControl EmailSecuritySummaryMaliciousParamsDateRange = "1dControl"
+ EmailSecuritySummaryMaliciousParamsDateRange2dControl EmailSecuritySummaryMaliciousParamsDateRange = "2dControl"
+ EmailSecuritySummaryMaliciousParamsDateRange7dControl EmailSecuritySummaryMaliciousParamsDateRange = "7dControl"
+ EmailSecuritySummaryMaliciousParamsDateRange14dControl EmailSecuritySummaryMaliciousParamsDateRange = "14dControl"
+ EmailSecuritySummaryMaliciousParamsDateRange28dControl EmailSecuritySummaryMaliciousParamsDateRange = "28dControl"
+ EmailSecuritySummaryMaliciousParamsDateRange12wControl EmailSecuritySummaryMaliciousParamsDateRange = "12wControl"
+ EmailSecuritySummaryMaliciousParamsDateRange24wControl EmailSecuritySummaryMaliciousParamsDateRange = "24wControl"
+)
+
+type EmailSecuritySummaryMaliciousParamsDKIM string
+
+const (
+ EmailSecuritySummaryMaliciousParamsDKIMPass EmailSecuritySummaryMaliciousParamsDKIM = "PASS"
+ EmailSecuritySummaryMaliciousParamsDKIMNone EmailSecuritySummaryMaliciousParamsDKIM = "NONE"
+ EmailSecuritySummaryMaliciousParamsDKIMFail EmailSecuritySummaryMaliciousParamsDKIM = "FAIL"
+)
+
+type EmailSecuritySummaryMaliciousParamsDMARC string
+
+const (
+ EmailSecuritySummaryMaliciousParamsDMARCPass EmailSecuritySummaryMaliciousParamsDMARC = "PASS"
+ EmailSecuritySummaryMaliciousParamsDMARCNone EmailSecuritySummaryMaliciousParamsDMARC = "NONE"
+ EmailSecuritySummaryMaliciousParamsDMARCFail EmailSecuritySummaryMaliciousParamsDMARC = "FAIL"
+)
+
+// Format results are returned in.
+type EmailSecuritySummaryMaliciousParamsFormat string
+
+const (
+ EmailSecuritySummaryMaliciousParamsFormatJson EmailSecuritySummaryMaliciousParamsFormat = "JSON"
+ EmailSecuritySummaryMaliciousParamsFormatCsv EmailSecuritySummaryMaliciousParamsFormat = "CSV"
+)
+
+type EmailSecuritySummaryMaliciousParamsSPF string
+
+const (
+ EmailSecuritySummaryMaliciousParamsSPFPass EmailSecuritySummaryMaliciousParamsSPF = "PASS"
+ EmailSecuritySummaryMaliciousParamsSPFNone EmailSecuritySummaryMaliciousParamsSPF = "NONE"
+ EmailSecuritySummaryMaliciousParamsSPFFail EmailSecuritySummaryMaliciousParamsSPF = "FAIL"
+)
+
+type EmailSecuritySummaryMaliciousParamsTLSVersion string
+
+const (
+ EmailSecuritySummaryMaliciousParamsTLSVersionTlSv1_0 EmailSecuritySummaryMaliciousParamsTLSVersion = "TLSv1_0"
+ EmailSecuritySummaryMaliciousParamsTLSVersionTlSv1_1 EmailSecuritySummaryMaliciousParamsTLSVersion = "TLSv1_1"
+ EmailSecuritySummaryMaliciousParamsTLSVersionTlSv1_2 EmailSecuritySummaryMaliciousParamsTLSVersion = "TLSv1_2"
+ EmailSecuritySummaryMaliciousParamsTLSVersionTlSv1_3 EmailSecuritySummaryMaliciousParamsTLSVersion = "TLSv1_3"
+)
+
+type EmailSecuritySummaryMaliciousResponseEnvelope struct {
+ Result EmailSecuritySummaryMaliciousResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON emailSecuritySummaryMaliciousResponseEnvelopeJSON `json:"-"`
+}
+
+// emailSecuritySummaryMaliciousResponseEnvelopeJSON contains the JSON metadata for
+// the struct [EmailSecuritySummaryMaliciousResponseEnvelope]
+type emailSecuritySummaryMaliciousResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecuritySummaryMaliciousResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecuritySummaryMaliciousResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecuritySummarySpamParams struct {
+ // Filter for arc (Authenticated Received Chain).
+ ARC param.Field[[]EmailSecuritySummarySpamParamsARC] `query:"arc"`
+ // 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[[]EmailSecuritySummarySpamParamsDateRange] `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[[]EmailSecuritySummarySpamParamsDKIM] `query:"dkim"`
+ // Filter for dmarc.
+ DMARC param.Field[[]EmailSecuritySummarySpamParamsDMARC] `query:"dmarc"`
+ // Format results are returned in.
+ Format param.Field[EmailSecuritySummarySpamParamsFormat] `query:"format"`
+ // 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[[]EmailSecuritySummarySpamParamsSPF] `query:"spf"`
+ // Filter for tls version.
+ TLSVersion param.Field[[]EmailSecuritySummarySpamParamsTLSVersion] `query:"tlsVersion"`
+}
+
+// URLQuery serializes [EmailSecuritySummarySpamParams]'s query parameters as
+// `url.Values`.
+func (r EmailSecuritySummarySpamParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type EmailSecuritySummarySpamParamsARC string
+
+const (
+ EmailSecuritySummarySpamParamsARCPass EmailSecuritySummarySpamParamsARC = "PASS"
+ EmailSecuritySummarySpamParamsARCNone EmailSecuritySummarySpamParamsARC = "NONE"
+ EmailSecuritySummarySpamParamsARCFail EmailSecuritySummarySpamParamsARC = "FAIL"
+)
+
+type EmailSecuritySummarySpamParamsDateRange string
+
+const (
+ EmailSecuritySummarySpamParamsDateRange1d EmailSecuritySummarySpamParamsDateRange = "1d"
+ EmailSecuritySummarySpamParamsDateRange2d EmailSecuritySummarySpamParamsDateRange = "2d"
+ EmailSecuritySummarySpamParamsDateRange7d EmailSecuritySummarySpamParamsDateRange = "7d"
+ EmailSecuritySummarySpamParamsDateRange14d EmailSecuritySummarySpamParamsDateRange = "14d"
+ EmailSecuritySummarySpamParamsDateRange28d EmailSecuritySummarySpamParamsDateRange = "28d"
+ EmailSecuritySummarySpamParamsDateRange12w EmailSecuritySummarySpamParamsDateRange = "12w"
+ EmailSecuritySummarySpamParamsDateRange24w EmailSecuritySummarySpamParamsDateRange = "24w"
+ EmailSecuritySummarySpamParamsDateRange52w EmailSecuritySummarySpamParamsDateRange = "52w"
+ EmailSecuritySummarySpamParamsDateRange1dControl EmailSecuritySummarySpamParamsDateRange = "1dControl"
+ EmailSecuritySummarySpamParamsDateRange2dControl EmailSecuritySummarySpamParamsDateRange = "2dControl"
+ EmailSecuritySummarySpamParamsDateRange7dControl EmailSecuritySummarySpamParamsDateRange = "7dControl"
+ EmailSecuritySummarySpamParamsDateRange14dControl EmailSecuritySummarySpamParamsDateRange = "14dControl"
+ EmailSecuritySummarySpamParamsDateRange28dControl EmailSecuritySummarySpamParamsDateRange = "28dControl"
+ EmailSecuritySummarySpamParamsDateRange12wControl EmailSecuritySummarySpamParamsDateRange = "12wControl"
+ EmailSecuritySummarySpamParamsDateRange24wControl EmailSecuritySummarySpamParamsDateRange = "24wControl"
+)
+
+type EmailSecuritySummarySpamParamsDKIM string
+
+const (
+ EmailSecuritySummarySpamParamsDKIMPass EmailSecuritySummarySpamParamsDKIM = "PASS"
+ EmailSecuritySummarySpamParamsDKIMNone EmailSecuritySummarySpamParamsDKIM = "NONE"
+ EmailSecuritySummarySpamParamsDKIMFail EmailSecuritySummarySpamParamsDKIM = "FAIL"
+)
+
+type EmailSecuritySummarySpamParamsDMARC string
+
+const (
+ EmailSecuritySummarySpamParamsDMARCPass EmailSecuritySummarySpamParamsDMARC = "PASS"
+ EmailSecuritySummarySpamParamsDMARCNone EmailSecuritySummarySpamParamsDMARC = "NONE"
+ EmailSecuritySummarySpamParamsDMARCFail EmailSecuritySummarySpamParamsDMARC = "FAIL"
+)
+
+// Format results are returned in.
+type EmailSecuritySummarySpamParamsFormat string
+
+const (
+ EmailSecuritySummarySpamParamsFormatJson EmailSecuritySummarySpamParamsFormat = "JSON"
+ EmailSecuritySummarySpamParamsFormatCsv EmailSecuritySummarySpamParamsFormat = "CSV"
+)
+
+type EmailSecuritySummarySpamParamsSPF string
+
+const (
+ EmailSecuritySummarySpamParamsSPFPass EmailSecuritySummarySpamParamsSPF = "PASS"
+ EmailSecuritySummarySpamParamsSPFNone EmailSecuritySummarySpamParamsSPF = "NONE"
+ EmailSecuritySummarySpamParamsSPFFail EmailSecuritySummarySpamParamsSPF = "FAIL"
+)
+
+type EmailSecuritySummarySpamParamsTLSVersion string
+
+const (
+ EmailSecuritySummarySpamParamsTLSVersionTlSv1_0 EmailSecuritySummarySpamParamsTLSVersion = "TLSv1_0"
+ EmailSecuritySummarySpamParamsTLSVersionTlSv1_1 EmailSecuritySummarySpamParamsTLSVersion = "TLSv1_1"
+ EmailSecuritySummarySpamParamsTLSVersionTlSv1_2 EmailSecuritySummarySpamParamsTLSVersion = "TLSv1_2"
+ EmailSecuritySummarySpamParamsTLSVersionTlSv1_3 EmailSecuritySummarySpamParamsTLSVersion = "TLSv1_3"
+)
+
+type EmailSecuritySummarySpamResponseEnvelope struct {
+ Result EmailSecuritySummarySpamResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON emailSecuritySummarySpamResponseEnvelopeJSON `json:"-"`
+}
+
+// emailSecuritySummarySpamResponseEnvelopeJSON contains the JSON metadata for the
+// struct [EmailSecuritySummarySpamResponseEnvelope]
+type emailSecuritySummarySpamResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecuritySummarySpamResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecuritySummarySpamResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecuritySummarySPFParams struct {
+ // Filter for arc (Authenticated Received Chain).
+ ARC param.Field[[]EmailSecuritySummarySPFParamsARC] `query:"arc"`
+ // 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[[]EmailSecuritySummarySPFParamsDateRange] `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[[]EmailSecuritySummarySPFParamsDKIM] `query:"dkim"`
+ // Filter for dmarc.
+ DMARC param.Field[[]EmailSecuritySummarySPFParamsDMARC] `query:"dmarc"`
+ // Format results are returned in.
+ Format param.Field[EmailSecuritySummarySPFParamsFormat] `query:"format"`
+ // 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[[]EmailSecuritySummarySPFParamsTLSVersion] `query:"tlsVersion"`
+}
+
+// URLQuery serializes [EmailSecuritySummarySPFParams]'s query parameters as
+// `url.Values`.
+func (r EmailSecuritySummarySPFParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type EmailSecuritySummarySPFParamsARC string
+
+const (
+ EmailSecuritySummarySPFParamsARCPass EmailSecuritySummarySPFParamsARC = "PASS"
+ EmailSecuritySummarySPFParamsARCNone EmailSecuritySummarySPFParamsARC = "NONE"
+ EmailSecuritySummarySPFParamsARCFail EmailSecuritySummarySPFParamsARC = "FAIL"
+)
+
+type EmailSecuritySummarySPFParamsDateRange string
+
+const (
+ EmailSecuritySummarySPFParamsDateRange1d EmailSecuritySummarySPFParamsDateRange = "1d"
+ EmailSecuritySummarySPFParamsDateRange2d EmailSecuritySummarySPFParamsDateRange = "2d"
+ EmailSecuritySummarySPFParamsDateRange7d EmailSecuritySummarySPFParamsDateRange = "7d"
+ EmailSecuritySummarySPFParamsDateRange14d EmailSecuritySummarySPFParamsDateRange = "14d"
+ EmailSecuritySummarySPFParamsDateRange28d EmailSecuritySummarySPFParamsDateRange = "28d"
+ EmailSecuritySummarySPFParamsDateRange12w EmailSecuritySummarySPFParamsDateRange = "12w"
+ EmailSecuritySummarySPFParamsDateRange24w EmailSecuritySummarySPFParamsDateRange = "24w"
+ EmailSecuritySummarySPFParamsDateRange52w EmailSecuritySummarySPFParamsDateRange = "52w"
+ EmailSecuritySummarySPFParamsDateRange1dControl EmailSecuritySummarySPFParamsDateRange = "1dControl"
+ EmailSecuritySummarySPFParamsDateRange2dControl EmailSecuritySummarySPFParamsDateRange = "2dControl"
+ EmailSecuritySummarySPFParamsDateRange7dControl EmailSecuritySummarySPFParamsDateRange = "7dControl"
+ EmailSecuritySummarySPFParamsDateRange14dControl EmailSecuritySummarySPFParamsDateRange = "14dControl"
+ EmailSecuritySummarySPFParamsDateRange28dControl EmailSecuritySummarySPFParamsDateRange = "28dControl"
+ EmailSecuritySummarySPFParamsDateRange12wControl EmailSecuritySummarySPFParamsDateRange = "12wControl"
+ EmailSecuritySummarySPFParamsDateRange24wControl EmailSecuritySummarySPFParamsDateRange = "24wControl"
+)
+
+type EmailSecuritySummarySPFParamsDKIM string
+
+const (
+ EmailSecuritySummarySPFParamsDKIMPass EmailSecuritySummarySPFParamsDKIM = "PASS"
+ EmailSecuritySummarySPFParamsDKIMNone EmailSecuritySummarySPFParamsDKIM = "NONE"
+ EmailSecuritySummarySPFParamsDKIMFail EmailSecuritySummarySPFParamsDKIM = "FAIL"
+)
+
+type EmailSecuritySummarySPFParamsDMARC string
+
+const (
+ EmailSecuritySummarySPFParamsDMARCPass EmailSecuritySummarySPFParamsDMARC = "PASS"
+ EmailSecuritySummarySPFParamsDMARCNone EmailSecuritySummarySPFParamsDMARC = "NONE"
+ EmailSecuritySummarySPFParamsDMARCFail EmailSecuritySummarySPFParamsDMARC = "FAIL"
+)
+
+// Format results are returned in.
+type EmailSecuritySummarySPFParamsFormat string
+
+const (
+ EmailSecuritySummarySPFParamsFormatJson EmailSecuritySummarySPFParamsFormat = "JSON"
+ EmailSecuritySummarySPFParamsFormatCsv EmailSecuritySummarySPFParamsFormat = "CSV"
+)
+
+type EmailSecuritySummarySPFParamsTLSVersion string
+
+const (
+ EmailSecuritySummarySPFParamsTLSVersionTlSv1_0 EmailSecuritySummarySPFParamsTLSVersion = "TLSv1_0"
+ EmailSecuritySummarySPFParamsTLSVersionTlSv1_1 EmailSecuritySummarySPFParamsTLSVersion = "TLSv1_1"
+ EmailSecuritySummarySPFParamsTLSVersionTlSv1_2 EmailSecuritySummarySPFParamsTLSVersion = "TLSv1_2"
+ EmailSecuritySummarySPFParamsTLSVersionTlSv1_3 EmailSecuritySummarySPFParamsTLSVersion = "TLSv1_3"
+)
+
+type EmailSecuritySummarySPFResponseEnvelope struct {
+ Result EmailSecuritySummarySPFResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON emailSecuritySummarySPFResponseEnvelopeJSON `json:"-"`
+}
+
+// emailSecuritySummarySPFResponseEnvelopeJSON contains the JSON metadata for the
+// struct [EmailSecuritySummarySPFResponseEnvelope]
+type emailSecuritySummarySPFResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecuritySummarySPFResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecuritySummarySPFResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecuritySummarySpoofParams struct {
+ // Filter for arc (Authenticated Received Chain).
+ ARC param.Field[[]EmailSecuritySummarySpoofParamsARC] `query:"arc"`
+ // 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[[]EmailSecuritySummarySpoofParamsDateRange] `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[[]EmailSecuritySummarySpoofParamsDKIM] `query:"dkim"`
+ // Filter for dmarc.
+ DMARC param.Field[[]EmailSecuritySummarySpoofParamsDMARC] `query:"dmarc"`
+ // Format results are returned in.
+ Format param.Field[EmailSecuritySummarySpoofParamsFormat] `query:"format"`
+ // 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[[]EmailSecuritySummarySpoofParamsSPF] `query:"spf"`
+ // Filter for tls version.
+ TLSVersion param.Field[[]EmailSecuritySummarySpoofParamsTLSVersion] `query:"tlsVersion"`
+}
+
+// URLQuery serializes [EmailSecuritySummarySpoofParams]'s query parameters as
+// `url.Values`.
+func (r EmailSecuritySummarySpoofParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type EmailSecuritySummarySpoofParamsARC string
+
+const (
+ EmailSecuritySummarySpoofParamsARCPass EmailSecuritySummarySpoofParamsARC = "PASS"
+ EmailSecuritySummarySpoofParamsARCNone EmailSecuritySummarySpoofParamsARC = "NONE"
+ EmailSecuritySummarySpoofParamsARCFail EmailSecuritySummarySpoofParamsARC = "FAIL"
+)
+
+type EmailSecuritySummarySpoofParamsDateRange string
+
+const (
+ EmailSecuritySummarySpoofParamsDateRange1d EmailSecuritySummarySpoofParamsDateRange = "1d"
+ EmailSecuritySummarySpoofParamsDateRange2d EmailSecuritySummarySpoofParamsDateRange = "2d"
+ EmailSecuritySummarySpoofParamsDateRange7d EmailSecuritySummarySpoofParamsDateRange = "7d"
+ EmailSecuritySummarySpoofParamsDateRange14d EmailSecuritySummarySpoofParamsDateRange = "14d"
+ EmailSecuritySummarySpoofParamsDateRange28d EmailSecuritySummarySpoofParamsDateRange = "28d"
+ EmailSecuritySummarySpoofParamsDateRange12w EmailSecuritySummarySpoofParamsDateRange = "12w"
+ EmailSecuritySummarySpoofParamsDateRange24w EmailSecuritySummarySpoofParamsDateRange = "24w"
+ EmailSecuritySummarySpoofParamsDateRange52w EmailSecuritySummarySpoofParamsDateRange = "52w"
+ EmailSecuritySummarySpoofParamsDateRange1dControl EmailSecuritySummarySpoofParamsDateRange = "1dControl"
+ EmailSecuritySummarySpoofParamsDateRange2dControl EmailSecuritySummarySpoofParamsDateRange = "2dControl"
+ EmailSecuritySummarySpoofParamsDateRange7dControl EmailSecuritySummarySpoofParamsDateRange = "7dControl"
+ EmailSecuritySummarySpoofParamsDateRange14dControl EmailSecuritySummarySpoofParamsDateRange = "14dControl"
+ EmailSecuritySummarySpoofParamsDateRange28dControl EmailSecuritySummarySpoofParamsDateRange = "28dControl"
+ EmailSecuritySummarySpoofParamsDateRange12wControl EmailSecuritySummarySpoofParamsDateRange = "12wControl"
+ EmailSecuritySummarySpoofParamsDateRange24wControl EmailSecuritySummarySpoofParamsDateRange = "24wControl"
+)
+
+type EmailSecuritySummarySpoofParamsDKIM string
+
+const (
+ EmailSecuritySummarySpoofParamsDKIMPass EmailSecuritySummarySpoofParamsDKIM = "PASS"
+ EmailSecuritySummarySpoofParamsDKIMNone EmailSecuritySummarySpoofParamsDKIM = "NONE"
+ EmailSecuritySummarySpoofParamsDKIMFail EmailSecuritySummarySpoofParamsDKIM = "FAIL"
+)
+
+type EmailSecuritySummarySpoofParamsDMARC string
+
+const (
+ EmailSecuritySummarySpoofParamsDMARCPass EmailSecuritySummarySpoofParamsDMARC = "PASS"
+ EmailSecuritySummarySpoofParamsDMARCNone EmailSecuritySummarySpoofParamsDMARC = "NONE"
+ EmailSecuritySummarySpoofParamsDMARCFail EmailSecuritySummarySpoofParamsDMARC = "FAIL"
+)
+
+// Format results are returned in.
+type EmailSecuritySummarySpoofParamsFormat string
+
+const (
+ EmailSecuritySummarySpoofParamsFormatJson EmailSecuritySummarySpoofParamsFormat = "JSON"
+ EmailSecuritySummarySpoofParamsFormatCsv EmailSecuritySummarySpoofParamsFormat = "CSV"
+)
+
+type EmailSecuritySummarySpoofParamsSPF string
+
+const (
+ EmailSecuritySummarySpoofParamsSPFPass EmailSecuritySummarySpoofParamsSPF = "PASS"
+ EmailSecuritySummarySpoofParamsSPFNone EmailSecuritySummarySpoofParamsSPF = "NONE"
+ EmailSecuritySummarySpoofParamsSPFFail EmailSecuritySummarySpoofParamsSPF = "FAIL"
+)
+
+type EmailSecuritySummarySpoofParamsTLSVersion string
+
+const (
+ EmailSecuritySummarySpoofParamsTLSVersionTlSv1_0 EmailSecuritySummarySpoofParamsTLSVersion = "TLSv1_0"
+ EmailSecuritySummarySpoofParamsTLSVersionTlSv1_1 EmailSecuritySummarySpoofParamsTLSVersion = "TLSv1_1"
+ EmailSecuritySummarySpoofParamsTLSVersionTlSv1_2 EmailSecuritySummarySpoofParamsTLSVersion = "TLSv1_2"
+ EmailSecuritySummarySpoofParamsTLSVersionTlSv1_3 EmailSecuritySummarySpoofParamsTLSVersion = "TLSv1_3"
+)
+
+type EmailSecuritySummarySpoofResponseEnvelope struct {
+ Result EmailSecuritySummarySpoofResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON emailSecuritySummarySpoofResponseEnvelopeJSON `json:"-"`
+}
+
+// emailSecuritySummarySpoofResponseEnvelopeJSON contains the JSON metadata for the
+// struct [EmailSecuritySummarySpoofResponseEnvelope]
+type emailSecuritySummarySpoofResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecuritySummarySpoofResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecuritySummarySpoofResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecuritySummaryThreatCategoryParams struct {
+ // Filter for arc (Authenticated Received Chain).
+ ARC param.Field[[]EmailSecuritySummaryThreatCategoryParamsARC] `query:"arc"`
+ // 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[[]EmailSecuritySummaryThreatCategoryParamsDateRange] `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[[]EmailSecuritySummaryThreatCategoryParamsDKIM] `query:"dkim"`
+ // Filter for dmarc.
+ DMARC param.Field[[]EmailSecuritySummaryThreatCategoryParamsDMARC] `query:"dmarc"`
+ // Format results are returned in.
+ Format param.Field[EmailSecuritySummaryThreatCategoryParamsFormat] `query:"format"`
+ // 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[[]EmailSecuritySummaryThreatCategoryParamsSPF] `query:"spf"`
+ // Filter for tls version.
+ TLSVersion param.Field[[]EmailSecuritySummaryThreatCategoryParamsTLSVersion] `query:"tlsVersion"`
+}
+
+// URLQuery serializes [EmailSecuritySummaryThreatCategoryParams]'s query
+// parameters as `url.Values`.
+func (r EmailSecuritySummaryThreatCategoryParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type EmailSecuritySummaryThreatCategoryParamsARC string
+
+const (
+ EmailSecuritySummaryThreatCategoryParamsARCPass EmailSecuritySummaryThreatCategoryParamsARC = "PASS"
+ EmailSecuritySummaryThreatCategoryParamsARCNone EmailSecuritySummaryThreatCategoryParamsARC = "NONE"
+ EmailSecuritySummaryThreatCategoryParamsARCFail EmailSecuritySummaryThreatCategoryParamsARC = "FAIL"
+)
+
+type EmailSecuritySummaryThreatCategoryParamsDateRange string
+
+const (
+ EmailSecuritySummaryThreatCategoryParamsDateRange1d EmailSecuritySummaryThreatCategoryParamsDateRange = "1d"
+ EmailSecuritySummaryThreatCategoryParamsDateRange2d EmailSecuritySummaryThreatCategoryParamsDateRange = "2d"
+ EmailSecuritySummaryThreatCategoryParamsDateRange7d EmailSecuritySummaryThreatCategoryParamsDateRange = "7d"
+ EmailSecuritySummaryThreatCategoryParamsDateRange14d EmailSecuritySummaryThreatCategoryParamsDateRange = "14d"
+ EmailSecuritySummaryThreatCategoryParamsDateRange28d EmailSecuritySummaryThreatCategoryParamsDateRange = "28d"
+ EmailSecuritySummaryThreatCategoryParamsDateRange12w EmailSecuritySummaryThreatCategoryParamsDateRange = "12w"
+ EmailSecuritySummaryThreatCategoryParamsDateRange24w EmailSecuritySummaryThreatCategoryParamsDateRange = "24w"
+ EmailSecuritySummaryThreatCategoryParamsDateRange52w EmailSecuritySummaryThreatCategoryParamsDateRange = "52w"
+ EmailSecuritySummaryThreatCategoryParamsDateRange1dControl EmailSecuritySummaryThreatCategoryParamsDateRange = "1dControl"
+ EmailSecuritySummaryThreatCategoryParamsDateRange2dControl EmailSecuritySummaryThreatCategoryParamsDateRange = "2dControl"
+ EmailSecuritySummaryThreatCategoryParamsDateRange7dControl EmailSecuritySummaryThreatCategoryParamsDateRange = "7dControl"
+ EmailSecuritySummaryThreatCategoryParamsDateRange14dControl EmailSecuritySummaryThreatCategoryParamsDateRange = "14dControl"
+ EmailSecuritySummaryThreatCategoryParamsDateRange28dControl EmailSecuritySummaryThreatCategoryParamsDateRange = "28dControl"
+ EmailSecuritySummaryThreatCategoryParamsDateRange12wControl EmailSecuritySummaryThreatCategoryParamsDateRange = "12wControl"
+ EmailSecuritySummaryThreatCategoryParamsDateRange24wControl EmailSecuritySummaryThreatCategoryParamsDateRange = "24wControl"
+)
+
+type EmailSecuritySummaryThreatCategoryParamsDKIM string
+
+const (
+ EmailSecuritySummaryThreatCategoryParamsDKIMPass EmailSecuritySummaryThreatCategoryParamsDKIM = "PASS"
+ EmailSecuritySummaryThreatCategoryParamsDKIMNone EmailSecuritySummaryThreatCategoryParamsDKIM = "NONE"
+ EmailSecuritySummaryThreatCategoryParamsDKIMFail EmailSecuritySummaryThreatCategoryParamsDKIM = "FAIL"
+)
+
+type EmailSecuritySummaryThreatCategoryParamsDMARC string
+
+const (
+ EmailSecuritySummaryThreatCategoryParamsDMARCPass EmailSecuritySummaryThreatCategoryParamsDMARC = "PASS"
+ EmailSecuritySummaryThreatCategoryParamsDMARCNone EmailSecuritySummaryThreatCategoryParamsDMARC = "NONE"
+ EmailSecuritySummaryThreatCategoryParamsDMARCFail EmailSecuritySummaryThreatCategoryParamsDMARC = "FAIL"
+)
+
+// Format results are returned in.
+type EmailSecuritySummaryThreatCategoryParamsFormat string
+
+const (
+ EmailSecuritySummaryThreatCategoryParamsFormatJson EmailSecuritySummaryThreatCategoryParamsFormat = "JSON"
+ EmailSecuritySummaryThreatCategoryParamsFormatCsv EmailSecuritySummaryThreatCategoryParamsFormat = "CSV"
+)
+
+type EmailSecuritySummaryThreatCategoryParamsSPF string
+
+const (
+ EmailSecuritySummaryThreatCategoryParamsSPFPass EmailSecuritySummaryThreatCategoryParamsSPF = "PASS"
+ EmailSecuritySummaryThreatCategoryParamsSPFNone EmailSecuritySummaryThreatCategoryParamsSPF = "NONE"
+ EmailSecuritySummaryThreatCategoryParamsSPFFail EmailSecuritySummaryThreatCategoryParamsSPF = "FAIL"
+)
+
+type EmailSecuritySummaryThreatCategoryParamsTLSVersion string
+
+const (
+ EmailSecuritySummaryThreatCategoryParamsTLSVersionTlSv1_0 EmailSecuritySummaryThreatCategoryParamsTLSVersion = "TLSv1_0"
+ EmailSecuritySummaryThreatCategoryParamsTLSVersionTlSv1_1 EmailSecuritySummaryThreatCategoryParamsTLSVersion = "TLSv1_1"
+ EmailSecuritySummaryThreatCategoryParamsTLSVersionTlSv1_2 EmailSecuritySummaryThreatCategoryParamsTLSVersion = "TLSv1_2"
+ EmailSecuritySummaryThreatCategoryParamsTLSVersionTlSv1_3 EmailSecuritySummaryThreatCategoryParamsTLSVersion = "TLSv1_3"
+)
+
+type EmailSecuritySummaryThreatCategoryResponseEnvelope struct {
+ Result EmailSecuritySummaryThreatCategoryResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON emailSecuritySummaryThreatCategoryResponseEnvelopeJSON `json:"-"`
+}
+
+// emailSecuritySummaryThreatCategoryResponseEnvelopeJSON contains the JSON
+// metadata for the struct [EmailSecuritySummaryThreatCategoryResponseEnvelope]
+type emailSecuritySummaryThreatCategoryResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecuritySummaryThreatCategoryResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecuritySummaryThreatCategoryResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecuritySummaryTLSVersionParams struct {
+ // Filter for arc (Authenticated Received Chain).
+ ARC param.Field[[]EmailSecuritySummaryTLSVersionParamsARC] `query:"arc"`
+ // 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[[]EmailSecuritySummaryTLSVersionParamsDateRange] `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[[]EmailSecuritySummaryTLSVersionParamsDKIM] `query:"dkim"`
+ // Filter for dmarc.
+ DMARC param.Field[[]EmailSecuritySummaryTLSVersionParamsDMARC] `query:"dmarc"`
+ // Format results are returned in.
+ Format param.Field[EmailSecuritySummaryTLSVersionParamsFormat] `query:"format"`
+ // 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[[]EmailSecuritySummaryTLSVersionParamsSPF] `query:"spf"`
+}
+
+// URLQuery serializes [EmailSecuritySummaryTLSVersionParams]'s query parameters as
+// `url.Values`.
+func (r EmailSecuritySummaryTLSVersionParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type EmailSecuritySummaryTLSVersionParamsARC string
+
+const (
+ EmailSecuritySummaryTLSVersionParamsARCPass EmailSecuritySummaryTLSVersionParamsARC = "PASS"
+ EmailSecuritySummaryTLSVersionParamsARCNone EmailSecuritySummaryTLSVersionParamsARC = "NONE"
+ EmailSecuritySummaryTLSVersionParamsARCFail EmailSecuritySummaryTLSVersionParamsARC = "FAIL"
+)
+
+type EmailSecuritySummaryTLSVersionParamsDateRange string
+
+const (
+ EmailSecuritySummaryTLSVersionParamsDateRange1d EmailSecuritySummaryTLSVersionParamsDateRange = "1d"
+ EmailSecuritySummaryTLSVersionParamsDateRange2d EmailSecuritySummaryTLSVersionParamsDateRange = "2d"
+ EmailSecuritySummaryTLSVersionParamsDateRange7d EmailSecuritySummaryTLSVersionParamsDateRange = "7d"
+ EmailSecuritySummaryTLSVersionParamsDateRange14d EmailSecuritySummaryTLSVersionParamsDateRange = "14d"
+ EmailSecuritySummaryTLSVersionParamsDateRange28d EmailSecuritySummaryTLSVersionParamsDateRange = "28d"
+ EmailSecuritySummaryTLSVersionParamsDateRange12w EmailSecuritySummaryTLSVersionParamsDateRange = "12w"
+ EmailSecuritySummaryTLSVersionParamsDateRange24w EmailSecuritySummaryTLSVersionParamsDateRange = "24w"
+ EmailSecuritySummaryTLSVersionParamsDateRange52w EmailSecuritySummaryTLSVersionParamsDateRange = "52w"
+ EmailSecuritySummaryTLSVersionParamsDateRange1dControl EmailSecuritySummaryTLSVersionParamsDateRange = "1dControl"
+ EmailSecuritySummaryTLSVersionParamsDateRange2dControl EmailSecuritySummaryTLSVersionParamsDateRange = "2dControl"
+ EmailSecuritySummaryTLSVersionParamsDateRange7dControl EmailSecuritySummaryTLSVersionParamsDateRange = "7dControl"
+ EmailSecuritySummaryTLSVersionParamsDateRange14dControl EmailSecuritySummaryTLSVersionParamsDateRange = "14dControl"
+ EmailSecuritySummaryTLSVersionParamsDateRange28dControl EmailSecuritySummaryTLSVersionParamsDateRange = "28dControl"
+ EmailSecuritySummaryTLSVersionParamsDateRange12wControl EmailSecuritySummaryTLSVersionParamsDateRange = "12wControl"
+ EmailSecuritySummaryTLSVersionParamsDateRange24wControl EmailSecuritySummaryTLSVersionParamsDateRange = "24wControl"
+)
+
+type EmailSecuritySummaryTLSVersionParamsDKIM string
+
+const (
+ EmailSecuritySummaryTLSVersionParamsDKIMPass EmailSecuritySummaryTLSVersionParamsDKIM = "PASS"
+ EmailSecuritySummaryTLSVersionParamsDKIMNone EmailSecuritySummaryTLSVersionParamsDKIM = "NONE"
+ EmailSecuritySummaryTLSVersionParamsDKIMFail EmailSecuritySummaryTLSVersionParamsDKIM = "FAIL"
+)
+
+type EmailSecuritySummaryTLSVersionParamsDMARC string
+
+const (
+ EmailSecuritySummaryTLSVersionParamsDMARCPass EmailSecuritySummaryTLSVersionParamsDMARC = "PASS"
+ EmailSecuritySummaryTLSVersionParamsDMARCNone EmailSecuritySummaryTLSVersionParamsDMARC = "NONE"
+ EmailSecuritySummaryTLSVersionParamsDMARCFail EmailSecuritySummaryTLSVersionParamsDMARC = "FAIL"
+)
+
+// Format results are returned in.
+type EmailSecuritySummaryTLSVersionParamsFormat string
+
+const (
+ EmailSecuritySummaryTLSVersionParamsFormatJson EmailSecuritySummaryTLSVersionParamsFormat = "JSON"
+ EmailSecuritySummaryTLSVersionParamsFormatCsv EmailSecuritySummaryTLSVersionParamsFormat = "CSV"
+)
+
+type EmailSecuritySummaryTLSVersionParamsSPF string
+
+const (
+ EmailSecuritySummaryTLSVersionParamsSPFPass EmailSecuritySummaryTLSVersionParamsSPF = "PASS"
+ EmailSecuritySummaryTLSVersionParamsSPFNone EmailSecuritySummaryTLSVersionParamsSPF = "NONE"
+ EmailSecuritySummaryTLSVersionParamsSPFFail EmailSecuritySummaryTLSVersionParamsSPF = "FAIL"
+)
+
+type EmailSecuritySummaryTLSVersionResponseEnvelope struct {
+ Result EmailSecuritySummaryTLSVersionResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON emailSecuritySummaryTLSVersionResponseEnvelopeJSON `json:"-"`
+}
+
+// emailSecuritySummaryTLSVersionResponseEnvelopeJSON contains the JSON metadata
+// for the struct [EmailSecuritySummaryTLSVersionResponseEnvelope]
+type emailSecuritySummaryTLSVersionResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecuritySummaryTLSVersionResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecuritySummaryTLSVersionResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/radar/emailsecuritysummary_test.go b/radar/emailsecuritysummary_test.go
new file mode 100644
index 00000000000..89cbbdd5efe
--- /dev/null
+++ b/radar/emailsecuritysummary_test.go
@@ -0,0 +1,326 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/radar"
+)
+
+func TestEmailSecuritySummaryARCWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Email.Security.Summary.ARC(context.TODO(), radar.EmailSecuritySummaryARCParams{
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.EmailSecuritySummaryARCParamsDateRange{radar.EmailSecuritySummaryARCParamsDateRange1d, radar.EmailSecuritySummaryARCParamsDateRange2d, radar.EmailSecuritySummaryARCParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DKIM: cloudflare.F([]radar.EmailSecuritySummaryARCParamsDKIM{radar.EmailSecuritySummaryARCParamsDKIMPass, radar.EmailSecuritySummaryARCParamsDKIMNone, radar.EmailSecuritySummaryARCParamsDKIMFail}),
+ DMARC: cloudflare.F([]radar.EmailSecuritySummaryARCParamsDMARC{radar.EmailSecuritySummaryARCParamsDMARCPass, radar.EmailSecuritySummaryARCParamsDMARCNone, radar.EmailSecuritySummaryARCParamsDMARCFail}),
+ Format: cloudflare.F(radar.EmailSecuritySummaryARCParamsFormatJson),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ SPF: cloudflare.F([]radar.EmailSecuritySummaryARCParamsSPF{radar.EmailSecuritySummaryARCParamsSPFPass, radar.EmailSecuritySummaryARCParamsSPFNone, radar.EmailSecuritySummaryARCParamsSPFFail}),
+ TLSVersion: cloudflare.F([]radar.EmailSecuritySummaryARCParamsTLSVersion{radar.EmailSecuritySummaryARCParamsTLSVersionTlSv1_0, radar.EmailSecuritySummaryARCParamsTLSVersionTlSv1_1, radar.EmailSecuritySummaryARCParamsTLSVersionTlSv1_2}),
+ })
+ 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())
+ }
+}
+
+func TestEmailSecuritySummaryDKIMWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Email.Security.Summary.DKIM(context.TODO(), radar.EmailSecuritySummaryDKIMParams{
+ ARC: cloudflare.F([]radar.EmailSecuritySummaryDKIMParamsARC{radar.EmailSecuritySummaryDKIMParamsARCPass, radar.EmailSecuritySummaryDKIMParamsARCNone, radar.EmailSecuritySummaryDKIMParamsARCFail}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.EmailSecuritySummaryDKIMParamsDateRange{radar.EmailSecuritySummaryDKIMParamsDateRange1d, radar.EmailSecuritySummaryDKIMParamsDateRange2d, radar.EmailSecuritySummaryDKIMParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DMARC: cloudflare.F([]radar.EmailSecuritySummaryDKIMParamsDMARC{radar.EmailSecuritySummaryDKIMParamsDMARCPass, radar.EmailSecuritySummaryDKIMParamsDMARCNone, radar.EmailSecuritySummaryDKIMParamsDMARCFail}),
+ Format: cloudflare.F(radar.EmailSecuritySummaryDKIMParamsFormatJson),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ SPF: cloudflare.F([]radar.EmailSecuritySummaryDKIMParamsSPF{radar.EmailSecuritySummaryDKIMParamsSPFPass, radar.EmailSecuritySummaryDKIMParamsSPFNone, radar.EmailSecuritySummaryDKIMParamsSPFFail}),
+ TLSVersion: cloudflare.F([]radar.EmailSecuritySummaryDKIMParamsTLSVersion{radar.EmailSecuritySummaryDKIMParamsTLSVersionTlSv1_0, radar.EmailSecuritySummaryDKIMParamsTLSVersionTlSv1_1, radar.EmailSecuritySummaryDKIMParamsTLSVersionTlSv1_2}),
+ })
+ 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())
+ }
+}
+
+func TestEmailSecuritySummaryDMARCWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Email.Security.Summary.DMARC(context.TODO(), radar.EmailSecuritySummaryDMARCParams{
+ ARC: cloudflare.F([]radar.EmailSecuritySummaryDMARCParamsARC{radar.EmailSecuritySummaryDMARCParamsARCPass, radar.EmailSecuritySummaryDMARCParamsARCNone, radar.EmailSecuritySummaryDMARCParamsARCFail}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.EmailSecuritySummaryDMARCParamsDateRange{radar.EmailSecuritySummaryDMARCParamsDateRange1d, radar.EmailSecuritySummaryDMARCParamsDateRange2d, radar.EmailSecuritySummaryDMARCParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DKIM: cloudflare.F([]radar.EmailSecuritySummaryDMARCParamsDKIM{radar.EmailSecuritySummaryDMARCParamsDKIMPass, radar.EmailSecuritySummaryDMARCParamsDKIMNone, radar.EmailSecuritySummaryDMARCParamsDKIMFail}),
+ Format: cloudflare.F(radar.EmailSecuritySummaryDMARCParamsFormatJson),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ SPF: cloudflare.F([]radar.EmailSecuritySummaryDMARCParamsSPF{radar.EmailSecuritySummaryDMARCParamsSPFPass, radar.EmailSecuritySummaryDMARCParamsSPFNone, radar.EmailSecuritySummaryDMARCParamsSPFFail}),
+ TLSVersion: cloudflare.F([]radar.EmailSecuritySummaryDMARCParamsTLSVersion{radar.EmailSecuritySummaryDMARCParamsTLSVersionTlSv1_0, radar.EmailSecuritySummaryDMARCParamsTLSVersionTlSv1_1, radar.EmailSecuritySummaryDMARCParamsTLSVersionTlSv1_2}),
+ })
+ 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())
+ }
+}
+
+func TestEmailSecuritySummaryMaliciousWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Email.Security.Summary.Malicious(context.TODO(), radar.EmailSecuritySummaryMaliciousParams{
+ ARC: cloudflare.F([]radar.EmailSecuritySummaryMaliciousParamsARC{radar.EmailSecuritySummaryMaliciousParamsARCPass, radar.EmailSecuritySummaryMaliciousParamsARCNone, radar.EmailSecuritySummaryMaliciousParamsARCFail}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.EmailSecuritySummaryMaliciousParamsDateRange{radar.EmailSecuritySummaryMaliciousParamsDateRange1d, radar.EmailSecuritySummaryMaliciousParamsDateRange2d, radar.EmailSecuritySummaryMaliciousParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DKIM: cloudflare.F([]radar.EmailSecuritySummaryMaliciousParamsDKIM{radar.EmailSecuritySummaryMaliciousParamsDKIMPass, radar.EmailSecuritySummaryMaliciousParamsDKIMNone, radar.EmailSecuritySummaryMaliciousParamsDKIMFail}),
+ DMARC: cloudflare.F([]radar.EmailSecuritySummaryMaliciousParamsDMARC{radar.EmailSecuritySummaryMaliciousParamsDMARCPass, radar.EmailSecuritySummaryMaliciousParamsDMARCNone, radar.EmailSecuritySummaryMaliciousParamsDMARCFail}),
+ Format: cloudflare.F(radar.EmailSecuritySummaryMaliciousParamsFormatJson),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ SPF: cloudflare.F([]radar.EmailSecuritySummaryMaliciousParamsSPF{radar.EmailSecuritySummaryMaliciousParamsSPFPass, radar.EmailSecuritySummaryMaliciousParamsSPFNone, radar.EmailSecuritySummaryMaliciousParamsSPFFail}),
+ TLSVersion: cloudflare.F([]radar.EmailSecuritySummaryMaliciousParamsTLSVersion{radar.EmailSecuritySummaryMaliciousParamsTLSVersionTlSv1_0, radar.EmailSecuritySummaryMaliciousParamsTLSVersionTlSv1_1, radar.EmailSecuritySummaryMaliciousParamsTLSVersionTlSv1_2}),
+ })
+ 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())
+ }
+}
+
+func TestEmailSecuritySummarySpamWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Email.Security.Summary.Spam(context.TODO(), radar.EmailSecuritySummarySpamParams{
+ ARC: cloudflare.F([]radar.EmailSecuritySummarySpamParamsARC{radar.EmailSecuritySummarySpamParamsARCPass, radar.EmailSecuritySummarySpamParamsARCNone, radar.EmailSecuritySummarySpamParamsARCFail}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.EmailSecuritySummarySpamParamsDateRange{radar.EmailSecuritySummarySpamParamsDateRange1d, radar.EmailSecuritySummarySpamParamsDateRange2d, radar.EmailSecuritySummarySpamParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DKIM: cloudflare.F([]radar.EmailSecuritySummarySpamParamsDKIM{radar.EmailSecuritySummarySpamParamsDKIMPass, radar.EmailSecuritySummarySpamParamsDKIMNone, radar.EmailSecuritySummarySpamParamsDKIMFail}),
+ DMARC: cloudflare.F([]radar.EmailSecuritySummarySpamParamsDMARC{radar.EmailSecuritySummarySpamParamsDMARCPass, radar.EmailSecuritySummarySpamParamsDMARCNone, radar.EmailSecuritySummarySpamParamsDMARCFail}),
+ Format: cloudflare.F(radar.EmailSecuritySummarySpamParamsFormatJson),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ SPF: cloudflare.F([]radar.EmailSecuritySummarySpamParamsSPF{radar.EmailSecuritySummarySpamParamsSPFPass, radar.EmailSecuritySummarySpamParamsSPFNone, radar.EmailSecuritySummarySpamParamsSPFFail}),
+ TLSVersion: cloudflare.F([]radar.EmailSecuritySummarySpamParamsTLSVersion{radar.EmailSecuritySummarySpamParamsTLSVersionTlSv1_0, radar.EmailSecuritySummarySpamParamsTLSVersionTlSv1_1, radar.EmailSecuritySummarySpamParamsTLSVersionTlSv1_2}),
+ })
+ 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())
+ }
+}
+
+func TestEmailSecuritySummarySPFWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Email.Security.Summary.SPF(context.TODO(), radar.EmailSecuritySummarySPFParams{
+ ARC: cloudflare.F([]radar.EmailSecuritySummarySPFParamsARC{radar.EmailSecuritySummarySPFParamsARCPass, radar.EmailSecuritySummarySPFParamsARCNone, radar.EmailSecuritySummarySPFParamsARCFail}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.EmailSecuritySummarySPFParamsDateRange{radar.EmailSecuritySummarySPFParamsDateRange1d, radar.EmailSecuritySummarySPFParamsDateRange2d, radar.EmailSecuritySummarySPFParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DKIM: cloudflare.F([]radar.EmailSecuritySummarySPFParamsDKIM{radar.EmailSecuritySummarySPFParamsDKIMPass, radar.EmailSecuritySummarySPFParamsDKIMNone, radar.EmailSecuritySummarySPFParamsDKIMFail}),
+ DMARC: cloudflare.F([]radar.EmailSecuritySummarySPFParamsDMARC{radar.EmailSecuritySummarySPFParamsDMARCPass, radar.EmailSecuritySummarySPFParamsDMARCNone, radar.EmailSecuritySummarySPFParamsDMARCFail}),
+ Format: cloudflare.F(radar.EmailSecuritySummarySPFParamsFormatJson),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ TLSVersion: cloudflare.F([]radar.EmailSecuritySummarySPFParamsTLSVersion{radar.EmailSecuritySummarySPFParamsTLSVersionTlSv1_0, radar.EmailSecuritySummarySPFParamsTLSVersionTlSv1_1, radar.EmailSecuritySummarySPFParamsTLSVersionTlSv1_2}),
+ })
+ 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())
+ }
+}
+
+func TestEmailSecuritySummarySpoofWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Email.Security.Summary.Spoof(context.TODO(), radar.EmailSecuritySummarySpoofParams{
+ ARC: cloudflare.F([]radar.EmailSecuritySummarySpoofParamsARC{radar.EmailSecuritySummarySpoofParamsARCPass, radar.EmailSecuritySummarySpoofParamsARCNone, radar.EmailSecuritySummarySpoofParamsARCFail}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.EmailSecuritySummarySpoofParamsDateRange{radar.EmailSecuritySummarySpoofParamsDateRange1d, radar.EmailSecuritySummarySpoofParamsDateRange2d, radar.EmailSecuritySummarySpoofParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DKIM: cloudflare.F([]radar.EmailSecuritySummarySpoofParamsDKIM{radar.EmailSecuritySummarySpoofParamsDKIMPass, radar.EmailSecuritySummarySpoofParamsDKIMNone, radar.EmailSecuritySummarySpoofParamsDKIMFail}),
+ DMARC: cloudflare.F([]radar.EmailSecuritySummarySpoofParamsDMARC{radar.EmailSecuritySummarySpoofParamsDMARCPass, radar.EmailSecuritySummarySpoofParamsDMARCNone, radar.EmailSecuritySummarySpoofParamsDMARCFail}),
+ Format: cloudflare.F(radar.EmailSecuritySummarySpoofParamsFormatJson),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ SPF: cloudflare.F([]radar.EmailSecuritySummarySpoofParamsSPF{radar.EmailSecuritySummarySpoofParamsSPFPass, radar.EmailSecuritySummarySpoofParamsSPFNone, radar.EmailSecuritySummarySpoofParamsSPFFail}),
+ TLSVersion: cloudflare.F([]radar.EmailSecuritySummarySpoofParamsTLSVersion{radar.EmailSecuritySummarySpoofParamsTLSVersionTlSv1_0, radar.EmailSecuritySummarySpoofParamsTLSVersionTlSv1_1, radar.EmailSecuritySummarySpoofParamsTLSVersionTlSv1_2}),
+ })
+ 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())
+ }
+}
+
+func TestEmailSecuritySummaryThreatCategoryWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Email.Security.Summary.ThreatCategory(context.TODO(), radar.EmailSecuritySummaryThreatCategoryParams{
+ ARC: cloudflare.F([]radar.EmailSecuritySummaryThreatCategoryParamsARC{radar.EmailSecuritySummaryThreatCategoryParamsARCPass, radar.EmailSecuritySummaryThreatCategoryParamsARCNone, radar.EmailSecuritySummaryThreatCategoryParamsARCFail}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.EmailSecuritySummaryThreatCategoryParamsDateRange{radar.EmailSecuritySummaryThreatCategoryParamsDateRange1d, radar.EmailSecuritySummaryThreatCategoryParamsDateRange2d, radar.EmailSecuritySummaryThreatCategoryParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DKIM: cloudflare.F([]radar.EmailSecuritySummaryThreatCategoryParamsDKIM{radar.EmailSecuritySummaryThreatCategoryParamsDKIMPass, radar.EmailSecuritySummaryThreatCategoryParamsDKIMNone, radar.EmailSecuritySummaryThreatCategoryParamsDKIMFail}),
+ DMARC: cloudflare.F([]radar.EmailSecuritySummaryThreatCategoryParamsDMARC{radar.EmailSecuritySummaryThreatCategoryParamsDMARCPass, radar.EmailSecuritySummaryThreatCategoryParamsDMARCNone, radar.EmailSecuritySummaryThreatCategoryParamsDMARCFail}),
+ Format: cloudflare.F(radar.EmailSecuritySummaryThreatCategoryParamsFormatJson),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ SPF: cloudflare.F([]radar.EmailSecuritySummaryThreatCategoryParamsSPF{radar.EmailSecuritySummaryThreatCategoryParamsSPFPass, radar.EmailSecuritySummaryThreatCategoryParamsSPFNone, radar.EmailSecuritySummaryThreatCategoryParamsSPFFail}),
+ TLSVersion: cloudflare.F([]radar.EmailSecuritySummaryThreatCategoryParamsTLSVersion{radar.EmailSecuritySummaryThreatCategoryParamsTLSVersionTlSv1_0, radar.EmailSecuritySummaryThreatCategoryParamsTLSVersionTlSv1_1, radar.EmailSecuritySummaryThreatCategoryParamsTLSVersionTlSv1_2}),
+ })
+ 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())
+ }
+}
+
+func TestEmailSecuritySummaryTLSVersionWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Email.Security.Summary.TLSVersion(context.TODO(), radar.EmailSecuritySummaryTLSVersionParams{
+ ARC: cloudflare.F([]radar.EmailSecuritySummaryTLSVersionParamsARC{radar.EmailSecuritySummaryTLSVersionParamsARCPass, radar.EmailSecuritySummaryTLSVersionParamsARCNone, radar.EmailSecuritySummaryTLSVersionParamsARCFail}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.EmailSecuritySummaryTLSVersionParamsDateRange{radar.EmailSecuritySummaryTLSVersionParamsDateRange1d, radar.EmailSecuritySummaryTLSVersionParamsDateRange2d, radar.EmailSecuritySummaryTLSVersionParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DKIM: cloudflare.F([]radar.EmailSecuritySummaryTLSVersionParamsDKIM{radar.EmailSecuritySummaryTLSVersionParamsDKIMPass, radar.EmailSecuritySummaryTLSVersionParamsDKIMNone, radar.EmailSecuritySummaryTLSVersionParamsDKIMFail}),
+ DMARC: cloudflare.F([]radar.EmailSecuritySummaryTLSVersionParamsDMARC{radar.EmailSecuritySummaryTLSVersionParamsDMARCPass, radar.EmailSecuritySummaryTLSVersionParamsDMARCNone, radar.EmailSecuritySummaryTLSVersionParamsDMARCFail}),
+ Format: cloudflare.F(radar.EmailSecuritySummaryTLSVersionParamsFormatJson),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ SPF: cloudflare.F([]radar.EmailSecuritySummaryTLSVersionParamsSPF{radar.EmailSecuritySummaryTLSVersionParamsSPFPass, radar.EmailSecuritySummaryTLSVersionParamsSPFNone, radar.EmailSecuritySummaryTLSVersionParamsSPFFail}),
+ })
+ 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/radar/emailsecuritytimeseriesgroup.go b/radar/emailsecuritytimeseriesgroup.go
new file mode 100644
index 00000000000..bc08ba538f2
--- /dev/null
+++ b/radar/emailsecuritytimeseriesgroup.go
@@ -0,0 +1,1810 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "context"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// EmailSecurityTimeseriesGroupService contains methods and other services that
+// help with interacting with the cloudflare API. Note, unlike clients, this
+// service does not read variables from the environment automatically. You should
+// not instantiate this service directly, and instead use the
+// [NewEmailSecurityTimeseriesGroupService] method instead.
+type EmailSecurityTimeseriesGroupService struct {
+ Options []option.RequestOption
+}
+
+// NewEmailSecurityTimeseriesGroupService generates a new service that applies the
+// given options to each request. These options are applied after the parent
+// client's options (if there is one), and before any request-specific options.
+func NewEmailSecurityTimeseriesGroupService(opts ...option.RequestOption) (r *EmailSecurityTimeseriesGroupService) {
+ r = &EmailSecurityTimeseriesGroupService{}
+ r.Options = opts
+ return
+}
+
+// Percentage distribution of emails classified per Arc validation over time.
+func (r *EmailSecurityTimeseriesGroupService) ARC(ctx context.Context, query EmailSecurityTimeseriesGroupARCParams, opts ...option.RequestOption) (res *EmailSecurityTimeseriesGroupARCResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env EmailSecurityTimeseriesGroupARCResponseEnvelope
+ path := "radar/email/security/timeseries_groups/arc"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Percentage distribution of emails classified per DKIM validation over time.
+func (r *EmailSecurityTimeseriesGroupService) DKIM(ctx context.Context, query EmailSecurityTimeseriesGroupDKIMParams, opts ...option.RequestOption) (res *EmailSecurityTimeseriesGroupDKIMResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env EmailSecurityTimeseriesGroupDKIMResponseEnvelope
+ path := "radar/email/security/timeseries_groups/dkim"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Percentage distribution of emails classified per DMARC validation over time.
+func (r *EmailSecurityTimeseriesGroupService) DMARC(ctx context.Context, query EmailSecurityTimeseriesGroupDMARCParams, opts ...option.RequestOption) (res *EmailSecurityTimeseriesGroupDMARCResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env EmailSecurityTimeseriesGroupDMARCResponseEnvelope
+ path := "radar/email/security/timeseries_groups/dmarc"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Percentage distribution of emails classified as MALICIOUS over time.
+func (r *EmailSecurityTimeseriesGroupService) Malicious(ctx context.Context, query EmailSecurityTimeseriesGroupMaliciousParams, opts ...option.RequestOption) (res *EmailSecurityTimeseriesGroupMaliciousResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env EmailSecurityTimeseriesGroupMaliciousResponseEnvelope
+ path := "radar/email/security/timeseries_groups/malicious"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Percentage distribution of emails classified as SPAM over time.
+func (r *EmailSecurityTimeseriesGroupService) Spam(ctx context.Context, query EmailSecurityTimeseriesGroupSpamParams, opts ...option.RequestOption) (res *EmailSecurityTimeseriesGroupSpamResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env EmailSecurityTimeseriesGroupSpamResponseEnvelope
+ path := "radar/email/security/timeseries_groups/spam"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Percentage distribution of emails classified per SPF validation over time.
+func (r *EmailSecurityTimeseriesGroupService) SPF(ctx context.Context, query EmailSecurityTimeseriesGroupSPFParams, opts ...option.RequestOption) (res *EmailSecurityTimeseriesGroupSPFResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env EmailSecurityTimeseriesGroupSPFResponseEnvelope
+ path := "radar/email/security/timeseries_groups/spf"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Percentage distribution of emails classified as SPOOF over time.
+func (r *EmailSecurityTimeseriesGroupService) Spoof(ctx context.Context, query EmailSecurityTimeseriesGroupSpoofParams, opts ...option.RequestOption) (res *EmailSecurityTimeseriesGroupSpoofResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env EmailSecurityTimeseriesGroupSpoofResponseEnvelope
+ path := "radar/email/security/timeseries_groups/spoof"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Percentage distribution of emails classified in Threat Categories over time.
+func (r *EmailSecurityTimeseriesGroupService) ThreatCategory(ctx context.Context, query EmailSecurityTimeseriesGroupThreatCategoryParams, opts ...option.RequestOption) (res *EmailSecurityTimeseriesGroupThreatCategoryResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env EmailSecurityTimeseriesGroupThreatCategoryResponseEnvelope
+ path := "radar/email/security/timeseries_groups/threat_category"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Percentage distribution of emails classified per TLS Version over time.
+func (r *EmailSecurityTimeseriesGroupService) TLSVersion(ctx context.Context, query EmailSecurityTimeseriesGroupTLSVersionParams, opts ...option.RequestOption) (res *EmailSecurityTimeseriesGroupTLSVersionResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env EmailSecurityTimeseriesGroupTLSVersionResponseEnvelope
+ path := "radar/email/security/timeseries_groups/tls_version"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type EmailSecurityTimeseriesGroupARCResponse struct {
+ Meta interface{} `json:"meta,required"`
+ Serie0 EmailSecurityTimeseriesGroupARCResponseSerie0 `json:"serie_0,required"`
+ JSON emailSecurityTimeseriesGroupARCResponseJSON `json:"-"`
+}
+
+// emailSecurityTimeseriesGroupARCResponseJSON contains the JSON metadata for the
+// struct [EmailSecurityTimeseriesGroupARCResponse]
+type emailSecurityTimeseriesGroupARCResponseJSON struct {
+ Meta apijson.Field
+ Serie0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecurityTimeseriesGroupARCResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecurityTimeseriesGroupARCResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecurityTimeseriesGroupARCResponseSerie0 struct {
+ Fail []string `json:"FAIL,required"`
+ None []string `json:"NONE,required"`
+ Pass []string `json:"PASS,required"`
+ JSON emailSecurityTimeseriesGroupARCResponseSerie0JSON `json:"-"`
+}
+
+// emailSecurityTimeseriesGroupARCResponseSerie0JSON contains the JSON metadata for
+// the struct [EmailSecurityTimeseriesGroupARCResponseSerie0]
+type emailSecurityTimeseriesGroupARCResponseSerie0JSON struct {
+ Fail apijson.Field
+ None apijson.Field
+ Pass apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecurityTimeseriesGroupARCResponseSerie0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecurityTimeseriesGroupARCResponseSerie0JSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecurityTimeseriesGroupDKIMResponse struct {
+ Meta interface{} `json:"meta,required"`
+ Serie0 EmailSecurityTimeseriesGroupDKIMResponseSerie0 `json:"serie_0,required"`
+ JSON emailSecurityTimeseriesGroupDKIMResponseJSON `json:"-"`
+}
+
+// emailSecurityTimeseriesGroupDKIMResponseJSON contains the JSON metadata for the
+// struct [EmailSecurityTimeseriesGroupDKIMResponse]
+type emailSecurityTimeseriesGroupDKIMResponseJSON struct {
+ Meta apijson.Field
+ Serie0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecurityTimeseriesGroupDKIMResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecurityTimeseriesGroupDKIMResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecurityTimeseriesGroupDKIMResponseSerie0 struct {
+ Fail []string `json:"FAIL,required"`
+ None []string `json:"NONE,required"`
+ Pass []string `json:"PASS,required"`
+ JSON emailSecurityTimeseriesGroupDKIMResponseSerie0JSON `json:"-"`
+}
+
+// emailSecurityTimeseriesGroupDKIMResponseSerie0JSON contains the JSON metadata
+// for the struct [EmailSecurityTimeseriesGroupDKIMResponseSerie0]
+type emailSecurityTimeseriesGroupDKIMResponseSerie0JSON struct {
+ Fail apijson.Field
+ None apijson.Field
+ Pass apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecurityTimeseriesGroupDKIMResponseSerie0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecurityTimeseriesGroupDKIMResponseSerie0JSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecurityTimeseriesGroupDMARCResponse struct {
+ Meta interface{} `json:"meta,required"`
+ Serie0 EmailSecurityTimeseriesGroupDMARCResponseSerie0 `json:"serie_0,required"`
+ JSON emailSecurityTimeseriesGroupDMARCResponseJSON `json:"-"`
+}
+
+// emailSecurityTimeseriesGroupDMARCResponseJSON contains the JSON metadata for the
+// struct [EmailSecurityTimeseriesGroupDMARCResponse]
+type emailSecurityTimeseriesGroupDMARCResponseJSON struct {
+ Meta apijson.Field
+ Serie0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecurityTimeseriesGroupDMARCResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecurityTimeseriesGroupDMARCResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecurityTimeseriesGroupDMARCResponseSerie0 struct {
+ Fail []string `json:"FAIL,required"`
+ None []string `json:"NONE,required"`
+ Pass []string `json:"PASS,required"`
+ JSON emailSecurityTimeseriesGroupDMARCResponseSerie0JSON `json:"-"`
+}
+
+// emailSecurityTimeseriesGroupDMARCResponseSerie0JSON contains the JSON metadata
+// for the struct [EmailSecurityTimeseriesGroupDMARCResponseSerie0]
+type emailSecurityTimeseriesGroupDMARCResponseSerie0JSON struct {
+ Fail apijson.Field
+ None apijson.Field
+ Pass apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecurityTimeseriesGroupDMARCResponseSerie0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecurityTimeseriesGroupDMARCResponseSerie0JSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecurityTimeseriesGroupMaliciousResponse struct {
+ Meta interface{} `json:"meta,required"`
+ Serie0 EmailSecurityTimeseriesGroupMaliciousResponseSerie0 `json:"serie_0,required"`
+ JSON emailSecurityTimeseriesGroupMaliciousResponseJSON `json:"-"`
+}
+
+// emailSecurityTimeseriesGroupMaliciousResponseJSON contains the JSON metadata for
+// the struct [EmailSecurityTimeseriesGroupMaliciousResponse]
+type emailSecurityTimeseriesGroupMaliciousResponseJSON struct {
+ Meta apijson.Field
+ Serie0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecurityTimeseriesGroupMaliciousResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecurityTimeseriesGroupMaliciousResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecurityTimeseriesGroupMaliciousResponseSerie0 struct {
+ Malicious []string `json:"MALICIOUS,required"`
+ NotMalicious []string `json:"NOT_MALICIOUS,required"`
+ JSON emailSecurityTimeseriesGroupMaliciousResponseSerie0JSON `json:"-"`
+}
+
+// emailSecurityTimeseriesGroupMaliciousResponseSerie0JSON contains the JSON
+// metadata for the struct [EmailSecurityTimeseriesGroupMaliciousResponseSerie0]
+type emailSecurityTimeseriesGroupMaliciousResponseSerie0JSON struct {
+ Malicious apijson.Field
+ NotMalicious apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecurityTimeseriesGroupMaliciousResponseSerie0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecurityTimeseriesGroupMaliciousResponseSerie0JSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecurityTimeseriesGroupSpamResponse struct {
+ Meta interface{} `json:"meta,required"`
+ Serie0 EmailSecurityTimeseriesGroupSpamResponseSerie0 `json:"serie_0,required"`
+ JSON emailSecurityTimeseriesGroupSpamResponseJSON `json:"-"`
+}
+
+// emailSecurityTimeseriesGroupSpamResponseJSON contains the JSON metadata for the
+// struct [EmailSecurityTimeseriesGroupSpamResponse]
+type emailSecurityTimeseriesGroupSpamResponseJSON struct {
+ Meta apijson.Field
+ Serie0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecurityTimeseriesGroupSpamResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecurityTimeseriesGroupSpamResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecurityTimeseriesGroupSpamResponseSerie0 struct {
+ NotSpam []string `json:"NOT_SPAM,required"`
+ Spam []string `json:"SPAM,required"`
+ JSON emailSecurityTimeseriesGroupSpamResponseSerie0JSON `json:"-"`
+}
+
+// emailSecurityTimeseriesGroupSpamResponseSerie0JSON contains the JSON metadata
+// for the struct [EmailSecurityTimeseriesGroupSpamResponseSerie0]
+type emailSecurityTimeseriesGroupSpamResponseSerie0JSON struct {
+ NotSpam apijson.Field
+ Spam apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecurityTimeseriesGroupSpamResponseSerie0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecurityTimeseriesGroupSpamResponseSerie0JSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecurityTimeseriesGroupSPFResponse struct {
+ Meta interface{} `json:"meta,required"`
+ Serie0 EmailSecurityTimeseriesGroupSPFResponseSerie0 `json:"serie_0,required"`
+ JSON emailSecurityTimeseriesGroupSPFResponseJSON `json:"-"`
+}
+
+// emailSecurityTimeseriesGroupSPFResponseJSON contains the JSON metadata for the
+// struct [EmailSecurityTimeseriesGroupSPFResponse]
+type emailSecurityTimeseriesGroupSPFResponseJSON struct {
+ Meta apijson.Field
+ Serie0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecurityTimeseriesGroupSPFResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecurityTimeseriesGroupSPFResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecurityTimeseriesGroupSPFResponseSerie0 struct {
+ Fail []string `json:"FAIL,required"`
+ None []string `json:"NONE,required"`
+ Pass []string `json:"PASS,required"`
+ JSON emailSecurityTimeseriesGroupSPFResponseSerie0JSON `json:"-"`
+}
+
+// emailSecurityTimeseriesGroupSPFResponseSerie0JSON contains the JSON metadata for
+// the struct [EmailSecurityTimeseriesGroupSPFResponseSerie0]
+type emailSecurityTimeseriesGroupSPFResponseSerie0JSON struct {
+ Fail apijson.Field
+ None apijson.Field
+ Pass apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecurityTimeseriesGroupSPFResponseSerie0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecurityTimeseriesGroupSPFResponseSerie0JSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecurityTimeseriesGroupSpoofResponse struct {
+ Meta interface{} `json:"meta,required"`
+ Serie0 EmailSecurityTimeseriesGroupSpoofResponseSerie0 `json:"serie_0,required"`
+ JSON emailSecurityTimeseriesGroupSpoofResponseJSON `json:"-"`
+}
+
+// emailSecurityTimeseriesGroupSpoofResponseJSON contains the JSON metadata for the
+// struct [EmailSecurityTimeseriesGroupSpoofResponse]
+type emailSecurityTimeseriesGroupSpoofResponseJSON struct {
+ Meta apijson.Field
+ Serie0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecurityTimeseriesGroupSpoofResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecurityTimeseriesGroupSpoofResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecurityTimeseriesGroupSpoofResponseSerie0 struct {
+ NotSpoof []string `json:"NOT_SPOOF,required"`
+ Spoof []string `json:"SPOOF,required"`
+ JSON emailSecurityTimeseriesGroupSpoofResponseSerie0JSON `json:"-"`
+}
+
+// emailSecurityTimeseriesGroupSpoofResponseSerie0JSON contains the JSON metadata
+// for the struct [EmailSecurityTimeseriesGroupSpoofResponseSerie0]
+type emailSecurityTimeseriesGroupSpoofResponseSerie0JSON struct {
+ NotSpoof apijson.Field
+ Spoof apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecurityTimeseriesGroupSpoofResponseSerie0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecurityTimeseriesGroupSpoofResponseSerie0JSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecurityTimeseriesGroupThreatCategoryResponse struct {
+ Meta interface{} `json:"meta,required"`
+ Serie0 EmailSecurityTimeseriesGroupThreatCategoryResponseSerie0 `json:"serie_0,required"`
+ JSON emailSecurityTimeseriesGroupThreatCategoryResponseJSON `json:"-"`
+}
+
+// emailSecurityTimeseriesGroupThreatCategoryResponseJSON contains the JSON
+// metadata for the struct [EmailSecurityTimeseriesGroupThreatCategoryResponse]
+type emailSecurityTimeseriesGroupThreatCategoryResponseJSON struct {
+ Meta apijson.Field
+ Serie0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecurityTimeseriesGroupThreatCategoryResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecurityTimeseriesGroupThreatCategoryResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecurityTimeseriesGroupThreatCategoryResponseSerie0 struct {
+ BrandImpersonation []string `json:"BrandImpersonation,required"`
+ CredentialHarvester []string `json:"CredentialHarvester,required"`
+ IdentityDeception []string `json:"IdentityDeception,required"`
+ Link []string `json:"Link,required"`
+ JSON emailSecurityTimeseriesGroupThreatCategoryResponseSerie0JSON `json:"-"`
+}
+
+// emailSecurityTimeseriesGroupThreatCategoryResponseSerie0JSON contains the JSON
+// metadata for the struct
+// [EmailSecurityTimeseriesGroupThreatCategoryResponseSerie0]
+type emailSecurityTimeseriesGroupThreatCategoryResponseSerie0JSON struct {
+ BrandImpersonation apijson.Field
+ CredentialHarvester apijson.Field
+ IdentityDeception apijson.Field
+ Link apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecurityTimeseriesGroupThreatCategoryResponseSerie0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecurityTimeseriesGroupThreatCategoryResponseSerie0JSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecurityTimeseriesGroupTLSVersionResponse struct {
+ Meta interface{} `json:"meta,required"`
+ Serie0 EmailSecurityTimeseriesGroupTLSVersionResponseSerie0 `json:"serie_0,required"`
+ JSON emailSecurityTimeseriesGroupTLSVersionResponseJSON `json:"-"`
+}
+
+// emailSecurityTimeseriesGroupTLSVersionResponseJSON contains the JSON metadata
+// for the struct [EmailSecurityTimeseriesGroupTLSVersionResponse]
+type emailSecurityTimeseriesGroupTLSVersionResponseJSON struct {
+ Meta apijson.Field
+ Serie0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecurityTimeseriesGroupTLSVersionResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecurityTimeseriesGroupTLSVersionResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecurityTimeseriesGroupTLSVersionResponseSerie0 struct {
+ TLS1_0 []string `json:"TLS 1.0,required"`
+ TLS1_1 []string `json:"TLS 1.1,required"`
+ TLS1_2 []string `json:"TLS 1.2,required"`
+ TLS1_3 []string `json:"TLS 1.3,required"`
+ JSON emailSecurityTimeseriesGroupTLSVersionResponseSerie0JSON `json:"-"`
+}
+
+// emailSecurityTimeseriesGroupTLSVersionResponseSerie0JSON contains the JSON
+// metadata for the struct [EmailSecurityTimeseriesGroupTLSVersionResponseSerie0]
+type emailSecurityTimeseriesGroupTLSVersionResponseSerie0JSON struct {
+ TLS1_0 apijson.Field
+ TLS1_1 apijson.Field
+ TLS1_2 apijson.Field
+ TLS1_3 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecurityTimeseriesGroupTLSVersionResponseSerie0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecurityTimeseriesGroupTLSVersionResponseSerie0JSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecurityTimeseriesGroupARCParams struct {
+ // Aggregation interval results should be returned in (for example, in 15 minutes
+ // or 1 hour intervals). Refer to
+ // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+ AggInterval param.Field[EmailSecurityTimeseriesGroupARCParamsAggInterval] `query:"aggInterval"`
+ // 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[[]EmailSecurityTimeseriesGroupARCParamsDateRange] `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[[]EmailSecurityTimeseriesGroupARCParamsDKIM] `query:"dkim"`
+ // Filter for dmarc.
+ DMARC param.Field[[]EmailSecurityTimeseriesGroupARCParamsDMARC] `query:"dmarc"`
+ // Format results are returned in.
+ Format param.Field[EmailSecurityTimeseriesGroupARCParamsFormat] `query:"format"`
+ // 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[[]EmailSecurityTimeseriesGroupARCParamsSPF] `query:"spf"`
+ // Filter for tls version.
+ TLSVersion param.Field[[]EmailSecurityTimeseriesGroupARCParamsTLSVersion] `query:"tlsVersion"`
+}
+
+// URLQuery serializes [EmailSecurityTimeseriesGroupARCParams]'s query parameters
+// as `url.Values`.
+func (r EmailSecurityTimeseriesGroupARCParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Aggregation interval results should be returned in (for example, in 15 minutes
+// or 1 hour intervals). Refer to
+// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+type EmailSecurityTimeseriesGroupARCParamsAggInterval string
+
+const (
+ EmailSecurityTimeseriesGroupARCParamsAggInterval15m EmailSecurityTimeseriesGroupARCParamsAggInterval = "15m"
+ EmailSecurityTimeseriesGroupARCParamsAggInterval1h EmailSecurityTimeseriesGroupARCParamsAggInterval = "1h"
+ EmailSecurityTimeseriesGroupARCParamsAggInterval1d EmailSecurityTimeseriesGroupARCParamsAggInterval = "1d"
+ EmailSecurityTimeseriesGroupARCParamsAggInterval1w EmailSecurityTimeseriesGroupARCParamsAggInterval = "1w"
+)
+
+type EmailSecurityTimeseriesGroupARCParamsDateRange string
+
+const (
+ EmailSecurityTimeseriesGroupARCParamsDateRange1d EmailSecurityTimeseriesGroupARCParamsDateRange = "1d"
+ EmailSecurityTimeseriesGroupARCParamsDateRange2d EmailSecurityTimeseriesGroupARCParamsDateRange = "2d"
+ EmailSecurityTimeseriesGroupARCParamsDateRange7d EmailSecurityTimeseriesGroupARCParamsDateRange = "7d"
+ EmailSecurityTimeseriesGroupARCParamsDateRange14d EmailSecurityTimeseriesGroupARCParamsDateRange = "14d"
+ EmailSecurityTimeseriesGroupARCParamsDateRange28d EmailSecurityTimeseriesGroupARCParamsDateRange = "28d"
+ EmailSecurityTimeseriesGroupARCParamsDateRange12w EmailSecurityTimeseriesGroupARCParamsDateRange = "12w"
+ EmailSecurityTimeseriesGroupARCParamsDateRange24w EmailSecurityTimeseriesGroupARCParamsDateRange = "24w"
+ EmailSecurityTimeseriesGroupARCParamsDateRange52w EmailSecurityTimeseriesGroupARCParamsDateRange = "52w"
+ EmailSecurityTimeseriesGroupARCParamsDateRange1dControl EmailSecurityTimeseriesGroupARCParamsDateRange = "1dControl"
+ EmailSecurityTimeseriesGroupARCParamsDateRange2dControl EmailSecurityTimeseriesGroupARCParamsDateRange = "2dControl"
+ EmailSecurityTimeseriesGroupARCParamsDateRange7dControl EmailSecurityTimeseriesGroupARCParamsDateRange = "7dControl"
+ EmailSecurityTimeseriesGroupARCParamsDateRange14dControl EmailSecurityTimeseriesGroupARCParamsDateRange = "14dControl"
+ EmailSecurityTimeseriesGroupARCParamsDateRange28dControl EmailSecurityTimeseriesGroupARCParamsDateRange = "28dControl"
+ EmailSecurityTimeseriesGroupARCParamsDateRange12wControl EmailSecurityTimeseriesGroupARCParamsDateRange = "12wControl"
+ EmailSecurityTimeseriesGroupARCParamsDateRange24wControl EmailSecurityTimeseriesGroupARCParamsDateRange = "24wControl"
+)
+
+type EmailSecurityTimeseriesGroupARCParamsDKIM string
+
+const (
+ EmailSecurityTimeseriesGroupARCParamsDKIMPass EmailSecurityTimeseriesGroupARCParamsDKIM = "PASS"
+ EmailSecurityTimeseriesGroupARCParamsDKIMNone EmailSecurityTimeseriesGroupARCParamsDKIM = "NONE"
+ EmailSecurityTimeseriesGroupARCParamsDKIMFail EmailSecurityTimeseriesGroupARCParamsDKIM = "FAIL"
+)
+
+type EmailSecurityTimeseriesGroupARCParamsDMARC string
+
+const (
+ EmailSecurityTimeseriesGroupARCParamsDMARCPass EmailSecurityTimeseriesGroupARCParamsDMARC = "PASS"
+ EmailSecurityTimeseriesGroupARCParamsDMARCNone EmailSecurityTimeseriesGroupARCParamsDMARC = "NONE"
+ EmailSecurityTimeseriesGroupARCParamsDMARCFail EmailSecurityTimeseriesGroupARCParamsDMARC = "FAIL"
+)
+
+// Format results are returned in.
+type EmailSecurityTimeseriesGroupARCParamsFormat string
+
+const (
+ EmailSecurityTimeseriesGroupARCParamsFormatJson EmailSecurityTimeseriesGroupARCParamsFormat = "JSON"
+ EmailSecurityTimeseriesGroupARCParamsFormatCsv EmailSecurityTimeseriesGroupARCParamsFormat = "CSV"
+)
+
+type EmailSecurityTimeseriesGroupARCParamsSPF string
+
+const (
+ EmailSecurityTimeseriesGroupARCParamsSPFPass EmailSecurityTimeseriesGroupARCParamsSPF = "PASS"
+ EmailSecurityTimeseriesGroupARCParamsSPFNone EmailSecurityTimeseriesGroupARCParamsSPF = "NONE"
+ EmailSecurityTimeseriesGroupARCParamsSPFFail EmailSecurityTimeseriesGroupARCParamsSPF = "FAIL"
+)
+
+type EmailSecurityTimeseriesGroupARCParamsTLSVersion string
+
+const (
+ EmailSecurityTimeseriesGroupARCParamsTLSVersionTlSv1_0 EmailSecurityTimeseriesGroupARCParamsTLSVersion = "TLSv1_0"
+ EmailSecurityTimeseriesGroupARCParamsTLSVersionTlSv1_1 EmailSecurityTimeseriesGroupARCParamsTLSVersion = "TLSv1_1"
+ EmailSecurityTimeseriesGroupARCParamsTLSVersionTlSv1_2 EmailSecurityTimeseriesGroupARCParamsTLSVersion = "TLSv1_2"
+ EmailSecurityTimeseriesGroupARCParamsTLSVersionTlSv1_3 EmailSecurityTimeseriesGroupARCParamsTLSVersion = "TLSv1_3"
+)
+
+type EmailSecurityTimeseriesGroupARCResponseEnvelope struct {
+ Result EmailSecurityTimeseriesGroupARCResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON emailSecurityTimeseriesGroupARCResponseEnvelopeJSON `json:"-"`
+}
+
+// emailSecurityTimeseriesGroupARCResponseEnvelopeJSON contains the JSON metadata
+// for the struct [EmailSecurityTimeseriesGroupARCResponseEnvelope]
+type emailSecurityTimeseriesGroupARCResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecurityTimeseriesGroupARCResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecurityTimeseriesGroupARCResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecurityTimeseriesGroupDKIMParams struct {
+ // Aggregation interval results should be returned in (for example, in 15 minutes
+ // or 1 hour intervals). Refer to
+ // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+ AggInterval param.Field[EmailSecurityTimeseriesGroupDKIMParamsAggInterval] `query:"aggInterval"`
+ // Filter for arc (Authenticated Received Chain).
+ ARC param.Field[[]EmailSecurityTimeseriesGroupDKIMParamsARC] `query:"arc"`
+ // 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[[]EmailSecurityTimeseriesGroupDKIMParamsDateRange] `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[[]EmailSecurityTimeseriesGroupDKIMParamsDMARC] `query:"dmarc"`
+ // Format results are returned in.
+ Format param.Field[EmailSecurityTimeseriesGroupDKIMParamsFormat] `query:"format"`
+ // 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[[]EmailSecurityTimeseriesGroupDKIMParamsSPF] `query:"spf"`
+ // Filter for tls version.
+ TLSVersion param.Field[[]EmailSecurityTimeseriesGroupDKIMParamsTLSVersion] `query:"tlsVersion"`
+}
+
+// URLQuery serializes [EmailSecurityTimeseriesGroupDKIMParams]'s query parameters
+// as `url.Values`.
+func (r EmailSecurityTimeseriesGroupDKIMParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Aggregation interval results should be returned in (for example, in 15 minutes
+// or 1 hour intervals). Refer to
+// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+type EmailSecurityTimeseriesGroupDKIMParamsAggInterval string
+
+const (
+ EmailSecurityTimeseriesGroupDKIMParamsAggInterval15m EmailSecurityTimeseriesGroupDKIMParamsAggInterval = "15m"
+ EmailSecurityTimeseriesGroupDKIMParamsAggInterval1h EmailSecurityTimeseriesGroupDKIMParamsAggInterval = "1h"
+ EmailSecurityTimeseriesGroupDKIMParamsAggInterval1d EmailSecurityTimeseriesGroupDKIMParamsAggInterval = "1d"
+ EmailSecurityTimeseriesGroupDKIMParamsAggInterval1w EmailSecurityTimeseriesGroupDKIMParamsAggInterval = "1w"
+)
+
+type EmailSecurityTimeseriesGroupDKIMParamsARC string
+
+const (
+ EmailSecurityTimeseriesGroupDKIMParamsARCPass EmailSecurityTimeseriesGroupDKIMParamsARC = "PASS"
+ EmailSecurityTimeseriesGroupDKIMParamsARCNone EmailSecurityTimeseriesGroupDKIMParamsARC = "NONE"
+ EmailSecurityTimeseriesGroupDKIMParamsARCFail EmailSecurityTimeseriesGroupDKIMParamsARC = "FAIL"
+)
+
+type EmailSecurityTimeseriesGroupDKIMParamsDateRange string
+
+const (
+ EmailSecurityTimeseriesGroupDKIMParamsDateRange1d EmailSecurityTimeseriesGroupDKIMParamsDateRange = "1d"
+ EmailSecurityTimeseriesGroupDKIMParamsDateRange2d EmailSecurityTimeseriesGroupDKIMParamsDateRange = "2d"
+ EmailSecurityTimeseriesGroupDKIMParamsDateRange7d EmailSecurityTimeseriesGroupDKIMParamsDateRange = "7d"
+ EmailSecurityTimeseriesGroupDKIMParamsDateRange14d EmailSecurityTimeseriesGroupDKIMParamsDateRange = "14d"
+ EmailSecurityTimeseriesGroupDKIMParamsDateRange28d EmailSecurityTimeseriesGroupDKIMParamsDateRange = "28d"
+ EmailSecurityTimeseriesGroupDKIMParamsDateRange12w EmailSecurityTimeseriesGroupDKIMParamsDateRange = "12w"
+ EmailSecurityTimeseriesGroupDKIMParamsDateRange24w EmailSecurityTimeseriesGroupDKIMParamsDateRange = "24w"
+ EmailSecurityTimeseriesGroupDKIMParamsDateRange52w EmailSecurityTimeseriesGroupDKIMParamsDateRange = "52w"
+ EmailSecurityTimeseriesGroupDKIMParamsDateRange1dControl EmailSecurityTimeseriesGroupDKIMParamsDateRange = "1dControl"
+ EmailSecurityTimeseriesGroupDKIMParamsDateRange2dControl EmailSecurityTimeseriesGroupDKIMParamsDateRange = "2dControl"
+ EmailSecurityTimeseriesGroupDKIMParamsDateRange7dControl EmailSecurityTimeseriesGroupDKIMParamsDateRange = "7dControl"
+ EmailSecurityTimeseriesGroupDKIMParamsDateRange14dControl EmailSecurityTimeseriesGroupDKIMParamsDateRange = "14dControl"
+ EmailSecurityTimeseriesGroupDKIMParamsDateRange28dControl EmailSecurityTimeseriesGroupDKIMParamsDateRange = "28dControl"
+ EmailSecurityTimeseriesGroupDKIMParamsDateRange12wControl EmailSecurityTimeseriesGroupDKIMParamsDateRange = "12wControl"
+ EmailSecurityTimeseriesGroupDKIMParamsDateRange24wControl EmailSecurityTimeseriesGroupDKIMParamsDateRange = "24wControl"
+)
+
+type EmailSecurityTimeseriesGroupDKIMParamsDMARC string
+
+const (
+ EmailSecurityTimeseriesGroupDKIMParamsDMARCPass EmailSecurityTimeseriesGroupDKIMParamsDMARC = "PASS"
+ EmailSecurityTimeseriesGroupDKIMParamsDMARCNone EmailSecurityTimeseriesGroupDKIMParamsDMARC = "NONE"
+ EmailSecurityTimeseriesGroupDKIMParamsDMARCFail EmailSecurityTimeseriesGroupDKIMParamsDMARC = "FAIL"
+)
+
+// Format results are returned in.
+type EmailSecurityTimeseriesGroupDKIMParamsFormat string
+
+const (
+ EmailSecurityTimeseriesGroupDKIMParamsFormatJson EmailSecurityTimeseriesGroupDKIMParamsFormat = "JSON"
+ EmailSecurityTimeseriesGroupDKIMParamsFormatCsv EmailSecurityTimeseriesGroupDKIMParamsFormat = "CSV"
+)
+
+type EmailSecurityTimeseriesGroupDKIMParamsSPF string
+
+const (
+ EmailSecurityTimeseriesGroupDKIMParamsSPFPass EmailSecurityTimeseriesGroupDKIMParamsSPF = "PASS"
+ EmailSecurityTimeseriesGroupDKIMParamsSPFNone EmailSecurityTimeseriesGroupDKIMParamsSPF = "NONE"
+ EmailSecurityTimeseriesGroupDKIMParamsSPFFail EmailSecurityTimeseriesGroupDKIMParamsSPF = "FAIL"
+)
+
+type EmailSecurityTimeseriesGroupDKIMParamsTLSVersion string
+
+const (
+ EmailSecurityTimeseriesGroupDKIMParamsTLSVersionTlSv1_0 EmailSecurityTimeseriesGroupDKIMParamsTLSVersion = "TLSv1_0"
+ EmailSecurityTimeseriesGroupDKIMParamsTLSVersionTlSv1_1 EmailSecurityTimeseriesGroupDKIMParamsTLSVersion = "TLSv1_1"
+ EmailSecurityTimeseriesGroupDKIMParamsTLSVersionTlSv1_2 EmailSecurityTimeseriesGroupDKIMParamsTLSVersion = "TLSv1_2"
+ EmailSecurityTimeseriesGroupDKIMParamsTLSVersionTlSv1_3 EmailSecurityTimeseriesGroupDKIMParamsTLSVersion = "TLSv1_3"
+)
+
+type EmailSecurityTimeseriesGroupDKIMResponseEnvelope struct {
+ Result EmailSecurityTimeseriesGroupDKIMResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON emailSecurityTimeseriesGroupDKIMResponseEnvelopeJSON `json:"-"`
+}
+
+// emailSecurityTimeseriesGroupDKIMResponseEnvelopeJSON contains the JSON metadata
+// for the struct [EmailSecurityTimeseriesGroupDKIMResponseEnvelope]
+type emailSecurityTimeseriesGroupDKIMResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecurityTimeseriesGroupDKIMResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecurityTimeseriesGroupDKIMResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecurityTimeseriesGroupDMARCParams struct {
+ // Aggregation interval results should be returned in (for example, in 15 minutes
+ // or 1 hour intervals). Refer to
+ // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+ AggInterval param.Field[EmailSecurityTimeseriesGroupDMARCParamsAggInterval] `query:"aggInterval"`
+ // Filter for arc (Authenticated Received Chain).
+ ARC param.Field[[]EmailSecurityTimeseriesGroupDMARCParamsARC] `query:"arc"`
+ // 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[[]EmailSecurityTimeseriesGroupDMARCParamsDateRange] `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[[]EmailSecurityTimeseriesGroupDMARCParamsDKIM] `query:"dkim"`
+ // Format results are returned in.
+ Format param.Field[EmailSecurityTimeseriesGroupDMARCParamsFormat] `query:"format"`
+ // 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[[]EmailSecurityTimeseriesGroupDMARCParamsSPF] `query:"spf"`
+ // Filter for tls version.
+ TLSVersion param.Field[[]EmailSecurityTimeseriesGroupDMARCParamsTLSVersion] `query:"tlsVersion"`
+}
+
+// URLQuery serializes [EmailSecurityTimeseriesGroupDMARCParams]'s query parameters
+// as `url.Values`.
+func (r EmailSecurityTimeseriesGroupDMARCParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Aggregation interval results should be returned in (for example, in 15 minutes
+// or 1 hour intervals). Refer to
+// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+type EmailSecurityTimeseriesGroupDMARCParamsAggInterval string
+
+const (
+ EmailSecurityTimeseriesGroupDMARCParamsAggInterval15m EmailSecurityTimeseriesGroupDMARCParamsAggInterval = "15m"
+ EmailSecurityTimeseriesGroupDMARCParamsAggInterval1h EmailSecurityTimeseriesGroupDMARCParamsAggInterval = "1h"
+ EmailSecurityTimeseriesGroupDMARCParamsAggInterval1d EmailSecurityTimeseriesGroupDMARCParamsAggInterval = "1d"
+ EmailSecurityTimeseriesGroupDMARCParamsAggInterval1w EmailSecurityTimeseriesGroupDMARCParamsAggInterval = "1w"
+)
+
+type EmailSecurityTimeseriesGroupDMARCParamsARC string
+
+const (
+ EmailSecurityTimeseriesGroupDMARCParamsARCPass EmailSecurityTimeseriesGroupDMARCParamsARC = "PASS"
+ EmailSecurityTimeseriesGroupDMARCParamsARCNone EmailSecurityTimeseriesGroupDMARCParamsARC = "NONE"
+ EmailSecurityTimeseriesGroupDMARCParamsARCFail EmailSecurityTimeseriesGroupDMARCParamsARC = "FAIL"
+)
+
+type EmailSecurityTimeseriesGroupDMARCParamsDateRange string
+
+const (
+ EmailSecurityTimeseriesGroupDMARCParamsDateRange1d EmailSecurityTimeseriesGroupDMARCParamsDateRange = "1d"
+ EmailSecurityTimeseriesGroupDMARCParamsDateRange2d EmailSecurityTimeseriesGroupDMARCParamsDateRange = "2d"
+ EmailSecurityTimeseriesGroupDMARCParamsDateRange7d EmailSecurityTimeseriesGroupDMARCParamsDateRange = "7d"
+ EmailSecurityTimeseriesGroupDMARCParamsDateRange14d EmailSecurityTimeseriesGroupDMARCParamsDateRange = "14d"
+ EmailSecurityTimeseriesGroupDMARCParamsDateRange28d EmailSecurityTimeseriesGroupDMARCParamsDateRange = "28d"
+ EmailSecurityTimeseriesGroupDMARCParamsDateRange12w EmailSecurityTimeseriesGroupDMARCParamsDateRange = "12w"
+ EmailSecurityTimeseriesGroupDMARCParamsDateRange24w EmailSecurityTimeseriesGroupDMARCParamsDateRange = "24w"
+ EmailSecurityTimeseriesGroupDMARCParamsDateRange52w EmailSecurityTimeseriesGroupDMARCParamsDateRange = "52w"
+ EmailSecurityTimeseriesGroupDMARCParamsDateRange1dControl EmailSecurityTimeseriesGroupDMARCParamsDateRange = "1dControl"
+ EmailSecurityTimeseriesGroupDMARCParamsDateRange2dControl EmailSecurityTimeseriesGroupDMARCParamsDateRange = "2dControl"
+ EmailSecurityTimeseriesGroupDMARCParamsDateRange7dControl EmailSecurityTimeseriesGroupDMARCParamsDateRange = "7dControl"
+ EmailSecurityTimeseriesGroupDMARCParamsDateRange14dControl EmailSecurityTimeseriesGroupDMARCParamsDateRange = "14dControl"
+ EmailSecurityTimeseriesGroupDMARCParamsDateRange28dControl EmailSecurityTimeseriesGroupDMARCParamsDateRange = "28dControl"
+ EmailSecurityTimeseriesGroupDMARCParamsDateRange12wControl EmailSecurityTimeseriesGroupDMARCParamsDateRange = "12wControl"
+ EmailSecurityTimeseriesGroupDMARCParamsDateRange24wControl EmailSecurityTimeseriesGroupDMARCParamsDateRange = "24wControl"
+)
+
+type EmailSecurityTimeseriesGroupDMARCParamsDKIM string
+
+const (
+ EmailSecurityTimeseriesGroupDMARCParamsDKIMPass EmailSecurityTimeseriesGroupDMARCParamsDKIM = "PASS"
+ EmailSecurityTimeseriesGroupDMARCParamsDKIMNone EmailSecurityTimeseriesGroupDMARCParamsDKIM = "NONE"
+ EmailSecurityTimeseriesGroupDMARCParamsDKIMFail EmailSecurityTimeseriesGroupDMARCParamsDKIM = "FAIL"
+)
+
+// Format results are returned in.
+type EmailSecurityTimeseriesGroupDMARCParamsFormat string
+
+const (
+ EmailSecurityTimeseriesGroupDMARCParamsFormatJson EmailSecurityTimeseriesGroupDMARCParamsFormat = "JSON"
+ EmailSecurityTimeseriesGroupDMARCParamsFormatCsv EmailSecurityTimeseriesGroupDMARCParamsFormat = "CSV"
+)
+
+type EmailSecurityTimeseriesGroupDMARCParamsSPF string
+
+const (
+ EmailSecurityTimeseriesGroupDMARCParamsSPFPass EmailSecurityTimeseriesGroupDMARCParamsSPF = "PASS"
+ EmailSecurityTimeseriesGroupDMARCParamsSPFNone EmailSecurityTimeseriesGroupDMARCParamsSPF = "NONE"
+ EmailSecurityTimeseriesGroupDMARCParamsSPFFail EmailSecurityTimeseriesGroupDMARCParamsSPF = "FAIL"
+)
+
+type EmailSecurityTimeseriesGroupDMARCParamsTLSVersion string
+
+const (
+ EmailSecurityTimeseriesGroupDMARCParamsTLSVersionTlSv1_0 EmailSecurityTimeseriesGroupDMARCParamsTLSVersion = "TLSv1_0"
+ EmailSecurityTimeseriesGroupDMARCParamsTLSVersionTlSv1_1 EmailSecurityTimeseriesGroupDMARCParamsTLSVersion = "TLSv1_1"
+ EmailSecurityTimeseriesGroupDMARCParamsTLSVersionTlSv1_2 EmailSecurityTimeseriesGroupDMARCParamsTLSVersion = "TLSv1_2"
+ EmailSecurityTimeseriesGroupDMARCParamsTLSVersionTlSv1_3 EmailSecurityTimeseriesGroupDMARCParamsTLSVersion = "TLSv1_3"
+)
+
+type EmailSecurityTimeseriesGroupDMARCResponseEnvelope struct {
+ Result EmailSecurityTimeseriesGroupDMARCResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON emailSecurityTimeseriesGroupDMARCResponseEnvelopeJSON `json:"-"`
+}
+
+// emailSecurityTimeseriesGroupDMARCResponseEnvelopeJSON contains the JSON metadata
+// for the struct [EmailSecurityTimeseriesGroupDMARCResponseEnvelope]
+type emailSecurityTimeseriesGroupDMARCResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecurityTimeseriesGroupDMARCResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecurityTimeseriesGroupDMARCResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecurityTimeseriesGroupMaliciousParams struct {
+ // Aggregation interval results should be returned in (for example, in 15 minutes
+ // or 1 hour intervals). Refer to
+ // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+ AggInterval param.Field[EmailSecurityTimeseriesGroupMaliciousParamsAggInterval] `query:"aggInterval"`
+ // Filter for arc (Authenticated Received Chain).
+ ARC param.Field[[]EmailSecurityTimeseriesGroupMaliciousParamsARC] `query:"arc"`
+ // 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[[]EmailSecurityTimeseriesGroupMaliciousParamsDateRange] `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[[]EmailSecurityTimeseriesGroupMaliciousParamsDKIM] `query:"dkim"`
+ // Filter for dmarc.
+ DMARC param.Field[[]EmailSecurityTimeseriesGroupMaliciousParamsDMARC] `query:"dmarc"`
+ // Format results are returned in.
+ Format param.Field[EmailSecurityTimeseriesGroupMaliciousParamsFormat] `query:"format"`
+ // 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[[]EmailSecurityTimeseriesGroupMaliciousParamsSPF] `query:"spf"`
+ // Filter for tls version.
+ TLSVersion param.Field[[]EmailSecurityTimeseriesGroupMaliciousParamsTLSVersion] `query:"tlsVersion"`
+}
+
+// URLQuery serializes [EmailSecurityTimeseriesGroupMaliciousParams]'s query
+// parameters as `url.Values`.
+func (r EmailSecurityTimeseriesGroupMaliciousParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Aggregation interval results should be returned in (for example, in 15 minutes
+// or 1 hour intervals). Refer to
+// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+type EmailSecurityTimeseriesGroupMaliciousParamsAggInterval string
+
+const (
+ EmailSecurityTimeseriesGroupMaliciousParamsAggInterval15m EmailSecurityTimeseriesGroupMaliciousParamsAggInterval = "15m"
+ EmailSecurityTimeseriesGroupMaliciousParamsAggInterval1h EmailSecurityTimeseriesGroupMaliciousParamsAggInterval = "1h"
+ EmailSecurityTimeseriesGroupMaliciousParamsAggInterval1d EmailSecurityTimeseriesGroupMaliciousParamsAggInterval = "1d"
+ EmailSecurityTimeseriesGroupMaliciousParamsAggInterval1w EmailSecurityTimeseriesGroupMaliciousParamsAggInterval = "1w"
+)
+
+type EmailSecurityTimeseriesGroupMaliciousParamsARC string
+
+const (
+ EmailSecurityTimeseriesGroupMaliciousParamsARCPass EmailSecurityTimeseriesGroupMaliciousParamsARC = "PASS"
+ EmailSecurityTimeseriesGroupMaliciousParamsARCNone EmailSecurityTimeseriesGroupMaliciousParamsARC = "NONE"
+ EmailSecurityTimeseriesGroupMaliciousParamsARCFail EmailSecurityTimeseriesGroupMaliciousParamsARC = "FAIL"
+)
+
+type EmailSecurityTimeseriesGroupMaliciousParamsDateRange string
+
+const (
+ EmailSecurityTimeseriesGroupMaliciousParamsDateRange1d EmailSecurityTimeseriesGroupMaliciousParamsDateRange = "1d"
+ EmailSecurityTimeseriesGroupMaliciousParamsDateRange2d EmailSecurityTimeseriesGroupMaliciousParamsDateRange = "2d"
+ EmailSecurityTimeseriesGroupMaliciousParamsDateRange7d EmailSecurityTimeseriesGroupMaliciousParamsDateRange = "7d"
+ EmailSecurityTimeseriesGroupMaliciousParamsDateRange14d EmailSecurityTimeseriesGroupMaliciousParamsDateRange = "14d"
+ EmailSecurityTimeseriesGroupMaliciousParamsDateRange28d EmailSecurityTimeseriesGroupMaliciousParamsDateRange = "28d"
+ EmailSecurityTimeseriesGroupMaliciousParamsDateRange12w EmailSecurityTimeseriesGroupMaliciousParamsDateRange = "12w"
+ EmailSecurityTimeseriesGroupMaliciousParamsDateRange24w EmailSecurityTimeseriesGroupMaliciousParamsDateRange = "24w"
+ EmailSecurityTimeseriesGroupMaliciousParamsDateRange52w EmailSecurityTimeseriesGroupMaliciousParamsDateRange = "52w"
+ EmailSecurityTimeseriesGroupMaliciousParamsDateRange1dControl EmailSecurityTimeseriesGroupMaliciousParamsDateRange = "1dControl"
+ EmailSecurityTimeseriesGroupMaliciousParamsDateRange2dControl EmailSecurityTimeseriesGroupMaliciousParamsDateRange = "2dControl"
+ EmailSecurityTimeseriesGroupMaliciousParamsDateRange7dControl EmailSecurityTimeseriesGroupMaliciousParamsDateRange = "7dControl"
+ EmailSecurityTimeseriesGroupMaliciousParamsDateRange14dControl EmailSecurityTimeseriesGroupMaliciousParamsDateRange = "14dControl"
+ EmailSecurityTimeseriesGroupMaliciousParamsDateRange28dControl EmailSecurityTimeseriesGroupMaliciousParamsDateRange = "28dControl"
+ EmailSecurityTimeseriesGroupMaliciousParamsDateRange12wControl EmailSecurityTimeseriesGroupMaliciousParamsDateRange = "12wControl"
+ EmailSecurityTimeseriesGroupMaliciousParamsDateRange24wControl EmailSecurityTimeseriesGroupMaliciousParamsDateRange = "24wControl"
+)
+
+type EmailSecurityTimeseriesGroupMaliciousParamsDKIM string
+
+const (
+ EmailSecurityTimeseriesGroupMaliciousParamsDKIMPass EmailSecurityTimeseriesGroupMaliciousParamsDKIM = "PASS"
+ EmailSecurityTimeseriesGroupMaliciousParamsDKIMNone EmailSecurityTimeseriesGroupMaliciousParamsDKIM = "NONE"
+ EmailSecurityTimeseriesGroupMaliciousParamsDKIMFail EmailSecurityTimeseriesGroupMaliciousParamsDKIM = "FAIL"
+)
+
+type EmailSecurityTimeseriesGroupMaliciousParamsDMARC string
+
+const (
+ EmailSecurityTimeseriesGroupMaliciousParamsDMARCPass EmailSecurityTimeseriesGroupMaliciousParamsDMARC = "PASS"
+ EmailSecurityTimeseriesGroupMaliciousParamsDMARCNone EmailSecurityTimeseriesGroupMaliciousParamsDMARC = "NONE"
+ EmailSecurityTimeseriesGroupMaliciousParamsDMARCFail EmailSecurityTimeseriesGroupMaliciousParamsDMARC = "FAIL"
+)
+
+// Format results are returned in.
+type EmailSecurityTimeseriesGroupMaliciousParamsFormat string
+
+const (
+ EmailSecurityTimeseriesGroupMaliciousParamsFormatJson EmailSecurityTimeseriesGroupMaliciousParamsFormat = "JSON"
+ EmailSecurityTimeseriesGroupMaliciousParamsFormatCsv EmailSecurityTimeseriesGroupMaliciousParamsFormat = "CSV"
+)
+
+type EmailSecurityTimeseriesGroupMaliciousParamsSPF string
+
+const (
+ EmailSecurityTimeseriesGroupMaliciousParamsSPFPass EmailSecurityTimeseriesGroupMaliciousParamsSPF = "PASS"
+ EmailSecurityTimeseriesGroupMaliciousParamsSPFNone EmailSecurityTimeseriesGroupMaliciousParamsSPF = "NONE"
+ EmailSecurityTimeseriesGroupMaliciousParamsSPFFail EmailSecurityTimeseriesGroupMaliciousParamsSPF = "FAIL"
+)
+
+type EmailSecurityTimeseriesGroupMaliciousParamsTLSVersion string
+
+const (
+ EmailSecurityTimeseriesGroupMaliciousParamsTLSVersionTlSv1_0 EmailSecurityTimeseriesGroupMaliciousParamsTLSVersion = "TLSv1_0"
+ EmailSecurityTimeseriesGroupMaliciousParamsTLSVersionTlSv1_1 EmailSecurityTimeseriesGroupMaliciousParamsTLSVersion = "TLSv1_1"
+ EmailSecurityTimeseriesGroupMaliciousParamsTLSVersionTlSv1_2 EmailSecurityTimeseriesGroupMaliciousParamsTLSVersion = "TLSv1_2"
+ EmailSecurityTimeseriesGroupMaliciousParamsTLSVersionTlSv1_3 EmailSecurityTimeseriesGroupMaliciousParamsTLSVersion = "TLSv1_3"
+)
+
+type EmailSecurityTimeseriesGroupMaliciousResponseEnvelope struct {
+ Result EmailSecurityTimeseriesGroupMaliciousResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON emailSecurityTimeseriesGroupMaliciousResponseEnvelopeJSON `json:"-"`
+}
+
+// emailSecurityTimeseriesGroupMaliciousResponseEnvelopeJSON contains the JSON
+// metadata for the struct [EmailSecurityTimeseriesGroupMaliciousResponseEnvelope]
+type emailSecurityTimeseriesGroupMaliciousResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecurityTimeseriesGroupMaliciousResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecurityTimeseriesGroupMaliciousResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecurityTimeseriesGroupSpamParams struct {
+ // Aggregation interval results should be returned in (for example, in 15 minutes
+ // or 1 hour intervals). Refer to
+ // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+ AggInterval param.Field[EmailSecurityTimeseriesGroupSpamParamsAggInterval] `query:"aggInterval"`
+ // Filter for arc (Authenticated Received Chain).
+ ARC param.Field[[]EmailSecurityTimeseriesGroupSpamParamsARC] `query:"arc"`
+ // 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[[]EmailSecurityTimeseriesGroupSpamParamsDateRange] `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[[]EmailSecurityTimeseriesGroupSpamParamsDKIM] `query:"dkim"`
+ // Filter for dmarc.
+ DMARC param.Field[[]EmailSecurityTimeseriesGroupSpamParamsDMARC] `query:"dmarc"`
+ // Format results are returned in.
+ Format param.Field[EmailSecurityTimeseriesGroupSpamParamsFormat] `query:"format"`
+ // 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[[]EmailSecurityTimeseriesGroupSpamParamsSPF] `query:"spf"`
+ // Filter for tls version.
+ TLSVersion param.Field[[]EmailSecurityTimeseriesGroupSpamParamsTLSVersion] `query:"tlsVersion"`
+}
+
+// URLQuery serializes [EmailSecurityTimeseriesGroupSpamParams]'s query parameters
+// as `url.Values`.
+func (r EmailSecurityTimeseriesGroupSpamParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Aggregation interval results should be returned in (for example, in 15 minutes
+// or 1 hour intervals). Refer to
+// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+type EmailSecurityTimeseriesGroupSpamParamsAggInterval string
+
+const (
+ EmailSecurityTimeseriesGroupSpamParamsAggInterval15m EmailSecurityTimeseriesGroupSpamParamsAggInterval = "15m"
+ EmailSecurityTimeseriesGroupSpamParamsAggInterval1h EmailSecurityTimeseriesGroupSpamParamsAggInterval = "1h"
+ EmailSecurityTimeseriesGroupSpamParamsAggInterval1d EmailSecurityTimeseriesGroupSpamParamsAggInterval = "1d"
+ EmailSecurityTimeseriesGroupSpamParamsAggInterval1w EmailSecurityTimeseriesGroupSpamParamsAggInterval = "1w"
+)
+
+type EmailSecurityTimeseriesGroupSpamParamsARC string
+
+const (
+ EmailSecurityTimeseriesGroupSpamParamsARCPass EmailSecurityTimeseriesGroupSpamParamsARC = "PASS"
+ EmailSecurityTimeseriesGroupSpamParamsARCNone EmailSecurityTimeseriesGroupSpamParamsARC = "NONE"
+ EmailSecurityTimeseriesGroupSpamParamsARCFail EmailSecurityTimeseriesGroupSpamParamsARC = "FAIL"
+)
+
+type EmailSecurityTimeseriesGroupSpamParamsDateRange string
+
+const (
+ EmailSecurityTimeseriesGroupSpamParamsDateRange1d EmailSecurityTimeseriesGroupSpamParamsDateRange = "1d"
+ EmailSecurityTimeseriesGroupSpamParamsDateRange2d EmailSecurityTimeseriesGroupSpamParamsDateRange = "2d"
+ EmailSecurityTimeseriesGroupSpamParamsDateRange7d EmailSecurityTimeseriesGroupSpamParamsDateRange = "7d"
+ EmailSecurityTimeseriesGroupSpamParamsDateRange14d EmailSecurityTimeseriesGroupSpamParamsDateRange = "14d"
+ EmailSecurityTimeseriesGroupSpamParamsDateRange28d EmailSecurityTimeseriesGroupSpamParamsDateRange = "28d"
+ EmailSecurityTimeseriesGroupSpamParamsDateRange12w EmailSecurityTimeseriesGroupSpamParamsDateRange = "12w"
+ EmailSecurityTimeseriesGroupSpamParamsDateRange24w EmailSecurityTimeseriesGroupSpamParamsDateRange = "24w"
+ EmailSecurityTimeseriesGroupSpamParamsDateRange52w EmailSecurityTimeseriesGroupSpamParamsDateRange = "52w"
+ EmailSecurityTimeseriesGroupSpamParamsDateRange1dControl EmailSecurityTimeseriesGroupSpamParamsDateRange = "1dControl"
+ EmailSecurityTimeseriesGroupSpamParamsDateRange2dControl EmailSecurityTimeseriesGroupSpamParamsDateRange = "2dControl"
+ EmailSecurityTimeseriesGroupSpamParamsDateRange7dControl EmailSecurityTimeseriesGroupSpamParamsDateRange = "7dControl"
+ EmailSecurityTimeseriesGroupSpamParamsDateRange14dControl EmailSecurityTimeseriesGroupSpamParamsDateRange = "14dControl"
+ EmailSecurityTimeseriesGroupSpamParamsDateRange28dControl EmailSecurityTimeseriesGroupSpamParamsDateRange = "28dControl"
+ EmailSecurityTimeseriesGroupSpamParamsDateRange12wControl EmailSecurityTimeseriesGroupSpamParamsDateRange = "12wControl"
+ EmailSecurityTimeseriesGroupSpamParamsDateRange24wControl EmailSecurityTimeseriesGroupSpamParamsDateRange = "24wControl"
+)
+
+type EmailSecurityTimeseriesGroupSpamParamsDKIM string
+
+const (
+ EmailSecurityTimeseriesGroupSpamParamsDKIMPass EmailSecurityTimeseriesGroupSpamParamsDKIM = "PASS"
+ EmailSecurityTimeseriesGroupSpamParamsDKIMNone EmailSecurityTimeseriesGroupSpamParamsDKIM = "NONE"
+ EmailSecurityTimeseriesGroupSpamParamsDKIMFail EmailSecurityTimeseriesGroupSpamParamsDKIM = "FAIL"
+)
+
+type EmailSecurityTimeseriesGroupSpamParamsDMARC string
+
+const (
+ EmailSecurityTimeseriesGroupSpamParamsDMARCPass EmailSecurityTimeseriesGroupSpamParamsDMARC = "PASS"
+ EmailSecurityTimeseriesGroupSpamParamsDMARCNone EmailSecurityTimeseriesGroupSpamParamsDMARC = "NONE"
+ EmailSecurityTimeseriesGroupSpamParamsDMARCFail EmailSecurityTimeseriesGroupSpamParamsDMARC = "FAIL"
+)
+
+// Format results are returned in.
+type EmailSecurityTimeseriesGroupSpamParamsFormat string
+
+const (
+ EmailSecurityTimeseriesGroupSpamParamsFormatJson EmailSecurityTimeseriesGroupSpamParamsFormat = "JSON"
+ EmailSecurityTimeseriesGroupSpamParamsFormatCsv EmailSecurityTimeseriesGroupSpamParamsFormat = "CSV"
+)
+
+type EmailSecurityTimeseriesGroupSpamParamsSPF string
+
+const (
+ EmailSecurityTimeseriesGroupSpamParamsSPFPass EmailSecurityTimeseriesGroupSpamParamsSPF = "PASS"
+ EmailSecurityTimeseriesGroupSpamParamsSPFNone EmailSecurityTimeseriesGroupSpamParamsSPF = "NONE"
+ EmailSecurityTimeseriesGroupSpamParamsSPFFail EmailSecurityTimeseriesGroupSpamParamsSPF = "FAIL"
+)
+
+type EmailSecurityTimeseriesGroupSpamParamsTLSVersion string
+
+const (
+ EmailSecurityTimeseriesGroupSpamParamsTLSVersionTlSv1_0 EmailSecurityTimeseriesGroupSpamParamsTLSVersion = "TLSv1_0"
+ EmailSecurityTimeseriesGroupSpamParamsTLSVersionTlSv1_1 EmailSecurityTimeseriesGroupSpamParamsTLSVersion = "TLSv1_1"
+ EmailSecurityTimeseriesGroupSpamParamsTLSVersionTlSv1_2 EmailSecurityTimeseriesGroupSpamParamsTLSVersion = "TLSv1_2"
+ EmailSecurityTimeseriesGroupSpamParamsTLSVersionTlSv1_3 EmailSecurityTimeseriesGroupSpamParamsTLSVersion = "TLSv1_3"
+)
+
+type EmailSecurityTimeseriesGroupSpamResponseEnvelope struct {
+ Result EmailSecurityTimeseriesGroupSpamResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON emailSecurityTimeseriesGroupSpamResponseEnvelopeJSON `json:"-"`
+}
+
+// emailSecurityTimeseriesGroupSpamResponseEnvelopeJSON contains the JSON metadata
+// for the struct [EmailSecurityTimeseriesGroupSpamResponseEnvelope]
+type emailSecurityTimeseriesGroupSpamResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecurityTimeseriesGroupSpamResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecurityTimeseriesGroupSpamResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecurityTimeseriesGroupSPFParams struct {
+ // Aggregation interval results should be returned in (for example, in 15 minutes
+ // or 1 hour intervals). Refer to
+ // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+ AggInterval param.Field[EmailSecurityTimeseriesGroupSPFParamsAggInterval] `query:"aggInterval"`
+ // Filter for arc (Authenticated Received Chain).
+ ARC param.Field[[]EmailSecurityTimeseriesGroupSPFParamsARC] `query:"arc"`
+ // 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[[]EmailSecurityTimeseriesGroupSPFParamsDateRange] `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[[]EmailSecurityTimeseriesGroupSPFParamsDKIM] `query:"dkim"`
+ // Filter for dmarc.
+ DMARC param.Field[[]EmailSecurityTimeseriesGroupSPFParamsDMARC] `query:"dmarc"`
+ // Format results are returned in.
+ Format param.Field[EmailSecurityTimeseriesGroupSPFParamsFormat] `query:"format"`
+ // 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[[]EmailSecurityTimeseriesGroupSPFParamsTLSVersion] `query:"tlsVersion"`
+}
+
+// URLQuery serializes [EmailSecurityTimeseriesGroupSPFParams]'s query parameters
+// as `url.Values`.
+func (r EmailSecurityTimeseriesGroupSPFParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Aggregation interval results should be returned in (for example, in 15 minutes
+// or 1 hour intervals). Refer to
+// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+type EmailSecurityTimeseriesGroupSPFParamsAggInterval string
+
+const (
+ EmailSecurityTimeseriesGroupSPFParamsAggInterval15m EmailSecurityTimeseriesGroupSPFParamsAggInterval = "15m"
+ EmailSecurityTimeseriesGroupSPFParamsAggInterval1h EmailSecurityTimeseriesGroupSPFParamsAggInterval = "1h"
+ EmailSecurityTimeseriesGroupSPFParamsAggInterval1d EmailSecurityTimeseriesGroupSPFParamsAggInterval = "1d"
+ EmailSecurityTimeseriesGroupSPFParamsAggInterval1w EmailSecurityTimeseriesGroupSPFParamsAggInterval = "1w"
+)
+
+type EmailSecurityTimeseriesGroupSPFParamsARC string
+
+const (
+ EmailSecurityTimeseriesGroupSPFParamsARCPass EmailSecurityTimeseriesGroupSPFParamsARC = "PASS"
+ EmailSecurityTimeseriesGroupSPFParamsARCNone EmailSecurityTimeseriesGroupSPFParamsARC = "NONE"
+ EmailSecurityTimeseriesGroupSPFParamsARCFail EmailSecurityTimeseriesGroupSPFParamsARC = "FAIL"
+)
+
+type EmailSecurityTimeseriesGroupSPFParamsDateRange string
+
+const (
+ EmailSecurityTimeseriesGroupSPFParamsDateRange1d EmailSecurityTimeseriesGroupSPFParamsDateRange = "1d"
+ EmailSecurityTimeseriesGroupSPFParamsDateRange2d EmailSecurityTimeseriesGroupSPFParamsDateRange = "2d"
+ EmailSecurityTimeseriesGroupSPFParamsDateRange7d EmailSecurityTimeseriesGroupSPFParamsDateRange = "7d"
+ EmailSecurityTimeseriesGroupSPFParamsDateRange14d EmailSecurityTimeseriesGroupSPFParamsDateRange = "14d"
+ EmailSecurityTimeseriesGroupSPFParamsDateRange28d EmailSecurityTimeseriesGroupSPFParamsDateRange = "28d"
+ EmailSecurityTimeseriesGroupSPFParamsDateRange12w EmailSecurityTimeseriesGroupSPFParamsDateRange = "12w"
+ EmailSecurityTimeseriesGroupSPFParamsDateRange24w EmailSecurityTimeseriesGroupSPFParamsDateRange = "24w"
+ EmailSecurityTimeseriesGroupSPFParamsDateRange52w EmailSecurityTimeseriesGroupSPFParamsDateRange = "52w"
+ EmailSecurityTimeseriesGroupSPFParamsDateRange1dControl EmailSecurityTimeseriesGroupSPFParamsDateRange = "1dControl"
+ EmailSecurityTimeseriesGroupSPFParamsDateRange2dControl EmailSecurityTimeseriesGroupSPFParamsDateRange = "2dControl"
+ EmailSecurityTimeseriesGroupSPFParamsDateRange7dControl EmailSecurityTimeseriesGroupSPFParamsDateRange = "7dControl"
+ EmailSecurityTimeseriesGroupSPFParamsDateRange14dControl EmailSecurityTimeseriesGroupSPFParamsDateRange = "14dControl"
+ EmailSecurityTimeseriesGroupSPFParamsDateRange28dControl EmailSecurityTimeseriesGroupSPFParamsDateRange = "28dControl"
+ EmailSecurityTimeseriesGroupSPFParamsDateRange12wControl EmailSecurityTimeseriesGroupSPFParamsDateRange = "12wControl"
+ EmailSecurityTimeseriesGroupSPFParamsDateRange24wControl EmailSecurityTimeseriesGroupSPFParamsDateRange = "24wControl"
+)
+
+type EmailSecurityTimeseriesGroupSPFParamsDKIM string
+
+const (
+ EmailSecurityTimeseriesGroupSPFParamsDKIMPass EmailSecurityTimeseriesGroupSPFParamsDKIM = "PASS"
+ EmailSecurityTimeseriesGroupSPFParamsDKIMNone EmailSecurityTimeseriesGroupSPFParamsDKIM = "NONE"
+ EmailSecurityTimeseriesGroupSPFParamsDKIMFail EmailSecurityTimeseriesGroupSPFParamsDKIM = "FAIL"
+)
+
+type EmailSecurityTimeseriesGroupSPFParamsDMARC string
+
+const (
+ EmailSecurityTimeseriesGroupSPFParamsDMARCPass EmailSecurityTimeseriesGroupSPFParamsDMARC = "PASS"
+ EmailSecurityTimeseriesGroupSPFParamsDMARCNone EmailSecurityTimeseriesGroupSPFParamsDMARC = "NONE"
+ EmailSecurityTimeseriesGroupSPFParamsDMARCFail EmailSecurityTimeseriesGroupSPFParamsDMARC = "FAIL"
+)
+
+// Format results are returned in.
+type EmailSecurityTimeseriesGroupSPFParamsFormat string
+
+const (
+ EmailSecurityTimeseriesGroupSPFParamsFormatJson EmailSecurityTimeseriesGroupSPFParamsFormat = "JSON"
+ EmailSecurityTimeseriesGroupSPFParamsFormatCsv EmailSecurityTimeseriesGroupSPFParamsFormat = "CSV"
+)
+
+type EmailSecurityTimeseriesGroupSPFParamsTLSVersion string
+
+const (
+ EmailSecurityTimeseriesGroupSPFParamsTLSVersionTlSv1_0 EmailSecurityTimeseriesGroupSPFParamsTLSVersion = "TLSv1_0"
+ EmailSecurityTimeseriesGroupSPFParamsTLSVersionTlSv1_1 EmailSecurityTimeseriesGroupSPFParamsTLSVersion = "TLSv1_1"
+ EmailSecurityTimeseriesGroupSPFParamsTLSVersionTlSv1_2 EmailSecurityTimeseriesGroupSPFParamsTLSVersion = "TLSv1_2"
+ EmailSecurityTimeseriesGroupSPFParamsTLSVersionTlSv1_3 EmailSecurityTimeseriesGroupSPFParamsTLSVersion = "TLSv1_3"
+)
+
+type EmailSecurityTimeseriesGroupSPFResponseEnvelope struct {
+ Result EmailSecurityTimeseriesGroupSPFResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON emailSecurityTimeseriesGroupSPFResponseEnvelopeJSON `json:"-"`
+}
+
+// emailSecurityTimeseriesGroupSPFResponseEnvelopeJSON contains the JSON metadata
+// for the struct [EmailSecurityTimeseriesGroupSPFResponseEnvelope]
+type emailSecurityTimeseriesGroupSPFResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecurityTimeseriesGroupSPFResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecurityTimeseriesGroupSPFResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecurityTimeseriesGroupSpoofParams struct {
+ // Aggregation interval results should be returned in (for example, in 15 minutes
+ // or 1 hour intervals). Refer to
+ // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+ AggInterval param.Field[EmailSecurityTimeseriesGroupSpoofParamsAggInterval] `query:"aggInterval"`
+ // Filter for arc (Authenticated Received Chain).
+ ARC param.Field[[]EmailSecurityTimeseriesGroupSpoofParamsARC] `query:"arc"`
+ // 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[[]EmailSecurityTimeseriesGroupSpoofParamsDateRange] `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[[]EmailSecurityTimeseriesGroupSpoofParamsDKIM] `query:"dkim"`
+ // Filter for dmarc.
+ DMARC param.Field[[]EmailSecurityTimeseriesGroupSpoofParamsDMARC] `query:"dmarc"`
+ // Format results are returned in.
+ Format param.Field[EmailSecurityTimeseriesGroupSpoofParamsFormat] `query:"format"`
+ // 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[[]EmailSecurityTimeseriesGroupSpoofParamsSPF] `query:"spf"`
+ // Filter for tls version.
+ TLSVersion param.Field[[]EmailSecurityTimeseriesGroupSpoofParamsTLSVersion] `query:"tlsVersion"`
+}
+
+// URLQuery serializes [EmailSecurityTimeseriesGroupSpoofParams]'s query parameters
+// as `url.Values`.
+func (r EmailSecurityTimeseriesGroupSpoofParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Aggregation interval results should be returned in (for example, in 15 minutes
+// or 1 hour intervals). Refer to
+// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+type EmailSecurityTimeseriesGroupSpoofParamsAggInterval string
+
+const (
+ EmailSecurityTimeseriesGroupSpoofParamsAggInterval15m EmailSecurityTimeseriesGroupSpoofParamsAggInterval = "15m"
+ EmailSecurityTimeseriesGroupSpoofParamsAggInterval1h EmailSecurityTimeseriesGroupSpoofParamsAggInterval = "1h"
+ EmailSecurityTimeseriesGroupSpoofParamsAggInterval1d EmailSecurityTimeseriesGroupSpoofParamsAggInterval = "1d"
+ EmailSecurityTimeseriesGroupSpoofParamsAggInterval1w EmailSecurityTimeseriesGroupSpoofParamsAggInterval = "1w"
+)
+
+type EmailSecurityTimeseriesGroupSpoofParamsARC string
+
+const (
+ EmailSecurityTimeseriesGroupSpoofParamsARCPass EmailSecurityTimeseriesGroupSpoofParamsARC = "PASS"
+ EmailSecurityTimeseriesGroupSpoofParamsARCNone EmailSecurityTimeseriesGroupSpoofParamsARC = "NONE"
+ EmailSecurityTimeseriesGroupSpoofParamsARCFail EmailSecurityTimeseriesGroupSpoofParamsARC = "FAIL"
+)
+
+type EmailSecurityTimeseriesGroupSpoofParamsDateRange string
+
+const (
+ EmailSecurityTimeseriesGroupSpoofParamsDateRange1d EmailSecurityTimeseriesGroupSpoofParamsDateRange = "1d"
+ EmailSecurityTimeseriesGroupSpoofParamsDateRange2d EmailSecurityTimeseriesGroupSpoofParamsDateRange = "2d"
+ EmailSecurityTimeseriesGroupSpoofParamsDateRange7d EmailSecurityTimeseriesGroupSpoofParamsDateRange = "7d"
+ EmailSecurityTimeseriesGroupSpoofParamsDateRange14d EmailSecurityTimeseriesGroupSpoofParamsDateRange = "14d"
+ EmailSecurityTimeseriesGroupSpoofParamsDateRange28d EmailSecurityTimeseriesGroupSpoofParamsDateRange = "28d"
+ EmailSecurityTimeseriesGroupSpoofParamsDateRange12w EmailSecurityTimeseriesGroupSpoofParamsDateRange = "12w"
+ EmailSecurityTimeseriesGroupSpoofParamsDateRange24w EmailSecurityTimeseriesGroupSpoofParamsDateRange = "24w"
+ EmailSecurityTimeseriesGroupSpoofParamsDateRange52w EmailSecurityTimeseriesGroupSpoofParamsDateRange = "52w"
+ EmailSecurityTimeseriesGroupSpoofParamsDateRange1dControl EmailSecurityTimeseriesGroupSpoofParamsDateRange = "1dControl"
+ EmailSecurityTimeseriesGroupSpoofParamsDateRange2dControl EmailSecurityTimeseriesGroupSpoofParamsDateRange = "2dControl"
+ EmailSecurityTimeseriesGroupSpoofParamsDateRange7dControl EmailSecurityTimeseriesGroupSpoofParamsDateRange = "7dControl"
+ EmailSecurityTimeseriesGroupSpoofParamsDateRange14dControl EmailSecurityTimeseriesGroupSpoofParamsDateRange = "14dControl"
+ EmailSecurityTimeseriesGroupSpoofParamsDateRange28dControl EmailSecurityTimeseriesGroupSpoofParamsDateRange = "28dControl"
+ EmailSecurityTimeseriesGroupSpoofParamsDateRange12wControl EmailSecurityTimeseriesGroupSpoofParamsDateRange = "12wControl"
+ EmailSecurityTimeseriesGroupSpoofParamsDateRange24wControl EmailSecurityTimeseriesGroupSpoofParamsDateRange = "24wControl"
+)
+
+type EmailSecurityTimeseriesGroupSpoofParamsDKIM string
+
+const (
+ EmailSecurityTimeseriesGroupSpoofParamsDKIMPass EmailSecurityTimeseriesGroupSpoofParamsDKIM = "PASS"
+ EmailSecurityTimeseriesGroupSpoofParamsDKIMNone EmailSecurityTimeseriesGroupSpoofParamsDKIM = "NONE"
+ EmailSecurityTimeseriesGroupSpoofParamsDKIMFail EmailSecurityTimeseriesGroupSpoofParamsDKIM = "FAIL"
+)
+
+type EmailSecurityTimeseriesGroupSpoofParamsDMARC string
+
+const (
+ EmailSecurityTimeseriesGroupSpoofParamsDMARCPass EmailSecurityTimeseriesGroupSpoofParamsDMARC = "PASS"
+ EmailSecurityTimeseriesGroupSpoofParamsDMARCNone EmailSecurityTimeseriesGroupSpoofParamsDMARC = "NONE"
+ EmailSecurityTimeseriesGroupSpoofParamsDMARCFail EmailSecurityTimeseriesGroupSpoofParamsDMARC = "FAIL"
+)
+
+// Format results are returned in.
+type EmailSecurityTimeseriesGroupSpoofParamsFormat string
+
+const (
+ EmailSecurityTimeseriesGroupSpoofParamsFormatJson EmailSecurityTimeseriesGroupSpoofParamsFormat = "JSON"
+ EmailSecurityTimeseriesGroupSpoofParamsFormatCsv EmailSecurityTimeseriesGroupSpoofParamsFormat = "CSV"
+)
+
+type EmailSecurityTimeseriesGroupSpoofParamsSPF string
+
+const (
+ EmailSecurityTimeseriesGroupSpoofParamsSPFPass EmailSecurityTimeseriesGroupSpoofParamsSPF = "PASS"
+ EmailSecurityTimeseriesGroupSpoofParamsSPFNone EmailSecurityTimeseriesGroupSpoofParamsSPF = "NONE"
+ EmailSecurityTimeseriesGroupSpoofParamsSPFFail EmailSecurityTimeseriesGroupSpoofParamsSPF = "FAIL"
+)
+
+type EmailSecurityTimeseriesGroupSpoofParamsTLSVersion string
+
+const (
+ EmailSecurityTimeseriesGroupSpoofParamsTLSVersionTlSv1_0 EmailSecurityTimeseriesGroupSpoofParamsTLSVersion = "TLSv1_0"
+ EmailSecurityTimeseriesGroupSpoofParamsTLSVersionTlSv1_1 EmailSecurityTimeseriesGroupSpoofParamsTLSVersion = "TLSv1_1"
+ EmailSecurityTimeseriesGroupSpoofParamsTLSVersionTlSv1_2 EmailSecurityTimeseriesGroupSpoofParamsTLSVersion = "TLSv1_2"
+ EmailSecurityTimeseriesGroupSpoofParamsTLSVersionTlSv1_3 EmailSecurityTimeseriesGroupSpoofParamsTLSVersion = "TLSv1_3"
+)
+
+type EmailSecurityTimeseriesGroupSpoofResponseEnvelope struct {
+ Result EmailSecurityTimeseriesGroupSpoofResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON emailSecurityTimeseriesGroupSpoofResponseEnvelopeJSON `json:"-"`
+}
+
+// emailSecurityTimeseriesGroupSpoofResponseEnvelopeJSON contains the JSON metadata
+// for the struct [EmailSecurityTimeseriesGroupSpoofResponseEnvelope]
+type emailSecurityTimeseriesGroupSpoofResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecurityTimeseriesGroupSpoofResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecurityTimeseriesGroupSpoofResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecurityTimeseriesGroupThreatCategoryParams struct {
+ // Aggregation interval results should be returned in (for example, in 15 minutes
+ // or 1 hour intervals). Refer to
+ // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+ AggInterval param.Field[EmailSecurityTimeseriesGroupThreatCategoryParamsAggInterval] `query:"aggInterval"`
+ // Filter for arc (Authenticated Received Chain).
+ ARC param.Field[[]EmailSecurityTimeseriesGroupThreatCategoryParamsARC] `query:"arc"`
+ // 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[[]EmailSecurityTimeseriesGroupThreatCategoryParamsDateRange] `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[[]EmailSecurityTimeseriesGroupThreatCategoryParamsDKIM] `query:"dkim"`
+ // Filter for dmarc.
+ DMARC param.Field[[]EmailSecurityTimeseriesGroupThreatCategoryParamsDMARC] `query:"dmarc"`
+ // Format results are returned in.
+ Format param.Field[EmailSecurityTimeseriesGroupThreatCategoryParamsFormat] `query:"format"`
+ // 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[[]EmailSecurityTimeseriesGroupThreatCategoryParamsSPF] `query:"spf"`
+ // Filter for tls version.
+ TLSVersion param.Field[[]EmailSecurityTimeseriesGroupThreatCategoryParamsTLSVersion] `query:"tlsVersion"`
+}
+
+// URLQuery serializes [EmailSecurityTimeseriesGroupThreatCategoryParams]'s query
+// parameters as `url.Values`.
+func (r EmailSecurityTimeseriesGroupThreatCategoryParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Aggregation interval results should be returned in (for example, in 15 minutes
+// or 1 hour intervals). Refer to
+// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+type EmailSecurityTimeseriesGroupThreatCategoryParamsAggInterval string
+
+const (
+ EmailSecurityTimeseriesGroupThreatCategoryParamsAggInterval15m EmailSecurityTimeseriesGroupThreatCategoryParamsAggInterval = "15m"
+ EmailSecurityTimeseriesGroupThreatCategoryParamsAggInterval1h EmailSecurityTimeseriesGroupThreatCategoryParamsAggInterval = "1h"
+ EmailSecurityTimeseriesGroupThreatCategoryParamsAggInterval1d EmailSecurityTimeseriesGroupThreatCategoryParamsAggInterval = "1d"
+ EmailSecurityTimeseriesGroupThreatCategoryParamsAggInterval1w EmailSecurityTimeseriesGroupThreatCategoryParamsAggInterval = "1w"
+)
+
+type EmailSecurityTimeseriesGroupThreatCategoryParamsARC string
+
+const (
+ EmailSecurityTimeseriesGroupThreatCategoryParamsARCPass EmailSecurityTimeseriesGroupThreatCategoryParamsARC = "PASS"
+ EmailSecurityTimeseriesGroupThreatCategoryParamsARCNone EmailSecurityTimeseriesGroupThreatCategoryParamsARC = "NONE"
+ EmailSecurityTimeseriesGroupThreatCategoryParamsARCFail EmailSecurityTimeseriesGroupThreatCategoryParamsARC = "FAIL"
+)
+
+type EmailSecurityTimeseriesGroupThreatCategoryParamsDateRange string
+
+const (
+ EmailSecurityTimeseriesGroupThreatCategoryParamsDateRange1d EmailSecurityTimeseriesGroupThreatCategoryParamsDateRange = "1d"
+ EmailSecurityTimeseriesGroupThreatCategoryParamsDateRange2d EmailSecurityTimeseriesGroupThreatCategoryParamsDateRange = "2d"
+ EmailSecurityTimeseriesGroupThreatCategoryParamsDateRange7d EmailSecurityTimeseriesGroupThreatCategoryParamsDateRange = "7d"
+ EmailSecurityTimeseriesGroupThreatCategoryParamsDateRange14d EmailSecurityTimeseriesGroupThreatCategoryParamsDateRange = "14d"
+ EmailSecurityTimeseriesGroupThreatCategoryParamsDateRange28d EmailSecurityTimeseriesGroupThreatCategoryParamsDateRange = "28d"
+ EmailSecurityTimeseriesGroupThreatCategoryParamsDateRange12w EmailSecurityTimeseriesGroupThreatCategoryParamsDateRange = "12w"
+ EmailSecurityTimeseriesGroupThreatCategoryParamsDateRange24w EmailSecurityTimeseriesGroupThreatCategoryParamsDateRange = "24w"
+ EmailSecurityTimeseriesGroupThreatCategoryParamsDateRange52w EmailSecurityTimeseriesGroupThreatCategoryParamsDateRange = "52w"
+ EmailSecurityTimeseriesGroupThreatCategoryParamsDateRange1dControl EmailSecurityTimeseriesGroupThreatCategoryParamsDateRange = "1dControl"
+ EmailSecurityTimeseriesGroupThreatCategoryParamsDateRange2dControl EmailSecurityTimeseriesGroupThreatCategoryParamsDateRange = "2dControl"
+ EmailSecurityTimeseriesGroupThreatCategoryParamsDateRange7dControl EmailSecurityTimeseriesGroupThreatCategoryParamsDateRange = "7dControl"
+ EmailSecurityTimeseriesGroupThreatCategoryParamsDateRange14dControl EmailSecurityTimeseriesGroupThreatCategoryParamsDateRange = "14dControl"
+ EmailSecurityTimeseriesGroupThreatCategoryParamsDateRange28dControl EmailSecurityTimeseriesGroupThreatCategoryParamsDateRange = "28dControl"
+ EmailSecurityTimeseriesGroupThreatCategoryParamsDateRange12wControl EmailSecurityTimeseriesGroupThreatCategoryParamsDateRange = "12wControl"
+ EmailSecurityTimeseriesGroupThreatCategoryParamsDateRange24wControl EmailSecurityTimeseriesGroupThreatCategoryParamsDateRange = "24wControl"
+)
+
+type EmailSecurityTimeseriesGroupThreatCategoryParamsDKIM string
+
+const (
+ EmailSecurityTimeseriesGroupThreatCategoryParamsDKIMPass EmailSecurityTimeseriesGroupThreatCategoryParamsDKIM = "PASS"
+ EmailSecurityTimeseriesGroupThreatCategoryParamsDKIMNone EmailSecurityTimeseriesGroupThreatCategoryParamsDKIM = "NONE"
+ EmailSecurityTimeseriesGroupThreatCategoryParamsDKIMFail EmailSecurityTimeseriesGroupThreatCategoryParamsDKIM = "FAIL"
+)
+
+type EmailSecurityTimeseriesGroupThreatCategoryParamsDMARC string
+
+const (
+ EmailSecurityTimeseriesGroupThreatCategoryParamsDMARCPass EmailSecurityTimeseriesGroupThreatCategoryParamsDMARC = "PASS"
+ EmailSecurityTimeseriesGroupThreatCategoryParamsDMARCNone EmailSecurityTimeseriesGroupThreatCategoryParamsDMARC = "NONE"
+ EmailSecurityTimeseriesGroupThreatCategoryParamsDMARCFail EmailSecurityTimeseriesGroupThreatCategoryParamsDMARC = "FAIL"
+)
+
+// Format results are returned in.
+type EmailSecurityTimeseriesGroupThreatCategoryParamsFormat string
+
+const (
+ EmailSecurityTimeseriesGroupThreatCategoryParamsFormatJson EmailSecurityTimeseriesGroupThreatCategoryParamsFormat = "JSON"
+ EmailSecurityTimeseriesGroupThreatCategoryParamsFormatCsv EmailSecurityTimeseriesGroupThreatCategoryParamsFormat = "CSV"
+)
+
+type EmailSecurityTimeseriesGroupThreatCategoryParamsSPF string
+
+const (
+ EmailSecurityTimeseriesGroupThreatCategoryParamsSPFPass EmailSecurityTimeseriesGroupThreatCategoryParamsSPF = "PASS"
+ EmailSecurityTimeseriesGroupThreatCategoryParamsSPFNone EmailSecurityTimeseriesGroupThreatCategoryParamsSPF = "NONE"
+ EmailSecurityTimeseriesGroupThreatCategoryParamsSPFFail EmailSecurityTimeseriesGroupThreatCategoryParamsSPF = "FAIL"
+)
+
+type EmailSecurityTimeseriesGroupThreatCategoryParamsTLSVersion string
+
+const (
+ EmailSecurityTimeseriesGroupThreatCategoryParamsTLSVersionTlSv1_0 EmailSecurityTimeseriesGroupThreatCategoryParamsTLSVersion = "TLSv1_0"
+ EmailSecurityTimeseriesGroupThreatCategoryParamsTLSVersionTlSv1_1 EmailSecurityTimeseriesGroupThreatCategoryParamsTLSVersion = "TLSv1_1"
+ EmailSecurityTimeseriesGroupThreatCategoryParamsTLSVersionTlSv1_2 EmailSecurityTimeseriesGroupThreatCategoryParamsTLSVersion = "TLSv1_2"
+ EmailSecurityTimeseriesGroupThreatCategoryParamsTLSVersionTlSv1_3 EmailSecurityTimeseriesGroupThreatCategoryParamsTLSVersion = "TLSv1_3"
+)
+
+type EmailSecurityTimeseriesGroupThreatCategoryResponseEnvelope struct {
+ Result EmailSecurityTimeseriesGroupThreatCategoryResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON emailSecurityTimeseriesGroupThreatCategoryResponseEnvelopeJSON `json:"-"`
+}
+
+// emailSecurityTimeseriesGroupThreatCategoryResponseEnvelopeJSON contains the JSON
+// metadata for the struct
+// [EmailSecurityTimeseriesGroupThreatCategoryResponseEnvelope]
+type emailSecurityTimeseriesGroupThreatCategoryResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecurityTimeseriesGroupThreatCategoryResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecurityTimeseriesGroupThreatCategoryResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecurityTimeseriesGroupTLSVersionParams struct {
+ // Aggregation interval results should be returned in (for example, in 15 minutes
+ // or 1 hour intervals). Refer to
+ // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+ AggInterval param.Field[EmailSecurityTimeseriesGroupTLSVersionParamsAggInterval] `query:"aggInterval"`
+ // Filter for arc (Authenticated Received Chain).
+ ARC param.Field[[]EmailSecurityTimeseriesGroupTLSVersionParamsARC] `query:"arc"`
+ // 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[[]EmailSecurityTimeseriesGroupTLSVersionParamsDateRange] `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[[]EmailSecurityTimeseriesGroupTLSVersionParamsDKIM] `query:"dkim"`
+ // Filter for dmarc.
+ DMARC param.Field[[]EmailSecurityTimeseriesGroupTLSVersionParamsDMARC] `query:"dmarc"`
+ // Format results are returned in.
+ Format param.Field[EmailSecurityTimeseriesGroupTLSVersionParamsFormat] `query:"format"`
+ // 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[[]EmailSecurityTimeseriesGroupTLSVersionParamsSPF] `query:"spf"`
+}
+
+// URLQuery serializes [EmailSecurityTimeseriesGroupTLSVersionParams]'s query
+// parameters as `url.Values`.
+func (r EmailSecurityTimeseriesGroupTLSVersionParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Aggregation interval results should be returned in (for example, in 15 minutes
+// or 1 hour intervals). Refer to
+// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+type EmailSecurityTimeseriesGroupTLSVersionParamsAggInterval string
+
+const (
+ EmailSecurityTimeseriesGroupTLSVersionParamsAggInterval15m EmailSecurityTimeseriesGroupTLSVersionParamsAggInterval = "15m"
+ EmailSecurityTimeseriesGroupTLSVersionParamsAggInterval1h EmailSecurityTimeseriesGroupTLSVersionParamsAggInterval = "1h"
+ EmailSecurityTimeseriesGroupTLSVersionParamsAggInterval1d EmailSecurityTimeseriesGroupTLSVersionParamsAggInterval = "1d"
+ EmailSecurityTimeseriesGroupTLSVersionParamsAggInterval1w EmailSecurityTimeseriesGroupTLSVersionParamsAggInterval = "1w"
+)
+
+type EmailSecurityTimeseriesGroupTLSVersionParamsARC string
+
+const (
+ EmailSecurityTimeseriesGroupTLSVersionParamsARCPass EmailSecurityTimeseriesGroupTLSVersionParamsARC = "PASS"
+ EmailSecurityTimeseriesGroupTLSVersionParamsARCNone EmailSecurityTimeseriesGroupTLSVersionParamsARC = "NONE"
+ EmailSecurityTimeseriesGroupTLSVersionParamsARCFail EmailSecurityTimeseriesGroupTLSVersionParamsARC = "FAIL"
+)
+
+type EmailSecurityTimeseriesGroupTLSVersionParamsDateRange string
+
+const (
+ EmailSecurityTimeseriesGroupTLSVersionParamsDateRange1d EmailSecurityTimeseriesGroupTLSVersionParamsDateRange = "1d"
+ EmailSecurityTimeseriesGroupTLSVersionParamsDateRange2d EmailSecurityTimeseriesGroupTLSVersionParamsDateRange = "2d"
+ EmailSecurityTimeseriesGroupTLSVersionParamsDateRange7d EmailSecurityTimeseriesGroupTLSVersionParamsDateRange = "7d"
+ EmailSecurityTimeseriesGroupTLSVersionParamsDateRange14d EmailSecurityTimeseriesGroupTLSVersionParamsDateRange = "14d"
+ EmailSecurityTimeseriesGroupTLSVersionParamsDateRange28d EmailSecurityTimeseriesGroupTLSVersionParamsDateRange = "28d"
+ EmailSecurityTimeseriesGroupTLSVersionParamsDateRange12w EmailSecurityTimeseriesGroupTLSVersionParamsDateRange = "12w"
+ EmailSecurityTimeseriesGroupTLSVersionParamsDateRange24w EmailSecurityTimeseriesGroupTLSVersionParamsDateRange = "24w"
+ EmailSecurityTimeseriesGroupTLSVersionParamsDateRange52w EmailSecurityTimeseriesGroupTLSVersionParamsDateRange = "52w"
+ EmailSecurityTimeseriesGroupTLSVersionParamsDateRange1dControl EmailSecurityTimeseriesGroupTLSVersionParamsDateRange = "1dControl"
+ EmailSecurityTimeseriesGroupTLSVersionParamsDateRange2dControl EmailSecurityTimeseriesGroupTLSVersionParamsDateRange = "2dControl"
+ EmailSecurityTimeseriesGroupTLSVersionParamsDateRange7dControl EmailSecurityTimeseriesGroupTLSVersionParamsDateRange = "7dControl"
+ EmailSecurityTimeseriesGroupTLSVersionParamsDateRange14dControl EmailSecurityTimeseriesGroupTLSVersionParamsDateRange = "14dControl"
+ EmailSecurityTimeseriesGroupTLSVersionParamsDateRange28dControl EmailSecurityTimeseriesGroupTLSVersionParamsDateRange = "28dControl"
+ EmailSecurityTimeseriesGroupTLSVersionParamsDateRange12wControl EmailSecurityTimeseriesGroupTLSVersionParamsDateRange = "12wControl"
+ EmailSecurityTimeseriesGroupTLSVersionParamsDateRange24wControl EmailSecurityTimeseriesGroupTLSVersionParamsDateRange = "24wControl"
+)
+
+type EmailSecurityTimeseriesGroupTLSVersionParamsDKIM string
+
+const (
+ EmailSecurityTimeseriesGroupTLSVersionParamsDKIMPass EmailSecurityTimeseriesGroupTLSVersionParamsDKIM = "PASS"
+ EmailSecurityTimeseriesGroupTLSVersionParamsDKIMNone EmailSecurityTimeseriesGroupTLSVersionParamsDKIM = "NONE"
+ EmailSecurityTimeseriesGroupTLSVersionParamsDKIMFail EmailSecurityTimeseriesGroupTLSVersionParamsDKIM = "FAIL"
+)
+
+type EmailSecurityTimeseriesGroupTLSVersionParamsDMARC string
+
+const (
+ EmailSecurityTimeseriesGroupTLSVersionParamsDMARCPass EmailSecurityTimeseriesGroupTLSVersionParamsDMARC = "PASS"
+ EmailSecurityTimeseriesGroupTLSVersionParamsDMARCNone EmailSecurityTimeseriesGroupTLSVersionParamsDMARC = "NONE"
+ EmailSecurityTimeseriesGroupTLSVersionParamsDMARCFail EmailSecurityTimeseriesGroupTLSVersionParamsDMARC = "FAIL"
+)
+
+// Format results are returned in.
+type EmailSecurityTimeseriesGroupTLSVersionParamsFormat string
+
+const (
+ EmailSecurityTimeseriesGroupTLSVersionParamsFormatJson EmailSecurityTimeseriesGroupTLSVersionParamsFormat = "JSON"
+ EmailSecurityTimeseriesGroupTLSVersionParamsFormatCsv EmailSecurityTimeseriesGroupTLSVersionParamsFormat = "CSV"
+)
+
+type EmailSecurityTimeseriesGroupTLSVersionParamsSPF string
+
+const (
+ EmailSecurityTimeseriesGroupTLSVersionParamsSPFPass EmailSecurityTimeseriesGroupTLSVersionParamsSPF = "PASS"
+ EmailSecurityTimeseriesGroupTLSVersionParamsSPFNone EmailSecurityTimeseriesGroupTLSVersionParamsSPF = "NONE"
+ EmailSecurityTimeseriesGroupTLSVersionParamsSPFFail EmailSecurityTimeseriesGroupTLSVersionParamsSPF = "FAIL"
+)
+
+type EmailSecurityTimeseriesGroupTLSVersionResponseEnvelope struct {
+ Result EmailSecurityTimeseriesGroupTLSVersionResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON emailSecurityTimeseriesGroupTLSVersionResponseEnvelopeJSON `json:"-"`
+}
+
+// emailSecurityTimeseriesGroupTLSVersionResponseEnvelopeJSON contains the JSON
+// metadata for the struct [EmailSecurityTimeseriesGroupTLSVersionResponseEnvelope]
+type emailSecurityTimeseriesGroupTLSVersionResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecurityTimeseriesGroupTLSVersionResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecurityTimeseriesGroupTLSVersionResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/radar/emailsecuritytimeseriesgroup_test.go b/radar/emailsecuritytimeseriesgroup_test.go
new file mode 100644
index 00000000000..f51a38a25e1
--- /dev/null
+++ b/radar/emailsecuritytimeseriesgroup_test.go
@@ -0,0 +1,335 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/radar"
+)
+
+func TestEmailSecurityTimeseriesGroupARCWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Email.Security.TimeseriesGroups.ARC(context.TODO(), radar.EmailSecurityTimeseriesGroupARCParams{
+ AggInterval: cloudflare.F(radar.EmailSecurityTimeseriesGroupARCParamsAggInterval1h),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.EmailSecurityTimeseriesGroupARCParamsDateRange{radar.EmailSecurityTimeseriesGroupARCParamsDateRange1d, radar.EmailSecurityTimeseriesGroupARCParamsDateRange2d, radar.EmailSecurityTimeseriesGroupARCParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DKIM: cloudflare.F([]radar.EmailSecurityTimeseriesGroupARCParamsDKIM{radar.EmailSecurityTimeseriesGroupARCParamsDKIMPass, radar.EmailSecurityTimeseriesGroupARCParamsDKIMNone, radar.EmailSecurityTimeseriesGroupARCParamsDKIMFail}),
+ DMARC: cloudflare.F([]radar.EmailSecurityTimeseriesGroupARCParamsDMARC{radar.EmailSecurityTimeseriesGroupARCParamsDMARCPass, radar.EmailSecurityTimeseriesGroupARCParamsDMARCNone, radar.EmailSecurityTimeseriesGroupARCParamsDMARCFail}),
+ Format: cloudflare.F(radar.EmailSecurityTimeseriesGroupARCParamsFormatJson),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ SPF: cloudflare.F([]radar.EmailSecurityTimeseriesGroupARCParamsSPF{radar.EmailSecurityTimeseriesGroupARCParamsSPFPass, radar.EmailSecurityTimeseriesGroupARCParamsSPFNone, radar.EmailSecurityTimeseriesGroupARCParamsSPFFail}),
+ TLSVersion: cloudflare.F([]radar.EmailSecurityTimeseriesGroupARCParamsTLSVersion{radar.EmailSecurityTimeseriesGroupARCParamsTLSVersionTlSv1_0, radar.EmailSecurityTimeseriesGroupARCParamsTLSVersionTlSv1_1, radar.EmailSecurityTimeseriesGroupARCParamsTLSVersionTlSv1_2}),
+ })
+ 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())
+ }
+}
+
+func TestEmailSecurityTimeseriesGroupDKIMWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Email.Security.TimeseriesGroups.DKIM(context.TODO(), radar.EmailSecurityTimeseriesGroupDKIMParams{
+ AggInterval: cloudflare.F(radar.EmailSecurityTimeseriesGroupDKIMParamsAggInterval1h),
+ ARC: cloudflare.F([]radar.EmailSecurityTimeseriesGroupDKIMParamsARC{radar.EmailSecurityTimeseriesGroupDKIMParamsARCPass, radar.EmailSecurityTimeseriesGroupDKIMParamsARCNone, radar.EmailSecurityTimeseriesGroupDKIMParamsARCFail}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.EmailSecurityTimeseriesGroupDKIMParamsDateRange{radar.EmailSecurityTimeseriesGroupDKIMParamsDateRange1d, radar.EmailSecurityTimeseriesGroupDKIMParamsDateRange2d, radar.EmailSecurityTimeseriesGroupDKIMParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DMARC: cloudflare.F([]radar.EmailSecurityTimeseriesGroupDKIMParamsDMARC{radar.EmailSecurityTimeseriesGroupDKIMParamsDMARCPass, radar.EmailSecurityTimeseriesGroupDKIMParamsDMARCNone, radar.EmailSecurityTimeseriesGroupDKIMParamsDMARCFail}),
+ Format: cloudflare.F(radar.EmailSecurityTimeseriesGroupDKIMParamsFormatJson),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ SPF: cloudflare.F([]radar.EmailSecurityTimeseriesGroupDKIMParamsSPF{radar.EmailSecurityTimeseriesGroupDKIMParamsSPFPass, radar.EmailSecurityTimeseriesGroupDKIMParamsSPFNone, radar.EmailSecurityTimeseriesGroupDKIMParamsSPFFail}),
+ TLSVersion: cloudflare.F([]radar.EmailSecurityTimeseriesGroupDKIMParamsTLSVersion{radar.EmailSecurityTimeseriesGroupDKIMParamsTLSVersionTlSv1_0, radar.EmailSecurityTimeseriesGroupDKIMParamsTLSVersionTlSv1_1, radar.EmailSecurityTimeseriesGroupDKIMParamsTLSVersionTlSv1_2}),
+ })
+ 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())
+ }
+}
+
+func TestEmailSecurityTimeseriesGroupDMARCWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Email.Security.TimeseriesGroups.DMARC(context.TODO(), radar.EmailSecurityTimeseriesGroupDMARCParams{
+ AggInterval: cloudflare.F(radar.EmailSecurityTimeseriesGroupDMARCParamsAggInterval1h),
+ ARC: cloudflare.F([]radar.EmailSecurityTimeseriesGroupDMARCParamsARC{radar.EmailSecurityTimeseriesGroupDMARCParamsARCPass, radar.EmailSecurityTimeseriesGroupDMARCParamsARCNone, radar.EmailSecurityTimeseriesGroupDMARCParamsARCFail}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.EmailSecurityTimeseriesGroupDMARCParamsDateRange{radar.EmailSecurityTimeseriesGroupDMARCParamsDateRange1d, radar.EmailSecurityTimeseriesGroupDMARCParamsDateRange2d, radar.EmailSecurityTimeseriesGroupDMARCParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DKIM: cloudflare.F([]radar.EmailSecurityTimeseriesGroupDMARCParamsDKIM{radar.EmailSecurityTimeseriesGroupDMARCParamsDKIMPass, radar.EmailSecurityTimeseriesGroupDMARCParamsDKIMNone, radar.EmailSecurityTimeseriesGroupDMARCParamsDKIMFail}),
+ Format: cloudflare.F(radar.EmailSecurityTimeseriesGroupDMARCParamsFormatJson),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ SPF: cloudflare.F([]radar.EmailSecurityTimeseriesGroupDMARCParamsSPF{radar.EmailSecurityTimeseriesGroupDMARCParamsSPFPass, radar.EmailSecurityTimeseriesGroupDMARCParamsSPFNone, radar.EmailSecurityTimeseriesGroupDMARCParamsSPFFail}),
+ TLSVersion: cloudflare.F([]radar.EmailSecurityTimeseriesGroupDMARCParamsTLSVersion{radar.EmailSecurityTimeseriesGroupDMARCParamsTLSVersionTlSv1_0, radar.EmailSecurityTimeseriesGroupDMARCParamsTLSVersionTlSv1_1, radar.EmailSecurityTimeseriesGroupDMARCParamsTLSVersionTlSv1_2}),
+ })
+ 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())
+ }
+}
+
+func TestEmailSecurityTimeseriesGroupMaliciousWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Email.Security.TimeseriesGroups.Malicious(context.TODO(), radar.EmailSecurityTimeseriesGroupMaliciousParams{
+ AggInterval: cloudflare.F(radar.EmailSecurityTimeseriesGroupMaliciousParamsAggInterval1h),
+ ARC: cloudflare.F([]radar.EmailSecurityTimeseriesGroupMaliciousParamsARC{radar.EmailSecurityTimeseriesGroupMaliciousParamsARCPass, radar.EmailSecurityTimeseriesGroupMaliciousParamsARCNone, radar.EmailSecurityTimeseriesGroupMaliciousParamsARCFail}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.EmailSecurityTimeseriesGroupMaliciousParamsDateRange{radar.EmailSecurityTimeseriesGroupMaliciousParamsDateRange1d, radar.EmailSecurityTimeseriesGroupMaliciousParamsDateRange2d, radar.EmailSecurityTimeseriesGroupMaliciousParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DKIM: cloudflare.F([]radar.EmailSecurityTimeseriesGroupMaliciousParamsDKIM{radar.EmailSecurityTimeseriesGroupMaliciousParamsDKIMPass, radar.EmailSecurityTimeseriesGroupMaliciousParamsDKIMNone, radar.EmailSecurityTimeseriesGroupMaliciousParamsDKIMFail}),
+ DMARC: cloudflare.F([]radar.EmailSecurityTimeseriesGroupMaliciousParamsDMARC{radar.EmailSecurityTimeseriesGroupMaliciousParamsDMARCPass, radar.EmailSecurityTimeseriesGroupMaliciousParamsDMARCNone, radar.EmailSecurityTimeseriesGroupMaliciousParamsDMARCFail}),
+ Format: cloudflare.F(radar.EmailSecurityTimeseriesGroupMaliciousParamsFormatJson),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ SPF: cloudflare.F([]radar.EmailSecurityTimeseriesGroupMaliciousParamsSPF{radar.EmailSecurityTimeseriesGroupMaliciousParamsSPFPass, radar.EmailSecurityTimeseriesGroupMaliciousParamsSPFNone, radar.EmailSecurityTimeseriesGroupMaliciousParamsSPFFail}),
+ TLSVersion: cloudflare.F([]radar.EmailSecurityTimeseriesGroupMaliciousParamsTLSVersion{radar.EmailSecurityTimeseriesGroupMaliciousParamsTLSVersionTlSv1_0, radar.EmailSecurityTimeseriesGroupMaliciousParamsTLSVersionTlSv1_1, radar.EmailSecurityTimeseriesGroupMaliciousParamsTLSVersionTlSv1_2}),
+ })
+ 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())
+ }
+}
+
+func TestEmailSecurityTimeseriesGroupSpamWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Email.Security.TimeseriesGroups.Spam(context.TODO(), radar.EmailSecurityTimeseriesGroupSpamParams{
+ AggInterval: cloudflare.F(radar.EmailSecurityTimeseriesGroupSpamParamsAggInterval1h),
+ ARC: cloudflare.F([]radar.EmailSecurityTimeseriesGroupSpamParamsARC{radar.EmailSecurityTimeseriesGroupSpamParamsARCPass, radar.EmailSecurityTimeseriesGroupSpamParamsARCNone, radar.EmailSecurityTimeseriesGroupSpamParamsARCFail}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.EmailSecurityTimeseriesGroupSpamParamsDateRange{radar.EmailSecurityTimeseriesGroupSpamParamsDateRange1d, radar.EmailSecurityTimeseriesGroupSpamParamsDateRange2d, radar.EmailSecurityTimeseriesGroupSpamParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DKIM: cloudflare.F([]radar.EmailSecurityTimeseriesGroupSpamParamsDKIM{radar.EmailSecurityTimeseriesGroupSpamParamsDKIMPass, radar.EmailSecurityTimeseriesGroupSpamParamsDKIMNone, radar.EmailSecurityTimeseriesGroupSpamParamsDKIMFail}),
+ DMARC: cloudflare.F([]radar.EmailSecurityTimeseriesGroupSpamParamsDMARC{radar.EmailSecurityTimeseriesGroupSpamParamsDMARCPass, radar.EmailSecurityTimeseriesGroupSpamParamsDMARCNone, radar.EmailSecurityTimeseriesGroupSpamParamsDMARCFail}),
+ Format: cloudflare.F(radar.EmailSecurityTimeseriesGroupSpamParamsFormatJson),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ SPF: cloudflare.F([]radar.EmailSecurityTimeseriesGroupSpamParamsSPF{radar.EmailSecurityTimeseriesGroupSpamParamsSPFPass, radar.EmailSecurityTimeseriesGroupSpamParamsSPFNone, radar.EmailSecurityTimeseriesGroupSpamParamsSPFFail}),
+ TLSVersion: cloudflare.F([]radar.EmailSecurityTimeseriesGroupSpamParamsTLSVersion{radar.EmailSecurityTimeseriesGroupSpamParamsTLSVersionTlSv1_0, radar.EmailSecurityTimeseriesGroupSpamParamsTLSVersionTlSv1_1, radar.EmailSecurityTimeseriesGroupSpamParamsTLSVersionTlSv1_2}),
+ })
+ 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())
+ }
+}
+
+func TestEmailSecurityTimeseriesGroupSPFWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Email.Security.TimeseriesGroups.SPF(context.TODO(), radar.EmailSecurityTimeseriesGroupSPFParams{
+ AggInterval: cloudflare.F(radar.EmailSecurityTimeseriesGroupSPFParamsAggInterval1h),
+ ARC: cloudflare.F([]radar.EmailSecurityTimeseriesGroupSPFParamsARC{radar.EmailSecurityTimeseriesGroupSPFParamsARCPass, radar.EmailSecurityTimeseriesGroupSPFParamsARCNone, radar.EmailSecurityTimeseriesGroupSPFParamsARCFail}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.EmailSecurityTimeseriesGroupSPFParamsDateRange{radar.EmailSecurityTimeseriesGroupSPFParamsDateRange1d, radar.EmailSecurityTimeseriesGroupSPFParamsDateRange2d, radar.EmailSecurityTimeseriesGroupSPFParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DKIM: cloudflare.F([]radar.EmailSecurityTimeseriesGroupSPFParamsDKIM{radar.EmailSecurityTimeseriesGroupSPFParamsDKIMPass, radar.EmailSecurityTimeseriesGroupSPFParamsDKIMNone, radar.EmailSecurityTimeseriesGroupSPFParamsDKIMFail}),
+ DMARC: cloudflare.F([]radar.EmailSecurityTimeseriesGroupSPFParamsDMARC{radar.EmailSecurityTimeseriesGroupSPFParamsDMARCPass, radar.EmailSecurityTimeseriesGroupSPFParamsDMARCNone, radar.EmailSecurityTimeseriesGroupSPFParamsDMARCFail}),
+ Format: cloudflare.F(radar.EmailSecurityTimeseriesGroupSPFParamsFormatJson),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ TLSVersion: cloudflare.F([]radar.EmailSecurityTimeseriesGroupSPFParamsTLSVersion{radar.EmailSecurityTimeseriesGroupSPFParamsTLSVersionTlSv1_0, radar.EmailSecurityTimeseriesGroupSPFParamsTLSVersionTlSv1_1, radar.EmailSecurityTimeseriesGroupSPFParamsTLSVersionTlSv1_2}),
+ })
+ 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())
+ }
+}
+
+func TestEmailSecurityTimeseriesGroupSpoofWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Email.Security.TimeseriesGroups.Spoof(context.TODO(), radar.EmailSecurityTimeseriesGroupSpoofParams{
+ AggInterval: cloudflare.F(radar.EmailSecurityTimeseriesGroupSpoofParamsAggInterval1h),
+ ARC: cloudflare.F([]radar.EmailSecurityTimeseriesGroupSpoofParamsARC{radar.EmailSecurityTimeseriesGroupSpoofParamsARCPass, radar.EmailSecurityTimeseriesGroupSpoofParamsARCNone, radar.EmailSecurityTimeseriesGroupSpoofParamsARCFail}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.EmailSecurityTimeseriesGroupSpoofParamsDateRange{radar.EmailSecurityTimeseriesGroupSpoofParamsDateRange1d, radar.EmailSecurityTimeseriesGroupSpoofParamsDateRange2d, radar.EmailSecurityTimeseriesGroupSpoofParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DKIM: cloudflare.F([]radar.EmailSecurityTimeseriesGroupSpoofParamsDKIM{radar.EmailSecurityTimeseriesGroupSpoofParamsDKIMPass, radar.EmailSecurityTimeseriesGroupSpoofParamsDKIMNone, radar.EmailSecurityTimeseriesGroupSpoofParamsDKIMFail}),
+ DMARC: cloudflare.F([]radar.EmailSecurityTimeseriesGroupSpoofParamsDMARC{radar.EmailSecurityTimeseriesGroupSpoofParamsDMARCPass, radar.EmailSecurityTimeseriesGroupSpoofParamsDMARCNone, radar.EmailSecurityTimeseriesGroupSpoofParamsDMARCFail}),
+ Format: cloudflare.F(radar.EmailSecurityTimeseriesGroupSpoofParamsFormatJson),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ SPF: cloudflare.F([]radar.EmailSecurityTimeseriesGroupSpoofParamsSPF{radar.EmailSecurityTimeseriesGroupSpoofParamsSPFPass, radar.EmailSecurityTimeseriesGroupSpoofParamsSPFNone, radar.EmailSecurityTimeseriesGroupSpoofParamsSPFFail}),
+ TLSVersion: cloudflare.F([]radar.EmailSecurityTimeseriesGroupSpoofParamsTLSVersion{radar.EmailSecurityTimeseriesGroupSpoofParamsTLSVersionTlSv1_0, radar.EmailSecurityTimeseriesGroupSpoofParamsTLSVersionTlSv1_1, radar.EmailSecurityTimeseriesGroupSpoofParamsTLSVersionTlSv1_2}),
+ })
+ 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())
+ }
+}
+
+func TestEmailSecurityTimeseriesGroupThreatCategoryWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Email.Security.TimeseriesGroups.ThreatCategory(context.TODO(), radar.EmailSecurityTimeseriesGroupThreatCategoryParams{
+ AggInterval: cloudflare.F(radar.EmailSecurityTimeseriesGroupThreatCategoryParamsAggInterval1h),
+ ARC: cloudflare.F([]radar.EmailSecurityTimeseriesGroupThreatCategoryParamsARC{radar.EmailSecurityTimeseriesGroupThreatCategoryParamsARCPass, radar.EmailSecurityTimeseriesGroupThreatCategoryParamsARCNone, radar.EmailSecurityTimeseriesGroupThreatCategoryParamsARCFail}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.EmailSecurityTimeseriesGroupThreatCategoryParamsDateRange{radar.EmailSecurityTimeseriesGroupThreatCategoryParamsDateRange1d, radar.EmailSecurityTimeseriesGroupThreatCategoryParamsDateRange2d, radar.EmailSecurityTimeseriesGroupThreatCategoryParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DKIM: cloudflare.F([]radar.EmailSecurityTimeseriesGroupThreatCategoryParamsDKIM{radar.EmailSecurityTimeseriesGroupThreatCategoryParamsDKIMPass, radar.EmailSecurityTimeseriesGroupThreatCategoryParamsDKIMNone, radar.EmailSecurityTimeseriesGroupThreatCategoryParamsDKIMFail}),
+ DMARC: cloudflare.F([]radar.EmailSecurityTimeseriesGroupThreatCategoryParamsDMARC{radar.EmailSecurityTimeseriesGroupThreatCategoryParamsDMARCPass, radar.EmailSecurityTimeseriesGroupThreatCategoryParamsDMARCNone, radar.EmailSecurityTimeseriesGroupThreatCategoryParamsDMARCFail}),
+ Format: cloudflare.F(radar.EmailSecurityTimeseriesGroupThreatCategoryParamsFormatJson),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ SPF: cloudflare.F([]radar.EmailSecurityTimeseriesGroupThreatCategoryParamsSPF{radar.EmailSecurityTimeseriesGroupThreatCategoryParamsSPFPass, radar.EmailSecurityTimeseriesGroupThreatCategoryParamsSPFNone, radar.EmailSecurityTimeseriesGroupThreatCategoryParamsSPFFail}),
+ TLSVersion: cloudflare.F([]radar.EmailSecurityTimeseriesGroupThreatCategoryParamsTLSVersion{radar.EmailSecurityTimeseriesGroupThreatCategoryParamsTLSVersionTlSv1_0, radar.EmailSecurityTimeseriesGroupThreatCategoryParamsTLSVersionTlSv1_1, radar.EmailSecurityTimeseriesGroupThreatCategoryParamsTLSVersionTlSv1_2}),
+ })
+ 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())
+ }
+}
+
+func TestEmailSecurityTimeseriesGroupTLSVersionWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Email.Security.TimeseriesGroups.TLSVersion(context.TODO(), radar.EmailSecurityTimeseriesGroupTLSVersionParams{
+ AggInterval: cloudflare.F(radar.EmailSecurityTimeseriesGroupTLSVersionParamsAggInterval1h),
+ ARC: cloudflare.F([]radar.EmailSecurityTimeseriesGroupTLSVersionParamsARC{radar.EmailSecurityTimeseriesGroupTLSVersionParamsARCPass, radar.EmailSecurityTimeseriesGroupTLSVersionParamsARCNone, radar.EmailSecurityTimeseriesGroupTLSVersionParamsARCFail}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.EmailSecurityTimeseriesGroupTLSVersionParamsDateRange{radar.EmailSecurityTimeseriesGroupTLSVersionParamsDateRange1d, radar.EmailSecurityTimeseriesGroupTLSVersionParamsDateRange2d, radar.EmailSecurityTimeseriesGroupTLSVersionParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DKIM: cloudflare.F([]radar.EmailSecurityTimeseriesGroupTLSVersionParamsDKIM{radar.EmailSecurityTimeseriesGroupTLSVersionParamsDKIMPass, radar.EmailSecurityTimeseriesGroupTLSVersionParamsDKIMNone, radar.EmailSecurityTimeseriesGroupTLSVersionParamsDKIMFail}),
+ DMARC: cloudflare.F([]radar.EmailSecurityTimeseriesGroupTLSVersionParamsDMARC{radar.EmailSecurityTimeseriesGroupTLSVersionParamsDMARCPass, radar.EmailSecurityTimeseriesGroupTLSVersionParamsDMARCNone, radar.EmailSecurityTimeseriesGroupTLSVersionParamsDMARCFail}),
+ Format: cloudflare.F(radar.EmailSecurityTimeseriesGroupTLSVersionParamsFormatJson),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ SPF: cloudflare.F([]radar.EmailSecurityTimeseriesGroupTLSVersionParamsSPF{radar.EmailSecurityTimeseriesGroupTLSVersionParamsSPFPass, radar.EmailSecurityTimeseriesGroupTLSVersionParamsSPFNone, radar.EmailSecurityTimeseriesGroupTLSVersionParamsSPFFail}),
+ })
+ 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/radar/emailsecuritytop.go b/radar/emailsecuritytop.go
new file mode 100644
index 00000000000..6c23b0e6c52
--- /dev/null
+++ b/radar/emailsecuritytop.go
@@ -0,0 +1,27 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// EmailSecurityTopService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewEmailSecurityTopService] method
+// instead.
+type EmailSecurityTopService struct {
+ Options []option.RequestOption
+ Tlds *EmailSecurityTopTldService
+}
+
+// NewEmailSecurityTopService generates a new service that applies the given
+// options to each request. These options are applied after the parent client's
+// options (if there is one), and before any request-specific options.
+func NewEmailSecurityTopService(opts ...option.RequestOption) (r *EmailSecurityTopService) {
+ r = &EmailSecurityTopService{}
+ r.Options = opts
+ r.Tlds = NewEmailSecurityTopTldService(opts...)
+ return
+}
diff --git a/radar/emailsecuritytoptld.go b/radar/emailsecuritytoptld.go
new file mode 100644
index 00000000000..d4ef96eb7d5
--- /dev/null
+++ b/radar/emailsecuritytoptld.go
@@ -0,0 +1,345 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "context"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// EmailSecurityTopTldService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewEmailSecurityTopTldService]
+// method instead.
+type EmailSecurityTopTldService struct {
+ Options []option.RequestOption
+ Malicious *EmailSecurityTopTldMaliciousService
+ Spam *EmailSecurityTopTldSpamService
+ Spoof *EmailSecurityTopTldSpoofService
+}
+
+// NewEmailSecurityTopTldService generates a new service that applies the given
+// options to each request. These options are applied after the parent client's
+// options (if there is one), and before any request-specific options.
+func NewEmailSecurityTopTldService(opts ...option.RequestOption) (r *EmailSecurityTopTldService) {
+ r = &EmailSecurityTopTldService{}
+ r.Options = opts
+ r.Malicious = NewEmailSecurityTopTldMaliciousService(opts...)
+ r.Spam = NewEmailSecurityTopTldSpamService(opts...)
+ r.Spoof = NewEmailSecurityTopTldSpoofService(opts...)
+ return
+}
+
+// Get the top TLDs by email messages. Values are a percentage out of the total
+// emails.
+func (r *EmailSecurityTopTldService) Get(ctx context.Context, query EmailSecurityTopTldGetParams, opts ...option.RequestOption) (res *EmailSecurityTopTldGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env EmailSecurityTopTldGetResponseEnvelope
+ path := "radar/email/security/top/tlds"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type EmailSecurityTopTldGetResponse struct {
+ Meta EmailSecurityTopTldGetResponseMeta `json:"meta,required"`
+ Top0 []EmailSecurityTopTldGetResponseTop0 `json:"top_0,required"`
+ JSON emailSecurityTopTldGetResponseJSON `json:"-"`
+}
+
+// emailSecurityTopTldGetResponseJSON contains the JSON metadata for the struct
+// [EmailSecurityTopTldGetResponse]
+type emailSecurityTopTldGetResponseJSON struct {
+ Meta apijson.Field
+ Top0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecurityTopTldGetResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecurityTopTldGetResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecurityTopTldGetResponseMeta struct {
+ DateRange []EmailSecurityTopTldGetResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ ConfidenceInfo EmailSecurityTopTldGetResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON emailSecurityTopTldGetResponseMetaJSON `json:"-"`
+}
+
+// emailSecurityTopTldGetResponseMetaJSON contains the JSON metadata for the struct
+// [EmailSecurityTopTldGetResponseMeta]
+type emailSecurityTopTldGetResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecurityTopTldGetResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecurityTopTldGetResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecurityTopTldGetResponseMetaDateRange 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 emailSecurityTopTldGetResponseMetaDateRangeJSON `json:"-"`
+}
+
+// emailSecurityTopTldGetResponseMetaDateRangeJSON contains the JSON metadata for
+// the struct [EmailSecurityTopTldGetResponseMetaDateRange]
+type emailSecurityTopTldGetResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecurityTopTldGetResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecurityTopTldGetResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecurityTopTldGetResponseMetaConfidenceInfo struct {
+ Annotations []EmailSecurityTopTldGetResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON emailSecurityTopTldGetResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// emailSecurityTopTldGetResponseMetaConfidenceInfoJSON contains the JSON metadata
+// for the struct [EmailSecurityTopTldGetResponseMetaConfidenceInfo]
+type emailSecurityTopTldGetResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecurityTopTldGetResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecurityTopTldGetResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecurityTopTldGetResponseMetaConfidenceInfoAnnotation 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 emailSecurityTopTldGetResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// emailSecurityTopTldGetResponseMetaConfidenceInfoAnnotationJSON contains the JSON
+// metadata for the struct
+// [EmailSecurityTopTldGetResponseMetaConfidenceInfoAnnotation]
+type emailSecurityTopTldGetResponseMetaConfidenceInfoAnnotationJSON 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 *EmailSecurityTopTldGetResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecurityTopTldGetResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecurityTopTldGetResponseTop0 struct {
+ Name string `json:"name,required"`
+ Value string `json:"value,required"`
+ JSON emailSecurityTopTldGetResponseTop0JSON `json:"-"`
+}
+
+// emailSecurityTopTldGetResponseTop0JSON contains the JSON metadata for the struct
+// [EmailSecurityTopTldGetResponseTop0]
+type emailSecurityTopTldGetResponseTop0JSON struct {
+ Name apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecurityTopTldGetResponseTop0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecurityTopTldGetResponseTop0JSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecurityTopTldGetParams struct {
+ // Filter for arc (Authenticated Received Chain).
+ ARC param.Field[[]EmailSecurityTopTldGetParamsARC] `query:"arc"`
+ // 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[[]EmailSecurityTopTldGetParamsDateRange] `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[[]EmailSecurityTopTldGetParamsDKIM] `query:"dkim"`
+ // Filter for dmarc.
+ DMARC param.Field[[]EmailSecurityTopTldGetParamsDMARC] `query:"dmarc"`
+ // Format results are returned in.
+ Format param.Field[EmailSecurityTopTldGetParamsFormat] `query:"format"`
+ // Limit the number of objects in the response.
+ Limit param.Field[int64] `query:"limit"`
+ // 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[[]EmailSecurityTopTldGetParamsSPF] `query:"spf"`
+ // Filter for TLDs by category.
+ TldCategory param.Field[EmailSecurityTopTldGetParamsTldCategory] `query:"tldCategory"`
+ // Filter for tls version.
+ TLSVersion param.Field[[]EmailSecurityTopTldGetParamsTLSVersion] `query:"tlsVersion"`
+}
+
+// URLQuery serializes [EmailSecurityTopTldGetParams]'s query parameters as
+// `url.Values`.
+func (r EmailSecurityTopTldGetParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type EmailSecurityTopTldGetParamsARC string
+
+const (
+ EmailSecurityTopTldGetParamsARCPass EmailSecurityTopTldGetParamsARC = "PASS"
+ EmailSecurityTopTldGetParamsARCNone EmailSecurityTopTldGetParamsARC = "NONE"
+ EmailSecurityTopTldGetParamsARCFail EmailSecurityTopTldGetParamsARC = "FAIL"
+)
+
+type EmailSecurityTopTldGetParamsDateRange string
+
+const (
+ EmailSecurityTopTldGetParamsDateRange1d EmailSecurityTopTldGetParamsDateRange = "1d"
+ EmailSecurityTopTldGetParamsDateRange2d EmailSecurityTopTldGetParamsDateRange = "2d"
+ EmailSecurityTopTldGetParamsDateRange7d EmailSecurityTopTldGetParamsDateRange = "7d"
+ EmailSecurityTopTldGetParamsDateRange14d EmailSecurityTopTldGetParamsDateRange = "14d"
+ EmailSecurityTopTldGetParamsDateRange28d EmailSecurityTopTldGetParamsDateRange = "28d"
+ EmailSecurityTopTldGetParamsDateRange12w EmailSecurityTopTldGetParamsDateRange = "12w"
+ EmailSecurityTopTldGetParamsDateRange24w EmailSecurityTopTldGetParamsDateRange = "24w"
+ EmailSecurityTopTldGetParamsDateRange52w EmailSecurityTopTldGetParamsDateRange = "52w"
+ EmailSecurityTopTldGetParamsDateRange1dControl EmailSecurityTopTldGetParamsDateRange = "1dControl"
+ EmailSecurityTopTldGetParamsDateRange2dControl EmailSecurityTopTldGetParamsDateRange = "2dControl"
+ EmailSecurityTopTldGetParamsDateRange7dControl EmailSecurityTopTldGetParamsDateRange = "7dControl"
+ EmailSecurityTopTldGetParamsDateRange14dControl EmailSecurityTopTldGetParamsDateRange = "14dControl"
+ EmailSecurityTopTldGetParamsDateRange28dControl EmailSecurityTopTldGetParamsDateRange = "28dControl"
+ EmailSecurityTopTldGetParamsDateRange12wControl EmailSecurityTopTldGetParamsDateRange = "12wControl"
+ EmailSecurityTopTldGetParamsDateRange24wControl EmailSecurityTopTldGetParamsDateRange = "24wControl"
+)
+
+type EmailSecurityTopTldGetParamsDKIM string
+
+const (
+ EmailSecurityTopTldGetParamsDKIMPass EmailSecurityTopTldGetParamsDKIM = "PASS"
+ EmailSecurityTopTldGetParamsDKIMNone EmailSecurityTopTldGetParamsDKIM = "NONE"
+ EmailSecurityTopTldGetParamsDKIMFail EmailSecurityTopTldGetParamsDKIM = "FAIL"
+)
+
+type EmailSecurityTopTldGetParamsDMARC string
+
+const (
+ EmailSecurityTopTldGetParamsDMARCPass EmailSecurityTopTldGetParamsDMARC = "PASS"
+ EmailSecurityTopTldGetParamsDMARCNone EmailSecurityTopTldGetParamsDMARC = "NONE"
+ EmailSecurityTopTldGetParamsDMARCFail EmailSecurityTopTldGetParamsDMARC = "FAIL"
+)
+
+// Format results are returned in.
+type EmailSecurityTopTldGetParamsFormat string
+
+const (
+ EmailSecurityTopTldGetParamsFormatJson EmailSecurityTopTldGetParamsFormat = "JSON"
+ EmailSecurityTopTldGetParamsFormatCsv EmailSecurityTopTldGetParamsFormat = "CSV"
+)
+
+type EmailSecurityTopTldGetParamsSPF string
+
+const (
+ EmailSecurityTopTldGetParamsSPFPass EmailSecurityTopTldGetParamsSPF = "PASS"
+ EmailSecurityTopTldGetParamsSPFNone EmailSecurityTopTldGetParamsSPF = "NONE"
+ EmailSecurityTopTldGetParamsSPFFail EmailSecurityTopTldGetParamsSPF = "FAIL"
+)
+
+// Filter for TLDs by category.
+type EmailSecurityTopTldGetParamsTldCategory string
+
+const (
+ EmailSecurityTopTldGetParamsTldCategoryClassic EmailSecurityTopTldGetParamsTldCategory = "CLASSIC"
+ EmailSecurityTopTldGetParamsTldCategoryCountry EmailSecurityTopTldGetParamsTldCategory = "COUNTRY"
+)
+
+type EmailSecurityTopTldGetParamsTLSVersion string
+
+const (
+ EmailSecurityTopTldGetParamsTLSVersionTlSv1_0 EmailSecurityTopTldGetParamsTLSVersion = "TLSv1_0"
+ EmailSecurityTopTldGetParamsTLSVersionTlSv1_1 EmailSecurityTopTldGetParamsTLSVersion = "TLSv1_1"
+ EmailSecurityTopTldGetParamsTLSVersionTlSv1_2 EmailSecurityTopTldGetParamsTLSVersion = "TLSv1_2"
+ EmailSecurityTopTldGetParamsTLSVersionTlSv1_3 EmailSecurityTopTldGetParamsTLSVersion = "TLSv1_3"
+)
+
+type EmailSecurityTopTldGetResponseEnvelope struct {
+ Result EmailSecurityTopTldGetResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON emailSecurityTopTldGetResponseEnvelopeJSON `json:"-"`
+}
+
+// emailSecurityTopTldGetResponseEnvelopeJSON contains the JSON metadata for the
+// struct [EmailSecurityTopTldGetResponseEnvelope]
+type emailSecurityTopTldGetResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecurityTopTldGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecurityTopTldGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/radar/emailsecuritytoptld_test.go b/radar/emailsecuritytoptld_test.go
new file mode 100644
index 00000000000..07539d5ab53
--- /dev/null
+++ b/radar/emailsecuritytoptld_test.go
@@ -0,0 +1,53 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/radar"
+)
+
+func TestEmailSecurityTopTldGetWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Email.Security.Top.Tlds.Get(context.TODO(), radar.EmailSecurityTopTldGetParams{
+ ARC: cloudflare.F([]radar.EmailSecurityTopTldGetParamsARC{radar.EmailSecurityTopTldGetParamsARCPass, radar.EmailSecurityTopTldGetParamsARCNone, radar.EmailSecurityTopTldGetParamsARCFail}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.EmailSecurityTopTldGetParamsDateRange{radar.EmailSecurityTopTldGetParamsDateRange1d, radar.EmailSecurityTopTldGetParamsDateRange2d, radar.EmailSecurityTopTldGetParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DKIM: cloudflare.F([]radar.EmailSecurityTopTldGetParamsDKIM{radar.EmailSecurityTopTldGetParamsDKIMPass, radar.EmailSecurityTopTldGetParamsDKIMNone, radar.EmailSecurityTopTldGetParamsDKIMFail}),
+ DMARC: cloudflare.F([]radar.EmailSecurityTopTldGetParamsDMARC{radar.EmailSecurityTopTldGetParamsDMARCPass, radar.EmailSecurityTopTldGetParamsDMARCNone, radar.EmailSecurityTopTldGetParamsDMARCFail}),
+ Format: cloudflare.F(radar.EmailSecurityTopTldGetParamsFormatJson),
+ Limit: cloudflare.F(int64(5)),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ SPF: cloudflare.F([]radar.EmailSecurityTopTldGetParamsSPF{radar.EmailSecurityTopTldGetParamsSPFPass, radar.EmailSecurityTopTldGetParamsSPFNone, radar.EmailSecurityTopTldGetParamsSPFFail}),
+ TldCategory: cloudflare.F(radar.EmailSecurityTopTldGetParamsTldCategoryClassic),
+ TLSVersion: cloudflare.F([]radar.EmailSecurityTopTldGetParamsTLSVersion{radar.EmailSecurityTopTldGetParamsTLSVersionTlSv1_0, radar.EmailSecurityTopTldGetParamsTLSVersionTlSv1_1, radar.EmailSecurityTopTldGetParamsTLSVersionTlSv1_2}),
+ })
+ 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/radar/emailsecuritytoptldmalicious.go b/radar/emailsecuritytoptldmalicious.go
new file mode 100644
index 00000000000..ce71823bba7
--- /dev/null
+++ b/radar/emailsecuritytoptldmalicious.go
@@ -0,0 +1,348 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// EmailSecurityTopTldMaliciousService contains methods and other services that
+// help with interacting with the cloudflare API. Note, unlike clients, this
+// service does not read variables from the environment automatically. You should
+// not instantiate this service directly, and instead use the
+// [NewEmailSecurityTopTldMaliciousService] method instead.
+type EmailSecurityTopTldMaliciousService struct {
+ Options []option.RequestOption
+}
+
+// NewEmailSecurityTopTldMaliciousService generates a new service that applies the
+// given options to each request. These options are applied after the parent
+// client's options (if there is one), and before any request-specific options.
+func NewEmailSecurityTopTldMaliciousService(opts ...option.RequestOption) (r *EmailSecurityTopTldMaliciousService) {
+ r = &EmailSecurityTopTldMaliciousService{}
+ r.Options = opts
+ return
+}
+
+// Get the TLDs by emails classified as malicious or not.
+func (r *EmailSecurityTopTldMaliciousService) Get(ctx context.Context, malicious EmailSecurityTopTldMaliciousGetParamsMalicious, query EmailSecurityTopTldMaliciousGetParams, opts ...option.RequestOption) (res *EmailSecurityTopTldMaliciousGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env EmailSecurityTopTldMaliciousGetResponseEnvelope
+ path := fmt.Sprintf("radar/email/security/top/tlds/malicious/%v", malicious)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type EmailSecurityTopTldMaliciousGetResponse struct {
+ Meta EmailSecurityTopTldMaliciousGetResponseMeta `json:"meta,required"`
+ Top0 []EmailSecurityTopTldMaliciousGetResponseTop0 `json:"top_0,required"`
+ JSON emailSecurityTopTldMaliciousGetResponseJSON `json:"-"`
+}
+
+// emailSecurityTopTldMaliciousGetResponseJSON contains the JSON metadata for the
+// struct [EmailSecurityTopTldMaliciousGetResponse]
+type emailSecurityTopTldMaliciousGetResponseJSON struct {
+ Meta apijson.Field
+ Top0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecurityTopTldMaliciousGetResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecurityTopTldMaliciousGetResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecurityTopTldMaliciousGetResponseMeta struct {
+ DateRange []EmailSecurityTopTldMaliciousGetResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ ConfidenceInfo EmailSecurityTopTldMaliciousGetResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON emailSecurityTopTldMaliciousGetResponseMetaJSON `json:"-"`
+}
+
+// emailSecurityTopTldMaliciousGetResponseMetaJSON contains the JSON metadata for
+// the struct [EmailSecurityTopTldMaliciousGetResponseMeta]
+type emailSecurityTopTldMaliciousGetResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecurityTopTldMaliciousGetResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecurityTopTldMaliciousGetResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecurityTopTldMaliciousGetResponseMetaDateRange 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 emailSecurityTopTldMaliciousGetResponseMetaDateRangeJSON `json:"-"`
+}
+
+// emailSecurityTopTldMaliciousGetResponseMetaDateRangeJSON contains the JSON
+// metadata for the struct [EmailSecurityTopTldMaliciousGetResponseMetaDateRange]
+type emailSecurityTopTldMaliciousGetResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecurityTopTldMaliciousGetResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecurityTopTldMaliciousGetResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecurityTopTldMaliciousGetResponseMetaConfidenceInfo struct {
+ Annotations []EmailSecurityTopTldMaliciousGetResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON emailSecurityTopTldMaliciousGetResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// emailSecurityTopTldMaliciousGetResponseMetaConfidenceInfoJSON contains the JSON
+// metadata for the struct
+// [EmailSecurityTopTldMaliciousGetResponseMetaConfidenceInfo]
+type emailSecurityTopTldMaliciousGetResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecurityTopTldMaliciousGetResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecurityTopTldMaliciousGetResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecurityTopTldMaliciousGetResponseMetaConfidenceInfoAnnotation 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 emailSecurityTopTldMaliciousGetResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// emailSecurityTopTldMaliciousGetResponseMetaConfidenceInfoAnnotationJSON contains
+// the JSON metadata for the struct
+// [EmailSecurityTopTldMaliciousGetResponseMetaConfidenceInfoAnnotation]
+type emailSecurityTopTldMaliciousGetResponseMetaConfidenceInfoAnnotationJSON 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 *EmailSecurityTopTldMaliciousGetResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecurityTopTldMaliciousGetResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecurityTopTldMaliciousGetResponseTop0 struct {
+ Name string `json:"name,required"`
+ Value string `json:"value,required"`
+ JSON emailSecurityTopTldMaliciousGetResponseTop0JSON `json:"-"`
+}
+
+// emailSecurityTopTldMaliciousGetResponseTop0JSON contains the JSON metadata for
+// the struct [EmailSecurityTopTldMaliciousGetResponseTop0]
+type emailSecurityTopTldMaliciousGetResponseTop0JSON struct {
+ Name apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecurityTopTldMaliciousGetResponseTop0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecurityTopTldMaliciousGetResponseTop0JSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecurityTopTldMaliciousGetParams struct {
+ // Filter for arc (Authenticated Received Chain).
+ ARC param.Field[[]EmailSecurityTopTldMaliciousGetParamsARC] `query:"arc"`
+ // 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[[]EmailSecurityTopTldMaliciousGetParamsDateRange] `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[[]EmailSecurityTopTldMaliciousGetParamsDKIM] `query:"dkim"`
+ // Filter for dmarc.
+ DMARC param.Field[[]EmailSecurityTopTldMaliciousGetParamsDMARC] `query:"dmarc"`
+ // Format results are returned in.
+ Format param.Field[EmailSecurityTopTldMaliciousGetParamsFormat] `query:"format"`
+ // Limit the number of objects in the response.
+ Limit param.Field[int64] `query:"limit"`
+ // 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[[]EmailSecurityTopTldMaliciousGetParamsSPF] `query:"spf"`
+ // Filter for TLDs by category.
+ TldCategory param.Field[EmailSecurityTopTldMaliciousGetParamsTldCategory] `query:"tldCategory"`
+ // Filter for tls version.
+ TLSVersion param.Field[[]EmailSecurityTopTldMaliciousGetParamsTLSVersion] `query:"tlsVersion"`
+}
+
+// URLQuery serializes [EmailSecurityTopTldMaliciousGetParams]'s query parameters
+// as `url.Values`.
+func (r EmailSecurityTopTldMaliciousGetParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Malicious.
+type EmailSecurityTopTldMaliciousGetParamsMalicious string
+
+const (
+ EmailSecurityTopTldMaliciousGetParamsMaliciousMalicious EmailSecurityTopTldMaliciousGetParamsMalicious = "MALICIOUS"
+ EmailSecurityTopTldMaliciousGetParamsMaliciousNotMalicious EmailSecurityTopTldMaliciousGetParamsMalicious = "NOT_MALICIOUS"
+)
+
+type EmailSecurityTopTldMaliciousGetParamsARC string
+
+const (
+ EmailSecurityTopTldMaliciousGetParamsARCPass EmailSecurityTopTldMaliciousGetParamsARC = "PASS"
+ EmailSecurityTopTldMaliciousGetParamsARCNone EmailSecurityTopTldMaliciousGetParamsARC = "NONE"
+ EmailSecurityTopTldMaliciousGetParamsARCFail EmailSecurityTopTldMaliciousGetParamsARC = "FAIL"
+)
+
+type EmailSecurityTopTldMaliciousGetParamsDateRange string
+
+const (
+ EmailSecurityTopTldMaliciousGetParamsDateRange1d EmailSecurityTopTldMaliciousGetParamsDateRange = "1d"
+ EmailSecurityTopTldMaliciousGetParamsDateRange2d EmailSecurityTopTldMaliciousGetParamsDateRange = "2d"
+ EmailSecurityTopTldMaliciousGetParamsDateRange7d EmailSecurityTopTldMaliciousGetParamsDateRange = "7d"
+ EmailSecurityTopTldMaliciousGetParamsDateRange14d EmailSecurityTopTldMaliciousGetParamsDateRange = "14d"
+ EmailSecurityTopTldMaliciousGetParamsDateRange28d EmailSecurityTopTldMaliciousGetParamsDateRange = "28d"
+ EmailSecurityTopTldMaliciousGetParamsDateRange12w EmailSecurityTopTldMaliciousGetParamsDateRange = "12w"
+ EmailSecurityTopTldMaliciousGetParamsDateRange24w EmailSecurityTopTldMaliciousGetParamsDateRange = "24w"
+ EmailSecurityTopTldMaliciousGetParamsDateRange52w EmailSecurityTopTldMaliciousGetParamsDateRange = "52w"
+ EmailSecurityTopTldMaliciousGetParamsDateRange1dControl EmailSecurityTopTldMaliciousGetParamsDateRange = "1dControl"
+ EmailSecurityTopTldMaliciousGetParamsDateRange2dControl EmailSecurityTopTldMaliciousGetParamsDateRange = "2dControl"
+ EmailSecurityTopTldMaliciousGetParamsDateRange7dControl EmailSecurityTopTldMaliciousGetParamsDateRange = "7dControl"
+ EmailSecurityTopTldMaliciousGetParamsDateRange14dControl EmailSecurityTopTldMaliciousGetParamsDateRange = "14dControl"
+ EmailSecurityTopTldMaliciousGetParamsDateRange28dControl EmailSecurityTopTldMaliciousGetParamsDateRange = "28dControl"
+ EmailSecurityTopTldMaliciousGetParamsDateRange12wControl EmailSecurityTopTldMaliciousGetParamsDateRange = "12wControl"
+ EmailSecurityTopTldMaliciousGetParamsDateRange24wControl EmailSecurityTopTldMaliciousGetParamsDateRange = "24wControl"
+)
+
+type EmailSecurityTopTldMaliciousGetParamsDKIM string
+
+const (
+ EmailSecurityTopTldMaliciousGetParamsDKIMPass EmailSecurityTopTldMaliciousGetParamsDKIM = "PASS"
+ EmailSecurityTopTldMaliciousGetParamsDKIMNone EmailSecurityTopTldMaliciousGetParamsDKIM = "NONE"
+ EmailSecurityTopTldMaliciousGetParamsDKIMFail EmailSecurityTopTldMaliciousGetParamsDKIM = "FAIL"
+)
+
+type EmailSecurityTopTldMaliciousGetParamsDMARC string
+
+const (
+ EmailSecurityTopTldMaliciousGetParamsDMARCPass EmailSecurityTopTldMaliciousGetParamsDMARC = "PASS"
+ EmailSecurityTopTldMaliciousGetParamsDMARCNone EmailSecurityTopTldMaliciousGetParamsDMARC = "NONE"
+ EmailSecurityTopTldMaliciousGetParamsDMARCFail EmailSecurityTopTldMaliciousGetParamsDMARC = "FAIL"
+)
+
+// Format results are returned in.
+type EmailSecurityTopTldMaliciousGetParamsFormat string
+
+const (
+ EmailSecurityTopTldMaliciousGetParamsFormatJson EmailSecurityTopTldMaliciousGetParamsFormat = "JSON"
+ EmailSecurityTopTldMaliciousGetParamsFormatCsv EmailSecurityTopTldMaliciousGetParamsFormat = "CSV"
+)
+
+type EmailSecurityTopTldMaliciousGetParamsSPF string
+
+const (
+ EmailSecurityTopTldMaliciousGetParamsSPFPass EmailSecurityTopTldMaliciousGetParamsSPF = "PASS"
+ EmailSecurityTopTldMaliciousGetParamsSPFNone EmailSecurityTopTldMaliciousGetParamsSPF = "NONE"
+ EmailSecurityTopTldMaliciousGetParamsSPFFail EmailSecurityTopTldMaliciousGetParamsSPF = "FAIL"
+)
+
+// Filter for TLDs by category.
+type EmailSecurityTopTldMaliciousGetParamsTldCategory string
+
+const (
+ EmailSecurityTopTldMaliciousGetParamsTldCategoryClassic EmailSecurityTopTldMaliciousGetParamsTldCategory = "CLASSIC"
+ EmailSecurityTopTldMaliciousGetParamsTldCategoryCountry EmailSecurityTopTldMaliciousGetParamsTldCategory = "COUNTRY"
+)
+
+type EmailSecurityTopTldMaliciousGetParamsTLSVersion string
+
+const (
+ EmailSecurityTopTldMaliciousGetParamsTLSVersionTlSv1_0 EmailSecurityTopTldMaliciousGetParamsTLSVersion = "TLSv1_0"
+ EmailSecurityTopTldMaliciousGetParamsTLSVersionTlSv1_1 EmailSecurityTopTldMaliciousGetParamsTLSVersion = "TLSv1_1"
+ EmailSecurityTopTldMaliciousGetParamsTLSVersionTlSv1_2 EmailSecurityTopTldMaliciousGetParamsTLSVersion = "TLSv1_2"
+ EmailSecurityTopTldMaliciousGetParamsTLSVersionTlSv1_3 EmailSecurityTopTldMaliciousGetParamsTLSVersion = "TLSv1_3"
+)
+
+type EmailSecurityTopTldMaliciousGetResponseEnvelope struct {
+ Result EmailSecurityTopTldMaliciousGetResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON emailSecurityTopTldMaliciousGetResponseEnvelopeJSON `json:"-"`
+}
+
+// emailSecurityTopTldMaliciousGetResponseEnvelopeJSON contains the JSON metadata
+// for the struct [EmailSecurityTopTldMaliciousGetResponseEnvelope]
+type emailSecurityTopTldMaliciousGetResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecurityTopTldMaliciousGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecurityTopTldMaliciousGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/radar/emailsecuritytoptldmalicious_test.go b/radar/emailsecuritytoptldmalicious_test.go
new file mode 100644
index 00000000000..67484a15dec
--- /dev/null
+++ b/radar/emailsecuritytoptldmalicious_test.go
@@ -0,0 +1,57 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/radar"
+)
+
+func TestEmailSecurityTopTldMaliciousGetWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Email.Security.Top.Tlds.Malicious.Get(
+ context.TODO(),
+ radar.EmailSecurityTopTldMaliciousGetParamsMaliciousMalicious,
+ radar.EmailSecurityTopTldMaliciousGetParams{
+ ARC: cloudflare.F([]radar.EmailSecurityTopTldMaliciousGetParamsARC{radar.EmailSecurityTopTldMaliciousGetParamsARCPass, radar.EmailSecurityTopTldMaliciousGetParamsARCNone, radar.EmailSecurityTopTldMaliciousGetParamsARCFail}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.EmailSecurityTopTldMaliciousGetParamsDateRange{radar.EmailSecurityTopTldMaliciousGetParamsDateRange1d, radar.EmailSecurityTopTldMaliciousGetParamsDateRange2d, radar.EmailSecurityTopTldMaliciousGetParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DKIM: cloudflare.F([]radar.EmailSecurityTopTldMaliciousGetParamsDKIM{radar.EmailSecurityTopTldMaliciousGetParamsDKIMPass, radar.EmailSecurityTopTldMaliciousGetParamsDKIMNone, radar.EmailSecurityTopTldMaliciousGetParamsDKIMFail}),
+ DMARC: cloudflare.F([]radar.EmailSecurityTopTldMaliciousGetParamsDMARC{radar.EmailSecurityTopTldMaliciousGetParamsDMARCPass, radar.EmailSecurityTopTldMaliciousGetParamsDMARCNone, radar.EmailSecurityTopTldMaliciousGetParamsDMARCFail}),
+ Format: cloudflare.F(radar.EmailSecurityTopTldMaliciousGetParamsFormatJson),
+ Limit: cloudflare.F(int64(5)),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ SPF: cloudflare.F([]radar.EmailSecurityTopTldMaliciousGetParamsSPF{radar.EmailSecurityTopTldMaliciousGetParamsSPFPass, radar.EmailSecurityTopTldMaliciousGetParamsSPFNone, radar.EmailSecurityTopTldMaliciousGetParamsSPFFail}),
+ TldCategory: cloudflare.F(radar.EmailSecurityTopTldMaliciousGetParamsTldCategoryClassic),
+ TLSVersion: cloudflare.F([]radar.EmailSecurityTopTldMaliciousGetParamsTLSVersion{radar.EmailSecurityTopTldMaliciousGetParamsTLSVersionTlSv1_0, radar.EmailSecurityTopTldMaliciousGetParamsTLSVersionTlSv1_1, radar.EmailSecurityTopTldMaliciousGetParamsTLSVersionTlSv1_2}),
+ },
+ )
+ 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/radar/emailsecuritytoptldspam.go b/radar/emailsecuritytoptldspam.go
new file mode 100644
index 00000000000..5b26bf3ff00
--- /dev/null
+++ b/radar/emailsecuritytoptldspam.go
@@ -0,0 +1,347 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// EmailSecurityTopTldSpamService contains methods and other services that help
+// with interacting with the cloudflare API. Note, unlike clients, this service
+// does not read variables from the environment automatically. You should not
+// instantiate this service directly, and instead use the
+// [NewEmailSecurityTopTldSpamService] method instead.
+type EmailSecurityTopTldSpamService struct {
+ Options []option.RequestOption
+}
+
+// NewEmailSecurityTopTldSpamService generates a new service that applies the given
+// options to each request. These options are applied after the parent client's
+// options (if there is one), and before any request-specific options.
+func NewEmailSecurityTopTldSpamService(opts ...option.RequestOption) (r *EmailSecurityTopTldSpamService) {
+ r = &EmailSecurityTopTldSpamService{}
+ r.Options = opts
+ return
+}
+
+// Get the top TLDs by emails classified as Spam or not.
+func (r *EmailSecurityTopTldSpamService) Get(ctx context.Context, spam EmailSecurityTopTldSpamGetParamsSpam, query EmailSecurityTopTldSpamGetParams, opts ...option.RequestOption) (res *EmailSecurityTopTldSpamGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env EmailSecurityTopTldSpamGetResponseEnvelope
+ path := fmt.Sprintf("radar/email/security/top/tlds/spam/%v", spam)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type EmailSecurityTopTldSpamGetResponse struct {
+ Meta EmailSecurityTopTldSpamGetResponseMeta `json:"meta,required"`
+ Top0 []EmailSecurityTopTldSpamGetResponseTop0 `json:"top_0,required"`
+ JSON emailSecurityTopTldSpamGetResponseJSON `json:"-"`
+}
+
+// emailSecurityTopTldSpamGetResponseJSON contains the JSON metadata for the struct
+// [EmailSecurityTopTldSpamGetResponse]
+type emailSecurityTopTldSpamGetResponseJSON struct {
+ Meta apijson.Field
+ Top0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecurityTopTldSpamGetResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecurityTopTldSpamGetResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecurityTopTldSpamGetResponseMeta struct {
+ DateRange []EmailSecurityTopTldSpamGetResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ ConfidenceInfo EmailSecurityTopTldSpamGetResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON emailSecurityTopTldSpamGetResponseMetaJSON `json:"-"`
+}
+
+// emailSecurityTopTldSpamGetResponseMetaJSON contains the JSON metadata for the
+// struct [EmailSecurityTopTldSpamGetResponseMeta]
+type emailSecurityTopTldSpamGetResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecurityTopTldSpamGetResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecurityTopTldSpamGetResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecurityTopTldSpamGetResponseMetaDateRange 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 emailSecurityTopTldSpamGetResponseMetaDateRangeJSON `json:"-"`
+}
+
+// emailSecurityTopTldSpamGetResponseMetaDateRangeJSON contains the JSON metadata
+// for the struct [EmailSecurityTopTldSpamGetResponseMetaDateRange]
+type emailSecurityTopTldSpamGetResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecurityTopTldSpamGetResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecurityTopTldSpamGetResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecurityTopTldSpamGetResponseMetaConfidenceInfo struct {
+ Annotations []EmailSecurityTopTldSpamGetResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON emailSecurityTopTldSpamGetResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// emailSecurityTopTldSpamGetResponseMetaConfidenceInfoJSON contains the JSON
+// metadata for the struct [EmailSecurityTopTldSpamGetResponseMetaConfidenceInfo]
+type emailSecurityTopTldSpamGetResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecurityTopTldSpamGetResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecurityTopTldSpamGetResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecurityTopTldSpamGetResponseMetaConfidenceInfoAnnotation 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 emailSecurityTopTldSpamGetResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// emailSecurityTopTldSpamGetResponseMetaConfidenceInfoAnnotationJSON contains the
+// JSON metadata for the struct
+// [EmailSecurityTopTldSpamGetResponseMetaConfidenceInfoAnnotation]
+type emailSecurityTopTldSpamGetResponseMetaConfidenceInfoAnnotationJSON 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 *EmailSecurityTopTldSpamGetResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecurityTopTldSpamGetResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecurityTopTldSpamGetResponseTop0 struct {
+ Name string `json:"name,required"`
+ Value string `json:"value,required"`
+ JSON emailSecurityTopTldSpamGetResponseTop0JSON `json:"-"`
+}
+
+// emailSecurityTopTldSpamGetResponseTop0JSON contains the JSON metadata for the
+// struct [EmailSecurityTopTldSpamGetResponseTop0]
+type emailSecurityTopTldSpamGetResponseTop0JSON struct {
+ Name apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecurityTopTldSpamGetResponseTop0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecurityTopTldSpamGetResponseTop0JSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecurityTopTldSpamGetParams struct {
+ // Filter for arc (Authenticated Received Chain).
+ ARC param.Field[[]EmailSecurityTopTldSpamGetParamsARC] `query:"arc"`
+ // 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[[]EmailSecurityTopTldSpamGetParamsDateRange] `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[[]EmailSecurityTopTldSpamGetParamsDKIM] `query:"dkim"`
+ // Filter for dmarc.
+ DMARC param.Field[[]EmailSecurityTopTldSpamGetParamsDMARC] `query:"dmarc"`
+ // Format results are returned in.
+ Format param.Field[EmailSecurityTopTldSpamGetParamsFormat] `query:"format"`
+ // Limit the number of objects in the response.
+ Limit param.Field[int64] `query:"limit"`
+ // 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[[]EmailSecurityTopTldSpamGetParamsSPF] `query:"spf"`
+ // Filter for TLDs by category.
+ TldCategory param.Field[EmailSecurityTopTldSpamGetParamsTldCategory] `query:"tldCategory"`
+ // Filter for tls version.
+ TLSVersion param.Field[[]EmailSecurityTopTldSpamGetParamsTLSVersion] `query:"tlsVersion"`
+}
+
+// URLQuery serializes [EmailSecurityTopTldSpamGetParams]'s query parameters as
+// `url.Values`.
+func (r EmailSecurityTopTldSpamGetParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Spam.
+type EmailSecurityTopTldSpamGetParamsSpam string
+
+const (
+ EmailSecurityTopTldSpamGetParamsSpamSpam EmailSecurityTopTldSpamGetParamsSpam = "SPAM"
+ EmailSecurityTopTldSpamGetParamsSpamNotSpam EmailSecurityTopTldSpamGetParamsSpam = "NOT_SPAM"
+)
+
+type EmailSecurityTopTldSpamGetParamsARC string
+
+const (
+ EmailSecurityTopTldSpamGetParamsARCPass EmailSecurityTopTldSpamGetParamsARC = "PASS"
+ EmailSecurityTopTldSpamGetParamsARCNone EmailSecurityTopTldSpamGetParamsARC = "NONE"
+ EmailSecurityTopTldSpamGetParamsARCFail EmailSecurityTopTldSpamGetParamsARC = "FAIL"
+)
+
+type EmailSecurityTopTldSpamGetParamsDateRange string
+
+const (
+ EmailSecurityTopTldSpamGetParamsDateRange1d EmailSecurityTopTldSpamGetParamsDateRange = "1d"
+ EmailSecurityTopTldSpamGetParamsDateRange2d EmailSecurityTopTldSpamGetParamsDateRange = "2d"
+ EmailSecurityTopTldSpamGetParamsDateRange7d EmailSecurityTopTldSpamGetParamsDateRange = "7d"
+ EmailSecurityTopTldSpamGetParamsDateRange14d EmailSecurityTopTldSpamGetParamsDateRange = "14d"
+ EmailSecurityTopTldSpamGetParamsDateRange28d EmailSecurityTopTldSpamGetParamsDateRange = "28d"
+ EmailSecurityTopTldSpamGetParamsDateRange12w EmailSecurityTopTldSpamGetParamsDateRange = "12w"
+ EmailSecurityTopTldSpamGetParamsDateRange24w EmailSecurityTopTldSpamGetParamsDateRange = "24w"
+ EmailSecurityTopTldSpamGetParamsDateRange52w EmailSecurityTopTldSpamGetParamsDateRange = "52w"
+ EmailSecurityTopTldSpamGetParamsDateRange1dControl EmailSecurityTopTldSpamGetParamsDateRange = "1dControl"
+ EmailSecurityTopTldSpamGetParamsDateRange2dControl EmailSecurityTopTldSpamGetParamsDateRange = "2dControl"
+ EmailSecurityTopTldSpamGetParamsDateRange7dControl EmailSecurityTopTldSpamGetParamsDateRange = "7dControl"
+ EmailSecurityTopTldSpamGetParamsDateRange14dControl EmailSecurityTopTldSpamGetParamsDateRange = "14dControl"
+ EmailSecurityTopTldSpamGetParamsDateRange28dControl EmailSecurityTopTldSpamGetParamsDateRange = "28dControl"
+ EmailSecurityTopTldSpamGetParamsDateRange12wControl EmailSecurityTopTldSpamGetParamsDateRange = "12wControl"
+ EmailSecurityTopTldSpamGetParamsDateRange24wControl EmailSecurityTopTldSpamGetParamsDateRange = "24wControl"
+)
+
+type EmailSecurityTopTldSpamGetParamsDKIM string
+
+const (
+ EmailSecurityTopTldSpamGetParamsDKIMPass EmailSecurityTopTldSpamGetParamsDKIM = "PASS"
+ EmailSecurityTopTldSpamGetParamsDKIMNone EmailSecurityTopTldSpamGetParamsDKIM = "NONE"
+ EmailSecurityTopTldSpamGetParamsDKIMFail EmailSecurityTopTldSpamGetParamsDKIM = "FAIL"
+)
+
+type EmailSecurityTopTldSpamGetParamsDMARC string
+
+const (
+ EmailSecurityTopTldSpamGetParamsDMARCPass EmailSecurityTopTldSpamGetParamsDMARC = "PASS"
+ EmailSecurityTopTldSpamGetParamsDMARCNone EmailSecurityTopTldSpamGetParamsDMARC = "NONE"
+ EmailSecurityTopTldSpamGetParamsDMARCFail EmailSecurityTopTldSpamGetParamsDMARC = "FAIL"
+)
+
+// Format results are returned in.
+type EmailSecurityTopTldSpamGetParamsFormat string
+
+const (
+ EmailSecurityTopTldSpamGetParamsFormatJson EmailSecurityTopTldSpamGetParamsFormat = "JSON"
+ EmailSecurityTopTldSpamGetParamsFormatCsv EmailSecurityTopTldSpamGetParamsFormat = "CSV"
+)
+
+type EmailSecurityTopTldSpamGetParamsSPF string
+
+const (
+ EmailSecurityTopTldSpamGetParamsSPFPass EmailSecurityTopTldSpamGetParamsSPF = "PASS"
+ EmailSecurityTopTldSpamGetParamsSPFNone EmailSecurityTopTldSpamGetParamsSPF = "NONE"
+ EmailSecurityTopTldSpamGetParamsSPFFail EmailSecurityTopTldSpamGetParamsSPF = "FAIL"
+)
+
+// Filter for TLDs by category.
+type EmailSecurityTopTldSpamGetParamsTldCategory string
+
+const (
+ EmailSecurityTopTldSpamGetParamsTldCategoryClassic EmailSecurityTopTldSpamGetParamsTldCategory = "CLASSIC"
+ EmailSecurityTopTldSpamGetParamsTldCategoryCountry EmailSecurityTopTldSpamGetParamsTldCategory = "COUNTRY"
+)
+
+type EmailSecurityTopTldSpamGetParamsTLSVersion string
+
+const (
+ EmailSecurityTopTldSpamGetParamsTLSVersionTlSv1_0 EmailSecurityTopTldSpamGetParamsTLSVersion = "TLSv1_0"
+ EmailSecurityTopTldSpamGetParamsTLSVersionTlSv1_1 EmailSecurityTopTldSpamGetParamsTLSVersion = "TLSv1_1"
+ EmailSecurityTopTldSpamGetParamsTLSVersionTlSv1_2 EmailSecurityTopTldSpamGetParamsTLSVersion = "TLSv1_2"
+ EmailSecurityTopTldSpamGetParamsTLSVersionTlSv1_3 EmailSecurityTopTldSpamGetParamsTLSVersion = "TLSv1_3"
+)
+
+type EmailSecurityTopTldSpamGetResponseEnvelope struct {
+ Result EmailSecurityTopTldSpamGetResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON emailSecurityTopTldSpamGetResponseEnvelopeJSON `json:"-"`
+}
+
+// emailSecurityTopTldSpamGetResponseEnvelopeJSON contains the JSON metadata for
+// the struct [EmailSecurityTopTldSpamGetResponseEnvelope]
+type emailSecurityTopTldSpamGetResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecurityTopTldSpamGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecurityTopTldSpamGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/radar/emailsecuritytoptldspam_test.go b/radar/emailsecuritytoptldspam_test.go
new file mode 100644
index 00000000000..1c50be3f037
--- /dev/null
+++ b/radar/emailsecuritytoptldspam_test.go
@@ -0,0 +1,57 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/radar"
+)
+
+func TestEmailSecurityTopTldSpamGetWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Email.Security.Top.Tlds.Spam.Get(
+ context.TODO(),
+ radar.EmailSecurityTopTldSpamGetParamsSpamSpam,
+ radar.EmailSecurityTopTldSpamGetParams{
+ ARC: cloudflare.F([]radar.EmailSecurityTopTldSpamGetParamsARC{radar.EmailSecurityTopTldSpamGetParamsARCPass, radar.EmailSecurityTopTldSpamGetParamsARCNone, radar.EmailSecurityTopTldSpamGetParamsARCFail}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.EmailSecurityTopTldSpamGetParamsDateRange{radar.EmailSecurityTopTldSpamGetParamsDateRange1d, radar.EmailSecurityTopTldSpamGetParamsDateRange2d, radar.EmailSecurityTopTldSpamGetParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DKIM: cloudflare.F([]radar.EmailSecurityTopTldSpamGetParamsDKIM{radar.EmailSecurityTopTldSpamGetParamsDKIMPass, radar.EmailSecurityTopTldSpamGetParamsDKIMNone, radar.EmailSecurityTopTldSpamGetParamsDKIMFail}),
+ DMARC: cloudflare.F([]radar.EmailSecurityTopTldSpamGetParamsDMARC{radar.EmailSecurityTopTldSpamGetParamsDMARCPass, radar.EmailSecurityTopTldSpamGetParamsDMARCNone, radar.EmailSecurityTopTldSpamGetParamsDMARCFail}),
+ Format: cloudflare.F(radar.EmailSecurityTopTldSpamGetParamsFormatJson),
+ Limit: cloudflare.F(int64(5)),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ SPF: cloudflare.F([]radar.EmailSecurityTopTldSpamGetParamsSPF{radar.EmailSecurityTopTldSpamGetParamsSPFPass, radar.EmailSecurityTopTldSpamGetParamsSPFNone, radar.EmailSecurityTopTldSpamGetParamsSPFFail}),
+ TldCategory: cloudflare.F(radar.EmailSecurityTopTldSpamGetParamsTldCategoryClassic),
+ TLSVersion: cloudflare.F([]radar.EmailSecurityTopTldSpamGetParamsTLSVersion{radar.EmailSecurityTopTldSpamGetParamsTLSVersionTlSv1_0, radar.EmailSecurityTopTldSpamGetParamsTLSVersionTlSv1_1, radar.EmailSecurityTopTldSpamGetParamsTLSVersionTlSv1_2}),
+ },
+ )
+ 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/radar/emailsecuritytoptldspoof.go b/radar/emailsecuritytoptldspoof.go
new file mode 100644
index 00000000000..e8a0fd38df2
--- /dev/null
+++ b/radar/emailsecuritytoptldspoof.go
@@ -0,0 +1,347 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// EmailSecurityTopTldSpoofService contains methods and other services that help
+// with interacting with the cloudflare API. Note, unlike clients, this service
+// does not read variables from the environment automatically. You should not
+// instantiate this service directly, and instead use the
+// [NewEmailSecurityTopTldSpoofService] method instead.
+type EmailSecurityTopTldSpoofService struct {
+ Options []option.RequestOption
+}
+
+// NewEmailSecurityTopTldSpoofService generates a new service that applies the
+// given options to each request. These options are applied after the parent
+// client's options (if there is one), and before any request-specific options.
+func NewEmailSecurityTopTldSpoofService(opts ...option.RequestOption) (r *EmailSecurityTopTldSpoofService) {
+ r = &EmailSecurityTopTldSpoofService{}
+ r.Options = opts
+ return
+}
+
+// Get the TLDs by emails classified as spoof or not.
+func (r *EmailSecurityTopTldSpoofService) Get(ctx context.Context, spoof EmailSecurityTopTldSpoofGetParamsSpoof, query EmailSecurityTopTldSpoofGetParams, opts ...option.RequestOption) (res *EmailSecurityTopTldSpoofGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env EmailSecurityTopTldSpoofGetResponseEnvelope
+ path := fmt.Sprintf("radar/email/security/top/tlds/spoof/%v", spoof)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type EmailSecurityTopTldSpoofGetResponse struct {
+ Meta EmailSecurityTopTldSpoofGetResponseMeta `json:"meta,required"`
+ Top0 []EmailSecurityTopTldSpoofGetResponseTop0 `json:"top_0,required"`
+ JSON emailSecurityTopTldSpoofGetResponseJSON `json:"-"`
+}
+
+// emailSecurityTopTldSpoofGetResponseJSON contains the JSON metadata for the
+// struct [EmailSecurityTopTldSpoofGetResponse]
+type emailSecurityTopTldSpoofGetResponseJSON struct {
+ Meta apijson.Field
+ Top0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecurityTopTldSpoofGetResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecurityTopTldSpoofGetResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecurityTopTldSpoofGetResponseMeta struct {
+ DateRange []EmailSecurityTopTldSpoofGetResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ ConfidenceInfo EmailSecurityTopTldSpoofGetResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON emailSecurityTopTldSpoofGetResponseMetaJSON `json:"-"`
+}
+
+// emailSecurityTopTldSpoofGetResponseMetaJSON contains the JSON metadata for the
+// struct [EmailSecurityTopTldSpoofGetResponseMeta]
+type emailSecurityTopTldSpoofGetResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecurityTopTldSpoofGetResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecurityTopTldSpoofGetResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecurityTopTldSpoofGetResponseMetaDateRange 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 emailSecurityTopTldSpoofGetResponseMetaDateRangeJSON `json:"-"`
+}
+
+// emailSecurityTopTldSpoofGetResponseMetaDateRangeJSON contains the JSON metadata
+// for the struct [EmailSecurityTopTldSpoofGetResponseMetaDateRange]
+type emailSecurityTopTldSpoofGetResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecurityTopTldSpoofGetResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecurityTopTldSpoofGetResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecurityTopTldSpoofGetResponseMetaConfidenceInfo struct {
+ Annotations []EmailSecurityTopTldSpoofGetResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON emailSecurityTopTldSpoofGetResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// emailSecurityTopTldSpoofGetResponseMetaConfidenceInfoJSON contains the JSON
+// metadata for the struct [EmailSecurityTopTldSpoofGetResponseMetaConfidenceInfo]
+type emailSecurityTopTldSpoofGetResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecurityTopTldSpoofGetResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecurityTopTldSpoofGetResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecurityTopTldSpoofGetResponseMetaConfidenceInfoAnnotation 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 emailSecurityTopTldSpoofGetResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// emailSecurityTopTldSpoofGetResponseMetaConfidenceInfoAnnotationJSON contains the
+// JSON metadata for the struct
+// [EmailSecurityTopTldSpoofGetResponseMetaConfidenceInfoAnnotation]
+type emailSecurityTopTldSpoofGetResponseMetaConfidenceInfoAnnotationJSON 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 *EmailSecurityTopTldSpoofGetResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecurityTopTldSpoofGetResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecurityTopTldSpoofGetResponseTop0 struct {
+ Name string `json:"name,required"`
+ Value string `json:"value,required"`
+ JSON emailSecurityTopTldSpoofGetResponseTop0JSON `json:"-"`
+}
+
+// emailSecurityTopTldSpoofGetResponseTop0JSON contains the JSON metadata for the
+// struct [EmailSecurityTopTldSpoofGetResponseTop0]
+type emailSecurityTopTldSpoofGetResponseTop0JSON struct {
+ Name apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecurityTopTldSpoofGetResponseTop0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecurityTopTldSpoofGetResponseTop0JSON) RawJSON() string {
+ return r.raw
+}
+
+type EmailSecurityTopTldSpoofGetParams struct {
+ // Filter for arc (Authenticated Received Chain).
+ ARC param.Field[[]EmailSecurityTopTldSpoofGetParamsARC] `query:"arc"`
+ // 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[[]EmailSecurityTopTldSpoofGetParamsDateRange] `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[[]EmailSecurityTopTldSpoofGetParamsDKIM] `query:"dkim"`
+ // Filter for dmarc.
+ DMARC param.Field[[]EmailSecurityTopTldSpoofGetParamsDMARC] `query:"dmarc"`
+ // Format results are returned in.
+ Format param.Field[EmailSecurityTopTldSpoofGetParamsFormat] `query:"format"`
+ // Limit the number of objects in the response.
+ Limit param.Field[int64] `query:"limit"`
+ // 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[[]EmailSecurityTopTldSpoofGetParamsSPF] `query:"spf"`
+ // Filter for TLDs by category.
+ TldCategory param.Field[EmailSecurityTopTldSpoofGetParamsTldCategory] `query:"tldCategory"`
+ // Filter for tls version.
+ TLSVersion param.Field[[]EmailSecurityTopTldSpoofGetParamsTLSVersion] `query:"tlsVersion"`
+}
+
+// URLQuery serializes [EmailSecurityTopTldSpoofGetParams]'s query parameters as
+// `url.Values`.
+func (r EmailSecurityTopTldSpoofGetParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Spoof.
+type EmailSecurityTopTldSpoofGetParamsSpoof string
+
+const (
+ EmailSecurityTopTldSpoofGetParamsSpoofSpoof EmailSecurityTopTldSpoofGetParamsSpoof = "SPOOF"
+ EmailSecurityTopTldSpoofGetParamsSpoofNotSpoof EmailSecurityTopTldSpoofGetParamsSpoof = "NOT_SPOOF"
+)
+
+type EmailSecurityTopTldSpoofGetParamsARC string
+
+const (
+ EmailSecurityTopTldSpoofGetParamsARCPass EmailSecurityTopTldSpoofGetParamsARC = "PASS"
+ EmailSecurityTopTldSpoofGetParamsARCNone EmailSecurityTopTldSpoofGetParamsARC = "NONE"
+ EmailSecurityTopTldSpoofGetParamsARCFail EmailSecurityTopTldSpoofGetParamsARC = "FAIL"
+)
+
+type EmailSecurityTopTldSpoofGetParamsDateRange string
+
+const (
+ EmailSecurityTopTldSpoofGetParamsDateRange1d EmailSecurityTopTldSpoofGetParamsDateRange = "1d"
+ EmailSecurityTopTldSpoofGetParamsDateRange2d EmailSecurityTopTldSpoofGetParamsDateRange = "2d"
+ EmailSecurityTopTldSpoofGetParamsDateRange7d EmailSecurityTopTldSpoofGetParamsDateRange = "7d"
+ EmailSecurityTopTldSpoofGetParamsDateRange14d EmailSecurityTopTldSpoofGetParamsDateRange = "14d"
+ EmailSecurityTopTldSpoofGetParamsDateRange28d EmailSecurityTopTldSpoofGetParamsDateRange = "28d"
+ EmailSecurityTopTldSpoofGetParamsDateRange12w EmailSecurityTopTldSpoofGetParamsDateRange = "12w"
+ EmailSecurityTopTldSpoofGetParamsDateRange24w EmailSecurityTopTldSpoofGetParamsDateRange = "24w"
+ EmailSecurityTopTldSpoofGetParamsDateRange52w EmailSecurityTopTldSpoofGetParamsDateRange = "52w"
+ EmailSecurityTopTldSpoofGetParamsDateRange1dControl EmailSecurityTopTldSpoofGetParamsDateRange = "1dControl"
+ EmailSecurityTopTldSpoofGetParamsDateRange2dControl EmailSecurityTopTldSpoofGetParamsDateRange = "2dControl"
+ EmailSecurityTopTldSpoofGetParamsDateRange7dControl EmailSecurityTopTldSpoofGetParamsDateRange = "7dControl"
+ EmailSecurityTopTldSpoofGetParamsDateRange14dControl EmailSecurityTopTldSpoofGetParamsDateRange = "14dControl"
+ EmailSecurityTopTldSpoofGetParamsDateRange28dControl EmailSecurityTopTldSpoofGetParamsDateRange = "28dControl"
+ EmailSecurityTopTldSpoofGetParamsDateRange12wControl EmailSecurityTopTldSpoofGetParamsDateRange = "12wControl"
+ EmailSecurityTopTldSpoofGetParamsDateRange24wControl EmailSecurityTopTldSpoofGetParamsDateRange = "24wControl"
+)
+
+type EmailSecurityTopTldSpoofGetParamsDKIM string
+
+const (
+ EmailSecurityTopTldSpoofGetParamsDKIMPass EmailSecurityTopTldSpoofGetParamsDKIM = "PASS"
+ EmailSecurityTopTldSpoofGetParamsDKIMNone EmailSecurityTopTldSpoofGetParamsDKIM = "NONE"
+ EmailSecurityTopTldSpoofGetParamsDKIMFail EmailSecurityTopTldSpoofGetParamsDKIM = "FAIL"
+)
+
+type EmailSecurityTopTldSpoofGetParamsDMARC string
+
+const (
+ EmailSecurityTopTldSpoofGetParamsDMARCPass EmailSecurityTopTldSpoofGetParamsDMARC = "PASS"
+ EmailSecurityTopTldSpoofGetParamsDMARCNone EmailSecurityTopTldSpoofGetParamsDMARC = "NONE"
+ EmailSecurityTopTldSpoofGetParamsDMARCFail EmailSecurityTopTldSpoofGetParamsDMARC = "FAIL"
+)
+
+// Format results are returned in.
+type EmailSecurityTopTldSpoofGetParamsFormat string
+
+const (
+ EmailSecurityTopTldSpoofGetParamsFormatJson EmailSecurityTopTldSpoofGetParamsFormat = "JSON"
+ EmailSecurityTopTldSpoofGetParamsFormatCsv EmailSecurityTopTldSpoofGetParamsFormat = "CSV"
+)
+
+type EmailSecurityTopTldSpoofGetParamsSPF string
+
+const (
+ EmailSecurityTopTldSpoofGetParamsSPFPass EmailSecurityTopTldSpoofGetParamsSPF = "PASS"
+ EmailSecurityTopTldSpoofGetParamsSPFNone EmailSecurityTopTldSpoofGetParamsSPF = "NONE"
+ EmailSecurityTopTldSpoofGetParamsSPFFail EmailSecurityTopTldSpoofGetParamsSPF = "FAIL"
+)
+
+// Filter for TLDs by category.
+type EmailSecurityTopTldSpoofGetParamsTldCategory string
+
+const (
+ EmailSecurityTopTldSpoofGetParamsTldCategoryClassic EmailSecurityTopTldSpoofGetParamsTldCategory = "CLASSIC"
+ EmailSecurityTopTldSpoofGetParamsTldCategoryCountry EmailSecurityTopTldSpoofGetParamsTldCategory = "COUNTRY"
+)
+
+type EmailSecurityTopTldSpoofGetParamsTLSVersion string
+
+const (
+ EmailSecurityTopTldSpoofGetParamsTLSVersionTlSv1_0 EmailSecurityTopTldSpoofGetParamsTLSVersion = "TLSv1_0"
+ EmailSecurityTopTldSpoofGetParamsTLSVersionTlSv1_1 EmailSecurityTopTldSpoofGetParamsTLSVersion = "TLSv1_1"
+ EmailSecurityTopTldSpoofGetParamsTLSVersionTlSv1_2 EmailSecurityTopTldSpoofGetParamsTLSVersion = "TLSv1_2"
+ EmailSecurityTopTldSpoofGetParamsTLSVersionTlSv1_3 EmailSecurityTopTldSpoofGetParamsTLSVersion = "TLSv1_3"
+)
+
+type EmailSecurityTopTldSpoofGetResponseEnvelope struct {
+ Result EmailSecurityTopTldSpoofGetResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON emailSecurityTopTldSpoofGetResponseEnvelopeJSON `json:"-"`
+}
+
+// emailSecurityTopTldSpoofGetResponseEnvelopeJSON contains the JSON metadata for
+// the struct [EmailSecurityTopTldSpoofGetResponseEnvelope]
+type emailSecurityTopTldSpoofGetResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EmailSecurityTopTldSpoofGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r emailSecurityTopTldSpoofGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/radar/emailsecuritytoptldspoof_test.go b/radar/emailsecuritytoptldspoof_test.go
new file mode 100644
index 00000000000..b3acf7580f4
--- /dev/null
+++ b/radar/emailsecuritytoptldspoof_test.go
@@ -0,0 +1,57 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/radar"
+)
+
+func TestEmailSecurityTopTldSpoofGetWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Email.Security.Top.Tlds.Spoof.Get(
+ context.TODO(),
+ radar.EmailSecurityTopTldSpoofGetParamsSpoofSpoof,
+ radar.EmailSecurityTopTldSpoofGetParams{
+ ARC: cloudflare.F([]radar.EmailSecurityTopTldSpoofGetParamsARC{radar.EmailSecurityTopTldSpoofGetParamsARCPass, radar.EmailSecurityTopTldSpoofGetParamsARCNone, radar.EmailSecurityTopTldSpoofGetParamsARCFail}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.EmailSecurityTopTldSpoofGetParamsDateRange{radar.EmailSecurityTopTldSpoofGetParamsDateRange1d, radar.EmailSecurityTopTldSpoofGetParamsDateRange2d, radar.EmailSecurityTopTldSpoofGetParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DKIM: cloudflare.F([]radar.EmailSecurityTopTldSpoofGetParamsDKIM{radar.EmailSecurityTopTldSpoofGetParamsDKIMPass, radar.EmailSecurityTopTldSpoofGetParamsDKIMNone, radar.EmailSecurityTopTldSpoofGetParamsDKIMFail}),
+ DMARC: cloudflare.F([]radar.EmailSecurityTopTldSpoofGetParamsDMARC{radar.EmailSecurityTopTldSpoofGetParamsDMARCPass, radar.EmailSecurityTopTldSpoofGetParamsDMARCNone, radar.EmailSecurityTopTldSpoofGetParamsDMARCFail}),
+ Format: cloudflare.F(radar.EmailSecurityTopTldSpoofGetParamsFormatJson),
+ Limit: cloudflare.F(int64(5)),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ SPF: cloudflare.F([]radar.EmailSecurityTopTldSpoofGetParamsSPF{radar.EmailSecurityTopTldSpoofGetParamsSPFPass, radar.EmailSecurityTopTldSpoofGetParamsSPFNone, radar.EmailSecurityTopTldSpoofGetParamsSPFFail}),
+ TldCategory: cloudflare.F(radar.EmailSecurityTopTldSpoofGetParamsTldCategoryClassic),
+ TLSVersion: cloudflare.F([]radar.EmailSecurityTopTldSpoofGetParamsTLSVersion{radar.EmailSecurityTopTldSpoofGetParamsTLSVersionTlSv1_0, radar.EmailSecurityTopTldSpoofGetParamsTLSVersionTlSv1_1, radar.EmailSecurityTopTldSpoofGetParamsTLSVersionTlSv1_2}),
+ },
+ )
+ 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/radar/entity.go b/radar/entity.go
new file mode 100644
index 00000000000..2c7e31f0ce6
--- /dev/null
+++ b/radar/entity.go
@@ -0,0 +1,151 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "context"
+ "net/http"
+ "net/url"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// EntityService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewEntityService] method instead.
+type EntityService struct {
+ Options []option.RequestOption
+ ASNs *EntityASNService
+ Locations *EntityLocationService
+}
+
+// NewEntityService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewEntityService(opts ...option.RequestOption) (r *EntityService) {
+ r = &EntityService{}
+ r.Options = opts
+ r.ASNs = NewEntityASNService(opts...)
+ r.Locations = NewEntityLocationService(opts...)
+ return
+}
+
+// Get IP address information.
+func (r *EntityService) Get(ctx context.Context, query EntityGetParams, opts ...option.RequestOption) (res *EntityGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env EntityGetResponseEnvelope
+ path := "radar/entities/ip"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type EntityGetResponse struct {
+ IP EntityGetResponseIP `json:"ip,required"`
+ JSON entityGetResponseJSON `json:"-"`
+}
+
+// entityGetResponseJSON contains the JSON metadata for the struct
+// [EntityGetResponse]
+type entityGetResponseJSON struct {
+ IP apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EntityGetResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r entityGetResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type EntityGetResponseIP struct {
+ ASN string `json:"asn,required"`
+ ASNLocation string `json:"asnLocation,required"`
+ ASNName string `json:"asnName,required"`
+ ASNOrgName string `json:"asnOrgName,required"`
+ IP string `json:"ip,required"`
+ IPVersion string `json:"ipVersion,required"`
+ Location string `json:"location,required"`
+ LocationName string `json:"locationName,required"`
+ JSON entityGetResponseIPJSON `json:"-"`
+}
+
+// entityGetResponseIPJSON contains the JSON metadata for the struct
+// [EntityGetResponseIP]
+type entityGetResponseIPJSON struct {
+ ASN apijson.Field
+ ASNLocation apijson.Field
+ ASNName apijson.Field
+ ASNOrgName apijson.Field
+ IP apijson.Field
+ IPVersion apijson.Field
+ Location apijson.Field
+ LocationName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EntityGetResponseIP) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r entityGetResponseIPJSON) RawJSON() string {
+ return r.raw
+}
+
+type EntityGetParams struct {
+ // IP address.
+ IP param.Field[string] `query:"ip,required"`
+ // Format results are returned in.
+ Format param.Field[EntityGetParamsFormat] `query:"format"`
+}
+
+// URLQuery serializes [EntityGetParams]'s query parameters as `url.Values`.
+func (r EntityGetParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Format results are returned in.
+type EntityGetParamsFormat string
+
+const (
+ EntityGetParamsFormatJson EntityGetParamsFormat = "JSON"
+ EntityGetParamsFormatCsv EntityGetParamsFormat = "CSV"
+)
+
+type EntityGetResponseEnvelope struct {
+ Result EntityGetResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON entityGetResponseEnvelopeJSON `json:"-"`
+}
+
+// entityGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [EntityGetResponseEnvelope]
+type entityGetResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EntityGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r entityGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/radar/entity_test.go b/radar/entity_test.go
new file mode 100644
index 00000000000..a39840f8af8
--- /dev/null
+++ b/radar/entity_test.go
@@ -0,0 +1,42 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/radar"
+)
+
+func TestEntityGetWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Entities.Get(context.TODO(), radar.EntityGetParams{
+ IP: cloudflare.F("8.8.8.8"),
+ Format: cloudflare.F(radar.EntityGetParamsFormatJson),
+ })
+ 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/radar/entityasn.go b/radar/entityasn.go
new file mode 100644
index 00000000000..8d731578d0a
--- /dev/null
+++ b/radar/entityasn.go
@@ -0,0 +1,711 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// EntityASNService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewEntityASNService] method instead.
+type EntityASNService struct {
+ Options []option.RequestOption
+}
+
+// NewEntityASNService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewEntityASNService(opts ...option.RequestOption) (r *EntityASNService) {
+ r = &EntityASNService{}
+ r.Options = opts
+ return
+}
+
+// Gets a list of autonomous systems (AS).
+func (r *EntityASNService) List(ctx context.Context, query EntityASNListParams, opts ...option.RequestOption) (res *EntityASNListResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env EntityASNListResponseEnvelope
+ path := "radar/entities/asns"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Get the requested autonomous system information. A confidence level below `5`
+// indicates a low level of confidence in the traffic data - normally this happens
+// because Cloudflare has a small amount of traffic from/to this AS). Population
+// estimates come from APNIC (refer to https://labs.apnic.net/?p=526).
+func (r *EntityASNService) Get(ctx context.Context, asn int64, query EntityASNGetParams, opts ...option.RequestOption) (res *EntityASNGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env EntityASNGetResponseEnvelope
+ path := fmt.Sprintf("radar/entities/asns/%v", asn)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Get the requested autonomous system information based on IP address. Population
+// estimates come from APNIC (refer to https://labs.apnic.net/?p=526).
+func (r *EntityASNService) IP(ctx context.Context, query EntityASNIPParams, opts ...option.RequestOption) (res *EntityAsnipResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env EntityAsnipResponseEnvelope
+ path := "radar/entities/asns/ip"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Get AS-level relationship for given networks.
+func (r *EntityASNService) Rel(ctx context.Context, asn int64, query EntityASNRelParams, opts ...option.RequestOption) (res *EntityASNRelResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env EntityASNRelResponseEnvelope
+ path := fmt.Sprintf("radar/entities/asns/%v/rel", asn)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type EntityASNListResponse struct {
+ ASNs []EntityASNListResponseASN `json:"asns,required"`
+ JSON entityASNListResponseJSON `json:"-"`
+}
+
+// entityASNListResponseJSON contains the JSON metadata for the struct
+// [EntityASNListResponse]
+type entityASNListResponseJSON struct {
+ ASNs apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EntityASNListResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r entityASNListResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type EntityASNListResponseASN struct {
+ ASN int64 `json:"asn,required"`
+ Country string `json:"country,required"`
+ CountryName string `json:"countryName,required"`
+ Name string `json:"name,required"`
+ Aka string `json:"aka"`
+ // Deprecated field. Please use 'aka'.
+ NameLong string `json:"nameLong"`
+ OrgName string `json:"orgName"`
+ Website string `json:"website"`
+ JSON entityASNListResponseASNJSON `json:"-"`
+}
+
+// entityASNListResponseASNJSON contains the JSON metadata for the struct
+// [EntityASNListResponseASN]
+type entityASNListResponseASNJSON struct {
+ ASN apijson.Field
+ Country apijson.Field
+ CountryName apijson.Field
+ Name apijson.Field
+ Aka apijson.Field
+ NameLong apijson.Field
+ OrgName apijson.Field
+ Website apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EntityASNListResponseASN) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r entityASNListResponseASNJSON) RawJSON() string {
+ return r.raw
+}
+
+type EntityASNGetResponse struct {
+ ASN EntityASNGetResponseASN `json:"asn,required"`
+ JSON entityASNGetResponseJSON `json:"-"`
+}
+
+// entityASNGetResponseJSON contains the JSON metadata for the struct
+// [EntityASNGetResponse]
+type entityASNGetResponseJSON struct {
+ ASN apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EntityASNGetResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r entityASNGetResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type EntityASNGetResponseASN struct {
+ ASN int64 `json:"asn,required"`
+ ConfidenceLevel int64 `json:"confidenceLevel,required"`
+ Country string `json:"country,required"`
+ CountryName string `json:"countryName,required"`
+ EstimatedUsers EntityASNGetResponseASNEstimatedUsers `json:"estimatedUsers,required"`
+ Name string `json:"name,required"`
+ OrgName string `json:"orgName,required"`
+ Related []EntityASNGetResponseASNRelated `json:"related,required"`
+ // Regional Internet Registry
+ Source string `json:"source,required"`
+ Website string `json:"website,required"`
+ Aka string `json:"aka"`
+ // Deprecated field. Please use 'aka'.
+ NameLong string `json:"nameLong"`
+ JSON entityASNGetResponseASNJSON `json:"-"`
+}
+
+// entityASNGetResponseASNJSON contains the JSON metadata for the struct
+// [EntityASNGetResponseASN]
+type entityASNGetResponseASNJSON struct {
+ ASN apijson.Field
+ ConfidenceLevel apijson.Field
+ Country apijson.Field
+ CountryName apijson.Field
+ EstimatedUsers apijson.Field
+ Name apijson.Field
+ OrgName apijson.Field
+ Related apijson.Field
+ Source apijson.Field
+ Website apijson.Field
+ Aka apijson.Field
+ NameLong apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EntityASNGetResponseASN) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r entityASNGetResponseASNJSON) RawJSON() string {
+ return r.raw
+}
+
+type EntityASNGetResponseASNEstimatedUsers struct {
+ Locations []EntityASNGetResponseASNEstimatedUsersLocation `json:"locations,required"`
+ // Total estimated users
+ EstimatedUsers int64 `json:"estimatedUsers"`
+ JSON entityASNGetResponseASNEstimatedUsersJSON `json:"-"`
+}
+
+// entityASNGetResponseASNEstimatedUsersJSON contains the JSON metadata for the
+// struct [EntityASNGetResponseASNEstimatedUsers]
+type entityASNGetResponseASNEstimatedUsersJSON struct {
+ Locations apijson.Field
+ EstimatedUsers apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EntityASNGetResponseASNEstimatedUsers) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r entityASNGetResponseASNEstimatedUsersJSON) RawJSON() string {
+ return r.raw
+}
+
+type EntityASNGetResponseASNEstimatedUsersLocation struct {
+ LocationAlpha2 string `json:"locationAlpha2,required"`
+ LocationName string `json:"locationName,required"`
+ // Estimated users per location
+ EstimatedUsers int64 `json:"estimatedUsers"`
+ JSON entityASNGetResponseASNEstimatedUsersLocationJSON `json:"-"`
+}
+
+// entityASNGetResponseASNEstimatedUsersLocationJSON contains the JSON metadata for
+// the struct [EntityASNGetResponseASNEstimatedUsersLocation]
+type entityASNGetResponseASNEstimatedUsersLocationJSON struct {
+ LocationAlpha2 apijson.Field
+ LocationName apijson.Field
+ EstimatedUsers apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EntityASNGetResponseASNEstimatedUsersLocation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r entityASNGetResponseASNEstimatedUsersLocationJSON) RawJSON() string {
+ return r.raw
+}
+
+type EntityASNGetResponseASNRelated struct {
+ ASN int64 `json:"asn,required"`
+ Name string `json:"name,required"`
+ Aka string `json:"aka"`
+ // Total estimated users
+ EstimatedUsers int64 `json:"estimatedUsers"`
+ JSON entityASNGetResponseASNRelatedJSON `json:"-"`
+}
+
+// entityASNGetResponseASNRelatedJSON contains the JSON metadata for the struct
+// [EntityASNGetResponseASNRelated]
+type entityASNGetResponseASNRelatedJSON struct {
+ ASN apijson.Field
+ Name apijson.Field
+ Aka apijson.Field
+ EstimatedUsers apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EntityASNGetResponseASNRelated) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r entityASNGetResponseASNRelatedJSON) RawJSON() string {
+ return r.raw
+}
+
+type EntityAsnipResponse struct {
+ ASN EntityAsnipResponseASN `json:"asn,required"`
+ JSON entityAsnipResponseJSON `json:"-"`
+}
+
+// entityAsnipResponseJSON contains the JSON metadata for the struct
+// [EntityAsnipResponse]
+type entityAsnipResponseJSON struct {
+ ASN apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EntityAsnipResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r entityAsnipResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type EntityAsnipResponseASN struct {
+ ASN int64 `json:"asn,required"`
+ Country string `json:"country,required"`
+ CountryName string `json:"countryName,required"`
+ EstimatedUsers EntityAsnipResponseASNEstimatedUsers `json:"estimatedUsers,required"`
+ Name string `json:"name,required"`
+ OrgName string `json:"orgName,required"`
+ Related []EntityAsnipResponseASNRelated `json:"related,required"`
+ // Regional Internet Registry
+ Source string `json:"source,required"`
+ Website string `json:"website,required"`
+ Aka string `json:"aka"`
+ // Deprecated field. Please use 'aka'.
+ NameLong string `json:"nameLong"`
+ JSON entityAsnipResponseASNJSON `json:"-"`
+}
+
+// entityAsnipResponseASNJSON contains the JSON metadata for the struct
+// [EntityAsnipResponseASN]
+type entityAsnipResponseASNJSON struct {
+ ASN apijson.Field
+ Country apijson.Field
+ CountryName apijson.Field
+ EstimatedUsers apijson.Field
+ Name apijson.Field
+ OrgName apijson.Field
+ Related apijson.Field
+ Source apijson.Field
+ Website apijson.Field
+ Aka apijson.Field
+ NameLong apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EntityAsnipResponseASN) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r entityAsnipResponseASNJSON) RawJSON() string {
+ return r.raw
+}
+
+type EntityAsnipResponseASNEstimatedUsers struct {
+ Locations []EntityAsnipResponseASNEstimatedUsersLocation `json:"locations,required"`
+ // Total estimated users
+ EstimatedUsers int64 `json:"estimatedUsers"`
+ JSON entityAsnipResponseASNEstimatedUsersJSON `json:"-"`
+}
+
+// entityAsnipResponseASNEstimatedUsersJSON contains the JSON metadata for the
+// struct [EntityAsnipResponseASNEstimatedUsers]
+type entityAsnipResponseASNEstimatedUsersJSON struct {
+ Locations apijson.Field
+ EstimatedUsers apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EntityAsnipResponseASNEstimatedUsers) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r entityAsnipResponseASNEstimatedUsersJSON) RawJSON() string {
+ return r.raw
+}
+
+type EntityAsnipResponseASNEstimatedUsersLocation struct {
+ LocationAlpha2 string `json:"locationAlpha2,required"`
+ LocationName string `json:"locationName,required"`
+ // Estimated users per location
+ EstimatedUsers int64 `json:"estimatedUsers"`
+ JSON entityAsnipResponseASNEstimatedUsersLocationJSON `json:"-"`
+}
+
+// entityAsnipResponseASNEstimatedUsersLocationJSON contains the JSON metadata for
+// the struct [EntityAsnipResponseASNEstimatedUsersLocation]
+type entityAsnipResponseASNEstimatedUsersLocationJSON struct {
+ LocationAlpha2 apijson.Field
+ LocationName apijson.Field
+ EstimatedUsers apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EntityAsnipResponseASNEstimatedUsersLocation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r entityAsnipResponseASNEstimatedUsersLocationJSON) RawJSON() string {
+ return r.raw
+}
+
+type EntityAsnipResponseASNRelated struct {
+ ASN int64 `json:"asn,required"`
+ Name string `json:"name,required"`
+ Aka string `json:"aka"`
+ // Total estimated users
+ EstimatedUsers int64 `json:"estimatedUsers"`
+ JSON entityAsnipResponseASNRelatedJSON `json:"-"`
+}
+
+// entityAsnipResponseASNRelatedJSON contains the JSON metadata for the struct
+// [EntityAsnipResponseASNRelated]
+type entityAsnipResponseASNRelatedJSON struct {
+ ASN apijson.Field
+ Name apijson.Field
+ Aka apijson.Field
+ EstimatedUsers apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EntityAsnipResponseASNRelated) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r entityAsnipResponseASNRelatedJSON) RawJSON() string {
+ return r.raw
+}
+
+type EntityASNRelResponse struct {
+ Meta EntityASNRelResponseMeta `json:"meta,required"`
+ Rels []EntityASNRelResponseRel `json:"rels,required"`
+ JSON entityASNRelResponseJSON `json:"-"`
+}
+
+// entityASNRelResponseJSON contains the JSON metadata for the struct
+// [EntityASNRelResponse]
+type entityASNRelResponseJSON struct {
+ Meta apijson.Field
+ Rels apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EntityASNRelResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r entityASNRelResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type EntityASNRelResponseMeta struct {
+ DataTime string `json:"data_time,required"`
+ QueryTime string `json:"query_time,required"`
+ TotalPeers int64 `json:"total_peers,required"`
+ JSON entityASNRelResponseMetaJSON `json:"-"`
+}
+
+// entityASNRelResponseMetaJSON contains the JSON metadata for the struct
+// [EntityASNRelResponseMeta]
+type entityASNRelResponseMetaJSON struct {
+ DataTime apijson.Field
+ QueryTime apijson.Field
+ TotalPeers apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EntityASNRelResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r entityASNRelResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type EntityASNRelResponseRel struct {
+ Asn1 int64 `json:"asn1,required"`
+ Asn1Country string `json:"asn1_country,required"`
+ Asn1Name string `json:"asn1_name,required"`
+ Asn2 int64 `json:"asn2,required"`
+ Asn2Country string `json:"asn2_country,required"`
+ Asn2Name string `json:"asn2_name,required"`
+ Rel string `json:"rel,required"`
+ JSON entityASNRelResponseRelJSON `json:"-"`
+}
+
+// entityASNRelResponseRelJSON contains the JSON metadata for the struct
+// [EntityASNRelResponseRel]
+type entityASNRelResponseRelJSON struct {
+ Asn1 apijson.Field
+ Asn1Country apijson.Field
+ Asn1Name apijson.Field
+ Asn2 apijson.Field
+ Asn2Country apijson.Field
+ Asn2Name apijson.Field
+ Rel apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EntityASNRelResponseRel) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r entityASNRelResponseRelJSON) RawJSON() string {
+ return r.raw
+}
+
+type EntityASNListParams struct {
+ // Comma separated list of ASNs.
+ ASN param.Field[string] `query:"asn"`
+ // Format results are returned in.
+ Format param.Field[EntityASNListParamsFormat] `query:"format"`
+ // Limit the number of objects in the response.
+ Limit param.Field[int64] `query:"limit"`
+ // Location Alpha2 to filter results.
+ Location param.Field[string] `query:"location"`
+ // Number of objects to skip before grabbing results.
+ Offset param.Field[int64] `query:"offset"`
+ // Order asn list.
+ OrderBy param.Field[EntityASNListParamsOrderBy] `query:"orderBy"`
+}
+
+// URLQuery serializes [EntityASNListParams]'s query parameters as `url.Values`.
+func (r EntityASNListParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Format results are returned in.
+type EntityASNListParamsFormat string
+
+const (
+ EntityASNListParamsFormatJson EntityASNListParamsFormat = "JSON"
+ EntityASNListParamsFormatCsv EntityASNListParamsFormat = "CSV"
+)
+
+// Order asn list.
+type EntityASNListParamsOrderBy string
+
+const (
+ EntityASNListParamsOrderByASN EntityASNListParamsOrderBy = "ASN"
+ EntityASNListParamsOrderByPopulation EntityASNListParamsOrderBy = "POPULATION"
+)
+
+type EntityASNListResponseEnvelope struct {
+ Result EntityASNListResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON entityASNListResponseEnvelopeJSON `json:"-"`
+}
+
+// entityASNListResponseEnvelopeJSON contains the JSON metadata for the struct
+// [EntityASNListResponseEnvelope]
+type entityASNListResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EntityASNListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r entityASNListResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type EntityASNGetParams struct {
+ // Format results are returned in.
+ Format param.Field[EntityASNGetParamsFormat] `query:"format"`
+}
+
+// URLQuery serializes [EntityASNGetParams]'s query parameters as `url.Values`.
+func (r EntityASNGetParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Format results are returned in.
+type EntityASNGetParamsFormat string
+
+const (
+ EntityASNGetParamsFormatJson EntityASNGetParamsFormat = "JSON"
+ EntityASNGetParamsFormatCsv EntityASNGetParamsFormat = "CSV"
+)
+
+type EntityASNGetResponseEnvelope struct {
+ Result EntityASNGetResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON entityASNGetResponseEnvelopeJSON `json:"-"`
+}
+
+// entityASNGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [EntityASNGetResponseEnvelope]
+type entityASNGetResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EntityASNGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r entityASNGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type EntityASNIPParams struct {
+ // IP address.
+ IP param.Field[string] `query:"ip,required"`
+ // Format results are returned in.
+ Format param.Field[EntityAsnipParamsFormat] `query:"format"`
+}
+
+// URLQuery serializes [EntityASNIPParams]'s query parameters as `url.Values`.
+func (r EntityASNIPParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Format results are returned in.
+type EntityAsnipParamsFormat string
+
+const (
+ EntityAsnipParamsFormatJson EntityAsnipParamsFormat = "JSON"
+ EntityAsnipParamsFormatCsv EntityAsnipParamsFormat = "CSV"
+)
+
+type EntityAsnipResponseEnvelope struct {
+ Result EntityAsnipResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON entityAsnipResponseEnvelopeJSON `json:"-"`
+}
+
+// entityAsnipResponseEnvelopeJSON contains the JSON metadata for the struct
+// [EntityAsnipResponseEnvelope]
+type entityAsnipResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EntityAsnipResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r entityAsnipResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type EntityASNRelParams struct {
+ // Get the AS relationship of ASN2 with respect to the given ASN
+ Asn2 param.Field[int64] `query:"asn2"`
+ // Format results are returned in.
+ Format param.Field[EntityASNRelParamsFormat] `query:"format"`
+}
+
+// URLQuery serializes [EntityASNRelParams]'s query parameters as `url.Values`.
+func (r EntityASNRelParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Format results are returned in.
+type EntityASNRelParamsFormat string
+
+const (
+ EntityASNRelParamsFormatJson EntityASNRelParamsFormat = "JSON"
+ EntityASNRelParamsFormatCsv EntityASNRelParamsFormat = "CSV"
+)
+
+type EntityASNRelResponseEnvelope struct {
+ Result EntityASNRelResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON entityASNRelResponseEnvelopeJSON `json:"-"`
+}
+
+// entityASNRelResponseEnvelopeJSON contains the JSON metadata for the struct
+// [EntityASNRelResponseEnvelope]
+type entityASNRelResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EntityASNRelResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r entityASNRelResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/radar/entityasn_test.go b/radar/entityasn_test.go
new file mode 100644
index 00000000000..abea898b279
--- /dev/null
+++ b/radar/entityasn_test.go
@@ -0,0 +1,134 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/radar"
+)
+
+func TestEntityASNListWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Entities.ASNs.List(context.TODO(), radar.EntityASNListParams{
+ ASN: cloudflare.F("174,7922"),
+ Format: cloudflare.F(radar.EntityASNListParamsFormatJson),
+ Limit: cloudflare.F(int64(5)),
+ Location: cloudflare.F("US"),
+ Offset: cloudflare.F(int64(0)),
+ OrderBy: cloudflare.F(radar.EntityASNListParamsOrderByASN),
+ })
+ 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())
+ }
+}
+
+func TestEntityASNGetWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Entities.ASNs.Get(
+ context.TODO(),
+ int64(3),
+ radar.EntityASNGetParams{
+ Format: cloudflare.F(radar.EntityASNGetParamsFormatJson),
+ },
+ )
+ 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())
+ }
+}
+
+func TestEntityASNIPWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Entities.ASNs.IP(context.TODO(), radar.EntityASNIPParams{
+ IP: cloudflare.F("8.8.8.8"),
+ Format: cloudflare.F(radar.EntityAsnipParamsFormatJson),
+ })
+ 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())
+ }
+}
+
+func TestEntityASNRelWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Entities.ASNs.Rel(
+ context.TODO(),
+ int64(3),
+ radar.EntityASNRelParams{
+ Asn2: cloudflare.F(int64(0)),
+ Format: cloudflare.F(radar.EntityASNRelParamsFormatJson),
+ },
+ )
+ 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/radar/entitylocation.go b/radar/entitylocation.go
new file mode 100644
index 00000000000..929d2a584b9
--- /dev/null
+++ b/radar/entitylocation.go
@@ -0,0 +1,260 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// EntityLocationService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewEntityLocationService] method
+// instead.
+type EntityLocationService struct {
+ Options []option.RequestOption
+}
+
+// NewEntityLocationService generates a new service that applies the given options
+// to each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewEntityLocationService(opts ...option.RequestOption) (r *EntityLocationService) {
+ r = &EntityLocationService{}
+ r.Options = opts
+ return
+}
+
+// Get a list of locations.
+func (r *EntityLocationService) List(ctx context.Context, query EntityLocationListParams, opts ...option.RequestOption) (res *EntityLocationListResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env EntityLocationListResponseEnvelope
+ path := "radar/entities/locations"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Get the requested location information. A confidence level below `5` indicates a
+// low level of confidence in the traffic data - normally this happens because
+// Cloudflare has a small amount of traffic from/to this location).
+func (r *EntityLocationService) Get(ctx context.Context, location string, query EntityLocationGetParams, opts ...option.RequestOption) (res *EntityLocationGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env EntityLocationGetResponseEnvelope
+ path := fmt.Sprintf("radar/entities/locations/%s", location)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type EntityLocationListResponse struct {
+ Locations []EntityLocationListResponseLocation `json:"locations,required"`
+ JSON entityLocationListResponseJSON `json:"-"`
+}
+
+// entityLocationListResponseJSON contains the JSON metadata for the struct
+// [EntityLocationListResponse]
+type entityLocationListResponseJSON struct {
+ Locations apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EntityLocationListResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r entityLocationListResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type EntityLocationListResponseLocation struct {
+ Alpha2 string `json:"alpha2,required"`
+ Latitude string `json:"latitude,required"`
+ Longitude string `json:"longitude,required"`
+ Name string `json:"name,required"`
+ JSON entityLocationListResponseLocationJSON `json:"-"`
+}
+
+// entityLocationListResponseLocationJSON contains the JSON metadata for the struct
+// [EntityLocationListResponseLocation]
+type entityLocationListResponseLocationJSON struct {
+ Alpha2 apijson.Field
+ Latitude apijson.Field
+ Longitude apijson.Field
+ Name apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EntityLocationListResponseLocation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r entityLocationListResponseLocationJSON) RawJSON() string {
+ return r.raw
+}
+
+type EntityLocationGetResponse struct {
+ Location EntityLocationGetResponseLocation `json:"location,required"`
+ JSON entityLocationGetResponseJSON `json:"-"`
+}
+
+// entityLocationGetResponseJSON contains the JSON metadata for the struct
+// [EntityLocationGetResponse]
+type entityLocationGetResponseJSON struct {
+ Location apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EntityLocationGetResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r entityLocationGetResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type EntityLocationGetResponseLocation struct {
+ Alpha2 string `json:"alpha2,required"`
+ ConfidenceLevel int64 `json:"confidenceLevel,required"`
+ Latitude string `json:"latitude,required"`
+ Longitude string `json:"longitude,required"`
+ Name string `json:"name,required"`
+ Region string `json:"region,required"`
+ Subregion string `json:"subregion,required"`
+ JSON entityLocationGetResponseLocationJSON `json:"-"`
+}
+
+// entityLocationGetResponseLocationJSON contains the JSON metadata for the struct
+// [EntityLocationGetResponseLocation]
+type entityLocationGetResponseLocationJSON struct {
+ Alpha2 apijson.Field
+ ConfidenceLevel apijson.Field
+ Latitude apijson.Field
+ Longitude apijson.Field
+ Name apijson.Field
+ Region apijson.Field
+ Subregion apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EntityLocationGetResponseLocation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r entityLocationGetResponseLocationJSON) RawJSON() string {
+ return r.raw
+}
+
+type EntityLocationListParams struct {
+ // Format results are returned in.
+ Format param.Field[EntityLocationListParamsFormat] `query:"format"`
+ // Limit the number of objects in the response.
+ Limit param.Field[int64] `query:"limit"`
+ // Comma separated list of locations.
+ Location param.Field[string] `query:"location"`
+ // Number of objects to skip before grabbing results.
+ Offset param.Field[int64] `query:"offset"`
+}
+
+// URLQuery serializes [EntityLocationListParams]'s query parameters as
+// `url.Values`.
+func (r EntityLocationListParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Format results are returned in.
+type EntityLocationListParamsFormat string
+
+const (
+ EntityLocationListParamsFormatJson EntityLocationListParamsFormat = "JSON"
+ EntityLocationListParamsFormatCsv EntityLocationListParamsFormat = "CSV"
+)
+
+type EntityLocationListResponseEnvelope struct {
+ Result EntityLocationListResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON entityLocationListResponseEnvelopeJSON `json:"-"`
+}
+
+// entityLocationListResponseEnvelopeJSON contains the JSON metadata for the struct
+// [EntityLocationListResponseEnvelope]
+type entityLocationListResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EntityLocationListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r entityLocationListResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type EntityLocationGetParams struct {
+ // Format results are returned in.
+ Format param.Field[EntityLocationGetParamsFormat] `query:"format"`
+}
+
+// URLQuery serializes [EntityLocationGetParams]'s query parameters as
+// `url.Values`.
+func (r EntityLocationGetParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Format results are returned in.
+type EntityLocationGetParamsFormat string
+
+const (
+ EntityLocationGetParamsFormatJson EntityLocationGetParamsFormat = "JSON"
+ EntityLocationGetParamsFormatCsv EntityLocationGetParamsFormat = "CSV"
+)
+
+type EntityLocationGetResponseEnvelope struct {
+ Result EntityLocationGetResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON entityLocationGetResponseEnvelopeJSON `json:"-"`
+}
+
+// entityLocationGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [EntityLocationGetResponseEnvelope]
+type entityLocationGetResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *EntityLocationGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r entityLocationGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/radar/entitylocation_test.go b/radar/entitylocation_test.go
new file mode 100644
index 00000000000..9004167a055
--- /dev/null
+++ b/radar/entitylocation_test.go
@@ -0,0 +1,74 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/radar"
+)
+
+func TestEntityLocationListWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Entities.Locations.List(context.TODO(), radar.EntityLocationListParams{
+ Format: cloudflare.F(radar.EntityLocationListParamsFormatJson),
+ Limit: cloudflare.F(int64(5)),
+ Location: cloudflare.F("US,CA"),
+ Offset: cloudflare.F(int64(0)),
+ })
+ 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())
+ }
+}
+
+func TestEntityLocationGetWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Entities.Locations.Get(
+ context.TODO(),
+ "US",
+ radar.EntityLocationGetParams{
+ Format: cloudflare.F(radar.EntityLocationGetParamsFormatJson),
+ },
+ )
+ 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/radar/http.go b/radar/http.go
new file mode 100644
index 00000000000..05143800791
--- /dev/null
+++ b/radar/http.go
@@ -0,0 +1,34 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// HTTPService contains methods and other services that help with interacting with
+// the cloudflare API. Note, unlike clients, this service does not read variables
+// from the environment automatically. You should not instantiate this service
+// directly, and instead use the [NewHTTPService] method instead.
+type HTTPService struct {
+ Options []option.RequestOption
+ Top *HTTPTopService
+ Locations *HTTPLocationService
+ Ases *HTTPAseService
+ Summary *HTTPSummaryService
+ TimeseriesGroups *HTTPTimeseriesGroupService
+}
+
+// NewHTTPService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewHTTPService(opts ...option.RequestOption) (r *HTTPService) {
+ r = &HTTPService{}
+ r.Options = opts
+ r.Top = NewHTTPTopService(opts...)
+ r.Locations = NewHTTPLocationService(opts...)
+ r.Ases = NewHTTPAseService(opts...)
+ r.Summary = NewHTTPSummaryService(opts...)
+ r.TimeseriesGroups = NewHTTPTimeseriesGroupService(opts...)
+ return
+}
diff --git a/radar/httpase.go b/radar/httpase.go
new file mode 100644
index 00000000000..37a6cf78d5c
--- /dev/null
+++ b/radar/httpase.go
@@ -0,0 +1,377 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "context"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// HTTPAseService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewHTTPAseService] method instead.
+type HTTPAseService struct {
+ Options []option.RequestOption
+ BotClass *HTTPAseBotClassService
+ DeviceType *HTTPAseDeviceTypeService
+ HTTPProtocol *HTTPAseHTTPProtocolService
+ HTTPMethod *HTTPAseHTTPMethodService
+ IPVersion *HTTPAseIPVersionService
+ OS *HTTPAseOSService
+ TLSVersion *HTTPAseTLSVersionService
+}
+
+// NewHTTPAseService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewHTTPAseService(opts ...option.RequestOption) (r *HTTPAseService) {
+ r = &HTTPAseService{}
+ r.Options = opts
+ r.BotClass = NewHTTPAseBotClassService(opts...)
+ r.DeviceType = NewHTTPAseDeviceTypeService(opts...)
+ r.HTTPProtocol = NewHTTPAseHTTPProtocolService(opts...)
+ r.HTTPMethod = NewHTTPAseHTTPMethodService(opts...)
+ r.IPVersion = NewHTTPAseIPVersionService(opts...)
+ r.OS = NewHTTPAseOSService(opts...)
+ r.TLSVersion = NewHTTPAseTLSVersionService(opts...)
+ return
+}
+
+// Get the top autonomous systems by HTTP traffic. Values are a percentage out of
+// the total traffic.
+func (r *HTTPAseService) Get(ctx context.Context, query HTTPAseGetParams, opts ...option.RequestOption) (res *HTTPAseGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env HTTPAseGetResponseEnvelope
+ path := "radar/http/top/ases"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type HTTPAseGetResponse struct {
+ Meta HTTPAseGetResponseMeta `json:"meta,required"`
+ Top0 []HTTPAseGetResponseTop0 `json:"top_0,required"`
+ JSON httpAseGetResponseJSON `json:"-"`
+}
+
+// httpAseGetResponseJSON contains the JSON metadata for the struct
+// [HTTPAseGetResponse]
+type httpAseGetResponseJSON struct {
+ Meta apijson.Field
+ Top0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPAseGetResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpAseGetResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPAseGetResponseMeta struct {
+ DateRange []HTTPAseGetResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ ConfidenceInfo HTTPAseGetResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON httpAseGetResponseMetaJSON `json:"-"`
+}
+
+// httpAseGetResponseMetaJSON contains the JSON metadata for the struct
+// [HTTPAseGetResponseMeta]
+type httpAseGetResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPAseGetResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpAseGetResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPAseGetResponseMetaDateRange 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 httpAseGetResponseMetaDateRangeJSON `json:"-"`
+}
+
+// httpAseGetResponseMetaDateRangeJSON contains the JSON metadata for the struct
+// [HTTPAseGetResponseMetaDateRange]
+type httpAseGetResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPAseGetResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpAseGetResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPAseGetResponseMetaConfidenceInfo struct {
+ Annotations []HTTPAseGetResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON httpAseGetResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// httpAseGetResponseMetaConfidenceInfoJSON contains the JSON metadata for the
+// struct [HTTPAseGetResponseMetaConfidenceInfo]
+type httpAseGetResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPAseGetResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpAseGetResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPAseGetResponseMetaConfidenceInfoAnnotation 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 httpAseGetResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// httpAseGetResponseMetaConfidenceInfoAnnotationJSON contains the JSON metadata
+// for the struct [HTTPAseGetResponseMetaConfidenceInfoAnnotation]
+type httpAseGetResponseMetaConfidenceInfoAnnotationJSON 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 *HTTPAseGetResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpAseGetResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPAseGetResponseTop0 struct {
+ ClientASN int64 `json:"clientASN,required"`
+ ClientAsName string `json:"clientASName,required"`
+ Value string `json:"value,required"`
+ JSON httpAseGetResponseTop0JSON `json:"-"`
+}
+
+// httpAseGetResponseTop0JSON contains the JSON metadata for the struct
+// [HTTPAseGetResponseTop0]
+type httpAseGetResponseTop0JSON struct {
+ ClientASN apijson.Field
+ ClientAsName apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPAseGetResponseTop0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpAseGetResponseTop0JSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPAseGetParams 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"`
+ // Filter for bot class. Refer to
+ // [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/).
+ BotClass param.Field[[]HTTPAseGetParamsBotClass] `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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]HTTPAseGetParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Filter for device type.
+ DeviceType param.Field[[]HTTPAseGetParamsDeviceType] `query:"deviceType"`
+ // Format results are returned in.
+ Format param.Field[HTTPAseGetParamsFormat] `query:"format"`
+ // Filter for http protocol.
+ HTTPProtocol param.Field[[]HTTPAseGetParamsHTTPProtocol] `query:"httpProtocol"`
+ // Filter for http version.
+ HTTPVersion param.Field[[]HTTPAseGetParamsHTTPVersion] `query:"httpVersion"`
+ // Filter for ip version.
+ IPVersion param.Field[[]HTTPAseGetParamsIPVersion] `query:"ipVersion"`
+ // 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 os name.
+ OS param.Field[[]HTTPAseGetParamsOS] `query:"os"`
+ // Filter for tls version.
+ TLSVersion param.Field[[]HTTPAseGetParamsTLSVersion] `query:"tlsVersion"`
+}
+
+// URLQuery serializes [HTTPAseGetParams]'s query parameters as `url.Values`.
+func (r HTTPAseGetParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type HTTPAseGetParamsBotClass string
+
+const (
+ HTTPAseGetParamsBotClassLikelyAutomated HTTPAseGetParamsBotClass = "LIKELY_AUTOMATED"
+ HTTPAseGetParamsBotClassLikelyHuman HTTPAseGetParamsBotClass = "LIKELY_HUMAN"
+)
+
+type HTTPAseGetParamsDateRange string
+
+const (
+ HTTPAseGetParamsDateRange1d HTTPAseGetParamsDateRange = "1d"
+ HTTPAseGetParamsDateRange2d HTTPAseGetParamsDateRange = "2d"
+ HTTPAseGetParamsDateRange7d HTTPAseGetParamsDateRange = "7d"
+ HTTPAseGetParamsDateRange14d HTTPAseGetParamsDateRange = "14d"
+ HTTPAseGetParamsDateRange28d HTTPAseGetParamsDateRange = "28d"
+ HTTPAseGetParamsDateRange12w HTTPAseGetParamsDateRange = "12w"
+ HTTPAseGetParamsDateRange24w HTTPAseGetParamsDateRange = "24w"
+ HTTPAseGetParamsDateRange52w HTTPAseGetParamsDateRange = "52w"
+ HTTPAseGetParamsDateRange1dControl HTTPAseGetParamsDateRange = "1dControl"
+ HTTPAseGetParamsDateRange2dControl HTTPAseGetParamsDateRange = "2dControl"
+ HTTPAseGetParamsDateRange7dControl HTTPAseGetParamsDateRange = "7dControl"
+ HTTPAseGetParamsDateRange14dControl HTTPAseGetParamsDateRange = "14dControl"
+ HTTPAseGetParamsDateRange28dControl HTTPAseGetParamsDateRange = "28dControl"
+ HTTPAseGetParamsDateRange12wControl HTTPAseGetParamsDateRange = "12wControl"
+ HTTPAseGetParamsDateRange24wControl HTTPAseGetParamsDateRange = "24wControl"
+)
+
+type HTTPAseGetParamsDeviceType string
+
+const (
+ HTTPAseGetParamsDeviceTypeDesktop HTTPAseGetParamsDeviceType = "DESKTOP"
+ HTTPAseGetParamsDeviceTypeMobile HTTPAseGetParamsDeviceType = "MOBILE"
+ HTTPAseGetParamsDeviceTypeOther HTTPAseGetParamsDeviceType = "OTHER"
+)
+
+// Format results are returned in.
+type HTTPAseGetParamsFormat string
+
+const (
+ HTTPAseGetParamsFormatJson HTTPAseGetParamsFormat = "JSON"
+ HTTPAseGetParamsFormatCsv HTTPAseGetParamsFormat = "CSV"
+)
+
+type HTTPAseGetParamsHTTPProtocol string
+
+const (
+ HTTPAseGetParamsHTTPProtocolHTTP HTTPAseGetParamsHTTPProtocol = "HTTP"
+ HTTPAseGetParamsHTTPProtocolHTTPS HTTPAseGetParamsHTTPProtocol = "HTTPS"
+)
+
+type HTTPAseGetParamsHTTPVersion string
+
+const (
+ HTTPAseGetParamsHTTPVersionHttPv1 HTTPAseGetParamsHTTPVersion = "HTTPv1"
+ HTTPAseGetParamsHTTPVersionHttPv2 HTTPAseGetParamsHTTPVersion = "HTTPv2"
+ HTTPAseGetParamsHTTPVersionHttPv3 HTTPAseGetParamsHTTPVersion = "HTTPv3"
+)
+
+type HTTPAseGetParamsIPVersion string
+
+const (
+ HTTPAseGetParamsIPVersionIPv4 HTTPAseGetParamsIPVersion = "IPv4"
+ HTTPAseGetParamsIPVersionIPv6 HTTPAseGetParamsIPVersion = "IPv6"
+)
+
+type HTTPAseGetParamsOS string
+
+const (
+ HTTPAseGetParamsOSWindows HTTPAseGetParamsOS = "WINDOWS"
+ HTTPAseGetParamsOSMacosx HTTPAseGetParamsOS = "MACOSX"
+ HTTPAseGetParamsOSIos HTTPAseGetParamsOS = "IOS"
+ HTTPAseGetParamsOSAndroid HTTPAseGetParamsOS = "ANDROID"
+ HTTPAseGetParamsOSChromeos HTTPAseGetParamsOS = "CHROMEOS"
+ HTTPAseGetParamsOSLinux HTTPAseGetParamsOS = "LINUX"
+ HTTPAseGetParamsOSSmartTv HTTPAseGetParamsOS = "SMART_TV"
+)
+
+type HTTPAseGetParamsTLSVersion string
+
+const (
+ HTTPAseGetParamsTLSVersionTlSv1_0 HTTPAseGetParamsTLSVersion = "TLSv1_0"
+ HTTPAseGetParamsTLSVersionTlSv1_1 HTTPAseGetParamsTLSVersion = "TLSv1_1"
+ HTTPAseGetParamsTLSVersionTlSv1_2 HTTPAseGetParamsTLSVersion = "TLSv1_2"
+ HTTPAseGetParamsTLSVersionTlSv1_3 HTTPAseGetParamsTLSVersion = "TLSv1_3"
+ HTTPAseGetParamsTLSVersionTlSvQuic HTTPAseGetParamsTLSVersion = "TLSvQUIC"
+)
+
+type HTTPAseGetResponseEnvelope struct {
+ Result HTTPAseGetResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON httpAseGetResponseEnvelopeJSON `json:"-"`
+}
+
+// httpAseGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [HTTPAseGetResponseEnvelope]
+type httpAseGetResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPAseGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpAseGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/radar/httpase_test.go b/radar/httpase_test.go
new file mode 100644
index 00000000000..6d7ca8335c0
--- /dev/null
+++ b/radar/httpase_test.go
@@ -0,0 +1,57 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/radar"
+)
+
+func TestHTTPAseGetWithOptionalParams(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"),
+ )
+ _, err := client.Radar.HTTP.Ases.Get(context.TODO(), radar.HTTPAseGetParams{
+ ASN: cloudflare.F([]string{"string", "string", "string"}),
+ BotClass: cloudflare.F([]radar.HTTPAseGetParamsBotClass{radar.HTTPAseGetParamsBotClassLikelyAutomated, radar.HTTPAseGetParamsBotClassLikelyHuman}),
+ Continent: cloudflare.F([]string{"string", "string", "string"}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.HTTPAseGetParamsDateRange{radar.HTTPAseGetParamsDateRange1d, radar.HTTPAseGetParamsDateRange2d, radar.HTTPAseGetParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DeviceType: cloudflare.F([]radar.HTTPAseGetParamsDeviceType{radar.HTTPAseGetParamsDeviceTypeDesktop, radar.HTTPAseGetParamsDeviceTypeMobile, radar.HTTPAseGetParamsDeviceTypeOther}),
+ Format: cloudflare.F(radar.HTTPAseGetParamsFormatJson),
+ HTTPProtocol: cloudflare.F([]radar.HTTPAseGetParamsHTTPProtocol{radar.HTTPAseGetParamsHTTPProtocolHTTP, radar.HTTPAseGetParamsHTTPProtocolHTTPS}),
+ HTTPVersion: cloudflare.F([]radar.HTTPAseGetParamsHTTPVersion{radar.HTTPAseGetParamsHTTPVersionHttPv1, radar.HTTPAseGetParamsHTTPVersionHttPv2, radar.HTTPAseGetParamsHTTPVersionHttPv3}),
+ IPVersion: cloudflare.F([]radar.HTTPAseGetParamsIPVersion{radar.HTTPAseGetParamsIPVersionIPv4, radar.HTTPAseGetParamsIPVersionIPv6}),
+ Limit: cloudflare.F(int64(5)),
+ Location: cloudflare.F([]string{"string", "string", "string"}),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ OS: cloudflare.F([]radar.HTTPAseGetParamsOS{radar.HTTPAseGetParamsOSWindows, radar.HTTPAseGetParamsOSMacosx, radar.HTTPAseGetParamsOSIos}),
+ TLSVersion: cloudflare.F([]radar.HTTPAseGetParamsTLSVersion{radar.HTTPAseGetParamsTLSVersionTlSv1_0, radar.HTTPAseGetParamsTLSVersionTlSv1_1, radar.HTTPAseGetParamsTLSVersionTlSv1_2}),
+ })
+ 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/radar/httpasebotclass.go b/radar/httpasebotclass.go
new file mode 100644
index 00000000000..7102e32fcde
--- /dev/null
+++ b/radar/httpasebotclass.go
@@ -0,0 +1,366 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// HTTPAseBotClassService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewHTTPAseBotClassService] method
+// instead.
+type HTTPAseBotClassService struct {
+ Options []option.RequestOption
+}
+
+// NewHTTPAseBotClassService generates a new service that applies the given options
+// to each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewHTTPAseBotClassService(opts ...option.RequestOption) (r *HTTPAseBotClassService) {
+ r = &HTTPAseBotClassService{}
+ r.Options = opts
+ return
+}
+
+// Get the top autonomous systems (AS), by HTTP traffic, of the requested bot
+// class. These two categories use Cloudflare's bot score - refer to
+// [Bot Scores](https://developers.cloudflare.com/bots/concepts/bot-score) for more
+// information. Values are a percentage out of the total traffic.
+func (r *HTTPAseBotClassService) Get(ctx context.Context, botClass HTTPAseBotClassGetParamsBotClass, query HTTPAseBotClassGetParams, opts ...option.RequestOption) (res *HTTPAseBotClassGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env HTTPAseBotClassGetResponseEnvelope
+ path := fmt.Sprintf("radar/http/top/ases/bot_class/%v", botClass)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type HTTPAseBotClassGetResponse struct {
+ Meta HTTPAseBotClassGetResponseMeta `json:"meta,required"`
+ Top0 []HTTPAseBotClassGetResponseTop0 `json:"top_0,required"`
+ JSON httpAseBotClassGetResponseJSON `json:"-"`
+}
+
+// httpAseBotClassGetResponseJSON contains the JSON metadata for the struct
+// [HTTPAseBotClassGetResponse]
+type httpAseBotClassGetResponseJSON struct {
+ Meta apijson.Field
+ Top0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPAseBotClassGetResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpAseBotClassGetResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPAseBotClassGetResponseMeta struct {
+ DateRange []HTTPAseBotClassGetResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ ConfidenceInfo HTTPAseBotClassGetResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON httpAseBotClassGetResponseMetaJSON `json:"-"`
+}
+
+// httpAseBotClassGetResponseMetaJSON contains the JSON metadata for the struct
+// [HTTPAseBotClassGetResponseMeta]
+type httpAseBotClassGetResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPAseBotClassGetResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpAseBotClassGetResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPAseBotClassGetResponseMetaDateRange 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 httpAseBotClassGetResponseMetaDateRangeJSON `json:"-"`
+}
+
+// httpAseBotClassGetResponseMetaDateRangeJSON contains the JSON metadata for the
+// struct [HTTPAseBotClassGetResponseMetaDateRange]
+type httpAseBotClassGetResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPAseBotClassGetResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpAseBotClassGetResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPAseBotClassGetResponseMetaConfidenceInfo struct {
+ Annotations []HTTPAseBotClassGetResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON httpAseBotClassGetResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// httpAseBotClassGetResponseMetaConfidenceInfoJSON contains the JSON metadata for
+// the struct [HTTPAseBotClassGetResponseMetaConfidenceInfo]
+type httpAseBotClassGetResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPAseBotClassGetResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpAseBotClassGetResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPAseBotClassGetResponseMetaConfidenceInfoAnnotation 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 httpAseBotClassGetResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// httpAseBotClassGetResponseMetaConfidenceInfoAnnotationJSON contains the JSON
+// metadata for the struct [HTTPAseBotClassGetResponseMetaConfidenceInfoAnnotation]
+type httpAseBotClassGetResponseMetaConfidenceInfoAnnotationJSON 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 *HTTPAseBotClassGetResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpAseBotClassGetResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPAseBotClassGetResponseTop0 struct {
+ ClientASN int64 `json:"clientASN,required"`
+ ClientAsName string `json:"clientASName,required"`
+ Value string `json:"value,required"`
+ JSON httpAseBotClassGetResponseTop0JSON `json:"-"`
+}
+
+// httpAseBotClassGetResponseTop0JSON contains the JSON metadata for the struct
+// [HTTPAseBotClassGetResponseTop0]
+type httpAseBotClassGetResponseTop0JSON struct {
+ ClientASN apijson.Field
+ ClientAsName apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPAseBotClassGetResponseTop0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpAseBotClassGetResponseTop0JSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPAseBotClassGetParams 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"`
+ // 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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]HTTPAseBotClassGetParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Filter for device type.
+ DeviceType param.Field[[]HTTPAseBotClassGetParamsDeviceType] `query:"deviceType"`
+ // Format results are returned in.
+ Format param.Field[HTTPAseBotClassGetParamsFormat] `query:"format"`
+ // Filter for http protocol.
+ HTTPProtocol param.Field[[]HTTPAseBotClassGetParamsHTTPProtocol] `query:"httpProtocol"`
+ // Filter for http version.
+ HTTPVersion param.Field[[]HTTPAseBotClassGetParamsHTTPVersion] `query:"httpVersion"`
+ // Filter for ip version.
+ IPVersion param.Field[[]HTTPAseBotClassGetParamsIPVersion] `query:"ipVersion"`
+ // 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 os name.
+ OS param.Field[[]HTTPAseBotClassGetParamsOS] `query:"os"`
+ // Filter for tls version.
+ TLSVersion param.Field[[]HTTPAseBotClassGetParamsTLSVersion] `query:"tlsVersion"`
+}
+
+// URLQuery serializes [HTTPAseBotClassGetParams]'s query parameters as
+// `url.Values`.
+func (r HTTPAseBotClassGetParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Bot class.
+type HTTPAseBotClassGetParamsBotClass string
+
+const (
+ HTTPAseBotClassGetParamsBotClassLikelyAutomated HTTPAseBotClassGetParamsBotClass = "LIKELY_AUTOMATED"
+ HTTPAseBotClassGetParamsBotClassLikelyHuman HTTPAseBotClassGetParamsBotClass = "LIKELY_HUMAN"
+)
+
+type HTTPAseBotClassGetParamsDateRange string
+
+const (
+ HTTPAseBotClassGetParamsDateRange1d HTTPAseBotClassGetParamsDateRange = "1d"
+ HTTPAseBotClassGetParamsDateRange2d HTTPAseBotClassGetParamsDateRange = "2d"
+ HTTPAseBotClassGetParamsDateRange7d HTTPAseBotClassGetParamsDateRange = "7d"
+ HTTPAseBotClassGetParamsDateRange14d HTTPAseBotClassGetParamsDateRange = "14d"
+ HTTPAseBotClassGetParamsDateRange28d HTTPAseBotClassGetParamsDateRange = "28d"
+ HTTPAseBotClassGetParamsDateRange12w HTTPAseBotClassGetParamsDateRange = "12w"
+ HTTPAseBotClassGetParamsDateRange24w HTTPAseBotClassGetParamsDateRange = "24w"
+ HTTPAseBotClassGetParamsDateRange52w HTTPAseBotClassGetParamsDateRange = "52w"
+ HTTPAseBotClassGetParamsDateRange1dControl HTTPAseBotClassGetParamsDateRange = "1dControl"
+ HTTPAseBotClassGetParamsDateRange2dControl HTTPAseBotClassGetParamsDateRange = "2dControl"
+ HTTPAseBotClassGetParamsDateRange7dControl HTTPAseBotClassGetParamsDateRange = "7dControl"
+ HTTPAseBotClassGetParamsDateRange14dControl HTTPAseBotClassGetParamsDateRange = "14dControl"
+ HTTPAseBotClassGetParamsDateRange28dControl HTTPAseBotClassGetParamsDateRange = "28dControl"
+ HTTPAseBotClassGetParamsDateRange12wControl HTTPAseBotClassGetParamsDateRange = "12wControl"
+ HTTPAseBotClassGetParamsDateRange24wControl HTTPAseBotClassGetParamsDateRange = "24wControl"
+)
+
+type HTTPAseBotClassGetParamsDeviceType string
+
+const (
+ HTTPAseBotClassGetParamsDeviceTypeDesktop HTTPAseBotClassGetParamsDeviceType = "DESKTOP"
+ HTTPAseBotClassGetParamsDeviceTypeMobile HTTPAseBotClassGetParamsDeviceType = "MOBILE"
+ HTTPAseBotClassGetParamsDeviceTypeOther HTTPAseBotClassGetParamsDeviceType = "OTHER"
+)
+
+// Format results are returned in.
+type HTTPAseBotClassGetParamsFormat string
+
+const (
+ HTTPAseBotClassGetParamsFormatJson HTTPAseBotClassGetParamsFormat = "JSON"
+ HTTPAseBotClassGetParamsFormatCsv HTTPAseBotClassGetParamsFormat = "CSV"
+)
+
+type HTTPAseBotClassGetParamsHTTPProtocol string
+
+const (
+ HTTPAseBotClassGetParamsHTTPProtocolHTTP HTTPAseBotClassGetParamsHTTPProtocol = "HTTP"
+ HTTPAseBotClassGetParamsHTTPProtocolHTTPS HTTPAseBotClassGetParamsHTTPProtocol = "HTTPS"
+)
+
+type HTTPAseBotClassGetParamsHTTPVersion string
+
+const (
+ HTTPAseBotClassGetParamsHTTPVersionHttPv1 HTTPAseBotClassGetParamsHTTPVersion = "HTTPv1"
+ HTTPAseBotClassGetParamsHTTPVersionHttPv2 HTTPAseBotClassGetParamsHTTPVersion = "HTTPv2"
+ HTTPAseBotClassGetParamsHTTPVersionHttPv3 HTTPAseBotClassGetParamsHTTPVersion = "HTTPv3"
+)
+
+type HTTPAseBotClassGetParamsIPVersion string
+
+const (
+ HTTPAseBotClassGetParamsIPVersionIPv4 HTTPAseBotClassGetParamsIPVersion = "IPv4"
+ HTTPAseBotClassGetParamsIPVersionIPv6 HTTPAseBotClassGetParamsIPVersion = "IPv6"
+)
+
+type HTTPAseBotClassGetParamsOS string
+
+const (
+ HTTPAseBotClassGetParamsOSWindows HTTPAseBotClassGetParamsOS = "WINDOWS"
+ HTTPAseBotClassGetParamsOSMacosx HTTPAseBotClassGetParamsOS = "MACOSX"
+ HTTPAseBotClassGetParamsOSIos HTTPAseBotClassGetParamsOS = "IOS"
+ HTTPAseBotClassGetParamsOSAndroid HTTPAseBotClassGetParamsOS = "ANDROID"
+ HTTPAseBotClassGetParamsOSChromeos HTTPAseBotClassGetParamsOS = "CHROMEOS"
+ HTTPAseBotClassGetParamsOSLinux HTTPAseBotClassGetParamsOS = "LINUX"
+ HTTPAseBotClassGetParamsOSSmartTv HTTPAseBotClassGetParamsOS = "SMART_TV"
+)
+
+type HTTPAseBotClassGetParamsTLSVersion string
+
+const (
+ HTTPAseBotClassGetParamsTLSVersionTlSv1_0 HTTPAseBotClassGetParamsTLSVersion = "TLSv1_0"
+ HTTPAseBotClassGetParamsTLSVersionTlSv1_1 HTTPAseBotClassGetParamsTLSVersion = "TLSv1_1"
+ HTTPAseBotClassGetParamsTLSVersionTlSv1_2 HTTPAseBotClassGetParamsTLSVersion = "TLSv1_2"
+ HTTPAseBotClassGetParamsTLSVersionTlSv1_3 HTTPAseBotClassGetParamsTLSVersion = "TLSv1_3"
+ HTTPAseBotClassGetParamsTLSVersionTlSvQuic HTTPAseBotClassGetParamsTLSVersion = "TLSvQUIC"
+)
+
+type HTTPAseBotClassGetResponseEnvelope struct {
+ Result HTTPAseBotClassGetResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON httpAseBotClassGetResponseEnvelopeJSON `json:"-"`
+}
+
+// httpAseBotClassGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [HTTPAseBotClassGetResponseEnvelope]
+type httpAseBotClassGetResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPAseBotClassGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpAseBotClassGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/radar/httpasebotclass_test.go b/radar/httpasebotclass_test.go
new file mode 100644
index 00000000000..7a2a059a8e1
--- /dev/null
+++ b/radar/httpasebotclass_test.go
@@ -0,0 +1,60 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/radar"
+)
+
+func TestHTTPAseBotClassGetWithOptionalParams(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"),
+ )
+ _, err := client.Radar.HTTP.Ases.BotClass.Get(
+ context.TODO(),
+ radar.HTTPAseBotClassGetParamsBotClassLikelyAutomated,
+ radar.HTTPAseBotClassGetParams{
+ 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([]radar.HTTPAseBotClassGetParamsDateRange{radar.HTTPAseBotClassGetParamsDateRange1d, radar.HTTPAseBotClassGetParamsDateRange2d, radar.HTTPAseBotClassGetParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DeviceType: cloudflare.F([]radar.HTTPAseBotClassGetParamsDeviceType{radar.HTTPAseBotClassGetParamsDeviceTypeDesktop, radar.HTTPAseBotClassGetParamsDeviceTypeMobile, radar.HTTPAseBotClassGetParamsDeviceTypeOther}),
+ Format: cloudflare.F(radar.HTTPAseBotClassGetParamsFormatJson),
+ HTTPProtocol: cloudflare.F([]radar.HTTPAseBotClassGetParamsHTTPProtocol{radar.HTTPAseBotClassGetParamsHTTPProtocolHTTP, radar.HTTPAseBotClassGetParamsHTTPProtocolHTTPS}),
+ HTTPVersion: cloudflare.F([]radar.HTTPAseBotClassGetParamsHTTPVersion{radar.HTTPAseBotClassGetParamsHTTPVersionHttPv1, radar.HTTPAseBotClassGetParamsHTTPVersionHttPv2, radar.HTTPAseBotClassGetParamsHTTPVersionHttPv3}),
+ IPVersion: cloudflare.F([]radar.HTTPAseBotClassGetParamsIPVersion{radar.HTTPAseBotClassGetParamsIPVersionIPv4, radar.HTTPAseBotClassGetParamsIPVersionIPv6}),
+ Limit: cloudflare.F(int64(5)),
+ Location: cloudflare.F([]string{"string", "string", "string"}),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ OS: cloudflare.F([]radar.HTTPAseBotClassGetParamsOS{radar.HTTPAseBotClassGetParamsOSWindows, radar.HTTPAseBotClassGetParamsOSMacosx, radar.HTTPAseBotClassGetParamsOSIos}),
+ TLSVersion: cloudflare.F([]radar.HTTPAseBotClassGetParamsTLSVersion{radar.HTTPAseBotClassGetParamsTLSVersionTlSv1_0, radar.HTTPAseBotClassGetParamsTLSVersionTlSv1_1, radar.HTTPAseBotClassGetParamsTLSVersionTlSv1_2}),
+ },
+ )
+ 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/radar/httpasedevicetype.go b/radar/httpasedevicetype.go
new file mode 100644
index 00000000000..f72f613eadd
--- /dev/null
+++ b/radar/httpasedevicetype.go
@@ -0,0 +1,366 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// HTTPAseDeviceTypeService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewHTTPAseDeviceTypeService] method
+// instead.
+type HTTPAseDeviceTypeService struct {
+ Options []option.RequestOption
+}
+
+// NewHTTPAseDeviceTypeService generates a new service that applies the given
+// options to each request. These options are applied after the parent client's
+// options (if there is one), and before any request-specific options.
+func NewHTTPAseDeviceTypeService(opts ...option.RequestOption) (r *HTTPAseDeviceTypeService) {
+ r = &HTTPAseDeviceTypeService{}
+ r.Options = opts
+ return
+}
+
+// Get the top autonomous systems (AS), by HTTP traffic, of the requested device
+// type. Values are a percentage out of the total traffic.
+func (r *HTTPAseDeviceTypeService) Get(ctx context.Context, deviceType HTTPAseDeviceTypeGetParamsDeviceType, query HTTPAseDeviceTypeGetParams, opts ...option.RequestOption) (res *HTTPAseDeviceTypeGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env HTTPAseDeviceTypeGetResponseEnvelope
+ path := fmt.Sprintf("radar/http/top/ases/device_type/%v", deviceType)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type HTTPAseDeviceTypeGetResponse struct {
+ Meta HTTPAseDeviceTypeGetResponseMeta `json:"meta,required"`
+ Top0 []HTTPAseDeviceTypeGetResponseTop0 `json:"top_0,required"`
+ JSON httpAseDeviceTypeGetResponseJSON `json:"-"`
+}
+
+// httpAseDeviceTypeGetResponseJSON contains the JSON metadata for the struct
+// [HTTPAseDeviceTypeGetResponse]
+type httpAseDeviceTypeGetResponseJSON struct {
+ Meta apijson.Field
+ Top0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPAseDeviceTypeGetResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpAseDeviceTypeGetResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPAseDeviceTypeGetResponseMeta struct {
+ DateRange []HTTPAseDeviceTypeGetResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ ConfidenceInfo HTTPAseDeviceTypeGetResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON httpAseDeviceTypeGetResponseMetaJSON `json:"-"`
+}
+
+// httpAseDeviceTypeGetResponseMetaJSON contains the JSON metadata for the struct
+// [HTTPAseDeviceTypeGetResponseMeta]
+type httpAseDeviceTypeGetResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPAseDeviceTypeGetResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpAseDeviceTypeGetResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPAseDeviceTypeGetResponseMetaDateRange 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 httpAseDeviceTypeGetResponseMetaDateRangeJSON `json:"-"`
+}
+
+// httpAseDeviceTypeGetResponseMetaDateRangeJSON contains the JSON metadata for the
+// struct [HTTPAseDeviceTypeGetResponseMetaDateRange]
+type httpAseDeviceTypeGetResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPAseDeviceTypeGetResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpAseDeviceTypeGetResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPAseDeviceTypeGetResponseMetaConfidenceInfo struct {
+ Annotations []HTTPAseDeviceTypeGetResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON httpAseDeviceTypeGetResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// httpAseDeviceTypeGetResponseMetaConfidenceInfoJSON contains the JSON metadata
+// for the struct [HTTPAseDeviceTypeGetResponseMetaConfidenceInfo]
+type httpAseDeviceTypeGetResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPAseDeviceTypeGetResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpAseDeviceTypeGetResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPAseDeviceTypeGetResponseMetaConfidenceInfoAnnotation 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 httpAseDeviceTypeGetResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// httpAseDeviceTypeGetResponseMetaConfidenceInfoAnnotationJSON contains the JSON
+// metadata for the struct
+// [HTTPAseDeviceTypeGetResponseMetaConfidenceInfoAnnotation]
+type httpAseDeviceTypeGetResponseMetaConfidenceInfoAnnotationJSON 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 *HTTPAseDeviceTypeGetResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpAseDeviceTypeGetResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPAseDeviceTypeGetResponseTop0 struct {
+ ClientASN int64 `json:"clientASN,required"`
+ ClientAsName string `json:"clientASName,required"`
+ Value string `json:"value,required"`
+ JSON httpAseDeviceTypeGetResponseTop0JSON `json:"-"`
+}
+
+// httpAseDeviceTypeGetResponseTop0JSON contains the JSON metadata for the struct
+// [HTTPAseDeviceTypeGetResponseTop0]
+type httpAseDeviceTypeGetResponseTop0JSON struct {
+ ClientASN apijson.Field
+ ClientAsName apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPAseDeviceTypeGetResponseTop0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpAseDeviceTypeGetResponseTop0JSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPAseDeviceTypeGetParams 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"`
+ // Filter for bot class. Refer to
+ // [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/).
+ BotClass param.Field[[]HTTPAseDeviceTypeGetParamsBotClass] `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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]HTTPAseDeviceTypeGetParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Format results are returned in.
+ Format param.Field[HTTPAseDeviceTypeGetParamsFormat] `query:"format"`
+ // Filter for http protocol.
+ HTTPProtocol param.Field[[]HTTPAseDeviceTypeGetParamsHTTPProtocol] `query:"httpProtocol"`
+ // Filter for http version.
+ HTTPVersion param.Field[[]HTTPAseDeviceTypeGetParamsHTTPVersion] `query:"httpVersion"`
+ // Filter for ip version.
+ IPVersion param.Field[[]HTTPAseDeviceTypeGetParamsIPVersion] `query:"ipVersion"`
+ // 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 os name.
+ OS param.Field[[]HTTPAseDeviceTypeGetParamsOS] `query:"os"`
+ // Filter for tls version.
+ TLSVersion param.Field[[]HTTPAseDeviceTypeGetParamsTLSVersion] `query:"tlsVersion"`
+}
+
+// URLQuery serializes [HTTPAseDeviceTypeGetParams]'s query parameters as
+// `url.Values`.
+func (r HTTPAseDeviceTypeGetParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Device type.
+type HTTPAseDeviceTypeGetParamsDeviceType string
+
+const (
+ HTTPAseDeviceTypeGetParamsDeviceTypeDesktop HTTPAseDeviceTypeGetParamsDeviceType = "DESKTOP"
+ HTTPAseDeviceTypeGetParamsDeviceTypeMobile HTTPAseDeviceTypeGetParamsDeviceType = "MOBILE"
+ HTTPAseDeviceTypeGetParamsDeviceTypeOther HTTPAseDeviceTypeGetParamsDeviceType = "OTHER"
+)
+
+type HTTPAseDeviceTypeGetParamsBotClass string
+
+const (
+ HTTPAseDeviceTypeGetParamsBotClassLikelyAutomated HTTPAseDeviceTypeGetParamsBotClass = "LIKELY_AUTOMATED"
+ HTTPAseDeviceTypeGetParamsBotClassLikelyHuman HTTPAseDeviceTypeGetParamsBotClass = "LIKELY_HUMAN"
+)
+
+type HTTPAseDeviceTypeGetParamsDateRange string
+
+const (
+ HTTPAseDeviceTypeGetParamsDateRange1d HTTPAseDeviceTypeGetParamsDateRange = "1d"
+ HTTPAseDeviceTypeGetParamsDateRange2d HTTPAseDeviceTypeGetParamsDateRange = "2d"
+ HTTPAseDeviceTypeGetParamsDateRange7d HTTPAseDeviceTypeGetParamsDateRange = "7d"
+ HTTPAseDeviceTypeGetParamsDateRange14d HTTPAseDeviceTypeGetParamsDateRange = "14d"
+ HTTPAseDeviceTypeGetParamsDateRange28d HTTPAseDeviceTypeGetParamsDateRange = "28d"
+ HTTPAseDeviceTypeGetParamsDateRange12w HTTPAseDeviceTypeGetParamsDateRange = "12w"
+ HTTPAseDeviceTypeGetParamsDateRange24w HTTPAseDeviceTypeGetParamsDateRange = "24w"
+ HTTPAseDeviceTypeGetParamsDateRange52w HTTPAseDeviceTypeGetParamsDateRange = "52w"
+ HTTPAseDeviceTypeGetParamsDateRange1dControl HTTPAseDeviceTypeGetParamsDateRange = "1dControl"
+ HTTPAseDeviceTypeGetParamsDateRange2dControl HTTPAseDeviceTypeGetParamsDateRange = "2dControl"
+ HTTPAseDeviceTypeGetParamsDateRange7dControl HTTPAseDeviceTypeGetParamsDateRange = "7dControl"
+ HTTPAseDeviceTypeGetParamsDateRange14dControl HTTPAseDeviceTypeGetParamsDateRange = "14dControl"
+ HTTPAseDeviceTypeGetParamsDateRange28dControl HTTPAseDeviceTypeGetParamsDateRange = "28dControl"
+ HTTPAseDeviceTypeGetParamsDateRange12wControl HTTPAseDeviceTypeGetParamsDateRange = "12wControl"
+ HTTPAseDeviceTypeGetParamsDateRange24wControl HTTPAseDeviceTypeGetParamsDateRange = "24wControl"
+)
+
+// Format results are returned in.
+type HTTPAseDeviceTypeGetParamsFormat string
+
+const (
+ HTTPAseDeviceTypeGetParamsFormatJson HTTPAseDeviceTypeGetParamsFormat = "JSON"
+ HTTPAseDeviceTypeGetParamsFormatCsv HTTPAseDeviceTypeGetParamsFormat = "CSV"
+)
+
+type HTTPAseDeviceTypeGetParamsHTTPProtocol string
+
+const (
+ HTTPAseDeviceTypeGetParamsHTTPProtocolHTTP HTTPAseDeviceTypeGetParamsHTTPProtocol = "HTTP"
+ HTTPAseDeviceTypeGetParamsHTTPProtocolHTTPS HTTPAseDeviceTypeGetParamsHTTPProtocol = "HTTPS"
+)
+
+type HTTPAseDeviceTypeGetParamsHTTPVersion string
+
+const (
+ HTTPAseDeviceTypeGetParamsHTTPVersionHttPv1 HTTPAseDeviceTypeGetParamsHTTPVersion = "HTTPv1"
+ HTTPAseDeviceTypeGetParamsHTTPVersionHttPv2 HTTPAseDeviceTypeGetParamsHTTPVersion = "HTTPv2"
+ HTTPAseDeviceTypeGetParamsHTTPVersionHttPv3 HTTPAseDeviceTypeGetParamsHTTPVersion = "HTTPv3"
+)
+
+type HTTPAseDeviceTypeGetParamsIPVersion string
+
+const (
+ HTTPAseDeviceTypeGetParamsIPVersionIPv4 HTTPAseDeviceTypeGetParamsIPVersion = "IPv4"
+ HTTPAseDeviceTypeGetParamsIPVersionIPv6 HTTPAseDeviceTypeGetParamsIPVersion = "IPv6"
+)
+
+type HTTPAseDeviceTypeGetParamsOS string
+
+const (
+ HTTPAseDeviceTypeGetParamsOSWindows HTTPAseDeviceTypeGetParamsOS = "WINDOWS"
+ HTTPAseDeviceTypeGetParamsOSMacosx HTTPAseDeviceTypeGetParamsOS = "MACOSX"
+ HTTPAseDeviceTypeGetParamsOSIos HTTPAseDeviceTypeGetParamsOS = "IOS"
+ HTTPAseDeviceTypeGetParamsOSAndroid HTTPAseDeviceTypeGetParamsOS = "ANDROID"
+ HTTPAseDeviceTypeGetParamsOSChromeos HTTPAseDeviceTypeGetParamsOS = "CHROMEOS"
+ HTTPAseDeviceTypeGetParamsOSLinux HTTPAseDeviceTypeGetParamsOS = "LINUX"
+ HTTPAseDeviceTypeGetParamsOSSmartTv HTTPAseDeviceTypeGetParamsOS = "SMART_TV"
+)
+
+type HTTPAseDeviceTypeGetParamsTLSVersion string
+
+const (
+ HTTPAseDeviceTypeGetParamsTLSVersionTlSv1_0 HTTPAseDeviceTypeGetParamsTLSVersion = "TLSv1_0"
+ HTTPAseDeviceTypeGetParamsTLSVersionTlSv1_1 HTTPAseDeviceTypeGetParamsTLSVersion = "TLSv1_1"
+ HTTPAseDeviceTypeGetParamsTLSVersionTlSv1_2 HTTPAseDeviceTypeGetParamsTLSVersion = "TLSv1_2"
+ HTTPAseDeviceTypeGetParamsTLSVersionTlSv1_3 HTTPAseDeviceTypeGetParamsTLSVersion = "TLSv1_3"
+ HTTPAseDeviceTypeGetParamsTLSVersionTlSvQuic HTTPAseDeviceTypeGetParamsTLSVersion = "TLSvQUIC"
+)
+
+type HTTPAseDeviceTypeGetResponseEnvelope struct {
+ Result HTTPAseDeviceTypeGetResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON httpAseDeviceTypeGetResponseEnvelopeJSON `json:"-"`
+}
+
+// httpAseDeviceTypeGetResponseEnvelopeJSON contains the JSON metadata for the
+// struct [HTTPAseDeviceTypeGetResponseEnvelope]
+type httpAseDeviceTypeGetResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPAseDeviceTypeGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpAseDeviceTypeGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/radar/httpasedevicetype_test.go b/radar/httpasedevicetype_test.go
new file mode 100644
index 00000000000..db94d051b20
--- /dev/null
+++ b/radar/httpasedevicetype_test.go
@@ -0,0 +1,60 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/radar"
+)
+
+func TestHTTPAseDeviceTypeGetWithOptionalParams(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"),
+ )
+ _, err := client.Radar.HTTP.Ases.DeviceType.Get(
+ context.TODO(),
+ radar.HTTPAseDeviceTypeGetParamsDeviceTypeDesktop,
+ radar.HTTPAseDeviceTypeGetParams{
+ ASN: cloudflare.F([]string{"string", "string", "string"}),
+ BotClass: cloudflare.F([]radar.HTTPAseDeviceTypeGetParamsBotClass{radar.HTTPAseDeviceTypeGetParamsBotClassLikelyAutomated, radar.HTTPAseDeviceTypeGetParamsBotClassLikelyHuman}),
+ Continent: cloudflare.F([]string{"string", "string", "string"}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.HTTPAseDeviceTypeGetParamsDateRange{radar.HTTPAseDeviceTypeGetParamsDateRange1d, radar.HTTPAseDeviceTypeGetParamsDateRange2d, radar.HTTPAseDeviceTypeGetParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Format: cloudflare.F(radar.HTTPAseDeviceTypeGetParamsFormatJson),
+ HTTPProtocol: cloudflare.F([]radar.HTTPAseDeviceTypeGetParamsHTTPProtocol{radar.HTTPAseDeviceTypeGetParamsHTTPProtocolHTTP, radar.HTTPAseDeviceTypeGetParamsHTTPProtocolHTTPS}),
+ HTTPVersion: cloudflare.F([]radar.HTTPAseDeviceTypeGetParamsHTTPVersion{radar.HTTPAseDeviceTypeGetParamsHTTPVersionHttPv1, radar.HTTPAseDeviceTypeGetParamsHTTPVersionHttPv2, radar.HTTPAseDeviceTypeGetParamsHTTPVersionHttPv3}),
+ IPVersion: cloudflare.F([]radar.HTTPAseDeviceTypeGetParamsIPVersion{radar.HTTPAseDeviceTypeGetParamsIPVersionIPv4, radar.HTTPAseDeviceTypeGetParamsIPVersionIPv6}),
+ Limit: cloudflare.F(int64(5)),
+ Location: cloudflare.F([]string{"string", "string", "string"}),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ OS: cloudflare.F([]radar.HTTPAseDeviceTypeGetParamsOS{radar.HTTPAseDeviceTypeGetParamsOSWindows, radar.HTTPAseDeviceTypeGetParamsOSMacosx, radar.HTTPAseDeviceTypeGetParamsOSIos}),
+ TLSVersion: cloudflare.F([]radar.HTTPAseDeviceTypeGetParamsTLSVersion{radar.HTTPAseDeviceTypeGetParamsTLSVersionTlSv1_0, radar.HTTPAseDeviceTypeGetParamsTLSVersionTlSv1_1, radar.HTTPAseDeviceTypeGetParamsTLSVersionTlSv1_2}),
+ },
+ )
+ 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/radar/httpasehttpmethod.go b/radar/httpasehttpmethod.go
new file mode 100644
index 00000000000..8032c4ba823
--- /dev/null
+++ b/radar/httpasehttpmethod.go
@@ -0,0 +1,366 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// HTTPAseHTTPMethodService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewHTTPAseHTTPMethodService] method
+// instead.
+type HTTPAseHTTPMethodService struct {
+ Options []option.RequestOption
+}
+
+// NewHTTPAseHTTPMethodService generates a new service that applies the given
+// options to each request. These options are applied after the parent client's
+// options (if there is one), and before any request-specific options.
+func NewHTTPAseHTTPMethodService(opts ...option.RequestOption) (r *HTTPAseHTTPMethodService) {
+ r = &HTTPAseHTTPMethodService{}
+ r.Options = opts
+ return
+}
+
+// Get the top autonomous systems (AS), by HTTP traffic, of the requested HTTP
+// protocol version. Values are a percentage out of the total traffic.
+func (r *HTTPAseHTTPMethodService) Get(ctx context.Context, httpVersion HTTPAseHTTPMethodGetParamsHTTPVersion, query HTTPAseHTTPMethodGetParams, opts ...option.RequestOption) (res *HTTPAseHTTPMethodGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env HTTPAseHTTPMethodGetResponseEnvelope
+ path := fmt.Sprintf("radar/http/top/ases/http_version/%v", httpVersion)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type HTTPAseHTTPMethodGetResponse struct {
+ Meta HTTPAseHTTPMethodGetResponseMeta `json:"meta,required"`
+ Top0 []HTTPAseHTTPMethodGetResponseTop0 `json:"top_0,required"`
+ JSON httpAseHTTPMethodGetResponseJSON `json:"-"`
+}
+
+// httpAseHTTPMethodGetResponseJSON contains the JSON metadata for the struct
+// [HTTPAseHTTPMethodGetResponse]
+type httpAseHTTPMethodGetResponseJSON struct {
+ Meta apijson.Field
+ Top0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPAseHTTPMethodGetResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpAseHTTPMethodGetResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPAseHTTPMethodGetResponseMeta struct {
+ DateRange []HTTPAseHTTPMethodGetResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ ConfidenceInfo HTTPAseHTTPMethodGetResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON httpAseHTTPMethodGetResponseMetaJSON `json:"-"`
+}
+
+// httpAseHTTPMethodGetResponseMetaJSON contains the JSON metadata for the struct
+// [HTTPAseHTTPMethodGetResponseMeta]
+type httpAseHTTPMethodGetResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPAseHTTPMethodGetResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpAseHTTPMethodGetResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPAseHTTPMethodGetResponseMetaDateRange 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 httpAseHTTPMethodGetResponseMetaDateRangeJSON `json:"-"`
+}
+
+// httpAseHTTPMethodGetResponseMetaDateRangeJSON contains the JSON metadata for the
+// struct [HTTPAseHTTPMethodGetResponseMetaDateRange]
+type httpAseHTTPMethodGetResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPAseHTTPMethodGetResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpAseHTTPMethodGetResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPAseHTTPMethodGetResponseMetaConfidenceInfo struct {
+ Annotations []HTTPAseHTTPMethodGetResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON httpAseHTTPMethodGetResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// httpAseHTTPMethodGetResponseMetaConfidenceInfoJSON contains the JSON metadata
+// for the struct [HTTPAseHTTPMethodGetResponseMetaConfidenceInfo]
+type httpAseHTTPMethodGetResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPAseHTTPMethodGetResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpAseHTTPMethodGetResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPAseHTTPMethodGetResponseMetaConfidenceInfoAnnotation 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 httpAseHTTPMethodGetResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// httpAseHTTPMethodGetResponseMetaConfidenceInfoAnnotationJSON contains the JSON
+// metadata for the struct
+// [HTTPAseHTTPMethodGetResponseMetaConfidenceInfoAnnotation]
+type httpAseHTTPMethodGetResponseMetaConfidenceInfoAnnotationJSON 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 *HTTPAseHTTPMethodGetResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpAseHTTPMethodGetResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPAseHTTPMethodGetResponseTop0 struct {
+ ClientASN int64 `json:"clientASN,required"`
+ ClientAsName string `json:"clientASName,required"`
+ Value string `json:"value,required"`
+ JSON httpAseHTTPMethodGetResponseTop0JSON `json:"-"`
+}
+
+// httpAseHTTPMethodGetResponseTop0JSON contains the JSON metadata for the struct
+// [HTTPAseHTTPMethodGetResponseTop0]
+type httpAseHTTPMethodGetResponseTop0JSON struct {
+ ClientASN apijson.Field
+ ClientAsName apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPAseHTTPMethodGetResponseTop0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpAseHTTPMethodGetResponseTop0JSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPAseHTTPMethodGetParams 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"`
+ // Filter for bot class. Refer to
+ // [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/).
+ BotClass param.Field[[]HTTPAseHTTPMethodGetParamsBotClass] `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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]HTTPAseHTTPMethodGetParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Filter for device type.
+ DeviceType param.Field[[]HTTPAseHTTPMethodGetParamsDeviceType] `query:"deviceType"`
+ // Format results are returned in.
+ Format param.Field[HTTPAseHTTPMethodGetParamsFormat] `query:"format"`
+ // Filter for http protocol.
+ HTTPProtocol param.Field[[]HTTPAseHTTPMethodGetParamsHTTPProtocol] `query:"httpProtocol"`
+ // Filter for ip version.
+ IPVersion param.Field[[]HTTPAseHTTPMethodGetParamsIPVersion] `query:"ipVersion"`
+ // 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 os name.
+ OS param.Field[[]HTTPAseHTTPMethodGetParamsOS] `query:"os"`
+ // Filter for tls version.
+ TLSVersion param.Field[[]HTTPAseHTTPMethodGetParamsTLSVersion] `query:"tlsVersion"`
+}
+
+// URLQuery serializes [HTTPAseHTTPMethodGetParams]'s query parameters as
+// `url.Values`.
+func (r HTTPAseHTTPMethodGetParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// HTTP version.
+type HTTPAseHTTPMethodGetParamsHTTPVersion string
+
+const (
+ HTTPAseHTTPMethodGetParamsHTTPVersionHttPv1 HTTPAseHTTPMethodGetParamsHTTPVersion = "HTTPv1"
+ HTTPAseHTTPMethodGetParamsHTTPVersionHttPv2 HTTPAseHTTPMethodGetParamsHTTPVersion = "HTTPv2"
+ HTTPAseHTTPMethodGetParamsHTTPVersionHttPv3 HTTPAseHTTPMethodGetParamsHTTPVersion = "HTTPv3"
+)
+
+type HTTPAseHTTPMethodGetParamsBotClass string
+
+const (
+ HTTPAseHTTPMethodGetParamsBotClassLikelyAutomated HTTPAseHTTPMethodGetParamsBotClass = "LIKELY_AUTOMATED"
+ HTTPAseHTTPMethodGetParamsBotClassLikelyHuman HTTPAseHTTPMethodGetParamsBotClass = "LIKELY_HUMAN"
+)
+
+type HTTPAseHTTPMethodGetParamsDateRange string
+
+const (
+ HTTPAseHTTPMethodGetParamsDateRange1d HTTPAseHTTPMethodGetParamsDateRange = "1d"
+ HTTPAseHTTPMethodGetParamsDateRange2d HTTPAseHTTPMethodGetParamsDateRange = "2d"
+ HTTPAseHTTPMethodGetParamsDateRange7d HTTPAseHTTPMethodGetParamsDateRange = "7d"
+ HTTPAseHTTPMethodGetParamsDateRange14d HTTPAseHTTPMethodGetParamsDateRange = "14d"
+ HTTPAseHTTPMethodGetParamsDateRange28d HTTPAseHTTPMethodGetParamsDateRange = "28d"
+ HTTPAseHTTPMethodGetParamsDateRange12w HTTPAseHTTPMethodGetParamsDateRange = "12w"
+ HTTPAseHTTPMethodGetParamsDateRange24w HTTPAseHTTPMethodGetParamsDateRange = "24w"
+ HTTPAseHTTPMethodGetParamsDateRange52w HTTPAseHTTPMethodGetParamsDateRange = "52w"
+ HTTPAseHTTPMethodGetParamsDateRange1dControl HTTPAseHTTPMethodGetParamsDateRange = "1dControl"
+ HTTPAseHTTPMethodGetParamsDateRange2dControl HTTPAseHTTPMethodGetParamsDateRange = "2dControl"
+ HTTPAseHTTPMethodGetParamsDateRange7dControl HTTPAseHTTPMethodGetParamsDateRange = "7dControl"
+ HTTPAseHTTPMethodGetParamsDateRange14dControl HTTPAseHTTPMethodGetParamsDateRange = "14dControl"
+ HTTPAseHTTPMethodGetParamsDateRange28dControl HTTPAseHTTPMethodGetParamsDateRange = "28dControl"
+ HTTPAseHTTPMethodGetParamsDateRange12wControl HTTPAseHTTPMethodGetParamsDateRange = "12wControl"
+ HTTPAseHTTPMethodGetParamsDateRange24wControl HTTPAseHTTPMethodGetParamsDateRange = "24wControl"
+)
+
+type HTTPAseHTTPMethodGetParamsDeviceType string
+
+const (
+ HTTPAseHTTPMethodGetParamsDeviceTypeDesktop HTTPAseHTTPMethodGetParamsDeviceType = "DESKTOP"
+ HTTPAseHTTPMethodGetParamsDeviceTypeMobile HTTPAseHTTPMethodGetParamsDeviceType = "MOBILE"
+ HTTPAseHTTPMethodGetParamsDeviceTypeOther HTTPAseHTTPMethodGetParamsDeviceType = "OTHER"
+)
+
+// Format results are returned in.
+type HTTPAseHTTPMethodGetParamsFormat string
+
+const (
+ HTTPAseHTTPMethodGetParamsFormatJson HTTPAseHTTPMethodGetParamsFormat = "JSON"
+ HTTPAseHTTPMethodGetParamsFormatCsv HTTPAseHTTPMethodGetParamsFormat = "CSV"
+)
+
+type HTTPAseHTTPMethodGetParamsHTTPProtocol string
+
+const (
+ HTTPAseHTTPMethodGetParamsHTTPProtocolHTTP HTTPAseHTTPMethodGetParamsHTTPProtocol = "HTTP"
+ HTTPAseHTTPMethodGetParamsHTTPProtocolHTTPS HTTPAseHTTPMethodGetParamsHTTPProtocol = "HTTPS"
+)
+
+type HTTPAseHTTPMethodGetParamsIPVersion string
+
+const (
+ HTTPAseHTTPMethodGetParamsIPVersionIPv4 HTTPAseHTTPMethodGetParamsIPVersion = "IPv4"
+ HTTPAseHTTPMethodGetParamsIPVersionIPv6 HTTPAseHTTPMethodGetParamsIPVersion = "IPv6"
+)
+
+type HTTPAseHTTPMethodGetParamsOS string
+
+const (
+ HTTPAseHTTPMethodGetParamsOSWindows HTTPAseHTTPMethodGetParamsOS = "WINDOWS"
+ HTTPAseHTTPMethodGetParamsOSMacosx HTTPAseHTTPMethodGetParamsOS = "MACOSX"
+ HTTPAseHTTPMethodGetParamsOSIos HTTPAseHTTPMethodGetParamsOS = "IOS"
+ HTTPAseHTTPMethodGetParamsOSAndroid HTTPAseHTTPMethodGetParamsOS = "ANDROID"
+ HTTPAseHTTPMethodGetParamsOSChromeos HTTPAseHTTPMethodGetParamsOS = "CHROMEOS"
+ HTTPAseHTTPMethodGetParamsOSLinux HTTPAseHTTPMethodGetParamsOS = "LINUX"
+ HTTPAseHTTPMethodGetParamsOSSmartTv HTTPAseHTTPMethodGetParamsOS = "SMART_TV"
+)
+
+type HTTPAseHTTPMethodGetParamsTLSVersion string
+
+const (
+ HTTPAseHTTPMethodGetParamsTLSVersionTlSv1_0 HTTPAseHTTPMethodGetParamsTLSVersion = "TLSv1_0"
+ HTTPAseHTTPMethodGetParamsTLSVersionTlSv1_1 HTTPAseHTTPMethodGetParamsTLSVersion = "TLSv1_1"
+ HTTPAseHTTPMethodGetParamsTLSVersionTlSv1_2 HTTPAseHTTPMethodGetParamsTLSVersion = "TLSv1_2"
+ HTTPAseHTTPMethodGetParamsTLSVersionTlSv1_3 HTTPAseHTTPMethodGetParamsTLSVersion = "TLSv1_3"
+ HTTPAseHTTPMethodGetParamsTLSVersionTlSvQuic HTTPAseHTTPMethodGetParamsTLSVersion = "TLSvQUIC"
+)
+
+type HTTPAseHTTPMethodGetResponseEnvelope struct {
+ Result HTTPAseHTTPMethodGetResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON httpAseHTTPMethodGetResponseEnvelopeJSON `json:"-"`
+}
+
+// httpAseHTTPMethodGetResponseEnvelopeJSON contains the JSON metadata for the
+// struct [HTTPAseHTTPMethodGetResponseEnvelope]
+type httpAseHTTPMethodGetResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPAseHTTPMethodGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpAseHTTPMethodGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/radar/httpasehttpmethod_test.go b/radar/httpasehttpmethod_test.go
new file mode 100644
index 00000000000..cd8908b8013
--- /dev/null
+++ b/radar/httpasehttpmethod_test.go
@@ -0,0 +1,60 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/radar"
+)
+
+func TestHTTPAseHTTPMethodGetWithOptionalParams(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"),
+ )
+ _, err := client.Radar.HTTP.Ases.HTTPMethod.Get(
+ context.TODO(),
+ radar.HTTPAseHTTPMethodGetParamsHTTPVersionHttPv1,
+ radar.HTTPAseHTTPMethodGetParams{
+ ASN: cloudflare.F([]string{"string", "string", "string"}),
+ BotClass: cloudflare.F([]radar.HTTPAseHTTPMethodGetParamsBotClass{radar.HTTPAseHTTPMethodGetParamsBotClassLikelyAutomated, radar.HTTPAseHTTPMethodGetParamsBotClassLikelyHuman}),
+ Continent: cloudflare.F([]string{"string", "string", "string"}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.HTTPAseHTTPMethodGetParamsDateRange{radar.HTTPAseHTTPMethodGetParamsDateRange1d, radar.HTTPAseHTTPMethodGetParamsDateRange2d, radar.HTTPAseHTTPMethodGetParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DeviceType: cloudflare.F([]radar.HTTPAseHTTPMethodGetParamsDeviceType{radar.HTTPAseHTTPMethodGetParamsDeviceTypeDesktop, radar.HTTPAseHTTPMethodGetParamsDeviceTypeMobile, radar.HTTPAseHTTPMethodGetParamsDeviceTypeOther}),
+ Format: cloudflare.F(radar.HTTPAseHTTPMethodGetParamsFormatJson),
+ HTTPProtocol: cloudflare.F([]radar.HTTPAseHTTPMethodGetParamsHTTPProtocol{radar.HTTPAseHTTPMethodGetParamsHTTPProtocolHTTP, radar.HTTPAseHTTPMethodGetParamsHTTPProtocolHTTPS}),
+ IPVersion: cloudflare.F([]radar.HTTPAseHTTPMethodGetParamsIPVersion{radar.HTTPAseHTTPMethodGetParamsIPVersionIPv4, radar.HTTPAseHTTPMethodGetParamsIPVersionIPv6}),
+ Limit: cloudflare.F(int64(5)),
+ Location: cloudflare.F([]string{"string", "string", "string"}),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ OS: cloudflare.F([]radar.HTTPAseHTTPMethodGetParamsOS{radar.HTTPAseHTTPMethodGetParamsOSWindows, radar.HTTPAseHTTPMethodGetParamsOSMacosx, radar.HTTPAseHTTPMethodGetParamsOSIos}),
+ TLSVersion: cloudflare.F([]radar.HTTPAseHTTPMethodGetParamsTLSVersion{radar.HTTPAseHTTPMethodGetParamsTLSVersionTlSv1_0, radar.HTTPAseHTTPMethodGetParamsTLSVersionTlSv1_1, radar.HTTPAseHTTPMethodGetParamsTLSVersionTlSv1_2}),
+ },
+ )
+ 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/radar/httpasehttpprotocol.go b/radar/httpasehttpprotocol.go
new file mode 100644
index 00000000000..db9cdc48324
--- /dev/null
+++ b/radar/httpasehttpprotocol.go
@@ -0,0 +1,356 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// HTTPAseHTTPProtocolService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewHTTPAseHTTPProtocolService]
+// method instead.
+type HTTPAseHTTPProtocolService struct {
+ Options []option.RequestOption
+}
+
+// NewHTTPAseHTTPProtocolService generates a new service that applies the given
+// options to each request. These options are applied after the parent client's
+// options (if there is one), and before any request-specific options.
+func NewHTTPAseHTTPProtocolService(opts ...option.RequestOption) (r *HTTPAseHTTPProtocolService) {
+ r = &HTTPAseHTTPProtocolService{}
+ r.Options = opts
+ return
+}
+
+// Get the top autonomous systems (AS), by HTTP traffic, of the requested HTTP
+// protocol. Values are a percentage out of the total traffic.
+func (r *HTTPAseHTTPProtocolService) Get(ctx context.Context, httpProtocol HTTPAseHTTPProtocolGetParamsHTTPProtocol, query HTTPAseHTTPProtocolGetParams, opts ...option.RequestOption) (res *HTTPAseHTTPProtocolGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env HTTPAseHTTPProtocolGetResponseEnvelope
+ path := fmt.Sprintf("radar/http/top/ases/http_protocol/%v", httpProtocol)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type HTTPAseHTTPProtocolGetResponse struct {
+ Meta HTTPAseHTTPProtocolGetResponseMeta `json:"meta,required"`
+ Top0 []HTTPAseHTTPProtocolGetResponseTop0 `json:"top_0,required"`
+ JSON httpAseHTTPProtocolGetResponseJSON `json:"-"`
+}
+
+// httpAseHTTPProtocolGetResponseJSON contains the JSON metadata for the struct
+// [HTTPAseHTTPProtocolGetResponse]
+type httpAseHTTPProtocolGetResponseJSON struct {
+ Meta apijson.Field
+ Top0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPAseHTTPProtocolGetResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpAseHTTPProtocolGetResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPAseHTTPProtocolGetResponseMeta struct {
+ DateRange []HTTPAseHTTPProtocolGetResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ ConfidenceInfo HTTPAseHTTPProtocolGetResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON httpAseHTTPProtocolGetResponseMetaJSON `json:"-"`
+}
+
+// httpAseHTTPProtocolGetResponseMetaJSON contains the JSON metadata for the struct
+// [HTTPAseHTTPProtocolGetResponseMeta]
+type httpAseHTTPProtocolGetResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPAseHTTPProtocolGetResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpAseHTTPProtocolGetResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPAseHTTPProtocolGetResponseMetaDateRange 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 httpAseHTTPProtocolGetResponseMetaDateRangeJSON `json:"-"`
+}
+
+// httpAseHTTPProtocolGetResponseMetaDateRangeJSON contains the JSON metadata for
+// the struct [HTTPAseHTTPProtocolGetResponseMetaDateRange]
+type httpAseHTTPProtocolGetResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPAseHTTPProtocolGetResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpAseHTTPProtocolGetResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPAseHTTPProtocolGetResponseMetaConfidenceInfo struct {
+ Annotations []HTTPAseHTTPProtocolGetResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON httpAseHTTPProtocolGetResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// httpAseHTTPProtocolGetResponseMetaConfidenceInfoJSON contains the JSON metadata
+// for the struct [HTTPAseHTTPProtocolGetResponseMetaConfidenceInfo]
+type httpAseHTTPProtocolGetResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPAseHTTPProtocolGetResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpAseHTTPProtocolGetResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPAseHTTPProtocolGetResponseMetaConfidenceInfoAnnotation 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 httpAseHTTPProtocolGetResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// httpAseHTTPProtocolGetResponseMetaConfidenceInfoAnnotationJSON contains the JSON
+// metadata for the struct
+// [HTTPAseHTTPProtocolGetResponseMetaConfidenceInfoAnnotation]
+type httpAseHTTPProtocolGetResponseMetaConfidenceInfoAnnotationJSON 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 *HTTPAseHTTPProtocolGetResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpAseHTTPProtocolGetResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPAseHTTPProtocolGetResponseTop0 struct {
+ ClientASN int64 `json:"clientASN,required"`
+ ClientAsName string `json:"clientASName,required"`
+ Value string `json:"value,required"`
+ JSON httpAseHTTPProtocolGetResponseTop0JSON `json:"-"`
+}
+
+// httpAseHTTPProtocolGetResponseTop0JSON contains the JSON metadata for the struct
+// [HTTPAseHTTPProtocolGetResponseTop0]
+type httpAseHTTPProtocolGetResponseTop0JSON struct {
+ ClientASN apijson.Field
+ ClientAsName apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPAseHTTPProtocolGetResponseTop0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpAseHTTPProtocolGetResponseTop0JSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPAseHTTPProtocolGetParams 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"`
+ // Filter for bot class. Refer to
+ // [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/).
+ BotClass param.Field[[]HTTPAseHTTPProtocolGetParamsBotClass] `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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]HTTPAseHTTPProtocolGetParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Filter for device type.
+ DeviceType param.Field[[]HTTPAseHTTPProtocolGetParamsDeviceType] `query:"deviceType"`
+ // Format results are returned in.
+ Format param.Field[HTTPAseHTTPProtocolGetParamsFormat] `query:"format"`
+ // Filter for ip version.
+ IPVersion param.Field[[]HTTPAseHTTPProtocolGetParamsIPVersion] `query:"ipVersion"`
+ // 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 os name.
+ OS param.Field[[]HTTPAseHTTPProtocolGetParamsOS] `query:"os"`
+ // Filter for tls version.
+ TLSVersion param.Field[[]HTTPAseHTTPProtocolGetParamsTLSVersion] `query:"tlsVersion"`
+}
+
+// URLQuery serializes [HTTPAseHTTPProtocolGetParams]'s query parameters as
+// `url.Values`.
+func (r HTTPAseHTTPProtocolGetParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// HTTP Protocol.
+type HTTPAseHTTPProtocolGetParamsHTTPProtocol string
+
+const (
+ HTTPAseHTTPProtocolGetParamsHTTPProtocolHTTP HTTPAseHTTPProtocolGetParamsHTTPProtocol = "HTTP"
+ HTTPAseHTTPProtocolGetParamsHTTPProtocolHTTPS HTTPAseHTTPProtocolGetParamsHTTPProtocol = "HTTPS"
+)
+
+type HTTPAseHTTPProtocolGetParamsBotClass string
+
+const (
+ HTTPAseHTTPProtocolGetParamsBotClassLikelyAutomated HTTPAseHTTPProtocolGetParamsBotClass = "LIKELY_AUTOMATED"
+ HTTPAseHTTPProtocolGetParamsBotClassLikelyHuman HTTPAseHTTPProtocolGetParamsBotClass = "LIKELY_HUMAN"
+)
+
+type HTTPAseHTTPProtocolGetParamsDateRange string
+
+const (
+ HTTPAseHTTPProtocolGetParamsDateRange1d HTTPAseHTTPProtocolGetParamsDateRange = "1d"
+ HTTPAseHTTPProtocolGetParamsDateRange2d HTTPAseHTTPProtocolGetParamsDateRange = "2d"
+ HTTPAseHTTPProtocolGetParamsDateRange7d HTTPAseHTTPProtocolGetParamsDateRange = "7d"
+ HTTPAseHTTPProtocolGetParamsDateRange14d HTTPAseHTTPProtocolGetParamsDateRange = "14d"
+ HTTPAseHTTPProtocolGetParamsDateRange28d HTTPAseHTTPProtocolGetParamsDateRange = "28d"
+ HTTPAseHTTPProtocolGetParamsDateRange12w HTTPAseHTTPProtocolGetParamsDateRange = "12w"
+ HTTPAseHTTPProtocolGetParamsDateRange24w HTTPAseHTTPProtocolGetParamsDateRange = "24w"
+ HTTPAseHTTPProtocolGetParamsDateRange52w HTTPAseHTTPProtocolGetParamsDateRange = "52w"
+ HTTPAseHTTPProtocolGetParamsDateRange1dControl HTTPAseHTTPProtocolGetParamsDateRange = "1dControl"
+ HTTPAseHTTPProtocolGetParamsDateRange2dControl HTTPAseHTTPProtocolGetParamsDateRange = "2dControl"
+ HTTPAseHTTPProtocolGetParamsDateRange7dControl HTTPAseHTTPProtocolGetParamsDateRange = "7dControl"
+ HTTPAseHTTPProtocolGetParamsDateRange14dControl HTTPAseHTTPProtocolGetParamsDateRange = "14dControl"
+ HTTPAseHTTPProtocolGetParamsDateRange28dControl HTTPAseHTTPProtocolGetParamsDateRange = "28dControl"
+ HTTPAseHTTPProtocolGetParamsDateRange12wControl HTTPAseHTTPProtocolGetParamsDateRange = "12wControl"
+ HTTPAseHTTPProtocolGetParamsDateRange24wControl HTTPAseHTTPProtocolGetParamsDateRange = "24wControl"
+)
+
+type HTTPAseHTTPProtocolGetParamsDeviceType string
+
+const (
+ HTTPAseHTTPProtocolGetParamsDeviceTypeDesktop HTTPAseHTTPProtocolGetParamsDeviceType = "DESKTOP"
+ HTTPAseHTTPProtocolGetParamsDeviceTypeMobile HTTPAseHTTPProtocolGetParamsDeviceType = "MOBILE"
+ HTTPAseHTTPProtocolGetParamsDeviceTypeOther HTTPAseHTTPProtocolGetParamsDeviceType = "OTHER"
+)
+
+// Format results are returned in.
+type HTTPAseHTTPProtocolGetParamsFormat string
+
+const (
+ HTTPAseHTTPProtocolGetParamsFormatJson HTTPAseHTTPProtocolGetParamsFormat = "JSON"
+ HTTPAseHTTPProtocolGetParamsFormatCsv HTTPAseHTTPProtocolGetParamsFormat = "CSV"
+)
+
+type HTTPAseHTTPProtocolGetParamsIPVersion string
+
+const (
+ HTTPAseHTTPProtocolGetParamsIPVersionIPv4 HTTPAseHTTPProtocolGetParamsIPVersion = "IPv4"
+ HTTPAseHTTPProtocolGetParamsIPVersionIPv6 HTTPAseHTTPProtocolGetParamsIPVersion = "IPv6"
+)
+
+type HTTPAseHTTPProtocolGetParamsOS string
+
+const (
+ HTTPAseHTTPProtocolGetParamsOSWindows HTTPAseHTTPProtocolGetParamsOS = "WINDOWS"
+ HTTPAseHTTPProtocolGetParamsOSMacosx HTTPAseHTTPProtocolGetParamsOS = "MACOSX"
+ HTTPAseHTTPProtocolGetParamsOSIos HTTPAseHTTPProtocolGetParamsOS = "IOS"
+ HTTPAseHTTPProtocolGetParamsOSAndroid HTTPAseHTTPProtocolGetParamsOS = "ANDROID"
+ HTTPAseHTTPProtocolGetParamsOSChromeos HTTPAseHTTPProtocolGetParamsOS = "CHROMEOS"
+ HTTPAseHTTPProtocolGetParamsOSLinux HTTPAseHTTPProtocolGetParamsOS = "LINUX"
+ HTTPAseHTTPProtocolGetParamsOSSmartTv HTTPAseHTTPProtocolGetParamsOS = "SMART_TV"
+)
+
+type HTTPAseHTTPProtocolGetParamsTLSVersion string
+
+const (
+ HTTPAseHTTPProtocolGetParamsTLSVersionTlSv1_0 HTTPAseHTTPProtocolGetParamsTLSVersion = "TLSv1_0"
+ HTTPAseHTTPProtocolGetParamsTLSVersionTlSv1_1 HTTPAseHTTPProtocolGetParamsTLSVersion = "TLSv1_1"
+ HTTPAseHTTPProtocolGetParamsTLSVersionTlSv1_2 HTTPAseHTTPProtocolGetParamsTLSVersion = "TLSv1_2"
+ HTTPAseHTTPProtocolGetParamsTLSVersionTlSv1_3 HTTPAseHTTPProtocolGetParamsTLSVersion = "TLSv1_3"
+ HTTPAseHTTPProtocolGetParamsTLSVersionTlSvQuic HTTPAseHTTPProtocolGetParamsTLSVersion = "TLSvQUIC"
+)
+
+type HTTPAseHTTPProtocolGetResponseEnvelope struct {
+ Result HTTPAseHTTPProtocolGetResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON httpAseHTTPProtocolGetResponseEnvelopeJSON `json:"-"`
+}
+
+// httpAseHTTPProtocolGetResponseEnvelopeJSON contains the JSON metadata for the
+// struct [HTTPAseHTTPProtocolGetResponseEnvelope]
+type httpAseHTTPProtocolGetResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPAseHTTPProtocolGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpAseHTTPProtocolGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/radar/httpasehttpprotocol_test.go b/radar/httpasehttpprotocol_test.go
new file mode 100644
index 00000000000..01213638a65
--- /dev/null
+++ b/radar/httpasehttpprotocol_test.go
@@ -0,0 +1,59 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/radar"
+)
+
+func TestHTTPAseHTTPProtocolGetWithOptionalParams(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"),
+ )
+ _, err := client.Radar.HTTP.Ases.HTTPProtocol.Get(
+ context.TODO(),
+ radar.HTTPAseHTTPProtocolGetParamsHTTPProtocolHTTP,
+ radar.HTTPAseHTTPProtocolGetParams{
+ ASN: cloudflare.F([]string{"string", "string", "string"}),
+ BotClass: cloudflare.F([]radar.HTTPAseHTTPProtocolGetParamsBotClass{radar.HTTPAseHTTPProtocolGetParamsBotClassLikelyAutomated, radar.HTTPAseHTTPProtocolGetParamsBotClassLikelyHuman}),
+ Continent: cloudflare.F([]string{"string", "string", "string"}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.HTTPAseHTTPProtocolGetParamsDateRange{radar.HTTPAseHTTPProtocolGetParamsDateRange1d, radar.HTTPAseHTTPProtocolGetParamsDateRange2d, radar.HTTPAseHTTPProtocolGetParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DeviceType: cloudflare.F([]radar.HTTPAseHTTPProtocolGetParamsDeviceType{radar.HTTPAseHTTPProtocolGetParamsDeviceTypeDesktop, radar.HTTPAseHTTPProtocolGetParamsDeviceTypeMobile, radar.HTTPAseHTTPProtocolGetParamsDeviceTypeOther}),
+ Format: cloudflare.F(radar.HTTPAseHTTPProtocolGetParamsFormatJson),
+ IPVersion: cloudflare.F([]radar.HTTPAseHTTPProtocolGetParamsIPVersion{radar.HTTPAseHTTPProtocolGetParamsIPVersionIPv4, radar.HTTPAseHTTPProtocolGetParamsIPVersionIPv6}),
+ Limit: cloudflare.F(int64(5)),
+ Location: cloudflare.F([]string{"string", "string", "string"}),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ OS: cloudflare.F([]radar.HTTPAseHTTPProtocolGetParamsOS{radar.HTTPAseHTTPProtocolGetParamsOSWindows, radar.HTTPAseHTTPProtocolGetParamsOSMacosx, radar.HTTPAseHTTPProtocolGetParamsOSIos}),
+ TLSVersion: cloudflare.F([]radar.HTTPAseHTTPProtocolGetParamsTLSVersion{radar.HTTPAseHTTPProtocolGetParamsTLSVersionTlSv1_0, radar.HTTPAseHTTPProtocolGetParamsTLSVersionTlSv1_1, radar.HTTPAseHTTPProtocolGetParamsTLSVersionTlSv1_2}),
+ },
+ )
+ 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/radar/httpaseipversion.go b/radar/httpaseipversion.go
new file mode 100644
index 00000000000..0cfb4e22045
--- /dev/null
+++ b/radar/httpaseipversion.go
@@ -0,0 +1,366 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// HTTPAseIPVersionService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewHTTPAseIPVersionService] method
+// instead.
+type HTTPAseIPVersionService struct {
+ Options []option.RequestOption
+}
+
+// NewHTTPAseIPVersionService generates a new service that applies the given
+// options to each request. These options are applied after the parent client's
+// options (if there is one), and before any request-specific options.
+func NewHTTPAseIPVersionService(opts ...option.RequestOption) (r *HTTPAseIPVersionService) {
+ r = &HTTPAseIPVersionService{}
+ r.Options = opts
+ return
+}
+
+// Get the top autonomous systems, by HTTP traffic, of the requested IP protocol
+// version. Values are a percentage out of the total traffic.
+func (r *HTTPAseIPVersionService) Get(ctx context.Context, ipVersion HTTPAseIPVersionGetParamsIPVersion, query HTTPAseIPVersionGetParams, opts ...option.RequestOption) (res *HTTPAseIPVersionGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env HTTPAseIPVersionGetResponseEnvelope
+ path := fmt.Sprintf("radar/http/top/ases/ip_version/%v", ipVersion)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type HTTPAseIPVersionGetResponse struct {
+ Meta HTTPAseIPVersionGetResponseMeta `json:"meta,required"`
+ Top0 []HTTPAseIPVersionGetResponseTop0 `json:"top_0,required"`
+ JSON httpAseIPVersionGetResponseJSON `json:"-"`
+}
+
+// httpAseIPVersionGetResponseJSON contains the JSON metadata for the struct
+// [HTTPAseIPVersionGetResponse]
+type httpAseIPVersionGetResponseJSON struct {
+ Meta apijson.Field
+ Top0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPAseIPVersionGetResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpAseIPVersionGetResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPAseIPVersionGetResponseMeta struct {
+ DateRange []HTTPAseIPVersionGetResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ ConfidenceInfo HTTPAseIPVersionGetResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON httpAseIPVersionGetResponseMetaJSON `json:"-"`
+}
+
+// httpAseIPVersionGetResponseMetaJSON contains the JSON metadata for the struct
+// [HTTPAseIPVersionGetResponseMeta]
+type httpAseIPVersionGetResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPAseIPVersionGetResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpAseIPVersionGetResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPAseIPVersionGetResponseMetaDateRange 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 httpAseIPVersionGetResponseMetaDateRangeJSON `json:"-"`
+}
+
+// httpAseIPVersionGetResponseMetaDateRangeJSON contains the JSON metadata for the
+// struct [HTTPAseIPVersionGetResponseMetaDateRange]
+type httpAseIPVersionGetResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPAseIPVersionGetResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpAseIPVersionGetResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPAseIPVersionGetResponseMetaConfidenceInfo struct {
+ Annotations []HTTPAseIPVersionGetResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON httpAseIPVersionGetResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// httpAseIPVersionGetResponseMetaConfidenceInfoJSON contains the JSON metadata for
+// the struct [HTTPAseIPVersionGetResponseMetaConfidenceInfo]
+type httpAseIPVersionGetResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPAseIPVersionGetResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpAseIPVersionGetResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPAseIPVersionGetResponseMetaConfidenceInfoAnnotation 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 httpAseIPVersionGetResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// httpAseIPVersionGetResponseMetaConfidenceInfoAnnotationJSON contains the JSON
+// metadata for the struct
+// [HTTPAseIPVersionGetResponseMetaConfidenceInfoAnnotation]
+type httpAseIPVersionGetResponseMetaConfidenceInfoAnnotationJSON 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 *HTTPAseIPVersionGetResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpAseIPVersionGetResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPAseIPVersionGetResponseTop0 struct {
+ ClientASN int64 `json:"clientASN,required"`
+ ClientAsName string `json:"clientASName,required"`
+ Value string `json:"value,required"`
+ JSON httpAseIPVersionGetResponseTop0JSON `json:"-"`
+}
+
+// httpAseIPVersionGetResponseTop0JSON contains the JSON metadata for the struct
+// [HTTPAseIPVersionGetResponseTop0]
+type httpAseIPVersionGetResponseTop0JSON struct {
+ ClientASN apijson.Field
+ ClientAsName apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPAseIPVersionGetResponseTop0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpAseIPVersionGetResponseTop0JSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPAseIPVersionGetParams 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"`
+ // Filter for bot class. Refer to
+ // [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/).
+ BotClass param.Field[[]HTTPAseIPVersionGetParamsBotClass] `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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]HTTPAseIPVersionGetParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Filter for device type.
+ DeviceType param.Field[[]HTTPAseIPVersionGetParamsDeviceType] `query:"deviceType"`
+ // Format results are returned in.
+ Format param.Field[HTTPAseIPVersionGetParamsFormat] `query:"format"`
+ // Filter for http protocol.
+ HTTPProtocol param.Field[[]HTTPAseIPVersionGetParamsHTTPProtocol] `query:"httpProtocol"`
+ // Filter for http version.
+ HTTPVersion param.Field[[]HTTPAseIPVersionGetParamsHTTPVersion] `query:"httpVersion"`
+ // 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 os name.
+ OS param.Field[[]HTTPAseIPVersionGetParamsOS] `query:"os"`
+ // Filter for tls version.
+ TLSVersion param.Field[[]HTTPAseIPVersionGetParamsTLSVersion] `query:"tlsVersion"`
+}
+
+// URLQuery serializes [HTTPAseIPVersionGetParams]'s query parameters as
+// `url.Values`.
+func (r HTTPAseIPVersionGetParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// IP version.
+type HTTPAseIPVersionGetParamsIPVersion string
+
+const (
+ HTTPAseIPVersionGetParamsIPVersionIPv4 HTTPAseIPVersionGetParamsIPVersion = "IPv4"
+ HTTPAseIPVersionGetParamsIPVersionIPv6 HTTPAseIPVersionGetParamsIPVersion = "IPv6"
+)
+
+type HTTPAseIPVersionGetParamsBotClass string
+
+const (
+ HTTPAseIPVersionGetParamsBotClassLikelyAutomated HTTPAseIPVersionGetParamsBotClass = "LIKELY_AUTOMATED"
+ HTTPAseIPVersionGetParamsBotClassLikelyHuman HTTPAseIPVersionGetParamsBotClass = "LIKELY_HUMAN"
+)
+
+type HTTPAseIPVersionGetParamsDateRange string
+
+const (
+ HTTPAseIPVersionGetParamsDateRange1d HTTPAseIPVersionGetParamsDateRange = "1d"
+ HTTPAseIPVersionGetParamsDateRange2d HTTPAseIPVersionGetParamsDateRange = "2d"
+ HTTPAseIPVersionGetParamsDateRange7d HTTPAseIPVersionGetParamsDateRange = "7d"
+ HTTPAseIPVersionGetParamsDateRange14d HTTPAseIPVersionGetParamsDateRange = "14d"
+ HTTPAseIPVersionGetParamsDateRange28d HTTPAseIPVersionGetParamsDateRange = "28d"
+ HTTPAseIPVersionGetParamsDateRange12w HTTPAseIPVersionGetParamsDateRange = "12w"
+ HTTPAseIPVersionGetParamsDateRange24w HTTPAseIPVersionGetParamsDateRange = "24w"
+ HTTPAseIPVersionGetParamsDateRange52w HTTPAseIPVersionGetParamsDateRange = "52w"
+ HTTPAseIPVersionGetParamsDateRange1dControl HTTPAseIPVersionGetParamsDateRange = "1dControl"
+ HTTPAseIPVersionGetParamsDateRange2dControl HTTPAseIPVersionGetParamsDateRange = "2dControl"
+ HTTPAseIPVersionGetParamsDateRange7dControl HTTPAseIPVersionGetParamsDateRange = "7dControl"
+ HTTPAseIPVersionGetParamsDateRange14dControl HTTPAseIPVersionGetParamsDateRange = "14dControl"
+ HTTPAseIPVersionGetParamsDateRange28dControl HTTPAseIPVersionGetParamsDateRange = "28dControl"
+ HTTPAseIPVersionGetParamsDateRange12wControl HTTPAseIPVersionGetParamsDateRange = "12wControl"
+ HTTPAseIPVersionGetParamsDateRange24wControl HTTPAseIPVersionGetParamsDateRange = "24wControl"
+)
+
+type HTTPAseIPVersionGetParamsDeviceType string
+
+const (
+ HTTPAseIPVersionGetParamsDeviceTypeDesktop HTTPAseIPVersionGetParamsDeviceType = "DESKTOP"
+ HTTPAseIPVersionGetParamsDeviceTypeMobile HTTPAseIPVersionGetParamsDeviceType = "MOBILE"
+ HTTPAseIPVersionGetParamsDeviceTypeOther HTTPAseIPVersionGetParamsDeviceType = "OTHER"
+)
+
+// Format results are returned in.
+type HTTPAseIPVersionGetParamsFormat string
+
+const (
+ HTTPAseIPVersionGetParamsFormatJson HTTPAseIPVersionGetParamsFormat = "JSON"
+ HTTPAseIPVersionGetParamsFormatCsv HTTPAseIPVersionGetParamsFormat = "CSV"
+)
+
+type HTTPAseIPVersionGetParamsHTTPProtocol string
+
+const (
+ HTTPAseIPVersionGetParamsHTTPProtocolHTTP HTTPAseIPVersionGetParamsHTTPProtocol = "HTTP"
+ HTTPAseIPVersionGetParamsHTTPProtocolHTTPS HTTPAseIPVersionGetParamsHTTPProtocol = "HTTPS"
+)
+
+type HTTPAseIPVersionGetParamsHTTPVersion string
+
+const (
+ HTTPAseIPVersionGetParamsHTTPVersionHttPv1 HTTPAseIPVersionGetParamsHTTPVersion = "HTTPv1"
+ HTTPAseIPVersionGetParamsHTTPVersionHttPv2 HTTPAseIPVersionGetParamsHTTPVersion = "HTTPv2"
+ HTTPAseIPVersionGetParamsHTTPVersionHttPv3 HTTPAseIPVersionGetParamsHTTPVersion = "HTTPv3"
+)
+
+type HTTPAseIPVersionGetParamsOS string
+
+const (
+ HTTPAseIPVersionGetParamsOSWindows HTTPAseIPVersionGetParamsOS = "WINDOWS"
+ HTTPAseIPVersionGetParamsOSMacosx HTTPAseIPVersionGetParamsOS = "MACOSX"
+ HTTPAseIPVersionGetParamsOSIos HTTPAseIPVersionGetParamsOS = "IOS"
+ HTTPAseIPVersionGetParamsOSAndroid HTTPAseIPVersionGetParamsOS = "ANDROID"
+ HTTPAseIPVersionGetParamsOSChromeos HTTPAseIPVersionGetParamsOS = "CHROMEOS"
+ HTTPAseIPVersionGetParamsOSLinux HTTPAseIPVersionGetParamsOS = "LINUX"
+ HTTPAseIPVersionGetParamsOSSmartTv HTTPAseIPVersionGetParamsOS = "SMART_TV"
+)
+
+type HTTPAseIPVersionGetParamsTLSVersion string
+
+const (
+ HTTPAseIPVersionGetParamsTLSVersionTlSv1_0 HTTPAseIPVersionGetParamsTLSVersion = "TLSv1_0"
+ HTTPAseIPVersionGetParamsTLSVersionTlSv1_1 HTTPAseIPVersionGetParamsTLSVersion = "TLSv1_1"
+ HTTPAseIPVersionGetParamsTLSVersionTlSv1_2 HTTPAseIPVersionGetParamsTLSVersion = "TLSv1_2"
+ HTTPAseIPVersionGetParamsTLSVersionTlSv1_3 HTTPAseIPVersionGetParamsTLSVersion = "TLSv1_3"
+ HTTPAseIPVersionGetParamsTLSVersionTlSvQuic HTTPAseIPVersionGetParamsTLSVersion = "TLSvQUIC"
+)
+
+type HTTPAseIPVersionGetResponseEnvelope struct {
+ Result HTTPAseIPVersionGetResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON httpAseIPVersionGetResponseEnvelopeJSON `json:"-"`
+}
+
+// httpAseIPVersionGetResponseEnvelopeJSON contains the JSON metadata for the
+// struct [HTTPAseIPVersionGetResponseEnvelope]
+type httpAseIPVersionGetResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPAseIPVersionGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpAseIPVersionGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/radar/httpaseipversion_test.go b/radar/httpaseipversion_test.go
new file mode 100644
index 00000000000..1af21a03f65
--- /dev/null
+++ b/radar/httpaseipversion_test.go
@@ -0,0 +1,60 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/radar"
+)
+
+func TestHTTPAseIPVersionGetWithOptionalParams(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"),
+ )
+ _, err := client.Radar.HTTP.Ases.IPVersion.Get(
+ context.TODO(),
+ radar.HTTPAseIPVersionGetParamsIPVersionIPv4,
+ radar.HTTPAseIPVersionGetParams{
+ ASN: cloudflare.F([]string{"string", "string", "string"}),
+ BotClass: cloudflare.F([]radar.HTTPAseIPVersionGetParamsBotClass{radar.HTTPAseIPVersionGetParamsBotClassLikelyAutomated, radar.HTTPAseIPVersionGetParamsBotClassLikelyHuman}),
+ Continent: cloudflare.F([]string{"string", "string", "string"}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.HTTPAseIPVersionGetParamsDateRange{radar.HTTPAseIPVersionGetParamsDateRange1d, radar.HTTPAseIPVersionGetParamsDateRange2d, radar.HTTPAseIPVersionGetParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DeviceType: cloudflare.F([]radar.HTTPAseIPVersionGetParamsDeviceType{radar.HTTPAseIPVersionGetParamsDeviceTypeDesktop, radar.HTTPAseIPVersionGetParamsDeviceTypeMobile, radar.HTTPAseIPVersionGetParamsDeviceTypeOther}),
+ Format: cloudflare.F(radar.HTTPAseIPVersionGetParamsFormatJson),
+ HTTPProtocol: cloudflare.F([]radar.HTTPAseIPVersionGetParamsHTTPProtocol{radar.HTTPAseIPVersionGetParamsHTTPProtocolHTTP, radar.HTTPAseIPVersionGetParamsHTTPProtocolHTTPS}),
+ HTTPVersion: cloudflare.F([]radar.HTTPAseIPVersionGetParamsHTTPVersion{radar.HTTPAseIPVersionGetParamsHTTPVersionHttPv1, radar.HTTPAseIPVersionGetParamsHTTPVersionHttPv2, radar.HTTPAseIPVersionGetParamsHTTPVersionHttPv3}),
+ Limit: cloudflare.F(int64(5)),
+ Location: cloudflare.F([]string{"string", "string", "string"}),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ OS: cloudflare.F([]radar.HTTPAseIPVersionGetParamsOS{radar.HTTPAseIPVersionGetParamsOSWindows, radar.HTTPAseIPVersionGetParamsOSMacosx, radar.HTTPAseIPVersionGetParamsOSIos}),
+ TLSVersion: cloudflare.F([]radar.HTTPAseIPVersionGetParamsTLSVersion{radar.HTTPAseIPVersionGetParamsTLSVersionTlSv1_0, radar.HTTPAseIPVersionGetParamsTLSVersionTlSv1_1, radar.HTTPAseIPVersionGetParamsTLSVersionTlSv1_2}),
+ },
+ )
+ 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/radar/httpaseos.go b/radar/httpaseos.go
new file mode 100644
index 00000000000..ebbf34ffc3d
--- /dev/null
+++ b/radar/httpaseos.go
@@ -0,0 +1,363 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// HTTPAseOSService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewHTTPAseOSService] method instead.
+type HTTPAseOSService struct {
+ Options []option.RequestOption
+}
+
+// NewHTTPAseOSService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewHTTPAseOSService(opts ...option.RequestOption) (r *HTTPAseOSService) {
+ r = &HTTPAseOSService{}
+ r.Options = opts
+ return
+}
+
+// Get the top autonomous systems, by HTTP traffic, of the requested operating
+// systems. Values are a percentage out of the total traffic.
+func (r *HTTPAseOSService) Get(ctx context.Context, os HTTPAseOSGetParamsOS, query HTTPAseOSGetParams, opts ...option.RequestOption) (res *HTTPAseOSGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env HTTPAseOSGetResponseEnvelope
+ path := fmt.Sprintf("radar/http/top/ases/os/%v", os)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type HTTPAseOSGetResponse struct {
+ Meta HTTPAseOSGetResponseMeta `json:"meta,required"`
+ Top0 []HTTPAseOSGetResponseTop0 `json:"top_0,required"`
+ JSON httpAseOSGetResponseJSON `json:"-"`
+}
+
+// httpAseOSGetResponseJSON contains the JSON metadata for the struct
+// [HTTPAseOSGetResponse]
+type httpAseOSGetResponseJSON struct {
+ Meta apijson.Field
+ Top0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPAseOSGetResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpAseOSGetResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPAseOSGetResponseMeta struct {
+ DateRange []HTTPAseOSGetResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ ConfidenceInfo HTTPAseOSGetResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON httpAseOSGetResponseMetaJSON `json:"-"`
+}
+
+// httpAseOSGetResponseMetaJSON contains the JSON metadata for the struct
+// [HTTPAseOSGetResponseMeta]
+type httpAseOSGetResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPAseOSGetResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpAseOSGetResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPAseOSGetResponseMetaDateRange 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 httpAseOSGetResponseMetaDateRangeJSON `json:"-"`
+}
+
+// httpAseOSGetResponseMetaDateRangeJSON contains the JSON metadata for the struct
+// [HTTPAseOSGetResponseMetaDateRange]
+type httpAseOSGetResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPAseOSGetResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpAseOSGetResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPAseOSGetResponseMetaConfidenceInfo struct {
+ Annotations []HTTPAseOSGetResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON httpAseOSGetResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// httpAseOSGetResponseMetaConfidenceInfoJSON contains the JSON metadata for the
+// struct [HTTPAseOSGetResponseMetaConfidenceInfo]
+type httpAseOSGetResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPAseOSGetResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpAseOSGetResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPAseOSGetResponseMetaConfidenceInfoAnnotation 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 httpAseOSGetResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// httpAseOSGetResponseMetaConfidenceInfoAnnotationJSON contains the JSON metadata
+// for the struct [HTTPAseOSGetResponseMetaConfidenceInfoAnnotation]
+type httpAseOSGetResponseMetaConfidenceInfoAnnotationJSON 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 *HTTPAseOSGetResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpAseOSGetResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPAseOSGetResponseTop0 struct {
+ ClientASN int64 `json:"clientASN,required"`
+ ClientAsName string `json:"clientASName,required"`
+ Value string `json:"value,required"`
+ JSON httpAseOSGetResponseTop0JSON `json:"-"`
+}
+
+// httpAseOSGetResponseTop0JSON contains the JSON metadata for the struct
+// [HTTPAseOSGetResponseTop0]
+type httpAseOSGetResponseTop0JSON struct {
+ ClientASN apijson.Field
+ ClientAsName apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPAseOSGetResponseTop0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpAseOSGetResponseTop0JSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPAseOSGetParams 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"`
+ // Filter for bot class. Refer to
+ // [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/).
+ BotClass param.Field[[]HTTPAseOSGetParamsBotClass] `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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]HTTPAseOSGetParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Filter for device type.
+ DeviceType param.Field[[]HTTPAseOSGetParamsDeviceType] `query:"deviceType"`
+ // Format results are returned in.
+ Format param.Field[HTTPAseOSGetParamsFormat] `query:"format"`
+ // Filter for http protocol.
+ HTTPProtocol param.Field[[]HTTPAseOSGetParamsHTTPProtocol] `query:"httpProtocol"`
+ // Filter for http version.
+ HTTPVersion param.Field[[]HTTPAseOSGetParamsHTTPVersion] `query:"httpVersion"`
+ // Filter for ip version.
+ IPVersion param.Field[[]HTTPAseOSGetParamsIPVersion] `query:"ipVersion"`
+ // 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 tls version.
+ TLSVersion param.Field[[]HTTPAseOSGetParamsTLSVersion] `query:"tlsVersion"`
+}
+
+// URLQuery serializes [HTTPAseOSGetParams]'s query parameters as `url.Values`.
+func (r HTTPAseOSGetParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// IP version.
+type HTTPAseOSGetParamsOS string
+
+const (
+ HTTPAseOSGetParamsOSWindows HTTPAseOSGetParamsOS = "WINDOWS"
+ HTTPAseOSGetParamsOSMacosx HTTPAseOSGetParamsOS = "MACOSX"
+ HTTPAseOSGetParamsOSIos HTTPAseOSGetParamsOS = "IOS"
+ HTTPAseOSGetParamsOSAndroid HTTPAseOSGetParamsOS = "ANDROID"
+ HTTPAseOSGetParamsOSChromeos HTTPAseOSGetParamsOS = "CHROMEOS"
+ HTTPAseOSGetParamsOSLinux HTTPAseOSGetParamsOS = "LINUX"
+ HTTPAseOSGetParamsOSSmartTv HTTPAseOSGetParamsOS = "SMART_TV"
+)
+
+type HTTPAseOSGetParamsBotClass string
+
+const (
+ HTTPAseOSGetParamsBotClassLikelyAutomated HTTPAseOSGetParamsBotClass = "LIKELY_AUTOMATED"
+ HTTPAseOSGetParamsBotClassLikelyHuman HTTPAseOSGetParamsBotClass = "LIKELY_HUMAN"
+)
+
+type HTTPAseOSGetParamsDateRange string
+
+const (
+ HTTPAseOSGetParamsDateRange1d HTTPAseOSGetParamsDateRange = "1d"
+ HTTPAseOSGetParamsDateRange2d HTTPAseOSGetParamsDateRange = "2d"
+ HTTPAseOSGetParamsDateRange7d HTTPAseOSGetParamsDateRange = "7d"
+ HTTPAseOSGetParamsDateRange14d HTTPAseOSGetParamsDateRange = "14d"
+ HTTPAseOSGetParamsDateRange28d HTTPAseOSGetParamsDateRange = "28d"
+ HTTPAseOSGetParamsDateRange12w HTTPAseOSGetParamsDateRange = "12w"
+ HTTPAseOSGetParamsDateRange24w HTTPAseOSGetParamsDateRange = "24w"
+ HTTPAseOSGetParamsDateRange52w HTTPAseOSGetParamsDateRange = "52w"
+ HTTPAseOSGetParamsDateRange1dControl HTTPAseOSGetParamsDateRange = "1dControl"
+ HTTPAseOSGetParamsDateRange2dControl HTTPAseOSGetParamsDateRange = "2dControl"
+ HTTPAseOSGetParamsDateRange7dControl HTTPAseOSGetParamsDateRange = "7dControl"
+ HTTPAseOSGetParamsDateRange14dControl HTTPAseOSGetParamsDateRange = "14dControl"
+ HTTPAseOSGetParamsDateRange28dControl HTTPAseOSGetParamsDateRange = "28dControl"
+ HTTPAseOSGetParamsDateRange12wControl HTTPAseOSGetParamsDateRange = "12wControl"
+ HTTPAseOSGetParamsDateRange24wControl HTTPAseOSGetParamsDateRange = "24wControl"
+)
+
+type HTTPAseOSGetParamsDeviceType string
+
+const (
+ HTTPAseOSGetParamsDeviceTypeDesktop HTTPAseOSGetParamsDeviceType = "DESKTOP"
+ HTTPAseOSGetParamsDeviceTypeMobile HTTPAseOSGetParamsDeviceType = "MOBILE"
+ HTTPAseOSGetParamsDeviceTypeOther HTTPAseOSGetParamsDeviceType = "OTHER"
+)
+
+// Format results are returned in.
+type HTTPAseOSGetParamsFormat string
+
+const (
+ HTTPAseOSGetParamsFormatJson HTTPAseOSGetParamsFormat = "JSON"
+ HTTPAseOSGetParamsFormatCsv HTTPAseOSGetParamsFormat = "CSV"
+)
+
+type HTTPAseOSGetParamsHTTPProtocol string
+
+const (
+ HTTPAseOSGetParamsHTTPProtocolHTTP HTTPAseOSGetParamsHTTPProtocol = "HTTP"
+ HTTPAseOSGetParamsHTTPProtocolHTTPS HTTPAseOSGetParamsHTTPProtocol = "HTTPS"
+)
+
+type HTTPAseOSGetParamsHTTPVersion string
+
+const (
+ HTTPAseOSGetParamsHTTPVersionHttPv1 HTTPAseOSGetParamsHTTPVersion = "HTTPv1"
+ HTTPAseOSGetParamsHTTPVersionHttPv2 HTTPAseOSGetParamsHTTPVersion = "HTTPv2"
+ HTTPAseOSGetParamsHTTPVersionHttPv3 HTTPAseOSGetParamsHTTPVersion = "HTTPv3"
+)
+
+type HTTPAseOSGetParamsIPVersion string
+
+const (
+ HTTPAseOSGetParamsIPVersionIPv4 HTTPAseOSGetParamsIPVersion = "IPv4"
+ HTTPAseOSGetParamsIPVersionIPv6 HTTPAseOSGetParamsIPVersion = "IPv6"
+)
+
+type HTTPAseOSGetParamsTLSVersion string
+
+const (
+ HTTPAseOSGetParamsTLSVersionTlSv1_0 HTTPAseOSGetParamsTLSVersion = "TLSv1_0"
+ HTTPAseOSGetParamsTLSVersionTlSv1_1 HTTPAseOSGetParamsTLSVersion = "TLSv1_1"
+ HTTPAseOSGetParamsTLSVersionTlSv1_2 HTTPAseOSGetParamsTLSVersion = "TLSv1_2"
+ HTTPAseOSGetParamsTLSVersionTlSv1_3 HTTPAseOSGetParamsTLSVersion = "TLSv1_3"
+ HTTPAseOSGetParamsTLSVersionTlSvQuic HTTPAseOSGetParamsTLSVersion = "TLSvQUIC"
+)
+
+type HTTPAseOSGetResponseEnvelope struct {
+ Result HTTPAseOSGetResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON httpAseOSGetResponseEnvelopeJSON `json:"-"`
+}
+
+// httpAseOSGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [HTTPAseOSGetResponseEnvelope]
+type httpAseOSGetResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPAseOSGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpAseOSGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/radar/httpaseos_test.go b/radar/httpaseos_test.go
new file mode 100644
index 00000000000..172d8bf8315
--- /dev/null
+++ b/radar/httpaseos_test.go
@@ -0,0 +1,60 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/radar"
+)
+
+func TestHTTPAseOSGetWithOptionalParams(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"),
+ )
+ _, err := client.Radar.HTTP.Ases.OS.Get(
+ context.TODO(),
+ radar.HTTPAseOSGetParamsOSWindows,
+ radar.HTTPAseOSGetParams{
+ ASN: cloudflare.F([]string{"string", "string", "string"}),
+ BotClass: cloudflare.F([]radar.HTTPAseOSGetParamsBotClass{radar.HTTPAseOSGetParamsBotClassLikelyAutomated, radar.HTTPAseOSGetParamsBotClassLikelyHuman}),
+ Continent: cloudflare.F([]string{"string", "string", "string"}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.HTTPAseOSGetParamsDateRange{radar.HTTPAseOSGetParamsDateRange1d, radar.HTTPAseOSGetParamsDateRange2d, radar.HTTPAseOSGetParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DeviceType: cloudflare.F([]radar.HTTPAseOSGetParamsDeviceType{radar.HTTPAseOSGetParamsDeviceTypeDesktop, radar.HTTPAseOSGetParamsDeviceTypeMobile, radar.HTTPAseOSGetParamsDeviceTypeOther}),
+ Format: cloudflare.F(radar.HTTPAseOSGetParamsFormatJson),
+ HTTPProtocol: cloudflare.F([]radar.HTTPAseOSGetParamsHTTPProtocol{radar.HTTPAseOSGetParamsHTTPProtocolHTTP, radar.HTTPAseOSGetParamsHTTPProtocolHTTPS}),
+ HTTPVersion: cloudflare.F([]radar.HTTPAseOSGetParamsHTTPVersion{radar.HTTPAseOSGetParamsHTTPVersionHttPv1, radar.HTTPAseOSGetParamsHTTPVersionHttPv2, radar.HTTPAseOSGetParamsHTTPVersionHttPv3}),
+ IPVersion: cloudflare.F([]radar.HTTPAseOSGetParamsIPVersion{radar.HTTPAseOSGetParamsIPVersionIPv4, radar.HTTPAseOSGetParamsIPVersionIPv6}),
+ Limit: cloudflare.F(int64(5)),
+ Location: cloudflare.F([]string{"string", "string", "string"}),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ TLSVersion: cloudflare.F([]radar.HTTPAseOSGetParamsTLSVersion{radar.HTTPAseOSGetParamsTLSVersionTlSv1_0, radar.HTTPAseOSGetParamsTLSVersionTlSv1_1, radar.HTTPAseOSGetParamsTLSVersionTlSv1_2}),
+ },
+ )
+ 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/radar/httpasetlsversion.go b/radar/httpasetlsversion.go
new file mode 100644
index 00000000000..22d221f25e2
--- /dev/null
+++ b/radar/httpasetlsversion.go
@@ -0,0 +1,366 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// HTTPAseTLSVersionService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewHTTPAseTLSVersionService] method
+// instead.
+type HTTPAseTLSVersionService struct {
+ Options []option.RequestOption
+}
+
+// NewHTTPAseTLSVersionService generates a new service that applies the given
+// options to each request. These options are applied after the parent client's
+// options (if there is one), and before any request-specific options.
+func NewHTTPAseTLSVersionService(opts ...option.RequestOption) (r *HTTPAseTLSVersionService) {
+ r = &HTTPAseTLSVersionService{}
+ r.Options = opts
+ return
+}
+
+// Get the top autonomous systems (AS), by HTTP traffic, of the requested TLS
+// protocol version. Values are a percentage out of the total traffic.
+func (r *HTTPAseTLSVersionService) Get(ctx context.Context, tlsVersion HTTPAseTLSVersionGetParamsTLSVersion, query HTTPAseTLSVersionGetParams, opts ...option.RequestOption) (res *HTTPAseTLSVersionGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env HTTPAseTLSVersionGetResponseEnvelope
+ path := fmt.Sprintf("radar/http/top/ases/tls_version/%v", tlsVersion)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type HTTPAseTLSVersionGetResponse struct {
+ Meta HTTPAseTLSVersionGetResponseMeta `json:"meta,required"`
+ Top0 []HTTPAseTLSVersionGetResponseTop0 `json:"top_0,required"`
+ JSON httpAseTLSVersionGetResponseJSON `json:"-"`
+}
+
+// httpAseTLSVersionGetResponseJSON contains the JSON metadata for the struct
+// [HTTPAseTLSVersionGetResponse]
+type httpAseTLSVersionGetResponseJSON struct {
+ Meta apijson.Field
+ Top0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPAseTLSVersionGetResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpAseTLSVersionGetResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPAseTLSVersionGetResponseMeta struct {
+ DateRange []HTTPAseTLSVersionGetResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ ConfidenceInfo HTTPAseTLSVersionGetResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON httpAseTLSVersionGetResponseMetaJSON `json:"-"`
+}
+
+// httpAseTLSVersionGetResponseMetaJSON contains the JSON metadata for the struct
+// [HTTPAseTLSVersionGetResponseMeta]
+type httpAseTLSVersionGetResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPAseTLSVersionGetResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpAseTLSVersionGetResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPAseTLSVersionGetResponseMetaDateRange 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 httpAseTLSVersionGetResponseMetaDateRangeJSON `json:"-"`
+}
+
+// httpAseTLSVersionGetResponseMetaDateRangeJSON contains the JSON metadata for the
+// struct [HTTPAseTLSVersionGetResponseMetaDateRange]
+type httpAseTLSVersionGetResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPAseTLSVersionGetResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpAseTLSVersionGetResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPAseTLSVersionGetResponseMetaConfidenceInfo struct {
+ Annotations []HTTPAseTLSVersionGetResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON httpAseTLSVersionGetResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// httpAseTLSVersionGetResponseMetaConfidenceInfoJSON contains the JSON metadata
+// for the struct [HTTPAseTLSVersionGetResponseMetaConfidenceInfo]
+type httpAseTLSVersionGetResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPAseTLSVersionGetResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpAseTLSVersionGetResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPAseTLSVersionGetResponseMetaConfidenceInfoAnnotation 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 httpAseTLSVersionGetResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// httpAseTLSVersionGetResponseMetaConfidenceInfoAnnotationJSON contains the JSON
+// metadata for the struct
+// [HTTPAseTLSVersionGetResponseMetaConfidenceInfoAnnotation]
+type httpAseTLSVersionGetResponseMetaConfidenceInfoAnnotationJSON 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 *HTTPAseTLSVersionGetResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpAseTLSVersionGetResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPAseTLSVersionGetResponseTop0 struct {
+ ClientASN int64 `json:"clientASN,required"`
+ ClientAsName string `json:"clientASName,required"`
+ Value string `json:"value,required"`
+ JSON httpAseTLSVersionGetResponseTop0JSON `json:"-"`
+}
+
+// httpAseTLSVersionGetResponseTop0JSON contains the JSON metadata for the struct
+// [HTTPAseTLSVersionGetResponseTop0]
+type httpAseTLSVersionGetResponseTop0JSON struct {
+ ClientASN apijson.Field
+ ClientAsName apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPAseTLSVersionGetResponseTop0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpAseTLSVersionGetResponseTop0JSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPAseTLSVersionGetParams 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"`
+ // Filter for bot class. Refer to
+ // [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/).
+ BotClass param.Field[[]HTTPAseTLSVersionGetParamsBotClass] `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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]HTTPAseTLSVersionGetParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Filter for device type.
+ DeviceType param.Field[[]HTTPAseTLSVersionGetParamsDeviceType] `query:"deviceType"`
+ // Format results are returned in.
+ Format param.Field[HTTPAseTLSVersionGetParamsFormat] `query:"format"`
+ // Filter for http protocol.
+ HTTPProtocol param.Field[[]HTTPAseTLSVersionGetParamsHTTPProtocol] `query:"httpProtocol"`
+ // Filter for http version.
+ HTTPVersion param.Field[[]HTTPAseTLSVersionGetParamsHTTPVersion] `query:"httpVersion"`
+ // Filter for ip version.
+ IPVersion param.Field[[]HTTPAseTLSVersionGetParamsIPVersion] `query:"ipVersion"`
+ // 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 os name.
+ OS param.Field[[]HTTPAseTLSVersionGetParamsOS] `query:"os"`
+}
+
+// URLQuery serializes [HTTPAseTLSVersionGetParams]'s query parameters as
+// `url.Values`.
+func (r HTTPAseTLSVersionGetParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// TLS version.
+type HTTPAseTLSVersionGetParamsTLSVersion string
+
+const (
+ HTTPAseTLSVersionGetParamsTLSVersionTlSv1_0 HTTPAseTLSVersionGetParamsTLSVersion = "TLSv1_0"
+ HTTPAseTLSVersionGetParamsTLSVersionTlSv1_1 HTTPAseTLSVersionGetParamsTLSVersion = "TLSv1_1"
+ HTTPAseTLSVersionGetParamsTLSVersionTlSv1_2 HTTPAseTLSVersionGetParamsTLSVersion = "TLSv1_2"
+ HTTPAseTLSVersionGetParamsTLSVersionTlSv1_3 HTTPAseTLSVersionGetParamsTLSVersion = "TLSv1_3"
+ HTTPAseTLSVersionGetParamsTLSVersionTlSvQuic HTTPAseTLSVersionGetParamsTLSVersion = "TLSvQUIC"
+)
+
+type HTTPAseTLSVersionGetParamsBotClass string
+
+const (
+ HTTPAseTLSVersionGetParamsBotClassLikelyAutomated HTTPAseTLSVersionGetParamsBotClass = "LIKELY_AUTOMATED"
+ HTTPAseTLSVersionGetParamsBotClassLikelyHuman HTTPAseTLSVersionGetParamsBotClass = "LIKELY_HUMAN"
+)
+
+type HTTPAseTLSVersionGetParamsDateRange string
+
+const (
+ HTTPAseTLSVersionGetParamsDateRange1d HTTPAseTLSVersionGetParamsDateRange = "1d"
+ HTTPAseTLSVersionGetParamsDateRange2d HTTPAseTLSVersionGetParamsDateRange = "2d"
+ HTTPAseTLSVersionGetParamsDateRange7d HTTPAseTLSVersionGetParamsDateRange = "7d"
+ HTTPAseTLSVersionGetParamsDateRange14d HTTPAseTLSVersionGetParamsDateRange = "14d"
+ HTTPAseTLSVersionGetParamsDateRange28d HTTPAseTLSVersionGetParamsDateRange = "28d"
+ HTTPAseTLSVersionGetParamsDateRange12w HTTPAseTLSVersionGetParamsDateRange = "12w"
+ HTTPAseTLSVersionGetParamsDateRange24w HTTPAseTLSVersionGetParamsDateRange = "24w"
+ HTTPAseTLSVersionGetParamsDateRange52w HTTPAseTLSVersionGetParamsDateRange = "52w"
+ HTTPAseTLSVersionGetParamsDateRange1dControl HTTPAseTLSVersionGetParamsDateRange = "1dControl"
+ HTTPAseTLSVersionGetParamsDateRange2dControl HTTPAseTLSVersionGetParamsDateRange = "2dControl"
+ HTTPAseTLSVersionGetParamsDateRange7dControl HTTPAseTLSVersionGetParamsDateRange = "7dControl"
+ HTTPAseTLSVersionGetParamsDateRange14dControl HTTPAseTLSVersionGetParamsDateRange = "14dControl"
+ HTTPAseTLSVersionGetParamsDateRange28dControl HTTPAseTLSVersionGetParamsDateRange = "28dControl"
+ HTTPAseTLSVersionGetParamsDateRange12wControl HTTPAseTLSVersionGetParamsDateRange = "12wControl"
+ HTTPAseTLSVersionGetParamsDateRange24wControl HTTPAseTLSVersionGetParamsDateRange = "24wControl"
+)
+
+type HTTPAseTLSVersionGetParamsDeviceType string
+
+const (
+ HTTPAseTLSVersionGetParamsDeviceTypeDesktop HTTPAseTLSVersionGetParamsDeviceType = "DESKTOP"
+ HTTPAseTLSVersionGetParamsDeviceTypeMobile HTTPAseTLSVersionGetParamsDeviceType = "MOBILE"
+ HTTPAseTLSVersionGetParamsDeviceTypeOther HTTPAseTLSVersionGetParamsDeviceType = "OTHER"
+)
+
+// Format results are returned in.
+type HTTPAseTLSVersionGetParamsFormat string
+
+const (
+ HTTPAseTLSVersionGetParamsFormatJson HTTPAseTLSVersionGetParamsFormat = "JSON"
+ HTTPAseTLSVersionGetParamsFormatCsv HTTPAseTLSVersionGetParamsFormat = "CSV"
+)
+
+type HTTPAseTLSVersionGetParamsHTTPProtocol string
+
+const (
+ HTTPAseTLSVersionGetParamsHTTPProtocolHTTP HTTPAseTLSVersionGetParamsHTTPProtocol = "HTTP"
+ HTTPAseTLSVersionGetParamsHTTPProtocolHTTPS HTTPAseTLSVersionGetParamsHTTPProtocol = "HTTPS"
+)
+
+type HTTPAseTLSVersionGetParamsHTTPVersion string
+
+const (
+ HTTPAseTLSVersionGetParamsHTTPVersionHttPv1 HTTPAseTLSVersionGetParamsHTTPVersion = "HTTPv1"
+ HTTPAseTLSVersionGetParamsHTTPVersionHttPv2 HTTPAseTLSVersionGetParamsHTTPVersion = "HTTPv2"
+ HTTPAseTLSVersionGetParamsHTTPVersionHttPv3 HTTPAseTLSVersionGetParamsHTTPVersion = "HTTPv3"
+)
+
+type HTTPAseTLSVersionGetParamsIPVersion string
+
+const (
+ HTTPAseTLSVersionGetParamsIPVersionIPv4 HTTPAseTLSVersionGetParamsIPVersion = "IPv4"
+ HTTPAseTLSVersionGetParamsIPVersionIPv6 HTTPAseTLSVersionGetParamsIPVersion = "IPv6"
+)
+
+type HTTPAseTLSVersionGetParamsOS string
+
+const (
+ HTTPAseTLSVersionGetParamsOSWindows HTTPAseTLSVersionGetParamsOS = "WINDOWS"
+ HTTPAseTLSVersionGetParamsOSMacosx HTTPAseTLSVersionGetParamsOS = "MACOSX"
+ HTTPAseTLSVersionGetParamsOSIos HTTPAseTLSVersionGetParamsOS = "IOS"
+ HTTPAseTLSVersionGetParamsOSAndroid HTTPAseTLSVersionGetParamsOS = "ANDROID"
+ HTTPAseTLSVersionGetParamsOSChromeos HTTPAseTLSVersionGetParamsOS = "CHROMEOS"
+ HTTPAseTLSVersionGetParamsOSLinux HTTPAseTLSVersionGetParamsOS = "LINUX"
+ HTTPAseTLSVersionGetParamsOSSmartTv HTTPAseTLSVersionGetParamsOS = "SMART_TV"
+)
+
+type HTTPAseTLSVersionGetResponseEnvelope struct {
+ Result HTTPAseTLSVersionGetResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON httpAseTLSVersionGetResponseEnvelopeJSON `json:"-"`
+}
+
+// httpAseTLSVersionGetResponseEnvelopeJSON contains the JSON metadata for the
+// struct [HTTPAseTLSVersionGetResponseEnvelope]
+type httpAseTLSVersionGetResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPAseTLSVersionGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpAseTLSVersionGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/radar/httpasetlsversion_test.go b/radar/httpasetlsversion_test.go
new file mode 100644
index 00000000000..fa8d7ef6c09
--- /dev/null
+++ b/radar/httpasetlsversion_test.go
@@ -0,0 +1,60 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/radar"
+)
+
+func TestHTTPAseTLSVersionGetWithOptionalParams(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"),
+ )
+ _, err := client.Radar.HTTP.Ases.TLSVersion.Get(
+ context.TODO(),
+ radar.HTTPAseTLSVersionGetParamsTLSVersionTlSv1_0,
+ radar.HTTPAseTLSVersionGetParams{
+ ASN: cloudflare.F([]string{"string", "string", "string"}),
+ BotClass: cloudflare.F([]radar.HTTPAseTLSVersionGetParamsBotClass{radar.HTTPAseTLSVersionGetParamsBotClassLikelyAutomated, radar.HTTPAseTLSVersionGetParamsBotClassLikelyHuman}),
+ Continent: cloudflare.F([]string{"string", "string", "string"}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.HTTPAseTLSVersionGetParamsDateRange{radar.HTTPAseTLSVersionGetParamsDateRange1d, radar.HTTPAseTLSVersionGetParamsDateRange2d, radar.HTTPAseTLSVersionGetParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DeviceType: cloudflare.F([]radar.HTTPAseTLSVersionGetParamsDeviceType{radar.HTTPAseTLSVersionGetParamsDeviceTypeDesktop, radar.HTTPAseTLSVersionGetParamsDeviceTypeMobile, radar.HTTPAseTLSVersionGetParamsDeviceTypeOther}),
+ Format: cloudflare.F(radar.HTTPAseTLSVersionGetParamsFormatJson),
+ HTTPProtocol: cloudflare.F([]radar.HTTPAseTLSVersionGetParamsHTTPProtocol{radar.HTTPAseTLSVersionGetParamsHTTPProtocolHTTP, radar.HTTPAseTLSVersionGetParamsHTTPProtocolHTTPS}),
+ HTTPVersion: cloudflare.F([]radar.HTTPAseTLSVersionGetParamsHTTPVersion{radar.HTTPAseTLSVersionGetParamsHTTPVersionHttPv1, radar.HTTPAseTLSVersionGetParamsHTTPVersionHttPv2, radar.HTTPAseTLSVersionGetParamsHTTPVersionHttPv3}),
+ IPVersion: cloudflare.F([]radar.HTTPAseTLSVersionGetParamsIPVersion{radar.HTTPAseTLSVersionGetParamsIPVersionIPv4, radar.HTTPAseTLSVersionGetParamsIPVersionIPv6}),
+ Limit: cloudflare.F(int64(5)),
+ Location: cloudflare.F([]string{"string", "string", "string"}),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ OS: cloudflare.F([]radar.HTTPAseTLSVersionGetParamsOS{radar.HTTPAseTLSVersionGetParamsOSWindows, radar.HTTPAseTLSVersionGetParamsOSMacosx, radar.HTTPAseTLSVersionGetParamsOSIos}),
+ },
+ )
+ 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/radar/httplocation.go b/radar/httplocation.go
new file mode 100644
index 00000000000..e7d0d442222
--- /dev/null
+++ b/radar/httplocation.go
@@ -0,0 +1,378 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "context"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// HTTPLocationService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewHTTPLocationService] method
+// instead.
+type HTTPLocationService struct {
+ Options []option.RequestOption
+ BotClass *HTTPLocationBotClassService
+ DeviceType *HTTPLocationDeviceTypeService
+ HTTPProtocol *HTTPLocationHTTPProtocolService
+ HTTPMethod *HTTPLocationHTTPMethodService
+ IPVersion *HTTPLocationIPVersionService
+ OS *HTTPLocationOSService
+ TLSVersion *HTTPLocationTLSVersionService
+}
+
+// NewHTTPLocationService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewHTTPLocationService(opts ...option.RequestOption) (r *HTTPLocationService) {
+ r = &HTTPLocationService{}
+ r.Options = opts
+ r.BotClass = NewHTTPLocationBotClassService(opts...)
+ r.DeviceType = NewHTTPLocationDeviceTypeService(opts...)
+ r.HTTPProtocol = NewHTTPLocationHTTPProtocolService(opts...)
+ r.HTTPMethod = NewHTTPLocationHTTPMethodService(opts...)
+ r.IPVersion = NewHTTPLocationIPVersionService(opts...)
+ r.OS = NewHTTPLocationOSService(opts...)
+ r.TLSVersion = NewHTTPLocationTLSVersionService(opts...)
+ return
+}
+
+// Get the top locations by HTTP traffic. Values are a percentage out of the total
+// traffic.
+func (r *HTTPLocationService) Get(ctx context.Context, query HTTPLocationGetParams, opts ...option.RequestOption) (res *HTTPLocationGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env HTTPLocationGetResponseEnvelope
+ path := "radar/http/top/locations"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type HTTPLocationGetResponse struct {
+ Meta HTTPLocationGetResponseMeta `json:"meta,required"`
+ Top0 []HTTPLocationGetResponseTop0 `json:"top_0,required"`
+ JSON httpLocationGetResponseJSON `json:"-"`
+}
+
+// httpLocationGetResponseJSON contains the JSON metadata for the struct
+// [HTTPLocationGetResponse]
+type httpLocationGetResponseJSON struct {
+ Meta apijson.Field
+ Top0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPLocationGetResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpLocationGetResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPLocationGetResponseMeta struct {
+ DateRange []HTTPLocationGetResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ ConfidenceInfo HTTPLocationGetResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON httpLocationGetResponseMetaJSON `json:"-"`
+}
+
+// httpLocationGetResponseMetaJSON contains the JSON metadata for the struct
+// [HTTPLocationGetResponseMeta]
+type httpLocationGetResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPLocationGetResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpLocationGetResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPLocationGetResponseMetaDateRange 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 httpLocationGetResponseMetaDateRangeJSON `json:"-"`
+}
+
+// httpLocationGetResponseMetaDateRangeJSON contains the JSON metadata for the
+// struct [HTTPLocationGetResponseMetaDateRange]
+type httpLocationGetResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPLocationGetResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpLocationGetResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPLocationGetResponseMetaConfidenceInfo struct {
+ Annotations []HTTPLocationGetResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON httpLocationGetResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// httpLocationGetResponseMetaConfidenceInfoJSON contains the JSON metadata for the
+// struct [HTTPLocationGetResponseMetaConfidenceInfo]
+type httpLocationGetResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPLocationGetResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpLocationGetResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPLocationGetResponseMetaConfidenceInfoAnnotation 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 httpLocationGetResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// httpLocationGetResponseMetaConfidenceInfoAnnotationJSON contains the JSON
+// metadata for the struct [HTTPLocationGetResponseMetaConfidenceInfoAnnotation]
+type httpLocationGetResponseMetaConfidenceInfoAnnotationJSON 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 *HTTPLocationGetResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpLocationGetResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPLocationGetResponseTop0 struct {
+ ClientCountryAlpha2 string `json:"clientCountryAlpha2,required"`
+ ClientCountryName string `json:"clientCountryName,required"`
+ Value string `json:"value,required"`
+ JSON httpLocationGetResponseTop0JSON `json:"-"`
+}
+
+// httpLocationGetResponseTop0JSON contains the JSON metadata for the struct
+// [HTTPLocationGetResponseTop0]
+type httpLocationGetResponseTop0JSON struct {
+ ClientCountryAlpha2 apijson.Field
+ ClientCountryName apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPLocationGetResponseTop0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpLocationGetResponseTop0JSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPLocationGetParams 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"`
+ // Filter for bot class. Refer to
+ // [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/).
+ BotClass param.Field[[]HTTPLocationGetParamsBotClass] `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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]HTTPLocationGetParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Filter for device type.
+ DeviceType param.Field[[]HTTPLocationGetParamsDeviceType] `query:"deviceType"`
+ // Format results are returned in.
+ Format param.Field[HTTPLocationGetParamsFormat] `query:"format"`
+ // Filter for http protocol.
+ HTTPProtocol param.Field[[]HTTPLocationGetParamsHTTPProtocol] `query:"httpProtocol"`
+ // Filter for http version.
+ HTTPVersion param.Field[[]HTTPLocationGetParamsHTTPVersion] `query:"httpVersion"`
+ // Filter for ip version.
+ IPVersion param.Field[[]HTTPLocationGetParamsIPVersion] `query:"ipVersion"`
+ // 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 os name.
+ OS param.Field[[]HTTPLocationGetParamsOS] `query:"os"`
+ // Filter for tls version.
+ TLSVersion param.Field[[]HTTPLocationGetParamsTLSVersion] `query:"tlsVersion"`
+}
+
+// URLQuery serializes [HTTPLocationGetParams]'s query parameters as `url.Values`.
+func (r HTTPLocationGetParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type HTTPLocationGetParamsBotClass string
+
+const (
+ HTTPLocationGetParamsBotClassLikelyAutomated HTTPLocationGetParamsBotClass = "LIKELY_AUTOMATED"
+ HTTPLocationGetParamsBotClassLikelyHuman HTTPLocationGetParamsBotClass = "LIKELY_HUMAN"
+)
+
+type HTTPLocationGetParamsDateRange string
+
+const (
+ HTTPLocationGetParamsDateRange1d HTTPLocationGetParamsDateRange = "1d"
+ HTTPLocationGetParamsDateRange2d HTTPLocationGetParamsDateRange = "2d"
+ HTTPLocationGetParamsDateRange7d HTTPLocationGetParamsDateRange = "7d"
+ HTTPLocationGetParamsDateRange14d HTTPLocationGetParamsDateRange = "14d"
+ HTTPLocationGetParamsDateRange28d HTTPLocationGetParamsDateRange = "28d"
+ HTTPLocationGetParamsDateRange12w HTTPLocationGetParamsDateRange = "12w"
+ HTTPLocationGetParamsDateRange24w HTTPLocationGetParamsDateRange = "24w"
+ HTTPLocationGetParamsDateRange52w HTTPLocationGetParamsDateRange = "52w"
+ HTTPLocationGetParamsDateRange1dControl HTTPLocationGetParamsDateRange = "1dControl"
+ HTTPLocationGetParamsDateRange2dControl HTTPLocationGetParamsDateRange = "2dControl"
+ HTTPLocationGetParamsDateRange7dControl HTTPLocationGetParamsDateRange = "7dControl"
+ HTTPLocationGetParamsDateRange14dControl HTTPLocationGetParamsDateRange = "14dControl"
+ HTTPLocationGetParamsDateRange28dControl HTTPLocationGetParamsDateRange = "28dControl"
+ HTTPLocationGetParamsDateRange12wControl HTTPLocationGetParamsDateRange = "12wControl"
+ HTTPLocationGetParamsDateRange24wControl HTTPLocationGetParamsDateRange = "24wControl"
+)
+
+type HTTPLocationGetParamsDeviceType string
+
+const (
+ HTTPLocationGetParamsDeviceTypeDesktop HTTPLocationGetParamsDeviceType = "DESKTOP"
+ HTTPLocationGetParamsDeviceTypeMobile HTTPLocationGetParamsDeviceType = "MOBILE"
+ HTTPLocationGetParamsDeviceTypeOther HTTPLocationGetParamsDeviceType = "OTHER"
+)
+
+// Format results are returned in.
+type HTTPLocationGetParamsFormat string
+
+const (
+ HTTPLocationGetParamsFormatJson HTTPLocationGetParamsFormat = "JSON"
+ HTTPLocationGetParamsFormatCsv HTTPLocationGetParamsFormat = "CSV"
+)
+
+type HTTPLocationGetParamsHTTPProtocol string
+
+const (
+ HTTPLocationGetParamsHTTPProtocolHTTP HTTPLocationGetParamsHTTPProtocol = "HTTP"
+ HTTPLocationGetParamsHTTPProtocolHTTPS HTTPLocationGetParamsHTTPProtocol = "HTTPS"
+)
+
+type HTTPLocationGetParamsHTTPVersion string
+
+const (
+ HTTPLocationGetParamsHTTPVersionHttPv1 HTTPLocationGetParamsHTTPVersion = "HTTPv1"
+ HTTPLocationGetParamsHTTPVersionHttPv2 HTTPLocationGetParamsHTTPVersion = "HTTPv2"
+ HTTPLocationGetParamsHTTPVersionHttPv3 HTTPLocationGetParamsHTTPVersion = "HTTPv3"
+)
+
+type HTTPLocationGetParamsIPVersion string
+
+const (
+ HTTPLocationGetParamsIPVersionIPv4 HTTPLocationGetParamsIPVersion = "IPv4"
+ HTTPLocationGetParamsIPVersionIPv6 HTTPLocationGetParamsIPVersion = "IPv6"
+)
+
+type HTTPLocationGetParamsOS string
+
+const (
+ HTTPLocationGetParamsOSWindows HTTPLocationGetParamsOS = "WINDOWS"
+ HTTPLocationGetParamsOSMacosx HTTPLocationGetParamsOS = "MACOSX"
+ HTTPLocationGetParamsOSIos HTTPLocationGetParamsOS = "IOS"
+ HTTPLocationGetParamsOSAndroid HTTPLocationGetParamsOS = "ANDROID"
+ HTTPLocationGetParamsOSChromeos HTTPLocationGetParamsOS = "CHROMEOS"
+ HTTPLocationGetParamsOSLinux HTTPLocationGetParamsOS = "LINUX"
+ HTTPLocationGetParamsOSSmartTv HTTPLocationGetParamsOS = "SMART_TV"
+)
+
+type HTTPLocationGetParamsTLSVersion string
+
+const (
+ HTTPLocationGetParamsTLSVersionTlSv1_0 HTTPLocationGetParamsTLSVersion = "TLSv1_0"
+ HTTPLocationGetParamsTLSVersionTlSv1_1 HTTPLocationGetParamsTLSVersion = "TLSv1_1"
+ HTTPLocationGetParamsTLSVersionTlSv1_2 HTTPLocationGetParamsTLSVersion = "TLSv1_2"
+ HTTPLocationGetParamsTLSVersionTlSv1_3 HTTPLocationGetParamsTLSVersion = "TLSv1_3"
+ HTTPLocationGetParamsTLSVersionTlSvQuic HTTPLocationGetParamsTLSVersion = "TLSvQUIC"
+)
+
+type HTTPLocationGetResponseEnvelope struct {
+ Result HTTPLocationGetResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON httpLocationGetResponseEnvelopeJSON `json:"-"`
+}
+
+// httpLocationGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [HTTPLocationGetResponseEnvelope]
+type httpLocationGetResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPLocationGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpLocationGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/radar/httplocation_test.go b/radar/httplocation_test.go
new file mode 100644
index 00000000000..a54edbe2c35
--- /dev/null
+++ b/radar/httplocation_test.go
@@ -0,0 +1,57 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/radar"
+)
+
+func TestHTTPLocationGetWithOptionalParams(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"),
+ )
+ _, err := client.Radar.HTTP.Locations.Get(context.TODO(), radar.HTTPLocationGetParams{
+ ASN: cloudflare.F([]string{"string", "string", "string"}),
+ BotClass: cloudflare.F([]radar.HTTPLocationGetParamsBotClass{radar.HTTPLocationGetParamsBotClassLikelyAutomated, radar.HTTPLocationGetParamsBotClassLikelyHuman}),
+ Continent: cloudflare.F([]string{"string", "string", "string"}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.HTTPLocationGetParamsDateRange{radar.HTTPLocationGetParamsDateRange1d, radar.HTTPLocationGetParamsDateRange2d, radar.HTTPLocationGetParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DeviceType: cloudflare.F([]radar.HTTPLocationGetParamsDeviceType{radar.HTTPLocationGetParamsDeviceTypeDesktop, radar.HTTPLocationGetParamsDeviceTypeMobile, radar.HTTPLocationGetParamsDeviceTypeOther}),
+ Format: cloudflare.F(radar.HTTPLocationGetParamsFormatJson),
+ HTTPProtocol: cloudflare.F([]radar.HTTPLocationGetParamsHTTPProtocol{radar.HTTPLocationGetParamsHTTPProtocolHTTP, radar.HTTPLocationGetParamsHTTPProtocolHTTPS}),
+ HTTPVersion: cloudflare.F([]radar.HTTPLocationGetParamsHTTPVersion{radar.HTTPLocationGetParamsHTTPVersionHttPv1, radar.HTTPLocationGetParamsHTTPVersionHttPv2, radar.HTTPLocationGetParamsHTTPVersionHttPv3}),
+ IPVersion: cloudflare.F([]radar.HTTPLocationGetParamsIPVersion{radar.HTTPLocationGetParamsIPVersionIPv4, radar.HTTPLocationGetParamsIPVersionIPv6}),
+ Limit: cloudflare.F(int64(5)),
+ Location: cloudflare.F([]string{"string", "string", "string"}),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ OS: cloudflare.F([]radar.HTTPLocationGetParamsOS{radar.HTTPLocationGetParamsOSWindows, radar.HTTPLocationGetParamsOSMacosx, radar.HTTPLocationGetParamsOSIos}),
+ TLSVersion: cloudflare.F([]radar.HTTPLocationGetParamsTLSVersion{radar.HTTPLocationGetParamsTLSVersionTlSv1_0, radar.HTTPLocationGetParamsTLSVersionTlSv1_1, radar.HTTPLocationGetParamsTLSVersionTlSv1_2}),
+ })
+ 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/radar/httplocationbotclass.go b/radar/httplocationbotclass.go
new file mode 100644
index 00000000000..efaa36d6d63
--- /dev/null
+++ b/radar/httplocationbotclass.go
@@ -0,0 +1,367 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// HTTPLocationBotClassService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewHTTPLocationBotClassService]
+// method instead.
+type HTTPLocationBotClassService struct {
+ Options []option.RequestOption
+}
+
+// NewHTTPLocationBotClassService generates a new service that applies the given
+// options to each request. These options are applied after the parent client's
+// options (if there is one), and before any request-specific options.
+func NewHTTPLocationBotClassService(opts ...option.RequestOption) (r *HTTPLocationBotClassService) {
+ r = &HTTPLocationBotClassService{}
+ r.Options = opts
+ return
+}
+
+// Get the top locations, by HTTP traffic, of the requested bot class. These two
+// categories use Cloudflare's bot score - refer to [Bot
+// scores])https://developers.cloudflare.com/bots/concepts/bot-score). Values are a
+// percentage out of the total traffic.
+func (r *HTTPLocationBotClassService) Get(ctx context.Context, botClass HTTPLocationBotClassGetParamsBotClass, query HTTPLocationBotClassGetParams, opts ...option.RequestOption) (res *HTTPLocationBotClassGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env HTTPLocationBotClassGetResponseEnvelope
+ path := fmt.Sprintf("radar/http/top/locations/bot_class/%v", botClass)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type HTTPLocationBotClassGetResponse struct {
+ Meta HTTPLocationBotClassGetResponseMeta `json:"meta,required"`
+ Top0 []HTTPLocationBotClassGetResponseTop0 `json:"top_0,required"`
+ JSON httpLocationBotClassGetResponseJSON `json:"-"`
+}
+
+// httpLocationBotClassGetResponseJSON contains the JSON metadata for the struct
+// [HTTPLocationBotClassGetResponse]
+type httpLocationBotClassGetResponseJSON struct {
+ Meta apijson.Field
+ Top0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPLocationBotClassGetResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpLocationBotClassGetResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPLocationBotClassGetResponseMeta struct {
+ DateRange []HTTPLocationBotClassGetResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ ConfidenceInfo HTTPLocationBotClassGetResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON httpLocationBotClassGetResponseMetaJSON `json:"-"`
+}
+
+// httpLocationBotClassGetResponseMetaJSON contains the JSON metadata for the
+// struct [HTTPLocationBotClassGetResponseMeta]
+type httpLocationBotClassGetResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPLocationBotClassGetResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpLocationBotClassGetResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPLocationBotClassGetResponseMetaDateRange 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 httpLocationBotClassGetResponseMetaDateRangeJSON `json:"-"`
+}
+
+// httpLocationBotClassGetResponseMetaDateRangeJSON contains the JSON metadata for
+// the struct [HTTPLocationBotClassGetResponseMetaDateRange]
+type httpLocationBotClassGetResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPLocationBotClassGetResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpLocationBotClassGetResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPLocationBotClassGetResponseMetaConfidenceInfo struct {
+ Annotations []HTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON httpLocationBotClassGetResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// httpLocationBotClassGetResponseMetaConfidenceInfoJSON contains the JSON metadata
+// for the struct [HTTPLocationBotClassGetResponseMetaConfidenceInfo]
+type httpLocationBotClassGetResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPLocationBotClassGetResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpLocationBotClassGetResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotation 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 httpLocationBotClassGetResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// httpLocationBotClassGetResponseMetaConfidenceInfoAnnotationJSON contains the
+// JSON metadata for the struct
+// [HTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotation]
+type httpLocationBotClassGetResponseMetaConfidenceInfoAnnotationJSON 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 *HTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpLocationBotClassGetResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPLocationBotClassGetResponseTop0 struct {
+ ClientCountryAlpha2 string `json:"clientCountryAlpha2,required"`
+ ClientCountryName string `json:"clientCountryName,required"`
+ Value string `json:"value,required"`
+ JSON httpLocationBotClassGetResponseTop0JSON `json:"-"`
+}
+
+// httpLocationBotClassGetResponseTop0JSON contains the JSON metadata for the
+// struct [HTTPLocationBotClassGetResponseTop0]
+type httpLocationBotClassGetResponseTop0JSON struct {
+ ClientCountryAlpha2 apijson.Field
+ ClientCountryName apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPLocationBotClassGetResponseTop0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpLocationBotClassGetResponseTop0JSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPLocationBotClassGetParams 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"`
+ // 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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]HTTPLocationBotClassGetParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Filter for device type.
+ DeviceType param.Field[[]HTTPLocationBotClassGetParamsDeviceType] `query:"deviceType"`
+ // Format results are returned in.
+ Format param.Field[HTTPLocationBotClassGetParamsFormat] `query:"format"`
+ // Filter for http protocol.
+ HTTPProtocol param.Field[[]HTTPLocationBotClassGetParamsHTTPProtocol] `query:"httpProtocol"`
+ // Filter for http version.
+ HTTPVersion param.Field[[]HTTPLocationBotClassGetParamsHTTPVersion] `query:"httpVersion"`
+ // Filter for ip version.
+ IPVersion param.Field[[]HTTPLocationBotClassGetParamsIPVersion] `query:"ipVersion"`
+ // 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 os name.
+ OS param.Field[[]HTTPLocationBotClassGetParamsOS] `query:"os"`
+ // Filter for tls version.
+ TLSVersion param.Field[[]HTTPLocationBotClassGetParamsTLSVersion] `query:"tlsVersion"`
+}
+
+// URLQuery serializes [HTTPLocationBotClassGetParams]'s query parameters as
+// `url.Values`.
+func (r HTTPLocationBotClassGetParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Bot class.
+type HTTPLocationBotClassGetParamsBotClass string
+
+const (
+ HTTPLocationBotClassGetParamsBotClassLikelyAutomated HTTPLocationBotClassGetParamsBotClass = "LIKELY_AUTOMATED"
+ HTTPLocationBotClassGetParamsBotClassLikelyHuman HTTPLocationBotClassGetParamsBotClass = "LIKELY_HUMAN"
+)
+
+type HTTPLocationBotClassGetParamsDateRange string
+
+const (
+ HTTPLocationBotClassGetParamsDateRange1d HTTPLocationBotClassGetParamsDateRange = "1d"
+ HTTPLocationBotClassGetParamsDateRange2d HTTPLocationBotClassGetParamsDateRange = "2d"
+ HTTPLocationBotClassGetParamsDateRange7d HTTPLocationBotClassGetParamsDateRange = "7d"
+ HTTPLocationBotClassGetParamsDateRange14d HTTPLocationBotClassGetParamsDateRange = "14d"
+ HTTPLocationBotClassGetParamsDateRange28d HTTPLocationBotClassGetParamsDateRange = "28d"
+ HTTPLocationBotClassGetParamsDateRange12w HTTPLocationBotClassGetParamsDateRange = "12w"
+ HTTPLocationBotClassGetParamsDateRange24w HTTPLocationBotClassGetParamsDateRange = "24w"
+ HTTPLocationBotClassGetParamsDateRange52w HTTPLocationBotClassGetParamsDateRange = "52w"
+ HTTPLocationBotClassGetParamsDateRange1dControl HTTPLocationBotClassGetParamsDateRange = "1dControl"
+ HTTPLocationBotClassGetParamsDateRange2dControl HTTPLocationBotClassGetParamsDateRange = "2dControl"
+ HTTPLocationBotClassGetParamsDateRange7dControl HTTPLocationBotClassGetParamsDateRange = "7dControl"
+ HTTPLocationBotClassGetParamsDateRange14dControl HTTPLocationBotClassGetParamsDateRange = "14dControl"
+ HTTPLocationBotClassGetParamsDateRange28dControl HTTPLocationBotClassGetParamsDateRange = "28dControl"
+ HTTPLocationBotClassGetParamsDateRange12wControl HTTPLocationBotClassGetParamsDateRange = "12wControl"
+ HTTPLocationBotClassGetParamsDateRange24wControl HTTPLocationBotClassGetParamsDateRange = "24wControl"
+)
+
+type HTTPLocationBotClassGetParamsDeviceType string
+
+const (
+ HTTPLocationBotClassGetParamsDeviceTypeDesktop HTTPLocationBotClassGetParamsDeviceType = "DESKTOP"
+ HTTPLocationBotClassGetParamsDeviceTypeMobile HTTPLocationBotClassGetParamsDeviceType = "MOBILE"
+ HTTPLocationBotClassGetParamsDeviceTypeOther HTTPLocationBotClassGetParamsDeviceType = "OTHER"
+)
+
+// Format results are returned in.
+type HTTPLocationBotClassGetParamsFormat string
+
+const (
+ HTTPLocationBotClassGetParamsFormatJson HTTPLocationBotClassGetParamsFormat = "JSON"
+ HTTPLocationBotClassGetParamsFormatCsv HTTPLocationBotClassGetParamsFormat = "CSV"
+)
+
+type HTTPLocationBotClassGetParamsHTTPProtocol string
+
+const (
+ HTTPLocationBotClassGetParamsHTTPProtocolHTTP HTTPLocationBotClassGetParamsHTTPProtocol = "HTTP"
+ HTTPLocationBotClassGetParamsHTTPProtocolHTTPS HTTPLocationBotClassGetParamsHTTPProtocol = "HTTPS"
+)
+
+type HTTPLocationBotClassGetParamsHTTPVersion string
+
+const (
+ HTTPLocationBotClassGetParamsHTTPVersionHttPv1 HTTPLocationBotClassGetParamsHTTPVersion = "HTTPv1"
+ HTTPLocationBotClassGetParamsHTTPVersionHttPv2 HTTPLocationBotClassGetParamsHTTPVersion = "HTTPv2"
+ HTTPLocationBotClassGetParamsHTTPVersionHttPv3 HTTPLocationBotClassGetParamsHTTPVersion = "HTTPv3"
+)
+
+type HTTPLocationBotClassGetParamsIPVersion string
+
+const (
+ HTTPLocationBotClassGetParamsIPVersionIPv4 HTTPLocationBotClassGetParamsIPVersion = "IPv4"
+ HTTPLocationBotClassGetParamsIPVersionIPv6 HTTPLocationBotClassGetParamsIPVersion = "IPv6"
+)
+
+type HTTPLocationBotClassGetParamsOS string
+
+const (
+ HTTPLocationBotClassGetParamsOSWindows HTTPLocationBotClassGetParamsOS = "WINDOWS"
+ HTTPLocationBotClassGetParamsOSMacosx HTTPLocationBotClassGetParamsOS = "MACOSX"
+ HTTPLocationBotClassGetParamsOSIos HTTPLocationBotClassGetParamsOS = "IOS"
+ HTTPLocationBotClassGetParamsOSAndroid HTTPLocationBotClassGetParamsOS = "ANDROID"
+ HTTPLocationBotClassGetParamsOSChromeos HTTPLocationBotClassGetParamsOS = "CHROMEOS"
+ HTTPLocationBotClassGetParamsOSLinux HTTPLocationBotClassGetParamsOS = "LINUX"
+ HTTPLocationBotClassGetParamsOSSmartTv HTTPLocationBotClassGetParamsOS = "SMART_TV"
+)
+
+type HTTPLocationBotClassGetParamsTLSVersion string
+
+const (
+ HTTPLocationBotClassGetParamsTLSVersionTlSv1_0 HTTPLocationBotClassGetParamsTLSVersion = "TLSv1_0"
+ HTTPLocationBotClassGetParamsTLSVersionTlSv1_1 HTTPLocationBotClassGetParamsTLSVersion = "TLSv1_1"
+ HTTPLocationBotClassGetParamsTLSVersionTlSv1_2 HTTPLocationBotClassGetParamsTLSVersion = "TLSv1_2"
+ HTTPLocationBotClassGetParamsTLSVersionTlSv1_3 HTTPLocationBotClassGetParamsTLSVersion = "TLSv1_3"
+ HTTPLocationBotClassGetParamsTLSVersionTlSvQuic HTTPLocationBotClassGetParamsTLSVersion = "TLSvQUIC"
+)
+
+type HTTPLocationBotClassGetResponseEnvelope struct {
+ Result HTTPLocationBotClassGetResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON httpLocationBotClassGetResponseEnvelopeJSON `json:"-"`
+}
+
+// httpLocationBotClassGetResponseEnvelopeJSON contains the JSON metadata for the
+// struct [HTTPLocationBotClassGetResponseEnvelope]
+type httpLocationBotClassGetResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPLocationBotClassGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpLocationBotClassGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/radar/httplocationbotclass_test.go b/radar/httplocationbotclass_test.go
new file mode 100644
index 00000000000..d961f529e2f
--- /dev/null
+++ b/radar/httplocationbotclass_test.go
@@ -0,0 +1,60 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/radar"
+)
+
+func TestHTTPLocationBotClassGetWithOptionalParams(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"),
+ )
+ _, err := client.Radar.HTTP.Locations.BotClass.Get(
+ context.TODO(),
+ radar.HTTPLocationBotClassGetParamsBotClassLikelyAutomated,
+ radar.HTTPLocationBotClassGetParams{
+ 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([]radar.HTTPLocationBotClassGetParamsDateRange{radar.HTTPLocationBotClassGetParamsDateRange1d, radar.HTTPLocationBotClassGetParamsDateRange2d, radar.HTTPLocationBotClassGetParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DeviceType: cloudflare.F([]radar.HTTPLocationBotClassGetParamsDeviceType{radar.HTTPLocationBotClassGetParamsDeviceTypeDesktop, radar.HTTPLocationBotClassGetParamsDeviceTypeMobile, radar.HTTPLocationBotClassGetParamsDeviceTypeOther}),
+ Format: cloudflare.F(radar.HTTPLocationBotClassGetParamsFormatJson),
+ HTTPProtocol: cloudflare.F([]radar.HTTPLocationBotClassGetParamsHTTPProtocol{radar.HTTPLocationBotClassGetParamsHTTPProtocolHTTP, radar.HTTPLocationBotClassGetParamsHTTPProtocolHTTPS}),
+ HTTPVersion: cloudflare.F([]radar.HTTPLocationBotClassGetParamsHTTPVersion{radar.HTTPLocationBotClassGetParamsHTTPVersionHttPv1, radar.HTTPLocationBotClassGetParamsHTTPVersionHttPv2, radar.HTTPLocationBotClassGetParamsHTTPVersionHttPv3}),
+ IPVersion: cloudflare.F([]radar.HTTPLocationBotClassGetParamsIPVersion{radar.HTTPLocationBotClassGetParamsIPVersionIPv4, radar.HTTPLocationBotClassGetParamsIPVersionIPv6}),
+ Limit: cloudflare.F(int64(5)),
+ Location: cloudflare.F([]string{"string", "string", "string"}),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ OS: cloudflare.F([]radar.HTTPLocationBotClassGetParamsOS{radar.HTTPLocationBotClassGetParamsOSWindows, radar.HTTPLocationBotClassGetParamsOSMacosx, radar.HTTPLocationBotClassGetParamsOSIos}),
+ TLSVersion: cloudflare.F([]radar.HTTPLocationBotClassGetParamsTLSVersion{radar.HTTPLocationBotClassGetParamsTLSVersionTlSv1_0, radar.HTTPLocationBotClassGetParamsTLSVersionTlSv1_1, radar.HTTPLocationBotClassGetParamsTLSVersionTlSv1_2}),
+ },
+ )
+ 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/radar/httplocationdevicetype.go b/radar/httplocationdevicetype.go
new file mode 100644
index 00000000000..f3c410c10f3
--- /dev/null
+++ b/radar/httplocationdevicetype.go
@@ -0,0 +1,366 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// HTTPLocationDeviceTypeService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewHTTPLocationDeviceTypeService]
+// method instead.
+type HTTPLocationDeviceTypeService struct {
+ Options []option.RequestOption
+}
+
+// NewHTTPLocationDeviceTypeService generates a new service that applies the given
+// options to each request. These options are applied after the parent client's
+// options (if there is one), and before any request-specific options.
+func NewHTTPLocationDeviceTypeService(opts ...option.RequestOption) (r *HTTPLocationDeviceTypeService) {
+ r = &HTTPLocationDeviceTypeService{}
+ r.Options = opts
+ return
+}
+
+// Get the top locations, by HTTP traffic, of the requested device type. Values are
+// a percentage out of the total traffic.
+func (r *HTTPLocationDeviceTypeService) Get(ctx context.Context, deviceType HTTPLocationDeviceTypeGetParamsDeviceType, query HTTPLocationDeviceTypeGetParams, opts ...option.RequestOption) (res *HTTPLocationDeviceTypeGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env HTTPLocationDeviceTypeGetResponseEnvelope
+ path := fmt.Sprintf("radar/http/top/locations/device_type/%v", deviceType)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type HTTPLocationDeviceTypeGetResponse struct {
+ Meta HTTPLocationDeviceTypeGetResponseMeta `json:"meta,required"`
+ Top0 []HTTPLocationDeviceTypeGetResponseTop0 `json:"top_0,required"`
+ JSON httpLocationDeviceTypeGetResponseJSON `json:"-"`
+}
+
+// httpLocationDeviceTypeGetResponseJSON contains the JSON metadata for the struct
+// [HTTPLocationDeviceTypeGetResponse]
+type httpLocationDeviceTypeGetResponseJSON struct {
+ Meta apijson.Field
+ Top0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPLocationDeviceTypeGetResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpLocationDeviceTypeGetResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPLocationDeviceTypeGetResponseMeta struct {
+ DateRange []HTTPLocationDeviceTypeGetResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ ConfidenceInfo HTTPLocationDeviceTypeGetResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON httpLocationDeviceTypeGetResponseMetaJSON `json:"-"`
+}
+
+// httpLocationDeviceTypeGetResponseMetaJSON contains the JSON metadata for the
+// struct [HTTPLocationDeviceTypeGetResponseMeta]
+type httpLocationDeviceTypeGetResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPLocationDeviceTypeGetResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpLocationDeviceTypeGetResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPLocationDeviceTypeGetResponseMetaDateRange 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 httpLocationDeviceTypeGetResponseMetaDateRangeJSON `json:"-"`
+}
+
+// httpLocationDeviceTypeGetResponseMetaDateRangeJSON contains the JSON metadata
+// for the struct [HTTPLocationDeviceTypeGetResponseMetaDateRange]
+type httpLocationDeviceTypeGetResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPLocationDeviceTypeGetResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpLocationDeviceTypeGetResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPLocationDeviceTypeGetResponseMetaConfidenceInfo struct {
+ Annotations []HTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON httpLocationDeviceTypeGetResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// httpLocationDeviceTypeGetResponseMetaConfidenceInfoJSON contains the JSON
+// metadata for the struct [HTTPLocationDeviceTypeGetResponseMetaConfidenceInfo]
+type httpLocationDeviceTypeGetResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPLocationDeviceTypeGetResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpLocationDeviceTypeGetResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotation 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 httpLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// httpLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotationJSON contains the
+// JSON metadata for the struct
+// [HTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotation]
+type httpLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotationJSON 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 *HTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPLocationDeviceTypeGetResponseTop0 struct {
+ ClientCountryAlpha2 string `json:"clientCountryAlpha2,required"`
+ ClientCountryName string `json:"clientCountryName,required"`
+ Value string `json:"value,required"`
+ JSON httpLocationDeviceTypeGetResponseTop0JSON `json:"-"`
+}
+
+// httpLocationDeviceTypeGetResponseTop0JSON contains the JSON metadata for the
+// struct [HTTPLocationDeviceTypeGetResponseTop0]
+type httpLocationDeviceTypeGetResponseTop0JSON struct {
+ ClientCountryAlpha2 apijson.Field
+ ClientCountryName apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPLocationDeviceTypeGetResponseTop0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpLocationDeviceTypeGetResponseTop0JSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPLocationDeviceTypeGetParams 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"`
+ // Filter for bot class. Refer to
+ // [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/).
+ BotClass param.Field[[]HTTPLocationDeviceTypeGetParamsBotClass] `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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]HTTPLocationDeviceTypeGetParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Format results are returned in.
+ Format param.Field[HTTPLocationDeviceTypeGetParamsFormat] `query:"format"`
+ // Filter for http protocol.
+ HTTPProtocol param.Field[[]HTTPLocationDeviceTypeGetParamsHTTPProtocol] `query:"httpProtocol"`
+ // Filter for http version.
+ HTTPVersion param.Field[[]HTTPLocationDeviceTypeGetParamsHTTPVersion] `query:"httpVersion"`
+ // Filter for ip version.
+ IPVersion param.Field[[]HTTPLocationDeviceTypeGetParamsIPVersion] `query:"ipVersion"`
+ // 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 os name.
+ OS param.Field[[]HTTPLocationDeviceTypeGetParamsOS] `query:"os"`
+ // Filter for tls version.
+ TLSVersion param.Field[[]HTTPLocationDeviceTypeGetParamsTLSVersion] `query:"tlsVersion"`
+}
+
+// URLQuery serializes [HTTPLocationDeviceTypeGetParams]'s query parameters as
+// `url.Values`.
+func (r HTTPLocationDeviceTypeGetParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Device type.
+type HTTPLocationDeviceTypeGetParamsDeviceType string
+
+const (
+ HTTPLocationDeviceTypeGetParamsDeviceTypeDesktop HTTPLocationDeviceTypeGetParamsDeviceType = "DESKTOP"
+ HTTPLocationDeviceTypeGetParamsDeviceTypeMobile HTTPLocationDeviceTypeGetParamsDeviceType = "MOBILE"
+ HTTPLocationDeviceTypeGetParamsDeviceTypeOther HTTPLocationDeviceTypeGetParamsDeviceType = "OTHER"
+)
+
+type HTTPLocationDeviceTypeGetParamsBotClass string
+
+const (
+ HTTPLocationDeviceTypeGetParamsBotClassLikelyAutomated HTTPLocationDeviceTypeGetParamsBotClass = "LIKELY_AUTOMATED"
+ HTTPLocationDeviceTypeGetParamsBotClassLikelyHuman HTTPLocationDeviceTypeGetParamsBotClass = "LIKELY_HUMAN"
+)
+
+type HTTPLocationDeviceTypeGetParamsDateRange string
+
+const (
+ HTTPLocationDeviceTypeGetParamsDateRange1d HTTPLocationDeviceTypeGetParamsDateRange = "1d"
+ HTTPLocationDeviceTypeGetParamsDateRange2d HTTPLocationDeviceTypeGetParamsDateRange = "2d"
+ HTTPLocationDeviceTypeGetParamsDateRange7d HTTPLocationDeviceTypeGetParamsDateRange = "7d"
+ HTTPLocationDeviceTypeGetParamsDateRange14d HTTPLocationDeviceTypeGetParamsDateRange = "14d"
+ HTTPLocationDeviceTypeGetParamsDateRange28d HTTPLocationDeviceTypeGetParamsDateRange = "28d"
+ HTTPLocationDeviceTypeGetParamsDateRange12w HTTPLocationDeviceTypeGetParamsDateRange = "12w"
+ HTTPLocationDeviceTypeGetParamsDateRange24w HTTPLocationDeviceTypeGetParamsDateRange = "24w"
+ HTTPLocationDeviceTypeGetParamsDateRange52w HTTPLocationDeviceTypeGetParamsDateRange = "52w"
+ HTTPLocationDeviceTypeGetParamsDateRange1dControl HTTPLocationDeviceTypeGetParamsDateRange = "1dControl"
+ HTTPLocationDeviceTypeGetParamsDateRange2dControl HTTPLocationDeviceTypeGetParamsDateRange = "2dControl"
+ HTTPLocationDeviceTypeGetParamsDateRange7dControl HTTPLocationDeviceTypeGetParamsDateRange = "7dControl"
+ HTTPLocationDeviceTypeGetParamsDateRange14dControl HTTPLocationDeviceTypeGetParamsDateRange = "14dControl"
+ HTTPLocationDeviceTypeGetParamsDateRange28dControl HTTPLocationDeviceTypeGetParamsDateRange = "28dControl"
+ HTTPLocationDeviceTypeGetParamsDateRange12wControl HTTPLocationDeviceTypeGetParamsDateRange = "12wControl"
+ HTTPLocationDeviceTypeGetParamsDateRange24wControl HTTPLocationDeviceTypeGetParamsDateRange = "24wControl"
+)
+
+// Format results are returned in.
+type HTTPLocationDeviceTypeGetParamsFormat string
+
+const (
+ HTTPLocationDeviceTypeGetParamsFormatJson HTTPLocationDeviceTypeGetParamsFormat = "JSON"
+ HTTPLocationDeviceTypeGetParamsFormatCsv HTTPLocationDeviceTypeGetParamsFormat = "CSV"
+)
+
+type HTTPLocationDeviceTypeGetParamsHTTPProtocol string
+
+const (
+ HTTPLocationDeviceTypeGetParamsHTTPProtocolHTTP HTTPLocationDeviceTypeGetParamsHTTPProtocol = "HTTP"
+ HTTPLocationDeviceTypeGetParamsHTTPProtocolHTTPS HTTPLocationDeviceTypeGetParamsHTTPProtocol = "HTTPS"
+)
+
+type HTTPLocationDeviceTypeGetParamsHTTPVersion string
+
+const (
+ HTTPLocationDeviceTypeGetParamsHTTPVersionHttPv1 HTTPLocationDeviceTypeGetParamsHTTPVersion = "HTTPv1"
+ HTTPLocationDeviceTypeGetParamsHTTPVersionHttPv2 HTTPLocationDeviceTypeGetParamsHTTPVersion = "HTTPv2"
+ HTTPLocationDeviceTypeGetParamsHTTPVersionHttPv3 HTTPLocationDeviceTypeGetParamsHTTPVersion = "HTTPv3"
+)
+
+type HTTPLocationDeviceTypeGetParamsIPVersion string
+
+const (
+ HTTPLocationDeviceTypeGetParamsIPVersionIPv4 HTTPLocationDeviceTypeGetParamsIPVersion = "IPv4"
+ HTTPLocationDeviceTypeGetParamsIPVersionIPv6 HTTPLocationDeviceTypeGetParamsIPVersion = "IPv6"
+)
+
+type HTTPLocationDeviceTypeGetParamsOS string
+
+const (
+ HTTPLocationDeviceTypeGetParamsOSWindows HTTPLocationDeviceTypeGetParamsOS = "WINDOWS"
+ HTTPLocationDeviceTypeGetParamsOSMacosx HTTPLocationDeviceTypeGetParamsOS = "MACOSX"
+ HTTPLocationDeviceTypeGetParamsOSIos HTTPLocationDeviceTypeGetParamsOS = "IOS"
+ HTTPLocationDeviceTypeGetParamsOSAndroid HTTPLocationDeviceTypeGetParamsOS = "ANDROID"
+ HTTPLocationDeviceTypeGetParamsOSChromeos HTTPLocationDeviceTypeGetParamsOS = "CHROMEOS"
+ HTTPLocationDeviceTypeGetParamsOSLinux HTTPLocationDeviceTypeGetParamsOS = "LINUX"
+ HTTPLocationDeviceTypeGetParamsOSSmartTv HTTPLocationDeviceTypeGetParamsOS = "SMART_TV"
+)
+
+type HTTPLocationDeviceTypeGetParamsTLSVersion string
+
+const (
+ HTTPLocationDeviceTypeGetParamsTLSVersionTlSv1_0 HTTPLocationDeviceTypeGetParamsTLSVersion = "TLSv1_0"
+ HTTPLocationDeviceTypeGetParamsTLSVersionTlSv1_1 HTTPLocationDeviceTypeGetParamsTLSVersion = "TLSv1_1"
+ HTTPLocationDeviceTypeGetParamsTLSVersionTlSv1_2 HTTPLocationDeviceTypeGetParamsTLSVersion = "TLSv1_2"
+ HTTPLocationDeviceTypeGetParamsTLSVersionTlSv1_3 HTTPLocationDeviceTypeGetParamsTLSVersion = "TLSv1_3"
+ HTTPLocationDeviceTypeGetParamsTLSVersionTlSvQuic HTTPLocationDeviceTypeGetParamsTLSVersion = "TLSvQUIC"
+)
+
+type HTTPLocationDeviceTypeGetResponseEnvelope struct {
+ Result HTTPLocationDeviceTypeGetResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON httpLocationDeviceTypeGetResponseEnvelopeJSON `json:"-"`
+}
+
+// httpLocationDeviceTypeGetResponseEnvelopeJSON contains the JSON metadata for the
+// struct [HTTPLocationDeviceTypeGetResponseEnvelope]
+type httpLocationDeviceTypeGetResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPLocationDeviceTypeGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpLocationDeviceTypeGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/radar/httplocationdevicetype_test.go b/radar/httplocationdevicetype_test.go
new file mode 100644
index 00000000000..77289a629de
--- /dev/null
+++ b/radar/httplocationdevicetype_test.go
@@ -0,0 +1,60 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/radar"
+)
+
+func TestHTTPLocationDeviceTypeGetWithOptionalParams(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"),
+ )
+ _, err := client.Radar.HTTP.Locations.DeviceType.Get(
+ context.TODO(),
+ radar.HTTPLocationDeviceTypeGetParamsDeviceTypeDesktop,
+ radar.HTTPLocationDeviceTypeGetParams{
+ ASN: cloudflare.F([]string{"string", "string", "string"}),
+ BotClass: cloudflare.F([]radar.HTTPLocationDeviceTypeGetParamsBotClass{radar.HTTPLocationDeviceTypeGetParamsBotClassLikelyAutomated, radar.HTTPLocationDeviceTypeGetParamsBotClassLikelyHuman}),
+ Continent: cloudflare.F([]string{"string", "string", "string"}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.HTTPLocationDeviceTypeGetParamsDateRange{radar.HTTPLocationDeviceTypeGetParamsDateRange1d, radar.HTTPLocationDeviceTypeGetParamsDateRange2d, radar.HTTPLocationDeviceTypeGetParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Format: cloudflare.F(radar.HTTPLocationDeviceTypeGetParamsFormatJson),
+ HTTPProtocol: cloudflare.F([]radar.HTTPLocationDeviceTypeGetParamsHTTPProtocol{radar.HTTPLocationDeviceTypeGetParamsHTTPProtocolHTTP, radar.HTTPLocationDeviceTypeGetParamsHTTPProtocolHTTPS}),
+ HTTPVersion: cloudflare.F([]radar.HTTPLocationDeviceTypeGetParamsHTTPVersion{radar.HTTPLocationDeviceTypeGetParamsHTTPVersionHttPv1, radar.HTTPLocationDeviceTypeGetParamsHTTPVersionHttPv2, radar.HTTPLocationDeviceTypeGetParamsHTTPVersionHttPv3}),
+ IPVersion: cloudflare.F([]radar.HTTPLocationDeviceTypeGetParamsIPVersion{radar.HTTPLocationDeviceTypeGetParamsIPVersionIPv4, radar.HTTPLocationDeviceTypeGetParamsIPVersionIPv6}),
+ Limit: cloudflare.F(int64(5)),
+ Location: cloudflare.F([]string{"string", "string", "string"}),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ OS: cloudflare.F([]radar.HTTPLocationDeviceTypeGetParamsOS{radar.HTTPLocationDeviceTypeGetParamsOSWindows, radar.HTTPLocationDeviceTypeGetParamsOSMacosx, radar.HTTPLocationDeviceTypeGetParamsOSIos}),
+ TLSVersion: cloudflare.F([]radar.HTTPLocationDeviceTypeGetParamsTLSVersion{radar.HTTPLocationDeviceTypeGetParamsTLSVersionTlSv1_0, radar.HTTPLocationDeviceTypeGetParamsTLSVersionTlSv1_1, radar.HTTPLocationDeviceTypeGetParamsTLSVersionTlSv1_2}),
+ },
+ )
+ 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/radar/httplocationhttpmethod.go b/radar/httplocationhttpmethod.go
new file mode 100644
index 00000000000..c15c739d246
--- /dev/null
+++ b/radar/httplocationhttpmethod.go
@@ -0,0 +1,366 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// HTTPLocationHTTPMethodService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewHTTPLocationHTTPMethodService]
+// method instead.
+type HTTPLocationHTTPMethodService struct {
+ Options []option.RequestOption
+}
+
+// NewHTTPLocationHTTPMethodService generates a new service that applies the given
+// options to each request. These options are applied after the parent client's
+// options (if there is one), and before any request-specific options.
+func NewHTTPLocationHTTPMethodService(opts ...option.RequestOption) (r *HTTPLocationHTTPMethodService) {
+ r = &HTTPLocationHTTPMethodService{}
+ r.Options = opts
+ return
+}
+
+// Get the top locations, by HTTP traffic, of the requested HTTP protocol. Values
+// are a percentage out of the total traffic.
+func (r *HTTPLocationHTTPMethodService) Get(ctx context.Context, httpVersion HTTPLocationHTTPMethodGetParamsHTTPVersion, query HTTPLocationHTTPMethodGetParams, opts ...option.RequestOption) (res *HTTPLocationHTTPMethodGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env HTTPLocationHTTPMethodGetResponseEnvelope
+ path := fmt.Sprintf("radar/http/top/locations/http_version/%v", httpVersion)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type HTTPLocationHTTPMethodGetResponse struct {
+ Meta HTTPLocationHTTPMethodGetResponseMeta `json:"meta,required"`
+ Top0 []HTTPLocationHTTPMethodGetResponseTop0 `json:"top_0,required"`
+ JSON httpLocationHTTPMethodGetResponseJSON `json:"-"`
+}
+
+// httpLocationHTTPMethodGetResponseJSON contains the JSON metadata for the struct
+// [HTTPLocationHTTPMethodGetResponse]
+type httpLocationHTTPMethodGetResponseJSON struct {
+ Meta apijson.Field
+ Top0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPLocationHTTPMethodGetResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpLocationHTTPMethodGetResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPLocationHTTPMethodGetResponseMeta struct {
+ DateRange []HTTPLocationHTTPMethodGetResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ ConfidenceInfo HTTPLocationHTTPMethodGetResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON httpLocationHTTPMethodGetResponseMetaJSON `json:"-"`
+}
+
+// httpLocationHTTPMethodGetResponseMetaJSON contains the JSON metadata for the
+// struct [HTTPLocationHTTPMethodGetResponseMeta]
+type httpLocationHTTPMethodGetResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPLocationHTTPMethodGetResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpLocationHTTPMethodGetResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPLocationHTTPMethodGetResponseMetaDateRange 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 httpLocationHTTPMethodGetResponseMetaDateRangeJSON `json:"-"`
+}
+
+// httpLocationHTTPMethodGetResponseMetaDateRangeJSON contains the JSON metadata
+// for the struct [HTTPLocationHTTPMethodGetResponseMetaDateRange]
+type httpLocationHTTPMethodGetResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPLocationHTTPMethodGetResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpLocationHTTPMethodGetResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPLocationHTTPMethodGetResponseMetaConfidenceInfo struct {
+ Annotations []HTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON httpLocationHTTPMethodGetResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// httpLocationHTTPMethodGetResponseMetaConfidenceInfoJSON contains the JSON
+// metadata for the struct [HTTPLocationHTTPMethodGetResponseMetaConfidenceInfo]
+type httpLocationHTTPMethodGetResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPLocationHTTPMethodGetResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpLocationHTTPMethodGetResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotation 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 httpLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// httpLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotationJSON contains the
+// JSON metadata for the struct
+// [HTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotation]
+type httpLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotationJSON 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 *HTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPLocationHTTPMethodGetResponseTop0 struct {
+ ClientCountryAlpha2 string `json:"clientCountryAlpha2,required"`
+ ClientCountryName string `json:"clientCountryName,required"`
+ Value string `json:"value,required"`
+ JSON httpLocationHTTPMethodGetResponseTop0JSON `json:"-"`
+}
+
+// httpLocationHTTPMethodGetResponseTop0JSON contains the JSON metadata for the
+// struct [HTTPLocationHTTPMethodGetResponseTop0]
+type httpLocationHTTPMethodGetResponseTop0JSON struct {
+ ClientCountryAlpha2 apijson.Field
+ ClientCountryName apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPLocationHTTPMethodGetResponseTop0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpLocationHTTPMethodGetResponseTop0JSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPLocationHTTPMethodGetParams 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"`
+ // Filter for bot class. Refer to
+ // [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/).
+ BotClass param.Field[[]HTTPLocationHTTPMethodGetParamsBotClass] `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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]HTTPLocationHTTPMethodGetParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Filter for device type.
+ DeviceType param.Field[[]HTTPLocationHTTPMethodGetParamsDeviceType] `query:"deviceType"`
+ // Format results are returned in.
+ Format param.Field[HTTPLocationHTTPMethodGetParamsFormat] `query:"format"`
+ // Filter for http protocol.
+ HTTPProtocol param.Field[[]HTTPLocationHTTPMethodGetParamsHTTPProtocol] `query:"httpProtocol"`
+ // Filter for ip version.
+ IPVersion param.Field[[]HTTPLocationHTTPMethodGetParamsIPVersion] `query:"ipVersion"`
+ // 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 os name.
+ OS param.Field[[]HTTPLocationHTTPMethodGetParamsOS] `query:"os"`
+ // Filter for tls version.
+ TLSVersion param.Field[[]HTTPLocationHTTPMethodGetParamsTLSVersion] `query:"tlsVersion"`
+}
+
+// URLQuery serializes [HTTPLocationHTTPMethodGetParams]'s query parameters as
+// `url.Values`.
+func (r HTTPLocationHTTPMethodGetParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// HTTP version.
+type HTTPLocationHTTPMethodGetParamsHTTPVersion string
+
+const (
+ HTTPLocationHTTPMethodGetParamsHTTPVersionHttPv1 HTTPLocationHTTPMethodGetParamsHTTPVersion = "HTTPv1"
+ HTTPLocationHTTPMethodGetParamsHTTPVersionHttPv2 HTTPLocationHTTPMethodGetParamsHTTPVersion = "HTTPv2"
+ HTTPLocationHTTPMethodGetParamsHTTPVersionHttPv3 HTTPLocationHTTPMethodGetParamsHTTPVersion = "HTTPv3"
+)
+
+type HTTPLocationHTTPMethodGetParamsBotClass string
+
+const (
+ HTTPLocationHTTPMethodGetParamsBotClassLikelyAutomated HTTPLocationHTTPMethodGetParamsBotClass = "LIKELY_AUTOMATED"
+ HTTPLocationHTTPMethodGetParamsBotClassLikelyHuman HTTPLocationHTTPMethodGetParamsBotClass = "LIKELY_HUMAN"
+)
+
+type HTTPLocationHTTPMethodGetParamsDateRange string
+
+const (
+ HTTPLocationHTTPMethodGetParamsDateRange1d HTTPLocationHTTPMethodGetParamsDateRange = "1d"
+ HTTPLocationHTTPMethodGetParamsDateRange2d HTTPLocationHTTPMethodGetParamsDateRange = "2d"
+ HTTPLocationHTTPMethodGetParamsDateRange7d HTTPLocationHTTPMethodGetParamsDateRange = "7d"
+ HTTPLocationHTTPMethodGetParamsDateRange14d HTTPLocationHTTPMethodGetParamsDateRange = "14d"
+ HTTPLocationHTTPMethodGetParamsDateRange28d HTTPLocationHTTPMethodGetParamsDateRange = "28d"
+ HTTPLocationHTTPMethodGetParamsDateRange12w HTTPLocationHTTPMethodGetParamsDateRange = "12w"
+ HTTPLocationHTTPMethodGetParamsDateRange24w HTTPLocationHTTPMethodGetParamsDateRange = "24w"
+ HTTPLocationHTTPMethodGetParamsDateRange52w HTTPLocationHTTPMethodGetParamsDateRange = "52w"
+ HTTPLocationHTTPMethodGetParamsDateRange1dControl HTTPLocationHTTPMethodGetParamsDateRange = "1dControl"
+ HTTPLocationHTTPMethodGetParamsDateRange2dControl HTTPLocationHTTPMethodGetParamsDateRange = "2dControl"
+ HTTPLocationHTTPMethodGetParamsDateRange7dControl HTTPLocationHTTPMethodGetParamsDateRange = "7dControl"
+ HTTPLocationHTTPMethodGetParamsDateRange14dControl HTTPLocationHTTPMethodGetParamsDateRange = "14dControl"
+ HTTPLocationHTTPMethodGetParamsDateRange28dControl HTTPLocationHTTPMethodGetParamsDateRange = "28dControl"
+ HTTPLocationHTTPMethodGetParamsDateRange12wControl HTTPLocationHTTPMethodGetParamsDateRange = "12wControl"
+ HTTPLocationHTTPMethodGetParamsDateRange24wControl HTTPLocationHTTPMethodGetParamsDateRange = "24wControl"
+)
+
+type HTTPLocationHTTPMethodGetParamsDeviceType string
+
+const (
+ HTTPLocationHTTPMethodGetParamsDeviceTypeDesktop HTTPLocationHTTPMethodGetParamsDeviceType = "DESKTOP"
+ HTTPLocationHTTPMethodGetParamsDeviceTypeMobile HTTPLocationHTTPMethodGetParamsDeviceType = "MOBILE"
+ HTTPLocationHTTPMethodGetParamsDeviceTypeOther HTTPLocationHTTPMethodGetParamsDeviceType = "OTHER"
+)
+
+// Format results are returned in.
+type HTTPLocationHTTPMethodGetParamsFormat string
+
+const (
+ HTTPLocationHTTPMethodGetParamsFormatJson HTTPLocationHTTPMethodGetParamsFormat = "JSON"
+ HTTPLocationHTTPMethodGetParamsFormatCsv HTTPLocationHTTPMethodGetParamsFormat = "CSV"
+)
+
+type HTTPLocationHTTPMethodGetParamsHTTPProtocol string
+
+const (
+ HTTPLocationHTTPMethodGetParamsHTTPProtocolHTTP HTTPLocationHTTPMethodGetParamsHTTPProtocol = "HTTP"
+ HTTPLocationHTTPMethodGetParamsHTTPProtocolHTTPS HTTPLocationHTTPMethodGetParamsHTTPProtocol = "HTTPS"
+)
+
+type HTTPLocationHTTPMethodGetParamsIPVersion string
+
+const (
+ HTTPLocationHTTPMethodGetParamsIPVersionIPv4 HTTPLocationHTTPMethodGetParamsIPVersion = "IPv4"
+ HTTPLocationHTTPMethodGetParamsIPVersionIPv6 HTTPLocationHTTPMethodGetParamsIPVersion = "IPv6"
+)
+
+type HTTPLocationHTTPMethodGetParamsOS string
+
+const (
+ HTTPLocationHTTPMethodGetParamsOSWindows HTTPLocationHTTPMethodGetParamsOS = "WINDOWS"
+ HTTPLocationHTTPMethodGetParamsOSMacosx HTTPLocationHTTPMethodGetParamsOS = "MACOSX"
+ HTTPLocationHTTPMethodGetParamsOSIos HTTPLocationHTTPMethodGetParamsOS = "IOS"
+ HTTPLocationHTTPMethodGetParamsOSAndroid HTTPLocationHTTPMethodGetParamsOS = "ANDROID"
+ HTTPLocationHTTPMethodGetParamsOSChromeos HTTPLocationHTTPMethodGetParamsOS = "CHROMEOS"
+ HTTPLocationHTTPMethodGetParamsOSLinux HTTPLocationHTTPMethodGetParamsOS = "LINUX"
+ HTTPLocationHTTPMethodGetParamsOSSmartTv HTTPLocationHTTPMethodGetParamsOS = "SMART_TV"
+)
+
+type HTTPLocationHTTPMethodGetParamsTLSVersion string
+
+const (
+ HTTPLocationHTTPMethodGetParamsTLSVersionTlSv1_0 HTTPLocationHTTPMethodGetParamsTLSVersion = "TLSv1_0"
+ HTTPLocationHTTPMethodGetParamsTLSVersionTlSv1_1 HTTPLocationHTTPMethodGetParamsTLSVersion = "TLSv1_1"
+ HTTPLocationHTTPMethodGetParamsTLSVersionTlSv1_2 HTTPLocationHTTPMethodGetParamsTLSVersion = "TLSv1_2"
+ HTTPLocationHTTPMethodGetParamsTLSVersionTlSv1_3 HTTPLocationHTTPMethodGetParamsTLSVersion = "TLSv1_3"
+ HTTPLocationHTTPMethodGetParamsTLSVersionTlSvQuic HTTPLocationHTTPMethodGetParamsTLSVersion = "TLSvQUIC"
+)
+
+type HTTPLocationHTTPMethodGetResponseEnvelope struct {
+ Result HTTPLocationHTTPMethodGetResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON httpLocationHTTPMethodGetResponseEnvelopeJSON `json:"-"`
+}
+
+// httpLocationHTTPMethodGetResponseEnvelopeJSON contains the JSON metadata for the
+// struct [HTTPLocationHTTPMethodGetResponseEnvelope]
+type httpLocationHTTPMethodGetResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPLocationHTTPMethodGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpLocationHTTPMethodGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/radar/httplocationhttpmethod_test.go b/radar/httplocationhttpmethod_test.go
new file mode 100644
index 00000000000..cda9ab05bef
--- /dev/null
+++ b/radar/httplocationhttpmethod_test.go
@@ -0,0 +1,60 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/radar"
+)
+
+func TestHTTPLocationHTTPMethodGetWithOptionalParams(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"),
+ )
+ _, err := client.Radar.HTTP.Locations.HTTPMethod.Get(
+ context.TODO(),
+ radar.HTTPLocationHTTPMethodGetParamsHTTPVersionHttPv1,
+ radar.HTTPLocationHTTPMethodGetParams{
+ ASN: cloudflare.F([]string{"string", "string", "string"}),
+ BotClass: cloudflare.F([]radar.HTTPLocationHTTPMethodGetParamsBotClass{radar.HTTPLocationHTTPMethodGetParamsBotClassLikelyAutomated, radar.HTTPLocationHTTPMethodGetParamsBotClassLikelyHuman}),
+ Continent: cloudflare.F([]string{"string", "string", "string"}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.HTTPLocationHTTPMethodGetParamsDateRange{radar.HTTPLocationHTTPMethodGetParamsDateRange1d, radar.HTTPLocationHTTPMethodGetParamsDateRange2d, radar.HTTPLocationHTTPMethodGetParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DeviceType: cloudflare.F([]radar.HTTPLocationHTTPMethodGetParamsDeviceType{radar.HTTPLocationHTTPMethodGetParamsDeviceTypeDesktop, radar.HTTPLocationHTTPMethodGetParamsDeviceTypeMobile, radar.HTTPLocationHTTPMethodGetParamsDeviceTypeOther}),
+ Format: cloudflare.F(radar.HTTPLocationHTTPMethodGetParamsFormatJson),
+ HTTPProtocol: cloudflare.F([]radar.HTTPLocationHTTPMethodGetParamsHTTPProtocol{radar.HTTPLocationHTTPMethodGetParamsHTTPProtocolHTTP, radar.HTTPLocationHTTPMethodGetParamsHTTPProtocolHTTPS}),
+ IPVersion: cloudflare.F([]radar.HTTPLocationHTTPMethodGetParamsIPVersion{radar.HTTPLocationHTTPMethodGetParamsIPVersionIPv4, radar.HTTPLocationHTTPMethodGetParamsIPVersionIPv6}),
+ Limit: cloudflare.F(int64(5)),
+ Location: cloudflare.F([]string{"string", "string", "string"}),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ OS: cloudflare.F([]radar.HTTPLocationHTTPMethodGetParamsOS{radar.HTTPLocationHTTPMethodGetParamsOSWindows, radar.HTTPLocationHTTPMethodGetParamsOSMacosx, radar.HTTPLocationHTTPMethodGetParamsOSIos}),
+ TLSVersion: cloudflare.F([]radar.HTTPLocationHTTPMethodGetParamsTLSVersion{radar.HTTPLocationHTTPMethodGetParamsTLSVersionTlSv1_0, radar.HTTPLocationHTTPMethodGetParamsTLSVersionTlSv1_1, radar.HTTPLocationHTTPMethodGetParamsTLSVersionTlSv1_2}),
+ },
+ )
+ 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/radar/httplocationhttpprotocol.go b/radar/httplocationhttpprotocol.go
new file mode 100644
index 00000000000..b6bf46dc843
--- /dev/null
+++ b/radar/httplocationhttpprotocol.go
@@ -0,0 +1,356 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// HTTPLocationHTTPProtocolService contains methods and other services that help
+// with interacting with the cloudflare API. Note, unlike clients, this service
+// does not read variables from the environment automatically. You should not
+// instantiate this service directly, and instead use the
+// [NewHTTPLocationHTTPProtocolService] method instead.
+type HTTPLocationHTTPProtocolService struct {
+ Options []option.RequestOption
+}
+
+// NewHTTPLocationHTTPProtocolService generates a new service that applies the
+// given options to each request. These options are applied after the parent
+// client's options (if there is one), and before any request-specific options.
+func NewHTTPLocationHTTPProtocolService(opts ...option.RequestOption) (r *HTTPLocationHTTPProtocolService) {
+ r = &HTTPLocationHTTPProtocolService{}
+ r.Options = opts
+ return
+}
+
+// Get the top locations, by HTTP traffic, of the requested HTTP protocol. Values
+// are a percentage out of the total traffic.
+func (r *HTTPLocationHTTPProtocolService) Get(ctx context.Context, httpProtocol HTTPLocationHTTPProtocolGetParamsHTTPProtocol, query HTTPLocationHTTPProtocolGetParams, opts ...option.RequestOption) (res *HTTPLocationHTTPProtocolGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env HTTPLocationHTTPProtocolGetResponseEnvelope
+ path := fmt.Sprintf("radar/http/top/locations/http_protocol/%v", httpProtocol)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type HTTPLocationHTTPProtocolGetResponse struct {
+ Meta HTTPLocationHTTPProtocolGetResponseMeta `json:"meta,required"`
+ Top0 []HTTPLocationHTTPProtocolGetResponseTop0 `json:"top_0,required"`
+ JSON httpLocationHTTPProtocolGetResponseJSON `json:"-"`
+}
+
+// httpLocationHTTPProtocolGetResponseJSON contains the JSON metadata for the
+// struct [HTTPLocationHTTPProtocolGetResponse]
+type httpLocationHTTPProtocolGetResponseJSON struct {
+ Meta apijson.Field
+ Top0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPLocationHTTPProtocolGetResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpLocationHTTPProtocolGetResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPLocationHTTPProtocolGetResponseMeta struct {
+ DateRange []HTTPLocationHTTPProtocolGetResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ ConfidenceInfo HTTPLocationHTTPProtocolGetResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON httpLocationHTTPProtocolGetResponseMetaJSON `json:"-"`
+}
+
+// httpLocationHTTPProtocolGetResponseMetaJSON contains the JSON metadata for the
+// struct [HTTPLocationHTTPProtocolGetResponseMeta]
+type httpLocationHTTPProtocolGetResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPLocationHTTPProtocolGetResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpLocationHTTPProtocolGetResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPLocationHTTPProtocolGetResponseMetaDateRange 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 httpLocationHTTPProtocolGetResponseMetaDateRangeJSON `json:"-"`
+}
+
+// httpLocationHTTPProtocolGetResponseMetaDateRangeJSON contains the JSON metadata
+// for the struct [HTTPLocationHTTPProtocolGetResponseMetaDateRange]
+type httpLocationHTTPProtocolGetResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPLocationHTTPProtocolGetResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpLocationHTTPProtocolGetResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPLocationHTTPProtocolGetResponseMetaConfidenceInfo struct {
+ Annotations []HTTPLocationHTTPProtocolGetResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON httpLocationHTTPProtocolGetResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// httpLocationHTTPProtocolGetResponseMetaConfidenceInfoJSON contains the JSON
+// metadata for the struct [HTTPLocationHTTPProtocolGetResponseMetaConfidenceInfo]
+type httpLocationHTTPProtocolGetResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPLocationHTTPProtocolGetResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpLocationHTTPProtocolGetResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPLocationHTTPProtocolGetResponseMetaConfidenceInfoAnnotation 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 httpLocationHTTPProtocolGetResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// httpLocationHTTPProtocolGetResponseMetaConfidenceInfoAnnotationJSON contains the
+// JSON metadata for the struct
+// [HTTPLocationHTTPProtocolGetResponseMetaConfidenceInfoAnnotation]
+type httpLocationHTTPProtocolGetResponseMetaConfidenceInfoAnnotationJSON 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 *HTTPLocationHTTPProtocolGetResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpLocationHTTPProtocolGetResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPLocationHTTPProtocolGetResponseTop0 struct {
+ ClientCountryAlpha2 string `json:"clientCountryAlpha2,required"`
+ ClientCountryName string `json:"clientCountryName,required"`
+ Value string `json:"value,required"`
+ JSON httpLocationHTTPProtocolGetResponseTop0JSON `json:"-"`
+}
+
+// httpLocationHTTPProtocolGetResponseTop0JSON contains the JSON metadata for the
+// struct [HTTPLocationHTTPProtocolGetResponseTop0]
+type httpLocationHTTPProtocolGetResponseTop0JSON struct {
+ ClientCountryAlpha2 apijson.Field
+ ClientCountryName apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPLocationHTTPProtocolGetResponseTop0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpLocationHTTPProtocolGetResponseTop0JSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPLocationHTTPProtocolGetParams 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"`
+ // Filter for bot class. Refer to
+ // [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/).
+ BotClass param.Field[[]HTTPLocationHTTPProtocolGetParamsBotClass] `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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]HTTPLocationHTTPProtocolGetParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Filter for device type.
+ DeviceType param.Field[[]HTTPLocationHTTPProtocolGetParamsDeviceType] `query:"deviceType"`
+ // Format results are returned in.
+ Format param.Field[HTTPLocationHTTPProtocolGetParamsFormat] `query:"format"`
+ // Filter for ip version.
+ IPVersion param.Field[[]HTTPLocationHTTPProtocolGetParamsIPVersion] `query:"ipVersion"`
+ // 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 os name.
+ OS param.Field[[]HTTPLocationHTTPProtocolGetParamsOS] `query:"os"`
+ // Filter for tls version.
+ TLSVersion param.Field[[]HTTPLocationHTTPProtocolGetParamsTLSVersion] `query:"tlsVersion"`
+}
+
+// URLQuery serializes [HTTPLocationHTTPProtocolGetParams]'s query parameters as
+// `url.Values`.
+func (r HTTPLocationHTTPProtocolGetParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// HTTP Protocol.
+type HTTPLocationHTTPProtocolGetParamsHTTPProtocol string
+
+const (
+ HTTPLocationHTTPProtocolGetParamsHTTPProtocolHTTP HTTPLocationHTTPProtocolGetParamsHTTPProtocol = "HTTP"
+ HTTPLocationHTTPProtocolGetParamsHTTPProtocolHTTPS HTTPLocationHTTPProtocolGetParamsHTTPProtocol = "HTTPS"
+)
+
+type HTTPLocationHTTPProtocolGetParamsBotClass string
+
+const (
+ HTTPLocationHTTPProtocolGetParamsBotClassLikelyAutomated HTTPLocationHTTPProtocolGetParamsBotClass = "LIKELY_AUTOMATED"
+ HTTPLocationHTTPProtocolGetParamsBotClassLikelyHuman HTTPLocationHTTPProtocolGetParamsBotClass = "LIKELY_HUMAN"
+)
+
+type HTTPLocationHTTPProtocolGetParamsDateRange string
+
+const (
+ HTTPLocationHTTPProtocolGetParamsDateRange1d HTTPLocationHTTPProtocolGetParamsDateRange = "1d"
+ HTTPLocationHTTPProtocolGetParamsDateRange2d HTTPLocationHTTPProtocolGetParamsDateRange = "2d"
+ HTTPLocationHTTPProtocolGetParamsDateRange7d HTTPLocationHTTPProtocolGetParamsDateRange = "7d"
+ HTTPLocationHTTPProtocolGetParamsDateRange14d HTTPLocationHTTPProtocolGetParamsDateRange = "14d"
+ HTTPLocationHTTPProtocolGetParamsDateRange28d HTTPLocationHTTPProtocolGetParamsDateRange = "28d"
+ HTTPLocationHTTPProtocolGetParamsDateRange12w HTTPLocationHTTPProtocolGetParamsDateRange = "12w"
+ HTTPLocationHTTPProtocolGetParamsDateRange24w HTTPLocationHTTPProtocolGetParamsDateRange = "24w"
+ HTTPLocationHTTPProtocolGetParamsDateRange52w HTTPLocationHTTPProtocolGetParamsDateRange = "52w"
+ HTTPLocationHTTPProtocolGetParamsDateRange1dControl HTTPLocationHTTPProtocolGetParamsDateRange = "1dControl"
+ HTTPLocationHTTPProtocolGetParamsDateRange2dControl HTTPLocationHTTPProtocolGetParamsDateRange = "2dControl"
+ HTTPLocationHTTPProtocolGetParamsDateRange7dControl HTTPLocationHTTPProtocolGetParamsDateRange = "7dControl"
+ HTTPLocationHTTPProtocolGetParamsDateRange14dControl HTTPLocationHTTPProtocolGetParamsDateRange = "14dControl"
+ HTTPLocationHTTPProtocolGetParamsDateRange28dControl HTTPLocationHTTPProtocolGetParamsDateRange = "28dControl"
+ HTTPLocationHTTPProtocolGetParamsDateRange12wControl HTTPLocationHTTPProtocolGetParamsDateRange = "12wControl"
+ HTTPLocationHTTPProtocolGetParamsDateRange24wControl HTTPLocationHTTPProtocolGetParamsDateRange = "24wControl"
+)
+
+type HTTPLocationHTTPProtocolGetParamsDeviceType string
+
+const (
+ HTTPLocationHTTPProtocolGetParamsDeviceTypeDesktop HTTPLocationHTTPProtocolGetParamsDeviceType = "DESKTOP"
+ HTTPLocationHTTPProtocolGetParamsDeviceTypeMobile HTTPLocationHTTPProtocolGetParamsDeviceType = "MOBILE"
+ HTTPLocationHTTPProtocolGetParamsDeviceTypeOther HTTPLocationHTTPProtocolGetParamsDeviceType = "OTHER"
+)
+
+// Format results are returned in.
+type HTTPLocationHTTPProtocolGetParamsFormat string
+
+const (
+ HTTPLocationHTTPProtocolGetParamsFormatJson HTTPLocationHTTPProtocolGetParamsFormat = "JSON"
+ HTTPLocationHTTPProtocolGetParamsFormatCsv HTTPLocationHTTPProtocolGetParamsFormat = "CSV"
+)
+
+type HTTPLocationHTTPProtocolGetParamsIPVersion string
+
+const (
+ HTTPLocationHTTPProtocolGetParamsIPVersionIPv4 HTTPLocationHTTPProtocolGetParamsIPVersion = "IPv4"
+ HTTPLocationHTTPProtocolGetParamsIPVersionIPv6 HTTPLocationHTTPProtocolGetParamsIPVersion = "IPv6"
+)
+
+type HTTPLocationHTTPProtocolGetParamsOS string
+
+const (
+ HTTPLocationHTTPProtocolGetParamsOSWindows HTTPLocationHTTPProtocolGetParamsOS = "WINDOWS"
+ HTTPLocationHTTPProtocolGetParamsOSMacosx HTTPLocationHTTPProtocolGetParamsOS = "MACOSX"
+ HTTPLocationHTTPProtocolGetParamsOSIos HTTPLocationHTTPProtocolGetParamsOS = "IOS"
+ HTTPLocationHTTPProtocolGetParamsOSAndroid HTTPLocationHTTPProtocolGetParamsOS = "ANDROID"
+ HTTPLocationHTTPProtocolGetParamsOSChromeos HTTPLocationHTTPProtocolGetParamsOS = "CHROMEOS"
+ HTTPLocationHTTPProtocolGetParamsOSLinux HTTPLocationHTTPProtocolGetParamsOS = "LINUX"
+ HTTPLocationHTTPProtocolGetParamsOSSmartTv HTTPLocationHTTPProtocolGetParamsOS = "SMART_TV"
+)
+
+type HTTPLocationHTTPProtocolGetParamsTLSVersion string
+
+const (
+ HTTPLocationHTTPProtocolGetParamsTLSVersionTlSv1_0 HTTPLocationHTTPProtocolGetParamsTLSVersion = "TLSv1_0"
+ HTTPLocationHTTPProtocolGetParamsTLSVersionTlSv1_1 HTTPLocationHTTPProtocolGetParamsTLSVersion = "TLSv1_1"
+ HTTPLocationHTTPProtocolGetParamsTLSVersionTlSv1_2 HTTPLocationHTTPProtocolGetParamsTLSVersion = "TLSv1_2"
+ HTTPLocationHTTPProtocolGetParamsTLSVersionTlSv1_3 HTTPLocationHTTPProtocolGetParamsTLSVersion = "TLSv1_3"
+ HTTPLocationHTTPProtocolGetParamsTLSVersionTlSvQuic HTTPLocationHTTPProtocolGetParamsTLSVersion = "TLSvQUIC"
+)
+
+type HTTPLocationHTTPProtocolGetResponseEnvelope struct {
+ Result HTTPLocationHTTPProtocolGetResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON httpLocationHTTPProtocolGetResponseEnvelopeJSON `json:"-"`
+}
+
+// httpLocationHTTPProtocolGetResponseEnvelopeJSON contains the JSON metadata for
+// the struct [HTTPLocationHTTPProtocolGetResponseEnvelope]
+type httpLocationHTTPProtocolGetResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPLocationHTTPProtocolGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpLocationHTTPProtocolGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/radar/httplocationhttpprotocol_test.go b/radar/httplocationhttpprotocol_test.go
new file mode 100644
index 00000000000..35a3c61d954
--- /dev/null
+++ b/radar/httplocationhttpprotocol_test.go
@@ -0,0 +1,59 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/radar"
+)
+
+func TestHTTPLocationHTTPProtocolGetWithOptionalParams(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"),
+ )
+ _, err := client.Radar.HTTP.Locations.HTTPProtocol.Get(
+ context.TODO(),
+ radar.HTTPLocationHTTPProtocolGetParamsHTTPProtocolHTTP,
+ radar.HTTPLocationHTTPProtocolGetParams{
+ ASN: cloudflare.F([]string{"string", "string", "string"}),
+ BotClass: cloudflare.F([]radar.HTTPLocationHTTPProtocolGetParamsBotClass{radar.HTTPLocationHTTPProtocolGetParamsBotClassLikelyAutomated, radar.HTTPLocationHTTPProtocolGetParamsBotClassLikelyHuman}),
+ Continent: cloudflare.F([]string{"string", "string", "string"}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.HTTPLocationHTTPProtocolGetParamsDateRange{radar.HTTPLocationHTTPProtocolGetParamsDateRange1d, radar.HTTPLocationHTTPProtocolGetParamsDateRange2d, radar.HTTPLocationHTTPProtocolGetParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DeviceType: cloudflare.F([]radar.HTTPLocationHTTPProtocolGetParamsDeviceType{radar.HTTPLocationHTTPProtocolGetParamsDeviceTypeDesktop, radar.HTTPLocationHTTPProtocolGetParamsDeviceTypeMobile, radar.HTTPLocationHTTPProtocolGetParamsDeviceTypeOther}),
+ Format: cloudflare.F(radar.HTTPLocationHTTPProtocolGetParamsFormatJson),
+ IPVersion: cloudflare.F([]radar.HTTPLocationHTTPProtocolGetParamsIPVersion{radar.HTTPLocationHTTPProtocolGetParamsIPVersionIPv4, radar.HTTPLocationHTTPProtocolGetParamsIPVersionIPv6}),
+ Limit: cloudflare.F(int64(5)),
+ Location: cloudflare.F([]string{"string", "string", "string"}),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ OS: cloudflare.F([]radar.HTTPLocationHTTPProtocolGetParamsOS{radar.HTTPLocationHTTPProtocolGetParamsOSWindows, radar.HTTPLocationHTTPProtocolGetParamsOSMacosx, radar.HTTPLocationHTTPProtocolGetParamsOSIos}),
+ TLSVersion: cloudflare.F([]radar.HTTPLocationHTTPProtocolGetParamsTLSVersion{radar.HTTPLocationHTTPProtocolGetParamsTLSVersionTlSv1_0, radar.HTTPLocationHTTPProtocolGetParamsTLSVersionTlSv1_1, radar.HTTPLocationHTTPProtocolGetParamsTLSVersionTlSv1_2}),
+ },
+ )
+ 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/radar/httplocationipversion.go b/radar/httplocationipversion.go
new file mode 100644
index 00000000000..bb982e70d2f
--- /dev/null
+++ b/radar/httplocationipversion.go
@@ -0,0 +1,366 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// HTTPLocationIPVersionService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewHTTPLocationIPVersionService]
+// method instead.
+type HTTPLocationIPVersionService struct {
+ Options []option.RequestOption
+}
+
+// NewHTTPLocationIPVersionService generates a new service that applies the given
+// options to each request. These options are applied after the parent client's
+// options (if there is one), and before any request-specific options.
+func NewHTTPLocationIPVersionService(opts ...option.RequestOption) (r *HTTPLocationIPVersionService) {
+ r = &HTTPLocationIPVersionService{}
+ r.Options = opts
+ return
+}
+
+// Get the top locations, by HTTP traffic, of the requested IP protocol version.
+// Values are a percentage out of the total traffic.
+func (r *HTTPLocationIPVersionService) Get(ctx context.Context, ipVersion HTTPLocationIPVersionGetParamsIPVersion, query HTTPLocationIPVersionGetParams, opts ...option.RequestOption) (res *HTTPLocationIPVersionGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env HTTPLocationIPVersionGetResponseEnvelope
+ path := fmt.Sprintf("radar/http/top/locations/ip_version/%v", ipVersion)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type HTTPLocationIPVersionGetResponse struct {
+ Meta HTTPLocationIPVersionGetResponseMeta `json:"meta,required"`
+ Top0 []HTTPLocationIPVersionGetResponseTop0 `json:"top_0,required"`
+ JSON httpLocationIPVersionGetResponseJSON `json:"-"`
+}
+
+// httpLocationIPVersionGetResponseJSON contains the JSON metadata for the struct
+// [HTTPLocationIPVersionGetResponse]
+type httpLocationIPVersionGetResponseJSON struct {
+ Meta apijson.Field
+ Top0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPLocationIPVersionGetResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpLocationIPVersionGetResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPLocationIPVersionGetResponseMeta struct {
+ DateRange []HTTPLocationIPVersionGetResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ ConfidenceInfo HTTPLocationIPVersionGetResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON httpLocationIPVersionGetResponseMetaJSON `json:"-"`
+}
+
+// httpLocationIPVersionGetResponseMetaJSON contains the JSON metadata for the
+// struct [HTTPLocationIPVersionGetResponseMeta]
+type httpLocationIPVersionGetResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPLocationIPVersionGetResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpLocationIPVersionGetResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPLocationIPVersionGetResponseMetaDateRange 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 httpLocationIPVersionGetResponseMetaDateRangeJSON `json:"-"`
+}
+
+// httpLocationIPVersionGetResponseMetaDateRangeJSON contains the JSON metadata for
+// the struct [HTTPLocationIPVersionGetResponseMetaDateRange]
+type httpLocationIPVersionGetResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPLocationIPVersionGetResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpLocationIPVersionGetResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPLocationIPVersionGetResponseMetaConfidenceInfo struct {
+ Annotations []HTTPLocationIPVersionGetResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON httpLocationIPVersionGetResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// httpLocationIPVersionGetResponseMetaConfidenceInfoJSON contains the JSON
+// metadata for the struct [HTTPLocationIPVersionGetResponseMetaConfidenceInfo]
+type httpLocationIPVersionGetResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPLocationIPVersionGetResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpLocationIPVersionGetResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPLocationIPVersionGetResponseMetaConfidenceInfoAnnotation 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 httpLocationIPVersionGetResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// httpLocationIPVersionGetResponseMetaConfidenceInfoAnnotationJSON contains the
+// JSON metadata for the struct
+// [HTTPLocationIPVersionGetResponseMetaConfidenceInfoAnnotation]
+type httpLocationIPVersionGetResponseMetaConfidenceInfoAnnotationJSON 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 *HTTPLocationIPVersionGetResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpLocationIPVersionGetResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPLocationIPVersionGetResponseTop0 struct {
+ ClientCountryAlpha2 string `json:"clientCountryAlpha2,required"`
+ ClientCountryName string `json:"clientCountryName,required"`
+ Value string `json:"value,required"`
+ JSON httpLocationIPVersionGetResponseTop0JSON `json:"-"`
+}
+
+// httpLocationIPVersionGetResponseTop0JSON contains the JSON metadata for the
+// struct [HTTPLocationIPVersionGetResponseTop0]
+type httpLocationIPVersionGetResponseTop0JSON struct {
+ ClientCountryAlpha2 apijson.Field
+ ClientCountryName apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPLocationIPVersionGetResponseTop0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpLocationIPVersionGetResponseTop0JSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPLocationIPVersionGetParams 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"`
+ // Filter for bot class. Refer to
+ // [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/).
+ BotClass param.Field[[]HTTPLocationIPVersionGetParamsBotClass] `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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]HTTPLocationIPVersionGetParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Filter for device type.
+ DeviceType param.Field[[]HTTPLocationIPVersionGetParamsDeviceType] `query:"deviceType"`
+ // Format results are returned in.
+ Format param.Field[HTTPLocationIPVersionGetParamsFormat] `query:"format"`
+ // Filter for http protocol.
+ HTTPProtocol param.Field[[]HTTPLocationIPVersionGetParamsHTTPProtocol] `query:"httpProtocol"`
+ // Filter for http version.
+ HTTPVersion param.Field[[]HTTPLocationIPVersionGetParamsHTTPVersion] `query:"httpVersion"`
+ // 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 os name.
+ OS param.Field[[]HTTPLocationIPVersionGetParamsOS] `query:"os"`
+ // Filter for tls version.
+ TLSVersion param.Field[[]HTTPLocationIPVersionGetParamsTLSVersion] `query:"tlsVersion"`
+}
+
+// URLQuery serializes [HTTPLocationIPVersionGetParams]'s query parameters as
+// `url.Values`.
+func (r HTTPLocationIPVersionGetParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// IP version.
+type HTTPLocationIPVersionGetParamsIPVersion string
+
+const (
+ HTTPLocationIPVersionGetParamsIPVersionIPv4 HTTPLocationIPVersionGetParamsIPVersion = "IPv4"
+ HTTPLocationIPVersionGetParamsIPVersionIPv6 HTTPLocationIPVersionGetParamsIPVersion = "IPv6"
+)
+
+type HTTPLocationIPVersionGetParamsBotClass string
+
+const (
+ HTTPLocationIPVersionGetParamsBotClassLikelyAutomated HTTPLocationIPVersionGetParamsBotClass = "LIKELY_AUTOMATED"
+ HTTPLocationIPVersionGetParamsBotClassLikelyHuman HTTPLocationIPVersionGetParamsBotClass = "LIKELY_HUMAN"
+)
+
+type HTTPLocationIPVersionGetParamsDateRange string
+
+const (
+ HTTPLocationIPVersionGetParamsDateRange1d HTTPLocationIPVersionGetParamsDateRange = "1d"
+ HTTPLocationIPVersionGetParamsDateRange2d HTTPLocationIPVersionGetParamsDateRange = "2d"
+ HTTPLocationIPVersionGetParamsDateRange7d HTTPLocationIPVersionGetParamsDateRange = "7d"
+ HTTPLocationIPVersionGetParamsDateRange14d HTTPLocationIPVersionGetParamsDateRange = "14d"
+ HTTPLocationIPVersionGetParamsDateRange28d HTTPLocationIPVersionGetParamsDateRange = "28d"
+ HTTPLocationIPVersionGetParamsDateRange12w HTTPLocationIPVersionGetParamsDateRange = "12w"
+ HTTPLocationIPVersionGetParamsDateRange24w HTTPLocationIPVersionGetParamsDateRange = "24w"
+ HTTPLocationIPVersionGetParamsDateRange52w HTTPLocationIPVersionGetParamsDateRange = "52w"
+ HTTPLocationIPVersionGetParamsDateRange1dControl HTTPLocationIPVersionGetParamsDateRange = "1dControl"
+ HTTPLocationIPVersionGetParamsDateRange2dControl HTTPLocationIPVersionGetParamsDateRange = "2dControl"
+ HTTPLocationIPVersionGetParamsDateRange7dControl HTTPLocationIPVersionGetParamsDateRange = "7dControl"
+ HTTPLocationIPVersionGetParamsDateRange14dControl HTTPLocationIPVersionGetParamsDateRange = "14dControl"
+ HTTPLocationIPVersionGetParamsDateRange28dControl HTTPLocationIPVersionGetParamsDateRange = "28dControl"
+ HTTPLocationIPVersionGetParamsDateRange12wControl HTTPLocationIPVersionGetParamsDateRange = "12wControl"
+ HTTPLocationIPVersionGetParamsDateRange24wControl HTTPLocationIPVersionGetParamsDateRange = "24wControl"
+)
+
+type HTTPLocationIPVersionGetParamsDeviceType string
+
+const (
+ HTTPLocationIPVersionGetParamsDeviceTypeDesktop HTTPLocationIPVersionGetParamsDeviceType = "DESKTOP"
+ HTTPLocationIPVersionGetParamsDeviceTypeMobile HTTPLocationIPVersionGetParamsDeviceType = "MOBILE"
+ HTTPLocationIPVersionGetParamsDeviceTypeOther HTTPLocationIPVersionGetParamsDeviceType = "OTHER"
+)
+
+// Format results are returned in.
+type HTTPLocationIPVersionGetParamsFormat string
+
+const (
+ HTTPLocationIPVersionGetParamsFormatJson HTTPLocationIPVersionGetParamsFormat = "JSON"
+ HTTPLocationIPVersionGetParamsFormatCsv HTTPLocationIPVersionGetParamsFormat = "CSV"
+)
+
+type HTTPLocationIPVersionGetParamsHTTPProtocol string
+
+const (
+ HTTPLocationIPVersionGetParamsHTTPProtocolHTTP HTTPLocationIPVersionGetParamsHTTPProtocol = "HTTP"
+ HTTPLocationIPVersionGetParamsHTTPProtocolHTTPS HTTPLocationIPVersionGetParamsHTTPProtocol = "HTTPS"
+)
+
+type HTTPLocationIPVersionGetParamsHTTPVersion string
+
+const (
+ HTTPLocationIPVersionGetParamsHTTPVersionHttPv1 HTTPLocationIPVersionGetParamsHTTPVersion = "HTTPv1"
+ HTTPLocationIPVersionGetParamsHTTPVersionHttPv2 HTTPLocationIPVersionGetParamsHTTPVersion = "HTTPv2"
+ HTTPLocationIPVersionGetParamsHTTPVersionHttPv3 HTTPLocationIPVersionGetParamsHTTPVersion = "HTTPv3"
+)
+
+type HTTPLocationIPVersionGetParamsOS string
+
+const (
+ HTTPLocationIPVersionGetParamsOSWindows HTTPLocationIPVersionGetParamsOS = "WINDOWS"
+ HTTPLocationIPVersionGetParamsOSMacosx HTTPLocationIPVersionGetParamsOS = "MACOSX"
+ HTTPLocationIPVersionGetParamsOSIos HTTPLocationIPVersionGetParamsOS = "IOS"
+ HTTPLocationIPVersionGetParamsOSAndroid HTTPLocationIPVersionGetParamsOS = "ANDROID"
+ HTTPLocationIPVersionGetParamsOSChromeos HTTPLocationIPVersionGetParamsOS = "CHROMEOS"
+ HTTPLocationIPVersionGetParamsOSLinux HTTPLocationIPVersionGetParamsOS = "LINUX"
+ HTTPLocationIPVersionGetParamsOSSmartTv HTTPLocationIPVersionGetParamsOS = "SMART_TV"
+)
+
+type HTTPLocationIPVersionGetParamsTLSVersion string
+
+const (
+ HTTPLocationIPVersionGetParamsTLSVersionTlSv1_0 HTTPLocationIPVersionGetParamsTLSVersion = "TLSv1_0"
+ HTTPLocationIPVersionGetParamsTLSVersionTlSv1_1 HTTPLocationIPVersionGetParamsTLSVersion = "TLSv1_1"
+ HTTPLocationIPVersionGetParamsTLSVersionTlSv1_2 HTTPLocationIPVersionGetParamsTLSVersion = "TLSv1_2"
+ HTTPLocationIPVersionGetParamsTLSVersionTlSv1_3 HTTPLocationIPVersionGetParamsTLSVersion = "TLSv1_3"
+ HTTPLocationIPVersionGetParamsTLSVersionTlSvQuic HTTPLocationIPVersionGetParamsTLSVersion = "TLSvQUIC"
+)
+
+type HTTPLocationIPVersionGetResponseEnvelope struct {
+ Result HTTPLocationIPVersionGetResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON httpLocationIPVersionGetResponseEnvelopeJSON `json:"-"`
+}
+
+// httpLocationIPVersionGetResponseEnvelopeJSON contains the JSON metadata for the
+// struct [HTTPLocationIPVersionGetResponseEnvelope]
+type httpLocationIPVersionGetResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPLocationIPVersionGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpLocationIPVersionGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/radar/httplocationipversion_test.go b/radar/httplocationipversion_test.go
new file mode 100644
index 00000000000..3f61e422c46
--- /dev/null
+++ b/radar/httplocationipversion_test.go
@@ -0,0 +1,60 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/radar"
+)
+
+func TestHTTPLocationIPVersionGetWithOptionalParams(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"),
+ )
+ _, err := client.Radar.HTTP.Locations.IPVersion.Get(
+ context.TODO(),
+ radar.HTTPLocationIPVersionGetParamsIPVersionIPv4,
+ radar.HTTPLocationIPVersionGetParams{
+ ASN: cloudflare.F([]string{"string", "string", "string"}),
+ BotClass: cloudflare.F([]radar.HTTPLocationIPVersionGetParamsBotClass{radar.HTTPLocationIPVersionGetParamsBotClassLikelyAutomated, radar.HTTPLocationIPVersionGetParamsBotClassLikelyHuman}),
+ Continent: cloudflare.F([]string{"string", "string", "string"}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.HTTPLocationIPVersionGetParamsDateRange{radar.HTTPLocationIPVersionGetParamsDateRange1d, radar.HTTPLocationIPVersionGetParamsDateRange2d, radar.HTTPLocationIPVersionGetParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DeviceType: cloudflare.F([]radar.HTTPLocationIPVersionGetParamsDeviceType{radar.HTTPLocationIPVersionGetParamsDeviceTypeDesktop, radar.HTTPLocationIPVersionGetParamsDeviceTypeMobile, radar.HTTPLocationIPVersionGetParamsDeviceTypeOther}),
+ Format: cloudflare.F(radar.HTTPLocationIPVersionGetParamsFormatJson),
+ HTTPProtocol: cloudflare.F([]radar.HTTPLocationIPVersionGetParamsHTTPProtocol{radar.HTTPLocationIPVersionGetParamsHTTPProtocolHTTP, radar.HTTPLocationIPVersionGetParamsHTTPProtocolHTTPS}),
+ HTTPVersion: cloudflare.F([]radar.HTTPLocationIPVersionGetParamsHTTPVersion{radar.HTTPLocationIPVersionGetParamsHTTPVersionHttPv1, radar.HTTPLocationIPVersionGetParamsHTTPVersionHttPv2, radar.HTTPLocationIPVersionGetParamsHTTPVersionHttPv3}),
+ Limit: cloudflare.F(int64(5)),
+ Location: cloudflare.F([]string{"string", "string", "string"}),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ OS: cloudflare.F([]radar.HTTPLocationIPVersionGetParamsOS{radar.HTTPLocationIPVersionGetParamsOSWindows, radar.HTTPLocationIPVersionGetParamsOSMacosx, radar.HTTPLocationIPVersionGetParamsOSIos}),
+ TLSVersion: cloudflare.F([]radar.HTTPLocationIPVersionGetParamsTLSVersion{radar.HTTPLocationIPVersionGetParamsTLSVersionTlSv1_0, radar.HTTPLocationIPVersionGetParamsTLSVersionTlSv1_1, radar.HTTPLocationIPVersionGetParamsTLSVersionTlSv1_2}),
+ },
+ )
+ 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/radar/httplocationos.go b/radar/httplocationos.go
new file mode 100644
index 00000000000..eb4f70943b2
--- /dev/null
+++ b/radar/httplocationos.go
@@ -0,0 +1,365 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// HTTPLocationOSService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewHTTPLocationOSService] method
+// instead.
+type HTTPLocationOSService struct {
+ Options []option.RequestOption
+}
+
+// NewHTTPLocationOSService generates a new service that applies the given options
+// to each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewHTTPLocationOSService(opts ...option.RequestOption) (r *HTTPLocationOSService) {
+ r = &HTTPLocationOSService{}
+ r.Options = opts
+ return
+}
+
+// Get the top locations, by HTTP traffic, of the requested operating systems.
+// Values are a percentage out of the total traffic.
+func (r *HTTPLocationOSService) Get(ctx context.Context, os HTTPLocationOSGetParamsOS, query HTTPLocationOSGetParams, opts ...option.RequestOption) (res *HTTPLocationOSGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env HTTPLocationOSGetResponseEnvelope
+ path := fmt.Sprintf("radar/http/top/locations/os/%v", os)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type HTTPLocationOSGetResponse struct {
+ Meta HTTPLocationOSGetResponseMeta `json:"meta,required"`
+ Top0 []HTTPLocationOSGetResponseTop0 `json:"top_0,required"`
+ JSON httpLocationOSGetResponseJSON `json:"-"`
+}
+
+// httpLocationOSGetResponseJSON contains the JSON metadata for the struct
+// [HTTPLocationOSGetResponse]
+type httpLocationOSGetResponseJSON struct {
+ Meta apijson.Field
+ Top0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPLocationOSGetResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpLocationOSGetResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPLocationOSGetResponseMeta struct {
+ DateRange []HTTPLocationOSGetResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ ConfidenceInfo HTTPLocationOSGetResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON httpLocationOSGetResponseMetaJSON `json:"-"`
+}
+
+// httpLocationOSGetResponseMetaJSON contains the JSON metadata for the struct
+// [HTTPLocationOSGetResponseMeta]
+type httpLocationOSGetResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPLocationOSGetResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpLocationOSGetResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPLocationOSGetResponseMetaDateRange 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 httpLocationOSGetResponseMetaDateRangeJSON `json:"-"`
+}
+
+// httpLocationOSGetResponseMetaDateRangeJSON contains the JSON metadata for the
+// struct [HTTPLocationOSGetResponseMetaDateRange]
+type httpLocationOSGetResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPLocationOSGetResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpLocationOSGetResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPLocationOSGetResponseMetaConfidenceInfo struct {
+ Annotations []HTTPLocationOSGetResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON httpLocationOSGetResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// httpLocationOSGetResponseMetaConfidenceInfoJSON contains the JSON metadata for
+// the struct [HTTPLocationOSGetResponseMetaConfidenceInfo]
+type httpLocationOSGetResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPLocationOSGetResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpLocationOSGetResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPLocationOSGetResponseMetaConfidenceInfoAnnotation 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 httpLocationOSGetResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// httpLocationOSGetResponseMetaConfidenceInfoAnnotationJSON contains the JSON
+// metadata for the struct [HTTPLocationOSGetResponseMetaConfidenceInfoAnnotation]
+type httpLocationOSGetResponseMetaConfidenceInfoAnnotationJSON 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 *HTTPLocationOSGetResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpLocationOSGetResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPLocationOSGetResponseTop0 struct {
+ ClientCountryAlpha2 string `json:"clientCountryAlpha2,required"`
+ ClientCountryName string `json:"clientCountryName,required"`
+ Value string `json:"value,required"`
+ JSON httpLocationOSGetResponseTop0JSON `json:"-"`
+}
+
+// httpLocationOSGetResponseTop0JSON contains the JSON metadata for the struct
+// [HTTPLocationOSGetResponseTop0]
+type httpLocationOSGetResponseTop0JSON struct {
+ ClientCountryAlpha2 apijson.Field
+ ClientCountryName apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPLocationOSGetResponseTop0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpLocationOSGetResponseTop0JSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPLocationOSGetParams 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"`
+ // Filter for bot class. Refer to
+ // [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/).
+ BotClass param.Field[[]HTTPLocationOSGetParamsBotClass] `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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]HTTPLocationOSGetParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Filter for device type.
+ DeviceType param.Field[[]HTTPLocationOSGetParamsDeviceType] `query:"deviceType"`
+ // Format results are returned in.
+ Format param.Field[HTTPLocationOSGetParamsFormat] `query:"format"`
+ // Filter for http protocol.
+ HTTPProtocol param.Field[[]HTTPLocationOSGetParamsHTTPProtocol] `query:"httpProtocol"`
+ // Filter for http version.
+ HTTPVersion param.Field[[]HTTPLocationOSGetParamsHTTPVersion] `query:"httpVersion"`
+ // Filter for ip version.
+ IPVersion param.Field[[]HTTPLocationOSGetParamsIPVersion] `query:"ipVersion"`
+ // 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 tls version.
+ TLSVersion param.Field[[]HTTPLocationOSGetParamsTLSVersion] `query:"tlsVersion"`
+}
+
+// URLQuery serializes [HTTPLocationOSGetParams]'s query parameters as
+// `url.Values`.
+func (r HTTPLocationOSGetParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// IP version.
+type HTTPLocationOSGetParamsOS string
+
+const (
+ HTTPLocationOSGetParamsOSWindows HTTPLocationOSGetParamsOS = "WINDOWS"
+ HTTPLocationOSGetParamsOSMacosx HTTPLocationOSGetParamsOS = "MACOSX"
+ HTTPLocationOSGetParamsOSIos HTTPLocationOSGetParamsOS = "IOS"
+ HTTPLocationOSGetParamsOSAndroid HTTPLocationOSGetParamsOS = "ANDROID"
+ HTTPLocationOSGetParamsOSChromeos HTTPLocationOSGetParamsOS = "CHROMEOS"
+ HTTPLocationOSGetParamsOSLinux HTTPLocationOSGetParamsOS = "LINUX"
+ HTTPLocationOSGetParamsOSSmartTv HTTPLocationOSGetParamsOS = "SMART_TV"
+)
+
+type HTTPLocationOSGetParamsBotClass string
+
+const (
+ HTTPLocationOSGetParamsBotClassLikelyAutomated HTTPLocationOSGetParamsBotClass = "LIKELY_AUTOMATED"
+ HTTPLocationOSGetParamsBotClassLikelyHuman HTTPLocationOSGetParamsBotClass = "LIKELY_HUMAN"
+)
+
+type HTTPLocationOSGetParamsDateRange string
+
+const (
+ HTTPLocationOSGetParamsDateRange1d HTTPLocationOSGetParamsDateRange = "1d"
+ HTTPLocationOSGetParamsDateRange2d HTTPLocationOSGetParamsDateRange = "2d"
+ HTTPLocationOSGetParamsDateRange7d HTTPLocationOSGetParamsDateRange = "7d"
+ HTTPLocationOSGetParamsDateRange14d HTTPLocationOSGetParamsDateRange = "14d"
+ HTTPLocationOSGetParamsDateRange28d HTTPLocationOSGetParamsDateRange = "28d"
+ HTTPLocationOSGetParamsDateRange12w HTTPLocationOSGetParamsDateRange = "12w"
+ HTTPLocationOSGetParamsDateRange24w HTTPLocationOSGetParamsDateRange = "24w"
+ HTTPLocationOSGetParamsDateRange52w HTTPLocationOSGetParamsDateRange = "52w"
+ HTTPLocationOSGetParamsDateRange1dControl HTTPLocationOSGetParamsDateRange = "1dControl"
+ HTTPLocationOSGetParamsDateRange2dControl HTTPLocationOSGetParamsDateRange = "2dControl"
+ HTTPLocationOSGetParamsDateRange7dControl HTTPLocationOSGetParamsDateRange = "7dControl"
+ HTTPLocationOSGetParamsDateRange14dControl HTTPLocationOSGetParamsDateRange = "14dControl"
+ HTTPLocationOSGetParamsDateRange28dControl HTTPLocationOSGetParamsDateRange = "28dControl"
+ HTTPLocationOSGetParamsDateRange12wControl HTTPLocationOSGetParamsDateRange = "12wControl"
+ HTTPLocationOSGetParamsDateRange24wControl HTTPLocationOSGetParamsDateRange = "24wControl"
+)
+
+type HTTPLocationOSGetParamsDeviceType string
+
+const (
+ HTTPLocationOSGetParamsDeviceTypeDesktop HTTPLocationOSGetParamsDeviceType = "DESKTOP"
+ HTTPLocationOSGetParamsDeviceTypeMobile HTTPLocationOSGetParamsDeviceType = "MOBILE"
+ HTTPLocationOSGetParamsDeviceTypeOther HTTPLocationOSGetParamsDeviceType = "OTHER"
+)
+
+// Format results are returned in.
+type HTTPLocationOSGetParamsFormat string
+
+const (
+ HTTPLocationOSGetParamsFormatJson HTTPLocationOSGetParamsFormat = "JSON"
+ HTTPLocationOSGetParamsFormatCsv HTTPLocationOSGetParamsFormat = "CSV"
+)
+
+type HTTPLocationOSGetParamsHTTPProtocol string
+
+const (
+ HTTPLocationOSGetParamsHTTPProtocolHTTP HTTPLocationOSGetParamsHTTPProtocol = "HTTP"
+ HTTPLocationOSGetParamsHTTPProtocolHTTPS HTTPLocationOSGetParamsHTTPProtocol = "HTTPS"
+)
+
+type HTTPLocationOSGetParamsHTTPVersion string
+
+const (
+ HTTPLocationOSGetParamsHTTPVersionHttPv1 HTTPLocationOSGetParamsHTTPVersion = "HTTPv1"
+ HTTPLocationOSGetParamsHTTPVersionHttPv2 HTTPLocationOSGetParamsHTTPVersion = "HTTPv2"
+ HTTPLocationOSGetParamsHTTPVersionHttPv3 HTTPLocationOSGetParamsHTTPVersion = "HTTPv3"
+)
+
+type HTTPLocationOSGetParamsIPVersion string
+
+const (
+ HTTPLocationOSGetParamsIPVersionIPv4 HTTPLocationOSGetParamsIPVersion = "IPv4"
+ HTTPLocationOSGetParamsIPVersionIPv6 HTTPLocationOSGetParamsIPVersion = "IPv6"
+)
+
+type HTTPLocationOSGetParamsTLSVersion string
+
+const (
+ HTTPLocationOSGetParamsTLSVersionTlSv1_0 HTTPLocationOSGetParamsTLSVersion = "TLSv1_0"
+ HTTPLocationOSGetParamsTLSVersionTlSv1_1 HTTPLocationOSGetParamsTLSVersion = "TLSv1_1"
+ HTTPLocationOSGetParamsTLSVersionTlSv1_2 HTTPLocationOSGetParamsTLSVersion = "TLSv1_2"
+ HTTPLocationOSGetParamsTLSVersionTlSv1_3 HTTPLocationOSGetParamsTLSVersion = "TLSv1_3"
+ HTTPLocationOSGetParamsTLSVersionTlSvQuic HTTPLocationOSGetParamsTLSVersion = "TLSvQUIC"
+)
+
+type HTTPLocationOSGetResponseEnvelope struct {
+ Result HTTPLocationOSGetResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON httpLocationOSGetResponseEnvelopeJSON `json:"-"`
+}
+
+// httpLocationOSGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [HTTPLocationOSGetResponseEnvelope]
+type httpLocationOSGetResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPLocationOSGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpLocationOSGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/radar/httplocationos_test.go b/radar/httplocationos_test.go
new file mode 100644
index 00000000000..735e1da8af7
--- /dev/null
+++ b/radar/httplocationos_test.go
@@ -0,0 +1,60 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/radar"
+)
+
+func TestHTTPLocationOSGetWithOptionalParams(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"),
+ )
+ _, err := client.Radar.HTTP.Locations.OS.Get(
+ context.TODO(),
+ radar.HTTPLocationOSGetParamsOSWindows,
+ radar.HTTPLocationOSGetParams{
+ ASN: cloudflare.F([]string{"string", "string", "string"}),
+ BotClass: cloudflare.F([]radar.HTTPLocationOSGetParamsBotClass{radar.HTTPLocationOSGetParamsBotClassLikelyAutomated, radar.HTTPLocationOSGetParamsBotClassLikelyHuman}),
+ Continent: cloudflare.F([]string{"string", "string", "string"}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.HTTPLocationOSGetParamsDateRange{radar.HTTPLocationOSGetParamsDateRange1d, radar.HTTPLocationOSGetParamsDateRange2d, radar.HTTPLocationOSGetParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DeviceType: cloudflare.F([]radar.HTTPLocationOSGetParamsDeviceType{radar.HTTPLocationOSGetParamsDeviceTypeDesktop, radar.HTTPLocationOSGetParamsDeviceTypeMobile, radar.HTTPLocationOSGetParamsDeviceTypeOther}),
+ Format: cloudflare.F(radar.HTTPLocationOSGetParamsFormatJson),
+ HTTPProtocol: cloudflare.F([]radar.HTTPLocationOSGetParamsHTTPProtocol{radar.HTTPLocationOSGetParamsHTTPProtocolHTTP, radar.HTTPLocationOSGetParamsHTTPProtocolHTTPS}),
+ HTTPVersion: cloudflare.F([]radar.HTTPLocationOSGetParamsHTTPVersion{radar.HTTPLocationOSGetParamsHTTPVersionHttPv1, radar.HTTPLocationOSGetParamsHTTPVersionHttPv2, radar.HTTPLocationOSGetParamsHTTPVersionHttPv3}),
+ IPVersion: cloudflare.F([]radar.HTTPLocationOSGetParamsIPVersion{radar.HTTPLocationOSGetParamsIPVersionIPv4, radar.HTTPLocationOSGetParamsIPVersionIPv6}),
+ Limit: cloudflare.F(int64(5)),
+ Location: cloudflare.F([]string{"string", "string", "string"}),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ TLSVersion: cloudflare.F([]radar.HTTPLocationOSGetParamsTLSVersion{radar.HTTPLocationOSGetParamsTLSVersionTlSv1_0, radar.HTTPLocationOSGetParamsTLSVersionTlSv1_1, radar.HTTPLocationOSGetParamsTLSVersionTlSv1_2}),
+ },
+ )
+ 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/radar/httplocationtlsversion.go b/radar/httplocationtlsversion.go
new file mode 100644
index 00000000000..b280d0f6624
--- /dev/null
+++ b/radar/httplocationtlsversion.go
@@ -0,0 +1,366 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// HTTPLocationTLSVersionService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewHTTPLocationTLSVersionService]
+// method instead.
+type HTTPLocationTLSVersionService struct {
+ Options []option.RequestOption
+}
+
+// NewHTTPLocationTLSVersionService generates a new service that applies the given
+// options to each request. These options are applied after the parent client's
+// options (if there is one), and before any request-specific options.
+func NewHTTPLocationTLSVersionService(opts ...option.RequestOption) (r *HTTPLocationTLSVersionService) {
+ r = &HTTPLocationTLSVersionService{}
+ r.Options = opts
+ return
+}
+
+// Get the top locations, by HTTP traffic, of the requested TLS protocol version.
+// Values are a percentage out of the total traffic.
+func (r *HTTPLocationTLSVersionService) Get(ctx context.Context, tlsVersion HTTPLocationTLSVersionGetParamsTLSVersion, query HTTPLocationTLSVersionGetParams, opts ...option.RequestOption) (res *HTTPLocationTLSVersionGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env HTTPLocationTLSVersionGetResponseEnvelope
+ path := fmt.Sprintf("radar/http/top/locations/tls_version/%v", tlsVersion)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type HTTPLocationTLSVersionGetResponse struct {
+ Meta HTTPLocationTLSVersionGetResponseMeta `json:"meta,required"`
+ Top0 []HTTPLocationTLSVersionGetResponseTop0 `json:"top_0,required"`
+ JSON httpLocationTLSVersionGetResponseJSON `json:"-"`
+}
+
+// httpLocationTLSVersionGetResponseJSON contains the JSON metadata for the struct
+// [HTTPLocationTLSVersionGetResponse]
+type httpLocationTLSVersionGetResponseJSON struct {
+ Meta apijson.Field
+ Top0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPLocationTLSVersionGetResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpLocationTLSVersionGetResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPLocationTLSVersionGetResponseMeta struct {
+ DateRange []HTTPLocationTLSVersionGetResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ ConfidenceInfo HTTPLocationTLSVersionGetResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON httpLocationTLSVersionGetResponseMetaJSON `json:"-"`
+}
+
+// httpLocationTLSVersionGetResponseMetaJSON contains the JSON metadata for the
+// struct [HTTPLocationTLSVersionGetResponseMeta]
+type httpLocationTLSVersionGetResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPLocationTLSVersionGetResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpLocationTLSVersionGetResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPLocationTLSVersionGetResponseMetaDateRange 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 httpLocationTLSVersionGetResponseMetaDateRangeJSON `json:"-"`
+}
+
+// httpLocationTLSVersionGetResponseMetaDateRangeJSON contains the JSON metadata
+// for the struct [HTTPLocationTLSVersionGetResponseMetaDateRange]
+type httpLocationTLSVersionGetResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPLocationTLSVersionGetResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpLocationTLSVersionGetResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPLocationTLSVersionGetResponseMetaConfidenceInfo struct {
+ Annotations []HTTPLocationTLSVersionGetResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON httpLocationTLSVersionGetResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// httpLocationTLSVersionGetResponseMetaConfidenceInfoJSON contains the JSON
+// metadata for the struct [HTTPLocationTLSVersionGetResponseMetaConfidenceInfo]
+type httpLocationTLSVersionGetResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPLocationTLSVersionGetResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpLocationTLSVersionGetResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPLocationTLSVersionGetResponseMetaConfidenceInfoAnnotation 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 httpLocationTLSVersionGetResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// httpLocationTLSVersionGetResponseMetaConfidenceInfoAnnotationJSON contains the
+// JSON metadata for the struct
+// [HTTPLocationTLSVersionGetResponseMetaConfidenceInfoAnnotation]
+type httpLocationTLSVersionGetResponseMetaConfidenceInfoAnnotationJSON 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 *HTTPLocationTLSVersionGetResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpLocationTLSVersionGetResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPLocationTLSVersionGetResponseTop0 struct {
+ ClientCountryAlpha2 string `json:"clientCountryAlpha2,required"`
+ ClientCountryName string `json:"clientCountryName,required"`
+ Value string `json:"value,required"`
+ JSON httpLocationTLSVersionGetResponseTop0JSON `json:"-"`
+}
+
+// httpLocationTLSVersionGetResponseTop0JSON contains the JSON metadata for the
+// struct [HTTPLocationTLSVersionGetResponseTop0]
+type httpLocationTLSVersionGetResponseTop0JSON struct {
+ ClientCountryAlpha2 apijson.Field
+ ClientCountryName apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPLocationTLSVersionGetResponseTop0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpLocationTLSVersionGetResponseTop0JSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPLocationTLSVersionGetParams 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"`
+ // Filter for bot class. Refer to
+ // [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/).
+ BotClass param.Field[[]HTTPLocationTLSVersionGetParamsBotClass] `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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]HTTPLocationTLSVersionGetParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Filter for device type.
+ DeviceType param.Field[[]HTTPLocationTLSVersionGetParamsDeviceType] `query:"deviceType"`
+ // Format results are returned in.
+ Format param.Field[HTTPLocationTLSVersionGetParamsFormat] `query:"format"`
+ // Filter for http protocol.
+ HTTPProtocol param.Field[[]HTTPLocationTLSVersionGetParamsHTTPProtocol] `query:"httpProtocol"`
+ // Filter for http version.
+ HTTPVersion param.Field[[]HTTPLocationTLSVersionGetParamsHTTPVersion] `query:"httpVersion"`
+ // Filter for ip version.
+ IPVersion param.Field[[]HTTPLocationTLSVersionGetParamsIPVersion] `query:"ipVersion"`
+ // 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 os name.
+ OS param.Field[[]HTTPLocationTLSVersionGetParamsOS] `query:"os"`
+}
+
+// URLQuery serializes [HTTPLocationTLSVersionGetParams]'s query parameters as
+// `url.Values`.
+func (r HTTPLocationTLSVersionGetParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// TLS version.
+type HTTPLocationTLSVersionGetParamsTLSVersion string
+
+const (
+ HTTPLocationTLSVersionGetParamsTLSVersionTlSv1_0 HTTPLocationTLSVersionGetParamsTLSVersion = "TLSv1_0"
+ HTTPLocationTLSVersionGetParamsTLSVersionTlSv1_1 HTTPLocationTLSVersionGetParamsTLSVersion = "TLSv1_1"
+ HTTPLocationTLSVersionGetParamsTLSVersionTlSv1_2 HTTPLocationTLSVersionGetParamsTLSVersion = "TLSv1_2"
+ HTTPLocationTLSVersionGetParamsTLSVersionTlSv1_3 HTTPLocationTLSVersionGetParamsTLSVersion = "TLSv1_3"
+ HTTPLocationTLSVersionGetParamsTLSVersionTlSvQuic HTTPLocationTLSVersionGetParamsTLSVersion = "TLSvQUIC"
+)
+
+type HTTPLocationTLSVersionGetParamsBotClass string
+
+const (
+ HTTPLocationTLSVersionGetParamsBotClassLikelyAutomated HTTPLocationTLSVersionGetParamsBotClass = "LIKELY_AUTOMATED"
+ HTTPLocationTLSVersionGetParamsBotClassLikelyHuman HTTPLocationTLSVersionGetParamsBotClass = "LIKELY_HUMAN"
+)
+
+type HTTPLocationTLSVersionGetParamsDateRange string
+
+const (
+ HTTPLocationTLSVersionGetParamsDateRange1d HTTPLocationTLSVersionGetParamsDateRange = "1d"
+ HTTPLocationTLSVersionGetParamsDateRange2d HTTPLocationTLSVersionGetParamsDateRange = "2d"
+ HTTPLocationTLSVersionGetParamsDateRange7d HTTPLocationTLSVersionGetParamsDateRange = "7d"
+ HTTPLocationTLSVersionGetParamsDateRange14d HTTPLocationTLSVersionGetParamsDateRange = "14d"
+ HTTPLocationTLSVersionGetParamsDateRange28d HTTPLocationTLSVersionGetParamsDateRange = "28d"
+ HTTPLocationTLSVersionGetParamsDateRange12w HTTPLocationTLSVersionGetParamsDateRange = "12w"
+ HTTPLocationTLSVersionGetParamsDateRange24w HTTPLocationTLSVersionGetParamsDateRange = "24w"
+ HTTPLocationTLSVersionGetParamsDateRange52w HTTPLocationTLSVersionGetParamsDateRange = "52w"
+ HTTPLocationTLSVersionGetParamsDateRange1dControl HTTPLocationTLSVersionGetParamsDateRange = "1dControl"
+ HTTPLocationTLSVersionGetParamsDateRange2dControl HTTPLocationTLSVersionGetParamsDateRange = "2dControl"
+ HTTPLocationTLSVersionGetParamsDateRange7dControl HTTPLocationTLSVersionGetParamsDateRange = "7dControl"
+ HTTPLocationTLSVersionGetParamsDateRange14dControl HTTPLocationTLSVersionGetParamsDateRange = "14dControl"
+ HTTPLocationTLSVersionGetParamsDateRange28dControl HTTPLocationTLSVersionGetParamsDateRange = "28dControl"
+ HTTPLocationTLSVersionGetParamsDateRange12wControl HTTPLocationTLSVersionGetParamsDateRange = "12wControl"
+ HTTPLocationTLSVersionGetParamsDateRange24wControl HTTPLocationTLSVersionGetParamsDateRange = "24wControl"
+)
+
+type HTTPLocationTLSVersionGetParamsDeviceType string
+
+const (
+ HTTPLocationTLSVersionGetParamsDeviceTypeDesktop HTTPLocationTLSVersionGetParamsDeviceType = "DESKTOP"
+ HTTPLocationTLSVersionGetParamsDeviceTypeMobile HTTPLocationTLSVersionGetParamsDeviceType = "MOBILE"
+ HTTPLocationTLSVersionGetParamsDeviceTypeOther HTTPLocationTLSVersionGetParamsDeviceType = "OTHER"
+)
+
+// Format results are returned in.
+type HTTPLocationTLSVersionGetParamsFormat string
+
+const (
+ HTTPLocationTLSVersionGetParamsFormatJson HTTPLocationTLSVersionGetParamsFormat = "JSON"
+ HTTPLocationTLSVersionGetParamsFormatCsv HTTPLocationTLSVersionGetParamsFormat = "CSV"
+)
+
+type HTTPLocationTLSVersionGetParamsHTTPProtocol string
+
+const (
+ HTTPLocationTLSVersionGetParamsHTTPProtocolHTTP HTTPLocationTLSVersionGetParamsHTTPProtocol = "HTTP"
+ HTTPLocationTLSVersionGetParamsHTTPProtocolHTTPS HTTPLocationTLSVersionGetParamsHTTPProtocol = "HTTPS"
+)
+
+type HTTPLocationTLSVersionGetParamsHTTPVersion string
+
+const (
+ HTTPLocationTLSVersionGetParamsHTTPVersionHttPv1 HTTPLocationTLSVersionGetParamsHTTPVersion = "HTTPv1"
+ HTTPLocationTLSVersionGetParamsHTTPVersionHttPv2 HTTPLocationTLSVersionGetParamsHTTPVersion = "HTTPv2"
+ HTTPLocationTLSVersionGetParamsHTTPVersionHttPv3 HTTPLocationTLSVersionGetParamsHTTPVersion = "HTTPv3"
+)
+
+type HTTPLocationTLSVersionGetParamsIPVersion string
+
+const (
+ HTTPLocationTLSVersionGetParamsIPVersionIPv4 HTTPLocationTLSVersionGetParamsIPVersion = "IPv4"
+ HTTPLocationTLSVersionGetParamsIPVersionIPv6 HTTPLocationTLSVersionGetParamsIPVersion = "IPv6"
+)
+
+type HTTPLocationTLSVersionGetParamsOS string
+
+const (
+ HTTPLocationTLSVersionGetParamsOSWindows HTTPLocationTLSVersionGetParamsOS = "WINDOWS"
+ HTTPLocationTLSVersionGetParamsOSMacosx HTTPLocationTLSVersionGetParamsOS = "MACOSX"
+ HTTPLocationTLSVersionGetParamsOSIos HTTPLocationTLSVersionGetParamsOS = "IOS"
+ HTTPLocationTLSVersionGetParamsOSAndroid HTTPLocationTLSVersionGetParamsOS = "ANDROID"
+ HTTPLocationTLSVersionGetParamsOSChromeos HTTPLocationTLSVersionGetParamsOS = "CHROMEOS"
+ HTTPLocationTLSVersionGetParamsOSLinux HTTPLocationTLSVersionGetParamsOS = "LINUX"
+ HTTPLocationTLSVersionGetParamsOSSmartTv HTTPLocationTLSVersionGetParamsOS = "SMART_TV"
+)
+
+type HTTPLocationTLSVersionGetResponseEnvelope struct {
+ Result HTTPLocationTLSVersionGetResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON httpLocationTLSVersionGetResponseEnvelopeJSON `json:"-"`
+}
+
+// httpLocationTLSVersionGetResponseEnvelopeJSON contains the JSON metadata for the
+// struct [HTTPLocationTLSVersionGetResponseEnvelope]
+type httpLocationTLSVersionGetResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPLocationTLSVersionGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpLocationTLSVersionGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/radar/httplocationtlsversion_test.go b/radar/httplocationtlsversion_test.go
new file mode 100644
index 00000000000..daf1452bf19
--- /dev/null
+++ b/radar/httplocationtlsversion_test.go
@@ -0,0 +1,60 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/radar"
+)
+
+func TestHTTPLocationTLSVersionGetWithOptionalParams(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"),
+ )
+ _, err := client.Radar.HTTP.Locations.TLSVersion.Get(
+ context.TODO(),
+ radar.HTTPLocationTLSVersionGetParamsTLSVersionTlSv1_0,
+ radar.HTTPLocationTLSVersionGetParams{
+ ASN: cloudflare.F([]string{"string", "string", "string"}),
+ BotClass: cloudflare.F([]radar.HTTPLocationTLSVersionGetParamsBotClass{radar.HTTPLocationTLSVersionGetParamsBotClassLikelyAutomated, radar.HTTPLocationTLSVersionGetParamsBotClassLikelyHuman}),
+ Continent: cloudflare.F([]string{"string", "string", "string"}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.HTTPLocationTLSVersionGetParamsDateRange{radar.HTTPLocationTLSVersionGetParamsDateRange1d, radar.HTTPLocationTLSVersionGetParamsDateRange2d, radar.HTTPLocationTLSVersionGetParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DeviceType: cloudflare.F([]radar.HTTPLocationTLSVersionGetParamsDeviceType{radar.HTTPLocationTLSVersionGetParamsDeviceTypeDesktop, radar.HTTPLocationTLSVersionGetParamsDeviceTypeMobile, radar.HTTPLocationTLSVersionGetParamsDeviceTypeOther}),
+ Format: cloudflare.F(radar.HTTPLocationTLSVersionGetParamsFormatJson),
+ HTTPProtocol: cloudflare.F([]radar.HTTPLocationTLSVersionGetParamsHTTPProtocol{radar.HTTPLocationTLSVersionGetParamsHTTPProtocolHTTP, radar.HTTPLocationTLSVersionGetParamsHTTPProtocolHTTPS}),
+ HTTPVersion: cloudflare.F([]radar.HTTPLocationTLSVersionGetParamsHTTPVersion{radar.HTTPLocationTLSVersionGetParamsHTTPVersionHttPv1, radar.HTTPLocationTLSVersionGetParamsHTTPVersionHttPv2, radar.HTTPLocationTLSVersionGetParamsHTTPVersionHttPv3}),
+ IPVersion: cloudflare.F([]radar.HTTPLocationTLSVersionGetParamsIPVersion{radar.HTTPLocationTLSVersionGetParamsIPVersionIPv4, radar.HTTPLocationTLSVersionGetParamsIPVersionIPv6}),
+ Limit: cloudflare.F(int64(5)),
+ Location: cloudflare.F([]string{"string", "string", "string"}),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ OS: cloudflare.F([]radar.HTTPLocationTLSVersionGetParamsOS{radar.HTTPLocationTLSVersionGetParamsOSWindows, radar.HTTPLocationTLSVersionGetParamsOSMacosx, radar.HTTPLocationTLSVersionGetParamsOSIos}),
+ },
+ )
+ 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/radar/httpsummary.go b/radar/httpsummary.go
new file mode 100644
index 00000000000..1fd32b5a0ab
--- /dev/null
+++ b/radar/httpsummary.go
@@ -0,0 +1,2279 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "context"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// HTTPSummaryService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewHTTPSummaryService] method
+// instead.
+type HTTPSummaryService struct {
+ Options []option.RequestOption
+}
+
+// NewHTTPSummaryService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewHTTPSummaryService(opts ...option.RequestOption) (r *HTTPSummaryService) {
+ r = &HTTPSummaryService{}
+ r.Options = opts
+ return
+}
+
+// Percentage distribution of bot-generated traffic to genuine human traffic, as
+// classified by Cloudflare. Visit
+// https://developers.cloudflare.com/radar/concepts/bot-classes/ for more
+// information.
+func (r *HTTPSummaryService) BotClass(ctx context.Context, query HTTPSummaryBotClassParams, opts ...option.RequestOption) (res *HTTPSummaryBotClassResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env HTTPSummaryBotClassResponseEnvelope
+ path := "radar/http/summary/bot_class"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Percentage of Internet traffic generated by mobile, desktop, and other types of
+// devices, over a given time period.
+func (r *HTTPSummaryService) DeviceType(ctx context.Context, query HTTPSummaryDeviceTypeParams, opts ...option.RequestOption) (res *HTTPSummaryDeviceTypeResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env HTTPSummaryDeviceTypeResponseEnvelope
+ path := "radar/http/summary/device_type"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Percentage distribution of traffic per HTTP protocol over a given time period.
+func (r *HTTPSummaryService) HTTPProtocol(ctx context.Context, query HTTPSummaryHTTPProtocolParams, opts ...option.RequestOption) (res *HTTPSummaryHTTPProtocolResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env HTTPSummaryHTTPProtocolResponseEnvelope
+ path := "radar/http/summary/http_protocol"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Percentage distribution of traffic per HTTP protocol version over a given time
+// period.
+func (r *HTTPSummaryService) HTTPVersion(ctx context.Context, query HTTPSummaryHTTPVersionParams, opts ...option.RequestOption) (res *HTTPSummaryHTTPVersionResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env HTTPSummaryHTTPVersionResponseEnvelope
+ path := "radar/http/summary/http_version"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Percentage distribution of Internet traffic based on IP protocol versions, such
+// as IPv4 and IPv6, over a given time period.
+func (r *HTTPSummaryService) IPVersion(ctx context.Context, query HTTPSummaryIPVersionParams, opts ...option.RequestOption) (res *HTTPSummaryIPVersionResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env HTTPSummaryIPVersionResponseEnvelope
+ path := "radar/http/summary/ip_version"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Percentage distribution of Internet traffic generated by different operating
+// systems like Windows, macOS, Android, iOS, and others, over a given time period.
+func (r *HTTPSummaryService) OS(ctx context.Context, query HTTPSummaryOSParams, opts ...option.RequestOption) (res *HTTPSummaryOSResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env HTTPSummaryOSResponseEnvelope
+ path := "radar/http/summary/os"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Percentage distribution of traffic per TLS protocol version, over a given time
+// period.
+func (r *HTTPSummaryService) TLSVersion(ctx context.Context, query HTTPSummaryTLSVersionParams, opts ...option.RequestOption) (res *HTTPSummaryTLSVersionResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env HTTPSummaryTLSVersionResponseEnvelope
+ path := "radar/http/summary/tls_version"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type HTTPSummaryBotClassResponse struct {
+ Meta HTTPSummaryBotClassResponseMeta `json:"meta,required"`
+ Summary0 HTTPSummaryBotClassResponseSummary0 `json:"summary_0,required"`
+ JSON httpSummaryBotClassResponseJSON `json:"-"`
+}
+
+// httpSummaryBotClassResponseJSON contains the JSON metadata for the struct
+// [HTTPSummaryBotClassResponse]
+type httpSummaryBotClassResponseJSON struct {
+ Meta apijson.Field
+ Summary0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPSummaryBotClassResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpSummaryBotClassResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPSummaryBotClassResponseMeta struct {
+ DateRange []HTTPSummaryBotClassResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ Normalization string `json:"normalization,required"`
+ ConfidenceInfo HTTPSummaryBotClassResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON httpSummaryBotClassResponseMetaJSON `json:"-"`
+}
+
+// httpSummaryBotClassResponseMetaJSON contains the JSON metadata for the struct
+// [HTTPSummaryBotClassResponseMeta]
+type httpSummaryBotClassResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ Normalization apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPSummaryBotClassResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpSummaryBotClassResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPSummaryBotClassResponseMetaDateRange 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 httpSummaryBotClassResponseMetaDateRangeJSON `json:"-"`
+}
+
+// httpSummaryBotClassResponseMetaDateRangeJSON contains the JSON metadata for the
+// struct [HTTPSummaryBotClassResponseMetaDateRange]
+type httpSummaryBotClassResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPSummaryBotClassResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpSummaryBotClassResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPSummaryBotClassResponseMetaConfidenceInfo struct {
+ Annotations []HTTPSummaryBotClassResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON httpSummaryBotClassResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// httpSummaryBotClassResponseMetaConfidenceInfoJSON contains the JSON metadata for
+// the struct [HTTPSummaryBotClassResponseMetaConfidenceInfo]
+type httpSummaryBotClassResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPSummaryBotClassResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpSummaryBotClassResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPSummaryBotClassResponseMetaConfidenceInfoAnnotation 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 httpSummaryBotClassResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// httpSummaryBotClassResponseMetaConfidenceInfoAnnotationJSON contains the JSON
+// metadata for the struct
+// [HTTPSummaryBotClassResponseMetaConfidenceInfoAnnotation]
+type httpSummaryBotClassResponseMetaConfidenceInfoAnnotationJSON 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 *HTTPSummaryBotClassResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpSummaryBotClassResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPSummaryBotClassResponseSummary0 struct {
+ Bot string `json:"bot,required"`
+ Human string `json:"human,required"`
+ JSON httpSummaryBotClassResponseSummary0JSON `json:"-"`
+}
+
+// httpSummaryBotClassResponseSummary0JSON contains the JSON metadata for the
+// struct [HTTPSummaryBotClassResponseSummary0]
+type httpSummaryBotClassResponseSummary0JSON struct {
+ Bot apijson.Field
+ Human apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPSummaryBotClassResponseSummary0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpSummaryBotClassResponseSummary0JSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPSummaryDeviceTypeResponse struct {
+ Meta HTTPSummaryDeviceTypeResponseMeta `json:"meta,required"`
+ Summary0 HTTPSummaryDeviceTypeResponseSummary0 `json:"summary_0,required"`
+ JSON httpSummaryDeviceTypeResponseJSON `json:"-"`
+}
+
+// httpSummaryDeviceTypeResponseJSON contains the JSON metadata for the struct
+// [HTTPSummaryDeviceTypeResponse]
+type httpSummaryDeviceTypeResponseJSON struct {
+ Meta apijson.Field
+ Summary0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPSummaryDeviceTypeResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpSummaryDeviceTypeResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPSummaryDeviceTypeResponseMeta struct {
+ DateRange []HTTPSummaryDeviceTypeResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ Normalization string `json:"normalization,required"`
+ ConfidenceInfo HTTPSummaryDeviceTypeResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON httpSummaryDeviceTypeResponseMetaJSON `json:"-"`
+}
+
+// httpSummaryDeviceTypeResponseMetaJSON contains the JSON metadata for the struct
+// [HTTPSummaryDeviceTypeResponseMeta]
+type httpSummaryDeviceTypeResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ Normalization apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPSummaryDeviceTypeResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpSummaryDeviceTypeResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPSummaryDeviceTypeResponseMetaDateRange 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 httpSummaryDeviceTypeResponseMetaDateRangeJSON `json:"-"`
+}
+
+// httpSummaryDeviceTypeResponseMetaDateRangeJSON contains the JSON metadata for
+// the struct [HTTPSummaryDeviceTypeResponseMetaDateRange]
+type httpSummaryDeviceTypeResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPSummaryDeviceTypeResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpSummaryDeviceTypeResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPSummaryDeviceTypeResponseMetaConfidenceInfo struct {
+ Annotations []HTTPSummaryDeviceTypeResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON httpSummaryDeviceTypeResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// httpSummaryDeviceTypeResponseMetaConfidenceInfoJSON contains the JSON metadata
+// for the struct [HTTPSummaryDeviceTypeResponseMetaConfidenceInfo]
+type httpSummaryDeviceTypeResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPSummaryDeviceTypeResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpSummaryDeviceTypeResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPSummaryDeviceTypeResponseMetaConfidenceInfoAnnotation 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 httpSummaryDeviceTypeResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// httpSummaryDeviceTypeResponseMetaConfidenceInfoAnnotationJSON contains the JSON
+// metadata for the struct
+// [HTTPSummaryDeviceTypeResponseMetaConfidenceInfoAnnotation]
+type httpSummaryDeviceTypeResponseMetaConfidenceInfoAnnotationJSON 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 *HTTPSummaryDeviceTypeResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpSummaryDeviceTypeResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPSummaryDeviceTypeResponseSummary0 struct {
+ Desktop string `json:"desktop,required"`
+ Mobile string `json:"mobile,required"`
+ Other string `json:"other,required"`
+ JSON httpSummaryDeviceTypeResponseSummary0JSON `json:"-"`
+}
+
+// httpSummaryDeviceTypeResponseSummary0JSON contains the JSON metadata for the
+// struct [HTTPSummaryDeviceTypeResponseSummary0]
+type httpSummaryDeviceTypeResponseSummary0JSON struct {
+ Desktop apijson.Field
+ Mobile apijson.Field
+ Other apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPSummaryDeviceTypeResponseSummary0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpSummaryDeviceTypeResponseSummary0JSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPSummaryHTTPProtocolResponse struct {
+ Meta HTTPSummaryHTTPProtocolResponseMeta `json:"meta,required"`
+ Summary0 HTTPSummaryHTTPProtocolResponseSummary0 `json:"summary_0,required"`
+ JSON httpSummaryHTTPProtocolResponseJSON `json:"-"`
+}
+
+// httpSummaryHTTPProtocolResponseJSON contains the JSON metadata for the struct
+// [HTTPSummaryHTTPProtocolResponse]
+type httpSummaryHTTPProtocolResponseJSON struct {
+ Meta apijson.Field
+ Summary0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPSummaryHTTPProtocolResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpSummaryHTTPProtocolResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPSummaryHTTPProtocolResponseMeta struct {
+ DateRange []HTTPSummaryHTTPProtocolResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ Normalization string `json:"normalization,required"`
+ ConfidenceInfo HTTPSummaryHTTPProtocolResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON httpSummaryHTTPProtocolResponseMetaJSON `json:"-"`
+}
+
+// httpSummaryHTTPProtocolResponseMetaJSON contains the JSON metadata for the
+// struct [HTTPSummaryHTTPProtocolResponseMeta]
+type httpSummaryHTTPProtocolResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ Normalization apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPSummaryHTTPProtocolResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpSummaryHTTPProtocolResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPSummaryHTTPProtocolResponseMetaDateRange 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 httpSummaryHTTPProtocolResponseMetaDateRangeJSON `json:"-"`
+}
+
+// httpSummaryHTTPProtocolResponseMetaDateRangeJSON contains the JSON metadata for
+// the struct [HTTPSummaryHTTPProtocolResponseMetaDateRange]
+type httpSummaryHTTPProtocolResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPSummaryHTTPProtocolResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpSummaryHTTPProtocolResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPSummaryHTTPProtocolResponseMetaConfidenceInfo struct {
+ Annotations []HTTPSummaryHTTPProtocolResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON httpSummaryHTTPProtocolResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// httpSummaryHTTPProtocolResponseMetaConfidenceInfoJSON contains the JSON metadata
+// for the struct [HTTPSummaryHTTPProtocolResponseMetaConfidenceInfo]
+type httpSummaryHTTPProtocolResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPSummaryHTTPProtocolResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpSummaryHTTPProtocolResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPSummaryHTTPProtocolResponseMetaConfidenceInfoAnnotation 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 httpSummaryHTTPProtocolResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// httpSummaryHTTPProtocolResponseMetaConfidenceInfoAnnotationJSON contains the
+// JSON metadata for the struct
+// [HTTPSummaryHTTPProtocolResponseMetaConfidenceInfoAnnotation]
+type httpSummaryHTTPProtocolResponseMetaConfidenceInfoAnnotationJSON 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 *HTTPSummaryHTTPProtocolResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpSummaryHTTPProtocolResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPSummaryHTTPProtocolResponseSummary0 struct {
+ HTTP string `json:"http,required"`
+ HTTPS string `json:"https,required"`
+ JSON httpSummaryHTTPProtocolResponseSummary0JSON `json:"-"`
+}
+
+// httpSummaryHTTPProtocolResponseSummary0JSON contains the JSON metadata for the
+// struct [HTTPSummaryHTTPProtocolResponseSummary0]
+type httpSummaryHTTPProtocolResponseSummary0JSON struct {
+ HTTP apijson.Field
+ HTTPS apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPSummaryHTTPProtocolResponseSummary0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpSummaryHTTPProtocolResponseSummary0JSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPSummaryHTTPVersionResponse struct {
+ Meta HTTPSummaryHTTPVersionResponseMeta `json:"meta,required"`
+ Summary0 HTTPSummaryHTTPVersionResponseSummary0 `json:"summary_0,required"`
+ JSON httpSummaryHTTPVersionResponseJSON `json:"-"`
+}
+
+// httpSummaryHTTPVersionResponseJSON contains the JSON metadata for the struct
+// [HTTPSummaryHTTPVersionResponse]
+type httpSummaryHTTPVersionResponseJSON struct {
+ Meta apijson.Field
+ Summary0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPSummaryHTTPVersionResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpSummaryHTTPVersionResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPSummaryHTTPVersionResponseMeta struct {
+ DateRange []HTTPSummaryHTTPVersionResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ Normalization string `json:"normalization,required"`
+ ConfidenceInfo HTTPSummaryHTTPVersionResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON httpSummaryHTTPVersionResponseMetaJSON `json:"-"`
+}
+
+// httpSummaryHTTPVersionResponseMetaJSON contains the JSON metadata for the struct
+// [HTTPSummaryHTTPVersionResponseMeta]
+type httpSummaryHTTPVersionResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ Normalization apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPSummaryHTTPVersionResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpSummaryHTTPVersionResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPSummaryHTTPVersionResponseMetaDateRange 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 httpSummaryHTTPVersionResponseMetaDateRangeJSON `json:"-"`
+}
+
+// httpSummaryHTTPVersionResponseMetaDateRangeJSON contains the JSON metadata for
+// the struct [HTTPSummaryHTTPVersionResponseMetaDateRange]
+type httpSummaryHTTPVersionResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPSummaryHTTPVersionResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpSummaryHTTPVersionResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPSummaryHTTPVersionResponseMetaConfidenceInfo struct {
+ Annotations []HTTPSummaryHTTPVersionResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON httpSummaryHTTPVersionResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// httpSummaryHTTPVersionResponseMetaConfidenceInfoJSON contains the JSON metadata
+// for the struct [HTTPSummaryHTTPVersionResponseMetaConfidenceInfo]
+type httpSummaryHTTPVersionResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPSummaryHTTPVersionResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpSummaryHTTPVersionResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPSummaryHTTPVersionResponseMetaConfidenceInfoAnnotation 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 httpSummaryHTTPVersionResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// httpSummaryHTTPVersionResponseMetaConfidenceInfoAnnotationJSON contains the JSON
+// metadata for the struct
+// [HTTPSummaryHTTPVersionResponseMetaConfidenceInfoAnnotation]
+type httpSummaryHTTPVersionResponseMetaConfidenceInfoAnnotationJSON 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 *HTTPSummaryHTTPVersionResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpSummaryHTTPVersionResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPSummaryHTTPVersionResponseSummary0 struct {
+ HTTP1X string `json:"HTTP/1.x,required"`
+ HTTP2 string `json:"HTTP/2,required"`
+ HTTP3 string `json:"HTTP/3,required"`
+ JSON httpSummaryHTTPVersionResponseSummary0JSON `json:"-"`
+}
+
+// httpSummaryHTTPVersionResponseSummary0JSON contains the JSON metadata for the
+// struct [HTTPSummaryHTTPVersionResponseSummary0]
+type httpSummaryHTTPVersionResponseSummary0JSON struct {
+ HTTP1X apijson.Field
+ HTTP2 apijson.Field
+ HTTP3 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPSummaryHTTPVersionResponseSummary0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpSummaryHTTPVersionResponseSummary0JSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPSummaryIPVersionResponse struct {
+ Meta HTTPSummaryIPVersionResponseMeta `json:"meta,required"`
+ Summary0 HTTPSummaryIPVersionResponseSummary0 `json:"summary_0,required"`
+ JSON httpSummaryIPVersionResponseJSON `json:"-"`
+}
+
+// httpSummaryIPVersionResponseJSON contains the JSON metadata for the struct
+// [HTTPSummaryIPVersionResponse]
+type httpSummaryIPVersionResponseJSON struct {
+ Meta apijson.Field
+ Summary0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPSummaryIPVersionResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpSummaryIPVersionResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPSummaryIPVersionResponseMeta struct {
+ DateRange []HTTPSummaryIPVersionResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ Normalization string `json:"normalization,required"`
+ ConfidenceInfo HTTPSummaryIPVersionResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON httpSummaryIPVersionResponseMetaJSON `json:"-"`
+}
+
+// httpSummaryIPVersionResponseMetaJSON contains the JSON metadata for the struct
+// [HTTPSummaryIPVersionResponseMeta]
+type httpSummaryIPVersionResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ Normalization apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPSummaryIPVersionResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpSummaryIPVersionResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPSummaryIPVersionResponseMetaDateRange 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 httpSummaryIPVersionResponseMetaDateRangeJSON `json:"-"`
+}
+
+// httpSummaryIPVersionResponseMetaDateRangeJSON contains the JSON metadata for the
+// struct [HTTPSummaryIPVersionResponseMetaDateRange]
+type httpSummaryIPVersionResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPSummaryIPVersionResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpSummaryIPVersionResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPSummaryIPVersionResponseMetaConfidenceInfo struct {
+ Annotations []HTTPSummaryIPVersionResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON httpSummaryIPVersionResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// httpSummaryIPVersionResponseMetaConfidenceInfoJSON contains the JSON metadata
+// for the struct [HTTPSummaryIPVersionResponseMetaConfidenceInfo]
+type httpSummaryIPVersionResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPSummaryIPVersionResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpSummaryIPVersionResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPSummaryIPVersionResponseMetaConfidenceInfoAnnotation 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 httpSummaryIPVersionResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// httpSummaryIPVersionResponseMetaConfidenceInfoAnnotationJSON contains the JSON
+// metadata for the struct
+// [HTTPSummaryIPVersionResponseMetaConfidenceInfoAnnotation]
+type httpSummaryIPVersionResponseMetaConfidenceInfoAnnotationJSON 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 *HTTPSummaryIPVersionResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpSummaryIPVersionResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPSummaryIPVersionResponseSummary0 struct {
+ IPv4 string `json:"IPv4,required"`
+ IPv6 string `json:"IPv6,required"`
+ JSON httpSummaryIPVersionResponseSummary0JSON `json:"-"`
+}
+
+// httpSummaryIPVersionResponseSummary0JSON contains the JSON metadata for the
+// struct [HTTPSummaryIPVersionResponseSummary0]
+type httpSummaryIPVersionResponseSummary0JSON struct {
+ IPv4 apijson.Field
+ IPv6 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPSummaryIPVersionResponseSummary0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpSummaryIPVersionResponseSummary0JSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPSummaryOSResponse struct {
+ Meta HTTPSummaryOSResponseMeta `json:"meta,required"`
+ Summary0 HTTPSummaryOSResponseSummary0 `json:"summary_0,required"`
+ JSON httpSummaryOSResponseJSON `json:"-"`
+}
+
+// httpSummaryOSResponseJSON contains the JSON metadata for the struct
+// [HTTPSummaryOSResponse]
+type httpSummaryOSResponseJSON struct {
+ Meta apijson.Field
+ Summary0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPSummaryOSResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpSummaryOSResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPSummaryOSResponseMeta struct {
+ DateRange []HTTPSummaryOSResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ Normalization string `json:"normalization,required"`
+ ConfidenceInfo HTTPSummaryOSResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON httpSummaryOSResponseMetaJSON `json:"-"`
+}
+
+// httpSummaryOSResponseMetaJSON contains the JSON metadata for the struct
+// [HTTPSummaryOSResponseMeta]
+type httpSummaryOSResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ Normalization apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPSummaryOSResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpSummaryOSResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPSummaryOSResponseMetaDateRange 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 httpSummaryOSResponseMetaDateRangeJSON `json:"-"`
+}
+
+// httpSummaryOSResponseMetaDateRangeJSON contains the JSON metadata for the struct
+// [HTTPSummaryOSResponseMetaDateRange]
+type httpSummaryOSResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPSummaryOSResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpSummaryOSResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPSummaryOSResponseMetaConfidenceInfo struct {
+ Annotations []HTTPSummaryOSResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON httpSummaryOSResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// httpSummaryOSResponseMetaConfidenceInfoJSON contains the JSON metadata for the
+// struct [HTTPSummaryOSResponseMetaConfidenceInfo]
+type httpSummaryOSResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPSummaryOSResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpSummaryOSResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPSummaryOSResponseMetaConfidenceInfoAnnotation 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 httpSummaryOSResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// httpSummaryOSResponseMetaConfidenceInfoAnnotationJSON contains the JSON metadata
+// for the struct [HTTPSummaryOSResponseMetaConfidenceInfoAnnotation]
+type httpSummaryOSResponseMetaConfidenceInfoAnnotationJSON 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 *HTTPSummaryOSResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpSummaryOSResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPSummaryOSResponseSummary0 struct {
+ Android string `json:"ANDROID,required"`
+ Ios string `json:"IOS,required"`
+ JSON httpSummaryOSResponseSummary0JSON `json:"-"`
+}
+
+// httpSummaryOSResponseSummary0JSON contains the JSON metadata for the struct
+// [HTTPSummaryOSResponseSummary0]
+type httpSummaryOSResponseSummary0JSON struct {
+ Android apijson.Field
+ Ios apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPSummaryOSResponseSummary0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpSummaryOSResponseSummary0JSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPSummaryTLSVersionResponse struct {
+ Meta HTTPSummaryTLSVersionResponseMeta `json:"meta,required"`
+ Summary0 HTTPSummaryTLSVersionResponseSummary0 `json:"summary_0,required"`
+ JSON httpSummaryTLSVersionResponseJSON `json:"-"`
+}
+
+// httpSummaryTLSVersionResponseJSON contains the JSON metadata for the struct
+// [HTTPSummaryTLSVersionResponse]
+type httpSummaryTLSVersionResponseJSON struct {
+ Meta apijson.Field
+ Summary0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPSummaryTLSVersionResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpSummaryTLSVersionResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPSummaryTLSVersionResponseMeta struct {
+ DateRange []HTTPSummaryTLSVersionResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ Normalization string `json:"normalization,required"`
+ ConfidenceInfo HTTPSummaryTLSVersionResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON httpSummaryTLSVersionResponseMetaJSON `json:"-"`
+}
+
+// httpSummaryTLSVersionResponseMetaJSON contains the JSON metadata for the struct
+// [HTTPSummaryTLSVersionResponseMeta]
+type httpSummaryTLSVersionResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ Normalization apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPSummaryTLSVersionResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpSummaryTLSVersionResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPSummaryTLSVersionResponseMetaDateRange 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 httpSummaryTLSVersionResponseMetaDateRangeJSON `json:"-"`
+}
+
+// httpSummaryTLSVersionResponseMetaDateRangeJSON contains the JSON metadata for
+// the struct [HTTPSummaryTLSVersionResponseMetaDateRange]
+type httpSummaryTLSVersionResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPSummaryTLSVersionResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpSummaryTLSVersionResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPSummaryTLSVersionResponseMetaConfidenceInfo struct {
+ Annotations []HTTPSummaryTLSVersionResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON httpSummaryTLSVersionResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// httpSummaryTLSVersionResponseMetaConfidenceInfoJSON contains the JSON metadata
+// for the struct [HTTPSummaryTLSVersionResponseMetaConfidenceInfo]
+type httpSummaryTLSVersionResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPSummaryTLSVersionResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpSummaryTLSVersionResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPSummaryTLSVersionResponseMetaConfidenceInfoAnnotation 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 httpSummaryTLSVersionResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// httpSummaryTLSVersionResponseMetaConfidenceInfoAnnotationJSON contains the JSON
+// metadata for the struct
+// [HTTPSummaryTLSVersionResponseMetaConfidenceInfoAnnotation]
+type httpSummaryTLSVersionResponseMetaConfidenceInfoAnnotationJSON 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 *HTTPSummaryTLSVersionResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpSummaryTLSVersionResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPSummaryTLSVersionResponseSummary0 struct {
+ TLS1_0 string `json:"TLS 1.0,required"`
+ TLS1_1 string `json:"TLS 1.1,required"`
+ TLS1_2 string `json:"TLS 1.2,required"`
+ TLS1_3 string `json:"TLS 1.3,required"`
+ TLSQuic string `json:"TLS QUIC,required"`
+ JSON httpSummaryTLSVersionResponseSummary0JSON `json:"-"`
+}
+
+// httpSummaryTLSVersionResponseSummary0JSON contains the JSON metadata for the
+// struct [HTTPSummaryTLSVersionResponseSummary0]
+type httpSummaryTLSVersionResponseSummary0JSON struct {
+ TLS1_0 apijson.Field
+ TLS1_1 apijson.Field
+ TLS1_2 apijson.Field
+ TLS1_3 apijson.Field
+ TLSQuic apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPSummaryTLSVersionResponseSummary0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpSummaryTLSVersionResponseSummary0JSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPSummaryBotClassParams 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"`
+ // 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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]HTTPSummaryBotClassParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Filter for device type.
+ DeviceType param.Field[[]HTTPSummaryBotClassParamsDeviceType] `query:"deviceType"`
+ // Format results are returned in.
+ Format param.Field[HTTPSummaryBotClassParamsFormat] `query:"format"`
+ // Filter for http protocol.
+ HTTPProtocol param.Field[[]HTTPSummaryBotClassParamsHTTPProtocol] `query:"httpProtocol"`
+ // Filter for http version.
+ HTTPVersion param.Field[[]HTTPSummaryBotClassParamsHTTPVersion] `query:"httpVersion"`
+ // Filter for ip version.
+ IPVersion param.Field[[]HTTPSummaryBotClassParamsIPVersion] `query:"ipVersion"`
+ // 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 os name.
+ OS param.Field[[]HTTPSummaryBotClassParamsOS] `query:"os"`
+ // Filter for tls version.
+ TLSVersion param.Field[[]HTTPSummaryBotClassParamsTLSVersion] `query:"tlsVersion"`
+}
+
+// URLQuery serializes [HTTPSummaryBotClassParams]'s query parameters as
+// `url.Values`.
+func (r HTTPSummaryBotClassParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type HTTPSummaryBotClassParamsDateRange string
+
+const (
+ HTTPSummaryBotClassParamsDateRange1d HTTPSummaryBotClassParamsDateRange = "1d"
+ HTTPSummaryBotClassParamsDateRange2d HTTPSummaryBotClassParamsDateRange = "2d"
+ HTTPSummaryBotClassParamsDateRange7d HTTPSummaryBotClassParamsDateRange = "7d"
+ HTTPSummaryBotClassParamsDateRange14d HTTPSummaryBotClassParamsDateRange = "14d"
+ HTTPSummaryBotClassParamsDateRange28d HTTPSummaryBotClassParamsDateRange = "28d"
+ HTTPSummaryBotClassParamsDateRange12w HTTPSummaryBotClassParamsDateRange = "12w"
+ HTTPSummaryBotClassParamsDateRange24w HTTPSummaryBotClassParamsDateRange = "24w"
+ HTTPSummaryBotClassParamsDateRange52w HTTPSummaryBotClassParamsDateRange = "52w"
+ HTTPSummaryBotClassParamsDateRange1dControl HTTPSummaryBotClassParamsDateRange = "1dControl"
+ HTTPSummaryBotClassParamsDateRange2dControl HTTPSummaryBotClassParamsDateRange = "2dControl"
+ HTTPSummaryBotClassParamsDateRange7dControl HTTPSummaryBotClassParamsDateRange = "7dControl"
+ HTTPSummaryBotClassParamsDateRange14dControl HTTPSummaryBotClassParamsDateRange = "14dControl"
+ HTTPSummaryBotClassParamsDateRange28dControl HTTPSummaryBotClassParamsDateRange = "28dControl"
+ HTTPSummaryBotClassParamsDateRange12wControl HTTPSummaryBotClassParamsDateRange = "12wControl"
+ HTTPSummaryBotClassParamsDateRange24wControl HTTPSummaryBotClassParamsDateRange = "24wControl"
+)
+
+type HTTPSummaryBotClassParamsDeviceType string
+
+const (
+ HTTPSummaryBotClassParamsDeviceTypeDesktop HTTPSummaryBotClassParamsDeviceType = "DESKTOP"
+ HTTPSummaryBotClassParamsDeviceTypeMobile HTTPSummaryBotClassParamsDeviceType = "MOBILE"
+ HTTPSummaryBotClassParamsDeviceTypeOther HTTPSummaryBotClassParamsDeviceType = "OTHER"
+)
+
+// Format results are returned in.
+type HTTPSummaryBotClassParamsFormat string
+
+const (
+ HTTPSummaryBotClassParamsFormatJson HTTPSummaryBotClassParamsFormat = "JSON"
+ HTTPSummaryBotClassParamsFormatCsv HTTPSummaryBotClassParamsFormat = "CSV"
+)
+
+type HTTPSummaryBotClassParamsHTTPProtocol string
+
+const (
+ HTTPSummaryBotClassParamsHTTPProtocolHTTP HTTPSummaryBotClassParamsHTTPProtocol = "HTTP"
+ HTTPSummaryBotClassParamsHTTPProtocolHTTPS HTTPSummaryBotClassParamsHTTPProtocol = "HTTPS"
+)
+
+type HTTPSummaryBotClassParamsHTTPVersion string
+
+const (
+ HTTPSummaryBotClassParamsHTTPVersionHttPv1 HTTPSummaryBotClassParamsHTTPVersion = "HTTPv1"
+ HTTPSummaryBotClassParamsHTTPVersionHttPv2 HTTPSummaryBotClassParamsHTTPVersion = "HTTPv2"
+ HTTPSummaryBotClassParamsHTTPVersionHttPv3 HTTPSummaryBotClassParamsHTTPVersion = "HTTPv3"
+)
+
+type HTTPSummaryBotClassParamsIPVersion string
+
+const (
+ HTTPSummaryBotClassParamsIPVersionIPv4 HTTPSummaryBotClassParamsIPVersion = "IPv4"
+ HTTPSummaryBotClassParamsIPVersionIPv6 HTTPSummaryBotClassParamsIPVersion = "IPv6"
+)
+
+type HTTPSummaryBotClassParamsOS string
+
+const (
+ HTTPSummaryBotClassParamsOSWindows HTTPSummaryBotClassParamsOS = "WINDOWS"
+ HTTPSummaryBotClassParamsOSMacosx HTTPSummaryBotClassParamsOS = "MACOSX"
+ HTTPSummaryBotClassParamsOSIos HTTPSummaryBotClassParamsOS = "IOS"
+ HTTPSummaryBotClassParamsOSAndroid HTTPSummaryBotClassParamsOS = "ANDROID"
+ HTTPSummaryBotClassParamsOSChromeos HTTPSummaryBotClassParamsOS = "CHROMEOS"
+ HTTPSummaryBotClassParamsOSLinux HTTPSummaryBotClassParamsOS = "LINUX"
+ HTTPSummaryBotClassParamsOSSmartTv HTTPSummaryBotClassParamsOS = "SMART_TV"
+)
+
+type HTTPSummaryBotClassParamsTLSVersion string
+
+const (
+ HTTPSummaryBotClassParamsTLSVersionTlSv1_0 HTTPSummaryBotClassParamsTLSVersion = "TLSv1_0"
+ HTTPSummaryBotClassParamsTLSVersionTlSv1_1 HTTPSummaryBotClassParamsTLSVersion = "TLSv1_1"
+ HTTPSummaryBotClassParamsTLSVersionTlSv1_2 HTTPSummaryBotClassParamsTLSVersion = "TLSv1_2"
+ HTTPSummaryBotClassParamsTLSVersionTlSv1_3 HTTPSummaryBotClassParamsTLSVersion = "TLSv1_3"
+ HTTPSummaryBotClassParamsTLSVersionTlSvQuic HTTPSummaryBotClassParamsTLSVersion = "TLSvQUIC"
+)
+
+type HTTPSummaryBotClassResponseEnvelope struct {
+ Result HTTPSummaryBotClassResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON httpSummaryBotClassResponseEnvelopeJSON `json:"-"`
+}
+
+// httpSummaryBotClassResponseEnvelopeJSON contains the JSON metadata for the
+// struct [HTTPSummaryBotClassResponseEnvelope]
+type httpSummaryBotClassResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPSummaryBotClassResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpSummaryBotClassResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPSummaryDeviceTypeParams 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"`
+ // Filter for bot class. Refer to
+ // [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/).
+ BotClass param.Field[[]HTTPSummaryDeviceTypeParamsBotClass] `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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]HTTPSummaryDeviceTypeParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Format results are returned in.
+ Format param.Field[HTTPSummaryDeviceTypeParamsFormat] `query:"format"`
+ // Filter for http protocol.
+ HTTPProtocol param.Field[[]HTTPSummaryDeviceTypeParamsHTTPProtocol] `query:"httpProtocol"`
+ // Filter for http version.
+ HTTPVersion param.Field[[]HTTPSummaryDeviceTypeParamsHTTPVersion] `query:"httpVersion"`
+ // Filter for ip version.
+ IPVersion param.Field[[]HTTPSummaryDeviceTypeParamsIPVersion] `query:"ipVersion"`
+ // 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 os name.
+ OS param.Field[[]HTTPSummaryDeviceTypeParamsOS] `query:"os"`
+ // Filter for tls version.
+ TLSVersion param.Field[[]HTTPSummaryDeviceTypeParamsTLSVersion] `query:"tlsVersion"`
+}
+
+// URLQuery serializes [HTTPSummaryDeviceTypeParams]'s query parameters as
+// `url.Values`.
+func (r HTTPSummaryDeviceTypeParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type HTTPSummaryDeviceTypeParamsBotClass string
+
+const (
+ HTTPSummaryDeviceTypeParamsBotClassLikelyAutomated HTTPSummaryDeviceTypeParamsBotClass = "LIKELY_AUTOMATED"
+ HTTPSummaryDeviceTypeParamsBotClassLikelyHuman HTTPSummaryDeviceTypeParamsBotClass = "LIKELY_HUMAN"
+)
+
+type HTTPSummaryDeviceTypeParamsDateRange string
+
+const (
+ HTTPSummaryDeviceTypeParamsDateRange1d HTTPSummaryDeviceTypeParamsDateRange = "1d"
+ HTTPSummaryDeviceTypeParamsDateRange2d HTTPSummaryDeviceTypeParamsDateRange = "2d"
+ HTTPSummaryDeviceTypeParamsDateRange7d HTTPSummaryDeviceTypeParamsDateRange = "7d"
+ HTTPSummaryDeviceTypeParamsDateRange14d HTTPSummaryDeviceTypeParamsDateRange = "14d"
+ HTTPSummaryDeviceTypeParamsDateRange28d HTTPSummaryDeviceTypeParamsDateRange = "28d"
+ HTTPSummaryDeviceTypeParamsDateRange12w HTTPSummaryDeviceTypeParamsDateRange = "12w"
+ HTTPSummaryDeviceTypeParamsDateRange24w HTTPSummaryDeviceTypeParamsDateRange = "24w"
+ HTTPSummaryDeviceTypeParamsDateRange52w HTTPSummaryDeviceTypeParamsDateRange = "52w"
+ HTTPSummaryDeviceTypeParamsDateRange1dControl HTTPSummaryDeviceTypeParamsDateRange = "1dControl"
+ HTTPSummaryDeviceTypeParamsDateRange2dControl HTTPSummaryDeviceTypeParamsDateRange = "2dControl"
+ HTTPSummaryDeviceTypeParamsDateRange7dControl HTTPSummaryDeviceTypeParamsDateRange = "7dControl"
+ HTTPSummaryDeviceTypeParamsDateRange14dControl HTTPSummaryDeviceTypeParamsDateRange = "14dControl"
+ HTTPSummaryDeviceTypeParamsDateRange28dControl HTTPSummaryDeviceTypeParamsDateRange = "28dControl"
+ HTTPSummaryDeviceTypeParamsDateRange12wControl HTTPSummaryDeviceTypeParamsDateRange = "12wControl"
+ HTTPSummaryDeviceTypeParamsDateRange24wControl HTTPSummaryDeviceTypeParamsDateRange = "24wControl"
+)
+
+// Format results are returned in.
+type HTTPSummaryDeviceTypeParamsFormat string
+
+const (
+ HTTPSummaryDeviceTypeParamsFormatJson HTTPSummaryDeviceTypeParamsFormat = "JSON"
+ HTTPSummaryDeviceTypeParamsFormatCsv HTTPSummaryDeviceTypeParamsFormat = "CSV"
+)
+
+type HTTPSummaryDeviceTypeParamsHTTPProtocol string
+
+const (
+ HTTPSummaryDeviceTypeParamsHTTPProtocolHTTP HTTPSummaryDeviceTypeParamsHTTPProtocol = "HTTP"
+ HTTPSummaryDeviceTypeParamsHTTPProtocolHTTPS HTTPSummaryDeviceTypeParamsHTTPProtocol = "HTTPS"
+)
+
+type HTTPSummaryDeviceTypeParamsHTTPVersion string
+
+const (
+ HTTPSummaryDeviceTypeParamsHTTPVersionHttPv1 HTTPSummaryDeviceTypeParamsHTTPVersion = "HTTPv1"
+ HTTPSummaryDeviceTypeParamsHTTPVersionHttPv2 HTTPSummaryDeviceTypeParamsHTTPVersion = "HTTPv2"
+ HTTPSummaryDeviceTypeParamsHTTPVersionHttPv3 HTTPSummaryDeviceTypeParamsHTTPVersion = "HTTPv3"
+)
+
+type HTTPSummaryDeviceTypeParamsIPVersion string
+
+const (
+ HTTPSummaryDeviceTypeParamsIPVersionIPv4 HTTPSummaryDeviceTypeParamsIPVersion = "IPv4"
+ HTTPSummaryDeviceTypeParamsIPVersionIPv6 HTTPSummaryDeviceTypeParamsIPVersion = "IPv6"
+)
+
+type HTTPSummaryDeviceTypeParamsOS string
+
+const (
+ HTTPSummaryDeviceTypeParamsOSWindows HTTPSummaryDeviceTypeParamsOS = "WINDOWS"
+ HTTPSummaryDeviceTypeParamsOSMacosx HTTPSummaryDeviceTypeParamsOS = "MACOSX"
+ HTTPSummaryDeviceTypeParamsOSIos HTTPSummaryDeviceTypeParamsOS = "IOS"
+ HTTPSummaryDeviceTypeParamsOSAndroid HTTPSummaryDeviceTypeParamsOS = "ANDROID"
+ HTTPSummaryDeviceTypeParamsOSChromeos HTTPSummaryDeviceTypeParamsOS = "CHROMEOS"
+ HTTPSummaryDeviceTypeParamsOSLinux HTTPSummaryDeviceTypeParamsOS = "LINUX"
+ HTTPSummaryDeviceTypeParamsOSSmartTv HTTPSummaryDeviceTypeParamsOS = "SMART_TV"
+)
+
+type HTTPSummaryDeviceTypeParamsTLSVersion string
+
+const (
+ HTTPSummaryDeviceTypeParamsTLSVersionTlSv1_0 HTTPSummaryDeviceTypeParamsTLSVersion = "TLSv1_0"
+ HTTPSummaryDeviceTypeParamsTLSVersionTlSv1_1 HTTPSummaryDeviceTypeParamsTLSVersion = "TLSv1_1"
+ HTTPSummaryDeviceTypeParamsTLSVersionTlSv1_2 HTTPSummaryDeviceTypeParamsTLSVersion = "TLSv1_2"
+ HTTPSummaryDeviceTypeParamsTLSVersionTlSv1_3 HTTPSummaryDeviceTypeParamsTLSVersion = "TLSv1_3"
+ HTTPSummaryDeviceTypeParamsTLSVersionTlSvQuic HTTPSummaryDeviceTypeParamsTLSVersion = "TLSvQUIC"
+)
+
+type HTTPSummaryDeviceTypeResponseEnvelope struct {
+ Result HTTPSummaryDeviceTypeResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON httpSummaryDeviceTypeResponseEnvelopeJSON `json:"-"`
+}
+
+// httpSummaryDeviceTypeResponseEnvelopeJSON contains the JSON metadata for the
+// struct [HTTPSummaryDeviceTypeResponseEnvelope]
+type httpSummaryDeviceTypeResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPSummaryDeviceTypeResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpSummaryDeviceTypeResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPSummaryHTTPProtocolParams 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"`
+ // Filter for bot class. Refer to
+ // [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/).
+ BotClass param.Field[[]HTTPSummaryHTTPProtocolParamsBotClass] `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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]HTTPSummaryHTTPProtocolParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Filter for device type.
+ DeviceType param.Field[[]HTTPSummaryHTTPProtocolParamsDeviceType] `query:"deviceType"`
+ // Format results are returned in.
+ Format param.Field[HTTPSummaryHTTPProtocolParamsFormat] `query:"format"`
+ // Filter for http version.
+ HTTPVersion param.Field[[]HTTPSummaryHTTPProtocolParamsHTTPVersion] `query:"httpVersion"`
+ // Filter for ip version.
+ IPVersion param.Field[[]HTTPSummaryHTTPProtocolParamsIPVersion] `query:"ipVersion"`
+ // 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 os name.
+ OS param.Field[[]HTTPSummaryHTTPProtocolParamsOS] `query:"os"`
+ // Filter for tls version.
+ TLSVersion param.Field[[]HTTPSummaryHTTPProtocolParamsTLSVersion] `query:"tlsVersion"`
+}
+
+// URLQuery serializes [HTTPSummaryHTTPProtocolParams]'s query parameters as
+// `url.Values`.
+func (r HTTPSummaryHTTPProtocolParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type HTTPSummaryHTTPProtocolParamsBotClass string
+
+const (
+ HTTPSummaryHTTPProtocolParamsBotClassLikelyAutomated HTTPSummaryHTTPProtocolParamsBotClass = "LIKELY_AUTOMATED"
+ HTTPSummaryHTTPProtocolParamsBotClassLikelyHuman HTTPSummaryHTTPProtocolParamsBotClass = "LIKELY_HUMAN"
+)
+
+type HTTPSummaryHTTPProtocolParamsDateRange string
+
+const (
+ HTTPSummaryHTTPProtocolParamsDateRange1d HTTPSummaryHTTPProtocolParamsDateRange = "1d"
+ HTTPSummaryHTTPProtocolParamsDateRange2d HTTPSummaryHTTPProtocolParamsDateRange = "2d"
+ HTTPSummaryHTTPProtocolParamsDateRange7d HTTPSummaryHTTPProtocolParamsDateRange = "7d"
+ HTTPSummaryHTTPProtocolParamsDateRange14d HTTPSummaryHTTPProtocolParamsDateRange = "14d"
+ HTTPSummaryHTTPProtocolParamsDateRange28d HTTPSummaryHTTPProtocolParamsDateRange = "28d"
+ HTTPSummaryHTTPProtocolParamsDateRange12w HTTPSummaryHTTPProtocolParamsDateRange = "12w"
+ HTTPSummaryHTTPProtocolParamsDateRange24w HTTPSummaryHTTPProtocolParamsDateRange = "24w"
+ HTTPSummaryHTTPProtocolParamsDateRange52w HTTPSummaryHTTPProtocolParamsDateRange = "52w"
+ HTTPSummaryHTTPProtocolParamsDateRange1dControl HTTPSummaryHTTPProtocolParamsDateRange = "1dControl"
+ HTTPSummaryHTTPProtocolParamsDateRange2dControl HTTPSummaryHTTPProtocolParamsDateRange = "2dControl"
+ HTTPSummaryHTTPProtocolParamsDateRange7dControl HTTPSummaryHTTPProtocolParamsDateRange = "7dControl"
+ HTTPSummaryHTTPProtocolParamsDateRange14dControl HTTPSummaryHTTPProtocolParamsDateRange = "14dControl"
+ HTTPSummaryHTTPProtocolParamsDateRange28dControl HTTPSummaryHTTPProtocolParamsDateRange = "28dControl"
+ HTTPSummaryHTTPProtocolParamsDateRange12wControl HTTPSummaryHTTPProtocolParamsDateRange = "12wControl"
+ HTTPSummaryHTTPProtocolParamsDateRange24wControl HTTPSummaryHTTPProtocolParamsDateRange = "24wControl"
+)
+
+type HTTPSummaryHTTPProtocolParamsDeviceType string
+
+const (
+ HTTPSummaryHTTPProtocolParamsDeviceTypeDesktop HTTPSummaryHTTPProtocolParamsDeviceType = "DESKTOP"
+ HTTPSummaryHTTPProtocolParamsDeviceTypeMobile HTTPSummaryHTTPProtocolParamsDeviceType = "MOBILE"
+ HTTPSummaryHTTPProtocolParamsDeviceTypeOther HTTPSummaryHTTPProtocolParamsDeviceType = "OTHER"
+)
+
+// Format results are returned in.
+type HTTPSummaryHTTPProtocolParamsFormat string
+
+const (
+ HTTPSummaryHTTPProtocolParamsFormatJson HTTPSummaryHTTPProtocolParamsFormat = "JSON"
+ HTTPSummaryHTTPProtocolParamsFormatCsv HTTPSummaryHTTPProtocolParamsFormat = "CSV"
+)
+
+type HTTPSummaryHTTPProtocolParamsHTTPVersion string
+
+const (
+ HTTPSummaryHTTPProtocolParamsHTTPVersionHttPv1 HTTPSummaryHTTPProtocolParamsHTTPVersion = "HTTPv1"
+ HTTPSummaryHTTPProtocolParamsHTTPVersionHttPv2 HTTPSummaryHTTPProtocolParamsHTTPVersion = "HTTPv2"
+ HTTPSummaryHTTPProtocolParamsHTTPVersionHttPv3 HTTPSummaryHTTPProtocolParamsHTTPVersion = "HTTPv3"
+)
+
+type HTTPSummaryHTTPProtocolParamsIPVersion string
+
+const (
+ HTTPSummaryHTTPProtocolParamsIPVersionIPv4 HTTPSummaryHTTPProtocolParamsIPVersion = "IPv4"
+ HTTPSummaryHTTPProtocolParamsIPVersionIPv6 HTTPSummaryHTTPProtocolParamsIPVersion = "IPv6"
+)
+
+type HTTPSummaryHTTPProtocolParamsOS string
+
+const (
+ HTTPSummaryHTTPProtocolParamsOSWindows HTTPSummaryHTTPProtocolParamsOS = "WINDOWS"
+ HTTPSummaryHTTPProtocolParamsOSMacosx HTTPSummaryHTTPProtocolParamsOS = "MACOSX"
+ HTTPSummaryHTTPProtocolParamsOSIos HTTPSummaryHTTPProtocolParamsOS = "IOS"
+ HTTPSummaryHTTPProtocolParamsOSAndroid HTTPSummaryHTTPProtocolParamsOS = "ANDROID"
+ HTTPSummaryHTTPProtocolParamsOSChromeos HTTPSummaryHTTPProtocolParamsOS = "CHROMEOS"
+ HTTPSummaryHTTPProtocolParamsOSLinux HTTPSummaryHTTPProtocolParamsOS = "LINUX"
+ HTTPSummaryHTTPProtocolParamsOSSmartTv HTTPSummaryHTTPProtocolParamsOS = "SMART_TV"
+)
+
+type HTTPSummaryHTTPProtocolParamsTLSVersion string
+
+const (
+ HTTPSummaryHTTPProtocolParamsTLSVersionTlSv1_0 HTTPSummaryHTTPProtocolParamsTLSVersion = "TLSv1_0"
+ HTTPSummaryHTTPProtocolParamsTLSVersionTlSv1_1 HTTPSummaryHTTPProtocolParamsTLSVersion = "TLSv1_1"
+ HTTPSummaryHTTPProtocolParamsTLSVersionTlSv1_2 HTTPSummaryHTTPProtocolParamsTLSVersion = "TLSv1_2"
+ HTTPSummaryHTTPProtocolParamsTLSVersionTlSv1_3 HTTPSummaryHTTPProtocolParamsTLSVersion = "TLSv1_3"
+ HTTPSummaryHTTPProtocolParamsTLSVersionTlSvQuic HTTPSummaryHTTPProtocolParamsTLSVersion = "TLSvQUIC"
+)
+
+type HTTPSummaryHTTPProtocolResponseEnvelope struct {
+ Result HTTPSummaryHTTPProtocolResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON httpSummaryHTTPProtocolResponseEnvelopeJSON `json:"-"`
+}
+
+// httpSummaryHTTPProtocolResponseEnvelopeJSON contains the JSON metadata for the
+// struct [HTTPSummaryHTTPProtocolResponseEnvelope]
+type httpSummaryHTTPProtocolResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPSummaryHTTPProtocolResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpSummaryHTTPProtocolResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPSummaryHTTPVersionParams 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"`
+ // Filter for bot class. Refer to
+ // [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/).
+ BotClass param.Field[[]HTTPSummaryHTTPVersionParamsBotClass] `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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]HTTPSummaryHTTPVersionParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Filter for device type.
+ DeviceType param.Field[[]HTTPSummaryHTTPVersionParamsDeviceType] `query:"deviceType"`
+ // Format results are returned in.
+ Format param.Field[HTTPSummaryHTTPVersionParamsFormat] `query:"format"`
+ // Filter for http protocol.
+ HTTPProtocol param.Field[[]HTTPSummaryHTTPVersionParamsHTTPProtocol] `query:"httpProtocol"`
+ // Filter for ip version.
+ IPVersion param.Field[[]HTTPSummaryHTTPVersionParamsIPVersion] `query:"ipVersion"`
+ // 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 os name.
+ OS param.Field[[]HTTPSummaryHTTPVersionParamsOS] `query:"os"`
+ // Filter for tls version.
+ TLSVersion param.Field[[]HTTPSummaryHTTPVersionParamsTLSVersion] `query:"tlsVersion"`
+}
+
+// URLQuery serializes [HTTPSummaryHTTPVersionParams]'s query parameters as
+// `url.Values`.
+func (r HTTPSummaryHTTPVersionParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type HTTPSummaryHTTPVersionParamsBotClass string
+
+const (
+ HTTPSummaryHTTPVersionParamsBotClassLikelyAutomated HTTPSummaryHTTPVersionParamsBotClass = "LIKELY_AUTOMATED"
+ HTTPSummaryHTTPVersionParamsBotClassLikelyHuman HTTPSummaryHTTPVersionParamsBotClass = "LIKELY_HUMAN"
+)
+
+type HTTPSummaryHTTPVersionParamsDateRange string
+
+const (
+ HTTPSummaryHTTPVersionParamsDateRange1d HTTPSummaryHTTPVersionParamsDateRange = "1d"
+ HTTPSummaryHTTPVersionParamsDateRange2d HTTPSummaryHTTPVersionParamsDateRange = "2d"
+ HTTPSummaryHTTPVersionParamsDateRange7d HTTPSummaryHTTPVersionParamsDateRange = "7d"
+ HTTPSummaryHTTPVersionParamsDateRange14d HTTPSummaryHTTPVersionParamsDateRange = "14d"
+ HTTPSummaryHTTPVersionParamsDateRange28d HTTPSummaryHTTPVersionParamsDateRange = "28d"
+ HTTPSummaryHTTPVersionParamsDateRange12w HTTPSummaryHTTPVersionParamsDateRange = "12w"
+ HTTPSummaryHTTPVersionParamsDateRange24w HTTPSummaryHTTPVersionParamsDateRange = "24w"
+ HTTPSummaryHTTPVersionParamsDateRange52w HTTPSummaryHTTPVersionParamsDateRange = "52w"
+ HTTPSummaryHTTPVersionParamsDateRange1dControl HTTPSummaryHTTPVersionParamsDateRange = "1dControl"
+ HTTPSummaryHTTPVersionParamsDateRange2dControl HTTPSummaryHTTPVersionParamsDateRange = "2dControl"
+ HTTPSummaryHTTPVersionParamsDateRange7dControl HTTPSummaryHTTPVersionParamsDateRange = "7dControl"
+ HTTPSummaryHTTPVersionParamsDateRange14dControl HTTPSummaryHTTPVersionParamsDateRange = "14dControl"
+ HTTPSummaryHTTPVersionParamsDateRange28dControl HTTPSummaryHTTPVersionParamsDateRange = "28dControl"
+ HTTPSummaryHTTPVersionParamsDateRange12wControl HTTPSummaryHTTPVersionParamsDateRange = "12wControl"
+ HTTPSummaryHTTPVersionParamsDateRange24wControl HTTPSummaryHTTPVersionParamsDateRange = "24wControl"
+)
+
+type HTTPSummaryHTTPVersionParamsDeviceType string
+
+const (
+ HTTPSummaryHTTPVersionParamsDeviceTypeDesktop HTTPSummaryHTTPVersionParamsDeviceType = "DESKTOP"
+ HTTPSummaryHTTPVersionParamsDeviceTypeMobile HTTPSummaryHTTPVersionParamsDeviceType = "MOBILE"
+ HTTPSummaryHTTPVersionParamsDeviceTypeOther HTTPSummaryHTTPVersionParamsDeviceType = "OTHER"
+)
+
+// Format results are returned in.
+type HTTPSummaryHTTPVersionParamsFormat string
+
+const (
+ HTTPSummaryHTTPVersionParamsFormatJson HTTPSummaryHTTPVersionParamsFormat = "JSON"
+ HTTPSummaryHTTPVersionParamsFormatCsv HTTPSummaryHTTPVersionParamsFormat = "CSV"
+)
+
+type HTTPSummaryHTTPVersionParamsHTTPProtocol string
+
+const (
+ HTTPSummaryHTTPVersionParamsHTTPProtocolHTTP HTTPSummaryHTTPVersionParamsHTTPProtocol = "HTTP"
+ HTTPSummaryHTTPVersionParamsHTTPProtocolHTTPS HTTPSummaryHTTPVersionParamsHTTPProtocol = "HTTPS"
+)
+
+type HTTPSummaryHTTPVersionParamsIPVersion string
+
+const (
+ HTTPSummaryHTTPVersionParamsIPVersionIPv4 HTTPSummaryHTTPVersionParamsIPVersion = "IPv4"
+ HTTPSummaryHTTPVersionParamsIPVersionIPv6 HTTPSummaryHTTPVersionParamsIPVersion = "IPv6"
+)
+
+type HTTPSummaryHTTPVersionParamsOS string
+
+const (
+ HTTPSummaryHTTPVersionParamsOSWindows HTTPSummaryHTTPVersionParamsOS = "WINDOWS"
+ HTTPSummaryHTTPVersionParamsOSMacosx HTTPSummaryHTTPVersionParamsOS = "MACOSX"
+ HTTPSummaryHTTPVersionParamsOSIos HTTPSummaryHTTPVersionParamsOS = "IOS"
+ HTTPSummaryHTTPVersionParamsOSAndroid HTTPSummaryHTTPVersionParamsOS = "ANDROID"
+ HTTPSummaryHTTPVersionParamsOSChromeos HTTPSummaryHTTPVersionParamsOS = "CHROMEOS"
+ HTTPSummaryHTTPVersionParamsOSLinux HTTPSummaryHTTPVersionParamsOS = "LINUX"
+ HTTPSummaryHTTPVersionParamsOSSmartTv HTTPSummaryHTTPVersionParamsOS = "SMART_TV"
+)
+
+type HTTPSummaryHTTPVersionParamsTLSVersion string
+
+const (
+ HTTPSummaryHTTPVersionParamsTLSVersionTlSv1_0 HTTPSummaryHTTPVersionParamsTLSVersion = "TLSv1_0"
+ HTTPSummaryHTTPVersionParamsTLSVersionTlSv1_1 HTTPSummaryHTTPVersionParamsTLSVersion = "TLSv1_1"
+ HTTPSummaryHTTPVersionParamsTLSVersionTlSv1_2 HTTPSummaryHTTPVersionParamsTLSVersion = "TLSv1_2"
+ HTTPSummaryHTTPVersionParamsTLSVersionTlSv1_3 HTTPSummaryHTTPVersionParamsTLSVersion = "TLSv1_3"
+ HTTPSummaryHTTPVersionParamsTLSVersionTlSvQuic HTTPSummaryHTTPVersionParamsTLSVersion = "TLSvQUIC"
+)
+
+type HTTPSummaryHTTPVersionResponseEnvelope struct {
+ Result HTTPSummaryHTTPVersionResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON httpSummaryHTTPVersionResponseEnvelopeJSON `json:"-"`
+}
+
+// httpSummaryHTTPVersionResponseEnvelopeJSON contains the JSON metadata for the
+// struct [HTTPSummaryHTTPVersionResponseEnvelope]
+type httpSummaryHTTPVersionResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPSummaryHTTPVersionResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpSummaryHTTPVersionResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPSummaryIPVersionParams 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"`
+ // Filter for bot class. Refer to
+ // [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/).
+ BotClass param.Field[[]HTTPSummaryIPVersionParamsBotClass] `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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]HTTPSummaryIPVersionParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Filter for device type.
+ DeviceType param.Field[[]HTTPSummaryIPVersionParamsDeviceType] `query:"deviceType"`
+ // Format results are returned in.
+ Format param.Field[HTTPSummaryIPVersionParamsFormat] `query:"format"`
+ // Filter for http protocol.
+ HTTPProtocol param.Field[[]HTTPSummaryIPVersionParamsHTTPProtocol] `query:"httpProtocol"`
+ // Filter for http version.
+ HTTPVersion param.Field[[]HTTPSummaryIPVersionParamsHTTPVersion] `query:"httpVersion"`
+ // 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 os name.
+ OS param.Field[[]HTTPSummaryIPVersionParamsOS] `query:"os"`
+ // Filter for tls version.
+ TLSVersion param.Field[[]HTTPSummaryIPVersionParamsTLSVersion] `query:"tlsVersion"`
+}
+
+// URLQuery serializes [HTTPSummaryIPVersionParams]'s query parameters as
+// `url.Values`.
+func (r HTTPSummaryIPVersionParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type HTTPSummaryIPVersionParamsBotClass string
+
+const (
+ HTTPSummaryIPVersionParamsBotClassLikelyAutomated HTTPSummaryIPVersionParamsBotClass = "LIKELY_AUTOMATED"
+ HTTPSummaryIPVersionParamsBotClassLikelyHuman HTTPSummaryIPVersionParamsBotClass = "LIKELY_HUMAN"
+)
+
+type HTTPSummaryIPVersionParamsDateRange string
+
+const (
+ HTTPSummaryIPVersionParamsDateRange1d HTTPSummaryIPVersionParamsDateRange = "1d"
+ HTTPSummaryIPVersionParamsDateRange2d HTTPSummaryIPVersionParamsDateRange = "2d"
+ HTTPSummaryIPVersionParamsDateRange7d HTTPSummaryIPVersionParamsDateRange = "7d"
+ HTTPSummaryIPVersionParamsDateRange14d HTTPSummaryIPVersionParamsDateRange = "14d"
+ HTTPSummaryIPVersionParamsDateRange28d HTTPSummaryIPVersionParamsDateRange = "28d"
+ HTTPSummaryIPVersionParamsDateRange12w HTTPSummaryIPVersionParamsDateRange = "12w"
+ HTTPSummaryIPVersionParamsDateRange24w HTTPSummaryIPVersionParamsDateRange = "24w"
+ HTTPSummaryIPVersionParamsDateRange52w HTTPSummaryIPVersionParamsDateRange = "52w"
+ HTTPSummaryIPVersionParamsDateRange1dControl HTTPSummaryIPVersionParamsDateRange = "1dControl"
+ HTTPSummaryIPVersionParamsDateRange2dControl HTTPSummaryIPVersionParamsDateRange = "2dControl"
+ HTTPSummaryIPVersionParamsDateRange7dControl HTTPSummaryIPVersionParamsDateRange = "7dControl"
+ HTTPSummaryIPVersionParamsDateRange14dControl HTTPSummaryIPVersionParamsDateRange = "14dControl"
+ HTTPSummaryIPVersionParamsDateRange28dControl HTTPSummaryIPVersionParamsDateRange = "28dControl"
+ HTTPSummaryIPVersionParamsDateRange12wControl HTTPSummaryIPVersionParamsDateRange = "12wControl"
+ HTTPSummaryIPVersionParamsDateRange24wControl HTTPSummaryIPVersionParamsDateRange = "24wControl"
+)
+
+type HTTPSummaryIPVersionParamsDeviceType string
+
+const (
+ HTTPSummaryIPVersionParamsDeviceTypeDesktop HTTPSummaryIPVersionParamsDeviceType = "DESKTOP"
+ HTTPSummaryIPVersionParamsDeviceTypeMobile HTTPSummaryIPVersionParamsDeviceType = "MOBILE"
+ HTTPSummaryIPVersionParamsDeviceTypeOther HTTPSummaryIPVersionParamsDeviceType = "OTHER"
+)
+
+// Format results are returned in.
+type HTTPSummaryIPVersionParamsFormat string
+
+const (
+ HTTPSummaryIPVersionParamsFormatJson HTTPSummaryIPVersionParamsFormat = "JSON"
+ HTTPSummaryIPVersionParamsFormatCsv HTTPSummaryIPVersionParamsFormat = "CSV"
+)
+
+type HTTPSummaryIPVersionParamsHTTPProtocol string
+
+const (
+ HTTPSummaryIPVersionParamsHTTPProtocolHTTP HTTPSummaryIPVersionParamsHTTPProtocol = "HTTP"
+ HTTPSummaryIPVersionParamsHTTPProtocolHTTPS HTTPSummaryIPVersionParamsHTTPProtocol = "HTTPS"
+)
+
+type HTTPSummaryIPVersionParamsHTTPVersion string
+
+const (
+ HTTPSummaryIPVersionParamsHTTPVersionHttPv1 HTTPSummaryIPVersionParamsHTTPVersion = "HTTPv1"
+ HTTPSummaryIPVersionParamsHTTPVersionHttPv2 HTTPSummaryIPVersionParamsHTTPVersion = "HTTPv2"
+ HTTPSummaryIPVersionParamsHTTPVersionHttPv3 HTTPSummaryIPVersionParamsHTTPVersion = "HTTPv3"
+)
+
+type HTTPSummaryIPVersionParamsOS string
+
+const (
+ HTTPSummaryIPVersionParamsOSWindows HTTPSummaryIPVersionParamsOS = "WINDOWS"
+ HTTPSummaryIPVersionParamsOSMacosx HTTPSummaryIPVersionParamsOS = "MACOSX"
+ HTTPSummaryIPVersionParamsOSIos HTTPSummaryIPVersionParamsOS = "IOS"
+ HTTPSummaryIPVersionParamsOSAndroid HTTPSummaryIPVersionParamsOS = "ANDROID"
+ HTTPSummaryIPVersionParamsOSChromeos HTTPSummaryIPVersionParamsOS = "CHROMEOS"
+ HTTPSummaryIPVersionParamsOSLinux HTTPSummaryIPVersionParamsOS = "LINUX"
+ HTTPSummaryIPVersionParamsOSSmartTv HTTPSummaryIPVersionParamsOS = "SMART_TV"
+)
+
+type HTTPSummaryIPVersionParamsTLSVersion string
+
+const (
+ HTTPSummaryIPVersionParamsTLSVersionTlSv1_0 HTTPSummaryIPVersionParamsTLSVersion = "TLSv1_0"
+ HTTPSummaryIPVersionParamsTLSVersionTlSv1_1 HTTPSummaryIPVersionParamsTLSVersion = "TLSv1_1"
+ HTTPSummaryIPVersionParamsTLSVersionTlSv1_2 HTTPSummaryIPVersionParamsTLSVersion = "TLSv1_2"
+ HTTPSummaryIPVersionParamsTLSVersionTlSv1_3 HTTPSummaryIPVersionParamsTLSVersion = "TLSv1_3"
+ HTTPSummaryIPVersionParamsTLSVersionTlSvQuic HTTPSummaryIPVersionParamsTLSVersion = "TLSvQUIC"
+)
+
+type HTTPSummaryIPVersionResponseEnvelope struct {
+ Result HTTPSummaryIPVersionResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON httpSummaryIPVersionResponseEnvelopeJSON `json:"-"`
+}
+
+// httpSummaryIPVersionResponseEnvelopeJSON contains the JSON metadata for the
+// struct [HTTPSummaryIPVersionResponseEnvelope]
+type httpSummaryIPVersionResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPSummaryIPVersionResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpSummaryIPVersionResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPSummaryOSParams 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"`
+ // Filter for bot class. Refer to
+ // [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/).
+ BotClass param.Field[[]HTTPSummaryOSParamsBotClass] `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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]HTTPSummaryOSParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Filter for device type.
+ DeviceType param.Field[[]HTTPSummaryOSParamsDeviceType] `query:"deviceType"`
+ // Format results are returned in.
+ Format param.Field[HTTPSummaryOSParamsFormat] `query:"format"`
+ // Filter for http protocol.
+ HTTPProtocol param.Field[[]HTTPSummaryOSParamsHTTPProtocol] `query:"httpProtocol"`
+ // Filter for http version.
+ HTTPVersion param.Field[[]HTTPSummaryOSParamsHTTPVersion] `query:"httpVersion"`
+ // Filter for ip version.
+ IPVersion param.Field[[]HTTPSummaryOSParamsIPVersion] `query:"ipVersion"`
+ // 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[[]HTTPSummaryOSParamsTLSVersion] `query:"tlsVersion"`
+}
+
+// URLQuery serializes [HTTPSummaryOSParams]'s query parameters as `url.Values`.
+func (r HTTPSummaryOSParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type HTTPSummaryOSParamsBotClass string
+
+const (
+ HTTPSummaryOSParamsBotClassLikelyAutomated HTTPSummaryOSParamsBotClass = "LIKELY_AUTOMATED"
+ HTTPSummaryOSParamsBotClassLikelyHuman HTTPSummaryOSParamsBotClass = "LIKELY_HUMAN"
+)
+
+type HTTPSummaryOSParamsDateRange string
+
+const (
+ HTTPSummaryOSParamsDateRange1d HTTPSummaryOSParamsDateRange = "1d"
+ HTTPSummaryOSParamsDateRange2d HTTPSummaryOSParamsDateRange = "2d"
+ HTTPSummaryOSParamsDateRange7d HTTPSummaryOSParamsDateRange = "7d"
+ HTTPSummaryOSParamsDateRange14d HTTPSummaryOSParamsDateRange = "14d"
+ HTTPSummaryOSParamsDateRange28d HTTPSummaryOSParamsDateRange = "28d"
+ HTTPSummaryOSParamsDateRange12w HTTPSummaryOSParamsDateRange = "12w"
+ HTTPSummaryOSParamsDateRange24w HTTPSummaryOSParamsDateRange = "24w"
+ HTTPSummaryOSParamsDateRange52w HTTPSummaryOSParamsDateRange = "52w"
+ HTTPSummaryOSParamsDateRange1dControl HTTPSummaryOSParamsDateRange = "1dControl"
+ HTTPSummaryOSParamsDateRange2dControl HTTPSummaryOSParamsDateRange = "2dControl"
+ HTTPSummaryOSParamsDateRange7dControl HTTPSummaryOSParamsDateRange = "7dControl"
+ HTTPSummaryOSParamsDateRange14dControl HTTPSummaryOSParamsDateRange = "14dControl"
+ HTTPSummaryOSParamsDateRange28dControl HTTPSummaryOSParamsDateRange = "28dControl"
+ HTTPSummaryOSParamsDateRange12wControl HTTPSummaryOSParamsDateRange = "12wControl"
+ HTTPSummaryOSParamsDateRange24wControl HTTPSummaryOSParamsDateRange = "24wControl"
+)
+
+type HTTPSummaryOSParamsDeviceType string
+
+const (
+ HTTPSummaryOSParamsDeviceTypeDesktop HTTPSummaryOSParamsDeviceType = "DESKTOP"
+ HTTPSummaryOSParamsDeviceTypeMobile HTTPSummaryOSParamsDeviceType = "MOBILE"
+ HTTPSummaryOSParamsDeviceTypeOther HTTPSummaryOSParamsDeviceType = "OTHER"
+)
+
+// Format results are returned in.
+type HTTPSummaryOSParamsFormat string
+
+const (
+ HTTPSummaryOSParamsFormatJson HTTPSummaryOSParamsFormat = "JSON"
+ HTTPSummaryOSParamsFormatCsv HTTPSummaryOSParamsFormat = "CSV"
+)
+
+type HTTPSummaryOSParamsHTTPProtocol string
+
+const (
+ HTTPSummaryOSParamsHTTPProtocolHTTP HTTPSummaryOSParamsHTTPProtocol = "HTTP"
+ HTTPSummaryOSParamsHTTPProtocolHTTPS HTTPSummaryOSParamsHTTPProtocol = "HTTPS"
+)
+
+type HTTPSummaryOSParamsHTTPVersion string
+
+const (
+ HTTPSummaryOSParamsHTTPVersionHttPv1 HTTPSummaryOSParamsHTTPVersion = "HTTPv1"
+ HTTPSummaryOSParamsHTTPVersionHttPv2 HTTPSummaryOSParamsHTTPVersion = "HTTPv2"
+ HTTPSummaryOSParamsHTTPVersionHttPv3 HTTPSummaryOSParamsHTTPVersion = "HTTPv3"
+)
+
+type HTTPSummaryOSParamsIPVersion string
+
+const (
+ HTTPSummaryOSParamsIPVersionIPv4 HTTPSummaryOSParamsIPVersion = "IPv4"
+ HTTPSummaryOSParamsIPVersionIPv6 HTTPSummaryOSParamsIPVersion = "IPv6"
+)
+
+type HTTPSummaryOSParamsTLSVersion string
+
+const (
+ HTTPSummaryOSParamsTLSVersionTlSv1_0 HTTPSummaryOSParamsTLSVersion = "TLSv1_0"
+ HTTPSummaryOSParamsTLSVersionTlSv1_1 HTTPSummaryOSParamsTLSVersion = "TLSv1_1"
+ HTTPSummaryOSParamsTLSVersionTlSv1_2 HTTPSummaryOSParamsTLSVersion = "TLSv1_2"
+ HTTPSummaryOSParamsTLSVersionTlSv1_3 HTTPSummaryOSParamsTLSVersion = "TLSv1_3"
+ HTTPSummaryOSParamsTLSVersionTlSvQuic HTTPSummaryOSParamsTLSVersion = "TLSvQUIC"
+)
+
+type HTTPSummaryOSResponseEnvelope struct {
+ Result HTTPSummaryOSResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON httpSummaryOSResponseEnvelopeJSON `json:"-"`
+}
+
+// httpSummaryOSResponseEnvelopeJSON contains the JSON metadata for the struct
+// [HTTPSummaryOSResponseEnvelope]
+type httpSummaryOSResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPSummaryOSResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpSummaryOSResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPSummaryTLSVersionParams 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"`
+ // Filter for bot class. Refer to
+ // [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/).
+ BotClass param.Field[[]HTTPSummaryTLSVersionParamsBotClass] `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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]HTTPSummaryTLSVersionParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Filter for device type.
+ DeviceType param.Field[[]HTTPSummaryTLSVersionParamsDeviceType] `query:"deviceType"`
+ // Format results are returned in.
+ Format param.Field[HTTPSummaryTLSVersionParamsFormat] `query:"format"`
+ // Filter for http protocol.
+ HTTPProtocol param.Field[[]HTTPSummaryTLSVersionParamsHTTPProtocol] `query:"httpProtocol"`
+ // Filter for http version.
+ HTTPVersion param.Field[[]HTTPSummaryTLSVersionParamsHTTPVersion] `query:"httpVersion"`
+ // Filter for ip version.
+ IPVersion param.Field[[]HTTPSummaryTLSVersionParamsIPVersion] `query:"ipVersion"`
+ // 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 os name.
+ OS param.Field[[]HTTPSummaryTLSVersionParamsOS] `query:"os"`
+}
+
+// URLQuery serializes [HTTPSummaryTLSVersionParams]'s query parameters as
+// `url.Values`.
+func (r HTTPSummaryTLSVersionParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type HTTPSummaryTLSVersionParamsBotClass string
+
+const (
+ HTTPSummaryTLSVersionParamsBotClassLikelyAutomated HTTPSummaryTLSVersionParamsBotClass = "LIKELY_AUTOMATED"
+ HTTPSummaryTLSVersionParamsBotClassLikelyHuman HTTPSummaryTLSVersionParamsBotClass = "LIKELY_HUMAN"
+)
+
+type HTTPSummaryTLSVersionParamsDateRange string
+
+const (
+ HTTPSummaryTLSVersionParamsDateRange1d HTTPSummaryTLSVersionParamsDateRange = "1d"
+ HTTPSummaryTLSVersionParamsDateRange2d HTTPSummaryTLSVersionParamsDateRange = "2d"
+ HTTPSummaryTLSVersionParamsDateRange7d HTTPSummaryTLSVersionParamsDateRange = "7d"
+ HTTPSummaryTLSVersionParamsDateRange14d HTTPSummaryTLSVersionParamsDateRange = "14d"
+ HTTPSummaryTLSVersionParamsDateRange28d HTTPSummaryTLSVersionParamsDateRange = "28d"
+ HTTPSummaryTLSVersionParamsDateRange12w HTTPSummaryTLSVersionParamsDateRange = "12w"
+ HTTPSummaryTLSVersionParamsDateRange24w HTTPSummaryTLSVersionParamsDateRange = "24w"
+ HTTPSummaryTLSVersionParamsDateRange52w HTTPSummaryTLSVersionParamsDateRange = "52w"
+ HTTPSummaryTLSVersionParamsDateRange1dControl HTTPSummaryTLSVersionParamsDateRange = "1dControl"
+ HTTPSummaryTLSVersionParamsDateRange2dControl HTTPSummaryTLSVersionParamsDateRange = "2dControl"
+ HTTPSummaryTLSVersionParamsDateRange7dControl HTTPSummaryTLSVersionParamsDateRange = "7dControl"
+ HTTPSummaryTLSVersionParamsDateRange14dControl HTTPSummaryTLSVersionParamsDateRange = "14dControl"
+ HTTPSummaryTLSVersionParamsDateRange28dControl HTTPSummaryTLSVersionParamsDateRange = "28dControl"
+ HTTPSummaryTLSVersionParamsDateRange12wControl HTTPSummaryTLSVersionParamsDateRange = "12wControl"
+ HTTPSummaryTLSVersionParamsDateRange24wControl HTTPSummaryTLSVersionParamsDateRange = "24wControl"
+)
+
+type HTTPSummaryTLSVersionParamsDeviceType string
+
+const (
+ HTTPSummaryTLSVersionParamsDeviceTypeDesktop HTTPSummaryTLSVersionParamsDeviceType = "DESKTOP"
+ HTTPSummaryTLSVersionParamsDeviceTypeMobile HTTPSummaryTLSVersionParamsDeviceType = "MOBILE"
+ HTTPSummaryTLSVersionParamsDeviceTypeOther HTTPSummaryTLSVersionParamsDeviceType = "OTHER"
+)
+
+// Format results are returned in.
+type HTTPSummaryTLSVersionParamsFormat string
+
+const (
+ HTTPSummaryTLSVersionParamsFormatJson HTTPSummaryTLSVersionParamsFormat = "JSON"
+ HTTPSummaryTLSVersionParamsFormatCsv HTTPSummaryTLSVersionParamsFormat = "CSV"
+)
+
+type HTTPSummaryTLSVersionParamsHTTPProtocol string
+
+const (
+ HTTPSummaryTLSVersionParamsHTTPProtocolHTTP HTTPSummaryTLSVersionParamsHTTPProtocol = "HTTP"
+ HTTPSummaryTLSVersionParamsHTTPProtocolHTTPS HTTPSummaryTLSVersionParamsHTTPProtocol = "HTTPS"
+)
+
+type HTTPSummaryTLSVersionParamsHTTPVersion string
+
+const (
+ HTTPSummaryTLSVersionParamsHTTPVersionHttPv1 HTTPSummaryTLSVersionParamsHTTPVersion = "HTTPv1"
+ HTTPSummaryTLSVersionParamsHTTPVersionHttPv2 HTTPSummaryTLSVersionParamsHTTPVersion = "HTTPv2"
+ HTTPSummaryTLSVersionParamsHTTPVersionHttPv3 HTTPSummaryTLSVersionParamsHTTPVersion = "HTTPv3"
+)
+
+type HTTPSummaryTLSVersionParamsIPVersion string
+
+const (
+ HTTPSummaryTLSVersionParamsIPVersionIPv4 HTTPSummaryTLSVersionParamsIPVersion = "IPv4"
+ HTTPSummaryTLSVersionParamsIPVersionIPv6 HTTPSummaryTLSVersionParamsIPVersion = "IPv6"
+)
+
+type HTTPSummaryTLSVersionParamsOS string
+
+const (
+ HTTPSummaryTLSVersionParamsOSWindows HTTPSummaryTLSVersionParamsOS = "WINDOWS"
+ HTTPSummaryTLSVersionParamsOSMacosx HTTPSummaryTLSVersionParamsOS = "MACOSX"
+ HTTPSummaryTLSVersionParamsOSIos HTTPSummaryTLSVersionParamsOS = "IOS"
+ HTTPSummaryTLSVersionParamsOSAndroid HTTPSummaryTLSVersionParamsOS = "ANDROID"
+ HTTPSummaryTLSVersionParamsOSChromeos HTTPSummaryTLSVersionParamsOS = "CHROMEOS"
+ HTTPSummaryTLSVersionParamsOSLinux HTTPSummaryTLSVersionParamsOS = "LINUX"
+ HTTPSummaryTLSVersionParamsOSSmartTv HTTPSummaryTLSVersionParamsOS = "SMART_TV"
+)
+
+type HTTPSummaryTLSVersionResponseEnvelope struct {
+ Result HTTPSummaryTLSVersionResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON httpSummaryTLSVersionResponseEnvelopeJSON `json:"-"`
+}
+
+// httpSummaryTLSVersionResponseEnvelopeJSON contains the JSON metadata for the
+// struct [HTTPSummaryTLSVersionResponseEnvelope]
+type httpSummaryTLSVersionResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPSummaryTLSVersionResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpSummaryTLSVersionResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/radar/httpsummary_test.go b/radar/httpsummary_test.go
new file mode 100644
index 00000000000..09db8054892
--- /dev/null
+++ b/radar/httpsummary_test.go
@@ -0,0 +1,289 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/radar"
+)
+
+func TestHTTPSummaryBotClassWithOptionalParams(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"),
+ )
+ _, err := client.Radar.HTTP.Summary.BotClass(context.TODO(), radar.HTTPSummaryBotClassParams{
+ 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([]radar.HTTPSummaryBotClassParamsDateRange{radar.HTTPSummaryBotClassParamsDateRange1d, radar.HTTPSummaryBotClassParamsDateRange2d, radar.HTTPSummaryBotClassParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DeviceType: cloudflare.F([]radar.HTTPSummaryBotClassParamsDeviceType{radar.HTTPSummaryBotClassParamsDeviceTypeDesktop, radar.HTTPSummaryBotClassParamsDeviceTypeMobile, radar.HTTPSummaryBotClassParamsDeviceTypeOther}),
+ Format: cloudflare.F(radar.HTTPSummaryBotClassParamsFormatJson),
+ HTTPProtocol: cloudflare.F([]radar.HTTPSummaryBotClassParamsHTTPProtocol{radar.HTTPSummaryBotClassParamsHTTPProtocolHTTP, radar.HTTPSummaryBotClassParamsHTTPProtocolHTTPS}),
+ HTTPVersion: cloudflare.F([]radar.HTTPSummaryBotClassParamsHTTPVersion{radar.HTTPSummaryBotClassParamsHTTPVersionHttPv1, radar.HTTPSummaryBotClassParamsHTTPVersionHttPv2, radar.HTTPSummaryBotClassParamsHTTPVersionHttPv3}),
+ IPVersion: cloudflare.F([]radar.HTTPSummaryBotClassParamsIPVersion{radar.HTTPSummaryBotClassParamsIPVersionIPv4, radar.HTTPSummaryBotClassParamsIPVersionIPv6}),
+ Location: cloudflare.F([]string{"string", "string", "string"}),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ OS: cloudflare.F([]radar.HTTPSummaryBotClassParamsOS{radar.HTTPSummaryBotClassParamsOSWindows, radar.HTTPSummaryBotClassParamsOSMacosx, radar.HTTPSummaryBotClassParamsOSIos}),
+ TLSVersion: cloudflare.F([]radar.HTTPSummaryBotClassParamsTLSVersion{radar.HTTPSummaryBotClassParamsTLSVersionTlSv1_0, radar.HTTPSummaryBotClassParamsTLSVersionTlSv1_1, radar.HTTPSummaryBotClassParamsTLSVersionTlSv1_2}),
+ })
+ 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())
+ }
+}
+
+func TestHTTPSummaryDeviceTypeWithOptionalParams(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"),
+ )
+ _, err := client.Radar.HTTP.Summary.DeviceType(context.TODO(), radar.HTTPSummaryDeviceTypeParams{
+ ASN: cloudflare.F([]string{"string", "string", "string"}),
+ BotClass: cloudflare.F([]radar.HTTPSummaryDeviceTypeParamsBotClass{radar.HTTPSummaryDeviceTypeParamsBotClassLikelyAutomated, radar.HTTPSummaryDeviceTypeParamsBotClassLikelyHuman}),
+ Continent: cloudflare.F([]string{"string", "string", "string"}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.HTTPSummaryDeviceTypeParamsDateRange{radar.HTTPSummaryDeviceTypeParamsDateRange1d, radar.HTTPSummaryDeviceTypeParamsDateRange2d, radar.HTTPSummaryDeviceTypeParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Format: cloudflare.F(radar.HTTPSummaryDeviceTypeParamsFormatJson),
+ HTTPProtocol: cloudflare.F([]radar.HTTPSummaryDeviceTypeParamsHTTPProtocol{radar.HTTPSummaryDeviceTypeParamsHTTPProtocolHTTP, radar.HTTPSummaryDeviceTypeParamsHTTPProtocolHTTPS}),
+ HTTPVersion: cloudflare.F([]radar.HTTPSummaryDeviceTypeParamsHTTPVersion{radar.HTTPSummaryDeviceTypeParamsHTTPVersionHttPv1, radar.HTTPSummaryDeviceTypeParamsHTTPVersionHttPv2, radar.HTTPSummaryDeviceTypeParamsHTTPVersionHttPv3}),
+ IPVersion: cloudflare.F([]radar.HTTPSummaryDeviceTypeParamsIPVersion{radar.HTTPSummaryDeviceTypeParamsIPVersionIPv4, radar.HTTPSummaryDeviceTypeParamsIPVersionIPv6}),
+ Location: cloudflare.F([]string{"string", "string", "string"}),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ OS: cloudflare.F([]radar.HTTPSummaryDeviceTypeParamsOS{radar.HTTPSummaryDeviceTypeParamsOSWindows, radar.HTTPSummaryDeviceTypeParamsOSMacosx, radar.HTTPSummaryDeviceTypeParamsOSIos}),
+ TLSVersion: cloudflare.F([]radar.HTTPSummaryDeviceTypeParamsTLSVersion{radar.HTTPSummaryDeviceTypeParamsTLSVersionTlSv1_0, radar.HTTPSummaryDeviceTypeParamsTLSVersionTlSv1_1, radar.HTTPSummaryDeviceTypeParamsTLSVersionTlSv1_2}),
+ })
+ 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())
+ }
+}
+
+func TestHTTPSummaryHTTPProtocolWithOptionalParams(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"),
+ )
+ _, err := client.Radar.HTTP.Summary.HTTPProtocol(context.TODO(), radar.HTTPSummaryHTTPProtocolParams{
+ ASN: cloudflare.F([]string{"string", "string", "string"}),
+ BotClass: cloudflare.F([]radar.HTTPSummaryHTTPProtocolParamsBotClass{radar.HTTPSummaryHTTPProtocolParamsBotClassLikelyAutomated, radar.HTTPSummaryHTTPProtocolParamsBotClassLikelyHuman}),
+ Continent: cloudflare.F([]string{"string", "string", "string"}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.HTTPSummaryHTTPProtocolParamsDateRange{radar.HTTPSummaryHTTPProtocolParamsDateRange1d, radar.HTTPSummaryHTTPProtocolParamsDateRange2d, radar.HTTPSummaryHTTPProtocolParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DeviceType: cloudflare.F([]radar.HTTPSummaryHTTPProtocolParamsDeviceType{radar.HTTPSummaryHTTPProtocolParamsDeviceTypeDesktop, radar.HTTPSummaryHTTPProtocolParamsDeviceTypeMobile, radar.HTTPSummaryHTTPProtocolParamsDeviceTypeOther}),
+ Format: cloudflare.F(radar.HTTPSummaryHTTPProtocolParamsFormatJson),
+ HTTPVersion: cloudflare.F([]radar.HTTPSummaryHTTPProtocolParamsHTTPVersion{radar.HTTPSummaryHTTPProtocolParamsHTTPVersionHttPv1, radar.HTTPSummaryHTTPProtocolParamsHTTPVersionHttPv2, radar.HTTPSummaryHTTPProtocolParamsHTTPVersionHttPv3}),
+ IPVersion: cloudflare.F([]radar.HTTPSummaryHTTPProtocolParamsIPVersion{radar.HTTPSummaryHTTPProtocolParamsIPVersionIPv4, radar.HTTPSummaryHTTPProtocolParamsIPVersionIPv6}),
+ Location: cloudflare.F([]string{"string", "string", "string"}),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ OS: cloudflare.F([]radar.HTTPSummaryHTTPProtocolParamsOS{radar.HTTPSummaryHTTPProtocolParamsOSWindows, radar.HTTPSummaryHTTPProtocolParamsOSMacosx, radar.HTTPSummaryHTTPProtocolParamsOSIos}),
+ TLSVersion: cloudflare.F([]radar.HTTPSummaryHTTPProtocolParamsTLSVersion{radar.HTTPSummaryHTTPProtocolParamsTLSVersionTlSv1_0, radar.HTTPSummaryHTTPProtocolParamsTLSVersionTlSv1_1, radar.HTTPSummaryHTTPProtocolParamsTLSVersionTlSv1_2}),
+ })
+ 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())
+ }
+}
+
+func TestHTTPSummaryHTTPVersionWithOptionalParams(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"),
+ )
+ _, err := client.Radar.HTTP.Summary.HTTPVersion(context.TODO(), radar.HTTPSummaryHTTPVersionParams{
+ ASN: cloudflare.F([]string{"string", "string", "string"}),
+ BotClass: cloudflare.F([]radar.HTTPSummaryHTTPVersionParamsBotClass{radar.HTTPSummaryHTTPVersionParamsBotClassLikelyAutomated, radar.HTTPSummaryHTTPVersionParamsBotClassLikelyHuman}),
+ Continent: cloudflare.F([]string{"string", "string", "string"}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.HTTPSummaryHTTPVersionParamsDateRange{radar.HTTPSummaryHTTPVersionParamsDateRange1d, radar.HTTPSummaryHTTPVersionParamsDateRange2d, radar.HTTPSummaryHTTPVersionParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DeviceType: cloudflare.F([]radar.HTTPSummaryHTTPVersionParamsDeviceType{radar.HTTPSummaryHTTPVersionParamsDeviceTypeDesktop, radar.HTTPSummaryHTTPVersionParamsDeviceTypeMobile, radar.HTTPSummaryHTTPVersionParamsDeviceTypeOther}),
+ Format: cloudflare.F(radar.HTTPSummaryHTTPVersionParamsFormatJson),
+ HTTPProtocol: cloudflare.F([]radar.HTTPSummaryHTTPVersionParamsHTTPProtocol{radar.HTTPSummaryHTTPVersionParamsHTTPProtocolHTTP, radar.HTTPSummaryHTTPVersionParamsHTTPProtocolHTTPS}),
+ IPVersion: cloudflare.F([]radar.HTTPSummaryHTTPVersionParamsIPVersion{radar.HTTPSummaryHTTPVersionParamsIPVersionIPv4, radar.HTTPSummaryHTTPVersionParamsIPVersionIPv6}),
+ Location: cloudflare.F([]string{"string", "string", "string"}),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ OS: cloudflare.F([]radar.HTTPSummaryHTTPVersionParamsOS{radar.HTTPSummaryHTTPVersionParamsOSWindows, radar.HTTPSummaryHTTPVersionParamsOSMacosx, radar.HTTPSummaryHTTPVersionParamsOSIos}),
+ TLSVersion: cloudflare.F([]radar.HTTPSummaryHTTPVersionParamsTLSVersion{radar.HTTPSummaryHTTPVersionParamsTLSVersionTlSv1_0, radar.HTTPSummaryHTTPVersionParamsTLSVersionTlSv1_1, radar.HTTPSummaryHTTPVersionParamsTLSVersionTlSv1_2}),
+ })
+ 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())
+ }
+}
+
+func TestHTTPSummaryIPVersionWithOptionalParams(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"),
+ )
+ _, err := client.Radar.HTTP.Summary.IPVersion(context.TODO(), radar.HTTPSummaryIPVersionParams{
+ ASN: cloudflare.F([]string{"string", "string", "string"}),
+ BotClass: cloudflare.F([]radar.HTTPSummaryIPVersionParamsBotClass{radar.HTTPSummaryIPVersionParamsBotClassLikelyAutomated, radar.HTTPSummaryIPVersionParamsBotClassLikelyHuman}),
+ Continent: cloudflare.F([]string{"string", "string", "string"}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.HTTPSummaryIPVersionParamsDateRange{radar.HTTPSummaryIPVersionParamsDateRange1d, radar.HTTPSummaryIPVersionParamsDateRange2d, radar.HTTPSummaryIPVersionParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DeviceType: cloudflare.F([]radar.HTTPSummaryIPVersionParamsDeviceType{radar.HTTPSummaryIPVersionParamsDeviceTypeDesktop, radar.HTTPSummaryIPVersionParamsDeviceTypeMobile, radar.HTTPSummaryIPVersionParamsDeviceTypeOther}),
+ Format: cloudflare.F(radar.HTTPSummaryIPVersionParamsFormatJson),
+ HTTPProtocol: cloudflare.F([]radar.HTTPSummaryIPVersionParamsHTTPProtocol{radar.HTTPSummaryIPVersionParamsHTTPProtocolHTTP, radar.HTTPSummaryIPVersionParamsHTTPProtocolHTTPS}),
+ HTTPVersion: cloudflare.F([]radar.HTTPSummaryIPVersionParamsHTTPVersion{radar.HTTPSummaryIPVersionParamsHTTPVersionHttPv1, radar.HTTPSummaryIPVersionParamsHTTPVersionHttPv2, radar.HTTPSummaryIPVersionParamsHTTPVersionHttPv3}),
+ Location: cloudflare.F([]string{"string", "string", "string"}),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ OS: cloudflare.F([]radar.HTTPSummaryIPVersionParamsOS{radar.HTTPSummaryIPVersionParamsOSWindows, radar.HTTPSummaryIPVersionParamsOSMacosx, radar.HTTPSummaryIPVersionParamsOSIos}),
+ TLSVersion: cloudflare.F([]radar.HTTPSummaryIPVersionParamsTLSVersion{radar.HTTPSummaryIPVersionParamsTLSVersionTlSv1_0, radar.HTTPSummaryIPVersionParamsTLSVersionTlSv1_1, radar.HTTPSummaryIPVersionParamsTLSVersionTlSv1_2}),
+ })
+ 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())
+ }
+}
+
+func TestHTTPSummaryOSWithOptionalParams(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"),
+ )
+ _, err := client.Radar.HTTP.Summary.OS(context.TODO(), radar.HTTPSummaryOSParams{
+ ASN: cloudflare.F([]string{"string", "string", "string"}),
+ BotClass: cloudflare.F([]radar.HTTPSummaryOSParamsBotClass{radar.HTTPSummaryOSParamsBotClassLikelyAutomated, radar.HTTPSummaryOSParamsBotClassLikelyHuman}),
+ Continent: cloudflare.F([]string{"string", "string", "string"}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.HTTPSummaryOSParamsDateRange{radar.HTTPSummaryOSParamsDateRange1d, radar.HTTPSummaryOSParamsDateRange2d, radar.HTTPSummaryOSParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DeviceType: cloudflare.F([]radar.HTTPSummaryOSParamsDeviceType{radar.HTTPSummaryOSParamsDeviceTypeDesktop, radar.HTTPSummaryOSParamsDeviceTypeMobile, radar.HTTPSummaryOSParamsDeviceTypeOther}),
+ Format: cloudflare.F(radar.HTTPSummaryOSParamsFormatJson),
+ HTTPProtocol: cloudflare.F([]radar.HTTPSummaryOSParamsHTTPProtocol{radar.HTTPSummaryOSParamsHTTPProtocolHTTP, radar.HTTPSummaryOSParamsHTTPProtocolHTTPS}),
+ HTTPVersion: cloudflare.F([]radar.HTTPSummaryOSParamsHTTPVersion{radar.HTTPSummaryOSParamsHTTPVersionHttPv1, radar.HTTPSummaryOSParamsHTTPVersionHttPv2, radar.HTTPSummaryOSParamsHTTPVersionHttPv3}),
+ IPVersion: cloudflare.F([]radar.HTTPSummaryOSParamsIPVersion{radar.HTTPSummaryOSParamsIPVersionIPv4, radar.HTTPSummaryOSParamsIPVersionIPv6}),
+ Location: cloudflare.F([]string{"string", "string", "string"}),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ TLSVersion: cloudflare.F([]radar.HTTPSummaryOSParamsTLSVersion{radar.HTTPSummaryOSParamsTLSVersionTlSv1_0, radar.HTTPSummaryOSParamsTLSVersionTlSv1_1, radar.HTTPSummaryOSParamsTLSVersionTlSv1_2}),
+ })
+ 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())
+ }
+}
+
+func TestHTTPSummaryTLSVersionWithOptionalParams(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"),
+ )
+ _, err := client.Radar.HTTP.Summary.TLSVersion(context.TODO(), radar.HTTPSummaryTLSVersionParams{
+ ASN: cloudflare.F([]string{"string", "string", "string"}),
+ BotClass: cloudflare.F([]radar.HTTPSummaryTLSVersionParamsBotClass{radar.HTTPSummaryTLSVersionParamsBotClassLikelyAutomated, radar.HTTPSummaryTLSVersionParamsBotClassLikelyHuman}),
+ Continent: cloudflare.F([]string{"string", "string", "string"}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.HTTPSummaryTLSVersionParamsDateRange{radar.HTTPSummaryTLSVersionParamsDateRange1d, radar.HTTPSummaryTLSVersionParamsDateRange2d, radar.HTTPSummaryTLSVersionParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DeviceType: cloudflare.F([]radar.HTTPSummaryTLSVersionParamsDeviceType{radar.HTTPSummaryTLSVersionParamsDeviceTypeDesktop, radar.HTTPSummaryTLSVersionParamsDeviceTypeMobile, radar.HTTPSummaryTLSVersionParamsDeviceTypeOther}),
+ Format: cloudflare.F(radar.HTTPSummaryTLSVersionParamsFormatJson),
+ HTTPProtocol: cloudflare.F([]radar.HTTPSummaryTLSVersionParamsHTTPProtocol{radar.HTTPSummaryTLSVersionParamsHTTPProtocolHTTP, radar.HTTPSummaryTLSVersionParamsHTTPProtocolHTTPS}),
+ HTTPVersion: cloudflare.F([]radar.HTTPSummaryTLSVersionParamsHTTPVersion{radar.HTTPSummaryTLSVersionParamsHTTPVersionHttPv1, radar.HTTPSummaryTLSVersionParamsHTTPVersionHttPv2, radar.HTTPSummaryTLSVersionParamsHTTPVersionHttPv3}),
+ IPVersion: cloudflare.F([]radar.HTTPSummaryTLSVersionParamsIPVersion{radar.HTTPSummaryTLSVersionParamsIPVersionIPv4, radar.HTTPSummaryTLSVersionParamsIPVersionIPv6}),
+ Location: cloudflare.F([]string{"string", "string", "string"}),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ OS: cloudflare.F([]radar.HTTPSummaryTLSVersionParamsOS{radar.HTTPSummaryTLSVersionParamsOSWindows, radar.HTTPSummaryTLSVersionParamsOSMacosx, radar.HTTPSummaryTLSVersionParamsOSIos}),
+ })
+ 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/radar/httptimeseriesgroup.go b/radar/httptimeseriesgroup.go
new file mode 100644
index 00000000000..915b8c162cc
--- /dev/null
+++ b/radar/httptimeseriesgroup.go
@@ -0,0 +1,2115 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "context"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// HTTPTimeseriesGroupService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewHTTPTimeseriesGroupService]
+// method instead.
+type HTTPTimeseriesGroupService struct {
+ Options []option.RequestOption
+}
+
+// NewHTTPTimeseriesGroupService generates a new service that applies the given
+// options to each request. These options are applied after the parent client's
+// options (if there is one), and before any request-specific options.
+func NewHTTPTimeseriesGroupService(opts ...option.RequestOption) (r *HTTPTimeseriesGroupService) {
+ r = &HTTPTimeseriesGroupService{}
+ r.Options = opts
+ return
+}
+
+// Get a time series of the percentage distribution of traffic classified as
+// automated or human. Visit
+// https://developers.cloudflare.com/radar/concepts/bot-classes/ for more
+// information.
+func (r *HTTPTimeseriesGroupService) BotClass(ctx context.Context, query HTTPTimeseriesGroupBotClassParams, opts ...option.RequestOption) (res *HTTPTimeseriesGroupBotClassResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env HTTPTimeseriesGroupBotClassResponseEnvelope
+ path := "radar/http/timeseries_groups/bot_class"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Get a time series of the percentage distribution of traffic of the top user
+// agents.
+func (r *HTTPTimeseriesGroupService) Browser(ctx context.Context, query HTTPTimeseriesGroupBrowserParams, opts ...option.RequestOption) (res *HTTPTimeseriesGroupBrowserResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env HTTPTimeseriesGroupBrowserResponseEnvelope
+ path := "radar/http/timeseries_groups/browser"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Get a time series of the percentage distribution of traffic of the top user
+// agents aggregated in families.
+func (r *HTTPTimeseriesGroupService) BrowserFamily(ctx context.Context, query HTTPTimeseriesGroupBrowserFamilyParams, opts ...option.RequestOption) (res *HTTPTimeseriesGroupBrowserFamilyResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env HTTPTimeseriesGroupBrowserFamilyResponseEnvelope
+ path := "radar/http/timeseries_groups/browser_family"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Get a time series of the percentage distribution of traffic per device type.
+func (r *HTTPTimeseriesGroupService) DeviceType(ctx context.Context, query HTTPTimeseriesGroupDeviceTypeParams, opts ...option.RequestOption) (res *HTTPTimeseriesGroupDeviceTypeResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env HTTPTimeseriesGroupDeviceTypeResponseEnvelope
+ path := "radar/http/timeseries_groups/device_type"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Get a time series of the percentage distribution of traffic per HTTP protocol.
+func (r *HTTPTimeseriesGroupService) HTTPProtocol(ctx context.Context, query HTTPTimeseriesGroupHTTPProtocolParams, opts ...option.RequestOption) (res *HTTPTimeseriesGroupHTTPProtocolResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env HTTPTimeseriesGroupHTTPProtocolResponseEnvelope
+ path := "radar/http/timeseries_groups/http_protocol"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Get a time series of the percentage distribution of traffic per HTTP protocol
+// version.
+func (r *HTTPTimeseriesGroupService) HTTPVersion(ctx context.Context, query HTTPTimeseriesGroupHTTPVersionParams, opts ...option.RequestOption) (res *HTTPTimeseriesGroupHTTPVersionResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env HTTPTimeseriesGroupHTTPVersionResponseEnvelope
+ path := "radar/http/timeseries_groups/http_version"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Get a time series of the percentage distribution of traffic per IP protocol
+// version.
+func (r *HTTPTimeseriesGroupService) IPVersion(ctx context.Context, query HTTPTimeseriesGroupIPVersionParams, opts ...option.RequestOption) (res *HTTPTimeseriesGroupIPVersionResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env HTTPTimeseriesGroupIPVersionResponseEnvelope
+ path := "radar/http/timeseries_groups/ip_version"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Get a time series of the percentage distribution of traffic of the top operating
+// systems.
+func (r *HTTPTimeseriesGroupService) OS(ctx context.Context, query HTTPTimeseriesGroupOSParams, opts ...option.RequestOption) (res *HTTPTimeseriesGroupOSResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env HTTPTimeseriesGroupOSResponseEnvelope
+ path := "radar/http/timeseries_groups/os"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Get a time series of the percentage distribution of traffic per TLS protocol
+// version.
+func (r *HTTPTimeseriesGroupService) TLSVersion(ctx context.Context, query HTTPTimeseriesGroupTLSVersionParams, opts ...option.RequestOption) (res *HTTPTimeseriesGroupTLSVersionResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env HTTPTimeseriesGroupTLSVersionResponseEnvelope
+ path := "radar/http/timeseries_groups/tls_version"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type HTTPTimeseriesGroupBotClassResponse struct {
+ Meta interface{} `json:"meta,required"`
+ Serie0 HTTPTimeseriesGroupBotClassResponseSerie0 `json:"serie_0,required"`
+ JSON httpTimeseriesGroupBotClassResponseJSON `json:"-"`
+}
+
+// httpTimeseriesGroupBotClassResponseJSON contains the JSON metadata for the
+// struct [HTTPTimeseriesGroupBotClassResponse]
+type httpTimeseriesGroupBotClassResponseJSON struct {
+ Meta apijson.Field
+ Serie0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPTimeseriesGroupBotClassResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpTimeseriesGroupBotClassResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPTimeseriesGroupBotClassResponseSerie0 struct {
+ Bot []string `json:"bot,required"`
+ Human []string `json:"human,required"`
+ Timestamps []string `json:"timestamps,required"`
+ JSON httpTimeseriesGroupBotClassResponseSerie0JSON `json:"-"`
+}
+
+// httpTimeseriesGroupBotClassResponseSerie0JSON contains the JSON metadata for the
+// struct [HTTPTimeseriesGroupBotClassResponseSerie0]
+type httpTimeseriesGroupBotClassResponseSerie0JSON struct {
+ Bot apijson.Field
+ Human apijson.Field
+ Timestamps apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPTimeseriesGroupBotClassResponseSerie0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpTimeseriesGroupBotClassResponseSerie0JSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPTimeseriesGroupBrowserResponse struct {
+ Meta interface{} `json:"meta,required"`
+ Serie0 HTTPTimeseriesGroupBrowserResponseSerie0 `json:"serie_0,required"`
+ JSON httpTimeseriesGroupBrowserResponseJSON `json:"-"`
+}
+
+// httpTimeseriesGroupBrowserResponseJSON contains the JSON metadata for the struct
+// [HTTPTimeseriesGroupBrowserResponse]
+type httpTimeseriesGroupBrowserResponseJSON struct {
+ Meta apijson.Field
+ Serie0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPTimeseriesGroupBrowserResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpTimeseriesGroupBrowserResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPTimeseriesGroupBrowserResponseSerie0 struct {
+ Timestamps []string `json:"timestamps,required"`
+ ExtraFields map[string][]string `json:"-,extras"`
+ JSON httpTimeseriesGroupBrowserResponseSerie0JSON `json:"-"`
+}
+
+// httpTimeseriesGroupBrowserResponseSerie0JSON contains the JSON metadata for the
+// struct [HTTPTimeseriesGroupBrowserResponseSerie0]
+type httpTimeseriesGroupBrowserResponseSerie0JSON struct {
+ Timestamps apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPTimeseriesGroupBrowserResponseSerie0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpTimeseriesGroupBrowserResponseSerie0JSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPTimeseriesGroupBrowserFamilyResponse struct {
+ Meta interface{} `json:"meta,required"`
+ Serie0 HTTPTimeseriesGroupBrowserFamilyResponseSerie0 `json:"serie_0,required"`
+ JSON httpTimeseriesGroupBrowserFamilyResponseJSON `json:"-"`
+}
+
+// httpTimeseriesGroupBrowserFamilyResponseJSON contains the JSON metadata for the
+// struct [HTTPTimeseriesGroupBrowserFamilyResponse]
+type httpTimeseriesGroupBrowserFamilyResponseJSON struct {
+ Meta apijson.Field
+ Serie0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPTimeseriesGroupBrowserFamilyResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpTimeseriesGroupBrowserFamilyResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPTimeseriesGroupBrowserFamilyResponseSerie0 struct {
+ Timestamps []string `json:"timestamps,required"`
+ ExtraFields map[string][]string `json:"-,extras"`
+ JSON httpTimeseriesGroupBrowserFamilyResponseSerie0JSON `json:"-"`
+}
+
+// httpTimeseriesGroupBrowserFamilyResponseSerie0JSON contains the JSON metadata
+// for the struct [HTTPTimeseriesGroupBrowserFamilyResponseSerie0]
+type httpTimeseriesGroupBrowserFamilyResponseSerie0JSON struct {
+ Timestamps apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPTimeseriesGroupBrowserFamilyResponseSerie0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpTimeseriesGroupBrowserFamilyResponseSerie0JSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPTimeseriesGroupDeviceTypeResponse struct {
+ Meta interface{} `json:"meta,required"`
+ Serie0 HTTPTimeseriesGroupDeviceTypeResponseSerie0 `json:"serie_0,required"`
+ JSON httpTimeseriesGroupDeviceTypeResponseJSON `json:"-"`
+}
+
+// httpTimeseriesGroupDeviceTypeResponseJSON contains the JSON metadata for the
+// struct [HTTPTimeseriesGroupDeviceTypeResponse]
+type httpTimeseriesGroupDeviceTypeResponseJSON struct {
+ Meta apijson.Field
+ Serie0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPTimeseriesGroupDeviceTypeResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpTimeseriesGroupDeviceTypeResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPTimeseriesGroupDeviceTypeResponseSerie0 struct {
+ Desktop []string `json:"desktop,required"`
+ Mobile []string `json:"mobile,required"`
+ Other []string `json:"other,required"`
+ Timestamps []string `json:"timestamps,required"`
+ JSON httpTimeseriesGroupDeviceTypeResponseSerie0JSON `json:"-"`
+}
+
+// httpTimeseriesGroupDeviceTypeResponseSerie0JSON contains the JSON metadata for
+// the struct [HTTPTimeseriesGroupDeviceTypeResponseSerie0]
+type httpTimeseriesGroupDeviceTypeResponseSerie0JSON struct {
+ Desktop apijson.Field
+ Mobile apijson.Field
+ Other apijson.Field
+ Timestamps apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPTimeseriesGroupDeviceTypeResponseSerie0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpTimeseriesGroupDeviceTypeResponseSerie0JSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPTimeseriesGroupHTTPProtocolResponse struct {
+ Meta interface{} `json:"meta,required"`
+ Serie0 HTTPTimeseriesGroupHTTPProtocolResponseSerie0 `json:"serie_0,required"`
+ JSON httpTimeseriesGroupHTTPProtocolResponseJSON `json:"-"`
+}
+
+// httpTimeseriesGroupHTTPProtocolResponseJSON contains the JSON metadata for the
+// struct [HTTPTimeseriesGroupHTTPProtocolResponse]
+type httpTimeseriesGroupHTTPProtocolResponseJSON struct {
+ Meta apijson.Field
+ Serie0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPTimeseriesGroupHTTPProtocolResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpTimeseriesGroupHTTPProtocolResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPTimeseriesGroupHTTPProtocolResponseSerie0 struct {
+ HTTP []string `json:"http,required"`
+ HTTPS []string `json:"https,required"`
+ Timestamps []string `json:"timestamps,required"`
+ JSON httpTimeseriesGroupHTTPProtocolResponseSerie0JSON `json:"-"`
+}
+
+// httpTimeseriesGroupHTTPProtocolResponseSerie0JSON contains the JSON metadata for
+// the struct [HTTPTimeseriesGroupHTTPProtocolResponseSerie0]
+type httpTimeseriesGroupHTTPProtocolResponseSerie0JSON struct {
+ HTTP apijson.Field
+ HTTPS apijson.Field
+ Timestamps apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPTimeseriesGroupHTTPProtocolResponseSerie0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpTimeseriesGroupHTTPProtocolResponseSerie0JSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPTimeseriesGroupHTTPVersionResponse struct {
+ Meta interface{} `json:"meta,required"`
+ Serie0 HTTPTimeseriesGroupHTTPVersionResponseSerie0 `json:"serie_0,required"`
+ JSON httpTimeseriesGroupHTTPVersionResponseJSON `json:"-"`
+}
+
+// httpTimeseriesGroupHTTPVersionResponseJSON contains the JSON metadata for the
+// struct [HTTPTimeseriesGroupHTTPVersionResponse]
+type httpTimeseriesGroupHTTPVersionResponseJSON struct {
+ Meta apijson.Field
+ Serie0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPTimeseriesGroupHTTPVersionResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpTimeseriesGroupHTTPVersionResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPTimeseriesGroupHTTPVersionResponseSerie0 struct {
+ HTTP1X []string `json:"HTTP/1.x,required"`
+ HTTP2 []string `json:"HTTP/2,required"`
+ HTTP3 []string `json:"HTTP/3,required"`
+ Timestamps []string `json:"timestamps,required"`
+ JSON httpTimeseriesGroupHTTPVersionResponseSerie0JSON `json:"-"`
+}
+
+// httpTimeseriesGroupHTTPVersionResponseSerie0JSON contains the JSON metadata for
+// the struct [HTTPTimeseriesGroupHTTPVersionResponseSerie0]
+type httpTimeseriesGroupHTTPVersionResponseSerie0JSON struct {
+ HTTP1X apijson.Field
+ HTTP2 apijson.Field
+ HTTP3 apijson.Field
+ Timestamps apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPTimeseriesGroupHTTPVersionResponseSerie0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpTimeseriesGroupHTTPVersionResponseSerie0JSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPTimeseriesGroupIPVersionResponse struct {
+ Meta interface{} `json:"meta,required"`
+ Serie0 HTTPTimeseriesGroupIPVersionResponseSerie0 `json:"serie_0,required"`
+ JSON httpTimeseriesGroupIPVersionResponseJSON `json:"-"`
+}
+
+// httpTimeseriesGroupIPVersionResponseJSON contains the JSON metadata for the
+// struct [HTTPTimeseriesGroupIPVersionResponse]
+type httpTimeseriesGroupIPVersionResponseJSON struct {
+ Meta apijson.Field
+ Serie0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPTimeseriesGroupIPVersionResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpTimeseriesGroupIPVersionResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPTimeseriesGroupIPVersionResponseSerie0 struct {
+ IPv4 []string `json:"IPv4,required"`
+ IPv6 []string `json:"IPv6,required"`
+ Timestamps []string `json:"timestamps,required"`
+ JSON httpTimeseriesGroupIPVersionResponseSerie0JSON `json:"-"`
+}
+
+// httpTimeseriesGroupIPVersionResponseSerie0JSON contains the JSON metadata for
+// the struct [HTTPTimeseriesGroupIPVersionResponseSerie0]
+type httpTimeseriesGroupIPVersionResponseSerie0JSON struct {
+ IPv4 apijson.Field
+ IPv6 apijson.Field
+ Timestamps apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPTimeseriesGroupIPVersionResponseSerie0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpTimeseriesGroupIPVersionResponseSerie0JSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPTimeseriesGroupOSResponse struct {
+ Meta interface{} `json:"meta,required"`
+ Serie0 HTTPTimeseriesGroupOSResponseSerie0 `json:"serie_0,required"`
+ JSON httpTimeseriesGroupOSResponseJSON `json:"-"`
+}
+
+// httpTimeseriesGroupOSResponseJSON contains the JSON metadata for the struct
+// [HTTPTimeseriesGroupOSResponse]
+type httpTimeseriesGroupOSResponseJSON struct {
+ Meta apijson.Field
+ Serie0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPTimeseriesGroupOSResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpTimeseriesGroupOSResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPTimeseriesGroupOSResponseSerie0 struct {
+ Timestamps []string `json:"timestamps,required"`
+ ExtraFields map[string][]string `json:"-,extras"`
+ JSON httpTimeseriesGroupOSResponseSerie0JSON `json:"-"`
+}
+
+// httpTimeseriesGroupOSResponseSerie0JSON contains the JSON metadata for the
+// struct [HTTPTimeseriesGroupOSResponseSerie0]
+type httpTimeseriesGroupOSResponseSerie0JSON struct {
+ Timestamps apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPTimeseriesGroupOSResponseSerie0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpTimeseriesGroupOSResponseSerie0JSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPTimeseriesGroupTLSVersionResponse struct {
+ Meta interface{} `json:"meta,required"`
+ Serie0 HTTPTimeseriesGroupTLSVersionResponseSerie0 `json:"serie_0,required"`
+ JSON httpTimeseriesGroupTLSVersionResponseJSON `json:"-"`
+}
+
+// httpTimeseriesGroupTLSVersionResponseJSON contains the JSON metadata for the
+// struct [HTTPTimeseriesGroupTLSVersionResponse]
+type httpTimeseriesGroupTLSVersionResponseJSON struct {
+ Meta apijson.Field
+ Serie0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPTimeseriesGroupTLSVersionResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpTimeseriesGroupTLSVersionResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPTimeseriesGroupTLSVersionResponseSerie0 struct {
+ Timestamps []string `json:"timestamps,required"`
+ TLS1_0 []string `json:"TLS 1.0,required"`
+ TLS1_1 []string `json:"TLS 1.1,required"`
+ TLS1_2 []string `json:"TLS 1.2,required"`
+ TLS1_3 []string `json:"TLS 1.3,required"`
+ TLSQuic []string `json:"TLS QUIC,required"`
+ JSON httpTimeseriesGroupTLSVersionResponseSerie0JSON `json:"-"`
+}
+
+// httpTimeseriesGroupTLSVersionResponseSerie0JSON contains the JSON metadata for
+// the struct [HTTPTimeseriesGroupTLSVersionResponseSerie0]
+type httpTimeseriesGroupTLSVersionResponseSerie0JSON struct {
+ Timestamps apijson.Field
+ TLS1_0 apijson.Field
+ TLS1_1 apijson.Field
+ TLS1_2 apijson.Field
+ TLS1_3 apijson.Field
+ TLSQuic apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPTimeseriesGroupTLSVersionResponseSerie0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpTimeseriesGroupTLSVersionResponseSerie0JSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPTimeseriesGroupBotClassParams struct {
+ // Aggregation interval results should be returned in (for example, in 15 minutes
+ // or 1 hour intervals). Refer to
+ // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+ AggInterval param.Field[HTTPTimeseriesGroupBotClassParamsAggInterval] `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"`
+ // 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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]HTTPTimeseriesGroupBotClassParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Filter for device type.
+ DeviceType param.Field[[]HTTPTimeseriesGroupBotClassParamsDeviceType] `query:"deviceType"`
+ // Format results are returned in.
+ Format param.Field[HTTPTimeseriesGroupBotClassParamsFormat] `query:"format"`
+ // Filter for http protocol.
+ HTTPProtocol param.Field[[]HTTPTimeseriesGroupBotClassParamsHTTPProtocol] `query:"httpProtocol"`
+ // Filter for http version.
+ HTTPVersion param.Field[[]HTTPTimeseriesGroupBotClassParamsHTTPVersion] `query:"httpVersion"`
+ // Filter for ip version.
+ IPVersion param.Field[[]HTTPTimeseriesGroupBotClassParamsIPVersion] `query:"ipVersion"`
+ // 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 os name.
+ OS param.Field[[]HTTPTimeseriesGroupBotClassParamsOS] `query:"os"`
+ // Filter for tls version.
+ TLSVersion param.Field[[]HTTPTimeseriesGroupBotClassParamsTLSVersion] `query:"tlsVersion"`
+}
+
+// URLQuery serializes [HTTPTimeseriesGroupBotClassParams]'s query parameters as
+// `url.Values`.
+func (r HTTPTimeseriesGroupBotClassParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Aggregation interval results should be returned in (for example, in 15 minutes
+// or 1 hour intervals). Refer to
+// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+type HTTPTimeseriesGroupBotClassParamsAggInterval string
+
+const (
+ HTTPTimeseriesGroupBotClassParamsAggInterval15m HTTPTimeseriesGroupBotClassParamsAggInterval = "15m"
+ HTTPTimeseriesGroupBotClassParamsAggInterval1h HTTPTimeseriesGroupBotClassParamsAggInterval = "1h"
+ HTTPTimeseriesGroupBotClassParamsAggInterval1d HTTPTimeseriesGroupBotClassParamsAggInterval = "1d"
+ HTTPTimeseriesGroupBotClassParamsAggInterval1w HTTPTimeseriesGroupBotClassParamsAggInterval = "1w"
+)
+
+type HTTPTimeseriesGroupBotClassParamsDateRange string
+
+const (
+ HTTPTimeseriesGroupBotClassParamsDateRange1d HTTPTimeseriesGroupBotClassParamsDateRange = "1d"
+ HTTPTimeseriesGroupBotClassParamsDateRange2d HTTPTimeseriesGroupBotClassParamsDateRange = "2d"
+ HTTPTimeseriesGroupBotClassParamsDateRange7d HTTPTimeseriesGroupBotClassParamsDateRange = "7d"
+ HTTPTimeseriesGroupBotClassParamsDateRange14d HTTPTimeseriesGroupBotClassParamsDateRange = "14d"
+ HTTPTimeseriesGroupBotClassParamsDateRange28d HTTPTimeseriesGroupBotClassParamsDateRange = "28d"
+ HTTPTimeseriesGroupBotClassParamsDateRange12w HTTPTimeseriesGroupBotClassParamsDateRange = "12w"
+ HTTPTimeseriesGroupBotClassParamsDateRange24w HTTPTimeseriesGroupBotClassParamsDateRange = "24w"
+ HTTPTimeseriesGroupBotClassParamsDateRange52w HTTPTimeseriesGroupBotClassParamsDateRange = "52w"
+ HTTPTimeseriesGroupBotClassParamsDateRange1dControl HTTPTimeseriesGroupBotClassParamsDateRange = "1dControl"
+ HTTPTimeseriesGroupBotClassParamsDateRange2dControl HTTPTimeseriesGroupBotClassParamsDateRange = "2dControl"
+ HTTPTimeseriesGroupBotClassParamsDateRange7dControl HTTPTimeseriesGroupBotClassParamsDateRange = "7dControl"
+ HTTPTimeseriesGroupBotClassParamsDateRange14dControl HTTPTimeseriesGroupBotClassParamsDateRange = "14dControl"
+ HTTPTimeseriesGroupBotClassParamsDateRange28dControl HTTPTimeseriesGroupBotClassParamsDateRange = "28dControl"
+ HTTPTimeseriesGroupBotClassParamsDateRange12wControl HTTPTimeseriesGroupBotClassParamsDateRange = "12wControl"
+ HTTPTimeseriesGroupBotClassParamsDateRange24wControl HTTPTimeseriesGroupBotClassParamsDateRange = "24wControl"
+)
+
+type HTTPTimeseriesGroupBotClassParamsDeviceType string
+
+const (
+ HTTPTimeseriesGroupBotClassParamsDeviceTypeDesktop HTTPTimeseriesGroupBotClassParamsDeviceType = "DESKTOP"
+ HTTPTimeseriesGroupBotClassParamsDeviceTypeMobile HTTPTimeseriesGroupBotClassParamsDeviceType = "MOBILE"
+ HTTPTimeseriesGroupBotClassParamsDeviceTypeOther HTTPTimeseriesGroupBotClassParamsDeviceType = "OTHER"
+)
+
+// Format results are returned in.
+type HTTPTimeseriesGroupBotClassParamsFormat string
+
+const (
+ HTTPTimeseriesGroupBotClassParamsFormatJson HTTPTimeseriesGroupBotClassParamsFormat = "JSON"
+ HTTPTimeseriesGroupBotClassParamsFormatCsv HTTPTimeseriesGroupBotClassParamsFormat = "CSV"
+)
+
+type HTTPTimeseriesGroupBotClassParamsHTTPProtocol string
+
+const (
+ HTTPTimeseriesGroupBotClassParamsHTTPProtocolHTTP HTTPTimeseriesGroupBotClassParamsHTTPProtocol = "HTTP"
+ HTTPTimeseriesGroupBotClassParamsHTTPProtocolHTTPS HTTPTimeseriesGroupBotClassParamsHTTPProtocol = "HTTPS"
+)
+
+type HTTPTimeseriesGroupBotClassParamsHTTPVersion string
+
+const (
+ HTTPTimeseriesGroupBotClassParamsHTTPVersionHttPv1 HTTPTimeseriesGroupBotClassParamsHTTPVersion = "HTTPv1"
+ HTTPTimeseriesGroupBotClassParamsHTTPVersionHttPv2 HTTPTimeseriesGroupBotClassParamsHTTPVersion = "HTTPv2"
+ HTTPTimeseriesGroupBotClassParamsHTTPVersionHttPv3 HTTPTimeseriesGroupBotClassParamsHTTPVersion = "HTTPv3"
+)
+
+type HTTPTimeseriesGroupBotClassParamsIPVersion string
+
+const (
+ HTTPTimeseriesGroupBotClassParamsIPVersionIPv4 HTTPTimeseriesGroupBotClassParamsIPVersion = "IPv4"
+ HTTPTimeseriesGroupBotClassParamsIPVersionIPv6 HTTPTimeseriesGroupBotClassParamsIPVersion = "IPv6"
+)
+
+type HTTPTimeseriesGroupBotClassParamsOS string
+
+const (
+ HTTPTimeseriesGroupBotClassParamsOSWindows HTTPTimeseriesGroupBotClassParamsOS = "WINDOWS"
+ HTTPTimeseriesGroupBotClassParamsOSMacosx HTTPTimeseriesGroupBotClassParamsOS = "MACOSX"
+ HTTPTimeseriesGroupBotClassParamsOSIos HTTPTimeseriesGroupBotClassParamsOS = "IOS"
+ HTTPTimeseriesGroupBotClassParamsOSAndroid HTTPTimeseriesGroupBotClassParamsOS = "ANDROID"
+ HTTPTimeseriesGroupBotClassParamsOSChromeos HTTPTimeseriesGroupBotClassParamsOS = "CHROMEOS"
+ HTTPTimeseriesGroupBotClassParamsOSLinux HTTPTimeseriesGroupBotClassParamsOS = "LINUX"
+ HTTPTimeseriesGroupBotClassParamsOSSmartTv HTTPTimeseriesGroupBotClassParamsOS = "SMART_TV"
+)
+
+type HTTPTimeseriesGroupBotClassParamsTLSVersion string
+
+const (
+ HTTPTimeseriesGroupBotClassParamsTLSVersionTlSv1_0 HTTPTimeseriesGroupBotClassParamsTLSVersion = "TLSv1_0"
+ HTTPTimeseriesGroupBotClassParamsTLSVersionTlSv1_1 HTTPTimeseriesGroupBotClassParamsTLSVersion = "TLSv1_1"
+ HTTPTimeseriesGroupBotClassParamsTLSVersionTlSv1_2 HTTPTimeseriesGroupBotClassParamsTLSVersion = "TLSv1_2"
+ HTTPTimeseriesGroupBotClassParamsTLSVersionTlSv1_3 HTTPTimeseriesGroupBotClassParamsTLSVersion = "TLSv1_3"
+ HTTPTimeseriesGroupBotClassParamsTLSVersionTlSvQuic HTTPTimeseriesGroupBotClassParamsTLSVersion = "TLSvQUIC"
+)
+
+type HTTPTimeseriesGroupBotClassResponseEnvelope struct {
+ Result HTTPTimeseriesGroupBotClassResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON httpTimeseriesGroupBotClassResponseEnvelopeJSON `json:"-"`
+}
+
+// httpTimeseriesGroupBotClassResponseEnvelopeJSON contains the JSON metadata for
+// the struct [HTTPTimeseriesGroupBotClassResponseEnvelope]
+type httpTimeseriesGroupBotClassResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPTimeseriesGroupBotClassResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpTimeseriesGroupBotClassResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPTimeseriesGroupBrowserParams struct {
+ // Aggregation interval results should be returned in (for example, in 15 minutes
+ // or 1 hour intervals). Refer to
+ // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+ AggInterval param.Field[HTTPTimeseriesGroupBrowserParamsAggInterval] `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"`
+ // Filter for bot class. Refer to
+ // [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/).
+ BotClass param.Field[[]HTTPTimeseriesGroupBrowserParamsBotClass] `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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]HTTPTimeseriesGroupBrowserParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Filter for device type.
+ DeviceType param.Field[[]HTTPTimeseriesGroupBrowserParamsDeviceType] `query:"deviceType"`
+ // Format results are returned in.
+ Format param.Field[HTTPTimeseriesGroupBrowserParamsFormat] `query:"format"`
+ // Filter for http protocol.
+ HTTPProtocol param.Field[[]HTTPTimeseriesGroupBrowserParamsHTTPProtocol] `query:"httpProtocol"`
+ // Filter for http version.
+ HTTPVersion param.Field[[]HTTPTimeseriesGroupBrowserParamsHTTPVersion] `query:"httpVersion"`
+ // Filter for ip version.
+ IPVersion param.Field[[]HTTPTimeseriesGroupBrowserParamsIPVersion] `query:"ipVersion"`
+ // Limit the number of objects (eg browsers, verticals, etc) to the top items over
+ // the time range.
+ LimitPerGroup param.Field[int64] `query:"limitPerGroup"`
+ // Array of comma separated list of locations (alpha-2 country codes). Start with
+ // `-` to exclude from results. For example, `-US,PT` excludes results from the US,
+ // but includes results from PT.
+ 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 os name.
+ OS param.Field[[]HTTPTimeseriesGroupBrowserParamsOS] `query:"os"`
+ // Filter for tls version.
+ TLSVersion param.Field[[]HTTPTimeseriesGroupBrowserParamsTLSVersion] `query:"tlsVersion"`
+}
+
+// URLQuery serializes [HTTPTimeseriesGroupBrowserParams]'s query parameters as
+// `url.Values`.
+func (r HTTPTimeseriesGroupBrowserParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Aggregation interval results should be returned in (for example, in 15 minutes
+// or 1 hour intervals). Refer to
+// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+type HTTPTimeseriesGroupBrowserParamsAggInterval string
+
+const (
+ HTTPTimeseriesGroupBrowserParamsAggInterval15m HTTPTimeseriesGroupBrowserParamsAggInterval = "15m"
+ HTTPTimeseriesGroupBrowserParamsAggInterval1h HTTPTimeseriesGroupBrowserParamsAggInterval = "1h"
+ HTTPTimeseriesGroupBrowserParamsAggInterval1d HTTPTimeseriesGroupBrowserParamsAggInterval = "1d"
+ HTTPTimeseriesGroupBrowserParamsAggInterval1w HTTPTimeseriesGroupBrowserParamsAggInterval = "1w"
+)
+
+type HTTPTimeseriesGroupBrowserParamsBotClass string
+
+const (
+ HTTPTimeseriesGroupBrowserParamsBotClassLikelyAutomated HTTPTimeseriesGroupBrowserParamsBotClass = "LIKELY_AUTOMATED"
+ HTTPTimeseriesGroupBrowserParamsBotClassLikelyHuman HTTPTimeseriesGroupBrowserParamsBotClass = "LIKELY_HUMAN"
+)
+
+type HTTPTimeseriesGroupBrowserParamsDateRange string
+
+const (
+ HTTPTimeseriesGroupBrowserParamsDateRange1d HTTPTimeseriesGroupBrowserParamsDateRange = "1d"
+ HTTPTimeseriesGroupBrowserParamsDateRange2d HTTPTimeseriesGroupBrowserParamsDateRange = "2d"
+ HTTPTimeseriesGroupBrowserParamsDateRange7d HTTPTimeseriesGroupBrowserParamsDateRange = "7d"
+ HTTPTimeseriesGroupBrowserParamsDateRange14d HTTPTimeseriesGroupBrowserParamsDateRange = "14d"
+ HTTPTimeseriesGroupBrowserParamsDateRange28d HTTPTimeseriesGroupBrowserParamsDateRange = "28d"
+ HTTPTimeseriesGroupBrowserParamsDateRange12w HTTPTimeseriesGroupBrowserParamsDateRange = "12w"
+ HTTPTimeseriesGroupBrowserParamsDateRange24w HTTPTimeseriesGroupBrowserParamsDateRange = "24w"
+ HTTPTimeseriesGroupBrowserParamsDateRange52w HTTPTimeseriesGroupBrowserParamsDateRange = "52w"
+ HTTPTimeseriesGroupBrowserParamsDateRange1dControl HTTPTimeseriesGroupBrowserParamsDateRange = "1dControl"
+ HTTPTimeseriesGroupBrowserParamsDateRange2dControl HTTPTimeseriesGroupBrowserParamsDateRange = "2dControl"
+ HTTPTimeseriesGroupBrowserParamsDateRange7dControl HTTPTimeseriesGroupBrowserParamsDateRange = "7dControl"
+ HTTPTimeseriesGroupBrowserParamsDateRange14dControl HTTPTimeseriesGroupBrowserParamsDateRange = "14dControl"
+ HTTPTimeseriesGroupBrowserParamsDateRange28dControl HTTPTimeseriesGroupBrowserParamsDateRange = "28dControl"
+ HTTPTimeseriesGroupBrowserParamsDateRange12wControl HTTPTimeseriesGroupBrowserParamsDateRange = "12wControl"
+ HTTPTimeseriesGroupBrowserParamsDateRange24wControl HTTPTimeseriesGroupBrowserParamsDateRange = "24wControl"
+)
+
+type HTTPTimeseriesGroupBrowserParamsDeviceType string
+
+const (
+ HTTPTimeseriesGroupBrowserParamsDeviceTypeDesktop HTTPTimeseriesGroupBrowserParamsDeviceType = "DESKTOP"
+ HTTPTimeseriesGroupBrowserParamsDeviceTypeMobile HTTPTimeseriesGroupBrowserParamsDeviceType = "MOBILE"
+ HTTPTimeseriesGroupBrowserParamsDeviceTypeOther HTTPTimeseriesGroupBrowserParamsDeviceType = "OTHER"
+)
+
+// Format results are returned in.
+type HTTPTimeseriesGroupBrowserParamsFormat string
+
+const (
+ HTTPTimeseriesGroupBrowserParamsFormatJson HTTPTimeseriesGroupBrowserParamsFormat = "JSON"
+ HTTPTimeseriesGroupBrowserParamsFormatCsv HTTPTimeseriesGroupBrowserParamsFormat = "CSV"
+)
+
+type HTTPTimeseriesGroupBrowserParamsHTTPProtocol string
+
+const (
+ HTTPTimeseriesGroupBrowserParamsHTTPProtocolHTTP HTTPTimeseriesGroupBrowserParamsHTTPProtocol = "HTTP"
+ HTTPTimeseriesGroupBrowserParamsHTTPProtocolHTTPS HTTPTimeseriesGroupBrowserParamsHTTPProtocol = "HTTPS"
+)
+
+type HTTPTimeseriesGroupBrowserParamsHTTPVersion string
+
+const (
+ HTTPTimeseriesGroupBrowserParamsHTTPVersionHttPv1 HTTPTimeseriesGroupBrowserParamsHTTPVersion = "HTTPv1"
+ HTTPTimeseriesGroupBrowserParamsHTTPVersionHttPv2 HTTPTimeseriesGroupBrowserParamsHTTPVersion = "HTTPv2"
+ HTTPTimeseriesGroupBrowserParamsHTTPVersionHttPv3 HTTPTimeseriesGroupBrowserParamsHTTPVersion = "HTTPv3"
+)
+
+type HTTPTimeseriesGroupBrowserParamsIPVersion string
+
+const (
+ HTTPTimeseriesGroupBrowserParamsIPVersionIPv4 HTTPTimeseriesGroupBrowserParamsIPVersion = "IPv4"
+ HTTPTimeseriesGroupBrowserParamsIPVersionIPv6 HTTPTimeseriesGroupBrowserParamsIPVersion = "IPv6"
+)
+
+type HTTPTimeseriesGroupBrowserParamsOS string
+
+const (
+ HTTPTimeseriesGroupBrowserParamsOSWindows HTTPTimeseriesGroupBrowserParamsOS = "WINDOWS"
+ HTTPTimeseriesGroupBrowserParamsOSMacosx HTTPTimeseriesGroupBrowserParamsOS = "MACOSX"
+ HTTPTimeseriesGroupBrowserParamsOSIos HTTPTimeseriesGroupBrowserParamsOS = "IOS"
+ HTTPTimeseriesGroupBrowserParamsOSAndroid HTTPTimeseriesGroupBrowserParamsOS = "ANDROID"
+ HTTPTimeseriesGroupBrowserParamsOSChromeos HTTPTimeseriesGroupBrowserParamsOS = "CHROMEOS"
+ HTTPTimeseriesGroupBrowserParamsOSLinux HTTPTimeseriesGroupBrowserParamsOS = "LINUX"
+ HTTPTimeseriesGroupBrowserParamsOSSmartTv HTTPTimeseriesGroupBrowserParamsOS = "SMART_TV"
+)
+
+type HTTPTimeseriesGroupBrowserParamsTLSVersion string
+
+const (
+ HTTPTimeseriesGroupBrowserParamsTLSVersionTlSv1_0 HTTPTimeseriesGroupBrowserParamsTLSVersion = "TLSv1_0"
+ HTTPTimeseriesGroupBrowserParamsTLSVersionTlSv1_1 HTTPTimeseriesGroupBrowserParamsTLSVersion = "TLSv1_1"
+ HTTPTimeseriesGroupBrowserParamsTLSVersionTlSv1_2 HTTPTimeseriesGroupBrowserParamsTLSVersion = "TLSv1_2"
+ HTTPTimeseriesGroupBrowserParamsTLSVersionTlSv1_3 HTTPTimeseriesGroupBrowserParamsTLSVersion = "TLSv1_3"
+ HTTPTimeseriesGroupBrowserParamsTLSVersionTlSvQuic HTTPTimeseriesGroupBrowserParamsTLSVersion = "TLSvQUIC"
+)
+
+type HTTPTimeseriesGroupBrowserResponseEnvelope struct {
+ Result HTTPTimeseriesGroupBrowserResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON httpTimeseriesGroupBrowserResponseEnvelopeJSON `json:"-"`
+}
+
+// httpTimeseriesGroupBrowserResponseEnvelopeJSON contains the JSON metadata for
+// the struct [HTTPTimeseriesGroupBrowserResponseEnvelope]
+type httpTimeseriesGroupBrowserResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPTimeseriesGroupBrowserResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpTimeseriesGroupBrowserResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPTimeseriesGroupBrowserFamilyParams struct {
+ // Aggregation interval results should be returned in (for example, in 15 minutes
+ // or 1 hour intervals). Refer to
+ // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+ AggInterval param.Field[HTTPTimeseriesGroupBrowserFamilyParamsAggInterval] `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"`
+ // Filter for bot class. Refer to
+ // [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/).
+ BotClass param.Field[[]HTTPTimeseriesGroupBrowserFamilyParamsBotClass] `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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]HTTPTimeseriesGroupBrowserFamilyParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Filter for device type.
+ DeviceType param.Field[[]HTTPTimeseriesGroupBrowserFamilyParamsDeviceType] `query:"deviceType"`
+ // Format results are returned in.
+ Format param.Field[HTTPTimeseriesGroupBrowserFamilyParamsFormat] `query:"format"`
+ // Filter for http protocol.
+ HTTPProtocol param.Field[[]HTTPTimeseriesGroupBrowserFamilyParamsHTTPProtocol] `query:"httpProtocol"`
+ // Filter for http version.
+ HTTPVersion param.Field[[]HTTPTimeseriesGroupBrowserFamilyParamsHTTPVersion] `query:"httpVersion"`
+ // Filter for ip version.
+ IPVersion param.Field[[]HTTPTimeseriesGroupBrowserFamilyParamsIPVersion] `query:"ipVersion"`
+ // 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 os name.
+ OS param.Field[[]HTTPTimeseriesGroupBrowserFamilyParamsOS] `query:"os"`
+ // Filter for tls version.
+ TLSVersion param.Field[[]HTTPTimeseriesGroupBrowserFamilyParamsTLSVersion] `query:"tlsVersion"`
+}
+
+// URLQuery serializes [HTTPTimeseriesGroupBrowserFamilyParams]'s query parameters
+// as `url.Values`.
+func (r HTTPTimeseriesGroupBrowserFamilyParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Aggregation interval results should be returned in (for example, in 15 minutes
+// or 1 hour intervals). Refer to
+// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+type HTTPTimeseriesGroupBrowserFamilyParamsAggInterval string
+
+const (
+ HTTPTimeseriesGroupBrowserFamilyParamsAggInterval15m HTTPTimeseriesGroupBrowserFamilyParamsAggInterval = "15m"
+ HTTPTimeseriesGroupBrowserFamilyParamsAggInterval1h HTTPTimeseriesGroupBrowserFamilyParamsAggInterval = "1h"
+ HTTPTimeseriesGroupBrowserFamilyParamsAggInterval1d HTTPTimeseriesGroupBrowserFamilyParamsAggInterval = "1d"
+ HTTPTimeseriesGroupBrowserFamilyParamsAggInterval1w HTTPTimeseriesGroupBrowserFamilyParamsAggInterval = "1w"
+)
+
+type HTTPTimeseriesGroupBrowserFamilyParamsBotClass string
+
+const (
+ HTTPTimeseriesGroupBrowserFamilyParamsBotClassLikelyAutomated HTTPTimeseriesGroupBrowserFamilyParamsBotClass = "LIKELY_AUTOMATED"
+ HTTPTimeseriesGroupBrowserFamilyParamsBotClassLikelyHuman HTTPTimeseriesGroupBrowserFamilyParamsBotClass = "LIKELY_HUMAN"
+)
+
+type HTTPTimeseriesGroupBrowserFamilyParamsDateRange string
+
+const (
+ HTTPTimeseriesGroupBrowserFamilyParamsDateRange1d HTTPTimeseriesGroupBrowserFamilyParamsDateRange = "1d"
+ HTTPTimeseriesGroupBrowserFamilyParamsDateRange2d HTTPTimeseriesGroupBrowserFamilyParamsDateRange = "2d"
+ HTTPTimeseriesGroupBrowserFamilyParamsDateRange7d HTTPTimeseriesGroupBrowserFamilyParamsDateRange = "7d"
+ HTTPTimeseriesGroupBrowserFamilyParamsDateRange14d HTTPTimeseriesGroupBrowserFamilyParamsDateRange = "14d"
+ HTTPTimeseriesGroupBrowserFamilyParamsDateRange28d HTTPTimeseriesGroupBrowserFamilyParamsDateRange = "28d"
+ HTTPTimeseriesGroupBrowserFamilyParamsDateRange12w HTTPTimeseriesGroupBrowserFamilyParamsDateRange = "12w"
+ HTTPTimeseriesGroupBrowserFamilyParamsDateRange24w HTTPTimeseriesGroupBrowserFamilyParamsDateRange = "24w"
+ HTTPTimeseriesGroupBrowserFamilyParamsDateRange52w HTTPTimeseriesGroupBrowserFamilyParamsDateRange = "52w"
+ HTTPTimeseriesGroupBrowserFamilyParamsDateRange1dControl HTTPTimeseriesGroupBrowserFamilyParamsDateRange = "1dControl"
+ HTTPTimeseriesGroupBrowserFamilyParamsDateRange2dControl HTTPTimeseriesGroupBrowserFamilyParamsDateRange = "2dControl"
+ HTTPTimeseriesGroupBrowserFamilyParamsDateRange7dControl HTTPTimeseriesGroupBrowserFamilyParamsDateRange = "7dControl"
+ HTTPTimeseriesGroupBrowserFamilyParamsDateRange14dControl HTTPTimeseriesGroupBrowserFamilyParamsDateRange = "14dControl"
+ HTTPTimeseriesGroupBrowserFamilyParamsDateRange28dControl HTTPTimeseriesGroupBrowserFamilyParamsDateRange = "28dControl"
+ HTTPTimeseriesGroupBrowserFamilyParamsDateRange12wControl HTTPTimeseriesGroupBrowserFamilyParamsDateRange = "12wControl"
+ HTTPTimeseriesGroupBrowserFamilyParamsDateRange24wControl HTTPTimeseriesGroupBrowserFamilyParamsDateRange = "24wControl"
+)
+
+type HTTPTimeseriesGroupBrowserFamilyParamsDeviceType string
+
+const (
+ HTTPTimeseriesGroupBrowserFamilyParamsDeviceTypeDesktop HTTPTimeseriesGroupBrowserFamilyParamsDeviceType = "DESKTOP"
+ HTTPTimeseriesGroupBrowserFamilyParamsDeviceTypeMobile HTTPTimeseriesGroupBrowserFamilyParamsDeviceType = "MOBILE"
+ HTTPTimeseriesGroupBrowserFamilyParamsDeviceTypeOther HTTPTimeseriesGroupBrowserFamilyParamsDeviceType = "OTHER"
+)
+
+// Format results are returned in.
+type HTTPTimeseriesGroupBrowserFamilyParamsFormat string
+
+const (
+ HTTPTimeseriesGroupBrowserFamilyParamsFormatJson HTTPTimeseriesGroupBrowserFamilyParamsFormat = "JSON"
+ HTTPTimeseriesGroupBrowserFamilyParamsFormatCsv HTTPTimeseriesGroupBrowserFamilyParamsFormat = "CSV"
+)
+
+type HTTPTimeseriesGroupBrowserFamilyParamsHTTPProtocol string
+
+const (
+ HTTPTimeseriesGroupBrowserFamilyParamsHTTPProtocolHTTP HTTPTimeseriesGroupBrowserFamilyParamsHTTPProtocol = "HTTP"
+ HTTPTimeseriesGroupBrowserFamilyParamsHTTPProtocolHTTPS HTTPTimeseriesGroupBrowserFamilyParamsHTTPProtocol = "HTTPS"
+)
+
+type HTTPTimeseriesGroupBrowserFamilyParamsHTTPVersion string
+
+const (
+ HTTPTimeseriesGroupBrowserFamilyParamsHTTPVersionHttPv1 HTTPTimeseriesGroupBrowserFamilyParamsHTTPVersion = "HTTPv1"
+ HTTPTimeseriesGroupBrowserFamilyParamsHTTPVersionHttPv2 HTTPTimeseriesGroupBrowserFamilyParamsHTTPVersion = "HTTPv2"
+ HTTPTimeseriesGroupBrowserFamilyParamsHTTPVersionHttPv3 HTTPTimeseriesGroupBrowserFamilyParamsHTTPVersion = "HTTPv3"
+)
+
+type HTTPTimeseriesGroupBrowserFamilyParamsIPVersion string
+
+const (
+ HTTPTimeseriesGroupBrowserFamilyParamsIPVersionIPv4 HTTPTimeseriesGroupBrowserFamilyParamsIPVersion = "IPv4"
+ HTTPTimeseriesGroupBrowserFamilyParamsIPVersionIPv6 HTTPTimeseriesGroupBrowserFamilyParamsIPVersion = "IPv6"
+)
+
+type HTTPTimeseriesGroupBrowserFamilyParamsOS string
+
+const (
+ HTTPTimeseriesGroupBrowserFamilyParamsOSWindows HTTPTimeseriesGroupBrowserFamilyParamsOS = "WINDOWS"
+ HTTPTimeseriesGroupBrowserFamilyParamsOSMacosx HTTPTimeseriesGroupBrowserFamilyParamsOS = "MACOSX"
+ HTTPTimeseriesGroupBrowserFamilyParamsOSIos HTTPTimeseriesGroupBrowserFamilyParamsOS = "IOS"
+ HTTPTimeseriesGroupBrowserFamilyParamsOSAndroid HTTPTimeseriesGroupBrowserFamilyParamsOS = "ANDROID"
+ HTTPTimeseriesGroupBrowserFamilyParamsOSChromeos HTTPTimeseriesGroupBrowserFamilyParamsOS = "CHROMEOS"
+ HTTPTimeseriesGroupBrowserFamilyParamsOSLinux HTTPTimeseriesGroupBrowserFamilyParamsOS = "LINUX"
+ HTTPTimeseriesGroupBrowserFamilyParamsOSSmartTv HTTPTimeseriesGroupBrowserFamilyParamsOS = "SMART_TV"
+)
+
+type HTTPTimeseriesGroupBrowserFamilyParamsTLSVersion string
+
+const (
+ HTTPTimeseriesGroupBrowserFamilyParamsTLSVersionTlSv1_0 HTTPTimeseriesGroupBrowserFamilyParamsTLSVersion = "TLSv1_0"
+ HTTPTimeseriesGroupBrowserFamilyParamsTLSVersionTlSv1_1 HTTPTimeseriesGroupBrowserFamilyParamsTLSVersion = "TLSv1_1"
+ HTTPTimeseriesGroupBrowserFamilyParamsTLSVersionTlSv1_2 HTTPTimeseriesGroupBrowserFamilyParamsTLSVersion = "TLSv1_2"
+ HTTPTimeseriesGroupBrowserFamilyParamsTLSVersionTlSv1_3 HTTPTimeseriesGroupBrowserFamilyParamsTLSVersion = "TLSv1_3"
+ HTTPTimeseriesGroupBrowserFamilyParamsTLSVersionTlSvQuic HTTPTimeseriesGroupBrowserFamilyParamsTLSVersion = "TLSvQUIC"
+)
+
+type HTTPTimeseriesGroupBrowserFamilyResponseEnvelope struct {
+ Result HTTPTimeseriesGroupBrowserFamilyResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON httpTimeseriesGroupBrowserFamilyResponseEnvelopeJSON `json:"-"`
+}
+
+// httpTimeseriesGroupBrowserFamilyResponseEnvelopeJSON contains the JSON metadata
+// for the struct [HTTPTimeseriesGroupBrowserFamilyResponseEnvelope]
+type httpTimeseriesGroupBrowserFamilyResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPTimeseriesGroupBrowserFamilyResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpTimeseriesGroupBrowserFamilyResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPTimeseriesGroupDeviceTypeParams struct {
+ // Aggregation interval results should be returned in (for example, in 15 minutes
+ // or 1 hour intervals). Refer to
+ // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+ AggInterval param.Field[HTTPTimeseriesGroupDeviceTypeParamsAggInterval] `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"`
+ // Filter for bot class. Refer to
+ // [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/).
+ BotClass param.Field[[]HTTPTimeseriesGroupDeviceTypeParamsBotClass] `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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]HTTPTimeseriesGroupDeviceTypeParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Format results are returned in.
+ Format param.Field[HTTPTimeseriesGroupDeviceTypeParamsFormat] `query:"format"`
+ // Filter for http protocol.
+ HTTPProtocol param.Field[[]HTTPTimeseriesGroupDeviceTypeParamsHTTPProtocol] `query:"httpProtocol"`
+ // Filter for http version.
+ HTTPVersion param.Field[[]HTTPTimeseriesGroupDeviceTypeParamsHTTPVersion] `query:"httpVersion"`
+ // Filter for ip version.
+ IPVersion param.Field[[]HTTPTimeseriesGroupDeviceTypeParamsIPVersion] `query:"ipVersion"`
+ // 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 os name.
+ OS param.Field[[]HTTPTimeseriesGroupDeviceTypeParamsOS] `query:"os"`
+ // Filter for tls version.
+ TLSVersion param.Field[[]HTTPTimeseriesGroupDeviceTypeParamsTLSVersion] `query:"tlsVersion"`
+}
+
+// URLQuery serializes [HTTPTimeseriesGroupDeviceTypeParams]'s query parameters as
+// `url.Values`.
+func (r HTTPTimeseriesGroupDeviceTypeParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Aggregation interval results should be returned in (for example, in 15 minutes
+// or 1 hour intervals). Refer to
+// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+type HTTPTimeseriesGroupDeviceTypeParamsAggInterval string
+
+const (
+ HTTPTimeseriesGroupDeviceTypeParamsAggInterval15m HTTPTimeseriesGroupDeviceTypeParamsAggInterval = "15m"
+ HTTPTimeseriesGroupDeviceTypeParamsAggInterval1h HTTPTimeseriesGroupDeviceTypeParamsAggInterval = "1h"
+ HTTPTimeseriesGroupDeviceTypeParamsAggInterval1d HTTPTimeseriesGroupDeviceTypeParamsAggInterval = "1d"
+ HTTPTimeseriesGroupDeviceTypeParamsAggInterval1w HTTPTimeseriesGroupDeviceTypeParamsAggInterval = "1w"
+)
+
+type HTTPTimeseriesGroupDeviceTypeParamsBotClass string
+
+const (
+ HTTPTimeseriesGroupDeviceTypeParamsBotClassLikelyAutomated HTTPTimeseriesGroupDeviceTypeParamsBotClass = "LIKELY_AUTOMATED"
+ HTTPTimeseriesGroupDeviceTypeParamsBotClassLikelyHuman HTTPTimeseriesGroupDeviceTypeParamsBotClass = "LIKELY_HUMAN"
+)
+
+type HTTPTimeseriesGroupDeviceTypeParamsDateRange string
+
+const (
+ HTTPTimeseriesGroupDeviceTypeParamsDateRange1d HTTPTimeseriesGroupDeviceTypeParamsDateRange = "1d"
+ HTTPTimeseriesGroupDeviceTypeParamsDateRange2d HTTPTimeseriesGroupDeviceTypeParamsDateRange = "2d"
+ HTTPTimeseriesGroupDeviceTypeParamsDateRange7d HTTPTimeseriesGroupDeviceTypeParamsDateRange = "7d"
+ HTTPTimeseriesGroupDeviceTypeParamsDateRange14d HTTPTimeseriesGroupDeviceTypeParamsDateRange = "14d"
+ HTTPTimeseriesGroupDeviceTypeParamsDateRange28d HTTPTimeseriesGroupDeviceTypeParamsDateRange = "28d"
+ HTTPTimeseriesGroupDeviceTypeParamsDateRange12w HTTPTimeseriesGroupDeviceTypeParamsDateRange = "12w"
+ HTTPTimeseriesGroupDeviceTypeParamsDateRange24w HTTPTimeseriesGroupDeviceTypeParamsDateRange = "24w"
+ HTTPTimeseriesGroupDeviceTypeParamsDateRange52w HTTPTimeseriesGroupDeviceTypeParamsDateRange = "52w"
+ HTTPTimeseriesGroupDeviceTypeParamsDateRange1dControl HTTPTimeseriesGroupDeviceTypeParamsDateRange = "1dControl"
+ HTTPTimeseriesGroupDeviceTypeParamsDateRange2dControl HTTPTimeseriesGroupDeviceTypeParamsDateRange = "2dControl"
+ HTTPTimeseriesGroupDeviceTypeParamsDateRange7dControl HTTPTimeseriesGroupDeviceTypeParamsDateRange = "7dControl"
+ HTTPTimeseriesGroupDeviceTypeParamsDateRange14dControl HTTPTimeseriesGroupDeviceTypeParamsDateRange = "14dControl"
+ HTTPTimeseriesGroupDeviceTypeParamsDateRange28dControl HTTPTimeseriesGroupDeviceTypeParamsDateRange = "28dControl"
+ HTTPTimeseriesGroupDeviceTypeParamsDateRange12wControl HTTPTimeseriesGroupDeviceTypeParamsDateRange = "12wControl"
+ HTTPTimeseriesGroupDeviceTypeParamsDateRange24wControl HTTPTimeseriesGroupDeviceTypeParamsDateRange = "24wControl"
+)
+
+// Format results are returned in.
+type HTTPTimeseriesGroupDeviceTypeParamsFormat string
+
+const (
+ HTTPTimeseriesGroupDeviceTypeParamsFormatJson HTTPTimeseriesGroupDeviceTypeParamsFormat = "JSON"
+ HTTPTimeseriesGroupDeviceTypeParamsFormatCsv HTTPTimeseriesGroupDeviceTypeParamsFormat = "CSV"
+)
+
+type HTTPTimeseriesGroupDeviceTypeParamsHTTPProtocol string
+
+const (
+ HTTPTimeseriesGroupDeviceTypeParamsHTTPProtocolHTTP HTTPTimeseriesGroupDeviceTypeParamsHTTPProtocol = "HTTP"
+ HTTPTimeseriesGroupDeviceTypeParamsHTTPProtocolHTTPS HTTPTimeseriesGroupDeviceTypeParamsHTTPProtocol = "HTTPS"
+)
+
+type HTTPTimeseriesGroupDeviceTypeParamsHTTPVersion string
+
+const (
+ HTTPTimeseriesGroupDeviceTypeParamsHTTPVersionHttPv1 HTTPTimeseriesGroupDeviceTypeParamsHTTPVersion = "HTTPv1"
+ HTTPTimeseriesGroupDeviceTypeParamsHTTPVersionHttPv2 HTTPTimeseriesGroupDeviceTypeParamsHTTPVersion = "HTTPv2"
+ HTTPTimeseriesGroupDeviceTypeParamsHTTPVersionHttPv3 HTTPTimeseriesGroupDeviceTypeParamsHTTPVersion = "HTTPv3"
+)
+
+type HTTPTimeseriesGroupDeviceTypeParamsIPVersion string
+
+const (
+ HTTPTimeseriesGroupDeviceTypeParamsIPVersionIPv4 HTTPTimeseriesGroupDeviceTypeParamsIPVersion = "IPv4"
+ HTTPTimeseriesGroupDeviceTypeParamsIPVersionIPv6 HTTPTimeseriesGroupDeviceTypeParamsIPVersion = "IPv6"
+)
+
+type HTTPTimeseriesGroupDeviceTypeParamsOS string
+
+const (
+ HTTPTimeseriesGroupDeviceTypeParamsOSWindows HTTPTimeseriesGroupDeviceTypeParamsOS = "WINDOWS"
+ HTTPTimeseriesGroupDeviceTypeParamsOSMacosx HTTPTimeseriesGroupDeviceTypeParamsOS = "MACOSX"
+ HTTPTimeseriesGroupDeviceTypeParamsOSIos HTTPTimeseriesGroupDeviceTypeParamsOS = "IOS"
+ HTTPTimeseriesGroupDeviceTypeParamsOSAndroid HTTPTimeseriesGroupDeviceTypeParamsOS = "ANDROID"
+ HTTPTimeseriesGroupDeviceTypeParamsOSChromeos HTTPTimeseriesGroupDeviceTypeParamsOS = "CHROMEOS"
+ HTTPTimeseriesGroupDeviceTypeParamsOSLinux HTTPTimeseriesGroupDeviceTypeParamsOS = "LINUX"
+ HTTPTimeseriesGroupDeviceTypeParamsOSSmartTv HTTPTimeseriesGroupDeviceTypeParamsOS = "SMART_TV"
+)
+
+type HTTPTimeseriesGroupDeviceTypeParamsTLSVersion string
+
+const (
+ HTTPTimeseriesGroupDeviceTypeParamsTLSVersionTlSv1_0 HTTPTimeseriesGroupDeviceTypeParamsTLSVersion = "TLSv1_0"
+ HTTPTimeseriesGroupDeviceTypeParamsTLSVersionTlSv1_1 HTTPTimeseriesGroupDeviceTypeParamsTLSVersion = "TLSv1_1"
+ HTTPTimeseriesGroupDeviceTypeParamsTLSVersionTlSv1_2 HTTPTimeseriesGroupDeviceTypeParamsTLSVersion = "TLSv1_2"
+ HTTPTimeseriesGroupDeviceTypeParamsTLSVersionTlSv1_3 HTTPTimeseriesGroupDeviceTypeParamsTLSVersion = "TLSv1_3"
+ HTTPTimeseriesGroupDeviceTypeParamsTLSVersionTlSvQuic HTTPTimeseriesGroupDeviceTypeParamsTLSVersion = "TLSvQUIC"
+)
+
+type HTTPTimeseriesGroupDeviceTypeResponseEnvelope struct {
+ Result HTTPTimeseriesGroupDeviceTypeResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON httpTimeseriesGroupDeviceTypeResponseEnvelopeJSON `json:"-"`
+}
+
+// httpTimeseriesGroupDeviceTypeResponseEnvelopeJSON contains the JSON metadata for
+// the struct [HTTPTimeseriesGroupDeviceTypeResponseEnvelope]
+type httpTimeseriesGroupDeviceTypeResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPTimeseriesGroupDeviceTypeResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpTimeseriesGroupDeviceTypeResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPTimeseriesGroupHTTPProtocolParams struct {
+ // Aggregation interval results should be returned in (for example, in 15 minutes
+ // or 1 hour intervals). Refer to
+ // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+ AggInterval param.Field[HTTPTimeseriesGroupHTTPProtocolParamsAggInterval] `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"`
+ // Filter for bot class. Refer to
+ // [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/).
+ BotClass param.Field[[]HTTPTimeseriesGroupHTTPProtocolParamsBotClass] `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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]HTTPTimeseriesGroupHTTPProtocolParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Filter for device type.
+ DeviceType param.Field[[]HTTPTimeseriesGroupHTTPProtocolParamsDeviceType] `query:"deviceType"`
+ // Format results are returned in.
+ Format param.Field[HTTPTimeseriesGroupHTTPProtocolParamsFormat] `query:"format"`
+ // Filter for http version.
+ HTTPVersion param.Field[[]HTTPTimeseriesGroupHTTPProtocolParamsHTTPVersion] `query:"httpVersion"`
+ // Filter for ip version.
+ IPVersion param.Field[[]HTTPTimeseriesGroupHTTPProtocolParamsIPVersion] `query:"ipVersion"`
+ // 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 os name.
+ OS param.Field[[]HTTPTimeseriesGroupHTTPProtocolParamsOS] `query:"os"`
+ // Filter for tls version.
+ TLSVersion param.Field[[]HTTPTimeseriesGroupHTTPProtocolParamsTLSVersion] `query:"tlsVersion"`
+}
+
+// URLQuery serializes [HTTPTimeseriesGroupHTTPProtocolParams]'s query parameters
+// as `url.Values`.
+func (r HTTPTimeseriesGroupHTTPProtocolParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Aggregation interval results should be returned in (for example, in 15 minutes
+// or 1 hour intervals). Refer to
+// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+type HTTPTimeseriesGroupHTTPProtocolParamsAggInterval string
+
+const (
+ HTTPTimeseriesGroupHTTPProtocolParamsAggInterval15m HTTPTimeseriesGroupHTTPProtocolParamsAggInterval = "15m"
+ HTTPTimeseriesGroupHTTPProtocolParamsAggInterval1h HTTPTimeseriesGroupHTTPProtocolParamsAggInterval = "1h"
+ HTTPTimeseriesGroupHTTPProtocolParamsAggInterval1d HTTPTimeseriesGroupHTTPProtocolParamsAggInterval = "1d"
+ HTTPTimeseriesGroupHTTPProtocolParamsAggInterval1w HTTPTimeseriesGroupHTTPProtocolParamsAggInterval = "1w"
+)
+
+type HTTPTimeseriesGroupHTTPProtocolParamsBotClass string
+
+const (
+ HTTPTimeseriesGroupHTTPProtocolParamsBotClassLikelyAutomated HTTPTimeseriesGroupHTTPProtocolParamsBotClass = "LIKELY_AUTOMATED"
+ HTTPTimeseriesGroupHTTPProtocolParamsBotClassLikelyHuman HTTPTimeseriesGroupHTTPProtocolParamsBotClass = "LIKELY_HUMAN"
+)
+
+type HTTPTimeseriesGroupHTTPProtocolParamsDateRange string
+
+const (
+ HTTPTimeseriesGroupHTTPProtocolParamsDateRange1d HTTPTimeseriesGroupHTTPProtocolParamsDateRange = "1d"
+ HTTPTimeseriesGroupHTTPProtocolParamsDateRange2d HTTPTimeseriesGroupHTTPProtocolParamsDateRange = "2d"
+ HTTPTimeseriesGroupHTTPProtocolParamsDateRange7d HTTPTimeseriesGroupHTTPProtocolParamsDateRange = "7d"
+ HTTPTimeseriesGroupHTTPProtocolParamsDateRange14d HTTPTimeseriesGroupHTTPProtocolParamsDateRange = "14d"
+ HTTPTimeseriesGroupHTTPProtocolParamsDateRange28d HTTPTimeseriesGroupHTTPProtocolParamsDateRange = "28d"
+ HTTPTimeseriesGroupHTTPProtocolParamsDateRange12w HTTPTimeseriesGroupHTTPProtocolParamsDateRange = "12w"
+ HTTPTimeseriesGroupHTTPProtocolParamsDateRange24w HTTPTimeseriesGroupHTTPProtocolParamsDateRange = "24w"
+ HTTPTimeseriesGroupHTTPProtocolParamsDateRange52w HTTPTimeseriesGroupHTTPProtocolParamsDateRange = "52w"
+ HTTPTimeseriesGroupHTTPProtocolParamsDateRange1dControl HTTPTimeseriesGroupHTTPProtocolParamsDateRange = "1dControl"
+ HTTPTimeseriesGroupHTTPProtocolParamsDateRange2dControl HTTPTimeseriesGroupHTTPProtocolParamsDateRange = "2dControl"
+ HTTPTimeseriesGroupHTTPProtocolParamsDateRange7dControl HTTPTimeseriesGroupHTTPProtocolParamsDateRange = "7dControl"
+ HTTPTimeseriesGroupHTTPProtocolParamsDateRange14dControl HTTPTimeseriesGroupHTTPProtocolParamsDateRange = "14dControl"
+ HTTPTimeseriesGroupHTTPProtocolParamsDateRange28dControl HTTPTimeseriesGroupHTTPProtocolParamsDateRange = "28dControl"
+ HTTPTimeseriesGroupHTTPProtocolParamsDateRange12wControl HTTPTimeseriesGroupHTTPProtocolParamsDateRange = "12wControl"
+ HTTPTimeseriesGroupHTTPProtocolParamsDateRange24wControl HTTPTimeseriesGroupHTTPProtocolParamsDateRange = "24wControl"
+)
+
+type HTTPTimeseriesGroupHTTPProtocolParamsDeviceType string
+
+const (
+ HTTPTimeseriesGroupHTTPProtocolParamsDeviceTypeDesktop HTTPTimeseriesGroupHTTPProtocolParamsDeviceType = "DESKTOP"
+ HTTPTimeseriesGroupHTTPProtocolParamsDeviceTypeMobile HTTPTimeseriesGroupHTTPProtocolParamsDeviceType = "MOBILE"
+ HTTPTimeseriesGroupHTTPProtocolParamsDeviceTypeOther HTTPTimeseriesGroupHTTPProtocolParamsDeviceType = "OTHER"
+)
+
+// Format results are returned in.
+type HTTPTimeseriesGroupHTTPProtocolParamsFormat string
+
+const (
+ HTTPTimeseriesGroupHTTPProtocolParamsFormatJson HTTPTimeseriesGroupHTTPProtocolParamsFormat = "JSON"
+ HTTPTimeseriesGroupHTTPProtocolParamsFormatCsv HTTPTimeseriesGroupHTTPProtocolParamsFormat = "CSV"
+)
+
+type HTTPTimeseriesGroupHTTPProtocolParamsHTTPVersion string
+
+const (
+ HTTPTimeseriesGroupHTTPProtocolParamsHTTPVersionHttPv1 HTTPTimeseriesGroupHTTPProtocolParamsHTTPVersion = "HTTPv1"
+ HTTPTimeseriesGroupHTTPProtocolParamsHTTPVersionHttPv2 HTTPTimeseriesGroupHTTPProtocolParamsHTTPVersion = "HTTPv2"
+ HTTPTimeseriesGroupHTTPProtocolParamsHTTPVersionHttPv3 HTTPTimeseriesGroupHTTPProtocolParamsHTTPVersion = "HTTPv3"
+)
+
+type HTTPTimeseriesGroupHTTPProtocolParamsIPVersion string
+
+const (
+ HTTPTimeseriesGroupHTTPProtocolParamsIPVersionIPv4 HTTPTimeseriesGroupHTTPProtocolParamsIPVersion = "IPv4"
+ HTTPTimeseriesGroupHTTPProtocolParamsIPVersionIPv6 HTTPTimeseriesGroupHTTPProtocolParamsIPVersion = "IPv6"
+)
+
+type HTTPTimeseriesGroupHTTPProtocolParamsOS string
+
+const (
+ HTTPTimeseriesGroupHTTPProtocolParamsOSWindows HTTPTimeseriesGroupHTTPProtocolParamsOS = "WINDOWS"
+ HTTPTimeseriesGroupHTTPProtocolParamsOSMacosx HTTPTimeseriesGroupHTTPProtocolParamsOS = "MACOSX"
+ HTTPTimeseriesGroupHTTPProtocolParamsOSIos HTTPTimeseriesGroupHTTPProtocolParamsOS = "IOS"
+ HTTPTimeseriesGroupHTTPProtocolParamsOSAndroid HTTPTimeseriesGroupHTTPProtocolParamsOS = "ANDROID"
+ HTTPTimeseriesGroupHTTPProtocolParamsOSChromeos HTTPTimeseriesGroupHTTPProtocolParamsOS = "CHROMEOS"
+ HTTPTimeseriesGroupHTTPProtocolParamsOSLinux HTTPTimeseriesGroupHTTPProtocolParamsOS = "LINUX"
+ HTTPTimeseriesGroupHTTPProtocolParamsOSSmartTv HTTPTimeseriesGroupHTTPProtocolParamsOS = "SMART_TV"
+)
+
+type HTTPTimeseriesGroupHTTPProtocolParamsTLSVersion string
+
+const (
+ HTTPTimeseriesGroupHTTPProtocolParamsTLSVersionTlSv1_0 HTTPTimeseriesGroupHTTPProtocolParamsTLSVersion = "TLSv1_0"
+ HTTPTimeseriesGroupHTTPProtocolParamsTLSVersionTlSv1_1 HTTPTimeseriesGroupHTTPProtocolParamsTLSVersion = "TLSv1_1"
+ HTTPTimeseriesGroupHTTPProtocolParamsTLSVersionTlSv1_2 HTTPTimeseriesGroupHTTPProtocolParamsTLSVersion = "TLSv1_2"
+ HTTPTimeseriesGroupHTTPProtocolParamsTLSVersionTlSv1_3 HTTPTimeseriesGroupHTTPProtocolParamsTLSVersion = "TLSv1_3"
+ HTTPTimeseriesGroupHTTPProtocolParamsTLSVersionTlSvQuic HTTPTimeseriesGroupHTTPProtocolParamsTLSVersion = "TLSvQUIC"
+)
+
+type HTTPTimeseriesGroupHTTPProtocolResponseEnvelope struct {
+ Result HTTPTimeseriesGroupHTTPProtocolResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON httpTimeseriesGroupHTTPProtocolResponseEnvelopeJSON `json:"-"`
+}
+
+// httpTimeseriesGroupHTTPProtocolResponseEnvelopeJSON contains the JSON metadata
+// for the struct [HTTPTimeseriesGroupHTTPProtocolResponseEnvelope]
+type httpTimeseriesGroupHTTPProtocolResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPTimeseriesGroupHTTPProtocolResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpTimeseriesGroupHTTPProtocolResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPTimeseriesGroupHTTPVersionParams struct {
+ // Aggregation interval results should be returned in (for example, in 15 minutes
+ // or 1 hour intervals). Refer to
+ // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+ AggInterval param.Field[HTTPTimeseriesGroupHTTPVersionParamsAggInterval] `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"`
+ // Filter for bot class. Refer to
+ // [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/).
+ BotClass param.Field[[]HTTPTimeseriesGroupHTTPVersionParamsBotClass] `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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]HTTPTimeseriesGroupHTTPVersionParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Filter for device type.
+ DeviceType param.Field[[]HTTPTimeseriesGroupHTTPVersionParamsDeviceType] `query:"deviceType"`
+ // Format results are returned in.
+ Format param.Field[HTTPTimeseriesGroupHTTPVersionParamsFormat] `query:"format"`
+ // Filter for http protocol.
+ HTTPProtocol param.Field[[]HTTPTimeseriesGroupHTTPVersionParamsHTTPProtocol] `query:"httpProtocol"`
+ // Filter for ip version.
+ IPVersion param.Field[[]HTTPTimeseriesGroupHTTPVersionParamsIPVersion] `query:"ipVersion"`
+ // 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 os name.
+ OS param.Field[[]HTTPTimeseriesGroupHTTPVersionParamsOS] `query:"os"`
+ // Filter for tls version.
+ TLSVersion param.Field[[]HTTPTimeseriesGroupHTTPVersionParamsTLSVersion] `query:"tlsVersion"`
+}
+
+// URLQuery serializes [HTTPTimeseriesGroupHTTPVersionParams]'s query parameters as
+// `url.Values`.
+func (r HTTPTimeseriesGroupHTTPVersionParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Aggregation interval results should be returned in (for example, in 15 minutes
+// or 1 hour intervals). Refer to
+// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+type HTTPTimeseriesGroupHTTPVersionParamsAggInterval string
+
+const (
+ HTTPTimeseriesGroupHTTPVersionParamsAggInterval15m HTTPTimeseriesGroupHTTPVersionParamsAggInterval = "15m"
+ HTTPTimeseriesGroupHTTPVersionParamsAggInterval1h HTTPTimeseriesGroupHTTPVersionParamsAggInterval = "1h"
+ HTTPTimeseriesGroupHTTPVersionParamsAggInterval1d HTTPTimeseriesGroupHTTPVersionParamsAggInterval = "1d"
+ HTTPTimeseriesGroupHTTPVersionParamsAggInterval1w HTTPTimeseriesGroupHTTPVersionParamsAggInterval = "1w"
+)
+
+type HTTPTimeseriesGroupHTTPVersionParamsBotClass string
+
+const (
+ HTTPTimeseriesGroupHTTPVersionParamsBotClassLikelyAutomated HTTPTimeseriesGroupHTTPVersionParamsBotClass = "LIKELY_AUTOMATED"
+ HTTPTimeseriesGroupHTTPVersionParamsBotClassLikelyHuman HTTPTimeseriesGroupHTTPVersionParamsBotClass = "LIKELY_HUMAN"
+)
+
+type HTTPTimeseriesGroupHTTPVersionParamsDateRange string
+
+const (
+ HTTPTimeseriesGroupHTTPVersionParamsDateRange1d HTTPTimeseriesGroupHTTPVersionParamsDateRange = "1d"
+ HTTPTimeseriesGroupHTTPVersionParamsDateRange2d HTTPTimeseriesGroupHTTPVersionParamsDateRange = "2d"
+ HTTPTimeseriesGroupHTTPVersionParamsDateRange7d HTTPTimeseriesGroupHTTPVersionParamsDateRange = "7d"
+ HTTPTimeseriesGroupHTTPVersionParamsDateRange14d HTTPTimeseriesGroupHTTPVersionParamsDateRange = "14d"
+ HTTPTimeseriesGroupHTTPVersionParamsDateRange28d HTTPTimeseriesGroupHTTPVersionParamsDateRange = "28d"
+ HTTPTimeseriesGroupHTTPVersionParamsDateRange12w HTTPTimeseriesGroupHTTPVersionParamsDateRange = "12w"
+ HTTPTimeseriesGroupHTTPVersionParamsDateRange24w HTTPTimeseriesGroupHTTPVersionParamsDateRange = "24w"
+ HTTPTimeseriesGroupHTTPVersionParamsDateRange52w HTTPTimeseriesGroupHTTPVersionParamsDateRange = "52w"
+ HTTPTimeseriesGroupHTTPVersionParamsDateRange1dControl HTTPTimeseriesGroupHTTPVersionParamsDateRange = "1dControl"
+ HTTPTimeseriesGroupHTTPVersionParamsDateRange2dControl HTTPTimeseriesGroupHTTPVersionParamsDateRange = "2dControl"
+ HTTPTimeseriesGroupHTTPVersionParamsDateRange7dControl HTTPTimeseriesGroupHTTPVersionParamsDateRange = "7dControl"
+ HTTPTimeseriesGroupHTTPVersionParamsDateRange14dControl HTTPTimeseriesGroupHTTPVersionParamsDateRange = "14dControl"
+ HTTPTimeseriesGroupHTTPVersionParamsDateRange28dControl HTTPTimeseriesGroupHTTPVersionParamsDateRange = "28dControl"
+ HTTPTimeseriesGroupHTTPVersionParamsDateRange12wControl HTTPTimeseriesGroupHTTPVersionParamsDateRange = "12wControl"
+ HTTPTimeseriesGroupHTTPVersionParamsDateRange24wControl HTTPTimeseriesGroupHTTPVersionParamsDateRange = "24wControl"
+)
+
+type HTTPTimeseriesGroupHTTPVersionParamsDeviceType string
+
+const (
+ HTTPTimeseriesGroupHTTPVersionParamsDeviceTypeDesktop HTTPTimeseriesGroupHTTPVersionParamsDeviceType = "DESKTOP"
+ HTTPTimeseriesGroupHTTPVersionParamsDeviceTypeMobile HTTPTimeseriesGroupHTTPVersionParamsDeviceType = "MOBILE"
+ HTTPTimeseriesGroupHTTPVersionParamsDeviceTypeOther HTTPTimeseriesGroupHTTPVersionParamsDeviceType = "OTHER"
+)
+
+// Format results are returned in.
+type HTTPTimeseriesGroupHTTPVersionParamsFormat string
+
+const (
+ HTTPTimeseriesGroupHTTPVersionParamsFormatJson HTTPTimeseriesGroupHTTPVersionParamsFormat = "JSON"
+ HTTPTimeseriesGroupHTTPVersionParamsFormatCsv HTTPTimeseriesGroupHTTPVersionParamsFormat = "CSV"
+)
+
+type HTTPTimeseriesGroupHTTPVersionParamsHTTPProtocol string
+
+const (
+ HTTPTimeseriesGroupHTTPVersionParamsHTTPProtocolHTTP HTTPTimeseriesGroupHTTPVersionParamsHTTPProtocol = "HTTP"
+ HTTPTimeseriesGroupHTTPVersionParamsHTTPProtocolHTTPS HTTPTimeseriesGroupHTTPVersionParamsHTTPProtocol = "HTTPS"
+)
+
+type HTTPTimeseriesGroupHTTPVersionParamsIPVersion string
+
+const (
+ HTTPTimeseriesGroupHTTPVersionParamsIPVersionIPv4 HTTPTimeseriesGroupHTTPVersionParamsIPVersion = "IPv4"
+ HTTPTimeseriesGroupHTTPVersionParamsIPVersionIPv6 HTTPTimeseriesGroupHTTPVersionParamsIPVersion = "IPv6"
+)
+
+type HTTPTimeseriesGroupHTTPVersionParamsOS string
+
+const (
+ HTTPTimeseriesGroupHTTPVersionParamsOSWindows HTTPTimeseriesGroupHTTPVersionParamsOS = "WINDOWS"
+ HTTPTimeseriesGroupHTTPVersionParamsOSMacosx HTTPTimeseriesGroupHTTPVersionParamsOS = "MACOSX"
+ HTTPTimeseriesGroupHTTPVersionParamsOSIos HTTPTimeseriesGroupHTTPVersionParamsOS = "IOS"
+ HTTPTimeseriesGroupHTTPVersionParamsOSAndroid HTTPTimeseriesGroupHTTPVersionParamsOS = "ANDROID"
+ HTTPTimeseriesGroupHTTPVersionParamsOSChromeos HTTPTimeseriesGroupHTTPVersionParamsOS = "CHROMEOS"
+ HTTPTimeseriesGroupHTTPVersionParamsOSLinux HTTPTimeseriesGroupHTTPVersionParamsOS = "LINUX"
+ HTTPTimeseriesGroupHTTPVersionParamsOSSmartTv HTTPTimeseriesGroupHTTPVersionParamsOS = "SMART_TV"
+)
+
+type HTTPTimeseriesGroupHTTPVersionParamsTLSVersion string
+
+const (
+ HTTPTimeseriesGroupHTTPVersionParamsTLSVersionTlSv1_0 HTTPTimeseriesGroupHTTPVersionParamsTLSVersion = "TLSv1_0"
+ HTTPTimeseriesGroupHTTPVersionParamsTLSVersionTlSv1_1 HTTPTimeseriesGroupHTTPVersionParamsTLSVersion = "TLSv1_1"
+ HTTPTimeseriesGroupHTTPVersionParamsTLSVersionTlSv1_2 HTTPTimeseriesGroupHTTPVersionParamsTLSVersion = "TLSv1_2"
+ HTTPTimeseriesGroupHTTPVersionParamsTLSVersionTlSv1_3 HTTPTimeseriesGroupHTTPVersionParamsTLSVersion = "TLSv1_3"
+ HTTPTimeseriesGroupHTTPVersionParamsTLSVersionTlSvQuic HTTPTimeseriesGroupHTTPVersionParamsTLSVersion = "TLSvQUIC"
+)
+
+type HTTPTimeseriesGroupHTTPVersionResponseEnvelope struct {
+ Result HTTPTimeseriesGroupHTTPVersionResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON httpTimeseriesGroupHTTPVersionResponseEnvelopeJSON `json:"-"`
+}
+
+// httpTimeseriesGroupHTTPVersionResponseEnvelopeJSON contains the JSON metadata
+// for the struct [HTTPTimeseriesGroupHTTPVersionResponseEnvelope]
+type httpTimeseriesGroupHTTPVersionResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPTimeseriesGroupHTTPVersionResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpTimeseriesGroupHTTPVersionResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPTimeseriesGroupIPVersionParams struct {
+ // Aggregation interval results should be returned in (for example, in 15 minutes
+ // or 1 hour intervals). Refer to
+ // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+ AggInterval param.Field[HTTPTimeseriesGroupIPVersionParamsAggInterval] `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"`
+ // Filter for bot class. Refer to
+ // [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/).
+ BotClass param.Field[[]HTTPTimeseriesGroupIPVersionParamsBotClass] `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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]HTTPTimeseriesGroupIPVersionParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Filter for device type.
+ DeviceType param.Field[[]HTTPTimeseriesGroupIPVersionParamsDeviceType] `query:"deviceType"`
+ // Format results are returned in.
+ Format param.Field[HTTPTimeseriesGroupIPVersionParamsFormat] `query:"format"`
+ // Filter for http protocol.
+ HTTPProtocol param.Field[[]HTTPTimeseriesGroupIPVersionParamsHTTPProtocol] `query:"httpProtocol"`
+ // Filter for http version.
+ HTTPVersion param.Field[[]HTTPTimeseriesGroupIPVersionParamsHTTPVersion] `query:"httpVersion"`
+ // 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 os name.
+ OS param.Field[[]HTTPTimeseriesGroupIPVersionParamsOS] `query:"os"`
+ // Filter for tls version.
+ TLSVersion param.Field[[]HTTPTimeseriesGroupIPVersionParamsTLSVersion] `query:"tlsVersion"`
+}
+
+// URLQuery serializes [HTTPTimeseriesGroupIPVersionParams]'s query parameters as
+// `url.Values`.
+func (r HTTPTimeseriesGroupIPVersionParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Aggregation interval results should be returned in (for example, in 15 minutes
+// or 1 hour intervals). Refer to
+// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+type HTTPTimeseriesGroupIPVersionParamsAggInterval string
+
+const (
+ HTTPTimeseriesGroupIPVersionParamsAggInterval15m HTTPTimeseriesGroupIPVersionParamsAggInterval = "15m"
+ HTTPTimeseriesGroupIPVersionParamsAggInterval1h HTTPTimeseriesGroupIPVersionParamsAggInterval = "1h"
+ HTTPTimeseriesGroupIPVersionParamsAggInterval1d HTTPTimeseriesGroupIPVersionParamsAggInterval = "1d"
+ HTTPTimeseriesGroupIPVersionParamsAggInterval1w HTTPTimeseriesGroupIPVersionParamsAggInterval = "1w"
+)
+
+type HTTPTimeseriesGroupIPVersionParamsBotClass string
+
+const (
+ HTTPTimeseriesGroupIPVersionParamsBotClassLikelyAutomated HTTPTimeseriesGroupIPVersionParamsBotClass = "LIKELY_AUTOMATED"
+ HTTPTimeseriesGroupIPVersionParamsBotClassLikelyHuman HTTPTimeseriesGroupIPVersionParamsBotClass = "LIKELY_HUMAN"
+)
+
+type HTTPTimeseriesGroupIPVersionParamsDateRange string
+
+const (
+ HTTPTimeseriesGroupIPVersionParamsDateRange1d HTTPTimeseriesGroupIPVersionParamsDateRange = "1d"
+ HTTPTimeseriesGroupIPVersionParamsDateRange2d HTTPTimeseriesGroupIPVersionParamsDateRange = "2d"
+ HTTPTimeseriesGroupIPVersionParamsDateRange7d HTTPTimeseriesGroupIPVersionParamsDateRange = "7d"
+ HTTPTimeseriesGroupIPVersionParamsDateRange14d HTTPTimeseriesGroupIPVersionParamsDateRange = "14d"
+ HTTPTimeseriesGroupIPVersionParamsDateRange28d HTTPTimeseriesGroupIPVersionParamsDateRange = "28d"
+ HTTPTimeseriesGroupIPVersionParamsDateRange12w HTTPTimeseriesGroupIPVersionParamsDateRange = "12w"
+ HTTPTimeseriesGroupIPVersionParamsDateRange24w HTTPTimeseriesGroupIPVersionParamsDateRange = "24w"
+ HTTPTimeseriesGroupIPVersionParamsDateRange52w HTTPTimeseriesGroupIPVersionParamsDateRange = "52w"
+ HTTPTimeseriesGroupIPVersionParamsDateRange1dControl HTTPTimeseriesGroupIPVersionParamsDateRange = "1dControl"
+ HTTPTimeseriesGroupIPVersionParamsDateRange2dControl HTTPTimeseriesGroupIPVersionParamsDateRange = "2dControl"
+ HTTPTimeseriesGroupIPVersionParamsDateRange7dControl HTTPTimeseriesGroupIPVersionParamsDateRange = "7dControl"
+ HTTPTimeseriesGroupIPVersionParamsDateRange14dControl HTTPTimeseriesGroupIPVersionParamsDateRange = "14dControl"
+ HTTPTimeseriesGroupIPVersionParamsDateRange28dControl HTTPTimeseriesGroupIPVersionParamsDateRange = "28dControl"
+ HTTPTimeseriesGroupIPVersionParamsDateRange12wControl HTTPTimeseriesGroupIPVersionParamsDateRange = "12wControl"
+ HTTPTimeseriesGroupIPVersionParamsDateRange24wControl HTTPTimeseriesGroupIPVersionParamsDateRange = "24wControl"
+)
+
+type HTTPTimeseriesGroupIPVersionParamsDeviceType string
+
+const (
+ HTTPTimeseriesGroupIPVersionParamsDeviceTypeDesktop HTTPTimeseriesGroupIPVersionParamsDeviceType = "DESKTOP"
+ HTTPTimeseriesGroupIPVersionParamsDeviceTypeMobile HTTPTimeseriesGroupIPVersionParamsDeviceType = "MOBILE"
+ HTTPTimeseriesGroupIPVersionParamsDeviceTypeOther HTTPTimeseriesGroupIPVersionParamsDeviceType = "OTHER"
+)
+
+// Format results are returned in.
+type HTTPTimeseriesGroupIPVersionParamsFormat string
+
+const (
+ HTTPTimeseriesGroupIPVersionParamsFormatJson HTTPTimeseriesGroupIPVersionParamsFormat = "JSON"
+ HTTPTimeseriesGroupIPVersionParamsFormatCsv HTTPTimeseriesGroupIPVersionParamsFormat = "CSV"
+)
+
+type HTTPTimeseriesGroupIPVersionParamsHTTPProtocol string
+
+const (
+ HTTPTimeseriesGroupIPVersionParamsHTTPProtocolHTTP HTTPTimeseriesGroupIPVersionParamsHTTPProtocol = "HTTP"
+ HTTPTimeseriesGroupIPVersionParamsHTTPProtocolHTTPS HTTPTimeseriesGroupIPVersionParamsHTTPProtocol = "HTTPS"
+)
+
+type HTTPTimeseriesGroupIPVersionParamsHTTPVersion string
+
+const (
+ HTTPTimeseriesGroupIPVersionParamsHTTPVersionHttPv1 HTTPTimeseriesGroupIPVersionParamsHTTPVersion = "HTTPv1"
+ HTTPTimeseriesGroupIPVersionParamsHTTPVersionHttPv2 HTTPTimeseriesGroupIPVersionParamsHTTPVersion = "HTTPv2"
+ HTTPTimeseriesGroupIPVersionParamsHTTPVersionHttPv3 HTTPTimeseriesGroupIPVersionParamsHTTPVersion = "HTTPv3"
+)
+
+type HTTPTimeseriesGroupIPVersionParamsOS string
+
+const (
+ HTTPTimeseriesGroupIPVersionParamsOSWindows HTTPTimeseriesGroupIPVersionParamsOS = "WINDOWS"
+ HTTPTimeseriesGroupIPVersionParamsOSMacosx HTTPTimeseriesGroupIPVersionParamsOS = "MACOSX"
+ HTTPTimeseriesGroupIPVersionParamsOSIos HTTPTimeseriesGroupIPVersionParamsOS = "IOS"
+ HTTPTimeseriesGroupIPVersionParamsOSAndroid HTTPTimeseriesGroupIPVersionParamsOS = "ANDROID"
+ HTTPTimeseriesGroupIPVersionParamsOSChromeos HTTPTimeseriesGroupIPVersionParamsOS = "CHROMEOS"
+ HTTPTimeseriesGroupIPVersionParamsOSLinux HTTPTimeseriesGroupIPVersionParamsOS = "LINUX"
+ HTTPTimeseriesGroupIPVersionParamsOSSmartTv HTTPTimeseriesGroupIPVersionParamsOS = "SMART_TV"
+)
+
+type HTTPTimeseriesGroupIPVersionParamsTLSVersion string
+
+const (
+ HTTPTimeseriesGroupIPVersionParamsTLSVersionTlSv1_0 HTTPTimeseriesGroupIPVersionParamsTLSVersion = "TLSv1_0"
+ HTTPTimeseriesGroupIPVersionParamsTLSVersionTlSv1_1 HTTPTimeseriesGroupIPVersionParamsTLSVersion = "TLSv1_1"
+ HTTPTimeseriesGroupIPVersionParamsTLSVersionTlSv1_2 HTTPTimeseriesGroupIPVersionParamsTLSVersion = "TLSv1_2"
+ HTTPTimeseriesGroupIPVersionParamsTLSVersionTlSv1_3 HTTPTimeseriesGroupIPVersionParamsTLSVersion = "TLSv1_3"
+ HTTPTimeseriesGroupIPVersionParamsTLSVersionTlSvQuic HTTPTimeseriesGroupIPVersionParamsTLSVersion = "TLSvQUIC"
+)
+
+type HTTPTimeseriesGroupIPVersionResponseEnvelope struct {
+ Result HTTPTimeseriesGroupIPVersionResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON httpTimeseriesGroupIPVersionResponseEnvelopeJSON `json:"-"`
+}
+
+// httpTimeseriesGroupIPVersionResponseEnvelopeJSON contains the JSON metadata for
+// the struct [HTTPTimeseriesGroupIPVersionResponseEnvelope]
+type httpTimeseriesGroupIPVersionResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPTimeseriesGroupIPVersionResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpTimeseriesGroupIPVersionResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPTimeseriesGroupOSParams struct {
+ // Aggregation interval results should be returned in (for example, in 15 minutes
+ // or 1 hour intervals). Refer to
+ // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+ AggInterval param.Field[HTTPTimeseriesGroupOSParamsAggInterval] `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"`
+ // Filter for bot class. Refer to
+ // [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/).
+ BotClass param.Field[[]HTTPTimeseriesGroupOSParamsBotClass] `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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]HTTPTimeseriesGroupOSParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Filter for device type.
+ DeviceType param.Field[[]HTTPTimeseriesGroupOSParamsDeviceType] `query:"deviceType"`
+ // Format results are returned in.
+ Format param.Field[HTTPTimeseriesGroupOSParamsFormat] `query:"format"`
+ // Filter for http protocol.
+ HTTPProtocol param.Field[[]HTTPTimeseriesGroupOSParamsHTTPProtocol] `query:"httpProtocol"`
+ // Filter for http version.
+ HTTPVersion param.Field[[]HTTPTimeseriesGroupOSParamsHTTPVersion] `query:"httpVersion"`
+ // Filter for ip version.
+ IPVersion param.Field[[]HTTPTimeseriesGroupOSParamsIPVersion] `query:"ipVersion"`
+ // 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[[]HTTPTimeseriesGroupOSParamsTLSVersion] `query:"tlsVersion"`
+}
+
+// URLQuery serializes [HTTPTimeseriesGroupOSParams]'s query parameters as
+// `url.Values`.
+func (r HTTPTimeseriesGroupOSParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Aggregation interval results should be returned in (for example, in 15 minutes
+// or 1 hour intervals). Refer to
+// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+type HTTPTimeseriesGroupOSParamsAggInterval string
+
+const (
+ HTTPTimeseriesGroupOSParamsAggInterval15m HTTPTimeseriesGroupOSParamsAggInterval = "15m"
+ HTTPTimeseriesGroupOSParamsAggInterval1h HTTPTimeseriesGroupOSParamsAggInterval = "1h"
+ HTTPTimeseriesGroupOSParamsAggInterval1d HTTPTimeseriesGroupOSParamsAggInterval = "1d"
+ HTTPTimeseriesGroupOSParamsAggInterval1w HTTPTimeseriesGroupOSParamsAggInterval = "1w"
+)
+
+type HTTPTimeseriesGroupOSParamsBotClass string
+
+const (
+ HTTPTimeseriesGroupOSParamsBotClassLikelyAutomated HTTPTimeseriesGroupOSParamsBotClass = "LIKELY_AUTOMATED"
+ HTTPTimeseriesGroupOSParamsBotClassLikelyHuman HTTPTimeseriesGroupOSParamsBotClass = "LIKELY_HUMAN"
+)
+
+type HTTPTimeseriesGroupOSParamsDateRange string
+
+const (
+ HTTPTimeseriesGroupOSParamsDateRange1d HTTPTimeseriesGroupOSParamsDateRange = "1d"
+ HTTPTimeseriesGroupOSParamsDateRange2d HTTPTimeseriesGroupOSParamsDateRange = "2d"
+ HTTPTimeseriesGroupOSParamsDateRange7d HTTPTimeseriesGroupOSParamsDateRange = "7d"
+ HTTPTimeseriesGroupOSParamsDateRange14d HTTPTimeseriesGroupOSParamsDateRange = "14d"
+ HTTPTimeseriesGroupOSParamsDateRange28d HTTPTimeseriesGroupOSParamsDateRange = "28d"
+ HTTPTimeseriesGroupOSParamsDateRange12w HTTPTimeseriesGroupOSParamsDateRange = "12w"
+ HTTPTimeseriesGroupOSParamsDateRange24w HTTPTimeseriesGroupOSParamsDateRange = "24w"
+ HTTPTimeseriesGroupOSParamsDateRange52w HTTPTimeseriesGroupOSParamsDateRange = "52w"
+ HTTPTimeseriesGroupOSParamsDateRange1dControl HTTPTimeseriesGroupOSParamsDateRange = "1dControl"
+ HTTPTimeseriesGroupOSParamsDateRange2dControl HTTPTimeseriesGroupOSParamsDateRange = "2dControl"
+ HTTPTimeseriesGroupOSParamsDateRange7dControl HTTPTimeseriesGroupOSParamsDateRange = "7dControl"
+ HTTPTimeseriesGroupOSParamsDateRange14dControl HTTPTimeseriesGroupOSParamsDateRange = "14dControl"
+ HTTPTimeseriesGroupOSParamsDateRange28dControl HTTPTimeseriesGroupOSParamsDateRange = "28dControl"
+ HTTPTimeseriesGroupOSParamsDateRange12wControl HTTPTimeseriesGroupOSParamsDateRange = "12wControl"
+ HTTPTimeseriesGroupOSParamsDateRange24wControl HTTPTimeseriesGroupOSParamsDateRange = "24wControl"
+)
+
+type HTTPTimeseriesGroupOSParamsDeviceType string
+
+const (
+ HTTPTimeseriesGroupOSParamsDeviceTypeDesktop HTTPTimeseriesGroupOSParamsDeviceType = "DESKTOP"
+ HTTPTimeseriesGroupOSParamsDeviceTypeMobile HTTPTimeseriesGroupOSParamsDeviceType = "MOBILE"
+ HTTPTimeseriesGroupOSParamsDeviceTypeOther HTTPTimeseriesGroupOSParamsDeviceType = "OTHER"
+)
+
+// Format results are returned in.
+type HTTPTimeseriesGroupOSParamsFormat string
+
+const (
+ HTTPTimeseriesGroupOSParamsFormatJson HTTPTimeseriesGroupOSParamsFormat = "JSON"
+ HTTPTimeseriesGroupOSParamsFormatCsv HTTPTimeseriesGroupOSParamsFormat = "CSV"
+)
+
+type HTTPTimeseriesGroupOSParamsHTTPProtocol string
+
+const (
+ HTTPTimeseriesGroupOSParamsHTTPProtocolHTTP HTTPTimeseriesGroupOSParamsHTTPProtocol = "HTTP"
+ HTTPTimeseriesGroupOSParamsHTTPProtocolHTTPS HTTPTimeseriesGroupOSParamsHTTPProtocol = "HTTPS"
+)
+
+type HTTPTimeseriesGroupOSParamsHTTPVersion string
+
+const (
+ HTTPTimeseriesGroupOSParamsHTTPVersionHttPv1 HTTPTimeseriesGroupOSParamsHTTPVersion = "HTTPv1"
+ HTTPTimeseriesGroupOSParamsHTTPVersionHttPv2 HTTPTimeseriesGroupOSParamsHTTPVersion = "HTTPv2"
+ HTTPTimeseriesGroupOSParamsHTTPVersionHttPv3 HTTPTimeseriesGroupOSParamsHTTPVersion = "HTTPv3"
+)
+
+type HTTPTimeseriesGroupOSParamsIPVersion string
+
+const (
+ HTTPTimeseriesGroupOSParamsIPVersionIPv4 HTTPTimeseriesGroupOSParamsIPVersion = "IPv4"
+ HTTPTimeseriesGroupOSParamsIPVersionIPv6 HTTPTimeseriesGroupOSParamsIPVersion = "IPv6"
+)
+
+type HTTPTimeseriesGroupOSParamsTLSVersion string
+
+const (
+ HTTPTimeseriesGroupOSParamsTLSVersionTlSv1_0 HTTPTimeseriesGroupOSParamsTLSVersion = "TLSv1_0"
+ HTTPTimeseriesGroupOSParamsTLSVersionTlSv1_1 HTTPTimeseriesGroupOSParamsTLSVersion = "TLSv1_1"
+ HTTPTimeseriesGroupOSParamsTLSVersionTlSv1_2 HTTPTimeseriesGroupOSParamsTLSVersion = "TLSv1_2"
+ HTTPTimeseriesGroupOSParamsTLSVersionTlSv1_3 HTTPTimeseriesGroupOSParamsTLSVersion = "TLSv1_3"
+ HTTPTimeseriesGroupOSParamsTLSVersionTlSvQuic HTTPTimeseriesGroupOSParamsTLSVersion = "TLSvQUIC"
+)
+
+type HTTPTimeseriesGroupOSResponseEnvelope struct {
+ Result HTTPTimeseriesGroupOSResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON httpTimeseriesGroupOSResponseEnvelopeJSON `json:"-"`
+}
+
+// httpTimeseriesGroupOSResponseEnvelopeJSON contains the JSON metadata for the
+// struct [HTTPTimeseriesGroupOSResponseEnvelope]
+type httpTimeseriesGroupOSResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPTimeseriesGroupOSResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpTimeseriesGroupOSResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPTimeseriesGroupTLSVersionParams struct {
+ // Aggregation interval results should be returned in (for example, in 15 minutes
+ // or 1 hour intervals). Refer to
+ // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+ AggInterval param.Field[HTTPTimeseriesGroupTLSVersionParamsAggInterval] `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"`
+ // Filter for bot class. Refer to
+ // [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/).
+ BotClass param.Field[[]HTTPTimeseriesGroupTLSVersionParamsBotClass] `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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]HTTPTimeseriesGroupTLSVersionParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Filter for device type.
+ DeviceType param.Field[[]HTTPTimeseriesGroupTLSVersionParamsDeviceType] `query:"deviceType"`
+ // Format results are returned in.
+ Format param.Field[HTTPTimeseriesGroupTLSVersionParamsFormat] `query:"format"`
+ // Filter for http protocol.
+ HTTPProtocol param.Field[[]HTTPTimeseriesGroupTLSVersionParamsHTTPProtocol] `query:"httpProtocol"`
+ // Filter for http version.
+ HTTPVersion param.Field[[]HTTPTimeseriesGroupTLSVersionParamsHTTPVersion] `query:"httpVersion"`
+ // Filter for ip version.
+ IPVersion param.Field[[]HTTPTimeseriesGroupTLSVersionParamsIPVersion] `query:"ipVersion"`
+ // 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 os name.
+ OS param.Field[[]HTTPTimeseriesGroupTLSVersionParamsOS] `query:"os"`
+}
+
+// URLQuery serializes [HTTPTimeseriesGroupTLSVersionParams]'s query parameters as
+// `url.Values`.
+func (r HTTPTimeseriesGroupTLSVersionParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Aggregation interval results should be returned in (for example, in 15 minutes
+// or 1 hour intervals). Refer to
+// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+type HTTPTimeseriesGroupTLSVersionParamsAggInterval string
+
+const (
+ HTTPTimeseriesGroupTLSVersionParamsAggInterval15m HTTPTimeseriesGroupTLSVersionParamsAggInterval = "15m"
+ HTTPTimeseriesGroupTLSVersionParamsAggInterval1h HTTPTimeseriesGroupTLSVersionParamsAggInterval = "1h"
+ HTTPTimeseriesGroupTLSVersionParamsAggInterval1d HTTPTimeseriesGroupTLSVersionParamsAggInterval = "1d"
+ HTTPTimeseriesGroupTLSVersionParamsAggInterval1w HTTPTimeseriesGroupTLSVersionParamsAggInterval = "1w"
+)
+
+type HTTPTimeseriesGroupTLSVersionParamsBotClass string
+
+const (
+ HTTPTimeseriesGroupTLSVersionParamsBotClassLikelyAutomated HTTPTimeseriesGroupTLSVersionParamsBotClass = "LIKELY_AUTOMATED"
+ HTTPTimeseriesGroupTLSVersionParamsBotClassLikelyHuman HTTPTimeseriesGroupTLSVersionParamsBotClass = "LIKELY_HUMAN"
+)
+
+type HTTPTimeseriesGroupTLSVersionParamsDateRange string
+
+const (
+ HTTPTimeseriesGroupTLSVersionParamsDateRange1d HTTPTimeseriesGroupTLSVersionParamsDateRange = "1d"
+ HTTPTimeseriesGroupTLSVersionParamsDateRange2d HTTPTimeseriesGroupTLSVersionParamsDateRange = "2d"
+ HTTPTimeseriesGroupTLSVersionParamsDateRange7d HTTPTimeseriesGroupTLSVersionParamsDateRange = "7d"
+ HTTPTimeseriesGroupTLSVersionParamsDateRange14d HTTPTimeseriesGroupTLSVersionParamsDateRange = "14d"
+ HTTPTimeseriesGroupTLSVersionParamsDateRange28d HTTPTimeseriesGroupTLSVersionParamsDateRange = "28d"
+ HTTPTimeseriesGroupTLSVersionParamsDateRange12w HTTPTimeseriesGroupTLSVersionParamsDateRange = "12w"
+ HTTPTimeseriesGroupTLSVersionParamsDateRange24w HTTPTimeseriesGroupTLSVersionParamsDateRange = "24w"
+ HTTPTimeseriesGroupTLSVersionParamsDateRange52w HTTPTimeseriesGroupTLSVersionParamsDateRange = "52w"
+ HTTPTimeseriesGroupTLSVersionParamsDateRange1dControl HTTPTimeseriesGroupTLSVersionParamsDateRange = "1dControl"
+ HTTPTimeseriesGroupTLSVersionParamsDateRange2dControl HTTPTimeseriesGroupTLSVersionParamsDateRange = "2dControl"
+ HTTPTimeseriesGroupTLSVersionParamsDateRange7dControl HTTPTimeseriesGroupTLSVersionParamsDateRange = "7dControl"
+ HTTPTimeseriesGroupTLSVersionParamsDateRange14dControl HTTPTimeseriesGroupTLSVersionParamsDateRange = "14dControl"
+ HTTPTimeseriesGroupTLSVersionParamsDateRange28dControl HTTPTimeseriesGroupTLSVersionParamsDateRange = "28dControl"
+ HTTPTimeseriesGroupTLSVersionParamsDateRange12wControl HTTPTimeseriesGroupTLSVersionParamsDateRange = "12wControl"
+ HTTPTimeseriesGroupTLSVersionParamsDateRange24wControl HTTPTimeseriesGroupTLSVersionParamsDateRange = "24wControl"
+)
+
+type HTTPTimeseriesGroupTLSVersionParamsDeviceType string
+
+const (
+ HTTPTimeseriesGroupTLSVersionParamsDeviceTypeDesktop HTTPTimeseriesGroupTLSVersionParamsDeviceType = "DESKTOP"
+ HTTPTimeseriesGroupTLSVersionParamsDeviceTypeMobile HTTPTimeseriesGroupTLSVersionParamsDeviceType = "MOBILE"
+ HTTPTimeseriesGroupTLSVersionParamsDeviceTypeOther HTTPTimeseriesGroupTLSVersionParamsDeviceType = "OTHER"
+)
+
+// Format results are returned in.
+type HTTPTimeseriesGroupTLSVersionParamsFormat string
+
+const (
+ HTTPTimeseriesGroupTLSVersionParamsFormatJson HTTPTimeseriesGroupTLSVersionParamsFormat = "JSON"
+ HTTPTimeseriesGroupTLSVersionParamsFormatCsv HTTPTimeseriesGroupTLSVersionParamsFormat = "CSV"
+)
+
+type HTTPTimeseriesGroupTLSVersionParamsHTTPProtocol string
+
+const (
+ HTTPTimeseriesGroupTLSVersionParamsHTTPProtocolHTTP HTTPTimeseriesGroupTLSVersionParamsHTTPProtocol = "HTTP"
+ HTTPTimeseriesGroupTLSVersionParamsHTTPProtocolHTTPS HTTPTimeseriesGroupTLSVersionParamsHTTPProtocol = "HTTPS"
+)
+
+type HTTPTimeseriesGroupTLSVersionParamsHTTPVersion string
+
+const (
+ HTTPTimeseriesGroupTLSVersionParamsHTTPVersionHttPv1 HTTPTimeseriesGroupTLSVersionParamsHTTPVersion = "HTTPv1"
+ HTTPTimeseriesGroupTLSVersionParamsHTTPVersionHttPv2 HTTPTimeseriesGroupTLSVersionParamsHTTPVersion = "HTTPv2"
+ HTTPTimeseriesGroupTLSVersionParamsHTTPVersionHttPv3 HTTPTimeseriesGroupTLSVersionParamsHTTPVersion = "HTTPv3"
+)
+
+type HTTPTimeseriesGroupTLSVersionParamsIPVersion string
+
+const (
+ HTTPTimeseriesGroupTLSVersionParamsIPVersionIPv4 HTTPTimeseriesGroupTLSVersionParamsIPVersion = "IPv4"
+ HTTPTimeseriesGroupTLSVersionParamsIPVersionIPv6 HTTPTimeseriesGroupTLSVersionParamsIPVersion = "IPv6"
+)
+
+type HTTPTimeseriesGroupTLSVersionParamsOS string
+
+const (
+ HTTPTimeseriesGroupTLSVersionParamsOSWindows HTTPTimeseriesGroupTLSVersionParamsOS = "WINDOWS"
+ HTTPTimeseriesGroupTLSVersionParamsOSMacosx HTTPTimeseriesGroupTLSVersionParamsOS = "MACOSX"
+ HTTPTimeseriesGroupTLSVersionParamsOSIos HTTPTimeseriesGroupTLSVersionParamsOS = "IOS"
+ HTTPTimeseriesGroupTLSVersionParamsOSAndroid HTTPTimeseriesGroupTLSVersionParamsOS = "ANDROID"
+ HTTPTimeseriesGroupTLSVersionParamsOSChromeos HTTPTimeseriesGroupTLSVersionParamsOS = "CHROMEOS"
+ HTTPTimeseriesGroupTLSVersionParamsOSLinux HTTPTimeseriesGroupTLSVersionParamsOS = "LINUX"
+ HTTPTimeseriesGroupTLSVersionParamsOSSmartTv HTTPTimeseriesGroupTLSVersionParamsOS = "SMART_TV"
+)
+
+type HTTPTimeseriesGroupTLSVersionResponseEnvelope struct {
+ Result HTTPTimeseriesGroupTLSVersionResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON httpTimeseriesGroupTLSVersionResponseEnvelopeJSON `json:"-"`
+}
+
+// httpTimeseriesGroupTLSVersionResponseEnvelopeJSON contains the JSON metadata for
+// the struct [HTTPTimeseriesGroupTLSVersionResponseEnvelope]
+type httpTimeseriesGroupTLSVersionResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPTimeseriesGroupTLSVersionResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpTimeseriesGroupTLSVersionResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/radar/httptimeseriesgroup_test.go b/radar/httptimeseriesgroup_test.go
new file mode 100644
index 00000000000..38f1706d2ed
--- /dev/null
+++ b/radar/httptimeseriesgroup_test.go
@@ -0,0 +1,379 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/radar"
+)
+
+func TestHTTPTimeseriesGroupBotClassWithOptionalParams(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"),
+ )
+ _, err := client.Radar.HTTP.TimeseriesGroups.BotClass(context.TODO(), radar.HTTPTimeseriesGroupBotClassParams{
+ AggInterval: cloudflare.F(radar.HTTPTimeseriesGroupBotClassParamsAggInterval1h),
+ 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([]radar.HTTPTimeseriesGroupBotClassParamsDateRange{radar.HTTPTimeseriesGroupBotClassParamsDateRange1d, radar.HTTPTimeseriesGroupBotClassParamsDateRange2d, radar.HTTPTimeseriesGroupBotClassParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DeviceType: cloudflare.F([]radar.HTTPTimeseriesGroupBotClassParamsDeviceType{radar.HTTPTimeseriesGroupBotClassParamsDeviceTypeDesktop, radar.HTTPTimeseriesGroupBotClassParamsDeviceTypeMobile, radar.HTTPTimeseriesGroupBotClassParamsDeviceTypeOther}),
+ Format: cloudflare.F(radar.HTTPTimeseriesGroupBotClassParamsFormatJson),
+ HTTPProtocol: cloudflare.F([]radar.HTTPTimeseriesGroupBotClassParamsHTTPProtocol{radar.HTTPTimeseriesGroupBotClassParamsHTTPProtocolHTTP, radar.HTTPTimeseriesGroupBotClassParamsHTTPProtocolHTTPS}),
+ HTTPVersion: cloudflare.F([]radar.HTTPTimeseriesGroupBotClassParamsHTTPVersion{radar.HTTPTimeseriesGroupBotClassParamsHTTPVersionHttPv1, radar.HTTPTimeseriesGroupBotClassParamsHTTPVersionHttPv2, radar.HTTPTimeseriesGroupBotClassParamsHTTPVersionHttPv3}),
+ IPVersion: cloudflare.F([]radar.HTTPTimeseriesGroupBotClassParamsIPVersion{radar.HTTPTimeseriesGroupBotClassParamsIPVersionIPv4, radar.HTTPTimeseriesGroupBotClassParamsIPVersionIPv6}),
+ Location: cloudflare.F([]string{"string", "string", "string"}),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ OS: cloudflare.F([]radar.HTTPTimeseriesGroupBotClassParamsOS{radar.HTTPTimeseriesGroupBotClassParamsOSWindows, radar.HTTPTimeseriesGroupBotClassParamsOSMacosx, radar.HTTPTimeseriesGroupBotClassParamsOSIos}),
+ TLSVersion: cloudflare.F([]radar.HTTPTimeseriesGroupBotClassParamsTLSVersion{radar.HTTPTimeseriesGroupBotClassParamsTLSVersionTlSv1_0, radar.HTTPTimeseriesGroupBotClassParamsTLSVersionTlSv1_1, radar.HTTPTimeseriesGroupBotClassParamsTLSVersionTlSv1_2}),
+ })
+ 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())
+ }
+}
+
+func TestHTTPTimeseriesGroupBrowserWithOptionalParams(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"),
+ )
+ _, err := client.Radar.HTTP.TimeseriesGroups.Browser(context.TODO(), radar.HTTPTimeseriesGroupBrowserParams{
+ AggInterval: cloudflare.F(radar.HTTPTimeseriesGroupBrowserParamsAggInterval1h),
+ ASN: cloudflare.F([]string{"string", "string", "string"}),
+ BotClass: cloudflare.F([]radar.HTTPTimeseriesGroupBrowserParamsBotClass{radar.HTTPTimeseriesGroupBrowserParamsBotClassLikelyAutomated, radar.HTTPTimeseriesGroupBrowserParamsBotClassLikelyHuman}),
+ Continent: cloudflare.F([]string{"string", "string", "string"}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.HTTPTimeseriesGroupBrowserParamsDateRange{radar.HTTPTimeseriesGroupBrowserParamsDateRange1d, radar.HTTPTimeseriesGroupBrowserParamsDateRange2d, radar.HTTPTimeseriesGroupBrowserParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DeviceType: cloudflare.F([]radar.HTTPTimeseriesGroupBrowserParamsDeviceType{radar.HTTPTimeseriesGroupBrowserParamsDeviceTypeDesktop, radar.HTTPTimeseriesGroupBrowserParamsDeviceTypeMobile, radar.HTTPTimeseriesGroupBrowserParamsDeviceTypeOther}),
+ Format: cloudflare.F(radar.HTTPTimeseriesGroupBrowserParamsFormatJson),
+ HTTPProtocol: cloudflare.F([]radar.HTTPTimeseriesGroupBrowserParamsHTTPProtocol{radar.HTTPTimeseriesGroupBrowserParamsHTTPProtocolHTTP, radar.HTTPTimeseriesGroupBrowserParamsHTTPProtocolHTTPS}),
+ HTTPVersion: cloudflare.F([]radar.HTTPTimeseriesGroupBrowserParamsHTTPVersion{radar.HTTPTimeseriesGroupBrowserParamsHTTPVersionHttPv1, radar.HTTPTimeseriesGroupBrowserParamsHTTPVersionHttPv2, radar.HTTPTimeseriesGroupBrowserParamsHTTPVersionHttPv3}),
+ IPVersion: cloudflare.F([]radar.HTTPTimeseriesGroupBrowserParamsIPVersion{radar.HTTPTimeseriesGroupBrowserParamsIPVersionIPv4, radar.HTTPTimeseriesGroupBrowserParamsIPVersionIPv6}),
+ LimitPerGroup: cloudflare.F(int64(4)),
+ Location: cloudflare.F([]string{"string", "string", "string"}),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ OS: cloudflare.F([]radar.HTTPTimeseriesGroupBrowserParamsOS{radar.HTTPTimeseriesGroupBrowserParamsOSWindows, radar.HTTPTimeseriesGroupBrowserParamsOSMacosx, radar.HTTPTimeseriesGroupBrowserParamsOSIos}),
+ TLSVersion: cloudflare.F([]radar.HTTPTimeseriesGroupBrowserParamsTLSVersion{radar.HTTPTimeseriesGroupBrowserParamsTLSVersionTlSv1_0, radar.HTTPTimeseriesGroupBrowserParamsTLSVersionTlSv1_1, radar.HTTPTimeseriesGroupBrowserParamsTLSVersionTlSv1_2}),
+ })
+ 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())
+ }
+}
+
+func TestHTTPTimeseriesGroupBrowserFamilyWithOptionalParams(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"),
+ )
+ _, err := client.Radar.HTTP.TimeseriesGroups.BrowserFamily(context.TODO(), radar.HTTPTimeseriesGroupBrowserFamilyParams{
+ AggInterval: cloudflare.F(radar.HTTPTimeseriesGroupBrowserFamilyParamsAggInterval1h),
+ ASN: cloudflare.F([]string{"string", "string", "string"}),
+ BotClass: cloudflare.F([]radar.HTTPTimeseriesGroupBrowserFamilyParamsBotClass{radar.HTTPTimeseriesGroupBrowserFamilyParamsBotClassLikelyAutomated, radar.HTTPTimeseriesGroupBrowserFamilyParamsBotClassLikelyHuman}),
+ Continent: cloudflare.F([]string{"string", "string", "string"}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.HTTPTimeseriesGroupBrowserFamilyParamsDateRange{radar.HTTPTimeseriesGroupBrowserFamilyParamsDateRange1d, radar.HTTPTimeseriesGroupBrowserFamilyParamsDateRange2d, radar.HTTPTimeseriesGroupBrowserFamilyParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DeviceType: cloudflare.F([]radar.HTTPTimeseriesGroupBrowserFamilyParamsDeviceType{radar.HTTPTimeseriesGroupBrowserFamilyParamsDeviceTypeDesktop, radar.HTTPTimeseriesGroupBrowserFamilyParamsDeviceTypeMobile, radar.HTTPTimeseriesGroupBrowserFamilyParamsDeviceTypeOther}),
+ Format: cloudflare.F(radar.HTTPTimeseriesGroupBrowserFamilyParamsFormatJson),
+ HTTPProtocol: cloudflare.F([]radar.HTTPTimeseriesGroupBrowserFamilyParamsHTTPProtocol{radar.HTTPTimeseriesGroupBrowserFamilyParamsHTTPProtocolHTTP, radar.HTTPTimeseriesGroupBrowserFamilyParamsHTTPProtocolHTTPS}),
+ HTTPVersion: cloudflare.F([]radar.HTTPTimeseriesGroupBrowserFamilyParamsHTTPVersion{radar.HTTPTimeseriesGroupBrowserFamilyParamsHTTPVersionHttPv1, radar.HTTPTimeseriesGroupBrowserFamilyParamsHTTPVersionHttPv2, radar.HTTPTimeseriesGroupBrowserFamilyParamsHTTPVersionHttPv3}),
+ IPVersion: cloudflare.F([]radar.HTTPTimeseriesGroupBrowserFamilyParamsIPVersion{radar.HTTPTimeseriesGroupBrowserFamilyParamsIPVersionIPv4, radar.HTTPTimeseriesGroupBrowserFamilyParamsIPVersionIPv6}),
+ Location: cloudflare.F([]string{"string", "string", "string"}),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ OS: cloudflare.F([]radar.HTTPTimeseriesGroupBrowserFamilyParamsOS{radar.HTTPTimeseriesGroupBrowserFamilyParamsOSWindows, radar.HTTPTimeseriesGroupBrowserFamilyParamsOSMacosx, radar.HTTPTimeseriesGroupBrowserFamilyParamsOSIos}),
+ TLSVersion: cloudflare.F([]radar.HTTPTimeseriesGroupBrowserFamilyParamsTLSVersion{radar.HTTPTimeseriesGroupBrowserFamilyParamsTLSVersionTlSv1_0, radar.HTTPTimeseriesGroupBrowserFamilyParamsTLSVersionTlSv1_1, radar.HTTPTimeseriesGroupBrowserFamilyParamsTLSVersionTlSv1_2}),
+ })
+ 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())
+ }
+}
+
+func TestHTTPTimeseriesGroupDeviceTypeWithOptionalParams(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"),
+ )
+ _, err := client.Radar.HTTP.TimeseriesGroups.DeviceType(context.TODO(), radar.HTTPTimeseriesGroupDeviceTypeParams{
+ AggInterval: cloudflare.F(radar.HTTPTimeseriesGroupDeviceTypeParamsAggInterval1h),
+ ASN: cloudflare.F([]string{"string", "string", "string"}),
+ BotClass: cloudflare.F([]radar.HTTPTimeseriesGroupDeviceTypeParamsBotClass{radar.HTTPTimeseriesGroupDeviceTypeParamsBotClassLikelyAutomated, radar.HTTPTimeseriesGroupDeviceTypeParamsBotClassLikelyHuman}),
+ Continent: cloudflare.F([]string{"string", "string", "string"}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.HTTPTimeseriesGroupDeviceTypeParamsDateRange{radar.HTTPTimeseriesGroupDeviceTypeParamsDateRange1d, radar.HTTPTimeseriesGroupDeviceTypeParamsDateRange2d, radar.HTTPTimeseriesGroupDeviceTypeParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Format: cloudflare.F(radar.HTTPTimeseriesGroupDeviceTypeParamsFormatJson),
+ HTTPProtocol: cloudflare.F([]radar.HTTPTimeseriesGroupDeviceTypeParamsHTTPProtocol{radar.HTTPTimeseriesGroupDeviceTypeParamsHTTPProtocolHTTP, radar.HTTPTimeseriesGroupDeviceTypeParamsHTTPProtocolHTTPS}),
+ HTTPVersion: cloudflare.F([]radar.HTTPTimeseriesGroupDeviceTypeParamsHTTPVersion{radar.HTTPTimeseriesGroupDeviceTypeParamsHTTPVersionHttPv1, radar.HTTPTimeseriesGroupDeviceTypeParamsHTTPVersionHttPv2, radar.HTTPTimeseriesGroupDeviceTypeParamsHTTPVersionHttPv3}),
+ IPVersion: cloudflare.F([]radar.HTTPTimeseriesGroupDeviceTypeParamsIPVersion{radar.HTTPTimeseriesGroupDeviceTypeParamsIPVersionIPv4, radar.HTTPTimeseriesGroupDeviceTypeParamsIPVersionIPv6}),
+ Location: cloudflare.F([]string{"string", "string", "string"}),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ OS: cloudflare.F([]radar.HTTPTimeseriesGroupDeviceTypeParamsOS{radar.HTTPTimeseriesGroupDeviceTypeParamsOSWindows, radar.HTTPTimeseriesGroupDeviceTypeParamsOSMacosx, radar.HTTPTimeseriesGroupDeviceTypeParamsOSIos}),
+ TLSVersion: cloudflare.F([]radar.HTTPTimeseriesGroupDeviceTypeParamsTLSVersion{radar.HTTPTimeseriesGroupDeviceTypeParamsTLSVersionTlSv1_0, radar.HTTPTimeseriesGroupDeviceTypeParamsTLSVersionTlSv1_1, radar.HTTPTimeseriesGroupDeviceTypeParamsTLSVersionTlSv1_2}),
+ })
+ 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())
+ }
+}
+
+func TestHTTPTimeseriesGroupHTTPProtocolWithOptionalParams(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"),
+ )
+ _, err := client.Radar.HTTP.TimeseriesGroups.HTTPProtocol(context.TODO(), radar.HTTPTimeseriesGroupHTTPProtocolParams{
+ AggInterval: cloudflare.F(radar.HTTPTimeseriesGroupHTTPProtocolParamsAggInterval1h),
+ ASN: cloudflare.F([]string{"string", "string", "string"}),
+ BotClass: cloudflare.F([]radar.HTTPTimeseriesGroupHTTPProtocolParamsBotClass{radar.HTTPTimeseriesGroupHTTPProtocolParamsBotClassLikelyAutomated, radar.HTTPTimeseriesGroupHTTPProtocolParamsBotClassLikelyHuman}),
+ Continent: cloudflare.F([]string{"string", "string", "string"}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.HTTPTimeseriesGroupHTTPProtocolParamsDateRange{radar.HTTPTimeseriesGroupHTTPProtocolParamsDateRange1d, radar.HTTPTimeseriesGroupHTTPProtocolParamsDateRange2d, radar.HTTPTimeseriesGroupHTTPProtocolParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DeviceType: cloudflare.F([]radar.HTTPTimeseriesGroupHTTPProtocolParamsDeviceType{radar.HTTPTimeseriesGroupHTTPProtocolParamsDeviceTypeDesktop, radar.HTTPTimeseriesGroupHTTPProtocolParamsDeviceTypeMobile, radar.HTTPTimeseriesGroupHTTPProtocolParamsDeviceTypeOther}),
+ Format: cloudflare.F(radar.HTTPTimeseriesGroupHTTPProtocolParamsFormatJson),
+ HTTPVersion: cloudflare.F([]radar.HTTPTimeseriesGroupHTTPProtocolParamsHTTPVersion{radar.HTTPTimeseriesGroupHTTPProtocolParamsHTTPVersionHttPv1, radar.HTTPTimeseriesGroupHTTPProtocolParamsHTTPVersionHttPv2, radar.HTTPTimeseriesGroupHTTPProtocolParamsHTTPVersionHttPv3}),
+ IPVersion: cloudflare.F([]radar.HTTPTimeseriesGroupHTTPProtocolParamsIPVersion{radar.HTTPTimeseriesGroupHTTPProtocolParamsIPVersionIPv4, radar.HTTPTimeseriesGroupHTTPProtocolParamsIPVersionIPv6}),
+ Location: cloudflare.F([]string{"string", "string", "string"}),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ OS: cloudflare.F([]radar.HTTPTimeseriesGroupHTTPProtocolParamsOS{radar.HTTPTimeseriesGroupHTTPProtocolParamsOSWindows, radar.HTTPTimeseriesGroupHTTPProtocolParamsOSMacosx, radar.HTTPTimeseriesGroupHTTPProtocolParamsOSIos}),
+ TLSVersion: cloudflare.F([]radar.HTTPTimeseriesGroupHTTPProtocolParamsTLSVersion{radar.HTTPTimeseriesGroupHTTPProtocolParamsTLSVersionTlSv1_0, radar.HTTPTimeseriesGroupHTTPProtocolParamsTLSVersionTlSv1_1, radar.HTTPTimeseriesGroupHTTPProtocolParamsTLSVersionTlSv1_2}),
+ })
+ 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())
+ }
+}
+
+func TestHTTPTimeseriesGroupHTTPVersionWithOptionalParams(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"),
+ )
+ _, err := client.Radar.HTTP.TimeseriesGroups.HTTPVersion(context.TODO(), radar.HTTPTimeseriesGroupHTTPVersionParams{
+ AggInterval: cloudflare.F(radar.HTTPTimeseriesGroupHTTPVersionParamsAggInterval1h),
+ ASN: cloudflare.F([]string{"string", "string", "string"}),
+ BotClass: cloudflare.F([]radar.HTTPTimeseriesGroupHTTPVersionParamsBotClass{radar.HTTPTimeseriesGroupHTTPVersionParamsBotClassLikelyAutomated, radar.HTTPTimeseriesGroupHTTPVersionParamsBotClassLikelyHuman}),
+ Continent: cloudflare.F([]string{"string", "string", "string"}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.HTTPTimeseriesGroupHTTPVersionParamsDateRange{radar.HTTPTimeseriesGroupHTTPVersionParamsDateRange1d, radar.HTTPTimeseriesGroupHTTPVersionParamsDateRange2d, radar.HTTPTimeseriesGroupHTTPVersionParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DeviceType: cloudflare.F([]radar.HTTPTimeseriesGroupHTTPVersionParamsDeviceType{radar.HTTPTimeseriesGroupHTTPVersionParamsDeviceTypeDesktop, radar.HTTPTimeseriesGroupHTTPVersionParamsDeviceTypeMobile, radar.HTTPTimeseriesGroupHTTPVersionParamsDeviceTypeOther}),
+ Format: cloudflare.F(radar.HTTPTimeseriesGroupHTTPVersionParamsFormatJson),
+ HTTPProtocol: cloudflare.F([]radar.HTTPTimeseriesGroupHTTPVersionParamsHTTPProtocol{radar.HTTPTimeseriesGroupHTTPVersionParamsHTTPProtocolHTTP, radar.HTTPTimeseriesGroupHTTPVersionParamsHTTPProtocolHTTPS}),
+ IPVersion: cloudflare.F([]radar.HTTPTimeseriesGroupHTTPVersionParamsIPVersion{radar.HTTPTimeseriesGroupHTTPVersionParamsIPVersionIPv4, radar.HTTPTimeseriesGroupHTTPVersionParamsIPVersionIPv6}),
+ Location: cloudflare.F([]string{"string", "string", "string"}),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ OS: cloudflare.F([]radar.HTTPTimeseriesGroupHTTPVersionParamsOS{radar.HTTPTimeseriesGroupHTTPVersionParamsOSWindows, radar.HTTPTimeseriesGroupHTTPVersionParamsOSMacosx, radar.HTTPTimeseriesGroupHTTPVersionParamsOSIos}),
+ TLSVersion: cloudflare.F([]radar.HTTPTimeseriesGroupHTTPVersionParamsTLSVersion{radar.HTTPTimeseriesGroupHTTPVersionParamsTLSVersionTlSv1_0, radar.HTTPTimeseriesGroupHTTPVersionParamsTLSVersionTlSv1_1, radar.HTTPTimeseriesGroupHTTPVersionParamsTLSVersionTlSv1_2}),
+ })
+ 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())
+ }
+}
+
+func TestHTTPTimeseriesGroupIPVersionWithOptionalParams(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"),
+ )
+ _, err := client.Radar.HTTP.TimeseriesGroups.IPVersion(context.TODO(), radar.HTTPTimeseriesGroupIPVersionParams{
+ AggInterval: cloudflare.F(radar.HTTPTimeseriesGroupIPVersionParamsAggInterval1h),
+ ASN: cloudflare.F([]string{"string", "string", "string"}),
+ BotClass: cloudflare.F([]radar.HTTPTimeseriesGroupIPVersionParamsBotClass{radar.HTTPTimeseriesGroupIPVersionParamsBotClassLikelyAutomated, radar.HTTPTimeseriesGroupIPVersionParamsBotClassLikelyHuman}),
+ Continent: cloudflare.F([]string{"string", "string", "string"}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.HTTPTimeseriesGroupIPVersionParamsDateRange{radar.HTTPTimeseriesGroupIPVersionParamsDateRange1d, radar.HTTPTimeseriesGroupIPVersionParamsDateRange2d, radar.HTTPTimeseriesGroupIPVersionParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DeviceType: cloudflare.F([]radar.HTTPTimeseriesGroupIPVersionParamsDeviceType{radar.HTTPTimeseriesGroupIPVersionParamsDeviceTypeDesktop, radar.HTTPTimeseriesGroupIPVersionParamsDeviceTypeMobile, radar.HTTPTimeseriesGroupIPVersionParamsDeviceTypeOther}),
+ Format: cloudflare.F(radar.HTTPTimeseriesGroupIPVersionParamsFormatJson),
+ HTTPProtocol: cloudflare.F([]radar.HTTPTimeseriesGroupIPVersionParamsHTTPProtocol{radar.HTTPTimeseriesGroupIPVersionParamsHTTPProtocolHTTP, radar.HTTPTimeseriesGroupIPVersionParamsHTTPProtocolHTTPS}),
+ HTTPVersion: cloudflare.F([]radar.HTTPTimeseriesGroupIPVersionParamsHTTPVersion{radar.HTTPTimeseriesGroupIPVersionParamsHTTPVersionHttPv1, radar.HTTPTimeseriesGroupIPVersionParamsHTTPVersionHttPv2, radar.HTTPTimeseriesGroupIPVersionParamsHTTPVersionHttPv3}),
+ Location: cloudflare.F([]string{"string", "string", "string"}),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ OS: cloudflare.F([]radar.HTTPTimeseriesGroupIPVersionParamsOS{radar.HTTPTimeseriesGroupIPVersionParamsOSWindows, radar.HTTPTimeseriesGroupIPVersionParamsOSMacosx, radar.HTTPTimeseriesGroupIPVersionParamsOSIos}),
+ TLSVersion: cloudflare.F([]radar.HTTPTimeseriesGroupIPVersionParamsTLSVersion{radar.HTTPTimeseriesGroupIPVersionParamsTLSVersionTlSv1_0, radar.HTTPTimeseriesGroupIPVersionParamsTLSVersionTlSv1_1, radar.HTTPTimeseriesGroupIPVersionParamsTLSVersionTlSv1_2}),
+ })
+ 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())
+ }
+}
+
+func TestHTTPTimeseriesGroupOSWithOptionalParams(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"),
+ )
+ _, err := client.Radar.HTTP.TimeseriesGroups.OS(context.TODO(), radar.HTTPTimeseriesGroupOSParams{
+ AggInterval: cloudflare.F(radar.HTTPTimeseriesGroupOSParamsAggInterval1h),
+ ASN: cloudflare.F([]string{"string", "string", "string"}),
+ BotClass: cloudflare.F([]radar.HTTPTimeseriesGroupOSParamsBotClass{radar.HTTPTimeseriesGroupOSParamsBotClassLikelyAutomated, radar.HTTPTimeseriesGroupOSParamsBotClassLikelyHuman}),
+ Continent: cloudflare.F([]string{"string", "string", "string"}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.HTTPTimeseriesGroupOSParamsDateRange{radar.HTTPTimeseriesGroupOSParamsDateRange1d, radar.HTTPTimeseriesGroupOSParamsDateRange2d, radar.HTTPTimeseriesGroupOSParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DeviceType: cloudflare.F([]radar.HTTPTimeseriesGroupOSParamsDeviceType{radar.HTTPTimeseriesGroupOSParamsDeviceTypeDesktop, radar.HTTPTimeseriesGroupOSParamsDeviceTypeMobile, radar.HTTPTimeseriesGroupOSParamsDeviceTypeOther}),
+ Format: cloudflare.F(radar.HTTPTimeseriesGroupOSParamsFormatJson),
+ HTTPProtocol: cloudflare.F([]radar.HTTPTimeseriesGroupOSParamsHTTPProtocol{radar.HTTPTimeseriesGroupOSParamsHTTPProtocolHTTP, radar.HTTPTimeseriesGroupOSParamsHTTPProtocolHTTPS}),
+ HTTPVersion: cloudflare.F([]radar.HTTPTimeseriesGroupOSParamsHTTPVersion{radar.HTTPTimeseriesGroupOSParamsHTTPVersionHttPv1, radar.HTTPTimeseriesGroupOSParamsHTTPVersionHttPv2, radar.HTTPTimeseriesGroupOSParamsHTTPVersionHttPv3}),
+ IPVersion: cloudflare.F([]radar.HTTPTimeseriesGroupOSParamsIPVersion{radar.HTTPTimeseriesGroupOSParamsIPVersionIPv4, radar.HTTPTimeseriesGroupOSParamsIPVersionIPv6}),
+ Location: cloudflare.F([]string{"string", "string", "string"}),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ TLSVersion: cloudflare.F([]radar.HTTPTimeseriesGroupOSParamsTLSVersion{radar.HTTPTimeseriesGroupOSParamsTLSVersionTlSv1_0, radar.HTTPTimeseriesGroupOSParamsTLSVersionTlSv1_1, radar.HTTPTimeseriesGroupOSParamsTLSVersionTlSv1_2}),
+ })
+ 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())
+ }
+}
+
+func TestHTTPTimeseriesGroupTLSVersionWithOptionalParams(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"),
+ )
+ _, err := client.Radar.HTTP.TimeseriesGroups.TLSVersion(context.TODO(), radar.HTTPTimeseriesGroupTLSVersionParams{
+ AggInterval: cloudflare.F(radar.HTTPTimeseriesGroupTLSVersionParamsAggInterval1h),
+ ASN: cloudflare.F([]string{"string", "string", "string"}),
+ BotClass: cloudflare.F([]radar.HTTPTimeseriesGroupTLSVersionParamsBotClass{radar.HTTPTimeseriesGroupTLSVersionParamsBotClassLikelyAutomated, radar.HTTPTimeseriesGroupTLSVersionParamsBotClassLikelyHuman}),
+ Continent: cloudflare.F([]string{"string", "string", "string"}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.HTTPTimeseriesGroupTLSVersionParamsDateRange{radar.HTTPTimeseriesGroupTLSVersionParamsDateRange1d, radar.HTTPTimeseriesGroupTLSVersionParamsDateRange2d, radar.HTTPTimeseriesGroupTLSVersionParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DeviceType: cloudflare.F([]radar.HTTPTimeseriesGroupTLSVersionParamsDeviceType{radar.HTTPTimeseriesGroupTLSVersionParamsDeviceTypeDesktop, radar.HTTPTimeseriesGroupTLSVersionParamsDeviceTypeMobile, radar.HTTPTimeseriesGroupTLSVersionParamsDeviceTypeOther}),
+ Format: cloudflare.F(radar.HTTPTimeseriesGroupTLSVersionParamsFormatJson),
+ HTTPProtocol: cloudflare.F([]radar.HTTPTimeseriesGroupTLSVersionParamsHTTPProtocol{radar.HTTPTimeseriesGroupTLSVersionParamsHTTPProtocolHTTP, radar.HTTPTimeseriesGroupTLSVersionParamsHTTPProtocolHTTPS}),
+ HTTPVersion: cloudflare.F([]radar.HTTPTimeseriesGroupTLSVersionParamsHTTPVersion{radar.HTTPTimeseriesGroupTLSVersionParamsHTTPVersionHttPv1, radar.HTTPTimeseriesGroupTLSVersionParamsHTTPVersionHttPv2, radar.HTTPTimeseriesGroupTLSVersionParamsHTTPVersionHttPv3}),
+ IPVersion: cloudflare.F([]radar.HTTPTimeseriesGroupTLSVersionParamsIPVersion{radar.HTTPTimeseriesGroupTLSVersionParamsIPVersionIPv4, radar.HTTPTimeseriesGroupTLSVersionParamsIPVersionIPv6}),
+ Location: cloudflare.F([]string{"string", "string", "string"}),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ OS: cloudflare.F([]radar.HTTPTimeseriesGroupTLSVersionParamsOS{radar.HTTPTimeseriesGroupTLSVersionParamsOSWindows, radar.HTTPTimeseriesGroupTLSVersionParamsOSMacosx, radar.HTTPTimeseriesGroupTLSVersionParamsOSIos}),
+ })
+ 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/radar/httptop.go b/radar/httptop.go
new file mode 100644
index 00000000000..8b546e0818a
--- /dev/null
+++ b/radar/httptop.go
@@ -0,0 +1,691 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "context"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// HTTPTopService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewHTTPTopService] method instead.
+type HTTPTopService struct {
+ Options []option.RequestOption
+}
+
+// NewHTTPTopService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewHTTPTopService(opts ...option.RequestOption) (r *HTTPTopService) {
+ r = &HTTPTopService{}
+ r.Options = opts
+ return
+}
+
+// Get the top user agents aggregated in families by HTTP traffic. Values are a
+// percentage out of the total traffic.
+func (r *HTTPTopService) BrowserFamilies(ctx context.Context, query HTTPTopBrowserFamiliesParams, opts ...option.RequestOption) (res *HTTPTopBrowserFamiliesResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env HTTPTopBrowserFamiliesResponseEnvelope
+ path := "radar/http/top/browser_families"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Get the top user agents by HTTP traffic. Values are a percentage out of the
+// total traffic.
+func (r *HTTPTopService) Browsers(ctx context.Context, query HTTPTopBrowsersParams, opts ...option.RequestOption) (res *HTTPTopBrowsersResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env HTTPTopBrowsersResponseEnvelope
+ path := "radar/http/top/browsers"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type HTTPTopBrowserFamiliesResponse struct {
+ Meta HTTPTopBrowserFamiliesResponseMeta `json:"meta,required"`
+ Top0 []HTTPTopBrowserFamiliesResponseTop0 `json:"top_0,required"`
+ JSON httpTopBrowserFamiliesResponseJSON `json:"-"`
+}
+
+// httpTopBrowserFamiliesResponseJSON contains the JSON metadata for the struct
+// [HTTPTopBrowserFamiliesResponse]
+type httpTopBrowserFamiliesResponseJSON struct {
+ Meta apijson.Field
+ Top0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPTopBrowserFamiliesResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpTopBrowserFamiliesResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPTopBrowserFamiliesResponseMeta struct {
+ DateRange []HTTPTopBrowserFamiliesResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ ConfidenceInfo HTTPTopBrowserFamiliesResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON httpTopBrowserFamiliesResponseMetaJSON `json:"-"`
+}
+
+// httpTopBrowserFamiliesResponseMetaJSON contains the JSON metadata for the struct
+// [HTTPTopBrowserFamiliesResponseMeta]
+type httpTopBrowserFamiliesResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPTopBrowserFamiliesResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpTopBrowserFamiliesResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPTopBrowserFamiliesResponseMetaDateRange 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 httpTopBrowserFamiliesResponseMetaDateRangeJSON `json:"-"`
+}
+
+// httpTopBrowserFamiliesResponseMetaDateRangeJSON contains the JSON metadata for
+// the struct [HTTPTopBrowserFamiliesResponseMetaDateRange]
+type httpTopBrowserFamiliesResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPTopBrowserFamiliesResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpTopBrowserFamiliesResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPTopBrowserFamiliesResponseMetaConfidenceInfo struct {
+ Annotations []HTTPTopBrowserFamiliesResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON httpTopBrowserFamiliesResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// httpTopBrowserFamiliesResponseMetaConfidenceInfoJSON contains the JSON metadata
+// for the struct [HTTPTopBrowserFamiliesResponseMetaConfidenceInfo]
+type httpTopBrowserFamiliesResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPTopBrowserFamiliesResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpTopBrowserFamiliesResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPTopBrowserFamiliesResponseMetaConfidenceInfoAnnotation 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 httpTopBrowserFamiliesResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// httpTopBrowserFamiliesResponseMetaConfidenceInfoAnnotationJSON contains the JSON
+// metadata for the struct
+// [HTTPTopBrowserFamiliesResponseMetaConfidenceInfoAnnotation]
+type httpTopBrowserFamiliesResponseMetaConfidenceInfoAnnotationJSON 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 *HTTPTopBrowserFamiliesResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpTopBrowserFamiliesResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPTopBrowserFamiliesResponseTop0 struct {
+ Name string `json:"name,required"`
+ Value string `json:"value,required"`
+ JSON httpTopBrowserFamiliesResponseTop0JSON `json:"-"`
+}
+
+// httpTopBrowserFamiliesResponseTop0JSON contains the JSON metadata for the struct
+// [HTTPTopBrowserFamiliesResponseTop0]
+type httpTopBrowserFamiliesResponseTop0JSON struct {
+ Name apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPTopBrowserFamiliesResponseTop0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpTopBrowserFamiliesResponseTop0JSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPTopBrowsersResponse struct {
+ Meta HTTPTopBrowsersResponseMeta `json:"meta,required"`
+ Top0 []HTTPTopBrowsersResponseTop0 `json:"top_0,required"`
+ JSON httpTopBrowsersResponseJSON `json:"-"`
+}
+
+// httpTopBrowsersResponseJSON contains the JSON metadata for the struct
+// [HTTPTopBrowsersResponse]
+type httpTopBrowsersResponseJSON struct {
+ Meta apijson.Field
+ Top0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPTopBrowsersResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpTopBrowsersResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPTopBrowsersResponseMeta struct {
+ DateRange []HTTPTopBrowsersResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ ConfidenceInfo HTTPTopBrowsersResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON httpTopBrowsersResponseMetaJSON `json:"-"`
+}
+
+// httpTopBrowsersResponseMetaJSON contains the JSON metadata for the struct
+// [HTTPTopBrowsersResponseMeta]
+type httpTopBrowsersResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPTopBrowsersResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpTopBrowsersResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPTopBrowsersResponseMetaDateRange 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 httpTopBrowsersResponseMetaDateRangeJSON `json:"-"`
+}
+
+// httpTopBrowsersResponseMetaDateRangeJSON contains the JSON metadata for the
+// struct [HTTPTopBrowsersResponseMetaDateRange]
+type httpTopBrowsersResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPTopBrowsersResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpTopBrowsersResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPTopBrowsersResponseMetaConfidenceInfo struct {
+ Annotations []HTTPTopBrowsersResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON httpTopBrowsersResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// httpTopBrowsersResponseMetaConfidenceInfoJSON contains the JSON metadata for the
+// struct [HTTPTopBrowsersResponseMetaConfidenceInfo]
+type httpTopBrowsersResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPTopBrowsersResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpTopBrowsersResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPTopBrowsersResponseMetaConfidenceInfoAnnotation 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 httpTopBrowsersResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// httpTopBrowsersResponseMetaConfidenceInfoAnnotationJSON contains the JSON
+// metadata for the struct [HTTPTopBrowsersResponseMetaConfidenceInfoAnnotation]
+type httpTopBrowsersResponseMetaConfidenceInfoAnnotationJSON 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 *HTTPTopBrowsersResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpTopBrowsersResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPTopBrowsersResponseTop0 struct {
+ Name string `json:"name,required"`
+ Value string `json:"value,required"`
+ JSON httpTopBrowsersResponseTop0JSON `json:"-"`
+}
+
+// httpTopBrowsersResponseTop0JSON contains the JSON metadata for the struct
+// [HTTPTopBrowsersResponseTop0]
+type httpTopBrowsersResponseTop0JSON struct {
+ Name apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPTopBrowsersResponseTop0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpTopBrowsersResponseTop0JSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPTopBrowserFamiliesParams 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"`
+ // Filter for bot class. Refer to
+ // [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/).
+ BotClass param.Field[[]HTTPTopBrowserFamiliesParamsBotClass] `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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]HTTPTopBrowserFamiliesParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Filter for device type.
+ DeviceType param.Field[[]HTTPTopBrowserFamiliesParamsDeviceType] `query:"deviceType"`
+ // Format results are returned in.
+ Format param.Field[HTTPTopBrowserFamiliesParamsFormat] `query:"format"`
+ // Filter for http protocol.
+ HTTPProtocol param.Field[[]HTTPTopBrowserFamiliesParamsHTTPProtocol] `query:"httpProtocol"`
+ // Filter for http version.
+ HTTPVersion param.Field[[]HTTPTopBrowserFamiliesParamsHTTPVersion] `query:"httpVersion"`
+ // Filter for ip version.
+ IPVersion param.Field[[]HTTPTopBrowserFamiliesParamsIPVersion] `query:"ipVersion"`
+ // 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 os name.
+ OS param.Field[[]HTTPTopBrowserFamiliesParamsOS] `query:"os"`
+ // Filter for tls version.
+ TLSVersion param.Field[[]HTTPTopBrowserFamiliesParamsTLSVersion] `query:"tlsVersion"`
+}
+
+// URLQuery serializes [HTTPTopBrowserFamiliesParams]'s query parameters as
+// `url.Values`.
+func (r HTTPTopBrowserFamiliesParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type HTTPTopBrowserFamiliesParamsBotClass string
+
+const (
+ HTTPTopBrowserFamiliesParamsBotClassLikelyAutomated HTTPTopBrowserFamiliesParamsBotClass = "LIKELY_AUTOMATED"
+ HTTPTopBrowserFamiliesParamsBotClassLikelyHuman HTTPTopBrowserFamiliesParamsBotClass = "LIKELY_HUMAN"
+)
+
+type HTTPTopBrowserFamiliesParamsDateRange string
+
+const (
+ HTTPTopBrowserFamiliesParamsDateRange1d HTTPTopBrowserFamiliesParamsDateRange = "1d"
+ HTTPTopBrowserFamiliesParamsDateRange2d HTTPTopBrowserFamiliesParamsDateRange = "2d"
+ HTTPTopBrowserFamiliesParamsDateRange7d HTTPTopBrowserFamiliesParamsDateRange = "7d"
+ HTTPTopBrowserFamiliesParamsDateRange14d HTTPTopBrowserFamiliesParamsDateRange = "14d"
+ HTTPTopBrowserFamiliesParamsDateRange28d HTTPTopBrowserFamiliesParamsDateRange = "28d"
+ HTTPTopBrowserFamiliesParamsDateRange12w HTTPTopBrowserFamiliesParamsDateRange = "12w"
+ HTTPTopBrowserFamiliesParamsDateRange24w HTTPTopBrowserFamiliesParamsDateRange = "24w"
+ HTTPTopBrowserFamiliesParamsDateRange52w HTTPTopBrowserFamiliesParamsDateRange = "52w"
+ HTTPTopBrowserFamiliesParamsDateRange1dControl HTTPTopBrowserFamiliesParamsDateRange = "1dControl"
+ HTTPTopBrowserFamiliesParamsDateRange2dControl HTTPTopBrowserFamiliesParamsDateRange = "2dControl"
+ HTTPTopBrowserFamiliesParamsDateRange7dControl HTTPTopBrowserFamiliesParamsDateRange = "7dControl"
+ HTTPTopBrowserFamiliesParamsDateRange14dControl HTTPTopBrowserFamiliesParamsDateRange = "14dControl"
+ HTTPTopBrowserFamiliesParamsDateRange28dControl HTTPTopBrowserFamiliesParamsDateRange = "28dControl"
+ HTTPTopBrowserFamiliesParamsDateRange12wControl HTTPTopBrowserFamiliesParamsDateRange = "12wControl"
+ HTTPTopBrowserFamiliesParamsDateRange24wControl HTTPTopBrowserFamiliesParamsDateRange = "24wControl"
+)
+
+type HTTPTopBrowserFamiliesParamsDeviceType string
+
+const (
+ HTTPTopBrowserFamiliesParamsDeviceTypeDesktop HTTPTopBrowserFamiliesParamsDeviceType = "DESKTOP"
+ HTTPTopBrowserFamiliesParamsDeviceTypeMobile HTTPTopBrowserFamiliesParamsDeviceType = "MOBILE"
+ HTTPTopBrowserFamiliesParamsDeviceTypeOther HTTPTopBrowserFamiliesParamsDeviceType = "OTHER"
+)
+
+// Format results are returned in.
+type HTTPTopBrowserFamiliesParamsFormat string
+
+const (
+ HTTPTopBrowserFamiliesParamsFormatJson HTTPTopBrowserFamiliesParamsFormat = "JSON"
+ HTTPTopBrowserFamiliesParamsFormatCsv HTTPTopBrowserFamiliesParamsFormat = "CSV"
+)
+
+type HTTPTopBrowserFamiliesParamsHTTPProtocol string
+
+const (
+ HTTPTopBrowserFamiliesParamsHTTPProtocolHTTP HTTPTopBrowserFamiliesParamsHTTPProtocol = "HTTP"
+ HTTPTopBrowserFamiliesParamsHTTPProtocolHTTPS HTTPTopBrowserFamiliesParamsHTTPProtocol = "HTTPS"
+)
+
+type HTTPTopBrowserFamiliesParamsHTTPVersion string
+
+const (
+ HTTPTopBrowserFamiliesParamsHTTPVersionHttPv1 HTTPTopBrowserFamiliesParamsHTTPVersion = "HTTPv1"
+ HTTPTopBrowserFamiliesParamsHTTPVersionHttPv2 HTTPTopBrowserFamiliesParamsHTTPVersion = "HTTPv2"
+ HTTPTopBrowserFamiliesParamsHTTPVersionHttPv3 HTTPTopBrowserFamiliesParamsHTTPVersion = "HTTPv3"
+)
+
+type HTTPTopBrowserFamiliesParamsIPVersion string
+
+const (
+ HTTPTopBrowserFamiliesParamsIPVersionIPv4 HTTPTopBrowserFamiliesParamsIPVersion = "IPv4"
+ HTTPTopBrowserFamiliesParamsIPVersionIPv6 HTTPTopBrowserFamiliesParamsIPVersion = "IPv6"
+)
+
+type HTTPTopBrowserFamiliesParamsOS string
+
+const (
+ HTTPTopBrowserFamiliesParamsOSWindows HTTPTopBrowserFamiliesParamsOS = "WINDOWS"
+ HTTPTopBrowserFamiliesParamsOSMacosx HTTPTopBrowserFamiliesParamsOS = "MACOSX"
+ HTTPTopBrowserFamiliesParamsOSIos HTTPTopBrowserFamiliesParamsOS = "IOS"
+ HTTPTopBrowserFamiliesParamsOSAndroid HTTPTopBrowserFamiliesParamsOS = "ANDROID"
+ HTTPTopBrowserFamiliesParamsOSChromeos HTTPTopBrowserFamiliesParamsOS = "CHROMEOS"
+ HTTPTopBrowserFamiliesParamsOSLinux HTTPTopBrowserFamiliesParamsOS = "LINUX"
+ HTTPTopBrowserFamiliesParamsOSSmartTv HTTPTopBrowserFamiliesParamsOS = "SMART_TV"
+)
+
+type HTTPTopBrowserFamiliesParamsTLSVersion string
+
+const (
+ HTTPTopBrowserFamiliesParamsTLSVersionTlSv1_0 HTTPTopBrowserFamiliesParamsTLSVersion = "TLSv1_0"
+ HTTPTopBrowserFamiliesParamsTLSVersionTlSv1_1 HTTPTopBrowserFamiliesParamsTLSVersion = "TLSv1_1"
+ HTTPTopBrowserFamiliesParamsTLSVersionTlSv1_2 HTTPTopBrowserFamiliesParamsTLSVersion = "TLSv1_2"
+ HTTPTopBrowserFamiliesParamsTLSVersionTlSv1_3 HTTPTopBrowserFamiliesParamsTLSVersion = "TLSv1_3"
+ HTTPTopBrowserFamiliesParamsTLSVersionTlSvQuic HTTPTopBrowserFamiliesParamsTLSVersion = "TLSvQUIC"
+)
+
+type HTTPTopBrowserFamiliesResponseEnvelope struct {
+ Result HTTPTopBrowserFamiliesResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON httpTopBrowserFamiliesResponseEnvelopeJSON `json:"-"`
+}
+
+// httpTopBrowserFamiliesResponseEnvelopeJSON contains the JSON metadata for the
+// struct [HTTPTopBrowserFamiliesResponseEnvelope]
+type httpTopBrowserFamiliesResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPTopBrowserFamiliesResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpTopBrowserFamiliesResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type HTTPTopBrowsersParams 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"`
+ // Filter for bot class. Refer to
+ // [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/).
+ BotClass param.Field[[]HTTPTopBrowsersParamsBotClass] `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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]HTTPTopBrowsersParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Filter for device type.
+ DeviceType param.Field[[]HTTPTopBrowsersParamsDeviceType] `query:"deviceType"`
+ // Format results are returned in.
+ Format param.Field[HTTPTopBrowsersParamsFormat] `query:"format"`
+ // Filter for http protocol.
+ HTTPProtocol param.Field[[]HTTPTopBrowsersParamsHTTPProtocol] `query:"httpProtocol"`
+ // Filter for http version.
+ HTTPVersion param.Field[[]HTTPTopBrowsersParamsHTTPVersion] `query:"httpVersion"`
+ // Filter for ip version.
+ IPVersion param.Field[[]HTTPTopBrowsersParamsIPVersion] `query:"ipVersion"`
+ // 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 os name.
+ OS param.Field[[]HTTPTopBrowsersParamsOS] `query:"os"`
+ // Filter for tls version.
+ TLSVersion param.Field[[]HTTPTopBrowsersParamsTLSVersion] `query:"tlsVersion"`
+}
+
+// URLQuery serializes [HTTPTopBrowsersParams]'s query parameters as `url.Values`.
+func (r HTTPTopBrowsersParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type HTTPTopBrowsersParamsBotClass string
+
+const (
+ HTTPTopBrowsersParamsBotClassLikelyAutomated HTTPTopBrowsersParamsBotClass = "LIKELY_AUTOMATED"
+ HTTPTopBrowsersParamsBotClassLikelyHuman HTTPTopBrowsersParamsBotClass = "LIKELY_HUMAN"
+)
+
+type HTTPTopBrowsersParamsDateRange string
+
+const (
+ HTTPTopBrowsersParamsDateRange1d HTTPTopBrowsersParamsDateRange = "1d"
+ HTTPTopBrowsersParamsDateRange2d HTTPTopBrowsersParamsDateRange = "2d"
+ HTTPTopBrowsersParamsDateRange7d HTTPTopBrowsersParamsDateRange = "7d"
+ HTTPTopBrowsersParamsDateRange14d HTTPTopBrowsersParamsDateRange = "14d"
+ HTTPTopBrowsersParamsDateRange28d HTTPTopBrowsersParamsDateRange = "28d"
+ HTTPTopBrowsersParamsDateRange12w HTTPTopBrowsersParamsDateRange = "12w"
+ HTTPTopBrowsersParamsDateRange24w HTTPTopBrowsersParamsDateRange = "24w"
+ HTTPTopBrowsersParamsDateRange52w HTTPTopBrowsersParamsDateRange = "52w"
+ HTTPTopBrowsersParamsDateRange1dControl HTTPTopBrowsersParamsDateRange = "1dControl"
+ HTTPTopBrowsersParamsDateRange2dControl HTTPTopBrowsersParamsDateRange = "2dControl"
+ HTTPTopBrowsersParamsDateRange7dControl HTTPTopBrowsersParamsDateRange = "7dControl"
+ HTTPTopBrowsersParamsDateRange14dControl HTTPTopBrowsersParamsDateRange = "14dControl"
+ HTTPTopBrowsersParamsDateRange28dControl HTTPTopBrowsersParamsDateRange = "28dControl"
+ HTTPTopBrowsersParamsDateRange12wControl HTTPTopBrowsersParamsDateRange = "12wControl"
+ HTTPTopBrowsersParamsDateRange24wControl HTTPTopBrowsersParamsDateRange = "24wControl"
+)
+
+type HTTPTopBrowsersParamsDeviceType string
+
+const (
+ HTTPTopBrowsersParamsDeviceTypeDesktop HTTPTopBrowsersParamsDeviceType = "DESKTOP"
+ HTTPTopBrowsersParamsDeviceTypeMobile HTTPTopBrowsersParamsDeviceType = "MOBILE"
+ HTTPTopBrowsersParamsDeviceTypeOther HTTPTopBrowsersParamsDeviceType = "OTHER"
+)
+
+// Format results are returned in.
+type HTTPTopBrowsersParamsFormat string
+
+const (
+ HTTPTopBrowsersParamsFormatJson HTTPTopBrowsersParamsFormat = "JSON"
+ HTTPTopBrowsersParamsFormatCsv HTTPTopBrowsersParamsFormat = "CSV"
+)
+
+type HTTPTopBrowsersParamsHTTPProtocol string
+
+const (
+ HTTPTopBrowsersParamsHTTPProtocolHTTP HTTPTopBrowsersParamsHTTPProtocol = "HTTP"
+ HTTPTopBrowsersParamsHTTPProtocolHTTPS HTTPTopBrowsersParamsHTTPProtocol = "HTTPS"
+)
+
+type HTTPTopBrowsersParamsHTTPVersion string
+
+const (
+ HTTPTopBrowsersParamsHTTPVersionHttPv1 HTTPTopBrowsersParamsHTTPVersion = "HTTPv1"
+ HTTPTopBrowsersParamsHTTPVersionHttPv2 HTTPTopBrowsersParamsHTTPVersion = "HTTPv2"
+ HTTPTopBrowsersParamsHTTPVersionHttPv3 HTTPTopBrowsersParamsHTTPVersion = "HTTPv3"
+)
+
+type HTTPTopBrowsersParamsIPVersion string
+
+const (
+ HTTPTopBrowsersParamsIPVersionIPv4 HTTPTopBrowsersParamsIPVersion = "IPv4"
+ HTTPTopBrowsersParamsIPVersionIPv6 HTTPTopBrowsersParamsIPVersion = "IPv6"
+)
+
+type HTTPTopBrowsersParamsOS string
+
+const (
+ HTTPTopBrowsersParamsOSWindows HTTPTopBrowsersParamsOS = "WINDOWS"
+ HTTPTopBrowsersParamsOSMacosx HTTPTopBrowsersParamsOS = "MACOSX"
+ HTTPTopBrowsersParamsOSIos HTTPTopBrowsersParamsOS = "IOS"
+ HTTPTopBrowsersParamsOSAndroid HTTPTopBrowsersParamsOS = "ANDROID"
+ HTTPTopBrowsersParamsOSChromeos HTTPTopBrowsersParamsOS = "CHROMEOS"
+ HTTPTopBrowsersParamsOSLinux HTTPTopBrowsersParamsOS = "LINUX"
+ HTTPTopBrowsersParamsOSSmartTv HTTPTopBrowsersParamsOS = "SMART_TV"
+)
+
+type HTTPTopBrowsersParamsTLSVersion string
+
+const (
+ HTTPTopBrowsersParamsTLSVersionTlSv1_0 HTTPTopBrowsersParamsTLSVersion = "TLSv1_0"
+ HTTPTopBrowsersParamsTLSVersionTlSv1_1 HTTPTopBrowsersParamsTLSVersion = "TLSv1_1"
+ HTTPTopBrowsersParamsTLSVersionTlSv1_2 HTTPTopBrowsersParamsTLSVersion = "TLSv1_2"
+ HTTPTopBrowsersParamsTLSVersionTlSv1_3 HTTPTopBrowsersParamsTLSVersion = "TLSv1_3"
+ HTTPTopBrowsersParamsTLSVersionTlSvQuic HTTPTopBrowsersParamsTLSVersion = "TLSvQUIC"
+)
+
+type HTTPTopBrowsersResponseEnvelope struct {
+ Result HTTPTopBrowsersResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON httpTopBrowsersResponseEnvelopeJSON `json:"-"`
+}
+
+// httpTopBrowsersResponseEnvelopeJSON contains the JSON metadata for the struct
+// [HTTPTopBrowsersResponseEnvelope]
+type httpTopBrowsersResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *HTTPTopBrowsersResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r httpTopBrowsersResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/radar/httptop_test.go b/radar/httptop_test.go
new file mode 100644
index 00000000000..9f7d1d150d7
--- /dev/null
+++ b/radar/httptop_test.go
@@ -0,0 +1,98 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/radar"
+)
+
+func TestHTTPTopBrowserFamiliesWithOptionalParams(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"),
+ )
+ _, err := client.Radar.HTTP.Top.BrowserFamilies(context.TODO(), radar.HTTPTopBrowserFamiliesParams{
+ ASN: cloudflare.F([]string{"string", "string", "string"}),
+ BotClass: cloudflare.F([]radar.HTTPTopBrowserFamiliesParamsBotClass{radar.HTTPTopBrowserFamiliesParamsBotClassLikelyAutomated, radar.HTTPTopBrowserFamiliesParamsBotClassLikelyHuman}),
+ Continent: cloudflare.F([]string{"string", "string", "string"}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.HTTPTopBrowserFamiliesParamsDateRange{radar.HTTPTopBrowserFamiliesParamsDateRange1d, radar.HTTPTopBrowserFamiliesParamsDateRange2d, radar.HTTPTopBrowserFamiliesParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DeviceType: cloudflare.F([]radar.HTTPTopBrowserFamiliesParamsDeviceType{radar.HTTPTopBrowserFamiliesParamsDeviceTypeDesktop, radar.HTTPTopBrowserFamiliesParamsDeviceTypeMobile, radar.HTTPTopBrowserFamiliesParamsDeviceTypeOther}),
+ Format: cloudflare.F(radar.HTTPTopBrowserFamiliesParamsFormatJson),
+ HTTPProtocol: cloudflare.F([]radar.HTTPTopBrowserFamiliesParamsHTTPProtocol{radar.HTTPTopBrowserFamiliesParamsHTTPProtocolHTTP, radar.HTTPTopBrowserFamiliesParamsHTTPProtocolHTTPS}),
+ HTTPVersion: cloudflare.F([]radar.HTTPTopBrowserFamiliesParamsHTTPVersion{radar.HTTPTopBrowserFamiliesParamsHTTPVersionHttPv1, radar.HTTPTopBrowserFamiliesParamsHTTPVersionHttPv2, radar.HTTPTopBrowserFamiliesParamsHTTPVersionHttPv3}),
+ IPVersion: cloudflare.F([]radar.HTTPTopBrowserFamiliesParamsIPVersion{radar.HTTPTopBrowserFamiliesParamsIPVersionIPv4, radar.HTTPTopBrowserFamiliesParamsIPVersionIPv6}),
+ Limit: cloudflare.F(int64(5)),
+ Location: cloudflare.F([]string{"string", "string", "string"}),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ OS: cloudflare.F([]radar.HTTPTopBrowserFamiliesParamsOS{radar.HTTPTopBrowserFamiliesParamsOSWindows, radar.HTTPTopBrowserFamiliesParamsOSMacosx, radar.HTTPTopBrowserFamiliesParamsOSIos}),
+ TLSVersion: cloudflare.F([]radar.HTTPTopBrowserFamiliesParamsTLSVersion{radar.HTTPTopBrowserFamiliesParamsTLSVersionTlSv1_0, radar.HTTPTopBrowserFamiliesParamsTLSVersionTlSv1_1, radar.HTTPTopBrowserFamiliesParamsTLSVersionTlSv1_2}),
+ })
+ 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())
+ }
+}
+
+func TestHTTPTopBrowsersWithOptionalParams(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"),
+ )
+ _, err := client.Radar.HTTP.Top.Browsers(context.TODO(), radar.HTTPTopBrowsersParams{
+ ASN: cloudflare.F([]string{"string", "string", "string"}),
+ BotClass: cloudflare.F([]radar.HTTPTopBrowsersParamsBotClass{radar.HTTPTopBrowsersParamsBotClassLikelyAutomated, radar.HTTPTopBrowsersParamsBotClassLikelyHuman}),
+ Continent: cloudflare.F([]string{"string", "string", "string"}),
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.HTTPTopBrowsersParamsDateRange{radar.HTTPTopBrowsersParamsDateRange1d, radar.HTTPTopBrowsersParamsDateRange2d, radar.HTTPTopBrowsersParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DeviceType: cloudflare.F([]radar.HTTPTopBrowsersParamsDeviceType{radar.HTTPTopBrowsersParamsDeviceTypeDesktop, radar.HTTPTopBrowsersParamsDeviceTypeMobile, radar.HTTPTopBrowsersParamsDeviceTypeOther}),
+ Format: cloudflare.F(radar.HTTPTopBrowsersParamsFormatJson),
+ HTTPProtocol: cloudflare.F([]radar.HTTPTopBrowsersParamsHTTPProtocol{radar.HTTPTopBrowsersParamsHTTPProtocolHTTP, radar.HTTPTopBrowsersParamsHTTPProtocolHTTPS}),
+ HTTPVersion: cloudflare.F([]radar.HTTPTopBrowsersParamsHTTPVersion{radar.HTTPTopBrowsersParamsHTTPVersionHttPv1, radar.HTTPTopBrowsersParamsHTTPVersionHttPv2, radar.HTTPTopBrowsersParamsHTTPVersionHttPv3}),
+ IPVersion: cloudflare.F([]radar.HTTPTopBrowsersParamsIPVersion{radar.HTTPTopBrowsersParamsIPVersionIPv4, radar.HTTPTopBrowsersParamsIPVersionIPv6}),
+ Limit: cloudflare.F(int64(5)),
+ Location: cloudflare.F([]string{"string", "string", "string"}),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ OS: cloudflare.F([]radar.HTTPTopBrowsersParamsOS{radar.HTTPTopBrowsersParamsOSWindows, radar.HTTPTopBrowsersParamsOSMacosx, radar.HTTPTopBrowsersParamsOSIos}),
+ TLSVersion: cloudflare.F([]radar.HTTPTopBrowsersParamsTLSVersion{radar.HTTPTopBrowsersParamsTLSVersionTlSv1_0, radar.HTTPTopBrowsersParamsTLSVersionTlSv1_1, radar.HTTPTopBrowsersParamsTLSVersionTlSv1_2}),
+ })
+ 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/radar/netflow.go b/radar/netflow.go
new file mode 100644
index 00000000000..eb30ccb3871
--- /dev/null
+++ b/radar/netflow.go
@@ -0,0 +1,327 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "context"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// NetflowService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewNetflowService] method instead.
+type NetflowService struct {
+ Options []option.RequestOption
+ Top *NetflowTopService
+}
+
+// NewNetflowService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewNetflowService(opts ...option.RequestOption) (r *NetflowService) {
+ r = &NetflowService{}
+ r.Options = opts
+ r.Top = NewNetflowTopService(opts...)
+ return
+}
+
+// Get network traffic change over time. Visit
+// https://en.wikipedia.org/wiki/NetFlow for more information on NetFlows.
+func (r *NetflowService) Timeseries(ctx context.Context, query NetflowTimeseriesParams, opts ...option.RequestOption) (res *NetflowTimeseriesResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env NetflowTimeseriesResponseEnvelope
+ path := "radar/netflows/timeseries"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type NetflowTimeseriesResponse struct {
+ Meta NetflowTimeseriesResponseMeta `json:"meta,required"`
+ Serie0 NetflowTimeseriesResponseSerie0 `json:"serie_0,required"`
+ JSON netflowTimeseriesResponseJSON `json:"-"`
+}
+
+// netflowTimeseriesResponseJSON contains the JSON metadata for the struct
+// [NetflowTimeseriesResponse]
+type netflowTimeseriesResponseJSON struct {
+ Meta apijson.Field
+ Serie0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *NetflowTimeseriesResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r netflowTimeseriesResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type NetflowTimeseriesResponseMeta struct {
+ AggInterval string `json:"aggInterval,required"`
+ DateRange []NetflowTimeseriesResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated time.Time `json:"lastUpdated,required" format:"date-time"`
+ ConfidenceInfo NetflowTimeseriesResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON netflowTimeseriesResponseMetaJSON `json:"-"`
+}
+
+// netflowTimeseriesResponseMetaJSON contains the JSON metadata for the struct
+// [NetflowTimeseriesResponseMeta]
+type netflowTimeseriesResponseMetaJSON struct {
+ AggInterval apijson.Field
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *NetflowTimeseriesResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r netflowTimeseriesResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type NetflowTimeseriesResponseMetaDateRange 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 netflowTimeseriesResponseMetaDateRangeJSON `json:"-"`
+}
+
+// netflowTimeseriesResponseMetaDateRangeJSON contains the JSON metadata for the
+// struct [NetflowTimeseriesResponseMetaDateRange]
+type netflowTimeseriesResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *NetflowTimeseriesResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r netflowTimeseriesResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type NetflowTimeseriesResponseMetaConfidenceInfo struct {
+ Annotations []NetflowTimeseriesResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON netflowTimeseriesResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// netflowTimeseriesResponseMetaConfidenceInfoJSON contains the JSON metadata for
+// the struct [NetflowTimeseriesResponseMetaConfidenceInfo]
+type netflowTimeseriesResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *NetflowTimeseriesResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r netflowTimeseriesResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type NetflowTimeseriesResponseMetaConfidenceInfoAnnotation 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 netflowTimeseriesResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// netflowTimeseriesResponseMetaConfidenceInfoAnnotationJSON contains the JSON
+// metadata for the struct [NetflowTimeseriesResponseMetaConfidenceInfoAnnotation]
+type netflowTimeseriesResponseMetaConfidenceInfoAnnotationJSON 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 *NetflowTimeseriesResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r netflowTimeseriesResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type NetflowTimeseriesResponseSerie0 struct {
+ Timestamps []time.Time `json:"timestamps,required" format:"date-time"`
+ Values []string `json:"values,required"`
+ JSON netflowTimeseriesResponseSerie0JSON `json:"-"`
+}
+
+// netflowTimeseriesResponseSerie0JSON contains the JSON metadata for the struct
+// [NetflowTimeseriesResponseSerie0]
+type netflowTimeseriesResponseSerie0JSON struct {
+ Timestamps apijson.Field
+ Values apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *NetflowTimeseriesResponseSerie0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r netflowTimeseriesResponseSerie0JSON) RawJSON() string {
+ return r.raw
+}
+
+type NetflowTimeseriesParams struct {
+ // Aggregation interval results should be returned in (for example, in 15 minutes
+ // or 1 hour intervals). Refer to
+ // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+ AggInterval param.Field[NetflowTimeseriesParamsAggInterval] `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"`
+ // 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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]NetflowTimeseriesParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Format results are returned in.
+ Format param.Field[NetflowTimeseriesParamsFormat] `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"`
+ // Normalization method applied. Refer to
+ // [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/).
+ Normalization param.Field[NetflowTimeseriesParamsNormalization] `query:"normalization"`
+ // Array of network traffic product types.
+ Product param.Field[[]NetflowTimeseriesParamsProduct] `query:"product"`
+}
+
+// URLQuery serializes [NetflowTimeseriesParams]'s query parameters as
+// `url.Values`.
+func (r NetflowTimeseriesParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Aggregation interval results should be returned in (for example, in 15 minutes
+// or 1 hour intervals). Refer to
+// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+type NetflowTimeseriesParamsAggInterval string
+
+const (
+ NetflowTimeseriesParamsAggInterval15m NetflowTimeseriesParamsAggInterval = "15m"
+ NetflowTimeseriesParamsAggInterval1h NetflowTimeseriesParamsAggInterval = "1h"
+ NetflowTimeseriesParamsAggInterval1d NetflowTimeseriesParamsAggInterval = "1d"
+ NetflowTimeseriesParamsAggInterval1w NetflowTimeseriesParamsAggInterval = "1w"
+)
+
+type NetflowTimeseriesParamsDateRange string
+
+const (
+ NetflowTimeseriesParamsDateRange1d NetflowTimeseriesParamsDateRange = "1d"
+ NetflowTimeseriesParamsDateRange2d NetflowTimeseriesParamsDateRange = "2d"
+ NetflowTimeseriesParamsDateRange7d NetflowTimeseriesParamsDateRange = "7d"
+ NetflowTimeseriesParamsDateRange14d NetflowTimeseriesParamsDateRange = "14d"
+ NetflowTimeseriesParamsDateRange28d NetflowTimeseriesParamsDateRange = "28d"
+ NetflowTimeseriesParamsDateRange12w NetflowTimeseriesParamsDateRange = "12w"
+ NetflowTimeseriesParamsDateRange24w NetflowTimeseriesParamsDateRange = "24w"
+ NetflowTimeseriesParamsDateRange52w NetflowTimeseriesParamsDateRange = "52w"
+ NetflowTimeseriesParamsDateRange1dControl NetflowTimeseriesParamsDateRange = "1dControl"
+ NetflowTimeseriesParamsDateRange2dControl NetflowTimeseriesParamsDateRange = "2dControl"
+ NetflowTimeseriesParamsDateRange7dControl NetflowTimeseriesParamsDateRange = "7dControl"
+ NetflowTimeseriesParamsDateRange14dControl NetflowTimeseriesParamsDateRange = "14dControl"
+ NetflowTimeseriesParamsDateRange28dControl NetflowTimeseriesParamsDateRange = "28dControl"
+ NetflowTimeseriesParamsDateRange12wControl NetflowTimeseriesParamsDateRange = "12wControl"
+ NetflowTimeseriesParamsDateRange24wControl NetflowTimeseriesParamsDateRange = "24wControl"
+)
+
+// Format results are returned in.
+type NetflowTimeseriesParamsFormat string
+
+const (
+ NetflowTimeseriesParamsFormatJson NetflowTimeseriesParamsFormat = "JSON"
+ NetflowTimeseriesParamsFormatCsv NetflowTimeseriesParamsFormat = "CSV"
+)
+
+// Normalization method applied. Refer to
+// [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/).
+type NetflowTimeseriesParamsNormalization string
+
+const (
+ NetflowTimeseriesParamsNormalizationPercentageChange NetflowTimeseriesParamsNormalization = "PERCENTAGE_CHANGE"
+ NetflowTimeseriesParamsNormalizationMin0Max NetflowTimeseriesParamsNormalization = "MIN0_MAX"
+)
+
+type NetflowTimeseriesParamsProduct string
+
+const (
+ NetflowTimeseriesParamsProductHTTP NetflowTimeseriesParamsProduct = "HTTP"
+ NetflowTimeseriesParamsProductAll NetflowTimeseriesParamsProduct = "ALL"
+)
+
+type NetflowTimeseriesResponseEnvelope struct {
+ Result NetflowTimeseriesResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON netflowTimeseriesResponseEnvelopeJSON `json:"-"`
+}
+
+// netflowTimeseriesResponseEnvelopeJSON contains the JSON metadata for the struct
+// [NetflowTimeseriesResponseEnvelope]
+type netflowTimeseriesResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *NetflowTimeseriesResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r netflowTimeseriesResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/radar/netflow_test.go b/radar/netflow_test.go
new file mode 100644
index 00000000000..01a990bd25c
--- /dev/null
+++ b/radar/netflow_test.go
@@ -0,0 +1,52 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/radar"
+)
+
+func TestNetflowTimeseriesWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Netflows.Timeseries(context.TODO(), radar.NetflowTimeseriesParams{
+ AggInterval: cloudflare.F(radar.NetflowTimeseriesParamsAggInterval1h),
+ 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([]radar.NetflowTimeseriesParamsDateRange{radar.NetflowTimeseriesParamsDateRange1d, radar.NetflowTimeseriesParamsDateRange2d, radar.NetflowTimeseriesParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Format: cloudflare.F(radar.NetflowTimeseriesParamsFormatJson),
+ Location: cloudflare.F([]string{"string", "string", "string"}),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ Normalization: cloudflare.F(radar.NetflowTimeseriesParamsNormalizationMin0Max),
+ Product: cloudflare.F([]radar.NetflowTimeseriesParamsProduct{radar.NetflowTimeseriesParamsProductHTTP, radar.NetflowTimeseriesParamsProductAll}),
+ })
+ 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/radar/netflowtop.go b/radar/netflowtop.go
new file mode 100644
index 00000000000..c8b9ce538c6
--- /dev/null
+++ b/radar/netflowtop.go
@@ -0,0 +1,330 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "context"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// NetflowTopService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewNetflowTopService] method instead.
+type NetflowTopService struct {
+ Options []option.RequestOption
+}
+
+// NewNetflowTopService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewNetflowTopService(opts ...option.RequestOption) (r *NetflowTopService) {
+ r = &NetflowTopService{}
+ r.Options = opts
+ return
+}
+
+// Get the top autonomous systems (AS) by network traffic (NetFlows) over a given
+// time period. Visit https://en.wikipedia.org/wiki/NetFlow for more information.
+func (r *NetflowTopService) Ases(ctx context.Context, query NetflowTopAsesParams, opts ...option.RequestOption) (res *NetflowTopAsesResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env NetflowTopAsesResponseEnvelope
+ path := "radar/netflows/top/ases"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Get the top locations by network traffic (NetFlows) over a given time period.
+// Visit https://en.wikipedia.org/wiki/NetFlow for more information.
+func (r *NetflowTopService) Locations(ctx context.Context, query NetflowTopLocationsParams, opts ...option.RequestOption) (res *NetflowTopLocationsResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env NetflowTopLocationsResponseEnvelope
+ path := "radar/netflows/top/locations"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type NetflowTopAsesResponse struct {
+ Top0 []NetflowTopAsesResponseTop0 `json:"top_0,required"`
+ JSON netflowTopAsesResponseJSON `json:"-"`
+}
+
+// netflowTopAsesResponseJSON contains the JSON metadata for the struct
+// [NetflowTopAsesResponse]
+type netflowTopAsesResponseJSON struct {
+ Top0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *NetflowTopAsesResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r netflowTopAsesResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type NetflowTopAsesResponseTop0 struct {
+ ClientASN float64 `json:"clientASN,required"`
+ ClientAsName string `json:"clientASName,required"`
+ Value string `json:"value,required"`
+ JSON netflowTopAsesResponseTop0JSON `json:"-"`
+}
+
+// netflowTopAsesResponseTop0JSON contains the JSON metadata for the struct
+// [NetflowTopAsesResponseTop0]
+type netflowTopAsesResponseTop0JSON struct {
+ ClientASN apijson.Field
+ ClientAsName apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *NetflowTopAsesResponseTop0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r netflowTopAsesResponseTop0JSON) RawJSON() string {
+ return r.raw
+}
+
+type NetflowTopLocationsResponse struct {
+ Top0 []NetflowTopLocationsResponseTop0 `json:"top_0,required"`
+ JSON netflowTopLocationsResponseJSON `json:"-"`
+}
+
+// netflowTopLocationsResponseJSON contains the JSON metadata for the struct
+// [NetflowTopLocationsResponse]
+type netflowTopLocationsResponseJSON struct {
+ Top0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *NetflowTopLocationsResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r netflowTopLocationsResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type NetflowTopLocationsResponseTop0 struct {
+ ClientCountryAlpha2 string `json:"clientCountryAlpha2,required"`
+ ClientCountryName string `json:"clientCountryName,required"`
+ Value string `json:"value,required"`
+ JSON netflowTopLocationsResponseTop0JSON `json:"-"`
+}
+
+// netflowTopLocationsResponseTop0JSON contains the JSON metadata for the struct
+// [NetflowTopLocationsResponseTop0]
+type netflowTopLocationsResponseTop0JSON struct {
+ ClientCountryAlpha2 apijson.Field
+ ClientCountryName apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *NetflowTopLocationsResponseTop0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r netflowTopLocationsResponseTop0JSON) RawJSON() string {
+ return r.raw
+}
+
+type NetflowTopAsesParams 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"`
+ // 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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]NetflowTopAsesParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Format results are returned in.
+ Format param.Field[NetflowTopAsesParamsFormat] `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 [NetflowTopAsesParams]'s query parameters as `url.Values`.
+func (r NetflowTopAsesParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type NetflowTopAsesParamsDateRange string
+
+const (
+ NetflowTopAsesParamsDateRange1d NetflowTopAsesParamsDateRange = "1d"
+ NetflowTopAsesParamsDateRange2d NetflowTopAsesParamsDateRange = "2d"
+ NetflowTopAsesParamsDateRange7d NetflowTopAsesParamsDateRange = "7d"
+ NetflowTopAsesParamsDateRange14d NetflowTopAsesParamsDateRange = "14d"
+ NetflowTopAsesParamsDateRange28d NetflowTopAsesParamsDateRange = "28d"
+ NetflowTopAsesParamsDateRange12w NetflowTopAsesParamsDateRange = "12w"
+ NetflowTopAsesParamsDateRange24w NetflowTopAsesParamsDateRange = "24w"
+ NetflowTopAsesParamsDateRange52w NetflowTopAsesParamsDateRange = "52w"
+ NetflowTopAsesParamsDateRange1dControl NetflowTopAsesParamsDateRange = "1dControl"
+ NetflowTopAsesParamsDateRange2dControl NetflowTopAsesParamsDateRange = "2dControl"
+ NetflowTopAsesParamsDateRange7dControl NetflowTopAsesParamsDateRange = "7dControl"
+ NetflowTopAsesParamsDateRange14dControl NetflowTopAsesParamsDateRange = "14dControl"
+ NetflowTopAsesParamsDateRange28dControl NetflowTopAsesParamsDateRange = "28dControl"
+ NetflowTopAsesParamsDateRange12wControl NetflowTopAsesParamsDateRange = "12wControl"
+ NetflowTopAsesParamsDateRange24wControl NetflowTopAsesParamsDateRange = "24wControl"
+)
+
+// Format results are returned in.
+type NetflowTopAsesParamsFormat string
+
+const (
+ NetflowTopAsesParamsFormatJson NetflowTopAsesParamsFormat = "JSON"
+ NetflowTopAsesParamsFormatCsv NetflowTopAsesParamsFormat = "CSV"
+)
+
+type NetflowTopAsesResponseEnvelope struct {
+ Result NetflowTopAsesResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON netflowTopAsesResponseEnvelopeJSON `json:"-"`
+}
+
+// netflowTopAsesResponseEnvelopeJSON contains the JSON metadata for the struct
+// [NetflowTopAsesResponseEnvelope]
+type netflowTopAsesResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *NetflowTopAsesResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r netflowTopAsesResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type NetflowTopLocationsParams 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"`
+ // 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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]NetflowTopLocationsParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Format results are returned in.
+ Format param.Field[NetflowTopLocationsParamsFormat] `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 [NetflowTopLocationsParams]'s query parameters as
+// `url.Values`.
+func (r NetflowTopLocationsParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type NetflowTopLocationsParamsDateRange string
+
+const (
+ NetflowTopLocationsParamsDateRange1d NetflowTopLocationsParamsDateRange = "1d"
+ NetflowTopLocationsParamsDateRange2d NetflowTopLocationsParamsDateRange = "2d"
+ NetflowTopLocationsParamsDateRange7d NetflowTopLocationsParamsDateRange = "7d"
+ NetflowTopLocationsParamsDateRange14d NetflowTopLocationsParamsDateRange = "14d"
+ NetflowTopLocationsParamsDateRange28d NetflowTopLocationsParamsDateRange = "28d"
+ NetflowTopLocationsParamsDateRange12w NetflowTopLocationsParamsDateRange = "12w"
+ NetflowTopLocationsParamsDateRange24w NetflowTopLocationsParamsDateRange = "24w"
+ NetflowTopLocationsParamsDateRange52w NetflowTopLocationsParamsDateRange = "52w"
+ NetflowTopLocationsParamsDateRange1dControl NetflowTopLocationsParamsDateRange = "1dControl"
+ NetflowTopLocationsParamsDateRange2dControl NetflowTopLocationsParamsDateRange = "2dControl"
+ NetflowTopLocationsParamsDateRange7dControl NetflowTopLocationsParamsDateRange = "7dControl"
+ NetflowTopLocationsParamsDateRange14dControl NetflowTopLocationsParamsDateRange = "14dControl"
+ NetflowTopLocationsParamsDateRange28dControl NetflowTopLocationsParamsDateRange = "28dControl"
+ NetflowTopLocationsParamsDateRange12wControl NetflowTopLocationsParamsDateRange = "12wControl"
+ NetflowTopLocationsParamsDateRange24wControl NetflowTopLocationsParamsDateRange = "24wControl"
+)
+
+// Format results are returned in.
+type NetflowTopLocationsParamsFormat string
+
+const (
+ NetflowTopLocationsParamsFormatJson NetflowTopLocationsParamsFormat = "JSON"
+ NetflowTopLocationsParamsFormatCsv NetflowTopLocationsParamsFormat = "CSV"
+)
+
+type NetflowTopLocationsResponseEnvelope struct {
+ Result NetflowTopLocationsResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON netflowTopLocationsResponseEnvelopeJSON `json:"-"`
+}
+
+// netflowTopLocationsResponseEnvelopeJSON contains the JSON metadata for the
+// struct [NetflowTopLocationsResponseEnvelope]
+type netflowTopLocationsResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *NetflowTopLocationsResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r netflowTopLocationsResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/radar/netflowtop_test.go b/radar/netflowtop_test.go
new file mode 100644
index 00000000000..621039c6d21
--- /dev/null
+++ b/radar/netflowtop_test.go
@@ -0,0 +1,84 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/radar"
+)
+
+func TestNetflowTopAsesWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Netflows.Top.Ases(context.TODO(), radar.NetflowTopAsesParams{
+ 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([]radar.NetflowTopAsesParamsDateRange{radar.NetflowTopAsesParamsDateRange1d, radar.NetflowTopAsesParamsDateRange2d, radar.NetflowTopAsesParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Format: cloudflare.F(radar.NetflowTopAsesParamsFormatJson),
+ 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())
+ }
+}
+
+func TestNetflowTopLocationsWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Netflows.Top.Locations(context.TODO(), radar.NetflowTopLocationsParams{
+ 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([]radar.NetflowTopLocationsParamsDateRange{radar.NetflowTopLocationsParamsDateRange1d, radar.NetflowTopLocationsParamsDateRange2d, radar.NetflowTopLocationsParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Format: cloudflare.F(radar.NetflowTopLocationsParamsFormatJson),
+ 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/radar/quality.go b/radar/quality.go
new file mode 100644
index 00000000000..18fdb1d7fa4
--- /dev/null
+++ b/radar/quality.go
@@ -0,0 +1,28 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// QualityService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewQualityService] method instead.
+type QualityService struct {
+ Options []option.RequestOption
+ IQI *QualityIQIService
+ Speed *QualitySpeedService
+}
+
+// NewQualityService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewQualityService(opts ...option.RequestOption) (r *QualityService) {
+ r = &QualityService{}
+ r.Options = opts
+ r.IQI = NewQualityIQIService(opts...)
+ r.Speed = NewQualitySpeedService(opts...)
+ return
+}
diff --git a/radar/qualityiqi.go b/radar/qualityiqi.go
new file mode 100644
index 00000000000..a4e5518bf65
--- /dev/null
+++ b/radar/qualityiqi.go
@@ -0,0 +1,481 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "context"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// QualityIQIService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewQualityIQIService] method instead.
+type QualityIQIService struct {
+ Options []option.RequestOption
+}
+
+// NewQualityIQIService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewQualityIQIService(opts ...option.RequestOption) (r *QualityIQIService) {
+ r = &QualityIQIService{}
+ r.Options = opts
+ return
+}
+
+// Get a summary (percentiles) of bandwidth, latency or DNS response time from the
+// Radar Internet Quality Index (IQI).
+func (r *QualityIQIService) Summary(ctx context.Context, query QualityIQISummaryParams, opts ...option.RequestOption) (res *QualityIQISummaryResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env QualityIQISummaryResponseEnvelope
+ path := "radar/quality/iqi/summary"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Get a time series (percentiles) of bandwidth, latency or DNS response time from
+// the Radar Internet Quality Index (IQI).
+func (r *QualityIQIService) TimeseriesGroups(ctx context.Context, query QualityIQITimeseriesGroupsParams, opts ...option.RequestOption) (res *QualityIQITimeseriesGroupsResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env QualityIQITimeseriesGroupsResponseEnvelope
+ path := "radar/quality/iqi/timeseries_groups"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type QualityIQISummaryResponse struct {
+ Meta QualityIQISummaryResponseMeta `json:"meta,required"`
+ Summary0 QualityIQISummaryResponseSummary0 `json:"summary_0,required"`
+ JSON qualityIQISummaryResponseJSON `json:"-"`
+}
+
+// qualityIQISummaryResponseJSON contains the JSON metadata for the struct
+// [QualityIQISummaryResponse]
+type qualityIQISummaryResponseJSON struct {
+ Meta apijson.Field
+ Summary0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *QualityIQISummaryResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r qualityIQISummaryResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type QualityIQISummaryResponseMeta struct {
+ DateRange []QualityIQISummaryResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ Normalization string `json:"normalization,required"`
+ ConfidenceInfo QualityIQISummaryResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON qualityIQISummaryResponseMetaJSON `json:"-"`
+}
+
+// qualityIQISummaryResponseMetaJSON contains the JSON metadata for the struct
+// [QualityIQISummaryResponseMeta]
+type qualityIQISummaryResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ Normalization apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *QualityIQISummaryResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r qualityIQISummaryResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type QualityIQISummaryResponseMetaDateRange 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 qualityIQISummaryResponseMetaDateRangeJSON `json:"-"`
+}
+
+// qualityIQISummaryResponseMetaDateRangeJSON contains the JSON metadata for the
+// struct [QualityIQISummaryResponseMetaDateRange]
+type qualityIQISummaryResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *QualityIQISummaryResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r qualityIQISummaryResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type QualityIQISummaryResponseMetaConfidenceInfo struct {
+ Annotations []QualityIQISummaryResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON qualityIQISummaryResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// qualityIQISummaryResponseMetaConfidenceInfoJSON contains the JSON metadata for
+// the struct [QualityIQISummaryResponseMetaConfidenceInfo]
+type qualityIQISummaryResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *QualityIQISummaryResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r qualityIQISummaryResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type QualityIQISummaryResponseMetaConfidenceInfoAnnotation 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 qualityIQISummaryResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// qualityIQISummaryResponseMetaConfidenceInfoAnnotationJSON contains the JSON
+// metadata for the struct [QualityIQISummaryResponseMetaConfidenceInfoAnnotation]
+type qualityIQISummaryResponseMetaConfidenceInfoAnnotationJSON 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 *QualityIQISummaryResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r qualityIQISummaryResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type QualityIQISummaryResponseSummary0 struct {
+ P25 string `json:"p25,required"`
+ P50 string `json:"p50,required"`
+ P75 string `json:"p75,required"`
+ JSON qualityIQISummaryResponseSummary0JSON `json:"-"`
+}
+
+// qualityIQISummaryResponseSummary0JSON contains the JSON metadata for the struct
+// [QualityIQISummaryResponseSummary0]
+type qualityIQISummaryResponseSummary0JSON struct {
+ P25 apijson.Field
+ P50 apijson.Field
+ P75 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *QualityIQISummaryResponseSummary0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r qualityIQISummaryResponseSummary0JSON) RawJSON() string {
+ return r.raw
+}
+
+type QualityIQITimeseriesGroupsResponse struct {
+ Meta interface{} `json:"meta,required"`
+ Serie0 QualityIQITimeseriesGroupsResponseSerie0 `json:"serie_0,required"`
+ JSON qualityIQITimeseriesGroupsResponseJSON `json:"-"`
+}
+
+// qualityIQITimeseriesGroupsResponseJSON contains the JSON metadata for the struct
+// [QualityIQITimeseriesGroupsResponse]
+type qualityIQITimeseriesGroupsResponseJSON struct {
+ Meta apijson.Field
+ Serie0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *QualityIQITimeseriesGroupsResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r qualityIQITimeseriesGroupsResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type QualityIQITimeseriesGroupsResponseSerie0 struct {
+ P25 []string `json:"p25,required"`
+ P50 []string `json:"p50,required"`
+ P75 []string `json:"p75,required"`
+ Timestamps []string `json:"timestamps,required"`
+ JSON qualityIQITimeseriesGroupsResponseSerie0JSON `json:"-"`
+}
+
+// qualityIQITimeseriesGroupsResponseSerie0JSON contains the JSON metadata for the
+// struct [QualityIQITimeseriesGroupsResponseSerie0]
+type qualityIQITimeseriesGroupsResponseSerie0JSON struct {
+ P25 apijson.Field
+ P50 apijson.Field
+ P75 apijson.Field
+ Timestamps apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *QualityIQITimeseriesGroupsResponseSerie0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r qualityIQITimeseriesGroupsResponseSerie0JSON) RawJSON() string {
+ return r.raw
+}
+
+type QualityIQISummaryParams struct {
+ // Which metric to return: bandwidth, latency or DNS response time.
+ Metric param.Field[QualityIQISummaryParamsMetric] `query:"metric,required"`
+ // 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"`
+ // 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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]QualityIQISummaryParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Format results are returned in.
+ Format param.Field[QualityIQISummaryParamsFormat] `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"`
+}
+
+// URLQuery serializes [QualityIQISummaryParams]'s query parameters as
+// `url.Values`.
+func (r QualityIQISummaryParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Which metric to return: bandwidth, latency or DNS response time.
+type QualityIQISummaryParamsMetric string
+
+const (
+ QualityIQISummaryParamsMetricBandwidth QualityIQISummaryParamsMetric = "BANDWIDTH"
+ QualityIQISummaryParamsMetricDNS QualityIQISummaryParamsMetric = "DNS"
+ QualityIQISummaryParamsMetricLatency QualityIQISummaryParamsMetric = "LATENCY"
+)
+
+type QualityIQISummaryParamsDateRange string
+
+const (
+ QualityIQISummaryParamsDateRange1d QualityIQISummaryParamsDateRange = "1d"
+ QualityIQISummaryParamsDateRange2d QualityIQISummaryParamsDateRange = "2d"
+ QualityIQISummaryParamsDateRange7d QualityIQISummaryParamsDateRange = "7d"
+ QualityIQISummaryParamsDateRange14d QualityIQISummaryParamsDateRange = "14d"
+ QualityIQISummaryParamsDateRange28d QualityIQISummaryParamsDateRange = "28d"
+ QualityIQISummaryParamsDateRange12w QualityIQISummaryParamsDateRange = "12w"
+ QualityIQISummaryParamsDateRange24w QualityIQISummaryParamsDateRange = "24w"
+ QualityIQISummaryParamsDateRange52w QualityIQISummaryParamsDateRange = "52w"
+ QualityIQISummaryParamsDateRange1dControl QualityIQISummaryParamsDateRange = "1dControl"
+ QualityIQISummaryParamsDateRange2dControl QualityIQISummaryParamsDateRange = "2dControl"
+ QualityIQISummaryParamsDateRange7dControl QualityIQISummaryParamsDateRange = "7dControl"
+ QualityIQISummaryParamsDateRange14dControl QualityIQISummaryParamsDateRange = "14dControl"
+ QualityIQISummaryParamsDateRange28dControl QualityIQISummaryParamsDateRange = "28dControl"
+ QualityIQISummaryParamsDateRange12wControl QualityIQISummaryParamsDateRange = "12wControl"
+ QualityIQISummaryParamsDateRange24wControl QualityIQISummaryParamsDateRange = "24wControl"
+)
+
+// Format results are returned in.
+type QualityIQISummaryParamsFormat string
+
+const (
+ QualityIQISummaryParamsFormatJson QualityIQISummaryParamsFormat = "JSON"
+ QualityIQISummaryParamsFormatCsv QualityIQISummaryParamsFormat = "CSV"
+)
+
+type QualityIQISummaryResponseEnvelope struct {
+ Result QualityIQISummaryResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON qualityIQISummaryResponseEnvelopeJSON `json:"-"`
+}
+
+// qualityIQISummaryResponseEnvelopeJSON contains the JSON metadata for the struct
+// [QualityIQISummaryResponseEnvelope]
+type qualityIQISummaryResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *QualityIQISummaryResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r qualityIQISummaryResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type QualityIQITimeseriesGroupsParams struct {
+ // Which metric to return: bandwidth, latency or DNS response time.
+ Metric param.Field[QualityIQITimeseriesGroupsParamsMetric] `query:"metric,required"`
+ // Aggregation interval results should be returned in (for example, in 15 minutes
+ // or 1 hour intervals). Refer to
+ // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+ AggInterval param.Field[QualityIQITimeseriesGroupsParamsAggInterval] `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"`
+ // 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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]QualityIQITimeseriesGroupsParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Format results are returned in.
+ Format param.Field[QualityIQITimeseriesGroupsParamsFormat] `query:"format"`
+ // Enable interpolation for all series (using the average).
+ Interpolation param.Field[bool] `query:"interpolation"`
+ // 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 [QualityIQITimeseriesGroupsParams]'s query parameters as
+// `url.Values`.
+func (r QualityIQITimeseriesGroupsParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Which metric to return: bandwidth, latency or DNS response time.
+type QualityIQITimeseriesGroupsParamsMetric string
+
+const (
+ QualityIQITimeseriesGroupsParamsMetricBandwidth QualityIQITimeseriesGroupsParamsMetric = "BANDWIDTH"
+ QualityIQITimeseriesGroupsParamsMetricDNS QualityIQITimeseriesGroupsParamsMetric = "DNS"
+ QualityIQITimeseriesGroupsParamsMetricLatency QualityIQITimeseriesGroupsParamsMetric = "LATENCY"
+)
+
+// Aggregation interval results should be returned in (for example, in 15 minutes
+// or 1 hour intervals). Refer to
+// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
+type QualityIQITimeseriesGroupsParamsAggInterval string
+
+const (
+ QualityIQITimeseriesGroupsParamsAggInterval15m QualityIQITimeseriesGroupsParamsAggInterval = "15m"
+ QualityIQITimeseriesGroupsParamsAggInterval1h QualityIQITimeseriesGroupsParamsAggInterval = "1h"
+ QualityIQITimeseriesGroupsParamsAggInterval1d QualityIQITimeseriesGroupsParamsAggInterval = "1d"
+ QualityIQITimeseriesGroupsParamsAggInterval1w QualityIQITimeseriesGroupsParamsAggInterval = "1w"
+)
+
+type QualityIQITimeseriesGroupsParamsDateRange string
+
+const (
+ QualityIQITimeseriesGroupsParamsDateRange1d QualityIQITimeseriesGroupsParamsDateRange = "1d"
+ QualityIQITimeseriesGroupsParamsDateRange2d QualityIQITimeseriesGroupsParamsDateRange = "2d"
+ QualityIQITimeseriesGroupsParamsDateRange7d QualityIQITimeseriesGroupsParamsDateRange = "7d"
+ QualityIQITimeseriesGroupsParamsDateRange14d QualityIQITimeseriesGroupsParamsDateRange = "14d"
+ QualityIQITimeseriesGroupsParamsDateRange28d QualityIQITimeseriesGroupsParamsDateRange = "28d"
+ QualityIQITimeseriesGroupsParamsDateRange12w QualityIQITimeseriesGroupsParamsDateRange = "12w"
+ QualityIQITimeseriesGroupsParamsDateRange24w QualityIQITimeseriesGroupsParamsDateRange = "24w"
+ QualityIQITimeseriesGroupsParamsDateRange52w QualityIQITimeseriesGroupsParamsDateRange = "52w"
+ QualityIQITimeseriesGroupsParamsDateRange1dControl QualityIQITimeseriesGroupsParamsDateRange = "1dControl"
+ QualityIQITimeseriesGroupsParamsDateRange2dControl QualityIQITimeseriesGroupsParamsDateRange = "2dControl"
+ QualityIQITimeseriesGroupsParamsDateRange7dControl QualityIQITimeseriesGroupsParamsDateRange = "7dControl"
+ QualityIQITimeseriesGroupsParamsDateRange14dControl QualityIQITimeseriesGroupsParamsDateRange = "14dControl"
+ QualityIQITimeseriesGroupsParamsDateRange28dControl QualityIQITimeseriesGroupsParamsDateRange = "28dControl"
+ QualityIQITimeseriesGroupsParamsDateRange12wControl QualityIQITimeseriesGroupsParamsDateRange = "12wControl"
+ QualityIQITimeseriesGroupsParamsDateRange24wControl QualityIQITimeseriesGroupsParamsDateRange = "24wControl"
+)
+
+// Format results are returned in.
+type QualityIQITimeseriesGroupsParamsFormat string
+
+const (
+ QualityIQITimeseriesGroupsParamsFormatJson QualityIQITimeseriesGroupsParamsFormat = "JSON"
+ QualityIQITimeseriesGroupsParamsFormatCsv QualityIQITimeseriesGroupsParamsFormat = "CSV"
+)
+
+type QualityIQITimeseriesGroupsResponseEnvelope struct {
+ Result QualityIQITimeseriesGroupsResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON qualityIQITimeseriesGroupsResponseEnvelopeJSON `json:"-"`
+}
+
+// qualityIQITimeseriesGroupsResponseEnvelopeJSON contains the JSON metadata for
+// the struct [QualityIQITimeseriesGroupsResponseEnvelope]
+type qualityIQITimeseriesGroupsResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *QualityIQITimeseriesGroupsResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r qualityIQITimeseriesGroupsResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/radar/qualityiqi_test.go b/radar/qualityiqi_test.go
new file mode 100644
index 00000000000..092e990a33e
--- /dev/null
+++ b/radar/qualityiqi_test.go
@@ -0,0 +1,86 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/radar"
+)
+
+func TestQualityIQISummaryWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Quality.IQI.Summary(context.TODO(), radar.QualityIQISummaryParams{
+ Metric: cloudflare.F(radar.QualityIQISummaryParamsMetricBandwidth),
+ 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([]radar.QualityIQISummaryParamsDateRange{radar.QualityIQISummaryParamsDateRange1d, radar.QualityIQISummaryParamsDateRange2d, radar.QualityIQISummaryParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Format: cloudflare.F(radar.QualityIQISummaryParamsFormatJson),
+ 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())
+ }
+}
+
+func TestQualityIQITimeseriesGroupsWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Quality.IQI.TimeseriesGroups(context.TODO(), radar.QualityIQITimeseriesGroupsParams{
+ Metric: cloudflare.F(radar.QualityIQITimeseriesGroupsParamsMetricBandwidth),
+ AggInterval: cloudflare.F(radar.QualityIQITimeseriesGroupsParamsAggInterval1h),
+ 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([]radar.QualityIQITimeseriesGroupsParamsDateRange{radar.QualityIQITimeseriesGroupsParamsDateRange1d, radar.QualityIQITimeseriesGroupsParamsDateRange2d, radar.QualityIQITimeseriesGroupsParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Format: cloudflare.F(radar.QualityIQITimeseriesGroupsParamsFormatJson),
+ Interpolation: cloudflare.F(true),
+ 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/radar/qualityspeed.go b/radar/qualityspeed.go
new file mode 100644
index 00000000000..41990f64973
--- /dev/null
+++ b/radar/qualityspeed.go
@@ -0,0 +1,412 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "context"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// QualitySpeedService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewQualitySpeedService] method
+// instead.
+type QualitySpeedService struct {
+ Options []option.RequestOption
+ Top *QualitySpeedTopService
+}
+
+// NewQualitySpeedService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewQualitySpeedService(opts ...option.RequestOption) (r *QualitySpeedService) {
+ r = &QualitySpeedService{}
+ r.Options = opts
+ r.Top = NewQualitySpeedTopService(opts...)
+ return
+}
+
+// Get an histogram from the previous 90 days of Cloudflare Speed Test data, split
+// into fixed bandwidth (Mbps), latency (ms) or jitter (ms) buckets.
+func (r *QualitySpeedService) Histogram(ctx context.Context, query QualitySpeedHistogramParams, opts ...option.RequestOption) (res *QualitySpeedHistogramResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env QualitySpeedHistogramResponseEnvelope
+ path := "radar/quality/speed/histogram"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Get a summary of bandwidth, latency, jitter and packet loss, from the previous
+// 90 days of Cloudflare Speed Test data.
+func (r *QualitySpeedService) Summary(ctx context.Context, query QualitySpeedSummaryParams, opts ...option.RequestOption) (res *QualitySpeedSummaryResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env QualitySpeedSummaryResponseEnvelope
+ path := "radar/quality/speed/summary"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type QualitySpeedHistogramResponse struct {
+ Histogram0 QualitySpeedHistogramResponseHistogram0 `json:"histogram_0,required"`
+ Meta interface{} `json:"meta,required"`
+ JSON qualitySpeedHistogramResponseJSON `json:"-"`
+}
+
+// qualitySpeedHistogramResponseJSON contains the JSON metadata for the struct
+// [QualitySpeedHistogramResponse]
+type qualitySpeedHistogramResponseJSON struct {
+ Histogram0 apijson.Field
+ Meta apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *QualitySpeedHistogramResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r qualitySpeedHistogramResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type QualitySpeedHistogramResponseHistogram0 struct {
+ BandwidthDownload []string `json:"bandwidthDownload,required"`
+ BandwidthUpload []string `json:"bandwidthUpload,required"`
+ BucketMin []string `json:"bucketMin,required"`
+ JSON qualitySpeedHistogramResponseHistogram0JSON `json:"-"`
+}
+
+// qualitySpeedHistogramResponseHistogram0JSON contains the JSON metadata for the
+// struct [QualitySpeedHistogramResponseHistogram0]
+type qualitySpeedHistogramResponseHistogram0JSON struct {
+ BandwidthDownload apijson.Field
+ BandwidthUpload apijson.Field
+ BucketMin apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *QualitySpeedHistogramResponseHistogram0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r qualitySpeedHistogramResponseHistogram0JSON) RawJSON() string {
+ return r.raw
+}
+
+type QualitySpeedSummaryResponse struct {
+ Meta QualitySpeedSummaryResponseMeta `json:"meta,required"`
+ Summary0 QualitySpeedSummaryResponseSummary0 `json:"summary_0,required"`
+ JSON qualitySpeedSummaryResponseJSON `json:"-"`
+}
+
+// qualitySpeedSummaryResponseJSON contains the JSON metadata for the struct
+// [QualitySpeedSummaryResponse]
+type qualitySpeedSummaryResponseJSON struct {
+ Meta apijson.Field
+ Summary0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *QualitySpeedSummaryResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r qualitySpeedSummaryResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type QualitySpeedSummaryResponseMeta struct {
+ DateRange []QualitySpeedSummaryResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ Normalization string `json:"normalization,required"`
+ ConfidenceInfo QualitySpeedSummaryResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON qualitySpeedSummaryResponseMetaJSON `json:"-"`
+}
+
+// qualitySpeedSummaryResponseMetaJSON contains the JSON metadata for the struct
+// [QualitySpeedSummaryResponseMeta]
+type qualitySpeedSummaryResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ Normalization apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *QualitySpeedSummaryResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r qualitySpeedSummaryResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type QualitySpeedSummaryResponseMetaDateRange 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 qualitySpeedSummaryResponseMetaDateRangeJSON `json:"-"`
+}
+
+// qualitySpeedSummaryResponseMetaDateRangeJSON contains the JSON metadata for the
+// struct [QualitySpeedSummaryResponseMetaDateRange]
+type qualitySpeedSummaryResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *QualitySpeedSummaryResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r qualitySpeedSummaryResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type QualitySpeedSummaryResponseMetaConfidenceInfo struct {
+ Annotations []QualitySpeedSummaryResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON qualitySpeedSummaryResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// qualitySpeedSummaryResponseMetaConfidenceInfoJSON contains the JSON metadata for
+// the struct [QualitySpeedSummaryResponseMetaConfidenceInfo]
+type qualitySpeedSummaryResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *QualitySpeedSummaryResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r qualitySpeedSummaryResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type QualitySpeedSummaryResponseMetaConfidenceInfoAnnotation 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 qualitySpeedSummaryResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// qualitySpeedSummaryResponseMetaConfidenceInfoAnnotationJSON contains the JSON
+// metadata for the struct
+// [QualitySpeedSummaryResponseMetaConfidenceInfoAnnotation]
+type qualitySpeedSummaryResponseMetaConfidenceInfoAnnotationJSON 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 *QualitySpeedSummaryResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r qualitySpeedSummaryResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type QualitySpeedSummaryResponseSummary0 struct {
+ BandwidthDownload string `json:"bandwidthDownload,required"`
+ BandwidthUpload string `json:"bandwidthUpload,required"`
+ JitterIdle string `json:"jitterIdle,required"`
+ JitterLoaded string `json:"jitterLoaded,required"`
+ LatencyIdle string `json:"latencyIdle,required"`
+ LatencyLoaded string `json:"latencyLoaded,required"`
+ PacketLoss string `json:"packetLoss,required"`
+ JSON qualitySpeedSummaryResponseSummary0JSON `json:"-"`
+}
+
+// qualitySpeedSummaryResponseSummary0JSON contains the JSON metadata for the
+// struct [QualitySpeedSummaryResponseSummary0]
+type qualitySpeedSummaryResponseSummary0JSON struct {
+ BandwidthDownload apijson.Field
+ BandwidthUpload apijson.Field
+ JitterIdle apijson.Field
+ JitterLoaded apijson.Field
+ LatencyIdle apijson.Field
+ LatencyLoaded apijson.Field
+ PacketLoss apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *QualitySpeedSummaryResponseSummary0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r qualitySpeedSummaryResponseSummary0JSON) RawJSON() string {
+ return r.raw
+}
+
+type QualitySpeedHistogramParams 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"`
+ // 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.
+ Format param.Field[QualitySpeedHistogramParamsFormat] `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"`
+ // Metrics to be returned.
+ MetricGroup param.Field[QualitySpeedHistogramParamsMetricGroup] `query:"metricGroup"`
+ // Array of names that will be used to name the series in responses.
+ Name param.Field[[]string] `query:"name"`
+}
+
+// URLQuery serializes [QualitySpeedHistogramParams]'s query parameters as
+// `url.Values`.
+func (r QualitySpeedHistogramParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Format results are returned in.
+type QualitySpeedHistogramParamsFormat string
+
+const (
+ QualitySpeedHistogramParamsFormatJson QualitySpeedHistogramParamsFormat = "JSON"
+ QualitySpeedHistogramParamsFormatCsv QualitySpeedHistogramParamsFormat = "CSV"
+)
+
+// Metrics to be returned.
+type QualitySpeedHistogramParamsMetricGroup string
+
+const (
+ QualitySpeedHistogramParamsMetricGroupBandwidth QualitySpeedHistogramParamsMetricGroup = "BANDWIDTH"
+ QualitySpeedHistogramParamsMetricGroupLatency QualitySpeedHistogramParamsMetricGroup = "LATENCY"
+ QualitySpeedHistogramParamsMetricGroupJitter QualitySpeedHistogramParamsMetricGroup = "JITTER"
+)
+
+type QualitySpeedHistogramResponseEnvelope struct {
+ Result QualitySpeedHistogramResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON qualitySpeedHistogramResponseEnvelopeJSON `json:"-"`
+}
+
+// qualitySpeedHistogramResponseEnvelopeJSON contains the JSON metadata for the
+// struct [QualitySpeedHistogramResponseEnvelope]
+type qualitySpeedHistogramResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *QualitySpeedHistogramResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r qualitySpeedHistogramResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type QualitySpeedSummaryParams 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"`
+ // 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.
+ Format param.Field[QualitySpeedSummaryParamsFormat] `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"`
+}
+
+// URLQuery serializes [QualitySpeedSummaryParams]'s query parameters as
+// `url.Values`.
+func (r QualitySpeedSummaryParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Format results are returned in.
+type QualitySpeedSummaryParamsFormat string
+
+const (
+ QualitySpeedSummaryParamsFormatJson QualitySpeedSummaryParamsFormat = "JSON"
+ QualitySpeedSummaryParamsFormatCsv QualitySpeedSummaryParamsFormat = "CSV"
+)
+
+type QualitySpeedSummaryResponseEnvelope struct {
+ Result QualitySpeedSummaryResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON qualitySpeedSummaryResponseEnvelopeJSON `json:"-"`
+}
+
+// qualitySpeedSummaryResponseEnvelopeJSON contains the JSON metadata for the
+// struct [QualitySpeedSummaryResponseEnvelope]
+type qualitySpeedSummaryResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *QualitySpeedSummaryResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r qualitySpeedSummaryResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/radar/qualityspeed_test.go b/radar/qualityspeed_test.go
new file mode 100644
index 00000000000..0b1e5aac61a
--- /dev/null
+++ b/radar/qualityspeed_test.go
@@ -0,0 +1,80 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/radar"
+)
+
+func TestQualitySpeedHistogramWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Quality.Speed.Histogram(context.TODO(), radar.QualitySpeedHistogramParams{
+ 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(radar.QualitySpeedHistogramParamsFormatJson),
+ Location: cloudflare.F([]string{"string", "string", "string"}),
+ MetricGroup: cloudflare.F(radar.QualitySpeedHistogramParamsMetricGroupBandwidth),
+ 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())
+ }
+}
+
+func TestQualitySpeedSummaryWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Quality.Speed.Summary(context.TODO(), radar.QualitySpeedSummaryParams{
+ 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(radar.QualitySpeedSummaryParamsFormatJson),
+ 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/radar/qualityspeedtop.go b/radar/qualityspeedtop.go
new file mode 100644
index 00000000000..f655fd72ee8
--- /dev/null
+++ b/radar/qualityspeedtop.go
@@ -0,0 +1,558 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "context"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// QualitySpeedTopService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewQualitySpeedTopService] method
+// instead.
+type QualitySpeedTopService struct {
+ Options []option.RequestOption
+}
+
+// NewQualitySpeedTopService generates a new service that applies the given options
+// to each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewQualitySpeedTopService(opts ...option.RequestOption) (r *QualitySpeedTopService) {
+ r = &QualitySpeedTopService{}
+ r.Options = opts
+ return
+}
+
+// Get the top autonomous systems by bandwidth, latency, jitter or packet loss,
+// from the previous 90 days of Cloudflare Speed Test data.
+func (r *QualitySpeedTopService) Ases(ctx context.Context, query QualitySpeedTopAsesParams, opts ...option.RequestOption) (res *QualitySpeedTopAsesResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env QualitySpeedTopAsesResponseEnvelope
+ path := "radar/quality/speed/top/ases"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Get the top locations by bandwidth, latency, jitter or packet loss, from the
+// previous 90 days of Cloudflare Speed Test data.
+func (r *QualitySpeedTopService) Locations(ctx context.Context, query QualitySpeedTopLocationsParams, opts ...option.RequestOption) (res *QualitySpeedTopLocationsResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env QualitySpeedTopLocationsResponseEnvelope
+ path := "radar/quality/speed/top/locations"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type QualitySpeedTopAsesResponse struct {
+ Meta QualitySpeedTopAsesResponseMeta `json:"meta,required"`
+ Top0 []QualitySpeedTopAsesResponseTop0 `json:"top_0,required"`
+ JSON qualitySpeedTopAsesResponseJSON `json:"-"`
+}
+
+// qualitySpeedTopAsesResponseJSON contains the JSON metadata for the struct
+// [QualitySpeedTopAsesResponse]
+type qualitySpeedTopAsesResponseJSON struct {
+ Meta apijson.Field
+ Top0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *QualitySpeedTopAsesResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r qualitySpeedTopAsesResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type QualitySpeedTopAsesResponseMeta struct {
+ DateRange []QualitySpeedTopAsesResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ ConfidenceInfo QualitySpeedTopAsesResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON qualitySpeedTopAsesResponseMetaJSON `json:"-"`
+}
+
+// qualitySpeedTopAsesResponseMetaJSON contains the JSON metadata for the struct
+// [QualitySpeedTopAsesResponseMeta]
+type qualitySpeedTopAsesResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *QualitySpeedTopAsesResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r qualitySpeedTopAsesResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type QualitySpeedTopAsesResponseMetaDateRange 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 qualitySpeedTopAsesResponseMetaDateRangeJSON `json:"-"`
+}
+
+// qualitySpeedTopAsesResponseMetaDateRangeJSON contains the JSON metadata for the
+// struct [QualitySpeedTopAsesResponseMetaDateRange]
+type qualitySpeedTopAsesResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *QualitySpeedTopAsesResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r qualitySpeedTopAsesResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type QualitySpeedTopAsesResponseMetaConfidenceInfo struct {
+ Annotations []QualitySpeedTopAsesResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON qualitySpeedTopAsesResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// qualitySpeedTopAsesResponseMetaConfidenceInfoJSON contains the JSON metadata for
+// the struct [QualitySpeedTopAsesResponseMetaConfidenceInfo]
+type qualitySpeedTopAsesResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *QualitySpeedTopAsesResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r qualitySpeedTopAsesResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type QualitySpeedTopAsesResponseMetaConfidenceInfoAnnotation 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 qualitySpeedTopAsesResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// qualitySpeedTopAsesResponseMetaConfidenceInfoAnnotationJSON contains the JSON
+// metadata for the struct
+// [QualitySpeedTopAsesResponseMetaConfidenceInfoAnnotation]
+type qualitySpeedTopAsesResponseMetaConfidenceInfoAnnotationJSON 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 *QualitySpeedTopAsesResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r qualitySpeedTopAsesResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type QualitySpeedTopAsesResponseTop0 struct {
+ BandwidthDownload string `json:"bandwidthDownload,required"`
+ BandwidthUpload string `json:"bandwidthUpload,required"`
+ ClientASN float64 `json:"clientASN,required"`
+ ClientAsName string `json:"clientASName,required"`
+ JitterIdle string `json:"jitterIdle,required"`
+ JitterLoaded string `json:"jitterLoaded,required"`
+ LatencyIdle string `json:"latencyIdle,required"`
+ LatencyLoaded string `json:"latencyLoaded,required"`
+ NumTests float64 `json:"numTests,required"`
+ RankPower float64 `json:"rankPower,required"`
+ JSON qualitySpeedTopAsesResponseTop0JSON `json:"-"`
+}
+
+// qualitySpeedTopAsesResponseTop0JSON contains the JSON metadata for the struct
+// [QualitySpeedTopAsesResponseTop0]
+type qualitySpeedTopAsesResponseTop0JSON struct {
+ BandwidthDownload apijson.Field
+ BandwidthUpload apijson.Field
+ ClientASN apijson.Field
+ ClientAsName apijson.Field
+ JitterIdle apijson.Field
+ JitterLoaded apijson.Field
+ LatencyIdle apijson.Field
+ LatencyLoaded apijson.Field
+ NumTests apijson.Field
+ RankPower apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *QualitySpeedTopAsesResponseTop0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r qualitySpeedTopAsesResponseTop0JSON) RawJSON() string {
+ return r.raw
+}
+
+type QualitySpeedTopLocationsResponse struct {
+ Meta QualitySpeedTopLocationsResponseMeta `json:"meta,required"`
+ Top0 []QualitySpeedTopLocationsResponseTop0 `json:"top_0,required"`
+ JSON qualitySpeedTopLocationsResponseJSON `json:"-"`
+}
+
+// qualitySpeedTopLocationsResponseJSON contains the JSON metadata for the struct
+// [QualitySpeedTopLocationsResponse]
+type qualitySpeedTopLocationsResponseJSON struct {
+ Meta apijson.Field
+ Top0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *QualitySpeedTopLocationsResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r qualitySpeedTopLocationsResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type QualitySpeedTopLocationsResponseMeta struct {
+ DateRange []QualitySpeedTopLocationsResponseMetaDateRange `json:"dateRange,required"`
+ LastUpdated string `json:"lastUpdated,required"`
+ ConfidenceInfo QualitySpeedTopLocationsResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON qualitySpeedTopLocationsResponseMetaJSON `json:"-"`
+}
+
+// qualitySpeedTopLocationsResponseMetaJSON contains the JSON metadata for the
+// struct [QualitySpeedTopLocationsResponseMeta]
+type qualitySpeedTopLocationsResponseMetaJSON struct {
+ DateRange apijson.Field
+ LastUpdated apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *QualitySpeedTopLocationsResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r qualitySpeedTopLocationsResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type QualitySpeedTopLocationsResponseMetaDateRange 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 qualitySpeedTopLocationsResponseMetaDateRangeJSON `json:"-"`
+}
+
+// qualitySpeedTopLocationsResponseMetaDateRangeJSON contains the JSON metadata for
+// the struct [QualitySpeedTopLocationsResponseMetaDateRange]
+type qualitySpeedTopLocationsResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *QualitySpeedTopLocationsResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r qualitySpeedTopLocationsResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type QualitySpeedTopLocationsResponseMetaConfidenceInfo struct {
+ Annotations []QualitySpeedTopLocationsResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON qualitySpeedTopLocationsResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// qualitySpeedTopLocationsResponseMetaConfidenceInfoJSON contains the JSON
+// metadata for the struct [QualitySpeedTopLocationsResponseMetaConfidenceInfo]
+type qualitySpeedTopLocationsResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *QualitySpeedTopLocationsResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r qualitySpeedTopLocationsResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type QualitySpeedTopLocationsResponseMetaConfidenceInfoAnnotation 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 qualitySpeedTopLocationsResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// qualitySpeedTopLocationsResponseMetaConfidenceInfoAnnotationJSON contains the
+// JSON metadata for the struct
+// [QualitySpeedTopLocationsResponseMetaConfidenceInfoAnnotation]
+type qualitySpeedTopLocationsResponseMetaConfidenceInfoAnnotationJSON 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 *QualitySpeedTopLocationsResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r qualitySpeedTopLocationsResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type QualitySpeedTopLocationsResponseTop0 struct {
+ BandwidthDownload string `json:"bandwidthDownload,required"`
+ BandwidthUpload string `json:"bandwidthUpload,required"`
+ ClientCountryAlpha2 string `json:"clientCountryAlpha2,required"`
+ ClientCountryName string `json:"clientCountryName,required"`
+ JitterIdle string `json:"jitterIdle,required"`
+ JitterLoaded string `json:"jitterLoaded,required"`
+ LatencyIdle string `json:"latencyIdle,required"`
+ LatencyLoaded string `json:"latencyLoaded,required"`
+ NumTests float64 `json:"numTests,required"`
+ RankPower float64 `json:"rankPower,required"`
+ JSON qualitySpeedTopLocationsResponseTop0JSON `json:"-"`
+}
+
+// qualitySpeedTopLocationsResponseTop0JSON contains the JSON metadata for the
+// struct [QualitySpeedTopLocationsResponseTop0]
+type qualitySpeedTopLocationsResponseTop0JSON struct {
+ BandwidthDownload apijson.Field
+ BandwidthUpload apijson.Field
+ ClientCountryAlpha2 apijson.Field
+ ClientCountryName apijson.Field
+ JitterIdle apijson.Field
+ JitterLoaded apijson.Field
+ LatencyIdle apijson.Field
+ LatencyLoaded apijson.Field
+ NumTests apijson.Field
+ RankPower apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *QualitySpeedTopLocationsResponseTop0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r qualitySpeedTopLocationsResponseTop0JSON) RawJSON() string {
+ return r.raw
+}
+
+type QualitySpeedTopAsesParams 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"`
+ // 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.
+ Format param.Field[QualitySpeedTopAsesParamsFormat] `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"`
+ // Metric to order the results by.
+ OrderBy param.Field[QualitySpeedTopAsesParamsOrderBy] `query:"orderBy"`
+ // Reverse the order of results.
+ Reverse param.Field[bool] `query:"reverse"`
+}
+
+// URLQuery serializes [QualitySpeedTopAsesParams]'s query parameters as
+// `url.Values`.
+func (r QualitySpeedTopAsesParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Format results are returned in.
+type QualitySpeedTopAsesParamsFormat string
+
+const (
+ QualitySpeedTopAsesParamsFormatJson QualitySpeedTopAsesParamsFormat = "JSON"
+ QualitySpeedTopAsesParamsFormatCsv QualitySpeedTopAsesParamsFormat = "CSV"
+)
+
+// Metric to order the results by.
+type QualitySpeedTopAsesParamsOrderBy string
+
+const (
+ QualitySpeedTopAsesParamsOrderByBandwidthDownload QualitySpeedTopAsesParamsOrderBy = "BANDWIDTH_DOWNLOAD"
+ QualitySpeedTopAsesParamsOrderByBandwidthUpload QualitySpeedTopAsesParamsOrderBy = "BANDWIDTH_UPLOAD"
+ QualitySpeedTopAsesParamsOrderByLatencyIdle QualitySpeedTopAsesParamsOrderBy = "LATENCY_IDLE"
+ QualitySpeedTopAsesParamsOrderByLatencyLoaded QualitySpeedTopAsesParamsOrderBy = "LATENCY_LOADED"
+ QualitySpeedTopAsesParamsOrderByJitterIdle QualitySpeedTopAsesParamsOrderBy = "JITTER_IDLE"
+ QualitySpeedTopAsesParamsOrderByJitterLoaded QualitySpeedTopAsesParamsOrderBy = "JITTER_LOADED"
+)
+
+type QualitySpeedTopAsesResponseEnvelope struct {
+ Result QualitySpeedTopAsesResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON qualitySpeedTopAsesResponseEnvelopeJSON `json:"-"`
+}
+
+// qualitySpeedTopAsesResponseEnvelopeJSON contains the JSON metadata for the
+// struct [QualitySpeedTopAsesResponseEnvelope]
+type qualitySpeedTopAsesResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *QualitySpeedTopAsesResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r qualitySpeedTopAsesResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type QualitySpeedTopLocationsParams 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"`
+ // 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.
+ Format param.Field[QualitySpeedTopLocationsParamsFormat] `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"`
+ // Metric to order the results by.
+ OrderBy param.Field[QualitySpeedTopLocationsParamsOrderBy] `query:"orderBy"`
+ // Reverse the order of results.
+ Reverse param.Field[bool] `query:"reverse"`
+}
+
+// URLQuery serializes [QualitySpeedTopLocationsParams]'s query parameters as
+// `url.Values`.
+func (r QualitySpeedTopLocationsParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Format results are returned in.
+type QualitySpeedTopLocationsParamsFormat string
+
+const (
+ QualitySpeedTopLocationsParamsFormatJson QualitySpeedTopLocationsParamsFormat = "JSON"
+ QualitySpeedTopLocationsParamsFormatCsv QualitySpeedTopLocationsParamsFormat = "CSV"
+)
+
+// Metric to order the results by.
+type QualitySpeedTopLocationsParamsOrderBy string
+
+const (
+ QualitySpeedTopLocationsParamsOrderByBandwidthDownload QualitySpeedTopLocationsParamsOrderBy = "BANDWIDTH_DOWNLOAD"
+ QualitySpeedTopLocationsParamsOrderByBandwidthUpload QualitySpeedTopLocationsParamsOrderBy = "BANDWIDTH_UPLOAD"
+ QualitySpeedTopLocationsParamsOrderByLatencyIdle QualitySpeedTopLocationsParamsOrderBy = "LATENCY_IDLE"
+ QualitySpeedTopLocationsParamsOrderByLatencyLoaded QualitySpeedTopLocationsParamsOrderBy = "LATENCY_LOADED"
+ QualitySpeedTopLocationsParamsOrderByJitterIdle QualitySpeedTopLocationsParamsOrderBy = "JITTER_IDLE"
+ QualitySpeedTopLocationsParamsOrderByJitterLoaded QualitySpeedTopLocationsParamsOrderBy = "JITTER_LOADED"
+)
+
+type QualitySpeedTopLocationsResponseEnvelope struct {
+ Result QualitySpeedTopLocationsResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON qualitySpeedTopLocationsResponseEnvelopeJSON `json:"-"`
+}
+
+// qualitySpeedTopLocationsResponseEnvelopeJSON contains the JSON metadata for the
+// struct [QualitySpeedTopLocationsResponseEnvelope]
+type qualitySpeedTopLocationsResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *QualitySpeedTopLocationsResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r qualitySpeedTopLocationsResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/radar/qualityspeedtop_test.go b/radar/qualityspeedtop_test.go
new file mode 100644
index 00000000000..65e41ee4d11
--- /dev/null
+++ b/radar/qualityspeedtop_test.go
@@ -0,0 +1,84 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/radar"
+)
+
+func TestQualitySpeedTopAsesWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Quality.Speed.Top.Ases(context.TODO(), radar.QualitySpeedTopAsesParams{
+ 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(radar.QualitySpeedTopAsesParamsFormatJson),
+ Limit: cloudflare.F(int64(5)),
+ Location: cloudflare.F([]string{"string", "string", "string"}),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ OrderBy: cloudflare.F(radar.QualitySpeedTopAsesParamsOrderByBandwidthDownload),
+ Reverse: cloudflare.F(true),
+ })
+ 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())
+ }
+}
+
+func TestQualitySpeedTopLocationsWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Quality.Speed.Top.Locations(context.TODO(), radar.QualitySpeedTopLocationsParams{
+ 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(radar.QualitySpeedTopLocationsParamsFormatJson),
+ Limit: cloudflare.F(int64(5)),
+ Location: cloudflare.F([]string{"string", "string", "string"}),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ OrderBy: cloudflare.F(radar.QualitySpeedTopLocationsParamsOrderByBandwidthDownload),
+ Reverse: cloudflare.F(true),
+ })
+ 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/radar/radar.go b/radar/radar.go
new file mode 100644
index 00000000000..3a66ec74208
--- /dev/null
+++ b/radar/radar.go
@@ -0,0 +1,56 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// RadarService contains methods and other services that help with interacting with
+// the cloudflare API. Note, unlike clients, this service does not read variables
+// from the environment automatically. You should not instantiate this service
+// directly, and instead use the [NewRadarService] method instead.
+type RadarService struct {
+ Options []option.RequestOption
+ Annotations *AnnotationService
+ BGP *BGPService
+ Datasets *DatasetService
+ DNS *DNSService
+ Netflows *NetflowService
+ Search *SearchService
+ VerifiedBots *VerifiedBotService
+ AS112 *AS112Service
+ ConnectionTampering *ConnectionTamperingService
+ Email *EmailService
+ Attacks *AttackService
+ Entities *EntityService
+ HTTP *HTTPService
+ Quality *QualityService
+ Ranking *RankingService
+ TrafficAnomalies *TrafficAnomalyService
+}
+
+// NewRadarService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewRadarService(opts ...option.RequestOption) (r *RadarService) {
+ r = &RadarService{}
+ r.Options = opts
+ r.Annotations = NewAnnotationService(opts...)
+ r.BGP = NewBGPService(opts...)
+ r.Datasets = NewDatasetService(opts...)
+ r.DNS = NewDNSService(opts...)
+ r.Netflows = NewNetflowService(opts...)
+ r.Search = NewSearchService(opts...)
+ r.VerifiedBots = NewVerifiedBotService(opts...)
+ r.AS112 = NewAS112Service(opts...)
+ r.ConnectionTampering = NewConnectionTamperingService(opts...)
+ r.Email = NewEmailService(opts...)
+ r.Attacks = NewAttackService(opts...)
+ r.Entities = NewEntityService(opts...)
+ r.HTTP = NewHTTPService(opts...)
+ r.Quality = NewQualityService(opts...)
+ r.Ranking = NewRankingService(opts...)
+ r.TrafficAnomalies = NewTrafficAnomalyService(opts...)
+ return
+}
diff --git a/radar/ranking.go b/radar/ranking.go
new file mode 100644
index 00000000000..72c63f6c29e
--- /dev/null
+++ b/radar/ranking.go
@@ -0,0 +1,428 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "context"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// RankingService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewRankingService] method instead.
+type RankingService struct {
+ Options []option.RequestOption
+ Domain *RankingDomainService
+}
+
+// NewRankingService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewRankingService(opts ...option.RequestOption) (r *RankingService) {
+ r = &RankingService{}
+ r.Options = opts
+ r.Domain = NewRankingDomainService(opts...)
+ return
+}
+
+// Gets Domains Rank updates change over time. Raw values are returned.
+func (r *RankingService) TimeseriesGroups(ctx context.Context, query RankingTimeseriesGroupsParams, opts ...option.RequestOption) (res *RankingTimeseriesGroupsResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RankingTimeseriesGroupsResponseEnvelope
+ path := "radar/ranking/timeseries_groups"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Get top or trending domains based on their rank. Popular domains are domains of
+// broad appeal based on how people use the Internet. Trending domains are domains
+// that are generating a surge in interest. For more information on top domains,
+// see https://blog.cloudflare.com/radar-domain-rankings/.
+func (r *RankingService) Top(ctx context.Context, query RankingTopParams, opts ...option.RequestOption) (res *RankingTopResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RankingTopResponseEnvelope
+ path := "radar/ranking/top"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type RankingTimeseriesGroupsResponse struct {
+ Meta RankingTimeseriesGroupsResponseMeta `json:"meta,required"`
+ Serie0 RankingTimeseriesGroupsResponseSerie0 `json:"serie_0,required"`
+ JSON rankingTimeseriesGroupsResponseJSON `json:"-"`
+}
+
+// rankingTimeseriesGroupsResponseJSON contains the JSON metadata for the struct
+// [RankingTimeseriesGroupsResponse]
+type rankingTimeseriesGroupsResponseJSON struct {
+ Meta apijson.Field
+ Serie0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RankingTimeseriesGroupsResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r rankingTimeseriesGroupsResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type RankingTimeseriesGroupsResponseMeta struct {
+ DateRange []RankingTimeseriesGroupsResponseMetaDateRange `json:"dateRange,required"`
+ JSON rankingTimeseriesGroupsResponseMetaJSON `json:"-"`
+}
+
+// rankingTimeseriesGroupsResponseMetaJSON contains the JSON metadata for the
+// struct [RankingTimeseriesGroupsResponseMeta]
+type rankingTimeseriesGroupsResponseMetaJSON struct {
+ DateRange apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RankingTimeseriesGroupsResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r rankingTimeseriesGroupsResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type RankingTimeseriesGroupsResponseMetaDateRange 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 rankingTimeseriesGroupsResponseMetaDateRangeJSON `json:"-"`
+}
+
+// rankingTimeseriesGroupsResponseMetaDateRangeJSON contains the JSON metadata for
+// the struct [RankingTimeseriesGroupsResponseMetaDateRange]
+type rankingTimeseriesGroupsResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RankingTimeseriesGroupsResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r rankingTimeseriesGroupsResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type RankingTimeseriesGroupsResponseSerie0 struct {
+ Timestamps []string `json:"timestamps,required"`
+ ExtraFields map[string][]RankingTimeseriesGroupsResponseSerie0 `json:"-,extras"`
+ JSON rankingTimeseriesGroupsResponseSerie0JSON `json:"-"`
+}
+
+// rankingTimeseriesGroupsResponseSerie0JSON contains the JSON metadata for the
+// struct [RankingTimeseriesGroupsResponseSerie0]
+type rankingTimeseriesGroupsResponseSerie0JSON struct {
+ Timestamps apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RankingTimeseriesGroupsResponseSerie0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r rankingTimeseriesGroupsResponseSerie0JSON) RawJSON() string {
+ return r.raw
+}
+
+type RankingTopResponse struct {
+ Meta RankingTopResponseMeta `json:"meta,required"`
+ Top0 []RankingTopResponseTop0 `json:"top_0,required"`
+ JSON rankingTopResponseJSON `json:"-"`
+}
+
+// rankingTopResponseJSON contains the JSON metadata for the struct
+// [RankingTopResponse]
+type rankingTopResponseJSON struct {
+ Meta apijson.Field
+ Top0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RankingTopResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r rankingTopResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type RankingTopResponseMeta struct {
+ Top0 RankingTopResponseMetaTop0 `json:"top_0,required"`
+ JSON rankingTopResponseMetaJSON `json:"-"`
+}
+
+// rankingTopResponseMetaJSON contains the JSON metadata for the struct
+// [RankingTopResponseMeta]
+type rankingTopResponseMetaJSON struct {
+ Top0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RankingTopResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r rankingTopResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type RankingTopResponseMetaTop0 struct {
+ Date string `json:"date,required"`
+ JSON rankingTopResponseMetaTop0JSON `json:"-"`
+}
+
+// rankingTopResponseMetaTop0JSON contains the JSON metadata for the struct
+// [RankingTopResponseMetaTop0]
+type rankingTopResponseMetaTop0JSON struct {
+ Date apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RankingTopResponseMetaTop0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r rankingTopResponseMetaTop0JSON) RawJSON() string {
+ return r.raw
+}
+
+type RankingTopResponseTop0 struct {
+ Categories []RankingTopResponseTop0Category `json:"categories,required"`
+ Domain string `json:"domain,required"`
+ Rank int64 `json:"rank,required"`
+ // Only available in TRENDING rankings.
+ PctRankChange float64 `json:"pctRankChange"`
+ JSON rankingTopResponseTop0JSON `json:"-"`
+}
+
+// rankingTopResponseTop0JSON contains the JSON metadata for the struct
+// [RankingTopResponseTop0]
+type rankingTopResponseTop0JSON struct {
+ Categories apijson.Field
+ Domain apijson.Field
+ Rank apijson.Field
+ PctRankChange apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RankingTopResponseTop0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r rankingTopResponseTop0JSON) RawJSON() string {
+ return r.raw
+}
+
+type RankingTopResponseTop0Category struct {
+ ID float64 `json:"id,required"`
+ Name string `json:"name,required"`
+ SuperCategoryID float64 `json:"superCategoryId,required"`
+ JSON rankingTopResponseTop0CategoryJSON `json:"-"`
+}
+
+// rankingTopResponseTop0CategoryJSON contains the JSON metadata for the struct
+// [RankingTopResponseTop0Category]
+type rankingTopResponseTop0CategoryJSON struct {
+ ID apijson.Field
+ Name apijson.Field
+ SuperCategoryID apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RankingTopResponseTop0Category) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r rankingTopResponseTop0CategoryJSON) RawJSON() string {
+ return r.raw
+}
+
+type RankingTimeseriesGroupsParams struct {
+ // 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[[]RankingTimeseriesGroupsParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Array of comma separated list of domains names.
+ Domains param.Field[[]string] `query:"domains"`
+ // Format results are returned in.
+ Format param.Field[RankingTimeseriesGroupsParamsFormat] `query:"format"`
+ // Limit the number of objects in the response.
+ Limit param.Field[int64] `query:"limit"`
+ // Array of locations (alpha-2 country codes).
+ 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"`
+ // The ranking type.
+ RankingType param.Field[RankingTimeseriesGroupsParamsRankingType] `query:"rankingType"`
+}
+
+// URLQuery serializes [RankingTimeseriesGroupsParams]'s query parameters as
+// `url.Values`.
+func (r RankingTimeseriesGroupsParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type RankingTimeseriesGroupsParamsDateRange string
+
+const (
+ RankingTimeseriesGroupsParamsDateRange1d RankingTimeseriesGroupsParamsDateRange = "1d"
+ RankingTimeseriesGroupsParamsDateRange2d RankingTimeseriesGroupsParamsDateRange = "2d"
+ RankingTimeseriesGroupsParamsDateRange7d RankingTimeseriesGroupsParamsDateRange = "7d"
+ RankingTimeseriesGroupsParamsDateRange14d RankingTimeseriesGroupsParamsDateRange = "14d"
+ RankingTimeseriesGroupsParamsDateRange28d RankingTimeseriesGroupsParamsDateRange = "28d"
+ RankingTimeseriesGroupsParamsDateRange12w RankingTimeseriesGroupsParamsDateRange = "12w"
+ RankingTimeseriesGroupsParamsDateRange24w RankingTimeseriesGroupsParamsDateRange = "24w"
+ RankingTimeseriesGroupsParamsDateRange52w RankingTimeseriesGroupsParamsDateRange = "52w"
+ RankingTimeseriesGroupsParamsDateRange1dControl RankingTimeseriesGroupsParamsDateRange = "1dControl"
+ RankingTimeseriesGroupsParamsDateRange2dControl RankingTimeseriesGroupsParamsDateRange = "2dControl"
+ RankingTimeseriesGroupsParamsDateRange7dControl RankingTimeseriesGroupsParamsDateRange = "7dControl"
+ RankingTimeseriesGroupsParamsDateRange14dControl RankingTimeseriesGroupsParamsDateRange = "14dControl"
+ RankingTimeseriesGroupsParamsDateRange28dControl RankingTimeseriesGroupsParamsDateRange = "28dControl"
+ RankingTimeseriesGroupsParamsDateRange12wControl RankingTimeseriesGroupsParamsDateRange = "12wControl"
+ RankingTimeseriesGroupsParamsDateRange24wControl RankingTimeseriesGroupsParamsDateRange = "24wControl"
+)
+
+// Format results are returned in.
+type RankingTimeseriesGroupsParamsFormat string
+
+const (
+ RankingTimeseriesGroupsParamsFormatJson RankingTimeseriesGroupsParamsFormat = "JSON"
+ RankingTimeseriesGroupsParamsFormatCsv RankingTimeseriesGroupsParamsFormat = "CSV"
+)
+
+// The ranking type.
+type RankingTimeseriesGroupsParamsRankingType string
+
+const (
+ RankingTimeseriesGroupsParamsRankingTypePopular RankingTimeseriesGroupsParamsRankingType = "POPULAR"
+ RankingTimeseriesGroupsParamsRankingTypeTrendingRise RankingTimeseriesGroupsParamsRankingType = "TRENDING_RISE"
+ RankingTimeseriesGroupsParamsRankingTypeTrendingSteady RankingTimeseriesGroupsParamsRankingType = "TRENDING_STEADY"
+)
+
+type RankingTimeseriesGroupsResponseEnvelope struct {
+ Result RankingTimeseriesGroupsResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON rankingTimeseriesGroupsResponseEnvelopeJSON `json:"-"`
+}
+
+// rankingTimeseriesGroupsResponseEnvelopeJSON contains the JSON metadata for the
+// struct [RankingTimeseriesGroupsResponseEnvelope]
+type rankingTimeseriesGroupsResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RankingTimeseriesGroupsResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r rankingTimeseriesGroupsResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type RankingTopParams struct {
+ // Array of dates to filter the ranking.
+ Date param.Field[[]string] `query:"date"`
+ // Format results are returned in.
+ Format param.Field[RankingTopParamsFormat] `query:"format"`
+ // Limit the number of objects in the response.
+ Limit param.Field[int64] `query:"limit"`
+ // Array of locations (alpha-2 country codes).
+ 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"`
+ // The ranking type.
+ RankingType param.Field[RankingTopParamsRankingType] `query:"rankingType"`
+}
+
+// URLQuery serializes [RankingTopParams]'s query parameters as `url.Values`.
+func (r RankingTopParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Format results are returned in.
+type RankingTopParamsFormat string
+
+const (
+ RankingTopParamsFormatJson RankingTopParamsFormat = "JSON"
+ RankingTopParamsFormatCsv RankingTopParamsFormat = "CSV"
+)
+
+// The ranking type.
+type RankingTopParamsRankingType string
+
+const (
+ RankingTopParamsRankingTypePopular RankingTopParamsRankingType = "POPULAR"
+ RankingTopParamsRankingTypeTrendingRise RankingTopParamsRankingType = "TRENDING_RISE"
+ RankingTopParamsRankingTypeTrendingSteady RankingTopParamsRankingType = "TRENDING_STEADY"
+)
+
+type RankingTopResponseEnvelope struct {
+ Result RankingTopResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON rankingTopResponseEnvelopeJSON `json:"-"`
+}
+
+// rankingTopResponseEnvelopeJSON contains the JSON metadata for the struct
+// [RankingTopResponseEnvelope]
+type rankingTopResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RankingTopResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r rankingTopResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/radar/ranking_test.go b/radar/ranking_test.go
new file mode 100644
index 00000000000..cbcf4264686
--- /dev/null
+++ b/radar/ranking_test.go
@@ -0,0 +1,81 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/radar"
+)
+
+func TestRankingTimeseriesGroupsWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Ranking.TimeseriesGroups(context.TODO(), radar.RankingTimeseriesGroupsParams{
+ DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ DateRange: cloudflare.F([]radar.RankingTimeseriesGroupsParamsDateRange{radar.RankingTimeseriesGroupsParamsDateRange1d, radar.RankingTimeseriesGroupsParamsDateRange2d, radar.RankingTimeseriesGroupsParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Domains: cloudflare.F([]string{"string", "string", "string"}),
+ Format: cloudflare.F(radar.RankingTimeseriesGroupsParamsFormatJson),
+ Limit: cloudflare.F(int64(5)),
+ Location: cloudflare.F([]string{"string", "string", "string"}),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ RankingType: cloudflare.F(radar.RankingTimeseriesGroupsParamsRankingTypePopular),
+ })
+ 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())
+ }
+}
+
+func TestRankingTopWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Ranking.Top(context.TODO(), radar.RankingTopParams{
+ Date: cloudflare.F([]string{"string", "string", "string"}),
+ Format: cloudflare.F(radar.RankingTopParamsFormatJson),
+ Limit: cloudflare.F(int64(5)),
+ Location: cloudflare.F([]string{"string", "string", "string"}),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ RankingType: cloudflare.F(radar.RankingTopParamsRankingTypePopular),
+ })
+ 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/radar/rankingdomain.go b/radar/rankingdomain.go
new file mode 100644
index 00000000000..895a10bdecb
--- /dev/null
+++ b/radar/rankingdomain.go
@@ -0,0 +1,210 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// RankingDomainService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewRankingDomainService] method
+// instead.
+type RankingDomainService struct {
+ Options []option.RequestOption
+}
+
+// NewRankingDomainService generates a new service that applies the given options
+// to each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewRankingDomainService(opts ...option.RequestOption) (r *RankingDomainService) {
+ r = &RankingDomainService{}
+ r.Options = opts
+ return
+}
+
+// Gets Domains Rank details. Cloudflare provides an ordered rank for the top 100
+// domains, but for the remainder it only provides ranking buckets like top 200
+// thousand, top one million, etc.. These are available through Radar datasets
+// endpoints.
+func (r *RankingDomainService) Get(ctx context.Context, domain string, query RankingDomainGetParams, opts ...option.RequestOption) (res *RankingDomainGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RankingDomainGetResponseEnvelope
+ path := fmt.Sprintf("radar/ranking/domain/%s", domain)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type RankingDomainGetResponse struct {
+ Details0 RankingDomainGetResponseDetails0 `json:"details_0,required"`
+ JSON rankingDomainGetResponseJSON `json:"-"`
+}
+
+// rankingDomainGetResponseJSON contains the JSON metadata for the struct
+// [RankingDomainGetResponse]
+type rankingDomainGetResponseJSON struct {
+ Details0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RankingDomainGetResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r rankingDomainGetResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type RankingDomainGetResponseDetails0 struct {
+ Categories []RankingDomainGetResponseDetails0Category `json:"categories,required"`
+ TopLocations []RankingDomainGetResponseDetails0TopLocation `json:"top_locations,required"`
+ // Only available in POPULAR ranking for the most recent ranking.
+ Bucket string `json:"bucket"`
+ Rank int64 `json:"rank"`
+ JSON rankingDomainGetResponseDetails0JSON `json:"-"`
+}
+
+// rankingDomainGetResponseDetails0JSON contains the JSON metadata for the struct
+// [RankingDomainGetResponseDetails0]
+type rankingDomainGetResponseDetails0JSON struct {
+ Categories apijson.Field
+ TopLocations apijson.Field
+ Bucket apijson.Field
+ Rank apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RankingDomainGetResponseDetails0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r rankingDomainGetResponseDetails0JSON) RawJSON() string {
+ return r.raw
+}
+
+type RankingDomainGetResponseDetails0Category struct {
+ ID float64 `json:"id,required"`
+ Name string `json:"name,required"`
+ SuperCategoryID float64 `json:"superCategoryId,required"`
+ JSON rankingDomainGetResponseDetails0CategoryJSON `json:"-"`
+}
+
+// rankingDomainGetResponseDetails0CategoryJSON contains the JSON metadata for the
+// struct [RankingDomainGetResponseDetails0Category]
+type rankingDomainGetResponseDetails0CategoryJSON struct {
+ ID apijson.Field
+ Name apijson.Field
+ SuperCategoryID apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RankingDomainGetResponseDetails0Category) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r rankingDomainGetResponseDetails0CategoryJSON) RawJSON() string {
+ return r.raw
+}
+
+type RankingDomainGetResponseDetails0TopLocation struct {
+ LocationCode string `json:"locationCode,required"`
+ LocationName string `json:"locationName,required"`
+ Rank int64 `json:"rank,required"`
+ JSON rankingDomainGetResponseDetails0TopLocationJSON `json:"-"`
+}
+
+// rankingDomainGetResponseDetails0TopLocationJSON contains the JSON metadata for
+// the struct [RankingDomainGetResponseDetails0TopLocation]
+type rankingDomainGetResponseDetails0TopLocationJSON struct {
+ LocationCode apijson.Field
+ LocationName apijson.Field
+ Rank apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RankingDomainGetResponseDetails0TopLocation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r rankingDomainGetResponseDetails0TopLocationJSON) RawJSON() string {
+ return r.raw
+}
+
+type RankingDomainGetParams struct {
+ // Array of dates to filter the ranking.
+ Date param.Field[[]string] `query:"date"`
+ // Format results are returned in.
+ Format param.Field[RankingDomainGetParamsFormat] `query:"format"`
+ // Limit the number of objects in the response.
+ Limit param.Field[int64] `query:"limit"`
+ // Array of names that will be used to name the series in responses.
+ Name param.Field[[]string] `query:"name"`
+ // The ranking type.
+ RankingType param.Field[RankingDomainGetParamsRankingType] `query:"rankingType"`
+}
+
+// URLQuery serializes [RankingDomainGetParams]'s query parameters as `url.Values`.
+func (r RankingDomainGetParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Format results are returned in.
+type RankingDomainGetParamsFormat string
+
+const (
+ RankingDomainGetParamsFormatJson RankingDomainGetParamsFormat = "JSON"
+ RankingDomainGetParamsFormatCsv RankingDomainGetParamsFormat = "CSV"
+)
+
+// The ranking type.
+type RankingDomainGetParamsRankingType string
+
+const (
+ RankingDomainGetParamsRankingTypePopular RankingDomainGetParamsRankingType = "POPULAR"
+ RankingDomainGetParamsRankingTypeTrendingRise RankingDomainGetParamsRankingType = "TRENDING_RISE"
+ RankingDomainGetParamsRankingTypeTrendingSteady RankingDomainGetParamsRankingType = "TRENDING_STEADY"
+)
+
+type RankingDomainGetResponseEnvelope struct {
+ Result RankingDomainGetResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON rankingDomainGetResponseEnvelopeJSON `json:"-"`
+}
+
+// rankingDomainGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [RankingDomainGetResponseEnvelope]
+type rankingDomainGetResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RankingDomainGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r rankingDomainGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/radar/rankingdomain_test.go b/radar/rankingdomain_test.go
new file mode 100644
index 00000000000..e72a8bcf9f9
--- /dev/null
+++ b/radar/rankingdomain_test.go
@@ -0,0 +1,49 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/radar"
+)
+
+func TestRankingDomainGetWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Ranking.Domain.Get(
+ context.TODO(),
+ "google.com",
+ radar.RankingDomainGetParams{
+ Date: cloudflare.F([]string{"string", "string", "string"}),
+ Format: cloudflare.F(radar.RankingDomainGetParamsFormatJson),
+ Limit: cloudflare.F(int64(5)),
+ Name: cloudflare.F([]string{"string", "string", "string"}),
+ RankingType: cloudflare.F(radar.RankingDomainGetParamsRankingTypePopular),
+ },
+ )
+ 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/radar/search.go b/radar/search.go
new file mode 100644
index 00000000000..df707c6c372
--- /dev/null
+++ b/radar/search.go
@@ -0,0 +1,163 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "context"
+ "net/http"
+ "net/url"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// SearchService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewSearchService] method instead.
+type SearchService struct {
+ Options []option.RequestOption
+}
+
+// NewSearchService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewSearchService(opts ...option.RequestOption) (r *SearchService) {
+ r = &SearchService{}
+ r.Options = opts
+ return
+}
+
+// Lets you search for locations, autonomous systems (AS) and reports.
+func (r *SearchService) Global(ctx context.Context, query SearchGlobalParams, opts ...option.RequestOption) (res *SearchGlobalResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env SearchGlobalResponseEnvelope
+ path := "radar/search/global"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type SearchGlobalResponse struct {
+ Search []SearchGlobalResponseSearch `json:"search,required"`
+ JSON searchGlobalResponseJSON `json:"-"`
+}
+
+// searchGlobalResponseJSON contains the JSON metadata for the struct
+// [SearchGlobalResponse]
+type searchGlobalResponseJSON struct {
+ Search apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *SearchGlobalResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r searchGlobalResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type SearchGlobalResponseSearch struct {
+ Code string `json:"code,required"`
+ Name string `json:"name,required"`
+ Type string `json:"type,required"`
+ JSON searchGlobalResponseSearchJSON `json:"-"`
+}
+
+// searchGlobalResponseSearchJSON contains the JSON metadata for the struct
+// [SearchGlobalResponseSearch]
+type searchGlobalResponseSearchJSON struct {
+ Code apijson.Field
+ Name apijson.Field
+ Type apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *SearchGlobalResponseSearch) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r searchGlobalResponseSearchJSON) RawJSON() string {
+ return r.raw
+}
+
+type SearchGlobalParams struct {
+ // Search for locations, AS and reports.
+ Query param.Field[string] `query:"query,required"`
+ // Search types to be excluded from results.
+ Exclude param.Field[[]SearchGlobalParamsExclude] `query:"exclude"`
+ // Format results are returned in.
+ Format param.Field[SearchGlobalParamsFormat] `query:"format"`
+ // Search types to be included in results.
+ Include param.Field[[]SearchGlobalParamsInclude] `query:"include"`
+ // Limit the number of objects in the response.
+ Limit param.Field[int64] `query:"limit"`
+ // Limit the number of objects per search category.
+ LimitPerGroup param.Field[float64] `query:"limitPerGroup"`
+}
+
+// URLQuery serializes [SearchGlobalParams]'s query parameters as `url.Values`.
+func (r SearchGlobalParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type SearchGlobalParamsExclude string
+
+const (
+ SearchGlobalParamsExcludeSpecialEvents SearchGlobalParamsExclude = "SPECIAL_EVENTS"
+ SearchGlobalParamsExcludeNotebooks SearchGlobalParamsExclude = "NOTEBOOKS"
+ SearchGlobalParamsExcludeLocations SearchGlobalParamsExclude = "LOCATIONS"
+ SearchGlobalParamsExcludeASNs SearchGlobalParamsExclude = "ASNS"
+)
+
+// Format results are returned in.
+type SearchGlobalParamsFormat string
+
+const (
+ SearchGlobalParamsFormatJson SearchGlobalParamsFormat = "JSON"
+ SearchGlobalParamsFormatCsv SearchGlobalParamsFormat = "CSV"
+)
+
+type SearchGlobalParamsInclude string
+
+const (
+ SearchGlobalParamsIncludeSpecialEvents SearchGlobalParamsInclude = "SPECIAL_EVENTS"
+ SearchGlobalParamsIncludeNotebooks SearchGlobalParamsInclude = "NOTEBOOKS"
+ SearchGlobalParamsIncludeLocations SearchGlobalParamsInclude = "LOCATIONS"
+ SearchGlobalParamsIncludeASNs SearchGlobalParamsInclude = "ASNS"
+)
+
+type SearchGlobalResponseEnvelope struct {
+ Result SearchGlobalResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON searchGlobalResponseEnvelopeJSON `json:"-"`
+}
+
+// searchGlobalResponseEnvelopeJSON contains the JSON metadata for the struct
+// [SearchGlobalResponseEnvelope]
+type searchGlobalResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *SearchGlobalResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r searchGlobalResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/radar/search_test.go b/radar/search_test.go
new file mode 100644
index 00000000000..e1c6594203e
--- /dev/null
+++ b/radar/search_test.go
@@ -0,0 +1,46 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/radar"
+)
+
+func TestSearchGlobalWithOptionalParams(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"),
+ )
+ _, err := client.Radar.Search.Global(context.TODO(), radar.SearchGlobalParams{
+ Query: cloudflare.F("United"),
+ Exclude: cloudflare.F([]radar.SearchGlobalParamsExclude{radar.SearchGlobalParamsExcludeSpecialEvents, radar.SearchGlobalParamsExcludeNotebooks, radar.SearchGlobalParamsExcludeLocations}),
+ Format: cloudflare.F(radar.SearchGlobalParamsFormatJson),
+ Include: cloudflare.F([]radar.SearchGlobalParamsInclude{radar.SearchGlobalParamsIncludeSpecialEvents, radar.SearchGlobalParamsIncludeNotebooks, radar.SearchGlobalParamsIncludeLocations}),
+ Limit: cloudflare.F(int64(5)),
+ LimitPerGroup: cloudflare.F(0.000000),
+ })
+ 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/radar/trafficanomaly.go b/radar/trafficanomaly.go
new file mode 100644
index 00000000000..8ab61cfd6eb
--- /dev/null
+++ b/radar/trafficanomaly.go
@@ -0,0 +1,270 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "context"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// TrafficAnomalyService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewTrafficAnomalyService] method
+// instead.
+type TrafficAnomalyService struct {
+ Options []option.RequestOption
+ Locations *TrafficAnomalyLocationService
+}
+
+// NewTrafficAnomalyService generates a new service that applies the given options
+// to each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewTrafficAnomalyService(opts ...option.RequestOption) (r *TrafficAnomalyService) {
+ r = &TrafficAnomalyService{}
+ r.Options = opts
+ r.Locations = NewTrafficAnomalyLocationService(opts...)
+ return
+}
+
+// Internet traffic anomalies are signals that might point to an outage, These
+// alerts are automatically detected by Radar and then manually verified by our
+// team. This endpoint returns the latest alerts.
+func (r *TrafficAnomalyService) Get(ctx context.Context, query TrafficAnomalyGetParams, opts ...option.RequestOption) (res *TrafficAnomalyGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env TrafficAnomalyGetResponseEnvelope
+ path := "radar/traffic_anomalies"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type TrafficAnomalyGetResponse struct {
+ TrafficAnomalies []TrafficAnomalyGetResponseTrafficAnomaly `json:"trafficAnomalies,required"`
+ JSON trafficAnomalyGetResponseJSON `json:"-"`
+}
+
+// trafficAnomalyGetResponseJSON contains the JSON metadata for the struct
+// [TrafficAnomalyGetResponse]
+type trafficAnomalyGetResponseJSON struct {
+ TrafficAnomalies apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *TrafficAnomalyGetResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r trafficAnomalyGetResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type TrafficAnomalyGetResponseTrafficAnomaly struct {
+ StartDate string `json:"startDate,required"`
+ Status string `json:"status,required"`
+ Type string `json:"type,required"`
+ UUID string `json:"uuid,required"`
+ ASNDetails TrafficAnomalyGetResponseTrafficAnomaliesASNDetails `json:"asnDetails"`
+ EndDate string `json:"endDate"`
+ LocationDetails TrafficAnomalyGetResponseTrafficAnomaliesLocationDetails `json:"locationDetails"`
+ VisibleInDataSources []string `json:"visibleInDataSources"`
+ JSON trafficAnomalyGetResponseTrafficAnomalyJSON `json:"-"`
+}
+
+// trafficAnomalyGetResponseTrafficAnomalyJSON contains the JSON metadata for the
+// struct [TrafficAnomalyGetResponseTrafficAnomaly]
+type trafficAnomalyGetResponseTrafficAnomalyJSON struct {
+ StartDate apijson.Field
+ Status apijson.Field
+ Type apijson.Field
+ UUID apijson.Field
+ ASNDetails apijson.Field
+ EndDate apijson.Field
+ LocationDetails apijson.Field
+ VisibleInDataSources apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *TrafficAnomalyGetResponseTrafficAnomaly) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r trafficAnomalyGetResponseTrafficAnomalyJSON) RawJSON() string {
+ return r.raw
+}
+
+type TrafficAnomalyGetResponseTrafficAnomaliesASNDetails struct {
+ ASN string `json:"asn,required"`
+ Name string `json:"name,required"`
+ Locations TrafficAnomalyGetResponseTrafficAnomaliesASNDetailsLocations `json:"locations"`
+ JSON trafficAnomalyGetResponseTrafficAnomaliesASNDetailsJSON `json:"-"`
+}
+
+// trafficAnomalyGetResponseTrafficAnomaliesASNDetailsJSON contains the JSON
+// metadata for the struct [TrafficAnomalyGetResponseTrafficAnomaliesASNDetails]
+type trafficAnomalyGetResponseTrafficAnomaliesASNDetailsJSON struct {
+ ASN apijson.Field
+ Name apijson.Field
+ Locations apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *TrafficAnomalyGetResponseTrafficAnomaliesASNDetails) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r trafficAnomalyGetResponseTrafficAnomaliesASNDetailsJSON) RawJSON() string {
+ return r.raw
+}
+
+type TrafficAnomalyGetResponseTrafficAnomaliesASNDetailsLocations struct {
+ Code string `json:"code,required"`
+ Name string `json:"name,required"`
+ JSON trafficAnomalyGetResponseTrafficAnomaliesASNDetailsLocationsJSON `json:"-"`
+}
+
+// trafficAnomalyGetResponseTrafficAnomaliesASNDetailsLocationsJSON contains the
+// JSON metadata for the struct
+// [TrafficAnomalyGetResponseTrafficAnomaliesASNDetailsLocations]
+type trafficAnomalyGetResponseTrafficAnomaliesASNDetailsLocationsJSON struct {
+ Code apijson.Field
+ Name apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *TrafficAnomalyGetResponseTrafficAnomaliesASNDetailsLocations) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r trafficAnomalyGetResponseTrafficAnomaliesASNDetailsLocationsJSON) RawJSON() string {
+ return r.raw
+}
+
+type TrafficAnomalyGetResponseTrafficAnomaliesLocationDetails struct {
+ Code string `json:"code,required"`
+ Name string `json:"name,required"`
+ JSON trafficAnomalyGetResponseTrafficAnomaliesLocationDetailsJSON `json:"-"`
+}
+
+// trafficAnomalyGetResponseTrafficAnomaliesLocationDetailsJSON contains the JSON
+// metadata for the struct
+// [TrafficAnomalyGetResponseTrafficAnomaliesLocationDetails]
+type trafficAnomalyGetResponseTrafficAnomaliesLocationDetailsJSON struct {
+ Code apijson.Field
+ Name apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *TrafficAnomalyGetResponseTrafficAnomaliesLocationDetails) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r trafficAnomalyGetResponseTrafficAnomaliesLocationDetailsJSON) RawJSON() string {
+ return r.raw
+}
+
+type TrafficAnomalyGetParams struct {
+ // Single ASN as integer.
+ ASN param.Field[int64] `query:"asn"`
+ // End of the date range (inclusive).
+ DateEnd param.Field[time.Time] `query:"dateEnd" format:"date-time"`
+ // Shorthand date ranges for the last X days - use when you don't need specific
+ // start and end dates.
+ DateRange param.Field[TrafficAnomalyGetParamsDateRange] `query:"dateRange"`
+ // Start of the date range (inclusive).
+ DateStart param.Field[time.Time] `query:"dateStart" format:"date-time"`
+ // Format results are returned in.
+ Format param.Field[TrafficAnomalyGetParamsFormat] `query:"format"`
+ // Limit the number of objects in the response.
+ Limit param.Field[int64] `query:"limit"`
+ // Location Alpha2 code.
+ Location param.Field[string] `query:"location"`
+ // Number of objects to skip before grabbing results.
+ Offset param.Field[int64] `query:"offset"`
+ Status param.Field[TrafficAnomalyGetParamsStatus] `query:"status"`
+}
+
+// URLQuery serializes [TrafficAnomalyGetParams]'s query parameters as
+// `url.Values`.
+func (r TrafficAnomalyGetParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Shorthand date ranges for the last X days - use when you don't need specific
+// start and end dates.
+type TrafficAnomalyGetParamsDateRange string
+
+const (
+ TrafficAnomalyGetParamsDateRange1d TrafficAnomalyGetParamsDateRange = "1d"
+ TrafficAnomalyGetParamsDateRange2d TrafficAnomalyGetParamsDateRange = "2d"
+ TrafficAnomalyGetParamsDateRange7d TrafficAnomalyGetParamsDateRange = "7d"
+ TrafficAnomalyGetParamsDateRange14d TrafficAnomalyGetParamsDateRange = "14d"
+ TrafficAnomalyGetParamsDateRange28d TrafficAnomalyGetParamsDateRange = "28d"
+ TrafficAnomalyGetParamsDateRange12w TrafficAnomalyGetParamsDateRange = "12w"
+ TrafficAnomalyGetParamsDateRange24w TrafficAnomalyGetParamsDateRange = "24w"
+ TrafficAnomalyGetParamsDateRange52w TrafficAnomalyGetParamsDateRange = "52w"
+ TrafficAnomalyGetParamsDateRange1dControl TrafficAnomalyGetParamsDateRange = "1dControl"
+ TrafficAnomalyGetParamsDateRange2dControl TrafficAnomalyGetParamsDateRange = "2dControl"
+ TrafficAnomalyGetParamsDateRange7dControl TrafficAnomalyGetParamsDateRange = "7dControl"
+ TrafficAnomalyGetParamsDateRange14dControl TrafficAnomalyGetParamsDateRange = "14dControl"
+ TrafficAnomalyGetParamsDateRange28dControl TrafficAnomalyGetParamsDateRange = "28dControl"
+ TrafficAnomalyGetParamsDateRange12wControl TrafficAnomalyGetParamsDateRange = "12wControl"
+ TrafficAnomalyGetParamsDateRange24wControl TrafficAnomalyGetParamsDateRange = "24wControl"
+)
+
+// Format results are returned in.
+type TrafficAnomalyGetParamsFormat string
+
+const (
+ TrafficAnomalyGetParamsFormatJson TrafficAnomalyGetParamsFormat = "JSON"
+ TrafficAnomalyGetParamsFormatCsv TrafficAnomalyGetParamsFormat = "CSV"
+)
+
+type TrafficAnomalyGetParamsStatus string
+
+const (
+ TrafficAnomalyGetParamsStatusVerified TrafficAnomalyGetParamsStatus = "VERIFIED"
+ TrafficAnomalyGetParamsStatusUnverified TrafficAnomalyGetParamsStatus = "UNVERIFIED"
+)
+
+type TrafficAnomalyGetResponseEnvelope struct {
+ Result TrafficAnomalyGetResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON trafficAnomalyGetResponseEnvelopeJSON `json:"-"`
+}
+
+// trafficAnomalyGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [TrafficAnomalyGetResponseEnvelope]
+type trafficAnomalyGetResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *TrafficAnomalyGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r trafficAnomalyGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/radar/trafficanomaly_test.go b/radar/trafficanomaly_test.go
new file mode 100644
index 00000000000..1c6ee3aa7b2
--- /dev/null
+++ b/radar/trafficanomaly_test.go
@@ -0,0 +1,50 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/radar"
+)
+
+func TestTrafficAnomalyGetWithOptionalParams(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"),
+ )
+ _, err := client.Radar.TrafficAnomalies.Get(context.TODO(), radar.TrafficAnomalyGetParams{
+ ASN: cloudflare.F(int64(0)),
+ DateEnd: cloudflare.F(time.Now()),
+ DateRange: cloudflare.F(radar.TrafficAnomalyGetParamsDateRange7d),
+ DateStart: cloudflare.F(time.Now()),
+ Format: cloudflare.F(radar.TrafficAnomalyGetParamsFormatJson),
+ Limit: cloudflare.F(int64(5)),
+ Location: cloudflare.F("US"),
+ Offset: cloudflare.F(int64(0)),
+ Status: cloudflare.F(radar.TrafficAnomalyGetParamsStatusVerified),
+ })
+ 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/radar/trafficanomalylocation.go b/radar/trafficanomalylocation.go
new file mode 100644
index 00000000000..98f4371fb6b
--- /dev/null
+++ b/radar/trafficanomalylocation.go
@@ -0,0 +1,179 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "context"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// TrafficAnomalyLocationService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewTrafficAnomalyLocationService]
+// method instead.
+type TrafficAnomalyLocationService struct {
+ Options []option.RequestOption
+}
+
+// NewTrafficAnomalyLocationService generates a new service that applies the given
+// options to each request. These options are applied after the parent client's
+// options (if there is one), and before any request-specific options.
+func NewTrafficAnomalyLocationService(opts ...option.RequestOption) (r *TrafficAnomalyLocationService) {
+ r = &TrafficAnomalyLocationService{}
+ r.Options = opts
+ return
+}
+
+// Internet traffic anomalies are signals that might point to an outage, These
+// alerts are automatically detected by Radar and then manually verified by our
+// team. This endpoint returns the sum of alerts grouped by location.
+func (r *TrafficAnomalyLocationService) Get(ctx context.Context, query TrafficAnomalyLocationGetParams, opts ...option.RequestOption) (res *TrafficAnomalyLocationGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env TrafficAnomalyLocationGetResponseEnvelope
+ path := "radar/traffic_anomalies/locations"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type TrafficAnomalyLocationGetResponse struct {
+ TrafficAnomalies []TrafficAnomalyLocationGetResponseTrafficAnomaly `json:"trafficAnomalies,required"`
+ JSON trafficAnomalyLocationGetResponseJSON `json:"-"`
+}
+
+// trafficAnomalyLocationGetResponseJSON contains the JSON metadata for the struct
+// [TrafficAnomalyLocationGetResponse]
+type trafficAnomalyLocationGetResponseJSON struct {
+ TrafficAnomalies apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *TrafficAnomalyLocationGetResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r trafficAnomalyLocationGetResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type TrafficAnomalyLocationGetResponseTrafficAnomaly struct {
+ ClientCountryAlpha2 string `json:"clientCountryAlpha2,required"`
+ ClientCountryName string `json:"clientCountryName,required"`
+ Value string `json:"value,required"`
+ JSON trafficAnomalyLocationGetResponseTrafficAnomalyJSON `json:"-"`
+}
+
+// trafficAnomalyLocationGetResponseTrafficAnomalyJSON contains the JSON metadata
+// for the struct [TrafficAnomalyLocationGetResponseTrafficAnomaly]
+type trafficAnomalyLocationGetResponseTrafficAnomalyJSON struct {
+ ClientCountryAlpha2 apijson.Field
+ ClientCountryName apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *TrafficAnomalyLocationGetResponseTrafficAnomaly) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r trafficAnomalyLocationGetResponseTrafficAnomalyJSON) RawJSON() string {
+ return r.raw
+}
+
+type TrafficAnomalyLocationGetParams struct {
+ // End of the date range (inclusive).
+ DateEnd param.Field[time.Time] `query:"dateEnd" format:"date-time"`
+ // Shorthand date ranges for the last X days - use when you don't need specific
+ // start and end dates.
+ DateRange param.Field[TrafficAnomalyLocationGetParamsDateRange] `query:"dateRange"`
+ // Start of the date range (inclusive).
+ DateStart param.Field[time.Time] `query:"dateStart" format:"date-time"`
+ // Format results are returned in.
+ Format param.Field[TrafficAnomalyLocationGetParamsFormat] `query:"format"`
+ // Limit the number of objects in the response.
+ Limit param.Field[int64] `query:"limit"`
+ Status param.Field[TrafficAnomalyLocationGetParamsStatus] `query:"status"`
+}
+
+// URLQuery serializes [TrafficAnomalyLocationGetParams]'s query parameters as
+// `url.Values`.
+func (r TrafficAnomalyLocationGetParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Shorthand date ranges for the last X days - use when you don't need specific
+// start and end dates.
+type TrafficAnomalyLocationGetParamsDateRange string
+
+const (
+ TrafficAnomalyLocationGetParamsDateRange1d TrafficAnomalyLocationGetParamsDateRange = "1d"
+ TrafficAnomalyLocationGetParamsDateRange2d TrafficAnomalyLocationGetParamsDateRange = "2d"
+ TrafficAnomalyLocationGetParamsDateRange7d TrafficAnomalyLocationGetParamsDateRange = "7d"
+ TrafficAnomalyLocationGetParamsDateRange14d TrafficAnomalyLocationGetParamsDateRange = "14d"
+ TrafficAnomalyLocationGetParamsDateRange28d TrafficAnomalyLocationGetParamsDateRange = "28d"
+ TrafficAnomalyLocationGetParamsDateRange12w TrafficAnomalyLocationGetParamsDateRange = "12w"
+ TrafficAnomalyLocationGetParamsDateRange24w TrafficAnomalyLocationGetParamsDateRange = "24w"
+ TrafficAnomalyLocationGetParamsDateRange52w TrafficAnomalyLocationGetParamsDateRange = "52w"
+ TrafficAnomalyLocationGetParamsDateRange1dControl TrafficAnomalyLocationGetParamsDateRange = "1dControl"
+ TrafficAnomalyLocationGetParamsDateRange2dControl TrafficAnomalyLocationGetParamsDateRange = "2dControl"
+ TrafficAnomalyLocationGetParamsDateRange7dControl TrafficAnomalyLocationGetParamsDateRange = "7dControl"
+ TrafficAnomalyLocationGetParamsDateRange14dControl TrafficAnomalyLocationGetParamsDateRange = "14dControl"
+ TrafficAnomalyLocationGetParamsDateRange28dControl TrafficAnomalyLocationGetParamsDateRange = "28dControl"
+ TrafficAnomalyLocationGetParamsDateRange12wControl TrafficAnomalyLocationGetParamsDateRange = "12wControl"
+ TrafficAnomalyLocationGetParamsDateRange24wControl TrafficAnomalyLocationGetParamsDateRange = "24wControl"
+)
+
+// Format results are returned in.
+type TrafficAnomalyLocationGetParamsFormat string
+
+const (
+ TrafficAnomalyLocationGetParamsFormatJson TrafficAnomalyLocationGetParamsFormat = "JSON"
+ TrafficAnomalyLocationGetParamsFormatCsv TrafficAnomalyLocationGetParamsFormat = "CSV"
+)
+
+type TrafficAnomalyLocationGetParamsStatus string
+
+const (
+ TrafficAnomalyLocationGetParamsStatusVerified TrafficAnomalyLocationGetParamsStatus = "VERIFIED"
+ TrafficAnomalyLocationGetParamsStatusUnverified TrafficAnomalyLocationGetParamsStatus = "UNVERIFIED"
+)
+
+type TrafficAnomalyLocationGetResponseEnvelope struct {
+ Result TrafficAnomalyLocationGetResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON trafficAnomalyLocationGetResponseEnvelopeJSON `json:"-"`
+}
+
+// trafficAnomalyLocationGetResponseEnvelopeJSON contains the JSON metadata for the
+// struct [TrafficAnomalyLocationGetResponseEnvelope]
+type trafficAnomalyLocationGetResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *TrafficAnomalyLocationGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r trafficAnomalyLocationGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/radar/trafficanomalylocation_test.go b/radar/trafficanomalylocation_test.go
new file mode 100644
index 00000000000..89671cf2330
--- /dev/null
+++ b/radar/trafficanomalylocation_test.go
@@ -0,0 +1,47 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/radar"
+)
+
+func TestTrafficAnomalyLocationGetWithOptionalParams(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"),
+ )
+ _, err := client.Radar.TrafficAnomalies.Locations.Get(context.TODO(), radar.TrafficAnomalyLocationGetParams{
+ DateEnd: cloudflare.F(time.Now()),
+ DateRange: cloudflare.F(radar.TrafficAnomalyLocationGetParamsDateRange7d),
+ DateStart: cloudflare.F(time.Now()),
+ Format: cloudflare.F(radar.TrafficAnomalyLocationGetParamsFormatJson),
+ Limit: cloudflare.F(int64(5)),
+ Status: cloudflare.F(radar.TrafficAnomalyLocationGetParamsStatusVerified),
+ })
+ 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/radar/verifiedbot.go b/radar/verifiedbot.go
new file mode 100644
index 00000000000..efc73a04f66
--- /dev/null
+++ b/radar/verifiedbot.go
@@ -0,0 +1,27 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// VerifiedBotService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewVerifiedBotService] method
+// instead.
+type VerifiedBotService struct {
+ Options []option.RequestOption
+ Top *VerifiedBotTopService
+}
+
+// NewVerifiedBotService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewVerifiedBotService(opts ...option.RequestOption) (r *VerifiedBotService) {
+ r = &VerifiedBotService{}
+ r.Options = opts
+ r.Top = NewVerifiedBotTopService(opts...)
+ return
+}
diff --git a/radar/verifiedbottop.go b/radar/verifiedbottop.go
new file mode 100644
index 00000000000..5b023189c29
--- /dev/null
+++ b/radar/verifiedbottop.go
@@ -0,0 +1,544 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar
+
+import (
+ "context"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// VerifiedBotTopService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewVerifiedBotTopService] method
+// instead.
+type VerifiedBotTopService struct {
+ Options []option.RequestOption
+}
+
+// NewVerifiedBotTopService generates a new service that applies the given options
+// to each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewVerifiedBotTopService(opts ...option.RequestOption) (r *VerifiedBotTopService) {
+ r = &VerifiedBotTopService{}
+ r.Options = opts
+ return
+}
+
+// Get top verified bots by HTTP requests, with owner and category.
+func (r *VerifiedBotTopService) Bots(ctx context.Context, query VerifiedBotTopBotsParams, opts ...option.RequestOption) (res *VerifiedBotTopBotsResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env VerifiedBotTopBotsResponseEnvelope
+ path := "radar/verified_bots/top/bots"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Get top verified bot categories by HTTP requests, along with their corresponding
+// percentage, over the total verified bot HTTP requests.
+func (r *VerifiedBotTopService) Categories(ctx context.Context, query VerifiedBotTopCategoriesParams, opts ...option.RequestOption) (res *VerifiedBotTopCategoriesResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env VerifiedBotTopCategoriesResponseEnvelope
+ path := "radar/verified_bots/top/categories"
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type VerifiedBotTopBotsResponse struct {
+ Meta VerifiedBotTopBotsResponseMeta `json:"meta,required"`
+ Top0 []VerifiedBotTopBotsResponseTop0 `json:"top_0,required"`
+ JSON verifiedBotTopBotsResponseJSON `json:"-"`
+}
+
+// verifiedBotTopBotsResponseJSON contains the JSON metadata for the struct
+// [VerifiedBotTopBotsResponse]
+type verifiedBotTopBotsResponseJSON struct {
+ Meta apijson.Field
+ Top0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *VerifiedBotTopBotsResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r verifiedBotTopBotsResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type VerifiedBotTopBotsResponseMeta struct {
+ DateRange []VerifiedBotTopBotsResponseMetaDateRange `json:"dateRange,required"`
+ ConfidenceInfo VerifiedBotTopBotsResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON verifiedBotTopBotsResponseMetaJSON `json:"-"`
+}
+
+// verifiedBotTopBotsResponseMetaJSON contains the JSON metadata for the struct
+// [VerifiedBotTopBotsResponseMeta]
+type verifiedBotTopBotsResponseMetaJSON struct {
+ DateRange apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *VerifiedBotTopBotsResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r verifiedBotTopBotsResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type VerifiedBotTopBotsResponseMetaDateRange 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 verifiedBotTopBotsResponseMetaDateRangeJSON `json:"-"`
+}
+
+// verifiedBotTopBotsResponseMetaDateRangeJSON contains the JSON metadata for the
+// struct [VerifiedBotTopBotsResponseMetaDateRange]
+type verifiedBotTopBotsResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *VerifiedBotTopBotsResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r verifiedBotTopBotsResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type VerifiedBotTopBotsResponseMetaConfidenceInfo struct {
+ Annotations []VerifiedBotTopBotsResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON verifiedBotTopBotsResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// verifiedBotTopBotsResponseMetaConfidenceInfoJSON contains the JSON metadata for
+// the struct [VerifiedBotTopBotsResponseMetaConfidenceInfo]
+type verifiedBotTopBotsResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *VerifiedBotTopBotsResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r verifiedBotTopBotsResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type VerifiedBotTopBotsResponseMetaConfidenceInfoAnnotation 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 verifiedBotTopBotsResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// verifiedBotTopBotsResponseMetaConfidenceInfoAnnotationJSON contains the JSON
+// metadata for the struct [VerifiedBotTopBotsResponseMetaConfidenceInfoAnnotation]
+type verifiedBotTopBotsResponseMetaConfidenceInfoAnnotationJSON 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 *VerifiedBotTopBotsResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r verifiedBotTopBotsResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type VerifiedBotTopBotsResponseTop0 struct {
+ BotCategory string `json:"botCategory,required"`
+ BotName string `json:"botName,required"`
+ BotOwner string `json:"botOwner,required"`
+ Value string `json:"value,required"`
+ JSON verifiedBotTopBotsResponseTop0JSON `json:"-"`
+}
+
+// verifiedBotTopBotsResponseTop0JSON contains the JSON metadata for the struct
+// [VerifiedBotTopBotsResponseTop0]
+type verifiedBotTopBotsResponseTop0JSON struct {
+ BotCategory apijson.Field
+ BotName apijson.Field
+ BotOwner apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *VerifiedBotTopBotsResponseTop0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r verifiedBotTopBotsResponseTop0JSON) RawJSON() string {
+ return r.raw
+}
+
+type VerifiedBotTopCategoriesResponse struct {
+ Meta VerifiedBotTopCategoriesResponseMeta `json:"meta,required"`
+ Top0 []VerifiedBotTopCategoriesResponseTop0 `json:"top_0,required"`
+ JSON verifiedBotTopCategoriesResponseJSON `json:"-"`
+}
+
+// verifiedBotTopCategoriesResponseJSON contains the JSON metadata for the struct
+// [VerifiedBotTopCategoriesResponse]
+type verifiedBotTopCategoriesResponseJSON struct {
+ Meta apijson.Field
+ Top0 apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *VerifiedBotTopCategoriesResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r verifiedBotTopCategoriesResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type VerifiedBotTopCategoriesResponseMeta struct {
+ DateRange []VerifiedBotTopCategoriesResponseMetaDateRange `json:"dateRange,required"`
+ ConfidenceInfo VerifiedBotTopCategoriesResponseMetaConfidenceInfo `json:"confidenceInfo"`
+ JSON verifiedBotTopCategoriesResponseMetaJSON `json:"-"`
+}
+
+// verifiedBotTopCategoriesResponseMetaJSON contains the JSON metadata for the
+// struct [VerifiedBotTopCategoriesResponseMeta]
+type verifiedBotTopCategoriesResponseMetaJSON struct {
+ DateRange apijson.Field
+ ConfidenceInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *VerifiedBotTopCategoriesResponseMeta) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r verifiedBotTopCategoriesResponseMetaJSON) RawJSON() string {
+ return r.raw
+}
+
+type VerifiedBotTopCategoriesResponseMetaDateRange 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 verifiedBotTopCategoriesResponseMetaDateRangeJSON `json:"-"`
+}
+
+// verifiedBotTopCategoriesResponseMetaDateRangeJSON contains the JSON metadata for
+// the struct [VerifiedBotTopCategoriesResponseMetaDateRange]
+type verifiedBotTopCategoriesResponseMetaDateRangeJSON struct {
+ EndTime apijson.Field
+ StartTime apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *VerifiedBotTopCategoriesResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r verifiedBotTopCategoriesResponseMetaDateRangeJSON) RawJSON() string {
+ return r.raw
+}
+
+type VerifiedBotTopCategoriesResponseMetaConfidenceInfo struct {
+ Annotations []VerifiedBotTopCategoriesResponseMetaConfidenceInfoAnnotation `json:"annotations"`
+ Level int64 `json:"level"`
+ JSON verifiedBotTopCategoriesResponseMetaConfidenceInfoJSON `json:"-"`
+}
+
+// verifiedBotTopCategoriesResponseMetaConfidenceInfoJSON contains the JSON
+// metadata for the struct [VerifiedBotTopCategoriesResponseMetaConfidenceInfo]
+type verifiedBotTopCategoriesResponseMetaConfidenceInfoJSON struct {
+ Annotations apijson.Field
+ Level apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *VerifiedBotTopCategoriesResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r verifiedBotTopCategoriesResponseMetaConfidenceInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type VerifiedBotTopCategoriesResponseMetaConfidenceInfoAnnotation 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 verifiedBotTopCategoriesResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
+}
+
+// verifiedBotTopCategoriesResponseMetaConfidenceInfoAnnotationJSON contains the
+// JSON metadata for the struct
+// [VerifiedBotTopCategoriesResponseMetaConfidenceInfoAnnotation]
+type verifiedBotTopCategoriesResponseMetaConfidenceInfoAnnotationJSON 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 *VerifiedBotTopCategoriesResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r verifiedBotTopCategoriesResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
+ return r.raw
+}
+
+type VerifiedBotTopCategoriesResponseTop0 struct {
+ BotCategory string `json:"botCategory,required"`
+ Value string `json:"value,required"`
+ JSON verifiedBotTopCategoriesResponseTop0JSON `json:"-"`
+}
+
+// verifiedBotTopCategoriesResponseTop0JSON contains the JSON metadata for the
+// struct [VerifiedBotTopCategoriesResponseTop0]
+type verifiedBotTopCategoriesResponseTop0JSON struct {
+ BotCategory apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *VerifiedBotTopCategoriesResponseTop0) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r verifiedBotTopCategoriesResponseTop0JSON) RawJSON() string {
+ return r.raw
+}
+
+type VerifiedBotTopBotsParams 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"`
+ // 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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]VerifiedBotTopBotsParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Format results are returned in.
+ Format param.Field[VerifiedBotTopBotsParamsFormat] `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 [VerifiedBotTopBotsParams]'s query parameters as
+// `url.Values`.
+func (r VerifiedBotTopBotsParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type VerifiedBotTopBotsParamsDateRange string
+
+const (
+ VerifiedBotTopBotsParamsDateRange1d VerifiedBotTopBotsParamsDateRange = "1d"
+ VerifiedBotTopBotsParamsDateRange2d VerifiedBotTopBotsParamsDateRange = "2d"
+ VerifiedBotTopBotsParamsDateRange7d VerifiedBotTopBotsParamsDateRange = "7d"
+ VerifiedBotTopBotsParamsDateRange14d VerifiedBotTopBotsParamsDateRange = "14d"
+ VerifiedBotTopBotsParamsDateRange28d VerifiedBotTopBotsParamsDateRange = "28d"
+ VerifiedBotTopBotsParamsDateRange12w VerifiedBotTopBotsParamsDateRange = "12w"
+ VerifiedBotTopBotsParamsDateRange24w VerifiedBotTopBotsParamsDateRange = "24w"
+ VerifiedBotTopBotsParamsDateRange52w VerifiedBotTopBotsParamsDateRange = "52w"
+ VerifiedBotTopBotsParamsDateRange1dControl VerifiedBotTopBotsParamsDateRange = "1dControl"
+ VerifiedBotTopBotsParamsDateRange2dControl VerifiedBotTopBotsParamsDateRange = "2dControl"
+ VerifiedBotTopBotsParamsDateRange7dControl VerifiedBotTopBotsParamsDateRange = "7dControl"
+ VerifiedBotTopBotsParamsDateRange14dControl VerifiedBotTopBotsParamsDateRange = "14dControl"
+ VerifiedBotTopBotsParamsDateRange28dControl VerifiedBotTopBotsParamsDateRange = "28dControl"
+ VerifiedBotTopBotsParamsDateRange12wControl VerifiedBotTopBotsParamsDateRange = "12wControl"
+ VerifiedBotTopBotsParamsDateRange24wControl VerifiedBotTopBotsParamsDateRange = "24wControl"
+)
+
+// Format results are returned in.
+type VerifiedBotTopBotsParamsFormat string
+
+const (
+ VerifiedBotTopBotsParamsFormatJson VerifiedBotTopBotsParamsFormat = "JSON"
+ VerifiedBotTopBotsParamsFormatCsv VerifiedBotTopBotsParamsFormat = "CSV"
+)
+
+type VerifiedBotTopBotsResponseEnvelope struct {
+ Result VerifiedBotTopBotsResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON verifiedBotTopBotsResponseEnvelopeJSON `json:"-"`
+}
+
+// verifiedBotTopBotsResponseEnvelopeJSON contains the JSON metadata for the struct
+// [VerifiedBotTopBotsResponseEnvelope]
+type verifiedBotTopBotsResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *VerifiedBotTopBotsResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r verifiedBotTopBotsResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type VerifiedBotTopCategoriesParams 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"`
+ // 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
+ // week. Use this parameter or set specific start and end dates (`dateStart` and
+ // `dateEnd` parameters).
+ DateRange param.Field[[]VerifiedBotTopCategoriesParamsDateRange] `query:"dateRange"`
+ // Array of datetimes to filter the start of a series.
+ DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
+ // Format results are returned in.
+ Format param.Field[VerifiedBotTopCategoriesParamsFormat] `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 [VerifiedBotTopCategoriesParams]'s query parameters as
+// `url.Values`.
+func (r VerifiedBotTopCategoriesParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type VerifiedBotTopCategoriesParamsDateRange string
+
+const (
+ VerifiedBotTopCategoriesParamsDateRange1d VerifiedBotTopCategoriesParamsDateRange = "1d"
+ VerifiedBotTopCategoriesParamsDateRange2d VerifiedBotTopCategoriesParamsDateRange = "2d"
+ VerifiedBotTopCategoriesParamsDateRange7d VerifiedBotTopCategoriesParamsDateRange = "7d"
+ VerifiedBotTopCategoriesParamsDateRange14d VerifiedBotTopCategoriesParamsDateRange = "14d"
+ VerifiedBotTopCategoriesParamsDateRange28d VerifiedBotTopCategoriesParamsDateRange = "28d"
+ VerifiedBotTopCategoriesParamsDateRange12w VerifiedBotTopCategoriesParamsDateRange = "12w"
+ VerifiedBotTopCategoriesParamsDateRange24w VerifiedBotTopCategoriesParamsDateRange = "24w"
+ VerifiedBotTopCategoriesParamsDateRange52w VerifiedBotTopCategoriesParamsDateRange = "52w"
+ VerifiedBotTopCategoriesParamsDateRange1dControl VerifiedBotTopCategoriesParamsDateRange = "1dControl"
+ VerifiedBotTopCategoriesParamsDateRange2dControl VerifiedBotTopCategoriesParamsDateRange = "2dControl"
+ VerifiedBotTopCategoriesParamsDateRange7dControl VerifiedBotTopCategoriesParamsDateRange = "7dControl"
+ VerifiedBotTopCategoriesParamsDateRange14dControl VerifiedBotTopCategoriesParamsDateRange = "14dControl"
+ VerifiedBotTopCategoriesParamsDateRange28dControl VerifiedBotTopCategoriesParamsDateRange = "28dControl"
+ VerifiedBotTopCategoriesParamsDateRange12wControl VerifiedBotTopCategoriesParamsDateRange = "12wControl"
+ VerifiedBotTopCategoriesParamsDateRange24wControl VerifiedBotTopCategoriesParamsDateRange = "24wControl"
+)
+
+// Format results are returned in.
+type VerifiedBotTopCategoriesParamsFormat string
+
+const (
+ VerifiedBotTopCategoriesParamsFormatJson VerifiedBotTopCategoriesParamsFormat = "JSON"
+ VerifiedBotTopCategoriesParamsFormatCsv VerifiedBotTopCategoriesParamsFormat = "CSV"
+)
+
+type VerifiedBotTopCategoriesResponseEnvelope struct {
+ Result VerifiedBotTopCategoriesResponse `json:"result,required"`
+ Success bool `json:"success,required"`
+ JSON verifiedBotTopCategoriesResponseEnvelopeJSON `json:"-"`
+}
+
+// verifiedBotTopCategoriesResponseEnvelopeJSON contains the JSON metadata for the
+// struct [VerifiedBotTopCategoriesResponseEnvelope]
+type verifiedBotTopCategoriesResponseEnvelopeJSON struct {
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *VerifiedBotTopCategoriesResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r verifiedBotTopCategoriesResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/radar/verifiedbottop_test.go b/radar/verifiedbottop_test.go
new file mode 100644
index 00000000000..2c40bccf6e2
--- /dev/null
+++ b/radar/verifiedbottop_test.go
@@ -0,0 +1,84 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package radar_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/radar"
+)
+
+func TestVerifiedBotTopBotsWithOptionalParams(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"),
+ )
+ _, err := client.Radar.VerifiedBots.Top.Bots(context.TODO(), radar.VerifiedBotTopBotsParams{
+ 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([]radar.VerifiedBotTopBotsParamsDateRange{radar.VerifiedBotTopBotsParamsDateRange1d, radar.VerifiedBotTopBotsParamsDateRange2d, radar.VerifiedBotTopBotsParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Format: cloudflare.F(radar.VerifiedBotTopBotsParamsFormatJson),
+ 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())
+ }
+}
+
+func TestVerifiedBotTopCategoriesWithOptionalParams(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"),
+ )
+ _, err := client.Radar.VerifiedBots.Top.Categories(context.TODO(), radar.VerifiedBotTopCategoriesParams{
+ 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([]radar.VerifiedBotTopCategoriesParamsDateRange{radar.VerifiedBotTopCategoriesParamsDateRange1d, radar.VerifiedBotTopCategoriesParamsDateRange2d, radar.VerifiedBotTopCategoriesParamsDateRange7d}),
+ DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
+ Format: cloudflare.F(radar.VerifiedBotTopCategoriesParamsFormatJson),
+ 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/radarannotation.go b/radarannotation.go
deleted file mode 100644
index 517e6018591..00000000000
--- a/radarannotation.go
+++ /dev/null
@@ -1,27 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarAnnotationService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewRadarAnnotationService] method
-// instead.
-type RadarAnnotationService struct {
- Options []option.RequestOption
- Outages *RadarAnnotationOutageService
-}
-
-// NewRadarAnnotationService generates a new service that applies the given options
-// to each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewRadarAnnotationService(opts ...option.RequestOption) (r *RadarAnnotationService) {
- r = &RadarAnnotationService{}
- r.Options = opts
- r.Outages = NewRadarAnnotationOutageService(opts...)
- return
-}
diff --git a/radarannotationoutage.go b/radarannotationoutage.go
deleted file mode 100644
index 71beef567e2..00000000000
--- a/radarannotationoutage.go
+++ /dev/null
@@ -1,426 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarAnnotationOutageService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewRadarAnnotationOutageService]
-// method instead.
-type RadarAnnotationOutageService struct {
- Options []option.RequestOption
-}
-
-// NewRadarAnnotationOutageService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewRadarAnnotationOutageService(opts ...option.RequestOption) (r *RadarAnnotationOutageService) {
- r = &RadarAnnotationOutageService{}
- r.Options = opts
- return
-}
-
-// Get latest Internet outages and anomalies.
-func (r *RadarAnnotationOutageService) Get(ctx context.Context, query RadarAnnotationOutageGetParams, opts ...option.RequestOption) (res *RadarAnnotationOutageGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarAnnotationOutageGetResponseEnvelope
- path := "radar/annotations/outages"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Get the number of outages for locations.
-func (r *RadarAnnotationOutageService) Locations(ctx context.Context, query RadarAnnotationOutageLocationsParams, opts ...option.RequestOption) (res *RadarAnnotationOutageLocationsResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarAnnotationOutageLocationsResponseEnvelope
- path := "radar/annotations/outages/locations"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type RadarAnnotationOutageGetResponse struct {
- Annotations []RadarAnnotationOutageGetResponseAnnotation `json:"annotations,required"`
- JSON radarAnnotationOutageGetResponseJSON `json:"-"`
-}
-
-// radarAnnotationOutageGetResponseJSON contains the JSON metadata for the struct
-// [RadarAnnotationOutageGetResponse]
-type radarAnnotationOutageGetResponseJSON struct {
- Annotations apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAnnotationOutageGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAnnotationOutageGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAnnotationOutageGetResponseAnnotation struct {
- ID string `json:"id,required"`
- ASNs []int64 `json:"asns,required"`
- ASNsDetails []RadarAnnotationOutageGetResponseAnnotationsASNsDetail `json:"asnsDetails,required"`
- DataSource string `json:"dataSource,required"`
- EventType string `json:"eventType,required"`
- Locations []string `json:"locations,required"`
- LocationsDetails []RadarAnnotationOutageGetResponseAnnotationsLocationsDetail `json:"locationsDetails,required"`
- Outage RadarAnnotationOutageGetResponseAnnotationsOutage `json:"outage,required"`
- StartDate string `json:"startDate,required"`
- Description string `json:"description"`
- EndDate string `json:"endDate"`
- LinkedURL string `json:"linkedUrl"`
- Scope string `json:"scope"`
- JSON radarAnnotationOutageGetResponseAnnotationJSON `json:"-"`
-}
-
-// radarAnnotationOutageGetResponseAnnotationJSON contains the JSON metadata for
-// the struct [RadarAnnotationOutageGetResponseAnnotation]
-type radarAnnotationOutageGetResponseAnnotationJSON struct {
- ID apijson.Field
- ASNs apijson.Field
- ASNsDetails apijson.Field
- DataSource apijson.Field
- EventType apijson.Field
- Locations apijson.Field
- LocationsDetails apijson.Field
- Outage apijson.Field
- StartDate apijson.Field
- Description apijson.Field
- EndDate apijson.Field
- LinkedURL apijson.Field
- Scope apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAnnotationOutageGetResponseAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAnnotationOutageGetResponseAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAnnotationOutageGetResponseAnnotationsASNsDetail struct {
- ASN string `json:"asn,required"`
- Name string `json:"name,required"`
- Locations RadarAnnotationOutageGetResponseAnnotationsASNsDetailsLocations `json:"locations"`
- JSON radarAnnotationOutageGetResponseAnnotationsASNsDetailJSON `json:"-"`
-}
-
-// radarAnnotationOutageGetResponseAnnotationsASNsDetailJSON contains the JSON
-// metadata for the struct [RadarAnnotationOutageGetResponseAnnotationsASNsDetail]
-type radarAnnotationOutageGetResponseAnnotationsASNsDetailJSON struct {
- ASN apijson.Field
- Name apijson.Field
- Locations apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAnnotationOutageGetResponseAnnotationsASNsDetail) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAnnotationOutageGetResponseAnnotationsASNsDetailJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAnnotationOutageGetResponseAnnotationsASNsDetailsLocations struct {
- Code string `json:"code,required"`
- Name string `json:"name,required"`
- JSON radarAnnotationOutageGetResponseAnnotationsASNsDetailsLocationsJSON `json:"-"`
-}
-
-// radarAnnotationOutageGetResponseAnnotationsASNsDetailsLocationsJSON contains the
-// JSON metadata for the struct
-// [RadarAnnotationOutageGetResponseAnnotationsASNsDetailsLocations]
-type radarAnnotationOutageGetResponseAnnotationsASNsDetailsLocationsJSON struct {
- Code apijson.Field
- Name apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAnnotationOutageGetResponseAnnotationsASNsDetailsLocations) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAnnotationOutageGetResponseAnnotationsASNsDetailsLocationsJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAnnotationOutageGetResponseAnnotationsLocationsDetail struct {
- Code string `json:"code,required"`
- Name string `json:"name,required"`
- JSON radarAnnotationOutageGetResponseAnnotationsLocationsDetailJSON `json:"-"`
-}
-
-// radarAnnotationOutageGetResponseAnnotationsLocationsDetailJSON contains the JSON
-// metadata for the struct
-// [RadarAnnotationOutageGetResponseAnnotationsLocationsDetail]
-type radarAnnotationOutageGetResponseAnnotationsLocationsDetailJSON struct {
- Code apijson.Field
- Name apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAnnotationOutageGetResponseAnnotationsLocationsDetail) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAnnotationOutageGetResponseAnnotationsLocationsDetailJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAnnotationOutageGetResponseAnnotationsOutage struct {
- OutageCause string `json:"outageCause,required"`
- OutageType string `json:"outageType,required"`
- JSON radarAnnotationOutageGetResponseAnnotationsOutageJSON `json:"-"`
-}
-
-// radarAnnotationOutageGetResponseAnnotationsOutageJSON contains the JSON metadata
-// for the struct [RadarAnnotationOutageGetResponseAnnotationsOutage]
-type radarAnnotationOutageGetResponseAnnotationsOutageJSON struct {
- OutageCause apijson.Field
- OutageType apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAnnotationOutageGetResponseAnnotationsOutage) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAnnotationOutageGetResponseAnnotationsOutageJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAnnotationOutageLocationsResponse struct {
- Annotations []RadarAnnotationOutageLocationsResponseAnnotation `json:"annotations,required"`
- JSON radarAnnotationOutageLocationsResponseJSON `json:"-"`
-}
-
-// radarAnnotationOutageLocationsResponseJSON contains the JSON metadata for the
-// struct [RadarAnnotationOutageLocationsResponse]
-type radarAnnotationOutageLocationsResponseJSON struct {
- Annotations apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAnnotationOutageLocationsResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAnnotationOutageLocationsResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAnnotationOutageLocationsResponseAnnotation struct {
- ClientCountryAlpha2 string `json:"clientCountryAlpha2,required"`
- ClientCountryName string `json:"clientCountryName,required"`
- Value string `json:"value,required"`
- JSON radarAnnotationOutageLocationsResponseAnnotationJSON `json:"-"`
-}
-
-// radarAnnotationOutageLocationsResponseAnnotationJSON contains the JSON metadata
-// for the struct [RadarAnnotationOutageLocationsResponseAnnotation]
-type radarAnnotationOutageLocationsResponseAnnotationJSON struct {
- ClientCountryAlpha2 apijson.Field
- ClientCountryName apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAnnotationOutageLocationsResponseAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAnnotationOutageLocationsResponseAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAnnotationOutageGetParams struct {
- // Single ASN as integer.
- ASN param.Field[int64] `query:"asn"`
- // End of the date range (inclusive).
- DateEnd param.Field[time.Time] `query:"dateEnd" format:"date-time"`
- // Shorthand date ranges for the last X days - use when you don't need specific
- // start and end dates.
- DateRange param.Field[RadarAnnotationOutageGetParamsDateRange] `query:"dateRange"`
- // Start of the date range (inclusive).
- DateStart param.Field[time.Time] `query:"dateStart" format:"date-time"`
- // Format results are returned in.
- Format param.Field[RadarAnnotationOutageGetParamsFormat] `query:"format"`
- // Limit the number of objects in the response.
- Limit param.Field[int64] `query:"limit"`
- // Location Alpha2 code.
- Location param.Field[string] `query:"location"`
- // Number of objects to skip before grabbing results.
- Offset param.Field[int64] `query:"offset"`
-}
-
-// URLQuery serializes [RadarAnnotationOutageGetParams]'s query parameters as
-// `url.Values`.
-func (r RadarAnnotationOutageGetParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Shorthand date ranges for the last X days - use when you don't need specific
-// start and end dates.
-type RadarAnnotationOutageGetParamsDateRange string
-
-const (
- RadarAnnotationOutageGetParamsDateRange1d RadarAnnotationOutageGetParamsDateRange = "1d"
- RadarAnnotationOutageGetParamsDateRange2d RadarAnnotationOutageGetParamsDateRange = "2d"
- RadarAnnotationOutageGetParamsDateRange7d RadarAnnotationOutageGetParamsDateRange = "7d"
- RadarAnnotationOutageGetParamsDateRange14d RadarAnnotationOutageGetParamsDateRange = "14d"
- RadarAnnotationOutageGetParamsDateRange28d RadarAnnotationOutageGetParamsDateRange = "28d"
- RadarAnnotationOutageGetParamsDateRange12w RadarAnnotationOutageGetParamsDateRange = "12w"
- RadarAnnotationOutageGetParamsDateRange24w RadarAnnotationOutageGetParamsDateRange = "24w"
- RadarAnnotationOutageGetParamsDateRange52w RadarAnnotationOutageGetParamsDateRange = "52w"
- RadarAnnotationOutageGetParamsDateRange1dControl RadarAnnotationOutageGetParamsDateRange = "1dControl"
- RadarAnnotationOutageGetParamsDateRange2dControl RadarAnnotationOutageGetParamsDateRange = "2dControl"
- RadarAnnotationOutageGetParamsDateRange7dControl RadarAnnotationOutageGetParamsDateRange = "7dControl"
- RadarAnnotationOutageGetParamsDateRange14dControl RadarAnnotationOutageGetParamsDateRange = "14dControl"
- RadarAnnotationOutageGetParamsDateRange28dControl RadarAnnotationOutageGetParamsDateRange = "28dControl"
- RadarAnnotationOutageGetParamsDateRange12wControl RadarAnnotationOutageGetParamsDateRange = "12wControl"
- RadarAnnotationOutageGetParamsDateRange24wControl RadarAnnotationOutageGetParamsDateRange = "24wControl"
-)
-
-// Format results are returned in.
-type RadarAnnotationOutageGetParamsFormat string
-
-const (
- RadarAnnotationOutageGetParamsFormatJson RadarAnnotationOutageGetParamsFormat = "JSON"
- RadarAnnotationOutageGetParamsFormatCsv RadarAnnotationOutageGetParamsFormat = "CSV"
-)
-
-type RadarAnnotationOutageGetResponseEnvelope struct {
- Result RadarAnnotationOutageGetResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarAnnotationOutageGetResponseEnvelopeJSON `json:"-"`
-}
-
-// radarAnnotationOutageGetResponseEnvelopeJSON contains the JSON metadata for the
-// struct [RadarAnnotationOutageGetResponseEnvelope]
-type radarAnnotationOutageGetResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAnnotationOutageGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAnnotationOutageGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAnnotationOutageLocationsParams struct {
- // End of the date range (inclusive).
- DateEnd param.Field[time.Time] `query:"dateEnd" format:"date-time"`
- // Shorthand date ranges for the last X days - use when you don't need specific
- // start and end dates.
- DateRange param.Field[RadarAnnotationOutageLocationsParamsDateRange] `query:"dateRange"`
- // Start of the date range (inclusive).
- DateStart param.Field[time.Time] `query:"dateStart" format:"date-time"`
- // Format results are returned in.
- Format param.Field[RadarAnnotationOutageLocationsParamsFormat] `query:"format"`
- // Limit the number of objects in the response.
- Limit param.Field[int64] `query:"limit"`
-}
-
-// URLQuery serializes [RadarAnnotationOutageLocationsParams]'s query parameters as
-// `url.Values`.
-func (r RadarAnnotationOutageLocationsParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Shorthand date ranges for the last X days - use when you don't need specific
-// start and end dates.
-type RadarAnnotationOutageLocationsParamsDateRange string
-
-const (
- RadarAnnotationOutageLocationsParamsDateRange1d RadarAnnotationOutageLocationsParamsDateRange = "1d"
- RadarAnnotationOutageLocationsParamsDateRange2d RadarAnnotationOutageLocationsParamsDateRange = "2d"
- RadarAnnotationOutageLocationsParamsDateRange7d RadarAnnotationOutageLocationsParamsDateRange = "7d"
- RadarAnnotationOutageLocationsParamsDateRange14d RadarAnnotationOutageLocationsParamsDateRange = "14d"
- RadarAnnotationOutageLocationsParamsDateRange28d RadarAnnotationOutageLocationsParamsDateRange = "28d"
- RadarAnnotationOutageLocationsParamsDateRange12w RadarAnnotationOutageLocationsParamsDateRange = "12w"
- RadarAnnotationOutageLocationsParamsDateRange24w RadarAnnotationOutageLocationsParamsDateRange = "24w"
- RadarAnnotationOutageLocationsParamsDateRange52w RadarAnnotationOutageLocationsParamsDateRange = "52w"
- RadarAnnotationOutageLocationsParamsDateRange1dControl RadarAnnotationOutageLocationsParamsDateRange = "1dControl"
- RadarAnnotationOutageLocationsParamsDateRange2dControl RadarAnnotationOutageLocationsParamsDateRange = "2dControl"
- RadarAnnotationOutageLocationsParamsDateRange7dControl RadarAnnotationOutageLocationsParamsDateRange = "7dControl"
- RadarAnnotationOutageLocationsParamsDateRange14dControl RadarAnnotationOutageLocationsParamsDateRange = "14dControl"
- RadarAnnotationOutageLocationsParamsDateRange28dControl RadarAnnotationOutageLocationsParamsDateRange = "28dControl"
- RadarAnnotationOutageLocationsParamsDateRange12wControl RadarAnnotationOutageLocationsParamsDateRange = "12wControl"
- RadarAnnotationOutageLocationsParamsDateRange24wControl RadarAnnotationOutageLocationsParamsDateRange = "24wControl"
-)
-
-// Format results are returned in.
-type RadarAnnotationOutageLocationsParamsFormat string
-
-const (
- RadarAnnotationOutageLocationsParamsFormatJson RadarAnnotationOutageLocationsParamsFormat = "JSON"
- RadarAnnotationOutageLocationsParamsFormatCsv RadarAnnotationOutageLocationsParamsFormat = "CSV"
-)
-
-type RadarAnnotationOutageLocationsResponseEnvelope struct {
- Result RadarAnnotationOutageLocationsResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarAnnotationOutageLocationsResponseEnvelopeJSON `json:"-"`
-}
-
-// radarAnnotationOutageLocationsResponseEnvelopeJSON contains the JSON metadata
-// for the struct [RadarAnnotationOutageLocationsResponseEnvelope]
-type radarAnnotationOutageLocationsResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAnnotationOutageLocationsResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAnnotationOutageLocationsResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
diff --git a/radarannotationoutage_test.go b/radarannotationoutage_test.go
deleted file mode 100644
index 2422d7a63a3..00000000000
--- a/radarannotationoutage_test.go
+++ /dev/null
@@ -1,78 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
- "time"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRadarAnnotationOutageGetWithOptionalParams(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"),
- )
- _, err := client.Radar.Annotations.Outages.Get(context.TODO(), cloudflare.RadarAnnotationOutageGetParams{
- ASN: cloudflare.F(int64(0)),
- DateEnd: cloudflare.F(time.Now()),
- DateRange: cloudflare.F(cloudflare.RadarAnnotationOutageGetParamsDateRange7d),
- DateStart: cloudflare.F(time.Now()),
- Format: cloudflare.F(cloudflare.RadarAnnotationOutageGetParamsFormatJson),
- Limit: cloudflare.F(int64(5)),
- Location: cloudflare.F("US"),
- Offset: cloudflare.F(int64(0)),
- })
- 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())
- }
-}
-
-func TestRadarAnnotationOutageLocationsWithOptionalParams(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"),
- )
- _, err := client.Radar.Annotations.Outages.Locations(context.TODO(), cloudflare.RadarAnnotationOutageLocationsParams{
- DateEnd: cloudflare.F(time.Now()),
- DateRange: cloudflare.F(cloudflare.RadarAnnotationOutageLocationsParamsDateRange7d),
- DateStart: cloudflare.F(time.Now()),
- Format: cloudflare.F(cloudflare.RadarAnnotationOutageLocationsParamsFormatJson),
- Limit: cloudflare.F(int64(5)),
- })
- 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/radaras112.go b/radaras112.go
deleted file mode 100644
index c39a3a0989a..00000000000
--- a/radaras112.go
+++ /dev/null
@@ -1,310 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarAS112Service contains methods and other services that help with interacting
-// with the cloudflare API. Note, unlike clients, this service does not read
-// variables from the environment automatically. You should not instantiate this
-// service directly, and instead use the [NewRadarAS112Service] method instead.
-type RadarAS112Service struct {
- Options []option.RequestOption
- Summary *RadarAS112SummaryService
- TimeseriesGroups *RadarAS112TimeseriesGroupService
- Top *RadarAS112TopService
-}
-
-// NewRadarAS112Service generates a new service that applies the given options to
-// each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewRadarAS112Service(opts ...option.RequestOption) (r *RadarAS112Service) {
- r = &RadarAS112Service{}
- r.Options = opts
- r.Summary = NewRadarAS112SummaryService(opts...)
- r.TimeseriesGroups = NewRadarAS112TimeseriesGroupService(opts...)
- r.Top = NewRadarAS112TopService(opts...)
- return
-}
-
-// Get AS112 queries change over time.
-func (r *RadarAS112Service) Timeseries(ctx context.Context, query RadarAS112TimeseriesParams, opts ...option.RequestOption) (res *RadarAS112TimeseriesResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarAS112TimeseriesResponseEnvelope
- path := "radar/as112/timeseries"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type RadarAS112TimeseriesResponse struct {
- Meta RadarAS112TimeseriesResponseMeta `json:"meta,required"`
- Serie0 RadarAS112TimeseriesResponseSerie0 `json:"serie_0,required"`
- JSON radarAS112TimeseriesResponseJSON `json:"-"`
-}
-
-// radarAS112TimeseriesResponseJSON contains the JSON metadata for the struct
-// [RadarAS112TimeseriesResponse]
-type radarAS112TimeseriesResponseJSON struct {
- Meta apijson.Field
- Serie0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112TimeseriesResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112TimeseriesResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112TimeseriesResponseMeta struct {
- AggInterval string `json:"aggInterval,required"`
- DateRange []RadarAS112TimeseriesResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated time.Time `json:"lastUpdated,required" format:"date-time"`
- ConfidenceInfo RadarAS112TimeseriesResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarAS112TimeseriesResponseMetaJSON `json:"-"`
-}
-
-// radarAS112TimeseriesResponseMetaJSON contains the JSON metadata for the struct
-// [RadarAS112TimeseriesResponseMeta]
-type radarAS112TimeseriesResponseMetaJSON struct {
- AggInterval apijson.Field
- DateRange apijson.Field
- LastUpdated apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112TimeseriesResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112TimeseriesResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112TimeseriesResponseMetaDateRange 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 radarAS112TimeseriesResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarAS112TimeseriesResponseMetaDateRangeJSON contains the JSON metadata for the
-// struct [RadarAS112TimeseriesResponseMetaDateRange]
-type radarAS112TimeseriesResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112TimeseriesResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112TimeseriesResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112TimeseriesResponseMetaConfidenceInfo struct {
- Annotations []RadarAS112TimeseriesResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarAS112TimeseriesResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarAS112TimeseriesResponseMetaConfidenceInfoJSON contains the JSON metadata
-// for the struct [RadarAS112TimeseriesResponseMetaConfidenceInfo]
-type radarAS112TimeseriesResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112TimeseriesResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112TimeseriesResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112TimeseriesResponseMetaConfidenceInfoAnnotation 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 radarAS112TimeseriesResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarAS112TimeseriesResponseMetaConfidenceInfoAnnotationJSON contains the JSON
-// metadata for the struct
-// [RadarAS112TimeseriesResponseMetaConfidenceInfoAnnotation]
-type radarAS112TimeseriesResponseMetaConfidenceInfoAnnotationJSON 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 *RadarAS112TimeseriesResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112TimeseriesResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112TimeseriesResponseSerie0 struct {
- Timestamps []time.Time `json:"timestamps,required" format:"date-time"`
- Values []string `json:"values,required"`
- JSON radarAS112TimeseriesResponseSerie0JSON `json:"-"`
-}
-
-// radarAS112TimeseriesResponseSerie0JSON contains the JSON metadata for the struct
-// [RadarAS112TimeseriesResponseSerie0]
-type radarAS112TimeseriesResponseSerie0JSON struct {
- Timestamps apijson.Field
- Values apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112TimeseriesResponseSerie0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112TimeseriesResponseSerie0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112TimeseriesParams struct {
- // Aggregation interval results should be returned in (for example, in 15 minutes
- // or 1 hour intervals). Refer to
- // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
- AggInterval param.Field[RadarAS112TimeseriesParamsAggInterval] `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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarAS112TimeseriesParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Format results are returned in.
- Format param.Field[RadarAS112TimeseriesParamsFormat] `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"`
-}
-
-// URLQuery serializes [RadarAS112TimeseriesParams]'s query parameters as
-// `url.Values`.
-func (r RadarAS112TimeseriesParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Aggregation interval results should be returned in (for example, in 15 minutes
-// or 1 hour intervals). Refer to
-// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
-type RadarAS112TimeseriesParamsAggInterval string
-
-const (
- RadarAS112TimeseriesParamsAggInterval15m RadarAS112TimeseriesParamsAggInterval = "15m"
- RadarAS112TimeseriesParamsAggInterval1h RadarAS112TimeseriesParamsAggInterval = "1h"
- RadarAS112TimeseriesParamsAggInterval1d RadarAS112TimeseriesParamsAggInterval = "1d"
- RadarAS112TimeseriesParamsAggInterval1w RadarAS112TimeseriesParamsAggInterval = "1w"
-)
-
-type RadarAS112TimeseriesParamsDateRange string
-
-const (
- RadarAS112TimeseriesParamsDateRange1d RadarAS112TimeseriesParamsDateRange = "1d"
- RadarAS112TimeseriesParamsDateRange2d RadarAS112TimeseriesParamsDateRange = "2d"
- RadarAS112TimeseriesParamsDateRange7d RadarAS112TimeseriesParamsDateRange = "7d"
- RadarAS112TimeseriesParamsDateRange14d RadarAS112TimeseriesParamsDateRange = "14d"
- RadarAS112TimeseriesParamsDateRange28d RadarAS112TimeseriesParamsDateRange = "28d"
- RadarAS112TimeseriesParamsDateRange12w RadarAS112TimeseriesParamsDateRange = "12w"
- RadarAS112TimeseriesParamsDateRange24w RadarAS112TimeseriesParamsDateRange = "24w"
- RadarAS112TimeseriesParamsDateRange52w RadarAS112TimeseriesParamsDateRange = "52w"
- RadarAS112TimeseriesParamsDateRange1dControl RadarAS112TimeseriesParamsDateRange = "1dControl"
- RadarAS112TimeseriesParamsDateRange2dControl RadarAS112TimeseriesParamsDateRange = "2dControl"
- RadarAS112TimeseriesParamsDateRange7dControl RadarAS112TimeseriesParamsDateRange = "7dControl"
- RadarAS112TimeseriesParamsDateRange14dControl RadarAS112TimeseriesParamsDateRange = "14dControl"
- RadarAS112TimeseriesParamsDateRange28dControl RadarAS112TimeseriesParamsDateRange = "28dControl"
- RadarAS112TimeseriesParamsDateRange12wControl RadarAS112TimeseriesParamsDateRange = "12wControl"
- RadarAS112TimeseriesParamsDateRange24wControl RadarAS112TimeseriesParamsDateRange = "24wControl"
-)
-
-// Format results are returned in.
-type RadarAS112TimeseriesParamsFormat string
-
-const (
- RadarAS112TimeseriesParamsFormatJson RadarAS112TimeseriesParamsFormat = "JSON"
- RadarAS112TimeseriesParamsFormatCsv RadarAS112TimeseriesParamsFormat = "CSV"
-)
-
-type RadarAS112TimeseriesResponseEnvelope struct {
- Result RadarAS112TimeseriesResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarAS112TimeseriesResponseEnvelopeJSON `json:"-"`
-}
-
-// radarAS112TimeseriesResponseEnvelopeJSON contains the JSON metadata for the
-// struct [RadarAS112TimeseriesResponseEnvelope]
-type radarAS112TimeseriesResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112TimeseriesResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112TimeseriesResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
diff --git a/radaras112_test.go b/radaras112_test.go
deleted file mode 100644
index fc1addb1323..00000000000
--- a/radaras112_test.go
+++ /dev/null
@@ -1,49 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
- "time"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRadarAS112TimeseriesWithOptionalParams(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"),
- )
- _, 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()}),
- Format: cloudflare.F(cloudflare.RadarAS112TimeseriesParamsFormatJson),
- 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/radaras112summary.go b/radaras112summary.go
deleted file mode 100644
index d7cf2f3d9be..00000000000
--- a/radaras112summary.go
+++ /dev/null
@@ -1,1571 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarAS112SummaryService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewRadarAS112SummaryService] method
-// instead.
-type RadarAS112SummaryService struct {
- Options []option.RequestOption
-}
-
-// NewRadarAS112SummaryService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewRadarAS112SummaryService(opts ...option.RequestOption) (r *RadarAS112SummaryService) {
- r = &RadarAS112SummaryService{}
- r.Options = opts
- return
-}
-
-// Percentage distribution of DNS queries to AS112 by DNSSEC support.
-func (r *RadarAS112SummaryService) DNSSEC(ctx context.Context, query RadarAS112SummaryDNSSECParams, opts ...option.RequestOption) (res *RadarAS112SummaryDNSSECResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarAS112SummaryDNSSECResponseEnvelope
- path := "radar/as112/summary/dnssec"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Percentage distribution of DNS queries, to AS112, by EDNS support.
-func (r *RadarAS112SummaryService) Edns(ctx context.Context, query RadarAS112SummaryEdnsParams, opts ...option.RequestOption) (res *RadarAS112SummaryEdnsResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarAS112SummaryEdnsResponseEnvelope
- path := "radar/as112/summary/edns"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Percentage distribution of DNS queries to AS112 per IP Version.
-func (r *RadarAS112SummaryService) IPVersion(ctx context.Context, query RadarAS112SummaryIPVersionParams, opts ...option.RequestOption) (res *RadarAS112SummaryIPVersionResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarAS112SummaryIPVersionResponseEnvelope
- path := "radar/as112/summary/ip_version"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Percentage distribution of DNS queries to AS112 per protocol.
-func (r *RadarAS112SummaryService) Protocol(ctx context.Context, query RadarAS112SummaryProtocolParams, opts ...option.RequestOption) (res *RadarAS112SummaryProtocolResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarAS112SummaryProtocolResponseEnvelope
- path := "radar/as112/summary/protocol"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Percentage distribution of DNS queries to AS112 by Query Type.
-func (r *RadarAS112SummaryService) QueryType(ctx context.Context, query RadarAS112SummaryQueryTypeParams, opts ...option.RequestOption) (res *RadarAS112SummaryQueryTypeResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarAS112SummaryQueryTypeResponseEnvelope
- path := "radar/as112/summary/query_type"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Percentage distribution of AS112 dns requests classified per Response Codes.
-func (r *RadarAS112SummaryService) ResponseCodes(ctx context.Context, query RadarAS112SummaryResponseCodesParams, opts ...option.RequestOption) (res *RadarAS112SummaryResponseCodesResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarAS112SummaryResponseCodesResponseEnvelope
- path := "radar/as112/summary/response_codes"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type RadarAS112SummaryDNSSECResponse struct {
- Meta RadarAS112SummaryDNSSECResponseMeta `json:"meta,required"`
- Summary0 RadarAS112SummaryDNSSECResponseSummary0 `json:"summary_0,required"`
- JSON radarAS112SummaryDNSSECResponseJSON `json:"-"`
-}
-
-// radarAS112SummaryDNSSECResponseJSON contains the JSON metadata for the struct
-// [RadarAS112SummaryDNSSECResponse]
-type radarAS112SummaryDNSSECResponseJSON struct {
- Meta apijson.Field
- Summary0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112SummaryDNSSECResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112SummaryDNSSECResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112SummaryDNSSECResponseMeta struct {
- DateRange []RadarAS112SummaryDNSSECResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- Normalization string `json:"normalization,required"`
- ConfidenceInfo RadarAS112SummaryDNSSECResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarAS112SummaryDNSSECResponseMetaJSON `json:"-"`
-}
-
-// radarAS112SummaryDNSSECResponseMetaJSON contains the JSON metadata for the
-// struct [RadarAS112SummaryDNSSECResponseMeta]
-type radarAS112SummaryDNSSECResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- Normalization apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112SummaryDNSSECResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112SummaryDNSSECResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112SummaryDNSSECResponseMetaDateRange 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 radarAS112SummaryDNSSECResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarAS112SummaryDNSSECResponseMetaDateRangeJSON contains the JSON metadata for
-// the struct [RadarAS112SummaryDNSSECResponseMetaDateRange]
-type radarAS112SummaryDNSSECResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112SummaryDNSSECResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112SummaryDNSSECResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112SummaryDNSSECResponseMetaConfidenceInfo struct {
- Annotations []RadarAS112SummaryDNSSECResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarAS112SummaryDNSSECResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarAS112SummaryDNSSECResponseMetaConfidenceInfoJSON contains the JSON metadata
-// for the struct [RadarAS112SummaryDNSSECResponseMetaConfidenceInfo]
-type radarAS112SummaryDNSSECResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112SummaryDNSSECResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112SummaryDNSSECResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112SummaryDNSSECResponseMetaConfidenceInfoAnnotation 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 radarAS112SummaryDNSSECResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarAS112SummaryDNSSECResponseMetaConfidenceInfoAnnotationJSON contains the
-// JSON metadata for the struct
-// [RadarAS112SummaryDNSSECResponseMetaConfidenceInfoAnnotation]
-type radarAS112SummaryDNSSECResponseMetaConfidenceInfoAnnotationJSON 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 *RadarAS112SummaryDNSSECResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112SummaryDNSSECResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112SummaryDNSSECResponseSummary0 struct {
- NotSupported string `json:"NOT_SUPPORTED,required"`
- Supported string `json:"SUPPORTED,required"`
- JSON radarAS112SummaryDNSSECResponseSummary0JSON `json:"-"`
-}
-
-// radarAS112SummaryDNSSECResponseSummary0JSON contains the JSON metadata for the
-// struct [RadarAS112SummaryDNSSECResponseSummary0]
-type radarAS112SummaryDNSSECResponseSummary0JSON struct {
- NotSupported apijson.Field
- Supported apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112SummaryDNSSECResponseSummary0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112SummaryDNSSECResponseSummary0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112SummaryEdnsResponse struct {
- Meta RadarAS112SummaryEdnsResponseMeta `json:"meta,required"`
- Summary0 RadarAS112SummaryEdnsResponseSummary0 `json:"summary_0,required"`
- JSON radarAS112SummaryEdnsResponseJSON `json:"-"`
-}
-
-// radarAS112SummaryEdnsResponseJSON contains the JSON metadata for the struct
-// [RadarAS112SummaryEdnsResponse]
-type radarAS112SummaryEdnsResponseJSON struct {
- Meta apijson.Field
- Summary0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112SummaryEdnsResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112SummaryEdnsResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112SummaryEdnsResponseMeta struct {
- DateRange []RadarAS112SummaryEdnsResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- Normalization string `json:"normalization,required"`
- ConfidenceInfo RadarAS112SummaryEdnsResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarAS112SummaryEdnsResponseMetaJSON `json:"-"`
-}
-
-// radarAS112SummaryEdnsResponseMetaJSON contains the JSON metadata for the struct
-// [RadarAS112SummaryEdnsResponseMeta]
-type radarAS112SummaryEdnsResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- Normalization apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112SummaryEdnsResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112SummaryEdnsResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112SummaryEdnsResponseMetaDateRange 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 radarAS112SummaryEdnsResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarAS112SummaryEdnsResponseMetaDateRangeJSON contains the JSON metadata for
-// the struct [RadarAS112SummaryEdnsResponseMetaDateRange]
-type radarAS112SummaryEdnsResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112SummaryEdnsResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112SummaryEdnsResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112SummaryEdnsResponseMetaConfidenceInfo struct {
- Annotations []RadarAS112SummaryEdnsResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarAS112SummaryEdnsResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarAS112SummaryEdnsResponseMetaConfidenceInfoJSON contains the JSON metadata
-// for the struct [RadarAS112SummaryEdnsResponseMetaConfidenceInfo]
-type radarAS112SummaryEdnsResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112SummaryEdnsResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112SummaryEdnsResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112SummaryEdnsResponseMetaConfidenceInfoAnnotation 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 radarAS112SummaryEdnsResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarAS112SummaryEdnsResponseMetaConfidenceInfoAnnotationJSON contains the JSON
-// metadata for the struct
-// [RadarAS112SummaryEdnsResponseMetaConfidenceInfoAnnotation]
-type radarAS112SummaryEdnsResponseMetaConfidenceInfoAnnotationJSON 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 *RadarAS112SummaryEdnsResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112SummaryEdnsResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112SummaryEdnsResponseSummary0 struct {
- NotSupported string `json:"NOT_SUPPORTED,required"`
- Supported string `json:"SUPPORTED,required"`
- JSON radarAS112SummaryEdnsResponseSummary0JSON `json:"-"`
-}
-
-// radarAS112SummaryEdnsResponseSummary0JSON contains the JSON metadata for the
-// struct [RadarAS112SummaryEdnsResponseSummary0]
-type radarAS112SummaryEdnsResponseSummary0JSON struct {
- NotSupported apijson.Field
- Supported apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112SummaryEdnsResponseSummary0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112SummaryEdnsResponseSummary0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112SummaryIPVersionResponse struct {
- Meta RadarAS112SummaryIPVersionResponseMeta `json:"meta,required"`
- Summary0 RadarAS112SummaryIPVersionResponseSummary0 `json:"summary_0,required"`
- JSON radarAS112SummaryIPVersionResponseJSON `json:"-"`
-}
-
-// radarAS112SummaryIPVersionResponseJSON contains the JSON metadata for the struct
-// [RadarAS112SummaryIPVersionResponse]
-type radarAS112SummaryIPVersionResponseJSON struct {
- Meta apijson.Field
- Summary0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112SummaryIPVersionResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112SummaryIPVersionResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112SummaryIPVersionResponseMeta struct {
- DateRange []RadarAS112SummaryIPVersionResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- Normalization string `json:"normalization,required"`
- ConfidenceInfo RadarAS112SummaryIPVersionResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarAS112SummaryIPVersionResponseMetaJSON `json:"-"`
-}
-
-// radarAS112SummaryIPVersionResponseMetaJSON contains the JSON metadata for the
-// struct [RadarAS112SummaryIPVersionResponseMeta]
-type radarAS112SummaryIPVersionResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- Normalization apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112SummaryIPVersionResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112SummaryIPVersionResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112SummaryIPVersionResponseMetaDateRange 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 radarAS112SummaryIPVersionResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarAS112SummaryIPVersionResponseMetaDateRangeJSON contains the JSON metadata
-// for the struct [RadarAS112SummaryIPVersionResponseMetaDateRange]
-type radarAS112SummaryIPVersionResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112SummaryIPVersionResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112SummaryIPVersionResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112SummaryIPVersionResponseMetaConfidenceInfo struct {
- Annotations []RadarAS112SummaryIPVersionResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarAS112SummaryIPVersionResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarAS112SummaryIPVersionResponseMetaConfidenceInfoJSON contains the JSON
-// metadata for the struct [RadarAS112SummaryIPVersionResponseMetaConfidenceInfo]
-type radarAS112SummaryIPVersionResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112SummaryIPVersionResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112SummaryIPVersionResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112SummaryIPVersionResponseMetaConfidenceInfoAnnotation 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 radarAS112SummaryIPVersionResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarAS112SummaryIPVersionResponseMetaConfidenceInfoAnnotationJSON contains the
-// JSON metadata for the struct
-// [RadarAS112SummaryIPVersionResponseMetaConfidenceInfoAnnotation]
-type radarAS112SummaryIPVersionResponseMetaConfidenceInfoAnnotationJSON 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 *RadarAS112SummaryIPVersionResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112SummaryIPVersionResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112SummaryIPVersionResponseSummary0 struct {
- IPv4 string `json:"IPv4,required"`
- IPv6 string `json:"IPv6,required"`
- JSON radarAS112SummaryIPVersionResponseSummary0JSON `json:"-"`
-}
-
-// radarAS112SummaryIPVersionResponseSummary0JSON contains the JSON metadata for
-// the struct [RadarAS112SummaryIPVersionResponseSummary0]
-type radarAS112SummaryIPVersionResponseSummary0JSON struct {
- IPv4 apijson.Field
- IPv6 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112SummaryIPVersionResponseSummary0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112SummaryIPVersionResponseSummary0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112SummaryProtocolResponse struct {
- Meta RadarAS112SummaryProtocolResponseMeta `json:"meta,required"`
- Summary0 RadarAS112SummaryProtocolResponseSummary0 `json:"summary_0,required"`
- JSON radarAS112SummaryProtocolResponseJSON `json:"-"`
-}
-
-// radarAS112SummaryProtocolResponseJSON contains the JSON metadata for the struct
-// [RadarAS112SummaryProtocolResponse]
-type radarAS112SummaryProtocolResponseJSON struct {
- Meta apijson.Field
- Summary0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112SummaryProtocolResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112SummaryProtocolResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112SummaryProtocolResponseMeta struct {
- DateRange []RadarAS112SummaryProtocolResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- Normalization string `json:"normalization,required"`
- ConfidenceInfo RadarAS112SummaryProtocolResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarAS112SummaryProtocolResponseMetaJSON `json:"-"`
-}
-
-// radarAS112SummaryProtocolResponseMetaJSON contains the JSON metadata for the
-// struct [RadarAS112SummaryProtocolResponseMeta]
-type radarAS112SummaryProtocolResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- Normalization apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112SummaryProtocolResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112SummaryProtocolResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112SummaryProtocolResponseMetaDateRange 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 radarAS112SummaryProtocolResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarAS112SummaryProtocolResponseMetaDateRangeJSON contains the JSON metadata
-// for the struct [RadarAS112SummaryProtocolResponseMetaDateRange]
-type radarAS112SummaryProtocolResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112SummaryProtocolResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112SummaryProtocolResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112SummaryProtocolResponseMetaConfidenceInfo struct {
- Annotations []RadarAS112SummaryProtocolResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarAS112SummaryProtocolResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarAS112SummaryProtocolResponseMetaConfidenceInfoJSON contains the JSON
-// metadata for the struct [RadarAS112SummaryProtocolResponseMetaConfidenceInfo]
-type radarAS112SummaryProtocolResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112SummaryProtocolResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112SummaryProtocolResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112SummaryProtocolResponseMetaConfidenceInfoAnnotation 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 radarAS112SummaryProtocolResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarAS112SummaryProtocolResponseMetaConfidenceInfoAnnotationJSON contains the
-// JSON metadata for the struct
-// [RadarAS112SummaryProtocolResponseMetaConfidenceInfoAnnotation]
-type radarAS112SummaryProtocolResponseMetaConfidenceInfoAnnotationJSON 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 *RadarAS112SummaryProtocolResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112SummaryProtocolResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112SummaryProtocolResponseSummary0 struct {
- Tcp string `json:"tcp,required"`
- Udp string `json:"udp,required"`
- JSON radarAS112SummaryProtocolResponseSummary0JSON `json:"-"`
-}
-
-// radarAS112SummaryProtocolResponseSummary0JSON contains the JSON metadata for the
-// struct [RadarAS112SummaryProtocolResponseSummary0]
-type radarAS112SummaryProtocolResponseSummary0JSON struct {
- Tcp apijson.Field
- Udp apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112SummaryProtocolResponseSummary0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112SummaryProtocolResponseSummary0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112SummaryQueryTypeResponse struct {
- Meta RadarAS112SummaryQueryTypeResponseMeta `json:"meta,required"`
- Summary0 RadarAS112SummaryQueryTypeResponseSummary0 `json:"summary_0,required"`
- JSON radarAS112SummaryQueryTypeResponseJSON `json:"-"`
-}
-
-// radarAS112SummaryQueryTypeResponseJSON contains the JSON metadata for the struct
-// [RadarAS112SummaryQueryTypeResponse]
-type radarAS112SummaryQueryTypeResponseJSON struct {
- Meta apijson.Field
- Summary0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112SummaryQueryTypeResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112SummaryQueryTypeResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112SummaryQueryTypeResponseMeta struct {
- DateRange []RadarAS112SummaryQueryTypeResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- Normalization string `json:"normalization,required"`
- ConfidenceInfo RadarAS112SummaryQueryTypeResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarAS112SummaryQueryTypeResponseMetaJSON `json:"-"`
-}
-
-// radarAS112SummaryQueryTypeResponseMetaJSON contains the JSON metadata for the
-// struct [RadarAS112SummaryQueryTypeResponseMeta]
-type radarAS112SummaryQueryTypeResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- Normalization apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112SummaryQueryTypeResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112SummaryQueryTypeResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112SummaryQueryTypeResponseMetaDateRange 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 radarAS112SummaryQueryTypeResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarAS112SummaryQueryTypeResponseMetaDateRangeJSON contains the JSON metadata
-// for the struct [RadarAS112SummaryQueryTypeResponseMetaDateRange]
-type radarAS112SummaryQueryTypeResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112SummaryQueryTypeResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112SummaryQueryTypeResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112SummaryQueryTypeResponseMetaConfidenceInfo struct {
- Annotations []RadarAS112SummaryQueryTypeResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarAS112SummaryQueryTypeResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarAS112SummaryQueryTypeResponseMetaConfidenceInfoJSON contains the JSON
-// metadata for the struct [RadarAS112SummaryQueryTypeResponseMetaConfidenceInfo]
-type radarAS112SummaryQueryTypeResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112SummaryQueryTypeResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112SummaryQueryTypeResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112SummaryQueryTypeResponseMetaConfidenceInfoAnnotation 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 radarAS112SummaryQueryTypeResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarAS112SummaryQueryTypeResponseMetaConfidenceInfoAnnotationJSON contains the
-// JSON metadata for the struct
-// [RadarAS112SummaryQueryTypeResponseMetaConfidenceInfoAnnotation]
-type radarAS112SummaryQueryTypeResponseMetaConfidenceInfoAnnotationJSON 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 *RadarAS112SummaryQueryTypeResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112SummaryQueryTypeResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112SummaryQueryTypeResponseSummary0 struct {
- A string `json:"A,required"`
- AAAA string `json:"AAAA,required"`
- PTR string `json:"PTR,required"`
- Soa string `json:"SOA,required"`
- SRV string `json:"SRV,required"`
- JSON radarAS112SummaryQueryTypeResponseSummary0JSON `json:"-"`
-}
-
-// radarAS112SummaryQueryTypeResponseSummary0JSON contains the JSON metadata for
-// the struct [RadarAS112SummaryQueryTypeResponseSummary0]
-type radarAS112SummaryQueryTypeResponseSummary0JSON struct {
- A apijson.Field
- AAAA apijson.Field
- PTR apijson.Field
- Soa apijson.Field
- SRV apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112SummaryQueryTypeResponseSummary0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112SummaryQueryTypeResponseSummary0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112SummaryResponseCodesResponse struct {
- Meta RadarAS112SummaryResponseCodesResponseMeta `json:"meta,required"`
- Summary0 RadarAS112SummaryResponseCodesResponseSummary0 `json:"summary_0,required"`
- JSON radarAS112SummaryResponseCodesResponseJSON `json:"-"`
-}
-
-// radarAS112SummaryResponseCodesResponseJSON contains the JSON metadata for the
-// struct [RadarAS112SummaryResponseCodesResponse]
-type radarAS112SummaryResponseCodesResponseJSON struct {
- Meta apijson.Field
- Summary0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112SummaryResponseCodesResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112SummaryResponseCodesResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112SummaryResponseCodesResponseMeta struct {
- DateRange []RadarAS112SummaryResponseCodesResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- Normalization string `json:"normalization,required"`
- ConfidenceInfo RadarAS112SummaryResponseCodesResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarAS112SummaryResponseCodesResponseMetaJSON `json:"-"`
-}
-
-// radarAS112SummaryResponseCodesResponseMetaJSON contains the JSON metadata for
-// the struct [RadarAS112SummaryResponseCodesResponseMeta]
-type radarAS112SummaryResponseCodesResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- Normalization apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112SummaryResponseCodesResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112SummaryResponseCodesResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112SummaryResponseCodesResponseMetaDateRange 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 radarAS112SummaryResponseCodesResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarAS112SummaryResponseCodesResponseMetaDateRangeJSON contains the JSON
-// metadata for the struct [RadarAS112SummaryResponseCodesResponseMetaDateRange]
-type radarAS112SummaryResponseCodesResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112SummaryResponseCodesResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112SummaryResponseCodesResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112SummaryResponseCodesResponseMetaConfidenceInfo struct {
- Annotations []RadarAS112SummaryResponseCodesResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarAS112SummaryResponseCodesResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarAS112SummaryResponseCodesResponseMetaConfidenceInfoJSON contains the JSON
-// metadata for the struct
-// [RadarAS112SummaryResponseCodesResponseMetaConfidenceInfo]
-type radarAS112SummaryResponseCodesResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112SummaryResponseCodesResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112SummaryResponseCodesResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112SummaryResponseCodesResponseMetaConfidenceInfoAnnotation 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 radarAS112SummaryResponseCodesResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarAS112SummaryResponseCodesResponseMetaConfidenceInfoAnnotationJSON contains
-// the JSON metadata for the struct
-// [RadarAS112SummaryResponseCodesResponseMetaConfidenceInfoAnnotation]
-type radarAS112SummaryResponseCodesResponseMetaConfidenceInfoAnnotationJSON 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 *RadarAS112SummaryResponseCodesResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112SummaryResponseCodesResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112SummaryResponseCodesResponseSummary0 struct {
- Noerror string `json:"NOERROR,required"`
- Nxdomain string `json:"NXDOMAIN,required"`
- JSON radarAS112SummaryResponseCodesResponseSummary0JSON `json:"-"`
-}
-
-// radarAS112SummaryResponseCodesResponseSummary0JSON contains the JSON metadata
-// for the struct [RadarAS112SummaryResponseCodesResponseSummary0]
-type radarAS112SummaryResponseCodesResponseSummary0JSON struct {
- Noerror apijson.Field
- Nxdomain apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112SummaryResponseCodesResponseSummary0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112SummaryResponseCodesResponseSummary0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112SummaryDNSSECParams 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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarAS112SummaryDNSSECParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Format results are returned in.
- Format param.Field[RadarAS112SummaryDNSSECParamsFormat] `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"`
-}
-
-// URLQuery serializes [RadarAS112SummaryDNSSECParams]'s query parameters as
-// `url.Values`.
-func (r RadarAS112SummaryDNSSECParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type RadarAS112SummaryDNSSECParamsDateRange string
-
-const (
- RadarAS112SummaryDNSSECParamsDateRange1d RadarAS112SummaryDNSSECParamsDateRange = "1d"
- RadarAS112SummaryDNSSECParamsDateRange2d RadarAS112SummaryDNSSECParamsDateRange = "2d"
- RadarAS112SummaryDNSSECParamsDateRange7d RadarAS112SummaryDNSSECParamsDateRange = "7d"
- RadarAS112SummaryDNSSECParamsDateRange14d RadarAS112SummaryDNSSECParamsDateRange = "14d"
- RadarAS112SummaryDNSSECParamsDateRange28d RadarAS112SummaryDNSSECParamsDateRange = "28d"
- RadarAS112SummaryDNSSECParamsDateRange12w RadarAS112SummaryDNSSECParamsDateRange = "12w"
- RadarAS112SummaryDNSSECParamsDateRange24w RadarAS112SummaryDNSSECParamsDateRange = "24w"
- RadarAS112SummaryDNSSECParamsDateRange52w RadarAS112SummaryDNSSECParamsDateRange = "52w"
- RadarAS112SummaryDNSSECParamsDateRange1dControl RadarAS112SummaryDNSSECParamsDateRange = "1dControl"
- RadarAS112SummaryDNSSECParamsDateRange2dControl RadarAS112SummaryDNSSECParamsDateRange = "2dControl"
- RadarAS112SummaryDNSSECParamsDateRange7dControl RadarAS112SummaryDNSSECParamsDateRange = "7dControl"
- RadarAS112SummaryDNSSECParamsDateRange14dControl RadarAS112SummaryDNSSECParamsDateRange = "14dControl"
- RadarAS112SummaryDNSSECParamsDateRange28dControl RadarAS112SummaryDNSSECParamsDateRange = "28dControl"
- RadarAS112SummaryDNSSECParamsDateRange12wControl RadarAS112SummaryDNSSECParamsDateRange = "12wControl"
- RadarAS112SummaryDNSSECParamsDateRange24wControl RadarAS112SummaryDNSSECParamsDateRange = "24wControl"
-)
-
-// Format results are returned in.
-type RadarAS112SummaryDNSSECParamsFormat string
-
-const (
- RadarAS112SummaryDNSSECParamsFormatJson RadarAS112SummaryDNSSECParamsFormat = "JSON"
- RadarAS112SummaryDNSSECParamsFormatCsv RadarAS112SummaryDNSSECParamsFormat = "CSV"
-)
-
-type RadarAS112SummaryDNSSECResponseEnvelope struct {
- Result RadarAS112SummaryDNSSECResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarAS112SummaryDNSSECResponseEnvelopeJSON `json:"-"`
-}
-
-// radarAS112SummaryDNSSECResponseEnvelopeJSON contains the JSON metadata for the
-// struct [RadarAS112SummaryDNSSECResponseEnvelope]
-type radarAS112SummaryDNSSECResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112SummaryDNSSECResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112SummaryDNSSECResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112SummaryEdnsParams 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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarAS112SummaryEdnsParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Format results are returned in.
- Format param.Field[RadarAS112SummaryEdnsParamsFormat] `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"`
-}
-
-// URLQuery serializes [RadarAS112SummaryEdnsParams]'s query parameters as
-// `url.Values`.
-func (r RadarAS112SummaryEdnsParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type RadarAS112SummaryEdnsParamsDateRange string
-
-const (
- RadarAS112SummaryEdnsParamsDateRange1d RadarAS112SummaryEdnsParamsDateRange = "1d"
- RadarAS112SummaryEdnsParamsDateRange2d RadarAS112SummaryEdnsParamsDateRange = "2d"
- RadarAS112SummaryEdnsParamsDateRange7d RadarAS112SummaryEdnsParamsDateRange = "7d"
- RadarAS112SummaryEdnsParamsDateRange14d RadarAS112SummaryEdnsParamsDateRange = "14d"
- RadarAS112SummaryEdnsParamsDateRange28d RadarAS112SummaryEdnsParamsDateRange = "28d"
- RadarAS112SummaryEdnsParamsDateRange12w RadarAS112SummaryEdnsParamsDateRange = "12w"
- RadarAS112SummaryEdnsParamsDateRange24w RadarAS112SummaryEdnsParamsDateRange = "24w"
- RadarAS112SummaryEdnsParamsDateRange52w RadarAS112SummaryEdnsParamsDateRange = "52w"
- RadarAS112SummaryEdnsParamsDateRange1dControl RadarAS112SummaryEdnsParamsDateRange = "1dControl"
- RadarAS112SummaryEdnsParamsDateRange2dControl RadarAS112SummaryEdnsParamsDateRange = "2dControl"
- RadarAS112SummaryEdnsParamsDateRange7dControl RadarAS112SummaryEdnsParamsDateRange = "7dControl"
- RadarAS112SummaryEdnsParamsDateRange14dControl RadarAS112SummaryEdnsParamsDateRange = "14dControl"
- RadarAS112SummaryEdnsParamsDateRange28dControl RadarAS112SummaryEdnsParamsDateRange = "28dControl"
- RadarAS112SummaryEdnsParamsDateRange12wControl RadarAS112SummaryEdnsParamsDateRange = "12wControl"
- RadarAS112SummaryEdnsParamsDateRange24wControl RadarAS112SummaryEdnsParamsDateRange = "24wControl"
-)
-
-// Format results are returned in.
-type RadarAS112SummaryEdnsParamsFormat string
-
-const (
- RadarAS112SummaryEdnsParamsFormatJson RadarAS112SummaryEdnsParamsFormat = "JSON"
- RadarAS112SummaryEdnsParamsFormatCsv RadarAS112SummaryEdnsParamsFormat = "CSV"
-)
-
-type RadarAS112SummaryEdnsResponseEnvelope struct {
- Result RadarAS112SummaryEdnsResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarAS112SummaryEdnsResponseEnvelopeJSON `json:"-"`
-}
-
-// radarAS112SummaryEdnsResponseEnvelopeJSON contains the JSON metadata for the
-// struct [RadarAS112SummaryEdnsResponseEnvelope]
-type radarAS112SummaryEdnsResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112SummaryEdnsResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112SummaryEdnsResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112SummaryIPVersionParams 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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarAS112SummaryIPVersionParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Format results are returned in.
- Format param.Field[RadarAS112SummaryIPVersionParamsFormat] `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"`
-}
-
-// URLQuery serializes [RadarAS112SummaryIPVersionParams]'s query parameters as
-// `url.Values`.
-func (r RadarAS112SummaryIPVersionParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type RadarAS112SummaryIPVersionParamsDateRange string
-
-const (
- RadarAS112SummaryIPVersionParamsDateRange1d RadarAS112SummaryIPVersionParamsDateRange = "1d"
- RadarAS112SummaryIPVersionParamsDateRange2d RadarAS112SummaryIPVersionParamsDateRange = "2d"
- RadarAS112SummaryIPVersionParamsDateRange7d RadarAS112SummaryIPVersionParamsDateRange = "7d"
- RadarAS112SummaryIPVersionParamsDateRange14d RadarAS112SummaryIPVersionParamsDateRange = "14d"
- RadarAS112SummaryIPVersionParamsDateRange28d RadarAS112SummaryIPVersionParamsDateRange = "28d"
- RadarAS112SummaryIPVersionParamsDateRange12w RadarAS112SummaryIPVersionParamsDateRange = "12w"
- RadarAS112SummaryIPVersionParamsDateRange24w RadarAS112SummaryIPVersionParamsDateRange = "24w"
- RadarAS112SummaryIPVersionParamsDateRange52w RadarAS112SummaryIPVersionParamsDateRange = "52w"
- RadarAS112SummaryIPVersionParamsDateRange1dControl RadarAS112SummaryIPVersionParamsDateRange = "1dControl"
- RadarAS112SummaryIPVersionParamsDateRange2dControl RadarAS112SummaryIPVersionParamsDateRange = "2dControl"
- RadarAS112SummaryIPVersionParamsDateRange7dControl RadarAS112SummaryIPVersionParamsDateRange = "7dControl"
- RadarAS112SummaryIPVersionParamsDateRange14dControl RadarAS112SummaryIPVersionParamsDateRange = "14dControl"
- RadarAS112SummaryIPVersionParamsDateRange28dControl RadarAS112SummaryIPVersionParamsDateRange = "28dControl"
- RadarAS112SummaryIPVersionParamsDateRange12wControl RadarAS112SummaryIPVersionParamsDateRange = "12wControl"
- RadarAS112SummaryIPVersionParamsDateRange24wControl RadarAS112SummaryIPVersionParamsDateRange = "24wControl"
-)
-
-// Format results are returned in.
-type RadarAS112SummaryIPVersionParamsFormat string
-
-const (
- RadarAS112SummaryIPVersionParamsFormatJson RadarAS112SummaryIPVersionParamsFormat = "JSON"
- RadarAS112SummaryIPVersionParamsFormatCsv RadarAS112SummaryIPVersionParamsFormat = "CSV"
-)
-
-type RadarAS112SummaryIPVersionResponseEnvelope struct {
- Result RadarAS112SummaryIPVersionResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarAS112SummaryIPVersionResponseEnvelopeJSON `json:"-"`
-}
-
-// radarAS112SummaryIPVersionResponseEnvelopeJSON contains the JSON metadata for
-// the struct [RadarAS112SummaryIPVersionResponseEnvelope]
-type radarAS112SummaryIPVersionResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112SummaryIPVersionResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112SummaryIPVersionResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112SummaryProtocolParams 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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarAS112SummaryProtocolParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Format results are returned in.
- Format param.Field[RadarAS112SummaryProtocolParamsFormat] `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"`
-}
-
-// URLQuery serializes [RadarAS112SummaryProtocolParams]'s query parameters as
-// `url.Values`.
-func (r RadarAS112SummaryProtocolParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type RadarAS112SummaryProtocolParamsDateRange string
-
-const (
- RadarAS112SummaryProtocolParamsDateRange1d RadarAS112SummaryProtocolParamsDateRange = "1d"
- RadarAS112SummaryProtocolParamsDateRange2d RadarAS112SummaryProtocolParamsDateRange = "2d"
- RadarAS112SummaryProtocolParamsDateRange7d RadarAS112SummaryProtocolParamsDateRange = "7d"
- RadarAS112SummaryProtocolParamsDateRange14d RadarAS112SummaryProtocolParamsDateRange = "14d"
- RadarAS112SummaryProtocolParamsDateRange28d RadarAS112SummaryProtocolParamsDateRange = "28d"
- RadarAS112SummaryProtocolParamsDateRange12w RadarAS112SummaryProtocolParamsDateRange = "12w"
- RadarAS112SummaryProtocolParamsDateRange24w RadarAS112SummaryProtocolParamsDateRange = "24w"
- RadarAS112SummaryProtocolParamsDateRange52w RadarAS112SummaryProtocolParamsDateRange = "52w"
- RadarAS112SummaryProtocolParamsDateRange1dControl RadarAS112SummaryProtocolParamsDateRange = "1dControl"
- RadarAS112SummaryProtocolParamsDateRange2dControl RadarAS112SummaryProtocolParamsDateRange = "2dControl"
- RadarAS112SummaryProtocolParamsDateRange7dControl RadarAS112SummaryProtocolParamsDateRange = "7dControl"
- RadarAS112SummaryProtocolParamsDateRange14dControl RadarAS112SummaryProtocolParamsDateRange = "14dControl"
- RadarAS112SummaryProtocolParamsDateRange28dControl RadarAS112SummaryProtocolParamsDateRange = "28dControl"
- RadarAS112SummaryProtocolParamsDateRange12wControl RadarAS112SummaryProtocolParamsDateRange = "12wControl"
- RadarAS112SummaryProtocolParamsDateRange24wControl RadarAS112SummaryProtocolParamsDateRange = "24wControl"
-)
-
-// Format results are returned in.
-type RadarAS112SummaryProtocolParamsFormat string
-
-const (
- RadarAS112SummaryProtocolParamsFormatJson RadarAS112SummaryProtocolParamsFormat = "JSON"
- RadarAS112SummaryProtocolParamsFormatCsv RadarAS112SummaryProtocolParamsFormat = "CSV"
-)
-
-type RadarAS112SummaryProtocolResponseEnvelope struct {
- Result RadarAS112SummaryProtocolResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarAS112SummaryProtocolResponseEnvelopeJSON `json:"-"`
-}
-
-// radarAS112SummaryProtocolResponseEnvelopeJSON contains the JSON metadata for the
-// struct [RadarAS112SummaryProtocolResponseEnvelope]
-type radarAS112SummaryProtocolResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112SummaryProtocolResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112SummaryProtocolResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112SummaryQueryTypeParams 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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarAS112SummaryQueryTypeParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Format results are returned in.
- Format param.Field[RadarAS112SummaryQueryTypeParamsFormat] `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"`
-}
-
-// URLQuery serializes [RadarAS112SummaryQueryTypeParams]'s query parameters as
-// `url.Values`.
-func (r RadarAS112SummaryQueryTypeParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type RadarAS112SummaryQueryTypeParamsDateRange string
-
-const (
- RadarAS112SummaryQueryTypeParamsDateRange1d RadarAS112SummaryQueryTypeParamsDateRange = "1d"
- RadarAS112SummaryQueryTypeParamsDateRange2d RadarAS112SummaryQueryTypeParamsDateRange = "2d"
- RadarAS112SummaryQueryTypeParamsDateRange7d RadarAS112SummaryQueryTypeParamsDateRange = "7d"
- RadarAS112SummaryQueryTypeParamsDateRange14d RadarAS112SummaryQueryTypeParamsDateRange = "14d"
- RadarAS112SummaryQueryTypeParamsDateRange28d RadarAS112SummaryQueryTypeParamsDateRange = "28d"
- RadarAS112SummaryQueryTypeParamsDateRange12w RadarAS112SummaryQueryTypeParamsDateRange = "12w"
- RadarAS112SummaryQueryTypeParamsDateRange24w RadarAS112SummaryQueryTypeParamsDateRange = "24w"
- RadarAS112SummaryQueryTypeParamsDateRange52w RadarAS112SummaryQueryTypeParamsDateRange = "52w"
- RadarAS112SummaryQueryTypeParamsDateRange1dControl RadarAS112SummaryQueryTypeParamsDateRange = "1dControl"
- RadarAS112SummaryQueryTypeParamsDateRange2dControl RadarAS112SummaryQueryTypeParamsDateRange = "2dControl"
- RadarAS112SummaryQueryTypeParamsDateRange7dControl RadarAS112SummaryQueryTypeParamsDateRange = "7dControl"
- RadarAS112SummaryQueryTypeParamsDateRange14dControl RadarAS112SummaryQueryTypeParamsDateRange = "14dControl"
- RadarAS112SummaryQueryTypeParamsDateRange28dControl RadarAS112SummaryQueryTypeParamsDateRange = "28dControl"
- RadarAS112SummaryQueryTypeParamsDateRange12wControl RadarAS112SummaryQueryTypeParamsDateRange = "12wControl"
- RadarAS112SummaryQueryTypeParamsDateRange24wControl RadarAS112SummaryQueryTypeParamsDateRange = "24wControl"
-)
-
-// Format results are returned in.
-type RadarAS112SummaryQueryTypeParamsFormat string
-
-const (
- RadarAS112SummaryQueryTypeParamsFormatJson RadarAS112SummaryQueryTypeParamsFormat = "JSON"
- RadarAS112SummaryQueryTypeParamsFormatCsv RadarAS112SummaryQueryTypeParamsFormat = "CSV"
-)
-
-type RadarAS112SummaryQueryTypeResponseEnvelope struct {
- Result RadarAS112SummaryQueryTypeResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarAS112SummaryQueryTypeResponseEnvelopeJSON `json:"-"`
-}
-
-// radarAS112SummaryQueryTypeResponseEnvelopeJSON contains the JSON metadata for
-// the struct [RadarAS112SummaryQueryTypeResponseEnvelope]
-type radarAS112SummaryQueryTypeResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112SummaryQueryTypeResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112SummaryQueryTypeResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112SummaryResponseCodesParams 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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarAS112SummaryResponseCodesParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Format results are returned in.
- Format param.Field[RadarAS112SummaryResponseCodesParamsFormat] `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"`
-}
-
-// URLQuery serializes [RadarAS112SummaryResponseCodesParams]'s query parameters as
-// `url.Values`.
-func (r RadarAS112SummaryResponseCodesParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type RadarAS112SummaryResponseCodesParamsDateRange string
-
-const (
- RadarAS112SummaryResponseCodesParamsDateRange1d RadarAS112SummaryResponseCodesParamsDateRange = "1d"
- RadarAS112SummaryResponseCodesParamsDateRange2d RadarAS112SummaryResponseCodesParamsDateRange = "2d"
- RadarAS112SummaryResponseCodesParamsDateRange7d RadarAS112SummaryResponseCodesParamsDateRange = "7d"
- RadarAS112SummaryResponseCodesParamsDateRange14d RadarAS112SummaryResponseCodesParamsDateRange = "14d"
- RadarAS112SummaryResponseCodesParamsDateRange28d RadarAS112SummaryResponseCodesParamsDateRange = "28d"
- RadarAS112SummaryResponseCodesParamsDateRange12w RadarAS112SummaryResponseCodesParamsDateRange = "12w"
- RadarAS112SummaryResponseCodesParamsDateRange24w RadarAS112SummaryResponseCodesParamsDateRange = "24w"
- RadarAS112SummaryResponseCodesParamsDateRange52w RadarAS112SummaryResponseCodesParamsDateRange = "52w"
- RadarAS112SummaryResponseCodesParamsDateRange1dControl RadarAS112SummaryResponseCodesParamsDateRange = "1dControl"
- RadarAS112SummaryResponseCodesParamsDateRange2dControl RadarAS112SummaryResponseCodesParamsDateRange = "2dControl"
- RadarAS112SummaryResponseCodesParamsDateRange7dControl RadarAS112SummaryResponseCodesParamsDateRange = "7dControl"
- RadarAS112SummaryResponseCodesParamsDateRange14dControl RadarAS112SummaryResponseCodesParamsDateRange = "14dControl"
- RadarAS112SummaryResponseCodesParamsDateRange28dControl RadarAS112SummaryResponseCodesParamsDateRange = "28dControl"
- RadarAS112SummaryResponseCodesParamsDateRange12wControl RadarAS112SummaryResponseCodesParamsDateRange = "12wControl"
- RadarAS112SummaryResponseCodesParamsDateRange24wControl RadarAS112SummaryResponseCodesParamsDateRange = "24wControl"
-)
-
-// Format results are returned in.
-type RadarAS112SummaryResponseCodesParamsFormat string
-
-const (
- RadarAS112SummaryResponseCodesParamsFormatJson RadarAS112SummaryResponseCodesParamsFormat = "JSON"
- RadarAS112SummaryResponseCodesParamsFormatCsv RadarAS112SummaryResponseCodesParamsFormat = "CSV"
-)
-
-type RadarAS112SummaryResponseCodesResponseEnvelope struct {
- Result RadarAS112SummaryResponseCodesResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarAS112SummaryResponseCodesResponseEnvelopeJSON `json:"-"`
-}
-
-// radarAS112SummaryResponseCodesResponseEnvelopeJSON contains the JSON metadata
-// for the struct [RadarAS112SummaryResponseCodesResponseEnvelope]
-type radarAS112SummaryResponseCodesResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112SummaryResponseCodesResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112SummaryResponseCodesResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
diff --git a/radaras112summary_test.go b/radaras112summary_test.go
deleted file mode 100644
index aab7125d203..00000000000
--- a/radaras112summary_test.go
+++ /dev/null
@@ -1,213 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
- "time"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRadarAS112SummaryDNSSECWithOptionalParams(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"),
- )
- _, 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()}),
- Format: cloudflare.F(cloudflare.RadarAS112SummaryDNSSECParamsFormatJson),
- 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())
- }
-}
-
-func TestRadarAS112SummaryEdnsWithOptionalParams(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"),
- )
- _, 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()}),
- Format: cloudflare.F(cloudflare.RadarAS112SummaryEdnsParamsFormatJson),
- 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())
- }
-}
-
-func TestRadarAS112SummaryIPVersionWithOptionalParams(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"),
- )
- _, 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()}),
- Format: cloudflare.F(cloudflare.RadarAS112SummaryIPVersionParamsFormatJson),
- 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())
- }
-}
-
-func TestRadarAS112SummaryProtocolWithOptionalParams(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"),
- )
- _, 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()}),
- Format: cloudflare.F(cloudflare.RadarAS112SummaryProtocolParamsFormatJson),
- 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())
- }
-}
-
-func TestRadarAS112SummaryQueryTypeWithOptionalParams(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"),
- )
- _, 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()}),
- Format: cloudflare.F(cloudflare.RadarAS112SummaryQueryTypeParamsFormatJson),
- 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())
- }
-}
-
-func TestRadarAS112SummaryResponseCodesWithOptionalParams(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"),
- )
- _, 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()}),
- Format: cloudflare.F(cloudflare.RadarAS112SummaryResponseCodesParamsFormatJson),
- 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/radaras112timeseriesgroup.go b/radaras112timeseriesgroup.go
deleted file mode 100644
index 155d59dde10..00000000000
--- a/radaras112timeseriesgroup.go
+++ /dev/null
@@ -1,1013 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarAS112TimeseriesGroupService contains methods and other services that help
-// with interacting with the cloudflare API. Note, unlike clients, this service
-// does not read variables from the environment automatically. You should not
-// instantiate this service directly, and instead use the
-// [NewRadarAS112TimeseriesGroupService] method instead.
-type RadarAS112TimeseriesGroupService struct {
- Options []option.RequestOption
-}
-
-// NewRadarAS112TimeseriesGroupService generates a new service that applies the
-// given options to each request. These options are applied after the parent
-// client's options (if there is one), and before any request-specific options.
-func NewRadarAS112TimeseriesGroupService(opts ...option.RequestOption) (r *RadarAS112TimeseriesGroupService) {
- r = &RadarAS112TimeseriesGroupService{}
- r.Options = opts
- return
-}
-
-// Percentage distribution of DNS AS112 queries by DNSSEC support over time.
-func (r *RadarAS112TimeseriesGroupService) DNSSEC(ctx context.Context, query RadarAS112TimeseriesGroupDNSSECParams, opts ...option.RequestOption) (res *RadarAS112TimeseriesGroupDNSSECResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarAS112TimeseriesGroupDNSSECResponseEnvelope
- path := "radar/as112/timeseries_groups/dnssec"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Percentage distribution of AS112 DNS queries by EDNS support over time.
-func (r *RadarAS112TimeseriesGroupService) Edns(ctx context.Context, query RadarAS112TimeseriesGroupEdnsParams, opts ...option.RequestOption) (res *RadarAS112TimeseriesGroupEdnsResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarAS112TimeseriesGroupEdnsResponseEnvelope
- path := "radar/as112/timeseries_groups/edns"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Percentage distribution of AS112 DNS queries by IP Version over time.
-func (r *RadarAS112TimeseriesGroupService) IPVersion(ctx context.Context, query RadarAS112TimeseriesGroupIPVersionParams, opts ...option.RequestOption) (res *RadarAS112TimeseriesGroupIPVersionResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarAS112TimeseriesGroupIPVersionResponseEnvelope
- path := "radar/as112/timeseries_groups/ip_version"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Percentage distribution of AS112 dns requests classified per Protocol over time.
-func (r *RadarAS112TimeseriesGroupService) Protocol(ctx context.Context, query RadarAS112TimeseriesGroupProtocolParams, opts ...option.RequestOption) (res *RadarAS112TimeseriesGroupProtocolResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarAS112TimeseriesGroupProtocolResponseEnvelope
- path := "radar/as112/timeseries_groups/protocol"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Percentage distribution of AS112 DNS queries by Query Type over time.
-func (r *RadarAS112TimeseriesGroupService) QueryType(ctx context.Context, query RadarAS112TimeseriesGroupQueryTypeParams, opts ...option.RequestOption) (res *RadarAS112TimeseriesGroupQueryTypeResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarAS112TimeseriesGroupQueryTypeResponseEnvelope
- path := "radar/as112/timeseries_groups/query_type"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Percentage distribution of AS112 dns requests classified per Response Codes over
-// time.
-func (r *RadarAS112TimeseriesGroupService) ResponseCodes(ctx context.Context, query RadarAS112TimeseriesGroupResponseCodesParams, opts ...option.RequestOption) (res *RadarAS112TimeseriesGroupResponseCodesResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarAS112TimeseriesGroupResponseCodesResponseEnvelope
- path := "radar/as112/timeseries_groups/response_codes"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type RadarAS112TimeseriesGroupDNSSECResponse struct {
- Meta interface{} `json:"meta,required"`
- Serie0 RadarAS112TimeseriesGroupDNSSECResponseSerie0 `json:"serie_0,required"`
- JSON radarAS112TimeseriesGroupDNSSECResponseJSON `json:"-"`
-}
-
-// radarAS112TimeseriesGroupDNSSECResponseJSON contains the JSON metadata for the
-// struct [RadarAS112TimeseriesGroupDNSSECResponse]
-type radarAS112TimeseriesGroupDNSSECResponseJSON struct {
- Meta apijson.Field
- Serie0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112TimeseriesGroupDNSSECResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112TimeseriesGroupDNSSECResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112TimeseriesGroupDNSSECResponseSerie0 struct {
- NotSupported []string `json:"NOT_SUPPORTED,required"`
- Supported []string `json:"SUPPORTED,required"`
- JSON radarAS112TimeseriesGroupDNSSECResponseSerie0JSON `json:"-"`
-}
-
-// radarAS112TimeseriesGroupDNSSECResponseSerie0JSON contains the JSON metadata for
-// the struct [RadarAS112TimeseriesGroupDNSSECResponseSerie0]
-type radarAS112TimeseriesGroupDNSSECResponseSerie0JSON struct {
- NotSupported apijson.Field
- Supported apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112TimeseriesGroupDNSSECResponseSerie0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112TimeseriesGroupDNSSECResponseSerie0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112TimeseriesGroupEdnsResponse struct {
- Meta interface{} `json:"meta,required"`
- Serie0 RadarAS112TimeseriesGroupEdnsResponseSerie0 `json:"serie_0,required"`
- JSON radarAS112TimeseriesGroupEdnsResponseJSON `json:"-"`
-}
-
-// radarAS112TimeseriesGroupEdnsResponseJSON contains the JSON metadata for the
-// struct [RadarAS112TimeseriesGroupEdnsResponse]
-type radarAS112TimeseriesGroupEdnsResponseJSON struct {
- Meta apijson.Field
- Serie0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112TimeseriesGroupEdnsResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112TimeseriesGroupEdnsResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112TimeseriesGroupEdnsResponseSerie0 struct {
- NotSupported []string `json:"NOT_SUPPORTED,required"`
- Supported []string `json:"SUPPORTED,required"`
- JSON radarAS112TimeseriesGroupEdnsResponseSerie0JSON `json:"-"`
-}
-
-// radarAS112TimeseriesGroupEdnsResponseSerie0JSON contains the JSON metadata for
-// the struct [RadarAS112TimeseriesGroupEdnsResponseSerie0]
-type radarAS112TimeseriesGroupEdnsResponseSerie0JSON struct {
- NotSupported apijson.Field
- Supported apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112TimeseriesGroupEdnsResponseSerie0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112TimeseriesGroupEdnsResponseSerie0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112TimeseriesGroupIPVersionResponse struct {
- Meta interface{} `json:"meta,required"`
- Serie0 RadarAS112TimeseriesGroupIPVersionResponseSerie0 `json:"serie_0,required"`
- JSON radarAS112TimeseriesGroupIPVersionResponseJSON `json:"-"`
-}
-
-// radarAS112TimeseriesGroupIPVersionResponseJSON contains the JSON metadata for
-// the struct [RadarAS112TimeseriesGroupIPVersionResponse]
-type radarAS112TimeseriesGroupIPVersionResponseJSON struct {
- Meta apijson.Field
- Serie0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112TimeseriesGroupIPVersionResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112TimeseriesGroupIPVersionResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112TimeseriesGroupIPVersionResponseSerie0 struct {
- IPv4 []string `json:"IPv4,required"`
- IPv6 []string `json:"IPv6,required"`
- JSON radarAS112TimeseriesGroupIPVersionResponseSerie0JSON `json:"-"`
-}
-
-// radarAS112TimeseriesGroupIPVersionResponseSerie0JSON contains the JSON metadata
-// for the struct [RadarAS112TimeseriesGroupIPVersionResponseSerie0]
-type radarAS112TimeseriesGroupIPVersionResponseSerie0JSON struct {
- IPv4 apijson.Field
- IPv6 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112TimeseriesGroupIPVersionResponseSerie0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112TimeseriesGroupIPVersionResponseSerie0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112TimeseriesGroupProtocolResponse struct {
- Meta interface{} `json:"meta,required"`
- Serie0 RadarAS112TimeseriesGroupProtocolResponseSerie0 `json:"serie_0,required"`
- JSON radarAS112TimeseriesGroupProtocolResponseJSON `json:"-"`
-}
-
-// radarAS112TimeseriesGroupProtocolResponseJSON contains the JSON metadata for the
-// struct [RadarAS112TimeseriesGroupProtocolResponse]
-type radarAS112TimeseriesGroupProtocolResponseJSON struct {
- Meta apijson.Field
- Serie0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112TimeseriesGroupProtocolResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112TimeseriesGroupProtocolResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112TimeseriesGroupProtocolResponseSerie0 struct {
- Tcp []string `json:"tcp,required"`
- Udp []string `json:"udp,required"`
- JSON radarAS112TimeseriesGroupProtocolResponseSerie0JSON `json:"-"`
-}
-
-// radarAS112TimeseriesGroupProtocolResponseSerie0JSON contains the JSON metadata
-// for the struct [RadarAS112TimeseriesGroupProtocolResponseSerie0]
-type radarAS112TimeseriesGroupProtocolResponseSerie0JSON struct {
- Tcp apijson.Field
- Udp apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112TimeseriesGroupProtocolResponseSerie0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112TimeseriesGroupProtocolResponseSerie0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112TimeseriesGroupQueryTypeResponse struct {
- Meta interface{} `json:"meta,required"`
- Serie0 RadarAS112TimeseriesGroupQueryTypeResponseSerie0 `json:"serie_0,required"`
- JSON radarAS112TimeseriesGroupQueryTypeResponseJSON `json:"-"`
-}
-
-// radarAS112TimeseriesGroupQueryTypeResponseJSON contains the JSON metadata for
-// the struct [RadarAS112TimeseriesGroupQueryTypeResponse]
-type radarAS112TimeseriesGroupQueryTypeResponseJSON struct {
- Meta apijson.Field
- Serie0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112TimeseriesGroupQueryTypeResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112TimeseriesGroupQueryTypeResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112TimeseriesGroupQueryTypeResponseSerie0 struct {
- A []string `json:"A,required"`
- AAAA []string `json:"AAAA,required"`
- PTR []string `json:"PTR,required"`
- Soa []string `json:"SOA,required"`
- SRV []string `json:"SRV,required"`
- JSON radarAS112TimeseriesGroupQueryTypeResponseSerie0JSON `json:"-"`
-}
-
-// radarAS112TimeseriesGroupQueryTypeResponseSerie0JSON contains the JSON metadata
-// for the struct [RadarAS112TimeseriesGroupQueryTypeResponseSerie0]
-type radarAS112TimeseriesGroupQueryTypeResponseSerie0JSON struct {
- A apijson.Field
- AAAA apijson.Field
- PTR apijson.Field
- Soa apijson.Field
- SRV apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112TimeseriesGroupQueryTypeResponseSerie0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112TimeseriesGroupQueryTypeResponseSerie0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112TimeseriesGroupResponseCodesResponse struct {
- Meta interface{} `json:"meta,required"`
- Serie0 RadarAS112TimeseriesGroupResponseCodesResponseSerie0 `json:"serie_0,required"`
- JSON radarAS112TimeseriesGroupResponseCodesResponseJSON `json:"-"`
-}
-
-// radarAS112TimeseriesGroupResponseCodesResponseJSON contains the JSON metadata
-// for the struct [RadarAS112TimeseriesGroupResponseCodesResponse]
-type radarAS112TimeseriesGroupResponseCodesResponseJSON struct {
- Meta apijson.Field
- Serie0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112TimeseriesGroupResponseCodesResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112TimeseriesGroupResponseCodesResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112TimeseriesGroupResponseCodesResponseSerie0 struct {
- Noerror []string `json:"NOERROR,required"`
- Nxdomain []string `json:"NXDOMAIN,required"`
- JSON radarAS112TimeseriesGroupResponseCodesResponseSerie0JSON `json:"-"`
-}
-
-// radarAS112TimeseriesGroupResponseCodesResponseSerie0JSON contains the JSON
-// metadata for the struct [RadarAS112TimeseriesGroupResponseCodesResponseSerie0]
-type radarAS112TimeseriesGroupResponseCodesResponseSerie0JSON struct {
- Noerror apijson.Field
- Nxdomain apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112TimeseriesGroupResponseCodesResponseSerie0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112TimeseriesGroupResponseCodesResponseSerie0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112TimeseriesGroupDNSSECParams struct {
- // Aggregation interval results should be returned in (for example, in 15 minutes
- // or 1 hour intervals). Refer to
- // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
- AggInterval param.Field[RadarAS112TimeseriesGroupDNSSECParamsAggInterval] `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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarAS112TimeseriesGroupDNSSECParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Format results are returned in.
- Format param.Field[RadarAS112TimeseriesGroupDNSSECParamsFormat] `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"`
-}
-
-// URLQuery serializes [RadarAS112TimeseriesGroupDNSSECParams]'s query parameters
-// as `url.Values`.
-func (r RadarAS112TimeseriesGroupDNSSECParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Aggregation interval results should be returned in (for example, in 15 minutes
-// or 1 hour intervals). Refer to
-// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
-type RadarAS112TimeseriesGroupDNSSECParamsAggInterval string
-
-const (
- RadarAS112TimeseriesGroupDNSSECParamsAggInterval15m RadarAS112TimeseriesGroupDNSSECParamsAggInterval = "15m"
- RadarAS112TimeseriesGroupDNSSECParamsAggInterval1h RadarAS112TimeseriesGroupDNSSECParamsAggInterval = "1h"
- RadarAS112TimeseriesGroupDNSSECParamsAggInterval1d RadarAS112TimeseriesGroupDNSSECParamsAggInterval = "1d"
- RadarAS112TimeseriesGroupDNSSECParamsAggInterval1w RadarAS112TimeseriesGroupDNSSECParamsAggInterval = "1w"
-)
-
-type RadarAS112TimeseriesGroupDNSSECParamsDateRange string
-
-const (
- RadarAS112TimeseriesGroupDNSSECParamsDateRange1d RadarAS112TimeseriesGroupDNSSECParamsDateRange = "1d"
- RadarAS112TimeseriesGroupDNSSECParamsDateRange2d RadarAS112TimeseriesGroupDNSSECParamsDateRange = "2d"
- RadarAS112TimeseriesGroupDNSSECParamsDateRange7d RadarAS112TimeseriesGroupDNSSECParamsDateRange = "7d"
- RadarAS112TimeseriesGroupDNSSECParamsDateRange14d RadarAS112TimeseriesGroupDNSSECParamsDateRange = "14d"
- RadarAS112TimeseriesGroupDNSSECParamsDateRange28d RadarAS112TimeseriesGroupDNSSECParamsDateRange = "28d"
- RadarAS112TimeseriesGroupDNSSECParamsDateRange12w RadarAS112TimeseriesGroupDNSSECParamsDateRange = "12w"
- RadarAS112TimeseriesGroupDNSSECParamsDateRange24w RadarAS112TimeseriesGroupDNSSECParamsDateRange = "24w"
- RadarAS112TimeseriesGroupDNSSECParamsDateRange52w RadarAS112TimeseriesGroupDNSSECParamsDateRange = "52w"
- RadarAS112TimeseriesGroupDNSSECParamsDateRange1dControl RadarAS112TimeseriesGroupDNSSECParamsDateRange = "1dControl"
- RadarAS112TimeseriesGroupDNSSECParamsDateRange2dControl RadarAS112TimeseriesGroupDNSSECParamsDateRange = "2dControl"
- RadarAS112TimeseriesGroupDNSSECParamsDateRange7dControl RadarAS112TimeseriesGroupDNSSECParamsDateRange = "7dControl"
- RadarAS112TimeseriesGroupDNSSECParamsDateRange14dControl RadarAS112TimeseriesGroupDNSSECParamsDateRange = "14dControl"
- RadarAS112TimeseriesGroupDNSSECParamsDateRange28dControl RadarAS112TimeseriesGroupDNSSECParamsDateRange = "28dControl"
- RadarAS112TimeseriesGroupDNSSECParamsDateRange12wControl RadarAS112TimeseriesGroupDNSSECParamsDateRange = "12wControl"
- RadarAS112TimeseriesGroupDNSSECParamsDateRange24wControl RadarAS112TimeseriesGroupDNSSECParamsDateRange = "24wControl"
-)
-
-// Format results are returned in.
-type RadarAS112TimeseriesGroupDNSSECParamsFormat string
-
-const (
- RadarAS112TimeseriesGroupDNSSECParamsFormatJson RadarAS112TimeseriesGroupDNSSECParamsFormat = "JSON"
- RadarAS112TimeseriesGroupDNSSECParamsFormatCsv RadarAS112TimeseriesGroupDNSSECParamsFormat = "CSV"
-)
-
-type RadarAS112TimeseriesGroupDNSSECResponseEnvelope struct {
- Result RadarAS112TimeseriesGroupDNSSECResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarAS112TimeseriesGroupDNSSECResponseEnvelopeJSON `json:"-"`
-}
-
-// radarAS112TimeseriesGroupDNSSECResponseEnvelopeJSON contains the JSON metadata
-// for the struct [RadarAS112TimeseriesGroupDNSSECResponseEnvelope]
-type radarAS112TimeseriesGroupDNSSECResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112TimeseriesGroupDNSSECResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112TimeseriesGroupDNSSECResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112TimeseriesGroupEdnsParams struct {
- // Aggregation interval results should be returned in (for example, in 15 minutes
- // or 1 hour intervals). Refer to
- // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
- AggInterval param.Field[RadarAS112TimeseriesGroupEdnsParamsAggInterval] `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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarAS112TimeseriesGroupEdnsParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Format results are returned in.
- Format param.Field[RadarAS112TimeseriesGroupEdnsParamsFormat] `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"`
-}
-
-// URLQuery serializes [RadarAS112TimeseriesGroupEdnsParams]'s query parameters as
-// `url.Values`.
-func (r RadarAS112TimeseriesGroupEdnsParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Aggregation interval results should be returned in (for example, in 15 minutes
-// or 1 hour intervals). Refer to
-// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
-type RadarAS112TimeseriesGroupEdnsParamsAggInterval string
-
-const (
- RadarAS112TimeseriesGroupEdnsParamsAggInterval15m RadarAS112TimeseriesGroupEdnsParamsAggInterval = "15m"
- RadarAS112TimeseriesGroupEdnsParamsAggInterval1h RadarAS112TimeseriesGroupEdnsParamsAggInterval = "1h"
- RadarAS112TimeseriesGroupEdnsParamsAggInterval1d RadarAS112TimeseriesGroupEdnsParamsAggInterval = "1d"
- RadarAS112TimeseriesGroupEdnsParamsAggInterval1w RadarAS112TimeseriesGroupEdnsParamsAggInterval = "1w"
-)
-
-type RadarAS112TimeseriesGroupEdnsParamsDateRange string
-
-const (
- RadarAS112TimeseriesGroupEdnsParamsDateRange1d RadarAS112TimeseriesGroupEdnsParamsDateRange = "1d"
- RadarAS112TimeseriesGroupEdnsParamsDateRange2d RadarAS112TimeseriesGroupEdnsParamsDateRange = "2d"
- RadarAS112TimeseriesGroupEdnsParamsDateRange7d RadarAS112TimeseriesGroupEdnsParamsDateRange = "7d"
- RadarAS112TimeseriesGroupEdnsParamsDateRange14d RadarAS112TimeseriesGroupEdnsParamsDateRange = "14d"
- RadarAS112TimeseriesGroupEdnsParamsDateRange28d RadarAS112TimeseriesGroupEdnsParamsDateRange = "28d"
- RadarAS112TimeseriesGroupEdnsParamsDateRange12w RadarAS112TimeseriesGroupEdnsParamsDateRange = "12w"
- RadarAS112TimeseriesGroupEdnsParamsDateRange24w RadarAS112TimeseriesGroupEdnsParamsDateRange = "24w"
- RadarAS112TimeseriesGroupEdnsParamsDateRange52w RadarAS112TimeseriesGroupEdnsParamsDateRange = "52w"
- RadarAS112TimeseriesGroupEdnsParamsDateRange1dControl RadarAS112TimeseriesGroupEdnsParamsDateRange = "1dControl"
- RadarAS112TimeseriesGroupEdnsParamsDateRange2dControl RadarAS112TimeseriesGroupEdnsParamsDateRange = "2dControl"
- RadarAS112TimeseriesGroupEdnsParamsDateRange7dControl RadarAS112TimeseriesGroupEdnsParamsDateRange = "7dControl"
- RadarAS112TimeseriesGroupEdnsParamsDateRange14dControl RadarAS112TimeseriesGroupEdnsParamsDateRange = "14dControl"
- RadarAS112TimeseriesGroupEdnsParamsDateRange28dControl RadarAS112TimeseriesGroupEdnsParamsDateRange = "28dControl"
- RadarAS112TimeseriesGroupEdnsParamsDateRange12wControl RadarAS112TimeseriesGroupEdnsParamsDateRange = "12wControl"
- RadarAS112TimeseriesGroupEdnsParamsDateRange24wControl RadarAS112TimeseriesGroupEdnsParamsDateRange = "24wControl"
-)
-
-// Format results are returned in.
-type RadarAS112TimeseriesGroupEdnsParamsFormat string
-
-const (
- RadarAS112TimeseriesGroupEdnsParamsFormatJson RadarAS112TimeseriesGroupEdnsParamsFormat = "JSON"
- RadarAS112TimeseriesGroupEdnsParamsFormatCsv RadarAS112TimeseriesGroupEdnsParamsFormat = "CSV"
-)
-
-type RadarAS112TimeseriesGroupEdnsResponseEnvelope struct {
- Result RadarAS112TimeseriesGroupEdnsResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarAS112TimeseriesGroupEdnsResponseEnvelopeJSON `json:"-"`
-}
-
-// radarAS112TimeseriesGroupEdnsResponseEnvelopeJSON contains the JSON metadata for
-// the struct [RadarAS112TimeseriesGroupEdnsResponseEnvelope]
-type radarAS112TimeseriesGroupEdnsResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112TimeseriesGroupEdnsResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112TimeseriesGroupEdnsResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112TimeseriesGroupIPVersionParams struct {
- // Aggregation interval results should be returned in (for example, in 15 minutes
- // or 1 hour intervals). Refer to
- // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
- AggInterval param.Field[RadarAS112TimeseriesGroupIPVersionParamsAggInterval] `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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarAS112TimeseriesGroupIPVersionParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Format results are returned in.
- Format param.Field[RadarAS112TimeseriesGroupIPVersionParamsFormat] `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"`
-}
-
-// URLQuery serializes [RadarAS112TimeseriesGroupIPVersionParams]'s query
-// parameters as `url.Values`.
-func (r RadarAS112TimeseriesGroupIPVersionParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Aggregation interval results should be returned in (for example, in 15 minutes
-// or 1 hour intervals). Refer to
-// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
-type RadarAS112TimeseriesGroupIPVersionParamsAggInterval string
-
-const (
- RadarAS112TimeseriesGroupIPVersionParamsAggInterval15m RadarAS112TimeseriesGroupIPVersionParamsAggInterval = "15m"
- RadarAS112TimeseriesGroupIPVersionParamsAggInterval1h RadarAS112TimeseriesGroupIPVersionParamsAggInterval = "1h"
- RadarAS112TimeseriesGroupIPVersionParamsAggInterval1d RadarAS112TimeseriesGroupIPVersionParamsAggInterval = "1d"
- RadarAS112TimeseriesGroupIPVersionParamsAggInterval1w RadarAS112TimeseriesGroupIPVersionParamsAggInterval = "1w"
-)
-
-type RadarAS112TimeseriesGroupIPVersionParamsDateRange string
-
-const (
- RadarAS112TimeseriesGroupIPVersionParamsDateRange1d RadarAS112TimeseriesGroupIPVersionParamsDateRange = "1d"
- RadarAS112TimeseriesGroupIPVersionParamsDateRange2d RadarAS112TimeseriesGroupIPVersionParamsDateRange = "2d"
- RadarAS112TimeseriesGroupIPVersionParamsDateRange7d RadarAS112TimeseriesGroupIPVersionParamsDateRange = "7d"
- RadarAS112TimeseriesGroupIPVersionParamsDateRange14d RadarAS112TimeseriesGroupIPVersionParamsDateRange = "14d"
- RadarAS112TimeseriesGroupIPVersionParamsDateRange28d RadarAS112TimeseriesGroupIPVersionParamsDateRange = "28d"
- RadarAS112TimeseriesGroupIPVersionParamsDateRange12w RadarAS112TimeseriesGroupIPVersionParamsDateRange = "12w"
- RadarAS112TimeseriesGroupIPVersionParamsDateRange24w RadarAS112TimeseriesGroupIPVersionParamsDateRange = "24w"
- RadarAS112TimeseriesGroupIPVersionParamsDateRange52w RadarAS112TimeseriesGroupIPVersionParamsDateRange = "52w"
- RadarAS112TimeseriesGroupIPVersionParamsDateRange1dControl RadarAS112TimeseriesGroupIPVersionParamsDateRange = "1dControl"
- RadarAS112TimeseriesGroupIPVersionParamsDateRange2dControl RadarAS112TimeseriesGroupIPVersionParamsDateRange = "2dControl"
- RadarAS112TimeseriesGroupIPVersionParamsDateRange7dControl RadarAS112TimeseriesGroupIPVersionParamsDateRange = "7dControl"
- RadarAS112TimeseriesGroupIPVersionParamsDateRange14dControl RadarAS112TimeseriesGroupIPVersionParamsDateRange = "14dControl"
- RadarAS112TimeseriesGroupIPVersionParamsDateRange28dControl RadarAS112TimeseriesGroupIPVersionParamsDateRange = "28dControl"
- RadarAS112TimeseriesGroupIPVersionParamsDateRange12wControl RadarAS112TimeseriesGroupIPVersionParamsDateRange = "12wControl"
- RadarAS112TimeseriesGroupIPVersionParamsDateRange24wControl RadarAS112TimeseriesGroupIPVersionParamsDateRange = "24wControl"
-)
-
-// Format results are returned in.
-type RadarAS112TimeseriesGroupIPVersionParamsFormat string
-
-const (
- RadarAS112TimeseriesGroupIPVersionParamsFormatJson RadarAS112TimeseriesGroupIPVersionParamsFormat = "JSON"
- RadarAS112TimeseriesGroupIPVersionParamsFormatCsv RadarAS112TimeseriesGroupIPVersionParamsFormat = "CSV"
-)
-
-type RadarAS112TimeseriesGroupIPVersionResponseEnvelope struct {
- Result RadarAS112TimeseriesGroupIPVersionResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarAS112TimeseriesGroupIPVersionResponseEnvelopeJSON `json:"-"`
-}
-
-// radarAS112TimeseriesGroupIPVersionResponseEnvelopeJSON contains the JSON
-// metadata for the struct [RadarAS112TimeseriesGroupIPVersionResponseEnvelope]
-type radarAS112TimeseriesGroupIPVersionResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112TimeseriesGroupIPVersionResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112TimeseriesGroupIPVersionResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112TimeseriesGroupProtocolParams struct {
- // Aggregation interval results should be returned in (for example, in 15 minutes
- // or 1 hour intervals). Refer to
- // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
- AggInterval param.Field[RadarAS112TimeseriesGroupProtocolParamsAggInterval] `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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarAS112TimeseriesGroupProtocolParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Format results are returned in.
- Format param.Field[RadarAS112TimeseriesGroupProtocolParamsFormat] `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"`
-}
-
-// URLQuery serializes [RadarAS112TimeseriesGroupProtocolParams]'s query parameters
-// as `url.Values`.
-func (r RadarAS112TimeseriesGroupProtocolParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Aggregation interval results should be returned in (for example, in 15 minutes
-// or 1 hour intervals). Refer to
-// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
-type RadarAS112TimeseriesGroupProtocolParamsAggInterval string
-
-const (
- RadarAS112TimeseriesGroupProtocolParamsAggInterval15m RadarAS112TimeseriesGroupProtocolParamsAggInterval = "15m"
- RadarAS112TimeseriesGroupProtocolParamsAggInterval1h RadarAS112TimeseriesGroupProtocolParamsAggInterval = "1h"
- RadarAS112TimeseriesGroupProtocolParamsAggInterval1d RadarAS112TimeseriesGroupProtocolParamsAggInterval = "1d"
- RadarAS112TimeseriesGroupProtocolParamsAggInterval1w RadarAS112TimeseriesGroupProtocolParamsAggInterval = "1w"
-)
-
-type RadarAS112TimeseriesGroupProtocolParamsDateRange string
-
-const (
- RadarAS112TimeseriesGroupProtocolParamsDateRange1d RadarAS112TimeseriesGroupProtocolParamsDateRange = "1d"
- RadarAS112TimeseriesGroupProtocolParamsDateRange2d RadarAS112TimeseriesGroupProtocolParamsDateRange = "2d"
- RadarAS112TimeseriesGroupProtocolParamsDateRange7d RadarAS112TimeseriesGroupProtocolParamsDateRange = "7d"
- RadarAS112TimeseriesGroupProtocolParamsDateRange14d RadarAS112TimeseriesGroupProtocolParamsDateRange = "14d"
- RadarAS112TimeseriesGroupProtocolParamsDateRange28d RadarAS112TimeseriesGroupProtocolParamsDateRange = "28d"
- RadarAS112TimeseriesGroupProtocolParamsDateRange12w RadarAS112TimeseriesGroupProtocolParamsDateRange = "12w"
- RadarAS112TimeseriesGroupProtocolParamsDateRange24w RadarAS112TimeseriesGroupProtocolParamsDateRange = "24w"
- RadarAS112TimeseriesGroupProtocolParamsDateRange52w RadarAS112TimeseriesGroupProtocolParamsDateRange = "52w"
- RadarAS112TimeseriesGroupProtocolParamsDateRange1dControl RadarAS112TimeseriesGroupProtocolParamsDateRange = "1dControl"
- RadarAS112TimeseriesGroupProtocolParamsDateRange2dControl RadarAS112TimeseriesGroupProtocolParamsDateRange = "2dControl"
- RadarAS112TimeseriesGroupProtocolParamsDateRange7dControl RadarAS112TimeseriesGroupProtocolParamsDateRange = "7dControl"
- RadarAS112TimeseriesGroupProtocolParamsDateRange14dControl RadarAS112TimeseriesGroupProtocolParamsDateRange = "14dControl"
- RadarAS112TimeseriesGroupProtocolParamsDateRange28dControl RadarAS112TimeseriesGroupProtocolParamsDateRange = "28dControl"
- RadarAS112TimeseriesGroupProtocolParamsDateRange12wControl RadarAS112TimeseriesGroupProtocolParamsDateRange = "12wControl"
- RadarAS112TimeseriesGroupProtocolParamsDateRange24wControl RadarAS112TimeseriesGroupProtocolParamsDateRange = "24wControl"
-)
-
-// Format results are returned in.
-type RadarAS112TimeseriesGroupProtocolParamsFormat string
-
-const (
- RadarAS112TimeseriesGroupProtocolParamsFormatJson RadarAS112TimeseriesGroupProtocolParamsFormat = "JSON"
- RadarAS112TimeseriesGroupProtocolParamsFormatCsv RadarAS112TimeseriesGroupProtocolParamsFormat = "CSV"
-)
-
-type RadarAS112TimeseriesGroupProtocolResponseEnvelope struct {
- Result RadarAS112TimeseriesGroupProtocolResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarAS112TimeseriesGroupProtocolResponseEnvelopeJSON `json:"-"`
-}
-
-// radarAS112TimeseriesGroupProtocolResponseEnvelopeJSON contains the JSON metadata
-// for the struct [RadarAS112TimeseriesGroupProtocolResponseEnvelope]
-type radarAS112TimeseriesGroupProtocolResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112TimeseriesGroupProtocolResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112TimeseriesGroupProtocolResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112TimeseriesGroupQueryTypeParams struct {
- // Aggregation interval results should be returned in (for example, in 15 minutes
- // or 1 hour intervals). Refer to
- // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
- AggInterval param.Field[RadarAS112TimeseriesGroupQueryTypeParamsAggInterval] `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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarAS112TimeseriesGroupQueryTypeParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Format results are returned in.
- Format param.Field[RadarAS112TimeseriesGroupQueryTypeParamsFormat] `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"`
-}
-
-// URLQuery serializes [RadarAS112TimeseriesGroupQueryTypeParams]'s query
-// parameters as `url.Values`.
-func (r RadarAS112TimeseriesGroupQueryTypeParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Aggregation interval results should be returned in (for example, in 15 minutes
-// or 1 hour intervals). Refer to
-// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
-type RadarAS112TimeseriesGroupQueryTypeParamsAggInterval string
-
-const (
- RadarAS112TimeseriesGroupQueryTypeParamsAggInterval15m RadarAS112TimeseriesGroupQueryTypeParamsAggInterval = "15m"
- RadarAS112TimeseriesGroupQueryTypeParamsAggInterval1h RadarAS112TimeseriesGroupQueryTypeParamsAggInterval = "1h"
- RadarAS112TimeseriesGroupQueryTypeParamsAggInterval1d RadarAS112TimeseriesGroupQueryTypeParamsAggInterval = "1d"
- RadarAS112TimeseriesGroupQueryTypeParamsAggInterval1w RadarAS112TimeseriesGroupQueryTypeParamsAggInterval = "1w"
-)
-
-type RadarAS112TimeseriesGroupQueryTypeParamsDateRange string
-
-const (
- RadarAS112TimeseriesGroupQueryTypeParamsDateRange1d RadarAS112TimeseriesGroupQueryTypeParamsDateRange = "1d"
- RadarAS112TimeseriesGroupQueryTypeParamsDateRange2d RadarAS112TimeseriesGroupQueryTypeParamsDateRange = "2d"
- RadarAS112TimeseriesGroupQueryTypeParamsDateRange7d RadarAS112TimeseriesGroupQueryTypeParamsDateRange = "7d"
- RadarAS112TimeseriesGroupQueryTypeParamsDateRange14d RadarAS112TimeseriesGroupQueryTypeParamsDateRange = "14d"
- RadarAS112TimeseriesGroupQueryTypeParamsDateRange28d RadarAS112TimeseriesGroupQueryTypeParamsDateRange = "28d"
- RadarAS112TimeseriesGroupQueryTypeParamsDateRange12w RadarAS112TimeseriesGroupQueryTypeParamsDateRange = "12w"
- RadarAS112TimeseriesGroupQueryTypeParamsDateRange24w RadarAS112TimeseriesGroupQueryTypeParamsDateRange = "24w"
- RadarAS112TimeseriesGroupQueryTypeParamsDateRange52w RadarAS112TimeseriesGroupQueryTypeParamsDateRange = "52w"
- RadarAS112TimeseriesGroupQueryTypeParamsDateRange1dControl RadarAS112TimeseriesGroupQueryTypeParamsDateRange = "1dControl"
- RadarAS112TimeseriesGroupQueryTypeParamsDateRange2dControl RadarAS112TimeseriesGroupQueryTypeParamsDateRange = "2dControl"
- RadarAS112TimeseriesGroupQueryTypeParamsDateRange7dControl RadarAS112TimeseriesGroupQueryTypeParamsDateRange = "7dControl"
- RadarAS112TimeseriesGroupQueryTypeParamsDateRange14dControl RadarAS112TimeseriesGroupQueryTypeParamsDateRange = "14dControl"
- RadarAS112TimeseriesGroupQueryTypeParamsDateRange28dControl RadarAS112TimeseriesGroupQueryTypeParamsDateRange = "28dControl"
- RadarAS112TimeseriesGroupQueryTypeParamsDateRange12wControl RadarAS112TimeseriesGroupQueryTypeParamsDateRange = "12wControl"
- RadarAS112TimeseriesGroupQueryTypeParamsDateRange24wControl RadarAS112TimeseriesGroupQueryTypeParamsDateRange = "24wControl"
-)
-
-// Format results are returned in.
-type RadarAS112TimeseriesGroupQueryTypeParamsFormat string
-
-const (
- RadarAS112TimeseriesGroupQueryTypeParamsFormatJson RadarAS112TimeseriesGroupQueryTypeParamsFormat = "JSON"
- RadarAS112TimeseriesGroupQueryTypeParamsFormatCsv RadarAS112TimeseriesGroupQueryTypeParamsFormat = "CSV"
-)
-
-type RadarAS112TimeseriesGroupQueryTypeResponseEnvelope struct {
- Result RadarAS112TimeseriesGroupQueryTypeResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarAS112TimeseriesGroupQueryTypeResponseEnvelopeJSON `json:"-"`
-}
-
-// radarAS112TimeseriesGroupQueryTypeResponseEnvelopeJSON contains the JSON
-// metadata for the struct [RadarAS112TimeseriesGroupQueryTypeResponseEnvelope]
-type radarAS112TimeseriesGroupQueryTypeResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112TimeseriesGroupQueryTypeResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112TimeseriesGroupQueryTypeResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112TimeseriesGroupResponseCodesParams struct {
- // Aggregation interval results should be returned in (for example, in 15 minutes
- // or 1 hour intervals). Refer to
- // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
- AggInterval param.Field[RadarAS112TimeseriesGroupResponseCodesParamsAggInterval] `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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarAS112TimeseriesGroupResponseCodesParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Format results are returned in.
- Format param.Field[RadarAS112TimeseriesGroupResponseCodesParamsFormat] `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"`
-}
-
-// URLQuery serializes [RadarAS112TimeseriesGroupResponseCodesParams]'s query
-// parameters as `url.Values`.
-func (r RadarAS112TimeseriesGroupResponseCodesParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Aggregation interval results should be returned in (for example, in 15 minutes
-// or 1 hour intervals). Refer to
-// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
-type RadarAS112TimeseriesGroupResponseCodesParamsAggInterval string
-
-const (
- RadarAS112TimeseriesGroupResponseCodesParamsAggInterval15m RadarAS112TimeseriesGroupResponseCodesParamsAggInterval = "15m"
- RadarAS112TimeseriesGroupResponseCodesParamsAggInterval1h RadarAS112TimeseriesGroupResponseCodesParamsAggInterval = "1h"
- RadarAS112TimeseriesGroupResponseCodesParamsAggInterval1d RadarAS112TimeseriesGroupResponseCodesParamsAggInterval = "1d"
- RadarAS112TimeseriesGroupResponseCodesParamsAggInterval1w RadarAS112TimeseriesGroupResponseCodesParamsAggInterval = "1w"
-)
-
-type RadarAS112TimeseriesGroupResponseCodesParamsDateRange string
-
-const (
- RadarAS112TimeseriesGroupResponseCodesParamsDateRange1d RadarAS112TimeseriesGroupResponseCodesParamsDateRange = "1d"
- RadarAS112TimeseriesGroupResponseCodesParamsDateRange2d RadarAS112TimeseriesGroupResponseCodesParamsDateRange = "2d"
- RadarAS112TimeseriesGroupResponseCodesParamsDateRange7d RadarAS112TimeseriesGroupResponseCodesParamsDateRange = "7d"
- RadarAS112TimeseriesGroupResponseCodesParamsDateRange14d RadarAS112TimeseriesGroupResponseCodesParamsDateRange = "14d"
- RadarAS112TimeseriesGroupResponseCodesParamsDateRange28d RadarAS112TimeseriesGroupResponseCodesParamsDateRange = "28d"
- RadarAS112TimeseriesGroupResponseCodesParamsDateRange12w RadarAS112TimeseriesGroupResponseCodesParamsDateRange = "12w"
- RadarAS112TimeseriesGroupResponseCodesParamsDateRange24w RadarAS112TimeseriesGroupResponseCodesParamsDateRange = "24w"
- RadarAS112TimeseriesGroupResponseCodesParamsDateRange52w RadarAS112TimeseriesGroupResponseCodesParamsDateRange = "52w"
- RadarAS112TimeseriesGroupResponseCodesParamsDateRange1dControl RadarAS112TimeseriesGroupResponseCodesParamsDateRange = "1dControl"
- RadarAS112TimeseriesGroupResponseCodesParamsDateRange2dControl RadarAS112TimeseriesGroupResponseCodesParamsDateRange = "2dControl"
- RadarAS112TimeseriesGroupResponseCodesParamsDateRange7dControl RadarAS112TimeseriesGroupResponseCodesParamsDateRange = "7dControl"
- RadarAS112TimeseriesGroupResponseCodesParamsDateRange14dControl RadarAS112TimeseriesGroupResponseCodesParamsDateRange = "14dControl"
- RadarAS112TimeseriesGroupResponseCodesParamsDateRange28dControl RadarAS112TimeseriesGroupResponseCodesParamsDateRange = "28dControl"
- RadarAS112TimeseriesGroupResponseCodesParamsDateRange12wControl RadarAS112TimeseriesGroupResponseCodesParamsDateRange = "12wControl"
- RadarAS112TimeseriesGroupResponseCodesParamsDateRange24wControl RadarAS112TimeseriesGroupResponseCodesParamsDateRange = "24wControl"
-)
-
-// Format results are returned in.
-type RadarAS112TimeseriesGroupResponseCodesParamsFormat string
-
-const (
- RadarAS112TimeseriesGroupResponseCodesParamsFormatJson RadarAS112TimeseriesGroupResponseCodesParamsFormat = "JSON"
- RadarAS112TimeseriesGroupResponseCodesParamsFormatCsv RadarAS112TimeseriesGroupResponseCodesParamsFormat = "CSV"
-)
-
-type RadarAS112TimeseriesGroupResponseCodesResponseEnvelope struct {
- Result RadarAS112TimeseriesGroupResponseCodesResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarAS112TimeseriesGroupResponseCodesResponseEnvelopeJSON `json:"-"`
-}
-
-// radarAS112TimeseriesGroupResponseCodesResponseEnvelopeJSON contains the JSON
-// metadata for the struct [RadarAS112TimeseriesGroupResponseCodesResponseEnvelope]
-type radarAS112TimeseriesGroupResponseCodesResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112TimeseriesGroupResponseCodesResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112TimeseriesGroupResponseCodesResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
diff --git a/radaras112timeseriesgroup_test.go b/radaras112timeseriesgroup_test.go
deleted file mode 100644
index be431c781ab..00000000000
--- a/radaras112timeseriesgroup_test.go
+++ /dev/null
@@ -1,219 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
- "time"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRadarAS112TimeseriesGroupDNSSECWithOptionalParams(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"),
- )
- _, 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()}),
- Format: cloudflare.F(cloudflare.RadarAS112TimeseriesGroupDNSSECParamsFormatJson),
- 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())
- }
-}
-
-func TestRadarAS112TimeseriesGroupEdnsWithOptionalParams(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"),
- )
- _, 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()}),
- Format: cloudflare.F(cloudflare.RadarAS112TimeseriesGroupEdnsParamsFormatJson),
- 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())
- }
-}
-
-func TestRadarAS112TimeseriesGroupIPVersionWithOptionalParams(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"),
- )
- _, 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()}),
- Format: cloudflare.F(cloudflare.RadarAS112TimeseriesGroupIPVersionParamsFormatJson),
- 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())
- }
-}
-
-func TestRadarAS112TimeseriesGroupProtocolWithOptionalParams(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"),
- )
- _, 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()}),
- Format: cloudflare.F(cloudflare.RadarAS112TimeseriesGroupProtocolParamsFormatJson),
- 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())
- }
-}
-
-func TestRadarAS112TimeseriesGroupQueryTypeWithOptionalParams(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"),
- )
- _, 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()}),
- Format: cloudflare.F(cloudflare.RadarAS112TimeseriesGroupQueryTypeParamsFormatJson),
- 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())
- }
-}
-
-func TestRadarAS112TimeseriesGroupResponseCodesWithOptionalParams(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"),
- )
- _, 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()}),
- Format: cloudflare.F(cloudflare.RadarAS112TimeseriesGroupResponseCodesParamsFormatJson),
- 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/radaras112top.go b/radaras112top.go
deleted file mode 100644
index 05cc66585e7..00000000000
--- a/radaras112top.go
+++ /dev/null
@@ -1,1087 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarAS112TopService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewRadarAS112TopService] method
-// instead.
-type RadarAS112TopService struct {
- Options []option.RequestOption
-}
-
-// NewRadarAS112TopService generates a new service that applies the given options
-// to each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewRadarAS112TopService(opts ...option.RequestOption) (r *RadarAS112TopService) {
- r = &RadarAS112TopService{}
- r.Options = opts
- return
-}
-
-// Get the top locations by DNS queries DNSSEC support to AS112.
-func (r *RadarAS112TopService) DNSSEC(ctx context.Context, dnssec RadarAS112TopDNSSECParamsDNSSEC, query RadarAS112TopDNSSECParams, opts ...option.RequestOption) (res *RadarAS112TopDNSSECResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarAS112TopDNSSECResponseEnvelope
- path := fmt.Sprintf("radar/as112/top/locations/dnssec/%v", dnssec)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Get the top locations, by DNS queries EDNS support to AS112.
-func (r *RadarAS112TopService) Edns(ctx context.Context, edns RadarAS112TopEdnsParamsEdns, query RadarAS112TopEdnsParams, opts ...option.RequestOption) (res *RadarAS112TopEdnsResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarAS112TopEdnsResponseEnvelope
- path := fmt.Sprintf("radar/as112/top/locations/edns/%v", edns)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Get the top locations by DNS queries IP version to AS112.
-func (r *RadarAS112TopService) IPVersion(ctx context.Context, ipVersion RadarAS112TopIPVersionParamsIPVersion, query RadarAS112TopIPVersionParams, opts ...option.RequestOption) (res *RadarAS112TopIPVersionResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarAS112TopIPVersionResponseEnvelope
- path := fmt.Sprintf("radar/as112/top/locations/ip_version/%v", ipVersion)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Get the top locations by AS112 DNS queries. Values are a percentage out of the
-// total queries.
-func (r *RadarAS112TopService) Locations(ctx context.Context, query RadarAS112TopLocationsParams, opts ...option.RequestOption) (res *RadarAS112TopLocationsResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarAS112TopLocationsResponseEnvelope
- path := "radar/as112/top/locations"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type RadarAS112TopDNSSECResponse struct {
- Meta RadarAS112TopDNSSECResponseMeta `json:"meta,required"`
- Top0 []RadarAS112TopDNSSECResponseTop0 `json:"top_0,required"`
- JSON radarAS112TopDNSSECResponseJSON `json:"-"`
-}
-
-// radarAS112TopDNSSECResponseJSON contains the JSON metadata for the struct
-// [RadarAS112TopDNSSECResponse]
-type radarAS112TopDNSSECResponseJSON struct {
- Meta apijson.Field
- Top0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112TopDNSSECResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112TopDNSSECResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112TopDNSSECResponseMeta struct {
- DateRange []RadarAS112TopDNSSECResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- ConfidenceInfo RadarAS112TopDNSSECResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarAS112TopDNSSECResponseMetaJSON `json:"-"`
-}
-
-// radarAS112TopDNSSECResponseMetaJSON contains the JSON metadata for the struct
-// [RadarAS112TopDNSSECResponseMeta]
-type radarAS112TopDNSSECResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112TopDNSSECResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112TopDNSSECResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112TopDNSSECResponseMetaDateRange 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 radarAS112TopDNSSECResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarAS112TopDNSSECResponseMetaDateRangeJSON contains the JSON metadata for the
-// struct [RadarAS112TopDNSSECResponseMetaDateRange]
-type radarAS112TopDNSSECResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112TopDNSSECResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112TopDNSSECResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112TopDNSSECResponseMetaConfidenceInfo struct {
- Annotations []RadarAS112TopDNSSECResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarAS112TopDNSSECResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarAS112TopDNSSECResponseMetaConfidenceInfoJSON contains the JSON metadata for
-// the struct [RadarAS112TopDNSSECResponseMetaConfidenceInfo]
-type radarAS112TopDNSSECResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112TopDNSSECResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112TopDNSSECResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112TopDNSSECResponseMetaConfidenceInfoAnnotation 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 radarAS112TopDNSSECResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarAS112TopDNSSECResponseMetaConfidenceInfoAnnotationJSON contains the JSON
-// metadata for the struct
-// [RadarAS112TopDNSSECResponseMetaConfidenceInfoAnnotation]
-type radarAS112TopDNSSECResponseMetaConfidenceInfoAnnotationJSON 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 *RadarAS112TopDNSSECResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112TopDNSSECResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112TopDNSSECResponseTop0 struct {
- ClientCountryAlpha2 string `json:"clientCountryAlpha2,required"`
- ClientCountryName string `json:"clientCountryName,required"`
- Value string `json:"value,required"`
- JSON radarAS112TopDNSSECResponseTop0JSON `json:"-"`
-}
-
-// radarAS112TopDNSSECResponseTop0JSON contains the JSON metadata for the struct
-// [RadarAS112TopDNSSECResponseTop0]
-type radarAS112TopDNSSECResponseTop0JSON struct {
- ClientCountryAlpha2 apijson.Field
- ClientCountryName apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112TopDNSSECResponseTop0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112TopDNSSECResponseTop0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112TopEdnsResponse struct {
- Meta RadarAS112TopEdnsResponseMeta `json:"meta,required"`
- Top0 []RadarAS112TopEdnsResponseTop0 `json:"top_0,required"`
- JSON radarAS112TopEdnsResponseJSON `json:"-"`
-}
-
-// radarAS112TopEdnsResponseJSON contains the JSON metadata for the struct
-// [RadarAS112TopEdnsResponse]
-type radarAS112TopEdnsResponseJSON struct {
- Meta apijson.Field
- Top0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112TopEdnsResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112TopEdnsResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112TopEdnsResponseMeta struct {
- DateRange []RadarAS112TopEdnsResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- ConfidenceInfo RadarAS112TopEdnsResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarAS112TopEdnsResponseMetaJSON `json:"-"`
-}
-
-// radarAS112TopEdnsResponseMetaJSON contains the JSON metadata for the struct
-// [RadarAS112TopEdnsResponseMeta]
-type radarAS112TopEdnsResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112TopEdnsResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112TopEdnsResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112TopEdnsResponseMetaDateRange 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 radarAS112TopEdnsResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarAS112TopEdnsResponseMetaDateRangeJSON contains the JSON metadata for the
-// struct [RadarAS112TopEdnsResponseMetaDateRange]
-type radarAS112TopEdnsResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112TopEdnsResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112TopEdnsResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112TopEdnsResponseMetaConfidenceInfo struct {
- Annotations []RadarAS112TopEdnsResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarAS112TopEdnsResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarAS112TopEdnsResponseMetaConfidenceInfoJSON contains the JSON metadata for
-// the struct [RadarAS112TopEdnsResponseMetaConfidenceInfo]
-type radarAS112TopEdnsResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112TopEdnsResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112TopEdnsResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112TopEdnsResponseMetaConfidenceInfoAnnotation 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 radarAS112TopEdnsResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarAS112TopEdnsResponseMetaConfidenceInfoAnnotationJSON contains the JSON
-// metadata for the struct [RadarAS112TopEdnsResponseMetaConfidenceInfoAnnotation]
-type radarAS112TopEdnsResponseMetaConfidenceInfoAnnotationJSON 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 *RadarAS112TopEdnsResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112TopEdnsResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112TopEdnsResponseTop0 struct {
- ClientCountryAlpha2 string `json:"clientCountryAlpha2,required"`
- ClientCountryName string `json:"clientCountryName,required"`
- Value string `json:"value,required"`
- JSON radarAS112TopEdnsResponseTop0JSON `json:"-"`
-}
-
-// radarAS112TopEdnsResponseTop0JSON contains the JSON metadata for the struct
-// [RadarAS112TopEdnsResponseTop0]
-type radarAS112TopEdnsResponseTop0JSON struct {
- ClientCountryAlpha2 apijson.Field
- ClientCountryName apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112TopEdnsResponseTop0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112TopEdnsResponseTop0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112TopIPVersionResponse struct {
- Meta RadarAS112TopIPVersionResponseMeta `json:"meta,required"`
- Top0 []RadarAS112TopIPVersionResponseTop0 `json:"top_0,required"`
- JSON radarAS112TopIPVersionResponseJSON `json:"-"`
-}
-
-// radarAS112TopIPVersionResponseJSON contains the JSON metadata for the struct
-// [RadarAS112TopIPVersionResponse]
-type radarAS112TopIPVersionResponseJSON struct {
- Meta apijson.Field
- Top0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112TopIPVersionResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112TopIPVersionResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112TopIPVersionResponseMeta struct {
- DateRange []RadarAS112TopIPVersionResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- ConfidenceInfo RadarAS112TopIPVersionResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarAS112TopIPVersionResponseMetaJSON `json:"-"`
-}
-
-// radarAS112TopIPVersionResponseMetaJSON contains the JSON metadata for the struct
-// [RadarAS112TopIPVersionResponseMeta]
-type radarAS112TopIPVersionResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112TopIPVersionResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112TopIPVersionResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112TopIPVersionResponseMetaDateRange 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 radarAS112TopIPVersionResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarAS112TopIPVersionResponseMetaDateRangeJSON contains the JSON metadata for
-// the struct [RadarAS112TopIPVersionResponseMetaDateRange]
-type radarAS112TopIPVersionResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112TopIPVersionResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112TopIPVersionResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112TopIPVersionResponseMetaConfidenceInfo struct {
- Annotations []RadarAS112TopIPVersionResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarAS112TopIPVersionResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarAS112TopIPVersionResponseMetaConfidenceInfoJSON contains the JSON metadata
-// for the struct [RadarAS112TopIPVersionResponseMetaConfidenceInfo]
-type radarAS112TopIPVersionResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112TopIPVersionResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112TopIPVersionResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112TopIPVersionResponseMetaConfidenceInfoAnnotation 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 radarAS112TopIPVersionResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarAS112TopIPVersionResponseMetaConfidenceInfoAnnotationJSON contains the JSON
-// metadata for the struct
-// [RadarAS112TopIPVersionResponseMetaConfidenceInfoAnnotation]
-type radarAS112TopIPVersionResponseMetaConfidenceInfoAnnotationJSON 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 *RadarAS112TopIPVersionResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112TopIPVersionResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112TopIPVersionResponseTop0 struct {
- ClientCountryAlpha2 string `json:"clientCountryAlpha2,required"`
- ClientCountryName string `json:"clientCountryName,required"`
- Value string `json:"value,required"`
- JSON radarAS112TopIPVersionResponseTop0JSON `json:"-"`
-}
-
-// radarAS112TopIPVersionResponseTop0JSON contains the JSON metadata for the struct
-// [RadarAS112TopIPVersionResponseTop0]
-type radarAS112TopIPVersionResponseTop0JSON struct {
- ClientCountryAlpha2 apijson.Field
- ClientCountryName apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112TopIPVersionResponseTop0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112TopIPVersionResponseTop0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112TopLocationsResponse struct {
- Meta RadarAS112TopLocationsResponseMeta `json:"meta,required"`
- Top0 []RadarAS112TopLocationsResponseTop0 `json:"top_0,required"`
- JSON radarAS112TopLocationsResponseJSON `json:"-"`
-}
-
-// radarAS112TopLocationsResponseJSON contains the JSON metadata for the struct
-// [RadarAS112TopLocationsResponse]
-type radarAS112TopLocationsResponseJSON struct {
- Meta apijson.Field
- Top0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112TopLocationsResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112TopLocationsResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112TopLocationsResponseMeta struct {
- DateRange []RadarAS112TopLocationsResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- ConfidenceInfo RadarAS112TopLocationsResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarAS112TopLocationsResponseMetaJSON `json:"-"`
-}
-
-// radarAS112TopLocationsResponseMetaJSON contains the JSON metadata for the struct
-// [RadarAS112TopLocationsResponseMeta]
-type radarAS112TopLocationsResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112TopLocationsResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112TopLocationsResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112TopLocationsResponseMetaDateRange 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 radarAS112TopLocationsResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarAS112TopLocationsResponseMetaDateRangeJSON contains the JSON metadata for
-// the struct [RadarAS112TopLocationsResponseMetaDateRange]
-type radarAS112TopLocationsResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112TopLocationsResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112TopLocationsResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112TopLocationsResponseMetaConfidenceInfo struct {
- Annotations []RadarAS112TopLocationsResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarAS112TopLocationsResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarAS112TopLocationsResponseMetaConfidenceInfoJSON contains the JSON metadata
-// for the struct [RadarAS112TopLocationsResponseMetaConfidenceInfo]
-type radarAS112TopLocationsResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112TopLocationsResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112TopLocationsResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112TopLocationsResponseMetaConfidenceInfoAnnotation 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 radarAS112TopLocationsResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarAS112TopLocationsResponseMetaConfidenceInfoAnnotationJSON contains the JSON
-// metadata for the struct
-// [RadarAS112TopLocationsResponseMetaConfidenceInfoAnnotation]
-type radarAS112TopLocationsResponseMetaConfidenceInfoAnnotationJSON 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 *RadarAS112TopLocationsResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112TopLocationsResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112TopLocationsResponseTop0 struct {
- ClientCountryAlpha2 string `json:"clientCountryAlpha2,required"`
- ClientCountryName string `json:"clientCountryName,required"`
- Value string `json:"value,required"`
- JSON radarAS112TopLocationsResponseTop0JSON `json:"-"`
-}
-
-// radarAS112TopLocationsResponseTop0JSON contains the JSON metadata for the struct
-// [RadarAS112TopLocationsResponseTop0]
-type radarAS112TopLocationsResponseTop0JSON struct {
- ClientCountryAlpha2 apijson.Field
- ClientCountryName apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112TopLocationsResponseTop0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112TopLocationsResponseTop0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112TopDNSSECParams 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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarAS112TopDNSSECParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Format results are returned in.
- Format param.Field[RadarAS112TopDNSSECParamsFormat] `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 [RadarAS112TopDNSSECParams]'s query parameters as
-// `url.Values`.
-func (r RadarAS112TopDNSSECParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// DNSSEC.
-type RadarAS112TopDNSSECParamsDNSSEC string
-
-const (
- RadarAS112TopDNSSECParamsDNSSECSupported RadarAS112TopDNSSECParamsDNSSEC = "SUPPORTED"
- RadarAS112TopDNSSECParamsDNSSECNotSupported RadarAS112TopDNSSECParamsDNSSEC = "NOT_SUPPORTED"
-)
-
-type RadarAS112TopDNSSECParamsDateRange string
-
-const (
- RadarAS112TopDNSSECParamsDateRange1d RadarAS112TopDNSSECParamsDateRange = "1d"
- RadarAS112TopDNSSECParamsDateRange2d RadarAS112TopDNSSECParamsDateRange = "2d"
- RadarAS112TopDNSSECParamsDateRange7d RadarAS112TopDNSSECParamsDateRange = "7d"
- RadarAS112TopDNSSECParamsDateRange14d RadarAS112TopDNSSECParamsDateRange = "14d"
- RadarAS112TopDNSSECParamsDateRange28d RadarAS112TopDNSSECParamsDateRange = "28d"
- RadarAS112TopDNSSECParamsDateRange12w RadarAS112TopDNSSECParamsDateRange = "12w"
- RadarAS112TopDNSSECParamsDateRange24w RadarAS112TopDNSSECParamsDateRange = "24w"
- RadarAS112TopDNSSECParamsDateRange52w RadarAS112TopDNSSECParamsDateRange = "52w"
- RadarAS112TopDNSSECParamsDateRange1dControl RadarAS112TopDNSSECParamsDateRange = "1dControl"
- RadarAS112TopDNSSECParamsDateRange2dControl RadarAS112TopDNSSECParamsDateRange = "2dControl"
- RadarAS112TopDNSSECParamsDateRange7dControl RadarAS112TopDNSSECParamsDateRange = "7dControl"
- RadarAS112TopDNSSECParamsDateRange14dControl RadarAS112TopDNSSECParamsDateRange = "14dControl"
- RadarAS112TopDNSSECParamsDateRange28dControl RadarAS112TopDNSSECParamsDateRange = "28dControl"
- RadarAS112TopDNSSECParamsDateRange12wControl RadarAS112TopDNSSECParamsDateRange = "12wControl"
- RadarAS112TopDNSSECParamsDateRange24wControl RadarAS112TopDNSSECParamsDateRange = "24wControl"
-)
-
-// Format results are returned in.
-type RadarAS112TopDNSSECParamsFormat string
-
-const (
- RadarAS112TopDNSSECParamsFormatJson RadarAS112TopDNSSECParamsFormat = "JSON"
- RadarAS112TopDNSSECParamsFormatCsv RadarAS112TopDNSSECParamsFormat = "CSV"
-)
-
-type RadarAS112TopDNSSECResponseEnvelope struct {
- Result RadarAS112TopDNSSECResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarAS112TopDNSSECResponseEnvelopeJSON `json:"-"`
-}
-
-// radarAS112TopDNSSECResponseEnvelopeJSON contains the JSON metadata for the
-// struct [RadarAS112TopDNSSECResponseEnvelope]
-type radarAS112TopDNSSECResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112TopDNSSECResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112TopDNSSECResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112TopEdnsParams 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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarAS112TopEdnsParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Format results are returned in.
- Format param.Field[RadarAS112TopEdnsParamsFormat] `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 [RadarAS112TopEdnsParams]'s query parameters as
-// `url.Values`.
-func (r RadarAS112TopEdnsParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// EDNS.
-type RadarAS112TopEdnsParamsEdns string
-
-const (
- RadarAS112TopEdnsParamsEdnsSupported RadarAS112TopEdnsParamsEdns = "SUPPORTED"
- RadarAS112TopEdnsParamsEdnsNotSupported RadarAS112TopEdnsParamsEdns = "NOT_SUPPORTED"
-)
-
-type RadarAS112TopEdnsParamsDateRange string
-
-const (
- RadarAS112TopEdnsParamsDateRange1d RadarAS112TopEdnsParamsDateRange = "1d"
- RadarAS112TopEdnsParamsDateRange2d RadarAS112TopEdnsParamsDateRange = "2d"
- RadarAS112TopEdnsParamsDateRange7d RadarAS112TopEdnsParamsDateRange = "7d"
- RadarAS112TopEdnsParamsDateRange14d RadarAS112TopEdnsParamsDateRange = "14d"
- RadarAS112TopEdnsParamsDateRange28d RadarAS112TopEdnsParamsDateRange = "28d"
- RadarAS112TopEdnsParamsDateRange12w RadarAS112TopEdnsParamsDateRange = "12w"
- RadarAS112TopEdnsParamsDateRange24w RadarAS112TopEdnsParamsDateRange = "24w"
- RadarAS112TopEdnsParamsDateRange52w RadarAS112TopEdnsParamsDateRange = "52w"
- RadarAS112TopEdnsParamsDateRange1dControl RadarAS112TopEdnsParamsDateRange = "1dControl"
- RadarAS112TopEdnsParamsDateRange2dControl RadarAS112TopEdnsParamsDateRange = "2dControl"
- RadarAS112TopEdnsParamsDateRange7dControl RadarAS112TopEdnsParamsDateRange = "7dControl"
- RadarAS112TopEdnsParamsDateRange14dControl RadarAS112TopEdnsParamsDateRange = "14dControl"
- RadarAS112TopEdnsParamsDateRange28dControl RadarAS112TopEdnsParamsDateRange = "28dControl"
- RadarAS112TopEdnsParamsDateRange12wControl RadarAS112TopEdnsParamsDateRange = "12wControl"
- RadarAS112TopEdnsParamsDateRange24wControl RadarAS112TopEdnsParamsDateRange = "24wControl"
-)
-
-// Format results are returned in.
-type RadarAS112TopEdnsParamsFormat string
-
-const (
- RadarAS112TopEdnsParamsFormatJson RadarAS112TopEdnsParamsFormat = "JSON"
- RadarAS112TopEdnsParamsFormatCsv RadarAS112TopEdnsParamsFormat = "CSV"
-)
-
-type RadarAS112TopEdnsResponseEnvelope struct {
- Result RadarAS112TopEdnsResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarAS112TopEdnsResponseEnvelopeJSON `json:"-"`
-}
-
-// radarAS112TopEdnsResponseEnvelopeJSON contains the JSON metadata for the struct
-// [RadarAS112TopEdnsResponseEnvelope]
-type radarAS112TopEdnsResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112TopEdnsResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112TopEdnsResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112TopIPVersionParams 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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarAS112TopIPVersionParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Format results are returned in.
- Format param.Field[RadarAS112TopIPVersionParamsFormat] `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 [RadarAS112TopIPVersionParams]'s query parameters as
-// `url.Values`.
-func (r RadarAS112TopIPVersionParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// IP Version.
-type RadarAS112TopIPVersionParamsIPVersion string
-
-const (
- RadarAS112TopIPVersionParamsIPVersionIPv4 RadarAS112TopIPVersionParamsIPVersion = "IPv4"
- RadarAS112TopIPVersionParamsIPVersionIPv6 RadarAS112TopIPVersionParamsIPVersion = "IPv6"
-)
-
-type RadarAS112TopIPVersionParamsDateRange string
-
-const (
- RadarAS112TopIPVersionParamsDateRange1d RadarAS112TopIPVersionParamsDateRange = "1d"
- RadarAS112TopIPVersionParamsDateRange2d RadarAS112TopIPVersionParamsDateRange = "2d"
- RadarAS112TopIPVersionParamsDateRange7d RadarAS112TopIPVersionParamsDateRange = "7d"
- RadarAS112TopIPVersionParamsDateRange14d RadarAS112TopIPVersionParamsDateRange = "14d"
- RadarAS112TopIPVersionParamsDateRange28d RadarAS112TopIPVersionParamsDateRange = "28d"
- RadarAS112TopIPVersionParamsDateRange12w RadarAS112TopIPVersionParamsDateRange = "12w"
- RadarAS112TopIPVersionParamsDateRange24w RadarAS112TopIPVersionParamsDateRange = "24w"
- RadarAS112TopIPVersionParamsDateRange52w RadarAS112TopIPVersionParamsDateRange = "52w"
- RadarAS112TopIPVersionParamsDateRange1dControl RadarAS112TopIPVersionParamsDateRange = "1dControl"
- RadarAS112TopIPVersionParamsDateRange2dControl RadarAS112TopIPVersionParamsDateRange = "2dControl"
- RadarAS112TopIPVersionParamsDateRange7dControl RadarAS112TopIPVersionParamsDateRange = "7dControl"
- RadarAS112TopIPVersionParamsDateRange14dControl RadarAS112TopIPVersionParamsDateRange = "14dControl"
- RadarAS112TopIPVersionParamsDateRange28dControl RadarAS112TopIPVersionParamsDateRange = "28dControl"
- RadarAS112TopIPVersionParamsDateRange12wControl RadarAS112TopIPVersionParamsDateRange = "12wControl"
- RadarAS112TopIPVersionParamsDateRange24wControl RadarAS112TopIPVersionParamsDateRange = "24wControl"
-)
-
-// Format results are returned in.
-type RadarAS112TopIPVersionParamsFormat string
-
-const (
- RadarAS112TopIPVersionParamsFormatJson RadarAS112TopIPVersionParamsFormat = "JSON"
- RadarAS112TopIPVersionParamsFormatCsv RadarAS112TopIPVersionParamsFormat = "CSV"
-)
-
-type RadarAS112TopIPVersionResponseEnvelope struct {
- Result RadarAS112TopIPVersionResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarAS112TopIPVersionResponseEnvelopeJSON `json:"-"`
-}
-
-// radarAS112TopIPVersionResponseEnvelopeJSON contains the JSON metadata for the
-// struct [RadarAS112TopIPVersionResponseEnvelope]
-type radarAS112TopIPVersionResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112TopIPVersionResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112TopIPVersionResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAS112TopLocationsParams 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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarAS112TopLocationsParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Format results are returned in.
- Format param.Field[RadarAS112TopLocationsParamsFormat] `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 [RadarAS112TopLocationsParams]'s query parameters as
-// `url.Values`.
-func (r RadarAS112TopLocationsParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type RadarAS112TopLocationsParamsDateRange string
-
-const (
- RadarAS112TopLocationsParamsDateRange1d RadarAS112TopLocationsParamsDateRange = "1d"
- RadarAS112TopLocationsParamsDateRange2d RadarAS112TopLocationsParamsDateRange = "2d"
- RadarAS112TopLocationsParamsDateRange7d RadarAS112TopLocationsParamsDateRange = "7d"
- RadarAS112TopLocationsParamsDateRange14d RadarAS112TopLocationsParamsDateRange = "14d"
- RadarAS112TopLocationsParamsDateRange28d RadarAS112TopLocationsParamsDateRange = "28d"
- RadarAS112TopLocationsParamsDateRange12w RadarAS112TopLocationsParamsDateRange = "12w"
- RadarAS112TopLocationsParamsDateRange24w RadarAS112TopLocationsParamsDateRange = "24w"
- RadarAS112TopLocationsParamsDateRange52w RadarAS112TopLocationsParamsDateRange = "52w"
- RadarAS112TopLocationsParamsDateRange1dControl RadarAS112TopLocationsParamsDateRange = "1dControl"
- RadarAS112TopLocationsParamsDateRange2dControl RadarAS112TopLocationsParamsDateRange = "2dControl"
- RadarAS112TopLocationsParamsDateRange7dControl RadarAS112TopLocationsParamsDateRange = "7dControl"
- RadarAS112TopLocationsParamsDateRange14dControl RadarAS112TopLocationsParamsDateRange = "14dControl"
- RadarAS112TopLocationsParamsDateRange28dControl RadarAS112TopLocationsParamsDateRange = "28dControl"
- RadarAS112TopLocationsParamsDateRange12wControl RadarAS112TopLocationsParamsDateRange = "12wControl"
- RadarAS112TopLocationsParamsDateRange24wControl RadarAS112TopLocationsParamsDateRange = "24wControl"
-)
-
-// Format results are returned in.
-type RadarAS112TopLocationsParamsFormat string
-
-const (
- RadarAS112TopLocationsParamsFormatJson RadarAS112TopLocationsParamsFormat = "JSON"
- RadarAS112TopLocationsParamsFormatCsv RadarAS112TopLocationsParamsFormat = "CSV"
-)
-
-type RadarAS112TopLocationsResponseEnvelope struct {
- Result RadarAS112TopLocationsResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarAS112TopLocationsResponseEnvelopeJSON `json:"-"`
-}
-
-// radarAS112TopLocationsResponseEnvelopeJSON contains the JSON metadata for the
-// struct [RadarAS112TopLocationsResponseEnvelope]
-type radarAS112TopLocationsResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAS112TopLocationsResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAS112TopLocationsResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
diff --git a/radaras112top_test.go b/radaras112top_test.go
deleted file mode 100644
index b85552773fb..00000000000
--- a/radaras112top_test.go
+++ /dev/null
@@ -1,163 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
- "time"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRadarAS112TopDNSSECWithOptionalParams(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"),
- )
- _, err := client.Radar.AS112.Top.DNSSEC(
- context.TODO(),
- 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()}),
- Format: cloudflare.F(cloudflare.RadarAS112TopDNSSECParamsFormatJson),
- 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())
- }
-}
-
-func TestRadarAS112TopEdnsWithOptionalParams(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"),
- )
- _, err := client.Radar.AS112.Top.Edns(
- context.TODO(),
- 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()}),
- Format: cloudflare.F(cloudflare.RadarAS112TopEdnsParamsFormatJson),
- 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())
- }
-}
-
-func TestRadarAS112TopIPVersionWithOptionalParams(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"),
- )
- _, err := client.Radar.AS112.Top.IPVersion(
- context.TODO(),
- 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()}),
- Format: cloudflare.F(cloudflare.RadarAS112TopIPVersionParamsFormatJson),
- 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())
- }
-}
-
-func TestRadarAS112TopLocationsWithOptionalParams(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"),
- )
- _, 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()}),
- Format: cloudflare.F(cloudflare.RadarAS112TopLocationsParamsFormatJson),
- 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/radarattack.go b/radarattack.go
deleted file mode 100644
index 91a7ac3bfb0..00000000000
--- a/radarattack.go
+++ /dev/null
@@ -1,29 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarAttackService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewRadarAttackService] method
-// instead.
-type RadarAttackService struct {
- Options []option.RequestOption
- Layer3 *RadarAttackLayer3Service
- Layer7 *RadarAttackLayer7Service
-}
-
-// NewRadarAttackService generates a new service that applies the given options to
-// each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewRadarAttackService(opts ...option.RequestOption) (r *RadarAttackService) {
- r = &RadarAttackService{}
- r.Options = opts
- r.Layer3 = NewRadarAttackLayer3Service(opts...)
- r.Layer7 = NewRadarAttackLayer7Service(opts...)
- return
-}
diff --git a/radarattacklayer3.go b/radarattacklayer3.go
deleted file mode 100644
index 5d5cf0cf007..00000000000
--- a/radarattacklayer3.go
+++ /dev/null
@@ -1,256 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarAttackLayer3Service contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewRadarAttackLayer3Service] method
-// instead.
-type RadarAttackLayer3Service struct {
- Options []option.RequestOption
- Summary *RadarAttackLayer3SummaryService
- TimeseriesGroups *RadarAttackLayer3TimeseriesGroupService
- Top *RadarAttackLayer3TopService
-}
-
-// NewRadarAttackLayer3Service generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewRadarAttackLayer3Service(opts ...option.RequestOption) (r *RadarAttackLayer3Service) {
- r = &RadarAttackLayer3Service{}
- r.Options = opts
- r.Summary = NewRadarAttackLayer3SummaryService(opts...)
- r.TimeseriesGroups = NewRadarAttackLayer3TimeseriesGroupService(opts...)
- r.Top = NewRadarAttackLayer3TopService(opts...)
- return
-}
-
-// Get attacks change over time by bytes.
-func (r *RadarAttackLayer3Service) Timeseries(ctx context.Context, query RadarAttackLayer3TimeseriesParams, opts ...option.RequestOption) (res *RadarAttackLayer3TimeseriesResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarAttackLayer3TimeseriesResponseEnvelope
- path := "radar/attacks/layer3/timeseries"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type RadarAttackLayer3TimeseriesResponse struct {
- Meta interface{} `json:"meta,required"`
- Serie0 RadarAttackLayer3TimeseriesResponseSerie0 `json:"serie_0,required"`
- JSON radarAttackLayer3TimeseriesResponseJSON `json:"-"`
-}
-
-// radarAttackLayer3TimeseriesResponseJSON contains the JSON metadata for the
-// struct [RadarAttackLayer3TimeseriesResponse]
-type radarAttackLayer3TimeseriesResponseJSON struct {
- Meta apijson.Field
- Serie0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3TimeseriesResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3TimeseriesResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3TimeseriesResponseSerie0 struct {
- Timestamps []string `json:"timestamps,required"`
- Values []string `json:"values,required"`
- JSON radarAttackLayer3TimeseriesResponseSerie0JSON `json:"-"`
-}
-
-// radarAttackLayer3TimeseriesResponseSerie0JSON contains the JSON metadata for the
-// struct [RadarAttackLayer3TimeseriesResponseSerie0]
-type radarAttackLayer3TimeseriesResponseSerie0JSON struct {
- Timestamps apijson.Field
- Values apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3TimeseriesResponseSerie0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3TimeseriesResponseSerie0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3TimeseriesParams struct {
- // Aggregation interval results should be returned in (for example, in 15 minutes
- // or 1 hour intervals). Refer to
- // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
- AggInterval param.Field[RadarAttackLayer3TimeseriesParamsAggInterval] `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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarAttackLayer3TimeseriesParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Together with the `location` parameter, will apply the filter to origin or
- // target location.
- Direction param.Field[RadarAttackLayer3TimeseriesParamsDirection] `query:"direction"`
- // Format results are returned in.
- Format param.Field[RadarAttackLayer3TimeseriesParamsFormat] `query:"format"`
- // Filter for ip version.
- IPVersion param.Field[[]RadarAttackLayer3TimeseriesParamsIPVersion] `query:"ipVersion"`
- // 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"`
- // Measurement units, eg. bytes.
- Metric param.Field[RadarAttackLayer3TimeseriesParamsMetric] `query:"metric"`
- // Array of names that will be used to name the series in responses.
- Name param.Field[[]string] `query:"name"`
- // Normalization method applied. Refer to
- // [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/).
- Normalization param.Field[RadarAttackLayer3TimeseriesParamsNormalization] `query:"normalization"`
- // Array of L3/4 attack types.
- Protocol param.Field[[]RadarAttackLayer3TimeseriesParamsProtocol] `query:"protocol"`
-}
-
-// URLQuery serializes [RadarAttackLayer3TimeseriesParams]'s query parameters as
-// `url.Values`.
-func (r RadarAttackLayer3TimeseriesParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Aggregation interval results should be returned in (for example, in 15 minutes
-// or 1 hour intervals). Refer to
-// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
-type RadarAttackLayer3TimeseriesParamsAggInterval string
-
-const (
- RadarAttackLayer3TimeseriesParamsAggInterval15m RadarAttackLayer3TimeseriesParamsAggInterval = "15m"
- RadarAttackLayer3TimeseriesParamsAggInterval1h RadarAttackLayer3TimeseriesParamsAggInterval = "1h"
- RadarAttackLayer3TimeseriesParamsAggInterval1d RadarAttackLayer3TimeseriesParamsAggInterval = "1d"
- RadarAttackLayer3TimeseriesParamsAggInterval1w RadarAttackLayer3TimeseriesParamsAggInterval = "1w"
-)
-
-type RadarAttackLayer3TimeseriesParamsDateRange string
-
-const (
- RadarAttackLayer3TimeseriesParamsDateRange1d RadarAttackLayer3TimeseriesParamsDateRange = "1d"
- RadarAttackLayer3TimeseriesParamsDateRange2d RadarAttackLayer3TimeseriesParamsDateRange = "2d"
- RadarAttackLayer3TimeseriesParamsDateRange7d RadarAttackLayer3TimeseriesParamsDateRange = "7d"
- RadarAttackLayer3TimeseriesParamsDateRange14d RadarAttackLayer3TimeseriesParamsDateRange = "14d"
- RadarAttackLayer3TimeseriesParamsDateRange28d RadarAttackLayer3TimeseriesParamsDateRange = "28d"
- RadarAttackLayer3TimeseriesParamsDateRange12w RadarAttackLayer3TimeseriesParamsDateRange = "12w"
- RadarAttackLayer3TimeseriesParamsDateRange24w RadarAttackLayer3TimeseriesParamsDateRange = "24w"
- RadarAttackLayer3TimeseriesParamsDateRange52w RadarAttackLayer3TimeseriesParamsDateRange = "52w"
- RadarAttackLayer3TimeseriesParamsDateRange1dControl RadarAttackLayer3TimeseriesParamsDateRange = "1dControl"
- RadarAttackLayer3TimeseriesParamsDateRange2dControl RadarAttackLayer3TimeseriesParamsDateRange = "2dControl"
- RadarAttackLayer3TimeseriesParamsDateRange7dControl RadarAttackLayer3TimeseriesParamsDateRange = "7dControl"
- RadarAttackLayer3TimeseriesParamsDateRange14dControl RadarAttackLayer3TimeseriesParamsDateRange = "14dControl"
- RadarAttackLayer3TimeseriesParamsDateRange28dControl RadarAttackLayer3TimeseriesParamsDateRange = "28dControl"
- RadarAttackLayer3TimeseriesParamsDateRange12wControl RadarAttackLayer3TimeseriesParamsDateRange = "12wControl"
- RadarAttackLayer3TimeseriesParamsDateRange24wControl RadarAttackLayer3TimeseriesParamsDateRange = "24wControl"
-)
-
-// Together with the `location` parameter, will apply the filter to origin or
-// target location.
-type RadarAttackLayer3TimeseriesParamsDirection string
-
-const (
- RadarAttackLayer3TimeseriesParamsDirectionOrigin RadarAttackLayer3TimeseriesParamsDirection = "ORIGIN"
- RadarAttackLayer3TimeseriesParamsDirectionTarget RadarAttackLayer3TimeseriesParamsDirection = "TARGET"
-)
-
-// Format results are returned in.
-type RadarAttackLayer3TimeseriesParamsFormat string
-
-const (
- RadarAttackLayer3TimeseriesParamsFormatJson RadarAttackLayer3TimeseriesParamsFormat = "JSON"
- RadarAttackLayer3TimeseriesParamsFormatCsv RadarAttackLayer3TimeseriesParamsFormat = "CSV"
-)
-
-type RadarAttackLayer3TimeseriesParamsIPVersion string
-
-const (
- RadarAttackLayer3TimeseriesParamsIPVersionIPv4 RadarAttackLayer3TimeseriesParamsIPVersion = "IPv4"
- RadarAttackLayer3TimeseriesParamsIPVersionIPv6 RadarAttackLayer3TimeseriesParamsIPVersion = "IPv6"
-)
-
-// Measurement units, eg. bytes.
-type RadarAttackLayer3TimeseriesParamsMetric string
-
-const (
- RadarAttackLayer3TimeseriesParamsMetricBytes RadarAttackLayer3TimeseriesParamsMetric = "BYTES"
- RadarAttackLayer3TimeseriesParamsMetricBytesOld RadarAttackLayer3TimeseriesParamsMetric = "BYTES_OLD"
-)
-
-// Normalization method applied. Refer to
-// [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/).
-type RadarAttackLayer3TimeseriesParamsNormalization string
-
-const (
- RadarAttackLayer3TimeseriesParamsNormalizationPercentageChange RadarAttackLayer3TimeseriesParamsNormalization = "PERCENTAGE_CHANGE"
- RadarAttackLayer3TimeseriesParamsNormalizationMin0Max RadarAttackLayer3TimeseriesParamsNormalization = "MIN0_MAX"
-)
-
-type RadarAttackLayer3TimeseriesParamsProtocol string
-
-const (
- RadarAttackLayer3TimeseriesParamsProtocolUdp RadarAttackLayer3TimeseriesParamsProtocol = "UDP"
- RadarAttackLayer3TimeseriesParamsProtocolTcp RadarAttackLayer3TimeseriesParamsProtocol = "TCP"
- RadarAttackLayer3TimeseriesParamsProtocolIcmp RadarAttackLayer3TimeseriesParamsProtocol = "ICMP"
- RadarAttackLayer3TimeseriesParamsProtocolGRE RadarAttackLayer3TimeseriesParamsProtocol = "GRE"
-)
-
-type RadarAttackLayer3TimeseriesResponseEnvelope struct {
- Result RadarAttackLayer3TimeseriesResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarAttackLayer3TimeseriesResponseEnvelopeJSON `json:"-"`
-}
-
-// radarAttackLayer3TimeseriesResponseEnvelopeJSON contains the JSON metadata for
-// the struct [RadarAttackLayer3TimeseriesResponseEnvelope]
-type radarAttackLayer3TimeseriesResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3TimeseriesResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3TimeseriesResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
diff --git a/radarattacklayer3_test.go b/radarattacklayer3_test.go
deleted file mode 100644
index 299c8512005..00000000000
--- a/radarattacklayer3_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-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRadarAttackLayer3TimeseriesWithOptionalParams(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"),
- )
- _, 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()}),
- Direction: cloudflare.F(cloudflare.RadarAttackLayer3TimeseriesParamsDirectionOrigin),
- Format: cloudflare.F(cloudflare.RadarAttackLayer3TimeseriesParamsFormatJson),
- IPVersion: cloudflare.F([]cloudflare.RadarAttackLayer3TimeseriesParamsIPVersion{cloudflare.RadarAttackLayer3TimeseriesParamsIPVersionIPv4, cloudflare.RadarAttackLayer3TimeseriesParamsIPVersionIPv6}),
- Location: cloudflare.F([]string{"string", "string", "string"}),
- Metric: cloudflare.F(cloudflare.RadarAttackLayer3TimeseriesParamsMetricBytes),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- Normalization: cloudflare.F(cloudflare.RadarAttackLayer3TimeseriesParamsNormalizationMin0Max),
- Protocol: cloudflare.F([]cloudflare.RadarAttackLayer3TimeseriesParamsProtocol{cloudflare.RadarAttackLayer3TimeseriesParamsProtocolUdp, cloudflare.RadarAttackLayer3TimeseriesParamsProtocolTcp, cloudflare.RadarAttackLayer3TimeseriesParamsProtocolIcmp}),
- })
- 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/radarattacklayer3summary.go b/radarattacklayer3summary.go
deleted file mode 100644
index ecb8cb0e176..00000000000
--- a/radarattacklayer3summary.go
+++ /dev/null
@@ -1,1685 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarAttackLayer3SummaryService contains methods and other services that help
-// with interacting with the cloudflare API. Note, unlike clients, this service
-// does not read variables from the environment automatically. You should not
-// instantiate this service directly, and instead use the
-// [NewRadarAttackLayer3SummaryService] method instead.
-type RadarAttackLayer3SummaryService struct {
- Options []option.RequestOption
-}
-
-// NewRadarAttackLayer3SummaryService generates a new service that applies the
-// given options to each request. These options are applied after the parent
-// client's options (if there is one), and before any request-specific options.
-func NewRadarAttackLayer3SummaryService(opts ...option.RequestOption) (r *RadarAttackLayer3SummaryService) {
- r = &RadarAttackLayer3SummaryService{}
- r.Options = opts
- return
-}
-
-// Percentage distribution of attacks by bitrate.
-func (r *RadarAttackLayer3SummaryService) Bitrate(ctx context.Context, query RadarAttackLayer3SummaryBitrateParams, opts ...option.RequestOption) (res *RadarAttackLayer3SummaryBitrateResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarAttackLayer3SummaryBitrateResponseEnvelope
- path := "radar/attacks/layer3/summary/bitrate"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Percentage distribution of attacks by duration.
-func (r *RadarAttackLayer3SummaryService) Duration(ctx context.Context, query RadarAttackLayer3SummaryDurationParams, opts ...option.RequestOption) (res *RadarAttackLayer3SummaryDurationResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarAttackLayer3SummaryDurationResponseEnvelope
- path := "radar/attacks/layer3/summary/duration"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Percentage distribution of network protocols in layer 3/4 attacks over a given
-// time period.
-func (r *RadarAttackLayer3SummaryService) Get(ctx context.Context, query RadarAttackLayer3SummaryGetParams, opts ...option.RequestOption) (res *RadarAttackLayer3SummaryGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarAttackLayer3SummaryGetResponseEnvelope
- path := "radar/attacks/layer3/summary"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Percentage distribution of attacks by ip version used.
-func (r *RadarAttackLayer3SummaryService) IPVersion(ctx context.Context, query RadarAttackLayer3SummaryIPVersionParams, opts ...option.RequestOption) (res *RadarAttackLayer3SummaryIPVersionResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarAttackLayer3SummaryIPVersionResponseEnvelope
- path := "radar/attacks/layer3/summary/ip_version"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Percentage distribution of attacks by protocol used.
-func (r *RadarAttackLayer3SummaryService) Protocol(ctx context.Context, query RadarAttackLayer3SummaryProtocolParams, opts ...option.RequestOption) (res *RadarAttackLayer3SummaryProtocolResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarAttackLayer3SummaryProtocolResponseEnvelope
- path := "radar/attacks/layer3/summary/protocol"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Percentage distribution of attacks by vector.
-func (r *RadarAttackLayer3SummaryService) Vector(ctx context.Context, query RadarAttackLayer3SummaryVectorParams, opts ...option.RequestOption) (res *RadarAttackLayer3SummaryVectorResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarAttackLayer3SummaryVectorResponseEnvelope
- path := "radar/attacks/layer3/summary/vector"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type RadarAttackLayer3SummaryBitrateResponse struct {
- Meta RadarAttackLayer3SummaryBitrateResponseMeta `json:"meta,required"`
- Summary0 RadarAttackLayer3SummaryBitrateResponseSummary0 `json:"summary_0,required"`
- JSON radarAttackLayer3SummaryBitrateResponseJSON `json:"-"`
-}
-
-// radarAttackLayer3SummaryBitrateResponseJSON contains the JSON metadata for the
-// struct [RadarAttackLayer3SummaryBitrateResponse]
-type radarAttackLayer3SummaryBitrateResponseJSON struct {
- Meta apijson.Field
- Summary0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3SummaryBitrateResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3SummaryBitrateResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3SummaryBitrateResponseMeta struct {
- DateRange []RadarAttackLayer3SummaryBitrateResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- Normalization string `json:"normalization,required"`
- ConfidenceInfo RadarAttackLayer3SummaryBitrateResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarAttackLayer3SummaryBitrateResponseMetaJSON `json:"-"`
-}
-
-// radarAttackLayer3SummaryBitrateResponseMetaJSON contains the JSON metadata for
-// the struct [RadarAttackLayer3SummaryBitrateResponseMeta]
-type radarAttackLayer3SummaryBitrateResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- Normalization apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3SummaryBitrateResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3SummaryBitrateResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3SummaryBitrateResponseMetaDateRange 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 radarAttackLayer3SummaryBitrateResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarAttackLayer3SummaryBitrateResponseMetaDateRangeJSON contains the JSON
-// metadata for the struct [RadarAttackLayer3SummaryBitrateResponseMetaDateRange]
-type radarAttackLayer3SummaryBitrateResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3SummaryBitrateResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3SummaryBitrateResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3SummaryBitrateResponseMetaConfidenceInfo struct {
- Annotations []RadarAttackLayer3SummaryBitrateResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarAttackLayer3SummaryBitrateResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarAttackLayer3SummaryBitrateResponseMetaConfidenceInfoJSON contains the JSON
-// metadata for the struct
-// [RadarAttackLayer3SummaryBitrateResponseMetaConfidenceInfo]
-type radarAttackLayer3SummaryBitrateResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3SummaryBitrateResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3SummaryBitrateResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3SummaryBitrateResponseMetaConfidenceInfoAnnotation 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 radarAttackLayer3SummaryBitrateResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarAttackLayer3SummaryBitrateResponseMetaConfidenceInfoAnnotationJSON contains
-// the JSON metadata for the struct
-// [RadarAttackLayer3SummaryBitrateResponseMetaConfidenceInfoAnnotation]
-type radarAttackLayer3SummaryBitrateResponseMetaConfidenceInfoAnnotationJSON 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 *RadarAttackLayer3SummaryBitrateResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3SummaryBitrateResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3SummaryBitrateResponseSummary0 struct {
- Number1GbpsTo10Gbps string `json:"_1_GBPS_TO_10_GBPS,required"`
- Number10GbpsTo100Gbps string `json:"_10_GBPS_TO_100_GBPS,required"`
- Number500MbpsTo1Gbps string `json:"_500_MBPS_TO_1_GBPS,required"`
- Over100Gbps string `json:"OVER_100_GBPS,required"`
- Under500Mbps string `json:"UNDER_500_MBPS,required"`
- JSON radarAttackLayer3SummaryBitrateResponseSummary0JSON `json:"-"`
-}
-
-// radarAttackLayer3SummaryBitrateResponseSummary0JSON contains the JSON metadata
-// for the struct [RadarAttackLayer3SummaryBitrateResponseSummary0]
-type radarAttackLayer3SummaryBitrateResponseSummary0JSON struct {
- Number1GbpsTo10Gbps apijson.Field
- Number10GbpsTo100Gbps apijson.Field
- Number500MbpsTo1Gbps apijson.Field
- Over100Gbps apijson.Field
- Under500Mbps apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3SummaryBitrateResponseSummary0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3SummaryBitrateResponseSummary0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3SummaryDurationResponse struct {
- Meta RadarAttackLayer3SummaryDurationResponseMeta `json:"meta,required"`
- Summary0 RadarAttackLayer3SummaryDurationResponseSummary0 `json:"summary_0,required"`
- JSON radarAttackLayer3SummaryDurationResponseJSON `json:"-"`
-}
-
-// radarAttackLayer3SummaryDurationResponseJSON contains the JSON metadata for the
-// struct [RadarAttackLayer3SummaryDurationResponse]
-type radarAttackLayer3SummaryDurationResponseJSON struct {
- Meta apijson.Field
- Summary0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3SummaryDurationResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3SummaryDurationResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3SummaryDurationResponseMeta struct {
- DateRange []RadarAttackLayer3SummaryDurationResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- Normalization string `json:"normalization,required"`
- ConfidenceInfo RadarAttackLayer3SummaryDurationResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarAttackLayer3SummaryDurationResponseMetaJSON `json:"-"`
-}
-
-// radarAttackLayer3SummaryDurationResponseMetaJSON contains the JSON metadata for
-// the struct [RadarAttackLayer3SummaryDurationResponseMeta]
-type radarAttackLayer3SummaryDurationResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- Normalization apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3SummaryDurationResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3SummaryDurationResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3SummaryDurationResponseMetaDateRange 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 radarAttackLayer3SummaryDurationResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarAttackLayer3SummaryDurationResponseMetaDateRangeJSON contains the JSON
-// metadata for the struct [RadarAttackLayer3SummaryDurationResponseMetaDateRange]
-type radarAttackLayer3SummaryDurationResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3SummaryDurationResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3SummaryDurationResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3SummaryDurationResponseMetaConfidenceInfo struct {
- Annotations []RadarAttackLayer3SummaryDurationResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarAttackLayer3SummaryDurationResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarAttackLayer3SummaryDurationResponseMetaConfidenceInfoJSON contains the JSON
-// metadata for the struct
-// [RadarAttackLayer3SummaryDurationResponseMetaConfidenceInfo]
-type radarAttackLayer3SummaryDurationResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3SummaryDurationResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3SummaryDurationResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3SummaryDurationResponseMetaConfidenceInfoAnnotation 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 radarAttackLayer3SummaryDurationResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarAttackLayer3SummaryDurationResponseMetaConfidenceInfoAnnotationJSON
-// contains the JSON metadata for the struct
-// [RadarAttackLayer3SummaryDurationResponseMetaConfidenceInfoAnnotation]
-type radarAttackLayer3SummaryDurationResponseMetaConfidenceInfoAnnotationJSON 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 *RadarAttackLayer3SummaryDurationResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3SummaryDurationResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3SummaryDurationResponseSummary0 struct {
- Number1HourTo3Hours string `json:"_1_HOUR_TO_3_HOURS,required"`
- Number10MinsTo20Mins string `json:"_10_MINS_TO_20_MINS,required"`
- Number20MinsTo40Mins string `json:"_20_MINS_TO_40_MINS,required"`
- Number40MinsTo1Hour string `json:"_40_MINS_TO_1_HOUR,required"`
- Over3Hours string `json:"OVER_3_HOURS,required"`
- Under10Mins string `json:"UNDER_10_MINS,required"`
- JSON radarAttackLayer3SummaryDurationResponseSummary0JSON `json:"-"`
-}
-
-// radarAttackLayer3SummaryDurationResponseSummary0JSON contains the JSON metadata
-// for the struct [RadarAttackLayer3SummaryDurationResponseSummary0]
-type radarAttackLayer3SummaryDurationResponseSummary0JSON struct {
- Number1HourTo3Hours apijson.Field
- Number10MinsTo20Mins apijson.Field
- Number20MinsTo40Mins apijson.Field
- Number40MinsTo1Hour apijson.Field
- Over3Hours apijson.Field
- Under10Mins apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3SummaryDurationResponseSummary0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3SummaryDurationResponseSummary0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3SummaryGetResponse struct {
- Meta RadarAttackLayer3SummaryGetResponseMeta `json:"meta,required"`
- Summary0 RadarAttackLayer3SummaryGetResponseSummary0 `json:"summary_0,required"`
- JSON radarAttackLayer3SummaryGetResponseJSON `json:"-"`
-}
-
-// radarAttackLayer3SummaryGetResponseJSON contains the JSON metadata for the
-// struct [RadarAttackLayer3SummaryGetResponse]
-type radarAttackLayer3SummaryGetResponseJSON struct {
- Meta apijson.Field
- Summary0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3SummaryGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3SummaryGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3SummaryGetResponseMeta struct {
- DateRange []RadarAttackLayer3SummaryGetResponseMetaDateRange `json:"dateRange,required"`
- ConfidenceInfo RadarAttackLayer3SummaryGetResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarAttackLayer3SummaryGetResponseMetaJSON `json:"-"`
-}
-
-// radarAttackLayer3SummaryGetResponseMetaJSON contains the JSON metadata for the
-// struct [RadarAttackLayer3SummaryGetResponseMeta]
-type radarAttackLayer3SummaryGetResponseMetaJSON struct {
- DateRange apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3SummaryGetResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3SummaryGetResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3SummaryGetResponseMetaDateRange 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 radarAttackLayer3SummaryGetResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarAttackLayer3SummaryGetResponseMetaDateRangeJSON contains the JSON metadata
-// for the struct [RadarAttackLayer3SummaryGetResponseMetaDateRange]
-type radarAttackLayer3SummaryGetResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3SummaryGetResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3SummaryGetResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3SummaryGetResponseMetaConfidenceInfo struct {
- Annotations []RadarAttackLayer3SummaryGetResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarAttackLayer3SummaryGetResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarAttackLayer3SummaryGetResponseMetaConfidenceInfoJSON contains the JSON
-// metadata for the struct [RadarAttackLayer3SummaryGetResponseMetaConfidenceInfo]
-type radarAttackLayer3SummaryGetResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3SummaryGetResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3SummaryGetResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3SummaryGetResponseMetaConfidenceInfoAnnotation 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 radarAttackLayer3SummaryGetResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarAttackLayer3SummaryGetResponseMetaConfidenceInfoAnnotationJSON contains the
-// JSON metadata for the struct
-// [RadarAttackLayer3SummaryGetResponseMetaConfidenceInfoAnnotation]
-type radarAttackLayer3SummaryGetResponseMetaConfidenceInfoAnnotationJSON 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 *RadarAttackLayer3SummaryGetResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3SummaryGetResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3SummaryGetResponseSummary0 struct {
- GRE string `json:"gre,required"`
- Icmp string `json:"icmp,required"`
- Tcp string `json:"tcp,required"`
- Udp string `json:"udp,required"`
- JSON radarAttackLayer3SummaryGetResponseSummary0JSON `json:"-"`
-}
-
-// radarAttackLayer3SummaryGetResponseSummary0JSON contains the JSON metadata for
-// the struct [RadarAttackLayer3SummaryGetResponseSummary0]
-type radarAttackLayer3SummaryGetResponseSummary0JSON struct {
- GRE apijson.Field
- Icmp apijson.Field
- Tcp apijson.Field
- Udp apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3SummaryGetResponseSummary0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3SummaryGetResponseSummary0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3SummaryIPVersionResponse struct {
- Meta RadarAttackLayer3SummaryIPVersionResponseMeta `json:"meta,required"`
- Summary0 RadarAttackLayer3SummaryIPVersionResponseSummary0 `json:"summary_0,required"`
- JSON radarAttackLayer3SummaryIPVersionResponseJSON `json:"-"`
-}
-
-// radarAttackLayer3SummaryIPVersionResponseJSON contains the JSON metadata for the
-// struct [RadarAttackLayer3SummaryIPVersionResponse]
-type radarAttackLayer3SummaryIPVersionResponseJSON struct {
- Meta apijson.Field
- Summary0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3SummaryIPVersionResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3SummaryIPVersionResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3SummaryIPVersionResponseMeta struct {
- DateRange []RadarAttackLayer3SummaryIPVersionResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- Normalization string `json:"normalization,required"`
- ConfidenceInfo RadarAttackLayer3SummaryIPVersionResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarAttackLayer3SummaryIPVersionResponseMetaJSON `json:"-"`
-}
-
-// radarAttackLayer3SummaryIPVersionResponseMetaJSON contains the JSON metadata for
-// the struct [RadarAttackLayer3SummaryIPVersionResponseMeta]
-type radarAttackLayer3SummaryIPVersionResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- Normalization apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3SummaryIPVersionResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3SummaryIPVersionResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3SummaryIPVersionResponseMetaDateRange 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 radarAttackLayer3SummaryIPVersionResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarAttackLayer3SummaryIPVersionResponseMetaDateRangeJSON contains the JSON
-// metadata for the struct [RadarAttackLayer3SummaryIPVersionResponseMetaDateRange]
-type radarAttackLayer3SummaryIPVersionResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3SummaryIPVersionResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3SummaryIPVersionResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3SummaryIPVersionResponseMetaConfidenceInfo struct {
- Annotations []RadarAttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarAttackLayer3SummaryIPVersionResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarAttackLayer3SummaryIPVersionResponseMetaConfidenceInfoJSON contains the
-// JSON metadata for the struct
-// [RadarAttackLayer3SummaryIPVersionResponseMetaConfidenceInfo]
-type radarAttackLayer3SummaryIPVersionResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3SummaryIPVersionResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3SummaryIPVersionResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotation 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 radarAttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarAttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotationJSON
-// contains the JSON metadata for the struct
-// [RadarAttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotation]
-type radarAttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotationJSON 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 *RadarAttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3SummaryIPVersionResponseSummary0 struct {
- IPv4 string `json:"IPv4,required"`
- IPv6 string `json:"IPv6,required"`
- JSON radarAttackLayer3SummaryIPVersionResponseSummary0JSON `json:"-"`
-}
-
-// radarAttackLayer3SummaryIPVersionResponseSummary0JSON contains the JSON metadata
-// for the struct [RadarAttackLayer3SummaryIPVersionResponseSummary0]
-type radarAttackLayer3SummaryIPVersionResponseSummary0JSON struct {
- IPv4 apijson.Field
- IPv6 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3SummaryIPVersionResponseSummary0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3SummaryIPVersionResponseSummary0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3SummaryProtocolResponse struct {
- Meta RadarAttackLayer3SummaryProtocolResponseMeta `json:"meta,required"`
- Summary0 RadarAttackLayer3SummaryProtocolResponseSummary0 `json:"summary_0,required"`
- JSON radarAttackLayer3SummaryProtocolResponseJSON `json:"-"`
-}
-
-// radarAttackLayer3SummaryProtocolResponseJSON contains the JSON metadata for the
-// struct [RadarAttackLayer3SummaryProtocolResponse]
-type radarAttackLayer3SummaryProtocolResponseJSON struct {
- Meta apijson.Field
- Summary0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3SummaryProtocolResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3SummaryProtocolResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3SummaryProtocolResponseMeta struct {
- DateRange []RadarAttackLayer3SummaryProtocolResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- Normalization string `json:"normalization,required"`
- ConfidenceInfo RadarAttackLayer3SummaryProtocolResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarAttackLayer3SummaryProtocolResponseMetaJSON `json:"-"`
-}
-
-// radarAttackLayer3SummaryProtocolResponseMetaJSON contains the JSON metadata for
-// the struct [RadarAttackLayer3SummaryProtocolResponseMeta]
-type radarAttackLayer3SummaryProtocolResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- Normalization apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3SummaryProtocolResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3SummaryProtocolResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3SummaryProtocolResponseMetaDateRange 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 radarAttackLayer3SummaryProtocolResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarAttackLayer3SummaryProtocolResponseMetaDateRangeJSON contains the JSON
-// metadata for the struct [RadarAttackLayer3SummaryProtocolResponseMetaDateRange]
-type radarAttackLayer3SummaryProtocolResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3SummaryProtocolResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3SummaryProtocolResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3SummaryProtocolResponseMetaConfidenceInfo struct {
- Annotations []RadarAttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarAttackLayer3SummaryProtocolResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarAttackLayer3SummaryProtocolResponseMetaConfidenceInfoJSON contains the JSON
-// metadata for the struct
-// [RadarAttackLayer3SummaryProtocolResponseMetaConfidenceInfo]
-type radarAttackLayer3SummaryProtocolResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3SummaryProtocolResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3SummaryProtocolResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotation 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 radarAttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarAttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotationJSON
-// contains the JSON metadata for the struct
-// [RadarAttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotation]
-type radarAttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotationJSON 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 *RadarAttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3SummaryProtocolResponseSummary0 struct {
- GRE string `json:"GRE,required"`
- Icmp string `json:"ICMP,required"`
- Tcp string `json:"TCP,required"`
- Udp string `json:"UDP,required"`
- JSON radarAttackLayer3SummaryProtocolResponseSummary0JSON `json:"-"`
-}
-
-// radarAttackLayer3SummaryProtocolResponseSummary0JSON contains the JSON metadata
-// for the struct [RadarAttackLayer3SummaryProtocolResponseSummary0]
-type radarAttackLayer3SummaryProtocolResponseSummary0JSON struct {
- GRE apijson.Field
- Icmp apijson.Field
- Tcp apijson.Field
- Udp apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3SummaryProtocolResponseSummary0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3SummaryProtocolResponseSummary0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3SummaryVectorResponse struct {
- Meta RadarAttackLayer3SummaryVectorResponseMeta `json:"meta,required"`
- Summary0 map[string][]string `json:"summary_0,required"`
- JSON radarAttackLayer3SummaryVectorResponseJSON `json:"-"`
-}
-
-// radarAttackLayer3SummaryVectorResponseJSON contains the JSON metadata for the
-// struct [RadarAttackLayer3SummaryVectorResponse]
-type radarAttackLayer3SummaryVectorResponseJSON struct {
- Meta apijson.Field
- Summary0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3SummaryVectorResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3SummaryVectorResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3SummaryVectorResponseMeta struct {
- DateRange []RadarAttackLayer3SummaryVectorResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- Normalization string `json:"normalization,required"`
- ConfidenceInfo RadarAttackLayer3SummaryVectorResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarAttackLayer3SummaryVectorResponseMetaJSON `json:"-"`
-}
-
-// radarAttackLayer3SummaryVectorResponseMetaJSON contains the JSON metadata for
-// the struct [RadarAttackLayer3SummaryVectorResponseMeta]
-type radarAttackLayer3SummaryVectorResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- Normalization apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3SummaryVectorResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3SummaryVectorResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3SummaryVectorResponseMetaDateRange 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 radarAttackLayer3SummaryVectorResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarAttackLayer3SummaryVectorResponseMetaDateRangeJSON contains the JSON
-// metadata for the struct [RadarAttackLayer3SummaryVectorResponseMetaDateRange]
-type radarAttackLayer3SummaryVectorResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3SummaryVectorResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3SummaryVectorResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3SummaryVectorResponseMetaConfidenceInfo struct {
- Annotations []RadarAttackLayer3SummaryVectorResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarAttackLayer3SummaryVectorResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarAttackLayer3SummaryVectorResponseMetaConfidenceInfoJSON contains the JSON
-// metadata for the struct
-// [RadarAttackLayer3SummaryVectorResponseMetaConfidenceInfo]
-type radarAttackLayer3SummaryVectorResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3SummaryVectorResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3SummaryVectorResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3SummaryVectorResponseMetaConfidenceInfoAnnotation 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 radarAttackLayer3SummaryVectorResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarAttackLayer3SummaryVectorResponseMetaConfidenceInfoAnnotationJSON contains
-// the JSON metadata for the struct
-// [RadarAttackLayer3SummaryVectorResponseMetaConfidenceInfoAnnotation]
-type radarAttackLayer3SummaryVectorResponseMetaConfidenceInfoAnnotationJSON 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 *RadarAttackLayer3SummaryVectorResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3SummaryVectorResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarAttackLayer3SummaryBitrateParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Together with the `location` parameter, will apply the filter to origin or
- // target location.
- Direction param.Field[RadarAttackLayer3SummaryBitrateParamsDirection] `query:"direction"`
- // Format results are returned in.
- Format param.Field[RadarAttackLayer3SummaryBitrateParamsFormat] `query:"format"`
- // Filter for ip version.
- IPVersion param.Field[[]RadarAttackLayer3SummaryBitrateParamsIPVersion] `query:"ipVersion"`
- // 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"`
- // Array of L3/4 attack types.
- Protocol param.Field[[]RadarAttackLayer3SummaryBitrateParamsProtocol] `query:"protocol"`
-}
-
-// URLQuery serializes [RadarAttackLayer3SummaryBitrateParams]'s query parameters
-// as `url.Values`.
-func (r RadarAttackLayer3SummaryBitrateParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type RadarAttackLayer3SummaryBitrateParamsDateRange string
-
-const (
- RadarAttackLayer3SummaryBitrateParamsDateRange1d RadarAttackLayer3SummaryBitrateParamsDateRange = "1d"
- RadarAttackLayer3SummaryBitrateParamsDateRange2d RadarAttackLayer3SummaryBitrateParamsDateRange = "2d"
- RadarAttackLayer3SummaryBitrateParamsDateRange7d RadarAttackLayer3SummaryBitrateParamsDateRange = "7d"
- RadarAttackLayer3SummaryBitrateParamsDateRange14d RadarAttackLayer3SummaryBitrateParamsDateRange = "14d"
- RadarAttackLayer3SummaryBitrateParamsDateRange28d RadarAttackLayer3SummaryBitrateParamsDateRange = "28d"
- RadarAttackLayer3SummaryBitrateParamsDateRange12w RadarAttackLayer3SummaryBitrateParamsDateRange = "12w"
- RadarAttackLayer3SummaryBitrateParamsDateRange24w RadarAttackLayer3SummaryBitrateParamsDateRange = "24w"
- RadarAttackLayer3SummaryBitrateParamsDateRange52w RadarAttackLayer3SummaryBitrateParamsDateRange = "52w"
- RadarAttackLayer3SummaryBitrateParamsDateRange1dControl RadarAttackLayer3SummaryBitrateParamsDateRange = "1dControl"
- RadarAttackLayer3SummaryBitrateParamsDateRange2dControl RadarAttackLayer3SummaryBitrateParamsDateRange = "2dControl"
- RadarAttackLayer3SummaryBitrateParamsDateRange7dControl RadarAttackLayer3SummaryBitrateParamsDateRange = "7dControl"
- RadarAttackLayer3SummaryBitrateParamsDateRange14dControl RadarAttackLayer3SummaryBitrateParamsDateRange = "14dControl"
- RadarAttackLayer3SummaryBitrateParamsDateRange28dControl RadarAttackLayer3SummaryBitrateParamsDateRange = "28dControl"
- RadarAttackLayer3SummaryBitrateParamsDateRange12wControl RadarAttackLayer3SummaryBitrateParamsDateRange = "12wControl"
- RadarAttackLayer3SummaryBitrateParamsDateRange24wControl RadarAttackLayer3SummaryBitrateParamsDateRange = "24wControl"
-)
-
-// Together with the `location` parameter, will apply the filter to origin or
-// target location.
-type RadarAttackLayer3SummaryBitrateParamsDirection string
-
-const (
- RadarAttackLayer3SummaryBitrateParamsDirectionOrigin RadarAttackLayer3SummaryBitrateParamsDirection = "ORIGIN"
- RadarAttackLayer3SummaryBitrateParamsDirectionTarget RadarAttackLayer3SummaryBitrateParamsDirection = "TARGET"
-)
-
-// Format results are returned in.
-type RadarAttackLayer3SummaryBitrateParamsFormat string
-
-const (
- RadarAttackLayer3SummaryBitrateParamsFormatJson RadarAttackLayer3SummaryBitrateParamsFormat = "JSON"
- RadarAttackLayer3SummaryBitrateParamsFormatCsv RadarAttackLayer3SummaryBitrateParamsFormat = "CSV"
-)
-
-type RadarAttackLayer3SummaryBitrateParamsIPVersion string
-
-const (
- RadarAttackLayer3SummaryBitrateParamsIPVersionIPv4 RadarAttackLayer3SummaryBitrateParamsIPVersion = "IPv4"
- RadarAttackLayer3SummaryBitrateParamsIPVersionIPv6 RadarAttackLayer3SummaryBitrateParamsIPVersion = "IPv6"
-)
-
-type RadarAttackLayer3SummaryBitrateParamsProtocol string
-
-const (
- RadarAttackLayer3SummaryBitrateParamsProtocolUdp RadarAttackLayer3SummaryBitrateParamsProtocol = "UDP"
- RadarAttackLayer3SummaryBitrateParamsProtocolTcp RadarAttackLayer3SummaryBitrateParamsProtocol = "TCP"
- RadarAttackLayer3SummaryBitrateParamsProtocolIcmp RadarAttackLayer3SummaryBitrateParamsProtocol = "ICMP"
- RadarAttackLayer3SummaryBitrateParamsProtocolGRE RadarAttackLayer3SummaryBitrateParamsProtocol = "GRE"
-)
-
-type RadarAttackLayer3SummaryBitrateResponseEnvelope struct {
- Result RadarAttackLayer3SummaryBitrateResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarAttackLayer3SummaryBitrateResponseEnvelopeJSON `json:"-"`
-}
-
-// radarAttackLayer3SummaryBitrateResponseEnvelopeJSON contains the JSON metadata
-// for the struct [RadarAttackLayer3SummaryBitrateResponseEnvelope]
-type radarAttackLayer3SummaryBitrateResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3SummaryBitrateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3SummaryBitrateResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarAttackLayer3SummaryDurationParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Together with the `location` parameter, will apply the filter to origin or
- // target location.
- Direction param.Field[RadarAttackLayer3SummaryDurationParamsDirection] `query:"direction"`
- // Format results are returned in.
- Format param.Field[RadarAttackLayer3SummaryDurationParamsFormat] `query:"format"`
- // Filter for ip version.
- IPVersion param.Field[[]RadarAttackLayer3SummaryDurationParamsIPVersion] `query:"ipVersion"`
- // 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"`
- // Array of L3/4 attack types.
- Protocol param.Field[[]RadarAttackLayer3SummaryDurationParamsProtocol] `query:"protocol"`
-}
-
-// URLQuery serializes [RadarAttackLayer3SummaryDurationParams]'s query parameters
-// as `url.Values`.
-func (r RadarAttackLayer3SummaryDurationParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type RadarAttackLayer3SummaryDurationParamsDateRange string
-
-const (
- RadarAttackLayer3SummaryDurationParamsDateRange1d RadarAttackLayer3SummaryDurationParamsDateRange = "1d"
- RadarAttackLayer3SummaryDurationParamsDateRange2d RadarAttackLayer3SummaryDurationParamsDateRange = "2d"
- RadarAttackLayer3SummaryDurationParamsDateRange7d RadarAttackLayer3SummaryDurationParamsDateRange = "7d"
- RadarAttackLayer3SummaryDurationParamsDateRange14d RadarAttackLayer3SummaryDurationParamsDateRange = "14d"
- RadarAttackLayer3SummaryDurationParamsDateRange28d RadarAttackLayer3SummaryDurationParamsDateRange = "28d"
- RadarAttackLayer3SummaryDurationParamsDateRange12w RadarAttackLayer3SummaryDurationParamsDateRange = "12w"
- RadarAttackLayer3SummaryDurationParamsDateRange24w RadarAttackLayer3SummaryDurationParamsDateRange = "24w"
- RadarAttackLayer3SummaryDurationParamsDateRange52w RadarAttackLayer3SummaryDurationParamsDateRange = "52w"
- RadarAttackLayer3SummaryDurationParamsDateRange1dControl RadarAttackLayer3SummaryDurationParamsDateRange = "1dControl"
- RadarAttackLayer3SummaryDurationParamsDateRange2dControl RadarAttackLayer3SummaryDurationParamsDateRange = "2dControl"
- RadarAttackLayer3SummaryDurationParamsDateRange7dControl RadarAttackLayer3SummaryDurationParamsDateRange = "7dControl"
- RadarAttackLayer3SummaryDurationParamsDateRange14dControl RadarAttackLayer3SummaryDurationParamsDateRange = "14dControl"
- RadarAttackLayer3SummaryDurationParamsDateRange28dControl RadarAttackLayer3SummaryDurationParamsDateRange = "28dControl"
- RadarAttackLayer3SummaryDurationParamsDateRange12wControl RadarAttackLayer3SummaryDurationParamsDateRange = "12wControl"
- RadarAttackLayer3SummaryDurationParamsDateRange24wControl RadarAttackLayer3SummaryDurationParamsDateRange = "24wControl"
-)
-
-// Together with the `location` parameter, will apply the filter to origin or
-// target location.
-type RadarAttackLayer3SummaryDurationParamsDirection string
-
-const (
- RadarAttackLayer3SummaryDurationParamsDirectionOrigin RadarAttackLayer3SummaryDurationParamsDirection = "ORIGIN"
- RadarAttackLayer3SummaryDurationParamsDirectionTarget RadarAttackLayer3SummaryDurationParamsDirection = "TARGET"
-)
-
-// Format results are returned in.
-type RadarAttackLayer3SummaryDurationParamsFormat string
-
-const (
- RadarAttackLayer3SummaryDurationParamsFormatJson RadarAttackLayer3SummaryDurationParamsFormat = "JSON"
- RadarAttackLayer3SummaryDurationParamsFormatCsv RadarAttackLayer3SummaryDurationParamsFormat = "CSV"
-)
-
-type RadarAttackLayer3SummaryDurationParamsIPVersion string
-
-const (
- RadarAttackLayer3SummaryDurationParamsIPVersionIPv4 RadarAttackLayer3SummaryDurationParamsIPVersion = "IPv4"
- RadarAttackLayer3SummaryDurationParamsIPVersionIPv6 RadarAttackLayer3SummaryDurationParamsIPVersion = "IPv6"
-)
-
-type RadarAttackLayer3SummaryDurationParamsProtocol string
-
-const (
- RadarAttackLayer3SummaryDurationParamsProtocolUdp RadarAttackLayer3SummaryDurationParamsProtocol = "UDP"
- RadarAttackLayer3SummaryDurationParamsProtocolTcp RadarAttackLayer3SummaryDurationParamsProtocol = "TCP"
- RadarAttackLayer3SummaryDurationParamsProtocolIcmp RadarAttackLayer3SummaryDurationParamsProtocol = "ICMP"
- RadarAttackLayer3SummaryDurationParamsProtocolGRE RadarAttackLayer3SummaryDurationParamsProtocol = "GRE"
-)
-
-type RadarAttackLayer3SummaryDurationResponseEnvelope struct {
- Result RadarAttackLayer3SummaryDurationResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarAttackLayer3SummaryDurationResponseEnvelopeJSON `json:"-"`
-}
-
-// radarAttackLayer3SummaryDurationResponseEnvelopeJSON contains the JSON metadata
-// for the struct [RadarAttackLayer3SummaryDurationResponseEnvelope]
-type radarAttackLayer3SummaryDurationResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3SummaryDurationResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3SummaryDurationResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3SummaryGetParams 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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarAttackLayer3SummaryGetParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Format results are returned in.
- Format param.Field[RadarAttackLayer3SummaryGetParamsFormat] `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"`
-}
-
-// URLQuery serializes [RadarAttackLayer3SummaryGetParams]'s query parameters as
-// `url.Values`.
-func (r RadarAttackLayer3SummaryGetParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type RadarAttackLayer3SummaryGetParamsDateRange string
-
-const (
- RadarAttackLayer3SummaryGetParamsDateRange1d RadarAttackLayer3SummaryGetParamsDateRange = "1d"
- RadarAttackLayer3SummaryGetParamsDateRange2d RadarAttackLayer3SummaryGetParamsDateRange = "2d"
- RadarAttackLayer3SummaryGetParamsDateRange7d RadarAttackLayer3SummaryGetParamsDateRange = "7d"
- RadarAttackLayer3SummaryGetParamsDateRange14d RadarAttackLayer3SummaryGetParamsDateRange = "14d"
- RadarAttackLayer3SummaryGetParamsDateRange28d RadarAttackLayer3SummaryGetParamsDateRange = "28d"
- RadarAttackLayer3SummaryGetParamsDateRange12w RadarAttackLayer3SummaryGetParamsDateRange = "12w"
- RadarAttackLayer3SummaryGetParamsDateRange24w RadarAttackLayer3SummaryGetParamsDateRange = "24w"
- RadarAttackLayer3SummaryGetParamsDateRange52w RadarAttackLayer3SummaryGetParamsDateRange = "52w"
- RadarAttackLayer3SummaryGetParamsDateRange1dControl RadarAttackLayer3SummaryGetParamsDateRange = "1dControl"
- RadarAttackLayer3SummaryGetParamsDateRange2dControl RadarAttackLayer3SummaryGetParamsDateRange = "2dControl"
- RadarAttackLayer3SummaryGetParamsDateRange7dControl RadarAttackLayer3SummaryGetParamsDateRange = "7dControl"
- RadarAttackLayer3SummaryGetParamsDateRange14dControl RadarAttackLayer3SummaryGetParamsDateRange = "14dControl"
- RadarAttackLayer3SummaryGetParamsDateRange28dControl RadarAttackLayer3SummaryGetParamsDateRange = "28dControl"
- RadarAttackLayer3SummaryGetParamsDateRange12wControl RadarAttackLayer3SummaryGetParamsDateRange = "12wControl"
- RadarAttackLayer3SummaryGetParamsDateRange24wControl RadarAttackLayer3SummaryGetParamsDateRange = "24wControl"
-)
-
-// Format results are returned in.
-type RadarAttackLayer3SummaryGetParamsFormat string
-
-const (
- RadarAttackLayer3SummaryGetParamsFormatJson RadarAttackLayer3SummaryGetParamsFormat = "JSON"
- RadarAttackLayer3SummaryGetParamsFormatCsv RadarAttackLayer3SummaryGetParamsFormat = "CSV"
-)
-
-type RadarAttackLayer3SummaryGetResponseEnvelope struct {
- Result RadarAttackLayer3SummaryGetResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarAttackLayer3SummaryGetResponseEnvelopeJSON `json:"-"`
-}
-
-// radarAttackLayer3SummaryGetResponseEnvelopeJSON contains the JSON metadata for
-// the struct [RadarAttackLayer3SummaryGetResponseEnvelope]
-type radarAttackLayer3SummaryGetResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3SummaryGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3SummaryGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarAttackLayer3SummaryIPVersionParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Together with the `location` parameter, will apply the filter to origin or
- // target location.
- Direction param.Field[RadarAttackLayer3SummaryIPVersionParamsDirection] `query:"direction"`
- // Format results are returned in.
- Format param.Field[RadarAttackLayer3SummaryIPVersionParamsFormat] `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"`
- // Array of L3/4 attack types.
- Protocol param.Field[[]RadarAttackLayer3SummaryIPVersionParamsProtocol] `query:"protocol"`
-}
-
-// URLQuery serializes [RadarAttackLayer3SummaryIPVersionParams]'s query parameters
-// as `url.Values`.
-func (r RadarAttackLayer3SummaryIPVersionParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type RadarAttackLayer3SummaryIPVersionParamsDateRange string
-
-const (
- RadarAttackLayer3SummaryIPVersionParamsDateRange1d RadarAttackLayer3SummaryIPVersionParamsDateRange = "1d"
- RadarAttackLayer3SummaryIPVersionParamsDateRange2d RadarAttackLayer3SummaryIPVersionParamsDateRange = "2d"
- RadarAttackLayer3SummaryIPVersionParamsDateRange7d RadarAttackLayer3SummaryIPVersionParamsDateRange = "7d"
- RadarAttackLayer3SummaryIPVersionParamsDateRange14d RadarAttackLayer3SummaryIPVersionParamsDateRange = "14d"
- RadarAttackLayer3SummaryIPVersionParamsDateRange28d RadarAttackLayer3SummaryIPVersionParamsDateRange = "28d"
- RadarAttackLayer3SummaryIPVersionParamsDateRange12w RadarAttackLayer3SummaryIPVersionParamsDateRange = "12w"
- RadarAttackLayer3SummaryIPVersionParamsDateRange24w RadarAttackLayer3SummaryIPVersionParamsDateRange = "24w"
- RadarAttackLayer3SummaryIPVersionParamsDateRange52w RadarAttackLayer3SummaryIPVersionParamsDateRange = "52w"
- RadarAttackLayer3SummaryIPVersionParamsDateRange1dControl RadarAttackLayer3SummaryIPVersionParamsDateRange = "1dControl"
- RadarAttackLayer3SummaryIPVersionParamsDateRange2dControl RadarAttackLayer3SummaryIPVersionParamsDateRange = "2dControl"
- RadarAttackLayer3SummaryIPVersionParamsDateRange7dControl RadarAttackLayer3SummaryIPVersionParamsDateRange = "7dControl"
- RadarAttackLayer3SummaryIPVersionParamsDateRange14dControl RadarAttackLayer3SummaryIPVersionParamsDateRange = "14dControl"
- RadarAttackLayer3SummaryIPVersionParamsDateRange28dControl RadarAttackLayer3SummaryIPVersionParamsDateRange = "28dControl"
- RadarAttackLayer3SummaryIPVersionParamsDateRange12wControl RadarAttackLayer3SummaryIPVersionParamsDateRange = "12wControl"
- RadarAttackLayer3SummaryIPVersionParamsDateRange24wControl RadarAttackLayer3SummaryIPVersionParamsDateRange = "24wControl"
-)
-
-// Together with the `location` parameter, will apply the filter to origin or
-// target location.
-type RadarAttackLayer3SummaryIPVersionParamsDirection string
-
-const (
- RadarAttackLayer3SummaryIPVersionParamsDirectionOrigin RadarAttackLayer3SummaryIPVersionParamsDirection = "ORIGIN"
- RadarAttackLayer3SummaryIPVersionParamsDirectionTarget RadarAttackLayer3SummaryIPVersionParamsDirection = "TARGET"
-)
-
-// Format results are returned in.
-type RadarAttackLayer3SummaryIPVersionParamsFormat string
-
-const (
- RadarAttackLayer3SummaryIPVersionParamsFormatJson RadarAttackLayer3SummaryIPVersionParamsFormat = "JSON"
- RadarAttackLayer3SummaryIPVersionParamsFormatCsv RadarAttackLayer3SummaryIPVersionParamsFormat = "CSV"
-)
-
-type RadarAttackLayer3SummaryIPVersionParamsProtocol string
-
-const (
- RadarAttackLayer3SummaryIPVersionParamsProtocolUdp RadarAttackLayer3SummaryIPVersionParamsProtocol = "UDP"
- RadarAttackLayer3SummaryIPVersionParamsProtocolTcp RadarAttackLayer3SummaryIPVersionParamsProtocol = "TCP"
- RadarAttackLayer3SummaryIPVersionParamsProtocolIcmp RadarAttackLayer3SummaryIPVersionParamsProtocol = "ICMP"
- RadarAttackLayer3SummaryIPVersionParamsProtocolGRE RadarAttackLayer3SummaryIPVersionParamsProtocol = "GRE"
-)
-
-type RadarAttackLayer3SummaryIPVersionResponseEnvelope struct {
- Result RadarAttackLayer3SummaryIPVersionResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarAttackLayer3SummaryIPVersionResponseEnvelopeJSON `json:"-"`
-}
-
-// radarAttackLayer3SummaryIPVersionResponseEnvelopeJSON contains the JSON metadata
-// for the struct [RadarAttackLayer3SummaryIPVersionResponseEnvelope]
-type radarAttackLayer3SummaryIPVersionResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3SummaryIPVersionResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3SummaryIPVersionResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarAttackLayer3SummaryProtocolParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Together with the `location` parameter, will apply the filter to origin or
- // target location.
- Direction param.Field[RadarAttackLayer3SummaryProtocolParamsDirection] `query:"direction"`
- // Format results are returned in.
- Format param.Field[RadarAttackLayer3SummaryProtocolParamsFormat] `query:"format"`
- // Filter for ip version.
- IPVersion param.Field[[]RadarAttackLayer3SummaryProtocolParamsIPVersion] `query:"ipVersion"`
- // 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 [RadarAttackLayer3SummaryProtocolParams]'s query parameters
-// as `url.Values`.
-func (r RadarAttackLayer3SummaryProtocolParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type RadarAttackLayer3SummaryProtocolParamsDateRange string
-
-const (
- RadarAttackLayer3SummaryProtocolParamsDateRange1d RadarAttackLayer3SummaryProtocolParamsDateRange = "1d"
- RadarAttackLayer3SummaryProtocolParamsDateRange2d RadarAttackLayer3SummaryProtocolParamsDateRange = "2d"
- RadarAttackLayer3SummaryProtocolParamsDateRange7d RadarAttackLayer3SummaryProtocolParamsDateRange = "7d"
- RadarAttackLayer3SummaryProtocolParamsDateRange14d RadarAttackLayer3SummaryProtocolParamsDateRange = "14d"
- RadarAttackLayer3SummaryProtocolParamsDateRange28d RadarAttackLayer3SummaryProtocolParamsDateRange = "28d"
- RadarAttackLayer3SummaryProtocolParamsDateRange12w RadarAttackLayer3SummaryProtocolParamsDateRange = "12w"
- RadarAttackLayer3SummaryProtocolParamsDateRange24w RadarAttackLayer3SummaryProtocolParamsDateRange = "24w"
- RadarAttackLayer3SummaryProtocolParamsDateRange52w RadarAttackLayer3SummaryProtocolParamsDateRange = "52w"
- RadarAttackLayer3SummaryProtocolParamsDateRange1dControl RadarAttackLayer3SummaryProtocolParamsDateRange = "1dControl"
- RadarAttackLayer3SummaryProtocolParamsDateRange2dControl RadarAttackLayer3SummaryProtocolParamsDateRange = "2dControl"
- RadarAttackLayer3SummaryProtocolParamsDateRange7dControl RadarAttackLayer3SummaryProtocolParamsDateRange = "7dControl"
- RadarAttackLayer3SummaryProtocolParamsDateRange14dControl RadarAttackLayer3SummaryProtocolParamsDateRange = "14dControl"
- RadarAttackLayer3SummaryProtocolParamsDateRange28dControl RadarAttackLayer3SummaryProtocolParamsDateRange = "28dControl"
- RadarAttackLayer3SummaryProtocolParamsDateRange12wControl RadarAttackLayer3SummaryProtocolParamsDateRange = "12wControl"
- RadarAttackLayer3SummaryProtocolParamsDateRange24wControl RadarAttackLayer3SummaryProtocolParamsDateRange = "24wControl"
-)
-
-// Together with the `location` parameter, will apply the filter to origin or
-// target location.
-type RadarAttackLayer3SummaryProtocolParamsDirection string
-
-const (
- RadarAttackLayer3SummaryProtocolParamsDirectionOrigin RadarAttackLayer3SummaryProtocolParamsDirection = "ORIGIN"
- RadarAttackLayer3SummaryProtocolParamsDirectionTarget RadarAttackLayer3SummaryProtocolParamsDirection = "TARGET"
-)
-
-// Format results are returned in.
-type RadarAttackLayer3SummaryProtocolParamsFormat string
-
-const (
- RadarAttackLayer3SummaryProtocolParamsFormatJson RadarAttackLayer3SummaryProtocolParamsFormat = "JSON"
- RadarAttackLayer3SummaryProtocolParamsFormatCsv RadarAttackLayer3SummaryProtocolParamsFormat = "CSV"
-)
-
-type RadarAttackLayer3SummaryProtocolParamsIPVersion string
-
-const (
- RadarAttackLayer3SummaryProtocolParamsIPVersionIPv4 RadarAttackLayer3SummaryProtocolParamsIPVersion = "IPv4"
- RadarAttackLayer3SummaryProtocolParamsIPVersionIPv6 RadarAttackLayer3SummaryProtocolParamsIPVersion = "IPv6"
-)
-
-type RadarAttackLayer3SummaryProtocolResponseEnvelope struct {
- Result RadarAttackLayer3SummaryProtocolResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarAttackLayer3SummaryProtocolResponseEnvelopeJSON `json:"-"`
-}
-
-// radarAttackLayer3SummaryProtocolResponseEnvelopeJSON contains the JSON metadata
-// for the struct [RadarAttackLayer3SummaryProtocolResponseEnvelope]
-type radarAttackLayer3SummaryProtocolResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3SummaryProtocolResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3SummaryProtocolResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarAttackLayer3SummaryVectorParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Together with the `location` parameter, will apply the filter to origin or
- // target location.
- Direction param.Field[RadarAttackLayer3SummaryVectorParamsDirection] `query:"direction"`
- // Format results are returned in.
- Format param.Field[RadarAttackLayer3SummaryVectorParamsFormat] `query:"format"`
- // Filter for ip version.
- IPVersion param.Field[[]RadarAttackLayer3SummaryVectorParamsIPVersion] `query:"ipVersion"`
- // 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"`
- // Array of L3/4 attack types.
- Protocol param.Field[[]RadarAttackLayer3SummaryVectorParamsProtocol] `query:"protocol"`
-}
-
-// URLQuery serializes [RadarAttackLayer3SummaryVectorParams]'s query parameters as
-// `url.Values`.
-func (r RadarAttackLayer3SummaryVectorParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type RadarAttackLayer3SummaryVectorParamsDateRange string
-
-const (
- RadarAttackLayer3SummaryVectorParamsDateRange1d RadarAttackLayer3SummaryVectorParamsDateRange = "1d"
- RadarAttackLayer3SummaryVectorParamsDateRange2d RadarAttackLayer3SummaryVectorParamsDateRange = "2d"
- RadarAttackLayer3SummaryVectorParamsDateRange7d RadarAttackLayer3SummaryVectorParamsDateRange = "7d"
- RadarAttackLayer3SummaryVectorParamsDateRange14d RadarAttackLayer3SummaryVectorParamsDateRange = "14d"
- RadarAttackLayer3SummaryVectorParamsDateRange28d RadarAttackLayer3SummaryVectorParamsDateRange = "28d"
- RadarAttackLayer3SummaryVectorParamsDateRange12w RadarAttackLayer3SummaryVectorParamsDateRange = "12w"
- RadarAttackLayer3SummaryVectorParamsDateRange24w RadarAttackLayer3SummaryVectorParamsDateRange = "24w"
- RadarAttackLayer3SummaryVectorParamsDateRange52w RadarAttackLayer3SummaryVectorParamsDateRange = "52w"
- RadarAttackLayer3SummaryVectorParamsDateRange1dControl RadarAttackLayer3SummaryVectorParamsDateRange = "1dControl"
- RadarAttackLayer3SummaryVectorParamsDateRange2dControl RadarAttackLayer3SummaryVectorParamsDateRange = "2dControl"
- RadarAttackLayer3SummaryVectorParamsDateRange7dControl RadarAttackLayer3SummaryVectorParamsDateRange = "7dControl"
- RadarAttackLayer3SummaryVectorParamsDateRange14dControl RadarAttackLayer3SummaryVectorParamsDateRange = "14dControl"
- RadarAttackLayer3SummaryVectorParamsDateRange28dControl RadarAttackLayer3SummaryVectorParamsDateRange = "28dControl"
- RadarAttackLayer3SummaryVectorParamsDateRange12wControl RadarAttackLayer3SummaryVectorParamsDateRange = "12wControl"
- RadarAttackLayer3SummaryVectorParamsDateRange24wControl RadarAttackLayer3SummaryVectorParamsDateRange = "24wControl"
-)
-
-// Together with the `location` parameter, will apply the filter to origin or
-// target location.
-type RadarAttackLayer3SummaryVectorParamsDirection string
-
-const (
- RadarAttackLayer3SummaryVectorParamsDirectionOrigin RadarAttackLayer3SummaryVectorParamsDirection = "ORIGIN"
- RadarAttackLayer3SummaryVectorParamsDirectionTarget RadarAttackLayer3SummaryVectorParamsDirection = "TARGET"
-)
-
-// Format results are returned in.
-type RadarAttackLayer3SummaryVectorParamsFormat string
-
-const (
- RadarAttackLayer3SummaryVectorParamsFormatJson RadarAttackLayer3SummaryVectorParamsFormat = "JSON"
- RadarAttackLayer3SummaryVectorParamsFormatCsv RadarAttackLayer3SummaryVectorParamsFormat = "CSV"
-)
-
-type RadarAttackLayer3SummaryVectorParamsIPVersion string
-
-const (
- RadarAttackLayer3SummaryVectorParamsIPVersionIPv4 RadarAttackLayer3SummaryVectorParamsIPVersion = "IPv4"
- RadarAttackLayer3SummaryVectorParamsIPVersionIPv6 RadarAttackLayer3SummaryVectorParamsIPVersion = "IPv6"
-)
-
-type RadarAttackLayer3SummaryVectorParamsProtocol string
-
-const (
- RadarAttackLayer3SummaryVectorParamsProtocolUdp RadarAttackLayer3SummaryVectorParamsProtocol = "UDP"
- RadarAttackLayer3SummaryVectorParamsProtocolTcp RadarAttackLayer3SummaryVectorParamsProtocol = "TCP"
- RadarAttackLayer3SummaryVectorParamsProtocolIcmp RadarAttackLayer3SummaryVectorParamsProtocol = "ICMP"
- RadarAttackLayer3SummaryVectorParamsProtocolGRE RadarAttackLayer3SummaryVectorParamsProtocol = "GRE"
-)
-
-type RadarAttackLayer3SummaryVectorResponseEnvelope struct {
- Result RadarAttackLayer3SummaryVectorResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarAttackLayer3SummaryVectorResponseEnvelopeJSON `json:"-"`
-}
-
-// radarAttackLayer3SummaryVectorResponseEnvelopeJSON contains the JSON metadata
-// for the struct [RadarAttackLayer3SummaryVectorResponseEnvelope]
-type radarAttackLayer3SummaryVectorResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3SummaryVectorResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3SummaryVectorResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
diff --git a/radarattacklayer3summary_test.go b/radarattacklayer3summary_test.go
deleted file mode 100644
index efcb4eee3d5..00000000000
--- a/radarattacklayer3summary_test.go
+++ /dev/null
@@ -1,221 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
- "time"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRadarAttackLayer3SummaryBitrateWithOptionalParams(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"),
- )
- _, 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()}),
- Direction: cloudflare.F(cloudflare.RadarAttackLayer3SummaryBitrateParamsDirectionOrigin),
- Format: cloudflare.F(cloudflare.RadarAttackLayer3SummaryBitrateParamsFormatJson),
- IPVersion: cloudflare.F([]cloudflare.RadarAttackLayer3SummaryBitrateParamsIPVersion{cloudflare.RadarAttackLayer3SummaryBitrateParamsIPVersionIPv4, cloudflare.RadarAttackLayer3SummaryBitrateParamsIPVersionIPv6}),
- Location: cloudflare.F([]string{"string", "string", "string"}),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- Protocol: cloudflare.F([]cloudflare.RadarAttackLayer3SummaryBitrateParamsProtocol{cloudflare.RadarAttackLayer3SummaryBitrateParamsProtocolUdp, cloudflare.RadarAttackLayer3SummaryBitrateParamsProtocolTcp, cloudflare.RadarAttackLayer3SummaryBitrateParamsProtocolIcmp}),
- })
- 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())
- }
-}
-
-func TestRadarAttackLayer3SummaryDurationWithOptionalParams(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"),
- )
- _, 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()}),
- Direction: cloudflare.F(cloudflare.RadarAttackLayer3SummaryDurationParamsDirectionOrigin),
- Format: cloudflare.F(cloudflare.RadarAttackLayer3SummaryDurationParamsFormatJson),
- IPVersion: cloudflare.F([]cloudflare.RadarAttackLayer3SummaryDurationParamsIPVersion{cloudflare.RadarAttackLayer3SummaryDurationParamsIPVersionIPv4, cloudflare.RadarAttackLayer3SummaryDurationParamsIPVersionIPv6}),
- Location: cloudflare.F([]string{"string", "string", "string"}),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- Protocol: cloudflare.F([]cloudflare.RadarAttackLayer3SummaryDurationParamsProtocol{cloudflare.RadarAttackLayer3SummaryDurationParamsProtocolUdp, cloudflare.RadarAttackLayer3SummaryDurationParamsProtocolTcp, cloudflare.RadarAttackLayer3SummaryDurationParamsProtocolIcmp}),
- })
- 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())
- }
-}
-
-func TestRadarAttackLayer3SummaryGetWithOptionalParams(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"),
- )
- _, 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()}),
- Format: cloudflare.F(cloudflare.RadarAttackLayer3SummaryGetParamsFormatJson),
- 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())
- }
-}
-
-func TestRadarAttackLayer3SummaryIPVersionWithOptionalParams(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"),
- )
- _, 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()}),
- Direction: cloudflare.F(cloudflare.RadarAttackLayer3SummaryIPVersionParamsDirectionOrigin),
- Format: cloudflare.F(cloudflare.RadarAttackLayer3SummaryIPVersionParamsFormatJson),
- Location: cloudflare.F([]string{"string", "string", "string"}),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- Protocol: cloudflare.F([]cloudflare.RadarAttackLayer3SummaryIPVersionParamsProtocol{cloudflare.RadarAttackLayer3SummaryIPVersionParamsProtocolUdp, cloudflare.RadarAttackLayer3SummaryIPVersionParamsProtocolTcp, cloudflare.RadarAttackLayer3SummaryIPVersionParamsProtocolIcmp}),
- })
- 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())
- }
-}
-
-func TestRadarAttackLayer3SummaryProtocolWithOptionalParams(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"),
- )
- _, 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()}),
- Direction: cloudflare.F(cloudflare.RadarAttackLayer3SummaryProtocolParamsDirectionOrigin),
- Format: cloudflare.F(cloudflare.RadarAttackLayer3SummaryProtocolParamsFormatJson),
- IPVersion: cloudflare.F([]cloudflare.RadarAttackLayer3SummaryProtocolParamsIPVersion{cloudflare.RadarAttackLayer3SummaryProtocolParamsIPVersionIPv4, cloudflare.RadarAttackLayer3SummaryProtocolParamsIPVersionIPv6}),
- 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())
- }
-}
-
-func TestRadarAttackLayer3SummaryVectorWithOptionalParams(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"),
- )
- _, 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()}),
- Direction: cloudflare.F(cloudflare.RadarAttackLayer3SummaryVectorParamsDirectionOrigin),
- Format: cloudflare.F(cloudflare.RadarAttackLayer3SummaryVectorParamsFormatJson),
- IPVersion: cloudflare.F([]cloudflare.RadarAttackLayer3SummaryVectorParamsIPVersion{cloudflare.RadarAttackLayer3SummaryVectorParamsIPVersionIPv4, cloudflare.RadarAttackLayer3SummaryVectorParamsIPVersionIPv6}),
- Location: cloudflare.F([]string{"string", "string", "string"}),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- Protocol: cloudflare.F([]cloudflare.RadarAttackLayer3SummaryVectorParamsProtocol{cloudflare.RadarAttackLayer3SummaryVectorParamsProtocolUdp, cloudflare.RadarAttackLayer3SummaryVectorParamsProtocolTcp, cloudflare.RadarAttackLayer3SummaryVectorParamsProtocolIcmp}),
- })
- 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/radarattacklayer3timeseriesgroup.go b/radarattacklayer3timeseriesgroup.go
deleted file mode 100644
index 3bd6571a03c..00000000000
--- a/radarattacklayer3timeseriesgroup.go
+++ /dev/null
@@ -1,1725 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarAttackLayer3TimeseriesGroupService contains methods and other services that
-// help with interacting with the cloudflare API. Note, unlike clients, this
-// service does not read variables from the environment automatically. You should
-// not instantiate this service directly, and instead use the
-// [NewRadarAttackLayer3TimeseriesGroupService] method instead.
-type RadarAttackLayer3TimeseriesGroupService struct {
- Options []option.RequestOption
-}
-
-// NewRadarAttackLayer3TimeseriesGroupService generates a new service that applies
-// the given options to each request. These options are applied after the parent
-// client's options (if there is one), and before any request-specific options.
-func NewRadarAttackLayer3TimeseriesGroupService(opts ...option.RequestOption) (r *RadarAttackLayer3TimeseriesGroupService) {
- r = &RadarAttackLayer3TimeseriesGroupService{}
- r.Options = opts
- return
-}
-
-// Percentage distribution of attacks by bitrate over time.
-func (r *RadarAttackLayer3TimeseriesGroupService) Bitrate(ctx context.Context, query RadarAttackLayer3TimeseriesGroupBitrateParams, opts ...option.RequestOption) (res *RadarAttackLayer3TimeseriesGroupBitrateResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarAttackLayer3TimeseriesGroupBitrateResponseEnvelope
- path := "radar/attacks/layer3/timeseries_groups/bitrate"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Percentage distribution of attacks by duration over time.
-func (r *RadarAttackLayer3TimeseriesGroupService) Duration(ctx context.Context, query RadarAttackLayer3TimeseriesGroupDurationParams, opts ...option.RequestOption) (res *RadarAttackLayer3TimeseriesGroupDurationResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarAttackLayer3TimeseriesGroupDurationResponseEnvelope
- path := "radar/attacks/layer3/timeseries_groups/duration"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Get a timeseries of the percentage distribution of network protocols in Layer
-// 3/4 attacks.
-func (r *RadarAttackLayer3TimeseriesGroupService) Get(ctx context.Context, query RadarAttackLayer3TimeseriesGroupGetParams, opts ...option.RequestOption) (res *RadarAttackLayer3TimeseriesGroupGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarAttackLayer3TimeseriesGroupGetResponseEnvelope
- path := "radar/attacks/layer3/timeseries_groups"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Percentage distribution of attacks by industry used over time.
-func (r *RadarAttackLayer3TimeseriesGroupService) Industry(ctx context.Context, query RadarAttackLayer3TimeseriesGroupIndustryParams, opts ...option.RequestOption) (res *RadarAttackLayer3TimeseriesGroupIndustryResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarAttackLayer3TimeseriesGroupIndustryResponseEnvelope
- path := "radar/attacks/layer3/timeseries_groups/industry"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Percentage distribution of attacks by ip version used over time.
-func (r *RadarAttackLayer3TimeseriesGroupService) IPVersion(ctx context.Context, query RadarAttackLayer3TimeseriesGroupIPVersionParams, opts ...option.RequestOption) (res *RadarAttackLayer3TimeseriesGroupIPVersionResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarAttackLayer3TimeseriesGroupIPVersionResponseEnvelope
- path := "radar/attacks/layer3/timeseries_groups/ip_version"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Percentage distribution of attacks by protocol used over time.
-func (r *RadarAttackLayer3TimeseriesGroupService) Protocol(ctx context.Context, query RadarAttackLayer3TimeseriesGroupProtocolParams, opts ...option.RequestOption) (res *RadarAttackLayer3TimeseriesGroupProtocolResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarAttackLayer3TimeseriesGroupProtocolResponseEnvelope
- path := "radar/attacks/layer3/timeseries_groups/protocol"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Percentage distribution of attacks by vector used over time.
-func (r *RadarAttackLayer3TimeseriesGroupService) Vector(ctx context.Context, query RadarAttackLayer3TimeseriesGroupVectorParams, opts ...option.RequestOption) (res *RadarAttackLayer3TimeseriesGroupVectorResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarAttackLayer3TimeseriesGroupVectorResponseEnvelope
- path := "radar/attacks/layer3/timeseries_groups/vector"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Percentage distribution of attacks by vertical used over time.
-func (r *RadarAttackLayer3TimeseriesGroupService) Vertical(ctx context.Context, query RadarAttackLayer3TimeseriesGroupVerticalParams, opts ...option.RequestOption) (res *RadarAttackLayer3TimeseriesGroupVerticalResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarAttackLayer3TimeseriesGroupVerticalResponseEnvelope
- path := "radar/attacks/layer3/timeseries_groups/vertical"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type RadarAttackLayer3TimeseriesGroupBitrateResponse struct {
- Meta interface{} `json:"meta,required"`
- Serie0 RadarAttackLayer3TimeseriesGroupBitrateResponseSerie0 `json:"serie_0,required"`
- JSON radarAttackLayer3TimeseriesGroupBitrateResponseJSON `json:"-"`
-}
-
-// radarAttackLayer3TimeseriesGroupBitrateResponseJSON contains the JSON metadata
-// for the struct [RadarAttackLayer3TimeseriesGroupBitrateResponse]
-type radarAttackLayer3TimeseriesGroupBitrateResponseJSON struct {
- Meta apijson.Field
- Serie0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3TimeseriesGroupBitrateResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3TimeseriesGroupBitrateResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3TimeseriesGroupBitrateResponseSerie0 struct {
- Number1GbpsTo10Gbps []string `json:"_1_GBPS_TO_10_GBPS,required"`
- Number10GbpsTo100Gbps []string `json:"_10_GBPS_TO_100_GBPS,required"`
- Number500MbpsTo1Gbps []string `json:"_500_MBPS_TO_1_GBPS,required"`
- Over100Gbps []string `json:"OVER_100_GBPS,required"`
- Timestamps []string `json:"timestamps,required"`
- Under500Mbps []string `json:"UNDER_500_MBPS,required"`
- JSON radarAttackLayer3TimeseriesGroupBitrateResponseSerie0JSON `json:"-"`
-}
-
-// radarAttackLayer3TimeseriesGroupBitrateResponseSerie0JSON contains the JSON
-// metadata for the struct [RadarAttackLayer3TimeseriesGroupBitrateResponseSerie0]
-type radarAttackLayer3TimeseriesGroupBitrateResponseSerie0JSON struct {
- Number1GbpsTo10Gbps apijson.Field
- Number10GbpsTo100Gbps apijson.Field
- Number500MbpsTo1Gbps apijson.Field
- Over100Gbps apijson.Field
- Timestamps apijson.Field
- Under500Mbps apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3TimeseriesGroupBitrateResponseSerie0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3TimeseriesGroupBitrateResponseSerie0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3TimeseriesGroupDurationResponse struct {
- Meta interface{} `json:"meta,required"`
- Serie0 RadarAttackLayer3TimeseriesGroupDurationResponseSerie0 `json:"serie_0,required"`
- JSON radarAttackLayer3TimeseriesGroupDurationResponseJSON `json:"-"`
-}
-
-// radarAttackLayer3TimeseriesGroupDurationResponseJSON contains the JSON metadata
-// for the struct [RadarAttackLayer3TimeseriesGroupDurationResponse]
-type radarAttackLayer3TimeseriesGroupDurationResponseJSON struct {
- Meta apijson.Field
- Serie0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3TimeseriesGroupDurationResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3TimeseriesGroupDurationResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3TimeseriesGroupDurationResponseSerie0 struct {
- Number1HourTo3Hours []string `json:"_1_HOUR_TO_3_HOURS,required"`
- Number10MinsTo20Mins []string `json:"_10_MINS_TO_20_MINS,required"`
- Number20MinsTo40Mins []string `json:"_20_MINS_TO_40_MINS,required"`
- Number40MinsTo1Hour []string `json:"_40_MINS_TO_1_HOUR,required"`
- Over3Hours []string `json:"OVER_3_HOURS,required"`
- Timestamps []string `json:"timestamps,required"`
- Under10Mins []string `json:"UNDER_10_MINS,required"`
- JSON radarAttackLayer3TimeseriesGroupDurationResponseSerie0JSON `json:"-"`
-}
-
-// radarAttackLayer3TimeseriesGroupDurationResponseSerie0JSON contains the JSON
-// metadata for the struct [RadarAttackLayer3TimeseriesGroupDurationResponseSerie0]
-type radarAttackLayer3TimeseriesGroupDurationResponseSerie0JSON struct {
- Number1HourTo3Hours apijson.Field
- Number10MinsTo20Mins apijson.Field
- Number20MinsTo40Mins apijson.Field
- Number40MinsTo1Hour apijson.Field
- Over3Hours apijson.Field
- Timestamps apijson.Field
- Under10Mins apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3TimeseriesGroupDurationResponseSerie0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3TimeseriesGroupDurationResponseSerie0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3TimeseriesGroupGetResponse struct {
- Meta RadarAttackLayer3TimeseriesGroupGetResponseMeta `json:"meta,required"`
- Serie0 RadarAttackLayer3TimeseriesGroupGetResponseSerie0 `json:"serie_0,required"`
- JSON radarAttackLayer3TimeseriesGroupGetResponseJSON `json:"-"`
-}
-
-// radarAttackLayer3TimeseriesGroupGetResponseJSON contains the JSON metadata for
-// the struct [RadarAttackLayer3TimeseriesGroupGetResponse]
-type radarAttackLayer3TimeseriesGroupGetResponseJSON struct {
- Meta apijson.Field
- Serie0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3TimeseriesGroupGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3TimeseriesGroupGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3TimeseriesGroupGetResponseMeta struct {
- AggInterval string `json:"aggInterval,required"`
- DateRange []RadarAttackLayer3TimeseriesGroupGetResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated time.Time `json:"lastUpdated,required" format:"date-time"`
- ConfidenceInfo RadarAttackLayer3TimeseriesGroupGetResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarAttackLayer3TimeseriesGroupGetResponseMetaJSON `json:"-"`
-}
-
-// radarAttackLayer3TimeseriesGroupGetResponseMetaJSON contains the JSON metadata
-// for the struct [RadarAttackLayer3TimeseriesGroupGetResponseMeta]
-type radarAttackLayer3TimeseriesGroupGetResponseMetaJSON struct {
- AggInterval apijson.Field
- DateRange apijson.Field
- LastUpdated apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3TimeseriesGroupGetResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3TimeseriesGroupGetResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3TimeseriesGroupGetResponseMetaDateRange 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 radarAttackLayer3TimeseriesGroupGetResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarAttackLayer3TimeseriesGroupGetResponseMetaDateRangeJSON contains the JSON
-// metadata for the struct
-// [RadarAttackLayer3TimeseriesGroupGetResponseMetaDateRange]
-type radarAttackLayer3TimeseriesGroupGetResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3TimeseriesGroupGetResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3TimeseriesGroupGetResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3TimeseriesGroupGetResponseMetaConfidenceInfo struct {
- Annotations []RadarAttackLayer3TimeseriesGroupGetResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarAttackLayer3TimeseriesGroupGetResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarAttackLayer3TimeseriesGroupGetResponseMetaConfidenceInfoJSON contains the
-// JSON metadata for the struct
-// [RadarAttackLayer3TimeseriesGroupGetResponseMetaConfidenceInfo]
-type radarAttackLayer3TimeseriesGroupGetResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3TimeseriesGroupGetResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3TimeseriesGroupGetResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3TimeseriesGroupGetResponseMetaConfidenceInfoAnnotation 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 radarAttackLayer3TimeseriesGroupGetResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarAttackLayer3TimeseriesGroupGetResponseMetaConfidenceInfoAnnotationJSON
-// contains the JSON metadata for the struct
-// [RadarAttackLayer3TimeseriesGroupGetResponseMetaConfidenceInfoAnnotation]
-type radarAttackLayer3TimeseriesGroupGetResponseMetaConfidenceInfoAnnotationJSON 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 *RadarAttackLayer3TimeseriesGroupGetResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3TimeseriesGroupGetResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3TimeseriesGroupGetResponseSerie0 struct {
- GRE []string `json:"gre,required"`
- Icmp []string `json:"icmp,required"`
- Tcp []string `json:"tcp,required"`
- Timestamps []string `json:"timestamps,required"`
- Udp []string `json:"udp,required"`
- JSON radarAttackLayer3TimeseriesGroupGetResponseSerie0JSON `json:"-"`
-}
-
-// radarAttackLayer3TimeseriesGroupGetResponseSerie0JSON contains the JSON metadata
-// for the struct [RadarAttackLayer3TimeseriesGroupGetResponseSerie0]
-type radarAttackLayer3TimeseriesGroupGetResponseSerie0JSON struct {
- GRE apijson.Field
- Icmp apijson.Field
- Tcp apijson.Field
- Timestamps apijson.Field
- Udp apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3TimeseriesGroupGetResponseSerie0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3TimeseriesGroupGetResponseSerie0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3TimeseriesGroupIndustryResponse struct {
- Meta interface{} `json:"meta,required"`
- Serie0 RadarAttackLayer3TimeseriesGroupIndustryResponseSerie0 `json:"serie_0,required"`
- JSON radarAttackLayer3TimeseriesGroupIndustryResponseJSON `json:"-"`
-}
-
-// radarAttackLayer3TimeseriesGroupIndustryResponseJSON contains the JSON metadata
-// for the struct [RadarAttackLayer3TimeseriesGroupIndustryResponse]
-type radarAttackLayer3TimeseriesGroupIndustryResponseJSON struct {
- Meta apijson.Field
- Serie0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3TimeseriesGroupIndustryResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3TimeseriesGroupIndustryResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3TimeseriesGroupIndustryResponseSerie0 struct {
- Timestamps []string `json:"timestamps,required"`
- ExtraFields map[string][]string `json:"-,extras"`
- JSON radarAttackLayer3TimeseriesGroupIndustryResponseSerie0JSON `json:"-"`
-}
-
-// radarAttackLayer3TimeseriesGroupIndustryResponseSerie0JSON contains the JSON
-// metadata for the struct [RadarAttackLayer3TimeseriesGroupIndustryResponseSerie0]
-type radarAttackLayer3TimeseriesGroupIndustryResponseSerie0JSON struct {
- Timestamps apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3TimeseriesGroupIndustryResponseSerie0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3TimeseriesGroupIndustryResponseSerie0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3TimeseriesGroupIPVersionResponse struct {
- Meta interface{} `json:"meta,required"`
- Serie0 RadarAttackLayer3TimeseriesGroupIPVersionResponseSerie0 `json:"serie_0,required"`
- JSON radarAttackLayer3TimeseriesGroupIPVersionResponseJSON `json:"-"`
-}
-
-// radarAttackLayer3TimeseriesGroupIPVersionResponseJSON contains the JSON metadata
-// for the struct [RadarAttackLayer3TimeseriesGroupIPVersionResponse]
-type radarAttackLayer3TimeseriesGroupIPVersionResponseJSON struct {
- Meta apijson.Field
- Serie0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3TimeseriesGroupIPVersionResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3TimeseriesGroupIPVersionResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3TimeseriesGroupIPVersionResponseSerie0 struct {
- IPv4 []string `json:"IPv4,required"`
- IPv6 []string `json:"IPv6,required"`
- Timestamps []string `json:"timestamps,required"`
- JSON radarAttackLayer3TimeseriesGroupIPVersionResponseSerie0JSON `json:"-"`
-}
-
-// radarAttackLayer3TimeseriesGroupIPVersionResponseSerie0JSON contains the JSON
-// metadata for the struct
-// [RadarAttackLayer3TimeseriesGroupIPVersionResponseSerie0]
-type radarAttackLayer3TimeseriesGroupIPVersionResponseSerie0JSON struct {
- IPv4 apijson.Field
- IPv6 apijson.Field
- Timestamps apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3TimeseriesGroupIPVersionResponseSerie0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3TimeseriesGroupIPVersionResponseSerie0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3TimeseriesGroupProtocolResponse struct {
- Meta interface{} `json:"meta,required"`
- Serie0 RadarAttackLayer3TimeseriesGroupProtocolResponseSerie0 `json:"serie_0,required"`
- JSON radarAttackLayer3TimeseriesGroupProtocolResponseJSON `json:"-"`
-}
-
-// radarAttackLayer3TimeseriesGroupProtocolResponseJSON contains the JSON metadata
-// for the struct [RadarAttackLayer3TimeseriesGroupProtocolResponse]
-type radarAttackLayer3TimeseriesGroupProtocolResponseJSON struct {
- Meta apijson.Field
- Serie0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3TimeseriesGroupProtocolResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3TimeseriesGroupProtocolResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3TimeseriesGroupProtocolResponseSerie0 struct {
- GRE []string `json:"GRE,required"`
- Icmp []string `json:"ICMP,required"`
- Tcp []string `json:"TCP,required"`
- Timestamps []string `json:"timestamps,required"`
- Udp []string `json:"UDP,required"`
- JSON radarAttackLayer3TimeseriesGroupProtocolResponseSerie0JSON `json:"-"`
-}
-
-// radarAttackLayer3TimeseriesGroupProtocolResponseSerie0JSON contains the JSON
-// metadata for the struct [RadarAttackLayer3TimeseriesGroupProtocolResponseSerie0]
-type radarAttackLayer3TimeseriesGroupProtocolResponseSerie0JSON struct {
- GRE apijson.Field
- Icmp apijson.Field
- Tcp apijson.Field
- Timestamps apijson.Field
- Udp apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3TimeseriesGroupProtocolResponseSerie0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3TimeseriesGroupProtocolResponseSerie0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3TimeseriesGroupVectorResponse struct {
- Meta interface{} `json:"meta,required"`
- Serie0 RadarAttackLayer3TimeseriesGroupVectorResponseSerie0 `json:"serie_0,required"`
- JSON radarAttackLayer3TimeseriesGroupVectorResponseJSON `json:"-"`
-}
-
-// radarAttackLayer3TimeseriesGroupVectorResponseJSON contains the JSON metadata
-// for the struct [RadarAttackLayer3TimeseriesGroupVectorResponse]
-type radarAttackLayer3TimeseriesGroupVectorResponseJSON struct {
- Meta apijson.Field
- Serie0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3TimeseriesGroupVectorResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3TimeseriesGroupVectorResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3TimeseriesGroupVectorResponseSerie0 struct {
- Timestamps []string `json:"timestamps,required"`
- ExtraFields map[string][]string `json:"-,extras"`
- JSON radarAttackLayer3TimeseriesGroupVectorResponseSerie0JSON `json:"-"`
-}
-
-// radarAttackLayer3TimeseriesGroupVectorResponseSerie0JSON contains the JSON
-// metadata for the struct [RadarAttackLayer3TimeseriesGroupVectorResponseSerie0]
-type radarAttackLayer3TimeseriesGroupVectorResponseSerie0JSON struct {
- Timestamps apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3TimeseriesGroupVectorResponseSerie0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3TimeseriesGroupVectorResponseSerie0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3TimeseriesGroupVerticalResponse struct {
- Meta interface{} `json:"meta,required"`
- Serie0 RadarAttackLayer3TimeseriesGroupVerticalResponseSerie0 `json:"serie_0,required"`
- JSON radarAttackLayer3TimeseriesGroupVerticalResponseJSON `json:"-"`
-}
-
-// radarAttackLayer3TimeseriesGroupVerticalResponseJSON contains the JSON metadata
-// for the struct [RadarAttackLayer3TimeseriesGroupVerticalResponse]
-type radarAttackLayer3TimeseriesGroupVerticalResponseJSON struct {
- Meta apijson.Field
- Serie0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3TimeseriesGroupVerticalResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3TimeseriesGroupVerticalResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3TimeseriesGroupVerticalResponseSerie0 struct {
- Timestamps []string `json:"timestamps,required"`
- ExtraFields map[string][]string `json:"-,extras"`
- JSON radarAttackLayer3TimeseriesGroupVerticalResponseSerie0JSON `json:"-"`
-}
-
-// radarAttackLayer3TimeseriesGroupVerticalResponseSerie0JSON contains the JSON
-// metadata for the struct [RadarAttackLayer3TimeseriesGroupVerticalResponseSerie0]
-type radarAttackLayer3TimeseriesGroupVerticalResponseSerie0JSON struct {
- Timestamps apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3TimeseriesGroupVerticalResponseSerie0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3TimeseriesGroupVerticalResponseSerie0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3TimeseriesGroupBitrateParams struct {
- // Aggregation interval results should be returned in (for example, in 15 minutes
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarAttackLayer3TimeseriesGroupBitrateParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Together with the `location` parameter, will apply the filter to origin or
- // target location.
- Direction param.Field[RadarAttackLayer3TimeseriesGroupBitrateParamsDirection] `query:"direction"`
- // Format results are returned in.
- Format param.Field[RadarAttackLayer3TimeseriesGroupBitrateParamsFormat] `query:"format"`
- // Filter for ip version.
- IPVersion param.Field[[]RadarAttackLayer3TimeseriesGroupBitrateParamsIPVersion] `query:"ipVersion"`
- // 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"`
- // Normalization method applied. Refer to
- // [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/).
- Normalization param.Field[RadarAttackLayer3TimeseriesGroupBitrateParamsNormalization] `query:"normalization"`
- // Array of L3/4 attack types.
- Protocol param.Field[[]RadarAttackLayer3TimeseriesGroupBitrateParamsProtocol] `query:"protocol"`
-}
-
-// URLQuery serializes [RadarAttackLayer3TimeseriesGroupBitrateParams]'s query
-// parameters as `url.Values`.
-func (r RadarAttackLayer3TimeseriesGroupBitrateParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Aggregation interval results should be returned in (for example, in 15 minutes
-// or 1 hour intervals). Refer to
-// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
-type RadarAttackLayer3TimeseriesGroupBitrateParamsAggInterval string
-
-const (
- RadarAttackLayer3TimeseriesGroupBitrateParamsAggInterval15m RadarAttackLayer3TimeseriesGroupBitrateParamsAggInterval = "15m"
- RadarAttackLayer3TimeseriesGroupBitrateParamsAggInterval1h RadarAttackLayer3TimeseriesGroupBitrateParamsAggInterval = "1h"
- RadarAttackLayer3TimeseriesGroupBitrateParamsAggInterval1d RadarAttackLayer3TimeseriesGroupBitrateParamsAggInterval = "1d"
- RadarAttackLayer3TimeseriesGroupBitrateParamsAggInterval1w RadarAttackLayer3TimeseriesGroupBitrateParamsAggInterval = "1w"
-)
-
-type RadarAttackLayer3TimeseriesGroupBitrateParamsDateRange string
-
-const (
- RadarAttackLayer3TimeseriesGroupBitrateParamsDateRange1d RadarAttackLayer3TimeseriesGroupBitrateParamsDateRange = "1d"
- RadarAttackLayer3TimeseriesGroupBitrateParamsDateRange2d RadarAttackLayer3TimeseriesGroupBitrateParamsDateRange = "2d"
- RadarAttackLayer3TimeseriesGroupBitrateParamsDateRange7d RadarAttackLayer3TimeseriesGroupBitrateParamsDateRange = "7d"
- RadarAttackLayer3TimeseriesGroupBitrateParamsDateRange14d RadarAttackLayer3TimeseriesGroupBitrateParamsDateRange = "14d"
- RadarAttackLayer3TimeseriesGroupBitrateParamsDateRange28d RadarAttackLayer3TimeseriesGroupBitrateParamsDateRange = "28d"
- RadarAttackLayer3TimeseriesGroupBitrateParamsDateRange12w RadarAttackLayer3TimeseriesGroupBitrateParamsDateRange = "12w"
- RadarAttackLayer3TimeseriesGroupBitrateParamsDateRange24w RadarAttackLayer3TimeseriesGroupBitrateParamsDateRange = "24w"
- RadarAttackLayer3TimeseriesGroupBitrateParamsDateRange52w RadarAttackLayer3TimeseriesGroupBitrateParamsDateRange = "52w"
- RadarAttackLayer3TimeseriesGroupBitrateParamsDateRange1dControl RadarAttackLayer3TimeseriesGroupBitrateParamsDateRange = "1dControl"
- RadarAttackLayer3TimeseriesGroupBitrateParamsDateRange2dControl RadarAttackLayer3TimeseriesGroupBitrateParamsDateRange = "2dControl"
- RadarAttackLayer3TimeseriesGroupBitrateParamsDateRange7dControl RadarAttackLayer3TimeseriesGroupBitrateParamsDateRange = "7dControl"
- RadarAttackLayer3TimeseriesGroupBitrateParamsDateRange14dControl RadarAttackLayer3TimeseriesGroupBitrateParamsDateRange = "14dControl"
- RadarAttackLayer3TimeseriesGroupBitrateParamsDateRange28dControl RadarAttackLayer3TimeseriesGroupBitrateParamsDateRange = "28dControl"
- RadarAttackLayer3TimeseriesGroupBitrateParamsDateRange12wControl RadarAttackLayer3TimeseriesGroupBitrateParamsDateRange = "12wControl"
- RadarAttackLayer3TimeseriesGroupBitrateParamsDateRange24wControl RadarAttackLayer3TimeseriesGroupBitrateParamsDateRange = "24wControl"
-)
-
-// Together with the `location` parameter, will apply the filter to origin or
-// target location.
-type RadarAttackLayer3TimeseriesGroupBitrateParamsDirection string
-
-const (
- RadarAttackLayer3TimeseriesGroupBitrateParamsDirectionOrigin RadarAttackLayer3TimeseriesGroupBitrateParamsDirection = "ORIGIN"
- RadarAttackLayer3TimeseriesGroupBitrateParamsDirectionTarget RadarAttackLayer3TimeseriesGroupBitrateParamsDirection = "TARGET"
-)
-
-// Format results are returned in.
-type RadarAttackLayer3TimeseriesGroupBitrateParamsFormat string
-
-const (
- RadarAttackLayer3TimeseriesGroupBitrateParamsFormatJson RadarAttackLayer3TimeseriesGroupBitrateParamsFormat = "JSON"
- RadarAttackLayer3TimeseriesGroupBitrateParamsFormatCsv RadarAttackLayer3TimeseriesGroupBitrateParamsFormat = "CSV"
-)
-
-type RadarAttackLayer3TimeseriesGroupBitrateParamsIPVersion string
-
-const (
- RadarAttackLayer3TimeseriesGroupBitrateParamsIPVersionIPv4 RadarAttackLayer3TimeseriesGroupBitrateParamsIPVersion = "IPv4"
- RadarAttackLayer3TimeseriesGroupBitrateParamsIPVersionIPv6 RadarAttackLayer3TimeseriesGroupBitrateParamsIPVersion = "IPv6"
-)
-
-// Normalization method applied. Refer to
-// [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/).
-type RadarAttackLayer3TimeseriesGroupBitrateParamsNormalization string
-
-const (
- RadarAttackLayer3TimeseriesGroupBitrateParamsNormalizationPercentage RadarAttackLayer3TimeseriesGroupBitrateParamsNormalization = "PERCENTAGE"
- RadarAttackLayer3TimeseriesGroupBitrateParamsNormalizationMin0Max RadarAttackLayer3TimeseriesGroupBitrateParamsNormalization = "MIN0_MAX"
-)
-
-type RadarAttackLayer3TimeseriesGroupBitrateParamsProtocol string
-
-const (
- RadarAttackLayer3TimeseriesGroupBitrateParamsProtocolUdp RadarAttackLayer3TimeseriesGroupBitrateParamsProtocol = "UDP"
- RadarAttackLayer3TimeseriesGroupBitrateParamsProtocolTcp RadarAttackLayer3TimeseriesGroupBitrateParamsProtocol = "TCP"
- RadarAttackLayer3TimeseriesGroupBitrateParamsProtocolIcmp RadarAttackLayer3TimeseriesGroupBitrateParamsProtocol = "ICMP"
- RadarAttackLayer3TimeseriesGroupBitrateParamsProtocolGRE RadarAttackLayer3TimeseriesGroupBitrateParamsProtocol = "GRE"
-)
-
-type RadarAttackLayer3TimeseriesGroupBitrateResponseEnvelope struct {
- Result RadarAttackLayer3TimeseriesGroupBitrateResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarAttackLayer3TimeseriesGroupBitrateResponseEnvelopeJSON `json:"-"`
-}
-
-// radarAttackLayer3TimeseriesGroupBitrateResponseEnvelopeJSON contains the JSON
-// metadata for the struct
-// [RadarAttackLayer3TimeseriesGroupBitrateResponseEnvelope]
-type radarAttackLayer3TimeseriesGroupBitrateResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3TimeseriesGroupBitrateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3TimeseriesGroupBitrateResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3TimeseriesGroupDurationParams struct {
- // Aggregation interval results should be returned in (for example, in 15 minutes
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarAttackLayer3TimeseriesGroupDurationParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Together with the `location` parameter, will apply the filter to origin or
- // target location.
- Direction param.Field[RadarAttackLayer3TimeseriesGroupDurationParamsDirection] `query:"direction"`
- // Format results are returned in.
- Format param.Field[RadarAttackLayer3TimeseriesGroupDurationParamsFormat] `query:"format"`
- // Filter for ip version.
- IPVersion param.Field[[]RadarAttackLayer3TimeseriesGroupDurationParamsIPVersion] `query:"ipVersion"`
- // 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"`
- // Normalization method applied. Refer to
- // [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/).
- Normalization param.Field[RadarAttackLayer3TimeseriesGroupDurationParamsNormalization] `query:"normalization"`
- // Array of L3/4 attack types.
- Protocol param.Field[[]RadarAttackLayer3TimeseriesGroupDurationParamsProtocol] `query:"protocol"`
-}
-
-// URLQuery serializes [RadarAttackLayer3TimeseriesGroupDurationParams]'s query
-// parameters as `url.Values`.
-func (r RadarAttackLayer3TimeseriesGroupDurationParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Aggregation interval results should be returned in (for example, in 15 minutes
-// or 1 hour intervals). Refer to
-// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
-type RadarAttackLayer3TimeseriesGroupDurationParamsAggInterval string
-
-const (
- RadarAttackLayer3TimeseriesGroupDurationParamsAggInterval15m RadarAttackLayer3TimeseriesGroupDurationParamsAggInterval = "15m"
- RadarAttackLayer3TimeseriesGroupDurationParamsAggInterval1h RadarAttackLayer3TimeseriesGroupDurationParamsAggInterval = "1h"
- RadarAttackLayer3TimeseriesGroupDurationParamsAggInterval1d RadarAttackLayer3TimeseriesGroupDurationParamsAggInterval = "1d"
- RadarAttackLayer3TimeseriesGroupDurationParamsAggInterval1w RadarAttackLayer3TimeseriesGroupDurationParamsAggInterval = "1w"
-)
-
-type RadarAttackLayer3TimeseriesGroupDurationParamsDateRange string
-
-const (
- RadarAttackLayer3TimeseriesGroupDurationParamsDateRange1d RadarAttackLayer3TimeseriesGroupDurationParamsDateRange = "1d"
- RadarAttackLayer3TimeseriesGroupDurationParamsDateRange2d RadarAttackLayer3TimeseriesGroupDurationParamsDateRange = "2d"
- RadarAttackLayer3TimeseriesGroupDurationParamsDateRange7d RadarAttackLayer3TimeseriesGroupDurationParamsDateRange = "7d"
- RadarAttackLayer3TimeseriesGroupDurationParamsDateRange14d RadarAttackLayer3TimeseriesGroupDurationParamsDateRange = "14d"
- RadarAttackLayer3TimeseriesGroupDurationParamsDateRange28d RadarAttackLayer3TimeseriesGroupDurationParamsDateRange = "28d"
- RadarAttackLayer3TimeseriesGroupDurationParamsDateRange12w RadarAttackLayer3TimeseriesGroupDurationParamsDateRange = "12w"
- RadarAttackLayer3TimeseriesGroupDurationParamsDateRange24w RadarAttackLayer3TimeseriesGroupDurationParamsDateRange = "24w"
- RadarAttackLayer3TimeseriesGroupDurationParamsDateRange52w RadarAttackLayer3TimeseriesGroupDurationParamsDateRange = "52w"
- RadarAttackLayer3TimeseriesGroupDurationParamsDateRange1dControl RadarAttackLayer3TimeseriesGroupDurationParamsDateRange = "1dControl"
- RadarAttackLayer3TimeseriesGroupDurationParamsDateRange2dControl RadarAttackLayer3TimeseriesGroupDurationParamsDateRange = "2dControl"
- RadarAttackLayer3TimeseriesGroupDurationParamsDateRange7dControl RadarAttackLayer3TimeseriesGroupDurationParamsDateRange = "7dControl"
- RadarAttackLayer3TimeseriesGroupDurationParamsDateRange14dControl RadarAttackLayer3TimeseriesGroupDurationParamsDateRange = "14dControl"
- RadarAttackLayer3TimeseriesGroupDurationParamsDateRange28dControl RadarAttackLayer3TimeseriesGroupDurationParamsDateRange = "28dControl"
- RadarAttackLayer3TimeseriesGroupDurationParamsDateRange12wControl RadarAttackLayer3TimeseriesGroupDurationParamsDateRange = "12wControl"
- RadarAttackLayer3TimeseriesGroupDurationParamsDateRange24wControl RadarAttackLayer3TimeseriesGroupDurationParamsDateRange = "24wControl"
-)
-
-// Together with the `location` parameter, will apply the filter to origin or
-// target location.
-type RadarAttackLayer3TimeseriesGroupDurationParamsDirection string
-
-const (
- RadarAttackLayer3TimeseriesGroupDurationParamsDirectionOrigin RadarAttackLayer3TimeseriesGroupDurationParamsDirection = "ORIGIN"
- RadarAttackLayer3TimeseriesGroupDurationParamsDirectionTarget RadarAttackLayer3TimeseriesGroupDurationParamsDirection = "TARGET"
-)
-
-// Format results are returned in.
-type RadarAttackLayer3TimeseriesGroupDurationParamsFormat string
-
-const (
- RadarAttackLayer3TimeseriesGroupDurationParamsFormatJson RadarAttackLayer3TimeseriesGroupDurationParamsFormat = "JSON"
- RadarAttackLayer3TimeseriesGroupDurationParamsFormatCsv RadarAttackLayer3TimeseriesGroupDurationParamsFormat = "CSV"
-)
-
-type RadarAttackLayer3TimeseriesGroupDurationParamsIPVersion string
-
-const (
- RadarAttackLayer3TimeseriesGroupDurationParamsIPVersionIPv4 RadarAttackLayer3TimeseriesGroupDurationParamsIPVersion = "IPv4"
- RadarAttackLayer3TimeseriesGroupDurationParamsIPVersionIPv6 RadarAttackLayer3TimeseriesGroupDurationParamsIPVersion = "IPv6"
-)
-
-// Normalization method applied. Refer to
-// [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/).
-type RadarAttackLayer3TimeseriesGroupDurationParamsNormalization string
-
-const (
- RadarAttackLayer3TimeseriesGroupDurationParamsNormalizationPercentage RadarAttackLayer3TimeseriesGroupDurationParamsNormalization = "PERCENTAGE"
- RadarAttackLayer3TimeseriesGroupDurationParamsNormalizationMin0Max RadarAttackLayer3TimeseriesGroupDurationParamsNormalization = "MIN0_MAX"
-)
-
-type RadarAttackLayer3TimeseriesGroupDurationParamsProtocol string
-
-const (
- RadarAttackLayer3TimeseriesGroupDurationParamsProtocolUdp RadarAttackLayer3TimeseriesGroupDurationParamsProtocol = "UDP"
- RadarAttackLayer3TimeseriesGroupDurationParamsProtocolTcp RadarAttackLayer3TimeseriesGroupDurationParamsProtocol = "TCP"
- RadarAttackLayer3TimeseriesGroupDurationParamsProtocolIcmp RadarAttackLayer3TimeseriesGroupDurationParamsProtocol = "ICMP"
- RadarAttackLayer3TimeseriesGroupDurationParamsProtocolGRE RadarAttackLayer3TimeseriesGroupDurationParamsProtocol = "GRE"
-)
-
-type RadarAttackLayer3TimeseriesGroupDurationResponseEnvelope struct {
- Result RadarAttackLayer3TimeseriesGroupDurationResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarAttackLayer3TimeseriesGroupDurationResponseEnvelopeJSON `json:"-"`
-}
-
-// radarAttackLayer3TimeseriesGroupDurationResponseEnvelopeJSON contains the JSON
-// metadata for the struct
-// [RadarAttackLayer3TimeseriesGroupDurationResponseEnvelope]
-type radarAttackLayer3TimeseriesGroupDurationResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3TimeseriesGroupDurationResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3TimeseriesGroupDurationResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3TimeseriesGroupGetParams struct {
- // Aggregation interval results should be returned in (for example, in 15 minutes
- // or 1 hour intervals). Refer to
- // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
- AggInterval param.Field[RadarAttackLayer3TimeseriesGroupGetParamsAggInterval] `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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarAttackLayer3TimeseriesGroupGetParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Format results are returned in.
- Format param.Field[RadarAttackLayer3TimeseriesGroupGetParamsFormat] `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"`
-}
-
-// URLQuery serializes [RadarAttackLayer3TimeseriesGroupGetParams]'s query
-// parameters as `url.Values`.
-func (r RadarAttackLayer3TimeseriesGroupGetParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Aggregation interval results should be returned in (for example, in 15 minutes
-// or 1 hour intervals). Refer to
-// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
-type RadarAttackLayer3TimeseriesGroupGetParamsAggInterval string
-
-const (
- RadarAttackLayer3TimeseriesGroupGetParamsAggInterval15m RadarAttackLayer3TimeseriesGroupGetParamsAggInterval = "15m"
- RadarAttackLayer3TimeseriesGroupGetParamsAggInterval1h RadarAttackLayer3TimeseriesGroupGetParamsAggInterval = "1h"
- RadarAttackLayer3TimeseriesGroupGetParamsAggInterval1d RadarAttackLayer3TimeseriesGroupGetParamsAggInterval = "1d"
- RadarAttackLayer3TimeseriesGroupGetParamsAggInterval1w RadarAttackLayer3TimeseriesGroupGetParamsAggInterval = "1w"
-)
-
-type RadarAttackLayer3TimeseriesGroupGetParamsDateRange string
-
-const (
- RadarAttackLayer3TimeseriesGroupGetParamsDateRange1d RadarAttackLayer3TimeseriesGroupGetParamsDateRange = "1d"
- RadarAttackLayer3TimeseriesGroupGetParamsDateRange2d RadarAttackLayer3TimeseriesGroupGetParamsDateRange = "2d"
- RadarAttackLayer3TimeseriesGroupGetParamsDateRange7d RadarAttackLayer3TimeseriesGroupGetParamsDateRange = "7d"
- RadarAttackLayer3TimeseriesGroupGetParamsDateRange14d RadarAttackLayer3TimeseriesGroupGetParamsDateRange = "14d"
- RadarAttackLayer3TimeseriesGroupGetParamsDateRange28d RadarAttackLayer3TimeseriesGroupGetParamsDateRange = "28d"
- RadarAttackLayer3TimeseriesGroupGetParamsDateRange12w RadarAttackLayer3TimeseriesGroupGetParamsDateRange = "12w"
- RadarAttackLayer3TimeseriesGroupGetParamsDateRange24w RadarAttackLayer3TimeseriesGroupGetParamsDateRange = "24w"
- RadarAttackLayer3TimeseriesGroupGetParamsDateRange52w RadarAttackLayer3TimeseriesGroupGetParamsDateRange = "52w"
- RadarAttackLayer3TimeseriesGroupGetParamsDateRange1dControl RadarAttackLayer3TimeseriesGroupGetParamsDateRange = "1dControl"
- RadarAttackLayer3TimeseriesGroupGetParamsDateRange2dControl RadarAttackLayer3TimeseriesGroupGetParamsDateRange = "2dControl"
- RadarAttackLayer3TimeseriesGroupGetParamsDateRange7dControl RadarAttackLayer3TimeseriesGroupGetParamsDateRange = "7dControl"
- RadarAttackLayer3TimeseriesGroupGetParamsDateRange14dControl RadarAttackLayer3TimeseriesGroupGetParamsDateRange = "14dControl"
- RadarAttackLayer3TimeseriesGroupGetParamsDateRange28dControl RadarAttackLayer3TimeseriesGroupGetParamsDateRange = "28dControl"
- RadarAttackLayer3TimeseriesGroupGetParamsDateRange12wControl RadarAttackLayer3TimeseriesGroupGetParamsDateRange = "12wControl"
- RadarAttackLayer3TimeseriesGroupGetParamsDateRange24wControl RadarAttackLayer3TimeseriesGroupGetParamsDateRange = "24wControl"
-)
-
-// Format results are returned in.
-type RadarAttackLayer3TimeseriesGroupGetParamsFormat string
-
-const (
- RadarAttackLayer3TimeseriesGroupGetParamsFormatJson RadarAttackLayer3TimeseriesGroupGetParamsFormat = "JSON"
- RadarAttackLayer3TimeseriesGroupGetParamsFormatCsv RadarAttackLayer3TimeseriesGroupGetParamsFormat = "CSV"
-)
-
-type RadarAttackLayer3TimeseriesGroupGetResponseEnvelope struct {
- Result RadarAttackLayer3TimeseriesGroupGetResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarAttackLayer3TimeseriesGroupGetResponseEnvelopeJSON `json:"-"`
-}
-
-// radarAttackLayer3TimeseriesGroupGetResponseEnvelopeJSON contains the JSON
-// metadata for the struct [RadarAttackLayer3TimeseriesGroupGetResponseEnvelope]
-type radarAttackLayer3TimeseriesGroupGetResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3TimeseriesGroupGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3TimeseriesGroupGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3TimeseriesGroupIndustryParams struct {
- // Aggregation interval results should be returned in (for example, in 15 minutes
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarAttackLayer3TimeseriesGroupIndustryParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Together with the `location` parameter, will apply the filter to origin or
- // target location.
- Direction param.Field[RadarAttackLayer3TimeseriesGroupIndustryParamsDirection] `query:"direction"`
- // Format results are returned in.
- Format param.Field[RadarAttackLayer3TimeseriesGroupIndustryParamsFormat] `query:"format"`
- // Filter for ip version.
- IPVersion param.Field[[]RadarAttackLayer3TimeseriesGroupIndustryParamsIPVersion] `query:"ipVersion"`
- // Limit the number of objects (eg browsers, verticals, etc) to the top items over
- // the time range.
- LimitPerGroup param.Field[int64] `query:"limitPerGroup"`
- // Array of comma separated list of locations (alpha-2 country codes). Start with
- // `-` to exclude from results. For example, `-US,PT` excludes results from the US,
- // but includes results from PT.
- 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"`
- // Normalization method applied. Refer to
- // [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/).
- Normalization param.Field[RadarAttackLayer3TimeseriesGroupIndustryParamsNormalization] `query:"normalization"`
-}
-
-// URLQuery serializes [RadarAttackLayer3TimeseriesGroupIndustryParams]'s query
-// parameters as `url.Values`.
-func (r RadarAttackLayer3TimeseriesGroupIndustryParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Aggregation interval results should be returned in (for example, in 15 minutes
-// or 1 hour intervals). Refer to
-// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
-type RadarAttackLayer3TimeseriesGroupIndustryParamsAggInterval string
-
-const (
- RadarAttackLayer3TimeseriesGroupIndustryParamsAggInterval15m RadarAttackLayer3TimeseriesGroupIndustryParamsAggInterval = "15m"
- RadarAttackLayer3TimeseriesGroupIndustryParamsAggInterval1h RadarAttackLayer3TimeseriesGroupIndustryParamsAggInterval = "1h"
- RadarAttackLayer3TimeseriesGroupIndustryParamsAggInterval1d RadarAttackLayer3TimeseriesGroupIndustryParamsAggInterval = "1d"
- RadarAttackLayer3TimeseriesGroupIndustryParamsAggInterval1w RadarAttackLayer3TimeseriesGroupIndustryParamsAggInterval = "1w"
-)
-
-type RadarAttackLayer3TimeseriesGroupIndustryParamsDateRange string
-
-const (
- RadarAttackLayer3TimeseriesGroupIndustryParamsDateRange1d RadarAttackLayer3TimeseriesGroupIndustryParamsDateRange = "1d"
- RadarAttackLayer3TimeseriesGroupIndustryParamsDateRange2d RadarAttackLayer3TimeseriesGroupIndustryParamsDateRange = "2d"
- RadarAttackLayer3TimeseriesGroupIndustryParamsDateRange7d RadarAttackLayer3TimeseriesGroupIndustryParamsDateRange = "7d"
- RadarAttackLayer3TimeseriesGroupIndustryParamsDateRange14d RadarAttackLayer3TimeseriesGroupIndustryParamsDateRange = "14d"
- RadarAttackLayer3TimeseriesGroupIndustryParamsDateRange28d RadarAttackLayer3TimeseriesGroupIndustryParamsDateRange = "28d"
- RadarAttackLayer3TimeseriesGroupIndustryParamsDateRange12w RadarAttackLayer3TimeseriesGroupIndustryParamsDateRange = "12w"
- RadarAttackLayer3TimeseriesGroupIndustryParamsDateRange24w RadarAttackLayer3TimeseriesGroupIndustryParamsDateRange = "24w"
- RadarAttackLayer3TimeseriesGroupIndustryParamsDateRange52w RadarAttackLayer3TimeseriesGroupIndustryParamsDateRange = "52w"
- RadarAttackLayer3TimeseriesGroupIndustryParamsDateRange1dControl RadarAttackLayer3TimeseriesGroupIndustryParamsDateRange = "1dControl"
- RadarAttackLayer3TimeseriesGroupIndustryParamsDateRange2dControl RadarAttackLayer3TimeseriesGroupIndustryParamsDateRange = "2dControl"
- RadarAttackLayer3TimeseriesGroupIndustryParamsDateRange7dControl RadarAttackLayer3TimeseriesGroupIndustryParamsDateRange = "7dControl"
- RadarAttackLayer3TimeseriesGroupIndustryParamsDateRange14dControl RadarAttackLayer3TimeseriesGroupIndustryParamsDateRange = "14dControl"
- RadarAttackLayer3TimeseriesGroupIndustryParamsDateRange28dControl RadarAttackLayer3TimeseriesGroupIndustryParamsDateRange = "28dControl"
- RadarAttackLayer3TimeseriesGroupIndustryParamsDateRange12wControl RadarAttackLayer3TimeseriesGroupIndustryParamsDateRange = "12wControl"
- RadarAttackLayer3TimeseriesGroupIndustryParamsDateRange24wControl RadarAttackLayer3TimeseriesGroupIndustryParamsDateRange = "24wControl"
-)
-
-// Together with the `location` parameter, will apply the filter to origin or
-// target location.
-type RadarAttackLayer3TimeseriesGroupIndustryParamsDirection string
-
-const (
- RadarAttackLayer3TimeseriesGroupIndustryParamsDirectionOrigin RadarAttackLayer3TimeseriesGroupIndustryParamsDirection = "ORIGIN"
- RadarAttackLayer3TimeseriesGroupIndustryParamsDirectionTarget RadarAttackLayer3TimeseriesGroupIndustryParamsDirection = "TARGET"
-)
-
-// Format results are returned in.
-type RadarAttackLayer3TimeseriesGroupIndustryParamsFormat string
-
-const (
- RadarAttackLayer3TimeseriesGroupIndustryParamsFormatJson RadarAttackLayer3TimeseriesGroupIndustryParamsFormat = "JSON"
- RadarAttackLayer3TimeseriesGroupIndustryParamsFormatCsv RadarAttackLayer3TimeseriesGroupIndustryParamsFormat = "CSV"
-)
-
-type RadarAttackLayer3TimeseriesGroupIndustryParamsIPVersion string
-
-const (
- RadarAttackLayer3TimeseriesGroupIndustryParamsIPVersionIPv4 RadarAttackLayer3TimeseriesGroupIndustryParamsIPVersion = "IPv4"
- RadarAttackLayer3TimeseriesGroupIndustryParamsIPVersionIPv6 RadarAttackLayer3TimeseriesGroupIndustryParamsIPVersion = "IPv6"
-)
-
-// Normalization method applied. Refer to
-// [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/).
-type RadarAttackLayer3TimeseriesGroupIndustryParamsNormalization string
-
-const (
- RadarAttackLayer3TimeseriesGroupIndustryParamsNormalizationPercentage RadarAttackLayer3TimeseriesGroupIndustryParamsNormalization = "PERCENTAGE"
- RadarAttackLayer3TimeseriesGroupIndustryParamsNormalizationMin0Max RadarAttackLayer3TimeseriesGroupIndustryParamsNormalization = "MIN0_MAX"
-)
-
-type RadarAttackLayer3TimeseriesGroupIndustryResponseEnvelope struct {
- Result RadarAttackLayer3TimeseriesGroupIndustryResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarAttackLayer3TimeseriesGroupIndustryResponseEnvelopeJSON `json:"-"`
-}
-
-// radarAttackLayer3TimeseriesGroupIndustryResponseEnvelopeJSON contains the JSON
-// metadata for the struct
-// [RadarAttackLayer3TimeseriesGroupIndustryResponseEnvelope]
-type radarAttackLayer3TimeseriesGroupIndustryResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3TimeseriesGroupIndustryResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3TimeseriesGroupIndustryResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3TimeseriesGroupIPVersionParams struct {
- // Aggregation interval results should be returned in (for example, in 15 minutes
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarAttackLayer3TimeseriesGroupIPVersionParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Together with the `location` parameter, will apply the filter to origin or
- // target location.
- Direction param.Field[RadarAttackLayer3TimeseriesGroupIPVersionParamsDirection] `query:"direction"`
- // Format results are returned in.
- Format param.Field[RadarAttackLayer3TimeseriesGroupIPVersionParamsFormat] `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"`
- // Normalization method applied. Refer to
- // [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/).
- Normalization param.Field[RadarAttackLayer3TimeseriesGroupIPVersionParamsNormalization] `query:"normalization"`
- // Array of L3/4 attack types.
- Protocol param.Field[[]RadarAttackLayer3TimeseriesGroupIPVersionParamsProtocol] `query:"protocol"`
-}
-
-// URLQuery serializes [RadarAttackLayer3TimeseriesGroupIPVersionParams]'s query
-// parameters as `url.Values`.
-func (r RadarAttackLayer3TimeseriesGroupIPVersionParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Aggregation interval results should be returned in (for example, in 15 minutes
-// or 1 hour intervals). Refer to
-// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
-type RadarAttackLayer3TimeseriesGroupIPVersionParamsAggInterval string
-
-const (
- RadarAttackLayer3TimeseriesGroupIPVersionParamsAggInterval15m RadarAttackLayer3TimeseriesGroupIPVersionParamsAggInterval = "15m"
- RadarAttackLayer3TimeseriesGroupIPVersionParamsAggInterval1h RadarAttackLayer3TimeseriesGroupIPVersionParamsAggInterval = "1h"
- RadarAttackLayer3TimeseriesGroupIPVersionParamsAggInterval1d RadarAttackLayer3TimeseriesGroupIPVersionParamsAggInterval = "1d"
- RadarAttackLayer3TimeseriesGroupIPVersionParamsAggInterval1w RadarAttackLayer3TimeseriesGroupIPVersionParamsAggInterval = "1w"
-)
-
-type RadarAttackLayer3TimeseriesGroupIPVersionParamsDateRange string
-
-const (
- RadarAttackLayer3TimeseriesGroupIPVersionParamsDateRange1d RadarAttackLayer3TimeseriesGroupIPVersionParamsDateRange = "1d"
- RadarAttackLayer3TimeseriesGroupIPVersionParamsDateRange2d RadarAttackLayer3TimeseriesGroupIPVersionParamsDateRange = "2d"
- RadarAttackLayer3TimeseriesGroupIPVersionParamsDateRange7d RadarAttackLayer3TimeseriesGroupIPVersionParamsDateRange = "7d"
- RadarAttackLayer3TimeseriesGroupIPVersionParamsDateRange14d RadarAttackLayer3TimeseriesGroupIPVersionParamsDateRange = "14d"
- RadarAttackLayer3TimeseriesGroupIPVersionParamsDateRange28d RadarAttackLayer3TimeseriesGroupIPVersionParamsDateRange = "28d"
- RadarAttackLayer3TimeseriesGroupIPVersionParamsDateRange12w RadarAttackLayer3TimeseriesGroupIPVersionParamsDateRange = "12w"
- RadarAttackLayer3TimeseriesGroupIPVersionParamsDateRange24w RadarAttackLayer3TimeseriesGroupIPVersionParamsDateRange = "24w"
- RadarAttackLayer3TimeseriesGroupIPVersionParamsDateRange52w RadarAttackLayer3TimeseriesGroupIPVersionParamsDateRange = "52w"
- RadarAttackLayer3TimeseriesGroupIPVersionParamsDateRange1dControl RadarAttackLayer3TimeseriesGroupIPVersionParamsDateRange = "1dControl"
- RadarAttackLayer3TimeseriesGroupIPVersionParamsDateRange2dControl RadarAttackLayer3TimeseriesGroupIPVersionParamsDateRange = "2dControl"
- RadarAttackLayer3TimeseriesGroupIPVersionParamsDateRange7dControl RadarAttackLayer3TimeseriesGroupIPVersionParamsDateRange = "7dControl"
- RadarAttackLayer3TimeseriesGroupIPVersionParamsDateRange14dControl RadarAttackLayer3TimeseriesGroupIPVersionParamsDateRange = "14dControl"
- RadarAttackLayer3TimeseriesGroupIPVersionParamsDateRange28dControl RadarAttackLayer3TimeseriesGroupIPVersionParamsDateRange = "28dControl"
- RadarAttackLayer3TimeseriesGroupIPVersionParamsDateRange12wControl RadarAttackLayer3TimeseriesGroupIPVersionParamsDateRange = "12wControl"
- RadarAttackLayer3TimeseriesGroupIPVersionParamsDateRange24wControl RadarAttackLayer3TimeseriesGroupIPVersionParamsDateRange = "24wControl"
-)
-
-// Together with the `location` parameter, will apply the filter to origin or
-// target location.
-type RadarAttackLayer3TimeseriesGroupIPVersionParamsDirection string
-
-const (
- RadarAttackLayer3TimeseriesGroupIPVersionParamsDirectionOrigin RadarAttackLayer3TimeseriesGroupIPVersionParamsDirection = "ORIGIN"
- RadarAttackLayer3TimeseriesGroupIPVersionParamsDirectionTarget RadarAttackLayer3TimeseriesGroupIPVersionParamsDirection = "TARGET"
-)
-
-// Format results are returned in.
-type RadarAttackLayer3TimeseriesGroupIPVersionParamsFormat string
-
-const (
- RadarAttackLayer3TimeseriesGroupIPVersionParamsFormatJson RadarAttackLayer3TimeseriesGroupIPVersionParamsFormat = "JSON"
- RadarAttackLayer3TimeseriesGroupIPVersionParamsFormatCsv RadarAttackLayer3TimeseriesGroupIPVersionParamsFormat = "CSV"
-)
-
-// Normalization method applied. Refer to
-// [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/).
-type RadarAttackLayer3TimeseriesGroupIPVersionParamsNormalization string
-
-const (
- RadarAttackLayer3TimeseriesGroupIPVersionParamsNormalizationPercentage RadarAttackLayer3TimeseriesGroupIPVersionParamsNormalization = "PERCENTAGE"
- RadarAttackLayer3TimeseriesGroupIPVersionParamsNormalizationMin0Max RadarAttackLayer3TimeseriesGroupIPVersionParamsNormalization = "MIN0_MAX"
-)
-
-type RadarAttackLayer3TimeseriesGroupIPVersionParamsProtocol string
-
-const (
- RadarAttackLayer3TimeseriesGroupIPVersionParamsProtocolUdp RadarAttackLayer3TimeseriesGroupIPVersionParamsProtocol = "UDP"
- RadarAttackLayer3TimeseriesGroupIPVersionParamsProtocolTcp RadarAttackLayer3TimeseriesGroupIPVersionParamsProtocol = "TCP"
- RadarAttackLayer3TimeseriesGroupIPVersionParamsProtocolIcmp RadarAttackLayer3TimeseriesGroupIPVersionParamsProtocol = "ICMP"
- RadarAttackLayer3TimeseriesGroupIPVersionParamsProtocolGRE RadarAttackLayer3TimeseriesGroupIPVersionParamsProtocol = "GRE"
-)
-
-type RadarAttackLayer3TimeseriesGroupIPVersionResponseEnvelope struct {
- Result RadarAttackLayer3TimeseriesGroupIPVersionResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarAttackLayer3TimeseriesGroupIPVersionResponseEnvelopeJSON `json:"-"`
-}
-
-// radarAttackLayer3TimeseriesGroupIPVersionResponseEnvelopeJSON contains the JSON
-// metadata for the struct
-// [RadarAttackLayer3TimeseriesGroupIPVersionResponseEnvelope]
-type radarAttackLayer3TimeseriesGroupIPVersionResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3TimeseriesGroupIPVersionResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3TimeseriesGroupIPVersionResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3TimeseriesGroupProtocolParams struct {
- // Aggregation interval results should be returned in (for example, in 15 minutes
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarAttackLayer3TimeseriesGroupProtocolParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Together with the `location` parameter, will apply the filter to origin or
- // target location.
- Direction param.Field[RadarAttackLayer3TimeseriesGroupProtocolParamsDirection] `query:"direction"`
- // Format results are returned in.
- Format param.Field[RadarAttackLayer3TimeseriesGroupProtocolParamsFormat] `query:"format"`
- // Filter for ip version.
- IPVersion param.Field[[]RadarAttackLayer3TimeseriesGroupProtocolParamsIPVersion] `query:"ipVersion"`
- // 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"`
- // Normalization method applied. Refer to
- // [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/).
- Normalization param.Field[RadarAttackLayer3TimeseriesGroupProtocolParamsNormalization] `query:"normalization"`
-}
-
-// URLQuery serializes [RadarAttackLayer3TimeseriesGroupProtocolParams]'s query
-// parameters as `url.Values`.
-func (r RadarAttackLayer3TimeseriesGroupProtocolParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Aggregation interval results should be returned in (for example, in 15 minutes
-// or 1 hour intervals). Refer to
-// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
-type RadarAttackLayer3TimeseriesGroupProtocolParamsAggInterval string
-
-const (
- RadarAttackLayer3TimeseriesGroupProtocolParamsAggInterval15m RadarAttackLayer3TimeseriesGroupProtocolParamsAggInterval = "15m"
- RadarAttackLayer3TimeseriesGroupProtocolParamsAggInterval1h RadarAttackLayer3TimeseriesGroupProtocolParamsAggInterval = "1h"
- RadarAttackLayer3TimeseriesGroupProtocolParamsAggInterval1d RadarAttackLayer3TimeseriesGroupProtocolParamsAggInterval = "1d"
- RadarAttackLayer3TimeseriesGroupProtocolParamsAggInterval1w RadarAttackLayer3TimeseriesGroupProtocolParamsAggInterval = "1w"
-)
-
-type RadarAttackLayer3TimeseriesGroupProtocolParamsDateRange string
-
-const (
- RadarAttackLayer3TimeseriesGroupProtocolParamsDateRange1d RadarAttackLayer3TimeseriesGroupProtocolParamsDateRange = "1d"
- RadarAttackLayer3TimeseriesGroupProtocolParamsDateRange2d RadarAttackLayer3TimeseriesGroupProtocolParamsDateRange = "2d"
- RadarAttackLayer3TimeseriesGroupProtocolParamsDateRange7d RadarAttackLayer3TimeseriesGroupProtocolParamsDateRange = "7d"
- RadarAttackLayer3TimeseriesGroupProtocolParamsDateRange14d RadarAttackLayer3TimeseriesGroupProtocolParamsDateRange = "14d"
- RadarAttackLayer3TimeseriesGroupProtocolParamsDateRange28d RadarAttackLayer3TimeseriesGroupProtocolParamsDateRange = "28d"
- RadarAttackLayer3TimeseriesGroupProtocolParamsDateRange12w RadarAttackLayer3TimeseriesGroupProtocolParamsDateRange = "12w"
- RadarAttackLayer3TimeseriesGroupProtocolParamsDateRange24w RadarAttackLayer3TimeseriesGroupProtocolParamsDateRange = "24w"
- RadarAttackLayer3TimeseriesGroupProtocolParamsDateRange52w RadarAttackLayer3TimeseriesGroupProtocolParamsDateRange = "52w"
- RadarAttackLayer3TimeseriesGroupProtocolParamsDateRange1dControl RadarAttackLayer3TimeseriesGroupProtocolParamsDateRange = "1dControl"
- RadarAttackLayer3TimeseriesGroupProtocolParamsDateRange2dControl RadarAttackLayer3TimeseriesGroupProtocolParamsDateRange = "2dControl"
- RadarAttackLayer3TimeseriesGroupProtocolParamsDateRange7dControl RadarAttackLayer3TimeseriesGroupProtocolParamsDateRange = "7dControl"
- RadarAttackLayer3TimeseriesGroupProtocolParamsDateRange14dControl RadarAttackLayer3TimeseriesGroupProtocolParamsDateRange = "14dControl"
- RadarAttackLayer3TimeseriesGroupProtocolParamsDateRange28dControl RadarAttackLayer3TimeseriesGroupProtocolParamsDateRange = "28dControl"
- RadarAttackLayer3TimeseriesGroupProtocolParamsDateRange12wControl RadarAttackLayer3TimeseriesGroupProtocolParamsDateRange = "12wControl"
- RadarAttackLayer3TimeseriesGroupProtocolParamsDateRange24wControl RadarAttackLayer3TimeseriesGroupProtocolParamsDateRange = "24wControl"
-)
-
-// Together with the `location` parameter, will apply the filter to origin or
-// target location.
-type RadarAttackLayer3TimeseriesGroupProtocolParamsDirection string
-
-const (
- RadarAttackLayer3TimeseriesGroupProtocolParamsDirectionOrigin RadarAttackLayer3TimeseriesGroupProtocolParamsDirection = "ORIGIN"
- RadarAttackLayer3TimeseriesGroupProtocolParamsDirectionTarget RadarAttackLayer3TimeseriesGroupProtocolParamsDirection = "TARGET"
-)
-
-// Format results are returned in.
-type RadarAttackLayer3TimeseriesGroupProtocolParamsFormat string
-
-const (
- RadarAttackLayer3TimeseriesGroupProtocolParamsFormatJson RadarAttackLayer3TimeseriesGroupProtocolParamsFormat = "JSON"
- RadarAttackLayer3TimeseriesGroupProtocolParamsFormatCsv RadarAttackLayer3TimeseriesGroupProtocolParamsFormat = "CSV"
-)
-
-type RadarAttackLayer3TimeseriesGroupProtocolParamsIPVersion string
-
-const (
- RadarAttackLayer3TimeseriesGroupProtocolParamsIPVersionIPv4 RadarAttackLayer3TimeseriesGroupProtocolParamsIPVersion = "IPv4"
- RadarAttackLayer3TimeseriesGroupProtocolParamsIPVersionIPv6 RadarAttackLayer3TimeseriesGroupProtocolParamsIPVersion = "IPv6"
-)
-
-// Normalization method applied. Refer to
-// [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/).
-type RadarAttackLayer3TimeseriesGroupProtocolParamsNormalization string
-
-const (
- RadarAttackLayer3TimeseriesGroupProtocolParamsNormalizationPercentage RadarAttackLayer3TimeseriesGroupProtocolParamsNormalization = "PERCENTAGE"
- RadarAttackLayer3TimeseriesGroupProtocolParamsNormalizationMin0Max RadarAttackLayer3TimeseriesGroupProtocolParamsNormalization = "MIN0_MAX"
-)
-
-type RadarAttackLayer3TimeseriesGroupProtocolResponseEnvelope struct {
- Result RadarAttackLayer3TimeseriesGroupProtocolResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarAttackLayer3TimeseriesGroupProtocolResponseEnvelopeJSON `json:"-"`
-}
-
-// radarAttackLayer3TimeseriesGroupProtocolResponseEnvelopeJSON contains the JSON
-// metadata for the struct
-// [RadarAttackLayer3TimeseriesGroupProtocolResponseEnvelope]
-type radarAttackLayer3TimeseriesGroupProtocolResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3TimeseriesGroupProtocolResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3TimeseriesGroupProtocolResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3TimeseriesGroupVectorParams struct {
- // Aggregation interval results should be returned in (for example, in 15 minutes
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarAttackLayer3TimeseriesGroupVectorParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Together with the `location` parameter, will apply the filter to origin or
- // target location.
- Direction param.Field[RadarAttackLayer3TimeseriesGroupVectorParamsDirection] `query:"direction"`
- // Format results are returned in.
- Format param.Field[RadarAttackLayer3TimeseriesGroupVectorParamsFormat] `query:"format"`
- // Filter for ip version.
- IPVersion param.Field[[]RadarAttackLayer3TimeseriesGroupVectorParamsIPVersion] `query:"ipVersion"`
- // Limit the number of objects (eg browsers, verticals, etc) to the top items over
- // the time range.
- LimitPerGroup param.Field[int64] `query:"limitPerGroup"`
- // Array of comma separated list of locations (alpha-2 country codes). Start with
- // `-` to exclude from results. For example, `-US,PT` excludes results from the US,
- // but includes results from PT.
- 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"`
- // Normalization method applied. Refer to
- // [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/).
- Normalization param.Field[RadarAttackLayer3TimeseriesGroupVectorParamsNormalization] `query:"normalization"`
- // Array of L3/4 attack types.
- Protocol param.Field[[]RadarAttackLayer3TimeseriesGroupVectorParamsProtocol] `query:"protocol"`
-}
-
-// URLQuery serializes [RadarAttackLayer3TimeseriesGroupVectorParams]'s query
-// parameters as `url.Values`.
-func (r RadarAttackLayer3TimeseriesGroupVectorParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Aggregation interval results should be returned in (for example, in 15 minutes
-// or 1 hour intervals). Refer to
-// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
-type RadarAttackLayer3TimeseriesGroupVectorParamsAggInterval string
-
-const (
- RadarAttackLayer3TimeseriesGroupVectorParamsAggInterval15m RadarAttackLayer3TimeseriesGroupVectorParamsAggInterval = "15m"
- RadarAttackLayer3TimeseriesGroupVectorParamsAggInterval1h RadarAttackLayer3TimeseriesGroupVectorParamsAggInterval = "1h"
- RadarAttackLayer3TimeseriesGroupVectorParamsAggInterval1d RadarAttackLayer3TimeseriesGroupVectorParamsAggInterval = "1d"
- RadarAttackLayer3TimeseriesGroupVectorParamsAggInterval1w RadarAttackLayer3TimeseriesGroupVectorParamsAggInterval = "1w"
-)
-
-type RadarAttackLayer3TimeseriesGroupVectorParamsDateRange string
-
-const (
- RadarAttackLayer3TimeseriesGroupVectorParamsDateRange1d RadarAttackLayer3TimeseriesGroupVectorParamsDateRange = "1d"
- RadarAttackLayer3TimeseriesGroupVectorParamsDateRange2d RadarAttackLayer3TimeseriesGroupVectorParamsDateRange = "2d"
- RadarAttackLayer3TimeseriesGroupVectorParamsDateRange7d RadarAttackLayer3TimeseriesGroupVectorParamsDateRange = "7d"
- RadarAttackLayer3TimeseriesGroupVectorParamsDateRange14d RadarAttackLayer3TimeseriesGroupVectorParamsDateRange = "14d"
- RadarAttackLayer3TimeseriesGroupVectorParamsDateRange28d RadarAttackLayer3TimeseriesGroupVectorParamsDateRange = "28d"
- RadarAttackLayer3TimeseriesGroupVectorParamsDateRange12w RadarAttackLayer3TimeseriesGroupVectorParamsDateRange = "12w"
- RadarAttackLayer3TimeseriesGroupVectorParamsDateRange24w RadarAttackLayer3TimeseriesGroupVectorParamsDateRange = "24w"
- RadarAttackLayer3TimeseriesGroupVectorParamsDateRange52w RadarAttackLayer3TimeseriesGroupVectorParamsDateRange = "52w"
- RadarAttackLayer3TimeseriesGroupVectorParamsDateRange1dControl RadarAttackLayer3TimeseriesGroupVectorParamsDateRange = "1dControl"
- RadarAttackLayer3TimeseriesGroupVectorParamsDateRange2dControl RadarAttackLayer3TimeseriesGroupVectorParamsDateRange = "2dControl"
- RadarAttackLayer3TimeseriesGroupVectorParamsDateRange7dControl RadarAttackLayer3TimeseriesGroupVectorParamsDateRange = "7dControl"
- RadarAttackLayer3TimeseriesGroupVectorParamsDateRange14dControl RadarAttackLayer3TimeseriesGroupVectorParamsDateRange = "14dControl"
- RadarAttackLayer3TimeseriesGroupVectorParamsDateRange28dControl RadarAttackLayer3TimeseriesGroupVectorParamsDateRange = "28dControl"
- RadarAttackLayer3TimeseriesGroupVectorParamsDateRange12wControl RadarAttackLayer3TimeseriesGroupVectorParamsDateRange = "12wControl"
- RadarAttackLayer3TimeseriesGroupVectorParamsDateRange24wControl RadarAttackLayer3TimeseriesGroupVectorParamsDateRange = "24wControl"
-)
-
-// Together with the `location` parameter, will apply the filter to origin or
-// target location.
-type RadarAttackLayer3TimeseriesGroupVectorParamsDirection string
-
-const (
- RadarAttackLayer3TimeseriesGroupVectorParamsDirectionOrigin RadarAttackLayer3TimeseriesGroupVectorParamsDirection = "ORIGIN"
- RadarAttackLayer3TimeseriesGroupVectorParamsDirectionTarget RadarAttackLayer3TimeseriesGroupVectorParamsDirection = "TARGET"
-)
-
-// Format results are returned in.
-type RadarAttackLayer3TimeseriesGroupVectorParamsFormat string
-
-const (
- RadarAttackLayer3TimeseriesGroupVectorParamsFormatJson RadarAttackLayer3TimeseriesGroupVectorParamsFormat = "JSON"
- RadarAttackLayer3TimeseriesGroupVectorParamsFormatCsv RadarAttackLayer3TimeseriesGroupVectorParamsFormat = "CSV"
-)
-
-type RadarAttackLayer3TimeseriesGroupVectorParamsIPVersion string
-
-const (
- RadarAttackLayer3TimeseriesGroupVectorParamsIPVersionIPv4 RadarAttackLayer3TimeseriesGroupVectorParamsIPVersion = "IPv4"
- RadarAttackLayer3TimeseriesGroupVectorParamsIPVersionIPv6 RadarAttackLayer3TimeseriesGroupVectorParamsIPVersion = "IPv6"
-)
-
-// Normalization method applied. Refer to
-// [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/).
-type RadarAttackLayer3TimeseriesGroupVectorParamsNormalization string
-
-const (
- RadarAttackLayer3TimeseriesGroupVectorParamsNormalizationPercentage RadarAttackLayer3TimeseriesGroupVectorParamsNormalization = "PERCENTAGE"
- RadarAttackLayer3TimeseriesGroupVectorParamsNormalizationMin0Max RadarAttackLayer3TimeseriesGroupVectorParamsNormalization = "MIN0_MAX"
-)
-
-type RadarAttackLayer3TimeseriesGroupVectorParamsProtocol string
-
-const (
- RadarAttackLayer3TimeseriesGroupVectorParamsProtocolUdp RadarAttackLayer3TimeseriesGroupVectorParamsProtocol = "UDP"
- RadarAttackLayer3TimeseriesGroupVectorParamsProtocolTcp RadarAttackLayer3TimeseriesGroupVectorParamsProtocol = "TCP"
- RadarAttackLayer3TimeseriesGroupVectorParamsProtocolIcmp RadarAttackLayer3TimeseriesGroupVectorParamsProtocol = "ICMP"
- RadarAttackLayer3TimeseriesGroupVectorParamsProtocolGRE RadarAttackLayer3TimeseriesGroupVectorParamsProtocol = "GRE"
-)
-
-type RadarAttackLayer3TimeseriesGroupVectorResponseEnvelope struct {
- Result RadarAttackLayer3TimeseriesGroupVectorResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarAttackLayer3TimeseriesGroupVectorResponseEnvelopeJSON `json:"-"`
-}
-
-// radarAttackLayer3TimeseriesGroupVectorResponseEnvelopeJSON contains the JSON
-// metadata for the struct [RadarAttackLayer3TimeseriesGroupVectorResponseEnvelope]
-type radarAttackLayer3TimeseriesGroupVectorResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3TimeseriesGroupVectorResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3TimeseriesGroupVectorResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3TimeseriesGroupVerticalParams struct {
- // Aggregation interval results should be returned in (for example, in 15 minutes
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarAttackLayer3TimeseriesGroupVerticalParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Together with the `location` parameter, will apply the filter to origin or
- // target location.
- Direction param.Field[RadarAttackLayer3TimeseriesGroupVerticalParamsDirection] `query:"direction"`
- // Format results are returned in.
- Format param.Field[RadarAttackLayer3TimeseriesGroupVerticalParamsFormat] `query:"format"`
- // Filter for ip version.
- IPVersion param.Field[[]RadarAttackLayer3TimeseriesGroupVerticalParamsIPVersion] `query:"ipVersion"`
- // Limit the number of objects (eg browsers, verticals, etc) to the top items over
- // the time range.
- LimitPerGroup param.Field[int64] `query:"limitPerGroup"`
- // Array of comma separated list of locations (alpha-2 country codes). Start with
- // `-` to exclude from results. For example, `-US,PT` excludes results from the US,
- // but includes results from PT.
- 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"`
- // Normalization method applied. Refer to
- // [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/).
- Normalization param.Field[RadarAttackLayer3TimeseriesGroupVerticalParamsNormalization] `query:"normalization"`
-}
-
-// URLQuery serializes [RadarAttackLayer3TimeseriesGroupVerticalParams]'s query
-// parameters as `url.Values`.
-func (r RadarAttackLayer3TimeseriesGroupVerticalParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Aggregation interval results should be returned in (for example, in 15 minutes
-// or 1 hour intervals). Refer to
-// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
-type RadarAttackLayer3TimeseriesGroupVerticalParamsAggInterval string
-
-const (
- RadarAttackLayer3TimeseriesGroupVerticalParamsAggInterval15m RadarAttackLayer3TimeseriesGroupVerticalParamsAggInterval = "15m"
- RadarAttackLayer3TimeseriesGroupVerticalParamsAggInterval1h RadarAttackLayer3TimeseriesGroupVerticalParamsAggInterval = "1h"
- RadarAttackLayer3TimeseriesGroupVerticalParamsAggInterval1d RadarAttackLayer3TimeseriesGroupVerticalParamsAggInterval = "1d"
- RadarAttackLayer3TimeseriesGroupVerticalParamsAggInterval1w RadarAttackLayer3TimeseriesGroupVerticalParamsAggInterval = "1w"
-)
-
-type RadarAttackLayer3TimeseriesGroupVerticalParamsDateRange string
-
-const (
- RadarAttackLayer3TimeseriesGroupVerticalParamsDateRange1d RadarAttackLayer3TimeseriesGroupVerticalParamsDateRange = "1d"
- RadarAttackLayer3TimeseriesGroupVerticalParamsDateRange2d RadarAttackLayer3TimeseriesGroupVerticalParamsDateRange = "2d"
- RadarAttackLayer3TimeseriesGroupVerticalParamsDateRange7d RadarAttackLayer3TimeseriesGroupVerticalParamsDateRange = "7d"
- RadarAttackLayer3TimeseriesGroupVerticalParamsDateRange14d RadarAttackLayer3TimeseriesGroupVerticalParamsDateRange = "14d"
- RadarAttackLayer3TimeseriesGroupVerticalParamsDateRange28d RadarAttackLayer3TimeseriesGroupVerticalParamsDateRange = "28d"
- RadarAttackLayer3TimeseriesGroupVerticalParamsDateRange12w RadarAttackLayer3TimeseriesGroupVerticalParamsDateRange = "12w"
- RadarAttackLayer3TimeseriesGroupVerticalParamsDateRange24w RadarAttackLayer3TimeseriesGroupVerticalParamsDateRange = "24w"
- RadarAttackLayer3TimeseriesGroupVerticalParamsDateRange52w RadarAttackLayer3TimeseriesGroupVerticalParamsDateRange = "52w"
- RadarAttackLayer3TimeseriesGroupVerticalParamsDateRange1dControl RadarAttackLayer3TimeseriesGroupVerticalParamsDateRange = "1dControl"
- RadarAttackLayer3TimeseriesGroupVerticalParamsDateRange2dControl RadarAttackLayer3TimeseriesGroupVerticalParamsDateRange = "2dControl"
- RadarAttackLayer3TimeseriesGroupVerticalParamsDateRange7dControl RadarAttackLayer3TimeseriesGroupVerticalParamsDateRange = "7dControl"
- RadarAttackLayer3TimeseriesGroupVerticalParamsDateRange14dControl RadarAttackLayer3TimeseriesGroupVerticalParamsDateRange = "14dControl"
- RadarAttackLayer3TimeseriesGroupVerticalParamsDateRange28dControl RadarAttackLayer3TimeseriesGroupVerticalParamsDateRange = "28dControl"
- RadarAttackLayer3TimeseriesGroupVerticalParamsDateRange12wControl RadarAttackLayer3TimeseriesGroupVerticalParamsDateRange = "12wControl"
- RadarAttackLayer3TimeseriesGroupVerticalParamsDateRange24wControl RadarAttackLayer3TimeseriesGroupVerticalParamsDateRange = "24wControl"
-)
-
-// Together with the `location` parameter, will apply the filter to origin or
-// target location.
-type RadarAttackLayer3TimeseriesGroupVerticalParamsDirection string
-
-const (
- RadarAttackLayer3TimeseriesGroupVerticalParamsDirectionOrigin RadarAttackLayer3TimeseriesGroupVerticalParamsDirection = "ORIGIN"
- RadarAttackLayer3TimeseriesGroupVerticalParamsDirectionTarget RadarAttackLayer3TimeseriesGroupVerticalParamsDirection = "TARGET"
-)
-
-// Format results are returned in.
-type RadarAttackLayer3TimeseriesGroupVerticalParamsFormat string
-
-const (
- RadarAttackLayer3TimeseriesGroupVerticalParamsFormatJson RadarAttackLayer3TimeseriesGroupVerticalParamsFormat = "JSON"
- RadarAttackLayer3TimeseriesGroupVerticalParamsFormatCsv RadarAttackLayer3TimeseriesGroupVerticalParamsFormat = "CSV"
-)
-
-type RadarAttackLayer3TimeseriesGroupVerticalParamsIPVersion string
-
-const (
- RadarAttackLayer3TimeseriesGroupVerticalParamsIPVersionIPv4 RadarAttackLayer3TimeseriesGroupVerticalParamsIPVersion = "IPv4"
- RadarAttackLayer3TimeseriesGroupVerticalParamsIPVersionIPv6 RadarAttackLayer3TimeseriesGroupVerticalParamsIPVersion = "IPv6"
-)
-
-// Normalization method applied. Refer to
-// [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/).
-type RadarAttackLayer3TimeseriesGroupVerticalParamsNormalization string
-
-const (
- RadarAttackLayer3TimeseriesGroupVerticalParamsNormalizationPercentage RadarAttackLayer3TimeseriesGroupVerticalParamsNormalization = "PERCENTAGE"
- RadarAttackLayer3TimeseriesGroupVerticalParamsNormalizationMin0Max RadarAttackLayer3TimeseriesGroupVerticalParamsNormalization = "MIN0_MAX"
-)
-
-type RadarAttackLayer3TimeseriesGroupVerticalResponseEnvelope struct {
- Result RadarAttackLayer3TimeseriesGroupVerticalResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarAttackLayer3TimeseriesGroupVerticalResponseEnvelopeJSON `json:"-"`
-}
-
-// radarAttackLayer3TimeseriesGroupVerticalResponseEnvelopeJSON contains the JSON
-// metadata for the struct
-// [RadarAttackLayer3TimeseriesGroupVerticalResponseEnvelope]
-type radarAttackLayer3TimeseriesGroupVerticalResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3TimeseriesGroupVerticalResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3TimeseriesGroupVerticalResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
diff --git a/radarattacklayer3timeseriesgroup_test.go b/radarattacklayer3timeseriesgroup_test.go
deleted file mode 100644
index a7291ca48ae..00000000000
--- a/radarattacklayer3timeseriesgroup_test.go
+++ /dev/null
@@ -1,307 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
- "time"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRadarAttackLayer3TimeseriesGroupBitrateWithOptionalParams(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"),
- )
- _, 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()}),
- Direction: cloudflare.F(cloudflare.RadarAttackLayer3TimeseriesGroupBitrateParamsDirectionOrigin),
- Format: cloudflare.F(cloudflare.RadarAttackLayer3TimeseriesGroupBitrateParamsFormatJson),
- IPVersion: cloudflare.F([]cloudflare.RadarAttackLayer3TimeseriesGroupBitrateParamsIPVersion{cloudflare.RadarAttackLayer3TimeseriesGroupBitrateParamsIPVersionIPv4, cloudflare.RadarAttackLayer3TimeseriesGroupBitrateParamsIPVersionIPv6}),
- Location: cloudflare.F([]string{"string", "string", "string"}),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- Normalization: cloudflare.F(cloudflare.RadarAttackLayer3TimeseriesGroupBitrateParamsNormalizationPercentage),
- Protocol: cloudflare.F([]cloudflare.RadarAttackLayer3TimeseriesGroupBitrateParamsProtocol{cloudflare.RadarAttackLayer3TimeseriesGroupBitrateParamsProtocolUdp, cloudflare.RadarAttackLayer3TimeseriesGroupBitrateParamsProtocolTcp, cloudflare.RadarAttackLayer3TimeseriesGroupBitrateParamsProtocolIcmp}),
- })
- 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())
- }
-}
-
-func TestRadarAttackLayer3TimeseriesGroupDurationWithOptionalParams(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"),
- )
- _, 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()}),
- Direction: cloudflare.F(cloudflare.RadarAttackLayer3TimeseriesGroupDurationParamsDirectionOrigin),
- Format: cloudflare.F(cloudflare.RadarAttackLayer3TimeseriesGroupDurationParamsFormatJson),
- IPVersion: cloudflare.F([]cloudflare.RadarAttackLayer3TimeseriesGroupDurationParamsIPVersion{cloudflare.RadarAttackLayer3TimeseriesGroupDurationParamsIPVersionIPv4, cloudflare.RadarAttackLayer3TimeseriesGroupDurationParamsIPVersionIPv6}),
- Location: cloudflare.F([]string{"string", "string", "string"}),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- Normalization: cloudflare.F(cloudflare.RadarAttackLayer3TimeseriesGroupDurationParamsNormalizationPercentage),
- Protocol: cloudflare.F([]cloudflare.RadarAttackLayer3TimeseriesGroupDurationParamsProtocol{cloudflare.RadarAttackLayer3TimeseriesGroupDurationParamsProtocolUdp, cloudflare.RadarAttackLayer3TimeseriesGroupDurationParamsProtocolTcp, cloudflare.RadarAttackLayer3TimeseriesGroupDurationParamsProtocolIcmp}),
- })
- 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())
- }
-}
-
-func TestRadarAttackLayer3TimeseriesGroupGetWithOptionalParams(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"),
- )
- _, 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()}),
- Format: cloudflare.F(cloudflare.RadarAttackLayer3TimeseriesGroupGetParamsFormatJson),
- 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())
- }
-}
-
-func TestRadarAttackLayer3TimeseriesGroupIndustryWithOptionalParams(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"),
- )
- _, 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()}),
- Direction: cloudflare.F(cloudflare.RadarAttackLayer3TimeseriesGroupIndustryParamsDirectionOrigin),
- Format: cloudflare.F(cloudflare.RadarAttackLayer3TimeseriesGroupIndustryParamsFormatJson),
- IPVersion: cloudflare.F([]cloudflare.RadarAttackLayer3TimeseriesGroupIndustryParamsIPVersion{cloudflare.RadarAttackLayer3TimeseriesGroupIndustryParamsIPVersionIPv4, cloudflare.RadarAttackLayer3TimeseriesGroupIndustryParamsIPVersionIPv6}),
- LimitPerGroup: cloudflare.F(int64(4)),
- Location: cloudflare.F([]string{"string", "string", "string"}),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- Normalization: cloudflare.F(cloudflare.RadarAttackLayer3TimeseriesGroupIndustryParamsNormalizationPercentage),
- })
- 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())
- }
-}
-
-func TestRadarAttackLayer3TimeseriesGroupIPVersionWithOptionalParams(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"),
- )
- _, 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()}),
- Direction: cloudflare.F(cloudflare.RadarAttackLayer3TimeseriesGroupIPVersionParamsDirectionOrigin),
- Format: cloudflare.F(cloudflare.RadarAttackLayer3TimeseriesGroupIPVersionParamsFormatJson),
- Location: cloudflare.F([]string{"string", "string", "string"}),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- Normalization: cloudflare.F(cloudflare.RadarAttackLayer3TimeseriesGroupIPVersionParamsNormalizationPercentage),
- Protocol: cloudflare.F([]cloudflare.RadarAttackLayer3TimeseriesGroupIPVersionParamsProtocol{cloudflare.RadarAttackLayer3TimeseriesGroupIPVersionParamsProtocolUdp, cloudflare.RadarAttackLayer3TimeseriesGroupIPVersionParamsProtocolTcp, cloudflare.RadarAttackLayer3TimeseriesGroupIPVersionParamsProtocolIcmp}),
- })
- 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())
- }
-}
-
-func TestRadarAttackLayer3TimeseriesGroupProtocolWithOptionalParams(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"),
- )
- _, 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()}),
- Direction: cloudflare.F(cloudflare.RadarAttackLayer3TimeseriesGroupProtocolParamsDirectionOrigin),
- Format: cloudflare.F(cloudflare.RadarAttackLayer3TimeseriesGroupProtocolParamsFormatJson),
- IPVersion: cloudflare.F([]cloudflare.RadarAttackLayer3TimeseriesGroupProtocolParamsIPVersion{cloudflare.RadarAttackLayer3TimeseriesGroupProtocolParamsIPVersionIPv4, cloudflare.RadarAttackLayer3TimeseriesGroupProtocolParamsIPVersionIPv6}),
- Location: cloudflare.F([]string{"string", "string", "string"}),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- Normalization: cloudflare.F(cloudflare.RadarAttackLayer3TimeseriesGroupProtocolParamsNormalizationPercentage),
- })
- 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())
- }
-}
-
-func TestRadarAttackLayer3TimeseriesGroupVectorWithOptionalParams(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"),
- )
- _, 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()}),
- Direction: cloudflare.F(cloudflare.RadarAttackLayer3TimeseriesGroupVectorParamsDirectionOrigin),
- Format: cloudflare.F(cloudflare.RadarAttackLayer3TimeseriesGroupVectorParamsFormatJson),
- IPVersion: cloudflare.F([]cloudflare.RadarAttackLayer3TimeseriesGroupVectorParamsIPVersion{cloudflare.RadarAttackLayer3TimeseriesGroupVectorParamsIPVersionIPv4, cloudflare.RadarAttackLayer3TimeseriesGroupVectorParamsIPVersionIPv6}),
- LimitPerGroup: cloudflare.F(int64(4)),
- Location: cloudflare.F([]string{"string", "string", "string"}),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- Normalization: cloudflare.F(cloudflare.RadarAttackLayer3TimeseriesGroupVectorParamsNormalizationPercentage),
- Protocol: cloudflare.F([]cloudflare.RadarAttackLayer3TimeseriesGroupVectorParamsProtocol{cloudflare.RadarAttackLayer3TimeseriesGroupVectorParamsProtocolUdp, cloudflare.RadarAttackLayer3TimeseriesGroupVectorParamsProtocolTcp, cloudflare.RadarAttackLayer3TimeseriesGroupVectorParamsProtocolIcmp}),
- })
- 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())
- }
-}
-
-func TestRadarAttackLayer3TimeseriesGroupVerticalWithOptionalParams(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"),
- )
- _, 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()}),
- Direction: cloudflare.F(cloudflare.RadarAttackLayer3TimeseriesGroupVerticalParamsDirectionOrigin),
- Format: cloudflare.F(cloudflare.RadarAttackLayer3TimeseriesGroupVerticalParamsFormatJson),
- IPVersion: cloudflare.F([]cloudflare.RadarAttackLayer3TimeseriesGroupVerticalParamsIPVersion{cloudflare.RadarAttackLayer3TimeseriesGroupVerticalParamsIPVersionIPv4, cloudflare.RadarAttackLayer3TimeseriesGroupVerticalParamsIPVersionIPv6}),
- LimitPerGroup: cloudflare.F(int64(4)),
- Location: cloudflare.F([]string{"string", "string", "string"}),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- Normalization: cloudflare.F(cloudflare.RadarAttackLayer3TimeseriesGroupVerticalParamsNormalizationPercentage),
- })
- 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/radarattacklayer3top.go b/radarattacklayer3top.go
deleted file mode 100644
index 212616b4cc3..00000000000
--- a/radarattacklayer3top.go
+++ /dev/null
@@ -1,871 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarAttackLayer3TopService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewRadarAttackLayer3TopService]
-// method instead.
-type RadarAttackLayer3TopService struct {
- Options []option.RequestOption
- Locations *RadarAttackLayer3TopLocationService
-}
-
-// NewRadarAttackLayer3TopService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewRadarAttackLayer3TopService(opts ...option.RequestOption) (r *RadarAttackLayer3TopService) {
- r = &RadarAttackLayer3TopService{}
- r.Options = opts
- r.Locations = NewRadarAttackLayer3TopLocationService(opts...)
- return
-}
-
-// Get the top attacks from origin to target location. Values are a percentage out
-// of the total layer 3 attacks (with billing country). You can optionally limit
-// the number of attacks per origin/target location (useful if all the top attacks
-// are from or to the same location).
-func (r *RadarAttackLayer3TopService) Attacks(ctx context.Context, query RadarAttackLayer3TopAttacksParams, opts ...option.RequestOption) (res *RadarAttackLayer3TopAttacksResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarAttackLayer3TopAttacksResponseEnvelope
- path := "radar/attacks/layer3/top/attacks"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Get the Industry of attacks.
-func (r *RadarAttackLayer3TopService) Industry(ctx context.Context, query RadarAttackLayer3TopIndustryParams, opts ...option.RequestOption) (res *RadarAttackLayer3TopIndustryResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarAttackLayer3TopIndustryResponseEnvelope
- path := "radar/attacks/layer3/top/industry"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Get the Verticals of attacks.
-func (r *RadarAttackLayer3TopService) Vertical(ctx context.Context, query RadarAttackLayer3TopVerticalParams, opts ...option.RequestOption) (res *RadarAttackLayer3TopVerticalResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarAttackLayer3TopVerticalResponseEnvelope
- path := "radar/attacks/layer3/top/vertical"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type RadarAttackLayer3TopAttacksResponse struct {
- Meta RadarAttackLayer3TopAttacksResponseMeta `json:"meta,required"`
- Top0 []RadarAttackLayer3TopAttacksResponseTop0 `json:"top_0,required"`
- JSON radarAttackLayer3TopAttacksResponseJSON `json:"-"`
-}
-
-// radarAttackLayer3TopAttacksResponseJSON contains the JSON metadata for the
-// struct [RadarAttackLayer3TopAttacksResponse]
-type radarAttackLayer3TopAttacksResponseJSON struct {
- Meta apijson.Field
- Top0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3TopAttacksResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3TopAttacksResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3TopAttacksResponseMeta struct {
- DateRange []RadarAttackLayer3TopAttacksResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- ConfidenceInfo RadarAttackLayer3TopAttacksResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarAttackLayer3TopAttacksResponseMetaJSON `json:"-"`
-}
-
-// radarAttackLayer3TopAttacksResponseMetaJSON contains the JSON metadata for the
-// struct [RadarAttackLayer3TopAttacksResponseMeta]
-type radarAttackLayer3TopAttacksResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3TopAttacksResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3TopAttacksResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3TopAttacksResponseMetaDateRange 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 radarAttackLayer3TopAttacksResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarAttackLayer3TopAttacksResponseMetaDateRangeJSON contains the JSON metadata
-// for the struct [RadarAttackLayer3TopAttacksResponseMetaDateRange]
-type radarAttackLayer3TopAttacksResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3TopAttacksResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3TopAttacksResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3TopAttacksResponseMetaConfidenceInfo struct {
- Annotations []RadarAttackLayer3TopAttacksResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarAttackLayer3TopAttacksResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarAttackLayer3TopAttacksResponseMetaConfidenceInfoJSON contains the JSON
-// metadata for the struct [RadarAttackLayer3TopAttacksResponseMetaConfidenceInfo]
-type radarAttackLayer3TopAttacksResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3TopAttacksResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3TopAttacksResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3TopAttacksResponseMetaConfidenceInfoAnnotation 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 radarAttackLayer3TopAttacksResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarAttackLayer3TopAttacksResponseMetaConfidenceInfoAnnotationJSON contains the
-// JSON metadata for the struct
-// [RadarAttackLayer3TopAttacksResponseMetaConfidenceInfoAnnotation]
-type radarAttackLayer3TopAttacksResponseMetaConfidenceInfoAnnotationJSON 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 *RadarAttackLayer3TopAttacksResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3TopAttacksResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3TopAttacksResponseTop0 struct {
- OriginCountryAlpha2 string `json:"originCountryAlpha2,required"`
- OriginCountryName string `json:"originCountryName,required"`
- Value string `json:"value,required"`
- JSON radarAttackLayer3TopAttacksResponseTop0JSON `json:"-"`
-}
-
-// radarAttackLayer3TopAttacksResponseTop0JSON contains the JSON metadata for the
-// struct [RadarAttackLayer3TopAttacksResponseTop0]
-type radarAttackLayer3TopAttacksResponseTop0JSON struct {
- OriginCountryAlpha2 apijson.Field
- OriginCountryName apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3TopAttacksResponseTop0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3TopAttacksResponseTop0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3TopIndustryResponse struct {
- Meta RadarAttackLayer3TopIndustryResponseMeta `json:"meta,required"`
- Top0 []RadarAttackLayer3TopIndustryResponseTop0 `json:"top_0,required"`
- JSON radarAttackLayer3TopIndustryResponseJSON `json:"-"`
-}
-
-// radarAttackLayer3TopIndustryResponseJSON contains the JSON metadata for the
-// struct [RadarAttackLayer3TopIndustryResponse]
-type radarAttackLayer3TopIndustryResponseJSON struct {
- Meta apijson.Field
- Top0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3TopIndustryResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3TopIndustryResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3TopIndustryResponseMeta struct {
- DateRange []RadarAttackLayer3TopIndustryResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- ConfidenceInfo RadarAttackLayer3TopIndustryResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarAttackLayer3TopIndustryResponseMetaJSON `json:"-"`
-}
-
-// radarAttackLayer3TopIndustryResponseMetaJSON contains the JSON metadata for the
-// struct [RadarAttackLayer3TopIndustryResponseMeta]
-type radarAttackLayer3TopIndustryResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3TopIndustryResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3TopIndustryResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3TopIndustryResponseMetaDateRange 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 radarAttackLayer3TopIndustryResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarAttackLayer3TopIndustryResponseMetaDateRangeJSON contains the JSON metadata
-// for the struct [RadarAttackLayer3TopIndustryResponseMetaDateRange]
-type radarAttackLayer3TopIndustryResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3TopIndustryResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3TopIndustryResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3TopIndustryResponseMetaConfidenceInfo struct {
- Annotations []RadarAttackLayer3TopIndustryResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarAttackLayer3TopIndustryResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarAttackLayer3TopIndustryResponseMetaConfidenceInfoJSON contains the JSON
-// metadata for the struct [RadarAttackLayer3TopIndustryResponseMetaConfidenceInfo]
-type radarAttackLayer3TopIndustryResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3TopIndustryResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3TopIndustryResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3TopIndustryResponseMetaConfidenceInfoAnnotation 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 radarAttackLayer3TopIndustryResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarAttackLayer3TopIndustryResponseMetaConfidenceInfoAnnotationJSON contains
-// the JSON metadata for the struct
-// [RadarAttackLayer3TopIndustryResponseMetaConfidenceInfoAnnotation]
-type radarAttackLayer3TopIndustryResponseMetaConfidenceInfoAnnotationJSON 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 *RadarAttackLayer3TopIndustryResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3TopIndustryResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3TopIndustryResponseTop0 struct {
- Name string `json:"name,required"`
- Value string `json:"value,required"`
- JSON radarAttackLayer3TopIndustryResponseTop0JSON `json:"-"`
-}
-
-// radarAttackLayer3TopIndustryResponseTop0JSON contains the JSON metadata for the
-// struct [RadarAttackLayer3TopIndustryResponseTop0]
-type radarAttackLayer3TopIndustryResponseTop0JSON struct {
- Name apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3TopIndustryResponseTop0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3TopIndustryResponseTop0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3TopVerticalResponse struct {
- Meta RadarAttackLayer3TopVerticalResponseMeta `json:"meta,required"`
- Top0 []RadarAttackLayer3TopVerticalResponseTop0 `json:"top_0,required"`
- JSON radarAttackLayer3TopVerticalResponseJSON `json:"-"`
-}
-
-// radarAttackLayer3TopVerticalResponseJSON contains the JSON metadata for the
-// struct [RadarAttackLayer3TopVerticalResponse]
-type radarAttackLayer3TopVerticalResponseJSON struct {
- Meta apijson.Field
- Top0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3TopVerticalResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3TopVerticalResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3TopVerticalResponseMeta struct {
- DateRange []RadarAttackLayer3TopVerticalResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- ConfidenceInfo RadarAttackLayer3TopVerticalResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarAttackLayer3TopVerticalResponseMetaJSON `json:"-"`
-}
-
-// radarAttackLayer3TopVerticalResponseMetaJSON contains the JSON metadata for the
-// struct [RadarAttackLayer3TopVerticalResponseMeta]
-type radarAttackLayer3TopVerticalResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3TopVerticalResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3TopVerticalResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3TopVerticalResponseMetaDateRange 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 radarAttackLayer3TopVerticalResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarAttackLayer3TopVerticalResponseMetaDateRangeJSON contains the JSON metadata
-// for the struct [RadarAttackLayer3TopVerticalResponseMetaDateRange]
-type radarAttackLayer3TopVerticalResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3TopVerticalResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3TopVerticalResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3TopVerticalResponseMetaConfidenceInfo struct {
- Annotations []RadarAttackLayer3TopVerticalResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarAttackLayer3TopVerticalResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarAttackLayer3TopVerticalResponseMetaConfidenceInfoJSON contains the JSON
-// metadata for the struct [RadarAttackLayer3TopVerticalResponseMetaConfidenceInfo]
-type radarAttackLayer3TopVerticalResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3TopVerticalResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3TopVerticalResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3TopVerticalResponseMetaConfidenceInfoAnnotation 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 radarAttackLayer3TopVerticalResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarAttackLayer3TopVerticalResponseMetaConfidenceInfoAnnotationJSON contains
-// the JSON metadata for the struct
-// [RadarAttackLayer3TopVerticalResponseMetaConfidenceInfoAnnotation]
-type radarAttackLayer3TopVerticalResponseMetaConfidenceInfoAnnotationJSON 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 *RadarAttackLayer3TopVerticalResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3TopVerticalResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3TopVerticalResponseTop0 struct {
- Name string `json:"name,required"`
- Value string `json:"value,required"`
- JSON radarAttackLayer3TopVerticalResponseTop0JSON `json:"-"`
-}
-
-// radarAttackLayer3TopVerticalResponseTop0JSON contains the JSON metadata for the
-// struct [RadarAttackLayer3TopVerticalResponseTop0]
-type radarAttackLayer3TopVerticalResponseTop0JSON struct {
- Name apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3TopVerticalResponseTop0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3TopVerticalResponseTop0JSON) RawJSON() string {
- return r.raw
-}
-
-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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarAttackLayer3TopAttacksParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Format results are returned in.
- Format param.Field[RadarAttackLayer3TopAttacksParamsFormat] `query:"format"`
- // Filter for ip version.
- IPVersion param.Field[[]RadarAttackLayer3TopAttacksParamsIPVersion] `query:"ipVersion"`
- // Limit the number of objects in the response.
- Limit param.Field[int64] `query:"limit"`
- // Array of attack origin/target location attack limits. Together with
- // `limitPerLocation`, limits how many objects will be fetched per origin/target
- // location.
- LimitDirection param.Field[RadarAttackLayer3TopAttacksParamsLimitDirection] `query:"limitDirection"`
- // Limit the number of attacks per origin/target (refer to `limitDirection`
- // parameter) location.
- LimitPerLocation param.Field[int64] `query:"limitPerLocation"`
- // 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"`
- // Array of L3/4 attack types.
- Protocol param.Field[[]RadarAttackLayer3TopAttacksParamsProtocol] `query:"protocol"`
-}
-
-// URLQuery serializes [RadarAttackLayer3TopAttacksParams]'s query parameters as
-// `url.Values`.
-func (r RadarAttackLayer3TopAttacksParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type RadarAttackLayer3TopAttacksParamsDateRange string
-
-const (
- RadarAttackLayer3TopAttacksParamsDateRange1d RadarAttackLayer3TopAttacksParamsDateRange = "1d"
- RadarAttackLayer3TopAttacksParamsDateRange2d RadarAttackLayer3TopAttacksParamsDateRange = "2d"
- RadarAttackLayer3TopAttacksParamsDateRange7d RadarAttackLayer3TopAttacksParamsDateRange = "7d"
- RadarAttackLayer3TopAttacksParamsDateRange14d RadarAttackLayer3TopAttacksParamsDateRange = "14d"
- RadarAttackLayer3TopAttacksParamsDateRange28d RadarAttackLayer3TopAttacksParamsDateRange = "28d"
- RadarAttackLayer3TopAttacksParamsDateRange12w RadarAttackLayer3TopAttacksParamsDateRange = "12w"
- RadarAttackLayer3TopAttacksParamsDateRange24w RadarAttackLayer3TopAttacksParamsDateRange = "24w"
- RadarAttackLayer3TopAttacksParamsDateRange52w RadarAttackLayer3TopAttacksParamsDateRange = "52w"
- RadarAttackLayer3TopAttacksParamsDateRange1dControl RadarAttackLayer3TopAttacksParamsDateRange = "1dControl"
- RadarAttackLayer3TopAttacksParamsDateRange2dControl RadarAttackLayer3TopAttacksParamsDateRange = "2dControl"
- RadarAttackLayer3TopAttacksParamsDateRange7dControl RadarAttackLayer3TopAttacksParamsDateRange = "7dControl"
- RadarAttackLayer3TopAttacksParamsDateRange14dControl RadarAttackLayer3TopAttacksParamsDateRange = "14dControl"
- RadarAttackLayer3TopAttacksParamsDateRange28dControl RadarAttackLayer3TopAttacksParamsDateRange = "28dControl"
- RadarAttackLayer3TopAttacksParamsDateRange12wControl RadarAttackLayer3TopAttacksParamsDateRange = "12wControl"
- RadarAttackLayer3TopAttacksParamsDateRange24wControl RadarAttackLayer3TopAttacksParamsDateRange = "24wControl"
-)
-
-// Format results are returned in.
-type RadarAttackLayer3TopAttacksParamsFormat string
-
-const (
- RadarAttackLayer3TopAttacksParamsFormatJson RadarAttackLayer3TopAttacksParamsFormat = "JSON"
- RadarAttackLayer3TopAttacksParamsFormatCsv RadarAttackLayer3TopAttacksParamsFormat = "CSV"
-)
-
-type RadarAttackLayer3TopAttacksParamsIPVersion string
-
-const (
- RadarAttackLayer3TopAttacksParamsIPVersionIPv4 RadarAttackLayer3TopAttacksParamsIPVersion = "IPv4"
- RadarAttackLayer3TopAttacksParamsIPVersionIPv6 RadarAttackLayer3TopAttacksParamsIPVersion = "IPv6"
-)
-
-// Array of attack origin/target location attack limits. Together with
-// `limitPerLocation`, limits how many objects will be fetched per origin/target
-// location.
-type RadarAttackLayer3TopAttacksParamsLimitDirection string
-
-const (
- RadarAttackLayer3TopAttacksParamsLimitDirectionOrigin RadarAttackLayer3TopAttacksParamsLimitDirection = "ORIGIN"
- RadarAttackLayer3TopAttacksParamsLimitDirectionTarget RadarAttackLayer3TopAttacksParamsLimitDirection = "TARGET"
-)
-
-type RadarAttackLayer3TopAttacksParamsProtocol string
-
-const (
- RadarAttackLayer3TopAttacksParamsProtocolUdp RadarAttackLayer3TopAttacksParamsProtocol = "UDP"
- RadarAttackLayer3TopAttacksParamsProtocolTcp RadarAttackLayer3TopAttacksParamsProtocol = "TCP"
- RadarAttackLayer3TopAttacksParamsProtocolIcmp RadarAttackLayer3TopAttacksParamsProtocol = "ICMP"
- RadarAttackLayer3TopAttacksParamsProtocolGRE RadarAttackLayer3TopAttacksParamsProtocol = "GRE"
-)
-
-type RadarAttackLayer3TopAttacksResponseEnvelope struct {
- Result RadarAttackLayer3TopAttacksResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarAttackLayer3TopAttacksResponseEnvelopeJSON `json:"-"`
-}
-
-// radarAttackLayer3TopAttacksResponseEnvelopeJSON contains the JSON metadata for
-// the struct [RadarAttackLayer3TopAttacksResponseEnvelope]
-type radarAttackLayer3TopAttacksResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3TopAttacksResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3TopAttacksResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarAttackLayer3TopIndustryParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Format results are returned in.
- Format param.Field[RadarAttackLayer3TopIndustryParamsFormat] `query:"format"`
- // Filter for ip version.
- IPVersion param.Field[[]RadarAttackLayer3TopIndustryParamsIPVersion] `query:"ipVersion"`
- // 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"`
- // Array of L3/4 attack types.
- Protocol param.Field[[]RadarAttackLayer3TopIndustryParamsProtocol] `query:"protocol"`
-}
-
-// URLQuery serializes [RadarAttackLayer3TopIndustryParams]'s query parameters as
-// `url.Values`.
-func (r RadarAttackLayer3TopIndustryParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type RadarAttackLayer3TopIndustryParamsDateRange string
-
-const (
- RadarAttackLayer3TopIndustryParamsDateRange1d RadarAttackLayer3TopIndustryParamsDateRange = "1d"
- RadarAttackLayer3TopIndustryParamsDateRange2d RadarAttackLayer3TopIndustryParamsDateRange = "2d"
- RadarAttackLayer3TopIndustryParamsDateRange7d RadarAttackLayer3TopIndustryParamsDateRange = "7d"
- RadarAttackLayer3TopIndustryParamsDateRange14d RadarAttackLayer3TopIndustryParamsDateRange = "14d"
- RadarAttackLayer3TopIndustryParamsDateRange28d RadarAttackLayer3TopIndustryParamsDateRange = "28d"
- RadarAttackLayer3TopIndustryParamsDateRange12w RadarAttackLayer3TopIndustryParamsDateRange = "12w"
- RadarAttackLayer3TopIndustryParamsDateRange24w RadarAttackLayer3TopIndustryParamsDateRange = "24w"
- RadarAttackLayer3TopIndustryParamsDateRange52w RadarAttackLayer3TopIndustryParamsDateRange = "52w"
- RadarAttackLayer3TopIndustryParamsDateRange1dControl RadarAttackLayer3TopIndustryParamsDateRange = "1dControl"
- RadarAttackLayer3TopIndustryParamsDateRange2dControl RadarAttackLayer3TopIndustryParamsDateRange = "2dControl"
- RadarAttackLayer3TopIndustryParamsDateRange7dControl RadarAttackLayer3TopIndustryParamsDateRange = "7dControl"
- RadarAttackLayer3TopIndustryParamsDateRange14dControl RadarAttackLayer3TopIndustryParamsDateRange = "14dControl"
- RadarAttackLayer3TopIndustryParamsDateRange28dControl RadarAttackLayer3TopIndustryParamsDateRange = "28dControl"
- RadarAttackLayer3TopIndustryParamsDateRange12wControl RadarAttackLayer3TopIndustryParamsDateRange = "12wControl"
- RadarAttackLayer3TopIndustryParamsDateRange24wControl RadarAttackLayer3TopIndustryParamsDateRange = "24wControl"
-)
-
-// Format results are returned in.
-type RadarAttackLayer3TopIndustryParamsFormat string
-
-const (
- RadarAttackLayer3TopIndustryParamsFormatJson RadarAttackLayer3TopIndustryParamsFormat = "JSON"
- RadarAttackLayer3TopIndustryParamsFormatCsv RadarAttackLayer3TopIndustryParamsFormat = "CSV"
-)
-
-type RadarAttackLayer3TopIndustryParamsIPVersion string
-
-const (
- RadarAttackLayer3TopIndustryParamsIPVersionIPv4 RadarAttackLayer3TopIndustryParamsIPVersion = "IPv4"
- RadarAttackLayer3TopIndustryParamsIPVersionIPv6 RadarAttackLayer3TopIndustryParamsIPVersion = "IPv6"
-)
-
-type RadarAttackLayer3TopIndustryParamsProtocol string
-
-const (
- RadarAttackLayer3TopIndustryParamsProtocolUdp RadarAttackLayer3TopIndustryParamsProtocol = "UDP"
- RadarAttackLayer3TopIndustryParamsProtocolTcp RadarAttackLayer3TopIndustryParamsProtocol = "TCP"
- RadarAttackLayer3TopIndustryParamsProtocolIcmp RadarAttackLayer3TopIndustryParamsProtocol = "ICMP"
- RadarAttackLayer3TopIndustryParamsProtocolGRE RadarAttackLayer3TopIndustryParamsProtocol = "GRE"
-)
-
-type RadarAttackLayer3TopIndustryResponseEnvelope struct {
- Result RadarAttackLayer3TopIndustryResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarAttackLayer3TopIndustryResponseEnvelopeJSON `json:"-"`
-}
-
-// radarAttackLayer3TopIndustryResponseEnvelopeJSON contains the JSON metadata for
-// the struct [RadarAttackLayer3TopIndustryResponseEnvelope]
-type radarAttackLayer3TopIndustryResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3TopIndustryResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3TopIndustryResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarAttackLayer3TopVerticalParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Format results are returned in.
- Format param.Field[RadarAttackLayer3TopVerticalParamsFormat] `query:"format"`
- // Filter for ip version.
- IPVersion param.Field[[]RadarAttackLayer3TopVerticalParamsIPVersion] `query:"ipVersion"`
- // 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"`
- // Array of L3/4 attack types.
- Protocol param.Field[[]RadarAttackLayer3TopVerticalParamsProtocol] `query:"protocol"`
-}
-
-// URLQuery serializes [RadarAttackLayer3TopVerticalParams]'s query parameters as
-// `url.Values`.
-func (r RadarAttackLayer3TopVerticalParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type RadarAttackLayer3TopVerticalParamsDateRange string
-
-const (
- RadarAttackLayer3TopVerticalParamsDateRange1d RadarAttackLayer3TopVerticalParamsDateRange = "1d"
- RadarAttackLayer3TopVerticalParamsDateRange2d RadarAttackLayer3TopVerticalParamsDateRange = "2d"
- RadarAttackLayer3TopVerticalParamsDateRange7d RadarAttackLayer3TopVerticalParamsDateRange = "7d"
- RadarAttackLayer3TopVerticalParamsDateRange14d RadarAttackLayer3TopVerticalParamsDateRange = "14d"
- RadarAttackLayer3TopVerticalParamsDateRange28d RadarAttackLayer3TopVerticalParamsDateRange = "28d"
- RadarAttackLayer3TopVerticalParamsDateRange12w RadarAttackLayer3TopVerticalParamsDateRange = "12w"
- RadarAttackLayer3TopVerticalParamsDateRange24w RadarAttackLayer3TopVerticalParamsDateRange = "24w"
- RadarAttackLayer3TopVerticalParamsDateRange52w RadarAttackLayer3TopVerticalParamsDateRange = "52w"
- RadarAttackLayer3TopVerticalParamsDateRange1dControl RadarAttackLayer3TopVerticalParamsDateRange = "1dControl"
- RadarAttackLayer3TopVerticalParamsDateRange2dControl RadarAttackLayer3TopVerticalParamsDateRange = "2dControl"
- RadarAttackLayer3TopVerticalParamsDateRange7dControl RadarAttackLayer3TopVerticalParamsDateRange = "7dControl"
- RadarAttackLayer3TopVerticalParamsDateRange14dControl RadarAttackLayer3TopVerticalParamsDateRange = "14dControl"
- RadarAttackLayer3TopVerticalParamsDateRange28dControl RadarAttackLayer3TopVerticalParamsDateRange = "28dControl"
- RadarAttackLayer3TopVerticalParamsDateRange12wControl RadarAttackLayer3TopVerticalParamsDateRange = "12wControl"
- RadarAttackLayer3TopVerticalParamsDateRange24wControl RadarAttackLayer3TopVerticalParamsDateRange = "24wControl"
-)
-
-// Format results are returned in.
-type RadarAttackLayer3TopVerticalParamsFormat string
-
-const (
- RadarAttackLayer3TopVerticalParamsFormatJson RadarAttackLayer3TopVerticalParamsFormat = "JSON"
- RadarAttackLayer3TopVerticalParamsFormatCsv RadarAttackLayer3TopVerticalParamsFormat = "CSV"
-)
-
-type RadarAttackLayer3TopVerticalParamsIPVersion string
-
-const (
- RadarAttackLayer3TopVerticalParamsIPVersionIPv4 RadarAttackLayer3TopVerticalParamsIPVersion = "IPv4"
- RadarAttackLayer3TopVerticalParamsIPVersionIPv6 RadarAttackLayer3TopVerticalParamsIPVersion = "IPv6"
-)
-
-type RadarAttackLayer3TopVerticalParamsProtocol string
-
-const (
- RadarAttackLayer3TopVerticalParamsProtocolUdp RadarAttackLayer3TopVerticalParamsProtocol = "UDP"
- RadarAttackLayer3TopVerticalParamsProtocolTcp RadarAttackLayer3TopVerticalParamsProtocol = "TCP"
- RadarAttackLayer3TopVerticalParamsProtocolIcmp RadarAttackLayer3TopVerticalParamsProtocol = "ICMP"
- RadarAttackLayer3TopVerticalParamsProtocolGRE RadarAttackLayer3TopVerticalParamsProtocol = "GRE"
-)
-
-type RadarAttackLayer3TopVerticalResponseEnvelope struct {
- Result RadarAttackLayer3TopVerticalResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarAttackLayer3TopVerticalResponseEnvelopeJSON `json:"-"`
-}
-
-// radarAttackLayer3TopVerticalResponseEnvelopeJSON contains the JSON metadata for
-// the struct [RadarAttackLayer3TopVerticalResponseEnvelope]
-type radarAttackLayer3TopVerticalResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3TopVerticalResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3TopVerticalResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
diff --git a/radarattacklayer3top_test.go b/radarattacklayer3top_test.go
deleted file mode 100644
index 37116ff6ea0..00000000000
--- a/radarattacklayer3top_test.go
+++ /dev/null
@@ -1,122 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
- "time"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRadarAttackLayer3TopAttacksWithOptionalParams(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"),
- )
- _, 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()}),
- Format: cloudflare.F(cloudflare.RadarAttackLayer3TopAttacksParamsFormatJson),
- IPVersion: cloudflare.F([]cloudflare.RadarAttackLayer3TopAttacksParamsIPVersion{cloudflare.RadarAttackLayer3TopAttacksParamsIPVersionIPv4, cloudflare.RadarAttackLayer3TopAttacksParamsIPVersionIPv6}),
- Limit: cloudflare.F(int64(5)),
- LimitDirection: cloudflare.F(cloudflare.RadarAttackLayer3TopAttacksParamsLimitDirectionOrigin),
- LimitPerLocation: cloudflare.F(int64(10)),
- Location: cloudflare.F([]string{"string", "string", "string"}),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- Protocol: cloudflare.F([]cloudflare.RadarAttackLayer3TopAttacksParamsProtocol{cloudflare.RadarAttackLayer3TopAttacksParamsProtocolUdp, cloudflare.RadarAttackLayer3TopAttacksParamsProtocolTcp, cloudflare.RadarAttackLayer3TopAttacksParamsProtocolIcmp}),
- })
- 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())
- }
-}
-
-func TestRadarAttackLayer3TopIndustryWithOptionalParams(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"),
- )
- _, 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()}),
- Format: cloudflare.F(cloudflare.RadarAttackLayer3TopIndustryParamsFormatJson),
- IPVersion: cloudflare.F([]cloudflare.RadarAttackLayer3TopIndustryParamsIPVersion{cloudflare.RadarAttackLayer3TopIndustryParamsIPVersionIPv4, cloudflare.RadarAttackLayer3TopIndustryParamsIPVersionIPv6}),
- Limit: cloudflare.F(int64(5)),
- Location: cloudflare.F([]string{"string", "string", "string"}),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- Protocol: cloudflare.F([]cloudflare.RadarAttackLayer3TopIndustryParamsProtocol{cloudflare.RadarAttackLayer3TopIndustryParamsProtocolUdp, cloudflare.RadarAttackLayer3TopIndustryParamsProtocolTcp, cloudflare.RadarAttackLayer3TopIndustryParamsProtocolIcmp}),
- })
- 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())
- }
-}
-
-func TestRadarAttackLayer3TopVerticalWithOptionalParams(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"),
- )
- _, 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()}),
- Format: cloudflare.F(cloudflare.RadarAttackLayer3TopVerticalParamsFormatJson),
- IPVersion: cloudflare.F([]cloudflare.RadarAttackLayer3TopVerticalParamsIPVersion{cloudflare.RadarAttackLayer3TopVerticalParamsIPVersionIPv4, cloudflare.RadarAttackLayer3TopVerticalParamsIPVersionIPv6}),
- Limit: cloudflare.F(int64(5)),
- Location: cloudflare.F([]string{"string", "string", "string"}),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- Protocol: cloudflare.F([]cloudflare.RadarAttackLayer3TopVerticalParamsProtocol{cloudflare.RadarAttackLayer3TopVerticalParamsProtocolUdp, cloudflare.RadarAttackLayer3TopVerticalParamsProtocolTcp, cloudflare.RadarAttackLayer3TopVerticalParamsProtocolIcmp}),
- })
- 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/radarattacklayer3toplocation.go b/radarattacklayer3toplocation.go
deleted file mode 100644
index b3555140b3f..00000000000
--- a/radarattacklayer3toplocation.go
+++ /dev/null
@@ -1,588 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarAttackLayer3TopLocationService contains methods and other services that
-// help with interacting with the cloudflare API. Note, unlike clients, this
-// service does not read variables from the environment automatically. You should
-// not instantiate this service directly, and instead use the
-// [NewRadarAttackLayer3TopLocationService] method instead.
-type RadarAttackLayer3TopLocationService struct {
- Options []option.RequestOption
-}
-
-// NewRadarAttackLayer3TopLocationService generates a new service that applies the
-// given options to each request. These options are applied after the parent
-// client's options (if there is one), and before any request-specific options.
-func NewRadarAttackLayer3TopLocationService(opts ...option.RequestOption) (r *RadarAttackLayer3TopLocationService) {
- r = &RadarAttackLayer3TopLocationService{}
- r.Options = opts
- return
-}
-
-// Get the origin locations of attacks.
-func (r *RadarAttackLayer3TopLocationService) Origin(ctx context.Context, query RadarAttackLayer3TopLocationOriginParams, opts ...option.RequestOption) (res *RadarAttackLayer3TopLocationOriginResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarAttackLayer3TopLocationOriginResponseEnvelope
- path := "radar/attacks/layer3/top/locations/origin"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Get the target locations of attacks.
-func (r *RadarAttackLayer3TopLocationService) Target(ctx context.Context, query RadarAttackLayer3TopLocationTargetParams, opts ...option.RequestOption) (res *RadarAttackLayer3TopLocationTargetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarAttackLayer3TopLocationTargetResponseEnvelope
- path := "radar/attacks/layer3/top/locations/target"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type RadarAttackLayer3TopLocationOriginResponse struct {
- Meta RadarAttackLayer3TopLocationOriginResponseMeta `json:"meta,required"`
- Top0 []RadarAttackLayer3TopLocationOriginResponseTop0 `json:"top_0,required"`
- JSON radarAttackLayer3TopLocationOriginResponseJSON `json:"-"`
-}
-
-// radarAttackLayer3TopLocationOriginResponseJSON contains the JSON metadata for
-// the struct [RadarAttackLayer3TopLocationOriginResponse]
-type radarAttackLayer3TopLocationOriginResponseJSON struct {
- Meta apijson.Field
- Top0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3TopLocationOriginResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3TopLocationOriginResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3TopLocationOriginResponseMeta struct {
- DateRange []RadarAttackLayer3TopLocationOriginResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- ConfidenceInfo RadarAttackLayer3TopLocationOriginResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarAttackLayer3TopLocationOriginResponseMetaJSON `json:"-"`
-}
-
-// radarAttackLayer3TopLocationOriginResponseMetaJSON contains the JSON metadata
-// for the struct [RadarAttackLayer3TopLocationOriginResponseMeta]
-type radarAttackLayer3TopLocationOriginResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3TopLocationOriginResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3TopLocationOriginResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3TopLocationOriginResponseMetaDateRange 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 radarAttackLayer3TopLocationOriginResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarAttackLayer3TopLocationOriginResponseMetaDateRangeJSON contains the JSON
-// metadata for the struct
-// [RadarAttackLayer3TopLocationOriginResponseMetaDateRange]
-type radarAttackLayer3TopLocationOriginResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3TopLocationOriginResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3TopLocationOriginResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3TopLocationOriginResponseMetaConfidenceInfo struct {
- Annotations []RadarAttackLayer3TopLocationOriginResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarAttackLayer3TopLocationOriginResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarAttackLayer3TopLocationOriginResponseMetaConfidenceInfoJSON contains the
-// JSON metadata for the struct
-// [RadarAttackLayer3TopLocationOriginResponseMetaConfidenceInfo]
-type radarAttackLayer3TopLocationOriginResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3TopLocationOriginResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3TopLocationOriginResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3TopLocationOriginResponseMetaConfidenceInfoAnnotation 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 radarAttackLayer3TopLocationOriginResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarAttackLayer3TopLocationOriginResponseMetaConfidenceInfoAnnotationJSON
-// contains the JSON metadata for the struct
-// [RadarAttackLayer3TopLocationOriginResponseMetaConfidenceInfoAnnotation]
-type radarAttackLayer3TopLocationOriginResponseMetaConfidenceInfoAnnotationJSON 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 *RadarAttackLayer3TopLocationOriginResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3TopLocationOriginResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3TopLocationOriginResponseTop0 struct {
- OriginCountryAlpha2 string `json:"originCountryAlpha2,required"`
- OriginCountryName string `json:"originCountryName,required"`
- Rank float64 `json:"rank,required"`
- Value string `json:"value,required"`
- JSON radarAttackLayer3TopLocationOriginResponseTop0JSON `json:"-"`
-}
-
-// radarAttackLayer3TopLocationOriginResponseTop0JSON contains the JSON metadata
-// for the struct [RadarAttackLayer3TopLocationOriginResponseTop0]
-type radarAttackLayer3TopLocationOriginResponseTop0JSON struct {
- OriginCountryAlpha2 apijson.Field
- OriginCountryName apijson.Field
- Rank apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3TopLocationOriginResponseTop0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3TopLocationOriginResponseTop0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3TopLocationTargetResponse struct {
- Meta RadarAttackLayer3TopLocationTargetResponseMeta `json:"meta,required"`
- Top0 []RadarAttackLayer3TopLocationTargetResponseTop0 `json:"top_0,required"`
- JSON radarAttackLayer3TopLocationTargetResponseJSON `json:"-"`
-}
-
-// radarAttackLayer3TopLocationTargetResponseJSON contains the JSON metadata for
-// the struct [RadarAttackLayer3TopLocationTargetResponse]
-type radarAttackLayer3TopLocationTargetResponseJSON struct {
- Meta apijson.Field
- Top0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3TopLocationTargetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3TopLocationTargetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3TopLocationTargetResponseMeta struct {
- DateRange []RadarAttackLayer3TopLocationTargetResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- ConfidenceInfo RadarAttackLayer3TopLocationTargetResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarAttackLayer3TopLocationTargetResponseMetaJSON `json:"-"`
-}
-
-// radarAttackLayer3TopLocationTargetResponseMetaJSON contains the JSON metadata
-// for the struct [RadarAttackLayer3TopLocationTargetResponseMeta]
-type radarAttackLayer3TopLocationTargetResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3TopLocationTargetResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3TopLocationTargetResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3TopLocationTargetResponseMetaDateRange 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 radarAttackLayer3TopLocationTargetResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarAttackLayer3TopLocationTargetResponseMetaDateRangeJSON contains the JSON
-// metadata for the struct
-// [RadarAttackLayer3TopLocationTargetResponseMetaDateRange]
-type radarAttackLayer3TopLocationTargetResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3TopLocationTargetResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3TopLocationTargetResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3TopLocationTargetResponseMetaConfidenceInfo struct {
- Annotations []RadarAttackLayer3TopLocationTargetResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarAttackLayer3TopLocationTargetResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarAttackLayer3TopLocationTargetResponseMetaConfidenceInfoJSON contains the
-// JSON metadata for the struct
-// [RadarAttackLayer3TopLocationTargetResponseMetaConfidenceInfo]
-type radarAttackLayer3TopLocationTargetResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3TopLocationTargetResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3TopLocationTargetResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3TopLocationTargetResponseMetaConfidenceInfoAnnotation 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 radarAttackLayer3TopLocationTargetResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarAttackLayer3TopLocationTargetResponseMetaConfidenceInfoAnnotationJSON
-// contains the JSON metadata for the struct
-// [RadarAttackLayer3TopLocationTargetResponseMetaConfidenceInfoAnnotation]
-type radarAttackLayer3TopLocationTargetResponseMetaConfidenceInfoAnnotationJSON 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 *RadarAttackLayer3TopLocationTargetResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3TopLocationTargetResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer3TopLocationTargetResponseTop0 struct {
- Rank float64 `json:"rank,required"`
- TargetCountryAlpha2 string `json:"targetCountryAlpha2,required"`
- TargetCountryName string `json:"targetCountryName,required"`
- Value string `json:"value,required"`
- JSON radarAttackLayer3TopLocationTargetResponseTop0JSON `json:"-"`
-}
-
-// radarAttackLayer3TopLocationTargetResponseTop0JSON contains the JSON metadata
-// for the struct [RadarAttackLayer3TopLocationTargetResponseTop0]
-type radarAttackLayer3TopLocationTargetResponseTop0JSON struct {
- Rank apijson.Field
- TargetCountryAlpha2 apijson.Field
- TargetCountryName apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3TopLocationTargetResponseTop0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3TopLocationTargetResponseTop0JSON) RawJSON() string {
- return r.raw
-}
-
-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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarAttackLayer3TopLocationOriginParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Format results are returned in.
- Format param.Field[RadarAttackLayer3TopLocationOriginParamsFormat] `query:"format"`
- // Filter for ip version.
- IPVersion param.Field[[]RadarAttackLayer3TopLocationOriginParamsIPVersion] `query:"ipVersion"`
- // 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"`
- // Array of L3/4 attack types.
- Protocol param.Field[[]RadarAttackLayer3TopLocationOriginParamsProtocol] `query:"protocol"`
-}
-
-// URLQuery serializes [RadarAttackLayer3TopLocationOriginParams]'s query
-// parameters as `url.Values`.
-func (r RadarAttackLayer3TopLocationOriginParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type RadarAttackLayer3TopLocationOriginParamsDateRange string
-
-const (
- RadarAttackLayer3TopLocationOriginParamsDateRange1d RadarAttackLayer3TopLocationOriginParamsDateRange = "1d"
- RadarAttackLayer3TopLocationOriginParamsDateRange2d RadarAttackLayer3TopLocationOriginParamsDateRange = "2d"
- RadarAttackLayer3TopLocationOriginParamsDateRange7d RadarAttackLayer3TopLocationOriginParamsDateRange = "7d"
- RadarAttackLayer3TopLocationOriginParamsDateRange14d RadarAttackLayer3TopLocationOriginParamsDateRange = "14d"
- RadarAttackLayer3TopLocationOriginParamsDateRange28d RadarAttackLayer3TopLocationOriginParamsDateRange = "28d"
- RadarAttackLayer3TopLocationOriginParamsDateRange12w RadarAttackLayer3TopLocationOriginParamsDateRange = "12w"
- RadarAttackLayer3TopLocationOriginParamsDateRange24w RadarAttackLayer3TopLocationOriginParamsDateRange = "24w"
- RadarAttackLayer3TopLocationOriginParamsDateRange52w RadarAttackLayer3TopLocationOriginParamsDateRange = "52w"
- RadarAttackLayer3TopLocationOriginParamsDateRange1dControl RadarAttackLayer3TopLocationOriginParamsDateRange = "1dControl"
- RadarAttackLayer3TopLocationOriginParamsDateRange2dControl RadarAttackLayer3TopLocationOriginParamsDateRange = "2dControl"
- RadarAttackLayer3TopLocationOriginParamsDateRange7dControl RadarAttackLayer3TopLocationOriginParamsDateRange = "7dControl"
- RadarAttackLayer3TopLocationOriginParamsDateRange14dControl RadarAttackLayer3TopLocationOriginParamsDateRange = "14dControl"
- RadarAttackLayer3TopLocationOriginParamsDateRange28dControl RadarAttackLayer3TopLocationOriginParamsDateRange = "28dControl"
- RadarAttackLayer3TopLocationOriginParamsDateRange12wControl RadarAttackLayer3TopLocationOriginParamsDateRange = "12wControl"
- RadarAttackLayer3TopLocationOriginParamsDateRange24wControl RadarAttackLayer3TopLocationOriginParamsDateRange = "24wControl"
-)
-
-// Format results are returned in.
-type RadarAttackLayer3TopLocationOriginParamsFormat string
-
-const (
- RadarAttackLayer3TopLocationOriginParamsFormatJson RadarAttackLayer3TopLocationOriginParamsFormat = "JSON"
- RadarAttackLayer3TopLocationOriginParamsFormatCsv RadarAttackLayer3TopLocationOriginParamsFormat = "CSV"
-)
-
-type RadarAttackLayer3TopLocationOriginParamsIPVersion string
-
-const (
- RadarAttackLayer3TopLocationOriginParamsIPVersionIPv4 RadarAttackLayer3TopLocationOriginParamsIPVersion = "IPv4"
- RadarAttackLayer3TopLocationOriginParamsIPVersionIPv6 RadarAttackLayer3TopLocationOriginParamsIPVersion = "IPv6"
-)
-
-type RadarAttackLayer3TopLocationOriginParamsProtocol string
-
-const (
- RadarAttackLayer3TopLocationOriginParamsProtocolUdp RadarAttackLayer3TopLocationOriginParamsProtocol = "UDP"
- RadarAttackLayer3TopLocationOriginParamsProtocolTcp RadarAttackLayer3TopLocationOriginParamsProtocol = "TCP"
- RadarAttackLayer3TopLocationOriginParamsProtocolIcmp RadarAttackLayer3TopLocationOriginParamsProtocol = "ICMP"
- RadarAttackLayer3TopLocationOriginParamsProtocolGRE RadarAttackLayer3TopLocationOriginParamsProtocol = "GRE"
-)
-
-type RadarAttackLayer3TopLocationOriginResponseEnvelope struct {
- Result RadarAttackLayer3TopLocationOriginResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarAttackLayer3TopLocationOriginResponseEnvelopeJSON `json:"-"`
-}
-
-// radarAttackLayer3TopLocationOriginResponseEnvelopeJSON contains the JSON
-// metadata for the struct [RadarAttackLayer3TopLocationOriginResponseEnvelope]
-type radarAttackLayer3TopLocationOriginResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3TopLocationOriginResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3TopLocationOriginResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarAttackLayer3TopLocationTargetParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Format results are returned in.
- Format param.Field[RadarAttackLayer3TopLocationTargetParamsFormat] `query:"format"`
- // Filter for ip version.
- IPVersion param.Field[[]RadarAttackLayer3TopLocationTargetParamsIPVersion] `query:"ipVersion"`
- // 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"`
- // Array of L3/4 attack types.
- Protocol param.Field[[]RadarAttackLayer3TopLocationTargetParamsProtocol] `query:"protocol"`
-}
-
-// URLQuery serializes [RadarAttackLayer3TopLocationTargetParams]'s query
-// parameters as `url.Values`.
-func (r RadarAttackLayer3TopLocationTargetParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type RadarAttackLayer3TopLocationTargetParamsDateRange string
-
-const (
- RadarAttackLayer3TopLocationTargetParamsDateRange1d RadarAttackLayer3TopLocationTargetParamsDateRange = "1d"
- RadarAttackLayer3TopLocationTargetParamsDateRange2d RadarAttackLayer3TopLocationTargetParamsDateRange = "2d"
- RadarAttackLayer3TopLocationTargetParamsDateRange7d RadarAttackLayer3TopLocationTargetParamsDateRange = "7d"
- RadarAttackLayer3TopLocationTargetParamsDateRange14d RadarAttackLayer3TopLocationTargetParamsDateRange = "14d"
- RadarAttackLayer3TopLocationTargetParamsDateRange28d RadarAttackLayer3TopLocationTargetParamsDateRange = "28d"
- RadarAttackLayer3TopLocationTargetParamsDateRange12w RadarAttackLayer3TopLocationTargetParamsDateRange = "12w"
- RadarAttackLayer3TopLocationTargetParamsDateRange24w RadarAttackLayer3TopLocationTargetParamsDateRange = "24w"
- RadarAttackLayer3TopLocationTargetParamsDateRange52w RadarAttackLayer3TopLocationTargetParamsDateRange = "52w"
- RadarAttackLayer3TopLocationTargetParamsDateRange1dControl RadarAttackLayer3TopLocationTargetParamsDateRange = "1dControl"
- RadarAttackLayer3TopLocationTargetParamsDateRange2dControl RadarAttackLayer3TopLocationTargetParamsDateRange = "2dControl"
- RadarAttackLayer3TopLocationTargetParamsDateRange7dControl RadarAttackLayer3TopLocationTargetParamsDateRange = "7dControl"
- RadarAttackLayer3TopLocationTargetParamsDateRange14dControl RadarAttackLayer3TopLocationTargetParamsDateRange = "14dControl"
- RadarAttackLayer3TopLocationTargetParamsDateRange28dControl RadarAttackLayer3TopLocationTargetParamsDateRange = "28dControl"
- RadarAttackLayer3TopLocationTargetParamsDateRange12wControl RadarAttackLayer3TopLocationTargetParamsDateRange = "12wControl"
- RadarAttackLayer3TopLocationTargetParamsDateRange24wControl RadarAttackLayer3TopLocationTargetParamsDateRange = "24wControl"
-)
-
-// Format results are returned in.
-type RadarAttackLayer3TopLocationTargetParamsFormat string
-
-const (
- RadarAttackLayer3TopLocationTargetParamsFormatJson RadarAttackLayer3TopLocationTargetParamsFormat = "JSON"
- RadarAttackLayer3TopLocationTargetParamsFormatCsv RadarAttackLayer3TopLocationTargetParamsFormat = "CSV"
-)
-
-type RadarAttackLayer3TopLocationTargetParamsIPVersion string
-
-const (
- RadarAttackLayer3TopLocationTargetParamsIPVersionIPv4 RadarAttackLayer3TopLocationTargetParamsIPVersion = "IPv4"
- RadarAttackLayer3TopLocationTargetParamsIPVersionIPv6 RadarAttackLayer3TopLocationTargetParamsIPVersion = "IPv6"
-)
-
-type RadarAttackLayer3TopLocationTargetParamsProtocol string
-
-const (
- RadarAttackLayer3TopLocationTargetParamsProtocolUdp RadarAttackLayer3TopLocationTargetParamsProtocol = "UDP"
- RadarAttackLayer3TopLocationTargetParamsProtocolTcp RadarAttackLayer3TopLocationTargetParamsProtocol = "TCP"
- RadarAttackLayer3TopLocationTargetParamsProtocolIcmp RadarAttackLayer3TopLocationTargetParamsProtocol = "ICMP"
- RadarAttackLayer3TopLocationTargetParamsProtocolGRE RadarAttackLayer3TopLocationTargetParamsProtocol = "GRE"
-)
-
-type RadarAttackLayer3TopLocationTargetResponseEnvelope struct {
- Result RadarAttackLayer3TopLocationTargetResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarAttackLayer3TopLocationTargetResponseEnvelopeJSON `json:"-"`
-}
-
-// radarAttackLayer3TopLocationTargetResponseEnvelopeJSON contains the JSON
-// metadata for the struct [RadarAttackLayer3TopLocationTargetResponseEnvelope]
-type radarAttackLayer3TopLocationTargetResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer3TopLocationTargetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer3TopLocationTargetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
diff --git a/radarattacklayer3toplocation_test.go b/radarattacklayer3toplocation_test.go
deleted file mode 100644
index 1279ed8147a..00000000000
--- a/radarattacklayer3toplocation_test.go
+++ /dev/null
@@ -1,85 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
- "time"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRadarAttackLayer3TopLocationOriginWithOptionalParams(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"),
- )
- _, 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()}),
- Format: cloudflare.F(cloudflare.RadarAttackLayer3TopLocationOriginParamsFormatJson),
- IPVersion: cloudflare.F([]cloudflare.RadarAttackLayer3TopLocationOriginParamsIPVersion{cloudflare.RadarAttackLayer3TopLocationOriginParamsIPVersionIPv4, cloudflare.RadarAttackLayer3TopLocationOriginParamsIPVersionIPv6}),
- Limit: cloudflare.F(int64(5)),
- Location: cloudflare.F([]string{"string", "string", "string"}),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- Protocol: cloudflare.F([]cloudflare.RadarAttackLayer3TopLocationOriginParamsProtocol{cloudflare.RadarAttackLayer3TopLocationOriginParamsProtocolUdp, cloudflare.RadarAttackLayer3TopLocationOriginParamsProtocolTcp, cloudflare.RadarAttackLayer3TopLocationOriginParamsProtocolIcmp}),
- })
- 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())
- }
-}
-
-func TestRadarAttackLayer3TopLocationTargetWithOptionalParams(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"),
- )
- _, 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()}),
- Format: cloudflare.F(cloudflare.RadarAttackLayer3TopLocationTargetParamsFormatJson),
- IPVersion: cloudflare.F([]cloudflare.RadarAttackLayer3TopLocationTargetParamsIPVersion{cloudflare.RadarAttackLayer3TopLocationTargetParamsIPVersionIPv4, cloudflare.RadarAttackLayer3TopLocationTargetParamsIPVersionIPv6}),
- Limit: cloudflare.F(int64(5)),
- Location: cloudflare.F([]string{"string", "string", "string"}),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- Protocol: cloudflare.F([]cloudflare.RadarAttackLayer3TopLocationTargetParamsProtocol{cloudflare.RadarAttackLayer3TopLocationTargetParamsProtocolUdp, cloudflare.RadarAttackLayer3TopLocationTargetParamsProtocolTcp, cloudflare.RadarAttackLayer3TopLocationTargetParamsProtocolIcmp}),
- })
- 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/radarattacklayer7.go b/radarattacklayer7.go
deleted file mode 100644
index b5f8f13bd90..00000000000
--- a/radarattacklayer7.go
+++ /dev/null
@@ -1,338 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarAttackLayer7Service contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewRadarAttackLayer7Service] method
-// instead.
-type RadarAttackLayer7Service struct {
- Options []option.RequestOption
- Summary *RadarAttackLayer7SummaryService
- TimeseriesGroups *RadarAttackLayer7TimeseriesGroupService
- Top *RadarAttackLayer7TopService
-}
-
-// NewRadarAttackLayer7Service generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewRadarAttackLayer7Service(opts ...option.RequestOption) (r *RadarAttackLayer7Service) {
- r = &RadarAttackLayer7Service{}
- r.Options = opts
- r.Summary = NewRadarAttackLayer7SummaryService(opts...)
- r.TimeseriesGroups = NewRadarAttackLayer7TimeseriesGroupService(opts...)
- r.Top = NewRadarAttackLayer7TopService(opts...)
- return
-}
-
-// Get a timeseries of Layer 7 attacks. Values represent HTTP requests and are
-// normalized using min-max by default.
-func (r *RadarAttackLayer7Service) Timeseries(ctx context.Context, query RadarAttackLayer7TimeseriesParams, opts ...option.RequestOption) (res *RadarAttackLayer7TimeseriesResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarAttackLayer7TimeseriesResponseEnvelope
- path := "radar/attacks/layer7/timeseries"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type RadarAttackLayer7TimeseriesResponse struct {
- Meta RadarAttackLayer7TimeseriesResponseMeta `json:"meta,required"`
- Serie0 RadarAttackLayer7TimeseriesResponseSerie0 `json:"serie_0,required"`
- JSON radarAttackLayer7TimeseriesResponseJSON `json:"-"`
-}
-
-// radarAttackLayer7TimeseriesResponseJSON contains the JSON metadata for the
-// struct [RadarAttackLayer7TimeseriesResponse]
-type radarAttackLayer7TimeseriesResponseJSON struct {
- Meta apijson.Field
- Serie0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7TimeseriesResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TimeseriesResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7TimeseriesResponseMeta struct {
- AggInterval string `json:"aggInterval,required"`
- DateRange []RadarAttackLayer7TimeseriesResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated time.Time `json:"lastUpdated,required" format:"date-time"`
- ConfidenceInfo RadarAttackLayer7TimeseriesResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarAttackLayer7TimeseriesResponseMetaJSON `json:"-"`
-}
-
-// radarAttackLayer7TimeseriesResponseMetaJSON contains the JSON metadata for the
-// struct [RadarAttackLayer7TimeseriesResponseMeta]
-type radarAttackLayer7TimeseriesResponseMetaJSON struct {
- AggInterval apijson.Field
- DateRange apijson.Field
- LastUpdated apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7TimeseriesResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TimeseriesResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7TimeseriesResponseMetaDateRange 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 radarAttackLayer7TimeseriesResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarAttackLayer7TimeseriesResponseMetaDateRangeJSON contains the JSON metadata
-// for the struct [RadarAttackLayer7TimeseriesResponseMetaDateRange]
-type radarAttackLayer7TimeseriesResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7TimeseriesResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TimeseriesResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7TimeseriesResponseMetaConfidenceInfo struct {
- Annotations []RadarAttackLayer7TimeseriesResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarAttackLayer7TimeseriesResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarAttackLayer7TimeseriesResponseMetaConfidenceInfoJSON contains the JSON
-// metadata for the struct [RadarAttackLayer7TimeseriesResponseMetaConfidenceInfo]
-type radarAttackLayer7TimeseriesResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7TimeseriesResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TimeseriesResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7TimeseriesResponseMetaConfidenceInfoAnnotation 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 radarAttackLayer7TimeseriesResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarAttackLayer7TimeseriesResponseMetaConfidenceInfoAnnotationJSON contains the
-// JSON metadata for the struct
-// [RadarAttackLayer7TimeseriesResponseMetaConfidenceInfoAnnotation]
-type radarAttackLayer7TimeseriesResponseMetaConfidenceInfoAnnotationJSON 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 *RadarAttackLayer7TimeseriesResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TimeseriesResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7TimeseriesResponseSerie0 struct {
- Timestamps []time.Time `json:"timestamps,required" format:"date-time"`
- Values []string `json:"values,required"`
- JSON radarAttackLayer7TimeseriesResponseSerie0JSON `json:"-"`
-}
-
-// radarAttackLayer7TimeseriesResponseSerie0JSON contains the JSON metadata for the
-// struct [RadarAttackLayer7TimeseriesResponseSerie0]
-type radarAttackLayer7TimeseriesResponseSerie0JSON struct {
- Timestamps apijson.Field
- Values apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7TimeseriesResponseSerie0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TimeseriesResponseSerie0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7TimeseriesParams struct {
- // Aggregation interval results should be returned in (for example, in 15 minutes
- // or 1 hour intervals). Refer to
- // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
- AggInterval param.Field[RadarAttackLayer7TimeseriesParamsAggInterval] `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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarAttackLayer7TimeseriesParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Format results are returned in.
- Format param.Field[RadarAttackLayer7TimeseriesParamsFormat] `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"`
- // Normalization method applied. Refer to
- // [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/).
- Normalization param.Field[RadarAttackLayer7TimeseriesParamsNormalization] `query:"normalization"`
-}
-
-// URLQuery serializes [RadarAttackLayer7TimeseriesParams]'s query parameters as
-// `url.Values`.
-func (r RadarAttackLayer7TimeseriesParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Aggregation interval results should be returned in (for example, in 15 minutes
-// or 1 hour intervals). Refer to
-// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
-type RadarAttackLayer7TimeseriesParamsAggInterval string
-
-const (
- RadarAttackLayer7TimeseriesParamsAggInterval15m RadarAttackLayer7TimeseriesParamsAggInterval = "15m"
- RadarAttackLayer7TimeseriesParamsAggInterval1h RadarAttackLayer7TimeseriesParamsAggInterval = "1h"
- RadarAttackLayer7TimeseriesParamsAggInterval1d RadarAttackLayer7TimeseriesParamsAggInterval = "1d"
- RadarAttackLayer7TimeseriesParamsAggInterval1w RadarAttackLayer7TimeseriesParamsAggInterval = "1w"
-)
-
-type RadarAttackLayer7TimeseriesParamsAttack string
-
-const (
- RadarAttackLayer7TimeseriesParamsAttackDDOS RadarAttackLayer7TimeseriesParamsAttack = "DDOS"
- RadarAttackLayer7TimeseriesParamsAttackWAF RadarAttackLayer7TimeseriesParamsAttack = "WAF"
- RadarAttackLayer7TimeseriesParamsAttackBotManagement RadarAttackLayer7TimeseriesParamsAttack = "BOT_MANAGEMENT"
- RadarAttackLayer7TimeseriesParamsAttackAccessRules RadarAttackLayer7TimeseriesParamsAttack = "ACCESS_RULES"
- RadarAttackLayer7TimeseriesParamsAttackIPReputation RadarAttackLayer7TimeseriesParamsAttack = "IP_REPUTATION"
- RadarAttackLayer7TimeseriesParamsAttackAPIShield RadarAttackLayer7TimeseriesParamsAttack = "API_SHIELD"
- RadarAttackLayer7TimeseriesParamsAttackDataLossPrevention RadarAttackLayer7TimeseriesParamsAttack = "DATA_LOSS_PREVENTION"
-)
-
-type RadarAttackLayer7TimeseriesParamsDateRange string
-
-const (
- RadarAttackLayer7TimeseriesParamsDateRange1d RadarAttackLayer7TimeseriesParamsDateRange = "1d"
- RadarAttackLayer7TimeseriesParamsDateRange2d RadarAttackLayer7TimeseriesParamsDateRange = "2d"
- RadarAttackLayer7TimeseriesParamsDateRange7d RadarAttackLayer7TimeseriesParamsDateRange = "7d"
- RadarAttackLayer7TimeseriesParamsDateRange14d RadarAttackLayer7TimeseriesParamsDateRange = "14d"
- RadarAttackLayer7TimeseriesParamsDateRange28d RadarAttackLayer7TimeseriesParamsDateRange = "28d"
- RadarAttackLayer7TimeseriesParamsDateRange12w RadarAttackLayer7TimeseriesParamsDateRange = "12w"
- RadarAttackLayer7TimeseriesParamsDateRange24w RadarAttackLayer7TimeseriesParamsDateRange = "24w"
- RadarAttackLayer7TimeseriesParamsDateRange52w RadarAttackLayer7TimeseriesParamsDateRange = "52w"
- RadarAttackLayer7TimeseriesParamsDateRange1dControl RadarAttackLayer7TimeseriesParamsDateRange = "1dControl"
- RadarAttackLayer7TimeseriesParamsDateRange2dControl RadarAttackLayer7TimeseriesParamsDateRange = "2dControl"
- RadarAttackLayer7TimeseriesParamsDateRange7dControl RadarAttackLayer7TimeseriesParamsDateRange = "7dControl"
- RadarAttackLayer7TimeseriesParamsDateRange14dControl RadarAttackLayer7TimeseriesParamsDateRange = "14dControl"
- RadarAttackLayer7TimeseriesParamsDateRange28dControl RadarAttackLayer7TimeseriesParamsDateRange = "28dControl"
- RadarAttackLayer7TimeseriesParamsDateRange12wControl RadarAttackLayer7TimeseriesParamsDateRange = "12wControl"
- RadarAttackLayer7TimeseriesParamsDateRange24wControl RadarAttackLayer7TimeseriesParamsDateRange = "24wControl"
-)
-
-// Format results are returned in.
-type RadarAttackLayer7TimeseriesParamsFormat string
-
-const (
- RadarAttackLayer7TimeseriesParamsFormatJson RadarAttackLayer7TimeseriesParamsFormat = "JSON"
- RadarAttackLayer7TimeseriesParamsFormatCsv RadarAttackLayer7TimeseriesParamsFormat = "CSV"
-)
-
-// Normalization method applied. Refer to
-// [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/).
-type RadarAttackLayer7TimeseriesParamsNormalization string
-
-const (
- RadarAttackLayer7TimeseriesParamsNormalizationPercentageChange RadarAttackLayer7TimeseriesParamsNormalization = "PERCENTAGE_CHANGE"
- RadarAttackLayer7TimeseriesParamsNormalizationMin0Max RadarAttackLayer7TimeseriesParamsNormalization = "MIN0_MAX"
-)
-
-type RadarAttackLayer7TimeseriesResponseEnvelope struct {
- Result RadarAttackLayer7TimeseriesResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarAttackLayer7TimeseriesResponseEnvelopeJSON `json:"-"`
-}
-
-// radarAttackLayer7TimeseriesResponseEnvelopeJSON contains the JSON metadata for
-// the struct [RadarAttackLayer7TimeseriesResponseEnvelope]
-type radarAttackLayer7TimeseriesResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7TimeseriesResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TimeseriesResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
diff --git a/radarattacklayer7_test.go b/radarattacklayer7_test.go
deleted file mode 100644
index 48487f8459c..00000000000
--- a/radarattacklayer7_test.go
+++ /dev/null
@@ -1,51 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
- "time"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRadarAttackLayer7TimeseriesWithOptionalParams(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"),
- )
- _, err := client.Radar.Attacks.Layer7.Timeseries(context.TODO(), cloudflare.RadarAttackLayer7TimeseriesParams{
- 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()}),
- Format: cloudflare.F(cloudflare.RadarAttackLayer7TimeseriesParamsFormatJson),
- Location: cloudflare.F([]string{"string", "string", "string"}),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- Normalization: cloudflare.F(cloudflare.RadarAttackLayer7TimeseriesParamsNormalizationMin0Max),
- })
- 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/radarattacklayer7summary.go b/radarattacklayer7summary.go
deleted file mode 100644
index 6b5a2c07c5f..00000000000
--- a/radarattacklayer7summary.go
+++ /dev/null
@@ -1,1927 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarAttackLayer7SummaryService contains methods and other services that help
-// with interacting with the cloudflare API. Note, unlike clients, this service
-// does not read variables from the environment automatically. You should not
-// instantiate this service directly, and instead use the
-// [NewRadarAttackLayer7SummaryService] method instead.
-type RadarAttackLayer7SummaryService struct {
- Options []option.RequestOption
-}
-
-// NewRadarAttackLayer7SummaryService generates a new service that applies the
-// given options to each request. These options are applied after the parent
-// client's options (if there is one), and before any request-specific options.
-func NewRadarAttackLayer7SummaryService(opts ...option.RequestOption) (r *RadarAttackLayer7SummaryService) {
- r = &RadarAttackLayer7SummaryService{}
- r.Options = opts
- return
-}
-
-// Percentage distribution of mitigation techniques in Layer 7 attacks.
-func (r *RadarAttackLayer7SummaryService) Get(ctx context.Context, query RadarAttackLayer7SummaryGetParams, opts ...option.RequestOption) (res *RadarAttackLayer7SummaryGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarAttackLayer7SummaryGetResponseEnvelope
- path := "radar/attacks/layer7/summary"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Percentage distribution of attacks by http method used.
-func (r *RadarAttackLayer7SummaryService) HTTPMethod(ctx context.Context, query RadarAttackLayer7SummaryHTTPMethodParams, opts ...option.RequestOption) (res *RadarAttackLayer7SummaryHTTPMethodResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarAttackLayer7SummaryHTTPMethodResponseEnvelope
- path := "radar/attacks/layer7/summary/http_method"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Percentage distribution of attacks by http version used.
-func (r *RadarAttackLayer7SummaryService) HTTPVersion(ctx context.Context, query RadarAttackLayer7SummaryHTTPVersionParams, opts ...option.RequestOption) (res *RadarAttackLayer7SummaryHTTPVersionResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarAttackLayer7SummaryHTTPVersionResponseEnvelope
- path := "radar/attacks/layer7/summary/http_version"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Percentage distribution of attacks by ip version used.
-func (r *RadarAttackLayer7SummaryService) IPVersion(ctx context.Context, query RadarAttackLayer7SummaryIPVersionParams, opts ...option.RequestOption) (res *RadarAttackLayer7SummaryIPVersionResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarAttackLayer7SummaryIPVersionResponseEnvelope
- path := "radar/attacks/layer7/summary/ip_version"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Percentage distribution of attacks by managed rules used.
-func (r *RadarAttackLayer7SummaryService) ManagedRules(ctx context.Context, query RadarAttackLayer7SummaryManagedRulesParams, opts ...option.RequestOption) (res *RadarAttackLayer7SummaryManagedRulesResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarAttackLayer7SummaryManagedRulesResponseEnvelope
- path := "radar/attacks/layer7/summary/managed_rules"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Percentage distribution of attacks by mitigation product used.
-func (r *RadarAttackLayer7SummaryService) MitigationProduct(ctx context.Context, query RadarAttackLayer7SummaryMitigationProductParams, opts ...option.RequestOption) (res *RadarAttackLayer7SummaryMitigationProductResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarAttackLayer7SummaryMitigationProductResponseEnvelope
- path := "radar/attacks/layer7/summary/mitigation_product"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type RadarAttackLayer7SummaryGetResponse struct {
- Meta RadarAttackLayer7SummaryGetResponseMeta `json:"meta,required"`
- Summary0 RadarAttackLayer7SummaryGetResponseSummary0 `json:"summary_0,required"`
- JSON radarAttackLayer7SummaryGetResponseJSON `json:"-"`
-}
-
-// radarAttackLayer7SummaryGetResponseJSON contains the JSON metadata for the
-// struct [RadarAttackLayer7SummaryGetResponse]
-type radarAttackLayer7SummaryGetResponseJSON struct {
- Meta apijson.Field
- Summary0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7SummaryGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7SummaryGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7SummaryGetResponseMeta struct {
- DateRange []RadarAttackLayer7SummaryGetResponseMetaDateRange `json:"dateRange,required"`
- ConfidenceInfo RadarAttackLayer7SummaryGetResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarAttackLayer7SummaryGetResponseMetaJSON `json:"-"`
-}
-
-// radarAttackLayer7SummaryGetResponseMetaJSON contains the JSON metadata for the
-// struct [RadarAttackLayer7SummaryGetResponseMeta]
-type radarAttackLayer7SummaryGetResponseMetaJSON struct {
- DateRange apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7SummaryGetResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7SummaryGetResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7SummaryGetResponseMetaDateRange 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 radarAttackLayer7SummaryGetResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarAttackLayer7SummaryGetResponseMetaDateRangeJSON contains the JSON metadata
-// for the struct [RadarAttackLayer7SummaryGetResponseMetaDateRange]
-type radarAttackLayer7SummaryGetResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7SummaryGetResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7SummaryGetResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7SummaryGetResponseMetaConfidenceInfo struct {
- Annotations []RadarAttackLayer7SummaryGetResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarAttackLayer7SummaryGetResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarAttackLayer7SummaryGetResponseMetaConfidenceInfoJSON contains the JSON
-// metadata for the struct [RadarAttackLayer7SummaryGetResponseMetaConfidenceInfo]
-type radarAttackLayer7SummaryGetResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7SummaryGetResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7SummaryGetResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7SummaryGetResponseMetaConfidenceInfoAnnotation 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 radarAttackLayer7SummaryGetResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarAttackLayer7SummaryGetResponseMetaConfidenceInfoAnnotationJSON contains the
-// JSON metadata for the struct
-// [RadarAttackLayer7SummaryGetResponseMetaConfidenceInfoAnnotation]
-type radarAttackLayer7SummaryGetResponseMetaConfidenceInfoAnnotationJSON 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 *RadarAttackLayer7SummaryGetResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7SummaryGetResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7SummaryGetResponseSummary0 struct {
- AccessRules string `json:"ACCESS_RULES,required"`
- APIShield string `json:"API_SHIELD,required"`
- BotManagement string `json:"BOT_MANAGEMENT,required"`
- DataLossPrevention string `json:"DATA_LOSS_PREVENTION,required"`
- DDOS string `json:"DDOS,required"`
- IPReputation string `json:"IP_REPUTATION,required"`
- WAF string `json:"WAF,required"`
- JSON radarAttackLayer7SummaryGetResponseSummary0JSON `json:"-"`
-}
-
-// radarAttackLayer7SummaryGetResponseSummary0JSON contains the JSON metadata for
-// the struct [RadarAttackLayer7SummaryGetResponseSummary0]
-type radarAttackLayer7SummaryGetResponseSummary0JSON struct {
- AccessRules apijson.Field
- APIShield apijson.Field
- BotManagement apijson.Field
- DataLossPrevention apijson.Field
- DDOS apijson.Field
- IPReputation apijson.Field
- WAF apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7SummaryGetResponseSummary0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7SummaryGetResponseSummary0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7SummaryHTTPMethodResponse struct {
- Meta RadarAttackLayer7SummaryHTTPMethodResponseMeta `json:"meta,required"`
- Summary0 RadarAttackLayer7SummaryHTTPMethodResponseSummary0 `json:"summary_0,required"`
- JSON radarAttackLayer7SummaryHTTPMethodResponseJSON `json:"-"`
-}
-
-// radarAttackLayer7SummaryHTTPMethodResponseJSON contains the JSON metadata for
-// the struct [RadarAttackLayer7SummaryHTTPMethodResponse]
-type radarAttackLayer7SummaryHTTPMethodResponseJSON struct {
- Meta apijson.Field
- Summary0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7SummaryHTTPMethodResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7SummaryHTTPMethodResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7SummaryHTTPMethodResponseMeta struct {
- DateRange []RadarAttackLayer7SummaryHTTPMethodResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- Normalization string `json:"normalization,required"`
- ConfidenceInfo RadarAttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarAttackLayer7SummaryHTTPMethodResponseMetaJSON `json:"-"`
-}
-
-// radarAttackLayer7SummaryHTTPMethodResponseMetaJSON contains the JSON metadata
-// for the struct [RadarAttackLayer7SummaryHTTPMethodResponseMeta]
-type radarAttackLayer7SummaryHTTPMethodResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- Normalization apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7SummaryHTTPMethodResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7SummaryHTTPMethodResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7SummaryHTTPMethodResponseMetaDateRange 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 radarAttackLayer7SummaryHTTPMethodResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarAttackLayer7SummaryHTTPMethodResponseMetaDateRangeJSON contains the JSON
-// metadata for the struct
-// [RadarAttackLayer7SummaryHTTPMethodResponseMetaDateRange]
-type radarAttackLayer7SummaryHTTPMethodResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7SummaryHTTPMethodResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7SummaryHTTPMethodResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfo struct {
- Annotations []RadarAttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarAttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarAttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoJSON contains the
-// JSON metadata for the struct
-// [RadarAttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfo]
-type radarAttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotation 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 radarAttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarAttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotationJSON
-// contains the JSON metadata for the struct
-// [RadarAttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotation]
-type radarAttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotationJSON 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 *RadarAttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7SummaryHTTPMethodResponseSummary0 struct {
- Get string `json:"GET,required"`
- Post string `json:"POST,required"`
- JSON radarAttackLayer7SummaryHTTPMethodResponseSummary0JSON `json:"-"`
-}
-
-// radarAttackLayer7SummaryHTTPMethodResponseSummary0JSON contains the JSON
-// metadata for the struct [RadarAttackLayer7SummaryHTTPMethodResponseSummary0]
-type radarAttackLayer7SummaryHTTPMethodResponseSummary0JSON struct {
- Get apijson.Field
- Post apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7SummaryHTTPMethodResponseSummary0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7SummaryHTTPMethodResponseSummary0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7SummaryHTTPVersionResponse struct {
- Meta RadarAttackLayer7SummaryHTTPVersionResponseMeta `json:"meta,required"`
- Summary0 RadarAttackLayer7SummaryHTTPVersionResponseSummary0 `json:"summary_0,required"`
- JSON radarAttackLayer7SummaryHTTPVersionResponseJSON `json:"-"`
-}
-
-// radarAttackLayer7SummaryHTTPVersionResponseJSON contains the JSON metadata for
-// the struct [RadarAttackLayer7SummaryHTTPVersionResponse]
-type radarAttackLayer7SummaryHTTPVersionResponseJSON struct {
- Meta apijson.Field
- Summary0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7SummaryHTTPVersionResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7SummaryHTTPVersionResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7SummaryHTTPVersionResponseMeta struct {
- DateRange []RadarAttackLayer7SummaryHTTPVersionResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- Normalization string `json:"normalization,required"`
- ConfidenceInfo RadarAttackLayer7SummaryHTTPVersionResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarAttackLayer7SummaryHTTPVersionResponseMetaJSON `json:"-"`
-}
-
-// radarAttackLayer7SummaryHTTPVersionResponseMetaJSON contains the JSON metadata
-// for the struct [RadarAttackLayer7SummaryHTTPVersionResponseMeta]
-type radarAttackLayer7SummaryHTTPVersionResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- Normalization apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7SummaryHTTPVersionResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7SummaryHTTPVersionResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7SummaryHTTPVersionResponseMetaDateRange 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 radarAttackLayer7SummaryHTTPVersionResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarAttackLayer7SummaryHTTPVersionResponseMetaDateRangeJSON contains the JSON
-// metadata for the struct
-// [RadarAttackLayer7SummaryHTTPVersionResponseMetaDateRange]
-type radarAttackLayer7SummaryHTTPVersionResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7SummaryHTTPVersionResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7SummaryHTTPVersionResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7SummaryHTTPVersionResponseMetaConfidenceInfo struct {
- Annotations []RadarAttackLayer7SummaryHTTPVersionResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarAttackLayer7SummaryHTTPVersionResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarAttackLayer7SummaryHTTPVersionResponseMetaConfidenceInfoJSON contains the
-// JSON metadata for the struct
-// [RadarAttackLayer7SummaryHTTPVersionResponseMetaConfidenceInfo]
-type radarAttackLayer7SummaryHTTPVersionResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7SummaryHTTPVersionResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7SummaryHTTPVersionResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7SummaryHTTPVersionResponseMetaConfidenceInfoAnnotation 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 radarAttackLayer7SummaryHTTPVersionResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarAttackLayer7SummaryHTTPVersionResponseMetaConfidenceInfoAnnotationJSON
-// contains the JSON metadata for the struct
-// [RadarAttackLayer7SummaryHTTPVersionResponseMetaConfidenceInfoAnnotation]
-type radarAttackLayer7SummaryHTTPVersionResponseMetaConfidenceInfoAnnotationJSON 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 *RadarAttackLayer7SummaryHTTPVersionResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7SummaryHTTPVersionResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7SummaryHTTPVersionResponseSummary0 struct {
- HTTP1X string `json:"HTTP/1.x,required"`
- HTTP2 string `json:"HTTP/2,required"`
- HTTP3 string `json:"HTTP/3,required"`
- JSON radarAttackLayer7SummaryHTTPVersionResponseSummary0JSON `json:"-"`
-}
-
-// radarAttackLayer7SummaryHTTPVersionResponseSummary0JSON contains the JSON
-// metadata for the struct [RadarAttackLayer7SummaryHTTPVersionResponseSummary0]
-type radarAttackLayer7SummaryHTTPVersionResponseSummary0JSON struct {
- HTTP1X apijson.Field
- HTTP2 apijson.Field
- HTTP3 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7SummaryHTTPVersionResponseSummary0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7SummaryHTTPVersionResponseSummary0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7SummaryIPVersionResponse struct {
- Meta RadarAttackLayer7SummaryIPVersionResponseMeta `json:"meta,required"`
- Summary0 RadarAttackLayer7SummaryIPVersionResponseSummary0 `json:"summary_0,required"`
- JSON radarAttackLayer7SummaryIPVersionResponseJSON `json:"-"`
-}
-
-// radarAttackLayer7SummaryIPVersionResponseJSON contains the JSON metadata for the
-// struct [RadarAttackLayer7SummaryIPVersionResponse]
-type radarAttackLayer7SummaryIPVersionResponseJSON struct {
- Meta apijson.Field
- Summary0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7SummaryIPVersionResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7SummaryIPVersionResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7SummaryIPVersionResponseMeta struct {
- DateRange []RadarAttackLayer7SummaryIPVersionResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- Normalization string `json:"normalization,required"`
- ConfidenceInfo RadarAttackLayer7SummaryIPVersionResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarAttackLayer7SummaryIPVersionResponseMetaJSON `json:"-"`
-}
-
-// radarAttackLayer7SummaryIPVersionResponseMetaJSON contains the JSON metadata for
-// the struct [RadarAttackLayer7SummaryIPVersionResponseMeta]
-type radarAttackLayer7SummaryIPVersionResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- Normalization apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7SummaryIPVersionResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7SummaryIPVersionResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7SummaryIPVersionResponseMetaDateRange 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 radarAttackLayer7SummaryIPVersionResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarAttackLayer7SummaryIPVersionResponseMetaDateRangeJSON contains the JSON
-// metadata for the struct [RadarAttackLayer7SummaryIPVersionResponseMetaDateRange]
-type radarAttackLayer7SummaryIPVersionResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7SummaryIPVersionResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7SummaryIPVersionResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7SummaryIPVersionResponseMetaConfidenceInfo struct {
- Annotations []RadarAttackLayer7SummaryIPVersionResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarAttackLayer7SummaryIPVersionResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarAttackLayer7SummaryIPVersionResponseMetaConfidenceInfoJSON contains the
-// JSON metadata for the struct
-// [RadarAttackLayer7SummaryIPVersionResponseMetaConfidenceInfo]
-type radarAttackLayer7SummaryIPVersionResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7SummaryIPVersionResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7SummaryIPVersionResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7SummaryIPVersionResponseMetaConfidenceInfoAnnotation 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 radarAttackLayer7SummaryIPVersionResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarAttackLayer7SummaryIPVersionResponseMetaConfidenceInfoAnnotationJSON
-// contains the JSON metadata for the struct
-// [RadarAttackLayer7SummaryIPVersionResponseMetaConfidenceInfoAnnotation]
-type radarAttackLayer7SummaryIPVersionResponseMetaConfidenceInfoAnnotationJSON 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 *RadarAttackLayer7SummaryIPVersionResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7SummaryIPVersionResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7SummaryIPVersionResponseSummary0 struct {
- IPv4 string `json:"IPv4,required"`
- IPv6 string `json:"IPv6,required"`
- JSON radarAttackLayer7SummaryIPVersionResponseSummary0JSON `json:"-"`
-}
-
-// radarAttackLayer7SummaryIPVersionResponseSummary0JSON contains the JSON metadata
-// for the struct [RadarAttackLayer7SummaryIPVersionResponseSummary0]
-type radarAttackLayer7SummaryIPVersionResponseSummary0JSON struct {
- IPv4 apijson.Field
- IPv6 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7SummaryIPVersionResponseSummary0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7SummaryIPVersionResponseSummary0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7SummaryManagedRulesResponse struct {
- Meta RadarAttackLayer7SummaryManagedRulesResponseMeta `json:"meta,required"`
- Summary0 RadarAttackLayer7SummaryManagedRulesResponseSummary0 `json:"summary_0,required"`
- JSON radarAttackLayer7SummaryManagedRulesResponseJSON `json:"-"`
-}
-
-// radarAttackLayer7SummaryManagedRulesResponseJSON contains the JSON metadata for
-// the struct [RadarAttackLayer7SummaryManagedRulesResponse]
-type radarAttackLayer7SummaryManagedRulesResponseJSON struct {
- Meta apijson.Field
- Summary0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7SummaryManagedRulesResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7SummaryManagedRulesResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7SummaryManagedRulesResponseMeta struct {
- DateRange []RadarAttackLayer7SummaryManagedRulesResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- Normalization string `json:"normalization,required"`
- ConfidenceInfo RadarAttackLayer7SummaryManagedRulesResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarAttackLayer7SummaryManagedRulesResponseMetaJSON `json:"-"`
-}
-
-// radarAttackLayer7SummaryManagedRulesResponseMetaJSON contains the JSON metadata
-// for the struct [RadarAttackLayer7SummaryManagedRulesResponseMeta]
-type radarAttackLayer7SummaryManagedRulesResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- Normalization apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7SummaryManagedRulesResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7SummaryManagedRulesResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7SummaryManagedRulesResponseMetaDateRange 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 radarAttackLayer7SummaryManagedRulesResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarAttackLayer7SummaryManagedRulesResponseMetaDateRangeJSON contains the JSON
-// metadata for the struct
-// [RadarAttackLayer7SummaryManagedRulesResponseMetaDateRange]
-type radarAttackLayer7SummaryManagedRulesResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7SummaryManagedRulesResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7SummaryManagedRulesResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7SummaryManagedRulesResponseMetaConfidenceInfo struct {
- Annotations []RadarAttackLayer7SummaryManagedRulesResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarAttackLayer7SummaryManagedRulesResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarAttackLayer7SummaryManagedRulesResponseMetaConfidenceInfoJSON contains the
-// JSON metadata for the struct
-// [RadarAttackLayer7SummaryManagedRulesResponseMetaConfidenceInfo]
-type radarAttackLayer7SummaryManagedRulesResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7SummaryManagedRulesResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7SummaryManagedRulesResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7SummaryManagedRulesResponseMetaConfidenceInfoAnnotation 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 radarAttackLayer7SummaryManagedRulesResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarAttackLayer7SummaryManagedRulesResponseMetaConfidenceInfoAnnotationJSON
-// contains the JSON metadata for the struct
-// [RadarAttackLayer7SummaryManagedRulesResponseMetaConfidenceInfoAnnotation]
-type radarAttackLayer7SummaryManagedRulesResponseMetaConfidenceInfoAnnotationJSON 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 *RadarAttackLayer7SummaryManagedRulesResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7SummaryManagedRulesResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7SummaryManagedRulesResponseSummary0 struct {
- Bot string `json:"Bot,required"`
- HTTPAnomaly string `json:"HTTP Anomaly,required"`
- JSON radarAttackLayer7SummaryManagedRulesResponseSummary0JSON `json:"-"`
-}
-
-// radarAttackLayer7SummaryManagedRulesResponseSummary0JSON contains the JSON
-// metadata for the struct [RadarAttackLayer7SummaryManagedRulesResponseSummary0]
-type radarAttackLayer7SummaryManagedRulesResponseSummary0JSON struct {
- Bot apijson.Field
- HTTPAnomaly apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7SummaryManagedRulesResponseSummary0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7SummaryManagedRulesResponseSummary0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7SummaryMitigationProductResponse struct {
- Meta RadarAttackLayer7SummaryMitigationProductResponseMeta `json:"meta,required"`
- Summary0 RadarAttackLayer7SummaryMitigationProductResponseSummary0 `json:"summary_0,required"`
- JSON radarAttackLayer7SummaryMitigationProductResponseJSON `json:"-"`
-}
-
-// radarAttackLayer7SummaryMitigationProductResponseJSON contains the JSON metadata
-// for the struct [RadarAttackLayer7SummaryMitigationProductResponse]
-type radarAttackLayer7SummaryMitigationProductResponseJSON struct {
- Meta apijson.Field
- Summary0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7SummaryMitigationProductResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7SummaryMitigationProductResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7SummaryMitigationProductResponseMeta struct {
- DateRange []RadarAttackLayer7SummaryMitigationProductResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- Normalization string `json:"normalization,required"`
- ConfidenceInfo RadarAttackLayer7SummaryMitigationProductResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarAttackLayer7SummaryMitigationProductResponseMetaJSON `json:"-"`
-}
-
-// radarAttackLayer7SummaryMitigationProductResponseMetaJSON contains the JSON
-// metadata for the struct [RadarAttackLayer7SummaryMitigationProductResponseMeta]
-type radarAttackLayer7SummaryMitigationProductResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- Normalization apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7SummaryMitigationProductResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7SummaryMitigationProductResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7SummaryMitigationProductResponseMetaDateRange 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 radarAttackLayer7SummaryMitigationProductResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarAttackLayer7SummaryMitigationProductResponseMetaDateRangeJSON contains the
-// JSON metadata for the struct
-// [RadarAttackLayer7SummaryMitigationProductResponseMetaDateRange]
-type radarAttackLayer7SummaryMitigationProductResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7SummaryMitigationProductResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7SummaryMitigationProductResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7SummaryMitigationProductResponseMetaConfidenceInfo struct {
- Annotations []RadarAttackLayer7SummaryMitigationProductResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarAttackLayer7SummaryMitigationProductResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarAttackLayer7SummaryMitigationProductResponseMetaConfidenceInfoJSON contains
-// the JSON metadata for the struct
-// [RadarAttackLayer7SummaryMitigationProductResponseMetaConfidenceInfo]
-type radarAttackLayer7SummaryMitigationProductResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7SummaryMitigationProductResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7SummaryMitigationProductResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7SummaryMitigationProductResponseMetaConfidenceInfoAnnotation 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 radarAttackLayer7SummaryMitigationProductResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarAttackLayer7SummaryMitigationProductResponseMetaConfidenceInfoAnnotationJSON
-// contains the JSON metadata for the struct
-// [RadarAttackLayer7SummaryMitigationProductResponseMetaConfidenceInfoAnnotation]
-type radarAttackLayer7SummaryMitigationProductResponseMetaConfidenceInfoAnnotationJSON 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 *RadarAttackLayer7SummaryMitigationProductResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7SummaryMitigationProductResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7SummaryMitigationProductResponseSummary0 struct {
- DDOS string `json:"DDOS,required"`
- WAF string `json:"WAF,required"`
- JSON radarAttackLayer7SummaryMitigationProductResponseSummary0JSON `json:"-"`
-}
-
-// radarAttackLayer7SummaryMitigationProductResponseSummary0JSON contains the JSON
-// metadata for the struct
-// [RadarAttackLayer7SummaryMitigationProductResponseSummary0]
-type radarAttackLayer7SummaryMitigationProductResponseSummary0JSON struct {
- DDOS apijson.Field
- WAF apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7SummaryMitigationProductResponseSummary0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7SummaryMitigationProductResponseSummary0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7SummaryGetParams 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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarAttackLayer7SummaryGetParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Format results are returned in.
- Format param.Field[RadarAttackLayer7SummaryGetParamsFormat] `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"`
-}
-
-// URLQuery serializes [RadarAttackLayer7SummaryGetParams]'s query parameters as
-// `url.Values`.
-func (r RadarAttackLayer7SummaryGetParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type RadarAttackLayer7SummaryGetParamsDateRange string
-
-const (
- RadarAttackLayer7SummaryGetParamsDateRange1d RadarAttackLayer7SummaryGetParamsDateRange = "1d"
- RadarAttackLayer7SummaryGetParamsDateRange2d RadarAttackLayer7SummaryGetParamsDateRange = "2d"
- RadarAttackLayer7SummaryGetParamsDateRange7d RadarAttackLayer7SummaryGetParamsDateRange = "7d"
- RadarAttackLayer7SummaryGetParamsDateRange14d RadarAttackLayer7SummaryGetParamsDateRange = "14d"
- RadarAttackLayer7SummaryGetParamsDateRange28d RadarAttackLayer7SummaryGetParamsDateRange = "28d"
- RadarAttackLayer7SummaryGetParamsDateRange12w RadarAttackLayer7SummaryGetParamsDateRange = "12w"
- RadarAttackLayer7SummaryGetParamsDateRange24w RadarAttackLayer7SummaryGetParamsDateRange = "24w"
- RadarAttackLayer7SummaryGetParamsDateRange52w RadarAttackLayer7SummaryGetParamsDateRange = "52w"
- RadarAttackLayer7SummaryGetParamsDateRange1dControl RadarAttackLayer7SummaryGetParamsDateRange = "1dControl"
- RadarAttackLayer7SummaryGetParamsDateRange2dControl RadarAttackLayer7SummaryGetParamsDateRange = "2dControl"
- RadarAttackLayer7SummaryGetParamsDateRange7dControl RadarAttackLayer7SummaryGetParamsDateRange = "7dControl"
- RadarAttackLayer7SummaryGetParamsDateRange14dControl RadarAttackLayer7SummaryGetParamsDateRange = "14dControl"
- RadarAttackLayer7SummaryGetParamsDateRange28dControl RadarAttackLayer7SummaryGetParamsDateRange = "28dControl"
- RadarAttackLayer7SummaryGetParamsDateRange12wControl RadarAttackLayer7SummaryGetParamsDateRange = "12wControl"
- RadarAttackLayer7SummaryGetParamsDateRange24wControl RadarAttackLayer7SummaryGetParamsDateRange = "24wControl"
-)
-
-// Format results are returned in.
-type RadarAttackLayer7SummaryGetParamsFormat string
-
-const (
- RadarAttackLayer7SummaryGetParamsFormatJson RadarAttackLayer7SummaryGetParamsFormat = "JSON"
- RadarAttackLayer7SummaryGetParamsFormatCsv RadarAttackLayer7SummaryGetParamsFormat = "CSV"
-)
-
-type RadarAttackLayer7SummaryGetResponseEnvelope struct {
- Result RadarAttackLayer7SummaryGetResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarAttackLayer7SummaryGetResponseEnvelopeJSON `json:"-"`
-}
-
-// radarAttackLayer7SummaryGetResponseEnvelopeJSON contains the JSON metadata for
-// the struct [RadarAttackLayer7SummaryGetResponseEnvelope]
-type radarAttackLayer7SummaryGetResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7SummaryGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7SummaryGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7SummaryHTTPMethodParams 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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarAttackLayer7SummaryHTTPMethodParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Format results are returned in.
- Format param.Field[RadarAttackLayer7SummaryHTTPMethodParamsFormat] `query:"format"`
- // Filter for http version.
- HTTPVersion param.Field[[]RadarAttackLayer7SummaryHTTPMethodParamsHTTPVersion] `query:"httpVersion"`
- // Filter for ip version.
- IPVersion param.Field[[]RadarAttackLayer7SummaryHTTPMethodParamsIPVersion] `query:"ipVersion"`
- // 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 L7 mitigation products.
- MitigationProduct param.Field[[]RadarAttackLayer7SummaryHTTPMethodParamsMitigationProduct] `query:"mitigationProduct"`
- // Array of names that will be used to name the series in responses.
- Name param.Field[[]string] `query:"name"`
-}
-
-// URLQuery serializes [RadarAttackLayer7SummaryHTTPMethodParams]'s query
-// parameters as `url.Values`.
-func (r RadarAttackLayer7SummaryHTTPMethodParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type RadarAttackLayer7SummaryHTTPMethodParamsDateRange string
-
-const (
- RadarAttackLayer7SummaryHTTPMethodParamsDateRange1d RadarAttackLayer7SummaryHTTPMethodParamsDateRange = "1d"
- RadarAttackLayer7SummaryHTTPMethodParamsDateRange2d RadarAttackLayer7SummaryHTTPMethodParamsDateRange = "2d"
- RadarAttackLayer7SummaryHTTPMethodParamsDateRange7d RadarAttackLayer7SummaryHTTPMethodParamsDateRange = "7d"
- RadarAttackLayer7SummaryHTTPMethodParamsDateRange14d RadarAttackLayer7SummaryHTTPMethodParamsDateRange = "14d"
- RadarAttackLayer7SummaryHTTPMethodParamsDateRange28d RadarAttackLayer7SummaryHTTPMethodParamsDateRange = "28d"
- RadarAttackLayer7SummaryHTTPMethodParamsDateRange12w RadarAttackLayer7SummaryHTTPMethodParamsDateRange = "12w"
- RadarAttackLayer7SummaryHTTPMethodParamsDateRange24w RadarAttackLayer7SummaryHTTPMethodParamsDateRange = "24w"
- RadarAttackLayer7SummaryHTTPMethodParamsDateRange52w RadarAttackLayer7SummaryHTTPMethodParamsDateRange = "52w"
- RadarAttackLayer7SummaryHTTPMethodParamsDateRange1dControl RadarAttackLayer7SummaryHTTPMethodParamsDateRange = "1dControl"
- RadarAttackLayer7SummaryHTTPMethodParamsDateRange2dControl RadarAttackLayer7SummaryHTTPMethodParamsDateRange = "2dControl"
- RadarAttackLayer7SummaryHTTPMethodParamsDateRange7dControl RadarAttackLayer7SummaryHTTPMethodParamsDateRange = "7dControl"
- RadarAttackLayer7SummaryHTTPMethodParamsDateRange14dControl RadarAttackLayer7SummaryHTTPMethodParamsDateRange = "14dControl"
- RadarAttackLayer7SummaryHTTPMethodParamsDateRange28dControl RadarAttackLayer7SummaryHTTPMethodParamsDateRange = "28dControl"
- RadarAttackLayer7SummaryHTTPMethodParamsDateRange12wControl RadarAttackLayer7SummaryHTTPMethodParamsDateRange = "12wControl"
- RadarAttackLayer7SummaryHTTPMethodParamsDateRange24wControl RadarAttackLayer7SummaryHTTPMethodParamsDateRange = "24wControl"
-)
-
-// Format results are returned in.
-type RadarAttackLayer7SummaryHTTPMethodParamsFormat string
-
-const (
- RadarAttackLayer7SummaryHTTPMethodParamsFormatJson RadarAttackLayer7SummaryHTTPMethodParamsFormat = "JSON"
- RadarAttackLayer7SummaryHTTPMethodParamsFormatCsv RadarAttackLayer7SummaryHTTPMethodParamsFormat = "CSV"
-)
-
-type RadarAttackLayer7SummaryHTTPMethodParamsHTTPVersion string
-
-const (
- RadarAttackLayer7SummaryHTTPMethodParamsHTTPVersionHttPv1 RadarAttackLayer7SummaryHTTPMethodParamsHTTPVersion = "HTTPv1"
- RadarAttackLayer7SummaryHTTPMethodParamsHTTPVersionHttPv2 RadarAttackLayer7SummaryHTTPMethodParamsHTTPVersion = "HTTPv2"
- RadarAttackLayer7SummaryHTTPMethodParamsHTTPVersionHttPv3 RadarAttackLayer7SummaryHTTPMethodParamsHTTPVersion = "HTTPv3"
-)
-
-type RadarAttackLayer7SummaryHTTPMethodParamsIPVersion string
-
-const (
- RadarAttackLayer7SummaryHTTPMethodParamsIPVersionIPv4 RadarAttackLayer7SummaryHTTPMethodParamsIPVersion = "IPv4"
- RadarAttackLayer7SummaryHTTPMethodParamsIPVersionIPv6 RadarAttackLayer7SummaryHTTPMethodParamsIPVersion = "IPv6"
-)
-
-type RadarAttackLayer7SummaryHTTPMethodParamsMitigationProduct string
-
-const (
- RadarAttackLayer7SummaryHTTPMethodParamsMitigationProductDDOS RadarAttackLayer7SummaryHTTPMethodParamsMitigationProduct = "DDOS"
- RadarAttackLayer7SummaryHTTPMethodParamsMitigationProductWAF RadarAttackLayer7SummaryHTTPMethodParamsMitigationProduct = "WAF"
- RadarAttackLayer7SummaryHTTPMethodParamsMitigationProductBotManagement RadarAttackLayer7SummaryHTTPMethodParamsMitigationProduct = "BOT_MANAGEMENT"
- RadarAttackLayer7SummaryHTTPMethodParamsMitigationProductAccessRules RadarAttackLayer7SummaryHTTPMethodParamsMitigationProduct = "ACCESS_RULES"
- RadarAttackLayer7SummaryHTTPMethodParamsMitigationProductIPReputation RadarAttackLayer7SummaryHTTPMethodParamsMitigationProduct = "IP_REPUTATION"
- RadarAttackLayer7SummaryHTTPMethodParamsMitigationProductAPIShield RadarAttackLayer7SummaryHTTPMethodParamsMitigationProduct = "API_SHIELD"
- RadarAttackLayer7SummaryHTTPMethodParamsMitigationProductDataLossPrevention RadarAttackLayer7SummaryHTTPMethodParamsMitigationProduct = "DATA_LOSS_PREVENTION"
-)
-
-type RadarAttackLayer7SummaryHTTPMethodResponseEnvelope struct {
- Result RadarAttackLayer7SummaryHTTPMethodResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarAttackLayer7SummaryHTTPMethodResponseEnvelopeJSON `json:"-"`
-}
-
-// radarAttackLayer7SummaryHTTPMethodResponseEnvelopeJSON contains the JSON
-// metadata for the struct [RadarAttackLayer7SummaryHTTPMethodResponseEnvelope]
-type radarAttackLayer7SummaryHTTPMethodResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7SummaryHTTPMethodResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7SummaryHTTPMethodResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7SummaryHTTPVersionParams 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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarAttackLayer7SummaryHTTPVersionParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Format results are returned in.
- Format param.Field[RadarAttackLayer7SummaryHTTPVersionParamsFormat] `query:"format"`
- // Filter for http method.
- HTTPMethod param.Field[[]RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethod] `query:"httpMethod"`
- // Filter for ip version.
- IPVersion param.Field[[]RadarAttackLayer7SummaryHTTPVersionParamsIPVersion] `query:"ipVersion"`
- // 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 L7 mitigation products.
- MitigationProduct param.Field[[]RadarAttackLayer7SummaryHTTPVersionParamsMitigationProduct] `query:"mitigationProduct"`
- // Array of names that will be used to name the series in responses.
- Name param.Field[[]string] `query:"name"`
-}
-
-// URLQuery serializes [RadarAttackLayer7SummaryHTTPVersionParams]'s query
-// parameters as `url.Values`.
-func (r RadarAttackLayer7SummaryHTTPVersionParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type RadarAttackLayer7SummaryHTTPVersionParamsDateRange string
-
-const (
- RadarAttackLayer7SummaryHTTPVersionParamsDateRange1d RadarAttackLayer7SummaryHTTPVersionParamsDateRange = "1d"
- RadarAttackLayer7SummaryHTTPVersionParamsDateRange2d RadarAttackLayer7SummaryHTTPVersionParamsDateRange = "2d"
- RadarAttackLayer7SummaryHTTPVersionParamsDateRange7d RadarAttackLayer7SummaryHTTPVersionParamsDateRange = "7d"
- RadarAttackLayer7SummaryHTTPVersionParamsDateRange14d RadarAttackLayer7SummaryHTTPVersionParamsDateRange = "14d"
- RadarAttackLayer7SummaryHTTPVersionParamsDateRange28d RadarAttackLayer7SummaryHTTPVersionParamsDateRange = "28d"
- RadarAttackLayer7SummaryHTTPVersionParamsDateRange12w RadarAttackLayer7SummaryHTTPVersionParamsDateRange = "12w"
- RadarAttackLayer7SummaryHTTPVersionParamsDateRange24w RadarAttackLayer7SummaryHTTPVersionParamsDateRange = "24w"
- RadarAttackLayer7SummaryHTTPVersionParamsDateRange52w RadarAttackLayer7SummaryHTTPVersionParamsDateRange = "52w"
- RadarAttackLayer7SummaryHTTPVersionParamsDateRange1dControl RadarAttackLayer7SummaryHTTPVersionParamsDateRange = "1dControl"
- RadarAttackLayer7SummaryHTTPVersionParamsDateRange2dControl RadarAttackLayer7SummaryHTTPVersionParamsDateRange = "2dControl"
- RadarAttackLayer7SummaryHTTPVersionParamsDateRange7dControl RadarAttackLayer7SummaryHTTPVersionParamsDateRange = "7dControl"
- RadarAttackLayer7SummaryHTTPVersionParamsDateRange14dControl RadarAttackLayer7SummaryHTTPVersionParamsDateRange = "14dControl"
- RadarAttackLayer7SummaryHTTPVersionParamsDateRange28dControl RadarAttackLayer7SummaryHTTPVersionParamsDateRange = "28dControl"
- RadarAttackLayer7SummaryHTTPVersionParamsDateRange12wControl RadarAttackLayer7SummaryHTTPVersionParamsDateRange = "12wControl"
- RadarAttackLayer7SummaryHTTPVersionParamsDateRange24wControl RadarAttackLayer7SummaryHTTPVersionParamsDateRange = "24wControl"
-)
-
-// Format results are returned in.
-type RadarAttackLayer7SummaryHTTPVersionParamsFormat string
-
-const (
- RadarAttackLayer7SummaryHTTPVersionParamsFormatJson RadarAttackLayer7SummaryHTTPVersionParamsFormat = "JSON"
- RadarAttackLayer7SummaryHTTPVersionParamsFormatCsv RadarAttackLayer7SummaryHTTPVersionParamsFormat = "CSV"
-)
-
-type RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethod string
-
-const (
- RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethodGet RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethod = "GET"
- RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethodPost RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethod = "POST"
- RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethodDelete RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethod = "DELETE"
- RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethodPut RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethod = "PUT"
- RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethodHead RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethod = "HEAD"
- RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethodPurge RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethod = "PURGE"
- RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethodOptions RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethod = "OPTIONS"
- RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethodPropfind RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethod = "PROPFIND"
- RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethodMkcol RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethod = "MKCOL"
- RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethodPatch RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethod = "PATCH"
- RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethodACL RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethod = "ACL"
- RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethodBcopy RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethod = "BCOPY"
- RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethodBdelete RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethod = "BDELETE"
- RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethodBmove RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethod = "BMOVE"
- RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethodBpropfind RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethod = "BPROPFIND"
- RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethodBproppatch RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethod = "BPROPPATCH"
- RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethodCheckin RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethod = "CHECKIN"
- RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethodCheckout RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethod = "CHECKOUT"
- RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethodConnect RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethod = "CONNECT"
- RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethodCopy RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethod = "COPY"
- RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethodLabel RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethod = "LABEL"
- RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethodLock RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethod = "LOCK"
- RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethodMerge RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethod = "MERGE"
- RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethodMkactivity RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethod = "MKACTIVITY"
- RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethodMkworkspace RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethod = "MKWORKSPACE"
- RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethodMove RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethod = "MOVE"
- RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethodNotify RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethod = "NOTIFY"
- RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethodOrderpatch RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethod = "ORDERPATCH"
- RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethodPoll RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethod = "POLL"
- RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethodProppatch RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethod = "PROPPATCH"
- RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethodReport RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethod = "REPORT"
- RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethodSearch RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethod = "SEARCH"
- RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethodSubscribe RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethod = "SUBSCRIBE"
- RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethodTrace RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethod = "TRACE"
- RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethodUncheckout RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethod = "UNCHECKOUT"
- RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethodUnlock RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethod = "UNLOCK"
- RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethodUnsubscribe RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethod = "UNSUBSCRIBE"
- RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethodUpdate RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethod = "UPDATE"
- RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethodVersioncontrol RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethod = "VERSIONCONTROL"
- RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethodBaselinecontrol RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethod = "BASELINECONTROL"
- RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethodXmsenumatts RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethod = "XMSENUMATTS"
- RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethodRpcOutData RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethod = "RPC_OUT_DATA"
- RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethodRpcInData RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethod = "RPC_IN_DATA"
- RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethodJson RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethod = "JSON"
- RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethodCook RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethod = "COOK"
- RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethodTrack RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethod = "TRACK"
-)
-
-type RadarAttackLayer7SummaryHTTPVersionParamsIPVersion string
-
-const (
- RadarAttackLayer7SummaryHTTPVersionParamsIPVersionIPv4 RadarAttackLayer7SummaryHTTPVersionParamsIPVersion = "IPv4"
- RadarAttackLayer7SummaryHTTPVersionParamsIPVersionIPv6 RadarAttackLayer7SummaryHTTPVersionParamsIPVersion = "IPv6"
-)
-
-type RadarAttackLayer7SummaryHTTPVersionParamsMitigationProduct string
-
-const (
- RadarAttackLayer7SummaryHTTPVersionParamsMitigationProductDDOS RadarAttackLayer7SummaryHTTPVersionParamsMitigationProduct = "DDOS"
- RadarAttackLayer7SummaryHTTPVersionParamsMitigationProductWAF RadarAttackLayer7SummaryHTTPVersionParamsMitigationProduct = "WAF"
- RadarAttackLayer7SummaryHTTPVersionParamsMitigationProductBotManagement RadarAttackLayer7SummaryHTTPVersionParamsMitigationProduct = "BOT_MANAGEMENT"
- RadarAttackLayer7SummaryHTTPVersionParamsMitigationProductAccessRules RadarAttackLayer7SummaryHTTPVersionParamsMitigationProduct = "ACCESS_RULES"
- RadarAttackLayer7SummaryHTTPVersionParamsMitigationProductIPReputation RadarAttackLayer7SummaryHTTPVersionParamsMitigationProduct = "IP_REPUTATION"
- RadarAttackLayer7SummaryHTTPVersionParamsMitigationProductAPIShield RadarAttackLayer7SummaryHTTPVersionParamsMitigationProduct = "API_SHIELD"
- RadarAttackLayer7SummaryHTTPVersionParamsMitigationProductDataLossPrevention RadarAttackLayer7SummaryHTTPVersionParamsMitigationProduct = "DATA_LOSS_PREVENTION"
-)
-
-type RadarAttackLayer7SummaryHTTPVersionResponseEnvelope struct {
- Result RadarAttackLayer7SummaryHTTPVersionResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarAttackLayer7SummaryHTTPVersionResponseEnvelopeJSON `json:"-"`
-}
-
-// radarAttackLayer7SummaryHTTPVersionResponseEnvelopeJSON contains the JSON
-// metadata for the struct [RadarAttackLayer7SummaryHTTPVersionResponseEnvelope]
-type radarAttackLayer7SummaryHTTPVersionResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7SummaryHTTPVersionResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7SummaryHTTPVersionResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7SummaryIPVersionParams 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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarAttackLayer7SummaryIPVersionParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Format results are returned in.
- Format param.Field[RadarAttackLayer7SummaryIPVersionParamsFormat] `query:"format"`
- // Filter for http method.
- HTTPMethod param.Field[[]RadarAttackLayer7SummaryIPVersionParamsHTTPMethod] `query:"httpMethod"`
- // Filter for http version.
- HTTPVersion param.Field[[]RadarAttackLayer7SummaryIPVersionParamsHTTPVersion] `query:"httpVersion"`
- // 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 L7 mitigation products.
- MitigationProduct param.Field[[]RadarAttackLayer7SummaryIPVersionParamsMitigationProduct] `query:"mitigationProduct"`
- // Array of names that will be used to name the series in responses.
- Name param.Field[[]string] `query:"name"`
-}
-
-// URLQuery serializes [RadarAttackLayer7SummaryIPVersionParams]'s query parameters
-// as `url.Values`.
-func (r RadarAttackLayer7SummaryIPVersionParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type RadarAttackLayer7SummaryIPVersionParamsDateRange string
-
-const (
- RadarAttackLayer7SummaryIPVersionParamsDateRange1d RadarAttackLayer7SummaryIPVersionParamsDateRange = "1d"
- RadarAttackLayer7SummaryIPVersionParamsDateRange2d RadarAttackLayer7SummaryIPVersionParamsDateRange = "2d"
- RadarAttackLayer7SummaryIPVersionParamsDateRange7d RadarAttackLayer7SummaryIPVersionParamsDateRange = "7d"
- RadarAttackLayer7SummaryIPVersionParamsDateRange14d RadarAttackLayer7SummaryIPVersionParamsDateRange = "14d"
- RadarAttackLayer7SummaryIPVersionParamsDateRange28d RadarAttackLayer7SummaryIPVersionParamsDateRange = "28d"
- RadarAttackLayer7SummaryIPVersionParamsDateRange12w RadarAttackLayer7SummaryIPVersionParamsDateRange = "12w"
- RadarAttackLayer7SummaryIPVersionParamsDateRange24w RadarAttackLayer7SummaryIPVersionParamsDateRange = "24w"
- RadarAttackLayer7SummaryIPVersionParamsDateRange52w RadarAttackLayer7SummaryIPVersionParamsDateRange = "52w"
- RadarAttackLayer7SummaryIPVersionParamsDateRange1dControl RadarAttackLayer7SummaryIPVersionParamsDateRange = "1dControl"
- RadarAttackLayer7SummaryIPVersionParamsDateRange2dControl RadarAttackLayer7SummaryIPVersionParamsDateRange = "2dControl"
- RadarAttackLayer7SummaryIPVersionParamsDateRange7dControl RadarAttackLayer7SummaryIPVersionParamsDateRange = "7dControl"
- RadarAttackLayer7SummaryIPVersionParamsDateRange14dControl RadarAttackLayer7SummaryIPVersionParamsDateRange = "14dControl"
- RadarAttackLayer7SummaryIPVersionParamsDateRange28dControl RadarAttackLayer7SummaryIPVersionParamsDateRange = "28dControl"
- RadarAttackLayer7SummaryIPVersionParamsDateRange12wControl RadarAttackLayer7SummaryIPVersionParamsDateRange = "12wControl"
- RadarAttackLayer7SummaryIPVersionParamsDateRange24wControl RadarAttackLayer7SummaryIPVersionParamsDateRange = "24wControl"
-)
-
-// Format results are returned in.
-type RadarAttackLayer7SummaryIPVersionParamsFormat string
-
-const (
- RadarAttackLayer7SummaryIPVersionParamsFormatJson RadarAttackLayer7SummaryIPVersionParamsFormat = "JSON"
- RadarAttackLayer7SummaryIPVersionParamsFormatCsv RadarAttackLayer7SummaryIPVersionParamsFormat = "CSV"
-)
-
-type RadarAttackLayer7SummaryIPVersionParamsHTTPMethod string
-
-const (
- RadarAttackLayer7SummaryIPVersionParamsHTTPMethodGet RadarAttackLayer7SummaryIPVersionParamsHTTPMethod = "GET"
- RadarAttackLayer7SummaryIPVersionParamsHTTPMethodPost RadarAttackLayer7SummaryIPVersionParamsHTTPMethod = "POST"
- RadarAttackLayer7SummaryIPVersionParamsHTTPMethodDelete RadarAttackLayer7SummaryIPVersionParamsHTTPMethod = "DELETE"
- RadarAttackLayer7SummaryIPVersionParamsHTTPMethodPut RadarAttackLayer7SummaryIPVersionParamsHTTPMethod = "PUT"
- RadarAttackLayer7SummaryIPVersionParamsHTTPMethodHead RadarAttackLayer7SummaryIPVersionParamsHTTPMethod = "HEAD"
- RadarAttackLayer7SummaryIPVersionParamsHTTPMethodPurge RadarAttackLayer7SummaryIPVersionParamsHTTPMethod = "PURGE"
- RadarAttackLayer7SummaryIPVersionParamsHTTPMethodOptions RadarAttackLayer7SummaryIPVersionParamsHTTPMethod = "OPTIONS"
- RadarAttackLayer7SummaryIPVersionParamsHTTPMethodPropfind RadarAttackLayer7SummaryIPVersionParamsHTTPMethod = "PROPFIND"
- RadarAttackLayer7SummaryIPVersionParamsHTTPMethodMkcol RadarAttackLayer7SummaryIPVersionParamsHTTPMethod = "MKCOL"
- RadarAttackLayer7SummaryIPVersionParamsHTTPMethodPatch RadarAttackLayer7SummaryIPVersionParamsHTTPMethod = "PATCH"
- RadarAttackLayer7SummaryIPVersionParamsHTTPMethodACL RadarAttackLayer7SummaryIPVersionParamsHTTPMethod = "ACL"
- RadarAttackLayer7SummaryIPVersionParamsHTTPMethodBcopy RadarAttackLayer7SummaryIPVersionParamsHTTPMethod = "BCOPY"
- RadarAttackLayer7SummaryIPVersionParamsHTTPMethodBdelete RadarAttackLayer7SummaryIPVersionParamsHTTPMethod = "BDELETE"
- RadarAttackLayer7SummaryIPVersionParamsHTTPMethodBmove RadarAttackLayer7SummaryIPVersionParamsHTTPMethod = "BMOVE"
- RadarAttackLayer7SummaryIPVersionParamsHTTPMethodBpropfind RadarAttackLayer7SummaryIPVersionParamsHTTPMethod = "BPROPFIND"
- RadarAttackLayer7SummaryIPVersionParamsHTTPMethodBproppatch RadarAttackLayer7SummaryIPVersionParamsHTTPMethod = "BPROPPATCH"
- RadarAttackLayer7SummaryIPVersionParamsHTTPMethodCheckin RadarAttackLayer7SummaryIPVersionParamsHTTPMethod = "CHECKIN"
- RadarAttackLayer7SummaryIPVersionParamsHTTPMethodCheckout RadarAttackLayer7SummaryIPVersionParamsHTTPMethod = "CHECKOUT"
- RadarAttackLayer7SummaryIPVersionParamsHTTPMethodConnect RadarAttackLayer7SummaryIPVersionParamsHTTPMethod = "CONNECT"
- RadarAttackLayer7SummaryIPVersionParamsHTTPMethodCopy RadarAttackLayer7SummaryIPVersionParamsHTTPMethod = "COPY"
- RadarAttackLayer7SummaryIPVersionParamsHTTPMethodLabel RadarAttackLayer7SummaryIPVersionParamsHTTPMethod = "LABEL"
- RadarAttackLayer7SummaryIPVersionParamsHTTPMethodLock RadarAttackLayer7SummaryIPVersionParamsHTTPMethod = "LOCK"
- RadarAttackLayer7SummaryIPVersionParamsHTTPMethodMerge RadarAttackLayer7SummaryIPVersionParamsHTTPMethod = "MERGE"
- RadarAttackLayer7SummaryIPVersionParamsHTTPMethodMkactivity RadarAttackLayer7SummaryIPVersionParamsHTTPMethod = "MKACTIVITY"
- RadarAttackLayer7SummaryIPVersionParamsHTTPMethodMkworkspace RadarAttackLayer7SummaryIPVersionParamsHTTPMethod = "MKWORKSPACE"
- RadarAttackLayer7SummaryIPVersionParamsHTTPMethodMove RadarAttackLayer7SummaryIPVersionParamsHTTPMethod = "MOVE"
- RadarAttackLayer7SummaryIPVersionParamsHTTPMethodNotify RadarAttackLayer7SummaryIPVersionParamsHTTPMethod = "NOTIFY"
- RadarAttackLayer7SummaryIPVersionParamsHTTPMethodOrderpatch RadarAttackLayer7SummaryIPVersionParamsHTTPMethod = "ORDERPATCH"
- RadarAttackLayer7SummaryIPVersionParamsHTTPMethodPoll RadarAttackLayer7SummaryIPVersionParamsHTTPMethod = "POLL"
- RadarAttackLayer7SummaryIPVersionParamsHTTPMethodProppatch RadarAttackLayer7SummaryIPVersionParamsHTTPMethod = "PROPPATCH"
- RadarAttackLayer7SummaryIPVersionParamsHTTPMethodReport RadarAttackLayer7SummaryIPVersionParamsHTTPMethod = "REPORT"
- RadarAttackLayer7SummaryIPVersionParamsHTTPMethodSearch RadarAttackLayer7SummaryIPVersionParamsHTTPMethod = "SEARCH"
- RadarAttackLayer7SummaryIPVersionParamsHTTPMethodSubscribe RadarAttackLayer7SummaryIPVersionParamsHTTPMethod = "SUBSCRIBE"
- RadarAttackLayer7SummaryIPVersionParamsHTTPMethodTrace RadarAttackLayer7SummaryIPVersionParamsHTTPMethod = "TRACE"
- RadarAttackLayer7SummaryIPVersionParamsHTTPMethodUncheckout RadarAttackLayer7SummaryIPVersionParamsHTTPMethod = "UNCHECKOUT"
- RadarAttackLayer7SummaryIPVersionParamsHTTPMethodUnlock RadarAttackLayer7SummaryIPVersionParamsHTTPMethod = "UNLOCK"
- RadarAttackLayer7SummaryIPVersionParamsHTTPMethodUnsubscribe RadarAttackLayer7SummaryIPVersionParamsHTTPMethod = "UNSUBSCRIBE"
- RadarAttackLayer7SummaryIPVersionParamsHTTPMethodUpdate RadarAttackLayer7SummaryIPVersionParamsHTTPMethod = "UPDATE"
- RadarAttackLayer7SummaryIPVersionParamsHTTPMethodVersioncontrol RadarAttackLayer7SummaryIPVersionParamsHTTPMethod = "VERSIONCONTROL"
- RadarAttackLayer7SummaryIPVersionParamsHTTPMethodBaselinecontrol RadarAttackLayer7SummaryIPVersionParamsHTTPMethod = "BASELINECONTROL"
- RadarAttackLayer7SummaryIPVersionParamsHTTPMethodXmsenumatts RadarAttackLayer7SummaryIPVersionParamsHTTPMethod = "XMSENUMATTS"
- RadarAttackLayer7SummaryIPVersionParamsHTTPMethodRpcOutData RadarAttackLayer7SummaryIPVersionParamsHTTPMethod = "RPC_OUT_DATA"
- RadarAttackLayer7SummaryIPVersionParamsHTTPMethodRpcInData RadarAttackLayer7SummaryIPVersionParamsHTTPMethod = "RPC_IN_DATA"
- RadarAttackLayer7SummaryIPVersionParamsHTTPMethodJson RadarAttackLayer7SummaryIPVersionParamsHTTPMethod = "JSON"
- RadarAttackLayer7SummaryIPVersionParamsHTTPMethodCook RadarAttackLayer7SummaryIPVersionParamsHTTPMethod = "COOK"
- RadarAttackLayer7SummaryIPVersionParamsHTTPMethodTrack RadarAttackLayer7SummaryIPVersionParamsHTTPMethod = "TRACK"
-)
-
-type RadarAttackLayer7SummaryIPVersionParamsHTTPVersion string
-
-const (
- RadarAttackLayer7SummaryIPVersionParamsHTTPVersionHttPv1 RadarAttackLayer7SummaryIPVersionParamsHTTPVersion = "HTTPv1"
- RadarAttackLayer7SummaryIPVersionParamsHTTPVersionHttPv2 RadarAttackLayer7SummaryIPVersionParamsHTTPVersion = "HTTPv2"
- RadarAttackLayer7SummaryIPVersionParamsHTTPVersionHttPv3 RadarAttackLayer7SummaryIPVersionParamsHTTPVersion = "HTTPv3"
-)
-
-type RadarAttackLayer7SummaryIPVersionParamsMitigationProduct string
-
-const (
- RadarAttackLayer7SummaryIPVersionParamsMitigationProductDDOS RadarAttackLayer7SummaryIPVersionParamsMitigationProduct = "DDOS"
- RadarAttackLayer7SummaryIPVersionParamsMitigationProductWAF RadarAttackLayer7SummaryIPVersionParamsMitigationProduct = "WAF"
- RadarAttackLayer7SummaryIPVersionParamsMitigationProductBotManagement RadarAttackLayer7SummaryIPVersionParamsMitigationProduct = "BOT_MANAGEMENT"
- RadarAttackLayer7SummaryIPVersionParamsMitigationProductAccessRules RadarAttackLayer7SummaryIPVersionParamsMitigationProduct = "ACCESS_RULES"
- RadarAttackLayer7SummaryIPVersionParamsMitigationProductIPReputation RadarAttackLayer7SummaryIPVersionParamsMitigationProduct = "IP_REPUTATION"
- RadarAttackLayer7SummaryIPVersionParamsMitigationProductAPIShield RadarAttackLayer7SummaryIPVersionParamsMitigationProduct = "API_SHIELD"
- RadarAttackLayer7SummaryIPVersionParamsMitigationProductDataLossPrevention RadarAttackLayer7SummaryIPVersionParamsMitigationProduct = "DATA_LOSS_PREVENTION"
-)
-
-type RadarAttackLayer7SummaryIPVersionResponseEnvelope struct {
- Result RadarAttackLayer7SummaryIPVersionResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarAttackLayer7SummaryIPVersionResponseEnvelopeJSON `json:"-"`
-}
-
-// radarAttackLayer7SummaryIPVersionResponseEnvelopeJSON contains the JSON metadata
-// for the struct [RadarAttackLayer7SummaryIPVersionResponseEnvelope]
-type radarAttackLayer7SummaryIPVersionResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7SummaryIPVersionResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7SummaryIPVersionResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7SummaryManagedRulesParams 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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarAttackLayer7SummaryManagedRulesParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Format results are returned in.
- Format param.Field[RadarAttackLayer7SummaryManagedRulesParamsFormat] `query:"format"`
- // Filter for http method.
- HTTPMethod param.Field[[]RadarAttackLayer7SummaryManagedRulesParamsHTTPMethod] `query:"httpMethod"`
- // Filter for http version.
- HTTPVersion param.Field[[]RadarAttackLayer7SummaryManagedRulesParamsHTTPVersion] `query:"httpVersion"`
- // Filter for ip version.
- IPVersion param.Field[[]RadarAttackLayer7SummaryManagedRulesParamsIPVersion] `query:"ipVersion"`
- // 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 L7 mitigation products.
- MitigationProduct param.Field[[]RadarAttackLayer7SummaryManagedRulesParamsMitigationProduct] `query:"mitigationProduct"`
- // Array of names that will be used to name the series in responses.
- Name param.Field[[]string] `query:"name"`
-}
-
-// URLQuery serializes [RadarAttackLayer7SummaryManagedRulesParams]'s query
-// parameters as `url.Values`.
-func (r RadarAttackLayer7SummaryManagedRulesParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type RadarAttackLayer7SummaryManagedRulesParamsDateRange string
-
-const (
- RadarAttackLayer7SummaryManagedRulesParamsDateRange1d RadarAttackLayer7SummaryManagedRulesParamsDateRange = "1d"
- RadarAttackLayer7SummaryManagedRulesParamsDateRange2d RadarAttackLayer7SummaryManagedRulesParamsDateRange = "2d"
- RadarAttackLayer7SummaryManagedRulesParamsDateRange7d RadarAttackLayer7SummaryManagedRulesParamsDateRange = "7d"
- RadarAttackLayer7SummaryManagedRulesParamsDateRange14d RadarAttackLayer7SummaryManagedRulesParamsDateRange = "14d"
- RadarAttackLayer7SummaryManagedRulesParamsDateRange28d RadarAttackLayer7SummaryManagedRulesParamsDateRange = "28d"
- RadarAttackLayer7SummaryManagedRulesParamsDateRange12w RadarAttackLayer7SummaryManagedRulesParamsDateRange = "12w"
- RadarAttackLayer7SummaryManagedRulesParamsDateRange24w RadarAttackLayer7SummaryManagedRulesParamsDateRange = "24w"
- RadarAttackLayer7SummaryManagedRulesParamsDateRange52w RadarAttackLayer7SummaryManagedRulesParamsDateRange = "52w"
- RadarAttackLayer7SummaryManagedRulesParamsDateRange1dControl RadarAttackLayer7SummaryManagedRulesParamsDateRange = "1dControl"
- RadarAttackLayer7SummaryManagedRulesParamsDateRange2dControl RadarAttackLayer7SummaryManagedRulesParamsDateRange = "2dControl"
- RadarAttackLayer7SummaryManagedRulesParamsDateRange7dControl RadarAttackLayer7SummaryManagedRulesParamsDateRange = "7dControl"
- RadarAttackLayer7SummaryManagedRulesParamsDateRange14dControl RadarAttackLayer7SummaryManagedRulesParamsDateRange = "14dControl"
- RadarAttackLayer7SummaryManagedRulesParamsDateRange28dControl RadarAttackLayer7SummaryManagedRulesParamsDateRange = "28dControl"
- RadarAttackLayer7SummaryManagedRulesParamsDateRange12wControl RadarAttackLayer7SummaryManagedRulesParamsDateRange = "12wControl"
- RadarAttackLayer7SummaryManagedRulesParamsDateRange24wControl RadarAttackLayer7SummaryManagedRulesParamsDateRange = "24wControl"
-)
-
-// Format results are returned in.
-type RadarAttackLayer7SummaryManagedRulesParamsFormat string
-
-const (
- RadarAttackLayer7SummaryManagedRulesParamsFormatJson RadarAttackLayer7SummaryManagedRulesParamsFormat = "JSON"
- RadarAttackLayer7SummaryManagedRulesParamsFormatCsv RadarAttackLayer7SummaryManagedRulesParamsFormat = "CSV"
-)
-
-type RadarAttackLayer7SummaryManagedRulesParamsHTTPMethod string
-
-const (
- RadarAttackLayer7SummaryManagedRulesParamsHTTPMethodGet RadarAttackLayer7SummaryManagedRulesParamsHTTPMethod = "GET"
- RadarAttackLayer7SummaryManagedRulesParamsHTTPMethodPost RadarAttackLayer7SummaryManagedRulesParamsHTTPMethod = "POST"
- RadarAttackLayer7SummaryManagedRulesParamsHTTPMethodDelete RadarAttackLayer7SummaryManagedRulesParamsHTTPMethod = "DELETE"
- RadarAttackLayer7SummaryManagedRulesParamsHTTPMethodPut RadarAttackLayer7SummaryManagedRulesParamsHTTPMethod = "PUT"
- RadarAttackLayer7SummaryManagedRulesParamsHTTPMethodHead RadarAttackLayer7SummaryManagedRulesParamsHTTPMethod = "HEAD"
- RadarAttackLayer7SummaryManagedRulesParamsHTTPMethodPurge RadarAttackLayer7SummaryManagedRulesParamsHTTPMethod = "PURGE"
- RadarAttackLayer7SummaryManagedRulesParamsHTTPMethodOptions RadarAttackLayer7SummaryManagedRulesParamsHTTPMethod = "OPTIONS"
- RadarAttackLayer7SummaryManagedRulesParamsHTTPMethodPropfind RadarAttackLayer7SummaryManagedRulesParamsHTTPMethod = "PROPFIND"
- RadarAttackLayer7SummaryManagedRulesParamsHTTPMethodMkcol RadarAttackLayer7SummaryManagedRulesParamsHTTPMethod = "MKCOL"
- RadarAttackLayer7SummaryManagedRulesParamsHTTPMethodPatch RadarAttackLayer7SummaryManagedRulesParamsHTTPMethod = "PATCH"
- RadarAttackLayer7SummaryManagedRulesParamsHTTPMethodACL RadarAttackLayer7SummaryManagedRulesParamsHTTPMethod = "ACL"
- RadarAttackLayer7SummaryManagedRulesParamsHTTPMethodBcopy RadarAttackLayer7SummaryManagedRulesParamsHTTPMethod = "BCOPY"
- RadarAttackLayer7SummaryManagedRulesParamsHTTPMethodBdelete RadarAttackLayer7SummaryManagedRulesParamsHTTPMethod = "BDELETE"
- RadarAttackLayer7SummaryManagedRulesParamsHTTPMethodBmove RadarAttackLayer7SummaryManagedRulesParamsHTTPMethod = "BMOVE"
- RadarAttackLayer7SummaryManagedRulesParamsHTTPMethodBpropfind RadarAttackLayer7SummaryManagedRulesParamsHTTPMethod = "BPROPFIND"
- RadarAttackLayer7SummaryManagedRulesParamsHTTPMethodBproppatch RadarAttackLayer7SummaryManagedRulesParamsHTTPMethod = "BPROPPATCH"
- RadarAttackLayer7SummaryManagedRulesParamsHTTPMethodCheckin RadarAttackLayer7SummaryManagedRulesParamsHTTPMethod = "CHECKIN"
- RadarAttackLayer7SummaryManagedRulesParamsHTTPMethodCheckout RadarAttackLayer7SummaryManagedRulesParamsHTTPMethod = "CHECKOUT"
- RadarAttackLayer7SummaryManagedRulesParamsHTTPMethodConnect RadarAttackLayer7SummaryManagedRulesParamsHTTPMethod = "CONNECT"
- RadarAttackLayer7SummaryManagedRulesParamsHTTPMethodCopy RadarAttackLayer7SummaryManagedRulesParamsHTTPMethod = "COPY"
- RadarAttackLayer7SummaryManagedRulesParamsHTTPMethodLabel RadarAttackLayer7SummaryManagedRulesParamsHTTPMethod = "LABEL"
- RadarAttackLayer7SummaryManagedRulesParamsHTTPMethodLock RadarAttackLayer7SummaryManagedRulesParamsHTTPMethod = "LOCK"
- RadarAttackLayer7SummaryManagedRulesParamsHTTPMethodMerge RadarAttackLayer7SummaryManagedRulesParamsHTTPMethod = "MERGE"
- RadarAttackLayer7SummaryManagedRulesParamsHTTPMethodMkactivity RadarAttackLayer7SummaryManagedRulesParamsHTTPMethod = "MKACTIVITY"
- RadarAttackLayer7SummaryManagedRulesParamsHTTPMethodMkworkspace RadarAttackLayer7SummaryManagedRulesParamsHTTPMethod = "MKWORKSPACE"
- RadarAttackLayer7SummaryManagedRulesParamsHTTPMethodMove RadarAttackLayer7SummaryManagedRulesParamsHTTPMethod = "MOVE"
- RadarAttackLayer7SummaryManagedRulesParamsHTTPMethodNotify RadarAttackLayer7SummaryManagedRulesParamsHTTPMethod = "NOTIFY"
- RadarAttackLayer7SummaryManagedRulesParamsHTTPMethodOrderpatch RadarAttackLayer7SummaryManagedRulesParamsHTTPMethod = "ORDERPATCH"
- RadarAttackLayer7SummaryManagedRulesParamsHTTPMethodPoll RadarAttackLayer7SummaryManagedRulesParamsHTTPMethod = "POLL"
- RadarAttackLayer7SummaryManagedRulesParamsHTTPMethodProppatch RadarAttackLayer7SummaryManagedRulesParamsHTTPMethod = "PROPPATCH"
- RadarAttackLayer7SummaryManagedRulesParamsHTTPMethodReport RadarAttackLayer7SummaryManagedRulesParamsHTTPMethod = "REPORT"
- RadarAttackLayer7SummaryManagedRulesParamsHTTPMethodSearch RadarAttackLayer7SummaryManagedRulesParamsHTTPMethod = "SEARCH"
- RadarAttackLayer7SummaryManagedRulesParamsHTTPMethodSubscribe RadarAttackLayer7SummaryManagedRulesParamsHTTPMethod = "SUBSCRIBE"
- RadarAttackLayer7SummaryManagedRulesParamsHTTPMethodTrace RadarAttackLayer7SummaryManagedRulesParamsHTTPMethod = "TRACE"
- RadarAttackLayer7SummaryManagedRulesParamsHTTPMethodUncheckout RadarAttackLayer7SummaryManagedRulesParamsHTTPMethod = "UNCHECKOUT"
- RadarAttackLayer7SummaryManagedRulesParamsHTTPMethodUnlock RadarAttackLayer7SummaryManagedRulesParamsHTTPMethod = "UNLOCK"
- RadarAttackLayer7SummaryManagedRulesParamsHTTPMethodUnsubscribe RadarAttackLayer7SummaryManagedRulesParamsHTTPMethod = "UNSUBSCRIBE"
- RadarAttackLayer7SummaryManagedRulesParamsHTTPMethodUpdate RadarAttackLayer7SummaryManagedRulesParamsHTTPMethod = "UPDATE"
- RadarAttackLayer7SummaryManagedRulesParamsHTTPMethodVersioncontrol RadarAttackLayer7SummaryManagedRulesParamsHTTPMethod = "VERSIONCONTROL"
- RadarAttackLayer7SummaryManagedRulesParamsHTTPMethodBaselinecontrol RadarAttackLayer7SummaryManagedRulesParamsHTTPMethod = "BASELINECONTROL"
- RadarAttackLayer7SummaryManagedRulesParamsHTTPMethodXmsenumatts RadarAttackLayer7SummaryManagedRulesParamsHTTPMethod = "XMSENUMATTS"
- RadarAttackLayer7SummaryManagedRulesParamsHTTPMethodRpcOutData RadarAttackLayer7SummaryManagedRulesParamsHTTPMethod = "RPC_OUT_DATA"
- RadarAttackLayer7SummaryManagedRulesParamsHTTPMethodRpcInData RadarAttackLayer7SummaryManagedRulesParamsHTTPMethod = "RPC_IN_DATA"
- RadarAttackLayer7SummaryManagedRulesParamsHTTPMethodJson RadarAttackLayer7SummaryManagedRulesParamsHTTPMethod = "JSON"
- RadarAttackLayer7SummaryManagedRulesParamsHTTPMethodCook RadarAttackLayer7SummaryManagedRulesParamsHTTPMethod = "COOK"
- RadarAttackLayer7SummaryManagedRulesParamsHTTPMethodTrack RadarAttackLayer7SummaryManagedRulesParamsHTTPMethod = "TRACK"
-)
-
-type RadarAttackLayer7SummaryManagedRulesParamsHTTPVersion string
-
-const (
- RadarAttackLayer7SummaryManagedRulesParamsHTTPVersionHttPv1 RadarAttackLayer7SummaryManagedRulesParamsHTTPVersion = "HTTPv1"
- RadarAttackLayer7SummaryManagedRulesParamsHTTPVersionHttPv2 RadarAttackLayer7SummaryManagedRulesParamsHTTPVersion = "HTTPv2"
- RadarAttackLayer7SummaryManagedRulesParamsHTTPVersionHttPv3 RadarAttackLayer7SummaryManagedRulesParamsHTTPVersion = "HTTPv3"
-)
-
-type RadarAttackLayer7SummaryManagedRulesParamsIPVersion string
-
-const (
- RadarAttackLayer7SummaryManagedRulesParamsIPVersionIPv4 RadarAttackLayer7SummaryManagedRulesParamsIPVersion = "IPv4"
- RadarAttackLayer7SummaryManagedRulesParamsIPVersionIPv6 RadarAttackLayer7SummaryManagedRulesParamsIPVersion = "IPv6"
-)
-
-type RadarAttackLayer7SummaryManagedRulesParamsMitigationProduct string
-
-const (
- RadarAttackLayer7SummaryManagedRulesParamsMitigationProductDDOS RadarAttackLayer7SummaryManagedRulesParamsMitigationProduct = "DDOS"
- RadarAttackLayer7SummaryManagedRulesParamsMitigationProductWAF RadarAttackLayer7SummaryManagedRulesParamsMitigationProduct = "WAF"
- RadarAttackLayer7SummaryManagedRulesParamsMitigationProductBotManagement RadarAttackLayer7SummaryManagedRulesParamsMitigationProduct = "BOT_MANAGEMENT"
- RadarAttackLayer7SummaryManagedRulesParamsMitigationProductAccessRules RadarAttackLayer7SummaryManagedRulesParamsMitigationProduct = "ACCESS_RULES"
- RadarAttackLayer7SummaryManagedRulesParamsMitigationProductIPReputation RadarAttackLayer7SummaryManagedRulesParamsMitigationProduct = "IP_REPUTATION"
- RadarAttackLayer7SummaryManagedRulesParamsMitigationProductAPIShield RadarAttackLayer7SummaryManagedRulesParamsMitigationProduct = "API_SHIELD"
- RadarAttackLayer7SummaryManagedRulesParamsMitigationProductDataLossPrevention RadarAttackLayer7SummaryManagedRulesParamsMitigationProduct = "DATA_LOSS_PREVENTION"
-)
-
-type RadarAttackLayer7SummaryManagedRulesResponseEnvelope struct {
- Result RadarAttackLayer7SummaryManagedRulesResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarAttackLayer7SummaryManagedRulesResponseEnvelopeJSON `json:"-"`
-}
-
-// radarAttackLayer7SummaryManagedRulesResponseEnvelopeJSON contains the JSON
-// metadata for the struct [RadarAttackLayer7SummaryManagedRulesResponseEnvelope]
-type radarAttackLayer7SummaryManagedRulesResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7SummaryManagedRulesResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7SummaryManagedRulesResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7SummaryMitigationProductParams 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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarAttackLayer7SummaryMitigationProductParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Format results are returned in.
- Format param.Field[RadarAttackLayer7SummaryMitigationProductParamsFormat] `query:"format"`
- // Filter for http method.
- HTTPMethod param.Field[[]RadarAttackLayer7SummaryMitigationProductParamsHTTPMethod] `query:"httpMethod"`
- // Filter for http version.
- HTTPVersion param.Field[[]RadarAttackLayer7SummaryMitigationProductParamsHTTPVersion] `query:"httpVersion"`
- // Filter for ip version.
- IPVersion param.Field[[]RadarAttackLayer7SummaryMitigationProductParamsIPVersion] `query:"ipVersion"`
- // 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 [RadarAttackLayer7SummaryMitigationProductParams]'s query
-// parameters as `url.Values`.
-func (r RadarAttackLayer7SummaryMitigationProductParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type RadarAttackLayer7SummaryMitigationProductParamsDateRange string
-
-const (
- RadarAttackLayer7SummaryMitigationProductParamsDateRange1d RadarAttackLayer7SummaryMitigationProductParamsDateRange = "1d"
- RadarAttackLayer7SummaryMitigationProductParamsDateRange2d RadarAttackLayer7SummaryMitigationProductParamsDateRange = "2d"
- RadarAttackLayer7SummaryMitigationProductParamsDateRange7d RadarAttackLayer7SummaryMitigationProductParamsDateRange = "7d"
- RadarAttackLayer7SummaryMitigationProductParamsDateRange14d RadarAttackLayer7SummaryMitigationProductParamsDateRange = "14d"
- RadarAttackLayer7SummaryMitigationProductParamsDateRange28d RadarAttackLayer7SummaryMitigationProductParamsDateRange = "28d"
- RadarAttackLayer7SummaryMitigationProductParamsDateRange12w RadarAttackLayer7SummaryMitigationProductParamsDateRange = "12w"
- RadarAttackLayer7SummaryMitigationProductParamsDateRange24w RadarAttackLayer7SummaryMitigationProductParamsDateRange = "24w"
- RadarAttackLayer7SummaryMitigationProductParamsDateRange52w RadarAttackLayer7SummaryMitigationProductParamsDateRange = "52w"
- RadarAttackLayer7SummaryMitigationProductParamsDateRange1dControl RadarAttackLayer7SummaryMitigationProductParamsDateRange = "1dControl"
- RadarAttackLayer7SummaryMitigationProductParamsDateRange2dControl RadarAttackLayer7SummaryMitigationProductParamsDateRange = "2dControl"
- RadarAttackLayer7SummaryMitigationProductParamsDateRange7dControl RadarAttackLayer7SummaryMitigationProductParamsDateRange = "7dControl"
- RadarAttackLayer7SummaryMitigationProductParamsDateRange14dControl RadarAttackLayer7SummaryMitigationProductParamsDateRange = "14dControl"
- RadarAttackLayer7SummaryMitigationProductParamsDateRange28dControl RadarAttackLayer7SummaryMitigationProductParamsDateRange = "28dControl"
- RadarAttackLayer7SummaryMitigationProductParamsDateRange12wControl RadarAttackLayer7SummaryMitigationProductParamsDateRange = "12wControl"
- RadarAttackLayer7SummaryMitigationProductParamsDateRange24wControl RadarAttackLayer7SummaryMitigationProductParamsDateRange = "24wControl"
-)
-
-// Format results are returned in.
-type RadarAttackLayer7SummaryMitigationProductParamsFormat string
-
-const (
- RadarAttackLayer7SummaryMitigationProductParamsFormatJson RadarAttackLayer7SummaryMitigationProductParamsFormat = "JSON"
- RadarAttackLayer7SummaryMitigationProductParamsFormatCsv RadarAttackLayer7SummaryMitigationProductParamsFormat = "CSV"
-)
-
-type RadarAttackLayer7SummaryMitigationProductParamsHTTPMethod string
-
-const (
- RadarAttackLayer7SummaryMitigationProductParamsHTTPMethodGet RadarAttackLayer7SummaryMitigationProductParamsHTTPMethod = "GET"
- RadarAttackLayer7SummaryMitigationProductParamsHTTPMethodPost RadarAttackLayer7SummaryMitigationProductParamsHTTPMethod = "POST"
- RadarAttackLayer7SummaryMitigationProductParamsHTTPMethodDelete RadarAttackLayer7SummaryMitigationProductParamsHTTPMethod = "DELETE"
- RadarAttackLayer7SummaryMitigationProductParamsHTTPMethodPut RadarAttackLayer7SummaryMitigationProductParamsHTTPMethod = "PUT"
- RadarAttackLayer7SummaryMitigationProductParamsHTTPMethodHead RadarAttackLayer7SummaryMitigationProductParamsHTTPMethod = "HEAD"
- RadarAttackLayer7SummaryMitigationProductParamsHTTPMethodPurge RadarAttackLayer7SummaryMitigationProductParamsHTTPMethod = "PURGE"
- RadarAttackLayer7SummaryMitigationProductParamsHTTPMethodOptions RadarAttackLayer7SummaryMitigationProductParamsHTTPMethod = "OPTIONS"
- RadarAttackLayer7SummaryMitigationProductParamsHTTPMethodPropfind RadarAttackLayer7SummaryMitigationProductParamsHTTPMethod = "PROPFIND"
- RadarAttackLayer7SummaryMitigationProductParamsHTTPMethodMkcol RadarAttackLayer7SummaryMitigationProductParamsHTTPMethod = "MKCOL"
- RadarAttackLayer7SummaryMitigationProductParamsHTTPMethodPatch RadarAttackLayer7SummaryMitigationProductParamsHTTPMethod = "PATCH"
- RadarAttackLayer7SummaryMitigationProductParamsHTTPMethodACL RadarAttackLayer7SummaryMitigationProductParamsHTTPMethod = "ACL"
- RadarAttackLayer7SummaryMitigationProductParamsHTTPMethodBcopy RadarAttackLayer7SummaryMitigationProductParamsHTTPMethod = "BCOPY"
- RadarAttackLayer7SummaryMitigationProductParamsHTTPMethodBdelete RadarAttackLayer7SummaryMitigationProductParamsHTTPMethod = "BDELETE"
- RadarAttackLayer7SummaryMitigationProductParamsHTTPMethodBmove RadarAttackLayer7SummaryMitigationProductParamsHTTPMethod = "BMOVE"
- RadarAttackLayer7SummaryMitigationProductParamsHTTPMethodBpropfind RadarAttackLayer7SummaryMitigationProductParamsHTTPMethod = "BPROPFIND"
- RadarAttackLayer7SummaryMitigationProductParamsHTTPMethodBproppatch RadarAttackLayer7SummaryMitigationProductParamsHTTPMethod = "BPROPPATCH"
- RadarAttackLayer7SummaryMitigationProductParamsHTTPMethodCheckin RadarAttackLayer7SummaryMitigationProductParamsHTTPMethod = "CHECKIN"
- RadarAttackLayer7SummaryMitigationProductParamsHTTPMethodCheckout RadarAttackLayer7SummaryMitigationProductParamsHTTPMethod = "CHECKOUT"
- RadarAttackLayer7SummaryMitigationProductParamsHTTPMethodConnect RadarAttackLayer7SummaryMitigationProductParamsHTTPMethod = "CONNECT"
- RadarAttackLayer7SummaryMitigationProductParamsHTTPMethodCopy RadarAttackLayer7SummaryMitigationProductParamsHTTPMethod = "COPY"
- RadarAttackLayer7SummaryMitigationProductParamsHTTPMethodLabel RadarAttackLayer7SummaryMitigationProductParamsHTTPMethod = "LABEL"
- RadarAttackLayer7SummaryMitigationProductParamsHTTPMethodLock RadarAttackLayer7SummaryMitigationProductParamsHTTPMethod = "LOCK"
- RadarAttackLayer7SummaryMitigationProductParamsHTTPMethodMerge RadarAttackLayer7SummaryMitigationProductParamsHTTPMethod = "MERGE"
- RadarAttackLayer7SummaryMitigationProductParamsHTTPMethodMkactivity RadarAttackLayer7SummaryMitigationProductParamsHTTPMethod = "MKACTIVITY"
- RadarAttackLayer7SummaryMitigationProductParamsHTTPMethodMkworkspace RadarAttackLayer7SummaryMitigationProductParamsHTTPMethod = "MKWORKSPACE"
- RadarAttackLayer7SummaryMitigationProductParamsHTTPMethodMove RadarAttackLayer7SummaryMitigationProductParamsHTTPMethod = "MOVE"
- RadarAttackLayer7SummaryMitigationProductParamsHTTPMethodNotify RadarAttackLayer7SummaryMitigationProductParamsHTTPMethod = "NOTIFY"
- RadarAttackLayer7SummaryMitigationProductParamsHTTPMethodOrderpatch RadarAttackLayer7SummaryMitigationProductParamsHTTPMethod = "ORDERPATCH"
- RadarAttackLayer7SummaryMitigationProductParamsHTTPMethodPoll RadarAttackLayer7SummaryMitigationProductParamsHTTPMethod = "POLL"
- RadarAttackLayer7SummaryMitigationProductParamsHTTPMethodProppatch RadarAttackLayer7SummaryMitigationProductParamsHTTPMethod = "PROPPATCH"
- RadarAttackLayer7SummaryMitigationProductParamsHTTPMethodReport RadarAttackLayer7SummaryMitigationProductParamsHTTPMethod = "REPORT"
- RadarAttackLayer7SummaryMitigationProductParamsHTTPMethodSearch RadarAttackLayer7SummaryMitigationProductParamsHTTPMethod = "SEARCH"
- RadarAttackLayer7SummaryMitigationProductParamsHTTPMethodSubscribe RadarAttackLayer7SummaryMitigationProductParamsHTTPMethod = "SUBSCRIBE"
- RadarAttackLayer7SummaryMitigationProductParamsHTTPMethodTrace RadarAttackLayer7SummaryMitigationProductParamsHTTPMethod = "TRACE"
- RadarAttackLayer7SummaryMitigationProductParamsHTTPMethodUncheckout RadarAttackLayer7SummaryMitigationProductParamsHTTPMethod = "UNCHECKOUT"
- RadarAttackLayer7SummaryMitigationProductParamsHTTPMethodUnlock RadarAttackLayer7SummaryMitigationProductParamsHTTPMethod = "UNLOCK"
- RadarAttackLayer7SummaryMitigationProductParamsHTTPMethodUnsubscribe RadarAttackLayer7SummaryMitigationProductParamsHTTPMethod = "UNSUBSCRIBE"
- RadarAttackLayer7SummaryMitigationProductParamsHTTPMethodUpdate RadarAttackLayer7SummaryMitigationProductParamsHTTPMethod = "UPDATE"
- RadarAttackLayer7SummaryMitigationProductParamsHTTPMethodVersioncontrol RadarAttackLayer7SummaryMitigationProductParamsHTTPMethod = "VERSIONCONTROL"
- RadarAttackLayer7SummaryMitigationProductParamsHTTPMethodBaselinecontrol RadarAttackLayer7SummaryMitigationProductParamsHTTPMethod = "BASELINECONTROL"
- RadarAttackLayer7SummaryMitigationProductParamsHTTPMethodXmsenumatts RadarAttackLayer7SummaryMitigationProductParamsHTTPMethod = "XMSENUMATTS"
- RadarAttackLayer7SummaryMitigationProductParamsHTTPMethodRpcOutData RadarAttackLayer7SummaryMitigationProductParamsHTTPMethod = "RPC_OUT_DATA"
- RadarAttackLayer7SummaryMitigationProductParamsHTTPMethodRpcInData RadarAttackLayer7SummaryMitigationProductParamsHTTPMethod = "RPC_IN_DATA"
- RadarAttackLayer7SummaryMitigationProductParamsHTTPMethodJson RadarAttackLayer7SummaryMitigationProductParamsHTTPMethod = "JSON"
- RadarAttackLayer7SummaryMitigationProductParamsHTTPMethodCook RadarAttackLayer7SummaryMitigationProductParamsHTTPMethod = "COOK"
- RadarAttackLayer7SummaryMitigationProductParamsHTTPMethodTrack RadarAttackLayer7SummaryMitigationProductParamsHTTPMethod = "TRACK"
-)
-
-type RadarAttackLayer7SummaryMitigationProductParamsHTTPVersion string
-
-const (
- RadarAttackLayer7SummaryMitigationProductParamsHTTPVersionHttPv1 RadarAttackLayer7SummaryMitigationProductParamsHTTPVersion = "HTTPv1"
- RadarAttackLayer7SummaryMitigationProductParamsHTTPVersionHttPv2 RadarAttackLayer7SummaryMitigationProductParamsHTTPVersion = "HTTPv2"
- RadarAttackLayer7SummaryMitigationProductParamsHTTPVersionHttPv3 RadarAttackLayer7SummaryMitigationProductParamsHTTPVersion = "HTTPv3"
-)
-
-type RadarAttackLayer7SummaryMitigationProductParamsIPVersion string
-
-const (
- RadarAttackLayer7SummaryMitigationProductParamsIPVersionIPv4 RadarAttackLayer7SummaryMitigationProductParamsIPVersion = "IPv4"
- RadarAttackLayer7SummaryMitigationProductParamsIPVersionIPv6 RadarAttackLayer7SummaryMitigationProductParamsIPVersion = "IPv6"
-)
-
-type RadarAttackLayer7SummaryMitigationProductResponseEnvelope struct {
- Result RadarAttackLayer7SummaryMitigationProductResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarAttackLayer7SummaryMitigationProductResponseEnvelopeJSON `json:"-"`
-}
-
-// radarAttackLayer7SummaryMitigationProductResponseEnvelopeJSON contains the JSON
-// metadata for the struct
-// [RadarAttackLayer7SummaryMitigationProductResponseEnvelope]
-type radarAttackLayer7SummaryMitigationProductResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7SummaryMitigationProductResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7SummaryMitigationProductResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
diff --git a/radarattacklayer7summary_test.go b/radarattacklayer7summary_test.go
deleted file mode 100644
index c707c64fbf7..00000000000
--- a/radarattacklayer7summary_test.go
+++ /dev/null
@@ -1,229 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
- "time"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRadarAttackLayer7SummaryGetWithOptionalParams(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"),
- )
- _, 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()}),
- Format: cloudflare.F(cloudflare.RadarAttackLayer7SummaryGetParamsFormatJson),
- 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())
- }
-}
-
-func TestRadarAttackLayer7SummaryHTTPMethodWithOptionalParams(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"),
- )
- _, 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()}),
- Format: cloudflare.F(cloudflare.RadarAttackLayer7SummaryHTTPMethodParamsFormatJson),
- HTTPVersion: cloudflare.F([]cloudflare.RadarAttackLayer7SummaryHTTPMethodParamsHTTPVersion{cloudflare.RadarAttackLayer7SummaryHTTPMethodParamsHTTPVersionHttPv1, cloudflare.RadarAttackLayer7SummaryHTTPMethodParamsHTTPVersionHttPv2, cloudflare.RadarAttackLayer7SummaryHTTPMethodParamsHTTPVersionHttPv3}),
- IPVersion: cloudflare.F([]cloudflare.RadarAttackLayer7SummaryHTTPMethodParamsIPVersion{cloudflare.RadarAttackLayer7SummaryHTTPMethodParamsIPVersionIPv4, cloudflare.RadarAttackLayer7SummaryHTTPMethodParamsIPVersionIPv6}),
- Location: cloudflare.F([]string{"string", "string", "string"}),
- MitigationProduct: cloudflare.F([]cloudflare.RadarAttackLayer7SummaryHTTPMethodParamsMitigationProduct{cloudflare.RadarAttackLayer7SummaryHTTPMethodParamsMitigationProductDDOS, cloudflare.RadarAttackLayer7SummaryHTTPMethodParamsMitigationProductWAF, cloudflare.RadarAttackLayer7SummaryHTTPMethodParamsMitigationProductBotManagement}),
- 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())
- }
-}
-
-func TestRadarAttackLayer7SummaryHTTPVersionWithOptionalParams(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"),
- )
- _, 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()}),
- Format: cloudflare.F(cloudflare.RadarAttackLayer7SummaryHTTPVersionParamsFormatJson),
- HTTPMethod: cloudflare.F([]cloudflare.RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethod{cloudflare.RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethodGet, cloudflare.RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethodPost, cloudflare.RadarAttackLayer7SummaryHTTPVersionParamsHTTPMethodDelete}),
- IPVersion: cloudflare.F([]cloudflare.RadarAttackLayer7SummaryHTTPVersionParamsIPVersion{cloudflare.RadarAttackLayer7SummaryHTTPVersionParamsIPVersionIPv4, cloudflare.RadarAttackLayer7SummaryHTTPVersionParamsIPVersionIPv6}),
- Location: cloudflare.F([]string{"string", "string", "string"}),
- MitigationProduct: cloudflare.F([]cloudflare.RadarAttackLayer7SummaryHTTPVersionParamsMitigationProduct{cloudflare.RadarAttackLayer7SummaryHTTPVersionParamsMitigationProductDDOS, cloudflare.RadarAttackLayer7SummaryHTTPVersionParamsMitigationProductWAF, cloudflare.RadarAttackLayer7SummaryHTTPVersionParamsMitigationProductBotManagement}),
- 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())
- }
-}
-
-func TestRadarAttackLayer7SummaryIPVersionWithOptionalParams(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"),
- )
- _, 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()}),
- Format: cloudflare.F(cloudflare.RadarAttackLayer7SummaryIPVersionParamsFormatJson),
- HTTPMethod: cloudflare.F([]cloudflare.RadarAttackLayer7SummaryIPVersionParamsHTTPMethod{cloudflare.RadarAttackLayer7SummaryIPVersionParamsHTTPMethodGet, cloudflare.RadarAttackLayer7SummaryIPVersionParamsHTTPMethodPost, cloudflare.RadarAttackLayer7SummaryIPVersionParamsHTTPMethodDelete}),
- HTTPVersion: cloudflare.F([]cloudflare.RadarAttackLayer7SummaryIPVersionParamsHTTPVersion{cloudflare.RadarAttackLayer7SummaryIPVersionParamsHTTPVersionHttPv1, cloudflare.RadarAttackLayer7SummaryIPVersionParamsHTTPVersionHttPv2, cloudflare.RadarAttackLayer7SummaryIPVersionParamsHTTPVersionHttPv3}),
- Location: cloudflare.F([]string{"string", "string", "string"}),
- MitigationProduct: cloudflare.F([]cloudflare.RadarAttackLayer7SummaryIPVersionParamsMitigationProduct{cloudflare.RadarAttackLayer7SummaryIPVersionParamsMitigationProductDDOS, cloudflare.RadarAttackLayer7SummaryIPVersionParamsMitigationProductWAF, cloudflare.RadarAttackLayer7SummaryIPVersionParamsMitigationProductBotManagement}),
- 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())
- }
-}
-
-func TestRadarAttackLayer7SummaryManagedRulesWithOptionalParams(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"),
- )
- _, 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()}),
- Format: cloudflare.F(cloudflare.RadarAttackLayer7SummaryManagedRulesParamsFormatJson),
- HTTPMethod: cloudflare.F([]cloudflare.RadarAttackLayer7SummaryManagedRulesParamsHTTPMethod{cloudflare.RadarAttackLayer7SummaryManagedRulesParamsHTTPMethodGet, cloudflare.RadarAttackLayer7SummaryManagedRulesParamsHTTPMethodPost, cloudflare.RadarAttackLayer7SummaryManagedRulesParamsHTTPMethodDelete}),
- HTTPVersion: cloudflare.F([]cloudflare.RadarAttackLayer7SummaryManagedRulesParamsHTTPVersion{cloudflare.RadarAttackLayer7SummaryManagedRulesParamsHTTPVersionHttPv1, cloudflare.RadarAttackLayer7SummaryManagedRulesParamsHTTPVersionHttPv2, cloudflare.RadarAttackLayer7SummaryManagedRulesParamsHTTPVersionHttPv3}),
- IPVersion: cloudflare.F([]cloudflare.RadarAttackLayer7SummaryManagedRulesParamsIPVersion{cloudflare.RadarAttackLayer7SummaryManagedRulesParamsIPVersionIPv4, cloudflare.RadarAttackLayer7SummaryManagedRulesParamsIPVersionIPv6}),
- Location: cloudflare.F([]string{"string", "string", "string"}),
- MitigationProduct: cloudflare.F([]cloudflare.RadarAttackLayer7SummaryManagedRulesParamsMitigationProduct{cloudflare.RadarAttackLayer7SummaryManagedRulesParamsMitigationProductDDOS, cloudflare.RadarAttackLayer7SummaryManagedRulesParamsMitigationProductWAF, cloudflare.RadarAttackLayer7SummaryManagedRulesParamsMitigationProductBotManagement}),
- 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())
- }
-}
-
-func TestRadarAttackLayer7SummaryMitigationProductWithOptionalParams(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"),
- )
- _, 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()}),
- Format: cloudflare.F(cloudflare.RadarAttackLayer7SummaryMitigationProductParamsFormatJson),
- HTTPMethod: cloudflare.F([]cloudflare.RadarAttackLayer7SummaryMitigationProductParamsHTTPMethod{cloudflare.RadarAttackLayer7SummaryMitigationProductParamsHTTPMethodGet, cloudflare.RadarAttackLayer7SummaryMitigationProductParamsHTTPMethodPost, cloudflare.RadarAttackLayer7SummaryMitigationProductParamsHTTPMethodDelete}),
- HTTPVersion: cloudflare.F([]cloudflare.RadarAttackLayer7SummaryMitigationProductParamsHTTPVersion{cloudflare.RadarAttackLayer7SummaryMitigationProductParamsHTTPVersionHttPv1, cloudflare.RadarAttackLayer7SummaryMitigationProductParamsHTTPVersionHttPv2, cloudflare.RadarAttackLayer7SummaryMitigationProductParamsHTTPVersionHttPv3}),
- IPVersion: cloudflare.F([]cloudflare.RadarAttackLayer7SummaryMitigationProductParamsIPVersion{cloudflare.RadarAttackLayer7SummaryMitigationProductParamsIPVersionIPv4, cloudflare.RadarAttackLayer7SummaryMitigationProductParamsIPVersionIPv6}),
- 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/radarattacklayer7timeseriesgroup.go b/radarattacklayer7timeseriesgroup.go
deleted file mode 100644
index aac54d360ae..00000000000
--- a/radarattacklayer7timeseriesgroup.go
+++ /dev/null
@@ -1,2073 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarAttackLayer7TimeseriesGroupService contains methods and other services that
-// help with interacting with the cloudflare API. Note, unlike clients, this
-// service does not read variables from the environment automatically. You should
-// not instantiate this service directly, and instead use the
-// [NewRadarAttackLayer7TimeseriesGroupService] method instead.
-type RadarAttackLayer7TimeseriesGroupService struct {
- Options []option.RequestOption
-}
-
-// NewRadarAttackLayer7TimeseriesGroupService generates a new service that applies
-// the given options to each request. These options are applied after the parent
-// client's options (if there is one), and before any request-specific options.
-func NewRadarAttackLayer7TimeseriesGroupService(opts ...option.RequestOption) (r *RadarAttackLayer7TimeseriesGroupService) {
- r = &RadarAttackLayer7TimeseriesGroupService{}
- r.Options = opts
- return
-}
-
-// Get a time series of the percentual distribution of mitigation techniques, over
-// time.
-func (r *RadarAttackLayer7TimeseriesGroupService) Get(ctx context.Context, query RadarAttackLayer7TimeseriesGroupGetParams, opts ...option.RequestOption) (res *RadarAttackLayer7TimeseriesGroupGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarAttackLayer7TimeseriesGroupGetResponseEnvelope
- path := "radar/attacks/layer7/timeseries_groups"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Percentage distribution of attacks by http method used over time.
-func (r *RadarAttackLayer7TimeseriesGroupService) HTTPMethod(ctx context.Context, query RadarAttackLayer7TimeseriesGroupHTTPMethodParams, opts ...option.RequestOption) (res *RadarAttackLayer7TimeseriesGroupHTTPMethodResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarAttackLayer7TimeseriesGroupHTTPMethodResponseEnvelope
- path := "radar/attacks/layer7/timeseries_groups/http_method"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Percentage distribution of attacks by http version used over time.
-func (r *RadarAttackLayer7TimeseriesGroupService) HTTPVersion(ctx context.Context, query RadarAttackLayer7TimeseriesGroupHTTPVersionParams, opts ...option.RequestOption) (res *RadarAttackLayer7TimeseriesGroupHTTPVersionResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarAttackLayer7TimeseriesGroupHTTPVersionResponseEnvelope
- path := "radar/attacks/layer7/timeseries_groups/http_version"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Percentage distribution of attacks by industry used over time.
-func (r *RadarAttackLayer7TimeseriesGroupService) Industry(ctx context.Context, query RadarAttackLayer7TimeseriesGroupIndustryParams, opts ...option.RequestOption) (res *RadarAttackLayer7TimeseriesGroupIndustryResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarAttackLayer7TimeseriesGroupIndustryResponseEnvelope
- path := "radar/attacks/layer7/timeseries_groups/industry"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Percentage distribution of attacks by ip version used over time.
-func (r *RadarAttackLayer7TimeseriesGroupService) IPVersion(ctx context.Context, query RadarAttackLayer7TimeseriesGroupIPVersionParams, opts ...option.RequestOption) (res *RadarAttackLayer7TimeseriesGroupIPVersionResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarAttackLayer7TimeseriesGroupIPVersionResponseEnvelope
- path := "radar/attacks/layer7/timeseries_groups/ip_version"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Percentage distribution of attacks by managed rules used over time.
-func (r *RadarAttackLayer7TimeseriesGroupService) ManagedRules(ctx context.Context, query RadarAttackLayer7TimeseriesGroupManagedRulesParams, opts ...option.RequestOption) (res *RadarAttackLayer7TimeseriesGroupManagedRulesResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarAttackLayer7TimeseriesGroupManagedRulesResponseEnvelope
- path := "radar/attacks/layer7/timeseries_groups/managed_rules"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Percentage distribution of attacks by mitigation product used over time.
-func (r *RadarAttackLayer7TimeseriesGroupService) MitigationProduct(ctx context.Context, query RadarAttackLayer7TimeseriesGroupMitigationProductParams, opts ...option.RequestOption) (res *RadarAttackLayer7TimeseriesGroupMitigationProductResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarAttackLayer7TimeseriesGroupMitigationProductResponseEnvelope
- path := "radar/attacks/layer7/timeseries_groups/mitigation_product"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Percentage distribution of attacks by vertical used over time.
-func (r *RadarAttackLayer7TimeseriesGroupService) Vertical(ctx context.Context, query RadarAttackLayer7TimeseriesGroupVerticalParams, opts ...option.RequestOption) (res *RadarAttackLayer7TimeseriesGroupVerticalResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarAttackLayer7TimeseriesGroupVerticalResponseEnvelope
- path := "radar/attacks/layer7/timeseries_groups/vertical"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type RadarAttackLayer7TimeseriesGroupGetResponse struct {
- Meta RadarAttackLayer7TimeseriesGroupGetResponseMeta `json:"meta,required"`
- Serie0 RadarAttackLayer7TimeseriesGroupGetResponseSerie0 `json:"serie_0,required"`
- JSON radarAttackLayer7TimeseriesGroupGetResponseJSON `json:"-"`
-}
-
-// radarAttackLayer7TimeseriesGroupGetResponseJSON contains the JSON metadata for
-// the struct [RadarAttackLayer7TimeseriesGroupGetResponse]
-type radarAttackLayer7TimeseriesGroupGetResponseJSON struct {
- Meta apijson.Field
- Serie0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7TimeseriesGroupGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TimeseriesGroupGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7TimeseriesGroupGetResponseMeta struct {
- AggInterval string `json:"aggInterval,required"`
- DateRange []RadarAttackLayer7TimeseriesGroupGetResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated time.Time `json:"lastUpdated,required" format:"date-time"`
- ConfidenceInfo RadarAttackLayer7TimeseriesGroupGetResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarAttackLayer7TimeseriesGroupGetResponseMetaJSON `json:"-"`
-}
-
-// radarAttackLayer7TimeseriesGroupGetResponseMetaJSON contains the JSON metadata
-// for the struct [RadarAttackLayer7TimeseriesGroupGetResponseMeta]
-type radarAttackLayer7TimeseriesGroupGetResponseMetaJSON struct {
- AggInterval apijson.Field
- DateRange apijson.Field
- LastUpdated apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7TimeseriesGroupGetResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TimeseriesGroupGetResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7TimeseriesGroupGetResponseMetaDateRange 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 radarAttackLayer7TimeseriesGroupGetResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarAttackLayer7TimeseriesGroupGetResponseMetaDateRangeJSON contains the JSON
-// metadata for the struct
-// [RadarAttackLayer7TimeseriesGroupGetResponseMetaDateRange]
-type radarAttackLayer7TimeseriesGroupGetResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7TimeseriesGroupGetResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TimeseriesGroupGetResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7TimeseriesGroupGetResponseMetaConfidenceInfo struct {
- Annotations []RadarAttackLayer7TimeseriesGroupGetResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarAttackLayer7TimeseriesGroupGetResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarAttackLayer7TimeseriesGroupGetResponseMetaConfidenceInfoJSON contains the
-// JSON metadata for the struct
-// [RadarAttackLayer7TimeseriesGroupGetResponseMetaConfidenceInfo]
-type radarAttackLayer7TimeseriesGroupGetResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7TimeseriesGroupGetResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TimeseriesGroupGetResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7TimeseriesGroupGetResponseMetaConfidenceInfoAnnotation 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 radarAttackLayer7TimeseriesGroupGetResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarAttackLayer7TimeseriesGroupGetResponseMetaConfidenceInfoAnnotationJSON
-// contains the JSON metadata for the struct
-// [RadarAttackLayer7TimeseriesGroupGetResponseMetaConfidenceInfoAnnotation]
-type radarAttackLayer7TimeseriesGroupGetResponseMetaConfidenceInfoAnnotationJSON 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 *RadarAttackLayer7TimeseriesGroupGetResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TimeseriesGroupGetResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7TimeseriesGroupGetResponseSerie0 struct {
- AccessRules []string `json:"ACCESS_RULES,required"`
- APIShield []string `json:"API_SHIELD,required"`
- BotManagement []string `json:"BOT_MANAGEMENT,required"`
- DataLossPrevention []string `json:"DATA_LOSS_PREVENTION,required"`
- DDOS []string `json:"DDOS,required"`
- IPReputation []string `json:"IP_REPUTATION,required"`
- Timestamps []time.Time `json:"timestamps,required" format:"date-time"`
- WAF []string `json:"WAF,required"`
- JSON radarAttackLayer7TimeseriesGroupGetResponseSerie0JSON `json:"-"`
-}
-
-// radarAttackLayer7TimeseriesGroupGetResponseSerie0JSON contains the JSON metadata
-// for the struct [RadarAttackLayer7TimeseriesGroupGetResponseSerie0]
-type radarAttackLayer7TimeseriesGroupGetResponseSerie0JSON struct {
- AccessRules apijson.Field
- APIShield apijson.Field
- BotManagement apijson.Field
- DataLossPrevention apijson.Field
- DDOS apijson.Field
- IPReputation apijson.Field
- Timestamps apijson.Field
- WAF apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7TimeseriesGroupGetResponseSerie0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TimeseriesGroupGetResponseSerie0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7TimeseriesGroupHTTPMethodResponse struct {
- Meta interface{} `json:"meta,required"`
- Serie0 RadarAttackLayer7TimeseriesGroupHTTPMethodResponseSerie0 `json:"serie_0,required"`
- JSON radarAttackLayer7TimeseriesGroupHTTPMethodResponseJSON `json:"-"`
-}
-
-// radarAttackLayer7TimeseriesGroupHTTPMethodResponseJSON contains the JSON
-// metadata for the struct [RadarAttackLayer7TimeseriesGroupHTTPMethodResponse]
-type radarAttackLayer7TimeseriesGroupHTTPMethodResponseJSON struct {
- Meta apijson.Field
- Serie0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7TimeseriesGroupHTTPMethodResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TimeseriesGroupHTTPMethodResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7TimeseriesGroupHTTPMethodResponseSerie0 struct {
- Get []string `json:"GET,required"`
- Timestamps []string `json:"timestamps,required"`
- JSON radarAttackLayer7TimeseriesGroupHTTPMethodResponseSerie0JSON `json:"-"`
-}
-
-// radarAttackLayer7TimeseriesGroupHTTPMethodResponseSerie0JSON contains the JSON
-// metadata for the struct
-// [RadarAttackLayer7TimeseriesGroupHTTPMethodResponseSerie0]
-type radarAttackLayer7TimeseriesGroupHTTPMethodResponseSerie0JSON struct {
- Get apijson.Field
- Timestamps apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7TimeseriesGroupHTTPMethodResponseSerie0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TimeseriesGroupHTTPMethodResponseSerie0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7TimeseriesGroupHTTPVersionResponse struct {
- Meta interface{} `json:"meta,required"`
- Serie0 RadarAttackLayer7TimeseriesGroupHTTPVersionResponseSerie0 `json:"serie_0,required"`
- JSON radarAttackLayer7TimeseriesGroupHTTPVersionResponseJSON `json:"-"`
-}
-
-// radarAttackLayer7TimeseriesGroupHTTPVersionResponseJSON contains the JSON
-// metadata for the struct [RadarAttackLayer7TimeseriesGroupHTTPVersionResponse]
-type radarAttackLayer7TimeseriesGroupHTTPVersionResponseJSON struct {
- Meta apijson.Field
- Serie0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7TimeseriesGroupHTTPVersionResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TimeseriesGroupHTTPVersionResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7TimeseriesGroupHTTPVersionResponseSerie0 struct {
- HTTP1X []string `json:"HTTP/1.x,required"`
- Timestamps []string `json:"timestamps,required"`
- JSON radarAttackLayer7TimeseriesGroupHTTPVersionResponseSerie0JSON `json:"-"`
-}
-
-// radarAttackLayer7TimeseriesGroupHTTPVersionResponseSerie0JSON contains the JSON
-// metadata for the struct
-// [RadarAttackLayer7TimeseriesGroupHTTPVersionResponseSerie0]
-type radarAttackLayer7TimeseriesGroupHTTPVersionResponseSerie0JSON struct {
- HTTP1X apijson.Field
- Timestamps apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7TimeseriesGroupHTTPVersionResponseSerie0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TimeseriesGroupHTTPVersionResponseSerie0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7TimeseriesGroupIndustryResponse struct {
- Meta interface{} `json:"meta,required"`
- Serie0 RadarAttackLayer7TimeseriesGroupIndustryResponseSerie0 `json:"serie_0,required"`
- JSON radarAttackLayer7TimeseriesGroupIndustryResponseJSON `json:"-"`
-}
-
-// radarAttackLayer7TimeseriesGroupIndustryResponseJSON contains the JSON metadata
-// for the struct [RadarAttackLayer7TimeseriesGroupIndustryResponse]
-type radarAttackLayer7TimeseriesGroupIndustryResponseJSON struct {
- Meta apijson.Field
- Serie0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7TimeseriesGroupIndustryResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TimeseriesGroupIndustryResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7TimeseriesGroupIndustryResponseSerie0 struct {
- Timestamps []string `json:"timestamps,required"`
- ExtraFields map[string][]string `json:"-,extras"`
- JSON radarAttackLayer7TimeseriesGroupIndustryResponseSerie0JSON `json:"-"`
-}
-
-// radarAttackLayer7TimeseriesGroupIndustryResponseSerie0JSON contains the JSON
-// metadata for the struct [RadarAttackLayer7TimeseriesGroupIndustryResponseSerie0]
-type radarAttackLayer7TimeseriesGroupIndustryResponseSerie0JSON struct {
- Timestamps apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7TimeseriesGroupIndustryResponseSerie0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TimeseriesGroupIndustryResponseSerie0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7TimeseriesGroupIPVersionResponse struct {
- Meta interface{} `json:"meta,required"`
- Serie0 RadarAttackLayer7TimeseriesGroupIPVersionResponseSerie0 `json:"serie_0,required"`
- JSON radarAttackLayer7TimeseriesGroupIPVersionResponseJSON `json:"-"`
-}
-
-// radarAttackLayer7TimeseriesGroupIPVersionResponseJSON contains the JSON metadata
-// for the struct [RadarAttackLayer7TimeseriesGroupIPVersionResponse]
-type radarAttackLayer7TimeseriesGroupIPVersionResponseJSON struct {
- Meta apijson.Field
- Serie0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7TimeseriesGroupIPVersionResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TimeseriesGroupIPVersionResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7TimeseriesGroupIPVersionResponseSerie0 struct {
- IPv4 []string `json:"IPv4,required"`
- IPv6 []string `json:"IPv6,required"`
- Timestamps []string `json:"timestamps,required"`
- JSON radarAttackLayer7TimeseriesGroupIPVersionResponseSerie0JSON `json:"-"`
-}
-
-// radarAttackLayer7TimeseriesGroupIPVersionResponseSerie0JSON contains the JSON
-// metadata for the struct
-// [RadarAttackLayer7TimeseriesGroupIPVersionResponseSerie0]
-type radarAttackLayer7TimeseriesGroupIPVersionResponseSerie0JSON struct {
- IPv4 apijson.Field
- IPv6 apijson.Field
- Timestamps apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7TimeseriesGroupIPVersionResponseSerie0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TimeseriesGroupIPVersionResponseSerie0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7TimeseriesGroupManagedRulesResponse struct {
- Meta interface{} `json:"meta,required"`
- Serie0 RadarAttackLayer7TimeseriesGroupManagedRulesResponseSerie0 `json:"serie_0,required"`
- JSON radarAttackLayer7TimeseriesGroupManagedRulesResponseJSON `json:"-"`
-}
-
-// radarAttackLayer7TimeseriesGroupManagedRulesResponseJSON contains the JSON
-// metadata for the struct [RadarAttackLayer7TimeseriesGroupManagedRulesResponse]
-type radarAttackLayer7TimeseriesGroupManagedRulesResponseJSON struct {
- Meta apijson.Field
- Serie0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7TimeseriesGroupManagedRulesResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TimeseriesGroupManagedRulesResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7TimeseriesGroupManagedRulesResponseSerie0 struct {
- Bot []string `json:"Bot,required"`
- Timestamps []string `json:"timestamps,required"`
- JSON radarAttackLayer7TimeseriesGroupManagedRulesResponseSerie0JSON `json:"-"`
-}
-
-// radarAttackLayer7TimeseriesGroupManagedRulesResponseSerie0JSON contains the JSON
-// metadata for the struct
-// [RadarAttackLayer7TimeseriesGroupManagedRulesResponseSerie0]
-type radarAttackLayer7TimeseriesGroupManagedRulesResponseSerie0JSON struct {
- Bot apijson.Field
- Timestamps apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7TimeseriesGroupManagedRulesResponseSerie0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TimeseriesGroupManagedRulesResponseSerie0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7TimeseriesGroupMitigationProductResponse struct {
- Meta interface{} `json:"meta,required"`
- Serie0 RadarAttackLayer7TimeseriesGroupMitigationProductResponseSerie0 `json:"serie_0,required"`
- JSON radarAttackLayer7TimeseriesGroupMitigationProductResponseJSON `json:"-"`
-}
-
-// radarAttackLayer7TimeseriesGroupMitigationProductResponseJSON contains the JSON
-// metadata for the struct
-// [RadarAttackLayer7TimeseriesGroupMitigationProductResponse]
-type radarAttackLayer7TimeseriesGroupMitigationProductResponseJSON struct {
- Meta apijson.Field
- Serie0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7TimeseriesGroupMitigationProductResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TimeseriesGroupMitigationProductResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7TimeseriesGroupMitigationProductResponseSerie0 struct {
- DDOS []string `json:"DDOS,required"`
- Timestamps []string `json:"timestamps,required"`
- JSON radarAttackLayer7TimeseriesGroupMitigationProductResponseSerie0JSON `json:"-"`
-}
-
-// radarAttackLayer7TimeseriesGroupMitigationProductResponseSerie0JSON contains the
-// JSON metadata for the struct
-// [RadarAttackLayer7TimeseriesGroupMitigationProductResponseSerie0]
-type radarAttackLayer7TimeseriesGroupMitigationProductResponseSerie0JSON struct {
- DDOS apijson.Field
- Timestamps apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7TimeseriesGroupMitigationProductResponseSerie0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TimeseriesGroupMitigationProductResponseSerie0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7TimeseriesGroupVerticalResponse struct {
- Meta interface{} `json:"meta,required"`
- Serie0 RadarAttackLayer7TimeseriesGroupVerticalResponseSerie0 `json:"serie_0,required"`
- JSON radarAttackLayer7TimeseriesGroupVerticalResponseJSON `json:"-"`
-}
-
-// radarAttackLayer7TimeseriesGroupVerticalResponseJSON contains the JSON metadata
-// for the struct [RadarAttackLayer7TimeseriesGroupVerticalResponse]
-type radarAttackLayer7TimeseriesGroupVerticalResponseJSON struct {
- Meta apijson.Field
- Serie0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7TimeseriesGroupVerticalResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TimeseriesGroupVerticalResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7TimeseriesGroupVerticalResponseSerie0 struct {
- Timestamps []string `json:"timestamps,required"`
- ExtraFields map[string][]string `json:"-,extras"`
- JSON radarAttackLayer7TimeseriesGroupVerticalResponseSerie0JSON `json:"-"`
-}
-
-// radarAttackLayer7TimeseriesGroupVerticalResponseSerie0JSON contains the JSON
-// metadata for the struct [RadarAttackLayer7TimeseriesGroupVerticalResponseSerie0]
-type radarAttackLayer7TimeseriesGroupVerticalResponseSerie0JSON struct {
- Timestamps apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7TimeseriesGroupVerticalResponseSerie0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TimeseriesGroupVerticalResponseSerie0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7TimeseriesGroupGetParams struct {
- // Aggregation interval results should be returned in (for example, in 15 minutes
- // or 1 hour intervals). Refer to
- // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
- AggInterval param.Field[RadarAttackLayer7TimeseriesGroupGetParamsAggInterval] `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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarAttackLayer7TimeseriesGroupGetParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Format results are returned in.
- Format param.Field[RadarAttackLayer7TimeseriesGroupGetParamsFormat] `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"`
-}
-
-// URLQuery serializes [RadarAttackLayer7TimeseriesGroupGetParams]'s query
-// parameters as `url.Values`.
-func (r RadarAttackLayer7TimeseriesGroupGetParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Aggregation interval results should be returned in (for example, in 15 minutes
-// or 1 hour intervals). Refer to
-// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
-type RadarAttackLayer7TimeseriesGroupGetParamsAggInterval string
-
-const (
- RadarAttackLayer7TimeseriesGroupGetParamsAggInterval15m RadarAttackLayer7TimeseriesGroupGetParamsAggInterval = "15m"
- RadarAttackLayer7TimeseriesGroupGetParamsAggInterval1h RadarAttackLayer7TimeseriesGroupGetParamsAggInterval = "1h"
- RadarAttackLayer7TimeseriesGroupGetParamsAggInterval1d RadarAttackLayer7TimeseriesGroupGetParamsAggInterval = "1d"
- RadarAttackLayer7TimeseriesGroupGetParamsAggInterval1w RadarAttackLayer7TimeseriesGroupGetParamsAggInterval = "1w"
-)
-
-type RadarAttackLayer7TimeseriesGroupGetParamsDateRange string
-
-const (
- RadarAttackLayer7TimeseriesGroupGetParamsDateRange1d RadarAttackLayer7TimeseriesGroupGetParamsDateRange = "1d"
- RadarAttackLayer7TimeseriesGroupGetParamsDateRange2d RadarAttackLayer7TimeseriesGroupGetParamsDateRange = "2d"
- RadarAttackLayer7TimeseriesGroupGetParamsDateRange7d RadarAttackLayer7TimeseriesGroupGetParamsDateRange = "7d"
- RadarAttackLayer7TimeseriesGroupGetParamsDateRange14d RadarAttackLayer7TimeseriesGroupGetParamsDateRange = "14d"
- RadarAttackLayer7TimeseriesGroupGetParamsDateRange28d RadarAttackLayer7TimeseriesGroupGetParamsDateRange = "28d"
- RadarAttackLayer7TimeseriesGroupGetParamsDateRange12w RadarAttackLayer7TimeseriesGroupGetParamsDateRange = "12w"
- RadarAttackLayer7TimeseriesGroupGetParamsDateRange24w RadarAttackLayer7TimeseriesGroupGetParamsDateRange = "24w"
- RadarAttackLayer7TimeseriesGroupGetParamsDateRange52w RadarAttackLayer7TimeseriesGroupGetParamsDateRange = "52w"
- RadarAttackLayer7TimeseriesGroupGetParamsDateRange1dControl RadarAttackLayer7TimeseriesGroupGetParamsDateRange = "1dControl"
- RadarAttackLayer7TimeseriesGroupGetParamsDateRange2dControl RadarAttackLayer7TimeseriesGroupGetParamsDateRange = "2dControl"
- RadarAttackLayer7TimeseriesGroupGetParamsDateRange7dControl RadarAttackLayer7TimeseriesGroupGetParamsDateRange = "7dControl"
- RadarAttackLayer7TimeseriesGroupGetParamsDateRange14dControl RadarAttackLayer7TimeseriesGroupGetParamsDateRange = "14dControl"
- RadarAttackLayer7TimeseriesGroupGetParamsDateRange28dControl RadarAttackLayer7TimeseriesGroupGetParamsDateRange = "28dControl"
- RadarAttackLayer7TimeseriesGroupGetParamsDateRange12wControl RadarAttackLayer7TimeseriesGroupGetParamsDateRange = "12wControl"
- RadarAttackLayer7TimeseriesGroupGetParamsDateRange24wControl RadarAttackLayer7TimeseriesGroupGetParamsDateRange = "24wControl"
-)
-
-// Format results are returned in.
-type RadarAttackLayer7TimeseriesGroupGetParamsFormat string
-
-const (
- RadarAttackLayer7TimeseriesGroupGetParamsFormatJson RadarAttackLayer7TimeseriesGroupGetParamsFormat = "JSON"
- RadarAttackLayer7TimeseriesGroupGetParamsFormatCsv RadarAttackLayer7TimeseriesGroupGetParamsFormat = "CSV"
-)
-
-type RadarAttackLayer7TimeseriesGroupGetResponseEnvelope struct {
- Result RadarAttackLayer7TimeseriesGroupGetResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarAttackLayer7TimeseriesGroupGetResponseEnvelopeJSON `json:"-"`
-}
-
-// radarAttackLayer7TimeseriesGroupGetResponseEnvelopeJSON contains the JSON
-// metadata for the struct [RadarAttackLayer7TimeseriesGroupGetResponseEnvelope]
-type radarAttackLayer7TimeseriesGroupGetResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7TimeseriesGroupGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TimeseriesGroupGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7TimeseriesGroupHTTPMethodParams struct {
- // Aggregation interval results should be returned in (for example, in 15 minutes
- // or 1 hour intervals). Refer to
- // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
- AggInterval param.Field[RadarAttackLayer7TimeseriesGroupHTTPMethodParamsAggInterval] `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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarAttackLayer7TimeseriesGroupHTTPMethodParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Format results are returned in.
- Format param.Field[RadarAttackLayer7TimeseriesGroupHTTPMethodParamsFormat] `query:"format"`
- // Filter for http version.
- HTTPVersion param.Field[[]RadarAttackLayer7TimeseriesGroupHTTPMethodParamsHTTPVersion] `query:"httpVersion"`
- // Filter for ip version.
- IPVersion param.Field[[]RadarAttackLayer7TimeseriesGroupHTTPMethodParamsIPVersion] `query:"ipVersion"`
- // 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 L7 mitigation products.
- MitigationProduct param.Field[[]RadarAttackLayer7TimeseriesGroupHTTPMethodParamsMitigationProduct] `query:"mitigationProduct"`
- // Array of names that will be used to name the series in responses.
- Name param.Field[[]string] `query:"name"`
- // Normalization method applied. Refer to
- // [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/).
- Normalization param.Field[RadarAttackLayer7TimeseriesGroupHTTPMethodParamsNormalization] `query:"normalization"`
-}
-
-// URLQuery serializes [RadarAttackLayer7TimeseriesGroupHTTPMethodParams]'s query
-// parameters as `url.Values`.
-func (r RadarAttackLayer7TimeseriesGroupHTTPMethodParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Aggregation interval results should be returned in (for example, in 15 minutes
-// or 1 hour intervals). Refer to
-// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
-type RadarAttackLayer7TimeseriesGroupHTTPMethodParamsAggInterval string
-
-const (
- RadarAttackLayer7TimeseriesGroupHTTPMethodParamsAggInterval15m RadarAttackLayer7TimeseriesGroupHTTPMethodParamsAggInterval = "15m"
- RadarAttackLayer7TimeseriesGroupHTTPMethodParamsAggInterval1h RadarAttackLayer7TimeseriesGroupHTTPMethodParamsAggInterval = "1h"
- RadarAttackLayer7TimeseriesGroupHTTPMethodParamsAggInterval1d RadarAttackLayer7TimeseriesGroupHTTPMethodParamsAggInterval = "1d"
- RadarAttackLayer7TimeseriesGroupHTTPMethodParamsAggInterval1w RadarAttackLayer7TimeseriesGroupHTTPMethodParamsAggInterval = "1w"
-)
-
-type RadarAttackLayer7TimeseriesGroupHTTPMethodParamsDateRange string
-
-const (
- RadarAttackLayer7TimeseriesGroupHTTPMethodParamsDateRange1d RadarAttackLayer7TimeseriesGroupHTTPMethodParamsDateRange = "1d"
- RadarAttackLayer7TimeseriesGroupHTTPMethodParamsDateRange2d RadarAttackLayer7TimeseriesGroupHTTPMethodParamsDateRange = "2d"
- RadarAttackLayer7TimeseriesGroupHTTPMethodParamsDateRange7d RadarAttackLayer7TimeseriesGroupHTTPMethodParamsDateRange = "7d"
- RadarAttackLayer7TimeseriesGroupHTTPMethodParamsDateRange14d RadarAttackLayer7TimeseriesGroupHTTPMethodParamsDateRange = "14d"
- RadarAttackLayer7TimeseriesGroupHTTPMethodParamsDateRange28d RadarAttackLayer7TimeseriesGroupHTTPMethodParamsDateRange = "28d"
- RadarAttackLayer7TimeseriesGroupHTTPMethodParamsDateRange12w RadarAttackLayer7TimeseriesGroupHTTPMethodParamsDateRange = "12w"
- RadarAttackLayer7TimeseriesGroupHTTPMethodParamsDateRange24w RadarAttackLayer7TimeseriesGroupHTTPMethodParamsDateRange = "24w"
- RadarAttackLayer7TimeseriesGroupHTTPMethodParamsDateRange52w RadarAttackLayer7TimeseriesGroupHTTPMethodParamsDateRange = "52w"
- RadarAttackLayer7TimeseriesGroupHTTPMethodParamsDateRange1dControl RadarAttackLayer7TimeseriesGroupHTTPMethodParamsDateRange = "1dControl"
- RadarAttackLayer7TimeseriesGroupHTTPMethodParamsDateRange2dControl RadarAttackLayer7TimeseriesGroupHTTPMethodParamsDateRange = "2dControl"
- RadarAttackLayer7TimeseriesGroupHTTPMethodParamsDateRange7dControl RadarAttackLayer7TimeseriesGroupHTTPMethodParamsDateRange = "7dControl"
- RadarAttackLayer7TimeseriesGroupHTTPMethodParamsDateRange14dControl RadarAttackLayer7TimeseriesGroupHTTPMethodParamsDateRange = "14dControl"
- RadarAttackLayer7TimeseriesGroupHTTPMethodParamsDateRange28dControl RadarAttackLayer7TimeseriesGroupHTTPMethodParamsDateRange = "28dControl"
- RadarAttackLayer7TimeseriesGroupHTTPMethodParamsDateRange12wControl RadarAttackLayer7TimeseriesGroupHTTPMethodParamsDateRange = "12wControl"
- RadarAttackLayer7TimeseriesGroupHTTPMethodParamsDateRange24wControl RadarAttackLayer7TimeseriesGroupHTTPMethodParamsDateRange = "24wControl"
-)
-
-// Format results are returned in.
-type RadarAttackLayer7TimeseriesGroupHTTPMethodParamsFormat string
-
-const (
- RadarAttackLayer7TimeseriesGroupHTTPMethodParamsFormatJson RadarAttackLayer7TimeseriesGroupHTTPMethodParamsFormat = "JSON"
- RadarAttackLayer7TimeseriesGroupHTTPMethodParamsFormatCsv RadarAttackLayer7TimeseriesGroupHTTPMethodParamsFormat = "CSV"
-)
-
-type RadarAttackLayer7TimeseriesGroupHTTPMethodParamsHTTPVersion string
-
-const (
- RadarAttackLayer7TimeseriesGroupHTTPMethodParamsHTTPVersionHttPv1 RadarAttackLayer7TimeseriesGroupHTTPMethodParamsHTTPVersion = "HTTPv1"
- RadarAttackLayer7TimeseriesGroupHTTPMethodParamsHTTPVersionHttPv2 RadarAttackLayer7TimeseriesGroupHTTPMethodParamsHTTPVersion = "HTTPv2"
- RadarAttackLayer7TimeseriesGroupHTTPMethodParamsHTTPVersionHttPv3 RadarAttackLayer7TimeseriesGroupHTTPMethodParamsHTTPVersion = "HTTPv3"
-)
-
-type RadarAttackLayer7TimeseriesGroupHTTPMethodParamsIPVersion string
-
-const (
- RadarAttackLayer7TimeseriesGroupHTTPMethodParamsIPVersionIPv4 RadarAttackLayer7TimeseriesGroupHTTPMethodParamsIPVersion = "IPv4"
- RadarAttackLayer7TimeseriesGroupHTTPMethodParamsIPVersionIPv6 RadarAttackLayer7TimeseriesGroupHTTPMethodParamsIPVersion = "IPv6"
-)
-
-type RadarAttackLayer7TimeseriesGroupHTTPMethodParamsMitigationProduct string
-
-const (
- RadarAttackLayer7TimeseriesGroupHTTPMethodParamsMitigationProductDDOS RadarAttackLayer7TimeseriesGroupHTTPMethodParamsMitigationProduct = "DDOS"
- RadarAttackLayer7TimeseriesGroupHTTPMethodParamsMitigationProductWAF RadarAttackLayer7TimeseriesGroupHTTPMethodParamsMitigationProduct = "WAF"
- RadarAttackLayer7TimeseriesGroupHTTPMethodParamsMitigationProductBotManagement RadarAttackLayer7TimeseriesGroupHTTPMethodParamsMitigationProduct = "BOT_MANAGEMENT"
- RadarAttackLayer7TimeseriesGroupHTTPMethodParamsMitigationProductAccessRules RadarAttackLayer7TimeseriesGroupHTTPMethodParamsMitigationProduct = "ACCESS_RULES"
- RadarAttackLayer7TimeseriesGroupHTTPMethodParamsMitigationProductIPReputation RadarAttackLayer7TimeseriesGroupHTTPMethodParamsMitigationProduct = "IP_REPUTATION"
- RadarAttackLayer7TimeseriesGroupHTTPMethodParamsMitigationProductAPIShield RadarAttackLayer7TimeseriesGroupHTTPMethodParamsMitigationProduct = "API_SHIELD"
- RadarAttackLayer7TimeseriesGroupHTTPMethodParamsMitigationProductDataLossPrevention RadarAttackLayer7TimeseriesGroupHTTPMethodParamsMitigationProduct = "DATA_LOSS_PREVENTION"
-)
-
-// Normalization method applied. Refer to
-// [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/).
-type RadarAttackLayer7TimeseriesGroupHTTPMethodParamsNormalization string
-
-const (
- RadarAttackLayer7TimeseriesGroupHTTPMethodParamsNormalizationPercentage RadarAttackLayer7TimeseriesGroupHTTPMethodParamsNormalization = "PERCENTAGE"
- RadarAttackLayer7TimeseriesGroupHTTPMethodParamsNormalizationMin0Max RadarAttackLayer7TimeseriesGroupHTTPMethodParamsNormalization = "MIN0_MAX"
-)
-
-type RadarAttackLayer7TimeseriesGroupHTTPMethodResponseEnvelope struct {
- Result RadarAttackLayer7TimeseriesGroupHTTPMethodResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarAttackLayer7TimeseriesGroupHTTPMethodResponseEnvelopeJSON `json:"-"`
-}
-
-// radarAttackLayer7TimeseriesGroupHTTPMethodResponseEnvelopeJSON contains the JSON
-// metadata for the struct
-// [RadarAttackLayer7TimeseriesGroupHTTPMethodResponseEnvelope]
-type radarAttackLayer7TimeseriesGroupHTTPMethodResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7TimeseriesGroupHTTPMethodResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TimeseriesGroupHTTPMethodResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7TimeseriesGroupHTTPVersionParams struct {
- // Aggregation interval results should be returned in (for example, in 15 minutes
- // or 1 hour intervals). Refer to
- // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
- AggInterval param.Field[RadarAttackLayer7TimeseriesGroupHTTPVersionParamsAggInterval] `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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarAttackLayer7TimeseriesGroupHTTPVersionParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Format results are returned in.
- Format param.Field[RadarAttackLayer7TimeseriesGroupHTTPVersionParamsFormat] `query:"format"`
- // Filter for http method.
- HTTPMethod param.Field[[]RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod] `query:"httpMethod"`
- // Filter for ip version.
- IPVersion param.Field[[]RadarAttackLayer7TimeseriesGroupHTTPVersionParamsIPVersion] `query:"ipVersion"`
- // 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 L7 mitigation products.
- MitigationProduct param.Field[[]RadarAttackLayer7TimeseriesGroupHTTPVersionParamsMitigationProduct] `query:"mitigationProduct"`
- // Array of names that will be used to name the series in responses.
- Name param.Field[[]string] `query:"name"`
- // Normalization method applied. Refer to
- // [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/).
- Normalization param.Field[RadarAttackLayer7TimeseriesGroupHTTPVersionParamsNormalization] `query:"normalization"`
-}
-
-// URLQuery serializes [RadarAttackLayer7TimeseriesGroupHTTPVersionParams]'s query
-// parameters as `url.Values`.
-func (r RadarAttackLayer7TimeseriesGroupHTTPVersionParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Aggregation interval results should be returned in (for example, in 15 minutes
-// or 1 hour intervals). Refer to
-// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
-type RadarAttackLayer7TimeseriesGroupHTTPVersionParamsAggInterval string
-
-const (
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsAggInterval15m RadarAttackLayer7TimeseriesGroupHTTPVersionParamsAggInterval = "15m"
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsAggInterval1h RadarAttackLayer7TimeseriesGroupHTTPVersionParamsAggInterval = "1h"
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsAggInterval1d RadarAttackLayer7TimeseriesGroupHTTPVersionParamsAggInterval = "1d"
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsAggInterval1w RadarAttackLayer7TimeseriesGroupHTTPVersionParamsAggInterval = "1w"
-)
-
-type RadarAttackLayer7TimeseriesGroupHTTPVersionParamsDateRange string
-
-const (
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsDateRange1d RadarAttackLayer7TimeseriesGroupHTTPVersionParamsDateRange = "1d"
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsDateRange2d RadarAttackLayer7TimeseriesGroupHTTPVersionParamsDateRange = "2d"
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsDateRange7d RadarAttackLayer7TimeseriesGroupHTTPVersionParamsDateRange = "7d"
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsDateRange14d RadarAttackLayer7TimeseriesGroupHTTPVersionParamsDateRange = "14d"
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsDateRange28d RadarAttackLayer7TimeseriesGroupHTTPVersionParamsDateRange = "28d"
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsDateRange12w RadarAttackLayer7TimeseriesGroupHTTPVersionParamsDateRange = "12w"
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsDateRange24w RadarAttackLayer7TimeseriesGroupHTTPVersionParamsDateRange = "24w"
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsDateRange52w RadarAttackLayer7TimeseriesGroupHTTPVersionParamsDateRange = "52w"
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsDateRange1dControl RadarAttackLayer7TimeseriesGroupHTTPVersionParamsDateRange = "1dControl"
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsDateRange2dControl RadarAttackLayer7TimeseriesGroupHTTPVersionParamsDateRange = "2dControl"
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsDateRange7dControl RadarAttackLayer7TimeseriesGroupHTTPVersionParamsDateRange = "7dControl"
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsDateRange14dControl RadarAttackLayer7TimeseriesGroupHTTPVersionParamsDateRange = "14dControl"
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsDateRange28dControl RadarAttackLayer7TimeseriesGroupHTTPVersionParamsDateRange = "28dControl"
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsDateRange12wControl RadarAttackLayer7TimeseriesGroupHTTPVersionParamsDateRange = "12wControl"
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsDateRange24wControl RadarAttackLayer7TimeseriesGroupHTTPVersionParamsDateRange = "24wControl"
-)
-
-// Format results are returned in.
-type RadarAttackLayer7TimeseriesGroupHTTPVersionParamsFormat string
-
-const (
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsFormatJson RadarAttackLayer7TimeseriesGroupHTTPVersionParamsFormat = "JSON"
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsFormatCsv RadarAttackLayer7TimeseriesGroupHTTPVersionParamsFormat = "CSV"
-)
-
-type RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod string
-
-const (
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodGet RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "GET"
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodPost RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "POST"
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodDelete RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "DELETE"
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodPut RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "PUT"
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodHead RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "HEAD"
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodPurge RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "PURGE"
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodOptions RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "OPTIONS"
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodPropfind RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "PROPFIND"
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodMkcol RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "MKCOL"
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodPatch RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "PATCH"
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodACL RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "ACL"
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodBcopy RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "BCOPY"
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodBdelete RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "BDELETE"
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodBmove RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "BMOVE"
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodBpropfind RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "BPROPFIND"
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodBproppatch RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "BPROPPATCH"
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodCheckin RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "CHECKIN"
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodCheckout RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "CHECKOUT"
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodConnect RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "CONNECT"
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodCopy RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "COPY"
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodLabel RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "LABEL"
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodLock RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "LOCK"
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodMerge RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "MERGE"
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodMkactivity RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "MKACTIVITY"
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodMkworkspace RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "MKWORKSPACE"
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodMove RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "MOVE"
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodNotify RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "NOTIFY"
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodOrderpatch RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "ORDERPATCH"
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodPoll RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "POLL"
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodProppatch RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "PROPPATCH"
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodReport RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "REPORT"
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodSearch RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "SEARCH"
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodSubscribe RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "SUBSCRIBE"
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodTrace RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "TRACE"
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodUncheckout RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "UNCHECKOUT"
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodUnlock RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "UNLOCK"
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodUnsubscribe RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "UNSUBSCRIBE"
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodUpdate RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "UPDATE"
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodVersioncontrol RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "VERSIONCONTROL"
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodBaselinecontrol RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "BASELINECONTROL"
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodXmsenumatts RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "XMSENUMATTS"
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodRpcOutData RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "RPC_OUT_DATA"
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodRpcInData RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "RPC_IN_DATA"
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodJson RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "JSON"
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodCook RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "COOK"
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodTrack RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod = "TRACK"
-)
-
-type RadarAttackLayer7TimeseriesGroupHTTPVersionParamsIPVersion string
-
-const (
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsIPVersionIPv4 RadarAttackLayer7TimeseriesGroupHTTPVersionParamsIPVersion = "IPv4"
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsIPVersionIPv6 RadarAttackLayer7TimeseriesGroupHTTPVersionParamsIPVersion = "IPv6"
-)
-
-type RadarAttackLayer7TimeseriesGroupHTTPVersionParamsMitigationProduct string
-
-const (
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsMitigationProductDDOS RadarAttackLayer7TimeseriesGroupHTTPVersionParamsMitigationProduct = "DDOS"
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsMitigationProductWAF RadarAttackLayer7TimeseriesGroupHTTPVersionParamsMitigationProduct = "WAF"
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsMitigationProductBotManagement RadarAttackLayer7TimeseriesGroupHTTPVersionParamsMitigationProduct = "BOT_MANAGEMENT"
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsMitigationProductAccessRules RadarAttackLayer7TimeseriesGroupHTTPVersionParamsMitigationProduct = "ACCESS_RULES"
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsMitigationProductIPReputation RadarAttackLayer7TimeseriesGroupHTTPVersionParamsMitigationProduct = "IP_REPUTATION"
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsMitigationProductAPIShield RadarAttackLayer7TimeseriesGroupHTTPVersionParamsMitigationProduct = "API_SHIELD"
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsMitigationProductDataLossPrevention RadarAttackLayer7TimeseriesGroupHTTPVersionParamsMitigationProduct = "DATA_LOSS_PREVENTION"
-)
-
-// Normalization method applied. Refer to
-// [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/).
-type RadarAttackLayer7TimeseriesGroupHTTPVersionParamsNormalization string
-
-const (
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsNormalizationPercentage RadarAttackLayer7TimeseriesGroupHTTPVersionParamsNormalization = "PERCENTAGE"
- RadarAttackLayer7TimeseriesGroupHTTPVersionParamsNormalizationMin0Max RadarAttackLayer7TimeseriesGroupHTTPVersionParamsNormalization = "MIN0_MAX"
-)
-
-type RadarAttackLayer7TimeseriesGroupHTTPVersionResponseEnvelope struct {
- Result RadarAttackLayer7TimeseriesGroupHTTPVersionResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarAttackLayer7TimeseriesGroupHTTPVersionResponseEnvelopeJSON `json:"-"`
-}
-
-// radarAttackLayer7TimeseriesGroupHTTPVersionResponseEnvelopeJSON contains the
-// JSON metadata for the struct
-// [RadarAttackLayer7TimeseriesGroupHTTPVersionResponseEnvelope]
-type radarAttackLayer7TimeseriesGroupHTTPVersionResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7TimeseriesGroupHTTPVersionResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TimeseriesGroupHTTPVersionResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7TimeseriesGroupIndustryParams struct {
- // Aggregation interval results should be returned in (for example, in 15 minutes
- // or 1 hour intervals). Refer to
- // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
- AggInterval param.Field[RadarAttackLayer7TimeseriesGroupIndustryParamsAggInterval] `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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarAttackLayer7TimeseriesGroupIndustryParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Format results are returned in.
- Format param.Field[RadarAttackLayer7TimeseriesGroupIndustryParamsFormat] `query:"format"`
- // Filter for http method.
- HTTPMethod param.Field[[]RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethod] `query:"httpMethod"`
- // Filter for http version.
- HTTPVersion param.Field[[]RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPVersion] `query:"httpVersion"`
- // Filter for ip version.
- IPVersion param.Field[[]RadarAttackLayer7TimeseriesGroupIndustryParamsIPVersion] `query:"ipVersion"`
- // Limit the number of objects (eg browsers, verticals, etc) to the top items over
- // the time range.
- LimitPerGroup param.Field[int64] `query:"limitPerGroup"`
- // Array of comma separated list of locations (alpha-2 country codes). Start with
- // `-` to exclude from results. For example, `-US,PT` excludes results from the US,
- // but includes results from PT.
- Location param.Field[[]string] `query:"location"`
- // Array of L7 mitigation products.
- MitigationProduct param.Field[[]RadarAttackLayer7TimeseriesGroupIndustryParamsMitigationProduct] `query:"mitigationProduct"`
- // Array of names that will be used to name the series in responses.
- Name param.Field[[]string] `query:"name"`
- // Normalization method applied. Refer to
- // [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/).
- Normalization param.Field[RadarAttackLayer7TimeseriesGroupIndustryParamsNormalization] `query:"normalization"`
-}
-
-// URLQuery serializes [RadarAttackLayer7TimeseriesGroupIndustryParams]'s query
-// parameters as `url.Values`.
-func (r RadarAttackLayer7TimeseriesGroupIndustryParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Aggregation interval results should be returned in (for example, in 15 minutes
-// or 1 hour intervals). Refer to
-// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
-type RadarAttackLayer7TimeseriesGroupIndustryParamsAggInterval string
-
-const (
- RadarAttackLayer7TimeseriesGroupIndustryParamsAggInterval15m RadarAttackLayer7TimeseriesGroupIndustryParamsAggInterval = "15m"
- RadarAttackLayer7TimeseriesGroupIndustryParamsAggInterval1h RadarAttackLayer7TimeseriesGroupIndustryParamsAggInterval = "1h"
- RadarAttackLayer7TimeseriesGroupIndustryParamsAggInterval1d RadarAttackLayer7TimeseriesGroupIndustryParamsAggInterval = "1d"
- RadarAttackLayer7TimeseriesGroupIndustryParamsAggInterval1w RadarAttackLayer7TimeseriesGroupIndustryParamsAggInterval = "1w"
-)
-
-type RadarAttackLayer7TimeseriesGroupIndustryParamsDateRange string
-
-const (
- RadarAttackLayer7TimeseriesGroupIndustryParamsDateRange1d RadarAttackLayer7TimeseriesGroupIndustryParamsDateRange = "1d"
- RadarAttackLayer7TimeseriesGroupIndustryParamsDateRange2d RadarAttackLayer7TimeseriesGroupIndustryParamsDateRange = "2d"
- RadarAttackLayer7TimeseriesGroupIndustryParamsDateRange7d RadarAttackLayer7TimeseriesGroupIndustryParamsDateRange = "7d"
- RadarAttackLayer7TimeseriesGroupIndustryParamsDateRange14d RadarAttackLayer7TimeseriesGroupIndustryParamsDateRange = "14d"
- RadarAttackLayer7TimeseriesGroupIndustryParamsDateRange28d RadarAttackLayer7TimeseriesGroupIndustryParamsDateRange = "28d"
- RadarAttackLayer7TimeseriesGroupIndustryParamsDateRange12w RadarAttackLayer7TimeseriesGroupIndustryParamsDateRange = "12w"
- RadarAttackLayer7TimeseriesGroupIndustryParamsDateRange24w RadarAttackLayer7TimeseriesGroupIndustryParamsDateRange = "24w"
- RadarAttackLayer7TimeseriesGroupIndustryParamsDateRange52w RadarAttackLayer7TimeseriesGroupIndustryParamsDateRange = "52w"
- RadarAttackLayer7TimeseriesGroupIndustryParamsDateRange1dControl RadarAttackLayer7TimeseriesGroupIndustryParamsDateRange = "1dControl"
- RadarAttackLayer7TimeseriesGroupIndustryParamsDateRange2dControl RadarAttackLayer7TimeseriesGroupIndustryParamsDateRange = "2dControl"
- RadarAttackLayer7TimeseriesGroupIndustryParamsDateRange7dControl RadarAttackLayer7TimeseriesGroupIndustryParamsDateRange = "7dControl"
- RadarAttackLayer7TimeseriesGroupIndustryParamsDateRange14dControl RadarAttackLayer7TimeseriesGroupIndustryParamsDateRange = "14dControl"
- RadarAttackLayer7TimeseriesGroupIndustryParamsDateRange28dControl RadarAttackLayer7TimeseriesGroupIndustryParamsDateRange = "28dControl"
- RadarAttackLayer7TimeseriesGroupIndustryParamsDateRange12wControl RadarAttackLayer7TimeseriesGroupIndustryParamsDateRange = "12wControl"
- RadarAttackLayer7TimeseriesGroupIndustryParamsDateRange24wControl RadarAttackLayer7TimeseriesGroupIndustryParamsDateRange = "24wControl"
-)
-
-// Format results are returned in.
-type RadarAttackLayer7TimeseriesGroupIndustryParamsFormat string
-
-const (
- RadarAttackLayer7TimeseriesGroupIndustryParamsFormatJson RadarAttackLayer7TimeseriesGroupIndustryParamsFormat = "JSON"
- RadarAttackLayer7TimeseriesGroupIndustryParamsFormatCsv RadarAttackLayer7TimeseriesGroupIndustryParamsFormat = "CSV"
-)
-
-type RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethod string
-
-const (
- RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethodGet RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "GET"
- RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethodPost RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "POST"
- RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethodDelete RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "DELETE"
- RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethodPut RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "PUT"
- RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethodHead RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "HEAD"
- RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethodPurge RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "PURGE"
- RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethodOptions RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "OPTIONS"
- RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethodPropfind RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "PROPFIND"
- RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethodMkcol RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "MKCOL"
- RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethodPatch RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "PATCH"
- RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethodACL RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "ACL"
- RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethodBcopy RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "BCOPY"
- RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethodBdelete RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "BDELETE"
- RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethodBmove RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "BMOVE"
- RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethodBpropfind RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "BPROPFIND"
- RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethodBproppatch RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "BPROPPATCH"
- RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethodCheckin RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "CHECKIN"
- RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethodCheckout RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "CHECKOUT"
- RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethodConnect RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "CONNECT"
- RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethodCopy RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "COPY"
- RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethodLabel RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "LABEL"
- RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethodLock RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "LOCK"
- RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethodMerge RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "MERGE"
- RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethodMkactivity RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "MKACTIVITY"
- RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethodMkworkspace RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "MKWORKSPACE"
- RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethodMove RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "MOVE"
- RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethodNotify RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "NOTIFY"
- RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethodOrderpatch RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "ORDERPATCH"
- RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethodPoll RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "POLL"
- RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethodProppatch RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "PROPPATCH"
- RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethodReport RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "REPORT"
- RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethodSearch RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "SEARCH"
- RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethodSubscribe RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "SUBSCRIBE"
- RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethodTrace RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "TRACE"
- RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethodUncheckout RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "UNCHECKOUT"
- RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethodUnlock RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "UNLOCK"
- RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethodUnsubscribe RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "UNSUBSCRIBE"
- RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethodUpdate RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "UPDATE"
- RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethodVersioncontrol RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "VERSIONCONTROL"
- RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethodBaselinecontrol RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "BASELINECONTROL"
- RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethodXmsenumatts RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "XMSENUMATTS"
- RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethodRpcOutData RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "RPC_OUT_DATA"
- RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethodRpcInData RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "RPC_IN_DATA"
- RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethodJson RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "JSON"
- RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethodCook RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "COOK"
- RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethodTrack RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethod = "TRACK"
-)
-
-type RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPVersion string
-
-const (
- RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPVersionHttPv1 RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPVersion = "HTTPv1"
- RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPVersionHttPv2 RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPVersion = "HTTPv2"
- RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPVersionHttPv3 RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPVersion = "HTTPv3"
-)
-
-type RadarAttackLayer7TimeseriesGroupIndustryParamsIPVersion string
-
-const (
- RadarAttackLayer7TimeseriesGroupIndustryParamsIPVersionIPv4 RadarAttackLayer7TimeseriesGroupIndustryParamsIPVersion = "IPv4"
- RadarAttackLayer7TimeseriesGroupIndustryParamsIPVersionIPv6 RadarAttackLayer7TimeseriesGroupIndustryParamsIPVersion = "IPv6"
-)
-
-type RadarAttackLayer7TimeseriesGroupIndustryParamsMitigationProduct string
-
-const (
- RadarAttackLayer7TimeseriesGroupIndustryParamsMitigationProductDDOS RadarAttackLayer7TimeseriesGroupIndustryParamsMitigationProduct = "DDOS"
- RadarAttackLayer7TimeseriesGroupIndustryParamsMitigationProductWAF RadarAttackLayer7TimeseriesGroupIndustryParamsMitigationProduct = "WAF"
- RadarAttackLayer7TimeseriesGroupIndustryParamsMitigationProductBotManagement RadarAttackLayer7TimeseriesGroupIndustryParamsMitigationProduct = "BOT_MANAGEMENT"
- RadarAttackLayer7TimeseriesGroupIndustryParamsMitigationProductAccessRules RadarAttackLayer7TimeseriesGroupIndustryParamsMitigationProduct = "ACCESS_RULES"
- RadarAttackLayer7TimeseriesGroupIndustryParamsMitigationProductIPReputation RadarAttackLayer7TimeseriesGroupIndustryParamsMitigationProduct = "IP_REPUTATION"
- RadarAttackLayer7TimeseriesGroupIndustryParamsMitigationProductAPIShield RadarAttackLayer7TimeseriesGroupIndustryParamsMitigationProduct = "API_SHIELD"
- RadarAttackLayer7TimeseriesGroupIndustryParamsMitigationProductDataLossPrevention RadarAttackLayer7TimeseriesGroupIndustryParamsMitigationProduct = "DATA_LOSS_PREVENTION"
-)
-
-// Normalization method applied. Refer to
-// [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/).
-type RadarAttackLayer7TimeseriesGroupIndustryParamsNormalization string
-
-const (
- RadarAttackLayer7TimeseriesGroupIndustryParamsNormalizationPercentage RadarAttackLayer7TimeseriesGroupIndustryParamsNormalization = "PERCENTAGE"
- RadarAttackLayer7TimeseriesGroupIndustryParamsNormalizationMin0Max RadarAttackLayer7TimeseriesGroupIndustryParamsNormalization = "MIN0_MAX"
-)
-
-type RadarAttackLayer7TimeseriesGroupIndustryResponseEnvelope struct {
- Result RadarAttackLayer7TimeseriesGroupIndustryResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarAttackLayer7TimeseriesGroupIndustryResponseEnvelopeJSON `json:"-"`
-}
-
-// radarAttackLayer7TimeseriesGroupIndustryResponseEnvelopeJSON contains the JSON
-// metadata for the struct
-// [RadarAttackLayer7TimeseriesGroupIndustryResponseEnvelope]
-type radarAttackLayer7TimeseriesGroupIndustryResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7TimeseriesGroupIndustryResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TimeseriesGroupIndustryResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7TimeseriesGroupIPVersionParams struct {
- // Aggregation interval results should be returned in (for example, in 15 minutes
- // or 1 hour intervals). Refer to
- // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
- AggInterval param.Field[RadarAttackLayer7TimeseriesGroupIPVersionParamsAggInterval] `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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarAttackLayer7TimeseriesGroupIPVersionParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Format results are returned in.
- Format param.Field[RadarAttackLayer7TimeseriesGroupIPVersionParamsFormat] `query:"format"`
- // Filter for http method.
- HTTPMethod param.Field[[]RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod] `query:"httpMethod"`
- // Filter for http version.
- HTTPVersion param.Field[[]RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPVersion] `query:"httpVersion"`
- // 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 L7 mitigation products.
- MitigationProduct param.Field[[]RadarAttackLayer7TimeseriesGroupIPVersionParamsMitigationProduct] `query:"mitigationProduct"`
- // Array of names that will be used to name the series in responses.
- Name param.Field[[]string] `query:"name"`
- // Normalization method applied. Refer to
- // [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/).
- Normalization param.Field[RadarAttackLayer7TimeseriesGroupIPVersionParamsNormalization] `query:"normalization"`
-}
-
-// URLQuery serializes [RadarAttackLayer7TimeseriesGroupIPVersionParams]'s query
-// parameters as `url.Values`.
-func (r RadarAttackLayer7TimeseriesGroupIPVersionParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Aggregation interval results should be returned in (for example, in 15 minutes
-// or 1 hour intervals). Refer to
-// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
-type RadarAttackLayer7TimeseriesGroupIPVersionParamsAggInterval string
-
-const (
- RadarAttackLayer7TimeseriesGroupIPVersionParamsAggInterval15m RadarAttackLayer7TimeseriesGroupIPVersionParamsAggInterval = "15m"
- RadarAttackLayer7TimeseriesGroupIPVersionParamsAggInterval1h RadarAttackLayer7TimeseriesGroupIPVersionParamsAggInterval = "1h"
- RadarAttackLayer7TimeseriesGroupIPVersionParamsAggInterval1d RadarAttackLayer7TimeseriesGroupIPVersionParamsAggInterval = "1d"
- RadarAttackLayer7TimeseriesGroupIPVersionParamsAggInterval1w RadarAttackLayer7TimeseriesGroupIPVersionParamsAggInterval = "1w"
-)
-
-type RadarAttackLayer7TimeseriesGroupIPVersionParamsDateRange string
-
-const (
- RadarAttackLayer7TimeseriesGroupIPVersionParamsDateRange1d RadarAttackLayer7TimeseriesGroupIPVersionParamsDateRange = "1d"
- RadarAttackLayer7TimeseriesGroupIPVersionParamsDateRange2d RadarAttackLayer7TimeseriesGroupIPVersionParamsDateRange = "2d"
- RadarAttackLayer7TimeseriesGroupIPVersionParamsDateRange7d RadarAttackLayer7TimeseriesGroupIPVersionParamsDateRange = "7d"
- RadarAttackLayer7TimeseriesGroupIPVersionParamsDateRange14d RadarAttackLayer7TimeseriesGroupIPVersionParamsDateRange = "14d"
- RadarAttackLayer7TimeseriesGroupIPVersionParamsDateRange28d RadarAttackLayer7TimeseriesGroupIPVersionParamsDateRange = "28d"
- RadarAttackLayer7TimeseriesGroupIPVersionParamsDateRange12w RadarAttackLayer7TimeseriesGroupIPVersionParamsDateRange = "12w"
- RadarAttackLayer7TimeseriesGroupIPVersionParamsDateRange24w RadarAttackLayer7TimeseriesGroupIPVersionParamsDateRange = "24w"
- RadarAttackLayer7TimeseriesGroupIPVersionParamsDateRange52w RadarAttackLayer7TimeseriesGroupIPVersionParamsDateRange = "52w"
- RadarAttackLayer7TimeseriesGroupIPVersionParamsDateRange1dControl RadarAttackLayer7TimeseriesGroupIPVersionParamsDateRange = "1dControl"
- RadarAttackLayer7TimeseriesGroupIPVersionParamsDateRange2dControl RadarAttackLayer7TimeseriesGroupIPVersionParamsDateRange = "2dControl"
- RadarAttackLayer7TimeseriesGroupIPVersionParamsDateRange7dControl RadarAttackLayer7TimeseriesGroupIPVersionParamsDateRange = "7dControl"
- RadarAttackLayer7TimeseriesGroupIPVersionParamsDateRange14dControl RadarAttackLayer7TimeseriesGroupIPVersionParamsDateRange = "14dControl"
- RadarAttackLayer7TimeseriesGroupIPVersionParamsDateRange28dControl RadarAttackLayer7TimeseriesGroupIPVersionParamsDateRange = "28dControl"
- RadarAttackLayer7TimeseriesGroupIPVersionParamsDateRange12wControl RadarAttackLayer7TimeseriesGroupIPVersionParamsDateRange = "12wControl"
- RadarAttackLayer7TimeseriesGroupIPVersionParamsDateRange24wControl RadarAttackLayer7TimeseriesGroupIPVersionParamsDateRange = "24wControl"
-)
-
-// Format results are returned in.
-type RadarAttackLayer7TimeseriesGroupIPVersionParamsFormat string
-
-const (
- RadarAttackLayer7TimeseriesGroupIPVersionParamsFormatJson RadarAttackLayer7TimeseriesGroupIPVersionParamsFormat = "JSON"
- RadarAttackLayer7TimeseriesGroupIPVersionParamsFormatCsv RadarAttackLayer7TimeseriesGroupIPVersionParamsFormat = "CSV"
-)
-
-type RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod string
-
-const (
- RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodGet RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "GET"
- RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodPost RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "POST"
- RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodDelete RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "DELETE"
- RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodPut RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "PUT"
- RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodHead RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "HEAD"
- RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodPurge RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "PURGE"
- RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodOptions RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "OPTIONS"
- RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodPropfind RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "PROPFIND"
- RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodMkcol RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "MKCOL"
- RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodPatch RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "PATCH"
- RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodACL RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "ACL"
- RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodBcopy RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "BCOPY"
- RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodBdelete RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "BDELETE"
- RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodBmove RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "BMOVE"
- RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodBpropfind RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "BPROPFIND"
- RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodBproppatch RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "BPROPPATCH"
- RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodCheckin RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "CHECKIN"
- RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodCheckout RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "CHECKOUT"
- RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodConnect RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "CONNECT"
- RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodCopy RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "COPY"
- RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodLabel RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "LABEL"
- RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodLock RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "LOCK"
- RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodMerge RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "MERGE"
- RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodMkactivity RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "MKACTIVITY"
- RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodMkworkspace RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "MKWORKSPACE"
- RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodMove RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "MOVE"
- RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodNotify RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "NOTIFY"
- RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodOrderpatch RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "ORDERPATCH"
- RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodPoll RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "POLL"
- RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodProppatch RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "PROPPATCH"
- RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodReport RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "REPORT"
- RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodSearch RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "SEARCH"
- RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodSubscribe RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "SUBSCRIBE"
- RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodTrace RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "TRACE"
- RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodUncheckout RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "UNCHECKOUT"
- RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodUnlock RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "UNLOCK"
- RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodUnsubscribe RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "UNSUBSCRIBE"
- RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodUpdate RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "UPDATE"
- RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodVersioncontrol RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "VERSIONCONTROL"
- RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodBaselinecontrol RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "BASELINECONTROL"
- RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodXmsenumatts RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "XMSENUMATTS"
- RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodRpcOutData RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "RPC_OUT_DATA"
- RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodRpcInData RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "RPC_IN_DATA"
- RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodJson RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "JSON"
- RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodCook RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "COOK"
- RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodTrack RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod = "TRACK"
-)
-
-type RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPVersion string
-
-const (
- RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPVersionHttPv1 RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPVersion = "HTTPv1"
- RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPVersionHttPv2 RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPVersion = "HTTPv2"
- RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPVersionHttPv3 RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPVersion = "HTTPv3"
-)
-
-type RadarAttackLayer7TimeseriesGroupIPVersionParamsMitigationProduct string
-
-const (
- RadarAttackLayer7TimeseriesGroupIPVersionParamsMitigationProductDDOS RadarAttackLayer7TimeseriesGroupIPVersionParamsMitigationProduct = "DDOS"
- RadarAttackLayer7TimeseriesGroupIPVersionParamsMitigationProductWAF RadarAttackLayer7TimeseriesGroupIPVersionParamsMitigationProduct = "WAF"
- RadarAttackLayer7TimeseriesGroupIPVersionParamsMitigationProductBotManagement RadarAttackLayer7TimeseriesGroupIPVersionParamsMitigationProduct = "BOT_MANAGEMENT"
- RadarAttackLayer7TimeseriesGroupIPVersionParamsMitigationProductAccessRules RadarAttackLayer7TimeseriesGroupIPVersionParamsMitigationProduct = "ACCESS_RULES"
- RadarAttackLayer7TimeseriesGroupIPVersionParamsMitigationProductIPReputation RadarAttackLayer7TimeseriesGroupIPVersionParamsMitigationProduct = "IP_REPUTATION"
- RadarAttackLayer7TimeseriesGroupIPVersionParamsMitigationProductAPIShield RadarAttackLayer7TimeseriesGroupIPVersionParamsMitigationProduct = "API_SHIELD"
- RadarAttackLayer7TimeseriesGroupIPVersionParamsMitigationProductDataLossPrevention RadarAttackLayer7TimeseriesGroupIPVersionParamsMitigationProduct = "DATA_LOSS_PREVENTION"
-)
-
-// Normalization method applied. Refer to
-// [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/).
-type RadarAttackLayer7TimeseriesGroupIPVersionParamsNormalization string
-
-const (
- RadarAttackLayer7TimeseriesGroupIPVersionParamsNormalizationPercentage RadarAttackLayer7TimeseriesGroupIPVersionParamsNormalization = "PERCENTAGE"
- RadarAttackLayer7TimeseriesGroupIPVersionParamsNormalizationMin0Max RadarAttackLayer7TimeseriesGroupIPVersionParamsNormalization = "MIN0_MAX"
-)
-
-type RadarAttackLayer7TimeseriesGroupIPVersionResponseEnvelope struct {
- Result RadarAttackLayer7TimeseriesGroupIPVersionResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarAttackLayer7TimeseriesGroupIPVersionResponseEnvelopeJSON `json:"-"`
-}
-
-// radarAttackLayer7TimeseriesGroupIPVersionResponseEnvelopeJSON contains the JSON
-// metadata for the struct
-// [RadarAttackLayer7TimeseriesGroupIPVersionResponseEnvelope]
-type radarAttackLayer7TimeseriesGroupIPVersionResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7TimeseriesGroupIPVersionResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TimeseriesGroupIPVersionResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7TimeseriesGroupManagedRulesParams struct {
- // Aggregation interval results should be returned in (for example, in 15 minutes
- // or 1 hour intervals). Refer to
- // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
- AggInterval param.Field[RadarAttackLayer7TimeseriesGroupManagedRulesParamsAggInterval] `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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarAttackLayer7TimeseriesGroupManagedRulesParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Format results are returned in.
- Format param.Field[RadarAttackLayer7TimeseriesGroupManagedRulesParamsFormat] `query:"format"`
- // Filter for http method.
- HTTPMethod param.Field[[]RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod] `query:"httpMethod"`
- // Filter for http version.
- HTTPVersion param.Field[[]RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPVersion] `query:"httpVersion"`
- // Filter for ip version.
- IPVersion param.Field[[]RadarAttackLayer7TimeseriesGroupManagedRulesParamsIPVersion] `query:"ipVersion"`
- // 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 L7 mitigation products.
- MitigationProduct param.Field[[]RadarAttackLayer7TimeseriesGroupManagedRulesParamsMitigationProduct] `query:"mitigationProduct"`
- // Array of names that will be used to name the series in responses.
- Name param.Field[[]string] `query:"name"`
- // Normalization method applied. Refer to
- // [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/).
- Normalization param.Field[RadarAttackLayer7TimeseriesGroupManagedRulesParamsNormalization] `query:"normalization"`
-}
-
-// URLQuery serializes [RadarAttackLayer7TimeseriesGroupManagedRulesParams]'s query
-// parameters as `url.Values`.
-func (r RadarAttackLayer7TimeseriesGroupManagedRulesParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Aggregation interval results should be returned in (for example, in 15 minutes
-// or 1 hour intervals). Refer to
-// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
-type RadarAttackLayer7TimeseriesGroupManagedRulesParamsAggInterval string
-
-const (
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsAggInterval15m RadarAttackLayer7TimeseriesGroupManagedRulesParamsAggInterval = "15m"
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsAggInterval1h RadarAttackLayer7TimeseriesGroupManagedRulesParamsAggInterval = "1h"
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsAggInterval1d RadarAttackLayer7TimeseriesGroupManagedRulesParamsAggInterval = "1d"
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsAggInterval1w RadarAttackLayer7TimeseriesGroupManagedRulesParamsAggInterval = "1w"
-)
-
-type RadarAttackLayer7TimeseriesGroupManagedRulesParamsDateRange string
-
-const (
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsDateRange1d RadarAttackLayer7TimeseriesGroupManagedRulesParamsDateRange = "1d"
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsDateRange2d RadarAttackLayer7TimeseriesGroupManagedRulesParamsDateRange = "2d"
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsDateRange7d RadarAttackLayer7TimeseriesGroupManagedRulesParamsDateRange = "7d"
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsDateRange14d RadarAttackLayer7TimeseriesGroupManagedRulesParamsDateRange = "14d"
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsDateRange28d RadarAttackLayer7TimeseriesGroupManagedRulesParamsDateRange = "28d"
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsDateRange12w RadarAttackLayer7TimeseriesGroupManagedRulesParamsDateRange = "12w"
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsDateRange24w RadarAttackLayer7TimeseriesGroupManagedRulesParamsDateRange = "24w"
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsDateRange52w RadarAttackLayer7TimeseriesGroupManagedRulesParamsDateRange = "52w"
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsDateRange1dControl RadarAttackLayer7TimeseriesGroupManagedRulesParamsDateRange = "1dControl"
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsDateRange2dControl RadarAttackLayer7TimeseriesGroupManagedRulesParamsDateRange = "2dControl"
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsDateRange7dControl RadarAttackLayer7TimeseriesGroupManagedRulesParamsDateRange = "7dControl"
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsDateRange14dControl RadarAttackLayer7TimeseriesGroupManagedRulesParamsDateRange = "14dControl"
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsDateRange28dControl RadarAttackLayer7TimeseriesGroupManagedRulesParamsDateRange = "28dControl"
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsDateRange12wControl RadarAttackLayer7TimeseriesGroupManagedRulesParamsDateRange = "12wControl"
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsDateRange24wControl RadarAttackLayer7TimeseriesGroupManagedRulesParamsDateRange = "24wControl"
-)
-
-// Format results are returned in.
-type RadarAttackLayer7TimeseriesGroupManagedRulesParamsFormat string
-
-const (
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsFormatJson RadarAttackLayer7TimeseriesGroupManagedRulesParamsFormat = "JSON"
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsFormatCsv RadarAttackLayer7TimeseriesGroupManagedRulesParamsFormat = "CSV"
-)
-
-type RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod string
-
-const (
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodGet RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "GET"
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodPost RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "POST"
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodDelete RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "DELETE"
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodPut RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "PUT"
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodHead RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "HEAD"
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodPurge RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "PURGE"
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodOptions RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "OPTIONS"
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodPropfind RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "PROPFIND"
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodMkcol RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "MKCOL"
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodPatch RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "PATCH"
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodACL RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "ACL"
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodBcopy RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "BCOPY"
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodBdelete RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "BDELETE"
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodBmove RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "BMOVE"
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodBpropfind RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "BPROPFIND"
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodBproppatch RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "BPROPPATCH"
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodCheckin RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "CHECKIN"
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodCheckout RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "CHECKOUT"
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodConnect RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "CONNECT"
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodCopy RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "COPY"
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodLabel RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "LABEL"
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodLock RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "LOCK"
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodMerge RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "MERGE"
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodMkactivity RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "MKACTIVITY"
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodMkworkspace RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "MKWORKSPACE"
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodMove RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "MOVE"
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodNotify RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "NOTIFY"
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodOrderpatch RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "ORDERPATCH"
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodPoll RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "POLL"
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodProppatch RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "PROPPATCH"
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodReport RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "REPORT"
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodSearch RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "SEARCH"
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodSubscribe RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "SUBSCRIBE"
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodTrace RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "TRACE"
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodUncheckout RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "UNCHECKOUT"
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodUnlock RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "UNLOCK"
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodUnsubscribe RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "UNSUBSCRIBE"
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodUpdate RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "UPDATE"
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodVersioncontrol RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "VERSIONCONTROL"
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodBaselinecontrol RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "BASELINECONTROL"
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodXmsenumatts RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "XMSENUMATTS"
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodRpcOutData RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "RPC_OUT_DATA"
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodRpcInData RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "RPC_IN_DATA"
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodJson RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "JSON"
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodCook RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "COOK"
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodTrack RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod = "TRACK"
-)
-
-type RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPVersion string
-
-const (
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPVersionHttPv1 RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPVersion = "HTTPv1"
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPVersionHttPv2 RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPVersion = "HTTPv2"
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPVersionHttPv3 RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPVersion = "HTTPv3"
-)
-
-type RadarAttackLayer7TimeseriesGroupManagedRulesParamsIPVersion string
-
-const (
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsIPVersionIPv4 RadarAttackLayer7TimeseriesGroupManagedRulesParamsIPVersion = "IPv4"
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsIPVersionIPv6 RadarAttackLayer7TimeseriesGroupManagedRulesParamsIPVersion = "IPv6"
-)
-
-type RadarAttackLayer7TimeseriesGroupManagedRulesParamsMitigationProduct string
-
-const (
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsMitigationProductDDOS RadarAttackLayer7TimeseriesGroupManagedRulesParamsMitigationProduct = "DDOS"
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsMitigationProductWAF RadarAttackLayer7TimeseriesGroupManagedRulesParamsMitigationProduct = "WAF"
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsMitigationProductBotManagement RadarAttackLayer7TimeseriesGroupManagedRulesParamsMitigationProduct = "BOT_MANAGEMENT"
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsMitigationProductAccessRules RadarAttackLayer7TimeseriesGroupManagedRulesParamsMitigationProduct = "ACCESS_RULES"
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsMitigationProductIPReputation RadarAttackLayer7TimeseriesGroupManagedRulesParamsMitigationProduct = "IP_REPUTATION"
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsMitigationProductAPIShield RadarAttackLayer7TimeseriesGroupManagedRulesParamsMitigationProduct = "API_SHIELD"
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsMitigationProductDataLossPrevention RadarAttackLayer7TimeseriesGroupManagedRulesParamsMitigationProduct = "DATA_LOSS_PREVENTION"
-)
-
-// Normalization method applied. Refer to
-// [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/).
-type RadarAttackLayer7TimeseriesGroupManagedRulesParamsNormalization string
-
-const (
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsNormalizationPercentage RadarAttackLayer7TimeseriesGroupManagedRulesParamsNormalization = "PERCENTAGE"
- RadarAttackLayer7TimeseriesGroupManagedRulesParamsNormalizationMin0Max RadarAttackLayer7TimeseriesGroupManagedRulesParamsNormalization = "MIN0_MAX"
-)
-
-type RadarAttackLayer7TimeseriesGroupManagedRulesResponseEnvelope struct {
- Result RadarAttackLayer7TimeseriesGroupManagedRulesResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarAttackLayer7TimeseriesGroupManagedRulesResponseEnvelopeJSON `json:"-"`
-}
-
-// radarAttackLayer7TimeseriesGroupManagedRulesResponseEnvelopeJSON contains the
-// JSON metadata for the struct
-// [RadarAttackLayer7TimeseriesGroupManagedRulesResponseEnvelope]
-type radarAttackLayer7TimeseriesGroupManagedRulesResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7TimeseriesGroupManagedRulesResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TimeseriesGroupManagedRulesResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7TimeseriesGroupMitigationProductParams struct {
- // Aggregation interval results should be returned in (for example, in 15 minutes
- // or 1 hour intervals). Refer to
- // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
- AggInterval param.Field[RadarAttackLayer7TimeseriesGroupMitigationProductParamsAggInterval] `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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarAttackLayer7TimeseriesGroupMitigationProductParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Format results are returned in.
- Format param.Field[RadarAttackLayer7TimeseriesGroupMitigationProductParamsFormat] `query:"format"`
- // Filter for http method.
- HTTPMethod param.Field[[]RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod] `query:"httpMethod"`
- // Filter for http version.
- HTTPVersion param.Field[[]RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPVersion] `query:"httpVersion"`
- // Filter for ip version.
- IPVersion param.Field[[]RadarAttackLayer7TimeseriesGroupMitigationProductParamsIPVersion] `query:"ipVersion"`
- // 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"`
- // Normalization method applied. Refer to
- // [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/).
- Normalization param.Field[RadarAttackLayer7TimeseriesGroupMitigationProductParamsNormalization] `query:"normalization"`
-}
-
-// URLQuery serializes [RadarAttackLayer7TimeseriesGroupMitigationProductParams]'s
-// query parameters as `url.Values`.
-func (r RadarAttackLayer7TimeseriesGroupMitigationProductParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Aggregation interval results should be returned in (for example, in 15 minutes
-// or 1 hour intervals). Refer to
-// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
-type RadarAttackLayer7TimeseriesGroupMitigationProductParamsAggInterval string
-
-const (
- RadarAttackLayer7TimeseriesGroupMitigationProductParamsAggInterval15m RadarAttackLayer7TimeseriesGroupMitigationProductParamsAggInterval = "15m"
- RadarAttackLayer7TimeseriesGroupMitigationProductParamsAggInterval1h RadarAttackLayer7TimeseriesGroupMitigationProductParamsAggInterval = "1h"
- RadarAttackLayer7TimeseriesGroupMitigationProductParamsAggInterval1d RadarAttackLayer7TimeseriesGroupMitigationProductParamsAggInterval = "1d"
- RadarAttackLayer7TimeseriesGroupMitigationProductParamsAggInterval1w RadarAttackLayer7TimeseriesGroupMitigationProductParamsAggInterval = "1w"
-)
-
-type RadarAttackLayer7TimeseriesGroupMitigationProductParamsDateRange string
-
-const (
- RadarAttackLayer7TimeseriesGroupMitigationProductParamsDateRange1d RadarAttackLayer7TimeseriesGroupMitigationProductParamsDateRange = "1d"
- RadarAttackLayer7TimeseriesGroupMitigationProductParamsDateRange2d RadarAttackLayer7TimeseriesGroupMitigationProductParamsDateRange = "2d"
- RadarAttackLayer7TimeseriesGroupMitigationProductParamsDateRange7d RadarAttackLayer7TimeseriesGroupMitigationProductParamsDateRange = "7d"
- RadarAttackLayer7TimeseriesGroupMitigationProductParamsDateRange14d RadarAttackLayer7TimeseriesGroupMitigationProductParamsDateRange = "14d"
- RadarAttackLayer7TimeseriesGroupMitigationProductParamsDateRange28d RadarAttackLayer7TimeseriesGroupMitigationProductParamsDateRange = "28d"
- RadarAttackLayer7TimeseriesGroupMitigationProductParamsDateRange12w RadarAttackLayer7TimeseriesGroupMitigationProductParamsDateRange = "12w"
- RadarAttackLayer7TimeseriesGroupMitigationProductParamsDateRange24w RadarAttackLayer7TimeseriesGroupMitigationProductParamsDateRange = "24w"
- RadarAttackLayer7TimeseriesGroupMitigationProductParamsDateRange52w RadarAttackLayer7TimeseriesGroupMitigationProductParamsDateRange = "52w"
- RadarAttackLayer7TimeseriesGroupMitigationProductParamsDateRange1dControl RadarAttackLayer7TimeseriesGroupMitigationProductParamsDateRange = "1dControl"
- RadarAttackLayer7TimeseriesGroupMitigationProductParamsDateRange2dControl RadarAttackLayer7TimeseriesGroupMitigationProductParamsDateRange = "2dControl"
- RadarAttackLayer7TimeseriesGroupMitigationProductParamsDateRange7dControl RadarAttackLayer7TimeseriesGroupMitigationProductParamsDateRange = "7dControl"
- RadarAttackLayer7TimeseriesGroupMitigationProductParamsDateRange14dControl RadarAttackLayer7TimeseriesGroupMitigationProductParamsDateRange = "14dControl"
- RadarAttackLayer7TimeseriesGroupMitigationProductParamsDateRange28dControl RadarAttackLayer7TimeseriesGroupMitigationProductParamsDateRange = "28dControl"
- RadarAttackLayer7TimeseriesGroupMitigationProductParamsDateRange12wControl RadarAttackLayer7TimeseriesGroupMitigationProductParamsDateRange = "12wControl"
- RadarAttackLayer7TimeseriesGroupMitigationProductParamsDateRange24wControl RadarAttackLayer7TimeseriesGroupMitigationProductParamsDateRange = "24wControl"
-)
-
-// Format results are returned in.
-type RadarAttackLayer7TimeseriesGroupMitigationProductParamsFormat string
-
-const (
- RadarAttackLayer7TimeseriesGroupMitigationProductParamsFormatJson RadarAttackLayer7TimeseriesGroupMitigationProductParamsFormat = "JSON"
- RadarAttackLayer7TimeseriesGroupMitigationProductParamsFormatCsv RadarAttackLayer7TimeseriesGroupMitigationProductParamsFormat = "CSV"
-)
-
-type RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod string
-
-const (
- RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodGet RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "GET"
- RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodPost RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "POST"
- RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodDelete RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "DELETE"
- RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodPut RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "PUT"
- RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodHead RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "HEAD"
- RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodPurge RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "PURGE"
- RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodOptions RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "OPTIONS"
- RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodPropfind RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "PROPFIND"
- RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodMkcol RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "MKCOL"
- RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodPatch RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "PATCH"
- RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodACL RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "ACL"
- RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodBcopy RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "BCOPY"
- RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodBdelete RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "BDELETE"
- RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodBmove RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "BMOVE"
- RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodBpropfind RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "BPROPFIND"
- RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodBproppatch RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "BPROPPATCH"
- RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodCheckin RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "CHECKIN"
- RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodCheckout RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "CHECKOUT"
- RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodConnect RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "CONNECT"
- RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodCopy RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "COPY"
- RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodLabel RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "LABEL"
- RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodLock RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "LOCK"
- RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodMerge RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "MERGE"
- RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodMkactivity RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "MKACTIVITY"
- RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodMkworkspace RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "MKWORKSPACE"
- RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodMove RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "MOVE"
- RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodNotify RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "NOTIFY"
- RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodOrderpatch RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "ORDERPATCH"
- RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodPoll RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "POLL"
- RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodProppatch RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "PROPPATCH"
- RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodReport RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "REPORT"
- RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodSearch RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "SEARCH"
- RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodSubscribe RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "SUBSCRIBE"
- RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodTrace RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "TRACE"
- RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodUncheckout RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "UNCHECKOUT"
- RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodUnlock RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "UNLOCK"
- RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodUnsubscribe RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "UNSUBSCRIBE"
- RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodUpdate RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "UPDATE"
- RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodVersioncontrol RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "VERSIONCONTROL"
- RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodBaselinecontrol RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "BASELINECONTROL"
- RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodXmsenumatts RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "XMSENUMATTS"
- RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodRpcOutData RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "RPC_OUT_DATA"
- RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodRpcInData RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "RPC_IN_DATA"
- RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodJson RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "JSON"
- RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodCook RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "COOK"
- RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodTrack RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod = "TRACK"
-)
-
-type RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPVersion string
-
-const (
- RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPVersionHttPv1 RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPVersion = "HTTPv1"
- RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPVersionHttPv2 RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPVersion = "HTTPv2"
- RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPVersionHttPv3 RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPVersion = "HTTPv3"
-)
-
-type RadarAttackLayer7TimeseriesGroupMitigationProductParamsIPVersion string
-
-const (
- RadarAttackLayer7TimeseriesGroupMitigationProductParamsIPVersionIPv4 RadarAttackLayer7TimeseriesGroupMitigationProductParamsIPVersion = "IPv4"
- RadarAttackLayer7TimeseriesGroupMitigationProductParamsIPVersionIPv6 RadarAttackLayer7TimeseriesGroupMitigationProductParamsIPVersion = "IPv6"
-)
-
-// Normalization method applied. Refer to
-// [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/).
-type RadarAttackLayer7TimeseriesGroupMitigationProductParamsNormalization string
-
-const (
- RadarAttackLayer7TimeseriesGroupMitigationProductParamsNormalizationPercentage RadarAttackLayer7TimeseriesGroupMitigationProductParamsNormalization = "PERCENTAGE"
- RadarAttackLayer7TimeseriesGroupMitigationProductParamsNormalizationMin0Max RadarAttackLayer7TimeseriesGroupMitigationProductParamsNormalization = "MIN0_MAX"
-)
-
-type RadarAttackLayer7TimeseriesGroupMitigationProductResponseEnvelope struct {
- Result RadarAttackLayer7TimeseriesGroupMitigationProductResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarAttackLayer7TimeseriesGroupMitigationProductResponseEnvelopeJSON `json:"-"`
-}
-
-// radarAttackLayer7TimeseriesGroupMitigationProductResponseEnvelopeJSON contains
-// the JSON metadata for the struct
-// [RadarAttackLayer7TimeseriesGroupMitigationProductResponseEnvelope]
-type radarAttackLayer7TimeseriesGroupMitigationProductResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7TimeseriesGroupMitigationProductResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TimeseriesGroupMitigationProductResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7TimeseriesGroupVerticalParams struct {
- // Aggregation interval results should be returned in (for example, in 15 minutes
- // or 1 hour intervals). Refer to
- // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
- AggInterval param.Field[RadarAttackLayer7TimeseriesGroupVerticalParamsAggInterval] `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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarAttackLayer7TimeseriesGroupVerticalParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Format results are returned in.
- Format param.Field[RadarAttackLayer7TimeseriesGroupVerticalParamsFormat] `query:"format"`
- // Filter for http method.
- HTTPMethod param.Field[[]RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethod] `query:"httpMethod"`
- // Filter for http version.
- HTTPVersion param.Field[[]RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPVersion] `query:"httpVersion"`
- // Filter for ip version.
- IPVersion param.Field[[]RadarAttackLayer7TimeseriesGroupVerticalParamsIPVersion] `query:"ipVersion"`
- // Limit the number of objects (eg browsers, verticals, etc) to the top items over
- // the time range.
- LimitPerGroup param.Field[int64] `query:"limitPerGroup"`
- // Array of comma separated list of locations (alpha-2 country codes). Start with
- // `-` to exclude from results. For example, `-US,PT` excludes results from the US,
- // but includes results from PT.
- Location param.Field[[]string] `query:"location"`
- // Array of L7 mitigation products.
- MitigationProduct param.Field[[]RadarAttackLayer7TimeseriesGroupVerticalParamsMitigationProduct] `query:"mitigationProduct"`
- // Array of names that will be used to name the series in responses.
- Name param.Field[[]string] `query:"name"`
- // Normalization method applied. Refer to
- // [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/).
- Normalization param.Field[RadarAttackLayer7TimeseriesGroupVerticalParamsNormalization] `query:"normalization"`
-}
-
-// URLQuery serializes [RadarAttackLayer7TimeseriesGroupVerticalParams]'s query
-// parameters as `url.Values`.
-func (r RadarAttackLayer7TimeseriesGroupVerticalParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Aggregation interval results should be returned in (for example, in 15 minutes
-// or 1 hour intervals). Refer to
-// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
-type RadarAttackLayer7TimeseriesGroupVerticalParamsAggInterval string
-
-const (
- RadarAttackLayer7TimeseriesGroupVerticalParamsAggInterval15m RadarAttackLayer7TimeseriesGroupVerticalParamsAggInterval = "15m"
- RadarAttackLayer7TimeseriesGroupVerticalParamsAggInterval1h RadarAttackLayer7TimeseriesGroupVerticalParamsAggInterval = "1h"
- RadarAttackLayer7TimeseriesGroupVerticalParamsAggInterval1d RadarAttackLayer7TimeseriesGroupVerticalParamsAggInterval = "1d"
- RadarAttackLayer7TimeseriesGroupVerticalParamsAggInterval1w RadarAttackLayer7TimeseriesGroupVerticalParamsAggInterval = "1w"
-)
-
-type RadarAttackLayer7TimeseriesGroupVerticalParamsDateRange string
-
-const (
- RadarAttackLayer7TimeseriesGroupVerticalParamsDateRange1d RadarAttackLayer7TimeseriesGroupVerticalParamsDateRange = "1d"
- RadarAttackLayer7TimeseriesGroupVerticalParamsDateRange2d RadarAttackLayer7TimeseriesGroupVerticalParamsDateRange = "2d"
- RadarAttackLayer7TimeseriesGroupVerticalParamsDateRange7d RadarAttackLayer7TimeseriesGroupVerticalParamsDateRange = "7d"
- RadarAttackLayer7TimeseriesGroupVerticalParamsDateRange14d RadarAttackLayer7TimeseriesGroupVerticalParamsDateRange = "14d"
- RadarAttackLayer7TimeseriesGroupVerticalParamsDateRange28d RadarAttackLayer7TimeseriesGroupVerticalParamsDateRange = "28d"
- RadarAttackLayer7TimeseriesGroupVerticalParamsDateRange12w RadarAttackLayer7TimeseriesGroupVerticalParamsDateRange = "12w"
- RadarAttackLayer7TimeseriesGroupVerticalParamsDateRange24w RadarAttackLayer7TimeseriesGroupVerticalParamsDateRange = "24w"
- RadarAttackLayer7TimeseriesGroupVerticalParamsDateRange52w RadarAttackLayer7TimeseriesGroupVerticalParamsDateRange = "52w"
- RadarAttackLayer7TimeseriesGroupVerticalParamsDateRange1dControl RadarAttackLayer7TimeseriesGroupVerticalParamsDateRange = "1dControl"
- RadarAttackLayer7TimeseriesGroupVerticalParamsDateRange2dControl RadarAttackLayer7TimeseriesGroupVerticalParamsDateRange = "2dControl"
- RadarAttackLayer7TimeseriesGroupVerticalParamsDateRange7dControl RadarAttackLayer7TimeseriesGroupVerticalParamsDateRange = "7dControl"
- RadarAttackLayer7TimeseriesGroupVerticalParamsDateRange14dControl RadarAttackLayer7TimeseriesGroupVerticalParamsDateRange = "14dControl"
- RadarAttackLayer7TimeseriesGroupVerticalParamsDateRange28dControl RadarAttackLayer7TimeseriesGroupVerticalParamsDateRange = "28dControl"
- RadarAttackLayer7TimeseriesGroupVerticalParamsDateRange12wControl RadarAttackLayer7TimeseriesGroupVerticalParamsDateRange = "12wControl"
- RadarAttackLayer7TimeseriesGroupVerticalParamsDateRange24wControl RadarAttackLayer7TimeseriesGroupVerticalParamsDateRange = "24wControl"
-)
-
-// Format results are returned in.
-type RadarAttackLayer7TimeseriesGroupVerticalParamsFormat string
-
-const (
- RadarAttackLayer7TimeseriesGroupVerticalParamsFormatJson RadarAttackLayer7TimeseriesGroupVerticalParamsFormat = "JSON"
- RadarAttackLayer7TimeseriesGroupVerticalParamsFormatCsv RadarAttackLayer7TimeseriesGroupVerticalParamsFormat = "CSV"
-)
-
-type RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethod string
-
-const (
- RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethodGet RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "GET"
- RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethodPost RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "POST"
- RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethodDelete RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "DELETE"
- RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethodPut RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "PUT"
- RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethodHead RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "HEAD"
- RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethodPurge RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "PURGE"
- RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethodOptions RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "OPTIONS"
- RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethodPropfind RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "PROPFIND"
- RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethodMkcol RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "MKCOL"
- RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethodPatch RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "PATCH"
- RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethodACL RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "ACL"
- RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethodBcopy RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "BCOPY"
- RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethodBdelete RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "BDELETE"
- RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethodBmove RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "BMOVE"
- RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethodBpropfind RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "BPROPFIND"
- RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethodBproppatch RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "BPROPPATCH"
- RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethodCheckin RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "CHECKIN"
- RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethodCheckout RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "CHECKOUT"
- RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethodConnect RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "CONNECT"
- RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethodCopy RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "COPY"
- RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethodLabel RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "LABEL"
- RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethodLock RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "LOCK"
- RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethodMerge RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "MERGE"
- RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethodMkactivity RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "MKACTIVITY"
- RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethodMkworkspace RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "MKWORKSPACE"
- RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethodMove RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "MOVE"
- RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethodNotify RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "NOTIFY"
- RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethodOrderpatch RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "ORDERPATCH"
- RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethodPoll RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "POLL"
- RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethodProppatch RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "PROPPATCH"
- RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethodReport RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "REPORT"
- RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethodSearch RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "SEARCH"
- RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethodSubscribe RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "SUBSCRIBE"
- RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethodTrace RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "TRACE"
- RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethodUncheckout RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "UNCHECKOUT"
- RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethodUnlock RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "UNLOCK"
- RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethodUnsubscribe RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "UNSUBSCRIBE"
- RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethodUpdate RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "UPDATE"
- RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethodVersioncontrol RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "VERSIONCONTROL"
- RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethodBaselinecontrol RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "BASELINECONTROL"
- RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethodXmsenumatts RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "XMSENUMATTS"
- RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethodRpcOutData RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "RPC_OUT_DATA"
- RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethodRpcInData RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "RPC_IN_DATA"
- RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethodJson RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "JSON"
- RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethodCook RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "COOK"
- RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethodTrack RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethod = "TRACK"
-)
-
-type RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPVersion string
-
-const (
- RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPVersionHttPv1 RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPVersion = "HTTPv1"
- RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPVersionHttPv2 RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPVersion = "HTTPv2"
- RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPVersionHttPv3 RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPVersion = "HTTPv3"
-)
-
-type RadarAttackLayer7TimeseriesGroupVerticalParamsIPVersion string
-
-const (
- RadarAttackLayer7TimeseriesGroupVerticalParamsIPVersionIPv4 RadarAttackLayer7TimeseriesGroupVerticalParamsIPVersion = "IPv4"
- RadarAttackLayer7TimeseriesGroupVerticalParamsIPVersionIPv6 RadarAttackLayer7TimeseriesGroupVerticalParamsIPVersion = "IPv6"
-)
-
-type RadarAttackLayer7TimeseriesGroupVerticalParamsMitigationProduct string
-
-const (
- RadarAttackLayer7TimeseriesGroupVerticalParamsMitigationProductDDOS RadarAttackLayer7TimeseriesGroupVerticalParamsMitigationProduct = "DDOS"
- RadarAttackLayer7TimeseriesGroupVerticalParamsMitigationProductWAF RadarAttackLayer7TimeseriesGroupVerticalParamsMitigationProduct = "WAF"
- RadarAttackLayer7TimeseriesGroupVerticalParamsMitigationProductBotManagement RadarAttackLayer7TimeseriesGroupVerticalParamsMitigationProduct = "BOT_MANAGEMENT"
- RadarAttackLayer7TimeseriesGroupVerticalParamsMitigationProductAccessRules RadarAttackLayer7TimeseriesGroupVerticalParamsMitigationProduct = "ACCESS_RULES"
- RadarAttackLayer7TimeseriesGroupVerticalParamsMitigationProductIPReputation RadarAttackLayer7TimeseriesGroupVerticalParamsMitigationProduct = "IP_REPUTATION"
- RadarAttackLayer7TimeseriesGroupVerticalParamsMitigationProductAPIShield RadarAttackLayer7TimeseriesGroupVerticalParamsMitigationProduct = "API_SHIELD"
- RadarAttackLayer7TimeseriesGroupVerticalParamsMitigationProductDataLossPrevention RadarAttackLayer7TimeseriesGroupVerticalParamsMitigationProduct = "DATA_LOSS_PREVENTION"
-)
-
-// Normalization method applied. Refer to
-// [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/).
-type RadarAttackLayer7TimeseriesGroupVerticalParamsNormalization string
-
-const (
- RadarAttackLayer7TimeseriesGroupVerticalParamsNormalizationPercentage RadarAttackLayer7TimeseriesGroupVerticalParamsNormalization = "PERCENTAGE"
- RadarAttackLayer7TimeseriesGroupVerticalParamsNormalizationMin0Max RadarAttackLayer7TimeseriesGroupVerticalParamsNormalization = "MIN0_MAX"
-)
-
-type RadarAttackLayer7TimeseriesGroupVerticalResponseEnvelope struct {
- Result RadarAttackLayer7TimeseriesGroupVerticalResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarAttackLayer7TimeseriesGroupVerticalResponseEnvelopeJSON `json:"-"`
-}
-
-// radarAttackLayer7TimeseriesGroupVerticalResponseEnvelopeJSON contains the JSON
-// metadata for the struct
-// [RadarAttackLayer7TimeseriesGroupVerticalResponseEnvelope]
-type radarAttackLayer7TimeseriesGroupVerticalResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7TimeseriesGroupVerticalResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TimeseriesGroupVerticalResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
diff --git a/radarattacklayer7timeseriesgroup_test.go b/radarattacklayer7timeseriesgroup_test.go
deleted file mode 100644
index 5185540c10e..00000000000
--- a/radarattacklayer7timeseriesgroup_test.go
+++ /dev/null
@@ -1,320 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
- "time"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRadarAttackLayer7TimeseriesGroupGetWithOptionalParams(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"),
- )
- _, 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()}),
- Format: cloudflare.F(cloudflare.RadarAttackLayer7TimeseriesGroupGetParamsFormatJson),
- 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())
- }
-}
-
-func TestRadarAttackLayer7TimeseriesGroupHTTPMethodWithOptionalParams(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"),
- )
- _, 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()}),
- Format: cloudflare.F(cloudflare.RadarAttackLayer7TimeseriesGroupHTTPMethodParamsFormatJson),
- HTTPVersion: cloudflare.F([]cloudflare.RadarAttackLayer7TimeseriesGroupHTTPMethodParamsHTTPVersion{cloudflare.RadarAttackLayer7TimeseriesGroupHTTPMethodParamsHTTPVersionHttPv1, cloudflare.RadarAttackLayer7TimeseriesGroupHTTPMethodParamsHTTPVersionHttPv2, cloudflare.RadarAttackLayer7TimeseriesGroupHTTPMethodParamsHTTPVersionHttPv3}),
- IPVersion: cloudflare.F([]cloudflare.RadarAttackLayer7TimeseriesGroupHTTPMethodParamsIPVersion{cloudflare.RadarAttackLayer7TimeseriesGroupHTTPMethodParamsIPVersionIPv4, cloudflare.RadarAttackLayer7TimeseriesGroupHTTPMethodParamsIPVersionIPv6}),
- Location: cloudflare.F([]string{"string", "string", "string"}),
- MitigationProduct: cloudflare.F([]cloudflare.RadarAttackLayer7TimeseriesGroupHTTPMethodParamsMitigationProduct{cloudflare.RadarAttackLayer7TimeseriesGroupHTTPMethodParamsMitigationProductDDOS, cloudflare.RadarAttackLayer7TimeseriesGroupHTTPMethodParamsMitigationProductWAF, cloudflare.RadarAttackLayer7TimeseriesGroupHTTPMethodParamsMitigationProductBotManagement}),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- Normalization: cloudflare.F(cloudflare.RadarAttackLayer7TimeseriesGroupHTTPMethodParamsNormalizationPercentage),
- })
- 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())
- }
-}
-
-func TestRadarAttackLayer7TimeseriesGroupHTTPVersionWithOptionalParams(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"),
- )
- _, 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()}),
- Format: cloudflare.F(cloudflare.RadarAttackLayer7TimeseriesGroupHTTPVersionParamsFormatJson),
- HTTPMethod: cloudflare.F([]cloudflare.RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethod{cloudflare.RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodGet, cloudflare.RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodPost, cloudflare.RadarAttackLayer7TimeseriesGroupHTTPVersionParamsHTTPMethodDelete}),
- IPVersion: cloudflare.F([]cloudflare.RadarAttackLayer7TimeseriesGroupHTTPVersionParamsIPVersion{cloudflare.RadarAttackLayer7TimeseriesGroupHTTPVersionParamsIPVersionIPv4, cloudflare.RadarAttackLayer7TimeseriesGroupHTTPVersionParamsIPVersionIPv6}),
- Location: cloudflare.F([]string{"string", "string", "string"}),
- MitigationProduct: cloudflare.F([]cloudflare.RadarAttackLayer7TimeseriesGroupHTTPVersionParamsMitigationProduct{cloudflare.RadarAttackLayer7TimeseriesGroupHTTPVersionParamsMitigationProductDDOS, cloudflare.RadarAttackLayer7TimeseriesGroupHTTPVersionParamsMitigationProductWAF, cloudflare.RadarAttackLayer7TimeseriesGroupHTTPVersionParamsMitigationProductBotManagement}),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- Normalization: cloudflare.F(cloudflare.RadarAttackLayer7TimeseriesGroupHTTPVersionParamsNormalizationPercentage),
- })
- 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())
- }
-}
-
-func TestRadarAttackLayer7TimeseriesGroupIndustryWithOptionalParams(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"),
- )
- _, 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()}),
- Format: cloudflare.F(cloudflare.RadarAttackLayer7TimeseriesGroupIndustryParamsFormatJson),
- HTTPMethod: cloudflare.F([]cloudflare.RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethod{cloudflare.RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethodGet, cloudflare.RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethodPost, cloudflare.RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPMethodDelete}),
- HTTPVersion: cloudflare.F([]cloudflare.RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPVersion{cloudflare.RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPVersionHttPv1, cloudflare.RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPVersionHttPv2, cloudflare.RadarAttackLayer7TimeseriesGroupIndustryParamsHTTPVersionHttPv3}),
- IPVersion: cloudflare.F([]cloudflare.RadarAttackLayer7TimeseriesGroupIndustryParamsIPVersion{cloudflare.RadarAttackLayer7TimeseriesGroupIndustryParamsIPVersionIPv4, cloudflare.RadarAttackLayer7TimeseriesGroupIndustryParamsIPVersionIPv6}),
- LimitPerGroup: cloudflare.F(int64(4)),
- Location: cloudflare.F([]string{"string", "string", "string"}),
- MitigationProduct: cloudflare.F([]cloudflare.RadarAttackLayer7TimeseriesGroupIndustryParamsMitigationProduct{cloudflare.RadarAttackLayer7TimeseriesGroupIndustryParamsMitigationProductDDOS, cloudflare.RadarAttackLayer7TimeseriesGroupIndustryParamsMitigationProductWAF, cloudflare.RadarAttackLayer7TimeseriesGroupIndustryParamsMitigationProductBotManagement}),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- Normalization: cloudflare.F(cloudflare.RadarAttackLayer7TimeseriesGroupIndustryParamsNormalizationPercentage),
- })
- 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())
- }
-}
-
-func TestRadarAttackLayer7TimeseriesGroupIPVersionWithOptionalParams(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"),
- )
- _, 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()}),
- Format: cloudflare.F(cloudflare.RadarAttackLayer7TimeseriesGroupIPVersionParamsFormatJson),
- HTTPMethod: cloudflare.F([]cloudflare.RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethod{cloudflare.RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodGet, cloudflare.RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodPost, cloudflare.RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPMethodDelete}),
- HTTPVersion: cloudflare.F([]cloudflare.RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPVersion{cloudflare.RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPVersionHttPv1, cloudflare.RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPVersionHttPv2, cloudflare.RadarAttackLayer7TimeseriesGroupIPVersionParamsHTTPVersionHttPv3}),
- Location: cloudflare.F([]string{"string", "string", "string"}),
- MitigationProduct: cloudflare.F([]cloudflare.RadarAttackLayer7TimeseriesGroupIPVersionParamsMitigationProduct{cloudflare.RadarAttackLayer7TimeseriesGroupIPVersionParamsMitigationProductDDOS, cloudflare.RadarAttackLayer7TimeseriesGroupIPVersionParamsMitigationProductWAF, cloudflare.RadarAttackLayer7TimeseriesGroupIPVersionParamsMitigationProductBotManagement}),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- Normalization: cloudflare.F(cloudflare.RadarAttackLayer7TimeseriesGroupIPVersionParamsNormalizationPercentage),
- })
- 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())
- }
-}
-
-func TestRadarAttackLayer7TimeseriesGroupManagedRulesWithOptionalParams(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"),
- )
- _, 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()}),
- Format: cloudflare.F(cloudflare.RadarAttackLayer7TimeseriesGroupManagedRulesParamsFormatJson),
- HTTPMethod: cloudflare.F([]cloudflare.RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethod{cloudflare.RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodGet, cloudflare.RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodPost, cloudflare.RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPMethodDelete}),
- HTTPVersion: cloudflare.F([]cloudflare.RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPVersion{cloudflare.RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPVersionHttPv1, cloudflare.RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPVersionHttPv2, cloudflare.RadarAttackLayer7TimeseriesGroupManagedRulesParamsHTTPVersionHttPv3}),
- IPVersion: cloudflare.F([]cloudflare.RadarAttackLayer7TimeseriesGroupManagedRulesParamsIPVersion{cloudflare.RadarAttackLayer7TimeseriesGroupManagedRulesParamsIPVersionIPv4, cloudflare.RadarAttackLayer7TimeseriesGroupManagedRulesParamsIPVersionIPv6}),
- Location: cloudflare.F([]string{"string", "string", "string"}),
- MitigationProduct: cloudflare.F([]cloudflare.RadarAttackLayer7TimeseriesGroupManagedRulesParamsMitigationProduct{cloudflare.RadarAttackLayer7TimeseriesGroupManagedRulesParamsMitigationProductDDOS, cloudflare.RadarAttackLayer7TimeseriesGroupManagedRulesParamsMitigationProductWAF, cloudflare.RadarAttackLayer7TimeseriesGroupManagedRulesParamsMitigationProductBotManagement}),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- Normalization: cloudflare.F(cloudflare.RadarAttackLayer7TimeseriesGroupManagedRulesParamsNormalizationPercentage),
- })
- 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())
- }
-}
-
-func TestRadarAttackLayer7TimeseriesGroupMitigationProductWithOptionalParams(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"),
- )
- _, 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()}),
- Format: cloudflare.F(cloudflare.RadarAttackLayer7TimeseriesGroupMitigationProductParamsFormatJson),
- HTTPMethod: cloudflare.F([]cloudflare.RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethod{cloudflare.RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodGet, cloudflare.RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodPost, cloudflare.RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPMethodDelete}),
- HTTPVersion: cloudflare.F([]cloudflare.RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPVersion{cloudflare.RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPVersionHttPv1, cloudflare.RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPVersionHttPv2, cloudflare.RadarAttackLayer7TimeseriesGroupMitigationProductParamsHTTPVersionHttPv3}),
- IPVersion: cloudflare.F([]cloudflare.RadarAttackLayer7TimeseriesGroupMitigationProductParamsIPVersion{cloudflare.RadarAttackLayer7TimeseriesGroupMitigationProductParamsIPVersionIPv4, cloudflare.RadarAttackLayer7TimeseriesGroupMitigationProductParamsIPVersionIPv6}),
- Location: cloudflare.F([]string{"string", "string", "string"}),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- Normalization: cloudflare.F(cloudflare.RadarAttackLayer7TimeseriesGroupMitigationProductParamsNormalizationPercentage),
- })
- 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())
- }
-}
-
-func TestRadarAttackLayer7TimeseriesGroupVerticalWithOptionalParams(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"),
- )
- _, 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()}),
- Format: cloudflare.F(cloudflare.RadarAttackLayer7TimeseriesGroupVerticalParamsFormatJson),
- HTTPMethod: cloudflare.F([]cloudflare.RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethod{cloudflare.RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethodGet, cloudflare.RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethodPost, cloudflare.RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPMethodDelete}),
- HTTPVersion: cloudflare.F([]cloudflare.RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPVersion{cloudflare.RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPVersionHttPv1, cloudflare.RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPVersionHttPv2, cloudflare.RadarAttackLayer7TimeseriesGroupVerticalParamsHTTPVersionHttPv3}),
- IPVersion: cloudflare.F([]cloudflare.RadarAttackLayer7TimeseriesGroupVerticalParamsIPVersion{cloudflare.RadarAttackLayer7TimeseriesGroupVerticalParamsIPVersionIPv4, cloudflare.RadarAttackLayer7TimeseriesGroupVerticalParamsIPVersionIPv6}),
- LimitPerGroup: cloudflare.F(int64(4)),
- Location: cloudflare.F([]string{"string", "string", "string"}),
- MitigationProduct: cloudflare.F([]cloudflare.RadarAttackLayer7TimeseriesGroupVerticalParamsMitigationProduct{cloudflare.RadarAttackLayer7TimeseriesGroupVerticalParamsMitigationProductDDOS, cloudflare.RadarAttackLayer7TimeseriesGroupVerticalParamsMitigationProductWAF, cloudflare.RadarAttackLayer7TimeseriesGroupVerticalParamsMitigationProductBotManagement}),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- Normalization: cloudflare.F(cloudflare.RadarAttackLayer7TimeseriesGroupVerticalParamsNormalizationPercentage),
- })
- 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/radarattacklayer7top.go b/radarattacklayer7top.go
deleted file mode 100644
index e595f843f8e..00000000000
--- a/radarattacklayer7top.go
+++ /dev/null
@@ -1,842 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarAttackLayer7TopService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewRadarAttackLayer7TopService]
-// method instead.
-type RadarAttackLayer7TopService struct {
- Options []option.RequestOption
- Locations *RadarAttackLayer7TopLocationService
- Ases *RadarAttackLayer7TopAseService
-}
-
-// NewRadarAttackLayer7TopService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewRadarAttackLayer7TopService(opts ...option.RequestOption) (r *RadarAttackLayer7TopService) {
- r = &RadarAttackLayer7TopService{}
- r.Options = opts
- r.Locations = NewRadarAttackLayer7TopLocationService(opts...)
- r.Ases = NewRadarAttackLayer7TopAseService(opts...)
- return
-}
-
-// Get the top attacks from origin to target location. Values are a percentage out
-// of the total layer 7 attacks (with billing country). The attack magnitude can be
-// defined by the number of mitigated requests or by the number of zones affected.
-// You can optionally limit the number of attacks per origin/target location
-// (useful if all the top attacks are from or to the same location).
-func (r *RadarAttackLayer7TopService) Attacks(ctx context.Context, query RadarAttackLayer7TopAttacksParams, opts ...option.RequestOption) (res *RadarAttackLayer7TopAttacksResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarAttackLayer7TopAttacksResponseEnvelope
- path := "radar/attacks/layer7/top/attacks"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Get the Industry of attacks.
-func (r *RadarAttackLayer7TopService) Industry(ctx context.Context, query RadarAttackLayer7TopIndustryParams, opts ...option.RequestOption) (res *RadarAttackLayer7TopIndustryResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarAttackLayer7TopIndustryResponseEnvelope
- path := "radar/attacks/layer7/top/industry"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Get the Verticals of attacks.
-func (r *RadarAttackLayer7TopService) Vertical(ctx context.Context, query RadarAttackLayer7TopVerticalParams, opts ...option.RequestOption) (res *RadarAttackLayer7TopVerticalResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarAttackLayer7TopVerticalResponseEnvelope
- path := "radar/attacks/layer7/top/vertical"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type RadarAttackLayer7TopAttacksResponse struct {
- Meta RadarAttackLayer7TopAttacksResponseMeta `json:"meta,required"`
- Top0 []RadarAttackLayer7TopAttacksResponseTop0 `json:"top_0,required"`
- JSON radarAttackLayer7TopAttacksResponseJSON `json:"-"`
-}
-
-// radarAttackLayer7TopAttacksResponseJSON contains the JSON metadata for the
-// struct [RadarAttackLayer7TopAttacksResponse]
-type radarAttackLayer7TopAttacksResponseJSON struct {
- Meta apijson.Field
- Top0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7TopAttacksResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TopAttacksResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7TopAttacksResponseMeta struct {
- DateRange []RadarAttackLayer7TopAttacksResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- ConfidenceInfo RadarAttackLayer7TopAttacksResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarAttackLayer7TopAttacksResponseMetaJSON `json:"-"`
-}
-
-// radarAttackLayer7TopAttacksResponseMetaJSON contains the JSON metadata for the
-// struct [RadarAttackLayer7TopAttacksResponseMeta]
-type radarAttackLayer7TopAttacksResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7TopAttacksResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TopAttacksResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7TopAttacksResponseMetaDateRange 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 radarAttackLayer7TopAttacksResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarAttackLayer7TopAttacksResponseMetaDateRangeJSON contains the JSON metadata
-// for the struct [RadarAttackLayer7TopAttacksResponseMetaDateRange]
-type radarAttackLayer7TopAttacksResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7TopAttacksResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TopAttacksResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7TopAttacksResponseMetaConfidenceInfo struct {
- Annotations []RadarAttackLayer7TopAttacksResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarAttackLayer7TopAttacksResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarAttackLayer7TopAttacksResponseMetaConfidenceInfoJSON contains the JSON
-// metadata for the struct [RadarAttackLayer7TopAttacksResponseMetaConfidenceInfo]
-type radarAttackLayer7TopAttacksResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7TopAttacksResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TopAttacksResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7TopAttacksResponseMetaConfidenceInfoAnnotation 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 radarAttackLayer7TopAttacksResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarAttackLayer7TopAttacksResponseMetaConfidenceInfoAnnotationJSON contains the
-// JSON metadata for the struct
-// [RadarAttackLayer7TopAttacksResponseMetaConfidenceInfoAnnotation]
-type radarAttackLayer7TopAttacksResponseMetaConfidenceInfoAnnotationJSON 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 *RadarAttackLayer7TopAttacksResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TopAttacksResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7TopAttacksResponseTop0 struct {
- OriginCountryAlpha2 string `json:"originCountryAlpha2,required"`
- OriginCountryName string `json:"originCountryName,required"`
- TargetCountryAlpha2 string `json:"targetCountryAlpha2,required"`
- TargetCountryName string `json:"targetCountryName,required"`
- Value string `json:"value,required"`
- JSON radarAttackLayer7TopAttacksResponseTop0JSON `json:"-"`
-}
-
-// radarAttackLayer7TopAttacksResponseTop0JSON contains the JSON metadata for the
-// struct [RadarAttackLayer7TopAttacksResponseTop0]
-type radarAttackLayer7TopAttacksResponseTop0JSON struct {
- OriginCountryAlpha2 apijson.Field
- OriginCountryName apijson.Field
- TargetCountryAlpha2 apijson.Field
- TargetCountryName apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7TopAttacksResponseTop0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TopAttacksResponseTop0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7TopIndustryResponse struct {
- Meta RadarAttackLayer7TopIndustryResponseMeta `json:"meta,required"`
- Top0 []RadarAttackLayer7TopIndustryResponseTop0 `json:"top_0,required"`
- JSON radarAttackLayer7TopIndustryResponseJSON `json:"-"`
-}
-
-// radarAttackLayer7TopIndustryResponseJSON contains the JSON metadata for the
-// struct [RadarAttackLayer7TopIndustryResponse]
-type radarAttackLayer7TopIndustryResponseJSON struct {
- Meta apijson.Field
- Top0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7TopIndustryResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TopIndustryResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7TopIndustryResponseMeta struct {
- DateRange []RadarAttackLayer7TopIndustryResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- ConfidenceInfo RadarAttackLayer7TopIndustryResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarAttackLayer7TopIndustryResponseMetaJSON `json:"-"`
-}
-
-// radarAttackLayer7TopIndustryResponseMetaJSON contains the JSON metadata for the
-// struct [RadarAttackLayer7TopIndustryResponseMeta]
-type radarAttackLayer7TopIndustryResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7TopIndustryResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TopIndustryResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7TopIndustryResponseMetaDateRange 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 radarAttackLayer7TopIndustryResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarAttackLayer7TopIndustryResponseMetaDateRangeJSON contains the JSON metadata
-// for the struct [RadarAttackLayer7TopIndustryResponseMetaDateRange]
-type radarAttackLayer7TopIndustryResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7TopIndustryResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TopIndustryResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7TopIndustryResponseMetaConfidenceInfo struct {
- Annotations []RadarAttackLayer7TopIndustryResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarAttackLayer7TopIndustryResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarAttackLayer7TopIndustryResponseMetaConfidenceInfoJSON contains the JSON
-// metadata for the struct [RadarAttackLayer7TopIndustryResponseMetaConfidenceInfo]
-type radarAttackLayer7TopIndustryResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7TopIndustryResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TopIndustryResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7TopIndustryResponseMetaConfidenceInfoAnnotation 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 radarAttackLayer7TopIndustryResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarAttackLayer7TopIndustryResponseMetaConfidenceInfoAnnotationJSON contains
-// the JSON metadata for the struct
-// [RadarAttackLayer7TopIndustryResponseMetaConfidenceInfoAnnotation]
-type radarAttackLayer7TopIndustryResponseMetaConfidenceInfoAnnotationJSON 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 *RadarAttackLayer7TopIndustryResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TopIndustryResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7TopIndustryResponseTop0 struct {
- Name string `json:"name,required"`
- Value string `json:"value,required"`
- JSON radarAttackLayer7TopIndustryResponseTop0JSON `json:"-"`
-}
-
-// radarAttackLayer7TopIndustryResponseTop0JSON contains the JSON metadata for the
-// struct [RadarAttackLayer7TopIndustryResponseTop0]
-type radarAttackLayer7TopIndustryResponseTop0JSON struct {
- Name apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7TopIndustryResponseTop0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TopIndustryResponseTop0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7TopVerticalResponse struct {
- Meta RadarAttackLayer7TopVerticalResponseMeta `json:"meta,required"`
- Top0 []RadarAttackLayer7TopVerticalResponseTop0 `json:"top_0,required"`
- JSON radarAttackLayer7TopVerticalResponseJSON `json:"-"`
-}
-
-// radarAttackLayer7TopVerticalResponseJSON contains the JSON metadata for the
-// struct [RadarAttackLayer7TopVerticalResponse]
-type radarAttackLayer7TopVerticalResponseJSON struct {
- Meta apijson.Field
- Top0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7TopVerticalResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TopVerticalResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7TopVerticalResponseMeta struct {
- DateRange []RadarAttackLayer7TopVerticalResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- ConfidenceInfo RadarAttackLayer7TopVerticalResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarAttackLayer7TopVerticalResponseMetaJSON `json:"-"`
-}
-
-// radarAttackLayer7TopVerticalResponseMetaJSON contains the JSON metadata for the
-// struct [RadarAttackLayer7TopVerticalResponseMeta]
-type radarAttackLayer7TopVerticalResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7TopVerticalResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TopVerticalResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7TopVerticalResponseMetaDateRange 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 radarAttackLayer7TopVerticalResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarAttackLayer7TopVerticalResponseMetaDateRangeJSON contains the JSON metadata
-// for the struct [RadarAttackLayer7TopVerticalResponseMetaDateRange]
-type radarAttackLayer7TopVerticalResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7TopVerticalResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TopVerticalResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7TopVerticalResponseMetaConfidenceInfo struct {
- Annotations []RadarAttackLayer7TopVerticalResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarAttackLayer7TopVerticalResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarAttackLayer7TopVerticalResponseMetaConfidenceInfoJSON contains the JSON
-// metadata for the struct [RadarAttackLayer7TopVerticalResponseMetaConfidenceInfo]
-type radarAttackLayer7TopVerticalResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7TopVerticalResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TopVerticalResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7TopVerticalResponseMetaConfidenceInfoAnnotation 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 radarAttackLayer7TopVerticalResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarAttackLayer7TopVerticalResponseMetaConfidenceInfoAnnotationJSON contains
-// the JSON metadata for the struct
-// [RadarAttackLayer7TopVerticalResponseMetaConfidenceInfoAnnotation]
-type radarAttackLayer7TopVerticalResponseMetaConfidenceInfoAnnotationJSON 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 *RadarAttackLayer7TopVerticalResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TopVerticalResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7TopVerticalResponseTop0 struct {
- Name string `json:"name,required"`
- Value string `json:"value,required"`
- JSON radarAttackLayer7TopVerticalResponseTop0JSON `json:"-"`
-}
-
-// radarAttackLayer7TopVerticalResponseTop0JSON contains the JSON metadata for the
-// struct [RadarAttackLayer7TopVerticalResponseTop0]
-type radarAttackLayer7TopVerticalResponseTop0JSON struct {
- Name apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7TopVerticalResponseTop0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TopVerticalResponseTop0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7TopAttacksParams 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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarAttackLayer7TopAttacksParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Format results are returned in.
- Format param.Field[RadarAttackLayer7TopAttacksParamsFormat] `query:"format"`
- // Limit the number of objects in the response.
- Limit param.Field[int64] `query:"limit"`
- // Array of attack origin/target location attack limits. Together with
- // `limitPerLocation`, limits how many objects will be fetched per origin/target
- // location.
- LimitDirection param.Field[RadarAttackLayer7TopAttacksParamsLimitDirection] `query:"limitDirection"`
- // Limit the number of attacks per origin/target (refer to `limitDirection`
- // parameter) location.
- LimitPerLocation param.Field[int64] `query:"limitPerLocation"`
- // 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"`
- // Attack magnitude can be defined by total requests mitigated or by total zones
- // attacked.
- Magnitude param.Field[RadarAttackLayer7TopAttacksParamsMagnitude] `query:"magnitude"`
- // Array of names that will be used to name the series in responses.
- Name param.Field[[]string] `query:"name"`
-}
-
-// URLQuery serializes [RadarAttackLayer7TopAttacksParams]'s query parameters as
-// `url.Values`.
-func (r RadarAttackLayer7TopAttacksParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type RadarAttackLayer7TopAttacksParamsDateRange string
-
-const (
- RadarAttackLayer7TopAttacksParamsDateRange1d RadarAttackLayer7TopAttacksParamsDateRange = "1d"
- RadarAttackLayer7TopAttacksParamsDateRange2d RadarAttackLayer7TopAttacksParamsDateRange = "2d"
- RadarAttackLayer7TopAttacksParamsDateRange7d RadarAttackLayer7TopAttacksParamsDateRange = "7d"
- RadarAttackLayer7TopAttacksParamsDateRange14d RadarAttackLayer7TopAttacksParamsDateRange = "14d"
- RadarAttackLayer7TopAttacksParamsDateRange28d RadarAttackLayer7TopAttacksParamsDateRange = "28d"
- RadarAttackLayer7TopAttacksParamsDateRange12w RadarAttackLayer7TopAttacksParamsDateRange = "12w"
- RadarAttackLayer7TopAttacksParamsDateRange24w RadarAttackLayer7TopAttacksParamsDateRange = "24w"
- RadarAttackLayer7TopAttacksParamsDateRange52w RadarAttackLayer7TopAttacksParamsDateRange = "52w"
- RadarAttackLayer7TopAttacksParamsDateRange1dControl RadarAttackLayer7TopAttacksParamsDateRange = "1dControl"
- RadarAttackLayer7TopAttacksParamsDateRange2dControl RadarAttackLayer7TopAttacksParamsDateRange = "2dControl"
- RadarAttackLayer7TopAttacksParamsDateRange7dControl RadarAttackLayer7TopAttacksParamsDateRange = "7dControl"
- RadarAttackLayer7TopAttacksParamsDateRange14dControl RadarAttackLayer7TopAttacksParamsDateRange = "14dControl"
- RadarAttackLayer7TopAttacksParamsDateRange28dControl RadarAttackLayer7TopAttacksParamsDateRange = "28dControl"
- RadarAttackLayer7TopAttacksParamsDateRange12wControl RadarAttackLayer7TopAttacksParamsDateRange = "12wControl"
- RadarAttackLayer7TopAttacksParamsDateRange24wControl RadarAttackLayer7TopAttacksParamsDateRange = "24wControl"
-)
-
-// Format results are returned in.
-type RadarAttackLayer7TopAttacksParamsFormat string
-
-const (
- RadarAttackLayer7TopAttacksParamsFormatJson RadarAttackLayer7TopAttacksParamsFormat = "JSON"
- RadarAttackLayer7TopAttacksParamsFormatCsv RadarAttackLayer7TopAttacksParamsFormat = "CSV"
-)
-
-// Array of attack origin/target location attack limits. Together with
-// `limitPerLocation`, limits how many objects will be fetched per origin/target
-// location.
-type RadarAttackLayer7TopAttacksParamsLimitDirection string
-
-const (
- RadarAttackLayer7TopAttacksParamsLimitDirectionOrigin RadarAttackLayer7TopAttacksParamsLimitDirection = "ORIGIN"
- RadarAttackLayer7TopAttacksParamsLimitDirectionTarget RadarAttackLayer7TopAttacksParamsLimitDirection = "TARGET"
-)
-
-// Attack magnitude can be defined by total requests mitigated or by total zones
-// attacked.
-type RadarAttackLayer7TopAttacksParamsMagnitude string
-
-const (
- RadarAttackLayer7TopAttacksParamsMagnitudeAffectedZones RadarAttackLayer7TopAttacksParamsMagnitude = "AFFECTED_ZONES"
- RadarAttackLayer7TopAttacksParamsMagnitudeMitigatedRequests RadarAttackLayer7TopAttacksParamsMagnitude = "MITIGATED_REQUESTS"
-)
-
-type RadarAttackLayer7TopAttacksResponseEnvelope struct {
- Result RadarAttackLayer7TopAttacksResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarAttackLayer7TopAttacksResponseEnvelopeJSON `json:"-"`
-}
-
-// radarAttackLayer7TopAttacksResponseEnvelopeJSON contains the JSON metadata for
-// the struct [RadarAttackLayer7TopAttacksResponseEnvelope]
-type radarAttackLayer7TopAttacksResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7TopAttacksResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TopAttacksResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7TopIndustryParams 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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarAttackLayer7TopIndustryParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Format results are returned in.
- Format param.Field[RadarAttackLayer7TopIndustryParamsFormat] `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 [RadarAttackLayer7TopIndustryParams]'s query parameters as
-// `url.Values`.
-func (r RadarAttackLayer7TopIndustryParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type RadarAttackLayer7TopIndustryParamsDateRange string
-
-const (
- RadarAttackLayer7TopIndustryParamsDateRange1d RadarAttackLayer7TopIndustryParamsDateRange = "1d"
- RadarAttackLayer7TopIndustryParamsDateRange2d RadarAttackLayer7TopIndustryParamsDateRange = "2d"
- RadarAttackLayer7TopIndustryParamsDateRange7d RadarAttackLayer7TopIndustryParamsDateRange = "7d"
- RadarAttackLayer7TopIndustryParamsDateRange14d RadarAttackLayer7TopIndustryParamsDateRange = "14d"
- RadarAttackLayer7TopIndustryParamsDateRange28d RadarAttackLayer7TopIndustryParamsDateRange = "28d"
- RadarAttackLayer7TopIndustryParamsDateRange12w RadarAttackLayer7TopIndustryParamsDateRange = "12w"
- RadarAttackLayer7TopIndustryParamsDateRange24w RadarAttackLayer7TopIndustryParamsDateRange = "24w"
- RadarAttackLayer7TopIndustryParamsDateRange52w RadarAttackLayer7TopIndustryParamsDateRange = "52w"
- RadarAttackLayer7TopIndustryParamsDateRange1dControl RadarAttackLayer7TopIndustryParamsDateRange = "1dControl"
- RadarAttackLayer7TopIndustryParamsDateRange2dControl RadarAttackLayer7TopIndustryParamsDateRange = "2dControl"
- RadarAttackLayer7TopIndustryParamsDateRange7dControl RadarAttackLayer7TopIndustryParamsDateRange = "7dControl"
- RadarAttackLayer7TopIndustryParamsDateRange14dControl RadarAttackLayer7TopIndustryParamsDateRange = "14dControl"
- RadarAttackLayer7TopIndustryParamsDateRange28dControl RadarAttackLayer7TopIndustryParamsDateRange = "28dControl"
- RadarAttackLayer7TopIndustryParamsDateRange12wControl RadarAttackLayer7TopIndustryParamsDateRange = "12wControl"
- RadarAttackLayer7TopIndustryParamsDateRange24wControl RadarAttackLayer7TopIndustryParamsDateRange = "24wControl"
-)
-
-// Format results are returned in.
-type RadarAttackLayer7TopIndustryParamsFormat string
-
-const (
- RadarAttackLayer7TopIndustryParamsFormatJson RadarAttackLayer7TopIndustryParamsFormat = "JSON"
- RadarAttackLayer7TopIndustryParamsFormatCsv RadarAttackLayer7TopIndustryParamsFormat = "CSV"
-)
-
-type RadarAttackLayer7TopIndustryResponseEnvelope struct {
- Result RadarAttackLayer7TopIndustryResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarAttackLayer7TopIndustryResponseEnvelopeJSON `json:"-"`
-}
-
-// radarAttackLayer7TopIndustryResponseEnvelopeJSON contains the JSON metadata for
-// the struct [RadarAttackLayer7TopIndustryResponseEnvelope]
-type radarAttackLayer7TopIndustryResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7TopIndustryResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TopIndustryResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7TopVerticalParams 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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarAttackLayer7TopVerticalParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Format results are returned in.
- Format param.Field[RadarAttackLayer7TopVerticalParamsFormat] `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 [RadarAttackLayer7TopVerticalParams]'s query parameters as
-// `url.Values`.
-func (r RadarAttackLayer7TopVerticalParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type RadarAttackLayer7TopVerticalParamsDateRange string
-
-const (
- RadarAttackLayer7TopVerticalParamsDateRange1d RadarAttackLayer7TopVerticalParamsDateRange = "1d"
- RadarAttackLayer7TopVerticalParamsDateRange2d RadarAttackLayer7TopVerticalParamsDateRange = "2d"
- RadarAttackLayer7TopVerticalParamsDateRange7d RadarAttackLayer7TopVerticalParamsDateRange = "7d"
- RadarAttackLayer7TopVerticalParamsDateRange14d RadarAttackLayer7TopVerticalParamsDateRange = "14d"
- RadarAttackLayer7TopVerticalParamsDateRange28d RadarAttackLayer7TopVerticalParamsDateRange = "28d"
- RadarAttackLayer7TopVerticalParamsDateRange12w RadarAttackLayer7TopVerticalParamsDateRange = "12w"
- RadarAttackLayer7TopVerticalParamsDateRange24w RadarAttackLayer7TopVerticalParamsDateRange = "24w"
- RadarAttackLayer7TopVerticalParamsDateRange52w RadarAttackLayer7TopVerticalParamsDateRange = "52w"
- RadarAttackLayer7TopVerticalParamsDateRange1dControl RadarAttackLayer7TopVerticalParamsDateRange = "1dControl"
- RadarAttackLayer7TopVerticalParamsDateRange2dControl RadarAttackLayer7TopVerticalParamsDateRange = "2dControl"
- RadarAttackLayer7TopVerticalParamsDateRange7dControl RadarAttackLayer7TopVerticalParamsDateRange = "7dControl"
- RadarAttackLayer7TopVerticalParamsDateRange14dControl RadarAttackLayer7TopVerticalParamsDateRange = "14dControl"
- RadarAttackLayer7TopVerticalParamsDateRange28dControl RadarAttackLayer7TopVerticalParamsDateRange = "28dControl"
- RadarAttackLayer7TopVerticalParamsDateRange12wControl RadarAttackLayer7TopVerticalParamsDateRange = "12wControl"
- RadarAttackLayer7TopVerticalParamsDateRange24wControl RadarAttackLayer7TopVerticalParamsDateRange = "24wControl"
-)
-
-// Format results are returned in.
-type RadarAttackLayer7TopVerticalParamsFormat string
-
-const (
- RadarAttackLayer7TopVerticalParamsFormatJson RadarAttackLayer7TopVerticalParamsFormat = "JSON"
- RadarAttackLayer7TopVerticalParamsFormatCsv RadarAttackLayer7TopVerticalParamsFormat = "CSV"
-)
-
-type RadarAttackLayer7TopVerticalResponseEnvelope struct {
- Result RadarAttackLayer7TopVerticalResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarAttackLayer7TopVerticalResponseEnvelopeJSON `json:"-"`
-}
-
-// radarAttackLayer7TopVerticalResponseEnvelopeJSON contains the JSON metadata for
-// the struct [RadarAttackLayer7TopVerticalResponseEnvelope]
-type radarAttackLayer7TopVerticalResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7TopVerticalResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TopVerticalResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
diff --git a/radarattacklayer7top_test.go b/radarattacklayer7top_test.go
deleted file mode 100644
index 44e921138d7..00000000000
--- a/radarattacklayer7top_test.go
+++ /dev/null
@@ -1,120 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
- "time"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRadarAttackLayer7TopAttacksWithOptionalParams(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"),
- )
- _, 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()}),
- Format: cloudflare.F(cloudflare.RadarAttackLayer7TopAttacksParamsFormatJson),
- Limit: cloudflare.F(int64(5)),
- LimitDirection: cloudflare.F(cloudflare.RadarAttackLayer7TopAttacksParamsLimitDirectionOrigin),
- LimitPerLocation: cloudflare.F(int64(10)),
- Location: cloudflare.F([]string{"string", "string", "string"}),
- Magnitude: cloudflare.F(cloudflare.RadarAttackLayer7TopAttacksParamsMagnitudeMitigatedRequests),
- 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())
- }
-}
-
-func TestRadarAttackLayer7TopIndustryWithOptionalParams(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"),
- )
- _, 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()}),
- Format: cloudflare.F(cloudflare.RadarAttackLayer7TopIndustryParamsFormatJson),
- 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())
- }
-}
-
-func TestRadarAttackLayer7TopVerticalWithOptionalParams(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"),
- )
- _, 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()}),
- Format: cloudflare.F(cloudflare.RadarAttackLayer7TopVerticalParamsFormatJson),
- 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/radarattacklayer7topase.go b/radarattacklayer7topase.go
deleted file mode 100644
index 750145f3d60..00000000000
--- a/radarattacklayer7topase.go
+++ /dev/null
@@ -1,292 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarAttackLayer7TopAseService contains methods and other services that help
-// with interacting with the cloudflare API. Note, unlike clients, this service
-// does not read variables from the environment automatically. You should not
-// instantiate this service directly, and instead use the
-// [NewRadarAttackLayer7TopAseService] method instead.
-type RadarAttackLayer7TopAseService struct {
- Options []option.RequestOption
-}
-
-// NewRadarAttackLayer7TopAseService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewRadarAttackLayer7TopAseService(opts ...option.RequestOption) (r *RadarAttackLayer7TopAseService) {
- r = &RadarAttackLayer7TopAseService{}
- r.Options = opts
- return
-}
-
-// Get the top origin Autonomous Systems of and by layer 7 attacks. Values are a
-// percentage out of the total layer 7 attacks. The origin Autonomous Systems is
-// determined by the client IP.
-func (r *RadarAttackLayer7TopAseService) Origin(ctx context.Context, query RadarAttackLayer7TopAseOriginParams, opts ...option.RequestOption) (res *RadarAttackLayer7TopAseOriginResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarAttackLayer7TopAseOriginResponseEnvelope
- path := "radar/attacks/layer7/top/ases/origin"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type RadarAttackLayer7TopAseOriginResponse struct {
- Meta RadarAttackLayer7TopAseOriginResponseMeta `json:"meta,required"`
- Top0 []RadarAttackLayer7TopAseOriginResponseTop0 `json:"top_0,required"`
- JSON radarAttackLayer7TopAseOriginResponseJSON `json:"-"`
-}
-
-// radarAttackLayer7TopAseOriginResponseJSON contains the JSON metadata for the
-// struct [RadarAttackLayer7TopAseOriginResponse]
-type radarAttackLayer7TopAseOriginResponseJSON struct {
- Meta apijson.Field
- Top0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7TopAseOriginResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TopAseOriginResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7TopAseOriginResponseMeta struct {
- DateRange []RadarAttackLayer7TopAseOriginResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- ConfidenceInfo RadarAttackLayer7TopAseOriginResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarAttackLayer7TopAseOriginResponseMetaJSON `json:"-"`
-}
-
-// radarAttackLayer7TopAseOriginResponseMetaJSON contains the JSON metadata for the
-// struct [RadarAttackLayer7TopAseOriginResponseMeta]
-type radarAttackLayer7TopAseOriginResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7TopAseOriginResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TopAseOriginResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7TopAseOriginResponseMetaDateRange 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 radarAttackLayer7TopAseOriginResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarAttackLayer7TopAseOriginResponseMetaDateRangeJSON contains the JSON
-// metadata for the struct [RadarAttackLayer7TopAseOriginResponseMetaDateRange]
-type radarAttackLayer7TopAseOriginResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7TopAseOriginResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TopAseOriginResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7TopAseOriginResponseMetaConfidenceInfo struct {
- Annotations []RadarAttackLayer7TopAseOriginResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarAttackLayer7TopAseOriginResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarAttackLayer7TopAseOriginResponseMetaConfidenceInfoJSON contains the JSON
-// metadata for the struct
-// [RadarAttackLayer7TopAseOriginResponseMetaConfidenceInfo]
-type radarAttackLayer7TopAseOriginResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7TopAseOriginResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TopAseOriginResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7TopAseOriginResponseMetaConfidenceInfoAnnotation 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 radarAttackLayer7TopAseOriginResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarAttackLayer7TopAseOriginResponseMetaConfidenceInfoAnnotationJSON contains
-// the JSON metadata for the struct
-// [RadarAttackLayer7TopAseOriginResponseMetaConfidenceInfoAnnotation]
-type radarAttackLayer7TopAseOriginResponseMetaConfidenceInfoAnnotationJSON 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 *RadarAttackLayer7TopAseOriginResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TopAseOriginResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7TopAseOriginResponseTop0 struct {
- OriginASN string `json:"originAsn,required"`
- OriginASNName string `json:"originAsnName,required"`
- Rank float64 `json:"rank,required"`
- Value string `json:"value,required"`
- JSON radarAttackLayer7TopAseOriginResponseTop0JSON `json:"-"`
-}
-
-// radarAttackLayer7TopAseOriginResponseTop0JSON contains the JSON metadata for the
-// struct [RadarAttackLayer7TopAseOriginResponseTop0]
-type radarAttackLayer7TopAseOriginResponseTop0JSON struct {
- OriginASN apijson.Field
- OriginASNName apijson.Field
- Rank apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7TopAseOriginResponseTop0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TopAseOriginResponseTop0JSON) RawJSON() string {
- return r.raw
-}
-
-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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarAttackLayer7TopAseOriginParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Format results are returned in.
- Format param.Field[RadarAttackLayer7TopAseOriginParamsFormat] `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 [RadarAttackLayer7TopAseOriginParams]'s query parameters as
-// `url.Values`.
-func (r RadarAttackLayer7TopAseOriginParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type RadarAttackLayer7TopAseOriginParamsDateRange string
-
-const (
- RadarAttackLayer7TopAseOriginParamsDateRange1d RadarAttackLayer7TopAseOriginParamsDateRange = "1d"
- RadarAttackLayer7TopAseOriginParamsDateRange2d RadarAttackLayer7TopAseOriginParamsDateRange = "2d"
- RadarAttackLayer7TopAseOriginParamsDateRange7d RadarAttackLayer7TopAseOriginParamsDateRange = "7d"
- RadarAttackLayer7TopAseOriginParamsDateRange14d RadarAttackLayer7TopAseOriginParamsDateRange = "14d"
- RadarAttackLayer7TopAseOriginParamsDateRange28d RadarAttackLayer7TopAseOriginParamsDateRange = "28d"
- RadarAttackLayer7TopAseOriginParamsDateRange12w RadarAttackLayer7TopAseOriginParamsDateRange = "12w"
- RadarAttackLayer7TopAseOriginParamsDateRange24w RadarAttackLayer7TopAseOriginParamsDateRange = "24w"
- RadarAttackLayer7TopAseOriginParamsDateRange52w RadarAttackLayer7TopAseOriginParamsDateRange = "52w"
- RadarAttackLayer7TopAseOriginParamsDateRange1dControl RadarAttackLayer7TopAseOriginParamsDateRange = "1dControl"
- RadarAttackLayer7TopAseOriginParamsDateRange2dControl RadarAttackLayer7TopAseOriginParamsDateRange = "2dControl"
- RadarAttackLayer7TopAseOriginParamsDateRange7dControl RadarAttackLayer7TopAseOriginParamsDateRange = "7dControl"
- RadarAttackLayer7TopAseOriginParamsDateRange14dControl RadarAttackLayer7TopAseOriginParamsDateRange = "14dControl"
- RadarAttackLayer7TopAseOriginParamsDateRange28dControl RadarAttackLayer7TopAseOriginParamsDateRange = "28dControl"
- RadarAttackLayer7TopAseOriginParamsDateRange12wControl RadarAttackLayer7TopAseOriginParamsDateRange = "12wControl"
- RadarAttackLayer7TopAseOriginParamsDateRange24wControl RadarAttackLayer7TopAseOriginParamsDateRange = "24wControl"
-)
-
-// Format results are returned in.
-type RadarAttackLayer7TopAseOriginParamsFormat string
-
-const (
- RadarAttackLayer7TopAseOriginParamsFormatJson RadarAttackLayer7TopAseOriginParamsFormat = "JSON"
- RadarAttackLayer7TopAseOriginParamsFormatCsv RadarAttackLayer7TopAseOriginParamsFormat = "CSV"
-)
-
-type RadarAttackLayer7TopAseOriginResponseEnvelope struct {
- Result RadarAttackLayer7TopAseOriginResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarAttackLayer7TopAseOriginResponseEnvelopeJSON `json:"-"`
-}
-
-// radarAttackLayer7TopAseOriginResponseEnvelopeJSON contains the JSON metadata for
-// the struct [RadarAttackLayer7TopAseOriginResponseEnvelope]
-type radarAttackLayer7TopAseOriginResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7TopAseOriginResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TopAseOriginResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
diff --git a/radarattacklayer7topase_test.go b/radarattacklayer7topase_test.go
deleted file mode 100644
index 8c0eb989cbc..00000000000
--- a/radarattacklayer7topase_test.go
+++ /dev/null
@@ -1,48 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
- "time"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRadarAttackLayer7TopAseOriginWithOptionalParams(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"),
- )
- _, 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()}),
- Format: cloudflare.F(cloudflare.RadarAttackLayer7TopAseOriginParamsFormatJson),
- 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/radarattacklayer7toplocation.go b/radarattacklayer7toplocation.go
deleted file mode 100644
index 7dd8145414d..00000000000
--- a/radarattacklayer7toplocation.go
+++ /dev/null
@@ -1,548 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarAttackLayer7TopLocationService contains methods and other services that
-// help with interacting with the cloudflare API. Note, unlike clients, this
-// service does not read variables from the environment automatically. You should
-// not instantiate this service directly, and instead use the
-// [NewRadarAttackLayer7TopLocationService] method instead.
-type RadarAttackLayer7TopLocationService struct {
- Options []option.RequestOption
-}
-
-// NewRadarAttackLayer7TopLocationService generates a new service that applies the
-// given options to each request. These options are applied after the parent
-// client's options (if there is one), and before any request-specific options.
-func NewRadarAttackLayer7TopLocationService(opts ...option.RequestOption) (r *RadarAttackLayer7TopLocationService) {
- r = &RadarAttackLayer7TopLocationService{}
- r.Options = opts
- return
-}
-
-// Get the top origin locations of and by layer 7 attacks. Values are a percentage
-// out of the total layer 7 attacks. The origin location is determined by the
-// client IP.
-func (r *RadarAttackLayer7TopLocationService) Origin(ctx context.Context, query RadarAttackLayer7TopLocationOriginParams, opts ...option.RequestOption) (res *RadarAttackLayer7TopLocationOriginResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarAttackLayer7TopLocationOriginResponseEnvelope
- path := "radar/attacks/layer7/top/locations/origin"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Get the top target locations of and by layer 7 attacks. Values are a percentage
-// out of the total layer 7 attacks. The target location is determined by the
-// attacked zone's billing country, when available.
-func (r *RadarAttackLayer7TopLocationService) Target(ctx context.Context, query RadarAttackLayer7TopLocationTargetParams, opts ...option.RequestOption) (res *RadarAttackLayer7TopLocationTargetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarAttackLayer7TopLocationTargetResponseEnvelope
- path := "radar/attacks/layer7/top/locations/target"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type RadarAttackLayer7TopLocationOriginResponse struct {
- Meta RadarAttackLayer7TopLocationOriginResponseMeta `json:"meta,required"`
- Top0 []RadarAttackLayer7TopLocationOriginResponseTop0 `json:"top_0,required"`
- JSON radarAttackLayer7TopLocationOriginResponseJSON `json:"-"`
-}
-
-// radarAttackLayer7TopLocationOriginResponseJSON contains the JSON metadata for
-// the struct [RadarAttackLayer7TopLocationOriginResponse]
-type radarAttackLayer7TopLocationOriginResponseJSON struct {
- Meta apijson.Field
- Top0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7TopLocationOriginResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TopLocationOriginResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7TopLocationOriginResponseMeta struct {
- DateRange []RadarAttackLayer7TopLocationOriginResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- ConfidenceInfo RadarAttackLayer7TopLocationOriginResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarAttackLayer7TopLocationOriginResponseMetaJSON `json:"-"`
-}
-
-// radarAttackLayer7TopLocationOriginResponseMetaJSON contains the JSON metadata
-// for the struct [RadarAttackLayer7TopLocationOriginResponseMeta]
-type radarAttackLayer7TopLocationOriginResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7TopLocationOriginResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TopLocationOriginResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7TopLocationOriginResponseMetaDateRange 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 radarAttackLayer7TopLocationOriginResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarAttackLayer7TopLocationOriginResponseMetaDateRangeJSON contains the JSON
-// metadata for the struct
-// [RadarAttackLayer7TopLocationOriginResponseMetaDateRange]
-type radarAttackLayer7TopLocationOriginResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7TopLocationOriginResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TopLocationOriginResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7TopLocationOriginResponseMetaConfidenceInfo struct {
- Annotations []RadarAttackLayer7TopLocationOriginResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarAttackLayer7TopLocationOriginResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarAttackLayer7TopLocationOriginResponseMetaConfidenceInfoJSON contains the
-// JSON metadata for the struct
-// [RadarAttackLayer7TopLocationOriginResponseMetaConfidenceInfo]
-type radarAttackLayer7TopLocationOriginResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7TopLocationOriginResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TopLocationOriginResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7TopLocationOriginResponseMetaConfidenceInfoAnnotation 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 radarAttackLayer7TopLocationOriginResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarAttackLayer7TopLocationOriginResponseMetaConfidenceInfoAnnotationJSON
-// contains the JSON metadata for the struct
-// [RadarAttackLayer7TopLocationOriginResponseMetaConfidenceInfoAnnotation]
-type radarAttackLayer7TopLocationOriginResponseMetaConfidenceInfoAnnotationJSON 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 *RadarAttackLayer7TopLocationOriginResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TopLocationOriginResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7TopLocationOriginResponseTop0 struct {
- OriginCountryAlpha2 string `json:"originCountryAlpha2,required"`
- OriginCountryName string `json:"originCountryName,required"`
- Rank float64 `json:"rank,required"`
- Value string `json:"value,required"`
- JSON radarAttackLayer7TopLocationOriginResponseTop0JSON `json:"-"`
-}
-
-// radarAttackLayer7TopLocationOriginResponseTop0JSON contains the JSON metadata
-// for the struct [RadarAttackLayer7TopLocationOriginResponseTop0]
-type radarAttackLayer7TopLocationOriginResponseTop0JSON struct {
- OriginCountryAlpha2 apijson.Field
- OriginCountryName apijson.Field
- Rank apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7TopLocationOriginResponseTop0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TopLocationOriginResponseTop0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7TopLocationTargetResponse struct {
- Meta RadarAttackLayer7TopLocationTargetResponseMeta `json:"meta,required"`
- Top0 []RadarAttackLayer7TopLocationTargetResponseTop0 `json:"top_0,required"`
- JSON radarAttackLayer7TopLocationTargetResponseJSON `json:"-"`
-}
-
-// radarAttackLayer7TopLocationTargetResponseJSON contains the JSON metadata for
-// the struct [RadarAttackLayer7TopLocationTargetResponse]
-type radarAttackLayer7TopLocationTargetResponseJSON struct {
- Meta apijson.Field
- Top0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7TopLocationTargetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TopLocationTargetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7TopLocationTargetResponseMeta struct {
- DateRange []RadarAttackLayer7TopLocationTargetResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- ConfidenceInfo RadarAttackLayer7TopLocationTargetResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarAttackLayer7TopLocationTargetResponseMetaJSON `json:"-"`
-}
-
-// radarAttackLayer7TopLocationTargetResponseMetaJSON contains the JSON metadata
-// for the struct [RadarAttackLayer7TopLocationTargetResponseMeta]
-type radarAttackLayer7TopLocationTargetResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7TopLocationTargetResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TopLocationTargetResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7TopLocationTargetResponseMetaDateRange 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 radarAttackLayer7TopLocationTargetResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarAttackLayer7TopLocationTargetResponseMetaDateRangeJSON contains the JSON
-// metadata for the struct
-// [RadarAttackLayer7TopLocationTargetResponseMetaDateRange]
-type radarAttackLayer7TopLocationTargetResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7TopLocationTargetResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TopLocationTargetResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7TopLocationTargetResponseMetaConfidenceInfo struct {
- Annotations []RadarAttackLayer7TopLocationTargetResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarAttackLayer7TopLocationTargetResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarAttackLayer7TopLocationTargetResponseMetaConfidenceInfoJSON contains the
-// JSON metadata for the struct
-// [RadarAttackLayer7TopLocationTargetResponseMetaConfidenceInfo]
-type radarAttackLayer7TopLocationTargetResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7TopLocationTargetResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TopLocationTargetResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7TopLocationTargetResponseMetaConfidenceInfoAnnotation 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 radarAttackLayer7TopLocationTargetResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarAttackLayer7TopLocationTargetResponseMetaConfidenceInfoAnnotationJSON
-// contains the JSON metadata for the struct
-// [RadarAttackLayer7TopLocationTargetResponseMetaConfidenceInfoAnnotation]
-type radarAttackLayer7TopLocationTargetResponseMetaConfidenceInfoAnnotationJSON 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 *RadarAttackLayer7TopLocationTargetResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TopLocationTargetResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7TopLocationTargetResponseTop0 struct {
- Rank float64 `json:"rank,required"`
- TargetCountryAlpha2 string `json:"targetCountryAlpha2,required"`
- TargetCountryName string `json:"targetCountryName,required"`
- Value string `json:"value,required"`
- JSON radarAttackLayer7TopLocationTargetResponseTop0JSON `json:"-"`
-}
-
-// radarAttackLayer7TopLocationTargetResponseTop0JSON contains the JSON metadata
-// for the struct [RadarAttackLayer7TopLocationTargetResponseTop0]
-type radarAttackLayer7TopLocationTargetResponseTop0JSON struct {
- Rank apijson.Field
- TargetCountryAlpha2 apijson.Field
- TargetCountryName apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7TopLocationTargetResponseTop0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TopLocationTargetResponseTop0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarAttackLayer7TopLocationOriginParams 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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarAttackLayer7TopLocationOriginParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Format results are returned in.
- Format param.Field[RadarAttackLayer7TopLocationOriginParamsFormat] `query:"format"`
- // Limit the number of objects in the response.
- Limit param.Field[int64] `query:"limit"`
- // Array of names that will be used to name the series in responses.
- Name param.Field[[]string] `query:"name"`
-}
-
-// URLQuery serializes [RadarAttackLayer7TopLocationOriginParams]'s query
-// parameters as `url.Values`.
-func (r RadarAttackLayer7TopLocationOriginParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type RadarAttackLayer7TopLocationOriginParamsDateRange string
-
-const (
- RadarAttackLayer7TopLocationOriginParamsDateRange1d RadarAttackLayer7TopLocationOriginParamsDateRange = "1d"
- RadarAttackLayer7TopLocationOriginParamsDateRange2d RadarAttackLayer7TopLocationOriginParamsDateRange = "2d"
- RadarAttackLayer7TopLocationOriginParamsDateRange7d RadarAttackLayer7TopLocationOriginParamsDateRange = "7d"
- RadarAttackLayer7TopLocationOriginParamsDateRange14d RadarAttackLayer7TopLocationOriginParamsDateRange = "14d"
- RadarAttackLayer7TopLocationOriginParamsDateRange28d RadarAttackLayer7TopLocationOriginParamsDateRange = "28d"
- RadarAttackLayer7TopLocationOriginParamsDateRange12w RadarAttackLayer7TopLocationOriginParamsDateRange = "12w"
- RadarAttackLayer7TopLocationOriginParamsDateRange24w RadarAttackLayer7TopLocationOriginParamsDateRange = "24w"
- RadarAttackLayer7TopLocationOriginParamsDateRange52w RadarAttackLayer7TopLocationOriginParamsDateRange = "52w"
- RadarAttackLayer7TopLocationOriginParamsDateRange1dControl RadarAttackLayer7TopLocationOriginParamsDateRange = "1dControl"
- RadarAttackLayer7TopLocationOriginParamsDateRange2dControl RadarAttackLayer7TopLocationOriginParamsDateRange = "2dControl"
- RadarAttackLayer7TopLocationOriginParamsDateRange7dControl RadarAttackLayer7TopLocationOriginParamsDateRange = "7dControl"
- RadarAttackLayer7TopLocationOriginParamsDateRange14dControl RadarAttackLayer7TopLocationOriginParamsDateRange = "14dControl"
- RadarAttackLayer7TopLocationOriginParamsDateRange28dControl RadarAttackLayer7TopLocationOriginParamsDateRange = "28dControl"
- RadarAttackLayer7TopLocationOriginParamsDateRange12wControl RadarAttackLayer7TopLocationOriginParamsDateRange = "12wControl"
- RadarAttackLayer7TopLocationOriginParamsDateRange24wControl RadarAttackLayer7TopLocationOriginParamsDateRange = "24wControl"
-)
-
-// Format results are returned in.
-type RadarAttackLayer7TopLocationOriginParamsFormat string
-
-const (
- RadarAttackLayer7TopLocationOriginParamsFormatJson RadarAttackLayer7TopLocationOriginParamsFormat = "JSON"
- RadarAttackLayer7TopLocationOriginParamsFormatCsv RadarAttackLayer7TopLocationOriginParamsFormat = "CSV"
-)
-
-type RadarAttackLayer7TopLocationOriginResponseEnvelope struct {
- Result RadarAttackLayer7TopLocationOriginResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarAttackLayer7TopLocationOriginResponseEnvelopeJSON `json:"-"`
-}
-
-// radarAttackLayer7TopLocationOriginResponseEnvelopeJSON contains the JSON
-// metadata for the struct [RadarAttackLayer7TopLocationOriginResponseEnvelope]
-type radarAttackLayer7TopLocationOriginResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7TopLocationOriginResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TopLocationOriginResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarAttackLayer7TopLocationTargetParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Format results are returned in.
- Format param.Field[RadarAttackLayer7TopLocationTargetParamsFormat] `query:"format"`
- // Limit the number of objects in the response.
- Limit param.Field[int64] `query:"limit"`
- // Array of names that will be used to name the series in responses.
- Name param.Field[[]string] `query:"name"`
-}
-
-// URLQuery serializes [RadarAttackLayer7TopLocationTargetParams]'s query
-// parameters as `url.Values`.
-func (r RadarAttackLayer7TopLocationTargetParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type RadarAttackLayer7TopLocationTargetParamsDateRange string
-
-const (
- RadarAttackLayer7TopLocationTargetParamsDateRange1d RadarAttackLayer7TopLocationTargetParamsDateRange = "1d"
- RadarAttackLayer7TopLocationTargetParamsDateRange2d RadarAttackLayer7TopLocationTargetParamsDateRange = "2d"
- RadarAttackLayer7TopLocationTargetParamsDateRange7d RadarAttackLayer7TopLocationTargetParamsDateRange = "7d"
- RadarAttackLayer7TopLocationTargetParamsDateRange14d RadarAttackLayer7TopLocationTargetParamsDateRange = "14d"
- RadarAttackLayer7TopLocationTargetParamsDateRange28d RadarAttackLayer7TopLocationTargetParamsDateRange = "28d"
- RadarAttackLayer7TopLocationTargetParamsDateRange12w RadarAttackLayer7TopLocationTargetParamsDateRange = "12w"
- RadarAttackLayer7TopLocationTargetParamsDateRange24w RadarAttackLayer7TopLocationTargetParamsDateRange = "24w"
- RadarAttackLayer7TopLocationTargetParamsDateRange52w RadarAttackLayer7TopLocationTargetParamsDateRange = "52w"
- RadarAttackLayer7TopLocationTargetParamsDateRange1dControl RadarAttackLayer7TopLocationTargetParamsDateRange = "1dControl"
- RadarAttackLayer7TopLocationTargetParamsDateRange2dControl RadarAttackLayer7TopLocationTargetParamsDateRange = "2dControl"
- RadarAttackLayer7TopLocationTargetParamsDateRange7dControl RadarAttackLayer7TopLocationTargetParamsDateRange = "7dControl"
- RadarAttackLayer7TopLocationTargetParamsDateRange14dControl RadarAttackLayer7TopLocationTargetParamsDateRange = "14dControl"
- RadarAttackLayer7TopLocationTargetParamsDateRange28dControl RadarAttackLayer7TopLocationTargetParamsDateRange = "28dControl"
- RadarAttackLayer7TopLocationTargetParamsDateRange12wControl RadarAttackLayer7TopLocationTargetParamsDateRange = "12wControl"
- RadarAttackLayer7TopLocationTargetParamsDateRange24wControl RadarAttackLayer7TopLocationTargetParamsDateRange = "24wControl"
-)
-
-// Format results are returned in.
-type RadarAttackLayer7TopLocationTargetParamsFormat string
-
-const (
- RadarAttackLayer7TopLocationTargetParamsFormatJson RadarAttackLayer7TopLocationTargetParamsFormat = "JSON"
- RadarAttackLayer7TopLocationTargetParamsFormatCsv RadarAttackLayer7TopLocationTargetParamsFormat = "CSV"
-)
-
-type RadarAttackLayer7TopLocationTargetResponseEnvelope struct {
- Result RadarAttackLayer7TopLocationTargetResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarAttackLayer7TopLocationTargetResponseEnvelopeJSON `json:"-"`
-}
-
-// radarAttackLayer7TopLocationTargetResponseEnvelopeJSON contains the JSON
-// metadata for the struct [RadarAttackLayer7TopLocationTargetResponseEnvelope]
-type radarAttackLayer7TopLocationTargetResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarAttackLayer7TopLocationTargetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarAttackLayer7TopLocationTargetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
diff --git a/radarattacklayer7toplocation_test.go b/radarattacklayer7toplocation_test.go
deleted file mode 100644
index 257167b2b74..00000000000
--- a/radarattacklayer7toplocation_test.go
+++ /dev/null
@@ -1,80 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
- "time"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRadarAttackLayer7TopLocationOriginWithOptionalParams(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"),
- )
- _, 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()}),
- Format: cloudflare.F(cloudflare.RadarAttackLayer7TopLocationOriginParamsFormatJson),
- Limit: cloudflare.F(int64(5)),
- 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())
- }
-}
-
-func TestRadarAttackLayer7TopLocationTargetWithOptionalParams(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"),
- )
- _, 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()}),
- Format: cloudflare.F(cloudflare.RadarAttackLayer7TopLocationTargetParamsFormatJson),
- Limit: cloudflare.F(int64(5)),
- 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/radarbgp.go b/radarbgp.go
deleted file mode 100644
index 7cbfaf0e004..00000000000
--- a/radarbgp.go
+++ /dev/null
@@ -1,316 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarBGPService contains methods and other services that help with interacting
-// with the cloudflare API. Note, unlike clients, this service does not read
-// variables from the environment automatically. You should not instantiate this
-// service directly, and instead use the [NewRadarBGPService] method instead.
-type RadarBGPService struct {
- Options []option.RequestOption
- Leaks *RadarBGPLeakService
- Top *RadarBGPTopService
- Hijacks *RadarBGPHijackService
- Routes *RadarBGPRouteService
-}
-
-// NewRadarBGPService generates a new service that applies the given options to
-// each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewRadarBGPService(opts ...option.RequestOption) (r *RadarBGPService) {
- r = &RadarBGPService{}
- r.Options = opts
- r.Leaks = NewRadarBGPLeakService(opts...)
- r.Top = NewRadarBGPTopService(opts...)
- r.Hijacks = NewRadarBGPHijackService(opts...)
- r.Routes = NewRadarBGPRouteService(opts...)
- return
-}
-
-// Gets BGP updates change over time. Raw values are returned. When requesting
-// updates of an autonomous system (AS), only BGP updates of type announcement are
-// returned.
-func (r *RadarBGPService) Timeseries(ctx context.Context, query RadarBGPTimeseriesParams, opts ...option.RequestOption) (res *RadarBGPTimeseriesResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarBGPTimeseriesResponseEnvelope
- path := "radar/bgp/timeseries"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type RadarBGPTimeseriesResponse struct {
- Meta RadarBGPTimeseriesResponseMeta `json:"meta,required"`
- Serie0 RadarBGPTimeseriesResponseSerie0 `json:"serie_0,required"`
- JSON radarBGPTimeseriesResponseJSON `json:"-"`
-}
-
-// radarBGPTimeseriesResponseJSON contains the JSON metadata for the struct
-// [RadarBGPTimeseriesResponse]
-type radarBGPTimeseriesResponseJSON struct {
- Meta apijson.Field
- Serie0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarBGPTimeseriesResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarBGPTimeseriesResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarBGPTimeseriesResponseMeta struct {
- AggInterval string `json:"aggInterval,required"`
- DateRange []RadarBGPTimeseriesResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated time.Time `json:"lastUpdated,required" format:"date-time"`
- ConfidenceInfo RadarBGPTimeseriesResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarBGPTimeseriesResponseMetaJSON `json:"-"`
-}
-
-// radarBGPTimeseriesResponseMetaJSON contains the JSON metadata for the struct
-// [RadarBGPTimeseriesResponseMeta]
-type radarBGPTimeseriesResponseMetaJSON struct {
- AggInterval apijson.Field
- DateRange apijson.Field
- LastUpdated apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarBGPTimeseriesResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarBGPTimeseriesResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarBGPTimeseriesResponseMetaDateRange 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 radarBGPTimeseriesResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarBGPTimeseriesResponseMetaDateRangeJSON contains the JSON metadata for the
-// struct [RadarBGPTimeseriesResponseMetaDateRange]
-type radarBGPTimeseriesResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarBGPTimeseriesResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarBGPTimeseriesResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarBGPTimeseriesResponseMetaConfidenceInfo struct {
- Annotations []RadarBGPTimeseriesResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarBGPTimeseriesResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarBGPTimeseriesResponseMetaConfidenceInfoJSON contains the JSON metadata for
-// the struct [RadarBGPTimeseriesResponseMetaConfidenceInfo]
-type radarBGPTimeseriesResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarBGPTimeseriesResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarBGPTimeseriesResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarBGPTimeseriesResponseMetaConfidenceInfoAnnotation 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 radarBGPTimeseriesResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarBGPTimeseriesResponseMetaConfidenceInfoAnnotationJSON contains the JSON
-// metadata for the struct [RadarBGPTimeseriesResponseMetaConfidenceInfoAnnotation]
-type radarBGPTimeseriesResponseMetaConfidenceInfoAnnotationJSON 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 *RadarBGPTimeseriesResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarBGPTimeseriesResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarBGPTimeseriesResponseSerie0 struct {
- Timestamps []time.Time `json:"timestamps,required" format:"date-time"`
- Values []string `json:"values,required"`
- JSON radarBGPTimeseriesResponseSerie0JSON `json:"-"`
-}
-
-// radarBGPTimeseriesResponseSerie0JSON contains the JSON metadata for the struct
-// [RadarBGPTimeseriesResponseSerie0]
-type radarBGPTimeseriesResponseSerie0JSON struct {
- Timestamps apijson.Field
- Values apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarBGPTimeseriesResponseSerie0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarBGPTimeseriesResponseSerie0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarBGPTimeseriesParams struct {
- // Aggregation interval results should be returned in (for example, in 15 minutes
- // or 1 hour intervals). Refer to
- // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
- AggInterval param.Field[RadarBGPTimeseriesParamsAggInterval] `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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarBGPTimeseriesParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Format results are returned in.
- Format param.Field[RadarBGPTimeseriesParamsFormat] `query:"format"`
- // Array of names that will be used to name the series in responses.
- Name param.Field[[]string] `query:"name"`
- // Array of BGP network prefixes.
- Prefix param.Field[[]string] `query:"prefix"`
- // Array of BGP update types.
- UpdateType param.Field[[]RadarBGPTimeseriesParamsUpdateType] `query:"updateType"`
-}
-
-// URLQuery serializes [RadarBGPTimeseriesParams]'s query parameters as
-// `url.Values`.
-func (r RadarBGPTimeseriesParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Aggregation interval results should be returned in (for example, in 15 minutes
-// or 1 hour intervals). Refer to
-// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
-type RadarBGPTimeseriesParamsAggInterval string
-
-const (
- RadarBGPTimeseriesParamsAggInterval15m RadarBGPTimeseriesParamsAggInterval = "15m"
- RadarBGPTimeseriesParamsAggInterval1h RadarBGPTimeseriesParamsAggInterval = "1h"
- RadarBGPTimeseriesParamsAggInterval1d RadarBGPTimeseriesParamsAggInterval = "1d"
- RadarBGPTimeseriesParamsAggInterval1w RadarBGPTimeseriesParamsAggInterval = "1w"
-)
-
-type RadarBGPTimeseriesParamsDateRange string
-
-const (
- RadarBGPTimeseriesParamsDateRange1d RadarBGPTimeseriesParamsDateRange = "1d"
- RadarBGPTimeseriesParamsDateRange2d RadarBGPTimeseriesParamsDateRange = "2d"
- RadarBGPTimeseriesParamsDateRange7d RadarBGPTimeseriesParamsDateRange = "7d"
- RadarBGPTimeseriesParamsDateRange14d RadarBGPTimeseriesParamsDateRange = "14d"
- RadarBGPTimeseriesParamsDateRange28d RadarBGPTimeseriesParamsDateRange = "28d"
- RadarBGPTimeseriesParamsDateRange12w RadarBGPTimeseriesParamsDateRange = "12w"
- RadarBGPTimeseriesParamsDateRange24w RadarBGPTimeseriesParamsDateRange = "24w"
- RadarBGPTimeseriesParamsDateRange52w RadarBGPTimeseriesParamsDateRange = "52w"
- RadarBGPTimeseriesParamsDateRange1dControl RadarBGPTimeseriesParamsDateRange = "1dControl"
- RadarBGPTimeseriesParamsDateRange2dControl RadarBGPTimeseriesParamsDateRange = "2dControl"
- RadarBGPTimeseriesParamsDateRange7dControl RadarBGPTimeseriesParamsDateRange = "7dControl"
- RadarBGPTimeseriesParamsDateRange14dControl RadarBGPTimeseriesParamsDateRange = "14dControl"
- RadarBGPTimeseriesParamsDateRange28dControl RadarBGPTimeseriesParamsDateRange = "28dControl"
- RadarBGPTimeseriesParamsDateRange12wControl RadarBGPTimeseriesParamsDateRange = "12wControl"
- RadarBGPTimeseriesParamsDateRange24wControl RadarBGPTimeseriesParamsDateRange = "24wControl"
-)
-
-// Format results are returned in.
-type RadarBGPTimeseriesParamsFormat string
-
-const (
- RadarBGPTimeseriesParamsFormatJson RadarBGPTimeseriesParamsFormat = "JSON"
- RadarBGPTimeseriesParamsFormatCsv RadarBGPTimeseriesParamsFormat = "CSV"
-)
-
-type RadarBGPTimeseriesParamsUpdateType string
-
-const (
- RadarBGPTimeseriesParamsUpdateTypeAnnouncement RadarBGPTimeseriesParamsUpdateType = "ANNOUNCEMENT"
- RadarBGPTimeseriesParamsUpdateTypeWithdrawal RadarBGPTimeseriesParamsUpdateType = "WITHDRAWAL"
-)
-
-type RadarBGPTimeseriesResponseEnvelope struct {
- Result RadarBGPTimeseriesResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarBGPTimeseriesResponseEnvelopeJSON `json:"-"`
-}
-
-// radarBGPTimeseriesResponseEnvelopeJSON contains the JSON metadata for the struct
-// [RadarBGPTimeseriesResponseEnvelope]
-type radarBGPTimeseriesResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarBGPTimeseriesResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarBGPTimeseriesResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
diff --git a/radarbgp_test.go b/radarbgp_test.go
deleted file mode 100644
index d99d975211d..00000000000
--- a/radarbgp_test.go
+++ /dev/null
@@ -1,49 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
- "time"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRadarBGPTimeseriesWithOptionalParams(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"),
- )
- _, err := client.Radar.BGP.Timeseries(context.TODO(), cloudflare.RadarBGPTimeseriesParams{
- AggInterval: cloudflare.F(cloudflare.RadarBGPTimeseriesParamsAggInterval1h),
- ASN: cloudflare.F([]string{"string", "string", "string"}),
- DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
- DateRange: cloudflare.F([]cloudflare.RadarBGPTimeseriesParamsDateRange{cloudflare.RadarBGPTimeseriesParamsDateRange1d, cloudflare.RadarBGPTimeseriesParamsDateRange2d, cloudflare.RadarBGPTimeseriesParamsDateRange7d}),
- DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
- Format: cloudflare.F(cloudflare.RadarBGPTimeseriesParamsFormatJson),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- Prefix: cloudflare.F([]string{"string", "string", "string"}),
- UpdateType: cloudflare.F([]cloudflare.RadarBGPTimeseriesParamsUpdateType{cloudflare.RadarBGPTimeseriesParamsUpdateTypeAnnouncement, cloudflare.RadarBGPTimeseriesParamsUpdateTypeWithdrawal}),
- })
- 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/radarbgphijack.go b/radarbgphijack.go
deleted file mode 100644
index c224b974d89..00000000000
--- a/radarbgphijack.go
+++ /dev/null
@@ -1,319 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarBGPHijackService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewRadarBGPHijackService] method
-// instead.
-type RadarBGPHijackService struct {
- Options []option.RequestOption
-}
-
-// NewRadarBGPHijackService generates a new service that applies the given options
-// to each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewRadarBGPHijackService(opts ...option.RequestOption) (r *RadarBGPHijackService) {
- r = &RadarBGPHijackService{}
- r.Options = opts
- return
-}
-
-// Get the BGP hijack events. (Beta)
-func (r *RadarBGPHijackService) Events(ctx context.Context, query RadarBGPHijackEventsParams, opts ...option.RequestOption) (res *RadarBGPHijackEventsResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarBGPHijackEventsResponseEnvelope
- path := "radar/bgp/hijacks/events"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type RadarBGPHijackEventsResponse struct {
- ASNInfo []RadarBGPHijackEventsResponseASNInfo `json:"asn_info,required"`
- Events []RadarBGPHijackEventsResponseEvent `json:"events,required"`
- TotalMonitors int64 `json:"total_monitors,required"`
- JSON radarBGPHijackEventsResponseJSON `json:"-"`
-}
-
-// radarBGPHijackEventsResponseJSON contains the JSON metadata for the struct
-// [RadarBGPHijackEventsResponse]
-type radarBGPHijackEventsResponseJSON struct {
- ASNInfo apijson.Field
- Events apijson.Field
- TotalMonitors apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarBGPHijackEventsResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarBGPHijackEventsResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarBGPHijackEventsResponseASNInfo struct {
- ASN int64 `json:"asn,required"`
- CountryCode string `json:"country_code,required"`
- OrgName string `json:"org_name,required"`
- JSON radarBGPHijackEventsResponseASNInfoJSON `json:"-"`
-}
-
-// radarBGPHijackEventsResponseASNInfoJSON contains the JSON metadata for the
-// struct [RadarBGPHijackEventsResponseASNInfo]
-type radarBGPHijackEventsResponseASNInfoJSON struct {
- ASN apijson.Field
- CountryCode apijson.Field
- OrgName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarBGPHijackEventsResponseASNInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarBGPHijackEventsResponseASNInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarBGPHijackEventsResponseEvent struct {
- ID int64 `json:"id,required"`
- ConfidenceScore int64 `json:"confidence_score,required"`
- Duration int64 `json:"duration,required"`
- EventType int64 `json:"event_type,required"`
- HijackMsgsCount int64 `json:"hijack_msgs_count,required"`
- HijackerASN int64 `json:"hijacker_asn,required"`
- HijackerCountry string `json:"hijacker_country,required"`
- IsStale bool `json:"is_stale,required"`
- MaxHijackTs string `json:"max_hijack_ts,required"`
- MaxMsgTs string `json:"max_msg_ts,required"`
- MinHijackTs string `json:"min_hijack_ts,required"`
- OnGoingCount int64 `json:"on_going_count,required"`
- PeerASNs []int64 `json:"peer_asns,required"`
- PeerIPCount int64 `json:"peer_ip_count,required"`
- Prefixes []string `json:"prefixes,required"`
- Tags []RadarBGPHijackEventsResponseEventsTag `json:"tags,required"`
- VictimASNs []int64 `json:"victim_asns,required"`
- VictimCountries []string `json:"victim_countries,required"`
- JSON radarBGPHijackEventsResponseEventJSON `json:"-"`
-}
-
-// radarBGPHijackEventsResponseEventJSON contains the JSON metadata for the struct
-// [RadarBGPHijackEventsResponseEvent]
-type radarBGPHijackEventsResponseEventJSON struct {
- ID apijson.Field
- ConfidenceScore apijson.Field
- Duration apijson.Field
- EventType apijson.Field
- HijackMsgsCount apijson.Field
- HijackerASN apijson.Field
- HijackerCountry apijson.Field
- IsStale apijson.Field
- MaxHijackTs apijson.Field
- MaxMsgTs apijson.Field
- MinHijackTs apijson.Field
- OnGoingCount apijson.Field
- PeerASNs apijson.Field
- PeerIPCount apijson.Field
- Prefixes apijson.Field
- Tags apijson.Field
- VictimASNs apijson.Field
- VictimCountries apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarBGPHijackEventsResponseEvent) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarBGPHijackEventsResponseEventJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarBGPHijackEventsResponseEventsTag struct {
- Name string `json:"name,required"`
- Score int64 `json:"score,required"`
- JSON radarBGPHijackEventsResponseEventsTagJSON `json:"-"`
-}
-
-// radarBGPHijackEventsResponseEventsTagJSON contains the JSON metadata for the
-// struct [RadarBGPHijackEventsResponseEventsTag]
-type radarBGPHijackEventsResponseEventsTagJSON struct {
- Name apijson.Field
- Score apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarBGPHijackEventsResponseEventsTag) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarBGPHijackEventsResponseEventsTagJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarBGPHijackEventsParams struct {
- // End of the date range (inclusive).
- DateEnd param.Field[time.Time] `query:"dateEnd" format:"date-time"`
- // Shorthand date ranges for the last X days - use when you don't need specific
- // start and end dates.
- DateRange param.Field[RadarBGPHijackEventsParamsDateRange] `query:"dateRange"`
- // Start of the date range (inclusive).
- DateStart param.Field[time.Time] `query:"dateStart" format:"date-time"`
- // The unique identifier of a event
- EventID param.Field[int64] `query:"eventId"`
- // Format results are returned in.
- Format param.Field[RadarBGPHijackEventsParamsFormat] `query:"format"`
- // The potential hijacker AS of a BGP hijack event
- HijackerASN param.Field[int64] `query:"hijackerAsn"`
- // The potential hijacker or victim AS of a BGP hijack event
- InvolvedASN param.Field[int64] `query:"involvedAsn"`
- // The country code of the potential hijacker or victim AS of a BGP hijack event
- InvolvedCountry param.Field[string] `query:"involvedCountry"`
- // The maximum confidence score to filter events (1-4 low, 5-7 mid, 8+ high)
- MaxConfidence param.Field[int64] `query:"maxConfidence"`
- // The minimum confidence score to filter events (1-4 low, 5-7 mid, 8+ high)
- MinConfidence param.Field[int64] `query:"minConfidence"`
- // Current page number, starting from 1
- Page param.Field[int64] `query:"page"`
- // Number of entries per page
- PerPage param.Field[int64] `query:"per_page"`
- // The prefix hijacked during a BGP hijack event
- Prefix param.Field[string] `query:"prefix"`
- // Sort events by field
- SortBy param.Field[RadarBGPHijackEventsParamsSortBy] `query:"sortBy"`
- // Sort order
- SortOrder param.Field[RadarBGPHijackEventsParamsSortOrder] `query:"sortOrder"`
- // The potential victim AS of a BGP hijack event
- VictimASN param.Field[int64] `query:"victimAsn"`
-}
-
-// URLQuery serializes [RadarBGPHijackEventsParams]'s query parameters as
-// `url.Values`.
-func (r RadarBGPHijackEventsParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Shorthand date ranges for the last X days - use when you don't need specific
-// start and end dates.
-type RadarBGPHijackEventsParamsDateRange string
-
-const (
- RadarBGPHijackEventsParamsDateRange1d RadarBGPHijackEventsParamsDateRange = "1d"
- RadarBGPHijackEventsParamsDateRange2d RadarBGPHijackEventsParamsDateRange = "2d"
- RadarBGPHijackEventsParamsDateRange7d RadarBGPHijackEventsParamsDateRange = "7d"
- RadarBGPHijackEventsParamsDateRange14d RadarBGPHijackEventsParamsDateRange = "14d"
- RadarBGPHijackEventsParamsDateRange28d RadarBGPHijackEventsParamsDateRange = "28d"
- RadarBGPHijackEventsParamsDateRange12w RadarBGPHijackEventsParamsDateRange = "12w"
- RadarBGPHijackEventsParamsDateRange24w RadarBGPHijackEventsParamsDateRange = "24w"
- RadarBGPHijackEventsParamsDateRange52w RadarBGPHijackEventsParamsDateRange = "52w"
- RadarBGPHijackEventsParamsDateRange1dControl RadarBGPHijackEventsParamsDateRange = "1dControl"
- RadarBGPHijackEventsParamsDateRange2dControl RadarBGPHijackEventsParamsDateRange = "2dControl"
- RadarBGPHijackEventsParamsDateRange7dControl RadarBGPHijackEventsParamsDateRange = "7dControl"
- RadarBGPHijackEventsParamsDateRange14dControl RadarBGPHijackEventsParamsDateRange = "14dControl"
- RadarBGPHijackEventsParamsDateRange28dControl RadarBGPHijackEventsParamsDateRange = "28dControl"
- RadarBGPHijackEventsParamsDateRange12wControl RadarBGPHijackEventsParamsDateRange = "12wControl"
- RadarBGPHijackEventsParamsDateRange24wControl RadarBGPHijackEventsParamsDateRange = "24wControl"
-)
-
-// Format results are returned in.
-type RadarBGPHijackEventsParamsFormat string
-
-const (
- RadarBGPHijackEventsParamsFormatJson RadarBGPHijackEventsParamsFormat = "JSON"
- RadarBGPHijackEventsParamsFormatCsv RadarBGPHijackEventsParamsFormat = "CSV"
-)
-
-// Sort events by field
-type RadarBGPHijackEventsParamsSortBy string
-
-const (
- RadarBGPHijackEventsParamsSortByID RadarBGPHijackEventsParamsSortBy = "ID"
- RadarBGPHijackEventsParamsSortByTime RadarBGPHijackEventsParamsSortBy = "TIME"
- RadarBGPHijackEventsParamsSortByConfidence RadarBGPHijackEventsParamsSortBy = "CONFIDENCE"
-)
-
-// Sort order
-type RadarBGPHijackEventsParamsSortOrder string
-
-const (
- RadarBGPHijackEventsParamsSortOrderAsc RadarBGPHijackEventsParamsSortOrder = "ASC"
- RadarBGPHijackEventsParamsSortOrderDesc RadarBGPHijackEventsParamsSortOrder = "DESC"
-)
-
-type RadarBGPHijackEventsResponseEnvelope struct {
- Result RadarBGPHijackEventsResponse `json:"result,required"`
- ResultInfo RadarBGPHijackEventsResponseEnvelopeResultInfo `json:"result_info,required"`
- Success bool `json:"success,required"`
- JSON radarBGPHijackEventsResponseEnvelopeJSON `json:"-"`
-}
-
-// radarBGPHijackEventsResponseEnvelopeJSON contains the JSON metadata for the
-// struct [RadarBGPHijackEventsResponseEnvelope]
-type radarBGPHijackEventsResponseEnvelopeJSON struct {
- Result apijson.Field
- ResultInfo apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarBGPHijackEventsResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarBGPHijackEventsResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarBGPHijackEventsResponseEnvelopeResultInfo struct {
- Count int64 `json:"count,required"`
- Page int64 `json:"page,required"`
- PerPage int64 `json:"per_page,required"`
- TotalCount int64 `json:"total_count,required"`
- JSON radarBGPHijackEventsResponseEnvelopeResultInfoJSON `json:"-"`
-}
-
-// radarBGPHijackEventsResponseEnvelopeResultInfoJSON contains the JSON metadata
-// for the struct [RadarBGPHijackEventsResponseEnvelopeResultInfo]
-type radarBGPHijackEventsResponseEnvelopeResultInfoJSON struct {
- Count apijson.Field
- Page apijson.Field
- PerPage apijson.Field
- TotalCount apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarBGPHijackEventsResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarBGPHijackEventsResponseEnvelopeResultInfoJSON) RawJSON() string {
- return r.raw
-}
diff --git a/radarbgphijack_test.go b/radarbgphijack_test.go
deleted file mode 100644
index 86bb901a2dc..00000000000
--- a/radarbgphijack_test.go
+++ /dev/null
@@ -1,56 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
- "time"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRadarBGPHijackEventsWithOptionalParams(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"),
- )
- _, err := client.Radar.BGP.Hijacks.Events(context.TODO(), cloudflare.RadarBGPHijackEventsParams{
- DateEnd: cloudflare.F(time.Now()),
- DateRange: cloudflare.F(cloudflare.RadarBGPHijackEventsParamsDateRange7d),
- DateStart: cloudflare.F(time.Now()),
- EventID: cloudflare.F(int64(0)),
- Format: cloudflare.F(cloudflare.RadarBGPHijackEventsParamsFormatJson),
- HijackerASN: cloudflare.F(int64(0)),
- InvolvedASN: cloudflare.F(int64(0)),
- InvolvedCountry: cloudflare.F("string"),
- MaxConfidence: cloudflare.F(int64(0)),
- MinConfidence: cloudflare.F(int64(0)),
- Page: cloudflare.F(int64(0)),
- PerPage: cloudflare.F(int64(0)),
- Prefix: cloudflare.F("string"),
- SortBy: cloudflare.F(cloudflare.RadarBGPHijackEventsParamsSortByTime),
- SortOrder: cloudflare.F(cloudflare.RadarBGPHijackEventsParamsSortOrderDesc),
- VictimASN: cloudflare.F(int64(0)),
- })
- 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/radarbgpleak.go b/radarbgpleak.go
deleted file mode 100644
index 7cbda02f10c..00000000000
--- a/radarbgpleak.go
+++ /dev/null
@@ -1,279 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarBGPLeakService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewRadarBGPLeakService] method
-// instead.
-type RadarBGPLeakService struct {
- Options []option.RequestOption
-}
-
-// NewRadarBGPLeakService generates a new service that applies the given options to
-// each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewRadarBGPLeakService(opts ...option.RequestOption) (r *RadarBGPLeakService) {
- r = &RadarBGPLeakService{}
- r.Options = opts
- return
-}
-
-// Get the BGP route leak events (Beta).
-func (r *RadarBGPLeakService) Events(ctx context.Context, query RadarBGPLeakEventsParams, opts ...option.RequestOption) (res *RadarBGPLeakEventsResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarBGPLeakEventsResponseEnvelope
- path := "radar/bgp/leaks/events"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type RadarBGPLeakEventsResponse struct {
- ASNInfo []RadarBGPLeakEventsResponseASNInfo `json:"asn_info,required"`
- Events []RadarBGPLeakEventsResponseEvent `json:"events,required"`
- JSON radarBGPLeakEventsResponseJSON `json:"-"`
-}
-
-// radarBGPLeakEventsResponseJSON contains the JSON metadata for the struct
-// [RadarBGPLeakEventsResponse]
-type radarBGPLeakEventsResponseJSON struct {
- ASNInfo apijson.Field
- Events apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarBGPLeakEventsResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarBGPLeakEventsResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarBGPLeakEventsResponseASNInfo struct {
- ASN int64 `json:"asn,required"`
- CountryCode string `json:"country_code,required"`
- OrgName string `json:"org_name,required"`
- JSON radarBGPLeakEventsResponseASNInfoJSON `json:"-"`
-}
-
-// radarBGPLeakEventsResponseASNInfoJSON contains the JSON metadata for the struct
-// [RadarBGPLeakEventsResponseASNInfo]
-type radarBGPLeakEventsResponseASNInfoJSON struct {
- ASN apijson.Field
- CountryCode apijson.Field
- OrgName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarBGPLeakEventsResponseASNInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarBGPLeakEventsResponseASNInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarBGPLeakEventsResponseEvent struct {
- ID int64 `json:"id,required"`
- Countries []string `json:"countries,required"`
- DetectedTs string `json:"detected_ts,required"`
- Finished bool `json:"finished,required"`
- LeakASN int64 `json:"leak_asn,required"`
- LeakCount int64 `json:"leak_count,required"`
- LeakSeg []int64 `json:"leak_seg,required"`
- LeakType int64 `json:"leak_type,required"`
- MaxTs string `json:"max_ts,required"`
- MinTs string `json:"min_ts,required"`
- OriginCount int64 `json:"origin_count,required"`
- PeerCount int64 `json:"peer_count,required"`
- PrefixCount int64 `json:"prefix_count,required"`
- JSON radarBGPLeakEventsResponseEventJSON `json:"-"`
-}
-
-// radarBGPLeakEventsResponseEventJSON contains the JSON metadata for the struct
-// [RadarBGPLeakEventsResponseEvent]
-type radarBGPLeakEventsResponseEventJSON struct {
- ID apijson.Field
- Countries apijson.Field
- DetectedTs apijson.Field
- Finished apijson.Field
- LeakASN apijson.Field
- LeakCount apijson.Field
- LeakSeg apijson.Field
- LeakType apijson.Field
- MaxTs apijson.Field
- MinTs apijson.Field
- OriginCount apijson.Field
- PeerCount apijson.Field
- PrefixCount apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarBGPLeakEventsResponseEvent) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarBGPLeakEventsResponseEventJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarBGPLeakEventsParams struct {
- // End of the date range (inclusive).
- DateEnd param.Field[time.Time] `query:"dateEnd" format:"date-time"`
- // Shorthand date ranges for the last X days - use when you don't need specific
- // start and end dates.
- DateRange param.Field[RadarBGPLeakEventsParamsDateRange] `query:"dateRange"`
- // Start of the date range (inclusive).
- DateStart param.Field[time.Time] `query:"dateStart" format:"date-time"`
- // The unique identifier of a event
- EventID param.Field[int64] `query:"eventId"`
- // Format results are returned in.
- Format param.Field[RadarBGPLeakEventsParamsFormat] `query:"format"`
- // ASN that is causing or affected by a route leak event
- InvolvedASN param.Field[int64] `query:"involvedAsn"`
- // Country code of a involved ASN in a route leak event
- InvolvedCountry param.Field[string] `query:"involvedCountry"`
- // The leaking AS of a route leak event
- LeakASN param.Field[int64] `query:"leakAsn"`
- // Current page number, starting from 1
- Page param.Field[int64] `query:"page"`
- // Number of entries per page
- PerPage param.Field[int64] `query:"per_page"`
- // Sort events by field
- SortBy param.Field[RadarBGPLeakEventsParamsSortBy] `query:"sortBy"`
- // Sort order
- SortOrder param.Field[RadarBGPLeakEventsParamsSortOrder] `query:"sortOrder"`
-}
-
-// URLQuery serializes [RadarBGPLeakEventsParams]'s query parameters as
-// `url.Values`.
-func (r RadarBGPLeakEventsParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Shorthand date ranges for the last X days - use when you don't need specific
-// start and end dates.
-type RadarBGPLeakEventsParamsDateRange string
-
-const (
- RadarBGPLeakEventsParamsDateRange1d RadarBGPLeakEventsParamsDateRange = "1d"
- RadarBGPLeakEventsParamsDateRange2d RadarBGPLeakEventsParamsDateRange = "2d"
- RadarBGPLeakEventsParamsDateRange7d RadarBGPLeakEventsParamsDateRange = "7d"
- RadarBGPLeakEventsParamsDateRange14d RadarBGPLeakEventsParamsDateRange = "14d"
- RadarBGPLeakEventsParamsDateRange28d RadarBGPLeakEventsParamsDateRange = "28d"
- RadarBGPLeakEventsParamsDateRange12w RadarBGPLeakEventsParamsDateRange = "12w"
- RadarBGPLeakEventsParamsDateRange24w RadarBGPLeakEventsParamsDateRange = "24w"
- RadarBGPLeakEventsParamsDateRange52w RadarBGPLeakEventsParamsDateRange = "52w"
- RadarBGPLeakEventsParamsDateRange1dControl RadarBGPLeakEventsParamsDateRange = "1dControl"
- RadarBGPLeakEventsParamsDateRange2dControl RadarBGPLeakEventsParamsDateRange = "2dControl"
- RadarBGPLeakEventsParamsDateRange7dControl RadarBGPLeakEventsParamsDateRange = "7dControl"
- RadarBGPLeakEventsParamsDateRange14dControl RadarBGPLeakEventsParamsDateRange = "14dControl"
- RadarBGPLeakEventsParamsDateRange28dControl RadarBGPLeakEventsParamsDateRange = "28dControl"
- RadarBGPLeakEventsParamsDateRange12wControl RadarBGPLeakEventsParamsDateRange = "12wControl"
- RadarBGPLeakEventsParamsDateRange24wControl RadarBGPLeakEventsParamsDateRange = "24wControl"
-)
-
-// Format results are returned in.
-type RadarBGPLeakEventsParamsFormat string
-
-const (
- RadarBGPLeakEventsParamsFormatJson RadarBGPLeakEventsParamsFormat = "JSON"
- RadarBGPLeakEventsParamsFormatCsv RadarBGPLeakEventsParamsFormat = "CSV"
-)
-
-// Sort events by field
-type RadarBGPLeakEventsParamsSortBy string
-
-const (
- RadarBGPLeakEventsParamsSortByID RadarBGPLeakEventsParamsSortBy = "ID"
- RadarBGPLeakEventsParamsSortByLeaks RadarBGPLeakEventsParamsSortBy = "LEAKS"
- RadarBGPLeakEventsParamsSortByPeers RadarBGPLeakEventsParamsSortBy = "PEERS"
- RadarBGPLeakEventsParamsSortByPrefixes RadarBGPLeakEventsParamsSortBy = "PREFIXES"
- RadarBGPLeakEventsParamsSortByOrigins RadarBGPLeakEventsParamsSortBy = "ORIGINS"
- RadarBGPLeakEventsParamsSortByTime RadarBGPLeakEventsParamsSortBy = "TIME"
-)
-
-// Sort order
-type RadarBGPLeakEventsParamsSortOrder string
-
-const (
- RadarBGPLeakEventsParamsSortOrderAsc RadarBGPLeakEventsParamsSortOrder = "ASC"
- RadarBGPLeakEventsParamsSortOrderDesc RadarBGPLeakEventsParamsSortOrder = "DESC"
-)
-
-type RadarBGPLeakEventsResponseEnvelope struct {
- Result RadarBGPLeakEventsResponse `json:"result,required"`
- ResultInfo RadarBGPLeakEventsResponseEnvelopeResultInfo `json:"result_info,required"`
- Success bool `json:"success,required"`
- JSON radarBGPLeakEventsResponseEnvelopeJSON `json:"-"`
-}
-
-// radarBGPLeakEventsResponseEnvelopeJSON contains the JSON metadata for the struct
-// [RadarBGPLeakEventsResponseEnvelope]
-type radarBGPLeakEventsResponseEnvelopeJSON struct {
- Result apijson.Field
- ResultInfo apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarBGPLeakEventsResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarBGPLeakEventsResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarBGPLeakEventsResponseEnvelopeResultInfo struct {
- Count int64 `json:"count,required"`
- Page int64 `json:"page,required"`
- PerPage int64 `json:"per_page,required"`
- TotalCount int64 `json:"total_count,required"`
- JSON radarBGPLeakEventsResponseEnvelopeResultInfoJSON `json:"-"`
-}
-
-// radarBGPLeakEventsResponseEnvelopeResultInfoJSON contains the JSON metadata for
-// the struct [RadarBGPLeakEventsResponseEnvelopeResultInfo]
-type radarBGPLeakEventsResponseEnvelopeResultInfoJSON struct {
- Count apijson.Field
- Page apijson.Field
- PerPage apijson.Field
- TotalCount apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarBGPLeakEventsResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarBGPLeakEventsResponseEnvelopeResultInfoJSON) RawJSON() string {
- return r.raw
-}
diff --git a/radarbgpleak_test.go b/radarbgpleak_test.go
deleted file mode 100644
index 094d96fb136..00000000000
--- a/radarbgpleak_test.go
+++ /dev/null
@@ -1,52 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
- "time"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRadarBGPLeakEventsWithOptionalParams(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"),
- )
- _, err := client.Radar.BGP.Leaks.Events(context.TODO(), cloudflare.RadarBGPLeakEventsParams{
- DateEnd: cloudflare.F(time.Now()),
- DateRange: cloudflare.F(cloudflare.RadarBGPLeakEventsParamsDateRange7d),
- DateStart: cloudflare.F(time.Now()),
- EventID: cloudflare.F(int64(0)),
- Format: cloudflare.F(cloudflare.RadarBGPLeakEventsParamsFormatJson),
- InvolvedASN: cloudflare.F(int64(0)),
- InvolvedCountry: cloudflare.F("string"),
- LeakASN: cloudflare.F(int64(0)),
- Page: cloudflare.F(int64(0)),
- PerPage: cloudflare.F(int64(0)),
- SortBy: cloudflare.F(cloudflare.RadarBGPLeakEventsParamsSortByTime),
- SortOrder: cloudflare.F(cloudflare.RadarBGPLeakEventsParamsSortOrderDesc),
- })
- 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/radarbgproute.go b/radarbgproute.go
deleted file mode 100644
index b59cfa25421..00000000000
--- a/radarbgproute.go
+++ /dev/null
@@ -1,714 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarBGPRouteService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewRadarBGPRouteService] method
-// instead.
-type RadarBGPRouteService struct {
- Options []option.RequestOption
-}
-
-// NewRadarBGPRouteService generates a new service that applies the given options
-// to each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewRadarBGPRouteService(opts ...option.RequestOption) (r *RadarBGPRouteService) {
- r = &RadarBGPRouteService{}
- r.Options = opts
- return
-}
-
-// List all Multi-origin AS (MOAS) prefixes on the global routing tables.
-func (r *RadarBGPRouteService) Moas(ctx context.Context, query RadarBGPRouteMoasParams, opts ...option.RequestOption) (res *RadarBGPRouteMoasResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarBGPRouteMoasResponseEnvelope
- path := "radar/bgp/routes/moas"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Lookup prefix-to-origin mapping on global routing tables.
-func (r *RadarBGPRouteService) Pfx2as(ctx context.Context, query RadarBGPRoutePfx2asParams, opts ...option.RequestOption) (res *RadarBGPRoutePfx2asResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarBGPRoutePfx2asResponseEnvelope
- path := "radar/bgp/routes/pfx2as"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Get the BGP routing table stats (Beta).
-func (r *RadarBGPRouteService) Stats(ctx context.Context, query RadarBGPRouteStatsParams, opts ...option.RequestOption) (res *RadarBGPRouteStatsResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarBGPRouteStatsResponseEnvelope
- path := "radar/bgp/routes/stats"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Gets time-series data for the announced IP space count, represented as the
-// number of IPv4 /24s and IPv6 /48s, for a given ASN.
-func (r *RadarBGPRouteService) Timeseries(ctx context.Context, query RadarBGPRouteTimeseriesParams, opts ...option.RequestOption) (res *RadarBGPRouteTimeseriesResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarBGPRouteTimeseriesResponseEnvelope
- path := "radar/bgp/routes/timeseries"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type RadarBGPRouteMoasResponse struct {
- Meta RadarBGPRouteMoasResponseMeta `json:"meta,required"`
- Moas []RadarBGPRouteMoasResponseMoa `json:"moas,required"`
- JSON radarBGPRouteMoasResponseJSON `json:"-"`
-}
-
-// radarBGPRouteMoasResponseJSON contains the JSON metadata for the struct
-// [RadarBGPRouteMoasResponse]
-type radarBGPRouteMoasResponseJSON struct {
- Meta apijson.Field
- Moas apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarBGPRouteMoasResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarBGPRouteMoasResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarBGPRouteMoasResponseMeta struct {
- DataTime string `json:"data_time,required"`
- QueryTime string `json:"query_time,required"`
- TotalPeers int64 `json:"total_peers,required"`
- JSON radarBGPRouteMoasResponseMetaJSON `json:"-"`
-}
-
-// radarBGPRouteMoasResponseMetaJSON contains the JSON metadata for the struct
-// [RadarBGPRouteMoasResponseMeta]
-type radarBGPRouteMoasResponseMetaJSON struct {
- DataTime apijson.Field
- QueryTime apijson.Field
- TotalPeers apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarBGPRouteMoasResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarBGPRouteMoasResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarBGPRouteMoasResponseMoa struct {
- Origins []RadarBGPRouteMoasResponseMoasOrigin `json:"origins,required"`
- Prefix string `json:"prefix,required"`
- JSON radarBGPRouteMoasResponseMoaJSON `json:"-"`
-}
-
-// radarBGPRouteMoasResponseMoaJSON contains the JSON metadata for the struct
-// [RadarBGPRouteMoasResponseMoa]
-type radarBGPRouteMoasResponseMoaJSON struct {
- Origins apijson.Field
- Prefix apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarBGPRouteMoasResponseMoa) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarBGPRouteMoasResponseMoaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarBGPRouteMoasResponseMoasOrigin struct {
- Origin int64 `json:"origin,required"`
- PeerCount int64 `json:"peer_count,required"`
- RpkiValidation string `json:"rpki_validation,required"`
- JSON radarBGPRouteMoasResponseMoasOriginJSON `json:"-"`
-}
-
-// radarBGPRouteMoasResponseMoasOriginJSON contains the JSON metadata for the
-// struct [RadarBGPRouteMoasResponseMoasOrigin]
-type radarBGPRouteMoasResponseMoasOriginJSON struct {
- Origin apijson.Field
- PeerCount apijson.Field
- RpkiValidation apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarBGPRouteMoasResponseMoasOrigin) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarBGPRouteMoasResponseMoasOriginJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarBGPRoutePfx2asResponse struct {
- Meta RadarBGPRoutePfx2asResponseMeta `json:"meta,required"`
- PrefixOrigins []RadarBGPRoutePfx2asResponsePrefixOrigin `json:"prefix_origins,required"`
- JSON radarBGPRoutePfx2asResponseJSON `json:"-"`
-}
-
-// radarBGPRoutePfx2asResponseJSON contains the JSON metadata for the struct
-// [RadarBGPRoutePfx2asResponse]
-type radarBGPRoutePfx2asResponseJSON struct {
- Meta apijson.Field
- PrefixOrigins apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarBGPRoutePfx2asResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarBGPRoutePfx2asResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarBGPRoutePfx2asResponseMeta struct {
- DataTime string `json:"data_time,required"`
- QueryTime string `json:"query_time,required"`
- TotalPeers int64 `json:"total_peers,required"`
- JSON radarBGPRoutePfx2asResponseMetaJSON `json:"-"`
-}
-
-// radarBGPRoutePfx2asResponseMetaJSON contains the JSON metadata for the struct
-// [RadarBGPRoutePfx2asResponseMeta]
-type radarBGPRoutePfx2asResponseMetaJSON struct {
- DataTime apijson.Field
- QueryTime apijson.Field
- TotalPeers apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarBGPRoutePfx2asResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarBGPRoutePfx2asResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarBGPRoutePfx2asResponsePrefixOrigin struct {
- Origin int64 `json:"origin,required"`
- PeerCount int64 `json:"peer_count,required"`
- Prefix string `json:"prefix,required"`
- RpkiValidation string `json:"rpki_validation,required"`
- JSON radarBGPRoutePfx2asResponsePrefixOriginJSON `json:"-"`
-}
-
-// radarBGPRoutePfx2asResponsePrefixOriginJSON contains the JSON metadata for the
-// struct [RadarBGPRoutePfx2asResponsePrefixOrigin]
-type radarBGPRoutePfx2asResponsePrefixOriginJSON struct {
- Origin apijson.Field
- PeerCount apijson.Field
- Prefix apijson.Field
- RpkiValidation apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarBGPRoutePfx2asResponsePrefixOrigin) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarBGPRoutePfx2asResponsePrefixOriginJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarBGPRouteStatsResponse struct {
- Meta RadarBGPRouteStatsResponseMeta `json:"meta,required"`
- Stats RadarBGPRouteStatsResponseStats `json:"stats,required"`
- JSON radarBGPRouteStatsResponseJSON `json:"-"`
-}
-
-// radarBGPRouteStatsResponseJSON contains the JSON metadata for the struct
-// [RadarBGPRouteStatsResponse]
-type radarBGPRouteStatsResponseJSON struct {
- Meta apijson.Field
- Stats apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarBGPRouteStatsResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarBGPRouteStatsResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarBGPRouteStatsResponseMeta struct {
- DataTime string `json:"data_time,required"`
- QueryTime string `json:"query_time,required"`
- TotalPeers int64 `json:"total_peers,required"`
- JSON radarBGPRouteStatsResponseMetaJSON `json:"-"`
-}
-
-// radarBGPRouteStatsResponseMetaJSON contains the JSON metadata for the struct
-// [RadarBGPRouteStatsResponseMeta]
-type radarBGPRouteStatsResponseMetaJSON struct {
- DataTime apijson.Field
- QueryTime apijson.Field
- TotalPeers apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarBGPRouteStatsResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarBGPRouteStatsResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarBGPRouteStatsResponseStats struct {
- DistinctOrigins int64 `json:"distinct_origins,required"`
- DistinctOriginsIPV4 int64 `json:"distinct_origins_ipv4,required"`
- DistinctOriginsIPV6 int64 `json:"distinct_origins_ipv6,required"`
- DistinctPrefixes int64 `json:"distinct_prefixes,required"`
- DistinctPrefixesIPV4 int64 `json:"distinct_prefixes_ipv4,required"`
- DistinctPrefixesIPV6 int64 `json:"distinct_prefixes_ipv6,required"`
- RoutesInvalid int64 `json:"routes_invalid,required"`
- RoutesInvalidIPV4 int64 `json:"routes_invalid_ipv4,required"`
- RoutesInvalidIPV6 int64 `json:"routes_invalid_ipv6,required"`
- RoutesTotal int64 `json:"routes_total,required"`
- RoutesTotalIPV4 int64 `json:"routes_total_ipv4,required"`
- RoutesTotalIPV6 int64 `json:"routes_total_ipv6,required"`
- RoutesUnknown int64 `json:"routes_unknown,required"`
- RoutesUnknownIPV4 int64 `json:"routes_unknown_ipv4,required"`
- RoutesUnknownIPV6 int64 `json:"routes_unknown_ipv6,required"`
- RoutesValid int64 `json:"routes_valid,required"`
- RoutesValidIPV4 int64 `json:"routes_valid_ipv4,required"`
- RoutesValidIPV6 int64 `json:"routes_valid_ipv6,required"`
- JSON radarBGPRouteStatsResponseStatsJSON `json:"-"`
-}
-
-// radarBGPRouteStatsResponseStatsJSON contains the JSON metadata for the struct
-// [RadarBGPRouteStatsResponseStats]
-type radarBGPRouteStatsResponseStatsJSON struct {
- DistinctOrigins apijson.Field
- DistinctOriginsIPV4 apijson.Field
- DistinctOriginsIPV6 apijson.Field
- DistinctPrefixes apijson.Field
- DistinctPrefixesIPV4 apijson.Field
- DistinctPrefixesIPV6 apijson.Field
- RoutesInvalid apijson.Field
- RoutesInvalidIPV4 apijson.Field
- RoutesInvalidIPV6 apijson.Field
- RoutesTotal apijson.Field
- RoutesTotalIPV4 apijson.Field
- RoutesTotalIPV6 apijson.Field
- RoutesUnknown apijson.Field
- RoutesUnknownIPV4 apijson.Field
- RoutesUnknownIPV6 apijson.Field
- RoutesValid apijson.Field
- RoutesValidIPV4 apijson.Field
- RoutesValidIPV6 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarBGPRouteStatsResponseStats) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarBGPRouteStatsResponseStatsJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarBGPRouteTimeseriesResponse struct {
- Meta RadarBGPRouteTimeseriesResponseMeta `json:"meta,required"`
- SerieIPV4_24s RadarBGPRouteTimeseriesResponseSerieIPV4_24s `json:"serie_ipv4_24s,required"`
- SerieIPV6_48s RadarBGPRouteTimeseriesResponseSerieIPV6_48s `json:"serie_ipv6_48s,required"`
- JSON radarBGPRouteTimeseriesResponseJSON `json:"-"`
-}
-
-// radarBGPRouteTimeseriesResponseJSON contains the JSON metadata for the struct
-// [RadarBGPRouteTimeseriesResponse]
-type radarBGPRouteTimeseriesResponseJSON struct {
- Meta apijson.Field
- SerieIPV4_24s apijson.Field
- SerieIPV6_48s apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarBGPRouteTimeseriesResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarBGPRouteTimeseriesResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarBGPRouteTimeseriesResponseMeta struct {
- DateRange []RadarBGPRouteTimeseriesResponseMetaDateRange `json:"dateRange,required"`
- JSON radarBGPRouteTimeseriesResponseMetaJSON `json:"-"`
-}
-
-// radarBGPRouteTimeseriesResponseMetaJSON contains the JSON metadata for the
-// struct [RadarBGPRouteTimeseriesResponseMeta]
-type radarBGPRouteTimeseriesResponseMetaJSON struct {
- DateRange apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarBGPRouteTimeseriesResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarBGPRouteTimeseriesResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarBGPRouteTimeseriesResponseMetaDateRange 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 radarBGPRouteTimeseriesResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarBGPRouteTimeseriesResponseMetaDateRangeJSON contains the JSON metadata for
-// the struct [RadarBGPRouteTimeseriesResponseMetaDateRange]
-type radarBGPRouteTimeseriesResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarBGPRouteTimeseriesResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarBGPRouteTimeseriesResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarBGPRouteTimeseriesResponseSerieIPV4_24s struct {
- Timestamps []time.Time `json:"timestamps,required" format:"date-time"`
- Values []int64 `json:"values,required"`
- JSON radarBGPRouteTimeseriesResponseSerieIPV4_24sJSON `json:"-"`
-}
-
-// radarBGPRouteTimeseriesResponseSerieIPV4_24sJSON contains the JSON metadata for
-// the struct [RadarBGPRouteTimeseriesResponseSerieIPV4_24s]
-type radarBGPRouteTimeseriesResponseSerieIPV4_24sJSON struct {
- Timestamps apijson.Field
- Values apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarBGPRouteTimeseriesResponseSerieIPV4_24s) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarBGPRouteTimeseriesResponseSerieIPV4_24sJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarBGPRouteTimeseriesResponseSerieIPV6_48s struct {
- Timestamps []time.Time `json:"timestamps,required" format:"date-time"`
- Values []int64 `json:"values,required"`
- JSON radarBGPRouteTimeseriesResponseSerieIPV6_48sJSON `json:"-"`
-}
-
-// radarBGPRouteTimeseriesResponseSerieIPV6_48sJSON contains the JSON metadata for
-// the struct [RadarBGPRouteTimeseriesResponseSerieIPV6_48s]
-type radarBGPRouteTimeseriesResponseSerieIPV6_48sJSON struct {
- Timestamps apijson.Field
- Values apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarBGPRouteTimeseriesResponseSerieIPV6_48s) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarBGPRouteTimeseriesResponseSerieIPV6_48sJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarBGPRouteMoasParams struct {
- // Format results are returned in.
- Format param.Field[RadarBGPRouteMoasParamsFormat] `query:"format"`
- // Lookup only RPKI invalid MOASes
- InvalidOnly param.Field[bool] `query:"invalid_only"`
- // Lookup MOASes originated by the given ASN
- Origin param.Field[int64] `query:"origin"`
- // Lookup MOASes by prefix
- Prefix param.Field[string] `query:"prefix"`
-}
-
-// URLQuery serializes [RadarBGPRouteMoasParams]'s query parameters as
-// `url.Values`.
-func (r RadarBGPRouteMoasParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Format results are returned in.
-type RadarBGPRouteMoasParamsFormat string
-
-const (
- RadarBGPRouteMoasParamsFormatJson RadarBGPRouteMoasParamsFormat = "JSON"
- RadarBGPRouteMoasParamsFormatCsv RadarBGPRouteMoasParamsFormat = "CSV"
-)
-
-type RadarBGPRouteMoasResponseEnvelope struct {
- Result RadarBGPRouteMoasResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarBGPRouteMoasResponseEnvelopeJSON `json:"-"`
-}
-
-// radarBGPRouteMoasResponseEnvelopeJSON contains the JSON metadata for the struct
-// [RadarBGPRouteMoasResponseEnvelope]
-type radarBGPRouteMoasResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarBGPRouteMoasResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarBGPRouteMoasResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarBGPRoutePfx2asParams struct {
- // Format results are returned in.
- Format param.Field[RadarBGPRoutePfx2asParamsFormat] `query:"format"`
- // Lookup prefixes originated by the given ASN
- Origin param.Field[int64] `query:"origin"`
- // Lookup origins of the given prefix
- Prefix param.Field[string] `query:"prefix"`
- // Return only results with matching rpki status: valid, invalid or unknown
- RpkiStatus param.Field[RadarBGPRoutePfx2asParamsRpkiStatus] `query:"rpkiStatus"`
-}
-
-// URLQuery serializes [RadarBGPRoutePfx2asParams]'s query parameters as
-// `url.Values`.
-func (r RadarBGPRoutePfx2asParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Format results are returned in.
-type RadarBGPRoutePfx2asParamsFormat string
-
-const (
- RadarBGPRoutePfx2asParamsFormatJson RadarBGPRoutePfx2asParamsFormat = "JSON"
- RadarBGPRoutePfx2asParamsFormatCsv RadarBGPRoutePfx2asParamsFormat = "CSV"
-)
-
-// Return only results with matching rpki status: valid, invalid or unknown
-type RadarBGPRoutePfx2asParamsRpkiStatus string
-
-const (
- RadarBGPRoutePfx2asParamsRpkiStatusValid RadarBGPRoutePfx2asParamsRpkiStatus = "VALID"
- RadarBGPRoutePfx2asParamsRpkiStatusInvalid RadarBGPRoutePfx2asParamsRpkiStatus = "INVALID"
- RadarBGPRoutePfx2asParamsRpkiStatusUnknown RadarBGPRoutePfx2asParamsRpkiStatus = "UNKNOWN"
-)
-
-type RadarBGPRoutePfx2asResponseEnvelope struct {
- Result RadarBGPRoutePfx2asResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarBGPRoutePfx2asResponseEnvelopeJSON `json:"-"`
-}
-
-// radarBGPRoutePfx2asResponseEnvelopeJSON contains the JSON metadata for the
-// struct [RadarBGPRoutePfx2asResponseEnvelope]
-type radarBGPRoutePfx2asResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarBGPRoutePfx2asResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarBGPRoutePfx2asResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarBGPRouteStatsParams struct {
- // Single ASN as integer.
- ASN param.Field[int64] `query:"asn"`
- // Format results are returned in.
- Format param.Field[RadarBGPRouteStatsParamsFormat] `query:"format"`
- // Location Alpha2 code.
- Location param.Field[string] `query:"location"`
-}
-
-// URLQuery serializes [RadarBGPRouteStatsParams]'s query parameters as
-// `url.Values`.
-func (r RadarBGPRouteStatsParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Format results are returned in.
-type RadarBGPRouteStatsParamsFormat string
-
-const (
- RadarBGPRouteStatsParamsFormatJson RadarBGPRouteStatsParamsFormat = "JSON"
- RadarBGPRouteStatsParamsFormatCsv RadarBGPRouteStatsParamsFormat = "CSV"
-)
-
-type RadarBGPRouteStatsResponseEnvelope struct {
- Result RadarBGPRouteStatsResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarBGPRouteStatsResponseEnvelopeJSON `json:"-"`
-}
-
-// radarBGPRouteStatsResponseEnvelopeJSON contains the JSON metadata for the struct
-// [RadarBGPRouteStatsResponseEnvelope]
-type radarBGPRouteStatsResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarBGPRouteStatsResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarBGPRouteStatsResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarBGPRouteTimeseriesParams struct {
- // Single ASN as integer.
- ASN param.Field[int64] `query:"asn"`
- // End of the date range (inclusive).
- DateEnd param.Field[time.Time] `query:"dateEnd" format:"date-time"`
- // Shorthand date ranges for the last X days - use when you don't need specific
- // start and end dates.
- DateRange param.Field[RadarBGPRouteTimeseriesParamsDateRange] `query:"dateRange"`
- // Start of the date range (inclusive).
- DateStart param.Field[time.Time] `query:"dateStart" format:"date-time"`
- // Format results are returned in.
- Format param.Field[RadarBGPRouteTimeseriesParamsFormat] `query:"format"`
-}
-
-// URLQuery serializes [RadarBGPRouteTimeseriesParams]'s query parameters as
-// `url.Values`.
-func (r RadarBGPRouteTimeseriesParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Shorthand date ranges for the last X days - use when you don't need specific
-// start and end dates.
-type RadarBGPRouteTimeseriesParamsDateRange string
-
-const (
- RadarBGPRouteTimeseriesParamsDateRange1d RadarBGPRouteTimeseriesParamsDateRange = "1d"
- RadarBGPRouteTimeseriesParamsDateRange2d RadarBGPRouteTimeseriesParamsDateRange = "2d"
- RadarBGPRouteTimeseriesParamsDateRange7d RadarBGPRouteTimeseriesParamsDateRange = "7d"
- RadarBGPRouteTimeseriesParamsDateRange14d RadarBGPRouteTimeseriesParamsDateRange = "14d"
- RadarBGPRouteTimeseriesParamsDateRange28d RadarBGPRouteTimeseriesParamsDateRange = "28d"
- RadarBGPRouteTimeseriesParamsDateRange12w RadarBGPRouteTimeseriesParamsDateRange = "12w"
- RadarBGPRouteTimeseriesParamsDateRange24w RadarBGPRouteTimeseriesParamsDateRange = "24w"
- RadarBGPRouteTimeseriesParamsDateRange52w RadarBGPRouteTimeseriesParamsDateRange = "52w"
- RadarBGPRouteTimeseriesParamsDateRange1dControl RadarBGPRouteTimeseriesParamsDateRange = "1dControl"
- RadarBGPRouteTimeseriesParamsDateRange2dControl RadarBGPRouteTimeseriesParamsDateRange = "2dControl"
- RadarBGPRouteTimeseriesParamsDateRange7dControl RadarBGPRouteTimeseriesParamsDateRange = "7dControl"
- RadarBGPRouteTimeseriesParamsDateRange14dControl RadarBGPRouteTimeseriesParamsDateRange = "14dControl"
- RadarBGPRouteTimeseriesParamsDateRange28dControl RadarBGPRouteTimeseriesParamsDateRange = "28dControl"
- RadarBGPRouteTimeseriesParamsDateRange12wControl RadarBGPRouteTimeseriesParamsDateRange = "12wControl"
- RadarBGPRouteTimeseriesParamsDateRange24wControl RadarBGPRouteTimeseriesParamsDateRange = "24wControl"
-)
-
-// Format results are returned in.
-type RadarBGPRouteTimeseriesParamsFormat string
-
-const (
- RadarBGPRouteTimeseriesParamsFormatJson RadarBGPRouteTimeseriesParamsFormat = "JSON"
- RadarBGPRouteTimeseriesParamsFormatCsv RadarBGPRouteTimeseriesParamsFormat = "CSV"
-)
-
-type RadarBGPRouteTimeseriesResponseEnvelope struct {
- Result RadarBGPRouteTimeseriesResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarBGPRouteTimeseriesResponseEnvelopeJSON `json:"-"`
-}
-
-// radarBGPRouteTimeseriesResponseEnvelopeJSON contains the JSON metadata for the
-// struct [RadarBGPRouteTimeseriesResponseEnvelope]
-type radarBGPRouteTimeseriesResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarBGPRouteTimeseriesResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarBGPRouteTimeseriesResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
diff --git a/radarbgproute_test.go b/radarbgproute_test.go
deleted file mode 100644
index 2c00ce6b696..00000000000
--- a/radarbgproute_test.go
+++ /dev/null
@@ -1,131 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
- "time"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRadarBGPRouteMoasWithOptionalParams(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"),
- )
- _, err := client.Radar.BGP.Routes.Moas(context.TODO(), cloudflare.RadarBGPRouteMoasParams{
- Format: cloudflare.F(cloudflare.RadarBGPRouteMoasParamsFormatJson),
- InvalidOnly: cloudflare.F(true),
- Origin: cloudflare.F(int64(0)),
- Prefix: cloudflare.F("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())
- }
-}
-
-func TestRadarBGPRoutePfx2asWithOptionalParams(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"),
- )
- _, err := client.Radar.BGP.Routes.Pfx2as(context.TODO(), cloudflare.RadarBGPRoutePfx2asParams{
- Format: cloudflare.F(cloudflare.RadarBGPRoutePfx2asParamsFormatJson),
- Origin: cloudflare.F(int64(0)),
- Prefix: cloudflare.F("1.1.1.0/24"),
- RpkiStatus: cloudflare.F(cloudflare.RadarBGPRoutePfx2asParamsRpkiStatusInvalid),
- })
- 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())
- }
-}
-
-func TestRadarBGPRouteStatsWithOptionalParams(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"),
- )
- _, err := client.Radar.BGP.Routes.Stats(context.TODO(), cloudflare.RadarBGPRouteStatsParams{
- ASN: cloudflare.F(int64(0)),
- Format: cloudflare.F(cloudflare.RadarBGPRouteStatsParamsFormatJson),
- Location: cloudflare.F("US"),
- })
- 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())
- }
-}
-
-func TestRadarBGPRouteTimeseriesWithOptionalParams(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"),
- )
- _, err := client.Radar.BGP.Routes.Timeseries(context.TODO(), cloudflare.RadarBGPRouteTimeseriesParams{
- ASN: cloudflare.F(int64(0)),
- DateEnd: cloudflare.F(time.Now()),
- DateRange: cloudflare.F(cloudflare.RadarBGPRouteTimeseriesParamsDateRange7d),
- DateStart: cloudflare.F(time.Now()),
- Format: cloudflare.F(cloudflare.RadarBGPRouteTimeseriesParamsFormatJson),
- })
- 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/radarbgptop.go b/radarbgptop.go
deleted file mode 100644
index c96ebb1805b..00000000000
--- a/radarbgptop.go
+++ /dev/null
@@ -1,232 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarBGPTopService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewRadarBGPTopService] method
-// instead.
-type RadarBGPTopService struct {
- Options []option.RequestOption
- Ases *RadarBGPTopAseService
-}
-
-// NewRadarBGPTopService generates a new service that applies the given options to
-// each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewRadarBGPTopService(opts ...option.RequestOption) (r *RadarBGPTopService) {
- r = &RadarBGPTopService{}
- r.Options = opts
- r.Ases = NewRadarBGPTopAseService(opts...)
- return
-}
-
-// Get the top network prefixes by BGP updates. Values are a percentage out of the
-// total BGP updates.
-func (r *RadarBGPTopService) Prefixes(ctx context.Context, query RadarBGPTopPrefixesParams, opts ...option.RequestOption) (res *RadarBGPTopPrefixesResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarBGPTopPrefixesResponseEnvelope
- path := "radar/bgp/top/prefixes"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type RadarBGPTopPrefixesResponse struct {
- Meta RadarBGPTopPrefixesResponseMeta `json:"meta,required"`
- Top0 []RadarBGPTopPrefixesResponseTop0 `json:"top_0,required"`
- JSON radarBGPTopPrefixesResponseJSON `json:"-"`
-}
-
-// radarBGPTopPrefixesResponseJSON contains the JSON metadata for the struct
-// [RadarBGPTopPrefixesResponse]
-type radarBGPTopPrefixesResponseJSON struct {
- Meta apijson.Field
- Top0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarBGPTopPrefixesResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarBGPTopPrefixesResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarBGPTopPrefixesResponseMeta struct {
- DateRange []RadarBGPTopPrefixesResponseMetaDateRange `json:"dateRange,required"`
- JSON radarBGPTopPrefixesResponseMetaJSON `json:"-"`
-}
-
-// radarBGPTopPrefixesResponseMetaJSON contains the JSON metadata for the struct
-// [RadarBGPTopPrefixesResponseMeta]
-type radarBGPTopPrefixesResponseMetaJSON struct {
- DateRange apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarBGPTopPrefixesResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarBGPTopPrefixesResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarBGPTopPrefixesResponseMetaDateRange 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 radarBGPTopPrefixesResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarBGPTopPrefixesResponseMetaDateRangeJSON contains the JSON metadata for the
-// struct [RadarBGPTopPrefixesResponseMetaDateRange]
-type radarBGPTopPrefixesResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarBGPTopPrefixesResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarBGPTopPrefixesResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarBGPTopPrefixesResponseTop0 struct {
- Prefix string `json:"prefix,required"`
- Value string `json:"value,required"`
- JSON radarBGPTopPrefixesResponseTop0JSON `json:"-"`
-}
-
-// radarBGPTopPrefixesResponseTop0JSON contains the JSON metadata for the struct
-// [RadarBGPTopPrefixesResponseTop0]
-type radarBGPTopPrefixesResponseTop0JSON struct {
- Prefix apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarBGPTopPrefixesResponseTop0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarBGPTopPrefixesResponseTop0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarBGPTopPrefixesParams 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[[]RadarBGPTopPrefixesParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Format results are returned in.
- Format param.Field[RadarBGPTopPrefixesParamsFormat] `query:"format"`
- // Limit the number of objects in the response.
- Limit param.Field[int64] `query:"limit"`
- // Array of names that will be used to name the series in responses.
- Name param.Field[[]string] `query:"name"`
- // Array of BGP update types.
- UpdateType param.Field[[]RadarBGPTopPrefixesParamsUpdateType] `query:"updateType"`
-}
-
-// URLQuery serializes [RadarBGPTopPrefixesParams]'s query parameters as
-// `url.Values`.
-func (r RadarBGPTopPrefixesParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type RadarBGPTopPrefixesParamsDateRange string
-
-const (
- RadarBGPTopPrefixesParamsDateRange1d RadarBGPTopPrefixesParamsDateRange = "1d"
- RadarBGPTopPrefixesParamsDateRange2d RadarBGPTopPrefixesParamsDateRange = "2d"
- RadarBGPTopPrefixesParamsDateRange7d RadarBGPTopPrefixesParamsDateRange = "7d"
- RadarBGPTopPrefixesParamsDateRange14d RadarBGPTopPrefixesParamsDateRange = "14d"
- RadarBGPTopPrefixesParamsDateRange28d RadarBGPTopPrefixesParamsDateRange = "28d"
- RadarBGPTopPrefixesParamsDateRange12w RadarBGPTopPrefixesParamsDateRange = "12w"
- RadarBGPTopPrefixesParamsDateRange24w RadarBGPTopPrefixesParamsDateRange = "24w"
- RadarBGPTopPrefixesParamsDateRange52w RadarBGPTopPrefixesParamsDateRange = "52w"
- RadarBGPTopPrefixesParamsDateRange1dControl RadarBGPTopPrefixesParamsDateRange = "1dControl"
- RadarBGPTopPrefixesParamsDateRange2dControl RadarBGPTopPrefixesParamsDateRange = "2dControl"
- RadarBGPTopPrefixesParamsDateRange7dControl RadarBGPTopPrefixesParamsDateRange = "7dControl"
- RadarBGPTopPrefixesParamsDateRange14dControl RadarBGPTopPrefixesParamsDateRange = "14dControl"
- RadarBGPTopPrefixesParamsDateRange28dControl RadarBGPTopPrefixesParamsDateRange = "28dControl"
- RadarBGPTopPrefixesParamsDateRange12wControl RadarBGPTopPrefixesParamsDateRange = "12wControl"
- RadarBGPTopPrefixesParamsDateRange24wControl RadarBGPTopPrefixesParamsDateRange = "24wControl"
-)
-
-// Format results are returned in.
-type RadarBGPTopPrefixesParamsFormat string
-
-const (
- RadarBGPTopPrefixesParamsFormatJson RadarBGPTopPrefixesParamsFormat = "JSON"
- RadarBGPTopPrefixesParamsFormatCsv RadarBGPTopPrefixesParamsFormat = "CSV"
-)
-
-type RadarBGPTopPrefixesParamsUpdateType string
-
-const (
- RadarBGPTopPrefixesParamsUpdateTypeAnnouncement RadarBGPTopPrefixesParamsUpdateType = "ANNOUNCEMENT"
- RadarBGPTopPrefixesParamsUpdateTypeWithdrawal RadarBGPTopPrefixesParamsUpdateType = "WITHDRAWAL"
-)
-
-type RadarBGPTopPrefixesResponseEnvelope struct {
- Result RadarBGPTopPrefixesResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarBGPTopPrefixesResponseEnvelopeJSON `json:"-"`
-}
-
-// radarBGPTopPrefixesResponseEnvelopeJSON contains the JSON metadata for the
-// struct [RadarBGPTopPrefixesResponseEnvelope]
-type radarBGPTopPrefixesResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarBGPTopPrefixesResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarBGPTopPrefixesResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
diff --git a/radarbgptop_test.go b/radarbgptop_test.go
deleted file mode 100644
index 60cada0a40b..00000000000
--- a/radarbgptop_test.go
+++ /dev/null
@@ -1,48 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
- "time"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRadarBGPTopPrefixesWithOptionalParams(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"),
- )
- _, err := client.Radar.BGP.Top.Prefixes(context.TODO(), cloudflare.RadarBGPTopPrefixesParams{
- ASN: cloudflare.F([]string{"string", "string", "string"}),
- DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
- DateRange: cloudflare.F([]cloudflare.RadarBGPTopPrefixesParamsDateRange{cloudflare.RadarBGPTopPrefixesParamsDateRange1d, cloudflare.RadarBGPTopPrefixesParamsDateRange2d, cloudflare.RadarBGPTopPrefixesParamsDateRange7d}),
- DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
- Format: cloudflare.F(cloudflare.RadarBGPTopPrefixesParamsFormatJson),
- Limit: cloudflare.F(int64(5)),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- UpdateType: cloudflare.F([]cloudflare.RadarBGPTopPrefixesParamsUpdateType{cloudflare.RadarBGPTopPrefixesParamsUpdateTypeAnnouncement, cloudflare.RadarBGPTopPrefixesParamsUpdateTypeWithdrawal}),
- })
- 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/radarbgptopase.go b/radarbgptopase.go
deleted file mode 100644
index 449c4b968c7..00000000000
--- a/radarbgptopase.go
+++ /dev/null
@@ -1,375 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarBGPTopAseService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewRadarBGPTopAseService] method
-// instead.
-type RadarBGPTopAseService struct {
- Options []option.RequestOption
-}
-
-// NewRadarBGPTopAseService generates a new service that applies the given options
-// to each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewRadarBGPTopAseService(opts ...option.RequestOption) (r *RadarBGPTopAseService) {
- r = &RadarBGPTopAseService{}
- r.Options = opts
- return
-}
-
-// Get the top autonomous systems (AS) by BGP updates (announcements only). Values
-// are a percentage out of the total updates.
-func (r *RadarBGPTopAseService) Get(ctx context.Context, query RadarBGPTopAseGetParams, opts ...option.RequestOption) (res *RadarBGPTopAseGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarBGPTopAseGetResponseEnvelope
- path := "radar/bgp/top/ases"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Get the full list of autonomous systems on the global routing table ordered by
-// announced prefixes count. The data comes from public BGP MRT data archives and
-// updates every 2 hours.
-func (r *RadarBGPTopAseService) Prefixes(ctx context.Context, query RadarBGPTopAsePrefixesParams, opts ...option.RequestOption) (res *RadarBGPTopAsePrefixesResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarBGPTopAsePrefixesResponseEnvelope
- path := "radar/bgp/top/ases/prefixes"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type RadarBGPTopAseGetResponse struct {
- Meta RadarBGPTopAseGetResponseMeta `json:"meta,required"`
- Top0 []RadarBGPTopAseGetResponseTop0 `json:"top_0,required"`
- JSON radarBGPTopAseGetResponseJSON `json:"-"`
-}
-
-// radarBGPTopAseGetResponseJSON contains the JSON metadata for the struct
-// [RadarBGPTopAseGetResponse]
-type radarBGPTopAseGetResponseJSON struct {
- Meta apijson.Field
- Top0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarBGPTopAseGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarBGPTopAseGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarBGPTopAseGetResponseMeta struct {
- DateRange []RadarBGPTopAseGetResponseMetaDateRange `json:"dateRange,required"`
- JSON radarBGPTopAseGetResponseMetaJSON `json:"-"`
-}
-
-// radarBGPTopAseGetResponseMetaJSON contains the JSON metadata for the struct
-// [RadarBGPTopAseGetResponseMeta]
-type radarBGPTopAseGetResponseMetaJSON struct {
- DateRange apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarBGPTopAseGetResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarBGPTopAseGetResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarBGPTopAseGetResponseMetaDateRange 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 radarBGPTopAseGetResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarBGPTopAseGetResponseMetaDateRangeJSON contains the JSON metadata for the
-// struct [RadarBGPTopAseGetResponseMetaDateRange]
-type radarBGPTopAseGetResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarBGPTopAseGetResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarBGPTopAseGetResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarBGPTopAseGetResponseTop0 struct {
- ASN int64 `json:"asn,required"`
- AsName string `json:"ASName,required"`
- // Percentage of updates by this AS out of the total updates by all autonomous
- // systems.
- Value string `json:"value,required"`
- JSON radarBGPTopAseGetResponseTop0JSON `json:"-"`
-}
-
-// radarBGPTopAseGetResponseTop0JSON contains the JSON metadata for the struct
-// [RadarBGPTopAseGetResponseTop0]
-type radarBGPTopAseGetResponseTop0JSON struct {
- ASN apijson.Field
- AsName apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarBGPTopAseGetResponseTop0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarBGPTopAseGetResponseTop0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarBGPTopAsePrefixesResponse struct {
- ASNs []RadarBGPTopAsePrefixesResponseASN `json:"asns,required"`
- Meta RadarBGPTopAsePrefixesResponseMeta `json:"meta,required"`
- JSON radarBGPTopAsePrefixesResponseJSON `json:"-"`
-}
-
-// radarBGPTopAsePrefixesResponseJSON contains the JSON metadata for the struct
-// [RadarBGPTopAsePrefixesResponse]
-type radarBGPTopAsePrefixesResponseJSON struct {
- ASNs apijson.Field
- Meta apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarBGPTopAsePrefixesResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarBGPTopAsePrefixesResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarBGPTopAsePrefixesResponseASN struct {
- ASN int64 `json:"asn,required"`
- Country string `json:"country,required"`
- Name string `json:"name,required"`
- PfxsCount int64 `json:"pfxs_count,required"`
- JSON radarBGPTopAsePrefixesResponseASNJSON `json:"-"`
-}
-
-// radarBGPTopAsePrefixesResponseASNJSON contains the JSON metadata for the struct
-// [RadarBGPTopAsePrefixesResponseASN]
-type radarBGPTopAsePrefixesResponseASNJSON struct {
- ASN apijson.Field
- Country apijson.Field
- Name apijson.Field
- PfxsCount apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarBGPTopAsePrefixesResponseASN) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarBGPTopAsePrefixesResponseASNJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarBGPTopAsePrefixesResponseMeta struct {
- DataTime string `json:"data_time,required"`
- QueryTime string `json:"query_time,required"`
- TotalPeers int64 `json:"total_peers,required"`
- JSON radarBGPTopAsePrefixesResponseMetaJSON `json:"-"`
-}
-
-// radarBGPTopAsePrefixesResponseMetaJSON contains the JSON metadata for the struct
-// [RadarBGPTopAsePrefixesResponseMeta]
-type radarBGPTopAsePrefixesResponseMetaJSON struct {
- DataTime apijson.Field
- QueryTime apijson.Field
- TotalPeers apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarBGPTopAsePrefixesResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarBGPTopAsePrefixesResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarBGPTopAseGetParams 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[[]RadarBGPTopAseGetParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Format results are returned in.
- Format param.Field[RadarBGPTopAseGetParamsFormat] `query:"format"`
- // Limit the number of objects in the response.
- Limit param.Field[int64] `query:"limit"`
- // Array of names that will be used to name the series in responses.
- Name param.Field[[]string] `query:"name"`
- // Array of BGP network prefixes.
- Prefix param.Field[[]string] `query:"prefix"`
- // Array of BGP update types.
- UpdateType param.Field[[]RadarBGPTopAseGetParamsUpdateType] `query:"updateType"`
-}
-
-// URLQuery serializes [RadarBGPTopAseGetParams]'s query parameters as
-// `url.Values`.
-func (r RadarBGPTopAseGetParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type RadarBGPTopAseGetParamsDateRange string
-
-const (
- RadarBGPTopAseGetParamsDateRange1d RadarBGPTopAseGetParamsDateRange = "1d"
- RadarBGPTopAseGetParamsDateRange2d RadarBGPTopAseGetParamsDateRange = "2d"
- RadarBGPTopAseGetParamsDateRange7d RadarBGPTopAseGetParamsDateRange = "7d"
- RadarBGPTopAseGetParamsDateRange14d RadarBGPTopAseGetParamsDateRange = "14d"
- RadarBGPTopAseGetParamsDateRange28d RadarBGPTopAseGetParamsDateRange = "28d"
- RadarBGPTopAseGetParamsDateRange12w RadarBGPTopAseGetParamsDateRange = "12w"
- RadarBGPTopAseGetParamsDateRange24w RadarBGPTopAseGetParamsDateRange = "24w"
- RadarBGPTopAseGetParamsDateRange52w RadarBGPTopAseGetParamsDateRange = "52w"
- RadarBGPTopAseGetParamsDateRange1dControl RadarBGPTopAseGetParamsDateRange = "1dControl"
- RadarBGPTopAseGetParamsDateRange2dControl RadarBGPTopAseGetParamsDateRange = "2dControl"
- RadarBGPTopAseGetParamsDateRange7dControl RadarBGPTopAseGetParamsDateRange = "7dControl"
- RadarBGPTopAseGetParamsDateRange14dControl RadarBGPTopAseGetParamsDateRange = "14dControl"
- RadarBGPTopAseGetParamsDateRange28dControl RadarBGPTopAseGetParamsDateRange = "28dControl"
- RadarBGPTopAseGetParamsDateRange12wControl RadarBGPTopAseGetParamsDateRange = "12wControl"
- RadarBGPTopAseGetParamsDateRange24wControl RadarBGPTopAseGetParamsDateRange = "24wControl"
-)
-
-// Format results are returned in.
-type RadarBGPTopAseGetParamsFormat string
-
-const (
- RadarBGPTopAseGetParamsFormatJson RadarBGPTopAseGetParamsFormat = "JSON"
- RadarBGPTopAseGetParamsFormatCsv RadarBGPTopAseGetParamsFormat = "CSV"
-)
-
-type RadarBGPTopAseGetParamsUpdateType string
-
-const (
- RadarBGPTopAseGetParamsUpdateTypeAnnouncement RadarBGPTopAseGetParamsUpdateType = "ANNOUNCEMENT"
- RadarBGPTopAseGetParamsUpdateTypeWithdrawal RadarBGPTopAseGetParamsUpdateType = "WITHDRAWAL"
-)
-
-type RadarBGPTopAseGetResponseEnvelope struct {
- Result RadarBGPTopAseGetResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarBGPTopAseGetResponseEnvelopeJSON `json:"-"`
-}
-
-// radarBGPTopAseGetResponseEnvelopeJSON contains the JSON metadata for the struct
-// [RadarBGPTopAseGetResponseEnvelope]
-type radarBGPTopAseGetResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarBGPTopAseGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarBGPTopAseGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarBGPTopAsePrefixesParams struct {
- // Alpha-2 country code.
- Country param.Field[string] `query:"country"`
- // Format results are returned in.
- Format param.Field[RadarBGPTopAsePrefixesParamsFormat] `query:"format"`
- // Maximum number of ASes to return
- Limit param.Field[int64] `query:"limit"`
-}
-
-// URLQuery serializes [RadarBGPTopAsePrefixesParams]'s query parameters as
-// `url.Values`.
-func (r RadarBGPTopAsePrefixesParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Format results are returned in.
-type RadarBGPTopAsePrefixesParamsFormat string
-
-const (
- RadarBGPTopAsePrefixesParamsFormatJson RadarBGPTopAsePrefixesParamsFormat = "JSON"
- RadarBGPTopAsePrefixesParamsFormatCsv RadarBGPTopAsePrefixesParamsFormat = "CSV"
-)
-
-type RadarBGPTopAsePrefixesResponseEnvelope struct {
- Result RadarBGPTopAsePrefixesResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarBGPTopAsePrefixesResponseEnvelopeJSON `json:"-"`
-}
-
-// radarBGPTopAsePrefixesResponseEnvelopeJSON contains the JSON metadata for the
-// struct [RadarBGPTopAsePrefixesResponseEnvelope]
-type radarBGPTopAsePrefixesResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarBGPTopAsePrefixesResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarBGPTopAsePrefixesResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
diff --git a/radarbgptopase_test.go b/radarbgptopase_test.go
deleted file mode 100644
index 6ffdb048db1..00000000000
--- a/radarbgptopase_test.go
+++ /dev/null
@@ -1,77 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
- "time"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRadarBGPTopAseGetWithOptionalParams(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"),
- )
- _, err := client.Radar.BGP.Top.Ases.Get(context.TODO(), cloudflare.RadarBGPTopAseGetParams{
- ASN: cloudflare.F([]string{"string", "string", "string"}),
- DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
- DateRange: cloudflare.F([]cloudflare.RadarBGPTopAseGetParamsDateRange{cloudflare.RadarBGPTopAseGetParamsDateRange1d, cloudflare.RadarBGPTopAseGetParamsDateRange2d, cloudflare.RadarBGPTopAseGetParamsDateRange7d}),
- DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
- Format: cloudflare.F(cloudflare.RadarBGPTopAseGetParamsFormatJson),
- Limit: cloudflare.F(int64(5)),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- Prefix: cloudflare.F([]string{"string", "string", "string"}),
- UpdateType: cloudflare.F([]cloudflare.RadarBGPTopAseGetParamsUpdateType{cloudflare.RadarBGPTopAseGetParamsUpdateTypeAnnouncement, cloudflare.RadarBGPTopAseGetParamsUpdateTypeWithdrawal}),
- })
- 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())
- }
-}
-
-func TestRadarBGPTopAsePrefixesWithOptionalParams(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"),
- )
- _, err := client.Radar.BGP.Top.Ases.Prefixes(context.TODO(), cloudflare.RadarBGPTopAsePrefixesParams{
- Country: cloudflare.F("NZ"),
- Format: cloudflare.F(cloudflare.RadarBGPTopAsePrefixesParamsFormatJson),
- Limit: cloudflare.F(int64(10)),
- })
- 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/radarconnectiontampering.go b/radarconnectiontampering.go
deleted file mode 100644
index 897504b7e52..00000000000
--- a/radarconnectiontampering.go
+++ /dev/null
@@ -1,594 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarConnectionTamperingService contains methods and other services that help
-// with interacting with the cloudflare API. Note, unlike clients, this service
-// does not read variables from the environment automatically. You should not
-// instantiate this service directly, and instead use the
-// [NewRadarConnectionTamperingService] method instead.
-type RadarConnectionTamperingService struct {
- Options []option.RequestOption
-}
-
-// NewRadarConnectionTamperingService generates a new service that applies the
-// given options to each request. These options are applied after the parent
-// client's options (if there is one), and before any request-specific options.
-func NewRadarConnectionTamperingService(opts ...option.RequestOption) (r *RadarConnectionTamperingService) {
- r = &RadarConnectionTamperingService{}
- r.Options = opts
- return
-}
-
-// Distribution of connection tampering types over a given time period.
-func (r *RadarConnectionTamperingService) Summary(ctx context.Context, query RadarConnectionTamperingSummaryParams, opts ...option.RequestOption) (res *RadarConnectionTamperingSummaryResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarConnectionTamperingSummaryResponseEnvelope
- path := "radar/connection_tampering/summary"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Distribution of connection tampering types over time.
-func (r *RadarConnectionTamperingService) TimeseriesGroups(ctx context.Context, query RadarConnectionTamperingTimeseriesGroupsParams, opts ...option.RequestOption) (res *RadarConnectionTamperingTimeseriesGroupsResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarConnectionTamperingTimeseriesGroupsResponseEnvelope
- path := "radar/connection_tampering/timeseries_groups"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type RadarConnectionTamperingSummaryResponse struct {
- Meta RadarConnectionTamperingSummaryResponseMeta `json:"meta,required"`
- Summary0 RadarConnectionTamperingSummaryResponseSummary0 `json:"summary_0,required"`
- JSON radarConnectionTamperingSummaryResponseJSON `json:"-"`
-}
-
-// radarConnectionTamperingSummaryResponseJSON contains the JSON metadata for the
-// struct [RadarConnectionTamperingSummaryResponse]
-type radarConnectionTamperingSummaryResponseJSON struct {
- Meta apijson.Field
- Summary0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarConnectionTamperingSummaryResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarConnectionTamperingSummaryResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarConnectionTamperingSummaryResponseMeta struct {
- DateRange []RadarConnectionTamperingSummaryResponseMetaDateRange `json:"dateRange,required"`
- ConfidenceInfo RadarConnectionTamperingSummaryResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarConnectionTamperingSummaryResponseMetaJSON `json:"-"`
-}
-
-// radarConnectionTamperingSummaryResponseMetaJSON contains the JSON metadata for
-// the struct [RadarConnectionTamperingSummaryResponseMeta]
-type radarConnectionTamperingSummaryResponseMetaJSON struct {
- DateRange apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarConnectionTamperingSummaryResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarConnectionTamperingSummaryResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarConnectionTamperingSummaryResponseMetaDateRange 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 radarConnectionTamperingSummaryResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarConnectionTamperingSummaryResponseMetaDateRangeJSON contains the JSON
-// metadata for the struct [RadarConnectionTamperingSummaryResponseMetaDateRange]
-type radarConnectionTamperingSummaryResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarConnectionTamperingSummaryResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarConnectionTamperingSummaryResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarConnectionTamperingSummaryResponseMetaConfidenceInfo struct {
- Annotations []RadarConnectionTamperingSummaryResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarConnectionTamperingSummaryResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarConnectionTamperingSummaryResponseMetaConfidenceInfoJSON contains the JSON
-// metadata for the struct
-// [RadarConnectionTamperingSummaryResponseMetaConfidenceInfo]
-type radarConnectionTamperingSummaryResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarConnectionTamperingSummaryResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarConnectionTamperingSummaryResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarConnectionTamperingSummaryResponseMetaConfidenceInfoAnnotation 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 radarConnectionTamperingSummaryResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarConnectionTamperingSummaryResponseMetaConfidenceInfoAnnotationJSON contains
-// the JSON metadata for the struct
-// [RadarConnectionTamperingSummaryResponseMetaConfidenceInfoAnnotation]
-type radarConnectionTamperingSummaryResponseMetaConfidenceInfoAnnotationJSON 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 *RadarConnectionTamperingSummaryResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarConnectionTamperingSummaryResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarConnectionTamperingSummaryResponseSummary0 struct {
- // Connections matching signatures for tampering later in the connection, after the
- // transfer of multiple data packets.
- LaterInFlow string `json:"later_in_flow,required"`
- // Connections that do not match any tampering signatures.
- NoMatch string `json:"no_match,required"`
- // Connections matching signatures for tampering after the receipt of a SYN packet
- // and ACK packet, meaning the TCP connection was successfully established but the
- // server did not receive any subsequent packets.
- PostAck string `json:"post_ack,required"`
- // Connections matching signatures for tampering after the receipt of a packet with
- // PSH flag set, following connection establishment.
- PostPsh string `json:"post_psh,required"`
- // Connections matching signatures for tampering after the receipt of only a single
- // SYN packet, and before the handshake completes.
- PostSyn string `json:"post_syn,required"`
- JSON radarConnectionTamperingSummaryResponseSummary0JSON `json:"-"`
-}
-
-// radarConnectionTamperingSummaryResponseSummary0JSON contains the JSON metadata
-// for the struct [RadarConnectionTamperingSummaryResponseSummary0]
-type radarConnectionTamperingSummaryResponseSummary0JSON struct {
- LaterInFlow apijson.Field
- NoMatch apijson.Field
- PostAck apijson.Field
- PostPsh apijson.Field
- PostSyn apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarConnectionTamperingSummaryResponseSummary0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarConnectionTamperingSummaryResponseSummary0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarConnectionTamperingTimeseriesGroupsResponse struct {
- Meta RadarConnectionTamperingTimeseriesGroupsResponseMeta `json:"meta,required"`
- Serie0 RadarConnectionTamperingTimeseriesGroupsResponseSerie0 `json:"serie_0,required"`
- JSON radarConnectionTamperingTimeseriesGroupsResponseJSON `json:"-"`
-}
-
-// radarConnectionTamperingTimeseriesGroupsResponseJSON contains the JSON metadata
-// for the struct [RadarConnectionTamperingTimeseriesGroupsResponse]
-type radarConnectionTamperingTimeseriesGroupsResponseJSON struct {
- Meta apijson.Field
- Serie0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarConnectionTamperingTimeseriesGroupsResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarConnectionTamperingTimeseriesGroupsResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarConnectionTamperingTimeseriesGroupsResponseMeta struct {
- AggInterval string `json:"aggInterval,required"`
- DateRange []RadarConnectionTamperingTimeseriesGroupsResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated time.Time `json:"lastUpdated,required" format:"date-time"`
- ConfidenceInfo RadarConnectionTamperingTimeseriesGroupsResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarConnectionTamperingTimeseriesGroupsResponseMetaJSON `json:"-"`
-}
-
-// radarConnectionTamperingTimeseriesGroupsResponseMetaJSON contains the JSON
-// metadata for the struct [RadarConnectionTamperingTimeseriesGroupsResponseMeta]
-type radarConnectionTamperingTimeseriesGroupsResponseMetaJSON struct {
- AggInterval apijson.Field
- DateRange apijson.Field
- LastUpdated apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarConnectionTamperingTimeseriesGroupsResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarConnectionTamperingTimeseriesGroupsResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarConnectionTamperingTimeseriesGroupsResponseMetaDateRange 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 radarConnectionTamperingTimeseriesGroupsResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarConnectionTamperingTimeseriesGroupsResponseMetaDateRangeJSON contains the
-// JSON metadata for the struct
-// [RadarConnectionTamperingTimeseriesGroupsResponseMetaDateRange]
-type radarConnectionTamperingTimeseriesGroupsResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarConnectionTamperingTimeseriesGroupsResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarConnectionTamperingTimeseriesGroupsResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarConnectionTamperingTimeseriesGroupsResponseMetaConfidenceInfo struct {
- Annotations []RadarConnectionTamperingTimeseriesGroupsResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarConnectionTamperingTimeseriesGroupsResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarConnectionTamperingTimeseriesGroupsResponseMetaConfidenceInfoJSON contains
-// the JSON metadata for the struct
-// [RadarConnectionTamperingTimeseriesGroupsResponseMetaConfidenceInfo]
-type radarConnectionTamperingTimeseriesGroupsResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarConnectionTamperingTimeseriesGroupsResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarConnectionTamperingTimeseriesGroupsResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarConnectionTamperingTimeseriesGroupsResponseMetaConfidenceInfoAnnotation 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 radarConnectionTamperingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarConnectionTamperingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationJSON
-// contains the JSON metadata for the struct
-// [RadarConnectionTamperingTimeseriesGroupsResponseMetaConfidenceInfoAnnotation]
-type radarConnectionTamperingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationJSON 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 *RadarConnectionTamperingTimeseriesGroupsResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarConnectionTamperingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarConnectionTamperingTimeseriesGroupsResponseSerie0 struct {
- // Connections matching signatures for tampering later in the connection, after the
- // transfer of multiple data packets.
- LaterInFlow []string `json:"later_in_flow,required"`
- // Connections that do not match any tampering signatures.
- NoMatch []string `json:"no_match,required"`
- // Connections matching signatures for tampering after the receipt of a SYN packet
- // and ACK packet, meaning the TCP connection was successfully established but the
- // server did not receive any subsequent packets.
- PostAck []string `json:"post_ack,required"`
- // Connections matching signatures for tampering after the receipt of a packet with
- // PSH flag set, following connection establishment.
- PostPsh []string `json:"post_psh,required"`
- // Connections matching signatures for tampering after the receipt of only a single
- // SYN packet, and before the handshake completes.
- PostSyn []string `json:"post_syn,required"`
- Timestamps []time.Time `json:"timestamps,required" format:"date-time"`
- JSON radarConnectionTamperingTimeseriesGroupsResponseSerie0JSON `json:"-"`
-}
-
-// radarConnectionTamperingTimeseriesGroupsResponseSerie0JSON contains the JSON
-// metadata for the struct [RadarConnectionTamperingTimeseriesGroupsResponseSerie0]
-type radarConnectionTamperingTimeseriesGroupsResponseSerie0JSON struct {
- LaterInFlow apijson.Field
- NoMatch apijson.Field
- PostAck apijson.Field
- PostPsh apijson.Field
- PostSyn apijson.Field
- Timestamps apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarConnectionTamperingTimeseriesGroupsResponseSerie0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarConnectionTamperingTimeseriesGroupsResponseSerie0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarConnectionTamperingSummaryParams 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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarConnectionTamperingSummaryParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Format results are returned in.
- Format param.Field[RadarConnectionTamperingSummaryParamsFormat] `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"`
-}
-
-// URLQuery serializes [RadarConnectionTamperingSummaryParams]'s query parameters
-// as `url.Values`.
-func (r RadarConnectionTamperingSummaryParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type RadarConnectionTamperingSummaryParamsDateRange string
-
-const (
- RadarConnectionTamperingSummaryParamsDateRange1d RadarConnectionTamperingSummaryParamsDateRange = "1d"
- RadarConnectionTamperingSummaryParamsDateRange2d RadarConnectionTamperingSummaryParamsDateRange = "2d"
- RadarConnectionTamperingSummaryParamsDateRange7d RadarConnectionTamperingSummaryParamsDateRange = "7d"
- RadarConnectionTamperingSummaryParamsDateRange14d RadarConnectionTamperingSummaryParamsDateRange = "14d"
- RadarConnectionTamperingSummaryParamsDateRange28d RadarConnectionTamperingSummaryParamsDateRange = "28d"
- RadarConnectionTamperingSummaryParamsDateRange12w RadarConnectionTamperingSummaryParamsDateRange = "12w"
- RadarConnectionTamperingSummaryParamsDateRange24w RadarConnectionTamperingSummaryParamsDateRange = "24w"
- RadarConnectionTamperingSummaryParamsDateRange52w RadarConnectionTamperingSummaryParamsDateRange = "52w"
- RadarConnectionTamperingSummaryParamsDateRange1dControl RadarConnectionTamperingSummaryParamsDateRange = "1dControl"
- RadarConnectionTamperingSummaryParamsDateRange2dControl RadarConnectionTamperingSummaryParamsDateRange = "2dControl"
- RadarConnectionTamperingSummaryParamsDateRange7dControl RadarConnectionTamperingSummaryParamsDateRange = "7dControl"
- RadarConnectionTamperingSummaryParamsDateRange14dControl RadarConnectionTamperingSummaryParamsDateRange = "14dControl"
- RadarConnectionTamperingSummaryParamsDateRange28dControl RadarConnectionTamperingSummaryParamsDateRange = "28dControl"
- RadarConnectionTamperingSummaryParamsDateRange12wControl RadarConnectionTamperingSummaryParamsDateRange = "12wControl"
- RadarConnectionTamperingSummaryParamsDateRange24wControl RadarConnectionTamperingSummaryParamsDateRange = "24wControl"
-)
-
-// Format results are returned in.
-type RadarConnectionTamperingSummaryParamsFormat string
-
-const (
- RadarConnectionTamperingSummaryParamsFormatJson RadarConnectionTamperingSummaryParamsFormat = "JSON"
- RadarConnectionTamperingSummaryParamsFormatCsv RadarConnectionTamperingSummaryParamsFormat = "CSV"
-)
-
-type RadarConnectionTamperingSummaryResponseEnvelope struct {
- Result RadarConnectionTamperingSummaryResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarConnectionTamperingSummaryResponseEnvelopeJSON `json:"-"`
-}
-
-// radarConnectionTamperingSummaryResponseEnvelopeJSON contains the JSON metadata
-// for the struct [RadarConnectionTamperingSummaryResponseEnvelope]
-type radarConnectionTamperingSummaryResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarConnectionTamperingSummaryResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarConnectionTamperingSummaryResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarConnectionTamperingTimeseriesGroupsParams struct {
- // Aggregation interval results should be returned in (for example, in 15 minutes
- // or 1 hour intervals). Refer to
- // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
- AggInterval param.Field[RadarConnectionTamperingTimeseriesGroupsParamsAggInterval] `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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarConnectionTamperingTimeseriesGroupsParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Format results are returned in.
- Format param.Field[RadarConnectionTamperingTimeseriesGroupsParamsFormat] `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"`
-}
-
-// URLQuery serializes [RadarConnectionTamperingTimeseriesGroupsParams]'s query
-// parameters as `url.Values`.
-func (r RadarConnectionTamperingTimeseriesGroupsParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Aggregation interval results should be returned in (for example, in 15 minutes
-// or 1 hour intervals). Refer to
-// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
-type RadarConnectionTamperingTimeseriesGroupsParamsAggInterval string
-
-const (
- RadarConnectionTamperingTimeseriesGroupsParamsAggInterval15m RadarConnectionTamperingTimeseriesGroupsParamsAggInterval = "15m"
- RadarConnectionTamperingTimeseriesGroupsParamsAggInterval1h RadarConnectionTamperingTimeseriesGroupsParamsAggInterval = "1h"
- RadarConnectionTamperingTimeseriesGroupsParamsAggInterval1d RadarConnectionTamperingTimeseriesGroupsParamsAggInterval = "1d"
- RadarConnectionTamperingTimeseriesGroupsParamsAggInterval1w RadarConnectionTamperingTimeseriesGroupsParamsAggInterval = "1w"
-)
-
-type RadarConnectionTamperingTimeseriesGroupsParamsDateRange string
-
-const (
- RadarConnectionTamperingTimeseriesGroupsParamsDateRange1d RadarConnectionTamperingTimeseriesGroupsParamsDateRange = "1d"
- RadarConnectionTamperingTimeseriesGroupsParamsDateRange2d RadarConnectionTamperingTimeseriesGroupsParamsDateRange = "2d"
- RadarConnectionTamperingTimeseriesGroupsParamsDateRange7d RadarConnectionTamperingTimeseriesGroupsParamsDateRange = "7d"
- RadarConnectionTamperingTimeseriesGroupsParamsDateRange14d RadarConnectionTamperingTimeseriesGroupsParamsDateRange = "14d"
- RadarConnectionTamperingTimeseriesGroupsParamsDateRange28d RadarConnectionTamperingTimeseriesGroupsParamsDateRange = "28d"
- RadarConnectionTamperingTimeseriesGroupsParamsDateRange12w RadarConnectionTamperingTimeseriesGroupsParamsDateRange = "12w"
- RadarConnectionTamperingTimeseriesGroupsParamsDateRange24w RadarConnectionTamperingTimeseriesGroupsParamsDateRange = "24w"
- RadarConnectionTamperingTimeseriesGroupsParamsDateRange52w RadarConnectionTamperingTimeseriesGroupsParamsDateRange = "52w"
- RadarConnectionTamperingTimeseriesGroupsParamsDateRange1dControl RadarConnectionTamperingTimeseriesGroupsParamsDateRange = "1dControl"
- RadarConnectionTamperingTimeseriesGroupsParamsDateRange2dControl RadarConnectionTamperingTimeseriesGroupsParamsDateRange = "2dControl"
- RadarConnectionTamperingTimeseriesGroupsParamsDateRange7dControl RadarConnectionTamperingTimeseriesGroupsParamsDateRange = "7dControl"
- RadarConnectionTamperingTimeseriesGroupsParamsDateRange14dControl RadarConnectionTamperingTimeseriesGroupsParamsDateRange = "14dControl"
- RadarConnectionTamperingTimeseriesGroupsParamsDateRange28dControl RadarConnectionTamperingTimeseriesGroupsParamsDateRange = "28dControl"
- RadarConnectionTamperingTimeseriesGroupsParamsDateRange12wControl RadarConnectionTamperingTimeseriesGroupsParamsDateRange = "12wControl"
- RadarConnectionTamperingTimeseriesGroupsParamsDateRange24wControl RadarConnectionTamperingTimeseriesGroupsParamsDateRange = "24wControl"
-)
-
-// Format results are returned in.
-type RadarConnectionTamperingTimeseriesGroupsParamsFormat string
-
-const (
- RadarConnectionTamperingTimeseriesGroupsParamsFormatJson RadarConnectionTamperingTimeseriesGroupsParamsFormat = "JSON"
- RadarConnectionTamperingTimeseriesGroupsParamsFormatCsv RadarConnectionTamperingTimeseriesGroupsParamsFormat = "CSV"
-)
-
-type RadarConnectionTamperingTimeseriesGroupsResponseEnvelope struct {
- Result RadarConnectionTamperingTimeseriesGroupsResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarConnectionTamperingTimeseriesGroupsResponseEnvelopeJSON `json:"-"`
-}
-
-// radarConnectionTamperingTimeseriesGroupsResponseEnvelopeJSON contains the JSON
-// metadata for the struct
-// [RadarConnectionTamperingTimeseriesGroupsResponseEnvelope]
-type radarConnectionTamperingTimeseriesGroupsResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarConnectionTamperingTimeseriesGroupsResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarConnectionTamperingTimeseriesGroupsResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
diff --git a/radarconnectiontampering_test.go b/radarconnectiontampering_test.go
deleted file mode 100644
index 2b348ad4727..00000000000
--- a/radarconnectiontampering_test.go
+++ /dev/null
@@ -1,82 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
- "time"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRadarConnectionTamperingSummaryWithOptionalParams(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"),
- )
- _, 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()}),
- Format: cloudflare.F(cloudflare.RadarConnectionTamperingSummaryParamsFormatJson),
- 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())
- }
-}
-
-func TestRadarConnectionTamperingTimeseriesGroupsWithOptionalParams(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"),
- )
- _, 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()}),
- Format: cloudflare.F(cloudflare.RadarConnectionTamperingTimeseriesGroupsParamsFormatJson),
- 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/radardataset.go b/radardataset.go
deleted file mode 100644
index 45385555c8d..00000000000
--- a/radardataset.go
+++ /dev/null
@@ -1,286 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarDatasetService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewRadarDatasetService] method
-// instead.
-type RadarDatasetService struct {
- Options []option.RequestOption
-}
-
-// NewRadarDatasetService generates a new service that applies the given options to
-// each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewRadarDatasetService(opts ...option.RequestOption) (r *RadarDatasetService) {
- r = &RadarDatasetService{}
- r.Options = opts
- return
-}
-
-// Get a list of datasets.
-func (r *RadarDatasetService) List(ctx context.Context, query RadarDatasetListParams, opts ...option.RequestOption) (res *RadarDatasetListResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarDatasetListResponseEnvelope
- path := "radar/datasets"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Get a url to download a single dataset.
-func (r *RadarDatasetService) Download(ctx context.Context, params RadarDatasetDownloadParams, opts ...option.RequestOption) (res *RadarDatasetDownloadResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarDatasetDownloadResponseEnvelope
- path := "radar/datasets/download"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Get the csv content of a given dataset by alias or id. When getting the content
-// by alias the latest dataset is returned, optionally filtered by the latest
-// available at a given date.
-func (r *RadarDatasetService) Get(ctx context.Context, alias string, query RadarDatasetGetParams, opts ...option.RequestOption) (res *string, err error) {
- opts = append(r.Options[:], opts...)
- opts = append([]option.RequestOption{option.WithHeader("Accept", "text/csv")}, opts...)
- path := fmt.Sprintf("radar/datasets/%s", alias)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &res, opts...)
- return
-}
-
-type RadarDatasetListResponse struct {
- Datasets []RadarDatasetListResponseDataset `json:"datasets,required"`
- JSON radarDatasetListResponseJSON `json:"-"`
-}
-
-// radarDatasetListResponseJSON contains the JSON metadata for the struct
-// [RadarDatasetListResponse]
-type radarDatasetListResponseJSON struct {
- Datasets apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarDatasetListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarDatasetListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarDatasetListResponseDataset struct {
- ID int64 `json:"id,required"`
- Description string `json:"description,required"`
- Meta interface{} `json:"meta,required"`
- Tags []string `json:"tags,required"`
- Title string `json:"title,required"`
- Type string `json:"type,required"`
- JSON radarDatasetListResponseDatasetJSON `json:"-"`
-}
-
-// radarDatasetListResponseDatasetJSON contains the JSON metadata for the struct
-// [RadarDatasetListResponseDataset]
-type radarDatasetListResponseDatasetJSON struct {
- ID apijson.Field
- Description apijson.Field
- Meta apijson.Field
- Tags apijson.Field
- Title apijson.Field
- Type apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarDatasetListResponseDataset) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarDatasetListResponseDatasetJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarDatasetDownloadResponse struct {
- Dataset RadarDatasetDownloadResponseDataset `json:"dataset,required"`
- JSON radarDatasetDownloadResponseJSON `json:"-"`
-}
-
-// radarDatasetDownloadResponseJSON contains the JSON metadata for the struct
-// [RadarDatasetDownloadResponse]
-type radarDatasetDownloadResponseJSON struct {
- Dataset apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarDatasetDownloadResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarDatasetDownloadResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarDatasetDownloadResponseDataset struct {
- URL string `json:"url,required"`
- JSON radarDatasetDownloadResponseDatasetJSON `json:"-"`
-}
-
-// radarDatasetDownloadResponseDatasetJSON contains the JSON metadata for the
-// struct [RadarDatasetDownloadResponseDataset]
-type radarDatasetDownloadResponseDatasetJSON struct {
- URL apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarDatasetDownloadResponseDataset) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarDatasetDownloadResponseDatasetJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarDatasetListParams struct {
- // Dataset type.
- DatasetType param.Field[RadarDatasetListParamsDatasetType] `query:"datasetType"`
- // Format results are returned in.
- Format param.Field[RadarDatasetListParamsFormat] `query:"format"`
- // Limit the number of objects in the response.
- Limit param.Field[int64] `query:"limit"`
- // Number of objects to skip before grabbing results.
- Offset param.Field[int64] `query:"offset"`
-}
-
-// URLQuery serializes [RadarDatasetListParams]'s query parameters as `url.Values`.
-func (r RadarDatasetListParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Dataset type.
-type RadarDatasetListParamsDatasetType string
-
-const (
- RadarDatasetListParamsDatasetTypeRankingBucket RadarDatasetListParamsDatasetType = "RANKING_BUCKET"
- RadarDatasetListParamsDatasetTypeReport RadarDatasetListParamsDatasetType = "REPORT"
-)
-
-// Format results are returned in.
-type RadarDatasetListParamsFormat string
-
-const (
- RadarDatasetListParamsFormatJson RadarDatasetListParamsFormat = "JSON"
- RadarDatasetListParamsFormatCsv RadarDatasetListParamsFormat = "CSV"
-)
-
-type RadarDatasetListResponseEnvelope struct {
- Result RadarDatasetListResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarDatasetListResponseEnvelopeJSON `json:"-"`
-}
-
-// radarDatasetListResponseEnvelopeJSON contains the JSON metadata for the struct
-// [RadarDatasetListResponseEnvelope]
-type radarDatasetListResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarDatasetListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarDatasetListResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarDatasetDownloadParams struct {
- DatasetID param.Field[int64] `json:"datasetId,required"`
- // Format results are returned in.
- Format param.Field[RadarDatasetDownloadParamsFormat] `query:"format"`
-}
-
-func (r RadarDatasetDownloadParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// URLQuery serializes [RadarDatasetDownloadParams]'s query parameters as
-// `url.Values`.
-func (r RadarDatasetDownloadParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Format results are returned in.
-type RadarDatasetDownloadParamsFormat string
-
-const (
- RadarDatasetDownloadParamsFormatJson RadarDatasetDownloadParamsFormat = "JSON"
- RadarDatasetDownloadParamsFormatCsv RadarDatasetDownloadParamsFormat = "CSV"
-)
-
-type RadarDatasetDownloadResponseEnvelope struct {
- Result RadarDatasetDownloadResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarDatasetDownloadResponseEnvelopeJSON `json:"-"`
-}
-
-// radarDatasetDownloadResponseEnvelopeJSON contains the JSON metadata for the
-// struct [RadarDatasetDownloadResponseEnvelope]
-type radarDatasetDownloadResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarDatasetDownloadResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarDatasetDownloadResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarDatasetGetParams struct {
- // Filter dataset alias by date
- Date param.Field[string] `query:"date"`
-}
-
-// URLQuery serializes [RadarDatasetGetParams]'s query parameters as `url.Values`.
-func (r RadarDatasetGetParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
diff --git a/radardataset_test.go b/radardataset_test.go
deleted file mode 100644
index 590be4764da..00000000000
--- a/radardataset_test.go
+++ /dev/null
@@ -1,100 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRadarDatasetListWithOptionalParams(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"),
- )
- _, err := client.Radar.Datasets.List(context.TODO(), cloudflare.RadarDatasetListParams{
- DatasetType: cloudflare.F(cloudflare.RadarDatasetListParamsDatasetTypeRankingBucket),
- Format: cloudflare.F(cloudflare.RadarDatasetListParamsFormatJson),
- Limit: cloudflare.F(int64(5)),
- Offset: cloudflare.F(int64(0)),
- })
- 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())
- }
-}
-
-func TestRadarDatasetDownloadWithOptionalParams(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"),
- )
- _, err := client.Radar.Datasets.Download(context.TODO(), cloudflare.RadarDatasetDownloadParams{
- DatasetID: cloudflare.F(int64(3)),
- Format: cloudflare.F(cloudflare.RadarDatasetDownloadParamsFormatJson),
- })
- 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())
- }
-}
-
-func TestRadarDatasetGetWithOptionalParams(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"),
- )
- _, err := client.Radar.Datasets.Get(
- context.TODO(),
- "ranking_top_1000",
- cloudflare.RadarDatasetGetParams{
- Date: cloudflare.F("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/radardns.go b/radardns.go
deleted file mode 100644
index 8e0425ae521..00000000000
--- a/radardns.go
+++ /dev/null
@@ -1,26 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarDNSService contains methods and other services that help with interacting
-// with the cloudflare API. Note, unlike clients, this service does not read
-// variables from the environment automatically. You should not instantiate this
-// service directly, and instead use the [NewRadarDNSService] method instead.
-type RadarDNSService struct {
- Options []option.RequestOption
- Top *RadarDNSTopService
-}
-
-// NewRadarDNSService generates a new service that applies the given options to
-// each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewRadarDNSService(opts ...option.RequestOption) (r *RadarDNSService) {
- r = &RadarDNSService{}
- r.Options = opts
- r.Top = NewRadarDNSTopService(opts...)
- return
-}
diff --git a/radardnstop.go b/radardnstop.go
deleted file mode 100644
index 875c9b73651..00000000000
--- a/radardnstop.go
+++ /dev/null
@@ -1,547 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarDNSTopService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewRadarDNSTopService] method
-// instead.
-type RadarDNSTopService struct {
- Options []option.RequestOption
-}
-
-// NewRadarDNSTopService generates a new service that applies the given options to
-// each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewRadarDNSTopService(opts ...option.RequestOption) (r *RadarDNSTopService) {
- r = &RadarDNSTopService{}
- r.Options = opts
- return
-}
-
-// Get top autonomous systems by DNS queries made to Cloudflare's public DNS
-// resolver.
-func (r *RadarDNSTopService) Ases(ctx context.Context, query RadarDNSTopAsesParams, opts ...option.RequestOption) (res *RadarDNSTopAsesResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarDNSTopAsesResponseEnvelope
- path := "radar/dns/top/ases"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Get top locations by DNS queries made to Cloudflare's public DNS resolver.
-func (r *RadarDNSTopService) Locations(ctx context.Context, query RadarDNSTopLocationsParams, opts ...option.RequestOption) (res *RadarDNSTopLocationsResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarDNSTopLocationsResponseEnvelope
- path := "radar/dns/top/locations"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type RadarDNSTopAsesResponse struct {
- Meta RadarDNSTopAsesResponseMeta `json:"meta,required"`
- Top0 []RadarDNSTopAsesResponseTop0 `json:"top_0,required"`
- JSON radarDNSTopAsesResponseJSON `json:"-"`
-}
-
-// radarDNSTopAsesResponseJSON contains the JSON metadata for the struct
-// [RadarDNSTopAsesResponse]
-type radarDNSTopAsesResponseJSON struct {
- Meta apijson.Field
- Top0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarDNSTopAsesResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarDNSTopAsesResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarDNSTopAsesResponseMeta struct {
- DateRange []RadarDNSTopAsesResponseMetaDateRange `json:"dateRange,required"`
- ConfidenceInfo RadarDNSTopAsesResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarDNSTopAsesResponseMetaJSON `json:"-"`
-}
-
-// radarDNSTopAsesResponseMetaJSON contains the JSON metadata for the struct
-// [RadarDNSTopAsesResponseMeta]
-type radarDNSTopAsesResponseMetaJSON struct {
- DateRange apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarDNSTopAsesResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarDNSTopAsesResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarDNSTopAsesResponseMetaDateRange 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 radarDNSTopAsesResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarDNSTopAsesResponseMetaDateRangeJSON contains the JSON metadata for the
-// struct [RadarDNSTopAsesResponseMetaDateRange]
-type radarDNSTopAsesResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarDNSTopAsesResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarDNSTopAsesResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarDNSTopAsesResponseMetaConfidenceInfo struct {
- Annotations []RadarDNSTopAsesResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarDNSTopAsesResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarDNSTopAsesResponseMetaConfidenceInfoJSON contains the JSON metadata for the
-// struct [RadarDNSTopAsesResponseMetaConfidenceInfo]
-type radarDNSTopAsesResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarDNSTopAsesResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarDNSTopAsesResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarDNSTopAsesResponseMetaConfidenceInfoAnnotation 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 radarDNSTopAsesResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarDNSTopAsesResponseMetaConfidenceInfoAnnotationJSON contains the JSON
-// metadata for the struct [RadarDNSTopAsesResponseMetaConfidenceInfoAnnotation]
-type radarDNSTopAsesResponseMetaConfidenceInfoAnnotationJSON 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 *RadarDNSTopAsesResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarDNSTopAsesResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarDNSTopAsesResponseTop0 struct {
- ClientASN int64 `json:"clientASN,required"`
- ClientAsName string `json:"clientASName,required"`
- Value string `json:"value,required"`
- JSON radarDNSTopAsesResponseTop0JSON `json:"-"`
-}
-
-// radarDNSTopAsesResponseTop0JSON contains the JSON metadata for the struct
-// [RadarDNSTopAsesResponseTop0]
-type radarDNSTopAsesResponseTop0JSON struct {
- ClientASN apijson.Field
- ClientAsName apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarDNSTopAsesResponseTop0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarDNSTopAsesResponseTop0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarDNSTopLocationsResponse struct {
- Meta RadarDNSTopLocationsResponseMeta `json:"meta,required"`
- Top0 []RadarDNSTopLocationsResponseTop0 `json:"top_0,required"`
- JSON radarDNSTopLocationsResponseJSON `json:"-"`
-}
-
-// radarDNSTopLocationsResponseJSON contains the JSON metadata for the struct
-// [RadarDNSTopLocationsResponse]
-type radarDNSTopLocationsResponseJSON struct {
- Meta apijson.Field
- Top0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarDNSTopLocationsResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarDNSTopLocationsResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarDNSTopLocationsResponseMeta struct {
- DateRange []RadarDNSTopLocationsResponseMetaDateRange `json:"dateRange,required"`
- ConfidenceInfo RadarDNSTopLocationsResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarDNSTopLocationsResponseMetaJSON `json:"-"`
-}
-
-// radarDNSTopLocationsResponseMetaJSON contains the JSON metadata for the struct
-// [RadarDNSTopLocationsResponseMeta]
-type radarDNSTopLocationsResponseMetaJSON struct {
- DateRange apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarDNSTopLocationsResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarDNSTopLocationsResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarDNSTopLocationsResponseMetaDateRange 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 radarDNSTopLocationsResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarDNSTopLocationsResponseMetaDateRangeJSON contains the JSON metadata for the
-// struct [RadarDNSTopLocationsResponseMetaDateRange]
-type radarDNSTopLocationsResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarDNSTopLocationsResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarDNSTopLocationsResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarDNSTopLocationsResponseMetaConfidenceInfo struct {
- Annotations []RadarDNSTopLocationsResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarDNSTopLocationsResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarDNSTopLocationsResponseMetaConfidenceInfoJSON contains the JSON metadata
-// for the struct [RadarDNSTopLocationsResponseMetaConfidenceInfo]
-type radarDNSTopLocationsResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarDNSTopLocationsResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarDNSTopLocationsResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarDNSTopLocationsResponseMetaConfidenceInfoAnnotation 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 radarDNSTopLocationsResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarDNSTopLocationsResponseMetaConfidenceInfoAnnotationJSON contains the JSON
-// metadata for the struct
-// [RadarDNSTopLocationsResponseMetaConfidenceInfoAnnotation]
-type radarDNSTopLocationsResponseMetaConfidenceInfoAnnotationJSON 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 *RadarDNSTopLocationsResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarDNSTopLocationsResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarDNSTopLocationsResponseTop0 struct {
- ClientCountryAlpha2 string `json:"clientCountryAlpha2,required"`
- ClientCountryName string `json:"clientCountryName,required"`
- Value string `json:"value,required"`
- JSON radarDNSTopLocationsResponseTop0JSON `json:"-"`
-}
-
-// radarDNSTopLocationsResponseTop0JSON contains the JSON metadata for the struct
-// [RadarDNSTopLocationsResponseTop0]
-type radarDNSTopLocationsResponseTop0JSON struct {
- ClientCountryAlpha2 apijson.Field
- ClientCountryName apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarDNSTopLocationsResponseTop0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarDNSTopLocationsResponseTop0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarDNSTopAsesParams struct {
- // Array of domain names.
- Domain param.Field[[]string] `query:"domain,required"`
- // 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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarDNSTopAsesParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Format results are returned in.
- Format param.Field[RadarDNSTopAsesParamsFormat] `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 [RadarDNSTopAsesParams]'s query parameters as `url.Values`.
-func (r RadarDNSTopAsesParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type RadarDNSTopAsesParamsDateRange string
-
-const (
- RadarDNSTopAsesParamsDateRange1d RadarDNSTopAsesParamsDateRange = "1d"
- RadarDNSTopAsesParamsDateRange2d RadarDNSTopAsesParamsDateRange = "2d"
- RadarDNSTopAsesParamsDateRange7d RadarDNSTopAsesParamsDateRange = "7d"
- RadarDNSTopAsesParamsDateRange14d RadarDNSTopAsesParamsDateRange = "14d"
- RadarDNSTopAsesParamsDateRange28d RadarDNSTopAsesParamsDateRange = "28d"
- RadarDNSTopAsesParamsDateRange12w RadarDNSTopAsesParamsDateRange = "12w"
- RadarDNSTopAsesParamsDateRange24w RadarDNSTopAsesParamsDateRange = "24w"
- RadarDNSTopAsesParamsDateRange52w RadarDNSTopAsesParamsDateRange = "52w"
- RadarDNSTopAsesParamsDateRange1dControl RadarDNSTopAsesParamsDateRange = "1dControl"
- RadarDNSTopAsesParamsDateRange2dControl RadarDNSTopAsesParamsDateRange = "2dControl"
- RadarDNSTopAsesParamsDateRange7dControl RadarDNSTopAsesParamsDateRange = "7dControl"
- RadarDNSTopAsesParamsDateRange14dControl RadarDNSTopAsesParamsDateRange = "14dControl"
- RadarDNSTopAsesParamsDateRange28dControl RadarDNSTopAsesParamsDateRange = "28dControl"
- RadarDNSTopAsesParamsDateRange12wControl RadarDNSTopAsesParamsDateRange = "12wControl"
- RadarDNSTopAsesParamsDateRange24wControl RadarDNSTopAsesParamsDateRange = "24wControl"
-)
-
-// Format results are returned in.
-type RadarDNSTopAsesParamsFormat string
-
-const (
- RadarDNSTopAsesParamsFormatJson RadarDNSTopAsesParamsFormat = "JSON"
- RadarDNSTopAsesParamsFormatCsv RadarDNSTopAsesParamsFormat = "CSV"
-)
-
-type RadarDNSTopAsesResponseEnvelope struct {
- Result RadarDNSTopAsesResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarDNSTopAsesResponseEnvelopeJSON `json:"-"`
-}
-
-// radarDNSTopAsesResponseEnvelopeJSON contains the JSON metadata for the struct
-// [RadarDNSTopAsesResponseEnvelope]
-type radarDNSTopAsesResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarDNSTopAsesResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarDNSTopAsesResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarDNSTopLocationsParams struct {
- // Array of domain names.
- Domain param.Field[[]string] `query:"domain,required"`
- // 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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarDNSTopLocationsParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Format results are returned in.
- Format param.Field[RadarDNSTopLocationsParamsFormat] `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 [RadarDNSTopLocationsParams]'s query parameters as
-// `url.Values`.
-func (r RadarDNSTopLocationsParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type RadarDNSTopLocationsParamsDateRange string
-
-const (
- RadarDNSTopLocationsParamsDateRange1d RadarDNSTopLocationsParamsDateRange = "1d"
- RadarDNSTopLocationsParamsDateRange2d RadarDNSTopLocationsParamsDateRange = "2d"
- RadarDNSTopLocationsParamsDateRange7d RadarDNSTopLocationsParamsDateRange = "7d"
- RadarDNSTopLocationsParamsDateRange14d RadarDNSTopLocationsParamsDateRange = "14d"
- RadarDNSTopLocationsParamsDateRange28d RadarDNSTopLocationsParamsDateRange = "28d"
- RadarDNSTopLocationsParamsDateRange12w RadarDNSTopLocationsParamsDateRange = "12w"
- RadarDNSTopLocationsParamsDateRange24w RadarDNSTopLocationsParamsDateRange = "24w"
- RadarDNSTopLocationsParamsDateRange52w RadarDNSTopLocationsParamsDateRange = "52w"
- RadarDNSTopLocationsParamsDateRange1dControl RadarDNSTopLocationsParamsDateRange = "1dControl"
- RadarDNSTopLocationsParamsDateRange2dControl RadarDNSTopLocationsParamsDateRange = "2dControl"
- RadarDNSTopLocationsParamsDateRange7dControl RadarDNSTopLocationsParamsDateRange = "7dControl"
- RadarDNSTopLocationsParamsDateRange14dControl RadarDNSTopLocationsParamsDateRange = "14dControl"
- RadarDNSTopLocationsParamsDateRange28dControl RadarDNSTopLocationsParamsDateRange = "28dControl"
- RadarDNSTopLocationsParamsDateRange12wControl RadarDNSTopLocationsParamsDateRange = "12wControl"
- RadarDNSTopLocationsParamsDateRange24wControl RadarDNSTopLocationsParamsDateRange = "24wControl"
-)
-
-// Format results are returned in.
-type RadarDNSTopLocationsParamsFormat string
-
-const (
- RadarDNSTopLocationsParamsFormatJson RadarDNSTopLocationsParamsFormat = "JSON"
- RadarDNSTopLocationsParamsFormatCsv RadarDNSTopLocationsParamsFormat = "CSV"
-)
-
-type RadarDNSTopLocationsResponseEnvelope struct {
- Result RadarDNSTopLocationsResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarDNSTopLocationsResponseEnvelopeJSON `json:"-"`
-}
-
-// radarDNSTopLocationsResponseEnvelopeJSON contains the JSON metadata for the
-// struct [RadarDNSTopLocationsResponseEnvelope]
-type radarDNSTopLocationsResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarDNSTopLocationsResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarDNSTopLocationsResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
diff --git a/radardnstop_test.go b/radardnstop_test.go
deleted file mode 100644
index ad36f56fca8..00000000000
--- a/radardnstop_test.go
+++ /dev/null
@@ -1,85 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
- "time"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRadarDNSTopAsesWithOptionalParams(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"),
- )
- _, 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()}),
- Format: cloudflare.F(cloudflare.RadarDNSTopAsesParamsFormatJson),
- 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())
- }
-}
-
-func TestRadarDNSTopLocationsWithOptionalParams(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"),
- )
- _, 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()}),
- Format: cloudflare.F(cloudflare.RadarDNSTopLocationsParamsFormatJson),
- 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/radaremail.go b/radaremail.go
deleted file mode 100644
index cd0b43d48d7..00000000000
--- a/radaremail.go
+++ /dev/null
@@ -1,28 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarEmailService contains methods and other services that help with interacting
-// with the cloudflare API. Note, unlike clients, this service does not read
-// variables from the environment automatically. You should not instantiate this
-// service directly, and instead use the [NewRadarEmailService] method instead.
-type RadarEmailService struct {
- Options []option.RequestOption
- Routing *RadarEmailRoutingService
- Security *RadarEmailSecurityService
-}
-
-// NewRadarEmailService generates a new service that applies the given options to
-// each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewRadarEmailService(opts ...option.RequestOption) (r *RadarEmailService) {
- r = &RadarEmailService{}
- r.Options = opts
- r.Routing = NewRadarEmailRoutingService(opts...)
- r.Security = NewRadarEmailSecurityService(opts...)
- return
-}
diff --git a/radaremailrouting.go b/radaremailrouting.go
deleted file mode 100644
index 31c24ade4fd..00000000000
--- a/radaremailrouting.go
+++ /dev/null
@@ -1,29 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarEmailRoutingService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewRadarEmailRoutingService] method
-// instead.
-type RadarEmailRoutingService struct {
- Options []option.RequestOption
- Summary *RadarEmailRoutingSummaryService
- TimeseriesGroups *RadarEmailRoutingTimeseriesGroupService
-}
-
-// NewRadarEmailRoutingService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewRadarEmailRoutingService(opts ...option.RequestOption) (r *RadarEmailRoutingService) {
- r = &RadarEmailRoutingService{}
- r.Options = opts
- r.Summary = NewRadarEmailRoutingSummaryService(opts...)
- r.TimeseriesGroups = NewRadarEmailRoutingTimeseriesGroupService(opts...)
- return
-}
diff --git a/radaremailroutingsummary.go b/radaremailroutingsummary.go
deleted file mode 100644
index 92f5c912455..00000000000
--- a/radaremailroutingsummary.go
+++ /dev/null
@@ -1,1793 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarEmailRoutingSummaryService contains methods and other services that help
-// with interacting with the cloudflare API. Note, unlike clients, this service
-// does not read variables from the environment automatically. You should not
-// instantiate this service directly, and instead use the
-// [NewRadarEmailRoutingSummaryService] method instead.
-type RadarEmailRoutingSummaryService struct {
- Options []option.RequestOption
-}
-
-// NewRadarEmailRoutingSummaryService generates a new service that applies the
-// given options to each request. These options are applied after the parent
-// client's options (if there is one), and before any request-specific options.
-func NewRadarEmailRoutingSummaryService(opts ...option.RequestOption) (r *RadarEmailRoutingSummaryService) {
- r = &RadarEmailRoutingSummaryService{}
- r.Options = opts
- return
-}
-
-// Percentage distribution of emails classified per ARC validation.
-func (r *RadarEmailRoutingSummaryService) ARC(ctx context.Context, query RadarEmailRoutingSummaryARCParams, opts ...option.RequestOption) (res *RadarEmailRoutingSummaryARCResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarEmailRoutingSummaryARCResponseEnvelope
- path := "radar/email/routing/summary/arc"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Percentage distribution of emails classified per DKIM validation.
-func (r *RadarEmailRoutingSummaryService) DKIM(ctx context.Context, query RadarEmailRoutingSummaryDKIMParams, opts ...option.RequestOption) (res *RadarEmailRoutingSummaryDKIMResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarEmailRoutingSummaryDKIMResponseEnvelope
- path := "radar/email/routing/summary/dkim"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Percentage distribution of emails classified per DMARC validation.
-func (r *RadarEmailRoutingSummaryService) DMARC(ctx context.Context, query RadarEmailRoutingSummaryDMARCParams, opts ...option.RequestOption) (res *RadarEmailRoutingSummaryDMARCResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarEmailRoutingSummaryDMARCResponseEnvelope
- path := "radar/email/routing/summary/dmarc"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Percentage distribution of emails by Encrypted
-func (r *RadarEmailRoutingSummaryService) Encrypted(ctx context.Context, query RadarEmailRoutingSummaryEncryptedParams, opts ...option.RequestOption) (res *RadarEmailRoutingSummaryEncryptedResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarEmailRoutingSummaryEncryptedResponseEnvelope
- path := "radar/email/routing/summary/encrypted"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Percentage distribution of emails by Ip Version.
-func (r *RadarEmailRoutingSummaryService) IPVersion(ctx context.Context, query RadarEmailRoutingSummaryIPVersionParams, opts ...option.RequestOption) (res *RadarEmailRoutingSummaryIPVersionResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarEmailRoutingSummaryIPVersionResponseEnvelope
- path := "radar/email/routing/summary/ip_version"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Percentage distribution of emails classified per SPF validation.
-func (r *RadarEmailRoutingSummaryService) SPF(ctx context.Context, query RadarEmailRoutingSummarySPFParams, opts ...option.RequestOption) (res *RadarEmailRoutingSummarySPFResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarEmailRoutingSummarySPFResponseEnvelope
- path := "radar/email/routing/summary/spf"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type RadarEmailRoutingSummaryARCResponse struct {
- Meta RadarEmailRoutingSummaryARCResponseMeta `json:"meta,required"`
- Summary0 RadarEmailRoutingSummaryARCResponseSummary0 `json:"summary_0,required"`
- JSON radarEmailRoutingSummaryARCResponseJSON `json:"-"`
-}
-
-// radarEmailRoutingSummaryARCResponseJSON contains the JSON metadata for the
-// struct [RadarEmailRoutingSummaryARCResponse]
-type radarEmailRoutingSummaryARCResponseJSON struct {
- Meta apijson.Field
- Summary0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailRoutingSummaryARCResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailRoutingSummaryARCResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailRoutingSummaryARCResponseMeta struct {
- DateRange []RadarEmailRoutingSummaryARCResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- Normalization string `json:"normalization,required"`
- ConfidenceInfo RadarEmailRoutingSummaryARCResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarEmailRoutingSummaryARCResponseMetaJSON `json:"-"`
-}
-
-// radarEmailRoutingSummaryARCResponseMetaJSON contains the JSON metadata for the
-// struct [RadarEmailRoutingSummaryARCResponseMeta]
-type radarEmailRoutingSummaryARCResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- Normalization apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailRoutingSummaryARCResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailRoutingSummaryARCResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailRoutingSummaryARCResponseMetaDateRange 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 radarEmailRoutingSummaryARCResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarEmailRoutingSummaryARCResponseMetaDateRangeJSON contains the JSON metadata
-// for the struct [RadarEmailRoutingSummaryARCResponseMetaDateRange]
-type radarEmailRoutingSummaryARCResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailRoutingSummaryARCResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailRoutingSummaryARCResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailRoutingSummaryARCResponseMetaConfidenceInfo struct {
- Annotations []RadarEmailRoutingSummaryARCResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarEmailRoutingSummaryARCResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarEmailRoutingSummaryARCResponseMetaConfidenceInfoJSON contains the JSON
-// metadata for the struct [RadarEmailRoutingSummaryARCResponseMetaConfidenceInfo]
-type radarEmailRoutingSummaryARCResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailRoutingSummaryARCResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailRoutingSummaryARCResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailRoutingSummaryARCResponseMetaConfidenceInfoAnnotation 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 radarEmailRoutingSummaryARCResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarEmailRoutingSummaryARCResponseMetaConfidenceInfoAnnotationJSON contains the
-// JSON metadata for the struct
-// [RadarEmailRoutingSummaryARCResponseMetaConfidenceInfoAnnotation]
-type radarEmailRoutingSummaryARCResponseMetaConfidenceInfoAnnotationJSON 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 *RadarEmailRoutingSummaryARCResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailRoutingSummaryARCResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailRoutingSummaryARCResponseSummary0 struct {
- Fail string `json:"FAIL,required"`
- None string `json:"NONE,required"`
- Pass string `json:"PASS,required"`
- JSON radarEmailRoutingSummaryARCResponseSummary0JSON `json:"-"`
-}
-
-// radarEmailRoutingSummaryARCResponseSummary0JSON contains the JSON metadata for
-// the struct [RadarEmailRoutingSummaryARCResponseSummary0]
-type radarEmailRoutingSummaryARCResponseSummary0JSON struct {
- Fail apijson.Field
- None apijson.Field
- Pass apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailRoutingSummaryARCResponseSummary0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailRoutingSummaryARCResponseSummary0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailRoutingSummaryDKIMResponse struct {
- Meta RadarEmailRoutingSummaryDKIMResponseMeta `json:"meta,required"`
- Summary0 RadarEmailRoutingSummaryDKIMResponseSummary0 `json:"summary_0,required"`
- JSON radarEmailRoutingSummaryDKIMResponseJSON `json:"-"`
-}
-
-// radarEmailRoutingSummaryDKIMResponseJSON contains the JSON metadata for the
-// struct [RadarEmailRoutingSummaryDKIMResponse]
-type radarEmailRoutingSummaryDKIMResponseJSON struct {
- Meta apijson.Field
- Summary0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailRoutingSummaryDKIMResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailRoutingSummaryDKIMResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailRoutingSummaryDKIMResponseMeta struct {
- DateRange []RadarEmailRoutingSummaryDKIMResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- Normalization string `json:"normalization,required"`
- ConfidenceInfo RadarEmailRoutingSummaryDKIMResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarEmailRoutingSummaryDKIMResponseMetaJSON `json:"-"`
-}
-
-// radarEmailRoutingSummaryDKIMResponseMetaJSON contains the JSON metadata for the
-// struct [RadarEmailRoutingSummaryDKIMResponseMeta]
-type radarEmailRoutingSummaryDKIMResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- Normalization apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailRoutingSummaryDKIMResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailRoutingSummaryDKIMResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailRoutingSummaryDKIMResponseMetaDateRange 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 radarEmailRoutingSummaryDKIMResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarEmailRoutingSummaryDKIMResponseMetaDateRangeJSON contains the JSON metadata
-// for the struct [RadarEmailRoutingSummaryDKIMResponseMetaDateRange]
-type radarEmailRoutingSummaryDKIMResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailRoutingSummaryDKIMResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailRoutingSummaryDKIMResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailRoutingSummaryDKIMResponseMetaConfidenceInfo struct {
- Annotations []RadarEmailRoutingSummaryDKIMResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarEmailRoutingSummaryDKIMResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarEmailRoutingSummaryDKIMResponseMetaConfidenceInfoJSON contains the JSON
-// metadata for the struct [RadarEmailRoutingSummaryDKIMResponseMetaConfidenceInfo]
-type radarEmailRoutingSummaryDKIMResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailRoutingSummaryDKIMResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailRoutingSummaryDKIMResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailRoutingSummaryDKIMResponseMetaConfidenceInfoAnnotation 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 radarEmailRoutingSummaryDKIMResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarEmailRoutingSummaryDKIMResponseMetaConfidenceInfoAnnotationJSON contains
-// the JSON metadata for the struct
-// [RadarEmailRoutingSummaryDKIMResponseMetaConfidenceInfoAnnotation]
-type radarEmailRoutingSummaryDKIMResponseMetaConfidenceInfoAnnotationJSON 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 *RadarEmailRoutingSummaryDKIMResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailRoutingSummaryDKIMResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailRoutingSummaryDKIMResponseSummary0 struct {
- Fail string `json:"FAIL,required"`
- None string `json:"NONE,required"`
- Pass string `json:"PASS,required"`
- JSON radarEmailRoutingSummaryDKIMResponseSummary0JSON `json:"-"`
-}
-
-// radarEmailRoutingSummaryDKIMResponseSummary0JSON contains the JSON metadata for
-// the struct [RadarEmailRoutingSummaryDKIMResponseSummary0]
-type radarEmailRoutingSummaryDKIMResponseSummary0JSON struct {
- Fail apijson.Field
- None apijson.Field
- Pass apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailRoutingSummaryDKIMResponseSummary0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailRoutingSummaryDKIMResponseSummary0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailRoutingSummaryDMARCResponse struct {
- Meta RadarEmailRoutingSummaryDMARCResponseMeta `json:"meta,required"`
- Summary0 RadarEmailRoutingSummaryDMARCResponseSummary0 `json:"summary_0,required"`
- JSON radarEmailRoutingSummaryDMARCResponseJSON `json:"-"`
-}
-
-// radarEmailRoutingSummaryDMARCResponseJSON contains the JSON metadata for the
-// struct [RadarEmailRoutingSummaryDMARCResponse]
-type radarEmailRoutingSummaryDMARCResponseJSON struct {
- Meta apijson.Field
- Summary0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailRoutingSummaryDMARCResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailRoutingSummaryDMARCResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailRoutingSummaryDMARCResponseMeta struct {
- DateRange []RadarEmailRoutingSummaryDMARCResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- Normalization string `json:"normalization,required"`
- ConfidenceInfo RadarEmailRoutingSummaryDMARCResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarEmailRoutingSummaryDMARCResponseMetaJSON `json:"-"`
-}
-
-// radarEmailRoutingSummaryDMARCResponseMetaJSON contains the JSON metadata for the
-// struct [RadarEmailRoutingSummaryDMARCResponseMeta]
-type radarEmailRoutingSummaryDMARCResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- Normalization apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailRoutingSummaryDMARCResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailRoutingSummaryDMARCResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailRoutingSummaryDMARCResponseMetaDateRange 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 radarEmailRoutingSummaryDMARCResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarEmailRoutingSummaryDMARCResponseMetaDateRangeJSON contains the JSON
-// metadata for the struct [RadarEmailRoutingSummaryDMARCResponseMetaDateRange]
-type radarEmailRoutingSummaryDMARCResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailRoutingSummaryDMARCResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailRoutingSummaryDMARCResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailRoutingSummaryDMARCResponseMetaConfidenceInfo struct {
- Annotations []RadarEmailRoutingSummaryDMARCResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarEmailRoutingSummaryDMARCResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarEmailRoutingSummaryDMARCResponseMetaConfidenceInfoJSON contains the JSON
-// metadata for the struct
-// [RadarEmailRoutingSummaryDMARCResponseMetaConfidenceInfo]
-type radarEmailRoutingSummaryDMARCResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailRoutingSummaryDMARCResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailRoutingSummaryDMARCResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailRoutingSummaryDMARCResponseMetaConfidenceInfoAnnotation 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 radarEmailRoutingSummaryDMARCResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarEmailRoutingSummaryDMARCResponseMetaConfidenceInfoAnnotationJSON contains
-// the JSON metadata for the struct
-// [RadarEmailRoutingSummaryDMARCResponseMetaConfidenceInfoAnnotation]
-type radarEmailRoutingSummaryDMARCResponseMetaConfidenceInfoAnnotationJSON 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 *RadarEmailRoutingSummaryDMARCResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailRoutingSummaryDMARCResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailRoutingSummaryDMARCResponseSummary0 struct {
- Fail string `json:"FAIL,required"`
- None string `json:"NONE,required"`
- Pass string `json:"PASS,required"`
- JSON radarEmailRoutingSummaryDMARCResponseSummary0JSON `json:"-"`
-}
-
-// radarEmailRoutingSummaryDMARCResponseSummary0JSON contains the JSON metadata for
-// the struct [RadarEmailRoutingSummaryDMARCResponseSummary0]
-type radarEmailRoutingSummaryDMARCResponseSummary0JSON struct {
- Fail apijson.Field
- None apijson.Field
- Pass apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailRoutingSummaryDMARCResponseSummary0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailRoutingSummaryDMARCResponseSummary0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailRoutingSummaryEncryptedResponse struct {
- Meta RadarEmailRoutingSummaryEncryptedResponseMeta `json:"meta,required"`
- Summary0 RadarEmailRoutingSummaryEncryptedResponseSummary0 `json:"summary_0,required"`
- JSON radarEmailRoutingSummaryEncryptedResponseJSON `json:"-"`
-}
-
-// radarEmailRoutingSummaryEncryptedResponseJSON contains the JSON metadata for the
-// struct [RadarEmailRoutingSummaryEncryptedResponse]
-type radarEmailRoutingSummaryEncryptedResponseJSON struct {
- Meta apijson.Field
- Summary0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailRoutingSummaryEncryptedResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailRoutingSummaryEncryptedResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailRoutingSummaryEncryptedResponseMeta struct {
- DateRange []RadarEmailRoutingSummaryEncryptedResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- Normalization string `json:"normalization,required"`
- ConfidenceInfo RadarEmailRoutingSummaryEncryptedResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarEmailRoutingSummaryEncryptedResponseMetaJSON `json:"-"`
-}
-
-// radarEmailRoutingSummaryEncryptedResponseMetaJSON contains the JSON metadata for
-// the struct [RadarEmailRoutingSummaryEncryptedResponseMeta]
-type radarEmailRoutingSummaryEncryptedResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- Normalization apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailRoutingSummaryEncryptedResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailRoutingSummaryEncryptedResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailRoutingSummaryEncryptedResponseMetaDateRange 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 radarEmailRoutingSummaryEncryptedResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarEmailRoutingSummaryEncryptedResponseMetaDateRangeJSON contains the JSON
-// metadata for the struct [RadarEmailRoutingSummaryEncryptedResponseMetaDateRange]
-type radarEmailRoutingSummaryEncryptedResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailRoutingSummaryEncryptedResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailRoutingSummaryEncryptedResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailRoutingSummaryEncryptedResponseMetaConfidenceInfo struct {
- Annotations []RadarEmailRoutingSummaryEncryptedResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarEmailRoutingSummaryEncryptedResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarEmailRoutingSummaryEncryptedResponseMetaConfidenceInfoJSON contains the
-// JSON metadata for the struct
-// [RadarEmailRoutingSummaryEncryptedResponseMetaConfidenceInfo]
-type radarEmailRoutingSummaryEncryptedResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailRoutingSummaryEncryptedResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailRoutingSummaryEncryptedResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailRoutingSummaryEncryptedResponseMetaConfidenceInfoAnnotation 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 radarEmailRoutingSummaryEncryptedResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarEmailRoutingSummaryEncryptedResponseMetaConfidenceInfoAnnotationJSON
-// contains the JSON metadata for the struct
-// [RadarEmailRoutingSummaryEncryptedResponseMetaConfidenceInfoAnnotation]
-type radarEmailRoutingSummaryEncryptedResponseMetaConfidenceInfoAnnotationJSON 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 *RadarEmailRoutingSummaryEncryptedResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailRoutingSummaryEncryptedResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailRoutingSummaryEncryptedResponseSummary0 struct {
- Encrypted string `json:"ENCRYPTED,required"`
- NotEncrypted string `json:"NOT_ENCRYPTED,required"`
- JSON radarEmailRoutingSummaryEncryptedResponseSummary0JSON `json:"-"`
-}
-
-// radarEmailRoutingSummaryEncryptedResponseSummary0JSON contains the JSON metadata
-// for the struct [RadarEmailRoutingSummaryEncryptedResponseSummary0]
-type radarEmailRoutingSummaryEncryptedResponseSummary0JSON struct {
- Encrypted apijson.Field
- NotEncrypted apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailRoutingSummaryEncryptedResponseSummary0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailRoutingSummaryEncryptedResponseSummary0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailRoutingSummaryIPVersionResponse struct {
- Meta RadarEmailRoutingSummaryIPVersionResponseMeta `json:"meta,required"`
- Summary0 RadarEmailRoutingSummaryIPVersionResponseSummary0 `json:"summary_0,required"`
- JSON radarEmailRoutingSummaryIPVersionResponseJSON `json:"-"`
-}
-
-// radarEmailRoutingSummaryIPVersionResponseJSON contains the JSON metadata for the
-// struct [RadarEmailRoutingSummaryIPVersionResponse]
-type radarEmailRoutingSummaryIPVersionResponseJSON struct {
- Meta apijson.Field
- Summary0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailRoutingSummaryIPVersionResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailRoutingSummaryIPVersionResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailRoutingSummaryIPVersionResponseMeta struct {
- DateRange []RadarEmailRoutingSummaryIPVersionResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- Normalization string `json:"normalization,required"`
- ConfidenceInfo RadarEmailRoutingSummaryIPVersionResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarEmailRoutingSummaryIPVersionResponseMetaJSON `json:"-"`
-}
-
-// radarEmailRoutingSummaryIPVersionResponseMetaJSON contains the JSON metadata for
-// the struct [RadarEmailRoutingSummaryIPVersionResponseMeta]
-type radarEmailRoutingSummaryIPVersionResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- Normalization apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailRoutingSummaryIPVersionResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailRoutingSummaryIPVersionResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailRoutingSummaryIPVersionResponseMetaDateRange 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 radarEmailRoutingSummaryIPVersionResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarEmailRoutingSummaryIPVersionResponseMetaDateRangeJSON contains the JSON
-// metadata for the struct [RadarEmailRoutingSummaryIPVersionResponseMetaDateRange]
-type radarEmailRoutingSummaryIPVersionResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailRoutingSummaryIPVersionResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailRoutingSummaryIPVersionResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailRoutingSummaryIPVersionResponseMetaConfidenceInfo struct {
- Annotations []RadarEmailRoutingSummaryIPVersionResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarEmailRoutingSummaryIPVersionResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarEmailRoutingSummaryIPVersionResponseMetaConfidenceInfoJSON contains the
-// JSON metadata for the struct
-// [RadarEmailRoutingSummaryIPVersionResponseMetaConfidenceInfo]
-type radarEmailRoutingSummaryIPVersionResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailRoutingSummaryIPVersionResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailRoutingSummaryIPVersionResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailRoutingSummaryIPVersionResponseMetaConfidenceInfoAnnotation 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 radarEmailRoutingSummaryIPVersionResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarEmailRoutingSummaryIPVersionResponseMetaConfidenceInfoAnnotationJSON
-// contains the JSON metadata for the struct
-// [RadarEmailRoutingSummaryIPVersionResponseMetaConfidenceInfoAnnotation]
-type radarEmailRoutingSummaryIPVersionResponseMetaConfidenceInfoAnnotationJSON 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 *RadarEmailRoutingSummaryIPVersionResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailRoutingSummaryIPVersionResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailRoutingSummaryIPVersionResponseSummary0 struct {
- IPv4 string `json:"IPv4,required"`
- IPv6 string `json:"IPv6,required"`
- JSON radarEmailRoutingSummaryIPVersionResponseSummary0JSON `json:"-"`
-}
-
-// radarEmailRoutingSummaryIPVersionResponseSummary0JSON contains the JSON metadata
-// for the struct [RadarEmailRoutingSummaryIPVersionResponseSummary0]
-type radarEmailRoutingSummaryIPVersionResponseSummary0JSON struct {
- IPv4 apijson.Field
- IPv6 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailRoutingSummaryIPVersionResponseSummary0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailRoutingSummaryIPVersionResponseSummary0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailRoutingSummarySPFResponse struct {
- Meta RadarEmailRoutingSummarySPFResponseMeta `json:"meta,required"`
- Summary0 RadarEmailRoutingSummarySPFResponseSummary0 `json:"summary_0,required"`
- JSON radarEmailRoutingSummarySPFResponseJSON `json:"-"`
-}
-
-// radarEmailRoutingSummarySPFResponseJSON contains the JSON metadata for the
-// struct [RadarEmailRoutingSummarySPFResponse]
-type radarEmailRoutingSummarySPFResponseJSON struct {
- Meta apijson.Field
- Summary0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailRoutingSummarySPFResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailRoutingSummarySPFResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailRoutingSummarySPFResponseMeta struct {
- DateRange []RadarEmailRoutingSummarySPFResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- Normalization string `json:"normalization,required"`
- ConfidenceInfo RadarEmailRoutingSummarySPFResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarEmailRoutingSummarySPFResponseMetaJSON `json:"-"`
-}
-
-// radarEmailRoutingSummarySPFResponseMetaJSON contains the JSON metadata for the
-// struct [RadarEmailRoutingSummarySPFResponseMeta]
-type radarEmailRoutingSummarySPFResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- Normalization apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailRoutingSummarySPFResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailRoutingSummarySPFResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailRoutingSummarySPFResponseMetaDateRange 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 radarEmailRoutingSummarySPFResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarEmailRoutingSummarySPFResponseMetaDateRangeJSON contains the JSON metadata
-// for the struct [RadarEmailRoutingSummarySPFResponseMetaDateRange]
-type radarEmailRoutingSummarySPFResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailRoutingSummarySPFResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailRoutingSummarySPFResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailRoutingSummarySPFResponseMetaConfidenceInfo struct {
- Annotations []RadarEmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarEmailRoutingSummarySPFResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarEmailRoutingSummarySPFResponseMetaConfidenceInfoJSON contains the JSON
-// metadata for the struct [RadarEmailRoutingSummarySPFResponseMetaConfidenceInfo]
-type radarEmailRoutingSummarySPFResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailRoutingSummarySPFResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailRoutingSummarySPFResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotation 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 radarEmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarEmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotationJSON contains the
-// JSON metadata for the struct
-// [RadarEmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotation]
-type radarEmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotationJSON 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 *RadarEmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailRoutingSummarySPFResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailRoutingSummarySPFResponseSummary0 struct {
- Fail string `json:"FAIL,required"`
- None string `json:"NONE,required"`
- Pass string `json:"PASS,required"`
- JSON radarEmailRoutingSummarySPFResponseSummary0JSON `json:"-"`
-}
-
-// radarEmailRoutingSummarySPFResponseSummary0JSON contains the JSON metadata for
-// the struct [RadarEmailRoutingSummarySPFResponseSummary0]
-type radarEmailRoutingSummarySPFResponseSummary0JSON struct {
- Fail apijson.Field
- None apijson.Field
- Pass apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailRoutingSummarySPFResponseSummary0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailRoutingSummarySPFResponseSummary0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailRoutingSummaryARCParams struct {
- // 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[[]RadarEmailRoutingSummaryARCParamsDateRange] `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[[]RadarEmailRoutingSummaryARCParamsDKIM] `query:"dkim"`
- // Filter for dmarc.
- DMARC param.Field[[]RadarEmailRoutingSummaryARCParamsDMARC] `query:"dmarc"`
- // Filter for encrypted emails.
- Encrypted param.Field[[]RadarEmailRoutingSummaryARCParamsEncrypted] `query:"encrypted"`
- // Format results are returned in.
- Format param.Field[RadarEmailRoutingSummaryARCParamsFormat] `query:"format"`
- // Filter for ip version.
- IPVersion param.Field[[]RadarEmailRoutingSummaryARCParamsIPVersion] `query:"ipVersion"`
- // 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[[]RadarEmailRoutingSummaryARCParamsSPF] `query:"spf"`
-}
-
-// URLQuery serializes [RadarEmailRoutingSummaryARCParams]'s query parameters as
-// `url.Values`.
-func (r RadarEmailRoutingSummaryARCParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type RadarEmailRoutingSummaryARCParamsDateRange string
-
-const (
- RadarEmailRoutingSummaryARCParamsDateRange1d RadarEmailRoutingSummaryARCParamsDateRange = "1d"
- RadarEmailRoutingSummaryARCParamsDateRange2d RadarEmailRoutingSummaryARCParamsDateRange = "2d"
- RadarEmailRoutingSummaryARCParamsDateRange7d RadarEmailRoutingSummaryARCParamsDateRange = "7d"
- RadarEmailRoutingSummaryARCParamsDateRange14d RadarEmailRoutingSummaryARCParamsDateRange = "14d"
- RadarEmailRoutingSummaryARCParamsDateRange28d RadarEmailRoutingSummaryARCParamsDateRange = "28d"
- RadarEmailRoutingSummaryARCParamsDateRange12w RadarEmailRoutingSummaryARCParamsDateRange = "12w"
- RadarEmailRoutingSummaryARCParamsDateRange24w RadarEmailRoutingSummaryARCParamsDateRange = "24w"
- RadarEmailRoutingSummaryARCParamsDateRange52w RadarEmailRoutingSummaryARCParamsDateRange = "52w"
- RadarEmailRoutingSummaryARCParamsDateRange1dControl RadarEmailRoutingSummaryARCParamsDateRange = "1dControl"
- RadarEmailRoutingSummaryARCParamsDateRange2dControl RadarEmailRoutingSummaryARCParamsDateRange = "2dControl"
- RadarEmailRoutingSummaryARCParamsDateRange7dControl RadarEmailRoutingSummaryARCParamsDateRange = "7dControl"
- RadarEmailRoutingSummaryARCParamsDateRange14dControl RadarEmailRoutingSummaryARCParamsDateRange = "14dControl"
- RadarEmailRoutingSummaryARCParamsDateRange28dControl RadarEmailRoutingSummaryARCParamsDateRange = "28dControl"
- RadarEmailRoutingSummaryARCParamsDateRange12wControl RadarEmailRoutingSummaryARCParamsDateRange = "12wControl"
- RadarEmailRoutingSummaryARCParamsDateRange24wControl RadarEmailRoutingSummaryARCParamsDateRange = "24wControl"
-)
-
-type RadarEmailRoutingSummaryARCParamsDKIM string
-
-const (
- RadarEmailRoutingSummaryARCParamsDKIMPass RadarEmailRoutingSummaryARCParamsDKIM = "PASS"
- RadarEmailRoutingSummaryARCParamsDKIMNone RadarEmailRoutingSummaryARCParamsDKIM = "NONE"
- RadarEmailRoutingSummaryARCParamsDKIMFail RadarEmailRoutingSummaryARCParamsDKIM = "FAIL"
-)
-
-type RadarEmailRoutingSummaryARCParamsDMARC string
-
-const (
- RadarEmailRoutingSummaryARCParamsDMARCPass RadarEmailRoutingSummaryARCParamsDMARC = "PASS"
- RadarEmailRoutingSummaryARCParamsDMARCNone RadarEmailRoutingSummaryARCParamsDMARC = "NONE"
- RadarEmailRoutingSummaryARCParamsDMARCFail RadarEmailRoutingSummaryARCParamsDMARC = "FAIL"
-)
-
-type RadarEmailRoutingSummaryARCParamsEncrypted string
-
-const (
- RadarEmailRoutingSummaryARCParamsEncryptedEncrypted RadarEmailRoutingSummaryARCParamsEncrypted = "ENCRYPTED"
- RadarEmailRoutingSummaryARCParamsEncryptedNotEncrypted RadarEmailRoutingSummaryARCParamsEncrypted = "NOT_ENCRYPTED"
-)
-
-// Format results are returned in.
-type RadarEmailRoutingSummaryARCParamsFormat string
-
-const (
- RadarEmailRoutingSummaryARCParamsFormatJson RadarEmailRoutingSummaryARCParamsFormat = "JSON"
- RadarEmailRoutingSummaryARCParamsFormatCsv RadarEmailRoutingSummaryARCParamsFormat = "CSV"
-)
-
-type RadarEmailRoutingSummaryARCParamsIPVersion string
-
-const (
- RadarEmailRoutingSummaryARCParamsIPVersionIPv4 RadarEmailRoutingSummaryARCParamsIPVersion = "IPv4"
- RadarEmailRoutingSummaryARCParamsIPVersionIPv6 RadarEmailRoutingSummaryARCParamsIPVersion = "IPv6"
-)
-
-type RadarEmailRoutingSummaryARCParamsSPF string
-
-const (
- RadarEmailRoutingSummaryARCParamsSPFPass RadarEmailRoutingSummaryARCParamsSPF = "PASS"
- RadarEmailRoutingSummaryARCParamsSPFNone RadarEmailRoutingSummaryARCParamsSPF = "NONE"
- RadarEmailRoutingSummaryARCParamsSPFFail RadarEmailRoutingSummaryARCParamsSPF = "FAIL"
-)
-
-type RadarEmailRoutingSummaryARCResponseEnvelope struct {
- Result RadarEmailRoutingSummaryARCResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarEmailRoutingSummaryARCResponseEnvelopeJSON `json:"-"`
-}
-
-// radarEmailRoutingSummaryARCResponseEnvelopeJSON contains the JSON metadata for
-// the struct [RadarEmailRoutingSummaryARCResponseEnvelope]
-type radarEmailRoutingSummaryARCResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailRoutingSummaryARCResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailRoutingSummaryARCResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailRoutingSummaryDKIMParams struct {
- // Filter for arc (Authenticated Received Chain).
- ARC param.Field[[]RadarEmailRoutingSummaryDKIMParamsARC] `query:"arc"`
- // 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[[]RadarEmailRoutingSummaryDKIMParamsDateRange] `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[[]RadarEmailRoutingSummaryDKIMParamsDMARC] `query:"dmarc"`
- // Filter for encrypted emails.
- Encrypted param.Field[[]RadarEmailRoutingSummaryDKIMParamsEncrypted] `query:"encrypted"`
- // Format results are returned in.
- Format param.Field[RadarEmailRoutingSummaryDKIMParamsFormat] `query:"format"`
- // Filter for ip version.
- IPVersion param.Field[[]RadarEmailRoutingSummaryDKIMParamsIPVersion] `query:"ipVersion"`
- // 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[[]RadarEmailRoutingSummaryDKIMParamsSPF] `query:"spf"`
-}
-
-// URLQuery serializes [RadarEmailRoutingSummaryDKIMParams]'s query parameters as
-// `url.Values`.
-func (r RadarEmailRoutingSummaryDKIMParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type RadarEmailRoutingSummaryDKIMParamsARC string
-
-const (
- RadarEmailRoutingSummaryDKIMParamsARCPass RadarEmailRoutingSummaryDKIMParamsARC = "PASS"
- RadarEmailRoutingSummaryDKIMParamsARCNone RadarEmailRoutingSummaryDKIMParamsARC = "NONE"
- RadarEmailRoutingSummaryDKIMParamsARCFail RadarEmailRoutingSummaryDKIMParamsARC = "FAIL"
-)
-
-type RadarEmailRoutingSummaryDKIMParamsDateRange string
-
-const (
- RadarEmailRoutingSummaryDKIMParamsDateRange1d RadarEmailRoutingSummaryDKIMParamsDateRange = "1d"
- RadarEmailRoutingSummaryDKIMParamsDateRange2d RadarEmailRoutingSummaryDKIMParamsDateRange = "2d"
- RadarEmailRoutingSummaryDKIMParamsDateRange7d RadarEmailRoutingSummaryDKIMParamsDateRange = "7d"
- RadarEmailRoutingSummaryDKIMParamsDateRange14d RadarEmailRoutingSummaryDKIMParamsDateRange = "14d"
- RadarEmailRoutingSummaryDKIMParamsDateRange28d RadarEmailRoutingSummaryDKIMParamsDateRange = "28d"
- RadarEmailRoutingSummaryDKIMParamsDateRange12w RadarEmailRoutingSummaryDKIMParamsDateRange = "12w"
- RadarEmailRoutingSummaryDKIMParamsDateRange24w RadarEmailRoutingSummaryDKIMParamsDateRange = "24w"
- RadarEmailRoutingSummaryDKIMParamsDateRange52w RadarEmailRoutingSummaryDKIMParamsDateRange = "52w"
- RadarEmailRoutingSummaryDKIMParamsDateRange1dControl RadarEmailRoutingSummaryDKIMParamsDateRange = "1dControl"
- RadarEmailRoutingSummaryDKIMParamsDateRange2dControl RadarEmailRoutingSummaryDKIMParamsDateRange = "2dControl"
- RadarEmailRoutingSummaryDKIMParamsDateRange7dControl RadarEmailRoutingSummaryDKIMParamsDateRange = "7dControl"
- RadarEmailRoutingSummaryDKIMParamsDateRange14dControl RadarEmailRoutingSummaryDKIMParamsDateRange = "14dControl"
- RadarEmailRoutingSummaryDKIMParamsDateRange28dControl RadarEmailRoutingSummaryDKIMParamsDateRange = "28dControl"
- RadarEmailRoutingSummaryDKIMParamsDateRange12wControl RadarEmailRoutingSummaryDKIMParamsDateRange = "12wControl"
- RadarEmailRoutingSummaryDKIMParamsDateRange24wControl RadarEmailRoutingSummaryDKIMParamsDateRange = "24wControl"
-)
-
-type RadarEmailRoutingSummaryDKIMParamsDMARC string
-
-const (
- RadarEmailRoutingSummaryDKIMParamsDMARCPass RadarEmailRoutingSummaryDKIMParamsDMARC = "PASS"
- RadarEmailRoutingSummaryDKIMParamsDMARCNone RadarEmailRoutingSummaryDKIMParamsDMARC = "NONE"
- RadarEmailRoutingSummaryDKIMParamsDMARCFail RadarEmailRoutingSummaryDKIMParamsDMARC = "FAIL"
-)
-
-type RadarEmailRoutingSummaryDKIMParamsEncrypted string
-
-const (
- RadarEmailRoutingSummaryDKIMParamsEncryptedEncrypted RadarEmailRoutingSummaryDKIMParamsEncrypted = "ENCRYPTED"
- RadarEmailRoutingSummaryDKIMParamsEncryptedNotEncrypted RadarEmailRoutingSummaryDKIMParamsEncrypted = "NOT_ENCRYPTED"
-)
-
-// Format results are returned in.
-type RadarEmailRoutingSummaryDKIMParamsFormat string
-
-const (
- RadarEmailRoutingSummaryDKIMParamsFormatJson RadarEmailRoutingSummaryDKIMParamsFormat = "JSON"
- RadarEmailRoutingSummaryDKIMParamsFormatCsv RadarEmailRoutingSummaryDKIMParamsFormat = "CSV"
-)
-
-type RadarEmailRoutingSummaryDKIMParamsIPVersion string
-
-const (
- RadarEmailRoutingSummaryDKIMParamsIPVersionIPv4 RadarEmailRoutingSummaryDKIMParamsIPVersion = "IPv4"
- RadarEmailRoutingSummaryDKIMParamsIPVersionIPv6 RadarEmailRoutingSummaryDKIMParamsIPVersion = "IPv6"
-)
-
-type RadarEmailRoutingSummaryDKIMParamsSPF string
-
-const (
- RadarEmailRoutingSummaryDKIMParamsSPFPass RadarEmailRoutingSummaryDKIMParamsSPF = "PASS"
- RadarEmailRoutingSummaryDKIMParamsSPFNone RadarEmailRoutingSummaryDKIMParamsSPF = "NONE"
- RadarEmailRoutingSummaryDKIMParamsSPFFail RadarEmailRoutingSummaryDKIMParamsSPF = "FAIL"
-)
-
-type RadarEmailRoutingSummaryDKIMResponseEnvelope struct {
- Result RadarEmailRoutingSummaryDKIMResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarEmailRoutingSummaryDKIMResponseEnvelopeJSON `json:"-"`
-}
-
-// radarEmailRoutingSummaryDKIMResponseEnvelopeJSON contains the JSON metadata for
-// the struct [RadarEmailRoutingSummaryDKIMResponseEnvelope]
-type radarEmailRoutingSummaryDKIMResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailRoutingSummaryDKIMResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailRoutingSummaryDKIMResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailRoutingSummaryDMARCParams struct {
- // Filter for arc (Authenticated Received Chain).
- ARC param.Field[[]RadarEmailRoutingSummaryDMARCParamsARC] `query:"arc"`
- // 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[[]RadarEmailRoutingSummaryDMARCParamsDateRange] `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[[]RadarEmailRoutingSummaryDMARCParamsDKIM] `query:"dkim"`
- // Filter for encrypted emails.
- Encrypted param.Field[[]RadarEmailRoutingSummaryDMARCParamsEncrypted] `query:"encrypted"`
- // Format results are returned in.
- Format param.Field[RadarEmailRoutingSummaryDMARCParamsFormat] `query:"format"`
- // Filter for ip version.
- IPVersion param.Field[[]RadarEmailRoutingSummaryDMARCParamsIPVersion] `query:"ipVersion"`
- // 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[[]RadarEmailRoutingSummaryDMARCParamsSPF] `query:"spf"`
-}
-
-// URLQuery serializes [RadarEmailRoutingSummaryDMARCParams]'s query parameters as
-// `url.Values`.
-func (r RadarEmailRoutingSummaryDMARCParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type RadarEmailRoutingSummaryDMARCParamsARC string
-
-const (
- RadarEmailRoutingSummaryDMARCParamsARCPass RadarEmailRoutingSummaryDMARCParamsARC = "PASS"
- RadarEmailRoutingSummaryDMARCParamsARCNone RadarEmailRoutingSummaryDMARCParamsARC = "NONE"
- RadarEmailRoutingSummaryDMARCParamsARCFail RadarEmailRoutingSummaryDMARCParamsARC = "FAIL"
-)
-
-type RadarEmailRoutingSummaryDMARCParamsDateRange string
-
-const (
- RadarEmailRoutingSummaryDMARCParamsDateRange1d RadarEmailRoutingSummaryDMARCParamsDateRange = "1d"
- RadarEmailRoutingSummaryDMARCParamsDateRange2d RadarEmailRoutingSummaryDMARCParamsDateRange = "2d"
- RadarEmailRoutingSummaryDMARCParamsDateRange7d RadarEmailRoutingSummaryDMARCParamsDateRange = "7d"
- RadarEmailRoutingSummaryDMARCParamsDateRange14d RadarEmailRoutingSummaryDMARCParamsDateRange = "14d"
- RadarEmailRoutingSummaryDMARCParamsDateRange28d RadarEmailRoutingSummaryDMARCParamsDateRange = "28d"
- RadarEmailRoutingSummaryDMARCParamsDateRange12w RadarEmailRoutingSummaryDMARCParamsDateRange = "12w"
- RadarEmailRoutingSummaryDMARCParamsDateRange24w RadarEmailRoutingSummaryDMARCParamsDateRange = "24w"
- RadarEmailRoutingSummaryDMARCParamsDateRange52w RadarEmailRoutingSummaryDMARCParamsDateRange = "52w"
- RadarEmailRoutingSummaryDMARCParamsDateRange1dControl RadarEmailRoutingSummaryDMARCParamsDateRange = "1dControl"
- RadarEmailRoutingSummaryDMARCParamsDateRange2dControl RadarEmailRoutingSummaryDMARCParamsDateRange = "2dControl"
- RadarEmailRoutingSummaryDMARCParamsDateRange7dControl RadarEmailRoutingSummaryDMARCParamsDateRange = "7dControl"
- RadarEmailRoutingSummaryDMARCParamsDateRange14dControl RadarEmailRoutingSummaryDMARCParamsDateRange = "14dControl"
- RadarEmailRoutingSummaryDMARCParamsDateRange28dControl RadarEmailRoutingSummaryDMARCParamsDateRange = "28dControl"
- RadarEmailRoutingSummaryDMARCParamsDateRange12wControl RadarEmailRoutingSummaryDMARCParamsDateRange = "12wControl"
- RadarEmailRoutingSummaryDMARCParamsDateRange24wControl RadarEmailRoutingSummaryDMARCParamsDateRange = "24wControl"
-)
-
-type RadarEmailRoutingSummaryDMARCParamsDKIM string
-
-const (
- RadarEmailRoutingSummaryDMARCParamsDKIMPass RadarEmailRoutingSummaryDMARCParamsDKIM = "PASS"
- RadarEmailRoutingSummaryDMARCParamsDKIMNone RadarEmailRoutingSummaryDMARCParamsDKIM = "NONE"
- RadarEmailRoutingSummaryDMARCParamsDKIMFail RadarEmailRoutingSummaryDMARCParamsDKIM = "FAIL"
-)
-
-type RadarEmailRoutingSummaryDMARCParamsEncrypted string
-
-const (
- RadarEmailRoutingSummaryDMARCParamsEncryptedEncrypted RadarEmailRoutingSummaryDMARCParamsEncrypted = "ENCRYPTED"
- RadarEmailRoutingSummaryDMARCParamsEncryptedNotEncrypted RadarEmailRoutingSummaryDMARCParamsEncrypted = "NOT_ENCRYPTED"
-)
-
-// Format results are returned in.
-type RadarEmailRoutingSummaryDMARCParamsFormat string
-
-const (
- RadarEmailRoutingSummaryDMARCParamsFormatJson RadarEmailRoutingSummaryDMARCParamsFormat = "JSON"
- RadarEmailRoutingSummaryDMARCParamsFormatCsv RadarEmailRoutingSummaryDMARCParamsFormat = "CSV"
-)
-
-type RadarEmailRoutingSummaryDMARCParamsIPVersion string
-
-const (
- RadarEmailRoutingSummaryDMARCParamsIPVersionIPv4 RadarEmailRoutingSummaryDMARCParamsIPVersion = "IPv4"
- RadarEmailRoutingSummaryDMARCParamsIPVersionIPv6 RadarEmailRoutingSummaryDMARCParamsIPVersion = "IPv6"
-)
-
-type RadarEmailRoutingSummaryDMARCParamsSPF string
-
-const (
- RadarEmailRoutingSummaryDMARCParamsSPFPass RadarEmailRoutingSummaryDMARCParamsSPF = "PASS"
- RadarEmailRoutingSummaryDMARCParamsSPFNone RadarEmailRoutingSummaryDMARCParamsSPF = "NONE"
- RadarEmailRoutingSummaryDMARCParamsSPFFail RadarEmailRoutingSummaryDMARCParamsSPF = "FAIL"
-)
-
-type RadarEmailRoutingSummaryDMARCResponseEnvelope struct {
- Result RadarEmailRoutingSummaryDMARCResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarEmailRoutingSummaryDMARCResponseEnvelopeJSON `json:"-"`
-}
-
-// radarEmailRoutingSummaryDMARCResponseEnvelopeJSON contains the JSON metadata for
-// the struct [RadarEmailRoutingSummaryDMARCResponseEnvelope]
-type radarEmailRoutingSummaryDMARCResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailRoutingSummaryDMARCResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailRoutingSummaryDMARCResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailRoutingSummaryEncryptedParams struct {
- // Filter for arc (Authenticated Received Chain).
- ARC param.Field[[]RadarEmailRoutingSummaryEncryptedParamsARC] `query:"arc"`
- // 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[[]RadarEmailRoutingSummaryEncryptedParamsDateRange] `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[[]RadarEmailRoutingSummaryEncryptedParamsDKIM] `query:"dkim"`
- // Filter for dmarc.
- DMARC param.Field[[]RadarEmailRoutingSummaryEncryptedParamsDMARC] `query:"dmarc"`
- // Format results are returned in.
- Format param.Field[RadarEmailRoutingSummaryEncryptedParamsFormat] `query:"format"`
- // Filter for ip version.
- IPVersion param.Field[[]RadarEmailRoutingSummaryEncryptedParamsIPVersion] `query:"ipVersion"`
- // 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[[]RadarEmailRoutingSummaryEncryptedParamsSPF] `query:"spf"`
-}
-
-// URLQuery serializes [RadarEmailRoutingSummaryEncryptedParams]'s query parameters
-// as `url.Values`.
-func (r RadarEmailRoutingSummaryEncryptedParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type RadarEmailRoutingSummaryEncryptedParamsARC string
-
-const (
- RadarEmailRoutingSummaryEncryptedParamsARCPass RadarEmailRoutingSummaryEncryptedParamsARC = "PASS"
- RadarEmailRoutingSummaryEncryptedParamsARCNone RadarEmailRoutingSummaryEncryptedParamsARC = "NONE"
- RadarEmailRoutingSummaryEncryptedParamsARCFail RadarEmailRoutingSummaryEncryptedParamsARC = "FAIL"
-)
-
-type RadarEmailRoutingSummaryEncryptedParamsDateRange string
-
-const (
- RadarEmailRoutingSummaryEncryptedParamsDateRange1d RadarEmailRoutingSummaryEncryptedParamsDateRange = "1d"
- RadarEmailRoutingSummaryEncryptedParamsDateRange2d RadarEmailRoutingSummaryEncryptedParamsDateRange = "2d"
- RadarEmailRoutingSummaryEncryptedParamsDateRange7d RadarEmailRoutingSummaryEncryptedParamsDateRange = "7d"
- RadarEmailRoutingSummaryEncryptedParamsDateRange14d RadarEmailRoutingSummaryEncryptedParamsDateRange = "14d"
- RadarEmailRoutingSummaryEncryptedParamsDateRange28d RadarEmailRoutingSummaryEncryptedParamsDateRange = "28d"
- RadarEmailRoutingSummaryEncryptedParamsDateRange12w RadarEmailRoutingSummaryEncryptedParamsDateRange = "12w"
- RadarEmailRoutingSummaryEncryptedParamsDateRange24w RadarEmailRoutingSummaryEncryptedParamsDateRange = "24w"
- RadarEmailRoutingSummaryEncryptedParamsDateRange52w RadarEmailRoutingSummaryEncryptedParamsDateRange = "52w"
- RadarEmailRoutingSummaryEncryptedParamsDateRange1dControl RadarEmailRoutingSummaryEncryptedParamsDateRange = "1dControl"
- RadarEmailRoutingSummaryEncryptedParamsDateRange2dControl RadarEmailRoutingSummaryEncryptedParamsDateRange = "2dControl"
- RadarEmailRoutingSummaryEncryptedParamsDateRange7dControl RadarEmailRoutingSummaryEncryptedParamsDateRange = "7dControl"
- RadarEmailRoutingSummaryEncryptedParamsDateRange14dControl RadarEmailRoutingSummaryEncryptedParamsDateRange = "14dControl"
- RadarEmailRoutingSummaryEncryptedParamsDateRange28dControl RadarEmailRoutingSummaryEncryptedParamsDateRange = "28dControl"
- RadarEmailRoutingSummaryEncryptedParamsDateRange12wControl RadarEmailRoutingSummaryEncryptedParamsDateRange = "12wControl"
- RadarEmailRoutingSummaryEncryptedParamsDateRange24wControl RadarEmailRoutingSummaryEncryptedParamsDateRange = "24wControl"
-)
-
-type RadarEmailRoutingSummaryEncryptedParamsDKIM string
-
-const (
- RadarEmailRoutingSummaryEncryptedParamsDKIMPass RadarEmailRoutingSummaryEncryptedParamsDKIM = "PASS"
- RadarEmailRoutingSummaryEncryptedParamsDKIMNone RadarEmailRoutingSummaryEncryptedParamsDKIM = "NONE"
- RadarEmailRoutingSummaryEncryptedParamsDKIMFail RadarEmailRoutingSummaryEncryptedParamsDKIM = "FAIL"
-)
-
-type RadarEmailRoutingSummaryEncryptedParamsDMARC string
-
-const (
- RadarEmailRoutingSummaryEncryptedParamsDMARCPass RadarEmailRoutingSummaryEncryptedParamsDMARC = "PASS"
- RadarEmailRoutingSummaryEncryptedParamsDMARCNone RadarEmailRoutingSummaryEncryptedParamsDMARC = "NONE"
- RadarEmailRoutingSummaryEncryptedParamsDMARCFail RadarEmailRoutingSummaryEncryptedParamsDMARC = "FAIL"
-)
-
-// Format results are returned in.
-type RadarEmailRoutingSummaryEncryptedParamsFormat string
-
-const (
- RadarEmailRoutingSummaryEncryptedParamsFormatJson RadarEmailRoutingSummaryEncryptedParamsFormat = "JSON"
- RadarEmailRoutingSummaryEncryptedParamsFormatCsv RadarEmailRoutingSummaryEncryptedParamsFormat = "CSV"
-)
-
-type RadarEmailRoutingSummaryEncryptedParamsIPVersion string
-
-const (
- RadarEmailRoutingSummaryEncryptedParamsIPVersionIPv4 RadarEmailRoutingSummaryEncryptedParamsIPVersion = "IPv4"
- RadarEmailRoutingSummaryEncryptedParamsIPVersionIPv6 RadarEmailRoutingSummaryEncryptedParamsIPVersion = "IPv6"
-)
-
-type RadarEmailRoutingSummaryEncryptedParamsSPF string
-
-const (
- RadarEmailRoutingSummaryEncryptedParamsSPFPass RadarEmailRoutingSummaryEncryptedParamsSPF = "PASS"
- RadarEmailRoutingSummaryEncryptedParamsSPFNone RadarEmailRoutingSummaryEncryptedParamsSPF = "NONE"
- RadarEmailRoutingSummaryEncryptedParamsSPFFail RadarEmailRoutingSummaryEncryptedParamsSPF = "FAIL"
-)
-
-type RadarEmailRoutingSummaryEncryptedResponseEnvelope struct {
- Result RadarEmailRoutingSummaryEncryptedResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarEmailRoutingSummaryEncryptedResponseEnvelopeJSON `json:"-"`
-}
-
-// radarEmailRoutingSummaryEncryptedResponseEnvelopeJSON contains the JSON metadata
-// for the struct [RadarEmailRoutingSummaryEncryptedResponseEnvelope]
-type radarEmailRoutingSummaryEncryptedResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailRoutingSummaryEncryptedResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailRoutingSummaryEncryptedResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailRoutingSummaryIPVersionParams struct {
- // Filter for arc (Authenticated Received Chain).
- ARC param.Field[[]RadarEmailRoutingSummaryIPVersionParamsARC] `query:"arc"`
- // 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[[]RadarEmailRoutingSummaryIPVersionParamsDateRange] `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[[]RadarEmailRoutingSummaryIPVersionParamsDKIM] `query:"dkim"`
- // Filter for dmarc.
- DMARC param.Field[[]RadarEmailRoutingSummaryIPVersionParamsDMARC] `query:"dmarc"`
- // Filter for encrypted emails.
- Encrypted param.Field[[]RadarEmailRoutingSummaryIPVersionParamsEncrypted] `query:"encrypted"`
- // Format results are returned in.
- Format param.Field[RadarEmailRoutingSummaryIPVersionParamsFormat] `query:"format"`
- // 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[[]RadarEmailRoutingSummaryIPVersionParamsSPF] `query:"spf"`
-}
-
-// URLQuery serializes [RadarEmailRoutingSummaryIPVersionParams]'s query parameters
-// as `url.Values`.
-func (r RadarEmailRoutingSummaryIPVersionParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type RadarEmailRoutingSummaryIPVersionParamsARC string
-
-const (
- RadarEmailRoutingSummaryIPVersionParamsARCPass RadarEmailRoutingSummaryIPVersionParamsARC = "PASS"
- RadarEmailRoutingSummaryIPVersionParamsARCNone RadarEmailRoutingSummaryIPVersionParamsARC = "NONE"
- RadarEmailRoutingSummaryIPVersionParamsARCFail RadarEmailRoutingSummaryIPVersionParamsARC = "FAIL"
-)
-
-type RadarEmailRoutingSummaryIPVersionParamsDateRange string
-
-const (
- RadarEmailRoutingSummaryIPVersionParamsDateRange1d RadarEmailRoutingSummaryIPVersionParamsDateRange = "1d"
- RadarEmailRoutingSummaryIPVersionParamsDateRange2d RadarEmailRoutingSummaryIPVersionParamsDateRange = "2d"
- RadarEmailRoutingSummaryIPVersionParamsDateRange7d RadarEmailRoutingSummaryIPVersionParamsDateRange = "7d"
- RadarEmailRoutingSummaryIPVersionParamsDateRange14d RadarEmailRoutingSummaryIPVersionParamsDateRange = "14d"
- RadarEmailRoutingSummaryIPVersionParamsDateRange28d RadarEmailRoutingSummaryIPVersionParamsDateRange = "28d"
- RadarEmailRoutingSummaryIPVersionParamsDateRange12w RadarEmailRoutingSummaryIPVersionParamsDateRange = "12w"
- RadarEmailRoutingSummaryIPVersionParamsDateRange24w RadarEmailRoutingSummaryIPVersionParamsDateRange = "24w"
- RadarEmailRoutingSummaryIPVersionParamsDateRange52w RadarEmailRoutingSummaryIPVersionParamsDateRange = "52w"
- RadarEmailRoutingSummaryIPVersionParamsDateRange1dControl RadarEmailRoutingSummaryIPVersionParamsDateRange = "1dControl"
- RadarEmailRoutingSummaryIPVersionParamsDateRange2dControl RadarEmailRoutingSummaryIPVersionParamsDateRange = "2dControl"
- RadarEmailRoutingSummaryIPVersionParamsDateRange7dControl RadarEmailRoutingSummaryIPVersionParamsDateRange = "7dControl"
- RadarEmailRoutingSummaryIPVersionParamsDateRange14dControl RadarEmailRoutingSummaryIPVersionParamsDateRange = "14dControl"
- RadarEmailRoutingSummaryIPVersionParamsDateRange28dControl RadarEmailRoutingSummaryIPVersionParamsDateRange = "28dControl"
- RadarEmailRoutingSummaryIPVersionParamsDateRange12wControl RadarEmailRoutingSummaryIPVersionParamsDateRange = "12wControl"
- RadarEmailRoutingSummaryIPVersionParamsDateRange24wControl RadarEmailRoutingSummaryIPVersionParamsDateRange = "24wControl"
-)
-
-type RadarEmailRoutingSummaryIPVersionParamsDKIM string
-
-const (
- RadarEmailRoutingSummaryIPVersionParamsDKIMPass RadarEmailRoutingSummaryIPVersionParamsDKIM = "PASS"
- RadarEmailRoutingSummaryIPVersionParamsDKIMNone RadarEmailRoutingSummaryIPVersionParamsDKIM = "NONE"
- RadarEmailRoutingSummaryIPVersionParamsDKIMFail RadarEmailRoutingSummaryIPVersionParamsDKIM = "FAIL"
-)
-
-type RadarEmailRoutingSummaryIPVersionParamsDMARC string
-
-const (
- RadarEmailRoutingSummaryIPVersionParamsDMARCPass RadarEmailRoutingSummaryIPVersionParamsDMARC = "PASS"
- RadarEmailRoutingSummaryIPVersionParamsDMARCNone RadarEmailRoutingSummaryIPVersionParamsDMARC = "NONE"
- RadarEmailRoutingSummaryIPVersionParamsDMARCFail RadarEmailRoutingSummaryIPVersionParamsDMARC = "FAIL"
-)
-
-type RadarEmailRoutingSummaryIPVersionParamsEncrypted string
-
-const (
- RadarEmailRoutingSummaryIPVersionParamsEncryptedEncrypted RadarEmailRoutingSummaryIPVersionParamsEncrypted = "ENCRYPTED"
- RadarEmailRoutingSummaryIPVersionParamsEncryptedNotEncrypted RadarEmailRoutingSummaryIPVersionParamsEncrypted = "NOT_ENCRYPTED"
-)
-
-// Format results are returned in.
-type RadarEmailRoutingSummaryIPVersionParamsFormat string
-
-const (
- RadarEmailRoutingSummaryIPVersionParamsFormatJson RadarEmailRoutingSummaryIPVersionParamsFormat = "JSON"
- RadarEmailRoutingSummaryIPVersionParamsFormatCsv RadarEmailRoutingSummaryIPVersionParamsFormat = "CSV"
-)
-
-type RadarEmailRoutingSummaryIPVersionParamsSPF string
-
-const (
- RadarEmailRoutingSummaryIPVersionParamsSPFPass RadarEmailRoutingSummaryIPVersionParamsSPF = "PASS"
- RadarEmailRoutingSummaryIPVersionParamsSPFNone RadarEmailRoutingSummaryIPVersionParamsSPF = "NONE"
- RadarEmailRoutingSummaryIPVersionParamsSPFFail RadarEmailRoutingSummaryIPVersionParamsSPF = "FAIL"
-)
-
-type RadarEmailRoutingSummaryIPVersionResponseEnvelope struct {
- Result RadarEmailRoutingSummaryIPVersionResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarEmailRoutingSummaryIPVersionResponseEnvelopeJSON `json:"-"`
-}
-
-// radarEmailRoutingSummaryIPVersionResponseEnvelopeJSON contains the JSON metadata
-// for the struct [RadarEmailRoutingSummaryIPVersionResponseEnvelope]
-type radarEmailRoutingSummaryIPVersionResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailRoutingSummaryIPVersionResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailRoutingSummaryIPVersionResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailRoutingSummarySPFParams struct {
- // Filter for arc (Authenticated Received Chain).
- ARC param.Field[[]RadarEmailRoutingSummarySPFParamsARC] `query:"arc"`
- // 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[[]RadarEmailRoutingSummarySPFParamsDateRange] `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[[]RadarEmailRoutingSummarySPFParamsDKIM] `query:"dkim"`
- // Filter for dmarc.
- DMARC param.Field[[]RadarEmailRoutingSummarySPFParamsDMARC] `query:"dmarc"`
- // Filter for encrypted emails.
- Encrypted param.Field[[]RadarEmailRoutingSummarySPFParamsEncrypted] `query:"encrypted"`
- // Format results are returned in.
- Format param.Field[RadarEmailRoutingSummarySPFParamsFormat] `query:"format"`
- // Filter for ip version.
- IPVersion param.Field[[]RadarEmailRoutingSummarySPFParamsIPVersion] `query:"ipVersion"`
- // Array of names that will be used to name the series in responses.
- Name param.Field[[]string] `query:"name"`
-}
-
-// URLQuery serializes [RadarEmailRoutingSummarySPFParams]'s query parameters as
-// `url.Values`.
-func (r RadarEmailRoutingSummarySPFParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type RadarEmailRoutingSummarySPFParamsARC string
-
-const (
- RadarEmailRoutingSummarySPFParamsARCPass RadarEmailRoutingSummarySPFParamsARC = "PASS"
- RadarEmailRoutingSummarySPFParamsARCNone RadarEmailRoutingSummarySPFParamsARC = "NONE"
- RadarEmailRoutingSummarySPFParamsARCFail RadarEmailRoutingSummarySPFParamsARC = "FAIL"
-)
-
-type RadarEmailRoutingSummarySPFParamsDateRange string
-
-const (
- RadarEmailRoutingSummarySPFParamsDateRange1d RadarEmailRoutingSummarySPFParamsDateRange = "1d"
- RadarEmailRoutingSummarySPFParamsDateRange2d RadarEmailRoutingSummarySPFParamsDateRange = "2d"
- RadarEmailRoutingSummarySPFParamsDateRange7d RadarEmailRoutingSummarySPFParamsDateRange = "7d"
- RadarEmailRoutingSummarySPFParamsDateRange14d RadarEmailRoutingSummarySPFParamsDateRange = "14d"
- RadarEmailRoutingSummarySPFParamsDateRange28d RadarEmailRoutingSummarySPFParamsDateRange = "28d"
- RadarEmailRoutingSummarySPFParamsDateRange12w RadarEmailRoutingSummarySPFParamsDateRange = "12w"
- RadarEmailRoutingSummarySPFParamsDateRange24w RadarEmailRoutingSummarySPFParamsDateRange = "24w"
- RadarEmailRoutingSummarySPFParamsDateRange52w RadarEmailRoutingSummarySPFParamsDateRange = "52w"
- RadarEmailRoutingSummarySPFParamsDateRange1dControl RadarEmailRoutingSummarySPFParamsDateRange = "1dControl"
- RadarEmailRoutingSummarySPFParamsDateRange2dControl RadarEmailRoutingSummarySPFParamsDateRange = "2dControl"
- RadarEmailRoutingSummarySPFParamsDateRange7dControl RadarEmailRoutingSummarySPFParamsDateRange = "7dControl"
- RadarEmailRoutingSummarySPFParamsDateRange14dControl RadarEmailRoutingSummarySPFParamsDateRange = "14dControl"
- RadarEmailRoutingSummarySPFParamsDateRange28dControl RadarEmailRoutingSummarySPFParamsDateRange = "28dControl"
- RadarEmailRoutingSummarySPFParamsDateRange12wControl RadarEmailRoutingSummarySPFParamsDateRange = "12wControl"
- RadarEmailRoutingSummarySPFParamsDateRange24wControl RadarEmailRoutingSummarySPFParamsDateRange = "24wControl"
-)
-
-type RadarEmailRoutingSummarySPFParamsDKIM string
-
-const (
- RadarEmailRoutingSummarySPFParamsDKIMPass RadarEmailRoutingSummarySPFParamsDKIM = "PASS"
- RadarEmailRoutingSummarySPFParamsDKIMNone RadarEmailRoutingSummarySPFParamsDKIM = "NONE"
- RadarEmailRoutingSummarySPFParamsDKIMFail RadarEmailRoutingSummarySPFParamsDKIM = "FAIL"
-)
-
-type RadarEmailRoutingSummarySPFParamsDMARC string
-
-const (
- RadarEmailRoutingSummarySPFParamsDMARCPass RadarEmailRoutingSummarySPFParamsDMARC = "PASS"
- RadarEmailRoutingSummarySPFParamsDMARCNone RadarEmailRoutingSummarySPFParamsDMARC = "NONE"
- RadarEmailRoutingSummarySPFParamsDMARCFail RadarEmailRoutingSummarySPFParamsDMARC = "FAIL"
-)
-
-type RadarEmailRoutingSummarySPFParamsEncrypted string
-
-const (
- RadarEmailRoutingSummarySPFParamsEncryptedEncrypted RadarEmailRoutingSummarySPFParamsEncrypted = "ENCRYPTED"
- RadarEmailRoutingSummarySPFParamsEncryptedNotEncrypted RadarEmailRoutingSummarySPFParamsEncrypted = "NOT_ENCRYPTED"
-)
-
-// Format results are returned in.
-type RadarEmailRoutingSummarySPFParamsFormat string
-
-const (
- RadarEmailRoutingSummarySPFParamsFormatJson RadarEmailRoutingSummarySPFParamsFormat = "JSON"
- RadarEmailRoutingSummarySPFParamsFormatCsv RadarEmailRoutingSummarySPFParamsFormat = "CSV"
-)
-
-type RadarEmailRoutingSummarySPFParamsIPVersion string
-
-const (
- RadarEmailRoutingSummarySPFParamsIPVersionIPv4 RadarEmailRoutingSummarySPFParamsIPVersion = "IPv4"
- RadarEmailRoutingSummarySPFParamsIPVersionIPv6 RadarEmailRoutingSummarySPFParamsIPVersion = "IPv6"
-)
-
-type RadarEmailRoutingSummarySPFResponseEnvelope struct {
- Result RadarEmailRoutingSummarySPFResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarEmailRoutingSummarySPFResponseEnvelopeJSON `json:"-"`
-}
-
-// radarEmailRoutingSummarySPFResponseEnvelopeJSON contains the JSON metadata for
-// the struct [RadarEmailRoutingSummarySPFResponseEnvelope]
-type radarEmailRoutingSummarySPFResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailRoutingSummarySPFResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailRoutingSummarySPFResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
diff --git a/radaremailroutingsummary_test.go b/radaremailroutingsummary_test.go
deleted file mode 100644
index 0ce932f2a52..00000000000
--- a/radaremailroutingsummary_test.go
+++ /dev/null
@@ -1,225 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
- "time"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRadarEmailRoutingSummaryARCWithOptionalParams(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"),
- )
- _, err := client.Radar.Email.Routing.Summary.ARC(context.TODO(), cloudflare.RadarEmailRoutingSummaryARCParams{
- DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
- DateRange: cloudflare.F([]cloudflare.RadarEmailRoutingSummaryARCParamsDateRange{cloudflare.RadarEmailRoutingSummaryARCParamsDateRange1d, cloudflare.RadarEmailRoutingSummaryARCParamsDateRange2d, cloudflare.RadarEmailRoutingSummaryARCParamsDateRange7d}),
- DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
- DKIM: cloudflare.F([]cloudflare.RadarEmailRoutingSummaryARCParamsDKIM{cloudflare.RadarEmailRoutingSummaryARCParamsDKIMPass, cloudflare.RadarEmailRoutingSummaryARCParamsDKIMNone, cloudflare.RadarEmailRoutingSummaryARCParamsDKIMFail}),
- DMARC: cloudflare.F([]cloudflare.RadarEmailRoutingSummaryARCParamsDMARC{cloudflare.RadarEmailRoutingSummaryARCParamsDMARCPass, cloudflare.RadarEmailRoutingSummaryARCParamsDMARCNone, cloudflare.RadarEmailRoutingSummaryARCParamsDMARCFail}),
- Encrypted: cloudflare.F([]cloudflare.RadarEmailRoutingSummaryARCParamsEncrypted{cloudflare.RadarEmailRoutingSummaryARCParamsEncryptedEncrypted, cloudflare.RadarEmailRoutingSummaryARCParamsEncryptedNotEncrypted}),
- Format: cloudflare.F(cloudflare.RadarEmailRoutingSummaryARCParamsFormatJson),
- IPVersion: cloudflare.F([]cloudflare.RadarEmailRoutingSummaryARCParamsIPVersion{cloudflare.RadarEmailRoutingSummaryARCParamsIPVersionIPv4, cloudflare.RadarEmailRoutingSummaryARCParamsIPVersionIPv6}),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- SPF: cloudflare.F([]cloudflare.RadarEmailRoutingSummaryARCParamsSPF{cloudflare.RadarEmailRoutingSummaryARCParamsSPFPass, cloudflare.RadarEmailRoutingSummaryARCParamsSPFNone, cloudflare.RadarEmailRoutingSummaryARCParamsSPFFail}),
- })
- 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())
- }
-}
-
-func TestRadarEmailRoutingSummaryDKIMWithOptionalParams(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"),
- )
- _, err := client.Radar.Email.Routing.Summary.DKIM(context.TODO(), cloudflare.RadarEmailRoutingSummaryDKIMParams{
- ARC: cloudflare.F([]cloudflare.RadarEmailRoutingSummaryDKIMParamsARC{cloudflare.RadarEmailRoutingSummaryDKIMParamsARCPass, cloudflare.RadarEmailRoutingSummaryDKIMParamsARCNone, cloudflare.RadarEmailRoutingSummaryDKIMParamsARCFail}),
- DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
- DateRange: cloudflare.F([]cloudflare.RadarEmailRoutingSummaryDKIMParamsDateRange{cloudflare.RadarEmailRoutingSummaryDKIMParamsDateRange1d, cloudflare.RadarEmailRoutingSummaryDKIMParamsDateRange2d, cloudflare.RadarEmailRoutingSummaryDKIMParamsDateRange7d}),
- DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
- DMARC: cloudflare.F([]cloudflare.RadarEmailRoutingSummaryDKIMParamsDMARC{cloudflare.RadarEmailRoutingSummaryDKIMParamsDMARCPass, cloudflare.RadarEmailRoutingSummaryDKIMParamsDMARCNone, cloudflare.RadarEmailRoutingSummaryDKIMParamsDMARCFail}),
- Encrypted: cloudflare.F([]cloudflare.RadarEmailRoutingSummaryDKIMParamsEncrypted{cloudflare.RadarEmailRoutingSummaryDKIMParamsEncryptedEncrypted, cloudflare.RadarEmailRoutingSummaryDKIMParamsEncryptedNotEncrypted}),
- Format: cloudflare.F(cloudflare.RadarEmailRoutingSummaryDKIMParamsFormatJson),
- IPVersion: cloudflare.F([]cloudflare.RadarEmailRoutingSummaryDKIMParamsIPVersion{cloudflare.RadarEmailRoutingSummaryDKIMParamsIPVersionIPv4, cloudflare.RadarEmailRoutingSummaryDKIMParamsIPVersionIPv6}),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- SPF: cloudflare.F([]cloudflare.RadarEmailRoutingSummaryDKIMParamsSPF{cloudflare.RadarEmailRoutingSummaryDKIMParamsSPFPass, cloudflare.RadarEmailRoutingSummaryDKIMParamsSPFNone, cloudflare.RadarEmailRoutingSummaryDKIMParamsSPFFail}),
- })
- 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())
- }
-}
-
-func TestRadarEmailRoutingSummaryDMARCWithOptionalParams(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"),
- )
- _, err := client.Radar.Email.Routing.Summary.DMARC(context.TODO(), cloudflare.RadarEmailRoutingSummaryDMARCParams{
- ARC: cloudflare.F([]cloudflare.RadarEmailRoutingSummaryDMARCParamsARC{cloudflare.RadarEmailRoutingSummaryDMARCParamsARCPass, cloudflare.RadarEmailRoutingSummaryDMARCParamsARCNone, cloudflare.RadarEmailRoutingSummaryDMARCParamsARCFail}),
- DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
- DateRange: cloudflare.F([]cloudflare.RadarEmailRoutingSummaryDMARCParamsDateRange{cloudflare.RadarEmailRoutingSummaryDMARCParamsDateRange1d, cloudflare.RadarEmailRoutingSummaryDMARCParamsDateRange2d, cloudflare.RadarEmailRoutingSummaryDMARCParamsDateRange7d}),
- DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
- DKIM: cloudflare.F([]cloudflare.RadarEmailRoutingSummaryDMARCParamsDKIM{cloudflare.RadarEmailRoutingSummaryDMARCParamsDKIMPass, cloudflare.RadarEmailRoutingSummaryDMARCParamsDKIMNone, cloudflare.RadarEmailRoutingSummaryDMARCParamsDKIMFail}),
- Encrypted: cloudflare.F([]cloudflare.RadarEmailRoutingSummaryDMARCParamsEncrypted{cloudflare.RadarEmailRoutingSummaryDMARCParamsEncryptedEncrypted, cloudflare.RadarEmailRoutingSummaryDMARCParamsEncryptedNotEncrypted}),
- Format: cloudflare.F(cloudflare.RadarEmailRoutingSummaryDMARCParamsFormatJson),
- IPVersion: cloudflare.F([]cloudflare.RadarEmailRoutingSummaryDMARCParamsIPVersion{cloudflare.RadarEmailRoutingSummaryDMARCParamsIPVersionIPv4, cloudflare.RadarEmailRoutingSummaryDMARCParamsIPVersionIPv6}),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- SPF: cloudflare.F([]cloudflare.RadarEmailRoutingSummaryDMARCParamsSPF{cloudflare.RadarEmailRoutingSummaryDMARCParamsSPFPass, cloudflare.RadarEmailRoutingSummaryDMARCParamsSPFNone, cloudflare.RadarEmailRoutingSummaryDMARCParamsSPFFail}),
- })
- 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())
- }
-}
-
-func TestRadarEmailRoutingSummaryEncryptedWithOptionalParams(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"),
- )
- _, err := client.Radar.Email.Routing.Summary.Encrypted(context.TODO(), cloudflare.RadarEmailRoutingSummaryEncryptedParams{
- ARC: cloudflare.F([]cloudflare.RadarEmailRoutingSummaryEncryptedParamsARC{cloudflare.RadarEmailRoutingSummaryEncryptedParamsARCPass, cloudflare.RadarEmailRoutingSummaryEncryptedParamsARCNone, cloudflare.RadarEmailRoutingSummaryEncryptedParamsARCFail}),
- DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
- DateRange: cloudflare.F([]cloudflare.RadarEmailRoutingSummaryEncryptedParamsDateRange{cloudflare.RadarEmailRoutingSummaryEncryptedParamsDateRange1d, cloudflare.RadarEmailRoutingSummaryEncryptedParamsDateRange2d, cloudflare.RadarEmailRoutingSummaryEncryptedParamsDateRange7d}),
- DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
- DKIM: cloudflare.F([]cloudflare.RadarEmailRoutingSummaryEncryptedParamsDKIM{cloudflare.RadarEmailRoutingSummaryEncryptedParamsDKIMPass, cloudflare.RadarEmailRoutingSummaryEncryptedParamsDKIMNone, cloudflare.RadarEmailRoutingSummaryEncryptedParamsDKIMFail}),
- DMARC: cloudflare.F([]cloudflare.RadarEmailRoutingSummaryEncryptedParamsDMARC{cloudflare.RadarEmailRoutingSummaryEncryptedParamsDMARCPass, cloudflare.RadarEmailRoutingSummaryEncryptedParamsDMARCNone, cloudflare.RadarEmailRoutingSummaryEncryptedParamsDMARCFail}),
- Format: cloudflare.F(cloudflare.RadarEmailRoutingSummaryEncryptedParamsFormatJson),
- IPVersion: cloudflare.F([]cloudflare.RadarEmailRoutingSummaryEncryptedParamsIPVersion{cloudflare.RadarEmailRoutingSummaryEncryptedParamsIPVersionIPv4, cloudflare.RadarEmailRoutingSummaryEncryptedParamsIPVersionIPv6}),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- SPF: cloudflare.F([]cloudflare.RadarEmailRoutingSummaryEncryptedParamsSPF{cloudflare.RadarEmailRoutingSummaryEncryptedParamsSPFPass, cloudflare.RadarEmailRoutingSummaryEncryptedParamsSPFNone, cloudflare.RadarEmailRoutingSummaryEncryptedParamsSPFFail}),
- })
- 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())
- }
-}
-
-func TestRadarEmailRoutingSummaryIPVersionWithOptionalParams(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"),
- )
- _, err := client.Radar.Email.Routing.Summary.IPVersion(context.TODO(), cloudflare.RadarEmailRoutingSummaryIPVersionParams{
- ARC: cloudflare.F([]cloudflare.RadarEmailRoutingSummaryIPVersionParamsARC{cloudflare.RadarEmailRoutingSummaryIPVersionParamsARCPass, cloudflare.RadarEmailRoutingSummaryIPVersionParamsARCNone, cloudflare.RadarEmailRoutingSummaryIPVersionParamsARCFail}),
- DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
- DateRange: cloudflare.F([]cloudflare.RadarEmailRoutingSummaryIPVersionParamsDateRange{cloudflare.RadarEmailRoutingSummaryIPVersionParamsDateRange1d, cloudflare.RadarEmailRoutingSummaryIPVersionParamsDateRange2d, cloudflare.RadarEmailRoutingSummaryIPVersionParamsDateRange7d}),
- DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
- DKIM: cloudflare.F([]cloudflare.RadarEmailRoutingSummaryIPVersionParamsDKIM{cloudflare.RadarEmailRoutingSummaryIPVersionParamsDKIMPass, cloudflare.RadarEmailRoutingSummaryIPVersionParamsDKIMNone, cloudflare.RadarEmailRoutingSummaryIPVersionParamsDKIMFail}),
- DMARC: cloudflare.F([]cloudflare.RadarEmailRoutingSummaryIPVersionParamsDMARC{cloudflare.RadarEmailRoutingSummaryIPVersionParamsDMARCPass, cloudflare.RadarEmailRoutingSummaryIPVersionParamsDMARCNone, cloudflare.RadarEmailRoutingSummaryIPVersionParamsDMARCFail}),
- Encrypted: cloudflare.F([]cloudflare.RadarEmailRoutingSummaryIPVersionParamsEncrypted{cloudflare.RadarEmailRoutingSummaryIPVersionParamsEncryptedEncrypted, cloudflare.RadarEmailRoutingSummaryIPVersionParamsEncryptedNotEncrypted}),
- Format: cloudflare.F(cloudflare.RadarEmailRoutingSummaryIPVersionParamsFormatJson),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- SPF: cloudflare.F([]cloudflare.RadarEmailRoutingSummaryIPVersionParamsSPF{cloudflare.RadarEmailRoutingSummaryIPVersionParamsSPFPass, cloudflare.RadarEmailRoutingSummaryIPVersionParamsSPFNone, cloudflare.RadarEmailRoutingSummaryIPVersionParamsSPFFail}),
- })
- 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())
- }
-}
-
-func TestRadarEmailRoutingSummarySPFWithOptionalParams(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"),
- )
- _, err := client.Radar.Email.Routing.Summary.SPF(context.TODO(), cloudflare.RadarEmailRoutingSummarySPFParams{
- ARC: cloudflare.F([]cloudflare.RadarEmailRoutingSummarySPFParamsARC{cloudflare.RadarEmailRoutingSummarySPFParamsARCPass, cloudflare.RadarEmailRoutingSummarySPFParamsARCNone, cloudflare.RadarEmailRoutingSummarySPFParamsARCFail}),
- DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
- DateRange: cloudflare.F([]cloudflare.RadarEmailRoutingSummarySPFParamsDateRange{cloudflare.RadarEmailRoutingSummarySPFParamsDateRange1d, cloudflare.RadarEmailRoutingSummarySPFParamsDateRange2d, cloudflare.RadarEmailRoutingSummarySPFParamsDateRange7d}),
- DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
- DKIM: cloudflare.F([]cloudflare.RadarEmailRoutingSummarySPFParamsDKIM{cloudflare.RadarEmailRoutingSummarySPFParamsDKIMPass, cloudflare.RadarEmailRoutingSummarySPFParamsDKIMNone, cloudflare.RadarEmailRoutingSummarySPFParamsDKIMFail}),
- DMARC: cloudflare.F([]cloudflare.RadarEmailRoutingSummarySPFParamsDMARC{cloudflare.RadarEmailRoutingSummarySPFParamsDMARCPass, cloudflare.RadarEmailRoutingSummarySPFParamsDMARCNone, cloudflare.RadarEmailRoutingSummarySPFParamsDMARCFail}),
- Encrypted: cloudflare.F([]cloudflare.RadarEmailRoutingSummarySPFParamsEncrypted{cloudflare.RadarEmailRoutingSummarySPFParamsEncryptedEncrypted, cloudflare.RadarEmailRoutingSummarySPFParamsEncryptedNotEncrypted}),
- Format: cloudflare.F(cloudflare.RadarEmailRoutingSummarySPFParamsFormatJson),
- IPVersion: cloudflare.F([]cloudflare.RadarEmailRoutingSummarySPFParamsIPVersion{cloudflare.RadarEmailRoutingSummarySPFParamsIPVersionIPv4, cloudflare.RadarEmailRoutingSummarySPFParamsIPVersionIPv6}),
- 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/radaremailroutingtimeseriesgroup.go b/radaremailroutingtimeseriesgroup.go
deleted file mode 100644
index 90baca09110..00000000000
--- a/radaremailroutingtimeseriesgroup.go
+++ /dev/null
@@ -1,1236 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarEmailRoutingTimeseriesGroupService contains methods and other services that
-// help with interacting with the cloudflare API. Note, unlike clients, this
-// service does not read variables from the environment automatically. You should
-// not instantiate this service directly, and instead use the
-// [NewRadarEmailRoutingTimeseriesGroupService] method instead.
-type RadarEmailRoutingTimeseriesGroupService struct {
- Options []option.RequestOption
-}
-
-// NewRadarEmailRoutingTimeseriesGroupService generates a new service that applies
-// the given options to each request. These options are applied after the parent
-// client's options (if there is one), and before any request-specific options.
-func NewRadarEmailRoutingTimeseriesGroupService(opts ...option.RequestOption) (r *RadarEmailRoutingTimeseriesGroupService) {
- r = &RadarEmailRoutingTimeseriesGroupService{}
- r.Options = opts
- return
-}
-
-// Percentage distribution of emails classified per Arc validation over time.
-func (r *RadarEmailRoutingTimeseriesGroupService) ARC(ctx context.Context, query RadarEmailRoutingTimeseriesGroupARCParams, opts ...option.RequestOption) (res *RadarEmailRoutingTimeseriesGroupARCResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarEmailRoutingTimeseriesGroupARCResponseEnvelope
- path := "radar/email/routing/timeseries_groups/arc"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Percentage distribution of emails classified per DKIM validation over time.
-func (r *RadarEmailRoutingTimeseriesGroupService) DKIM(ctx context.Context, query RadarEmailRoutingTimeseriesGroupDKIMParams, opts ...option.RequestOption) (res *RadarEmailRoutingTimeseriesGroupDKIMResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarEmailRoutingTimeseriesGroupDKIMResponseEnvelope
- path := "radar/email/routing/timeseries_groups/dkim"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Percentage distribution of emails classified per DMARC validation over time.
-func (r *RadarEmailRoutingTimeseriesGroupService) DMARC(ctx context.Context, query RadarEmailRoutingTimeseriesGroupDMARCParams, opts ...option.RequestOption) (res *RadarEmailRoutingTimeseriesGroupDMARCResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarEmailRoutingTimeseriesGroupDMARCResponseEnvelope
- path := "radar/email/routing/timeseries_groups/dmarc"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Percentage distribution of emails by Encrypted over time.
-func (r *RadarEmailRoutingTimeseriesGroupService) Encrypted(ctx context.Context, query RadarEmailRoutingTimeseriesGroupEncryptedParams, opts ...option.RequestOption) (res *RadarEmailRoutingTimeseriesGroupEncryptedResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarEmailRoutingTimeseriesGroupEncryptedResponseEnvelope
- path := "radar/email/routing/timeseries_groups/encrypted"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Percentage distribution of emails by Ip Version over time.
-func (r *RadarEmailRoutingTimeseriesGroupService) IPVersion(ctx context.Context, query RadarEmailRoutingTimeseriesGroupIPVersionParams, opts ...option.RequestOption) (res *RadarEmailRoutingTimeseriesGroupIPVersionResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarEmailRoutingTimeseriesGroupIPVersionResponseEnvelope
- path := "radar/email/routing/timeseries_groups/ip_version"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Percentage distribution of emails classified per SPF validation over time.
-func (r *RadarEmailRoutingTimeseriesGroupService) SPF(ctx context.Context, query RadarEmailRoutingTimeseriesGroupSPFParams, opts ...option.RequestOption) (res *RadarEmailRoutingTimeseriesGroupSPFResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarEmailRoutingTimeseriesGroupSPFResponseEnvelope
- path := "radar/email/routing/timeseries_groups/spf"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type RadarEmailRoutingTimeseriesGroupARCResponse struct {
- Meta interface{} `json:"meta,required"`
- Serie0 RadarEmailRoutingTimeseriesGroupARCResponseSerie0 `json:"serie_0,required"`
- JSON radarEmailRoutingTimeseriesGroupARCResponseJSON `json:"-"`
-}
-
-// radarEmailRoutingTimeseriesGroupARCResponseJSON contains the JSON metadata for
-// the struct [RadarEmailRoutingTimeseriesGroupARCResponse]
-type radarEmailRoutingTimeseriesGroupARCResponseJSON struct {
- Meta apijson.Field
- Serie0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailRoutingTimeseriesGroupARCResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailRoutingTimeseriesGroupARCResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailRoutingTimeseriesGroupARCResponseSerie0 struct {
- Fail []string `json:"FAIL,required"`
- None []string `json:"NONE,required"`
- Pass []string `json:"PASS,required"`
- JSON radarEmailRoutingTimeseriesGroupARCResponseSerie0JSON `json:"-"`
-}
-
-// radarEmailRoutingTimeseriesGroupARCResponseSerie0JSON contains the JSON metadata
-// for the struct [RadarEmailRoutingTimeseriesGroupARCResponseSerie0]
-type radarEmailRoutingTimeseriesGroupARCResponseSerie0JSON struct {
- Fail apijson.Field
- None apijson.Field
- Pass apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailRoutingTimeseriesGroupARCResponseSerie0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailRoutingTimeseriesGroupARCResponseSerie0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailRoutingTimeseriesGroupDKIMResponse struct {
- Meta interface{} `json:"meta,required"`
- Serie0 RadarEmailRoutingTimeseriesGroupDKIMResponseSerie0 `json:"serie_0,required"`
- JSON radarEmailRoutingTimeseriesGroupDKIMResponseJSON `json:"-"`
-}
-
-// radarEmailRoutingTimeseriesGroupDKIMResponseJSON contains the JSON metadata for
-// the struct [RadarEmailRoutingTimeseriesGroupDKIMResponse]
-type radarEmailRoutingTimeseriesGroupDKIMResponseJSON struct {
- Meta apijson.Field
- Serie0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailRoutingTimeseriesGroupDKIMResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailRoutingTimeseriesGroupDKIMResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailRoutingTimeseriesGroupDKIMResponseSerie0 struct {
- Fail []string `json:"FAIL,required"`
- None []string `json:"NONE,required"`
- Pass []string `json:"PASS,required"`
- JSON radarEmailRoutingTimeseriesGroupDKIMResponseSerie0JSON `json:"-"`
-}
-
-// radarEmailRoutingTimeseriesGroupDKIMResponseSerie0JSON contains the JSON
-// metadata for the struct [RadarEmailRoutingTimeseriesGroupDKIMResponseSerie0]
-type radarEmailRoutingTimeseriesGroupDKIMResponseSerie0JSON struct {
- Fail apijson.Field
- None apijson.Field
- Pass apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailRoutingTimeseriesGroupDKIMResponseSerie0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailRoutingTimeseriesGroupDKIMResponseSerie0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailRoutingTimeseriesGroupDMARCResponse struct {
- Meta interface{} `json:"meta,required"`
- Serie0 RadarEmailRoutingTimeseriesGroupDMARCResponseSerie0 `json:"serie_0,required"`
- JSON radarEmailRoutingTimeseriesGroupDMARCResponseJSON `json:"-"`
-}
-
-// radarEmailRoutingTimeseriesGroupDMARCResponseJSON contains the JSON metadata for
-// the struct [RadarEmailRoutingTimeseriesGroupDMARCResponse]
-type radarEmailRoutingTimeseriesGroupDMARCResponseJSON struct {
- Meta apijson.Field
- Serie0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailRoutingTimeseriesGroupDMARCResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailRoutingTimeseriesGroupDMARCResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailRoutingTimeseriesGroupDMARCResponseSerie0 struct {
- Fail []string `json:"FAIL,required"`
- None []string `json:"NONE,required"`
- Pass []string `json:"PASS,required"`
- JSON radarEmailRoutingTimeseriesGroupDMARCResponseSerie0JSON `json:"-"`
-}
-
-// radarEmailRoutingTimeseriesGroupDMARCResponseSerie0JSON contains the JSON
-// metadata for the struct [RadarEmailRoutingTimeseriesGroupDMARCResponseSerie0]
-type radarEmailRoutingTimeseriesGroupDMARCResponseSerie0JSON struct {
- Fail apijson.Field
- None apijson.Field
- Pass apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailRoutingTimeseriesGroupDMARCResponseSerie0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailRoutingTimeseriesGroupDMARCResponseSerie0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailRoutingTimeseriesGroupEncryptedResponse struct {
- Meta interface{} `json:"meta,required"`
- Serie0 RadarEmailRoutingTimeseriesGroupEncryptedResponseSerie0 `json:"serie_0,required"`
- JSON radarEmailRoutingTimeseriesGroupEncryptedResponseJSON `json:"-"`
-}
-
-// radarEmailRoutingTimeseriesGroupEncryptedResponseJSON contains the JSON metadata
-// for the struct [RadarEmailRoutingTimeseriesGroupEncryptedResponse]
-type radarEmailRoutingTimeseriesGroupEncryptedResponseJSON struct {
- Meta apijson.Field
- Serie0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailRoutingTimeseriesGroupEncryptedResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailRoutingTimeseriesGroupEncryptedResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailRoutingTimeseriesGroupEncryptedResponseSerie0 struct {
- Encrypted []string `json:"ENCRYPTED,required"`
- NotEncrypted []string `json:"NOT_ENCRYPTED,required"`
- JSON radarEmailRoutingTimeseriesGroupEncryptedResponseSerie0JSON `json:"-"`
-}
-
-// radarEmailRoutingTimeseriesGroupEncryptedResponseSerie0JSON contains the JSON
-// metadata for the struct
-// [RadarEmailRoutingTimeseriesGroupEncryptedResponseSerie0]
-type radarEmailRoutingTimeseriesGroupEncryptedResponseSerie0JSON struct {
- Encrypted apijson.Field
- NotEncrypted apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailRoutingTimeseriesGroupEncryptedResponseSerie0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailRoutingTimeseriesGroupEncryptedResponseSerie0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailRoutingTimeseriesGroupIPVersionResponse struct {
- Meta interface{} `json:"meta,required"`
- Serie0 RadarEmailRoutingTimeseriesGroupIPVersionResponseSerie0 `json:"serie_0,required"`
- JSON radarEmailRoutingTimeseriesGroupIPVersionResponseJSON `json:"-"`
-}
-
-// radarEmailRoutingTimeseriesGroupIPVersionResponseJSON contains the JSON metadata
-// for the struct [RadarEmailRoutingTimeseriesGroupIPVersionResponse]
-type radarEmailRoutingTimeseriesGroupIPVersionResponseJSON struct {
- Meta apijson.Field
- Serie0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailRoutingTimeseriesGroupIPVersionResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailRoutingTimeseriesGroupIPVersionResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailRoutingTimeseriesGroupIPVersionResponseSerie0 struct {
- IPv4 []string `json:"IPv4,required"`
- IPv6 []string `json:"IPv6,required"`
- JSON radarEmailRoutingTimeseriesGroupIPVersionResponseSerie0JSON `json:"-"`
-}
-
-// radarEmailRoutingTimeseriesGroupIPVersionResponseSerie0JSON contains the JSON
-// metadata for the struct
-// [RadarEmailRoutingTimeseriesGroupIPVersionResponseSerie0]
-type radarEmailRoutingTimeseriesGroupIPVersionResponseSerie0JSON struct {
- IPv4 apijson.Field
- IPv6 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailRoutingTimeseriesGroupIPVersionResponseSerie0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailRoutingTimeseriesGroupIPVersionResponseSerie0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailRoutingTimeseriesGroupSPFResponse struct {
- Meta interface{} `json:"meta,required"`
- Serie0 RadarEmailRoutingTimeseriesGroupSPFResponseSerie0 `json:"serie_0,required"`
- JSON radarEmailRoutingTimeseriesGroupSPFResponseJSON `json:"-"`
-}
-
-// radarEmailRoutingTimeseriesGroupSPFResponseJSON contains the JSON metadata for
-// the struct [RadarEmailRoutingTimeseriesGroupSPFResponse]
-type radarEmailRoutingTimeseriesGroupSPFResponseJSON struct {
- Meta apijson.Field
- Serie0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailRoutingTimeseriesGroupSPFResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailRoutingTimeseriesGroupSPFResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailRoutingTimeseriesGroupSPFResponseSerie0 struct {
- Fail []string `json:"FAIL,required"`
- None []string `json:"NONE,required"`
- Pass []string `json:"PASS,required"`
- JSON radarEmailRoutingTimeseriesGroupSPFResponseSerie0JSON `json:"-"`
-}
-
-// radarEmailRoutingTimeseriesGroupSPFResponseSerie0JSON contains the JSON metadata
-// for the struct [RadarEmailRoutingTimeseriesGroupSPFResponseSerie0]
-type radarEmailRoutingTimeseriesGroupSPFResponseSerie0JSON struct {
- Fail apijson.Field
- None apijson.Field
- Pass apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailRoutingTimeseriesGroupSPFResponseSerie0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailRoutingTimeseriesGroupSPFResponseSerie0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailRoutingTimeseriesGroupARCParams struct {
- // Aggregation interval results should be returned in (for example, in 15 minutes
- // or 1 hour intervals). Refer to
- // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
- AggInterval param.Field[RadarEmailRoutingTimeseriesGroupARCParamsAggInterval] `query:"aggInterval"`
- // 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[[]RadarEmailRoutingTimeseriesGroupARCParamsDateRange] `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[[]RadarEmailRoutingTimeseriesGroupARCParamsDKIM] `query:"dkim"`
- // Filter for dmarc.
- DMARC param.Field[[]RadarEmailRoutingTimeseriesGroupARCParamsDMARC] `query:"dmarc"`
- // Filter for encrypted emails.
- Encrypted param.Field[[]RadarEmailRoutingTimeseriesGroupARCParamsEncrypted] `query:"encrypted"`
- // Format results are returned in.
- Format param.Field[RadarEmailRoutingTimeseriesGroupARCParamsFormat] `query:"format"`
- // Filter for ip version.
- IPVersion param.Field[[]RadarEmailRoutingTimeseriesGroupARCParamsIPVersion] `query:"ipVersion"`
- // 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[[]RadarEmailRoutingTimeseriesGroupARCParamsSPF] `query:"spf"`
-}
-
-// URLQuery serializes [RadarEmailRoutingTimeseriesGroupARCParams]'s query
-// parameters as `url.Values`.
-func (r RadarEmailRoutingTimeseriesGroupARCParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Aggregation interval results should be returned in (for example, in 15 minutes
-// or 1 hour intervals). Refer to
-// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
-type RadarEmailRoutingTimeseriesGroupARCParamsAggInterval string
-
-const (
- RadarEmailRoutingTimeseriesGroupARCParamsAggInterval15m RadarEmailRoutingTimeseriesGroupARCParamsAggInterval = "15m"
- RadarEmailRoutingTimeseriesGroupARCParamsAggInterval1h RadarEmailRoutingTimeseriesGroupARCParamsAggInterval = "1h"
- RadarEmailRoutingTimeseriesGroupARCParamsAggInterval1d RadarEmailRoutingTimeseriesGroupARCParamsAggInterval = "1d"
- RadarEmailRoutingTimeseriesGroupARCParamsAggInterval1w RadarEmailRoutingTimeseriesGroupARCParamsAggInterval = "1w"
-)
-
-type RadarEmailRoutingTimeseriesGroupARCParamsDateRange string
-
-const (
- RadarEmailRoutingTimeseriesGroupARCParamsDateRange1d RadarEmailRoutingTimeseriesGroupARCParamsDateRange = "1d"
- RadarEmailRoutingTimeseriesGroupARCParamsDateRange2d RadarEmailRoutingTimeseriesGroupARCParamsDateRange = "2d"
- RadarEmailRoutingTimeseriesGroupARCParamsDateRange7d RadarEmailRoutingTimeseriesGroupARCParamsDateRange = "7d"
- RadarEmailRoutingTimeseriesGroupARCParamsDateRange14d RadarEmailRoutingTimeseriesGroupARCParamsDateRange = "14d"
- RadarEmailRoutingTimeseriesGroupARCParamsDateRange28d RadarEmailRoutingTimeseriesGroupARCParamsDateRange = "28d"
- RadarEmailRoutingTimeseriesGroupARCParamsDateRange12w RadarEmailRoutingTimeseriesGroupARCParamsDateRange = "12w"
- RadarEmailRoutingTimeseriesGroupARCParamsDateRange24w RadarEmailRoutingTimeseriesGroupARCParamsDateRange = "24w"
- RadarEmailRoutingTimeseriesGroupARCParamsDateRange52w RadarEmailRoutingTimeseriesGroupARCParamsDateRange = "52w"
- RadarEmailRoutingTimeseriesGroupARCParamsDateRange1dControl RadarEmailRoutingTimeseriesGroupARCParamsDateRange = "1dControl"
- RadarEmailRoutingTimeseriesGroupARCParamsDateRange2dControl RadarEmailRoutingTimeseriesGroupARCParamsDateRange = "2dControl"
- RadarEmailRoutingTimeseriesGroupARCParamsDateRange7dControl RadarEmailRoutingTimeseriesGroupARCParamsDateRange = "7dControl"
- RadarEmailRoutingTimeseriesGroupARCParamsDateRange14dControl RadarEmailRoutingTimeseriesGroupARCParamsDateRange = "14dControl"
- RadarEmailRoutingTimeseriesGroupARCParamsDateRange28dControl RadarEmailRoutingTimeseriesGroupARCParamsDateRange = "28dControl"
- RadarEmailRoutingTimeseriesGroupARCParamsDateRange12wControl RadarEmailRoutingTimeseriesGroupARCParamsDateRange = "12wControl"
- RadarEmailRoutingTimeseriesGroupARCParamsDateRange24wControl RadarEmailRoutingTimeseriesGroupARCParamsDateRange = "24wControl"
-)
-
-type RadarEmailRoutingTimeseriesGroupARCParamsDKIM string
-
-const (
- RadarEmailRoutingTimeseriesGroupARCParamsDKIMPass RadarEmailRoutingTimeseriesGroupARCParamsDKIM = "PASS"
- RadarEmailRoutingTimeseriesGroupARCParamsDKIMNone RadarEmailRoutingTimeseriesGroupARCParamsDKIM = "NONE"
- RadarEmailRoutingTimeseriesGroupARCParamsDKIMFail RadarEmailRoutingTimeseriesGroupARCParamsDKIM = "FAIL"
-)
-
-type RadarEmailRoutingTimeseriesGroupARCParamsDMARC string
-
-const (
- RadarEmailRoutingTimeseriesGroupARCParamsDMARCPass RadarEmailRoutingTimeseriesGroupARCParamsDMARC = "PASS"
- RadarEmailRoutingTimeseriesGroupARCParamsDMARCNone RadarEmailRoutingTimeseriesGroupARCParamsDMARC = "NONE"
- RadarEmailRoutingTimeseriesGroupARCParamsDMARCFail RadarEmailRoutingTimeseriesGroupARCParamsDMARC = "FAIL"
-)
-
-type RadarEmailRoutingTimeseriesGroupARCParamsEncrypted string
-
-const (
- RadarEmailRoutingTimeseriesGroupARCParamsEncryptedEncrypted RadarEmailRoutingTimeseriesGroupARCParamsEncrypted = "ENCRYPTED"
- RadarEmailRoutingTimeseriesGroupARCParamsEncryptedNotEncrypted RadarEmailRoutingTimeseriesGroupARCParamsEncrypted = "NOT_ENCRYPTED"
-)
-
-// Format results are returned in.
-type RadarEmailRoutingTimeseriesGroupARCParamsFormat string
-
-const (
- RadarEmailRoutingTimeseriesGroupARCParamsFormatJson RadarEmailRoutingTimeseriesGroupARCParamsFormat = "JSON"
- RadarEmailRoutingTimeseriesGroupARCParamsFormatCsv RadarEmailRoutingTimeseriesGroupARCParamsFormat = "CSV"
-)
-
-type RadarEmailRoutingTimeseriesGroupARCParamsIPVersion string
-
-const (
- RadarEmailRoutingTimeseriesGroupARCParamsIPVersionIPv4 RadarEmailRoutingTimeseriesGroupARCParamsIPVersion = "IPv4"
- RadarEmailRoutingTimeseriesGroupARCParamsIPVersionIPv6 RadarEmailRoutingTimeseriesGroupARCParamsIPVersion = "IPv6"
-)
-
-type RadarEmailRoutingTimeseriesGroupARCParamsSPF string
-
-const (
- RadarEmailRoutingTimeseriesGroupARCParamsSPFPass RadarEmailRoutingTimeseriesGroupARCParamsSPF = "PASS"
- RadarEmailRoutingTimeseriesGroupARCParamsSPFNone RadarEmailRoutingTimeseriesGroupARCParamsSPF = "NONE"
- RadarEmailRoutingTimeseriesGroupARCParamsSPFFail RadarEmailRoutingTimeseriesGroupARCParamsSPF = "FAIL"
-)
-
-type RadarEmailRoutingTimeseriesGroupARCResponseEnvelope struct {
- Result RadarEmailRoutingTimeseriesGroupARCResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarEmailRoutingTimeseriesGroupARCResponseEnvelopeJSON `json:"-"`
-}
-
-// radarEmailRoutingTimeseriesGroupARCResponseEnvelopeJSON contains the JSON
-// metadata for the struct [RadarEmailRoutingTimeseriesGroupARCResponseEnvelope]
-type radarEmailRoutingTimeseriesGroupARCResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailRoutingTimeseriesGroupARCResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailRoutingTimeseriesGroupARCResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailRoutingTimeseriesGroupDKIMParams struct {
- // Aggregation interval results should be returned in (for example, in 15 minutes
- // or 1 hour intervals). Refer to
- // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
- AggInterval param.Field[RadarEmailRoutingTimeseriesGroupDKIMParamsAggInterval] `query:"aggInterval"`
- // Filter for arc (Authenticated Received Chain).
- ARC param.Field[[]RadarEmailRoutingTimeseriesGroupDKIMParamsARC] `query:"arc"`
- // 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[[]RadarEmailRoutingTimeseriesGroupDKIMParamsDateRange] `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[[]RadarEmailRoutingTimeseriesGroupDKIMParamsDMARC] `query:"dmarc"`
- // Filter for encrypted emails.
- Encrypted param.Field[[]RadarEmailRoutingTimeseriesGroupDKIMParamsEncrypted] `query:"encrypted"`
- // Format results are returned in.
- Format param.Field[RadarEmailRoutingTimeseriesGroupDKIMParamsFormat] `query:"format"`
- // Filter for ip version.
- IPVersion param.Field[[]RadarEmailRoutingTimeseriesGroupDKIMParamsIPVersion] `query:"ipVersion"`
- // 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[[]RadarEmailRoutingTimeseriesGroupDKIMParamsSPF] `query:"spf"`
-}
-
-// URLQuery serializes [RadarEmailRoutingTimeseriesGroupDKIMParams]'s query
-// parameters as `url.Values`.
-func (r RadarEmailRoutingTimeseriesGroupDKIMParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Aggregation interval results should be returned in (for example, in 15 minutes
-// or 1 hour intervals). Refer to
-// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
-type RadarEmailRoutingTimeseriesGroupDKIMParamsAggInterval string
-
-const (
- RadarEmailRoutingTimeseriesGroupDKIMParamsAggInterval15m RadarEmailRoutingTimeseriesGroupDKIMParamsAggInterval = "15m"
- RadarEmailRoutingTimeseriesGroupDKIMParamsAggInterval1h RadarEmailRoutingTimeseriesGroupDKIMParamsAggInterval = "1h"
- RadarEmailRoutingTimeseriesGroupDKIMParamsAggInterval1d RadarEmailRoutingTimeseriesGroupDKIMParamsAggInterval = "1d"
- RadarEmailRoutingTimeseriesGroupDKIMParamsAggInterval1w RadarEmailRoutingTimeseriesGroupDKIMParamsAggInterval = "1w"
-)
-
-type RadarEmailRoutingTimeseriesGroupDKIMParamsARC string
-
-const (
- RadarEmailRoutingTimeseriesGroupDKIMParamsARCPass RadarEmailRoutingTimeseriesGroupDKIMParamsARC = "PASS"
- RadarEmailRoutingTimeseriesGroupDKIMParamsARCNone RadarEmailRoutingTimeseriesGroupDKIMParamsARC = "NONE"
- RadarEmailRoutingTimeseriesGroupDKIMParamsARCFail RadarEmailRoutingTimeseriesGroupDKIMParamsARC = "FAIL"
-)
-
-type RadarEmailRoutingTimeseriesGroupDKIMParamsDateRange string
-
-const (
- RadarEmailRoutingTimeseriesGroupDKIMParamsDateRange1d RadarEmailRoutingTimeseriesGroupDKIMParamsDateRange = "1d"
- RadarEmailRoutingTimeseriesGroupDKIMParamsDateRange2d RadarEmailRoutingTimeseriesGroupDKIMParamsDateRange = "2d"
- RadarEmailRoutingTimeseriesGroupDKIMParamsDateRange7d RadarEmailRoutingTimeseriesGroupDKIMParamsDateRange = "7d"
- RadarEmailRoutingTimeseriesGroupDKIMParamsDateRange14d RadarEmailRoutingTimeseriesGroupDKIMParamsDateRange = "14d"
- RadarEmailRoutingTimeseriesGroupDKIMParamsDateRange28d RadarEmailRoutingTimeseriesGroupDKIMParamsDateRange = "28d"
- RadarEmailRoutingTimeseriesGroupDKIMParamsDateRange12w RadarEmailRoutingTimeseriesGroupDKIMParamsDateRange = "12w"
- RadarEmailRoutingTimeseriesGroupDKIMParamsDateRange24w RadarEmailRoutingTimeseriesGroupDKIMParamsDateRange = "24w"
- RadarEmailRoutingTimeseriesGroupDKIMParamsDateRange52w RadarEmailRoutingTimeseriesGroupDKIMParamsDateRange = "52w"
- RadarEmailRoutingTimeseriesGroupDKIMParamsDateRange1dControl RadarEmailRoutingTimeseriesGroupDKIMParamsDateRange = "1dControl"
- RadarEmailRoutingTimeseriesGroupDKIMParamsDateRange2dControl RadarEmailRoutingTimeseriesGroupDKIMParamsDateRange = "2dControl"
- RadarEmailRoutingTimeseriesGroupDKIMParamsDateRange7dControl RadarEmailRoutingTimeseriesGroupDKIMParamsDateRange = "7dControl"
- RadarEmailRoutingTimeseriesGroupDKIMParamsDateRange14dControl RadarEmailRoutingTimeseriesGroupDKIMParamsDateRange = "14dControl"
- RadarEmailRoutingTimeseriesGroupDKIMParamsDateRange28dControl RadarEmailRoutingTimeseriesGroupDKIMParamsDateRange = "28dControl"
- RadarEmailRoutingTimeseriesGroupDKIMParamsDateRange12wControl RadarEmailRoutingTimeseriesGroupDKIMParamsDateRange = "12wControl"
- RadarEmailRoutingTimeseriesGroupDKIMParamsDateRange24wControl RadarEmailRoutingTimeseriesGroupDKIMParamsDateRange = "24wControl"
-)
-
-type RadarEmailRoutingTimeseriesGroupDKIMParamsDMARC string
-
-const (
- RadarEmailRoutingTimeseriesGroupDKIMParamsDMARCPass RadarEmailRoutingTimeseriesGroupDKIMParamsDMARC = "PASS"
- RadarEmailRoutingTimeseriesGroupDKIMParamsDMARCNone RadarEmailRoutingTimeseriesGroupDKIMParamsDMARC = "NONE"
- RadarEmailRoutingTimeseriesGroupDKIMParamsDMARCFail RadarEmailRoutingTimeseriesGroupDKIMParamsDMARC = "FAIL"
-)
-
-type RadarEmailRoutingTimeseriesGroupDKIMParamsEncrypted string
-
-const (
- RadarEmailRoutingTimeseriesGroupDKIMParamsEncryptedEncrypted RadarEmailRoutingTimeseriesGroupDKIMParamsEncrypted = "ENCRYPTED"
- RadarEmailRoutingTimeseriesGroupDKIMParamsEncryptedNotEncrypted RadarEmailRoutingTimeseriesGroupDKIMParamsEncrypted = "NOT_ENCRYPTED"
-)
-
-// Format results are returned in.
-type RadarEmailRoutingTimeseriesGroupDKIMParamsFormat string
-
-const (
- RadarEmailRoutingTimeseriesGroupDKIMParamsFormatJson RadarEmailRoutingTimeseriesGroupDKIMParamsFormat = "JSON"
- RadarEmailRoutingTimeseriesGroupDKIMParamsFormatCsv RadarEmailRoutingTimeseriesGroupDKIMParamsFormat = "CSV"
-)
-
-type RadarEmailRoutingTimeseriesGroupDKIMParamsIPVersion string
-
-const (
- RadarEmailRoutingTimeseriesGroupDKIMParamsIPVersionIPv4 RadarEmailRoutingTimeseriesGroupDKIMParamsIPVersion = "IPv4"
- RadarEmailRoutingTimeseriesGroupDKIMParamsIPVersionIPv6 RadarEmailRoutingTimeseriesGroupDKIMParamsIPVersion = "IPv6"
-)
-
-type RadarEmailRoutingTimeseriesGroupDKIMParamsSPF string
-
-const (
- RadarEmailRoutingTimeseriesGroupDKIMParamsSPFPass RadarEmailRoutingTimeseriesGroupDKIMParamsSPF = "PASS"
- RadarEmailRoutingTimeseriesGroupDKIMParamsSPFNone RadarEmailRoutingTimeseriesGroupDKIMParamsSPF = "NONE"
- RadarEmailRoutingTimeseriesGroupDKIMParamsSPFFail RadarEmailRoutingTimeseriesGroupDKIMParamsSPF = "FAIL"
-)
-
-type RadarEmailRoutingTimeseriesGroupDKIMResponseEnvelope struct {
- Result RadarEmailRoutingTimeseriesGroupDKIMResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarEmailRoutingTimeseriesGroupDKIMResponseEnvelopeJSON `json:"-"`
-}
-
-// radarEmailRoutingTimeseriesGroupDKIMResponseEnvelopeJSON contains the JSON
-// metadata for the struct [RadarEmailRoutingTimeseriesGroupDKIMResponseEnvelope]
-type radarEmailRoutingTimeseriesGroupDKIMResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailRoutingTimeseriesGroupDKIMResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailRoutingTimeseriesGroupDKIMResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailRoutingTimeseriesGroupDMARCParams struct {
- // Aggregation interval results should be returned in (for example, in 15 minutes
- // or 1 hour intervals). Refer to
- // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
- AggInterval param.Field[RadarEmailRoutingTimeseriesGroupDMARCParamsAggInterval] `query:"aggInterval"`
- // Filter for arc (Authenticated Received Chain).
- ARC param.Field[[]RadarEmailRoutingTimeseriesGroupDMARCParamsARC] `query:"arc"`
- // 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[[]RadarEmailRoutingTimeseriesGroupDMARCParamsDateRange] `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[[]RadarEmailRoutingTimeseriesGroupDMARCParamsDKIM] `query:"dkim"`
- // Filter for encrypted emails.
- Encrypted param.Field[[]RadarEmailRoutingTimeseriesGroupDMARCParamsEncrypted] `query:"encrypted"`
- // Format results are returned in.
- Format param.Field[RadarEmailRoutingTimeseriesGroupDMARCParamsFormat] `query:"format"`
- // Filter for ip version.
- IPVersion param.Field[[]RadarEmailRoutingTimeseriesGroupDMARCParamsIPVersion] `query:"ipVersion"`
- // 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[[]RadarEmailRoutingTimeseriesGroupDMARCParamsSPF] `query:"spf"`
-}
-
-// URLQuery serializes [RadarEmailRoutingTimeseriesGroupDMARCParams]'s query
-// parameters as `url.Values`.
-func (r RadarEmailRoutingTimeseriesGroupDMARCParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Aggregation interval results should be returned in (for example, in 15 minutes
-// or 1 hour intervals). Refer to
-// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
-type RadarEmailRoutingTimeseriesGroupDMARCParamsAggInterval string
-
-const (
- RadarEmailRoutingTimeseriesGroupDMARCParamsAggInterval15m RadarEmailRoutingTimeseriesGroupDMARCParamsAggInterval = "15m"
- RadarEmailRoutingTimeseriesGroupDMARCParamsAggInterval1h RadarEmailRoutingTimeseriesGroupDMARCParamsAggInterval = "1h"
- RadarEmailRoutingTimeseriesGroupDMARCParamsAggInterval1d RadarEmailRoutingTimeseriesGroupDMARCParamsAggInterval = "1d"
- RadarEmailRoutingTimeseriesGroupDMARCParamsAggInterval1w RadarEmailRoutingTimeseriesGroupDMARCParamsAggInterval = "1w"
-)
-
-type RadarEmailRoutingTimeseriesGroupDMARCParamsARC string
-
-const (
- RadarEmailRoutingTimeseriesGroupDMARCParamsARCPass RadarEmailRoutingTimeseriesGroupDMARCParamsARC = "PASS"
- RadarEmailRoutingTimeseriesGroupDMARCParamsARCNone RadarEmailRoutingTimeseriesGroupDMARCParamsARC = "NONE"
- RadarEmailRoutingTimeseriesGroupDMARCParamsARCFail RadarEmailRoutingTimeseriesGroupDMARCParamsARC = "FAIL"
-)
-
-type RadarEmailRoutingTimeseriesGroupDMARCParamsDateRange string
-
-const (
- RadarEmailRoutingTimeseriesGroupDMARCParamsDateRange1d RadarEmailRoutingTimeseriesGroupDMARCParamsDateRange = "1d"
- RadarEmailRoutingTimeseriesGroupDMARCParamsDateRange2d RadarEmailRoutingTimeseriesGroupDMARCParamsDateRange = "2d"
- RadarEmailRoutingTimeseriesGroupDMARCParamsDateRange7d RadarEmailRoutingTimeseriesGroupDMARCParamsDateRange = "7d"
- RadarEmailRoutingTimeseriesGroupDMARCParamsDateRange14d RadarEmailRoutingTimeseriesGroupDMARCParamsDateRange = "14d"
- RadarEmailRoutingTimeseriesGroupDMARCParamsDateRange28d RadarEmailRoutingTimeseriesGroupDMARCParamsDateRange = "28d"
- RadarEmailRoutingTimeseriesGroupDMARCParamsDateRange12w RadarEmailRoutingTimeseriesGroupDMARCParamsDateRange = "12w"
- RadarEmailRoutingTimeseriesGroupDMARCParamsDateRange24w RadarEmailRoutingTimeseriesGroupDMARCParamsDateRange = "24w"
- RadarEmailRoutingTimeseriesGroupDMARCParamsDateRange52w RadarEmailRoutingTimeseriesGroupDMARCParamsDateRange = "52w"
- RadarEmailRoutingTimeseriesGroupDMARCParamsDateRange1dControl RadarEmailRoutingTimeseriesGroupDMARCParamsDateRange = "1dControl"
- RadarEmailRoutingTimeseriesGroupDMARCParamsDateRange2dControl RadarEmailRoutingTimeseriesGroupDMARCParamsDateRange = "2dControl"
- RadarEmailRoutingTimeseriesGroupDMARCParamsDateRange7dControl RadarEmailRoutingTimeseriesGroupDMARCParamsDateRange = "7dControl"
- RadarEmailRoutingTimeseriesGroupDMARCParamsDateRange14dControl RadarEmailRoutingTimeseriesGroupDMARCParamsDateRange = "14dControl"
- RadarEmailRoutingTimeseriesGroupDMARCParamsDateRange28dControl RadarEmailRoutingTimeseriesGroupDMARCParamsDateRange = "28dControl"
- RadarEmailRoutingTimeseriesGroupDMARCParamsDateRange12wControl RadarEmailRoutingTimeseriesGroupDMARCParamsDateRange = "12wControl"
- RadarEmailRoutingTimeseriesGroupDMARCParamsDateRange24wControl RadarEmailRoutingTimeseriesGroupDMARCParamsDateRange = "24wControl"
-)
-
-type RadarEmailRoutingTimeseriesGroupDMARCParamsDKIM string
-
-const (
- RadarEmailRoutingTimeseriesGroupDMARCParamsDKIMPass RadarEmailRoutingTimeseriesGroupDMARCParamsDKIM = "PASS"
- RadarEmailRoutingTimeseriesGroupDMARCParamsDKIMNone RadarEmailRoutingTimeseriesGroupDMARCParamsDKIM = "NONE"
- RadarEmailRoutingTimeseriesGroupDMARCParamsDKIMFail RadarEmailRoutingTimeseriesGroupDMARCParamsDKIM = "FAIL"
-)
-
-type RadarEmailRoutingTimeseriesGroupDMARCParamsEncrypted string
-
-const (
- RadarEmailRoutingTimeseriesGroupDMARCParamsEncryptedEncrypted RadarEmailRoutingTimeseriesGroupDMARCParamsEncrypted = "ENCRYPTED"
- RadarEmailRoutingTimeseriesGroupDMARCParamsEncryptedNotEncrypted RadarEmailRoutingTimeseriesGroupDMARCParamsEncrypted = "NOT_ENCRYPTED"
-)
-
-// Format results are returned in.
-type RadarEmailRoutingTimeseriesGroupDMARCParamsFormat string
-
-const (
- RadarEmailRoutingTimeseriesGroupDMARCParamsFormatJson RadarEmailRoutingTimeseriesGroupDMARCParamsFormat = "JSON"
- RadarEmailRoutingTimeseriesGroupDMARCParamsFormatCsv RadarEmailRoutingTimeseriesGroupDMARCParamsFormat = "CSV"
-)
-
-type RadarEmailRoutingTimeseriesGroupDMARCParamsIPVersion string
-
-const (
- RadarEmailRoutingTimeseriesGroupDMARCParamsIPVersionIPv4 RadarEmailRoutingTimeseriesGroupDMARCParamsIPVersion = "IPv4"
- RadarEmailRoutingTimeseriesGroupDMARCParamsIPVersionIPv6 RadarEmailRoutingTimeseriesGroupDMARCParamsIPVersion = "IPv6"
-)
-
-type RadarEmailRoutingTimeseriesGroupDMARCParamsSPF string
-
-const (
- RadarEmailRoutingTimeseriesGroupDMARCParamsSPFPass RadarEmailRoutingTimeseriesGroupDMARCParamsSPF = "PASS"
- RadarEmailRoutingTimeseriesGroupDMARCParamsSPFNone RadarEmailRoutingTimeseriesGroupDMARCParamsSPF = "NONE"
- RadarEmailRoutingTimeseriesGroupDMARCParamsSPFFail RadarEmailRoutingTimeseriesGroupDMARCParamsSPF = "FAIL"
-)
-
-type RadarEmailRoutingTimeseriesGroupDMARCResponseEnvelope struct {
- Result RadarEmailRoutingTimeseriesGroupDMARCResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarEmailRoutingTimeseriesGroupDMARCResponseEnvelopeJSON `json:"-"`
-}
-
-// radarEmailRoutingTimeseriesGroupDMARCResponseEnvelopeJSON contains the JSON
-// metadata for the struct [RadarEmailRoutingTimeseriesGroupDMARCResponseEnvelope]
-type radarEmailRoutingTimeseriesGroupDMARCResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailRoutingTimeseriesGroupDMARCResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailRoutingTimeseriesGroupDMARCResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailRoutingTimeseriesGroupEncryptedParams struct {
- // Aggregation interval results should be returned in (for example, in 15 minutes
- // or 1 hour intervals). Refer to
- // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
- AggInterval param.Field[RadarEmailRoutingTimeseriesGroupEncryptedParamsAggInterval] `query:"aggInterval"`
- // Filter for arc (Authenticated Received Chain).
- ARC param.Field[[]RadarEmailRoutingTimeseriesGroupEncryptedParamsARC] `query:"arc"`
- // 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[[]RadarEmailRoutingTimeseriesGroupEncryptedParamsDateRange] `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[[]RadarEmailRoutingTimeseriesGroupEncryptedParamsDKIM] `query:"dkim"`
- // Filter for dmarc.
- DMARC param.Field[[]RadarEmailRoutingTimeseriesGroupEncryptedParamsDMARC] `query:"dmarc"`
- // Format results are returned in.
- Format param.Field[RadarEmailRoutingTimeseriesGroupEncryptedParamsFormat] `query:"format"`
- // Filter for ip version.
- IPVersion param.Field[[]RadarEmailRoutingTimeseriesGroupEncryptedParamsIPVersion] `query:"ipVersion"`
- // 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[[]RadarEmailRoutingTimeseriesGroupEncryptedParamsSPF] `query:"spf"`
-}
-
-// URLQuery serializes [RadarEmailRoutingTimeseriesGroupEncryptedParams]'s query
-// parameters as `url.Values`.
-func (r RadarEmailRoutingTimeseriesGroupEncryptedParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Aggregation interval results should be returned in (for example, in 15 minutes
-// or 1 hour intervals). Refer to
-// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
-type RadarEmailRoutingTimeseriesGroupEncryptedParamsAggInterval string
-
-const (
- RadarEmailRoutingTimeseriesGroupEncryptedParamsAggInterval15m RadarEmailRoutingTimeseriesGroupEncryptedParamsAggInterval = "15m"
- RadarEmailRoutingTimeseriesGroupEncryptedParamsAggInterval1h RadarEmailRoutingTimeseriesGroupEncryptedParamsAggInterval = "1h"
- RadarEmailRoutingTimeseriesGroupEncryptedParamsAggInterval1d RadarEmailRoutingTimeseriesGroupEncryptedParamsAggInterval = "1d"
- RadarEmailRoutingTimeseriesGroupEncryptedParamsAggInterval1w RadarEmailRoutingTimeseriesGroupEncryptedParamsAggInterval = "1w"
-)
-
-type RadarEmailRoutingTimeseriesGroupEncryptedParamsARC string
-
-const (
- RadarEmailRoutingTimeseriesGroupEncryptedParamsARCPass RadarEmailRoutingTimeseriesGroupEncryptedParamsARC = "PASS"
- RadarEmailRoutingTimeseriesGroupEncryptedParamsARCNone RadarEmailRoutingTimeseriesGroupEncryptedParamsARC = "NONE"
- RadarEmailRoutingTimeseriesGroupEncryptedParamsARCFail RadarEmailRoutingTimeseriesGroupEncryptedParamsARC = "FAIL"
-)
-
-type RadarEmailRoutingTimeseriesGroupEncryptedParamsDateRange string
-
-const (
- RadarEmailRoutingTimeseriesGroupEncryptedParamsDateRange1d RadarEmailRoutingTimeseriesGroupEncryptedParamsDateRange = "1d"
- RadarEmailRoutingTimeseriesGroupEncryptedParamsDateRange2d RadarEmailRoutingTimeseriesGroupEncryptedParamsDateRange = "2d"
- RadarEmailRoutingTimeseriesGroupEncryptedParamsDateRange7d RadarEmailRoutingTimeseriesGroupEncryptedParamsDateRange = "7d"
- RadarEmailRoutingTimeseriesGroupEncryptedParamsDateRange14d RadarEmailRoutingTimeseriesGroupEncryptedParamsDateRange = "14d"
- RadarEmailRoutingTimeseriesGroupEncryptedParamsDateRange28d RadarEmailRoutingTimeseriesGroupEncryptedParamsDateRange = "28d"
- RadarEmailRoutingTimeseriesGroupEncryptedParamsDateRange12w RadarEmailRoutingTimeseriesGroupEncryptedParamsDateRange = "12w"
- RadarEmailRoutingTimeseriesGroupEncryptedParamsDateRange24w RadarEmailRoutingTimeseriesGroupEncryptedParamsDateRange = "24w"
- RadarEmailRoutingTimeseriesGroupEncryptedParamsDateRange52w RadarEmailRoutingTimeseriesGroupEncryptedParamsDateRange = "52w"
- RadarEmailRoutingTimeseriesGroupEncryptedParamsDateRange1dControl RadarEmailRoutingTimeseriesGroupEncryptedParamsDateRange = "1dControl"
- RadarEmailRoutingTimeseriesGroupEncryptedParamsDateRange2dControl RadarEmailRoutingTimeseriesGroupEncryptedParamsDateRange = "2dControl"
- RadarEmailRoutingTimeseriesGroupEncryptedParamsDateRange7dControl RadarEmailRoutingTimeseriesGroupEncryptedParamsDateRange = "7dControl"
- RadarEmailRoutingTimeseriesGroupEncryptedParamsDateRange14dControl RadarEmailRoutingTimeseriesGroupEncryptedParamsDateRange = "14dControl"
- RadarEmailRoutingTimeseriesGroupEncryptedParamsDateRange28dControl RadarEmailRoutingTimeseriesGroupEncryptedParamsDateRange = "28dControl"
- RadarEmailRoutingTimeseriesGroupEncryptedParamsDateRange12wControl RadarEmailRoutingTimeseriesGroupEncryptedParamsDateRange = "12wControl"
- RadarEmailRoutingTimeseriesGroupEncryptedParamsDateRange24wControl RadarEmailRoutingTimeseriesGroupEncryptedParamsDateRange = "24wControl"
-)
-
-type RadarEmailRoutingTimeseriesGroupEncryptedParamsDKIM string
-
-const (
- RadarEmailRoutingTimeseriesGroupEncryptedParamsDKIMPass RadarEmailRoutingTimeseriesGroupEncryptedParamsDKIM = "PASS"
- RadarEmailRoutingTimeseriesGroupEncryptedParamsDKIMNone RadarEmailRoutingTimeseriesGroupEncryptedParamsDKIM = "NONE"
- RadarEmailRoutingTimeseriesGroupEncryptedParamsDKIMFail RadarEmailRoutingTimeseriesGroupEncryptedParamsDKIM = "FAIL"
-)
-
-type RadarEmailRoutingTimeseriesGroupEncryptedParamsDMARC string
-
-const (
- RadarEmailRoutingTimeseriesGroupEncryptedParamsDMARCPass RadarEmailRoutingTimeseriesGroupEncryptedParamsDMARC = "PASS"
- RadarEmailRoutingTimeseriesGroupEncryptedParamsDMARCNone RadarEmailRoutingTimeseriesGroupEncryptedParamsDMARC = "NONE"
- RadarEmailRoutingTimeseriesGroupEncryptedParamsDMARCFail RadarEmailRoutingTimeseriesGroupEncryptedParamsDMARC = "FAIL"
-)
-
-// Format results are returned in.
-type RadarEmailRoutingTimeseriesGroupEncryptedParamsFormat string
-
-const (
- RadarEmailRoutingTimeseriesGroupEncryptedParamsFormatJson RadarEmailRoutingTimeseriesGroupEncryptedParamsFormat = "JSON"
- RadarEmailRoutingTimeseriesGroupEncryptedParamsFormatCsv RadarEmailRoutingTimeseriesGroupEncryptedParamsFormat = "CSV"
-)
-
-type RadarEmailRoutingTimeseriesGroupEncryptedParamsIPVersion string
-
-const (
- RadarEmailRoutingTimeseriesGroupEncryptedParamsIPVersionIPv4 RadarEmailRoutingTimeseriesGroupEncryptedParamsIPVersion = "IPv4"
- RadarEmailRoutingTimeseriesGroupEncryptedParamsIPVersionIPv6 RadarEmailRoutingTimeseriesGroupEncryptedParamsIPVersion = "IPv6"
-)
-
-type RadarEmailRoutingTimeseriesGroupEncryptedParamsSPF string
-
-const (
- RadarEmailRoutingTimeseriesGroupEncryptedParamsSPFPass RadarEmailRoutingTimeseriesGroupEncryptedParamsSPF = "PASS"
- RadarEmailRoutingTimeseriesGroupEncryptedParamsSPFNone RadarEmailRoutingTimeseriesGroupEncryptedParamsSPF = "NONE"
- RadarEmailRoutingTimeseriesGroupEncryptedParamsSPFFail RadarEmailRoutingTimeseriesGroupEncryptedParamsSPF = "FAIL"
-)
-
-type RadarEmailRoutingTimeseriesGroupEncryptedResponseEnvelope struct {
- Result RadarEmailRoutingTimeseriesGroupEncryptedResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarEmailRoutingTimeseriesGroupEncryptedResponseEnvelopeJSON `json:"-"`
-}
-
-// radarEmailRoutingTimeseriesGroupEncryptedResponseEnvelopeJSON contains the JSON
-// metadata for the struct
-// [RadarEmailRoutingTimeseriesGroupEncryptedResponseEnvelope]
-type radarEmailRoutingTimeseriesGroupEncryptedResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailRoutingTimeseriesGroupEncryptedResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailRoutingTimeseriesGroupEncryptedResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailRoutingTimeseriesGroupIPVersionParams struct {
- // Aggregation interval results should be returned in (for example, in 15 minutes
- // or 1 hour intervals). Refer to
- // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
- AggInterval param.Field[RadarEmailRoutingTimeseriesGroupIPVersionParamsAggInterval] `query:"aggInterval"`
- // Filter for arc (Authenticated Received Chain).
- ARC param.Field[[]RadarEmailRoutingTimeseriesGroupIPVersionParamsARC] `query:"arc"`
- // 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[[]RadarEmailRoutingTimeseriesGroupIPVersionParamsDateRange] `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[[]RadarEmailRoutingTimeseriesGroupIPVersionParamsDKIM] `query:"dkim"`
- // Filter for dmarc.
- DMARC param.Field[[]RadarEmailRoutingTimeseriesGroupIPVersionParamsDMARC] `query:"dmarc"`
- // Filter for encrypted emails.
- Encrypted param.Field[[]RadarEmailRoutingTimeseriesGroupIPVersionParamsEncrypted] `query:"encrypted"`
- // Format results are returned in.
- Format param.Field[RadarEmailRoutingTimeseriesGroupIPVersionParamsFormat] `query:"format"`
- // 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[[]RadarEmailRoutingTimeseriesGroupIPVersionParamsSPF] `query:"spf"`
-}
-
-// URLQuery serializes [RadarEmailRoutingTimeseriesGroupIPVersionParams]'s query
-// parameters as `url.Values`.
-func (r RadarEmailRoutingTimeseriesGroupIPVersionParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Aggregation interval results should be returned in (for example, in 15 minutes
-// or 1 hour intervals). Refer to
-// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
-type RadarEmailRoutingTimeseriesGroupIPVersionParamsAggInterval string
-
-const (
- RadarEmailRoutingTimeseriesGroupIPVersionParamsAggInterval15m RadarEmailRoutingTimeseriesGroupIPVersionParamsAggInterval = "15m"
- RadarEmailRoutingTimeseriesGroupIPVersionParamsAggInterval1h RadarEmailRoutingTimeseriesGroupIPVersionParamsAggInterval = "1h"
- RadarEmailRoutingTimeseriesGroupIPVersionParamsAggInterval1d RadarEmailRoutingTimeseriesGroupIPVersionParamsAggInterval = "1d"
- RadarEmailRoutingTimeseriesGroupIPVersionParamsAggInterval1w RadarEmailRoutingTimeseriesGroupIPVersionParamsAggInterval = "1w"
-)
-
-type RadarEmailRoutingTimeseriesGroupIPVersionParamsARC string
-
-const (
- RadarEmailRoutingTimeseriesGroupIPVersionParamsARCPass RadarEmailRoutingTimeseriesGroupIPVersionParamsARC = "PASS"
- RadarEmailRoutingTimeseriesGroupIPVersionParamsARCNone RadarEmailRoutingTimeseriesGroupIPVersionParamsARC = "NONE"
- RadarEmailRoutingTimeseriesGroupIPVersionParamsARCFail RadarEmailRoutingTimeseriesGroupIPVersionParamsARC = "FAIL"
-)
-
-type RadarEmailRoutingTimeseriesGroupIPVersionParamsDateRange string
-
-const (
- RadarEmailRoutingTimeseriesGroupIPVersionParamsDateRange1d RadarEmailRoutingTimeseriesGroupIPVersionParamsDateRange = "1d"
- RadarEmailRoutingTimeseriesGroupIPVersionParamsDateRange2d RadarEmailRoutingTimeseriesGroupIPVersionParamsDateRange = "2d"
- RadarEmailRoutingTimeseriesGroupIPVersionParamsDateRange7d RadarEmailRoutingTimeseriesGroupIPVersionParamsDateRange = "7d"
- RadarEmailRoutingTimeseriesGroupIPVersionParamsDateRange14d RadarEmailRoutingTimeseriesGroupIPVersionParamsDateRange = "14d"
- RadarEmailRoutingTimeseriesGroupIPVersionParamsDateRange28d RadarEmailRoutingTimeseriesGroupIPVersionParamsDateRange = "28d"
- RadarEmailRoutingTimeseriesGroupIPVersionParamsDateRange12w RadarEmailRoutingTimeseriesGroupIPVersionParamsDateRange = "12w"
- RadarEmailRoutingTimeseriesGroupIPVersionParamsDateRange24w RadarEmailRoutingTimeseriesGroupIPVersionParamsDateRange = "24w"
- RadarEmailRoutingTimeseriesGroupIPVersionParamsDateRange52w RadarEmailRoutingTimeseriesGroupIPVersionParamsDateRange = "52w"
- RadarEmailRoutingTimeseriesGroupIPVersionParamsDateRange1dControl RadarEmailRoutingTimeseriesGroupIPVersionParamsDateRange = "1dControl"
- RadarEmailRoutingTimeseriesGroupIPVersionParamsDateRange2dControl RadarEmailRoutingTimeseriesGroupIPVersionParamsDateRange = "2dControl"
- RadarEmailRoutingTimeseriesGroupIPVersionParamsDateRange7dControl RadarEmailRoutingTimeseriesGroupIPVersionParamsDateRange = "7dControl"
- RadarEmailRoutingTimeseriesGroupIPVersionParamsDateRange14dControl RadarEmailRoutingTimeseriesGroupIPVersionParamsDateRange = "14dControl"
- RadarEmailRoutingTimeseriesGroupIPVersionParamsDateRange28dControl RadarEmailRoutingTimeseriesGroupIPVersionParamsDateRange = "28dControl"
- RadarEmailRoutingTimeseriesGroupIPVersionParamsDateRange12wControl RadarEmailRoutingTimeseriesGroupIPVersionParamsDateRange = "12wControl"
- RadarEmailRoutingTimeseriesGroupIPVersionParamsDateRange24wControl RadarEmailRoutingTimeseriesGroupIPVersionParamsDateRange = "24wControl"
-)
-
-type RadarEmailRoutingTimeseriesGroupIPVersionParamsDKIM string
-
-const (
- RadarEmailRoutingTimeseriesGroupIPVersionParamsDKIMPass RadarEmailRoutingTimeseriesGroupIPVersionParamsDKIM = "PASS"
- RadarEmailRoutingTimeseriesGroupIPVersionParamsDKIMNone RadarEmailRoutingTimeseriesGroupIPVersionParamsDKIM = "NONE"
- RadarEmailRoutingTimeseriesGroupIPVersionParamsDKIMFail RadarEmailRoutingTimeseriesGroupIPVersionParamsDKIM = "FAIL"
-)
-
-type RadarEmailRoutingTimeseriesGroupIPVersionParamsDMARC string
-
-const (
- RadarEmailRoutingTimeseriesGroupIPVersionParamsDMARCPass RadarEmailRoutingTimeseriesGroupIPVersionParamsDMARC = "PASS"
- RadarEmailRoutingTimeseriesGroupIPVersionParamsDMARCNone RadarEmailRoutingTimeseriesGroupIPVersionParamsDMARC = "NONE"
- RadarEmailRoutingTimeseriesGroupIPVersionParamsDMARCFail RadarEmailRoutingTimeseriesGroupIPVersionParamsDMARC = "FAIL"
-)
-
-type RadarEmailRoutingTimeseriesGroupIPVersionParamsEncrypted string
-
-const (
- RadarEmailRoutingTimeseriesGroupIPVersionParamsEncryptedEncrypted RadarEmailRoutingTimeseriesGroupIPVersionParamsEncrypted = "ENCRYPTED"
- RadarEmailRoutingTimeseriesGroupIPVersionParamsEncryptedNotEncrypted RadarEmailRoutingTimeseriesGroupIPVersionParamsEncrypted = "NOT_ENCRYPTED"
-)
-
-// Format results are returned in.
-type RadarEmailRoutingTimeseriesGroupIPVersionParamsFormat string
-
-const (
- RadarEmailRoutingTimeseriesGroupIPVersionParamsFormatJson RadarEmailRoutingTimeseriesGroupIPVersionParamsFormat = "JSON"
- RadarEmailRoutingTimeseriesGroupIPVersionParamsFormatCsv RadarEmailRoutingTimeseriesGroupIPVersionParamsFormat = "CSV"
-)
-
-type RadarEmailRoutingTimeseriesGroupIPVersionParamsSPF string
-
-const (
- RadarEmailRoutingTimeseriesGroupIPVersionParamsSPFPass RadarEmailRoutingTimeseriesGroupIPVersionParamsSPF = "PASS"
- RadarEmailRoutingTimeseriesGroupIPVersionParamsSPFNone RadarEmailRoutingTimeseriesGroupIPVersionParamsSPF = "NONE"
- RadarEmailRoutingTimeseriesGroupIPVersionParamsSPFFail RadarEmailRoutingTimeseriesGroupIPVersionParamsSPF = "FAIL"
-)
-
-type RadarEmailRoutingTimeseriesGroupIPVersionResponseEnvelope struct {
- Result RadarEmailRoutingTimeseriesGroupIPVersionResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarEmailRoutingTimeseriesGroupIPVersionResponseEnvelopeJSON `json:"-"`
-}
-
-// radarEmailRoutingTimeseriesGroupIPVersionResponseEnvelopeJSON contains the JSON
-// metadata for the struct
-// [RadarEmailRoutingTimeseriesGroupIPVersionResponseEnvelope]
-type radarEmailRoutingTimeseriesGroupIPVersionResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailRoutingTimeseriesGroupIPVersionResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailRoutingTimeseriesGroupIPVersionResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailRoutingTimeseriesGroupSPFParams struct {
- // Aggregation interval results should be returned in (for example, in 15 minutes
- // or 1 hour intervals). Refer to
- // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
- AggInterval param.Field[RadarEmailRoutingTimeseriesGroupSPFParamsAggInterval] `query:"aggInterval"`
- // Filter for arc (Authenticated Received Chain).
- ARC param.Field[[]RadarEmailRoutingTimeseriesGroupSPFParamsARC] `query:"arc"`
- // 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[[]RadarEmailRoutingTimeseriesGroupSPFParamsDateRange] `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[[]RadarEmailRoutingTimeseriesGroupSPFParamsDKIM] `query:"dkim"`
- // Filter for dmarc.
- DMARC param.Field[[]RadarEmailRoutingTimeseriesGroupSPFParamsDMARC] `query:"dmarc"`
- // Filter for encrypted emails.
- Encrypted param.Field[[]RadarEmailRoutingTimeseriesGroupSPFParamsEncrypted] `query:"encrypted"`
- // Format results are returned in.
- Format param.Field[RadarEmailRoutingTimeseriesGroupSPFParamsFormat] `query:"format"`
- // Filter for ip version.
- IPVersion param.Field[[]RadarEmailRoutingTimeseriesGroupSPFParamsIPVersion] `query:"ipVersion"`
- // Array of names that will be used to name the series in responses.
- Name param.Field[[]string] `query:"name"`
-}
-
-// URLQuery serializes [RadarEmailRoutingTimeseriesGroupSPFParams]'s query
-// parameters as `url.Values`.
-func (r RadarEmailRoutingTimeseriesGroupSPFParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Aggregation interval results should be returned in (for example, in 15 minutes
-// or 1 hour intervals). Refer to
-// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
-type RadarEmailRoutingTimeseriesGroupSPFParamsAggInterval string
-
-const (
- RadarEmailRoutingTimeseriesGroupSPFParamsAggInterval15m RadarEmailRoutingTimeseriesGroupSPFParamsAggInterval = "15m"
- RadarEmailRoutingTimeseriesGroupSPFParamsAggInterval1h RadarEmailRoutingTimeseriesGroupSPFParamsAggInterval = "1h"
- RadarEmailRoutingTimeseriesGroupSPFParamsAggInterval1d RadarEmailRoutingTimeseriesGroupSPFParamsAggInterval = "1d"
- RadarEmailRoutingTimeseriesGroupSPFParamsAggInterval1w RadarEmailRoutingTimeseriesGroupSPFParamsAggInterval = "1w"
-)
-
-type RadarEmailRoutingTimeseriesGroupSPFParamsARC string
-
-const (
- RadarEmailRoutingTimeseriesGroupSPFParamsARCPass RadarEmailRoutingTimeseriesGroupSPFParamsARC = "PASS"
- RadarEmailRoutingTimeseriesGroupSPFParamsARCNone RadarEmailRoutingTimeseriesGroupSPFParamsARC = "NONE"
- RadarEmailRoutingTimeseriesGroupSPFParamsARCFail RadarEmailRoutingTimeseriesGroupSPFParamsARC = "FAIL"
-)
-
-type RadarEmailRoutingTimeseriesGroupSPFParamsDateRange string
-
-const (
- RadarEmailRoutingTimeseriesGroupSPFParamsDateRange1d RadarEmailRoutingTimeseriesGroupSPFParamsDateRange = "1d"
- RadarEmailRoutingTimeseriesGroupSPFParamsDateRange2d RadarEmailRoutingTimeseriesGroupSPFParamsDateRange = "2d"
- RadarEmailRoutingTimeseriesGroupSPFParamsDateRange7d RadarEmailRoutingTimeseriesGroupSPFParamsDateRange = "7d"
- RadarEmailRoutingTimeseriesGroupSPFParamsDateRange14d RadarEmailRoutingTimeseriesGroupSPFParamsDateRange = "14d"
- RadarEmailRoutingTimeseriesGroupSPFParamsDateRange28d RadarEmailRoutingTimeseriesGroupSPFParamsDateRange = "28d"
- RadarEmailRoutingTimeseriesGroupSPFParamsDateRange12w RadarEmailRoutingTimeseriesGroupSPFParamsDateRange = "12w"
- RadarEmailRoutingTimeseriesGroupSPFParamsDateRange24w RadarEmailRoutingTimeseriesGroupSPFParamsDateRange = "24w"
- RadarEmailRoutingTimeseriesGroupSPFParamsDateRange52w RadarEmailRoutingTimeseriesGroupSPFParamsDateRange = "52w"
- RadarEmailRoutingTimeseriesGroupSPFParamsDateRange1dControl RadarEmailRoutingTimeseriesGroupSPFParamsDateRange = "1dControl"
- RadarEmailRoutingTimeseriesGroupSPFParamsDateRange2dControl RadarEmailRoutingTimeseriesGroupSPFParamsDateRange = "2dControl"
- RadarEmailRoutingTimeseriesGroupSPFParamsDateRange7dControl RadarEmailRoutingTimeseriesGroupSPFParamsDateRange = "7dControl"
- RadarEmailRoutingTimeseriesGroupSPFParamsDateRange14dControl RadarEmailRoutingTimeseriesGroupSPFParamsDateRange = "14dControl"
- RadarEmailRoutingTimeseriesGroupSPFParamsDateRange28dControl RadarEmailRoutingTimeseriesGroupSPFParamsDateRange = "28dControl"
- RadarEmailRoutingTimeseriesGroupSPFParamsDateRange12wControl RadarEmailRoutingTimeseriesGroupSPFParamsDateRange = "12wControl"
- RadarEmailRoutingTimeseriesGroupSPFParamsDateRange24wControl RadarEmailRoutingTimeseriesGroupSPFParamsDateRange = "24wControl"
-)
-
-type RadarEmailRoutingTimeseriesGroupSPFParamsDKIM string
-
-const (
- RadarEmailRoutingTimeseriesGroupSPFParamsDKIMPass RadarEmailRoutingTimeseriesGroupSPFParamsDKIM = "PASS"
- RadarEmailRoutingTimeseriesGroupSPFParamsDKIMNone RadarEmailRoutingTimeseriesGroupSPFParamsDKIM = "NONE"
- RadarEmailRoutingTimeseriesGroupSPFParamsDKIMFail RadarEmailRoutingTimeseriesGroupSPFParamsDKIM = "FAIL"
-)
-
-type RadarEmailRoutingTimeseriesGroupSPFParamsDMARC string
-
-const (
- RadarEmailRoutingTimeseriesGroupSPFParamsDMARCPass RadarEmailRoutingTimeseriesGroupSPFParamsDMARC = "PASS"
- RadarEmailRoutingTimeseriesGroupSPFParamsDMARCNone RadarEmailRoutingTimeseriesGroupSPFParamsDMARC = "NONE"
- RadarEmailRoutingTimeseriesGroupSPFParamsDMARCFail RadarEmailRoutingTimeseriesGroupSPFParamsDMARC = "FAIL"
-)
-
-type RadarEmailRoutingTimeseriesGroupSPFParamsEncrypted string
-
-const (
- RadarEmailRoutingTimeseriesGroupSPFParamsEncryptedEncrypted RadarEmailRoutingTimeseriesGroupSPFParamsEncrypted = "ENCRYPTED"
- RadarEmailRoutingTimeseriesGroupSPFParamsEncryptedNotEncrypted RadarEmailRoutingTimeseriesGroupSPFParamsEncrypted = "NOT_ENCRYPTED"
-)
-
-// Format results are returned in.
-type RadarEmailRoutingTimeseriesGroupSPFParamsFormat string
-
-const (
- RadarEmailRoutingTimeseriesGroupSPFParamsFormatJson RadarEmailRoutingTimeseriesGroupSPFParamsFormat = "JSON"
- RadarEmailRoutingTimeseriesGroupSPFParamsFormatCsv RadarEmailRoutingTimeseriesGroupSPFParamsFormat = "CSV"
-)
-
-type RadarEmailRoutingTimeseriesGroupSPFParamsIPVersion string
-
-const (
- RadarEmailRoutingTimeseriesGroupSPFParamsIPVersionIPv4 RadarEmailRoutingTimeseriesGroupSPFParamsIPVersion = "IPv4"
- RadarEmailRoutingTimeseriesGroupSPFParamsIPVersionIPv6 RadarEmailRoutingTimeseriesGroupSPFParamsIPVersion = "IPv6"
-)
-
-type RadarEmailRoutingTimeseriesGroupSPFResponseEnvelope struct {
- Result RadarEmailRoutingTimeseriesGroupSPFResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarEmailRoutingTimeseriesGroupSPFResponseEnvelopeJSON `json:"-"`
-}
-
-// radarEmailRoutingTimeseriesGroupSPFResponseEnvelopeJSON contains the JSON
-// metadata for the struct [RadarEmailRoutingTimeseriesGroupSPFResponseEnvelope]
-type radarEmailRoutingTimeseriesGroupSPFResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailRoutingTimeseriesGroupSPFResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailRoutingTimeseriesGroupSPFResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
diff --git a/radaremailroutingtimeseriesgroup_test.go b/radaremailroutingtimeseriesgroup_test.go
deleted file mode 100644
index f8805c47ea1..00000000000
--- a/radaremailroutingtimeseriesgroup_test.go
+++ /dev/null
@@ -1,231 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
- "time"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRadarEmailRoutingTimeseriesGroupARCWithOptionalParams(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"),
- )
- _, err := client.Radar.Email.Routing.TimeseriesGroups.ARC(context.TODO(), cloudflare.RadarEmailRoutingTimeseriesGroupARCParams{
- AggInterval: cloudflare.F(cloudflare.RadarEmailRoutingTimeseriesGroupARCParamsAggInterval1h),
- DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
- DateRange: cloudflare.F([]cloudflare.RadarEmailRoutingTimeseriesGroupARCParamsDateRange{cloudflare.RadarEmailRoutingTimeseriesGroupARCParamsDateRange1d, cloudflare.RadarEmailRoutingTimeseriesGroupARCParamsDateRange2d, cloudflare.RadarEmailRoutingTimeseriesGroupARCParamsDateRange7d}),
- DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
- DKIM: cloudflare.F([]cloudflare.RadarEmailRoutingTimeseriesGroupARCParamsDKIM{cloudflare.RadarEmailRoutingTimeseriesGroupARCParamsDKIMPass, cloudflare.RadarEmailRoutingTimeseriesGroupARCParamsDKIMNone, cloudflare.RadarEmailRoutingTimeseriesGroupARCParamsDKIMFail}),
- DMARC: cloudflare.F([]cloudflare.RadarEmailRoutingTimeseriesGroupARCParamsDMARC{cloudflare.RadarEmailRoutingTimeseriesGroupARCParamsDMARCPass, cloudflare.RadarEmailRoutingTimeseriesGroupARCParamsDMARCNone, cloudflare.RadarEmailRoutingTimeseriesGroupARCParamsDMARCFail}),
- Encrypted: cloudflare.F([]cloudflare.RadarEmailRoutingTimeseriesGroupARCParamsEncrypted{cloudflare.RadarEmailRoutingTimeseriesGroupARCParamsEncryptedEncrypted, cloudflare.RadarEmailRoutingTimeseriesGroupARCParamsEncryptedNotEncrypted}),
- Format: cloudflare.F(cloudflare.RadarEmailRoutingTimeseriesGroupARCParamsFormatJson),
- IPVersion: cloudflare.F([]cloudflare.RadarEmailRoutingTimeseriesGroupARCParamsIPVersion{cloudflare.RadarEmailRoutingTimeseriesGroupARCParamsIPVersionIPv4, cloudflare.RadarEmailRoutingTimeseriesGroupARCParamsIPVersionIPv6}),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- SPF: cloudflare.F([]cloudflare.RadarEmailRoutingTimeseriesGroupARCParamsSPF{cloudflare.RadarEmailRoutingTimeseriesGroupARCParamsSPFPass, cloudflare.RadarEmailRoutingTimeseriesGroupARCParamsSPFNone, cloudflare.RadarEmailRoutingTimeseriesGroupARCParamsSPFFail}),
- })
- 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())
- }
-}
-
-func TestRadarEmailRoutingTimeseriesGroupDKIMWithOptionalParams(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"),
- )
- _, err := client.Radar.Email.Routing.TimeseriesGroups.DKIM(context.TODO(), cloudflare.RadarEmailRoutingTimeseriesGroupDKIMParams{
- AggInterval: cloudflare.F(cloudflare.RadarEmailRoutingTimeseriesGroupDKIMParamsAggInterval1h),
- ARC: cloudflare.F([]cloudflare.RadarEmailRoutingTimeseriesGroupDKIMParamsARC{cloudflare.RadarEmailRoutingTimeseriesGroupDKIMParamsARCPass, cloudflare.RadarEmailRoutingTimeseriesGroupDKIMParamsARCNone, cloudflare.RadarEmailRoutingTimeseriesGroupDKIMParamsARCFail}),
- DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
- DateRange: cloudflare.F([]cloudflare.RadarEmailRoutingTimeseriesGroupDKIMParamsDateRange{cloudflare.RadarEmailRoutingTimeseriesGroupDKIMParamsDateRange1d, cloudflare.RadarEmailRoutingTimeseriesGroupDKIMParamsDateRange2d, cloudflare.RadarEmailRoutingTimeseriesGroupDKIMParamsDateRange7d}),
- DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
- DMARC: cloudflare.F([]cloudflare.RadarEmailRoutingTimeseriesGroupDKIMParamsDMARC{cloudflare.RadarEmailRoutingTimeseriesGroupDKIMParamsDMARCPass, cloudflare.RadarEmailRoutingTimeseriesGroupDKIMParamsDMARCNone, cloudflare.RadarEmailRoutingTimeseriesGroupDKIMParamsDMARCFail}),
- Encrypted: cloudflare.F([]cloudflare.RadarEmailRoutingTimeseriesGroupDKIMParamsEncrypted{cloudflare.RadarEmailRoutingTimeseriesGroupDKIMParamsEncryptedEncrypted, cloudflare.RadarEmailRoutingTimeseriesGroupDKIMParamsEncryptedNotEncrypted}),
- Format: cloudflare.F(cloudflare.RadarEmailRoutingTimeseriesGroupDKIMParamsFormatJson),
- IPVersion: cloudflare.F([]cloudflare.RadarEmailRoutingTimeseriesGroupDKIMParamsIPVersion{cloudflare.RadarEmailRoutingTimeseriesGroupDKIMParamsIPVersionIPv4, cloudflare.RadarEmailRoutingTimeseriesGroupDKIMParamsIPVersionIPv6}),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- SPF: cloudflare.F([]cloudflare.RadarEmailRoutingTimeseriesGroupDKIMParamsSPF{cloudflare.RadarEmailRoutingTimeseriesGroupDKIMParamsSPFPass, cloudflare.RadarEmailRoutingTimeseriesGroupDKIMParamsSPFNone, cloudflare.RadarEmailRoutingTimeseriesGroupDKIMParamsSPFFail}),
- })
- 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())
- }
-}
-
-func TestRadarEmailRoutingTimeseriesGroupDMARCWithOptionalParams(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"),
- )
- _, err := client.Radar.Email.Routing.TimeseriesGroups.DMARC(context.TODO(), cloudflare.RadarEmailRoutingTimeseriesGroupDMARCParams{
- AggInterval: cloudflare.F(cloudflare.RadarEmailRoutingTimeseriesGroupDMARCParamsAggInterval1h),
- ARC: cloudflare.F([]cloudflare.RadarEmailRoutingTimeseriesGroupDMARCParamsARC{cloudflare.RadarEmailRoutingTimeseriesGroupDMARCParamsARCPass, cloudflare.RadarEmailRoutingTimeseriesGroupDMARCParamsARCNone, cloudflare.RadarEmailRoutingTimeseriesGroupDMARCParamsARCFail}),
- DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
- DateRange: cloudflare.F([]cloudflare.RadarEmailRoutingTimeseriesGroupDMARCParamsDateRange{cloudflare.RadarEmailRoutingTimeseriesGroupDMARCParamsDateRange1d, cloudflare.RadarEmailRoutingTimeseriesGroupDMARCParamsDateRange2d, cloudflare.RadarEmailRoutingTimeseriesGroupDMARCParamsDateRange7d}),
- DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
- DKIM: cloudflare.F([]cloudflare.RadarEmailRoutingTimeseriesGroupDMARCParamsDKIM{cloudflare.RadarEmailRoutingTimeseriesGroupDMARCParamsDKIMPass, cloudflare.RadarEmailRoutingTimeseriesGroupDMARCParamsDKIMNone, cloudflare.RadarEmailRoutingTimeseriesGroupDMARCParamsDKIMFail}),
- Encrypted: cloudflare.F([]cloudflare.RadarEmailRoutingTimeseriesGroupDMARCParamsEncrypted{cloudflare.RadarEmailRoutingTimeseriesGroupDMARCParamsEncryptedEncrypted, cloudflare.RadarEmailRoutingTimeseriesGroupDMARCParamsEncryptedNotEncrypted}),
- Format: cloudflare.F(cloudflare.RadarEmailRoutingTimeseriesGroupDMARCParamsFormatJson),
- IPVersion: cloudflare.F([]cloudflare.RadarEmailRoutingTimeseriesGroupDMARCParamsIPVersion{cloudflare.RadarEmailRoutingTimeseriesGroupDMARCParamsIPVersionIPv4, cloudflare.RadarEmailRoutingTimeseriesGroupDMARCParamsIPVersionIPv6}),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- SPF: cloudflare.F([]cloudflare.RadarEmailRoutingTimeseriesGroupDMARCParamsSPF{cloudflare.RadarEmailRoutingTimeseriesGroupDMARCParamsSPFPass, cloudflare.RadarEmailRoutingTimeseriesGroupDMARCParamsSPFNone, cloudflare.RadarEmailRoutingTimeseriesGroupDMARCParamsSPFFail}),
- })
- 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())
- }
-}
-
-func TestRadarEmailRoutingTimeseriesGroupEncryptedWithOptionalParams(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"),
- )
- _, err := client.Radar.Email.Routing.TimeseriesGroups.Encrypted(context.TODO(), cloudflare.RadarEmailRoutingTimeseriesGroupEncryptedParams{
- AggInterval: cloudflare.F(cloudflare.RadarEmailRoutingTimeseriesGroupEncryptedParamsAggInterval1h),
- ARC: cloudflare.F([]cloudflare.RadarEmailRoutingTimeseriesGroupEncryptedParamsARC{cloudflare.RadarEmailRoutingTimeseriesGroupEncryptedParamsARCPass, cloudflare.RadarEmailRoutingTimeseriesGroupEncryptedParamsARCNone, cloudflare.RadarEmailRoutingTimeseriesGroupEncryptedParamsARCFail}),
- DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
- DateRange: cloudflare.F([]cloudflare.RadarEmailRoutingTimeseriesGroupEncryptedParamsDateRange{cloudflare.RadarEmailRoutingTimeseriesGroupEncryptedParamsDateRange1d, cloudflare.RadarEmailRoutingTimeseriesGroupEncryptedParamsDateRange2d, cloudflare.RadarEmailRoutingTimeseriesGroupEncryptedParamsDateRange7d}),
- DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
- DKIM: cloudflare.F([]cloudflare.RadarEmailRoutingTimeseriesGroupEncryptedParamsDKIM{cloudflare.RadarEmailRoutingTimeseriesGroupEncryptedParamsDKIMPass, cloudflare.RadarEmailRoutingTimeseriesGroupEncryptedParamsDKIMNone, cloudflare.RadarEmailRoutingTimeseriesGroupEncryptedParamsDKIMFail}),
- DMARC: cloudflare.F([]cloudflare.RadarEmailRoutingTimeseriesGroupEncryptedParamsDMARC{cloudflare.RadarEmailRoutingTimeseriesGroupEncryptedParamsDMARCPass, cloudflare.RadarEmailRoutingTimeseriesGroupEncryptedParamsDMARCNone, cloudflare.RadarEmailRoutingTimeseriesGroupEncryptedParamsDMARCFail}),
- Format: cloudflare.F(cloudflare.RadarEmailRoutingTimeseriesGroupEncryptedParamsFormatJson),
- IPVersion: cloudflare.F([]cloudflare.RadarEmailRoutingTimeseriesGroupEncryptedParamsIPVersion{cloudflare.RadarEmailRoutingTimeseriesGroupEncryptedParamsIPVersionIPv4, cloudflare.RadarEmailRoutingTimeseriesGroupEncryptedParamsIPVersionIPv6}),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- SPF: cloudflare.F([]cloudflare.RadarEmailRoutingTimeseriesGroupEncryptedParamsSPF{cloudflare.RadarEmailRoutingTimeseriesGroupEncryptedParamsSPFPass, cloudflare.RadarEmailRoutingTimeseriesGroupEncryptedParamsSPFNone, cloudflare.RadarEmailRoutingTimeseriesGroupEncryptedParamsSPFFail}),
- })
- 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())
- }
-}
-
-func TestRadarEmailRoutingTimeseriesGroupIPVersionWithOptionalParams(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"),
- )
- _, err := client.Radar.Email.Routing.TimeseriesGroups.IPVersion(context.TODO(), cloudflare.RadarEmailRoutingTimeseriesGroupIPVersionParams{
- AggInterval: cloudflare.F(cloudflare.RadarEmailRoutingTimeseriesGroupIPVersionParamsAggInterval1h),
- ARC: cloudflare.F([]cloudflare.RadarEmailRoutingTimeseriesGroupIPVersionParamsARC{cloudflare.RadarEmailRoutingTimeseriesGroupIPVersionParamsARCPass, cloudflare.RadarEmailRoutingTimeseriesGroupIPVersionParamsARCNone, cloudflare.RadarEmailRoutingTimeseriesGroupIPVersionParamsARCFail}),
- DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
- DateRange: cloudflare.F([]cloudflare.RadarEmailRoutingTimeseriesGroupIPVersionParamsDateRange{cloudflare.RadarEmailRoutingTimeseriesGroupIPVersionParamsDateRange1d, cloudflare.RadarEmailRoutingTimeseriesGroupIPVersionParamsDateRange2d, cloudflare.RadarEmailRoutingTimeseriesGroupIPVersionParamsDateRange7d}),
- DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
- DKIM: cloudflare.F([]cloudflare.RadarEmailRoutingTimeseriesGroupIPVersionParamsDKIM{cloudflare.RadarEmailRoutingTimeseriesGroupIPVersionParamsDKIMPass, cloudflare.RadarEmailRoutingTimeseriesGroupIPVersionParamsDKIMNone, cloudflare.RadarEmailRoutingTimeseriesGroupIPVersionParamsDKIMFail}),
- DMARC: cloudflare.F([]cloudflare.RadarEmailRoutingTimeseriesGroupIPVersionParamsDMARC{cloudflare.RadarEmailRoutingTimeseriesGroupIPVersionParamsDMARCPass, cloudflare.RadarEmailRoutingTimeseriesGroupIPVersionParamsDMARCNone, cloudflare.RadarEmailRoutingTimeseriesGroupIPVersionParamsDMARCFail}),
- Encrypted: cloudflare.F([]cloudflare.RadarEmailRoutingTimeseriesGroupIPVersionParamsEncrypted{cloudflare.RadarEmailRoutingTimeseriesGroupIPVersionParamsEncryptedEncrypted, cloudflare.RadarEmailRoutingTimeseriesGroupIPVersionParamsEncryptedNotEncrypted}),
- Format: cloudflare.F(cloudflare.RadarEmailRoutingTimeseriesGroupIPVersionParamsFormatJson),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- SPF: cloudflare.F([]cloudflare.RadarEmailRoutingTimeseriesGroupIPVersionParamsSPF{cloudflare.RadarEmailRoutingTimeseriesGroupIPVersionParamsSPFPass, cloudflare.RadarEmailRoutingTimeseriesGroupIPVersionParamsSPFNone, cloudflare.RadarEmailRoutingTimeseriesGroupIPVersionParamsSPFFail}),
- })
- 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())
- }
-}
-
-func TestRadarEmailRoutingTimeseriesGroupSPFWithOptionalParams(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"),
- )
- _, err := client.Radar.Email.Routing.TimeseriesGroups.SPF(context.TODO(), cloudflare.RadarEmailRoutingTimeseriesGroupSPFParams{
- AggInterval: cloudflare.F(cloudflare.RadarEmailRoutingTimeseriesGroupSPFParamsAggInterval1h),
- ARC: cloudflare.F([]cloudflare.RadarEmailRoutingTimeseriesGroupSPFParamsARC{cloudflare.RadarEmailRoutingTimeseriesGroupSPFParamsARCPass, cloudflare.RadarEmailRoutingTimeseriesGroupSPFParamsARCNone, cloudflare.RadarEmailRoutingTimeseriesGroupSPFParamsARCFail}),
- DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
- DateRange: cloudflare.F([]cloudflare.RadarEmailRoutingTimeseriesGroupSPFParamsDateRange{cloudflare.RadarEmailRoutingTimeseriesGroupSPFParamsDateRange1d, cloudflare.RadarEmailRoutingTimeseriesGroupSPFParamsDateRange2d, cloudflare.RadarEmailRoutingTimeseriesGroupSPFParamsDateRange7d}),
- DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
- DKIM: cloudflare.F([]cloudflare.RadarEmailRoutingTimeseriesGroupSPFParamsDKIM{cloudflare.RadarEmailRoutingTimeseriesGroupSPFParamsDKIMPass, cloudflare.RadarEmailRoutingTimeseriesGroupSPFParamsDKIMNone, cloudflare.RadarEmailRoutingTimeseriesGroupSPFParamsDKIMFail}),
- DMARC: cloudflare.F([]cloudflare.RadarEmailRoutingTimeseriesGroupSPFParamsDMARC{cloudflare.RadarEmailRoutingTimeseriesGroupSPFParamsDMARCPass, cloudflare.RadarEmailRoutingTimeseriesGroupSPFParamsDMARCNone, cloudflare.RadarEmailRoutingTimeseriesGroupSPFParamsDMARCFail}),
- Encrypted: cloudflare.F([]cloudflare.RadarEmailRoutingTimeseriesGroupSPFParamsEncrypted{cloudflare.RadarEmailRoutingTimeseriesGroupSPFParamsEncryptedEncrypted, cloudflare.RadarEmailRoutingTimeseriesGroupSPFParamsEncryptedNotEncrypted}),
- Format: cloudflare.F(cloudflare.RadarEmailRoutingTimeseriesGroupSPFParamsFormatJson),
- IPVersion: cloudflare.F([]cloudflare.RadarEmailRoutingTimeseriesGroupSPFParamsIPVersion{cloudflare.RadarEmailRoutingTimeseriesGroupSPFParamsIPVersionIPv4, cloudflare.RadarEmailRoutingTimeseriesGroupSPFParamsIPVersionIPv6}),
- 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/radaremailsecurity.go b/radaremailsecurity.go
deleted file mode 100644
index cb3855a813f..00000000000
--- a/radaremailsecurity.go
+++ /dev/null
@@ -1,31 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarEmailSecurityService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewRadarEmailSecurityService] method
-// instead.
-type RadarEmailSecurityService struct {
- Options []option.RequestOption
- Top *RadarEmailSecurityTopService
- Summary *RadarEmailSecuritySummaryService
- TimeseriesGroups *RadarEmailSecurityTimeseriesGroupService
-}
-
-// NewRadarEmailSecurityService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewRadarEmailSecurityService(opts ...option.RequestOption) (r *RadarEmailSecurityService) {
- r = &RadarEmailSecurityService{}
- r.Options = opts
- r.Top = NewRadarEmailSecurityTopService(opts...)
- r.Summary = NewRadarEmailSecuritySummaryService(opts...)
- r.TimeseriesGroups = NewRadarEmailSecurityTimeseriesGroupService(opts...)
- return
-}
diff --git a/radaremailsecuritysummary.go b/radaremailsecuritysummary.go
deleted file mode 100644
index 448923d5547..00000000000
--- a/radaremailsecuritysummary.go
+++ /dev/null
@@ -1,2657 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarEmailSecuritySummaryService contains methods and other services that help
-// with interacting with the cloudflare API. Note, unlike clients, this service
-// does not read variables from the environment automatically. You should not
-// instantiate this service directly, and instead use the
-// [NewRadarEmailSecuritySummaryService] method instead.
-type RadarEmailSecuritySummaryService struct {
- Options []option.RequestOption
-}
-
-// NewRadarEmailSecuritySummaryService generates a new service that applies the
-// given options to each request. These options are applied after the parent
-// client's options (if there is one), and before any request-specific options.
-func NewRadarEmailSecuritySummaryService(opts ...option.RequestOption) (r *RadarEmailSecuritySummaryService) {
- r = &RadarEmailSecuritySummaryService{}
- r.Options = opts
- return
-}
-
-// Percentage distribution of emails classified per ARC validation.
-func (r *RadarEmailSecuritySummaryService) ARC(ctx context.Context, query RadarEmailSecuritySummaryARCParams, opts ...option.RequestOption) (res *RadarEmailSecuritySummaryARCResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarEmailSecuritySummaryARCResponseEnvelope
- path := "radar/email/security/summary/arc"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Percentage distribution of emails classified per DKIM validation.
-func (r *RadarEmailSecuritySummaryService) DKIM(ctx context.Context, query RadarEmailSecuritySummaryDKIMParams, opts ...option.RequestOption) (res *RadarEmailSecuritySummaryDKIMResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarEmailSecuritySummaryDKIMResponseEnvelope
- path := "radar/email/security/summary/dkim"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Percentage distribution of emails classified per DMARC validation.
-func (r *RadarEmailSecuritySummaryService) DMARC(ctx context.Context, query RadarEmailSecuritySummaryDMARCParams, opts ...option.RequestOption) (res *RadarEmailSecuritySummaryDMARCResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarEmailSecuritySummaryDMARCResponseEnvelope
- path := "radar/email/security/summary/dmarc"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Percentage distribution of emails classified as MALICIOUS.
-func (r *RadarEmailSecuritySummaryService) Malicious(ctx context.Context, query RadarEmailSecuritySummaryMaliciousParams, opts ...option.RequestOption) (res *RadarEmailSecuritySummaryMaliciousResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarEmailSecuritySummaryMaliciousResponseEnvelope
- path := "radar/email/security/summary/malicious"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Proportion of emails categorized as either spam or legitimate (non-spam).
-func (r *RadarEmailSecuritySummaryService) Spam(ctx context.Context, query RadarEmailSecuritySummarySpamParams, opts ...option.RequestOption) (res *RadarEmailSecuritySummarySpamResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarEmailSecuritySummarySpamResponseEnvelope
- path := "radar/email/security/summary/spam"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Percentage distribution of emails classified per SPF validation.
-func (r *RadarEmailSecuritySummaryService) SPF(ctx context.Context, query RadarEmailSecuritySummarySPFParams, opts ...option.RequestOption) (res *RadarEmailSecuritySummarySPFResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarEmailSecuritySummarySPFResponseEnvelope
- path := "radar/email/security/summary/spf"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Proportion of emails categorized as either spoof or legitimate (non-spoof).
-func (r *RadarEmailSecuritySummaryService) Spoof(ctx context.Context, query RadarEmailSecuritySummarySpoofParams, opts ...option.RequestOption) (res *RadarEmailSecuritySummarySpoofResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarEmailSecuritySummarySpoofResponseEnvelope
- path := "radar/email/security/summary/spoof"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Percentage distribution of emails classified in Threat Categories.
-func (r *RadarEmailSecuritySummaryService) ThreatCategory(ctx context.Context, query RadarEmailSecuritySummaryThreatCategoryParams, opts ...option.RequestOption) (res *RadarEmailSecuritySummaryThreatCategoryResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarEmailSecuritySummaryThreatCategoryResponseEnvelope
- path := "radar/email/security/summary/threat_category"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Percentage distribution of emails classified per TLS Version.
-func (r *RadarEmailSecuritySummaryService) TLSVersion(ctx context.Context, query RadarEmailSecuritySummaryTLSVersionParams, opts ...option.RequestOption) (res *RadarEmailSecuritySummaryTLSVersionResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarEmailSecuritySummaryTLSVersionResponseEnvelope
- path := "radar/email/security/summary/tls_version"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type RadarEmailSecuritySummaryARCResponse struct {
- Meta RadarEmailSecuritySummaryARCResponseMeta `json:"meta,required"`
- Summary0 RadarEmailSecuritySummaryARCResponseSummary0 `json:"summary_0,required"`
- JSON radarEmailSecuritySummaryARCResponseJSON `json:"-"`
-}
-
-// radarEmailSecuritySummaryARCResponseJSON contains the JSON metadata for the
-// struct [RadarEmailSecuritySummaryARCResponse]
-type radarEmailSecuritySummaryARCResponseJSON struct {
- Meta apijson.Field
- Summary0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecuritySummaryARCResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecuritySummaryARCResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecuritySummaryARCResponseMeta struct {
- DateRange []RadarEmailSecuritySummaryARCResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- Normalization string `json:"normalization,required"`
- ConfidenceInfo RadarEmailSecuritySummaryARCResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarEmailSecuritySummaryARCResponseMetaJSON `json:"-"`
-}
-
-// radarEmailSecuritySummaryARCResponseMetaJSON contains the JSON metadata for the
-// struct [RadarEmailSecuritySummaryARCResponseMeta]
-type radarEmailSecuritySummaryARCResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- Normalization apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecuritySummaryARCResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecuritySummaryARCResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecuritySummaryARCResponseMetaDateRange 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 radarEmailSecuritySummaryARCResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarEmailSecuritySummaryARCResponseMetaDateRangeJSON contains the JSON metadata
-// for the struct [RadarEmailSecuritySummaryARCResponseMetaDateRange]
-type radarEmailSecuritySummaryARCResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecuritySummaryARCResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecuritySummaryARCResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecuritySummaryARCResponseMetaConfidenceInfo struct {
- Annotations []RadarEmailSecuritySummaryARCResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarEmailSecuritySummaryARCResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarEmailSecuritySummaryARCResponseMetaConfidenceInfoJSON contains the JSON
-// metadata for the struct [RadarEmailSecuritySummaryARCResponseMetaConfidenceInfo]
-type radarEmailSecuritySummaryARCResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecuritySummaryARCResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecuritySummaryARCResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecuritySummaryARCResponseMetaConfidenceInfoAnnotation 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 radarEmailSecuritySummaryARCResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarEmailSecuritySummaryARCResponseMetaConfidenceInfoAnnotationJSON contains
-// the JSON metadata for the struct
-// [RadarEmailSecuritySummaryARCResponseMetaConfidenceInfoAnnotation]
-type radarEmailSecuritySummaryARCResponseMetaConfidenceInfoAnnotationJSON 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 *RadarEmailSecuritySummaryARCResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecuritySummaryARCResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecuritySummaryARCResponseSummary0 struct {
- Fail string `json:"FAIL,required"`
- None string `json:"NONE,required"`
- Pass string `json:"PASS,required"`
- JSON radarEmailSecuritySummaryARCResponseSummary0JSON `json:"-"`
-}
-
-// radarEmailSecuritySummaryARCResponseSummary0JSON contains the JSON metadata for
-// the struct [RadarEmailSecuritySummaryARCResponseSummary0]
-type radarEmailSecuritySummaryARCResponseSummary0JSON struct {
- Fail apijson.Field
- None apijson.Field
- Pass apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecuritySummaryARCResponseSummary0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecuritySummaryARCResponseSummary0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecuritySummaryDKIMResponse struct {
- Meta RadarEmailSecuritySummaryDKIMResponseMeta `json:"meta,required"`
- Summary0 RadarEmailSecuritySummaryDKIMResponseSummary0 `json:"summary_0,required"`
- JSON radarEmailSecuritySummaryDKIMResponseJSON `json:"-"`
-}
-
-// radarEmailSecuritySummaryDKIMResponseJSON contains the JSON metadata for the
-// struct [RadarEmailSecuritySummaryDKIMResponse]
-type radarEmailSecuritySummaryDKIMResponseJSON struct {
- Meta apijson.Field
- Summary0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecuritySummaryDKIMResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecuritySummaryDKIMResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecuritySummaryDKIMResponseMeta struct {
- DateRange []RadarEmailSecuritySummaryDKIMResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- Normalization string `json:"normalization,required"`
- ConfidenceInfo RadarEmailSecuritySummaryDKIMResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarEmailSecuritySummaryDKIMResponseMetaJSON `json:"-"`
-}
-
-// radarEmailSecuritySummaryDKIMResponseMetaJSON contains the JSON metadata for the
-// struct [RadarEmailSecuritySummaryDKIMResponseMeta]
-type radarEmailSecuritySummaryDKIMResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- Normalization apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecuritySummaryDKIMResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecuritySummaryDKIMResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecuritySummaryDKIMResponseMetaDateRange 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 radarEmailSecuritySummaryDKIMResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarEmailSecuritySummaryDKIMResponseMetaDateRangeJSON contains the JSON
-// metadata for the struct [RadarEmailSecuritySummaryDKIMResponseMetaDateRange]
-type radarEmailSecuritySummaryDKIMResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecuritySummaryDKIMResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecuritySummaryDKIMResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecuritySummaryDKIMResponseMetaConfidenceInfo struct {
- Annotations []RadarEmailSecuritySummaryDKIMResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarEmailSecuritySummaryDKIMResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarEmailSecuritySummaryDKIMResponseMetaConfidenceInfoJSON contains the JSON
-// metadata for the struct
-// [RadarEmailSecuritySummaryDKIMResponseMetaConfidenceInfo]
-type radarEmailSecuritySummaryDKIMResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecuritySummaryDKIMResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecuritySummaryDKIMResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecuritySummaryDKIMResponseMetaConfidenceInfoAnnotation 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 radarEmailSecuritySummaryDKIMResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarEmailSecuritySummaryDKIMResponseMetaConfidenceInfoAnnotationJSON contains
-// the JSON metadata for the struct
-// [RadarEmailSecuritySummaryDKIMResponseMetaConfidenceInfoAnnotation]
-type radarEmailSecuritySummaryDKIMResponseMetaConfidenceInfoAnnotationJSON 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 *RadarEmailSecuritySummaryDKIMResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecuritySummaryDKIMResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecuritySummaryDKIMResponseSummary0 struct {
- Fail string `json:"FAIL,required"`
- None string `json:"NONE,required"`
- Pass string `json:"PASS,required"`
- JSON radarEmailSecuritySummaryDKIMResponseSummary0JSON `json:"-"`
-}
-
-// radarEmailSecuritySummaryDKIMResponseSummary0JSON contains the JSON metadata for
-// the struct [RadarEmailSecuritySummaryDKIMResponseSummary0]
-type radarEmailSecuritySummaryDKIMResponseSummary0JSON struct {
- Fail apijson.Field
- None apijson.Field
- Pass apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecuritySummaryDKIMResponseSummary0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecuritySummaryDKIMResponseSummary0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecuritySummaryDMARCResponse struct {
- Meta RadarEmailSecuritySummaryDMARCResponseMeta `json:"meta,required"`
- Summary0 RadarEmailSecuritySummaryDMARCResponseSummary0 `json:"summary_0,required"`
- JSON radarEmailSecuritySummaryDMARCResponseJSON `json:"-"`
-}
-
-// radarEmailSecuritySummaryDMARCResponseJSON contains the JSON metadata for the
-// struct [RadarEmailSecuritySummaryDMARCResponse]
-type radarEmailSecuritySummaryDMARCResponseJSON struct {
- Meta apijson.Field
- Summary0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecuritySummaryDMARCResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecuritySummaryDMARCResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecuritySummaryDMARCResponseMeta struct {
- DateRange []RadarEmailSecuritySummaryDMARCResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- Normalization string `json:"normalization,required"`
- ConfidenceInfo RadarEmailSecuritySummaryDMARCResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarEmailSecuritySummaryDMARCResponseMetaJSON `json:"-"`
-}
-
-// radarEmailSecuritySummaryDMARCResponseMetaJSON contains the JSON metadata for
-// the struct [RadarEmailSecuritySummaryDMARCResponseMeta]
-type radarEmailSecuritySummaryDMARCResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- Normalization apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecuritySummaryDMARCResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecuritySummaryDMARCResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecuritySummaryDMARCResponseMetaDateRange 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 radarEmailSecuritySummaryDMARCResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarEmailSecuritySummaryDMARCResponseMetaDateRangeJSON contains the JSON
-// metadata for the struct [RadarEmailSecuritySummaryDMARCResponseMetaDateRange]
-type radarEmailSecuritySummaryDMARCResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecuritySummaryDMARCResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecuritySummaryDMARCResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecuritySummaryDMARCResponseMetaConfidenceInfo struct {
- Annotations []RadarEmailSecuritySummaryDMARCResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarEmailSecuritySummaryDMARCResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarEmailSecuritySummaryDMARCResponseMetaConfidenceInfoJSON contains the JSON
-// metadata for the struct
-// [RadarEmailSecuritySummaryDMARCResponseMetaConfidenceInfo]
-type radarEmailSecuritySummaryDMARCResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecuritySummaryDMARCResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecuritySummaryDMARCResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecuritySummaryDMARCResponseMetaConfidenceInfoAnnotation 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 radarEmailSecuritySummaryDMARCResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarEmailSecuritySummaryDMARCResponseMetaConfidenceInfoAnnotationJSON contains
-// the JSON metadata for the struct
-// [RadarEmailSecuritySummaryDMARCResponseMetaConfidenceInfoAnnotation]
-type radarEmailSecuritySummaryDMARCResponseMetaConfidenceInfoAnnotationJSON 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 *RadarEmailSecuritySummaryDMARCResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecuritySummaryDMARCResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecuritySummaryDMARCResponseSummary0 struct {
- Fail string `json:"FAIL,required"`
- None string `json:"NONE,required"`
- Pass string `json:"PASS,required"`
- JSON radarEmailSecuritySummaryDMARCResponseSummary0JSON `json:"-"`
-}
-
-// radarEmailSecuritySummaryDMARCResponseSummary0JSON contains the JSON metadata
-// for the struct [RadarEmailSecuritySummaryDMARCResponseSummary0]
-type radarEmailSecuritySummaryDMARCResponseSummary0JSON struct {
- Fail apijson.Field
- None apijson.Field
- Pass apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecuritySummaryDMARCResponseSummary0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecuritySummaryDMARCResponseSummary0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecuritySummaryMaliciousResponse struct {
- Meta RadarEmailSecuritySummaryMaliciousResponseMeta `json:"meta,required"`
- Summary0 RadarEmailSecuritySummaryMaliciousResponseSummary0 `json:"summary_0,required"`
- JSON radarEmailSecuritySummaryMaliciousResponseJSON `json:"-"`
-}
-
-// radarEmailSecuritySummaryMaliciousResponseJSON contains the JSON metadata for
-// the struct [RadarEmailSecuritySummaryMaliciousResponse]
-type radarEmailSecuritySummaryMaliciousResponseJSON struct {
- Meta apijson.Field
- Summary0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecuritySummaryMaliciousResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecuritySummaryMaliciousResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecuritySummaryMaliciousResponseMeta struct {
- DateRange []RadarEmailSecuritySummaryMaliciousResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- Normalization string `json:"normalization,required"`
- ConfidenceInfo RadarEmailSecuritySummaryMaliciousResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarEmailSecuritySummaryMaliciousResponseMetaJSON `json:"-"`
-}
-
-// radarEmailSecuritySummaryMaliciousResponseMetaJSON contains the JSON metadata
-// for the struct [RadarEmailSecuritySummaryMaliciousResponseMeta]
-type radarEmailSecuritySummaryMaliciousResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- Normalization apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecuritySummaryMaliciousResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecuritySummaryMaliciousResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecuritySummaryMaliciousResponseMetaDateRange 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 radarEmailSecuritySummaryMaliciousResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarEmailSecuritySummaryMaliciousResponseMetaDateRangeJSON contains the JSON
-// metadata for the struct
-// [RadarEmailSecuritySummaryMaliciousResponseMetaDateRange]
-type radarEmailSecuritySummaryMaliciousResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecuritySummaryMaliciousResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecuritySummaryMaliciousResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecuritySummaryMaliciousResponseMetaConfidenceInfo struct {
- Annotations []RadarEmailSecuritySummaryMaliciousResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarEmailSecuritySummaryMaliciousResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarEmailSecuritySummaryMaliciousResponseMetaConfidenceInfoJSON contains the
-// JSON metadata for the struct
-// [RadarEmailSecuritySummaryMaliciousResponseMetaConfidenceInfo]
-type radarEmailSecuritySummaryMaliciousResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecuritySummaryMaliciousResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecuritySummaryMaliciousResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecuritySummaryMaliciousResponseMetaConfidenceInfoAnnotation 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 radarEmailSecuritySummaryMaliciousResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarEmailSecuritySummaryMaliciousResponseMetaConfidenceInfoAnnotationJSON
-// contains the JSON metadata for the struct
-// [RadarEmailSecuritySummaryMaliciousResponseMetaConfidenceInfoAnnotation]
-type radarEmailSecuritySummaryMaliciousResponseMetaConfidenceInfoAnnotationJSON 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 *RadarEmailSecuritySummaryMaliciousResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecuritySummaryMaliciousResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecuritySummaryMaliciousResponseSummary0 struct {
- Malicious string `json:"MALICIOUS,required"`
- NotMalicious string `json:"NOT_MALICIOUS,required"`
- JSON radarEmailSecuritySummaryMaliciousResponseSummary0JSON `json:"-"`
-}
-
-// radarEmailSecuritySummaryMaliciousResponseSummary0JSON contains the JSON
-// metadata for the struct [RadarEmailSecuritySummaryMaliciousResponseSummary0]
-type radarEmailSecuritySummaryMaliciousResponseSummary0JSON struct {
- Malicious apijson.Field
- NotMalicious apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecuritySummaryMaliciousResponseSummary0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecuritySummaryMaliciousResponseSummary0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecuritySummarySpamResponse struct {
- Meta RadarEmailSecuritySummarySpamResponseMeta `json:"meta,required"`
- Summary0 RadarEmailSecuritySummarySpamResponseSummary0 `json:"summary_0,required"`
- JSON radarEmailSecuritySummarySpamResponseJSON `json:"-"`
-}
-
-// radarEmailSecuritySummarySpamResponseJSON contains the JSON metadata for the
-// struct [RadarEmailSecuritySummarySpamResponse]
-type radarEmailSecuritySummarySpamResponseJSON struct {
- Meta apijson.Field
- Summary0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecuritySummarySpamResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecuritySummarySpamResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecuritySummarySpamResponseMeta struct {
- DateRange []RadarEmailSecuritySummarySpamResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- Normalization string `json:"normalization,required"`
- ConfidenceInfo RadarEmailSecuritySummarySpamResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarEmailSecuritySummarySpamResponseMetaJSON `json:"-"`
-}
-
-// radarEmailSecuritySummarySpamResponseMetaJSON contains the JSON metadata for the
-// struct [RadarEmailSecuritySummarySpamResponseMeta]
-type radarEmailSecuritySummarySpamResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- Normalization apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecuritySummarySpamResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecuritySummarySpamResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecuritySummarySpamResponseMetaDateRange 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 radarEmailSecuritySummarySpamResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarEmailSecuritySummarySpamResponseMetaDateRangeJSON contains the JSON
-// metadata for the struct [RadarEmailSecuritySummarySpamResponseMetaDateRange]
-type radarEmailSecuritySummarySpamResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecuritySummarySpamResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecuritySummarySpamResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecuritySummarySpamResponseMetaConfidenceInfo struct {
- Annotations []RadarEmailSecuritySummarySpamResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarEmailSecuritySummarySpamResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarEmailSecuritySummarySpamResponseMetaConfidenceInfoJSON contains the JSON
-// metadata for the struct
-// [RadarEmailSecuritySummarySpamResponseMetaConfidenceInfo]
-type radarEmailSecuritySummarySpamResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecuritySummarySpamResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecuritySummarySpamResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecuritySummarySpamResponseMetaConfidenceInfoAnnotation 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 radarEmailSecuritySummarySpamResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarEmailSecuritySummarySpamResponseMetaConfidenceInfoAnnotationJSON contains
-// the JSON metadata for the struct
-// [RadarEmailSecuritySummarySpamResponseMetaConfidenceInfoAnnotation]
-type radarEmailSecuritySummarySpamResponseMetaConfidenceInfoAnnotationJSON 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 *RadarEmailSecuritySummarySpamResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecuritySummarySpamResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecuritySummarySpamResponseSummary0 struct {
- NotSpam string `json:"NOT_SPAM,required"`
- Spam string `json:"SPAM,required"`
- JSON radarEmailSecuritySummarySpamResponseSummary0JSON `json:"-"`
-}
-
-// radarEmailSecuritySummarySpamResponseSummary0JSON contains the JSON metadata for
-// the struct [RadarEmailSecuritySummarySpamResponseSummary0]
-type radarEmailSecuritySummarySpamResponseSummary0JSON struct {
- NotSpam apijson.Field
- Spam apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecuritySummarySpamResponseSummary0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecuritySummarySpamResponseSummary0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecuritySummarySPFResponse struct {
- Meta RadarEmailSecuritySummarySPFResponseMeta `json:"meta,required"`
- Summary0 RadarEmailSecuritySummarySPFResponseSummary0 `json:"summary_0,required"`
- JSON radarEmailSecuritySummarySPFResponseJSON `json:"-"`
-}
-
-// radarEmailSecuritySummarySPFResponseJSON contains the JSON metadata for the
-// struct [RadarEmailSecuritySummarySPFResponse]
-type radarEmailSecuritySummarySPFResponseJSON struct {
- Meta apijson.Field
- Summary0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecuritySummarySPFResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecuritySummarySPFResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecuritySummarySPFResponseMeta struct {
- DateRange []RadarEmailSecuritySummarySPFResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- Normalization string `json:"normalization,required"`
- ConfidenceInfo RadarEmailSecuritySummarySPFResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarEmailSecuritySummarySPFResponseMetaJSON `json:"-"`
-}
-
-// radarEmailSecuritySummarySPFResponseMetaJSON contains the JSON metadata for the
-// struct [RadarEmailSecuritySummarySPFResponseMeta]
-type radarEmailSecuritySummarySPFResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- Normalization apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecuritySummarySPFResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecuritySummarySPFResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecuritySummarySPFResponseMetaDateRange 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 radarEmailSecuritySummarySPFResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarEmailSecuritySummarySPFResponseMetaDateRangeJSON contains the JSON metadata
-// for the struct [RadarEmailSecuritySummarySPFResponseMetaDateRange]
-type radarEmailSecuritySummarySPFResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecuritySummarySPFResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecuritySummarySPFResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecuritySummarySPFResponseMetaConfidenceInfo struct {
- Annotations []RadarEmailSecuritySummarySPFResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarEmailSecuritySummarySPFResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarEmailSecuritySummarySPFResponseMetaConfidenceInfoJSON contains the JSON
-// metadata for the struct [RadarEmailSecuritySummarySPFResponseMetaConfidenceInfo]
-type radarEmailSecuritySummarySPFResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecuritySummarySPFResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecuritySummarySPFResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecuritySummarySPFResponseMetaConfidenceInfoAnnotation 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 radarEmailSecuritySummarySPFResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarEmailSecuritySummarySPFResponseMetaConfidenceInfoAnnotationJSON contains
-// the JSON metadata for the struct
-// [RadarEmailSecuritySummarySPFResponseMetaConfidenceInfoAnnotation]
-type radarEmailSecuritySummarySPFResponseMetaConfidenceInfoAnnotationJSON 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 *RadarEmailSecuritySummarySPFResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecuritySummarySPFResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecuritySummarySPFResponseSummary0 struct {
- Fail string `json:"FAIL,required"`
- None string `json:"NONE,required"`
- Pass string `json:"PASS,required"`
- JSON radarEmailSecuritySummarySPFResponseSummary0JSON `json:"-"`
-}
-
-// radarEmailSecuritySummarySPFResponseSummary0JSON contains the JSON metadata for
-// the struct [RadarEmailSecuritySummarySPFResponseSummary0]
-type radarEmailSecuritySummarySPFResponseSummary0JSON struct {
- Fail apijson.Field
- None apijson.Field
- Pass apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecuritySummarySPFResponseSummary0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecuritySummarySPFResponseSummary0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecuritySummarySpoofResponse struct {
- Meta RadarEmailSecuritySummarySpoofResponseMeta `json:"meta,required"`
- Summary0 RadarEmailSecuritySummarySpoofResponseSummary0 `json:"summary_0,required"`
- JSON radarEmailSecuritySummarySpoofResponseJSON `json:"-"`
-}
-
-// radarEmailSecuritySummarySpoofResponseJSON contains the JSON metadata for the
-// struct [RadarEmailSecuritySummarySpoofResponse]
-type radarEmailSecuritySummarySpoofResponseJSON struct {
- Meta apijson.Field
- Summary0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecuritySummarySpoofResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecuritySummarySpoofResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecuritySummarySpoofResponseMeta struct {
- DateRange []RadarEmailSecuritySummarySpoofResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- Normalization string `json:"normalization,required"`
- ConfidenceInfo RadarEmailSecuritySummarySpoofResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarEmailSecuritySummarySpoofResponseMetaJSON `json:"-"`
-}
-
-// radarEmailSecuritySummarySpoofResponseMetaJSON contains the JSON metadata for
-// the struct [RadarEmailSecuritySummarySpoofResponseMeta]
-type radarEmailSecuritySummarySpoofResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- Normalization apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecuritySummarySpoofResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecuritySummarySpoofResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecuritySummarySpoofResponseMetaDateRange 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 radarEmailSecuritySummarySpoofResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarEmailSecuritySummarySpoofResponseMetaDateRangeJSON contains the JSON
-// metadata for the struct [RadarEmailSecuritySummarySpoofResponseMetaDateRange]
-type radarEmailSecuritySummarySpoofResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecuritySummarySpoofResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecuritySummarySpoofResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecuritySummarySpoofResponseMetaConfidenceInfo struct {
- Annotations []RadarEmailSecuritySummarySpoofResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarEmailSecuritySummarySpoofResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarEmailSecuritySummarySpoofResponseMetaConfidenceInfoJSON contains the JSON
-// metadata for the struct
-// [RadarEmailSecuritySummarySpoofResponseMetaConfidenceInfo]
-type radarEmailSecuritySummarySpoofResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecuritySummarySpoofResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecuritySummarySpoofResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecuritySummarySpoofResponseMetaConfidenceInfoAnnotation 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 radarEmailSecuritySummarySpoofResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarEmailSecuritySummarySpoofResponseMetaConfidenceInfoAnnotationJSON contains
-// the JSON metadata for the struct
-// [RadarEmailSecuritySummarySpoofResponseMetaConfidenceInfoAnnotation]
-type radarEmailSecuritySummarySpoofResponseMetaConfidenceInfoAnnotationJSON 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 *RadarEmailSecuritySummarySpoofResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecuritySummarySpoofResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecuritySummarySpoofResponseSummary0 struct {
- NotSpoof string `json:"NOT_SPOOF,required"`
- Spoof string `json:"SPOOF,required"`
- JSON radarEmailSecuritySummarySpoofResponseSummary0JSON `json:"-"`
-}
-
-// radarEmailSecuritySummarySpoofResponseSummary0JSON contains the JSON metadata
-// for the struct [RadarEmailSecuritySummarySpoofResponseSummary0]
-type radarEmailSecuritySummarySpoofResponseSummary0JSON struct {
- NotSpoof apijson.Field
- Spoof apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecuritySummarySpoofResponseSummary0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecuritySummarySpoofResponseSummary0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecuritySummaryThreatCategoryResponse struct {
- Meta RadarEmailSecuritySummaryThreatCategoryResponseMeta `json:"meta,required"`
- Summary0 RadarEmailSecuritySummaryThreatCategoryResponseSummary0 `json:"summary_0,required"`
- JSON radarEmailSecuritySummaryThreatCategoryResponseJSON `json:"-"`
-}
-
-// radarEmailSecuritySummaryThreatCategoryResponseJSON contains the JSON metadata
-// for the struct [RadarEmailSecuritySummaryThreatCategoryResponse]
-type radarEmailSecuritySummaryThreatCategoryResponseJSON struct {
- Meta apijson.Field
- Summary0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecuritySummaryThreatCategoryResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecuritySummaryThreatCategoryResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecuritySummaryThreatCategoryResponseMeta struct {
- DateRange []RadarEmailSecuritySummaryThreatCategoryResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- Normalization string `json:"normalization,required"`
- ConfidenceInfo RadarEmailSecuritySummaryThreatCategoryResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarEmailSecuritySummaryThreatCategoryResponseMetaJSON `json:"-"`
-}
-
-// radarEmailSecuritySummaryThreatCategoryResponseMetaJSON contains the JSON
-// metadata for the struct [RadarEmailSecuritySummaryThreatCategoryResponseMeta]
-type radarEmailSecuritySummaryThreatCategoryResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- Normalization apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecuritySummaryThreatCategoryResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecuritySummaryThreatCategoryResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecuritySummaryThreatCategoryResponseMetaDateRange 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 radarEmailSecuritySummaryThreatCategoryResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarEmailSecuritySummaryThreatCategoryResponseMetaDateRangeJSON contains the
-// JSON metadata for the struct
-// [RadarEmailSecuritySummaryThreatCategoryResponseMetaDateRange]
-type radarEmailSecuritySummaryThreatCategoryResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecuritySummaryThreatCategoryResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecuritySummaryThreatCategoryResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecuritySummaryThreatCategoryResponseMetaConfidenceInfo struct {
- Annotations []RadarEmailSecuritySummaryThreatCategoryResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarEmailSecuritySummaryThreatCategoryResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarEmailSecuritySummaryThreatCategoryResponseMetaConfidenceInfoJSON contains
-// the JSON metadata for the struct
-// [RadarEmailSecuritySummaryThreatCategoryResponseMetaConfidenceInfo]
-type radarEmailSecuritySummaryThreatCategoryResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecuritySummaryThreatCategoryResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecuritySummaryThreatCategoryResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecuritySummaryThreatCategoryResponseMetaConfidenceInfoAnnotation 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 radarEmailSecuritySummaryThreatCategoryResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarEmailSecuritySummaryThreatCategoryResponseMetaConfidenceInfoAnnotationJSON
-// contains the JSON metadata for the struct
-// [RadarEmailSecuritySummaryThreatCategoryResponseMetaConfidenceInfoAnnotation]
-type radarEmailSecuritySummaryThreatCategoryResponseMetaConfidenceInfoAnnotationJSON 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 *RadarEmailSecuritySummaryThreatCategoryResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecuritySummaryThreatCategoryResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecuritySummaryThreatCategoryResponseSummary0 struct {
- BrandImpersonation string `json:"BrandImpersonation,required"`
- CredentialHarvester string `json:"CredentialHarvester,required"`
- IdentityDeception string `json:"IdentityDeception,required"`
- Link string `json:"Link,required"`
- JSON radarEmailSecuritySummaryThreatCategoryResponseSummary0JSON `json:"-"`
-}
-
-// radarEmailSecuritySummaryThreatCategoryResponseSummary0JSON contains the JSON
-// metadata for the struct
-// [RadarEmailSecuritySummaryThreatCategoryResponseSummary0]
-type radarEmailSecuritySummaryThreatCategoryResponseSummary0JSON struct {
- BrandImpersonation apijson.Field
- CredentialHarvester apijson.Field
- IdentityDeception apijson.Field
- Link apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecuritySummaryThreatCategoryResponseSummary0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecuritySummaryThreatCategoryResponseSummary0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecuritySummaryTLSVersionResponse struct {
- Meta RadarEmailSecuritySummaryTLSVersionResponseMeta `json:"meta,required"`
- Summary0 RadarEmailSecuritySummaryTLSVersionResponseSummary0 `json:"summary_0,required"`
- JSON radarEmailSecuritySummaryTLSVersionResponseJSON `json:"-"`
-}
-
-// radarEmailSecuritySummaryTLSVersionResponseJSON contains the JSON metadata for
-// the struct [RadarEmailSecuritySummaryTLSVersionResponse]
-type radarEmailSecuritySummaryTLSVersionResponseJSON struct {
- Meta apijson.Field
- Summary0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecuritySummaryTLSVersionResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecuritySummaryTLSVersionResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecuritySummaryTLSVersionResponseMeta struct {
- DateRange []RadarEmailSecuritySummaryTLSVersionResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- Normalization string `json:"normalization,required"`
- ConfidenceInfo RadarEmailSecuritySummaryTLSVersionResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarEmailSecuritySummaryTLSVersionResponseMetaJSON `json:"-"`
-}
-
-// radarEmailSecuritySummaryTLSVersionResponseMetaJSON contains the JSON metadata
-// for the struct [RadarEmailSecuritySummaryTLSVersionResponseMeta]
-type radarEmailSecuritySummaryTLSVersionResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- Normalization apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecuritySummaryTLSVersionResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecuritySummaryTLSVersionResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecuritySummaryTLSVersionResponseMetaDateRange 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 radarEmailSecuritySummaryTLSVersionResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarEmailSecuritySummaryTLSVersionResponseMetaDateRangeJSON contains the JSON
-// metadata for the struct
-// [RadarEmailSecuritySummaryTLSVersionResponseMetaDateRange]
-type radarEmailSecuritySummaryTLSVersionResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecuritySummaryTLSVersionResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecuritySummaryTLSVersionResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecuritySummaryTLSVersionResponseMetaConfidenceInfo struct {
- Annotations []RadarEmailSecuritySummaryTLSVersionResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarEmailSecuritySummaryTLSVersionResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarEmailSecuritySummaryTLSVersionResponseMetaConfidenceInfoJSON contains the
-// JSON metadata for the struct
-// [RadarEmailSecuritySummaryTLSVersionResponseMetaConfidenceInfo]
-type radarEmailSecuritySummaryTLSVersionResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecuritySummaryTLSVersionResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecuritySummaryTLSVersionResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecuritySummaryTLSVersionResponseMetaConfidenceInfoAnnotation 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 radarEmailSecuritySummaryTLSVersionResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarEmailSecuritySummaryTLSVersionResponseMetaConfidenceInfoAnnotationJSON
-// contains the JSON metadata for the struct
-// [RadarEmailSecuritySummaryTLSVersionResponseMetaConfidenceInfoAnnotation]
-type radarEmailSecuritySummaryTLSVersionResponseMetaConfidenceInfoAnnotationJSON 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 *RadarEmailSecuritySummaryTLSVersionResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecuritySummaryTLSVersionResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecuritySummaryTLSVersionResponseSummary0 struct {
- TLS1_0 string `json:"TLS 1.0,required"`
- TLS1_1 string `json:"TLS 1.1,required"`
- TLS1_2 string `json:"TLS 1.2,required"`
- TLS1_3 string `json:"TLS 1.3,required"`
- JSON radarEmailSecuritySummaryTLSVersionResponseSummary0JSON `json:"-"`
-}
-
-// radarEmailSecuritySummaryTLSVersionResponseSummary0JSON contains the JSON
-// metadata for the struct [RadarEmailSecuritySummaryTLSVersionResponseSummary0]
-type radarEmailSecuritySummaryTLSVersionResponseSummary0JSON struct {
- TLS1_0 apijson.Field
- TLS1_1 apijson.Field
- TLS1_2 apijson.Field
- TLS1_3 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecuritySummaryTLSVersionResponseSummary0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecuritySummaryTLSVersionResponseSummary0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecuritySummaryARCParams struct {
- // 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[[]RadarEmailSecuritySummaryARCParamsDateRange] `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[[]RadarEmailSecuritySummaryARCParamsDKIM] `query:"dkim"`
- // Filter for dmarc.
- DMARC param.Field[[]RadarEmailSecuritySummaryARCParamsDMARC] `query:"dmarc"`
- // Format results are returned in.
- Format param.Field[RadarEmailSecuritySummaryARCParamsFormat] `query:"format"`
- // 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
-// `url.Values`.
-func (r RadarEmailSecuritySummaryARCParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type RadarEmailSecuritySummaryARCParamsDateRange string
-
-const (
- RadarEmailSecuritySummaryARCParamsDateRange1d RadarEmailSecuritySummaryARCParamsDateRange = "1d"
- RadarEmailSecuritySummaryARCParamsDateRange2d RadarEmailSecuritySummaryARCParamsDateRange = "2d"
- RadarEmailSecuritySummaryARCParamsDateRange7d RadarEmailSecuritySummaryARCParamsDateRange = "7d"
- RadarEmailSecuritySummaryARCParamsDateRange14d RadarEmailSecuritySummaryARCParamsDateRange = "14d"
- RadarEmailSecuritySummaryARCParamsDateRange28d RadarEmailSecuritySummaryARCParamsDateRange = "28d"
- RadarEmailSecuritySummaryARCParamsDateRange12w RadarEmailSecuritySummaryARCParamsDateRange = "12w"
- RadarEmailSecuritySummaryARCParamsDateRange24w RadarEmailSecuritySummaryARCParamsDateRange = "24w"
- RadarEmailSecuritySummaryARCParamsDateRange52w RadarEmailSecuritySummaryARCParamsDateRange = "52w"
- RadarEmailSecuritySummaryARCParamsDateRange1dControl RadarEmailSecuritySummaryARCParamsDateRange = "1dControl"
- RadarEmailSecuritySummaryARCParamsDateRange2dControl RadarEmailSecuritySummaryARCParamsDateRange = "2dControl"
- RadarEmailSecuritySummaryARCParamsDateRange7dControl RadarEmailSecuritySummaryARCParamsDateRange = "7dControl"
- RadarEmailSecuritySummaryARCParamsDateRange14dControl RadarEmailSecuritySummaryARCParamsDateRange = "14dControl"
- RadarEmailSecuritySummaryARCParamsDateRange28dControl RadarEmailSecuritySummaryARCParamsDateRange = "28dControl"
- RadarEmailSecuritySummaryARCParamsDateRange12wControl RadarEmailSecuritySummaryARCParamsDateRange = "12wControl"
- RadarEmailSecuritySummaryARCParamsDateRange24wControl RadarEmailSecuritySummaryARCParamsDateRange = "24wControl"
-)
-
-type RadarEmailSecuritySummaryARCParamsDKIM string
-
-const (
- RadarEmailSecuritySummaryARCParamsDKIMPass RadarEmailSecuritySummaryARCParamsDKIM = "PASS"
- RadarEmailSecuritySummaryARCParamsDKIMNone RadarEmailSecuritySummaryARCParamsDKIM = "NONE"
- RadarEmailSecuritySummaryARCParamsDKIMFail RadarEmailSecuritySummaryARCParamsDKIM = "FAIL"
-)
-
-type RadarEmailSecuritySummaryARCParamsDMARC string
-
-const (
- RadarEmailSecuritySummaryARCParamsDMARCPass RadarEmailSecuritySummaryARCParamsDMARC = "PASS"
- RadarEmailSecuritySummaryARCParamsDMARCNone RadarEmailSecuritySummaryARCParamsDMARC = "NONE"
- RadarEmailSecuritySummaryARCParamsDMARCFail RadarEmailSecuritySummaryARCParamsDMARC = "FAIL"
-)
-
-// Format results are returned in.
-type RadarEmailSecuritySummaryARCParamsFormat string
-
-const (
- RadarEmailSecuritySummaryARCParamsFormatJson RadarEmailSecuritySummaryARCParamsFormat = "JSON"
- RadarEmailSecuritySummaryARCParamsFormatCsv RadarEmailSecuritySummaryARCParamsFormat = "CSV"
-)
-
-type RadarEmailSecuritySummaryARCParamsSPF string
-
-const (
- RadarEmailSecuritySummaryARCParamsSPFPass RadarEmailSecuritySummaryARCParamsSPF = "PASS"
- RadarEmailSecuritySummaryARCParamsSPFNone RadarEmailSecuritySummaryARCParamsSPF = "NONE"
- 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"`
- JSON radarEmailSecuritySummaryARCResponseEnvelopeJSON `json:"-"`
-}
-
-// radarEmailSecuritySummaryARCResponseEnvelopeJSON contains the JSON metadata for
-// the struct [RadarEmailSecuritySummaryARCResponseEnvelope]
-type radarEmailSecuritySummaryARCResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecuritySummaryARCResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecuritySummaryARCResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecuritySummaryDKIMParams struct {
- // Filter for arc (Authenticated Received Chain).
- ARC param.Field[[]RadarEmailSecuritySummaryDKIMParamsARC] `query:"arc"`
- // 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[[]RadarEmailSecuritySummaryDKIMParamsDateRange] `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[[]RadarEmailSecuritySummaryDKIMParamsDMARC] `query:"dmarc"`
- // Format results are returned in.
- Format param.Field[RadarEmailSecuritySummaryDKIMParamsFormat] `query:"format"`
- // 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
-// `url.Values`.
-func (r RadarEmailSecuritySummaryDKIMParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type RadarEmailSecuritySummaryDKIMParamsARC string
-
-const (
- RadarEmailSecuritySummaryDKIMParamsARCPass RadarEmailSecuritySummaryDKIMParamsARC = "PASS"
- RadarEmailSecuritySummaryDKIMParamsARCNone RadarEmailSecuritySummaryDKIMParamsARC = "NONE"
- RadarEmailSecuritySummaryDKIMParamsARCFail RadarEmailSecuritySummaryDKIMParamsARC = "FAIL"
-)
-
-type RadarEmailSecuritySummaryDKIMParamsDateRange string
-
-const (
- RadarEmailSecuritySummaryDKIMParamsDateRange1d RadarEmailSecuritySummaryDKIMParamsDateRange = "1d"
- RadarEmailSecuritySummaryDKIMParamsDateRange2d RadarEmailSecuritySummaryDKIMParamsDateRange = "2d"
- RadarEmailSecuritySummaryDKIMParamsDateRange7d RadarEmailSecuritySummaryDKIMParamsDateRange = "7d"
- RadarEmailSecuritySummaryDKIMParamsDateRange14d RadarEmailSecuritySummaryDKIMParamsDateRange = "14d"
- RadarEmailSecuritySummaryDKIMParamsDateRange28d RadarEmailSecuritySummaryDKIMParamsDateRange = "28d"
- RadarEmailSecuritySummaryDKIMParamsDateRange12w RadarEmailSecuritySummaryDKIMParamsDateRange = "12w"
- RadarEmailSecuritySummaryDKIMParamsDateRange24w RadarEmailSecuritySummaryDKIMParamsDateRange = "24w"
- RadarEmailSecuritySummaryDKIMParamsDateRange52w RadarEmailSecuritySummaryDKIMParamsDateRange = "52w"
- RadarEmailSecuritySummaryDKIMParamsDateRange1dControl RadarEmailSecuritySummaryDKIMParamsDateRange = "1dControl"
- RadarEmailSecuritySummaryDKIMParamsDateRange2dControl RadarEmailSecuritySummaryDKIMParamsDateRange = "2dControl"
- RadarEmailSecuritySummaryDKIMParamsDateRange7dControl RadarEmailSecuritySummaryDKIMParamsDateRange = "7dControl"
- RadarEmailSecuritySummaryDKIMParamsDateRange14dControl RadarEmailSecuritySummaryDKIMParamsDateRange = "14dControl"
- RadarEmailSecuritySummaryDKIMParamsDateRange28dControl RadarEmailSecuritySummaryDKIMParamsDateRange = "28dControl"
- RadarEmailSecuritySummaryDKIMParamsDateRange12wControl RadarEmailSecuritySummaryDKIMParamsDateRange = "12wControl"
- RadarEmailSecuritySummaryDKIMParamsDateRange24wControl RadarEmailSecuritySummaryDKIMParamsDateRange = "24wControl"
-)
-
-type RadarEmailSecuritySummaryDKIMParamsDMARC string
-
-const (
- RadarEmailSecuritySummaryDKIMParamsDMARCPass RadarEmailSecuritySummaryDKIMParamsDMARC = "PASS"
- RadarEmailSecuritySummaryDKIMParamsDMARCNone RadarEmailSecuritySummaryDKIMParamsDMARC = "NONE"
- RadarEmailSecuritySummaryDKIMParamsDMARCFail RadarEmailSecuritySummaryDKIMParamsDMARC = "FAIL"
-)
-
-// Format results are returned in.
-type RadarEmailSecuritySummaryDKIMParamsFormat string
-
-const (
- RadarEmailSecuritySummaryDKIMParamsFormatJson RadarEmailSecuritySummaryDKIMParamsFormat = "JSON"
- RadarEmailSecuritySummaryDKIMParamsFormatCsv RadarEmailSecuritySummaryDKIMParamsFormat = "CSV"
-)
-
-type RadarEmailSecuritySummaryDKIMParamsSPF string
-
-const (
- RadarEmailSecuritySummaryDKIMParamsSPFPass RadarEmailSecuritySummaryDKIMParamsSPF = "PASS"
- RadarEmailSecuritySummaryDKIMParamsSPFNone RadarEmailSecuritySummaryDKIMParamsSPF = "NONE"
- 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"`
- JSON radarEmailSecuritySummaryDKIMResponseEnvelopeJSON `json:"-"`
-}
-
-// radarEmailSecuritySummaryDKIMResponseEnvelopeJSON contains the JSON metadata for
-// the struct [RadarEmailSecuritySummaryDKIMResponseEnvelope]
-type radarEmailSecuritySummaryDKIMResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecuritySummaryDKIMResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecuritySummaryDKIMResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecuritySummaryDMARCParams struct {
- // Filter for arc (Authenticated Received Chain).
- ARC param.Field[[]RadarEmailSecuritySummaryDMARCParamsARC] `query:"arc"`
- // 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[[]RadarEmailSecuritySummaryDMARCParamsDateRange] `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[[]RadarEmailSecuritySummaryDMARCParamsDKIM] `query:"dkim"`
- // Format results are returned in.
- Format param.Field[RadarEmailSecuritySummaryDMARCParamsFormat] `query:"format"`
- // 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
-// `url.Values`.
-func (r RadarEmailSecuritySummaryDMARCParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type RadarEmailSecuritySummaryDMARCParamsARC string
-
-const (
- RadarEmailSecuritySummaryDMARCParamsARCPass RadarEmailSecuritySummaryDMARCParamsARC = "PASS"
- RadarEmailSecuritySummaryDMARCParamsARCNone RadarEmailSecuritySummaryDMARCParamsARC = "NONE"
- RadarEmailSecuritySummaryDMARCParamsARCFail RadarEmailSecuritySummaryDMARCParamsARC = "FAIL"
-)
-
-type RadarEmailSecuritySummaryDMARCParamsDateRange string
-
-const (
- RadarEmailSecuritySummaryDMARCParamsDateRange1d RadarEmailSecuritySummaryDMARCParamsDateRange = "1d"
- RadarEmailSecuritySummaryDMARCParamsDateRange2d RadarEmailSecuritySummaryDMARCParamsDateRange = "2d"
- RadarEmailSecuritySummaryDMARCParamsDateRange7d RadarEmailSecuritySummaryDMARCParamsDateRange = "7d"
- RadarEmailSecuritySummaryDMARCParamsDateRange14d RadarEmailSecuritySummaryDMARCParamsDateRange = "14d"
- RadarEmailSecuritySummaryDMARCParamsDateRange28d RadarEmailSecuritySummaryDMARCParamsDateRange = "28d"
- RadarEmailSecuritySummaryDMARCParamsDateRange12w RadarEmailSecuritySummaryDMARCParamsDateRange = "12w"
- RadarEmailSecuritySummaryDMARCParamsDateRange24w RadarEmailSecuritySummaryDMARCParamsDateRange = "24w"
- RadarEmailSecuritySummaryDMARCParamsDateRange52w RadarEmailSecuritySummaryDMARCParamsDateRange = "52w"
- RadarEmailSecuritySummaryDMARCParamsDateRange1dControl RadarEmailSecuritySummaryDMARCParamsDateRange = "1dControl"
- RadarEmailSecuritySummaryDMARCParamsDateRange2dControl RadarEmailSecuritySummaryDMARCParamsDateRange = "2dControl"
- RadarEmailSecuritySummaryDMARCParamsDateRange7dControl RadarEmailSecuritySummaryDMARCParamsDateRange = "7dControl"
- RadarEmailSecuritySummaryDMARCParamsDateRange14dControl RadarEmailSecuritySummaryDMARCParamsDateRange = "14dControl"
- RadarEmailSecuritySummaryDMARCParamsDateRange28dControl RadarEmailSecuritySummaryDMARCParamsDateRange = "28dControl"
- RadarEmailSecuritySummaryDMARCParamsDateRange12wControl RadarEmailSecuritySummaryDMARCParamsDateRange = "12wControl"
- RadarEmailSecuritySummaryDMARCParamsDateRange24wControl RadarEmailSecuritySummaryDMARCParamsDateRange = "24wControl"
-)
-
-type RadarEmailSecuritySummaryDMARCParamsDKIM string
-
-const (
- RadarEmailSecuritySummaryDMARCParamsDKIMPass RadarEmailSecuritySummaryDMARCParamsDKIM = "PASS"
- RadarEmailSecuritySummaryDMARCParamsDKIMNone RadarEmailSecuritySummaryDMARCParamsDKIM = "NONE"
- RadarEmailSecuritySummaryDMARCParamsDKIMFail RadarEmailSecuritySummaryDMARCParamsDKIM = "FAIL"
-)
-
-// Format results are returned in.
-type RadarEmailSecuritySummaryDMARCParamsFormat string
-
-const (
- RadarEmailSecuritySummaryDMARCParamsFormatJson RadarEmailSecuritySummaryDMARCParamsFormat = "JSON"
- RadarEmailSecuritySummaryDMARCParamsFormatCsv RadarEmailSecuritySummaryDMARCParamsFormat = "CSV"
-)
-
-type RadarEmailSecuritySummaryDMARCParamsSPF string
-
-const (
- RadarEmailSecuritySummaryDMARCParamsSPFPass RadarEmailSecuritySummaryDMARCParamsSPF = "PASS"
- RadarEmailSecuritySummaryDMARCParamsSPFNone RadarEmailSecuritySummaryDMARCParamsSPF = "NONE"
- 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"`
- JSON radarEmailSecuritySummaryDMARCResponseEnvelopeJSON `json:"-"`
-}
-
-// radarEmailSecuritySummaryDMARCResponseEnvelopeJSON contains the JSON metadata
-// for the struct [RadarEmailSecuritySummaryDMARCResponseEnvelope]
-type radarEmailSecuritySummaryDMARCResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecuritySummaryDMARCResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecuritySummaryDMARCResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecuritySummaryMaliciousParams struct {
- // Filter for arc (Authenticated Received Chain).
- ARC param.Field[[]RadarEmailSecuritySummaryMaliciousParamsARC] `query:"arc"`
- // 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[[]RadarEmailSecuritySummaryMaliciousParamsDateRange] `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[[]RadarEmailSecuritySummaryMaliciousParamsDKIM] `query:"dkim"`
- // Filter for dmarc.
- DMARC param.Field[[]RadarEmailSecuritySummaryMaliciousParamsDMARC] `query:"dmarc"`
- // Format results are returned in.
- Format param.Field[RadarEmailSecuritySummaryMaliciousParamsFormat] `query:"format"`
- // 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
-// parameters as `url.Values`.
-func (r RadarEmailSecuritySummaryMaliciousParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type RadarEmailSecuritySummaryMaliciousParamsARC string
-
-const (
- RadarEmailSecuritySummaryMaliciousParamsARCPass RadarEmailSecuritySummaryMaliciousParamsARC = "PASS"
- RadarEmailSecuritySummaryMaliciousParamsARCNone RadarEmailSecuritySummaryMaliciousParamsARC = "NONE"
- RadarEmailSecuritySummaryMaliciousParamsARCFail RadarEmailSecuritySummaryMaliciousParamsARC = "FAIL"
-)
-
-type RadarEmailSecuritySummaryMaliciousParamsDateRange string
-
-const (
- RadarEmailSecuritySummaryMaliciousParamsDateRange1d RadarEmailSecuritySummaryMaliciousParamsDateRange = "1d"
- RadarEmailSecuritySummaryMaliciousParamsDateRange2d RadarEmailSecuritySummaryMaliciousParamsDateRange = "2d"
- RadarEmailSecuritySummaryMaliciousParamsDateRange7d RadarEmailSecuritySummaryMaliciousParamsDateRange = "7d"
- RadarEmailSecuritySummaryMaliciousParamsDateRange14d RadarEmailSecuritySummaryMaliciousParamsDateRange = "14d"
- RadarEmailSecuritySummaryMaliciousParamsDateRange28d RadarEmailSecuritySummaryMaliciousParamsDateRange = "28d"
- RadarEmailSecuritySummaryMaliciousParamsDateRange12w RadarEmailSecuritySummaryMaliciousParamsDateRange = "12w"
- RadarEmailSecuritySummaryMaliciousParamsDateRange24w RadarEmailSecuritySummaryMaliciousParamsDateRange = "24w"
- RadarEmailSecuritySummaryMaliciousParamsDateRange52w RadarEmailSecuritySummaryMaliciousParamsDateRange = "52w"
- RadarEmailSecuritySummaryMaliciousParamsDateRange1dControl RadarEmailSecuritySummaryMaliciousParamsDateRange = "1dControl"
- RadarEmailSecuritySummaryMaliciousParamsDateRange2dControl RadarEmailSecuritySummaryMaliciousParamsDateRange = "2dControl"
- RadarEmailSecuritySummaryMaliciousParamsDateRange7dControl RadarEmailSecuritySummaryMaliciousParamsDateRange = "7dControl"
- RadarEmailSecuritySummaryMaliciousParamsDateRange14dControl RadarEmailSecuritySummaryMaliciousParamsDateRange = "14dControl"
- RadarEmailSecuritySummaryMaliciousParamsDateRange28dControl RadarEmailSecuritySummaryMaliciousParamsDateRange = "28dControl"
- RadarEmailSecuritySummaryMaliciousParamsDateRange12wControl RadarEmailSecuritySummaryMaliciousParamsDateRange = "12wControl"
- RadarEmailSecuritySummaryMaliciousParamsDateRange24wControl RadarEmailSecuritySummaryMaliciousParamsDateRange = "24wControl"
-)
-
-type RadarEmailSecuritySummaryMaliciousParamsDKIM string
-
-const (
- RadarEmailSecuritySummaryMaliciousParamsDKIMPass RadarEmailSecuritySummaryMaliciousParamsDKIM = "PASS"
- RadarEmailSecuritySummaryMaliciousParamsDKIMNone RadarEmailSecuritySummaryMaliciousParamsDKIM = "NONE"
- RadarEmailSecuritySummaryMaliciousParamsDKIMFail RadarEmailSecuritySummaryMaliciousParamsDKIM = "FAIL"
-)
-
-type RadarEmailSecuritySummaryMaliciousParamsDMARC string
-
-const (
- RadarEmailSecuritySummaryMaliciousParamsDMARCPass RadarEmailSecuritySummaryMaliciousParamsDMARC = "PASS"
- RadarEmailSecuritySummaryMaliciousParamsDMARCNone RadarEmailSecuritySummaryMaliciousParamsDMARC = "NONE"
- RadarEmailSecuritySummaryMaliciousParamsDMARCFail RadarEmailSecuritySummaryMaliciousParamsDMARC = "FAIL"
-)
-
-// Format results are returned in.
-type RadarEmailSecuritySummaryMaliciousParamsFormat string
-
-const (
- RadarEmailSecuritySummaryMaliciousParamsFormatJson RadarEmailSecuritySummaryMaliciousParamsFormat = "JSON"
- RadarEmailSecuritySummaryMaliciousParamsFormatCsv RadarEmailSecuritySummaryMaliciousParamsFormat = "CSV"
-)
-
-type RadarEmailSecuritySummaryMaliciousParamsSPF string
-
-const (
- RadarEmailSecuritySummaryMaliciousParamsSPFPass RadarEmailSecuritySummaryMaliciousParamsSPF = "PASS"
- RadarEmailSecuritySummaryMaliciousParamsSPFNone RadarEmailSecuritySummaryMaliciousParamsSPF = "NONE"
- 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"`
- JSON radarEmailSecuritySummaryMaliciousResponseEnvelopeJSON `json:"-"`
-}
-
-// radarEmailSecuritySummaryMaliciousResponseEnvelopeJSON contains the JSON
-// metadata for the struct [RadarEmailSecuritySummaryMaliciousResponseEnvelope]
-type radarEmailSecuritySummaryMaliciousResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecuritySummaryMaliciousResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecuritySummaryMaliciousResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecuritySummarySpamParams struct {
- // Filter for arc (Authenticated Received Chain).
- ARC param.Field[[]RadarEmailSecuritySummarySpamParamsARC] `query:"arc"`
- // 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[[]RadarEmailSecuritySummarySpamParamsDateRange] `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[[]RadarEmailSecuritySummarySpamParamsDKIM] `query:"dkim"`
- // Filter for dmarc.
- DMARC param.Field[[]RadarEmailSecuritySummarySpamParamsDMARC] `query:"dmarc"`
- // Format results are returned in.
- Format param.Field[RadarEmailSecuritySummarySpamParamsFormat] `query:"format"`
- // 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
-// `url.Values`.
-func (r RadarEmailSecuritySummarySpamParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type RadarEmailSecuritySummarySpamParamsARC string
-
-const (
- RadarEmailSecuritySummarySpamParamsARCPass RadarEmailSecuritySummarySpamParamsARC = "PASS"
- RadarEmailSecuritySummarySpamParamsARCNone RadarEmailSecuritySummarySpamParamsARC = "NONE"
- RadarEmailSecuritySummarySpamParamsARCFail RadarEmailSecuritySummarySpamParamsARC = "FAIL"
-)
-
-type RadarEmailSecuritySummarySpamParamsDateRange string
-
-const (
- RadarEmailSecuritySummarySpamParamsDateRange1d RadarEmailSecuritySummarySpamParamsDateRange = "1d"
- RadarEmailSecuritySummarySpamParamsDateRange2d RadarEmailSecuritySummarySpamParamsDateRange = "2d"
- RadarEmailSecuritySummarySpamParamsDateRange7d RadarEmailSecuritySummarySpamParamsDateRange = "7d"
- RadarEmailSecuritySummarySpamParamsDateRange14d RadarEmailSecuritySummarySpamParamsDateRange = "14d"
- RadarEmailSecuritySummarySpamParamsDateRange28d RadarEmailSecuritySummarySpamParamsDateRange = "28d"
- RadarEmailSecuritySummarySpamParamsDateRange12w RadarEmailSecuritySummarySpamParamsDateRange = "12w"
- RadarEmailSecuritySummarySpamParamsDateRange24w RadarEmailSecuritySummarySpamParamsDateRange = "24w"
- RadarEmailSecuritySummarySpamParamsDateRange52w RadarEmailSecuritySummarySpamParamsDateRange = "52w"
- RadarEmailSecuritySummarySpamParamsDateRange1dControl RadarEmailSecuritySummarySpamParamsDateRange = "1dControl"
- RadarEmailSecuritySummarySpamParamsDateRange2dControl RadarEmailSecuritySummarySpamParamsDateRange = "2dControl"
- RadarEmailSecuritySummarySpamParamsDateRange7dControl RadarEmailSecuritySummarySpamParamsDateRange = "7dControl"
- RadarEmailSecuritySummarySpamParamsDateRange14dControl RadarEmailSecuritySummarySpamParamsDateRange = "14dControl"
- RadarEmailSecuritySummarySpamParamsDateRange28dControl RadarEmailSecuritySummarySpamParamsDateRange = "28dControl"
- RadarEmailSecuritySummarySpamParamsDateRange12wControl RadarEmailSecuritySummarySpamParamsDateRange = "12wControl"
- RadarEmailSecuritySummarySpamParamsDateRange24wControl RadarEmailSecuritySummarySpamParamsDateRange = "24wControl"
-)
-
-type RadarEmailSecuritySummarySpamParamsDKIM string
-
-const (
- RadarEmailSecuritySummarySpamParamsDKIMPass RadarEmailSecuritySummarySpamParamsDKIM = "PASS"
- RadarEmailSecuritySummarySpamParamsDKIMNone RadarEmailSecuritySummarySpamParamsDKIM = "NONE"
- RadarEmailSecuritySummarySpamParamsDKIMFail RadarEmailSecuritySummarySpamParamsDKIM = "FAIL"
-)
-
-type RadarEmailSecuritySummarySpamParamsDMARC string
-
-const (
- RadarEmailSecuritySummarySpamParamsDMARCPass RadarEmailSecuritySummarySpamParamsDMARC = "PASS"
- RadarEmailSecuritySummarySpamParamsDMARCNone RadarEmailSecuritySummarySpamParamsDMARC = "NONE"
- RadarEmailSecuritySummarySpamParamsDMARCFail RadarEmailSecuritySummarySpamParamsDMARC = "FAIL"
-)
-
-// Format results are returned in.
-type RadarEmailSecuritySummarySpamParamsFormat string
-
-const (
- RadarEmailSecuritySummarySpamParamsFormatJson RadarEmailSecuritySummarySpamParamsFormat = "JSON"
- RadarEmailSecuritySummarySpamParamsFormatCsv RadarEmailSecuritySummarySpamParamsFormat = "CSV"
-)
-
-type RadarEmailSecuritySummarySpamParamsSPF string
-
-const (
- RadarEmailSecuritySummarySpamParamsSPFPass RadarEmailSecuritySummarySpamParamsSPF = "PASS"
- RadarEmailSecuritySummarySpamParamsSPFNone RadarEmailSecuritySummarySpamParamsSPF = "NONE"
- 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"`
- JSON radarEmailSecuritySummarySpamResponseEnvelopeJSON `json:"-"`
-}
-
-// radarEmailSecuritySummarySpamResponseEnvelopeJSON contains the JSON metadata for
-// the struct [RadarEmailSecuritySummarySpamResponseEnvelope]
-type radarEmailSecuritySummarySpamResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecuritySummarySpamResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecuritySummarySpamResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecuritySummarySPFParams struct {
- // Filter for arc (Authenticated Received Chain).
- ARC param.Field[[]RadarEmailSecuritySummarySPFParamsARC] `query:"arc"`
- // 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[[]RadarEmailSecuritySummarySPFParamsDateRange] `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[[]RadarEmailSecuritySummarySPFParamsDKIM] `query:"dkim"`
- // Filter for dmarc.
- DMARC param.Field[[]RadarEmailSecuritySummarySPFParamsDMARC] `query:"dmarc"`
- // Format results are returned in.
- Format param.Field[RadarEmailSecuritySummarySPFParamsFormat] `query:"format"`
- // 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
-// `url.Values`.
-func (r RadarEmailSecuritySummarySPFParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type RadarEmailSecuritySummarySPFParamsARC string
-
-const (
- RadarEmailSecuritySummarySPFParamsARCPass RadarEmailSecuritySummarySPFParamsARC = "PASS"
- RadarEmailSecuritySummarySPFParamsARCNone RadarEmailSecuritySummarySPFParamsARC = "NONE"
- RadarEmailSecuritySummarySPFParamsARCFail RadarEmailSecuritySummarySPFParamsARC = "FAIL"
-)
-
-type RadarEmailSecuritySummarySPFParamsDateRange string
-
-const (
- RadarEmailSecuritySummarySPFParamsDateRange1d RadarEmailSecuritySummarySPFParamsDateRange = "1d"
- RadarEmailSecuritySummarySPFParamsDateRange2d RadarEmailSecuritySummarySPFParamsDateRange = "2d"
- RadarEmailSecuritySummarySPFParamsDateRange7d RadarEmailSecuritySummarySPFParamsDateRange = "7d"
- RadarEmailSecuritySummarySPFParamsDateRange14d RadarEmailSecuritySummarySPFParamsDateRange = "14d"
- RadarEmailSecuritySummarySPFParamsDateRange28d RadarEmailSecuritySummarySPFParamsDateRange = "28d"
- RadarEmailSecuritySummarySPFParamsDateRange12w RadarEmailSecuritySummarySPFParamsDateRange = "12w"
- RadarEmailSecuritySummarySPFParamsDateRange24w RadarEmailSecuritySummarySPFParamsDateRange = "24w"
- RadarEmailSecuritySummarySPFParamsDateRange52w RadarEmailSecuritySummarySPFParamsDateRange = "52w"
- RadarEmailSecuritySummarySPFParamsDateRange1dControl RadarEmailSecuritySummarySPFParamsDateRange = "1dControl"
- RadarEmailSecuritySummarySPFParamsDateRange2dControl RadarEmailSecuritySummarySPFParamsDateRange = "2dControl"
- RadarEmailSecuritySummarySPFParamsDateRange7dControl RadarEmailSecuritySummarySPFParamsDateRange = "7dControl"
- RadarEmailSecuritySummarySPFParamsDateRange14dControl RadarEmailSecuritySummarySPFParamsDateRange = "14dControl"
- RadarEmailSecuritySummarySPFParamsDateRange28dControl RadarEmailSecuritySummarySPFParamsDateRange = "28dControl"
- RadarEmailSecuritySummarySPFParamsDateRange12wControl RadarEmailSecuritySummarySPFParamsDateRange = "12wControl"
- RadarEmailSecuritySummarySPFParamsDateRange24wControl RadarEmailSecuritySummarySPFParamsDateRange = "24wControl"
-)
-
-type RadarEmailSecuritySummarySPFParamsDKIM string
-
-const (
- RadarEmailSecuritySummarySPFParamsDKIMPass RadarEmailSecuritySummarySPFParamsDKIM = "PASS"
- RadarEmailSecuritySummarySPFParamsDKIMNone RadarEmailSecuritySummarySPFParamsDKIM = "NONE"
- RadarEmailSecuritySummarySPFParamsDKIMFail RadarEmailSecuritySummarySPFParamsDKIM = "FAIL"
-)
-
-type RadarEmailSecuritySummarySPFParamsDMARC string
-
-const (
- RadarEmailSecuritySummarySPFParamsDMARCPass RadarEmailSecuritySummarySPFParamsDMARC = "PASS"
- RadarEmailSecuritySummarySPFParamsDMARCNone RadarEmailSecuritySummarySPFParamsDMARC = "NONE"
- RadarEmailSecuritySummarySPFParamsDMARCFail RadarEmailSecuritySummarySPFParamsDMARC = "FAIL"
-)
-
-// Format results are returned in.
-type RadarEmailSecuritySummarySPFParamsFormat string
-
-const (
- RadarEmailSecuritySummarySPFParamsFormatJson RadarEmailSecuritySummarySPFParamsFormat = "JSON"
- 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"`
- JSON radarEmailSecuritySummarySPFResponseEnvelopeJSON `json:"-"`
-}
-
-// radarEmailSecuritySummarySPFResponseEnvelopeJSON contains the JSON metadata for
-// the struct [RadarEmailSecuritySummarySPFResponseEnvelope]
-type radarEmailSecuritySummarySPFResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecuritySummarySPFResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecuritySummarySPFResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecuritySummarySpoofParams struct {
- // Filter for arc (Authenticated Received Chain).
- ARC param.Field[[]RadarEmailSecuritySummarySpoofParamsARC] `query:"arc"`
- // 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[[]RadarEmailSecuritySummarySpoofParamsDateRange] `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[[]RadarEmailSecuritySummarySpoofParamsDKIM] `query:"dkim"`
- // Filter for dmarc.
- DMARC param.Field[[]RadarEmailSecuritySummarySpoofParamsDMARC] `query:"dmarc"`
- // Format results are returned in.
- Format param.Field[RadarEmailSecuritySummarySpoofParamsFormat] `query:"format"`
- // 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[[]RadarEmailSecuritySummarySpoofParamsSPF] `query:"spf"`
- // Filter for tls version.
- TLSVersion param.Field[[]RadarEmailSecuritySummarySpoofParamsTLSVersion] `query:"tlsVersion"`
-}
-
-// URLQuery serializes [RadarEmailSecuritySummarySpoofParams]'s query parameters as
-// `url.Values`.
-func (r RadarEmailSecuritySummarySpoofParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type RadarEmailSecuritySummarySpoofParamsARC string
-
-const (
- RadarEmailSecuritySummarySpoofParamsARCPass RadarEmailSecuritySummarySpoofParamsARC = "PASS"
- RadarEmailSecuritySummarySpoofParamsARCNone RadarEmailSecuritySummarySpoofParamsARC = "NONE"
- RadarEmailSecuritySummarySpoofParamsARCFail RadarEmailSecuritySummarySpoofParamsARC = "FAIL"
-)
-
-type RadarEmailSecuritySummarySpoofParamsDateRange string
-
-const (
- RadarEmailSecuritySummarySpoofParamsDateRange1d RadarEmailSecuritySummarySpoofParamsDateRange = "1d"
- RadarEmailSecuritySummarySpoofParamsDateRange2d RadarEmailSecuritySummarySpoofParamsDateRange = "2d"
- RadarEmailSecuritySummarySpoofParamsDateRange7d RadarEmailSecuritySummarySpoofParamsDateRange = "7d"
- RadarEmailSecuritySummarySpoofParamsDateRange14d RadarEmailSecuritySummarySpoofParamsDateRange = "14d"
- RadarEmailSecuritySummarySpoofParamsDateRange28d RadarEmailSecuritySummarySpoofParamsDateRange = "28d"
- RadarEmailSecuritySummarySpoofParamsDateRange12w RadarEmailSecuritySummarySpoofParamsDateRange = "12w"
- RadarEmailSecuritySummarySpoofParamsDateRange24w RadarEmailSecuritySummarySpoofParamsDateRange = "24w"
- RadarEmailSecuritySummarySpoofParamsDateRange52w RadarEmailSecuritySummarySpoofParamsDateRange = "52w"
- RadarEmailSecuritySummarySpoofParamsDateRange1dControl RadarEmailSecuritySummarySpoofParamsDateRange = "1dControl"
- RadarEmailSecuritySummarySpoofParamsDateRange2dControl RadarEmailSecuritySummarySpoofParamsDateRange = "2dControl"
- RadarEmailSecuritySummarySpoofParamsDateRange7dControl RadarEmailSecuritySummarySpoofParamsDateRange = "7dControl"
- RadarEmailSecuritySummarySpoofParamsDateRange14dControl RadarEmailSecuritySummarySpoofParamsDateRange = "14dControl"
- RadarEmailSecuritySummarySpoofParamsDateRange28dControl RadarEmailSecuritySummarySpoofParamsDateRange = "28dControl"
- RadarEmailSecuritySummarySpoofParamsDateRange12wControl RadarEmailSecuritySummarySpoofParamsDateRange = "12wControl"
- RadarEmailSecuritySummarySpoofParamsDateRange24wControl RadarEmailSecuritySummarySpoofParamsDateRange = "24wControl"
-)
-
-type RadarEmailSecuritySummarySpoofParamsDKIM string
-
-const (
- RadarEmailSecuritySummarySpoofParamsDKIMPass RadarEmailSecuritySummarySpoofParamsDKIM = "PASS"
- RadarEmailSecuritySummarySpoofParamsDKIMNone RadarEmailSecuritySummarySpoofParamsDKIM = "NONE"
- RadarEmailSecuritySummarySpoofParamsDKIMFail RadarEmailSecuritySummarySpoofParamsDKIM = "FAIL"
-)
-
-type RadarEmailSecuritySummarySpoofParamsDMARC string
-
-const (
- RadarEmailSecuritySummarySpoofParamsDMARCPass RadarEmailSecuritySummarySpoofParamsDMARC = "PASS"
- RadarEmailSecuritySummarySpoofParamsDMARCNone RadarEmailSecuritySummarySpoofParamsDMARC = "NONE"
- RadarEmailSecuritySummarySpoofParamsDMARCFail RadarEmailSecuritySummarySpoofParamsDMARC = "FAIL"
-)
-
-// Format results are returned in.
-type RadarEmailSecuritySummarySpoofParamsFormat string
-
-const (
- RadarEmailSecuritySummarySpoofParamsFormatJson RadarEmailSecuritySummarySpoofParamsFormat = "JSON"
- RadarEmailSecuritySummarySpoofParamsFormatCsv RadarEmailSecuritySummarySpoofParamsFormat = "CSV"
-)
-
-type RadarEmailSecuritySummarySpoofParamsSPF string
-
-const (
- RadarEmailSecuritySummarySpoofParamsSPFPass RadarEmailSecuritySummarySpoofParamsSPF = "PASS"
- RadarEmailSecuritySummarySpoofParamsSPFNone RadarEmailSecuritySummarySpoofParamsSPF = "NONE"
- RadarEmailSecuritySummarySpoofParamsSPFFail RadarEmailSecuritySummarySpoofParamsSPF = "FAIL"
-)
-
-type RadarEmailSecuritySummarySpoofParamsTLSVersion string
-
-const (
- RadarEmailSecuritySummarySpoofParamsTLSVersionTlSv1_0 RadarEmailSecuritySummarySpoofParamsTLSVersion = "TLSv1_0"
- RadarEmailSecuritySummarySpoofParamsTLSVersionTlSv1_1 RadarEmailSecuritySummarySpoofParamsTLSVersion = "TLSv1_1"
- RadarEmailSecuritySummarySpoofParamsTLSVersionTlSv1_2 RadarEmailSecuritySummarySpoofParamsTLSVersion = "TLSv1_2"
- RadarEmailSecuritySummarySpoofParamsTLSVersionTlSv1_3 RadarEmailSecuritySummarySpoofParamsTLSVersion = "TLSv1_3"
-)
-
-type RadarEmailSecuritySummarySpoofResponseEnvelope struct {
- Result RadarEmailSecuritySummarySpoofResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarEmailSecuritySummarySpoofResponseEnvelopeJSON `json:"-"`
-}
-
-// radarEmailSecuritySummarySpoofResponseEnvelopeJSON contains the JSON metadata
-// for the struct [RadarEmailSecuritySummarySpoofResponseEnvelope]
-type radarEmailSecuritySummarySpoofResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecuritySummarySpoofResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecuritySummarySpoofResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecuritySummaryThreatCategoryParams struct {
- // Filter for arc (Authenticated Received Chain).
- ARC param.Field[[]RadarEmailSecuritySummaryThreatCategoryParamsARC] `query:"arc"`
- // 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[[]RadarEmailSecuritySummaryThreatCategoryParamsDateRange] `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[[]RadarEmailSecuritySummaryThreatCategoryParamsDKIM] `query:"dkim"`
- // Filter for dmarc.
- DMARC param.Field[[]RadarEmailSecuritySummaryThreatCategoryParamsDMARC] `query:"dmarc"`
- // Format results are returned in.
- Format param.Field[RadarEmailSecuritySummaryThreatCategoryParamsFormat] `query:"format"`
- // 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
-// parameters as `url.Values`.
-func (r RadarEmailSecuritySummaryThreatCategoryParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type RadarEmailSecuritySummaryThreatCategoryParamsARC string
-
-const (
- RadarEmailSecuritySummaryThreatCategoryParamsARCPass RadarEmailSecuritySummaryThreatCategoryParamsARC = "PASS"
- RadarEmailSecuritySummaryThreatCategoryParamsARCNone RadarEmailSecuritySummaryThreatCategoryParamsARC = "NONE"
- RadarEmailSecuritySummaryThreatCategoryParamsARCFail RadarEmailSecuritySummaryThreatCategoryParamsARC = "FAIL"
-)
-
-type RadarEmailSecuritySummaryThreatCategoryParamsDateRange string
-
-const (
- RadarEmailSecuritySummaryThreatCategoryParamsDateRange1d RadarEmailSecuritySummaryThreatCategoryParamsDateRange = "1d"
- RadarEmailSecuritySummaryThreatCategoryParamsDateRange2d RadarEmailSecuritySummaryThreatCategoryParamsDateRange = "2d"
- RadarEmailSecuritySummaryThreatCategoryParamsDateRange7d RadarEmailSecuritySummaryThreatCategoryParamsDateRange = "7d"
- RadarEmailSecuritySummaryThreatCategoryParamsDateRange14d RadarEmailSecuritySummaryThreatCategoryParamsDateRange = "14d"
- RadarEmailSecuritySummaryThreatCategoryParamsDateRange28d RadarEmailSecuritySummaryThreatCategoryParamsDateRange = "28d"
- RadarEmailSecuritySummaryThreatCategoryParamsDateRange12w RadarEmailSecuritySummaryThreatCategoryParamsDateRange = "12w"
- RadarEmailSecuritySummaryThreatCategoryParamsDateRange24w RadarEmailSecuritySummaryThreatCategoryParamsDateRange = "24w"
- RadarEmailSecuritySummaryThreatCategoryParamsDateRange52w RadarEmailSecuritySummaryThreatCategoryParamsDateRange = "52w"
- RadarEmailSecuritySummaryThreatCategoryParamsDateRange1dControl RadarEmailSecuritySummaryThreatCategoryParamsDateRange = "1dControl"
- RadarEmailSecuritySummaryThreatCategoryParamsDateRange2dControl RadarEmailSecuritySummaryThreatCategoryParamsDateRange = "2dControl"
- RadarEmailSecuritySummaryThreatCategoryParamsDateRange7dControl RadarEmailSecuritySummaryThreatCategoryParamsDateRange = "7dControl"
- RadarEmailSecuritySummaryThreatCategoryParamsDateRange14dControl RadarEmailSecuritySummaryThreatCategoryParamsDateRange = "14dControl"
- RadarEmailSecuritySummaryThreatCategoryParamsDateRange28dControl RadarEmailSecuritySummaryThreatCategoryParamsDateRange = "28dControl"
- RadarEmailSecuritySummaryThreatCategoryParamsDateRange12wControl RadarEmailSecuritySummaryThreatCategoryParamsDateRange = "12wControl"
- RadarEmailSecuritySummaryThreatCategoryParamsDateRange24wControl RadarEmailSecuritySummaryThreatCategoryParamsDateRange = "24wControl"
-)
-
-type RadarEmailSecuritySummaryThreatCategoryParamsDKIM string
-
-const (
- RadarEmailSecuritySummaryThreatCategoryParamsDKIMPass RadarEmailSecuritySummaryThreatCategoryParamsDKIM = "PASS"
- RadarEmailSecuritySummaryThreatCategoryParamsDKIMNone RadarEmailSecuritySummaryThreatCategoryParamsDKIM = "NONE"
- RadarEmailSecuritySummaryThreatCategoryParamsDKIMFail RadarEmailSecuritySummaryThreatCategoryParamsDKIM = "FAIL"
-)
-
-type RadarEmailSecuritySummaryThreatCategoryParamsDMARC string
-
-const (
- RadarEmailSecuritySummaryThreatCategoryParamsDMARCPass RadarEmailSecuritySummaryThreatCategoryParamsDMARC = "PASS"
- RadarEmailSecuritySummaryThreatCategoryParamsDMARCNone RadarEmailSecuritySummaryThreatCategoryParamsDMARC = "NONE"
- RadarEmailSecuritySummaryThreatCategoryParamsDMARCFail RadarEmailSecuritySummaryThreatCategoryParamsDMARC = "FAIL"
-)
-
-// Format results are returned in.
-type RadarEmailSecuritySummaryThreatCategoryParamsFormat string
-
-const (
- RadarEmailSecuritySummaryThreatCategoryParamsFormatJson RadarEmailSecuritySummaryThreatCategoryParamsFormat = "JSON"
- RadarEmailSecuritySummaryThreatCategoryParamsFormatCsv RadarEmailSecuritySummaryThreatCategoryParamsFormat = "CSV"
-)
-
-type RadarEmailSecuritySummaryThreatCategoryParamsSPF string
-
-const (
- RadarEmailSecuritySummaryThreatCategoryParamsSPFPass RadarEmailSecuritySummaryThreatCategoryParamsSPF = "PASS"
- RadarEmailSecuritySummaryThreatCategoryParamsSPFNone RadarEmailSecuritySummaryThreatCategoryParamsSPF = "NONE"
- 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"`
- JSON radarEmailSecuritySummaryThreatCategoryResponseEnvelopeJSON `json:"-"`
-}
-
-// radarEmailSecuritySummaryThreatCategoryResponseEnvelopeJSON contains the JSON
-// metadata for the struct
-// [RadarEmailSecuritySummaryThreatCategoryResponseEnvelope]
-type radarEmailSecuritySummaryThreatCategoryResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecuritySummaryThreatCategoryResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecuritySummaryThreatCategoryResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecuritySummaryTLSVersionParams struct {
- // Filter for arc (Authenticated Received Chain).
- ARC param.Field[[]RadarEmailSecuritySummaryTLSVersionParamsARC] `query:"arc"`
- // 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[[]RadarEmailSecuritySummaryTLSVersionParamsDateRange] `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[[]RadarEmailSecuritySummaryTLSVersionParamsDKIM] `query:"dkim"`
- // Filter for dmarc.
- DMARC param.Field[[]RadarEmailSecuritySummaryTLSVersionParamsDMARC] `query:"dmarc"`
- // Format results are returned in.
- Format param.Field[RadarEmailSecuritySummaryTLSVersionParamsFormat] `query:"format"`
- // 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[[]RadarEmailSecuritySummaryTLSVersionParamsSPF] `query:"spf"`
-}
-
-// URLQuery serializes [RadarEmailSecuritySummaryTLSVersionParams]'s query
-// parameters as `url.Values`.
-func (r RadarEmailSecuritySummaryTLSVersionParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type RadarEmailSecuritySummaryTLSVersionParamsARC string
-
-const (
- RadarEmailSecuritySummaryTLSVersionParamsARCPass RadarEmailSecuritySummaryTLSVersionParamsARC = "PASS"
- RadarEmailSecuritySummaryTLSVersionParamsARCNone RadarEmailSecuritySummaryTLSVersionParamsARC = "NONE"
- RadarEmailSecuritySummaryTLSVersionParamsARCFail RadarEmailSecuritySummaryTLSVersionParamsARC = "FAIL"
-)
-
-type RadarEmailSecuritySummaryTLSVersionParamsDateRange string
-
-const (
- RadarEmailSecuritySummaryTLSVersionParamsDateRange1d RadarEmailSecuritySummaryTLSVersionParamsDateRange = "1d"
- RadarEmailSecuritySummaryTLSVersionParamsDateRange2d RadarEmailSecuritySummaryTLSVersionParamsDateRange = "2d"
- RadarEmailSecuritySummaryTLSVersionParamsDateRange7d RadarEmailSecuritySummaryTLSVersionParamsDateRange = "7d"
- RadarEmailSecuritySummaryTLSVersionParamsDateRange14d RadarEmailSecuritySummaryTLSVersionParamsDateRange = "14d"
- RadarEmailSecuritySummaryTLSVersionParamsDateRange28d RadarEmailSecuritySummaryTLSVersionParamsDateRange = "28d"
- RadarEmailSecuritySummaryTLSVersionParamsDateRange12w RadarEmailSecuritySummaryTLSVersionParamsDateRange = "12w"
- RadarEmailSecuritySummaryTLSVersionParamsDateRange24w RadarEmailSecuritySummaryTLSVersionParamsDateRange = "24w"
- RadarEmailSecuritySummaryTLSVersionParamsDateRange52w RadarEmailSecuritySummaryTLSVersionParamsDateRange = "52w"
- RadarEmailSecuritySummaryTLSVersionParamsDateRange1dControl RadarEmailSecuritySummaryTLSVersionParamsDateRange = "1dControl"
- RadarEmailSecuritySummaryTLSVersionParamsDateRange2dControl RadarEmailSecuritySummaryTLSVersionParamsDateRange = "2dControl"
- RadarEmailSecuritySummaryTLSVersionParamsDateRange7dControl RadarEmailSecuritySummaryTLSVersionParamsDateRange = "7dControl"
- RadarEmailSecuritySummaryTLSVersionParamsDateRange14dControl RadarEmailSecuritySummaryTLSVersionParamsDateRange = "14dControl"
- RadarEmailSecuritySummaryTLSVersionParamsDateRange28dControl RadarEmailSecuritySummaryTLSVersionParamsDateRange = "28dControl"
- RadarEmailSecuritySummaryTLSVersionParamsDateRange12wControl RadarEmailSecuritySummaryTLSVersionParamsDateRange = "12wControl"
- RadarEmailSecuritySummaryTLSVersionParamsDateRange24wControl RadarEmailSecuritySummaryTLSVersionParamsDateRange = "24wControl"
-)
-
-type RadarEmailSecuritySummaryTLSVersionParamsDKIM string
-
-const (
- RadarEmailSecuritySummaryTLSVersionParamsDKIMPass RadarEmailSecuritySummaryTLSVersionParamsDKIM = "PASS"
- RadarEmailSecuritySummaryTLSVersionParamsDKIMNone RadarEmailSecuritySummaryTLSVersionParamsDKIM = "NONE"
- RadarEmailSecuritySummaryTLSVersionParamsDKIMFail RadarEmailSecuritySummaryTLSVersionParamsDKIM = "FAIL"
-)
-
-type RadarEmailSecuritySummaryTLSVersionParamsDMARC string
-
-const (
- RadarEmailSecuritySummaryTLSVersionParamsDMARCPass RadarEmailSecuritySummaryTLSVersionParamsDMARC = "PASS"
- RadarEmailSecuritySummaryTLSVersionParamsDMARCNone RadarEmailSecuritySummaryTLSVersionParamsDMARC = "NONE"
- RadarEmailSecuritySummaryTLSVersionParamsDMARCFail RadarEmailSecuritySummaryTLSVersionParamsDMARC = "FAIL"
-)
-
-// Format results are returned in.
-type RadarEmailSecuritySummaryTLSVersionParamsFormat string
-
-const (
- RadarEmailSecuritySummaryTLSVersionParamsFormatJson RadarEmailSecuritySummaryTLSVersionParamsFormat = "JSON"
- RadarEmailSecuritySummaryTLSVersionParamsFormatCsv RadarEmailSecuritySummaryTLSVersionParamsFormat = "CSV"
-)
-
-type RadarEmailSecuritySummaryTLSVersionParamsSPF string
-
-const (
- RadarEmailSecuritySummaryTLSVersionParamsSPFPass RadarEmailSecuritySummaryTLSVersionParamsSPF = "PASS"
- RadarEmailSecuritySummaryTLSVersionParamsSPFNone RadarEmailSecuritySummaryTLSVersionParamsSPF = "NONE"
- RadarEmailSecuritySummaryTLSVersionParamsSPFFail RadarEmailSecuritySummaryTLSVersionParamsSPF = "FAIL"
-)
-
-type RadarEmailSecuritySummaryTLSVersionResponseEnvelope struct {
- Result RadarEmailSecuritySummaryTLSVersionResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarEmailSecuritySummaryTLSVersionResponseEnvelopeJSON `json:"-"`
-}
-
-// radarEmailSecuritySummaryTLSVersionResponseEnvelopeJSON contains the JSON
-// metadata for the struct [RadarEmailSecuritySummaryTLSVersionResponseEnvelope]
-type radarEmailSecuritySummaryTLSVersionResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecuritySummaryTLSVersionResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecuritySummaryTLSVersionResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
diff --git a/radaremailsecuritysummary_test.go b/radaremailsecuritysummary_test.go
deleted file mode 100644
index 74cf5da7212..00000000000
--- a/radaremailsecuritysummary_test.go
+++ /dev/null
@@ -1,325 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
- "time"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRadarEmailSecuritySummaryARCWithOptionalParams(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"),
- )
- _, err := client.Radar.Email.Security.Summary.ARC(context.TODO(), cloudflare.RadarEmailSecuritySummaryARCParams{
- 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
- if errors.As(err, &apierr) {
- t.Log(string(apierr.DumpRequest(true)))
- }
- t.Fatalf("err should be nil: %s", err.Error())
- }
-}
-
-func TestRadarEmailSecuritySummaryDKIMWithOptionalParams(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"),
- )
- _, err := client.Radar.Email.Security.Summary.DKIM(context.TODO(), cloudflare.RadarEmailSecuritySummaryDKIMParams{
- 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
- if errors.As(err, &apierr) {
- t.Log(string(apierr.DumpRequest(true)))
- }
- t.Fatalf("err should be nil: %s", err.Error())
- }
-}
-
-func TestRadarEmailSecuritySummaryDMARCWithOptionalParams(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"),
- )
- _, err := client.Radar.Email.Security.Summary.DMARC(context.TODO(), cloudflare.RadarEmailSecuritySummaryDMARCParams{
- 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
- if errors.As(err, &apierr) {
- t.Log(string(apierr.DumpRequest(true)))
- }
- t.Fatalf("err should be nil: %s", err.Error())
- }
-}
-
-func TestRadarEmailSecuritySummaryMaliciousWithOptionalParams(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"),
- )
- _, err := client.Radar.Email.Security.Summary.Malicious(context.TODO(), cloudflare.RadarEmailSecuritySummaryMaliciousParams{
- 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
- if errors.As(err, &apierr) {
- t.Log(string(apierr.DumpRequest(true)))
- }
- t.Fatalf("err should be nil: %s", err.Error())
- }
-}
-
-func TestRadarEmailSecuritySummarySpamWithOptionalParams(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"),
- )
- _, err := client.Radar.Email.Security.Summary.Spam(context.TODO(), cloudflare.RadarEmailSecuritySummarySpamParams{
- 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
- if errors.As(err, &apierr) {
- t.Log(string(apierr.DumpRequest(true)))
- }
- t.Fatalf("err should be nil: %s", err.Error())
- }
-}
-
-func TestRadarEmailSecuritySummarySPFWithOptionalParams(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"),
- )
- _, err := client.Radar.Email.Security.Summary.SPF(context.TODO(), cloudflare.RadarEmailSecuritySummarySPFParams{
- 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
- if errors.As(err, &apierr) {
- t.Log(string(apierr.DumpRequest(true)))
- }
- t.Fatalf("err should be nil: %s", err.Error())
- }
-}
-
-func TestRadarEmailSecuritySummarySpoofWithOptionalParams(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"),
- )
- _, err := client.Radar.Email.Security.Summary.Spoof(context.TODO(), cloudflare.RadarEmailSecuritySummarySpoofParams{
- ARC: cloudflare.F([]cloudflare.RadarEmailSecuritySummarySpoofParamsARC{cloudflare.RadarEmailSecuritySummarySpoofParamsARCPass, cloudflare.RadarEmailSecuritySummarySpoofParamsARCNone, cloudflare.RadarEmailSecuritySummarySpoofParamsARCFail}),
- DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
- DateRange: cloudflare.F([]cloudflare.RadarEmailSecuritySummarySpoofParamsDateRange{cloudflare.RadarEmailSecuritySummarySpoofParamsDateRange1d, cloudflare.RadarEmailSecuritySummarySpoofParamsDateRange2d, cloudflare.RadarEmailSecuritySummarySpoofParamsDateRange7d}),
- DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
- DKIM: cloudflare.F([]cloudflare.RadarEmailSecuritySummarySpoofParamsDKIM{cloudflare.RadarEmailSecuritySummarySpoofParamsDKIMPass, cloudflare.RadarEmailSecuritySummarySpoofParamsDKIMNone, cloudflare.RadarEmailSecuritySummarySpoofParamsDKIMFail}),
- DMARC: cloudflare.F([]cloudflare.RadarEmailSecuritySummarySpoofParamsDMARC{cloudflare.RadarEmailSecuritySummarySpoofParamsDMARCPass, cloudflare.RadarEmailSecuritySummarySpoofParamsDMARCNone, cloudflare.RadarEmailSecuritySummarySpoofParamsDMARCFail}),
- Format: cloudflare.F(cloudflare.RadarEmailSecuritySummarySpoofParamsFormatJson),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- SPF: cloudflare.F([]cloudflare.RadarEmailSecuritySummarySpoofParamsSPF{cloudflare.RadarEmailSecuritySummarySpoofParamsSPFPass, cloudflare.RadarEmailSecuritySummarySpoofParamsSPFNone, cloudflare.RadarEmailSecuritySummarySpoofParamsSPFFail}),
- TLSVersion: cloudflare.F([]cloudflare.RadarEmailSecuritySummarySpoofParamsTLSVersion{cloudflare.RadarEmailSecuritySummarySpoofParamsTLSVersionTlSv1_0, cloudflare.RadarEmailSecuritySummarySpoofParamsTLSVersionTlSv1_1, cloudflare.RadarEmailSecuritySummarySpoofParamsTLSVersionTlSv1_2}),
- })
- 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())
- }
-}
-
-func TestRadarEmailSecuritySummaryThreatCategoryWithOptionalParams(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"),
- )
- _, err := client.Radar.Email.Security.Summary.ThreatCategory(context.TODO(), cloudflare.RadarEmailSecuritySummaryThreatCategoryParams{
- 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
- if errors.As(err, &apierr) {
- t.Log(string(apierr.DumpRequest(true)))
- }
- t.Fatalf("err should be nil: %s", err.Error())
- }
-}
-
-func TestRadarEmailSecuritySummaryTLSVersionWithOptionalParams(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"),
- )
- _, err := client.Radar.Email.Security.Summary.TLSVersion(context.TODO(), cloudflare.RadarEmailSecuritySummaryTLSVersionParams{
- ARC: cloudflare.F([]cloudflare.RadarEmailSecuritySummaryTLSVersionParamsARC{cloudflare.RadarEmailSecuritySummaryTLSVersionParamsARCPass, cloudflare.RadarEmailSecuritySummaryTLSVersionParamsARCNone, cloudflare.RadarEmailSecuritySummaryTLSVersionParamsARCFail}),
- DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
- DateRange: cloudflare.F([]cloudflare.RadarEmailSecuritySummaryTLSVersionParamsDateRange{cloudflare.RadarEmailSecuritySummaryTLSVersionParamsDateRange1d, cloudflare.RadarEmailSecuritySummaryTLSVersionParamsDateRange2d, cloudflare.RadarEmailSecuritySummaryTLSVersionParamsDateRange7d}),
- DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
- DKIM: cloudflare.F([]cloudflare.RadarEmailSecuritySummaryTLSVersionParamsDKIM{cloudflare.RadarEmailSecuritySummaryTLSVersionParamsDKIMPass, cloudflare.RadarEmailSecuritySummaryTLSVersionParamsDKIMNone, cloudflare.RadarEmailSecuritySummaryTLSVersionParamsDKIMFail}),
- DMARC: cloudflare.F([]cloudflare.RadarEmailSecuritySummaryTLSVersionParamsDMARC{cloudflare.RadarEmailSecuritySummaryTLSVersionParamsDMARCPass, cloudflare.RadarEmailSecuritySummaryTLSVersionParamsDMARCNone, cloudflare.RadarEmailSecuritySummaryTLSVersionParamsDMARCFail}),
- Format: cloudflare.F(cloudflare.RadarEmailSecuritySummaryTLSVersionParamsFormatJson),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- SPF: cloudflare.F([]cloudflare.RadarEmailSecuritySummaryTLSVersionParamsSPF{cloudflare.RadarEmailSecuritySummaryTLSVersionParamsSPFPass, cloudflare.RadarEmailSecuritySummaryTLSVersionParamsSPFNone, cloudflare.RadarEmailSecuritySummaryTLSVersionParamsSPFFail}),
- })
- 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/radaremailsecuritytimeseriesgroup.go b/radaremailsecuritytimeseriesgroup.go
deleted file mode 100644
index a07b16adb3e..00000000000
--- a/radaremailsecuritytimeseriesgroup.go
+++ /dev/null
@@ -1,1815 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarEmailSecurityTimeseriesGroupService contains methods and other services
-// that help with interacting with the cloudflare API. Note, unlike clients, this
-// service does not read variables from the environment automatically. You should
-// not instantiate this service directly, and instead use the
-// [NewRadarEmailSecurityTimeseriesGroupService] method instead.
-type RadarEmailSecurityTimeseriesGroupService struct {
- Options []option.RequestOption
-}
-
-// NewRadarEmailSecurityTimeseriesGroupService generates a new service that applies
-// the given options to each request. These options are applied after the parent
-// client's options (if there is one), and before any request-specific options.
-func NewRadarEmailSecurityTimeseriesGroupService(opts ...option.RequestOption) (r *RadarEmailSecurityTimeseriesGroupService) {
- r = &RadarEmailSecurityTimeseriesGroupService{}
- r.Options = opts
- return
-}
-
-// Percentage distribution of emails classified per Arc validation over time.
-func (r *RadarEmailSecurityTimeseriesGroupService) ARC(ctx context.Context, query RadarEmailSecurityTimeseriesGroupARCParams, opts ...option.RequestOption) (res *RadarEmailSecurityTimeseriesGroupARCResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarEmailSecurityTimeseriesGroupARCResponseEnvelope
- path := "radar/email/security/timeseries_groups/arc"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Percentage distribution of emails classified per DKIM validation over time.
-func (r *RadarEmailSecurityTimeseriesGroupService) DKIM(ctx context.Context, query RadarEmailSecurityTimeseriesGroupDKIMParams, opts ...option.RequestOption) (res *RadarEmailSecurityTimeseriesGroupDKIMResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarEmailSecurityTimeseriesGroupDKIMResponseEnvelope
- path := "radar/email/security/timeseries_groups/dkim"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Percentage distribution of emails classified per DMARC validation over time.
-func (r *RadarEmailSecurityTimeseriesGroupService) DMARC(ctx context.Context, query RadarEmailSecurityTimeseriesGroupDMARCParams, opts ...option.RequestOption) (res *RadarEmailSecurityTimeseriesGroupDMARCResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarEmailSecurityTimeseriesGroupDMARCResponseEnvelope
- path := "radar/email/security/timeseries_groups/dmarc"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Percentage distribution of emails classified as MALICIOUS over time.
-func (r *RadarEmailSecurityTimeseriesGroupService) Malicious(ctx context.Context, query RadarEmailSecurityTimeseriesGroupMaliciousParams, opts ...option.RequestOption) (res *RadarEmailSecurityTimeseriesGroupMaliciousResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarEmailSecurityTimeseriesGroupMaliciousResponseEnvelope
- path := "radar/email/security/timeseries_groups/malicious"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Percentage distribution of emails classified as SPAM over time.
-func (r *RadarEmailSecurityTimeseriesGroupService) Spam(ctx context.Context, query RadarEmailSecurityTimeseriesGroupSpamParams, opts ...option.RequestOption) (res *RadarEmailSecurityTimeseriesGroupSpamResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarEmailSecurityTimeseriesGroupSpamResponseEnvelope
- path := "radar/email/security/timeseries_groups/spam"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Percentage distribution of emails classified per SPF validation over time.
-func (r *RadarEmailSecurityTimeseriesGroupService) SPF(ctx context.Context, query RadarEmailSecurityTimeseriesGroupSPFParams, opts ...option.RequestOption) (res *RadarEmailSecurityTimeseriesGroupSPFResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarEmailSecurityTimeseriesGroupSPFResponseEnvelope
- path := "radar/email/security/timeseries_groups/spf"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Percentage distribution of emails classified as SPOOF over time.
-func (r *RadarEmailSecurityTimeseriesGroupService) Spoof(ctx context.Context, query RadarEmailSecurityTimeseriesGroupSpoofParams, opts ...option.RequestOption) (res *RadarEmailSecurityTimeseriesGroupSpoofResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarEmailSecurityTimeseriesGroupSpoofResponseEnvelope
- path := "radar/email/security/timeseries_groups/spoof"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Percentage distribution of emails classified in Threat Categories over time.
-func (r *RadarEmailSecurityTimeseriesGroupService) ThreatCategory(ctx context.Context, query RadarEmailSecurityTimeseriesGroupThreatCategoryParams, opts ...option.RequestOption) (res *RadarEmailSecurityTimeseriesGroupThreatCategoryResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarEmailSecurityTimeseriesGroupThreatCategoryResponseEnvelope
- path := "radar/email/security/timeseries_groups/threat_category"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Percentage distribution of emails classified per TLS Version over time.
-func (r *RadarEmailSecurityTimeseriesGroupService) TLSVersion(ctx context.Context, query RadarEmailSecurityTimeseriesGroupTLSVersionParams, opts ...option.RequestOption) (res *RadarEmailSecurityTimeseriesGroupTLSVersionResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarEmailSecurityTimeseriesGroupTLSVersionResponseEnvelope
- path := "radar/email/security/timeseries_groups/tls_version"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type RadarEmailSecurityTimeseriesGroupARCResponse struct {
- Meta interface{} `json:"meta,required"`
- Serie0 RadarEmailSecurityTimeseriesGroupARCResponseSerie0 `json:"serie_0,required"`
- JSON radarEmailSecurityTimeseriesGroupARCResponseJSON `json:"-"`
-}
-
-// radarEmailSecurityTimeseriesGroupARCResponseJSON contains the JSON metadata for
-// the struct [RadarEmailSecurityTimeseriesGroupARCResponse]
-type radarEmailSecurityTimeseriesGroupARCResponseJSON struct {
- Meta apijson.Field
- Serie0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecurityTimeseriesGroupARCResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecurityTimeseriesGroupARCResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecurityTimeseriesGroupARCResponseSerie0 struct {
- Fail []string `json:"FAIL,required"`
- None []string `json:"NONE,required"`
- Pass []string `json:"PASS,required"`
- JSON radarEmailSecurityTimeseriesGroupARCResponseSerie0JSON `json:"-"`
-}
-
-// radarEmailSecurityTimeseriesGroupARCResponseSerie0JSON contains the JSON
-// metadata for the struct [RadarEmailSecurityTimeseriesGroupARCResponseSerie0]
-type radarEmailSecurityTimeseriesGroupARCResponseSerie0JSON struct {
- Fail apijson.Field
- None apijson.Field
- Pass apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecurityTimeseriesGroupARCResponseSerie0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecurityTimeseriesGroupARCResponseSerie0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecurityTimeseriesGroupDKIMResponse struct {
- Meta interface{} `json:"meta,required"`
- Serie0 RadarEmailSecurityTimeseriesGroupDKIMResponseSerie0 `json:"serie_0,required"`
- JSON radarEmailSecurityTimeseriesGroupDKIMResponseJSON `json:"-"`
-}
-
-// radarEmailSecurityTimeseriesGroupDKIMResponseJSON contains the JSON metadata for
-// the struct [RadarEmailSecurityTimeseriesGroupDKIMResponse]
-type radarEmailSecurityTimeseriesGroupDKIMResponseJSON struct {
- Meta apijson.Field
- Serie0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecurityTimeseriesGroupDKIMResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecurityTimeseriesGroupDKIMResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecurityTimeseriesGroupDKIMResponseSerie0 struct {
- Fail []string `json:"FAIL,required"`
- None []string `json:"NONE,required"`
- Pass []string `json:"PASS,required"`
- JSON radarEmailSecurityTimeseriesGroupDKIMResponseSerie0JSON `json:"-"`
-}
-
-// radarEmailSecurityTimeseriesGroupDKIMResponseSerie0JSON contains the JSON
-// metadata for the struct [RadarEmailSecurityTimeseriesGroupDKIMResponseSerie0]
-type radarEmailSecurityTimeseriesGroupDKIMResponseSerie0JSON struct {
- Fail apijson.Field
- None apijson.Field
- Pass apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecurityTimeseriesGroupDKIMResponseSerie0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecurityTimeseriesGroupDKIMResponseSerie0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecurityTimeseriesGroupDMARCResponse struct {
- Meta interface{} `json:"meta,required"`
- Serie0 RadarEmailSecurityTimeseriesGroupDMARCResponseSerie0 `json:"serie_0,required"`
- JSON radarEmailSecurityTimeseriesGroupDMARCResponseJSON `json:"-"`
-}
-
-// radarEmailSecurityTimeseriesGroupDMARCResponseJSON contains the JSON metadata
-// for the struct [RadarEmailSecurityTimeseriesGroupDMARCResponse]
-type radarEmailSecurityTimeseriesGroupDMARCResponseJSON struct {
- Meta apijson.Field
- Serie0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecurityTimeseriesGroupDMARCResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecurityTimeseriesGroupDMARCResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecurityTimeseriesGroupDMARCResponseSerie0 struct {
- Fail []string `json:"FAIL,required"`
- None []string `json:"NONE,required"`
- Pass []string `json:"PASS,required"`
- JSON radarEmailSecurityTimeseriesGroupDMARCResponseSerie0JSON `json:"-"`
-}
-
-// radarEmailSecurityTimeseriesGroupDMARCResponseSerie0JSON contains the JSON
-// metadata for the struct [RadarEmailSecurityTimeseriesGroupDMARCResponseSerie0]
-type radarEmailSecurityTimeseriesGroupDMARCResponseSerie0JSON struct {
- Fail apijson.Field
- None apijson.Field
- Pass apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecurityTimeseriesGroupDMARCResponseSerie0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecurityTimeseriesGroupDMARCResponseSerie0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecurityTimeseriesGroupMaliciousResponse struct {
- Meta interface{} `json:"meta,required"`
- Serie0 RadarEmailSecurityTimeseriesGroupMaliciousResponseSerie0 `json:"serie_0,required"`
- JSON radarEmailSecurityTimeseriesGroupMaliciousResponseJSON `json:"-"`
-}
-
-// radarEmailSecurityTimeseriesGroupMaliciousResponseJSON contains the JSON
-// metadata for the struct [RadarEmailSecurityTimeseriesGroupMaliciousResponse]
-type radarEmailSecurityTimeseriesGroupMaliciousResponseJSON struct {
- Meta apijson.Field
- Serie0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecurityTimeseriesGroupMaliciousResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecurityTimeseriesGroupMaliciousResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecurityTimeseriesGroupMaliciousResponseSerie0 struct {
- Malicious []string `json:"MALICIOUS,required"`
- NotMalicious []string `json:"NOT_MALICIOUS,required"`
- JSON radarEmailSecurityTimeseriesGroupMaliciousResponseSerie0JSON `json:"-"`
-}
-
-// radarEmailSecurityTimeseriesGroupMaliciousResponseSerie0JSON contains the JSON
-// metadata for the struct
-// [RadarEmailSecurityTimeseriesGroupMaliciousResponseSerie0]
-type radarEmailSecurityTimeseriesGroupMaliciousResponseSerie0JSON struct {
- Malicious apijson.Field
- NotMalicious apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecurityTimeseriesGroupMaliciousResponseSerie0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecurityTimeseriesGroupMaliciousResponseSerie0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecurityTimeseriesGroupSpamResponse struct {
- Meta interface{} `json:"meta,required"`
- Serie0 RadarEmailSecurityTimeseriesGroupSpamResponseSerie0 `json:"serie_0,required"`
- JSON radarEmailSecurityTimeseriesGroupSpamResponseJSON `json:"-"`
-}
-
-// radarEmailSecurityTimeseriesGroupSpamResponseJSON contains the JSON metadata for
-// the struct [RadarEmailSecurityTimeseriesGroupSpamResponse]
-type radarEmailSecurityTimeseriesGroupSpamResponseJSON struct {
- Meta apijson.Field
- Serie0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecurityTimeseriesGroupSpamResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecurityTimeseriesGroupSpamResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecurityTimeseriesGroupSpamResponseSerie0 struct {
- NotSpam []string `json:"NOT_SPAM,required"`
- Spam []string `json:"SPAM,required"`
- JSON radarEmailSecurityTimeseriesGroupSpamResponseSerie0JSON `json:"-"`
-}
-
-// radarEmailSecurityTimeseriesGroupSpamResponseSerie0JSON contains the JSON
-// metadata for the struct [RadarEmailSecurityTimeseriesGroupSpamResponseSerie0]
-type radarEmailSecurityTimeseriesGroupSpamResponseSerie0JSON struct {
- NotSpam apijson.Field
- Spam apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecurityTimeseriesGroupSpamResponseSerie0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecurityTimeseriesGroupSpamResponseSerie0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecurityTimeseriesGroupSPFResponse struct {
- Meta interface{} `json:"meta,required"`
- Serie0 RadarEmailSecurityTimeseriesGroupSPFResponseSerie0 `json:"serie_0,required"`
- JSON radarEmailSecurityTimeseriesGroupSPFResponseJSON `json:"-"`
-}
-
-// radarEmailSecurityTimeseriesGroupSPFResponseJSON contains the JSON metadata for
-// the struct [RadarEmailSecurityTimeseriesGroupSPFResponse]
-type radarEmailSecurityTimeseriesGroupSPFResponseJSON struct {
- Meta apijson.Field
- Serie0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecurityTimeseriesGroupSPFResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecurityTimeseriesGroupSPFResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecurityTimeseriesGroupSPFResponseSerie0 struct {
- Fail []string `json:"FAIL,required"`
- None []string `json:"NONE,required"`
- Pass []string `json:"PASS,required"`
- JSON radarEmailSecurityTimeseriesGroupSPFResponseSerie0JSON `json:"-"`
-}
-
-// radarEmailSecurityTimeseriesGroupSPFResponseSerie0JSON contains the JSON
-// metadata for the struct [RadarEmailSecurityTimeseriesGroupSPFResponseSerie0]
-type radarEmailSecurityTimeseriesGroupSPFResponseSerie0JSON struct {
- Fail apijson.Field
- None apijson.Field
- Pass apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecurityTimeseriesGroupSPFResponseSerie0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecurityTimeseriesGroupSPFResponseSerie0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecurityTimeseriesGroupSpoofResponse struct {
- Meta interface{} `json:"meta,required"`
- Serie0 RadarEmailSecurityTimeseriesGroupSpoofResponseSerie0 `json:"serie_0,required"`
- JSON radarEmailSecurityTimeseriesGroupSpoofResponseJSON `json:"-"`
-}
-
-// radarEmailSecurityTimeseriesGroupSpoofResponseJSON contains the JSON metadata
-// for the struct [RadarEmailSecurityTimeseriesGroupSpoofResponse]
-type radarEmailSecurityTimeseriesGroupSpoofResponseJSON struct {
- Meta apijson.Field
- Serie0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecurityTimeseriesGroupSpoofResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecurityTimeseriesGroupSpoofResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecurityTimeseriesGroupSpoofResponseSerie0 struct {
- NotSpoof []string `json:"NOT_SPOOF,required"`
- Spoof []string `json:"SPOOF,required"`
- JSON radarEmailSecurityTimeseriesGroupSpoofResponseSerie0JSON `json:"-"`
-}
-
-// radarEmailSecurityTimeseriesGroupSpoofResponseSerie0JSON contains the JSON
-// metadata for the struct [RadarEmailSecurityTimeseriesGroupSpoofResponseSerie0]
-type radarEmailSecurityTimeseriesGroupSpoofResponseSerie0JSON struct {
- NotSpoof apijson.Field
- Spoof apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecurityTimeseriesGroupSpoofResponseSerie0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecurityTimeseriesGroupSpoofResponseSerie0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecurityTimeseriesGroupThreatCategoryResponse struct {
- Meta interface{} `json:"meta,required"`
- Serie0 RadarEmailSecurityTimeseriesGroupThreatCategoryResponseSerie0 `json:"serie_0,required"`
- JSON radarEmailSecurityTimeseriesGroupThreatCategoryResponseJSON `json:"-"`
-}
-
-// radarEmailSecurityTimeseriesGroupThreatCategoryResponseJSON contains the JSON
-// metadata for the struct
-// [RadarEmailSecurityTimeseriesGroupThreatCategoryResponse]
-type radarEmailSecurityTimeseriesGroupThreatCategoryResponseJSON struct {
- Meta apijson.Field
- Serie0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecurityTimeseriesGroupThreatCategoryResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecurityTimeseriesGroupThreatCategoryResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecurityTimeseriesGroupThreatCategoryResponseSerie0 struct {
- BrandImpersonation []string `json:"BrandImpersonation,required"`
- CredentialHarvester []string `json:"CredentialHarvester,required"`
- IdentityDeception []string `json:"IdentityDeception,required"`
- Link []string `json:"Link,required"`
- JSON radarEmailSecurityTimeseriesGroupThreatCategoryResponseSerie0JSON `json:"-"`
-}
-
-// radarEmailSecurityTimeseriesGroupThreatCategoryResponseSerie0JSON contains the
-// JSON metadata for the struct
-// [RadarEmailSecurityTimeseriesGroupThreatCategoryResponseSerie0]
-type radarEmailSecurityTimeseriesGroupThreatCategoryResponseSerie0JSON struct {
- BrandImpersonation apijson.Field
- CredentialHarvester apijson.Field
- IdentityDeception apijson.Field
- Link apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecurityTimeseriesGroupThreatCategoryResponseSerie0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecurityTimeseriesGroupThreatCategoryResponseSerie0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecurityTimeseriesGroupTLSVersionResponse struct {
- Meta interface{} `json:"meta,required"`
- Serie0 RadarEmailSecurityTimeseriesGroupTLSVersionResponseSerie0 `json:"serie_0,required"`
- JSON radarEmailSecurityTimeseriesGroupTLSVersionResponseJSON `json:"-"`
-}
-
-// radarEmailSecurityTimeseriesGroupTLSVersionResponseJSON contains the JSON
-// metadata for the struct [RadarEmailSecurityTimeseriesGroupTLSVersionResponse]
-type radarEmailSecurityTimeseriesGroupTLSVersionResponseJSON struct {
- Meta apijson.Field
- Serie0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecurityTimeseriesGroupTLSVersionResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecurityTimeseriesGroupTLSVersionResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecurityTimeseriesGroupTLSVersionResponseSerie0 struct {
- TLS1_0 []string `json:"TLS 1.0,required"`
- TLS1_1 []string `json:"TLS 1.1,required"`
- TLS1_2 []string `json:"TLS 1.2,required"`
- TLS1_3 []string `json:"TLS 1.3,required"`
- JSON radarEmailSecurityTimeseriesGroupTLSVersionResponseSerie0JSON `json:"-"`
-}
-
-// radarEmailSecurityTimeseriesGroupTLSVersionResponseSerie0JSON contains the JSON
-// metadata for the struct
-// [RadarEmailSecurityTimeseriesGroupTLSVersionResponseSerie0]
-type radarEmailSecurityTimeseriesGroupTLSVersionResponseSerie0JSON struct {
- TLS1_0 apijson.Field
- TLS1_1 apijson.Field
- TLS1_2 apijson.Field
- TLS1_3 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecurityTimeseriesGroupTLSVersionResponseSerie0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecurityTimeseriesGroupTLSVersionResponseSerie0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecurityTimeseriesGroupARCParams struct {
- // Aggregation interval results should be returned in (for example, in 15 minutes
- // or 1 hour intervals). Refer to
- // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
- AggInterval param.Field[RadarEmailSecurityTimeseriesGroupARCParamsAggInterval] `query:"aggInterval"`
- // 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[[]RadarEmailSecurityTimeseriesGroupARCParamsDateRange] `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[[]RadarEmailSecurityTimeseriesGroupARCParamsDKIM] `query:"dkim"`
- // Filter for dmarc.
- DMARC param.Field[[]RadarEmailSecurityTimeseriesGroupARCParamsDMARC] `query:"dmarc"`
- // Format results are returned in.
- Format param.Field[RadarEmailSecurityTimeseriesGroupARCParamsFormat] `query:"format"`
- // 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
-// parameters as `url.Values`.
-func (r RadarEmailSecurityTimeseriesGroupARCParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Aggregation interval results should be returned in (for example, in 15 minutes
-// or 1 hour intervals). Refer to
-// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
-type RadarEmailSecurityTimeseriesGroupARCParamsAggInterval string
-
-const (
- RadarEmailSecurityTimeseriesGroupARCParamsAggInterval15m RadarEmailSecurityTimeseriesGroupARCParamsAggInterval = "15m"
- RadarEmailSecurityTimeseriesGroupARCParamsAggInterval1h RadarEmailSecurityTimeseriesGroupARCParamsAggInterval = "1h"
- RadarEmailSecurityTimeseriesGroupARCParamsAggInterval1d RadarEmailSecurityTimeseriesGroupARCParamsAggInterval = "1d"
- RadarEmailSecurityTimeseriesGroupARCParamsAggInterval1w RadarEmailSecurityTimeseriesGroupARCParamsAggInterval = "1w"
-)
-
-type RadarEmailSecurityTimeseriesGroupARCParamsDateRange string
-
-const (
- RadarEmailSecurityTimeseriesGroupARCParamsDateRange1d RadarEmailSecurityTimeseriesGroupARCParamsDateRange = "1d"
- RadarEmailSecurityTimeseriesGroupARCParamsDateRange2d RadarEmailSecurityTimeseriesGroupARCParamsDateRange = "2d"
- RadarEmailSecurityTimeseriesGroupARCParamsDateRange7d RadarEmailSecurityTimeseriesGroupARCParamsDateRange = "7d"
- RadarEmailSecurityTimeseriesGroupARCParamsDateRange14d RadarEmailSecurityTimeseriesGroupARCParamsDateRange = "14d"
- RadarEmailSecurityTimeseriesGroupARCParamsDateRange28d RadarEmailSecurityTimeseriesGroupARCParamsDateRange = "28d"
- RadarEmailSecurityTimeseriesGroupARCParamsDateRange12w RadarEmailSecurityTimeseriesGroupARCParamsDateRange = "12w"
- RadarEmailSecurityTimeseriesGroupARCParamsDateRange24w RadarEmailSecurityTimeseriesGroupARCParamsDateRange = "24w"
- RadarEmailSecurityTimeseriesGroupARCParamsDateRange52w RadarEmailSecurityTimeseriesGroupARCParamsDateRange = "52w"
- RadarEmailSecurityTimeseriesGroupARCParamsDateRange1dControl RadarEmailSecurityTimeseriesGroupARCParamsDateRange = "1dControl"
- RadarEmailSecurityTimeseriesGroupARCParamsDateRange2dControl RadarEmailSecurityTimeseriesGroupARCParamsDateRange = "2dControl"
- RadarEmailSecurityTimeseriesGroupARCParamsDateRange7dControl RadarEmailSecurityTimeseriesGroupARCParamsDateRange = "7dControl"
- RadarEmailSecurityTimeseriesGroupARCParamsDateRange14dControl RadarEmailSecurityTimeseriesGroupARCParamsDateRange = "14dControl"
- RadarEmailSecurityTimeseriesGroupARCParamsDateRange28dControl RadarEmailSecurityTimeseriesGroupARCParamsDateRange = "28dControl"
- RadarEmailSecurityTimeseriesGroupARCParamsDateRange12wControl RadarEmailSecurityTimeseriesGroupARCParamsDateRange = "12wControl"
- RadarEmailSecurityTimeseriesGroupARCParamsDateRange24wControl RadarEmailSecurityTimeseriesGroupARCParamsDateRange = "24wControl"
-)
-
-type RadarEmailSecurityTimeseriesGroupARCParamsDKIM string
-
-const (
- RadarEmailSecurityTimeseriesGroupARCParamsDKIMPass RadarEmailSecurityTimeseriesGroupARCParamsDKIM = "PASS"
- RadarEmailSecurityTimeseriesGroupARCParamsDKIMNone RadarEmailSecurityTimeseriesGroupARCParamsDKIM = "NONE"
- RadarEmailSecurityTimeseriesGroupARCParamsDKIMFail RadarEmailSecurityTimeseriesGroupARCParamsDKIM = "FAIL"
-)
-
-type RadarEmailSecurityTimeseriesGroupARCParamsDMARC string
-
-const (
- RadarEmailSecurityTimeseriesGroupARCParamsDMARCPass RadarEmailSecurityTimeseriesGroupARCParamsDMARC = "PASS"
- RadarEmailSecurityTimeseriesGroupARCParamsDMARCNone RadarEmailSecurityTimeseriesGroupARCParamsDMARC = "NONE"
- RadarEmailSecurityTimeseriesGroupARCParamsDMARCFail RadarEmailSecurityTimeseriesGroupARCParamsDMARC = "FAIL"
-)
-
-// Format results are returned in.
-type RadarEmailSecurityTimeseriesGroupARCParamsFormat string
-
-const (
- RadarEmailSecurityTimeseriesGroupARCParamsFormatJson RadarEmailSecurityTimeseriesGroupARCParamsFormat = "JSON"
- RadarEmailSecurityTimeseriesGroupARCParamsFormatCsv RadarEmailSecurityTimeseriesGroupARCParamsFormat = "CSV"
-)
-
-type RadarEmailSecurityTimeseriesGroupARCParamsSPF string
-
-const (
- RadarEmailSecurityTimeseriesGroupARCParamsSPFPass RadarEmailSecurityTimeseriesGroupARCParamsSPF = "PASS"
- RadarEmailSecurityTimeseriesGroupARCParamsSPFNone RadarEmailSecurityTimeseriesGroupARCParamsSPF = "NONE"
- 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"`
- JSON radarEmailSecurityTimeseriesGroupARCResponseEnvelopeJSON `json:"-"`
-}
-
-// radarEmailSecurityTimeseriesGroupARCResponseEnvelopeJSON contains the JSON
-// metadata for the struct [RadarEmailSecurityTimeseriesGroupARCResponseEnvelope]
-type radarEmailSecurityTimeseriesGroupARCResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecurityTimeseriesGroupARCResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecurityTimeseriesGroupARCResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecurityTimeseriesGroupDKIMParams struct {
- // Aggregation interval results should be returned in (for example, in 15 minutes
- // or 1 hour intervals). Refer to
- // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
- AggInterval param.Field[RadarEmailSecurityTimeseriesGroupDKIMParamsAggInterval] `query:"aggInterval"`
- // Filter for arc (Authenticated Received Chain).
- ARC param.Field[[]RadarEmailSecurityTimeseriesGroupDKIMParamsARC] `query:"arc"`
- // 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[[]RadarEmailSecurityTimeseriesGroupDKIMParamsDateRange] `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[[]RadarEmailSecurityTimeseriesGroupDKIMParamsDMARC] `query:"dmarc"`
- // Format results are returned in.
- Format param.Field[RadarEmailSecurityTimeseriesGroupDKIMParamsFormat] `query:"format"`
- // 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
-// parameters as `url.Values`.
-func (r RadarEmailSecurityTimeseriesGroupDKIMParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Aggregation interval results should be returned in (for example, in 15 minutes
-// or 1 hour intervals). Refer to
-// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
-type RadarEmailSecurityTimeseriesGroupDKIMParamsAggInterval string
-
-const (
- RadarEmailSecurityTimeseriesGroupDKIMParamsAggInterval15m RadarEmailSecurityTimeseriesGroupDKIMParamsAggInterval = "15m"
- RadarEmailSecurityTimeseriesGroupDKIMParamsAggInterval1h RadarEmailSecurityTimeseriesGroupDKIMParamsAggInterval = "1h"
- RadarEmailSecurityTimeseriesGroupDKIMParamsAggInterval1d RadarEmailSecurityTimeseriesGroupDKIMParamsAggInterval = "1d"
- RadarEmailSecurityTimeseriesGroupDKIMParamsAggInterval1w RadarEmailSecurityTimeseriesGroupDKIMParamsAggInterval = "1w"
-)
-
-type RadarEmailSecurityTimeseriesGroupDKIMParamsARC string
-
-const (
- RadarEmailSecurityTimeseriesGroupDKIMParamsARCPass RadarEmailSecurityTimeseriesGroupDKIMParamsARC = "PASS"
- RadarEmailSecurityTimeseriesGroupDKIMParamsARCNone RadarEmailSecurityTimeseriesGroupDKIMParamsARC = "NONE"
- RadarEmailSecurityTimeseriesGroupDKIMParamsARCFail RadarEmailSecurityTimeseriesGroupDKIMParamsARC = "FAIL"
-)
-
-type RadarEmailSecurityTimeseriesGroupDKIMParamsDateRange string
-
-const (
- RadarEmailSecurityTimeseriesGroupDKIMParamsDateRange1d RadarEmailSecurityTimeseriesGroupDKIMParamsDateRange = "1d"
- RadarEmailSecurityTimeseriesGroupDKIMParamsDateRange2d RadarEmailSecurityTimeseriesGroupDKIMParamsDateRange = "2d"
- RadarEmailSecurityTimeseriesGroupDKIMParamsDateRange7d RadarEmailSecurityTimeseriesGroupDKIMParamsDateRange = "7d"
- RadarEmailSecurityTimeseriesGroupDKIMParamsDateRange14d RadarEmailSecurityTimeseriesGroupDKIMParamsDateRange = "14d"
- RadarEmailSecurityTimeseriesGroupDKIMParamsDateRange28d RadarEmailSecurityTimeseriesGroupDKIMParamsDateRange = "28d"
- RadarEmailSecurityTimeseriesGroupDKIMParamsDateRange12w RadarEmailSecurityTimeseriesGroupDKIMParamsDateRange = "12w"
- RadarEmailSecurityTimeseriesGroupDKIMParamsDateRange24w RadarEmailSecurityTimeseriesGroupDKIMParamsDateRange = "24w"
- RadarEmailSecurityTimeseriesGroupDKIMParamsDateRange52w RadarEmailSecurityTimeseriesGroupDKIMParamsDateRange = "52w"
- RadarEmailSecurityTimeseriesGroupDKIMParamsDateRange1dControl RadarEmailSecurityTimeseriesGroupDKIMParamsDateRange = "1dControl"
- RadarEmailSecurityTimeseriesGroupDKIMParamsDateRange2dControl RadarEmailSecurityTimeseriesGroupDKIMParamsDateRange = "2dControl"
- RadarEmailSecurityTimeseriesGroupDKIMParamsDateRange7dControl RadarEmailSecurityTimeseriesGroupDKIMParamsDateRange = "7dControl"
- RadarEmailSecurityTimeseriesGroupDKIMParamsDateRange14dControl RadarEmailSecurityTimeseriesGroupDKIMParamsDateRange = "14dControl"
- RadarEmailSecurityTimeseriesGroupDKIMParamsDateRange28dControl RadarEmailSecurityTimeseriesGroupDKIMParamsDateRange = "28dControl"
- RadarEmailSecurityTimeseriesGroupDKIMParamsDateRange12wControl RadarEmailSecurityTimeseriesGroupDKIMParamsDateRange = "12wControl"
- RadarEmailSecurityTimeseriesGroupDKIMParamsDateRange24wControl RadarEmailSecurityTimeseriesGroupDKIMParamsDateRange = "24wControl"
-)
-
-type RadarEmailSecurityTimeseriesGroupDKIMParamsDMARC string
-
-const (
- RadarEmailSecurityTimeseriesGroupDKIMParamsDMARCPass RadarEmailSecurityTimeseriesGroupDKIMParamsDMARC = "PASS"
- RadarEmailSecurityTimeseriesGroupDKIMParamsDMARCNone RadarEmailSecurityTimeseriesGroupDKIMParamsDMARC = "NONE"
- RadarEmailSecurityTimeseriesGroupDKIMParamsDMARCFail RadarEmailSecurityTimeseriesGroupDKIMParamsDMARC = "FAIL"
-)
-
-// Format results are returned in.
-type RadarEmailSecurityTimeseriesGroupDKIMParamsFormat string
-
-const (
- RadarEmailSecurityTimeseriesGroupDKIMParamsFormatJson RadarEmailSecurityTimeseriesGroupDKIMParamsFormat = "JSON"
- RadarEmailSecurityTimeseriesGroupDKIMParamsFormatCsv RadarEmailSecurityTimeseriesGroupDKIMParamsFormat = "CSV"
-)
-
-type RadarEmailSecurityTimeseriesGroupDKIMParamsSPF string
-
-const (
- RadarEmailSecurityTimeseriesGroupDKIMParamsSPFPass RadarEmailSecurityTimeseriesGroupDKIMParamsSPF = "PASS"
- RadarEmailSecurityTimeseriesGroupDKIMParamsSPFNone RadarEmailSecurityTimeseriesGroupDKIMParamsSPF = "NONE"
- 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"`
- JSON radarEmailSecurityTimeseriesGroupDKIMResponseEnvelopeJSON `json:"-"`
-}
-
-// radarEmailSecurityTimeseriesGroupDKIMResponseEnvelopeJSON contains the JSON
-// metadata for the struct [RadarEmailSecurityTimeseriesGroupDKIMResponseEnvelope]
-type radarEmailSecurityTimeseriesGroupDKIMResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecurityTimeseriesGroupDKIMResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecurityTimeseriesGroupDKIMResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecurityTimeseriesGroupDMARCParams struct {
- // Aggregation interval results should be returned in (for example, in 15 minutes
- // or 1 hour intervals). Refer to
- // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
- AggInterval param.Field[RadarEmailSecurityTimeseriesGroupDMARCParamsAggInterval] `query:"aggInterval"`
- // Filter for arc (Authenticated Received Chain).
- ARC param.Field[[]RadarEmailSecurityTimeseriesGroupDMARCParamsARC] `query:"arc"`
- // 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[[]RadarEmailSecurityTimeseriesGroupDMARCParamsDateRange] `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[[]RadarEmailSecurityTimeseriesGroupDMARCParamsDKIM] `query:"dkim"`
- // Format results are returned in.
- Format param.Field[RadarEmailSecurityTimeseriesGroupDMARCParamsFormat] `query:"format"`
- // 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
-// parameters as `url.Values`.
-func (r RadarEmailSecurityTimeseriesGroupDMARCParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Aggregation interval results should be returned in (for example, in 15 minutes
-// or 1 hour intervals). Refer to
-// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
-type RadarEmailSecurityTimeseriesGroupDMARCParamsAggInterval string
-
-const (
- RadarEmailSecurityTimeseriesGroupDMARCParamsAggInterval15m RadarEmailSecurityTimeseriesGroupDMARCParamsAggInterval = "15m"
- RadarEmailSecurityTimeseriesGroupDMARCParamsAggInterval1h RadarEmailSecurityTimeseriesGroupDMARCParamsAggInterval = "1h"
- RadarEmailSecurityTimeseriesGroupDMARCParamsAggInterval1d RadarEmailSecurityTimeseriesGroupDMARCParamsAggInterval = "1d"
- RadarEmailSecurityTimeseriesGroupDMARCParamsAggInterval1w RadarEmailSecurityTimeseriesGroupDMARCParamsAggInterval = "1w"
-)
-
-type RadarEmailSecurityTimeseriesGroupDMARCParamsARC string
-
-const (
- RadarEmailSecurityTimeseriesGroupDMARCParamsARCPass RadarEmailSecurityTimeseriesGroupDMARCParamsARC = "PASS"
- RadarEmailSecurityTimeseriesGroupDMARCParamsARCNone RadarEmailSecurityTimeseriesGroupDMARCParamsARC = "NONE"
- RadarEmailSecurityTimeseriesGroupDMARCParamsARCFail RadarEmailSecurityTimeseriesGroupDMARCParamsARC = "FAIL"
-)
-
-type RadarEmailSecurityTimeseriesGroupDMARCParamsDateRange string
-
-const (
- RadarEmailSecurityTimeseriesGroupDMARCParamsDateRange1d RadarEmailSecurityTimeseriesGroupDMARCParamsDateRange = "1d"
- RadarEmailSecurityTimeseriesGroupDMARCParamsDateRange2d RadarEmailSecurityTimeseriesGroupDMARCParamsDateRange = "2d"
- RadarEmailSecurityTimeseriesGroupDMARCParamsDateRange7d RadarEmailSecurityTimeseriesGroupDMARCParamsDateRange = "7d"
- RadarEmailSecurityTimeseriesGroupDMARCParamsDateRange14d RadarEmailSecurityTimeseriesGroupDMARCParamsDateRange = "14d"
- RadarEmailSecurityTimeseriesGroupDMARCParamsDateRange28d RadarEmailSecurityTimeseriesGroupDMARCParamsDateRange = "28d"
- RadarEmailSecurityTimeseriesGroupDMARCParamsDateRange12w RadarEmailSecurityTimeseriesGroupDMARCParamsDateRange = "12w"
- RadarEmailSecurityTimeseriesGroupDMARCParamsDateRange24w RadarEmailSecurityTimeseriesGroupDMARCParamsDateRange = "24w"
- RadarEmailSecurityTimeseriesGroupDMARCParamsDateRange52w RadarEmailSecurityTimeseriesGroupDMARCParamsDateRange = "52w"
- RadarEmailSecurityTimeseriesGroupDMARCParamsDateRange1dControl RadarEmailSecurityTimeseriesGroupDMARCParamsDateRange = "1dControl"
- RadarEmailSecurityTimeseriesGroupDMARCParamsDateRange2dControl RadarEmailSecurityTimeseriesGroupDMARCParamsDateRange = "2dControl"
- RadarEmailSecurityTimeseriesGroupDMARCParamsDateRange7dControl RadarEmailSecurityTimeseriesGroupDMARCParamsDateRange = "7dControl"
- RadarEmailSecurityTimeseriesGroupDMARCParamsDateRange14dControl RadarEmailSecurityTimeseriesGroupDMARCParamsDateRange = "14dControl"
- RadarEmailSecurityTimeseriesGroupDMARCParamsDateRange28dControl RadarEmailSecurityTimeseriesGroupDMARCParamsDateRange = "28dControl"
- RadarEmailSecurityTimeseriesGroupDMARCParamsDateRange12wControl RadarEmailSecurityTimeseriesGroupDMARCParamsDateRange = "12wControl"
- RadarEmailSecurityTimeseriesGroupDMARCParamsDateRange24wControl RadarEmailSecurityTimeseriesGroupDMARCParamsDateRange = "24wControl"
-)
-
-type RadarEmailSecurityTimeseriesGroupDMARCParamsDKIM string
-
-const (
- RadarEmailSecurityTimeseriesGroupDMARCParamsDKIMPass RadarEmailSecurityTimeseriesGroupDMARCParamsDKIM = "PASS"
- RadarEmailSecurityTimeseriesGroupDMARCParamsDKIMNone RadarEmailSecurityTimeseriesGroupDMARCParamsDKIM = "NONE"
- RadarEmailSecurityTimeseriesGroupDMARCParamsDKIMFail RadarEmailSecurityTimeseriesGroupDMARCParamsDKIM = "FAIL"
-)
-
-// Format results are returned in.
-type RadarEmailSecurityTimeseriesGroupDMARCParamsFormat string
-
-const (
- RadarEmailSecurityTimeseriesGroupDMARCParamsFormatJson RadarEmailSecurityTimeseriesGroupDMARCParamsFormat = "JSON"
- RadarEmailSecurityTimeseriesGroupDMARCParamsFormatCsv RadarEmailSecurityTimeseriesGroupDMARCParamsFormat = "CSV"
-)
-
-type RadarEmailSecurityTimeseriesGroupDMARCParamsSPF string
-
-const (
- RadarEmailSecurityTimeseriesGroupDMARCParamsSPFPass RadarEmailSecurityTimeseriesGroupDMARCParamsSPF = "PASS"
- RadarEmailSecurityTimeseriesGroupDMARCParamsSPFNone RadarEmailSecurityTimeseriesGroupDMARCParamsSPF = "NONE"
- 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"`
- JSON radarEmailSecurityTimeseriesGroupDMARCResponseEnvelopeJSON `json:"-"`
-}
-
-// radarEmailSecurityTimeseriesGroupDMARCResponseEnvelopeJSON contains the JSON
-// metadata for the struct [RadarEmailSecurityTimeseriesGroupDMARCResponseEnvelope]
-type radarEmailSecurityTimeseriesGroupDMARCResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecurityTimeseriesGroupDMARCResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecurityTimeseriesGroupDMARCResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecurityTimeseriesGroupMaliciousParams struct {
- // Aggregation interval results should be returned in (for example, in 15 minutes
- // or 1 hour intervals). Refer to
- // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
- AggInterval param.Field[RadarEmailSecurityTimeseriesGroupMaliciousParamsAggInterval] `query:"aggInterval"`
- // Filter for arc (Authenticated Received Chain).
- ARC param.Field[[]RadarEmailSecurityTimeseriesGroupMaliciousParamsARC] `query:"arc"`
- // 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[[]RadarEmailSecurityTimeseriesGroupMaliciousParamsDateRange] `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[[]RadarEmailSecurityTimeseriesGroupMaliciousParamsDKIM] `query:"dkim"`
- // Filter for dmarc.
- DMARC param.Field[[]RadarEmailSecurityTimeseriesGroupMaliciousParamsDMARC] `query:"dmarc"`
- // Format results are returned in.
- Format param.Field[RadarEmailSecurityTimeseriesGroupMaliciousParamsFormat] `query:"format"`
- // 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
-// parameters as `url.Values`.
-func (r RadarEmailSecurityTimeseriesGroupMaliciousParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Aggregation interval results should be returned in (for example, in 15 minutes
-// or 1 hour intervals). Refer to
-// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
-type RadarEmailSecurityTimeseriesGroupMaliciousParamsAggInterval string
-
-const (
- RadarEmailSecurityTimeseriesGroupMaliciousParamsAggInterval15m RadarEmailSecurityTimeseriesGroupMaliciousParamsAggInterval = "15m"
- RadarEmailSecurityTimeseriesGroupMaliciousParamsAggInterval1h RadarEmailSecurityTimeseriesGroupMaliciousParamsAggInterval = "1h"
- RadarEmailSecurityTimeseriesGroupMaliciousParamsAggInterval1d RadarEmailSecurityTimeseriesGroupMaliciousParamsAggInterval = "1d"
- RadarEmailSecurityTimeseriesGroupMaliciousParamsAggInterval1w RadarEmailSecurityTimeseriesGroupMaliciousParamsAggInterval = "1w"
-)
-
-type RadarEmailSecurityTimeseriesGroupMaliciousParamsARC string
-
-const (
- RadarEmailSecurityTimeseriesGroupMaliciousParamsARCPass RadarEmailSecurityTimeseriesGroupMaliciousParamsARC = "PASS"
- RadarEmailSecurityTimeseriesGroupMaliciousParamsARCNone RadarEmailSecurityTimeseriesGroupMaliciousParamsARC = "NONE"
- RadarEmailSecurityTimeseriesGroupMaliciousParamsARCFail RadarEmailSecurityTimeseriesGroupMaliciousParamsARC = "FAIL"
-)
-
-type RadarEmailSecurityTimeseriesGroupMaliciousParamsDateRange string
-
-const (
- RadarEmailSecurityTimeseriesGroupMaliciousParamsDateRange1d RadarEmailSecurityTimeseriesGroupMaliciousParamsDateRange = "1d"
- RadarEmailSecurityTimeseriesGroupMaliciousParamsDateRange2d RadarEmailSecurityTimeseriesGroupMaliciousParamsDateRange = "2d"
- RadarEmailSecurityTimeseriesGroupMaliciousParamsDateRange7d RadarEmailSecurityTimeseriesGroupMaliciousParamsDateRange = "7d"
- RadarEmailSecurityTimeseriesGroupMaliciousParamsDateRange14d RadarEmailSecurityTimeseriesGroupMaliciousParamsDateRange = "14d"
- RadarEmailSecurityTimeseriesGroupMaliciousParamsDateRange28d RadarEmailSecurityTimeseriesGroupMaliciousParamsDateRange = "28d"
- RadarEmailSecurityTimeseriesGroupMaliciousParamsDateRange12w RadarEmailSecurityTimeseriesGroupMaliciousParamsDateRange = "12w"
- RadarEmailSecurityTimeseriesGroupMaliciousParamsDateRange24w RadarEmailSecurityTimeseriesGroupMaliciousParamsDateRange = "24w"
- RadarEmailSecurityTimeseriesGroupMaliciousParamsDateRange52w RadarEmailSecurityTimeseriesGroupMaliciousParamsDateRange = "52w"
- RadarEmailSecurityTimeseriesGroupMaliciousParamsDateRange1dControl RadarEmailSecurityTimeseriesGroupMaliciousParamsDateRange = "1dControl"
- RadarEmailSecurityTimeseriesGroupMaliciousParamsDateRange2dControl RadarEmailSecurityTimeseriesGroupMaliciousParamsDateRange = "2dControl"
- RadarEmailSecurityTimeseriesGroupMaliciousParamsDateRange7dControl RadarEmailSecurityTimeseriesGroupMaliciousParamsDateRange = "7dControl"
- RadarEmailSecurityTimeseriesGroupMaliciousParamsDateRange14dControl RadarEmailSecurityTimeseriesGroupMaliciousParamsDateRange = "14dControl"
- RadarEmailSecurityTimeseriesGroupMaliciousParamsDateRange28dControl RadarEmailSecurityTimeseriesGroupMaliciousParamsDateRange = "28dControl"
- RadarEmailSecurityTimeseriesGroupMaliciousParamsDateRange12wControl RadarEmailSecurityTimeseriesGroupMaliciousParamsDateRange = "12wControl"
- RadarEmailSecurityTimeseriesGroupMaliciousParamsDateRange24wControl RadarEmailSecurityTimeseriesGroupMaliciousParamsDateRange = "24wControl"
-)
-
-type RadarEmailSecurityTimeseriesGroupMaliciousParamsDKIM string
-
-const (
- RadarEmailSecurityTimeseriesGroupMaliciousParamsDKIMPass RadarEmailSecurityTimeseriesGroupMaliciousParamsDKIM = "PASS"
- RadarEmailSecurityTimeseriesGroupMaliciousParamsDKIMNone RadarEmailSecurityTimeseriesGroupMaliciousParamsDKIM = "NONE"
- RadarEmailSecurityTimeseriesGroupMaliciousParamsDKIMFail RadarEmailSecurityTimeseriesGroupMaliciousParamsDKIM = "FAIL"
-)
-
-type RadarEmailSecurityTimeseriesGroupMaliciousParamsDMARC string
-
-const (
- RadarEmailSecurityTimeseriesGroupMaliciousParamsDMARCPass RadarEmailSecurityTimeseriesGroupMaliciousParamsDMARC = "PASS"
- RadarEmailSecurityTimeseriesGroupMaliciousParamsDMARCNone RadarEmailSecurityTimeseriesGroupMaliciousParamsDMARC = "NONE"
- RadarEmailSecurityTimeseriesGroupMaliciousParamsDMARCFail RadarEmailSecurityTimeseriesGroupMaliciousParamsDMARC = "FAIL"
-)
-
-// Format results are returned in.
-type RadarEmailSecurityTimeseriesGroupMaliciousParamsFormat string
-
-const (
- RadarEmailSecurityTimeseriesGroupMaliciousParamsFormatJson RadarEmailSecurityTimeseriesGroupMaliciousParamsFormat = "JSON"
- RadarEmailSecurityTimeseriesGroupMaliciousParamsFormatCsv RadarEmailSecurityTimeseriesGroupMaliciousParamsFormat = "CSV"
-)
-
-type RadarEmailSecurityTimeseriesGroupMaliciousParamsSPF string
-
-const (
- RadarEmailSecurityTimeseriesGroupMaliciousParamsSPFPass RadarEmailSecurityTimeseriesGroupMaliciousParamsSPF = "PASS"
- RadarEmailSecurityTimeseriesGroupMaliciousParamsSPFNone RadarEmailSecurityTimeseriesGroupMaliciousParamsSPF = "NONE"
- 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"`
- JSON radarEmailSecurityTimeseriesGroupMaliciousResponseEnvelopeJSON `json:"-"`
-}
-
-// radarEmailSecurityTimeseriesGroupMaliciousResponseEnvelopeJSON contains the JSON
-// metadata for the struct
-// [RadarEmailSecurityTimeseriesGroupMaliciousResponseEnvelope]
-type radarEmailSecurityTimeseriesGroupMaliciousResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecurityTimeseriesGroupMaliciousResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecurityTimeseriesGroupMaliciousResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecurityTimeseriesGroupSpamParams struct {
- // Aggregation interval results should be returned in (for example, in 15 minutes
- // or 1 hour intervals). Refer to
- // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
- AggInterval param.Field[RadarEmailSecurityTimeseriesGroupSpamParamsAggInterval] `query:"aggInterval"`
- // Filter for arc (Authenticated Received Chain).
- ARC param.Field[[]RadarEmailSecurityTimeseriesGroupSpamParamsARC] `query:"arc"`
- // 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[[]RadarEmailSecurityTimeseriesGroupSpamParamsDateRange] `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[[]RadarEmailSecurityTimeseriesGroupSpamParamsDKIM] `query:"dkim"`
- // Filter for dmarc.
- DMARC param.Field[[]RadarEmailSecurityTimeseriesGroupSpamParamsDMARC] `query:"dmarc"`
- // Format results are returned in.
- Format param.Field[RadarEmailSecurityTimeseriesGroupSpamParamsFormat] `query:"format"`
- // 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
-// parameters as `url.Values`.
-func (r RadarEmailSecurityTimeseriesGroupSpamParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Aggregation interval results should be returned in (for example, in 15 minutes
-// or 1 hour intervals). Refer to
-// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
-type RadarEmailSecurityTimeseriesGroupSpamParamsAggInterval string
-
-const (
- RadarEmailSecurityTimeseriesGroupSpamParamsAggInterval15m RadarEmailSecurityTimeseriesGroupSpamParamsAggInterval = "15m"
- RadarEmailSecurityTimeseriesGroupSpamParamsAggInterval1h RadarEmailSecurityTimeseriesGroupSpamParamsAggInterval = "1h"
- RadarEmailSecurityTimeseriesGroupSpamParamsAggInterval1d RadarEmailSecurityTimeseriesGroupSpamParamsAggInterval = "1d"
- RadarEmailSecurityTimeseriesGroupSpamParamsAggInterval1w RadarEmailSecurityTimeseriesGroupSpamParamsAggInterval = "1w"
-)
-
-type RadarEmailSecurityTimeseriesGroupSpamParamsARC string
-
-const (
- RadarEmailSecurityTimeseriesGroupSpamParamsARCPass RadarEmailSecurityTimeseriesGroupSpamParamsARC = "PASS"
- RadarEmailSecurityTimeseriesGroupSpamParamsARCNone RadarEmailSecurityTimeseriesGroupSpamParamsARC = "NONE"
- RadarEmailSecurityTimeseriesGroupSpamParamsARCFail RadarEmailSecurityTimeseriesGroupSpamParamsARC = "FAIL"
-)
-
-type RadarEmailSecurityTimeseriesGroupSpamParamsDateRange string
-
-const (
- RadarEmailSecurityTimeseriesGroupSpamParamsDateRange1d RadarEmailSecurityTimeseriesGroupSpamParamsDateRange = "1d"
- RadarEmailSecurityTimeseriesGroupSpamParamsDateRange2d RadarEmailSecurityTimeseriesGroupSpamParamsDateRange = "2d"
- RadarEmailSecurityTimeseriesGroupSpamParamsDateRange7d RadarEmailSecurityTimeseriesGroupSpamParamsDateRange = "7d"
- RadarEmailSecurityTimeseriesGroupSpamParamsDateRange14d RadarEmailSecurityTimeseriesGroupSpamParamsDateRange = "14d"
- RadarEmailSecurityTimeseriesGroupSpamParamsDateRange28d RadarEmailSecurityTimeseriesGroupSpamParamsDateRange = "28d"
- RadarEmailSecurityTimeseriesGroupSpamParamsDateRange12w RadarEmailSecurityTimeseriesGroupSpamParamsDateRange = "12w"
- RadarEmailSecurityTimeseriesGroupSpamParamsDateRange24w RadarEmailSecurityTimeseriesGroupSpamParamsDateRange = "24w"
- RadarEmailSecurityTimeseriesGroupSpamParamsDateRange52w RadarEmailSecurityTimeseriesGroupSpamParamsDateRange = "52w"
- RadarEmailSecurityTimeseriesGroupSpamParamsDateRange1dControl RadarEmailSecurityTimeseriesGroupSpamParamsDateRange = "1dControl"
- RadarEmailSecurityTimeseriesGroupSpamParamsDateRange2dControl RadarEmailSecurityTimeseriesGroupSpamParamsDateRange = "2dControl"
- RadarEmailSecurityTimeseriesGroupSpamParamsDateRange7dControl RadarEmailSecurityTimeseriesGroupSpamParamsDateRange = "7dControl"
- RadarEmailSecurityTimeseriesGroupSpamParamsDateRange14dControl RadarEmailSecurityTimeseriesGroupSpamParamsDateRange = "14dControl"
- RadarEmailSecurityTimeseriesGroupSpamParamsDateRange28dControl RadarEmailSecurityTimeseriesGroupSpamParamsDateRange = "28dControl"
- RadarEmailSecurityTimeseriesGroupSpamParamsDateRange12wControl RadarEmailSecurityTimeseriesGroupSpamParamsDateRange = "12wControl"
- RadarEmailSecurityTimeseriesGroupSpamParamsDateRange24wControl RadarEmailSecurityTimeseriesGroupSpamParamsDateRange = "24wControl"
-)
-
-type RadarEmailSecurityTimeseriesGroupSpamParamsDKIM string
-
-const (
- RadarEmailSecurityTimeseriesGroupSpamParamsDKIMPass RadarEmailSecurityTimeseriesGroupSpamParamsDKIM = "PASS"
- RadarEmailSecurityTimeseriesGroupSpamParamsDKIMNone RadarEmailSecurityTimeseriesGroupSpamParamsDKIM = "NONE"
- RadarEmailSecurityTimeseriesGroupSpamParamsDKIMFail RadarEmailSecurityTimeseriesGroupSpamParamsDKIM = "FAIL"
-)
-
-type RadarEmailSecurityTimeseriesGroupSpamParamsDMARC string
-
-const (
- RadarEmailSecurityTimeseriesGroupSpamParamsDMARCPass RadarEmailSecurityTimeseriesGroupSpamParamsDMARC = "PASS"
- RadarEmailSecurityTimeseriesGroupSpamParamsDMARCNone RadarEmailSecurityTimeseriesGroupSpamParamsDMARC = "NONE"
- RadarEmailSecurityTimeseriesGroupSpamParamsDMARCFail RadarEmailSecurityTimeseriesGroupSpamParamsDMARC = "FAIL"
-)
-
-// Format results are returned in.
-type RadarEmailSecurityTimeseriesGroupSpamParamsFormat string
-
-const (
- RadarEmailSecurityTimeseriesGroupSpamParamsFormatJson RadarEmailSecurityTimeseriesGroupSpamParamsFormat = "JSON"
- RadarEmailSecurityTimeseriesGroupSpamParamsFormatCsv RadarEmailSecurityTimeseriesGroupSpamParamsFormat = "CSV"
-)
-
-type RadarEmailSecurityTimeseriesGroupSpamParamsSPF string
-
-const (
- RadarEmailSecurityTimeseriesGroupSpamParamsSPFPass RadarEmailSecurityTimeseriesGroupSpamParamsSPF = "PASS"
- RadarEmailSecurityTimeseriesGroupSpamParamsSPFNone RadarEmailSecurityTimeseriesGroupSpamParamsSPF = "NONE"
- 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"`
- JSON radarEmailSecurityTimeseriesGroupSpamResponseEnvelopeJSON `json:"-"`
-}
-
-// radarEmailSecurityTimeseriesGroupSpamResponseEnvelopeJSON contains the JSON
-// metadata for the struct [RadarEmailSecurityTimeseriesGroupSpamResponseEnvelope]
-type radarEmailSecurityTimeseriesGroupSpamResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecurityTimeseriesGroupSpamResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecurityTimeseriesGroupSpamResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecurityTimeseriesGroupSPFParams struct {
- // Aggregation interval results should be returned in (for example, in 15 minutes
- // or 1 hour intervals). Refer to
- // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
- AggInterval param.Field[RadarEmailSecurityTimeseriesGroupSPFParamsAggInterval] `query:"aggInterval"`
- // Filter for arc (Authenticated Received Chain).
- ARC param.Field[[]RadarEmailSecurityTimeseriesGroupSPFParamsARC] `query:"arc"`
- // 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[[]RadarEmailSecurityTimeseriesGroupSPFParamsDateRange] `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[[]RadarEmailSecurityTimeseriesGroupSPFParamsDKIM] `query:"dkim"`
- // Filter for dmarc.
- DMARC param.Field[[]RadarEmailSecurityTimeseriesGroupSPFParamsDMARC] `query:"dmarc"`
- // Format results are returned in.
- Format param.Field[RadarEmailSecurityTimeseriesGroupSPFParamsFormat] `query:"format"`
- // 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
-// parameters as `url.Values`.
-func (r RadarEmailSecurityTimeseriesGroupSPFParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Aggregation interval results should be returned in (for example, in 15 minutes
-// or 1 hour intervals). Refer to
-// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
-type RadarEmailSecurityTimeseriesGroupSPFParamsAggInterval string
-
-const (
- RadarEmailSecurityTimeseriesGroupSPFParamsAggInterval15m RadarEmailSecurityTimeseriesGroupSPFParamsAggInterval = "15m"
- RadarEmailSecurityTimeseriesGroupSPFParamsAggInterval1h RadarEmailSecurityTimeseriesGroupSPFParamsAggInterval = "1h"
- RadarEmailSecurityTimeseriesGroupSPFParamsAggInterval1d RadarEmailSecurityTimeseriesGroupSPFParamsAggInterval = "1d"
- RadarEmailSecurityTimeseriesGroupSPFParamsAggInterval1w RadarEmailSecurityTimeseriesGroupSPFParamsAggInterval = "1w"
-)
-
-type RadarEmailSecurityTimeseriesGroupSPFParamsARC string
-
-const (
- RadarEmailSecurityTimeseriesGroupSPFParamsARCPass RadarEmailSecurityTimeseriesGroupSPFParamsARC = "PASS"
- RadarEmailSecurityTimeseriesGroupSPFParamsARCNone RadarEmailSecurityTimeseriesGroupSPFParamsARC = "NONE"
- RadarEmailSecurityTimeseriesGroupSPFParamsARCFail RadarEmailSecurityTimeseriesGroupSPFParamsARC = "FAIL"
-)
-
-type RadarEmailSecurityTimeseriesGroupSPFParamsDateRange string
-
-const (
- RadarEmailSecurityTimeseriesGroupSPFParamsDateRange1d RadarEmailSecurityTimeseriesGroupSPFParamsDateRange = "1d"
- RadarEmailSecurityTimeseriesGroupSPFParamsDateRange2d RadarEmailSecurityTimeseriesGroupSPFParamsDateRange = "2d"
- RadarEmailSecurityTimeseriesGroupSPFParamsDateRange7d RadarEmailSecurityTimeseriesGroupSPFParamsDateRange = "7d"
- RadarEmailSecurityTimeseriesGroupSPFParamsDateRange14d RadarEmailSecurityTimeseriesGroupSPFParamsDateRange = "14d"
- RadarEmailSecurityTimeseriesGroupSPFParamsDateRange28d RadarEmailSecurityTimeseriesGroupSPFParamsDateRange = "28d"
- RadarEmailSecurityTimeseriesGroupSPFParamsDateRange12w RadarEmailSecurityTimeseriesGroupSPFParamsDateRange = "12w"
- RadarEmailSecurityTimeseriesGroupSPFParamsDateRange24w RadarEmailSecurityTimeseriesGroupSPFParamsDateRange = "24w"
- RadarEmailSecurityTimeseriesGroupSPFParamsDateRange52w RadarEmailSecurityTimeseriesGroupSPFParamsDateRange = "52w"
- RadarEmailSecurityTimeseriesGroupSPFParamsDateRange1dControl RadarEmailSecurityTimeseriesGroupSPFParamsDateRange = "1dControl"
- RadarEmailSecurityTimeseriesGroupSPFParamsDateRange2dControl RadarEmailSecurityTimeseriesGroupSPFParamsDateRange = "2dControl"
- RadarEmailSecurityTimeseriesGroupSPFParamsDateRange7dControl RadarEmailSecurityTimeseriesGroupSPFParamsDateRange = "7dControl"
- RadarEmailSecurityTimeseriesGroupSPFParamsDateRange14dControl RadarEmailSecurityTimeseriesGroupSPFParamsDateRange = "14dControl"
- RadarEmailSecurityTimeseriesGroupSPFParamsDateRange28dControl RadarEmailSecurityTimeseriesGroupSPFParamsDateRange = "28dControl"
- RadarEmailSecurityTimeseriesGroupSPFParamsDateRange12wControl RadarEmailSecurityTimeseriesGroupSPFParamsDateRange = "12wControl"
- RadarEmailSecurityTimeseriesGroupSPFParamsDateRange24wControl RadarEmailSecurityTimeseriesGroupSPFParamsDateRange = "24wControl"
-)
-
-type RadarEmailSecurityTimeseriesGroupSPFParamsDKIM string
-
-const (
- RadarEmailSecurityTimeseriesGroupSPFParamsDKIMPass RadarEmailSecurityTimeseriesGroupSPFParamsDKIM = "PASS"
- RadarEmailSecurityTimeseriesGroupSPFParamsDKIMNone RadarEmailSecurityTimeseriesGroupSPFParamsDKIM = "NONE"
- RadarEmailSecurityTimeseriesGroupSPFParamsDKIMFail RadarEmailSecurityTimeseriesGroupSPFParamsDKIM = "FAIL"
-)
-
-type RadarEmailSecurityTimeseriesGroupSPFParamsDMARC string
-
-const (
- RadarEmailSecurityTimeseriesGroupSPFParamsDMARCPass RadarEmailSecurityTimeseriesGroupSPFParamsDMARC = "PASS"
- RadarEmailSecurityTimeseriesGroupSPFParamsDMARCNone RadarEmailSecurityTimeseriesGroupSPFParamsDMARC = "NONE"
- RadarEmailSecurityTimeseriesGroupSPFParamsDMARCFail RadarEmailSecurityTimeseriesGroupSPFParamsDMARC = "FAIL"
-)
-
-// Format results are returned in.
-type RadarEmailSecurityTimeseriesGroupSPFParamsFormat string
-
-const (
- RadarEmailSecurityTimeseriesGroupSPFParamsFormatJson RadarEmailSecurityTimeseriesGroupSPFParamsFormat = "JSON"
- 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"`
- JSON radarEmailSecurityTimeseriesGroupSPFResponseEnvelopeJSON `json:"-"`
-}
-
-// radarEmailSecurityTimeseriesGroupSPFResponseEnvelopeJSON contains the JSON
-// metadata for the struct [RadarEmailSecurityTimeseriesGroupSPFResponseEnvelope]
-type radarEmailSecurityTimeseriesGroupSPFResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecurityTimeseriesGroupSPFResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecurityTimeseriesGroupSPFResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecurityTimeseriesGroupSpoofParams struct {
- // Aggregation interval results should be returned in (for example, in 15 minutes
- // or 1 hour intervals). Refer to
- // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
- AggInterval param.Field[RadarEmailSecurityTimeseriesGroupSpoofParamsAggInterval] `query:"aggInterval"`
- // Filter for arc (Authenticated Received Chain).
- ARC param.Field[[]RadarEmailSecurityTimeseriesGroupSpoofParamsARC] `query:"arc"`
- // 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[[]RadarEmailSecurityTimeseriesGroupSpoofParamsDateRange] `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[[]RadarEmailSecurityTimeseriesGroupSpoofParamsDKIM] `query:"dkim"`
- // Filter for dmarc.
- DMARC param.Field[[]RadarEmailSecurityTimeseriesGroupSpoofParamsDMARC] `query:"dmarc"`
- // Format results are returned in.
- Format param.Field[RadarEmailSecurityTimeseriesGroupSpoofParamsFormat] `query:"format"`
- // 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[[]RadarEmailSecurityTimeseriesGroupSpoofParamsSPF] `query:"spf"`
- // Filter for tls version.
- TLSVersion param.Field[[]RadarEmailSecurityTimeseriesGroupSpoofParamsTLSVersion] `query:"tlsVersion"`
-}
-
-// URLQuery serializes [RadarEmailSecurityTimeseriesGroupSpoofParams]'s query
-// parameters as `url.Values`.
-func (r RadarEmailSecurityTimeseriesGroupSpoofParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Aggregation interval results should be returned in (for example, in 15 minutes
-// or 1 hour intervals). Refer to
-// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
-type RadarEmailSecurityTimeseriesGroupSpoofParamsAggInterval string
-
-const (
- RadarEmailSecurityTimeseriesGroupSpoofParamsAggInterval15m RadarEmailSecurityTimeseriesGroupSpoofParamsAggInterval = "15m"
- RadarEmailSecurityTimeseriesGroupSpoofParamsAggInterval1h RadarEmailSecurityTimeseriesGroupSpoofParamsAggInterval = "1h"
- RadarEmailSecurityTimeseriesGroupSpoofParamsAggInterval1d RadarEmailSecurityTimeseriesGroupSpoofParamsAggInterval = "1d"
- RadarEmailSecurityTimeseriesGroupSpoofParamsAggInterval1w RadarEmailSecurityTimeseriesGroupSpoofParamsAggInterval = "1w"
-)
-
-type RadarEmailSecurityTimeseriesGroupSpoofParamsARC string
-
-const (
- RadarEmailSecurityTimeseriesGroupSpoofParamsARCPass RadarEmailSecurityTimeseriesGroupSpoofParamsARC = "PASS"
- RadarEmailSecurityTimeseriesGroupSpoofParamsARCNone RadarEmailSecurityTimeseriesGroupSpoofParamsARC = "NONE"
- RadarEmailSecurityTimeseriesGroupSpoofParamsARCFail RadarEmailSecurityTimeseriesGroupSpoofParamsARC = "FAIL"
-)
-
-type RadarEmailSecurityTimeseriesGroupSpoofParamsDateRange string
-
-const (
- RadarEmailSecurityTimeseriesGroupSpoofParamsDateRange1d RadarEmailSecurityTimeseriesGroupSpoofParamsDateRange = "1d"
- RadarEmailSecurityTimeseriesGroupSpoofParamsDateRange2d RadarEmailSecurityTimeseriesGroupSpoofParamsDateRange = "2d"
- RadarEmailSecurityTimeseriesGroupSpoofParamsDateRange7d RadarEmailSecurityTimeseriesGroupSpoofParamsDateRange = "7d"
- RadarEmailSecurityTimeseriesGroupSpoofParamsDateRange14d RadarEmailSecurityTimeseriesGroupSpoofParamsDateRange = "14d"
- RadarEmailSecurityTimeseriesGroupSpoofParamsDateRange28d RadarEmailSecurityTimeseriesGroupSpoofParamsDateRange = "28d"
- RadarEmailSecurityTimeseriesGroupSpoofParamsDateRange12w RadarEmailSecurityTimeseriesGroupSpoofParamsDateRange = "12w"
- RadarEmailSecurityTimeseriesGroupSpoofParamsDateRange24w RadarEmailSecurityTimeseriesGroupSpoofParamsDateRange = "24w"
- RadarEmailSecurityTimeseriesGroupSpoofParamsDateRange52w RadarEmailSecurityTimeseriesGroupSpoofParamsDateRange = "52w"
- RadarEmailSecurityTimeseriesGroupSpoofParamsDateRange1dControl RadarEmailSecurityTimeseriesGroupSpoofParamsDateRange = "1dControl"
- RadarEmailSecurityTimeseriesGroupSpoofParamsDateRange2dControl RadarEmailSecurityTimeseriesGroupSpoofParamsDateRange = "2dControl"
- RadarEmailSecurityTimeseriesGroupSpoofParamsDateRange7dControl RadarEmailSecurityTimeseriesGroupSpoofParamsDateRange = "7dControl"
- RadarEmailSecurityTimeseriesGroupSpoofParamsDateRange14dControl RadarEmailSecurityTimeseriesGroupSpoofParamsDateRange = "14dControl"
- RadarEmailSecurityTimeseriesGroupSpoofParamsDateRange28dControl RadarEmailSecurityTimeseriesGroupSpoofParamsDateRange = "28dControl"
- RadarEmailSecurityTimeseriesGroupSpoofParamsDateRange12wControl RadarEmailSecurityTimeseriesGroupSpoofParamsDateRange = "12wControl"
- RadarEmailSecurityTimeseriesGroupSpoofParamsDateRange24wControl RadarEmailSecurityTimeseriesGroupSpoofParamsDateRange = "24wControl"
-)
-
-type RadarEmailSecurityTimeseriesGroupSpoofParamsDKIM string
-
-const (
- RadarEmailSecurityTimeseriesGroupSpoofParamsDKIMPass RadarEmailSecurityTimeseriesGroupSpoofParamsDKIM = "PASS"
- RadarEmailSecurityTimeseriesGroupSpoofParamsDKIMNone RadarEmailSecurityTimeseriesGroupSpoofParamsDKIM = "NONE"
- RadarEmailSecurityTimeseriesGroupSpoofParamsDKIMFail RadarEmailSecurityTimeseriesGroupSpoofParamsDKIM = "FAIL"
-)
-
-type RadarEmailSecurityTimeseriesGroupSpoofParamsDMARC string
-
-const (
- RadarEmailSecurityTimeseriesGroupSpoofParamsDMARCPass RadarEmailSecurityTimeseriesGroupSpoofParamsDMARC = "PASS"
- RadarEmailSecurityTimeseriesGroupSpoofParamsDMARCNone RadarEmailSecurityTimeseriesGroupSpoofParamsDMARC = "NONE"
- RadarEmailSecurityTimeseriesGroupSpoofParamsDMARCFail RadarEmailSecurityTimeseriesGroupSpoofParamsDMARC = "FAIL"
-)
-
-// Format results are returned in.
-type RadarEmailSecurityTimeseriesGroupSpoofParamsFormat string
-
-const (
- RadarEmailSecurityTimeseriesGroupSpoofParamsFormatJson RadarEmailSecurityTimeseriesGroupSpoofParamsFormat = "JSON"
- RadarEmailSecurityTimeseriesGroupSpoofParamsFormatCsv RadarEmailSecurityTimeseriesGroupSpoofParamsFormat = "CSV"
-)
-
-type RadarEmailSecurityTimeseriesGroupSpoofParamsSPF string
-
-const (
- RadarEmailSecurityTimeseriesGroupSpoofParamsSPFPass RadarEmailSecurityTimeseriesGroupSpoofParamsSPF = "PASS"
- RadarEmailSecurityTimeseriesGroupSpoofParamsSPFNone RadarEmailSecurityTimeseriesGroupSpoofParamsSPF = "NONE"
- RadarEmailSecurityTimeseriesGroupSpoofParamsSPFFail RadarEmailSecurityTimeseriesGroupSpoofParamsSPF = "FAIL"
-)
-
-type RadarEmailSecurityTimeseriesGroupSpoofParamsTLSVersion string
-
-const (
- RadarEmailSecurityTimeseriesGroupSpoofParamsTLSVersionTlSv1_0 RadarEmailSecurityTimeseriesGroupSpoofParamsTLSVersion = "TLSv1_0"
- RadarEmailSecurityTimeseriesGroupSpoofParamsTLSVersionTlSv1_1 RadarEmailSecurityTimeseriesGroupSpoofParamsTLSVersion = "TLSv1_1"
- RadarEmailSecurityTimeseriesGroupSpoofParamsTLSVersionTlSv1_2 RadarEmailSecurityTimeseriesGroupSpoofParamsTLSVersion = "TLSv1_2"
- RadarEmailSecurityTimeseriesGroupSpoofParamsTLSVersionTlSv1_3 RadarEmailSecurityTimeseriesGroupSpoofParamsTLSVersion = "TLSv1_3"
-)
-
-type RadarEmailSecurityTimeseriesGroupSpoofResponseEnvelope struct {
- Result RadarEmailSecurityTimeseriesGroupSpoofResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarEmailSecurityTimeseriesGroupSpoofResponseEnvelopeJSON `json:"-"`
-}
-
-// radarEmailSecurityTimeseriesGroupSpoofResponseEnvelopeJSON contains the JSON
-// metadata for the struct [RadarEmailSecurityTimeseriesGroupSpoofResponseEnvelope]
-type radarEmailSecurityTimeseriesGroupSpoofResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecurityTimeseriesGroupSpoofResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecurityTimeseriesGroupSpoofResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecurityTimeseriesGroupThreatCategoryParams struct {
- // Aggregation interval results should be returned in (for example, in 15 minutes
- // or 1 hour intervals). Refer to
- // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
- AggInterval param.Field[RadarEmailSecurityTimeseriesGroupThreatCategoryParamsAggInterval] `query:"aggInterval"`
- // Filter for arc (Authenticated Received Chain).
- ARC param.Field[[]RadarEmailSecurityTimeseriesGroupThreatCategoryParamsARC] `query:"arc"`
- // 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[[]RadarEmailSecurityTimeseriesGroupThreatCategoryParamsDateRange] `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[[]RadarEmailSecurityTimeseriesGroupThreatCategoryParamsDKIM] `query:"dkim"`
- // Filter for dmarc.
- DMARC param.Field[[]RadarEmailSecurityTimeseriesGroupThreatCategoryParamsDMARC] `query:"dmarc"`
- // Format results are returned in.
- Format param.Field[RadarEmailSecurityTimeseriesGroupThreatCategoryParamsFormat] `query:"format"`
- // 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
-// query parameters as `url.Values`.
-func (r RadarEmailSecurityTimeseriesGroupThreatCategoryParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Aggregation interval results should be returned in (for example, in 15 minutes
-// or 1 hour intervals). Refer to
-// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
-type RadarEmailSecurityTimeseriesGroupThreatCategoryParamsAggInterval string
-
-const (
- RadarEmailSecurityTimeseriesGroupThreatCategoryParamsAggInterval15m RadarEmailSecurityTimeseriesGroupThreatCategoryParamsAggInterval = "15m"
- RadarEmailSecurityTimeseriesGroupThreatCategoryParamsAggInterval1h RadarEmailSecurityTimeseriesGroupThreatCategoryParamsAggInterval = "1h"
- RadarEmailSecurityTimeseriesGroupThreatCategoryParamsAggInterval1d RadarEmailSecurityTimeseriesGroupThreatCategoryParamsAggInterval = "1d"
- RadarEmailSecurityTimeseriesGroupThreatCategoryParamsAggInterval1w RadarEmailSecurityTimeseriesGroupThreatCategoryParamsAggInterval = "1w"
-)
-
-type RadarEmailSecurityTimeseriesGroupThreatCategoryParamsARC string
-
-const (
- RadarEmailSecurityTimeseriesGroupThreatCategoryParamsARCPass RadarEmailSecurityTimeseriesGroupThreatCategoryParamsARC = "PASS"
- RadarEmailSecurityTimeseriesGroupThreatCategoryParamsARCNone RadarEmailSecurityTimeseriesGroupThreatCategoryParamsARC = "NONE"
- RadarEmailSecurityTimeseriesGroupThreatCategoryParamsARCFail RadarEmailSecurityTimeseriesGroupThreatCategoryParamsARC = "FAIL"
-)
-
-type RadarEmailSecurityTimeseriesGroupThreatCategoryParamsDateRange string
-
-const (
- RadarEmailSecurityTimeseriesGroupThreatCategoryParamsDateRange1d RadarEmailSecurityTimeseriesGroupThreatCategoryParamsDateRange = "1d"
- RadarEmailSecurityTimeseriesGroupThreatCategoryParamsDateRange2d RadarEmailSecurityTimeseriesGroupThreatCategoryParamsDateRange = "2d"
- RadarEmailSecurityTimeseriesGroupThreatCategoryParamsDateRange7d RadarEmailSecurityTimeseriesGroupThreatCategoryParamsDateRange = "7d"
- RadarEmailSecurityTimeseriesGroupThreatCategoryParamsDateRange14d RadarEmailSecurityTimeseriesGroupThreatCategoryParamsDateRange = "14d"
- RadarEmailSecurityTimeseriesGroupThreatCategoryParamsDateRange28d RadarEmailSecurityTimeseriesGroupThreatCategoryParamsDateRange = "28d"
- RadarEmailSecurityTimeseriesGroupThreatCategoryParamsDateRange12w RadarEmailSecurityTimeseriesGroupThreatCategoryParamsDateRange = "12w"
- RadarEmailSecurityTimeseriesGroupThreatCategoryParamsDateRange24w RadarEmailSecurityTimeseriesGroupThreatCategoryParamsDateRange = "24w"
- RadarEmailSecurityTimeseriesGroupThreatCategoryParamsDateRange52w RadarEmailSecurityTimeseriesGroupThreatCategoryParamsDateRange = "52w"
- RadarEmailSecurityTimeseriesGroupThreatCategoryParamsDateRange1dControl RadarEmailSecurityTimeseriesGroupThreatCategoryParamsDateRange = "1dControl"
- RadarEmailSecurityTimeseriesGroupThreatCategoryParamsDateRange2dControl RadarEmailSecurityTimeseriesGroupThreatCategoryParamsDateRange = "2dControl"
- RadarEmailSecurityTimeseriesGroupThreatCategoryParamsDateRange7dControl RadarEmailSecurityTimeseriesGroupThreatCategoryParamsDateRange = "7dControl"
- RadarEmailSecurityTimeseriesGroupThreatCategoryParamsDateRange14dControl RadarEmailSecurityTimeseriesGroupThreatCategoryParamsDateRange = "14dControl"
- RadarEmailSecurityTimeseriesGroupThreatCategoryParamsDateRange28dControl RadarEmailSecurityTimeseriesGroupThreatCategoryParamsDateRange = "28dControl"
- RadarEmailSecurityTimeseriesGroupThreatCategoryParamsDateRange12wControl RadarEmailSecurityTimeseriesGroupThreatCategoryParamsDateRange = "12wControl"
- RadarEmailSecurityTimeseriesGroupThreatCategoryParamsDateRange24wControl RadarEmailSecurityTimeseriesGroupThreatCategoryParamsDateRange = "24wControl"
-)
-
-type RadarEmailSecurityTimeseriesGroupThreatCategoryParamsDKIM string
-
-const (
- RadarEmailSecurityTimeseriesGroupThreatCategoryParamsDKIMPass RadarEmailSecurityTimeseriesGroupThreatCategoryParamsDKIM = "PASS"
- RadarEmailSecurityTimeseriesGroupThreatCategoryParamsDKIMNone RadarEmailSecurityTimeseriesGroupThreatCategoryParamsDKIM = "NONE"
- RadarEmailSecurityTimeseriesGroupThreatCategoryParamsDKIMFail RadarEmailSecurityTimeseriesGroupThreatCategoryParamsDKIM = "FAIL"
-)
-
-type RadarEmailSecurityTimeseriesGroupThreatCategoryParamsDMARC string
-
-const (
- RadarEmailSecurityTimeseriesGroupThreatCategoryParamsDMARCPass RadarEmailSecurityTimeseriesGroupThreatCategoryParamsDMARC = "PASS"
- RadarEmailSecurityTimeseriesGroupThreatCategoryParamsDMARCNone RadarEmailSecurityTimeseriesGroupThreatCategoryParamsDMARC = "NONE"
- RadarEmailSecurityTimeseriesGroupThreatCategoryParamsDMARCFail RadarEmailSecurityTimeseriesGroupThreatCategoryParamsDMARC = "FAIL"
-)
-
-// Format results are returned in.
-type RadarEmailSecurityTimeseriesGroupThreatCategoryParamsFormat string
-
-const (
- RadarEmailSecurityTimeseriesGroupThreatCategoryParamsFormatJson RadarEmailSecurityTimeseriesGroupThreatCategoryParamsFormat = "JSON"
- RadarEmailSecurityTimeseriesGroupThreatCategoryParamsFormatCsv RadarEmailSecurityTimeseriesGroupThreatCategoryParamsFormat = "CSV"
-)
-
-type RadarEmailSecurityTimeseriesGroupThreatCategoryParamsSPF string
-
-const (
- RadarEmailSecurityTimeseriesGroupThreatCategoryParamsSPFPass RadarEmailSecurityTimeseriesGroupThreatCategoryParamsSPF = "PASS"
- RadarEmailSecurityTimeseriesGroupThreatCategoryParamsSPFNone RadarEmailSecurityTimeseriesGroupThreatCategoryParamsSPF = "NONE"
- 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"`
- JSON radarEmailSecurityTimeseriesGroupThreatCategoryResponseEnvelopeJSON `json:"-"`
-}
-
-// radarEmailSecurityTimeseriesGroupThreatCategoryResponseEnvelopeJSON contains the
-// JSON metadata for the struct
-// [RadarEmailSecurityTimeseriesGroupThreatCategoryResponseEnvelope]
-type radarEmailSecurityTimeseriesGroupThreatCategoryResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecurityTimeseriesGroupThreatCategoryResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecurityTimeseriesGroupThreatCategoryResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecurityTimeseriesGroupTLSVersionParams struct {
- // Aggregation interval results should be returned in (for example, in 15 minutes
- // or 1 hour intervals). Refer to
- // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
- AggInterval param.Field[RadarEmailSecurityTimeseriesGroupTLSVersionParamsAggInterval] `query:"aggInterval"`
- // Filter for arc (Authenticated Received Chain).
- ARC param.Field[[]RadarEmailSecurityTimeseriesGroupTLSVersionParamsARC] `query:"arc"`
- // 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[[]RadarEmailSecurityTimeseriesGroupTLSVersionParamsDateRange] `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[[]RadarEmailSecurityTimeseriesGroupTLSVersionParamsDKIM] `query:"dkim"`
- // Filter for dmarc.
- DMARC param.Field[[]RadarEmailSecurityTimeseriesGroupTLSVersionParamsDMARC] `query:"dmarc"`
- // Format results are returned in.
- Format param.Field[RadarEmailSecurityTimeseriesGroupTLSVersionParamsFormat] `query:"format"`
- // 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[[]RadarEmailSecurityTimeseriesGroupTLSVersionParamsSPF] `query:"spf"`
-}
-
-// URLQuery serializes [RadarEmailSecurityTimeseriesGroupTLSVersionParams]'s query
-// parameters as `url.Values`.
-func (r RadarEmailSecurityTimeseriesGroupTLSVersionParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Aggregation interval results should be returned in (for example, in 15 minutes
-// or 1 hour intervals). Refer to
-// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
-type RadarEmailSecurityTimeseriesGroupTLSVersionParamsAggInterval string
-
-const (
- RadarEmailSecurityTimeseriesGroupTLSVersionParamsAggInterval15m RadarEmailSecurityTimeseriesGroupTLSVersionParamsAggInterval = "15m"
- RadarEmailSecurityTimeseriesGroupTLSVersionParamsAggInterval1h RadarEmailSecurityTimeseriesGroupTLSVersionParamsAggInterval = "1h"
- RadarEmailSecurityTimeseriesGroupTLSVersionParamsAggInterval1d RadarEmailSecurityTimeseriesGroupTLSVersionParamsAggInterval = "1d"
- RadarEmailSecurityTimeseriesGroupTLSVersionParamsAggInterval1w RadarEmailSecurityTimeseriesGroupTLSVersionParamsAggInterval = "1w"
-)
-
-type RadarEmailSecurityTimeseriesGroupTLSVersionParamsARC string
-
-const (
- RadarEmailSecurityTimeseriesGroupTLSVersionParamsARCPass RadarEmailSecurityTimeseriesGroupTLSVersionParamsARC = "PASS"
- RadarEmailSecurityTimeseriesGroupTLSVersionParamsARCNone RadarEmailSecurityTimeseriesGroupTLSVersionParamsARC = "NONE"
- RadarEmailSecurityTimeseriesGroupTLSVersionParamsARCFail RadarEmailSecurityTimeseriesGroupTLSVersionParamsARC = "FAIL"
-)
-
-type RadarEmailSecurityTimeseriesGroupTLSVersionParamsDateRange string
-
-const (
- RadarEmailSecurityTimeseriesGroupTLSVersionParamsDateRange1d RadarEmailSecurityTimeseriesGroupTLSVersionParamsDateRange = "1d"
- RadarEmailSecurityTimeseriesGroupTLSVersionParamsDateRange2d RadarEmailSecurityTimeseriesGroupTLSVersionParamsDateRange = "2d"
- RadarEmailSecurityTimeseriesGroupTLSVersionParamsDateRange7d RadarEmailSecurityTimeseriesGroupTLSVersionParamsDateRange = "7d"
- RadarEmailSecurityTimeseriesGroupTLSVersionParamsDateRange14d RadarEmailSecurityTimeseriesGroupTLSVersionParamsDateRange = "14d"
- RadarEmailSecurityTimeseriesGroupTLSVersionParamsDateRange28d RadarEmailSecurityTimeseriesGroupTLSVersionParamsDateRange = "28d"
- RadarEmailSecurityTimeseriesGroupTLSVersionParamsDateRange12w RadarEmailSecurityTimeseriesGroupTLSVersionParamsDateRange = "12w"
- RadarEmailSecurityTimeseriesGroupTLSVersionParamsDateRange24w RadarEmailSecurityTimeseriesGroupTLSVersionParamsDateRange = "24w"
- RadarEmailSecurityTimeseriesGroupTLSVersionParamsDateRange52w RadarEmailSecurityTimeseriesGroupTLSVersionParamsDateRange = "52w"
- RadarEmailSecurityTimeseriesGroupTLSVersionParamsDateRange1dControl RadarEmailSecurityTimeseriesGroupTLSVersionParamsDateRange = "1dControl"
- RadarEmailSecurityTimeseriesGroupTLSVersionParamsDateRange2dControl RadarEmailSecurityTimeseriesGroupTLSVersionParamsDateRange = "2dControl"
- RadarEmailSecurityTimeseriesGroupTLSVersionParamsDateRange7dControl RadarEmailSecurityTimeseriesGroupTLSVersionParamsDateRange = "7dControl"
- RadarEmailSecurityTimeseriesGroupTLSVersionParamsDateRange14dControl RadarEmailSecurityTimeseriesGroupTLSVersionParamsDateRange = "14dControl"
- RadarEmailSecurityTimeseriesGroupTLSVersionParamsDateRange28dControl RadarEmailSecurityTimeseriesGroupTLSVersionParamsDateRange = "28dControl"
- RadarEmailSecurityTimeseriesGroupTLSVersionParamsDateRange12wControl RadarEmailSecurityTimeseriesGroupTLSVersionParamsDateRange = "12wControl"
- RadarEmailSecurityTimeseriesGroupTLSVersionParamsDateRange24wControl RadarEmailSecurityTimeseriesGroupTLSVersionParamsDateRange = "24wControl"
-)
-
-type RadarEmailSecurityTimeseriesGroupTLSVersionParamsDKIM string
-
-const (
- RadarEmailSecurityTimeseriesGroupTLSVersionParamsDKIMPass RadarEmailSecurityTimeseriesGroupTLSVersionParamsDKIM = "PASS"
- RadarEmailSecurityTimeseriesGroupTLSVersionParamsDKIMNone RadarEmailSecurityTimeseriesGroupTLSVersionParamsDKIM = "NONE"
- RadarEmailSecurityTimeseriesGroupTLSVersionParamsDKIMFail RadarEmailSecurityTimeseriesGroupTLSVersionParamsDKIM = "FAIL"
-)
-
-type RadarEmailSecurityTimeseriesGroupTLSVersionParamsDMARC string
-
-const (
- RadarEmailSecurityTimeseriesGroupTLSVersionParamsDMARCPass RadarEmailSecurityTimeseriesGroupTLSVersionParamsDMARC = "PASS"
- RadarEmailSecurityTimeseriesGroupTLSVersionParamsDMARCNone RadarEmailSecurityTimeseriesGroupTLSVersionParamsDMARC = "NONE"
- RadarEmailSecurityTimeseriesGroupTLSVersionParamsDMARCFail RadarEmailSecurityTimeseriesGroupTLSVersionParamsDMARC = "FAIL"
-)
-
-// Format results are returned in.
-type RadarEmailSecurityTimeseriesGroupTLSVersionParamsFormat string
-
-const (
- RadarEmailSecurityTimeseriesGroupTLSVersionParamsFormatJson RadarEmailSecurityTimeseriesGroupTLSVersionParamsFormat = "JSON"
- RadarEmailSecurityTimeseriesGroupTLSVersionParamsFormatCsv RadarEmailSecurityTimeseriesGroupTLSVersionParamsFormat = "CSV"
-)
-
-type RadarEmailSecurityTimeseriesGroupTLSVersionParamsSPF string
-
-const (
- RadarEmailSecurityTimeseriesGroupTLSVersionParamsSPFPass RadarEmailSecurityTimeseriesGroupTLSVersionParamsSPF = "PASS"
- RadarEmailSecurityTimeseriesGroupTLSVersionParamsSPFNone RadarEmailSecurityTimeseriesGroupTLSVersionParamsSPF = "NONE"
- RadarEmailSecurityTimeseriesGroupTLSVersionParamsSPFFail RadarEmailSecurityTimeseriesGroupTLSVersionParamsSPF = "FAIL"
-)
-
-type RadarEmailSecurityTimeseriesGroupTLSVersionResponseEnvelope struct {
- Result RadarEmailSecurityTimeseriesGroupTLSVersionResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarEmailSecurityTimeseriesGroupTLSVersionResponseEnvelopeJSON `json:"-"`
-}
-
-// radarEmailSecurityTimeseriesGroupTLSVersionResponseEnvelopeJSON contains the
-// JSON metadata for the struct
-// [RadarEmailSecurityTimeseriesGroupTLSVersionResponseEnvelope]
-type radarEmailSecurityTimeseriesGroupTLSVersionResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecurityTimeseriesGroupTLSVersionResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecurityTimeseriesGroupTLSVersionResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
diff --git a/radaremailsecuritytimeseriesgroup_test.go b/radaremailsecuritytimeseriesgroup_test.go
deleted file mode 100644
index a5033831376..00000000000
--- a/radaremailsecuritytimeseriesgroup_test.go
+++ /dev/null
@@ -1,334 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
- "time"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRadarEmailSecurityTimeseriesGroupARCWithOptionalParams(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"),
- )
- _, err := client.Radar.Email.Security.TimeseriesGroups.ARC(context.TODO(), cloudflare.RadarEmailSecurityTimeseriesGroupARCParams{
- AggInterval: cloudflare.F(cloudflare.RadarEmailSecurityTimeseriesGroupARCParamsAggInterval1h),
- 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),
- 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
- if errors.As(err, &apierr) {
- t.Log(string(apierr.DumpRequest(true)))
- }
- t.Fatalf("err should be nil: %s", err.Error())
- }
-}
-
-func TestRadarEmailSecurityTimeseriesGroupDKIMWithOptionalParams(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"),
- )
- _, 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}),
- 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),
- 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
- if errors.As(err, &apierr) {
- t.Log(string(apierr.DumpRequest(true)))
- }
- t.Fatalf("err should be nil: %s", err.Error())
- }
-}
-
-func TestRadarEmailSecurityTimeseriesGroupDMARCWithOptionalParams(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"),
- )
- _, 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}),
- 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),
- 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
- if errors.As(err, &apierr) {
- t.Log(string(apierr.DumpRequest(true)))
- }
- t.Fatalf("err should be nil: %s", err.Error())
- }
-}
-
-func TestRadarEmailSecurityTimeseriesGroupMaliciousWithOptionalParams(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"),
- )
- _, 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}),
- 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),
- 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
- if errors.As(err, &apierr) {
- t.Log(string(apierr.DumpRequest(true)))
- }
- t.Fatalf("err should be nil: %s", err.Error())
- }
-}
-
-func TestRadarEmailSecurityTimeseriesGroupSpamWithOptionalParams(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"),
- )
- _, 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}),
- 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),
- 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
- if errors.As(err, &apierr) {
- t.Log(string(apierr.DumpRequest(true)))
- }
- t.Fatalf("err should be nil: %s", err.Error())
- }
-}
-
-func TestRadarEmailSecurityTimeseriesGroupSPFWithOptionalParams(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"),
- )
- _, 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}),
- 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),
- 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
- if errors.As(err, &apierr) {
- t.Log(string(apierr.DumpRequest(true)))
- }
- t.Fatalf("err should be nil: %s", err.Error())
- }
-}
-
-func TestRadarEmailSecurityTimeseriesGroupSpoofWithOptionalParams(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"),
- )
- _, err := client.Radar.Email.Security.TimeseriesGroups.Spoof(context.TODO(), cloudflare.RadarEmailSecurityTimeseriesGroupSpoofParams{
- AggInterval: cloudflare.F(cloudflare.RadarEmailSecurityTimeseriesGroupSpoofParamsAggInterval1h),
- ARC: cloudflare.F([]cloudflare.RadarEmailSecurityTimeseriesGroupSpoofParamsARC{cloudflare.RadarEmailSecurityTimeseriesGroupSpoofParamsARCPass, cloudflare.RadarEmailSecurityTimeseriesGroupSpoofParamsARCNone, cloudflare.RadarEmailSecurityTimeseriesGroupSpoofParamsARCFail}),
- DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
- DateRange: cloudflare.F([]cloudflare.RadarEmailSecurityTimeseriesGroupSpoofParamsDateRange{cloudflare.RadarEmailSecurityTimeseriesGroupSpoofParamsDateRange1d, cloudflare.RadarEmailSecurityTimeseriesGroupSpoofParamsDateRange2d, cloudflare.RadarEmailSecurityTimeseriesGroupSpoofParamsDateRange7d}),
- DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
- DKIM: cloudflare.F([]cloudflare.RadarEmailSecurityTimeseriesGroupSpoofParamsDKIM{cloudflare.RadarEmailSecurityTimeseriesGroupSpoofParamsDKIMPass, cloudflare.RadarEmailSecurityTimeseriesGroupSpoofParamsDKIMNone, cloudflare.RadarEmailSecurityTimeseriesGroupSpoofParamsDKIMFail}),
- DMARC: cloudflare.F([]cloudflare.RadarEmailSecurityTimeseriesGroupSpoofParamsDMARC{cloudflare.RadarEmailSecurityTimeseriesGroupSpoofParamsDMARCPass, cloudflare.RadarEmailSecurityTimeseriesGroupSpoofParamsDMARCNone, cloudflare.RadarEmailSecurityTimeseriesGroupSpoofParamsDMARCFail}),
- Format: cloudflare.F(cloudflare.RadarEmailSecurityTimeseriesGroupSpoofParamsFormatJson),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- SPF: cloudflare.F([]cloudflare.RadarEmailSecurityTimeseriesGroupSpoofParamsSPF{cloudflare.RadarEmailSecurityTimeseriesGroupSpoofParamsSPFPass, cloudflare.RadarEmailSecurityTimeseriesGroupSpoofParamsSPFNone, cloudflare.RadarEmailSecurityTimeseriesGroupSpoofParamsSPFFail}),
- TLSVersion: cloudflare.F([]cloudflare.RadarEmailSecurityTimeseriesGroupSpoofParamsTLSVersion{cloudflare.RadarEmailSecurityTimeseriesGroupSpoofParamsTLSVersionTlSv1_0, cloudflare.RadarEmailSecurityTimeseriesGroupSpoofParamsTLSVersionTlSv1_1, cloudflare.RadarEmailSecurityTimeseriesGroupSpoofParamsTLSVersionTlSv1_2}),
- })
- 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())
- }
-}
-
-func TestRadarEmailSecurityTimeseriesGroupThreatCategoryWithOptionalParams(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"),
- )
- _, 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}),
- 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),
- 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
- if errors.As(err, &apierr) {
- t.Log(string(apierr.DumpRequest(true)))
- }
- t.Fatalf("err should be nil: %s", err.Error())
- }
-}
-
-func TestRadarEmailSecurityTimeseriesGroupTLSVersionWithOptionalParams(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"),
- )
- _, err := client.Radar.Email.Security.TimeseriesGroups.TLSVersion(context.TODO(), cloudflare.RadarEmailSecurityTimeseriesGroupTLSVersionParams{
- AggInterval: cloudflare.F(cloudflare.RadarEmailSecurityTimeseriesGroupTLSVersionParamsAggInterval1h),
- ARC: cloudflare.F([]cloudflare.RadarEmailSecurityTimeseriesGroupTLSVersionParamsARC{cloudflare.RadarEmailSecurityTimeseriesGroupTLSVersionParamsARCPass, cloudflare.RadarEmailSecurityTimeseriesGroupTLSVersionParamsARCNone, cloudflare.RadarEmailSecurityTimeseriesGroupTLSVersionParamsARCFail}),
- DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
- DateRange: cloudflare.F([]cloudflare.RadarEmailSecurityTimeseriesGroupTLSVersionParamsDateRange{cloudflare.RadarEmailSecurityTimeseriesGroupTLSVersionParamsDateRange1d, cloudflare.RadarEmailSecurityTimeseriesGroupTLSVersionParamsDateRange2d, cloudflare.RadarEmailSecurityTimeseriesGroupTLSVersionParamsDateRange7d}),
- DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
- DKIM: cloudflare.F([]cloudflare.RadarEmailSecurityTimeseriesGroupTLSVersionParamsDKIM{cloudflare.RadarEmailSecurityTimeseriesGroupTLSVersionParamsDKIMPass, cloudflare.RadarEmailSecurityTimeseriesGroupTLSVersionParamsDKIMNone, cloudflare.RadarEmailSecurityTimeseriesGroupTLSVersionParamsDKIMFail}),
- DMARC: cloudflare.F([]cloudflare.RadarEmailSecurityTimeseriesGroupTLSVersionParamsDMARC{cloudflare.RadarEmailSecurityTimeseriesGroupTLSVersionParamsDMARCPass, cloudflare.RadarEmailSecurityTimeseriesGroupTLSVersionParamsDMARCNone, cloudflare.RadarEmailSecurityTimeseriesGroupTLSVersionParamsDMARCFail}),
- Format: cloudflare.F(cloudflare.RadarEmailSecurityTimeseriesGroupTLSVersionParamsFormatJson),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- SPF: cloudflare.F([]cloudflare.RadarEmailSecurityTimeseriesGroupTLSVersionParamsSPF{cloudflare.RadarEmailSecurityTimeseriesGroupTLSVersionParamsSPFPass, cloudflare.RadarEmailSecurityTimeseriesGroupTLSVersionParamsSPFNone, cloudflare.RadarEmailSecurityTimeseriesGroupTLSVersionParamsSPFFail}),
- })
- 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/radaremailsecuritytop.go b/radaremailsecuritytop.go
deleted file mode 100644
index 07de49b25fe..00000000000
--- a/radaremailsecuritytop.go
+++ /dev/null
@@ -1,27 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarEmailSecurityTopService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewRadarEmailSecurityTopService]
-// method instead.
-type RadarEmailSecurityTopService struct {
- Options []option.RequestOption
- Tlds *RadarEmailSecurityTopTldService
-}
-
-// NewRadarEmailSecurityTopService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewRadarEmailSecurityTopService(opts ...option.RequestOption) (r *RadarEmailSecurityTopService) {
- r = &RadarEmailSecurityTopService{}
- r.Options = opts
- r.Tlds = NewRadarEmailSecurityTopTldService(opts...)
- return
-}
diff --git a/radaremailsecuritytoptld.go b/radaremailsecuritytoptld.go
deleted file mode 100644
index b3804997c11..00000000000
--- a/radaremailsecuritytoptld.go
+++ /dev/null
@@ -1,345 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarEmailSecurityTopTldService contains methods and other services that help
-// with interacting with the cloudflare API. Note, unlike clients, this service
-// does not read variables from the environment automatically. You should not
-// instantiate this service directly, and instead use the
-// [NewRadarEmailSecurityTopTldService] method instead.
-type RadarEmailSecurityTopTldService struct {
- Options []option.RequestOption
- Malicious *RadarEmailSecurityTopTldMaliciousService
- Spam *RadarEmailSecurityTopTldSpamService
- Spoof *RadarEmailSecurityTopTldSpoofService
-}
-
-// NewRadarEmailSecurityTopTldService generates a new service that applies the
-// given options to each request. These options are applied after the parent
-// client's options (if there is one), and before any request-specific options.
-func NewRadarEmailSecurityTopTldService(opts ...option.RequestOption) (r *RadarEmailSecurityTopTldService) {
- r = &RadarEmailSecurityTopTldService{}
- r.Options = opts
- r.Malicious = NewRadarEmailSecurityTopTldMaliciousService(opts...)
- r.Spam = NewRadarEmailSecurityTopTldSpamService(opts...)
- r.Spoof = NewRadarEmailSecurityTopTldSpoofService(opts...)
- return
-}
-
-// Get the top TLDs by email messages. Values are a percentage out of the total
-// emails.
-func (r *RadarEmailSecurityTopTldService) Get(ctx context.Context, query RadarEmailSecurityTopTldGetParams, opts ...option.RequestOption) (res *RadarEmailSecurityTopTldGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarEmailSecurityTopTldGetResponseEnvelope
- path := "radar/email/security/top/tlds"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type RadarEmailSecurityTopTldGetResponse struct {
- Meta RadarEmailSecurityTopTldGetResponseMeta `json:"meta,required"`
- Top0 []RadarEmailSecurityTopTldGetResponseTop0 `json:"top_0,required"`
- JSON radarEmailSecurityTopTldGetResponseJSON `json:"-"`
-}
-
-// radarEmailSecurityTopTldGetResponseJSON contains the JSON metadata for the
-// struct [RadarEmailSecurityTopTldGetResponse]
-type radarEmailSecurityTopTldGetResponseJSON struct {
- Meta apijson.Field
- Top0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecurityTopTldGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecurityTopTldGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecurityTopTldGetResponseMeta struct {
- DateRange []RadarEmailSecurityTopTldGetResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- ConfidenceInfo RadarEmailSecurityTopTldGetResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarEmailSecurityTopTldGetResponseMetaJSON `json:"-"`
-}
-
-// radarEmailSecurityTopTldGetResponseMetaJSON contains the JSON metadata for the
-// struct [RadarEmailSecurityTopTldGetResponseMeta]
-type radarEmailSecurityTopTldGetResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecurityTopTldGetResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecurityTopTldGetResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecurityTopTldGetResponseMetaDateRange 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 radarEmailSecurityTopTldGetResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarEmailSecurityTopTldGetResponseMetaDateRangeJSON contains the JSON metadata
-// for the struct [RadarEmailSecurityTopTldGetResponseMetaDateRange]
-type radarEmailSecurityTopTldGetResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecurityTopTldGetResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecurityTopTldGetResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecurityTopTldGetResponseMetaConfidenceInfo struct {
- Annotations []RadarEmailSecurityTopTldGetResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarEmailSecurityTopTldGetResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarEmailSecurityTopTldGetResponseMetaConfidenceInfoJSON contains the JSON
-// metadata for the struct [RadarEmailSecurityTopTldGetResponseMetaConfidenceInfo]
-type radarEmailSecurityTopTldGetResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecurityTopTldGetResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecurityTopTldGetResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecurityTopTldGetResponseMetaConfidenceInfoAnnotation 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 radarEmailSecurityTopTldGetResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarEmailSecurityTopTldGetResponseMetaConfidenceInfoAnnotationJSON contains the
-// JSON metadata for the struct
-// [RadarEmailSecurityTopTldGetResponseMetaConfidenceInfoAnnotation]
-type radarEmailSecurityTopTldGetResponseMetaConfidenceInfoAnnotationJSON 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 *RadarEmailSecurityTopTldGetResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecurityTopTldGetResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecurityTopTldGetResponseTop0 struct {
- Name string `json:"name,required"`
- Value string `json:"value,required"`
- JSON radarEmailSecurityTopTldGetResponseTop0JSON `json:"-"`
-}
-
-// radarEmailSecurityTopTldGetResponseTop0JSON contains the JSON metadata for the
-// struct [RadarEmailSecurityTopTldGetResponseTop0]
-type radarEmailSecurityTopTldGetResponseTop0JSON struct {
- Name apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecurityTopTldGetResponseTop0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecurityTopTldGetResponseTop0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecurityTopTldGetParams struct {
- // Filter for arc (Authenticated Received Chain).
- ARC param.Field[[]RadarEmailSecurityTopTldGetParamsARC] `query:"arc"`
- // 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[[]RadarEmailSecurityTopTldGetParamsDateRange] `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[[]RadarEmailSecurityTopTldGetParamsDKIM] `query:"dkim"`
- // Filter for dmarc.
- DMARC param.Field[[]RadarEmailSecurityTopTldGetParamsDMARC] `query:"dmarc"`
- // Format results are returned in.
- Format param.Field[RadarEmailSecurityTopTldGetParamsFormat] `query:"format"`
- // Limit the number of objects in the response.
- Limit param.Field[int64] `query:"limit"`
- // 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[[]RadarEmailSecurityTopTldGetParamsSPF] `query:"spf"`
- // Filter for TLDs by category.
- TldCategory param.Field[RadarEmailSecurityTopTldGetParamsTldCategory] `query:"tldCategory"`
- // Filter for tls version.
- TLSVersion param.Field[[]RadarEmailSecurityTopTldGetParamsTLSVersion] `query:"tlsVersion"`
-}
-
-// URLQuery serializes [RadarEmailSecurityTopTldGetParams]'s query parameters as
-// `url.Values`.
-func (r RadarEmailSecurityTopTldGetParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type RadarEmailSecurityTopTldGetParamsARC string
-
-const (
- RadarEmailSecurityTopTldGetParamsARCPass RadarEmailSecurityTopTldGetParamsARC = "PASS"
- RadarEmailSecurityTopTldGetParamsARCNone RadarEmailSecurityTopTldGetParamsARC = "NONE"
- RadarEmailSecurityTopTldGetParamsARCFail RadarEmailSecurityTopTldGetParamsARC = "FAIL"
-)
-
-type RadarEmailSecurityTopTldGetParamsDateRange string
-
-const (
- RadarEmailSecurityTopTldGetParamsDateRange1d RadarEmailSecurityTopTldGetParamsDateRange = "1d"
- RadarEmailSecurityTopTldGetParamsDateRange2d RadarEmailSecurityTopTldGetParamsDateRange = "2d"
- RadarEmailSecurityTopTldGetParamsDateRange7d RadarEmailSecurityTopTldGetParamsDateRange = "7d"
- RadarEmailSecurityTopTldGetParamsDateRange14d RadarEmailSecurityTopTldGetParamsDateRange = "14d"
- RadarEmailSecurityTopTldGetParamsDateRange28d RadarEmailSecurityTopTldGetParamsDateRange = "28d"
- RadarEmailSecurityTopTldGetParamsDateRange12w RadarEmailSecurityTopTldGetParamsDateRange = "12w"
- RadarEmailSecurityTopTldGetParamsDateRange24w RadarEmailSecurityTopTldGetParamsDateRange = "24w"
- RadarEmailSecurityTopTldGetParamsDateRange52w RadarEmailSecurityTopTldGetParamsDateRange = "52w"
- RadarEmailSecurityTopTldGetParamsDateRange1dControl RadarEmailSecurityTopTldGetParamsDateRange = "1dControl"
- RadarEmailSecurityTopTldGetParamsDateRange2dControl RadarEmailSecurityTopTldGetParamsDateRange = "2dControl"
- RadarEmailSecurityTopTldGetParamsDateRange7dControl RadarEmailSecurityTopTldGetParamsDateRange = "7dControl"
- RadarEmailSecurityTopTldGetParamsDateRange14dControl RadarEmailSecurityTopTldGetParamsDateRange = "14dControl"
- RadarEmailSecurityTopTldGetParamsDateRange28dControl RadarEmailSecurityTopTldGetParamsDateRange = "28dControl"
- RadarEmailSecurityTopTldGetParamsDateRange12wControl RadarEmailSecurityTopTldGetParamsDateRange = "12wControl"
- RadarEmailSecurityTopTldGetParamsDateRange24wControl RadarEmailSecurityTopTldGetParamsDateRange = "24wControl"
-)
-
-type RadarEmailSecurityTopTldGetParamsDKIM string
-
-const (
- RadarEmailSecurityTopTldGetParamsDKIMPass RadarEmailSecurityTopTldGetParamsDKIM = "PASS"
- RadarEmailSecurityTopTldGetParamsDKIMNone RadarEmailSecurityTopTldGetParamsDKIM = "NONE"
- RadarEmailSecurityTopTldGetParamsDKIMFail RadarEmailSecurityTopTldGetParamsDKIM = "FAIL"
-)
-
-type RadarEmailSecurityTopTldGetParamsDMARC string
-
-const (
- RadarEmailSecurityTopTldGetParamsDMARCPass RadarEmailSecurityTopTldGetParamsDMARC = "PASS"
- RadarEmailSecurityTopTldGetParamsDMARCNone RadarEmailSecurityTopTldGetParamsDMARC = "NONE"
- RadarEmailSecurityTopTldGetParamsDMARCFail RadarEmailSecurityTopTldGetParamsDMARC = "FAIL"
-)
-
-// Format results are returned in.
-type RadarEmailSecurityTopTldGetParamsFormat string
-
-const (
- RadarEmailSecurityTopTldGetParamsFormatJson RadarEmailSecurityTopTldGetParamsFormat = "JSON"
- RadarEmailSecurityTopTldGetParamsFormatCsv RadarEmailSecurityTopTldGetParamsFormat = "CSV"
-)
-
-type RadarEmailSecurityTopTldGetParamsSPF string
-
-const (
- RadarEmailSecurityTopTldGetParamsSPFPass RadarEmailSecurityTopTldGetParamsSPF = "PASS"
- RadarEmailSecurityTopTldGetParamsSPFNone RadarEmailSecurityTopTldGetParamsSPF = "NONE"
- RadarEmailSecurityTopTldGetParamsSPFFail RadarEmailSecurityTopTldGetParamsSPF = "FAIL"
-)
-
-// Filter for TLDs by category.
-type RadarEmailSecurityTopTldGetParamsTldCategory string
-
-const (
- RadarEmailSecurityTopTldGetParamsTldCategoryClassic RadarEmailSecurityTopTldGetParamsTldCategory = "CLASSIC"
- RadarEmailSecurityTopTldGetParamsTldCategoryCountry RadarEmailSecurityTopTldGetParamsTldCategory = "COUNTRY"
-)
-
-type RadarEmailSecurityTopTldGetParamsTLSVersion string
-
-const (
- RadarEmailSecurityTopTldGetParamsTLSVersionTlSv1_0 RadarEmailSecurityTopTldGetParamsTLSVersion = "TLSv1_0"
- RadarEmailSecurityTopTldGetParamsTLSVersionTlSv1_1 RadarEmailSecurityTopTldGetParamsTLSVersion = "TLSv1_1"
- RadarEmailSecurityTopTldGetParamsTLSVersionTlSv1_2 RadarEmailSecurityTopTldGetParamsTLSVersion = "TLSv1_2"
- RadarEmailSecurityTopTldGetParamsTLSVersionTlSv1_3 RadarEmailSecurityTopTldGetParamsTLSVersion = "TLSv1_3"
-)
-
-type RadarEmailSecurityTopTldGetResponseEnvelope struct {
- Result RadarEmailSecurityTopTldGetResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarEmailSecurityTopTldGetResponseEnvelopeJSON `json:"-"`
-}
-
-// radarEmailSecurityTopTldGetResponseEnvelopeJSON contains the JSON metadata for
-// the struct [RadarEmailSecurityTopTldGetResponseEnvelope]
-type radarEmailSecurityTopTldGetResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecurityTopTldGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecurityTopTldGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
diff --git a/radaremailsecuritytoptld_test.go b/radaremailsecuritytoptld_test.go
deleted file mode 100644
index d729ec6a60d..00000000000
--- a/radaremailsecuritytoptld_test.go
+++ /dev/null
@@ -1,52 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
- "time"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRadarEmailSecurityTopTldGetWithOptionalParams(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"),
- )
- _, err := client.Radar.Email.Security.Top.Tlds.Get(context.TODO(), cloudflare.RadarEmailSecurityTopTldGetParams{
- ARC: cloudflare.F([]cloudflare.RadarEmailSecurityTopTldGetParamsARC{cloudflare.RadarEmailSecurityTopTldGetParamsARCPass, cloudflare.RadarEmailSecurityTopTldGetParamsARCNone, cloudflare.RadarEmailSecurityTopTldGetParamsARCFail}),
- DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
- DateRange: cloudflare.F([]cloudflare.RadarEmailSecurityTopTldGetParamsDateRange{cloudflare.RadarEmailSecurityTopTldGetParamsDateRange1d, cloudflare.RadarEmailSecurityTopTldGetParamsDateRange2d, cloudflare.RadarEmailSecurityTopTldGetParamsDateRange7d}),
- DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
- DKIM: cloudflare.F([]cloudflare.RadarEmailSecurityTopTldGetParamsDKIM{cloudflare.RadarEmailSecurityTopTldGetParamsDKIMPass, cloudflare.RadarEmailSecurityTopTldGetParamsDKIMNone, cloudflare.RadarEmailSecurityTopTldGetParamsDKIMFail}),
- DMARC: cloudflare.F([]cloudflare.RadarEmailSecurityTopTldGetParamsDMARC{cloudflare.RadarEmailSecurityTopTldGetParamsDMARCPass, cloudflare.RadarEmailSecurityTopTldGetParamsDMARCNone, cloudflare.RadarEmailSecurityTopTldGetParamsDMARCFail}),
- Format: cloudflare.F(cloudflare.RadarEmailSecurityTopTldGetParamsFormatJson),
- Limit: cloudflare.F(int64(5)),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- SPF: cloudflare.F([]cloudflare.RadarEmailSecurityTopTldGetParamsSPF{cloudflare.RadarEmailSecurityTopTldGetParamsSPFPass, cloudflare.RadarEmailSecurityTopTldGetParamsSPFNone, cloudflare.RadarEmailSecurityTopTldGetParamsSPFFail}),
- TldCategory: cloudflare.F(cloudflare.RadarEmailSecurityTopTldGetParamsTldCategoryClassic),
- TLSVersion: cloudflare.F([]cloudflare.RadarEmailSecurityTopTldGetParamsTLSVersion{cloudflare.RadarEmailSecurityTopTldGetParamsTLSVersionTlSv1_0, cloudflare.RadarEmailSecurityTopTldGetParamsTLSVersionTlSv1_1, cloudflare.RadarEmailSecurityTopTldGetParamsTLSVersionTlSv1_2}),
- })
- 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/radaremailsecuritytoptldmalicious.go b/radaremailsecuritytoptldmalicious.go
deleted file mode 100644
index 1c5ce1260a9..00000000000
--- a/radaremailsecuritytoptldmalicious.go
+++ /dev/null
@@ -1,349 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarEmailSecurityTopTldMaliciousService contains methods and other services
-// that help with interacting with the cloudflare API. Note, unlike clients, this
-// service does not read variables from the environment automatically. You should
-// not instantiate this service directly, and instead use the
-// [NewRadarEmailSecurityTopTldMaliciousService] method instead.
-type RadarEmailSecurityTopTldMaliciousService struct {
- Options []option.RequestOption
-}
-
-// NewRadarEmailSecurityTopTldMaliciousService generates a new service that applies
-// the given options to each request. These options are applied after the parent
-// client's options (if there is one), and before any request-specific options.
-func NewRadarEmailSecurityTopTldMaliciousService(opts ...option.RequestOption) (r *RadarEmailSecurityTopTldMaliciousService) {
- r = &RadarEmailSecurityTopTldMaliciousService{}
- r.Options = opts
- return
-}
-
-// Get the TLDs by emails classified as malicious or not.
-func (r *RadarEmailSecurityTopTldMaliciousService) Get(ctx context.Context, malicious RadarEmailSecurityTopTldMaliciousGetParamsMalicious, query RadarEmailSecurityTopTldMaliciousGetParams, opts ...option.RequestOption) (res *RadarEmailSecurityTopTldMaliciousGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarEmailSecurityTopTldMaliciousGetResponseEnvelope
- path := fmt.Sprintf("radar/email/security/top/tlds/malicious/%v", malicious)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type RadarEmailSecurityTopTldMaliciousGetResponse struct {
- Meta RadarEmailSecurityTopTldMaliciousGetResponseMeta `json:"meta,required"`
- Top0 []RadarEmailSecurityTopTldMaliciousGetResponseTop0 `json:"top_0,required"`
- JSON radarEmailSecurityTopTldMaliciousGetResponseJSON `json:"-"`
-}
-
-// radarEmailSecurityTopTldMaliciousGetResponseJSON contains the JSON metadata for
-// the struct [RadarEmailSecurityTopTldMaliciousGetResponse]
-type radarEmailSecurityTopTldMaliciousGetResponseJSON struct {
- Meta apijson.Field
- Top0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecurityTopTldMaliciousGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecurityTopTldMaliciousGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecurityTopTldMaliciousGetResponseMeta struct {
- DateRange []RadarEmailSecurityTopTldMaliciousGetResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- ConfidenceInfo RadarEmailSecurityTopTldMaliciousGetResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarEmailSecurityTopTldMaliciousGetResponseMetaJSON `json:"-"`
-}
-
-// radarEmailSecurityTopTldMaliciousGetResponseMetaJSON contains the JSON metadata
-// for the struct [RadarEmailSecurityTopTldMaliciousGetResponseMeta]
-type radarEmailSecurityTopTldMaliciousGetResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecurityTopTldMaliciousGetResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecurityTopTldMaliciousGetResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecurityTopTldMaliciousGetResponseMetaDateRange 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 radarEmailSecurityTopTldMaliciousGetResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarEmailSecurityTopTldMaliciousGetResponseMetaDateRangeJSON contains the JSON
-// metadata for the struct
-// [RadarEmailSecurityTopTldMaliciousGetResponseMetaDateRange]
-type radarEmailSecurityTopTldMaliciousGetResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecurityTopTldMaliciousGetResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecurityTopTldMaliciousGetResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecurityTopTldMaliciousGetResponseMetaConfidenceInfo struct {
- Annotations []RadarEmailSecurityTopTldMaliciousGetResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarEmailSecurityTopTldMaliciousGetResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarEmailSecurityTopTldMaliciousGetResponseMetaConfidenceInfoJSON contains the
-// JSON metadata for the struct
-// [RadarEmailSecurityTopTldMaliciousGetResponseMetaConfidenceInfo]
-type radarEmailSecurityTopTldMaliciousGetResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecurityTopTldMaliciousGetResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecurityTopTldMaliciousGetResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecurityTopTldMaliciousGetResponseMetaConfidenceInfoAnnotation 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 radarEmailSecurityTopTldMaliciousGetResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarEmailSecurityTopTldMaliciousGetResponseMetaConfidenceInfoAnnotationJSON
-// contains the JSON metadata for the struct
-// [RadarEmailSecurityTopTldMaliciousGetResponseMetaConfidenceInfoAnnotation]
-type radarEmailSecurityTopTldMaliciousGetResponseMetaConfidenceInfoAnnotationJSON 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 *RadarEmailSecurityTopTldMaliciousGetResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecurityTopTldMaliciousGetResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecurityTopTldMaliciousGetResponseTop0 struct {
- Name string `json:"name,required"`
- Value string `json:"value,required"`
- JSON radarEmailSecurityTopTldMaliciousGetResponseTop0JSON `json:"-"`
-}
-
-// radarEmailSecurityTopTldMaliciousGetResponseTop0JSON contains the JSON metadata
-// for the struct [RadarEmailSecurityTopTldMaliciousGetResponseTop0]
-type radarEmailSecurityTopTldMaliciousGetResponseTop0JSON struct {
- Name apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecurityTopTldMaliciousGetResponseTop0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecurityTopTldMaliciousGetResponseTop0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecurityTopTldMaliciousGetParams struct {
- // Filter for arc (Authenticated Received Chain).
- ARC param.Field[[]RadarEmailSecurityTopTldMaliciousGetParamsARC] `query:"arc"`
- // 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[[]RadarEmailSecurityTopTldMaliciousGetParamsDateRange] `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[[]RadarEmailSecurityTopTldMaliciousGetParamsDKIM] `query:"dkim"`
- // Filter for dmarc.
- DMARC param.Field[[]RadarEmailSecurityTopTldMaliciousGetParamsDMARC] `query:"dmarc"`
- // Format results are returned in.
- Format param.Field[RadarEmailSecurityTopTldMaliciousGetParamsFormat] `query:"format"`
- // Limit the number of objects in the response.
- Limit param.Field[int64] `query:"limit"`
- // 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[[]RadarEmailSecurityTopTldMaliciousGetParamsSPF] `query:"spf"`
- // Filter for TLDs by category.
- TldCategory param.Field[RadarEmailSecurityTopTldMaliciousGetParamsTldCategory] `query:"tldCategory"`
- // Filter for tls version.
- TLSVersion param.Field[[]RadarEmailSecurityTopTldMaliciousGetParamsTLSVersion] `query:"tlsVersion"`
-}
-
-// URLQuery serializes [RadarEmailSecurityTopTldMaliciousGetParams]'s query
-// parameters as `url.Values`.
-func (r RadarEmailSecurityTopTldMaliciousGetParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Malicious.
-type RadarEmailSecurityTopTldMaliciousGetParamsMalicious string
-
-const (
- RadarEmailSecurityTopTldMaliciousGetParamsMaliciousMalicious RadarEmailSecurityTopTldMaliciousGetParamsMalicious = "MALICIOUS"
- RadarEmailSecurityTopTldMaliciousGetParamsMaliciousNotMalicious RadarEmailSecurityTopTldMaliciousGetParamsMalicious = "NOT_MALICIOUS"
-)
-
-type RadarEmailSecurityTopTldMaliciousGetParamsARC string
-
-const (
- RadarEmailSecurityTopTldMaliciousGetParamsARCPass RadarEmailSecurityTopTldMaliciousGetParamsARC = "PASS"
- RadarEmailSecurityTopTldMaliciousGetParamsARCNone RadarEmailSecurityTopTldMaliciousGetParamsARC = "NONE"
- RadarEmailSecurityTopTldMaliciousGetParamsARCFail RadarEmailSecurityTopTldMaliciousGetParamsARC = "FAIL"
-)
-
-type RadarEmailSecurityTopTldMaliciousGetParamsDateRange string
-
-const (
- RadarEmailSecurityTopTldMaliciousGetParamsDateRange1d RadarEmailSecurityTopTldMaliciousGetParamsDateRange = "1d"
- RadarEmailSecurityTopTldMaliciousGetParamsDateRange2d RadarEmailSecurityTopTldMaliciousGetParamsDateRange = "2d"
- RadarEmailSecurityTopTldMaliciousGetParamsDateRange7d RadarEmailSecurityTopTldMaliciousGetParamsDateRange = "7d"
- RadarEmailSecurityTopTldMaliciousGetParamsDateRange14d RadarEmailSecurityTopTldMaliciousGetParamsDateRange = "14d"
- RadarEmailSecurityTopTldMaliciousGetParamsDateRange28d RadarEmailSecurityTopTldMaliciousGetParamsDateRange = "28d"
- RadarEmailSecurityTopTldMaliciousGetParamsDateRange12w RadarEmailSecurityTopTldMaliciousGetParamsDateRange = "12w"
- RadarEmailSecurityTopTldMaliciousGetParamsDateRange24w RadarEmailSecurityTopTldMaliciousGetParamsDateRange = "24w"
- RadarEmailSecurityTopTldMaliciousGetParamsDateRange52w RadarEmailSecurityTopTldMaliciousGetParamsDateRange = "52w"
- RadarEmailSecurityTopTldMaliciousGetParamsDateRange1dControl RadarEmailSecurityTopTldMaliciousGetParamsDateRange = "1dControl"
- RadarEmailSecurityTopTldMaliciousGetParamsDateRange2dControl RadarEmailSecurityTopTldMaliciousGetParamsDateRange = "2dControl"
- RadarEmailSecurityTopTldMaliciousGetParamsDateRange7dControl RadarEmailSecurityTopTldMaliciousGetParamsDateRange = "7dControl"
- RadarEmailSecurityTopTldMaliciousGetParamsDateRange14dControl RadarEmailSecurityTopTldMaliciousGetParamsDateRange = "14dControl"
- RadarEmailSecurityTopTldMaliciousGetParamsDateRange28dControl RadarEmailSecurityTopTldMaliciousGetParamsDateRange = "28dControl"
- RadarEmailSecurityTopTldMaliciousGetParamsDateRange12wControl RadarEmailSecurityTopTldMaliciousGetParamsDateRange = "12wControl"
- RadarEmailSecurityTopTldMaliciousGetParamsDateRange24wControl RadarEmailSecurityTopTldMaliciousGetParamsDateRange = "24wControl"
-)
-
-type RadarEmailSecurityTopTldMaliciousGetParamsDKIM string
-
-const (
- RadarEmailSecurityTopTldMaliciousGetParamsDKIMPass RadarEmailSecurityTopTldMaliciousGetParamsDKIM = "PASS"
- RadarEmailSecurityTopTldMaliciousGetParamsDKIMNone RadarEmailSecurityTopTldMaliciousGetParamsDKIM = "NONE"
- RadarEmailSecurityTopTldMaliciousGetParamsDKIMFail RadarEmailSecurityTopTldMaliciousGetParamsDKIM = "FAIL"
-)
-
-type RadarEmailSecurityTopTldMaliciousGetParamsDMARC string
-
-const (
- RadarEmailSecurityTopTldMaliciousGetParamsDMARCPass RadarEmailSecurityTopTldMaliciousGetParamsDMARC = "PASS"
- RadarEmailSecurityTopTldMaliciousGetParamsDMARCNone RadarEmailSecurityTopTldMaliciousGetParamsDMARC = "NONE"
- RadarEmailSecurityTopTldMaliciousGetParamsDMARCFail RadarEmailSecurityTopTldMaliciousGetParamsDMARC = "FAIL"
-)
-
-// Format results are returned in.
-type RadarEmailSecurityTopTldMaliciousGetParamsFormat string
-
-const (
- RadarEmailSecurityTopTldMaliciousGetParamsFormatJson RadarEmailSecurityTopTldMaliciousGetParamsFormat = "JSON"
- RadarEmailSecurityTopTldMaliciousGetParamsFormatCsv RadarEmailSecurityTopTldMaliciousGetParamsFormat = "CSV"
-)
-
-type RadarEmailSecurityTopTldMaliciousGetParamsSPF string
-
-const (
- RadarEmailSecurityTopTldMaliciousGetParamsSPFPass RadarEmailSecurityTopTldMaliciousGetParamsSPF = "PASS"
- RadarEmailSecurityTopTldMaliciousGetParamsSPFNone RadarEmailSecurityTopTldMaliciousGetParamsSPF = "NONE"
- RadarEmailSecurityTopTldMaliciousGetParamsSPFFail RadarEmailSecurityTopTldMaliciousGetParamsSPF = "FAIL"
-)
-
-// Filter for TLDs by category.
-type RadarEmailSecurityTopTldMaliciousGetParamsTldCategory string
-
-const (
- RadarEmailSecurityTopTldMaliciousGetParamsTldCategoryClassic RadarEmailSecurityTopTldMaliciousGetParamsTldCategory = "CLASSIC"
- RadarEmailSecurityTopTldMaliciousGetParamsTldCategoryCountry RadarEmailSecurityTopTldMaliciousGetParamsTldCategory = "COUNTRY"
-)
-
-type RadarEmailSecurityTopTldMaliciousGetParamsTLSVersion string
-
-const (
- RadarEmailSecurityTopTldMaliciousGetParamsTLSVersionTlSv1_0 RadarEmailSecurityTopTldMaliciousGetParamsTLSVersion = "TLSv1_0"
- RadarEmailSecurityTopTldMaliciousGetParamsTLSVersionTlSv1_1 RadarEmailSecurityTopTldMaliciousGetParamsTLSVersion = "TLSv1_1"
- RadarEmailSecurityTopTldMaliciousGetParamsTLSVersionTlSv1_2 RadarEmailSecurityTopTldMaliciousGetParamsTLSVersion = "TLSv1_2"
- RadarEmailSecurityTopTldMaliciousGetParamsTLSVersionTlSv1_3 RadarEmailSecurityTopTldMaliciousGetParamsTLSVersion = "TLSv1_3"
-)
-
-type RadarEmailSecurityTopTldMaliciousGetResponseEnvelope struct {
- Result RadarEmailSecurityTopTldMaliciousGetResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarEmailSecurityTopTldMaliciousGetResponseEnvelopeJSON `json:"-"`
-}
-
-// radarEmailSecurityTopTldMaliciousGetResponseEnvelopeJSON contains the JSON
-// metadata for the struct [RadarEmailSecurityTopTldMaliciousGetResponseEnvelope]
-type radarEmailSecurityTopTldMaliciousGetResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecurityTopTldMaliciousGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecurityTopTldMaliciousGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
diff --git a/radaremailsecuritytoptldmalicious_test.go b/radaremailsecuritytoptldmalicious_test.go
deleted file mode 100644
index 745562a8419..00000000000
--- a/radaremailsecuritytoptldmalicious_test.go
+++ /dev/null
@@ -1,56 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
- "time"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRadarEmailSecurityTopTldMaliciousGetWithOptionalParams(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"),
- )
- _, err := client.Radar.Email.Security.Top.Tlds.Malicious.Get(
- context.TODO(),
- cloudflare.RadarEmailSecurityTopTldMaliciousGetParamsMaliciousMalicious,
- cloudflare.RadarEmailSecurityTopTldMaliciousGetParams{
- ARC: cloudflare.F([]cloudflare.RadarEmailSecurityTopTldMaliciousGetParamsARC{cloudflare.RadarEmailSecurityTopTldMaliciousGetParamsARCPass, cloudflare.RadarEmailSecurityTopTldMaliciousGetParamsARCNone, cloudflare.RadarEmailSecurityTopTldMaliciousGetParamsARCFail}),
- DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
- DateRange: cloudflare.F([]cloudflare.RadarEmailSecurityTopTldMaliciousGetParamsDateRange{cloudflare.RadarEmailSecurityTopTldMaliciousGetParamsDateRange1d, cloudflare.RadarEmailSecurityTopTldMaliciousGetParamsDateRange2d, cloudflare.RadarEmailSecurityTopTldMaliciousGetParamsDateRange7d}),
- DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
- DKIM: cloudflare.F([]cloudflare.RadarEmailSecurityTopTldMaliciousGetParamsDKIM{cloudflare.RadarEmailSecurityTopTldMaliciousGetParamsDKIMPass, cloudflare.RadarEmailSecurityTopTldMaliciousGetParamsDKIMNone, cloudflare.RadarEmailSecurityTopTldMaliciousGetParamsDKIMFail}),
- DMARC: cloudflare.F([]cloudflare.RadarEmailSecurityTopTldMaliciousGetParamsDMARC{cloudflare.RadarEmailSecurityTopTldMaliciousGetParamsDMARCPass, cloudflare.RadarEmailSecurityTopTldMaliciousGetParamsDMARCNone, cloudflare.RadarEmailSecurityTopTldMaliciousGetParamsDMARCFail}),
- Format: cloudflare.F(cloudflare.RadarEmailSecurityTopTldMaliciousGetParamsFormatJson),
- Limit: cloudflare.F(int64(5)),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- SPF: cloudflare.F([]cloudflare.RadarEmailSecurityTopTldMaliciousGetParamsSPF{cloudflare.RadarEmailSecurityTopTldMaliciousGetParamsSPFPass, cloudflare.RadarEmailSecurityTopTldMaliciousGetParamsSPFNone, cloudflare.RadarEmailSecurityTopTldMaliciousGetParamsSPFFail}),
- TldCategory: cloudflare.F(cloudflare.RadarEmailSecurityTopTldMaliciousGetParamsTldCategoryClassic),
- TLSVersion: cloudflare.F([]cloudflare.RadarEmailSecurityTopTldMaliciousGetParamsTLSVersion{cloudflare.RadarEmailSecurityTopTldMaliciousGetParamsTLSVersionTlSv1_0, cloudflare.RadarEmailSecurityTopTldMaliciousGetParamsTLSVersionTlSv1_1, cloudflare.RadarEmailSecurityTopTldMaliciousGetParamsTLSVersionTlSv1_2}),
- },
- )
- 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/radaremailsecuritytoptldspam.go b/radaremailsecuritytoptldspam.go
deleted file mode 100644
index a0fc5ee6679..00000000000
--- a/radaremailsecuritytoptldspam.go
+++ /dev/null
@@ -1,348 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarEmailSecurityTopTldSpamService contains methods and other services that
-// help with interacting with the cloudflare API. Note, unlike clients, this
-// service does not read variables from the environment automatically. You should
-// not instantiate this service directly, and instead use the
-// [NewRadarEmailSecurityTopTldSpamService] method instead.
-type RadarEmailSecurityTopTldSpamService struct {
- Options []option.RequestOption
-}
-
-// NewRadarEmailSecurityTopTldSpamService generates a new service that applies the
-// given options to each request. These options are applied after the parent
-// client's options (if there is one), and before any request-specific options.
-func NewRadarEmailSecurityTopTldSpamService(opts ...option.RequestOption) (r *RadarEmailSecurityTopTldSpamService) {
- r = &RadarEmailSecurityTopTldSpamService{}
- r.Options = opts
- return
-}
-
-// Get the top TLDs by emails classified as Spam or not.
-func (r *RadarEmailSecurityTopTldSpamService) Get(ctx context.Context, spam RadarEmailSecurityTopTldSpamGetParamsSpam, query RadarEmailSecurityTopTldSpamGetParams, opts ...option.RequestOption) (res *RadarEmailSecurityTopTldSpamGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarEmailSecurityTopTldSpamGetResponseEnvelope
- path := fmt.Sprintf("radar/email/security/top/tlds/spam/%v", spam)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type RadarEmailSecurityTopTldSpamGetResponse struct {
- Meta RadarEmailSecurityTopTldSpamGetResponseMeta `json:"meta,required"`
- Top0 []RadarEmailSecurityTopTldSpamGetResponseTop0 `json:"top_0,required"`
- JSON radarEmailSecurityTopTldSpamGetResponseJSON `json:"-"`
-}
-
-// radarEmailSecurityTopTldSpamGetResponseJSON contains the JSON metadata for the
-// struct [RadarEmailSecurityTopTldSpamGetResponse]
-type radarEmailSecurityTopTldSpamGetResponseJSON struct {
- Meta apijson.Field
- Top0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecurityTopTldSpamGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecurityTopTldSpamGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecurityTopTldSpamGetResponseMeta struct {
- DateRange []RadarEmailSecurityTopTldSpamGetResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- ConfidenceInfo RadarEmailSecurityTopTldSpamGetResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarEmailSecurityTopTldSpamGetResponseMetaJSON `json:"-"`
-}
-
-// radarEmailSecurityTopTldSpamGetResponseMetaJSON contains the JSON metadata for
-// the struct [RadarEmailSecurityTopTldSpamGetResponseMeta]
-type radarEmailSecurityTopTldSpamGetResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecurityTopTldSpamGetResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecurityTopTldSpamGetResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecurityTopTldSpamGetResponseMetaDateRange 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 radarEmailSecurityTopTldSpamGetResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarEmailSecurityTopTldSpamGetResponseMetaDateRangeJSON contains the JSON
-// metadata for the struct [RadarEmailSecurityTopTldSpamGetResponseMetaDateRange]
-type radarEmailSecurityTopTldSpamGetResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecurityTopTldSpamGetResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecurityTopTldSpamGetResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecurityTopTldSpamGetResponseMetaConfidenceInfo struct {
- Annotations []RadarEmailSecurityTopTldSpamGetResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarEmailSecurityTopTldSpamGetResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarEmailSecurityTopTldSpamGetResponseMetaConfidenceInfoJSON contains the JSON
-// metadata for the struct
-// [RadarEmailSecurityTopTldSpamGetResponseMetaConfidenceInfo]
-type radarEmailSecurityTopTldSpamGetResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecurityTopTldSpamGetResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecurityTopTldSpamGetResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecurityTopTldSpamGetResponseMetaConfidenceInfoAnnotation 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 radarEmailSecurityTopTldSpamGetResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarEmailSecurityTopTldSpamGetResponseMetaConfidenceInfoAnnotationJSON contains
-// the JSON metadata for the struct
-// [RadarEmailSecurityTopTldSpamGetResponseMetaConfidenceInfoAnnotation]
-type radarEmailSecurityTopTldSpamGetResponseMetaConfidenceInfoAnnotationJSON 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 *RadarEmailSecurityTopTldSpamGetResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecurityTopTldSpamGetResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecurityTopTldSpamGetResponseTop0 struct {
- Name string `json:"name,required"`
- Value string `json:"value,required"`
- JSON radarEmailSecurityTopTldSpamGetResponseTop0JSON `json:"-"`
-}
-
-// radarEmailSecurityTopTldSpamGetResponseTop0JSON contains the JSON metadata for
-// the struct [RadarEmailSecurityTopTldSpamGetResponseTop0]
-type radarEmailSecurityTopTldSpamGetResponseTop0JSON struct {
- Name apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecurityTopTldSpamGetResponseTop0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecurityTopTldSpamGetResponseTop0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecurityTopTldSpamGetParams struct {
- // Filter for arc (Authenticated Received Chain).
- ARC param.Field[[]RadarEmailSecurityTopTldSpamGetParamsARC] `query:"arc"`
- // 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[[]RadarEmailSecurityTopTldSpamGetParamsDateRange] `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[[]RadarEmailSecurityTopTldSpamGetParamsDKIM] `query:"dkim"`
- // Filter for dmarc.
- DMARC param.Field[[]RadarEmailSecurityTopTldSpamGetParamsDMARC] `query:"dmarc"`
- // Format results are returned in.
- Format param.Field[RadarEmailSecurityTopTldSpamGetParamsFormat] `query:"format"`
- // Limit the number of objects in the response.
- Limit param.Field[int64] `query:"limit"`
- // 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[[]RadarEmailSecurityTopTldSpamGetParamsSPF] `query:"spf"`
- // Filter for TLDs by category.
- TldCategory param.Field[RadarEmailSecurityTopTldSpamGetParamsTldCategory] `query:"tldCategory"`
- // Filter for tls version.
- TLSVersion param.Field[[]RadarEmailSecurityTopTldSpamGetParamsTLSVersion] `query:"tlsVersion"`
-}
-
-// URLQuery serializes [RadarEmailSecurityTopTldSpamGetParams]'s query parameters
-// as `url.Values`.
-func (r RadarEmailSecurityTopTldSpamGetParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Spam.
-type RadarEmailSecurityTopTldSpamGetParamsSpam string
-
-const (
- RadarEmailSecurityTopTldSpamGetParamsSpamSpam RadarEmailSecurityTopTldSpamGetParamsSpam = "SPAM"
- RadarEmailSecurityTopTldSpamGetParamsSpamNotSpam RadarEmailSecurityTopTldSpamGetParamsSpam = "NOT_SPAM"
-)
-
-type RadarEmailSecurityTopTldSpamGetParamsARC string
-
-const (
- RadarEmailSecurityTopTldSpamGetParamsARCPass RadarEmailSecurityTopTldSpamGetParamsARC = "PASS"
- RadarEmailSecurityTopTldSpamGetParamsARCNone RadarEmailSecurityTopTldSpamGetParamsARC = "NONE"
- RadarEmailSecurityTopTldSpamGetParamsARCFail RadarEmailSecurityTopTldSpamGetParamsARC = "FAIL"
-)
-
-type RadarEmailSecurityTopTldSpamGetParamsDateRange string
-
-const (
- RadarEmailSecurityTopTldSpamGetParamsDateRange1d RadarEmailSecurityTopTldSpamGetParamsDateRange = "1d"
- RadarEmailSecurityTopTldSpamGetParamsDateRange2d RadarEmailSecurityTopTldSpamGetParamsDateRange = "2d"
- RadarEmailSecurityTopTldSpamGetParamsDateRange7d RadarEmailSecurityTopTldSpamGetParamsDateRange = "7d"
- RadarEmailSecurityTopTldSpamGetParamsDateRange14d RadarEmailSecurityTopTldSpamGetParamsDateRange = "14d"
- RadarEmailSecurityTopTldSpamGetParamsDateRange28d RadarEmailSecurityTopTldSpamGetParamsDateRange = "28d"
- RadarEmailSecurityTopTldSpamGetParamsDateRange12w RadarEmailSecurityTopTldSpamGetParamsDateRange = "12w"
- RadarEmailSecurityTopTldSpamGetParamsDateRange24w RadarEmailSecurityTopTldSpamGetParamsDateRange = "24w"
- RadarEmailSecurityTopTldSpamGetParamsDateRange52w RadarEmailSecurityTopTldSpamGetParamsDateRange = "52w"
- RadarEmailSecurityTopTldSpamGetParamsDateRange1dControl RadarEmailSecurityTopTldSpamGetParamsDateRange = "1dControl"
- RadarEmailSecurityTopTldSpamGetParamsDateRange2dControl RadarEmailSecurityTopTldSpamGetParamsDateRange = "2dControl"
- RadarEmailSecurityTopTldSpamGetParamsDateRange7dControl RadarEmailSecurityTopTldSpamGetParamsDateRange = "7dControl"
- RadarEmailSecurityTopTldSpamGetParamsDateRange14dControl RadarEmailSecurityTopTldSpamGetParamsDateRange = "14dControl"
- RadarEmailSecurityTopTldSpamGetParamsDateRange28dControl RadarEmailSecurityTopTldSpamGetParamsDateRange = "28dControl"
- RadarEmailSecurityTopTldSpamGetParamsDateRange12wControl RadarEmailSecurityTopTldSpamGetParamsDateRange = "12wControl"
- RadarEmailSecurityTopTldSpamGetParamsDateRange24wControl RadarEmailSecurityTopTldSpamGetParamsDateRange = "24wControl"
-)
-
-type RadarEmailSecurityTopTldSpamGetParamsDKIM string
-
-const (
- RadarEmailSecurityTopTldSpamGetParamsDKIMPass RadarEmailSecurityTopTldSpamGetParamsDKIM = "PASS"
- RadarEmailSecurityTopTldSpamGetParamsDKIMNone RadarEmailSecurityTopTldSpamGetParamsDKIM = "NONE"
- RadarEmailSecurityTopTldSpamGetParamsDKIMFail RadarEmailSecurityTopTldSpamGetParamsDKIM = "FAIL"
-)
-
-type RadarEmailSecurityTopTldSpamGetParamsDMARC string
-
-const (
- RadarEmailSecurityTopTldSpamGetParamsDMARCPass RadarEmailSecurityTopTldSpamGetParamsDMARC = "PASS"
- RadarEmailSecurityTopTldSpamGetParamsDMARCNone RadarEmailSecurityTopTldSpamGetParamsDMARC = "NONE"
- RadarEmailSecurityTopTldSpamGetParamsDMARCFail RadarEmailSecurityTopTldSpamGetParamsDMARC = "FAIL"
-)
-
-// Format results are returned in.
-type RadarEmailSecurityTopTldSpamGetParamsFormat string
-
-const (
- RadarEmailSecurityTopTldSpamGetParamsFormatJson RadarEmailSecurityTopTldSpamGetParamsFormat = "JSON"
- RadarEmailSecurityTopTldSpamGetParamsFormatCsv RadarEmailSecurityTopTldSpamGetParamsFormat = "CSV"
-)
-
-type RadarEmailSecurityTopTldSpamGetParamsSPF string
-
-const (
- RadarEmailSecurityTopTldSpamGetParamsSPFPass RadarEmailSecurityTopTldSpamGetParamsSPF = "PASS"
- RadarEmailSecurityTopTldSpamGetParamsSPFNone RadarEmailSecurityTopTldSpamGetParamsSPF = "NONE"
- RadarEmailSecurityTopTldSpamGetParamsSPFFail RadarEmailSecurityTopTldSpamGetParamsSPF = "FAIL"
-)
-
-// Filter for TLDs by category.
-type RadarEmailSecurityTopTldSpamGetParamsTldCategory string
-
-const (
- RadarEmailSecurityTopTldSpamGetParamsTldCategoryClassic RadarEmailSecurityTopTldSpamGetParamsTldCategory = "CLASSIC"
- RadarEmailSecurityTopTldSpamGetParamsTldCategoryCountry RadarEmailSecurityTopTldSpamGetParamsTldCategory = "COUNTRY"
-)
-
-type RadarEmailSecurityTopTldSpamGetParamsTLSVersion string
-
-const (
- RadarEmailSecurityTopTldSpamGetParamsTLSVersionTlSv1_0 RadarEmailSecurityTopTldSpamGetParamsTLSVersion = "TLSv1_0"
- RadarEmailSecurityTopTldSpamGetParamsTLSVersionTlSv1_1 RadarEmailSecurityTopTldSpamGetParamsTLSVersion = "TLSv1_1"
- RadarEmailSecurityTopTldSpamGetParamsTLSVersionTlSv1_2 RadarEmailSecurityTopTldSpamGetParamsTLSVersion = "TLSv1_2"
- RadarEmailSecurityTopTldSpamGetParamsTLSVersionTlSv1_3 RadarEmailSecurityTopTldSpamGetParamsTLSVersion = "TLSv1_3"
-)
-
-type RadarEmailSecurityTopTldSpamGetResponseEnvelope struct {
- Result RadarEmailSecurityTopTldSpamGetResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarEmailSecurityTopTldSpamGetResponseEnvelopeJSON `json:"-"`
-}
-
-// radarEmailSecurityTopTldSpamGetResponseEnvelopeJSON contains the JSON metadata
-// for the struct [RadarEmailSecurityTopTldSpamGetResponseEnvelope]
-type radarEmailSecurityTopTldSpamGetResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecurityTopTldSpamGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecurityTopTldSpamGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
diff --git a/radaremailsecuritytoptldspam_test.go b/radaremailsecuritytoptldspam_test.go
deleted file mode 100644
index 796e78b2d01..00000000000
--- a/radaremailsecuritytoptldspam_test.go
+++ /dev/null
@@ -1,56 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
- "time"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRadarEmailSecurityTopTldSpamGetWithOptionalParams(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"),
- )
- _, err := client.Radar.Email.Security.Top.Tlds.Spam.Get(
- context.TODO(),
- cloudflare.RadarEmailSecurityTopTldSpamGetParamsSpamSpam,
- cloudflare.RadarEmailSecurityTopTldSpamGetParams{
- ARC: cloudflare.F([]cloudflare.RadarEmailSecurityTopTldSpamGetParamsARC{cloudflare.RadarEmailSecurityTopTldSpamGetParamsARCPass, cloudflare.RadarEmailSecurityTopTldSpamGetParamsARCNone, cloudflare.RadarEmailSecurityTopTldSpamGetParamsARCFail}),
- DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
- DateRange: cloudflare.F([]cloudflare.RadarEmailSecurityTopTldSpamGetParamsDateRange{cloudflare.RadarEmailSecurityTopTldSpamGetParamsDateRange1d, cloudflare.RadarEmailSecurityTopTldSpamGetParamsDateRange2d, cloudflare.RadarEmailSecurityTopTldSpamGetParamsDateRange7d}),
- DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
- DKIM: cloudflare.F([]cloudflare.RadarEmailSecurityTopTldSpamGetParamsDKIM{cloudflare.RadarEmailSecurityTopTldSpamGetParamsDKIMPass, cloudflare.RadarEmailSecurityTopTldSpamGetParamsDKIMNone, cloudflare.RadarEmailSecurityTopTldSpamGetParamsDKIMFail}),
- DMARC: cloudflare.F([]cloudflare.RadarEmailSecurityTopTldSpamGetParamsDMARC{cloudflare.RadarEmailSecurityTopTldSpamGetParamsDMARCPass, cloudflare.RadarEmailSecurityTopTldSpamGetParamsDMARCNone, cloudflare.RadarEmailSecurityTopTldSpamGetParamsDMARCFail}),
- Format: cloudflare.F(cloudflare.RadarEmailSecurityTopTldSpamGetParamsFormatJson),
- Limit: cloudflare.F(int64(5)),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- SPF: cloudflare.F([]cloudflare.RadarEmailSecurityTopTldSpamGetParamsSPF{cloudflare.RadarEmailSecurityTopTldSpamGetParamsSPFPass, cloudflare.RadarEmailSecurityTopTldSpamGetParamsSPFNone, cloudflare.RadarEmailSecurityTopTldSpamGetParamsSPFFail}),
- TldCategory: cloudflare.F(cloudflare.RadarEmailSecurityTopTldSpamGetParamsTldCategoryClassic),
- TLSVersion: cloudflare.F([]cloudflare.RadarEmailSecurityTopTldSpamGetParamsTLSVersion{cloudflare.RadarEmailSecurityTopTldSpamGetParamsTLSVersionTlSv1_0, cloudflare.RadarEmailSecurityTopTldSpamGetParamsTLSVersionTlSv1_1, cloudflare.RadarEmailSecurityTopTldSpamGetParamsTLSVersionTlSv1_2}),
- },
- )
- 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/radaremailsecuritytoptldspoof.go b/radaremailsecuritytoptldspoof.go
deleted file mode 100644
index 87518dce3a7..00000000000
--- a/radaremailsecuritytoptldspoof.go
+++ /dev/null
@@ -1,348 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarEmailSecurityTopTldSpoofService contains methods and other services that
-// help with interacting with the cloudflare API. Note, unlike clients, this
-// service does not read variables from the environment automatically. You should
-// not instantiate this service directly, and instead use the
-// [NewRadarEmailSecurityTopTldSpoofService] method instead.
-type RadarEmailSecurityTopTldSpoofService struct {
- Options []option.RequestOption
-}
-
-// NewRadarEmailSecurityTopTldSpoofService generates a new service that applies the
-// given options to each request. These options are applied after the parent
-// client's options (if there is one), and before any request-specific options.
-func NewRadarEmailSecurityTopTldSpoofService(opts ...option.RequestOption) (r *RadarEmailSecurityTopTldSpoofService) {
- r = &RadarEmailSecurityTopTldSpoofService{}
- r.Options = opts
- return
-}
-
-// Get the TLDs by emails classified as spoof or not.
-func (r *RadarEmailSecurityTopTldSpoofService) Get(ctx context.Context, spoof RadarEmailSecurityTopTldSpoofGetParamsSpoof, query RadarEmailSecurityTopTldSpoofGetParams, opts ...option.RequestOption) (res *RadarEmailSecurityTopTldSpoofGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarEmailSecurityTopTldSpoofGetResponseEnvelope
- path := fmt.Sprintf("radar/email/security/top/tlds/spoof/%v", spoof)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type RadarEmailSecurityTopTldSpoofGetResponse struct {
- Meta RadarEmailSecurityTopTldSpoofGetResponseMeta `json:"meta,required"`
- Top0 []RadarEmailSecurityTopTldSpoofGetResponseTop0 `json:"top_0,required"`
- JSON radarEmailSecurityTopTldSpoofGetResponseJSON `json:"-"`
-}
-
-// radarEmailSecurityTopTldSpoofGetResponseJSON contains the JSON metadata for the
-// struct [RadarEmailSecurityTopTldSpoofGetResponse]
-type radarEmailSecurityTopTldSpoofGetResponseJSON struct {
- Meta apijson.Field
- Top0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecurityTopTldSpoofGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecurityTopTldSpoofGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecurityTopTldSpoofGetResponseMeta struct {
- DateRange []RadarEmailSecurityTopTldSpoofGetResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- ConfidenceInfo RadarEmailSecurityTopTldSpoofGetResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarEmailSecurityTopTldSpoofGetResponseMetaJSON `json:"-"`
-}
-
-// radarEmailSecurityTopTldSpoofGetResponseMetaJSON contains the JSON metadata for
-// the struct [RadarEmailSecurityTopTldSpoofGetResponseMeta]
-type radarEmailSecurityTopTldSpoofGetResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecurityTopTldSpoofGetResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecurityTopTldSpoofGetResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecurityTopTldSpoofGetResponseMetaDateRange 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 radarEmailSecurityTopTldSpoofGetResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarEmailSecurityTopTldSpoofGetResponseMetaDateRangeJSON contains the JSON
-// metadata for the struct [RadarEmailSecurityTopTldSpoofGetResponseMetaDateRange]
-type radarEmailSecurityTopTldSpoofGetResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecurityTopTldSpoofGetResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecurityTopTldSpoofGetResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecurityTopTldSpoofGetResponseMetaConfidenceInfo struct {
- Annotations []RadarEmailSecurityTopTldSpoofGetResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarEmailSecurityTopTldSpoofGetResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarEmailSecurityTopTldSpoofGetResponseMetaConfidenceInfoJSON contains the JSON
-// metadata for the struct
-// [RadarEmailSecurityTopTldSpoofGetResponseMetaConfidenceInfo]
-type radarEmailSecurityTopTldSpoofGetResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecurityTopTldSpoofGetResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecurityTopTldSpoofGetResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecurityTopTldSpoofGetResponseMetaConfidenceInfoAnnotation 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 radarEmailSecurityTopTldSpoofGetResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarEmailSecurityTopTldSpoofGetResponseMetaConfidenceInfoAnnotationJSON
-// contains the JSON metadata for the struct
-// [RadarEmailSecurityTopTldSpoofGetResponseMetaConfidenceInfoAnnotation]
-type radarEmailSecurityTopTldSpoofGetResponseMetaConfidenceInfoAnnotationJSON 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 *RadarEmailSecurityTopTldSpoofGetResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecurityTopTldSpoofGetResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecurityTopTldSpoofGetResponseTop0 struct {
- Name string `json:"name,required"`
- Value string `json:"value,required"`
- JSON radarEmailSecurityTopTldSpoofGetResponseTop0JSON `json:"-"`
-}
-
-// radarEmailSecurityTopTldSpoofGetResponseTop0JSON contains the JSON metadata for
-// the struct [RadarEmailSecurityTopTldSpoofGetResponseTop0]
-type radarEmailSecurityTopTldSpoofGetResponseTop0JSON struct {
- Name apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecurityTopTldSpoofGetResponseTop0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecurityTopTldSpoofGetResponseTop0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEmailSecurityTopTldSpoofGetParams struct {
- // Filter for arc (Authenticated Received Chain).
- ARC param.Field[[]RadarEmailSecurityTopTldSpoofGetParamsARC] `query:"arc"`
- // 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[[]RadarEmailSecurityTopTldSpoofGetParamsDateRange] `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[[]RadarEmailSecurityTopTldSpoofGetParamsDKIM] `query:"dkim"`
- // Filter for dmarc.
- DMARC param.Field[[]RadarEmailSecurityTopTldSpoofGetParamsDMARC] `query:"dmarc"`
- // Format results are returned in.
- Format param.Field[RadarEmailSecurityTopTldSpoofGetParamsFormat] `query:"format"`
- // Limit the number of objects in the response.
- Limit param.Field[int64] `query:"limit"`
- // 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[[]RadarEmailSecurityTopTldSpoofGetParamsSPF] `query:"spf"`
- // Filter for TLDs by category.
- TldCategory param.Field[RadarEmailSecurityTopTldSpoofGetParamsTldCategory] `query:"tldCategory"`
- // Filter for tls version.
- TLSVersion param.Field[[]RadarEmailSecurityTopTldSpoofGetParamsTLSVersion] `query:"tlsVersion"`
-}
-
-// URLQuery serializes [RadarEmailSecurityTopTldSpoofGetParams]'s query parameters
-// as `url.Values`.
-func (r RadarEmailSecurityTopTldSpoofGetParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Spoof.
-type RadarEmailSecurityTopTldSpoofGetParamsSpoof string
-
-const (
- RadarEmailSecurityTopTldSpoofGetParamsSpoofSpoof RadarEmailSecurityTopTldSpoofGetParamsSpoof = "SPOOF"
- RadarEmailSecurityTopTldSpoofGetParamsSpoofNotSpoof RadarEmailSecurityTopTldSpoofGetParamsSpoof = "NOT_SPOOF"
-)
-
-type RadarEmailSecurityTopTldSpoofGetParamsARC string
-
-const (
- RadarEmailSecurityTopTldSpoofGetParamsARCPass RadarEmailSecurityTopTldSpoofGetParamsARC = "PASS"
- RadarEmailSecurityTopTldSpoofGetParamsARCNone RadarEmailSecurityTopTldSpoofGetParamsARC = "NONE"
- RadarEmailSecurityTopTldSpoofGetParamsARCFail RadarEmailSecurityTopTldSpoofGetParamsARC = "FAIL"
-)
-
-type RadarEmailSecurityTopTldSpoofGetParamsDateRange string
-
-const (
- RadarEmailSecurityTopTldSpoofGetParamsDateRange1d RadarEmailSecurityTopTldSpoofGetParamsDateRange = "1d"
- RadarEmailSecurityTopTldSpoofGetParamsDateRange2d RadarEmailSecurityTopTldSpoofGetParamsDateRange = "2d"
- RadarEmailSecurityTopTldSpoofGetParamsDateRange7d RadarEmailSecurityTopTldSpoofGetParamsDateRange = "7d"
- RadarEmailSecurityTopTldSpoofGetParamsDateRange14d RadarEmailSecurityTopTldSpoofGetParamsDateRange = "14d"
- RadarEmailSecurityTopTldSpoofGetParamsDateRange28d RadarEmailSecurityTopTldSpoofGetParamsDateRange = "28d"
- RadarEmailSecurityTopTldSpoofGetParamsDateRange12w RadarEmailSecurityTopTldSpoofGetParamsDateRange = "12w"
- RadarEmailSecurityTopTldSpoofGetParamsDateRange24w RadarEmailSecurityTopTldSpoofGetParamsDateRange = "24w"
- RadarEmailSecurityTopTldSpoofGetParamsDateRange52w RadarEmailSecurityTopTldSpoofGetParamsDateRange = "52w"
- RadarEmailSecurityTopTldSpoofGetParamsDateRange1dControl RadarEmailSecurityTopTldSpoofGetParamsDateRange = "1dControl"
- RadarEmailSecurityTopTldSpoofGetParamsDateRange2dControl RadarEmailSecurityTopTldSpoofGetParamsDateRange = "2dControl"
- RadarEmailSecurityTopTldSpoofGetParamsDateRange7dControl RadarEmailSecurityTopTldSpoofGetParamsDateRange = "7dControl"
- RadarEmailSecurityTopTldSpoofGetParamsDateRange14dControl RadarEmailSecurityTopTldSpoofGetParamsDateRange = "14dControl"
- RadarEmailSecurityTopTldSpoofGetParamsDateRange28dControl RadarEmailSecurityTopTldSpoofGetParamsDateRange = "28dControl"
- RadarEmailSecurityTopTldSpoofGetParamsDateRange12wControl RadarEmailSecurityTopTldSpoofGetParamsDateRange = "12wControl"
- RadarEmailSecurityTopTldSpoofGetParamsDateRange24wControl RadarEmailSecurityTopTldSpoofGetParamsDateRange = "24wControl"
-)
-
-type RadarEmailSecurityTopTldSpoofGetParamsDKIM string
-
-const (
- RadarEmailSecurityTopTldSpoofGetParamsDKIMPass RadarEmailSecurityTopTldSpoofGetParamsDKIM = "PASS"
- RadarEmailSecurityTopTldSpoofGetParamsDKIMNone RadarEmailSecurityTopTldSpoofGetParamsDKIM = "NONE"
- RadarEmailSecurityTopTldSpoofGetParamsDKIMFail RadarEmailSecurityTopTldSpoofGetParamsDKIM = "FAIL"
-)
-
-type RadarEmailSecurityTopTldSpoofGetParamsDMARC string
-
-const (
- RadarEmailSecurityTopTldSpoofGetParamsDMARCPass RadarEmailSecurityTopTldSpoofGetParamsDMARC = "PASS"
- RadarEmailSecurityTopTldSpoofGetParamsDMARCNone RadarEmailSecurityTopTldSpoofGetParamsDMARC = "NONE"
- RadarEmailSecurityTopTldSpoofGetParamsDMARCFail RadarEmailSecurityTopTldSpoofGetParamsDMARC = "FAIL"
-)
-
-// Format results are returned in.
-type RadarEmailSecurityTopTldSpoofGetParamsFormat string
-
-const (
- RadarEmailSecurityTopTldSpoofGetParamsFormatJson RadarEmailSecurityTopTldSpoofGetParamsFormat = "JSON"
- RadarEmailSecurityTopTldSpoofGetParamsFormatCsv RadarEmailSecurityTopTldSpoofGetParamsFormat = "CSV"
-)
-
-type RadarEmailSecurityTopTldSpoofGetParamsSPF string
-
-const (
- RadarEmailSecurityTopTldSpoofGetParamsSPFPass RadarEmailSecurityTopTldSpoofGetParamsSPF = "PASS"
- RadarEmailSecurityTopTldSpoofGetParamsSPFNone RadarEmailSecurityTopTldSpoofGetParamsSPF = "NONE"
- RadarEmailSecurityTopTldSpoofGetParamsSPFFail RadarEmailSecurityTopTldSpoofGetParamsSPF = "FAIL"
-)
-
-// Filter for TLDs by category.
-type RadarEmailSecurityTopTldSpoofGetParamsTldCategory string
-
-const (
- RadarEmailSecurityTopTldSpoofGetParamsTldCategoryClassic RadarEmailSecurityTopTldSpoofGetParamsTldCategory = "CLASSIC"
- RadarEmailSecurityTopTldSpoofGetParamsTldCategoryCountry RadarEmailSecurityTopTldSpoofGetParamsTldCategory = "COUNTRY"
-)
-
-type RadarEmailSecurityTopTldSpoofGetParamsTLSVersion string
-
-const (
- RadarEmailSecurityTopTldSpoofGetParamsTLSVersionTlSv1_0 RadarEmailSecurityTopTldSpoofGetParamsTLSVersion = "TLSv1_0"
- RadarEmailSecurityTopTldSpoofGetParamsTLSVersionTlSv1_1 RadarEmailSecurityTopTldSpoofGetParamsTLSVersion = "TLSv1_1"
- RadarEmailSecurityTopTldSpoofGetParamsTLSVersionTlSv1_2 RadarEmailSecurityTopTldSpoofGetParamsTLSVersion = "TLSv1_2"
- RadarEmailSecurityTopTldSpoofGetParamsTLSVersionTlSv1_3 RadarEmailSecurityTopTldSpoofGetParamsTLSVersion = "TLSv1_3"
-)
-
-type RadarEmailSecurityTopTldSpoofGetResponseEnvelope struct {
- Result RadarEmailSecurityTopTldSpoofGetResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarEmailSecurityTopTldSpoofGetResponseEnvelopeJSON `json:"-"`
-}
-
-// radarEmailSecurityTopTldSpoofGetResponseEnvelopeJSON contains the JSON metadata
-// for the struct [RadarEmailSecurityTopTldSpoofGetResponseEnvelope]
-type radarEmailSecurityTopTldSpoofGetResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEmailSecurityTopTldSpoofGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEmailSecurityTopTldSpoofGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
diff --git a/radaremailsecuritytoptldspoof_test.go b/radaremailsecuritytoptldspoof_test.go
deleted file mode 100644
index 032f335c306..00000000000
--- a/radaremailsecuritytoptldspoof_test.go
+++ /dev/null
@@ -1,56 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
- "time"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRadarEmailSecurityTopTldSpoofGetWithOptionalParams(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"),
- )
- _, err := client.Radar.Email.Security.Top.Tlds.Spoof.Get(
- context.TODO(),
- cloudflare.RadarEmailSecurityTopTldSpoofGetParamsSpoofSpoof,
- cloudflare.RadarEmailSecurityTopTldSpoofGetParams{
- ARC: cloudflare.F([]cloudflare.RadarEmailSecurityTopTldSpoofGetParamsARC{cloudflare.RadarEmailSecurityTopTldSpoofGetParamsARCPass, cloudflare.RadarEmailSecurityTopTldSpoofGetParamsARCNone, cloudflare.RadarEmailSecurityTopTldSpoofGetParamsARCFail}),
- DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
- DateRange: cloudflare.F([]cloudflare.RadarEmailSecurityTopTldSpoofGetParamsDateRange{cloudflare.RadarEmailSecurityTopTldSpoofGetParamsDateRange1d, cloudflare.RadarEmailSecurityTopTldSpoofGetParamsDateRange2d, cloudflare.RadarEmailSecurityTopTldSpoofGetParamsDateRange7d}),
- DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
- DKIM: cloudflare.F([]cloudflare.RadarEmailSecurityTopTldSpoofGetParamsDKIM{cloudflare.RadarEmailSecurityTopTldSpoofGetParamsDKIMPass, cloudflare.RadarEmailSecurityTopTldSpoofGetParamsDKIMNone, cloudflare.RadarEmailSecurityTopTldSpoofGetParamsDKIMFail}),
- DMARC: cloudflare.F([]cloudflare.RadarEmailSecurityTopTldSpoofGetParamsDMARC{cloudflare.RadarEmailSecurityTopTldSpoofGetParamsDMARCPass, cloudflare.RadarEmailSecurityTopTldSpoofGetParamsDMARCNone, cloudflare.RadarEmailSecurityTopTldSpoofGetParamsDMARCFail}),
- Format: cloudflare.F(cloudflare.RadarEmailSecurityTopTldSpoofGetParamsFormatJson),
- Limit: cloudflare.F(int64(5)),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- SPF: cloudflare.F([]cloudflare.RadarEmailSecurityTopTldSpoofGetParamsSPF{cloudflare.RadarEmailSecurityTopTldSpoofGetParamsSPFPass, cloudflare.RadarEmailSecurityTopTldSpoofGetParamsSPFNone, cloudflare.RadarEmailSecurityTopTldSpoofGetParamsSPFFail}),
- TldCategory: cloudflare.F(cloudflare.RadarEmailSecurityTopTldSpoofGetParamsTldCategoryClassic),
- TLSVersion: cloudflare.F([]cloudflare.RadarEmailSecurityTopTldSpoofGetParamsTLSVersion{cloudflare.RadarEmailSecurityTopTldSpoofGetParamsTLSVersionTlSv1_0, cloudflare.RadarEmailSecurityTopTldSpoofGetParamsTLSVersionTlSv1_1, cloudflare.RadarEmailSecurityTopTldSpoofGetParamsTLSVersionTlSv1_2}),
- },
- )
- 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/radarentity.go b/radarentity.go
deleted file mode 100644
index 1245b39160d..00000000000
--- a/radarentity.go
+++ /dev/null
@@ -1,152 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "net/http"
- "net/url"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarEntityService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewRadarEntityService] method
-// instead.
-type RadarEntityService struct {
- Options []option.RequestOption
- ASNs *RadarEntityASNService
- Locations *RadarEntityLocationService
-}
-
-// NewRadarEntityService generates a new service that applies the given options to
-// each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewRadarEntityService(opts ...option.RequestOption) (r *RadarEntityService) {
- r = &RadarEntityService{}
- r.Options = opts
- r.ASNs = NewRadarEntityASNService(opts...)
- r.Locations = NewRadarEntityLocationService(opts...)
- return
-}
-
-// Get IP address information.
-func (r *RadarEntityService) Get(ctx context.Context, query RadarEntityGetParams, opts ...option.RequestOption) (res *RadarEntityGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarEntityGetResponseEnvelope
- path := "radar/entities/ip"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type RadarEntityGetResponse struct {
- IP RadarEntityGetResponseIP `json:"ip,required"`
- JSON radarEntityGetResponseJSON `json:"-"`
-}
-
-// radarEntityGetResponseJSON contains the JSON metadata for the struct
-// [RadarEntityGetResponse]
-type radarEntityGetResponseJSON struct {
- IP apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEntityGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEntityGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEntityGetResponseIP struct {
- ASN string `json:"asn,required"`
- ASNLocation string `json:"asnLocation,required"`
- ASNName string `json:"asnName,required"`
- ASNOrgName string `json:"asnOrgName,required"`
- IP string `json:"ip,required"`
- IPVersion string `json:"ipVersion,required"`
- Location string `json:"location,required"`
- LocationName string `json:"locationName,required"`
- JSON radarEntityGetResponseIPJSON `json:"-"`
-}
-
-// radarEntityGetResponseIPJSON contains the JSON metadata for the struct
-// [RadarEntityGetResponseIP]
-type radarEntityGetResponseIPJSON struct {
- ASN apijson.Field
- ASNLocation apijson.Field
- ASNName apijson.Field
- ASNOrgName apijson.Field
- IP apijson.Field
- IPVersion apijson.Field
- Location apijson.Field
- LocationName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEntityGetResponseIP) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEntityGetResponseIPJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEntityGetParams struct {
- // IP address.
- IP param.Field[string] `query:"ip,required"`
- // Format results are returned in.
- Format param.Field[RadarEntityGetParamsFormat] `query:"format"`
-}
-
-// URLQuery serializes [RadarEntityGetParams]'s query parameters as `url.Values`.
-func (r RadarEntityGetParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Format results are returned in.
-type RadarEntityGetParamsFormat string
-
-const (
- RadarEntityGetParamsFormatJson RadarEntityGetParamsFormat = "JSON"
- RadarEntityGetParamsFormatCsv RadarEntityGetParamsFormat = "CSV"
-)
-
-type RadarEntityGetResponseEnvelope struct {
- Result RadarEntityGetResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarEntityGetResponseEnvelopeJSON `json:"-"`
-}
-
-// radarEntityGetResponseEnvelopeJSON contains the JSON metadata for the struct
-// [RadarEntityGetResponseEnvelope]
-type radarEntityGetResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEntityGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEntityGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
diff --git a/radarentity_test.go b/radarentity_test.go
deleted file mode 100644
index 7b801700a77..00000000000
--- a/radarentity_test.go
+++ /dev/null
@@ -1,41 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRadarEntityGetWithOptionalParams(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"),
- )
- _, err := client.Radar.Entities.Get(context.TODO(), cloudflare.RadarEntityGetParams{
- IP: cloudflare.F("8.8.8.8"),
- Format: cloudflare.F(cloudflare.RadarEntityGetParamsFormatJson),
- })
- 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/radarentityasn.go b/radarentityasn.go
deleted file mode 100644
index 867c15f01f7..00000000000
--- a/radarentityasn.go
+++ /dev/null
@@ -1,715 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarEntityASNService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewRadarEntityASNService] method
-// instead.
-type RadarEntityASNService struct {
- Options []option.RequestOption
-}
-
-// NewRadarEntityASNService generates a new service that applies the given options
-// to each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewRadarEntityASNService(opts ...option.RequestOption) (r *RadarEntityASNService) {
- r = &RadarEntityASNService{}
- r.Options = opts
- return
-}
-
-// Gets a list of autonomous systems (AS).
-func (r *RadarEntityASNService) List(ctx context.Context, query RadarEntityASNListParams, opts ...option.RequestOption) (res *RadarEntityASNListResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarEntityASNListResponseEnvelope
- path := "radar/entities/asns"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Get the requested autonomous system information. A confidence level below `5`
-// indicates a low level of confidence in the traffic data - normally this happens
-// because Cloudflare has a small amount of traffic from/to this AS). Population
-// estimates come from APNIC (refer to https://labs.apnic.net/?p=526).
-func (r *RadarEntityASNService) Get(ctx context.Context, asn int64, query RadarEntityASNGetParams, opts ...option.RequestOption) (res *RadarEntityASNGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarEntityASNGetResponseEnvelope
- path := fmt.Sprintf("radar/entities/asns/%v", asn)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Get the requested autonomous system information based on IP address. Population
-// estimates come from APNIC (refer to https://labs.apnic.net/?p=526).
-func (r *RadarEntityASNService) IP(ctx context.Context, query RadarEntityASNIPParams, opts ...option.RequestOption) (res *RadarEntityAsnipResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarEntityAsnipResponseEnvelope
- path := "radar/entities/asns/ip"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Get AS-level relationship for given networks.
-func (r *RadarEntityASNService) Rel(ctx context.Context, asn int64, query RadarEntityASNRelParams, opts ...option.RequestOption) (res *RadarEntityASNRelResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarEntityASNRelResponseEnvelope
- path := fmt.Sprintf("radar/entities/asns/%v/rel", asn)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type RadarEntityASNListResponse struct {
- ASNs []RadarEntityASNListResponseASN `json:"asns,required"`
- JSON radarEntityASNListResponseJSON `json:"-"`
-}
-
-// radarEntityASNListResponseJSON contains the JSON metadata for the struct
-// [RadarEntityASNListResponse]
-type radarEntityASNListResponseJSON struct {
- ASNs apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEntityASNListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEntityASNListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEntityASNListResponseASN struct {
- ASN int64 `json:"asn,required"`
- Country string `json:"country,required"`
- CountryName string `json:"countryName,required"`
- Name string `json:"name,required"`
- Aka string `json:"aka"`
- // Deprecated field. Please use 'aka'.
- NameLong string `json:"nameLong"`
- OrgName string `json:"orgName"`
- Website string `json:"website"`
- JSON radarEntityASNListResponseASNJSON `json:"-"`
-}
-
-// radarEntityASNListResponseASNJSON contains the JSON metadata for the struct
-// [RadarEntityASNListResponseASN]
-type radarEntityASNListResponseASNJSON struct {
- ASN apijson.Field
- Country apijson.Field
- CountryName apijson.Field
- Name apijson.Field
- Aka apijson.Field
- NameLong apijson.Field
- OrgName apijson.Field
- Website apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEntityASNListResponseASN) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEntityASNListResponseASNJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEntityASNGetResponse struct {
- ASN RadarEntityASNGetResponseASN `json:"asn,required"`
- JSON radarEntityASNGetResponseJSON `json:"-"`
-}
-
-// radarEntityASNGetResponseJSON contains the JSON metadata for the struct
-// [RadarEntityASNGetResponse]
-type radarEntityASNGetResponseJSON struct {
- ASN apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEntityASNGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEntityASNGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEntityASNGetResponseASN struct {
- ASN int64 `json:"asn,required"`
- ConfidenceLevel int64 `json:"confidenceLevel,required"`
- Country string `json:"country,required"`
- CountryName string `json:"countryName,required"`
- EstimatedUsers RadarEntityASNGetResponseASNEstimatedUsers `json:"estimatedUsers,required"`
- Name string `json:"name,required"`
- OrgName string `json:"orgName,required"`
- Related []RadarEntityASNGetResponseASNRelated `json:"related,required"`
- // Regional Internet Registry
- Source string `json:"source,required"`
- Website string `json:"website,required"`
- Aka string `json:"aka"`
- // Deprecated field. Please use 'aka'.
- NameLong string `json:"nameLong"`
- JSON radarEntityASNGetResponseASNJSON `json:"-"`
-}
-
-// radarEntityASNGetResponseASNJSON contains the JSON metadata for the struct
-// [RadarEntityASNGetResponseASN]
-type radarEntityASNGetResponseASNJSON struct {
- ASN apijson.Field
- ConfidenceLevel apijson.Field
- Country apijson.Field
- CountryName apijson.Field
- EstimatedUsers apijson.Field
- Name apijson.Field
- OrgName apijson.Field
- Related apijson.Field
- Source apijson.Field
- Website apijson.Field
- Aka apijson.Field
- NameLong apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEntityASNGetResponseASN) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEntityASNGetResponseASNJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEntityASNGetResponseASNEstimatedUsers struct {
- Locations []RadarEntityASNGetResponseASNEstimatedUsersLocation `json:"locations,required"`
- // Total estimated users
- EstimatedUsers int64 `json:"estimatedUsers"`
- JSON radarEntityASNGetResponseASNEstimatedUsersJSON `json:"-"`
-}
-
-// radarEntityASNGetResponseASNEstimatedUsersJSON contains the JSON metadata for
-// the struct [RadarEntityASNGetResponseASNEstimatedUsers]
-type radarEntityASNGetResponseASNEstimatedUsersJSON struct {
- Locations apijson.Field
- EstimatedUsers apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEntityASNGetResponseASNEstimatedUsers) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEntityASNGetResponseASNEstimatedUsersJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEntityASNGetResponseASNEstimatedUsersLocation struct {
- LocationAlpha2 string `json:"locationAlpha2,required"`
- LocationName string `json:"locationName,required"`
- // Estimated users per location
- EstimatedUsers int64 `json:"estimatedUsers"`
- JSON radarEntityASNGetResponseASNEstimatedUsersLocationJSON `json:"-"`
-}
-
-// radarEntityASNGetResponseASNEstimatedUsersLocationJSON contains the JSON
-// metadata for the struct [RadarEntityASNGetResponseASNEstimatedUsersLocation]
-type radarEntityASNGetResponseASNEstimatedUsersLocationJSON struct {
- LocationAlpha2 apijson.Field
- LocationName apijson.Field
- EstimatedUsers apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEntityASNGetResponseASNEstimatedUsersLocation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEntityASNGetResponseASNEstimatedUsersLocationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEntityASNGetResponseASNRelated struct {
- ASN int64 `json:"asn,required"`
- Name string `json:"name,required"`
- Aka string `json:"aka"`
- // Total estimated users
- EstimatedUsers int64 `json:"estimatedUsers"`
- JSON radarEntityASNGetResponseASNRelatedJSON `json:"-"`
-}
-
-// radarEntityASNGetResponseASNRelatedJSON contains the JSON metadata for the
-// struct [RadarEntityASNGetResponseASNRelated]
-type radarEntityASNGetResponseASNRelatedJSON struct {
- ASN apijson.Field
- Name apijson.Field
- Aka apijson.Field
- EstimatedUsers apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEntityASNGetResponseASNRelated) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEntityASNGetResponseASNRelatedJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEntityAsnipResponse struct {
- ASN RadarEntityAsnipResponseASN `json:"asn,required"`
- JSON radarEntityAsnipResponseJSON `json:"-"`
-}
-
-// radarEntityAsnipResponseJSON contains the JSON metadata for the struct
-// [RadarEntityAsnipResponse]
-type radarEntityAsnipResponseJSON struct {
- ASN apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEntityAsnipResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEntityAsnipResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEntityAsnipResponseASN struct {
- ASN int64 `json:"asn,required"`
- Country string `json:"country,required"`
- CountryName string `json:"countryName,required"`
- EstimatedUsers RadarEntityAsnipResponseASNEstimatedUsers `json:"estimatedUsers,required"`
- Name string `json:"name,required"`
- OrgName string `json:"orgName,required"`
- Related []RadarEntityAsnipResponseASNRelated `json:"related,required"`
- // Regional Internet Registry
- Source string `json:"source,required"`
- Website string `json:"website,required"`
- Aka string `json:"aka"`
- // Deprecated field. Please use 'aka'.
- NameLong string `json:"nameLong"`
- JSON radarEntityAsnipResponseASNJSON `json:"-"`
-}
-
-// radarEntityAsnipResponseASNJSON contains the JSON metadata for the struct
-// [RadarEntityAsnipResponseASN]
-type radarEntityAsnipResponseASNJSON struct {
- ASN apijson.Field
- Country apijson.Field
- CountryName apijson.Field
- EstimatedUsers apijson.Field
- Name apijson.Field
- OrgName apijson.Field
- Related apijson.Field
- Source apijson.Field
- Website apijson.Field
- Aka apijson.Field
- NameLong apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEntityAsnipResponseASN) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEntityAsnipResponseASNJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEntityAsnipResponseASNEstimatedUsers struct {
- Locations []RadarEntityAsnipResponseASNEstimatedUsersLocation `json:"locations,required"`
- // Total estimated users
- EstimatedUsers int64 `json:"estimatedUsers"`
- JSON radarEntityAsnipResponseASNEstimatedUsersJSON `json:"-"`
-}
-
-// radarEntityAsnipResponseASNEstimatedUsersJSON contains the JSON metadata for the
-// struct [RadarEntityAsnipResponseASNEstimatedUsers]
-type radarEntityAsnipResponseASNEstimatedUsersJSON struct {
- Locations apijson.Field
- EstimatedUsers apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEntityAsnipResponseASNEstimatedUsers) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEntityAsnipResponseASNEstimatedUsersJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEntityAsnipResponseASNEstimatedUsersLocation struct {
- LocationAlpha2 string `json:"locationAlpha2,required"`
- LocationName string `json:"locationName,required"`
- // Estimated users per location
- EstimatedUsers int64 `json:"estimatedUsers"`
- JSON radarEntityAsnipResponseASNEstimatedUsersLocationJSON `json:"-"`
-}
-
-// radarEntityAsnipResponseASNEstimatedUsersLocationJSON contains the JSON metadata
-// for the struct [RadarEntityAsnipResponseASNEstimatedUsersLocation]
-type radarEntityAsnipResponseASNEstimatedUsersLocationJSON struct {
- LocationAlpha2 apijson.Field
- LocationName apijson.Field
- EstimatedUsers apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEntityAsnipResponseASNEstimatedUsersLocation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEntityAsnipResponseASNEstimatedUsersLocationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEntityAsnipResponseASNRelated struct {
- ASN int64 `json:"asn,required"`
- Name string `json:"name,required"`
- Aka string `json:"aka"`
- // Total estimated users
- EstimatedUsers int64 `json:"estimatedUsers"`
- JSON radarEntityAsnipResponseASNRelatedJSON `json:"-"`
-}
-
-// radarEntityAsnipResponseASNRelatedJSON contains the JSON metadata for the struct
-// [RadarEntityAsnipResponseASNRelated]
-type radarEntityAsnipResponseASNRelatedJSON struct {
- ASN apijson.Field
- Name apijson.Field
- Aka apijson.Field
- EstimatedUsers apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEntityAsnipResponseASNRelated) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEntityAsnipResponseASNRelatedJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEntityASNRelResponse struct {
- Meta RadarEntityASNRelResponseMeta `json:"meta,required"`
- Rels []RadarEntityASNRelResponseRel `json:"rels,required"`
- JSON radarEntityASNRelResponseJSON `json:"-"`
-}
-
-// radarEntityASNRelResponseJSON contains the JSON metadata for the struct
-// [RadarEntityASNRelResponse]
-type radarEntityASNRelResponseJSON struct {
- Meta apijson.Field
- Rels apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEntityASNRelResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEntityASNRelResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEntityASNRelResponseMeta struct {
- DataTime string `json:"data_time,required"`
- QueryTime string `json:"query_time,required"`
- TotalPeers int64 `json:"total_peers,required"`
- JSON radarEntityASNRelResponseMetaJSON `json:"-"`
-}
-
-// radarEntityASNRelResponseMetaJSON contains the JSON metadata for the struct
-// [RadarEntityASNRelResponseMeta]
-type radarEntityASNRelResponseMetaJSON struct {
- DataTime apijson.Field
- QueryTime apijson.Field
- TotalPeers apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEntityASNRelResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEntityASNRelResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEntityASNRelResponseRel struct {
- Asn1 int64 `json:"asn1,required"`
- Asn1Country string `json:"asn1_country,required"`
- Asn1Name string `json:"asn1_name,required"`
- Asn2 int64 `json:"asn2,required"`
- Asn2Country string `json:"asn2_country,required"`
- Asn2Name string `json:"asn2_name,required"`
- Rel string `json:"rel,required"`
- JSON radarEntityASNRelResponseRelJSON `json:"-"`
-}
-
-// radarEntityASNRelResponseRelJSON contains the JSON metadata for the struct
-// [RadarEntityASNRelResponseRel]
-type radarEntityASNRelResponseRelJSON struct {
- Asn1 apijson.Field
- Asn1Country apijson.Field
- Asn1Name apijson.Field
- Asn2 apijson.Field
- Asn2Country apijson.Field
- Asn2Name apijson.Field
- Rel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEntityASNRelResponseRel) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEntityASNRelResponseRelJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEntityASNListParams struct {
- // Comma separated list of ASNs.
- ASN param.Field[string] `query:"asn"`
- // Format results are returned in.
- Format param.Field[RadarEntityASNListParamsFormat] `query:"format"`
- // Limit the number of objects in the response.
- Limit param.Field[int64] `query:"limit"`
- // Location Alpha2 to filter results.
- Location param.Field[string] `query:"location"`
- // Number of objects to skip before grabbing results.
- Offset param.Field[int64] `query:"offset"`
- // Order asn list.
- OrderBy param.Field[RadarEntityASNListParamsOrderBy] `query:"orderBy"`
-}
-
-// URLQuery serializes [RadarEntityASNListParams]'s query parameters as
-// `url.Values`.
-func (r RadarEntityASNListParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Format results are returned in.
-type RadarEntityASNListParamsFormat string
-
-const (
- RadarEntityASNListParamsFormatJson RadarEntityASNListParamsFormat = "JSON"
- RadarEntityASNListParamsFormatCsv RadarEntityASNListParamsFormat = "CSV"
-)
-
-// Order asn list.
-type RadarEntityASNListParamsOrderBy string
-
-const (
- RadarEntityASNListParamsOrderByASN RadarEntityASNListParamsOrderBy = "ASN"
- RadarEntityASNListParamsOrderByPopulation RadarEntityASNListParamsOrderBy = "POPULATION"
-)
-
-type RadarEntityASNListResponseEnvelope struct {
- Result RadarEntityASNListResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarEntityASNListResponseEnvelopeJSON `json:"-"`
-}
-
-// radarEntityASNListResponseEnvelopeJSON contains the JSON metadata for the struct
-// [RadarEntityASNListResponseEnvelope]
-type radarEntityASNListResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEntityASNListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEntityASNListResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEntityASNGetParams struct {
- // Format results are returned in.
- Format param.Field[RadarEntityASNGetParamsFormat] `query:"format"`
-}
-
-// URLQuery serializes [RadarEntityASNGetParams]'s query parameters as
-// `url.Values`.
-func (r RadarEntityASNGetParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Format results are returned in.
-type RadarEntityASNGetParamsFormat string
-
-const (
- RadarEntityASNGetParamsFormatJson RadarEntityASNGetParamsFormat = "JSON"
- RadarEntityASNGetParamsFormatCsv RadarEntityASNGetParamsFormat = "CSV"
-)
-
-type RadarEntityASNGetResponseEnvelope struct {
- Result RadarEntityASNGetResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarEntityASNGetResponseEnvelopeJSON `json:"-"`
-}
-
-// radarEntityASNGetResponseEnvelopeJSON contains the JSON metadata for the struct
-// [RadarEntityASNGetResponseEnvelope]
-type radarEntityASNGetResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEntityASNGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEntityASNGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEntityASNIPParams struct {
- // IP address.
- IP param.Field[string] `query:"ip,required"`
- // Format results are returned in.
- Format param.Field[RadarEntityAsnipParamsFormat] `query:"format"`
-}
-
-// URLQuery serializes [RadarEntityASNIPParams]'s query parameters as `url.Values`.
-func (r RadarEntityASNIPParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Format results are returned in.
-type RadarEntityAsnipParamsFormat string
-
-const (
- RadarEntityAsnipParamsFormatJson RadarEntityAsnipParamsFormat = "JSON"
- RadarEntityAsnipParamsFormatCsv RadarEntityAsnipParamsFormat = "CSV"
-)
-
-type RadarEntityAsnipResponseEnvelope struct {
- Result RadarEntityAsnipResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarEntityAsnipResponseEnvelopeJSON `json:"-"`
-}
-
-// radarEntityAsnipResponseEnvelopeJSON contains the JSON metadata for the struct
-// [RadarEntityAsnipResponseEnvelope]
-type radarEntityAsnipResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEntityAsnipResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEntityAsnipResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEntityASNRelParams struct {
- // Get the AS relationship of ASN2 with respect to the given ASN
- Asn2 param.Field[int64] `query:"asn2"`
- // Format results are returned in.
- Format param.Field[RadarEntityASNRelParamsFormat] `query:"format"`
-}
-
-// URLQuery serializes [RadarEntityASNRelParams]'s query parameters as
-// `url.Values`.
-func (r RadarEntityASNRelParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Format results are returned in.
-type RadarEntityASNRelParamsFormat string
-
-const (
- RadarEntityASNRelParamsFormatJson RadarEntityASNRelParamsFormat = "JSON"
- RadarEntityASNRelParamsFormatCsv RadarEntityASNRelParamsFormat = "CSV"
-)
-
-type RadarEntityASNRelResponseEnvelope struct {
- Result RadarEntityASNRelResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarEntityASNRelResponseEnvelopeJSON `json:"-"`
-}
-
-// radarEntityASNRelResponseEnvelopeJSON contains the JSON metadata for the struct
-// [RadarEntityASNRelResponseEnvelope]
-type radarEntityASNRelResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEntityASNRelResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEntityASNRelResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
diff --git a/radarentityasn_test.go b/radarentityasn_test.go
deleted file mode 100644
index 20266650313..00000000000
--- a/radarentityasn_test.go
+++ /dev/null
@@ -1,133 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRadarEntityASNListWithOptionalParams(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"),
- )
- _, err := client.Radar.Entities.ASNs.List(context.TODO(), cloudflare.RadarEntityASNListParams{
- ASN: cloudflare.F("174,7922"),
- Format: cloudflare.F(cloudflare.RadarEntityASNListParamsFormatJson),
- Limit: cloudflare.F(int64(5)),
- Location: cloudflare.F("US"),
- Offset: cloudflare.F(int64(0)),
- OrderBy: cloudflare.F(cloudflare.RadarEntityASNListParamsOrderByASN),
- })
- 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())
- }
-}
-
-func TestRadarEntityASNGetWithOptionalParams(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"),
- )
- _, err := client.Radar.Entities.ASNs.Get(
- context.TODO(),
- int64(3),
- cloudflare.RadarEntityASNGetParams{
- Format: cloudflare.F(cloudflare.RadarEntityASNGetParamsFormatJson),
- },
- )
- 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())
- }
-}
-
-func TestRadarEntityASNIPWithOptionalParams(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"),
- )
- _, err := client.Radar.Entities.ASNs.IP(context.TODO(), cloudflare.RadarEntityASNIPParams{
- IP: cloudflare.F("8.8.8.8"),
- Format: cloudflare.F(cloudflare.RadarEntityAsnipParamsFormatJson),
- })
- 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())
- }
-}
-
-func TestRadarEntityASNRelWithOptionalParams(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"),
- )
- _, err := client.Radar.Entities.ASNs.Rel(
- context.TODO(),
- int64(3),
- cloudflare.RadarEntityASNRelParams{
- Asn2: cloudflare.F(int64(0)),
- Format: cloudflare.F(cloudflare.RadarEntityASNRelParamsFormatJson),
- },
- )
- 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/radarentitylocation.go b/radarentitylocation.go
deleted file mode 100644
index c68976392a8..00000000000
--- a/radarentitylocation.go
+++ /dev/null
@@ -1,260 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarEntityLocationService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewRadarEntityLocationService]
-// method instead.
-type RadarEntityLocationService struct {
- Options []option.RequestOption
-}
-
-// NewRadarEntityLocationService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewRadarEntityLocationService(opts ...option.RequestOption) (r *RadarEntityLocationService) {
- r = &RadarEntityLocationService{}
- r.Options = opts
- return
-}
-
-// Get a list of locations.
-func (r *RadarEntityLocationService) List(ctx context.Context, query RadarEntityLocationListParams, opts ...option.RequestOption) (res *RadarEntityLocationListResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarEntityLocationListResponseEnvelope
- path := "radar/entities/locations"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Get the requested location information. A confidence level below `5` indicates a
-// low level of confidence in the traffic data - normally this happens because
-// Cloudflare has a small amount of traffic from/to this location).
-func (r *RadarEntityLocationService) Get(ctx context.Context, location string, query RadarEntityLocationGetParams, opts ...option.RequestOption) (res *RadarEntityLocationGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarEntityLocationGetResponseEnvelope
- path := fmt.Sprintf("radar/entities/locations/%s", location)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type RadarEntityLocationListResponse struct {
- Locations []RadarEntityLocationListResponseLocation `json:"locations,required"`
- JSON radarEntityLocationListResponseJSON `json:"-"`
-}
-
-// radarEntityLocationListResponseJSON contains the JSON metadata for the struct
-// [RadarEntityLocationListResponse]
-type radarEntityLocationListResponseJSON struct {
- Locations apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEntityLocationListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEntityLocationListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEntityLocationListResponseLocation struct {
- Alpha2 string `json:"alpha2,required"`
- Latitude string `json:"latitude,required"`
- Longitude string `json:"longitude,required"`
- Name string `json:"name,required"`
- JSON radarEntityLocationListResponseLocationJSON `json:"-"`
-}
-
-// radarEntityLocationListResponseLocationJSON contains the JSON metadata for the
-// struct [RadarEntityLocationListResponseLocation]
-type radarEntityLocationListResponseLocationJSON struct {
- Alpha2 apijson.Field
- Latitude apijson.Field
- Longitude apijson.Field
- Name apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEntityLocationListResponseLocation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEntityLocationListResponseLocationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEntityLocationGetResponse struct {
- Location RadarEntityLocationGetResponseLocation `json:"location,required"`
- JSON radarEntityLocationGetResponseJSON `json:"-"`
-}
-
-// radarEntityLocationGetResponseJSON contains the JSON metadata for the struct
-// [RadarEntityLocationGetResponse]
-type radarEntityLocationGetResponseJSON struct {
- Location apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEntityLocationGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEntityLocationGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEntityLocationGetResponseLocation struct {
- Alpha2 string `json:"alpha2,required"`
- ConfidenceLevel int64 `json:"confidenceLevel,required"`
- Latitude string `json:"latitude,required"`
- Longitude string `json:"longitude,required"`
- Name string `json:"name,required"`
- Region string `json:"region,required"`
- Subregion string `json:"subregion,required"`
- JSON radarEntityLocationGetResponseLocationJSON `json:"-"`
-}
-
-// radarEntityLocationGetResponseLocationJSON contains the JSON metadata for the
-// struct [RadarEntityLocationGetResponseLocation]
-type radarEntityLocationGetResponseLocationJSON struct {
- Alpha2 apijson.Field
- ConfidenceLevel apijson.Field
- Latitude apijson.Field
- Longitude apijson.Field
- Name apijson.Field
- Region apijson.Field
- Subregion apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEntityLocationGetResponseLocation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEntityLocationGetResponseLocationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEntityLocationListParams struct {
- // Format results are returned in.
- Format param.Field[RadarEntityLocationListParamsFormat] `query:"format"`
- // Limit the number of objects in the response.
- Limit param.Field[int64] `query:"limit"`
- // Comma separated list of locations.
- Location param.Field[string] `query:"location"`
- // Number of objects to skip before grabbing results.
- Offset param.Field[int64] `query:"offset"`
-}
-
-// URLQuery serializes [RadarEntityLocationListParams]'s query parameters as
-// `url.Values`.
-func (r RadarEntityLocationListParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Format results are returned in.
-type RadarEntityLocationListParamsFormat string
-
-const (
- RadarEntityLocationListParamsFormatJson RadarEntityLocationListParamsFormat = "JSON"
- RadarEntityLocationListParamsFormatCsv RadarEntityLocationListParamsFormat = "CSV"
-)
-
-type RadarEntityLocationListResponseEnvelope struct {
- Result RadarEntityLocationListResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarEntityLocationListResponseEnvelopeJSON `json:"-"`
-}
-
-// radarEntityLocationListResponseEnvelopeJSON contains the JSON metadata for the
-// struct [RadarEntityLocationListResponseEnvelope]
-type radarEntityLocationListResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEntityLocationListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEntityLocationListResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarEntityLocationGetParams struct {
- // Format results are returned in.
- Format param.Field[RadarEntityLocationGetParamsFormat] `query:"format"`
-}
-
-// URLQuery serializes [RadarEntityLocationGetParams]'s query parameters as
-// `url.Values`.
-func (r RadarEntityLocationGetParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Format results are returned in.
-type RadarEntityLocationGetParamsFormat string
-
-const (
- RadarEntityLocationGetParamsFormatJson RadarEntityLocationGetParamsFormat = "JSON"
- RadarEntityLocationGetParamsFormatCsv RadarEntityLocationGetParamsFormat = "CSV"
-)
-
-type RadarEntityLocationGetResponseEnvelope struct {
- Result RadarEntityLocationGetResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarEntityLocationGetResponseEnvelopeJSON `json:"-"`
-}
-
-// radarEntityLocationGetResponseEnvelopeJSON contains the JSON metadata for the
-// struct [RadarEntityLocationGetResponseEnvelope]
-type radarEntityLocationGetResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarEntityLocationGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarEntityLocationGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
diff --git a/radarentitylocation_test.go b/radarentitylocation_test.go
deleted file mode 100644
index 65b29b8bd9e..00000000000
--- a/radarentitylocation_test.go
+++ /dev/null
@@ -1,73 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRadarEntityLocationListWithOptionalParams(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"),
- )
- _, err := client.Radar.Entities.Locations.List(context.TODO(), cloudflare.RadarEntityLocationListParams{
- Format: cloudflare.F(cloudflare.RadarEntityLocationListParamsFormatJson),
- Limit: cloudflare.F(int64(5)),
- Location: cloudflare.F("US,CA"),
- Offset: cloudflare.F(int64(0)),
- })
- 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())
- }
-}
-
-func TestRadarEntityLocationGetWithOptionalParams(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"),
- )
- _, err := client.Radar.Entities.Locations.Get(
- context.TODO(),
- "US",
- cloudflare.RadarEntityLocationGetParams{
- Format: cloudflare.F(cloudflare.RadarEntityLocationGetParamsFormatJson),
- },
- )
- 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/radarhttp.go b/radarhttp.go
deleted file mode 100644
index 9599d89a568..00000000000
--- a/radarhttp.go
+++ /dev/null
@@ -1,34 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarHTTPService contains methods and other services that help with interacting
-// with the cloudflare API. Note, unlike clients, this service does not read
-// variables from the environment automatically. You should not instantiate this
-// service directly, and instead use the [NewRadarHTTPService] method instead.
-type RadarHTTPService struct {
- Options []option.RequestOption
- Top *RadarHTTPTopService
- Locations *RadarHTTPLocationService
- Ases *RadarHTTPAseService
- Summary *RadarHTTPSummaryService
- TimeseriesGroups *RadarHTTPTimeseriesGroupService
-}
-
-// NewRadarHTTPService generates a new service that applies the given options to
-// each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewRadarHTTPService(opts ...option.RequestOption) (r *RadarHTTPService) {
- r = &RadarHTTPService{}
- r.Options = opts
- r.Top = NewRadarHTTPTopService(opts...)
- r.Locations = NewRadarHTTPLocationService(opts...)
- r.Ases = NewRadarHTTPAseService(opts...)
- r.Summary = NewRadarHTTPSummaryService(opts...)
- r.TimeseriesGroups = NewRadarHTTPTimeseriesGroupService(opts...)
- return
-}
diff --git a/radarhttpase.go b/radarhttpase.go
deleted file mode 100644
index 153afcf3f63..00000000000
--- a/radarhttpase.go
+++ /dev/null
@@ -1,378 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarHTTPAseService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewRadarHTTPAseService] method
-// instead.
-type RadarHTTPAseService struct {
- Options []option.RequestOption
- BotClass *RadarHTTPAseBotClassService
- DeviceType *RadarHTTPAseDeviceTypeService
- HTTPProtocol *RadarHTTPAseHTTPProtocolService
- HTTPMethod *RadarHTTPAseHTTPMethodService
- IPVersion *RadarHTTPAseIPVersionService
- OS *RadarHTTPAseOSService
- TLSVersion *RadarHTTPAseTLSVersionService
-}
-
-// NewRadarHTTPAseService generates a new service that applies the given options to
-// each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewRadarHTTPAseService(opts ...option.RequestOption) (r *RadarHTTPAseService) {
- r = &RadarHTTPAseService{}
- r.Options = opts
- r.BotClass = NewRadarHTTPAseBotClassService(opts...)
- r.DeviceType = NewRadarHTTPAseDeviceTypeService(opts...)
- r.HTTPProtocol = NewRadarHTTPAseHTTPProtocolService(opts...)
- r.HTTPMethod = NewRadarHTTPAseHTTPMethodService(opts...)
- r.IPVersion = NewRadarHTTPAseIPVersionService(opts...)
- r.OS = NewRadarHTTPAseOSService(opts...)
- r.TLSVersion = NewRadarHTTPAseTLSVersionService(opts...)
- return
-}
-
-// Get the top autonomous systems by HTTP traffic. Values are a percentage out of
-// the total traffic.
-func (r *RadarHTTPAseService) Get(ctx context.Context, query RadarHTTPAseGetParams, opts ...option.RequestOption) (res *RadarHTTPAseGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarHTTPAseGetResponseEnvelope
- path := "radar/http/top/ases"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type RadarHTTPAseGetResponse struct {
- Meta RadarHTTPAseGetResponseMeta `json:"meta,required"`
- Top0 []RadarHTTPAseGetResponseTop0 `json:"top_0,required"`
- JSON radarHTTPAseGetResponseJSON `json:"-"`
-}
-
-// radarHTTPAseGetResponseJSON contains the JSON metadata for the struct
-// [RadarHTTPAseGetResponse]
-type radarHTTPAseGetResponseJSON struct {
- Meta apijson.Field
- Top0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPAseGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPAseGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPAseGetResponseMeta struct {
- DateRange []RadarHTTPAseGetResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- ConfidenceInfo RadarHTTPAseGetResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarHTTPAseGetResponseMetaJSON `json:"-"`
-}
-
-// radarHTTPAseGetResponseMetaJSON contains the JSON metadata for the struct
-// [RadarHTTPAseGetResponseMeta]
-type radarHTTPAseGetResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPAseGetResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPAseGetResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPAseGetResponseMetaDateRange 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 radarHTTPAseGetResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarHTTPAseGetResponseMetaDateRangeJSON contains the JSON metadata for the
-// struct [RadarHTTPAseGetResponseMetaDateRange]
-type radarHTTPAseGetResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPAseGetResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPAseGetResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPAseGetResponseMetaConfidenceInfo struct {
- Annotations []RadarHTTPAseGetResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarHTTPAseGetResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarHTTPAseGetResponseMetaConfidenceInfoJSON contains the JSON metadata for the
-// struct [RadarHTTPAseGetResponseMetaConfidenceInfo]
-type radarHTTPAseGetResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPAseGetResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPAseGetResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPAseGetResponseMetaConfidenceInfoAnnotation 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 radarHTTPAseGetResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarHTTPAseGetResponseMetaConfidenceInfoAnnotationJSON contains the JSON
-// metadata for the struct [RadarHTTPAseGetResponseMetaConfidenceInfoAnnotation]
-type radarHTTPAseGetResponseMetaConfidenceInfoAnnotationJSON 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 *RadarHTTPAseGetResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPAseGetResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPAseGetResponseTop0 struct {
- ClientASN int64 `json:"clientASN,required"`
- ClientAsName string `json:"clientASName,required"`
- Value string `json:"value,required"`
- JSON radarHTTPAseGetResponseTop0JSON `json:"-"`
-}
-
-// radarHTTPAseGetResponseTop0JSON contains the JSON metadata for the struct
-// [RadarHTTPAseGetResponseTop0]
-type radarHTTPAseGetResponseTop0JSON struct {
- ClientASN apijson.Field
- ClientAsName apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPAseGetResponseTop0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPAseGetResponseTop0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPAseGetParams 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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarHTTPAseGetParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Filter for device type.
- DeviceType param.Field[[]RadarHTTPAseGetParamsDeviceType] `query:"deviceType"`
- // Format results are returned in.
- Format param.Field[RadarHTTPAseGetParamsFormat] `query:"format"`
- // Filter for http protocol.
- HTTPProtocol param.Field[[]RadarHTTPAseGetParamsHTTPProtocol] `query:"httpProtocol"`
- // Filter for http version.
- HTTPVersion param.Field[[]RadarHTTPAseGetParamsHTTPVersion] `query:"httpVersion"`
- // Filter for ip version.
- IPVersion param.Field[[]RadarHTTPAseGetParamsIPVersion] `query:"ipVersion"`
- // 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 os name.
- OS param.Field[[]RadarHTTPAseGetParamsOS] `query:"os"`
- // Filter for tls version.
- TLSVersion param.Field[[]RadarHTTPAseGetParamsTLSVersion] `query:"tlsVersion"`
-}
-
-// URLQuery serializes [RadarHTTPAseGetParams]'s query parameters as `url.Values`.
-func (r RadarHTTPAseGetParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type RadarHTTPAseGetParamsBotClass string
-
-const (
- RadarHTTPAseGetParamsBotClassLikelyAutomated RadarHTTPAseGetParamsBotClass = "LIKELY_AUTOMATED"
- RadarHTTPAseGetParamsBotClassLikelyHuman RadarHTTPAseGetParamsBotClass = "LIKELY_HUMAN"
-)
-
-type RadarHTTPAseGetParamsDateRange string
-
-const (
- RadarHTTPAseGetParamsDateRange1d RadarHTTPAseGetParamsDateRange = "1d"
- RadarHTTPAseGetParamsDateRange2d RadarHTTPAseGetParamsDateRange = "2d"
- RadarHTTPAseGetParamsDateRange7d RadarHTTPAseGetParamsDateRange = "7d"
- RadarHTTPAseGetParamsDateRange14d RadarHTTPAseGetParamsDateRange = "14d"
- RadarHTTPAseGetParamsDateRange28d RadarHTTPAseGetParamsDateRange = "28d"
- RadarHTTPAseGetParamsDateRange12w RadarHTTPAseGetParamsDateRange = "12w"
- RadarHTTPAseGetParamsDateRange24w RadarHTTPAseGetParamsDateRange = "24w"
- RadarHTTPAseGetParamsDateRange52w RadarHTTPAseGetParamsDateRange = "52w"
- RadarHTTPAseGetParamsDateRange1dControl RadarHTTPAseGetParamsDateRange = "1dControl"
- RadarHTTPAseGetParamsDateRange2dControl RadarHTTPAseGetParamsDateRange = "2dControl"
- RadarHTTPAseGetParamsDateRange7dControl RadarHTTPAseGetParamsDateRange = "7dControl"
- RadarHTTPAseGetParamsDateRange14dControl RadarHTTPAseGetParamsDateRange = "14dControl"
- RadarHTTPAseGetParamsDateRange28dControl RadarHTTPAseGetParamsDateRange = "28dControl"
- RadarHTTPAseGetParamsDateRange12wControl RadarHTTPAseGetParamsDateRange = "12wControl"
- RadarHTTPAseGetParamsDateRange24wControl RadarHTTPAseGetParamsDateRange = "24wControl"
-)
-
-type RadarHTTPAseGetParamsDeviceType string
-
-const (
- RadarHTTPAseGetParamsDeviceTypeDesktop RadarHTTPAseGetParamsDeviceType = "DESKTOP"
- RadarHTTPAseGetParamsDeviceTypeMobile RadarHTTPAseGetParamsDeviceType = "MOBILE"
- RadarHTTPAseGetParamsDeviceTypeOther RadarHTTPAseGetParamsDeviceType = "OTHER"
-)
-
-// Format results are returned in.
-type RadarHTTPAseGetParamsFormat string
-
-const (
- RadarHTTPAseGetParamsFormatJson RadarHTTPAseGetParamsFormat = "JSON"
- RadarHTTPAseGetParamsFormatCsv RadarHTTPAseGetParamsFormat = "CSV"
-)
-
-type RadarHTTPAseGetParamsHTTPProtocol string
-
-const (
- RadarHTTPAseGetParamsHTTPProtocolHTTP RadarHTTPAseGetParamsHTTPProtocol = "HTTP"
- RadarHTTPAseGetParamsHTTPProtocolHTTPS RadarHTTPAseGetParamsHTTPProtocol = "HTTPS"
-)
-
-type RadarHTTPAseGetParamsHTTPVersion string
-
-const (
- RadarHTTPAseGetParamsHTTPVersionHttPv1 RadarHTTPAseGetParamsHTTPVersion = "HTTPv1"
- RadarHTTPAseGetParamsHTTPVersionHttPv2 RadarHTTPAseGetParamsHTTPVersion = "HTTPv2"
- RadarHTTPAseGetParamsHTTPVersionHttPv3 RadarHTTPAseGetParamsHTTPVersion = "HTTPv3"
-)
-
-type RadarHTTPAseGetParamsIPVersion string
-
-const (
- RadarHTTPAseGetParamsIPVersionIPv4 RadarHTTPAseGetParamsIPVersion = "IPv4"
- RadarHTTPAseGetParamsIPVersionIPv6 RadarHTTPAseGetParamsIPVersion = "IPv6"
-)
-
-type RadarHTTPAseGetParamsOS string
-
-const (
- RadarHTTPAseGetParamsOSWindows RadarHTTPAseGetParamsOS = "WINDOWS"
- RadarHTTPAseGetParamsOSMacosx RadarHTTPAseGetParamsOS = "MACOSX"
- RadarHTTPAseGetParamsOSIos RadarHTTPAseGetParamsOS = "IOS"
- RadarHTTPAseGetParamsOSAndroid RadarHTTPAseGetParamsOS = "ANDROID"
- RadarHTTPAseGetParamsOSChromeos RadarHTTPAseGetParamsOS = "CHROMEOS"
- RadarHTTPAseGetParamsOSLinux RadarHTTPAseGetParamsOS = "LINUX"
- RadarHTTPAseGetParamsOSSmartTv RadarHTTPAseGetParamsOS = "SMART_TV"
-)
-
-type RadarHTTPAseGetParamsTLSVersion string
-
-const (
- RadarHTTPAseGetParamsTLSVersionTlSv1_0 RadarHTTPAseGetParamsTLSVersion = "TLSv1_0"
- RadarHTTPAseGetParamsTLSVersionTlSv1_1 RadarHTTPAseGetParamsTLSVersion = "TLSv1_1"
- RadarHTTPAseGetParamsTLSVersionTlSv1_2 RadarHTTPAseGetParamsTLSVersion = "TLSv1_2"
- RadarHTTPAseGetParamsTLSVersionTlSv1_3 RadarHTTPAseGetParamsTLSVersion = "TLSv1_3"
- RadarHTTPAseGetParamsTLSVersionTlSvQuic RadarHTTPAseGetParamsTLSVersion = "TLSvQUIC"
-)
-
-type RadarHTTPAseGetResponseEnvelope struct {
- Result RadarHTTPAseGetResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarHTTPAseGetResponseEnvelopeJSON `json:"-"`
-}
-
-// radarHTTPAseGetResponseEnvelopeJSON contains the JSON metadata for the struct
-// [RadarHTTPAseGetResponseEnvelope]
-type radarHTTPAseGetResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPAseGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPAseGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
diff --git a/radarhttpase_test.go b/radarhttpase_test.go
deleted file mode 100644
index 0d715bd1015..00000000000
--- a/radarhttpase_test.go
+++ /dev/null
@@ -1,56 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
- "time"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRadarHTTPAseGetWithOptionalParams(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"),
- )
- _, 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()}),
- DeviceType: cloudflare.F([]cloudflare.RadarHTTPAseGetParamsDeviceType{cloudflare.RadarHTTPAseGetParamsDeviceTypeDesktop, cloudflare.RadarHTTPAseGetParamsDeviceTypeMobile, cloudflare.RadarHTTPAseGetParamsDeviceTypeOther}),
- Format: cloudflare.F(cloudflare.RadarHTTPAseGetParamsFormatJson),
- HTTPProtocol: cloudflare.F([]cloudflare.RadarHTTPAseGetParamsHTTPProtocol{cloudflare.RadarHTTPAseGetParamsHTTPProtocolHTTP, cloudflare.RadarHTTPAseGetParamsHTTPProtocolHTTPS}),
- HTTPVersion: cloudflare.F([]cloudflare.RadarHTTPAseGetParamsHTTPVersion{cloudflare.RadarHTTPAseGetParamsHTTPVersionHttPv1, cloudflare.RadarHTTPAseGetParamsHTTPVersionHttPv2, cloudflare.RadarHTTPAseGetParamsHTTPVersionHttPv3}),
- IPVersion: cloudflare.F([]cloudflare.RadarHTTPAseGetParamsIPVersion{cloudflare.RadarHTTPAseGetParamsIPVersionIPv4, cloudflare.RadarHTTPAseGetParamsIPVersionIPv6}),
- Limit: cloudflare.F(int64(5)),
- Location: cloudflare.F([]string{"string", "string", "string"}),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- OS: cloudflare.F([]cloudflare.RadarHTTPAseGetParamsOS{cloudflare.RadarHTTPAseGetParamsOSWindows, cloudflare.RadarHTTPAseGetParamsOSMacosx, cloudflare.RadarHTTPAseGetParamsOSIos}),
- TLSVersion: cloudflare.F([]cloudflare.RadarHTTPAseGetParamsTLSVersion{cloudflare.RadarHTTPAseGetParamsTLSVersionTlSv1_0, cloudflare.RadarHTTPAseGetParamsTLSVersionTlSv1_1, cloudflare.RadarHTTPAseGetParamsTLSVersionTlSv1_2}),
- })
- 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/radarhttpasebotclass.go b/radarhttpasebotclass.go
deleted file mode 100644
index e45575c4295..00000000000
--- a/radarhttpasebotclass.go
+++ /dev/null
@@ -1,367 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarHTTPAseBotClassService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewRadarHTTPAseBotClassService]
-// method instead.
-type RadarHTTPAseBotClassService struct {
- Options []option.RequestOption
-}
-
-// NewRadarHTTPAseBotClassService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewRadarHTTPAseBotClassService(opts ...option.RequestOption) (r *RadarHTTPAseBotClassService) {
- r = &RadarHTTPAseBotClassService{}
- r.Options = opts
- return
-}
-
-// Get the top autonomous systems (AS), by HTTP traffic, of the requested bot
-// class. These two categories use Cloudflare's bot score - refer to
-// [Bot Scores](https://developers.cloudflare.com/bots/concepts/bot-score) for more
-// information. Values are a percentage out of the total traffic.
-func (r *RadarHTTPAseBotClassService) Get(ctx context.Context, botClass RadarHTTPAseBotClassGetParamsBotClass, query RadarHTTPAseBotClassGetParams, opts ...option.RequestOption) (res *RadarHTTPAseBotClassGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarHTTPAseBotClassGetResponseEnvelope
- path := fmt.Sprintf("radar/http/top/ases/bot_class/%v", botClass)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type RadarHTTPAseBotClassGetResponse struct {
- Meta RadarHTTPAseBotClassGetResponseMeta `json:"meta,required"`
- Top0 []RadarHTTPAseBotClassGetResponseTop0 `json:"top_0,required"`
- JSON radarHTTPAseBotClassGetResponseJSON `json:"-"`
-}
-
-// radarHTTPAseBotClassGetResponseJSON contains the JSON metadata for the struct
-// [RadarHTTPAseBotClassGetResponse]
-type radarHTTPAseBotClassGetResponseJSON struct {
- Meta apijson.Field
- Top0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPAseBotClassGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPAseBotClassGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPAseBotClassGetResponseMeta struct {
- DateRange []RadarHTTPAseBotClassGetResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- ConfidenceInfo RadarHTTPAseBotClassGetResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarHTTPAseBotClassGetResponseMetaJSON `json:"-"`
-}
-
-// radarHTTPAseBotClassGetResponseMetaJSON contains the JSON metadata for the
-// struct [RadarHTTPAseBotClassGetResponseMeta]
-type radarHTTPAseBotClassGetResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPAseBotClassGetResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPAseBotClassGetResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPAseBotClassGetResponseMetaDateRange 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 radarHTTPAseBotClassGetResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarHTTPAseBotClassGetResponseMetaDateRangeJSON contains the JSON metadata for
-// the struct [RadarHTTPAseBotClassGetResponseMetaDateRange]
-type radarHTTPAseBotClassGetResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPAseBotClassGetResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPAseBotClassGetResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPAseBotClassGetResponseMetaConfidenceInfo struct {
- Annotations []RadarHTTPAseBotClassGetResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarHTTPAseBotClassGetResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarHTTPAseBotClassGetResponseMetaConfidenceInfoJSON contains the JSON metadata
-// for the struct [RadarHTTPAseBotClassGetResponseMetaConfidenceInfo]
-type radarHTTPAseBotClassGetResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPAseBotClassGetResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPAseBotClassGetResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPAseBotClassGetResponseMetaConfidenceInfoAnnotation 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 radarHTTPAseBotClassGetResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarHTTPAseBotClassGetResponseMetaConfidenceInfoAnnotationJSON contains the
-// JSON metadata for the struct
-// [RadarHTTPAseBotClassGetResponseMetaConfidenceInfoAnnotation]
-type radarHTTPAseBotClassGetResponseMetaConfidenceInfoAnnotationJSON 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 *RadarHTTPAseBotClassGetResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPAseBotClassGetResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPAseBotClassGetResponseTop0 struct {
- ClientASN int64 `json:"clientASN,required"`
- ClientAsName string `json:"clientASName,required"`
- Value string `json:"value,required"`
- JSON radarHTTPAseBotClassGetResponseTop0JSON `json:"-"`
-}
-
-// radarHTTPAseBotClassGetResponseTop0JSON contains the JSON metadata for the
-// struct [RadarHTTPAseBotClassGetResponseTop0]
-type radarHTTPAseBotClassGetResponseTop0JSON struct {
- ClientASN apijson.Field
- ClientAsName apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPAseBotClassGetResponseTop0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPAseBotClassGetResponseTop0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPAseBotClassGetParams 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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarHTTPAseBotClassGetParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Filter for device type.
- DeviceType param.Field[[]RadarHTTPAseBotClassGetParamsDeviceType] `query:"deviceType"`
- // Format results are returned in.
- Format param.Field[RadarHTTPAseBotClassGetParamsFormat] `query:"format"`
- // Filter for http protocol.
- HTTPProtocol param.Field[[]RadarHTTPAseBotClassGetParamsHTTPProtocol] `query:"httpProtocol"`
- // Filter for http version.
- HTTPVersion param.Field[[]RadarHTTPAseBotClassGetParamsHTTPVersion] `query:"httpVersion"`
- // Filter for ip version.
- IPVersion param.Field[[]RadarHTTPAseBotClassGetParamsIPVersion] `query:"ipVersion"`
- // 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 os name.
- OS param.Field[[]RadarHTTPAseBotClassGetParamsOS] `query:"os"`
- // Filter for tls version.
- TLSVersion param.Field[[]RadarHTTPAseBotClassGetParamsTLSVersion] `query:"tlsVersion"`
-}
-
-// URLQuery serializes [RadarHTTPAseBotClassGetParams]'s query parameters as
-// `url.Values`.
-func (r RadarHTTPAseBotClassGetParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Bot class.
-type RadarHTTPAseBotClassGetParamsBotClass string
-
-const (
- RadarHTTPAseBotClassGetParamsBotClassLikelyAutomated RadarHTTPAseBotClassGetParamsBotClass = "LIKELY_AUTOMATED"
- RadarHTTPAseBotClassGetParamsBotClassLikelyHuman RadarHTTPAseBotClassGetParamsBotClass = "LIKELY_HUMAN"
-)
-
-type RadarHTTPAseBotClassGetParamsDateRange string
-
-const (
- RadarHTTPAseBotClassGetParamsDateRange1d RadarHTTPAseBotClassGetParamsDateRange = "1d"
- RadarHTTPAseBotClassGetParamsDateRange2d RadarHTTPAseBotClassGetParamsDateRange = "2d"
- RadarHTTPAseBotClassGetParamsDateRange7d RadarHTTPAseBotClassGetParamsDateRange = "7d"
- RadarHTTPAseBotClassGetParamsDateRange14d RadarHTTPAseBotClassGetParamsDateRange = "14d"
- RadarHTTPAseBotClassGetParamsDateRange28d RadarHTTPAseBotClassGetParamsDateRange = "28d"
- RadarHTTPAseBotClassGetParamsDateRange12w RadarHTTPAseBotClassGetParamsDateRange = "12w"
- RadarHTTPAseBotClassGetParamsDateRange24w RadarHTTPAseBotClassGetParamsDateRange = "24w"
- RadarHTTPAseBotClassGetParamsDateRange52w RadarHTTPAseBotClassGetParamsDateRange = "52w"
- RadarHTTPAseBotClassGetParamsDateRange1dControl RadarHTTPAseBotClassGetParamsDateRange = "1dControl"
- RadarHTTPAseBotClassGetParamsDateRange2dControl RadarHTTPAseBotClassGetParamsDateRange = "2dControl"
- RadarHTTPAseBotClassGetParamsDateRange7dControl RadarHTTPAseBotClassGetParamsDateRange = "7dControl"
- RadarHTTPAseBotClassGetParamsDateRange14dControl RadarHTTPAseBotClassGetParamsDateRange = "14dControl"
- RadarHTTPAseBotClassGetParamsDateRange28dControl RadarHTTPAseBotClassGetParamsDateRange = "28dControl"
- RadarHTTPAseBotClassGetParamsDateRange12wControl RadarHTTPAseBotClassGetParamsDateRange = "12wControl"
- RadarHTTPAseBotClassGetParamsDateRange24wControl RadarHTTPAseBotClassGetParamsDateRange = "24wControl"
-)
-
-type RadarHTTPAseBotClassGetParamsDeviceType string
-
-const (
- RadarHTTPAseBotClassGetParamsDeviceTypeDesktop RadarHTTPAseBotClassGetParamsDeviceType = "DESKTOP"
- RadarHTTPAseBotClassGetParamsDeviceTypeMobile RadarHTTPAseBotClassGetParamsDeviceType = "MOBILE"
- RadarHTTPAseBotClassGetParamsDeviceTypeOther RadarHTTPAseBotClassGetParamsDeviceType = "OTHER"
-)
-
-// Format results are returned in.
-type RadarHTTPAseBotClassGetParamsFormat string
-
-const (
- RadarHTTPAseBotClassGetParamsFormatJson RadarHTTPAseBotClassGetParamsFormat = "JSON"
- RadarHTTPAseBotClassGetParamsFormatCsv RadarHTTPAseBotClassGetParamsFormat = "CSV"
-)
-
-type RadarHTTPAseBotClassGetParamsHTTPProtocol string
-
-const (
- RadarHTTPAseBotClassGetParamsHTTPProtocolHTTP RadarHTTPAseBotClassGetParamsHTTPProtocol = "HTTP"
- RadarHTTPAseBotClassGetParamsHTTPProtocolHTTPS RadarHTTPAseBotClassGetParamsHTTPProtocol = "HTTPS"
-)
-
-type RadarHTTPAseBotClassGetParamsHTTPVersion string
-
-const (
- RadarHTTPAseBotClassGetParamsHTTPVersionHttPv1 RadarHTTPAseBotClassGetParamsHTTPVersion = "HTTPv1"
- RadarHTTPAseBotClassGetParamsHTTPVersionHttPv2 RadarHTTPAseBotClassGetParamsHTTPVersion = "HTTPv2"
- RadarHTTPAseBotClassGetParamsHTTPVersionHttPv3 RadarHTTPAseBotClassGetParamsHTTPVersion = "HTTPv3"
-)
-
-type RadarHTTPAseBotClassGetParamsIPVersion string
-
-const (
- RadarHTTPAseBotClassGetParamsIPVersionIPv4 RadarHTTPAseBotClassGetParamsIPVersion = "IPv4"
- RadarHTTPAseBotClassGetParamsIPVersionIPv6 RadarHTTPAseBotClassGetParamsIPVersion = "IPv6"
-)
-
-type RadarHTTPAseBotClassGetParamsOS string
-
-const (
- RadarHTTPAseBotClassGetParamsOSWindows RadarHTTPAseBotClassGetParamsOS = "WINDOWS"
- RadarHTTPAseBotClassGetParamsOSMacosx RadarHTTPAseBotClassGetParamsOS = "MACOSX"
- RadarHTTPAseBotClassGetParamsOSIos RadarHTTPAseBotClassGetParamsOS = "IOS"
- RadarHTTPAseBotClassGetParamsOSAndroid RadarHTTPAseBotClassGetParamsOS = "ANDROID"
- RadarHTTPAseBotClassGetParamsOSChromeos RadarHTTPAseBotClassGetParamsOS = "CHROMEOS"
- RadarHTTPAseBotClassGetParamsOSLinux RadarHTTPAseBotClassGetParamsOS = "LINUX"
- RadarHTTPAseBotClassGetParamsOSSmartTv RadarHTTPAseBotClassGetParamsOS = "SMART_TV"
-)
-
-type RadarHTTPAseBotClassGetParamsTLSVersion string
-
-const (
- RadarHTTPAseBotClassGetParamsTLSVersionTlSv1_0 RadarHTTPAseBotClassGetParamsTLSVersion = "TLSv1_0"
- RadarHTTPAseBotClassGetParamsTLSVersionTlSv1_1 RadarHTTPAseBotClassGetParamsTLSVersion = "TLSv1_1"
- RadarHTTPAseBotClassGetParamsTLSVersionTlSv1_2 RadarHTTPAseBotClassGetParamsTLSVersion = "TLSv1_2"
- RadarHTTPAseBotClassGetParamsTLSVersionTlSv1_3 RadarHTTPAseBotClassGetParamsTLSVersion = "TLSv1_3"
- RadarHTTPAseBotClassGetParamsTLSVersionTlSvQuic RadarHTTPAseBotClassGetParamsTLSVersion = "TLSvQUIC"
-)
-
-type RadarHTTPAseBotClassGetResponseEnvelope struct {
- Result RadarHTTPAseBotClassGetResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarHTTPAseBotClassGetResponseEnvelopeJSON `json:"-"`
-}
-
-// radarHTTPAseBotClassGetResponseEnvelopeJSON contains the JSON metadata for the
-// struct [RadarHTTPAseBotClassGetResponseEnvelope]
-type radarHTTPAseBotClassGetResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPAseBotClassGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPAseBotClassGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
diff --git a/radarhttpasebotclass_test.go b/radarhttpasebotclass_test.go
deleted file mode 100644
index dc7d9ea4730..00000000000
--- a/radarhttpasebotclass_test.go
+++ /dev/null
@@ -1,59 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
- "time"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRadarHTTPAseBotClassGetWithOptionalParams(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"),
- )
- _, err := client.Radar.HTTP.Ases.BotClass.Get(
- context.TODO(),
- 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()}),
- DeviceType: cloudflare.F([]cloudflare.RadarHTTPAseBotClassGetParamsDeviceType{cloudflare.RadarHTTPAseBotClassGetParamsDeviceTypeDesktop, cloudflare.RadarHTTPAseBotClassGetParamsDeviceTypeMobile, cloudflare.RadarHTTPAseBotClassGetParamsDeviceTypeOther}),
- Format: cloudflare.F(cloudflare.RadarHTTPAseBotClassGetParamsFormatJson),
- HTTPProtocol: cloudflare.F([]cloudflare.RadarHTTPAseBotClassGetParamsHTTPProtocol{cloudflare.RadarHTTPAseBotClassGetParamsHTTPProtocolHTTP, cloudflare.RadarHTTPAseBotClassGetParamsHTTPProtocolHTTPS}),
- HTTPVersion: cloudflare.F([]cloudflare.RadarHTTPAseBotClassGetParamsHTTPVersion{cloudflare.RadarHTTPAseBotClassGetParamsHTTPVersionHttPv1, cloudflare.RadarHTTPAseBotClassGetParamsHTTPVersionHttPv2, cloudflare.RadarHTTPAseBotClassGetParamsHTTPVersionHttPv3}),
- IPVersion: cloudflare.F([]cloudflare.RadarHTTPAseBotClassGetParamsIPVersion{cloudflare.RadarHTTPAseBotClassGetParamsIPVersionIPv4, cloudflare.RadarHTTPAseBotClassGetParamsIPVersionIPv6}),
- Limit: cloudflare.F(int64(5)),
- Location: cloudflare.F([]string{"string", "string", "string"}),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- OS: cloudflare.F([]cloudflare.RadarHTTPAseBotClassGetParamsOS{cloudflare.RadarHTTPAseBotClassGetParamsOSWindows, cloudflare.RadarHTTPAseBotClassGetParamsOSMacosx, cloudflare.RadarHTTPAseBotClassGetParamsOSIos}),
- TLSVersion: cloudflare.F([]cloudflare.RadarHTTPAseBotClassGetParamsTLSVersion{cloudflare.RadarHTTPAseBotClassGetParamsTLSVersionTlSv1_0, cloudflare.RadarHTTPAseBotClassGetParamsTLSVersionTlSv1_1, cloudflare.RadarHTTPAseBotClassGetParamsTLSVersionTlSv1_2}),
- },
- )
- 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/radarhttpasedevicetype.go b/radarhttpasedevicetype.go
deleted file mode 100644
index 533e4b52fbe..00000000000
--- a/radarhttpasedevicetype.go
+++ /dev/null
@@ -1,366 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarHTTPAseDeviceTypeService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewRadarHTTPAseDeviceTypeService]
-// method instead.
-type RadarHTTPAseDeviceTypeService struct {
- Options []option.RequestOption
-}
-
-// NewRadarHTTPAseDeviceTypeService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewRadarHTTPAseDeviceTypeService(opts ...option.RequestOption) (r *RadarHTTPAseDeviceTypeService) {
- r = &RadarHTTPAseDeviceTypeService{}
- r.Options = opts
- return
-}
-
-// Get the top autonomous systems (AS), by HTTP traffic, of the requested device
-// type. Values are a percentage out of the total traffic.
-func (r *RadarHTTPAseDeviceTypeService) Get(ctx context.Context, deviceType RadarHTTPAseDeviceTypeGetParamsDeviceType, query RadarHTTPAseDeviceTypeGetParams, opts ...option.RequestOption) (res *RadarHTTPAseDeviceTypeGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarHTTPAseDeviceTypeGetResponseEnvelope
- path := fmt.Sprintf("radar/http/top/ases/device_type/%v", deviceType)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type RadarHTTPAseDeviceTypeGetResponse struct {
- Meta RadarHTTPAseDeviceTypeGetResponseMeta `json:"meta,required"`
- Top0 []RadarHTTPAseDeviceTypeGetResponseTop0 `json:"top_0,required"`
- JSON radarHTTPAseDeviceTypeGetResponseJSON `json:"-"`
-}
-
-// radarHTTPAseDeviceTypeGetResponseJSON contains the JSON metadata for the struct
-// [RadarHTTPAseDeviceTypeGetResponse]
-type radarHTTPAseDeviceTypeGetResponseJSON struct {
- Meta apijson.Field
- Top0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPAseDeviceTypeGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPAseDeviceTypeGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPAseDeviceTypeGetResponseMeta struct {
- DateRange []RadarHTTPAseDeviceTypeGetResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- ConfidenceInfo RadarHTTPAseDeviceTypeGetResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarHTTPAseDeviceTypeGetResponseMetaJSON `json:"-"`
-}
-
-// radarHTTPAseDeviceTypeGetResponseMetaJSON contains the JSON metadata for the
-// struct [RadarHTTPAseDeviceTypeGetResponseMeta]
-type radarHTTPAseDeviceTypeGetResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPAseDeviceTypeGetResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPAseDeviceTypeGetResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPAseDeviceTypeGetResponseMetaDateRange 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 radarHTTPAseDeviceTypeGetResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarHTTPAseDeviceTypeGetResponseMetaDateRangeJSON contains the JSON metadata
-// for the struct [RadarHTTPAseDeviceTypeGetResponseMetaDateRange]
-type radarHTTPAseDeviceTypeGetResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPAseDeviceTypeGetResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPAseDeviceTypeGetResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPAseDeviceTypeGetResponseMetaConfidenceInfo struct {
- Annotations []RadarHTTPAseDeviceTypeGetResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarHTTPAseDeviceTypeGetResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarHTTPAseDeviceTypeGetResponseMetaConfidenceInfoJSON contains the JSON
-// metadata for the struct [RadarHTTPAseDeviceTypeGetResponseMetaConfidenceInfo]
-type radarHTTPAseDeviceTypeGetResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPAseDeviceTypeGetResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPAseDeviceTypeGetResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPAseDeviceTypeGetResponseMetaConfidenceInfoAnnotation 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 radarHTTPAseDeviceTypeGetResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarHTTPAseDeviceTypeGetResponseMetaConfidenceInfoAnnotationJSON contains the
-// JSON metadata for the struct
-// [RadarHTTPAseDeviceTypeGetResponseMetaConfidenceInfoAnnotation]
-type radarHTTPAseDeviceTypeGetResponseMetaConfidenceInfoAnnotationJSON 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 *RadarHTTPAseDeviceTypeGetResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPAseDeviceTypeGetResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPAseDeviceTypeGetResponseTop0 struct {
- ClientASN int64 `json:"clientASN,required"`
- ClientAsName string `json:"clientASName,required"`
- Value string `json:"value,required"`
- JSON radarHTTPAseDeviceTypeGetResponseTop0JSON `json:"-"`
-}
-
-// radarHTTPAseDeviceTypeGetResponseTop0JSON contains the JSON metadata for the
-// struct [RadarHTTPAseDeviceTypeGetResponseTop0]
-type radarHTTPAseDeviceTypeGetResponseTop0JSON struct {
- ClientASN apijson.Field
- ClientAsName apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPAseDeviceTypeGetResponseTop0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPAseDeviceTypeGetResponseTop0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPAseDeviceTypeGetParams 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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarHTTPAseDeviceTypeGetParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Format results are returned in.
- Format param.Field[RadarHTTPAseDeviceTypeGetParamsFormat] `query:"format"`
- // Filter for http protocol.
- HTTPProtocol param.Field[[]RadarHTTPAseDeviceTypeGetParamsHTTPProtocol] `query:"httpProtocol"`
- // Filter for http version.
- HTTPVersion param.Field[[]RadarHTTPAseDeviceTypeGetParamsHTTPVersion] `query:"httpVersion"`
- // Filter for ip version.
- IPVersion param.Field[[]RadarHTTPAseDeviceTypeGetParamsIPVersion] `query:"ipVersion"`
- // 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 os name.
- OS param.Field[[]RadarHTTPAseDeviceTypeGetParamsOS] `query:"os"`
- // Filter for tls version.
- TLSVersion param.Field[[]RadarHTTPAseDeviceTypeGetParamsTLSVersion] `query:"tlsVersion"`
-}
-
-// URLQuery serializes [RadarHTTPAseDeviceTypeGetParams]'s query parameters as
-// `url.Values`.
-func (r RadarHTTPAseDeviceTypeGetParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Device type.
-type RadarHTTPAseDeviceTypeGetParamsDeviceType string
-
-const (
- RadarHTTPAseDeviceTypeGetParamsDeviceTypeDesktop RadarHTTPAseDeviceTypeGetParamsDeviceType = "DESKTOP"
- RadarHTTPAseDeviceTypeGetParamsDeviceTypeMobile RadarHTTPAseDeviceTypeGetParamsDeviceType = "MOBILE"
- RadarHTTPAseDeviceTypeGetParamsDeviceTypeOther RadarHTTPAseDeviceTypeGetParamsDeviceType = "OTHER"
-)
-
-type RadarHTTPAseDeviceTypeGetParamsBotClass string
-
-const (
- RadarHTTPAseDeviceTypeGetParamsBotClassLikelyAutomated RadarHTTPAseDeviceTypeGetParamsBotClass = "LIKELY_AUTOMATED"
- RadarHTTPAseDeviceTypeGetParamsBotClassLikelyHuman RadarHTTPAseDeviceTypeGetParamsBotClass = "LIKELY_HUMAN"
-)
-
-type RadarHTTPAseDeviceTypeGetParamsDateRange string
-
-const (
- RadarHTTPAseDeviceTypeGetParamsDateRange1d RadarHTTPAseDeviceTypeGetParamsDateRange = "1d"
- RadarHTTPAseDeviceTypeGetParamsDateRange2d RadarHTTPAseDeviceTypeGetParamsDateRange = "2d"
- RadarHTTPAseDeviceTypeGetParamsDateRange7d RadarHTTPAseDeviceTypeGetParamsDateRange = "7d"
- RadarHTTPAseDeviceTypeGetParamsDateRange14d RadarHTTPAseDeviceTypeGetParamsDateRange = "14d"
- RadarHTTPAseDeviceTypeGetParamsDateRange28d RadarHTTPAseDeviceTypeGetParamsDateRange = "28d"
- RadarHTTPAseDeviceTypeGetParamsDateRange12w RadarHTTPAseDeviceTypeGetParamsDateRange = "12w"
- RadarHTTPAseDeviceTypeGetParamsDateRange24w RadarHTTPAseDeviceTypeGetParamsDateRange = "24w"
- RadarHTTPAseDeviceTypeGetParamsDateRange52w RadarHTTPAseDeviceTypeGetParamsDateRange = "52w"
- RadarHTTPAseDeviceTypeGetParamsDateRange1dControl RadarHTTPAseDeviceTypeGetParamsDateRange = "1dControl"
- RadarHTTPAseDeviceTypeGetParamsDateRange2dControl RadarHTTPAseDeviceTypeGetParamsDateRange = "2dControl"
- RadarHTTPAseDeviceTypeGetParamsDateRange7dControl RadarHTTPAseDeviceTypeGetParamsDateRange = "7dControl"
- RadarHTTPAseDeviceTypeGetParamsDateRange14dControl RadarHTTPAseDeviceTypeGetParamsDateRange = "14dControl"
- RadarHTTPAseDeviceTypeGetParamsDateRange28dControl RadarHTTPAseDeviceTypeGetParamsDateRange = "28dControl"
- RadarHTTPAseDeviceTypeGetParamsDateRange12wControl RadarHTTPAseDeviceTypeGetParamsDateRange = "12wControl"
- RadarHTTPAseDeviceTypeGetParamsDateRange24wControl RadarHTTPAseDeviceTypeGetParamsDateRange = "24wControl"
-)
-
-// Format results are returned in.
-type RadarHTTPAseDeviceTypeGetParamsFormat string
-
-const (
- RadarHTTPAseDeviceTypeGetParamsFormatJson RadarHTTPAseDeviceTypeGetParamsFormat = "JSON"
- RadarHTTPAseDeviceTypeGetParamsFormatCsv RadarHTTPAseDeviceTypeGetParamsFormat = "CSV"
-)
-
-type RadarHTTPAseDeviceTypeGetParamsHTTPProtocol string
-
-const (
- RadarHTTPAseDeviceTypeGetParamsHTTPProtocolHTTP RadarHTTPAseDeviceTypeGetParamsHTTPProtocol = "HTTP"
- RadarHTTPAseDeviceTypeGetParamsHTTPProtocolHTTPS RadarHTTPAseDeviceTypeGetParamsHTTPProtocol = "HTTPS"
-)
-
-type RadarHTTPAseDeviceTypeGetParamsHTTPVersion string
-
-const (
- RadarHTTPAseDeviceTypeGetParamsHTTPVersionHttPv1 RadarHTTPAseDeviceTypeGetParamsHTTPVersion = "HTTPv1"
- RadarHTTPAseDeviceTypeGetParamsHTTPVersionHttPv2 RadarHTTPAseDeviceTypeGetParamsHTTPVersion = "HTTPv2"
- RadarHTTPAseDeviceTypeGetParamsHTTPVersionHttPv3 RadarHTTPAseDeviceTypeGetParamsHTTPVersion = "HTTPv3"
-)
-
-type RadarHTTPAseDeviceTypeGetParamsIPVersion string
-
-const (
- RadarHTTPAseDeviceTypeGetParamsIPVersionIPv4 RadarHTTPAseDeviceTypeGetParamsIPVersion = "IPv4"
- RadarHTTPAseDeviceTypeGetParamsIPVersionIPv6 RadarHTTPAseDeviceTypeGetParamsIPVersion = "IPv6"
-)
-
-type RadarHTTPAseDeviceTypeGetParamsOS string
-
-const (
- RadarHTTPAseDeviceTypeGetParamsOSWindows RadarHTTPAseDeviceTypeGetParamsOS = "WINDOWS"
- RadarHTTPAseDeviceTypeGetParamsOSMacosx RadarHTTPAseDeviceTypeGetParamsOS = "MACOSX"
- RadarHTTPAseDeviceTypeGetParamsOSIos RadarHTTPAseDeviceTypeGetParamsOS = "IOS"
- RadarHTTPAseDeviceTypeGetParamsOSAndroid RadarHTTPAseDeviceTypeGetParamsOS = "ANDROID"
- RadarHTTPAseDeviceTypeGetParamsOSChromeos RadarHTTPAseDeviceTypeGetParamsOS = "CHROMEOS"
- RadarHTTPAseDeviceTypeGetParamsOSLinux RadarHTTPAseDeviceTypeGetParamsOS = "LINUX"
- RadarHTTPAseDeviceTypeGetParamsOSSmartTv RadarHTTPAseDeviceTypeGetParamsOS = "SMART_TV"
-)
-
-type RadarHTTPAseDeviceTypeGetParamsTLSVersion string
-
-const (
- RadarHTTPAseDeviceTypeGetParamsTLSVersionTlSv1_0 RadarHTTPAseDeviceTypeGetParamsTLSVersion = "TLSv1_0"
- RadarHTTPAseDeviceTypeGetParamsTLSVersionTlSv1_1 RadarHTTPAseDeviceTypeGetParamsTLSVersion = "TLSv1_1"
- RadarHTTPAseDeviceTypeGetParamsTLSVersionTlSv1_2 RadarHTTPAseDeviceTypeGetParamsTLSVersion = "TLSv1_2"
- RadarHTTPAseDeviceTypeGetParamsTLSVersionTlSv1_3 RadarHTTPAseDeviceTypeGetParamsTLSVersion = "TLSv1_3"
- RadarHTTPAseDeviceTypeGetParamsTLSVersionTlSvQuic RadarHTTPAseDeviceTypeGetParamsTLSVersion = "TLSvQUIC"
-)
-
-type RadarHTTPAseDeviceTypeGetResponseEnvelope struct {
- Result RadarHTTPAseDeviceTypeGetResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarHTTPAseDeviceTypeGetResponseEnvelopeJSON `json:"-"`
-}
-
-// radarHTTPAseDeviceTypeGetResponseEnvelopeJSON contains the JSON metadata for the
-// struct [RadarHTTPAseDeviceTypeGetResponseEnvelope]
-type radarHTTPAseDeviceTypeGetResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPAseDeviceTypeGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPAseDeviceTypeGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
diff --git a/radarhttpasedevicetype_test.go b/radarhttpasedevicetype_test.go
deleted file mode 100644
index 6a0e89270e0..00000000000
--- a/radarhttpasedevicetype_test.go
+++ /dev/null
@@ -1,59 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
- "time"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRadarHTTPAseDeviceTypeGetWithOptionalParams(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"),
- )
- _, err := client.Radar.HTTP.Ases.DeviceType.Get(
- context.TODO(),
- cloudflare.RadarHTTPAseDeviceTypeGetParamsDeviceTypeDesktop,
- 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()}),
- Format: cloudflare.F(cloudflare.RadarHTTPAseDeviceTypeGetParamsFormatJson),
- HTTPProtocol: cloudflare.F([]cloudflare.RadarHTTPAseDeviceTypeGetParamsHTTPProtocol{cloudflare.RadarHTTPAseDeviceTypeGetParamsHTTPProtocolHTTP, cloudflare.RadarHTTPAseDeviceTypeGetParamsHTTPProtocolHTTPS}),
- HTTPVersion: cloudflare.F([]cloudflare.RadarHTTPAseDeviceTypeGetParamsHTTPVersion{cloudflare.RadarHTTPAseDeviceTypeGetParamsHTTPVersionHttPv1, cloudflare.RadarHTTPAseDeviceTypeGetParamsHTTPVersionHttPv2, cloudflare.RadarHTTPAseDeviceTypeGetParamsHTTPVersionHttPv3}),
- IPVersion: cloudflare.F([]cloudflare.RadarHTTPAseDeviceTypeGetParamsIPVersion{cloudflare.RadarHTTPAseDeviceTypeGetParamsIPVersionIPv4, cloudflare.RadarHTTPAseDeviceTypeGetParamsIPVersionIPv6}),
- Limit: cloudflare.F(int64(5)),
- Location: cloudflare.F([]string{"string", "string", "string"}),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- OS: cloudflare.F([]cloudflare.RadarHTTPAseDeviceTypeGetParamsOS{cloudflare.RadarHTTPAseDeviceTypeGetParamsOSWindows, cloudflare.RadarHTTPAseDeviceTypeGetParamsOSMacosx, cloudflare.RadarHTTPAseDeviceTypeGetParamsOSIos}),
- TLSVersion: cloudflare.F([]cloudflare.RadarHTTPAseDeviceTypeGetParamsTLSVersion{cloudflare.RadarHTTPAseDeviceTypeGetParamsTLSVersionTlSv1_0, cloudflare.RadarHTTPAseDeviceTypeGetParamsTLSVersionTlSv1_1, cloudflare.RadarHTTPAseDeviceTypeGetParamsTLSVersionTlSv1_2}),
- },
- )
- 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/radarhttpasehttpmethod.go b/radarhttpasehttpmethod.go
deleted file mode 100644
index ac63a481a3f..00000000000
--- a/radarhttpasehttpmethod.go
+++ /dev/null
@@ -1,366 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarHTTPAseHTTPMethodService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewRadarHTTPAseHTTPMethodService]
-// method instead.
-type RadarHTTPAseHTTPMethodService struct {
- Options []option.RequestOption
-}
-
-// NewRadarHTTPAseHTTPMethodService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewRadarHTTPAseHTTPMethodService(opts ...option.RequestOption) (r *RadarHTTPAseHTTPMethodService) {
- r = &RadarHTTPAseHTTPMethodService{}
- r.Options = opts
- return
-}
-
-// Get the top autonomous systems (AS), by HTTP traffic, of the requested HTTP
-// protocol version. Values are a percentage out of the total traffic.
-func (r *RadarHTTPAseHTTPMethodService) Get(ctx context.Context, httpVersion RadarHTTPAseHTTPMethodGetParamsHTTPVersion, query RadarHTTPAseHTTPMethodGetParams, opts ...option.RequestOption) (res *RadarHTTPAseHTTPMethodGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarHTTPAseHTTPMethodGetResponseEnvelope
- path := fmt.Sprintf("radar/http/top/ases/http_version/%v", httpVersion)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type RadarHTTPAseHTTPMethodGetResponse struct {
- Meta RadarHTTPAseHTTPMethodGetResponseMeta `json:"meta,required"`
- Top0 []RadarHTTPAseHTTPMethodGetResponseTop0 `json:"top_0,required"`
- JSON radarHTTPAseHTTPMethodGetResponseJSON `json:"-"`
-}
-
-// radarHTTPAseHTTPMethodGetResponseJSON contains the JSON metadata for the struct
-// [RadarHTTPAseHTTPMethodGetResponse]
-type radarHTTPAseHTTPMethodGetResponseJSON struct {
- Meta apijson.Field
- Top0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPAseHTTPMethodGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPAseHTTPMethodGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPAseHTTPMethodGetResponseMeta struct {
- DateRange []RadarHTTPAseHTTPMethodGetResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- ConfidenceInfo RadarHTTPAseHTTPMethodGetResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarHTTPAseHTTPMethodGetResponseMetaJSON `json:"-"`
-}
-
-// radarHTTPAseHTTPMethodGetResponseMetaJSON contains the JSON metadata for the
-// struct [RadarHTTPAseHTTPMethodGetResponseMeta]
-type radarHTTPAseHTTPMethodGetResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPAseHTTPMethodGetResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPAseHTTPMethodGetResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPAseHTTPMethodGetResponseMetaDateRange 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 radarHTTPAseHTTPMethodGetResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarHTTPAseHTTPMethodGetResponseMetaDateRangeJSON contains the JSON metadata
-// for the struct [RadarHTTPAseHTTPMethodGetResponseMetaDateRange]
-type radarHTTPAseHTTPMethodGetResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPAseHTTPMethodGetResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPAseHTTPMethodGetResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPAseHTTPMethodGetResponseMetaConfidenceInfo struct {
- Annotations []RadarHTTPAseHTTPMethodGetResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarHTTPAseHTTPMethodGetResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarHTTPAseHTTPMethodGetResponseMetaConfidenceInfoJSON contains the JSON
-// metadata for the struct [RadarHTTPAseHTTPMethodGetResponseMetaConfidenceInfo]
-type radarHTTPAseHTTPMethodGetResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPAseHTTPMethodGetResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPAseHTTPMethodGetResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPAseHTTPMethodGetResponseMetaConfidenceInfoAnnotation 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 radarHTTPAseHTTPMethodGetResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarHTTPAseHTTPMethodGetResponseMetaConfidenceInfoAnnotationJSON contains the
-// JSON metadata for the struct
-// [RadarHTTPAseHTTPMethodGetResponseMetaConfidenceInfoAnnotation]
-type radarHTTPAseHTTPMethodGetResponseMetaConfidenceInfoAnnotationJSON 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 *RadarHTTPAseHTTPMethodGetResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPAseHTTPMethodGetResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPAseHTTPMethodGetResponseTop0 struct {
- ClientASN int64 `json:"clientASN,required"`
- ClientAsName string `json:"clientASName,required"`
- Value string `json:"value,required"`
- JSON radarHTTPAseHTTPMethodGetResponseTop0JSON `json:"-"`
-}
-
-// radarHTTPAseHTTPMethodGetResponseTop0JSON contains the JSON metadata for the
-// struct [RadarHTTPAseHTTPMethodGetResponseTop0]
-type radarHTTPAseHTTPMethodGetResponseTop0JSON struct {
- ClientASN apijson.Field
- ClientAsName apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPAseHTTPMethodGetResponseTop0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPAseHTTPMethodGetResponseTop0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPAseHTTPMethodGetParams 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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarHTTPAseHTTPMethodGetParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Filter for device type.
- DeviceType param.Field[[]RadarHTTPAseHTTPMethodGetParamsDeviceType] `query:"deviceType"`
- // Format results are returned in.
- Format param.Field[RadarHTTPAseHTTPMethodGetParamsFormat] `query:"format"`
- // Filter for http protocol.
- HTTPProtocol param.Field[[]RadarHTTPAseHTTPMethodGetParamsHTTPProtocol] `query:"httpProtocol"`
- // Filter for ip version.
- IPVersion param.Field[[]RadarHTTPAseHTTPMethodGetParamsIPVersion] `query:"ipVersion"`
- // 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 os name.
- OS param.Field[[]RadarHTTPAseHTTPMethodGetParamsOS] `query:"os"`
- // Filter for tls version.
- TLSVersion param.Field[[]RadarHTTPAseHTTPMethodGetParamsTLSVersion] `query:"tlsVersion"`
-}
-
-// URLQuery serializes [RadarHTTPAseHTTPMethodGetParams]'s query parameters as
-// `url.Values`.
-func (r RadarHTTPAseHTTPMethodGetParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// HTTP version.
-type RadarHTTPAseHTTPMethodGetParamsHTTPVersion string
-
-const (
- RadarHTTPAseHTTPMethodGetParamsHTTPVersionHttPv1 RadarHTTPAseHTTPMethodGetParamsHTTPVersion = "HTTPv1"
- RadarHTTPAseHTTPMethodGetParamsHTTPVersionHttPv2 RadarHTTPAseHTTPMethodGetParamsHTTPVersion = "HTTPv2"
- RadarHTTPAseHTTPMethodGetParamsHTTPVersionHttPv3 RadarHTTPAseHTTPMethodGetParamsHTTPVersion = "HTTPv3"
-)
-
-type RadarHTTPAseHTTPMethodGetParamsBotClass string
-
-const (
- RadarHTTPAseHTTPMethodGetParamsBotClassLikelyAutomated RadarHTTPAseHTTPMethodGetParamsBotClass = "LIKELY_AUTOMATED"
- RadarHTTPAseHTTPMethodGetParamsBotClassLikelyHuman RadarHTTPAseHTTPMethodGetParamsBotClass = "LIKELY_HUMAN"
-)
-
-type RadarHTTPAseHTTPMethodGetParamsDateRange string
-
-const (
- RadarHTTPAseHTTPMethodGetParamsDateRange1d RadarHTTPAseHTTPMethodGetParamsDateRange = "1d"
- RadarHTTPAseHTTPMethodGetParamsDateRange2d RadarHTTPAseHTTPMethodGetParamsDateRange = "2d"
- RadarHTTPAseHTTPMethodGetParamsDateRange7d RadarHTTPAseHTTPMethodGetParamsDateRange = "7d"
- RadarHTTPAseHTTPMethodGetParamsDateRange14d RadarHTTPAseHTTPMethodGetParamsDateRange = "14d"
- RadarHTTPAseHTTPMethodGetParamsDateRange28d RadarHTTPAseHTTPMethodGetParamsDateRange = "28d"
- RadarHTTPAseHTTPMethodGetParamsDateRange12w RadarHTTPAseHTTPMethodGetParamsDateRange = "12w"
- RadarHTTPAseHTTPMethodGetParamsDateRange24w RadarHTTPAseHTTPMethodGetParamsDateRange = "24w"
- RadarHTTPAseHTTPMethodGetParamsDateRange52w RadarHTTPAseHTTPMethodGetParamsDateRange = "52w"
- RadarHTTPAseHTTPMethodGetParamsDateRange1dControl RadarHTTPAseHTTPMethodGetParamsDateRange = "1dControl"
- RadarHTTPAseHTTPMethodGetParamsDateRange2dControl RadarHTTPAseHTTPMethodGetParamsDateRange = "2dControl"
- RadarHTTPAseHTTPMethodGetParamsDateRange7dControl RadarHTTPAseHTTPMethodGetParamsDateRange = "7dControl"
- RadarHTTPAseHTTPMethodGetParamsDateRange14dControl RadarHTTPAseHTTPMethodGetParamsDateRange = "14dControl"
- RadarHTTPAseHTTPMethodGetParamsDateRange28dControl RadarHTTPAseHTTPMethodGetParamsDateRange = "28dControl"
- RadarHTTPAseHTTPMethodGetParamsDateRange12wControl RadarHTTPAseHTTPMethodGetParamsDateRange = "12wControl"
- RadarHTTPAseHTTPMethodGetParamsDateRange24wControl RadarHTTPAseHTTPMethodGetParamsDateRange = "24wControl"
-)
-
-type RadarHTTPAseHTTPMethodGetParamsDeviceType string
-
-const (
- RadarHTTPAseHTTPMethodGetParamsDeviceTypeDesktop RadarHTTPAseHTTPMethodGetParamsDeviceType = "DESKTOP"
- RadarHTTPAseHTTPMethodGetParamsDeviceTypeMobile RadarHTTPAseHTTPMethodGetParamsDeviceType = "MOBILE"
- RadarHTTPAseHTTPMethodGetParamsDeviceTypeOther RadarHTTPAseHTTPMethodGetParamsDeviceType = "OTHER"
-)
-
-// Format results are returned in.
-type RadarHTTPAseHTTPMethodGetParamsFormat string
-
-const (
- RadarHTTPAseHTTPMethodGetParamsFormatJson RadarHTTPAseHTTPMethodGetParamsFormat = "JSON"
- RadarHTTPAseHTTPMethodGetParamsFormatCsv RadarHTTPAseHTTPMethodGetParamsFormat = "CSV"
-)
-
-type RadarHTTPAseHTTPMethodGetParamsHTTPProtocol string
-
-const (
- RadarHTTPAseHTTPMethodGetParamsHTTPProtocolHTTP RadarHTTPAseHTTPMethodGetParamsHTTPProtocol = "HTTP"
- RadarHTTPAseHTTPMethodGetParamsHTTPProtocolHTTPS RadarHTTPAseHTTPMethodGetParamsHTTPProtocol = "HTTPS"
-)
-
-type RadarHTTPAseHTTPMethodGetParamsIPVersion string
-
-const (
- RadarHTTPAseHTTPMethodGetParamsIPVersionIPv4 RadarHTTPAseHTTPMethodGetParamsIPVersion = "IPv4"
- RadarHTTPAseHTTPMethodGetParamsIPVersionIPv6 RadarHTTPAseHTTPMethodGetParamsIPVersion = "IPv6"
-)
-
-type RadarHTTPAseHTTPMethodGetParamsOS string
-
-const (
- RadarHTTPAseHTTPMethodGetParamsOSWindows RadarHTTPAseHTTPMethodGetParamsOS = "WINDOWS"
- RadarHTTPAseHTTPMethodGetParamsOSMacosx RadarHTTPAseHTTPMethodGetParamsOS = "MACOSX"
- RadarHTTPAseHTTPMethodGetParamsOSIos RadarHTTPAseHTTPMethodGetParamsOS = "IOS"
- RadarHTTPAseHTTPMethodGetParamsOSAndroid RadarHTTPAseHTTPMethodGetParamsOS = "ANDROID"
- RadarHTTPAseHTTPMethodGetParamsOSChromeos RadarHTTPAseHTTPMethodGetParamsOS = "CHROMEOS"
- RadarHTTPAseHTTPMethodGetParamsOSLinux RadarHTTPAseHTTPMethodGetParamsOS = "LINUX"
- RadarHTTPAseHTTPMethodGetParamsOSSmartTv RadarHTTPAseHTTPMethodGetParamsOS = "SMART_TV"
-)
-
-type RadarHTTPAseHTTPMethodGetParamsTLSVersion string
-
-const (
- RadarHTTPAseHTTPMethodGetParamsTLSVersionTlSv1_0 RadarHTTPAseHTTPMethodGetParamsTLSVersion = "TLSv1_0"
- RadarHTTPAseHTTPMethodGetParamsTLSVersionTlSv1_1 RadarHTTPAseHTTPMethodGetParamsTLSVersion = "TLSv1_1"
- RadarHTTPAseHTTPMethodGetParamsTLSVersionTlSv1_2 RadarHTTPAseHTTPMethodGetParamsTLSVersion = "TLSv1_2"
- RadarHTTPAseHTTPMethodGetParamsTLSVersionTlSv1_3 RadarHTTPAseHTTPMethodGetParamsTLSVersion = "TLSv1_3"
- RadarHTTPAseHTTPMethodGetParamsTLSVersionTlSvQuic RadarHTTPAseHTTPMethodGetParamsTLSVersion = "TLSvQUIC"
-)
-
-type RadarHTTPAseHTTPMethodGetResponseEnvelope struct {
- Result RadarHTTPAseHTTPMethodGetResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarHTTPAseHTTPMethodGetResponseEnvelopeJSON `json:"-"`
-}
-
-// radarHTTPAseHTTPMethodGetResponseEnvelopeJSON contains the JSON metadata for the
-// struct [RadarHTTPAseHTTPMethodGetResponseEnvelope]
-type radarHTTPAseHTTPMethodGetResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPAseHTTPMethodGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPAseHTTPMethodGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
diff --git a/radarhttpasehttpmethod_test.go b/radarhttpasehttpmethod_test.go
deleted file mode 100644
index e7dc39299c1..00000000000
--- a/radarhttpasehttpmethod_test.go
+++ /dev/null
@@ -1,59 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
- "time"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRadarHTTPAseHTTPMethodGetWithOptionalParams(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"),
- )
- _, err := client.Radar.HTTP.Ases.HTTPMethod.Get(
- context.TODO(),
- cloudflare.RadarHTTPAseHTTPMethodGetParamsHTTPVersionHttPv1,
- 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()}),
- DeviceType: cloudflare.F([]cloudflare.RadarHTTPAseHTTPMethodGetParamsDeviceType{cloudflare.RadarHTTPAseHTTPMethodGetParamsDeviceTypeDesktop, cloudflare.RadarHTTPAseHTTPMethodGetParamsDeviceTypeMobile, cloudflare.RadarHTTPAseHTTPMethodGetParamsDeviceTypeOther}),
- Format: cloudflare.F(cloudflare.RadarHTTPAseHTTPMethodGetParamsFormatJson),
- HTTPProtocol: cloudflare.F([]cloudflare.RadarHTTPAseHTTPMethodGetParamsHTTPProtocol{cloudflare.RadarHTTPAseHTTPMethodGetParamsHTTPProtocolHTTP, cloudflare.RadarHTTPAseHTTPMethodGetParamsHTTPProtocolHTTPS}),
- IPVersion: cloudflare.F([]cloudflare.RadarHTTPAseHTTPMethodGetParamsIPVersion{cloudflare.RadarHTTPAseHTTPMethodGetParamsIPVersionIPv4, cloudflare.RadarHTTPAseHTTPMethodGetParamsIPVersionIPv6}),
- Limit: cloudflare.F(int64(5)),
- Location: cloudflare.F([]string{"string", "string", "string"}),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- OS: cloudflare.F([]cloudflare.RadarHTTPAseHTTPMethodGetParamsOS{cloudflare.RadarHTTPAseHTTPMethodGetParamsOSWindows, cloudflare.RadarHTTPAseHTTPMethodGetParamsOSMacosx, cloudflare.RadarHTTPAseHTTPMethodGetParamsOSIos}),
- TLSVersion: cloudflare.F([]cloudflare.RadarHTTPAseHTTPMethodGetParamsTLSVersion{cloudflare.RadarHTTPAseHTTPMethodGetParamsTLSVersionTlSv1_0, cloudflare.RadarHTTPAseHTTPMethodGetParamsTLSVersionTlSv1_1, cloudflare.RadarHTTPAseHTTPMethodGetParamsTLSVersionTlSv1_2}),
- },
- )
- 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/radarhttpasehttpprotocol.go b/radarhttpasehttpprotocol.go
deleted file mode 100644
index 074857b218f..00000000000
--- a/radarhttpasehttpprotocol.go
+++ /dev/null
@@ -1,356 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarHTTPAseHTTPProtocolService contains methods and other services that help
-// with interacting with the cloudflare API. Note, unlike clients, this service
-// does not read variables from the environment automatically. You should not
-// instantiate this service directly, and instead use the
-// [NewRadarHTTPAseHTTPProtocolService] method instead.
-type RadarHTTPAseHTTPProtocolService struct {
- Options []option.RequestOption
-}
-
-// NewRadarHTTPAseHTTPProtocolService generates a new service that applies the
-// given options to each request. These options are applied after the parent
-// client's options (if there is one), and before any request-specific options.
-func NewRadarHTTPAseHTTPProtocolService(opts ...option.RequestOption) (r *RadarHTTPAseHTTPProtocolService) {
- r = &RadarHTTPAseHTTPProtocolService{}
- r.Options = opts
- return
-}
-
-// Get the top autonomous systems (AS), by HTTP traffic, of the requested HTTP
-// protocol. Values are a percentage out of the total traffic.
-func (r *RadarHTTPAseHTTPProtocolService) Get(ctx context.Context, httpProtocol RadarHTTPAseHTTPProtocolGetParamsHTTPProtocol, query RadarHTTPAseHTTPProtocolGetParams, opts ...option.RequestOption) (res *RadarHTTPAseHTTPProtocolGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarHTTPAseHTTPProtocolGetResponseEnvelope
- path := fmt.Sprintf("radar/http/top/ases/http_protocol/%v", httpProtocol)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type RadarHTTPAseHTTPProtocolGetResponse struct {
- Meta RadarHTTPAseHTTPProtocolGetResponseMeta `json:"meta,required"`
- Top0 []RadarHTTPAseHTTPProtocolGetResponseTop0 `json:"top_0,required"`
- JSON radarHTTPAseHTTPProtocolGetResponseJSON `json:"-"`
-}
-
-// radarHTTPAseHTTPProtocolGetResponseJSON contains the JSON metadata for the
-// struct [RadarHTTPAseHTTPProtocolGetResponse]
-type radarHTTPAseHTTPProtocolGetResponseJSON struct {
- Meta apijson.Field
- Top0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPAseHTTPProtocolGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPAseHTTPProtocolGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPAseHTTPProtocolGetResponseMeta struct {
- DateRange []RadarHTTPAseHTTPProtocolGetResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- ConfidenceInfo RadarHTTPAseHTTPProtocolGetResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarHTTPAseHTTPProtocolGetResponseMetaJSON `json:"-"`
-}
-
-// radarHTTPAseHTTPProtocolGetResponseMetaJSON contains the JSON metadata for the
-// struct [RadarHTTPAseHTTPProtocolGetResponseMeta]
-type radarHTTPAseHTTPProtocolGetResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPAseHTTPProtocolGetResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPAseHTTPProtocolGetResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPAseHTTPProtocolGetResponseMetaDateRange 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 radarHTTPAseHTTPProtocolGetResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarHTTPAseHTTPProtocolGetResponseMetaDateRangeJSON contains the JSON metadata
-// for the struct [RadarHTTPAseHTTPProtocolGetResponseMetaDateRange]
-type radarHTTPAseHTTPProtocolGetResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPAseHTTPProtocolGetResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPAseHTTPProtocolGetResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPAseHTTPProtocolGetResponseMetaConfidenceInfo struct {
- Annotations []RadarHTTPAseHTTPProtocolGetResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarHTTPAseHTTPProtocolGetResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarHTTPAseHTTPProtocolGetResponseMetaConfidenceInfoJSON contains the JSON
-// metadata for the struct [RadarHTTPAseHTTPProtocolGetResponseMetaConfidenceInfo]
-type radarHTTPAseHTTPProtocolGetResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPAseHTTPProtocolGetResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPAseHTTPProtocolGetResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPAseHTTPProtocolGetResponseMetaConfidenceInfoAnnotation 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 radarHTTPAseHTTPProtocolGetResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarHTTPAseHTTPProtocolGetResponseMetaConfidenceInfoAnnotationJSON contains the
-// JSON metadata for the struct
-// [RadarHTTPAseHTTPProtocolGetResponseMetaConfidenceInfoAnnotation]
-type radarHTTPAseHTTPProtocolGetResponseMetaConfidenceInfoAnnotationJSON 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 *RadarHTTPAseHTTPProtocolGetResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPAseHTTPProtocolGetResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPAseHTTPProtocolGetResponseTop0 struct {
- ClientASN int64 `json:"clientASN,required"`
- ClientAsName string `json:"clientASName,required"`
- Value string `json:"value,required"`
- JSON radarHTTPAseHTTPProtocolGetResponseTop0JSON `json:"-"`
-}
-
-// radarHTTPAseHTTPProtocolGetResponseTop0JSON contains the JSON metadata for the
-// struct [RadarHTTPAseHTTPProtocolGetResponseTop0]
-type radarHTTPAseHTTPProtocolGetResponseTop0JSON struct {
- ClientASN apijson.Field
- ClientAsName apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPAseHTTPProtocolGetResponseTop0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPAseHTTPProtocolGetResponseTop0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPAseHTTPProtocolGetParams 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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarHTTPAseHTTPProtocolGetParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Filter for device type.
- DeviceType param.Field[[]RadarHTTPAseHTTPProtocolGetParamsDeviceType] `query:"deviceType"`
- // Format results are returned in.
- Format param.Field[RadarHTTPAseHTTPProtocolGetParamsFormat] `query:"format"`
- // Filter for ip version.
- IPVersion param.Field[[]RadarHTTPAseHTTPProtocolGetParamsIPVersion] `query:"ipVersion"`
- // 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 os name.
- OS param.Field[[]RadarHTTPAseHTTPProtocolGetParamsOS] `query:"os"`
- // Filter for tls version.
- TLSVersion param.Field[[]RadarHTTPAseHTTPProtocolGetParamsTLSVersion] `query:"tlsVersion"`
-}
-
-// URLQuery serializes [RadarHTTPAseHTTPProtocolGetParams]'s query parameters as
-// `url.Values`.
-func (r RadarHTTPAseHTTPProtocolGetParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// HTTP Protocol.
-type RadarHTTPAseHTTPProtocolGetParamsHTTPProtocol string
-
-const (
- RadarHTTPAseHTTPProtocolGetParamsHTTPProtocolHTTP RadarHTTPAseHTTPProtocolGetParamsHTTPProtocol = "HTTP"
- RadarHTTPAseHTTPProtocolGetParamsHTTPProtocolHTTPS RadarHTTPAseHTTPProtocolGetParamsHTTPProtocol = "HTTPS"
-)
-
-type RadarHTTPAseHTTPProtocolGetParamsBotClass string
-
-const (
- RadarHTTPAseHTTPProtocolGetParamsBotClassLikelyAutomated RadarHTTPAseHTTPProtocolGetParamsBotClass = "LIKELY_AUTOMATED"
- RadarHTTPAseHTTPProtocolGetParamsBotClassLikelyHuman RadarHTTPAseHTTPProtocolGetParamsBotClass = "LIKELY_HUMAN"
-)
-
-type RadarHTTPAseHTTPProtocolGetParamsDateRange string
-
-const (
- RadarHTTPAseHTTPProtocolGetParamsDateRange1d RadarHTTPAseHTTPProtocolGetParamsDateRange = "1d"
- RadarHTTPAseHTTPProtocolGetParamsDateRange2d RadarHTTPAseHTTPProtocolGetParamsDateRange = "2d"
- RadarHTTPAseHTTPProtocolGetParamsDateRange7d RadarHTTPAseHTTPProtocolGetParamsDateRange = "7d"
- RadarHTTPAseHTTPProtocolGetParamsDateRange14d RadarHTTPAseHTTPProtocolGetParamsDateRange = "14d"
- RadarHTTPAseHTTPProtocolGetParamsDateRange28d RadarHTTPAseHTTPProtocolGetParamsDateRange = "28d"
- RadarHTTPAseHTTPProtocolGetParamsDateRange12w RadarHTTPAseHTTPProtocolGetParamsDateRange = "12w"
- RadarHTTPAseHTTPProtocolGetParamsDateRange24w RadarHTTPAseHTTPProtocolGetParamsDateRange = "24w"
- RadarHTTPAseHTTPProtocolGetParamsDateRange52w RadarHTTPAseHTTPProtocolGetParamsDateRange = "52w"
- RadarHTTPAseHTTPProtocolGetParamsDateRange1dControl RadarHTTPAseHTTPProtocolGetParamsDateRange = "1dControl"
- RadarHTTPAseHTTPProtocolGetParamsDateRange2dControl RadarHTTPAseHTTPProtocolGetParamsDateRange = "2dControl"
- RadarHTTPAseHTTPProtocolGetParamsDateRange7dControl RadarHTTPAseHTTPProtocolGetParamsDateRange = "7dControl"
- RadarHTTPAseHTTPProtocolGetParamsDateRange14dControl RadarHTTPAseHTTPProtocolGetParamsDateRange = "14dControl"
- RadarHTTPAseHTTPProtocolGetParamsDateRange28dControl RadarHTTPAseHTTPProtocolGetParamsDateRange = "28dControl"
- RadarHTTPAseHTTPProtocolGetParamsDateRange12wControl RadarHTTPAseHTTPProtocolGetParamsDateRange = "12wControl"
- RadarHTTPAseHTTPProtocolGetParamsDateRange24wControl RadarHTTPAseHTTPProtocolGetParamsDateRange = "24wControl"
-)
-
-type RadarHTTPAseHTTPProtocolGetParamsDeviceType string
-
-const (
- RadarHTTPAseHTTPProtocolGetParamsDeviceTypeDesktop RadarHTTPAseHTTPProtocolGetParamsDeviceType = "DESKTOP"
- RadarHTTPAseHTTPProtocolGetParamsDeviceTypeMobile RadarHTTPAseHTTPProtocolGetParamsDeviceType = "MOBILE"
- RadarHTTPAseHTTPProtocolGetParamsDeviceTypeOther RadarHTTPAseHTTPProtocolGetParamsDeviceType = "OTHER"
-)
-
-// Format results are returned in.
-type RadarHTTPAseHTTPProtocolGetParamsFormat string
-
-const (
- RadarHTTPAseHTTPProtocolGetParamsFormatJson RadarHTTPAseHTTPProtocolGetParamsFormat = "JSON"
- RadarHTTPAseHTTPProtocolGetParamsFormatCsv RadarHTTPAseHTTPProtocolGetParamsFormat = "CSV"
-)
-
-type RadarHTTPAseHTTPProtocolGetParamsIPVersion string
-
-const (
- RadarHTTPAseHTTPProtocolGetParamsIPVersionIPv4 RadarHTTPAseHTTPProtocolGetParamsIPVersion = "IPv4"
- RadarHTTPAseHTTPProtocolGetParamsIPVersionIPv6 RadarHTTPAseHTTPProtocolGetParamsIPVersion = "IPv6"
-)
-
-type RadarHTTPAseHTTPProtocolGetParamsOS string
-
-const (
- RadarHTTPAseHTTPProtocolGetParamsOSWindows RadarHTTPAseHTTPProtocolGetParamsOS = "WINDOWS"
- RadarHTTPAseHTTPProtocolGetParamsOSMacosx RadarHTTPAseHTTPProtocolGetParamsOS = "MACOSX"
- RadarHTTPAseHTTPProtocolGetParamsOSIos RadarHTTPAseHTTPProtocolGetParamsOS = "IOS"
- RadarHTTPAseHTTPProtocolGetParamsOSAndroid RadarHTTPAseHTTPProtocolGetParamsOS = "ANDROID"
- RadarHTTPAseHTTPProtocolGetParamsOSChromeos RadarHTTPAseHTTPProtocolGetParamsOS = "CHROMEOS"
- RadarHTTPAseHTTPProtocolGetParamsOSLinux RadarHTTPAseHTTPProtocolGetParamsOS = "LINUX"
- RadarHTTPAseHTTPProtocolGetParamsOSSmartTv RadarHTTPAseHTTPProtocolGetParamsOS = "SMART_TV"
-)
-
-type RadarHTTPAseHTTPProtocolGetParamsTLSVersion string
-
-const (
- RadarHTTPAseHTTPProtocolGetParamsTLSVersionTlSv1_0 RadarHTTPAseHTTPProtocolGetParamsTLSVersion = "TLSv1_0"
- RadarHTTPAseHTTPProtocolGetParamsTLSVersionTlSv1_1 RadarHTTPAseHTTPProtocolGetParamsTLSVersion = "TLSv1_1"
- RadarHTTPAseHTTPProtocolGetParamsTLSVersionTlSv1_2 RadarHTTPAseHTTPProtocolGetParamsTLSVersion = "TLSv1_2"
- RadarHTTPAseHTTPProtocolGetParamsTLSVersionTlSv1_3 RadarHTTPAseHTTPProtocolGetParamsTLSVersion = "TLSv1_3"
- RadarHTTPAseHTTPProtocolGetParamsTLSVersionTlSvQuic RadarHTTPAseHTTPProtocolGetParamsTLSVersion = "TLSvQUIC"
-)
-
-type RadarHTTPAseHTTPProtocolGetResponseEnvelope struct {
- Result RadarHTTPAseHTTPProtocolGetResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarHTTPAseHTTPProtocolGetResponseEnvelopeJSON `json:"-"`
-}
-
-// radarHTTPAseHTTPProtocolGetResponseEnvelopeJSON contains the JSON metadata for
-// the struct [RadarHTTPAseHTTPProtocolGetResponseEnvelope]
-type radarHTTPAseHTTPProtocolGetResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPAseHTTPProtocolGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPAseHTTPProtocolGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
diff --git a/radarhttpasehttpprotocol_test.go b/radarhttpasehttpprotocol_test.go
deleted file mode 100644
index 2e2d0478b9e..00000000000
--- a/radarhttpasehttpprotocol_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-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRadarHTTPAseHTTPProtocolGetWithOptionalParams(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"),
- )
- _, err := client.Radar.HTTP.Ases.HTTPProtocol.Get(
- context.TODO(),
- cloudflare.RadarHTTPAseHTTPProtocolGetParamsHTTPProtocolHTTP,
- 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()}),
- DeviceType: cloudflare.F([]cloudflare.RadarHTTPAseHTTPProtocolGetParamsDeviceType{cloudflare.RadarHTTPAseHTTPProtocolGetParamsDeviceTypeDesktop, cloudflare.RadarHTTPAseHTTPProtocolGetParamsDeviceTypeMobile, cloudflare.RadarHTTPAseHTTPProtocolGetParamsDeviceTypeOther}),
- Format: cloudflare.F(cloudflare.RadarHTTPAseHTTPProtocolGetParamsFormatJson),
- IPVersion: cloudflare.F([]cloudflare.RadarHTTPAseHTTPProtocolGetParamsIPVersion{cloudflare.RadarHTTPAseHTTPProtocolGetParamsIPVersionIPv4, cloudflare.RadarHTTPAseHTTPProtocolGetParamsIPVersionIPv6}),
- Limit: cloudflare.F(int64(5)),
- Location: cloudflare.F([]string{"string", "string", "string"}),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- OS: cloudflare.F([]cloudflare.RadarHTTPAseHTTPProtocolGetParamsOS{cloudflare.RadarHTTPAseHTTPProtocolGetParamsOSWindows, cloudflare.RadarHTTPAseHTTPProtocolGetParamsOSMacosx, cloudflare.RadarHTTPAseHTTPProtocolGetParamsOSIos}),
- TLSVersion: cloudflare.F([]cloudflare.RadarHTTPAseHTTPProtocolGetParamsTLSVersion{cloudflare.RadarHTTPAseHTTPProtocolGetParamsTLSVersionTlSv1_0, cloudflare.RadarHTTPAseHTTPProtocolGetParamsTLSVersionTlSv1_1, cloudflare.RadarHTTPAseHTTPProtocolGetParamsTLSVersionTlSv1_2}),
- },
- )
- 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/radarhttpaseipversion.go b/radarhttpaseipversion.go
deleted file mode 100644
index 4efc1e99de3..00000000000
--- a/radarhttpaseipversion.go
+++ /dev/null
@@ -1,366 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarHTTPAseIPVersionService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewRadarHTTPAseIPVersionService]
-// method instead.
-type RadarHTTPAseIPVersionService struct {
- Options []option.RequestOption
-}
-
-// NewRadarHTTPAseIPVersionService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewRadarHTTPAseIPVersionService(opts ...option.RequestOption) (r *RadarHTTPAseIPVersionService) {
- r = &RadarHTTPAseIPVersionService{}
- r.Options = opts
- return
-}
-
-// Get the top autonomous systems, by HTTP traffic, of the requested IP protocol
-// version. Values are a percentage out of the total traffic.
-func (r *RadarHTTPAseIPVersionService) Get(ctx context.Context, ipVersion RadarHTTPAseIPVersionGetParamsIPVersion, query RadarHTTPAseIPVersionGetParams, opts ...option.RequestOption) (res *RadarHTTPAseIPVersionGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarHTTPAseIPVersionGetResponseEnvelope
- path := fmt.Sprintf("radar/http/top/ases/ip_version/%v", ipVersion)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type RadarHTTPAseIPVersionGetResponse struct {
- Meta RadarHTTPAseIPVersionGetResponseMeta `json:"meta,required"`
- Top0 []RadarHTTPAseIPVersionGetResponseTop0 `json:"top_0,required"`
- JSON radarHTTPAseIPVersionGetResponseJSON `json:"-"`
-}
-
-// radarHTTPAseIPVersionGetResponseJSON contains the JSON metadata for the struct
-// [RadarHTTPAseIPVersionGetResponse]
-type radarHTTPAseIPVersionGetResponseJSON struct {
- Meta apijson.Field
- Top0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPAseIPVersionGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPAseIPVersionGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPAseIPVersionGetResponseMeta struct {
- DateRange []RadarHTTPAseIPVersionGetResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- ConfidenceInfo RadarHTTPAseIPVersionGetResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarHTTPAseIPVersionGetResponseMetaJSON `json:"-"`
-}
-
-// radarHTTPAseIPVersionGetResponseMetaJSON contains the JSON metadata for the
-// struct [RadarHTTPAseIPVersionGetResponseMeta]
-type radarHTTPAseIPVersionGetResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPAseIPVersionGetResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPAseIPVersionGetResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPAseIPVersionGetResponseMetaDateRange 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 radarHTTPAseIPVersionGetResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarHTTPAseIPVersionGetResponseMetaDateRangeJSON contains the JSON metadata for
-// the struct [RadarHTTPAseIPVersionGetResponseMetaDateRange]
-type radarHTTPAseIPVersionGetResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPAseIPVersionGetResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPAseIPVersionGetResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPAseIPVersionGetResponseMetaConfidenceInfo struct {
- Annotations []RadarHTTPAseIPVersionGetResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarHTTPAseIPVersionGetResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarHTTPAseIPVersionGetResponseMetaConfidenceInfoJSON contains the JSON
-// metadata for the struct [RadarHTTPAseIPVersionGetResponseMetaConfidenceInfo]
-type radarHTTPAseIPVersionGetResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPAseIPVersionGetResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPAseIPVersionGetResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPAseIPVersionGetResponseMetaConfidenceInfoAnnotation 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 radarHTTPAseIPVersionGetResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarHTTPAseIPVersionGetResponseMetaConfidenceInfoAnnotationJSON contains the
-// JSON metadata for the struct
-// [RadarHTTPAseIPVersionGetResponseMetaConfidenceInfoAnnotation]
-type radarHTTPAseIPVersionGetResponseMetaConfidenceInfoAnnotationJSON 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 *RadarHTTPAseIPVersionGetResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPAseIPVersionGetResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPAseIPVersionGetResponseTop0 struct {
- ClientASN int64 `json:"clientASN,required"`
- ClientAsName string `json:"clientASName,required"`
- Value string `json:"value,required"`
- JSON radarHTTPAseIPVersionGetResponseTop0JSON `json:"-"`
-}
-
-// radarHTTPAseIPVersionGetResponseTop0JSON contains the JSON metadata for the
-// struct [RadarHTTPAseIPVersionGetResponseTop0]
-type radarHTTPAseIPVersionGetResponseTop0JSON struct {
- ClientASN apijson.Field
- ClientAsName apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPAseIPVersionGetResponseTop0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPAseIPVersionGetResponseTop0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPAseIPVersionGetParams 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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarHTTPAseIPVersionGetParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Filter for device type.
- DeviceType param.Field[[]RadarHTTPAseIPVersionGetParamsDeviceType] `query:"deviceType"`
- // Format results are returned in.
- Format param.Field[RadarHTTPAseIPVersionGetParamsFormat] `query:"format"`
- // Filter for http protocol.
- HTTPProtocol param.Field[[]RadarHTTPAseIPVersionGetParamsHTTPProtocol] `query:"httpProtocol"`
- // Filter for http version.
- HTTPVersion param.Field[[]RadarHTTPAseIPVersionGetParamsHTTPVersion] `query:"httpVersion"`
- // 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 os name.
- OS param.Field[[]RadarHTTPAseIPVersionGetParamsOS] `query:"os"`
- // Filter for tls version.
- TLSVersion param.Field[[]RadarHTTPAseIPVersionGetParamsTLSVersion] `query:"tlsVersion"`
-}
-
-// URLQuery serializes [RadarHTTPAseIPVersionGetParams]'s query parameters as
-// `url.Values`.
-func (r RadarHTTPAseIPVersionGetParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// IP version.
-type RadarHTTPAseIPVersionGetParamsIPVersion string
-
-const (
- RadarHTTPAseIPVersionGetParamsIPVersionIPv4 RadarHTTPAseIPVersionGetParamsIPVersion = "IPv4"
- RadarHTTPAseIPVersionGetParamsIPVersionIPv6 RadarHTTPAseIPVersionGetParamsIPVersion = "IPv6"
-)
-
-type RadarHTTPAseIPVersionGetParamsBotClass string
-
-const (
- RadarHTTPAseIPVersionGetParamsBotClassLikelyAutomated RadarHTTPAseIPVersionGetParamsBotClass = "LIKELY_AUTOMATED"
- RadarHTTPAseIPVersionGetParamsBotClassLikelyHuman RadarHTTPAseIPVersionGetParamsBotClass = "LIKELY_HUMAN"
-)
-
-type RadarHTTPAseIPVersionGetParamsDateRange string
-
-const (
- RadarHTTPAseIPVersionGetParamsDateRange1d RadarHTTPAseIPVersionGetParamsDateRange = "1d"
- RadarHTTPAseIPVersionGetParamsDateRange2d RadarHTTPAseIPVersionGetParamsDateRange = "2d"
- RadarHTTPAseIPVersionGetParamsDateRange7d RadarHTTPAseIPVersionGetParamsDateRange = "7d"
- RadarHTTPAseIPVersionGetParamsDateRange14d RadarHTTPAseIPVersionGetParamsDateRange = "14d"
- RadarHTTPAseIPVersionGetParamsDateRange28d RadarHTTPAseIPVersionGetParamsDateRange = "28d"
- RadarHTTPAseIPVersionGetParamsDateRange12w RadarHTTPAseIPVersionGetParamsDateRange = "12w"
- RadarHTTPAseIPVersionGetParamsDateRange24w RadarHTTPAseIPVersionGetParamsDateRange = "24w"
- RadarHTTPAseIPVersionGetParamsDateRange52w RadarHTTPAseIPVersionGetParamsDateRange = "52w"
- RadarHTTPAseIPVersionGetParamsDateRange1dControl RadarHTTPAseIPVersionGetParamsDateRange = "1dControl"
- RadarHTTPAseIPVersionGetParamsDateRange2dControl RadarHTTPAseIPVersionGetParamsDateRange = "2dControl"
- RadarHTTPAseIPVersionGetParamsDateRange7dControl RadarHTTPAseIPVersionGetParamsDateRange = "7dControl"
- RadarHTTPAseIPVersionGetParamsDateRange14dControl RadarHTTPAseIPVersionGetParamsDateRange = "14dControl"
- RadarHTTPAseIPVersionGetParamsDateRange28dControl RadarHTTPAseIPVersionGetParamsDateRange = "28dControl"
- RadarHTTPAseIPVersionGetParamsDateRange12wControl RadarHTTPAseIPVersionGetParamsDateRange = "12wControl"
- RadarHTTPAseIPVersionGetParamsDateRange24wControl RadarHTTPAseIPVersionGetParamsDateRange = "24wControl"
-)
-
-type RadarHTTPAseIPVersionGetParamsDeviceType string
-
-const (
- RadarHTTPAseIPVersionGetParamsDeviceTypeDesktop RadarHTTPAseIPVersionGetParamsDeviceType = "DESKTOP"
- RadarHTTPAseIPVersionGetParamsDeviceTypeMobile RadarHTTPAseIPVersionGetParamsDeviceType = "MOBILE"
- RadarHTTPAseIPVersionGetParamsDeviceTypeOther RadarHTTPAseIPVersionGetParamsDeviceType = "OTHER"
-)
-
-// Format results are returned in.
-type RadarHTTPAseIPVersionGetParamsFormat string
-
-const (
- RadarHTTPAseIPVersionGetParamsFormatJson RadarHTTPAseIPVersionGetParamsFormat = "JSON"
- RadarHTTPAseIPVersionGetParamsFormatCsv RadarHTTPAseIPVersionGetParamsFormat = "CSV"
-)
-
-type RadarHTTPAseIPVersionGetParamsHTTPProtocol string
-
-const (
- RadarHTTPAseIPVersionGetParamsHTTPProtocolHTTP RadarHTTPAseIPVersionGetParamsHTTPProtocol = "HTTP"
- RadarHTTPAseIPVersionGetParamsHTTPProtocolHTTPS RadarHTTPAseIPVersionGetParamsHTTPProtocol = "HTTPS"
-)
-
-type RadarHTTPAseIPVersionGetParamsHTTPVersion string
-
-const (
- RadarHTTPAseIPVersionGetParamsHTTPVersionHttPv1 RadarHTTPAseIPVersionGetParamsHTTPVersion = "HTTPv1"
- RadarHTTPAseIPVersionGetParamsHTTPVersionHttPv2 RadarHTTPAseIPVersionGetParamsHTTPVersion = "HTTPv2"
- RadarHTTPAseIPVersionGetParamsHTTPVersionHttPv3 RadarHTTPAseIPVersionGetParamsHTTPVersion = "HTTPv3"
-)
-
-type RadarHTTPAseIPVersionGetParamsOS string
-
-const (
- RadarHTTPAseIPVersionGetParamsOSWindows RadarHTTPAseIPVersionGetParamsOS = "WINDOWS"
- RadarHTTPAseIPVersionGetParamsOSMacosx RadarHTTPAseIPVersionGetParamsOS = "MACOSX"
- RadarHTTPAseIPVersionGetParamsOSIos RadarHTTPAseIPVersionGetParamsOS = "IOS"
- RadarHTTPAseIPVersionGetParamsOSAndroid RadarHTTPAseIPVersionGetParamsOS = "ANDROID"
- RadarHTTPAseIPVersionGetParamsOSChromeos RadarHTTPAseIPVersionGetParamsOS = "CHROMEOS"
- RadarHTTPAseIPVersionGetParamsOSLinux RadarHTTPAseIPVersionGetParamsOS = "LINUX"
- RadarHTTPAseIPVersionGetParamsOSSmartTv RadarHTTPAseIPVersionGetParamsOS = "SMART_TV"
-)
-
-type RadarHTTPAseIPVersionGetParamsTLSVersion string
-
-const (
- RadarHTTPAseIPVersionGetParamsTLSVersionTlSv1_0 RadarHTTPAseIPVersionGetParamsTLSVersion = "TLSv1_0"
- RadarHTTPAseIPVersionGetParamsTLSVersionTlSv1_1 RadarHTTPAseIPVersionGetParamsTLSVersion = "TLSv1_1"
- RadarHTTPAseIPVersionGetParamsTLSVersionTlSv1_2 RadarHTTPAseIPVersionGetParamsTLSVersion = "TLSv1_2"
- RadarHTTPAseIPVersionGetParamsTLSVersionTlSv1_3 RadarHTTPAseIPVersionGetParamsTLSVersion = "TLSv1_3"
- RadarHTTPAseIPVersionGetParamsTLSVersionTlSvQuic RadarHTTPAseIPVersionGetParamsTLSVersion = "TLSvQUIC"
-)
-
-type RadarHTTPAseIPVersionGetResponseEnvelope struct {
- Result RadarHTTPAseIPVersionGetResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarHTTPAseIPVersionGetResponseEnvelopeJSON `json:"-"`
-}
-
-// radarHTTPAseIPVersionGetResponseEnvelopeJSON contains the JSON metadata for the
-// struct [RadarHTTPAseIPVersionGetResponseEnvelope]
-type radarHTTPAseIPVersionGetResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPAseIPVersionGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPAseIPVersionGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
diff --git a/radarhttpaseipversion_test.go b/radarhttpaseipversion_test.go
deleted file mode 100644
index 98c2e9bb3a7..00000000000
--- a/radarhttpaseipversion_test.go
+++ /dev/null
@@ -1,59 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
- "time"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRadarHTTPAseIPVersionGetWithOptionalParams(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"),
- )
- _, err := client.Radar.HTTP.Ases.IPVersion.Get(
- context.TODO(),
- cloudflare.RadarHTTPAseIPVersionGetParamsIPVersionIPv4,
- 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()}),
- DeviceType: cloudflare.F([]cloudflare.RadarHTTPAseIPVersionGetParamsDeviceType{cloudflare.RadarHTTPAseIPVersionGetParamsDeviceTypeDesktop, cloudflare.RadarHTTPAseIPVersionGetParamsDeviceTypeMobile, cloudflare.RadarHTTPAseIPVersionGetParamsDeviceTypeOther}),
- Format: cloudflare.F(cloudflare.RadarHTTPAseIPVersionGetParamsFormatJson),
- HTTPProtocol: cloudflare.F([]cloudflare.RadarHTTPAseIPVersionGetParamsHTTPProtocol{cloudflare.RadarHTTPAseIPVersionGetParamsHTTPProtocolHTTP, cloudflare.RadarHTTPAseIPVersionGetParamsHTTPProtocolHTTPS}),
- HTTPVersion: cloudflare.F([]cloudflare.RadarHTTPAseIPVersionGetParamsHTTPVersion{cloudflare.RadarHTTPAseIPVersionGetParamsHTTPVersionHttPv1, cloudflare.RadarHTTPAseIPVersionGetParamsHTTPVersionHttPv2, cloudflare.RadarHTTPAseIPVersionGetParamsHTTPVersionHttPv3}),
- Limit: cloudflare.F(int64(5)),
- Location: cloudflare.F([]string{"string", "string", "string"}),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- OS: cloudflare.F([]cloudflare.RadarHTTPAseIPVersionGetParamsOS{cloudflare.RadarHTTPAseIPVersionGetParamsOSWindows, cloudflare.RadarHTTPAseIPVersionGetParamsOSMacosx, cloudflare.RadarHTTPAseIPVersionGetParamsOSIos}),
- TLSVersion: cloudflare.F([]cloudflare.RadarHTTPAseIPVersionGetParamsTLSVersion{cloudflare.RadarHTTPAseIPVersionGetParamsTLSVersionTlSv1_0, cloudflare.RadarHTTPAseIPVersionGetParamsTLSVersionTlSv1_1, cloudflare.RadarHTTPAseIPVersionGetParamsTLSVersionTlSv1_2}),
- },
- )
- 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/radarhttpaseos.go b/radarhttpaseos.go
deleted file mode 100644
index 8a49d823204..00000000000
--- a/radarhttpaseos.go
+++ /dev/null
@@ -1,365 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarHTTPAseOSService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewRadarHTTPAseOSService] method
-// instead.
-type RadarHTTPAseOSService struct {
- Options []option.RequestOption
-}
-
-// NewRadarHTTPAseOSService generates a new service that applies the given options
-// to each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewRadarHTTPAseOSService(opts ...option.RequestOption) (r *RadarHTTPAseOSService) {
- r = &RadarHTTPAseOSService{}
- r.Options = opts
- return
-}
-
-// Get the top autonomous systems, by HTTP traffic, of the requested operating
-// systems. Values are a percentage out of the total traffic.
-func (r *RadarHTTPAseOSService) Get(ctx context.Context, os RadarHTTPAseOSGetParamsOS, query RadarHTTPAseOSGetParams, opts ...option.RequestOption) (res *RadarHTTPAseOSGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarHTTPAseOSGetResponseEnvelope
- path := fmt.Sprintf("radar/http/top/ases/os/%v", os)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type RadarHTTPAseOSGetResponse struct {
- Meta RadarHTTPAseOSGetResponseMeta `json:"meta,required"`
- Top0 []RadarHTTPAseOSGetResponseTop0 `json:"top_0,required"`
- JSON radarHTTPAseOSGetResponseJSON `json:"-"`
-}
-
-// radarHTTPAseOSGetResponseJSON contains the JSON metadata for the struct
-// [RadarHTTPAseOSGetResponse]
-type radarHTTPAseOSGetResponseJSON struct {
- Meta apijson.Field
- Top0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPAseOSGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPAseOSGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPAseOSGetResponseMeta struct {
- DateRange []RadarHTTPAseOSGetResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- ConfidenceInfo RadarHTTPAseOSGetResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarHTTPAseOSGetResponseMetaJSON `json:"-"`
-}
-
-// radarHTTPAseOSGetResponseMetaJSON contains the JSON metadata for the struct
-// [RadarHTTPAseOSGetResponseMeta]
-type radarHTTPAseOSGetResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPAseOSGetResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPAseOSGetResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPAseOSGetResponseMetaDateRange 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 radarHTTPAseOSGetResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarHTTPAseOSGetResponseMetaDateRangeJSON contains the JSON metadata for the
-// struct [RadarHTTPAseOSGetResponseMetaDateRange]
-type radarHTTPAseOSGetResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPAseOSGetResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPAseOSGetResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPAseOSGetResponseMetaConfidenceInfo struct {
- Annotations []RadarHTTPAseOSGetResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarHTTPAseOSGetResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarHTTPAseOSGetResponseMetaConfidenceInfoJSON contains the JSON metadata for
-// the struct [RadarHTTPAseOSGetResponseMetaConfidenceInfo]
-type radarHTTPAseOSGetResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPAseOSGetResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPAseOSGetResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPAseOSGetResponseMetaConfidenceInfoAnnotation 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 radarHTTPAseOSGetResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarHTTPAseOSGetResponseMetaConfidenceInfoAnnotationJSON contains the JSON
-// metadata for the struct [RadarHTTPAseOSGetResponseMetaConfidenceInfoAnnotation]
-type radarHTTPAseOSGetResponseMetaConfidenceInfoAnnotationJSON 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 *RadarHTTPAseOSGetResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPAseOSGetResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPAseOSGetResponseTop0 struct {
- ClientASN int64 `json:"clientASN,required"`
- ClientAsName string `json:"clientASName,required"`
- Value string `json:"value,required"`
- JSON radarHTTPAseOSGetResponseTop0JSON `json:"-"`
-}
-
-// radarHTTPAseOSGetResponseTop0JSON contains the JSON metadata for the struct
-// [RadarHTTPAseOSGetResponseTop0]
-type radarHTTPAseOSGetResponseTop0JSON struct {
- ClientASN apijson.Field
- ClientAsName apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPAseOSGetResponseTop0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPAseOSGetResponseTop0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPAseOSGetParams 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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarHTTPAseOSGetParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Filter for device type.
- DeviceType param.Field[[]RadarHTTPAseOSGetParamsDeviceType] `query:"deviceType"`
- // Format results are returned in.
- Format param.Field[RadarHTTPAseOSGetParamsFormat] `query:"format"`
- // Filter for http protocol.
- HTTPProtocol param.Field[[]RadarHTTPAseOSGetParamsHTTPProtocol] `query:"httpProtocol"`
- // Filter for http version.
- HTTPVersion param.Field[[]RadarHTTPAseOSGetParamsHTTPVersion] `query:"httpVersion"`
- // Filter for ip version.
- IPVersion param.Field[[]RadarHTTPAseOSGetParamsIPVersion] `query:"ipVersion"`
- // 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 tls version.
- TLSVersion param.Field[[]RadarHTTPAseOSGetParamsTLSVersion] `query:"tlsVersion"`
-}
-
-// URLQuery serializes [RadarHTTPAseOSGetParams]'s query parameters as
-// `url.Values`.
-func (r RadarHTTPAseOSGetParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// IP version.
-type RadarHTTPAseOSGetParamsOS string
-
-const (
- RadarHTTPAseOSGetParamsOSWindows RadarHTTPAseOSGetParamsOS = "WINDOWS"
- RadarHTTPAseOSGetParamsOSMacosx RadarHTTPAseOSGetParamsOS = "MACOSX"
- RadarHTTPAseOSGetParamsOSIos RadarHTTPAseOSGetParamsOS = "IOS"
- RadarHTTPAseOSGetParamsOSAndroid RadarHTTPAseOSGetParamsOS = "ANDROID"
- RadarHTTPAseOSGetParamsOSChromeos RadarHTTPAseOSGetParamsOS = "CHROMEOS"
- RadarHTTPAseOSGetParamsOSLinux RadarHTTPAseOSGetParamsOS = "LINUX"
- RadarHTTPAseOSGetParamsOSSmartTv RadarHTTPAseOSGetParamsOS = "SMART_TV"
-)
-
-type RadarHTTPAseOSGetParamsBotClass string
-
-const (
- RadarHTTPAseOSGetParamsBotClassLikelyAutomated RadarHTTPAseOSGetParamsBotClass = "LIKELY_AUTOMATED"
- RadarHTTPAseOSGetParamsBotClassLikelyHuman RadarHTTPAseOSGetParamsBotClass = "LIKELY_HUMAN"
-)
-
-type RadarHTTPAseOSGetParamsDateRange string
-
-const (
- RadarHTTPAseOSGetParamsDateRange1d RadarHTTPAseOSGetParamsDateRange = "1d"
- RadarHTTPAseOSGetParamsDateRange2d RadarHTTPAseOSGetParamsDateRange = "2d"
- RadarHTTPAseOSGetParamsDateRange7d RadarHTTPAseOSGetParamsDateRange = "7d"
- RadarHTTPAseOSGetParamsDateRange14d RadarHTTPAseOSGetParamsDateRange = "14d"
- RadarHTTPAseOSGetParamsDateRange28d RadarHTTPAseOSGetParamsDateRange = "28d"
- RadarHTTPAseOSGetParamsDateRange12w RadarHTTPAseOSGetParamsDateRange = "12w"
- RadarHTTPAseOSGetParamsDateRange24w RadarHTTPAseOSGetParamsDateRange = "24w"
- RadarHTTPAseOSGetParamsDateRange52w RadarHTTPAseOSGetParamsDateRange = "52w"
- RadarHTTPAseOSGetParamsDateRange1dControl RadarHTTPAseOSGetParamsDateRange = "1dControl"
- RadarHTTPAseOSGetParamsDateRange2dControl RadarHTTPAseOSGetParamsDateRange = "2dControl"
- RadarHTTPAseOSGetParamsDateRange7dControl RadarHTTPAseOSGetParamsDateRange = "7dControl"
- RadarHTTPAseOSGetParamsDateRange14dControl RadarHTTPAseOSGetParamsDateRange = "14dControl"
- RadarHTTPAseOSGetParamsDateRange28dControl RadarHTTPAseOSGetParamsDateRange = "28dControl"
- RadarHTTPAseOSGetParamsDateRange12wControl RadarHTTPAseOSGetParamsDateRange = "12wControl"
- RadarHTTPAseOSGetParamsDateRange24wControl RadarHTTPAseOSGetParamsDateRange = "24wControl"
-)
-
-type RadarHTTPAseOSGetParamsDeviceType string
-
-const (
- RadarHTTPAseOSGetParamsDeviceTypeDesktop RadarHTTPAseOSGetParamsDeviceType = "DESKTOP"
- RadarHTTPAseOSGetParamsDeviceTypeMobile RadarHTTPAseOSGetParamsDeviceType = "MOBILE"
- RadarHTTPAseOSGetParamsDeviceTypeOther RadarHTTPAseOSGetParamsDeviceType = "OTHER"
-)
-
-// Format results are returned in.
-type RadarHTTPAseOSGetParamsFormat string
-
-const (
- RadarHTTPAseOSGetParamsFormatJson RadarHTTPAseOSGetParamsFormat = "JSON"
- RadarHTTPAseOSGetParamsFormatCsv RadarHTTPAseOSGetParamsFormat = "CSV"
-)
-
-type RadarHTTPAseOSGetParamsHTTPProtocol string
-
-const (
- RadarHTTPAseOSGetParamsHTTPProtocolHTTP RadarHTTPAseOSGetParamsHTTPProtocol = "HTTP"
- RadarHTTPAseOSGetParamsHTTPProtocolHTTPS RadarHTTPAseOSGetParamsHTTPProtocol = "HTTPS"
-)
-
-type RadarHTTPAseOSGetParamsHTTPVersion string
-
-const (
- RadarHTTPAseOSGetParamsHTTPVersionHttPv1 RadarHTTPAseOSGetParamsHTTPVersion = "HTTPv1"
- RadarHTTPAseOSGetParamsHTTPVersionHttPv2 RadarHTTPAseOSGetParamsHTTPVersion = "HTTPv2"
- RadarHTTPAseOSGetParamsHTTPVersionHttPv3 RadarHTTPAseOSGetParamsHTTPVersion = "HTTPv3"
-)
-
-type RadarHTTPAseOSGetParamsIPVersion string
-
-const (
- RadarHTTPAseOSGetParamsIPVersionIPv4 RadarHTTPAseOSGetParamsIPVersion = "IPv4"
- RadarHTTPAseOSGetParamsIPVersionIPv6 RadarHTTPAseOSGetParamsIPVersion = "IPv6"
-)
-
-type RadarHTTPAseOSGetParamsTLSVersion string
-
-const (
- RadarHTTPAseOSGetParamsTLSVersionTlSv1_0 RadarHTTPAseOSGetParamsTLSVersion = "TLSv1_0"
- RadarHTTPAseOSGetParamsTLSVersionTlSv1_1 RadarHTTPAseOSGetParamsTLSVersion = "TLSv1_1"
- RadarHTTPAseOSGetParamsTLSVersionTlSv1_2 RadarHTTPAseOSGetParamsTLSVersion = "TLSv1_2"
- RadarHTTPAseOSGetParamsTLSVersionTlSv1_3 RadarHTTPAseOSGetParamsTLSVersion = "TLSv1_3"
- RadarHTTPAseOSGetParamsTLSVersionTlSvQuic RadarHTTPAseOSGetParamsTLSVersion = "TLSvQUIC"
-)
-
-type RadarHTTPAseOSGetResponseEnvelope struct {
- Result RadarHTTPAseOSGetResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarHTTPAseOSGetResponseEnvelopeJSON `json:"-"`
-}
-
-// radarHTTPAseOSGetResponseEnvelopeJSON contains the JSON metadata for the struct
-// [RadarHTTPAseOSGetResponseEnvelope]
-type radarHTTPAseOSGetResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPAseOSGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPAseOSGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
diff --git a/radarhttpaseos_test.go b/radarhttpaseos_test.go
deleted file mode 100644
index 26bece2de1a..00000000000
--- a/radarhttpaseos_test.go
+++ /dev/null
@@ -1,59 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
- "time"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRadarHTTPAseOSGetWithOptionalParams(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"),
- )
- _, err := client.Radar.HTTP.Ases.OS.Get(
- context.TODO(),
- cloudflare.RadarHTTPAseOSGetParamsOSWindows,
- 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()}),
- DeviceType: cloudflare.F([]cloudflare.RadarHTTPAseOSGetParamsDeviceType{cloudflare.RadarHTTPAseOSGetParamsDeviceTypeDesktop, cloudflare.RadarHTTPAseOSGetParamsDeviceTypeMobile, cloudflare.RadarHTTPAseOSGetParamsDeviceTypeOther}),
- Format: cloudflare.F(cloudflare.RadarHTTPAseOSGetParamsFormatJson),
- HTTPProtocol: cloudflare.F([]cloudflare.RadarHTTPAseOSGetParamsHTTPProtocol{cloudflare.RadarHTTPAseOSGetParamsHTTPProtocolHTTP, cloudflare.RadarHTTPAseOSGetParamsHTTPProtocolHTTPS}),
- HTTPVersion: cloudflare.F([]cloudflare.RadarHTTPAseOSGetParamsHTTPVersion{cloudflare.RadarHTTPAseOSGetParamsHTTPVersionHttPv1, cloudflare.RadarHTTPAseOSGetParamsHTTPVersionHttPv2, cloudflare.RadarHTTPAseOSGetParamsHTTPVersionHttPv3}),
- IPVersion: cloudflare.F([]cloudflare.RadarHTTPAseOSGetParamsIPVersion{cloudflare.RadarHTTPAseOSGetParamsIPVersionIPv4, cloudflare.RadarHTTPAseOSGetParamsIPVersionIPv6}),
- Limit: cloudflare.F(int64(5)),
- Location: cloudflare.F([]string{"string", "string", "string"}),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- TLSVersion: cloudflare.F([]cloudflare.RadarHTTPAseOSGetParamsTLSVersion{cloudflare.RadarHTTPAseOSGetParamsTLSVersionTlSv1_0, cloudflare.RadarHTTPAseOSGetParamsTLSVersionTlSv1_1, cloudflare.RadarHTTPAseOSGetParamsTLSVersionTlSv1_2}),
- },
- )
- 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/radarhttpasetlsversion.go b/radarhttpasetlsversion.go
deleted file mode 100644
index e85293c151d..00000000000
--- a/radarhttpasetlsversion.go
+++ /dev/null
@@ -1,366 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarHTTPAseTLSVersionService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewRadarHTTPAseTLSVersionService]
-// method instead.
-type RadarHTTPAseTLSVersionService struct {
- Options []option.RequestOption
-}
-
-// NewRadarHTTPAseTLSVersionService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewRadarHTTPAseTLSVersionService(opts ...option.RequestOption) (r *RadarHTTPAseTLSVersionService) {
- r = &RadarHTTPAseTLSVersionService{}
- r.Options = opts
- return
-}
-
-// Get the top autonomous systems (AS), by HTTP traffic, of the requested TLS
-// protocol version. Values are a percentage out of the total traffic.
-func (r *RadarHTTPAseTLSVersionService) Get(ctx context.Context, tlsVersion RadarHTTPAseTLSVersionGetParamsTLSVersion, query RadarHTTPAseTLSVersionGetParams, opts ...option.RequestOption) (res *RadarHTTPAseTLSVersionGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarHTTPAseTLSVersionGetResponseEnvelope
- path := fmt.Sprintf("radar/http/top/ases/tls_version/%v", tlsVersion)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type RadarHTTPAseTLSVersionGetResponse struct {
- Meta RadarHTTPAseTLSVersionGetResponseMeta `json:"meta,required"`
- Top0 []RadarHTTPAseTLSVersionGetResponseTop0 `json:"top_0,required"`
- JSON radarHTTPAseTLSVersionGetResponseJSON `json:"-"`
-}
-
-// radarHTTPAseTLSVersionGetResponseJSON contains the JSON metadata for the struct
-// [RadarHTTPAseTLSVersionGetResponse]
-type radarHTTPAseTLSVersionGetResponseJSON struct {
- Meta apijson.Field
- Top0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPAseTLSVersionGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPAseTLSVersionGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPAseTLSVersionGetResponseMeta struct {
- DateRange []RadarHTTPAseTLSVersionGetResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- ConfidenceInfo RadarHTTPAseTLSVersionGetResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarHTTPAseTLSVersionGetResponseMetaJSON `json:"-"`
-}
-
-// radarHTTPAseTLSVersionGetResponseMetaJSON contains the JSON metadata for the
-// struct [RadarHTTPAseTLSVersionGetResponseMeta]
-type radarHTTPAseTLSVersionGetResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPAseTLSVersionGetResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPAseTLSVersionGetResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPAseTLSVersionGetResponseMetaDateRange 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 radarHTTPAseTLSVersionGetResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarHTTPAseTLSVersionGetResponseMetaDateRangeJSON contains the JSON metadata
-// for the struct [RadarHTTPAseTLSVersionGetResponseMetaDateRange]
-type radarHTTPAseTLSVersionGetResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPAseTLSVersionGetResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPAseTLSVersionGetResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPAseTLSVersionGetResponseMetaConfidenceInfo struct {
- Annotations []RadarHTTPAseTLSVersionGetResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarHTTPAseTLSVersionGetResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarHTTPAseTLSVersionGetResponseMetaConfidenceInfoJSON contains the JSON
-// metadata for the struct [RadarHTTPAseTLSVersionGetResponseMetaConfidenceInfo]
-type radarHTTPAseTLSVersionGetResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPAseTLSVersionGetResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPAseTLSVersionGetResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPAseTLSVersionGetResponseMetaConfidenceInfoAnnotation 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 radarHTTPAseTLSVersionGetResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarHTTPAseTLSVersionGetResponseMetaConfidenceInfoAnnotationJSON contains the
-// JSON metadata for the struct
-// [RadarHTTPAseTLSVersionGetResponseMetaConfidenceInfoAnnotation]
-type radarHTTPAseTLSVersionGetResponseMetaConfidenceInfoAnnotationJSON 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 *RadarHTTPAseTLSVersionGetResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPAseTLSVersionGetResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPAseTLSVersionGetResponseTop0 struct {
- ClientASN int64 `json:"clientASN,required"`
- ClientAsName string `json:"clientASName,required"`
- Value string `json:"value,required"`
- JSON radarHTTPAseTLSVersionGetResponseTop0JSON `json:"-"`
-}
-
-// radarHTTPAseTLSVersionGetResponseTop0JSON contains the JSON metadata for the
-// struct [RadarHTTPAseTLSVersionGetResponseTop0]
-type radarHTTPAseTLSVersionGetResponseTop0JSON struct {
- ClientASN apijson.Field
- ClientAsName apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPAseTLSVersionGetResponseTop0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPAseTLSVersionGetResponseTop0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPAseTLSVersionGetParams 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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarHTTPAseTLSVersionGetParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Filter for device type.
- DeviceType param.Field[[]RadarHTTPAseTLSVersionGetParamsDeviceType] `query:"deviceType"`
- // Format results are returned in.
- Format param.Field[RadarHTTPAseTLSVersionGetParamsFormat] `query:"format"`
- // Filter for http protocol.
- HTTPProtocol param.Field[[]RadarHTTPAseTLSVersionGetParamsHTTPProtocol] `query:"httpProtocol"`
- // Filter for http version.
- HTTPVersion param.Field[[]RadarHTTPAseTLSVersionGetParamsHTTPVersion] `query:"httpVersion"`
- // Filter for ip version.
- IPVersion param.Field[[]RadarHTTPAseTLSVersionGetParamsIPVersion] `query:"ipVersion"`
- // 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 os name.
- OS param.Field[[]RadarHTTPAseTLSVersionGetParamsOS] `query:"os"`
-}
-
-// URLQuery serializes [RadarHTTPAseTLSVersionGetParams]'s query parameters as
-// `url.Values`.
-func (r RadarHTTPAseTLSVersionGetParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// TLS version.
-type RadarHTTPAseTLSVersionGetParamsTLSVersion string
-
-const (
- RadarHTTPAseTLSVersionGetParamsTLSVersionTlSv1_0 RadarHTTPAseTLSVersionGetParamsTLSVersion = "TLSv1_0"
- RadarHTTPAseTLSVersionGetParamsTLSVersionTlSv1_1 RadarHTTPAseTLSVersionGetParamsTLSVersion = "TLSv1_1"
- RadarHTTPAseTLSVersionGetParamsTLSVersionTlSv1_2 RadarHTTPAseTLSVersionGetParamsTLSVersion = "TLSv1_2"
- RadarHTTPAseTLSVersionGetParamsTLSVersionTlSv1_3 RadarHTTPAseTLSVersionGetParamsTLSVersion = "TLSv1_3"
- RadarHTTPAseTLSVersionGetParamsTLSVersionTlSvQuic RadarHTTPAseTLSVersionGetParamsTLSVersion = "TLSvQUIC"
-)
-
-type RadarHTTPAseTLSVersionGetParamsBotClass string
-
-const (
- RadarHTTPAseTLSVersionGetParamsBotClassLikelyAutomated RadarHTTPAseTLSVersionGetParamsBotClass = "LIKELY_AUTOMATED"
- RadarHTTPAseTLSVersionGetParamsBotClassLikelyHuman RadarHTTPAseTLSVersionGetParamsBotClass = "LIKELY_HUMAN"
-)
-
-type RadarHTTPAseTLSVersionGetParamsDateRange string
-
-const (
- RadarHTTPAseTLSVersionGetParamsDateRange1d RadarHTTPAseTLSVersionGetParamsDateRange = "1d"
- RadarHTTPAseTLSVersionGetParamsDateRange2d RadarHTTPAseTLSVersionGetParamsDateRange = "2d"
- RadarHTTPAseTLSVersionGetParamsDateRange7d RadarHTTPAseTLSVersionGetParamsDateRange = "7d"
- RadarHTTPAseTLSVersionGetParamsDateRange14d RadarHTTPAseTLSVersionGetParamsDateRange = "14d"
- RadarHTTPAseTLSVersionGetParamsDateRange28d RadarHTTPAseTLSVersionGetParamsDateRange = "28d"
- RadarHTTPAseTLSVersionGetParamsDateRange12w RadarHTTPAseTLSVersionGetParamsDateRange = "12w"
- RadarHTTPAseTLSVersionGetParamsDateRange24w RadarHTTPAseTLSVersionGetParamsDateRange = "24w"
- RadarHTTPAseTLSVersionGetParamsDateRange52w RadarHTTPAseTLSVersionGetParamsDateRange = "52w"
- RadarHTTPAseTLSVersionGetParamsDateRange1dControl RadarHTTPAseTLSVersionGetParamsDateRange = "1dControl"
- RadarHTTPAseTLSVersionGetParamsDateRange2dControl RadarHTTPAseTLSVersionGetParamsDateRange = "2dControl"
- RadarHTTPAseTLSVersionGetParamsDateRange7dControl RadarHTTPAseTLSVersionGetParamsDateRange = "7dControl"
- RadarHTTPAseTLSVersionGetParamsDateRange14dControl RadarHTTPAseTLSVersionGetParamsDateRange = "14dControl"
- RadarHTTPAseTLSVersionGetParamsDateRange28dControl RadarHTTPAseTLSVersionGetParamsDateRange = "28dControl"
- RadarHTTPAseTLSVersionGetParamsDateRange12wControl RadarHTTPAseTLSVersionGetParamsDateRange = "12wControl"
- RadarHTTPAseTLSVersionGetParamsDateRange24wControl RadarHTTPAseTLSVersionGetParamsDateRange = "24wControl"
-)
-
-type RadarHTTPAseTLSVersionGetParamsDeviceType string
-
-const (
- RadarHTTPAseTLSVersionGetParamsDeviceTypeDesktop RadarHTTPAseTLSVersionGetParamsDeviceType = "DESKTOP"
- RadarHTTPAseTLSVersionGetParamsDeviceTypeMobile RadarHTTPAseTLSVersionGetParamsDeviceType = "MOBILE"
- RadarHTTPAseTLSVersionGetParamsDeviceTypeOther RadarHTTPAseTLSVersionGetParamsDeviceType = "OTHER"
-)
-
-// Format results are returned in.
-type RadarHTTPAseTLSVersionGetParamsFormat string
-
-const (
- RadarHTTPAseTLSVersionGetParamsFormatJson RadarHTTPAseTLSVersionGetParamsFormat = "JSON"
- RadarHTTPAseTLSVersionGetParamsFormatCsv RadarHTTPAseTLSVersionGetParamsFormat = "CSV"
-)
-
-type RadarHTTPAseTLSVersionGetParamsHTTPProtocol string
-
-const (
- RadarHTTPAseTLSVersionGetParamsHTTPProtocolHTTP RadarHTTPAseTLSVersionGetParamsHTTPProtocol = "HTTP"
- RadarHTTPAseTLSVersionGetParamsHTTPProtocolHTTPS RadarHTTPAseTLSVersionGetParamsHTTPProtocol = "HTTPS"
-)
-
-type RadarHTTPAseTLSVersionGetParamsHTTPVersion string
-
-const (
- RadarHTTPAseTLSVersionGetParamsHTTPVersionHttPv1 RadarHTTPAseTLSVersionGetParamsHTTPVersion = "HTTPv1"
- RadarHTTPAseTLSVersionGetParamsHTTPVersionHttPv2 RadarHTTPAseTLSVersionGetParamsHTTPVersion = "HTTPv2"
- RadarHTTPAseTLSVersionGetParamsHTTPVersionHttPv3 RadarHTTPAseTLSVersionGetParamsHTTPVersion = "HTTPv3"
-)
-
-type RadarHTTPAseTLSVersionGetParamsIPVersion string
-
-const (
- RadarHTTPAseTLSVersionGetParamsIPVersionIPv4 RadarHTTPAseTLSVersionGetParamsIPVersion = "IPv4"
- RadarHTTPAseTLSVersionGetParamsIPVersionIPv6 RadarHTTPAseTLSVersionGetParamsIPVersion = "IPv6"
-)
-
-type RadarHTTPAseTLSVersionGetParamsOS string
-
-const (
- RadarHTTPAseTLSVersionGetParamsOSWindows RadarHTTPAseTLSVersionGetParamsOS = "WINDOWS"
- RadarHTTPAseTLSVersionGetParamsOSMacosx RadarHTTPAseTLSVersionGetParamsOS = "MACOSX"
- RadarHTTPAseTLSVersionGetParamsOSIos RadarHTTPAseTLSVersionGetParamsOS = "IOS"
- RadarHTTPAseTLSVersionGetParamsOSAndroid RadarHTTPAseTLSVersionGetParamsOS = "ANDROID"
- RadarHTTPAseTLSVersionGetParamsOSChromeos RadarHTTPAseTLSVersionGetParamsOS = "CHROMEOS"
- RadarHTTPAseTLSVersionGetParamsOSLinux RadarHTTPAseTLSVersionGetParamsOS = "LINUX"
- RadarHTTPAseTLSVersionGetParamsOSSmartTv RadarHTTPAseTLSVersionGetParamsOS = "SMART_TV"
-)
-
-type RadarHTTPAseTLSVersionGetResponseEnvelope struct {
- Result RadarHTTPAseTLSVersionGetResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarHTTPAseTLSVersionGetResponseEnvelopeJSON `json:"-"`
-}
-
-// radarHTTPAseTLSVersionGetResponseEnvelopeJSON contains the JSON metadata for the
-// struct [RadarHTTPAseTLSVersionGetResponseEnvelope]
-type radarHTTPAseTLSVersionGetResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPAseTLSVersionGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPAseTLSVersionGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
diff --git a/radarhttpasetlsversion_test.go b/radarhttpasetlsversion_test.go
deleted file mode 100644
index 25de37e42df..00000000000
--- a/radarhttpasetlsversion_test.go
+++ /dev/null
@@ -1,59 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
- "time"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRadarHTTPAseTLSVersionGetWithOptionalParams(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"),
- )
- _, err := client.Radar.HTTP.Ases.TLSVersion.Get(
- context.TODO(),
- cloudflare.RadarHTTPAseTLSVersionGetParamsTLSVersionTlSv1_0,
- 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()}),
- DeviceType: cloudflare.F([]cloudflare.RadarHTTPAseTLSVersionGetParamsDeviceType{cloudflare.RadarHTTPAseTLSVersionGetParamsDeviceTypeDesktop, cloudflare.RadarHTTPAseTLSVersionGetParamsDeviceTypeMobile, cloudflare.RadarHTTPAseTLSVersionGetParamsDeviceTypeOther}),
- Format: cloudflare.F(cloudflare.RadarHTTPAseTLSVersionGetParamsFormatJson),
- HTTPProtocol: cloudflare.F([]cloudflare.RadarHTTPAseTLSVersionGetParamsHTTPProtocol{cloudflare.RadarHTTPAseTLSVersionGetParamsHTTPProtocolHTTP, cloudflare.RadarHTTPAseTLSVersionGetParamsHTTPProtocolHTTPS}),
- HTTPVersion: cloudflare.F([]cloudflare.RadarHTTPAseTLSVersionGetParamsHTTPVersion{cloudflare.RadarHTTPAseTLSVersionGetParamsHTTPVersionHttPv1, cloudflare.RadarHTTPAseTLSVersionGetParamsHTTPVersionHttPv2, cloudflare.RadarHTTPAseTLSVersionGetParamsHTTPVersionHttPv3}),
- IPVersion: cloudflare.F([]cloudflare.RadarHTTPAseTLSVersionGetParamsIPVersion{cloudflare.RadarHTTPAseTLSVersionGetParamsIPVersionIPv4, cloudflare.RadarHTTPAseTLSVersionGetParamsIPVersionIPv6}),
- Limit: cloudflare.F(int64(5)),
- Location: cloudflare.F([]string{"string", "string", "string"}),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- OS: cloudflare.F([]cloudflare.RadarHTTPAseTLSVersionGetParamsOS{cloudflare.RadarHTTPAseTLSVersionGetParamsOSWindows, cloudflare.RadarHTTPAseTLSVersionGetParamsOSMacosx, cloudflare.RadarHTTPAseTLSVersionGetParamsOSIos}),
- },
- )
- 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/radarhttplocation.go b/radarhttplocation.go
deleted file mode 100644
index 6c7b3c5ef50..00000000000
--- a/radarhttplocation.go
+++ /dev/null
@@ -1,380 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarHTTPLocationService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewRadarHTTPLocationService] method
-// instead.
-type RadarHTTPLocationService struct {
- Options []option.RequestOption
- BotClass *RadarHTTPLocationBotClassService
- DeviceType *RadarHTTPLocationDeviceTypeService
- HTTPProtocol *RadarHTTPLocationHTTPProtocolService
- HTTPMethod *RadarHTTPLocationHTTPMethodService
- IPVersion *RadarHTTPLocationIPVersionService
- OS *RadarHTTPLocationOSService
- TLSVersion *RadarHTTPLocationTLSVersionService
-}
-
-// NewRadarHTTPLocationService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewRadarHTTPLocationService(opts ...option.RequestOption) (r *RadarHTTPLocationService) {
- r = &RadarHTTPLocationService{}
- r.Options = opts
- r.BotClass = NewRadarHTTPLocationBotClassService(opts...)
- r.DeviceType = NewRadarHTTPLocationDeviceTypeService(opts...)
- r.HTTPProtocol = NewRadarHTTPLocationHTTPProtocolService(opts...)
- r.HTTPMethod = NewRadarHTTPLocationHTTPMethodService(opts...)
- r.IPVersion = NewRadarHTTPLocationIPVersionService(opts...)
- r.OS = NewRadarHTTPLocationOSService(opts...)
- r.TLSVersion = NewRadarHTTPLocationTLSVersionService(opts...)
- return
-}
-
-// Get the top locations by HTTP traffic. Values are a percentage out of the total
-// traffic.
-func (r *RadarHTTPLocationService) Get(ctx context.Context, query RadarHTTPLocationGetParams, opts ...option.RequestOption) (res *RadarHTTPLocationGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarHTTPLocationGetResponseEnvelope
- path := "radar/http/top/locations"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type RadarHTTPLocationGetResponse struct {
- Meta RadarHTTPLocationGetResponseMeta `json:"meta,required"`
- Top0 []RadarHTTPLocationGetResponseTop0 `json:"top_0,required"`
- JSON radarHTTPLocationGetResponseJSON `json:"-"`
-}
-
-// radarHTTPLocationGetResponseJSON contains the JSON metadata for the struct
-// [RadarHTTPLocationGetResponse]
-type radarHTTPLocationGetResponseJSON struct {
- Meta apijson.Field
- Top0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPLocationGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPLocationGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPLocationGetResponseMeta struct {
- DateRange []RadarHTTPLocationGetResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- ConfidenceInfo RadarHTTPLocationGetResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarHTTPLocationGetResponseMetaJSON `json:"-"`
-}
-
-// radarHTTPLocationGetResponseMetaJSON contains the JSON metadata for the struct
-// [RadarHTTPLocationGetResponseMeta]
-type radarHTTPLocationGetResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPLocationGetResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPLocationGetResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPLocationGetResponseMetaDateRange 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 radarHTTPLocationGetResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarHTTPLocationGetResponseMetaDateRangeJSON contains the JSON metadata for the
-// struct [RadarHTTPLocationGetResponseMetaDateRange]
-type radarHTTPLocationGetResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPLocationGetResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPLocationGetResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPLocationGetResponseMetaConfidenceInfo struct {
- Annotations []RadarHTTPLocationGetResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarHTTPLocationGetResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarHTTPLocationGetResponseMetaConfidenceInfoJSON contains the JSON metadata
-// for the struct [RadarHTTPLocationGetResponseMetaConfidenceInfo]
-type radarHTTPLocationGetResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPLocationGetResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPLocationGetResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPLocationGetResponseMetaConfidenceInfoAnnotation 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 radarHTTPLocationGetResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarHTTPLocationGetResponseMetaConfidenceInfoAnnotationJSON contains the JSON
-// metadata for the struct
-// [RadarHTTPLocationGetResponseMetaConfidenceInfoAnnotation]
-type radarHTTPLocationGetResponseMetaConfidenceInfoAnnotationJSON 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 *RadarHTTPLocationGetResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPLocationGetResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPLocationGetResponseTop0 struct {
- ClientCountryAlpha2 string `json:"clientCountryAlpha2,required"`
- ClientCountryName string `json:"clientCountryName,required"`
- Value string `json:"value,required"`
- JSON radarHTTPLocationGetResponseTop0JSON `json:"-"`
-}
-
-// radarHTTPLocationGetResponseTop0JSON contains the JSON metadata for the struct
-// [RadarHTTPLocationGetResponseTop0]
-type radarHTTPLocationGetResponseTop0JSON struct {
- ClientCountryAlpha2 apijson.Field
- ClientCountryName apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPLocationGetResponseTop0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPLocationGetResponseTop0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPLocationGetParams 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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarHTTPLocationGetParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Filter for device type.
- DeviceType param.Field[[]RadarHTTPLocationGetParamsDeviceType] `query:"deviceType"`
- // Format results are returned in.
- Format param.Field[RadarHTTPLocationGetParamsFormat] `query:"format"`
- // Filter for http protocol.
- HTTPProtocol param.Field[[]RadarHTTPLocationGetParamsHTTPProtocol] `query:"httpProtocol"`
- // Filter for http version.
- HTTPVersion param.Field[[]RadarHTTPLocationGetParamsHTTPVersion] `query:"httpVersion"`
- // Filter for ip version.
- IPVersion param.Field[[]RadarHTTPLocationGetParamsIPVersion] `query:"ipVersion"`
- // 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 os name.
- OS param.Field[[]RadarHTTPLocationGetParamsOS] `query:"os"`
- // Filter for tls version.
- TLSVersion param.Field[[]RadarHTTPLocationGetParamsTLSVersion] `query:"tlsVersion"`
-}
-
-// URLQuery serializes [RadarHTTPLocationGetParams]'s query parameters as
-// `url.Values`.
-func (r RadarHTTPLocationGetParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type RadarHTTPLocationGetParamsBotClass string
-
-const (
- RadarHTTPLocationGetParamsBotClassLikelyAutomated RadarHTTPLocationGetParamsBotClass = "LIKELY_AUTOMATED"
- RadarHTTPLocationGetParamsBotClassLikelyHuman RadarHTTPLocationGetParamsBotClass = "LIKELY_HUMAN"
-)
-
-type RadarHTTPLocationGetParamsDateRange string
-
-const (
- RadarHTTPLocationGetParamsDateRange1d RadarHTTPLocationGetParamsDateRange = "1d"
- RadarHTTPLocationGetParamsDateRange2d RadarHTTPLocationGetParamsDateRange = "2d"
- RadarHTTPLocationGetParamsDateRange7d RadarHTTPLocationGetParamsDateRange = "7d"
- RadarHTTPLocationGetParamsDateRange14d RadarHTTPLocationGetParamsDateRange = "14d"
- RadarHTTPLocationGetParamsDateRange28d RadarHTTPLocationGetParamsDateRange = "28d"
- RadarHTTPLocationGetParamsDateRange12w RadarHTTPLocationGetParamsDateRange = "12w"
- RadarHTTPLocationGetParamsDateRange24w RadarHTTPLocationGetParamsDateRange = "24w"
- RadarHTTPLocationGetParamsDateRange52w RadarHTTPLocationGetParamsDateRange = "52w"
- RadarHTTPLocationGetParamsDateRange1dControl RadarHTTPLocationGetParamsDateRange = "1dControl"
- RadarHTTPLocationGetParamsDateRange2dControl RadarHTTPLocationGetParamsDateRange = "2dControl"
- RadarHTTPLocationGetParamsDateRange7dControl RadarHTTPLocationGetParamsDateRange = "7dControl"
- RadarHTTPLocationGetParamsDateRange14dControl RadarHTTPLocationGetParamsDateRange = "14dControl"
- RadarHTTPLocationGetParamsDateRange28dControl RadarHTTPLocationGetParamsDateRange = "28dControl"
- RadarHTTPLocationGetParamsDateRange12wControl RadarHTTPLocationGetParamsDateRange = "12wControl"
- RadarHTTPLocationGetParamsDateRange24wControl RadarHTTPLocationGetParamsDateRange = "24wControl"
-)
-
-type RadarHTTPLocationGetParamsDeviceType string
-
-const (
- RadarHTTPLocationGetParamsDeviceTypeDesktop RadarHTTPLocationGetParamsDeviceType = "DESKTOP"
- RadarHTTPLocationGetParamsDeviceTypeMobile RadarHTTPLocationGetParamsDeviceType = "MOBILE"
- RadarHTTPLocationGetParamsDeviceTypeOther RadarHTTPLocationGetParamsDeviceType = "OTHER"
-)
-
-// Format results are returned in.
-type RadarHTTPLocationGetParamsFormat string
-
-const (
- RadarHTTPLocationGetParamsFormatJson RadarHTTPLocationGetParamsFormat = "JSON"
- RadarHTTPLocationGetParamsFormatCsv RadarHTTPLocationGetParamsFormat = "CSV"
-)
-
-type RadarHTTPLocationGetParamsHTTPProtocol string
-
-const (
- RadarHTTPLocationGetParamsHTTPProtocolHTTP RadarHTTPLocationGetParamsHTTPProtocol = "HTTP"
- RadarHTTPLocationGetParamsHTTPProtocolHTTPS RadarHTTPLocationGetParamsHTTPProtocol = "HTTPS"
-)
-
-type RadarHTTPLocationGetParamsHTTPVersion string
-
-const (
- RadarHTTPLocationGetParamsHTTPVersionHttPv1 RadarHTTPLocationGetParamsHTTPVersion = "HTTPv1"
- RadarHTTPLocationGetParamsHTTPVersionHttPv2 RadarHTTPLocationGetParamsHTTPVersion = "HTTPv2"
- RadarHTTPLocationGetParamsHTTPVersionHttPv3 RadarHTTPLocationGetParamsHTTPVersion = "HTTPv3"
-)
-
-type RadarHTTPLocationGetParamsIPVersion string
-
-const (
- RadarHTTPLocationGetParamsIPVersionIPv4 RadarHTTPLocationGetParamsIPVersion = "IPv4"
- RadarHTTPLocationGetParamsIPVersionIPv6 RadarHTTPLocationGetParamsIPVersion = "IPv6"
-)
-
-type RadarHTTPLocationGetParamsOS string
-
-const (
- RadarHTTPLocationGetParamsOSWindows RadarHTTPLocationGetParamsOS = "WINDOWS"
- RadarHTTPLocationGetParamsOSMacosx RadarHTTPLocationGetParamsOS = "MACOSX"
- RadarHTTPLocationGetParamsOSIos RadarHTTPLocationGetParamsOS = "IOS"
- RadarHTTPLocationGetParamsOSAndroid RadarHTTPLocationGetParamsOS = "ANDROID"
- RadarHTTPLocationGetParamsOSChromeos RadarHTTPLocationGetParamsOS = "CHROMEOS"
- RadarHTTPLocationGetParamsOSLinux RadarHTTPLocationGetParamsOS = "LINUX"
- RadarHTTPLocationGetParamsOSSmartTv RadarHTTPLocationGetParamsOS = "SMART_TV"
-)
-
-type RadarHTTPLocationGetParamsTLSVersion string
-
-const (
- RadarHTTPLocationGetParamsTLSVersionTlSv1_0 RadarHTTPLocationGetParamsTLSVersion = "TLSv1_0"
- RadarHTTPLocationGetParamsTLSVersionTlSv1_1 RadarHTTPLocationGetParamsTLSVersion = "TLSv1_1"
- RadarHTTPLocationGetParamsTLSVersionTlSv1_2 RadarHTTPLocationGetParamsTLSVersion = "TLSv1_2"
- RadarHTTPLocationGetParamsTLSVersionTlSv1_3 RadarHTTPLocationGetParamsTLSVersion = "TLSv1_3"
- RadarHTTPLocationGetParamsTLSVersionTlSvQuic RadarHTTPLocationGetParamsTLSVersion = "TLSvQUIC"
-)
-
-type RadarHTTPLocationGetResponseEnvelope struct {
- Result RadarHTTPLocationGetResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarHTTPLocationGetResponseEnvelopeJSON `json:"-"`
-}
-
-// radarHTTPLocationGetResponseEnvelopeJSON contains the JSON metadata for the
-// struct [RadarHTTPLocationGetResponseEnvelope]
-type radarHTTPLocationGetResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPLocationGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPLocationGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
diff --git a/radarhttplocation_test.go b/radarhttplocation_test.go
deleted file mode 100644
index dcca6ba3d78..00000000000
--- a/radarhttplocation_test.go
+++ /dev/null
@@ -1,56 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
- "time"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRadarHTTPLocationGetWithOptionalParams(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"),
- )
- _, 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()}),
- DeviceType: cloudflare.F([]cloudflare.RadarHTTPLocationGetParamsDeviceType{cloudflare.RadarHTTPLocationGetParamsDeviceTypeDesktop, cloudflare.RadarHTTPLocationGetParamsDeviceTypeMobile, cloudflare.RadarHTTPLocationGetParamsDeviceTypeOther}),
- Format: cloudflare.F(cloudflare.RadarHTTPLocationGetParamsFormatJson),
- HTTPProtocol: cloudflare.F([]cloudflare.RadarHTTPLocationGetParamsHTTPProtocol{cloudflare.RadarHTTPLocationGetParamsHTTPProtocolHTTP, cloudflare.RadarHTTPLocationGetParamsHTTPProtocolHTTPS}),
- HTTPVersion: cloudflare.F([]cloudflare.RadarHTTPLocationGetParamsHTTPVersion{cloudflare.RadarHTTPLocationGetParamsHTTPVersionHttPv1, cloudflare.RadarHTTPLocationGetParamsHTTPVersionHttPv2, cloudflare.RadarHTTPLocationGetParamsHTTPVersionHttPv3}),
- IPVersion: cloudflare.F([]cloudflare.RadarHTTPLocationGetParamsIPVersion{cloudflare.RadarHTTPLocationGetParamsIPVersionIPv4, cloudflare.RadarHTTPLocationGetParamsIPVersionIPv6}),
- Limit: cloudflare.F(int64(5)),
- Location: cloudflare.F([]string{"string", "string", "string"}),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- OS: cloudflare.F([]cloudflare.RadarHTTPLocationGetParamsOS{cloudflare.RadarHTTPLocationGetParamsOSWindows, cloudflare.RadarHTTPLocationGetParamsOSMacosx, cloudflare.RadarHTTPLocationGetParamsOSIos}),
- TLSVersion: cloudflare.F([]cloudflare.RadarHTTPLocationGetParamsTLSVersion{cloudflare.RadarHTTPLocationGetParamsTLSVersionTlSv1_0, cloudflare.RadarHTTPLocationGetParamsTLSVersionTlSv1_1, cloudflare.RadarHTTPLocationGetParamsTLSVersionTlSv1_2}),
- })
- 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/radarhttplocationbotclass.go b/radarhttplocationbotclass.go
deleted file mode 100644
index d7dcb198392..00000000000
--- a/radarhttplocationbotclass.go
+++ /dev/null
@@ -1,367 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarHTTPLocationBotClassService contains methods and other services that help
-// with interacting with the cloudflare API. Note, unlike clients, this service
-// does not read variables from the environment automatically. You should not
-// instantiate this service directly, and instead use the
-// [NewRadarHTTPLocationBotClassService] method instead.
-type RadarHTTPLocationBotClassService struct {
- Options []option.RequestOption
-}
-
-// NewRadarHTTPLocationBotClassService generates a new service that applies the
-// given options to each request. These options are applied after the parent
-// client's options (if there is one), and before any request-specific options.
-func NewRadarHTTPLocationBotClassService(opts ...option.RequestOption) (r *RadarHTTPLocationBotClassService) {
- r = &RadarHTTPLocationBotClassService{}
- r.Options = opts
- return
-}
-
-// Get the top locations, by HTTP traffic, of the requested bot class. These two
-// categories use Cloudflare's bot score - refer to [Bot
-// scores])https://developers.cloudflare.com/bots/concepts/bot-score). Values are a
-// percentage out of the total traffic.
-func (r *RadarHTTPLocationBotClassService) Get(ctx context.Context, botClass RadarHTTPLocationBotClassGetParamsBotClass, query RadarHTTPLocationBotClassGetParams, opts ...option.RequestOption) (res *RadarHTTPLocationBotClassGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarHTTPLocationBotClassGetResponseEnvelope
- path := fmt.Sprintf("radar/http/top/locations/bot_class/%v", botClass)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type RadarHTTPLocationBotClassGetResponse struct {
- Meta RadarHTTPLocationBotClassGetResponseMeta `json:"meta,required"`
- Top0 []RadarHTTPLocationBotClassGetResponseTop0 `json:"top_0,required"`
- JSON radarHTTPLocationBotClassGetResponseJSON `json:"-"`
-}
-
-// radarHTTPLocationBotClassGetResponseJSON contains the JSON metadata for the
-// struct [RadarHTTPLocationBotClassGetResponse]
-type radarHTTPLocationBotClassGetResponseJSON struct {
- Meta apijson.Field
- Top0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPLocationBotClassGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPLocationBotClassGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPLocationBotClassGetResponseMeta struct {
- DateRange []RadarHTTPLocationBotClassGetResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- ConfidenceInfo RadarHTTPLocationBotClassGetResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarHTTPLocationBotClassGetResponseMetaJSON `json:"-"`
-}
-
-// radarHTTPLocationBotClassGetResponseMetaJSON contains the JSON metadata for the
-// struct [RadarHTTPLocationBotClassGetResponseMeta]
-type radarHTTPLocationBotClassGetResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPLocationBotClassGetResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPLocationBotClassGetResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPLocationBotClassGetResponseMetaDateRange 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 radarHTTPLocationBotClassGetResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarHTTPLocationBotClassGetResponseMetaDateRangeJSON contains the JSON metadata
-// for the struct [RadarHTTPLocationBotClassGetResponseMetaDateRange]
-type radarHTTPLocationBotClassGetResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPLocationBotClassGetResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPLocationBotClassGetResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPLocationBotClassGetResponseMetaConfidenceInfo struct {
- Annotations []RadarHTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarHTTPLocationBotClassGetResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarHTTPLocationBotClassGetResponseMetaConfidenceInfoJSON contains the JSON
-// metadata for the struct [RadarHTTPLocationBotClassGetResponseMetaConfidenceInfo]
-type radarHTTPLocationBotClassGetResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPLocationBotClassGetResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPLocationBotClassGetResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotation 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 radarHTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarHTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotationJSON contains
-// the JSON metadata for the struct
-// [RadarHTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotation]
-type radarHTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotationJSON 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 *RadarHTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPLocationBotClassGetResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPLocationBotClassGetResponseTop0 struct {
- ClientCountryAlpha2 string `json:"clientCountryAlpha2,required"`
- ClientCountryName string `json:"clientCountryName,required"`
- Value string `json:"value,required"`
- JSON radarHTTPLocationBotClassGetResponseTop0JSON `json:"-"`
-}
-
-// radarHTTPLocationBotClassGetResponseTop0JSON contains the JSON metadata for the
-// struct [RadarHTTPLocationBotClassGetResponseTop0]
-type radarHTTPLocationBotClassGetResponseTop0JSON struct {
- ClientCountryAlpha2 apijson.Field
- ClientCountryName apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPLocationBotClassGetResponseTop0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPLocationBotClassGetResponseTop0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPLocationBotClassGetParams 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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarHTTPLocationBotClassGetParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Filter for device type.
- DeviceType param.Field[[]RadarHTTPLocationBotClassGetParamsDeviceType] `query:"deviceType"`
- // Format results are returned in.
- Format param.Field[RadarHTTPLocationBotClassGetParamsFormat] `query:"format"`
- // Filter for http protocol.
- HTTPProtocol param.Field[[]RadarHTTPLocationBotClassGetParamsHTTPProtocol] `query:"httpProtocol"`
- // Filter for http version.
- HTTPVersion param.Field[[]RadarHTTPLocationBotClassGetParamsHTTPVersion] `query:"httpVersion"`
- // Filter for ip version.
- IPVersion param.Field[[]RadarHTTPLocationBotClassGetParamsIPVersion] `query:"ipVersion"`
- // 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 os name.
- OS param.Field[[]RadarHTTPLocationBotClassGetParamsOS] `query:"os"`
- // Filter for tls version.
- TLSVersion param.Field[[]RadarHTTPLocationBotClassGetParamsTLSVersion] `query:"tlsVersion"`
-}
-
-// URLQuery serializes [RadarHTTPLocationBotClassGetParams]'s query parameters as
-// `url.Values`.
-func (r RadarHTTPLocationBotClassGetParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Bot class.
-type RadarHTTPLocationBotClassGetParamsBotClass string
-
-const (
- RadarHTTPLocationBotClassGetParamsBotClassLikelyAutomated RadarHTTPLocationBotClassGetParamsBotClass = "LIKELY_AUTOMATED"
- RadarHTTPLocationBotClassGetParamsBotClassLikelyHuman RadarHTTPLocationBotClassGetParamsBotClass = "LIKELY_HUMAN"
-)
-
-type RadarHTTPLocationBotClassGetParamsDateRange string
-
-const (
- RadarHTTPLocationBotClassGetParamsDateRange1d RadarHTTPLocationBotClassGetParamsDateRange = "1d"
- RadarHTTPLocationBotClassGetParamsDateRange2d RadarHTTPLocationBotClassGetParamsDateRange = "2d"
- RadarHTTPLocationBotClassGetParamsDateRange7d RadarHTTPLocationBotClassGetParamsDateRange = "7d"
- RadarHTTPLocationBotClassGetParamsDateRange14d RadarHTTPLocationBotClassGetParamsDateRange = "14d"
- RadarHTTPLocationBotClassGetParamsDateRange28d RadarHTTPLocationBotClassGetParamsDateRange = "28d"
- RadarHTTPLocationBotClassGetParamsDateRange12w RadarHTTPLocationBotClassGetParamsDateRange = "12w"
- RadarHTTPLocationBotClassGetParamsDateRange24w RadarHTTPLocationBotClassGetParamsDateRange = "24w"
- RadarHTTPLocationBotClassGetParamsDateRange52w RadarHTTPLocationBotClassGetParamsDateRange = "52w"
- RadarHTTPLocationBotClassGetParamsDateRange1dControl RadarHTTPLocationBotClassGetParamsDateRange = "1dControl"
- RadarHTTPLocationBotClassGetParamsDateRange2dControl RadarHTTPLocationBotClassGetParamsDateRange = "2dControl"
- RadarHTTPLocationBotClassGetParamsDateRange7dControl RadarHTTPLocationBotClassGetParamsDateRange = "7dControl"
- RadarHTTPLocationBotClassGetParamsDateRange14dControl RadarHTTPLocationBotClassGetParamsDateRange = "14dControl"
- RadarHTTPLocationBotClassGetParamsDateRange28dControl RadarHTTPLocationBotClassGetParamsDateRange = "28dControl"
- RadarHTTPLocationBotClassGetParamsDateRange12wControl RadarHTTPLocationBotClassGetParamsDateRange = "12wControl"
- RadarHTTPLocationBotClassGetParamsDateRange24wControl RadarHTTPLocationBotClassGetParamsDateRange = "24wControl"
-)
-
-type RadarHTTPLocationBotClassGetParamsDeviceType string
-
-const (
- RadarHTTPLocationBotClassGetParamsDeviceTypeDesktop RadarHTTPLocationBotClassGetParamsDeviceType = "DESKTOP"
- RadarHTTPLocationBotClassGetParamsDeviceTypeMobile RadarHTTPLocationBotClassGetParamsDeviceType = "MOBILE"
- RadarHTTPLocationBotClassGetParamsDeviceTypeOther RadarHTTPLocationBotClassGetParamsDeviceType = "OTHER"
-)
-
-// Format results are returned in.
-type RadarHTTPLocationBotClassGetParamsFormat string
-
-const (
- RadarHTTPLocationBotClassGetParamsFormatJson RadarHTTPLocationBotClassGetParamsFormat = "JSON"
- RadarHTTPLocationBotClassGetParamsFormatCsv RadarHTTPLocationBotClassGetParamsFormat = "CSV"
-)
-
-type RadarHTTPLocationBotClassGetParamsHTTPProtocol string
-
-const (
- RadarHTTPLocationBotClassGetParamsHTTPProtocolHTTP RadarHTTPLocationBotClassGetParamsHTTPProtocol = "HTTP"
- RadarHTTPLocationBotClassGetParamsHTTPProtocolHTTPS RadarHTTPLocationBotClassGetParamsHTTPProtocol = "HTTPS"
-)
-
-type RadarHTTPLocationBotClassGetParamsHTTPVersion string
-
-const (
- RadarHTTPLocationBotClassGetParamsHTTPVersionHttPv1 RadarHTTPLocationBotClassGetParamsHTTPVersion = "HTTPv1"
- RadarHTTPLocationBotClassGetParamsHTTPVersionHttPv2 RadarHTTPLocationBotClassGetParamsHTTPVersion = "HTTPv2"
- RadarHTTPLocationBotClassGetParamsHTTPVersionHttPv3 RadarHTTPLocationBotClassGetParamsHTTPVersion = "HTTPv3"
-)
-
-type RadarHTTPLocationBotClassGetParamsIPVersion string
-
-const (
- RadarHTTPLocationBotClassGetParamsIPVersionIPv4 RadarHTTPLocationBotClassGetParamsIPVersion = "IPv4"
- RadarHTTPLocationBotClassGetParamsIPVersionIPv6 RadarHTTPLocationBotClassGetParamsIPVersion = "IPv6"
-)
-
-type RadarHTTPLocationBotClassGetParamsOS string
-
-const (
- RadarHTTPLocationBotClassGetParamsOSWindows RadarHTTPLocationBotClassGetParamsOS = "WINDOWS"
- RadarHTTPLocationBotClassGetParamsOSMacosx RadarHTTPLocationBotClassGetParamsOS = "MACOSX"
- RadarHTTPLocationBotClassGetParamsOSIos RadarHTTPLocationBotClassGetParamsOS = "IOS"
- RadarHTTPLocationBotClassGetParamsOSAndroid RadarHTTPLocationBotClassGetParamsOS = "ANDROID"
- RadarHTTPLocationBotClassGetParamsOSChromeos RadarHTTPLocationBotClassGetParamsOS = "CHROMEOS"
- RadarHTTPLocationBotClassGetParamsOSLinux RadarHTTPLocationBotClassGetParamsOS = "LINUX"
- RadarHTTPLocationBotClassGetParamsOSSmartTv RadarHTTPLocationBotClassGetParamsOS = "SMART_TV"
-)
-
-type RadarHTTPLocationBotClassGetParamsTLSVersion string
-
-const (
- RadarHTTPLocationBotClassGetParamsTLSVersionTlSv1_0 RadarHTTPLocationBotClassGetParamsTLSVersion = "TLSv1_0"
- RadarHTTPLocationBotClassGetParamsTLSVersionTlSv1_1 RadarHTTPLocationBotClassGetParamsTLSVersion = "TLSv1_1"
- RadarHTTPLocationBotClassGetParamsTLSVersionTlSv1_2 RadarHTTPLocationBotClassGetParamsTLSVersion = "TLSv1_2"
- RadarHTTPLocationBotClassGetParamsTLSVersionTlSv1_3 RadarHTTPLocationBotClassGetParamsTLSVersion = "TLSv1_3"
- RadarHTTPLocationBotClassGetParamsTLSVersionTlSvQuic RadarHTTPLocationBotClassGetParamsTLSVersion = "TLSvQUIC"
-)
-
-type RadarHTTPLocationBotClassGetResponseEnvelope struct {
- Result RadarHTTPLocationBotClassGetResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarHTTPLocationBotClassGetResponseEnvelopeJSON `json:"-"`
-}
-
-// radarHTTPLocationBotClassGetResponseEnvelopeJSON contains the JSON metadata for
-// the struct [RadarHTTPLocationBotClassGetResponseEnvelope]
-type radarHTTPLocationBotClassGetResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPLocationBotClassGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPLocationBotClassGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
diff --git a/radarhttplocationbotclass_test.go b/radarhttplocationbotclass_test.go
deleted file mode 100644
index 30e84504a54..00000000000
--- a/radarhttplocationbotclass_test.go
+++ /dev/null
@@ -1,59 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
- "time"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRadarHTTPLocationBotClassGetWithOptionalParams(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"),
- )
- _, err := client.Radar.HTTP.Locations.BotClass.Get(
- context.TODO(),
- 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()}),
- DeviceType: cloudflare.F([]cloudflare.RadarHTTPLocationBotClassGetParamsDeviceType{cloudflare.RadarHTTPLocationBotClassGetParamsDeviceTypeDesktop, cloudflare.RadarHTTPLocationBotClassGetParamsDeviceTypeMobile, cloudflare.RadarHTTPLocationBotClassGetParamsDeviceTypeOther}),
- Format: cloudflare.F(cloudflare.RadarHTTPLocationBotClassGetParamsFormatJson),
- HTTPProtocol: cloudflare.F([]cloudflare.RadarHTTPLocationBotClassGetParamsHTTPProtocol{cloudflare.RadarHTTPLocationBotClassGetParamsHTTPProtocolHTTP, cloudflare.RadarHTTPLocationBotClassGetParamsHTTPProtocolHTTPS}),
- HTTPVersion: cloudflare.F([]cloudflare.RadarHTTPLocationBotClassGetParamsHTTPVersion{cloudflare.RadarHTTPLocationBotClassGetParamsHTTPVersionHttPv1, cloudflare.RadarHTTPLocationBotClassGetParamsHTTPVersionHttPv2, cloudflare.RadarHTTPLocationBotClassGetParamsHTTPVersionHttPv3}),
- IPVersion: cloudflare.F([]cloudflare.RadarHTTPLocationBotClassGetParamsIPVersion{cloudflare.RadarHTTPLocationBotClassGetParamsIPVersionIPv4, cloudflare.RadarHTTPLocationBotClassGetParamsIPVersionIPv6}),
- Limit: cloudflare.F(int64(5)),
- Location: cloudflare.F([]string{"string", "string", "string"}),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- OS: cloudflare.F([]cloudflare.RadarHTTPLocationBotClassGetParamsOS{cloudflare.RadarHTTPLocationBotClassGetParamsOSWindows, cloudflare.RadarHTTPLocationBotClassGetParamsOSMacosx, cloudflare.RadarHTTPLocationBotClassGetParamsOSIos}),
- TLSVersion: cloudflare.F([]cloudflare.RadarHTTPLocationBotClassGetParamsTLSVersion{cloudflare.RadarHTTPLocationBotClassGetParamsTLSVersionTlSv1_0, cloudflare.RadarHTTPLocationBotClassGetParamsTLSVersionTlSv1_1, cloudflare.RadarHTTPLocationBotClassGetParamsTLSVersionTlSv1_2}),
- },
- )
- 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/radarhttplocationdevicetype.go b/radarhttplocationdevicetype.go
deleted file mode 100644
index edf264a9084..00000000000
--- a/radarhttplocationdevicetype.go
+++ /dev/null
@@ -1,367 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarHTTPLocationDeviceTypeService contains methods and other services that help
-// with interacting with the cloudflare API. Note, unlike clients, this service
-// does not read variables from the environment automatically. You should not
-// instantiate this service directly, and instead use the
-// [NewRadarHTTPLocationDeviceTypeService] method instead.
-type RadarHTTPLocationDeviceTypeService struct {
- Options []option.RequestOption
-}
-
-// NewRadarHTTPLocationDeviceTypeService generates a new service that applies the
-// given options to each request. These options are applied after the parent
-// client's options (if there is one), and before any request-specific options.
-func NewRadarHTTPLocationDeviceTypeService(opts ...option.RequestOption) (r *RadarHTTPLocationDeviceTypeService) {
- r = &RadarHTTPLocationDeviceTypeService{}
- r.Options = opts
- return
-}
-
-// Get the top locations, by HTTP traffic, of the requested device type. Values are
-// a percentage out of the total traffic.
-func (r *RadarHTTPLocationDeviceTypeService) Get(ctx context.Context, deviceType RadarHTTPLocationDeviceTypeGetParamsDeviceType, query RadarHTTPLocationDeviceTypeGetParams, opts ...option.RequestOption) (res *RadarHTTPLocationDeviceTypeGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarHTTPLocationDeviceTypeGetResponseEnvelope
- path := fmt.Sprintf("radar/http/top/locations/device_type/%v", deviceType)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type RadarHTTPLocationDeviceTypeGetResponse struct {
- Meta RadarHTTPLocationDeviceTypeGetResponseMeta `json:"meta,required"`
- Top0 []RadarHTTPLocationDeviceTypeGetResponseTop0 `json:"top_0,required"`
- JSON radarHTTPLocationDeviceTypeGetResponseJSON `json:"-"`
-}
-
-// radarHTTPLocationDeviceTypeGetResponseJSON contains the JSON metadata for the
-// struct [RadarHTTPLocationDeviceTypeGetResponse]
-type radarHTTPLocationDeviceTypeGetResponseJSON struct {
- Meta apijson.Field
- Top0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPLocationDeviceTypeGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPLocationDeviceTypeGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPLocationDeviceTypeGetResponseMeta struct {
- DateRange []RadarHTTPLocationDeviceTypeGetResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- ConfidenceInfo RadarHTTPLocationDeviceTypeGetResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarHTTPLocationDeviceTypeGetResponseMetaJSON `json:"-"`
-}
-
-// radarHTTPLocationDeviceTypeGetResponseMetaJSON contains the JSON metadata for
-// the struct [RadarHTTPLocationDeviceTypeGetResponseMeta]
-type radarHTTPLocationDeviceTypeGetResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPLocationDeviceTypeGetResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPLocationDeviceTypeGetResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPLocationDeviceTypeGetResponseMetaDateRange 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 radarHTTPLocationDeviceTypeGetResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarHTTPLocationDeviceTypeGetResponseMetaDateRangeJSON contains the JSON
-// metadata for the struct [RadarHTTPLocationDeviceTypeGetResponseMetaDateRange]
-type radarHTTPLocationDeviceTypeGetResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPLocationDeviceTypeGetResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPLocationDeviceTypeGetResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPLocationDeviceTypeGetResponseMetaConfidenceInfo struct {
- Annotations []RadarHTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarHTTPLocationDeviceTypeGetResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarHTTPLocationDeviceTypeGetResponseMetaConfidenceInfoJSON contains the JSON
-// metadata for the struct
-// [RadarHTTPLocationDeviceTypeGetResponseMetaConfidenceInfo]
-type radarHTTPLocationDeviceTypeGetResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPLocationDeviceTypeGetResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPLocationDeviceTypeGetResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotation 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 radarHTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarHTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotationJSON contains
-// the JSON metadata for the struct
-// [RadarHTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotation]
-type radarHTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotationJSON 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 *RadarHTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPLocationDeviceTypeGetResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPLocationDeviceTypeGetResponseTop0 struct {
- ClientCountryAlpha2 string `json:"clientCountryAlpha2,required"`
- ClientCountryName string `json:"clientCountryName,required"`
- Value string `json:"value,required"`
- JSON radarHTTPLocationDeviceTypeGetResponseTop0JSON `json:"-"`
-}
-
-// radarHTTPLocationDeviceTypeGetResponseTop0JSON contains the JSON metadata for
-// the struct [RadarHTTPLocationDeviceTypeGetResponseTop0]
-type radarHTTPLocationDeviceTypeGetResponseTop0JSON struct {
- ClientCountryAlpha2 apijson.Field
- ClientCountryName apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPLocationDeviceTypeGetResponseTop0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPLocationDeviceTypeGetResponseTop0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPLocationDeviceTypeGetParams 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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarHTTPLocationDeviceTypeGetParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Format results are returned in.
- Format param.Field[RadarHTTPLocationDeviceTypeGetParamsFormat] `query:"format"`
- // Filter for http protocol.
- HTTPProtocol param.Field[[]RadarHTTPLocationDeviceTypeGetParamsHTTPProtocol] `query:"httpProtocol"`
- // Filter for http version.
- HTTPVersion param.Field[[]RadarHTTPLocationDeviceTypeGetParamsHTTPVersion] `query:"httpVersion"`
- // Filter for ip version.
- IPVersion param.Field[[]RadarHTTPLocationDeviceTypeGetParamsIPVersion] `query:"ipVersion"`
- // 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 os name.
- OS param.Field[[]RadarHTTPLocationDeviceTypeGetParamsOS] `query:"os"`
- // Filter for tls version.
- TLSVersion param.Field[[]RadarHTTPLocationDeviceTypeGetParamsTLSVersion] `query:"tlsVersion"`
-}
-
-// URLQuery serializes [RadarHTTPLocationDeviceTypeGetParams]'s query parameters as
-// `url.Values`.
-func (r RadarHTTPLocationDeviceTypeGetParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Device type.
-type RadarHTTPLocationDeviceTypeGetParamsDeviceType string
-
-const (
- RadarHTTPLocationDeviceTypeGetParamsDeviceTypeDesktop RadarHTTPLocationDeviceTypeGetParamsDeviceType = "DESKTOP"
- RadarHTTPLocationDeviceTypeGetParamsDeviceTypeMobile RadarHTTPLocationDeviceTypeGetParamsDeviceType = "MOBILE"
- RadarHTTPLocationDeviceTypeGetParamsDeviceTypeOther RadarHTTPLocationDeviceTypeGetParamsDeviceType = "OTHER"
-)
-
-type RadarHTTPLocationDeviceTypeGetParamsBotClass string
-
-const (
- RadarHTTPLocationDeviceTypeGetParamsBotClassLikelyAutomated RadarHTTPLocationDeviceTypeGetParamsBotClass = "LIKELY_AUTOMATED"
- RadarHTTPLocationDeviceTypeGetParamsBotClassLikelyHuman RadarHTTPLocationDeviceTypeGetParamsBotClass = "LIKELY_HUMAN"
-)
-
-type RadarHTTPLocationDeviceTypeGetParamsDateRange string
-
-const (
- RadarHTTPLocationDeviceTypeGetParamsDateRange1d RadarHTTPLocationDeviceTypeGetParamsDateRange = "1d"
- RadarHTTPLocationDeviceTypeGetParamsDateRange2d RadarHTTPLocationDeviceTypeGetParamsDateRange = "2d"
- RadarHTTPLocationDeviceTypeGetParamsDateRange7d RadarHTTPLocationDeviceTypeGetParamsDateRange = "7d"
- RadarHTTPLocationDeviceTypeGetParamsDateRange14d RadarHTTPLocationDeviceTypeGetParamsDateRange = "14d"
- RadarHTTPLocationDeviceTypeGetParamsDateRange28d RadarHTTPLocationDeviceTypeGetParamsDateRange = "28d"
- RadarHTTPLocationDeviceTypeGetParamsDateRange12w RadarHTTPLocationDeviceTypeGetParamsDateRange = "12w"
- RadarHTTPLocationDeviceTypeGetParamsDateRange24w RadarHTTPLocationDeviceTypeGetParamsDateRange = "24w"
- RadarHTTPLocationDeviceTypeGetParamsDateRange52w RadarHTTPLocationDeviceTypeGetParamsDateRange = "52w"
- RadarHTTPLocationDeviceTypeGetParamsDateRange1dControl RadarHTTPLocationDeviceTypeGetParamsDateRange = "1dControl"
- RadarHTTPLocationDeviceTypeGetParamsDateRange2dControl RadarHTTPLocationDeviceTypeGetParamsDateRange = "2dControl"
- RadarHTTPLocationDeviceTypeGetParamsDateRange7dControl RadarHTTPLocationDeviceTypeGetParamsDateRange = "7dControl"
- RadarHTTPLocationDeviceTypeGetParamsDateRange14dControl RadarHTTPLocationDeviceTypeGetParamsDateRange = "14dControl"
- RadarHTTPLocationDeviceTypeGetParamsDateRange28dControl RadarHTTPLocationDeviceTypeGetParamsDateRange = "28dControl"
- RadarHTTPLocationDeviceTypeGetParamsDateRange12wControl RadarHTTPLocationDeviceTypeGetParamsDateRange = "12wControl"
- RadarHTTPLocationDeviceTypeGetParamsDateRange24wControl RadarHTTPLocationDeviceTypeGetParamsDateRange = "24wControl"
-)
-
-// Format results are returned in.
-type RadarHTTPLocationDeviceTypeGetParamsFormat string
-
-const (
- RadarHTTPLocationDeviceTypeGetParamsFormatJson RadarHTTPLocationDeviceTypeGetParamsFormat = "JSON"
- RadarHTTPLocationDeviceTypeGetParamsFormatCsv RadarHTTPLocationDeviceTypeGetParamsFormat = "CSV"
-)
-
-type RadarHTTPLocationDeviceTypeGetParamsHTTPProtocol string
-
-const (
- RadarHTTPLocationDeviceTypeGetParamsHTTPProtocolHTTP RadarHTTPLocationDeviceTypeGetParamsHTTPProtocol = "HTTP"
- RadarHTTPLocationDeviceTypeGetParamsHTTPProtocolHTTPS RadarHTTPLocationDeviceTypeGetParamsHTTPProtocol = "HTTPS"
-)
-
-type RadarHTTPLocationDeviceTypeGetParamsHTTPVersion string
-
-const (
- RadarHTTPLocationDeviceTypeGetParamsHTTPVersionHttPv1 RadarHTTPLocationDeviceTypeGetParamsHTTPVersion = "HTTPv1"
- RadarHTTPLocationDeviceTypeGetParamsHTTPVersionHttPv2 RadarHTTPLocationDeviceTypeGetParamsHTTPVersion = "HTTPv2"
- RadarHTTPLocationDeviceTypeGetParamsHTTPVersionHttPv3 RadarHTTPLocationDeviceTypeGetParamsHTTPVersion = "HTTPv3"
-)
-
-type RadarHTTPLocationDeviceTypeGetParamsIPVersion string
-
-const (
- RadarHTTPLocationDeviceTypeGetParamsIPVersionIPv4 RadarHTTPLocationDeviceTypeGetParamsIPVersion = "IPv4"
- RadarHTTPLocationDeviceTypeGetParamsIPVersionIPv6 RadarHTTPLocationDeviceTypeGetParamsIPVersion = "IPv6"
-)
-
-type RadarHTTPLocationDeviceTypeGetParamsOS string
-
-const (
- RadarHTTPLocationDeviceTypeGetParamsOSWindows RadarHTTPLocationDeviceTypeGetParamsOS = "WINDOWS"
- RadarHTTPLocationDeviceTypeGetParamsOSMacosx RadarHTTPLocationDeviceTypeGetParamsOS = "MACOSX"
- RadarHTTPLocationDeviceTypeGetParamsOSIos RadarHTTPLocationDeviceTypeGetParamsOS = "IOS"
- RadarHTTPLocationDeviceTypeGetParamsOSAndroid RadarHTTPLocationDeviceTypeGetParamsOS = "ANDROID"
- RadarHTTPLocationDeviceTypeGetParamsOSChromeos RadarHTTPLocationDeviceTypeGetParamsOS = "CHROMEOS"
- RadarHTTPLocationDeviceTypeGetParamsOSLinux RadarHTTPLocationDeviceTypeGetParamsOS = "LINUX"
- RadarHTTPLocationDeviceTypeGetParamsOSSmartTv RadarHTTPLocationDeviceTypeGetParamsOS = "SMART_TV"
-)
-
-type RadarHTTPLocationDeviceTypeGetParamsTLSVersion string
-
-const (
- RadarHTTPLocationDeviceTypeGetParamsTLSVersionTlSv1_0 RadarHTTPLocationDeviceTypeGetParamsTLSVersion = "TLSv1_0"
- RadarHTTPLocationDeviceTypeGetParamsTLSVersionTlSv1_1 RadarHTTPLocationDeviceTypeGetParamsTLSVersion = "TLSv1_1"
- RadarHTTPLocationDeviceTypeGetParamsTLSVersionTlSv1_2 RadarHTTPLocationDeviceTypeGetParamsTLSVersion = "TLSv1_2"
- RadarHTTPLocationDeviceTypeGetParamsTLSVersionTlSv1_3 RadarHTTPLocationDeviceTypeGetParamsTLSVersion = "TLSv1_3"
- RadarHTTPLocationDeviceTypeGetParamsTLSVersionTlSvQuic RadarHTTPLocationDeviceTypeGetParamsTLSVersion = "TLSvQUIC"
-)
-
-type RadarHTTPLocationDeviceTypeGetResponseEnvelope struct {
- Result RadarHTTPLocationDeviceTypeGetResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarHTTPLocationDeviceTypeGetResponseEnvelopeJSON `json:"-"`
-}
-
-// radarHTTPLocationDeviceTypeGetResponseEnvelopeJSON contains the JSON metadata
-// for the struct [RadarHTTPLocationDeviceTypeGetResponseEnvelope]
-type radarHTTPLocationDeviceTypeGetResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPLocationDeviceTypeGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPLocationDeviceTypeGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
diff --git a/radarhttplocationdevicetype_test.go b/radarhttplocationdevicetype_test.go
deleted file mode 100644
index b67fa5a85ed..00000000000
--- a/radarhttplocationdevicetype_test.go
+++ /dev/null
@@ -1,59 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
- "time"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRadarHTTPLocationDeviceTypeGetWithOptionalParams(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"),
- )
- _, err := client.Radar.HTTP.Locations.DeviceType.Get(
- context.TODO(),
- cloudflare.RadarHTTPLocationDeviceTypeGetParamsDeviceTypeDesktop,
- 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()}),
- Format: cloudflare.F(cloudflare.RadarHTTPLocationDeviceTypeGetParamsFormatJson),
- HTTPProtocol: cloudflare.F([]cloudflare.RadarHTTPLocationDeviceTypeGetParamsHTTPProtocol{cloudflare.RadarHTTPLocationDeviceTypeGetParamsHTTPProtocolHTTP, cloudflare.RadarHTTPLocationDeviceTypeGetParamsHTTPProtocolHTTPS}),
- HTTPVersion: cloudflare.F([]cloudflare.RadarHTTPLocationDeviceTypeGetParamsHTTPVersion{cloudflare.RadarHTTPLocationDeviceTypeGetParamsHTTPVersionHttPv1, cloudflare.RadarHTTPLocationDeviceTypeGetParamsHTTPVersionHttPv2, cloudflare.RadarHTTPLocationDeviceTypeGetParamsHTTPVersionHttPv3}),
- IPVersion: cloudflare.F([]cloudflare.RadarHTTPLocationDeviceTypeGetParamsIPVersion{cloudflare.RadarHTTPLocationDeviceTypeGetParamsIPVersionIPv4, cloudflare.RadarHTTPLocationDeviceTypeGetParamsIPVersionIPv6}),
- Limit: cloudflare.F(int64(5)),
- Location: cloudflare.F([]string{"string", "string", "string"}),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- OS: cloudflare.F([]cloudflare.RadarHTTPLocationDeviceTypeGetParamsOS{cloudflare.RadarHTTPLocationDeviceTypeGetParamsOSWindows, cloudflare.RadarHTTPLocationDeviceTypeGetParamsOSMacosx, cloudflare.RadarHTTPLocationDeviceTypeGetParamsOSIos}),
- TLSVersion: cloudflare.F([]cloudflare.RadarHTTPLocationDeviceTypeGetParamsTLSVersion{cloudflare.RadarHTTPLocationDeviceTypeGetParamsTLSVersionTlSv1_0, cloudflare.RadarHTTPLocationDeviceTypeGetParamsTLSVersionTlSv1_1, cloudflare.RadarHTTPLocationDeviceTypeGetParamsTLSVersionTlSv1_2}),
- },
- )
- 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/radarhttplocationhttpmethod.go b/radarhttplocationhttpmethod.go
deleted file mode 100644
index e8c5aef1836..00000000000
--- a/radarhttplocationhttpmethod.go
+++ /dev/null
@@ -1,367 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarHTTPLocationHTTPMethodService contains methods and other services that help
-// with interacting with the cloudflare API. Note, unlike clients, this service
-// does not read variables from the environment automatically. You should not
-// instantiate this service directly, and instead use the
-// [NewRadarHTTPLocationHTTPMethodService] method instead.
-type RadarHTTPLocationHTTPMethodService struct {
- Options []option.RequestOption
-}
-
-// NewRadarHTTPLocationHTTPMethodService generates a new service that applies the
-// given options to each request. These options are applied after the parent
-// client's options (if there is one), and before any request-specific options.
-func NewRadarHTTPLocationHTTPMethodService(opts ...option.RequestOption) (r *RadarHTTPLocationHTTPMethodService) {
- r = &RadarHTTPLocationHTTPMethodService{}
- r.Options = opts
- return
-}
-
-// Get the top locations, by HTTP traffic, of the requested HTTP protocol. Values
-// are a percentage out of the total traffic.
-func (r *RadarHTTPLocationHTTPMethodService) Get(ctx context.Context, httpVersion RadarHTTPLocationHTTPMethodGetParamsHTTPVersion, query RadarHTTPLocationHTTPMethodGetParams, opts ...option.RequestOption) (res *RadarHTTPLocationHTTPMethodGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarHTTPLocationHTTPMethodGetResponseEnvelope
- path := fmt.Sprintf("radar/http/top/locations/http_version/%v", httpVersion)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type RadarHTTPLocationHTTPMethodGetResponse struct {
- Meta RadarHTTPLocationHTTPMethodGetResponseMeta `json:"meta,required"`
- Top0 []RadarHTTPLocationHTTPMethodGetResponseTop0 `json:"top_0,required"`
- JSON radarHTTPLocationHTTPMethodGetResponseJSON `json:"-"`
-}
-
-// radarHTTPLocationHTTPMethodGetResponseJSON contains the JSON metadata for the
-// struct [RadarHTTPLocationHTTPMethodGetResponse]
-type radarHTTPLocationHTTPMethodGetResponseJSON struct {
- Meta apijson.Field
- Top0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPLocationHTTPMethodGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPLocationHTTPMethodGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPLocationHTTPMethodGetResponseMeta struct {
- DateRange []RadarHTTPLocationHTTPMethodGetResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- ConfidenceInfo RadarHTTPLocationHTTPMethodGetResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarHTTPLocationHTTPMethodGetResponseMetaJSON `json:"-"`
-}
-
-// radarHTTPLocationHTTPMethodGetResponseMetaJSON contains the JSON metadata for
-// the struct [RadarHTTPLocationHTTPMethodGetResponseMeta]
-type radarHTTPLocationHTTPMethodGetResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPLocationHTTPMethodGetResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPLocationHTTPMethodGetResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPLocationHTTPMethodGetResponseMetaDateRange 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 radarHTTPLocationHTTPMethodGetResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarHTTPLocationHTTPMethodGetResponseMetaDateRangeJSON contains the JSON
-// metadata for the struct [RadarHTTPLocationHTTPMethodGetResponseMetaDateRange]
-type radarHTTPLocationHTTPMethodGetResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPLocationHTTPMethodGetResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPLocationHTTPMethodGetResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPLocationHTTPMethodGetResponseMetaConfidenceInfo struct {
- Annotations []RadarHTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarHTTPLocationHTTPMethodGetResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarHTTPLocationHTTPMethodGetResponseMetaConfidenceInfoJSON contains the JSON
-// metadata for the struct
-// [RadarHTTPLocationHTTPMethodGetResponseMetaConfidenceInfo]
-type radarHTTPLocationHTTPMethodGetResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPLocationHTTPMethodGetResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPLocationHTTPMethodGetResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotation 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 radarHTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarHTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotationJSON contains
-// the JSON metadata for the struct
-// [RadarHTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotation]
-type radarHTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotationJSON 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 *RadarHTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPLocationHTTPMethodGetResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPLocationHTTPMethodGetResponseTop0 struct {
- ClientCountryAlpha2 string `json:"clientCountryAlpha2,required"`
- ClientCountryName string `json:"clientCountryName,required"`
- Value string `json:"value,required"`
- JSON radarHTTPLocationHTTPMethodGetResponseTop0JSON `json:"-"`
-}
-
-// radarHTTPLocationHTTPMethodGetResponseTop0JSON contains the JSON metadata for
-// the struct [RadarHTTPLocationHTTPMethodGetResponseTop0]
-type radarHTTPLocationHTTPMethodGetResponseTop0JSON struct {
- ClientCountryAlpha2 apijson.Field
- ClientCountryName apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPLocationHTTPMethodGetResponseTop0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPLocationHTTPMethodGetResponseTop0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPLocationHTTPMethodGetParams 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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarHTTPLocationHTTPMethodGetParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Filter for device type.
- DeviceType param.Field[[]RadarHTTPLocationHTTPMethodGetParamsDeviceType] `query:"deviceType"`
- // Format results are returned in.
- Format param.Field[RadarHTTPLocationHTTPMethodGetParamsFormat] `query:"format"`
- // Filter for http protocol.
- HTTPProtocol param.Field[[]RadarHTTPLocationHTTPMethodGetParamsHTTPProtocol] `query:"httpProtocol"`
- // Filter for ip version.
- IPVersion param.Field[[]RadarHTTPLocationHTTPMethodGetParamsIPVersion] `query:"ipVersion"`
- // 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 os name.
- OS param.Field[[]RadarHTTPLocationHTTPMethodGetParamsOS] `query:"os"`
- // Filter for tls version.
- TLSVersion param.Field[[]RadarHTTPLocationHTTPMethodGetParamsTLSVersion] `query:"tlsVersion"`
-}
-
-// URLQuery serializes [RadarHTTPLocationHTTPMethodGetParams]'s query parameters as
-// `url.Values`.
-func (r RadarHTTPLocationHTTPMethodGetParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// HTTP version.
-type RadarHTTPLocationHTTPMethodGetParamsHTTPVersion string
-
-const (
- RadarHTTPLocationHTTPMethodGetParamsHTTPVersionHttPv1 RadarHTTPLocationHTTPMethodGetParamsHTTPVersion = "HTTPv1"
- RadarHTTPLocationHTTPMethodGetParamsHTTPVersionHttPv2 RadarHTTPLocationHTTPMethodGetParamsHTTPVersion = "HTTPv2"
- RadarHTTPLocationHTTPMethodGetParamsHTTPVersionHttPv3 RadarHTTPLocationHTTPMethodGetParamsHTTPVersion = "HTTPv3"
-)
-
-type RadarHTTPLocationHTTPMethodGetParamsBotClass string
-
-const (
- RadarHTTPLocationHTTPMethodGetParamsBotClassLikelyAutomated RadarHTTPLocationHTTPMethodGetParamsBotClass = "LIKELY_AUTOMATED"
- RadarHTTPLocationHTTPMethodGetParamsBotClassLikelyHuman RadarHTTPLocationHTTPMethodGetParamsBotClass = "LIKELY_HUMAN"
-)
-
-type RadarHTTPLocationHTTPMethodGetParamsDateRange string
-
-const (
- RadarHTTPLocationHTTPMethodGetParamsDateRange1d RadarHTTPLocationHTTPMethodGetParamsDateRange = "1d"
- RadarHTTPLocationHTTPMethodGetParamsDateRange2d RadarHTTPLocationHTTPMethodGetParamsDateRange = "2d"
- RadarHTTPLocationHTTPMethodGetParamsDateRange7d RadarHTTPLocationHTTPMethodGetParamsDateRange = "7d"
- RadarHTTPLocationHTTPMethodGetParamsDateRange14d RadarHTTPLocationHTTPMethodGetParamsDateRange = "14d"
- RadarHTTPLocationHTTPMethodGetParamsDateRange28d RadarHTTPLocationHTTPMethodGetParamsDateRange = "28d"
- RadarHTTPLocationHTTPMethodGetParamsDateRange12w RadarHTTPLocationHTTPMethodGetParamsDateRange = "12w"
- RadarHTTPLocationHTTPMethodGetParamsDateRange24w RadarHTTPLocationHTTPMethodGetParamsDateRange = "24w"
- RadarHTTPLocationHTTPMethodGetParamsDateRange52w RadarHTTPLocationHTTPMethodGetParamsDateRange = "52w"
- RadarHTTPLocationHTTPMethodGetParamsDateRange1dControl RadarHTTPLocationHTTPMethodGetParamsDateRange = "1dControl"
- RadarHTTPLocationHTTPMethodGetParamsDateRange2dControl RadarHTTPLocationHTTPMethodGetParamsDateRange = "2dControl"
- RadarHTTPLocationHTTPMethodGetParamsDateRange7dControl RadarHTTPLocationHTTPMethodGetParamsDateRange = "7dControl"
- RadarHTTPLocationHTTPMethodGetParamsDateRange14dControl RadarHTTPLocationHTTPMethodGetParamsDateRange = "14dControl"
- RadarHTTPLocationHTTPMethodGetParamsDateRange28dControl RadarHTTPLocationHTTPMethodGetParamsDateRange = "28dControl"
- RadarHTTPLocationHTTPMethodGetParamsDateRange12wControl RadarHTTPLocationHTTPMethodGetParamsDateRange = "12wControl"
- RadarHTTPLocationHTTPMethodGetParamsDateRange24wControl RadarHTTPLocationHTTPMethodGetParamsDateRange = "24wControl"
-)
-
-type RadarHTTPLocationHTTPMethodGetParamsDeviceType string
-
-const (
- RadarHTTPLocationHTTPMethodGetParamsDeviceTypeDesktop RadarHTTPLocationHTTPMethodGetParamsDeviceType = "DESKTOP"
- RadarHTTPLocationHTTPMethodGetParamsDeviceTypeMobile RadarHTTPLocationHTTPMethodGetParamsDeviceType = "MOBILE"
- RadarHTTPLocationHTTPMethodGetParamsDeviceTypeOther RadarHTTPLocationHTTPMethodGetParamsDeviceType = "OTHER"
-)
-
-// Format results are returned in.
-type RadarHTTPLocationHTTPMethodGetParamsFormat string
-
-const (
- RadarHTTPLocationHTTPMethodGetParamsFormatJson RadarHTTPLocationHTTPMethodGetParamsFormat = "JSON"
- RadarHTTPLocationHTTPMethodGetParamsFormatCsv RadarHTTPLocationHTTPMethodGetParamsFormat = "CSV"
-)
-
-type RadarHTTPLocationHTTPMethodGetParamsHTTPProtocol string
-
-const (
- RadarHTTPLocationHTTPMethodGetParamsHTTPProtocolHTTP RadarHTTPLocationHTTPMethodGetParamsHTTPProtocol = "HTTP"
- RadarHTTPLocationHTTPMethodGetParamsHTTPProtocolHTTPS RadarHTTPLocationHTTPMethodGetParamsHTTPProtocol = "HTTPS"
-)
-
-type RadarHTTPLocationHTTPMethodGetParamsIPVersion string
-
-const (
- RadarHTTPLocationHTTPMethodGetParamsIPVersionIPv4 RadarHTTPLocationHTTPMethodGetParamsIPVersion = "IPv4"
- RadarHTTPLocationHTTPMethodGetParamsIPVersionIPv6 RadarHTTPLocationHTTPMethodGetParamsIPVersion = "IPv6"
-)
-
-type RadarHTTPLocationHTTPMethodGetParamsOS string
-
-const (
- RadarHTTPLocationHTTPMethodGetParamsOSWindows RadarHTTPLocationHTTPMethodGetParamsOS = "WINDOWS"
- RadarHTTPLocationHTTPMethodGetParamsOSMacosx RadarHTTPLocationHTTPMethodGetParamsOS = "MACOSX"
- RadarHTTPLocationHTTPMethodGetParamsOSIos RadarHTTPLocationHTTPMethodGetParamsOS = "IOS"
- RadarHTTPLocationHTTPMethodGetParamsOSAndroid RadarHTTPLocationHTTPMethodGetParamsOS = "ANDROID"
- RadarHTTPLocationHTTPMethodGetParamsOSChromeos RadarHTTPLocationHTTPMethodGetParamsOS = "CHROMEOS"
- RadarHTTPLocationHTTPMethodGetParamsOSLinux RadarHTTPLocationHTTPMethodGetParamsOS = "LINUX"
- RadarHTTPLocationHTTPMethodGetParamsOSSmartTv RadarHTTPLocationHTTPMethodGetParamsOS = "SMART_TV"
-)
-
-type RadarHTTPLocationHTTPMethodGetParamsTLSVersion string
-
-const (
- RadarHTTPLocationHTTPMethodGetParamsTLSVersionTlSv1_0 RadarHTTPLocationHTTPMethodGetParamsTLSVersion = "TLSv1_0"
- RadarHTTPLocationHTTPMethodGetParamsTLSVersionTlSv1_1 RadarHTTPLocationHTTPMethodGetParamsTLSVersion = "TLSv1_1"
- RadarHTTPLocationHTTPMethodGetParamsTLSVersionTlSv1_2 RadarHTTPLocationHTTPMethodGetParamsTLSVersion = "TLSv1_2"
- RadarHTTPLocationHTTPMethodGetParamsTLSVersionTlSv1_3 RadarHTTPLocationHTTPMethodGetParamsTLSVersion = "TLSv1_3"
- RadarHTTPLocationHTTPMethodGetParamsTLSVersionTlSvQuic RadarHTTPLocationHTTPMethodGetParamsTLSVersion = "TLSvQUIC"
-)
-
-type RadarHTTPLocationHTTPMethodGetResponseEnvelope struct {
- Result RadarHTTPLocationHTTPMethodGetResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarHTTPLocationHTTPMethodGetResponseEnvelopeJSON `json:"-"`
-}
-
-// radarHTTPLocationHTTPMethodGetResponseEnvelopeJSON contains the JSON metadata
-// for the struct [RadarHTTPLocationHTTPMethodGetResponseEnvelope]
-type radarHTTPLocationHTTPMethodGetResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPLocationHTTPMethodGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPLocationHTTPMethodGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
diff --git a/radarhttplocationhttpmethod_test.go b/radarhttplocationhttpmethod_test.go
deleted file mode 100644
index 6e9c7d078c9..00000000000
--- a/radarhttplocationhttpmethod_test.go
+++ /dev/null
@@ -1,59 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
- "time"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRadarHTTPLocationHTTPMethodGetWithOptionalParams(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"),
- )
- _, err := client.Radar.HTTP.Locations.HTTPMethod.Get(
- context.TODO(),
- cloudflare.RadarHTTPLocationHTTPMethodGetParamsHTTPVersionHttPv1,
- 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()}),
- DeviceType: cloudflare.F([]cloudflare.RadarHTTPLocationHTTPMethodGetParamsDeviceType{cloudflare.RadarHTTPLocationHTTPMethodGetParamsDeviceTypeDesktop, cloudflare.RadarHTTPLocationHTTPMethodGetParamsDeviceTypeMobile, cloudflare.RadarHTTPLocationHTTPMethodGetParamsDeviceTypeOther}),
- Format: cloudflare.F(cloudflare.RadarHTTPLocationHTTPMethodGetParamsFormatJson),
- HTTPProtocol: cloudflare.F([]cloudflare.RadarHTTPLocationHTTPMethodGetParamsHTTPProtocol{cloudflare.RadarHTTPLocationHTTPMethodGetParamsHTTPProtocolHTTP, cloudflare.RadarHTTPLocationHTTPMethodGetParamsHTTPProtocolHTTPS}),
- IPVersion: cloudflare.F([]cloudflare.RadarHTTPLocationHTTPMethodGetParamsIPVersion{cloudflare.RadarHTTPLocationHTTPMethodGetParamsIPVersionIPv4, cloudflare.RadarHTTPLocationHTTPMethodGetParamsIPVersionIPv6}),
- Limit: cloudflare.F(int64(5)),
- Location: cloudflare.F([]string{"string", "string", "string"}),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- OS: cloudflare.F([]cloudflare.RadarHTTPLocationHTTPMethodGetParamsOS{cloudflare.RadarHTTPLocationHTTPMethodGetParamsOSWindows, cloudflare.RadarHTTPLocationHTTPMethodGetParamsOSMacosx, cloudflare.RadarHTTPLocationHTTPMethodGetParamsOSIos}),
- TLSVersion: cloudflare.F([]cloudflare.RadarHTTPLocationHTTPMethodGetParamsTLSVersion{cloudflare.RadarHTTPLocationHTTPMethodGetParamsTLSVersionTlSv1_0, cloudflare.RadarHTTPLocationHTTPMethodGetParamsTLSVersionTlSv1_1, cloudflare.RadarHTTPLocationHTTPMethodGetParamsTLSVersionTlSv1_2}),
- },
- )
- 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/radarhttplocationhttpprotocol.go b/radarhttplocationhttpprotocol.go
deleted file mode 100644
index 1d0ac9a87dc..00000000000
--- a/radarhttplocationhttpprotocol.go
+++ /dev/null
@@ -1,357 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarHTTPLocationHTTPProtocolService contains methods and other services that
-// help with interacting with the cloudflare API. Note, unlike clients, this
-// service does not read variables from the environment automatically. You should
-// not instantiate this service directly, and instead use the
-// [NewRadarHTTPLocationHTTPProtocolService] method instead.
-type RadarHTTPLocationHTTPProtocolService struct {
- Options []option.RequestOption
-}
-
-// NewRadarHTTPLocationHTTPProtocolService generates a new service that applies the
-// given options to each request. These options are applied after the parent
-// client's options (if there is one), and before any request-specific options.
-func NewRadarHTTPLocationHTTPProtocolService(opts ...option.RequestOption) (r *RadarHTTPLocationHTTPProtocolService) {
- r = &RadarHTTPLocationHTTPProtocolService{}
- r.Options = opts
- return
-}
-
-// Get the top locations, by HTTP traffic, of the requested HTTP protocol. Values
-// are a percentage out of the total traffic.
-func (r *RadarHTTPLocationHTTPProtocolService) Get(ctx context.Context, httpProtocol RadarHTTPLocationHTTPProtocolGetParamsHTTPProtocol, query RadarHTTPLocationHTTPProtocolGetParams, opts ...option.RequestOption) (res *RadarHTTPLocationHTTPProtocolGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarHTTPLocationHTTPProtocolGetResponseEnvelope
- path := fmt.Sprintf("radar/http/top/locations/http_protocol/%v", httpProtocol)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type RadarHTTPLocationHTTPProtocolGetResponse struct {
- Meta RadarHTTPLocationHTTPProtocolGetResponseMeta `json:"meta,required"`
- Top0 []RadarHTTPLocationHTTPProtocolGetResponseTop0 `json:"top_0,required"`
- JSON radarHTTPLocationHTTPProtocolGetResponseJSON `json:"-"`
-}
-
-// radarHTTPLocationHTTPProtocolGetResponseJSON contains the JSON metadata for the
-// struct [RadarHTTPLocationHTTPProtocolGetResponse]
-type radarHTTPLocationHTTPProtocolGetResponseJSON struct {
- Meta apijson.Field
- Top0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPLocationHTTPProtocolGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPLocationHTTPProtocolGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPLocationHTTPProtocolGetResponseMeta struct {
- DateRange []RadarHTTPLocationHTTPProtocolGetResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- ConfidenceInfo RadarHTTPLocationHTTPProtocolGetResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarHTTPLocationHTTPProtocolGetResponseMetaJSON `json:"-"`
-}
-
-// radarHTTPLocationHTTPProtocolGetResponseMetaJSON contains the JSON metadata for
-// the struct [RadarHTTPLocationHTTPProtocolGetResponseMeta]
-type radarHTTPLocationHTTPProtocolGetResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPLocationHTTPProtocolGetResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPLocationHTTPProtocolGetResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPLocationHTTPProtocolGetResponseMetaDateRange 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 radarHTTPLocationHTTPProtocolGetResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarHTTPLocationHTTPProtocolGetResponseMetaDateRangeJSON contains the JSON
-// metadata for the struct [RadarHTTPLocationHTTPProtocolGetResponseMetaDateRange]
-type radarHTTPLocationHTTPProtocolGetResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPLocationHTTPProtocolGetResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPLocationHTTPProtocolGetResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPLocationHTTPProtocolGetResponseMetaConfidenceInfo struct {
- Annotations []RadarHTTPLocationHTTPProtocolGetResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarHTTPLocationHTTPProtocolGetResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarHTTPLocationHTTPProtocolGetResponseMetaConfidenceInfoJSON contains the JSON
-// metadata for the struct
-// [RadarHTTPLocationHTTPProtocolGetResponseMetaConfidenceInfo]
-type radarHTTPLocationHTTPProtocolGetResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPLocationHTTPProtocolGetResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPLocationHTTPProtocolGetResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPLocationHTTPProtocolGetResponseMetaConfidenceInfoAnnotation 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 radarHTTPLocationHTTPProtocolGetResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarHTTPLocationHTTPProtocolGetResponseMetaConfidenceInfoAnnotationJSON
-// contains the JSON metadata for the struct
-// [RadarHTTPLocationHTTPProtocolGetResponseMetaConfidenceInfoAnnotation]
-type radarHTTPLocationHTTPProtocolGetResponseMetaConfidenceInfoAnnotationJSON 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 *RadarHTTPLocationHTTPProtocolGetResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPLocationHTTPProtocolGetResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPLocationHTTPProtocolGetResponseTop0 struct {
- ClientCountryAlpha2 string `json:"clientCountryAlpha2,required"`
- ClientCountryName string `json:"clientCountryName,required"`
- Value string `json:"value,required"`
- JSON radarHTTPLocationHTTPProtocolGetResponseTop0JSON `json:"-"`
-}
-
-// radarHTTPLocationHTTPProtocolGetResponseTop0JSON contains the JSON metadata for
-// the struct [RadarHTTPLocationHTTPProtocolGetResponseTop0]
-type radarHTTPLocationHTTPProtocolGetResponseTop0JSON struct {
- ClientCountryAlpha2 apijson.Field
- ClientCountryName apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPLocationHTTPProtocolGetResponseTop0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPLocationHTTPProtocolGetResponseTop0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPLocationHTTPProtocolGetParams 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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarHTTPLocationHTTPProtocolGetParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Filter for device type.
- DeviceType param.Field[[]RadarHTTPLocationHTTPProtocolGetParamsDeviceType] `query:"deviceType"`
- // Format results are returned in.
- Format param.Field[RadarHTTPLocationHTTPProtocolGetParamsFormat] `query:"format"`
- // Filter for ip version.
- IPVersion param.Field[[]RadarHTTPLocationHTTPProtocolGetParamsIPVersion] `query:"ipVersion"`
- // 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 os name.
- OS param.Field[[]RadarHTTPLocationHTTPProtocolGetParamsOS] `query:"os"`
- // Filter for tls version.
- TLSVersion param.Field[[]RadarHTTPLocationHTTPProtocolGetParamsTLSVersion] `query:"tlsVersion"`
-}
-
-// URLQuery serializes [RadarHTTPLocationHTTPProtocolGetParams]'s query parameters
-// as `url.Values`.
-func (r RadarHTTPLocationHTTPProtocolGetParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// HTTP Protocol.
-type RadarHTTPLocationHTTPProtocolGetParamsHTTPProtocol string
-
-const (
- RadarHTTPLocationHTTPProtocolGetParamsHTTPProtocolHTTP RadarHTTPLocationHTTPProtocolGetParamsHTTPProtocol = "HTTP"
- RadarHTTPLocationHTTPProtocolGetParamsHTTPProtocolHTTPS RadarHTTPLocationHTTPProtocolGetParamsHTTPProtocol = "HTTPS"
-)
-
-type RadarHTTPLocationHTTPProtocolGetParamsBotClass string
-
-const (
- RadarHTTPLocationHTTPProtocolGetParamsBotClassLikelyAutomated RadarHTTPLocationHTTPProtocolGetParamsBotClass = "LIKELY_AUTOMATED"
- RadarHTTPLocationHTTPProtocolGetParamsBotClassLikelyHuman RadarHTTPLocationHTTPProtocolGetParamsBotClass = "LIKELY_HUMAN"
-)
-
-type RadarHTTPLocationHTTPProtocolGetParamsDateRange string
-
-const (
- RadarHTTPLocationHTTPProtocolGetParamsDateRange1d RadarHTTPLocationHTTPProtocolGetParamsDateRange = "1d"
- RadarHTTPLocationHTTPProtocolGetParamsDateRange2d RadarHTTPLocationHTTPProtocolGetParamsDateRange = "2d"
- RadarHTTPLocationHTTPProtocolGetParamsDateRange7d RadarHTTPLocationHTTPProtocolGetParamsDateRange = "7d"
- RadarHTTPLocationHTTPProtocolGetParamsDateRange14d RadarHTTPLocationHTTPProtocolGetParamsDateRange = "14d"
- RadarHTTPLocationHTTPProtocolGetParamsDateRange28d RadarHTTPLocationHTTPProtocolGetParamsDateRange = "28d"
- RadarHTTPLocationHTTPProtocolGetParamsDateRange12w RadarHTTPLocationHTTPProtocolGetParamsDateRange = "12w"
- RadarHTTPLocationHTTPProtocolGetParamsDateRange24w RadarHTTPLocationHTTPProtocolGetParamsDateRange = "24w"
- RadarHTTPLocationHTTPProtocolGetParamsDateRange52w RadarHTTPLocationHTTPProtocolGetParamsDateRange = "52w"
- RadarHTTPLocationHTTPProtocolGetParamsDateRange1dControl RadarHTTPLocationHTTPProtocolGetParamsDateRange = "1dControl"
- RadarHTTPLocationHTTPProtocolGetParamsDateRange2dControl RadarHTTPLocationHTTPProtocolGetParamsDateRange = "2dControl"
- RadarHTTPLocationHTTPProtocolGetParamsDateRange7dControl RadarHTTPLocationHTTPProtocolGetParamsDateRange = "7dControl"
- RadarHTTPLocationHTTPProtocolGetParamsDateRange14dControl RadarHTTPLocationHTTPProtocolGetParamsDateRange = "14dControl"
- RadarHTTPLocationHTTPProtocolGetParamsDateRange28dControl RadarHTTPLocationHTTPProtocolGetParamsDateRange = "28dControl"
- RadarHTTPLocationHTTPProtocolGetParamsDateRange12wControl RadarHTTPLocationHTTPProtocolGetParamsDateRange = "12wControl"
- RadarHTTPLocationHTTPProtocolGetParamsDateRange24wControl RadarHTTPLocationHTTPProtocolGetParamsDateRange = "24wControl"
-)
-
-type RadarHTTPLocationHTTPProtocolGetParamsDeviceType string
-
-const (
- RadarHTTPLocationHTTPProtocolGetParamsDeviceTypeDesktop RadarHTTPLocationHTTPProtocolGetParamsDeviceType = "DESKTOP"
- RadarHTTPLocationHTTPProtocolGetParamsDeviceTypeMobile RadarHTTPLocationHTTPProtocolGetParamsDeviceType = "MOBILE"
- RadarHTTPLocationHTTPProtocolGetParamsDeviceTypeOther RadarHTTPLocationHTTPProtocolGetParamsDeviceType = "OTHER"
-)
-
-// Format results are returned in.
-type RadarHTTPLocationHTTPProtocolGetParamsFormat string
-
-const (
- RadarHTTPLocationHTTPProtocolGetParamsFormatJson RadarHTTPLocationHTTPProtocolGetParamsFormat = "JSON"
- RadarHTTPLocationHTTPProtocolGetParamsFormatCsv RadarHTTPLocationHTTPProtocolGetParamsFormat = "CSV"
-)
-
-type RadarHTTPLocationHTTPProtocolGetParamsIPVersion string
-
-const (
- RadarHTTPLocationHTTPProtocolGetParamsIPVersionIPv4 RadarHTTPLocationHTTPProtocolGetParamsIPVersion = "IPv4"
- RadarHTTPLocationHTTPProtocolGetParamsIPVersionIPv6 RadarHTTPLocationHTTPProtocolGetParamsIPVersion = "IPv6"
-)
-
-type RadarHTTPLocationHTTPProtocolGetParamsOS string
-
-const (
- RadarHTTPLocationHTTPProtocolGetParamsOSWindows RadarHTTPLocationHTTPProtocolGetParamsOS = "WINDOWS"
- RadarHTTPLocationHTTPProtocolGetParamsOSMacosx RadarHTTPLocationHTTPProtocolGetParamsOS = "MACOSX"
- RadarHTTPLocationHTTPProtocolGetParamsOSIos RadarHTTPLocationHTTPProtocolGetParamsOS = "IOS"
- RadarHTTPLocationHTTPProtocolGetParamsOSAndroid RadarHTTPLocationHTTPProtocolGetParamsOS = "ANDROID"
- RadarHTTPLocationHTTPProtocolGetParamsOSChromeos RadarHTTPLocationHTTPProtocolGetParamsOS = "CHROMEOS"
- RadarHTTPLocationHTTPProtocolGetParamsOSLinux RadarHTTPLocationHTTPProtocolGetParamsOS = "LINUX"
- RadarHTTPLocationHTTPProtocolGetParamsOSSmartTv RadarHTTPLocationHTTPProtocolGetParamsOS = "SMART_TV"
-)
-
-type RadarHTTPLocationHTTPProtocolGetParamsTLSVersion string
-
-const (
- RadarHTTPLocationHTTPProtocolGetParamsTLSVersionTlSv1_0 RadarHTTPLocationHTTPProtocolGetParamsTLSVersion = "TLSv1_0"
- RadarHTTPLocationHTTPProtocolGetParamsTLSVersionTlSv1_1 RadarHTTPLocationHTTPProtocolGetParamsTLSVersion = "TLSv1_1"
- RadarHTTPLocationHTTPProtocolGetParamsTLSVersionTlSv1_2 RadarHTTPLocationHTTPProtocolGetParamsTLSVersion = "TLSv1_2"
- RadarHTTPLocationHTTPProtocolGetParamsTLSVersionTlSv1_3 RadarHTTPLocationHTTPProtocolGetParamsTLSVersion = "TLSv1_3"
- RadarHTTPLocationHTTPProtocolGetParamsTLSVersionTlSvQuic RadarHTTPLocationHTTPProtocolGetParamsTLSVersion = "TLSvQUIC"
-)
-
-type RadarHTTPLocationHTTPProtocolGetResponseEnvelope struct {
- Result RadarHTTPLocationHTTPProtocolGetResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarHTTPLocationHTTPProtocolGetResponseEnvelopeJSON `json:"-"`
-}
-
-// radarHTTPLocationHTTPProtocolGetResponseEnvelopeJSON contains the JSON metadata
-// for the struct [RadarHTTPLocationHTTPProtocolGetResponseEnvelope]
-type radarHTTPLocationHTTPProtocolGetResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPLocationHTTPProtocolGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPLocationHTTPProtocolGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
diff --git a/radarhttplocationhttpprotocol_test.go b/radarhttplocationhttpprotocol_test.go
deleted file mode 100644
index 63f3f0e909d..00000000000
--- a/radarhttplocationhttpprotocol_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-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRadarHTTPLocationHTTPProtocolGetWithOptionalParams(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"),
- )
- _, err := client.Radar.HTTP.Locations.HTTPProtocol.Get(
- context.TODO(),
- cloudflare.RadarHTTPLocationHTTPProtocolGetParamsHTTPProtocolHTTP,
- 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()}),
- DeviceType: cloudflare.F([]cloudflare.RadarHTTPLocationHTTPProtocolGetParamsDeviceType{cloudflare.RadarHTTPLocationHTTPProtocolGetParamsDeviceTypeDesktop, cloudflare.RadarHTTPLocationHTTPProtocolGetParamsDeviceTypeMobile, cloudflare.RadarHTTPLocationHTTPProtocolGetParamsDeviceTypeOther}),
- Format: cloudflare.F(cloudflare.RadarHTTPLocationHTTPProtocolGetParamsFormatJson),
- IPVersion: cloudflare.F([]cloudflare.RadarHTTPLocationHTTPProtocolGetParamsIPVersion{cloudflare.RadarHTTPLocationHTTPProtocolGetParamsIPVersionIPv4, cloudflare.RadarHTTPLocationHTTPProtocolGetParamsIPVersionIPv6}),
- Limit: cloudflare.F(int64(5)),
- Location: cloudflare.F([]string{"string", "string", "string"}),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- OS: cloudflare.F([]cloudflare.RadarHTTPLocationHTTPProtocolGetParamsOS{cloudflare.RadarHTTPLocationHTTPProtocolGetParamsOSWindows, cloudflare.RadarHTTPLocationHTTPProtocolGetParamsOSMacosx, cloudflare.RadarHTTPLocationHTTPProtocolGetParamsOSIos}),
- TLSVersion: cloudflare.F([]cloudflare.RadarHTTPLocationHTTPProtocolGetParamsTLSVersion{cloudflare.RadarHTTPLocationHTTPProtocolGetParamsTLSVersionTlSv1_0, cloudflare.RadarHTTPLocationHTTPProtocolGetParamsTLSVersionTlSv1_1, cloudflare.RadarHTTPLocationHTTPProtocolGetParamsTLSVersionTlSv1_2}),
- },
- )
- 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/radarhttplocationipversion.go b/radarhttplocationipversion.go
deleted file mode 100644
index 908e7c23f63..00000000000
--- a/radarhttplocationipversion.go
+++ /dev/null
@@ -1,367 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarHTTPLocationIPVersionService contains methods and other services that help
-// with interacting with the cloudflare API. Note, unlike clients, this service
-// does not read variables from the environment automatically. You should not
-// instantiate this service directly, and instead use the
-// [NewRadarHTTPLocationIPVersionService] method instead.
-type RadarHTTPLocationIPVersionService struct {
- Options []option.RequestOption
-}
-
-// NewRadarHTTPLocationIPVersionService generates a new service that applies the
-// given options to each request. These options are applied after the parent
-// client's options (if there is one), and before any request-specific options.
-func NewRadarHTTPLocationIPVersionService(opts ...option.RequestOption) (r *RadarHTTPLocationIPVersionService) {
- r = &RadarHTTPLocationIPVersionService{}
- r.Options = opts
- return
-}
-
-// Get the top locations, by HTTP traffic, of the requested IP protocol version.
-// Values are a percentage out of the total traffic.
-func (r *RadarHTTPLocationIPVersionService) Get(ctx context.Context, ipVersion RadarHTTPLocationIPVersionGetParamsIPVersion, query RadarHTTPLocationIPVersionGetParams, opts ...option.RequestOption) (res *RadarHTTPLocationIPVersionGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarHTTPLocationIPVersionGetResponseEnvelope
- path := fmt.Sprintf("radar/http/top/locations/ip_version/%v", ipVersion)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type RadarHTTPLocationIPVersionGetResponse struct {
- Meta RadarHTTPLocationIPVersionGetResponseMeta `json:"meta,required"`
- Top0 []RadarHTTPLocationIPVersionGetResponseTop0 `json:"top_0,required"`
- JSON radarHTTPLocationIPVersionGetResponseJSON `json:"-"`
-}
-
-// radarHTTPLocationIPVersionGetResponseJSON contains the JSON metadata for the
-// struct [RadarHTTPLocationIPVersionGetResponse]
-type radarHTTPLocationIPVersionGetResponseJSON struct {
- Meta apijson.Field
- Top0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPLocationIPVersionGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPLocationIPVersionGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPLocationIPVersionGetResponseMeta struct {
- DateRange []RadarHTTPLocationIPVersionGetResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- ConfidenceInfo RadarHTTPLocationIPVersionGetResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarHTTPLocationIPVersionGetResponseMetaJSON `json:"-"`
-}
-
-// radarHTTPLocationIPVersionGetResponseMetaJSON contains the JSON metadata for the
-// struct [RadarHTTPLocationIPVersionGetResponseMeta]
-type radarHTTPLocationIPVersionGetResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPLocationIPVersionGetResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPLocationIPVersionGetResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPLocationIPVersionGetResponseMetaDateRange 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 radarHTTPLocationIPVersionGetResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarHTTPLocationIPVersionGetResponseMetaDateRangeJSON contains the JSON
-// metadata for the struct [RadarHTTPLocationIPVersionGetResponseMetaDateRange]
-type radarHTTPLocationIPVersionGetResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPLocationIPVersionGetResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPLocationIPVersionGetResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPLocationIPVersionGetResponseMetaConfidenceInfo struct {
- Annotations []RadarHTTPLocationIPVersionGetResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarHTTPLocationIPVersionGetResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarHTTPLocationIPVersionGetResponseMetaConfidenceInfoJSON contains the JSON
-// metadata for the struct
-// [RadarHTTPLocationIPVersionGetResponseMetaConfidenceInfo]
-type radarHTTPLocationIPVersionGetResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPLocationIPVersionGetResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPLocationIPVersionGetResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPLocationIPVersionGetResponseMetaConfidenceInfoAnnotation 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 radarHTTPLocationIPVersionGetResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarHTTPLocationIPVersionGetResponseMetaConfidenceInfoAnnotationJSON contains
-// the JSON metadata for the struct
-// [RadarHTTPLocationIPVersionGetResponseMetaConfidenceInfoAnnotation]
-type radarHTTPLocationIPVersionGetResponseMetaConfidenceInfoAnnotationJSON 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 *RadarHTTPLocationIPVersionGetResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPLocationIPVersionGetResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPLocationIPVersionGetResponseTop0 struct {
- ClientCountryAlpha2 string `json:"clientCountryAlpha2,required"`
- ClientCountryName string `json:"clientCountryName,required"`
- Value string `json:"value,required"`
- JSON radarHTTPLocationIPVersionGetResponseTop0JSON `json:"-"`
-}
-
-// radarHTTPLocationIPVersionGetResponseTop0JSON contains the JSON metadata for the
-// struct [RadarHTTPLocationIPVersionGetResponseTop0]
-type radarHTTPLocationIPVersionGetResponseTop0JSON struct {
- ClientCountryAlpha2 apijson.Field
- ClientCountryName apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPLocationIPVersionGetResponseTop0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPLocationIPVersionGetResponseTop0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPLocationIPVersionGetParams 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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarHTTPLocationIPVersionGetParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Filter for device type.
- DeviceType param.Field[[]RadarHTTPLocationIPVersionGetParamsDeviceType] `query:"deviceType"`
- // Format results are returned in.
- Format param.Field[RadarHTTPLocationIPVersionGetParamsFormat] `query:"format"`
- // Filter for http protocol.
- HTTPProtocol param.Field[[]RadarHTTPLocationIPVersionGetParamsHTTPProtocol] `query:"httpProtocol"`
- // Filter for http version.
- HTTPVersion param.Field[[]RadarHTTPLocationIPVersionGetParamsHTTPVersion] `query:"httpVersion"`
- // 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 os name.
- OS param.Field[[]RadarHTTPLocationIPVersionGetParamsOS] `query:"os"`
- // Filter for tls version.
- TLSVersion param.Field[[]RadarHTTPLocationIPVersionGetParamsTLSVersion] `query:"tlsVersion"`
-}
-
-// URLQuery serializes [RadarHTTPLocationIPVersionGetParams]'s query parameters as
-// `url.Values`.
-func (r RadarHTTPLocationIPVersionGetParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// IP version.
-type RadarHTTPLocationIPVersionGetParamsIPVersion string
-
-const (
- RadarHTTPLocationIPVersionGetParamsIPVersionIPv4 RadarHTTPLocationIPVersionGetParamsIPVersion = "IPv4"
- RadarHTTPLocationIPVersionGetParamsIPVersionIPv6 RadarHTTPLocationIPVersionGetParamsIPVersion = "IPv6"
-)
-
-type RadarHTTPLocationIPVersionGetParamsBotClass string
-
-const (
- RadarHTTPLocationIPVersionGetParamsBotClassLikelyAutomated RadarHTTPLocationIPVersionGetParamsBotClass = "LIKELY_AUTOMATED"
- RadarHTTPLocationIPVersionGetParamsBotClassLikelyHuman RadarHTTPLocationIPVersionGetParamsBotClass = "LIKELY_HUMAN"
-)
-
-type RadarHTTPLocationIPVersionGetParamsDateRange string
-
-const (
- RadarHTTPLocationIPVersionGetParamsDateRange1d RadarHTTPLocationIPVersionGetParamsDateRange = "1d"
- RadarHTTPLocationIPVersionGetParamsDateRange2d RadarHTTPLocationIPVersionGetParamsDateRange = "2d"
- RadarHTTPLocationIPVersionGetParamsDateRange7d RadarHTTPLocationIPVersionGetParamsDateRange = "7d"
- RadarHTTPLocationIPVersionGetParamsDateRange14d RadarHTTPLocationIPVersionGetParamsDateRange = "14d"
- RadarHTTPLocationIPVersionGetParamsDateRange28d RadarHTTPLocationIPVersionGetParamsDateRange = "28d"
- RadarHTTPLocationIPVersionGetParamsDateRange12w RadarHTTPLocationIPVersionGetParamsDateRange = "12w"
- RadarHTTPLocationIPVersionGetParamsDateRange24w RadarHTTPLocationIPVersionGetParamsDateRange = "24w"
- RadarHTTPLocationIPVersionGetParamsDateRange52w RadarHTTPLocationIPVersionGetParamsDateRange = "52w"
- RadarHTTPLocationIPVersionGetParamsDateRange1dControl RadarHTTPLocationIPVersionGetParamsDateRange = "1dControl"
- RadarHTTPLocationIPVersionGetParamsDateRange2dControl RadarHTTPLocationIPVersionGetParamsDateRange = "2dControl"
- RadarHTTPLocationIPVersionGetParamsDateRange7dControl RadarHTTPLocationIPVersionGetParamsDateRange = "7dControl"
- RadarHTTPLocationIPVersionGetParamsDateRange14dControl RadarHTTPLocationIPVersionGetParamsDateRange = "14dControl"
- RadarHTTPLocationIPVersionGetParamsDateRange28dControl RadarHTTPLocationIPVersionGetParamsDateRange = "28dControl"
- RadarHTTPLocationIPVersionGetParamsDateRange12wControl RadarHTTPLocationIPVersionGetParamsDateRange = "12wControl"
- RadarHTTPLocationIPVersionGetParamsDateRange24wControl RadarHTTPLocationIPVersionGetParamsDateRange = "24wControl"
-)
-
-type RadarHTTPLocationIPVersionGetParamsDeviceType string
-
-const (
- RadarHTTPLocationIPVersionGetParamsDeviceTypeDesktop RadarHTTPLocationIPVersionGetParamsDeviceType = "DESKTOP"
- RadarHTTPLocationIPVersionGetParamsDeviceTypeMobile RadarHTTPLocationIPVersionGetParamsDeviceType = "MOBILE"
- RadarHTTPLocationIPVersionGetParamsDeviceTypeOther RadarHTTPLocationIPVersionGetParamsDeviceType = "OTHER"
-)
-
-// Format results are returned in.
-type RadarHTTPLocationIPVersionGetParamsFormat string
-
-const (
- RadarHTTPLocationIPVersionGetParamsFormatJson RadarHTTPLocationIPVersionGetParamsFormat = "JSON"
- RadarHTTPLocationIPVersionGetParamsFormatCsv RadarHTTPLocationIPVersionGetParamsFormat = "CSV"
-)
-
-type RadarHTTPLocationIPVersionGetParamsHTTPProtocol string
-
-const (
- RadarHTTPLocationIPVersionGetParamsHTTPProtocolHTTP RadarHTTPLocationIPVersionGetParamsHTTPProtocol = "HTTP"
- RadarHTTPLocationIPVersionGetParamsHTTPProtocolHTTPS RadarHTTPLocationIPVersionGetParamsHTTPProtocol = "HTTPS"
-)
-
-type RadarHTTPLocationIPVersionGetParamsHTTPVersion string
-
-const (
- RadarHTTPLocationIPVersionGetParamsHTTPVersionHttPv1 RadarHTTPLocationIPVersionGetParamsHTTPVersion = "HTTPv1"
- RadarHTTPLocationIPVersionGetParamsHTTPVersionHttPv2 RadarHTTPLocationIPVersionGetParamsHTTPVersion = "HTTPv2"
- RadarHTTPLocationIPVersionGetParamsHTTPVersionHttPv3 RadarHTTPLocationIPVersionGetParamsHTTPVersion = "HTTPv3"
-)
-
-type RadarHTTPLocationIPVersionGetParamsOS string
-
-const (
- RadarHTTPLocationIPVersionGetParamsOSWindows RadarHTTPLocationIPVersionGetParamsOS = "WINDOWS"
- RadarHTTPLocationIPVersionGetParamsOSMacosx RadarHTTPLocationIPVersionGetParamsOS = "MACOSX"
- RadarHTTPLocationIPVersionGetParamsOSIos RadarHTTPLocationIPVersionGetParamsOS = "IOS"
- RadarHTTPLocationIPVersionGetParamsOSAndroid RadarHTTPLocationIPVersionGetParamsOS = "ANDROID"
- RadarHTTPLocationIPVersionGetParamsOSChromeos RadarHTTPLocationIPVersionGetParamsOS = "CHROMEOS"
- RadarHTTPLocationIPVersionGetParamsOSLinux RadarHTTPLocationIPVersionGetParamsOS = "LINUX"
- RadarHTTPLocationIPVersionGetParamsOSSmartTv RadarHTTPLocationIPVersionGetParamsOS = "SMART_TV"
-)
-
-type RadarHTTPLocationIPVersionGetParamsTLSVersion string
-
-const (
- RadarHTTPLocationIPVersionGetParamsTLSVersionTlSv1_0 RadarHTTPLocationIPVersionGetParamsTLSVersion = "TLSv1_0"
- RadarHTTPLocationIPVersionGetParamsTLSVersionTlSv1_1 RadarHTTPLocationIPVersionGetParamsTLSVersion = "TLSv1_1"
- RadarHTTPLocationIPVersionGetParamsTLSVersionTlSv1_2 RadarHTTPLocationIPVersionGetParamsTLSVersion = "TLSv1_2"
- RadarHTTPLocationIPVersionGetParamsTLSVersionTlSv1_3 RadarHTTPLocationIPVersionGetParamsTLSVersion = "TLSv1_3"
- RadarHTTPLocationIPVersionGetParamsTLSVersionTlSvQuic RadarHTTPLocationIPVersionGetParamsTLSVersion = "TLSvQUIC"
-)
-
-type RadarHTTPLocationIPVersionGetResponseEnvelope struct {
- Result RadarHTTPLocationIPVersionGetResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarHTTPLocationIPVersionGetResponseEnvelopeJSON `json:"-"`
-}
-
-// radarHTTPLocationIPVersionGetResponseEnvelopeJSON contains the JSON metadata for
-// the struct [RadarHTTPLocationIPVersionGetResponseEnvelope]
-type radarHTTPLocationIPVersionGetResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPLocationIPVersionGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPLocationIPVersionGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
diff --git a/radarhttplocationipversion_test.go b/radarhttplocationipversion_test.go
deleted file mode 100644
index 645d9029471..00000000000
--- a/radarhttplocationipversion_test.go
+++ /dev/null
@@ -1,59 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
- "time"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRadarHTTPLocationIPVersionGetWithOptionalParams(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"),
- )
- _, err := client.Radar.HTTP.Locations.IPVersion.Get(
- context.TODO(),
- cloudflare.RadarHTTPLocationIPVersionGetParamsIPVersionIPv4,
- 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()}),
- DeviceType: cloudflare.F([]cloudflare.RadarHTTPLocationIPVersionGetParamsDeviceType{cloudflare.RadarHTTPLocationIPVersionGetParamsDeviceTypeDesktop, cloudflare.RadarHTTPLocationIPVersionGetParamsDeviceTypeMobile, cloudflare.RadarHTTPLocationIPVersionGetParamsDeviceTypeOther}),
- Format: cloudflare.F(cloudflare.RadarHTTPLocationIPVersionGetParamsFormatJson),
- HTTPProtocol: cloudflare.F([]cloudflare.RadarHTTPLocationIPVersionGetParamsHTTPProtocol{cloudflare.RadarHTTPLocationIPVersionGetParamsHTTPProtocolHTTP, cloudflare.RadarHTTPLocationIPVersionGetParamsHTTPProtocolHTTPS}),
- HTTPVersion: cloudflare.F([]cloudflare.RadarHTTPLocationIPVersionGetParamsHTTPVersion{cloudflare.RadarHTTPLocationIPVersionGetParamsHTTPVersionHttPv1, cloudflare.RadarHTTPLocationIPVersionGetParamsHTTPVersionHttPv2, cloudflare.RadarHTTPLocationIPVersionGetParamsHTTPVersionHttPv3}),
- Limit: cloudflare.F(int64(5)),
- Location: cloudflare.F([]string{"string", "string", "string"}),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- OS: cloudflare.F([]cloudflare.RadarHTTPLocationIPVersionGetParamsOS{cloudflare.RadarHTTPLocationIPVersionGetParamsOSWindows, cloudflare.RadarHTTPLocationIPVersionGetParamsOSMacosx, cloudflare.RadarHTTPLocationIPVersionGetParamsOSIos}),
- TLSVersion: cloudflare.F([]cloudflare.RadarHTTPLocationIPVersionGetParamsTLSVersion{cloudflare.RadarHTTPLocationIPVersionGetParamsTLSVersionTlSv1_0, cloudflare.RadarHTTPLocationIPVersionGetParamsTLSVersionTlSv1_1, cloudflare.RadarHTTPLocationIPVersionGetParamsTLSVersionTlSv1_2}),
- },
- )
- 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/radarhttplocationos.go b/radarhttplocationos.go
deleted file mode 100644
index b29271276fe..00000000000
--- a/radarhttplocationos.go
+++ /dev/null
@@ -1,366 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarHTTPLocationOSService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewRadarHTTPLocationOSService]
-// method instead.
-type RadarHTTPLocationOSService struct {
- Options []option.RequestOption
-}
-
-// NewRadarHTTPLocationOSService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewRadarHTTPLocationOSService(opts ...option.RequestOption) (r *RadarHTTPLocationOSService) {
- r = &RadarHTTPLocationOSService{}
- r.Options = opts
- return
-}
-
-// Get the top locations, by HTTP traffic, of the requested operating systems.
-// Values are a percentage out of the total traffic.
-func (r *RadarHTTPLocationOSService) Get(ctx context.Context, os RadarHTTPLocationOSGetParamsOS, query RadarHTTPLocationOSGetParams, opts ...option.RequestOption) (res *RadarHTTPLocationOSGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarHTTPLocationOSGetResponseEnvelope
- path := fmt.Sprintf("radar/http/top/locations/os/%v", os)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type RadarHTTPLocationOSGetResponse struct {
- Meta RadarHTTPLocationOSGetResponseMeta `json:"meta,required"`
- Top0 []RadarHTTPLocationOSGetResponseTop0 `json:"top_0,required"`
- JSON radarHTTPLocationOSGetResponseJSON `json:"-"`
-}
-
-// radarHTTPLocationOSGetResponseJSON contains the JSON metadata for the struct
-// [RadarHTTPLocationOSGetResponse]
-type radarHTTPLocationOSGetResponseJSON struct {
- Meta apijson.Field
- Top0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPLocationOSGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPLocationOSGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPLocationOSGetResponseMeta struct {
- DateRange []RadarHTTPLocationOSGetResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- ConfidenceInfo RadarHTTPLocationOSGetResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarHTTPLocationOSGetResponseMetaJSON `json:"-"`
-}
-
-// radarHTTPLocationOSGetResponseMetaJSON contains the JSON metadata for the struct
-// [RadarHTTPLocationOSGetResponseMeta]
-type radarHTTPLocationOSGetResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPLocationOSGetResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPLocationOSGetResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPLocationOSGetResponseMetaDateRange 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 radarHTTPLocationOSGetResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarHTTPLocationOSGetResponseMetaDateRangeJSON contains the JSON metadata for
-// the struct [RadarHTTPLocationOSGetResponseMetaDateRange]
-type radarHTTPLocationOSGetResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPLocationOSGetResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPLocationOSGetResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPLocationOSGetResponseMetaConfidenceInfo struct {
- Annotations []RadarHTTPLocationOSGetResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarHTTPLocationOSGetResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarHTTPLocationOSGetResponseMetaConfidenceInfoJSON contains the JSON metadata
-// for the struct [RadarHTTPLocationOSGetResponseMetaConfidenceInfo]
-type radarHTTPLocationOSGetResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPLocationOSGetResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPLocationOSGetResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPLocationOSGetResponseMetaConfidenceInfoAnnotation 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 radarHTTPLocationOSGetResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarHTTPLocationOSGetResponseMetaConfidenceInfoAnnotationJSON contains the JSON
-// metadata for the struct
-// [RadarHTTPLocationOSGetResponseMetaConfidenceInfoAnnotation]
-type radarHTTPLocationOSGetResponseMetaConfidenceInfoAnnotationJSON 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 *RadarHTTPLocationOSGetResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPLocationOSGetResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPLocationOSGetResponseTop0 struct {
- ClientCountryAlpha2 string `json:"clientCountryAlpha2,required"`
- ClientCountryName string `json:"clientCountryName,required"`
- Value string `json:"value,required"`
- JSON radarHTTPLocationOSGetResponseTop0JSON `json:"-"`
-}
-
-// radarHTTPLocationOSGetResponseTop0JSON contains the JSON metadata for the struct
-// [RadarHTTPLocationOSGetResponseTop0]
-type radarHTTPLocationOSGetResponseTop0JSON struct {
- ClientCountryAlpha2 apijson.Field
- ClientCountryName apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPLocationOSGetResponseTop0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPLocationOSGetResponseTop0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPLocationOSGetParams 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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarHTTPLocationOSGetParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Filter for device type.
- DeviceType param.Field[[]RadarHTTPLocationOSGetParamsDeviceType] `query:"deviceType"`
- // Format results are returned in.
- Format param.Field[RadarHTTPLocationOSGetParamsFormat] `query:"format"`
- // Filter for http protocol.
- HTTPProtocol param.Field[[]RadarHTTPLocationOSGetParamsHTTPProtocol] `query:"httpProtocol"`
- // Filter for http version.
- HTTPVersion param.Field[[]RadarHTTPLocationOSGetParamsHTTPVersion] `query:"httpVersion"`
- // Filter for ip version.
- IPVersion param.Field[[]RadarHTTPLocationOSGetParamsIPVersion] `query:"ipVersion"`
- // 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 tls version.
- TLSVersion param.Field[[]RadarHTTPLocationOSGetParamsTLSVersion] `query:"tlsVersion"`
-}
-
-// URLQuery serializes [RadarHTTPLocationOSGetParams]'s query parameters as
-// `url.Values`.
-func (r RadarHTTPLocationOSGetParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// IP version.
-type RadarHTTPLocationOSGetParamsOS string
-
-const (
- RadarHTTPLocationOSGetParamsOSWindows RadarHTTPLocationOSGetParamsOS = "WINDOWS"
- RadarHTTPLocationOSGetParamsOSMacosx RadarHTTPLocationOSGetParamsOS = "MACOSX"
- RadarHTTPLocationOSGetParamsOSIos RadarHTTPLocationOSGetParamsOS = "IOS"
- RadarHTTPLocationOSGetParamsOSAndroid RadarHTTPLocationOSGetParamsOS = "ANDROID"
- RadarHTTPLocationOSGetParamsOSChromeos RadarHTTPLocationOSGetParamsOS = "CHROMEOS"
- RadarHTTPLocationOSGetParamsOSLinux RadarHTTPLocationOSGetParamsOS = "LINUX"
- RadarHTTPLocationOSGetParamsOSSmartTv RadarHTTPLocationOSGetParamsOS = "SMART_TV"
-)
-
-type RadarHTTPLocationOSGetParamsBotClass string
-
-const (
- RadarHTTPLocationOSGetParamsBotClassLikelyAutomated RadarHTTPLocationOSGetParamsBotClass = "LIKELY_AUTOMATED"
- RadarHTTPLocationOSGetParamsBotClassLikelyHuman RadarHTTPLocationOSGetParamsBotClass = "LIKELY_HUMAN"
-)
-
-type RadarHTTPLocationOSGetParamsDateRange string
-
-const (
- RadarHTTPLocationOSGetParamsDateRange1d RadarHTTPLocationOSGetParamsDateRange = "1d"
- RadarHTTPLocationOSGetParamsDateRange2d RadarHTTPLocationOSGetParamsDateRange = "2d"
- RadarHTTPLocationOSGetParamsDateRange7d RadarHTTPLocationOSGetParamsDateRange = "7d"
- RadarHTTPLocationOSGetParamsDateRange14d RadarHTTPLocationOSGetParamsDateRange = "14d"
- RadarHTTPLocationOSGetParamsDateRange28d RadarHTTPLocationOSGetParamsDateRange = "28d"
- RadarHTTPLocationOSGetParamsDateRange12w RadarHTTPLocationOSGetParamsDateRange = "12w"
- RadarHTTPLocationOSGetParamsDateRange24w RadarHTTPLocationOSGetParamsDateRange = "24w"
- RadarHTTPLocationOSGetParamsDateRange52w RadarHTTPLocationOSGetParamsDateRange = "52w"
- RadarHTTPLocationOSGetParamsDateRange1dControl RadarHTTPLocationOSGetParamsDateRange = "1dControl"
- RadarHTTPLocationOSGetParamsDateRange2dControl RadarHTTPLocationOSGetParamsDateRange = "2dControl"
- RadarHTTPLocationOSGetParamsDateRange7dControl RadarHTTPLocationOSGetParamsDateRange = "7dControl"
- RadarHTTPLocationOSGetParamsDateRange14dControl RadarHTTPLocationOSGetParamsDateRange = "14dControl"
- RadarHTTPLocationOSGetParamsDateRange28dControl RadarHTTPLocationOSGetParamsDateRange = "28dControl"
- RadarHTTPLocationOSGetParamsDateRange12wControl RadarHTTPLocationOSGetParamsDateRange = "12wControl"
- RadarHTTPLocationOSGetParamsDateRange24wControl RadarHTTPLocationOSGetParamsDateRange = "24wControl"
-)
-
-type RadarHTTPLocationOSGetParamsDeviceType string
-
-const (
- RadarHTTPLocationOSGetParamsDeviceTypeDesktop RadarHTTPLocationOSGetParamsDeviceType = "DESKTOP"
- RadarHTTPLocationOSGetParamsDeviceTypeMobile RadarHTTPLocationOSGetParamsDeviceType = "MOBILE"
- RadarHTTPLocationOSGetParamsDeviceTypeOther RadarHTTPLocationOSGetParamsDeviceType = "OTHER"
-)
-
-// Format results are returned in.
-type RadarHTTPLocationOSGetParamsFormat string
-
-const (
- RadarHTTPLocationOSGetParamsFormatJson RadarHTTPLocationOSGetParamsFormat = "JSON"
- RadarHTTPLocationOSGetParamsFormatCsv RadarHTTPLocationOSGetParamsFormat = "CSV"
-)
-
-type RadarHTTPLocationOSGetParamsHTTPProtocol string
-
-const (
- RadarHTTPLocationOSGetParamsHTTPProtocolHTTP RadarHTTPLocationOSGetParamsHTTPProtocol = "HTTP"
- RadarHTTPLocationOSGetParamsHTTPProtocolHTTPS RadarHTTPLocationOSGetParamsHTTPProtocol = "HTTPS"
-)
-
-type RadarHTTPLocationOSGetParamsHTTPVersion string
-
-const (
- RadarHTTPLocationOSGetParamsHTTPVersionHttPv1 RadarHTTPLocationOSGetParamsHTTPVersion = "HTTPv1"
- RadarHTTPLocationOSGetParamsHTTPVersionHttPv2 RadarHTTPLocationOSGetParamsHTTPVersion = "HTTPv2"
- RadarHTTPLocationOSGetParamsHTTPVersionHttPv3 RadarHTTPLocationOSGetParamsHTTPVersion = "HTTPv3"
-)
-
-type RadarHTTPLocationOSGetParamsIPVersion string
-
-const (
- RadarHTTPLocationOSGetParamsIPVersionIPv4 RadarHTTPLocationOSGetParamsIPVersion = "IPv4"
- RadarHTTPLocationOSGetParamsIPVersionIPv6 RadarHTTPLocationOSGetParamsIPVersion = "IPv6"
-)
-
-type RadarHTTPLocationOSGetParamsTLSVersion string
-
-const (
- RadarHTTPLocationOSGetParamsTLSVersionTlSv1_0 RadarHTTPLocationOSGetParamsTLSVersion = "TLSv1_0"
- RadarHTTPLocationOSGetParamsTLSVersionTlSv1_1 RadarHTTPLocationOSGetParamsTLSVersion = "TLSv1_1"
- RadarHTTPLocationOSGetParamsTLSVersionTlSv1_2 RadarHTTPLocationOSGetParamsTLSVersion = "TLSv1_2"
- RadarHTTPLocationOSGetParamsTLSVersionTlSv1_3 RadarHTTPLocationOSGetParamsTLSVersion = "TLSv1_3"
- RadarHTTPLocationOSGetParamsTLSVersionTlSvQuic RadarHTTPLocationOSGetParamsTLSVersion = "TLSvQUIC"
-)
-
-type RadarHTTPLocationOSGetResponseEnvelope struct {
- Result RadarHTTPLocationOSGetResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarHTTPLocationOSGetResponseEnvelopeJSON `json:"-"`
-}
-
-// radarHTTPLocationOSGetResponseEnvelopeJSON contains the JSON metadata for the
-// struct [RadarHTTPLocationOSGetResponseEnvelope]
-type radarHTTPLocationOSGetResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPLocationOSGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPLocationOSGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
diff --git a/radarhttplocationos_test.go b/radarhttplocationos_test.go
deleted file mode 100644
index cdb3e8059de..00000000000
--- a/radarhttplocationos_test.go
+++ /dev/null
@@ -1,59 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
- "time"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRadarHTTPLocationOSGetWithOptionalParams(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"),
- )
- _, err := client.Radar.HTTP.Locations.OS.Get(
- context.TODO(),
- cloudflare.RadarHTTPLocationOSGetParamsOSWindows,
- 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()}),
- DeviceType: cloudflare.F([]cloudflare.RadarHTTPLocationOSGetParamsDeviceType{cloudflare.RadarHTTPLocationOSGetParamsDeviceTypeDesktop, cloudflare.RadarHTTPLocationOSGetParamsDeviceTypeMobile, cloudflare.RadarHTTPLocationOSGetParamsDeviceTypeOther}),
- Format: cloudflare.F(cloudflare.RadarHTTPLocationOSGetParamsFormatJson),
- HTTPProtocol: cloudflare.F([]cloudflare.RadarHTTPLocationOSGetParamsHTTPProtocol{cloudflare.RadarHTTPLocationOSGetParamsHTTPProtocolHTTP, cloudflare.RadarHTTPLocationOSGetParamsHTTPProtocolHTTPS}),
- HTTPVersion: cloudflare.F([]cloudflare.RadarHTTPLocationOSGetParamsHTTPVersion{cloudflare.RadarHTTPLocationOSGetParamsHTTPVersionHttPv1, cloudflare.RadarHTTPLocationOSGetParamsHTTPVersionHttPv2, cloudflare.RadarHTTPLocationOSGetParamsHTTPVersionHttPv3}),
- IPVersion: cloudflare.F([]cloudflare.RadarHTTPLocationOSGetParamsIPVersion{cloudflare.RadarHTTPLocationOSGetParamsIPVersionIPv4, cloudflare.RadarHTTPLocationOSGetParamsIPVersionIPv6}),
- Limit: cloudflare.F(int64(5)),
- Location: cloudflare.F([]string{"string", "string", "string"}),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- TLSVersion: cloudflare.F([]cloudflare.RadarHTTPLocationOSGetParamsTLSVersion{cloudflare.RadarHTTPLocationOSGetParamsTLSVersionTlSv1_0, cloudflare.RadarHTTPLocationOSGetParamsTLSVersionTlSv1_1, cloudflare.RadarHTTPLocationOSGetParamsTLSVersionTlSv1_2}),
- },
- )
- 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/radarhttplocationtlsversion.go b/radarhttplocationtlsversion.go
deleted file mode 100644
index bd0fc8f4484..00000000000
--- a/radarhttplocationtlsversion.go
+++ /dev/null
@@ -1,367 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarHTTPLocationTLSVersionService contains methods and other services that help
-// with interacting with the cloudflare API. Note, unlike clients, this service
-// does not read variables from the environment automatically. You should not
-// instantiate this service directly, and instead use the
-// [NewRadarHTTPLocationTLSVersionService] method instead.
-type RadarHTTPLocationTLSVersionService struct {
- Options []option.RequestOption
-}
-
-// NewRadarHTTPLocationTLSVersionService generates a new service that applies the
-// given options to each request. These options are applied after the parent
-// client's options (if there is one), and before any request-specific options.
-func NewRadarHTTPLocationTLSVersionService(opts ...option.RequestOption) (r *RadarHTTPLocationTLSVersionService) {
- r = &RadarHTTPLocationTLSVersionService{}
- r.Options = opts
- return
-}
-
-// Get the top locations, by HTTP traffic, of the requested TLS protocol version.
-// Values are a percentage out of the total traffic.
-func (r *RadarHTTPLocationTLSVersionService) Get(ctx context.Context, tlsVersion RadarHTTPLocationTLSVersionGetParamsTLSVersion, query RadarHTTPLocationTLSVersionGetParams, opts ...option.RequestOption) (res *RadarHTTPLocationTLSVersionGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarHTTPLocationTLSVersionGetResponseEnvelope
- path := fmt.Sprintf("radar/http/top/locations/tls_version/%v", tlsVersion)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type RadarHTTPLocationTLSVersionGetResponse struct {
- Meta RadarHTTPLocationTLSVersionGetResponseMeta `json:"meta,required"`
- Top0 []RadarHTTPLocationTLSVersionGetResponseTop0 `json:"top_0,required"`
- JSON radarHTTPLocationTLSVersionGetResponseJSON `json:"-"`
-}
-
-// radarHTTPLocationTLSVersionGetResponseJSON contains the JSON metadata for the
-// struct [RadarHTTPLocationTLSVersionGetResponse]
-type radarHTTPLocationTLSVersionGetResponseJSON struct {
- Meta apijson.Field
- Top0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPLocationTLSVersionGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPLocationTLSVersionGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPLocationTLSVersionGetResponseMeta struct {
- DateRange []RadarHTTPLocationTLSVersionGetResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- ConfidenceInfo RadarHTTPLocationTLSVersionGetResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarHTTPLocationTLSVersionGetResponseMetaJSON `json:"-"`
-}
-
-// radarHTTPLocationTLSVersionGetResponseMetaJSON contains the JSON metadata for
-// the struct [RadarHTTPLocationTLSVersionGetResponseMeta]
-type radarHTTPLocationTLSVersionGetResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPLocationTLSVersionGetResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPLocationTLSVersionGetResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPLocationTLSVersionGetResponseMetaDateRange 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 radarHTTPLocationTLSVersionGetResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarHTTPLocationTLSVersionGetResponseMetaDateRangeJSON contains the JSON
-// metadata for the struct [RadarHTTPLocationTLSVersionGetResponseMetaDateRange]
-type radarHTTPLocationTLSVersionGetResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPLocationTLSVersionGetResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPLocationTLSVersionGetResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPLocationTLSVersionGetResponseMetaConfidenceInfo struct {
- Annotations []RadarHTTPLocationTLSVersionGetResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarHTTPLocationTLSVersionGetResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarHTTPLocationTLSVersionGetResponseMetaConfidenceInfoJSON contains the JSON
-// metadata for the struct
-// [RadarHTTPLocationTLSVersionGetResponseMetaConfidenceInfo]
-type radarHTTPLocationTLSVersionGetResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPLocationTLSVersionGetResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPLocationTLSVersionGetResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPLocationTLSVersionGetResponseMetaConfidenceInfoAnnotation 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 radarHTTPLocationTLSVersionGetResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarHTTPLocationTLSVersionGetResponseMetaConfidenceInfoAnnotationJSON contains
-// the JSON metadata for the struct
-// [RadarHTTPLocationTLSVersionGetResponseMetaConfidenceInfoAnnotation]
-type radarHTTPLocationTLSVersionGetResponseMetaConfidenceInfoAnnotationJSON 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 *RadarHTTPLocationTLSVersionGetResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPLocationTLSVersionGetResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPLocationTLSVersionGetResponseTop0 struct {
- ClientCountryAlpha2 string `json:"clientCountryAlpha2,required"`
- ClientCountryName string `json:"clientCountryName,required"`
- Value string `json:"value,required"`
- JSON radarHTTPLocationTLSVersionGetResponseTop0JSON `json:"-"`
-}
-
-// radarHTTPLocationTLSVersionGetResponseTop0JSON contains the JSON metadata for
-// the struct [RadarHTTPLocationTLSVersionGetResponseTop0]
-type radarHTTPLocationTLSVersionGetResponseTop0JSON struct {
- ClientCountryAlpha2 apijson.Field
- ClientCountryName apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPLocationTLSVersionGetResponseTop0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPLocationTLSVersionGetResponseTop0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPLocationTLSVersionGetParams 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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarHTTPLocationTLSVersionGetParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Filter for device type.
- DeviceType param.Field[[]RadarHTTPLocationTLSVersionGetParamsDeviceType] `query:"deviceType"`
- // Format results are returned in.
- Format param.Field[RadarHTTPLocationTLSVersionGetParamsFormat] `query:"format"`
- // Filter for http protocol.
- HTTPProtocol param.Field[[]RadarHTTPLocationTLSVersionGetParamsHTTPProtocol] `query:"httpProtocol"`
- // Filter for http version.
- HTTPVersion param.Field[[]RadarHTTPLocationTLSVersionGetParamsHTTPVersion] `query:"httpVersion"`
- // Filter for ip version.
- IPVersion param.Field[[]RadarHTTPLocationTLSVersionGetParamsIPVersion] `query:"ipVersion"`
- // 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 os name.
- OS param.Field[[]RadarHTTPLocationTLSVersionGetParamsOS] `query:"os"`
-}
-
-// URLQuery serializes [RadarHTTPLocationTLSVersionGetParams]'s query parameters as
-// `url.Values`.
-func (r RadarHTTPLocationTLSVersionGetParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// TLS version.
-type RadarHTTPLocationTLSVersionGetParamsTLSVersion string
-
-const (
- RadarHTTPLocationTLSVersionGetParamsTLSVersionTlSv1_0 RadarHTTPLocationTLSVersionGetParamsTLSVersion = "TLSv1_0"
- RadarHTTPLocationTLSVersionGetParamsTLSVersionTlSv1_1 RadarHTTPLocationTLSVersionGetParamsTLSVersion = "TLSv1_1"
- RadarHTTPLocationTLSVersionGetParamsTLSVersionTlSv1_2 RadarHTTPLocationTLSVersionGetParamsTLSVersion = "TLSv1_2"
- RadarHTTPLocationTLSVersionGetParamsTLSVersionTlSv1_3 RadarHTTPLocationTLSVersionGetParamsTLSVersion = "TLSv1_3"
- RadarHTTPLocationTLSVersionGetParamsTLSVersionTlSvQuic RadarHTTPLocationTLSVersionGetParamsTLSVersion = "TLSvQUIC"
-)
-
-type RadarHTTPLocationTLSVersionGetParamsBotClass string
-
-const (
- RadarHTTPLocationTLSVersionGetParamsBotClassLikelyAutomated RadarHTTPLocationTLSVersionGetParamsBotClass = "LIKELY_AUTOMATED"
- RadarHTTPLocationTLSVersionGetParamsBotClassLikelyHuman RadarHTTPLocationTLSVersionGetParamsBotClass = "LIKELY_HUMAN"
-)
-
-type RadarHTTPLocationTLSVersionGetParamsDateRange string
-
-const (
- RadarHTTPLocationTLSVersionGetParamsDateRange1d RadarHTTPLocationTLSVersionGetParamsDateRange = "1d"
- RadarHTTPLocationTLSVersionGetParamsDateRange2d RadarHTTPLocationTLSVersionGetParamsDateRange = "2d"
- RadarHTTPLocationTLSVersionGetParamsDateRange7d RadarHTTPLocationTLSVersionGetParamsDateRange = "7d"
- RadarHTTPLocationTLSVersionGetParamsDateRange14d RadarHTTPLocationTLSVersionGetParamsDateRange = "14d"
- RadarHTTPLocationTLSVersionGetParamsDateRange28d RadarHTTPLocationTLSVersionGetParamsDateRange = "28d"
- RadarHTTPLocationTLSVersionGetParamsDateRange12w RadarHTTPLocationTLSVersionGetParamsDateRange = "12w"
- RadarHTTPLocationTLSVersionGetParamsDateRange24w RadarHTTPLocationTLSVersionGetParamsDateRange = "24w"
- RadarHTTPLocationTLSVersionGetParamsDateRange52w RadarHTTPLocationTLSVersionGetParamsDateRange = "52w"
- RadarHTTPLocationTLSVersionGetParamsDateRange1dControl RadarHTTPLocationTLSVersionGetParamsDateRange = "1dControl"
- RadarHTTPLocationTLSVersionGetParamsDateRange2dControl RadarHTTPLocationTLSVersionGetParamsDateRange = "2dControl"
- RadarHTTPLocationTLSVersionGetParamsDateRange7dControl RadarHTTPLocationTLSVersionGetParamsDateRange = "7dControl"
- RadarHTTPLocationTLSVersionGetParamsDateRange14dControl RadarHTTPLocationTLSVersionGetParamsDateRange = "14dControl"
- RadarHTTPLocationTLSVersionGetParamsDateRange28dControl RadarHTTPLocationTLSVersionGetParamsDateRange = "28dControl"
- RadarHTTPLocationTLSVersionGetParamsDateRange12wControl RadarHTTPLocationTLSVersionGetParamsDateRange = "12wControl"
- RadarHTTPLocationTLSVersionGetParamsDateRange24wControl RadarHTTPLocationTLSVersionGetParamsDateRange = "24wControl"
-)
-
-type RadarHTTPLocationTLSVersionGetParamsDeviceType string
-
-const (
- RadarHTTPLocationTLSVersionGetParamsDeviceTypeDesktop RadarHTTPLocationTLSVersionGetParamsDeviceType = "DESKTOP"
- RadarHTTPLocationTLSVersionGetParamsDeviceTypeMobile RadarHTTPLocationTLSVersionGetParamsDeviceType = "MOBILE"
- RadarHTTPLocationTLSVersionGetParamsDeviceTypeOther RadarHTTPLocationTLSVersionGetParamsDeviceType = "OTHER"
-)
-
-// Format results are returned in.
-type RadarHTTPLocationTLSVersionGetParamsFormat string
-
-const (
- RadarHTTPLocationTLSVersionGetParamsFormatJson RadarHTTPLocationTLSVersionGetParamsFormat = "JSON"
- RadarHTTPLocationTLSVersionGetParamsFormatCsv RadarHTTPLocationTLSVersionGetParamsFormat = "CSV"
-)
-
-type RadarHTTPLocationTLSVersionGetParamsHTTPProtocol string
-
-const (
- RadarHTTPLocationTLSVersionGetParamsHTTPProtocolHTTP RadarHTTPLocationTLSVersionGetParamsHTTPProtocol = "HTTP"
- RadarHTTPLocationTLSVersionGetParamsHTTPProtocolHTTPS RadarHTTPLocationTLSVersionGetParamsHTTPProtocol = "HTTPS"
-)
-
-type RadarHTTPLocationTLSVersionGetParamsHTTPVersion string
-
-const (
- RadarHTTPLocationTLSVersionGetParamsHTTPVersionHttPv1 RadarHTTPLocationTLSVersionGetParamsHTTPVersion = "HTTPv1"
- RadarHTTPLocationTLSVersionGetParamsHTTPVersionHttPv2 RadarHTTPLocationTLSVersionGetParamsHTTPVersion = "HTTPv2"
- RadarHTTPLocationTLSVersionGetParamsHTTPVersionHttPv3 RadarHTTPLocationTLSVersionGetParamsHTTPVersion = "HTTPv3"
-)
-
-type RadarHTTPLocationTLSVersionGetParamsIPVersion string
-
-const (
- RadarHTTPLocationTLSVersionGetParamsIPVersionIPv4 RadarHTTPLocationTLSVersionGetParamsIPVersion = "IPv4"
- RadarHTTPLocationTLSVersionGetParamsIPVersionIPv6 RadarHTTPLocationTLSVersionGetParamsIPVersion = "IPv6"
-)
-
-type RadarHTTPLocationTLSVersionGetParamsOS string
-
-const (
- RadarHTTPLocationTLSVersionGetParamsOSWindows RadarHTTPLocationTLSVersionGetParamsOS = "WINDOWS"
- RadarHTTPLocationTLSVersionGetParamsOSMacosx RadarHTTPLocationTLSVersionGetParamsOS = "MACOSX"
- RadarHTTPLocationTLSVersionGetParamsOSIos RadarHTTPLocationTLSVersionGetParamsOS = "IOS"
- RadarHTTPLocationTLSVersionGetParamsOSAndroid RadarHTTPLocationTLSVersionGetParamsOS = "ANDROID"
- RadarHTTPLocationTLSVersionGetParamsOSChromeos RadarHTTPLocationTLSVersionGetParamsOS = "CHROMEOS"
- RadarHTTPLocationTLSVersionGetParamsOSLinux RadarHTTPLocationTLSVersionGetParamsOS = "LINUX"
- RadarHTTPLocationTLSVersionGetParamsOSSmartTv RadarHTTPLocationTLSVersionGetParamsOS = "SMART_TV"
-)
-
-type RadarHTTPLocationTLSVersionGetResponseEnvelope struct {
- Result RadarHTTPLocationTLSVersionGetResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarHTTPLocationTLSVersionGetResponseEnvelopeJSON `json:"-"`
-}
-
-// radarHTTPLocationTLSVersionGetResponseEnvelopeJSON contains the JSON metadata
-// for the struct [RadarHTTPLocationTLSVersionGetResponseEnvelope]
-type radarHTTPLocationTLSVersionGetResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPLocationTLSVersionGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPLocationTLSVersionGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
diff --git a/radarhttplocationtlsversion_test.go b/radarhttplocationtlsversion_test.go
deleted file mode 100644
index d097f7dd22a..00000000000
--- a/radarhttplocationtlsversion_test.go
+++ /dev/null
@@ -1,59 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
- "time"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRadarHTTPLocationTLSVersionGetWithOptionalParams(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"),
- )
- _, err := client.Radar.HTTP.Locations.TLSVersion.Get(
- context.TODO(),
- cloudflare.RadarHTTPLocationTLSVersionGetParamsTLSVersionTlSv1_0,
- 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()}),
- DeviceType: cloudflare.F([]cloudflare.RadarHTTPLocationTLSVersionGetParamsDeviceType{cloudflare.RadarHTTPLocationTLSVersionGetParamsDeviceTypeDesktop, cloudflare.RadarHTTPLocationTLSVersionGetParamsDeviceTypeMobile, cloudflare.RadarHTTPLocationTLSVersionGetParamsDeviceTypeOther}),
- Format: cloudflare.F(cloudflare.RadarHTTPLocationTLSVersionGetParamsFormatJson),
- HTTPProtocol: cloudflare.F([]cloudflare.RadarHTTPLocationTLSVersionGetParamsHTTPProtocol{cloudflare.RadarHTTPLocationTLSVersionGetParamsHTTPProtocolHTTP, cloudflare.RadarHTTPLocationTLSVersionGetParamsHTTPProtocolHTTPS}),
- HTTPVersion: cloudflare.F([]cloudflare.RadarHTTPLocationTLSVersionGetParamsHTTPVersion{cloudflare.RadarHTTPLocationTLSVersionGetParamsHTTPVersionHttPv1, cloudflare.RadarHTTPLocationTLSVersionGetParamsHTTPVersionHttPv2, cloudflare.RadarHTTPLocationTLSVersionGetParamsHTTPVersionHttPv3}),
- IPVersion: cloudflare.F([]cloudflare.RadarHTTPLocationTLSVersionGetParamsIPVersion{cloudflare.RadarHTTPLocationTLSVersionGetParamsIPVersionIPv4, cloudflare.RadarHTTPLocationTLSVersionGetParamsIPVersionIPv6}),
- Limit: cloudflare.F(int64(5)),
- Location: cloudflare.F([]string{"string", "string", "string"}),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- OS: cloudflare.F([]cloudflare.RadarHTTPLocationTLSVersionGetParamsOS{cloudflare.RadarHTTPLocationTLSVersionGetParamsOSWindows, cloudflare.RadarHTTPLocationTLSVersionGetParamsOSMacosx, cloudflare.RadarHTTPLocationTLSVersionGetParamsOSIos}),
- },
- )
- 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/radarhttpsummary.go b/radarhttpsummary.go
deleted file mode 100644
index 8cb1bbb264a..00000000000
--- a/radarhttpsummary.go
+++ /dev/null
@@ -1,2280 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarHTTPSummaryService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewRadarHTTPSummaryService] method
-// instead.
-type RadarHTTPSummaryService struct {
- Options []option.RequestOption
-}
-
-// NewRadarHTTPSummaryService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewRadarHTTPSummaryService(opts ...option.RequestOption) (r *RadarHTTPSummaryService) {
- r = &RadarHTTPSummaryService{}
- r.Options = opts
- return
-}
-
-// Percentage distribution of bot-generated traffic to genuine human traffic, as
-// classified by Cloudflare. Visit
-// https://developers.cloudflare.com/radar/concepts/bot-classes/ for more
-// information.
-func (r *RadarHTTPSummaryService) BotClass(ctx context.Context, query RadarHTTPSummaryBotClassParams, opts ...option.RequestOption) (res *RadarHTTPSummaryBotClassResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarHTTPSummaryBotClassResponseEnvelope
- path := "radar/http/summary/bot_class"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Percentage of Internet traffic generated by mobile, desktop, and other types of
-// devices, over a given time period.
-func (r *RadarHTTPSummaryService) DeviceType(ctx context.Context, query RadarHTTPSummaryDeviceTypeParams, opts ...option.RequestOption) (res *RadarHTTPSummaryDeviceTypeResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarHTTPSummaryDeviceTypeResponseEnvelope
- path := "radar/http/summary/device_type"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Percentage distribution of traffic per HTTP protocol over a given time period.
-func (r *RadarHTTPSummaryService) HTTPProtocol(ctx context.Context, query RadarHTTPSummaryHTTPProtocolParams, opts ...option.RequestOption) (res *RadarHTTPSummaryHTTPProtocolResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarHTTPSummaryHTTPProtocolResponseEnvelope
- path := "radar/http/summary/http_protocol"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Percentage distribution of traffic per HTTP protocol version over a given time
-// period.
-func (r *RadarHTTPSummaryService) HTTPVersion(ctx context.Context, query RadarHTTPSummaryHTTPVersionParams, opts ...option.RequestOption) (res *RadarHTTPSummaryHTTPVersionResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarHTTPSummaryHTTPVersionResponseEnvelope
- path := "radar/http/summary/http_version"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Percentage distribution of Internet traffic based on IP protocol versions, such
-// as IPv4 and IPv6, over a given time period.
-func (r *RadarHTTPSummaryService) IPVersion(ctx context.Context, query RadarHTTPSummaryIPVersionParams, opts ...option.RequestOption) (res *RadarHTTPSummaryIPVersionResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarHTTPSummaryIPVersionResponseEnvelope
- path := "radar/http/summary/ip_version"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Percentage distribution of Internet traffic generated by different operating
-// systems like Windows, macOS, Android, iOS, and others, over a given time period.
-func (r *RadarHTTPSummaryService) OS(ctx context.Context, query RadarHTTPSummaryOSParams, opts ...option.RequestOption) (res *RadarHTTPSummaryOSResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarHTTPSummaryOSResponseEnvelope
- path := "radar/http/summary/os"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Percentage distribution of traffic per TLS protocol version, over a given time
-// period.
-func (r *RadarHTTPSummaryService) TLSVersion(ctx context.Context, query RadarHTTPSummaryTLSVersionParams, opts ...option.RequestOption) (res *RadarHTTPSummaryTLSVersionResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarHTTPSummaryTLSVersionResponseEnvelope
- path := "radar/http/summary/tls_version"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type RadarHTTPSummaryBotClassResponse struct {
- Meta RadarHTTPSummaryBotClassResponseMeta `json:"meta,required"`
- Summary0 RadarHTTPSummaryBotClassResponseSummary0 `json:"summary_0,required"`
- JSON radarHTTPSummaryBotClassResponseJSON `json:"-"`
-}
-
-// radarHTTPSummaryBotClassResponseJSON contains the JSON metadata for the struct
-// [RadarHTTPSummaryBotClassResponse]
-type radarHTTPSummaryBotClassResponseJSON struct {
- Meta apijson.Field
- Summary0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPSummaryBotClassResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPSummaryBotClassResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPSummaryBotClassResponseMeta struct {
- DateRange []RadarHTTPSummaryBotClassResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- Normalization string `json:"normalization,required"`
- ConfidenceInfo RadarHTTPSummaryBotClassResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarHTTPSummaryBotClassResponseMetaJSON `json:"-"`
-}
-
-// radarHTTPSummaryBotClassResponseMetaJSON contains the JSON metadata for the
-// struct [RadarHTTPSummaryBotClassResponseMeta]
-type radarHTTPSummaryBotClassResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- Normalization apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPSummaryBotClassResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPSummaryBotClassResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPSummaryBotClassResponseMetaDateRange 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 radarHTTPSummaryBotClassResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarHTTPSummaryBotClassResponseMetaDateRangeJSON contains the JSON metadata for
-// the struct [RadarHTTPSummaryBotClassResponseMetaDateRange]
-type radarHTTPSummaryBotClassResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPSummaryBotClassResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPSummaryBotClassResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPSummaryBotClassResponseMetaConfidenceInfo struct {
- Annotations []RadarHTTPSummaryBotClassResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarHTTPSummaryBotClassResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarHTTPSummaryBotClassResponseMetaConfidenceInfoJSON contains the JSON
-// metadata for the struct [RadarHTTPSummaryBotClassResponseMetaConfidenceInfo]
-type radarHTTPSummaryBotClassResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPSummaryBotClassResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPSummaryBotClassResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPSummaryBotClassResponseMetaConfidenceInfoAnnotation 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 radarHTTPSummaryBotClassResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarHTTPSummaryBotClassResponseMetaConfidenceInfoAnnotationJSON contains the
-// JSON metadata for the struct
-// [RadarHTTPSummaryBotClassResponseMetaConfidenceInfoAnnotation]
-type radarHTTPSummaryBotClassResponseMetaConfidenceInfoAnnotationJSON 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 *RadarHTTPSummaryBotClassResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPSummaryBotClassResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPSummaryBotClassResponseSummary0 struct {
- Bot string `json:"bot,required"`
- Human string `json:"human,required"`
- JSON radarHTTPSummaryBotClassResponseSummary0JSON `json:"-"`
-}
-
-// radarHTTPSummaryBotClassResponseSummary0JSON contains the JSON metadata for the
-// struct [RadarHTTPSummaryBotClassResponseSummary0]
-type radarHTTPSummaryBotClassResponseSummary0JSON struct {
- Bot apijson.Field
- Human apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPSummaryBotClassResponseSummary0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPSummaryBotClassResponseSummary0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPSummaryDeviceTypeResponse struct {
- Meta RadarHTTPSummaryDeviceTypeResponseMeta `json:"meta,required"`
- Summary0 RadarHTTPSummaryDeviceTypeResponseSummary0 `json:"summary_0,required"`
- JSON radarHTTPSummaryDeviceTypeResponseJSON `json:"-"`
-}
-
-// radarHTTPSummaryDeviceTypeResponseJSON contains the JSON metadata for the struct
-// [RadarHTTPSummaryDeviceTypeResponse]
-type radarHTTPSummaryDeviceTypeResponseJSON struct {
- Meta apijson.Field
- Summary0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPSummaryDeviceTypeResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPSummaryDeviceTypeResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPSummaryDeviceTypeResponseMeta struct {
- DateRange []RadarHTTPSummaryDeviceTypeResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- Normalization string `json:"normalization,required"`
- ConfidenceInfo RadarHTTPSummaryDeviceTypeResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarHTTPSummaryDeviceTypeResponseMetaJSON `json:"-"`
-}
-
-// radarHTTPSummaryDeviceTypeResponseMetaJSON contains the JSON metadata for the
-// struct [RadarHTTPSummaryDeviceTypeResponseMeta]
-type radarHTTPSummaryDeviceTypeResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- Normalization apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPSummaryDeviceTypeResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPSummaryDeviceTypeResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPSummaryDeviceTypeResponseMetaDateRange 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 radarHTTPSummaryDeviceTypeResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarHTTPSummaryDeviceTypeResponseMetaDateRangeJSON contains the JSON metadata
-// for the struct [RadarHTTPSummaryDeviceTypeResponseMetaDateRange]
-type radarHTTPSummaryDeviceTypeResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPSummaryDeviceTypeResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPSummaryDeviceTypeResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPSummaryDeviceTypeResponseMetaConfidenceInfo struct {
- Annotations []RadarHTTPSummaryDeviceTypeResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarHTTPSummaryDeviceTypeResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarHTTPSummaryDeviceTypeResponseMetaConfidenceInfoJSON contains the JSON
-// metadata for the struct [RadarHTTPSummaryDeviceTypeResponseMetaConfidenceInfo]
-type radarHTTPSummaryDeviceTypeResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPSummaryDeviceTypeResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPSummaryDeviceTypeResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPSummaryDeviceTypeResponseMetaConfidenceInfoAnnotation 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 radarHTTPSummaryDeviceTypeResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarHTTPSummaryDeviceTypeResponseMetaConfidenceInfoAnnotationJSON contains the
-// JSON metadata for the struct
-// [RadarHTTPSummaryDeviceTypeResponseMetaConfidenceInfoAnnotation]
-type radarHTTPSummaryDeviceTypeResponseMetaConfidenceInfoAnnotationJSON 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 *RadarHTTPSummaryDeviceTypeResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPSummaryDeviceTypeResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPSummaryDeviceTypeResponseSummary0 struct {
- Desktop string `json:"desktop,required"`
- Mobile string `json:"mobile,required"`
- Other string `json:"other,required"`
- JSON radarHTTPSummaryDeviceTypeResponseSummary0JSON `json:"-"`
-}
-
-// radarHTTPSummaryDeviceTypeResponseSummary0JSON contains the JSON metadata for
-// the struct [RadarHTTPSummaryDeviceTypeResponseSummary0]
-type radarHTTPSummaryDeviceTypeResponseSummary0JSON struct {
- Desktop apijson.Field
- Mobile apijson.Field
- Other apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPSummaryDeviceTypeResponseSummary0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPSummaryDeviceTypeResponseSummary0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPSummaryHTTPProtocolResponse struct {
- Meta RadarHTTPSummaryHTTPProtocolResponseMeta `json:"meta,required"`
- Summary0 RadarHTTPSummaryHTTPProtocolResponseSummary0 `json:"summary_0,required"`
- JSON radarHTTPSummaryHTTPProtocolResponseJSON `json:"-"`
-}
-
-// radarHTTPSummaryHTTPProtocolResponseJSON contains the JSON metadata for the
-// struct [RadarHTTPSummaryHTTPProtocolResponse]
-type radarHTTPSummaryHTTPProtocolResponseJSON struct {
- Meta apijson.Field
- Summary0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPSummaryHTTPProtocolResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPSummaryHTTPProtocolResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPSummaryHTTPProtocolResponseMeta struct {
- DateRange []RadarHTTPSummaryHTTPProtocolResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- Normalization string `json:"normalization,required"`
- ConfidenceInfo RadarHTTPSummaryHTTPProtocolResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarHTTPSummaryHTTPProtocolResponseMetaJSON `json:"-"`
-}
-
-// radarHTTPSummaryHTTPProtocolResponseMetaJSON contains the JSON metadata for the
-// struct [RadarHTTPSummaryHTTPProtocolResponseMeta]
-type radarHTTPSummaryHTTPProtocolResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- Normalization apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPSummaryHTTPProtocolResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPSummaryHTTPProtocolResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPSummaryHTTPProtocolResponseMetaDateRange 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 radarHTTPSummaryHTTPProtocolResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarHTTPSummaryHTTPProtocolResponseMetaDateRangeJSON contains the JSON metadata
-// for the struct [RadarHTTPSummaryHTTPProtocolResponseMetaDateRange]
-type radarHTTPSummaryHTTPProtocolResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPSummaryHTTPProtocolResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPSummaryHTTPProtocolResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPSummaryHTTPProtocolResponseMetaConfidenceInfo struct {
- Annotations []RadarHTTPSummaryHTTPProtocolResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarHTTPSummaryHTTPProtocolResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarHTTPSummaryHTTPProtocolResponseMetaConfidenceInfoJSON contains the JSON
-// metadata for the struct [RadarHTTPSummaryHTTPProtocolResponseMetaConfidenceInfo]
-type radarHTTPSummaryHTTPProtocolResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPSummaryHTTPProtocolResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPSummaryHTTPProtocolResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPSummaryHTTPProtocolResponseMetaConfidenceInfoAnnotation 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 radarHTTPSummaryHTTPProtocolResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarHTTPSummaryHTTPProtocolResponseMetaConfidenceInfoAnnotationJSON contains
-// the JSON metadata for the struct
-// [RadarHTTPSummaryHTTPProtocolResponseMetaConfidenceInfoAnnotation]
-type radarHTTPSummaryHTTPProtocolResponseMetaConfidenceInfoAnnotationJSON 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 *RadarHTTPSummaryHTTPProtocolResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPSummaryHTTPProtocolResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPSummaryHTTPProtocolResponseSummary0 struct {
- HTTP string `json:"http,required"`
- HTTPS string `json:"https,required"`
- JSON radarHTTPSummaryHTTPProtocolResponseSummary0JSON `json:"-"`
-}
-
-// radarHTTPSummaryHTTPProtocolResponseSummary0JSON contains the JSON metadata for
-// the struct [RadarHTTPSummaryHTTPProtocolResponseSummary0]
-type radarHTTPSummaryHTTPProtocolResponseSummary0JSON struct {
- HTTP apijson.Field
- HTTPS apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPSummaryHTTPProtocolResponseSummary0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPSummaryHTTPProtocolResponseSummary0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPSummaryHTTPVersionResponse struct {
- Meta RadarHTTPSummaryHTTPVersionResponseMeta `json:"meta,required"`
- Summary0 RadarHTTPSummaryHTTPVersionResponseSummary0 `json:"summary_0,required"`
- JSON radarHTTPSummaryHTTPVersionResponseJSON `json:"-"`
-}
-
-// radarHTTPSummaryHTTPVersionResponseJSON contains the JSON metadata for the
-// struct [RadarHTTPSummaryHTTPVersionResponse]
-type radarHTTPSummaryHTTPVersionResponseJSON struct {
- Meta apijson.Field
- Summary0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPSummaryHTTPVersionResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPSummaryHTTPVersionResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPSummaryHTTPVersionResponseMeta struct {
- DateRange []RadarHTTPSummaryHTTPVersionResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- Normalization string `json:"normalization,required"`
- ConfidenceInfo RadarHTTPSummaryHTTPVersionResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarHTTPSummaryHTTPVersionResponseMetaJSON `json:"-"`
-}
-
-// radarHTTPSummaryHTTPVersionResponseMetaJSON contains the JSON metadata for the
-// struct [RadarHTTPSummaryHTTPVersionResponseMeta]
-type radarHTTPSummaryHTTPVersionResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- Normalization apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPSummaryHTTPVersionResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPSummaryHTTPVersionResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPSummaryHTTPVersionResponseMetaDateRange 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 radarHTTPSummaryHTTPVersionResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarHTTPSummaryHTTPVersionResponseMetaDateRangeJSON contains the JSON metadata
-// for the struct [RadarHTTPSummaryHTTPVersionResponseMetaDateRange]
-type radarHTTPSummaryHTTPVersionResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPSummaryHTTPVersionResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPSummaryHTTPVersionResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPSummaryHTTPVersionResponseMetaConfidenceInfo struct {
- Annotations []RadarHTTPSummaryHTTPVersionResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarHTTPSummaryHTTPVersionResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarHTTPSummaryHTTPVersionResponseMetaConfidenceInfoJSON contains the JSON
-// metadata for the struct [RadarHTTPSummaryHTTPVersionResponseMetaConfidenceInfo]
-type radarHTTPSummaryHTTPVersionResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPSummaryHTTPVersionResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPSummaryHTTPVersionResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPSummaryHTTPVersionResponseMetaConfidenceInfoAnnotation 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 radarHTTPSummaryHTTPVersionResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarHTTPSummaryHTTPVersionResponseMetaConfidenceInfoAnnotationJSON contains the
-// JSON metadata for the struct
-// [RadarHTTPSummaryHTTPVersionResponseMetaConfidenceInfoAnnotation]
-type radarHTTPSummaryHTTPVersionResponseMetaConfidenceInfoAnnotationJSON 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 *RadarHTTPSummaryHTTPVersionResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPSummaryHTTPVersionResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPSummaryHTTPVersionResponseSummary0 struct {
- HTTP1X string `json:"HTTP/1.x,required"`
- HTTP2 string `json:"HTTP/2,required"`
- HTTP3 string `json:"HTTP/3,required"`
- JSON radarHTTPSummaryHTTPVersionResponseSummary0JSON `json:"-"`
-}
-
-// radarHTTPSummaryHTTPVersionResponseSummary0JSON contains the JSON metadata for
-// the struct [RadarHTTPSummaryHTTPVersionResponseSummary0]
-type radarHTTPSummaryHTTPVersionResponseSummary0JSON struct {
- HTTP1X apijson.Field
- HTTP2 apijson.Field
- HTTP3 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPSummaryHTTPVersionResponseSummary0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPSummaryHTTPVersionResponseSummary0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPSummaryIPVersionResponse struct {
- Meta RadarHTTPSummaryIPVersionResponseMeta `json:"meta,required"`
- Summary0 RadarHTTPSummaryIPVersionResponseSummary0 `json:"summary_0,required"`
- JSON radarHTTPSummaryIPVersionResponseJSON `json:"-"`
-}
-
-// radarHTTPSummaryIPVersionResponseJSON contains the JSON metadata for the struct
-// [RadarHTTPSummaryIPVersionResponse]
-type radarHTTPSummaryIPVersionResponseJSON struct {
- Meta apijson.Field
- Summary0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPSummaryIPVersionResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPSummaryIPVersionResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPSummaryIPVersionResponseMeta struct {
- DateRange []RadarHTTPSummaryIPVersionResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- Normalization string `json:"normalization,required"`
- ConfidenceInfo RadarHTTPSummaryIPVersionResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarHTTPSummaryIPVersionResponseMetaJSON `json:"-"`
-}
-
-// radarHTTPSummaryIPVersionResponseMetaJSON contains the JSON metadata for the
-// struct [RadarHTTPSummaryIPVersionResponseMeta]
-type radarHTTPSummaryIPVersionResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- Normalization apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPSummaryIPVersionResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPSummaryIPVersionResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPSummaryIPVersionResponseMetaDateRange 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 radarHTTPSummaryIPVersionResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarHTTPSummaryIPVersionResponseMetaDateRangeJSON contains the JSON metadata
-// for the struct [RadarHTTPSummaryIPVersionResponseMetaDateRange]
-type radarHTTPSummaryIPVersionResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPSummaryIPVersionResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPSummaryIPVersionResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPSummaryIPVersionResponseMetaConfidenceInfo struct {
- Annotations []RadarHTTPSummaryIPVersionResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarHTTPSummaryIPVersionResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarHTTPSummaryIPVersionResponseMetaConfidenceInfoJSON contains the JSON
-// metadata for the struct [RadarHTTPSummaryIPVersionResponseMetaConfidenceInfo]
-type radarHTTPSummaryIPVersionResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPSummaryIPVersionResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPSummaryIPVersionResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPSummaryIPVersionResponseMetaConfidenceInfoAnnotation 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 radarHTTPSummaryIPVersionResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarHTTPSummaryIPVersionResponseMetaConfidenceInfoAnnotationJSON contains the
-// JSON metadata for the struct
-// [RadarHTTPSummaryIPVersionResponseMetaConfidenceInfoAnnotation]
-type radarHTTPSummaryIPVersionResponseMetaConfidenceInfoAnnotationJSON 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 *RadarHTTPSummaryIPVersionResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPSummaryIPVersionResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPSummaryIPVersionResponseSummary0 struct {
- IPv4 string `json:"IPv4,required"`
- IPv6 string `json:"IPv6,required"`
- JSON radarHTTPSummaryIPVersionResponseSummary0JSON `json:"-"`
-}
-
-// radarHTTPSummaryIPVersionResponseSummary0JSON contains the JSON metadata for the
-// struct [RadarHTTPSummaryIPVersionResponseSummary0]
-type radarHTTPSummaryIPVersionResponseSummary0JSON struct {
- IPv4 apijson.Field
- IPv6 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPSummaryIPVersionResponseSummary0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPSummaryIPVersionResponseSummary0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPSummaryOSResponse struct {
- Meta RadarHTTPSummaryOSResponseMeta `json:"meta,required"`
- Summary0 RadarHTTPSummaryOSResponseSummary0 `json:"summary_0,required"`
- JSON radarHTTPSummaryOSResponseJSON `json:"-"`
-}
-
-// radarHTTPSummaryOSResponseJSON contains the JSON metadata for the struct
-// [RadarHTTPSummaryOSResponse]
-type radarHTTPSummaryOSResponseJSON struct {
- Meta apijson.Field
- Summary0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPSummaryOSResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPSummaryOSResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPSummaryOSResponseMeta struct {
- DateRange []RadarHTTPSummaryOSResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- Normalization string `json:"normalization,required"`
- ConfidenceInfo RadarHTTPSummaryOSResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarHTTPSummaryOSResponseMetaJSON `json:"-"`
-}
-
-// radarHTTPSummaryOSResponseMetaJSON contains the JSON metadata for the struct
-// [RadarHTTPSummaryOSResponseMeta]
-type radarHTTPSummaryOSResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- Normalization apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPSummaryOSResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPSummaryOSResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPSummaryOSResponseMetaDateRange 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 radarHTTPSummaryOSResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarHTTPSummaryOSResponseMetaDateRangeJSON contains the JSON metadata for the
-// struct [RadarHTTPSummaryOSResponseMetaDateRange]
-type radarHTTPSummaryOSResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPSummaryOSResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPSummaryOSResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPSummaryOSResponseMetaConfidenceInfo struct {
- Annotations []RadarHTTPSummaryOSResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarHTTPSummaryOSResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarHTTPSummaryOSResponseMetaConfidenceInfoJSON contains the JSON metadata for
-// the struct [RadarHTTPSummaryOSResponseMetaConfidenceInfo]
-type radarHTTPSummaryOSResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPSummaryOSResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPSummaryOSResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPSummaryOSResponseMetaConfidenceInfoAnnotation 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 radarHTTPSummaryOSResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarHTTPSummaryOSResponseMetaConfidenceInfoAnnotationJSON contains the JSON
-// metadata for the struct [RadarHTTPSummaryOSResponseMetaConfidenceInfoAnnotation]
-type radarHTTPSummaryOSResponseMetaConfidenceInfoAnnotationJSON 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 *RadarHTTPSummaryOSResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPSummaryOSResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPSummaryOSResponseSummary0 struct {
- Android string `json:"ANDROID,required"`
- Ios string `json:"IOS,required"`
- JSON radarHTTPSummaryOSResponseSummary0JSON `json:"-"`
-}
-
-// radarHTTPSummaryOSResponseSummary0JSON contains the JSON metadata for the struct
-// [RadarHTTPSummaryOSResponseSummary0]
-type radarHTTPSummaryOSResponseSummary0JSON struct {
- Android apijson.Field
- Ios apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPSummaryOSResponseSummary0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPSummaryOSResponseSummary0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPSummaryTLSVersionResponse struct {
- Meta RadarHTTPSummaryTLSVersionResponseMeta `json:"meta,required"`
- Summary0 RadarHTTPSummaryTLSVersionResponseSummary0 `json:"summary_0,required"`
- JSON radarHTTPSummaryTLSVersionResponseJSON `json:"-"`
-}
-
-// radarHTTPSummaryTLSVersionResponseJSON contains the JSON metadata for the struct
-// [RadarHTTPSummaryTLSVersionResponse]
-type radarHTTPSummaryTLSVersionResponseJSON struct {
- Meta apijson.Field
- Summary0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPSummaryTLSVersionResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPSummaryTLSVersionResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPSummaryTLSVersionResponseMeta struct {
- DateRange []RadarHTTPSummaryTLSVersionResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- Normalization string `json:"normalization,required"`
- ConfidenceInfo RadarHTTPSummaryTLSVersionResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarHTTPSummaryTLSVersionResponseMetaJSON `json:"-"`
-}
-
-// radarHTTPSummaryTLSVersionResponseMetaJSON contains the JSON metadata for the
-// struct [RadarHTTPSummaryTLSVersionResponseMeta]
-type radarHTTPSummaryTLSVersionResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- Normalization apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPSummaryTLSVersionResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPSummaryTLSVersionResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPSummaryTLSVersionResponseMetaDateRange 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 radarHTTPSummaryTLSVersionResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarHTTPSummaryTLSVersionResponseMetaDateRangeJSON contains the JSON metadata
-// for the struct [RadarHTTPSummaryTLSVersionResponseMetaDateRange]
-type radarHTTPSummaryTLSVersionResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPSummaryTLSVersionResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPSummaryTLSVersionResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPSummaryTLSVersionResponseMetaConfidenceInfo struct {
- Annotations []RadarHTTPSummaryTLSVersionResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarHTTPSummaryTLSVersionResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarHTTPSummaryTLSVersionResponseMetaConfidenceInfoJSON contains the JSON
-// metadata for the struct [RadarHTTPSummaryTLSVersionResponseMetaConfidenceInfo]
-type radarHTTPSummaryTLSVersionResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPSummaryTLSVersionResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPSummaryTLSVersionResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPSummaryTLSVersionResponseMetaConfidenceInfoAnnotation 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 radarHTTPSummaryTLSVersionResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarHTTPSummaryTLSVersionResponseMetaConfidenceInfoAnnotationJSON contains the
-// JSON metadata for the struct
-// [RadarHTTPSummaryTLSVersionResponseMetaConfidenceInfoAnnotation]
-type radarHTTPSummaryTLSVersionResponseMetaConfidenceInfoAnnotationJSON 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 *RadarHTTPSummaryTLSVersionResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPSummaryTLSVersionResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPSummaryTLSVersionResponseSummary0 struct {
- TLS1_0 string `json:"TLS 1.0,required"`
- TLS1_1 string `json:"TLS 1.1,required"`
- TLS1_2 string `json:"TLS 1.2,required"`
- TLS1_3 string `json:"TLS 1.3,required"`
- TLSQuic string `json:"TLS QUIC,required"`
- JSON radarHTTPSummaryTLSVersionResponseSummary0JSON `json:"-"`
-}
-
-// radarHTTPSummaryTLSVersionResponseSummary0JSON contains the JSON metadata for
-// the struct [RadarHTTPSummaryTLSVersionResponseSummary0]
-type radarHTTPSummaryTLSVersionResponseSummary0JSON struct {
- TLS1_0 apijson.Field
- TLS1_1 apijson.Field
- TLS1_2 apijson.Field
- TLS1_3 apijson.Field
- TLSQuic apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPSummaryTLSVersionResponseSummary0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPSummaryTLSVersionResponseSummary0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPSummaryBotClassParams 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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarHTTPSummaryBotClassParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Filter for device type.
- DeviceType param.Field[[]RadarHTTPSummaryBotClassParamsDeviceType] `query:"deviceType"`
- // Format results are returned in.
- Format param.Field[RadarHTTPSummaryBotClassParamsFormat] `query:"format"`
- // Filter for http protocol.
- HTTPProtocol param.Field[[]RadarHTTPSummaryBotClassParamsHTTPProtocol] `query:"httpProtocol"`
- // Filter for http version.
- HTTPVersion param.Field[[]RadarHTTPSummaryBotClassParamsHTTPVersion] `query:"httpVersion"`
- // Filter for ip version.
- IPVersion param.Field[[]RadarHTTPSummaryBotClassParamsIPVersion] `query:"ipVersion"`
- // 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 os name.
- OS param.Field[[]RadarHTTPSummaryBotClassParamsOS] `query:"os"`
- // Filter for tls version.
- TLSVersion param.Field[[]RadarHTTPSummaryBotClassParamsTLSVersion] `query:"tlsVersion"`
-}
-
-// URLQuery serializes [RadarHTTPSummaryBotClassParams]'s query parameters as
-// `url.Values`.
-func (r RadarHTTPSummaryBotClassParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type RadarHTTPSummaryBotClassParamsDateRange string
-
-const (
- RadarHTTPSummaryBotClassParamsDateRange1d RadarHTTPSummaryBotClassParamsDateRange = "1d"
- RadarHTTPSummaryBotClassParamsDateRange2d RadarHTTPSummaryBotClassParamsDateRange = "2d"
- RadarHTTPSummaryBotClassParamsDateRange7d RadarHTTPSummaryBotClassParamsDateRange = "7d"
- RadarHTTPSummaryBotClassParamsDateRange14d RadarHTTPSummaryBotClassParamsDateRange = "14d"
- RadarHTTPSummaryBotClassParamsDateRange28d RadarHTTPSummaryBotClassParamsDateRange = "28d"
- RadarHTTPSummaryBotClassParamsDateRange12w RadarHTTPSummaryBotClassParamsDateRange = "12w"
- RadarHTTPSummaryBotClassParamsDateRange24w RadarHTTPSummaryBotClassParamsDateRange = "24w"
- RadarHTTPSummaryBotClassParamsDateRange52w RadarHTTPSummaryBotClassParamsDateRange = "52w"
- RadarHTTPSummaryBotClassParamsDateRange1dControl RadarHTTPSummaryBotClassParamsDateRange = "1dControl"
- RadarHTTPSummaryBotClassParamsDateRange2dControl RadarHTTPSummaryBotClassParamsDateRange = "2dControl"
- RadarHTTPSummaryBotClassParamsDateRange7dControl RadarHTTPSummaryBotClassParamsDateRange = "7dControl"
- RadarHTTPSummaryBotClassParamsDateRange14dControl RadarHTTPSummaryBotClassParamsDateRange = "14dControl"
- RadarHTTPSummaryBotClassParamsDateRange28dControl RadarHTTPSummaryBotClassParamsDateRange = "28dControl"
- RadarHTTPSummaryBotClassParamsDateRange12wControl RadarHTTPSummaryBotClassParamsDateRange = "12wControl"
- RadarHTTPSummaryBotClassParamsDateRange24wControl RadarHTTPSummaryBotClassParamsDateRange = "24wControl"
-)
-
-type RadarHTTPSummaryBotClassParamsDeviceType string
-
-const (
- RadarHTTPSummaryBotClassParamsDeviceTypeDesktop RadarHTTPSummaryBotClassParamsDeviceType = "DESKTOP"
- RadarHTTPSummaryBotClassParamsDeviceTypeMobile RadarHTTPSummaryBotClassParamsDeviceType = "MOBILE"
- RadarHTTPSummaryBotClassParamsDeviceTypeOther RadarHTTPSummaryBotClassParamsDeviceType = "OTHER"
-)
-
-// Format results are returned in.
-type RadarHTTPSummaryBotClassParamsFormat string
-
-const (
- RadarHTTPSummaryBotClassParamsFormatJson RadarHTTPSummaryBotClassParamsFormat = "JSON"
- RadarHTTPSummaryBotClassParamsFormatCsv RadarHTTPSummaryBotClassParamsFormat = "CSV"
-)
-
-type RadarHTTPSummaryBotClassParamsHTTPProtocol string
-
-const (
- RadarHTTPSummaryBotClassParamsHTTPProtocolHTTP RadarHTTPSummaryBotClassParamsHTTPProtocol = "HTTP"
- RadarHTTPSummaryBotClassParamsHTTPProtocolHTTPS RadarHTTPSummaryBotClassParamsHTTPProtocol = "HTTPS"
-)
-
-type RadarHTTPSummaryBotClassParamsHTTPVersion string
-
-const (
- RadarHTTPSummaryBotClassParamsHTTPVersionHttPv1 RadarHTTPSummaryBotClassParamsHTTPVersion = "HTTPv1"
- RadarHTTPSummaryBotClassParamsHTTPVersionHttPv2 RadarHTTPSummaryBotClassParamsHTTPVersion = "HTTPv2"
- RadarHTTPSummaryBotClassParamsHTTPVersionHttPv3 RadarHTTPSummaryBotClassParamsHTTPVersion = "HTTPv3"
-)
-
-type RadarHTTPSummaryBotClassParamsIPVersion string
-
-const (
- RadarHTTPSummaryBotClassParamsIPVersionIPv4 RadarHTTPSummaryBotClassParamsIPVersion = "IPv4"
- RadarHTTPSummaryBotClassParamsIPVersionIPv6 RadarHTTPSummaryBotClassParamsIPVersion = "IPv6"
-)
-
-type RadarHTTPSummaryBotClassParamsOS string
-
-const (
- RadarHTTPSummaryBotClassParamsOSWindows RadarHTTPSummaryBotClassParamsOS = "WINDOWS"
- RadarHTTPSummaryBotClassParamsOSMacosx RadarHTTPSummaryBotClassParamsOS = "MACOSX"
- RadarHTTPSummaryBotClassParamsOSIos RadarHTTPSummaryBotClassParamsOS = "IOS"
- RadarHTTPSummaryBotClassParamsOSAndroid RadarHTTPSummaryBotClassParamsOS = "ANDROID"
- RadarHTTPSummaryBotClassParamsOSChromeos RadarHTTPSummaryBotClassParamsOS = "CHROMEOS"
- RadarHTTPSummaryBotClassParamsOSLinux RadarHTTPSummaryBotClassParamsOS = "LINUX"
- RadarHTTPSummaryBotClassParamsOSSmartTv RadarHTTPSummaryBotClassParamsOS = "SMART_TV"
-)
-
-type RadarHTTPSummaryBotClassParamsTLSVersion string
-
-const (
- RadarHTTPSummaryBotClassParamsTLSVersionTlSv1_0 RadarHTTPSummaryBotClassParamsTLSVersion = "TLSv1_0"
- RadarHTTPSummaryBotClassParamsTLSVersionTlSv1_1 RadarHTTPSummaryBotClassParamsTLSVersion = "TLSv1_1"
- RadarHTTPSummaryBotClassParamsTLSVersionTlSv1_2 RadarHTTPSummaryBotClassParamsTLSVersion = "TLSv1_2"
- RadarHTTPSummaryBotClassParamsTLSVersionTlSv1_3 RadarHTTPSummaryBotClassParamsTLSVersion = "TLSv1_3"
- RadarHTTPSummaryBotClassParamsTLSVersionTlSvQuic RadarHTTPSummaryBotClassParamsTLSVersion = "TLSvQUIC"
-)
-
-type RadarHTTPSummaryBotClassResponseEnvelope struct {
- Result RadarHTTPSummaryBotClassResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarHTTPSummaryBotClassResponseEnvelopeJSON `json:"-"`
-}
-
-// radarHTTPSummaryBotClassResponseEnvelopeJSON contains the JSON metadata for the
-// struct [RadarHTTPSummaryBotClassResponseEnvelope]
-type radarHTTPSummaryBotClassResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPSummaryBotClassResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPSummaryBotClassResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPSummaryDeviceTypeParams 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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarHTTPSummaryDeviceTypeParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Format results are returned in.
- Format param.Field[RadarHTTPSummaryDeviceTypeParamsFormat] `query:"format"`
- // Filter for http protocol.
- HTTPProtocol param.Field[[]RadarHTTPSummaryDeviceTypeParamsHTTPProtocol] `query:"httpProtocol"`
- // Filter for http version.
- HTTPVersion param.Field[[]RadarHTTPSummaryDeviceTypeParamsHTTPVersion] `query:"httpVersion"`
- // Filter for ip version.
- IPVersion param.Field[[]RadarHTTPSummaryDeviceTypeParamsIPVersion] `query:"ipVersion"`
- // 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 os name.
- OS param.Field[[]RadarHTTPSummaryDeviceTypeParamsOS] `query:"os"`
- // Filter for tls version.
- TLSVersion param.Field[[]RadarHTTPSummaryDeviceTypeParamsTLSVersion] `query:"tlsVersion"`
-}
-
-// URLQuery serializes [RadarHTTPSummaryDeviceTypeParams]'s query parameters as
-// `url.Values`.
-func (r RadarHTTPSummaryDeviceTypeParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type RadarHTTPSummaryDeviceTypeParamsBotClass string
-
-const (
- RadarHTTPSummaryDeviceTypeParamsBotClassLikelyAutomated RadarHTTPSummaryDeviceTypeParamsBotClass = "LIKELY_AUTOMATED"
- RadarHTTPSummaryDeviceTypeParamsBotClassLikelyHuman RadarHTTPSummaryDeviceTypeParamsBotClass = "LIKELY_HUMAN"
-)
-
-type RadarHTTPSummaryDeviceTypeParamsDateRange string
-
-const (
- RadarHTTPSummaryDeviceTypeParamsDateRange1d RadarHTTPSummaryDeviceTypeParamsDateRange = "1d"
- RadarHTTPSummaryDeviceTypeParamsDateRange2d RadarHTTPSummaryDeviceTypeParamsDateRange = "2d"
- RadarHTTPSummaryDeviceTypeParamsDateRange7d RadarHTTPSummaryDeviceTypeParamsDateRange = "7d"
- RadarHTTPSummaryDeviceTypeParamsDateRange14d RadarHTTPSummaryDeviceTypeParamsDateRange = "14d"
- RadarHTTPSummaryDeviceTypeParamsDateRange28d RadarHTTPSummaryDeviceTypeParamsDateRange = "28d"
- RadarHTTPSummaryDeviceTypeParamsDateRange12w RadarHTTPSummaryDeviceTypeParamsDateRange = "12w"
- RadarHTTPSummaryDeviceTypeParamsDateRange24w RadarHTTPSummaryDeviceTypeParamsDateRange = "24w"
- RadarHTTPSummaryDeviceTypeParamsDateRange52w RadarHTTPSummaryDeviceTypeParamsDateRange = "52w"
- RadarHTTPSummaryDeviceTypeParamsDateRange1dControl RadarHTTPSummaryDeviceTypeParamsDateRange = "1dControl"
- RadarHTTPSummaryDeviceTypeParamsDateRange2dControl RadarHTTPSummaryDeviceTypeParamsDateRange = "2dControl"
- RadarHTTPSummaryDeviceTypeParamsDateRange7dControl RadarHTTPSummaryDeviceTypeParamsDateRange = "7dControl"
- RadarHTTPSummaryDeviceTypeParamsDateRange14dControl RadarHTTPSummaryDeviceTypeParamsDateRange = "14dControl"
- RadarHTTPSummaryDeviceTypeParamsDateRange28dControl RadarHTTPSummaryDeviceTypeParamsDateRange = "28dControl"
- RadarHTTPSummaryDeviceTypeParamsDateRange12wControl RadarHTTPSummaryDeviceTypeParamsDateRange = "12wControl"
- RadarHTTPSummaryDeviceTypeParamsDateRange24wControl RadarHTTPSummaryDeviceTypeParamsDateRange = "24wControl"
-)
-
-// Format results are returned in.
-type RadarHTTPSummaryDeviceTypeParamsFormat string
-
-const (
- RadarHTTPSummaryDeviceTypeParamsFormatJson RadarHTTPSummaryDeviceTypeParamsFormat = "JSON"
- RadarHTTPSummaryDeviceTypeParamsFormatCsv RadarHTTPSummaryDeviceTypeParamsFormat = "CSV"
-)
-
-type RadarHTTPSummaryDeviceTypeParamsHTTPProtocol string
-
-const (
- RadarHTTPSummaryDeviceTypeParamsHTTPProtocolHTTP RadarHTTPSummaryDeviceTypeParamsHTTPProtocol = "HTTP"
- RadarHTTPSummaryDeviceTypeParamsHTTPProtocolHTTPS RadarHTTPSummaryDeviceTypeParamsHTTPProtocol = "HTTPS"
-)
-
-type RadarHTTPSummaryDeviceTypeParamsHTTPVersion string
-
-const (
- RadarHTTPSummaryDeviceTypeParamsHTTPVersionHttPv1 RadarHTTPSummaryDeviceTypeParamsHTTPVersion = "HTTPv1"
- RadarHTTPSummaryDeviceTypeParamsHTTPVersionHttPv2 RadarHTTPSummaryDeviceTypeParamsHTTPVersion = "HTTPv2"
- RadarHTTPSummaryDeviceTypeParamsHTTPVersionHttPv3 RadarHTTPSummaryDeviceTypeParamsHTTPVersion = "HTTPv3"
-)
-
-type RadarHTTPSummaryDeviceTypeParamsIPVersion string
-
-const (
- RadarHTTPSummaryDeviceTypeParamsIPVersionIPv4 RadarHTTPSummaryDeviceTypeParamsIPVersion = "IPv4"
- RadarHTTPSummaryDeviceTypeParamsIPVersionIPv6 RadarHTTPSummaryDeviceTypeParamsIPVersion = "IPv6"
-)
-
-type RadarHTTPSummaryDeviceTypeParamsOS string
-
-const (
- RadarHTTPSummaryDeviceTypeParamsOSWindows RadarHTTPSummaryDeviceTypeParamsOS = "WINDOWS"
- RadarHTTPSummaryDeviceTypeParamsOSMacosx RadarHTTPSummaryDeviceTypeParamsOS = "MACOSX"
- RadarHTTPSummaryDeviceTypeParamsOSIos RadarHTTPSummaryDeviceTypeParamsOS = "IOS"
- RadarHTTPSummaryDeviceTypeParamsOSAndroid RadarHTTPSummaryDeviceTypeParamsOS = "ANDROID"
- RadarHTTPSummaryDeviceTypeParamsOSChromeos RadarHTTPSummaryDeviceTypeParamsOS = "CHROMEOS"
- RadarHTTPSummaryDeviceTypeParamsOSLinux RadarHTTPSummaryDeviceTypeParamsOS = "LINUX"
- RadarHTTPSummaryDeviceTypeParamsOSSmartTv RadarHTTPSummaryDeviceTypeParamsOS = "SMART_TV"
-)
-
-type RadarHTTPSummaryDeviceTypeParamsTLSVersion string
-
-const (
- RadarHTTPSummaryDeviceTypeParamsTLSVersionTlSv1_0 RadarHTTPSummaryDeviceTypeParamsTLSVersion = "TLSv1_0"
- RadarHTTPSummaryDeviceTypeParamsTLSVersionTlSv1_1 RadarHTTPSummaryDeviceTypeParamsTLSVersion = "TLSv1_1"
- RadarHTTPSummaryDeviceTypeParamsTLSVersionTlSv1_2 RadarHTTPSummaryDeviceTypeParamsTLSVersion = "TLSv1_2"
- RadarHTTPSummaryDeviceTypeParamsTLSVersionTlSv1_3 RadarHTTPSummaryDeviceTypeParamsTLSVersion = "TLSv1_3"
- RadarHTTPSummaryDeviceTypeParamsTLSVersionTlSvQuic RadarHTTPSummaryDeviceTypeParamsTLSVersion = "TLSvQUIC"
-)
-
-type RadarHTTPSummaryDeviceTypeResponseEnvelope struct {
- Result RadarHTTPSummaryDeviceTypeResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarHTTPSummaryDeviceTypeResponseEnvelopeJSON `json:"-"`
-}
-
-// radarHTTPSummaryDeviceTypeResponseEnvelopeJSON contains the JSON metadata for
-// the struct [RadarHTTPSummaryDeviceTypeResponseEnvelope]
-type radarHTTPSummaryDeviceTypeResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPSummaryDeviceTypeResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPSummaryDeviceTypeResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPSummaryHTTPProtocolParams 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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarHTTPSummaryHTTPProtocolParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Filter for device type.
- DeviceType param.Field[[]RadarHTTPSummaryHTTPProtocolParamsDeviceType] `query:"deviceType"`
- // Format results are returned in.
- Format param.Field[RadarHTTPSummaryHTTPProtocolParamsFormat] `query:"format"`
- // Filter for http version.
- HTTPVersion param.Field[[]RadarHTTPSummaryHTTPProtocolParamsHTTPVersion] `query:"httpVersion"`
- // Filter for ip version.
- IPVersion param.Field[[]RadarHTTPSummaryHTTPProtocolParamsIPVersion] `query:"ipVersion"`
- // 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 os name.
- OS param.Field[[]RadarHTTPSummaryHTTPProtocolParamsOS] `query:"os"`
- // Filter for tls version.
- TLSVersion param.Field[[]RadarHTTPSummaryHTTPProtocolParamsTLSVersion] `query:"tlsVersion"`
-}
-
-// URLQuery serializes [RadarHTTPSummaryHTTPProtocolParams]'s query parameters as
-// `url.Values`.
-func (r RadarHTTPSummaryHTTPProtocolParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type RadarHTTPSummaryHTTPProtocolParamsBotClass string
-
-const (
- RadarHTTPSummaryHTTPProtocolParamsBotClassLikelyAutomated RadarHTTPSummaryHTTPProtocolParamsBotClass = "LIKELY_AUTOMATED"
- RadarHTTPSummaryHTTPProtocolParamsBotClassLikelyHuman RadarHTTPSummaryHTTPProtocolParamsBotClass = "LIKELY_HUMAN"
-)
-
-type RadarHTTPSummaryHTTPProtocolParamsDateRange string
-
-const (
- RadarHTTPSummaryHTTPProtocolParamsDateRange1d RadarHTTPSummaryHTTPProtocolParamsDateRange = "1d"
- RadarHTTPSummaryHTTPProtocolParamsDateRange2d RadarHTTPSummaryHTTPProtocolParamsDateRange = "2d"
- RadarHTTPSummaryHTTPProtocolParamsDateRange7d RadarHTTPSummaryHTTPProtocolParamsDateRange = "7d"
- RadarHTTPSummaryHTTPProtocolParamsDateRange14d RadarHTTPSummaryHTTPProtocolParamsDateRange = "14d"
- RadarHTTPSummaryHTTPProtocolParamsDateRange28d RadarHTTPSummaryHTTPProtocolParamsDateRange = "28d"
- RadarHTTPSummaryHTTPProtocolParamsDateRange12w RadarHTTPSummaryHTTPProtocolParamsDateRange = "12w"
- RadarHTTPSummaryHTTPProtocolParamsDateRange24w RadarHTTPSummaryHTTPProtocolParamsDateRange = "24w"
- RadarHTTPSummaryHTTPProtocolParamsDateRange52w RadarHTTPSummaryHTTPProtocolParamsDateRange = "52w"
- RadarHTTPSummaryHTTPProtocolParamsDateRange1dControl RadarHTTPSummaryHTTPProtocolParamsDateRange = "1dControl"
- RadarHTTPSummaryHTTPProtocolParamsDateRange2dControl RadarHTTPSummaryHTTPProtocolParamsDateRange = "2dControl"
- RadarHTTPSummaryHTTPProtocolParamsDateRange7dControl RadarHTTPSummaryHTTPProtocolParamsDateRange = "7dControl"
- RadarHTTPSummaryHTTPProtocolParamsDateRange14dControl RadarHTTPSummaryHTTPProtocolParamsDateRange = "14dControl"
- RadarHTTPSummaryHTTPProtocolParamsDateRange28dControl RadarHTTPSummaryHTTPProtocolParamsDateRange = "28dControl"
- RadarHTTPSummaryHTTPProtocolParamsDateRange12wControl RadarHTTPSummaryHTTPProtocolParamsDateRange = "12wControl"
- RadarHTTPSummaryHTTPProtocolParamsDateRange24wControl RadarHTTPSummaryHTTPProtocolParamsDateRange = "24wControl"
-)
-
-type RadarHTTPSummaryHTTPProtocolParamsDeviceType string
-
-const (
- RadarHTTPSummaryHTTPProtocolParamsDeviceTypeDesktop RadarHTTPSummaryHTTPProtocolParamsDeviceType = "DESKTOP"
- RadarHTTPSummaryHTTPProtocolParamsDeviceTypeMobile RadarHTTPSummaryHTTPProtocolParamsDeviceType = "MOBILE"
- RadarHTTPSummaryHTTPProtocolParamsDeviceTypeOther RadarHTTPSummaryHTTPProtocolParamsDeviceType = "OTHER"
-)
-
-// Format results are returned in.
-type RadarHTTPSummaryHTTPProtocolParamsFormat string
-
-const (
- RadarHTTPSummaryHTTPProtocolParamsFormatJson RadarHTTPSummaryHTTPProtocolParamsFormat = "JSON"
- RadarHTTPSummaryHTTPProtocolParamsFormatCsv RadarHTTPSummaryHTTPProtocolParamsFormat = "CSV"
-)
-
-type RadarHTTPSummaryHTTPProtocolParamsHTTPVersion string
-
-const (
- RadarHTTPSummaryHTTPProtocolParamsHTTPVersionHttPv1 RadarHTTPSummaryHTTPProtocolParamsHTTPVersion = "HTTPv1"
- RadarHTTPSummaryHTTPProtocolParamsHTTPVersionHttPv2 RadarHTTPSummaryHTTPProtocolParamsHTTPVersion = "HTTPv2"
- RadarHTTPSummaryHTTPProtocolParamsHTTPVersionHttPv3 RadarHTTPSummaryHTTPProtocolParamsHTTPVersion = "HTTPv3"
-)
-
-type RadarHTTPSummaryHTTPProtocolParamsIPVersion string
-
-const (
- RadarHTTPSummaryHTTPProtocolParamsIPVersionIPv4 RadarHTTPSummaryHTTPProtocolParamsIPVersion = "IPv4"
- RadarHTTPSummaryHTTPProtocolParamsIPVersionIPv6 RadarHTTPSummaryHTTPProtocolParamsIPVersion = "IPv6"
-)
-
-type RadarHTTPSummaryHTTPProtocolParamsOS string
-
-const (
- RadarHTTPSummaryHTTPProtocolParamsOSWindows RadarHTTPSummaryHTTPProtocolParamsOS = "WINDOWS"
- RadarHTTPSummaryHTTPProtocolParamsOSMacosx RadarHTTPSummaryHTTPProtocolParamsOS = "MACOSX"
- RadarHTTPSummaryHTTPProtocolParamsOSIos RadarHTTPSummaryHTTPProtocolParamsOS = "IOS"
- RadarHTTPSummaryHTTPProtocolParamsOSAndroid RadarHTTPSummaryHTTPProtocolParamsOS = "ANDROID"
- RadarHTTPSummaryHTTPProtocolParamsOSChromeos RadarHTTPSummaryHTTPProtocolParamsOS = "CHROMEOS"
- RadarHTTPSummaryHTTPProtocolParamsOSLinux RadarHTTPSummaryHTTPProtocolParamsOS = "LINUX"
- RadarHTTPSummaryHTTPProtocolParamsOSSmartTv RadarHTTPSummaryHTTPProtocolParamsOS = "SMART_TV"
-)
-
-type RadarHTTPSummaryHTTPProtocolParamsTLSVersion string
-
-const (
- RadarHTTPSummaryHTTPProtocolParamsTLSVersionTlSv1_0 RadarHTTPSummaryHTTPProtocolParamsTLSVersion = "TLSv1_0"
- RadarHTTPSummaryHTTPProtocolParamsTLSVersionTlSv1_1 RadarHTTPSummaryHTTPProtocolParamsTLSVersion = "TLSv1_1"
- RadarHTTPSummaryHTTPProtocolParamsTLSVersionTlSv1_2 RadarHTTPSummaryHTTPProtocolParamsTLSVersion = "TLSv1_2"
- RadarHTTPSummaryHTTPProtocolParamsTLSVersionTlSv1_3 RadarHTTPSummaryHTTPProtocolParamsTLSVersion = "TLSv1_3"
- RadarHTTPSummaryHTTPProtocolParamsTLSVersionTlSvQuic RadarHTTPSummaryHTTPProtocolParamsTLSVersion = "TLSvQUIC"
-)
-
-type RadarHTTPSummaryHTTPProtocolResponseEnvelope struct {
- Result RadarHTTPSummaryHTTPProtocolResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarHTTPSummaryHTTPProtocolResponseEnvelopeJSON `json:"-"`
-}
-
-// radarHTTPSummaryHTTPProtocolResponseEnvelopeJSON contains the JSON metadata for
-// the struct [RadarHTTPSummaryHTTPProtocolResponseEnvelope]
-type radarHTTPSummaryHTTPProtocolResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPSummaryHTTPProtocolResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPSummaryHTTPProtocolResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPSummaryHTTPVersionParams 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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarHTTPSummaryHTTPVersionParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Filter for device type.
- DeviceType param.Field[[]RadarHTTPSummaryHTTPVersionParamsDeviceType] `query:"deviceType"`
- // Format results are returned in.
- Format param.Field[RadarHTTPSummaryHTTPVersionParamsFormat] `query:"format"`
- // Filter for http protocol.
- HTTPProtocol param.Field[[]RadarHTTPSummaryHTTPVersionParamsHTTPProtocol] `query:"httpProtocol"`
- // Filter for ip version.
- IPVersion param.Field[[]RadarHTTPSummaryHTTPVersionParamsIPVersion] `query:"ipVersion"`
- // 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 os name.
- OS param.Field[[]RadarHTTPSummaryHTTPVersionParamsOS] `query:"os"`
- // Filter for tls version.
- TLSVersion param.Field[[]RadarHTTPSummaryHTTPVersionParamsTLSVersion] `query:"tlsVersion"`
-}
-
-// URLQuery serializes [RadarHTTPSummaryHTTPVersionParams]'s query parameters as
-// `url.Values`.
-func (r RadarHTTPSummaryHTTPVersionParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type RadarHTTPSummaryHTTPVersionParamsBotClass string
-
-const (
- RadarHTTPSummaryHTTPVersionParamsBotClassLikelyAutomated RadarHTTPSummaryHTTPVersionParamsBotClass = "LIKELY_AUTOMATED"
- RadarHTTPSummaryHTTPVersionParamsBotClassLikelyHuman RadarHTTPSummaryHTTPVersionParamsBotClass = "LIKELY_HUMAN"
-)
-
-type RadarHTTPSummaryHTTPVersionParamsDateRange string
-
-const (
- RadarHTTPSummaryHTTPVersionParamsDateRange1d RadarHTTPSummaryHTTPVersionParamsDateRange = "1d"
- RadarHTTPSummaryHTTPVersionParamsDateRange2d RadarHTTPSummaryHTTPVersionParamsDateRange = "2d"
- RadarHTTPSummaryHTTPVersionParamsDateRange7d RadarHTTPSummaryHTTPVersionParamsDateRange = "7d"
- RadarHTTPSummaryHTTPVersionParamsDateRange14d RadarHTTPSummaryHTTPVersionParamsDateRange = "14d"
- RadarHTTPSummaryHTTPVersionParamsDateRange28d RadarHTTPSummaryHTTPVersionParamsDateRange = "28d"
- RadarHTTPSummaryHTTPVersionParamsDateRange12w RadarHTTPSummaryHTTPVersionParamsDateRange = "12w"
- RadarHTTPSummaryHTTPVersionParamsDateRange24w RadarHTTPSummaryHTTPVersionParamsDateRange = "24w"
- RadarHTTPSummaryHTTPVersionParamsDateRange52w RadarHTTPSummaryHTTPVersionParamsDateRange = "52w"
- RadarHTTPSummaryHTTPVersionParamsDateRange1dControl RadarHTTPSummaryHTTPVersionParamsDateRange = "1dControl"
- RadarHTTPSummaryHTTPVersionParamsDateRange2dControl RadarHTTPSummaryHTTPVersionParamsDateRange = "2dControl"
- RadarHTTPSummaryHTTPVersionParamsDateRange7dControl RadarHTTPSummaryHTTPVersionParamsDateRange = "7dControl"
- RadarHTTPSummaryHTTPVersionParamsDateRange14dControl RadarHTTPSummaryHTTPVersionParamsDateRange = "14dControl"
- RadarHTTPSummaryHTTPVersionParamsDateRange28dControl RadarHTTPSummaryHTTPVersionParamsDateRange = "28dControl"
- RadarHTTPSummaryHTTPVersionParamsDateRange12wControl RadarHTTPSummaryHTTPVersionParamsDateRange = "12wControl"
- RadarHTTPSummaryHTTPVersionParamsDateRange24wControl RadarHTTPSummaryHTTPVersionParamsDateRange = "24wControl"
-)
-
-type RadarHTTPSummaryHTTPVersionParamsDeviceType string
-
-const (
- RadarHTTPSummaryHTTPVersionParamsDeviceTypeDesktop RadarHTTPSummaryHTTPVersionParamsDeviceType = "DESKTOP"
- RadarHTTPSummaryHTTPVersionParamsDeviceTypeMobile RadarHTTPSummaryHTTPVersionParamsDeviceType = "MOBILE"
- RadarHTTPSummaryHTTPVersionParamsDeviceTypeOther RadarHTTPSummaryHTTPVersionParamsDeviceType = "OTHER"
-)
-
-// Format results are returned in.
-type RadarHTTPSummaryHTTPVersionParamsFormat string
-
-const (
- RadarHTTPSummaryHTTPVersionParamsFormatJson RadarHTTPSummaryHTTPVersionParamsFormat = "JSON"
- RadarHTTPSummaryHTTPVersionParamsFormatCsv RadarHTTPSummaryHTTPVersionParamsFormat = "CSV"
-)
-
-type RadarHTTPSummaryHTTPVersionParamsHTTPProtocol string
-
-const (
- RadarHTTPSummaryHTTPVersionParamsHTTPProtocolHTTP RadarHTTPSummaryHTTPVersionParamsHTTPProtocol = "HTTP"
- RadarHTTPSummaryHTTPVersionParamsHTTPProtocolHTTPS RadarHTTPSummaryHTTPVersionParamsHTTPProtocol = "HTTPS"
-)
-
-type RadarHTTPSummaryHTTPVersionParamsIPVersion string
-
-const (
- RadarHTTPSummaryHTTPVersionParamsIPVersionIPv4 RadarHTTPSummaryHTTPVersionParamsIPVersion = "IPv4"
- RadarHTTPSummaryHTTPVersionParamsIPVersionIPv6 RadarHTTPSummaryHTTPVersionParamsIPVersion = "IPv6"
-)
-
-type RadarHTTPSummaryHTTPVersionParamsOS string
-
-const (
- RadarHTTPSummaryHTTPVersionParamsOSWindows RadarHTTPSummaryHTTPVersionParamsOS = "WINDOWS"
- RadarHTTPSummaryHTTPVersionParamsOSMacosx RadarHTTPSummaryHTTPVersionParamsOS = "MACOSX"
- RadarHTTPSummaryHTTPVersionParamsOSIos RadarHTTPSummaryHTTPVersionParamsOS = "IOS"
- RadarHTTPSummaryHTTPVersionParamsOSAndroid RadarHTTPSummaryHTTPVersionParamsOS = "ANDROID"
- RadarHTTPSummaryHTTPVersionParamsOSChromeos RadarHTTPSummaryHTTPVersionParamsOS = "CHROMEOS"
- RadarHTTPSummaryHTTPVersionParamsOSLinux RadarHTTPSummaryHTTPVersionParamsOS = "LINUX"
- RadarHTTPSummaryHTTPVersionParamsOSSmartTv RadarHTTPSummaryHTTPVersionParamsOS = "SMART_TV"
-)
-
-type RadarHTTPSummaryHTTPVersionParamsTLSVersion string
-
-const (
- RadarHTTPSummaryHTTPVersionParamsTLSVersionTlSv1_0 RadarHTTPSummaryHTTPVersionParamsTLSVersion = "TLSv1_0"
- RadarHTTPSummaryHTTPVersionParamsTLSVersionTlSv1_1 RadarHTTPSummaryHTTPVersionParamsTLSVersion = "TLSv1_1"
- RadarHTTPSummaryHTTPVersionParamsTLSVersionTlSv1_2 RadarHTTPSummaryHTTPVersionParamsTLSVersion = "TLSv1_2"
- RadarHTTPSummaryHTTPVersionParamsTLSVersionTlSv1_3 RadarHTTPSummaryHTTPVersionParamsTLSVersion = "TLSv1_3"
- RadarHTTPSummaryHTTPVersionParamsTLSVersionTlSvQuic RadarHTTPSummaryHTTPVersionParamsTLSVersion = "TLSvQUIC"
-)
-
-type RadarHTTPSummaryHTTPVersionResponseEnvelope struct {
- Result RadarHTTPSummaryHTTPVersionResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarHTTPSummaryHTTPVersionResponseEnvelopeJSON `json:"-"`
-}
-
-// radarHTTPSummaryHTTPVersionResponseEnvelopeJSON contains the JSON metadata for
-// the struct [RadarHTTPSummaryHTTPVersionResponseEnvelope]
-type radarHTTPSummaryHTTPVersionResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPSummaryHTTPVersionResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPSummaryHTTPVersionResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPSummaryIPVersionParams 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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarHTTPSummaryIPVersionParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Filter for device type.
- DeviceType param.Field[[]RadarHTTPSummaryIPVersionParamsDeviceType] `query:"deviceType"`
- // Format results are returned in.
- Format param.Field[RadarHTTPSummaryIPVersionParamsFormat] `query:"format"`
- // Filter for http protocol.
- HTTPProtocol param.Field[[]RadarHTTPSummaryIPVersionParamsHTTPProtocol] `query:"httpProtocol"`
- // Filter for http version.
- HTTPVersion param.Field[[]RadarHTTPSummaryIPVersionParamsHTTPVersion] `query:"httpVersion"`
- // 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 os name.
- OS param.Field[[]RadarHTTPSummaryIPVersionParamsOS] `query:"os"`
- // Filter for tls version.
- TLSVersion param.Field[[]RadarHTTPSummaryIPVersionParamsTLSVersion] `query:"tlsVersion"`
-}
-
-// URLQuery serializes [RadarHTTPSummaryIPVersionParams]'s query parameters as
-// `url.Values`.
-func (r RadarHTTPSummaryIPVersionParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type RadarHTTPSummaryIPVersionParamsBotClass string
-
-const (
- RadarHTTPSummaryIPVersionParamsBotClassLikelyAutomated RadarHTTPSummaryIPVersionParamsBotClass = "LIKELY_AUTOMATED"
- RadarHTTPSummaryIPVersionParamsBotClassLikelyHuman RadarHTTPSummaryIPVersionParamsBotClass = "LIKELY_HUMAN"
-)
-
-type RadarHTTPSummaryIPVersionParamsDateRange string
-
-const (
- RadarHTTPSummaryIPVersionParamsDateRange1d RadarHTTPSummaryIPVersionParamsDateRange = "1d"
- RadarHTTPSummaryIPVersionParamsDateRange2d RadarHTTPSummaryIPVersionParamsDateRange = "2d"
- RadarHTTPSummaryIPVersionParamsDateRange7d RadarHTTPSummaryIPVersionParamsDateRange = "7d"
- RadarHTTPSummaryIPVersionParamsDateRange14d RadarHTTPSummaryIPVersionParamsDateRange = "14d"
- RadarHTTPSummaryIPVersionParamsDateRange28d RadarHTTPSummaryIPVersionParamsDateRange = "28d"
- RadarHTTPSummaryIPVersionParamsDateRange12w RadarHTTPSummaryIPVersionParamsDateRange = "12w"
- RadarHTTPSummaryIPVersionParamsDateRange24w RadarHTTPSummaryIPVersionParamsDateRange = "24w"
- RadarHTTPSummaryIPVersionParamsDateRange52w RadarHTTPSummaryIPVersionParamsDateRange = "52w"
- RadarHTTPSummaryIPVersionParamsDateRange1dControl RadarHTTPSummaryIPVersionParamsDateRange = "1dControl"
- RadarHTTPSummaryIPVersionParamsDateRange2dControl RadarHTTPSummaryIPVersionParamsDateRange = "2dControl"
- RadarHTTPSummaryIPVersionParamsDateRange7dControl RadarHTTPSummaryIPVersionParamsDateRange = "7dControl"
- RadarHTTPSummaryIPVersionParamsDateRange14dControl RadarHTTPSummaryIPVersionParamsDateRange = "14dControl"
- RadarHTTPSummaryIPVersionParamsDateRange28dControl RadarHTTPSummaryIPVersionParamsDateRange = "28dControl"
- RadarHTTPSummaryIPVersionParamsDateRange12wControl RadarHTTPSummaryIPVersionParamsDateRange = "12wControl"
- RadarHTTPSummaryIPVersionParamsDateRange24wControl RadarHTTPSummaryIPVersionParamsDateRange = "24wControl"
-)
-
-type RadarHTTPSummaryIPVersionParamsDeviceType string
-
-const (
- RadarHTTPSummaryIPVersionParamsDeviceTypeDesktop RadarHTTPSummaryIPVersionParamsDeviceType = "DESKTOP"
- RadarHTTPSummaryIPVersionParamsDeviceTypeMobile RadarHTTPSummaryIPVersionParamsDeviceType = "MOBILE"
- RadarHTTPSummaryIPVersionParamsDeviceTypeOther RadarHTTPSummaryIPVersionParamsDeviceType = "OTHER"
-)
-
-// Format results are returned in.
-type RadarHTTPSummaryIPVersionParamsFormat string
-
-const (
- RadarHTTPSummaryIPVersionParamsFormatJson RadarHTTPSummaryIPVersionParamsFormat = "JSON"
- RadarHTTPSummaryIPVersionParamsFormatCsv RadarHTTPSummaryIPVersionParamsFormat = "CSV"
-)
-
-type RadarHTTPSummaryIPVersionParamsHTTPProtocol string
-
-const (
- RadarHTTPSummaryIPVersionParamsHTTPProtocolHTTP RadarHTTPSummaryIPVersionParamsHTTPProtocol = "HTTP"
- RadarHTTPSummaryIPVersionParamsHTTPProtocolHTTPS RadarHTTPSummaryIPVersionParamsHTTPProtocol = "HTTPS"
-)
-
-type RadarHTTPSummaryIPVersionParamsHTTPVersion string
-
-const (
- RadarHTTPSummaryIPVersionParamsHTTPVersionHttPv1 RadarHTTPSummaryIPVersionParamsHTTPVersion = "HTTPv1"
- RadarHTTPSummaryIPVersionParamsHTTPVersionHttPv2 RadarHTTPSummaryIPVersionParamsHTTPVersion = "HTTPv2"
- RadarHTTPSummaryIPVersionParamsHTTPVersionHttPv3 RadarHTTPSummaryIPVersionParamsHTTPVersion = "HTTPv3"
-)
-
-type RadarHTTPSummaryIPVersionParamsOS string
-
-const (
- RadarHTTPSummaryIPVersionParamsOSWindows RadarHTTPSummaryIPVersionParamsOS = "WINDOWS"
- RadarHTTPSummaryIPVersionParamsOSMacosx RadarHTTPSummaryIPVersionParamsOS = "MACOSX"
- RadarHTTPSummaryIPVersionParamsOSIos RadarHTTPSummaryIPVersionParamsOS = "IOS"
- RadarHTTPSummaryIPVersionParamsOSAndroid RadarHTTPSummaryIPVersionParamsOS = "ANDROID"
- RadarHTTPSummaryIPVersionParamsOSChromeos RadarHTTPSummaryIPVersionParamsOS = "CHROMEOS"
- RadarHTTPSummaryIPVersionParamsOSLinux RadarHTTPSummaryIPVersionParamsOS = "LINUX"
- RadarHTTPSummaryIPVersionParamsOSSmartTv RadarHTTPSummaryIPVersionParamsOS = "SMART_TV"
-)
-
-type RadarHTTPSummaryIPVersionParamsTLSVersion string
-
-const (
- RadarHTTPSummaryIPVersionParamsTLSVersionTlSv1_0 RadarHTTPSummaryIPVersionParamsTLSVersion = "TLSv1_0"
- RadarHTTPSummaryIPVersionParamsTLSVersionTlSv1_1 RadarHTTPSummaryIPVersionParamsTLSVersion = "TLSv1_1"
- RadarHTTPSummaryIPVersionParamsTLSVersionTlSv1_2 RadarHTTPSummaryIPVersionParamsTLSVersion = "TLSv1_2"
- RadarHTTPSummaryIPVersionParamsTLSVersionTlSv1_3 RadarHTTPSummaryIPVersionParamsTLSVersion = "TLSv1_3"
- RadarHTTPSummaryIPVersionParamsTLSVersionTlSvQuic RadarHTTPSummaryIPVersionParamsTLSVersion = "TLSvQUIC"
-)
-
-type RadarHTTPSummaryIPVersionResponseEnvelope struct {
- Result RadarHTTPSummaryIPVersionResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarHTTPSummaryIPVersionResponseEnvelopeJSON `json:"-"`
-}
-
-// radarHTTPSummaryIPVersionResponseEnvelopeJSON contains the JSON metadata for the
-// struct [RadarHTTPSummaryIPVersionResponseEnvelope]
-type radarHTTPSummaryIPVersionResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPSummaryIPVersionResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPSummaryIPVersionResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPSummaryOSParams 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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarHTTPSummaryOSParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Filter for device type.
- DeviceType param.Field[[]RadarHTTPSummaryOSParamsDeviceType] `query:"deviceType"`
- // Format results are returned in.
- Format param.Field[RadarHTTPSummaryOSParamsFormat] `query:"format"`
- // Filter for http protocol.
- HTTPProtocol param.Field[[]RadarHTTPSummaryOSParamsHTTPProtocol] `query:"httpProtocol"`
- // Filter for http version.
- HTTPVersion param.Field[[]RadarHTTPSummaryOSParamsHTTPVersion] `query:"httpVersion"`
- // Filter for ip version.
- IPVersion param.Field[[]RadarHTTPSummaryOSParamsIPVersion] `query:"ipVersion"`
- // 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[[]RadarHTTPSummaryOSParamsTLSVersion] `query:"tlsVersion"`
-}
-
-// URLQuery serializes [RadarHTTPSummaryOSParams]'s query parameters as
-// `url.Values`.
-func (r RadarHTTPSummaryOSParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type RadarHTTPSummaryOSParamsBotClass string
-
-const (
- RadarHTTPSummaryOSParamsBotClassLikelyAutomated RadarHTTPSummaryOSParamsBotClass = "LIKELY_AUTOMATED"
- RadarHTTPSummaryOSParamsBotClassLikelyHuman RadarHTTPSummaryOSParamsBotClass = "LIKELY_HUMAN"
-)
-
-type RadarHTTPSummaryOSParamsDateRange string
-
-const (
- RadarHTTPSummaryOSParamsDateRange1d RadarHTTPSummaryOSParamsDateRange = "1d"
- RadarHTTPSummaryOSParamsDateRange2d RadarHTTPSummaryOSParamsDateRange = "2d"
- RadarHTTPSummaryOSParamsDateRange7d RadarHTTPSummaryOSParamsDateRange = "7d"
- RadarHTTPSummaryOSParamsDateRange14d RadarHTTPSummaryOSParamsDateRange = "14d"
- RadarHTTPSummaryOSParamsDateRange28d RadarHTTPSummaryOSParamsDateRange = "28d"
- RadarHTTPSummaryOSParamsDateRange12w RadarHTTPSummaryOSParamsDateRange = "12w"
- RadarHTTPSummaryOSParamsDateRange24w RadarHTTPSummaryOSParamsDateRange = "24w"
- RadarHTTPSummaryOSParamsDateRange52w RadarHTTPSummaryOSParamsDateRange = "52w"
- RadarHTTPSummaryOSParamsDateRange1dControl RadarHTTPSummaryOSParamsDateRange = "1dControl"
- RadarHTTPSummaryOSParamsDateRange2dControl RadarHTTPSummaryOSParamsDateRange = "2dControl"
- RadarHTTPSummaryOSParamsDateRange7dControl RadarHTTPSummaryOSParamsDateRange = "7dControl"
- RadarHTTPSummaryOSParamsDateRange14dControl RadarHTTPSummaryOSParamsDateRange = "14dControl"
- RadarHTTPSummaryOSParamsDateRange28dControl RadarHTTPSummaryOSParamsDateRange = "28dControl"
- RadarHTTPSummaryOSParamsDateRange12wControl RadarHTTPSummaryOSParamsDateRange = "12wControl"
- RadarHTTPSummaryOSParamsDateRange24wControl RadarHTTPSummaryOSParamsDateRange = "24wControl"
-)
-
-type RadarHTTPSummaryOSParamsDeviceType string
-
-const (
- RadarHTTPSummaryOSParamsDeviceTypeDesktop RadarHTTPSummaryOSParamsDeviceType = "DESKTOP"
- RadarHTTPSummaryOSParamsDeviceTypeMobile RadarHTTPSummaryOSParamsDeviceType = "MOBILE"
- RadarHTTPSummaryOSParamsDeviceTypeOther RadarHTTPSummaryOSParamsDeviceType = "OTHER"
-)
-
-// Format results are returned in.
-type RadarHTTPSummaryOSParamsFormat string
-
-const (
- RadarHTTPSummaryOSParamsFormatJson RadarHTTPSummaryOSParamsFormat = "JSON"
- RadarHTTPSummaryOSParamsFormatCsv RadarHTTPSummaryOSParamsFormat = "CSV"
-)
-
-type RadarHTTPSummaryOSParamsHTTPProtocol string
-
-const (
- RadarHTTPSummaryOSParamsHTTPProtocolHTTP RadarHTTPSummaryOSParamsHTTPProtocol = "HTTP"
- RadarHTTPSummaryOSParamsHTTPProtocolHTTPS RadarHTTPSummaryOSParamsHTTPProtocol = "HTTPS"
-)
-
-type RadarHTTPSummaryOSParamsHTTPVersion string
-
-const (
- RadarHTTPSummaryOSParamsHTTPVersionHttPv1 RadarHTTPSummaryOSParamsHTTPVersion = "HTTPv1"
- RadarHTTPSummaryOSParamsHTTPVersionHttPv2 RadarHTTPSummaryOSParamsHTTPVersion = "HTTPv2"
- RadarHTTPSummaryOSParamsHTTPVersionHttPv3 RadarHTTPSummaryOSParamsHTTPVersion = "HTTPv3"
-)
-
-type RadarHTTPSummaryOSParamsIPVersion string
-
-const (
- RadarHTTPSummaryOSParamsIPVersionIPv4 RadarHTTPSummaryOSParamsIPVersion = "IPv4"
- RadarHTTPSummaryOSParamsIPVersionIPv6 RadarHTTPSummaryOSParamsIPVersion = "IPv6"
-)
-
-type RadarHTTPSummaryOSParamsTLSVersion string
-
-const (
- RadarHTTPSummaryOSParamsTLSVersionTlSv1_0 RadarHTTPSummaryOSParamsTLSVersion = "TLSv1_0"
- RadarHTTPSummaryOSParamsTLSVersionTlSv1_1 RadarHTTPSummaryOSParamsTLSVersion = "TLSv1_1"
- RadarHTTPSummaryOSParamsTLSVersionTlSv1_2 RadarHTTPSummaryOSParamsTLSVersion = "TLSv1_2"
- RadarHTTPSummaryOSParamsTLSVersionTlSv1_3 RadarHTTPSummaryOSParamsTLSVersion = "TLSv1_3"
- RadarHTTPSummaryOSParamsTLSVersionTlSvQuic RadarHTTPSummaryOSParamsTLSVersion = "TLSvQUIC"
-)
-
-type RadarHTTPSummaryOSResponseEnvelope struct {
- Result RadarHTTPSummaryOSResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarHTTPSummaryOSResponseEnvelopeJSON `json:"-"`
-}
-
-// radarHTTPSummaryOSResponseEnvelopeJSON contains the JSON metadata for the struct
-// [RadarHTTPSummaryOSResponseEnvelope]
-type radarHTTPSummaryOSResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPSummaryOSResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPSummaryOSResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPSummaryTLSVersionParams 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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarHTTPSummaryTLSVersionParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Filter for device type.
- DeviceType param.Field[[]RadarHTTPSummaryTLSVersionParamsDeviceType] `query:"deviceType"`
- // Format results are returned in.
- Format param.Field[RadarHTTPSummaryTLSVersionParamsFormat] `query:"format"`
- // Filter for http protocol.
- HTTPProtocol param.Field[[]RadarHTTPSummaryTLSVersionParamsHTTPProtocol] `query:"httpProtocol"`
- // Filter for http version.
- HTTPVersion param.Field[[]RadarHTTPSummaryTLSVersionParamsHTTPVersion] `query:"httpVersion"`
- // Filter for ip version.
- IPVersion param.Field[[]RadarHTTPSummaryTLSVersionParamsIPVersion] `query:"ipVersion"`
- // 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 os name.
- OS param.Field[[]RadarHTTPSummaryTLSVersionParamsOS] `query:"os"`
-}
-
-// URLQuery serializes [RadarHTTPSummaryTLSVersionParams]'s query parameters as
-// `url.Values`.
-func (r RadarHTTPSummaryTLSVersionParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type RadarHTTPSummaryTLSVersionParamsBotClass string
-
-const (
- RadarHTTPSummaryTLSVersionParamsBotClassLikelyAutomated RadarHTTPSummaryTLSVersionParamsBotClass = "LIKELY_AUTOMATED"
- RadarHTTPSummaryTLSVersionParamsBotClassLikelyHuman RadarHTTPSummaryTLSVersionParamsBotClass = "LIKELY_HUMAN"
-)
-
-type RadarHTTPSummaryTLSVersionParamsDateRange string
-
-const (
- RadarHTTPSummaryTLSVersionParamsDateRange1d RadarHTTPSummaryTLSVersionParamsDateRange = "1d"
- RadarHTTPSummaryTLSVersionParamsDateRange2d RadarHTTPSummaryTLSVersionParamsDateRange = "2d"
- RadarHTTPSummaryTLSVersionParamsDateRange7d RadarHTTPSummaryTLSVersionParamsDateRange = "7d"
- RadarHTTPSummaryTLSVersionParamsDateRange14d RadarHTTPSummaryTLSVersionParamsDateRange = "14d"
- RadarHTTPSummaryTLSVersionParamsDateRange28d RadarHTTPSummaryTLSVersionParamsDateRange = "28d"
- RadarHTTPSummaryTLSVersionParamsDateRange12w RadarHTTPSummaryTLSVersionParamsDateRange = "12w"
- RadarHTTPSummaryTLSVersionParamsDateRange24w RadarHTTPSummaryTLSVersionParamsDateRange = "24w"
- RadarHTTPSummaryTLSVersionParamsDateRange52w RadarHTTPSummaryTLSVersionParamsDateRange = "52w"
- RadarHTTPSummaryTLSVersionParamsDateRange1dControl RadarHTTPSummaryTLSVersionParamsDateRange = "1dControl"
- RadarHTTPSummaryTLSVersionParamsDateRange2dControl RadarHTTPSummaryTLSVersionParamsDateRange = "2dControl"
- RadarHTTPSummaryTLSVersionParamsDateRange7dControl RadarHTTPSummaryTLSVersionParamsDateRange = "7dControl"
- RadarHTTPSummaryTLSVersionParamsDateRange14dControl RadarHTTPSummaryTLSVersionParamsDateRange = "14dControl"
- RadarHTTPSummaryTLSVersionParamsDateRange28dControl RadarHTTPSummaryTLSVersionParamsDateRange = "28dControl"
- RadarHTTPSummaryTLSVersionParamsDateRange12wControl RadarHTTPSummaryTLSVersionParamsDateRange = "12wControl"
- RadarHTTPSummaryTLSVersionParamsDateRange24wControl RadarHTTPSummaryTLSVersionParamsDateRange = "24wControl"
-)
-
-type RadarHTTPSummaryTLSVersionParamsDeviceType string
-
-const (
- RadarHTTPSummaryTLSVersionParamsDeviceTypeDesktop RadarHTTPSummaryTLSVersionParamsDeviceType = "DESKTOP"
- RadarHTTPSummaryTLSVersionParamsDeviceTypeMobile RadarHTTPSummaryTLSVersionParamsDeviceType = "MOBILE"
- RadarHTTPSummaryTLSVersionParamsDeviceTypeOther RadarHTTPSummaryTLSVersionParamsDeviceType = "OTHER"
-)
-
-// Format results are returned in.
-type RadarHTTPSummaryTLSVersionParamsFormat string
-
-const (
- RadarHTTPSummaryTLSVersionParamsFormatJson RadarHTTPSummaryTLSVersionParamsFormat = "JSON"
- RadarHTTPSummaryTLSVersionParamsFormatCsv RadarHTTPSummaryTLSVersionParamsFormat = "CSV"
-)
-
-type RadarHTTPSummaryTLSVersionParamsHTTPProtocol string
-
-const (
- RadarHTTPSummaryTLSVersionParamsHTTPProtocolHTTP RadarHTTPSummaryTLSVersionParamsHTTPProtocol = "HTTP"
- RadarHTTPSummaryTLSVersionParamsHTTPProtocolHTTPS RadarHTTPSummaryTLSVersionParamsHTTPProtocol = "HTTPS"
-)
-
-type RadarHTTPSummaryTLSVersionParamsHTTPVersion string
-
-const (
- RadarHTTPSummaryTLSVersionParamsHTTPVersionHttPv1 RadarHTTPSummaryTLSVersionParamsHTTPVersion = "HTTPv1"
- RadarHTTPSummaryTLSVersionParamsHTTPVersionHttPv2 RadarHTTPSummaryTLSVersionParamsHTTPVersion = "HTTPv2"
- RadarHTTPSummaryTLSVersionParamsHTTPVersionHttPv3 RadarHTTPSummaryTLSVersionParamsHTTPVersion = "HTTPv3"
-)
-
-type RadarHTTPSummaryTLSVersionParamsIPVersion string
-
-const (
- RadarHTTPSummaryTLSVersionParamsIPVersionIPv4 RadarHTTPSummaryTLSVersionParamsIPVersion = "IPv4"
- RadarHTTPSummaryTLSVersionParamsIPVersionIPv6 RadarHTTPSummaryTLSVersionParamsIPVersion = "IPv6"
-)
-
-type RadarHTTPSummaryTLSVersionParamsOS string
-
-const (
- RadarHTTPSummaryTLSVersionParamsOSWindows RadarHTTPSummaryTLSVersionParamsOS = "WINDOWS"
- RadarHTTPSummaryTLSVersionParamsOSMacosx RadarHTTPSummaryTLSVersionParamsOS = "MACOSX"
- RadarHTTPSummaryTLSVersionParamsOSIos RadarHTTPSummaryTLSVersionParamsOS = "IOS"
- RadarHTTPSummaryTLSVersionParamsOSAndroid RadarHTTPSummaryTLSVersionParamsOS = "ANDROID"
- RadarHTTPSummaryTLSVersionParamsOSChromeos RadarHTTPSummaryTLSVersionParamsOS = "CHROMEOS"
- RadarHTTPSummaryTLSVersionParamsOSLinux RadarHTTPSummaryTLSVersionParamsOS = "LINUX"
- RadarHTTPSummaryTLSVersionParamsOSSmartTv RadarHTTPSummaryTLSVersionParamsOS = "SMART_TV"
-)
-
-type RadarHTTPSummaryTLSVersionResponseEnvelope struct {
- Result RadarHTTPSummaryTLSVersionResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarHTTPSummaryTLSVersionResponseEnvelopeJSON `json:"-"`
-}
-
-// radarHTTPSummaryTLSVersionResponseEnvelopeJSON contains the JSON metadata for
-// the struct [RadarHTTPSummaryTLSVersionResponseEnvelope]
-type radarHTTPSummaryTLSVersionResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPSummaryTLSVersionResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPSummaryTLSVersionResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
diff --git a/radarhttpsummary_test.go b/radarhttpsummary_test.go
deleted file mode 100644
index 9e288dcbd4d..00000000000
--- a/radarhttpsummary_test.go
+++ /dev/null
@@ -1,288 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
- "time"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRadarHTTPSummaryBotClassWithOptionalParams(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"),
- )
- _, 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()}),
- DeviceType: cloudflare.F([]cloudflare.RadarHTTPSummaryBotClassParamsDeviceType{cloudflare.RadarHTTPSummaryBotClassParamsDeviceTypeDesktop, cloudflare.RadarHTTPSummaryBotClassParamsDeviceTypeMobile, cloudflare.RadarHTTPSummaryBotClassParamsDeviceTypeOther}),
- Format: cloudflare.F(cloudflare.RadarHTTPSummaryBotClassParamsFormatJson),
- HTTPProtocol: cloudflare.F([]cloudflare.RadarHTTPSummaryBotClassParamsHTTPProtocol{cloudflare.RadarHTTPSummaryBotClassParamsHTTPProtocolHTTP, cloudflare.RadarHTTPSummaryBotClassParamsHTTPProtocolHTTPS}),
- HTTPVersion: cloudflare.F([]cloudflare.RadarHTTPSummaryBotClassParamsHTTPVersion{cloudflare.RadarHTTPSummaryBotClassParamsHTTPVersionHttPv1, cloudflare.RadarHTTPSummaryBotClassParamsHTTPVersionHttPv2, cloudflare.RadarHTTPSummaryBotClassParamsHTTPVersionHttPv3}),
- IPVersion: cloudflare.F([]cloudflare.RadarHTTPSummaryBotClassParamsIPVersion{cloudflare.RadarHTTPSummaryBotClassParamsIPVersionIPv4, cloudflare.RadarHTTPSummaryBotClassParamsIPVersionIPv6}),
- Location: cloudflare.F([]string{"string", "string", "string"}),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- OS: cloudflare.F([]cloudflare.RadarHTTPSummaryBotClassParamsOS{cloudflare.RadarHTTPSummaryBotClassParamsOSWindows, cloudflare.RadarHTTPSummaryBotClassParamsOSMacosx, cloudflare.RadarHTTPSummaryBotClassParamsOSIos}),
- TLSVersion: cloudflare.F([]cloudflare.RadarHTTPSummaryBotClassParamsTLSVersion{cloudflare.RadarHTTPSummaryBotClassParamsTLSVersionTlSv1_0, cloudflare.RadarHTTPSummaryBotClassParamsTLSVersionTlSv1_1, cloudflare.RadarHTTPSummaryBotClassParamsTLSVersionTlSv1_2}),
- })
- 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())
- }
-}
-
-func TestRadarHTTPSummaryDeviceTypeWithOptionalParams(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"),
- )
- _, 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()}),
- Format: cloudflare.F(cloudflare.RadarHTTPSummaryDeviceTypeParamsFormatJson),
- HTTPProtocol: cloudflare.F([]cloudflare.RadarHTTPSummaryDeviceTypeParamsHTTPProtocol{cloudflare.RadarHTTPSummaryDeviceTypeParamsHTTPProtocolHTTP, cloudflare.RadarHTTPSummaryDeviceTypeParamsHTTPProtocolHTTPS}),
- HTTPVersion: cloudflare.F([]cloudflare.RadarHTTPSummaryDeviceTypeParamsHTTPVersion{cloudflare.RadarHTTPSummaryDeviceTypeParamsHTTPVersionHttPv1, cloudflare.RadarHTTPSummaryDeviceTypeParamsHTTPVersionHttPv2, cloudflare.RadarHTTPSummaryDeviceTypeParamsHTTPVersionHttPv3}),
- IPVersion: cloudflare.F([]cloudflare.RadarHTTPSummaryDeviceTypeParamsIPVersion{cloudflare.RadarHTTPSummaryDeviceTypeParamsIPVersionIPv4, cloudflare.RadarHTTPSummaryDeviceTypeParamsIPVersionIPv6}),
- Location: cloudflare.F([]string{"string", "string", "string"}),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- OS: cloudflare.F([]cloudflare.RadarHTTPSummaryDeviceTypeParamsOS{cloudflare.RadarHTTPSummaryDeviceTypeParamsOSWindows, cloudflare.RadarHTTPSummaryDeviceTypeParamsOSMacosx, cloudflare.RadarHTTPSummaryDeviceTypeParamsOSIos}),
- TLSVersion: cloudflare.F([]cloudflare.RadarHTTPSummaryDeviceTypeParamsTLSVersion{cloudflare.RadarHTTPSummaryDeviceTypeParamsTLSVersionTlSv1_0, cloudflare.RadarHTTPSummaryDeviceTypeParamsTLSVersionTlSv1_1, cloudflare.RadarHTTPSummaryDeviceTypeParamsTLSVersionTlSv1_2}),
- })
- 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())
- }
-}
-
-func TestRadarHTTPSummaryHTTPProtocolWithOptionalParams(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"),
- )
- _, 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()}),
- DeviceType: cloudflare.F([]cloudflare.RadarHTTPSummaryHTTPProtocolParamsDeviceType{cloudflare.RadarHTTPSummaryHTTPProtocolParamsDeviceTypeDesktop, cloudflare.RadarHTTPSummaryHTTPProtocolParamsDeviceTypeMobile, cloudflare.RadarHTTPSummaryHTTPProtocolParamsDeviceTypeOther}),
- Format: cloudflare.F(cloudflare.RadarHTTPSummaryHTTPProtocolParamsFormatJson),
- HTTPVersion: cloudflare.F([]cloudflare.RadarHTTPSummaryHTTPProtocolParamsHTTPVersion{cloudflare.RadarHTTPSummaryHTTPProtocolParamsHTTPVersionHttPv1, cloudflare.RadarHTTPSummaryHTTPProtocolParamsHTTPVersionHttPv2, cloudflare.RadarHTTPSummaryHTTPProtocolParamsHTTPVersionHttPv3}),
- IPVersion: cloudflare.F([]cloudflare.RadarHTTPSummaryHTTPProtocolParamsIPVersion{cloudflare.RadarHTTPSummaryHTTPProtocolParamsIPVersionIPv4, cloudflare.RadarHTTPSummaryHTTPProtocolParamsIPVersionIPv6}),
- Location: cloudflare.F([]string{"string", "string", "string"}),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- OS: cloudflare.F([]cloudflare.RadarHTTPSummaryHTTPProtocolParamsOS{cloudflare.RadarHTTPSummaryHTTPProtocolParamsOSWindows, cloudflare.RadarHTTPSummaryHTTPProtocolParamsOSMacosx, cloudflare.RadarHTTPSummaryHTTPProtocolParamsOSIos}),
- TLSVersion: cloudflare.F([]cloudflare.RadarHTTPSummaryHTTPProtocolParamsTLSVersion{cloudflare.RadarHTTPSummaryHTTPProtocolParamsTLSVersionTlSv1_0, cloudflare.RadarHTTPSummaryHTTPProtocolParamsTLSVersionTlSv1_1, cloudflare.RadarHTTPSummaryHTTPProtocolParamsTLSVersionTlSv1_2}),
- })
- 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())
- }
-}
-
-func TestRadarHTTPSummaryHTTPVersionWithOptionalParams(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"),
- )
- _, 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()}),
- DeviceType: cloudflare.F([]cloudflare.RadarHTTPSummaryHTTPVersionParamsDeviceType{cloudflare.RadarHTTPSummaryHTTPVersionParamsDeviceTypeDesktop, cloudflare.RadarHTTPSummaryHTTPVersionParamsDeviceTypeMobile, cloudflare.RadarHTTPSummaryHTTPVersionParamsDeviceTypeOther}),
- Format: cloudflare.F(cloudflare.RadarHTTPSummaryHTTPVersionParamsFormatJson),
- HTTPProtocol: cloudflare.F([]cloudflare.RadarHTTPSummaryHTTPVersionParamsHTTPProtocol{cloudflare.RadarHTTPSummaryHTTPVersionParamsHTTPProtocolHTTP, cloudflare.RadarHTTPSummaryHTTPVersionParamsHTTPProtocolHTTPS}),
- IPVersion: cloudflare.F([]cloudflare.RadarHTTPSummaryHTTPVersionParamsIPVersion{cloudflare.RadarHTTPSummaryHTTPVersionParamsIPVersionIPv4, cloudflare.RadarHTTPSummaryHTTPVersionParamsIPVersionIPv6}),
- Location: cloudflare.F([]string{"string", "string", "string"}),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- OS: cloudflare.F([]cloudflare.RadarHTTPSummaryHTTPVersionParamsOS{cloudflare.RadarHTTPSummaryHTTPVersionParamsOSWindows, cloudflare.RadarHTTPSummaryHTTPVersionParamsOSMacosx, cloudflare.RadarHTTPSummaryHTTPVersionParamsOSIos}),
- TLSVersion: cloudflare.F([]cloudflare.RadarHTTPSummaryHTTPVersionParamsTLSVersion{cloudflare.RadarHTTPSummaryHTTPVersionParamsTLSVersionTlSv1_0, cloudflare.RadarHTTPSummaryHTTPVersionParamsTLSVersionTlSv1_1, cloudflare.RadarHTTPSummaryHTTPVersionParamsTLSVersionTlSv1_2}),
- })
- 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())
- }
-}
-
-func TestRadarHTTPSummaryIPVersionWithOptionalParams(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"),
- )
- _, 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()}),
- DeviceType: cloudflare.F([]cloudflare.RadarHTTPSummaryIPVersionParamsDeviceType{cloudflare.RadarHTTPSummaryIPVersionParamsDeviceTypeDesktop, cloudflare.RadarHTTPSummaryIPVersionParamsDeviceTypeMobile, cloudflare.RadarHTTPSummaryIPVersionParamsDeviceTypeOther}),
- Format: cloudflare.F(cloudflare.RadarHTTPSummaryIPVersionParamsFormatJson),
- HTTPProtocol: cloudflare.F([]cloudflare.RadarHTTPSummaryIPVersionParamsHTTPProtocol{cloudflare.RadarHTTPSummaryIPVersionParamsHTTPProtocolHTTP, cloudflare.RadarHTTPSummaryIPVersionParamsHTTPProtocolHTTPS}),
- HTTPVersion: cloudflare.F([]cloudflare.RadarHTTPSummaryIPVersionParamsHTTPVersion{cloudflare.RadarHTTPSummaryIPVersionParamsHTTPVersionHttPv1, cloudflare.RadarHTTPSummaryIPVersionParamsHTTPVersionHttPv2, cloudflare.RadarHTTPSummaryIPVersionParamsHTTPVersionHttPv3}),
- Location: cloudflare.F([]string{"string", "string", "string"}),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- OS: cloudflare.F([]cloudflare.RadarHTTPSummaryIPVersionParamsOS{cloudflare.RadarHTTPSummaryIPVersionParamsOSWindows, cloudflare.RadarHTTPSummaryIPVersionParamsOSMacosx, cloudflare.RadarHTTPSummaryIPVersionParamsOSIos}),
- TLSVersion: cloudflare.F([]cloudflare.RadarHTTPSummaryIPVersionParamsTLSVersion{cloudflare.RadarHTTPSummaryIPVersionParamsTLSVersionTlSv1_0, cloudflare.RadarHTTPSummaryIPVersionParamsTLSVersionTlSv1_1, cloudflare.RadarHTTPSummaryIPVersionParamsTLSVersionTlSv1_2}),
- })
- 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())
- }
-}
-
-func TestRadarHTTPSummaryOSWithOptionalParams(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"),
- )
- _, 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()}),
- DeviceType: cloudflare.F([]cloudflare.RadarHTTPSummaryOSParamsDeviceType{cloudflare.RadarHTTPSummaryOSParamsDeviceTypeDesktop, cloudflare.RadarHTTPSummaryOSParamsDeviceTypeMobile, cloudflare.RadarHTTPSummaryOSParamsDeviceTypeOther}),
- Format: cloudflare.F(cloudflare.RadarHTTPSummaryOSParamsFormatJson),
- HTTPProtocol: cloudflare.F([]cloudflare.RadarHTTPSummaryOSParamsHTTPProtocol{cloudflare.RadarHTTPSummaryOSParamsHTTPProtocolHTTP, cloudflare.RadarHTTPSummaryOSParamsHTTPProtocolHTTPS}),
- HTTPVersion: cloudflare.F([]cloudflare.RadarHTTPSummaryOSParamsHTTPVersion{cloudflare.RadarHTTPSummaryOSParamsHTTPVersionHttPv1, cloudflare.RadarHTTPSummaryOSParamsHTTPVersionHttPv2, cloudflare.RadarHTTPSummaryOSParamsHTTPVersionHttPv3}),
- IPVersion: cloudflare.F([]cloudflare.RadarHTTPSummaryOSParamsIPVersion{cloudflare.RadarHTTPSummaryOSParamsIPVersionIPv4, cloudflare.RadarHTTPSummaryOSParamsIPVersionIPv6}),
- Location: cloudflare.F([]string{"string", "string", "string"}),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- TLSVersion: cloudflare.F([]cloudflare.RadarHTTPSummaryOSParamsTLSVersion{cloudflare.RadarHTTPSummaryOSParamsTLSVersionTlSv1_0, cloudflare.RadarHTTPSummaryOSParamsTLSVersionTlSv1_1, cloudflare.RadarHTTPSummaryOSParamsTLSVersionTlSv1_2}),
- })
- 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())
- }
-}
-
-func TestRadarHTTPSummaryTLSVersionWithOptionalParams(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"),
- )
- _, 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()}),
- DeviceType: cloudflare.F([]cloudflare.RadarHTTPSummaryTLSVersionParamsDeviceType{cloudflare.RadarHTTPSummaryTLSVersionParamsDeviceTypeDesktop, cloudflare.RadarHTTPSummaryTLSVersionParamsDeviceTypeMobile, cloudflare.RadarHTTPSummaryTLSVersionParamsDeviceTypeOther}),
- Format: cloudflare.F(cloudflare.RadarHTTPSummaryTLSVersionParamsFormatJson),
- HTTPProtocol: cloudflare.F([]cloudflare.RadarHTTPSummaryTLSVersionParamsHTTPProtocol{cloudflare.RadarHTTPSummaryTLSVersionParamsHTTPProtocolHTTP, cloudflare.RadarHTTPSummaryTLSVersionParamsHTTPProtocolHTTPS}),
- HTTPVersion: cloudflare.F([]cloudflare.RadarHTTPSummaryTLSVersionParamsHTTPVersion{cloudflare.RadarHTTPSummaryTLSVersionParamsHTTPVersionHttPv1, cloudflare.RadarHTTPSummaryTLSVersionParamsHTTPVersionHttPv2, cloudflare.RadarHTTPSummaryTLSVersionParamsHTTPVersionHttPv3}),
- IPVersion: cloudflare.F([]cloudflare.RadarHTTPSummaryTLSVersionParamsIPVersion{cloudflare.RadarHTTPSummaryTLSVersionParamsIPVersionIPv4, cloudflare.RadarHTTPSummaryTLSVersionParamsIPVersionIPv6}),
- Location: cloudflare.F([]string{"string", "string", "string"}),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- OS: cloudflare.F([]cloudflare.RadarHTTPSummaryTLSVersionParamsOS{cloudflare.RadarHTTPSummaryTLSVersionParamsOSWindows, cloudflare.RadarHTTPSummaryTLSVersionParamsOSMacosx, cloudflare.RadarHTTPSummaryTLSVersionParamsOSIos}),
- })
- 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/radarhttptimeseriesgroup.go b/radarhttptimeseriesgroup.go
deleted file mode 100644
index 6c3645d23d2..00000000000
--- a/radarhttptimeseriesgroup.go
+++ /dev/null
@@ -1,2115 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarHTTPTimeseriesGroupService contains methods and other services that help
-// with interacting with the cloudflare API. Note, unlike clients, this service
-// does not read variables from the environment automatically. You should not
-// instantiate this service directly, and instead use the
-// [NewRadarHTTPTimeseriesGroupService] method instead.
-type RadarHTTPTimeseriesGroupService struct {
- Options []option.RequestOption
-}
-
-// NewRadarHTTPTimeseriesGroupService generates a new service that applies the
-// given options to each request. These options are applied after the parent
-// client's options (if there is one), and before any request-specific options.
-func NewRadarHTTPTimeseriesGroupService(opts ...option.RequestOption) (r *RadarHTTPTimeseriesGroupService) {
- r = &RadarHTTPTimeseriesGroupService{}
- r.Options = opts
- return
-}
-
-// Get a time series of the percentage distribution of traffic classified as
-// automated or human. Visit
-// https://developers.cloudflare.com/radar/concepts/bot-classes/ for more
-// information.
-func (r *RadarHTTPTimeseriesGroupService) BotClass(ctx context.Context, query RadarHTTPTimeseriesGroupBotClassParams, opts ...option.RequestOption) (res *RadarHTTPTimeseriesGroupBotClassResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarHTTPTimeseriesGroupBotClassResponseEnvelope
- path := "radar/http/timeseries_groups/bot_class"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Get a time series of the percentage distribution of traffic of the top user
-// agents.
-func (r *RadarHTTPTimeseriesGroupService) Browser(ctx context.Context, query RadarHTTPTimeseriesGroupBrowserParams, opts ...option.RequestOption) (res *RadarHTTPTimeseriesGroupBrowserResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarHTTPTimeseriesGroupBrowserResponseEnvelope
- path := "radar/http/timeseries_groups/browser"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Get a time series of the percentage distribution of traffic of the top user
-// agents aggregated in families.
-func (r *RadarHTTPTimeseriesGroupService) BrowserFamily(ctx context.Context, query RadarHTTPTimeseriesGroupBrowserFamilyParams, opts ...option.RequestOption) (res *RadarHTTPTimeseriesGroupBrowserFamilyResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarHTTPTimeseriesGroupBrowserFamilyResponseEnvelope
- path := "radar/http/timeseries_groups/browser_family"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Get a time series of the percentage distribution of traffic per device type.
-func (r *RadarHTTPTimeseriesGroupService) DeviceType(ctx context.Context, query RadarHTTPTimeseriesGroupDeviceTypeParams, opts ...option.RequestOption) (res *RadarHTTPTimeseriesGroupDeviceTypeResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarHTTPTimeseriesGroupDeviceTypeResponseEnvelope
- path := "radar/http/timeseries_groups/device_type"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Get a time series of the percentage distribution of traffic per HTTP protocol.
-func (r *RadarHTTPTimeseriesGroupService) HTTPProtocol(ctx context.Context, query RadarHTTPTimeseriesGroupHTTPProtocolParams, opts ...option.RequestOption) (res *RadarHTTPTimeseriesGroupHTTPProtocolResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarHTTPTimeseriesGroupHTTPProtocolResponseEnvelope
- path := "radar/http/timeseries_groups/http_protocol"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Get a time series of the percentage distribution of traffic per HTTP protocol
-// version.
-func (r *RadarHTTPTimeseriesGroupService) HTTPVersion(ctx context.Context, query RadarHTTPTimeseriesGroupHTTPVersionParams, opts ...option.RequestOption) (res *RadarHTTPTimeseriesGroupHTTPVersionResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarHTTPTimeseriesGroupHTTPVersionResponseEnvelope
- path := "radar/http/timeseries_groups/http_version"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Get a time series of the percentage distribution of traffic per IP protocol
-// version.
-func (r *RadarHTTPTimeseriesGroupService) IPVersion(ctx context.Context, query RadarHTTPTimeseriesGroupIPVersionParams, opts ...option.RequestOption) (res *RadarHTTPTimeseriesGroupIPVersionResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarHTTPTimeseriesGroupIPVersionResponseEnvelope
- path := "radar/http/timeseries_groups/ip_version"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Get a time series of the percentage distribution of traffic of the top operating
-// systems.
-func (r *RadarHTTPTimeseriesGroupService) OS(ctx context.Context, query RadarHTTPTimeseriesGroupOSParams, opts ...option.RequestOption) (res *RadarHTTPTimeseriesGroupOSResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarHTTPTimeseriesGroupOSResponseEnvelope
- path := "radar/http/timeseries_groups/os"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Get a time series of the percentage distribution of traffic per TLS protocol
-// version.
-func (r *RadarHTTPTimeseriesGroupService) TLSVersion(ctx context.Context, query RadarHTTPTimeseriesGroupTLSVersionParams, opts ...option.RequestOption) (res *RadarHTTPTimeseriesGroupTLSVersionResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarHTTPTimeseriesGroupTLSVersionResponseEnvelope
- path := "radar/http/timeseries_groups/tls_version"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type RadarHTTPTimeseriesGroupBotClassResponse struct {
- Meta interface{} `json:"meta,required"`
- Serie0 RadarHTTPTimeseriesGroupBotClassResponseSerie0 `json:"serie_0,required"`
- JSON radarHTTPTimeseriesGroupBotClassResponseJSON `json:"-"`
-}
-
-// radarHTTPTimeseriesGroupBotClassResponseJSON contains the JSON metadata for the
-// struct [RadarHTTPTimeseriesGroupBotClassResponse]
-type radarHTTPTimeseriesGroupBotClassResponseJSON struct {
- Meta apijson.Field
- Serie0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPTimeseriesGroupBotClassResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPTimeseriesGroupBotClassResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPTimeseriesGroupBotClassResponseSerie0 struct {
- Bot []string `json:"bot,required"`
- Human []string `json:"human,required"`
- Timestamps []string `json:"timestamps,required"`
- JSON radarHTTPTimeseriesGroupBotClassResponseSerie0JSON `json:"-"`
-}
-
-// radarHTTPTimeseriesGroupBotClassResponseSerie0JSON contains the JSON metadata
-// for the struct [RadarHTTPTimeseriesGroupBotClassResponseSerie0]
-type radarHTTPTimeseriesGroupBotClassResponseSerie0JSON struct {
- Bot apijson.Field
- Human apijson.Field
- Timestamps apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPTimeseriesGroupBotClassResponseSerie0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPTimeseriesGroupBotClassResponseSerie0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPTimeseriesGroupBrowserResponse struct {
- Meta interface{} `json:"meta,required"`
- Serie0 RadarHTTPTimeseriesGroupBrowserResponseSerie0 `json:"serie_0,required"`
- JSON radarHTTPTimeseriesGroupBrowserResponseJSON `json:"-"`
-}
-
-// radarHTTPTimeseriesGroupBrowserResponseJSON contains the JSON metadata for the
-// struct [RadarHTTPTimeseriesGroupBrowserResponse]
-type radarHTTPTimeseriesGroupBrowserResponseJSON struct {
- Meta apijson.Field
- Serie0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPTimeseriesGroupBrowserResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPTimeseriesGroupBrowserResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPTimeseriesGroupBrowserResponseSerie0 struct {
- Timestamps []string `json:"timestamps,required"`
- ExtraFields map[string][]string `json:"-,extras"`
- JSON radarHTTPTimeseriesGroupBrowserResponseSerie0JSON `json:"-"`
-}
-
-// radarHTTPTimeseriesGroupBrowserResponseSerie0JSON contains the JSON metadata for
-// the struct [RadarHTTPTimeseriesGroupBrowserResponseSerie0]
-type radarHTTPTimeseriesGroupBrowserResponseSerie0JSON struct {
- Timestamps apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPTimeseriesGroupBrowserResponseSerie0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPTimeseriesGroupBrowserResponseSerie0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPTimeseriesGroupBrowserFamilyResponse struct {
- Meta interface{} `json:"meta,required"`
- Serie0 RadarHTTPTimeseriesGroupBrowserFamilyResponseSerie0 `json:"serie_0,required"`
- JSON radarHTTPTimeseriesGroupBrowserFamilyResponseJSON `json:"-"`
-}
-
-// radarHTTPTimeseriesGroupBrowserFamilyResponseJSON contains the JSON metadata for
-// the struct [RadarHTTPTimeseriesGroupBrowserFamilyResponse]
-type radarHTTPTimeseriesGroupBrowserFamilyResponseJSON struct {
- Meta apijson.Field
- Serie0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPTimeseriesGroupBrowserFamilyResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPTimeseriesGroupBrowserFamilyResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPTimeseriesGroupBrowserFamilyResponseSerie0 struct {
- Timestamps []string `json:"timestamps,required"`
- ExtraFields map[string][]string `json:"-,extras"`
- JSON radarHTTPTimeseriesGroupBrowserFamilyResponseSerie0JSON `json:"-"`
-}
-
-// radarHTTPTimeseriesGroupBrowserFamilyResponseSerie0JSON contains the JSON
-// metadata for the struct [RadarHTTPTimeseriesGroupBrowserFamilyResponseSerie0]
-type radarHTTPTimeseriesGroupBrowserFamilyResponseSerie0JSON struct {
- Timestamps apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPTimeseriesGroupBrowserFamilyResponseSerie0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPTimeseriesGroupBrowserFamilyResponseSerie0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPTimeseriesGroupDeviceTypeResponse struct {
- Meta interface{} `json:"meta,required"`
- Serie0 RadarHTTPTimeseriesGroupDeviceTypeResponseSerie0 `json:"serie_0,required"`
- JSON radarHTTPTimeseriesGroupDeviceTypeResponseJSON `json:"-"`
-}
-
-// radarHTTPTimeseriesGroupDeviceTypeResponseJSON contains the JSON metadata for
-// the struct [RadarHTTPTimeseriesGroupDeviceTypeResponse]
-type radarHTTPTimeseriesGroupDeviceTypeResponseJSON struct {
- Meta apijson.Field
- Serie0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPTimeseriesGroupDeviceTypeResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPTimeseriesGroupDeviceTypeResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPTimeseriesGroupDeviceTypeResponseSerie0 struct {
- Desktop []string `json:"desktop,required"`
- Mobile []string `json:"mobile,required"`
- Other []string `json:"other,required"`
- Timestamps []string `json:"timestamps,required"`
- JSON radarHTTPTimeseriesGroupDeviceTypeResponseSerie0JSON `json:"-"`
-}
-
-// radarHTTPTimeseriesGroupDeviceTypeResponseSerie0JSON contains the JSON metadata
-// for the struct [RadarHTTPTimeseriesGroupDeviceTypeResponseSerie0]
-type radarHTTPTimeseriesGroupDeviceTypeResponseSerie0JSON struct {
- Desktop apijson.Field
- Mobile apijson.Field
- Other apijson.Field
- Timestamps apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPTimeseriesGroupDeviceTypeResponseSerie0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPTimeseriesGroupDeviceTypeResponseSerie0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPTimeseriesGroupHTTPProtocolResponse struct {
- Meta interface{} `json:"meta,required"`
- Serie0 RadarHTTPTimeseriesGroupHTTPProtocolResponseSerie0 `json:"serie_0,required"`
- JSON radarHTTPTimeseriesGroupHTTPProtocolResponseJSON `json:"-"`
-}
-
-// radarHTTPTimeseriesGroupHTTPProtocolResponseJSON contains the JSON metadata for
-// the struct [RadarHTTPTimeseriesGroupHTTPProtocolResponse]
-type radarHTTPTimeseriesGroupHTTPProtocolResponseJSON struct {
- Meta apijson.Field
- Serie0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPTimeseriesGroupHTTPProtocolResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPTimeseriesGroupHTTPProtocolResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPTimeseriesGroupHTTPProtocolResponseSerie0 struct {
- HTTP []string `json:"http,required"`
- HTTPS []string `json:"https,required"`
- Timestamps []string `json:"timestamps,required"`
- JSON radarHTTPTimeseriesGroupHTTPProtocolResponseSerie0JSON `json:"-"`
-}
-
-// radarHTTPTimeseriesGroupHTTPProtocolResponseSerie0JSON contains the JSON
-// metadata for the struct [RadarHTTPTimeseriesGroupHTTPProtocolResponseSerie0]
-type radarHTTPTimeseriesGroupHTTPProtocolResponseSerie0JSON struct {
- HTTP apijson.Field
- HTTPS apijson.Field
- Timestamps apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPTimeseriesGroupHTTPProtocolResponseSerie0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPTimeseriesGroupHTTPProtocolResponseSerie0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPTimeseriesGroupHTTPVersionResponse struct {
- Meta interface{} `json:"meta,required"`
- Serie0 RadarHTTPTimeseriesGroupHTTPVersionResponseSerie0 `json:"serie_0,required"`
- JSON radarHTTPTimeseriesGroupHTTPVersionResponseJSON `json:"-"`
-}
-
-// radarHTTPTimeseriesGroupHTTPVersionResponseJSON contains the JSON metadata for
-// the struct [RadarHTTPTimeseriesGroupHTTPVersionResponse]
-type radarHTTPTimeseriesGroupHTTPVersionResponseJSON struct {
- Meta apijson.Field
- Serie0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPTimeseriesGroupHTTPVersionResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPTimeseriesGroupHTTPVersionResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPTimeseriesGroupHTTPVersionResponseSerie0 struct {
- HTTP1X []string `json:"HTTP/1.x,required"`
- HTTP2 []string `json:"HTTP/2,required"`
- HTTP3 []string `json:"HTTP/3,required"`
- Timestamps []string `json:"timestamps,required"`
- JSON radarHTTPTimeseriesGroupHTTPVersionResponseSerie0JSON `json:"-"`
-}
-
-// radarHTTPTimeseriesGroupHTTPVersionResponseSerie0JSON contains the JSON metadata
-// for the struct [RadarHTTPTimeseriesGroupHTTPVersionResponseSerie0]
-type radarHTTPTimeseriesGroupHTTPVersionResponseSerie0JSON struct {
- HTTP1X apijson.Field
- HTTP2 apijson.Field
- HTTP3 apijson.Field
- Timestamps apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPTimeseriesGroupHTTPVersionResponseSerie0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPTimeseriesGroupHTTPVersionResponseSerie0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPTimeseriesGroupIPVersionResponse struct {
- Meta interface{} `json:"meta,required"`
- Serie0 RadarHTTPTimeseriesGroupIPVersionResponseSerie0 `json:"serie_0,required"`
- JSON radarHTTPTimeseriesGroupIPVersionResponseJSON `json:"-"`
-}
-
-// radarHTTPTimeseriesGroupIPVersionResponseJSON contains the JSON metadata for the
-// struct [RadarHTTPTimeseriesGroupIPVersionResponse]
-type radarHTTPTimeseriesGroupIPVersionResponseJSON struct {
- Meta apijson.Field
- Serie0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPTimeseriesGroupIPVersionResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPTimeseriesGroupIPVersionResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPTimeseriesGroupIPVersionResponseSerie0 struct {
- IPv4 []string `json:"IPv4,required"`
- IPv6 []string `json:"IPv6,required"`
- Timestamps []string `json:"timestamps,required"`
- JSON radarHTTPTimeseriesGroupIPVersionResponseSerie0JSON `json:"-"`
-}
-
-// radarHTTPTimeseriesGroupIPVersionResponseSerie0JSON contains the JSON metadata
-// for the struct [RadarHTTPTimeseriesGroupIPVersionResponseSerie0]
-type radarHTTPTimeseriesGroupIPVersionResponseSerie0JSON struct {
- IPv4 apijson.Field
- IPv6 apijson.Field
- Timestamps apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPTimeseriesGroupIPVersionResponseSerie0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPTimeseriesGroupIPVersionResponseSerie0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPTimeseriesGroupOSResponse struct {
- Meta interface{} `json:"meta,required"`
- Serie0 RadarHTTPTimeseriesGroupOSResponseSerie0 `json:"serie_0,required"`
- JSON radarHTTPTimeseriesGroupOSResponseJSON `json:"-"`
-}
-
-// radarHTTPTimeseriesGroupOSResponseJSON contains the JSON metadata for the struct
-// [RadarHTTPTimeseriesGroupOSResponse]
-type radarHTTPTimeseriesGroupOSResponseJSON struct {
- Meta apijson.Field
- Serie0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPTimeseriesGroupOSResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPTimeseriesGroupOSResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPTimeseriesGroupOSResponseSerie0 struct {
- Timestamps []string `json:"timestamps,required"`
- ExtraFields map[string][]string `json:"-,extras"`
- JSON radarHTTPTimeseriesGroupOSResponseSerie0JSON `json:"-"`
-}
-
-// radarHTTPTimeseriesGroupOSResponseSerie0JSON contains the JSON metadata for the
-// struct [RadarHTTPTimeseriesGroupOSResponseSerie0]
-type radarHTTPTimeseriesGroupOSResponseSerie0JSON struct {
- Timestamps apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPTimeseriesGroupOSResponseSerie0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPTimeseriesGroupOSResponseSerie0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPTimeseriesGroupTLSVersionResponse struct {
- Meta interface{} `json:"meta,required"`
- Serie0 RadarHTTPTimeseriesGroupTLSVersionResponseSerie0 `json:"serie_0,required"`
- JSON radarHTTPTimeseriesGroupTLSVersionResponseJSON `json:"-"`
-}
-
-// radarHTTPTimeseriesGroupTLSVersionResponseJSON contains the JSON metadata for
-// the struct [RadarHTTPTimeseriesGroupTLSVersionResponse]
-type radarHTTPTimeseriesGroupTLSVersionResponseJSON struct {
- Meta apijson.Field
- Serie0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPTimeseriesGroupTLSVersionResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPTimeseriesGroupTLSVersionResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPTimeseriesGroupTLSVersionResponseSerie0 struct {
- Timestamps []string `json:"timestamps,required"`
- TLS1_0 []string `json:"TLS 1.0,required"`
- TLS1_1 []string `json:"TLS 1.1,required"`
- TLS1_2 []string `json:"TLS 1.2,required"`
- TLS1_3 []string `json:"TLS 1.3,required"`
- TLSQuic []string `json:"TLS QUIC,required"`
- JSON radarHTTPTimeseriesGroupTLSVersionResponseSerie0JSON `json:"-"`
-}
-
-// radarHTTPTimeseriesGroupTLSVersionResponseSerie0JSON contains the JSON metadata
-// for the struct [RadarHTTPTimeseriesGroupTLSVersionResponseSerie0]
-type radarHTTPTimeseriesGroupTLSVersionResponseSerie0JSON struct {
- Timestamps apijson.Field
- TLS1_0 apijson.Field
- TLS1_1 apijson.Field
- TLS1_2 apijson.Field
- TLS1_3 apijson.Field
- TLSQuic apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPTimeseriesGroupTLSVersionResponseSerie0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPTimeseriesGroupTLSVersionResponseSerie0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPTimeseriesGroupBotClassParams struct {
- // Aggregation interval results should be returned in (for example, in 15 minutes
- // or 1 hour intervals). Refer to
- // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
- AggInterval param.Field[RadarHTTPTimeseriesGroupBotClassParamsAggInterval] `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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarHTTPTimeseriesGroupBotClassParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Filter for device type.
- DeviceType param.Field[[]RadarHTTPTimeseriesGroupBotClassParamsDeviceType] `query:"deviceType"`
- // Format results are returned in.
- Format param.Field[RadarHTTPTimeseriesGroupBotClassParamsFormat] `query:"format"`
- // Filter for http protocol.
- HTTPProtocol param.Field[[]RadarHTTPTimeseriesGroupBotClassParamsHTTPProtocol] `query:"httpProtocol"`
- // Filter for http version.
- HTTPVersion param.Field[[]RadarHTTPTimeseriesGroupBotClassParamsHTTPVersion] `query:"httpVersion"`
- // Filter for ip version.
- IPVersion param.Field[[]RadarHTTPTimeseriesGroupBotClassParamsIPVersion] `query:"ipVersion"`
- // 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 os name.
- OS param.Field[[]RadarHTTPTimeseriesGroupBotClassParamsOS] `query:"os"`
- // Filter for tls version.
- TLSVersion param.Field[[]RadarHTTPTimeseriesGroupBotClassParamsTLSVersion] `query:"tlsVersion"`
-}
-
-// URLQuery serializes [RadarHTTPTimeseriesGroupBotClassParams]'s query parameters
-// as `url.Values`.
-func (r RadarHTTPTimeseriesGroupBotClassParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Aggregation interval results should be returned in (for example, in 15 minutes
-// or 1 hour intervals). Refer to
-// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
-type RadarHTTPTimeseriesGroupBotClassParamsAggInterval string
-
-const (
- RadarHTTPTimeseriesGroupBotClassParamsAggInterval15m RadarHTTPTimeseriesGroupBotClassParamsAggInterval = "15m"
- RadarHTTPTimeseriesGroupBotClassParamsAggInterval1h RadarHTTPTimeseriesGroupBotClassParamsAggInterval = "1h"
- RadarHTTPTimeseriesGroupBotClassParamsAggInterval1d RadarHTTPTimeseriesGroupBotClassParamsAggInterval = "1d"
- RadarHTTPTimeseriesGroupBotClassParamsAggInterval1w RadarHTTPTimeseriesGroupBotClassParamsAggInterval = "1w"
-)
-
-type RadarHTTPTimeseriesGroupBotClassParamsDateRange string
-
-const (
- RadarHTTPTimeseriesGroupBotClassParamsDateRange1d RadarHTTPTimeseriesGroupBotClassParamsDateRange = "1d"
- RadarHTTPTimeseriesGroupBotClassParamsDateRange2d RadarHTTPTimeseriesGroupBotClassParamsDateRange = "2d"
- RadarHTTPTimeseriesGroupBotClassParamsDateRange7d RadarHTTPTimeseriesGroupBotClassParamsDateRange = "7d"
- RadarHTTPTimeseriesGroupBotClassParamsDateRange14d RadarHTTPTimeseriesGroupBotClassParamsDateRange = "14d"
- RadarHTTPTimeseriesGroupBotClassParamsDateRange28d RadarHTTPTimeseriesGroupBotClassParamsDateRange = "28d"
- RadarHTTPTimeseriesGroupBotClassParamsDateRange12w RadarHTTPTimeseriesGroupBotClassParamsDateRange = "12w"
- RadarHTTPTimeseriesGroupBotClassParamsDateRange24w RadarHTTPTimeseriesGroupBotClassParamsDateRange = "24w"
- RadarHTTPTimeseriesGroupBotClassParamsDateRange52w RadarHTTPTimeseriesGroupBotClassParamsDateRange = "52w"
- RadarHTTPTimeseriesGroupBotClassParamsDateRange1dControl RadarHTTPTimeseriesGroupBotClassParamsDateRange = "1dControl"
- RadarHTTPTimeseriesGroupBotClassParamsDateRange2dControl RadarHTTPTimeseriesGroupBotClassParamsDateRange = "2dControl"
- RadarHTTPTimeseriesGroupBotClassParamsDateRange7dControl RadarHTTPTimeseriesGroupBotClassParamsDateRange = "7dControl"
- RadarHTTPTimeseriesGroupBotClassParamsDateRange14dControl RadarHTTPTimeseriesGroupBotClassParamsDateRange = "14dControl"
- RadarHTTPTimeseriesGroupBotClassParamsDateRange28dControl RadarHTTPTimeseriesGroupBotClassParamsDateRange = "28dControl"
- RadarHTTPTimeseriesGroupBotClassParamsDateRange12wControl RadarHTTPTimeseriesGroupBotClassParamsDateRange = "12wControl"
- RadarHTTPTimeseriesGroupBotClassParamsDateRange24wControl RadarHTTPTimeseriesGroupBotClassParamsDateRange = "24wControl"
-)
-
-type RadarHTTPTimeseriesGroupBotClassParamsDeviceType string
-
-const (
- RadarHTTPTimeseriesGroupBotClassParamsDeviceTypeDesktop RadarHTTPTimeseriesGroupBotClassParamsDeviceType = "DESKTOP"
- RadarHTTPTimeseriesGroupBotClassParamsDeviceTypeMobile RadarHTTPTimeseriesGroupBotClassParamsDeviceType = "MOBILE"
- RadarHTTPTimeseriesGroupBotClassParamsDeviceTypeOther RadarHTTPTimeseriesGroupBotClassParamsDeviceType = "OTHER"
-)
-
-// Format results are returned in.
-type RadarHTTPTimeseriesGroupBotClassParamsFormat string
-
-const (
- RadarHTTPTimeseriesGroupBotClassParamsFormatJson RadarHTTPTimeseriesGroupBotClassParamsFormat = "JSON"
- RadarHTTPTimeseriesGroupBotClassParamsFormatCsv RadarHTTPTimeseriesGroupBotClassParamsFormat = "CSV"
-)
-
-type RadarHTTPTimeseriesGroupBotClassParamsHTTPProtocol string
-
-const (
- RadarHTTPTimeseriesGroupBotClassParamsHTTPProtocolHTTP RadarHTTPTimeseriesGroupBotClassParamsHTTPProtocol = "HTTP"
- RadarHTTPTimeseriesGroupBotClassParamsHTTPProtocolHTTPS RadarHTTPTimeseriesGroupBotClassParamsHTTPProtocol = "HTTPS"
-)
-
-type RadarHTTPTimeseriesGroupBotClassParamsHTTPVersion string
-
-const (
- RadarHTTPTimeseriesGroupBotClassParamsHTTPVersionHttPv1 RadarHTTPTimeseriesGroupBotClassParamsHTTPVersion = "HTTPv1"
- RadarHTTPTimeseriesGroupBotClassParamsHTTPVersionHttPv2 RadarHTTPTimeseriesGroupBotClassParamsHTTPVersion = "HTTPv2"
- RadarHTTPTimeseriesGroupBotClassParamsHTTPVersionHttPv3 RadarHTTPTimeseriesGroupBotClassParamsHTTPVersion = "HTTPv3"
-)
-
-type RadarHTTPTimeseriesGroupBotClassParamsIPVersion string
-
-const (
- RadarHTTPTimeseriesGroupBotClassParamsIPVersionIPv4 RadarHTTPTimeseriesGroupBotClassParamsIPVersion = "IPv4"
- RadarHTTPTimeseriesGroupBotClassParamsIPVersionIPv6 RadarHTTPTimeseriesGroupBotClassParamsIPVersion = "IPv6"
-)
-
-type RadarHTTPTimeseriesGroupBotClassParamsOS string
-
-const (
- RadarHTTPTimeseriesGroupBotClassParamsOSWindows RadarHTTPTimeseriesGroupBotClassParamsOS = "WINDOWS"
- RadarHTTPTimeseriesGroupBotClassParamsOSMacosx RadarHTTPTimeseriesGroupBotClassParamsOS = "MACOSX"
- RadarHTTPTimeseriesGroupBotClassParamsOSIos RadarHTTPTimeseriesGroupBotClassParamsOS = "IOS"
- RadarHTTPTimeseriesGroupBotClassParamsOSAndroid RadarHTTPTimeseriesGroupBotClassParamsOS = "ANDROID"
- RadarHTTPTimeseriesGroupBotClassParamsOSChromeos RadarHTTPTimeseriesGroupBotClassParamsOS = "CHROMEOS"
- RadarHTTPTimeseriesGroupBotClassParamsOSLinux RadarHTTPTimeseriesGroupBotClassParamsOS = "LINUX"
- RadarHTTPTimeseriesGroupBotClassParamsOSSmartTv RadarHTTPTimeseriesGroupBotClassParamsOS = "SMART_TV"
-)
-
-type RadarHTTPTimeseriesGroupBotClassParamsTLSVersion string
-
-const (
- RadarHTTPTimeseriesGroupBotClassParamsTLSVersionTlSv1_0 RadarHTTPTimeseriesGroupBotClassParamsTLSVersion = "TLSv1_0"
- RadarHTTPTimeseriesGroupBotClassParamsTLSVersionTlSv1_1 RadarHTTPTimeseriesGroupBotClassParamsTLSVersion = "TLSv1_1"
- RadarHTTPTimeseriesGroupBotClassParamsTLSVersionTlSv1_2 RadarHTTPTimeseriesGroupBotClassParamsTLSVersion = "TLSv1_2"
- RadarHTTPTimeseriesGroupBotClassParamsTLSVersionTlSv1_3 RadarHTTPTimeseriesGroupBotClassParamsTLSVersion = "TLSv1_3"
- RadarHTTPTimeseriesGroupBotClassParamsTLSVersionTlSvQuic RadarHTTPTimeseriesGroupBotClassParamsTLSVersion = "TLSvQUIC"
-)
-
-type RadarHTTPTimeseriesGroupBotClassResponseEnvelope struct {
- Result RadarHTTPTimeseriesGroupBotClassResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarHTTPTimeseriesGroupBotClassResponseEnvelopeJSON `json:"-"`
-}
-
-// radarHTTPTimeseriesGroupBotClassResponseEnvelopeJSON contains the JSON metadata
-// for the struct [RadarHTTPTimeseriesGroupBotClassResponseEnvelope]
-type radarHTTPTimeseriesGroupBotClassResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPTimeseriesGroupBotClassResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPTimeseriesGroupBotClassResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPTimeseriesGroupBrowserParams struct {
- // Aggregation interval results should be returned in (for example, in 15 minutes
- // or 1 hour intervals). Refer to
- // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
- AggInterval param.Field[RadarHTTPTimeseriesGroupBrowserParamsAggInterval] `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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarHTTPTimeseriesGroupBrowserParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Filter for device type.
- DeviceType param.Field[[]RadarHTTPTimeseriesGroupBrowserParamsDeviceType] `query:"deviceType"`
- // Format results are returned in.
- Format param.Field[RadarHTTPTimeseriesGroupBrowserParamsFormat] `query:"format"`
- // Filter for http protocol.
- HTTPProtocol param.Field[[]RadarHTTPTimeseriesGroupBrowserParamsHTTPProtocol] `query:"httpProtocol"`
- // Filter for http version.
- HTTPVersion param.Field[[]RadarHTTPTimeseriesGroupBrowserParamsHTTPVersion] `query:"httpVersion"`
- // Filter for ip version.
- IPVersion param.Field[[]RadarHTTPTimeseriesGroupBrowserParamsIPVersion] `query:"ipVersion"`
- // Limit the number of objects (eg browsers, verticals, etc) to the top items over
- // the time range.
- LimitPerGroup param.Field[int64] `query:"limitPerGroup"`
- // Array of comma separated list of locations (alpha-2 country codes). Start with
- // `-` to exclude from results. For example, `-US,PT` excludes results from the US,
- // but includes results from PT.
- 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 os name.
- OS param.Field[[]RadarHTTPTimeseriesGroupBrowserParamsOS] `query:"os"`
- // Filter for tls version.
- TLSVersion param.Field[[]RadarHTTPTimeseriesGroupBrowserParamsTLSVersion] `query:"tlsVersion"`
-}
-
-// URLQuery serializes [RadarHTTPTimeseriesGroupBrowserParams]'s query parameters
-// as `url.Values`.
-func (r RadarHTTPTimeseriesGroupBrowserParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Aggregation interval results should be returned in (for example, in 15 minutes
-// or 1 hour intervals). Refer to
-// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
-type RadarHTTPTimeseriesGroupBrowserParamsAggInterval string
-
-const (
- RadarHTTPTimeseriesGroupBrowserParamsAggInterval15m RadarHTTPTimeseriesGroupBrowserParamsAggInterval = "15m"
- RadarHTTPTimeseriesGroupBrowserParamsAggInterval1h RadarHTTPTimeseriesGroupBrowserParamsAggInterval = "1h"
- RadarHTTPTimeseriesGroupBrowserParamsAggInterval1d RadarHTTPTimeseriesGroupBrowserParamsAggInterval = "1d"
- RadarHTTPTimeseriesGroupBrowserParamsAggInterval1w RadarHTTPTimeseriesGroupBrowserParamsAggInterval = "1w"
-)
-
-type RadarHTTPTimeseriesGroupBrowserParamsBotClass string
-
-const (
- RadarHTTPTimeseriesGroupBrowserParamsBotClassLikelyAutomated RadarHTTPTimeseriesGroupBrowserParamsBotClass = "LIKELY_AUTOMATED"
- RadarHTTPTimeseriesGroupBrowserParamsBotClassLikelyHuman RadarHTTPTimeseriesGroupBrowserParamsBotClass = "LIKELY_HUMAN"
-)
-
-type RadarHTTPTimeseriesGroupBrowserParamsDateRange string
-
-const (
- RadarHTTPTimeseriesGroupBrowserParamsDateRange1d RadarHTTPTimeseriesGroupBrowserParamsDateRange = "1d"
- RadarHTTPTimeseriesGroupBrowserParamsDateRange2d RadarHTTPTimeseriesGroupBrowserParamsDateRange = "2d"
- RadarHTTPTimeseriesGroupBrowserParamsDateRange7d RadarHTTPTimeseriesGroupBrowserParamsDateRange = "7d"
- RadarHTTPTimeseriesGroupBrowserParamsDateRange14d RadarHTTPTimeseriesGroupBrowserParamsDateRange = "14d"
- RadarHTTPTimeseriesGroupBrowserParamsDateRange28d RadarHTTPTimeseriesGroupBrowserParamsDateRange = "28d"
- RadarHTTPTimeseriesGroupBrowserParamsDateRange12w RadarHTTPTimeseriesGroupBrowserParamsDateRange = "12w"
- RadarHTTPTimeseriesGroupBrowserParamsDateRange24w RadarHTTPTimeseriesGroupBrowserParamsDateRange = "24w"
- RadarHTTPTimeseriesGroupBrowserParamsDateRange52w RadarHTTPTimeseriesGroupBrowserParamsDateRange = "52w"
- RadarHTTPTimeseriesGroupBrowserParamsDateRange1dControl RadarHTTPTimeseriesGroupBrowserParamsDateRange = "1dControl"
- RadarHTTPTimeseriesGroupBrowserParamsDateRange2dControl RadarHTTPTimeseriesGroupBrowserParamsDateRange = "2dControl"
- RadarHTTPTimeseriesGroupBrowserParamsDateRange7dControl RadarHTTPTimeseriesGroupBrowserParamsDateRange = "7dControl"
- RadarHTTPTimeseriesGroupBrowserParamsDateRange14dControl RadarHTTPTimeseriesGroupBrowserParamsDateRange = "14dControl"
- RadarHTTPTimeseriesGroupBrowserParamsDateRange28dControl RadarHTTPTimeseriesGroupBrowserParamsDateRange = "28dControl"
- RadarHTTPTimeseriesGroupBrowserParamsDateRange12wControl RadarHTTPTimeseriesGroupBrowserParamsDateRange = "12wControl"
- RadarHTTPTimeseriesGroupBrowserParamsDateRange24wControl RadarHTTPTimeseriesGroupBrowserParamsDateRange = "24wControl"
-)
-
-type RadarHTTPTimeseriesGroupBrowserParamsDeviceType string
-
-const (
- RadarHTTPTimeseriesGroupBrowserParamsDeviceTypeDesktop RadarHTTPTimeseriesGroupBrowserParamsDeviceType = "DESKTOP"
- RadarHTTPTimeseriesGroupBrowserParamsDeviceTypeMobile RadarHTTPTimeseriesGroupBrowserParamsDeviceType = "MOBILE"
- RadarHTTPTimeseriesGroupBrowserParamsDeviceTypeOther RadarHTTPTimeseriesGroupBrowserParamsDeviceType = "OTHER"
-)
-
-// Format results are returned in.
-type RadarHTTPTimeseriesGroupBrowserParamsFormat string
-
-const (
- RadarHTTPTimeseriesGroupBrowserParamsFormatJson RadarHTTPTimeseriesGroupBrowserParamsFormat = "JSON"
- RadarHTTPTimeseriesGroupBrowserParamsFormatCsv RadarHTTPTimeseriesGroupBrowserParamsFormat = "CSV"
-)
-
-type RadarHTTPTimeseriesGroupBrowserParamsHTTPProtocol string
-
-const (
- RadarHTTPTimeseriesGroupBrowserParamsHTTPProtocolHTTP RadarHTTPTimeseriesGroupBrowserParamsHTTPProtocol = "HTTP"
- RadarHTTPTimeseriesGroupBrowserParamsHTTPProtocolHTTPS RadarHTTPTimeseriesGroupBrowserParamsHTTPProtocol = "HTTPS"
-)
-
-type RadarHTTPTimeseriesGroupBrowserParamsHTTPVersion string
-
-const (
- RadarHTTPTimeseriesGroupBrowserParamsHTTPVersionHttPv1 RadarHTTPTimeseriesGroupBrowserParamsHTTPVersion = "HTTPv1"
- RadarHTTPTimeseriesGroupBrowserParamsHTTPVersionHttPv2 RadarHTTPTimeseriesGroupBrowserParamsHTTPVersion = "HTTPv2"
- RadarHTTPTimeseriesGroupBrowserParamsHTTPVersionHttPv3 RadarHTTPTimeseriesGroupBrowserParamsHTTPVersion = "HTTPv3"
-)
-
-type RadarHTTPTimeseriesGroupBrowserParamsIPVersion string
-
-const (
- RadarHTTPTimeseriesGroupBrowserParamsIPVersionIPv4 RadarHTTPTimeseriesGroupBrowserParamsIPVersion = "IPv4"
- RadarHTTPTimeseriesGroupBrowserParamsIPVersionIPv6 RadarHTTPTimeseriesGroupBrowserParamsIPVersion = "IPv6"
-)
-
-type RadarHTTPTimeseriesGroupBrowserParamsOS string
-
-const (
- RadarHTTPTimeseriesGroupBrowserParamsOSWindows RadarHTTPTimeseriesGroupBrowserParamsOS = "WINDOWS"
- RadarHTTPTimeseriesGroupBrowserParamsOSMacosx RadarHTTPTimeseriesGroupBrowserParamsOS = "MACOSX"
- RadarHTTPTimeseriesGroupBrowserParamsOSIos RadarHTTPTimeseriesGroupBrowserParamsOS = "IOS"
- RadarHTTPTimeseriesGroupBrowserParamsOSAndroid RadarHTTPTimeseriesGroupBrowserParamsOS = "ANDROID"
- RadarHTTPTimeseriesGroupBrowserParamsOSChromeos RadarHTTPTimeseriesGroupBrowserParamsOS = "CHROMEOS"
- RadarHTTPTimeseriesGroupBrowserParamsOSLinux RadarHTTPTimeseriesGroupBrowserParamsOS = "LINUX"
- RadarHTTPTimeseriesGroupBrowserParamsOSSmartTv RadarHTTPTimeseriesGroupBrowserParamsOS = "SMART_TV"
-)
-
-type RadarHTTPTimeseriesGroupBrowserParamsTLSVersion string
-
-const (
- RadarHTTPTimeseriesGroupBrowserParamsTLSVersionTlSv1_0 RadarHTTPTimeseriesGroupBrowserParamsTLSVersion = "TLSv1_0"
- RadarHTTPTimeseriesGroupBrowserParamsTLSVersionTlSv1_1 RadarHTTPTimeseriesGroupBrowserParamsTLSVersion = "TLSv1_1"
- RadarHTTPTimeseriesGroupBrowserParamsTLSVersionTlSv1_2 RadarHTTPTimeseriesGroupBrowserParamsTLSVersion = "TLSv1_2"
- RadarHTTPTimeseriesGroupBrowserParamsTLSVersionTlSv1_3 RadarHTTPTimeseriesGroupBrowserParamsTLSVersion = "TLSv1_3"
- RadarHTTPTimeseriesGroupBrowserParamsTLSVersionTlSvQuic RadarHTTPTimeseriesGroupBrowserParamsTLSVersion = "TLSvQUIC"
-)
-
-type RadarHTTPTimeseriesGroupBrowserResponseEnvelope struct {
- Result RadarHTTPTimeseriesGroupBrowserResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarHTTPTimeseriesGroupBrowserResponseEnvelopeJSON `json:"-"`
-}
-
-// radarHTTPTimeseriesGroupBrowserResponseEnvelopeJSON contains the JSON metadata
-// for the struct [RadarHTTPTimeseriesGroupBrowserResponseEnvelope]
-type radarHTTPTimeseriesGroupBrowserResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPTimeseriesGroupBrowserResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPTimeseriesGroupBrowserResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPTimeseriesGroupBrowserFamilyParams struct {
- // Aggregation interval results should be returned in (for example, in 15 minutes
- // or 1 hour intervals). Refer to
- // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
- AggInterval param.Field[RadarHTTPTimeseriesGroupBrowserFamilyParamsAggInterval] `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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarHTTPTimeseriesGroupBrowserFamilyParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Filter for device type.
- DeviceType param.Field[[]RadarHTTPTimeseriesGroupBrowserFamilyParamsDeviceType] `query:"deviceType"`
- // Format results are returned in.
- Format param.Field[RadarHTTPTimeseriesGroupBrowserFamilyParamsFormat] `query:"format"`
- // Filter for http protocol.
- HTTPProtocol param.Field[[]RadarHTTPTimeseriesGroupBrowserFamilyParamsHTTPProtocol] `query:"httpProtocol"`
- // Filter for http version.
- HTTPVersion param.Field[[]RadarHTTPTimeseriesGroupBrowserFamilyParamsHTTPVersion] `query:"httpVersion"`
- // Filter for ip version.
- IPVersion param.Field[[]RadarHTTPTimeseriesGroupBrowserFamilyParamsIPVersion] `query:"ipVersion"`
- // 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 os name.
- OS param.Field[[]RadarHTTPTimeseriesGroupBrowserFamilyParamsOS] `query:"os"`
- // Filter for tls version.
- TLSVersion param.Field[[]RadarHTTPTimeseriesGroupBrowserFamilyParamsTLSVersion] `query:"tlsVersion"`
-}
-
-// URLQuery serializes [RadarHTTPTimeseriesGroupBrowserFamilyParams]'s query
-// parameters as `url.Values`.
-func (r RadarHTTPTimeseriesGroupBrowserFamilyParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Aggregation interval results should be returned in (for example, in 15 minutes
-// or 1 hour intervals). Refer to
-// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
-type RadarHTTPTimeseriesGroupBrowserFamilyParamsAggInterval string
-
-const (
- RadarHTTPTimeseriesGroupBrowserFamilyParamsAggInterval15m RadarHTTPTimeseriesGroupBrowserFamilyParamsAggInterval = "15m"
- RadarHTTPTimeseriesGroupBrowserFamilyParamsAggInterval1h RadarHTTPTimeseriesGroupBrowserFamilyParamsAggInterval = "1h"
- RadarHTTPTimeseriesGroupBrowserFamilyParamsAggInterval1d RadarHTTPTimeseriesGroupBrowserFamilyParamsAggInterval = "1d"
- RadarHTTPTimeseriesGroupBrowserFamilyParamsAggInterval1w RadarHTTPTimeseriesGroupBrowserFamilyParamsAggInterval = "1w"
-)
-
-type RadarHTTPTimeseriesGroupBrowserFamilyParamsBotClass string
-
-const (
- RadarHTTPTimeseriesGroupBrowserFamilyParamsBotClassLikelyAutomated RadarHTTPTimeseriesGroupBrowserFamilyParamsBotClass = "LIKELY_AUTOMATED"
- RadarHTTPTimeseriesGroupBrowserFamilyParamsBotClassLikelyHuman RadarHTTPTimeseriesGroupBrowserFamilyParamsBotClass = "LIKELY_HUMAN"
-)
-
-type RadarHTTPTimeseriesGroupBrowserFamilyParamsDateRange string
-
-const (
- RadarHTTPTimeseriesGroupBrowserFamilyParamsDateRange1d RadarHTTPTimeseriesGroupBrowserFamilyParamsDateRange = "1d"
- RadarHTTPTimeseriesGroupBrowserFamilyParamsDateRange2d RadarHTTPTimeseriesGroupBrowserFamilyParamsDateRange = "2d"
- RadarHTTPTimeseriesGroupBrowserFamilyParamsDateRange7d RadarHTTPTimeseriesGroupBrowserFamilyParamsDateRange = "7d"
- RadarHTTPTimeseriesGroupBrowserFamilyParamsDateRange14d RadarHTTPTimeseriesGroupBrowserFamilyParamsDateRange = "14d"
- RadarHTTPTimeseriesGroupBrowserFamilyParamsDateRange28d RadarHTTPTimeseriesGroupBrowserFamilyParamsDateRange = "28d"
- RadarHTTPTimeseriesGroupBrowserFamilyParamsDateRange12w RadarHTTPTimeseriesGroupBrowserFamilyParamsDateRange = "12w"
- RadarHTTPTimeseriesGroupBrowserFamilyParamsDateRange24w RadarHTTPTimeseriesGroupBrowserFamilyParamsDateRange = "24w"
- RadarHTTPTimeseriesGroupBrowserFamilyParamsDateRange52w RadarHTTPTimeseriesGroupBrowserFamilyParamsDateRange = "52w"
- RadarHTTPTimeseriesGroupBrowserFamilyParamsDateRange1dControl RadarHTTPTimeseriesGroupBrowserFamilyParamsDateRange = "1dControl"
- RadarHTTPTimeseriesGroupBrowserFamilyParamsDateRange2dControl RadarHTTPTimeseriesGroupBrowserFamilyParamsDateRange = "2dControl"
- RadarHTTPTimeseriesGroupBrowserFamilyParamsDateRange7dControl RadarHTTPTimeseriesGroupBrowserFamilyParamsDateRange = "7dControl"
- RadarHTTPTimeseriesGroupBrowserFamilyParamsDateRange14dControl RadarHTTPTimeseriesGroupBrowserFamilyParamsDateRange = "14dControl"
- RadarHTTPTimeseriesGroupBrowserFamilyParamsDateRange28dControl RadarHTTPTimeseriesGroupBrowserFamilyParamsDateRange = "28dControl"
- RadarHTTPTimeseriesGroupBrowserFamilyParamsDateRange12wControl RadarHTTPTimeseriesGroupBrowserFamilyParamsDateRange = "12wControl"
- RadarHTTPTimeseriesGroupBrowserFamilyParamsDateRange24wControl RadarHTTPTimeseriesGroupBrowserFamilyParamsDateRange = "24wControl"
-)
-
-type RadarHTTPTimeseriesGroupBrowserFamilyParamsDeviceType string
-
-const (
- RadarHTTPTimeseriesGroupBrowserFamilyParamsDeviceTypeDesktop RadarHTTPTimeseriesGroupBrowserFamilyParamsDeviceType = "DESKTOP"
- RadarHTTPTimeseriesGroupBrowserFamilyParamsDeviceTypeMobile RadarHTTPTimeseriesGroupBrowserFamilyParamsDeviceType = "MOBILE"
- RadarHTTPTimeseriesGroupBrowserFamilyParamsDeviceTypeOther RadarHTTPTimeseriesGroupBrowserFamilyParamsDeviceType = "OTHER"
-)
-
-// Format results are returned in.
-type RadarHTTPTimeseriesGroupBrowserFamilyParamsFormat string
-
-const (
- RadarHTTPTimeseriesGroupBrowserFamilyParamsFormatJson RadarHTTPTimeseriesGroupBrowserFamilyParamsFormat = "JSON"
- RadarHTTPTimeseriesGroupBrowserFamilyParamsFormatCsv RadarHTTPTimeseriesGroupBrowserFamilyParamsFormat = "CSV"
-)
-
-type RadarHTTPTimeseriesGroupBrowserFamilyParamsHTTPProtocol string
-
-const (
- RadarHTTPTimeseriesGroupBrowserFamilyParamsHTTPProtocolHTTP RadarHTTPTimeseriesGroupBrowserFamilyParamsHTTPProtocol = "HTTP"
- RadarHTTPTimeseriesGroupBrowserFamilyParamsHTTPProtocolHTTPS RadarHTTPTimeseriesGroupBrowserFamilyParamsHTTPProtocol = "HTTPS"
-)
-
-type RadarHTTPTimeseriesGroupBrowserFamilyParamsHTTPVersion string
-
-const (
- RadarHTTPTimeseriesGroupBrowserFamilyParamsHTTPVersionHttPv1 RadarHTTPTimeseriesGroupBrowserFamilyParamsHTTPVersion = "HTTPv1"
- RadarHTTPTimeseriesGroupBrowserFamilyParamsHTTPVersionHttPv2 RadarHTTPTimeseriesGroupBrowserFamilyParamsHTTPVersion = "HTTPv2"
- RadarHTTPTimeseriesGroupBrowserFamilyParamsHTTPVersionHttPv3 RadarHTTPTimeseriesGroupBrowserFamilyParamsHTTPVersion = "HTTPv3"
-)
-
-type RadarHTTPTimeseriesGroupBrowserFamilyParamsIPVersion string
-
-const (
- RadarHTTPTimeseriesGroupBrowserFamilyParamsIPVersionIPv4 RadarHTTPTimeseriesGroupBrowserFamilyParamsIPVersion = "IPv4"
- RadarHTTPTimeseriesGroupBrowserFamilyParamsIPVersionIPv6 RadarHTTPTimeseriesGroupBrowserFamilyParamsIPVersion = "IPv6"
-)
-
-type RadarHTTPTimeseriesGroupBrowserFamilyParamsOS string
-
-const (
- RadarHTTPTimeseriesGroupBrowserFamilyParamsOSWindows RadarHTTPTimeseriesGroupBrowserFamilyParamsOS = "WINDOWS"
- RadarHTTPTimeseriesGroupBrowserFamilyParamsOSMacosx RadarHTTPTimeseriesGroupBrowserFamilyParamsOS = "MACOSX"
- RadarHTTPTimeseriesGroupBrowserFamilyParamsOSIos RadarHTTPTimeseriesGroupBrowserFamilyParamsOS = "IOS"
- RadarHTTPTimeseriesGroupBrowserFamilyParamsOSAndroid RadarHTTPTimeseriesGroupBrowserFamilyParamsOS = "ANDROID"
- RadarHTTPTimeseriesGroupBrowserFamilyParamsOSChromeos RadarHTTPTimeseriesGroupBrowserFamilyParamsOS = "CHROMEOS"
- RadarHTTPTimeseriesGroupBrowserFamilyParamsOSLinux RadarHTTPTimeseriesGroupBrowserFamilyParamsOS = "LINUX"
- RadarHTTPTimeseriesGroupBrowserFamilyParamsOSSmartTv RadarHTTPTimeseriesGroupBrowserFamilyParamsOS = "SMART_TV"
-)
-
-type RadarHTTPTimeseriesGroupBrowserFamilyParamsTLSVersion string
-
-const (
- RadarHTTPTimeseriesGroupBrowserFamilyParamsTLSVersionTlSv1_0 RadarHTTPTimeseriesGroupBrowserFamilyParamsTLSVersion = "TLSv1_0"
- RadarHTTPTimeseriesGroupBrowserFamilyParamsTLSVersionTlSv1_1 RadarHTTPTimeseriesGroupBrowserFamilyParamsTLSVersion = "TLSv1_1"
- RadarHTTPTimeseriesGroupBrowserFamilyParamsTLSVersionTlSv1_2 RadarHTTPTimeseriesGroupBrowserFamilyParamsTLSVersion = "TLSv1_2"
- RadarHTTPTimeseriesGroupBrowserFamilyParamsTLSVersionTlSv1_3 RadarHTTPTimeseriesGroupBrowserFamilyParamsTLSVersion = "TLSv1_3"
- RadarHTTPTimeseriesGroupBrowserFamilyParamsTLSVersionTlSvQuic RadarHTTPTimeseriesGroupBrowserFamilyParamsTLSVersion = "TLSvQUIC"
-)
-
-type RadarHTTPTimeseriesGroupBrowserFamilyResponseEnvelope struct {
- Result RadarHTTPTimeseriesGroupBrowserFamilyResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarHTTPTimeseriesGroupBrowserFamilyResponseEnvelopeJSON `json:"-"`
-}
-
-// radarHTTPTimeseriesGroupBrowserFamilyResponseEnvelopeJSON contains the JSON
-// metadata for the struct [RadarHTTPTimeseriesGroupBrowserFamilyResponseEnvelope]
-type radarHTTPTimeseriesGroupBrowserFamilyResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPTimeseriesGroupBrowserFamilyResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPTimeseriesGroupBrowserFamilyResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPTimeseriesGroupDeviceTypeParams struct {
- // Aggregation interval results should be returned in (for example, in 15 minutes
- // or 1 hour intervals). Refer to
- // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
- AggInterval param.Field[RadarHTTPTimeseriesGroupDeviceTypeParamsAggInterval] `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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarHTTPTimeseriesGroupDeviceTypeParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Format results are returned in.
- Format param.Field[RadarHTTPTimeseriesGroupDeviceTypeParamsFormat] `query:"format"`
- // Filter for http protocol.
- HTTPProtocol param.Field[[]RadarHTTPTimeseriesGroupDeviceTypeParamsHTTPProtocol] `query:"httpProtocol"`
- // Filter for http version.
- HTTPVersion param.Field[[]RadarHTTPTimeseriesGroupDeviceTypeParamsHTTPVersion] `query:"httpVersion"`
- // Filter for ip version.
- IPVersion param.Field[[]RadarHTTPTimeseriesGroupDeviceTypeParamsIPVersion] `query:"ipVersion"`
- // 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 os name.
- OS param.Field[[]RadarHTTPTimeseriesGroupDeviceTypeParamsOS] `query:"os"`
- // Filter for tls version.
- TLSVersion param.Field[[]RadarHTTPTimeseriesGroupDeviceTypeParamsTLSVersion] `query:"tlsVersion"`
-}
-
-// URLQuery serializes [RadarHTTPTimeseriesGroupDeviceTypeParams]'s query
-// parameters as `url.Values`.
-func (r RadarHTTPTimeseriesGroupDeviceTypeParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Aggregation interval results should be returned in (for example, in 15 minutes
-// or 1 hour intervals). Refer to
-// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
-type RadarHTTPTimeseriesGroupDeviceTypeParamsAggInterval string
-
-const (
- RadarHTTPTimeseriesGroupDeviceTypeParamsAggInterval15m RadarHTTPTimeseriesGroupDeviceTypeParamsAggInterval = "15m"
- RadarHTTPTimeseriesGroupDeviceTypeParamsAggInterval1h RadarHTTPTimeseriesGroupDeviceTypeParamsAggInterval = "1h"
- RadarHTTPTimeseriesGroupDeviceTypeParamsAggInterval1d RadarHTTPTimeseriesGroupDeviceTypeParamsAggInterval = "1d"
- RadarHTTPTimeseriesGroupDeviceTypeParamsAggInterval1w RadarHTTPTimeseriesGroupDeviceTypeParamsAggInterval = "1w"
-)
-
-type RadarHTTPTimeseriesGroupDeviceTypeParamsBotClass string
-
-const (
- RadarHTTPTimeseriesGroupDeviceTypeParamsBotClassLikelyAutomated RadarHTTPTimeseriesGroupDeviceTypeParamsBotClass = "LIKELY_AUTOMATED"
- RadarHTTPTimeseriesGroupDeviceTypeParamsBotClassLikelyHuman RadarHTTPTimeseriesGroupDeviceTypeParamsBotClass = "LIKELY_HUMAN"
-)
-
-type RadarHTTPTimeseriesGroupDeviceTypeParamsDateRange string
-
-const (
- RadarHTTPTimeseriesGroupDeviceTypeParamsDateRange1d RadarHTTPTimeseriesGroupDeviceTypeParamsDateRange = "1d"
- RadarHTTPTimeseriesGroupDeviceTypeParamsDateRange2d RadarHTTPTimeseriesGroupDeviceTypeParamsDateRange = "2d"
- RadarHTTPTimeseriesGroupDeviceTypeParamsDateRange7d RadarHTTPTimeseriesGroupDeviceTypeParamsDateRange = "7d"
- RadarHTTPTimeseriesGroupDeviceTypeParamsDateRange14d RadarHTTPTimeseriesGroupDeviceTypeParamsDateRange = "14d"
- RadarHTTPTimeseriesGroupDeviceTypeParamsDateRange28d RadarHTTPTimeseriesGroupDeviceTypeParamsDateRange = "28d"
- RadarHTTPTimeseriesGroupDeviceTypeParamsDateRange12w RadarHTTPTimeseriesGroupDeviceTypeParamsDateRange = "12w"
- RadarHTTPTimeseriesGroupDeviceTypeParamsDateRange24w RadarHTTPTimeseriesGroupDeviceTypeParamsDateRange = "24w"
- RadarHTTPTimeseriesGroupDeviceTypeParamsDateRange52w RadarHTTPTimeseriesGroupDeviceTypeParamsDateRange = "52w"
- RadarHTTPTimeseriesGroupDeviceTypeParamsDateRange1dControl RadarHTTPTimeseriesGroupDeviceTypeParamsDateRange = "1dControl"
- RadarHTTPTimeseriesGroupDeviceTypeParamsDateRange2dControl RadarHTTPTimeseriesGroupDeviceTypeParamsDateRange = "2dControl"
- RadarHTTPTimeseriesGroupDeviceTypeParamsDateRange7dControl RadarHTTPTimeseriesGroupDeviceTypeParamsDateRange = "7dControl"
- RadarHTTPTimeseriesGroupDeviceTypeParamsDateRange14dControl RadarHTTPTimeseriesGroupDeviceTypeParamsDateRange = "14dControl"
- RadarHTTPTimeseriesGroupDeviceTypeParamsDateRange28dControl RadarHTTPTimeseriesGroupDeviceTypeParamsDateRange = "28dControl"
- RadarHTTPTimeseriesGroupDeviceTypeParamsDateRange12wControl RadarHTTPTimeseriesGroupDeviceTypeParamsDateRange = "12wControl"
- RadarHTTPTimeseriesGroupDeviceTypeParamsDateRange24wControl RadarHTTPTimeseriesGroupDeviceTypeParamsDateRange = "24wControl"
-)
-
-// Format results are returned in.
-type RadarHTTPTimeseriesGroupDeviceTypeParamsFormat string
-
-const (
- RadarHTTPTimeseriesGroupDeviceTypeParamsFormatJson RadarHTTPTimeseriesGroupDeviceTypeParamsFormat = "JSON"
- RadarHTTPTimeseriesGroupDeviceTypeParamsFormatCsv RadarHTTPTimeseriesGroupDeviceTypeParamsFormat = "CSV"
-)
-
-type RadarHTTPTimeseriesGroupDeviceTypeParamsHTTPProtocol string
-
-const (
- RadarHTTPTimeseriesGroupDeviceTypeParamsHTTPProtocolHTTP RadarHTTPTimeseriesGroupDeviceTypeParamsHTTPProtocol = "HTTP"
- RadarHTTPTimeseriesGroupDeviceTypeParamsHTTPProtocolHTTPS RadarHTTPTimeseriesGroupDeviceTypeParamsHTTPProtocol = "HTTPS"
-)
-
-type RadarHTTPTimeseriesGroupDeviceTypeParamsHTTPVersion string
-
-const (
- RadarHTTPTimeseriesGroupDeviceTypeParamsHTTPVersionHttPv1 RadarHTTPTimeseriesGroupDeviceTypeParamsHTTPVersion = "HTTPv1"
- RadarHTTPTimeseriesGroupDeviceTypeParamsHTTPVersionHttPv2 RadarHTTPTimeseriesGroupDeviceTypeParamsHTTPVersion = "HTTPv2"
- RadarHTTPTimeseriesGroupDeviceTypeParamsHTTPVersionHttPv3 RadarHTTPTimeseriesGroupDeviceTypeParamsHTTPVersion = "HTTPv3"
-)
-
-type RadarHTTPTimeseriesGroupDeviceTypeParamsIPVersion string
-
-const (
- RadarHTTPTimeseriesGroupDeviceTypeParamsIPVersionIPv4 RadarHTTPTimeseriesGroupDeviceTypeParamsIPVersion = "IPv4"
- RadarHTTPTimeseriesGroupDeviceTypeParamsIPVersionIPv6 RadarHTTPTimeseriesGroupDeviceTypeParamsIPVersion = "IPv6"
-)
-
-type RadarHTTPTimeseriesGroupDeviceTypeParamsOS string
-
-const (
- RadarHTTPTimeseriesGroupDeviceTypeParamsOSWindows RadarHTTPTimeseriesGroupDeviceTypeParamsOS = "WINDOWS"
- RadarHTTPTimeseriesGroupDeviceTypeParamsOSMacosx RadarHTTPTimeseriesGroupDeviceTypeParamsOS = "MACOSX"
- RadarHTTPTimeseriesGroupDeviceTypeParamsOSIos RadarHTTPTimeseriesGroupDeviceTypeParamsOS = "IOS"
- RadarHTTPTimeseriesGroupDeviceTypeParamsOSAndroid RadarHTTPTimeseriesGroupDeviceTypeParamsOS = "ANDROID"
- RadarHTTPTimeseriesGroupDeviceTypeParamsOSChromeos RadarHTTPTimeseriesGroupDeviceTypeParamsOS = "CHROMEOS"
- RadarHTTPTimeseriesGroupDeviceTypeParamsOSLinux RadarHTTPTimeseriesGroupDeviceTypeParamsOS = "LINUX"
- RadarHTTPTimeseriesGroupDeviceTypeParamsOSSmartTv RadarHTTPTimeseriesGroupDeviceTypeParamsOS = "SMART_TV"
-)
-
-type RadarHTTPTimeseriesGroupDeviceTypeParamsTLSVersion string
-
-const (
- RadarHTTPTimeseriesGroupDeviceTypeParamsTLSVersionTlSv1_0 RadarHTTPTimeseriesGroupDeviceTypeParamsTLSVersion = "TLSv1_0"
- RadarHTTPTimeseriesGroupDeviceTypeParamsTLSVersionTlSv1_1 RadarHTTPTimeseriesGroupDeviceTypeParamsTLSVersion = "TLSv1_1"
- RadarHTTPTimeseriesGroupDeviceTypeParamsTLSVersionTlSv1_2 RadarHTTPTimeseriesGroupDeviceTypeParamsTLSVersion = "TLSv1_2"
- RadarHTTPTimeseriesGroupDeviceTypeParamsTLSVersionTlSv1_3 RadarHTTPTimeseriesGroupDeviceTypeParamsTLSVersion = "TLSv1_3"
- RadarHTTPTimeseriesGroupDeviceTypeParamsTLSVersionTlSvQuic RadarHTTPTimeseriesGroupDeviceTypeParamsTLSVersion = "TLSvQUIC"
-)
-
-type RadarHTTPTimeseriesGroupDeviceTypeResponseEnvelope struct {
- Result RadarHTTPTimeseriesGroupDeviceTypeResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarHTTPTimeseriesGroupDeviceTypeResponseEnvelopeJSON `json:"-"`
-}
-
-// radarHTTPTimeseriesGroupDeviceTypeResponseEnvelopeJSON contains the JSON
-// metadata for the struct [RadarHTTPTimeseriesGroupDeviceTypeResponseEnvelope]
-type radarHTTPTimeseriesGroupDeviceTypeResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPTimeseriesGroupDeviceTypeResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPTimeseriesGroupDeviceTypeResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPTimeseriesGroupHTTPProtocolParams struct {
- // Aggregation interval results should be returned in (for example, in 15 minutes
- // or 1 hour intervals). Refer to
- // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
- AggInterval param.Field[RadarHTTPTimeseriesGroupHTTPProtocolParamsAggInterval] `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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarHTTPTimeseriesGroupHTTPProtocolParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Filter for device type.
- DeviceType param.Field[[]RadarHTTPTimeseriesGroupHTTPProtocolParamsDeviceType] `query:"deviceType"`
- // Format results are returned in.
- Format param.Field[RadarHTTPTimeseriesGroupHTTPProtocolParamsFormat] `query:"format"`
- // Filter for http version.
- HTTPVersion param.Field[[]RadarHTTPTimeseriesGroupHTTPProtocolParamsHTTPVersion] `query:"httpVersion"`
- // Filter for ip version.
- IPVersion param.Field[[]RadarHTTPTimeseriesGroupHTTPProtocolParamsIPVersion] `query:"ipVersion"`
- // 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 os name.
- OS param.Field[[]RadarHTTPTimeseriesGroupHTTPProtocolParamsOS] `query:"os"`
- // Filter for tls version.
- TLSVersion param.Field[[]RadarHTTPTimeseriesGroupHTTPProtocolParamsTLSVersion] `query:"tlsVersion"`
-}
-
-// URLQuery serializes [RadarHTTPTimeseriesGroupHTTPProtocolParams]'s query
-// parameters as `url.Values`.
-func (r RadarHTTPTimeseriesGroupHTTPProtocolParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Aggregation interval results should be returned in (for example, in 15 minutes
-// or 1 hour intervals). Refer to
-// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
-type RadarHTTPTimeseriesGroupHTTPProtocolParamsAggInterval string
-
-const (
- RadarHTTPTimeseriesGroupHTTPProtocolParamsAggInterval15m RadarHTTPTimeseriesGroupHTTPProtocolParamsAggInterval = "15m"
- RadarHTTPTimeseriesGroupHTTPProtocolParamsAggInterval1h RadarHTTPTimeseriesGroupHTTPProtocolParamsAggInterval = "1h"
- RadarHTTPTimeseriesGroupHTTPProtocolParamsAggInterval1d RadarHTTPTimeseriesGroupHTTPProtocolParamsAggInterval = "1d"
- RadarHTTPTimeseriesGroupHTTPProtocolParamsAggInterval1w RadarHTTPTimeseriesGroupHTTPProtocolParamsAggInterval = "1w"
-)
-
-type RadarHTTPTimeseriesGroupHTTPProtocolParamsBotClass string
-
-const (
- RadarHTTPTimeseriesGroupHTTPProtocolParamsBotClassLikelyAutomated RadarHTTPTimeseriesGroupHTTPProtocolParamsBotClass = "LIKELY_AUTOMATED"
- RadarHTTPTimeseriesGroupHTTPProtocolParamsBotClassLikelyHuman RadarHTTPTimeseriesGroupHTTPProtocolParamsBotClass = "LIKELY_HUMAN"
-)
-
-type RadarHTTPTimeseriesGroupHTTPProtocolParamsDateRange string
-
-const (
- RadarHTTPTimeseriesGroupHTTPProtocolParamsDateRange1d RadarHTTPTimeseriesGroupHTTPProtocolParamsDateRange = "1d"
- RadarHTTPTimeseriesGroupHTTPProtocolParamsDateRange2d RadarHTTPTimeseriesGroupHTTPProtocolParamsDateRange = "2d"
- RadarHTTPTimeseriesGroupHTTPProtocolParamsDateRange7d RadarHTTPTimeseriesGroupHTTPProtocolParamsDateRange = "7d"
- RadarHTTPTimeseriesGroupHTTPProtocolParamsDateRange14d RadarHTTPTimeseriesGroupHTTPProtocolParamsDateRange = "14d"
- RadarHTTPTimeseriesGroupHTTPProtocolParamsDateRange28d RadarHTTPTimeseriesGroupHTTPProtocolParamsDateRange = "28d"
- RadarHTTPTimeseriesGroupHTTPProtocolParamsDateRange12w RadarHTTPTimeseriesGroupHTTPProtocolParamsDateRange = "12w"
- RadarHTTPTimeseriesGroupHTTPProtocolParamsDateRange24w RadarHTTPTimeseriesGroupHTTPProtocolParamsDateRange = "24w"
- RadarHTTPTimeseriesGroupHTTPProtocolParamsDateRange52w RadarHTTPTimeseriesGroupHTTPProtocolParamsDateRange = "52w"
- RadarHTTPTimeseriesGroupHTTPProtocolParamsDateRange1dControl RadarHTTPTimeseriesGroupHTTPProtocolParamsDateRange = "1dControl"
- RadarHTTPTimeseriesGroupHTTPProtocolParamsDateRange2dControl RadarHTTPTimeseriesGroupHTTPProtocolParamsDateRange = "2dControl"
- RadarHTTPTimeseriesGroupHTTPProtocolParamsDateRange7dControl RadarHTTPTimeseriesGroupHTTPProtocolParamsDateRange = "7dControl"
- RadarHTTPTimeseriesGroupHTTPProtocolParamsDateRange14dControl RadarHTTPTimeseriesGroupHTTPProtocolParamsDateRange = "14dControl"
- RadarHTTPTimeseriesGroupHTTPProtocolParamsDateRange28dControl RadarHTTPTimeseriesGroupHTTPProtocolParamsDateRange = "28dControl"
- RadarHTTPTimeseriesGroupHTTPProtocolParamsDateRange12wControl RadarHTTPTimeseriesGroupHTTPProtocolParamsDateRange = "12wControl"
- RadarHTTPTimeseriesGroupHTTPProtocolParamsDateRange24wControl RadarHTTPTimeseriesGroupHTTPProtocolParamsDateRange = "24wControl"
-)
-
-type RadarHTTPTimeseriesGroupHTTPProtocolParamsDeviceType string
-
-const (
- RadarHTTPTimeseriesGroupHTTPProtocolParamsDeviceTypeDesktop RadarHTTPTimeseriesGroupHTTPProtocolParamsDeviceType = "DESKTOP"
- RadarHTTPTimeseriesGroupHTTPProtocolParamsDeviceTypeMobile RadarHTTPTimeseriesGroupHTTPProtocolParamsDeviceType = "MOBILE"
- RadarHTTPTimeseriesGroupHTTPProtocolParamsDeviceTypeOther RadarHTTPTimeseriesGroupHTTPProtocolParamsDeviceType = "OTHER"
-)
-
-// Format results are returned in.
-type RadarHTTPTimeseriesGroupHTTPProtocolParamsFormat string
-
-const (
- RadarHTTPTimeseriesGroupHTTPProtocolParamsFormatJson RadarHTTPTimeseriesGroupHTTPProtocolParamsFormat = "JSON"
- RadarHTTPTimeseriesGroupHTTPProtocolParamsFormatCsv RadarHTTPTimeseriesGroupHTTPProtocolParamsFormat = "CSV"
-)
-
-type RadarHTTPTimeseriesGroupHTTPProtocolParamsHTTPVersion string
-
-const (
- RadarHTTPTimeseriesGroupHTTPProtocolParamsHTTPVersionHttPv1 RadarHTTPTimeseriesGroupHTTPProtocolParamsHTTPVersion = "HTTPv1"
- RadarHTTPTimeseriesGroupHTTPProtocolParamsHTTPVersionHttPv2 RadarHTTPTimeseriesGroupHTTPProtocolParamsHTTPVersion = "HTTPv2"
- RadarHTTPTimeseriesGroupHTTPProtocolParamsHTTPVersionHttPv3 RadarHTTPTimeseriesGroupHTTPProtocolParamsHTTPVersion = "HTTPv3"
-)
-
-type RadarHTTPTimeseriesGroupHTTPProtocolParamsIPVersion string
-
-const (
- RadarHTTPTimeseriesGroupHTTPProtocolParamsIPVersionIPv4 RadarHTTPTimeseriesGroupHTTPProtocolParamsIPVersion = "IPv4"
- RadarHTTPTimeseriesGroupHTTPProtocolParamsIPVersionIPv6 RadarHTTPTimeseriesGroupHTTPProtocolParamsIPVersion = "IPv6"
-)
-
-type RadarHTTPTimeseriesGroupHTTPProtocolParamsOS string
-
-const (
- RadarHTTPTimeseriesGroupHTTPProtocolParamsOSWindows RadarHTTPTimeseriesGroupHTTPProtocolParamsOS = "WINDOWS"
- RadarHTTPTimeseriesGroupHTTPProtocolParamsOSMacosx RadarHTTPTimeseriesGroupHTTPProtocolParamsOS = "MACOSX"
- RadarHTTPTimeseriesGroupHTTPProtocolParamsOSIos RadarHTTPTimeseriesGroupHTTPProtocolParamsOS = "IOS"
- RadarHTTPTimeseriesGroupHTTPProtocolParamsOSAndroid RadarHTTPTimeseriesGroupHTTPProtocolParamsOS = "ANDROID"
- RadarHTTPTimeseriesGroupHTTPProtocolParamsOSChromeos RadarHTTPTimeseriesGroupHTTPProtocolParamsOS = "CHROMEOS"
- RadarHTTPTimeseriesGroupHTTPProtocolParamsOSLinux RadarHTTPTimeseriesGroupHTTPProtocolParamsOS = "LINUX"
- RadarHTTPTimeseriesGroupHTTPProtocolParamsOSSmartTv RadarHTTPTimeseriesGroupHTTPProtocolParamsOS = "SMART_TV"
-)
-
-type RadarHTTPTimeseriesGroupHTTPProtocolParamsTLSVersion string
-
-const (
- RadarHTTPTimeseriesGroupHTTPProtocolParamsTLSVersionTlSv1_0 RadarHTTPTimeseriesGroupHTTPProtocolParamsTLSVersion = "TLSv1_0"
- RadarHTTPTimeseriesGroupHTTPProtocolParamsTLSVersionTlSv1_1 RadarHTTPTimeseriesGroupHTTPProtocolParamsTLSVersion = "TLSv1_1"
- RadarHTTPTimeseriesGroupHTTPProtocolParamsTLSVersionTlSv1_2 RadarHTTPTimeseriesGroupHTTPProtocolParamsTLSVersion = "TLSv1_2"
- RadarHTTPTimeseriesGroupHTTPProtocolParamsTLSVersionTlSv1_3 RadarHTTPTimeseriesGroupHTTPProtocolParamsTLSVersion = "TLSv1_3"
- RadarHTTPTimeseriesGroupHTTPProtocolParamsTLSVersionTlSvQuic RadarHTTPTimeseriesGroupHTTPProtocolParamsTLSVersion = "TLSvQUIC"
-)
-
-type RadarHTTPTimeseriesGroupHTTPProtocolResponseEnvelope struct {
- Result RadarHTTPTimeseriesGroupHTTPProtocolResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarHTTPTimeseriesGroupHTTPProtocolResponseEnvelopeJSON `json:"-"`
-}
-
-// radarHTTPTimeseriesGroupHTTPProtocolResponseEnvelopeJSON contains the JSON
-// metadata for the struct [RadarHTTPTimeseriesGroupHTTPProtocolResponseEnvelope]
-type radarHTTPTimeseriesGroupHTTPProtocolResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPTimeseriesGroupHTTPProtocolResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPTimeseriesGroupHTTPProtocolResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPTimeseriesGroupHTTPVersionParams struct {
- // Aggregation interval results should be returned in (for example, in 15 minutes
- // or 1 hour intervals). Refer to
- // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
- AggInterval param.Field[RadarHTTPTimeseriesGroupHTTPVersionParamsAggInterval] `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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarHTTPTimeseriesGroupHTTPVersionParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Filter for device type.
- DeviceType param.Field[[]RadarHTTPTimeseriesGroupHTTPVersionParamsDeviceType] `query:"deviceType"`
- // Format results are returned in.
- Format param.Field[RadarHTTPTimeseriesGroupHTTPVersionParamsFormat] `query:"format"`
- // Filter for http protocol.
- HTTPProtocol param.Field[[]RadarHTTPTimeseriesGroupHTTPVersionParamsHTTPProtocol] `query:"httpProtocol"`
- // Filter for ip version.
- IPVersion param.Field[[]RadarHTTPTimeseriesGroupHTTPVersionParamsIPVersion] `query:"ipVersion"`
- // 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 os name.
- OS param.Field[[]RadarHTTPTimeseriesGroupHTTPVersionParamsOS] `query:"os"`
- // Filter for tls version.
- TLSVersion param.Field[[]RadarHTTPTimeseriesGroupHTTPVersionParamsTLSVersion] `query:"tlsVersion"`
-}
-
-// URLQuery serializes [RadarHTTPTimeseriesGroupHTTPVersionParams]'s query
-// parameters as `url.Values`.
-func (r RadarHTTPTimeseriesGroupHTTPVersionParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Aggregation interval results should be returned in (for example, in 15 minutes
-// or 1 hour intervals). Refer to
-// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
-type RadarHTTPTimeseriesGroupHTTPVersionParamsAggInterval string
-
-const (
- RadarHTTPTimeseriesGroupHTTPVersionParamsAggInterval15m RadarHTTPTimeseriesGroupHTTPVersionParamsAggInterval = "15m"
- RadarHTTPTimeseriesGroupHTTPVersionParamsAggInterval1h RadarHTTPTimeseriesGroupHTTPVersionParamsAggInterval = "1h"
- RadarHTTPTimeseriesGroupHTTPVersionParamsAggInterval1d RadarHTTPTimeseriesGroupHTTPVersionParamsAggInterval = "1d"
- RadarHTTPTimeseriesGroupHTTPVersionParamsAggInterval1w RadarHTTPTimeseriesGroupHTTPVersionParamsAggInterval = "1w"
-)
-
-type RadarHTTPTimeseriesGroupHTTPVersionParamsBotClass string
-
-const (
- RadarHTTPTimeseriesGroupHTTPVersionParamsBotClassLikelyAutomated RadarHTTPTimeseriesGroupHTTPVersionParamsBotClass = "LIKELY_AUTOMATED"
- RadarHTTPTimeseriesGroupHTTPVersionParamsBotClassLikelyHuman RadarHTTPTimeseriesGroupHTTPVersionParamsBotClass = "LIKELY_HUMAN"
-)
-
-type RadarHTTPTimeseriesGroupHTTPVersionParamsDateRange string
-
-const (
- RadarHTTPTimeseriesGroupHTTPVersionParamsDateRange1d RadarHTTPTimeseriesGroupHTTPVersionParamsDateRange = "1d"
- RadarHTTPTimeseriesGroupHTTPVersionParamsDateRange2d RadarHTTPTimeseriesGroupHTTPVersionParamsDateRange = "2d"
- RadarHTTPTimeseriesGroupHTTPVersionParamsDateRange7d RadarHTTPTimeseriesGroupHTTPVersionParamsDateRange = "7d"
- RadarHTTPTimeseriesGroupHTTPVersionParamsDateRange14d RadarHTTPTimeseriesGroupHTTPVersionParamsDateRange = "14d"
- RadarHTTPTimeseriesGroupHTTPVersionParamsDateRange28d RadarHTTPTimeseriesGroupHTTPVersionParamsDateRange = "28d"
- RadarHTTPTimeseriesGroupHTTPVersionParamsDateRange12w RadarHTTPTimeseriesGroupHTTPVersionParamsDateRange = "12w"
- RadarHTTPTimeseriesGroupHTTPVersionParamsDateRange24w RadarHTTPTimeseriesGroupHTTPVersionParamsDateRange = "24w"
- RadarHTTPTimeseriesGroupHTTPVersionParamsDateRange52w RadarHTTPTimeseriesGroupHTTPVersionParamsDateRange = "52w"
- RadarHTTPTimeseriesGroupHTTPVersionParamsDateRange1dControl RadarHTTPTimeseriesGroupHTTPVersionParamsDateRange = "1dControl"
- RadarHTTPTimeseriesGroupHTTPVersionParamsDateRange2dControl RadarHTTPTimeseriesGroupHTTPVersionParamsDateRange = "2dControl"
- RadarHTTPTimeseriesGroupHTTPVersionParamsDateRange7dControl RadarHTTPTimeseriesGroupHTTPVersionParamsDateRange = "7dControl"
- RadarHTTPTimeseriesGroupHTTPVersionParamsDateRange14dControl RadarHTTPTimeseriesGroupHTTPVersionParamsDateRange = "14dControl"
- RadarHTTPTimeseriesGroupHTTPVersionParamsDateRange28dControl RadarHTTPTimeseriesGroupHTTPVersionParamsDateRange = "28dControl"
- RadarHTTPTimeseriesGroupHTTPVersionParamsDateRange12wControl RadarHTTPTimeseriesGroupHTTPVersionParamsDateRange = "12wControl"
- RadarHTTPTimeseriesGroupHTTPVersionParamsDateRange24wControl RadarHTTPTimeseriesGroupHTTPVersionParamsDateRange = "24wControl"
-)
-
-type RadarHTTPTimeseriesGroupHTTPVersionParamsDeviceType string
-
-const (
- RadarHTTPTimeseriesGroupHTTPVersionParamsDeviceTypeDesktop RadarHTTPTimeseriesGroupHTTPVersionParamsDeviceType = "DESKTOP"
- RadarHTTPTimeseriesGroupHTTPVersionParamsDeviceTypeMobile RadarHTTPTimeseriesGroupHTTPVersionParamsDeviceType = "MOBILE"
- RadarHTTPTimeseriesGroupHTTPVersionParamsDeviceTypeOther RadarHTTPTimeseriesGroupHTTPVersionParamsDeviceType = "OTHER"
-)
-
-// Format results are returned in.
-type RadarHTTPTimeseriesGroupHTTPVersionParamsFormat string
-
-const (
- RadarHTTPTimeseriesGroupHTTPVersionParamsFormatJson RadarHTTPTimeseriesGroupHTTPVersionParamsFormat = "JSON"
- RadarHTTPTimeseriesGroupHTTPVersionParamsFormatCsv RadarHTTPTimeseriesGroupHTTPVersionParamsFormat = "CSV"
-)
-
-type RadarHTTPTimeseriesGroupHTTPVersionParamsHTTPProtocol string
-
-const (
- RadarHTTPTimeseriesGroupHTTPVersionParamsHTTPProtocolHTTP RadarHTTPTimeseriesGroupHTTPVersionParamsHTTPProtocol = "HTTP"
- RadarHTTPTimeseriesGroupHTTPVersionParamsHTTPProtocolHTTPS RadarHTTPTimeseriesGroupHTTPVersionParamsHTTPProtocol = "HTTPS"
-)
-
-type RadarHTTPTimeseriesGroupHTTPVersionParamsIPVersion string
-
-const (
- RadarHTTPTimeseriesGroupHTTPVersionParamsIPVersionIPv4 RadarHTTPTimeseriesGroupHTTPVersionParamsIPVersion = "IPv4"
- RadarHTTPTimeseriesGroupHTTPVersionParamsIPVersionIPv6 RadarHTTPTimeseriesGroupHTTPVersionParamsIPVersion = "IPv6"
-)
-
-type RadarHTTPTimeseriesGroupHTTPVersionParamsOS string
-
-const (
- RadarHTTPTimeseriesGroupHTTPVersionParamsOSWindows RadarHTTPTimeseriesGroupHTTPVersionParamsOS = "WINDOWS"
- RadarHTTPTimeseriesGroupHTTPVersionParamsOSMacosx RadarHTTPTimeseriesGroupHTTPVersionParamsOS = "MACOSX"
- RadarHTTPTimeseriesGroupHTTPVersionParamsOSIos RadarHTTPTimeseriesGroupHTTPVersionParamsOS = "IOS"
- RadarHTTPTimeseriesGroupHTTPVersionParamsOSAndroid RadarHTTPTimeseriesGroupHTTPVersionParamsOS = "ANDROID"
- RadarHTTPTimeseriesGroupHTTPVersionParamsOSChromeos RadarHTTPTimeseriesGroupHTTPVersionParamsOS = "CHROMEOS"
- RadarHTTPTimeseriesGroupHTTPVersionParamsOSLinux RadarHTTPTimeseriesGroupHTTPVersionParamsOS = "LINUX"
- RadarHTTPTimeseriesGroupHTTPVersionParamsOSSmartTv RadarHTTPTimeseriesGroupHTTPVersionParamsOS = "SMART_TV"
-)
-
-type RadarHTTPTimeseriesGroupHTTPVersionParamsTLSVersion string
-
-const (
- RadarHTTPTimeseriesGroupHTTPVersionParamsTLSVersionTlSv1_0 RadarHTTPTimeseriesGroupHTTPVersionParamsTLSVersion = "TLSv1_0"
- RadarHTTPTimeseriesGroupHTTPVersionParamsTLSVersionTlSv1_1 RadarHTTPTimeseriesGroupHTTPVersionParamsTLSVersion = "TLSv1_1"
- RadarHTTPTimeseriesGroupHTTPVersionParamsTLSVersionTlSv1_2 RadarHTTPTimeseriesGroupHTTPVersionParamsTLSVersion = "TLSv1_2"
- RadarHTTPTimeseriesGroupHTTPVersionParamsTLSVersionTlSv1_3 RadarHTTPTimeseriesGroupHTTPVersionParamsTLSVersion = "TLSv1_3"
- RadarHTTPTimeseriesGroupHTTPVersionParamsTLSVersionTlSvQuic RadarHTTPTimeseriesGroupHTTPVersionParamsTLSVersion = "TLSvQUIC"
-)
-
-type RadarHTTPTimeseriesGroupHTTPVersionResponseEnvelope struct {
- Result RadarHTTPTimeseriesGroupHTTPVersionResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarHTTPTimeseriesGroupHTTPVersionResponseEnvelopeJSON `json:"-"`
-}
-
-// radarHTTPTimeseriesGroupHTTPVersionResponseEnvelopeJSON contains the JSON
-// metadata for the struct [RadarHTTPTimeseriesGroupHTTPVersionResponseEnvelope]
-type radarHTTPTimeseriesGroupHTTPVersionResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPTimeseriesGroupHTTPVersionResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPTimeseriesGroupHTTPVersionResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPTimeseriesGroupIPVersionParams struct {
- // Aggregation interval results should be returned in (for example, in 15 minutes
- // or 1 hour intervals). Refer to
- // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
- AggInterval param.Field[RadarHTTPTimeseriesGroupIPVersionParamsAggInterval] `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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarHTTPTimeseriesGroupIPVersionParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Filter for device type.
- DeviceType param.Field[[]RadarHTTPTimeseriesGroupIPVersionParamsDeviceType] `query:"deviceType"`
- // Format results are returned in.
- Format param.Field[RadarHTTPTimeseriesGroupIPVersionParamsFormat] `query:"format"`
- // Filter for http protocol.
- HTTPProtocol param.Field[[]RadarHTTPTimeseriesGroupIPVersionParamsHTTPProtocol] `query:"httpProtocol"`
- // Filter for http version.
- HTTPVersion param.Field[[]RadarHTTPTimeseriesGroupIPVersionParamsHTTPVersion] `query:"httpVersion"`
- // 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 os name.
- OS param.Field[[]RadarHTTPTimeseriesGroupIPVersionParamsOS] `query:"os"`
- // Filter for tls version.
- TLSVersion param.Field[[]RadarHTTPTimeseriesGroupIPVersionParamsTLSVersion] `query:"tlsVersion"`
-}
-
-// URLQuery serializes [RadarHTTPTimeseriesGroupIPVersionParams]'s query parameters
-// as `url.Values`.
-func (r RadarHTTPTimeseriesGroupIPVersionParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Aggregation interval results should be returned in (for example, in 15 minutes
-// or 1 hour intervals). Refer to
-// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
-type RadarHTTPTimeseriesGroupIPVersionParamsAggInterval string
-
-const (
- RadarHTTPTimeseriesGroupIPVersionParamsAggInterval15m RadarHTTPTimeseriesGroupIPVersionParamsAggInterval = "15m"
- RadarHTTPTimeseriesGroupIPVersionParamsAggInterval1h RadarHTTPTimeseriesGroupIPVersionParamsAggInterval = "1h"
- RadarHTTPTimeseriesGroupIPVersionParamsAggInterval1d RadarHTTPTimeseriesGroupIPVersionParamsAggInterval = "1d"
- RadarHTTPTimeseriesGroupIPVersionParamsAggInterval1w RadarHTTPTimeseriesGroupIPVersionParamsAggInterval = "1w"
-)
-
-type RadarHTTPTimeseriesGroupIPVersionParamsBotClass string
-
-const (
- RadarHTTPTimeseriesGroupIPVersionParamsBotClassLikelyAutomated RadarHTTPTimeseriesGroupIPVersionParamsBotClass = "LIKELY_AUTOMATED"
- RadarHTTPTimeseriesGroupIPVersionParamsBotClassLikelyHuman RadarHTTPTimeseriesGroupIPVersionParamsBotClass = "LIKELY_HUMAN"
-)
-
-type RadarHTTPTimeseriesGroupIPVersionParamsDateRange string
-
-const (
- RadarHTTPTimeseriesGroupIPVersionParamsDateRange1d RadarHTTPTimeseriesGroupIPVersionParamsDateRange = "1d"
- RadarHTTPTimeseriesGroupIPVersionParamsDateRange2d RadarHTTPTimeseriesGroupIPVersionParamsDateRange = "2d"
- RadarHTTPTimeseriesGroupIPVersionParamsDateRange7d RadarHTTPTimeseriesGroupIPVersionParamsDateRange = "7d"
- RadarHTTPTimeseriesGroupIPVersionParamsDateRange14d RadarHTTPTimeseriesGroupIPVersionParamsDateRange = "14d"
- RadarHTTPTimeseriesGroupIPVersionParamsDateRange28d RadarHTTPTimeseriesGroupIPVersionParamsDateRange = "28d"
- RadarHTTPTimeseriesGroupIPVersionParamsDateRange12w RadarHTTPTimeseriesGroupIPVersionParamsDateRange = "12w"
- RadarHTTPTimeseriesGroupIPVersionParamsDateRange24w RadarHTTPTimeseriesGroupIPVersionParamsDateRange = "24w"
- RadarHTTPTimeseriesGroupIPVersionParamsDateRange52w RadarHTTPTimeseriesGroupIPVersionParamsDateRange = "52w"
- RadarHTTPTimeseriesGroupIPVersionParamsDateRange1dControl RadarHTTPTimeseriesGroupIPVersionParamsDateRange = "1dControl"
- RadarHTTPTimeseriesGroupIPVersionParamsDateRange2dControl RadarHTTPTimeseriesGroupIPVersionParamsDateRange = "2dControl"
- RadarHTTPTimeseriesGroupIPVersionParamsDateRange7dControl RadarHTTPTimeseriesGroupIPVersionParamsDateRange = "7dControl"
- RadarHTTPTimeseriesGroupIPVersionParamsDateRange14dControl RadarHTTPTimeseriesGroupIPVersionParamsDateRange = "14dControl"
- RadarHTTPTimeseriesGroupIPVersionParamsDateRange28dControl RadarHTTPTimeseriesGroupIPVersionParamsDateRange = "28dControl"
- RadarHTTPTimeseriesGroupIPVersionParamsDateRange12wControl RadarHTTPTimeseriesGroupIPVersionParamsDateRange = "12wControl"
- RadarHTTPTimeseriesGroupIPVersionParamsDateRange24wControl RadarHTTPTimeseriesGroupIPVersionParamsDateRange = "24wControl"
-)
-
-type RadarHTTPTimeseriesGroupIPVersionParamsDeviceType string
-
-const (
- RadarHTTPTimeseriesGroupIPVersionParamsDeviceTypeDesktop RadarHTTPTimeseriesGroupIPVersionParamsDeviceType = "DESKTOP"
- RadarHTTPTimeseriesGroupIPVersionParamsDeviceTypeMobile RadarHTTPTimeseriesGroupIPVersionParamsDeviceType = "MOBILE"
- RadarHTTPTimeseriesGroupIPVersionParamsDeviceTypeOther RadarHTTPTimeseriesGroupIPVersionParamsDeviceType = "OTHER"
-)
-
-// Format results are returned in.
-type RadarHTTPTimeseriesGroupIPVersionParamsFormat string
-
-const (
- RadarHTTPTimeseriesGroupIPVersionParamsFormatJson RadarHTTPTimeseriesGroupIPVersionParamsFormat = "JSON"
- RadarHTTPTimeseriesGroupIPVersionParamsFormatCsv RadarHTTPTimeseriesGroupIPVersionParamsFormat = "CSV"
-)
-
-type RadarHTTPTimeseriesGroupIPVersionParamsHTTPProtocol string
-
-const (
- RadarHTTPTimeseriesGroupIPVersionParamsHTTPProtocolHTTP RadarHTTPTimeseriesGroupIPVersionParamsHTTPProtocol = "HTTP"
- RadarHTTPTimeseriesGroupIPVersionParamsHTTPProtocolHTTPS RadarHTTPTimeseriesGroupIPVersionParamsHTTPProtocol = "HTTPS"
-)
-
-type RadarHTTPTimeseriesGroupIPVersionParamsHTTPVersion string
-
-const (
- RadarHTTPTimeseriesGroupIPVersionParamsHTTPVersionHttPv1 RadarHTTPTimeseriesGroupIPVersionParamsHTTPVersion = "HTTPv1"
- RadarHTTPTimeseriesGroupIPVersionParamsHTTPVersionHttPv2 RadarHTTPTimeseriesGroupIPVersionParamsHTTPVersion = "HTTPv2"
- RadarHTTPTimeseriesGroupIPVersionParamsHTTPVersionHttPv3 RadarHTTPTimeseriesGroupIPVersionParamsHTTPVersion = "HTTPv3"
-)
-
-type RadarHTTPTimeseriesGroupIPVersionParamsOS string
-
-const (
- RadarHTTPTimeseriesGroupIPVersionParamsOSWindows RadarHTTPTimeseriesGroupIPVersionParamsOS = "WINDOWS"
- RadarHTTPTimeseriesGroupIPVersionParamsOSMacosx RadarHTTPTimeseriesGroupIPVersionParamsOS = "MACOSX"
- RadarHTTPTimeseriesGroupIPVersionParamsOSIos RadarHTTPTimeseriesGroupIPVersionParamsOS = "IOS"
- RadarHTTPTimeseriesGroupIPVersionParamsOSAndroid RadarHTTPTimeseriesGroupIPVersionParamsOS = "ANDROID"
- RadarHTTPTimeseriesGroupIPVersionParamsOSChromeos RadarHTTPTimeseriesGroupIPVersionParamsOS = "CHROMEOS"
- RadarHTTPTimeseriesGroupIPVersionParamsOSLinux RadarHTTPTimeseriesGroupIPVersionParamsOS = "LINUX"
- RadarHTTPTimeseriesGroupIPVersionParamsOSSmartTv RadarHTTPTimeseriesGroupIPVersionParamsOS = "SMART_TV"
-)
-
-type RadarHTTPTimeseriesGroupIPVersionParamsTLSVersion string
-
-const (
- RadarHTTPTimeseriesGroupIPVersionParamsTLSVersionTlSv1_0 RadarHTTPTimeseriesGroupIPVersionParamsTLSVersion = "TLSv1_0"
- RadarHTTPTimeseriesGroupIPVersionParamsTLSVersionTlSv1_1 RadarHTTPTimeseriesGroupIPVersionParamsTLSVersion = "TLSv1_1"
- RadarHTTPTimeseriesGroupIPVersionParamsTLSVersionTlSv1_2 RadarHTTPTimeseriesGroupIPVersionParamsTLSVersion = "TLSv1_2"
- RadarHTTPTimeseriesGroupIPVersionParamsTLSVersionTlSv1_3 RadarHTTPTimeseriesGroupIPVersionParamsTLSVersion = "TLSv1_3"
- RadarHTTPTimeseriesGroupIPVersionParamsTLSVersionTlSvQuic RadarHTTPTimeseriesGroupIPVersionParamsTLSVersion = "TLSvQUIC"
-)
-
-type RadarHTTPTimeseriesGroupIPVersionResponseEnvelope struct {
- Result RadarHTTPTimeseriesGroupIPVersionResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarHTTPTimeseriesGroupIPVersionResponseEnvelopeJSON `json:"-"`
-}
-
-// radarHTTPTimeseriesGroupIPVersionResponseEnvelopeJSON contains the JSON metadata
-// for the struct [RadarHTTPTimeseriesGroupIPVersionResponseEnvelope]
-type radarHTTPTimeseriesGroupIPVersionResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPTimeseriesGroupIPVersionResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPTimeseriesGroupIPVersionResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPTimeseriesGroupOSParams struct {
- // Aggregation interval results should be returned in (for example, in 15 minutes
- // or 1 hour intervals). Refer to
- // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
- AggInterval param.Field[RadarHTTPTimeseriesGroupOSParamsAggInterval] `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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarHTTPTimeseriesGroupOSParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Filter for device type.
- DeviceType param.Field[[]RadarHTTPTimeseriesGroupOSParamsDeviceType] `query:"deviceType"`
- // Format results are returned in.
- Format param.Field[RadarHTTPTimeseriesGroupOSParamsFormat] `query:"format"`
- // Filter for http protocol.
- HTTPProtocol param.Field[[]RadarHTTPTimeseriesGroupOSParamsHTTPProtocol] `query:"httpProtocol"`
- // Filter for http version.
- HTTPVersion param.Field[[]RadarHTTPTimeseriesGroupOSParamsHTTPVersion] `query:"httpVersion"`
- // Filter for ip version.
- IPVersion param.Field[[]RadarHTTPTimeseriesGroupOSParamsIPVersion] `query:"ipVersion"`
- // 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[[]RadarHTTPTimeseriesGroupOSParamsTLSVersion] `query:"tlsVersion"`
-}
-
-// URLQuery serializes [RadarHTTPTimeseriesGroupOSParams]'s query parameters as
-// `url.Values`.
-func (r RadarHTTPTimeseriesGroupOSParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Aggregation interval results should be returned in (for example, in 15 minutes
-// or 1 hour intervals). Refer to
-// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
-type RadarHTTPTimeseriesGroupOSParamsAggInterval string
-
-const (
- RadarHTTPTimeseriesGroupOSParamsAggInterval15m RadarHTTPTimeseriesGroupOSParamsAggInterval = "15m"
- RadarHTTPTimeseriesGroupOSParamsAggInterval1h RadarHTTPTimeseriesGroupOSParamsAggInterval = "1h"
- RadarHTTPTimeseriesGroupOSParamsAggInterval1d RadarHTTPTimeseriesGroupOSParamsAggInterval = "1d"
- RadarHTTPTimeseriesGroupOSParamsAggInterval1w RadarHTTPTimeseriesGroupOSParamsAggInterval = "1w"
-)
-
-type RadarHTTPTimeseriesGroupOSParamsBotClass string
-
-const (
- RadarHTTPTimeseriesGroupOSParamsBotClassLikelyAutomated RadarHTTPTimeseriesGroupOSParamsBotClass = "LIKELY_AUTOMATED"
- RadarHTTPTimeseriesGroupOSParamsBotClassLikelyHuman RadarHTTPTimeseriesGroupOSParamsBotClass = "LIKELY_HUMAN"
-)
-
-type RadarHTTPTimeseriesGroupOSParamsDateRange string
-
-const (
- RadarHTTPTimeseriesGroupOSParamsDateRange1d RadarHTTPTimeseriesGroupOSParamsDateRange = "1d"
- RadarHTTPTimeseriesGroupOSParamsDateRange2d RadarHTTPTimeseriesGroupOSParamsDateRange = "2d"
- RadarHTTPTimeseriesGroupOSParamsDateRange7d RadarHTTPTimeseriesGroupOSParamsDateRange = "7d"
- RadarHTTPTimeseriesGroupOSParamsDateRange14d RadarHTTPTimeseriesGroupOSParamsDateRange = "14d"
- RadarHTTPTimeseriesGroupOSParamsDateRange28d RadarHTTPTimeseriesGroupOSParamsDateRange = "28d"
- RadarHTTPTimeseriesGroupOSParamsDateRange12w RadarHTTPTimeseriesGroupOSParamsDateRange = "12w"
- RadarHTTPTimeseriesGroupOSParamsDateRange24w RadarHTTPTimeseriesGroupOSParamsDateRange = "24w"
- RadarHTTPTimeseriesGroupOSParamsDateRange52w RadarHTTPTimeseriesGroupOSParamsDateRange = "52w"
- RadarHTTPTimeseriesGroupOSParamsDateRange1dControl RadarHTTPTimeseriesGroupOSParamsDateRange = "1dControl"
- RadarHTTPTimeseriesGroupOSParamsDateRange2dControl RadarHTTPTimeseriesGroupOSParamsDateRange = "2dControl"
- RadarHTTPTimeseriesGroupOSParamsDateRange7dControl RadarHTTPTimeseriesGroupOSParamsDateRange = "7dControl"
- RadarHTTPTimeseriesGroupOSParamsDateRange14dControl RadarHTTPTimeseriesGroupOSParamsDateRange = "14dControl"
- RadarHTTPTimeseriesGroupOSParamsDateRange28dControl RadarHTTPTimeseriesGroupOSParamsDateRange = "28dControl"
- RadarHTTPTimeseriesGroupOSParamsDateRange12wControl RadarHTTPTimeseriesGroupOSParamsDateRange = "12wControl"
- RadarHTTPTimeseriesGroupOSParamsDateRange24wControl RadarHTTPTimeseriesGroupOSParamsDateRange = "24wControl"
-)
-
-type RadarHTTPTimeseriesGroupOSParamsDeviceType string
-
-const (
- RadarHTTPTimeseriesGroupOSParamsDeviceTypeDesktop RadarHTTPTimeseriesGroupOSParamsDeviceType = "DESKTOP"
- RadarHTTPTimeseriesGroupOSParamsDeviceTypeMobile RadarHTTPTimeseriesGroupOSParamsDeviceType = "MOBILE"
- RadarHTTPTimeseriesGroupOSParamsDeviceTypeOther RadarHTTPTimeseriesGroupOSParamsDeviceType = "OTHER"
-)
-
-// Format results are returned in.
-type RadarHTTPTimeseriesGroupOSParamsFormat string
-
-const (
- RadarHTTPTimeseriesGroupOSParamsFormatJson RadarHTTPTimeseriesGroupOSParamsFormat = "JSON"
- RadarHTTPTimeseriesGroupOSParamsFormatCsv RadarHTTPTimeseriesGroupOSParamsFormat = "CSV"
-)
-
-type RadarHTTPTimeseriesGroupOSParamsHTTPProtocol string
-
-const (
- RadarHTTPTimeseriesGroupOSParamsHTTPProtocolHTTP RadarHTTPTimeseriesGroupOSParamsHTTPProtocol = "HTTP"
- RadarHTTPTimeseriesGroupOSParamsHTTPProtocolHTTPS RadarHTTPTimeseriesGroupOSParamsHTTPProtocol = "HTTPS"
-)
-
-type RadarHTTPTimeseriesGroupOSParamsHTTPVersion string
-
-const (
- RadarHTTPTimeseriesGroupOSParamsHTTPVersionHttPv1 RadarHTTPTimeseriesGroupOSParamsHTTPVersion = "HTTPv1"
- RadarHTTPTimeseriesGroupOSParamsHTTPVersionHttPv2 RadarHTTPTimeseriesGroupOSParamsHTTPVersion = "HTTPv2"
- RadarHTTPTimeseriesGroupOSParamsHTTPVersionHttPv3 RadarHTTPTimeseriesGroupOSParamsHTTPVersion = "HTTPv3"
-)
-
-type RadarHTTPTimeseriesGroupOSParamsIPVersion string
-
-const (
- RadarHTTPTimeseriesGroupOSParamsIPVersionIPv4 RadarHTTPTimeseriesGroupOSParamsIPVersion = "IPv4"
- RadarHTTPTimeseriesGroupOSParamsIPVersionIPv6 RadarHTTPTimeseriesGroupOSParamsIPVersion = "IPv6"
-)
-
-type RadarHTTPTimeseriesGroupOSParamsTLSVersion string
-
-const (
- RadarHTTPTimeseriesGroupOSParamsTLSVersionTlSv1_0 RadarHTTPTimeseriesGroupOSParamsTLSVersion = "TLSv1_0"
- RadarHTTPTimeseriesGroupOSParamsTLSVersionTlSv1_1 RadarHTTPTimeseriesGroupOSParamsTLSVersion = "TLSv1_1"
- RadarHTTPTimeseriesGroupOSParamsTLSVersionTlSv1_2 RadarHTTPTimeseriesGroupOSParamsTLSVersion = "TLSv1_2"
- RadarHTTPTimeseriesGroupOSParamsTLSVersionTlSv1_3 RadarHTTPTimeseriesGroupOSParamsTLSVersion = "TLSv1_3"
- RadarHTTPTimeseriesGroupOSParamsTLSVersionTlSvQuic RadarHTTPTimeseriesGroupOSParamsTLSVersion = "TLSvQUIC"
-)
-
-type RadarHTTPTimeseriesGroupOSResponseEnvelope struct {
- Result RadarHTTPTimeseriesGroupOSResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarHTTPTimeseriesGroupOSResponseEnvelopeJSON `json:"-"`
-}
-
-// radarHTTPTimeseriesGroupOSResponseEnvelopeJSON contains the JSON metadata for
-// the struct [RadarHTTPTimeseriesGroupOSResponseEnvelope]
-type radarHTTPTimeseriesGroupOSResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPTimeseriesGroupOSResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPTimeseriesGroupOSResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPTimeseriesGroupTLSVersionParams struct {
- // Aggregation interval results should be returned in (for example, in 15 minutes
- // or 1 hour intervals). Refer to
- // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
- AggInterval param.Field[RadarHTTPTimeseriesGroupTLSVersionParamsAggInterval] `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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarHTTPTimeseriesGroupTLSVersionParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Filter for device type.
- DeviceType param.Field[[]RadarHTTPTimeseriesGroupTLSVersionParamsDeviceType] `query:"deviceType"`
- // Format results are returned in.
- Format param.Field[RadarHTTPTimeseriesGroupTLSVersionParamsFormat] `query:"format"`
- // Filter for http protocol.
- HTTPProtocol param.Field[[]RadarHTTPTimeseriesGroupTLSVersionParamsHTTPProtocol] `query:"httpProtocol"`
- // Filter for http version.
- HTTPVersion param.Field[[]RadarHTTPTimeseriesGroupTLSVersionParamsHTTPVersion] `query:"httpVersion"`
- // Filter for ip version.
- IPVersion param.Field[[]RadarHTTPTimeseriesGroupTLSVersionParamsIPVersion] `query:"ipVersion"`
- // 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 os name.
- OS param.Field[[]RadarHTTPTimeseriesGroupTLSVersionParamsOS] `query:"os"`
-}
-
-// URLQuery serializes [RadarHTTPTimeseriesGroupTLSVersionParams]'s query
-// parameters as `url.Values`.
-func (r RadarHTTPTimeseriesGroupTLSVersionParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Aggregation interval results should be returned in (for example, in 15 minutes
-// or 1 hour intervals). Refer to
-// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
-type RadarHTTPTimeseriesGroupTLSVersionParamsAggInterval string
-
-const (
- RadarHTTPTimeseriesGroupTLSVersionParamsAggInterval15m RadarHTTPTimeseriesGroupTLSVersionParamsAggInterval = "15m"
- RadarHTTPTimeseriesGroupTLSVersionParamsAggInterval1h RadarHTTPTimeseriesGroupTLSVersionParamsAggInterval = "1h"
- RadarHTTPTimeseriesGroupTLSVersionParamsAggInterval1d RadarHTTPTimeseriesGroupTLSVersionParamsAggInterval = "1d"
- RadarHTTPTimeseriesGroupTLSVersionParamsAggInterval1w RadarHTTPTimeseriesGroupTLSVersionParamsAggInterval = "1w"
-)
-
-type RadarHTTPTimeseriesGroupTLSVersionParamsBotClass string
-
-const (
- RadarHTTPTimeseriesGroupTLSVersionParamsBotClassLikelyAutomated RadarHTTPTimeseriesGroupTLSVersionParamsBotClass = "LIKELY_AUTOMATED"
- RadarHTTPTimeseriesGroupTLSVersionParamsBotClassLikelyHuman RadarHTTPTimeseriesGroupTLSVersionParamsBotClass = "LIKELY_HUMAN"
-)
-
-type RadarHTTPTimeseriesGroupTLSVersionParamsDateRange string
-
-const (
- RadarHTTPTimeseriesGroupTLSVersionParamsDateRange1d RadarHTTPTimeseriesGroupTLSVersionParamsDateRange = "1d"
- RadarHTTPTimeseriesGroupTLSVersionParamsDateRange2d RadarHTTPTimeseriesGroupTLSVersionParamsDateRange = "2d"
- RadarHTTPTimeseriesGroupTLSVersionParamsDateRange7d RadarHTTPTimeseriesGroupTLSVersionParamsDateRange = "7d"
- RadarHTTPTimeseriesGroupTLSVersionParamsDateRange14d RadarHTTPTimeseriesGroupTLSVersionParamsDateRange = "14d"
- RadarHTTPTimeseriesGroupTLSVersionParamsDateRange28d RadarHTTPTimeseriesGroupTLSVersionParamsDateRange = "28d"
- RadarHTTPTimeseriesGroupTLSVersionParamsDateRange12w RadarHTTPTimeseriesGroupTLSVersionParamsDateRange = "12w"
- RadarHTTPTimeseriesGroupTLSVersionParamsDateRange24w RadarHTTPTimeseriesGroupTLSVersionParamsDateRange = "24w"
- RadarHTTPTimeseriesGroupTLSVersionParamsDateRange52w RadarHTTPTimeseriesGroupTLSVersionParamsDateRange = "52w"
- RadarHTTPTimeseriesGroupTLSVersionParamsDateRange1dControl RadarHTTPTimeseriesGroupTLSVersionParamsDateRange = "1dControl"
- RadarHTTPTimeseriesGroupTLSVersionParamsDateRange2dControl RadarHTTPTimeseriesGroupTLSVersionParamsDateRange = "2dControl"
- RadarHTTPTimeseriesGroupTLSVersionParamsDateRange7dControl RadarHTTPTimeseriesGroupTLSVersionParamsDateRange = "7dControl"
- RadarHTTPTimeseriesGroupTLSVersionParamsDateRange14dControl RadarHTTPTimeseriesGroupTLSVersionParamsDateRange = "14dControl"
- RadarHTTPTimeseriesGroupTLSVersionParamsDateRange28dControl RadarHTTPTimeseriesGroupTLSVersionParamsDateRange = "28dControl"
- RadarHTTPTimeseriesGroupTLSVersionParamsDateRange12wControl RadarHTTPTimeseriesGroupTLSVersionParamsDateRange = "12wControl"
- RadarHTTPTimeseriesGroupTLSVersionParamsDateRange24wControl RadarHTTPTimeseriesGroupTLSVersionParamsDateRange = "24wControl"
-)
-
-type RadarHTTPTimeseriesGroupTLSVersionParamsDeviceType string
-
-const (
- RadarHTTPTimeseriesGroupTLSVersionParamsDeviceTypeDesktop RadarHTTPTimeseriesGroupTLSVersionParamsDeviceType = "DESKTOP"
- RadarHTTPTimeseriesGroupTLSVersionParamsDeviceTypeMobile RadarHTTPTimeseriesGroupTLSVersionParamsDeviceType = "MOBILE"
- RadarHTTPTimeseriesGroupTLSVersionParamsDeviceTypeOther RadarHTTPTimeseriesGroupTLSVersionParamsDeviceType = "OTHER"
-)
-
-// Format results are returned in.
-type RadarHTTPTimeseriesGroupTLSVersionParamsFormat string
-
-const (
- RadarHTTPTimeseriesGroupTLSVersionParamsFormatJson RadarHTTPTimeseriesGroupTLSVersionParamsFormat = "JSON"
- RadarHTTPTimeseriesGroupTLSVersionParamsFormatCsv RadarHTTPTimeseriesGroupTLSVersionParamsFormat = "CSV"
-)
-
-type RadarHTTPTimeseriesGroupTLSVersionParamsHTTPProtocol string
-
-const (
- RadarHTTPTimeseriesGroupTLSVersionParamsHTTPProtocolHTTP RadarHTTPTimeseriesGroupTLSVersionParamsHTTPProtocol = "HTTP"
- RadarHTTPTimeseriesGroupTLSVersionParamsHTTPProtocolHTTPS RadarHTTPTimeseriesGroupTLSVersionParamsHTTPProtocol = "HTTPS"
-)
-
-type RadarHTTPTimeseriesGroupTLSVersionParamsHTTPVersion string
-
-const (
- RadarHTTPTimeseriesGroupTLSVersionParamsHTTPVersionHttPv1 RadarHTTPTimeseriesGroupTLSVersionParamsHTTPVersion = "HTTPv1"
- RadarHTTPTimeseriesGroupTLSVersionParamsHTTPVersionHttPv2 RadarHTTPTimeseriesGroupTLSVersionParamsHTTPVersion = "HTTPv2"
- RadarHTTPTimeseriesGroupTLSVersionParamsHTTPVersionHttPv3 RadarHTTPTimeseriesGroupTLSVersionParamsHTTPVersion = "HTTPv3"
-)
-
-type RadarHTTPTimeseriesGroupTLSVersionParamsIPVersion string
-
-const (
- RadarHTTPTimeseriesGroupTLSVersionParamsIPVersionIPv4 RadarHTTPTimeseriesGroupTLSVersionParamsIPVersion = "IPv4"
- RadarHTTPTimeseriesGroupTLSVersionParamsIPVersionIPv6 RadarHTTPTimeseriesGroupTLSVersionParamsIPVersion = "IPv6"
-)
-
-type RadarHTTPTimeseriesGroupTLSVersionParamsOS string
-
-const (
- RadarHTTPTimeseriesGroupTLSVersionParamsOSWindows RadarHTTPTimeseriesGroupTLSVersionParamsOS = "WINDOWS"
- RadarHTTPTimeseriesGroupTLSVersionParamsOSMacosx RadarHTTPTimeseriesGroupTLSVersionParamsOS = "MACOSX"
- RadarHTTPTimeseriesGroupTLSVersionParamsOSIos RadarHTTPTimeseriesGroupTLSVersionParamsOS = "IOS"
- RadarHTTPTimeseriesGroupTLSVersionParamsOSAndroid RadarHTTPTimeseriesGroupTLSVersionParamsOS = "ANDROID"
- RadarHTTPTimeseriesGroupTLSVersionParamsOSChromeos RadarHTTPTimeseriesGroupTLSVersionParamsOS = "CHROMEOS"
- RadarHTTPTimeseriesGroupTLSVersionParamsOSLinux RadarHTTPTimeseriesGroupTLSVersionParamsOS = "LINUX"
- RadarHTTPTimeseriesGroupTLSVersionParamsOSSmartTv RadarHTTPTimeseriesGroupTLSVersionParamsOS = "SMART_TV"
-)
-
-type RadarHTTPTimeseriesGroupTLSVersionResponseEnvelope struct {
- Result RadarHTTPTimeseriesGroupTLSVersionResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarHTTPTimeseriesGroupTLSVersionResponseEnvelopeJSON `json:"-"`
-}
-
-// radarHTTPTimeseriesGroupTLSVersionResponseEnvelopeJSON contains the JSON
-// metadata for the struct [RadarHTTPTimeseriesGroupTLSVersionResponseEnvelope]
-type radarHTTPTimeseriesGroupTLSVersionResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPTimeseriesGroupTLSVersionResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPTimeseriesGroupTLSVersionResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
diff --git a/radarhttptimeseriesgroup_test.go b/radarhttptimeseriesgroup_test.go
deleted file mode 100644
index 0472cbd714f..00000000000
--- a/radarhttptimeseriesgroup_test.go
+++ /dev/null
@@ -1,378 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
- "time"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRadarHTTPTimeseriesGroupBotClassWithOptionalParams(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"),
- )
- _, 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()}),
- DeviceType: cloudflare.F([]cloudflare.RadarHTTPTimeseriesGroupBotClassParamsDeviceType{cloudflare.RadarHTTPTimeseriesGroupBotClassParamsDeviceTypeDesktop, cloudflare.RadarHTTPTimeseriesGroupBotClassParamsDeviceTypeMobile, cloudflare.RadarHTTPTimeseriesGroupBotClassParamsDeviceTypeOther}),
- Format: cloudflare.F(cloudflare.RadarHTTPTimeseriesGroupBotClassParamsFormatJson),
- HTTPProtocol: cloudflare.F([]cloudflare.RadarHTTPTimeseriesGroupBotClassParamsHTTPProtocol{cloudflare.RadarHTTPTimeseriesGroupBotClassParamsHTTPProtocolHTTP, cloudflare.RadarHTTPTimeseriesGroupBotClassParamsHTTPProtocolHTTPS}),
- HTTPVersion: cloudflare.F([]cloudflare.RadarHTTPTimeseriesGroupBotClassParamsHTTPVersion{cloudflare.RadarHTTPTimeseriesGroupBotClassParamsHTTPVersionHttPv1, cloudflare.RadarHTTPTimeseriesGroupBotClassParamsHTTPVersionHttPv2, cloudflare.RadarHTTPTimeseriesGroupBotClassParamsHTTPVersionHttPv3}),
- IPVersion: cloudflare.F([]cloudflare.RadarHTTPTimeseriesGroupBotClassParamsIPVersion{cloudflare.RadarHTTPTimeseriesGroupBotClassParamsIPVersionIPv4, cloudflare.RadarHTTPTimeseriesGroupBotClassParamsIPVersionIPv6}),
- Location: cloudflare.F([]string{"string", "string", "string"}),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- OS: cloudflare.F([]cloudflare.RadarHTTPTimeseriesGroupBotClassParamsOS{cloudflare.RadarHTTPTimeseriesGroupBotClassParamsOSWindows, cloudflare.RadarHTTPTimeseriesGroupBotClassParamsOSMacosx, cloudflare.RadarHTTPTimeseriesGroupBotClassParamsOSIos}),
- TLSVersion: cloudflare.F([]cloudflare.RadarHTTPTimeseriesGroupBotClassParamsTLSVersion{cloudflare.RadarHTTPTimeseriesGroupBotClassParamsTLSVersionTlSv1_0, cloudflare.RadarHTTPTimeseriesGroupBotClassParamsTLSVersionTlSv1_1, cloudflare.RadarHTTPTimeseriesGroupBotClassParamsTLSVersionTlSv1_2}),
- })
- 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())
- }
-}
-
-func TestRadarHTTPTimeseriesGroupBrowserWithOptionalParams(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"),
- )
- _, err := client.Radar.HTTP.TimeseriesGroups.Browser(context.TODO(), cloudflare.RadarHTTPTimeseriesGroupBrowserParams{
- 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()}),
- DeviceType: cloudflare.F([]cloudflare.RadarHTTPTimeseriesGroupBrowserParamsDeviceType{cloudflare.RadarHTTPTimeseriesGroupBrowserParamsDeviceTypeDesktop, cloudflare.RadarHTTPTimeseriesGroupBrowserParamsDeviceTypeMobile, cloudflare.RadarHTTPTimeseriesGroupBrowserParamsDeviceTypeOther}),
- Format: cloudflare.F(cloudflare.RadarHTTPTimeseriesGroupBrowserParamsFormatJson),
- HTTPProtocol: cloudflare.F([]cloudflare.RadarHTTPTimeseriesGroupBrowserParamsHTTPProtocol{cloudflare.RadarHTTPTimeseriesGroupBrowserParamsHTTPProtocolHTTP, cloudflare.RadarHTTPTimeseriesGroupBrowserParamsHTTPProtocolHTTPS}),
- HTTPVersion: cloudflare.F([]cloudflare.RadarHTTPTimeseriesGroupBrowserParamsHTTPVersion{cloudflare.RadarHTTPTimeseriesGroupBrowserParamsHTTPVersionHttPv1, cloudflare.RadarHTTPTimeseriesGroupBrowserParamsHTTPVersionHttPv2, cloudflare.RadarHTTPTimeseriesGroupBrowserParamsHTTPVersionHttPv3}),
- IPVersion: cloudflare.F([]cloudflare.RadarHTTPTimeseriesGroupBrowserParamsIPVersion{cloudflare.RadarHTTPTimeseriesGroupBrowserParamsIPVersionIPv4, cloudflare.RadarHTTPTimeseriesGroupBrowserParamsIPVersionIPv6}),
- LimitPerGroup: cloudflare.F(int64(4)),
- Location: cloudflare.F([]string{"string", "string", "string"}),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- OS: cloudflare.F([]cloudflare.RadarHTTPTimeseriesGroupBrowserParamsOS{cloudflare.RadarHTTPTimeseriesGroupBrowserParamsOSWindows, cloudflare.RadarHTTPTimeseriesGroupBrowserParamsOSMacosx, cloudflare.RadarHTTPTimeseriesGroupBrowserParamsOSIos}),
- TLSVersion: cloudflare.F([]cloudflare.RadarHTTPTimeseriesGroupBrowserParamsTLSVersion{cloudflare.RadarHTTPTimeseriesGroupBrowserParamsTLSVersionTlSv1_0, cloudflare.RadarHTTPTimeseriesGroupBrowserParamsTLSVersionTlSv1_1, cloudflare.RadarHTTPTimeseriesGroupBrowserParamsTLSVersionTlSv1_2}),
- })
- 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())
- }
-}
-
-func TestRadarHTTPTimeseriesGroupBrowserFamilyWithOptionalParams(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"),
- )
- _, err := client.Radar.HTTP.TimeseriesGroups.BrowserFamily(context.TODO(), cloudflare.RadarHTTPTimeseriesGroupBrowserFamilyParams{
- 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()}),
- DeviceType: cloudflare.F([]cloudflare.RadarHTTPTimeseriesGroupBrowserFamilyParamsDeviceType{cloudflare.RadarHTTPTimeseriesGroupBrowserFamilyParamsDeviceTypeDesktop, cloudflare.RadarHTTPTimeseriesGroupBrowserFamilyParamsDeviceTypeMobile, cloudflare.RadarHTTPTimeseriesGroupBrowserFamilyParamsDeviceTypeOther}),
- Format: cloudflare.F(cloudflare.RadarHTTPTimeseriesGroupBrowserFamilyParamsFormatJson),
- HTTPProtocol: cloudflare.F([]cloudflare.RadarHTTPTimeseriesGroupBrowserFamilyParamsHTTPProtocol{cloudflare.RadarHTTPTimeseriesGroupBrowserFamilyParamsHTTPProtocolHTTP, cloudflare.RadarHTTPTimeseriesGroupBrowserFamilyParamsHTTPProtocolHTTPS}),
- HTTPVersion: cloudflare.F([]cloudflare.RadarHTTPTimeseriesGroupBrowserFamilyParamsHTTPVersion{cloudflare.RadarHTTPTimeseriesGroupBrowserFamilyParamsHTTPVersionHttPv1, cloudflare.RadarHTTPTimeseriesGroupBrowserFamilyParamsHTTPVersionHttPv2, cloudflare.RadarHTTPTimeseriesGroupBrowserFamilyParamsHTTPVersionHttPv3}),
- IPVersion: cloudflare.F([]cloudflare.RadarHTTPTimeseriesGroupBrowserFamilyParamsIPVersion{cloudflare.RadarHTTPTimeseriesGroupBrowserFamilyParamsIPVersionIPv4, cloudflare.RadarHTTPTimeseriesGroupBrowserFamilyParamsIPVersionIPv6}),
- Location: cloudflare.F([]string{"string", "string", "string"}),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- OS: cloudflare.F([]cloudflare.RadarHTTPTimeseriesGroupBrowserFamilyParamsOS{cloudflare.RadarHTTPTimeseriesGroupBrowserFamilyParamsOSWindows, cloudflare.RadarHTTPTimeseriesGroupBrowserFamilyParamsOSMacosx, cloudflare.RadarHTTPTimeseriesGroupBrowserFamilyParamsOSIos}),
- TLSVersion: cloudflare.F([]cloudflare.RadarHTTPTimeseriesGroupBrowserFamilyParamsTLSVersion{cloudflare.RadarHTTPTimeseriesGroupBrowserFamilyParamsTLSVersionTlSv1_0, cloudflare.RadarHTTPTimeseriesGroupBrowserFamilyParamsTLSVersionTlSv1_1, cloudflare.RadarHTTPTimeseriesGroupBrowserFamilyParamsTLSVersionTlSv1_2}),
- })
- 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())
- }
-}
-
-func TestRadarHTTPTimeseriesGroupDeviceTypeWithOptionalParams(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"),
- )
- _, err := client.Radar.HTTP.TimeseriesGroups.DeviceType(context.TODO(), cloudflare.RadarHTTPTimeseriesGroupDeviceTypeParams{
- 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()}),
- Format: cloudflare.F(cloudflare.RadarHTTPTimeseriesGroupDeviceTypeParamsFormatJson),
- HTTPProtocol: cloudflare.F([]cloudflare.RadarHTTPTimeseriesGroupDeviceTypeParamsHTTPProtocol{cloudflare.RadarHTTPTimeseriesGroupDeviceTypeParamsHTTPProtocolHTTP, cloudflare.RadarHTTPTimeseriesGroupDeviceTypeParamsHTTPProtocolHTTPS}),
- HTTPVersion: cloudflare.F([]cloudflare.RadarHTTPTimeseriesGroupDeviceTypeParamsHTTPVersion{cloudflare.RadarHTTPTimeseriesGroupDeviceTypeParamsHTTPVersionHttPv1, cloudflare.RadarHTTPTimeseriesGroupDeviceTypeParamsHTTPVersionHttPv2, cloudflare.RadarHTTPTimeseriesGroupDeviceTypeParamsHTTPVersionHttPv3}),
- IPVersion: cloudflare.F([]cloudflare.RadarHTTPTimeseriesGroupDeviceTypeParamsIPVersion{cloudflare.RadarHTTPTimeseriesGroupDeviceTypeParamsIPVersionIPv4, cloudflare.RadarHTTPTimeseriesGroupDeviceTypeParamsIPVersionIPv6}),
- Location: cloudflare.F([]string{"string", "string", "string"}),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- OS: cloudflare.F([]cloudflare.RadarHTTPTimeseriesGroupDeviceTypeParamsOS{cloudflare.RadarHTTPTimeseriesGroupDeviceTypeParamsOSWindows, cloudflare.RadarHTTPTimeseriesGroupDeviceTypeParamsOSMacosx, cloudflare.RadarHTTPTimeseriesGroupDeviceTypeParamsOSIos}),
- TLSVersion: cloudflare.F([]cloudflare.RadarHTTPTimeseriesGroupDeviceTypeParamsTLSVersion{cloudflare.RadarHTTPTimeseriesGroupDeviceTypeParamsTLSVersionTlSv1_0, cloudflare.RadarHTTPTimeseriesGroupDeviceTypeParamsTLSVersionTlSv1_1, cloudflare.RadarHTTPTimeseriesGroupDeviceTypeParamsTLSVersionTlSv1_2}),
- })
- 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())
- }
-}
-
-func TestRadarHTTPTimeseriesGroupHTTPProtocolWithOptionalParams(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"),
- )
- _, err := client.Radar.HTTP.TimeseriesGroups.HTTPProtocol(context.TODO(), cloudflare.RadarHTTPTimeseriesGroupHTTPProtocolParams{
- 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()}),
- DeviceType: cloudflare.F([]cloudflare.RadarHTTPTimeseriesGroupHTTPProtocolParamsDeviceType{cloudflare.RadarHTTPTimeseriesGroupHTTPProtocolParamsDeviceTypeDesktop, cloudflare.RadarHTTPTimeseriesGroupHTTPProtocolParamsDeviceTypeMobile, cloudflare.RadarHTTPTimeseriesGroupHTTPProtocolParamsDeviceTypeOther}),
- Format: cloudflare.F(cloudflare.RadarHTTPTimeseriesGroupHTTPProtocolParamsFormatJson),
- HTTPVersion: cloudflare.F([]cloudflare.RadarHTTPTimeseriesGroupHTTPProtocolParamsHTTPVersion{cloudflare.RadarHTTPTimeseriesGroupHTTPProtocolParamsHTTPVersionHttPv1, cloudflare.RadarHTTPTimeseriesGroupHTTPProtocolParamsHTTPVersionHttPv2, cloudflare.RadarHTTPTimeseriesGroupHTTPProtocolParamsHTTPVersionHttPv3}),
- IPVersion: cloudflare.F([]cloudflare.RadarHTTPTimeseriesGroupHTTPProtocolParamsIPVersion{cloudflare.RadarHTTPTimeseriesGroupHTTPProtocolParamsIPVersionIPv4, cloudflare.RadarHTTPTimeseriesGroupHTTPProtocolParamsIPVersionIPv6}),
- Location: cloudflare.F([]string{"string", "string", "string"}),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- OS: cloudflare.F([]cloudflare.RadarHTTPTimeseriesGroupHTTPProtocolParamsOS{cloudflare.RadarHTTPTimeseriesGroupHTTPProtocolParamsOSWindows, cloudflare.RadarHTTPTimeseriesGroupHTTPProtocolParamsOSMacosx, cloudflare.RadarHTTPTimeseriesGroupHTTPProtocolParamsOSIos}),
- TLSVersion: cloudflare.F([]cloudflare.RadarHTTPTimeseriesGroupHTTPProtocolParamsTLSVersion{cloudflare.RadarHTTPTimeseriesGroupHTTPProtocolParamsTLSVersionTlSv1_0, cloudflare.RadarHTTPTimeseriesGroupHTTPProtocolParamsTLSVersionTlSv1_1, cloudflare.RadarHTTPTimeseriesGroupHTTPProtocolParamsTLSVersionTlSv1_2}),
- })
- 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())
- }
-}
-
-func TestRadarHTTPTimeseriesGroupHTTPVersionWithOptionalParams(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"),
- )
- _, err := client.Radar.HTTP.TimeseriesGroups.HTTPVersion(context.TODO(), cloudflare.RadarHTTPTimeseriesGroupHTTPVersionParams{
- 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()}),
- DeviceType: cloudflare.F([]cloudflare.RadarHTTPTimeseriesGroupHTTPVersionParamsDeviceType{cloudflare.RadarHTTPTimeseriesGroupHTTPVersionParamsDeviceTypeDesktop, cloudflare.RadarHTTPTimeseriesGroupHTTPVersionParamsDeviceTypeMobile, cloudflare.RadarHTTPTimeseriesGroupHTTPVersionParamsDeviceTypeOther}),
- Format: cloudflare.F(cloudflare.RadarHTTPTimeseriesGroupHTTPVersionParamsFormatJson),
- HTTPProtocol: cloudflare.F([]cloudflare.RadarHTTPTimeseriesGroupHTTPVersionParamsHTTPProtocol{cloudflare.RadarHTTPTimeseriesGroupHTTPVersionParamsHTTPProtocolHTTP, cloudflare.RadarHTTPTimeseriesGroupHTTPVersionParamsHTTPProtocolHTTPS}),
- IPVersion: cloudflare.F([]cloudflare.RadarHTTPTimeseriesGroupHTTPVersionParamsIPVersion{cloudflare.RadarHTTPTimeseriesGroupHTTPVersionParamsIPVersionIPv4, cloudflare.RadarHTTPTimeseriesGroupHTTPVersionParamsIPVersionIPv6}),
- Location: cloudflare.F([]string{"string", "string", "string"}),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- OS: cloudflare.F([]cloudflare.RadarHTTPTimeseriesGroupHTTPVersionParamsOS{cloudflare.RadarHTTPTimeseriesGroupHTTPVersionParamsOSWindows, cloudflare.RadarHTTPTimeseriesGroupHTTPVersionParamsOSMacosx, cloudflare.RadarHTTPTimeseriesGroupHTTPVersionParamsOSIos}),
- TLSVersion: cloudflare.F([]cloudflare.RadarHTTPTimeseriesGroupHTTPVersionParamsTLSVersion{cloudflare.RadarHTTPTimeseriesGroupHTTPVersionParamsTLSVersionTlSv1_0, cloudflare.RadarHTTPTimeseriesGroupHTTPVersionParamsTLSVersionTlSv1_1, cloudflare.RadarHTTPTimeseriesGroupHTTPVersionParamsTLSVersionTlSv1_2}),
- })
- 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())
- }
-}
-
-func TestRadarHTTPTimeseriesGroupIPVersionWithOptionalParams(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"),
- )
- _, err := client.Radar.HTTP.TimeseriesGroups.IPVersion(context.TODO(), cloudflare.RadarHTTPTimeseriesGroupIPVersionParams{
- 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()}),
- DeviceType: cloudflare.F([]cloudflare.RadarHTTPTimeseriesGroupIPVersionParamsDeviceType{cloudflare.RadarHTTPTimeseriesGroupIPVersionParamsDeviceTypeDesktop, cloudflare.RadarHTTPTimeseriesGroupIPVersionParamsDeviceTypeMobile, cloudflare.RadarHTTPTimeseriesGroupIPVersionParamsDeviceTypeOther}),
- Format: cloudflare.F(cloudflare.RadarHTTPTimeseriesGroupIPVersionParamsFormatJson),
- HTTPProtocol: cloudflare.F([]cloudflare.RadarHTTPTimeseriesGroupIPVersionParamsHTTPProtocol{cloudflare.RadarHTTPTimeseriesGroupIPVersionParamsHTTPProtocolHTTP, cloudflare.RadarHTTPTimeseriesGroupIPVersionParamsHTTPProtocolHTTPS}),
- HTTPVersion: cloudflare.F([]cloudflare.RadarHTTPTimeseriesGroupIPVersionParamsHTTPVersion{cloudflare.RadarHTTPTimeseriesGroupIPVersionParamsHTTPVersionHttPv1, cloudflare.RadarHTTPTimeseriesGroupIPVersionParamsHTTPVersionHttPv2, cloudflare.RadarHTTPTimeseriesGroupIPVersionParamsHTTPVersionHttPv3}),
- Location: cloudflare.F([]string{"string", "string", "string"}),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- OS: cloudflare.F([]cloudflare.RadarHTTPTimeseriesGroupIPVersionParamsOS{cloudflare.RadarHTTPTimeseriesGroupIPVersionParamsOSWindows, cloudflare.RadarHTTPTimeseriesGroupIPVersionParamsOSMacosx, cloudflare.RadarHTTPTimeseriesGroupIPVersionParamsOSIos}),
- TLSVersion: cloudflare.F([]cloudflare.RadarHTTPTimeseriesGroupIPVersionParamsTLSVersion{cloudflare.RadarHTTPTimeseriesGroupIPVersionParamsTLSVersionTlSv1_0, cloudflare.RadarHTTPTimeseriesGroupIPVersionParamsTLSVersionTlSv1_1, cloudflare.RadarHTTPTimeseriesGroupIPVersionParamsTLSVersionTlSv1_2}),
- })
- 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())
- }
-}
-
-func TestRadarHTTPTimeseriesGroupOSWithOptionalParams(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"),
- )
- _, err := client.Radar.HTTP.TimeseriesGroups.OS(context.TODO(), cloudflare.RadarHTTPTimeseriesGroupOSParams{
- 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()}),
- DeviceType: cloudflare.F([]cloudflare.RadarHTTPTimeseriesGroupOSParamsDeviceType{cloudflare.RadarHTTPTimeseriesGroupOSParamsDeviceTypeDesktop, cloudflare.RadarHTTPTimeseriesGroupOSParamsDeviceTypeMobile, cloudflare.RadarHTTPTimeseriesGroupOSParamsDeviceTypeOther}),
- Format: cloudflare.F(cloudflare.RadarHTTPTimeseriesGroupOSParamsFormatJson),
- HTTPProtocol: cloudflare.F([]cloudflare.RadarHTTPTimeseriesGroupOSParamsHTTPProtocol{cloudflare.RadarHTTPTimeseriesGroupOSParamsHTTPProtocolHTTP, cloudflare.RadarHTTPTimeseriesGroupOSParamsHTTPProtocolHTTPS}),
- HTTPVersion: cloudflare.F([]cloudflare.RadarHTTPTimeseriesGroupOSParamsHTTPVersion{cloudflare.RadarHTTPTimeseriesGroupOSParamsHTTPVersionHttPv1, cloudflare.RadarHTTPTimeseriesGroupOSParamsHTTPVersionHttPv2, cloudflare.RadarHTTPTimeseriesGroupOSParamsHTTPVersionHttPv3}),
- IPVersion: cloudflare.F([]cloudflare.RadarHTTPTimeseriesGroupOSParamsIPVersion{cloudflare.RadarHTTPTimeseriesGroupOSParamsIPVersionIPv4, cloudflare.RadarHTTPTimeseriesGroupOSParamsIPVersionIPv6}),
- Location: cloudflare.F([]string{"string", "string", "string"}),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- TLSVersion: cloudflare.F([]cloudflare.RadarHTTPTimeseriesGroupOSParamsTLSVersion{cloudflare.RadarHTTPTimeseriesGroupOSParamsTLSVersionTlSv1_0, cloudflare.RadarHTTPTimeseriesGroupOSParamsTLSVersionTlSv1_1, cloudflare.RadarHTTPTimeseriesGroupOSParamsTLSVersionTlSv1_2}),
- })
- 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())
- }
-}
-
-func TestRadarHTTPTimeseriesGroupTLSVersionWithOptionalParams(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"),
- )
- _, err := client.Radar.HTTP.TimeseriesGroups.TLSVersion(context.TODO(), cloudflare.RadarHTTPTimeseriesGroupTLSVersionParams{
- 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()}),
- DeviceType: cloudflare.F([]cloudflare.RadarHTTPTimeseriesGroupTLSVersionParamsDeviceType{cloudflare.RadarHTTPTimeseriesGroupTLSVersionParamsDeviceTypeDesktop, cloudflare.RadarHTTPTimeseriesGroupTLSVersionParamsDeviceTypeMobile, cloudflare.RadarHTTPTimeseriesGroupTLSVersionParamsDeviceTypeOther}),
- Format: cloudflare.F(cloudflare.RadarHTTPTimeseriesGroupTLSVersionParamsFormatJson),
- HTTPProtocol: cloudflare.F([]cloudflare.RadarHTTPTimeseriesGroupTLSVersionParamsHTTPProtocol{cloudflare.RadarHTTPTimeseriesGroupTLSVersionParamsHTTPProtocolHTTP, cloudflare.RadarHTTPTimeseriesGroupTLSVersionParamsHTTPProtocolHTTPS}),
- HTTPVersion: cloudflare.F([]cloudflare.RadarHTTPTimeseriesGroupTLSVersionParamsHTTPVersion{cloudflare.RadarHTTPTimeseriesGroupTLSVersionParamsHTTPVersionHttPv1, cloudflare.RadarHTTPTimeseriesGroupTLSVersionParamsHTTPVersionHttPv2, cloudflare.RadarHTTPTimeseriesGroupTLSVersionParamsHTTPVersionHttPv3}),
- IPVersion: cloudflare.F([]cloudflare.RadarHTTPTimeseriesGroupTLSVersionParamsIPVersion{cloudflare.RadarHTTPTimeseriesGroupTLSVersionParamsIPVersionIPv4, cloudflare.RadarHTTPTimeseriesGroupTLSVersionParamsIPVersionIPv6}),
- Location: cloudflare.F([]string{"string", "string", "string"}),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- OS: cloudflare.F([]cloudflare.RadarHTTPTimeseriesGroupTLSVersionParamsOS{cloudflare.RadarHTTPTimeseriesGroupTLSVersionParamsOSWindows, cloudflare.RadarHTTPTimeseriesGroupTLSVersionParamsOSMacosx, cloudflare.RadarHTTPTimeseriesGroupTLSVersionParamsOSIos}),
- })
- 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/radarhttptop.go b/radarhttptop.go
deleted file mode 100644
index b556861b089..00000000000
--- a/radarhttptop.go
+++ /dev/null
@@ -1,694 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarHTTPTopService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewRadarHTTPTopService] method
-// instead.
-type RadarHTTPTopService struct {
- Options []option.RequestOption
-}
-
-// NewRadarHTTPTopService generates a new service that applies the given options to
-// each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewRadarHTTPTopService(opts ...option.RequestOption) (r *RadarHTTPTopService) {
- r = &RadarHTTPTopService{}
- r.Options = opts
- return
-}
-
-// Get the top user agents aggregated in families by HTTP traffic. Values are a
-// percentage out of the total traffic.
-func (r *RadarHTTPTopService) BrowserFamilies(ctx context.Context, query RadarHTTPTopBrowserFamiliesParams, opts ...option.RequestOption) (res *RadarHTTPTopBrowserFamiliesResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarHTTPTopBrowserFamiliesResponseEnvelope
- path := "radar/http/top/browser_families"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Get the top user agents by HTTP traffic. Values are a percentage out of the
-// total traffic.
-func (r *RadarHTTPTopService) Browsers(ctx context.Context, query RadarHTTPTopBrowsersParams, opts ...option.RequestOption) (res *RadarHTTPTopBrowsersResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarHTTPTopBrowsersResponseEnvelope
- path := "radar/http/top/browsers"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type RadarHTTPTopBrowserFamiliesResponse struct {
- Meta RadarHTTPTopBrowserFamiliesResponseMeta `json:"meta,required"`
- Top0 []RadarHTTPTopBrowserFamiliesResponseTop0 `json:"top_0,required"`
- JSON radarHTTPTopBrowserFamiliesResponseJSON `json:"-"`
-}
-
-// radarHTTPTopBrowserFamiliesResponseJSON contains the JSON metadata for the
-// struct [RadarHTTPTopBrowserFamiliesResponse]
-type radarHTTPTopBrowserFamiliesResponseJSON struct {
- Meta apijson.Field
- Top0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPTopBrowserFamiliesResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPTopBrowserFamiliesResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPTopBrowserFamiliesResponseMeta struct {
- DateRange []RadarHTTPTopBrowserFamiliesResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- ConfidenceInfo RadarHTTPTopBrowserFamiliesResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarHTTPTopBrowserFamiliesResponseMetaJSON `json:"-"`
-}
-
-// radarHTTPTopBrowserFamiliesResponseMetaJSON contains the JSON metadata for the
-// struct [RadarHTTPTopBrowserFamiliesResponseMeta]
-type radarHTTPTopBrowserFamiliesResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPTopBrowserFamiliesResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPTopBrowserFamiliesResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPTopBrowserFamiliesResponseMetaDateRange 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 radarHTTPTopBrowserFamiliesResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarHTTPTopBrowserFamiliesResponseMetaDateRangeJSON contains the JSON metadata
-// for the struct [RadarHTTPTopBrowserFamiliesResponseMetaDateRange]
-type radarHTTPTopBrowserFamiliesResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPTopBrowserFamiliesResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPTopBrowserFamiliesResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPTopBrowserFamiliesResponseMetaConfidenceInfo struct {
- Annotations []RadarHTTPTopBrowserFamiliesResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarHTTPTopBrowserFamiliesResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarHTTPTopBrowserFamiliesResponseMetaConfidenceInfoJSON contains the JSON
-// metadata for the struct [RadarHTTPTopBrowserFamiliesResponseMetaConfidenceInfo]
-type radarHTTPTopBrowserFamiliesResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPTopBrowserFamiliesResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPTopBrowserFamiliesResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPTopBrowserFamiliesResponseMetaConfidenceInfoAnnotation 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 radarHTTPTopBrowserFamiliesResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarHTTPTopBrowserFamiliesResponseMetaConfidenceInfoAnnotationJSON contains the
-// JSON metadata for the struct
-// [RadarHTTPTopBrowserFamiliesResponseMetaConfidenceInfoAnnotation]
-type radarHTTPTopBrowserFamiliesResponseMetaConfidenceInfoAnnotationJSON 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 *RadarHTTPTopBrowserFamiliesResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPTopBrowserFamiliesResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPTopBrowserFamiliesResponseTop0 struct {
- Name string `json:"name,required"`
- Value string `json:"value,required"`
- JSON radarHTTPTopBrowserFamiliesResponseTop0JSON `json:"-"`
-}
-
-// radarHTTPTopBrowserFamiliesResponseTop0JSON contains the JSON metadata for the
-// struct [RadarHTTPTopBrowserFamiliesResponseTop0]
-type radarHTTPTopBrowserFamiliesResponseTop0JSON struct {
- Name apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPTopBrowserFamiliesResponseTop0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPTopBrowserFamiliesResponseTop0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPTopBrowsersResponse struct {
- Meta RadarHTTPTopBrowsersResponseMeta `json:"meta,required"`
- Top0 []RadarHTTPTopBrowsersResponseTop0 `json:"top_0,required"`
- JSON radarHTTPTopBrowsersResponseJSON `json:"-"`
-}
-
-// radarHTTPTopBrowsersResponseJSON contains the JSON metadata for the struct
-// [RadarHTTPTopBrowsersResponse]
-type radarHTTPTopBrowsersResponseJSON struct {
- Meta apijson.Field
- Top0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPTopBrowsersResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPTopBrowsersResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPTopBrowsersResponseMeta struct {
- DateRange []RadarHTTPTopBrowsersResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- ConfidenceInfo RadarHTTPTopBrowsersResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarHTTPTopBrowsersResponseMetaJSON `json:"-"`
-}
-
-// radarHTTPTopBrowsersResponseMetaJSON contains the JSON metadata for the struct
-// [RadarHTTPTopBrowsersResponseMeta]
-type radarHTTPTopBrowsersResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPTopBrowsersResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPTopBrowsersResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPTopBrowsersResponseMetaDateRange 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 radarHTTPTopBrowsersResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarHTTPTopBrowsersResponseMetaDateRangeJSON contains the JSON metadata for the
-// struct [RadarHTTPTopBrowsersResponseMetaDateRange]
-type radarHTTPTopBrowsersResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPTopBrowsersResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPTopBrowsersResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPTopBrowsersResponseMetaConfidenceInfo struct {
- Annotations []RadarHTTPTopBrowsersResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarHTTPTopBrowsersResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarHTTPTopBrowsersResponseMetaConfidenceInfoJSON contains the JSON metadata
-// for the struct [RadarHTTPTopBrowsersResponseMetaConfidenceInfo]
-type radarHTTPTopBrowsersResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPTopBrowsersResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPTopBrowsersResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPTopBrowsersResponseMetaConfidenceInfoAnnotation 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 radarHTTPTopBrowsersResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarHTTPTopBrowsersResponseMetaConfidenceInfoAnnotationJSON contains the JSON
-// metadata for the struct
-// [RadarHTTPTopBrowsersResponseMetaConfidenceInfoAnnotation]
-type radarHTTPTopBrowsersResponseMetaConfidenceInfoAnnotationJSON 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 *RadarHTTPTopBrowsersResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPTopBrowsersResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPTopBrowsersResponseTop0 struct {
- Name string `json:"name,required"`
- Value string `json:"value,required"`
- JSON radarHTTPTopBrowsersResponseTop0JSON `json:"-"`
-}
-
-// radarHTTPTopBrowsersResponseTop0JSON contains the JSON metadata for the struct
-// [RadarHTTPTopBrowsersResponseTop0]
-type radarHTTPTopBrowsersResponseTop0JSON struct {
- Name apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPTopBrowsersResponseTop0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPTopBrowsersResponseTop0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPTopBrowserFamiliesParams 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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarHTTPTopBrowserFamiliesParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Filter for device type.
- DeviceType param.Field[[]RadarHTTPTopBrowserFamiliesParamsDeviceType] `query:"deviceType"`
- // Format results are returned in.
- Format param.Field[RadarHTTPTopBrowserFamiliesParamsFormat] `query:"format"`
- // Filter for http protocol.
- HTTPProtocol param.Field[[]RadarHTTPTopBrowserFamiliesParamsHTTPProtocol] `query:"httpProtocol"`
- // Filter for http version.
- HTTPVersion param.Field[[]RadarHTTPTopBrowserFamiliesParamsHTTPVersion] `query:"httpVersion"`
- // Filter for ip version.
- IPVersion param.Field[[]RadarHTTPTopBrowserFamiliesParamsIPVersion] `query:"ipVersion"`
- // 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 os name.
- OS param.Field[[]RadarHTTPTopBrowserFamiliesParamsOS] `query:"os"`
- // Filter for tls version.
- TLSVersion param.Field[[]RadarHTTPTopBrowserFamiliesParamsTLSVersion] `query:"tlsVersion"`
-}
-
-// URLQuery serializes [RadarHTTPTopBrowserFamiliesParams]'s query parameters as
-// `url.Values`.
-func (r RadarHTTPTopBrowserFamiliesParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type RadarHTTPTopBrowserFamiliesParamsBotClass string
-
-const (
- RadarHTTPTopBrowserFamiliesParamsBotClassLikelyAutomated RadarHTTPTopBrowserFamiliesParamsBotClass = "LIKELY_AUTOMATED"
- RadarHTTPTopBrowserFamiliesParamsBotClassLikelyHuman RadarHTTPTopBrowserFamiliesParamsBotClass = "LIKELY_HUMAN"
-)
-
-type RadarHTTPTopBrowserFamiliesParamsDateRange string
-
-const (
- RadarHTTPTopBrowserFamiliesParamsDateRange1d RadarHTTPTopBrowserFamiliesParamsDateRange = "1d"
- RadarHTTPTopBrowserFamiliesParamsDateRange2d RadarHTTPTopBrowserFamiliesParamsDateRange = "2d"
- RadarHTTPTopBrowserFamiliesParamsDateRange7d RadarHTTPTopBrowserFamiliesParamsDateRange = "7d"
- RadarHTTPTopBrowserFamiliesParamsDateRange14d RadarHTTPTopBrowserFamiliesParamsDateRange = "14d"
- RadarHTTPTopBrowserFamiliesParamsDateRange28d RadarHTTPTopBrowserFamiliesParamsDateRange = "28d"
- RadarHTTPTopBrowserFamiliesParamsDateRange12w RadarHTTPTopBrowserFamiliesParamsDateRange = "12w"
- RadarHTTPTopBrowserFamiliesParamsDateRange24w RadarHTTPTopBrowserFamiliesParamsDateRange = "24w"
- RadarHTTPTopBrowserFamiliesParamsDateRange52w RadarHTTPTopBrowserFamiliesParamsDateRange = "52w"
- RadarHTTPTopBrowserFamiliesParamsDateRange1dControl RadarHTTPTopBrowserFamiliesParamsDateRange = "1dControl"
- RadarHTTPTopBrowserFamiliesParamsDateRange2dControl RadarHTTPTopBrowserFamiliesParamsDateRange = "2dControl"
- RadarHTTPTopBrowserFamiliesParamsDateRange7dControl RadarHTTPTopBrowserFamiliesParamsDateRange = "7dControl"
- RadarHTTPTopBrowserFamiliesParamsDateRange14dControl RadarHTTPTopBrowserFamiliesParamsDateRange = "14dControl"
- RadarHTTPTopBrowserFamiliesParamsDateRange28dControl RadarHTTPTopBrowserFamiliesParamsDateRange = "28dControl"
- RadarHTTPTopBrowserFamiliesParamsDateRange12wControl RadarHTTPTopBrowserFamiliesParamsDateRange = "12wControl"
- RadarHTTPTopBrowserFamiliesParamsDateRange24wControl RadarHTTPTopBrowserFamiliesParamsDateRange = "24wControl"
-)
-
-type RadarHTTPTopBrowserFamiliesParamsDeviceType string
-
-const (
- RadarHTTPTopBrowserFamiliesParamsDeviceTypeDesktop RadarHTTPTopBrowserFamiliesParamsDeviceType = "DESKTOP"
- RadarHTTPTopBrowserFamiliesParamsDeviceTypeMobile RadarHTTPTopBrowserFamiliesParamsDeviceType = "MOBILE"
- RadarHTTPTopBrowserFamiliesParamsDeviceTypeOther RadarHTTPTopBrowserFamiliesParamsDeviceType = "OTHER"
-)
-
-// Format results are returned in.
-type RadarHTTPTopBrowserFamiliesParamsFormat string
-
-const (
- RadarHTTPTopBrowserFamiliesParamsFormatJson RadarHTTPTopBrowserFamiliesParamsFormat = "JSON"
- RadarHTTPTopBrowserFamiliesParamsFormatCsv RadarHTTPTopBrowserFamiliesParamsFormat = "CSV"
-)
-
-type RadarHTTPTopBrowserFamiliesParamsHTTPProtocol string
-
-const (
- RadarHTTPTopBrowserFamiliesParamsHTTPProtocolHTTP RadarHTTPTopBrowserFamiliesParamsHTTPProtocol = "HTTP"
- RadarHTTPTopBrowserFamiliesParamsHTTPProtocolHTTPS RadarHTTPTopBrowserFamiliesParamsHTTPProtocol = "HTTPS"
-)
-
-type RadarHTTPTopBrowserFamiliesParamsHTTPVersion string
-
-const (
- RadarHTTPTopBrowserFamiliesParamsHTTPVersionHttPv1 RadarHTTPTopBrowserFamiliesParamsHTTPVersion = "HTTPv1"
- RadarHTTPTopBrowserFamiliesParamsHTTPVersionHttPv2 RadarHTTPTopBrowserFamiliesParamsHTTPVersion = "HTTPv2"
- RadarHTTPTopBrowserFamiliesParamsHTTPVersionHttPv3 RadarHTTPTopBrowserFamiliesParamsHTTPVersion = "HTTPv3"
-)
-
-type RadarHTTPTopBrowserFamiliesParamsIPVersion string
-
-const (
- RadarHTTPTopBrowserFamiliesParamsIPVersionIPv4 RadarHTTPTopBrowserFamiliesParamsIPVersion = "IPv4"
- RadarHTTPTopBrowserFamiliesParamsIPVersionIPv6 RadarHTTPTopBrowserFamiliesParamsIPVersion = "IPv6"
-)
-
-type RadarHTTPTopBrowserFamiliesParamsOS string
-
-const (
- RadarHTTPTopBrowserFamiliesParamsOSWindows RadarHTTPTopBrowserFamiliesParamsOS = "WINDOWS"
- RadarHTTPTopBrowserFamiliesParamsOSMacosx RadarHTTPTopBrowserFamiliesParamsOS = "MACOSX"
- RadarHTTPTopBrowserFamiliesParamsOSIos RadarHTTPTopBrowserFamiliesParamsOS = "IOS"
- RadarHTTPTopBrowserFamiliesParamsOSAndroid RadarHTTPTopBrowserFamiliesParamsOS = "ANDROID"
- RadarHTTPTopBrowserFamiliesParamsOSChromeos RadarHTTPTopBrowserFamiliesParamsOS = "CHROMEOS"
- RadarHTTPTopBrowserFamiliesParamsOSLinux RadarHTTPTopBrowserFamiliesParamsOS = "LINUX"
- RadarHTTPTopBrowserFamiliesParamsOSSmartTv RadarHTTPTopBrowserFamiliesParamsOS = "SMART_TV"
-)
-
-type RadarHTTPTopBrowserFamiliesParamsTLSVersion string
-
-const (
- RadarHTTPTopBrowserFamiliesParamsTLSVersionTlSv1_0 RadarHTTPTopBrowserFamiliesParamsTLSVersion = "TLSv1_0"
- RadarHTTPTopBrowserFamiliesParamsTLSVersionTlSv1_1 RadarHTTPTopBrowserFamiliesParamsTLSVersion = "TLSv1_1"
- RadarHTTPTopBrowserFamiliesParamsTLSVersionTlSv1_2 RadarHTTPTopBrowserFamiliesParamsTLSVersion = "TLSv1_2"
- RadarHTTPTopBrowserFamiliesParamsTLSVersionTlSv1_3 RadarHTTPTopBrowserFamiliesParamsTLSVersion = "TLSv1_3"
- RadarHTTPTopBrowserFamiliesParamsTLSVersionTlSvQuic RadarHTTPTopBrowserFamiliesParamsTLSVersion = "TLSvQUIC"
-)
-
-type RadarHTTPTopBrowserFamiliesResponseEnvelope struct {
- Result RadarHTTPTopBrowserFamiliesResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarHTTPTopBrowserFamiliesResponseEnvelopeJSON `json:"-"`
-}
-
-// radarHTTPTopBrowserFamiliesResponseEnvelopeJSON contains the JSON metadata for
-// the struct [RadarHTTPTopBrowserFamiliesResponseEnvelope]
-type radarHTTPTopBrowserFamiliesResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPTopBrowserFamiliesResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPTopBrowserFamiliesResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarHTTPTopBrowsersParams 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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarHTTPTopBrowsersParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Filter for device type.
- DeviceType param.Field[[]RadarHTTPTopBrowsersParamsDeviceType] `query:"deviceType"`
- // Format results are returned in.
- Format param.Field[RadarHTTPTopBrowsersParamsFormat] `query:"format"`
- // Filter for http protocol.
- HTTPProtocol param.Field[[]RadarHTTPTopBrowsersParamsHTTPProtocol] `query:"httpProtocol"`
- // Filter for http version.
- HTTPVersion param.Field[[]RadarHTTPTopBrowsersParamsHTTPVersion] `query:"httpVersion"`
- // Filter for ip version.
- IPVersion param.Field[[]RadarHTTPTopBrowsersParamsIPVersion] `query:"ipVersion"`
- // 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 os name.
- OS param.Field[[]RadarHTTPTopBrowsersParamsOS] `query:"os"`
- // Filter for tls version.
- TLSVersion param.Field[[]RadarHTTPTopBrowsersParamsTLSVersion] `query:"tlsVersion"`
-}
-
-// URLQuery serializes [RadarHTTPTopBrowsersParams]'s query parameters as
-// `url.Values`.
-func (r RadarHTTPTopBrowsersParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type RadarHTTPTopBrowsersParamsBotClass string
-
-const (
- RadarHTTPTopBrowsersParamsBotClassLikelyAutomated RadarHTTPTopBrowsersParamsBotClass = "LIKELY_AUTOMATED"
- RadarHTTPTopBrowsersParamsBotClassLikelyHuman RadarHTTPTopBrowsersParamsBotClass = "LIKELY_HUMAN"
-)
-
-type RadarHTTPTopBrowsersParamsDateRange string
-
-const (
- RadarHTTPTopBrowsersParamsDateRange1d RadarHTTPTopBrowsersParamsDateRange = "1d"
- RadarHTTPTopBrowsersParamsDateRange2d RadarHTTPTopBrowsersParamsDateRange = "2d"
- RadarHTTPTopBrowsersParamsDateRange7d RadarHTTPTopBrowsersParamsDateRange = "7d"
- RadarHTTPTopBrowsersParamsDateRange14d RadarHTTPTopBrowsersParamsDateRange = "14d"
- RadarHTTPTopBrowsersParamsDateRange28d RadarHTTPTopBrowsersParamsDateRange = "28d"
- RadarHTTPTopBrowsersParamsDateRange12w RadarHTTPTopBrowsersParamsDateRange = "12w"
- RadarHTTPTopBrowsersParamsDateRange24w RadarHTTPTopBrowsersParamsDateRange = "24w"
- RadarHTTPTopBrowsersParamsDateRange52w RadarHTTPTopBrowsersParamsDateRange = "52w"
- RadarHTTPTopBrowsersParamsDateRange1dControl RadarHTTPTopBrowsersParamsDateRange = "1dControl"
- RadarHTTPTopBrowsersParamsDateRange2dControl RadarHTTPTopBrowsersParamsDateRange = "2dControl"
- RadarHTTPTopBrowsersParamsDateRange7dControl RadarHTTPTopBrowsersParamsDateRange = "7dControl"
- RadarHTTPTopBrowsersParamsDateRange14dControl RadarHTTPTopBrowsersParamsDateRange = "14dControl"
- RadarHTTPTopBrowsersParamsDateRange28dControl RadarHTTPTopBrowsersParamsDateRange = "28dControl"
- RadarHTTPTopBrowsersParamsDateRange12wControl RadarHTTPTopBrowsersParamsDateRange = "12wControl"
- RadarHTTPTopBrowsersParamsDateRange24wControl RadarHTTPTopBrowsersParamsDateRange = "24wControl"
-)
-
-type RadarHTTPTopBrowsersParamsDeviceType string
-
-const (
- RadarHTTPTopBrowsersParamsDeviceTypeDesktop RadarHTTPTopBrowsersParamsDeviceType = "DESKTOP"
- RadarHTTPTopBrowsersParamsDeviceTypeMobile RadarHTTPTopBrowsersParamsDeviceType = "MOBILE"
- RadarHTTPTopBrowsersParamsDeviceTypeOther RadarHTTPTopBrowsersParamsDeviceType = "OTHER"
-)
-
-// Format results are returned in.
-type RadarHTTPTopBrowsersParamsFormat string
-
-const (
- RadarHTTPTopBrowsersParamsFormatJson RadarHTTPTopBrowsersParamsFormat = "JSON"
- RadarHTTPTopBrowsersParamsFormatCsv RadarHTTPTopBrowsersParamsFormat = "CSV"
-)
-
-type RadarHTTPTopBrowsersParamsHTTPProtocol string
-
-const (
- RadarHTTPTopBrowsersParamsHTTPProtocolHTTP RadarHTTPTopBrowsersParamsHTTPProtocol = "HTTP"
- RadarHTTPTopBrowsersParamsHTTPProtocolHTTPS RadarHTTPTopBrowsersParamsHTTPProtocol = "HTTPS"
-)
-
-type RadarHTTPTopBrowsersParamsHTTPVersion string
-
-const (
- RadarHTTPTopBrowsersParamsHTTPVersionHttPv1 RadarHTTPTopBrowsersParamsHTTPVersion = "HTTPv1"
- RadarHTTPTopBrowsersParamsHTTPVersionHttPv2 RadarHTTPTopBrowsersParamsHTTPVersion = "HTTPv2"
- RadarHTTPTopBrowsersParamsHTTPVersionHttPv3 RadarHTTPTopBrowsersParamsHTTPVersion = "HTTPv3"
-)
-
-type RadarHTTPTopBrowsersParamsIPVersion string
-
-const (
- RadarHTTPTopBrowsersParamsIPVersionIPv4 RadarHTTPTopBrowsersParamsIPVersion = "IPv4"
- RadarHTTPTopBrowsersParamsIPVersionIPv6 RadarHTTPTopBrowsersParamsIPVersion = "IPv6"
-)
-
-type RadarHTTPTopBrowsersParamsOS string
-
-const (
- RadarHTTPTopBrowsersParamsOSWindows RadarHTTPTopBrowsersParamsOS = "WINDOWS"
- RadarHTTPTopBrowsersParamsOSMacosx RadarHTTPTopBrowsersParamsOS = "MACOSX"
- RadarHTTPTopBrowsersParamsOSIos RadarHTTPTopBrowsersParamsOS = "IOS"
- RadarHTTPTopBrowsersParamsOSAndroid RadarHTTPTopBrowsersParamsOS = "ANDROID"
- RadarHTTPTopBrowsersParamsOSChromeos RadarHTTPTopBrowsersParamsOS = "CHROMEOS"
- RadarHTTPTopBrowsersParamsOSLinux RadarHTTPTopBrowsersParamsOS = "LINUX"
- RadarHTTPTopBrowsersParamsOSSmartTv RadarHTTPTopBrowsersParamsOS = "SMART_TV"
-)
-
-type RadarHTTPTopBrowsersParamsTLSVersion string
-
-const (
- RadarHTTPTopBrowsersParamsTLSVersionTlSv1_0 RadarHTTPTopBrowsersParamsTLSVersion = "TLSv1_0"
- RadarHTTPTopBrowsersParamsTLSVersionTlSv1_1 RadarHTTPTopBrowsersParamsTLSVersion = "TLSv1_1"
- RadarHTTPTopBrowsersParamsTLSVersionTlSv1_2 RadarHTTPTopBrowsersParamsTLSVersion = "TLSv1_2"
- RadarHTTPTopBrowsersParamsTLSVersionTlSv1_3 RadarHTTPTopBrowsersParamsTLSVersion = "TLSv1_3"
- RadarHTTPTopBrowsersParamsTLSVersionTlSvQuic RadarHTTPTopBrowsersParamsTLSVersion = "TLSvQUIC"
-)
-
-type RadarHTTPTopBrowsersResponseEnvelope struct {
- Result RadarHTTPTopBrowsersResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarHTTPTopBrowsersResponseEnvelopeJSON `json:"-"`
-}
-
-// radarHTTPTopBrowsersResponseEnvelopeJSON contains the JSON metadata for the
-// struct [RadarHTTPTopBrowsersResponseEnvelope]
-type radarHTTPTopBrowsersResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarHTTPTopBrowsersResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarHTTPTopBrowsersResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
diff --git a/radarhttptop_test.go b/radarhttptop_test.go
deleted file mode 100644
index 87f8e298ffc..00000000000
--- a/radarhttptop_test.go
+++ /dev/null
@@ -1,97 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
- "time"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRadarHTTPTopBrowserFamiliesWithOptionalParams(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"),
- )
- _, 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()}),
- DeviceType: cloudflare.F([]cloudflare.RadarHTTPTopBrowserFamiliesParamsDeviceType{cloudflare.RadarHTTPTopBrowserFamiliesParamsDeviceTypeDesktop, cloudflare.RadarHTTPTopBrowserFamiliesParamsDeviceTypeMobile, cloudflare.RadarHTTPTopBrowserFamiliesParamsDeviceTypeOther}),
- Format: cloudflare.F(cloudflare.RadarHTTPTopBrowserFamiliesParamsFormatJson),
- HTTPProtocol: cloudflare.F([]cloudflare.RadarHTTPTopBrowserFamiliesParamsHTTPProtocol{cloudflare.RadarHTTPTopBrowserFamiliesParamsHTTPProtocolHTTP, cloudflare.RadarHTTPTopBrowserFamiliesParamsHTTPProtocolHTTPS}),
- HTTPVersion: cloudflare.F([]cloudflare.RadarHTTPTopBrowserFamiliesParamsHTTPVersion{cloudflare.RadarHTTPTopBrowserFamiliesParamsHTTPVersionHttPv1, cloudflare.RadarHTTPTopBrowserFamiliesParamsHTTPVersionHttPv2, cloudflare.RadarHTTPTopBrowserFamiliesParamsHTTPVersionHttPv3}),
- IPVersion: cloudflare.F([]cloudflare.RadarHTTPTopBrowserFamiliesParamsIPVersion{cloudflare.RadarHTTPTopBrowserFamiliesParamsIPVersionIPv4, cloudflare.RadarHTTPTopBrowserFamiliesParamsIPVersionIPv6}),
- Limit: cloudflare.F(int64(5)),
- Location: cloudflare.F([]string{"string", "string", "string"}),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- OS: cloudflare.F([]cloudflare.RadarHTTPTopBrowserFamiliesParamsOS{cloudflare.RadarHTTPTopBrowserFamiliesParamsOSWindows, cloudflare.RadarHTTPTopBrowserFamiliesParamsOSMacosx, cloudflare.RadarHTTPTopBrowserFamiliesParamsOSIos}),
- TLSVersion: cloudflare.F([]cloudflare.RadarHTTPTopBrowserFamiliesParamsTLSVersion{cloudflare.RadarHTTPTopBrowserFamiliesParamsTLSVersionTlSv1_0, cloudflare.RadarHTTPTopBrowserFamiliesParamsTLSVersionTlSv1_1, cloudflare.RadarHTTPTopBrowserFamiliesParamsTLSVersionTlSv1_2}),
- })
- 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())
- }
-}
-
-func TestRadarHTTPTopBrowsersWithOptionalParams(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"),
- )
- _, 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()}),
- DeviceType: cloudflare.F([]cloudflare.RadarHTTPTopBrowsersParamsDeviceType{cloudflare.RadarHTTPTopBrowsersParamsDeviceTypeDesktop, cloudflare.RadarHTTPTopBrowsersParamsDeviceTypeMobile, cloudflare.RadarHTTPTopBrowsersParamsDeviceTypeOther}),
- Format: cloudflare.F(cloudflare.RadarHTTPTopBrowsersParamsFormatJson),
- HTTPProtocol: cloudflare.F([]cloudflare.RadarHTTPTopBrowsersParamsHTTPProtocol{cloudflare.RadarHTTPTopBrowsersParamsHTTPProtocolHTTP, cloudflare.RadarHTTPTopBrowsersParamsHTTPProtocolHTTPS}),
- HTTPVersion: cloudflare.F([]cloudflare.RadarHTTPTopBrowsersParamsHTTPVersion{cloudflare.RadarHTTPTopBrowsersParamsHTTPVersionHttPv1, cloudflare.RadarHTTPTopBrowsersParamsHTTPVersionHttPv2, cloudflare.RadarHTTPTopBrowsersParamsHTTPVersionHttPv3}),
- IPVersion: cloudflare.F([]cloudflare.RadarHTTPTopBrowsersParamsIPVersion{cloudflare.RadarHTTPTopBrowsersParamsIPVersionIPv4, cloudflare.RadarHTTPTopBrowsersParamsIPVersionIPv6}),
- Limit: cloudflare.F(int64(5)),
- Location: cloudflare.F([]string{"string", "string", "string"}),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- OS: cloudflare.F([]cloudflare.RadarHTTPTopBrowsersParamsOS{cloudflare.RadarHTTPTopBrowsersParamsOSWindows, cloudflare.RadarHTTPTopBrowsersParamsOSMacosx, cloudflare.RadarHTTPTopBrowsersParamsOSIos}),
- TLSVersion: cloudflare.F([]cloudflare.RadarHTTPTopBrowsersParamsTLSVersion{cloudflare.RadarHTTPTopBrowsersParamsTLSVersionTlSv1_0, cloudflare.RadarHTTPTopBrowsersParamsTLSVersionTlSv1_1, cloudflare.RadarHTTPTopBrowsersParamsTLSVersionTlSv1_2}),
- })
- 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/radarnetflow.go b/radarnetflow.go
deleted file mode 100644
index 44d586f0e7f..00000000000
--- a/radarnetflow.go
+++ /dev/null
@@ -1,329 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarNetflowService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewRadarNetflowService] method
-// instead.
-type RadarNetflowService struct {
- Options []option.RequestOption
- Top *RadarNetflowTopService
-}
-
-// NewRadarNetflowService generates a new service that applies the given options to
-// each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewRadarNetflowService(opts ...option.RequestOption) (r *RadarNetflowService) {
- r = &RadarNetflowService{}
- r.Options = opts
- r.Top = NewRadarNetflowTopService(opts...)
- return
-}
-
-// Get network traffic change over time. Visit
-// https://en.wikipedia.org/wiki/NetFlow for more information on NetFlows.
-func (r *RadarNetflowService) Timeseries(ctx context.Context, query RadarNetflowTimeseriesParams, opts ...option.RequestOption) (res *RadarNetflowTimeseriesResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarNetflowTimeseriesResponseEnvelope
- path := "radar/netflows/timeseries"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type RadarNetflowTimeseriesResponse struct {
- Meta RadarNetflowTimeseriesResponseMeta `json:"meta,required"`
- Serie0 RadarNetflowTimeseriesResponseSerie0 `json:"serie_0,required"`
- JSON radarNetflowTimeseriesResponseJSON `json:"-"`
-}
-
-// radarNetflowTimeseriesResponseJSON contains the JSON metadata for the struct
-// [RadarNetflowTimeseriesResponse]
-type radarNetflowTimeseriesResponseJSON struct {
- Meta apijson.Field
- Serie0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarNetflowTimeseriesResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarNetflowTimeseriesResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarNetflowTimeseriesResponseMeta struct {
- AggInterval string `json:"aggInterval,required"`
- DateRange []RadarNetflowTimeseriesResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated time.Time `json:"lastUpdated,required" format:"date-time"`
- ConfidenceInfo RadarNetflowTimeseriesResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarNetflowTimeseriesResponseMetaJSON `json:"-"`
-}
-
-// radarNetflowTimeseriesResponseMetaJSON contains the JSON metadata for the struct
-// [RadarNetflowTimeseriesResponseMeta]
-type radarNetflowTimeseriesResponseMetaJSON struct {
- AggInterval apijson.Field
- DateRange apijson.Field
- LastUpdated apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarNetflowTimeseriesResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarNetflowTimeseriesResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarNetflowTimeseriesResponseMetaDateRange 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 radarNetflowTimeseriesResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarNetflowTimeseriesResponseMetaDateRangeJSON contains the JSON metadata for
-// the struct [RadarNetflowTimeseriesResponseMetaDateRange]
-type radarNetflowTimeseriesResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarNetflowTimeseriesResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarNetflowTimeseriesResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarNetflowTimeseriesResponseMetaConfidenceInfo struct {
- Annotations []RadarNetflowTimeseriesResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarNetflowTimeseriesResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarNetflowTimeseriesResponseMetaConfidenceInfoJSON contains the JSON metadata
-// for the struct [RadarNetflowTimeseriesResponseMetaConfidenceInfo]
-type radarNetflowTimeseriesResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarNetflowTimeseriesResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarNetflowTimeseriesResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarNetflowTimeseriesResponseMetaConfidenceInfoAnnotation 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 radarNetflowTimeseriesResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarNetflowTimeseriesResponseMetaConfidenceInfoAnnotationJSON contains the JSON
-// metadata for the struct
-// [RadarNetflowTimeseriesResponseMetaConfidenceInfoAnnotation]
-type radarNetflowTimeseriesResponseMetaConfidenceInfoAnnotationJSON 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 *RadarNetflowTimeseriesResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarNetflowTimeseriesResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarNetflowTimeseriesResponseSerie0 struct {
- Timestamps []time.Time `json:"timestamps,required" format:"date-time"`
- Values []string `json:"values,required"`
- JSON radarNetflowTimeseriesResponseSerie0JSON `json:"-"`
-}
-
-// radarNetflowTimeseriesResponseSerie0JSON contains the JSON metadata for the
-// struct [RadarNetflowTimeseriesResponseSerie0]
-type radarNetflowTimeseriesResponseSerie0JSON struct {
- Timestamps apijson.Field
- Values apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarNetflowTimeseriesResponseSerie0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarNetflowTimeseriesResponseSerie0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarNetflowTimeseriesParams struct {
- // Aggregation interval results should be returned in (for example, in 15 minutes
- // or 1 hour intervals). Refer to
- // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
- AggInterval param.Field[RadarNetflowTimeseriesParamsAggInterval] `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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarNetflowTimeseriesParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Format results are returned in.
- Format param.Field[RadarNetflowTimeseriesParamsFormat] `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"`
- // Normalization method applied. Refer to
- // [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/).
- Normalization param.Field[RadarNetflowTimeseriesParamsNormalization] `query:"normalization"`
- // Array of network traffic product types.
- Product param.Field[[]RadarNetflowTimeseriesParamsProduct] `query:"product"`
-}
-
-// URLQuery serializes [RadarNetflowTimeseriesParams]'s query parameters as
-// `url.Values`.
-func (r RadarNetflowTimeseriesParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Aggregation interval results should be returned in (for example, in 15 minutes
-// or 1 hour intervals). Refer to
-// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
-type RadarNetflowTimeseriesParamsAggInterval string
-
-const (
- RadarNetflowTimeseriesParamsAggInterval15m RadarNetflowTimeseriesParamsAggInterval = "15m"
- RadarNetflowTimeseriesParamsAggInterval1h RadarNetflowTimeseriesParamsAggInterval = "1h"
- RadarNetflowTimeseriesParamsAggInterval1d RadarNetflowTimeseriesParamsAggInterval = "1d"
- RadarNetflowTimeseriesParamsAggInterval1w RadarNetflowTimeseriesParamsAggInterval = "1w"
-)
-
-type RadarNetflowTimeseriesParamsDateRange string
-
-const (
- RadarNetflowTimeseriesParamsDateRange1d RadarNetflowTimeseriesParamsDateRange = "1d"
- RadarNetflowTimeseriesParamsDateRange2d RadarNetflowTimeseriesParamsDateRange = "2d"
- RadarNetflowTimeseriesParamsDateRange7d RadarNetflowTimeseriesParamsDateRange = "7d"
- RadarNetflowTimeseriesParamsDateRange14d RadarNetflowTimeseriesParamsDateRange = "14d"
- RadarNetflowTimeseriesParamsDateRange28d RadarNetflowTimeseriesParamsDateRange = "28d"
- RadarNetflowTimeseriesParamsDateRange12w RadarNetflowTimeseriesParamsDateRange = "12w"
- RadarNetflowTimeseriesParamsDateRange24w RadarNetflowTimeseriesParamsDateRange = "24w"
- RadarNetflowTimeseriesParamsDateRange52w RadarNetflowTimeseriesParamsDateRange = "52w"
- RadarNetflowTimeseriesParamsDateRange1dControl RadarNetflowTimeseriesParamsDateRange = "1dControl"
- RadarNetflowTimeseriesParamsDateRange2dControl RadarNetflowTimeseriesParamsDateRange = "2dControl"
- RadarNetflowTimeseriesParamsDateRange7dControl RadarNetflowTimeseriesParamsDateRange = "7dControl"
- RadarNetflowTimeseriesParamsDateRange14dControl RadarNetflowTimeseriesParamsDateRange = "14dControl"
- RadarNetflowTimeseriesParamsDateRange28dControl RadarNetflowTimeseriesParamsDateRange = "28dControl"
- RadarNetflowTimeseriesParamsDateRange12wControl RadarNetflowTimeseriesParamsDateRange = "12wControl"
- RadarNetflowTimeseriesParamsDateRange24wControl RadarNetflowTimeseriesParamsDateRange = "24wControl"
-)
-
-// Format results are returned in.
-type RadarNetflowTimeseriesParamsFormat string
-
-const (
- RadarNetflowTimeseriesParamsFormatJson RadarNetflowTimeseriesParamsFormat = "JSON"
- RadarNetflowTimeseriesParamsFormatCsv RadarNetflowTimeseriesParamsFormat = "CSV"
-)
-
-// Normalization method applied. Refer to
-// [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/).
-type RadarNetflowTimeseriesParamsNormalization string
-
-const (
- RadarNetflowTimeseriesParamsNormalizationPercentageChange RadarNetflowTimeseriesParamsNormalization = "PERCENTAGE_CHANGE"
- RadarNetflowTimeseriesParamsNormalizationMin0Max RadarNetflowTimeseriesParamsNormalization = "MIN0_MAX"
-)
-
-type RadarNetflowTimeseriesParamsProduct string
-
-const (
- RadarNetflowTimeseriesParamsProductHTTP RadarNetflowTimeseriesParamsProduct = "HTTP"
- RadarNetflowTimeseriesParamsProductAll RadarNetflowTimeseriesParamsProduct = "ALL"
-)
-
-type RadarNetflowTimeseriesResponseEnvelope struct {
- Result RadarNetflowTimeseriesResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarNetflowTimeseriesResponseEnvelopeJSON `json:"-"`
-}
-
-// radarNetflowTimeseriesResponseEnvelopeJSON contains the JSON metadata for the
-// struct [RadarNetflowTimeseriesResponseEnvelope]
-type radarNetflowTimeseriesResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarNetflowTimeseriesResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarNetflowTimeseriesResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
diff --git a/radarnetflow_test.go b/radarnetflow_test.go
deleted file mode 100644
index f824c9f19f7..00000000000
--- a/radarnetflow_test.go
+++ /dev/null
@@ -1,51 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
- "time"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRadarNetflowTimeseriesWithOptionalParams(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"),
- )
- _, 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()}),
- Format: cloudflare.F(cloudflare.RadarNetflowTimeseriesParamsFormatJson),
- Location: cloudflare.F([]string{"string", "string", "string"}),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- Normalization: cloudflare.F(cloudflare.RadarNetflowTimeseriesParamsNormalizationMin0Max),
- Product: cloudflare.F([]cloudflare.RadarNetflowTimeseriesParamsProduct{cloudflare.RadarNetflowTimeseriesParamsProductHTTP, cloudflare.RadarNetflowTimeseriesParamsProductAll}),
- })
- 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/radarnetflowtop.go b/radarnetflowtop.go
deleted file mode 100644
index f30217ffd6e..00000000000
--- a/radarnetflowtop.go
+++ /dev/null
@@ -1,332 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarNetflowTopService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewRadarNetflowTopService] method
-// instead.
-type RadarNetflowTopService struct {
- Options []option.RequestOption
-}
-
-// NewRadarNetflowTopService generates a new service that applies the given options
-// to each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewRadarNetflowTopService(opts ...option.RequestOption) (r *RadarNetflowTopService) {
- r = &RadarNetflowTopService{}
- r.Options = opts
- return
-}
-
-// Get the top autonomous systems (AS) by network traffic (NetFlows) over a given
-// time period. Visit https://en.wikipedia.org/wiki/NetFlow for more information.
-func (r *RadarNetflowTopService) Ases(ctx context.Context, query RadarNetflowTopAsesParams, opts ...option.RequestOption) (res *RadarNetflowTopAsesResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarNetflowTopAsesResponseEnvelope
- path := "radar/netflows/top/ases"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Get the top locations by network traffic (NetFlows) over a given time period.
-// Visit https://en.wikipedia.org/wiki/NetFlow for more information.
-func (r *RadarNetflowTopService) Locations(ctx context.Context, query RadarNetflowTopLocationsParams, opts ...option.RequestOption) (res *RadarNetflowTopLocationsResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarNetflowTopLocationsResponseEnvelope
- path := "radar/netflows/top/locations"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type RadarNetflowTopAsesResponse struct {
- Top0 []RadarNetflowTopAsesResponseTop0 `json:"top_0,required"`
- JSON radarNetflowTopAsesResponseJSON `json:"-"`
-}
-
-// radarNetflowTopAsesResponseJSON contains the JSON metadata for the struct
-// [RadarNetflowTopAsesResponse]
-type radarNetflowTopAsesResponseJSON struct {
- Top0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarNetflowTopAsesResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarNetflowTopAsesResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarNetflowTopAsesResponseTop0 struct {
- ClientASN float64 `json:"clientASN,required"`
- ClientAsName string `json:"clientASName,required"`
- Value string `json:"value,required"`
- JSON radarNetflowTopAsesResponseTop0JSON `json:"-"`
-}
-
-// radarNetflowTopAsesResponseTop0JSON contains the JSON metadata for the struct
-// [RadarNetflowTopAsesResponseTop0]
-type radarNetflowTopAsesResponseTop0JSON struct {
- ClientASN apijson.Field
- ClientAsName apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarNetflowTopAsesResponseTop0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarNetflowTopAsesResponseTop0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarNetflowTopLocationsResponse struct {
- Top0 []RadarNetflowTopLocationsResponseTop0 `json:"top_0,required"`
- JSON radarNetflowTopLocationsResponseJSON `json:"-"`
-}
-
-// radarNetflowTopLocationsResponseJSON contains the JSON metadata for the struct
-// [RadarNetflowTopLocationsResponse]
-type radarNetflowTopLocationsResponseJSON struct {
- Top0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarNetflowTopLocationsResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarNetflowTopLocationsResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarNetflowTopLocationsResponseTop0 struct {
- ClientCountryAlpha2 string `json:"clientCountryAlpha2,required"`
- ClientCountryName string `json:"clientCountryName,required"`
- Value string `json:"value,required"`
- JSON radarNetflowTopLocationsResponseTop0JSON `json:"-"`
-}
-
-// radarNetflowTopLocationsResponseTop0JSON contains the JSON metadata for the
-// struct [RadarNetflowTopLocationsResponseTop0]
-type radarNetflowTopLocationsResponseTop0JSON struct {
- ClientCountryAlpha2 apijson.Field
- ClientCountryName apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarNetflowTopLocationsResponseTop0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarNetflowTopLocationsResponseTop0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarNetflowTopAsesParams 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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarNetflowTopAsesParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Format results are returned in.
- Format param.Field[RadarNetflowTopAsesParamsFormat] `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 [RadarNetflowTopAsesParams]'s query parameters as
-// `url.Values`.
-func (r RadarNetflowTopAsesParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type RadarNetflowTopAsesParamsDateRange string
-
-const (
- RadarNetflowTopAsesParamsDateRange1d RadarNetflowTopAsesParamsDateRange = "1d"
- RadarNetflowTopAsesParamsDateRange2d RadarNetflowTopAsesParamsDateRange = "2d"
- RadarNetflowTopAsesParamsDateRange7d RadarNetflowTopAsesParamsDateRange = "7d"
- RadarNetflowTopAsesParamsDateRange14d RadarNetflowTopAsesParamsDateRange = "14d"
- RadarNetflowTopAsesParamsDateRange28d RadarNetflowTopAsesParamsDateRange = "28d"
- RadarNetflowTopAsesParamsDateRange12w RadarNetflowTopAsesParamsDateRange = "12w"
- RadarNetflowTopAsesParamsDateRange24w RadarNetflowTopAsesParamsDateRange = "24w"
- RadarNetflowTopAsesParamsDateRange52w RadarNetflowTopAsesParamsDateRange = "52w"
- RadarNetflowTopAsesParamsDateRange1dControl RadarNetflowTopAsesParamsDateRange = "1dControl"
- RadarNetflowTopAsesParamsDateRange2dControl RadarNetflowTopAsesParamsDateRange = "2dControl"
- RadarNetflowTopAsesParamsDateRange7dControl RadarNetflowTopAsesParamsDateRange = "7dControl"
- RadarNetflowTopAsesParamsDateRange14dControl RadarNetflowTopAsesParamsDateRange = "14dControl"
- RadarNetflowTopAsesParamsDateRange28dControl RadarNetflowTopAsesParamsDateRange = "28dControl"
- RadarNetflowTopAsesParamsDateRange12wControl RadarNetflowTopAsesParamsDateRange = "12wControl"
- RadarNetflowTopAsesParamsDateRange24wControl RadarNetflowTopAsesParamsDateRange = "24wControl"
-)
-
-// Format results are returned in.
-type RadarNetflowTopAsesParamsFormat string
-
-const (
- RadarNetflowTopAsesParamsFormatJson RadarNetflowTopAsesParamsFormat = "JSON"
- RadarNetflowTopAsesParamsFormatCsv RadarNetflowTopAsesParamsFormat = "CSV"
-)
-
-type RadarNetflowTopAsesResponseEnvelope struct {
- Result RadarNetflowTopAsesResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarNetflowTopAsesResponseEnvelopeJSON `json:"-"`
-}
-
-// radarNetflowTopAsesResponseEnvelopeJSON contains the JSON metadata for the
-// struct [RadarNetflowTopAsesResponseEnvelope]
-type radarNetflowTopAsesResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarNetflowTopAsesResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarNetflowTopAsesResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarNetflowTopLocationsParams 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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarNetflowTopLocationsParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Format results are returned in.
- Format param.Field[RadarNetflowTopLocationsParamsFormat] `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 [RadarNetflowTopLocationsParams]'s query parameters as
-// `url.Values`.
-func (r RadarNetflowTopLocationsParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type RadarNetflowTopLocationsParamsDateRange string
-
-const (
- RadarNetflowTopLocationsParamsDateRange1d RadarNetflowTopLocationsParamsDateRange = "1d"
- RadarNetflowTopLocationsParamsDateRange2d RadarNetflowTopLocationsParamsDateRange = "2d"
- RadarNetflowTopLocationsParamsDateRange7d RadarNetflowTopLocationsParamsDateRange = "7d"
- RadarNetflowTopLocationsParamsDateRange14d RadarNetflowTopLocationsParamsDateRange = "14d"
- RadarNetflowTopLocationsParamsDateRange28d RadarNetflowTopLocationsParamsDateRange = "28d"
- RadarNetflowTopLocationsParamsDateRange12w RadarNetflowTopLocationsParamsDateRange = "12w"
- RadarNetflowTopLocationsParamsDateRange24w RadarNetflowTopLocationsParamsDateRange = "24w"
- RadarNetflowTopLocationsParamsDateRange52w RadarNetflowTopLocationsParamsDateRange = "52w"
- RadarNetflowTopLocationsParamsDateRange1dControl RadarNetflowTopLocationsParamsDateRange = "1dControl"
- RadarNetflowTopLocationsParamsDateRange2dControl RadarNetflowTopLocationsParamsDateRange = "2dControl"
- RadarNetflowTopLocationsParamsDateRange7dControl RadarNetflowTopLocationsParamsDateRange = "7dControl"
- RadarNetflowTopLocationsParamsDateRange14dControl RadarNetflowTopLocationsParamsDateRange = "14dControl"
- RadarNetflowTopLocationsParamsDateRange28dControl RadarNetflowTopLocationsParamsDateRange = "28dControl"
- RadarNetflowTopLocationsParamsDateRange12wControl RadarNetflowTopLocationsParamsDateRange = "12wControl"
- RadarNetflowTopLocationsParamsDateRange24wControl RadarNetflowTopLocationsParamsDateRange = "24wControl"
-)
-
-// Format results are returned in.
-type RadarNetflowTopLocationsParamsFormat string
-
-const (
- RadarNetflowTopLocationsParamsFormatJson RadarNetflowTopLocationsParamsFormat = "JSON"
- RadarNetflowTopLocationsParamsFormatCsv RadarNetflowTopLocationsParamsFormat = "CSV"
-)
-
-type RadarNetflowTopLocationsResponseEnvelope struct {
- Result RadarNetflowTopLocationsResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarNetflowTopLocationsResponseEnvelopeJSON `json:"-"`
-}
-
-// radarNetflowTopLocationsResponseEnvelopeJSON contains the JSON metadata for the
-// struct [RadarNetflowTopLocationsResponseEnvelope]
-type radarNetflowTopLocationsResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarNetflowTopLocationsResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarNetflowTopLocationsResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
diff --git a/radarnetflowtop_test.go b/radarnetflowtop_test.go
deleted file mode 100644
index 82345fd4050..00000000000
--- a/radarnetflowtop_test.go
+++ /dev/null
@@ -1,83 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
- "time"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRadarNetflowTopAsesWithOptionalParams(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"),
- )
- _, 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()}),
- Format: cloudflare.F(cloudflare.RadarNetflowTopAsesParamsFormatJson),
- 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())
- }
-}
-
-func TestRadarNetflowTopLocationsWithOptionalParams(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"),
- )
- _, 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()}),
- Format: cloudflare.F(cloudflare.RadarNetflowTopLocationsParamsFormatJson),
- 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/radarquality.go b/radarquality.go
deleted file mode 100644
index fc847049da8..00000000000
--- a/radarquality.go
+++ /dev/null
@@ -1,29 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarQualityService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewRadarQualityService] method
-// instead.
-type RadarQualityService struct {
- Options []option.RequestOption
- IQI *RadarQualityIQIService
- Speed *RadarQualitySpeedService
-}
-
-// NewRadarQualityService generates a new service that applies the given options to
-// each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewRadarQualityService(opts ...option.RequestOption) (r *RadarQualityService) {
- r = &RadarQualityService{}
- r.Options = opts
- r.IQI = NewRadarQualityIQIService(opts...)
- r.Speed = NewRadarQualitySpeedService(opts...)
- return
-}
diff --git a/radarqualityiqi.go b/radarqualityiqi.go
deleted file mode 100644
index 4d507da9aad..00000000000
--- a/radarqualityiqi.go
+++ /dev/null
@@ -1,483 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarQualityIQIService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewRadarQualityIQIService] method
-// instead.
-type RadarQualityIQIService struct {
- Options []option.RequestOption
-}
-
-// NewRadarQualityIQIService generates a new service that applies the given options
-// to each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewRadarQualityIQIService(opts ...option.RequestOption) (r *RadarQualityIQIService) {
- r = &RadarQualityIQIService{}
- r.Options = opts
- return
-}
-
-// Get a summary (percentiles) of bandwidth, latency or DNS response time from the
-// Radar Internet Quality Index (IQI).
-func (r *RadarQualityIQIService) Summary(ctx context.Context, query RadarQualityIQISummaryParams, opts ...option.RequestOption) (res *RadarQualityIQISummaryResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarQualityIQISummaryResponseEnvelope
- path := "radar/quality/iqi/summary"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Get a time series (percentiles) of bandwidth, latency or DNS response time from
-// the Radar Internet Quality Index (IQI).
-func (r *RadarQualityIQIService) TimeseriesGroups(ctx context.Context, query RadarQualityIQITimeseriesGroupsParams, opts ...option.RequestOption) (res *RadarQualityIQITimeseriesGroupsResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarQualityIQITimeseriesGroupsResponseEnvelope
- path := "radar/quality/iqi/timeseries_groups"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type RadarQualityIQISummaryResponse struct {
- Meta RadarQualityIQISummaryResponseMeta `json:"meta,required"`
- Summary0 RadarQualityIQISummaryResponseSummary0 `json:"summary_0,required"`
- JSON radarQualityIQISummaryResponseJSON `json:"-"`
-}
-
-// radarQualityIQISummaryResponseJSON contains the JSON metadata for the struct
-// [RadarQualityIQISummaryResponse]
-type radarQualityIQISummaryResponseJSON struct {
- Meta apijson.Field
- Summary0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarQualityIQISummaryResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarQualityIQISummaryResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarQualityIQISummaryResponseMeta struct {
- DateRange []RadarQualityIQISummaryResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- Normalization string `json:"normalization,required"`
- ConfidenceInfo RadarQualityIQISummaryResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarQualityIQISummaryResponseMetaJSON `json:"-"`
-}
-
-// radarQualityIQISummaryResponseMetaJSON contains the JSON metadata for the struct
-// [RadarQualityIQISummaryResponseMeta]
-type radarQualityIQISummaryResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- Normalization apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarQualityIQISummaryResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarQualityIQISummaryResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarQualityIQISummaryResponseMetaDateRange 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 radarQualityIQISummaryResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarQualityIQISummaryResponseMetaDateRangeJSON contains the JSON metadata for
-// the struct [RadarQualityIQISummaryResponseMetaDateRange]
-type radarQualityIQISummaryResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarQualityIQISummaryResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarQualityIQISummaryResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarQualityIQISummaryResponseMetaConfidenceInfo struct {
- Annotations []RadarQualityIQISummaryResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarQualityIQISummaryResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarQualityIQISummaryResponseMetaConfidenceInfoJSON contains the JSON metadata
-// for the struct [RadarQualityIQISummaryResponseMetaConfidenceInfo]
-type radarQualityIQISummaryResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarQualityIQISummaryResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarQualityIQISummaryResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarQualityIQISummaryResponseMetaConfidenceInfoAnnotation 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 radarQualityIQISummaryResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarQualityIQISummaryResponseMetaConfidenceInfoAnnotationJSON contains the JSON
-// metadata for the struct
-// [RadarQualityIQISummaryResponseMetaConfidenceInfoAnnotation]
-type radarQualityIQISummaryResponseMetaConfidenceInfoAnnotationJSON 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 *RadarQualityIQISummaryResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarQualityIQISummaryResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarQualityIQISummaryResponseSummary0 struct {
- P25 string `json:"p25,required"`
- P50 string `json:"p50,required"`
- P75 string `json:"p75,required"`
- JSON radarQualityIQISummaryResponseSummary0JSON `json:"-"`
-}
-
-// radarQualityIQISummaryResponseSummary0JSON contains the JSON metadata for the
-// struct [RadarQualityIQISummaryResponseSummary0]
-type radarQualityIQISummaryResponseSummary0JSON struct {
- P25 apijson.Field
- P50 apijson.Field
- P75 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarQualityIQISummaryResponseSummary0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarQualityIQISummaryResponseSummary0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarQualityIQITimeseriesGroupsResponse struct {
- Meta interface{} `json:"meta,required"`
- Serie0 RadarQualityIQITimeseriesGroupsResponseSerie0 `json:"serie_0,required"`
- JSON radarQualityIQITimeseriesGroupsResponseJSON `json:"-"`
-}
-
-// radarQualityIQITimeseriesGroupsResponseJSON contains the JSON metadata for the
-// struct [RadarQualityIQITimeseriesGroupsResponse]
-type radarQualityIQITimeseriesGroupsResponseJSON struct {
- Meta apijson.Field
- Serie0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarQualityIQITimeseriesGroupsResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarQualityIQITimeseriesGroupsResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarQualityIQITimeseriesGroupsResponseSerie0 struct {
- P25 []string `json:"p25,required"`
- P50 []string `json:"p50,required"`
- P75 []string `json:"p75,required"`
- Timestamps []string `json:"timestamps,required"`
- JSON radarQualityIQITimeseriesGroupsResponseSerie0JSON `json:"-"`
-}
-
-// radarQualityIQITimeseriesGroupsResponseSerie0JSON contains the JSON metadata for
-// the struct [RadarQualityIQITimeseriesGroupsResponseSerie0]
-type radarQualityIQITimeseriesGroupsResponseSerie0JSON struct {
- P25 apijson.Field
- P50 apijson.Field
- P75 apijson.Field
- Timestamps apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarQualityIQITimeseriesGroupsResponseSerie0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarQualityIQITimeseriesGroupsResponseSerie0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarQualityIQISummaryParams struct {
- // Which metric to return: bandwidth, latency or DNS response time.
- Metric param.Field[RadarQualityIQISummaryParamsMetric] `query:"metric,required"`
- // 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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarQualityIQISummaryParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Format results are returned in.
- Format param.Field[RadarQualityIQISummaryParamsFormat] `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"`
-}
-
-// URLQuery serializes [RadarQualityIQISummaryParams]'s query parameters as
-// `url.Values`.
-func (r RadarQualityIQISummaryParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Which metric to return: bandwidth, latency or DNS response time.
-type RadarQualityIQISummaryParamsMetric string
-
-const (
- RadarQualityIQISummaryParamsMetricBandwidth RadarQualityIQISummaryParamsMetric = "BANDWIDTH"
- RadarQualityIQISummaryParamsMetricDNS RadarQualityIQISummaryParamsMetric = "DNS"
- RadarQualityIQISummaryParamsMetricLatency RadarQualityIQISummaryParamsMetric = "LATENCY"
-)
-
-type RadarQualityIQISummaryParamsDateRange string
-
-const (
- RadarQualityIQISummaryParamsDateRange1d RadarQualityIQISummaryParamsDateRange = "1d"
- RadarQualityIQISummaryParamsDateRange2d RadarQualityIQISummaryParamsDateRange = "2d"
- RadarQualityIQISummaryParamsDateRange7d RadarQualityIQISummaryParamsDateRange = "7d"
- RadarQualityIQISummaryParamsDateRange14d RadarQualityIQISummaryParamsDateRange = "14d"
- RadarQualityIQISummaryParamsDateRange28d RadarQualityIQISummaryParamsDateRange = "28d"
- RadarQualityIQISummaryParamsDateRange12w RadarQualityIQISummaryParamsDateRange = "12w"
- RadarQualityIQISummaryParamsDateRange24w RadarQualityIQISummaryParamsDateRange = "24w"
- RadarQualityIQISummaryParamsDateRange52w RadarQualityIQISummaryParamsDateRange = "52w"
- RadarQualityIQISummaryParamsDateRange1dControl RadarQualityIQISummaryParamsDateRange = "1dControl"
- RadarQualityIQISummaryParamsDateRange2dControl RadarQualityIQISummaryParamsDateRange = "2dControl"
- RadarQualityIQISummaryParamsDateRange7dControl RadarQualityIQISummaryParamsDateRange = "7dControl"
- RadarQualityIQISummaryParamsDateRange14dControl RadarQualityIQISummaryParamsDateRange = "14dControl"
- RadarQualityIQISummaryParamsDateRange28dControl RadarQualityIQISummaryParamsDateRange = "28dControl"
- RadarQualityIQISummaryParamsDateRange12wControl RadarQualityIQISummaryParamsDateRange = "12wControl"
- RadarQualityIQISummaryParamsDateRange24wControl RadarQualityIQISummaryParamsDateRange = "24wControl"
-)
-
-// Format results are returned in.
-type RadarQualityIQISummaryParamsFormat string
-
-const (
- RadarQualityIQISummaryParamsFormatJson RadarQualityIQISummaryParamsFormat = "JSON"
- RadarQualityIQISummaryParamsFormatCsv RadarQualityIQISummaryParamsFormat = "CSV"
-)
-
-type RadarQualityIQISummaryResponseEnvelope struct {
- Result RadarQualityIQISummaryResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarQualityIQISummaryResponseEnvelopeJSON `json:"-"`
-}
-
-// radarQualityIQISummaryResponseEnvelopeJSON contains the JSON metadata for the
-// struct [RadarQualityIQISummaryResponseEnvelope]
-type radarQualityIQISummaryResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarQualityIQISummaryResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarQualityIQISummaryResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarQualityIQITimeseriesGroupsParams struct {
- // Which metric to return: bandwidth, latency or DNS response time.
- Metric param.Field[RadarQualityIQITimeseriesGroupsParamsMetric] `query:"metric,required"`
- // Aggregation interval results should be returned in (for example, in 15 minutes
- // or 1 hour intervals). Refer to
- // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
- AggInterval param.Field[RadarQualityIQITimeseriesGroupsParamsAggInterval] `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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarQualityIQITimeseriesGroupsParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Format results are returned in.
- Format param.Field[RadarQualityIQITimeseriesGroupsParamsFormat] `query:"format"`
- // Enable interpolation for all series (using the average).
- Interpolation param.Field[bool] `query:"interpolation"`
- // 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 [RadarQualityIQITimeseriesGroupsParams]'s query parameters
-// as `url.Values`.
-func (r RadarQualityIQITimeseriesGroupsParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Which metric to return: bandwidth, latency or DNS response time.
-type RadarQualityIQITimeseriesGroupsParamsMetric string
-
-const (
- RadarQualityIQITimeseriesGroupsParamsMetricBandwidth RadarQualityIQITimeseriesGroupsParamsMetric = "BANDWIDTH"
- RadarQualityIQITimeseriesGroupsParamsMetricDNS RadarQualityIQITimeseriesGroupsParamsMetric = "DNS"
- RadarQualityIQITimeseriesGroupsParamsMetricLatency RadarQualityIQITimeseriesGroupsParamsMetric = "LATENCY"
-)
-
-// Aggregation interval results should be returned in (for example, in 15 minutes
-// or 1 hour intervals). Refer to
-// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
-type RadarQualityIQITimeseriesGroupsParamsAggInterval string
-
-const (
- RadarQualityIQITimeseriesGroupsParamsAggInterval15m RadarQualityIQITimeseriesGroupsParamsAggInterval = "15m"
- RadarQualityIQITimeseriesGroupsParamsAggInterval1h RadarQualityIQITimeseriesGroupsParamsAggInterval = "1h"
- RadarQualityIQITimeseriesGroupsParamsAggInterval1d RadarQualityIQITimeseriesGroupsParamsAggInterval = "1d"
- RadarQualityIQITimeseriesGroupsParamsAggInterval1w RadarQualityIQITimeseriesGroupsParamsAggInterval = "1w"
-)
-
-type RadarQualityIQITimeseriesGroupsParamsDateRange string
-
-const (
- RadarQualityIQITimeseriesGroupsParamsDateRange1d RadarQualityIQITimeseriesGroupsParamsDateRange = "1d"
- RadarQualityIQITimeseriesGroupsParamsDateRange2d RadarQualityIQITimeseriesGroupsParamsDateRange = "2d"
- RadarQualityIQITimeseriesGroupsParamsDateRange7d RadarQualityIQITimeseriesGroupsParamsDateRange = "7d"
- RadarQualityIQITimeseriesGroupsParamsDateRange14d RadarQualityIQITimeseriesGroupsParamsDateRange = "14d"
- RadarQualityIQITimeseriesGroupsParamsDateRange28d RadarQualityIQITimeseriesGroupsParamsDateRange = "28d"
- RadarQualityIQITimeseriesGroupsParamsDateRange12w RadarQualityIQITimeseriesGroupsParamsDateRange = "12w"
- RadarQualityIQITimeseriesGroupsParamsDateRange24w RadarQualityIQITimeseriesGroupsParamsDateRange = "24w"
- RadarQualityIQITimeseriesGroupsParamsDateRange52w RadarQualityIQITimeseriesGroupsParamsDateRange = "52w"
- RadarQualityIQITimeseriesGroupsParamsDateRange1dControl RadarQualityIQITimeseriesGroupsParamsDateRange = "1dControl"
- RadarQualityIQITimeseriesGroupsParamsDateRange2dControl RadarQualityIQITimeseriesGroupsParamsDateRange = "2dControl"
- RadarQualityIQITimeseriesGroupsParamsDateRange7dControl RadarQualityIQITimeseriesGroupsParamsDateRange = "7dControl"
- RadarQualityIQITimeseriesGroupsParamsDateRange14dControl RadarQualityIQITimeseriesGroupsParamsDateRange = "14dControl"
- RadarQualityIQITimeseriesGroupsParamsDateRange28dControl RadarQualityIQITimeseriesGroupsParamsDateRange = "28dControl"
- RadarQualityIQITimeseriesGroupsParamsDateRange12wControl RadarQualityIQITimeseriesGroupsParamsDateRange = "12wControl"
- RadarQualityIQITimeseriesGroupsParamsDateRange24wControl RadarQualityIQITimeseriesGroupsParamsDateRange = "24wControl"
-)
-
-// Format results are returned in.
-type RadarQualityIQITimeseriesGroupsParamsFormat string
-
-const (
- RadarQualityIQITimeseriesGroupsParamsFormatJson RadarQualityIQITimeseriesGroupsParamsFormat = "JSON"
- RadarQualityIQITimeseriesGroupsParamsFormatCsv RadarQualityIQITimeseriesGroupsParamsFormat = "CSV"
-)
-
-type RadarQualityIQITimeseriesGroupsResponseEnvelope struct {
- Result RadarQualityIQITimeseriesGroupsResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarQualityIQITimeseriesGroupsResponseEnvelopeJSON `json:"-"`
-}
-
-// radarQualityIQITimeseriesGroupsResponseEnvelopeJSON contains the JSON metadata
-// for the struct [RadarQualityIQITimeseriesGroupsResponseEnvelope]
-type radarQualityIQITimeseriesGroupsResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarQualityIQITimeseriesGroupsResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarQualityIQITimeseriesGroupsResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
diff --git a/radarqualityiqi_test.go b/radarqualityiqi_test.go
deleted file mode 100644
index 02d08d4a2bf..00000000000
--- a/radarqualityiqi_test.go
+++ /dev/null
@@ -1,85 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
- "time"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRadarQualityIQISummaryWithOptionalParams(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"),
- )
- _, err := client.Radar.Quality.IQI.Summary(context.TODO(), cloudflare.RadarQualityIQISummaryParams{
- Metric: cloudflare.F(cloudflare.RadarQualityIQISummaryParamsMetricBandwidth),
- 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.RadarQualityIQISummaryParamsDateRange{cloudflare.RadarQualityIQISummaryParamsDateRange1d, cloudflare.RadarQualityIQISummaryParamsDateRange2d, cloudflare.RadarQualityIQISummaryParamsDateRange7d}),
- DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
- Format: cloudflare.F(cloudflare.RadarQualityIQISummaryParamsFormatJson),
- 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())
- }
-}
-
-func TestRadarQualityIQITimeseriesGroupsWithOptionalParams(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"),
- )
- _, err := client.Radar.Quality.IQI.TimeseriesGroups(context.TODO(), cloudflare.RadarQualityIQITimeseriesGroupsParams{
- Metric: cloudflare.F(cloudflare.RadarQualityIQITimeseriesGroupsParamsMetricBandwidth),
- AggInterval: cloudflare.F(cloudflare.RadarQualityIQITimeseriesGroupsParamsAggInterval1h),
- 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.RadarQualityIQITimeseriesGroupsParamsDateRange{cloudflare.RadarQualityIQITimeseriesGroupsParamsDateRange1d, cloudflare.RadarQualityIQITimeseriesGroupsParamsDateRange2d, cloudflare.RadarQualityIQITimeseriesGroupsParamsDateRange7d}),
- DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
- Format: cloudflare.F(cloudflare.RadarQualityIQITimeseriesGroupsParamsFormatJson),
- Interpolation: cloudflare.F(true),
- 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/radarqualityspeed.go b/radarqualityspeed.go
deleted file mode 100644
index a408e2c81f8..00000000000
--- a/radarqualityspeed.go
+++ /dev/null
@@ -1,412 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarQualitySpeedService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewRadarQualitySpeedService] method
-// instead.
-type RadarQualitySpeedService struct {
- Options []option.RequestOption
- Top *RadarQualitySpeedTopService
-}
-
-// NewRadarQualitySpeedService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewRadarQualitySpeedService(opts ...option.RequestOption) (r *RadarQualitySpeedService) {
- r = &RadarQualitySpeedService{}
- r.Options = opts
- r.Top = NewRadarQualitySpeedTopService(opts...)
- return
-}
-
-// Get an histogram from the previous 90 days of Cloudflare Speed Test data, split
-// into fixed bandwidth (Mbps), latency (ms) or jitter (ms) buckets.
-func (r *RadarQualitySpeedService) Histogram(ctx context.Context, query RadarQualitySpeedHistogramParams, opts ...option.RequestOption) (res *RadarQualitySpeedHistogramResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarQualitySpeedHistogramResponseEnvelope
- path := "radar/quality/speed/histogram"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Get a summary of bandwidth, latency, jitter and packet loss, from the previous
-// 90 days of Cloudflare Speed Test data.
-func (r *RadarQualitySpeedService) Summary(ctx context.Context, query RadarQualitySpeedSummaryParams, opts ...option.RequestOption) (res *RadarQualitySpeedSummaryResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarQualitySpeedSummaryResponseEnvelope
- path := "radar/quality/speed/summary"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type RadarQualitySpeedHistogramResponse struct {
- Histogram0 RadarQualitySpeedHistogramResponseHistogram0 `json:"histogram_0,required"`
- Meta interface{} `json:"meta,required"`
- JSON radarQualitySpeedHistogramResponseJSON `json:"-"`
-}
-
-// radarQualitySpeedHistogramResponseJSON contains the JSON metadata for the struct
-// [RadarQualitySpeedHistogramResponse]
-type radarQualitySpeedHistogramResponseJSON struct {
- Histogram0 apijson.Field
- Meta apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarQualitySpeedHistogramResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarQualitySpeedHistogramResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarQualitySpeedHistogramResponseHistogram0 struct {
- BandwidthDownload []string `json:"bandwidthDownload,required"`
- BandwidthUpload []string `json:"bandwidthUpload,required"`
- BucketMin []string `json:"bucketMin,required"`
- JSON radarQualitySpeedHistogramResponseHistogram0JSON `json:"-"`
-}
-
-// radarQualitySpeedHistogramResponseHistogram0JSON contains the JSON metadata for
-// the struct [RadarQualitySpeedHistogramResponseHistogram0]
-type radarQualitySpeedHistogramResponseHistogram0JSON struct {
- BandwidthDownload apijson.Field
- BandwidthUpload apijson.Field
- BucketMin apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarQualitySpeedHistogramResponseHistogram0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarQualitySpeedHistogramResponseHistogram0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarQualitySpeedSummaryResponse struct {
- Meta RadarQualitySpeedSummaryResponseMeta `json:"meta,required"`
- Summary0 RadarQualitySpeedSummaryResponseSummary0 `json:"summary_0,required"`
- JSON radarQualitySpeedSummaryResponseJSON `json:"-"`
-}
-
-// radarQualitySpeedSummaryResponseJSON contains the JSON metadata for the struct
-// [RadarQualitySpeedSummaryResponse]
-type radarQualitySpeedSummaryResponseJSON struct {
- Meta apijson.Field
- Summary0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarQualitySpeedSummaryResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarQualitySpeedSummaryResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarQualitySpeedSummaryResponseMeta struct {
- DateRange []RadarQualitySpeedSummaryResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- Normalization string `json:"normalization,required"`
- ConfidenceInfo RadarQualitySpeedSummaryResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarQualitySpeedSummaryResponseMetaJSON `json:"-"`
-}
-
-// radarQualitySpeedSummaryResponseMetaJSON contains the JSON metadata for the
-// struct [RadarQualitySpeedSummaryResponseMeta]
-type radarQualitySpeedSummaryResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- Normalization apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarQualitySpeedSummaryResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarQualitySpeedSummaryResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarQualitySpeedSummaryResponseMetaDateRange 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 radarQualitySpeedSummaryResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarQualitySpeedSummaryResponseMetaDateRangeJSON contains the JSON metadata for
-// the struct [RadarQualitySpeedSummaryResponseMetaDateRange]
-type radarQualitySpeedSummaryResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarQualitySpeedSummaryResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarQualitySpeedSummaryResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarQualitySpeedSummaryResponseMetaConfidenceInfo struct {
- Annotations []RadarQualitySpeedSummaryResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarQualitySpeedSummaryResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarQualitySpeedSummaryResponseMetaConfidenceInfoJSON contains the JSON
-// metadata for the struct [RadarQualitySpeedSummaryResponseMetaConfidenceInfo]
-type radarQualitySpeedSummaryResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarQualitySpeedSummaryResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarQualitySpeedSummaryResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarQualitySpeedSummaryResponseMetaConfidenceInfoAnnotation 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 radarQualitySpeedSummaryResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarQualitySpeedSummaryResponseMetaConfidenceInfoAnnotationJSON contains the
-// JSON metadata for the struct
-// [RadarQualitySpeedSummaryResponseMetaConfidenceInfoAnnotation]
-type radarQualitySpeedSummaryResponseMetaConfidenceInfoAnnotationJSON 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 *RadarQualitySpeedSummaryResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarQualitySpeedSummaryResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarQualitySpeedSummaryResponseSummary0 struct {
- BandwidthDownload string `json:"bandwidthDownload,required"`
- BandwidthUpload string `json:"bandwidthUpload,required"`
- JitterIdle string `json:"jitterIdle,required"`
- JitterLoaded string `json:"jitterLoaded,required"`
- LatencyIdle string `json:"latencyIdle,required"`
- LatencyLoaded string `json:"latencyLoaded,required"`
- PacketLoss string `json:"packetLoss,required"`
- JSON radarQualitySpeedSummaryResponseSummary0JSON `json:"-"`
-}
-
-// radarQualitySpeedSummaryResponseSummary0JSON contains the JSON metadata for the
-// struct [RadarQualitySpeedSummaryResponseSummary0]
-type radarQualitySpeedSummaryResponseSummary0JSON struct {
- BandwidthDownload apijson.Field
- BandwidthUpload apijson.Field
- JitterIdle apijson.Field
- JitterLoaded apijson.Field
- LatencyIdle apijson.Field
- LatencyLoaded apijson.Field
- PacketLoss apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarQualitySpeedSummaryResponseSummary0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarQualitySpeedSummaryResponseSummary0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarQualitySpeedHistogramParams 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"`
- // 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.
- Format param.Field[RadarQualitySpeedHistogramParamsFormat] `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"`
- // Metrics to be returned.
- MetricGroup param.Field[RadarQualitySpeedHistogramParamsMetricGroup] `query:"metricGroup"`
- // Array of names that will be used to name the series in responses.
- Name param.Field[[]string] `query:"name"`
-}
-
-// URLQuery serializes [RadarQualitySpeedHistogramParams]'s query parameters as
-// `url.Values`.
-func (r RadarQualitySpeedHistogramParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Format results are returned in.
-type RadarQualitySpeedHistogramParamsFormat string
-
-const (
- RadarQualitySpeedHistogramParamsFormatJson RadarQualitySpeedHistogramParamsFormat = "JSON"
- RadarQualitySpeedHistogramParamsFormatCsv RadarQualitySpeedHistogramParamsFormat = "CSV"
-)
-
-// Metrics to be returned.
-type RadarQualitySpeedHistogramParamsMetricGroup string
-
-const (
- RadarQualitySpeedHistogramParamsMetricGroupBandwidth RadarQualitySpeedHistogramParamsMetricGroup = "BANDWIDTH"
- RadarQualitySpeedHistogramParamsMetricGroupLatency RadarQualitySpeedHistogramParamsMetricGroup = "LATENCY"
- RadarQualitySpeedHistogramParamsMetricGroupJitter RadarQualitySpeedHistogramParamsMetricGroup = "JITTER"
-)
-
-type RadarQualitySpeedHistogramResponseEnvelope struct {
- Result RadarQualitySpeedHistogramResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarQualitySpeedHistogramResponseEnvelopeJSON `json:"-"`
-}
-
-// radarQualitySpeedHistogramResponseEnvelopeJSON contains the JSON metadata for
-// the struct [RadarQualitySpeedHistogramResponseEnvelope]
-type radarQualitySpeedHistogramResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarQualitySpeedHistogramResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarQualitySpeedHistogramResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarQualitySpeedSummaryParams 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"`
- // 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.
- Format param.Field[RadarQualitySpeedSummaryParamsFormat] `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"`
-}
-
-// URLQuery serializes [RadarQualitySpeedSummaryParams]'s query parameters as
-// `url.Values`.
-func (r RadarQualitySpeedSummaryParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Format results are returned in.
-type RadarQualitySpeedSummaryParamsFormat string
-
-const (
- RadarQualitySpeedSummaryParamsFormatJson RadarQualitySpeedSummaryParamsFormat = "JSON"
- RadarQualitySpeedSummaryParamsFormatCsv RadarQualitySpeedSummaryParamsFormat = "CSV"
-)
-
-type RadarQualitySpeedSummaryResponseEnvelope struct {
- Result RadarQualitySpeedSummaryResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarQualitySpeedSummaryResponseEnvelopeJSON `json:"-"`
-}
-
-// radarQualitySpeedSummaryResponseEnvelopeJSON contains the JSON metadata for the
-// struct [RadarQualitySpeedSummaryResponseEnvelope]
-type radarQualitySpeedSummaryResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarQualitySpeedSummaryResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarQualitySpeedSummaryResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
diff --git a/radarqualityspeed_test.go b/radarqualityspeed_test.go
deleted file mode 100644
index 635da7488d9..00000000000
--- a/radarqualityspeed_test.go
+++ /dev/null
@@ -1,79 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
- "time"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRadarQualitySpeedHistogramWithOptionalParams(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"),
- )
- _, 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"}),
- MetricGroup: cloudflare.F(cloudflare.RadarQualitySpeedHistogramParamsMetricGroupBandwidth),
- 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())
- }
-}
-
-func TestRadarQualitySpeedSummaryWithOptionalParams(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"),
- )
- _, err := client.Radar.Quality.Speed.Summary(context.TODO(), cloudflare.RadarQualitySpeedSummaryParams{
- 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
- if errors.As(err, &apierr) {
- t.Log(string(apierr.DumpRequest(true)))
- }
- t.Fatalf("err should be nil: %s", err.Error())
- }
-}
diff --git a/radarqualityspeedtop.go b/radarqualityspeedtop.go
deleted file mode 100644
index 0d69e7bda11..00000000000
--- a/radarqualityspeedtop.go
+++ /dev/null
@@ -1,559 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarQualitySpeedTopService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewRadarQualitySpeedTopService]
-// method instead.
-type RadarQualitySpeedTopService struct {
- Options []option.RequestOption
-}
-
-// NewRadarQualitySpeedTopService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewRadarQualitySpeedTopService(opts ...option.RequestOption) (r *RadarQualitySpeedTopService) {
- r = &RadarQualitySpeedTopService{}
- r.Options = opts
- return
-}
-
-// Get the top autonomous systems by bandwidth, latency, jitter or packet loss,
-// from the previous 90 days of Cloudflare Speed Test data.
-func (r *RadarQualitySpeedTopService) Ases(ctx context.Context, query RadarQualitySpeedTopAsesParams, opts ...option.RequestOption) (res *RadarQualitySpeedTopAsesResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarQualitySpeedTopAsesResponseEnvelope
- path := "radar/quality/speed/top/ases"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Get the top locations by bandwidth, latency, jitter or packet loss, from the
-// previous 90 days of Cloudflare Speed Test data.
-func (r *RadarQualitySpeedTopService) Locations(ctx context.Context, query RadarQualitySpeedTopLocationsParams, opts ...option.RequestOption) (res *RadarQualitySpeedTopLocationsResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarQualitySpeedTopLocationsResponseEnvelope
- path := "radar/quality/speed/top/locations"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type RadarQualitySpeedTopAsesResponse struct {
- Meta RadarQualitySpeedTopAsesResponseMeta `json:"meta,required"`
- Top0 []RadarQualitySpeedTopAsesResponseTop0 `json:"top_0,required"`
- JSON radarQualitySpeedTopAsesResponseJSON `json:"-"`
-}
-
-// radarQualitySpeedTopAsesResponseJSON contains the JSON metadata for the struct
-// [RadarQualitySpeedTopAsesResponse]
-type radarQualitySpeedTopAsesResponseJSON struct {
- Meta apijson.Field
- Top0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarQualitySpeedTopAsesResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarQualitySpeedTopAsesResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarQualitySpeedTopAsesResponseMeta struct {
- DateRange []RadarQualitySpeedTopAsesResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- ConfidenceInfo RadarQualitySpeedTopAsesResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarQualitySpeedTopAsesResponseMetaJSON `json:"-"`
-}
-
-// radarQualitySpeedTopAsesResponseMetaJSON contains the JSON metadata for the
-// struct [RadarQualitySpeedTopAsesResponseMeta]
-type radarQualitySpeedTopAsesResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarQualitySpeedTopAsesResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarQualitySpeedTopAsesResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarQualitySpeedTopAsesResponseMetaDateRange 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 radarQualitySpeedTopAsesResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarQualitySpeedTopAsesResponseMetaDateRangeJSON contains the JSON metadata for
-// the struct [RadarQualitySpeedTopAsesResponseMetaDateRange]
-type radarQualitySpeedTopAsesResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarQualitySpeedTopAsesResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarQualitySpeedTopAsesResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarQualitySpeedTopAsesResponseMetaConfidenceInfo struct {
- Annotations []RadarQualitySpeedTopAsesResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarQualitySpeedTopAsesResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarQualitySpeedTopAsesResponseMetaConfidenceInfoJSON contains the JSON
-// metadata for the struct [RadarQualitySpeedTopAsesResponseMetaConfidenceInfo]
-type radarQualitySpeedTopAsesResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarQualitySpeedTopAsesResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarQualitySpeedTopAsesResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarQualitySpeedTopAsesResponseMetaConfidenceInfoAnnotation 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 radarQualitySpeedTopAsesResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarQualitySpeedTopAsesResponseMetaConfidenceInfoAnnotationJSON contains the
-// JSON metadata for the struct
-// [RadarQualitySpeedTopAsesResponseMetaConfidenceInfoAnnotation]
-type radarQualitySpeedTopAsesResponseMetaConfidenceInfoAnnotationJSON 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 *RadarQualitySpeedTopAsesResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarQualitySpeedTopAsesResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarQualitySpeedTopAsesResponseTop0 struct {
- BandwidthDownload string `json:"bandwidthDownload,required"`
- BandwidthUpload string `json:"bandwidthUpload,required"`
- ClientASN float64 `json:"clientASN,required"`
- ClientAsName string `json:"clientASName,required"`
- JitterIdle string `json:"jitterIdle,required"`
- JitterLoaded string `json:"jitterLoaded,required"`
- LatencyIdle string `json:"latencyIdle,required"`
- LatencyLoaded string `json:"latencyLoaded,required"`
- NumTests float64 `json:"numTests,required"`
- RankPower float64 `json:"rankPower,required"`
- JSON radarQualitySpeedTopAsesResponseTop0JSON `json:"-"`
-}
-
-// radarQualitySpeedTopAsesResponseTop0JSON contains the JSON metadata for the
-// struct [RadarQualitySpeedTopAsesResponseTop0]
-type radarQualitySpeedTopAsesResponseTop0JSON struct {
- BandwidthDownload apijson.Field
- BandwidthUpload apijson.Field
- ClientASN apijson.Field
- ClientAsName apijson.Field
- JitterIdle apijson.Field
- JitterLoaded apijson.Field
- LatencyIdle apijson.Field
- LatencyLoaded apijson.Field
- NumTests apijson.Field
- RankPower apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarQualitySpeedTopAsesResponseTop0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarQualitySpeedTopAsesResponseTop0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarQualitySpeedTopLocationsResponse struct {
- Meta RadarQualitySpeedTopLocationsResponseMeta `json:"meta,required"`
- Top0 []RadarQualitySpeedTopLocationsResponseTop0 `json:"top_0,required"`
- JSON radarQualitySpeedTopLocationsResponseJSON `json:"-"`
-}
-
-// radarQualitySpeedTopLocationsResponseJSON contains the JSON metadata for the
-// struct [RadarQualitySpeedTopLocationsResponse]
-type radarQualitySpeedTopLocationsResponseJSON struct {
- Meta apijson.Field
- Top0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarQualitySpeedTopLocationsResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarQualitySpeedTopLocationsResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarQualitySpeedTopLocationsResponseMeta struct {
- DateRange []RadarQualitySpeedTopLocationsResponseMetaDateRange `json:"dateRange,required"`
- LastUpdated string `json:"lastUpdated,required"`
- ConfidenceInfo RadarQualitySpeedTopLocationsResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarQualitySpeedTopLocationsResponseMetaJSON `json:"-"`
-}
-
-// radarQualitySpeedTopLocationsResponseMetaJSON contains the JSON metadata for the
-// struct [RadarQualitySpeedTopLocationsResponseMeta]
-type radarQualitySpeedTopLocationsResponseMetaJSON struct {
- DateRange apijson.Field
- LastUpdated apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarQualitySpeedTopLocationsResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarQualitySpeedTopLocationsResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarQualitySpeedTopLocationsResponseMetaDateRange 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 radarQualitySpeedTopLocationsResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarQualitySpeedTopLocationsResponseMetaDateRangeJSON contains the JSON
-// metadata for the struct [RadarQualitySpeedTopLocationsResponseMetaDateRange]
-type radarQualitySpeedTopLocationsResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarQualitySpeedTopLocationsResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarQualitySpeedTopLocationsResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarQualitySpeedTopLocationsResponseMetaConfidenceInfo struct {
- Annotations []RadarQualitySpeedTopLocationsResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarQualitySpeedTopLocationsResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarQualitySpeedTopLocationsResponseMetaConfidenceInfoJSON contains the JSON
-// metadata for the struct
-// [RadarQualitySpeedTopLocationsResponseMetaConfidenceInfo]
-type radarQualitySpeedTopLocationsResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarQualitySpeedTopLocationsResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarQualitySpeedTopLocationsResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarQualitySpeedTopLocationsResponseMetaConfidenceInfoAnnotation 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 radarQualitySpeedTopLocationsResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarQualitySpeedTopLocationsResponseMetaConfidenceInfoAnnotationJSON contains
-// the JSON metadata for the struct
-// [RadarQualitySpeedTopLocationsResponseMetaConfidenceInfoAnnotation]
-type radarQualitySpeedTopLocationsResponseMetaConfidenceInfoAnnotationJSON 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 *RadarQualitySpeedTopLocationsResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarQualitySpeedTopLocationsResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarQualitySpeedTopLocationsResponseTop0 struct {
- BandwidthDownload string `json:"bandwidthDownload,required"`
- BandwidthUpload string `json:"bandwidthUpload,required"`
- ClientCountryAlpha2 string `json:"clientCountryAlpha2,required"`
- ClientCountryName string `json:"clientCountryName,required"`
- JitterIdle string `json:"jitterIdle,required"`
- JitterLoaded string `json:"jitterLoaded,required"`
- LatencyIdle string `json:"latencyIdle,required"`
- LatencyLoaded string `json:"latencyLoaded,required"`
- NumTests float64 `json:"numTests,required"`
- RankPower float64 `json:"rankPower,required"`
- JSON radarQualitySpeedTopLocationsResponseTop0JSON `json:"-"`
-}
-
-// radarQualitySpeedTopLocationsResponseTop0JSON contains the JSON metadata for the
-// struct [RadarQualitySpeedTopLocationsResponseTop0]
-type radarQualitySpeedTopLocationsResponseTop0JSON struct {
- BandwidthDownload apijson.Field
- BandwidthUpload apijson.Field
- ClientCountryAlpha2 apijson.Field
- ClientCountryName apijson.Field
- JitterIdle apijson.Field
- JitterLoaded apijson.Field
- LatencyIdle apijson.Field
- LatencyLoaded apijson.Field
- NumTests apijson.Field
- RankPower apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarQualitySpeedTopLocationsResponseTop0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarQualitySpeedTopLocationsResponseTop0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarQualitySpeedTopAsesParams 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"`
- // 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.
- Format param.Field[RadarQualitySpeedTopAsesParamsFormat] `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"`
- // Metric to order the results by.
- OrderBy param.Field[RadarQualitySpeedTopAsesParamsOrderBy] `query:"orderBy"`
- // Reverse the order of results.
- Reverse param.Field[bool] `query:"reverse"`
-}
-
-// URLQuery serializes [RadarQualitySpeedTopAsesParams]'s query parameters as
-// `url.Values`.
-func (r RadarQualitySpeedTopAsesParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Format results are returned in.
-type RadarQualitySpeedTopAsesParamsFormat string
-
-const (
- RadarQualitySpeedTopAsesParamsFormatJson RadarQualitySpeedTopAsesParamsFormat = "JSON"
- RadarQualitySpeedTopAsesParamsFormatCsv RadarQualitySpeedTopAsesParamsFormat = "CSV"
-)
-
-// Metric to order the results by.
-type RadarQualitySpeedTopAsesParamsOrderBy string
-
-const (
- RadarQualitySpeedTopAsesParamsOrderByBandwidthDownload RadarQualitySpeedTopAsesParamsOrderBy = "BANDWIDTH_DOWNLOAD"
- RadarQualitySpeedTopAsesParamsOrderByBandwidthUpload RadarQualitySpeedTopAsesParamsOrderBy = "BANDWIDTH_UPLOAD"
- RadarQualitySpeedTopAsesParamsOrderByLatencyIdle RadarQualitySpeedTopAsesParamsOrderBy = "LATENCY_IDLE"
- RadarQualitySpeedTopAsesParamsOrderByLatencyLoaded RadarQualitySpeedTopAsesParamsOrderBy = "LATENCY_LOADED"
- RadarQualitySpeedTopAsesParamsOrderByJitterIdle RadarQualitySpeedTopAsesParamsOrderBy = "JITTER_IDLE"
- RadarQualitySpeedTopAsesParamsOrderByJitterLoaded RadarQualitySpeedTopAsesParamsOrderBy = "JITTER_LOADED"
-)
-
-type RadarQualitySpeedTopAsesResponseEnvelope struct {
- Result RadarQualitySpeedTopAsesResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarQualitySpeedTopAsesResponseEnvelopeJSON `json:"-"`
-}
-
-// radarQualitySpeedTopAsesResponseEnvelopeJSON contains the JSON metadata for the
-// struct [RadarQualitySpeedTopAsesResponseEnvelope]
-type radarQualitySpeedTopAsesResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarQualitySpeedTopAsesResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarQualitySpeedTopAsesResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarQualitySpeedTopLocationsParams 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"`
- // 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.
- Format param.Field[RadarQualitySpeedTopLocationsParamsFormat] `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"`
- // Metric to order the results by.
- OrderBy param.Field[RadarQualitySpeedTopLocationsParamsOrderBy] `query:"orderBy"`
- // Reverse the order of results.
- Reverse param.Field[bool] `query:"reverse"`
-}
-
-// URLQuery serializes [RadarQualitySpeedTopLocationsParams]'s query parameters as
-// `url.Values`.
-func (r RadarQualitySpeedTopLocationsParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Format results are returned in.
-type RadarQualitySpeedTopLocationsParamsFormat string
-
-const (
- RadarQualitySpeedTopLocationsParamsFormatJson RadarQualitySpeedTopLocationsParamsFormat = "JSON"
- RadarQualitySpeedTopLocationsParamsFormatCsv RadarQualitySpeedTopLocationsParamsFormat = "CSV"
-)
-
-// Metric to order the results by.
-type RadarQualitySpeedTopLocationsParamsOrderBy string
-
-const (
- RadarQualitySpeedTopLocationsParamsOrderByBandwidthDownload RadarQualitySpeedTopLocationsParamsOrderBy = "BANDWIDTH_DOWNLOAD"
- RadarQualitySpeedTopLocationsParamsOrderByBandwidthUpload RadarQualitySpeedTopLocationsParamsOrderBy = "BANDWIDTH_UPLOAD"
- RadarQualitySpeedTopLocationsParamsOrderByLatencyIdle RadarQualitySpeedTopLocationsParamsOrderBy = "LATENCY_IDLE"
- RadarQualitySpeedTopLocationsParamsOrderByLatencyLoaded RadarQualitySpeedTopLocationsParamsOrderBy = "LATENCY_LOADED"
- RadarQualitySpeedTopLocationsParamsOrderByJitterIdle RadarQualitySpeedTopLocationsParamsOrderBy = "JITTER_IDLE"
- RadarQualitySpeedTopLocationsParamsOrderByJitterLoaded RadarQualitySpeedTopLocationsParamsOrderBy = "JITTER_LOADED"
-)
-
-type RadarQualitySpeedTopLocationsResponseEnvelope struct {
- Result RadarQualitySpeedTopLocationsResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarQualitySpeedTopLocationsResponseEnvelopeJSON `json:"-"`
-}
-
-// radarQualitySpeedTopLocationsResponseEnvelopeJSON contains the JSON metadata for
-// the struct [RadarQualitySpeedTopLocationsResponseEnvelope]
-type radarQualitySpeedTopLocationsResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarQualitySpeedTopLocationsResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarQualitySpeedTopLocationsResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
diff --git a/radarqualityspeedtop_test.go b/radarqualityspeedtop_test.go
deleted file mode 100644
index 8c4b70a35a9..00000000000
--- a/radarqualityspeedtop_test.go
+++ /dev/null
@@ -1,83 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
- "time"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRadarQualitySpeedTopAsesWithOptionalParams(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"),
- )
- _, err := client.Radar.Quality.Speed.Top.Ases(context.TODO(), cloudflare.RadarQualitySpeedTopAsesParams{
- 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
- if errors.As(err, &apierr) {
- t.Log(string(apierr.DumpRequest(true)))
- }
- t.Fatalf("err should be nil: %s", err.Error())
- }
-}
-
-func TestRadarQualitySpeedTopLocationsWithOptionalParams(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"),
- )
- _, err := client.Radar.Quality.Speed.Top.Locations(context.TODO(), cloudflare.RadarQualitySpeedTopLocationsParams{
- 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
- if errors.As(err, &apierr) {
- t.Log(string(apierr.DumpRequest(true)))
- }
- t.Fatalf("err should be nil: %s", err.Error())
- }
-}
diff --git a/radarranking.go b/radarranking.go
deleted file mode 100644
index 22e60097f36..00000000000
--- a/radarranking.go
+++ /dev/null
@@ -1,429 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarRankingService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewRadarRankingService] method
-// instead.
-type RadarRankingService struct {
- Options []option.RequestOption
- Domain *RadarRankingDomainService
-}
-
-// NewRadarRankingService generates a new service that applies the given options to
-// each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewRadarRankingService(opts ...option.RequestOption) (r *RadarRankingService) {
- r = &RadarRankingService{}
- r.Options = opts
- r.Domain = NewRadarRankingDomainService(opts...)
- return
-}
-
-// Gets Domains Rank updates change over time. Raw values are returned.
-func (r *RadarRankingService) TimeseriesGroups(ctx context.Context, query RadarRankingTimeseriesGroupsParams, opts ...option.RequestOption) (res *RadarRankingTimeseriesGroupsResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarRankingTimeseriesGroupsResponseEnvelope
- path := "radar/ranking/timeseries_groups"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Get top or trending domains based on their rank. Popular domains are domains of
-// broad appeal based on how people use the Internet. Trending domains are domains
-// that are generating a surge in interest. For more information on top domains,
-// see https://blog.cloudflare.com/radar-domain-rankings/.
-func (r *RadarRankingService) Top(ctx context.Context, query RadarRankingTopParams, opts ...option.RequestOption) (res *RadarRankingTopResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarRankingTopResponseEnvelope
- path := "radar/ranking/top"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type RadarRankingTimeseriesGroupsResponse struct {
- Meta RadarRankingTimeseriesGroupsResponseMeta `json:"meta,required"`
- Serie0 RadarRankingTimeseriesGroupsResponseSerie0 `json:"serie_0,required"`
- JSON radarRankingTimeseriesGroupsResponseJSON `json:"-"`
-}
-
-// radarRankingTimeseriesGroupsResponseJSON contains the JSON metadata for the
-// struct [RadarRankingTimeseriesGroupsResponse]
-type radarRankingTimeseriesGroupsResponseJSON struct {
- Meta apijson.Field
- Serie0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarRankingTimeseriesGroupsResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarRankingTimeseriesGroupsResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarRankingTimeseriesGroupsResponseMeta struct {
- DateRange []RadarRankingTimeseriesGroupsResponseMetaDateRange `json:"dateRange,required"`
- JSON radarRankingTimeseriesGroupsResponseMetaJSON `json:"-"`
-}
-
-// radarRankingTimeseriesGroupsResponseMetaJSON contains the JSON metadata for the
-// struct [RadarRankingTimeseriesGroupsResponseMeta]
-type radarRankingTimeseriesGroupsResponseMetaJSON struct {
- DateRange apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarRankingTimeseriesGroupsResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarRankingTimeseriesGroupsResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarRankingTimeseriesGroupsResponseMetaDateRange 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 radarRankingTimeseriesGroupsResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarRankingTimeseriesGroupsResponseMetaDateRangeJSON contains the JSON metadata
-// for the struct [RadarRankingTimeseriesGroupsResponseMetaDateRange]
-type radarRankingTimeseriesGroupsResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarRankingTimeseriesGroupsResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarRankingTimeseriesGroupsResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarRankingTimeseriesGroupsResponseSerie0 struct {
- Timestamps []string `json:"timestamps,required"`
- ExtraFields map[string][]RadarRankingTimeseriesGroupsResponseSerie0 `json:"-,extras"`
- JSON radarRankingTimeseriesGroupsResponseSerie0JSON `json:"-"`
-}
-
-// radarRankingTimeseriesGroupsResponseSerie0JSON contains the JSON metadata for
-// the struct [RadarRankingTimeseriesGroupsResponseSerie0]
-type radarRankingTimeseriesGroupsResponseSerie0JSON struct {
- Timestamps apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarRankingTimeseriesGroupsResponseSerie0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarRankingTimeseriesGroupsResponseSerie0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarRankingTopResponse struct {
- Meta RadarRankingTopResponseMeta `json:"meta,required"`
- Top0 []RadarRankingTopResponseTop0 `json:"top_0,required"`
- JSON radarRankingTopResponseJSON `json:"-"`
-}
-
-// radarRankingTopResponseJSON contains the JSON metadata for the struct
-// [RadarRankingTopResponse]
-type radarRankingTopResponseJSON struct {
- Meta apijson.Field
- Top0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarRankingTopResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarRankingTopResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarRankingTopResponseMeta struct {
- Top0 RadarRankingTopResponseMetaTop0 `json:"top_0,required"`
- JSON radarRankingTopResponseMetaJSON `json:"-"`
-}
-
-// radarRankingTopResponseMetaJSON contains the JSON metadata for the struct
-// [RadarRankingTopResponseMeta]
-type radarRankingTopResponseMetaJSON struct {
- Top0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarRankingTopResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarRankingTopResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarRankingTopResponseMetaTop0 struct {
- Date string `json:"date,required"`
- JSON radarRankingTopResponseMetaTop0JSON `json:"-"`
-}
-
-// radarRankingTopResponseMetaTop0JSON contains the JSON metadata for the struct
-// [RadarRankingTopResponseMetaTop0]
-type radarRankingTopResponseMetaTop0JSON struct {
- Date apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarRankingTopResponseMetaTop0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarRankingTopResponseMetaTop0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarRankingTopResponseTop0 struct {
- Categories []RadarRankingTopResponseTop0Category `json:"categories,required"`
- Domain string `json:"domain,required"`
- Rank int64 `json:"rank,required"`
- // Only available in TRENDING rankings.
- PctRankChange float64 `json:"pctRankChange"`
- JSON radarRankingTopResponseTop0JSON `json:"-"`
-}
-
-// radarRankingTopResponseTop0JSON contains the JSON metadata for the struct
-// [RadarRankingTopResponseTop0]
-type radarRankingTopResponseTop0JSON struct {
- Categories apijson.Field
- Domain apijson.Field
- Rank apijson.Field
- PctRankChange apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarRankingTopResponseTop0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarRankingTopResponseTop0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarRankingTopResponseTop0Category struct {
- ID float64 `json:"id,required"`
- Name string `json:"name,required"`
- SuperCategoryID float64 `json:"superCategoryId,required"`
- JSON radarRankingTopResponseTop0CategoryJSON `json:"-"`
-}
-
-// radarRankingTopResponseTop0CategoryJSON contains the JSON metadata for the
-// struct [RadarRankingTopResponseTop0Category]
-type radarRankingTopResponseTop0CategoryJSON struct {
- ID apijson.Field
- Name apijson.Field
- SuperCategoryID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarRankingTopResponseTop0Category) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarRankingTopResponseTop0CategoryJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarRankingTimeseriesGroupsParams struct {
- // 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[[]RadarRankingTimeseriesGroupsParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Array of comma separated list of domains names.
- Domains param.Field[[]string] `query:"domains"`
- // Format results are returned in.
- Format param.Field[RadarRankingTimeseriesGroupsParamsFormat] `query:"format"`
- // Limit the number of objects in the response.
- Limit param.Field[int64] `query:"limit"`
- // Array of locations (alpha-2 country codes).
- 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"`
- // The ranking type.
- RankingType param.Field[RadarRankingTimeseriesGroupsParamsRankingType] `query:"rankingType"`
-}
-
-// URLQuery serializes [RadarRankingTimeseriesGroupsParams]'s query parameters as
-// `url.Values`.
-func (r RadarRankingTimeseriesGroupsParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type RadarRankingTimeseriesGroupsParamsDateRange string
-
-const (
- RadarRankingTimeseriesGroupsParamsDateRange1d RadarRankingTimeseriesGroupsParamsDateRange = "1d"
- RadarRankingTimeseriesGroupsParamsDateRange2d RadarRankingTimeseriesGroupsParamsDateRange = "2d"
- RadarRankingTimeseriesGroupsParamsDateRange7d RadarRankingTimeseriesGroupsParamsDateRange = "7d"
- RadarRankingTimeseriesGroupsParamsDateRange14d RadarRankingTimeseriesGroupsParamsDateRange = "14d"
- RadarRankingTimeseriesGroupsParamsDateRange28d RadarRankingTimeseriesGroupsParamsDateRange = "28d"
- RadarRankingTimeseriesGroupsParamsDateRange12w RadarRankingTimeseriesGroupsParamsDateRange = "12w"
- RadarRankingTimeseriesGroupsParamsDateRange24w RadarRankingTimeseriesGroupsParamsDateRange = "24w"
- RadarRankingTimeseriesGroupsParamsDateRange52w RadarRankingTimeseriesGroupsParamsDateRange = "52w"
- RadarRankingTimeseriesGroupsParamsDateRange1dControl RadarRankingTimeseriesGroupsParamsDateRange = "1dControl"
- RadarRankingTimeseriesGroupsParamsDateRange2dControl RadarRankingTimeseriesGroupsParamsDateRange = "2dControl"
- RadarRankingTimeseriesGroupsParamsDateRange7dControl RadarRankingTimeseriesGroupsParamsDateRange = "7dControl"
- RadarRankingTimeseriesGroupsParamsDateRange14dControl RadarRankingTimeseriesGroupsParamsDateRange = "14dControl"
- RadarRankingTimeseriesGroupsParamsDateRange28dControl RadarRankingTimeseriesGroupsParamsDateRange = "28dControl"
- RadarRankingTimeseriesGroupsParamsDateRange12wControl RadarRankingTimeseriesGroupsParamsDateRange = "12wControl"
- RadarRankingTimeseriesGroupsParamsDateRange24wControl RadarRankingTimeseriesGroupsParamsDateRange = "24wControl"
-)
-
-// Format results are returned in.
-type RadarRankingTimeseriesGroupsParamsFormat string
-
-const (
- RadarRankingTimeseriesGroupsParamsFormatJson RadarRankingTimeseriesGroupsParamsFormat = "JSON"
- RadarRankingTimeseriesGroupsParamsFormatCsv RadarRankingTimeseriesGroupsParamsFormat = "CSV"
-)
-
-// The ranking type.
-type RadarRankingTimeseriesGroupsParamsRankingType string
-
-const (
- RadarRankingTimeseriesGroupsParamsRankingTypePopular RadarRankingTimeseriesGroupsParamsRankingType = "POPULAR"
- RadarRankingTimeseriesGroupsParamsRankingTypeTrendingRise RadarRankingTimeseriesGroupsParamsRankingType = "TRENDING_RISE"
- RadarRankingTimeseriesGroupsParamsRankingTypeTrendingSteady RadarRankingTimeseriesGroupsParamsRankingType = "TRENDING_STEADY"
-)
-
-type RadarRankingTimeseriesGroupsResponseEnvelope struct {
- Result RadarRankingTimeseriesGroupsResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarRankingTimeseriesGroupsResponseEnvelopeJSON `json:"-"`
-}
-
-// radarRankingTimeseriesGroupsResponseEnvelopeJSON contains the JSON metadata for
-// the struct [RadarRankingTimeseriesGroupsResponseEnvelope]
-type radarRankingTimeseriesGroupsResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarRankingTimeseriesGroupsResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarRankingTimeseriesGroupsResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarRankingTopParams struct {
- // Array of dates to filter the ranking.
- Date param.Field[[]string] `query:"date"`
- // Format results are returned in.
- Format param.Field[RadarRankingTopParamsFormat] `query:"format"`
- // Limit the number of objects in the response.
- Limit param.Field[int64] `query:"limit"`
- // Array of locations (alpha-2 country codes).
- 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"`
- // The ranking type.
- RankingType param.Field[RadarRankingTopParamsRankingType] `query:"rankingType"`
-}
-
-// URLQuery serializes [RadarRankingTopParams]'s query parameters as `url.Values`.
-func (r RadarRankingTopParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Format results are returned in.
-type RadarRankingTopParamsFormat string
-
-const (
- RadarRankingTopParamsFormatJson RadarRankingTopParamsFormat = "JSON"
- RadarRankingTopParamsFormatCsv RadarRankingTopParamsFormat = "CSV"
-)
-
-// The ranking type.
-type RadarRankingTopParamsRankingType string
-
-const (
- RadarRankingTopParamsRankingTypePopular RadarRankingTopParamsRankingType = "POPULAR"
- RadarRankingTopParamsRankingTypeTrendingRise RadarRankingTopParamsRankingType = "TRENDING_RISE"
- RadarRankingTopParamsRankingTypeTrendingSteady RadarRankingTopParamsRankingType = "TRENDING_STEADY"
-)
-
-type RadarRankingTopResponseEnvelope struct {
- Result RadarRankingTopResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarRankingTopResponseEnvelopeJSON `json:"-"`
-}
-
-// radarRankingTopResponseEnvelopeJSON contains the JSON metadata for the struct
-// [RadarRankingTopResponseEnvelope]
-type radarRankingTopResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarRankingTopResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarRankingTopResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
diff --git a/radarranking_test.go b/radarranking_test.go
deleted file mode 100644
index cf806a60ced..00000000000
--- a/radarranking_test.go
+++ /dev/null
@@ -1,80 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
- "time"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRadarRankingTimeseriesGroupsWithOptionalParams(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"),
- )
- _, err := client.Radar.Ranking.TimeseriesGroups(context.TODO(), cloudflare.RadarRankingTimeseriesGroupsParams{
- DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
- DateRange: cloudflare.F([]cloudflare.RadarRankingTimeseriesGroupsParamsDateRange{cloudflare.RadarRankingTimeseriesGroupsParamsDateRange1d, cloudflare.RadarRankingTimeseriesGroupsParamsDateRange2d, cloudflare.RadarRankingTimeseriesGroupsParamsDateRange7d}),
- DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),
- Domains: cloudflare.F([]string{"string", "string", "string"}),
- Format: cloudflare.F(cloudflare.RadarRankingTimeseriesGroupsParamsFormatJson),
- Limit: cloudflare.F(int64(5)),
- Location: cloudflare.F([]string{"string", "string", "string"}),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- RankingType: cloudflare.F(cloudflare.RadarRankingTimeseriesGroupsParamsRankingTypePopular),
- })
- 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())
- }
-}
-
-func TestRadarRankingTopWithOptionalParams(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"),
- )
- _, err := client.Radar.Ranking.Top(context.TODO(), cloudflare.RadarRankingTopParams{
- Date: cloudflare.F([]string{"string", "string", "string"}),
- Format: cloudflare.F(cloudflare.RadarRankingTopParamsFormatJson),
- Limit: cloudflare.F(int64(5)),
- Location: cloudflare.F([]string{"string", "string", "string"}),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- RankingType: cloudflare.F(cloudflare.RadarRankingTopParamsRankingTypePopular),
- })
- 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/radarrankingdomain.go b/radarrankingdomain.go
deleted file mode 100644
index ca5df8530db..00000000000
--- a/radarrankingdomain.go
+++ /dev/null
@@ -1,211 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarRankingDomainService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewRadarRankingDomainService] method
-// instead.
-type RadarRankingDomainService struct {
- Options []option.RequestOption
-}
-
-// NewRadarRankingDomainService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewRadarRankingDomainService(opts ...option.RequestOption) (r *RadarRankingDomainService) {
- r = &RadarRankingDomainService{}
- r.Options = opts
- return
-}
-
-// Gets Domains Rank details. Cloudflare provides an ordered rank for the top 100
-// domains, but for the remainder it only provides ranking buckets like top 200
-// thousand, top one million, etc.. These are available through Radar datasets
-// endpoints.
-func (r *RadarRankingDomainService) Get(ctx context.Context, domain string, query RadarRankingDomainGetParams, opts ...option.RequestOption) (res *RadarRankingDomainGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarRankingDomainGetResponseEnvelope
- path := fmt.Sprintf("radar/ranking/domain/%s", domain)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type RadarRankingDomainGetResponse struct {
- Details0 RadarRankingDomainGetResponseDetails0 `json:"details_0,required"`
- JSON radarRankingDomainGetResponseJSON `json:"-"`
-}
-
-// radarRankingDomainGetResponseJSON contains the JSON metadata for the struct
-// [RadarRankingDomainGetResponse]
-type radarRankingDomainGetResponseJSON struct {
- Details0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarRankingDomainGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarRankingDomainGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarRankingDomainGetResponseDetails0 struct {
- Categories []RadarRankingDomainGetResponseDetails0Category `json:"categories,required"`
- TopLocations []RadarRankingDomainGetResponseDetails0TopLocation `json:"top_locations,required"`
- // Only available in POPULAR ranking for the most recent ranking.
- Bucket string `json:"bucket"`
- Rank int64 `json:"rank"`
- JSON radarRankingDomainGetResponseDetails0JSON `json:"-"`
-}
-
-// radarRankingDomainGetResponseDetails0JSON contains the JSON metadata for the
-// struct [RadarRankingDomainGetResponseDetails0]
-type radarRankingDomainGetResponseDetails0JSON struct {
- Categories apijson.Field
- TopLocations apijson.Field
- Bucket apijson.Field
- Rank apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarRankingDomainGetResponseDetails0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarRankingDomainGetResponseDetails0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarRankingDomainGetResponseDetails0Category struct {
- ID float64 `json:"id,required"`
- Name string `json:"name,required"`
- SuperCategoryID float64 `json:"superCategoryId,required"`
- JSON radarRankingDomainGetResponseDetails0CategoryJSON `json:"-"`
-}
-
-// radarRankingDomainGetResponseDetails0CategoryJSON contains the JSON metadata for
-// the struct [RadarRankingDomainGetResponseDetails0Category]
-type radarRankingDomainGetResponseDetails0CategoryJSON struct {
- ID apijson.Field
- Name apijson.Field
- SuperCategoryID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarRankingDomainGetResponseDetails0Category) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarRankingDomainGetResponseDetails0CategoryJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarRankingDomainGetResponseDetails0TopLocation struct {
- LocationCode string `json:"locationCode,required"`
- LocationName string `json:"locationName,required"`
- Rank int64 `json:"rank,required"`
- JSON radarRankingDomainGetResponseDetails0TopLocationJSON `json:"-"`
-}
-
-// radarRankingDomainGetResponseDetails0TopLocationJSON contains the JSON metadata
-// for the struct [RadarRankingDomainGetResponseDetails0TopLocation]
-type radarRankingDomainGetResponseDetails0TopLocationJSON struct {
- LocationCode apijson.Field
- LocationName apijson.Field
- Rank apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarRankingDomainGetResponseDetails0TopLocation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarRankingDomainGetResponseDetails0TopLocationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarRankingDomainGetParams struct {
- // Array of dates to filter the ranking.
- Date param.Field[[]string] `query:"date"`
- // Format results are returned in.
- Format param.Field[RadarRankingDomainGetParamsFormat] `query:"format"`
- // Limit the number of objects in the response.
- Limit param.Field[int64] `query:"limit"`
- // Array of names that will be used to name the series in responses.
- Name param.Field[[]string] `query:"name"`
- // The ranking type.
- RankingType param.Field[RadarRankingDomainGetParamsRankingType] `query:"rankingType"`
-}
-
-// URLQuery serializes [RadarRankingDomainGetParams]'s query parameters as
-// `url.Values`.
-func (r RadarRankingDomainGetParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Format results are returned in.
-type RadarRankingDomainGetParamsFormat string
-
-const (
- RadarRankingDomainGetParamsFormatJson RadarRankingDomainGetParamsFormat = "JSON"
- RadarRankingDomainGetParamsFormatCsv RadarRankingDomainGetParamsFormat = "CSV"
-)
-
-// The ranking type.
-type RadarRankingDomainGetParamsRankingType string
-
-const (
- RadarRankingDomainGetParamsRankingTypePopular RadarRankingDomainGetParamsRankingType = "POPULAR"
- RadarRankingDomainGetParamsRankingTypeTrendingRise RadarRankingDomainGetParamsRankingType = "TRENDING_RISE"
- RadarRankingDomainGetParamsRankingTypeTrendingSteady RadarRankingDomainGetParamsRankingType = "TRENDING_STEADY"
-)
-
-type RadarRankingDomainGetResponseEnvelope struct {
- Result RadarRankingDomainGetResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarRankingDomainGetResponseEnvelopeJSON `json:"-"`
-}
-
-// radarRankingDomainGetResponseEnvelopeJSON contains the JSON metadata for the
-// struct [RadarRankingDomainGetResponseEnvelope]
-type radarRankingDomainGetResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarRankingDomainGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarRankingDomainGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
diff --git a/radarrankingdomain_test.go b/radarrankingdomain_test.go
deleted file mode 100644
index 86a1027f181..00000000000
--- a/radarrankingdomain_test.go
+++ /dev/null
@@ -1,48 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRadarRankingDomainGetWithOptionalParams(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"),
- )
- _, err := client.Radar.Ranking.Domain.Get(
- context.TODO(),
- "google.com",
- cloudflare.RadarRankingDomainGetParams{
- Date: cloudflare.F([]string{"string", "string", "string"}),
- Format: cloudflare.F(cloudflare.RadarRankingDomainGetParamsFormatJson),
- Limit: cloudflare.F(int64(5)),
- Name: cloudflare.F([]string{"string", "string", "string"}),
- RankingType: cloudflare.F(cloudflare.RadarRankingDomainGetParamsRankingTypePopular),
- },
- )
- 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/radarsearch.go b/radarsearch.go
deleted file mode 100644
index b53831905fe..00000000000
--- a/radarsearch.go
+++ /dev/null
@@ -1,165 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "net/http"
- "net/url"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarSearchService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewRadarSearchService] method
-// instead.
-type RadarSearchService struct {
- Options []option.RequestOption
-}
-
-// NewRadarSearchService generates a new service that applies the given options to
-// each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewRadarSearchService(opts ...option.RequestOption) (r *RadarSearchService) {
- r = &RadarSearchService{}
- r.Options = opts
- return
-}
-
-// Lets you search for locations, autonomous systems (AS) and reports.
-func (r *RadarSearchService) Global(ctx context.Context, query RadarSearchGlobalParams, opts ...option.RequestOption) (res *RadarSearchGlobalResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarSearchGlobalResponseEnvelope
- path := "radar/search/global"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type RadarSearchGlobalResponse struct {
- Search []RadarSearchGlobalResponseSearch `json:"search,required"`
- JSON radarSearchGlobalResponseJSON `json:"-"`
-}
-
-// radarSearchGlobalResponseJSON contains the JSON metadata for the struct
-// [RadarSearchGlobalResponse]
-type radarSearchGlobalResponseJSON struct {
- Search apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarSearchGlobalResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarSearchGlobalResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarSearchGlobalResponseSearch struct {
- Code string `json:"code,required"`
- Name string `json:"name,required"`
- Type string `json:"type,required"`
- JSON radarSearchGlobalResponseSearchJSON `json:"-"`
-}
-
-// radarSearchGlobalResponseSearchJSON contains the JSON metadata for the struct
-// [RadarSearchGlobalResponseSearch]
-type radarSearchGlobalResponseSearchJSON struct {
- Code apijson.Field
- Name apijson.Field
- Type apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarSearchGlobalResponseSearch) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarSearchGlobalResponseSearchJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarSearchGlobalParams struct {
- // Search for locations, AS and reports.
- Query param.Field[string] `query:"query,required"`
- // Search types to be excluded from results.
- Exclude param.Field[[]RadarSearchGlobalParamsExclude] `query:"exclude"`
- // Format results are returned in.
- Format param.Field[RadarSearchGlobalParamsFormat] `query:"format"`
- // Search types to be included in results.
- Include param.Field[[]RadarSearchGlobalParamsInclude] `query:"include"`
- // Limit the number of objects in the response.
- Limit param.Field[int64] `query:"limit"`
- // Limit the number of objects per search category.
- LimitPerGroup param.Field[float64] `query:"limitPerGroup"`
-}
-
-// URLQuery serializes [RadarSearchGlobalParams]'s query parameters as
-// `url.Values`.
-func (r RadarSearchGlobalParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type RadarSearchGlobalParamsExclude string
-
-const (
- RadarSearchGlobalParamsExcludeSpecialEvents RadarSearchGlobalParamsExclude = "SPECIAL_EVENTS"
- RadarSearchGlobalParamsExcludeNotebooks RadarSearchGlobalParamsExclude = "NOTEBOOKS"
- RadarSearchGlobalParamsExcludeLocations RadarSearchGlobalParamsExclude = "LOCATIONS"
- RadarSearchGlobalParamsExcludeASNs RadarSearchGlobalParamsExclude = "ASNS"
-)
-
-// Format results are returned in.
-type RadarSearchGlobalParamsFormat string
-
-const (
- RadarSearchGlobalParamsFormatJson RadarSearchGlobalParamsFormat = "JSON"
- RadarSearchGlobalParamsFormatCsv RadarSearchGlobalParamsFormat = "CSV"
-)
-
-type RadarSearchGlobalParamsInclude string
-
-const (
- RadarSearchGlobalParamsIncludeSpecialEvents RadarSearchGlobalParamsInclude = "SPECIAL_EVENTS"
- RadarSearchGlobalParamsIncludeNotebooks RadarSearchGlobalParamsInclude = "NOTEBOOKS"
- RadarSearchGlobalParamsIncludeLocations RadarSearchGlobalParamsInclude = "LOCATIONS"
- RadarSearchGlobalParamsIncludeASNs RadarSearchGlobalParamsInclude = "ASNS"
-)
-
-type RadarSearchGlobalResponseEnvelope struct {
- Result RadarSearchGlobalResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarSearchGlobalResponseEnvelopeJSON `json:"-"`
-}
-
-// radarSearchGlobalResponseEnvelopeJSON contains the JSON metadata for the struct
-// [RadarSearchGlobalResponseEnvelope]
-type radarSearchGlobalResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarSearchGlobalResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarSearchGlobalResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
diff --git a/radarsearch_test.go b/radarsearch_test.go
deleted file mode 100644
index 63f476134de..00000000000
--- a/radarsearch_test.go
+++ /dev/null
@@ -1,45 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRadarSearchGlobalWithOptionalParams(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"),
- )
- _, err := client.Radar.Search.Global(context.TODO(), cloudflare.RadarSearchGlobalParams{
- Query: cloudflare.F("United"),
- Exclude: cloudflare.F([]cloudflare.RadarSearchGlobalParamsExclude{cloudflare.RadarSearchGlobalParamsExcludeSpecialEvents, cloudflare.RadarSearchGlobalParamsExcludeNotebooks, cloudflare.RadarSearchGlobalParamsExcludeLocations}),
- Format: cloudflare.F(cloudflare.RadarSearchGlobalParamsFormatJson),
- Include: cloudflare.F([]cloudflare.RadarSearchGlobalParamsInclude{cloudflare.RadarSearchGlobalParamsIncludeSpecialEvents, cloudflare.RadarSearchGlobalParamsIncludeNotebooks, cloudflare.RadarSearchGlobalParamsIncludeLocations}),
- Limit: cloudflare.F(int64(5)),
- LimitPerGroup: cloudflare.F(0.000000),
- })
- 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/radartrafficanomaly.go b/radartrafficanomaly.go
deleted file mode 100644
index 4639abd0b6c..00000000000
--- a/radartrafficanomaly.go
+++ /dev/null
@@ -1,271 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarTrafficAnomalyService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewRadarTrafficAnomalyService]
-// method instead.
-type RadarTrafficAnomalyService struct {
- Options []option.RequestOption
- Locations *RadarTrafficAnomalyLocationService
-}
-
-// NewRadarTrafficAnomalyService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewRadarTrafficAnomalyService(opts ...option.RequestOption) (r *RadarTrafficAnomalyService) {
- r = &RadarTrafficAnomalyService{}
- r.Options = opts
- r.Locations = NewRadarTrafficAnomalyLocationService(opts...)
- return
-}
-
-// Internet traffic anomalies are signals that might point to an outage, These
-// alerts are automatically detected by Radar and then manually verified by our
-// team. This endpoint returns the latest alerts.
-func (r *RadarTrafficAnomalyService) Get(ctx context.Context, query RadarTrafficAnomalyGetParams, opts ...option.RequestOption) (res *RadarTrafficAnomalyGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarTrafficAnomalyGetResponseEnvelope
- path := "radar/traffic_anomalies"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type RadarTrafficAnomalyGetResponse struct {
- TrafficAnomalies []RadarTrafficAnomalyGetResponseTrafficAnomaly `json:"trafficAnomalies,required"`
- JSON radarTrafficAnomalyGetResponseJSON `json:"-"`
-}
-
-// radarTrafficAnomalyGetResponseJSON contains the JSON metadata for the struct
-// [RadarTrafficAnomalyGetResponse]
-type radarTrafficAnomalyGetResponseJSON struct {
- TrafficAnomalies apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarTrafficAnomalyGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarTrafficAnomalyGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarTrafficAnomalyGetResponseTrafficAnomaly struct {
- StartDate string `json:"startDate,required"`
- Status string `json:"status,required"`
- Type string `json:"type,required"`
- UUID string `json:"uuid,required"`
- ASNDetails RadarTrafficAnomalyGetResponseTrafficAnomaliesASNDetails `json:"asnDetails"`
- EndDate string `json:"endDate"`
- LocationDetails RadarTrafficAnomalyGetResponseTrafficAnomaliesLocationDetails `json:"locationDetails"`
- VisibleInDataSources []string `json:"visibleInDataSources"`
- JSON radarTrafficAnomalyGetResponseTrafficAnomalyJSON `json:"-"`
-}
-
-// radarTrafficAnomalyGetResponseTrafficAnomalyJSON contains the JSON metadata for
-// the struct [RadarTrafficAnomalyGetResponseTrafficAnomaly]
-type radarTrafficAnomalyGetResponseTrafficAnomalyJSON struct {
- StartDate apijson.Field
- Status apijson.Field
- Type apijson.Field
- UUID apijson.Field
- ASNDetails apijson.Field
- EndDate apijson.Field
- LocationDetails apijson.Field
- VisibleInDataSources apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarTrafficAnomalyGetResponseTrafficAnomaly) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarTrafficAnomalyGetResponseTrafficAnomalyJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarTrafficAnomalyGetResponseTrafficAnomaliesASNDetails struct {
- ASN string `json:"asn,required"`
- Name string `json:"name,required"`
- Locations RadarTrafficAnomalyGetResponseTrafficAnomaliesASNDetailsLocations `json:"locations"`
- JSON radarTrafficAnomalyGetResponseTrafficAnomaliesASNDetailsJSON `json:"-"`
-}
-
-// radarTrafficAnomalyGetResponseTrafficAnomaliesASNDetailsJSON contains the JSON
-// metadata for the struct
-// [RadarTrafficAnomalyGetResponseTrafficAnomaliesASNDetails]
-type radarTrafficAnomalyGetResponseTrafficAnomaliesASNDetailsJSON struct {
- ASN apijson.Field
- Name apijson.Field
- Locations apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarTrafficAnomalyGetResponseTrafficAnomaliesASNDetails) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarTrafficAnomalyGetResponseTrafficAnomaliesASNDetailsJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarTrafficAnomalyGetResponseTrafficAnomaliesASNDetailsLocations struct {
- Code string `json:"code,required"`
- Name string `json:"name,required"`
- JSON radarTrafficAnomalyGetResponseTrafficAnomaliesASNDetailsLocationsJSON `json:"-"`
-}
-
-// radarTrafficAnomalyGetResponseTrafficAnomaliesASNDetailsLocationsJSON contains
-// the JSON metadata for the struct
-// [RadarTrafficAnomalyGetResponseTrafficAnomaliesASNDetailsLocations]
-type radarTrafficAnomalyGetResponseTrafficAnomaliesASNDetailsLocationsJSON struct {
- Code apijson.Field
- Name apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarTrafficAnomalyGetResponseTrafficAnomaliesASNDetailsLocations) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarTrafficAnomalyGetResponseTrafficAnomaliesASNDetailsLocationsJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarTrafficAnomalyGetResponseTrafficAnomaliesLocationDetails struct {
- Code string `json:"code,required"`
- Name string `json:"name,required"`
- JSON radarTrafficAnomalyGetResponseTrafficAnomaliesLocationDetailsJSON `json:"-"`
-}
-
-// radarTrafficAnomalyGetResponseTrafficAnomaliesLocationDetailsJSON contains the
-// JSON metadata for the struct
-// [RadarTrafficAnomalyGetResponseTrafficAnomaliesLocationDetails]
-type radarTrafficAnomalyGetResponseTrafficAnomaliesLocationDetailsJSON struct {
- Code apijson.Field
- Name apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarTrafficAnomalyGetResponseTrafficAnomaliesLocationDetails) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarTrafficAnomalyGetResponseTrafficAnomaliesLocationDetailsJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarTrafficAnomalyGetParams struct {
- // Single ASN as integer.
- ASN param.Field[int64] `query:"asn"`
- // End of the date range (inclusive).
- DateEnd param.Field[time.Time] `query:"dateEnd" format:"date-time"`
- // Shorthand date ranges for the last X days - use when you don't need specific
- // start and end dates.
- DateRange param.Field[RadarTrafficAnomalyGetParamsDateRange] `query:"dateRange"`
- // Start of the date range (inclusive).
- DateStart param.Field[time.Time] `query:"dateStart" format:"date-time"`
- // Format results are returned in.
- Format param.Field[RadarTrafficAnomalyGetParamsFormat] `query:"format"`
- // Limit the number of objects in the response.
- Limit param.Field[int64] `query:"limit"`
- // Location Alpha2 code.
- Location param.Field[string] `query:"location"`
- // Number of objects to skip before grabbing results.
- Offset param.Field[int64] `query:"offset"`
- Status param.Field[RadarTrafficAnomalyGetParamsStatus] `query:"status"`
-}
-
-// URLQuery serializes [RadarTrafficAnomalyGetParams]'s query parameters as
-// `url.Values`.
-func (r RadarTrafficAnomalyGetParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Shorthand date ranges for the last X days - use when you don't need specific
-// start and end dates.
-type RadarTrafficAnomalyGetParamsDateRange string
-
-const (
- RadarTrafficAnomalyGetParamsDateRange1d RadarTrafficAnomalyGetParamsDateRange = "1d"
- RadarTrafficAnomalyGetParamsDateRange2d RadarTrafficAnomalyGetParamsDateRange = "2d"
- RadarTrafficAnomalyGetParamsDateRange7d RadarTrafficAnomalyGetParamsDateRange = "7d"
- RadarTrafficAnomalyGetParamsDateRange14d RadarTrafficAnomalyGetParamsDateRange = "14d"
- RadarTrafficAnomalyGetParamsDateRange28d RadarTrafficAnomalyGetParamsDateRange = "28d"
- RadarTrafficAnomalyGetParamsDateRange12w RadarTrafficAnomalyGetParamsDateRange = "12w"
- RadarTrafficAnomalyGetParamsDateRange24w RadarTrafficAnomalyGetParamsDateRange = "24w"
- RadarTrafficAnomalyGetParamsDateRange52w RadarTrafficAnomalyGetParamsDateRange = "52w"
- RadarTrafficAnomalyGetParamsDateRange1dControl RadarTrafficAnomalyGetParamsDateRange = "1dControl"
- RadarTrafficAnomalyGetParamsDateRange2dControl RadarTrafficAnomalyGetParamsDateRange = "2dControl"
- RadarTrafficAnomalyGetParamsDateRange7dControl RadarTrafficAnomalyGetParamsDateRange = "7dControl"
- RadarTrafficAnomalyGetParamsDateRange14dControl RadarTrafficAnomalyGetParamsDateRange = "14dControl"
- RadarTrafficAnomalyGetParamsDateRange28dControl RadarTrafficAnomalyGetParamsDateRange = "28dControl"
- RadarTrafficAnomalyGetParamsDateRange12wControl RadarTrafficAnomalyGetParamsDateRange = "12wControl"
- RadarTrafficAnomalyGetParamsDateRange24wControl RadarTrafficAnomalyGetParamsDateRange = "24wControl"
-)
-
-// Format results are returned in.
-type RadarTrafficAnomalyGetParamsFormat string
-
-const (
- RadarTrafficAnomalyGetParamsFormatJson RadarTrafficAnomalyGetParamsFormat = "JSON"
- RadarTrafficAnomalyGetParamsFormatCsv RadarTrafficAnomalyGetParamsFormat = "CSV"
-)
-
-type RadarTrafficAnomalyGetParamsStatus string
-
-const (
- RadarTrafficAnomalyGetParamsStatusVerified RadarTrafficAnomalyGetParamsStatus = "VERIFIED"
- RadarTrafficAnomalyGetParamsStatusUnverified RadarTrafficAnomalyGetParamsStatus = "UNVERIFIED"
-)
-
-type RadarTrafficAnomalyGetResponseEnvelope struct {
- Result RadarTrafficAnomalyGetResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarTrafficAnomalyGetResponseEnvelopeJSON `json:"-"`
-}
-
-// radarTrafficAnomalyGetResponseEnvelopeJSON contains the JSON metadata for the
-// struct [RadarTrafficAnomalyGetResponseEnvelope]
-type radarTrafficAnomalyGetResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarTrafficAnomalyGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarTrafficAnomalyGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
diff --git a/radartrafficanomaly_test.go b/radartrafficanomaly_test.go
deleted file mode 100644
index ec1e88ebd76..00000000000
--- a/radartrafficanomaly_test.go
+++ /dev/null
@@ -1,49 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
- "time"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRadarTrafficAnomalyGetWithOptionalParams(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"),
- )
- _, err := client.Radar.TrafficAnomalies.Get(context.TODO(), cloudflare.RadarTrafficAnomalyGetParams{
- ASN: cloudflare.F(int64(0)),
- DateEnd: cloudflare.F(time.Now()),
- DateRange: cloudflare.F(cloudflare.RadarTrafficAnomalyGetParamsDateRange7d),
- DateStart: cloudflare.F(time.Now()),
- Format: cloudflare.F(cloudflare.RadarTrafficAnomalyGetParamsFormatJson),
- Limit: cloudflare.F(int64(5)),
- Location: cloudflare.F("US"),
- Offset: cloudflare.F(int64(0)),
- Status: cloudflare.F(cloudflare.RadarTrafficAnomalyGetParamsStatusVerified),
- })
- 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/radartrafficanomalylocation.go b/radartrafficanomalylocation.go
deleted file mode 100644
index f21521cf79d..00000000000
--- a/radartrafficanomalylocation.go
+++ /dev/null
@@ -1,179 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarTrafficAnomalyLocationService contains methods and other services that help
-// with interacting with the cloudflare API. Note, unlike clients, this service
-// does not read variables from the environment automatically. You should not
-// instantiate this service directly, and instead use the
-// [NewRadarTrafficAnomalyLocationService] method instead.
-type RadarTrafficAnomalyLocationService struct {
- Options []option.RequestOption
-}
-
-// NewRadarTrafficAnomalyLocationService generates a new service that applies the
-// given options to each request. These options are applied after the parent
-// client's options (if there is one), and before any request-specific options.
-func NewRadarTrafficAnomalyLocationService(opts ...option.RequestOption) (r *RadarTrafficAnomalyLocationService) {
- r = &RadarTrafficAnomalyLocationService{}
- r.Options = opts
- return
-}
-
-// Internet traffic anomalies are signals that might point to an outage, These
-// alerts are automatically detected by Radar and then manually verified by our
-// team. This endpoint returns the sum of alerts grouped by location.
-func (r *RadarTrafficAnomalyLocationService) Get(ctx context.Context, query RadarTrafficAnomalyLocationGetParams, opts ...option.RequestOption) (res *RadarTrafficAnomalyLocationGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarTrafficAnomalyLocationGetResponseEnvelope
- path := "radar/traffic_anomalies/locations"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type RadarTrafficAnomalyLocationGetResponse struct {
- TrafficAnomalies []RadarTrafficAnomalyLocationGetResponseTrafficAnomaly `json:"trafficAnomalies,required"`
- JSON radarTrafficAnomalyLocationGetResponseJSON `json:"-"`
-}
-
-// radarTrafficAnomalyLocationGetResponseJSON contains the JSON metadata for the
-// struct [RadarTrafficAnomalyLocationGetResponse]
-type radarTrafficAnomalyLocationGetResponseJSON struct {
- TrafficAnomalies apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarTrafficAnomalyLocationGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarTrafficAnomalyLocationGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarTrafficAnomalyLocationGetResponseTrafficAnomaly struct {
- ClientCountryAlpha2 string `json:"clientCountryAlpha2,required"`
- ClientCountryName string `json:"clientCountryName,required"`
- Value string `json:"value,required"`
- JSON radarTrafficAnomalyLocationGetResponseTrafficAnomalyJSON `json:"-"`
-}
-
-// radarTrafficAnomalyLocationGetResponseTrafficAnomalyJSON contains the JSON
-// metadata for the struct [RadarTrafficAnomalyLocationGetResponseTrafficAnomaly]
-type radarTrafficAnomalyLocationGetResponseTrafficAnomalyJSON struct {
- ClientCountryAlpha2 apijson.Field
- ClientCountryName apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarTrafficAnomalyLocationGetResponseTrafficAnomaly) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarTrafficAnomalyLocationGetResponseTrafficAnomalyJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarTrafficAnomalyLocationGetParams struct {
- // End of the date range (inclusive).
- DateEnd param.Field[time.Time] `query:"dateEnd" format:"date-time"`
- // Shorthand date ranges for the last X days - use when you don't need specific
- // start and end dates.
- DateRange param.Field[RadarTrafficAnomalyLocationGetParamsDateRange] `query:"dateRange"`
- // Start of the date range (inclusive).
- DateStart param.Field[time.Time] `query:"dateStart" format:"date-time"`
- // Format results are returned in.
- Format param.Field[RadarTrafficAnomalyLocationGetParamsFormat] `query:"format"`
- // Limit the number of objects in the response.
- Limit param.Field[int64] `query:"limit"`
- Status param.Field[RadarTrafficAnomalyLocationGetParamsStatus] `query:"status"`
-}
-
-// URLQuery serializes [RadarTrafficAnomalyLocationGetParams]'s query parameters as
-// `url.Values`.
-func (r RadarTrafficAnomalyLocationGetParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Shorthand date ranges for the last X days - use when you don't need specific
-// start and end dates.
-type RadarTrafficAnomalyLocationGetParamsDateRange string
-
-const (
- RadarTrafficAnomalyLocationGetParamsDateRange1d RadarTrafficAnomalyLocationGetParamsDateRange = "1d"
- RadarTrafficAnomalyLocationGetParamsDateRange2d RadarTrafficAnomalyLocationGetParamsDateRange = "2d"
- RadarTrafficAnomalyLocationGetParamsDateRange7d RadarTrafficAnomalyLocationGetParamsDateRange = "7d"
- RadarTrafficAnomalyLocationGetParamsDateRange14d RadarTrafficAnomalyLocationGetParamsDateRange = "14d"
- RadarTrafficAnomalyLocationGetParamsDateRange28d RadarTrafficAnomalyLocationGetParamsDateRange = "28d"
- RadarTrafficAnomalyLocationGetParamsDateRange12w RadarTrafficAnomalyLocationGetParamsDateRange = "12w"
- RadarTrafficAnomalyLocationGetParamsDateRange24w RadarTrafficAnomalyLocationGetParamsDateRange = "24w"
- RadarTrafficAnomalyLocationGetParamsDateRange52w RadarTrafficAnomalyLocationGetParamsDateRange = "52w"
- RadarTrafficAnomalyLocationGetParamsDateRange1dControl RadarTrafficAnomalyLocationGetParamsDateRange = "1dControl"
- RadarTrafficAnomalyLocationGetParamsDateRange2dControl RadarTrafficAnomalyLocationGetParamsDateRange = "2dControl"
- RadarTrafficAnomalyLocationGetParamsDateRange7dControl RadarTrafficAnomalyLocationGetParamsDateRange = "7dControl"
- RadarTrafficAnomalyLocationGetParamsDateRange14dControl RadarTrafficAnomalyLocationGetParamsDateRange = "14dControl"
- RadarTrafficAnomalyLocationGetParamsDateRange28dControl RadarTrafficAnomalyLocationGetParamsDateRange = "28dControl"
- RadarTrafficAnomalyLocationGetParamsDateRange12wControl RadarTrafficAnomalyLocationGetParamsDateRange = "12wControl"
- RadarTrafficAnomalyLocationGetParamsDateRange24wControl RadarTrafficAnomalyLocationGetParamsDateRange = "24wControl"
-)
-
-// Format results are returned in.
-type RadarTrafficAnomalyLocationGetParamsFormat string
-
-const (
- RadarTrafficAnomalyLocationGetParamsFormatJson RadarTrafficAnomalyLocationGetParamsFormat = "JSON"
- RadarTrafficAnomalyLocationGetParamsFormatCsv RadarTrafficAnomalyLocationGetParamsFormat = "CSV"
-)
-
-type RadarTrafficAnomalyLocationGetParamsStatus string
-
-const (
- RadarTrafficAnomalyLocationGetParamsStatusVerified RadarTrafficAnomalyLocationGetParamsStatus = "VERIFIED"
- RadarTrafficAnomalyLocationGetParamsStatusUnverified RadarTrafficAnomalyLocationGetParamsStatus = "UNVERIFIED"
-)
-
-type RadarTrafficAnomalyLocationGetResponseEnvelope struct {
- Result RadarTrafficAnomalyLocationGetResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarTrafficAnomalyLocationGetResponseEnvelopeJSON `json:"-"`
-}
-
-// radarTrafficAnomalyLocationGetResponseEnvelopeJSON contains the JSON metadata
-// for the struct [RadarTrafficAnomalyLocationGetResponseEnvelope]
-type radarTrafficAnomalyLocationGetResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarTrafficAnomalyLocationGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarTrafficAnomalyLocationGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
diff --git a/radartrafficanomalylocation_test.go b/radartrafficanomalylocation_test.go
deleted file mode 100644
index 299c7fc81b2..00000000000
--- a/radartrafficanomalylocation_test.go
+++ /dev/null
@@ -1,46 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
- "time"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRadarTrafficAnomalyLocationGetWithOptionalParams(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"),
- )
- _, err := client.Radar.TrafficAnomalies.Locations.Get(context.TODO(), cloudflare.RadarTrafficAnomalyLocationGetParams{
- DateEnd: cloudflare.F(time.Now()),
- DateRange: cloudflare.F(cloudflare.RadarTrafficAnomalyLocationGetParamsDateRange7d),
- DateStart: cloudflare.F(time.Now()),
- Format: cloudflare.F(cloudflare.RadarTrafficAnomalyLocationGetParamsFormatJson),
- Limit: cloudflare.F(int64(5)),
- Status: cloudflare.F(cloudflare.RadarTrafficAnomalyLocationGetParamsStatusVerified),
- })
- 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/radarverifiedbot.go b/radarverifiedbot.go
deleted file mode 100644
index cffe7eb0a4b..00000000000
--- a/radarverifiedbot.go
+++ /dev/null
@@ -1,27 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarVerifiedBotService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewRadarVerifiedBotService] method
-// instead.
-type RadarVerifiedBotService struct {
- Options []option.RequestOption
- Top *RadarVerifiedBotTopService
-}
-
-// NewRadarVerifiedBotService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewRadarVerifiedBotService(opts ...option.RequestOption) (r *RadarVerifiedBotService) {
- r = &RadarVerifiedBotService{}
- r.Options = opts
- r.Top = NewRadarVerifiedBotTopService(opts...)
- return
-}
diff --git a/radarverifiedbottop.go b/radarverifiedbottop.go
deleted file mode 100644
index 1c1e60a319a..00000000000
--- a/radarverifiedbottop.go
+++ /dev/null
@@ -1,546 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RadarVerifiedBotTopService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewRadarVerifiedBotTopService]
-// method instead.
-type RadarVerifiedBotTopService struct {
- Options []option.RequestOption
-}
-
-// NewRadarVerifiedBotTopService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewRadarVerifiedBotTopService(opts ...option.RequestOption) (r *RadarVerifiedBotTopService) {
- r = &RadarVerifiedBotTopService{}
- r.Options = opts
- return
-}
-
-// Get top verified bots by HTTP requests, with owner and category.
-func (r *RadarVerifiedBotTopService) Bots(ctx context.Context, query RadarVerifiedBotTopBotsParams, opts ...option.RequestOption) (res *RadarVerifiedBotTopBotsResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarVerifiedBotTopBotsResponseEnvelope
- path := "radar/verified_bots/top/bots"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Get top verified bot categories by HTTP requests, along with their corresponding
-// percentage, over the total verified bot HTTP requests.
-func (r *RadarVerifiedBotTopService) Categories(ctx context.Context, query RadarVerifiedBotTopCategoriesParams, opts ...option.RequestOption) (res *RadarVerifiedBotTopCategoriesResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RadarVerifiedBotTopCategoriesResponseEnvelope
- path := "radar/verified_bots/top/categories"
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type RadarVerifiedBotTopBotsResponse struct {
- Meta RadarVerifiedBotTopBotsResponseMeta `json:"meta,required"`
- Top0 []RadarVerifiedBotTopBotsResponseTop0 `json:"top_0,required"`
- JSON radarVerifiedBotTopBotsResponseJSON `json:"-"`
-}
-
-// radarVerifiedBotTopBotsResponseJSON contains the JSON metadata for the struct
-// [RadarVerifiedBotTopBotsResponse]
-type radarVerifiedBotTopBotsResponseJSON struct {
- Meta apijson.Field
- Top0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarVerifiedBotTopBotsResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarVerifiedBotTopBotsResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarVerifiedBotTopBotsResponseMeta struct {
- DateRange []RadarVerifiedBotTopBotsResponseMetaDateRange `json:"dateRange,required"`
- ConfidenceInfo RadarVerifiedBotTopBotsResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarVerifiedBotTopBotsResponseMetaJSON `json:"-"`
-}
-
-// radarVerifiedBotTopBotsResponseMetaJSON contains the JSON metadata for the
-// struct [RadarVerifiedBotTopBotsResponseMeta]
-type radarVerifiedBotTopBotsResponseMetaJSON struct {
- DateRange apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarVerifiedBotTopBotsResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarVerifiedBotTopBotsResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarVerifiedBotTopBotsResponseMetaDateRange 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 radarVerifiedBotTopBotsResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarVerifiedBotTopBotsResponseMetaDateRangeJSON contains the JSON metadata for
-// the struct [RadarVerifiedBotTopBotsResponseMetaDateRange]
-type radarVerifiedBotTopBotsResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarVerifiedBotTopBotsResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarVerifiedBotTopBotsResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarVerifiedBotTopBotsResponseMetaConfidenceInfo struct {
- Annotations []RadarVerifiedBotTopBotsResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarVerifiedBotTopBotsResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarVerifiedBotTopBotsResponseMetaConfidenceInfoJSON contains the JSON metadata
-// for the struct [RadarVerifiedBotTopBotsResponseMetaConfidenceInfo]
-type radarVerifiedBotTopBotsResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarVerifiedBotTopBotsResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarVerifiedBotTopBotsResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarVerifiedBotTopBotsResponseMetaConfidenceInfoAnnotation 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 radarVerifiedBotTopBotsResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarVerifiedBotTopBotsResponseMetaConfidenceInfoAnnotationJSON contains the
-// JSON metadata for the struct
-// [RadarVerifiedBotTopBotsResponseMetaConfidenceInfoAnnotation]
-type radarVerifiedBotTopBotsResponseMetaConfidenceInfoAnnotationJSON 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 *RadarVerifiedBotTopBotsResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarVerifiedBotTopBotsResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarVerifiedBotTopBotsResponseTop0 struct {
- BotCategory string `json:"botCategory,required"`
- BotName string `json:"botName,required"`
- BotOwner string `json:"botOwner,required"`
- Value string `json:"value,required"`
- JSON radarVerifiedBotTopBotsResponseTop0JSON `json:"-"`
-}
-
-// radarVerifiedBotTopBotsResponseTop0JSON contains the JSON metadata for the
-// struct [RadarVerifiedBotTopBotsResponseTop0]
-type radarVerifiedBotTopBotsResponseTop0JSON struct {
- BotCategory apijson.Field
- BotName apijson.Field
- BotOwner apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarVerifiedBotTopBotsResponseTop0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarVerifiedBotTopBotsResponseTop0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarVerifiedBotTopCategoriesResponse struct {
- Meta RadarVerifiedBotTopCategoriesResponseMeta `json:"meta,required"`
- Top0 []RadarVerifiedBotTopCategoriesResponseTop0 `json:"top_0,required"`
- JSON radarVerifiedBotTopCategoriesResponseJSON `json:"-"`
-}
-
-// radarVerifiedBotTopCategoriesResponseJSON contains the JSON metadata for the
-// struct [RadarVerifiedBotTopCategoriesResponse]
-type radarVerifiedBotTopCategoriesResponseJSON struct {
- Meta apijson.Field
- Top0 apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarVerifiedBotTopCategoriesResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarVerifiedBotTopCategoriesResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarVerifiedBotTopCategoriesResponseMeta struct {
- DateRange []RadarVerifiedBotTopCategoriesResponseMetaDateRange `json:"dateRange,required"`
- ConfidenceInfo RadarVerifiedBotTopCategoriesResponseMetaConfidenceInfo `json:"confidenceInfo"`
- JSON radarVerifiedBotTopCategoriesResponseMetaJSON `json:"-"`
-}
-
-// radarVerifiedBotTopCategoriesResponseMetaJSON contains the JSON metadata for the
-// struct [RadarVerifiedBotTopCategoriesResponseMeta]
-type radarVerifiedBotTopCategoriesResponseMetaJSON struct {
- DateRange apijson.Field
- ConfidenceInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarVerifiedBotTopCategoriesResponseMeta) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarVerifiedBotTopCategoriesResponseMetaJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarVerifiedBotTopCategoriesResponseMetaDateRange 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 radarVerifiedBotTopCategoriesResponseMetaDateRangeJSON `json:"-"`
-}
-
-// radarVerifiedBotTopCategoriesResponseMetaDateRangeJSON contains the JSON
-// metadata for the struct [RadarVerifiedBotTopCategoriesResponseMetaDateRange]
-type radarVerifiedBotTopCategoriesResponseMetaDateRangeJSON struct {
- EndTime apijson.Field
- StartTime apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarVerifiedBotTopCategoriesResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarVerifiedBotTopCategoriesResponseMetaDateRangeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarVerifiedBotTopCategoriesResponseMetaConfidenceInfo struct {
- Annotations []RadarVerifiedBotTopCategoriesResponseMetaConfidenceInfoAnnotation `json:"annotations"`
- Level int64 `json:"level"`
- JSON radarVerifiedBotTopCategoriesResponseMetaConfidenceInfoJSON `json:"-"`
-}
-
-// radarVerifiedBotTopCategoriesResponseMetaConfidenceInfoJSON contains the JSON
-// metadata for the struct
-// [RadarVerifiedBotTopCategoriesResponseMetaConfidenceInfo]
-type radarVerifiedBotTopCategoriesResponseMetaConfidenceInfoJSON struct {
- Annotations apijson.Field
- Level apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarVerifiedBotTopCategoriesResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarVerifiedBotTopCategoriesResponseMetaConfidenceInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarVerifiedBotTopCategoriesResponseMetaConfidenceInfoAnnotation 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 radarVerifiedBotTopCategoriesResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
-}
-
-// radarVerifiedBotTopCategoriesResponseMetaConfidenceInfoAnnotationJSON contains
-// the JSON metadata for the struct
-// [RadarVerifiedBotTopCategoriesResponseMetaConfidenceInfoAnnotation]
-type radarVerifiedBotTopCategoriesResponseMetaConfidenceInfoAnnotationJSON 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 *RadarVerifiedBotTopCategoriesResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarVerifiedBotTopCategoriesResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarVerifiedBotTopCategoriesResponseTop0 struct {
- BotCategory string `json:"botCategory,required"`
- Value string `json:"value,required"`
- JSON radarVerifiedBotTopCategoriesResponseTop0JSON `json:"-"`
-}
-
-// radarVerifiedBotTopCategoriesResponseTop0JSON contains the JSON metadata for the
-// struct [RadarVerifiedBotTopCategoriesResponseTop0]
-type radarVerifiedBotTopCategoriesResponseTop0JSON struct {
- BotCategory apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarVerifiedBotTopCategoriesResponseTop0) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarVerifiedBotTopCategoriesResponseTop0JSON) RawJSON() string {
- return r.raw
-}
-
-type RadarVerifiedBotTopBotsParams 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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarVerifiedBotTopBotsParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Format results are returned in.
- Format param.Field[RadarVerifiedBotTopBotsParamsFormat] `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 [RadarVerifiedBotTopBotsParams]'s query parameters as
-// `url.Values`.
-func (r RadarVerifiedBotTopBotsParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type RadarVerifiedBotTopBotsParamsDateRange string
-
-const (
- RadarVerifiedBotTopBotsParamsDateRange1d RadarVerifiedBotTopBotsParamsDateRange = "1d"
- RadarVerifiedBotTopBotsParamsDateRange2d RadarVerifiedBotTopBotsParamsDateRange = "2d"
- RadarVerifiedBotTopBotsParamsDateRange7d RadarVerifiedBotTopBotsParamsDateRange = "7d"
- RadarVerifiedBotTopBotsParamsDateRange14d RadarVerifiedBotTopBotsParamsDateRange = "14d"
- RadarVerifiedBotTopBotsParamsDateRange28d RadarVerifiedBotTopBotsParamsDateRange = "28d"
- RadarVerifiedBotTopBotsParamsDateRange12w RadarVerifiedBotTopBotsParamsDateRange = "12w"
- RadarVerifiedBotTopBotsParamsDateRange24w RadarVerifiedBotTopBotsParamsDateRange = "24w"
- RadarVerifiedBotTopBotsParamsDateRange52w RadarVerifiedBotTopBotsParamsDateRange = "52w"
- RadarVerifiedBotTopBotsParamsDateRange1dControl RadarVerifiedBotTopBotsParamsDateRange = "1dControl"
- RadarVerifiedBotTopBotsParamsDateRange2dControl RadarVerifiedBotTopBotsParamsDateRange = "2dControl"
- RadarVerifiedBotTopBotsParamsDateRange7dControl RadarVerifiedBotTopBotsParamsDateRange = "7dControl"
- RadarVerifiedBotTopBotsParamsDateRange14dControl RadarVerifiedBotTopBotsParamsDateRange = "14dControl"
- RadarVerifiedBotTopBotsParamsDateRange28dControl RadarVerifiedBotTopBotsParamsDateRange = "28dControl"
- RadarVerifiedBotTopBotsParamsDateRange12wControl RadarVerifiedBotTopBotsParamsDateRange = "12wControl"
- RadarVerifiedBotTopBotsParamsDateRange24wControl RadarVerifiedBotTopBotsParamsDateRange = "24wControl"
-)
-
-// Format results are returned in.
-type RadarVerifiedBotTopBotsParamsFormat string
-
-const (
- RadarVerifiedBotTopBotsParamsFormatJson RadarVerifiedBotTopBotsParamsFormat = "JSON"
- RadarVerifiedBotTopBotsParamsFormatCsv RadarVerifiedBotTopBotsParamsFormat = "CSV"
-)
-
-type RadarVerifiedBotTopBotsResponseEnvelope struct {
- Result RadarVerifiedBotTopBotsResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarVerifiedBotTopBotsResponseEnvelopeJSON `json:"-"`
-}
-
-// radarVerifiedBotTopBotsResponseEnvelopeJSON contains the JSON metadata for the
-// struct [RadarVerifiedBotTopBotsResponseEnvelope]
-type radarVerifiedBotTopBotsResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarVerifiedBotTopBotsResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarVerifiedBotTopBotsResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RadarVerifiedBotTopCategoriesParams 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"`
- // 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
- // week. Use this parameter or set specific start and end dates (`dateStart` and
- // `dateEnd` parameters).
- DateRange param.Field[[]RadarVerifiedBotTopCategoriesParamsDateRange] `query:"dateRange"`
- // Array of datetimes to filter the start of a series.
- DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
- // Format results are returned in.
- Format param.Field[RadarVerifiedBotTopCategoriesParamsFormat] `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 [RadarVerifiedBotTopCategoriesParams]'s query parameters as
-// `url.Values`.
-func (r RadarVerifiedBotTopCategoriesParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type RadarVerifiedBotTopCategoriesParamsDateRange string
-
-const (
- RadarVerifiedBotTopCategoriesParamsDateRange1d RadarVerifiedBotTopCategoriesParamsDateRange = "1d"
- RadarVerifiedBotTopCategoriesParamsDateRange2d RadarVerifiedBotTopCategoriesParamsDateRange = "2d"
- RadarVerifiedBotTopCategoriesParamsDateRange7d RadarVerifiedBotTopCategoriesParamsDateRange = "7d"
- RadarVerifiedBotTopCategoriesParamsDateRange14d RadarVerifiedBotTopCategoriesParamsDateRange = "14d"
- RadarVerifiedBotTopCategoriesParamsDateRange28d RadarVerifiedBotTopCategoriesParamsDateRange = "28d"
- RadarVerifiedBotTopCategoriesParamsDateRange12w RadarVerifiedBotTopCategoriesParamsDateRange = "12w"
- RadarVerifiedBotTopCategoriesParamsDateRange24w RadarVerifiedBotTopCategoriesParamsDateRange = "24w"
- RadarVerifiedBotTopCategoriesParamsDateRange52w RadarVerifiedBotTopCategoriesParamsDateRange = "52w"
- RadarVerifiedBotTopCategoriesParamsDateRange1dControl RadarVerifiedBotTopCategoriesParamsDateRange = "1dControl"
- RadarVerifiedBotTopCategoriesParamsDateRange2dControl RadarVerifiedBotTopCategoriesParamsDateRange = "2dControl"
- RadarVerifiedBotTopCategoriesParamsDateRange7dControl RadarVerifiedBotTopCategoriesParamsDateRange = "7dControl"
- RadarVerifiedBotTopCategoriesParamsDateRange14dControl RadarVerifiedBotTopCategoriesParamsDateRange = "14dControl"
- RadarVerifiedBotTopCategoriesParamsDateRange28dControl RadarVerifiedBotTopCategoriesParamsDateRange = "28dControl"
- RadarVerifiedBotTopCategoriesParamsDateRange12wControl RadarVerifiedBotTopCategoriesParamsDateRange = "12wControl"
- RadarVerifiedBotTopCategoriesParamsDateRange24wControl RadarVerifiedBotTopCategoriesParamsDateRange = "24wControl"
-)
-
-// Format results are returned in.
-type RadarVerifiedBotTopCategoriesParamsFormat string
-
-const (
- RadarVerifiedBotTopCategoriesParamsFormatJson RadarVerifiedBotTopCategoriesParamsFormat = "JSON"
- RadarVerifiedBotTopCategoriesParamsFormatCsv RadarVerifiedBotTopCategoriesParamsFormat = "CSV"
-)
-
-type RadarVerifiedBotTopCategoriesResponseEnvelope struct {
- Result RadarVerifiedBotTopCategoriesResponse `json:"result,required"`
- Success bool `json:"success,required"`
- JSON radarVerifiedBotTopCategoriesResponseEnvelopeJSON `json:"-"`
-}
-
-// radarVerifiedBotTopCategoriesResponseEnvelopeJSON contains the JSON metadata for
-// the struct [RadarVerifiedBotTopCategoriesResponseEnvelope]
-type radarVerifiedBotTopCategoriesResponseEnvelopeJSON struct {
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RadarVerifiedBotTopCategoriesResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r radarVerifiedBotTopCategoriesResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
diff --git a/radarverifiedbottop_test.go b/radarverifiedbottop_test.go
deleted file mode 100644
index 33f391caea8..00000000000
--- a/radarverifiedbottop_test.go
+++ /dev/null
@@ -1,83 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
- "time"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRadarVerifiedBotTopBotsWithOptionalParams(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"),
- )
- _, 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()}),
- Format: cloudflare.F(cloudflare.RadarVerifiedBotTopBotsParamsFormatJson),
- 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())
- }
-}
-
-func TestRadarVerifiedBotTopCategoriesWithOptionalParams(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"),
- )
- _, 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()}),
- Format: cloudflare.F(cloudflare.RadarVerifiedBotTopCategoriesParamsFormatJson),
- 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/rate_limits/aliases.go b/rate_limits/aliases.go
new file mode 100644
index 00000000000..6b706e19539
--- /dev/null
+++ b/rate_limits/aliases.go
@@ -0,0 +1,9 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package rate_limits
+
+import (
+ "github.com/cloudflare/cloudflare-go/internal/apierror"
+)
+
+type Error = apierror.Error
diff --git a/ratelimit.go b/rate_limits/ratelimit.go
similarity index 98%
rename from ratelimit.go
rename to rate_limits/ratelimit.go
index 11a90fcad18..a9bcb9a4189 100644
--- a/ratelimit.go
+++ b/rate_limits/ratelimit.go
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package cloudflare
+package rate_limits
import (
"context"
@@ -111,9 +111,10 @@ func (r *RateLimitService) Get(ctx context.Context, zoneIdentifier string, id st
return
}
-// Union satisfied by [RateLimitNewResponseUnknown] or [shared.UnionString].
+// Union satisfied by [rate_limits.RateLimitNewResponseUnknown] or
+// [shared.UnionString].
type RateLimitNewResponse interface {
- ImplementsRateLimitNewResponse()
+ ImplementsRateLimitsRateLimitNewResponse()
}
func init() {
@@ -446,9 +447,10 @@ func (r rateLimitDeleteResponseJSON) RawJSON() string {
return r.raw
}
-// Union satisfied by [RateLimitEditResponseUnknown] or [shared.UnionString].
+// Union satisfied by [rate_limits.RateLimitEditResponseUnknown] or
+// [shared.UnionString].
type RateLimitEditResponse interface {
- ImplementsRateLimitEditResponse()
+ ImplementsRateLimitsRateLimitEditResponse()
}
func init() {
@@ -462,9 +464,10 @@ func init() {
)
}
-// Union satisfied by [RateLimitGetResponseUnknown] or [shared.UnionString].
+// Union satisfied by [rate_limits.RateLimitGetResponseUnknown] or
+// [shared.UnionString].
type RateLimitGetResponse interface {
- ImplementsRateLimitGetResponse()
+ ImplementsRateLimitsRateLimitGetResponse()
}
func init() {
diff --git a/ratelimit_test.go b/rate_limits/ratelimit_test.go
similarity index 95%
rename from ratelimit_test.go
rename to rate_limits/ratelimit_test.go
index fb0b9443523..7618681a37c 100644
--- a/ratelimit_test.go
+++ b/rate_limits/ratelimit_test.go
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package cloudflare_test
+package rate_limits_test
import (
"context"
@@ -11,6 +11,7 @@ import (
"github.com/cloudflare/cloudflare-go"
"github.com/cloudflare/cloudflare-go/internal/testutil"
"github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/rate_limits"
)
func TestRateLimitNew(t *testing.T) {
@@ -30,7 +31,7 @@ func TestRateLimitNew(t *testing.T) {
_, err := client.RateLimits.New(
context.TODO(),
"023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.RateLimitNewParams{
+ rate_limits.RateLimitNewParams{
Body: cloudflare.F[any](map[string]interface{}{}),
},
)
@@ -60,7 +61,7 @@ func TestRateLimitListWithOptionalParams(t *testing.T) {
_, err := client.RateLimits.List(
context.TODO(),
"023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.RateLimitListParams{
+ rate_limits.RateLimitListParams{
Page: cloudflare.F(1.000000),
PerPage: cloudflare.F(1.000000),
},
@@ -120,7 +121,7 @@ func TestRateLimitEdit(t *testing.T) {
context.TODO(),
"023e105f4ecef8ad9ca31a8372d0c353",
"372e67954025e0ba6aaa6d586b9e0b59",
- cloudflare.RateLimitEditParams{
+ rate_limits.RateLimitEditParams{
Body: cloudflare.F[any](map[string]interface{}{}),
},
)
diff --git a/registrar/aliases.go b/registrar/aliases.go
new file mode 100644
index 00000000000..d4c397c6ad4
--- /dev/null
+++ b/registrar/aliases.go
@@ -0,0 +1,9 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package registrar
+
+import (
+ "github.com/cloudflare/cloudflare-go/internal/apierror"
+)
+
+type Error = apierror.Error
diff --git a/registrar/domain.go b/registrar/domain.go
new file mode 100644
index 00000000000..dd30d58980a
--- /dev/null
+++ b/registrar/domain.go
@@ -0,0 +1,582 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package registrar
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "reflect"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/tidwall/gjson"
+)
+
+// DomainService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewDomainService] method instead.
+type DomainService struct {
+ Options []option.RequestOption
+}
+
+// NewDomainService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewDomainService(opts ...option.RequestOption) (r *DomainService) {
+ r = &DomainService{}
+ r.Options = opts
+ return
+}
+
+// Update individual domain.
+func (r *DomainService) Update(ctx context.Context, domainName string, params DomainUpdateParams, opts ...option.RequestOption) (res *DomainUpdateResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env DomainUpdateResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/registrar/domains/%s", params.AccountID, domainName)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// List domains handled by Registrar.
+func (r *DomainService) List(ctx context.Context, query DomainListParams, opts ...option.RequestOption) (res *[]DomainListResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env DomainListResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/registrar/domains", query.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Show individual domain.
+func (r *DomainService) Get(ctx context.Context, domainName string, query DomainGetParams, opts ...option.RequestOption) (res *DomainGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env DomainGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/registrar/domains/%s", query.AccountID, domainName)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Union satisfied by [registrar.DomainUpdateResponseUnknown],
+// [registrar.DomainUpdateResponseArray] or [shared.UnionString].
+type DomainUpdateResponse interface {
+ ImplementsRegistrarDomainUpdateResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*DomainUpdateResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(DomainUpdateResponseArray{}),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+type DomainUpdateResponseArray []interface{}
+
+func (r DomainUpdateResponseArray) ImplementsRegistrarDomainUpdateResponse() {}
+
+type DomainListResponse struct {
+ // Domain identifier.
+ ID string `json:"id"`
+ // Shows if a domain is available for transferring into Cloudflare Registrar.
+ Available bool `json:"available"`
+ // Indicates if the domain can be registered as a new domain.
+ CanRegister bool `json:"can_register"`
+ // Shows time of creation.
+ CreatedAt time.Time `json:"created_at" format:"date-time"`
+ // Shows name of current registrar.
+ CurrentRegistrar string `json:"current_registrar"`
+ // Shows when domain name registration expires.
+ ExpiresAt time.Time `json:"expires_at" format:"date-time"`
+ // Shows whether a registrar lock is in place for a domain.
+ Locked bool `json:"locked"`
+ // Shows contact information for domain registrant.
+ RegistrantContact DomainListResponseRegistrantContact `json:"registrant_contact"`
+ // A comma-separated list of registry status codes. A full list of status codes can
+ // be found at
+ // [EPP Status Codes](https://www.icann.org/resources/pages/epp-status-codes-2014-06-16-en).
+ RegistryStatuses string `json:"registry_statuses"`
+ // Whether a particular TLD is currently supported by Cloudflare Registrar. Refer
+ // to [TLD Policies](https://www.cloudflare.com/tld-policies/) for a list of
+ // supported TLDs.
+ SupportedTld bool `json:"supported_tld"`
+ // Statuses for domain transfers into Cloudflare Registrar.
+ TransferIn DomainListResponseTransferIn `json:"transfer_in"`
+ // Last updated.
+ UpdatedAt time.Time `json:"updated_at" format:"date-time"`
+ JSON domainListResponseJSON `json:"-"`
+}
+
+// domainListResponseJSON contains the JSON metadata for the struct
+// [DomainListResponse]
+type domainListResponseJSON struct {
+ ID apijson.Field
+ Available apijson.Field
+ CanRegister apijson.Field
+ CreatedAt apijson.Field
+ CurrentRegistrar apijson.Field
+ ExpiresAt apijson.Field
+ Locked apijson.Field
+ RegistrantContact apijson.Field
+ RegistryStatuses apijson.Field
+ SupportedTld apijson.Field
+ TransferIn apijson.Field
+ UpdatedAt apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DomainListResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r domainListResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+// Shows contact information for domain registrant.
+type DomainListResponseRegistrantContact struct {
+ // Address.
+ Address string `json:"address,required"`
+ // City.
+ City string `json:"city,required"`
+ // The country in which the user lives.
+ Country string `json:"country,required,nullable"`
+ // User's first name
+ FirstName string `json:"first_name,required,nullable"`
+ // User's last name
+ LastName string `json:"last_name,required,nullable"`
+ // Name of organization.
+ Organization string `json:"organization,required"`
+ // User's telephone number
+ Phone string `json:"phone,required,nullable"`
+ // State.
+ State string `json:"state,required"`
+ // The zipcode or postal code where the user lives.
+ Zip string `json:"zip,required,nullable"`
+ // Contact Identifier.
+ ID string `json:"id"`
+ // Optional address line for unit, floor, suite, etc.
+ Address2 string `json:"address2"`
+ // The contact email address of the user.
+ Email string `json:"email"`
+ // Contact fax number.
+ Fax string `json:"fax"`
+ JSON domainListResponseRegistrantContactJSON `json:"-"`
+}
+
+// domainListResponseRegistrantContactJSON contains the JSON metadata for the
+// struct [DomainListResponseRegistrantContact]
+type domainListResponseRegistrantContactJSON struct {
+ Address apijson.Field
+ City apijson.Field
+ Country apijson.Field
+ FirstName apijson.Field
+ LastName apijson.Field
+ Organization apijson.Field
+ Phone apijson.Field
+ State apijson.Field
+ Zip apijson.Field
+ ID apijson.Field
+ Address2 apijson.Field
+ Email apijson.Field
+ Fax apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DomainListResponseRegistrantContact) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r domainListResponseRegistrantContactJSON) RawJSON() string {
+ return r.raw
+}
+
+// Statuses for domain transfers into Cloudflare Registrar.
+type DomainListResponseTransferIn struct {
+ // Form of authorization has been accepted by the registrant.
+ AcceptFoa interface{} `json:"accept_foa"`
+ // Shows transfer status with the registry.
+ ApproveTransfer interface{} `json:"approve_transfer"`
+ // Indicates if cancellation is still possible.
+ CanCancelTransfer bool `json:"can_cancel_transfer"`
+ // Privacy guards are disabled at the foreign registrar.
+ DisablePrivacy interface{} `json:"disable_privacy"`
+ // Auth code has been entered and verified.
+ EnterAuthCode interface{} `json:"enter_auth_code"`
+ // Domain is unlocked at the foreign registrar.
+ UnlockDomain interface{} `json:"unlock_domain"`
+ JSON domainListResponseTransferInJSON `json:"-"`
+}
+
+// domainListResponseTransferInJSON contains the JSON metadata for the struct
+// [DomainListResponseTransferIn]
+type domainListResponseTransferInJSON struct {
+ AcceptFoa apijson.Field
+ ApproveTransfer apijson.Field
+ CanCancelTransfer apijson.Field
+ DisablePrivacy apijson.Field
+ EnterAuthCode apijson.Field
+ UnlockDomain apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DomainListResponseTransferIn) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r domainListResponseTransferInJSON) RawJSON() string {
+ return r.raw
+}
+
+// Union satisfied by [registrar.DomainGetResponseUnknown],
+// [registrar.DomainGetResponseArray] or [shared.UnionString].
+type DomainGetResponse interface {
+ ImplementsRegistrarDomainGetResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*DomainGetResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(DomainGetResponseArray{}),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+type DomainGetResponseArray []interface{}
+
+func (r DomainGetResponseArray) ImplementsRegistrarDomainGetResponse() {}
+
+type DomainUpdateParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ // Auto-renew controls whether subscription is automatically renewed upon domain
+ // expiration.
+ AutoRenew param.Field[bool] `json:"auto_renew"`
+ // Shows whether a registrar lock is in place for a domain.
+ Locked param.Field[bool] `json:"locked"`
+ // Privacy option controls redacting WHOIS information.
+ Privacy param.Field[bool] `json:"privacy"`
+}
+
+func (r DomainUpdateParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type DomainUpdateResponseEnvelope struct {
+ Errors []DomainUpdateResponseEnvelopeErrors `json:"errors,required"`
+ Messages []DomainUpdateResponseEnvelopeMessages `json:"messages,required"`
+ Result DomainUpdateResponse `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success DomainUpdateResponseEnvelopeSuccess `json:"success,required"`
+ JSON domainUpdateResponseEnvelopeJSON `json:"-"`
+}
+
+// domainUpdateResponseEnvelopeJSON contains the JSON metadata for the struct
+// [DomainUpdateResponseEnvelope]
+type domainUpdateResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DomainUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r domainUpdateResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type DomainUpdateResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON domainUpdateResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// domainUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [DomainUpdateResponseEnvelopeErrors]
+type domainUpdateResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DomainUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r domainUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type DomainUpdateResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON domainUpdateResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// domainUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [DomainUpdateResponseEnvelopeMessages]
+type domainUpdateResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DomainUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r domainUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type DomainUpdateResponseEnvelopeSuccess bool
+
+const (
+ DomainUpdateResponseEnvelopeSuccessTrue DomainUpdateResponseEnvelopeSuccess = true
+)
+
+type DomainListParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type DomainListResponseEnvelope struct {
+ Errors []DomainListResponseEnvelopeErrors `json:"errors,required"`
+ Messages []DomainListResponseEnvelopeMessages `json:"messages,required"`
+ Result []DomainListResponse `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success DomainListResponseEnvelopeSuccess `json:"success,required"`
+ ResultInfo DomainListResponseEnvelopeResultInfo `json:"result_info"`
+ JSON domainListResponseEnvelopeJSON `json:"-"`
+}
+
+// domainListResponseEnvelopeJSON contains the JSON metadata for the struct
+// [DomainListResponseEnvelope]
+type domainListResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ ResultInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DomainListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r domainListResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type DomainListResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON domainListResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// domainListResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [DomainListResponseEnvelopeErrors]
+type domainListResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DomainListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r domainListResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type DomainListResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON domainListResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// domainListResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [DomainListResponseEnvelopeMessages]
+type domainListResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DomainListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r domainListResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type DomainListResponseEnvelopeSuccess bool
+
+const (
+ DomainListResponseEnvelopeSuccessTrue DomainListResponseEnvelopeSuccess = true
+)
+
+type DomainListResponseEnvelopeResultInfo struct {
+ // Total number of results for the requested service
+ Count float64 `json:"count"`
+ // Current page within paginated list of results
+ Page float64 `json:"page"`
+ // Number of results per page of results
+ PerPage float64 `json:"per_page"`
+ // Total results available without any search parameters
+ TotalCount float64 `json:"total_count"`
+ JSON domainListResponseEnvelopeResultInfoJSON `json:"-"`
+}
+
+// domainListResponseEnvelopeResultInfoJSON contains the JSON metadata for the
+// struct [DomainListResponseEnvelopeResultInfo]
+type domainListResponseEnvelopeResultInfoJSON struct {
+ Count apijson.Field
+ Page apijson.Field
+ PerPage apijson.Field
+ TotalCount apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DomainListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r domainListResponseEnvelopeResultInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type DomainGetParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type DomainGetResponseEnvelope struct {
+ Errors []DomainGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []DomainGetResponseEnvelopeMessages `json:"messages,required"`
+ Result DomainGetResponse `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success DomainGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON domainGetResponseEnvelopeJSON `json:"-"`
+}
+
+// domainGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [DomainGetResponseEnvelope]
+type domainGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DomainGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r domainGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type DomainGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON domainGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// domainGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [DomainGetResponseEnvelopeErrors]
+type domainGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DomainGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r domainGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type DomainGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON domainGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// domainGetResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [DomainGetResponseEnvelopeMessages]
+type domainGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DomainGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r domainGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type DomainGetResponseEnvelopeSuccess bool
+
+const (
+ DomainGetResponseEnvelopeSuccessTrue DomainGetResponseEnvelopeSuccess = true
+)
diff --git a/registrar/domain_test.go b/registrar/domain_test.go
new file mode 100644
index 00000000000..4b5ac16a955
--- /dev/null
+++ b/registrar/domain_test.go
@@ -0,0 +1,104 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package registrar_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/registrar"
+)
+
+func TestDomainUpdateWithOptionalParams(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"),
+ )
+ _, err := client.Registrar.Domains.Update(
+ context.TODO(),
+ "cloudflare.com",
+ registrar.DomainUpdateParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ AutoRenew: cloudflare.F(true),
+ Locked: cloudflare.F(false),
+ Privacy: cloudflare.F(true),
+ },
+ )
+ 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())
+ }
+}
+
+func TestDomainList(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"),
+ )
+ _, err := client.Registrar.Domains.List(context.TODO(), registrar.DomainListParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ })
+ 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())
+ }
+}
+
+func TestDomainGet(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"),
+ )
+ _, err := client.Registrar.Domains.Get(
+ context.TODO(),
+ "cloudflare.com",
+ registrar.DomainGetParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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/registrar.go b/registrar/registrar.go
similarity index 89%
rename from registrar.go
rename to registrar/registrar.go
index e45c6173d54..bb503a24d3c 100644
--- a/registrar.go
+++ b/registrar/registrar.go
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package cloudflare
+package registrar
import (
"github.com/cloudflare/cloudflare-go/option"
@@ -12,7 +12,7 @@ import (
// service directly, and instead use the [NewRegistrarService] method instead.
type RegistrarService struct {
Options []option.RequestOption
- Domains *RegistrarDomainService
+ Domains *DomainService
}
// NewRegistrarService generates a new service that applies the given options to
@@ -21,6 +21,6 @@ type RegistrarService struct {
func NewRegistrarService(opts ...option.RequestOption) (r *RegistrarService) {
r = &RegistrarService{}
r.Options = opts
- r.Domains = NewRegistrarDomainService(opts...)
+ r.Domains = NewDomainService(opts...)
return
}
diff --git a/registrardomain.go b/registrardomain.go
deleted file mode 100644
index b51928300e7..00000000000
--- a/registrardomain.go
+++ /dev/null
@@ -1,583 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "reflect"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/option"
- "github.com/tidwall/gjson"
-)
-
-// RegistrarDomainService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewRegistrarDomainService] method
-// instead.
-type RegistrarDomainService struct {
- Options []option.RequestOption
-}
-
-// NewRegistrarDomainService generates a new service that applies the given options
-// to each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewRegistrarDomainService(opts ...option.RequestOption) (r *RegistrarDomainService) {
- r = &RegistrarDomainService{}
- r.Options = opts
- return
-}
-
-// Update individual domain.
-func (r *RegistrarDomainService) Update(ctx context.Context, domainName string, params RegistrarDomainUpdateParams, opts ...option.RequestOption) (res *RegistrarDomainUpdateResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RegistrarDomainUpdateResponseEnvelope
- path := fmt.Sprintf("accounts/%s/registrar/domains/%s", params.AccountID, domainName)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// List domains handled by Registrar.
-func (r *RegistrarDomainService) List(ctx context.Context, query RegistrarDomainListParams, opts ...option.RequestOption) (res *[]RegistrarDomainListResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RegistrarDomainListResponseEnvelope
- path := fmt.Sprintf("accounts/%s/registrar/domains", query.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Show individual domain.
-func (r *RegistrarDomainService) Get(ctx context.Context, domainName string, query RegistrarDomainGetParams, opts ...option.RequestOption) (res *RegistrarDomainGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RegistrarDomainGetResponseEnvelope
- path := fmt.Sprintf("accounts/%s/registrar/domains/%s", query.AccountID, domainName)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Union satisfied by [RegistrarDomainUpdateResponseUnknown],
-// [RegistrarDomainUpdateResponseArray] or [shared.UnionString].
-type RegistrarDomainUpdateResponse interface {
- ImplementsRegistrarDomainUpdateResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*RegistrarDomainUpdateResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(RegistrarDomainUpdateResponseArray{}),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-type RegistrarDomainUpdateResponseArray []interface{}
-
-func (r RegistrarDomainUpdateResponseArray) ImplementsRegistrarDomainUpdateResponse() {}
-
-type RegistrarDomainListResponse struct {
- // Domain identifier.
- ID string `json:"id"`
- // Shows if a domain is available for transferring into Cloudflare Registrar.
- Available bool `json:"available"`
- // Indicates if the domain can be registered as a new domain.
- CanRegister bool `json:"can_register"`
- // Shows time of creation.
- CreatedAt time.Time `json:"created_at" format:"date-time"`
- // Shows name of current registrar.
- CurrentRegistrar string `json:"current_registrar"`
- // Shows when domain name registration expires.
- ExpiresAt time.Time `json:"expires_at" format:"date-time"`
- // Shows whether a registrar lock is in place for a domain.
- Locked bool `json:"locked"`
- // Shows contact information for domain registrant.
- RegistrantContact RegistrarDomainListResponseRegistrantContact `json:"registrant_contact"`
- // A comma-separated list of registry status codes. A full list of status codes can
- // be found at
- // [EPP Status Codes](https://www.icann.org/resources/pages/epp-status-codes-2014-06-16-en).
- RegistryStatuses string `json:"registry_statuses"`
- // Whether a particular TLD is currently supported by Cloudflare Registrar. Refer
- // to [TLD Policies](https://www.cloudflare.com/tld-policies/) for a list of
- // supported TLDs.
- SupportedTld bool `json:"supported_tld"`
- // Statuses for domain transfers into Cloudflare Registrar.
- TransferIn RegistrarDomainListResponseTransferIn `json:"transfer_in"`
- // Last updated.
- UpdatedAt time.Time `json:"updated_at" format:"date-time"`
- JSON registrarDomainListResponseJSON `json:"-"`
-}
-
-// registrarDomainListResponseJSON contains the JSON metadata for the struct
-// [RegistrarDomainListResponse]
-type registrarDomainListResponseJSON struct {
- ID apijson.Field
- Available apijson.Field
- CanRegister apijson.Field
- CreatedAt apijson.Field
- CurrentRegistrar apijson.Field
- ExpiresAt apijson.Field
- Locked apijson.Field
- RegistrantContact apijson.Field
- RegistryStatuses apijson.Field
- SupportedTld apijson.Field
- TransferIn apijson.Field
- UpdatedAt apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RegistrarDomainListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r registrarDomainListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// Shows contact information for domain registrant.
-type RegistrarDomainListResponseRegistrantContact struct {
- // Address.
- Address string `json:"address,required"`
- // City.
- City string `json:"city,required"`
- // The country in which the user lives.
- Country string `json:"country,required,nullable"`
- // User's first name
- FirstName string `json:"first_name,required,nullable"`
- // User's last name
- LastName string `json:"last_name,required,nullable"`
- // Name of organization.
- Organization string `json:"organization,required"`
- // User's telephone number
- Phone string `json:"phone,required,nullable"`
- // State.
- State string `json:"state,required"`
- // The zipcode or postal code where the user lives.
- Zip string `json:"zip,required,nullable"`
- // Contact Identifier.
- ID string `json:"id"`
- // Optional address line for unit, floor, suite, etc.
- Address2 string `json:"address2"`
- // The contact email address of the user.
- Email string `json:"email"`
- // Contact fax number.
- Fax string `json:"fax"`
- JSON registrarDomainListResponseRegistrantContactJSON `json:"-"`
-}
-
-// registrarDomainListResponseRegistrantContactJSON contains the JSON metadata for
-// the struct [RegistrarDomainListResponseRegistrantContact]
-type registrarDomainListResponseRegistrantContactJSON struct {
- Address apijson.Field
- City apijson.Field
- Country apijson.Field
- FirstName apijson.Field
- LastName apijson.Field
- Organization apijson.Field
- Phone apijson.Field
- State apijson.Field
- Zip apijson.Field
- ID apijson.Field
- Address2 apijson.Field
- Email apijson.Field
- Fax apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RegistrarDomainListResponseRegistrantContact) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r registrarDomainListResponseRegistrantContactJSON) RawJSON() string {
- return r.raw
-}
-
-// Statuses for domain transfers into Cloudflare Registrar.
-type RegistrarDomainListResponseTransferIn struct {
- // Form of authorization has been accepted by the registrant.
- AcceptFoa interface{} `json:"accept_foa"`
- // Shows transfer status with the registry.
- ApproveTransfer interface{} `json:"approve_transfer"`
- // Indicates if cancellation is still possible.
- CanCancelTransfer bool `json:"can_cancel_transfer"`
- // Privacy guards are disabled at the foreign registrar.
- DisablePrivacy interface{} `json:"disable_privacy"`
- // Auth code has been entered and verified.
- EnterAuthCode interface{} `json:"enter_auth_code"`
- // Domain is unlocked at the foreign registrar.
- UnlockDomain interface{} `json:"unlock_domain"`
- JSON registrarDomainListResponseTransferInJSON `json:"-"`
-}
-
-// registrarDomainListResponseTransferInJSON contains the JSON metadata for the
-// struct [RegistrarDomainListResponseTransferIn]
-type registrarDomainListResponseTransferInJSON struct {
- AcceptFoa apijson.Field
- ApproveTransfer apijson.Field
- CanCancelTransfer apijson.Field
- DisablePrivacy apijson.Field
- EnterAuthCode apijson.Field
- UnlockDomain apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RegistrarDomainListResponseTransferIn) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r registrarDomainListResponseTransferInJSON) RawJSON() string {
- return r.raw
-}
-
-// Union satisfied by [RegistrarDomainGetResponseUnknown],
-// [RegistrarDomainGetResponseArray] or [shared.UnionString].
-type RegistrarDomainGetResponse interface {
- ImplementsRegistrarDomainGetResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*RegistrarDomainGetResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(RegistrarDomainGetResponseArray{}),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-type RegistrarDomainGetResponseArray []interface{}
-
-func (r RegistrarDomainGetResponseArray) ImplementsRegistrarDomainGetResponse() {}
-
-type RegistrarDomainUpdateParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
- // Auto-renew controls whether subscription is automatically renewed upon domain
- // expiration.
- AutoRenew param.Field[bool] `json:"auto_renew"`
- // Shows whether a registrar lock is in place for a domain.
- Locked param.Field[bool] `json:"locked"`
- // Privacy option controls redacting WHOIS information.
- Privacy param.Field[bool] `json:"privacy"`
-}
-
-func (r RegistrarDomainUpdateParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type RegistrarDomainUpdateResponseEnvelope struct {
- Errors []RegistrarDomainUpdateResponseEnvelopeErrors `json:"errors,required"`
- Messages []RegistrarDomainUpdateResponseEnvelopeMessages `json:"messages,required"`
- Result RegistrarDomainUpdateResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success RegistrarDomainUpdateResponseEnvelopeSuccess `json:"success,required"`
- JSON registrarDomainUpdateResponseEnvelopeJSON `json:"-"`
-}
-
-// registrarDomainUpdateResponseEnvelopeJSON contains the JSON metadata for the
-// struct [RegistrarDomainUpdateResponseEnvelope]
-type registrarDomainUpdateResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RegistrarDomainUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r registrarDomainUpdateResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RegistrarDomainUpdateResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON registrarDomainUpdateResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// registrarDomainUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [RegistrarDomainUpdateResponseEnvelopeErrors]
-type registrarDomainUpdateResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RegistrarDomainUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r registrarDomainUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type RegistrarDomainUpdateResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON registrarDomainUpdateResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// registrarDomainUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [RegistrarDomainUpdateResponseEnvelopeMessages]
-type registrarDomainUpdateResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RegistrarDomainUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r registrarDomainUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type RegistrarDomainUpdateResponseEnvelopeSuccess bool
-
-const (
- RegistrarDomainUpdateResponseEnvelopeSuccessTrue RegistrarDomainUpdateResponseEnvelopeSuccess = true
-)
-
-type RegistrarDomainListParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type RegistrarDomainListResponseEnvelope struct {
- Errors []RegistrarDomainListResponseEnvelopeErrors `json:"errors,required"`
- Messages []RegistrarDomainListResponseEnvelopeMessages `json:"messages,required"`
- Result []RegistrarDomainListResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success RegistrarDomainListResponseEnvelopeSuccess `json:"success,required"`
- ResultInfo RegistrarDomainListResponseEnvelopeResultInfo `json:"result_info"`
- JSON registrarDomainListResponseEnvelopeJSON `json:"-"`
-}
-
-// registrarDomainListResponseEnvelopeJSON contains the JSON metadata for the
-// struct [RegistrarDomainListResponseEnvelope]
-type registrarDomainListResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- ResultInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RegistrarDomainListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r registrarDomainListResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RegistrarDomainListResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON registrarDomainListResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// registrarDomainListResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [RegistrarDomainListResponseEnvelopeErrors]
-type registrarDomainListResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RegistrarDomainListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r registrarDomainListResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type RegistrarDomainListResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON registrarDomainListResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// registrarDomainListResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [RegistrarDomainListResponseEnvelopeMessages]
-type registrarDomainListResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RegistrarDomainListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r registrarDomainListResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type RegistrarDomainListResponseEnvelopeSuccess bool
-
-const (
- RegistrarDomainListResponseEnvelopeSuccessTrue RegistrarDomainListResponseEnvelopeSuccess = true
-)
-
-type RegistrarDomainListResponseEnvelopeResultInfo struct {
- // Total number of results for the requested service
- Count float64 `json:"count"`
- // Current page within paginated list of results
- Page float64 `json:"page"`
- // Number of results per page of results
- PerPage float64 `json:"per_page"`
- // Total results available without any search parameters
- TotalCount float64 `json:"total_count"`
- JSON registrarDomainListResponseEnvelopeResultInfoJSON `json:"-"`
-}
-
-// registrarDomainListResponseEnvelopeResultInfoJSON contains the JSON metadata for
-// the struct [RegistrarDomainListResponseEnvelopeResultInfo]
-type registrarDomainListResponseEnvelopeResultInfoJSON struct {
- Count apijson.Field
- Page apijson.Field
- PerPage apijson.Field
- TotalCount apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RegistrarDomainListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r registrarDomainListResponseEnvelopeResultInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RegistrarDomainGetParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type RegistrarDomainGetResponseEnvelope struct {
- Errors []RegistrarDomainGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []RegistrarDomainGetResponseEnvelopeMessages `json:"messages,required"`
- Result RegistrarDomainGetResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success RegistrarDomainGetResponseEnvelopeSuccess `json:"success,required"`
- JSON registrarDomainGetResponseEnvelopeJSON `json:"-"`
-}
-
-// registrarDomainGetResponseEnvelopeJSON contains the JSON metadata for the struct
-// [RegistrarDomainGetResponseEnvelope]
-type registrarDomainGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RegistrarDomainGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r registrarDomainGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RegistrarDomainGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON registrarDomainGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// registrarDomainGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [RegistrarDomainGetResponseEnvelopeErrors]
-type registrarDomainGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RegistrarDomainGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r registrarDomainGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type RegistrarDomainGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON registrarDomainGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// registrarDomainGetResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [RegistrarDomainGetResponseEnvelopeMessages]
-type registrarDomainGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RegistrarDomainGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r registrarDomainGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type RegistrarDomainGetResponseEnvelopeSuccess bool
-
-const (
- RegistrarDomainGetResponseEnvelopeSuccessTrue RegistrarDomainGetResponseEnvelopeSuccess = true
-)
diff --git a/registrardomain_test.go b/registrardomain_test.go
deleted file mode 100644
index 66a0de118b8..00000000000
--- a/registrardomain_test.go
+++ /dev/null
@@ -1,103 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRegistrarDomainUpdateWithOptionalParams(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"),
- )
- _, err := client.Registrar.Domains.Update(
- context.TODO(),
- "cloudflare.com",
- cloudflare.RegistrarDomainUpdateParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- AutoRenew: cloudflare.F(true),
- Locked: cloudflare.F(false),
- Privacy: cloudflare.F(true),
- },
- )
- 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())
- }
-}
-
-func TestRegistrarDomainList(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"),
- )
- _, err := client.Registrar.Domains.List(context.TODO(), cloudflare.RegistrarDomainListParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- })
- 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())
- }
-}
-
-func TestRegistrarDomainGet(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"),
- )
- _, err := client.Registrar.Domains.Get(
- context.TODO(),
- "cloudflare.com",
- cloudflare.RegistrarDomainGetParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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/request_tracers/aliases.go b/request_tracers/aliases.go
new file mode 100644
index 00000000000..a0311b5338a
--- /dev/null
+++ b/request_tracers/aliases.go
@@ -0,0 +1,9 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package request_tracers
+
+import (
+ "github.com/cloudflare/cloudflare-go/internal/apierror"
+)
+
+type Error = apierror.Error
diff --git a/requesttracer.go b/request_tracers/requesttracer.go
similarity index 89%
rename from requesttracer.go
rename to request_tracers/requesttracer.go
index f71c695fe2a..26fe935fdc2 100644
--- a/requesttracer.go
+++ b/request_tracers/requesttracer.go
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package cloudflare
+package request_tracers
import (
"github.com/cloudflare/cloudflare-go/option"
@@ -13,7 +13,7 @@ import (
// instead.
type RequestTracerService struct {
Options []option.RequestOption
- Traces *RequestTracerTraceService
+ Traces *TraceService
}
// NewRequestTracerService generates a new service that applies the given options
@@ -22,6 +22,6 @@ type RequestTracerService struct {
func NewRequestTracerService(opts ...option.RequestOption) (r *RequestTracerService) {
r = &RequestTracerService{}
r.Options = opts
- r.Traces = NewRequestTracerTraceService(opts...)
+ r.Traces = NewTraceService(opts...)
return
}
diff --git a/request_tracers/trace.go b/request_tracers/trace.go
new file mode 100644
index 00000000000..9ad6195db98
--- /dev/null
+++ b/request_tracers/trace.go
@@ -0,0 +1,222 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package request_tracers
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// TraceService contains methods and other services that help with interacting with
+// the cloudflare API. Note, unlike clients, this service does not read variables
+// from the environment automatically. You should not instantiate this service
+// directly, and instead use the [NewTraceService] method instead.
+type TraceService struct {
+ Options []option.RequestOption
+}
+
+// NewTraceService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewTraceService(opts ...option.RequestOption) (r *TraceService) {
+ r = &TraceService{}
+ r.Options = opts
+ return
+}
+
+// Request Trace
+func (r *TraceService) New(ctx context.Context, accountIdentifier string, body TraceNewParams, opts ...option.RequestOption) (res *TraceNewResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env TraceNewResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/request-tracer/trace", accountIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type RequestTracerTrace []RequestTracerTrace
+
+// Trace result with an origin status code
+type TraceNewResponse struct {
+ // HTTP Status code of zone response
+ StatusCode int64 `json:"status_code"`
+ Trace RequestTracerTrace `json:"trace"`
+ JSON traceNewResponseJSON `json:"-"`
+}
+
+// traceNewResponseJSON contains the JSON metadata for the struct
+// [TraceNewResponse]
+type traceNewResponseJSON struct {
+ StatusCode apijson.Field
+ Trace apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *TraceNewResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r traceNewResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type TraceNewParams struct {
+ // HTTP Method of tracing request
+ Method param.Field[string] `json:"method,required"`
+ // URL to which perform tracing request
+ URL param.Field[string] `json:"url,required"`
+ Body param.Field[TraceNewParamsBody] `json:"body"`
+ // Additional request parameters
+ Context param.Field[TraceNewParamsContext] `json:"context"`
+ // Cookies added to tracing request
+ Cookies param.Field[map[string]string] `json:"cookies"`
+ // Headers added to tracing request
+ Headers param.Field[map[string]string] `json:"headers"`
+ // HTTP Protocol of tracing request
+ Protocol param.Field[string] `json:"protocol"`
+ // Skip sending the request to the Origin server after all rules evaluation
+ SkipResponse param.Field[bool] `json:"skip_response"`
+}
+
+func (r TraceNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type TraceNewParamsBody struct {
+ // Base64 encoded request body
+ Base64 param.Field[string] `json:"base64"`
+ // Arbitrary json as request body
+ Json param.Field[interface{}] `json:"json"`
+ // Request body as plain text
+ PlainText param.Field[string] `json:"plain_text"`
+}
+
+func (r TraceNewParamsBody) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Additional request parameters
+type TraceNewParamsContext struct {
+ // Bot score used for evaluating tracing request processing
+ BotScore param.Field[int64] `json:"bot_score"`
+ // Geodata for tracing request
+ Geoloc param.Field[TraceNewParamsContextGeoloc] `json:"geoloc"`
+ // Whether to skip any challenges for tracing request (e.g.: captcha)
+ SkipChallenge param.Field[bool] `json:"skip_challenge"`
+ // Threat score used for evaluating tracing request processing
+ ThreatScore param.Field[int64] `json:"threat_score"`
+}
+
+func (r TraceNewParamsContext) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Geodata for tracing request
+type TraceNewParamsContextGeoloc struct {
+ City param.Field[string] `json:"city"`
+ Continent param.Field[string] `json:"continent"`
+ IsEuCountry param.Field[bool] `json:"is_eu_country"`
+ ISOCode param.Field[string] `json:"iso_code"`
+ Latitude param.Field[float64] `json:"latitude"`
+ Longitude param.Field[float64] `json:"longitude"`
+ PostalCode param.Field[string] `json:"postal_code"`
+ RegionCode param.Field[string] `json:"region_code"`
+ Subdivision2ISOCode param.Field[string] `json:"subdivision_2_iso_code"`
+ Timezone param.Field[string] `json:"timezone"`
+}
+
+func (r TraceNewParamsContextGeoloc) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type TraceNewResponseEnvelope struct {
+ Errors []TraceNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []TraceNewResponseEnvelopeMessages `json:"messages,required"`
+ // Trace result with an origin status code
+ Result TraceNewResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success TraceNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON traceNewResponseEnvelopeJSON `json:"-"`
+}
+
+// traceNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [TraceNewResponseEnvelope]
+type traceNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *TraceNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r traceNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type TraceNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON traceNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// traceNewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [TraceNewResponseEnvelopeErrors]
+type traceNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *TraceNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r traceNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type TraceNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON traceNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// traceNewResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [TraceNewResponseEnvelopeMessages]
+type traceNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *TraceNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r traceNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type TraceNewResponseEnvelopeSuccess bool
+
+const (
+ TraceNewResponseEnvelopeSuccessTrue TraceNewResponseEnvelopeSuccess = true
+)
diff --git a/request_tracers/trace_test.go b/request_tracers/trace_test.go
new file mode 100644
index 00000000000..e4192c3de2f
--- /dev/null
+++ b/request_tracers/trace_test.go
@@ -0,0 +1,78 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package request_tracers_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/request_tracers"
+)
+
+func TestTraceNewWithOptionalParams(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"),
+ )
+ _, err := client.RequestTracers.Traces.New(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ request_tracers.TraceNewParams{
+ Method: cloudflare.F("PUT"),
+ URL: cloudflare.F("https://some.zone/some_path"),
+ Body: cloudflare.F(request_tracers.TraceNewParamsBody{
+ Base64: cloudflare.F("c29tZV9yZXF1ZXN0X2JvZHk="),
+ Json: cloudflare.F[any](map[string]interface{}{}),
+ PlainText: cloudflare.F("string"),
+ }),
+ Context: cloudflare.F(request_tracers.TraceNewParamsContext{
+ BotScore: cloudflare.F(int64(0)),
+ Geoloc: cloudflare.F(request_tracers.TraceNewParamsContextGeoloc{
+ City: cloudflare.F("London"),
+ Continent: cloudflare.F("string"),
+ IsEuCountry: cloudflare.F(true),
+ ISOCode: cloudflare.F("string"),
+ Latitude: cloudflare.F(0.000000),
+ Longitude: cloudflare.F(0.000000),
+ PostalCode: cloudflare.F("string"),
+ RegionCode: cloudflare.F("string"),
+ Subdivision2ISOCode: cloudflare.F("string"),
+ Timezone: cloudflare.F("string"),
+ }),
+ SkipChallenge: cloudflare.F(true),
+ ThreatScore: cloudflare.F(int64(0)),
+ }),
+ Cookies: cloudflare.F(map[string]string{
+ "cookie_name_1": "cookie_value_1",
+ "cookie_name_2": "cookie_value_2",
+ }),
+ Headers: cloudflare.F(map[string]string{
+ "header_name_1": "header_value_1",
+ "header_name_2": "header_value_2",
+ }),
+ Protocol: cloudflare.F("HTTP/1.1"),
+ SkipResponse: cloudflare.F(true),
+ },
+ )
+ 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/requesttracertrace.go b/requesttracertrace.go
deleted file mode 100644
index 795110279f3..00000000000
--- a/requesttracertrace.go
+++ /dev/null
@@ -1,223 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RequestTracerTraceService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewRequestTracerTraceService] method
-// instead.
-type RequestTracerTraceService struct {
- Options []option.RequestOption
-}
-
-// NewRequestTracerTraceService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewRequestTracerTraceService(opts ...option.RequestOption) (r *RequestTracerTraceService) {
- r = &RequestTracerTraceService{}
- r.Options = opts
- return
-}
-
-// Request Trace
-func (r *RequestTracerTraceService) New(ctx context.Context, accountIdentifier string, body RequestTracerTraceNewParams, opts ...option.RequestOption) (res *RequestTracerTraceNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RequestTracerTraceNewResponseEnvelope
- path := fmt.Sprintf("accounts/%s/request-tracer/trace", accountIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type RequestTracerTrace []RequestTracerTrace
-
-// Trace result with an origin status code
-type RequestTracerTraceNewResponse struct {
- // HTTP Status code of zone response
- StatusCode int64 `json:"status_code"`
- Trace RequestTracerTrace `json:"trace"`
- JSON requestTracerTraceNewResponseJSON `json:"-"`
-}
-
-// requestTracerTraceNewResponseJSON contains the JSON metadata for the struct
-// [RequestTracerTraceNewResponse]
-type requestTracerTraceNewResponseJSON struct {
- StatusCode apijson.Field
- Trace apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RequestTracerTraceNewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r requestTracerTraceNewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RequestTracerTraceNewParams struct {
- // HTTP Method of tracing request
- Method param.Field[string] `json:"method,required"`
- // URL to which perform tracing request
- URL param.Field[string] `json:"url,required"`
- Body param.Field[RequestTracerTraceNewParamsBody] `json:"body"`
- // Additional request parameters
- Context param.Field[RequestTracerTraceNewParamsContext] `json:"context"`
- // Cookies added to tracing request
- Cookies param.Field[map[string]string] `json:"cookies"`
- // Headers added to tracing request
- Headers param.Field[map[string]string] `json:"headers"`
- // HTTP Protocol of tracing request
- Protocol param.Field[string] `json:"protocol"`
- // Skip sending the request to the Origin server after all rules evaluation
- SkipResponse param.Field[bool] `json:"skip_response"`
-}
-
-func (r RequestTracerTraceNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type RequestTracerTraceNewParamsBody struct {
- // Base64 encoded request body
- Base64 param.Field[string] `json:"base64"`
- // Arbitrary json as request body
- Json param.Field[interface{}] `json:"json"`
- // Request body as plain text
- PlainText param.Field[string] `json:"plain_text"`
-}
-
-func (r RequestTracerTraceNewParamsBody) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Additional request parameters
-type RequestTracerTraceNewParamsContext struct {
- // Bot score used for evaluating tracing request processing
- BotScore param.Field[int64] `json:"bot_score"`
- // Geodata for tracing request
- Geoloc param.Field[RequestTracerTraceNewParamsContextGeoloc] `json:"geoloc"`
- // Whether to skip any challenges for tracing request (e.g.: captcha)
- SkipChallenge param.Field[bool] `json:"skip_challenge"`
- // Threat score used for evaluating tracing request processing
- ThreatScore param.Field[int64] `json:"threat_score"`
-}
-
-func (r RequestTracerTraceNewParamsContext) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Geodata for tracing request
-type RequestTracerTraceNewParamsContextGeoloc struct {
- City param.Field[string] `json:"city"`
- Continent param.Field[string] `json:"continent"`
- IsEuCountry param.Field[bool] `json:"is_eu_country"`
- ISOCode param.Field[string] `json:"iso_code"`
- Latitude param.Field[float64] `json:"latitude"`
- Longitude param.Field[float64] `json:"longitude"`
- PostalCode param.Field[string] `json:"postal_code"`
- RegionCode param.Field[string] `json:"region_code"`
- Subdivision2ISOCode param.Field[string] `json:"subdivision_2_iso_code"`
- Timezone param.Field[string] `json:"timezone"`
-}
-
-func (r RequestTracerTraceNewParamsContextGeoloc) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type RequestTracerTraceNewResponseEnvelope struct {
- Errors []RequestTracerTraceNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []RequestTracerTraceNewResponseEnvelopeMessages `json:"messages,required"`
- // Trace result with an origin status code
- Result RequestTracerTraceNewResponse `json:"result,required"`
- // Whether the API call was successful
- Success RequestTracerTraceNewResponseEnvelopeSuccess `json:"success,required"`
- JSON requestTracerTraceNewResponseEnvelopeJSON `json:"-"`
-}
-
-// requestTracerTraceNewResponseEnvelopeJSON contains the JSON metadata for the
-// struct [RequestTracerTraceNewResponseEnvelope]
-type requestTracerTraceNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RequestTracerTraceNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r requestTracerTraceNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RequestTracerTraceNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON requestTracerTraceNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// requestTracerTraceNewResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [RequestTracerTraceNewResponseEnvelopeErrors]
-type requestTracerTraceNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RequestTracerTraceNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r requestTracerTraceNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type RequestTracerTraceNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON requestTracerTraceNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// requestTracerTraceNewResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [RequestTracerTraceNewResponseEnvelopeMessages]
-type requestTracerTraceNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RequestTracerTraceNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r requestTracerTraceNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type RequestTracerTraceNewResponseEnvelopeSuccess bool
-
-const (
- RequestTracerTraceNewResponseEnvelopeSuccessTrue RequestTracerTraceNewResponseEnvelopeSuccess = true
-)
diff --git a/requesttracertrace_test.go b/requesttracertrace_test.go
deleted file mode 100644
index b9691ab7555..00000000000
--- a/requesttracertrace_test.go
+++ /dev/null
@@ -1,77 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRequestTracerTraceNewWithOptionalParams(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"),
- )
- _, err := client.RequestTracers.Traces.New(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.RequestTracerTraceNewParams{
- Method: cloudflare.F("PUT"),
- URL: cloudflare.F("https://some.zone/some_path"),
- Body: cloudflare.F(cloudflare.RequestTracerTraceNewParamsBody{
- Base64: cloudflare.F("c29tZV9yZXF1ZXN0X2JvZHk="),
- Json: cloudflare.F[any](map[string]interface{}{}),
- PlainText: cloudflare.F("string"),
- }),
- Context: cloudflare.F(cloudflare.RequestTracerTraceNewParamsContext{
- BotScore: cloudflare.F(int64(0)),
- Geoloc: cloudflare.F(cloudflare.RequestTracerTraceNewParamsContextGeoloc{
- City: cloudflare.F("London"),
- Continent: cloudflare.F("string"),
- IsEuCountry: cloudflare.F(true),
- ISOCode: cloudflare.F("string"),
- Latitude: cloudflare.F(0.000000),
- Longitude: cloudflare.F(0.000000),
- PostalCode: cloudflare.F("string"),
- RegionCode: cloudflare.F("string"),
- Subdivision2ISOCode: cloudflare.F("string"),
- Timezone: cloudflare.F("string"),
- }),
- SkipChallenge: cloudflare.F(true),
- ThreatScore: cloudflare.F(int64(0)),
- }),
- Cookies: cloudflare.F(map[string]string{
- "cookie_name_1": "cookie_value_1",
- "cookie_name_2": "cookie_value_2",
- }),
- Headers: cloudflare.F(map[string]string{
- "header_name_1": "header_value_1",
- "header_name_2": "header_value_2",
- }),
- Protocol: cloudflare.F("HTTP/1.1"),
- SkipResponse: cloudflare.F(true),
- },
- )
- 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/rule.go b/rule.go
deleted file mode 100644
index c858c4acaf2..00000000000
--- a/rule.go
+++ /dev/null
@@ -1,26 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RuleService contains methods and other services that help with interacting with
-// the cloudflare API. Note, unlike clients, this service does not read variables
-// from the environment automatically. You should not instantiate this service
-// directly, and instead use the [NewRuleService] method instead.
-type RuleService struct {
- Options []option.RequestOption
- Lists *RuleListService
-}
-
-// NewRuleService generates a new service that applies the given options to each
-// request. These options are applied after the parent client's options (if there
-// is one), and before any request-specific options.
-func NewRuleService(opts ...option.RequestOption) (r *RuleService) {
- r = &RuleService{}
- r.Options = opts
- r.Lists = NewRuleListService(opts...)
- return
-}
diff --git a/rulelist.go b/rulelist.go
deleted file mode 100644
index 2b19128a73b..00000000000
--- a/rulelist.go
+++ /dev/null
@@ -1,641 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RuleListService contains methods and other services that help with interacting
-// with the cloudflare API. Note, unlike clients, this service does not read
-// variables from the environment automatically. You should not instantiate this
-// service directly, and instead use the [NewRuleListService] method instead.
-type RuleListService struct {
- Options []option.RequestOption
- BulkOperations *RuleListBulkOperationService
- Items *RuleListItemService
-}
-
-// NewRuleListService generates a new service that applies the given options to
-// each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewRuleListService(opts ...option.RequestOption) (r *RuleListService) {
- r = &RuleListService{}
- r.Options = opts
- r.BulkOperations = NewRuleListBulkOperationService(opts...)
- r.Items = NewRuleListItemService(opts...)
- return
-}
-
-// Creates a new list of the specified type.
-func (r *RuleListService) New(ctx context.Context, params RuleListNewParams, opts ...option.RequestOption) (res *[]RuleListNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RuleListNewResponseEnvelope
- path := fmt.Sprintf("accounts/%s/rules/lists", params.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Updates the description of a list.
-func (r *RuleListService) Update(ctx context.Context, listID string, params RuleListUpdateParams, opts ...option.RequestOption) (res *[]RuleListUpdateResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RuleListUpdateResponseEnvelope
- path := fmt.Sprintf("accounts/%s/rules/lists/%s", params.AccountID, listID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Fetches all lists in the account.
-func (r *RuleListService) List(ctx context.Context, query RuleListListParams, opts ...option.RequestOption) (res *[]RuleListListResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RuleListListResponseEnvelope
- path := fmt.Sprintf("accounts/%s/rules/lists", query.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Deletes a specific list and all its items.
-func (r *RuleListService) Delete(ctx context.Context, listID string, body RuleListDeleteParams, opts ...option.RequestOption) (res *RuleListDeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RuleListDeleteResponseEnvelope
- path := fmt.Sprintf("accounts/%s/rules/lists/%s", body.AccountID, listID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Fetches the details of a list.
-func (r *RuleListService) Get(ctx context.Context, listID string, query RuleListGetParams, opts ...option.RequestOption) (res *[]RuleListGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RuleListGetResponseEnvelope
- path := fmt.Sprintf("accounts/%s/rules/lists/%s", query.AccountID, listID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type RuleListNewResponse = interface{}
-
-type RuleListUpdateResponse = interface{}
-
-type RuleListListResponse struct {
- // The unique ID of the list.
- ID string `json:"id,required"`
- // The RFC 3339 timestamp of when the list was created.
- CreatedOn string `json:"created_on,required"`
- // The type of the list. Each type supports specific list items (IP addresses,
- // ASNs, hostnames or redirects).
- Kind RuleListListResponseKind `json:"kind,required"`
- // The RFC 3339 timestamp of when the list was last modified.
- ModifiedOn string `json:"modified_on,required"`
- // An informative name for the list. Use this name in filter and rule expressions.
- Name string `json:"name,required"`
- // The number of items in the list.
- NumItems float64 `json:"num_items,required"`
- // An informative summary of the list.
- Description string `json:"description"`
- // The number of [filters](/operations/filters-list-filters) referencing the list.
- NumReferencingFilters float64 `json:"num_referencing_filters"`
- JSON ruleListListResponseJSON `json:"-"`
-}
-
-// ruleListListResponseJSON contains the JSON metadata for the struct
-// [RuleListListResponse]
-type ruleListListResponseJSON struct {
- ID apijson.Field
- CreatedOn apijson.Field
- Kind apijson.Field
- ModifiedOn apijson.Field
- Name apijson.Field
- NumItems apijson.Field
- Description apijson.Field
- NumReferencingFilters apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleListListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleListListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// The type of the list. Each type supports specific list items (IP addresses,
-// ASNs, hostnames or redirects).
-type RuleListListResponseKind string
-
-const (
- RuleListListResponseKindIP RuleListListResponseKind = "ip"
- RuleListListResponseKindRedirect RuleListListResponseKind = "redirect"
- RuleListListResponseKindHostname RuleListListResponseKind = "hostname"
- RuleListListResponseKindASN RuleListListResponseKind = "asn"
-)
-
-type RuleListDeleteResponse struct {
- // The unique ID of the item in the List.
- ID string `json:"id"`
- JSON ruleListDeleteResponseJSON `json:"-"`
-}
-
-// ruleListDeleteResponseJSON contains the JSON metadata for the struct
-// [RuleListDeleteResponse]
-type ruleListDeleteResponseJSON struct {
- ID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleListDeleteResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleListDeleteResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RuleListGetResponse = interface{}
-
-type RuleListNewParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
- // The type of the list. Each type supports specific list items (IP addresses,
- // ASNs, hostnames or redirects).
- Kind param.Field[RuleListNewParamsKind] `json:"kind,required"`
- // An informative name for the list. Use this name in filter and rule expressions.
- Name param.Field[string] `json:"name,required"`
- // An informative summary of the list.
- Description param.Field[string] `json:"description"`
-}
-
-func (r RuleListNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The type of the list. Each type supports specific list items (IP addresses,
-// ASNs, hostnames or redirects).
-type RuleListNewParamsKind string
-
-const (
- RuleListNewParamsKindIP RuleListNewParamsKind = "ip"
- RuleListNewParamsKindRedirect RuleListNewParamsKind = "redirect"
- RuleListNewParamsKindHostname RuleListNewParamsKind = "hostname"
- RuleListNewParamsKindASN RuleListNewParamsKind = "asn"
-)
-
-type RuleListNewResponseEnvelope struct {
- Errors []RuleListNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []RuleListNewResponseEnvelopeMessages `json:"messages,required"`
- Result []RuleListNewResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success RuleListNewResponseEnvelopeSuccess `json:"success,required"`
- JSON ruleListNewResponseEnvelopeJSON `json:"-"`
-}
-
-// ruleListNewResponseEnvelopeJSON contains the JSON metadata for the struct
-// [RuleListNewResponseEnvelope]
-type ruleListNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleListNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleListNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RuleListNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON ruleListNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// ruleListNewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
-// [RuleListNewResponseEnvelopeErrors]
-type ruleListNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleListNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleListNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type RuleListNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON ruleListNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// ruleListNewResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [RuleListNewResponseEnvelopeMessages]
-type ruleListNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleListNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleListNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type RuleListNewResponseEnvelopeSuccess bool
-
-const (
- RuleListNewResponseEnvelopeSuccessTrue RuleListNewResponseEnvelopeSuccess = true
-)
-
-type RuleListUpdateParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
- // An informative summary of the list.
- Description param.Field[string] `json:"description"`
-}
-
-func (r RuleListUpdateParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type RuleListUpdateResponseEnvelope struct {
- Errors []RuleListUpdateResponseEnvelopeErrors `json:"errors,required"`
- Messages []RuleListUpdateResponseEnvelopeMessages `json:"messages,required"`
- Result []RuleListUpdateResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success RuleListUpdateResponseEnvelopeSuccess `json:"success,required"`
- JSON ruleListUpdateResponseEnvelopeJSON `json:"-"`
-}
-
-// ruleListUpdateResponseEnvelopeJSON contains the JSON metadata for the struct
-// [RuleListUpdateResponseEnvelope]
-type ruleListUpdateResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleListUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleListUpdateResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RuleListUpdateResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON ruleListUpdateResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// ruleListUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [RuleListUpdateResponseEnvelopeErrors]
-type ruleListUpdateResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleListUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleListUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type RuleListUpdateResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON ruleListUpdateResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// ruleListUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [RuleListUpdateResponseEnvelopeMessages]
-type ruleListUpdateResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleListUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleListUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type RuleListUpdateResponseEnvelopeSuccess bool
-
-const (
- RuleListUpdateResponseEnvelopeSuccessTrue RuleListUpdateResponseEnvelopeSuccess = true
-)
-
-type RuleListListParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type RuleListListResponseEnvelope struct {
- Errors []RuleListListResponseEnvelopeErrors `json:"errors,required"`
- Messages []RuleListListResponseEnvelopeMessages `json:"messages,required"`
- Result []RuleListListResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success RuleListListResponseEnvelopeSuccess `json:"success,required"`
- JSON ruleListListResponseEnvelopeJSON `json:"-"`
-}
-
-// ruleListListResponseEnvelopeJSON contains the JSON metadata for the struct
-// [RuleListListResponseEnvelope]
-type ruleListListResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleListListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleListListResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RuleListListResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON ruleListListResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// ruleListListResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
-// [RuleListListResponseEnvelopeErrors]
-type ruleListListResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleListListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleListListResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type RuleListListResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON ruleListListResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// ruleListListResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [RuleListListResponseEnvelopeMessages]
-type ruleListListResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleListListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleListListResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type RuleListListResponseEnvelopeSuccess bool
-
-const (
- RuleListListResponseEnvelopeSuccessTrue RuleListListResponseEnvelopeSuccess = true
-)
-
-type RuleListDeleteParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type RuleListDeleteResponseEnvelope struct {
- Errors []RuleListDeleteResponseEnvelopeErrors `json:"errors,required"`
- Messages []RuleListDeleteResponseEnvelopeMessages `json:"messages,required"`
- Result RuleListDeleteResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success RuleListDeleteResponseEnvelopeSuccess `json:"success,required"`
- JSON ruleListDeleteResponseEnvelopeJSON `json:"-"`
-}
-
-// ruleListDeleteResponseEnvelopeJSON contains the JSON metadata for the struct
-// [RuleListDeleteResponseEnvelope]
-type ruleListDeleteResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleListDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleListDeleteResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RuleListDeleteResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON ruleListDeleteResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// ruleListDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [RuleListDeleteResponseEnvelopeErrors]
-type ruleListDeleteResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleListDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleListDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type RuleListDeleteResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON ruleListDeleteResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// ruleListDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [RuleListDeleteResponseEnvelopeMessages]
-type ruleListDeleteResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleListDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleListDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type RuleListDeleteResponseEnvelopeSuccess bool
-
-const (
- RuleListDeleteResponseEnvelopeSuccessTrue RuleListDeleteResponseEnvelopeSuccess = true
-)
-
-type RuleListGetParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type RuleListGetResponseEnvelope struct {
- Errors []RuleListGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []RuleListGetResponseEnvelopeMessages `json:"messages,required"`
- Result []RuleListGetResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success RuleListGetResponseEnvelopeSuccess `json:"success,required"`
- JSON ruleListGetResponseEnvelopeJSON `json:"-"`
-}
-
-// ruleListGetResponseEnvelopeJSON contains the JSON metadata for the struct
-// [RuleListGetResponseEnvelope]
-type ruleListGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleListGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleListGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RuleListGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON ruleListGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// ruleListGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
-// [RuleListGetResponseEnvelopeErrors]
-type ruleListGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleListGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleListGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type RuleListGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON ruleListGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// ruleListGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [RuleListGetResponseEnvelopeMessages]
-type ruleListGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleListGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleListGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type RuleListGetResponseEnvelopeSuccess bool
-
-const (
- RuleListGetResponseEnvelopeSuccessTrue RuleListGetResponseEnvelopeSuccess = true
-)
diff --git a/rulelist_test.go b/rulelist_test.go
deleted file mode 100644
index c11b9c81bd3..00000000000
--- a/rulelist_test.go
+++ /dev/null
@@ -1,160 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRuleListNewWithOptionalParams(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"),
- )
- _, err := client.Rules.Lists.New(context.TODO(), cloudflare.RuleListNewParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Kind: cloudflare.F(cloudflare.RuleListNewParamsKindIP),
- Name: cloudflare.F("list1"),
- Description: cloudflare.F("This is a note"),
- })
- 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())
- }
-}
-
-func TestRuleListUpdateWithOptionalParams(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"),
- )
- _, err := client.Rules.Lists.Update(
- context.TODO(),
- "2c0fc9fa937b11eaa1b71c4d701ab86e",
- cloudflare.RuleListUpdateParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Description: cloudflare.F("This is a note"),
- },
- )
- 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())
- }
-}
-
-func TestRuleListList(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"),
- )
- _, err := client.Rules.Lists.List(context.TODO(), cloudflare.RuleListListParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- })
- 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())
- }
-}
-
-func TestRuleListDelete(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"),
- )
- _, err := client.Rules.Lists.Delete(
- context.TODO(),
- "2c0fc9fa937b11eaa1b71c4d701ab86e",
- cloudflare.RuleListDeleteParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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())
- }
-}
-
-func TestRuleListGet(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"),
- )
- _, err := client.Rules.Lists.Get(
- context.TODO(),
- "2c0fc9fa937b11eaa1b71c4d701ab86e",
- cloudflare.RuleListGetParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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/rulelistbulkoperation.go b/rulelistbulkoperation.go
deleted file mode 100644
index 5e108c6782b..00000000000
--- a/rulelistbulkoperation.go
+++ /dev/null
@@ -1,131 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RuleListBulkOperationService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewRuleListBulkOperationService]
-// method instead.
-type RuleListBulkOperationService struct {
- Options []option.RequestOption
-}
-
-// NewRuleListBulkOperationService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewRuleListBulkOperationService(opts ...option.RequestOption) (r *RuleListBulkOperationService) {
- r = &RuleListBulkOperationService{}
- r.Options = opts
- return
-}
-
-// Gets the current status of an asynchronous operation on a list.
-//
-// The `status` property can have one of the following values: `pending`,
-// `running`, `completed`, or `failed`. If the status is `failed`, the `error`
-// property will contain a message describing the error.
-func (r *RuleListBulkOperationService) Get(ctx context.Context, accountIdentifier string, operationID string, opts ...option.RequestOption) (res *[]RuleListBulkOperationGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RuleListBulkOperationGetResponseEnvelope
- path := fmt.Sprintf("accounts/%s/rules/lists/bulk_operations/%s", accountIdentifier, operationID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type RuleListBulkOperationGetResponse = interface{}
-
-type RuleListBulkOperationGetResponseEnvelope struct {
- Errors []RuleListBulkOperationGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []RuleListBulkOperationGetResponseEnvelopeMessages `json:"messages,required"`
- Result []RuleListBulkOperationGetResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success RuleListBulkOperationGetResponseEnvelopeSuccess `json:"success,required"`
- JSON ruleListBulkOperationGetResponseEnvelopeJSON `json:"-"`
-}
-
-// ruleListBulkOperationGetResponseEnvelopeJSON contains the JSON metadata for the
-// struct [RuleListBulkOperationGetResponseEnvelope]
-type ruleListBulkOperationGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleListBulkOperationGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleListBulkOperationGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RuleListBulkOperationGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON ruleListBulkOperationGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// ruleListBulkOperationGetResponseEnvelopeErrorsJSON contains the JSON metadata
-// for the struct [RuleListBulkOperationGetResponseEnvelopeErrors]
-type ruleListBulkOperationGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleListBulkOperationGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleListBulkOperationGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type RuleListBulkOperationGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON ruleListBulkOperationGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// ruleListBulkOperationGetResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [RuleListBulkOperationGetResponseEnvelopeMessages]
-type ruleListBulkOperationGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleListBulkOperationGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleListBulkOperationGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type RuleListBulkOperationGetResponseEnvelopeSuccess bool
-
-const (
- RuleListBulkOperationGetResponseEnvelopeSuccessTrue RuleListBulkOperationGetResponseEnvelopeSuccess = true
-)
diff --git a/rulelistbulkoperation_test.go b/rulelistbulkoperation_test.go
deleted file mode 100644
index 50979eb5f87..00000000000
--- a/rulelistbulkoperation_test.go
+++ /dev/null
@@ -1,42 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRuleListBulkOperationGet(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"),
- )
- _, err := client.Rules.Lists.BulkOperations.Get(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- "4da8780eeb215e6cb7f48dd981c4ea02",
- )
- 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/rulelistitem.go b/rulelistitem.go
deleted file mode 100644
index 80f7d662d67..00000000000
--- a/rulelistitem.go
+++ /dev/null
@@ -1,909 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
- "reflect"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/option"
- "github.com/tidwall/gjson"
-)
-
-// RuleListItemService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewRuleListItemService] method
-// instead.
-type RuleListItemService struct {
- Options []option.RequestOption
-}
-
-// NewRuleListItemService generates a new service that applies the given options to
-// each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewRuleListItemService(opts ...option.RequestOption) (r *RuleListItemService) {
- r = &RuleListItemService{}
- r.Options = opts
- return
-}
-
-// Appends new items to the list.
-//
-// This operation is asynchronous. To get current the operation status, invoke the
-// [Get bulk operation status](/operations/lists-get-bulk-operation-status)
-// endpoint with the returned `operation_id`.
-func (r *RuleListItemService) New(ctx context.Context, listID string, params RuleListItemNewParams, opts ...option.RequestOption) (res *RuleListItemNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RuleListItemNewResponseEnvelope
- path := fmt.Sprintf("accounts/%s/rules/lists/%s/items", params.AccountID, listID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Removes all existing items from the list and adds the provided items to the
-// list.
-//
-// This operation is asynchronous. To get current the operation status, invoke the
-// [Get bulk operation status](/operations/lists-get-bulk-operation-status)
-// endpoint with the returned `operation_id`.
-func (r *RuleListItemService) Update(ctx context.Context, listID string, params RuleListItemUpdateParams, opts ...option.RequestOption) (res *RuleListItemUpdateResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RuleListItemUpdateResponseEnvelope
- path := fmt.Sprintf("accounts/%s/rules/lists/%s/items", params.AccountID, listID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Fetches all the items in the list.
-func (r *RuleListItemService) List(ctx context.Context, listID string, params RuleListItemListParams, opts ...option.RequestOption) (res *[]RuleListItemListResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RuleListItemListResponseEnvelope
- path := fmt.Sprintf("accounts/%s/rules/lists/%s/items", params.AccountID, listID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Removes one or more items from a list.
-//
-// This operation is asynchronous. To get current the operation status, invoke the
-// [Get bulk operation status](/operations/lists-get-bulk-operation-status)
-// endpoint with the returned `operation_id`.
-func (r *RuleListItemService) Delete(ctx context.Context, listID string, params RuleListItemDeleteParams, opts ...option.RequestOption) (res *RuleListItemDeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RuleListItemDeleteResponseEnvelope
- path := fmt.Sprintf("accounts/%s/rules/lists/%s/items", params.AccountID, listID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Fetches a list item in the list.
-func (r *RuleListItemService) Get(ctx context.Context, accountIdentifier string, listID string, itemID string, opts ...option.RequestOption) (res *RuleListItemGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RuleListItemGetResponseEnvelope
- path := fmt.Sprintf("accounts/%s/rules/lists/%s/items/%s", accountIdentifier, listID, itemID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type RuleListItemNewResponse struct {
- // The unique operation ID of the asynchronous action.
- OperationID string `json:"operation_id"`
- JSON ruleListItemNewResponseJSON `json:"-"`
-}
-
-// ruleListItemNewResponseJSON contains the JSON metadata for the struct
-// [RuleListItemNewResponse]
-type ruleListItemNewResponseJSON struct {
- OperationID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleListItemNewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleListItemNewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RuleListItemUpdateResponse struct {
- // The unique operation ID of the asynchronous action.
- OperationID string `json:"operation_id"`
- JSON ruleListItemUpdateResponseJSON `json:"-"`
-}
-
-// ruleListItemUpdateResponseJSON contains the JSON metadata for the struct
-// [RuleListItemUpdateResponse]
-type ruleListItemUpdateResponseJSON struct {
- OperationID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleListItemUpdateResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleListItemUpdateResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RuleListItemListResponse = interface{}
-
-type RuleListItemDeleteResponse struct {
- // The unique operation ID of the asynchronous action.
- OperationID string `json:"operation_id"`
- JSON ruleListItemDeleteResponseJSON `json:"-"`
-}
-
-// ruleListItemDeleteResponseJSON contains the JSON metadata for the struct
-// [RuleListItemDeleteResponse]
-type ruleListItemDeleteResponseJSON struct {
- OperationID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleListItemDeleteResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleListItemDeleteResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// An IPv4 address, an IPv4 CIDR, or an IPv6 CIDR. IPv6 CIDRs are limited to a
-// maximum of /64.
-//
-// Union satisfied by [shared.UnionString],
-// [RuleListItemGetResponseListsItemRedirect],
-// [RuleListItemGetResponseListsItemHostname] or [shared.UnionInt].
-type RuleListItemGetResponse interface {
- ImplementsRuleListItemGetResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*RuleListItemGetResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(RuleListItemGetResponseListsItemRedirect{}),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(RuleListItemGetResponseListsItemHostname{}),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionInt(0)),
- },
- )
-}
-
-// The definition of the redirect.
-type RuleListItemGetResponseListsItemRedirect struct {
- SourceURL string `json:"source_url,required"`
- TargetURL string `json:"target_url,required"`
- IncludeSubdomains bool `json:"include_subdomains"`
- PreservePathSuffix bool `json:"preserve_path_suffix"`
- PreserveQueryString bool `json:"preserve_query_string"`
- StatusCode RuleListItemGetResponseListsItemRedirectStatusCode `json:"status_code"`
- SubpathMatching bool `json:"subpath_matching"`
- JSON ruleListItemGetResponseListsItemRedirectJSON `json:"-"`
-}
-
-// ruleListItemGetResponseListsItemRedirectJSON contains the JSON metadata for the
-// struct [RuleListItemGetResponseListsItemRedirect]
-type ruleListItemGetResponseListsItemRedirectJSON struct {
- SourceURL apijson.Field
- TargetURL apijson.Field
- IncludeSubdomains apijson.Field
- PreservePathSuffix apijson.Field
- PreserveQueryString apijson.Field
- StatusCode apijson.Field
- SubpathMatching apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleListItemGetResponseListsItemRedirect) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleListItemGetResponseListsItemRedirectJSON) RawJSON() string {
- return r.raw
-}
-
-func (r RuleListItemGetResponseListsItemRedirect) ImplementsRuleListItemGetResponse() {}
-
-type RuleListItemGetResponseListsItemRedirectStatusCode int64
-
-const (
- RuleListItemGetResponseListsItemRedirectStatusCode301 RuleListItemGetResponseListsItemRedirectStatusCode = 301
- RuleListItemGetResponseListsItemRedirectStatusCode302 RuleListItemGetResponseListsItemRedirectStatusCode = 302
- RuleListItemGetResponseListsItemRedirectStatusCode307 RuleListItemGetResponseListsItemRedirectStatusCode = 307
- RuleListItemGetResponseListsItemRedirectStatusCode308 RuleListItemGetResponseListsItemRedirectStatusCode = 308
-)
-
-// Valid characters for hostnames are ASCII(7) letters from a to z, the digits from
-// 0 to 9, wildcards (\*), and the hyphen (-).
-type RuleListItemGetResponseListsItemHostname struct {
- URLHostname string `json:"url_hostname,required"`
- JSON ruleListItemGetResponseListsItemHostnameJSON `json:"-"`
-}
-
-// ruleListItemGetResponseListsItemHostnameJSON contains the JSON metadata for the
-// struct [RuleListItemGetResponseListsItemHostname]
-type ruleListItemGetResponseListsItemHostnameJSON struct {
- URLHostname apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleListItemGetResponseListsItemHostname) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleListItemGetResponseListsItemHostnameJSON) RawJSON() string {
- return r.raw
-}
-
-func (r RuleListItemGetResponseListsItemHostname) ImplementsRuleListItemGetResponse() {}
-
-type RuleListItemNewParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
- Body param.Field[[]RuleListItemNewParamsBody] `json:"body,required"`
-}
-
-func (r RuleListItemNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r.Body)
-}
-
-type RuleListItemNewParamsBody struct {
- // A non-negative 32 bit integer
- ASN param.Field[int64] `json:"asn"`
- // An informative summary of the list item.
- Comment param.Field[string] `json:"comment"`
- // Valid characters for hostnames are ASCII(7) letters from a to z, the digits from
- // 0 to 9, wildcards (\*), and the hyphen (-).
- Hostname param.Field[RuleListItemNewParamsBodyHostname] `json:"hostname"`
- // An IPv4 address, an IPv4 CIDR, or an IPv6 CIDR. IPv6 CIDRs are limited to a
- // maximum of /64.
- IP param.Field[string] `json:"ip"`
- // The definition of the redirect.
- Redirect param.Field[RuleListItemNewParamsBodyRedirect] `json:"redirect"`
-}
-
-func (r RuleListItemNewParamsBody) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Valid characters for hostnames are ASCII(7) letters from a to z, the digits from
-// 0 to 9, wildcards (\*), and the hyphen (-).
-type RuleListItemNewParamsBodyHostname struct {
- URLHostname param.Field[string] `json:"url_hostname,required"`
-}
-
-func (r RuleListItemNewParamsBodyHostname) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The definition of the redirect.
-type RuleListItemNewParamsBodyRedirect struct {
- SourceURL param.Field[string] `json:"source_url,required"`
- TargetURL param.Field[string] `json:"target_url,required"`
- IncludeSubdomains param.Field[bool] `json:"include_subdomains"`
- PreservePathSuffix param.Field[bool] `json:"preserve_path_suffix"`
- PreserveQueryString param.Field[bool] `json:"preserve_query_string"`
- StatusCode param.Field[RuleListItemNewParamsBodyRedirectStatusCode] `json:"status_code"`
- SubpathMatching param.Field[bool] `json:"subpath_matching"`
-}
-
-func (r RuleListItemNewParamsBodyRedirect) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type RuleListItemNewParamsBodyRedirectStatusCode int64
-
-const (
- RuleListItemNewParamsBodyRedirectStatusCode301 RuleListItemNewParamsBodyRedirectStatusCode = 301
- RuleListItemNewParamsBodyRedirectStatusCode302 RuleListItemNewParamsBodyRedirectStatusCode = 302
- RuleListItemNewParamsBodyRedirectStatusCode307 RuleListItemNewParamsBodyRedirectStatusCode = 307
- RuleListItemNewParamsBodyRedirectStatusCode308 RuleListItemNewParamsBodyRedirectStatusCode = 308
-)
-
-type RuleListItemNewResponseEnvelope struct {
- Errors []RuleListItemNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []RuleListItemNewResponseEnvelopeMessages `json:"messages,required"`
- Result RuleListItemNewResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success RuleListItemNewResponseEnvelopeSuccess `json:"success,required"`
- JSON ruleListItemNewResponseEnvelopeJSON `json:"-"`
-}
-
-// ruleListItemNewResponseEnvelopeJSON contains the JSON metadata for the struct
-// [RuleListItemNewResponseEnvelope]
-type ruleListItemNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleListItemNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleListItemNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RuleListItemNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON ruleListItemNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// ruleListItemNewResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [RuleListItemNewResponseEnvelopeErrors]
-type ruleListItemNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleListItemNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleListItemNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type RuleListItemNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON ruleListItemNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// ruleListItemNewResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [RuleListItemNewResponseEnvelopeMessages]
-type ruleListItemNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleListItemNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleListItemNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type RuleListItemNewResponseEnvelopeSuccess bool
-
-const (
- RuleListItemNewResponseEnvelopeSuccessTrue RuleListItemNewResponseEnvelopeSuccess = true
-)
-
-type RuleListItemUpdateParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
- Body param.Field[[]RuleListItemUpdateParamsBody] `json:"body,required"`
-}
-
-func (r RuleListItemUpdateParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r.Body)
-}
-
-type RuleListItemUpdateParamsBody struct {
- // A non-negative 32 bit integer
- ASN param.Field[int64] `json:"asn"`
- // An informative summary of the list item.
- Comment param.Field[string] `json:"comment"`
- // Valid characters for hostnames are ASCII(7) letters from a to z, the digits from
- // 0 to 9, wildcards (\*), and the hyphen (-).
- Hostname param.Field[RuleListItemUpdateParamsBodyHostname] `json:"hostname"`
- // An IPv4 address, an IPv4 CIDR, or an IPv6 CIDR. IPv6 CIDRs are limited to a
- // maximum of /64.
- IP param.Field[string] `json:"ip"`
- // The definition of the redirect.
- Redirect param.Field[RuleListItemUpdateParamsBodyRedirect] `json:"redirect"`
-}
-
-func (r RuleListItemUpdateParamsBody) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Valid characters for hostnames are ASCII(7) letters from a to z, the digits from
-// 0 to 9, wildcards (\*), and the hyphen (-).
-type RuleListItemUpdateParamsBodyHostname struct {
- URLHostname param.Field[string] `json:"url_hostname,required"`
-}
-
-func (r RuleListItemUpdateParamsBodyHostname) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The definition of the redirect.
-type RuleListItemUpdateParamsBodyRedirect struct {
- SourceURL param.Field[string] `json:"source_url,required"`
- TargetURL param.Field[string] `json:"target_url,required"`
- IncludeSubdomains param.Field[bool] `json:"include_subdomains"`
- PreservePathSuffix param.Field[bool] `json:"preserve_path_suffix"`
- PreserveQueryString param.Field[bool] `json:"preserve_query_string"`
- StatusCode param.Field[RuleListItemUpdateParamsBodyRedirectStatusCode] `json:"status_code"`
- SubpathMatching param.Field[bool] `json:"subpath_matching"`
-}
-
-func (r RuleListItemUpdateParamsBodyRedirect) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type RuleListItemUpdateParamsBodyRedirectStatusCode int64
-
-const (
- RuleListItemUpdateParamsBodyRedirectStatusCode301 RuleListItemUpdateParamsBodyRedirectStatusCode = 301
- RuleListItemUpdateParamsBodyRedirectStatusCode302 RuleListItemUpdateParamsBodyRedirectStatusCode = 302
- RuleListItemUpdateParamsBodyRedirectStatusCode307 RuleListItemUpdateParamsBodyRedirectStatusCode = 307
- RuleListItemUpdateParamsBodyRedirectStatusCode308 RuleListItemUpdateParamsBodyRedirectStatusCode = 308
-)
-
-type RuleListItemUpdateResponseEnvelope struct {
- Errors []RuleListItemUpdateResponseEnvelopeErrors `json:"errors,required"`
- Messages []RuleListItemUpdateResponseEnvelopeMessages `json:"messages,required"`
- Result RuleListItemUpdateResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success RuleListItemUpdateResponseEnvelopeSuccess `json:"success,required"`
- JSON ruleListItemUpdateResponseEnvelopeJSON `json:"-"`
-}
-
-// ruleListItemUpdateResponseEnvelopeJSON contains the JSON metadata for the struct
-// [RuleListItemUpdateResponseEnvelope]
-type ruleListItemUpdateResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleListItemUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleListItemUpdateResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RuleListItemUpdateResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON ruleListItemUpdateResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// ruleListItemUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [RuleListItemUpdateResponseEnvelopeErrors]
-type ruleListItemUpdateResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleListItemUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleListItemUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type RuleListItemUpdateResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON ruleListItemUpdateResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// ruleListItemUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [RuleListItemUpdateResponseEnvelopeMessages]
-type ruleListItemUpdateResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleListItemUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleListItemUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type RuleListItemUpdateResponseEnvelopeSuccess bool
-
-const (
- RuleListItemUpdateResponseEnvelopeSuccessTrue RuleListItemUpdateResponseEnvelopeSuccess = true
-)
-
-type RuleListItemListParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
- // The pagination cursor. An opaque string token indicating the position from which
- // to continue when requesting the next/previous set of records. Cursor values are
- // provided under `result_info.cursors` in the response. You should make no
- // assumptions about a cursor's content or length.
- Cursor param.Field[string] `query:"cursor"`
- // Amount of results to include in each paginated response. A non-negative 32 bit
- // integer.
- PerPage param.Field[int64] `query:"per_page"`
- // A search query to filter returned items. Its meaning depends on the list type:
- // IP addresses must start with the provided string, hostnames and bulk redirects
- // must contain the string, and ASNs must match the string exactly.
- Search param.Field[string] `query:"search"`
-}
-
-// URLQuery serializes [RuleListItemListParams]'s query parameters as `url.Values`.
-func (r RuleListItemListParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type RuleListItemListResponseEnvelope struct {
- Errors []RuleListItemListResponseEnvelopeErrors `json:"errors,required"`
- Messages []RuleListItemListResponseEnvelopeMessages `json:"messages,required"`
- Result []RuleListItemListResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success RuleListItemListResponseEnvelopeSuccess `json:"success,required"`
- ResultInfo RuleListItemListResponseEnvelopeResultInfo `json:"result_info"`
- JSON ruleListItemListResponseEnvelopeJSON `json:"-"`
-}
-
-// ruleListItemListResponseEnvelopeJSON contains the JSON metadata for the struct
-// [RuleListItemListResponseEnvelope]
-type ruleListItemListResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- ResultInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleListItemListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleListItemListResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RuleListItemListResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON ruleListItemListResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// ruleListItemListResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [RuleListItemListResponseEnvelopeErrors]
-type ruleListItemListResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleListItemListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleListItemListResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type RuleListItemListResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON ruleListItemListResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// ruleListItemListResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [RuleListItemListResponseEnvelopeMessages]
-type ruleListItemListResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleListItemListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleListItemListResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type RuleListItemListResponseEnvelopeSuccess bool
-
-const (
- RuleListItemListResponseEnvelopeSuccessTrue RuleListItemListResponseEnvelopeSuccess = true
-)
-
-type RuleListItemListResponseEnvelopeResultInfo struct {
- Cursors RuleListItemListResponseEnvelopeResultInfoCursors `json:"cursors"`
- JSON ruleListItemListResponseEnvelopeResultInfoJSON `json:"-"`
-}
-
-// ruleListItemListResponseEnvelopeResultInfoJSON contains the JSON metadata for
-// the struct [RuleListItemListResponseEnvelopeResultInfo]
-type ruleListItemListResponseEnvelopeResultInfoJSON struct {
- Cursors apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleListItemListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleListItemListResponseEnvelopeResultInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type RuleListItemListResponseEnvelopeResultInfoCursors struct {
- After string `json:"after"`
- Before string `json:"before"`
- JSON ruleListItemListResponseEnvelopeResultInfoCursorsJSON `json:"-"`
-}
-
-// ruleListItemListResponseEnvelopeResultInfoCursorsJSON contains the JSON metadata
-// for the struct [RuleListItemListResponseEnvelopeResultInfoCursors]
-type ruleListItemListResponseEnvelopeResultInfoCursorsJSON struct {
- After apijson.Field
- Before apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleListItemListResponseEnvelopeResultInfoCursors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleListItemListResponseEnvelopeResultInfoCursorsJSON) RawJSON() string {
- return r.raw
-}
-
-type RuleListItemDeleteParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
- Items param.Field[[]RuleListItemDeleteParamsItem] `json:"items"`
-}
-
-func (r RuleListItemDeleteParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type RuleListItemDeleteParamsItem struct {
- // The unique ID of the item in the List.
- ID param.Field[string] `json:"id"`
-}
-
-func (r RuleListItemDeleteParamsItem) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type RuleListItemDeleteResponseEnvelope struct {
- Errors []RuleListItemDeleteResponseEnvelopeErrors `json:"errors,required"`
- Messages []RuleListItemDeleteResponseEnvelopeMessages `json:"messages,required"`
- Result RuleListItemDeleteResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success RuleListItemDeleteResponseEnvelopeSuccess `json:"success,required"`
- JSON ruleListItemDeleteResponseEnvelopeJSON `json:"-"`
-}
-
-// ruleListItemDeleteResponseEnvelopeJSON contains the JSON metadata for the struct
-// [RuleListItemDeleteResponseEnvelope]
-type ruleListItemDeleteResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleListItemDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleListItemDeleteResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RuleListItemDeleteResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON ruleListItemDeleteResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// ruleListItemDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [RuleListItemDeleteResponseEnvelopeErrors]
-type ruleListItemDeleteResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleListItemDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleListItemDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type RuleListItemDeleteResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON ruleListItemDeleteResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// ruleListItemDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [RuleListItemDeleteResponseEnvelopeMessages]
-type ruleListItemDeleteResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleListItemDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleListItemDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type RuleListItemDeleteResponseEnvelopeSuccess bool
-
-const (
- RuleListItemDeleteResponseEnvelopeSuccessTrue RuleListItemDeleteResponseEnvelopeSuccess = true
-)
-
-type RuleListItemGetResponseEnvelope struct {
- Errors []RuleListItemGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []RuleListItemGetResponseEnvelopeMessages `json:"messages,required"`
- // An IPv4 address, an IPv4 CIDR, or an IPv6 CIDR. IPv6 CIDRs are limited to a
- // maximum of /64.
- Result RuleListItemGetResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success RuleListItemGetResponseEnvelopeSuccess `json:"success,required"`
- JSON ruleListItemGetResponseEnvelopeJSON `json:"-"`
-}
-
-// ruleListItemGetResponseEnvelopeJSON contains the JSON metadata for the struct
-// [RuleListItemGetResponseEnvelope]
-type ruleListItemGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleListItemGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleListItemGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RuleListItemGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON ruleListItemGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// ruleListItemGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [RuleListItemGetResponseEnvelopeErrors]
-type ruleListItemGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleListItemGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleListItemGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type RuleListItemGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON ruleListItemGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// ruleListItemGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [RuleListItemGetResponseEnvelopeMessages]
-type ruleListItemGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RuleListItemGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r ruleListItemGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type RuleListItemGetResponseEnvelopeSuccess bool
-
-const (
- RuleListItemGetResponseEnvelopeSuccessTrue RuleListItemGetResponseEnvelopeSuccess = true
-)
diff --git a/rulelistitem_test.go b/rulelistitem_test.go
deleted file mode 100644
index 9bd44b65b14..00000000000
--- a/rulelistitem_test.go
+++ /dev/null
@@ -1,267 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRuleListItemNew(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"),
- )
- _, err := client.Rules.Lists.Items.New(
- context.TODO(),
- "2c0fc9fa937b11eaa1b71c4d701ab86e",
- cloudflare.RuleListItemNewParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Body: cloudflare.F([]cloudflare.RuleListItemNewParamsBody{{
- ASN: cloudflare.F(int64(5567)),
- Comment: cloudflare.F("Private IP address"),
- Hostname: cloudflare.F(cloudflare.RuleListItemNewParamsBodyHostname{
- URLHostname: cloudflare.F("example.com"),
- }),
- IP: cloudflare.F("10.0.0.1"),
- Redirect: cloudflare.F(cloudflare.RuleListItemNewParamsBodyRedirect{
- IncludeSubdomains: cloudflare.F(true),
- PreservePathSuffix: cloudflare.F(true),
- PreserveQueryString: cloudflare.F(true),
- SourceURL: cloudflare.F("example.com/arch"),
- StatusCode: cloudflare.F(cloudflare.RuleListItemNewParamsBodyRedirectStatusCode301),
- SubpathMatching: cloudflare.F(true),
- TargetURL: cloudflare.F("https://archlinux.org/"),
- }),
- }, {
- ASN: cloudflare.F(int64(5567)),
- Comment: cloudflare.F("Private IP address"),
- Hostname: cloudflare.F(cloudflare.RuleListItemNewParamsBodyHostname{
- URLHostname: cloudflare.F("example.com"),
- }),
- IP: cloudflare.F("10.0.0.1"),
- Redirect: cloudflare.F(cloudflare.RuleListItemNewParamsBodyRedirect{
- IncludeSubdomains: cloudflare.F(true),
- PreservePathSuffix: cloudflare.F(true),
- PreserveQueryString: cloudflare.F(true),
- SourceURL: cloudflare.F("example.com/arch"),
- StatusCode: cloudflare.F(cloudflare.RuleListItemNewParamsBodyRedirectStatusCode301),
- SubpathMatching: cloudflare.F(true),
- TargetURL: cloudflare.F("https://archlinux.org/"),
- }),
- }, {
- ASN: cloudflare.F(int64(5567)),
- Comment: cloudflare.F("Private IP address"),
- Hostname: cloudflare.F(cloudflare.RuleListItemNewParamsBodyHostname{
- URLHostname: cloudflare.F("example.com"),
- }),
- IP: cloudflare.F("10.0.0.1"),
- Redirect: cloudflare.F(cloudflare.RuleListItemNewParamsBodyRedirect{
- IncludeSubdomains: cloudflare.F(true),
- PreservePathSuffix: cloudflare.F(true),
- PreserveQueryString: cloudflare.F(true),
- SourceURL: cloudflare.F("example.com/arch"),
- StatusCode: cloudflare.F(cloudflare.RuleListItemNewParamsBodyRedirectStatusCode301),
- SubpathMatching: cloudflare.F(true),
- TargetURL: cloudflare.F("https://archlinux.org/"),
- }),
- }}),
- },
- )
- 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())
- }
-}
-
-func TestRuleListItemUpdate(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"),
- )
- _, err := client.Rules.Lists.Items.Update(
- context.TODO(),
- "2c0fc9fa937b11eaa1b71c4d701ab86e",
- cloudflare.RuleListItemUpdateParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Body: cloudflare.F([]cloudflare.RuleListItemUpdateParamsBody{{
- ASN: cloudflare.F(int64(5567)),
- Comment: cloudflare.F("Private IP address"),
- Hostname: cloudflare.F(cloudflare.RuleListItemUpdateParamsBodyHostname{
- URLHostname: cloudflare.F("example.com"),
- }),
- IP: cloudflare.F("10.0.0.1"),
- Redirect: cloudflare.F(cloudflare.RuleListItemUpdateParamsBodyRedirect{
- IncludeSubdomains: cloudflare.F(true),
- PreservePathSuffix: cloudflare.F(true),
- PreserveQueryString: cloudflare.F(true),
- SourceURL: cloudflare.F("example.com/arch"),
- StatusCode: cloudflare.F(cloudflare.RuleListItemUpdateParamsBodyRedirectStatusCode301),
- SubpathMatching: cloudflare.F(true),
- TargetURL: cloudflare.F("https://archlinux.org/"),
- }),
- }, {
- ASN: cloudflare.F(int64(5567)),
- Comment: cloudflare.F("Private IP address"),
- Hostname: cloudflare.F(cloudflare.RuleListItemUpdateParamsBodyHostname{
- URLHostname: cloudflare.F("example.com"),
- }),
- IP: cloudflare.F("10.0.0.1"),
- Redirect: cloudflare.F(cloudflare.RuleListItemUpdateParamsBodyRedirect{
- IncludeSubdomains: cloudflare.F(true),
- PreservePathSuffix: cloudflare.F(true),
- PreserveQueryString: cloudflare.F(true),
- SourceURL: cloudflare.F("example.com/arch"),
- StatusCode: cloudflare.F(cloudflare.RuleListItemUpdateParamsBodyRedirectStatusCode301),
- SubpathMatching: cloudflare.F(true),
- TargetURL: cloudflare.F("https://archlinux.org/"),
- }),
- }, {
- ASN: cloudflare.F(int64(5567)),
- Comment: cloudflare.F("Private IP address"),
- Hostname: cloudflare.F(cloudflare.RuleListItemUpdateParamsBodyHostname{
- URLHostname: cloudflare.F("example.com"),
- }),
- IP: cloudflare.F("10.0.0.1"),
- Redirect: cloudflare.F(cloudflare.RuleListItemUpdateParamsBodyRedirect{
- IncludeSubdomains: cloudflare.F(true),
- PreservePathSuffix: cloudflare.F(true),
- PreserveQueryString: cloudflare.F(true),
- SourceURL: cloudflare.F("example.com/arch"),
- StatusCode: cloudflare.F(cloudflare.RuleListItemUpdateParamsBodyRedirectStatusCode301),
- SubpathMatching: cloudflare.F(true),
- TargetURL: cloudflare.F("https://archlinux.org/"),
- }),
- }}),
- },
- )
- 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())
- }
-}
-
-func TestRuleListItemListWithOptionalParams(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"),
- )
- _, err := client.Rules.Lists.Items.List(
- context.TODO(),
- "2c0fc9fa937b11eaa1b71c4d701ab86e",
- cloudflare.RuleListItemListParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Cursor: cloudflare.F("zzz"),
- PerPage: cloudflare.F(int64(1)),
- Search: cloudflare.F("1.1.1."),
- },
- )
- 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())
- }
-}
-
-func TestRuleListItemDeleteWithOptionalParams(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"),
- )
- _, err := client.Rules.Lists.Items.Delete(
- context.TODO(),
- "2c0fc9fa937b11eaa1b71c4d701ab86e",
- cloudflare.RuleListItemDeleteParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Items: cloudflare.F([]cloudflare.RuleListItemDeleteParamsItem{{
- ID: cloudflare.F("34b12448945f11eaa1b71c4d701ab86e"),
- }}),
- },
- )
- 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())
- }
-}
-
-func TestRuleListItemGet(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"),
- )
- _, err := client.Rules.Lists.Items.Get(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- "2c0fc9fa937b11eaa1b71c4d701ab86e",
- "34b12448945f11eaa1b71c4d701ab86e",
- )
- 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/rules/aliases.go b/rules/aliases.go
new file mode 100644
index 00000000000..09b22308b08
--- /dev/null
+++ b/rules/aliases.go
@@ -0,0 +1,9 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package rules
+
+import (
+ "github.com/cloudflare/cloudflare-go/internal/apierror"
+)
+
+type Error = apierror.Error
diff --git a/rules/list.go b/rules/list.go
new file mode 100644
index 00000000000..6f3f46898ad
--- /dev/null
+++ b/rules/list.go
@@ -0,0 +1,640 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package rules
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// ListService contains methods and other services that help with interacting with
+// the cloudflare API. Note, unlike clients, this service does not read variables
+// from the environment automatically. You should not instantiate this service
+// directly, and instead use the [NewListService] method instead.
+type ListService struct {
+ Options []option.RequestOption
+ BulkOperations *ListBulkOperationService
+ Items *ListItemService
+}
+
+// NewListService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewListService(opts ...option.RequestOption) (r *ListService) {
+ r = &ListService{}
+ r.Options = opts
+ r.BulkOperations = NewListBulkOperationService(opts...)
+ r.Items = NewListItemService(opts...)
+ return
+}
+
+// Creates a new list of the specified type.
+func (r *ListService) New(ctx context.Context, params ListNewParams, opts ...option.RequestOption) (res *ListsList, err error) {
+ opts = append(r.Options[:], opts...)
+ var env ListNewResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/rules/lists", params.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Updates the description of a list.
+func (r *ListService) Update(ctx context.Context, listID string, params ListUpdateParams, opts ...option.RequestOption) (res *ListsList, err error) {
+ opts = append(r.Options[:], opts...)
+ var env ListUpdateResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/rules/lists/%s", params.AccountID, listID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Fetches all lists in the account.
+func (r *ListService) List(ctx context.Context, query ListListParams, opts ...option.RequestOption) (res *[]ListsList, err error) {
+ opts = append(r.Options[:], opts...)
+ var env ListListResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/rules/lists", query.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Deletes a specific list and all its items.
+func (r *ListService) Delete(ctx context.Context, listID string, body ListDeleteParams, opts ...option.RequestOption) (res *ListDeleteResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env ListDeleteResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/rules/lists/%s", body.AccountID, listID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Fetches the details of a list.
+func (r *ListService) Get(ctx context.Context, listID string, query ListGetParams, opts ...option.RequestOption) (res *ListsList, err error) {
+ opts = append(r.Options[:], opts...)
+ var env ListGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/rules/lists/%s", query.AccountID, listID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type ListsList struct {
+ // The unique ID of the list.
+ ID string `json:"id"`
+ // The RFC 3339 timestamp of when the list was created.
+ CreatedOn string `json:"created_on"`
+ // An informative summary of the list.
+ Description string `json:"description"`
+ // The type of the list. Each type supports specific list items (IP addresses,
+ // ASNs, hostnames or redirects).
+ Kind ListsListKind `json:"kind"`
+ // The RFC 3339 timestamp of when the list was last modified.
+ ModifiedOn string `json:"modified_on"`
+ // An informative name for the list. Use this name in filter and rule expressions.
+ Name string `json:"name"`
+ // The number of items in the list.
+ NumItems float64 `json:"num_items"`
+ // The number of [filters](/operations/filters-list-filters) referencing the list.
+ NumReferencingFilters float64 `json:"num_referencing_filters"`
+ JSON listsListJSON `json:"-"`
+}
+
+// listsListJSON contains the JSON metadata for the struct [ListsList]
+type listsListJSON struct {
+ ID apijson.Field
+ CreatedOn apijson.Field
+ Description apijson.Field
+ Kind apijson.Field
+ ModifiedOn apijson.Field
+ Name apijson.Field
+ NumItems apijson.Field
+ NumReferencingFilters apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ListsList) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r listsListJSON) RawJSON() string {
+ return r.raw
+}
+
+// The type of the list. Each type supports specific list items (IP addresses,
+// ASNs, hostnames or redirects).
+type ListsListKind string
+
+const (
+ ListsListKindIP ListsListKind = "ip"
+ ListsListKindRedirect ListsListKind = "redirect"
+ ListsListKindHostname ListsListKind = "hostname"
+ ListsListKindASN ListsListKind = "asn"
+)
+
+type ListNewResponse = interface{}
+
+type ListUpdateResponse = interface{}
+
+type ListDeleteResponse struct {
+ // The unique ID of the item in the List.
+ ID string `json:"id"`
+ JSON listDeleteResponseJSON `json:"-"`
+}
+
+// listDeleteResponseJSON contains the JSON metadata for the struct
+// [ListDeleteResponse]
+type listDeleteResponseJSON struct {
+ ID apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ListDeleteResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r listDeleteResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type ListGetResponse = interface{}
+
+type ListNewParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ // The type of the list. Each type supports specific list items (IP addresses,
+ // ASNs, hostnames or redirects).
+ Kind param.Field[ListNewParamsKind] `json:"kind,required"`
+ // An informative name for the list. Use this name in filter and rule expressions.
+ Name param.Field[string] `json:"name,required"`
+ // An informative summary of the list.
+ Description param.Field[string] `json:"description"`
+}
+
+func (r ListNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The type of the list. Each type supports specific list items (IP addresses,
+// ASNs, hostnames or redirects).
+type ListNewParamsKind string
+
+const (
+ ListNewParamsKindIP ListNewParamsKind = "ip"
+ ListNewParamsKindRedirect ListNewParamsKind = "redirect"
+ ListNewParamsKindHostname ListNewParamsKind = "hostname"
+ ListNewParamsKindASN ListNewParamsKind = "asn"
+)
+
+type ListNewResponseEnvelope struct {
+ Errors []ListNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []ListNewResponseEnvelopeMessages `json:"messages,required"`
+ Result ListsList `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success ListNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON listNewResponseEnvelopeJSON `json:"-"`
+}
+
+// listNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [ListNewResponseEnvelope]
+type listNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ListNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r listNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type ListNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON listNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// listNewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [ListNewResponseEnvelopeErrors]
+type listNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ListNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r listNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type ListNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON listNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// listNewResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [ListNewResponseEnvelopeMessages]
+type listNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ListNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r listNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type ListNewResponseEnvelopeSuccess bool
+
+const (
+ ListNewResponseEnvelopeSuccessTrue ListNewResponseEnvelopeSuccess = true
+)
+
+type ListUpdateParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ // An informative summary of the list.
+ Description param.Field[string] `json:"description"`
+}
+
+func (r ListUpdateParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type ListUpdateResponseEnvelope struct {
+ Errors []ListUpdateResponseEnvelopeErrors `json:"errors,required"`
+ Messages []ListUpdateResponseEnvelopeMessages `json:"messages,required"`
+ Result ListsList `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success ListUpdateResponseEnvelopeSuccess `json:"success,required"`
+ JSON listUpdateResponseEnvelopeJSON `json:"-"`
+}
+
+// listUpdateResponseEnvelopeJSON contains the JSON metadata for the struct
+// [ListUpdateResponseEnvelope]
+type listUpdateResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ListUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r listUpdateResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type ListUpdateResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON listUpdateResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// listUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [ListUpdateResponseEnvelopeErrors]
+type listUpdateResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ListUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r listUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type ListUpdateResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON listUpdateResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// listUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [ListUpdateResponseEnvelopeMessages]
+type listUpdateResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ListUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r listUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type ListUpdateResponseEnvelopeSuccess bool
+
+const (
+ ListUpdateResponseEnvelopeSuccessTrue ListUpdateResponseEnvelopeSuccess = true
+)
+
+type ListListParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type ListListResponseEnvelope struct {
+ Errors []ListListResponseEnvelopeErrors `json:"errors,required"`
+ Messages []ListListResponseEnvelopeMessages `json:"messages,required"`
+ Result []ListsList `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success ListListResponseEnvelopeSuccess `json:"success,required"`
+ JSON listListResponseEnvelopeJSON `json:"-"`
+}
+
+// listListResponseEnvelopeJSON contains the JSON metadata for the struct
+// [ListListResponseEnvelope]
+type listListResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ListListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r listListResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type ListListResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON listListResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// listListResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [ListListResponseEnvelopeErrors]
+type listListResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ListListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r listListResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type ListListResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON listListResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// listListResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [ListListResponseEnvelopeMessages]
+type listListResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ListListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r listListResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type ListListResponseEnvelopeSuccess bool
+
+const (
+ ListListResponseEnvelopeSuccessTrue ListListResponseEnvelopeSuccess = true
+)
+
+type ListDeleteParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type ListDeleteResponseEnvelope struct {
+ Errors []ListDeleteResponseEnvelopeErrors `json:"errors,required"`
+ Messages []ListDeleteResponseEnvelopeMessages `json:"messages,required"`
+ Result ListDeleteResponse `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success ListDeleteResponseEnvelopeSuccess `json:"success,required"`
+ JSON listDeleteResponseEnvelopeJSON `json:"-"`
+}
+
+// listDeleteResponseEnvelopeJSON contains the JSON metadata for the struct
+// [ListDeleteResponseEnvelope]
+type listDeleteResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ListDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r listDeleteResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type ListDeleteResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON listDeleteResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// listDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [ListDeleteResponseEnvelopeErrors]
+type listDeleteResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ListDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r listDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type ListDeleteResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON listDeleteResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// listDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [ListDeleteResponseEnvelopeMessages]
+type listDeleteResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ListDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r listDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type ListDeleteResponseEnvelopeSuccess bool
+
+const (
+ ListDeleteResponseEnvelopeSuccessTrue ListDeleteResponseEnvelopeSuccess = true
+)
+
+type ListGetParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type ListGetResponseEnvelope struct {
+ Errors []ListGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []ListGetResponseEnvelopeMessages `json:"messages,required"`
+ Result ListsList `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success ListGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON listGetResponseEnvelopeJSON `json:"-"`
+}
+
+// listGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [ListGetResponseEnvelope]
+type listGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ListGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r listGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type ListGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON listGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// listGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [ListGetResponseEnvelopeErrors]
+type listGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ListGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r listGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type ListGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON listGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// listGetResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [ListGetResponseEnvelopeMessages]
+type listGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ListGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r listGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type ListGetResponseEnvelopeSuccess bool
+
+const (
+ ListGetResponseEnvelopeSuccessTrue ListGetResponseEnvelopeSuccess = true
+)
diff --git a/rules/list_test.go b/rules/list_test.go
new file mode 100644
index 00000000000..bf888cf714d
--- /dev/null
+++ b/rules/list_test.go
@@ -0,0 +1,161 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package rules_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/rules"
+)
+
+func TestListNewWithOptionalParams(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"),
+ )
+ _, err := client.Rules.Lists.New(context.TODO(), rules.ListNewParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Kind: cloudflare.F(rules.ListNewParamsKindIP),
+ Name: cloudflare.F("list1"),
+ Description: cloudflare.F("This is a note"),
+ })
+ 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())
+ }
+}
+
+func TestListUpdateWithOptionalParams(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"),
+ )
+ _, err := client.Rules.Lists.Update(
+ context.TODO(),
+ "2c0fc9fa937b11eaa1b71c4d701ab86e",
+ rules.ListUpdateParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Description: cloudflare.F("This is a note"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestListList(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"),
+ )
+ _, err := client.Rules.Lists.List(context.TODO(), rules.ListListParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ })
+ 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())
+ }
+}
+
+func TestListDelete(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"),
+ )
+ _, err := client.Rules.Lists.Delete(
+ context.TODO(),
+ "2c0fc9fa937b11eaa1b71c4d701ab86e",
+ rules.ListDeleteParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestListGet(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"),
+ )
+ _, err := client.Rules.Lists.Get(
+ context.TODO(),
+ "2c0fc9fa937b11eaa1b71c4d701ab86e",
+ rules.ListGetParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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/rules/listbulkoperation.go b/rules/listbulkoperation.go
new file mode 100644
index 00000000000..9768de39686
--- /dev/null
+++ b/rules/listbulkoperation.go
@@ -0,0 +1,131 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package rules
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// ListBulkOperationService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewListBulkOperationService] method
+// instead.
+type ListBulkOperationService struct {
+ Options []option.RequestOption
+}
+
+// NewListBulkOperationService generates a new service that applies the given
+// options to each request. These options are applied after the parent client's
+// options (if there is one), and before any request-specific options.
+func NewListBulkOperationService(opts ...option.RequestOption) (r *ListBulkOperationService) {
+ r = &ListBulkOperationService{}
+ r.Options = opts
+ return
+}
+
+// Gets the current status of an asynchronous operation on a list.
+//
+// The `status` property can have one of the following values: `pending`,
+// `running`, `completed`, or `failed`. If the status is `failed`, the `error`
+// property will contain a message describing the error.
+func (r *ListBulkOperationService) Get(ctx context.Context, accountIdentifier string, operationID string, opts ...option.RequestOption) (res *[]ListBulkOperationGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env ListBulkOperationGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/rules/lists/bulk_operations/%s", accountIdentifier, operationID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type ListBulkOperationGetResponse = interface{}
+
+type ListBulkOperationGetResponseEnvelope struct {
+ Errors []ListBulkOperationGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []ListBulkOperationGetResponseEnvelopeMessages `json:"messages,required"`
+ Result []ListBulkOperationGetResponse `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success ListBulkOperationGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON listBulkOperationGetResponseEnvelopeJSON `json:"-"`
+}
+
+// listBulkOperationGetResponseEnvelopeJSON contains the JSON metadata for the
+// struct [ListBulkOperationGetResponseEnvelope]
+type listBulkOperationGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ListBulkOperationGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r listBulkOperationGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type ListBulkOperationGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON listBulkOperationGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// listBulkOperationGetResponseEnvelopeErrorsJSON contains the JSON metadata for
+// the struct [ListBulkOperationGetResponseEnvelopeErrors]
+type listBulkOperationGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ListBulkOperationGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r listBulkOperationGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type ListBulkOperationGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON listBulkOperationGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// listBulkOperationGetResponseEnvelopeMessagesJSON contains the JSON metadata for
+// the struct [ListBulkOperationGetResponseEnvelopeMessages]
+type listBulkOperationGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ListBulkOperationGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r listBulkOperationGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type ListBulkOperationGetResponseEnvelopeSuccess bool
+
+const (
+ ListBulkOperationGetResponseEnvelopeSuccessTrue ListBulkOperationGetResponseEnvelopeSuccess = true
+)
diff --git a/rules/listbulkoperation_test.go b/rules/listbulkoperation_test.go
new file mode 100644
index 00000000000..0fe299aed56
--- /dev/null
+++ b/rules/listbulkoperation_test.go
@@ -0,0 +1,42 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package rules_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestListBulkOperationGet(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"),
+ )
+ _, err := client.Rules.Lists.BulkOperations.Get(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ "4da8780eeb215e6cb7f48dd981c4ea02",
+ )
+ 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/rules/listitem.go b/rules/listitem.go
new file mode 100644
index 00000000000..739a20afc16
--- /dev/null
+++ b/rules/listitem.go
@@ -0,0 +1,908 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package rules
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+ "reflect"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/tidwall/gjson"
+)
+
+// ListItemService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewListItemService] method instead.
+type ListItemService struct {
+ Options []option.RequestOption
+}
+
+// NewListItemService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewListItemService(opts ...option.RequestOption) (r *ListItemService) {
+ r = &ListItemService{}
+ r.Options = opts
+ return
+}
+
+// Appends new items to the list.
+//
+// This operation is asynchronous. To get current the operation status, invoke the
+// [Get bulk operation status](/operations/lists-get-bulk-operation-status)
+// endpoint with the returned `operation_id`.
+func (r *ListItemService) New(ctx context.Context, listID string, params ListItemNewParams, opts ...option.RequestOption) (res *ListItemNewResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env ListItemNewResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/rules/lists/%s/items", params.AccountID, listID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Removes all existing items from the list and adds the provided items to the
+// list.
+//
+// This operation is asynchronous. To get current the operation status, invoke the
+// [Get bulk operation status](/operations/lists-get-bulk-operation-status)
+// endpoint with the returned `operation_id`.
+func (r *ListItemService) Update(ctx context.Context, listID string, params ListItemUpdateParams, opts ...option.RequestOption) (res *ListItemUpdateResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env ListItemUpdateResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/rules/lists/%s/items", params.AccountID, listID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Fetches all the items in the list.
+func (r *ListItemService) List(ctx context.Context, listID string, params ListItemListParams, opts ...option.RequestOption) (res *[]ListItemListResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env ListItemListResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/rules/lists/%s/items", params.AccountID, listID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Removes one or more items from a list.
+//
+// This operation is asynchronous. To get current the operation status, invoke the
+// [Get bulk operation status](/operations/lists-get-bulk-operation-status)
+// endpoint with the returned `operation_id`.
+func (r *ListItemService) Delete(ctx context.Context, listID string, params ListItemDeleteParams, opts ...option.RequestOption) (res *ListItemDeleteResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env ListItemDeleteResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/rules/lists/%s/items", params.AccountID, listID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Fetches a list item in the list.
+func (r *ListItemService) Get(ctx context.Context, accountIdentifier string, listID string, itemID string, opts ...option.RequestOption) (res *ListItemGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env ListItemGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/rules/lists/%s/items/%s", accountIdentifier, listID, itemID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type ListItemNewResponse struct {
+ // The unique operation ID of the asynchronous action.
+ OperationID string `json:"operation_id"`
+ JSON listItemNewResponseJSON `json:"-"`
+}
+
+// listItemNewResponseJSON contains the JSON metadata for the struct
+// [ListItemNewResponse]
+type listItemNewResponseJSON struct {
+ OperationID apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ListItemNewResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r listItemNewResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type ListItemUpdateResponse struct {
+ // The unique operation ID of the asynchronous action.
+ OperationID string `json:"operation_id"`
+ JSON listItemUpdateResponseJSON `json:"-"`
+}
+
+// listItemUpdateResponseJSON contains the JSON metadata for the struct
+// [ListItemUpdateResponse]
+type listItemUpdateResponseJSON struct {
+ OperationID apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ListItemUpdateResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r listItemUpdateResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type ListItemListResponse = interface{}
+
+type ListItemDeleteResponse struct {
+ // The unique operation ID of the asynchronous action.
+ OperationID string `json:"operation_id"`
+ JSON listItemDeleteResponseJSON `json:"-"`
+}
+
+// listItemDeleteResponseJSON contains the JSON metadata for the struct
+// [ListItemDeleteResponse]
+type listItemDeleteResponseJSON struct {
+ OperationID apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ListItemDeleteResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r listItemDeleteResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+// An IPv4 address, an IPv4 CIDR, or an IPv6 CIDR. IPv6 CIDRs are limited to a
+// maximum of /64.
+//
+// Union satisfied by [shared.UnionString],
+// [rules.ListItemGetResponseListsItemRedirect],
+// [rules.ListItemGetResponseListsItemHostname] or [shared.UnionInt].
+type ListItemGetResponse interface {
+ ImplementsRulesListItemGetResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*ListItemGetResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(ListItemGetResponseListsItemRedirect{}),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(ListItemGetResponseListsItemHostname{}),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionInt(0)),
+ },
+ )
+}
+
+// The definition of the redirect.
+type ListItemGetResponseListsItemRedirect struct {
+ SourceURL string `json:"source_url,required"`
+ TargetURL string `json:"target_url,required"`
+ IncludeSubdomains bool `json:"include_subdomains"`
+ PreservePathSuffix bool `json:"preserve_path_suffix"`
+ PreserveQueryString bool `json:"preserve_query_string"`
+ StatusCode ListItemGetResponseListsItemRedirectStatusCode `json:"status_code"`
+ SubpathMatching bool `json:"subpath_matching"`
+ JSON listItemGetResponseListsItemRedirectJSON `json:"-"`
+}
+
+// listItemGetResponseListsItemRedirectJSON contains the JSON metadata for the
+// struct [ListItemGetResponseListsItemRedirect]
+type listItemGetResponseListsItemRedirectJSON struct {
+ SourceURL apijson.Field
+ TargetURL apijson.Field
+ IncludeSubdomains apijson.Field
+ PreservePathSuffix apijson.Field
+ PreserveQueryString apijson.Field
+ StatusCode apijson.Field
+ SubpathMatching apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ListItemGetResponseListsItemRedirect) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r listItemGetResponseListsItemRedirectJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r ListItemGetResponseListsItemRedirect) ImplementsRulesListItemGetResponse() {}
+
+type ListItemGetResponseListsItemRedirectStatusCode int64
+
+const (
+ ListItemGetResponseListsItemRedirectStatusCode301 ListItemGetResponseListsItemRedirectStatusCode = 301
+ ListItemGetResponseListsItemRedirectStatusCode302 ListItemGetResponseListsItemRedirectStatusCode = 302
+ ListItemGetResponseListsItemRedirectStatusCode307 ListItemGetResponseListsItemRedirectStatusCode = 307
+ ListItemGetResponseListsItemRedirectStatusCode308 ListItemGetResponseListsItemRedirectStatusCode = 308
+)
+
+// Valid characters for hostnames are ASCII(7) letters from a to z, the digits from
+// 0 to 9, wildcards (\*), and the hyphen (-).
+type ListItemGetResponseListsItemHostname struct {
+ URLHostname string `json:"url_hostname,required"`
+ JSON listItemGetResponseListsItemHostnameJSON `json:"-"`
+}
+
+// listItemGetResponseListsItemHostnameJSON contains the JSON metadata for the
+// struct [ListItemGetResponseListsItemHostname]
+type listItemGetResponseListsItemHostnameJSON struct {
+ URLHostname apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ListItemGetResponseListsItemHostname) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r listItemGetResponseListsItemHostnameJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r ListItemGetResponseListsItemHostname) ImplementsRulesListItemGetResponse() {}
+
+type ListItemNewParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ Body param.Field[[]ListItemNewParamsBody] `json:"body,required"`
+}
+
+func (r ListItemNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r.Body)
+}
+
+type ListItemNewParamsBody struct {
+ // A non-negative 32 bit integer
+ ASN param.Field[int64] `json:"asn"`
+ // An informative summary of the list item.
+ Comment param.Field[string] `json:"comment"`
+ // Valid characters for hostnames are ASCII(7) letters from a to z, the digits from
+ // 0 to 9, wildcards (\*), and the hyphen (-).
+ Hostname param.Field[ListItemNewParamsBodyHostname] `json:"hostname"`
+ // An IPv4 address, an IPv4 CIDR, or an IPv6 CIDR. IPv6 CIDRs are limited to a
+ // maximum of /64.
+ IP param.Field[string] `json:"ip"`
+ // The definition of the redirect.
+ Redirect param.Field[ListItemNewParamsBodyRedirect] `json:"redirect"`
+}
+
+func (r ListItemNewParamsBody) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Valid characters for hostnames are ASCII(7) letters from a to z, the digits from
+// 0 to 9, wildcards (\*), and the hyphen (-).
+type ListItemNewParamsBodyHostname struct {
+ URLHostname param.Field[string] `json:"url_hostname,required"`
+}
+
+func (r ListItemNewParamsBodyHostname) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The definition of the redirect.
+type ListItemNewParamsBodyRedirect struct {
+ SourceURL param.Field[string] `json:"source_url,required"`
+ TargetURL param.Field[string] `json:"target_url,required"`
+ IncludeSubdomains param.Field[bool] `json:"include_subdomains"`
+ PreservePathSuffix param.Field[bool] `json:"preserve_path_suffix"`
+ PreserveQueryString param.Field[bool] `json:"preserve_query_string"`
+ StatusCode param.Field[ListItemNewParamsBodyRedirectStatusCode] `json:"status_code"`
+ SubpathMatching param.Field[bool] `json:"subpath_matching"`
+}
+
+func (r ListItemNewParamsBodyRedirect) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type ListItemNewParamsBodyRedirectStatusCode int64
+
+const (
+ ListItemNewParamsBodyRedirectStatusCode301 ListItemNewParamsBodyRedirectStatusCode = 301
+ ListItemNewParamsBodyRedirectStatusCode302 ListItemNewParamsBodyRedirectStatusCode = 302
+ ListItemNewParamsBodyRedirectStatusCode307 ListItemNewParamsBodyRedirectStatusCode = 307
+ ListItemNewParamsBodyRedirectStatusCode308 ListItemNewParamsBodyRedirectStatusCode = 308
+)
+
+type ListItemNewResponseEnvelope struct {
+ Errors []ListItemNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []ListItemNewResponseEnvelopeMessages `json:"messages,required"`
+ Result ListItemNewResponse `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success ListItemNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON listItemNewResponseEnvelopeJSON `json:"-"`
+}
+
+// listItemNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [ListItemNewResponseEnvelope]
+type listItemNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ListItemNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r listItemNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type ListItemNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON listItemNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// listItemNewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [ListItemNewResponseEnvelopeErrors]
+type listItemNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ListItemNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r listItemNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type ListItemNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON listItemNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// listItemNewResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [ListItemNewResponseEnvelopeMessages]
+type listItemNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ListItemNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r listItemNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type ListItemNewResponseEnvelopeSuccess bool
+
+const (
+ ListItemNewResponseEnvelopeSuccessTrue ListItemNewResponseEnvelopeSuccess = true
+)
+
+type ListItemUpdateParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ Body param.Field[[]ListItemUpdateParamsBody] `json:"body,required"`
+}
+
+func (r ListItemUpdateParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r.Body)
+}
+
+type ListItemUpdateParamsBody struct {
+ // A non-negative 32 bit integer
+ ASN param.Field[int64] `json:"asn"`
+ // An informative summary of the list item.
+ Comment param.Field[string] `json:"comment"`
+ // Valid characters for hostnames are ASCII(7) letters from a to z, the digits from
+ // 0 to 9, wildcards (\*), and the hyphen (-).
+ Hostname param.Field[ListItemUpdateParamsBodyHostname] `json:"hostname"`
+ // An IPv4 address, an IPv4 CIDR, or an IPv6 CIDR. IPv6 CIDRs are limited to a
+ // maximum of /64.
+ IP param.Field[string] `json:"ip"`
+ // The definition of the redirect.
+ Redirect param.Field[ListItemUpdateParamsBodyRedirect] `json:"redirect"`
+}
+
+func (r ListItemUpdateParamsBody) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Valid characters for hostnames are ASCII(7) letters from a to z, the digits from
+// 0 to 9, wildcards (\*), and the hyphen (-).
+type ListItemUpdateParamsBodyHostname struct {
+ URLHostname param.Field[string] `json:"url_hostname,required"`
+}
+
+func (r ListItemUpdateParamsBodyHostname) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The definition of the redirect.
+type ListItemUpdateParamsBodyRedirect struct {
+ SourceURL param.Field[string] `json:"source_url,required"`
+ TargetURL param.Field[string] `json:"target_url,required"`
+ IncludeSubdomains param.Field[bool] `json:"include_subdomains"`
+ PreservePathSuffix param.Field[bool] `json:"preserve_path_suffix"`
+ PreserveQueryString param.Field[bool] `json:"preserve_query_string"`
+ StatusCode param.Field[ListItemUpdateParamsBodyRedirectStatusCode] `json:"status_code"`
+ SubpathMatching param.Field[bool] `json:"subpath_matching"`
+}
+
+func (r ListItemUpdateParamsBodyRedirect) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type ListItemUpdateParamsBodyRedirectStatusCode int64
+
+const (
+ ListItemUpdateParamsBodyRedirectStatusCode301 ListItemUpdateParamsBodyRedirectStatusCode = 301
+ ListItemUpdateParamsBodyRedirectStatusCode302 ListItemUpdateParamsBodyRedirectStatusCode = 302
+ ListItemUpdateParamsBodyRedirectStatusCode307 ListItemUpdateParamsBodyRedirectStatusCode = 307
+ ListItemUpdateParamsBodyRedirectStatusCode308 ListItemUpdateParamsBodyRedirectStatusCode = 308
+)
+
+type ListItemUpdateResponseEnvelope struct {
+ Errors []ListItemUpdateResponseEnvelopeErrors `json:"errors,required"`
+ Messages []ListItemUpdateResponseEnvelopeMessages `json:"messages,required"`
+ Result ListItemUpdateResponse `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success ListItemUpdateResponseEnvelopeSuccess `json:"success,required"`
+ JSON listItemUpdateResponseEnvelopeJSON `json:"-"`
+}
+
+// listItemUpdateResponseEnvelopeJSON contains the JSON metadata for the struct
+// [ListItemUpdateResponseEnvelope]
+type listItemUpdateResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ListItemUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r listItemUpdateResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type ListItemUpdateResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON listItemUpdateResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// listItemUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [ListItemUpdateResponseEnvelopeErrors]
+type listItemUpdateResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ListItemUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r listItemUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type ListItemUpdateResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON listItemUpdateResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// listItemUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [ListItemUpdateResponseEnvelopeMessages]
+type listItemUpdateResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ListItemUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r listItemUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type ListItemUpdateResponseEnvelopeSuccess bool
+
+const (
+ ListItemUpdateResponseEnvelopeSuccessTrue ListItemUpdateResponseEnvelopeSuccess = true
+)
+
+type ListItemListParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ // The pagination cursor. An opaque string token indicating the position from which
+ // to continue when requesting the next/previous set of records. Cursor values are
+ // provided under `result_info.cursors` in the response. You should make no
+ // assumptions about a cursor's content or length.
+ Cursor param.Field[string] `query:"cursor"`
+ // Amount of results to include in each paginated response. A non-negative 32 bit
+ // integer.
+ PerPage param.Field[int64] `query:"per_page"`
+ // A search query to filter returned items. Its meaning depends on the list type:
+ // IP addresses must start with the provided string, hostnames and bulk redirects
+ // must contain the string, and ASNs must match the string exactly.
+ Search param.Field[string] `query:"search"`
+}
+
+// URLQuery serializes [ListItemListParams]'s query parameters as `url.Values`.
+func (r ListItemListParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type ListItemListResponseEnvelope struct {
+ Errors []ListItemListResponseEnvelopeErrors `json:"errors,required"`
+ Messages []ListItemListResponseEnvelopeMessages `json:"messages,required"`
+ Result []ListItemListResponse `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success ListItemListResponseEnvelopeSuccess `json:"success,required"`
+ ResultInfo ListItemListResponseEnvelopeResultInfo `json:"result_info"`
+ JSON listItemListResponseEnvelopeJSON `json:"-"`
+}
+
+// listItemListResponseEnvelopeJSON contains the JSON metadata for the struct
+// [ListItemListResponseEnvelope]
+type listItemListResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ ResultInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ListItemListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r listItemListResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type ListItemListResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON listItemListResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// listItemListResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [ListItemListResponseEnvelopeErrors]
+type listItemListResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ListItemListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r listItemListResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type ListItemListResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON listItemListResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// listItemListResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [ListItemListResponseEnvelopeMessages]
+type listItemListResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ListItemListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r listItemListResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type ListItemListResponseEnvelopeSuccess bool
+
+const (
+ ListItemListResponseEnvelopeSuccessTrue ListItemListResponseEnvelopeSuccess = true
+)
+
+type ListItemListResponseEnvelopeResultInfo struct {
+ Cursors ListItemListResponseEnvelopeResultInfoCursors `json:"cursors"`
+ JSON listItemListResponseEnvelopeResultInfoJSON `json:"-"`
+}
+
+// listItemListResponseEnvelopeResultInfoJSON contains the JSON metadata for the
+// struct [ListItemListResponseEnvelopeResultInfo]
+type listItemListResponseEnvelopeResultInfoJSON struct {
+ Cursors apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ListItemListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r listItemListResponseEnvelopeResultInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type ListItemListResponseEnvelopeResultInfoCursors struct {
+ After string `json:"after"`
+ Before string `json:"before"`
+ JSON listItemListResponseEnvelopeResultInfoCursorsJSON `json:"-"`
+}
+
+// listItemListResponseEnvelopeResultInfoCursorsJSON contains the JSON metadata for
+// the struct [ListItemListResponseEnvelopeResultInfoCursors]
+type listItemListResponseEnvelopeResultInfoCursorsJSON struct {
+ After apijson.Field
+ Before apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ListItemListResponseEnvelopeResultInfoCursors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r listItemListResponseEnvelopeResultInfoCursorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type ListItemDeleteParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ Items param.Field[[]ListItemDeleteParamsItem] `json:"items"`
+}
+
+func (r ListItemDeleteParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type ListItemDeleteParamsItem struct {
+ // The unique ID of the item in the List.
+ ID param.Field[string] `json:"id"`
+}
+
+func (r ListItemDeleteParamsItem) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type ListItemDeleteResponseEnvelope struct {
+ Errors []ListItemDeleteResponseEnvelopeErrors `json:"errors,required"`
+ Messages []ListItemDeleteResponseEnvelopeMessages `json:"messages,required"`
+ Result ListItemDeleteResponse `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success ListItemDeleteResponseEnvelopeSuccess `json:"success,required"`
+ JSON listItemDeleteResponseEnvelopeJSON `json:"-"`
+}
+
+// listItemDeleteResponseEnvelopeJSON contains the JSON metadata for the struct
+// [ListItemDeleteResponseEnvelope]
+type listItemDeleteResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ListItemDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r listItemDeleteResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type ListItemDeleteResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON listItemDeleteResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// listItemDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [ListItemDeleteResponseEnvelopeErrors]
+type listItemDeleteResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ListItemDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r listItemDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type ListItemDeleteResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON listItemDeleteResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// listItemDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [ListItemDeleteResponseEnvelopeMessages]
+type listItemDeleteResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ListItemDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r listItemDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type ListItemDeleteResponseEnvelopeSuccess bool
+
+const (
+ ListItemDeleteResponseEnvelopeSuccessTrue ListItemDeleteResponseEnvelopeSuccess = true
+)
+
+type ListItemGetResponseEnvelope struct {
+ Errors []ListItemGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []ListItemGetResponseEnvelopeMessages `json:"messages,required"`
+ // An IPv4 address, an IPv4 CIDR, or an IPv6 CIDR. IPv6 CIDRs are limited to a
+ // maximum of /64.
+ Result ListItemGetResponse `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success ListItemGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON listItemGetResponseEnvelopeJSON `json:"-"`
+}
+
+// listItemGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [ListItemGetResponseEnvelope]
+type listItemGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ListItemGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r listItemGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type ListItemGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON listItemGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// listItemGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [ListItemGetResponseEnvelopeErrors]
+type listItemGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ListItemGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r listItemGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type ListItemGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON listItemGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// listItemGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [ListItemGetResponseEnvelopeMessages]
+type listItemGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ListItemGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r listItemGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type ListItemGetResponseEnvelopeSuccess bool
+
+const (
+ ListItemGetResponseEnvelopeSuccessTrue ListItemGetResponseEnvelopeSuccess = true
+)
diff --git a/rules/listitem_test.go b/rules/listitem_test.go
new file mode 100644
index 00000000000..20d394a4901
--- /dev/null
+++ b/rules/listitem_test.go
@@ -0,0 +1,268 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package rules_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/rules"
+)
+
+func TestListItemNew(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"),
+ )
+ _, err := client.Rules.Lists.Items.New(
+ context.TODO(),
+ "2c0fc9fa937b11eaa1b71c4d701ab86e",
+ rules.ListItemNewParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Body: cloudflare.F([]rules.ListItemNewParamsBody{{
+ ASN: cloudflare.F(int64(5567)),
+ Comment: cloudflare.F("Private IP address"),
+ Hostname: cloudflare.F(rules.ListItemNewParamsBodyHostname{
+ URLHostname: cloudflare.F("example.com"),
+ }),
+ IP: cloudflare.F("10.0.0.1"),
+ Redirect: cloudflare.F(rules.ListItemNewParamsBodyRedirect{
+ IncludeSubdomains: cloudflare.F(true),
+ PreservePathSuffix: cloudflare.F(true),
+ PreserveQueryString: cloudflare.F(true),
+ SourceURL: cloudflare.F("example.com/arch"),
+ StatusCode: cloudflare.F(rules.ListItemNewParamsBodyRedirectStatusCode301),
+ SubpathMatching: cloudflare.F(true),
+ TargetURL: cloudflare.F("https://archlinux.org/"),
+ }),
+ }, {
+ ASN: cloudflare.F(int64(5567)),
+ Comment: cloudflare.F("Private IP address"),
+ Hostname: cloudflare.F(rules.ListItemNewParamsBodyHostname{
+ URLHostname: cloudflare.F("example.com"),
+ }),
+ IP: cloudflare.F("10.0.0.1"),
+ Redirect: cloudflare.F(rules.ListItemNewParamsBodyRedirect{
+ IncludeSubdomains: cloudflare.F(true),
+ PreservePathSuffix: cloudflare.F(true),
+ PreserveQueryString: cloudflare.F(true),
+ SourceURL: cloudflare.F("example.com/arch"),
+ StatusCode: cloudflare.F(rules.ListItemNewParamsBodyRedirectStatusCode301),
+ SubpathMatching: cloudflare.F(true),
+ TargetURL: cloudflare.F("https://archlinux.org/"),
+ }),
+ }, {
+ ASN: cloudflare.F(int64(5567)),
+ Comment: cloudflare.F("Private IP address"),
+ Hostname: cloudflare.F(rules.ListItemNewParamsBodyHostname{
+ URLHostname: cloudflare.F("example.com"),
+ }),
+ IP: cloudflare.F("10.0.0.1"),
+ Redirect: cloudflare.F(rules.ListItemNewParamsBodyRedirect{
+ IncludeSubdomains: cloudflare.F(true),
+ PreservePathSuffix: cloudflare.F(true),
+ PreserveQueryString: cloudflare.F(true),
+ SourceURL: cloudflare.F("example.com/arch"),
+ StatusCode: cloudflare.F(rules.ListItemNewParamsBodyRedirectStatusCode301),
+ SubpathMatching: cloudflare.F(true),
+ TargetURL: cloudflare.F("https://archlinux.org/"),
+ }),
+ }}),
+ },
+ )
+ 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())
+ }
+}
+
+func TestListItemUpdate(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"),
+ )
+ _, err := client.Rules.Lists.Items.Update(
+ context.TODO(),
+ "2c0fc9fa937b11eaa1b71c4d701ab86e",
+ rules.ListItemUpdateParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Body: cloudflare.F([]rules.ListItemUpdateParamsBody{{
+ ASN: cloudflare.F(int64(5567)),
+ Comment: cloudflare.F("Private IP address"),
+ Hostname: cloudflare.F(rules.ListItemUpdateParamsBodyHostname{
+ URLHostname: cloudflare.F("example.com"),
+ }),
+ IP: cloudflare.F("10.0.0.1"),
+ Redirect: cloudflare.F(rules.ListItemUpdateParamsBodyRedirect{
+ IncludeSubdomains: cloudflare.F(true),
+ PreservePathSuffix: cloudflare.F(true),
+ PreserveQueryString: cloudflare.F(true),
+ SourceURL: cloudflare.F("example.com/arch"),
+ StatusCode: cloudflare.F(rules.ListItemUpdateParamsBodyRedirectStatusCode301),
+ SubpathMatching: cloudflare.F(true),
+ TargetURL: cloudflare.F("https://archlinux.org/"),
+ }),
+ }, {
+ ASN: cloudflare.F(int64(5567)),
+ Comment: cloudflare.F("Private IP address"),
+ Hostname: cloudflare.F(rules.ListItemUpdateParamsBodyHostname{
+ URLHostname: cloudflare.F("example.com"),
+ }),
+ IP: cloudflare.F("10.0.0.1"),
+ Redirect: cloudflare.F(rules.ListItemUpdateParamsBodyRedirect{
+ IncludeSubdomains: cloudflare.F(true),
+ PreservePathSuffix: cloudflare.F(true),
+ PreserveQueryString: cloudflare.F(true),
+ SourceURL: cloudflare.F("example.com/arch"),
+ StatusCode: cloudflare.F(rules.ListItemUpdateParamsBodyRedirectStatusCode301),
+ SubpathMatching: cloudflare.F(true),
+ TargetURL: cloudflare.F("https://archlinux.org/"),
+ }),
+ }, {
+ ASN: cloudflare.F(int64(5567)),
+ Comment: cloudflare.F("Private IP address"),
+ Hostname: cloudflare.F(rules.ListItemUpdateParamsBodyHostname{
+ URLHostname: cloudflare.F("example.com"),
+ }),
+ IP: cloudflare.F("10.0.0.1"),
+ Redirect: cloudflare.F(rules.ListItemUpdateParamsBodyRedirect{
+ IncludeSubdomains: cloudflare.F(true),
+ PreservePathSuffix: cloudflare.F(true),
+ PreserveQueryString: cloudflare.F(true),
+ SourceURL: cloudflare.F("example.com/arch"),
+ StatusCode: cloudflare.F(rules.ListItemUpdateParamsBodyRedirectStatusCode301),
+ SubpathMatching: cloudflare.F(true),
+ TargetURL: cloudflare.F("https://archlinux.org/"),
+ }),
+ }}),
+ },
+ )
+ 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())
+ }
+}
+
+func TestListItemListWithOptionalParams(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"),
+ )
+ _, err := client.Rules.Lists.Items.List(
+ context.TODO(),
+ "2c0fc9fa937b11eaa1b71c4d701ab86e",
+ rules.ListItemListParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Cursor: cloudflare.F("zzz"),
+ PerPage: cloudflare.F(int64(1)),
+ Search: cloudflare.F("1.1.1."),
+ },
+ )
+ 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())
+ }
+}
+
+func TestListItemDeleteWithOptionalParams(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"),
+ )
+ _, err := client.Rules.Lists.Items.Delete(
+ context.TODO(),
+ "2c0fc9fa937b11eaa1b71c4d701ab86e",
+ rules.ListItemDeleteParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Items: cloudflare.F([]rules.ListItemDeleteParamsItem{{
+ ID: cloudflare.F("34b12448945f11eaa1b71c4d701ab86e"),
+ }}),
+ },
+ )
+ 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())
+ }
+}
+
+func TestListItemGet(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"),
+ )
+ _, err := client.Rules.Lists.Items.Get(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ "2c0fc9fa937b11eaa1b71c4d701ab86e",
+ "34b12448945f11eaa1b71c4d701ab86e",
+ )
+ 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/rules/rule.go b/rules/rule.go
new file mode 100644
index 00000000000..42b21d23589
--- /dev/null
+++ b/rules/rule.go
@@ -0,0 +1,26 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package rules
+
+import (
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// RuleService contains methods and other services that help with interacting with
+// the cloudflare API. Note, unlike clients, this service does not read variables
+// from the environment automatically. You should not instantiate this service
+// directly, and instead use the [NewRuleService] method instead.
+type RuleService struct {
+ Options []option.RequestOption
+ Lists *ListService
+}
+
+// NewRuleService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewRuleService(opts ...option.RequestOption) (r *RuleService) {
+ r = &RuleService{}
+ r.Options = opts
+ r.Lists = NewListService(opts...)
+ return
+}
diff --git a/ruleset.go b/ruleset.go
deleted file mode 100644
index 28067313dfe..00000000000
--- a/ruleset.go
+++ /dev/null
@@ -1,4082 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "reflect"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
- "github.com/tidwall/gjson"
-)
-
-// RulesetService contains methods and other services that help with interacting
-// with the cloudflare API. Note, unlike clients, this service does not read
-// variables from the environment automatically. You should not instantiate this
-// service directly, and instead use the [NewRulesetService] method instead.
-type RulesetService struct {
- Options []option.RequestOption
- Phases *RulesetPhaseService
- Rules *RulesetRuleService
- Versions *RulesetVersionService
-}
-
-// NewRulesetService generates a new service that applies the given options to each
-// request. These options are applied after the parent client's options (if there
-// is one), and before any request-specific options.
-func NewRulesetService(opts ...option.RequestOption) (r *RulesetService) {
- r = &RulesetService{}
- r.Options = opts
- r.Phases = NewRulesetPhaseService(opts...)
- r.Rules = NewRulesetRuleService(opts...)
- r.Versions = NewRulesetVersionService(opts...)
- return
-}
-
-// Creates a ruleset.
-func (r *RulesetService) New(ctx context.Context, params RulesetNewParams, opts ...option.RequestOption) (res *RulesetNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RulesetNewResponseEnvelope
- var accountOrZone string
- var accountOrZoneID param.Field[string]
- if params.AccountID.Present {
- accountOrZone = "accounts"
- accountOrZoneID = params.AccountID
- } else {
- accountOrZone = "zones"
- accountOrZoneID = params.ZoneID
- }
- path := fmt.Sprintf("%s/%s/rulesets", accountOrZone, accountOrZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Updates an account or zone ruleset, creating a new version.
-func (r *RulesetService) Update(ctx context.Context, rulesetID string, params RulesetUpdateParams, opts ...option.RequestOption) (res *RulesetUpdateResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RulesetUpdateResponseEnvelope
- var accountOrZone string
- var accountOrZoneID param.Field[string]
- if params.AccountID.Present {
- accountOrZone = "accounts"
- accountOrZoneID = params.AccountID
- } else {
- accountOrZone = "zones"
- accountOrZoneID = params.ZoneID
- }
- path := fmt.Sprintf("%s/%s/rulesets/%s", accountOrZone, accountOrZoneID, rulesetID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Fetches all rulesets.
-func (r *RulesetService) List(ctx context.Context, query RulesetListParams, opts ...option.RequestOption) (res *[]RulesetListResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RulesetListResponseEnvelope
- var accountOrZone string
- var accountOrZoneID param.Field[string]
- if query.AccountID.Present {
- accountOrZone = "accounts"
- accountOrZoneID = query.AccountID
- } else {
- accountOrZone = "zones"
- accountOrZoneID = query.ZoneID
- }
- path := fmt.Sprintf("%s/%s/rulesets", accountOrZone, accountOrZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Deletes all versions of an existing account or zone ruleset.
-func (r *RulesetService) Delete(ctx context.Context, rulesetID string, body RulesetDeleteParams, opts ...option.RequestOption) (err error) {
- opts = append(r.Options[:], opts...)
- opts = append([]option.RequestOption{option.WithHeader("Accept", "")}, opts...)
- var accountOrZone string
- var accountOrZoneID param.Field[string]
- if body.AccountID.Present {
- accountOrZone = "accounts"
- accountOrZoneID = body.AccountID
- } else {
- accountOrZone = "zones"
- accountOrZoneID = body.ZoneID
- }
- path := fmt.Sprintf("%s/%s/rulesets/%s", accountOrZone, accountOrZoneID, rulesetID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, nil, opts...)
- return
-}
-
-// Fetches the latest version of an account or zone ruleset.
-func (r *RulesetService) Get(ctx context.Context, rulesetID string, query RulesetGetParams, opts ...option.RequestOption) (res *RulesetGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RulesetGetResponseEnvelope
- var accountOrZone string
- var accountOrZoneID param.Field[string]
- if query.AccountID.Present {
- accountOrZone = "accounts"
- accountOrZoneID = query.AccountID
- } else {
- accountOrZone = "zones"
- accountOrZoneID = query.ZoneID
- }
- path := fmt.Sprintf("%s/%s/rulesets/%s", accountOrZone, accountOrZoneID, rulesetID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// A result.
-type RulesetNewResponse struct {
- // The unique ID of the ruleset.
- ID string `json:"id,required"`
- // The kind of the ruleset.
- Kind RulesetNewResponseKind `json:"kind,required"`
- // The timestamp of when the ruleset was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The human-readable name of the ruleset.
- Name string `json:"name,required"`
- // The phase of the ruleset.
- Phase RulesetNewResponsePhase `json:"phase,required"`
- // The list of rules in the ruleset.
- Rules []RulesetNewResponseRule `json:"rules,required"`
- // The version of the ruleset.
- Version string `json:"version,required"`
- // An informative description of the ruleset.
- Description string `json:"description"`
- JSON rulesetNewResponseJSON `json:"-"`
-}
-
-// rulesetNewResponseJSON contains the JSON metadata for the struct
-// [RulesetNewResponse]
-type rulesetNewResponseJSON struct {
- ID apijson.Field
- Kind apijson.Field
- LastUpdated apijson.Field
- Name apijson.Field
- Phase apijson.Field
- Rules apijson.Field
- Version apijson.Field
- Description apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetNewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetNewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// The kind of the ruleset.
-type RulesetNewResponseKind string
-
-const (
- RulesetNewResponseKindManaged RulesetNewResponseKind = "managed"
- RulesetNewResponseKindCustom RulesetNewResponseKind = "custom"
- RulesetNewResponseKindRoot RulesetNewResponseKind = "root"
- RulesetNewResponseKindZone RulesetNewResponseKind = "zone"
-)
-
-// The phase of the ruleset.
-type RulesetNewResponsePhase string
-
-const (
- RulesetNewResponsePhaseDDOSL4 RulesetNewResponsePhase = "ddos_l4"
- RulesetNewResponsePhaseDDOSL7 RulesetNewResponsePhase = "ddos_l7"
- RulesetNewResponsePhaseHTTPConfigSettings RulesetNewResponsePhase = "http_config_settings"
- RulesetNewResponsePhaseHTTPCustomErrors RulesetNewResponsePhase = "http_custom_errors"
- RulesetNewResponsePhaseHTTPLogCustomFields RulesetNewResponsePhase = "http_log_custom_fields"
- RulesetNewResponsePhaseHTTPRatelimit RulesetNewResponsePhase = "http_ratelimit"
- RulesetNewResponsePhaseHTTPRequestCacheSettings RulesetNewResponsePhase = "http_request_cache_settings"
- RulesetNewResponsePhaseHTTPRequestDynamicRedirect RulesetNewResponsePhase = "http_request_dynamic_redirect"
- RulesetNewResponsePhaseHTTPRequestFirewallCustom RulesetNewResponsePhase = "http_request_firewall_custom"
- RulesetNewResponsePhaseHTTPRequestFirewallManaged RulesetNewResponsePhase = "http_request_firewall_managed"
- RulesetNewResponsePhaseHTTPRequestLateTransform RulesetNewResponsePhase = "http_request_late_transform"
- RulesetNewResponsePhaseHTTPRequestOrigin RulesetNewResponsePhase = "http_request_origin"
- RulesetNewResponsePhaseHTTPRequestRedirect RulesetNewResponsePhase = "http_request_redirect"
- RulesetNewResponsePhaseHTTPRequestSanitize RulesetNewResponsePhase = "http_request_sanitize"
- RulesetNewResponsePhaseHTTPRequestSbfm RulesetNewResponsePhase = "http_request_sbfm"
- RulesetNewResponsePhaseHTTPRequestSelectConfiguration RulesetNewResponsePhase = "http_request_select_configuration"
- RulesetNewResponsePhaseHTTPRequestTransform RulesetNewResponsePhase = "http_request_transform"
- RulesetNewResponsePhaseHTTPResponseCompression RulesetNewResponsePhase = "http_response_compression"
- RulesetNewResponsePhaseHTTPResponseFirewallManaged RulesetNewResponsePhase = "http_response_firewall_managed"
- RulesetNewResponsePhaseHTTPResponseHeadersTransform RulesetNewResponsePhase = "http_response_headers_transform"
- RulesetNewResponsePhaseMagicTransit RulesetNewResponsePhase = "magic_transit"
- RulesetNewResponsePhaseMagicTransitIDsManaged RulesetNewResponsePhase = "magic_transit_ids_managed"
- RulesetNewResponsePhaseMagicTransitManaged RulesetNewResponsePhase = "magic_transit_managed"
-)
-
-// Union satisfied by [RulesetNewResponseRulesRulesetsBlockRule],
-// [RulesetNewResponseRulesRulesetsExecuteRule],
-// [RulesetNewResponseRulesRulesetsLogRule] or
-// [RulesetNewResponseRulesRulesetsSkipRule].
-type RulesetNewResponseRule interface {
- implementsRulesetNewResponseRule()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*RulesetNewResponseRule)(nil)).Elem(),
- "action",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(RulesetNewResponseRulesRulesetsBlockRule{}),
- DiscriminatorValue: "block",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(RulesetNewResponseRulesRulesetsExecuteRule{}),
- DiscriminatorValue: "execute",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(RulesetNewResponseRulesRulesetsLogRule{}),
- DiscriminatorValue: "log",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(RulesetNewResponseRulesRulesetsSkipRule{}),
- DiscriminatorValue: "skip",
- },
- )
-}
-
-type RulesetNewResponseRulesRulesetsBlockRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action RulesetNewResponseRulesRulesetsBlockRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters RulesetNewResponseRulesRulesetsBlockRuleActionParameters `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging RulesetNewResponseRulesRulesetsBlockRuleLogging `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON rulesetNewResponseRulesRulesetsBlockRuleJSON `json:"-"`
-}
-
-// rulesetNewResponseRulesRulesetsBlockRuleJSON contains the JSON metadata for the
-// struct [RulesetNewResponseRulesRulesetsBlockRule]
-type rulesetNewResponseRulesRulesetsBlockRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetNewResponseRulesRulesetsBlockRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetNewResponseRulesRulesetsBlockRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r RulesetNewResponseRulesRulesetsBlockRule) implementsRulesetNewResponseRule() {}
-
-// The action to perform when the rule matches.
-type RulesetNewResponseRulesRulesetsBlockRuleAction string
-
-const (
- RulesetNewResponseRulesRulesetsBlockRuleActionBlock RulesetNewResponseRulesRulesetsBlockRuleAction = "block"
-)
-
-// The parameters configuring the rule's action.
-type RulesetNewResponseRulesRulesetsBlockRuleActionParameters struct {
- // The response to show when the block is applied.
- Response RulesetNewResponseRulesRulesetsBlockRuleActionParametersResponse `json:"response"`
- JSON rulesetNewResponseRulesRulesetsBlockRuleActionParametersJSON `json:"-"`
-}
-
-// rulesetNewResponseRulesRulesetsBlockRuleActionParametersJSON contains the JSON
-// metadata for the struct
-// [RulesetNewResponseRulesRulesetsBlockRuleActionParameters]
-type rulesetNewResponseRulesRulesetsBlockRuleActionParametersJSON struct {
- Response apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetNewResponseRulesRulesetsBlockRuleActionParameters) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetNewResponseRulesRulesetsBlockRuleActionParametersJSON) RawJSON() string {
- return r.raw
-}
-
-// The response to show when the block is applied.
-type RulesetNewResponseRulesRulesetsBlockRuleActionParametersResponse struct {
- // The content to return.
- Content string `json:"content,required"`
- // The type of the content to return.
- ContentType string `json:"content_type,required"`
- // The status code to return.
- StatusCode int64 `json:"status_code,required"`
- JSON rulesetNewResponseRulesRulesetsBlockRuleActionParametersResponseJSON `json:"-"`
-}
-
-// rulesetNewResponseRulesRulesetsBlockRuleActionParametersResponseJSON contains
-// the JSON metadata for the struct
-// [RulesetNewResponseRulesRulesetsBlockRuleActionParametersResponse]
-type rulesetNewResponseRulesRulesetsBlockRuleActionParametersResponseJSON struct {
- Content apijson.Field
- ContentType apijson.Field
- StatusCode apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetNewResponseRulesRulesetsBlockRuleActionParametersResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetNewResponseRulesRulesetsBlockRuleActionParametersResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// An object configuring the rule's logging behavior.
-type RulesetNewResponseRulesRulesetsBlockRuleLogging struct {
- // Whether to generate a log when the rule matches.
- Enabled bool `json:"enabled,required"`
- JSON rulesetNewResponseRulesRulesetsBlockRuleLoggingJSON `json:"-"`
-}
-
-// rulesetNewResponseRulesRulesetsBlockRuleLoggingJSON contains the JSON metadata
-// for the struct [RulesetNewResponseRulesRulesetsBlockRuleLogging]
-type rulesetNewResponseRulesRulesetsBlockRuleLoggingJSON struct {
- Enabled apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetNewResponseRulesRulesetsBlockRuleLogging) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetNewResponseRulesRulesetsBlockRuleLoggingJSON) RawJSON() string {
- return r.raw
-}
-
-type RulesetNewResponseRulesRulesetsExecuteRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action RulesetNewResponseRulesRulesetsExecuteRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters RulesetNewResponseRulesRulesetsExecuteRuleActionParameters `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging RulesetNewResponseRulesRulesetsExecuteRuleLogging `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON rulesetNewResponseRulesRulesetsExecuteRuleJSON `json:"-"`
-}
-
-// rulesetNewResponseRulesRulesetsExecuteRuleJSON contains the JSON metadata for
-// the struct [RulesetNewResponseRulesRulesetsExecuteRule]
-type rulesetNewResponseRulesRulesetsExecuteRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetNewResponseRulesRulesetsExecuteRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetNewResponseRulesRulesetsExecuteRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r RulesetNewResponseRulesRulesetsExecuteRule) implementsRulesetNewResponseRule() {}
-
-// The action to perform when the rule matches.
-type RulesetNewResponseRulesRulesetsExecuteRuleAction string
-
-const (
- RulesetNewResponseRulesRulesetsExecuteRuleActionExecute RulesetNewResponseRulesRulesetsExecuteRuleAction = "execute"
-)
-
-// The parameters configuring the rule's action.
-type RulesetNewResponseRulesRulesetsExecuteRuleActionParameters struct {
- // The ID of the ruleset to execute.
- ID string `json:"id,required"`
- // The configuration to use for matched data logging.
- MatchedData RulesetNewResponseRulesRulesetsExecuteRuleActionParametersMatchedData `json:"matched_data"`
- // A set of overrides to apply to the target ruleset.
- Overrides RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverrides `json:"overrides"`
- JSON rulesetNewResponseRulesRulesetsExecuteRuleActionParametersJSON `json:"-"`
-}
-
-// rulesetNewResponseRulesRulesetsExecuteRuleActionParametersJSON contains the JSON
-// metadata for the struct
-// [RulesetNewResponseRulesRulesetsExecuteRuleActionParameters]
-type rulesetNewResponseRulesRulesetsExecuteRuleActionParametersJSON struct {
- ID apijson.Field
- MatchedData apijson.Field
- Overrides apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetNewResponseRulesRulesetsExecuteRuleActionParameters) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetNewResponseRulesRulesetsExecuteRuleActionParametersJSON) RawJSON() string {
- return r.raw
-}
-
-// The configuration to use for matched data logging.
-type RulesetNewResponseRulesRulesetsExecuteRuleActionParametersMatchedData struct {
- // The public key to encrypt matched data logs with.
- PublicKey string `json:"public_key,required"`
- JSON rulesetNewResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON `json:"-"`
-}
-
-// rulesetNewResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON
-// contains the JSON metadata for the struct
-// [RulesetNewResponseRulesRulesetsExecuteRuleActionParametersMatchedData]
-type rulesetNewResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON struct {
- PublicKey apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetNewResponseRulesRulesetsExecuteRuleActionParametersMatchedData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetNewResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON) RawJSON() string {
- return r.raw
-}
-
-// A set of overrides to apply to the target ruleset.
-type RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverrides struct {
- // An action to override all rules with. This option has lower precedence than rule
- // and category overrides.
- Action string `json:"action"`
- // A list of category-level overrides. This option has the second-highest
- // precedence after rule-level overrides.
- Categories []RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory `json:"categories"`
- // Whether to enable execution of all rules. This option has lower precedence than
- // rule and category overrides.
- Enabled bool `json:"enabled"`
- // A list of rule-level overrides. This option has the highest precedence.
- Rules []RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRule `json:"rules"`
- // A sensitivity level to set for all rules. This option has lower precedence than
- // rule and category overrides and is only applicable for DDoS phases.
- SensitivityLevel RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel `json:"sensitivity_level"`
- JSON rulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON `json:"-"`
-}
-
-// rulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON contains
-// the JSON metadata for the struct
-// [RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverrides]
-type rulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON struct {
- Action apijson.Field
- Categories apijson.Field
- Enabled apijson.Field
- Rules apijson.Field
- SensitivityLevel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverrides) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON) RawJSON() string {
- return r.raw
-}
-
-// A category-level override
-type RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory struct {
- // The name of the category to override.
- Category string `json:"category,required"`
- // The action to override rules in the category with.
- Action string `json:"action"`
- // Whether to enable execution of rules in the category.
- Enabled bool `json:"enabled"`
- // The sensitivity level to use for rules in the category.
- SensitivityLevel RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel `json:"sensitivity_level"`
- JSON rulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON `json:"-"`
-}
-
-// rulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON
-// contains the JSON metadata for the struct
-// [RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory]
-type rulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON struct {
- Category apijson.Field
- Action apijson.Field
- Enabled apijson.Field
- SensitivityLevel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON) RawJSON() string {
- return r.raw
-}
-
-// The sensitivity level to use for rules in the category.
-type RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel string
-
-const (
- RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "default"
- RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "medium"
- RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "low"
- RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "eoff"
-)
-
-// A rule-level override
-type RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRule struct {
- // The ID of the rule to override.
- ID string `json:"id,required"`
- // The action to override the rule with.
- Action string `json:"action"`
- // Whether to enable execution of the rule.
- Enabled bool `json:"enabled"`
- // The score threshold to use for the rule.
- ScoreThreshold int64 `json:"score_threshold"`
- // The sensitivity level to use for the rule.
- SensitivityLevel RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel `json:"sensitivity_level"`
- JSON rulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON `json:"-"`
-}
-
-// rulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON
-// contains the JSON metadata for the struct
-// [RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRule]
-type rulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON struct {
- ID apijson.Field
- Action apijson.Field
- Enabled apijson.Field
- ScoreThreshold apijson.Field
- SensitivityLevel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON) RawJSON() string {
- return r.raw
-}
-
-// The sensitivity level to use for the rule.
-type RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel string
-
-const (
- RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "default"
- RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "medium"
- RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelLow RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "low"
- RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "eoff"
-)
-
-// A sensitivity level to set for all rules. This option has lower precedence than
-// rule and category overrides and is only applicable for DDoS phases.
-type RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel string
-
-const (
- RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelDefault RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "default"
- RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelMedium RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "medium"
- RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelLow RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "low"
- RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelEoff RulesetNewResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "eoff"
-)
-
-// An object configuring the rule's logging behavior.
-type RulesetNewResponseRulesRulesetsExecuteRuleLogging struct {
- // Whether to generate a log when the rule matches.
- Enabled bool `json:"enabled,required"`
- JSON rulesetNewResponseRulesRulesetsExecuteRuleLoggingJSON `json:"-"`
-}
-
-// rulesetNewResponseRulesRulesetsExecuteRuleLoggingJSON contains the JSON metadata
-// for the struct [RulesetNewResponseRulesRulesetsExecuteRuleLogging]
-type rulesetNewResponseRulesRulesetsExecuteRuleLoggingJSON struct {
- Enabled apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetNewResponseRulesRulesetsExecuteRuleLogging) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetNewResponseRulesRulesetsExecuteRuleLoggingJSON) RawJSON() string {
- return r.raw
-}
-
-type RulesetNewResponseRulesRulesetsLogRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action RulesetNewResponseRulesRulesetsLogRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters interface{} `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging RulesetNewResponseRulesRulesetsLogRuleLogging `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON rulesetNewResponseRulesRulesetsLogRuleJSON `json:"-"`
-}
-
-// rulesetNewResponseRulesRulesetsLogRuleJSON contains the JSON metadata for the
-// struct [RulesetNewResponseRulesRulesetsLogRule]
-type rulesetNewResponseRulesRulesetsLogRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetNewResponseRulesRulesetsLogRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetNewResponseRulesRulesetsLogRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r RulesetNewResponseRulesRulesetsLogRule) implementsRulesetNewResponseRule() {}
-
-// The action to perform when the rule matches.
-type RulesetNewResponseRulesRulesetsLogRuleAction string
-
-const (
- RulesetNewResponseRulesRulesetsLogRuleActionLog RulesetNewResponseRulesRulesetsLogRuleAction = "log"
-)
-
-// An object configuring the rule's logging behavior.
-type RulesetNewResponseRulesRulesetsLogRuleLogging struct {
- // Whether to generate a log when the rule matches.
- Enabled bool `json:"enabled,required"`
- JSON rulesetNewResponseRulesRulesetsLogRuleLoggingJSON `json:"-"`
-}
-
-// rulesetNewResponseRulesRulesetsLogRuleLoggingJSON contains the JSON metadata for
-// the struct [RulesetNewResponseRulesRulesetsLogRuleLogging]
-type rulesetNewResponseRulesRulesetsLogRuleLoggingJSON struct {
- Enabled apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetNewResponseRulesRulesetsLogRuleLogging) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetNewResponseRulesRulesetsLogRuleLoggingJSON) RawJSON() string {
- return r.raw
-}
-
-type RulesetNewResponseRulesRulesetsSkipRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action RulesetNewResponseRulesRulesetsSkipRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters RulesetNewResponseRulesRulesetsSkipRuleActionParameters `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging RulesetNewResponseRulesRulesetsSkipRuleLogging `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON rulesetNewResponseRulesRulesetsSkipRuleJSON `json:"-"`
-}
-
-// rulesetNewResponseRulesRulesetsSkipRuleJSON contains the JSON metadata for the
-// struct [RulesetNewResponseRulesRulesetsSkipRule]
-type rulesetNewResponseRulesRulesetsSkipRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetNewResponseRulesRulesetsSkipRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetNewResponseRulesRulesetsSkipRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r RulesetNewResponseRulesRulesetsSkipRule) implementsRulesetNewResponseRule() {}
-
-// The action to perform when the rule matches.
-type RulesetNewResponseRulesRulesetsSkipRuleAction string
-
-const (
- RulesetNewResponseRulesRulesetsSkipRuleActionSkip RulesetNewResponseRulesRulesetsSkipRuleAction = "skip"
-)
-
-// The parameters configuring the rule's action.
-type RulesetNewResponseRulesRulesetsSkipRuleActionParameters struct {
- // A list of phases to skip the execution of. This option is incompatible with the
- // ruleset and rulesets options.
- Phases []RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhase `json:"phases"`
- // A list of legacy security products to skip the execution of.
- Products []RulesetNewResponseRulesRulesetsSkipRuleActionParametersProduct `json:"products"`
- // A mapping of ruleset IDs to a list of rule IDs in that ruleset to skip the
- // execution of. This option is incompatible with the ruleset option.
- Rules map[string][]string `json:"rules"`
- // A ruleset to skip the execution of. This option is incompatible with the
- // rulesets, rules and phases options.
- Ruleset RulesetNewResponseRulesRulesetsSkipRuleActionParametersRuleset `json:"ruleset"`
- // A list of ruleset IDs to skip the execution of. This option is incompatible with
- // the ruleset and phases options.
- Rulesets []string `json:"rulesets"`
- JSON rulesetNewResponseRulesRulesetsSkipRuleActionParametersJSON `json:"-"`
-}
-
-// rulesetNewResponseRulesRulesetsSkipRuleActionParametersJSON contains the JSON
-// metadata for the struct
-// [RulesetNewResponseRulesRulesetsSkipRuleActionParameters]
-type rulesetNewResponseRulesRulesetsSkipRuleActionParametersJSON struct {
- Phases apijson.Field
- Products apijson.Field
- Rules apijson.Field
- Ruleset apijson.Field
- Rulesets apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetNewResponseRulesRulesetsSkipRuleActionParameters) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetNewResponseRulesRulesetsSkipRuleActionParametersJSON) RawJSON() string {
- return r.raw
-}
-
-// A phase to skip the execution of.
-type RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhase string
-
-const (
- RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhaseDDOSL4 RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhase = "ddos_l4"
- RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhaseDDOSL7 RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhase = "ddos_l7"
- RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPConfigSettings RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_config_settings"
- RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPCustomErrors RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_custom_errors"
- RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPLogCustomFields RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_log_custom_fields"
- RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRatelimit RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_ratelimit"
- RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestCacheSettings RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_cache_settings"
- RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestDynamicRedirect RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_dynamic_redirect"
- RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallCustom RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_custom"
- RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallManaged RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_managed"
- RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestLateTransform RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_late_transform"
- RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestOrigin RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_origin"
- RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestRedirect RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_redirect"
- RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSanitize RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_sanitize"
- RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSbfm RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_sbfm"
- RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSelectConfiguration RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_select_configuration"
- RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestTransform RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_transform"
- RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseCompression RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_compression"
- RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseFirewallManaged RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_firewall_managed"
- RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseHeadersTransform RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_headers_transform"
- RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransit RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit"
- RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitIDsManaged RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_ids_managed"
- RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitManaged RulesetNewResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_managed"
-)
-
-// The name of a legacy security product to skip the execution of.
-type RulesetNewResponseRulesRulesetsSkipRuleActionParametersProduct string
-
-const (
- RulesetNewResponseRulesRulesetsSkipRuleActionParametersProductBic RulesetNewResponseRulesRulesetsSkipRuleActionParametersProduct = "bic"
- RulesetNewResponseRulesRulesetsSkipRuleActionParametersProductHot RulesetNewResponseRulesRulesetsSkipRuleActionParametersProduct = "hot"
- RulesetNewResponseRulesRulesetsSkipRuleActionParametersProductRateLimit RulesetNewResponseRulesRulesetsSkipRuleActionParametersProduct = "rateLimit"
- RulesetNewResponseRulesRulesetsSkipRuleActionParametersProductSecurityLevel RulesetNewResponseRulesRulesetsSkipRuleActionParametersProduct = "securityLevel"
- RulesetNewResponseRulesRulesetsSkipRuleActionParametersProductUABlock RulesetNewResponseRulesRulesetsSkipRuleActionParametersProduct = "uaBlock"
- RulesetNewResponseRulesRulesetsSkipRuleActionParametersProductWAF RulesetNewResponseRulesRulesetsSkipRuleActionParametersProduct = "waf"
- RulesetNewResponseRulesRulesetsSkipRuleActionParametersProductZoneLockdown RulesetNewResponseRulesRulesetsSkipRuleActionParametersProduct = "zoneLockdown"
-)
-
-// A ruleset to skip the execution of. This option is incompatible with the
-// rulesets, rules and phases options.
-type RulesetNewResponseRulesRulesetsSkipRuleActionParametersRuleset string
-
-const (
- RulesetNewResponseRulesRulesetsSkipRuleActionParametersRulesetCurrent RulesetNewResponseRulesRulesetsSkipRuleActionParametersRuleset = "current"
-)
-
-// An object configuring the rule's logging behavior.
-type RulesetNewResponseRulesRulesetsSkipRuleLogging struct {
- // Whether to generate a log when the rule matches.
- Enabled bool `json:"enabled,required"`
- JSON rulesetNewResponseRulesRulesetsSkipRuleLoggingJSON `json:"-"`
-}
-
-// rulesetNewResponseRulesRulesetsSkipRuleLoggingJSON contains the JSON metadata
-// for the struct [RulesetNewResponseRulesRulesetsSkipRuleLogging]
-type rulesetNewResponseRulesRulesetsSkipRuleLoggingJSON struct {
- Enabled apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetNewResponseRulesRulesetsSkipRuleLogging) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetNewResponseRulesRulesetsSkipRuleLoggingJSON) RawJSON() string {
- return r.raw
-}
-
-// A result.
-type RulesetUpdateResponse struct {
- // The unique ID of the ruleset.
- ID string `json:"id,required"`
- // The kind of the ruleset.
- Kind RulesetUpdateResponseKind `json:"kind,required"`
- // The timestamp of when the ruleset was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The human-readable name of the ruleset.
- Name string `json:"name,required"`
- // The phase of the ruleset.
- Phase RulesetUpdateResponsePhase `json:"phase,required"`
- // The list of rules in the ruleset.
- Rules []RulesetUpdateResponseRule `json:"rules,required"`
- // The version of the ruleset.
- Version string `json:"version,required"`
- // An informative description of the ruleset.
- Description string `json:"description"`
- JSON rulesetUpdateResponseJSON `json:"-"`
-}
-
-// rulesetUpdateResponseJSON contains the JSON metadata for the struct
-// [RulesetUpdateResponse]
-type rulesetUpdateResponseJSON struct {
- ID apijson.Field
- Kind apijson.Field
- LastUpdated apijson.Field
- Name apijson.Field
- Phase apijson.Field
- Rules apijson.Field
- Version apijson.Field
- Description apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetUpdateResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetUpdateResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// The kind of the ruleset.
-type RulesetUpdateResponseKind string
-
-const (
- RulesetUpdateResponseKindManaged RulesetUpdateResponseKind = "managed"
- RulesetUpdateResponseKindCustom RulesetUpdateResponseKind = "custom"
- RulesetUpdateResponseKindRoot RulesetUpdateResponseKind = "root"
- RulesetUpdateResponseKindZone RulesetUpdateResponseKind = "zone"
-)
-
-// The phase of the ruleset.
-type RulesetUpdateResponsePhase string
-
-const (
- RulesetUpdateResponsePhaseDDOSL4 RulesetUpdateResponsePhase = "ddos_l4"
- RulesetUpdateResponsePhaseDDOSL7 RulesetUpdateResponsePhase = "ddos_l7"
- RulesetUpdateResponsePhaseHTTPConfigSettings RulesetUpdateResponsePhase = "http_config_settings"
- RulesetUpdateResponsePhaseHTTPCustomErrors RulesetUpdateResponsePhase = "http_custom_errors"
- RulesetUpdateResponsePhaseHTTPLogCustomFields RulesetUpdateResponsePhase = "http_log_custom_fields"
- RulesetUpdateResponsePhaseHTTPRatelimit RulesetUpdateResponsePhase = "http_ratelimit"
- RulesetUpdateResponsePhaseHTTPRequestCacheSettings RulesetUpdateResponsePhase = "http_request_cache_settings"
- RulesetUpdateResponsePhaseHTTPRequestDynamicRedirect RulesetUpdateResponsePhase = "http_request_dynamic_redirect"
- RulesetUpdateResponsePhaseHTTPRequestFirewallCustom RulesetUpdateResponsePhase = "http_request_firewall_custom"
- RulesetUpdateResponsePhaseHTTPRequestFirewallManaged RulesetUpdateResponsePhase = "http_request_firewall_managed"
- RulesetUpdateResponsePhaseHTTPRequestLateTransform RulesetUpdateResponsePhase = "http_request_late_transform"
- RulesetUpdateResponsePhaseHTTPRequestOrigin RulesetUpdateResponsePhase = "http_request_origin"
- RulesetUpdateResponsePhaseHTTPRequestRedirect RulesetUpdateResponsePhase = "http_request_redirect"
- RulesetUpdateResponsePhaseHTTPRequestSanitize RulesetUpdateResponsePhase = "http_request_sanitize"
- RulesetUpdateResponsePhaseHTTPRequestSbfm RulesetUpdateResponsePhase = "http_request_sbfm"
- RulesetUpdateResponsePhaseHTTPRequestSelectConfiguration RulesetUpdateResponsePhase = "http_request_select_configuration"
- RulesetUpdateResponsePhaseHTTPRequestTransform RulesetUpdateResponsePhase = "http_request_transform"
- RulesetUpdateResponsePhaseHTTPResponseCompression RulesetUpdateResponsePhase = "http_response_compression"
- RulesetUpdateResponsePhaseHTTPResponseFirewallManaged RulesetUpdateResponsePhase = "http_response_firewall_managed"
- RulesetUpdateResponsePhaseHTTPResponseHeadersTransform RulesetUpdateResponsePhase = "http_response_headers_transform"
- RulesetUpdateResponsePhaseMagicTransit RulesetUpdateResponsePhase = "magic_transit"
- RulesetUpdateResponsePhaseMagicTransitIDsManaged RulesetUpdateResponsePhase = "magic_transit_ids_managed"
- RulesetUpdateResponsePhaseMagicTransitManaged RulesetUpdateResponsePhase = "magic_transit_managed"
-)
-
-// Union satisfied by [RulesetUpdateResponseRulesRulesetsBlockRule],
-// [RulesetUpdateResponseRulesRulesetsExecuteRule],
-// [RulesetUpdateResponseRulesRulesetsLogRule] or
-// [RulesetUpdateResponseRulesRulesetsSkipRule].
-type RulesetUpdateResponseRule interface {
- implementsRulesetUpdateResponseRule()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*RulesetUpdateResponseRule)(nil)).Elem(),
- "action",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(RulesetUpdateResponseRulesRulesetsBlockRule{}),
- DiscriminatorValue: "block",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(RulesetUpdateResponseRulesRulesetsExecuteRule{}),
- DiscriminatorValue: "execute",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(RulesetUpdateResponseRulesRulesetsLogRule{}),
- DiscriminatorValue: "log",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(RulesetUpdateResponseRulesRulesetsSkipRule{}),
- DiscriminatorValue: "skip",
- },
- )
-}
-
-type RulesetUpdateResponseRulesRulesetsBlockRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action RulesetUpdateResponseRulesRulesetsBlockRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters RulesetUpdateResponseRulesRulesetsBlockRuleActionParameters `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging RulesetUpdateResponseRulesRulesetsBlockRuleLogging `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON rulesetUpdateResponseRulesRulesetsBlockRuleJSON `json:"-"`
-}
-
-// rulesetUpdateResponseRulesRulesetsBlockRuleJSON contains the JSON metadata for
-// the struct [RulesetUpdateResponseRulesRulesetsBlockRule]
-type rulesetUpdateResponseRulesRulesetsBlockRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetUpdateResponseRulesRulesetsBlockRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetUpdateResponseRulesRulesetsBlockRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r RulesetUpdateResponseRulesRulesetsBlockRule) implementsRulesetUpdateResponseRule() {}
-
-// The action to perform when the rule matches.
-type RulesetUpdateResponseRulesRulesetsBlockRuleAction string
-
-const (
- RulesetUpdateResponseRulesRulesetsBlockRuleActionBlock RulesetUpdateResponseRulesRulesetsBlockRuleAction = "block"
-)
-
-// The parameters configuring the rule's action.
-type RulesetUpdateResponseRulesRulesetsBlockRuleActionParameters struct {
- // The response to show when the block is applied.
- Response RulesetUpdateResponseRulesRulesetsBlockRuleActionParametersResponse `json:"response"`
- JSON rulesetUpdateResponseRulesRulesetsBlockRuleActionParametersJSON `json:"-"`
-}
-
-// rulesetUpdateResponseRulesRulesetsBlockRuleActionParametersJSON contains the
-// JSON metadata for the struct
-// [RulesetUpdateResponseRulesRulesetsBlockRuleActionParameters]
-type rulesetUpdateResponseRulesRulesetsBlockRuleActionParametersJSON struct {
- Response apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetUpdateResponseRulesRulesetsBlockRuleActionParameters) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetUpdateResponseRulesRulesetsBlockRuleActionParametersJSON) RawJSON() string {
- return r.raw
-}
-
-// The response to show when the block is applied.
-type RulesetUpdateResponseRulesRulesetsBlockRuleActionParametersResponse struct {
- // The content to return.
- Content string `json:"content,required"`
- // The type of the content to return.
- ContentType string `json:"content_type,required"`
- // The status code to return.
- StatusCode int64 `json:"status_code,required"`
- JSON rulesetUpdateResponseRulesRulesetsBlockRuleActionParametersResponseJSON `json:"-"`
-}
-
-// rulesetUpdateResponseRulesRulesetsBlockRuleActionParametersResponseJSON contains
-// the JSON metadata for the struct
-// [RulesetUpdateResponseRulesRulesetsBlockRuleActionParametersResponse]
-type rulesetUpdateResponseRulesRulesetsBlockRuleActionParametersResponseJSON struct {
- Content apijson.Field
- ContentType apijson.Field
- StatusCode apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetUpdateResponseRulesRulesetsBlockRuleActionParametersResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetUpdateResponseRulesRulesetsBlockRuleActionParametersResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// An object configuring the rule's logging behavior.
-type RulesetUpdateResponseRulesRulesetsBlockRuleLogging struct {
- // Whether to generate a log when the rule matches.
- Enabled bool `json:"enabled,required"`
- JSON rulesetUpdateResponseRulesRulesetsBlockRuleLoggingJSON `json:"-"`
-}
-
-// rulesetUpdateResponseRulesRulesetsBlockRuleLoggingJSON contains the JSON
-// metadata for the struct [RulesetUpdateResponseRulesRulesetsBlockRuleLogging]
-type rulesetUpdateResponseRulesRulesetsBlockRuleLoggingJSON struct {
- Enabled apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetUpdateResponseRulesRulesetsBlockRuleLogging) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetUpdateResponseRulesRulesetsBlockRuleLoggingJSON) RawJSON() string {
- return r.raw
-}
-
-type RulesetUpdateResponseRulesRulesetsExecuteRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action RulesetUpdateResponseRulesRulesetsExecuteRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters RulesetUpdateResponseRulesRulesetsExecuteRuleActionParameters `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging RulesetUpdateResponseRulesRulesetsExecuteRuleLogging `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON rulesetUpdateResponseRulesRulesetsExecuteRuleJSON `json:"-"`
-}
-
-// rulesetUpdateResponseRulesRulesetsExecuteRuleJSON contains the JSON metadata for
-// the struct [RulesetUpdateResponseRulesRulesetsExecuteRule]
-type rulesetUpdateResponseRulesRulesetsExecuteRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetUpdateResponseRulesRulesetsExecuteRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetUpdateResponseRulesRulesetsExecuteRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r RulesetUpdateResponseRulesRulesetsExecuteRule) implementsRulesetUpdateResponseRule() {}
-
-// The action to perform when the rule matches.
-type RulesetUpdateResponseRulesRulesetsExecuteRuleAction string
-
-const (
- RulesetUpdateResponseRulesRulesetsExecuteRuleActionExecute RulesetUpdateResponseRulesRulesetsExecuteRuleAction = "execute"
-)
-
-// The parameters configuring the rule's action.
-type RulesetUpdateResponseRulesRulesetsExecuteRuleActionParameters struct {
- // The ID of the ruleset to execute.
- ID string `json:"id,required"`
- // The configuration to use for matched data logging.
- MatchedData RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersMatchedData `json:"matched_data"`
- // A set of overrides to apply to the target ruleset.
- Overrides RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverrides `json:"overrides"`
- JSON rulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersJSON `json:"-"`
-}
-
-// rulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersJSON contains the
-// JSON metadata for the struct
-// [RulesetUpdateResponseRulesRulesetsExecuteRuleActionParameters]
-type rulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersJSON struct {
- ID apijson.Field
- MatchedData apijson.Field
- Overrides apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetUpdateResponseRulesRulesetsExecuteRuleActionParameters) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersJSON) RawJSON() string {
- return r.raw
-}
-
-// The configuration to use for matched data logging.
-type RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersMatchedData struct {
- // The public key to encrypt matched data logs with.
- PublicKey string `json:"public_key,required"`
- JSON rulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON `json:"-"`
-}
-
-// rulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON
-// contains the JSON metadata for the struct
-// [RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersMatchedData]
-type rulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON struct {
- PublicKey apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersMatchedData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON) RawJSON() string {
- return r.raw
-}
-
-// A set of overrides to apply to the target ruleset.
-type RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverrides struct {
- // An action to override all rules with. This option has lower precedence than rule
- // and category overrides.
- Action string `json:"action"`
- // A list of category-level overrides. This option has the second-highest
- // precedence after rule-level overrides.
- Categories []RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory `json:"categories"`
- // Whether to enable execution of all rules. This option has lower precedence than
- // rule and category overrides.
- Enabled bool `json:"enabled"`
- // A list of rule-level overrides. This option has the highest precedence.
- Rules []RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRule `json:"rules"`
- // A sensitivity level to set for all rules. This option has lower precedence than
- // rule and category overrides and is only applicable for DDoS phases.
- SensitivityLevel RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel `json:"sensitivity_level"`
- JSON rulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON `json:"-"`
-}
-
-// rulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON
-// contains the JSON metadata for the struct
-// [RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverrides]
-type rulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON struct {
- Action apijson.Field
- Categories apijson.Field
- Enabled apijson.Field
- Rules apijson.Field
- SensitivityLevel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverrides) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON) RawJSON() string {
- return r.raw
-}
-
-// A category-level override
-type RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory struct {
- // The name of the category to override.
- Category string `json:"category,required"`
- // The action to override rules in the category with.
- Action string `json:"action"`
- // Whether to enable execution of rules in the category.
- Enabled bool `json:"enabled"`
- // The sensitivity level to use for rules in the category.
- SensitivityLevel RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel `json:"sensitivity_level"`
- JSON rulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON `json:"-"`
-}
-
-// rulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON
-// contains the JSON metadata for the struct
-// [RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory]
-type rulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON struct {
- Category apijson.Field
- Action apijson.Field
- Enabled apijson.Field
- SensitivityLevel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON) RawJSON() string {
- return r.raw
-}
-
-// The sensitivity level to use for rules in the category.
-type RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel string
-
-const (
- RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "default"
- RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "medium"
- RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "low"
- RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "eoff"
-)
-
-// A rule-level override
-type RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRule struct {
- // The ID of the rule to override.
- ID string `json:"id,required"`
- // The action to override the rule with.
- Action string `json:"action"`
- // Whether to enable execution of the rule.
- Enabled bool `json:"enabled"`
- // The score threshold to use for the rule.
- ScoreThreshold int64 `json:"score_threshold"`
- // The sensitivity level to use for the rule.
- SensitivityLevel RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel `json:"sensitivity_level"`
- JSON rulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON `json:"-"`
-}
-
-// rulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON
-// contains the JSON metadata for the struct
-// [RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRule]
-type rulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON struct {
- ID apijson.Field
- Action apijson.Field
- Enabled apijson.Field
- ScoreThreshold apijson.Field
- SensitivityLevel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON) RawJSON() string {
- return r.raw
-}
-
-// The sensitivity level to use for the rule.
-type RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel string
-
-const (
- RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "default"
- RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "medium"
- RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelLow RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "low"
- RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "eoff"
-)
-
-// A sensitivity level to set for all rules. This option has lower precedence than
-// rule and category overrides and is only applicable for DDoS phases.
-type RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel string
-
-const (
- RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelDefault RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "default"
- RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelMedium RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "medium"
- RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelLow RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "low"
- RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelEoff RulesetUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "eoff"
-)
-
-// An object configuring the rule's logging behavior.
-type RulesetUpdateResponseRulesRulesetsExecuteRuleLogging struct {
- // Whether to generate a log when the rule matches.
- Enabled bool `json:"enabled,required"`
- JSON rulesetUpdateResponseRulesRulesetsExecuteRuleLoggingJSON `json:"-"`
-}
-
-// rulesetUpdateResponseRulesRulesetsExecuteRuleLoggingJSON contains the JSON
-// metadata for the struct [RulesetUpdateResponseRulesRulesetsExecuteRuleLogging]
-type rulesetUpdateResponseRulesRulesetsExecuteRuleLoggingJSON struct {
- Enabled apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetUpdateResponseRulesRulesetsExecuteRuleLogging) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetUpdateResponseRulesRulesetsExecuteRuleLoggingJSON) RawJSON() string {
- return r.raw
-}
-
-type RulesetUpdateResponseRulesRulesetsLogRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action RulesetUpdateResponseRulesRulesetsLogRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters interface{} `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging RulesetUpdateResponseRulesRulesetsLogRuleLogging `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON rulesetUpdateResponseRulesRulesetsLogRuleJSON `json:"-"`
-}
-
-// rulesetUpdateResponseRulesRulesetsLogRuleJSON contains the JSON metadata for the
-// struct [RulesetUpdateResponseRulesRulesetsLogRule]
-type rulesetUpdateResponseRulesRulesetsLogRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetUpdateResponseRulesRulesetsLogRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetUpdateResponseRulesRulesetsLogRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r RulesetUpdateResponseRulesRulesetsLogRule) implementsRulesetUpdateResponseRule() {}
-
-// The action to perform when the rule matches.
-type RulesetUpdateResponseRulesRulesetsLogRuleAction string
-
-const (
- RulesetUpdateResponseRulesRulesetsLogRuleActionLog RulesetUpdateResponseRulesRulesetsLogRuleAction = "log"
-)
-
-// An object configuring the rule's logging behavior.
-type RulesetUpdateResponseRulesRulesetsLogRuleLogging struct {
- // Whether to generate a log when the rule matches.
- Enabled bool `json:"enabled,required"`
- JSON rulesetUpdateResponseRulesRulesetsLogRuleLoggingJSON `json:"-"`
-}
-
-// rulesetUpdateResponseRulesRulesetsLogRuleLoggingJSON contains the JSON metadata
-// for the struct [RulesetUpdateResponseRulesRulesetsLogRuleLogging]
-type rulesetUpdateResponseRulesRulesetsLogRuleLoggingJSON struct {
- Enabled apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetUpdateResponseRulesRulesetsLogRuleLogging) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetUpdateResponseRulesRulesetsLogRuleLoggingJSON) RawJSON() string {
- return r.raw
-}
-
-type RulesetUpdateResponseRulesRulesetsSkipRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action RulesetUpdateResponseRulesRulesetsSkipRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters RulesetUpdateResponseRulesRulesetsSkipRuleActionParameters `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging RulesetUpdateResponseRulesRulesetsSkipRuleLogging `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON rulesetUpdateResponseRulesRulesetsSkipRuleJSON `json:"-"`
-}
-
-// rulesetUpdateResponseRulesRulesetsSkipRuleJSON contains the JSON metadata for
-// the struct [RulesetUpdateResponseRulesRulesetsSkipRule]
-type rulesetUpdateResponseRulesRulesetsSkipRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetUpdateResponseRulesRulesetsSkipRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetUpdateResponseRulesRulesetsSkipRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r RulesetUpdateResponseRulesRulesetsSkipRule) implementsRulesetUpdateResponseRule() {}
-
-// The action to perform when the rule matches.
-type RulesetUpdateResponseRulesRulesetsSkipRuleAction string
-
-const (
- RulesetUpdateResponseRulesRulesetsSkipRuleActionSkip RulesetUpdateResponseRulesRulesetsSkipRuleAction = "skip"
-)
-
-// The parameters configuring the rule's action.
-type RulesetUpdateResponseRulesRulesetsSkipRuleActionParameters struct {
- // A list of phases to skip the execution of. This option is incompatible with the
- // ruleset and rulesets options.
- Phases []RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase `json:"phases"`
- // A list of legacy security products to skip the execution of.
- Products []RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersProduct `json:"products"`
- // A mapping of ruleset IDs to a list of rule IDs in that ruleset to skip the
- // execution of. This option is incompatible with the ruleset option.
- Rules map[string][]string `json:"rules"`
- // A ruleset to skip the execution of. This option is incompatible with the
- // rulesets, rules and phases options.
- Ruleset RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersRuleset `json:"ruleset"`
- // A list of ruleset IDs to skip the execution of. This option is incompatible with
- // the ruleset and phases options.
- Rulesets []string `json:"rulesets"`
- JSON rulesetUpdateResponseRulesRulesetsSkipRuleActionParametersJSON `json:"-"`
-}
-
-// rulesetUpdateResponseRulesRulesetsSkipRuleActionParametersJSON contains the JSON
-// metadata for the struct
-// [RulesetUpdateResponseRulesRulesetsSkipRuleActionParameters]
-type rulesetUpdateResponseRulesRulesetsSkipRuleActionParametersJSON struct {
- Phases apijson.Field
- Products apijson.Field
- Rules apijson.Field
- Ruleset apijson.Field
- Rulesets apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetUpdateResponseRulesRulesetsSkipRuleActionParameters) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetUpdateResponseRulesRulesetsSkipRuleActionParametersJSON) RawJSON() string {
- return r.raw
-}
-
-// A phase to skip the execution of.
-type RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase string
-
-const (
- RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseDDOSL4 RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "ddos_l4"
- RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseDDOSL7 RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "ddos_l7"
- RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPConfigSettings RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_config_settings"
- RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPCustomErrors RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_custom_errors"
- RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPLogCustomFields RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_log_custom_fields"
- RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRatelimit RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_ratelimit"
- RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestCacheSettings RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_cache_settings"
- RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestDynamicRedirect RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_dynamic_redirect"
- RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallCustom RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_custom"
- RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallManaged RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_managed"
- RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestLateTransform RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_late_transform"
- RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestOrigin RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_origin"
- RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestRedirect RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_redirect"
- RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSanitize RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_sanitize"
- RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSbfm RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_sbfm"
- RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSelectConfiguration RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_select_configuration"
- RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestTransform RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_transform"
- RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseCompression RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_compression"
- RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseFirewallManaged RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_firewall_managed"
- RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseHeadersTransform RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_headers_transform"
- RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransit RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit"
- RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitIDsManaged RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_ids_managed"
- RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitManaged RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_managed"
-)
-
-// The name of a legacy security product to skip the execution of.
-type RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersProduct string
-
-const (
- RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersProductBic RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersProduct = "bic"
- RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersProductHot RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersProduct = "hot"
- RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersProductRateLimit RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersProduct = "rateLimit"
- RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersProductSecurityLevel RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersProduct = "securityLevel"
- RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersProductUABlock RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersProduct = "uaBlock"
- RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersProductWAF RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersProduct = "waf"
- RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersProductZoneLockdown RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersProduct = "zoneLockdown"
-)
-
-// A ruleset to skip the execution of. This option is incompatible with the
-// rulesets, rules and phases options.
-type RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersRuleset string
-
-const (
- RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersRulesetCurrent RulesetUpdateResponseRulesRulesetsSkipRuleActionParametersRuleset = "current"
-)
-
-// An object configuring the rule's logging behavior.
-type RulesetUpdateResponseRulesRulesetsSkipRuleLogging struct {
- // Whether to generate a log when the rule matches.
- Enabled bool `json:"enabled,required"`
- JSON rulesetUpdateResponseRulesRulesetsSkipRuleLoggingJSON `json:"-"`
-}
-
-// rulesetUpdateResponseRulesRulesetsSkipRuleLoggingJSON contains the JSON metadata
-// for the struct [RulesetUpdateResponseRulesRulesetsSkipRuleLogging]
-type rulesetUpdateResponseRulesRulesetsSkipRuleLoggingJSON struct {
- Enabled apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetUpdateResponseRulesRulesetsSkipRuleLogging) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetUpdateResponseRulesRulesetsSkipRuleLoggingJSON) RawJSON() string {
- return r.raw
-}
-
-// A ruleset object.
-type RulesetListResponse struct {
- // The kind of the ruleset.
- Kind RulesetListResponseKind `json:"kind,required"`
- // The human-readable name of the ruleset.
- Name string `json:"name,required"`
- // The phase of the ruleset.
- Phase RulesetListResponsePhase `json:"phase,required"`
- // The unique ID of the ruleset.
- ID string `json:"id"`
- // An informative description of the ruleset.
- Description string `json:"description"`
- // The timestamp of when the ruleset was last modified.
- LastUpdated time.Time `json:"last_updated" format:"date-time"`
- // The version of the ruleset.
- Version string `json:"version"`
- JSON rulesetListResponseJSON `json:"-"`
-}
-
-// rulesetListResponseJSON contains the JSON metadata for the struct
-// [RulesetListResponse]
-type rulesetListResponseJSON struct {
- Kind apijson.Field
- Name apijson.Field
- Phase apijson.Field
- ID apijson.Field
- Description apijson.Field
- LastUpdated apijson.Field
- Version apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// The kind of the ruleset.
-type RulesetListResponseKind string
-
-const (
- RulesetListResponseKindManaged RulesetListResponseKind = "managed"
- RulesetListResponseKindCustom RulesetListResponseKind = "custom"
- RulesetListResponseKindRoot RulesetListResponseKind = "root"
- RulesetListResponseKindZone RulesetListResponseKind = "zone"
-)
-
-// The phase of the ruleset.
-type RulesetListResponsePhase string
-
-const (
- RulesetListResponsePhaseDDOSL4 RulesetListResponsePhase = "ddos_l4"
- RulesetListResponsePhaseDDOSL7 RulesetListResponsePhase = "ddos_l7"
- RulesetListResponsePhaseHTTPConfigSettings RulesetListResponsePhase = "http_config_settings"
- RulesetListResponsePhaseHTTPCustomErrors RulesetListResponsePhase = "http_custom_errors"
- RulesetListResponsePhaseHTTPLogCustomFields RulesetListResponsePhase = "http_log_custom_fields"
- RulesetListResponsePhaseHTTPRatelimit RulesetListResponsePhase = "http_ratelimit"
- RulesetListResponsePhaseHTTPRequestCacheSettings RulesetListResponsePhase = "http_request_cache_settings"
- RulesetListResponsePhaseHTTPRequestDynamicRedirect RulesetListResponsePhase = "http_request_dynamic_redirect"
- RulesetListResponsePhaseHTTPRequestFirewallCustom RulesetListResponsePhase = "http_request_firewall_custom"
- RulesetListResponsePhaseHTTPRequestFirewallManaged RulesetListResponsePhase = "http_request_firewall_managed"
- RulesetListResponsePhaseHTTPRequestLateTransform RulesetListResponsePhase = "http_request_late_transform"
- RulesetListResponsePhaseHTTPRequestOrigin RulesetListResponsePhase = "http_request_origin"
- RulesetListResponsePhaseHTTPRequestRedirect RulesetListResponsePhase = "http_request_redirect"
- RulesetListResponsePhaseHTTPRequestSanitize RulesetListResponsePhase = "http_request_sanitize"
- RulesetListResponsePhaseHTTPRequestSbfm RulesetListResponsePhase = "http_request_sbfm"
- RulesetListResponsePhaseHTTPRequestSelectConfiguration RulesetListResponsePhase = "http_request_select_configuration"
- RulesetListResponsePhaseHTTPRequestTransform RulesetListResponsePhase = "http_request_transform"
- RulesetListResponsePhaseHTTPResponseCompression RulesetListResponsePhase = "http_response_compression"
- RulesetListResponsePhaseHTTPResponseFirewallManaged RulesetListResponsePhase = "http_response_firewall_managed"
- RulesetListResponsePhaseHTTPResponseHeadersTransform RulesetListResponsePhase = "http_response_headers_transform"
- RulesetListResponsePhaseMagicTransit RulesetListResponsePhase = "magic_transit"
- RulesetListResponsePhaseMagicTransitIDsManaged RulesetListResponsePhase = "magic_transit_ids_managed"
- RulesetListResponsePhaseMagicTransitManaged RulesetListResponsePhase = "magic_transit_managed"
-)
-
-// A result.
-type RulesetGetResponse struct {
- // The unique ID of the ruleset.
- ID string `json:"id,required"`
- // The kind of the ruleset.
- Kind RulesetGetResponseKind `json:"kind,required"`
- // The timestamp of when the ruleset was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The human-readable name of the ruleset.
- Name string `json:"name,required"`
- // The phase of the ruleset.
- Phase RulesetGetResponsePhase `json:"phase,required"`
- // The list of rules in the ruleset.
- Rules []RulesetGetResponseRule `json:"rules,required"`
- // The version of the ruleset.
- Version string `json:"version,required"`
- // An informative description of the ruleset.
- Description string `json:"description"`
- JSON rulesetGetResponseJSON `json:"-"`
-}
-
-// rulesetGetResponseJSON contains the JSON metadata for the struct
-// [RulesetGetResponse]
-type rulesetGetResponseJSON struct {
- ID apijson.Field
- Kind apijson.Field
- LastUpdated apijson.Field
- Name apijson.Field
- Phase apijson.Field
- Rules apijson.Field
- Version apijson.Field
- Description apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// The kind of the ruleset.
-type RulesetGetResponseKind string
-
-const (
- RulesetGetResponseKindManaged RulesetGetResponseKind = "managed"
- RulesetGetResponseKindCustom RulesetGetResponseKind = "custom"
- RulesetGetResponseKindRoot RulesetGetResponseKind = "root"
- RulesetGetResponseKindZone RulesetGetResponseKind = "zone"
-)
-
-// The phase of the ruleset.
-type RulesetGetResponsePhase string
-
-const (
- RulesetGetResponsePhaseDDOSL4 RulesetGetResponsePhase = "ddos_l4"
- RulesetGetResponsePhaseDDOSL7 RulesetGetResponsePhase = "ddos_l7"
- RulesetGetResponsePhaseHTTPConfigSettings RulesetGetResponsePhase = "http_config_settings"
- RulesetGetResponsePhaseHTTPCustomErrors RulesetGetResponsePhase = "http_custom_errors"
- RulesetGetResponsePhaseHTTPLogCustomFields RulesetGetResponsePhase = "http_log_custom_fields"
- RulesetGetResponsePhaseHTTPRatelimit RulesetGetResponsePhase = "http_ratelimit"
- RulesetGetResponsePhaseHTTPRequestCacheSettings RulesetGetResponsePhase = "http_request_cache_settings"
- RulesetGetResponsePhaseHTTPRequestDynamicRedirect RulesetGetResponsePhase = "http_request_dynamic_redirect"
- RulesetGetResponsePhaseHTTPRequestFirewallCustom RulesetGetResponsePhase = "http_request_firewall_custom"
- RulesetGetResponsePhaseHTTPRequestFirewallManaged RulesetGetResponsePhase = "http_request_firewall_managed"
- RulesetGetResponsePhaseHTTPRequestLateTransform RulesetGetResponsePhase = "http_request_late_transform"
- RulesetGetResponsePhaseHTTPRequestOrigin RulesetGetResponsePhase = "http_request_origin"
- RulesetGetResponsePhaseHTTPRequestRedirect RulesetGetResponsePhase = "http_request_redirect"
- RulesetGetResponsePhaseHTTPRequestSanitize RulesetGetResponsePhase = "http_request_sanitize"
- RulesetGetResponsePhaseHTTPRequestSbfm RulesetGetResponsePhase = "http_request_sbfm"
- RulesetGetResponsePhaseHTTPRequestSelectConfiguration RulesetGetResponsePhase = "http_request_select_configuration"
- RulesetGetResponsePhaseHTTPRequestTransform RulesetGetResponsePhase = "http_request_transform"
- RulesetGetResponsePhaseHTTPResponseCompression RulesetGetResponsePhase = "http_response_compression"
- RulesetGetResponsePhaseHTTPResponseFirewallManaged RulesetGetResponsePhase = "http_response_firewall_managed"
- RulesetGetResponsePhaseHTTPResponseHeadersTransform RulesetGetResponsePhase = "http_response_headers_transform"
- RulesetGetResponsePhaseMagicTransit RulesetGetResponsePhase = "magic_transit"
- RulesetGetResponsePhaseMagicTransitIDsManaged RulesetGetResponsePhase = "magic_transit_ids_managed"
- RulesetGetResponsePhaseMagicTransitManaged RulesetGetResponsePhase = "magic_transit_managed"
-)
-
-// Union satisfied by [RulesetGetResponseRulesRulesetsBlockRule],
-// [RulesetGetResponseRulesRulesetsExecuteRule],
-// [RulesetGetResponseRulesRulesetsLogRule] or
-// [RulesetGetResponseRulesRulesetsSkipRule].
-type RulesetGetResponseRule interface {
- implementsRulesetGetResponseRule()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*RulesetGetResponseRule)(nil)).Elem(),
- "action",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(RulesetGetResponseRulesRulesetsBlockRule{}),
- DiscriminatorValue: "block",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(RulesetGetResponseRulesRulesetsExecuteRule{}),
- DiscriminatorValue: "execute",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(RulesetGetResponseRulesRulesetsLogRule{}),
- DiscriminatorValue: "log",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(RulesetGetResponseRulesRulesetsSkipRule{}),
- DiscriminatorValue: "skip",
- },
- )
-}
-
-type RulesetGetResponseRulesRulesetsBlockRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action RulesetGetResponseRulesRulesetsBlockRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters RulesetGetResponseRulesRulesetsBlockRuleActionParameters `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging RulesetGetResponseRulesRulesetsBlockRuleLogging `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON rulesetGetResponseRulesRulesetsBlockRuleJSON `json:"-"`
-}
-
-// rulesetGetResponseRulesRulesetsBlockRuleJSON contains the JSON metadata for the
-// struct [RulesetGetResponseRulesRulesetsBlockRule]
-type rulesetGetResponseRulesRulesetsBlockRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetGetResponseRulesRulesetsBlockRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetGetResponseRulesRulesetsBlockRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r RulesetGetResponseRulesRulesetsBlockRule) implementsRulesetGetResponseRule() {}
-
-// The action to perform when the rule matches.
-type RulesetGetResponseRulesRulesetsBlockRuleAction string
-
-const (
- RulesetGetResponseRulesRulesetsBlockRuleActionBlock RulesetGetResponseRulesRulesetsBlockRuleAction = "block"
-)
-
-// The parameters configuring the rule's action.
-type RulesetGetResponseRulesRulesetsBlockRuleActionParameters struct {
- // The response to show when the block is applied.
- Response RulesetGetResponseRulesRulesetsBlockRuleActionParametersResponse `json:"response"`
- JSON rulesetGetResponseRulesRulesetsBlockRuleActionParametersJSON `json:"-"`
-}
-
-// rulesetGetResponseRulesRulesetsBlockRuleActionParametersJSON contains the JSON
-// metadata for the struct
-// [RulesetGetResponseRulesRulesetsBlockRuleActionParameters]
-type rulesetGetResponseRulesRulesetsBlockRuleActionParametersJSON struct {
- Response apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetGetResponseRulesRulesetsBlockRuleActionParameters) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetGetResponseRulesRulesetsBlockRuleActionParametersJSON) RawJSON() string {
- return r.raw
-}
-
-// The response to show when the block is applied.
-type RulesetGetResponseRulesRulesetsBlockRuleActionParametersResponse struct {
- // The content to return.
- Content string `json:"content,required"`
- // The type of the content to return.
- ContentType string `json:"content_type,required"`
- // The status code to return.
- StatusCode int64 `json:"status_code,required"`
- JSON rulesetGetResponseRulesRulesetsBlockRuleActionParametersResponseJSON `json:"-"`
-}
-
-// rulesetGetResponseRulesRulesetsBlockRuleActionParametersResponseJSON contains
-// the JSON metadata for the struct
-// [RulesetGetResponseRulesRulesetsBlockRuleActionParametersResponse]
-type rulesetGetResponseRulesRulesetsBlockRuleActionParametersResponseJSON struct {
- Content apijson.Field
- ContentType apijson.Field
- StatusCode apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetGetResponseRulesRulesetsBlockRuleActionParametersResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetGetResponseRulesRulesetsBlockRuleActionParametersResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// An object configuring the rule's logging behavior.
-type RulesetGetResponseRulesRulesetsBlockRuleLogging struct {
- // Whether to generate a log when the rule matches.
- Enabled bool `json:"enabled,required"`
- JSON rulesetGetResponseRulesRulesetsBlockRuleLoggingJSON `json:"-"`
-}
-
-// rulesetGetResponseRulesRulesetsBlockRuleLoggingJSON contains the JSON metadata
-// for the struct [RulesetGetResponseRulesRulesetsBlockRuleLogging]
-type rulesetGetResponseRulesRulesetsBlockRuleLoggingJSON struct {
- Enabled apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetGetResponseRulesRulesetsBlockRuleLogging) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetGetResponseRulesRulesetsBlockRuleLoggingJSON) RawJSON() string {
- return r.raw
-}
-
-type RulesetGetResponseRulesRulesetsExecuteRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action RulesetGetResponseRulesRulesetsExecuteRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters RulesetGetResponseRulesRulesetsExecuteRuleActionParameters `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging RulesetGetResponseRulesRulesetsExecuteRuleLogging `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON rulesetGetResponseRulesRulesetsExecuteRuleJSON `json:"-"`
-}
-
-// rulesetGetResponseRulesRulesetsExecuteRuleJSON contains the JSON metadata for
-// the struct [RulesetGetResponseRulesRulesetsExecuteRule]
-type rulesetGetResponseRulesRulesetsExecuteRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetGetResponseRulesRulesetsExecuteRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetGetResponseRulesRulesetsExecuteRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r RulesetGetResponseRulesRulesetsExecuteRule) implementsRulesetGetResponseRule() {}
-
-// The action to perform when the rule matches.
-type RulesetGetResponseRulesRulesetsExecuteRuleAction string
-
-const (
- RulesetGetResponseRulesRulesetsExecuteRuleActionExecute RulesetGetResponseRulesRulesetsExecuteRuleAction = "execute"
-)
-
-// The parameters configuring the rule's action.
-type RulesetGetResponseRulesRulesetsExecuteRuleActionParameters struct {
- // The ID of the ruleset to execute.
- ID string `json:"id,required"`
- // The configuration to use for matched data logging.
- MatchedData RulesetGetResponseRulesRulesetsExecuteRuleActionParametersMatchedData `json:"matched_data"`
- // A set of overrides to apply to the target ruleset.
- Overrides RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverrides `json:"overrides"`
- JSON rulesetGetResponseRulesRulesetsExecuteRuleActionParametersJSON `json:"-"`
-}
-
-// rulesetGetResponseRulesRulesetsExecuteRuleActionParametersJSON contains the JSON
-// metadata for the struct
-// [RulesetGetResponseRulesRulesetsExecuteRuleActionParameters]
-type rulesetGetResponseRulesRulesetsExecuteRuleActionParametersJSON struct {
- ID apijson.Field
- MatchedData apijson.Field
- Overrides apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetGetResponseRulesRulesetsExecuteRuleActionParameters) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetGetResponseRulesRulesetsExecuteRuleActionParametersJSON) RawJSON() string {
- return r.raw
-}
-
-// The configuration to use for matched data logging.
-type RulesetGetResponseRulesRulesetsExecuteRuleActionParametersMatchedData struct {
- // The public key to encrypt matched data logs with.
- PublicKey string `json:"public_key,required"`
- JSON rulesetGetResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON `json:"-"`
-}
-
-// rulesetGetResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON
-// contains the JSON metadata for the struct
-// [RulesetGetResponseRulesRulesetsExecuteRuleActionParametersMatchedData]
-type rulesetGetResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON struct {
- PublicKey apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetGetResponseRulesRulesetsExecuteRuleActionParametersMatchedData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetGetResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON) RawJSON() string {
- return r.raw
-}
-
-// A set of overrides to apply to the target ruleset.
-type RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverrides struct {
- // An action to override all rules with. This option has lower precedence than rule
- // and category overrides.
- Action string `json:"action"`
- // A list of category-level overrides. This option has the second-highest
- // precedence after rule-level overrides.
- Categories []RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory `json:"categories"`
- // Whether to enable execution of all rules. This option has lower precedence than
- // rule and category overrides.
- Enabled bool `json:"enabled"`
- // A list of rule-level overrides. This option has the highest precedence.
- Rules []RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRule `json:"rules"`
- // A sensitivity level to set for all rules. This option has lower precedence than
- // rule and category overrides and is only applicable for DDoS phases.
- SensitivityLevel RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel `json:"sensitivity_level"`
- JSON rulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON `json:"-"`
-}
-
-// rulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON contains
-// the JSON metadata for the struct
-// [RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverrides]
-type rulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON struct {
- Action apijson.Field
- Categories apijson.Field
- Enabled apijson.Field
- Rules apijson.Field
- SensitivityLevel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverrides) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON) RawJSON() string {
- return r.raw
-}
-
-// A category-level override
-type RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory struct {
- // The name of the category to override.
- Category string `json:"category,required"`
- // The action to override rules in the category with.
- Action string `json:"action"`
- // Whether to enable execution of rules in the category.
- Enabled bool `json:"enabled"`
- // The sensitivity level to use for rules in the category.
- SensitivityLevel RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel `json:"sensitivity_level"`
- JSON rulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON `json:"-"`
-}
-
-// rulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON
-// contains the JSON metadata for the struct
-// [RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory]
-type rulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON struct {
- Category apijson.Field
- Action apijson.Field
- Enabled apijson.Field
- SensitivityLevel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON) RawJSON() string {
- return r.raw
-}
-
-// The sensitivity level to use for rules in the category.
-type RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel string
-
-const (
- RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "default"
- RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "medium"
- RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "low"
- RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "eoff"
-)
-
-// A rule-level override
-type RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRule struct {
- // The ID of the rule to override.
- ID string `json:"id,required"`
- // The action to override the rule with.
- Action string `json:"action"`
- // Whether to enable execution of the rule.
- Enabled bool `json:"enabled"`
- // The score threshold to use for the rule.
- ScoreThreshold int64 `json:"score_threshold"`
- // The sensitivity level to use for the rule.
- SensitivityLevel RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel `json:"sensitivity_level"`
- JSON rulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON `json:"-"`
-}
-
-// rulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON
-// contains the JSON metadata for the struct
-// [RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRule]
-type rulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON struct {
- ID apijson.Field
- Action apijson.Field
- Enabled apijson.Field
- ScoreThreshold apijson.Field
- SensitivityLevel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON) RawJSON() string {
- return r.raw
-}
-
-// The sensitivity level to use for the rule.
-type RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel string
-
-const (
- RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "default"
- RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "medium"
- RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelLow RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "low"
- RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "eoff"
-)
-
-// A sensitivity level to set for all rules. This option has lower precedence than
-// rule and category overrides and is only applicable for DDoS phases.
-type RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel string
-
-const (
- RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelDefault RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "default"
- RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelMedium RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "medium"
- RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelLow RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "low"
- RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelEoff RulesetGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "eoff"
-)
-
-// An object configuring the rule's logging behavior.
-type RulesetGetResponseRulesRulesetsExecuteRuleLogging struct {
- // Whether to generate a log when the rule matches.
- Enabled bool `json:"enabled,required"`
- JSON rulesetGetResponseRulesRulesetsExecuteRuleLoggingJSON `json:"-"`
-}
-
-// rulesetGetResponseRulesRulesetsExecuteRuleLoggingJSON contains the JSON metadata
-// for the struct [RulesetGetResponseRulesRulesetsExecuteRuleLogging]
-type rulesetGetResponseRulesRulesetsExecuteRuleLoggingJSON struct {
- Enabled apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetGetResponseRulesRulesetsExecuteRuleLogging) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetGetResponseRulesRulesetsExecuteRuleLoggingJSON) RawJSON() string {
- return r.raw
-}
-
-type RulesetGetResponseRulesRulesetsLogRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action RulesetGetResponseRulesRulesetsLogRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters interface{} `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging RulesetGetResponseRulesRulesetsLogRuleLogging `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON rulesetGetResponseRulesRulesetsLogRuleJSON `json:"-"`
-}
-
-// rulesetGetResponseRulesRulesetsLogRuleJSON contains the JSON metadata for the
-// struct [RulesetGetResponseRulesRulesetsLogRule]
-type rulesetGetResponseRulesRulesetsLogRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetGetResponseRulesRulesetsLogRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetGetResponseRulesRulesetsLogRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r RulesetGetResponseRulesRulesetsLogRule) implementsRulesetGetResponseRule() {}
-
-// The action to perform when the rule matches.
-type RulesetGetResponseRulesRulesetsLogRuleAction string
-
-const (
- RulesetGetResponseRulesRulesetsLogRuleActionLog RulesetGetResponseRulesRulesetsLogRuleAction = "log"
-)
-
-// An object configuring the rule's logging behavior.
-type RulesetGetResponseRulesRulesetsLogRuleLogging struct {
- // Whether to generate a log when the rule matches.
- Enabled bool `json:"enabled,required"`
- JSON rulesetGetResponseRulesRulesetsLogRuleLoggingJSON `json:"-"`
-}
-
-// rulesetGetResponseRulesRulesetsLogRuleLoggingJSON contains the JSON metadata for
-// the struct [RulesetGetResponseRulesRulesetsLogRuleLogging]
-type rulesetGetResponseRulesRulesetsLogRuleLoggingJSON struct {
- Enabled apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetGetResponseRulesRulesetsLogRuleLogging) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetGetResponseRulesRulesetsLogRuleLoggingJSON) RawJSON() string {
- return r.raw
-}
-
-type RulesetGetResponseRulesRulesetsSkipRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action RulesetGetResponseRulesRulesetsSkipRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters RulesetGetResponseRulesRulesetsSkipRuleActionParameters `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging RulesetGetResponseRulesRulesetsSkipRuleLogging `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON rulesetGetResponseRulesRulesetsSkipRuleJSON `json:"-"`
-}
-
-// rulesetGetResponseRulesRulesetsSkipRuleJSON contains the JSON metadata for the
-// struct [RulesetGetResponseRulesRulesetsSkipRule]
-type rulesetGetResponseRulesRulesetsSkipRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetGetResponseRulesRulesetsSkipRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetGetResponseRulesRulesetsSkipRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r RulesetGetResponseRulesRulesetsSkipRule) implementsRulesetGetResponseRule() {}
-
-// The action to perform when the rule matches.
-type RulesetGetResponseRulesRulesetsSkipRuleAction string
-
-const (
- RulesetGetResponseRulesRulesetsSkipRuleActionSkip RulesetGetResponseRulesRulesetsSkipRuleAction = "skip"
-)
-
-// The parameters configuring the rule's action.
-type RulesetGetResponseRulesRulesetsSkipRuleActionParameters struct {
- // A list of phases to skip the execution of. This option is incompatible with the
- // ruleset and rulesets options.
- Phases []RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase `json:"phases"`
- // A list of legacy security products to skip the execution of.
- Products []RulesetGetResponseRulesRulesetsSkipRuleActionParametersProduct `json:"products"`
- // A mapping of ruleset IDs to a list of rule IDs in that ruleset to skip the
- // execution of. This option is incompatible with the ruleset option.
- Rules map[string][]string `json:"rules"`
- // A ruleset to skip the execution of. This option is incompatible with the
- // rulesets, rules and phases options.
- Ruleset RulesetGetResponseRulesRulesetsSkipRuleActionParametersRuleset `json:"ruleset"`
- // A list of ruleset IDs to skip the execution of. This option is incompatible with
- // the ruleset and phases options.
- Rulesets []string `json:"rulesets"`
- JSON rulesetGetResponseRulesRulesetsSkipRuleActionParametersJSON `json:"-"`
-}
-
-// rulesetGetResponseRulesRulesetsSkipRuleActionParametersJSON contains the JSON
-// metadata for the struct
-// [RulesetGetResponseRulesRulesetsSkipRuleActionParameters]
-type rulesetGetResponseRulesRulesetsSkipRuleActionParametersJSON struct {
- Phases apijson.Field
- Products apijson.Field
- Rules apijson.Field
- Ruleset apijson.Field
- Rulesets apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetGetResponseRulesRulesetsSkipRuleActionParameters) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetGetResponseRulesRulesetsSkipRuleActionParametersJSON) RawJSON() string {
- return r.raw
-}
-
-// A phase to skip the execution of.
-type RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase string
-
-const (
- RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseDDOSL4 RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "ddos_l4"
- RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseDDOSL7 RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "ddos_l7"
- RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPConfigSettings RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_config_settings"
- RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPCustomErrors RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_custom_errors"
- RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPLogCustomFields RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_log_custom_fields"
- RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRatelimit RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_ratelimit"
- RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestCacheSettings RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_cache_settings"
- RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestDynamicRedirect RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_dynamic_redirect"
- RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallCustom RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_custom"
- RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallManaged RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_managed"
- RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestLateTransform RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_late_transform"
- RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestOrigin RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_origin"
- RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestRedirect RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_redirect"
- RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSanitize RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_sanitize"
- RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSbfm RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_sbfm"
- RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSelectConfiguration RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_select_configuration"
- RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestTransform RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_transform"
- RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseCompression RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_compression"
- RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseFirewallManaged RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_firewall_managed"
- RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseHeadersTransform RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_headers_transform"
- RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransit RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit"
- RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitIDsManaged RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_ids_managed"
- RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitManaged RulesetGetResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_managed"
-)
-
-// The name of a legacy security product to skip the execution of.
-type RulesetGetResponseRulesRulesetsSkipRuleActionParametersProduct string
-
-const (
- RulesetGetResponseRulesRulesetsSkipRuleActionParametersProductBic RulesetGetResponseRulesRulesetsSkipRuleActionParametersProduct = "bic"
- RulesetGetResponseRulesRulesetsSkipRuleActionParametersProductHot RulesetGetResponseRulesRulesetsSkipRuleActionParametersProduct = "hot"
- RulesetGetResponseRulesRulesetsSkipRuleActionParametersProductRateLimit RulesetGetResponseRulesRulesetsSkipRuleActionParametersProduct = "rateLimit"
- RulesetGetResponseRulesRulesetsSkipRuleActionParametersProductSecurityLevel RulesetGetResponseRulesRulesetsSkipRuleActionParametersProduct = "securityLevel"
- RulesetGetResponseRulesRulesetsSkipRuleActionParametersProductUABlock RulesetGetResponseRulesRulesetsSkipRuleActionParametersProduct = "uaBlock"
- RulesetGetResponseRulesRulesetsSkipRuleActionParametersProductWAF RulesetGetResponseRulesRulesetsSkipRuleActionParametersProduct = "waf"
- RulesetGetResponseRulesRulesetsSkipRuleActionParametersProductZoneLockdown RulesetGetResponseRulesRulesetsSkipRuleActionParametersProduct = "zoneLockdown"
-)
-
-// A ruleset to skip the execution of. This option is incompatible with the
-// rulesets, rules and phases options.
-type RulesetGetResponseRulesRulesetsSkipRuleActionParametersRuleset string
-
-const (
- RulesetGetResponseRulesRulesetsSkipRuleActionParametersRulesetCurrent RulesetGetResponseRulesRulesetsSkipRuleActionParametersRuleset = "current"
-)
-
-// An object configuring the rule's logging behavior.
-type RulesetGetResponseRulesRulesetsSkipRuleLogging struct {
- // Whether to generate a log when the rule matches.
- Enabled bool `json:"enabled,required"`
- JSON rulesetGetResponseRulesRulesetsSkipRuleLoggingJSON `json:"-"`
-}
-
-// rulesetGetResponseRulesRulesetsSkipRuleLoggingJSON contains the JSON metadata
-// for the struct [RulesetGetResponseRulesRulesetsSkipRuleLogging]
-type rulesetGetResponseRulesRulesetsSkipRuleLoggingJSON struct {
- Enabled apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetGetResponseRulesRulesetsSkipRuleLogging) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetGetResponseRulesRulesetsSkipRuleLoggingJSON) RawJSON() string {
- return r.raw
-}
-
-type RulesetNewParams struct {
- // The kind of the ruleset.
- Kind param.Field[RulesetNewParamsKind] `json:"kind,required"`
- // The human-readable name of the ruleset.
- Name param.Field[string] `json:"name,required"`
- // The phase of the ruleset.
- Phase param.Field[RulesetNewParamsPhase] `json:"phase,required"`
- // The list of rules in the ruleset.
- Rules param.Field[[]RulesetNewParamsRule] `json:"rules,required"`
- // The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
- AccountID param.Field[string] `path:"account_id"`
- // The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- ZoneID param.Field[string] `path:"zone_id"`
- // An informative description of the ruleset.
- Description param.Field[string] `json:"description"`
-}
-
-func (r RulesetNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The kind of the ruleset.
-type RulesetNewParamsKind string
-
-const (
- RulesetNewParamsKindManaged RulesetNewParamsKind = "managed"
- RulesetNewParamsKindCustom RulesetNewParamsKind = "custom"
- RulesetNewParamsKindRoot RulesetNewParamsKind = "root"
- RulesetNewParamsKindZone RulesetNewParamsKind = "zone"
-)
-
-// The phase of the ruleset.
-type RulesetNewParamsPhase string
-
-const (
- RulesetNewParamsPhaseDDOSL4 RulesetNewParamsPhase = "ddos_l4"
- RulesetNewParamsPhaseDDOSL7 RulesetNewParamsPhase = "ddos_l7"
- RulesetNewParamsPhaseHTTPConfigSettings RulesetNewParamsPhase = "http_config_settings"
- RulesetNewParamsPhaseHTTPCustomErrors RulesetNewParamsPhase = "http_custom_errors"
- RulesetNewParamsPhaseHTTPLogCustomFields RulesetNewParamsPhase = "http_log_custom_fields"
- RulesetNewParamsPhaseHTTPRatelimit RulesetNewParamsPhase = "http_ratelimit"
- RulesetNewParamsPhaseHTTPRequestCacheSettings RulesetNewParamsPhase = "http_request_cache_settings"
- RulesetNewParamsPhaseHTTPRequestDynamicRedirect RulesetNewParamsPhase = "http_request_dynamic_redirect"
- RulesetNewParamsPhaseHTTPRequestFirewallCustom RulesetNewParamsPhase = "http_request_firewall_custom"
- RulesetNewParamsPhaseHTTPRequestFirewallManaged RulesetNewParamsPhase = "http_request_firewall_managed"
- RulesetNewParamsPhaseHTTPRequestLateTransform RulesetNewParamsPhase = "http_request_late_transform"
- RulesetNewParamsPhaseHTTPRequestOrigin RulesetNewParamsPhase = "http_request_origin"
- RulesetNewParamsPhaseHTTPRequestRedirect RulesetNewParamsPhase = "http_request_redirect"
- RulesetNewParamsPhaseHTTPRequestSanitize RulesetNewParamsPhase = "http_request_sanitize"
- RulesetNewParamsPhaseHTTPRequestSbfm RulesetNewParamsPhase = "http_request_sbfm"
- RulesetNewParamsPhaseHTTPRequestSelectConfiguration RulesetNewParamsPhase = "http_request_select_configuration"
- RulesetNewParamsPhaseHTTPRequestTransform RulesetNewParamsPhase = "http_request_transform"
- RulesetNewParamsPhaseHTTPResponseCompression RulesetNewParamsPhase = "http_response_compression"
- RulesetNewParamsPhaseHTTPResponseFirewallManaged RulesetNewParamsPhase = "http_response_firewall_managed"
- RulesetNewParamsPhaseHTTPResponseHeadersTransform RulesetNewParamsPhase = "http_response_headers_transform"
- RulesetNewParamsPhaseMagicTransit RulesetNewParamsPhase = "magic_transit"
- RulesetNewParamsPhaseMagicTransitIDsManaged RulesetNewParamsPhase = "magic_transit_ids_managed"
- RulesetNewParamsPhaseMagicTransitManaged RulesetNewParamsPhase = "magic_transit_managed"
-)
-
-// Satisfied by [RulesetNewParamsRulesRulesetsBlockRule],
-// [RulesetNewParamsRulesRulesetsExecuteRule],
-// [RulesetNewParamsRulesRulesetsLogRule], [RulesetNewParamsRulesRulesetsSkipRule].
-type RulesetNewParamsRule interface {
- implementsRulesetNewParamsRule()
-}
-
-type RulesetNewParamsRulesRulesetsBlockRule struct {
- // The unique ID of the rule.
- ID param.Field[string] `json:"id"`
- // The action to perform when the rule matches.
- Action param.Field[RulesetNewParamsRulesRulesetsBlockRuleAction] `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters param.Field[RulesetNewParamsRulesRulesetsBlockRuleActionParameters] `json:"action_parameters"`
- // An informative description of the rule.
- Description param.Field[string] `json:"description"`
- // Whether the rule should be executed.
- Enabled param.Field[bool] `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression param.Field[string] `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging param.Field[RulesetNewParamsRulesRulesetsBlockRuleLogging] `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref param.Field[string] `json:"ref"`
-}
-
-func (r RulesetNewParamsRulesRulesetsBlockRule) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-func (r RulesetNewParamsRulesRulesetsBlockRule) implementsRulesetNewParamsRule() {}
-
-// The action to perform when the rule matches.
-type RulesetNewParamsRulesRulesetsBlockRuleAction string
-
-const (
- RulesetNewParamsRulesRulesetsBlockRuleActionBlock RulesetNewParamsRulesRulesetsBlockRuleAction = "block"
-)
-
-// The parameters configuring the rule's action.
-type RulesetNewParamsRulesRulesetsBlockRuleActionParameters struct {
- // The response to show when the block is applied.
- Response param.Field[RulesetNewParamsRulesRulesetsBlockRuleActionParametersResponse] `json:"response"`
-}
-
-func (r RulesetNewParamsRulesRulesetsBlockRuleActionParameters) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The response to show when the block is applied.
-type RulesetNewParamsRulesRulesetsBlockRuleActionParametersResponse struct {
- // The content to return.
- Content param.Field[string] `json:"content,required"`
- // The type of the content to return.
- ContentType param.Field[string] `json:"content_type,required"`
- // The status code to return.
- StatusCode param.Field[int64] `json:"status_code,required"`
-}
-
-func (r RulesetNewParamsRulesRulesetsBlockRuleActionParametersResponse) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// An object configuring the rule's logging behavior.
-type RulesetNewParamsRulesRulesetsBlockRuleLogging struct {
- // Whether to generate a log when the rule matches.
- Enabled param.Field[bool] `json:"enabled,required"`
-}
-
-func (r RulesetNewParamsRulesRulesetsBlockRuleLogging) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type RulesetNewParamsRulesRulesetsExecuteRule struct {
- // The unique ID of the rule.
- ID param.Field[string] `json:"id"`
- // The action to perform when the rule matches.
- Action param.Field[RulesetNewParamsRulesRulesetsExecuteRuleAction] `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters param.Field[RulesetNewParamsRulesRulesetsExecuteRuleActionParameters] `json:"action_parameters"`
- // An informative description of the rule.
- Description param.Field[string] `json:"description"`
- // Whether the rule should be executed.
- Enabled param.Field[bool] `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression param.Field[string] `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging param.Field[RulesetNewParamsRulesRulesetsExecuteRuleLogging] `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref param.Field[string] `json:"ref"`
-}
-
-func (r RulesetNewParamsRulesRulesetsExecuteRule) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-func (r RulesetNewParamsRulesRulesetsExecuteRule) implementsRulesetNewParamsRule() {}
-
-// The action to perform when the rule matches.
-type RulesetNewParamsRulesRulesetsExecuteRuleAction string
-
-const (
- RulesetNewParamsRulesRulesetsExecuteRuleActionExecute RulesetNewParamsRulesRulesetsExecuteRuleAction = "execute"
-)
-
-// The parameters configuring the rule's action.
-type RulesetNewParamsRulesRulesetsExecuteRuleActionParameters struct {
- // The ID of the ruleset to execute.
- ID param.Field[string] `json:"id,required"`
- // The configuration to use for matched data logging.
- MatchedData param.Field[RulesetNewParamsRulesRulesetsExecuteRuleActionParametersMatchedData] `json:"matched_data"`
- // A set of overrides to apply to the target ruleset.
- Overrides param.Field[RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverrides] `json:"overrides"`
-}
-
-func (r RulesetNewParamsRulesRulesetsExecuteRuleActionParameters) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The configuration to use for matched data logging.
-type RulesetNewParamsRulesRulesetsExecuteRuleActionParametersMatchedData struct {
- // The public key to encrypt matched data logs with.
- PublicKey param.Field[string] `json:"public_key,required"`
-}
-
-func (r RulesetNewParamsRulesRulesetsExecuteRuleActionParametersMatchedData) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// A set of overrides to apply to the target ruleset.
-type RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverrides struct {
- // An action to override all rules with. This option has lower precedence than rule
- // and category overrides.
- Action param.Field[string] `json:"action"`
- // A list of category-level overrides. This option has the second-highest
- // precedence after rule-level overrides.
- Categories param.Field[[]RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesCategory] `json:"categories"`
- // Whether to enable execution of all rules. This option has lower precedence than
- // rule and category overrides.
- Enabled param.Field[bool] `json:"enabled"`
- // A list of rule-level overrides. This option has the highest precedence.
- Rules param.Field[[]RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesRule] `json:"rules"`
- // A sensitivity level to set for all rules. This option has lower precedence than
- // rule and category overrides and is only applicable for DDoS phases.
- SensitivityLevel param.Field[RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel] `json:"sensitivity_level"`
-}
-
-func (r RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverrides) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// A category-level override
-type RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesCategory struct {
- // The name of the category to override.
- Category param.Field[string] `json:"category,required"`
- // The action to override rules in the category with.
- Action param.Field[string] `json:"action"`
- // Whether to enable execution of rules in the category.
- Enabled param.Field[bool] `json:"enabled"`
- // The sensitivity level to use for rules in the category.
- SensitivityLevel param.Field[RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel] `json:"sensitivity_level"`
-}
-
-func (r RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesCategory) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The sensitivity level to use for rules in the category.
-type RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel string
-
-const (
- RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "default"
- RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "medium"
- RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "low"
- RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "eoff"
-)
-
-// A rule-level override
-type RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesRule struct {
- // The ID of the rule to override.
- ID param.Field[string] `json:"id,required"`
- // The action to override the rule with.
- Action param.Field[string] `json:"action"`
- // Whether to enable execution of the rule.
- Enabled param.Field[bool] `json:"enabled"`
- // The score threshold to use for the rule.
- ScoreThreshold param.Field[int64] `json:"score_threshold"`
- // The sensitivity level to use for the rule.
- SensitivityLevel param.Field[RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel] `json:"sensitivity_level"`
-}
-
-func (r RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesRule) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The sensitivity level to use for the rule.
-type RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel string
-
-const (
- RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "default"
- RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "medium"
- RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelLow RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "low"
- RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "eoff"
-)
-
-// A sensitivity level to set for all rules. This option has lower precedence than
-// rule and category overrides and is only applicable for DDoS phases.
-type RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel string
-
-const (
- RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelDefault RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "default"
- RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelMedium RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "medium"
- RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelLow RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "low"
- RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelEoff RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "eoff"
-)
-
-// An object configuring the rule's logging behavior.
-type RulesetNewParamsRulesRulesetsExecuteRuleLogging struct {
- // Whether to generate a log when the rule matches.
- Enabled param.Field[bool] `json:"enabled,required"`
-}
-
-func (r RulesetNewParamsRulesRulesetsExecuteRuleLogging) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type RulesetNewParamsRulesRulesetsLogRule struct {
- // The unique ID of the rule.
- ID param.Field[string] `json:"id"`
- // The action to perform when the rule matches.
- Action param.Field[RulesetNewParamsRulesRulesetsLogRuleAction] `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters param.Field[interface{}] `json:"action_parameters"`
- // An informative description of the rule.
- Description param.Field[string] `json:"description"`
- // Whether the rule should be executed.
- Enabled param.Field[bool] `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression param.Field[string] `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging param.Field[RulesetNewParamsRulesRulesetsLogRuleLogging] `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref param.Field[string] `json:"ref"`
-}
-
-func (r RulesetNewParamsRulesRulesetsLogRule) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-func (r RulesetNewParamsRulesRulesetsLogRule) implementsRulesetNewParamsRule() {}
-
-// The action to perform when the rule matches.
-type RulesetNewParamsRulesRulesetsLogRuleAction string
-
-const (
- RulesetNewParamsRulesRulesetsLogRuleActionLog RulesetNewParamsRulesRulesetsLogRuleAction = "log"
-)
-
-// An object configuring the rule's logging behavior.
-type RulesetNewParamsRulesRulesetsLogRuleLogging struct {
- // Whether to generate a log when the rule matches.
- Enabled param.Field[bool] `json:"enabled,required"`
-}
-
-func (r RulesetNewParamsRulesRulesetsLogRuleLogging) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type RulesetNewParamsRulesRulesetsSkipRule struct {
- // The unique ID of the rule.
- ID param.Field[string] `json:"id"`
- // The action to perform when the rule matches.
- Action param.Field[RulesetNewParamsRulesRulesetsSkipRuleAction] `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters param.Field[RulesetNewParamsRulesRulesetsSkipRuleActionParameters] `json:"action_parameters"`
- // An informative description of the rule.
- Description param.Field[string] `json:"description"`
- // Whether the rule should be executed.
- Enabled param.Field[bool] `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression param.Field[string] `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging param.Field[RulesetNewParamsRulesRulesetsSkipRuleLogging] `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref param.Field[string] `json:"ref"`
-}
-
-func (r RulesetNewParamsRulesRulesetsSkipRule) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-func (r RulesetNewParamsRulesRulesetsSkipRule) implementsRulesetNewParamsRule() {}
-
-// The action to perform when the rule matches.
-type RulesetNewParamsRulesRulesetsSkipRuleAction string
-
-const (
- RulesetNewParamsRulesRulesetsSkipRuleActionSkip RulesetNewParamsRulesRulesetsSkipRuleAction = "skip"
-)
-
-// The parameters configuring the rule's action.
-type RulesetNewParamsRulesRulesetsSkipRuleActionParameters struct {
- // A list of phases to skip the execution of. This option is incompatible with the
- // ruleset and rulesets options.
- Phases param.Field[[]RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase] `json:"phases"`
- // A list of legacy security products to skip the execution of.
- Products param.Field[[]RulesetNewParamsRulesRulesetsSkipRuleActionParametersProduct] `json:"products"`
- // A mapping of ruleset IDs to a list of rule IDs in that ruleset to skip the
- // execution of. This option is incompatible with the ruleset option.
- Rules param.Field[map[string][]string] `json:"rules"`
- // A ruleset to skip the execution of. This option is incompatible with the
- // rulesets, rules and phases options.
- Ruleset param.Field[RulesetNewParamsRulesRulesetsSkipRuleActionParametersRuleset] `json:"ruleset"`
- // A list of ruleset IDs to skip the execution of. This option is incompatible with
- // the ruleset and phases options.
- Rulesets param.Field[[]string] `json:"rulesets"`
-}
-
-func (r RulesetNewParamsRulesRulesetsSkipRuleActionParameters) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// A phase to skip the execution of.
-type RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase string
-
-const (
- RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseDDOSL4 RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase = "ddos_l4"
- RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseDDOSL7 RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase = "ddos_l7"
- RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPConfigSettings RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase = "http_config_settings"
- RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPCustomErrors RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase = "http_custom_errors"
- RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPLogCustomFields RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase = "http_log_custom_fields"
- RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRatelimit RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase = "http_ratelimit"
- RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestCacheSettings RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_cache_settings"
- RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestDynamicRedirect RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_dynamic_redirect"
- RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallCustom RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_custom"
- RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallManaged RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_managed"
- RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestLateTransform RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_late_transform"
- RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestOrigin RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_origin"
- RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestRedirect RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_redirect"
- RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSanitize RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_sanitize"
- RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSbfm RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_sbfm"
- RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSelectConfiguration RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_select_configuration"
- RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestTransform RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_transform"
- RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseCompression RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase = "http_response_compression"
- RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseFirewallManaged RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase = "http_response_firewall_managed"
- RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseHeadersTransform RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase = "http_response_headers_transform"
- RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseMagicTransit RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase = "magic_transit"
- RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseMagicTransitIDsManaged RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_ids_managed"
- RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseMagicTransitManaged RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_managed"
-)
-
-// The name of a legacy security product to skip the execution of.
-type RulesetNewParamsRulesRulesetsSkipRuleActionParametersProduct string
-
-const (
- RulesetNewParamsRulesRulesetsSkipRuleActionParametersProductBic RulesetNewParamsRulesRulesetsSkipRuleActionParametersProduct = "bic"
- RulesetNewParamsRulesRulesetsSkipRuleActionParametersProductHot RulesetNewParamsRulesRulesetsSkipRuleActionParametersProduct = "hot"
- RulesetNewParamsRulesRulesetsSkipRuleActionParametersProductRateLimit RulesetNewParamsRulesRulesetsSkipRuleActionParametersProduct = "rateLimit"
- RulesetNewParamsRulesRulesetsSkipRuleActionParametersProductSecurityLevel RulesetNewParamsRulesRulesetsSkipRuleActionParametersProduct = "securityLevel"
- RulesetNewParamsRulesRulesetsSkipRuleActionParametersProductUABlock RulesetNewParamsRulesRulesetsSkipRuleActionParametersProduct = "uaBlock"
- RulesetNewParamsRulesRulesetsSkipRuleActionParametersProductWAF RulesetNewParamsRulesRulesetsSkipRuleActionParametersProduct = "waf"
- RulesetNewParamsRulesRulesetsSkipRuleActionParametersProductZoneLockdown RulesetNewParamsRulesRulesetsSkipRuleActionParametersProduct = "zoneLockdown"
-)
-
-// A ruleset to skip the execution of. This option is incompatible with the
-// rulesets, rules and phases options.
-type RulesetNewParamsRulesRulesetsSkipRuleActionParametersRuleset string
-
-const (
- RulesetNewParamsRulesRulesetsSkipRuleActionParametersRulesetCurrent RulesetNewParamsRulesRulesetsSkipRuleActionParametersRuleset = "current"
-)
-
-// An object configuring the rule's logging behavior.
-type RulesetNewParamsRulesRulesetsSkipRuleLogging struct {
- // Whether to generate a log when the rule matches.
- Enabled param.Field[bool] `json:"enabled,required"`
-}
-
-func (r RulesetNewParamsRulesRulesetsSkipRuleLogging) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// A response object.
-type RulesetNewResponseEnvelope struct {
- // A list of error messages.
- Errors []RulesetNewResponseEnvelopeErrors `json:"errors,required"`
- // A list of warning messages.
- Messages []RulesetNewResponseEnvelopeMessages `json:"messages,required"`
- // A result.
- Result RulesetNewResponse `json:"result,required"`
- // Whether the API call was successful.
- Success RulesetNewResponseEnvelopeSuccess `json:"success,required"`
- JSON rulesetNewResponseEnvelopeJSON `json:"-"`
-}
-
-// rulesetNewResponseEnvelopeJSON contains the JSON metadata for the struct
-// [RulesetNewResponseEnvelope]
-type rulesetNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-// A message.
-type RulesetNewResponseEnvelopeErrors struct {
- // A text description of this message.
- Message string `json:"message,required"`
- // A unique code for this message.
- Code int64 `json:"code"`
- // The source of this message.
- Source RulesetNewResponseEnvelopeErrorsSource `json:"source"`
- JSON rulesetNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// rulesetNewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
-// [RulesetNewResponseEnvelopeErrors]
-type rulesetNewResponseEnvelopeErrorsJSON struct {
- Message apijson.Field
- Code apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-// The source of this message.
-type RulesetNewResponseEnvelopeErrorsSource struct {
- // A JSON pointer to the field that is the source of the message.
- Pointer string `json:"pointer,required"`
- JSON rulesetNewResponseEnvelopeErrorsSourceJSON `json:"-"`
-}
-
-// rulesetNewResponseEnvelopeErrorsSourceJSON contains the JSON metadata for the
-// struct [RulesetNewResponseEnvelopeErrorsSource]
-type rulesetNewResponseEnvelopeErrorsSourceJSON struct {
- Pointer apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetNewResponseEnvelopeErrorsSource) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetNewResponseEnvelopeErrorsSourceJSON) RawJSON() string {
- return r.raw
-}
-
-// A message.
-type RulesetNewResponseEnvelopeMessages struct {
- // A text description of this message.
- Message string `json:"message,required"`
- // A unique code for this message.
- Code int64 `json:"code"`
- // The source of this message.
- Source RulesetNewResponseEnvelopeMessagesSource `json:"source"`
- JSON rulesetNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// rulesetNewResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
-// [RulesetNewResponseEnvelopeMessages]
-type rulesetNewResponseEnvelopeMessagesJSON struct {
- Message apijson.Field
- Code apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// The source of this message.
-type RulesetNewResponseEnvelopeMessagesSource struct {
- // A JSON pointer to the field that is the source of the message.
- Pointer string `json:"pointer,required"`
- JSON rulesetNewResponseEnvelopeMessagesSourceJSON `json:"-"`
-}
-
-// rulesetNewResponseEnvelopeMessagesSourceJSON contains the JSON metadata for the
-// struct [RulesetNewResponseEnvelopeMessagesSource]
-type rulesetNewResponseEnvelopeMessagesSourceJSON struct {
- Pointer apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetNewResponseEnvelopeMessagesSource) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetNewResponseEnvelopeMessagesSourceJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful.
-type RulesetNewResponseEnvelopeSuccess bool
-
-const (
- RulesetNewResponseEnvelopeSuccessTrue RulesetNewResponseEnvelopeSuccess = true
-)
-
-type RulesetUpdateParams struct {
- // The unique ID of the ruleset.
- ID param.Field[string] `json:"id,required"`
- // The list of rules in the ruleset.
- Rules param.Field[[]RulesetUpdateParamsRule] `json:"rules,required"`
- // The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
- AccountID param.Field[string] `path:"account_id"`
- // The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- ZoneID param.Field[string] `path:"zone_id"`
- // An informative description of the ruleset.
- Description param.Field[string] `json:"description"`
- // The kind of the ruleset.
- Kind param.Field[RulesetUpdateParamsKind] `json:"kind"`
- // The human-readable name of the ruleset.
- Name param.Field[string] `json:"name"`
- // The phase of the ruleset.
- Phase param.Field[RulesetUpdateParamsPhase] `json:"phase"`
-}
-
-func (r RulesetUpdateParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Satisfied by [RulesetUpdateParamsRulesRulesetsBlockRule],
-// [RulesetUpdateParamsRulesRulesetsExecuteRule],
-// [RulesetUpdateParamsRulesRulesetsLogRule],
-// [RulesetUpdateParamsRulesRulesetsSkipRule].
-type RulesetUpdateParamsRule interface {
- implementsRulesetUpdateParamsRule()
-}
-
-type RulesetUpdateParamsRulesRulesetsBlockRule struct {
- // The unique ID of the rule.
- ID param.Field[string] `json:"id"`
- // The action to perform when the rule matches.
- Action param.Field[RulesetUpdateParamsRulesRulesetsBlockRuleAction] `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters param.Field[RulesetUpdateParamsRulesRulesetsBlockRuleActionParameters] `json:"action_parameters"`
- // An informative description of the rule.
- Description param.Field[string] `json:"description"`
- // Whether the rule should be executed.
- Enabled param.Field[bool] `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression param.Field[string] `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging param.Field[RulesetUpdateParamsRulesRulesetsBlockRuleLogging] `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref param.Field[string] `json:"ref"`
-}
-
-func (r RulesetUpdateParamsRulesRulesetsBlockRule) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-func (r RulesetUpdateParamsRulesRulesetsBlockRule) implementsRulesetUpdateParamsRule() {}
-
-// The action to perform when the rule matches.
-type RulesetUpdateParamsRulesRulesetsBlockRuleAction string
-
-const (
- RulesetUpdateParamsRulesRulesetsBlockRuleActionBlock RulesetUpdateParamsRulesRulesetsBlockRuleAction = "block"
-)
-
-// The parameters configuring the rule's action.
-type RulesetUpdateParamsRulesRulesetsBlockRuleActionParameters struct {
- // The response to show when the block is applied.
- Response param.Field[RulesetUpdateParamsRulesRulesetsBlockRuleActionParametersResponse] `json:"response"`
-}
-
-func (r RulesetUpdateParamsRulesRulesetsBlockRuleActionParameters) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The response to show when the block is applied.
-type RulesetUpdateParamsRulesRulesetsBlockRuleActionParametersResponse struct {
- // The content to return.
- Content param.Field[string] `json:"content,required"`
- // The type of the content to return.
- ContentType param.Field[string] `json:"content_type,required"`
- // The status code to return.
- StatusCode param.Field[int64] `json:"status_code,required"`
-}
-
-func (r RulesetUpdateParamsRulesRulesetsBlockRuleActionParametersResponse) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// An object configuring the rule's logging behavior.
-type RulesetUpdateParamsRulesRulesetsBlockRuleLogging struct {
- // Whether to generate a log when the rule matches.
- Enabled param.Field[bool] `json:"enabled,required"`
-}
-
-func (r RulesetUpdateParamsRulesRulesetsBlockRuleLogging) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type RulesetUpdateParamsRulesRulesetsExecuteRule struct {
- // The unique ID of the rule.
- ID param.Field[string] `json:"id"`
- // The action to perform when the rule matches.
- Action param.Field[RulesetUpdateParamsRulesRulesetsExecuteRuleAction] `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters param.Field[RulesetUpdateParamsRulesRulesetsExecuteRuleActionParameters] `json:"action_parameters"`
- // An informative description of the rule.
- Description param.Field[string] `json:"description"`
- // Whether the rule should be executed.
- Enabled param.Field[bool] `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression param.Field[string] `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging param.Field[RulesetUpdateParamsRulesRulesetsExecuteRuleLogging] `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref param.Field[string] `json:"ref"`
-}
-
-func (r RulesetUpdateParamsRulesRulesetsExecuteRule) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-func (r RulesetUpdateParamsRulesRulesetsExecuteRule) implementsRulesetUpdateParamsRule() {}
-
-// The action to perform when the rule matches.
-type RulesetUpdateParamsRulesRulesetsExecuteRuleAction string
-
-const (
- RulesetUpdateParamsRulesRulesetsExecuteRuleActionExecute RulesetUpdateParamsRulesRulesetsExecuteRuleAction = "execute"
-)
-
-// The parameters configuring the rule's action.
-type RulesetUpdateParamsRulesRulesetsExecuteRuleActionParameters struct {
- // The ID of the ruleset to execute.
- ID param.Field[string] `json:"id,required"`
- // The configuration to use for matched data logging.
- MatchedData param.Field[RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersMatchedData] `json:"matched_data"`
- // A set of overrides to apply to the target ruleset.
- Overrides param.Field[RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverrides] `json:"overrides"`
-}
-
-func (r RulesetUpdateParamsRulesRulesetsExecuteRuleActionParameters) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The configuration to use for matched data logging.
-type RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersMatchedData struct {
- // The public key to encrypt matched data logs with.
- PublicKey param.Field[string] `json:"public_key,required"`
-}
-
-func (r RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersMatchedData) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// A set of overrides to apply to the target ruleset.
-type RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverrides struct {
- // An action to override all rules with. This option has lower precedence than rule
- // and category overrides.
- Action param.Field[string] `json:"action"`
- // A list of category-level overrides. This option has the second-highest
- // precedence after rule-level overrides.
- Categories param.Field[[]RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategory] `json:"categories"`
- // Whether to enable execution of all rules. This option has lower precedence than
- // rule and category overrides.
- Enabled param.Field[bool] `json:"enabled"`
- // A list of rule-level overrides. This option has the highest precedence.
- Rules param.Field[[]RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRule] `json:"rules"`
- // A sensitivity level to set for all rules. This option has lower precedence than
- // rule and category overrides and is only applicable for DDoS phases.
- SensitivityLevel param.Field[RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel] `json:"sensitivity_level"`
-}
-
-func (r RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverrides) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// A category-level override
-type RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategory struct {
- // The name of the category to override.
- Category param.Field[string] `json:"category,required"`
- // The action to override rules in the category with.
- Action param.Field[string] `json:"action"`
- // Whether to enable execution of rules in the category.
- Enabled param.Field[bool] `json:"enabled"`
- // The sensitivity level to use for rules in the category.
- SensitivityLevel param.Field[RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel] `json:"sensitivity_level"`
-}
-
-func (r RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategory) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The sensitivity level to use for rules in the category.
-type RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel string
-
-const (
- RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "default"
- RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "medium"
- RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "low"
- RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "eoff"
-)
-
-// A rule-level override
-type RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRule struct {
- // The ID of the rule to override.
- ID param.Field[string] `json:"id,required"`
- // The action to override the rule with.
- Action param.Field[string] `json:"action"`
- // Whether to enable execution of the rule.
- Enabled param.Field[bool] `json:"enabled"`
- // The score threshold to use for the rule.
- ScoreThreshold param.Field[int64] `json:"score_threshold"`
- // The sensitivity level to use for the rule.
- SensitivityLevel param.Field[RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel] `json:"sensitivity_level"`
-}
-
-func (r RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRule) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The sensitivity level to use for the rule.
-type RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel string
-
-const (
- RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "default"
- RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "medium"
- RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelLow RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "low"
- RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "eoff"
-)
-
-// A sensitivity level to set for all rules. This option has lower precedence than
-// rule and category overrides and is only applicable for DDoS phases.
-type RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel string
-
-const (
- RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelDefault RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "default"
- RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelMedium RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "medium"
- RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelLow RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "low"
- RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelEoff RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "eoff"
-)
-
-// An object configuring the rule's logging behavior.
-type RulesetUpdateParamsRulesRulesetsExecuteRuleLogging struct {
- // Whether to generate a log when the rule matches.
- Enabled param.Field[bool] `json:"enabled,required"`
-}
-
-func (r RulesetUpdateParamsRulesRulesetsExecuteRuleLogging) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type RulesetUpdateParamsRulesRulesetsLogRule struct {
- // The unique ID of the rule.
- ID param.Field[string] `json:"id"`
- // The action to perform when the rule matches.
- Action param.Field[RulesetUpdateParamsRulesRulesetsLogRuleAction] `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters param.Field[interface{}] `json:"action_parameters"`
- // An informative description of the rule.
- Description param.Field[string] `json:"description"`
- // Whether the rule should be executed.
- Enabled param.Field[bool] `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression param.Field[string] `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging param.Field[RulesetUpdateParamsRulesRulesetsLogRuleLogging] `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref param.Field[string] `json:"ref"`
-}
-
-func (r RulesetUpdateParamsRulesRulesetsLogRule) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-func (r RulesetUpdateParamsRulesRulesetsLogRule) implementsRulesetUpdateParamsRule() {}
-
-// The action to perform when the rule matches.
-type RulesetUpdateParamsRulesRulesetsLogRuleAction string
-
-const (
- RulesetUpdateParamsRulesRulesetsLogRuleActionLog RulesetUpdateParamsRulesRulesetsLogRuleAction = "log"
-)
-
-// An object configuring the rule's logging behavior.
-type RulesetUpdateParamsRulesRulesetsLogRuleLogging struct {
- // Whether to generate a log when the rule matches.
- Enabled param.Field[bool] `json:"enabled,required"`
-}
-
-func (r RulesetUpdateParamsRulesRulesetsLogRuleLogging) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type RulesetUpdateParamsRulesRulesetsSkipRule struct {
- // The unique ID of the rule.
- ID param.Field[string] `json:"id"`
- // The action to perform when the rule matches.
- Action param.Field[RulesetUpdateParamsRulesRulesetsSkipRuleAction] `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters param.Field[RulesetUpdateParamsRulesRulesetsSkipRuleActionParameters] `json:"action_parameters"`
- // An informative description of the rule.
- Description param.Field[string] `json:"description"`
- // Whether the rule should be executed.
- Enabled param.Field[bool] `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression param.Field[string] `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging param.Field[RulesetUpdateParamsRulesRulesetsSkipRuleLogging] `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref param.Field[string] `json:"ref"`
-}
-
-func (r RulesetUpdateParamsRulesRulesetsSkipRule) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-func (r RulesetUpdateParamsRulesRulesetsSkipRule) implementsRulesetUpdateParamsRule() {}
-
-// The action to perform when the rule matches.
-type RulesetUpdateParamsRulesRulesetsSkipRuleAction string
-
-const (
- RulesetUpdateParamsRulesRulesetsSkipRuleActionSkip RulesetUpdateParamsRulesRulesetsSkipRuleAction = "skip"
-)
-
-// The parameters configuring the rule's action.
-type RulesetUpdateParamsRulesRulesetsSkipRuleActionParameters struct {
- // A list of phases to skip the execution of. This option is incompatible with the
- // ruleset and rulesets options.
- Phases param.Field[[]RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase] `json:"phases"`
- // A list of legacy security products to skip the execution of.
- Products param.Field[[]RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersProduct] `json:"products"`
- // A mapping of ruleset IDs to a list of rule IDs in that ruleset to skip the
- // execution of. This option is incompatible with the ruleset option.
- Rules param.Field[map[string][]string] `json:"rules"`
- // A ruleset to skip the execution of. This option is incompatible with the
- // rulesets, rules and phases options.
- Ruleset param.Field[RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersRuleset] `json:"ruleset"`
- // A list of ruleset IDs to skip the execution of. This option is incompatible with
- // the ruleset and phases options.
- Rulesets param.Field[[]string] `json:"rulesets"`
-}
-
-func (r RulesetUpdateParamsRulesRulesetsSkipRuleActionParameters) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// A phase to skip the execution of.
-type RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase string
-
-const (
- RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseDDOSL4 RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "ddos_l4"
- RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseDDOSL7 RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "ddos_l7"
- RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPConfigSettings RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_config_settings"
- RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPCustomErrors RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_custom_errors"
- RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPLogCustomFields RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_log_custom_fields"
- RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRatelimit RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_ratelimit"
- RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestCacheSettings RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_cache_settings"
- RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestDynamicRedirect RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_dynamic_redirect"
- RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallCustom RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_custom"
- RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallManaged RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_managed"
- RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestLateTransform RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_late_transform"
- RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestOrigin RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_origin"
- RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestRedirect RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_redirect"
- RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSanitize RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_sanitize"
- RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSbfm RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_sbfm"
- RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSelectConfiguration RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_select_configuration"
- RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestTransform RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_transform"
- RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseCompression RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_response_compression"
- RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseFirewallManaged RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_response_firewall_managed"
- RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseHeadersTransform RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_response_headers_transform"
- RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseMagicTransit RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "magic_transit"
- RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseMagicTransitIDsManaged RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_ids_managed"
- RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseMagicTransitManaged RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_managed"
-)
-
-// The name of a legacy security product to skip the execution of.
-type RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersProduct string
-
-const (
- RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersProductBic RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersProduct = "bic"
- RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersProductHot RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersProduct = "hot"
- RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersProductRateLimit RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersProduct = "rateLimit"
- RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersProductSecurityLevel RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersProduct = "securityLevel"
- RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersProductUABlock RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersProduct = "uaBlock"
- RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersProductWAF RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersProduct = "waf"
- RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersProductZoneLockdown RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersProduct = "zoneLockdown"
-)
-
-// A ruleset to skip the execution of. This option is incompatible with the
-// rulesets, rules and phases options.
-type RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersRuleset string
-
-const (
- RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersRulesetCurrent RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersRuleset = "current"
-)
-
-// An object configuring the rule's logging behavior.
-type RulesetUpdateParamsRulesRulesetsSkipRuleLogging struct {
- // Whether to generate a log when the rule matches.
- Enabled param.Field[bool] `json:"enabled,required"`
-}
-
-func (r RulesetUpdateParamsRulesRulesetsSkipRuleLogging) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The kind of the ruleset.
-type RulesetUpdateParamsKind string
-
-const (
- RulesetUpdateParamsKindManaged RulesetUpdateParamsKind = "managed"
- RulesetUpdateParamsKindCustom RulesetUpdateParamsKind = "custom"
- RulesetUpdateParamsKindRoot RulesetUpdateParamsKind = "root"
- RulesetUpdateParamsKindZone RulesetUpdateParamsKind = "zone"
-)
-
-// The phase of the ruleset.
-type RulesetUpdateParamsPhase string
-
-const (
- RulesetUpdateParamsPhaseDDOSL4 RulesetUpdateParamsPhase = "ddos_l4"
- RulesetUpdateParamsPhaseDDOSL7 RulesetUpdateParamsPhase = "ddos_l7"
- RulesetUpdateParamsPhaseHTTPConfigSettings RulesetUpdateParamsPhase = "http_config_settings"
- RulesetUpdateParamsPhaseHTTPCustomErrors RulesetUpdateParamsPhase = "http_custom_errors"
- RulesetUpdateParamsPhaseHTTPLogCustomFields RulesetUpdateParamsPhase = "http_log_custom_fields"
- RulesetUpdateParamsPhaseHTTPRatelimit RulesetUpdateParamsPhase = "http_ratelimit"
- RulesetUpdateParamsPhaseHTTPRequestCacheSettings RulesetUpdateParamsPhase = "http_request_cache_settings"
- RulesetUpdateParamsPhaseHTTPRequestDynamicRedirect RulesetUpdateParamsPhase = "http_request_dynamic_redirect"
- RulesetUpdateParamsPhaseHTTPRequestFirewallCustom RulesetUpdateParamsPhase = "http_request_firewall_custom"
- RulesetUpdateParamsPhaseHTTPRequestFirewallManaged RulesetUpdateParamsPhase = "http_request_firewall_managed"
- RulesetUpdateParamsPhaseHTTPRequestLateTransform RulesetUpdateParamsPhase = "http_request_late_transform"
- RulesetUpdateParamsPhaseHTTPRequestOrigin RulesetUpdateParamsPhase = "http_request_origin"
- RulesetUpdateParamsPhaseHTTPRequestRedirect RulesetUpdateParamsPhase = "http_request_redirect"
- RulesetUpdateParamsPhaseHTTPRequestSanitize RulesetUpdateParamsPhase = "http_request_sanitize"
- RulesetUpdateParamsPhaseHTTPRequestSbfm RulesetUpdateParamsPhase = "http_request_sbfm"
- RulesetUpdateParamsPhaseHTTPRequestSelectConfiguration RulesetUpdateParamsPhase = "http_request_select_configuration"
- RulesetUpdateParamsPhaseHTTPRequestTransform RulesetUpdateParamsPhase = "http_request_transform"
- RulesetUpdateParamsPhaseHTTPResponseCompression RulesetUpdateParamsPhase = "http_response_compression"
- RulesetUpdateParamsPhaseHTTPResponseFirewallManaged RulesetUpdateParamsPhase = "http_response_firewall_managed"
- RulesetUpdateParamsPhaseHTTPResponseHeadersTransform RulesetUpdateParamsPhase = "http_response_headers_transform"
- RulesetUpdateParamsPhaseMagicTransit RulesetUpdateParamsPhase = "magic_transit"
- RulesetUpdateParamsPhaseMagicTransitIDsManaged RulesetUpdateParamsPhase = "magic_transit_ids_managed"
- RulesetUpdateParamsPhaseMagicTransitManaged RulesetUpdateParamsPhase = "magic_transit_managed"
-)
-
-// A response object.
-type RulesetUpdateResponseEnvelope struct {
- // A list of error messages.
- Errors []RulesetUpdateResponseEnvelopeErrors `json:"errors,required"`
- // A list of warning messages.
- Messages []RulesetUpdateResponseEnvelopeMessages `json:"messages,required"`
- // A result.
- Result RulesetUpdateResponse `json:"result,required"`
- // Whether the API call was successful.
- Success RulesetUpdateResponseEnvelopeSuccess `json:"success,required"`
- JSON rulesetUpdateResponseEnvelopeJSON `json:"-"`
-}
-
-// rulesetUpdateResponseEnvelopeJSON contains the JSON metadata for the struct
-// [RulesetUpdateResponseEnvelope]
-type rulesetUpdateResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetUpdateResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-// A message.
-type RulesetUpdateResponseEnvelopeErrors struct {
- // A text description of this message.
- Message string `json:"message,required"`
- // A unique code for this message.
- Code int64 `json:"code"`
- // The source of this message.
- Source RulesetUpdateResponseEnvelopeErrorsSource `json:"source"`
- JSON rulesetUpdateResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// rulesetUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [RulesetUpdateResponseEnvelopeErrors]
-type rulesetUpdateResponseEnvelopeErrorsJSON struct {
- Message apijson.Field
- Code apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-// The source of this message.
-type RulesetUpdateResponseEnvelopeErrorsSource struct {
- // A JSON pointer to the field that is the source of the message.
- Pointer string `json:"pointer,required"`
- JSON rulesetUpdateResponseEnvelopeErrorsSourceJSON `json:"-"`
-}
-
-// rulesetUpdateResponseEnvelopeErrorsSourceJSON contains the JSON metadata for the
-// struct [RulesetUpdateResponseEnvelopeErrorsSource]
-type rulesetUpdateResponseEnvelopeErrorsSourceJSON struct {
- Pointer apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetUpdateResponseEnvelopeErrorsSource) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetUpdateResponseEnvelopeErrorsSourceJSON) RawJSON() string {
- return r.raw
-}
-
-// A message.
-type RulesetUpdateResponseEnvelopeMessages struct {
- // A text description of this message.
- Message string `json:"message,required"`
- // A unique code for this message.
- Code int64 `json:"code"`
- // The source of this message.
- Source RulesetUpdateResponseEnvelopeMessagesSource `json:"source"`
- JSON rulesetUpdateResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// rulesetUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [RulesetUpdateResponseEnvelopeMessages]
-type rulesetUpdateResponseEnvelopeMessagesJSON struct {
- Message apijson.Field
- Code apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// The source of this message.
-type RulesetUpdateResponseEnvelopeMessagesSource struct {
- // A JSON pointer to the field that is the source of the message.
- Pointer string `json:"pointer,required"`
- JSON rulesetUpdateResponseEnvelopeMessagesSourceJSON `json:"-"`
-}
-
-// rulesetUpdateResponseEnvelopeMessagesSourceJSON contains the JSON metadata for
-// the struct [RulesetUpdateResponseEnvelopeMessagesSource]
-type rulesetUpdateResponseEnvelopeMessagesSourceJSON struct {
- Pointer apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetUpdateResponseEnvelopeMessagesSource) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetUpdateResponseEnvelopeMessagesSourceJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful.
-type RulesetUpdateResponseEnvelopeSuccess bool
-
-const (
- RulesetUpdateResponseEnvelopeSuccessTrue RulesetUpdateResponseEnvelopeSuccess = true
-)
-
-type RulesetListParams struct {
- // The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
- AccountID param.Field[string] `path:"account_id"`
- // The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- ZoneID param.Field[string] `path:"zone_id"`
-}
-
-// A response object.
-type RulesetListResponseEnvelope struct {
- // A list of error messages.
- Errors []RulesetListResponseEnvelopeErrors `json:"errors,required"`
- // A list of warning messages.
- Messages []RulesetListResponseEnvelopeMessages `json:"messages,required"`
- // A result.
- Result []RulesetListResponse `json:"result,required"`
- // Whether the API call was successful.
- Success RulesetListResponseEnvelopeSuccess `json:"success,required"`
- JSON rulesetListResponseEnvelopeJSON `json:"-"`
-}
-
-// rulesetListResponseEnvelopeJSON contains the JSON metadata for the struct
-// [RulesetListResponseEnvelope]
-type rulesetListResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetListResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-// A message.
-type RulesetListResponseEnvelopeErrors struct {
- // A text description of this message.
- Message string `json:"message,required"`
- // A unique code for this message.
- Code int64 `json:"code"`
- // The source of this message.
- Source RulesetListResponseEnvelopeErrorsSource `json:"source"`
- JSON rulesetListResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// rulesetListResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
-// [RulesetListResponseEnvelopeErrors]
-type rulesetListResponseEnvelopeErrorsJSON struct {
- Message apijson.Field
- Code apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetListResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-// The source of this message.
-type RulesetListResponseEnvelopeErrorsSource struct {
- // A JSON pointer to the field that is the source of the message.
- Pointer string `json:"pointer,required"`
- JSON rulesetListResponseEnvelopeErrorsSourceJSON `json:"-"`
-}
-
-// rulesetListResponseEnvelopeErrorsSourceJSON contains the JSON metadata for the
-// struct [RulesetListResponseEnvelopeErrorsSource]
-type rulesetListResponseEnvelopeErrorsSourceJSON struct {
- Pointer apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetListResponseEnvelopeErrorsSource) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetListResponseEnvelopeErrorsSourceJSON) RawJSON() string {
- return r.raw
-}
-
-// A message.
-type RulesetListResponseEnvelopeMessages struct {
- // A text description of this message.
- Message string `json:"message,required"`
- // A unique code for this message.
- Code int64 `json:"code"`
- // The source of this message.
- Source RulesetListResponseEnvelopeMessagesSource `json:"source"`
- JSON rulesetListResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// rulesetListResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [RulesetListResponseEnvelopeMessages]
-type rulesetListResponseEnvelopeMessagesJSON struct {
- Message apijson.Field
- Code apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetListResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// The source of this message.
-type RulesetListResponseEnvelopeMessagesSource struct {
- // A JSON pointer to the field that is the source of the message.
- Pointer string `json:"pointer,required"`
- JSON rulesetListResponseEnvelopeMessagesSourceJSON `json:"-"`
-}
-
-// rulesetListResponseEnvelopeMessagesSourceJSON contains the JSON metadata for the
-// struct [RulesetListResponseEnvelopeMessagesSource]
-type rulesetListResponseEnvelopeMessagesSourceJSON struct {
- Pointer apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetListResponseEnvelopeMessagesSource) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetListResponseEnvelopeMessagesSourceJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful.
-type RulesetListResponseEnvelopeSuccess bool
-
-const (
- RulesetListResponseEnvelopeSuccessTrue RulesetListResponseEnvelopeSuccess = true
-)
-
-type RulesetDeleteParams struct {
- // The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
- AccountID param.Field[string] `path:"account_id"`
- // The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- ZoneID param.Field[string] `path:"zone_id"`
-}
-
-type RulesetGetParams struct {
- // The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
- AccountID param.Field[string] `path:"account_id"`
- // The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- ZoneID param.Field[string] `path:"zone_id"`
-}
-
-// A response object.
-type RulesetGetResponseEnvelope struct {
- // A list of error messages.
- Errors []RulesetGetResponseEnvelopeErrors `json:"errors,required"`
- // A list of warning messages.
- Messages []RulesetGetResponseEnvelopeMessages `json:"messages,required"`
- // A result.
- Result RulesetGetResponse `json:"result,required"`
- // Whether the API call was successful.
- Success RulesetGetResponseEnvelopeSuccess `json:"success,required"`
- JSON rulesetGetResponseEnvelopeJSON `json:"-"`
-}
-
-// rulesetGetResponseEnvelopeJSON contains the JSON metadata for the struct
-// [RulesetGetResponseEnvelope]
-type rulesetGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-// A message.
-type RulesetGetResponseEnvelopeErrors struct {
- // A text description of this message.
- Message string `json:"message,required"`
- // A unique code for this message.
- Code int64 `json:"code"`
- // The source of this message.
- Source RulesetGetResponseEnvelopeErrorsSource `json:"source"`
- JSON rulesetGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// rulesetGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
-// [RulesetGetResponseEnvelopeErrors]
-type rulesetGetResponseEnvelopeErrorsJSON struct {
- Message apijson.Field
- Code apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-// The source of this message.
-type RulesetGetResponseEnvelopeErrorsSource struct {
- // A JSON pointer to the field that is the source of the message.
- Pointer string `json:"pointer,required"`
- JSON rulesetGetResponseEnvelopeErrorsSourceJSON `json:"-"`
-}
-
-// rulesetGetResponseEnvelopeErrorsSourceJSON contains the JSON metadata for the
-// struct [RulesetGetResponseEnvelopeErrorsSource]
-type rulesetGetResponseEnvelopeErrorsSourceJSON struct {
- Pointer apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetGetResponseEnvelopeErrorsSource) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetGetResponseEnvelopeErrorsSourceJSON) RawJSON() string {
- return r.raw
-}
-
-// A message.
-type RulesetGetResponseEnvelopeMessages struct {
- // A text description of this message.
- Message string `json:"message,required"`
- // A unique code for this message.
- Code int64 `json:"code"`
- // The source of this message.
- Source RulesetGetResponseEnvelopeMessagesSource `json:"source"`
- JSON rulesetGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// rulesetGetResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
-// [RulesetGetResponseEnvelopeMessages]
-type rulesetGetResponseEnvelopeMessagesJSON struct {
- Message apijson.Field
- Code apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// The source of this message.
-type RulesetGetResponseEnvelopeMessagesSource struct {
- // A JSON pointer to the field that is the source of the message.
- Pointer string `json:"pointer,required"`
- JSON rulesetGetResponseEnvelopeMessagesSourceJSON `json:"-"`
-}
-
-// rulesetGetResponseEnvelopeMessagesSourceJSON contains the JSON metadata for the
-// struct [RulesetGetResponseEnvelopeMessagesSource]
-type rulesetGetResponseEnvelopeMessagesSourceJSON struct {
- Pointer apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetGetResponseEnvelopeMessagesSource) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetGetResponseEnvelopeMessagesSourceJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful.
-type RulesetGetResponseEnvelopeSuccess bool
-
-const (
- RulesetGetResponseEnvelopeSuccessTrue RulesetGetResponseEnvelopeSuccess = true
-)
diff --git a/ruleset_test.go b/ruleset_test.go
deleted file mode 100644
index 54bb1f6de05..00000000000
--- a/ruleset_test.go
+++ /dev/null
@@ -1,274 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRulesetNewWithOptionalParams(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"),
- )
- _, err := client.Rulesets.New(context.TODO(), cloudflare.RulesetNewParams{
- Kind: cloudflare.F(cloudflare.RulesetNewParamsKindRoot),
- Name: cloudflare.F("My ruleset"),
- Phase: cloudflare.F(cloudflare.RulesetNewParamsPhaseHTTPRequestFirewallCustom),
- Rules: cloudflare.F([]cloudflare.RulesetNewParamsRule{cloudflare.RulesetNewParamsRulesRulesetsBlockRule(cloudflare.RulesetNewParamsRulesRulesetsBlockRule{
- Action: cloudflare.F(cloudflare.RulesetNewParamsRulesRulesetsBlockRuleActionBlock),
- ActionParameters: cloudflare.F(cloudflare.RulesetNewParamsRulesRulesetsBlockRuleActionParameters{
- Response: cloudflare.F(cloudflare.RulesetNewParamsRulesRulesetsBlockRuleActionParametersResponse{
- Content: cloudflare.F("{\n \"success\": false,\n \"error\": \"you have been blocked\"\n}"),
- ContentType: cloudflare.F("application/json"),
- StatusCode: cloudflare.F(int64(400)),
- }),
- }),
- Description: cloudflare.F("Block when the IP address is not 1.1.1.1"),
- Enabled: cloudflare.F(true),
- Expression: cloudflare.F("ip.src ne 1.1.1.1"),
- ID: cloudflare.F("3a03d665bac047339bb530ecb439a90d"),
- Logging: cloudflare.F(cloudflare.RulesetNewParamsRulesRulesetsBlockRuleLogging{
- Enabled: cloudflare.F(true),
- }),
- Ref: cloudflare.F("my_ref"),
- }), cloudflare.RulesetNewParamsRulesRulesetsBlockRule(cloudflare.RulesetNewParamsRulesRulesetsBlockRule{
- Action: cloudflare.F(cloudflare.RulesetNewParamsRulesRulesetsBlockRuleActionBlock),
- ActionParameters: cloudflare.F(cloudflare.RulesetNewParamsRulesRulesetsBlockRuleActionParameters{
- Response: cloudflare.F(cloudflare.RulesetNewParamsRulesRulesetsBlockRuleActionParametersResponse{
- Content: cloudflare.F("{\n \"success\": false,\n \"error\": \"you have been blocked\"\n}"),
- ContentType: cloudflare.F("application/json"),
- StatusCode: cloudflare.F(int64(400)),
- }),
- }),
- Description: cloudflare.F("Block when the IP address is not 1.1.1.1"),
- Enabled: cloudflare.F(true),
- Expression: cloudflare.F("ip.src ne 1.1.1.1"),
- ID: cloudflare.F("3a03d665bac047339bb530ecb439a90d"),
- Logging: cloudflare.F(cloudflare.RulesetNewParamsRulesRulesetsBlockRuleLogging{
- Enabled: cloudflare.F(true),
- }),
- Ref: cloudflare.F("my_ref"),
- }), cloudflare.RulesetNewParamsRulesRulesetsBlockRule(cloudflare.RulesetNewParamsRulesRulesetsBlockRule{
- Action: cloudflare.F(cloudflare.RulesetNewParamsRulesRulesetsBlockRuleActionBlock),
- ActionParameters: cloudflare.F(cloudflare.RulesetNewParamsRulesRulesetsBlockRuleActionParameters{
- Response: cloudflare.F(cloudflare.RulesetNewParamsRulesRulesetsBlockRuleActionParametersResponse{
- Content: cloudflare.F("{\n \"success\": false,\n \"error\": \"you have been blocked\"\n}"),
- ContentType: cloudflare.F("application/json"),
- StatusCode: cloudflare.F(int64(400)),
- }),
- }),
- Description: cloudflare.F("Block when the IP address is not 1.1.1.1"),
- Enabled: cloudflare.F(true),
- Expression: cloudflare.F("ip.src ne 1.1.1.1"),
- ID: cloudflare.F("3a03d665bac047339bb530ecb439a90d"),
- Logging: cloudflare.F(cloudflare.RulesetNewParamsRulesRulesetsBlockRuleLogging{
- Enabled: cloudflare.F(true),
- }),
- Ref: cloudflare.F("my_ref"),
- })}),
- AccountID: cloudflare.F("string"),
- ZoneID: cloudflare.F("string"),
- Description: cloudflare.F("My ruleset to execute managed rulesets"),
- })
- 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())
- }
-}
-
-func TestRulesetUpdateWithOptionalParams(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"),
- )
- _, err := client.Rulesets.Update(
- context.TODO(),
- "2f2feab2026849078ba485f918791bdc",
- cloudflare.RulesetUpdateParams{
- ID: cloudflare.F("2f2feab2026849078ba485f918791bdc"),
- Rules: cloudflare.F([]cloudflare.RulesetUpdateParamsRule{cloudflare.RulesetUpdateParamsRulesRulesetsBlockRule(cloudflare.RulesetUpdateParamsRulesRulesetsBlockRule{
- Action: cloudflare.F(cloudflare.RulesetUpdateParamsRulesRulesetsBlockRuleActionBlock),
- ActionParameters: cloudflare.F(cloudflare.RulesetUpdateParamsRulesRulesetsBlockRuleActionParameters{
- Response: cloudflare.F(cloudflare.RulesetUpdateParamsRulesRulesetsBlockRuleActionParametersResponse{
- Content: cloudflare.F("{\n \"success\": false,\n \"error\": \"you have been blocked\"\n}"),
- ContentType: cloudflare.F("application/json"),
- StatusCode: cloudflare.F(int64(400)),
- }),
- }),
- Description: cloudflare.F("Block when the IP address is not 1.1.1.1"),
- Enabled: cloudflare.F(true),
- Expression: cloudflare.F("ip.src ne 1.1.1.1"),
- ID: cloudflare.F("3a03d665bac047339bb530ecb439a90d"),
- Logging: cloudflare.F(cloudflare.RulesetUpdateParamsRulesRulesetsBlockRuleLogging{
- Enabled: cloudflare.F(true),
- }),
- Ref: cloudflare.F("my_ref"),
- }), cloudflare.RulesetUpdateParamsRulesRulesetsBlockRule(cloudflare.RulesetUpdateParamsRulesRulesetsBlockRule{
- Action: cloudflare.F(cloudflare.RulesetUpdateParamsRulesRulesetsBlockRuleActionBlock),
- ActionParameters: cloudflare.F(cloudflare.RulesetUpdateParamsRulesRulesetsBlockRuleActionParameters{
- Response: cloudflare.F(cloudflare.RulesetUpdateParamsRulesRulesetsBlockRuleActionParametersResponse{
- Content: cloudflare.F("{\n \"success\": false,\n \"error\": \"you have been blocked\"\n}"),
- ContentType: cloudflare.F("application/json"),
- StatusCode: cloudflare.F(int64(400)),
- }),
- }),
- Description: cloudflare.F("Block when the IP address is not 1.1.1.1"),
- Enabled: cloudflare.F(true),
- Expression: cloudflare.F("ip.src ne 1.1.1.1"),
- ID: cloudflare.F("3a03d665bac047339bb530ecb439a90d"),
- Logging: cloudflare.F(cloudflare.RulesetUpdateParamsRulesRulesetsBlockRuleLogging{
- Enabled: cloudflare.F(true),
- }),
- Ref: cloudflare.F("my_ref"),
- }), cloudflare.RulesetUpdateParamsRulesRulesetsBlockRule(cloudflare.RulesetUpdateParamsRulesRulesetsBlockRule{
- Action: cloudflare.F(cloudflare.RulesetUpdateParamsRulesRulesetsBlockRuleActionBlock),
- ActionParameters: cloudflare.F(cloudflare.RulesetUpdateParamsRulesRulesetsBlockRuleActionParameters{
- Response: cloudflare.F(cloudflare.RulesetUpdateParamsRulesRulesetsBlockRuleActionParametersResponse{
- Content: cloudflare.F("{\n \"success\": false,\n \"error\": \"you have been blocked\"\n}"),
- ContentType: cloudflare.F("application/json"),
- StatusCode: cloudflare.F(int64(400)),
- }),
- }),
- Description: cloudflare.F("Block when the IP address is not 1.1.1.1"),
- Enabled: cloudflare.F(true),
- Expression: cloudflare.F("ip.src ne 1.1.1.1"),
- ID: cloudflare.F("3a03d665bac047339bb530ecb439a90d"),
- Logging: cloudflare.F(cloudflare.RulesetUpdateParamsRulesRulesetsBlockRuleLogging{
- Enabled: cloudflare.F(true),
- }),
- Ref: cloudflare.F("my_ref"),
- })}),
- AccountID: cloudflare.F("string"),
- ZoneID: cloudflare.F("string"),
- Description: cloudflare.F("My ruleset to execute managed rulesets"),
- Kind: cloudflare.F(cloudflare.RulesetUpdateParamsKindRoot),
- Name: cloudflare.F("My ruleset"),
- Phase: cloudflare.F(cloudflare.RulesetUpdateParamsPhaseHTTPRequestFirewallCustom),
- },
- )
- 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())
- }
-}
-
-func TestRulesetListWithOptionalParams(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"),
- )
- _, err := client.Rulesets.List(context.TODO(), cloudflare.RulesetListParams{
- AccountID: cloudflare.F("string"),
- ZoneID: cloudflare.F("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())
- }
-}
-
-func TestRulesetDeleteWithOptionalParams(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"),
- )
- err := client.Rulesets.Delete(
- context.TODO(),
- "2f2feab2026849078ba485f918791bdc",
- cloudflare.RulesetDeleteParams{
- AccountID: cloudflare.F("string"),
- ZoneID: cloudflare.F("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())
- }
-}
-
-func TestRulesetGetWithOptionalParams(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"),
- )
- _, err := client.Rulesets.Get(
- context.TODO(),
- "2f2feab2026849078ba485f918791bdc",
- cloudflare.RulesetGetParams{
- AccountID: cloudflare.F("string"),
- ZoneID: cloudflare.F("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/rulesetphase.go b/rulesetphase.go
deleted file mode 100644
index 8abb88d080f..00000000000
--- a/rulesetphase.go
+++ /dev/null
@@ -1,2466 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "reflect"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
- "github.com/tidwall/gjson"
-)
-
-// RulesetPhaseService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewRulesetPhaseService] method
-// instead.
-type RulesetPhaseService struct {
- Options []option.RequestOption
- Versions *RulesetPhaseVersionService
-}
-
-// NewRulesetPhaseService generates a new service that applies the given options to
-// each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewRulesetPhaseService(opts ...option.RequestOption) (r *RulesetPhaseService) {
- r = &RulesetPhaseService{}
- r.Options = opts
- r.Versions = NewRulesetPhaseVersionService(opts...)
- return
-}
-
-// Updates an account or zone entry point ruleset, creating a new version.
-func (r *RulesetPhaseService) Update(ctx context.Context, rulesetPhase RulesetPhaseUpdateParamsRulesetPhase, params RulesetPhaseUpdateParams, opts ...option.RequestOption) (res *RulesetPhaseUpdateResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RulesetPhaseUpdateResponseEnvelope
- var accountOrZone string
- var accountOrZoneID param.Field[string]
- if params.AccountID.Present {
- accountOrZone = "accounts"
- accountOrZoneID = params.AccountID
- } else {
- accountOrZone = "zones"
- accountOrZoneID = params.ZoneID
- }
- path := fmt.Sprintf("%s/%s/rulesets/phases/%v/entrypoint", accountOrZone, accountOrZoneID, rulesetPhase)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Fetches the latest version of the account or zone entry point ruleset for a
-// given phase.
-func (r *RulesetPhaseService) Get(ctx context.Context, rulesetPhase RulesetPhaseGetParamsRulesetPhase, query RulesetPhaseGetParams, opts ...option.RequestOption) (res *RulesetPhaseGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RulesetPhaseGetResponseEnvelope
- var accountOrZone string
- var accountOrZoneID param.Field[string]
- if query.AccountID.Present {
- accountOrZone = "accounts"
- accountOrZoneID = query.AccountID
- } else {
- accountOrZone = "zones"
- accountOrZoneID = query.ZoneID
- }
- path := fmt.Sprintf("%s/%s/rulesets/phases/%v/entrypoint", accountOrZone, accountOrZoneID, rulesetPhase)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// A result.
-type RulesetPhaseUpdateResponse struct {
- // The unique ID of the ruleset.
- ID string `json:"id,required"`
- // The kind of the ruleset.
- Kind RulesetPhaseUpdateResponseKind `json:"kind,required"`
- // The timestamp of when the ruleset was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The human-readable name of the ruleset.
- Name string `json:"name,required"`
- // The phase of the ruleset.
- Phase RulesetPhaseUpdateResponsePhase `json:"phase,required"`
- // The list of rules in the ruleset.
- Rules []RulesetPhaseUpdateResponseRule `json:"rules,required"`
- // The version of the ruleset.
- Version string `json:"version,required"`
- // An informative description of the ruleset.
- Description string `json:"description"`
- JSON rulesetPhaseUpdateResponseJSON `json:"-"`
-}
-
-// rulesetPhaseUpdateResponseJSON contains the JSON metadata for the struct
-// [RulesetPhaseUpdateResponse]
-type rulesetPhaseUpdateResponseJSON struct {
- ID apijson.Field
- Kind apijson.Field
- LastUpdated apijson.Field
- Name apijson.Field
- Phase apijson.Field
- Rules apijson.Field
- Version apijson.Field
- Description apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetPhaseUpdateResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetPhaseUpdateResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// The kind of the ruleset.
-type RulesetPhaseUpdateResponseKind string
-
-const (
- RulesetPhaseUpdateResponseKindManaged RulesetPhaseUpdateResponseKind = "managed"
- RulesetPhaseUpdateResponseKindCustom RulesetPhaseUpdateResponseKind = "custom"
- RulesetPhaseUpdateResponseKindRoot RulesetPhaseUpdateResponseKind = "root"
- RulesetPhaseUpdateResponseKindZone RulesetPhaseUpdateResponseKind = "zone"
-)
-
-// The phase of the ruleset.
-type RulesetPhaseUpdateResponsePhase string
-
-const (
- RulesetPhaseUpdateResponsePhaseDDOSL4 RulesetPhaseUpdateResponsePhase = "ddos_l4"
- RulesetPhaseUpdateResponsePhaseDDOSL7 RulesetPhaseUpdateResponsePhase = "ddos_l7"
- RulesetPhaseUpdateResponsePhaseHTTPConfigSettings RulesetPhaseUpdateResponsePhase = "http_config_settings"
- RulesetPhaseUpdateResponsePhaseHTTPCustomErrors RulesetPhaseUpdateResponsePhase = "http_custom_errors"
- RulesetPhaseUpdateResponsePhaseHTTPLogCustomFields RulesetPhaseUpdateResponsePhase = "http_log_custom_fields"
- RulesetPhaseUpdateResponsePhaseHTTPRatelimit RulesetPhaseUpdateResponsePhase = "http_ratelimit"
- RulesetPhaseUpdateResponsePhaseHTTPRequestCacheSettings RulesetPhaseUpdateResponsePhase = "http_request_cache_settings"
- RulesetPhaseUpdateResponsePhaseHTTPRequestDynamicRedirect RulesetPhaseUpdateResponsePhase = "http_request_dynamic_redirect"
- RulesetPhaseUpdateResponsePhaseHTTPRequestFirewallCustom RulesetPhaseUpdateResponsePhase = "http_request_firewall_custom"
- RulesetPhaseUpdateResponsePhaseHTTPRequestFirewallManaged RulesetPhaseUpdateResponsePhase = "http_request_firewall_managed"
- RulesetPhaseUpdateResponsePhaseHTTPRequestLateTransform RulesetPhaseUpdateResponsePhase = "http_request_late_transform"
- RulesetPhaseUpdateResponsePhaseHTTPRequestOrigin RulesetPhaseUpdateResponsePhase = "http_request_origin"
- RulesetPhaseUpdateResponsePhaseHTTPRequestRedirect RulesetPhaseUpdateResponsePhase = "http_request_redirect"
- RulesetPhaseUpdateResponsePhaseHTTPRequestSanitize RulesetPhaseUpdateResponsePhase = "http_request_sanitize"
- RulesetPhaseUpdateResponsePhaseHTTPRequestSbfm RulesetPhaseUpdateResponsePhase = "http_request_sbfm"
- RulesetPhaseUpdateResponsePhaseHTTPRequestSelectConfiguration RulesetPhaseUpdateResponsePhase = "http_request_select_configuration"
- RulesetPhaseUpdateResponsePhaseHTTPRequestTransform RulesetPhaseUpdateResponsePhase = "http_request_transform"
- RulesetPhaseUpdateResponsePhaseHTTPResponseCompression RulesetPhaseUpdateResponsePhase = "http_response_compression"
- RulesetPhaseUpdateResponsePhaseHTTPResponseFirewallManaged RulesetPhaseUpdateResponsePhase = "http_response_firewall_managed"
- RulesetPhaseUpdateResponsePhaseHTTPResponseHeadersTransform RulesetPhaseUpdateResponsePhase = "http_response_headers_transform"
- RulesetPhaseUpdateResponsePhaseMagicTransit RulesetPhaseUpdateResponsePhase = "magic_transit"
- RulesetPhaseUpdateResponsePhaseMagicTransitIDsManaged RulesetPhaseUpdateResponsePhase = "magic_transit_ids_managed"
- RulesetPhaseUpdateResponsePhaseMagicTransitManaged RulesetPhaseUpdateResponsePhase = "magic_transit_managed"
-)
-
-// Union satisfied by [RulesetPhaseUpdateResponseRulesRulesetsBlockRule],
-// [RulesetPhaseUpdateResponseRulesRulesetsExecuteRule],
-// [RulesetPhaseUpdateResponseRulesRulesetsLogRule] or
-// [RulesetPhaseUpdateResponseRulesRulesetsSkipRule].
-type RulesetPhaseUpdateResponseRule interface {
- implementsRulesetPhaseUpdateResponseRule()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*RulesetPhaseUpdateResponseRule)(nil)).Elem(),
- "action",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(RulesetPhaseUpdateResponseRulesRulesetsBlockRule{}),
- DiscriminatorValue: "block",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(RulesetPhaseUpdateResponseRulesRulesetsExecuteRule{}),
- DiscriminatorValue: "execute",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(RulesetPhaseUpdateResponseRulesRulesetsLogRule{}),
- DiscriminatorValue: "log",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(RulesetPhaseUpdateResponseRulesRulesetsSkipRule{}),
- DiscriminatorValue: "skip",
- },
- )
-}
-
-type RulesetPhaseUpdateResponseRulesRulesetsBlockRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action RulesetPhaseUpdateResponseRulesRulesetsBlockRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters RulesetPhaseUpdateResponseRulesRulesetsBlockRuleActionParameters `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging RulesetPhaseUpdateResponseRulesRulesetsBlockRuleLogging `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON rulesetPhaseUpdateResponseRulesRulesetsBlockRuleJSON `json:"-"`
-}
-
-// rulesetPhaseUpdateResponseRulesRulesetsBlockRuleJSON contains the JSON metadata
-// for the struct [RulesetPhaseUpdateResponseRulesRulesetsBlockRule]
-type rulesetPhaseUpdateResponseRulesRulesetsBlockRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetPhaseUpdateResponseRulesRulesetsBlockRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetPhaseUpdateResponseRulesRulesetsBlockRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r RulesetPhaseUpdateResponseRulesRulesetsBlockRule) implementsRulesetPhaseUpdateResponseRule() {
-}
-
-// The action to perform when the rule matches.
-type RulesetPhaseUpdateResponseRulesRulesetsBlockRuleAction string
-
-const (
- RulesetPhaseUpdateResponseRulesRulesetsBlockRuleActionBlock RulesetPhaseUpdateResponseRulesRulesetsBlockRuleAction = "block"
-)
-
-// The parameters configuring the rule's action.
-type RulesetPhaseUpdateResponseRulesRulesetsBlockRuleActionParameters struct {
- // The response to show when the block is applied.
- Response RulesetPhaseUpdateResponseRulesRulesetsBlockRuleActionParametersResponse `json:"response"`
- JSON rulesetPhaseUpdateResponseRulesRulesetsBlockRuleActionParametersJSON `json:"-"`
-}
-
-// rulesetPhaseUpdateResponseRulesRulesetsBlockRuleActionParametersJSON contains
-// the JSON metadata for the struct
-// [RulesetPhaseUpdateResponseRulesRulesetsBlockRuleActionParameters]
-type rulesetPhaseUpdateResponseRulesRulesetsBlockRuleActionParametersJSON struct {
- Response apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetPhaseUpdateResponseRulesRulesetsBlockRuleActionParameters) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetPhaseUpdateResponseRulesRulesetsBlockRuleActionParametersJSON) RawJSON() string {
- return r.raw
-}
-
-// The response to show when the block is applied.
-type RulesetPhaseUpdateResponseRulesRulesetsBlockRuleActionParametersResponse struct {
- // The content to return.
- Content string `json:"content,required"`
- // The type of the content to return.
- ContentType string `json:"content_type,required"`
- // The status code to return.
- StatusCode int64 `json:"status_code,required"`
- JSON rulesetPhaseUpdateResponseRulesRulesetsBlockRuleActionParametersResponseJSON `json:"-"`
-}
-
-// rulesetPhaseUpdateResponseRulesRulesetsBlockRuleActionParametersResponseJSON
-// contains the JSON metadata for the struct
-// [RulesetPhaseUpdateResponseRulesRulesetsBlockRuleActionParametersResponse]
-type rulesetPhaseUpdateResponseRulesRulesetsBlockRuleActionParametersResponseJSON struct {
- Content apijson.Field
- ContentType apijson.Field
- StatusCode apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetPhaseUpdateResponseRulesRulesetsBlockRuleActionParametersResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetPhaseUpdateResponseRulesRulesetsBlockRuleActionParametersResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// An object configuring the rule's logging behavior.
-type RulesetPhaseUpdateResponseRulesRulesetsBlockRuleLogging struct {
- // Whether to generate a log when the rule matches.
- Enabled bool `json:"enabled,required"`
- JSON rulesetPhaseUpdateResponseRulesRulesetsBlockRuleLoggingJSON `json:"-"`
-}
-
-// rulesetPhaseUpdateResponseRulesRulesetsBlockRuleLoggingJSON contains the JSON
-// metadata for the struct
-// [RulesetPhaseUpdateResponseRulesRulesetsBlockRuleLogging]
-type rulesetPhaseUpdateResponseRulesRulesetsBlockRuleLoggingJSON struct {
- Enabled apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetPhaseUpdateResponseRulesRulesetsBlockRuleLogging) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetPhaseUpdateResponseRulesRulesetsBlockRuleLoggingJSON) RawJSON() string {
- return r.raw
-}
-
-type RulesetPhaseUpdateResponseRulesRulesetsExecuteRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action RulesetPhaseUpdateResponseRulesRulesetsExecuteRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters RulesetPhaseUpdateResponseRulesRulesetsExecuteRuleActionParameters `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging RulesetPhaseUpdateResponseRulesRulesetsExecuteRuleLogging `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON rulesetPhaseUpdateResponseRulesRulesetsExecuteRuleJSON `json:"-"`
-}
-
-// rulesetPhaseUpdateResponseRulesRulesetsExecuteRuleJSON contains the JSON
-// metadata for the struct [RulesetPhaseUpdateResponseRulesRulesetsExecuteRule]
-type rulesetPhaseUpdateResponseRulesRulesetsExecuteRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetPhaseUpdateResponseRulesRulesetsExecuteRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetPhaseUpdateResponseRulesRulesetsExecuteRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r RulesetPhaseUpdateResponseRulesRulesetsExecuteRule) implementsRulesetPhaseUpdateResponseRule() {
-}
-
-// The action to perform when the rule matches.
-type RulesetPhaseUpdateResponseRulesRulesetsExecuteRuleAction string
-
-const (
- RulesetPhaseUpdateResponseRulesRulesetsExecuteRuleActionExecute RulesetPhaseUpdateResponseRulesRulesetsExecuteRuleAction = "execute"
-)
-
-// The parameters configuring the rule's action.
-type RulesetPhaseUpdateResponseRulesRulesetsExecuteRuleActionParameters struct {
- // The ID of the ruleset to execute.
- ID string `json:"id,required"`
- // The configuration to use for matched data logging.
- MatchedData RulesetPhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersMatchedData `json:"matched_data"`
- // A set of overrides to apply to the target ruleset.
- Overrides RulesetPhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverrides `json:"overrides"`
- JSON rulesetPhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersJSON `json:"-"`
-}
-
-// rulesetPhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersJSON contains
-// the JSON metadata for the struct
-// [RulesetPhaseUpdateResponseRulesRulesetsExecuteRuleActionParameters]
-type rulesetPhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersJSON struct {
- ID apijson.Field
- MatchedData apijson.Field
- Overrides apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetPhaseUpdateResponseRulesRulesetsExecuteRuleActionParameters) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetPhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersJSON) RawJSON() string {
- return r.raw
-}
-
-// The configuration to use for matched data logging.
-type RulesetPhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersMatchedData struct {
- // The public key to encrypt matched data logs with.
- PublicKey string `json:"public_key,required"`
- JSON rulesetPhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON `json:"-"`
-}
-
-// rulesetPhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON
-// contains the JSON metadata for the struct
-// [RulesetPhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersMatchedData]
-type rulesetPhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON struct {
- PublicKey apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetPhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersMatchedData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetPhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON) RawJSON() string {
- return r.raw
-}
-
-// A set of overrides to apply to the target ruleset.
-type RulesetPhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverrides struct {
- // An action to override all rules with. This option has lower precedence than rule
- // and category overrides.
- Action string `json:"action"`
- // A list of category-level overrides. This option has the second-highest
- // precedence after rule-level overrides.
- Categories []RulesetPhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory `json:"categories"`
- // Whether to enable execution of all rules. This option has lower precedence than
- // rule and category overrides.
- Enabled bool `json:"enabled"`
- // A list of rule-level overrides. This option has the highest precedence.
- Rules []RulesetPhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRule `json:"rules"`
- // A sensitivity level to set for all rules. This option has lower precedence than
- // rule and category overrides and is only applicable for DDoS phases.
- SensitivityLevel RulesetPhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel `json:"sensitivity_level"`
- JSON rulesetPhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON `json:"-"`
-}
-
-// rulesetPhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON
-// contains the JSON metadata for the struct
-// [RulesetPhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverrides]
-type rulesetPhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON struct {
- Action apijson.Field
- Categories apijson.Field
- Enabled apijson.Field
- Rules apijson.Field
- SensitivityLevel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetPhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverrides) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetPhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON) RawJSON() string {
- return r.raw
-}
-
-// A category-level override
-type RulesetPhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory struct {
- // The name of the category to override.
- Category string `json:"category,required"`
- // The action to override rules in the category with.
- Action string `json:"action"`
- // Whether to enable execution of rules in the category.
- Enabled bool `json:"enabled"`
- // The sensitivity level to use for rules in the category.
- SensitivityLevel RulesetPhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel `json:"sensitivity_level"`
- JSON rulesetPhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON `json:"-"`
-}
-
-// rulesetPhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON
-// contains the JSON metadata for the struct
-// [RulesetPhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory]
-type rulesetPhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON struct {
- Category apijson.Field
- Action apijson.Field
- Enabled apijson.Field
- SensitivityLevel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetPhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetPhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON) RawJSON() string {
- return r.raw
-}
-
-// The sensitivity level to use for rules in the category.
-type RulesetPhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel string
-
-const (
- RulesetPhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault RulesetPhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "default"
- RulesetPhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium RulesetPhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "medium"
- RulesetPhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow RulesetPhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "low"
- RulesetPhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff RulesetPhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "eoff"
-)
-
-// A rule-level override
-type RulesetPhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRule struct {
- // The ID of the rule to override.
- ID string `json:"id,required"`
- // The action to override the rule with.
- Action string `json:"action"`
- // Whether to enable execution of the rule.
- Enabled bool `json:"enabled"`
- // The score threshold to use for the rule.
- ScoreThreshold int64 `json:"score_threshold"`
- // The sensitivity level to use for the rule.
- SensitivityLevel RulesetPhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel `json:"sensitivity_level"`
- JSON rulesetPhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON `json:"-"`
-}
-
-// rulesetPhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON
-// contains the JSON metadata for the struct
-// [RulesetPhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRule]
-type rulesetPhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON struct {
- ID apijson.Field
- Action apijson.Field
- Enabled apijson.Field
- ScoreThreshold apijson.Field
- SensitivityLevel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetPhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetPhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON) RawJSON() string {
- return r.raw
-}
-
-// The sensitivity level to use for the rule.
-type RulesetPhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel string
-
-const (
- RulesetPhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault RulesetPhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "default"
- RulesetPhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium RulesetPhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "medium"
- RulesetPhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelLow RulesetPhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "low"
- RulesetPhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff RulesetPhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "eoff"
-)
-
-// A sensitivity level to set for all rules. This option has lower precedence than
-// rule and category overrides and is only applicable for DDoS phases.
-type RulesetPhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel string
-
-const (
- RulesetPhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelDefault RulesetPhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "default"
- RulesetPhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelMedium RulesetPhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "medium"
- RulesetPhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelLow RulesetPhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "low"
- RulesetPhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelEoff RulesetPhaseUpdateResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "eoff"
-)
-
-// An object configuring the rule's logging behavior.
-type RulesetPhaseUpdateResponseRulesRulesetsExecuteRuleLogging struct {
- // Whether to generate a log when the rule matches.
- Enabled bool `json:"enabled,required"`
- JSON rulesetPhaseUpdateResponseRulesRulesetsExecuteRuleLoggingJSON `json:"-"`
-}
-
-// rulesetPhaseUpdateResponseRulesRulesetsExecuteRuleLoggingJSON contains the JSON
-// metadata for the struct
-// [RulesetPhaseUpdateResponseRulesRulesetsExecuteRuleLogging]
-type rulesetPhaseUpdateResponseRulesRulesetsExecuteRuleLoggingJSON struct {
- Enabled apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetPhaseUpdateResponseRulesRulesetsExecuteRuleLogging) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetPhaseUpdateResponseRulesRulesetsExecuteRuleLoggingJSON) RawJSON() string {
- return r.raw
-}
-
-type RulesetPhaseUpdateResponseRulesRulesetsLogRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action RulesetPhaseUpdateResponseRulesRulesetsLogRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters interface{} `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging RulesetPhaseUpdateResponseRulesRulesetsLogRuleLogging `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON rulesetPhaseUpdateResponseRulesRulesetsLogRuleJSON `json:"-"`
-}
-
-// rulesetPhaseUpdateResponseRulesRulesetsLogRuleJSON contains the JSON metadata
-// for the struct [RulesetPhaseUpdateResponseRulesRulesetsLogRule]
-type rulesetPhaseUpdateResponseRulesRulesetsLogRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetPhaseUpdateResponseRulesRulesetsLogRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetPhaseUpdateResponseRulesRulesetsLogRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r RulesetPhaseUpdateResponseRulesRulesetsLogRule) implementsRulesetPhaseUpdateResponseRule() {}
-
-// The action to perform when the rule matches.
-type RulesetPhaseUpdateResponseRulesRulesetsLogRuleAction string
-
-const (
- RulesetPhaseUpdateResponseRulesRulesetsLogRuleActionLog RulesetPhaseUpdateResponseRulesRulesetsLogRuleAction = "log"
-)
-
-// An object configuring the rule's logging behavior.
-type RulesetPhaseUpdateResponseRulesRulesetsLogRuleLogging struct {
- // Whether to generate a log when the rule matches.
- Enabled bool `json:"enabled,required"`
- JSON rulesetPhaseUpdateResponseRulesRulesetsLogRuleLoggingJSON `json:"-"`
-}
-
-// rulesetPhaseUpdateResponseRulesRulesetsLogRuleLoggingJSON contains the JSON
-// metadata for the struct [RulesetPhaseUpdateResponseRulesRulesetsLogRuleLogging]
-type rulesetPhaseUpdateResponseRulesRulesetsLogRuleLoggingJSON struct {
- Enabled apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetPhaseUpdateResponseRulesRulesetsLogRuleLogging) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetPhaseUpdateResponseRulesRulesetsLogRuleLoggingJSON) RawJSON() string {
- return r.raw
-}
-
-type RulesetPhaseUpdateResponseRulesRulesetsSkipRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action RulesetPhaseUpdateResponseRulesRulesetsSkipRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters RulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParameters `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging RulesetPhaseUpdateResponseRulesRulesetsSkipRuleLogging `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON rulesetPhaseUpdateResponseRulesRulesetsSkipRuleJSON `json:"-"`
-}
-
-// rulesetPhaseUpdateResponseRulesRulesetsSkipRuleJSON contains the JSON metadata
-// for the struct [RulesetPhaseUpdateResponseRulesRulesetsSkipRule]
-type rulesetPhaseUpdateResponseRulesRulesetsSkipRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetPhaseUpdateResponseRulesRulesetsSkipRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetPhaseUpdateResponseRulesRulesetsSkipRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r RulesetPhaseUpdateResponseRulesRulesetsSkipRule) implementsRulesetPhaseUpdateResponseRule() {}
-
-// The action to perform when the rule matches.
-type RulesetPhaseUpdateResponseRulesRulesetsSkipRuleAction string
-
-const (
- RulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionSkip RulesetPhaseUpdateResponseRulesRulesetsSkipRuleAction = "skip"
-)
-
-// The parameters configuring the rule's action.
-type RulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParameters struct {
- // A list of phases to skip the execution of. This option is incompatible with the
- // ruleset and rulesets options.
- Phases []RulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhase `json:"phases"`
- // A list of legacy security products to skip the execution of.
- Products []RulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParametersProduct `json:"products"`
- // A mapping of ruleset IDs to a list of rule IDs in that ruleset to skip the
- // execution of. This option is incompatible with the ruleset option.
- Rules map[string][]string `json:"rules"`
- // A ruleset to skip the execution of. This option is incompatible with the
- // rulesets, rules and phases options.
- Ruleset RulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParametersRuleset `json:"ruleset"`
- // A list of ruleset IDs to skip the execution of. This option is incompatible with
- // the ruleset and phases options.
- Rulesets []string `json:"rulesets"`
- JSON rulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParametersJSON `json:"-"`
-}
-
-// rulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParametersJSON contains the
-// JSON metadata for the struct
-// [RulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParameters]
-type rulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParametersJSON struct {
- Phases apijson.Field
- Products apijson.Field
- Rules apijson.Field
- Ruleset apijson.Field
- Rulesets apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParameters) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParametersJSON) RawJSON() string {
- return r.raw
-}
-
-// A phase to skip the execution of.
-type RulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhase string
-
-const (
- RulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseDDOSL4 RulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "ddos_l4"
- RulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseDDOSL7 RulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "ddos_l7"
- RulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPConfigSettings RulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_config_settings"
- RulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPCustomErrors RulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_custom_errors"
- RulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPLogCustomFields RulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_log_custom_fields"
- RulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRatelimit RulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_ratelimit"
- RulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestCacheSettings RulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_cache_settings"
- RulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestDynamicRedirect RulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_dynamic_redirect"
- RulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallCustom RulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_custom"
- RulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallManaged RulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_managed"
- RulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestLateTransform RulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_late_transform"
- RulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestOrigin RulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_origin"
- RulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestRedirect RulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_redirect"
- RulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSanitize RulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_sanitize"
- RulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSbfm RulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_sbfm"
- RulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSelectConfiguration RulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_select_configuration"
- RulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestTransform RulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_transform"
- RulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseCompression RulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_compression"
- RulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseFirewallManaged RulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_firewall_managed"
- RulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseHeadersTransform RulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_headers_transform"
- RulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransit RulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit"
- RulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitIDsManaged RulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_ids_managed"
- RulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitManaged RulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_managed"
-)
-
-// The name of a legacy security product to skip the execution of.
-type RulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParametersProduct string
-
-const (
- RulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParametersProductBic RulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParametersProduct = "bic"
- RulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParametersProductHot RulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParametersProduct = "hot"
- RulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParametersProductRateLimit RulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParametersProduct = "rateLimit"
- RulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParametersProductSecurityLevel RulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParametersProduct = "securityLevel"
- RulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParametersProductUABlock RulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParametersProduct = "uaBlock"
- RulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParametersProductWAF RulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParametersProduct = "waf"
- RulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParametersProductZoneLockdown RulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParametersProduct = "zoneLockdown"
-)
-
-// A ruleset to skip the execution of. This option is incompatible with the
-// rulesets, rules and phases options.
-type RulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParametersRuleset string
-
-const (
- RulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParametersRulesetCurrent RulesetPhaseUpdateResponseRulesRulesetsSkipRuleActionParametersRuleset = "current"
-)
-
-// An object configuring the rule's logging behavior.
-type RulesetPhaseUpdateResponseRulesRulesetsSkipRuleLogging struct {
- // Whether to generate a log when the rule matches.
- Enabled bool `json:"enabled,required"`
- JSON rulesetPhaseUpdateResponseRulesRulesetsSkipRuleLoggingJSON `json:"-"`
-}
-
-// rulesetPhaseUpdateResponseRulesRulesetsSkipRuleLoggingJSON contains the JSON
-// metadata for the struct [RulesetPhaseUpdateResponseRulesRulesetsSkipRuleLogging]
-type rulesetPhaseUpdateResponseRulesRulesetsSkipRuleLoggingJSON struct {
- Enabled apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetPhaseUpdateResponseRulesRulesetsSkipRuleLogging) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetPhaseUpdateResponseRulesRulesetsSkipRuleLoggingJSON) RawJSON() string {
- return r.raw
-}
-
-// A result.
-type RulesetPhaseGetResponse struct {
- // The unique ID of the ruleset.
- ID string `json:"id,required"`
- // The kind of the ruleset.
- Kind RulesetPhaseGetResponseKind `json:"kind,required"`
- // The timestamp of when the ruleset was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The human-readable name of the ruleset.
- Name string `json:"name,required"`
- // The phase of the ruleset.
- Phase RulesetPhaseGetResponsePhase `json:"phase,required"`
- // The list of rules in the ruleset.
- Rules []RulesetPhaseGetResponseRule `json:"rules,required"`
- // The version of the ruleset.
- Version string `json:"version,required"`
- // An informative description of the ruleset.
- Description string `json:"description"`
- JSON rulesetPhaseGetResponseJSON `json:"-"`
-}
-
-// rulesetPhaseGetResponseJSON contains the JSON metadata for the struct
-// [RulesetPhaseGetResponse]
-type rulesetPhaseGetResponseJSON struct {
- ID apijson.Field
- Kind apijson.Field
- LastUpdated apijson.Field
- Name apijson.Field
- Phase apijson.Field
- Rules apijson.Field
- Version apijson.Field
- Description apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetPhaseGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetPhaseGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// The kind of the ruleset.
-type RulesetPhaseGetResponseKind string
-
-const (
- RulesetPhaseGetResponseKindManaged RulesetPhaseGetResponseKind = "managed"
- RulesetPhaseGetResponseKindCustom RulesetPhaseGetResponseKind = "custom"
- RulesetPhaseGetResponseKindRoot RulesetPhaseGetResponseKind = "root"
- RulesetPhaseGetResponseKindZone RulesetPhaseGetResponseKind = "zone"
-)
-
-// The phase of the ruleset.
-type RulesetPhaseGetResponsePhase string
-
-const (
- RulesetPhaseGetResponsePhaseDDOSL4 RulesetPhaseGetResponsePhase = "ddos_l4"
- RulesetPhaseGetResponsePhaseDDOSL7 RulesetPhaseGetResponsePhase = "ddos_l7"
- RulesetPhaseGetResponsePhaseHTTPConfigSettings RulesetPhaseGetResponsePhase = "http_config_settings"
- RulesetPhaseGetResponsePhaseHTTPCustomErrors RulesetPhaseGetResponsePhase = "http_custom_errors"
- RulesetPhaseGetResponsePhaseHTTPLogCustomFields RulesetPhaseGetResponsePhase = "http_log_custom_fields"
- RulesetPhaseGetResponsePhaseHTTPRatelimit RulesetPhaseGetResponsePhase = "http_ratelimit"
- RulesetPhaseGetResponsePhaseHTTPRequestCacheSettings RulesetPhaseGetResponsePhase = "http_request_cache_settings"
- RulesetPhaseGetResponsePhaseHTTPRequestDynamicRedirect RulesetPhaseGetResponsePhase = "http_request_dynamic_redirect"
- RulesetPhaseGetResponsePhaseHTTPRequestFirewallCustom RulesetPhaseGetResponsePhase = "http_request_firewall_custom"
- RulesetPhaseGetResponsePhaseHTTPRequestFirewallManaged RulesetPhaseGetResponsePhase = "http_request_firewall_managed"
- RulesetPhaseGetResponsePhaseHTTPRequestLateTransform RulesetPhaseGetResponsePhase = "http_request_late_transform"
- RulesetPhaseGetResponsePhaseHTTPRequestOrigin RulesetPhaseGetResponsePhase = "http_request_origin"
- RulesetPhaseGetResponsePhaseHTTPRequestRedirect RulesetPhaseGetResponsePhase = "http_request_redirect"
- RulesetPhaseGetResponsePhaseHTTPRequestSanitize RulesetPhaseGetResponsePhase = "http_request_sanitize"
- RulesetPhaseGetResponsePhaseHTTPRequestSbfm RulesetPhaseGetResponsePhase = "http_request_sbfm"
- RulesetPhaseGetResponsePhaseHTTPRequestSelectConfiguration RulesetPhaseGetResponsePhase = "http_request_select_configuration"
- RulesetPhaseGetResponsePhaseHTTPRequestTransform RulesetPhaseGetResponsePhase = "http_request_transform"
- RulesetPhaseGetResponsePhaseHTTPResponseCompression RulesetPhaseGetResponsePhase = "http_response_compression"
- RulesetPhaseGetResponsePhaseHTTPResponseFirewallManaged RulesetPhaseGetResponsePhase = "http_response_firewall_managed"
- RulesetPhaseGetResponsePhaseHTTPResponseHeadersTransform RulesetPhaseGetResponsePhase = "http_response_headers_transform"
- RulesetPhaseGetResponsePhaseMagicTransit RulesetPhaseGetResponsePhase = "magic_transit"
- RulesetPhaseGetResponsePhaseMagicTransitIDsManaged RulesetPhaseGetResponsePhase = "magic_transit_ids_managed"
- RulesetPhaseGetResponsePhaseMagicTransitManaged RulesetPhaseGetResponsePhase = "magic_transit_managed"
-)
-
-// Union satisfied by [RulesetPhaseGetResponseRulesRulesetsBlockRule],
-// [RulesetPhaseGetResponseRulesRulesetsExecuteRule],
-// [RulesetPhaseGetResponseRulesRulesetsLogRule] or
-// [RulesetPhaseGetResponseRulesRulesetsSkipRule].
-type RulesetPhaseGetResponseRule interface {
- implementsRulesetPhaseGetResponseRule()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*RulesetPhaseGetResponseRule)(nil)).Elem(),
- "action",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(RulesetPhaseGetResponseRulesRulesetsBlockRule{}),
- DiscriminatorValue: "block",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(RulesetPhaseGetResponseRulesRulesetsExecuteRule{}),
- DiscriminatorValue: "execute",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(RulesetPhaseGetResponseRulesRulesetsLogRule{}),
- DiscriminatorValue: "log",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(RulesetPhaseGetResponseRulesRulesetsSkipRule{}),
- DiscriminatorValue: "skip",
- },
- )
-}
-
-type RulesetPhaseGetResponseRulesRulesetsBlockRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action RulesetPhaseGetResponseRulesRulesetsBlockRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters RulesetPhaseGetResponseRulesRulesetsBlockRuleActionParameters `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging RulesetPhaseGetResponseRulesRulesetsBlockRuleLogging `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON rulesetPhaseGetResponseRulesRulesetsBlockRuleJSON `json:"-"`
-}
-
-// rulesetPhaseGetResponseRulesRulesetsBlockRuleJSON contains the JSON metadata for
-// the struct [RulesetPhaseGetResponseRulesRulesetsBlockRule]
-type rulesetPhaseGetResponseRulesRulesetsBlockRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetPhaseGetResponseRulesRulesetsBlockRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetPhaseGetResponseRulesRulesetsBlockRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r RulesetPhaseGetResponseRulesRulesetsBlockRule) implementsRulesetPhaseGetResponseRule() {}
-
-// The action to perform when the rule matches.
-type RulesetPhaseGetResponseRulesRulesetsBlockRuleAction string
-
-const (
- RulesetPhaseGetResponseRulesRulesetsBlockRuleActionBlock RulesetPhaseGetResponseRulesRulesetsBlockRuleAction = "block"
-)
-
-// The parameters configuring the rule's action.
-type RulesetPhaseGetResponseRulesRulesetsBlockRuleActionParameters struct {
- // The response to show when the block is applied.
- Response RulesetPhaseGetResponseRulesRulesetsBlockRuleActionParametersResponse `json:"response"`
- JSON rulesetPhaseGetResponseRulesRulesetsBlockRuleActionParametersJSON `json:"-"`
-}
-
-// rulesetPhaseGetResponseRulesRulesetsBlockRuleActionParametersJSON contains the
-// JSON metadata for the struct
-// [RulesetPhaseGetResponseRulesRulesetsBlockRuleActionParameters]
-type rulesetPhaseGetResponseRulesRulesetsBlockRuleActionParametersJSON struct {
- Response apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetPhaseGetResponseRulesRulesetsBlockRuleActionParameters) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetPhaseGetResponseRulesRulesetsBlockRuleActionParametersJSON) RawJSON() string {
- return r.raw
-}
-
-// The response to show when the block is applied.
-type RulesetPhaseGetResponseRulesRulesetsBlockRuleActionParametersResponse struct {
- // The content to return.
- Content string `json:"content,required"`
- // The type of the content to return.
- ContentType string `json:"content_type,required"`
- // The status code to return.
- StatusCode int64 `json:"status_code,required"`
- JSON rulesetPhaseGetResponseRulesRulesetsBlockRuleActionParametersResponseJSON `json:"-"`
-}
-
-// rulesetPhaseGetResponseRulesRulesetsBlockRuleActionParametersResponseJSON
-// contains the JSON metadata for the struct
-// [RulesetPhaseGetResponseRulesRulesetsBlockRuleActionParametersResponse]
-type rulesetPhaseGetResponseRulesRulesetsBlockRuleActionParametersResponseJSON struct {
- Content apijson.Field
- ContentType apijson.Field
- StatusCode apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetPhaseGetResponseRulesRulesetsBlockRuleActionParametersResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetPhaseGetResponseRulesRulesetsBlockRuleActionParametersResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// An object configuring the rule's logging behavior.
-type RulesetPhaseGetResponseRulesRulesetsBlockRuleLogging struct {
- // Whether to generate a log when the rule matches.
- Enabled bool `json:"enabled,required"`
- JSON rulesetPhaseGetResponseRulesRulesetsBlockRuleLoggingJSON `json:"-"`
-}
-
-// rulesetPhaseGetResponseRulesRulesetsBlockRuleLoggingJSON contains the JSON
-// metadata for the struct [RulesetPhaseGetResponseRulesRulesetsBlockRuleLogging]
-type rulesetPhaseGetResponseRulesRulesetsBlockRuleLoggingJSON struct {
- Enabled apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetPhaseGetResponseRulesRulesetsBlockRuleLogging) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetPhaseGetResponseRulesRulesetsBlockRuleLoggingJSON) RawJSON() string {
- return r.raw
-}
-
-type RulesetPhaseGetResponseRulesRulesetsExecuteRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action RulesetPhaseGetResponseRulesRulesetsExecuteRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters RulesetPhaseGetResponseRulesRulesetsExecuteRuleActionParameters `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging RulesetPhaseGetResponseRulesRulesetsExecuteRuleLogging `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON rulesetPhaseGetResponseRulesRulesetsExecuteRuleJSON `json:"-"`
-}
-
-// rulesetPhaseGetResponseRulesRulesetsExecuteRuleJSON contains the JSON metadata
-// for the struct [RulesetPhaseGetResponseRulesRulesetsExecuteRule]
-type rulesetPhaseGetResponseRulesRulesetsExecuteRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetPhaseGetResponseRulesRulesetsExecuteRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetPhaseGetResponseRulesRulesetsExecuteRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r RulesetPhaseGetResponseRulesRulesetsExecuteRule) implementsRulesetPhaseGetResponseRule() {}
-
-// The action to perform when the rule matches.
-type RulesetPhaseGetResponseRulesRulesetsExecuteRuleAction string
-
-const (
- RulesetPhaseGetResponseRulesRulesetsExecuteRuleActionExecute RulesetPhaseGetResponseRulesRulesetsExecuteRuleAction = "execute"
-)
-
-// The parameters configuring the rule's action.
-type RulesetPhaseGetResponseRulesRulesetsExecuteRuleActionParameters struct {
- // The ID of the ruleset to execute.
- ID string `json:"id,required"`
- // The configuration to use for matched data logging.
- MatchedData RulesetPhaseGetResponseRulesRulesetsExecuteRuleActionParametersMatchedData `json:"matched_data"`
- // A set of overrides to apply to the target ruleset.
- Overrides RulesetPhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverrides `json:"overrides"`
- JSON rulesetPhaseGetResponseRulesRulesetsExecuteRuleActionParametersJSON `json:"-"`
-}
-
-// rulesetPhaseGetResponseRulesRulesetsExecuteRuleActionParametersJSON contains the
-// JSON metadata for the struct
-// [RulesetPhaseGetResponseRulesRulesetsExecuteRuleActionParameters]
-type rulesetPhaseGetResponseRulesRulesetsExecuteRuleActionParametersJSON struct {
- ID apijson.Field
- MatchedData apijson.Field
- Overrides apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetPhaseGetResponseRulesRulesetsExecuteRuleActionParameters) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetPhaseGetResponseRulesRulesetsExecuteRuleActionParametersJSON) RawJSON() string {
- return r.raw
-}
-
-// The configuration to use for matched data logging.
-type RulesetPhaseGetResponseRulesRulesetsExecuteRuleActionParametersMatchedData struct {
- // The public key to encrypt matched data logs with.
- PublicKey string `json:"public_key,required"`
- JSON rulesetPhaseGetResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON `json:"-"`
-}
-
-// rulesetPhaseGetResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON
-// contains the JSON metadata for the struct
-// [RulesetPhaseGetResponseRulesRulesetsExecuteRuleActionParametersMatchedData]
-type rulesetPhaseGetResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON struct {
- PublicKey apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetPhaseGetResponseRulesRulesetsExecuteRuleActionParametersMatchedData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetPhaseGetResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON) RawJSON() string {
- return r.raw
-}
-
-// A set of overrides to apply to the target ruleset.
-type RulesetPhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverrides struct {
- // An action to override all rules with. This option has lower precedence than rule
- // and category overrides.
- Action string `json:"action"`
- // A list of category-level overrides. This option has the second-highest
- // precedence after rule-level overrides.
- Categories []RulesetPhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory `json:"categories"`
- // Whether to enable execution of all rules. This option has lower precedence than
- // rule and category overrides.
- Enabled bool `json:"enabled"`
- // A list of rule-level overrides. This option has the highest precedence.
- Rules []RulesetPhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRule `json:"rules"`
- // A sensitivity level to set for all rules. This option has lower precedence than
- // rule and category overrides and is only applicable for DDoS phases.
- SensitivityLevel RulesetPhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel `json:"sensitivity_level"`
- JSON rulesetPhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON `json:"-"`
-}
-
-// rulesetPhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON
-// contains the JSON metadata for the struct
-// [RulesetPhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverrides]
-type rulesetPhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON struct {
- Action apijson.Field
- Categories apijson.Field
- Enabled apijson.Field
- Rules apijson.Field
- SensitivityLevel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetPhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverrides) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetPhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON) RawJSON() string {
- return r.raw
-}
-
-// A category-level override
-type RulesetPhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory struct {
- // The name of the category to override.
- Category string `json:"category,required"`
- // The action to override rules in the category with.
- Action string `json:"action"`
- // Whether to enable execution of rules in the category.
- Enabled bool `json:"enabled"`
- // The sensitivity level to use for rules in the category.
- SensitivityLevel RulesetPhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel `json:"sensitivity_level"`
- JSON rulesetPhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON `json:"-"`
-}
-
-// rulesetPhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON
-// contains the JSON metadata for the struct
-// [RulesetPhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory]
-type rulesetPhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON struct {
- Category apijson.Field
- Action apijson.Field
- Enabled apijson.Field
- SensitivityLevel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetPhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetPhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON) RawJSON() string {
- return r.raw
-}
-
-// The sensitivity level to use for rules in the category.
-type RulesetPhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel string
-
-const (
- RulesetPhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault RulesetPhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "default"
- RulesetPhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium RulesetPhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "medium"
- RulesetPhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow RulesetPhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "low"
- RulesetPhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff RulesetPhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "eoff"
-)
-
-// A rule-level override
-type RulesetPhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRule struct {
- // The ID of the rule to override.
- ID string `json:"id,required"`
- // The action to override the rule with.
- Action string `json:"action"`
- // Whether to enable execution of the rule.
- Enabled bool `json:"enabled"`
- // The score threshold to use for the rule.
- ScoreThreshold int64 `json:"score_threshold"`
- // The sensitivity level to use for the rule.
- SensitivityLevel RulesetPhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel `json:"sensitivity_level"`
- JSON rulesetPhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON `json:"-"`
-}
-
-// rulesetPhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON
-// contains the JSON metadata for the struct
-// [RulesetPhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRule]
-type rulesetPhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON struct {
- ID apijson.Field
- Action apijson.Field
- Enabled apijson.Field
- ScoreThreshold apijson.Field
- SensitivityLevel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetPhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetPhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON) RawJSON() string {
- return r.raw
-}
-
-// The sensitivity level to use for the rule.
-type RulesetPhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel string
-
-const (
- RulesetPhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault RulesetPhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "default"
- RulesetPhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium RulesetPhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "medium"
- RulesetPhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelLow RulesetPhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "low"
- RulesetPhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff RulesetPhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "eoff"
-)
-
-// A sensitivity level to set for all rules. This option has lower precedence than
-// rule and category overrides and is only applicable for DDoS phases.
-type RulesetPhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel string
-
-const (
- RulesetPhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelDefault RulesetPhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "default"
- RulesetPhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelMedium RulesetPhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "medium"
- RulesetPhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelLow RulesetPhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "low"
- RulesetPhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelEoff RulesetPhaseGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "eoff"
-)
-
-// An object configuring the rule's logging behavior.
-type RulesetPhaseGetResponseRulesRulesetsExecuteRuleLogging struct {
- // Whether to generate a log when the rule matches.
- Enabled bool `json:"enabled,required"`
- JSON rulesetPhaseGetResponseRulesRulesetsExecuteRuleLoggingJSON `json:"-"`
-}
-
-// rulesetPhaseGetResponseRulesRulesetsExecuteRuleLoggingJSON contains the JSON
-// metadata for the struct [RulesetPhaseGetResponseRulesRulesetsExecuteRuleLogging]
-type rulesetPhaseGetResponseRulesRulesetsExecuteRuleLoggingJSON struct {
- Enabled apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetPhaseGetResponseRulesRulesetsExecuteRuleLogging) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetPhaseGetResponseRulesRulesetsExecuteRuleLoggingJSON) RawJSON() string {
- return r.raw
-}
-
-type RulesetPhaseGetResponseRulesRulesetsLogRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action RulesetPhaseGetResponseRulesRulesetsLogRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters interface{} `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging RulesetPhaseGetResponseRulesRulesetsLogRuleLogging `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON rulesetPhaseGetResponseRulesRulesetsLogRuleJSON `json:"-"`
-}
-
-// rulesetPhaseGetResponseRulesRulesetsLogRuleJSON contains the JSON metadata for
-// the struct [RulesetPhaseGetResponseRulesRulesetsLogRule]
-type rulesetPhaseGetResponseRulesRulesetsLogRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetPhaseGetResponseRulesRulesetsLogRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetPhaseGetResponseRulesRulesetsLogRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r RulesetPhaseGetResponseRulesRulesetsLogRule) implementsRulesetPhaseGetResponseRule() {}
-
-// The action to perform when the rule matches.
-type RulesetPhaseGetResponseRulesRulesetsLogRuleAction string
-
-const (
- RulesetPhaseGetResponseRulesRulesetsLogRuleActionLog RulesetPhaseGetResponseRulesRulesetsLogRuleAction = "log"
-)
-
-// An object configuring the rule's logging behavior.
-type RulesetPhaseGetResponseRulesRulesetsLogRuleLogging struct {
- // Whether to generate a log when the rule matches.
- Enabled bool `json:"enabled,required"`
- JSON rulesetPhaseGetResponseRulesRulesetsLogRuleLoggingJSON `json:"-"`
-}
-
-// rulesetPhaseGetResponseRulesRulesetsLogRuleLoggingJSON contains the JSON
-// metadata for the struct [RulesetPhaseGetResponseRulesRulesetsLogRuleLogging]
-type rulesetPhaseGetResponseRulesRulesetsLogRuleLoggingJSON struct {
- Enabled apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetPhaseGetResponseRulesRulesetsLogRuleLogging) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetPhaseGetResponseRulesRulesetsLogRuleLoggingJSON) RawJSON() string {
- return r.raw
-}
-
-type RulesetPhaseGetResponseRulesRulesetsSkipRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action RulesetPhaseGetResponseRulesRulesetsSkipRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters RulesetPhaseGetResponseRulesRulesetsSkipRuleActionParameters `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging RulesetPhaseGetResponseRulesRulesetsSkipRuleLogging `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON rulesetPhaseGetResponseRulesRulesetsSkipRuleJSON `json:"-"`
-}
-
-// rulesetPhaseGetResponseRulesRulesetsSkipRuleJSON contains the JSON metadata for
-// the struct [RulesetPhaseGetResponseRulesRulesetsSkipRule]
-type rulesetPhaseGetResponseRulesRulesetsSkipRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetPhaseGetResponseRulesRulesetsSkipRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetPhaseGetResponseRulesRulesetsSkipRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r RulesetPhaseGetResponseRulesRulesetsSkipRule) implementsRulesetPhaseGetResponseRule() {}
-
-// The action to perform when the rule matches.
-type RulesetPhaseGetResponseRulesRulesetsSkipRuleAction string
-
-const (
- RulesetPhaseGetResponseRulesRulesetsSkipRuleActionSkip RulesetPhaseGetResponseRulesRulesetsSkipRuleAction = "skip"
-)
-
-// The parameters configuring the rule's action.
-type RulesetPhaseGetResponseRulesRulesetsSkipRuleActionParameters struct {
- // A list of phases to skip the execution of. This option is incompatible with the
- // ruleset and rulesets options.
- Phases []RulesetPhaseGetResponseRulesRulesetsSkipRuleActionParametersPhase `json:"phases"`
- // A list of legacy security products to skip the execution of.
- Products []RulesetPhaseGetResponseRulesRulesetsSkipRuleActionParametersProduct `json:"products"`
- // A mapping of ruleset IDs to a list of rule IDs in that ruleset to skip the
- // execution of. This option is incompatible with the ruleset option.
- Rules map[string][]string `json:"rules"`
- // A ruleset to skip the execution of. This option is incompatible with the
- // rulesets, rules and phases options.
- Ruleset RulesetPhaseGetResponseRulesRulesetsSkipRuleActionParametersRuleset `json:"ruleset"`
- // A list of ruleset IDs to skip the execution of. This option is incompatible with
- // the ruleset and phases options.
- Rulesets []string `json:"rulesets"`
- JSON rulesetPhaseGetResponseRulesRulesetsSkipRuleActionParametersJSON `json:"-"`
-}
-
-// rulesetPhaseGetResponseRulesRulesetsSkipRuleActionParametersJSON contains the
-// JSON metadata for the struct
-// [RulesetPhaseGetResponseRulesRulesetsSkipRuleActionParameters]
-type rulesetPhaseGetResponseRulesRulesetsSkipRuleActionParametersJSON struct {
- Phases apijson.Field
- Products apijson.Field
- Rules apijson.Field
- Ruleset apijson.Field
- Rulesets apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetPhaseGetResponseRulesRulesetsSkipRuleActionParameters) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetPhaseGetResponseRulesRulesetsSkipRuleActionParametersJSON) RawJSON() string {
- return r.raw
-}
-
-// A phase to skip the execution of.
-type RulesetPhaseGetResponseRulesRulesetsSkipRuleActionParametersPhase string
-
-const (
- RulesetPhaseGetResponseRulesRulesetsSkipRuleActionParametersPhaseDDOSL4 RulesetPhaseGetResponseRulesRulesetsSkipRuleActionParametersPhase = "ddos_l4"
- RulesetPhaseGetResponseRulesRulesetsSkipRuleActionParametersPhaseDDOSL7 RulesetPhaseGetResponseRulesRulesetsSkipRuleActionParametersPhase = "ddos_l7"
- RulesetPhaseGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPConfigSettings RulesetPhaseGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_config_settings"
- RulesetPhaseGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPCustomErrors RulesetPhaseGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_custom_errors"
- RulesetPhaseGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPLogCustomFields RulesetPhaseGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_log_custom_fields"
- RulesetPhaseGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRatelimit RulesetPhaseGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_ratelimit"
- RulesetPhaseGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestCacheSettings RulesetPhaseGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_cache_settings"
- RulesetPhaseGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestDynamicRedirect RulesetPhaseGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_dynamic_redirect"
- RulesetPhaseGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallCustom RulesetPhaseGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_custom"
- RulesetPhaseGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallManaged RulesetPhaseGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_managed"
- RulesetPhaseGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestLateTransform RulesetPhaseGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_late_transform"
- RulesetPhaseGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestOrigin RulesetPhaseGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_origin"
- RulesetPhaseGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestRedirect RulesetPhaseGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_redirect"
- RulesetPhaseGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSanitize RulesetPhaseGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_sanitize"
- RulesetPhaseGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSbfm RulesetPhaseGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_sbfm"
- RulesetPhaseGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSelectConfiguration RulesetPhaseGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_select_configuration"
- RulesetPhaseGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestTransform RulesetPhaseGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_transform"
- RulesetPhaseGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseCompression RulesetPhaseGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_compression"
- RulesetPhaseGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseFirewallManaged RulesetPhaseGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_firewall_managed"
- RulesetPhaseGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseHeadersTransform RulesetPhaseGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_headers_transform"
- RulesetPhaseGetResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransit RulesetPhaseGetResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit"
- RulesetPhaseGetResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitIDsManaged RulesetPhaseGetResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_ids_managed"
- RulesetPhaseGetResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitManaged RulesetPhaseGetResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_managed"
-)
-
-// The name of a legacy security product to skip the execution of.
-type RulesetPhaseGetResponseRulesRulesetsSkipRuleActionParametersProduct string
-
-const (
- RulesetPhaseGetResponseRulesRulesetsSkipRuleActionParametersProductBic RulesetPhaseGetResponseRulesRulesetsSkipRuleActionParametersProduct = "bic"
- RulesetPhaseGetResponseRulesRulesetsSkipRuleActionParametersProductHot RulesetPhaseGetResponseRulesRulesetsSkipRuleActionParametersProduct = "hot"
- RulesetPhaseGetResponseRulesRulesetsSkipRuleActionParametersProductRateLimit RulesetPhaseGetResponseRulesRulesetsSkipRuleActionParametersProduct = "rateLimit"
- RulesetPhaseGetResponseRulesRulesetsSkipRuleActionParametersProductSecurityLevel RulesetPhaseGetResponseRulesRulesetsSkipRuleActionParametersProduct = "securityLevel"
- RulesetPhaseGetResponseRulesRulesetsSkipRuleActionParametersProductUABlock RulesetPhaseGetResponseRulesRulesetsSkipRuleActionParametersProduct = "uaBlock"
- RulesetPhaseGetResponseRulesRulesetsSkipRuleActionParametersProductWAF RulesetPhaseGetResponseRulesRulesetsSkipRuleActionParametersProduct = "waf"
- RulesetPhaseGetResponseRulesRulesetsSkipRuleActionParametersProductZoneLockdown RulesetPhaseGetResponseRulesRulesetsSkipRuleActionParametersProduct = "zoneLockdown"
-)
-
-// A ruleset to skip the execution of. This option is incompatible with the
-// rulesets, rules and phases options.
-type RulesetPhaseGetResponseRulesRulesetsSkipRuleActionParametersRuleset string
-
-const (
- RulesetPhaseGetResponseRulesRulesetsSkipRuleActionParametersRulesetCurrent RulesetPhaseGetResponseRulesRulesetsSkipRuleActionParametersRuleset = "current"
-)
-
-// An object configuring the rule's logging behavior.
-type RulesetPhaseGetResponseRulesRulesetsSkipRuleLogging struct {
- // Whether to generate a log when the rule matches.
- Enabled bool `json:"enabled,required"`
- JSON rulesetPhaseGetResponseRulesRulesetsSkipRuleLoggingJSON `json:"-"`
-}
-
-// rulesetPhaseGetResponseRulesRulesetsSkipRuleLoggingJSON contains the JSON
-// metadata for the struct [RulesetPhaseGetResponseRulesRulesetsSkipRuleLogging]
-type rulesetPhaseGetResponseRulesRulesetsSkipRuleLoggingJSON struct {
- Enabled apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetPhaseGetResponseRulesRulesetsSkipRuleLogging) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetPhaseGetResponseRulesRulesetsSkipRuleLoggingJSON) RawJSON() string {
- return r.raw
-}
-
-type RulesetPhaseUpdateParams struct {
- // The unique ID of the ruleset.
- ID param.Field[string] `json:"id,required"`
- // The list of rules in the ruleset.
- Rules param.Field[[]RulesetPhaseUpdateParamsRule] `json:"rules,required"`
- // The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
- AccountID param.Field[string] `path:"account_id"`
- // The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- ZoneID param.Field[string] `path:"zone_id"`
- // An informative description of the ruleset.
- Description param.Field[string] `json:"description"`
- // The kind of the ruleset.
- Kind param.Field[RulesetPhaseUpdateParamsKind] `json:"kind"`
- // The human-readable name of the ruleset.
- Name param.Field[string] `json:"name"`
- // The phase of the ruleset.
- Phase param.Field[RulesetPhaseUpdateParamsPhase] `json:"phase"`
-}
-
-func (r RulesetPhaseUpdateParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The phase of the ruleset.
-type RulesetPhaseUpdateParamsRulesetPhase string
-
-const (
- RulesetPhaseUpdateParamsRulesetPhaseDDOSL4 RulesetPhaseUpdateParamsRulesetPhase = "ddos_l4"
- RulesetPhaseUpdateParamsRulesetPhaseDDOSL7 RulesetPhaseUpdateParamsRulesetPhase = "ddos_l7"
- RulesetPhaseUpdateParamsRulesetPhaseHTTPConfigSettings RulesetPhaseUpdateParamsRulesetPhase = "http_config_settings"
- RulesetPhaseUpdateParamsRulesetPhaseHTTPCustomErrors RulesetPhaseUpdateParamsRulesetPhase = "http_custom_errors"
- RulesetPhaseUpdateParamsRulesetPhaseHTTPLogCustomFields RulesetPhaseUpdateParamsRulesetPhase = "http_log_custom_fields"
- RulesetPhaseUpdateParamsRulesetPhaseHTTPRatelimit RulesetPhaseUpdateParamsRulesetPhase = "http_ratelimit"
- RulesetPhaseUpdateParamsRulesetPhaseHTTPRequestCacheSettings RulesetPhaseUpdateParamsRulesetPhase = "http_request_cache_settings"
- RulesetPhaseUpdateParamsRulesetPhaseHTTPRequestDynamicRedirect RulesetPhaseUpdateParamsRulesetPhase = "http_request_dynamic_redirect"
- RulesetPhaseUpdateParamsRulesetPhaseHTTPRequestFirewallCustom RulesetPhaseUpdateParamsRulesetPhase = "http_request_firewall_custom"
- RulesetPhaseUpdateParamsRulesetPhaseHTTPRequestFirewallManaged RulesetPhaseUpdateParamsRulesetPhase = "http_request_firewall_managed"
- RulesetPhaseUpdateParamsRulesetPhaseHTTPRequestLateTransform RulesetPhaseUpdateParamsRulesetPhase = "http_request_late_transform"
- RulesetPhaseUpdateParamsRulesetPhaseHTTPRequestOrigin RulesetPhaseUpdateParamsRulesetPhase = "http_request_origin"
- RulesetPhaseUpdateParamsRulesetPhaseHTTPRequestRedirect RulesetPhaseUpdateParamsRulesetPhase = "http_request_redirect"
- RulesetPhaseUpdateParamsRulesetPhaseHTTPRequestSanitize RulesetPhaseUpdateParamsRulesetPhase = "http_request_sanitize"
- RulesetPhaseUpdateParamsRulesetPhaseHTTPRequestSbfm RulesetPhaseUpdateParamsRulesetPhase = "http_request_sbfm"
- RulesetPhaseUpdateParamsRulesetPhaseHTTPRequestSelectConfiguration RulesetPhaseUpdateParamsRulesetPhase = "http_request_select_configuration"
- RulesetPhaseUpdateParamsRulesetPhaseHTTPRequestTransform RulesetPhaseUpdateParamsRulesetPhase = "http_request_transform"
- RulesetPhaseUpdateParamsRulesetPhaseHTTPResponseCompression RulesetPhaseUpdateParamsRulesetPhase = "http_response_compression"
- RulesetPhaseUpdateParamsRulesetPhaseHTTPResponseFirewallManaged RulesetPhaseUpdateParamsRulesetPhase = "http_response_firewall_managed"
- RulesetPhaseUpdateParamsRulesetPhaseHTTPResponseHeadersTransform RulesetPhaseUpdateParamsRulesetPhase = "http_response_headers_transform"
- RulesetPhaseUpdateParamsRulesetPhaseMagicTransit RulesetPhaseUpdateParamsRulesetPhase = "magic_transit"
- RulesetPhaseUpdateParamsRulesetPhaseMagicTransitIDsManaged RulesetPhaseUpdateParamsRulesetPhase = "magic_transit_ids_managed"
- RulesetPhaseUpdateParamsRulesetPhaseMagicTransitManaged RulesetPhaseUpdateParamsRulesetPhase = "magic_transit_managed"
-)
-
-// Satisfied by [RulesetPhaseUpdateParamsRulesRulesetsBlockRule],
-// [RulesetPhaseUpdateParamsRulesRulesetsExecuteRule],
-// [RulesetPhaseUpdateParamsRulesRulesetsLogRule],
-// [RulesetPhaseUpdateParamsRulesRulesetsSkipRule].
-type RulesetPhaseUpdateParamsRule interface {
- implementsRulesetPhaseUpdateParamsRule()
-}
-
-type RulesetPhaseUpdateParamsRulesRulesetsBlockRule struct {
- // The unique ID of the rule.
- ID param.Field[string] `json:"id"`
- // The action to perform when the rule matches.
- Action param.Field[RulesetPhaseUpdateParamsRulesRulesetsBlockRuleAction] `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters param.Field[RulesetPhaseUpdateParamsRulesRulesetsBlockRuleActionParameters] `json:"action_parameters"`
- // An informative description of the rule.
- Description param.Field[string] `json:"description"`
- // Whether the rule should be executed.
- Enabled param.Field[bool] `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression param.Field[string] `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging param.Field[RulesetPhaseUpdateParamsRulesRulesetsBlockRuleLogging] `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref param.Field[string] `json:"ref"`
-}
-
-func (r RulesetPhaseUpdateParamsRulesRulesetsBlockRule) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-func (r RulesetPhaseUpdateParamsRulesRulesetsBlockRule) implementsRulesetPhaseUpdateParamsRule() {}
-
-// The action to perform when the rule matches.
-type RulesetPhaseUpdateParamsRulesRulesetsBlockRuleAction string
-
-const (
- RulesetPhaseUpdateParamsRulesRulesetsBlockRuleActionBlock RulesetPhaseUpdateParamsRulesRulesetsBlockRuleAction = "block"
-)
-
-// The parameters configuring the rule's action.
-type RulesetPhaseUpdateParamsRulesRulesetsBlockRuleActionParameters struct {
- // The response to show when the block is applied.
- Response param.Field[RulesetPhaseUpdateParamsRulesRulesetsBlockRuleActionParametersResponse] `json:"response"`
-}
-
-func (r RulesetPhaseUpdateParamsRulesRulesetsBlockRuleActionParameters) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The response to show when the block is applied.
-type RulesetPhaseUpdateParamsRulesRulesetsBlockRuleActionParametersResponse struct {
- // The content to return.
- Content param.Field[string] `json:"content,required"`
- // The type of the content to return.
- ContentType param.Field[string] `json:"content_type,required"`
- // The status code to return.
- StatusCode param.Field[int64] `json:"status_code,required"`
-}
-
-func (r RulesetPhaseUpdateParamsRulesRulesetsBlockRuleActionParametersResponse) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// An object configuring the rule's logging behavior.
-type RulesetPhaseUpdateParamsRulesRulesetsBlockRuleLogging struct {
- // Whether to generate a log when the rule matches.
- Enabled param.Field[bool] `json:"enabled,required"`
-}
-
-func (r RulesetPhaseUpdateParamsRulesRulesetsBlockRuleLogging) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type RulesetPhaseUpdateParamsRulesRulesetsExecuteRule struct {
- // The unique ID of the rule.
- ID param.Field[string] `json:"id"`
- // The action to perform when the rule matches.
- Action param.Field[RulesetPhaseUpdateParamsRulesRulesetsExecuteRuleAction] `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters param.Field[RulesetPhaseUpdateParamsRulesRulesetsExecuteRuleActionParameters] `json:"action_parameters"`
- // An informative description of the rule.
- Description param.Field[string] `json:"description"`
- // Whether the rule should be executed.
- Enabled param.Field[bool] `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression param.Field[string] `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging param.Field[RulesetPhaseUpdateParamsRulesRulesetsExecuteRuleLogging] `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref param.Field[string] `json:"ref"`
-}
-
-func (r RulesetPhaseUpdateParamsRulesRulesetsExecuteRule) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-func (r RulesetPhaseUpdateParamsRulesRulesetsExecuteRule) implementsRulesetPhaseUpdateParamsRule() {}
-
-// The action to perform when the rule matches.
-type RulesetPhaseUpdateParamsRulesRulesetsExecuteRuleAction string
-
-const (
- RulesetPhaseUpdateParamsRulesRulesetsExecuteRuleActionExecute RulesetPhaseUpdateParamsRulesRulesetsExecuteRuleAction = "execute"
-)
-
-// The parameters configuring the rule's action.
-type RulesetPhaseUpdateParamsRulesRulesetsExecuteRuleActionParameters struct {
- // The ID of the ruleset to execute.
- ID param.Field[string] `json:"id,required"`
- // The configuration to use for matched data logging.
- MatchedData param.Field[RulesetPhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersMatchedData] `json:"matched_data"`
- // A set of overrides to apply to the target ruleset.
- Overrides param.Field[RulesetPhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverrides] `json:"overrides"`
-}
-
-func (r RulesetPhaseUpdateParamsRulesRulesetsExecuteRuleActionParameters) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The configuration to use for matched data logging.
-type RulesetPhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersMatchedData struct {
- // The public key to encrypt matched data logs with.
- PublicKey param.Field[string] `json:"public_key,required"`
-}
-
-func (r RulesetPhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersMatchedData) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// A set of overrides to apply to the target ruleset.
-type RulesetPhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverrides struct {
- // An action to override all rules with. This option has lower precedence than rule
- // and category overrides.
- Action param.Field[string] `json:"action"`
- // A list of category-level overrides. This option has the second-highest
- // precedence after rule-level overrides.
- Categories param.Field[[]RulesetPhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategory] `json:"categories"`
- // Whether to enable execution of all rules. This option has lower precedence than
- // rule and category overrides.
- Enabled param.Field[bool] `json:"enabled"`
- // A list of rule-level overrides. This option has the highest precedence.
- Rules param.Field[[]RulesetPhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRule] `json:"rules"`
- // A sensitivity level to set for all rules. This option has lower precedence than
- // rule and category overrides and is only applicable for DDoS phases.
- SensitivityLevel param.Field[RulesetPhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel] `json:"sensitivity_level"`
-}
-
-func (r RulesetPhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverrides) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// A category-level override
-type RulesetPhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategory struct {
- // The name of the category to override.
- Category param.Field[string] `json:"category,required"`
- // The action to override rules in the category with.
- Action param.Field[string] `json:"action"`
- // Whether to enable execution of rules in the category.
- Enabled param.Field[bool] `json:"enabled"`
- // The sensitivity level to use for rules in the category.
- SensitivityLevel param.Field[RulesetPhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel] `json:"sensitivity_level"`
-}
-
-func (r RulesetPhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategory) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The sensitivity level to use for rules in the category.
-type RulesetPhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel string
-
-const (
- RulesetPhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault RulesetPhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "default"
- RulesetPhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium RulesetPhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "medium"
- RulesetPhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow RulesetPhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "low"
- RulesetPhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff RulesetPhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "eoff"
-)
-
-// A rule-level override
-type RulesetPhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRule struct {
- // The ID of the rule to override.
- ID param.Field[string] `json:"id,required"`
- // The action to override the rule with.
- Action param.Field[string] `json:"action"`
- // Whether to enable execution of the rule.
- Enabled param.Field[bool] `json:"enabled"`
- // The score threshold to use for the rule.
- ScoreThreshold param.Field[int64] `json:"score_threshold"`
- // The sensitivity level to use for the rule.
- SensitivityLevel param.Field[RulesetPhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel] `json:"sensitivity_level"`
-}
-
-func (r RulesetPhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRule) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The sensitivity level to use for the rule.
-type RulesetPhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel string
-
-const (
- RulesetPhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault RulesetPhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "default"
- RulesetPhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium RulesetPhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "medium"
- RulesetPhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelLow RulesetPhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "low"
- RulesetPhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff RulesetPhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "eoff"
-)
-
-// A sensitivity level to set for all rules. This option has lower precedence than
-// rule and category overrides and is only applicable for DDoS phases.
-type RulesetPhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel string
-
-const (
- RulesetPhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelDefault RulesetPhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "default"
- RulesetPhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelMedium RulesetPhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "medium"
- RulesetPhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelLow RulesetPhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "low"
- RulesetPhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelEoff RulesetPhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "eoff"
-)
-
-// An object configuring the rule's logging behavior.
-type RulesetPhaseUpdateParamsRulesRulesetsExecuteRuleLogging struct {
- // Whether to generate a log when the rule matches.
- Enabled param.Field[bool] `json:"enabled,required"`
-}
-
-func (r RulesetPhaseUpdateParamsRulesRulesetsExecuteRuleLogging) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type RulesetPhaseUpdateParamsRulesRulesetsLogRule struct {
- // The unique ID of the rule.
- ID param.Field[string] `json:"id"`
- // The action to perform when the rule matches.
- Action param.Field[RulesetPhaseUpdateParamsRulesRulesetsLogRuleAction] `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters param.Field[interface{}] `json:"action_parameters"`
- // An informative description of the rule.
- Description param.Field[string] `json:"description"`
- // Whether the rule should be executed.
- Enabled param.Field[bool] `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression param.Field[string] `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging param.Field[RulesetPhaseUpdateParamsRulesRulesetsLogRuleLogging] `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref param.Field[string] `json:"ref"`
-}
-
-func (r RulesetPhaseUpdateParamsRulesRulesetsLogRule) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-func (r RulesetPhaseUpdateParamsRulesRulesetsLogRule) implementsRulesetPhaseUpdateParamsRule() {}
-
-// The action to perform when the rule matches.
-type RulesetPhaseUpdateParamsRulesRulesetsLogRuleAction string
-
-const (
- RulesetPhaseUpdateParamsRulesRulesetsLogRuleActionLog RulesetPhaseUpdateParamsRulesRulesetsLogRuleAction = "log"
-)
-
-// An object configuring the rule's logging behavior.
-type RulesetPhaseUpdateParamsRulesRulesetsLogRuleLogging struct {
- // Whether to generate a log when the rule matches.
- Enabled param.Field[bool] `json:"enabled,required"`
-}
-
-func (r RulesetPhaseUpdateParamsRulesRulesetsLogRuleLogging) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type RulesetPhaseUpdateParamsRulesRulesetsSkipRule struct {
- // The unique ID of the rule.
- ID param.Field[string] `json:"id"`
- // The action to perform when the rule matches.
- Action param.Field[RulesetPhaseUpdateParamsRulesRulesetsSkipRuleAction] `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters param.Field[RulesetPhaseUpdateParamsRulesRulesetsSkipRuleActionParameters] `json:"action_parameters"`
- // An informative description of the rule.
- Description param.Field[string] `json:"description"`
- // Whether the rule should be executed.
- Enabled param.Field[bool] `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression param.Field[string] `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging param.Field[RulesetPhaseUpdateParamsRulesRulesetsSkipRuleLogging] `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref param.Field[string] `json:"ref"`
-}
-
-func (r RulesetPhaseUpdateParamsRulesRulesetsSkipRule) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-func (r RulesetPhaseUpdateParamsRulesRulesetsSkipRule) implementsRulesetPhaseUpdateParamsRule() {}
-
-// The action to perform when the rule matches.
-type RulesetPhaseUpdateParamsRulesRulesetsSkipRuleAction string
-
-const (
- RulesetPhaseUpdateParamsRulesRulesetsSkipRuleActionSkip RulesetPhaseUpdateParamsRulesRulesetsSkipRuleAction = "skip"
-)
-
-// The parameters configuring the rule's action.
-type RulesetPhaseUpdateParamsRulesRulesetsSkipRuleActionParameters struct {
- // A list of phases to skip the execution of. This option is incompatible with the
- // ruleset and rulesets options.
- Phases param.Field[[]RulesetPhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase] `json:"phases"`
- // A list of legacy security products to skip the execution of.
- Products param.Field[[]RulesetPhaseUpdateParamsRulesRulesetsSkipRuleActionParametersProduct] `json:"products"`
- // A mapping of ruleset IDs to a list of rule IDs in that ruleset to skip the
- // execution of. This option is incompatible with the ruleset option.
- Rules param.Field[map[string][]string] `json:"rules"`
- // A ruleset to skip the execution of. This option is incompatible with the
- // rulesets, rules and phases options.
- Ruleset param.Field[RulesetPhaseUpdateParamsRulesRulesetsSkipRuleActionParametersRuleset] `json:"ruleset"`
- // A list of ruleset IDs to skip the execution of. This option is incompatible with
- // the ruleset and phases options.
- Rulesets param.Field[[]string] `json:"rulesets"`
-}
-
-func (r RulesetPhaseUpdateParamsRulesRulesetsSkipRuleActionParameters) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// A phase to skip the execution of.
-type RulesetPhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase string
-
-const (
- RulesetPhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseDDOSL4 RulesetPhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "ddos_l4"
- RulesetPhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseDDOSL7 RulesetPhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "ddos_l7"
- RulesetPhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPConfigSettings RulesetPhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_config_settings"
- RulesetPhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPCustomErrors RulesetPhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_custom_errors"
- RulesetPhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPLogCustomFields RulesetPhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_log_custom_fields"
- RulesetPhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRatelimit RulesetPhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_ratelimit"
- RulesetPhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestCacheSettings RulesetPhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_cache_settings"
- RulesetPhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestDynamicRedirect RulesetPhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_dynamic_redirect"
- RulesetPhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallCustom RulesetPhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_custom"
- RulesetPhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallManaged RulesetPhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_managed"
- RulesetPhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestLateTransform RulesetPhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_late_transform"
- RulesetPhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestOrigin RulesetPhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_origin"
- RulesetPhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestRedirect RulesetPhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_redirect"
- RulesetPhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSanitize RulesetPhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_sanitize"
- RulesetPhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSbfm RulesetPhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_sbfm"
- RulesetPhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSelectConfiguration RulesetPhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_select_configuration"
- RulesetPhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestTransform RulesetPhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_transform"
- RulesetPhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseCompression RulesetPhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_response_compression"
- RulesetPhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseFirewallManaged RulesetPhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_response_firewall_managed"
- RulesetPhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseHeadersTransform RulesetPhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_response_headers_transform"
- RulesetPhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseMagicTransit RulesetPhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "magic_transit"
- RulesetPhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseMagicTransitIDsManaged RulesetPhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_ids_managed"
- RulesetPhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseMagicTransitManaged RulesetPhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_managed"
-)
-
-// The name of a legacy security product to skip the execution of.
-type RulesetPhaseUpdateParamsRulesRulesetsSkipRuleActionParametersProduct string
-
-const (
- RulesetPhaseUpdateParamsRulesRulesetsSkipRuleActionParametersProductBic RulesetPhaseUpdateParamsRulesRulesetsSkipRuleActionParametersProduct = "bic"
- RulesetPhaseUpdateParamsRulesRulesetsSkipRuleActionParametersProductHot RulesetPhaseUpdateParamsRulesRulesetsSkipRuleActionParametersProduct = "hot"
- RulesetPhaseUpdateParamsRulesRulesetsSkipRuleActionParametersProductRateLimit RulesetPhaseUpdateParamsRulesRulesetsSkipRuleActionParametersProduct = "rateLimit"
- RulesetPhaseUpdateParamsRulesRulesetsSkipRuleActionParametersProductSecurityLevel RulesetPhaseUpdateParamsRulesRulesetsSkipRuleActionParametersProduct = "securityLevel"
- RulesetPhaseUpdateParamsRulesRulesetsSkipRuleActionParametersProductUABlock RulesetPhaseUpdateParamsRulesRulesetsSkipRuleActionParametersProduct = "uaBlock"
- RulesetPhaseUpdateParamsRulesRulesetsSkipRuleActionParametersProductWAF RulesetPhaseUpdateParamsRulesRulesetsSkipRuleActionParametersProduct = "waf"
- RulesetPhaseUpdateParamsRulesRulesetsSkipRuleActionParametersProductZoneLockdown RulesetPhaseUpdateParamsRulesRulesetsSkipRuleActionParametersProduct = "zoneLockdown"
-)
-
-// A ruleset to skip the execution of. This option is incompatible with the
-// rulesets, rules and phases options.
-type RulesetPhaseUpdateParamsRulesRulesetsSkipRuleActionParametersRuleset string
-
-const (
- RulesetPhaseUpdateParamsRulesRulesetsSkipRuleActionParametersRulesetCurrent RulesetPhaseUpdateParamsRulesRulesetsSkipRuleActionParametersRuleset = "current"
-)
-
-// An object configuring the rule's logging behavior.
-type RulesetPhaseUpdateParamsRulesRulesetsSkipRuleLogging struct {
- // Whether to generate a log when the rule matches.
- Enabled param.Field[bool] `json:"enabled,required"`
-}
-
-func (r RulesetPhaseUpdateParamsRulesRulesetsSkipRuleLogging) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The kind of the ruleset.
-type RulesetPhaseUpdateParamsKind string
-
-const (
- RulesetPhaseUpdateParamsKindManaged RulesetPhaseUpdateParamsKind = "managed"
- RulesetPhaseUpdateParamsKindCustom RulesetPhaseUpdateParamsKind = "custom"
- RulesetPhaseUpdateParamsKindRoot RulesetPhaseUpdateParamsKind = "root"
- RulesetPhaseUpdateParamsKindZone RulesetPhaseUpdateParamsKind = "zone"
-)
-
-// The phase of the ruleset.
-type RulesetPhaseUpdateParamsPhase string
-
-const (
- RulesetPhaseUpdateParamsPhaseDDOSL4 RulesetPhaseUpdateParamsPhase = "ddos_l4"
- RulesetPhaseUpdateParamsPhaseDDOSL7 RulesetPhaseUpdateParamsPhase = "ddos_l7"
- RulesetPhaseUpdateParamsPhaseHTTPConfigSettings RulesetPhaseUpdateParamsPhase = "http_config_settings"
- RulesetPhaseUpdateParamsPhaseHTTPCustomErrors RulesetPhaseUpdateParamsPhase = "http_custom_errors"
- RulesetPhaseUpdateParamsPhaseHTTPLogCustomFields RulesetPhaseUpdateParamsPhase = "http_log_custom_fields"
- RulesetPhaseUpdateParamsPhaseHTTPRatelimit RulesetPhaseUpdateParamsPhase = "http_ratelimit"
- RulesetPhaseUpdateParamsPhaseHTTPRequestCacheSettings RulesetPhaseUpdateParamsPhase = "http_request_cache_settings"
- RulesetPhaseUpdateParamsPhaseHTTPRequestDynamicRedirect RulesetPhaseUpdateParamsPhase = "http_request_dynamic_redirect"
- RulesetPhaseUpdateParamsPhaseHTTPRequestFirewallCustom RulesetPhaseUpdateParamsPhase = "http_request_firewall_custom"
- RulesetPhaseUpdateParamsPhaseHTTPRequestFirewallManaged RulesetPhaseUpdateParamsPhase = "http_request_firewall_managed"
- RulesetPhaseUpdateParamsPhaseHTTPRequestLateTransform RulesetPhaseUpdateParamsPhase = "http_request_late_transform"
- RulesetPhaseUpdateParamsPhaseHTTPRequestOrigin RulesetPhaseUpdateParamsPhase = "http_request_origin"
- RulesetPhaseUpdateParamsPhaseHTTPRequestRedirect RulesetPhaseUpdateParamsPhase = "http_request_redirect"
- RulesetPhaseUpdateParamsPhaseHTTPRequestSanitize RulesetPhaseUpdateParamsPhase = "http_request_sanitize"
- RulesetPhaseUpdateParamsPhaseHTTPRequestSbfm RulesetPhaseUpdateParamsPhase = "http_request_sbfm"
- RulesetPhaseUpdateParamsPhaseHTTPRequestSelectConfiguration RulesetPhaseUpdateParamsPhase = "http_request_select_configuration"
- RulesetPhaseUpdateParamsPhaseHTTPRequestTransform RulesetPhaseUpdateParamsPhase = "http_request_transform"
- RulesetPhaseUpdateParamsPhaseHTTPResponseCompression RulesetPhaseUpdateParamsPhase = "http_response_compression"
- RulesetPhaseUpdateParamsPhaseHTTPResponseFirewallManaged RulesetPhaseUpdateParamsPhase = "http_response_firewall_managed"
- RulesetPhaseUpdateParamsPhaseHTTPResponseHeadersTransform RulesetPhaseUpdateParamsPhase = "http_response_headers_transform"
- RulesetPhaseUpdateParamsPhaseMagicTransit RulesetPhaseUpdateParamsPhase = "magic_transit"
- RulesetPhaseUpdateParamsPhaseMagicTransitIDsManaged RulesetPhaseUpdateParamsPhase = "magic_transit_ids_managed"
- RulesetPhaseUpdateParamsPhaseMagicTransitManaged RulesetPhaseUpdateParamsPhase = "magic_transit_managed"
-)
-
-// A response object.
-type RulesetPhaseUpdateResponseEnvelope struct {
- // A list of error messages.
- Errors []RulesetPhaseUpdateResponseEnvelopeErrors `json:"errors,required"`
- // A list of warning messages.
- Messages []RulesetPhaseUpdateResponseEnvelopeMessages `json:"messages,required"`
- // A result.
- Result RulesetPhaseUpdateResponse `json:"result,required"`
- // Whether the API call was successful.
- Success RulesetPhaseUpdateResponseEnvelopeSuccess `json:"success,required"`
- JSON rulesetPhaseUpdateResponseEnvelopeJSON `json:"-"`
-}
-
-// rulesetPhaseUpdateResponseEnvelopeJSON contains the JSON metadata for the struct
-// [RulesetPhaseUpdateResponseEnvelope]
-type rulesetPhaseUpdateResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetPhaseUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetPhaseUpdateResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-// A message.
-type RulesetPhaseUpdateResponseEnvelopeErrors struct {
- // A text description of this message.
- Message string `json:"message,required"`
- // A unique code for this message.
- Code int64 `json:"code"`
- // The source of this message.
- Source RulesetPhaseUpdateResponseEnvelopeErrorsSource `json:"source"`
- JSON rulesetPhaseUpdateResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// rulesetPhaseUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [RulesetPhaseUpdateResponseEnvelopeErrors]
-type rulesetPhaseUpdateResponseEnvelopeErrorsJSON struct {
- Message apijson.Field
- Code apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetPhaseUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetPhaseUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-// The source of this message.
-type RulesetPhaseUpdateResponseEnvelopeErrorsSource struct {
- // A JSON pointer to the field that is the source of the message.
- Pointer string `json:"pointer,required"`
- JSON rulesetPhaseUpdateResponseEnvelopeErrorsSourceJSON `json:"-"`
-}
-
-// rulesetPhaseUpdateResponseEnvelopeErrorsSourceJSON contains the JSON metadata
-// for the struct [RulesetPhaseUpdateResponseEnvelopeErrorsSource]
-type rulesetPhaseUpdateResponseEnvelopeErrorsSourceJSON struct {
- Pointer apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetPhaseUpdateResponseEnvelopeErrorsSource) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetPhaseUpdateResponseEnvelopeErrorsSourceJSON) RawJSON() string {
- return r.raw
-}
-
-// A message.
-type RulesetPhaseUpdateResponseEnvelopeMessages struct {
- // A text description of this message.
- Message string `json:"message,required"`
- // A unique code for this message.
- Code int64 `json:"code"`
- // The source of this message.
- Source RulesetPhaseUpdateResponseEnvelopeMessagesSource `json:"source"`
- JSON rulesetPhaseUpdateResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// rulesetPhaseUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [RulesetPhaseUpdateResponseEnvelopeMessages]
-type rulesetPhaseUpdateResponseEnvelopeMessagesJSON struct {
- Message apijson.Field
- Code apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetPhaseUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetPhaseUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// The source of this message.
-type RulesetPhaseUpdateResponseEnvelopeMessagesSource struct {
- // A JSON pointer to the field that is the source of the message.
- Pointer string `json:"pointer,required"`
- JSON rulesetPhaseUpdateResponseEnvelopeMessagesSourceJSON `json:"-"`
-}
-
-// rulesetPhaseUpdateResponseEnvelopeMessagesSourceJSON contains the JSON metadata
-// for the struct [RulesetPhaseUpdateResponseEnvelopeMessagesSource]
-type rulesetPhaseUpdateResponseEnvelopeMessagesSourceJSON struct {
- Pointer apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetPhaseUpdateResponseEnvelopeMessagesSource) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetPhaseUpdateResponseEnvelopeMessagesSourceJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful.
-type RulesetPhaseUpdateResponseEnvelopeSuccess bool
-
-const (
- RulesetPhaseUpdateResponseEnvelopeSuccessTrue RulesetPhaseUpdateResponseEnvelopeSuccess = true
-)
-
-type RulesetPhaseGetParams struct {
- // The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
- AccountID param.Field[string] `path:"account_id"`
- // The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- ZoneID param.Field[string] `path:"zone_id"`
-}
-
-// The phase of the ruleset.
-type RulesetPhaseGetParamsRulesetPhase string
-
-const (
- RulesetPhaseGetParamsRulesetPhaseDDOSL4 RulesetPhaseGetParamsRulesetPhase = "ddos_l4"
- RulesetPhaseGetParamsRulesetPhaseDDOSL7 RulesetPhaseGetParamsRulesetPhase = "ddos_l7"
- RulesetPhaseGetParamsRulesetPhaseHTTPConfigSettings RulesetPhaseGetParamsRulesetPhase = "http_config_settings"
- RulesetPhaseGetParamsRulesetPhaseHTTPCustomErrors RulesetPhaseGetParamsRulesetPhase = "http_custom_errors"
- RulesetPhaseGetParamsRulesetPhaseHTTPLogCustomFields RulesetPhaseGetParamsRulesetPhase = "http_log_custom_fields"
- RulesetPhaseGetParamsRulesetPhaseHTTPRatelimit RulesetPhaseGetParamsRulesetPhase = "http_ratelimit"
- RulesetPhaseGetParamsRulesetPhaseHTTPRequestCacheSettings RulesetPhaseGetParamsRulesetPhase = "http_request_cache_settings"
- RulesetPhaseGetParamsRulesetPhaseHTTPRequestDynamicRedirect RulesetPhaseGetParamsRulesetPhase = "http_request_dynamic_redirect"
- RulesetPhaseGetParamsRulesetPhaseHTTPRequestFirewallCustom RulesetPhaseGetParamsRulesetPhase = "http_request_firewall_custom"
- RulesetPhaseGetParamsRulesetPhaseHTTPRequestFirewallManaged RulesetPhaseGetParamsRulesetPhase = "http_request_firewall_managed"
- RulesetPhaseGetParamsRulesetPhaseHTTPRequestLateTransform RulesetPhaseGetParamsRulesetPhase = "http_request_late_transform"
- RulesetPhaseGetParamsRulesetPhaseHTTPRequestOrigin RulesetPhaseGetParamsRulesetPhase = "http_request_origin"
- RulesetPhaseGetParamsRulesetPhaseHTTPRequestRedirect RulesetPhaseGetParamsRulesetPhase = "http_request_redirect"
- RulesetPhaseGetParamsRulesetPhaseHTTPRequestSanitize RulesetPhaseGetParamsRulesetPhase = "http_request_sanitize"
- RulesetPhaseGetParamsRulesetPhaseHTTPRequestSbfm RulesetPhaseGetParamsRulesetPhase = "http_request_sbfm"
- RulesetPhaseGetParamsRulesetPhaseHTTPRequestSelectConfiguration RulesetPhaseGetParamsRulesetPhase = "http_request_select_configuration"
- RulesetPhaseGetParamsRulesetPhaseHTTPRequestTransform RulesetPhaseGetParamsRulesetPhase = "http_request_transform"
- RulesetPhaseGetParamsRulesetPhaseHTTPResponseCompression RulesetPhaseGetParamsRulesetPhase = "http_response_compression"
- RulesetPhaseGetParamsRulesetPhaseHTTPResponseFirewallManaged RulesetPhaseGetParamsRulesetPhase = "http_response_firewall_managed"
- RulesetPhaseGetParamsRulesetPhaseHTTPResponseHeadersTransform RulesetPhaseGetParamsRulesetPhase = "http_response_headers_transform"
- RulesetPhaseGetParamsRulesetPhaseMagicTransit RulesetPhaseGetParamsRulesetPhase = "magic_transit"
- RulesetPhaseGetParamsRulesetPhaseMagicTransitIDsManaged RulesetPhaseGetParamsRulesetPhase = "magic_transit_ids_managed"
- RulesetPhaseGetParamsRulesetPhaseMagicTransitManaged RulesetPhaseGetParamsRulesetPhase = "magic_transit_managed"
-)
-
-// A response object.
-type RulesetPhaseGetResponseEnvelope struct {
- // A list of error messages.
- Errors []RulesetPhaseGetResponseEnvelopeErrors `json:"errors,required"`
- // A list of warning messages.
- Messages []RulesetPhaseGetResponseEnvelopeMessages `json:"messages,required"`
- // A result.
- Result RulesetPhaseGetResponse `json:"result,required"`
- // Whether the API call was successful.
- Success RulesetPhaseGetResponseEnvelopeSuccess `json:"success,required"`
- JSON rulesetPhaseGetResponseEnvelopeJSON `json:"-"`
-}
-
-// rulesetPhaseGetResponseEnvelopeJSON contains the JSON metadata for the struct
-// [RulesetPhaseGetResponseEnvelope]
-type rulesetPhaseGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetPhaseGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetPhaseGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-// A message.
-type RulesetPhaseGetResponseEnvelopeErrors struct {
- // A text description of this message.
- Message string `json:"message,required"`
- // A unique code for this message.
- Code int64 `json:"code"`
- // The source of this message.
- Source RulesetPhaseGetResponseEnvelopeErrorsSource `json:"source"`
- JSON rulesetPhaseGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// rulesetPhaseGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [RulesetPhaseGetResponseEnvelopeErrors]
-type rulesetPhaseGetResponseEnvelopeErrorsJSON struct {
- Message apijson.Field
- Code apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetPhaseGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetPhaseGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-// The source of this message.
-type RulesetPhaseGetResponseEnvelopeErrorsSource struct {
- // A JSON pointer to the field that is the source of the message.
- Pointer string `json:"pointer,required"`
- JSON rulesetPhaseGetResponseEnvelopeErrorsSourceJSON `json:"-"`
-}
-
-// rulesetPhaseGetResponseEnvelopeErrorsSourceJSON contains the JSON metadata for
-// the struct [RulesetPhaseGetResponseEnvelopeErrorsSource]
-type rulesetPhaseGetResponseEnvelopeErrorsSourceJSON struct {
- Pointer apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetPhaseGetResponseEnvelopeErrorsSource) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetPhaseGetResponseEnvelopeErrorsSourceJSON) RawJSON() string {
- return r.raw
-}
-
-// A message.
-type RulesetPhaseGetResponseEnvelopeMessages struct {
- // A text description of this message.
- Message string `json:"message,required"`
- // A unique code for this message.
- Code int64 `json:"code"`
- // The source of this message.
- Source RulesetPhaseGetResponseEnvelopeMessagesSource `json:"source"`
- JSON rulesetPhaseGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// rulesetPhaseGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [RulesetPhaseGetResponseEnvelopeMessages]
-type rulesetPhaseGetResponseEnvelopeMessagesJSON struct {
- Message apijson.Field
- Code apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetPhaseGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetPhaseGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// The source of this message.
-type RulesetPhaseGetResponseEnvelopeMessagesSource struct {
- // A JSON pointer to the field that is the source of the message.
- Pointer string `json:"pointer,required"`
- JSON rulesetPhaseGetResponseEnvelopeMessagesSourceJSON `json:"-"`
-}
-
-// rulesetPhaseGetResponseEnvelopeMessagesSourceJSON contains the JSON metadata for
-// the struct [RulesetPhaseGetResponseEnvelopeMessagesSource]
-type rulesetPhaseGetResponseEnvelopeMessagesSourceJSON struct {
- Pointer apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetPhaseGetResponseEnvelopeMessagesSource) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetPhaseGetResponseEnvelopeMessagesSourceJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful.
-type RulesetPhaseGetResponseEnvelopeSuccess bool
-
-const (
- RulesetPhaseGetResponseEnvelopeSuccessTrue RulesetPhaseGetResponseEnvelopeSuccess = true
-)
diff --git a/rulesetphase_test.go b/rulesetphase_test.go
deleted file mode 100644
index 12bafc4405b..00000000000
--- a/rulesetphase_test.go
+++ /dev/null
@@ -1,133 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRulesetPhaseUpdateWithOptionalParams(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"),
- )
- _, err := client.Rulesets.Phases.Update(
- context.TODO(),
- cloudflare.RulesetPhaseUpdateParamsRulesetPhaseHTTPRequestFirewallCustom,
- cloudflare.RulesetPhaseUpdateParams{
- ID: cloudflare.F("2f2feab2026849078ba485f918791bdc"),
- Rules: cloudflare.F([]cloudflare.RulesetPhaseUpdateParamsRule{cloudflare.RulesetPhaseUpdateParamsRulesRulesetsBlockRule(cloudflare.RulesetPhaseUpdateParamsRulesRulesetsBlockRule{
- Action: cloudflare.F(cloudflare.RulesetPhaseUpdateParamsRulesRulesetsBlockRuleActionBlock),
- ActionParameters: cloudflare.F(cloudflare.RulesetPhaseUpdateParamsRulesRulesetsBlockRuleActionParameters{
- Response: cloudflare.F(cloudflare.RulesetPhaseUpdateParamsRulesRulesetsBlockRuleActionParametersResponse{
- Content: cloudflare.F("{\n \"success\": false,\n \"error\": \"you have been blocked\"\n}"),
- ContentType: cloudflare.F("application/json"),
- StatusCode: cloudflare.F(int64(400)),
- }),
- }),
- Description: cloudflare.F("Block when the IP address is not 1.1.1.1"),
- Enabled: cloudflare.F(true),
- Expression: cloudflare.F("ip.src ne 1.1.1.1"),
- ID: cloudflare.F("3a03d665bac047339bb530ecb439a90d"),
- Logging: cloudflare.F(cloudflare.RulesetPhaseUpdateParamsRulesRulesetsBlockRuleLogging{
- Enabled: cloudflare.F(true),
- }),
- Ref: cloudflare.F("my_ref"),
- }), cloudflare.RulesetPhaseUpdateParamsRulesRulesetsBlockRule(cloudflare.RulesetPhaseUpdateParamsRulesRulesetsBlockRule{
- Action: cloudflare.F(cloudflare.RulesetPhaseUpdateParamsRulesRulesetsBlockRuleActionBlock),
- ActionParameters: cloudflare.F(cloudflare.RulesetPhaseUpdateParamsRulesRulesetsBlockRuleActionParameters{
- Response: cloudflare.F(cloudflare.RulesetPhaseUpdateParamsRulesRulesetsBlockRuleActionParametersResponse{
- Content: cloudflare.F("{\n \"success\": false,\n \"error\": \"you have been blocked\"\n}"),
- ContentType: cloudflare.F("application/json"),
- StatusCode: cloudflare.F(int64(400)),
- }),
- }),
- Description: cloudflare.F("Block when the IP address is not 1.1.1.1"),
- Enabled: cloudflare.F(true),
- Expression: cloudflare.F("ip.src ne 1.1.1.1"),
- ID: cloudflare.F("3a03d665bac047339bb530ecb439a90d"),
- Logging: cloudflare.F(cloudflare.RulesetPhaseUpdateParamsRulesRulesetsBlockRuleLogging{
- Enabled: cloudflare.F(true),
- }),
- Ref: cloudflare.F("my_ref"),
- }), cloudflare.RulesetPhaseUpdateParamsRulesRulesetsBlockRule(cloudflare.RulesetPhaseUpdateParamsRulesRulesetsBlockRule{
- Action: cloudflare.F(cloudflare.RulesetPhaseUpdateParamsRulesRulesetsBlockRuleActionBlock),
- ActionParameters: cloudflare.F(cloudflare.RulesetPhaseUpdateParamsRulesRulesetsBlockRuleActionParameters{
- Response: cloudflare.F(cloudflare.RulesetPhaseUpdateParamsRulesRulesetsBlockRuleActionParametersResponse{
- Content: cloudflare.F("{\n \"success\": false,\n \"error\": \"you have been blocked\"\n}"),
- ContentType: cloudflare.F("application/json"),
- StatusCode: cloudflare.F(int64(400)),
- }),
- }),
- Description: cloudflare.F("Block when the IP address is not 1.1.1.1"),
- Enabled: cloudflare.F(true),
- Expression: cloudflare.F("ip.src ne 1.1.1.1"),
- ID: cloudflare.F("3a03d665bac047339bb530ecb439a90d"),
- Logging: cloudflare.F(cloudflare.RulesetPhaseUpdateParamsRulesRulesetsBlockRuleLogging{
- Enabled: cloudflare.F(true),
- }),
- Ref: cloudflare.F("my_ref"),
- })}),
- AccountID: cloudflare.F("string"),
- ZoneID: cloudflare.F("string"),
- Description: cloudflare.F("My ruleset to execute managed rulesets"),
- Kind: cloudflare.F(cloudflare.RulesetPhaseUpdateParamsKindRoot),
- Name: cloudflare.F("My ruleset"),
- Phase: cloudflare.F(cloudflare.RulesetPhaseUpdateParamsPhaseHTTPRequestFirewallCustom),
- },
- )
- 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())
- }
-}
-
-func TestRulesetPhaseGetWithOptionalParams(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"),
- )
- _, err := client.Rulesets.Phases.Get(
- context.TODO(),
- cloudflare.RulesetPhaseGetParamsRulesetPhaseHTTPRequestFirewallCustom,
- cloudflare.RulesetPhaseGetParams{
- AccountID: cloudflare.F("string"),
- ZoneID: cloudflare.F("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/rulesetphaseversion.go b/rulesetphaseversion.go
deleted file mode 100644
index b3054a38ce9..00000000000
--- a/rulesetphaseversion.go
+++ /dev/null
@@ -1,1317 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "reflect"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
- "github.com/tidwall/gjson"
-)
-
-// RulesetPhaseVersionService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewRulesetPhaseVersionService]
-// method instead.
-type RulesetPhaseVersionService struct {
- Options []option.RequestOption
-}
-
-// NewRulesetPhaseVersionService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewRulesetPhaseVersionService(opts ...option.RequestOption) (r *RulesetPhaseVersionService) {
- r = &RulesetPhaseVersionService{}
- r.Options = opts
- return
-}
-
-// Fetches the versions of an account or zone entry point ruleset.
-func (r *RulesetPhaseVersionService) List(ctx context.Context, rulesetPhase RulesetPhaseVersionListParamsRulesetPhase, query RulesetPhaseVersionListParams, opts ...option.RequestOption) (res *[]RulesetPhaseVersionListResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RulesetPhaseVersionListResponseEnvelope
- var accountOrZone string
- var accountOrZoneID param.Field[string]
- if query.AccountID.Present {
- accountOrZone = "accounts"
- accountOrZoneID = query.AccountID
- } else {
- accountOrZone = "zones"
- accountOrZoneID = query.ZoneID
- }
- path := fmt.Sprintf("%s/%s/rulesets/phases/%v/entrypoint/versions", accountOrZone, accountOrZoneID, rulesetPhase)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Fetches a specific version of an account or zone entry point ruleset.
-func (r *RulesetPhaseVersionService) Get(ctx context.Context, rulesetPhase RulesetPhaseVersionGetParamsRulesetPhase, rulesetVersion string, query RulesetPhaseVersionGetParams, opts ...option.RequestOption) (res *RulesetPhaseVersionGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RulesetPhaseVersionGetResponseEnvelope
- var accountOrZone string
- var accountOrZoneID param.Field[string]
- if query.AccountID.Present {
- accountOrZone = "accounts"
- accountOrZoneID = query.AccountID
- } else {
- accountOrZone = "zones"
- accountOrZoneID = query.ZoneID
- }
- path := fmt.Sprintf("%s/%s/rulesets/phases/%v/entrypoint/versions/%s", accountOrZone, accountOrZoneID, rulesetPhase, rulesetVersion)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// A ruleset object.
-type RulesetPhaseVersionListResponse struct {
- // The kind of the ruleset.
- Kind RulesetPhaseVersionListResponseKind `json:"kind,required"`
- // The human-readable name of the ruleset.
- Name string `json:"name,required"`
- // The phase of the ruleset.
- Phase RulesetPhaseVersionListResponsePhase `json:"phase,required"`
- // The unique ID of the ruleset.
- ID string `json:"id"`
- // An informative description of the ruleset.
- Description string `json:"description"`
- // The timestamp of when the ruleset was last modified.
- LastUpdated time.Time `json:"last_updated" format:"date-time"`
- // The version of the ruleset.
- Version string `json:"version"`
- JSON rulesetPhaseVersionListResponseJSON `json:"-"`
-}
-
-// rulesetPhaseVersionListResponseJSON contains the JSON metadata for the struct
-// [RulesetPhaseVersionListResponse]
-type rulesetPhaseVersionListResponseJSON struct {
- Kind apijson.Field
- Name apijson.Field
- Phase apijson.Field
- ID apijson.Field
- Description apijson.Field
- LastUpdated apijson.Field
- Version apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetPhaseVersionListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetPhaseVersionListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// The kind of the ruleset.
-type RulesetPhaseVersionListResponseKind string
-
-const (
- RulesetPhaseVersionListResponseKindManaged RulesetPhaseVersionListResponseKind = "managed"
- RulesetPhaseVersionListResponseKindCustom RulesetPhaseVersionListResponseKind = "custom"
- RulesetPhaseVersionListResponseKindRoot RulesetPhaseVersionListResponseKind = "root"
- RulesetPhaseVersionListResponseKindZone RulesetPhaseVersionListResponseKind = "zone"
-)
-
-// The phase of the ruleset.
-type RulesetPhaseVersionListResponsePhase string
-
-const (
- RulesetPhaseVersionListResponsePhaseDDOSL4 RulesetPhaseVersionListResponsePhase = "ddos_l4"
- RulesetPhaseVersionListResponsePhaseDDOSL7 RulesetPhaseVersionListResponsePhase = "ddos_l7"
- RulesetPhaseVersionListResponsePhaseHTTPConfigSettings RulesetPhaseVersionListResponsePhase = "http_config_settings"
- RulesetPhaseVersionListResponsePhaseHTTPCustomErrors RulesetPhaseVersionListResponsePhase = "http_custom_errors"
- RulesetPhaseVersionListResponsePhaseHTTPLogCustomFields RulesetPhaseVersionListResponsePhase = "http_log_custom_fields"
- RulesetPhaseVersionListResponsePhaseHTTPRatelimit RulesetPhaseVersionListResponsePhase = "http_ratelimit"
- RulesetPhaseVersionListResponsePhaseHTTPRequestCacheSettings RulesetPhaseVersionListResponsePhase = "http_request_cache_settings"
- RulesetPhaseVersionListResponsePhaseHTTPRequestDynamicRedirect RulesetPhaseVersionListResponsePhase = "http_request_dynamic_redirect"
- RulesetPhaseVersionListResponsePhaseHTTPRequestFirewallCustom RulesetPhaseVersionListResponsePhase = "http_request_firewall_custom"
- RulesetPhaseVersionListResponsePhaseHTTPRequestFirewallManaged RulesetPhaseVersionListResponsePhase = "http_request_firewall_managed"
- RulesetPhaseVersionListResponsePhaseHTTPRequestLateTransform RulesetPhaseVersionListResponsePhase = "http_request_late_transform"
- RulesetPhaseVersionListResponsePhaseHTTPRequestOrigin RulesetPhaseVersionListResponsePhase = "http_request_origin"
- RulesetPhaseVersionListResponsePhaseHTTPRequestRedirect RulesetPhaseVersionListResponsePhase = "http_request_redirect"
- RulesetPhaseVersionListResponsePhaseHTTPRequestSanitize RulesetPhaseVersionListResponsePhase = "http_request_sanitize"
- RulesetPhaseVersionListResponsePhaseHTTPRequestSbfm RulesetPhaseVersionListResponsePhase = "http_request_sbfm"
- RulesetPhaseVersionListResponsePhaseHTTPRequestSelectConfiguration RulesetPhaseVersionListResponsePhase = "http_request_select_configuration"
- RulesetPhaseVersionListResponsePhaseHTTPRequestTransform RulesetPhaseVersionListResponsePhase = "http_request_transform"
- RulesetPhaseVersionListResponsePhaseHTTPResponseCompression RulesetPhaseVersionListResponsePhase = "http_response_compression"
- RulesetPhaseVersionListResponsePhaseHTTPResponseFirewallManaged RulesetPhaseVersionListResponsePhase = "http_response_firewall_managed"
- RulesetPhaseVersionListResponsePhaseHTTPResponseHeadersTransform RulesetPhaseVersionListResponsePhase = "http_response_headers_transform"
- RulesetPhaseVersionListResponsePhaseMagicTransit RulesetPhaseVersionListResponsePhase = "magic_transit"
- RulesetPhaseVersionListResponsePhaseMagicTransitIDsManaged RulesetPhaseVersionListResponsePhase = "magic_transit_ids_managed"
- RulesetPhaseVersionListResponsePhaseMagicTransitManaged RulesetPhaseVersionListResponsePhase = "magic_transit_managed"
-)
-
-// A result.
-type RulesetPhaseVersionGetResponse struct {
- // The unique ID of the ruleset.
- ID string `json:"id,required"`
- // The kind of the ruleset.
- Kind RulesetPhaseVersionGetResponseKind `json:"kind,required"`
- // The timestamp of when the ruleset was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The human-readable name of the ruleset.
- Name string `json:"name,required"`
- // The phase of the ruleset.
- Phase RulesetPhaseVersionGetResponsePhase `json:"phase,required"`
- // The list of rules in the ruleset.
- Rules []RulesetPhaseVersionGetResponseRule `json:"rules,required"`
- // The version of the ruleset.
- Version string `json:"version,required"`
- // An informative description of the ruleset.
- Description string `json:"description"`
- JSON rulesetPhaseVersionGetResponseJSON `json:"-"`
-}
-
-// rulesetPhaseVersionGetResponseJSON contains the JSON metadata for the struct
-// [RulesetPhaseVersionGetResponse]
-type rulesetPhaseVersionGetResponseJSON struct {
- ID apijson.Field
- Kind apijson.Field
- LastUpdated apijson.Field
- Name apijson.Field
- Phase apijson.Field
- Rules apijson.Field
- Version apijson.Field
- Description apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetPhaseVersionGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetPhaseVersionGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// The kind of the ruleset.
-type RulesetPhaseVersionGetResponseKind string
-
-const (
- RulesetPhaseVersionGetResponseKindManaged RulesetPhaseVersionGetResponseKind = "managed"
- RulesetPhaseVersionGetResponseKindCustom RulesetPhaseVersionGetResponseKind = "custom"
- RulesetPhaseVersionGetResponseKindRoot RulesetPhaseVersionGetResponseKind = "root"
- RulesetPhaseVersionGetResponseKindZone RulesetPhaseVersionGetResponseKind = "zone"
-)
-
-// The phase of the ruleset.
-type RulesetPhaseVersionGetResponsePhase string
-
-const (
- RulesetPhaseVersionGetResponsePhaseDDOSL4 RulesetPhaseVersionGetResponsePhase = "ddos_l4"
- RulesetPhaseVersionGetResponsePhaseDDOSL7 RulesetPhaseVersionGetResponsePhase = "ddos_l7"
- RulesetPhaseVersionGetResponsePhaseHTTPConfigSettings RulesetPhaseVersionGetResponsePhase = "http_config_settings"
- RulesetPhaseVersionGetResponsePhaseHTTPCustomErrors RulesetPhaseVersionGetResponsePhase = "http_custom_errors"
- RulesetPhaseVersionGetResponsePhaseHTTPLogCustomFields RulesetPhaseVersionGetResponsePhase = "http_log_custom_fields"
- RulesetPhaseVersionGetResponsePhaseHTTPRatelimit RulesetPhaseVersionGetResponsePhase = "http_ratelimit"
- RulesetPhaseVersionGetResponsePhaseHTTPRequestCacheSettings RulesetPhaseVersionGetResponsePhase = "http_request_cache_settings"
- RulesetPhaseVersionGetResponsePhaseHTTPRequestDynamicRedirect RulesetPhaseVersionGetResponsePhase = "http_request_dynamic_redirect"
- RulesetPhaseVersionGetResponsePhaseHTTPRequestFirewallCustom RulesetPhaseVersionGetResponsePhase = "http_request_firewall_custom"
- RulesetPhaseVersionGetResponsePhaseHTTPRequestFirewallManaged RulesetPhaseVersionGetResponsePhase = "http_request_firewall_managed"
- RulesetPhaseVersionGetResponsePhaseHTTPRequestLateTransform RulesetPhaseVersionGetResponsePhase = "http_request_late_transform"
- RulesetPhaseVersionGetResponsePhaseHTTPRequestOrigin RulesetPhaseVersionGetResponsePhase = "http_request_origin"
- RulesetPhaseVersionGetResponsePhaseHTTPRequestRedirect RulesetPhaseVersionGetResponsePhase = "http_request_redirect"
- RulesetPhaseVersionGetResponsePhaseHTTPRequestSanitize RulesetPhaseVersionGetResponsePhase = "http_request_sanitize"
- RulesetPhaseVersionGetResponsePhaseHTTPRequestSbfm RulesetPhaseVersionGetResponsePhase = "http_request_sbfm"
- RulesetPhaseVersionGetResponsePhaseHTTPRequestSelectConfiguration RulesetPhaseVersionGetResponsePhase = "http_request_select_configuration"
- RulesetPhaseVersionGetResponsePhaseHTTPRequestTransform RulesetPhaseVersionGetResponsePhase = "http_request_transform"
- RulesetPhaseVersionGetResponsePhaseHTTPResponseCompression RulesetPhaseVersionGetResponsePhase = "http_response_compression"
- RulesetPhaseVersionGetResponsePhaseHTTPResponseFirewallManaged RulesetPhaseVersionGetResponsePhase = "http_response_firewall_managed"
- RulesetPhaseVersionGetResponsePhaseHTTPResponseHeadersTransform RulesetPhaseVersionGetResponsePhase = "http_response_headers_transform"
- RulesetPhaseVersionGetResponsePhaseMagicTransit RulesetPhaseVersionGetResponsePhase = "magic_transit"
- RulesetPhaseVersionGetResponsePhaseMagicTransitIDsManaged RulesetPhaseVersionGetResponsePhase = "magic_transit_ids_managed"
- RulesetPhaseVersionGetResponsePhaseMagicTransitManaged RulesetPhaseVersionGetResponsePhase = "magic_transit_managed"
-)
-
-// Union satisfied by [RulesetPhaseVersionGetResponseRulesRulesetsBlockRule],
-// [RulesetPhaseVersionGetResponseRulesRulesetsExecuteRule],
-// [RulesetPhaseVersionGetResponseRulesRulesetsLogRule] or
-// [RulesetPhaseVersionGetResponseRulesRulesetsSkipRule].
-type RulesetPhaseVersionGetResponseRule interface {
- implementsRulesetPhaseVersionGetResponseRule()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*RulesetPhaseVersionGetResponseRule)(nil)).Elem(),
- "action",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(RulesetPhaseVersionGetResponseRulesRulesetsBlockRule{}),
- DiscriminatorValue: "block",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(RulesetPhaseVersionGetResponseRulesRulesetsExecuteRule{}),
- DiscriminatorValue: "execute",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(RulesetPhaseVersionGetResponseRulesRulesetsLogRule{}),
- DiscriminatorValue: "log",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(RulesetPhaseVersionGetResponseRulesRulesetsSkipRule{}),
- DiscriminatorValue: "skip",
- },
- )
-}
-
-type RulesetPhaseVersionGetResponseRulesRulesetsBlockRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action RulesetPhaseVersionGetResponseRulesRulesetsBlockRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters RulesetPhaseVersionGetResponseRulesRulesetsBlockRuleActionParameters `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging RulesetPhaseVersionGetResponseRulesRulesetsBlockRuleLogging `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON rulesetPhaseVersionGetResponseRulesRulesetsBlockRuleJSON `json:"-"`
-}
-
-// rulesetPhaseVersionGetResponseRulesRulesetsBlockRuleJSON contains the JSON
-// metadata for the struct [RulesetPhaseVersionGetResponseRulesRulesetsBlockRule]
-type rulesetPhaseVersionGetResponseRulesRulesetsBlockRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetPhaseVersionGetResponseRulesRulesetsBlockRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetPhaseVersionGetResponseRulesRulesetsBlockRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r RulesetPhaseVersionGetResponseRulesRulesetsBlockRule) implementsRulesetPhaseVersionGetResponseRule() {
-}
-
-// The action to perform when the rule matches.
-type RulesetPhaseVersionGetResponseRulesRulesetsBlockRuleAction string
-
-const (
- RulesetPhaseVersionGetResponseRulesRulesetsBlockRuleActionBlock RulesetPhaseVersionGetResponseRulesRulesetsBlockRuleAction = "block"
-)
-
-// The parameters configuring the rule's action.
-type RulesetPhaseVersionGetResponseRulesRulesetsBlockRuleActionParameters struct {
- // The response to show when the block is applied.
- Response RulesetPhaseVersionGetResponseRulesRulesetsBlockRuleActionParametersResponse `json:"response"`
- JSON rulesetPhaseVersionGetResponseRulesRulesetsBlockRuleActionParametersJSON `json:"-"`
-}
-
-// rulesetPhaseVersionGetResponseRulesRulesetsBlockRuleActionParametersJSON
-// contains the JSON metadata for the struct
-// [RulesetPhaseVersionGetResponseRulesRulesetsBlockRuleActionParameters]
-type rulesetPhaseVersionGetResponseRulesRulesetsBlockRuleActionParametersJSON struct {
- Response apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetPhaseVersionGetResponseRulesRulesetsBlockRuleActionParameters) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetPhaseVersionGetResponseRulesRulesetsBlockRuleActionParametersJSON) RawJSON() string {
- return r.raw
-}
-
-// The response to show when the block is applied.
-type RulesetPhaseVersionGetResponseRulesRulesetsBlockRuleActionParametersResponse struct {
- // The content to return.
- Content string `json:"content,required"`
- // The type of the content to return.
- ContentType string `json:"content_type,required"`
- // The status code to return.
- StatusCode int64 `json:"status_code,required"`
- JSON rulesetPhaseVersionGetResponseRulesRulesetsBlockRuleActionParametersResponseJSON `json:"-"`
-}
-
-// rulesetPhaseVersionGetResponseRulesRulesetsBlockRuleActionParametersResponseJSON
-// contains the JSON metadata for the struct
-// [RulesetPhaseVersionGetResponseRulesRulesetsBlockRuleActionParametersResponse]
-type rulesetPhaseVersionGetResponseRulesRulesetsBlockRuleActionParametersResponseJSON struct {
- Content apijson.Field
- ContentType apijson.Field
- StatusCode apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetPhaseVersionGetResponseRulesRulesetsBlockRuleActionParametersResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetPhaseVersionGetResponseRulesRulesetsBlockRuleActionParametersResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// An object configuring the rule's logging behavior.
-type RulesetPhaseVersionGetResponseRulesRulesetsBlockRuleLogging struct {
- // Whether to generate a log when the rule matches.
- Enabled bool `json:"enabled,required"`
- JSON rulesetPhaseVersionGetResponseRulesRulesetsBlockRuleLoggingJSON `json:"-"`
-}
-
-// rulesetPhaseVersionGetResponseRulesRulesetsBlockRuleLoggingJSON contains the
-// JSON metadata for the struct
-// [RulesetPhaseVersionGetResponseRulesRulesetsBlockRuleLogging]
-type rulesetPhaseVersionGetResponseRulesRulesetsBlockRuleLoggingJSON struct {
- Enabled apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetPhaseVersionGetResponseRulesRulesetsBlockRuleLogging) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetPhaseVersionGetResponseRulesRulesetsBlockRuleLoggingJSON) RawJSON() string {
- return r.raw
-}
-
-type RulesetPhaseVersionGetResponseRulesRulesetsExecuteRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action RulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters RulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleActionParameters `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging RulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleLogging `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON rulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleJSON `json:"-"`
-}
-
-// rulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleJSON contains the JSON
-// metadata for the struct [RulesetPhaseVersionGetResponseRulesRulesetsExecuteRule]
-type rulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetPhaseVersionGetResponseRulesRulesetsExecuteRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r RulesetPhaseVersionGetResponseRulesRulesetsExecuteRule) implementsRulesetPhaseVersionGetResponseRule() {
-}
-
-// The action to perform when the rule matches.
-type RulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleAction string
-
-const (
- RulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleActionExecute RulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleAction = "execute"
-)
-
-// The parameters configuring the rule's action.
-type RulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleActionParameters struct {
- // The ID of the ruleset to execute.
- ID string `json:"id,required"`
- // The configuration to use for matched data logging.
- MatchedData RulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersMatchedData `json:"matched_data"`
- // A set of overrides to apply to the target ruleset.
- Overrides RulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverrides `json:"overrides"`
- JSON rulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersJSON `json:"-"`
-}
-
-// rulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersJSON
-// contains the JSON metadata for the struct
-// [RulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleActionParameters]
-type rulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersJSON struct {
- ID apijson.Field
- MatchedData apijson.Field
- Overrides apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleActionParameters) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersJSON) RawJSON() string {
- return r.raw
-}
-
-// The configuration to use for matched data logging.
-type RulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersMatchedData struct {
- // The public key to encrypt matched data logs with.
- PublicKey string `json:"public_key,required"`
- JSON rulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON `json:"-"`
-}
-
-// rulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON
-// contains the JSON metadata for the struct
-// [RulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersMatchedData]
-type rulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON struct {
- PublicKey apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersMatchedData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON) RawJSON() string {
- return r.raw
-}
-
-// A set of overrides to apply to the target ruleset.
-type RulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverrides struct {
- // An action to override all rules with. This option has lower precedence than rule
- // and category overrides.
- Action string `json:"action"`
- // A list of category-level overrides. This option has the second-highest
- // precedence after rule-level overrides.
- Categories []RulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory `json:"categories"`
- // Whether to enable execution of all rules. This option has lower precedence than
- // rule and category overrides.
- Enabled bool `json:"enabled"`
- // A list of rule-level overrides. This option has the highest precedence.
- Rules []RulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRule `json:"rules"`
- // A sensitivity level to set for all rules. This option has lower precedence than
- // rule and category overrides and is only applicable for DDoS phases.
- SensitivityLevel RulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel `json:"sensitivity_level"`
- JSON rulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON `json:"-"`
-}
-
-// rulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON
-// contains the JSON metadata for the struct
-// [RulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverrides]
-type rulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON struct {
- Action apijson.Field
- Categories apijson.Field
- Enabled apijson.Field
- Rules apijson.Field
- SensitivityLevel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverrides) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON) RawJSON() string {
- return r.raw
-}
-
-// A category-level override
-type RulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory struct {
- // The name of the category to override.
- Category string `json:"category,required"`
- // The action to override rules in the category with.
- Action string `json:"action"`
- // Whether to enable execution of rules in the category.
- Enabled bool `json:"enabled"`
- // The sensitivity level to use for rules in the category.
- SensitivityLevel RulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel `json:"sensitivity_level"`
- JSON rulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON `json:"-"`
-}
-
-// rulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON
-// contains the JSON metadata for the struct
-// [RulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory]
-type rulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON struct {
- Category apijson.Field
- Action apijson.Field
- Enabled apijson.Field
- SensitivityLevel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON) RawJSON() string {
- return r.raw
-}
-
-// The sensitivity level to use for rules in the category.
-type RulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel string
-
-const (
- RulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault RulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "default"
- RulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium RulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "medium"
- RulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow RulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "low"
- RulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff RulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "eoff"
-)
-
-// A rule-level override
-type RulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRule struct {
- // The ID of the rule to override.
- ID string `json:"id,required"`
- // The action to override the rule with.
- Action string `json:"action"`
- // Whether to enable execution of the rule.
- Enabled bool `json:"enabled"`
- // The score threshold to use for the rule.
- ScoreThreshold int64 `json:"score_threshold"`
- // The sensitivity level to use for the rule.
- SensitivityLevel RulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel `json:"sensitivity_level"`
- JSON rulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON `json:"-"`
-}
-
-// rulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON
-// contains the JSON metadata for the struct
-// [RulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRule]
-type rulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON struct {
- ID apijson.Field
- Action apijson.Field
- Enabled apijson.Field
- ScoreThreshold apijson.Field
- SensitivityLevel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON) RawJSON() string {
- return r.raw
-}
-
-// The sensitivity level to use for the rule.
-type RulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel string
-
-const (
- RulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault RulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "default"
- RulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium RulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "medium"
- RulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelLow RulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "low"
- RulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff RulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "eoff"
-)
-
-// A sensitivity level to set for all rules. This option has lower precedence than
-// rule and category overrides and is only applicable for DDoS phases.
-type RulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel string
-
-const (
- RulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelDefault RulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "default"
- RulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelMedium RulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "medium"
- RulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelLow RulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "low"
- RulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelEoff RulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "eoff"
-)
-
-// An object configuring the rule's logging behavior.
-type RulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleLogging struct {
- // Whether to generate a log when the rule matches.
- Enabled bool `json:"enabled,required"`
- JSON rulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleLoggingJSON `json:"-"`
-}
-
-// rulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleLoggingJSON contains the
-// JSON metadata for the struct
-// [RulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleLogging]
-type rulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleLoggingJSON struct {
- Enabled apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleLogging) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetPhaseVersionGetResponseRulesRulesetsExecuteRuleLoggingJSON) RawJSON() string {
- return r.raw
-}
-
-type RulesetPhaseVersionGetResponseRulesRulesetsLogRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action RulesetPhaseVersionGetResponseRulesRulesetsLogRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters interface{} `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging RulesetPhaseVersionGetResponseRulesRulesetsLogRuleLogging `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON rulesetPhaseVersionGetResponseRulesRulesetsLogRuleJSON `json:"-"`
-}
-
-// rulesetPhaseVersionGetResponseRulesRulesetsLogRuleJSON contains the JSON
-// metadata for the struct [RulesetPhaseVersionGetResponseRulesRulesetsLogRule]
-type rulesetPhaseVersionGetResponseRulesRulesetsLogRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetPhaseVersionGetResponseRulesRulesetsLogRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetPhaseVersionGetResponseRulesRulesetsLogRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r RulesetPhaseVersionGetResponseRulesRulesetsLogRule) implementsRulesetPhaseVersionGetResponseRule() {
-}
-
-// The action to perform when the rule matches.
-type RulesetPhaseVersionGetResponseRulesRulesetsLogRuleAction string
-
-const (
- RulesetPhaseVersionGetResponseRulesRulesetsLogRuleActionLog RulesetPhaseVersionGetResponseRulesRulesetsLogRuleAction = "log"
-)
-
-// An object configuring the rule's logging behavior.
-type RulesetPhaseVersionGetResponseRulesRulesetsLogRuleLogging struct {
- // Whether to generate a log when the rule matches.
- Enabled bool `json:"enabled,required"`
- JSON rulesetPhaseVersionGetResponseRulesRulesetsLogRuleLoggingJSON `json:"-"`
-}
-
-// rulesetPhaseVersionGetResponseRulesRulesetsLogRuleLoggingJSON contains the JSON
-// metadata for the struct
-// [RulesetPhaseVersionGetResponseRulesRulesetsLogRuleLogging]
-type rulesetPhaseVersionGetResponseRulesRulesetsLogRuleLoggingJSON struct {
- Enabled apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetPhaseVersionGetResponseRulesRulesetsLogRuleLogging) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetPhaseVersionGetResponseRulesRulesetsLogRuleLoggingJSON) RawJSON() string {
- return r.raw
-}
-
-type RulesetPhaseVersionGetResponseRulesRulesetsSkipRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParameters `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleLogging `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON rulesetPhaseVersionGetResponseRulesRulesetsSkipRuleJSON `json:"-"`
-}
-
-// rulesetPhaseVersionGetResponseRulesRulesetsSkipRuleJSON contains the JSON
-// metadata for the struct [RulesetPhaseVersionGetResponseRulesRulesetsSkipRule]
-type rulesetPhaseVersionGetResponseRulesRulesetsSkipRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetPhaseVersionGetResponseRulesRulesetsSkipRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetPhaseVersionGetResponseRulesRulesetsSkipRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r RulesetPhaseVersionGetResponseRulesRulesetsSkipRule) implementsRulesetPhaseVersionGetResponseRule() {
-}
-
-// The action to perform when the rule matches.
-type RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleAction string
-
-const (
- RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionSkip RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleAction = "skip"
-)
-
-// The parameters configuring the rule's action.
-type RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParameters struct {
- // A list of phases to skip the execution of. This option is incompatible with the
- // ruleset and rulesets options.
- Phases []RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase `json:"phases"`
- // A list of legacy security products to skip the execution of.
- Products []RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersProduct `json:"products"`
- // A mapping of ruleset IDs to a list of rule IDs in that ruleset to skip the
- // execution of. This option is incompatible with the ruleset option.
- Rules map[string][]string `json:"rules"`
- // A ruleset to skip the execution of. This option is incompatible with the
- // rulesets, rules and phases options.
- Ruleset RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersRuleset `json:"ruleset"`
- // A list of ruleset IDs to skip the execution of. This option is incompatible with
- // the ruleset and phases options.
- Rulesets []string `json:"rulesets"`
- JSON rulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersJSON `json:"-"`
-}
-
-// rulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersJSON contains
-// the JSON metadata for the struct
-// [RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParameters]
-type rulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersJSON struct {
- Phases apijson.Field
- Products apijson.Field
- Rules apijson.Field
- Ruleset apijson.Field
- Rulesets apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParameters) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersJSON) RawJSON() string {
- return r.raw
-}
-
-// A phase to skip the execution of.
-type RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase string
-
-const (
- RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseDDOSL4 RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "ddos_l4"
- RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseDDOSL7 RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "ddos_l7"
- RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPConfigSettings RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_config_settings"
- RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPCustomErrors RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_custom_errors"
- RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPLogCustomFields RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_log_custom_fields"
- RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRatelimit RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_ratelimit"
- RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestCacheSettings RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_cache_settings"
- RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestDynamicRedirect RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_dynamic_redirect"
- RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallCustom RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_custom"
- RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallManaged RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_managed"
- RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestLateTransform RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_late_transform"
- RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestOrigin RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_origin"
- RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestRedirect RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_redirect"
- RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSanitize RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_sanitize"
- RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSbfm RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_sbfm"
- RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSelectConfiguration RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_select_configuration"
- RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestTransform RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_transform"
- RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseCompression RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_compression"
- RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseFirewallManaged RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_firewall_managed"
- RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseHeadersTransform RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_headers_transform"
- RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransit RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit"
- RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitIDsManaged RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_ids_managed"
- RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitManaged RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_managed"
-)
-
-// The name of a legacy security product to skip the execution of.
-type RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersProduct string
-
-const (
- RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersProductBic RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersProduct = "bic"
- RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersProductHot RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersProduct = "hot"
- RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersProductRateLimit RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersProduct = "rateLimit"
- RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersProductSecurityLevel RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersProduct = "securityLevel"
- RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersProductUABlock RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersProduct = "uaBlock"
- RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersProductWAF RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersProduct = "waf"
- RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersProductZoneLockdown RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersProduct = "zoneLockdown"
-)
-
-// A ruleset to skip the execution of. This option is incompatible with the
-// rulesets, rules and phases options.
-type RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersRuleset string
-
-const (
- RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersRulesetCurrent RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleActionParametersRuleset = "current"
-)
-
-// An object configuring the rule's logging behavior.
-type RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleLogging struct {
- // Whether to generate a log when the rule matches.
- Enabled bool `json:"enabled,required"`
- JSON rulesetPhaseVersionGetResponseRulesRulesetsSkipRuleLoggingJSON `json:"-"`
-}
-
-// rulesetPhaseVersionGetResponseRulesRulesetsSkipRuleLoggingJSON contains the JSON
-// metadata for the struct
-// [RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleLogging]
-type rulesetPhaseVersionGetResponseRulesRulesetsSkipRuleLoggingJSON struct {
- Enabled apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetPhaseVersionGetResponseRulesRulesetsSkipRuleLogging) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetPhaseVersionGetResponseRulesRulesetsSkipRuleLoggingJSON) RawJSON() string {
- return r.raw
-}
-
-type RulesetPhaseVersionListParams struct {
- // The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
- AccountID param.Field[string] `path:"account_id"`
- // The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- ZoneID param.Field[string] `path:"zone_id"`
-}
-
-// The phase of the ruleset.
-type RulesetPhaseVersionListParamsRulesetPhase string
-
-const (
- RulesetPhaseVersionListParamsRulesetPhaseDDOSL4 RulesetPhaseVersionListParamsRulesetPhase = "ddos_l4"
- RulesetPhaseVersionListParamsRulesetPhaseDDOSL7 RulesetPhaseVersionListParamsRulesetPhase = "ddos_l7"
- RulesetPhaseVersionListParamsRulesetPhaseHTTPConfigSettings RulesetPhaseVersionListParamsRulesetPhase = "http_config_settings"
- RulesetPhaseVersionListParamsRulesetPhaseHTTPCustomErrors RulesetPhaseVersionListParamsRulesetPhase = "http_custom_errors"
- RulesetPhaseVersionListParamsRulesetPhaseHTTPLogCustomFields RulesetPhaseVersionListParamsRulesetPhase = "http_log_custom_fields"
- RulesetPhaseVersionListParamsRulesetPhaseHTTPRatelimit RulesetPhaseVersionListParamsRulesetPhase = "http_ratelimit"
- RulesetPhaseVersionListParamsRulesetPhaseHTTPRequestCacheSettings RulesetPhaseVersionListParamsRulesetPhase = "http_request_cache_settings"
- RulesetPhaseVersionListParamsRulesetPhaseHTTPRequestDynamicRedirect RulesetPhaseVersionListParamsRulesetPhase = "http_request_dynamic_redirect"
- RulesetPhaseVersionListParamsRulesetPhaseHTTPRequestFirewallCustom RulesetPhaseVersionListParamsRulesetPhase = "http_request_firewall_custom"
- RulesetPhaseVersionListParamsRulesetPhaseHTTPRequestFirewallManaged RulesetPhaseVersionListParamsRulesetPhase = "http_request_firewall_managed"
- RulesetPhaseVersionListParamsRulesetPhaseHTTPRequestLateTransform RulesetPhaseVersionListParamsRulesetPhase = "http_request_late_transform"
- RulesetPhaseVersionListParamsRulesetPhaseHTTPRequestOrigin RulesetPhaseVersionListParamsRulesetPhase = "http_request_origin"
- RulesetPhaseVersionListParamsRulesetPhaseHTTPRequestRedirect RulesetPhaseVersionListParamsRulesetPhase = "http_request_redirect"
- RulesetPhaseVersionListParamsRulesetPhaseHTTPRequestSanitize RulesetPhaseVersionListParamsRulesetPhase = "http_request_sanitize"
- RulesetPhaseVersionListParamsRulesetPhaseHTTPRequestSbfm RulesetPhaseVersionListParamsRulesetPhase = "http_request_sbfm"
- RulesetPhaseVersionListParamsRulesetPhaseHTTPRequestSelectConfiguration RulesetPhaseVersionListParamsRulesetPhase = "http_request_select_configuration"
- RulesetPhaseVersionListParamsRulesetPhaseHTTPRequestTransform RulesetPhaseVersionListParamsRulesetPhase = "http_request_transform"
- RulesetPhaseVersionListParamsRulesetPhaseHTTPResponseCompression RulesetPhaseVersionListParamsRulesetPhase = "http_response_compression"
- RulesetPhaseVersionListParamsRulesetPhaseHTTPResponseFirewallManaged RulesetPhaseVersionListParamsRulesetPhase = "http_response_firewall_managed"
- RulesetPhaseVersionListParamsRulesetPhaseHTTPResponseHeadersTransform RulesetPhaseVersionListParamsRulesetPhase = "http_response_headers_transform"
- RulesetPhaseVersionListParamsRulesetPhaseMagicTransit RulesetPhaseVersionListParamsRulesetPhase = "magic_transit"
- RulesetPhaseVersionListParamsRulesetPhaseMagicTransitIDsManaged RulesetPhaseVersionListParamsRulesetPhase = "magic_transit_ids_managed"
- RulesetPhaseVersionListParamsRulesetPhaseMagicTransitManaged RulesetPhaseVersionListParamsRulesetPhase = "magic_transit_managed"
-)
-
-// A response object.
-type RulesetPhaseVersionListResponseEnvelope struct {
- // A list of error messages.
- Errors []RulesetPhaseVersionListResponseEnvelopeErrors `json:"errors,required"`
- // A list of warning messages.
- Messages []RulesetPhaseVersionListResponseEnvelopeMessages `json:"messages,required"`
- // A result.
- Result []RulesetPhaseVersionListResponse `json:"result,required"`
- // Whether the API call was successful.
- Success RulesetPhaseVersionListResponseEnvelopeSuccess `json:"success,required"`
- JSON rulesetPhaseVersionListResponseEnvelopeJSON `json:"-"`
-}
-
-// rulesetPhaseVersionListResponseEnvelopeJSON contains the JSON metadata for the
-// struct [RulesetPhaseVersionListResponseEnvelope]
-type rulesetPhaseVersionListResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetPhaseVersionListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetPhaseVersionListResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-// A message.
-type RulesetPhaseVersionListResponseEnvelopeErrors struct {
- // A text description of this message.
- Message string `json:"message,required"`
- // A unique code for this message.
- Code int64 `json:"code"`
- // The source of this message.
- Source RulesetPhaseVersionListResponseEnvelopeErrorsSource `json:"source"`
- JSON rulesetPhaseVersionListResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// rulesetPhaseVersionListResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [RulesetPhaseVersionListResponseEnvelopeErrors]
-type rulesetPhaseVersionListResponseEnvelopeErrorsJSON struct {
- Message apijson.Field
- Code apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetPhaseVersionListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetPhaseVersionListResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-// The source of this message.
-type RulesetPhaseVersionListResponseEnvelopeErrorsSource struct {
- // A JSON pointer to the field that is the source of the message.
- Pointer string `json:"pointer,required"`
- JSON rulesetPhaseVersionListResponseEnvelopeErrorsSourceJSON `json:"-"`
-}
-
-// rulesetPhaseVersionListResponseEnvelopeErrorsSourceJSON contains the JSON
-// metadata for the struct [RulesetPhaseVersionListResponseEnvelopeErrorsSource]
-type rulesetPhaseVersionListResponseEnvelopeErrorsSourceJSON struct {
- Pointer apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetPhaseVersionListResponseEnvelopeErrorsSource) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetPhaseVersionListResponseEnvelopeErrorsSourceJSON) RawJSON() string {
- return r.raw
-}
-
-// A message.
-type RulesetPhaseVersionListResponseEnvelopeMessages struct {
- // A text description of this message.
- Message string `json:"message,required"`
- // A unique code for this message.
- Code int64 `json:"code"`
- // The source of this message.
- Source RulesetPhaseVersionListResponseEnvelopeMessagesSource `json:"source"`
- JSON rulesetPhaseVersionListResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// rulesetPhaseVersionListResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [RulesetPhaseVersionListResponseEnvelopeMessages]
-type rulesetPhaseVersionListResponseEnvelopeMessagesJSON struct {
- Message apijson.Field
- Code apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetPhaseVersionListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetPhaseVersionListResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// The source of this message.
-type RulesetPhaseVersionListResponseEnvelopeMessagesSource struct {
- // A JSON pointer to the field that is the source of the message.
- Pointer string `json:"pointer,required"`
- JSON rulesetPhaseVersionListResponseEnvelopeMessagesSourceJSON `json:"-"`
-}
-
-// rulesetPhaseVersionListResponseEnvelopeMessagesSourceJSON contains the JSON
-// metadata for the struct [RulesetPhaseVersionListResponseEnvelopeMessagesSource]
-type rulesetPhaseVersionListResponseEnvelopeMessagesSourceJSON struct {
- Pointer apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetPhaseVersionListResponseEnvelopeMessagesSource) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetPhaseVersionListResponseEnvelopeMessagesSourceJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful.
-type RulesetPhaseVersionListResponseEnvelopeSuccess bool
-
-const (
- RulesetPhaseVersionListResponseEnvelopeSuccessTrue RulesetPhaseVersionListResponseEnvelopeSuccess = true
-)
-
-type RulesetPhaseVersionGetParams struct {
- // The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
- AccountID param.Field[string] `path:"account_id"`
- // The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- ZoneID param.Field[string] `path:"zone_id"`
-}
-
-// The phase of the ruleset.
-type RulesetPhaseVersionGetParamsRulesetPhase string
-
-const (
- RulesetPhaseVersionGetParamsRulesetPhaseDDOSL4 RulesetPhaseVersionGetParamsRulesetPhase = "ddos_l4"
- RulesetPhaseVersionGetParamsRulesetPhaseDDOSL7 RulesetPhaseVersionGetParamsRulesetPhase = "ddos_l7"
- RulesetPhaseVersionGetParamsRulesetPhaseHTTPConfigSettings RulesetPhaseVersionGetParamsRulesetPhase = "http_config_settings"
- RulesetPhaseVersionGetParamsRulesetPhaseHTTPCustomErrors RulesetPhaseVersionGetParamsRulesetPhase = "http_custom_errors"
- RulesetPhaseVersionGetParamsRulesetPhaseHTTPLogCustomFields RulesetPhaseVersionGetParamsRulesetPhase = "http_log_custom_fields"
- RulesetPhaseVersionGetParamsRulesetPhaseHTTPRatelimit RulesetPhaseVersionGetParamsRulesetPhase = "http_ratelimit"
- RulesetPhaseVersionGetParamsRulesetPhaseHTTPRequestCacheSettings RulesetPhaseVersionGetParamsRulesetPhase = "http_request_cache_settings"
- RulesetPhaseVersionGetParamsRulesetPhaseHTTPRequestDynamicRedirect RulesetPhaseVersionGetParamsRulesetPhase = "http_request_dynamic_redirect"
- RulesetPhaseVersionGetParamsRulesetPhaseHTTPRequestFirewallCustom RulesetPhaseVersionGetParamsRulesetPhase = "http_request_firewall_custom"
- RulesetPhaseVersionGetParamsRulesetPhaseHTTPRequestFirewallManaged RulesetPhaseVersionGetParamsRulesetPhase = "http_request_firewall_managed"
- RulesetPhaseVersionGetParamsRulesetPhaseHTTPRequestLateTransform RulesetPhaseVersionGetParamsRulesetPhase = "http_request_late_transform"
- RulesetPhaseVersionGetParamsRulesetPhaseHTTPRequestOrigin RulesetPhaseVersionGetParamsRulesetPhase = "http_request_origin"
- RulesetPhaseVersionGetParamsRulesetPhaseHTTPRequestRedirect RulesetPhaseVersionGetParamsRulesetPhase = "http_request_redirect"
- RulesetPhaseVersionGetParamsRulesetPhaseHTTPRequestSanitize RulesetPhaseVersionGetParamsRulesetPhase = "http_request_sanitize"
- RulesetPhaseVersionGetParamsRulesetPhaseHTTPRequestSbfm RulesetPhaseVersionGetParamsRulesetPhase = "http_request_sbfm"
- RulesetPhaseVersionGetParamsRulesetPhaseHTTPRequestSelectConfiguration RulesetPhaseVersionGetParamsRulesetPhase = "http_request_select_configuration"
- RulesetPhaseVersionGetParamsRulesetPhaseHTTPRequestTransform RulesetPhaseVersionGetParamsRulesetPhase = "http_request_transform"
- RulesetPhaseVersionGetParamsRulesetPhaseHTTPResponseCompression RulesetPhaseVersionGetParamsRulesetPhase = "http_response_compression"
- RulesetPhaseVersionGetParamsRulesetPhaseHTTPResponseFirewallManaged RulesetPhaseVersionGetParamsRulesetPhase = "http_response_firewall_managed"
- RulesetPhaseVersionGetParamsRulesetPhaseHTTPResponseHeadersTransform RulesetPhaseVersionGetParamsRulesetPhase = "http_response_headers_transform"
- RulesetPhaseVersionGetParamsRulesetPhaseMagicTransit RulesetPhaseVersionGetParamsRulesetPhase = "magic_transit"
- RulesetPhaseVersionGetParamsRulesetPhaseMagicTransitIDsManaged RulesetPhaseVersionGetParamsRulesetPhase = "magic_transit_ids_managed"
- RulesetPhaseVersionGetParamsRulesetPhaseMagicTransitManaged RulesetPhaseVersionGetParamsRulesetPhase = "magic_transit_managed"
-)
-
-// A response object.
-type RulesetPhaseVersionGetResponseEnvelope struct {
- // A list of error messages.
- Errors []RulesetPhaseVersionGetResponseEnvelopeErrors `json:"errors,required"`
- // A list of warning messages.
- Messages []RulesetPhaseVersionGetResponseEnvelopeMessages `json:"messages,required"`
- // A result.
- Result RulesetPhaseVersionGetResponse `json:"result,required"`
- // Whether the API call was successful.
- Success RulesetPhaseVersionGetResponseEnvelopeSuccess `json:"success,required"`
- JSON rulesetPhaseVersionGetResponseEnvelopeJSON `json:"-"`
-}
-
-// rulesetPhaseVersionGetResponseEnvelopeJSON contains the JSON metadata for the
-// struct [RulesetPhaseVersionGetResponseEnvelope]
-type rulesetPhaseVersionGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetPhaseVersionGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetPhaseVersionGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-// A message.
-type RulesetPhaseVersionGetResponseEnvelopeErrors struct {
- // A text description of this message.
- Message string `json:"message,required"`
- // A unique code for this message.
- Code int64 `json:"code"`
- // The source of this message.
- Source RulesetPhaseVersionGetResponseEnvelopeErrorsSource `json:"source"`
- JSON rulesetPhaseVersionGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// rulesetPhaseVersionGetResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [RulesetPhaseVersionGetResponseEnvelopeErrors]
-type rulesetPhaseVersionGetResponseEnvelopeErrorsJSON struct {
- Message apijson.Field
- Code apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetPhaseVersionGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetPhaseVersionGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-// The source of this message.
-type RulesetPhaseVersionGetResponseEnvelopeErrorsSource struct {
- // A JSON pointer to the field that is the source of the message.
- Pointer string `json:"pointer,required"`
- JSON rulesetPhaseVersionGetResponseEnvelopeErrorsSourceJSON `json:"-"`
-}
-
-// rulesetPhaseVersionGetResponseEnvelopeErrorsSourceJSON contains the JSON
-// metadata for the struct [RulesetPhaseVersionGetResponseEnvelopeErrorsSource]
-type rulesetPhaseVersionGetResponseEnvelopeErrorsSourceJSON struct {
- Pointer apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetPhaseVersionGetResponseEnvelopeErrorsSource) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetPhaseVersionGetResponseEnvelopeErrorsSourceJSON) RawJSON() string {
- return r.raw
-}
-
-// A message.
-type RulesetPhaseVersionGetResponseEnvelopeMessages struct {
- // A text description of this message.
- Message string `json:"message,required"`
- // A unique code for this message.
- Code int64 `json:"code"`
- // The source of this message.
- Source RulesetPhaseVersionGetResponseEnvelopeMessagesSource `json:"source"`
- JSON rulesetPhaseVersionGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// rulesetPhaseVersionGetResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [RulesetPhaseVersionGetResponseEnvelopeMessages]
-type rulesetPhaseVersionGetResponseEnvelopeMessagesJSON struct {
- Message apijson.Field
- Code apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetPhaseVersionGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetPhaseVersionGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// The source of this message.
-type RulesetPhaseVersionGetResponseEnvelopeMessagesSource struct {
- // A JSON pointer to the field that is the source of the message.
- Pointer string `json:"pointer,required"`
- JSON rulesetPhaseVersionGetResponseEnvelopeMessagesSourceJSON `json:"-"`
-}
-
-// rulesetPhaseVersionGetResponseEnvelopeMessagesSourceJSON contains the JSON
-// metadata for the struct [RulesetPhaseVersionGetResponseEnvelopeMessagesSource]
-type rulesetPhaseVersionGetResponseEnvelopeMessagesSourceJSON struct {
- Pointer apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetPhaseVersionGetResponseEnvelopeMessagesSource) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetPhaseVersionGetResponseEnvelopeMessagesSourceJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful.
-type RulesetPhaseVersionGetResponseEnvelopeSuccess bool
-
-const (
- RulesetPhaseVersionGetResponseEnvelopeSuccessTrue RulesetPhaseVersionGetResponseEnvelopeSuccess = true
-)
diff --git a/rulesetphaseversion_test.go b/rulesetphaseversion_test.go
deleted file mode 100644
index 353dd93908e..00000000000
--- a/rulesetphaseversion_test.go
+++ /dev/null
@@ -1,77 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRulesetPhaseVersionListWithOptionalParams(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"),
- )
- _, err := client.Rulesets.Phases.Versions.List(
- context.TODO(),
- cloudflare.RulesetPhaseVersionListParamsRulesetPhaseHTTPRequestFirewallCustom,
- cloudflare.RulesetPhaseVersionListParams{
- AccountID: cloudflare.F("string"),
- ZoneID: cloudflare.F("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())
- }
-}
-
-func TestRulesetPhaseVersionGetWithOptionalParams(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"),
- )
- _, err := client.Rulesets.Phases.Versions.Get(
- context.TODO(),
- cloudflare.RulesetPhaseVersionGetParamsRulesetPhaseHTTPRequestFirewallCustom,
- "1",
- cloudflare.RulesetPhaseVersionGetParams{
- AccountID: cloudflare.F("string"),
- ZoneID: cloudflare.F("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/rulesetrule.go b/rulesetrule.go
deleted file mode 100644
index 5c3249bd1ed..00000000000
--- a/rulesetrule.go
+++ /dev/null
@@ -1,3036 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "reflect"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
- "github.com/tidwall/gjson"
-)
-
-// RulesetRuleService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewRulesetRuleService] method
-// instead.
-type RulesetRuleService struct {
- Options []option.RequestOption
-}
-
-// NewRulesetRuleService generates a new service that applies the given options to
-// each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewRulesetRuleService(opts ...option.RequestOption) (r *RulesetRuleService) {
- r = &RulesetRuleService{}
- r.Options = opts
- return
-}
-
-// Adds a new rule to an account or zone ruleset. The rule will be added to the end
-// of the existing list of rules in the ruleset by default.
-func (r *RulesetRuleService) New(ctx context.Context, rulesetID string, params RulesetRuleNewParams, opts ...option.RequestOption) (res *RulesetRuleNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RulesetRuleNewResponseEnvelope
- var accountOrZone string
- var accountOrZoneID param.Field[string]
- if params.AccountID.Present {
- accountOrZone = "accounts"
- accountOrZoneID = params.AccountID
- } else {
- accountOrZone = "zones"
- accountOrZoneID = params.ZoneID
- }
- path := fmt.Sprintf("%s/%s/rulesets/%s/rules", accountOrZone, accountOrZoneID, rulesetID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Deletes an existing rule from an account or zone ruleset.
-func (r *RulesetRuleService) Delete(ctx context.Context, rulesetID string, ruleID string, body RulesetRuleDeleteParams, opts ...option.RequestOption) (res *RulesetRuleDeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RulesetRuleDeleteResponseEnvelope
- var accountOrZone string
- var accountOrZoneID param.Field[string]
- if body.AccountID.Present {
- accountOrZone = "accounts"
- accountOrZoneID = body.AccountID
- } else {
- accountOrZone = "zones"
- accountOrZoneID = body.ZoneID
- }
- path := fmt.Sprintf("%s/%s/rulesets/%s/rules/%s", accountOrZone, accountOrZoneID, rulesetID, ruleID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Updates an existing rule in an account ruleset.
-func (r *RulesetRuleService) Edit(ctx context.Context, rulesetID string, ruleID string, params RulesetRuleEditParams, opts ...option.RequestOption) (res *RulesetRuleEditResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RulesetRuleEditResponseEnvelope
- var accountOrZone string
- var accountOrZoneID param.Field[string]
- if params.AccountID.Present {
- accountOrZone = "accounts"
- accountOrZoneID = params.AccountID
- } else {
- accountOrZone = "zones"
- accountOrZoneID = params.ZoneID
- }
- path := fmt.Sprintf("%s/%s/rulesets/%s/rules/%s", accountOrZone, accountOrZoneID, rulesetID, ruleID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// A result.
-type RulesetRuleNewResponse struct {
- // The unique ID of the ruleset.
- ID string `json:"id,required"`
- // The kind of the ruleset.
- Kind RulesetRuleNewResponseKind `json:"kind,required"`
- // The timestamp of when the ruleset was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The human-readable name of the ruleset.
- Name string `json:"name,required"`
- // The phase of the ruleset.
- Phase RulesetRuleNewResponsePhase `json:"phase,required"`
- // The list of rules in the ruleset.
- Rules []RulesetRuleNewResponseRule `json:"rules,required"`
- // The version of the ruleset.
- Version string `json:"version,required"`
- // An informative description of the ruleset.
- Description string `json:"description"`
- JSON rulesetRuleNewResponseJSON `json:"-"`
-}
-
-// rulesetRuleNewResponseJSON contains the JSON metadata for the struct
-// [RulesetRuleNewResponse]
-type rulesetRuleNewResponseJSON struct {
- ID apijson.Field
- Kind apijson.Field
- LastUpdated apijson.Field
- Name apijson.Field
- Phase apijson.Field
- Rules apijson.Field
- Version apijson.Field
- Description apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetRuleNewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetRuleNewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// The kind of the ruleset.
-type RulesetRuleNewResponseKind string
-
-const (
- RulesetRuleNewResponseKindManaged RulesetRuleNewResponseKind = "managed"
- RulesetRuleNewResponseKindCustom RulesetRuleNewResponseKind = "custom"
- RulesetRuleNewResponseKindRoot RulesetRuleNewResponseKind = "root"
- RulesetRuleNewResponseKindZone RulesetRuleNewResponseKind = "zone"
-)
-
-// The phase of the ruleset.
-type RulesetRuleNewResponsePhase string
-
-const (
- RulesetRuleNewResponsePhaseDDOSL4 RulesetRuleNewResponsePhase = "ddos_l4"
- RulesetRuleNewResponsePhaseDDOSL7 RulesetRuleNewResponsePhase = "ddos_l7"
- RulesetRuleNewResponsePhaseHTTPConfigSettings RulesetRuleNewResponsePhase = "http_config_settings"
- RulesetRuleNewResponsePhaseHTTPCustomErrors RulesetRuleNewResponsePhase = "http_custom_errors"
- RulesetRuleNewResponsePhaseHTTPLogCustomFields RulesetRuleNewResponsePhase = "http_log_custom_fields"
- RulesetRuleNewResponsePhaseHTTPRatelimit RulesetRuleNewResponsePhase = "http_ratelimit"
- RulesetRuleNewResponsePhaseHTTPRequestCacheSettings RulesetRuleNewResponsePhase = "http_request_cache_settings"
- RulesetRuleNewResponsePhaseHTTPRequestDynamicRedirect RulesetRuleNewResponsePhase = "http_request_dynamic_redirect"
- RulesetRuleNewResponsePhaseHTTPRequestFirewallCustom RulesetRuleNewResponsePhase = "http_request_firewall_custom"
- RulesetRuleNewResponsePhaseHTTPRequestFirewallManaged RulesetRuleNewResponsePhase = "http_request_firewall_managed"
- RulesetRuleNewResponsePhaseHTTPRequestLateTransform RulesetRuleNewResponsePhase = "http_request_late_transform"
- RulesetRuleNewResponsePhaseHTTPRequestOrigin RulesetRuleNewResponsePhase = "http_request_origin"
- RulesetRuleNewResponsePhaseHTTPRequestRedirect RulesetRuleNewResponsePhase = "http_request_redirect"
- RulesetRuleNewResponsePhaseHTTPRequestSanitize RulesetRuleNewResponsePhase = "http_request_sanitize"
- RulesetRuleNewResponsePhaseHTTPRequestSbfm RulesetRuleNewResponsePhase = "http_request_sbfm"
- RulesetRuleNewResponsePhaseHTTPRequestSelectConfiguration RulesetRuleNewResponsePhase = "http_request_select_configuration"
- RulesetRuleNewResponsePhaseHTTPRequestTransform RulesetRuleNewResponsePhase = "http_request_transform"
- RulesetRuleNewResponsePhaseHTTPResponseCompression RulesetRuleNewResponsePhase = "http_response_compression"
- RulesetRuleNewResponsePhaseHTTPResponseFirewallManaged RulesetRuleNewResponsePhase = "http_response_firewall_managed"
- RulesetRuleNewResponsePhaseHTTPResponseHeadersTransform RulesetRuleNewResponsePhase = "http_response_headers_transform"
- RulesetRuleNewResponsePhaseMagicTransit RulesetRuleNewResponsePhase = "magic_transit"
- RulesetRuleNewResponsePhaseMagicTransitIDsManaged RulesetRuleNewResponsePhase = "magic_transit_ids_managed"
- RulesetRuleNewResponsePhaseMagicTransitManaged RulesetRuleNewResponsePhase = "magic_transit_managed"
-)
-
-// Union satisfied by [RulesetRuleNewResponseRulesRulesetsBlockRule],
-// [RulesetRuleNewResponseRulesRulesetsExecuteRule],
-// [RulesetRuleNewResponseRulesRulesetsLogRule] or
-// [RulesetRuleNewResponseRulesRulesetsSkipRule].
-type RulesetRuleNewResponseRule interface {
- implementsRulesetRuleNewResponseRule()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*RulesetRuleNewResponseRule)(nil)).Elem(),
- "action",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(RulesetRuleNewResponseRulesRulesetsBlockRule{}),
- DiscriminatorValue: "block",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(RulesetRuleNewResponseRulesRulesetsExecuteRule{}),
- DiscriminatorValue: "execute",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(RulesetRuleNewResponseRulesRulesetsLogRule{}),
- DiscriminatorValue: "log",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(RulesetRuleNewResponseRulesRulesetsSkipRule{}),
- DiscriminatorValue: "skip",
- },
- )
-}
-
-type RulesetRuleNewResponseRulesRulesetsBlockRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action RulesetRuleNewResponseRulesRulesetsBlockRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters RulesetRuleNewResponseRulesRulesetsBlockRuleActionParameters `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging RulesetRuleNewResponseRulesRulesetsBlockRuleLogging `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON rulesetRuleNewResponseRulesRulesetsBlockRuleJSON `json:"-"`
-}
-
-// rulesetRuleNewResponseRulesRulesetsBlockRuleJSON contains the JSON metadata for
-// the struct [RulesetRuleNewResponseRulesRulesetsBlockRule]
-type rulesetRuleNewResponseRulesRulesetsBlockRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetRuleNewResponseRulesRulesetsBlockRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetRuleNewResponseRulesRulesetsBlockRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r RulesetRuleNewResponseRulesRulesetsBlockRule) implementsRulesetRuleNewResponseRule() {}
-
-// The action to perform when the rule matches.
-type RulesetRuleNewResponseRulesRulesetsBlockRuleAction string
-
-const (
- RulesetRuleNewResponseRulesRulesetsBlockRuleActionBlock RulesetRuleNewResponseRulesRulesetsBlockRuleAction = "block"
-)
-
-// The parameters configuring the rule's action.
-type RulesetRuleNewResponseRulesRulesetsBlockRuleActionParameters struct {
- // The response to show when the block is applied.
- Response RulesetRuleNewResponseRulesRulesetsBlockRuleActionParametersResponse `json:"response"`
- JSON rulesetRuleNewResponseRulesRulesetsBlockRuleActionParametersJSON `json:"-"`
-}
-
-// rulesetRuleNewResponseRulesRulesetsBlockRuleActionParametersJSON contains the
-// JSON metadata for the struct
-// [RulesetRuleNewResponseRulesRulesetsBlockRuleActionParameters]
-type rulesetRuleNewResponseRulesRulesetsBlockRuleActionParametersJSON struct {
- Response apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetRuleNewResponseRulesRulesetsBlockRuleActionParameters) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetRuleNewResponseRulesRulesetsBlockRuleActionParametersJSON) RawJSON() string {
- return r.raw
-}
-
-// The response to show when the block is applied.
-type RulesetRuleNewResponseRulesRulesetsBlockRuleActionParametersResponse struct {
- // The content to return.
- Content string `json:"content,required"`
- // The type of the content to return.
- ContentType string `json:"content_type,required"`
- // The status code to return.
- StatusCode int64 `json:"status_code,required"`
- JSON rulesetRuleNewResponseRulesRulesetsBlockRuleActionParametersResponseJSON `json:"-"`
-}
-
-// rulesetRuleNewResponseRulesRulesetsBlockRuleActionParametersResponseJSON
-// contains the JSON metadata for the struct
-// [RulesetRuleNewResponseRulesRulesetsBlockRuleActionParametersResponse]
-type rulesetRuleNewResponseRulesRulesetsBlockRuleActionParametersResponseJSON struct {
- Content apijson.Field
- ContentType apijson.Field
- StatusCode apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetRuleNewResponseRulesRulesetsBlockRuleActionParametersResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetRuleNewResponseRulesRulesetsBlockRuleActionParametersResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// An object configuring the rule's logging behavior.
-type RulesetRuleNewResponseRulesRulesetsBlockRuleLogging struct {
- // Whether to generate a log when the rule matches.
- Enabled bool `json:"enabled,required"`
- JSON rulesetRuleNewResponseRulesRulesetsBlockRuleLoggingJSON `json:"-"`
-}
-
-// rulesetRuleNewResponseRulesRulesetsBlockRuleLoggingJSON contains the JSON
-// metadata for the struct [RulesetRuleNewResponseRulesRulesetsBlockRuleLogging]
-type rulesetRuleNewResponseRulesRulesetsBlockRuleLoggingJSON struct {
- Enabled apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetRuleNewResponseRulesRulesetsBlockRuleLogging) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetRuleNewResponseRulesRulesetsBlockRuleLoggingJSON) RawJSON() string {
- return r.raw
-}
-
-type RulesetRuleNewResponseRulesRulesetsExecuteRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action RulesetRuleNewResponseRulesRulesetsExecuteRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParameters `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging RulesetRuleNewResponseRulesRulesetsExecuteRuleLogging `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON rulesetRuleNewResponseRulesRulesetsExecuteRuleJSON `json:"-"`
-}
-
-// rulesetRuleNewResponseRulesRulesetsExecuteRuleJSON contains the JSON metadata
-// for the struct [RulesetRuleNewResponseRulesRulesetsExecuteRule]
-type rulesetRuleNewResponseRulesRulesetsExecuteRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetRuleNewResponseRulesRulesetsExecuteRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetRuleNewResponseRulesRulesetsExecuteRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r RulesetRuleNewResponseRulesRulesetsExecuteRule) implementsRulesetRuleNewResponseRule() {}
-
-// The action to perform when the rule matches.
-type RulesetRuleNewResponseRulesRulesetsExecuteRuleAction string
-
-const (
- RulesetRuleNewResponseRulesRulesetsExecuteRuleActionExecute RulesetRuleNewResponseRulesRulesetsExecuteRuleAction = "execute"
-)
-
-// The parameters configuring the rule's action.
-type RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParameters struct {
- // The ID of the ruleset to execute.
- ID string `json:"id,required"`
- // The configuration to use for matched data logging.
- MatchedData RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersMatchedData `json:"matched_data"`
- // A set of overrides to apply to the target ruleset.
- Overrides RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverrides `json:"overrides"`
- JSON rulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersJSON `json:"-"`
-}
-
-// rulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersJSON contains the
-// JSON metadata for the struct
-// [RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParameters]
-type rulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersJSON struct {
- ID apijson.Field
- MatchedData apijson.Field
- Overrides apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParameters) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersJSON) RawJSON() string {
- return r.raw
-}
-
-// The configuration to use for matched data logging.
-type RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersMatchedData struct {
- // The public key to encrypt matched data logs with.
- PublicKey string `json:"public_key,required"`
- JSON rulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON `json:"-"`
-}
-
-// rulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON
-// contains the JSON metadata for the struct
-// [RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersMatchedData]
-type rulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON struct {
- PublicKey apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersMatchedData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON) RawJSON() string {
- return r.raw
-}
-
-// A set of overrides to apply to the target ruleset.
-type RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverrides struct {
- // An action to override all rules with. This option has lower precedence than rule
- // and category overrides.
- Action string `json:"action"`
- // A list of category-level overrides. This option has the second-highest
- // precedence after rule-level overrides.
- Categories []RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory `json:"categories"`
- // Whether to enable execution of all rules. This option has lower precedence than
- // rule and category overrides.
- Enabled bool `json:"enabled"`
- // A list of rule-level overrides. This option has the highest precedence.
- Rules []RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRule `json:"rules"`
- // A sensitivity level to set for all rules. This option has lower precedence than
- // rule and category overrides and is only applicable for DDoS phases.
- SensitivityLevel RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel `json:"sensitivity_level"`
- JSON rulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON `json:"-"`
-}
-
-// rulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON
-// contains the JSON metadata for the struct
-// [RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverrides]
-type rulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON struct {
- Action apijson.Field
- Categories apijson.Field
- Enabled apijson.Field
- Rules apijson.Field
- SensitivityLevel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverrides) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON) RawJSON() string {
- return r.raw
-}
-
-// A category-level override
-type RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory struct {
- // The name of the category to override.
- Category string `json:"category,required"`
- // The action to override rules in the category with.
- Action string `json:"action"`
- // Whether to enable execution of rules in the category.
- Enabled bool `json:"enabled"`
- // The sensitivity level to use for rules in the category.
- SensitivityLevel RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel `json:"sensitivity_level"`
- JSON rulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON `json:"-"`
-}
-
-// rulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON
-// contains the JSON metadata for the struct
-// [RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory]
-type rulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON struct {
- Category apijson.Field
- Action apijson.Field
- Enabled apijson.Field
- SensitivityLevel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON) RawJSON() string {
- return r.raw
-}
-
-// The sensitivity level to use for rules in the category.
-type RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel string
-
-const (
- RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "default"
- RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "medium"
- RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "low"
- RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "eoff"
-)
-
-// A rule-level override
-type RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRule struct {
- // The ID of the rule to override.
- ID string `json:"id,required"`
- // The action to override the rule with.
- Action string `json:"action"`
- // Whether to enable execution of the rule.
- Enabled bool `json:"enabled"`
- // The score threshold to use for the rule.
- ScoreThreshold int64 `json:"score_threshold"`
- // The sensitivity level to use for the rule.
- SensitivityLevel RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel `json:"sensitivity_level"`
- JSON rulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON `json:"-"`
-}
-
-// rulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON
-// contains the JSON metadata for the struct
-// [RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRule]
-type rulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON struct {
- ID apijson.Field
- Action apijson.Field
- Enabled apijson.Field
- ScoreThreshold apijson.Field
- SensitivityLevel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON) RawJSON() string {
- return r.raw
-}
-
-// The sensitivity level to use for the rule.
-type RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel string
-
-const (
- RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "default"
- RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "medium"
- RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelLow RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "low"
- RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "eoff"
-)
-
-// A sensitivity level to set for all rules. This option has lower precedence than
-// rule and category overrides and is only applicable for DDoS phases.
-type RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel string
-
-const (
- RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelDefault RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "default"
- RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelMedium RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "medium"
- RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelLow RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "low"
- RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelEoff RulesetRuleNewResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "eoff"
-)
-
-// An object configuring the rule's logging behavior.
-type RulesetRuleNewResponseRulesRulesetsExecuteRuleLogging struct {
- // Whether to generate a log when the rule matches.
- Enabled bool `json:"enabled,required"`
- JSON rulesetRuleNewResponseRulesRulesetsExecuteRuleLoggingJSON `json:"-"`
-}
-
-// rulesetRuleNewResponseRulesRulesetsExecuteRuleLoggingJSON contains the JSON
-// metadata for the struct [RulesetRuleNewResponseRulesRulesetsExecuteRuleLogging]
-type rulesetRuleNewResponseRulesRulesetsExecuteRuleLoggingJSON struct {
- Enabled apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetRuleNewResponseRulesRulesetsExecuteRuleLogging) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetRuleNewResponseRulesRulesetsExecuteRuleLoggingJSON) RawJSON() string {
- return r.raw
-}
-
-type RulesetRuleNewResponseRulesRulesetsLogRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action RulesetRuleNewResponseRulesRulesetsLogRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters interface{} `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging RulesetRuleNewResponseRulesRulesetsLogRuleLogging `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON rulesetRuleNewResponseRulesRulesetsLogRuleJSON `json:"-"`
-}
-
-// rulesetRuleNewResponseRulesRulesetsLogRuleJSON contains the JSON metadata for
-// the struct [RulesetRuleNewResponseRulesRulesetsLogRule]
-type rulesetRuleNewResponseRulesRulesetsLogRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetRuleNewResponseRulesRulesetsLogRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetRuleNewResponseRulesRulesetsLogRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r RulesetRuleNewResponseRulesRulesetsLogRule) implementsRulesetRuleNewResponseRule() {}
-
-// The action to perform when the rule matches.
-type RulesetRuleNewResponseRulesRulesetsLogRuleAction string
-
-const (
- RulesetRuleNewResponseRulesRulesetsLogRuleActionLog RulesetRuleNewResponseRulesRulesetsLogRuleAction = "log"
-)
-
-// An object configuring the rule's logging behavior.
-type RulesetRuleNewResponseRulesRulesetsLogRuleLogging struct {
- // Whether to generate a log when the rule matches.
- Enabled bool `json:"enabled,required"`
- JSON rulesetRuleNewResponseRulesRulesetsLogRuleLoggingJSON `json:"-"`
-}
-
-// rulesetRuleNewResponseRulesRulesetsLogRuleLoggingJSON contains the JSON metadata
-// for the struct [RulesetRuleNewResponseRulesRulesetsLogRuleLogging]
-type rulesetRuleNewResponseRulesRulesetsLogRuleLoggingJSON struct {
- Enabled apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetRuleNewResponseRulesRulesetsLogRuleLogging) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetRuleNewResponseRulesRulesetsLogRuleLoggingJSON) RawJSON() string {
- return r.raw
-}
-
-type RulesetRuleNewResponseRulesRulesetsSkipRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action RulesetRuleNewResponseRulesRulesetsSkipRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters RulesetRuleNewResponseRulesRulesetsSkipRuleActionParameters `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging RulesetRuleNewResponseRulesRulesetsSkipRuleLogging `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON rulesetRuleNewResponseRulesRulesetsSkipRuleJSON `json:"-"`
-}
-
-// rulesetRuleNewResponseRulesRulesetsSkipRuleJSON contains the JSON metadata for
-// the struct [RulesetRuleNewResponseRulesRulesetsSkipRule]
-type rulesetRuleNewResponseRulesRulesetsSkipRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetRuleNewResponseRulesRulesetsSkipRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetRuleNewResponseRulesRulesetsSkipRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r RulesetRuleNewResponseRulesRulesetsSkipRule) implementsRulesetRuleNewResponseRule() {}
-
-// The action to perform when the rule matches.
-type RulesetRuleNewResponseRulesRulesetsSkipRuleAction string
-
-const (
- RulesetRuleNewResponseRulesRulesetsSkipRuleActionSkip RulesetRuleNewResponseRulesRulesetsSkipRuleAction = "skip"
-)
-
-// The parameters configuring the rule's action.
-type RulesetRuleNewResponseRulesRulesetsSkipRuleActionParameters struct {
- // A list of phases to skip the execution of. This option is incompatible with the
- // ruleset and rulesets options.
- Phases []RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhase `json:"phases"`
- // A list of legacy security products to skip the execution of.
- Products []RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersProduct `json:"products"`
- // A mapping of ruleset IDs to a list of rule IDs in that ruleset to skip the
- // execution of. This option is incompatible with the ruleset option.
- Rules map[string][]string `json:"rules"`
- // A ruleset to skip the execution of. This option is incompatible with the
- // rulesets, rules and phases options.
- Ruleset RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersRuleset `json:"ruleset"`
- // A list of ruleset IDs to skip the execution of. This option is incompatible with
- // the ruleset and phases options.
- Rulesets []string `json:"rulesets"`
- JSON rulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersJSON `json:"-"`
-}
-
-// rulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersJSON contains the
-// JSON metadata for the struct
-// [RulesetRuleNewResponseRulesRulesetsSkipRuleActionParameters]
-type rulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersJSON struct {
- Phases apijson.Field
- Products apijson.Field
- Rules apijson.Field
- Ruleset apijson.Field
- Rulesets apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetRuleNewResponseRulesRulesetsSkipRuleActionParameters) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersJSON) RawJSON() string {
- return r.raw
-}
-
-// A phase to skip the execution of.
-type RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhase string
-
-const (
- RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseDDOSL4 RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhase = "ddos_l4"
- RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseDDOSL7 RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhase = "ddos_l7"
- RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPConfigSettings RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_config_settings"
- RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPCustomErrors RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_custom_errors"
- RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPLogCustomFields RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_log_custom_fields"
- RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRatelimit RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_ratelimit"
- RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestCacheSettings RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_cache_settings"
- RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestDynamicRedirect RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_dynamic_redirect"
- RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallCustom RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_custom"
- RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallManaged RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_managed"
- RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestLateTransform RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_late_transform"
- RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestOrigin RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_origin"
- RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestRedirect RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_redirect"
- RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSanitize RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_sanitize"
- RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSbfm RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_sbfm"
- RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSelectConfiguration RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_select_configuration"
- RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestTransform RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_transform"
- RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseCompression RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_compression"
- RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseFirewallManaged RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_firewall_managed"
- RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseHeadersTransform RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_headers_transform"
- RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransit RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit"
- RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitIDsManaged RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_ids_managed"
- RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitManaged RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_managed"
-)
-
-// The name of a legacy security product to skip the execution of.
-type RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersProduct string
-
-const (
- RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersProductBic RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersProduct = "bic"
- RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersProductHot RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersProduct = "hot"
- RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersProductRateLimit RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersProduct = "rateLimit"
- RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersProductSecurityLevel RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersProduct = "securityLevel"
- RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersProductUABlock RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersProduct = "uaBlock"
- RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersProductWAF RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersProduct = "waf"
- RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersProductZoneLockdown RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersProduct = "zoneLockdown"
-)
-
-// A ruleset to skip the execution of. This option is incompatible with the
-// rulesets, rules and phases options.
-type RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersRuleset string
-
-const (
- RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersRulesetCurrent RulesetRuleNewResponseRulesRulesetsSkipRuleActionParametersRuleset = "current"
-)
-
-// An object configuring the rule's logging behavior.
-type RulesetRuleNewResponseRulesRulesetsSkipRuleLogging struct {
- // Whether to generate a log when the rule matches.
- Enabled bool `json:"enabled,required"`
- JSON rulesetRuleNewResponseRulesRulesetsSkipRuleLoggingJSON `json:"-"`
-}
-
-// rulesetRuleNewResponseRulesRulesetsSkipRuleLoggingJSON contains the JSON
-// metadata for the struct [RulesetRuleNewResponseRulesRulesetsSkipRuleLogging]
-type rulesetRuleNewResponseRulesRulesetsSkipRuleLoggingJSON struct {
- Enabled apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetRuleNewResponseRulesRulesetsSkipRuleLogging) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetRuleNewResponseRulesRulesetsSkipRuleLoggingJSON) RawJSON() string {
- return r.raw
-}
-
-// A result.
-type RulesetRuleDeleteResponse struct {
- // The unique ID of the ruleset.
- ID string `json:"id,required"`
- // The kind of the ruleset.
- Kind RulesetRuleDeleteResponseKind `json:"kind,required"`
- // The timestamp of when the ruleset was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The human-readable name of the ruleset.
- Name string `json:"name,required"`
- // The phase of the ruleset.
- Phase RulesetRuleDeleteResponsePhase `json:"phase,required"`
- // The list of rules in the ruleset.
- Rules []RulesetRuleDeleteResponseRule `json:"rules,required"`
- // The version of the ruleset.
- Version string `json:"version,required"`
- // An informative description of the ruleset.
- Description string `json:"description"`
- JSON rulesetRuleDeleteResponseJSON `json:"-"`
-}
-
-// rulesetRuleDeleteResponseJSON contains the JSON metadata for the struct
-// [RulesetRuleDeleteResponse]
-type rulesetRuleDeleteResponseJSON struct {
- ID apijson.Field
- Kind apijson.Field
- LastUpdated apijson.Field
- Name apijson.Field
- Phase apijson.Field
- Rules apijson.Field
- Version apijson.Field
- Description apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetRuleDeleteResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetRuleDeleteResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// The kind of the ruleset.
-type RulesetRuleDeleteResponseKind string
-
-const (
- RulesetRuleDeleteResponseKindManaged RulesetRuleDeleteResponseKind = "managed"
- RulesetRuleDeleteResponseKindCustom RulesetRuleDeleteResponseKind = "custom"
- RulesetRuleDeleteResponseKindRoot RulesetRuleDeleteResponseKind = "root"
- RulesetRuleDeleteResponseKindZone RulesetRuleDeleteResponseKind = "zone"
-)
-
-// The phase of the ruleset.
-type RulesetRuleDeleteResponsePhase string
-
-const (
- RulesetRuleDeleteResponsePhaseDDOSL4 RulesetRuleDeleteResponsePhase = "ddos_l4"
- RulesetRuleDeleteResponsePhaseDDOSL7 RulesetRuleDeleteResponsePhase = "ddos_l7"
- RulesetRuleDeleteResponsePhaseHTTPConfigSettings RulesetRuleDeleteResponsePhase = "http_config_settings"
- RulesetRuleDeleteResponsePhaseHTTPCustomErrors RulesetRuleDeleteResponsePhase = "http_custom_errors"
- RulesetRuleDeleteResponsePhaseHTTPLogCustomFields RulesetRuleDeleteResponsePhase = "http_log_custom_fields"
- RulesetRuleDeleteResponsePhaseHTTPRatelimit RulesetRuleDeleteResponsePhase = "http_ratelimit"
- RulesetRuleDeleteResponsePhaseHTTPRequestCacheSettings RulesetRuleDeleteResponsePhase = "http_request_cache_settings"
- RulesetRuleDeleteResponsePhaseHTTPRequestDynamicRedirect RulesetRuleDeleteResponsePhase = "http_request_dynamic_redirect"
- RulesetRuleDeleteResponsePhaseHTTPRequestFirewallCustom RulesetRuleDeleteResponsePhase = "http_request_firewall_custom"
- RulesetRuleDeleteResponsePhaseHTTPRequestFirewallManaged RulesetRuleDeleteResponsePhase = "http_request_firewall_managed"
- RulesetRuleDeleteResponsePhaseHTTPRequestLateTransform RulesetRuleDeleteResponsePhase = "http_request_late_transform"
- RulesetRuleDeleteResponsePhaseHTTPRequestOrigin RulesetRuleDeleteResponsePhase = "http_request_origin"
- RulesetRuleDeleteResponsePhaseHTTPRequestRedirect RulesetRuleDeleteResponsePhase = "http_request_redirect"
- RulesetRuleDeleteResponsePhaseHTTPRequestSanitize RulesetRuleDeleteResponsePhase = "http_request_sanitize"
- RulesetRuleDeleteResponsePhaseHTTPRequestSbfm RulesetRuleDeleteResponsePhase = "http_request_sbfm"
- RulesetRuleDeleteResponsePhaseHTTPRequestSelectConfiguration RulesetRuleDeleteResponsePhase = "http_request_select_configuration"
- RulesetRuleDeleteResponsePhaseHTTPRequestTransform RulesetRuleDeleteResponsePhase = "http_request_transform"
- RulesetRuleDeleteResponsePhaseHTTPResponseCompression RulesetRuleDeleteResponsePhase = "http_response_compression"
- RulesetRuleDeleteResponsePhaseHTTPResponseFirewallManaged RulesetRuleDeleteResponsePhase = "http_response_firewall_managed"
- RulesetRuleDeleteResponsePhaseHTTPResponseHeadersTransform RulesetRuleDeleteResponsePhase = "http_response_headers_transform"
- RulesetRuleDeleteResponsePhaseMagicTransit RulesetRuleDeleteResponsePhase = "magic_transit"
- RulesetRuleDeleteResponsePhaseMagicTransitIDsManaged RulesetRuleDeleteResponsePhase = "magic_transit_ids_managed"
- RulesetRuleDeleteResponsePhaseMagicTransitManaged RulesetRuleDeleteResponsePhase = "magic_transit_managed"
-)
-
-// Union satisfied by [RulesetRuleDeleteResponseRulesRulesetsBlockRule],
-// [RulesetRuleDeleteResponseRulesRulesetsExecuteRule],
-// [RulesetRuleDeleteResponseRulesRulesetsLogRule] or
-// [RulesetRuleDeleteResponseRulesRulesetsSkipRule].
-type RulesetRuleDeleteResponseRule interface {
- implementsRulesetRuleDeleteResponseRule()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*RulesetRuleDeleteResponseRule)(nil)).Elem(),
- "action",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(RulesetRuleDeleteResponseRulesRulesetsBlockRule{}),
- DiscriminatorValue: "block",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(RulesetRuleDeleteResponseRulesRulesetsExecuteRule{}),
- DiscriminatorValue: "execute",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(RulesetRuleDeleteResponseRulesRulesetsLogRule{}),
- DiscriminatorValue: "log",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(RulesetRuleDeleteResponseRulesRulesetsSkipRule{}),
- DiscriminatorValue: "skip",
- },
- )
-}
-
-type RulesetRuleDeleteResponseRulesRulesetsBlockRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action RulesetRuleDeleteResponseRulesRulesetsBlockRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters RulesetRuleDeleteResponseRulesRulesetsBlockRuleActionParameters `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging RulesetRuleDeleteResponseRulesRulesetsBlockRuleLogging `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON rulesetRuleDeleteResponseRulesRulesetsBlockRuleJSON `json:"-"`
-}
-
-// rulesetRuleDeleteResponseRulesRulesetsBlockRuleJSON contains the JSON metadata
-// for the struct [RulesetRuleDeleteResponseRulesRulesetsBlockRule]
-type rulesetRuleDeleteResponseRulesRulesetsBlockRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetRuleDeleteResponseRulesRulesetsBlockRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetRuleDeleteResponseRulesRulesetsBlockRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r RulesetRuleDeleteResponseRulesRulesetsBlockRule) implementsRulesetRuleDeleteResponseRule() {}
-
-// The action to perform when the rule matches.
-type RulesetRuleDeleteResponseRulesRulesetsBlockRuleAction string
-
-const (
- RulesetRuleDeleteResponseRulesRulesetsBlockRuleActionBlock RulesetRuleDeleteResponseRulesRulesetsBlockRuleAction = "block"
-)
-
-// The parameters configuring the rule's action.
-type RulesetRuleDeleteResponseRulesRulesetsBlockRuleActionParameters struct {
- // The response to show when the block is applied.
- Response RulesetRuleDeleteResponseRulesRulesetsBlockRuleActionParametersResponse `json:"response"`
- JSON rulesetRuleDeleteResponseRulesRulesetsBlockRuleActionParametersJSON `json:"-"`
-}
-
-// rulesetRuleDeleteResponseRulesRulesetsBlockRuleActionParametersJSON contains the
-// JSON metadata for the struct
-// [RulesetRuleDeleteResponseRulesRulesetsBlockRuleActionParameters]
-type rulesetRuleDeleteResponseRulesRulesetsBlockRuleActionParametersJSON struct {
- Response apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetRuleDeleteResponseRulesRulesetsBlockRuleActionParameters) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetRuleDeleteResponseRulesRulesetsBlockRuleActionParametersJSON) RawJSON() string {
- return r.raw
-}
-
-// The response to show when the block is applied.
-type RulesetRuleDeleteResponseRulesRulesetsBlockRuleActionParametersResponse struct {
- // The content to return.
- Content string `json:"content,required"`
- // The type of the content to return.
- ContentType string `json:"content_type,required"`
- // The status code to return.
- StatusCode int64 `json:"status_code,required"`
- JSON rulesetRuleDeleteResponseRulesRulesetsBlockRuleActionParametersResponseJSON `json:"-"`
-}
-
-// rulesetRuleDeleteResponseRulesRulesetsBlockRuleActionParametersResponseJSON
-// contains the JSON metadata for the struct
-// [RulesetRuleDeleteResponseRulesRulesetsBlockRuleActionParametersResponse]
-type rulesetRuleDeleteResponseRulesRulesetsBlockRuleActionParametersResponseJSON struct {
- Content apijson.Field
- ContentType apijson.Field
- StatusCode apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetRuleDeleteResponseRulesRulesetsBlockRuleActionParametersResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetRuleDeleteResponseRulesRulesetsBlockRuleActionParametersResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// An object configuring the rule's logging behavior.
-type RulesetRuleDeleteResponseRulesRulesetsBlockRuleLogging struct {
- // Whether to generate a log when the rule matches.
- Enabled bool `json:"enabled,required"`
- JSON rulesetRuleDeleteResponseRulesRulesetsBlockRuleLoggingJSON `json:"-"`
-}
-
-// rulesetRuleDeleteResponseRulesRulesetsBlockRuleLoggingJSON contains the JSON
-// metadata for the struct [RulesetRuleDeleteResponseRulesRulesetsBlockRuleLogging]
-type rulesetRuleDeleteResponseRulesRulesetsBlockRuleLoggingJSON struct {
- Enabled apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetRuleDeleteResponseRulesRulesetsBlockRuleLogging) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetRuleDeleteResponseRulesRulesetsBlockRuleLoggingJSON) RawJSON() string {
- return r.raw
-}
-
-type RulesetRuleDeleteResponseRulesRulesetsExecuteRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action RulesetRuleDeleteResponseRulesRulesetsExecuteRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParameters `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging RulesetRuleDeleteResponseRulesRulesetsExecuteRuleLogging `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON rulesetRuleDeleteResponseRulesRulesetsExecuteRuleJSON `json:"-"`
-}
-
-// rulesetRuleDeleteResponseRulesRulesetsExecuteRuleJSON contains the JSON metadata
-// for the struct [RulesetRuleDeleteResponseRulesRulesetsExecuteRule]
-type rulesetRuleDeleteResponseRulesRulesetsExecuteRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetRuleDeleteResponseRulesRulesetsExecuteRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetRuleDeleteResponseRulesRulesetsExecuteRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r RulesetRuleDeleteResponseRulesRulesetsExecuteRule) implementsRulesetRuleDeleteResponseRule() {
-}
-
-// The action to perform when the rule matches.
-type RulesetRuleDeleteResponseRulesRulesetsExecuteRuleAction string
-
-const (
- RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionExecute RulesetRuleDeleteResponseRulesRulesetsExecuteRuleAction = "execute"
-)
-
-// The parameters configuring the rule's action.
-type RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParameters struct {
- // The ID of the ruleset to execute.
- ID string `json:"id,required"`
- // The configuration to use for matched data logging.
- MatchedData RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersMatchedData `json:"matched_data"`
- // A set of overrides to apply to the target ruleset.
- Overrides RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverrides `json:"overrides"`
- JSON rulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersJSON `json:"-"`
-}
-
-// rulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersJSON contains
-// the JSON metadata for the struct
-// [RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParameters]
-type rulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersJSON struct {
- ID apijson.Field
- MatchedData apijson.Field
- Overrides apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParameters) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersJSON) RawJSON() string {
- return r.raw
-}
-
-// The configuration to use for matched data logging.
-type RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersMatchedData struct {
- // The public key to encrypt matched data logs with.
- PublicKey string `json:"public_key,required"`
- JSON rulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON `json:"-"`
-}
-
-// rulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON
-// contains the JSON metadata for the struct
-// [RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersMatchedData]
-type rulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON struct {
- PublicKey apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersMatchedData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON) RawJSON() string {
- return r.raw
-}
-
-// A set of overrides to apply to the target ruleset.
-type RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverrides struct {
- // An action to override all rules with. This option has lower precedence than rule
- // and category overrides.
- Action string `json:"action"`
- // A list of category-level overrides. This option has the second-highest
- // precedence after rule-level overrides.
- Categories []RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory `json:"categories"`
- // Whether to enable execution of all rules. This option has lower precedence than
- // rule and category overrides.
- Enabled bool `json:"enabled"`
- // A list of rule-level overrides. This option has the highest precedence.
- Rules []RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesRule `json:"rules"`
- // A sensitivity level to set for all rules. This option has lower precedence than
- // rule and category overrides and is only applicable for DDoS phases.
- SensitivityLevel RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel `json:"sensitivity_level"`
- JSON rulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON `json:"-"`
-}
-
-// rulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON
-// contains the JSON metadata for the struct
-// [RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverrides]
-type rulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON struct {
- Action apijson.Field
- Categories apijson.Field
- Enabled apijson.Field
- Rules apijson.Field
- SensitivityLevel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverrides) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON) RawJSON() string {
- return r.raw
-}
-
-// A category-level override
-type RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory struct {
- // The name of the category to override.
- Category string `json:"category,required"`
- // The action to override rules in the category with.
- Action string `json:"action"`
- // Whether to enable execution of rules in the category.
- Enabled bool `json:"enabled"`
- // The sensitivity level to use for rules in the category.
- SensitivityLevel RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel `json:"sensitivity_level"`
- JSON rulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON `json:"-"`
-}
-
-// rulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON
-// contains the JSON metadata for the struct
-// [RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory]
-type rulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON struct {
- Category apijson.Field
- Action apijson.Field
- Enabled apijson.Field
- SensitivityLevel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON) RawJSON() string {
- return r.raw
-}
-
-// The sensitivity level to use for rules in the category.
-type RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel string
-
-const (
- RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "default"
- RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "medium"
- RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "low"
- RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "eoff"
-)
-
-// A rule-level override
-type RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesRule struct {
- // The ID of the rule to override.
- ID string `json:"id,required"`
- // The action to override the rule with.
- Action string `json:"action"`
- // Whether to enable execution of the rule.
- Enabled bool `json:"enabled"`
- // The score threshold to use for the rule.
- ScoreThreshold int64 `json:"score_threshold"`
- // The sensitivity level to use for the rule.
- SensitivityLevel RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel `json:"sensitivity_level"`
- JSON rulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON `json:"-"`
-}
-
-// rulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON
-// contains the JSON metadata for the struct
-// [RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesRule]
-type rulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON struct {
- ID apijson.Field
- Action apijson.Field
- Enabled apijson.Field
- ScoreThreshold apijson.Field
- SensitivityLevel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON) RawJSON() string {
- return r.raw
-}
-
-// The sensitivity level to use for the rule.
-type RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel string
-
-const (
- RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "default"
- RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "medium"
- RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelLow RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "low"
- RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "eoff"
-)
-
-// A sensitivity level to set for all rules. This option has lower precedence than
-// rule and category overrides and is only applicable for DDoS phases.
-type RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel string
-
-const (
- RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelDefault RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "default"
- RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelMedium RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "medium"
- RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelLow RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "low"
- RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelEoff RulesetRuleDeleteResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "eoff"
-)
-
-// An object configuring the rule's logging behavior.
-type RulesetRuleDeleteResponseRulesRulesetsExecuteRuleLogging struct {
- // Whether to generate a log when the rule matches.
- Enabled bool `json:"enabled,required"`
- JSON rulesetRuleDeleteResponseRulesRulesetsExecuteRuleLoggingJSON `json:"-"`
-}
-
-// rulesetRuleDeleteResponseRulesRulesetsExecuteRuleLoggingJSON contains the JSON
-// metadata for the struct
-// [RulesetRuleDeleteResponseRulesRulesetsExecuteRuleLogging]
-type rulesetRuleDeleteResponseRulesRulesetsExecuteRuleLoggingJSON struct {
- Enabled apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetRuleDeleteResponseRulesRulesetsExecuteRuleLogging) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetRuleDeleteResponseRulesRulesetsExecuteRuleLoggingJSON) RawJSON() string {
- return r.raw
-}
-
-type RulesetRuleDeleteResponseRulesRulesetsLogRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action RulesetRuleDeleteResponseRulesRulesetsLogRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters interface{} `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging RulesetRuleDeleteResponseRulesRulesetsLogRuleLogging `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON rulesetRuleDeleteResponseRulesRulesetsLogRuleJSON `json:"-"`
-}
-
-// rulesetRuleDeleteResponseRulesRulesetsLogRuleJSON contains the JSON metadata for
-// the struct [RulesetRuleDeleteResponseRulesRulesetsLogRule]
-type rulesetRuleDeleteResponseRulesRulesetsLogRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetRuleDeleteResponseRulesRulesetsLogRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetRuleDeleteResponseRulesRulesetsLogRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r RulesetRuleDeleteResponseRulesRulesetsLogRule) implementsRulesetRuleDeleteResponseRule() {}
-
-// The action to perform when the rule matches.
-type RulesetRuleDeleteResponseRulesRulesetsLogRuleAction string
-
-const (
- RulesetRuleDeleteResponseRulesRulesetsLogRuleActionLog RulesetRuleDeleteResponseRulesRulesetsLogRuleAction = "log"
-)
-
-// An object configuring the rule's logging behavior.
-type RulesetRuleDeleteResponseRulesRulesetsLogRuleLogging struct {
- // Whether to generate a log when the rule matches.
- Enabled bool `json:"enabled,required"`
- JSON rulesetRuleDeleteResponseRulesRulesetsLogRuleLoggingJSON `json:"-"`
-}
-
-// rulesetRuleDeleteResponseRulesRulesetsLogRuleLoggingJSON contains the JSON
-// metadata for the struct [RulesetRuleDeleteResponseRulesRulesetsLogRuleLogging]
-type rulesetRuleDeleteResponseRulesRulesetsLogRuleLoggingJSON struct {
- Enabled apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetRuleDeleteResponseRulesRulesetsLogRuleLogging) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetRuleDeleteResponseRulesRulesetsLogRuleLoggingJSON) RawJSON() string {
- return r.raw
-}
-
-type RulesetRuleDeleteResponseRulesRulesetsSkipRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action RulesetRuleDeleteResponseRulesRulesetsSkipRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParameters `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging RulesetRuleDeleteResponseRulesRulesetsSkipRuleLogging `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON rulesetRuleDeleteResponseRulesRulesetsSkipRuleJSON `json:"-"`
-}
-
-// rulesetRuleDeleteResponseRulesRulesetsSkipRuleJSON contains the JSON metadata
-// for the struct [RulesetRuleDeleteResponseRulesRulesetsSkipRule]
-type rulesetRuleDeleteResponseRulesRulesetsSkipRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetRuleDeleteResponseRulesRulesetsSkipRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetRuleDeleteResponseRulesRulesetsSkipRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r RulesetRuleDeleteResponseRulesRulesetsSkipRule) implementsRulesetRuleDeleteResponseRule() {}
-
-// The action to perform when the rule matches.
-type RulesetRuleDeleteResponseRulesRulesetsSkipRuleAction string
-
-const (
- RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionSkip RulesetRuleDeleteResponseRulesRulesetsSkipRuleAction = "skip"
-)
-
-// The parameters configuring the rule's action.
-type RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParameters struct {
- // A list of phases to skip the execution of. This option is incompatible with the
- // ruleset and rulesets options.
- Phases []RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase `json:"phases"`
- // A list of legacy security products to skip the execution of.
- Products []RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersProduct `json:"products"`
- // A mapping of ruleset IDs to a list of rule IDs in that ruleset to skip the
- // execution of. This option is incompatible with the ruleset option.
- Rules map[string][]string `json:"rules"`
- // A ruleset to skip the execution of. This option is incompatible with the
- // rulesets, rules and phases options.
- Ruleset RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersRuleset `json:"ruleset"`
- // A list of ruleset IDs to skip the execution of. This option is incompatible with
- // the ruleset and phases options.
- Rulesets []string `json:"rulesets"`
- JSON rulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersJSON `json:"-"`
-}
-
-// rulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersJSON contains the
-// JSON metadata for the struct
-// [RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParameters]
-type rulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersJSON struct {
- Phases apijson.Field
- Products apijson.Field
- Rules apijson.Field
- Ruleset apijson.Field
- Rulesets apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParameters) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersJSON) RawJSON() string {
- return r.raw
-}
-
-// A phase to skip the execution of.
-type RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase string
-
-const (
- RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseDDOSL4 RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "ddos_l4"
- RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseDDOSL7 RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "ddos_l7"
- RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPConfigSettings RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "http_config_settings"
- RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPCustomErrors RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "http_custom_errors"
- RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPLogCustomFields RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "http_log_custom_fields"
- RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRatelimit RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "http_ratelimit"
- RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestCacheSettings RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_cache_settings"
- RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestDynamicRedirect RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_dynamic_redirect"
- RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallCustom RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_custom"
- RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallManaged RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_managed"
- RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestLateTransform RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_late_transform"
- RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestOrigin RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_origin"
- RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestRedirect RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_redirect"
- RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSanitize RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_sanitize"
- RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSbfm RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_sbfm"
- RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSelectConfiguration RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_select_configuration"
- RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestTransform RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_transform"
- RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseCompression RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_compression"
- RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseFirewallManaged RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_firewall_managed"
- RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseHeadersTransform RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_headers_transform"
- RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransit RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit"
- RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitIDsManaged RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_ids_managed"
- RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitManaged RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_managed"
-)
-
-// The name of a legacy security product to skip the execution of.
-type RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersProduct string
-
-const (
- RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersProductBic RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersProduct = "bic"
- RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersProductHot RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersProduct = "hot"
- RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersProductRateLimit RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersProduct = "rateLimit"
- RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersProductSecurityLevel RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersProduct = "securityLevel"
- RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersProductUABlock RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersProduct = "uaBlock"
- RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersProductWAF RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersProduct = "waf"
- RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersProductZoneLockdown RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersProduct = "zoneLockdown"
-)
-
-// A ruleset to skip the execution of. This option is incompatible with the
-// rulesets, rules and phases options.
-type RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersRuleset string
-
-const (
- RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersRulesetCurrent RulesetRuleDeleteResponseRulesRulesetsSkipRuleActionParametersRuleset = "current"
-)
-
-// An object configuring the rule's logging behavior.
-type RulesetRuleDeleteResponseRulesRulesetsSkipRuleLogging struct {
- // Whether to generate a log when the rule matches.
- Enabled bool `json:"enabled,required"`
- JSON rulesetRuleDeleteResponseRulesRulesetsSkipRuleLoggingJSON `json:"-"`
-}
-
-// rulesetRuleDeleteResponseRulesRulesetsSkipRuleLoggingJSON contains the JSON
-// metadata for the struct [RulesetRuleDeleteResponseRulesRulesetsSkipRuleLogging]
-type rulesetRuleDeleteResponseRulesRulesetsSkipRuleLoggingJSON struct {
- Enabled apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetRuleDeleteResponseRulesRulesetsSkipRuleLogging) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetRuleDeleteResponseRulesRulesetsSkipRuleLoggingJSON) RawJSON() string {
- return r.raw
-}
-
-// A result.
-type RulesetRuleEditResponse struct {
- // The unique ID of the ruleset.
- ID string `json:"id,required"`
- // The kind of the ruleset.
- Kind RulesetRuleEditResponseKind `json:"kind,required"`
- // The timestamp of when the ruleset was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The human-readable name of the ruleset.
- Name string `json:"name,required"`
- // The phase of the ruleset.
- Phase RulesetRuleEditResponsePhase `json:"phase,required"`
- // The list of rules in the ruleset.
- Rules []RulesetRuleEditResponseRule `json:"rules,required"`
- // The version of the ruleset.
- Version string `json:"version,required"`
- // An informative description of the ruleset.
- Description string `json:"description"`
- JSON rulesetRuleEditResponseJSON `json:"-"`
-}
-
-// rulesetRuleEditResponseJSON contains the JSON metadata for the struct
-// [RulesetRuleEditResponse]
-type rulesetRuleEditResponseJSON struct {
- ID apijson.Field
- Kind apijson.Field
- LastUpdated apijson.Field
- Name apijson.Field
- Phase apijson.Field
- Rules apijson.Field
- Version apijson.Field
- Description apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetRuleEditResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetRuleEditResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// The kind of the ruleset.
-type RulesetRuleEditResponseKind string
-
-const (
- RulesetRuleEditResponseKindManaged RulesetRuleEditResponseKind = "managed"
- RulesetRuleEditResponseKindCustom RulesetRuleEditResponseKind = "custom"
- RulesetRuleEditResponseKindRoot RulesetRuleEditResponseKind = "root"
- RulesetRuleEditResponseKindZone RulesetRuleEditResponseKind = "zone"
-)
-
-// The phase of the ruleset.
-type RulesetRuleEditResponsePhase string
-
-const (
- RulesetRuleEditResponsePhaseDDOSL4 RulesetRuleEditResponsePhase = "ddos_l4"
- RulesetRuleEditResponsePhaseDDOSL7 RulesetRuleEditResponsePhase = "ddos_l7"
- RulesetRuleEditResponsePhaseHTTPConfigSettings RulesetRuleEditResponsePhase = "http_config_settings"
- RulesetRuleEditResponsePhaseHTTPCustomErrors RulesetRuleEditResponsePhase = "http_custom_errors"
- RulesetRuleEditResponsePhaseHTTPLogCustomFields RulesetRuleEditResponsePhase = "http_log_custom_fields"
- RulesetRuleEditResponsePhaseHTTPRatelimit RulesetRuleEditResponsePhase = "http_ratelimit"
- RulesetRuleEditResponsePhaseHTTPRequestCacheSettings RulesetRuleEditResponsePhase = "http_request_cache_settings"
- RulesetRuleEditResponsePhaseHTTPRequestDynamicRedirect RulesetRuleEditResponsePhase = "http_request_dynamic_redirect"
- RulesetRuleEditResponsePhaseHTTPRequestFirewallCustom RulesetRuleEditResponsePhase = "http_request_firewall_custom"
- RulesetRuleEditResponsePhaseHTTPRequestFirewallManaged RulesetRuleEditResponsePhase = "http_request_firewall_managed"
- RulesetRuleEditResponsePhaseHTTPRequestLateTransform RulesetRuleEditResponsePhase = "http_request_late_transform"
- RulesetRuleEditResponsePhaseHTTPRequestOrigin RulesetRuleEditResponsePhase = "http_request_origin"
- RulesetRuleEditResponsePhaseHTTPRequestRedirect RulesetRuleEditResponsePhase = "http_request_redirect"
- RulesetRuleEditResponsePhaseHTTPRequestSanitize RulesetRuleEditResponsePhase = "http_request_sanitize"
- RulesetRuleEditResponsePhaseHTTPRequestSbfm RulesetRuleEditResponsePhase = "http_request_sbfm"
- RulesetRuleEditResponsePhaseHTTPRequestSelectConfiguration RulesetRuleEditResponsePhase = "http_request_select_configuration"
- RulesetRuleEditResponsePhaseHTTPRequestTransform RulesetRuleEditResponsePhase = "http_request_transform"
- RulesetRuleEditResponsePhaseHTTPResponseCompression RulesetRuleEditResponsePhase = "http_response_compression"
- RulesetRuleEditResponsePhaseHTTPResponseFirewallManaged RulesetRuleEditResponsePhase = "http_response_firewall_managed"
- RulesetRuleEditResponsePhaseHTTPResponseHeadersTransform RulesetRuleEditResponsePhase = "http_response_headers_transform"
- RulesetRuleEditResponsePhaseMagicTransit RulesetRuleEditResponsePhase = "magic_transit"
- RulesetRuleEditResponsePhaseMagicTransitIDsManaged RulesetRuleEditResponsePhase = "magic_transit_ids_managed"
- RulesetRuleEditResponsePhaseMagicTransitManaged RulesetRuleEditResponsePhase = "magic_transit_managed"
-)
-
-// Union satisfied by [RulesetRuleEditResponseRulesRulesetsBlockRule],
-// [RulesetRuleEditResponseRulesRulesetsExecuteRule],
-// [RulesetRuleEditResponseRulesRulesetsLogRule] or
-// [RulesetRuleEditResponseRulesRulesetsSkipRule].
-type RulesetRuleEditResponseRule interface {
- implementsRulesetRuleEditResponseRule()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*RulesetRuleEditResponseRule)(nil)).Elem(),
- "action",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(RulesetRuleEditResponseRulesRulesetsBlockRule{}),
- DiscriminatorValue: "block",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(RulesetRuleEditResponseRulesRulesetsExecuteRule{}),
- DiscriminatorValue: "execute",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(RulesetRuleEditResponseRulesRulesetsLogRule{}),
- DiscriminatorValue: "log",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(RulesetRuleEditResponseRulesRulesetsSkipRule{}),
- DiscriminatorValue: "skip",
- },
- )
-}
-
-type RulesetRuleEditResponseRulesRulesetsBlockRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action RulesetRuleEditResponseRulesRulesetsBlockRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters RulesetRuleEditResponseRulesRulesetsBlockRuleActionParameters `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging RulesetRuleEditResponseRulesRulesetsBlockRuleLogging `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON rulesetRuleEditResponseRulesRulesetsBlockRuleJSON `json:"-"`
-}
-
-// rulesetRuleEditResponseRulesRulesetsBlockRuleJSON contains the JSON metadata for
-// the struct [RulesetRuleEditResponseRulesRulesetsBlockRule]
-type rulesetRuleEditResponseRulesRulesetsBlockRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetRuleEditResponseRulesRulesetsBlockRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetRuleEditResponseRulesRulesetsBlockRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r RulesetRuleEditResponseRulesRulesetsBlockRule) implementsRulesetRuleEditResponseRule() {}
-
-// The action to perform when the rule matches.
-type RulesetRuleEditResponseRulesRulesetsBlockRuleAction string
-
-const (
- RulesetRuleEditResponseRulesRulesetsBlockRuleActionBlock RulesetRuleEditResponseRulesRulesetsBlockRuleAction = "block"
-)
-
-// The parameters configuring the rule's action.
-type RulesetRuleEditResponseRulesRulesetsBlockRuleActionParameters struct {
- // The response to show when the block is applied.
- Response RulesetRuleEditResponseRulesRulesetsBlockRuleActionParametersResponse `json:"response"`
- JSON rulesetRuleEditResponseRulesRulesetsBlockRuleActionParametersJSON `json:"-"`
-}
-
-// rulesetRuleEditResponseRulesRulesetsBlockRuleActionParametersJSON contains the
-// JSON metadata for the struct
-// [RulesetRuleEditResponseRulesRulesetsBlockRuleActionParameters]
-type rulesetRuleEditResponseRulesRulesetsBlockRuleActionParametersJSON struct {
- Response apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetRuleEditResponseRulesRulesetsBlockRuleActionParameters) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetRuleEditResponseRulesRulesetsBlockRuleActionParametersJSON) RawJSON() string {
- return r.raw
-}
-
-// The response to show when the block is applied.
-type RulesetRuleEditResponseRulesRulesetsBlockRuleActionParametersResponse struct {
- // The content to return.
- Content string `json:"content,required"`
- // The type of the content to return.
- ContentType string `json:"content_type,required"`
- // The status code to return.
- StatusCode int64 `json:"status_code,required"`
- JSON rulesetRuleEditResponseRulesRulesetsBlockRuleActionParametersResponseJSON `json:"-"`
-}
-
-// rulesetRuleEditResponseRulesRulesetsBlockRuleActionParametersResponseJSON
-// contains the JSON metadata for the struct
-// [RulesetRuleEditResponseRulesRulesetsBlockRuleActionParametersResponse]
-type rulesetRuleEditResponseRulesRulesetsBlockRuleActionParametersResponseJSON struct {
- Content apijson.Field
- ContentType apijson.Field
- StatusCode apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetRuleEditResponseRulesRulesetsBlockRuleActionParametersResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetRuleEditResponseRulesRulesetsBlockRuleActionParametersResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// An object configuring the rule's logging behavior.
-type RulesetRuleEditResponseRulesRulesetsBlockRuleLogging struct {
- // Whether to generate a log when the rule matches.
- Enabled bool `json:"enabled,required"`
- JSON rulesetRuleEditResponseRulesRulesetsBlockRuleLoggingJSON `json:"-"`
-}
-
-// rulesetRuleEditResponseRulesRulesetsBlockRuleLoggingJSON contains the JSON
-// metadata for the struct [RulesetRuleEditResponseRulesRulesetsBlockRuleLogging]
-type rulesetRuleEditResponseRulesRulesetsBlockRuleLoggingJSON struct {
- Enabled apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetRuleEditResponseRulesRulesetsBlockRuleLogging) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetRuleEditResponseRulesRulesetsBlockRuleLoggingJSON) RawJSON() string {
- return r.raw
-}
-
-type RulesetRuleEditResponseRulesRulesetsExecuteRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action RulesetRuleEditResponseRulesRulesetsExecuteRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters RulesetRuleEditResponseRulesRulesetsExecuteRuleActionParameters `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging RulesetRuleEditResponseRulesRulesetsExecuteRuleLogging `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON rulesetRuleEditResponseRulesRulesetsExecuteRuleJSON `json:"-"`
-}
-
-// rulesetRuleEditResponseRulesRulesetsExecuteRuleJSON contains the JSON metadata
-// for the struct [RulesetRuleEditResponseRulesRulesetsExecuteRule]
-type rulesetRuleEditResponseRulesRulesetsExecuteRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetRuleEditResponseRulesRulesetsExecuteRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetRuleEditResponseRulesRulesetsExecuteRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r RulesetRuleEditResponseRulesRulesetsExecuteRule) implementsRulesetRuleEditResponseRule() {}
-
-// The action to perform when the rule matches.
-type RulesetRuleEditResponseRulesRulesetsExecuteRuleAction string
-
-const (
- RulesetRuleEditResponseRulesRulesetsExecuteRuleActionExecute RulesetRuleEditResponseRulesRulesetsExecuteRuleAction = "execute"
-)
-
-// The parameters configuring the rule's action.
-type RulesetRuleEditResponseRulesRulesetsExecuteRuleActionParameters struct {
- // The ID of the ruleset to execute.
- ID string `json:"id,required"`
- // The configuration to use for matched data logging.
- MatchedData RulesetRuleEditResponseRulesRulesetsExecuteRuleActionParametersMatchedData `json:"matched_data"`
- // A set of overrides to apply to the target ruleset.
- Overrides RulesetRuleEditResponseRulesRulesetsExecuteRuleActionParametersOverrides `json:"overrides"`
- JSON rulesetRuleEditResponseRulesRulesetsExecuteRuleActionParametersJSON `json:"-"`
-}
-
-// rulesetRuleEditResponseRulesRulesetsExecuteRuleActionParametersJSON contains the
-// JSON metadata for the struct
-// [RulesetRuleEditResponseRulesRulesetsExecuteRuleActionParameters]
-type rulesetRuleEditResponseRulesRulesetsExecuteRuleActionParametersJSON struct {
- ID apijson.Field
- MatchedData apijson.Field
- Overrides apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetRuleEditResponseRulesRulesetsExecuteRuleActionParameters) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetRuleEditResponseRulesRulesetsExecuteRuleActionParametersJSON) RawJSON() string {
- return r.raw
-}
-
-// The configuration to use for matched data logging.
-type RulesetRuleEditResponseRulesRulesetsExecuteRuleActionParametersMatchedData struct {
- // The public key to encrypt matched data logs with.
- PublicKey string `json:"public_key,required"`
- JSON rulesetRuleEditResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON `json:"-"`
-}
-
-// rulesetRuleEditResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON
-// contains the JSON metadata for the struct
-// [RulesetRuleEditResponseRulesRulesetsExecuteRuleActionParametersMatchedData]
-type rulesetRuleEditResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON struct {
- PublicKey apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetRuleEditResponseRulesRulesetsExecuteRuleActionParametersMatchedData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetRuleEditResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON) RawJSON() string {
- return r.raw
-}
-
-// A set of overrides to apply to the target ruleset.
-type RulesetRuleEditResponseRulesRulesetsExecuteRuleActionParametersOverrides struct {
- // An action to override all rules with. This option has lower precedence than rule
- // and category overrides.
- Action string `json:"action"`
- // A list of category-level overrides. This option has the second-highest
- // precedence after rule-level overrides.
- Categories []RulesetRuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory `json:"categories"`
- // Whether to enable execution of all rules. This option has lower precedence than
- // rule and category overrides.
- Enabled bool `json:"enabled"`
- // A list of rule-level overrides. This option has the highest precedence.
- Rules []RulesetRuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesRule `json:"rules"`
- // A sensitivity level to set for all rules. This option has lower precedence than
- // rule and category overrides and is only applicable for DDoS phases.
- SensitivityLevel RulesetRuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel `json:"sensitivity_level"`
- JSON rulesetRuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON `json:"-"`
-}
-
-// rulesetRuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON
-// contains the JSON metadata for the struct
-// [RulesetRuleEditResponseRulesRulesetsExecuteRuleActionParametersOverrides]
-type rulesetRuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON struct {
- Action apijson.Field
- Categories apijson.Field
- Enabled apijson.Field
- Rules apijson.Field
- SensitivityLevel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetRuleEditResponseRulesRulesetsExecuteRuleActionParametersOverrides) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetRuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON) RawJSON() string {
- return r.raw
-}
-
-// A category-level override
-type RulesetRuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory struct {
- // The name of the category to override.
- Category string `json:"category,required"`
- // The action to override rules in the category with.
- Action string `json:"action"`
- // Whether to enable execution of rules in the category.
- Enabled bool `json:"enabled"`
- // The sensitivity level to use for rules in the category.
- SensitivityLevel RulesetRuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel `json:"sensitivity_level"`
- JSON rulesetRuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON `json:"-"`
-}
-
-// rulesetRuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON
-// contains the JSON metadata for the struct
-// [RulesetRuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory]
-type rulesetRuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON struct {
- Category apijson.Field
- Action apijson.Field
- Enabled apijson.Field
- SensitivityLevel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetRuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetRuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON) RawJSON() string {
- return r.raw
-}
-
-// The sensitivity level to use for rules in the category.
-type RulesetRuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel string
-
-const (
- RulesetRuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault RulesetRuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "default"
- RulesetRuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium RulesetRuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "medium"
- RulesetRuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow RulesetRuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "low"
- RulesetRuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff RulesetRuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "eoff"
-)
-
-// A rule-level override
-type RulesetRuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesRule struct {
- // The ID of the rule to override.
- ID string `json:"id,required"`
- // The action to override the rule with.
- Action string `json:"action"`
- // Whether to enable execution of the rule.
- Enabled bool `json:"enabled"`
- // The score threshold to use for the rule.
- ScoreThreshold int64 `json:"score_threshold"`
- // The sensitivity level to use for the rule.
- SensitivityLevel RulesetRuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel `json:"sensitivity_level"`
- JSON rulesetRuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON `json:"-"`
-}
-
-// rulesetRuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON
-// contains the JSON metadata for the struct
-// [RulesetRuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesRule]
-type rulesetRuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON struct {
- ID apijson.Field
- Action apijson.Field
- Enabled apijson.Field
- ScoreThreshold apijson.Field
- SensitivityLevel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetRuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetRuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON) RawJSON() string {
- return r.raw
-}
-
-// The sensitivity level to use for the rule.
-type RulesetRuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel string
-
-const (
- RulesetRuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault RulesetRuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "default"
- RulesetRuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium RulesetRuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "medium"
- RulesetRuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelLow RulesetRuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "low"
- RulesetRuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff RulesetRuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "eoff"
-)
-
-// A sensitivity level to set for all rules. This option has lower precedence than
-// rule and category overrides and is only applicable for DDoS phases.
-type RulesetRuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel string
-
-const (
- RulesetRuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelDefault RulesetRuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "default"
- RulesetRuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelMedium RulesetRuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "medium"
- RulesetRuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelLow RulesetRuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "low"
- RulesetRuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelEoff RulesetRuleEditResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "eoff"
-)
-
-// An object configuring the rule's logging behavior.
-type RulesetRuleEditResponseRulesRulesetsExecuteRuleLogging struct {
- // Whether to generate a log when the rule matches.
- Enabled bool `json:"enabled,required"`
- JSON rulesetRuleEditResponseRulesRulesetsExecuteRuleLoggingJSON `json:"-"`
-}
-
-// rulesetRuleEditResponseRulesRulesetsExecuteRuleLoggingJSON contains the JSON
-// metadata for the struct [RulesetRuleEditResponseRulesRulesetsExecuteRuleLogging]
-type rulesetRuleEditResponseRulesRulesetsExecuteRuleLoggingJSON struct {
- Enabled apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetRuleEditResponseRulesRulesetsExecuteRuleLogging) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetRuleEditResponseRulesRulesetsExecuteRuleLoggingJSON) RawJSON() string {
- return r.raw
-}
-
-type RulesetRuleEditResponseRulesRulesetsLogRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action RulesetRuleEditResponseRulesRulesetsLogRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters interface{} `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging RulesetRuleEditResponseRulesRulesetsLogRuleLogging `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON rulesetRuleEditResponseRulesRulesetsLogRuleJSON `json:"-"`
-}
-
-// rulesetRuleEditResponseRulesRulesetsLogRuleJSON contains the JSON metadata for
-// the struct [RulesetRuleEditResponseRulesRulesetsLogRule]
-type rulesetRuleEditResponseRulesRulesetsLogRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetRuleEditResponseRulesRulesetsLogRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetRuleEditResponseRulesRulesetsLogRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r RulesetRuleEditResponseRulesRulesetsLogRule) implementsRulesetRuleEditResponseRule() {}
-
-// The action to perform when the rule matches.
-type RulesetRuleEditResponseRulesRulesetsLogRuleAction string
-
-const (
- RulesetRuleEditResponseRulesRulesetsLogRuleActionLog RulesetRuleEditResponseRulesRulesetsLogRuleAction = "log"
-)
-
-// An object configuring the rule's logging behavior.
-type RulesetRuleEditResponseRulesRulesetsLogRuleLogging struct {
- // Whether to generate a log when the rule matches.
- Enabled bool `json:"enabled,required"`
- JSON rulesetRuleEditResponseRulesRulesetsLogRuleLoggingJSON `json:"-"`
-}
-
-// rulesetRuleEditResponseRulesRulesetsLogRuleLoggingJSON contains the JSON
-// metadata for the struct [RulesetRuleEditResponseRulesRulesetsLogRuleLogging]
-type rulesetRuleEditResponseRulesRulesetsLogRuleLoggingJSON struct {
- Enabled apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetRuleEditResponseRulesRulesetsLogRuleLogging) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetRuleEditResponseRulesRulesetsLogRuleLoggingJSON) RawJSON() string {
- return r.raw
-}
-
-type RulesetRuleEditResponseRulesRulesetsSkipRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action RulesetRuleEditResponseRulesRulesetsSkipRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters RulesetRuleEditResponseRulesRulesetsSkipRuleActionParameters `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging RulesetRuleEditResponseRulesRulesetsSkipRuleLogging `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON rulesetRuleEditResponseRulesRulesetsSkipRuleJSON `json:"-"`
-}
-
-// rulesetRuleEditResponseRulesRulesetsSkipRuleJSON contains the JSON metadata for
-// the struct [RulesetRuleEditResponseRulesRulesetsSkipRule]
-type rulesetRuleEditResponseRulesRulesetsSkipRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetRuleEditResponseRulesRulesetsSkipRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetRuleEditResponseRulesRulesetsSkipRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r RulesetRuleEditResponseRulesRulesetsSkipRule) implementsRulesetRuleEditResponseRule() {}
-
-// The action to perform when the rule matches.
-type RulesetRuleEditResponseRulesRulesetsSkipRuleAction string
-
-const (
- RulesetRuleEditResponseRulesRulesetsSkipRuleActionSkip RulesetRuleEditResponseRulesRulesetsSkipRuleAction = "skip"
-)
-
-// The parameters configuring the rule's action.
-type RulesetRuleEditResponseRulesRulesetsSkipRuleActionParameters struct {
- // A list of phases to skip the execution of. This option is incompatible with the
- // ruleset and rulesets options.
- Phases []RulesetRuleEditResponseRulesRulesetsSkipRuleActionParametersPhase `json:"phases"`
- // A list of legacy security products to skip the execution of.
- Products []RulesetRuleEditResponseRulesRulesetsSkipRuleActionParametersProduct `json:"products"`
- // A mapping of ruleset IDs to a list of rule IDs in that ruleset to skip the
- // execution of. This option is incompatible with the ruleset option.
- Rules map[string][]string `json:"rules"`
- // A ruleset to skip the execution of. This option is incompatible with the
- // rulesets, rules and phases options.
- Ruleset RulesetRuleEditResponseRulesRulesetsSkipRuleActionParametersRuleset `json:"ruleset"`
- // A list of ruleset IDs to skip the execution of. This option is incompatible with
- // the ruleset and phases options.
- Rulesets []string `json:"rulesets"`
- JSON rulesetRuleEditResponseRulesRulesetsSkipRuleActionParametersJSON `json:"-"`
-}
-
-// rulesetRuleEditResponseRulesRulesetsSkipRuleActionParametersJSON contains the
-// JSON metadata for the struct
-// [RulesetRuleEditResponseRulesRulesetsSkipRuleActionParameters]
-type rulesetRuleEditResponseRulesRulesetsSkipRuleActionParametersJSON struct {
- Phases apijson.Field
- Products apijson.Field
- Rules apijson.Field
- Ruleset apijson.Field
- Rulesets apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetRuleEditResponseRulesRulesetsSkipRuleActionParameters) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetRuleEditResponseRulesRulesetsSkipRuleActionParametersJSON) RawJSON() string {
- return r.raw
-}
-
-// A phase to skip the execution of.
-type RulesetRuleEditResponseRulesRulesetsSkipRuleActionParametersPhase string
-
-const (
- RulesetRuleEditResponseRulesRulesetsSkipRuleActionParametersPhaseDDOSL4 RulesetRuleEditResponseRulesRulesetsSkipRuleActionParametersPhase = "ddos_l4"
- RulesetRuleEditResponseRulesRulesetsSkipRuleActionParametersPhaseDDOSL7 RulesetRuleEditResponseRulesRulesetsSkipRuleActionParametersPhase = "ddos_l7"
- RulesetRuleEditResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPConfigSettings RulesetRuleEditResponseRulesRulesetsSkipRuleActionParametersPhase = "http_config_settings"
- RulesetRuleEditResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPCustomErrors RulesetRuleEditResponseRulesRulesetsSkipRuleActionParametersPhase = "http_custom_errors"
- RulesetRuleEditResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPLogCustomFields RulesetRuleEditResponseRulesRulesetsSkipRuleActionParametersPhase = "http_log_custom_fields"
- RulesetRuleEditResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRatelimit RulesetRuleEditResponseRulesRulesetsSkipRuleActionParametersPhase = "http_ratelimit"
- RulesetRuleEditResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestCacheSettings RulesetRuleEditResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_cache_settings"
- RulesetRuleEditResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestDynamicRedirect RulesetRuleEditResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_dynamic_redirect"
- RulesetRuleEditResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallCustom RulesetRuleEditResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_custom"
- RulesetRuleEditResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallManaged RulesetRuleEditResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_managed"
- RulesetRuleEditResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestLateTransform RulesetRuleEditResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_late_transform"
- RulesetRuleEditResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestOrigin RulesetRuleEditResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_origin"
- RulesetRuleEditResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestRedirect RulesetRuleEditResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_redirect"
- RulesetRuleEditResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSanitize RulesetRuleEditResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_sanitize"
- RulesetRuleEditResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSbfm RulesetRuleEditResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_sbfm"
- RulesetRuleEditResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSelectConfiguration RulesetRuleEditResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_select_configuration"
- RulesetRuleEditResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestTransform RulesetRuleEditResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_transform"
- RulesetRuleEditResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseCompression RulesetRuleEditResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_compression"
- RulesetRuleEditResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseFirewallManaged RulesetRuleEditResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_firewall_managed"
- RulesetRuleEditResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseHeadersTransform RulesetRuleEditResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_headers_transform"
- RulesetRuleEditResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransit RulesetRuleEditResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit"
- RulesetRuleEditResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitIDsManaged RulesetRuleEditResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_ids_managed"
- RulesetRuleEditResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitManaged RulesetRuleEditResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_managed"
-)
-
-// The name of a legacy security product to skip the execution of.
-type RulesetRuleEditResponseRulesRulesetsSkipRuleActionParametersProduct string
-
-const (
- RulesetRuleEditResponseRulesRulesetsSkipRuleActionParametersProductBic RulesetRuleEditResponseRulesRulesetsSkipRuleActionParametersProduct = "bic"
- RulesetRuleEditResponseRulesRulesetsSkipRuleActionParametersProductHot RulesetRuleEditResponseRulesRulesetsSkipRuleActionParametersProduct = "hot"
- RulesetRuleEditResponseRulesRulesetsSkipRuleActionParametersProductRateLimit RulesetRuleEditResponseRulesRulesetsSkipRuleActionParametersProduct = "rateLimit"
- RulesetRuleEditResponseRulesRulesetsSkipRuleActionParametersProductSecurityLevel RulesetRuleEditResponseRulesRulesetsSkipRuleActionParametersProduct = "securityLevel"
- RulesetRuleEditResponseRulesRulesetsSkipRuleActionParametersProductUABlock RulesetRuleEditResponseRulesRulesetsSkipRuleActionParametersProduct = "uaBlock"
- RulesetRuleEditResponseRulesRulesetsSkipRuleActionParametersProductWAF RulesetRuleEditResponseRulesRulesetsSkipRuleActionParametersProduct = "waf"
- RulesetRuleEditResponseRulesRulesetsSkipRuleActionParametersProductZoneLockdown RulesetRuleEditResponseRulesRulesetsSkipRuleActionParametersProduct = "zoneLockdown"
-)
-
-// A ruleset to skip the execution of. This option is incompatible with the
-// rulesets, rules and phases options.
-type RulesetRuleEditResponseRulesRulesetsSkipRuleActionParametersRuleset string
-
-const (
- RulesetRuleEditResponseRulesRulesetsSkipRuleActionParametersRulesetCurrent RulesetRuleEditResponseRulesRulesetsSkipRuleActionParametersRuleset = "current"
-)
-
-// An object configuring the rule's logging behavior.
-type RulesetRuleEditResponseRulesRulesetsSkipRuleLogging struct {
- // Whether to generate a log when the rule matches.
- Enabled bool `json:"enabled,required"`
- JSON rulesetRuleEditResponseRulesRulesetsSkipRuleLoggingJSON `json:"-"`
-}
-
-// rulesetRuleEditResponseRulesRulesetsSkipRuleLoggingJSON contains the JSON
-// metadata for the struct [RulesetRuleEditResponseRulesRulesetsSkipRuleLogging]
-type rulesetRuleEditResponseRulesRulesetsSkipRuleLoggingJSON struct {
- Enabled apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetRuleEditResponseRulesRulesetsSkipRuleLogging) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetRuleEditResponseRulesRulesetsSkipRuleLoggingJSON) RawJSON() string {
- return r.raw
-}
-
-type RulesetRuleNewParams struct {
- // The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
- AccountID param.Field[string] `path:"account_id"`
- // The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- ZoneID param.Field[string] `path:"zone_id"`
- // An object configuring where the rule will be placed.
- Position param.Field[RulesetRuleNewParamsPosition] `json:"position"`
-}
-
-func (r RulesetRuleNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// An object configuring where the rule will be placed.
-//
-// Satisfied by [RulesetRuleNewParamsPositionBeforePosition],
-// [RulesetRuleNewParamsPositionAfterPosition],
-// [RulesetRuleNewParamsPositionIndexPosition].
-type RulesetRuleNewParamsPosition interface {
- implementsRulesetRuleNewParamsPosition()
-}
-
-// An object configuring where the rule will be placed.
-type RulesetRuleNewParamsPositionBeforePosition struct {
- // The ID of another rule to place the rule before. An empty value causes the rule
- // to be placed at the top.
- Before param.Field[string] `json:"before"`
-}
-
-func (r RulesetRuleNewParamsPositionBeforePosition) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-func (r RulesetRuleNewParamsPositionBeforePosition) implementsRulesetRuleNewParamsPosition() {}
-
-// An object configuring where the rule will be placed.
-type RulesetRuleNewParamsPositionAfterPosition struct {
- // The ID of another rule to place the rule after. An empty value causes the rule
- // to be placed at the bottom.
- After param.Field[string] `json:"after"`
-}
-
-func (r RulesetRuleNewParamsPositionAfterPosition) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-func (r RulesetRuleNewParamsPositionAfterPosition) implementsRulesetRuleNewParamsPosition() {}
-
-// An object configuring where the rule will be placed.
-type RulesetRuleNewParamsPositionIndexPosition struct {
- // An index at which to place the rule, where index 1 is the first rule.
- Index param.Field[float64] `json:"index"`
-}
-
-func (r RulesetRuleNewParamsPositionIndexPosition) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-func (r RulesetRuleNewParamsPositionIndexPosition) implementsRulesetRuleNewParamsPosition() {}
-
-// A response object.
-type RulesetRuleNewResponseEnvelope struct {
- // A list of error messages.
- Errors []RulesetRuleNewResponseEnvelopeErrors `json:"errors,required"`
- // A list of warning messages.
- Messages []RulesetRuleNewResponseEnvelopeMessages `json:"messages,required"`
- // A result.
- Result RulesetRuleNewResponse `json:"result,required"`
- // Whether the API call was successful.
- Success RulesetRuleNewResponseEnvelopeSuccess `json:"success,required"`
- JSON rulesetRuleNewResponseEnvelopeJSON `json:"-"`
-}
-
-// rulesetRuleNewResponseEnvelopeJSON contains the JSON metadata for the struct
-// [RulesetRuleNewResponseEnvelope]
-type rulesetRuleNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetRuleNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetRuleNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-// A message.
-type RulesetRuleNewResponseEnvelopeErrors struct {
- // A text description of this message.
- Message string `json:"message,required"`
- // A unique code for this message.
- Code int64 `json:"code"`
- // The source of this message.
- Source RulesetRuleNewResponseEnvelopeErrorsSource `json:"source"`
- JSON rulesetRuleNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// rulesetRuleNewResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [RulesetRuleNewResponseEnvelopeErrors]
-type rulesetRuleNewResponseEnvelopeErrorsJSON struct {
- Message apijson.Field
- Code apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetRuleNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetRuleNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-// The source of this message.
-type RulesetRuleNewResponseEnvelopeErrorsSource struct {
- // A JSON pointer to the field that is the source of the message.
- Pointer string `json:"pointer,required"`
- JSON rulesetRuleNewResponseEnvelopeErrorsSourceJSON `json:"-"`
-}
-
-// rulesetRuleNewResponseEnvelopeErrorsSourceJSON contains the JSON metadata for
-// the struct [RulesetRuleNewResponseEnvelopeErrorsSource]
-type rulesetRuleNewResponseEnvelopeErrorsSourceJSON struct {
- Pointer apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetRuleNewResponseEnvelopeErrorsSource) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetRuleNewResponseEnvelopeErrorsSourceJSON) RawJSON() string {
- return r.raw
-}
-
-// A message.
-type RulesetRuleNewResponseEnvelopeMessages struct {
- // A text description of this message.
- Message string `json:"message,required"`
- // A unique code for this message.
- Code int64 `json:"code"`
- // The source of this message.
- Source RulesetRuleNewResponseEnvelopeMessagesSource `json:"source"`
- JSON rulesetRuleNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// rulesetRuleNewResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [RulesetRuleNewResponseEnvelopeMessages]
-type rulesetRuleNewResponseEnvelopeMessagesJSON struct {
- Message apijson.Field
- Code apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetRuleNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetRuleNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// The source of this message.
-type RulesetRuleNewResponseEnvelopeMessagesSource struct {
- // A JSON pointer to the field that is the source of the message.
- Pointer string `json:"pointer,required"`
- JSON rulesetRuleNewResponseEnvelopeMessagesSourceJSON `json:"-"`
-}
-
-// rulesetRuleNewResponseEnvelopeMessagesSourceJSON contains the JSON metadata for
-// the struct [RulesetRuleNewResponseEnvelopeMessagesSource]
-type rulesetRuleNewResponseEnvelopeMessagesSourceJSON struct {
- Pointer apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetRuleNewResponseEnvelopeMessagesSource) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetRuleNewResponseEnvelopeMessagesSourceJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful.
-type RulesetRuleNewResponseEnvelopeSuccess bool
-
-const (
- RulesetRuleNewResponseEnvelopeSuccessTrue RulesetRuleNewResponseEnvelopeSuccess = true
-)
-
-type RulesetRuleDeleteParams struct {
- // The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
- AccountID param.Field[string] `path:"account_id"`
- // The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- ZoneID param.Field[string] `path:"zone_id"`
-}
-
-// A response object.
-type RulesetRuleDeleteResponseEnvelope struct {
- // A list of error messages.
- Errors []RulesetRuleDeleteResponseEnvelopeErrors `json:"errors,required"`
- // A list of warning messages.
- Messages []RulesetRuleDeleteResponseEnvelopeMessages `json:"messages,required"`
- // A result.
- Result RulesetRuleDeleteResponse `json:"result,required"`
- // Whether the API call was successful.
- Success RulesetRuleDeleteResponseEnvelopeSuccess `json:"success,required"`
- JSON rulesetRuleDeleteResponseEnvelopeJSON `json:"-"`
-}
-
-// rulesetRuleDeleteResponseEnvelopeJSON contains the JSON metadata for the struct
-// [RulesetRuleDeleteResponseEnvelope]
-type rulesetRuleDeleteResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetRuleDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetRuleDeleteResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-// A message.
-type RulesetRuleDeleteResponseEnvelopeErrors struct {
- // A text description of this message.
- Message string `json:"message,required"`
- // A unique code for this message.
- Code int64 `json:"code"`
- // The source of this message.
- Source RulesetRuleDeleteResponseEnvelopeErrorsSource `json:"source"`
- JSON rulesetRuleDeleteResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// rulesetRuleDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [RulesetRuleDeleteResponseEnvelopeErrors]
-type rulesetRuleDeleteResponseEnvelopeErrorsJSON struct {
- Message apijson.Field
- Code apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetRuleDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetRuleDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-// The source of this message.
-type RulesetRuleDeleteResponseEnvelopeErrorsSource struct {
- // A JSON pointer to the field that is the source of the message.
- Pointer string `json:"pointer,required"`
- JSON rulesetRuleDeleteResponseEnvelopeErrorsSourceJSON `json:"-"`
-}
-
-// rulesetRuleDeleteResponseEnvelopeErrorsSourceJSON contains the JSON metadata for
-// the struct [RulesetRuleDeleteResponseEnvelopeErrorsSource]
-type rulesetRuleDeleteResponseEnvelopeErrorsSourceJSON struct {
- Pointer apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetRuleDeleteResponseEnvelopeErrorsSource) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetRuleDeleteResponseEnvelopeErrorsSourceJSON) RawJSON() string {
- return r.raw
-}
-
-// A message.
-type RulesetRuleDeleteResponseEnvelopeMessages struct {
- // A text description of this message.
- Message string `json:"message,required"`
- // A unique code for this message.
- Code int64 `json:"code"`
- // The source of this message.
- Source RulesetRuleDeleteResponseEnvelopeMessagesSource `json:"source"`
- JSON rulesetRuleDeleteResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// rulesetRuleDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [RulesetRuleDeleteResponseEnvelopeMessages]
-type rulesetRuleDeleteResponseEnvelopeMessagesJSON struct {
- Message apijson.Field
- Code apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetRuleDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetRuleDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// The source of this message.
-type RulesetRuleDeleteResponseEnvelopeMessagesSource struct {
- // A JSON pointer to the field that is the source of the message.
- Pointer string `json:"pointer,required"`
- JSON rulesetRuleDeleteResponseEnvelopeMessagesSourceJSON `json:"-"`
-}
-
-// rulesetRuleDeleteResponseEnvelopeMessagesSourceJSON contains the JSON metadata
-// for the struct [RulesetRuleDeleteResponseEnvelopeMessagesSource]
-type rulesetRuleDeleteResponseEnvelopeMessagesSourceJSON struct {
- Pointer apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetRuleDeleteResponseEnvelopeMessagesSource) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetRuleDeleteResponseEnvelopeMessagesSourceJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful.
-type RulesetRuleDeleteResponseEnvelopeSuccess bool
-
-const (
- RulesetRuleDeleteResponseEnvelopeSuccessTrue RulesetRuleDeleteResponseEnvelopeSuccess = true
-)
-
-type RulesetRuleEditParams struct {
- // The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
- AccountID param.Field[string] `path:"account_id"`
- // The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- ZoneID param.Field[string] `path:"zone_id"`
- // An object configuring where the rule will be placed.
- Position param.Field[RulesetRuleEditParamsPosition] `json:"position"`
-}
-
-func (r RulesetRuleEditParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// An object configuring where the rule will be placed.
-//
-// Satisfied by [RulesetRuleEditParamsPositionBeforePosition],
-// [RulesetRuleEditParamsPositionAfterPosition],
-// [RulesetRuleEditParamsPositionIndexPosition].
-type RulesetRuleEditParamsPosition interface {
- implementsRulesetRuleEditParamsPosition()
-}
-
-// An object configuring where the rule will be placed.
-type RulesetRuleEditParamsPositionBeforePosition struct {
- // The ID of another rule to place the rule before. An empty value causes the rule
- // to be placed at the top.
- Before param.Field[string] `json:"before"`
-}
-
-func (r RulesetRuleEditParamsPositionBeforePosition) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-func (r RulesetRuleEditParamsPositionBeforePosition) implementsRulesetRuleEditParamsPosition() {}
-
-// An object configuring where the rule will be placed.
-type RulesetRuleEditParamsPositionAfterPosition struct {
- // The ID of another rule to place the rule after. An empty value causes the rule
- // to be placed at the bottom.
- After param.Field[string] `json:"after"`
-}
-
-func (r RulesetRuleEditParamsPositionAfterPosition) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-func (r RulesetRuleEditParamsPositionAfterPosition) implementsRulesetRuleEditParamsPosition() {}
-
-// An object configuring where the rule will be placed.
-type RulesetRuleEditParamsPositionIndexPosition struct {
- // An index at which to place the rule, where index 1 is the first rule.
- Index param.Field[float64] `json:"index"`
-}
-
-func (r RulesetRuleEditParamsPositionIndexPosition) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-func (r RulesetRuleEditParamsPositionIndexPosition) implementsRulesetRuleEditParamsPosition() {}
-
-// A response object.
-type RulesetRuleEditResponseEnvelope struct {
- // A list of error messages.
- Errors []RulesetRuleEditResponseEnvelopeErrors `json:"errors,required"`
- // A list of warning messages.
- Messages []RulesetRuleEditResponseEnvelopeMessages `json:"messages,required"`
- // A result.
- Result RulesetRuleEditResponse `json:"result,required"`
- // Whether the API call was successful.
- Success RulesetRuleEditResponseEnvelopeSuccess `json:"success,required"`
- JSON rulesetRuleEditResponseEnvelopeJSON `json:"-"`
-}
-
-// rulesetRuleEditResponseEnvelopeJSON contains the JSON metadata for the struct
-// [RulesetRuleEditResponseEnvelope]
-type rulesetRuleEditResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetRuleEditResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetRuleEditResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-// A message.
-type RulesetRuleEditResponseEnvelopeErrors struct {
- // A text description of this message.
- Message string `json:"message,required"`
- // A unique code for this message.
- Code int64 `json:"code"`
- // The source of this message.
- Source RulesetRuleEditResponseEnvelopeErrorsSource `json:"source"`
- JSON rulesetRuleEditResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// rulesetRuleEditResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [RulesetRuleEditResponseEnvelopeErrors]
-type rulesetRuleEditResponseEnvelopeErrorsJSON struct {
- Message apijson.Field
- Code apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetRuleEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetRuleEditResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-// The source of this message.
-type RulesetRuleEditResponseEnvelopeErrorsSource struct {
- // A JSON pointer to the field that is the source of the message.
- Pointer string `json:"pointer,required"`
- JSON rulesetRuleEditResponseEnvelopeErrorsSourceJSON `json:"-"`
-}
-
-// rulesetRuleEditResponseEnvelopeErrorsSourceJSON contains the JSON metadata for
-// the struct [RulesetRuleEditResponseEnvelopeErrorsSource]
-type rulesetRuleEditResponseEnvelopeErrorsSourceJSON struct {
- Pointer apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetRuleEditResponseEnvelopeErrorsSource) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetRuleEditResponseEnvelopeErrorsSourceJSON) RawJSON() string {
- return r.raw
-}
-
-// A message.
-type RulesetRuleEditResponseEnvelopeMessages struct {
- // A text description of this message.
- Message string `json:"message,required"`
- // A unique code for this message.
- Code int64 `json:"code"`
- // The source of this message.
- Source RulesetRuleEditResponseEnvelopeMessagesSource `json:"source"`
- JSON rulesetRuleEditResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// rulesetRuleEditResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [RulesetRuleEditResponseEnvelopeMessages]
-type rulesetRuleEditResponseEnvelopeMessagesJSON struct {
- Message apijson.Field
- Code apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetRuleEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetRuleEditResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// The source of this message.
-type RulesetRuleEditResponseEnvelopeMessagesSource struct {
- // A JSON pointer to the field that is the source of the message.
- Pointer string `json:"pointer,required"`
- JSON rulesetRuleEditResponseEnvelopeMessagesSourceJSON `json:"-"`
-}
-
-// rulesetRuleEditResponseEnvelopeMessagesSourceJSON contains the JSON metadata for
-// the struct [RulesetRuleEditResponseEnvelopeMessagesSource]
-type rulesetRuleEditResponseEnvelopeMessagesSourceJSON struct {
- Pointer apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetRuleEditResponseEnvelopeMessagesSource) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetRuleEditResponseEnvelopeMessagesSourceJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful.
-type RulesetRuleEditResponseEnvelopeSuccess bool
-
-const (
- RulesetRuleEditResponseEnvelopeSuccessTrue RulesetRuleEditResponseEnvelopeSuccess = true
-)
diff --git a/rulesetrule_test.go b/rulesetrule_test.go
deleted file mode 100644
index a6e400ced2a..00000000000
--- a/rulesetrule_test.go
+++ /dev/null
@@ -1,115 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRulesetRuleNewWithOptionalParams(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"),
- )
- _, err := client.Rulesets.Rules.New(
- context.TODO(),
- "2f2feab2026849078ba485f918791bdc",
- cloudflare.RulesetRuleNewParams{
- AccountID: cloudflare.F("string"),
- ZoneID: cloudflare.F("string"),
- Position: cloudflare.F[cloudflare.RulesetRuleNewParamsPosition](cloudflare.RulesetRuleNewParamsPositionBeforePosition(cloudflare.RulesetRuleNewParamsPositionBeforePosition{
- Before: cloudflare.F("da5e8e506c8e7877fe06cdf4c41add54"),
- })),
- },
- )
- 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())
- }
-}
-
-func TestRulesetRuleDeleteWithOptionalParams(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"),
- )
- _, err := client.Rulesets.Rules.Delete(
- context.TODO(),
- "2f2feab2026849078ba485f918791bdc",
- "3a03d665bac047339bb530ecb439a90d",
- cloudflare.RulesetRuleDeleteParams{
- AccountID: cloudflare.F("string"),
- ZoneID: cloudflare.F("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())
- }
-}
-
-func TestRulesetRuleEditWithOptionalParams(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"),
- )
- _, err := client.Rulesets.Rules.Edit(
- context.TODO(),
- "2f2feab2026849078ba485f918791bdc",
- "3a03d665bac047339bb530ecb439a90d",
- cloudflare.RulesetRuleEditParams{
- AccountID: cloudflare.F("string"),
- ZoneID: cloudflare.F("string"),
- Position: cloudflare.F[cloudflare.RulesetRuleEditParamsPosition](cloudflare.RulesetRuleEditParamsPositionBeforePosition(cloudflare.RulesetRuleEditParamsPositionBeforePosition{
- Before: cloudflare.F("da5e8e506c8e7877fe06cdf4c41add54"),
- })),
- },
- )
- 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/rulesets/aliases.go b/rulesets/aliases.go
new file mode 100644
index 00000000000..dd97fee1c1b
--- /dev/null
+++ b/rulesets/aliases.go
@@ -0,0 +1,9 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package rulesets
+
+import (
+ "github.com/cloudflare/cloudflare-go/internal/apierror"
+)
+
+type Error = apierror.Error
diff --git a/rulesets/phase.go b/rulesets/phase.go
new file mode 100644
index 00000000000..a9bb9f77825
--- /dev/null
+++ b/rulesets/phase.go
@@ -0,0 +1,874 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package rulesets
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// PhaseService contains methods and other services that help with interacting with
+// the cloudflare API. Note, unlike clients, this service does not read variables
+// from the environment automatically. You should not instantiate this service
+// directly, and instead use the [NewPhaseService] method instead.
+type PhaseService struct {
+ Options []option.RequestOption
+ Versions *PhaseVersionService
+}
+
+// NewPhaseService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewPhaseService(opts ...option.RequestOption) (r *PhaseService) {
+ r = &PhaseService{}
+ r.Options = opts
+ r.Versions = NewPhaseVersionService(opts...)
+ return
+}
+
+// Updates an account or zone entry point ruleset, creating a new version.
+func (r *PhaseService) Update(ctx context.Context, rulesetPhase PhaseUpdateParamsRulesetPhase, params PhaseUpdateParams, opts ...option.RequestOption) (res *RulesetsRulesetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env PhaseUpdateResponseEnvelope
+ var accountOrZone string
+ var accountOrZoneID param.Field[string]
+ if params.AccountID.Present {
+ accountOrZone = "accounts"
+ accountOrZoneID = params.AccountID
+ } else {
+ accountOrZone = "zones"
+ accountOrZoneID = params.ZoneID
+ }
+ path := fmt.Sprintf("%s/%s/rulesets/phases/%v/entrypoint", accountOrZone, accountOrZoneID, rulesetPhase)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Fetches the latest version of the account or zone entry point ruleset for a
+// given phase.
+func (r *PhaseService) Get(ctx context.Context, rulesetPhase PhaseGetParamsRulesetPhase, query PhaseGetParams, opts ...option.RequestOption) (res *RulesetsRulesetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env PhaseGetResponseEnvelope
+ var accountOrZone string
+ var accountOrZoneID param.Field[string]
+ if query.AccountID.Present {
+ accountOrZone = "accounts"
+ accountOrZoneID = query.AccountID
+ } else {
+ accountOrZone = "zones"
+ accountOrZoneID = query.ZoneID
+ }
+ path := fmt.Sprintf("%s/%s/rulesets/phases/%v/entrypoint", accountOrZone, accountOrZoneID, rulesetPhase)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type PhaseUpdateParams struct {
+ // The unique ID of the ruleset.
+ ID param.Field[string] `json:"id,required"`
+ // The list of rules in the ruleset.
+ Rules param.Field[[]PhaseUpdateParamsRule] `json:"rules,required"`
+ // The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+ AccountID param.Field[string] `path:"account_id"`
+ // The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+ ZoneID param.Field[string] `path:"zone_id"`
+ // An informative description of the ruleset.
+ Description param.Field[string] `json:"description"`
+ // The kind of the ruleset.
+ Kind param.Field[PhaseUpdateParamsKind] `json:"kind"`
+ // The human-readable name of the ruleset.
+ Name param.Field[string] `json:"name"`
+ // The phase of the ruleset.
+ Phase param.Field[PhaseUpdateParamsPhase] `json:"phase"`
+}
+
+func (r PhaseUpdateParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The phase of the ruleset.
+type PhaseUpdateParamsRulesetPhase string
+
+const (
+ PhaseUpdateParamsRulesetPhaseDDOSL4 PhaseUpdateParamsRulesetPhase = "ddos_l4"
+ PhaseUpdateParamsRulesetPhaseDDOSL7 PhaseUpdateParamsRulesetPhase = "ddos_l7"
+ PhaseUpdateParamsRulesetPhaseHTTPConfigSettings PhaseUpdateParamsRulesetPhase = "http_config_settings"
+ PhaseUpdateParamsRulesetPhaseHTTPCustomErrors PhaseUpdateParamsRulesetPhase = "http_custom_errors"
+ PhaseUpdateParamsRulesetPhaseHTTPLogCustomFields PhaseUpdateParamsRulesetPhase = "http_log_custom_fields"
+ PhaseUpdateParamsRulesetPhaseHTTPRatelimit PhaseUpdateParamsRulesetPhase = "http_ratelimit"
+ PhaseUpdateParamsRulesetPhaseHTTPRequestCacheSettings PhaseUpdateParamsRulesetPhase = "http_request_cache_settings"
+ PhaseUpdateParamsRulesetPhaseHTTPRequestDynamicRedirect PhaseUpdateParamsRulesetPhase = "http_request_dynamic_redirect"
+ PhaseUpdateParamsRulesetPhaseHTTPRequestFirewallCustom PhaseUpdateParamsRulesetPhase = "http_request_firewall_custom"
+ PhaseUpdateParamsRulesetPhaseHTTPRequestFirewallManaged PhaseUpdateParamsRulesetPhase = "http_request_firewall_managed"
+ PhaseUpdateParamsRulesetPhaseHTTPRequestLateTransform PhaseUpdateParamsRulesetPhase = "http_request_late_transform"
+ PhaseUpdateParamsRulesetPhaseHTTPRequestOrigin PhaseUpdateParamsRulesetPhase = "http_request_origin"
+ PhaseUpdateParamsRulesetPhaseHTTPRequestRedirect PhaseUpdateParamsRulesetPhase = "http_request_redirect"
+ PhaseUpdateParamsRulesetPhaseHTTPRequestSanitize PhaseUpdateParamsRulesetPhase = "http_request_sanitize"
+ PhaseUpdateParamsRulesetPhaseHTTPRequestSbfm PhaseUpdateParamsRulesetPhase = "http_request_sbfm"
+ PhaseUpdateParamsRulesetPhaseHTTPRequestSelectConfiguration PhaseUpdateParamsRulesetPhase = "http_request_select_configuration"
+ PhaseUpdateParamsRulesetPhaseHTTPRequestTransform PhaseUpdateParamsRulesetPhase = "http_request_transform"
+ PhaseUpdateParamsRulesetPhaseHTTPResponseCompression PhaseUpdateParamsRulesetPhase = "http_response_compression"
+ PhaseUpdateParamsRulesetPhaseHTTPResponseFirewallManaged PhaseUpdateParamsRulesetPhase = "http_response_firewall_managed"
+ PhaseUpdateParamsRulesetPhaseHTTPResponseHeadersTransform PhaseUpdateParamsRulesetPhase = "http_response_headers_transform"
+ PhaseUpdateParamsRulesetPhaseMagicTransit PhaseUpdateParamsRulesetPhase = "magic_transit"
+ PhaseUpdateParamsRulesetPhaseMagicTransitIDsManaged PhaseUpdateParamsRulesetPhase = "magic_transit_ids_managed"
+ PhaseUpdateParamsRulesetPhaseMagicTransitManaged PhaseUpdateParamsRulesetPhase = "magic_transit_managed"
+)
+
+// Satisfied by [rulesets.PhaseUpdateParamsRulesRulesetsBlockRule],
+// [rulesets.PhaseUpdateParamsRulesRulesetsExecuteRule],
+// [rulesets.PhaseUpdateParamsRulesRulesetsLogRule],
+// [rulesets.PhaseUpdateParamsRulesRulesetsSkipRule].
+type PhaseUpdateParamsRule interface {
+ implementsRulesetsPhaseUpdateParamsRule()
+}
+
+type PhaseUpdateParamsRulesRulesetsBlockRule struct {
+ // The unique ID of the rule.
+ ID param.Field[string] `json:"id"`
+ // The action to perform when the rule matches.
+ Action param.Field[PhaseUpdateParamsRulesRulesetsBlockRuleAction] `json:"action"`
+ // The parameters configuring the rule's action.
+ ActionParameters param.Field[PhaseUpdateParamsRulesRulesetsBlockRuleActionParameters] `json:"action_parameters"`
+ // An informative description of the rule.
+ Description param.Field[string] `json:"description"`
+ // Whether the rule should be executed.
+ Enabled param.Field[bool] `json:"enabled"`
+ // The expression defining which traffic will match the rule.
+ Expression param.Field[string] `json:"expression"`
+ // An object configuring the rule's logging behavior.
+ Logging param.Field[PhaseUpdateParamsRulesRulesetsBlockRuleLogging] `json:"logging"`
+ // The reference of the rule (the rule ID by default).
+ Ref param.Field[string] `json:"ref"`
+}
+
+func (r PhaseUpdateParamsRulesRulesetsBlockRule) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+func (r PhaseUpdateParamsRulesRulesetsBlockRule) implementsRulesetsPhaseUpdateParamsRule() {}
+
+// The action to perform when the rule matches.
+type PhaseUpdateParamsRulesRulesetsBlockRuleAction string
+
+const (
+ PhaseUpdateParamsRulesRulesetsBlockRuleActionBlock PhaseUpdateParamsRulesRulesetsBlockRuleAction = "block"
+)
+
+// The parameters configuring the rule's action.
+type PhaseUpdateParamsRulesRulesetsBlockRuleActionParameters struct {
+ // The response to show when the block is applied.
+ Response param.Field[PhaseUpdateParamsRulesRulesetsBlockRuleActionParametersResponse] `json:"response"`
+}
+
+func (r PhaseUpdateParamsRulesRulesetsBlockRuleActionParameters) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The response to show when the block is applied.
+type PhaseUpdateParamsRulesRulesetsBlockRuleActionParametersResponse struct {
+ // The content to return.
+ Content param.Field[string] `json:"content,required"`
+ // The type of the content to return.
+ ContentType param.Field[string] `json:"content_type,required"`
+ // The status code to return.
+ StatusCode param.Field[int64] `json:"status_code,required"`
+}
+
+func (r PhaseUpdateParamsRulesRulesetsBlockRuleActionParametersResponse) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// An object configuring the rule's logging behavior.
+type PhaseUpdateParamsRulesRulesetsBlockRuleLogging struct {
+ // Whether to generate a log when the rule matches.
+ Enabled param.Field[bool] `json:"enabled,required"`
+}
+
+func (r PhaseUpdateParamsRulesRulesetsBlockRuleLogging) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type PhaseUpdateParamsRulesRulesetsExecuteRule struct {
+ // The unique ID of the rule.
+ ID param.Field[string] `json:"id"`
+ // The action to perform when the rule matches.
+ Action param.Field[PhaseUpdateParamsRulesRulesetsExecuteRuleAction] `json:"action"`
+ // The parameters configuring the rule's action.
+ ActionParameters param.Field[PhaseUpdateParamsRulesRulesetsExecuteRuleActionParameters] `json:"action_parameters"`
+ // An informative description of the rule.
+ Description param.Field[string] `json:"description"`
+ // Whether the rule should be executed.
+ Enabled param.Field[bool] `json:"enabled"`
+ // The expression defining which traffic will match the rule.
+ Expression param.Field[string] `json:"expression"`
+ // An object configuring the rule's logging behavior.
+ Logging param.Field[PhaseUpdateParamsRulesRulesetsExecuteRuleLogging] `json:"logging"`
+ // The reference of the rule (the rule ID by default).
+ Ref param.Field[string] `json:"ref"`
+}
+
+func (r PhaseUpdateParamsRulesRulesetsExecuteRule) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+func (r PhaseUpdateParamsRulesRulesetsExecuteRule) implementsRulesetsPhaseUpdateParamsRule() {}
+
+// The action to perform when the rule matches.
+type PhaseUpdateParamsRulesRulesetsExecuteRuleAction string
+
+const (
+ PhaseUpdateParamsRulesRulesetsExecuteRuleActionExecute PhaseUpdateParamsRulesRulesetsExecuteRuleAction = "execute"
+)
+
+// The parameters configuring the rule's action.
+type PhaseUpdateParamsRulesRulesetsExecuteRuleActionParameters struct {
+ // The ID of the ruleset to execute.
+ ID param.Field[string] `json:"id,required"`
+ // The configuration to use for matched data logging.
+ MatchedData param.Field[PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersMatchedData] `json:"matched_data"`
+ // A set of overrides to apply to the target ruleset.
+ Overrides param.Field[PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverrides] `json:"overrides"`
+}
+
+func (r PhaseUpdateParamsRulesRulesetsExecuteRuleActionParameters) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The configuration to use for matched data logging.
+type PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersMatchedData struct {
+ // The public key to encrypt matched data logs with.
+ PublicKey param.Field[string] `json:"public_key,required"`
+}
+
+func (r PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersMatchedData) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// A set of overrides to apply to the target ruleset.
+type PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverrides struct {
+ // An action to override all rules with. This option has lower precedence than rule
+ // and category overrides.
+ Action param.Field[string] `json:"action"`
+ // A list of category-level overrides. This option has the second-highest
+ // precedence after rule-level overrides.
+ Categories param.Field[[]PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategory] `json:"categories"`
+ // Whether to enable execution of all rules. This option has lower precedence than
+ // rule and category overrides.
+ Enabled param.Field[bool] `json:"enabled"`
+ // A list of rule-level overrides. This option has the highest precedence.
+ Rules param.Field[[]PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRule] `json:"rules"`
+ // A sensitivity level to set for all rules. This option has lower precedence than
+ // rule and category overrides and is only applicable for DDoS phases.
+ SensitivityLevel param.Field[PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel] `json:"sensitivity_level"`
+}
+
+func (r PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverrides) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// A category-level override
+type PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategory struct {
+ // The name of the category to override.
+ Category param.Field[string] `json:"category,required"`
+ // The action to override rules in the category with.
+ Action param.Field[string] `json:"action"`
+ // Whether to enable execution of rules in the category.
+ Enabled param.Field[bool] `json:"enabled"`
+ // The sensitivity level to use for rules in the category.
+ SensitivityLevel param.Field[PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel] `json:"sensitivity_level"`
+}
+
+func (r PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategory) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The sensitivity level to use for rules in the category.
+type PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel string
+
+const (
+ PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "default"
+ PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "medium"
+ PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "low"
+ PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "eoff"
+)
+
+// A rule-level override
+type PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRule struct {
+ // The ID of the rule to override.
+ ID param.Field[string] `json:"id,required"`
+ // The action to override the rule with.
+ Action param.Field[string] `json:"action"`
+ // Whether to enable execution of the rule.
+ Enabled param.Field[bool] `json:"enabled"`
+ // The score threshold to use for the rule.
+ ScoreThreshold param.Field[int64] `json:"score_threshold"`
+ // The sensitivity level to use for the rule.
+ SensitivityLevel param.Field[PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel] `json:"sensitivity_level"`
+}
+
+func (r PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRule) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The sensitivity level to use for the rule.
+type PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel string
+
+const (
+ PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "default"
+ PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "medium"
+ PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelLow PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "low"
+ PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "eoff"
+)
+
+// A sensitivity level to set for all rules. This option has lower precedence than
+// rule and category overrides and is only applicable for DDoS phases.
+type PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel string
+
+const (
+ PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelDefault PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "default"
+ PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelMedium PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "medium"
+ PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelLow PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "low"
+ PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelEoff PhaseUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "eoff"
+)
+
+// An object configuring the rule's logging behavior.
+type PhaseUpdateParamsRulesRulesetsExecuteRuleLogging struct {
+ // Whether to generate a log when the rule matches.
+ Enabled param.Field[bool] `json:"enabled,required"`
+}
+
+func (r PhaseUpdateParamsRulesRulesetsExecuteRuleLogging) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type PhaseUpdateParamsRulesRulesetsLogRule struct {
+ // The unique ID of the rule.
+ ID param.Field[string] `json:"id"`
+ // The action to perform when the rule matches.
+ Action param.Field[PhaseUpdateParamsRulesRulesetsLogRuleAction] `json:"action"`
+ // The parameters configuring the rule's action.
+ ActionParameters param.Field[interface{}] `json:"action_parameters"`
+ // An informative description of the rule.
+ Description param.Field[string] `json:"description"`
+ // Whether the rule should be executed.
+ Enabled param.Field[bool] `json:"enabled"`
+ // The expression defining which traffic will match the rule.
+ Expression param.Field[string] `json:"expression"`
+ // An object configuring the rule's logging behavior.
+ Logging param.Field[PhaseUpdateParamsRulesRulesetsLogRuleLogging] `json:"logging"`
+ // The reference of the rule (the rule ID by default).
+ Ref param.Field[string] `json:"ref"`
+}
+
+func (r PhaseUpdateParamsRulesRulesetsLogRule) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+func (r PhaseUpdateParamsRulesRulesetsLogRule) implementsRulesetsPhaseUpdateParamsRule() {}
+
+// The action to perform when the rule matches.
+type PhaseUpdateParamsRulesRulesetsLogRuleAction string
+
+const (
+ PhaseUpdateParamsRulesRulesetsLogRuleActionLog PhaseUpdateParamsRulesRulesetsLogRuleAction = "log"
+)
+
+// An object configuring the rule's logging behavior.
+type PhaseUpdateParamsRulesRulesetsLogRuleLogging struct {
+ // Whether to generate a log when the rule matches.
+ Enabled param.Field[bool] `json:"enabled,required"`
+}
+
+func (r PhaseUpdateParamsRulesRulesetsLogRuleLogging) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type PhaseUpdateParamsRulesRulesetsSkipRule struct {
+ // The unique ID of the rule.
+ ID param.Field[string] `json:"id"`
+ // The action to perform when the rule matches.
+ Action param.Field[PhaseUpdateParamsRulesRulesetsSkipRuleAction] `json:"action"`
+ // The parameters configuring the rule's action.
+ ActionParameters param.Field[PhaseUpdateParamsRulesRulesetsSkipRuleActionParameters] `json:"action_parameters"`
+ // An informative description of the rule.
+ Description param.Field[string] `json:"description"`
+ // Whether the rule should be executed.
+ Enabled param.Field[bool] `json:"enabled"`
+ // The expression defining which traffic will match the rule.
+ Expression param.Field[string] `json:"expression"`
+ // An object configuring the rule's logging behavior.
+ Logging param.Field[PhaseUpdateParamsRulesRulesetsSkipRuleLogging] `json:"logging"`
+ // The reference of the rule (the rule ID by default).
+ Ref param.Field[string] `json:"ref"`
+}
+
+func (r PhaseUpdateParamsRulesRulesetsSkipRule) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+func (r PhaseUpdateParamsRulesRulesetsSkipRule) implementsRulesetsPhaseUpdateParamsRule() {}
+
+// The action to perform when the rule matches.
+type PhaseUpdateParamsRulesRulesetsSkipRuleAction string
+
+const (
+ PhaseUpdateParamsRulesRulesetsSkipRuleActionSkip PhaseUpdateParamsRulesRulesetsSkipRuleAction = "skip"
+)
+
+// The parameters configuring the rule's action.
+type PhaseUpdateParamsRulesRulesetsSkipRuleActionParameters struct {
+ // A list of phases to skip the execution of. This option is incompatible with the
+ // ruleset and rulesets options.
+ Phases param.Field[[]PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase] `json:"phases"`
+ // A list of legacy security products to skip the execution of.
+ Products param.Field[[]PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersProduct] `json:"products"`
+ // A mapping of ruleset IDs to a list of rule IDs in that ruleset to skip the
+ // execution of. This option is incompatible with the ruleset option.
+ Rules param.Field[map[string][]string] `json:"rules"`
+ // A ruleset to skip the execution of. This option is incompatible with the
+ // rulesets, rules and phases options.
+ Ruleset param.Field[PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersRuleset] `json:"ruleset"`
+ // A list of ruleset IDs to skip the execution of. This option is incompatible with
+ // the ruleset and phases options.
+ Rulesets param.Field[[]string] `json:"rulesets"`
+}
+
+func (r PhaseUpdateParamsRulesRulesetsSkipRuleActionParameters) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// A phase to skip the execution of.
+type PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase string
+
+const (
+ PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseDDOSL4 PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "ddos_l4"
+ PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseDDOSL7 PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "ddos_l7"
+ PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPConfigSettings PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_config_settings"
+ PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPCustomErrors PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_custom_errors"
+ PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPLogCustomFields PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_log_custom_fields"
+ PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRatelimit PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_ratelimit"
+ PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestCacheSettings PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_cache_settings"
+ PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestDynamicRedirect PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_dynamic_redirect"
+ PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallCustom PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_custom"
+ PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallManaged PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_managed"
+ PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestLateTransform PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_late_transform"
+ PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestOrigin PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_origin"
+ PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestRedirect PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_redirect"
+ PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSanitize PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_sanitize"
+ PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSbfm PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_sbfm"
+ PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSelectConfiguration PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_select_configuration"
+ PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestTransform PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_transform"
+ PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseCompression PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_response_compression"
+ PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseFirewallManaged PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_response_firewall_managed"
+ PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseHeadersTransform PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_response_headers_transform"
+ PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseMagicTransit PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "magic_transit"
+ PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseMagicTransitIDsManaged PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_ids_managed"
+ PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseMagicTransitManaged PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_managed"
+)
+
+// The name of a legacy security product to skip the execution of.
+type PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersProduct string
+
+const (
+ PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersProductBic PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersProduct = "bic"
+ PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersProductHot PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersProduct = "hot"
+ PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersProductRateLimit PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersProduct = "rateLimit"
+ PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersProductSecurityLevel PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersProduct = "securityLevel"
+ PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersProductUABlock PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersProduct = "uaBlock"
+ PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersProductWAF PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersProduct = "waf"
+ PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersProductZoneLockdown PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersProduct = "zoneLockdown"
+)
+
+// A ruleset to skip the execution of. This option is incompatible with the
+// rulesets, rules and phases options.
+type PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersRuleset string
+
+const (
+ PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersRulesetCurrent PhaseUpdateParamsRulesRulesetsSkipRuleActionParametersRuleset = "current"
+)
+
+// An object configuring the rule's logging behavior.
+type PhaseUpdateParamsRulesRulesetsSkipRuleLogging struct {
+ // Whether to generate a log when the rule matches.
+ Enabled param.Field[bool] `json:"enabled,required"`
+}
+
+func (r PhaseUpdateParamsRulesRulesetsSkipRuleLogging) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The kind of the ruleset.
+type PhaseUpdateParamsKind string
+
+const (
+ PhaseUpdateParamsKindManaged PhaseUpdateParamsKind = "managed"
+ PhaseUpdateParamsKindCustom PhaseUpdateParamsKind = "custom"
+ PhaseUpdateParamsKindRoot PhaseUpdateParamsKind = "root"
+ PhaseUpdateParamsKindZone PhaseUpdateParamsKind = "zone"
+)
+
+// The phase of the ruleset.
+type PhaseUpdateParamsPhase string
+
+const (
+ PhaseUpdateParamsPhaseDDOSL4 PhaseUpdateParamsPhase = "ddos_l4"
+ PhaseUpdateParamsPhaseDDOSL7 PhaseUpdateParamsPhase = "ddos_l7"
+ PhaseUpdateParamsPhaseHTTPConfigSettings PhaseUpdateParamsPhase = "http_config_settings"
+ PhaseUpdateParamsPhaseHTTPCustomErrors PhaseUpdateParamsPhase = "http_custom_errors"
+ PhaseUpdateParamsPhaseHTTPLogCustomFields PhaseUpdateParamsPhase = "http_log_custom_fields"
+ PhaseUpdateParamsPhaseHTTPRatelimit PhaseUpdateParamsPhase = "http_ratelimit"
+ PhaseUpdateParamsPhaseHTTPRequestCacheSettings PhaseUpdateParamsPhase = "http_request_cache_settings"
+ PhaseUpdateParamsPhaseHTTPRequestDynamicRedirect PhaseUpdateParamsPhase = "http_request_dynamic_redirect"
+ PhaseUpdateParamsPhaseHTTPRequestFirewallCustom PhaseUpdateParamsPhase = "http_request_firewall_custom"
+ PhaseUpdateParamsPhaseHTTPRequestFirewallManaged PhaseUpdateParamsPhase = "http_request_firewall_managed"
+ PhaseUpdateParamsPhaseHTTPRequestLateTransform PhaseUpdateParamsPhase = "http_request_late_transform"
+ PhaseUpdateParamsPhaseHTTPRequestOrigin PhaseUpdateParamsPhase = "http_request_origin"
+ PhaseUpdateParamsPhaseHTTPRequestRedirect PhaseUpdateParamsPhase = "http_request_redirect"
+ PhaseUpdateParamsPhaseHTTPRequestSanitize PhaseUpdateParamsPhase = "http_request_sanitize"
+ PhaseUpdateParamsPhaseHTTPRequestSbfm PhaseUpdateParamsPhase = "http_request_sbfm"
+ PhaseUpdateParamsPhaseHTTPRequestSelectConfiguration PhaseUpdateParamsPhase = "http_request_select_configuration"
+ PhaseUpdateParamsPhaseHTTPRequestTransform PhaseUpdateParamsPhase = "http_request_transform"
+ PhaseUpdateParamsPhaseHTTPResponseCompression PhaseUpdateParamsPhase = "http_response_compression"
+ PhaseUpdateParamsPhaseHTTPResponseFirewallManaged PhaseUpdateParamsPhase = "http_response_firewall_managed"
+ PhaseUpdateParamsPhaseHTTPResponseHeadersTransform PhaseUpdateParamsPhase = "http_response_headers_transform"
+ PhaseUpdateParamsPhaseMagicTransit PhaseUpdateParamsPhase = "magic_transit"
+ PhaseUpdateParamsPhaseMagicTransitIDsManaged PhaseUpdateParamsPhase = "magic_transit_ids_managed"
+ PhaseUpdateParamsPhaseMagicTransitManaged PhaseUpdateParamsPhase = "magic_transit_managed"
+)
+
+// A response object.
+type PhaseUpdateResponseEnvelope struct {
+ // A list of error messages.
+ Errors []PhaseUpdateResponseEnvelopeErrors `json:"errors,required"`
+ // A list of warning messages.
+ Messages []PhaseUpdateResponseEnvelopeMessages `json:"messages,required"`
+ // A result.
+ Result RulesetsRulesetResponse `json:"result,required"`
+ // Whether the API call was successful.
+ Success PhaseUpdateResponseEnvelopeSuccess `json:"success,required"`
+ JSON phaseUpdateResponseEnvelopeJSON `json:"-"`
+}
+
+// phaseUpdateResponseEnvelopeJSON contains the JSON metadata for the struct
+// [PhaseUpdateResponseEnvelope]
+type phaseUpdateResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PhaseUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r phaseUpdateResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+// A message.
+type PhaseUpdateResponseEnvelopeErrors struct {
+ // A text description of this message.
+ Message string `json:"message,required"`
+ // A unique code for this message.
+ Code int64 `json:"code"`
+ // The source of this message.
+ Source PhaseUpdateResponseEnvelopeErrorsSource `json:"source"`
+ JSON phaseUpdateResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// phaseUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [PhaseUpdateResponseEnvelopeErrors]
+type phaseUpdateResponseEnvelopeErrorsJSON struct {
+ Message apijson.Field
+ Code apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PhaseUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r phaseUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+// The source of this message.
+type PhaseUpdateResponseEnvelopeErrorsSource struct {
+ // A JSON pointer to the field that is the source of the message.
+ Pointer string `json:"pointer,required"`
+ JSON phaseUpdateResponseEnvelopeErrorsSourceJSON `json:"-"`
+}
+
+// phaseUpdateResponseEnvelopeErrorsSourceJSON contains the JSON metadata for the
+// struct [PhaseUpdateResponseEnvelopeErrorsSource]
+type phaseUpdateResponseEnvelopeErrorsSourceJSON struct {
+ Pointer apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PhaseUpdateResponseEnvelopeErrorsSource) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r phaseUpdateResponseEnvelopeErrorsSourceJSON) RawJSON() string {
+ return r.raw
+}
+
+// A message.
+type PhaseUpdateResponseEnvelopeMessages struct {
+ // A text description of this message.
+ Message string `json:"message,required"`
+ // A unique code for this message.
+ Code int64 `json:"code"`
+ // The source of this message.
+ Source PhaseUpdateResponseEnvelopeMessagesSource `json:"source"`
+ JSON phaseUpdateResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// phaseUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [PhaseUpdateResponseEnvelopeMessages]
+type phaseUpdateResponseEnvelopeMessagesJSON struct {
+ Message apijson.Field
+ Code apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PhaseUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r phaseUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// The source of this message.
+type PhaseUpdateResponseEnvelopeMessagesSource struct {
+ // A JSON pointer to the field that is the source of the message.
+ Pointer string `json:"pointer,required"`
+ JSON phaseUpdateResponseEnvelopeMessagesSourceJSON `json:"-"`
+}
+
+// phaseUpdateResponseEnvelopeMessagesSourceJSON contains the JSON metadata for the
+// struct [PhaseUpdateResponseEnvelopeMessagesSource]
+type phaseUpdateResponseEnvelopeMessagesSourceJSON struct {
+ Pointer apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PhaseUpdateResponseEnvelopeMessagesSource) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r phaseUpdateResponseEnvelopeMessagesSourceJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful.
+type PhaseUpdateResponseEnvelopeSuccess bool
+
+const (
+ PhaseUpdateResponseEnvelopeSuccessTrue PhaseUpdateResponseEnvelopeSuccess = true
+)
+
+type PhaseGetParams struct {
+ // The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+ AccountID param.Field[string] `path:"account_id"`
+ // The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+ ZoneID param.Field[string] `path:"zone_id"`
+}
+
+// The phase of the ruleset.
+type PhaseGetParamsRulesetPhase string
+
+const (
+ PhaseGetParamsRulesetPhaseDDOSL4 PhaseGetParamsRulesetPhase = "ddos_l4"
+ PhaseGetParamsRulesetPhaseDDOSL7 PhaseGetParamsRulesetPhase = "ddos_l7"
+ PhaseGetParamsRulesetPhaseHTTPConfigSettings PhaseGetParamsRulesetPhase = "http_config_settings"
+ PhaseGetParamsRulesetPhaseHTTPCustomErrors PhaseGetParamsRulesetPhase = "http_custom_errors"
+ PhaseGetParamsRulesetPhaseHTTPLogCustomFields PhaseGetParamsRulesetPhase = "http_log_custom_fields"
+ PhaseGetParamsRulesetPhaseHTTPRatelimit PhaseGetParamsRulesetPhase = "http_ratelimit"
+ PhaseGetParamsRulesetPhaseHTTPRequestCacheSettings PhaseGetParamsRulesetPhase = "http_request_cache_settings"
+ PhaseGetParamsRulesetPhaseHTTPRequestDynamicRedirect PhaseGetParamsRulesetPhase = "http_request_dynamic_redirect"
+ PhaseGetParamsRulesetPhaseHTTPRequestFirewallCustom PhaseGetParamsRulesetPhase = "http_request_firewall_custom"
+ PhaseGetParamsRulesetPhaseHTTPRequestFirewallManaged PhaseGetParamsRulesetPhase = "http_request_firewall_managed"
+ PhaseGetParamsRulesetPhaseHTTPRequestLateTransform PhaseGetParamsRulesetPhase = "http_request_late_transform"
+ PhaseGetParamsRulesetPhaseHTTPRequestOrigin PhaseGetParamsRulesetPhase = "http_request_origin"
+ PhaseGetParamsRulesetPhaseHTTPRequestRedirect PhaseGetParamsRulesetPhase = "http_request_redirect"
+ PhaseGetParamsRulesetPhaseHTTPRequestSanitize PhaseGetParamsRulesetPhase = "http_request_sanitize"
+ PhaseGetParamsRulesetPhaseHTTPRequestSbfm PhaseGetParamsRulesetPhase = "http_request_sbfm"
+ PhaseGetParamsRulesetPhaseHTTPRequestSelectConfiguration PhaseGetParamsRulesetPhase = "http_request_select_configuration"
+ PhaseGetParamsRulesetPhaseHTTPRequestTransform PhaseGetParamsRulesetPhase = "http_request_transform"
+ PhaseGetParamsRulesetPhaseHTTPResponseCompression PhaseGetParamsRulesetPhase = "http_response_compression"
+ PhaseGetParamsRulesetPhaseHTTPResponseFirewallManaged PhaseGetParamsRulesetPhase = "http_response_firewall_managed"
+ PhaseGetParamsRulesetPhaseHTTPResponseHeadersTransform PhaseGetParamsRulesetPhase = "http_response_headers_transform"
+ PhaseGetParamsRulesetPhaseMagicTransit PhaseGetParamsRulesetPhase = "magic_transit"
+ PhaseGetParamsRulesetPhaseMagicTransitIDsManaged PhaseGetParamsRulesetPhase = "magic_transit_ids_managed"
+ PhaseGetParamsRulesetPhaseMagicTransitManaged PhaseGetParamsRulesetPhase = "magic_transit_managed"
+)
+
+// A response object.
+type PhaseGetResponseEnvelope struct {
+ // A list of error messages.
+ Errors []PhaseGetResponseEnvelopeErrors `json:"errors,required"`
+ // A list of warning messages.
+ Messages []PhaseGetResponseEnvelopeMessages `json:"messages,required"`
+ // A result.
+ Result RulesetsRulesetResponse `json:"result,required"`
+ // Whether the API call was successful.
+ Success PhaseGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON phaseGetResponseEnvelopeJSON `json:"-"`
+}
+
+// phaseGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [PhaseGetResponseEnvelope]
+type phaseGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PhaseGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r phaseGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+// A message.
+type PhaseGetResponseEnvelopeErrors struct {
+ // A text description of this message.
+ Message string `json:"message,required"`
+ // A unique code for this message.
+ Code int64 `json:"code"`
+ // The source of this message.
+ Source PhaseGetResponseEnvelopeErrorsSource `json:"source"`
+ JSON phaseGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// phaseGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [PhaseGetResponseEnvelopeErrors]
+type phaseGetResponseEnvelopeErrorsJSON struct {
+ Message apijson.Field
+ Code apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PhaseGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r phaseGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+// The source of this message.
+type PhaseGetResponseEnvelopeErrorsSource struct {
+ // A JSON pointer to the field that is the source of the message.
+ Pointer string `json:"pointer,required"`
+ JSON phaseGetResponseEnvelopeErrorsSourceJSON `json:"-"`
+}
+
+// phaseGetResponseEnvelopeErrorsSourceJSON contains the JSON metadata for the
+// struct [PhaseGetResponseEnvelopeErrorsSource]
+type phaseGetResponseEnvelopeErrorsSourceJSON struct {
+ Pointer apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PhaseGetResponseEnvelopeErrorsSource) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r phaseGetResponseEnvelopeErrorsSourceJSON) RawJSON() string {
+ return r.raw
+}
+
+// A message.
+type PhaseGetResponseEnvelopeMessages struct {
+ // A text description of this message.
+ Message string `json:"message,required"`
+ // A unique code for this message.
+ Code int64 `json:"code"`
+ // The source of this message.
+ Source PhaseGetResponseEnvelopeMessagesSource `json:"source"`
+ JSON phaseGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// phaseGetResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [PhaseGetResponseEnvelopeMessages]
+type phaseGetResponseEnvelopeMessagesJSON struct {
+ Message apijson.Field
+ Code apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PhaseGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r phaseGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// The source of this message.
+type PhaseGetResponseEnvelopeMessagesSource struct {
+ // A JSON pointer to the field that is the source of the message.
+ Pointer string `json:"pointer,required"`
+ JSON phaseGetResponseEnvelopeMessagesSourceJSON `json:"-"`
+}
+
+// phaseGetResponseEnvelopeMessagesSourceJSON contains the JSON metadata for the
+// struct [PhaseGetResponseEnvelopeMessagesSource]
+type phaseGetResponseEnvelopeMessagesSourceJSON struct {
+ Pointer apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PhaseGetResponseEnvelopeMessagesSource) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r phaseGetResponseEnvelopeMessagesSourceJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful.
+type PhaseGetResponseEnvelopeSuccess bool
+
+const (
+ PhaseGetResponseEnvelopeSuccessTrue PhaseGetResponseEnvelopeSuccess = true
+)
diff --git a/rulesets/phase_test.go b/rulesets/phase_test.go
new file mode 100644
index 00000000000..049983acc09
--- /dev/null
+++ b/rulesets/phase_test.go
@@ -0,0 +1,134 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package rulesets_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/rulesets"
+)
+
+func TestPhaseUpdateWithOptionalParams(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"),
+ )
+ _, err := client.Rulesets.Phases.Update(
+ context.TODO(),
+ rulesets.PhaseUpdateParamsRulesetPhaseHTTPRequestFirewallCustom,
+ rulesets.PhaseUpdateParams{
+ ID: cloudflare.F("2f2feab2026849078ba485f918791bdc"),
+ Rules: cloudflare.F([]rulesets.PhaseUpdateParamsRule{rulesets.PhaseUpdateParamsRulesRulesetsBlockRule(rulesets.PhaseUpdateParamsRulesRulesetsBlockRule{
+ Action: cloudflare.F(rulesets.PhaseUpdateParamsRulesRulesetsBlockRuleActionBlock),
+ ActionParameters: cloudflare.F(rulesets.PhaseUpdateParamsRulesRulesetsBlockRuleActionParameters{
+ Response: cloudflare.F(rulesets.PhaseUpdateParamsRulesRulesetsBlockRuleActionParametersResponse{
+ Content: cloudflare.F("{\n \"success\": false,\n \"error\": \"you have been blocked\"\n}"),
+ ContentType: cloudflare.F("application/json"),
+ StatusCode: cloudflare.F(int64(400)),
+ }),
+ }),
+ Description: cloudflare.F("Block when the IP address is not 1.1.1.1"),
+ Enabled: cloudflare.F(true),
+ Expression: cloudflare.F("ip.src ne 1.1.1.1"),
+ ID: cloudflare.F("3a03d665bac047339bb530ecb439a90d"),
+ Logging: cloudflare.F(rulesets.PhaseUpdateParamsRulesRulesetsBlockRuleLogging{
+ Enabled: cloudflare.F(true),
+ }),
+ Ref: cloudflare.F("my_ref"),
+ }), rulesets.PhaseUpdateParamsRulesRulesetsBlockRule(rulesets.PhaseUpdateParamsRulesRulesetsBlockRule{
+ Action: cloudflare.F(rulesets.PhaseUpdateParamsRulesRulesetsBlockRuleActionBlock),
+ ActionParameters: cloudflare.F(rulesets.PhaseUpdateParamsRulesRulesetsBlockRuleActionParameters{
+ Response: cloudflare.F(rulesets.PhaseUpdateParamsRulesRulesetsBlockRuleActionParametersResponse{
+ Content: cloudflare.F("{\n \"success\": false,\n \"error\": \"you have been blocked\"\n}"),
+ ContentType: cloudflare.F("application/json"),
+ StatusCode: cloudflare.F(int64(400)),
+ }),
+ }),
+ Description: cloudflare.F("Block when the IP address is not 1.1.1.1"),
+ Enabled: cloudflare.F(true),
+ Expression: cloudflare.F("ip.src ne 1.1.1.1"),
+ ID: cloudflare.F("3a03d665bac047339bb530ecb439a90d"),
+ Logging: cloudflare.F(rulesets.PhaseUpdateParamsRulesRulesetsBlockRuleLogging{
+ Enabled: cloudflare.F(true),
+ }),
+ Ref: cloudflare.F("my_ref"),
+ }), rulesets.PhaseUpdateParamsRulesRulesetsBlockRule(rulesets.PhaseUpdateParamsRulesRulesetsBlockRule{
+ Action: cloudflare.F(rulesets.PhaseUpdateParamsRulesRulesetsBlockRuleActionBlock),
+ ActionParameters: cloudflare.F(rulesets.PhaseUpdateParamsRulesRulesetsBlockRuleActionParameters{
+ Response: cloudflare.F(rulesets.PhaseUpdateParamsRulesRulesetsBlockRuleActionParametersResponse{
+ Content: cloudflare.F("{\n \"success\": false,\n \"error\": \"you have been blocked\"\n}"),
+ ContentType: cloudflare.F("application/json"),
+ StatusCode: cloudflare.F(int64(400)),
+ }),
+ }),
+ Description: cloudflare.F("Block when the IP address is not 1.1.1.1"),
+ Enabled: cloudflare.F(true),
+ Expression: cloudflare.F("ip.src ne 1.1.1.1"),
+ ID: cloudflare.F("3a03d665bac047339bb530ecb439a90d"),
+ Logging: cloudflare.F(rulesets.PhaseUpdateParamsRulesRulesetsBlockRuleLogging{
+ Enabled: cloudflare.F(true),
+ }),
+ Ref: cloudflare.F("my_ref"),
+ })}),
+ AccountID: cloudflare.F("string"),
+ ZoneID: cloudflare.F("string"),
+ Description: cloudflare.F("My ruleset to execute managed rulesets"),
+ Kind: cloudflare.F(rulesets.PhaseUpdateParamsKindRoot),
+ Name: cloudflare.F("My ruleset"),
+ Phase: cloudflare.F(rulesets.PhaseUpdateParamsPhaseHTTPRequestFirewallCustom),
+ },
+ )
+ 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())
+ }
+}
+
+func TestPhaseGetWithOptionalParams(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"),
+ )
+ _, err := client.Rulesets.Phases.Get(
+ context.TODO(),
+ rulesets.PhaseGetParamsRulesetPhaseHTTPRequestFirewallCustom,
+ rulesets.PhaseGetParams{
+ AccountID: cloudflare.F("string"),
+ ZoneID: cloudflare.F("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/rulesets/phaseversion.go b/rulesets/phaseversion.go
new file mode 100644
index 00000000000..352a3c62d26
--- /dev/null
+++ b/rulesets/phaseversion.go
@@ -0,0 +1,515 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package rulesets
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// PhaseVersionService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewPhaseVersionService] method
+// instead.
+type PhaseVersionService struct {
+ Options []option.RequestOption
+}
+
+// NewPhaseVersionService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewPhaseVersionService(opts ...option.RequestOption) (r *PhaseVersionService) {
+ r = &PhaseVersionService{}
+ r.Options = opts
+ return
+}
+
+// Fetches the versions of an account or zone entry point ruleset.
+func (r *PhaseVersionService) List(ctx context.Context, rulesetPhase PhaseVersionListParamsRulesetPhase, query PhaseVersionListParams, opts ...option.RequestOption) (res *RulesetsRulesetsResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env PhaseVersionListResponseEnvelope
+ var accountOrZone string
+ var accountOrZoneID param.Field[string]
+ if query.AccountID.Present {
+ accountOrZone = "accounts"
+ accountOrZoneID = query.AccountID
+ } else {
+ accountOrZone = "zones"
+ accountOrZoneID = query.ZoneID
+ }
+ path := fmt.Sprintf("%s/%s/rulesets/phases/%v/entrypoint/versions", accountOrZone, accountOrZoneID, rulesetPhase)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Fetches a specific version of an account or zone entry point ruleset.
+func (r *PhaseVersionService) Get(ctx context.Context, rulesetPhase PhaseVersionGetParamsRulesetPhase, rulesetVersion string, query PhaseVersionGetParams, opts ...option.RequestOption) (res *RulesetsRulesetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env PhaseVersionGetResponseEnvelope
+ var accountOrZone string
+ var accountOrZoneID param.Field[string]
+ if query.AccountID.Present {
+ accountOrZone = "accounts"
+ accountOrZoneID = query.AccountID
+ } else {
+ accountOrZone = "zones"
+ accountOrZoneID = query.ZoneID
+ }
+ path := fmt.Sprintf("%s/%s/rulesets/phases/%v/entrypoint/versions/%s", accountOrZone, accountOrZoneID, rulesetPhase, rulesetVersion)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// A ruleset object.
+type PhaseVersionListResponse struct {
+ // The kind of the ruleset.
+ Kind PhaseVersionListResponseKind `json:"kind,required"`
+ // The human-readable name of the ruleset.
+ Name string `json:"name,required"`
+ // The phase of the ruleset.
+ Phase PhaseVersionListResponsePhase `json:"phase,required"`
+ // The unique ID of the ruleset.
+ ID string `json:"id"`
+ // An informative description of the ruleset.
+ Description string `json:"description"`
+ // The timestamp of when the ruleset was last modified.
+ LastUpdated time.Time `json:"last_updated" format:"date-time"`
+ // The version of the ruleset.
+ Version string `json:"version"`
+ JSON phaseVersionListResponseJSON `json:"-"`
+}
+
+// phaseVersionListResponseJSON contains the JSON metadata for the struct
+// [PhaseVersionListResponse]
+type phaseVersionListResponseJSON struct {
+ Kind apijson.Field
+ Name apijson.Field
+ Phase apijson.Field
+ ID apijson.Field
+ Description apijson.Field
+ LastUpdated apijson.Field
+ Version apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PhaseVersionListResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r phaseVersionListResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+// The kind of the ruleset.
+type PhaseVersionListResponseKind string
+
+const (
+ PhaseVersionListResponseKindManaged PhaseVersionListResponseKind = "managed"
+ PhaseVersionListResponseKindCustom PhaseVersionListResponseKind = "custom"
+ PhaseVersionListResponseKindRoot PhaseVersionListResponseKind = "root"
+ PhaseVersionListResponseKindZone PhaseVersionListResponseKind = "zone"
+)
+
+// The phase of the ruleset.
+type PhaseVersionListResponsePhase string
+
+const (
+ PhaseVersionListResponsePhaseDDOSL4 PhaseVersionListResponsePhase = "ddos_l4"
+ PhaseVersionListResponsePhaseDDOSL7 PhaseVersionListResponsePhase = "ddos_l7"
+ PhaseVersionListResponsePhaseHTTPConfigSettings PhaseVersionListResponsePhase = "http_config_settings"
+ PhaseVersionListResponsePhaseHTTPCustomErrors PhaseVersionListResponsePhase = "http_custom_errors"
+ PhaseVersionListResponsePhaseHTTPLogCustomFields PhaseVersionListResponsePhase = "http_log_custom_fields"
+ PhaseVersionListResponsePhaseHTTPRatelimit PhaseVersionListResponsePhase = "http_ratelimit"
+ PhaseVersionListResponsePhaseHTTPRequestCacheSettings PhaseVersionListResponsePhase = "http_request_cache_settings"
+ PhaseVersionListResponsePhaseHTTPRequestDynamicRedirect PhaseVersionListResponsePhase = "http_request_dynamic_redirect"
+ PhaseVersionListResponsePhaseHTTPRequestFirewallCustom PhaseVersionListResponsePhase = "http_request_firewall_custom"
+ PhaseVersionListResponsePhaseHTTPRequestFirewallManaged PhaseVersionListResponsePhase = "http_request_firewall_managed"
+ PhaseVersionListResponsePhaseHTTPRequestLateTransform PhaseVersionListResponsePhase = "http_request_late_transform"
+ PhaseVersionListResponsePhaseHTTPRequestOrigin PhaseVersionListResponsePhase = "http_request_origin"
+ PhaseVersionListResponsePhaseHTTPRequestRedirect PhaseVersionListResponsePhase = "http_request_redirect"
+ PhaseVersionListResponsePhaseHTTPRequestSanitize PhaseVersionListResponsePhase = "http_request_sanitize"
+ PhaseVersionListResponsePhaseHTTPRequestSbfm PhaseVersionListResponsePhase = "http_request_sbfm"
+ PhaseVersionListResponsePhaseHTTPRequestSelectConfiguration PhaseVersionListResponsePhase = "http_request_select_configuration"
+ PhaseVersionListResponsePhaseHTTPRequestTransform PhaseVersionListResponsePhase = "http_request_transform"
+ PhaseVersionListResponsePhaseHTTPResponseCompression PhaseVersionListResponsePhase = "http_response_compression"
+ PhaseVersionListResponsePhaseHTTPResponseFirewallManaged PhaseVersionListResponsePhase = "http_response_firewall_managed"
+ PhaseVersionListResponsePhaseHTTPResponseHeadersTransform PhaseVersionListResponsePhase = "http_response_headers_transform"
+ PhaseVersionListResponsePhaseMagicTransit PhaseVersionListResponsePhase = "magic_transit"
+ PhaseVersionListResponsePhaseMagicTransitIDsManaged PhaseVersionListResponsePhase = "magic_transit_ids_managed"
+ PhaseVersionListResponsePhaseMagicTransitManaged PhaseVersionListResponsePhase = "magic_transit_managed"
+)
+
+type PhaseVersionListParams struct {
+ // The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+ AccountID param.Field[string] `path:"account_id"`
+ // The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+ ZoneID param.Field[string] `path:"zone_id"`
+}
+
+// The phase of the ruleset.
+type PhaseVersionListParamsRulesetPhase string
+
+const (
+ PhaseVersionListParamsRulesetPhaseDDOSL4 PhaseVersionListParamsRulesetPhase = "ddos_l4"
+ PhaseVersionListParamsRulesetPhaseDDOSL7 PhaseVersionListParamsRulesetPhase = "ddos_l7"
+ PhaseVersionListParamsRulesetPhaseHTTPConfigSettings PhaseVersionListParamsRulesetPhase = "http_config_settings"
+ PhaseVersionListParamsRulesetPhaseHTTPCustomErrors PhaseVersionListParamsRulesetPhase = "http_custom_errors"
+ PhaseVersionListParamsRulesetPhaseHTTPLogCustomFields PhaseVersionListParamsRulesetPhase = "http_log_custom_fields"
+ PhaseVersionListParamsRulesetPhaseHTTPRatelimit PhaseVersionListParamsRulesetPhase = "http_ratelimit"
+ PhaseVersionListParamsRulesetPhaseHTTPRequestCacheSettings PhaseVersionListParamsRulesetPhase = "http_request_cache_settings"
+ PhaseVersionListParamsRulesetPhaseHTTPRequestDynamicRedirect PhaseVersionListParamsRulesetPhase = "http_request_dynamic_redirect"
+ PhaseVersionListParamsRulesetPhaseHTTPRequestFirewallCustom PhaseVersionListParamsRulesetPhase = "http_request_firewall_custom"
+ PhaseVersionListParamsRulesetPhaseHTTPRequestFirewallManaged PhaseVersionListParamsRulesetPhase = "http_request_firewall_managed"
+ PhaseVersionListParamsRulesetPhaseHTTPRequestLateTransform PhaseVersionListParamsRulesetPhase = "http_request_late_transform"
+ PhaseVersionListParamsRulesetPhaseHTTPRequestOrigin PhaseVersionListParamsRulesetPhase = "http_request_origin"
+ PhaseVersionListParamsRulesetPhaseHTTPRequestRedirect PhaseVersionListParamsRulesetPhase = "http_request_redirect"
+ PhaseVersionListParamsRulesetPhaseHTTPRequestSanitize PhaseVersionListParamsRulesetPhase = "http_request_sanitize"
+ PhaseVersionListParamsRulesetPhaseHTTPRequestSbfm PhaseVersionListParamsRulesetPhase = "http_request_sbfm"
+ PhaseVersionListParamsRulesetPhaseHTTPRequestSelectConfiguration PhaseVersionListParamsRulesetPhase = "http_request_select_configuration"
+ PhaseVersionListParamsRulesetPhaseHTTPRequestTransform PhaseVersionListParamsRulesetPhase = "http_request_transform"
+ PhaseVersionListParamsRulesetPhaseHTTPResponseCompression PhaseVersionListParamsRulesetPhase = "http_response_compression"
+ PhaseVersionListParamsRulesetPhaseHTTPResponseFirewallManaged PhaseVersionListParamsRulesetPhase = "http_response_firewall_managed"
+ PhaseVersionListParamsRulesetPhaseHTTPResponseHeadersTransform PhaseVersionListParamsRulesetPhase = "http_response_headers_transform"
+ PhaseVersionListParamsRulesetPhaseMagicTransit PhaseVersionListParamsRulesetPhase = "magic_transit"
+ PhaseVersionListParamsRulesetPhaseMagicTransitIDsManaged PhaseVersionListParamsRulesetPhase = "magic_transit_ids_managed"
+ PhaseVersionListParamsRulesetPhaseMagicTransitManaged PhaseVersionListParamsRulesetPhase = "magic_transit_managed"
+)
+
+// A response object.
+type PhaseVersionListResponseEnvelope struct {
+ // A list of error messages.
+ Errors []PhaseVersionListResponseEnvelopeErrors `json:"errors,required"`
+ // A list of warning messages.
+ Messages []PhaseVersionListResponseEnvelopeMessages `json:"messages,required"`
+ // A result.
+ Result RulesetsRulesetsResponse `json:"result,required"`
+ // Whether the API call was successful.
+ Success PhaseVersionListResponseEnvelopeSuccess `json:"success,required"`
+ JSON phaseVersionListResponseEnvelopeJSON `json:"-"`
+}
+
+// phaseVersionListResponseEnvelopeJSON contains the JSON metadata for the struct
+// [PhaseVersionListResponseEnvelope]
+type phaseVersionListResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PhaseVersionListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r phaseVersionListResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+// A message.
+type PhaseVersionListResponseEnvelopeErrors struct {
+ // A text description of this message.
+ Message string `json:"message,required"`
+ // A unique code for this message.
+ Code int64 `json:"code"`
+ // The source of this message.
+ Source PhaseVersionListResponseEnvelopeErrorsSource `json:"source"`
+ JSON phaseVersionListResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// phaseVersionListResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [PhaseVersionListResponseEnvelopeErrors]
+type phaseVersionListResponseEnvelopeErrorsJSON struct {
+ Message apijson.Field
+ Code apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PhaseVersionListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r phaseVersionListResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+// The source of this message.
+type PhaseVersionListResponseEnvelopeErrorsSource struct {
+ // A JSON pointer to the field that is the source of the message.
+ Pointer string `json:"pointer,required"`
+ JSON phaseVersionListResponseEnvelopeErrorsSourceJSON `json:"-"`
+}
+
+// phaseVersionListResponseEnvelopeErrorsSourceJSON contains the JSON metadata for
+// the struct [PhaseVersionListResponseEnvelopeErrorsSource]
+type phaseVersionListResponseEnvelopeErrorsSourceJSON struct {
+ Pointer apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PhaseVersionListResponseEnvelopeErrorsSource) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r phaseVersionListResponseEnvelopeErrorsSourceJSON) RawJSON() string {
+ return r.raw
+}
+
+// A message.
+type PhaseVersionListResponseEnvelopeMessages struct {
+ // A text description of this message.
+ Message string `json:"message,required"`
+ // A unique code for this message.
+ Code int64 `json:"code"`
+ // The source of this message.
+ Source PhaseVersionListResponseEnvelopeMessagesSource `json:"source"`
+ JSON phaseVersionListResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// phaseVersionListResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [PhaseVersionListResponseEnvelopeMessages]
+type phaseVersionListResponseEnvelopeMessagesJSON struct {
+ Message apijson.Field
+ Code apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PhaseVersionListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r phaseVersionListResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// The source of this message.
+type PhaseVersionListResponseEnvelopeMessagesSource struct {
+ // A JSON pointer to the field that is the source of the message.
+ Pointer string `json:"pointer,required"`
+ JSON phaseVersionListResponseEnvelopeMessagesSourceJSON `json:"-"`
+}
+
+// phaseVersionListResponseEnvelopeMessagesSourceJSON contains the JSON metadata
+// for the struct [PhaseVersionListResponseEnvelopeMessagesSource]
+type phaseVersionListResponseEnvelopeMessagesSourceJSON struct {
+ Pointer apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PhaseVersionListResponseEnvelopeMessagesSource) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r phaseVersionListResponseEnvelopeMessagesSourceJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful.
+type PhaseVersionListResponseEnvelopeSuccess bool
+
+const (
+ PhaseVersionListResponseEnvelopeSuccessTrue PhaseVersionListResponseEnvelopeSuccess = true
+)
+
+type PhaseVersionGetParams struct {
+ // The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+ AccountID param.Field[string] `path:"account_id"`
+ // The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+ ZoneID param.Field[string] `path:"zone_id"`
+}
+
+// The phase of the ruleset.
+type PhaseVersionGetParamsRulesetPhase string
+
+const (
+ PhaseVersionGetParamsRulesetPhaseDDOSL4 PhaseVersionGetParamsRulesetPhase = "ddos_l4"
+ PhaseVersionGetParamsRulesetPhaseDDOSL7 PhaseVersionGetParamsRulesetPhase = "ddos_l7"
+ PhaseVersionGetParamsRulesetPhaseHTTPConfigSettings PhaseVersionGetParamsRulesetPhase = "http_config_settings"
+ PhaseVersionGetParamsRulesetPhaseHTTPCustomErrors PhaseVersionGetParamsRulesetPhase = "http_custom_errors"
+ PhaseVersionGetParamsRulesetPhaseHTTPLogCustomFields PhaseVersionGetParamsRulesetPhase = "http_log_custom_fields"
+ PhaseVersionGetParamsRulesetPhaseHTTPRatelimit PhaseVersionGetParamsRulesetPhase = "http_ratelimit"
+ PhaseVersionGetParamsRulesetPhaseHTTPRequestCacheSettings PhaseVersionGetParamsRulesetPhase = "http_request_cache_settings"
+ PhaseVersionGetParamsRulesetPhaseHTTPRequestDynamicRedirect PhaseVersionGetParamsRulesetPhase = "http_request_dynamic_redirect"
+ PhaseVersionGetParamsRulesetPhaseHTTPRequestFirewallCustom PhaseVersionGetParamsRulesetPhase = "http_request_firewall_custom"
+ PhaseVersionGetParamsRulesetPhaseHTTPRequestFirewallManaged PhaseVersionGetParamsRulesetPhase = "http_request_firewall_managed"
+ PhaseVersionGetParamsRulesetPhaseHTTPRequestLateTransform PhaseVersionGetParamsRulesetPhase = "http_request_late_transform"
+ PhaseVersionGetParamsRulesetPhaseHTTPRequestOrigin PhaseVersionGetParamsRulesetPhase = "http_request_origin"
+ PhaseVersionGetParamsRulesetPhaseHTTPRequestRedirect PhaseVersionGetParamsRulesetPhase = "http_request_redirect"
+ PhaseVersionGetParamsRulesetPhaseHTTPRequestSanitize PhaseVersionGetParamsRulesetPhase = "http_request_sanitize"
+ PhaseVersionGetParamsRulesetPhaseHTTPRequestSbfm PhaseVersionGetParamsRulesetPhase = "http_request_sbfm"
+ PhaseVersionGetParamsRulesetPhaseHTTPRequestSelectConfiguration PhaseVersionGetParamsRulesetPhase = "http_request_select_configuration"
+ PhaseVersionGetParamsRulesetPhaseHTTPRequestTransform PhaseVersionGetParamsRulesetPhase = "http_request_transform"
+ PhaseVersionGetParamsRulesetPhaseHTTPResponseCompression PhaseVersionGetParamsRulesetPhase = "http_response_compression"
+ PhaseVersionGetParamsRulesetPhaseHTTPResponseFirewallManaged PhaseVersionGetParamsRulesetPhase = "http_response_firewall_managed"
+ PhaseVersionGetParamsRulesetPhaseHTTPResponseHeadersTransform PhaseVersionGetParamsRulesetPhase = "http_response_headers_transform"
+ PhaseVersionGetParamsRulesetPhaseMagicTransit PhaseVersionGetParamsRulesetPhase = "magic_transit"
+ PhaseVersionGetParamsRulesetPhaseMagicTransitIDsManaged PhaseVersionGetParamsRulesetPhase = "magic_transit_ids_managed"
+ PhaseVersionGetParamsRulesetPhaseMagicTransitManaged PhaseVersionGetParamsRulesetPhase = "magic_transit_managed"
+)
+
+// A response object.
+type PhaseVersionGetResponseEnvelope struct {
+ // A list of error messages.
+ Errors []PhaseVersionGetResponseEnvelopeErrors `json:"errors,required"`
+ // A list of warning messages.
+ Messages []PhaseVersionGetResponseEnvelopeMessages `json:"messages,required"`
+ // A result.
+ Result RulesetsRulesetResponse `json:"result,required"`
+ // Whether the API call was successful.
+ Success PhaseVersionGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON phaseVersionGetResponseEnvelopeJSON `json:"-"`
+}
+
+// phaseVersionGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [PhaseVersionGetResponseEnvelope]
+type phaseVersionGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PhaseVersionGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r phaseVersionGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+// A message.
+type PhaseVersionGetResponseEnvelopeErrors struct {
+ // A text description of this message.
+ Message string `json:"message,required"`
+ // A unique code for this message.
+ Code int64 `json:"code"`
+ // The source of this message.
+ Source PhaseVersionGetResponseEnvelopeErrorsSource `json:"source"`
+ JSON phaseVersionGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// phaseVersionGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [PhaseVersionGetResponseEnvelopeErrors]
+type phaseVersionGetResponseEnvelopeErrorsJSON struct {
+ Message apijson.Field
+ Code apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PhaseVersionGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r phaseVersionGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+// The source of this message.
+type PhaseVersionGetResponseEnvelopeErrorsSource struct {
+ // A JSON pointer to the field that is the source of the message.
+ Pointer string `json:"pointer,required"`
+ JSON phaseVersionGetResponseEnvelopeErrorsSourceJSON `json:"-"`
+}
+
+// phaseVersionGetResponseEnvelopeErrorsSourceJSON contains the JSON metadata for
+// the struct [PhaseVersionGetResponseEnvelopeErrorsSource]
+type phaseVersionGetResponseEnvelopeErrorsSourceJSON struct {
+ Pointer apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PhaseVersionGetResponseEnvelopeErrorsSource) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r phaseVersionGetResponseEnvelopeErrorsSourceJSON) RawJSON() string {
+ return r.raw
+}
+
+// A message.
+type PhaseVersionGetResponseEnvelopeMessages struct {
+ // A text description of this message.
+ Message string `json:"message,required"`
+ // A unique code for this message.
+ Code int64 `json:"code"`
+ // The source of this message.
+ Source PhaseVersionGetResponseEnvelopeMessagesSource `json:"source"`
+ JSON phaseVersionGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// phaseVersionGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [PhaseVersionGetResponseEnvelopeMessages]
+type phaseVersionGetResponseEnvelopeMessagesJSON struct {
+ Message apijson.Field
+ Code apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PhaseVersionGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r phaseVersionGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// The source of this message.
+type PhaseVersionGetResponseEnvelopeMessagesSource struct {
+ // A JSON pointer to the field that is the source of the message.
+ Pointer string `json:"pointer,required"`
+ JSON phaseVersionGetResponseEnvelopeMessagesSourceJSON `json:"-"`
+}
+
+// phaseVersionGetResponseEnvelopeMessagesSourceJSON contains the JSON metadata for
+// the struct [PhaseVersionGetResponseEnvelopeMessagesSource]
+type phaseVersionGetResponseEnvelopeMessagesSourceJSON struct {
+ Pointer apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PhaseVersionGetResponseEnvelopeMessagesSource) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r phaseVersionGetResponseEnvelopeMessagesSourceJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful.
+type PhaseVersionGetResponseEnvelopeSuccess bool
+
+const (
+ PhaseVersionGetResponseEnvelopeSuccessTrue PhaseVersionGetResponseEnvelopeSuccess = true
+)
diff --git a/rulesets/phaseversion_test.go b/rulesets/phaseversion_test.go
new file mode 100644
index 00000000000..c6f6a3edac2
--- /dev/null
+++ b/rulesets/phaseversion_test.go
@@ -0,0 +1,78 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package rulesets_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/rulesets"
+)
+
+func TestPhaseVersionListWithOptionalParams(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"),
+ )
+ _, err := client.Rulesets.Phases.Versions.List(
+ context.TODO(),
+ rulesets.PhaseVersionListParamsRulesetPhaseHTTPRequestFirewallCustom,
+ rulesets.PhaseVersionListParams{
+ AccountID: cloudflare.F("string"),
+ ZoneID: cloudflare.F("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())
+ }
+}
+
+func TestPhaseVersionGetWithOptionalParams(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"),
+ )
+ _, err := client.Rulesets.Phases.Versions.Get(
+ context.TODO(),
+ rulesets.PhaseVersionGetParamsRulesetPhaseHTTPRequestFirewallCustom,
+ "1",
+ rulesets.PhaseVersionGetParams{
+ AccountID: cloudflare.F("string"),
+ ZoneID: cloudflare.F("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/rulesets/rule.go b/rulesets/rule.go
new file mode 100644
index 00000000000..5aafc47ad3b
--- /dev/null
+++ b/rulesets/rule.go
@@ -0,0 +1,654 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package rulesets
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// RuleService contains methods and other services that help with interacting with
+// the cloudflare API. Note, unlike clients, this service does not read variables
+// from the environment automatically. You should not instantiate this service
+// directly, and instead use the [NewRuleService] method instead.
+type RuleService struct {
+ Options []option.RequestOption
+}
+
+// NewRuleService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewRuleService(opts ...option.RequestOption) (r *RuleService) {
+ r = &RuleService{}
+ r.Options = opts
+ return
+}
+
+// Adds a new rule to an account or zone ruleset. The rule will be added to the end
+// of the existing list of rules in the ruleset by default.
+func (r *RuleService) New(ctx context.Context, rulesetID string, params RuleNewParams, opts ...option.RequestOption) (res *RulesetsRulesetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RuleNewResponseEnvelope
+ var accountOrZone string
+ var accountOrZoneID param.Field[string]
+ if params.AccountID.Present {
+ accountOrZone = "accounts"
+ accountOrZoneID = params.AccountID
+ } else {
+ accountOrZone = "zones"
+ accountOrZoneID = params.ZoneID
+ }
+ path := fmt.Sprintf("%s/%s/rulesets/%s/rules", accountOrZone, accountOrZoneID, rulesetID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Deletes an existing rule from an account or zone ruleset.
+func (r *RuleService) Delete(ctx context.Context, rulesetID string, ruleID string, body RuleDeleteParams, opts ...option.RequestOption) (res *RulesetsRulesetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RuleDeleteResponseEnvelope
+ var accountOrZone string
+ var accountOrZoneID param.Field[string]
+ if body.AccountID.Present {
+ accountOrZone = "accounts"
+ accountOrZoneID = body.AccountID
+ } else {
+ accountOrZone = "zones"
+ accountOrZoneID = body.ZoneID
+ }
+ path := fmt.Sprintf("%s/%s/rulesets/%s/rules/%s", accountOrZone, accountOrZoneID, rulesetID, ruleID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Updates an existing rule in an account ruleset.
+func (r *RuleService) Edit(ctx context.Context, rulesetID string, ruleID string, params RuleEditParams, opts ...option.RequestOption) (res *RulesetsRulesetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RuleEditResponseEnvelope
+ var accountOrZone string
+ var accountOrZoneID param.Field[string]
+ if params.AccountID.Present {
+ accountOrZone = "accounts"
+ accountOrZoneID = params.AccountID
+ } else {
+ accountOrZone = "zones"
+ accountOrZoneID = params.ZoneID
+ }
+ path := fmt.Sprintf("%s/%s/rulesets/%s/rules/%s", accountOrZone, accountOrZoneID, rulesetID, ruleID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type RuleNewParams struct {
+ // The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+ AccountID param.Field[string] `path:"account_id"`
+ // The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+ ZoneID param.Field[string] `path:"zone_id"`
+ // An object configuring where the rule will be placed.
+ Position param.Field[RuleNewParamsPosition] `json:"position"`
+}
+
+func (r RuleNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// An object configuring where the rule will be placed.
+//
+// Satisfied by [rulesets.RuleNewParamsPositionBeforePosition],
+// [rulesets.RuleNewParamsPositionAfterPosition],
+// [rulesets.RuleNewParamsPositionIndexPosition].
+type RuleNewParamsPosition interface {
+ implementsRulesetsRuleNewParamsPosition()
+}
+
+// An object configuring where the rule will be placed.
+type RuleNewParamsPositionBeforePosition struct {
+ // The ID of another rule to place the rule before. An empty value causes the rule
+ // to be placed at the top.
+ Before param.Field[string] `json:"before"`
+}
+
+func (r RuleNewParamsPositionBeforePosition) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+func (r RuleNewParamsPositionBeforePosition) implementsRulesetsRuleNewParamsPosition() {}
+
+// An object configuring where the rule will be placed.
+type RuleNewParamsPositionAfterPosition struct {
+ // The ID of another rule to place the rule after. An empty value causes the rule
+ // to be placed at the bottom.
+ After param.Field[string] `json:"after"`
+}
+
+func (r RuleNewParamsPositionAfterPosition) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+func (r RuleNewParamsPositionAfterPosition) implementsRulesetsRuleNewParamsPosition() {}
+
+// An object configuring where the rule will be placed.
+type RuleNewParamsPositionIndexPosition struct {
+ // An index at which to place the rule, where index 1 is the first rule.
+ Index param.Field[float64] `json:"index"`
+}
+
+func (r RuleNewParamsPositionIndexPosition) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+func (r RuleNewParamsPositionIndexPosition) implementsRulesetsRuleNewParamsPosition() {}
+
+// A response object.
+type RuleNewResponseEnvelope struct {
+ // A list of error messages.
+ Errors []RuleNewResponseEnvelopeErrors `json:"errors,required"`
+ // A list of warning messages.
+ Messages []RuleNewResponseEnvelopeMessages `json:"messages,required"`
+ // A result.
+ Result RulesetsRulesetResponse `json:"result,required"`
+ // Whether the API call was successful.
+ Success RuleNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON ruleNewResponseEnvelopeJSON `json:"-"`
+}
+
+// ruleNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [RuleNewResponseEnvelope]
+type ruleNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RuleNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ruleNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+// A message.
+type RuleNewResponseEnvelopeErrors struct {
+ // A text description of this message.
+ Message string `json:"message,required"`
+ // A unique code for this message.
+ Code int64 `json:"code"`
+ // The source of this message.
+ Source RuleNewResponseEnvelopeErrorsSource `json:"source"`
+ JSON ruleNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// ruleNewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [RuleNewResponseEnvelopeErrors]
+type ruleNewResponseEnvelopeErrorsJSON struct {
+ Message apijson.Field
+ Code apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RuleNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ruleNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+// The source of this message.
+type RuleNewResponseEnvelopeErrorsSource struct {
+ // A JSON pointer to the field that is the source of the message.
+ Pointer string `json:"pointer,required"`
+ JSON ruleNewResponseEnvelopeErrorsSourceJSON `json:"-"`
+}
+
+// ruleNewResponseEnvelopeErrorsSourceJSON contains the JSON metadata for the
+// struct [RuleNewResponseEnvelopeErrorsSource]
+type ruleNewResponseEnvelopeErrorsSourceJSON struct {
+ Pointer apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RuleNewResponseEnvelopeErrorsSource) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ruleNewResponseEnvelopeErrorsSourceJSON) RawJSON() string {
+ return r.raw
+}
+
+// A message.
+type RuleNewResponseEnvelopeMessages struct {
+ // A text description of this message.
+ Message string `json:"message,required"`
+ // A unique code for this message.
+ Code int64 `json:"code"`
+ // The source of this message.
+ Source RuleNewResponseEnvelopeMessagesSource `json:"source"`
+ JSON ruleNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// ruleNewResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [RuleNewResponseEnvelopeMessages]
+type ruleNewResponseEnvelopeMessagesJSON struct {
+ Message apijson.Field
+ Code apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RuleNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ruleNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// The source of this message.
+type RuleNewResponseEnvelopeMessagesSource struct {
+ // A JSON pointer to the field that is the source of the message.
+ Pointer string `json:"pointer,required"`
+ JSON ruleNewResponseEnvelopeMessagesSourceJSON `json:"-"`
+}
+
+// ruleNewResponseEnvelopeMessagesSourceJSON contains the JSON metadata for the
+// struct [RuleNewResponseEnvelopeMessagesSource]
+type ruleNewResponseEnvelopeMessagesSourceJSON struct {
+ Pointer apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RuleNewResponseEnvelopeMessagesSource) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ruleNewResponseEnvelopeMessagesSourceJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful.
+type RuleNewResponseEnvelopeSuccess bool
+
+const (
+ RuleNewResponseEnvelopeSuccessTrue RuleNewResponseEnvelopeSuccess = true
+)
+
+type RuleDeleteParams struct {
+ // The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+ AccountID param.Field[string] `path:"account_id"`
+ // The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+ ZoneID param.Field[string] `path:"zone_id"`
+}
+
+// A response object.
+type RuleDeleteResponseEnvelope struct {
+ // A list of error messages.
+ Errors []RuleDeleteResponseEnvelopeErrors `json:"errors,required"`
+ // A list of warning messages.
+ Messages []RuleDeleteResponseEnvelopeMessages `json:"messages,required"`
+ // A result.
+ Result RulesetsRulesetResponse `json:"result,required"`
+ // Whether the API call was successful.
+ Success RuleDeleteResponseEnvelopeSuccess `json:"success,required"`
+ JSON ruleDeleteResponseEnvelopeJSON `json:"-"`
+}
+
+// ruleDeleteResponseEnvelopeJSON contains the JSON metadata for the struct
+// [RuleDeleteResponseEnvelope]
+type ruleDeleteResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RuleDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ruleDeleteResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+// A message.
+type RuleDeleteResponseEnvelopeErrors struct {
+ // A text description of this message.
+ Message string `json:"message,required"`
+ // A unique code for this message.
+ Code int64 `json:"code"`
+ // The source of this message.
+ Source RuleDeleteResponseEnvelopeErrorsSource `json:"source"`
+ JSON ruleDeleteResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// ruleDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [RuleDeleteResponseEnvelopeErrors]
+type ruleDeleteResponseEnvelopeErrorsJSON struct {
+ Message apijson.Field
+ Code apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RuleDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ruleDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+// The source of this message.
+type RuleDeleteResponseEnvelopeErrorsSource struct {
+ // A JSON pointer to the field that is the source of the message.
+ Pointer string `json:"pointer,required"`
+ JSON ruleDeleteResponseEnvelopeErrorsSourceJSON `json:"-"`
+}
+
+// ruleDeleteResponseEnvelopeErrorsSourceJSON contains the JSON metadata for the
+// struct [RuleDeleteResponseEnvelopeErrorsSource]
+type ruleDeleteResponseEnvelopeErrorsSourceJSON struct {
+ Pointer apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RuleDeleteResponseEnvelopeErrorsSource) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ruleDeleteResponseEnvelopeErrorsSourceJSON) RawJSON() string {
+ return r.raw
+}
+
+// A message.
+type RuleDeleteResponseEnvelopeMessages struct {
+ // A text description of this message.
+ Message string `json:"message,required"`
+ // A unique code for this message.
+ Code int64 `json:"code"`
+ // The source of this message.
+ Source RuleDeleteResponseEnvelopeMessagesSource `json:"source"`
+ JSON ruleDeleteResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// ruleDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [RuleDeleteResponseEnvelopeMessages]
+type ruleDeleteResponseEnvelopeMessagesJSON struct {
+ Message apijson.Field
+ Code apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RuleDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ruleDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// The source of this message.
+type RuleDeleteResponseEnvelopeMessagesSource struct {
+ // A JSON pointer to the field that is the source of the message.
+ Pointer string `json:"pointer,required"`
+ JSON ruleDeleteResponseEnvelopeMessagesSourceJSON `json:"-"`
+}
+
+// ruleDeleteResponseEnvelopeMessagesSourceJSON contains the JSON metadata for the
+// struct [RuleDeleteResponseEnvelopeMessagesSource]
+type ruleDeleteResponseEnvelopeMessagesSourceJSON struct {
+ Pointer apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RuleDeleteResponseEnvelopeMessagesSource) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ruleDeleteResponseEnvelopeMessagesSourceJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful.
+type RuleDeleteResponseEnvelopeSuccess bool
+
+const (
+ RuleDeleteResponseEnvelopeSuccessTrue RuleDeleteResponseEnvelopeSuccess = true
+)
+
+type RuleEditParams struct {
+ // The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+ AccountID param.Field[string] `path:"account_id"`
+ // The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+ ZoneID param.Field[string] `path:"zone_id"`
+ // An object configuring where the rule will be placed.
+ Position param.Field[RuleEditParamsPosition] `json:"position"`
+}
+
+func (r RuleEditParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// An object configuring where the rule will be placed.
+//
+// Satisfied by [rulesets.RuleEditParamsPositionBeforePosition],
+// [rulesets.RuleEditParamsPositionAfterPosition],
+// [rulesets.RuleEditParamsPositionIndexPosition].
+type RuleEditParamsPosition interface {
+ implementsRulesetsRuleEditParamsPosition()
+}
+
+// An object configuring where the rule will be placed.
+type RuleEditParamsPositionBeforePosition struct {
+ // The ID of another rule to place the rule before. An empty value causes the rule
+ // to be placed at the top.
+ Before param.Field[string] `json:"before"`
+}
+
+func (r RuleEditParamsPositionBeforePosition) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+func (r RuleEditParamsPositionBeforePosition) implementsRulesetsRuleEditParamsPosition() {}
+
+// An object configuring where the rule will be placed.
+type RuleEditParamsPositionAfterPosition struct {
+ // The ID of another rule to place the rule after. An empty value causes the rule
+ // to be placed at the bottom.
+ After param.Field[string] `json:"after"`
+}
+
+func (r RuleEditParamsPositionAfterPosition) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+func (r RuleEditParamsPositionAfterPosition) implementsRulesetsRuleEditParamsPosition() {}
+
+// An object configuring where the rule will be placed.
+type RuleEditParamsPositionIndexPosition struct {
+ // An index at which to place the rule, where index 1 is the first rule.
+ Index param.Field[float64] `json:"index"`
+}
+
+func (r RuleEditParamsPositionIndexPosition) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+func (r RuleEditParamsPositionIndexPosition) implementsRulesetsRuleEditParamsPosition() {}
+
+// A response object.
+type RuleEditResponseEnvelope struct {
+ // A list of error messages.
+ Errors []RuleEditResponseEnvelopeErrors `json:"errors,required"`
+ // A list of warning messages.
+ Messages []RuleEditResponseEnvelopeMessages `json:"messages,required"`
+ // A result.
+ Result RulesetsRulesetResponse `json:"result,required"`
+ // Whether the API call was successful.
+ Success RuleEditResponseEnvelopeSuccess `json:"success,required"`
+ JSON ruleEditResponseEnvelopeJSON `json:"-"`
+}
+
+// ruleEditResponseEnvelopeJSON contains the JSON metadata for the struct
+// [RuleEditResponseEnvelope]
+type ruleEditResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RuleEditResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ruleEditResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+// A message.
+type RuleEditResponseEnvelopeErrors struct {
+ // A text description of this message.
+ Message string `json:"message,required"`
+ // A unique code for this message.
+ Code int64 `json:"code"`
+ // The source of this message.
+ Source RuleEditResponseEnvelopeErrorsSource `json:"source"`
+ JSON ruleEditResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// ruleEditResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [RuleEditResponseEnvelopeErrors]
+type ruleEditResponseEnvelopeErrorsJSON struct {
+ Message apijson.Field
+ Code apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RuleEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ruleEditResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+// The source of this message.
+type RuleEditResponseEnvelopeErrorsSource struct {
+ // A JSON pointer to the field that is the source of the message.
+ Pointer string `json:"pointer,required"`
+ JSON ruleEditResponseEnvelopeErrorsSourceJSON `json:"-"`
+}
+
+// ruleEditResponseEnvelopeErrorsSourceJSON contains the JSON metadata for the
+// struct [RuleEditResponseEnvelopeErrorsSource]
+type ruleEditResponseEnvelopeErrorsSourceJSON struct {
+ Pointer apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RuleEditResponseEnvelopeErrorsSource) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ruleEditResponseEnvelopeErrorsSourceJSON) RawJSON() string {
+ return r.raw
+}
+
+// A message.
+type RuleEditResponseEnvelopeMessages struct {
+ // A text description of this message.
+ Message string `json:"message,required"`
+ // A unique code for this message.
+ Code int64 `json:"code"`
+ // The source of this message.
+ Source RuleEditResponseEnvelopeMessagesSource `json:"source"`
+ JSON ruleEditResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// ruleEditResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [RuleEditResponseEnvelopeMessages]
+type ruleEditResponseEnvelopeMessagesJSON struct {
+ Message apijson.Field
+ Code apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RuleEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ruleEditResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// The source of this message.
+type RuleEditResponseEnvelopeMessagesSource struct {
+ // A JSON pointer to the field that is the source of the message.
+ Pointer string `json:"pointer,required"`
+ JSON ruleEditResponseEnvelopeMessagesSourceJSON `json:"-"`
+}
+
+// ruleEditResponseEnvelopeMessagesSourceJSON contains the JSON metadata for the
+// struct [RuleEditResponseEnvelopeMessagesSource]
+type ruleEditResponseEnvelopeMessagesSourceJSON struct {
+ Pointer apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RuleEditResponseEnvelopeMessagesSource) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ruleEditResponseEnvelopeMessagesSourceJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful.
+type RuleEditResponseEnvelopeSuccess bool
+
+const (
+ RuleEditResponseEnvelopeSuccessTrue RuleEditResponseEnvelopeSuccess = true
+)
diff --git a/rulesets/rule_test.go b/rulesets/rule_test.go
new file mode 100644
index 00000000000..ce85a188cd2
--- /dev/null
+++ b/rulesets/rule_test.go
@@ -0,0 +1,116 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package rulesets_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/rulesets"
+)
+
+func TestRuleNewWithOptionalParams(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"),
+ )
+ _, err := client.Rulesets.Rules.New(
+ context.TODO(),
+ "2f2feab2026849078ba485f918791bdc",
+ rulesets.RuleNewParams{
+ AccountID: cloudflare.F("string"),
+ ZoneID: cloudflare.F("string"),
+ Position: cloudflare.F[rulesets.RuleNewParamsPosition](rulesets.RuleNewParamsPositionBeforePosition(rulesets.RuleNewParamsPositionBeforePosition{
+ Before: cloudflare.F("da5e8e506c8e7877fe06cdf4c41add54"),
+ })),
+ },
+ )
+ 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())
+ }
+}
+
+func TestRuleDeleteWithOptionalParams(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"),
+ )
+ _, err := client.Rulesets.Rules.Delete(
+ context.TODO(),
+ "2f2feab2026849078ba485f918791bdc",
+ "3a03d665bac047339bb530ecb439a90d",
+ rulesets.RuleDeleteParams{
+ AccountID: cloudflare.F("string"),
+ ZoneID: cloudflare.F("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())
+ }
+}
+
+func TestRuleEditWithOptionalParams(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"),
+ )
+ _, err := client.Rulesets.Rules.Edit(
+ context.TODO(),
+ "2f2feab2026849078ba485f918791bdc",
+ "3a03d665bac047339bb530ecb439a90d",
+ rulesets.RuleEditParams{
+ AccountID: cloudflare.F("string"),
+ ZoneID: cloudflare.F("string"),
+ Position: cloudflare.F[rulesets.RuleEditParamsPosition](rulesets.RuleEditParamsPositionBeforePosition(rulesets.RuleEditParamsPositionBeforePosition{
+ Before: cloudflare.F("da5e8e506c8e7877fe06cdf4c41add54"),
+ })),
+ },
+ )
+ 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/rulesets/ruleset.go b/rulesets/ruleset.go
new file mode 100644
index 00000000000..a68b3ec3c43
--- /dev/null
+++ b/rulesets/ruleset.go
@@ -0,0 +1,2505 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package rulesets
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "reflect"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/tidwall/gjson"
+)
+
+// RulesetService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewRulesetService] method instead.
+type RulesetService struct {
+ Options []option.RequestOption
+ Phases *PhaseService
+ Rules *RuleService
+ Versions *VersionService
+}
+
+// NewRulesetService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewRulesetService(opts ...option.RequestOption) (r *RulesetService) {
+ r = &RulesetService{}
+ r.Options = opts
+ r.Phases = NewPhaseService(opts...)
+ r.Rules = NewRuleService(opts...)
+ r.Versions = NewVersionService(opts...)
+ return
+}
+
+// Creates a ruleset.
+func (r *RulesetService) New(ctx context.Context, params RulesetNewParams, opts ...option.RequestOption) (res *RulesetsRulesetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RulesetNewResponseEnvelope
+ var accountOrZone string
+ var accountOrZoneID param.Field[string]
+ if params.AccountID.Present {
+ accountOrZone = "accounts"
+ accountOrZoneID = params.AccountID
+ } else {
+ accountOrZone = "zones"
+ accountOrZoneID = params.ZoneID
+ }
+ path := fmt.Sprintf("%s/%s/rulesets", accountOrZone, accountOrZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Updates an account or zone ruleset, creating a new version.
+func (r *RulesetService) Update(ctx context.Context, rulesetID string, params RulesetUpdateParams, opts ...option.RequestOption) (res *RulesetsRulesetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RulesetUpdateResponseEnvelope
+ var accountOrZone string
+ var accountOrZoneID param.Field[string]
+ if params.AccountID.Present {
+ accountOrZone = "accounts"
+ accountOrZoneID = params.AccountID
+ } else {
+ accountOrZone = "zones"
+ accountOrZoneID = params.ZoneID
+ }
+ path := fmt.Sprintf("%s/%s/rulesets/%s", accountOrZone, accountOrZoneID, rulesetID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Fetches all rulesets.
+func (r *RulesetService) List(ctx context.Context, query RulesetListParams, opts ...option.RequestOption) (res *RulesetsRulesetsResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RulesetListResponseEnvelope
+ var accountOrZone string
+ var accountOrZoneID param.Field[string]
+ if query.AccountID.Present {
+ accountOrZone = "accounts"
+ accountOrZoneID = query.AccountID
+ } else {
+ accountOrZone = "zones"
+ accountOrZoneID = query.ZoneID
+ }
+ path := fmt.Sprintf("%s/%s/rulesets", accountOrZone, accountOrZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Deletes all versions of an existing account or zone ruleset.
+func (r *RulesetService) Delete(ctx context.Context, rulesetID string, body RulesetDeleteParams, opts ...option.RequestOption) (err error) {
+ opts = append(r.Options[:], opts...)
+ opts = append([]option.RequestOption{option.WithHeader("Accept", "")}, opts...)
+ var accountOrZone string
+ var accountOrZoneID param.Field[string]
+ if body.AccountID.Present {
+ accountOrZone = "accounts"
+ accountOrZoneID = body.AccountID
+ } else {
+ accountOrZone = "zones"
+ accountOrZoneID = body.ZoneID
+ }
+ path := fmt.Sprintf("%s/%s/rulesets/%s", accountOrZone, accountOrZoneID, rulesetID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, nil, opts...)
+ return
+}
+
+// Fetches the latest version of an account or zone ruleset.
+func (r *RulesetService) Get(ctx context.Context, rulesetID string, query RulesetGetParams, opts ...option.RequestOption) (res *RulesetsRulesetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RulesetGetResponseEnvelope
+ var accountOrZone string
+ var accountOrZoneID param.Field[string]
+ if query.AccountID.Present {
+ accountOrZone = "accounts"
+ accountOrZoneID = query.AccountID
+ } else {
+ accountOrZone = "zones"
+ accountOrZoneID = query.ZoneID
+ }
+ path := fmt.Sprintf("%s/%s/rulesets/%s", accountOrZone, accountOrZoneID, rulesetID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// A ruleset object.
+type RulesetsRulesetResponse struct {
+ // The unique ID of the ruleset.
+ ID string `json:"id,required"`
+ // The kind of the ruleset.
+ Kind RulesetsRulesetResponseKind `json:"kind,required"`
+ // The timestamp of when the ruleset was last modified.
+ LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
+ // The human-readable name of the ruleset.
+ Name string `json:"name,required"`
+ // The phase of the ruleset.
+ Phase RulesetsRulesetResponsePhase `json:"phase,required"`
+ // The list of rules in the ruleset.
+ Rules []RulesetsRulesetResponseRule `json:"rules,required"`
+ // The version of the ruleset.
+ Version string `json:"version,required"`
+ // An informative description of the ruleset.
+ Description string `json:"description"`
+ JSON rulesetsRulesetResponseJSON `json:"-"`
+}
+
+// rulesetsRulesetResponseJSON contains the JSON metadata for the struct
+// [RulesetsRulesetResponse]
+type rulesetsRulesetResponseJSON struct {
+ ID apijson.Field
+ Kind apijson.Field
+ LastUpdated apijson.Field
+ Name apijson.Field
+ Phase apijson.Field
+ Rules apijson.Field
+ Version apijson.Field
+ Description apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RulesetsRulesetResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r rulesetsRulesetResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+// The kind of the ruleset.
+type RulesetsRulesetResponseKind string
+
+const (
+ RulesetsRulesetResponseKindManaged RulesetsRulesetResponseKind = "managed"
+ RulesetsRulesetResponseKindCustom RulesetsRulesetResponseKind = "custom"
+ RulesetsRulesetResponseKindRoot RulesetsRulesetResponseKind = "root"
+ RulesetsRulesetResponseKindZone RulesetsRulesetResponseKind = "zone"
+)
+
+// The phase of the ruleset.
+type RulesetsRulesetResponsePhase string
+
+const (
+ RulesetsRulesetResponsePhaseDDOSL4 RulesetsRulesetResponsePhase = "ddos_l4"
+ RulesetsRulesetResponsePhaseDDOSL7 RulesetsRulesetResponsePhase = "ddos_l7"
+ RulesetsRulesetResponsePhaseHTTPConfigSettings RulesetsRulesetResponsePhase = "http_config_settings"
+ RulesetsRulesetResponsePhaseHTTPCustomErrors RulesetsRulesetResponsePhase = "http_custom_errors"
+ RulesetsRulesetResponsePhaseHTTPLogCustomFields RulesetsRulesetResponsePhase = "http_log_custom_fields"
+ RulesetsRulesetResponsePhaseHTTPRatelimit RulesetsRulesetResponsePhase = "http_ratelimit"
+ RulesetsRulesetResponsePhaseHTTPRequestCacheSettings RulesetsRulesetResponsePhase = "http_request_cache_settings"
+ RulesetsRulesetResponsePhaseHTTPRequestDynamicRedirect RulesetsRulesetResponsePhase = "http_request_dynamic_redirect"
+ RulesetsRulesetResponsePhaseHTTPRequestFirewallCustom RulesetsRulesetResponsePhase = "http_request_firewall_custom"
+ RulesetsRulesetResponsePhaseHTTPRequestFirewallManaged RulesetsRulesetResponsePhase = "http_request_firewall_managed"
+ RulesetsRulesetResponsePhaseHTTPRequestLateTransform RulesetsRulesetResponsePhase = "http_request_late_transform"
+ RulesetsRulesetResponsePhaseHTTPRequestOrigin RulesetsRulesetResponsePhase = "http_request_origin"
+ RulesetsRulesetResponsePhaseHTTPRequestRedirect RulesetsRulesetResponsePhase = "http_request_redirect"
+ RulesetsRulesetResponsePhaseHTTPRequestSanitize RulesetsRulesetResponsePhase = "http_request_sanitize"
+ RulesetsRulesetResponsePhaseHTTPRequestSbfm RulesetsRulesetResponsePhase = "http_request_sbfm"
+ RulesetsRulesetResponsePhaseHTTPRequestSelectConfiguration RulesetsRulesetResponsePhase = "http_request_select_configuration"
+ RulesetsRulesetResponsePhaseHTTPRequestTransform RulesetsRulesetResponsePhase = "http_request_transform"
+ RulesetsRulesetResponsePhaseHTTPResponseCompression RulesetsRulesetResponsePhase = "http_response_compression"
+ RulesetsRulesetResponsePhaseHTTPResponseFirewallManaged RulesetsRulesetResponsePhase = "http_response_firewall_managed"
+ RulesetsRulesetResponsePhaseHTTPResponseHeadersTransform RulesetsRulesetResponsePhase = "http_response_headers_transform"
+ RulesetsRulesetResponsePhaseMagicTransit RulesetsRulesetResponsePhase = "magic_transit"
+ RulesetsRulesetResponsePhaseMagicTransitIDsManaged RulesetsRulesetResponsePhase = "magic_transit_ids_managed"
+ RulesetsRulesetResponsePhaseMagicTransitManaged RulesetsRulesetResponsePhase = "magic_transit_managed"
+)
+
+// Union satisfied by [rulesets.RulesetsRulesetResponseRulesRulesetsBlockRule],
+// [rulesets.RulesetsRulesetResponseRulesRulesetsExecuteRule],
+// [rulesets.RulesetsRulesetResponseRulesRulesetsLogRule] or
+// [rulesets.RulesetsRulesetResponseRulesRulesetsSkipRule].
+type RulesetsRulesetResponseRule interface {
+ implementsRulesetsRulesetsRulesetResponseRule()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*RulesetsRulesetResponseRule)(nil)).Elem(),
+ "action",
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RulesetsRulesetResponseRulesRulesetsBlockRule{}),
+ DiscriminatorValue: "block",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RulesetsRulesetResponseRulesRulesetsExecuteRule{}),
+ DiscriminatorValue: "execute",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RulesetsRulesetResponseRulesRulesetsLogRule{}),
+ DiscriminatorValue: "log",
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(RulesetsRulesetResponseRulesRulesetsSkipRule{}),
+ DiscriminatorValue: "skip",
+ },
+ )
+}
+
+type RulesetsRulesetResponseRulesRulesetsBlockRule struct {
+ // The timestamp of when the rule was last modified.
+ LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
+ // The version of the rule.
+ Version string `json:"version,required"`
+ // The unique ID of the rule.
+ ID string `json:"id"`
+ // The action to perform when the rule matches.
+ Action RulesetsRulesetResponseRulesRulesetsBlockRuleAction `json:"action"`
+ // The parameters configuring the rule's action.
+ ActionParameters RulesetsRulesetResponseRulesRulesetsBlockRuleActionParameters `json:"action_parameters"`
+ // The categories of the rule.
+ Categories []string `json:"categories"`
+ // An informative description of the rule.
+ Description string `json:"description"`
+ // Whether the rule should be executed.
+ Enabled bool `json:"enabled"`
+ // The expression defining which traffic will match the rule.
+ Expression string `json:"expression"`
+ // An object configuring the rule's logging behavior.
+ Logging RulesetsRulesetResponseRulesRulesetsBlockRuleLogging `json:"logging"`
+ // The reference of the rule (the rule ID by default).
+ Ref string `json:"ref"`
+ JSON rulesetsRulesetResponseRulesRulesetsBlockRuleJSON `json:"-"`
+}
+
+// rulesetsRulesetResponseRulesRulesetsBlockRuleJSON contains the JSON metadata for
+// the struct [RulesetsRulesetResponseRulesRulesetsBlockRule]
+type rulesetsRulesetResponseRulesRulesetsBlockRuleJSON struct {
+ LastUpdated apijson.Field
+ Version apijson.Field
+ ID apijson.Field
+ Action apijson.Field
+ ActionParameters apijson.Field
+ Categories apijson.Field
+ Description apijson.Field
+ Enabled apijson.Field
+ Expression apijson.Field
+ Logging apijson.Field
+ Ref apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RulesetsRulesetResponseRulesRulesetsBlockRule) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r rulesetsRulesetResponseRulesRulesetsBlockRuleJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RulesetsRulesetResponseRulesRulesetsBlockRule) implementsRulesetsRulesetsRulesetResponseRule() {
+}
+
+// The action to perform when the rule matches.
+type RulesetsRulesetResponseRulesRulesetsBlockRuleAction string
+
+const (
+ RulesetsRulesetResponseRulesRulesetsBlockRuleActionBlock RulesetsRulesetResponseRulesRulesetsBlockRuleAction = "block"
+)
+
+// The parameters configuring the rule's action.
+type RulesetsRulesetResponseRulesRulesetsBlockRuleActionParameters struct {
+ // The response to show when the block is applied.
+ Response RulesetsRulesetResponseRulesRulesetsBlockRuleActionParametersResponse `json:"response"`
+ JSON rulesetsRulesetResponseRulesRulesetsBlockRuleActionParametersJSON `json:"-"`
+}
+
+// rulesetsRulesetResponseRulesRulesetsBlockRuleActionParametersJSON contains the
+// JSON metadata for the struct
+// [RulesetsRulesetResponseRulesRulesetsBlockRuleActionParameters]
+type rulesetsRulesetResponseRulesRulesetsBlockRuleActionParametersJSON struct {
+ Response apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RulesetsRulesetResponseRulesRulesetsBlockRuleActionParameters) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r rulesetsRulesetResponseRulesRulesetsBlockRuleActionParametersJSON) RawJSON() string {
+ return r.raw
+}
+
+// The response to show when the block is applied.
+type RulesetsRulesetResponseRulesRulesetsBlockRuleActionParametersResponse struct {
+ // The content to return.
+ Content string `json:"content,required"`
+ // The type of the content to return.
+ ContentType string `json:"content_type,required"`
+ // The status code to return.
+ StatusCode int64 `json:"status_code,required"`
+ JSON rulesetsRulesetResponseRulesRulesetsBlockRuleActionParametersResponseJSON `json:"-"`
+}
+
+// rulesetsRulesetResponseRulesRulesetsBlockRuleActionParametersResponseJSON
+// contains the JSON metadata for the struct
+// [RulesetsRulesetResponseRulesRulesetsBlockRuleActionParametersResponse]
+type rulesetsRulesetResponseRulesRulesetsBlockRuleActionParametersResponseJSON struct {
+ Content apijson.Field
+ ContentType apijson.Field
+ StatusCode apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RulesetsRulesetResponseRulesRulesetsBlockRuleActionParametersResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r rulesetsRulesetResponseRulesRulesetsBlockRuleActionParametersResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+// An object configuring the rule's logging behavior.
+type RulesetsRulesetResponseRulesRulesetsBlockRuleLogging struct {
+ // Whether to generate a log when the rule matches.
+ Enabled bool `json:"enabled,required"`
+ JSON rulesetsRulesetResponseRulesRulesetsBlockRuleLoggingJSON `json:"-"`
+}
+
+// rulesetsRulesetResponseRulesRulesetsBlockRuleLoggingJSON contains the JSON
+// metadata for the struct [RulesetsRulesetResponseRulesRulesetsBlockRuleLogging]
+type rulesetsRulesetResponseRulesRulesetsBlockRuleLoggingJSON struct {
+ Enabled apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RulesetsRulesetResponseRulesRulesetsBlockRuleLogging) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r rulesetsRulesetResponseRulesRulesetsBlockRuleLoggingJSON) RawJSON() string {
+ return r.raw
+}
+
+type RulesetsRulesetResponseRulesRulesetsExecuteRule struct {
+ // The timestamp of when the rule was last modified.
+ LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
+ // The version of the rule.
+ Version string `json:"version,required"`
+ // The unique ID of the rule.
+ ID string `json:"id"`
+ // The action to perform when the rule matches.
+ Action RulesetsRulesetResponseRulesRulesetsExecuteRuleAction `json:"action"`
+ // The parameters configuring the rule's action.
+ ActionParameters RulesetsRulesetResponseRulesRulesetsExecuteRuleActionParameters `json:"action_parameters"`
+ // The categories of the rule.
+ Categories []string `json:"categories"`
+ // An informative description of the rule.
+ Description string `json:"description"`
+ // Whether the rule should be executed.
+ Enabled bool `json:"enabled"`
+ // The expression defining which traffic will match the rule.
+ Expression string `json:"expression"`
+ // An object configuring the rule's logging behavior.
+ Logging RulesetsRulesetResponseRulesRulesetsExecuteRuleLogging `json:"logging"`
+ // The reference of the rule (the rule ID by default).
+ Ref string `json:"ref"`
+ JSON rulesetsRulesetResponseRulesRulesetsExecuteRuleJSON `json:"-"`
+}
+
+// rulesetsRulesetResponseRulesRulesetsExecuteRuleJSON contains the JSON metadata
+// for the struct [RulesetsRulesetResponseRulesRulesetsExecuteRule]
+type rulesetsRulesetResponseRulesRulesetsExecuteRuleJSON struct {
+ LastUpdated apijson.Field
+ Version apijson.Field
+ ID apijson.Field
+ Action apijson.Field
+ ActionParameters apijson.Field
+ Categories apijson.Field
+ Description apijson.Field
+ Enabled apijson.Field
+ Expression apijson.Field
+ Logging apijson.Field
+ Ref apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RulesetsRulesetResponseRulesRulesetsExecuteRule) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r rulesetsRulesetResponseRulesRulesetsExecuteRuleJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RulesetsRulesetResponseRulesRulesetsExecuteRule) implementsRulesetsRulesetsRulesetResponseRule() {
+}
+
+// The action to perform when the rule matches.
+type RulesetsRulesetResponseRulesRulesetsExecuteRuleAction string
+
+const (
+ RulesetsRulesetResponseRulesRulesetsExecuteRuleActionExecute RulesetsRulesetResponseRulesRulesetsExecuteRuleAction = "execute"
+)
+
+// The parameters configuring the rule's action.
+type RulesetsRulesetResponseRulesRulesetsExecuteRuleActionParameters struct {
+ // The ID of the ruleset to execute.
+ ID string `json:"id,required"`
+ // The configuration to use for matched data logging.
+ MatchedData RulesetsRulesetResponseRulesRulesetsExecuteRuleActionParametersMatchedData `json:"matched_data"`
+ // A set of overrides to apply to the target ruleset.
+ Overrides RulesetsRulesetResponseRulesRulesetsExecuteRuleActionParametersOverrides `json:"overrides"`
+ JSON rulesetsRulesetResponseRulesRulesetsExecuteRuleActionParametersJSON `json:"-"`
+}
+
+// rulesetsRulesetResponseRulesRulesetsExecuteRuleActionParametersJSON contains the
+// JSON metadata for the struct
+// [RulesetsRulesetResponseRulesRulesetsExecuteRuleActionParameters]
+type rulesetsRulesetResponseRulesRulesetsExecuteRuleActionParametersJSON struct {
+ ID apijson.Field
+ MatchedData apijson.Field
+ Overrides apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RulesetsRulesetResponseRulesRulesetsExecuteRuleActionParameters) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r rulesetsRulesetResponseRulesRulesetsExecuteRuleActionParametersJSON) RawJSON() string {
+ return r.raw
+}
+
+// The configuration to use for matched data logging.
+type RulesetsRulesetResponseRulesRulesetsExecuteRuleActionParametersMatchedData struct {
+ // The public key to encrypt matched data logs with.
+ PublicKey string `json:"public_key,required"`
+ JSON rulesetsRulesetResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON `json:"-"`
+}
+
+// rulesetsRulesetResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON
+// contains the JSON metadata for the struct
+// [RulesetsRulesetResponseRulesRulesetsExecuteRuleActionParametersMatchedData]
+type rulesetsRulesetResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON struct {
+ PublicKey apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RulesetsRulesetResponseRulesRulesetsExecuteRuleActionParametersMatchedData) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r rulesetsRulesetResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON) RawJSON() string {
+ return r.raw
+}
+
+// A set of overrides to apply to the target ruleset.
+type RulesetsRulesetResponseRulesRulesetsExecuteRuleActionParametersOverrides struct {
+ // An action to override all rules with. This option has lower precedence than rule
+ // and category overrides.
+ Action string `json:"action"`
+ // A list of category-level overrides. This option has the second-highest
+ // precedence after rule-level overrides.
+ Categories []RulesetsRulesetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory `json:"categories"`
+ // Whether to enable execution of all rules. This option has lower precedence than
+ // rule and category overrides.
+ Enabled bool `json:"enabled"`
+ // A list of rule-level overrides. This option has the highest precedence.
+ Rules []RulesetsRulesetResponseRulesRulesetsExecuteRuleActionParametersOverridesRule `json:"rules"`
+ // A sensitivity level to set for all rules. This option has lower precedence than
+ // rule and category overrides and is only applicable for DDoS phases.
+ SensitivityLevel RulesetsRulesetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel `json:"sensitivity_level"`
+ JSON rulesetsRulesetResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON `json:"-"`
+}
+
+// rulesetsRulesetResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON
+// contains the JSON metadata for the struct
+// [RulesetsRulesetResponseRulesRulesetsExecuteRuleActionParametersOverrides]
+type rulesetsRulesetResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON struct {
+ Action apijson.Field
+ Categories apijson.Field
+ Enabled apijson.Field
+ Rules apijson.Field
+ SensitivityLevel apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RulesetsRulesetResponseRulesRulesetsExecuteRuleActionParametersOverrides) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r rulesetsRulesetResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON) RawJSON() string {
+ return r.raw
+}
+
+// A category-level override
+type RulesetsRulesetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory struct {
+ // The name of the category to override.
+ Category string `json:"category,required"`
+ // The action to override rules in the category with.
+ Action string `json:"action"`
+ // Whether to enable execution of rules in the category.
+ Enabled bool `json:"enabled"`
+ // The sensitivity level to use for rules in the category.
+ SensitivityLevel RulesetsRulesetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel `json:"sensitivity_level"`
+ JSON rulesetsRulesetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON `json:"-"`
+}
+
+// rulesetsRulesetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON
+// contains the JSON metadata for the struct
+// [RulesetsRulesetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory]
+type rulesetsRulesetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON struct {
+ Category apijson.Field
+ Action apijson.Field
+ Enabled apijson.Field
+ SensitivityLevel apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RulesetsRulesetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r rulesetsRulesetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON) RawJSON() string {
+ return r.raw
+}
+
+// The sensitivity level to use for rules in the category.
+type RulesetsRulesetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel string
+
+const (
+ RulesetsRulesetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault RulesetsRulesetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "default"
+ RulesetsRulesetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium RulesetsRulesetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "medium"
+ RulesetsRulesetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow RulesetsRulesetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "low"
+ RulesetsRulesetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff RulesetsRulesetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "eoff"
+)
+
+// A rule-level override
+type RulesetsRulesetResponseRulesRulesetsExecuteRuleActionParametersOverridesRule struct {
+ // The ID of the rule to override.
+ ID string `json:"id,required"`
+ // The action to override the rule with.
+ Action string `json:"action"`
+ // Whether to enable execution of the rule.
+ Enabled bool `json:"enabled"`
+ // The score threshold to use for the rule.
+ ScoreThreshold int64 `json:"score_threshold"`
+ // The sensitivity level to use for the rule.
+ SensitivityLevel RulesetsRulesetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel `json:"sensitivity_level"`
+ JSON rulesetsRulesetResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON `json:"-"`
+}
+
+// rulesetsRulesetResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON
+// contains the JSON metadata for the struct
+// [RulesetsRulesetResponseRulesRulesetsExecuteRuleActionParametersOverridesRule]
+type rulesetsRulesetResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON struct {
+ ID apijson.Field
+ Action apijson.Field
+ Enabled apijson.Field
+ ScoreThreshold apijson.Field
+ SensitivityLevel apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RulesetsRulesetResponseRulesRulesetsExecuteRuleActionParametersOverridesRule) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r rulesetsRulesetResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON) RawJSON() string {
+ return r.raw
+}
+
+// The sensitivity level to use for the rule.
+type RulesetsRulesetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel string
+
+const (
+ RulesetsRulesetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault RulesetsRulesetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "default"
+ RulesetsRulesetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium RulesetsRulesetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "medium"
+ RulesetsRulesetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelLow RulesetsRulesetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "low"
+ RulesetsRulesetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff RulesetsRulesetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "eoff"
+)
+
+// A sensitivity level to set for all rules. This option has lower precedence than
+// rule and category overrides and is only applicable for DDoS phases.
+type RulesetsRulesetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel string
+
+const (
+ RulesetsRulesetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelDefault RulesetsRulesetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "default"
+ RulesetsRulesetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelMedium RulesetsRulesetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "medium"
+ RulesetsRulesetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelLow RulesetsRulesetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "low"
+ RulesetsRulesetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelEoff RulesetsRulesetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "eoff"
+)
+
+// An object configuring the rule's logging behavior.
+type RulesetsRulesetResponseRulesRulesetsExecuteRuleLogging struct {
+ // Whether to generate a log when the rule matches.
+ Enabled bool `json:"enabled,required"`
+ JSON rulesetsRulesetResponseRulesRulesetsExecuteRuleLoggingJSON `json:"-"`
+}
+
+// rulesetsRulesetResponseRulesRulesetsExecuteRuleLoggingJSON contains the JSON
+// metadata for the struct [RulesetsRulesetResponseRulesRulesetsExecuteRuleLogging]
+type rulesetsRulesetResponseRulesRulesetsExecuteRuleLoggingJSON struct {
+ Enabled apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RulesetsRulesetResponseRulesRulesetsExecuteRuleLogging) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r rulesetsRulesetResponseRulesRulesetsExecuteRuleLoggingJSON) RawJSON() string {
+ return r.raw
+}
+
+type RulesetsRulesetResponseRulesRulesetsLogRule struct {
+ // The timestamp of when the rule was last modified.
+ LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
+ // The version of the rule.
+ Version string `json:"version,required"`
+ // The unique ID of the rule.
+ ID string `json:"id"`
+ // The action to perform when the rule matches.
+ Action RulesetsRulesetResponseRulesRulesetsLogRuleAction `json:"action"`
+ // The parameters configuring the rule's action.
+ ActionParameters interface{} `json:"action_parameters"`
+ // The categories of the rule.
+ Categories []string `json:"categories"`
+ // An informative description of the rule.
+ Description string `json:"description"`
+ // Whether the rule should be executed.
+ Enabled bool `json:"enabled"`
+ // The expression defining which traffic will match the rule.
+ Expression string `json:"expression"`
+ // An object configuring the rule's logging behavior.
+ Logging RulesetsRulesetResponseRulesRulesetsLogRuleLogging `json:"logging"`
+ // The reference of the rule (the rule ID by default).
+ Ref string `json:"ref"`
+ JSON rulesetsRulesetResponseRulesRulesetsLogRuleJSON `json:"-"`
+}
+
+// rulesetsRulesetResponseRulesRulesetsLogRuleJSON contains the JSON metadata for
+// the struct [RulesetsRulesetResponseRulesRulesetsLogRule]
+type rulesetsRulesetResponseRulesRulesetsLogRuleJSON struct {
+ LastUpdated apijson.Field
+ Version apijson.Field
+ ID apijson.Field
+ Action apijson.Field
+ ActionParameters apijson.Field
+ Categories apijson.Field
+ Description apijson.Field
+ Enabled apijson.Field
+ Expression apijson.Field
+ Logging apijson.Field
+ Ref apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RulesetsRulesetResponseRulesRulesetsLogRule) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r rulesetsRulesetResponseRulesRulesetsLogRuleJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RulesetsRulesetResponseRulesRulesetsLogRule) implementsRulesetsRulesetsRulesetResponseRule() {
+}
+
+// The action to perform when the rule matches.
+type RulesetsRulesetResponseRulesRulesetsLogRuleAction string
+
+const (
+ RulesetsRulesetResponseRulesRulesetsLogRuleActionLog RulesetsRulesetResponseRulesRulesetsLogRuleAction = "log"
+)
+
+// An object configuring the rule's logging behavior.
+type RulesetsRulesetResponseRulesRulesetsLogRuleLogging struct {
+ // Whether to generate a log when the rule matches.
+ Enabled bool `json:"enabled,required"`
+ JSON rulesetsRulesetResponseRulesRulesetsLogRuleLoggingJSON `json:"-"`
+}
+
+// rulesetsRulesetResponseRulesRulesetsLogRuleLoggingJSON contains the JSON
+// metadata for the struct [RulesetsRulesetResponseRulesRulesetsLogRuleLogging]
+type rulesetsRulesetResponseRulesRulesetsLogRuleLoggingJSON struct {
+ Enabled apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RulesetsRulesetResponseRulesRulesetsLogRuleLogging) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r rulesetsRulesetResponseRulesRulesetsLogRuleLoggingJSON) RawJSON() string {
+ return r.raw
+}
+
+type RulesetsRulesetResponseRulesRulesetsSkipRule struct {
+ // The timestamp of when the rule was last modified.
+ LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
+ // The version of the rule.
+ Version string `json:"version,required"`
+ // The unique ID of the rule.
+ ID string `json:"id"`
+ // The action to perform when the rule matches.
+ Action RulesetsRulesetResponseRulesRulesetsSkipRuleAction `json:"action"`
+ // The parameters configuring the rule's action.
+ ActionParameters RulesetsRulesetResponseRulesRulesetsSkipRuleActionParameters `json:"action_parameters"`
+ // The categories of the rule.
+ Categories []string `json:"categories"`
+ // An informative description of the rule.
+ Description string `json:"description"`
+ // Whether the rule should be executed.
+ Enabled bool `json:"enabled"`
+ // The expression defining which traffic will match the rule.
+ Expression string `json:"expression"`
+ // An object configuring the rule's logging behavior.
+ Logging RulesetsRulesetResponseRulesRulesetsSkipRuleLogging `json:"logging"`
+ // The reference of the rule (the rule ID by default).
+ Ref string `json:"ref"`
+ JSON rulesetsRulesetResponseRulesRulesetsSkipRuleJSON `json:"-"`
+}
+
+// rulesetsRulesetResponseRulesRulesetsSkipRuleJSON contains the JSON metadata for
+// the struct [RulesetsRulesetResponseRulesRulesetsSkipRule]
+type rulesetsRulesetResponseRulesRulesetsSkipRuleJSON struct {
+ LastUpdated apijson.Field
+ Version apijson.Field
+ ID apijson.Field
+ Action apijson.Field
+ ActionParameters apijson.Field
+ Categories apijson.Field
+ Description apijson.Field
+ Enabled apijson.Field
+ Expression apijson.Field
+ Logging apijson.Field
+ Ref apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RulesetsRulesetResponseRulesRulesetsSkipRule) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r rulesetsRulesetResponseRulesRulesetsSkipRuleJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r RulesetsRulesetResponseRulesRulesetsSkipRule) implementsRulesetsRulesetsRulesetResponseRule() {
+}
+
+// The action to perform when the rule matches.
+type RulesetsRulesetResponseRulesRulesetsSkipRuleAction string
+
+const (
+ RulesetsRulesetResponseRulesRulesetsSkipRuleActionSkip RulesetsRulesetResponseRulesRulesetsSkipRuleAction = "skip"
+)
+
+// The parameters configuring the rule's action.
+type RulesetsRulesetResponseRulesRulesetsSkipRuleActionParameters struct {
+ // A list of phases to skip the execution of. This option is incompatible with the
+ // ruleset and rulesets options.
+ Phases []RulesetsRulesetResponseRulesRulesetsSkipRuleActionParametersPhase `json:"phases"`
+ // A list of legacy security products to skip the execution of.
+ Products []RulesetsRulesetResponseRulesRulesetsSkipRuleActionParametersProduct `json:"products"`
+ // A mapping of ruleset IDs to a list of rule IDs in that ruleset to skip the
+ // execution of. This option is incompatible with the ruleset option.
+ Rules map[string][]string `json:"rules"`
+ // A ruleset to skip the execution of. This option is incompatible with the
+ // rulesets, rules and phases options.
+ Ruleset RulesetsRulesetResponseRulesRulesetsSkipRuleActionParametersRuleset `json:"ruleset"`
+ // A list of ruleset IDs to skip the execution of. This option is incompatible with
+ // the ruleset and phases options.
+ Rulesets []string `json:"rulesets"`
+ JSON rulesetsRulesetResponseRulesRulesetsSkipRuleActionParametersJSON `json:"-"`
+}
+
+// rulesetsRulesetResponseRulesRulesetsSkipRuleActionParametersJSON contains the
+// JSON metadata for the struct
+// [RulesetsRulesetResponseRulesRulesetsSkipRuleActionParameters]
+type rulesetsRulesetResponseRulesRulesetsSkipRuleActionParametersJSON struct {
+ Phases apijson.Field
+ Products apijson.Field
+ Rules apijson.Field
+ Ruleset apijson.Field
+ Rulesets apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RulesetsRulesetResponseRulesRulesetsSkipRuleActionParameters) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r rulesetsRulesetResponseRulesRulesetsSkipRuleActionParametersJSON) RawJSON() string {
+ return r.raw
+}
+
+// A phase to skip the execution of.
+type RulesetsRulesetResponseRulesRulesetsSkipRuleActionParametersPhase string
+
+const (
+ RulesetsRulesetResponseRulesRulesetsSkipRuleActionParametersPhaseDDOSL4 RulesetsRulesetResponseRulesRulesetsSkipRuleActionParametersPhase = "ddos_l4"
+ RulesetsRulesetResponseRulesRulesetsSkipRuleActionParametersPhaseDDOSL7 RulesetsRulesetResponseRulesRulesetsSkipRuleActionParametersPhase = "ddos_l7"
+ RulesetsRulesetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPConfigSettings RulesetsRulesetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_config_settings"
+ RulesetsRulesetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPCustomErrors RulesetsRulesetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_custom_errors"
+ RulesetsRulesetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPLogCustomFields RulesetsRulesetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_log_custom_fields"
+ RulesetsRulesetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRatelimit RulesetsRulesetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_ratelimit"
+ RulesetsRulesetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestCacheSettings RulesetsRulesetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_cache_settings"
+ RulesetsRulesetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestDynamicRedirect RulesetsRulesetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_dynamic_redirect"
+ RulesetsRulesetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallCustom RulesetsRulesetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_custom"
+ RulesetsRulesetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallManaged RulesetsRulesetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_managed"
+ RulesetsRulesetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestLateTransform RulesetsRulesetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_late_transform"
+ RulesetsRulesetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestOrigin RulesetsRulesetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_origin"
+ RulesetsRulesetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestRedirect RulesetsRulesetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_redirect"
+ RulesetsRulesetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSanitize RulesetsRulesetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_sanitize"
+ RulesetsRulesetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSbfm RulesetsRulesetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_sbfm"
+ RulesetsRulesetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSelectConfiguration RulesetsRulesetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_select_configuration"
+ RulesetsRulesetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestTransform RulesetsRulesetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_transform"
+ RulesetsRulesetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseCompression RulesetsRulesetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_compression"
+ RulesetsRulesetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseFirewallManaged RulesetsRulesetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_firewall_managed"
+ RulesetsRulesetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseHeadersTransform RulesetsRulesetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_headers_transform"
+ RulesetsRulesetResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransit RulesetsRulesetResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit"
+ RulesetsRulesetResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitIDsManaged RulesetsRulesetResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_ids_managed"
+ RulesetsRulesetResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitManaged RulesetsRulesetResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_managed"
+)
+
+// The name of a legacy security product to skip the execution of.
+type RulesetsRulesetResponseRulesRulesetsSkipRuleActionParametersProduct string
+
+const (
+ RulesetsRulesetResponseRulesRulesetsSkipRuleActionParametersProductBic RulesetsRulesetResponseRulesRulesetsSkipRuleActionParametersProduct = "bic"
+ RulesetsRulesetResponseRulesRulesetsSkipRuleActionParametersProductHot RulesetsRulesetResponseRulesRulesetsSkipRuleActionParametersProduct = "hot"
+ RulesetsRulesetResponseRulesRulesetsSkipRuleActionParametersProductRateLimit RulesetsRulesetResponseRulesRulesetsSkipRuleActionParametersProduct = "rateLimit"
+ RulesetsRulesetResponseRulesRulesetsSkipRuleActionParametersProductSecurityLevel RulesetsRulesetResponseRulesRulesetsSkipRuleActionParametersProduct = "securityLevel"
+ RulesetsRulesetResponseRulesRulesetsSkipRuleActionParametersProductUABlock RulesetsRulesetResponseRulesRulesetsSkipRuleActionParametersProduct = "uaBlock"
+ RulesetsRulesetResponseRulesRulesetsSkipRuleActionParametersProductWAF RulesetsRulesetResponseRulesRulesetsSkipRuleActionParametersProduct = "waf"
+ RulesetsRulesetResponseRulesRulesetsSkipRuleActionParametersProductZoneLockdown RulesetsRulesetResponseRulesRulesetsSkipRuleActionParametersProduct = "zoneLockdown"
+)
+
+// A ruleset to skip the execution of. This option is incompatible with the
+// rulesets, rules and phases options.
+type RulesetsRulesetResponseRulesRulesetsSkipRuleActionParametersRuleset string
+
+const (
+ RulesetsRulesetResponseRulesRulesetsSkipRuleActionParametersRulesetCurrent RulesetsRulesetResponseRulesRulesetsSkipRuleActionParametersRuleset = "current"
+)
+
+// An object configuring the rule's logging behavior.
+type RulesetsRulesetResponseRulesRulesetsSkipRuleLogging struct {
+ // Whether to generate a log when the rule matches.
+ Enabled bool `json:"enabled,required"`
+ JSON rulesetsRulesetResponseRulesRulesetsSkipRuleLoggingJSON `json:"-"`
+}
+
+// rulesetsRulesetResponseRulesRulesetsSkipRuleLoggingJSON contains the JSON
+// metadata for the struct [RulesetsRulesetResponseRulesRulesetsSkipRuleLogging]
+type rulesetsRulesetResponseRulesRulesetsSkipRuleLoggingJSON struct {
+ Enabled apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RulesetsRulesetResponseRulesRulesetsSkipRuleLogging) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r rulesetsRulesetResponseRulesRulesetsSkipRuleLoggingJSON) RawJSON() string {
+ return r.raw
+}
+
+type RulesetsRulesetsResponse []RulesetsRulesetsResponse
+
+// A ruleset object.
+type RulesetListResponse struct {
+ // The kind of the ruleset.
+ Kind RulesetListResponseKind `json:"kind,required"`
+ // The human-readable name of the ruleset.
+ Name string `json:"name,required"`
+ // The phase of the ruleset.
+ Phase RulesetListResponsePhase `json:"phase,required"`
+ // The unique ID of the ruleset.
+ ID string `json:"id"`
+ // An informative description of the ruleset.
+ Description string `json:"description"`
+ // The timestamp of when the ruleset was last modified.
+ LastUpdated time.Time `json:"last_updated" format:"date-time"`
+ // The version of the ruleset.
+ Version string `json:"version"`
+ JSON rulesetListResponseJSON `json:"-"`
+}
+
+// rulesetListResponseJSON contains the JSON metadata for the struct
+// [RulesetListResponse]
+type rulesetListResponseJSON struct {
+ Kind apijson.Field
+ Name apijson.Field
+ Phase apijson.Field
+ ID apijson.Field
+ Description apijson.Field
+ LastUpdated apijson.Field
+ Version apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RulesetListResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r rulesetListResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+// The kind of the ruleset.
+type RulesetListResponseKind string
+
+const (
+ RulesetListResponseKindManaged RulesetListResponseKind = "managed"
+ RulesetListResponseKindCustom RulesetListResponseKind = "custom"
+ RulesetListResponseKindRoot RulesetListResponseKind = "root"
+ RulesetListResponseKindZone RulesetListResponseKind = "zone"
+)
+
+// The phase of the ruleset.
+type RulesetListResponsePhase string
+
+const (
+ RulesetListResponsePhaseDDOSL4 RulesetListResponsePhase = "ddos_l4"
+ RulesetListResponsePhaseDDOSL7 RulesetListResponsePhase = "ddos_l7"
+ RulesetListResponsePhaseHTTPConfigSettings RulesetListResponsePhase = "http_config_settings"
+ RulesetListResponsePhaseHTTPCustomErrors RulesetListResponsePhase = "http_custom_errors"
+ RulesetListResponsePhaseHTTPLogCustomFields RulesetListResponsePhase = "http_log_custom_fields"
+ RulesetListResponsePhaseHTTPRatelimit RulesetListResponsePhase = "http_ratelimit"
+ RulesetListResponsePhaseHTTPRequestCacheSettings RulesetListResponsePhase = "http_request_cache_settings"
+ RulesetListResponsePhaseHTTPRequestDynamicRedirect RulesetListResponsePhase = "http_request_dynamic_redirect"
+ RulesetListResponsePhaseHTTPRequestFirewallCustom RulesetListResponsePhase = "http_request_firewall_custom"
+ RulesetListResponsePhaseHTTPRequestFirewallManaged RulesetListResponsePhase = "http_request_firewall_managed"
+ RulesetListResponsePhaseHTTPRequestLateTransform RulesetListResponsePhase = "http_request_late_transform"
+ RulesetListResponsePhaseHTTPRequestOrigin RulesetListResponsePhase = "http_request_origin"
+ RulesetListResponsePhaseHTTPRequestRedirect RulesetListResponsePhase = "http_request_redirect"
+ RulesetListResponsePhaseHTTPRequestSanitize RulesetListResponsePhase = "http_request_sanitize"
+ RulesetListResponsePhaseHTTPRequestSbfm RulesetListResponsePhase = "http_request_sbfm"
+ RulesetListResponsePhaseHTTPRequestSelectConfiguration RulesetListResponsePhase = "http_request_select_configuration"
+ RulesetListResponsePhaseHTTPRequestTransform RulesetListResponsePhase = "http_request_transform"
+ RulesetListResponsePhaseHTTPResponseCompression RulesetListResponsePhase = "http_response_compression"
+ RulesetListResponsePhaseHTTPResponseFirewallManaged RulesetListResponsePhase = "http_response_firewall_managed"
+ RulesetListResponsePhaseHTTPResponseHeadersTransform RulesetListResponsePhase = "http_response_headers_transform"
+ RulesetListResponsePhaseMagicTransit RulesetListResponsePhase = "magic_transit"
+ RulesetListResponsePhaseMagicTransitIDsManaged RulesetListResponsePhase = "magic_transit_ids_managed"
+ RulesetListResponsePhaseMagicTransitManaged RulesetListResponsePhase = "magic_transit_managed"
+)
+
+type RulesetNewParams struct {
+ // The kind of the ruleset.
+ Kind param.Field[RulesetNewParamsKind] `json:"kind,required"`
+ // The human-readable name of the ruleset.
+ Name param.Field[string] `json:"name,required"`
+ // The phase of the ruleset.
+ Phase param.Field[RulesetNewParamsPhase] `json:"phase,required"`
+ // The list of rules in the ruleset.
+ Rules param.Field[[]RulesetNewParamsRule] `json:"rules,required"`
+ // The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+ AccountID param.Field[string] `path:"account_id"`
+ // The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+ ZoneID param.Field[string] `path:"zone_id"`
+ // An informative description of the ruleset.
+ Description param.Field[string] `json:"description"`
+}
+
+func (r RulesetNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The kind of the ruleset.
+type RulesetNewParamsKind string
+
+const (
+ RulesetNewParamsKindManaged RulesetNewParamsKind = "managed"
+ RulesetNewParamsKindCustom RulesetNewParamsKind = "custom"
+ RulesetNewParamsKindRoot RulesetNewParamsKind = "root"
+ RulesetNewParamsKindZone RulesetNewParamsKind = "zone"
+)
+
+// The phase of the ruleset.
+type RulesetNewParamsPhase string
+
+const (
+ RulesetNewParamsPhaseDDOSL4 RulesetNewParamsPhase = "ddos_l4"
+ RulesetNewParamsPhaseDDOSL7 RulesetNewParamsPhase = "ddos_l7"
+ RulesetNewParamsPhaseHTTPConfigSettings RulesetNewParamsPhase = "http_config_settings"
+ RulesetNewParamsPhaseHTTPCustomErrors RulesetNewParamsPhase = "http_custom_errors"
+ RulesetNewParamsPhaseHTTPLogCustomFields RulesetNewParamsPhase = "http_log_custom_fields"
+ RulesetNewParamsPhaseHTTPRatelimit RulesetNewParamsPhase = "http_ratelimit"
+ RulesetNewParamsPhaseHTTPRequestCacheSettings RulesetNewParamsPhase = "http_request_cache_settings"
+ RulesetNewParamsPhaseHTTPRequestDynamicRedirect RulesetNewParamsPhase = "http_request_dynamic_redirect"
+ RulesetNewParamsPhaseHTTPRequestFirewallCustom RulesetNewParamsPhase = "http_request_firewall_custom"
+ RulesetNewParamsPhaseHTTPRequestFirewallManaged RulesetNewParamsPhase = "http_request_firewall_managed"
+ RulesetNewParamsPhaseHTTPRequestLateTransform RulesetNewParamsPhase = "http_request_late_transform"
+ RulesetNewParamsPhaseHTTPRequestOrigin RulesetNewParamsPhase = "http_request_origin"
+ RulesetNewParamsPhaseHTTPRequestRedirect RulesetNewParamsPhase = "http_request_redirect"
+ RulesetNewParamsPhaseHTTPRequestSanitize RulesetNewParamsPhase = "http_request_sanitize"
+ RulesetNewParamsPhaseHTTPRequestSbfm RulesetNewParamsPhase = "http_request_sbfm"
+ RulesetNewParamsPhaseHTTPRequestSelectConfiguration RulesetNewParamsPhase = "http_request_select_configuration"
+ RulesetNewParamsPhaseHTTPRequestTransform RulesetNewParamsPhase = "http_request_transform"
+ RulesetNewParamsPhaseHTTPResponseCompression RulesetNewParamsPhase = "http_response_compression"
+ RulesetNewParamsPhaseHTTPResponseFirewallManaged RulesetNewParamsPhase = "http_response_firewall_managed"
+ RulesetNewParamsPhaseHTTPResponseHeadersTransform RulesetNewParamsPhase = "http_response_headers_transform"
+ RulesetNewParamsPhaseMagicTransit RulesetNewParamsPhase = "magic_transit"
+ RulesetNewParamsPhaseMagicTransitIDsManaged RulesetNewParamsPhase = "magic_transit_ids_managed"
+ RulesetNewParamsPhaseMagicTransitManaged RulesetNewParamsPhase = "magic_transit_managed"
+)
+
+// Satisfied by [rulesets.RulesetNewParamsRulesRulesetsBlockRule],
+// [rulesets.RulesetNewParamsRulesRulesetsExecuteRule],
+// [rulesets.RulesetNewParamsRulesRulesetsLogRule],
+// [rulesets.RulesetNewParamsRulesRulesetsSkipRule].
+type RulesetNewParamsRule interface {
+ implementsRulesetsRulesetNewParamsRule()
+}
+
+type RulesetNewParamsRulesRulesetsBlockRule struct {
+ // The unique ID of the rule.
+ ID param.Field[string] `json:"id"`
+ // The action to perform when the rule matches.
+ Action param.Field[RulesetNewParamsRulesRulesetsBlockRuleAction] `json:"action"`
+ // The parameters configuring the rule's action.
+ ActionParameters param.Field[RulesetNewParamsRulesRulesetsBlockRuleActionParameters] `json:"action_parameters"`
+ // An informative description of the rule.
+ Description param.Field[string] `json:"description"`
+ // Whether the rule should be executed.
+ Enabled param.Field[bool] `json:"enabled"`
+ // The expression defining which traffic will match the rule.
+ Expression param.Field[string] `json:"expression"`
+ // An object configuring the rule's logging behavior.
+ Logging param.Field[RulesetNewParamsRulesRulesetsBlockRuleLogging] `json:"logging"`
+ // The reference of the rule (the rule ID by default).
+ Ref param.Field[string] `json:"ref"`
+}
+
+func (r RulesetNewParamsRulesRulesetsBlockRule) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+func (r RulesetNewParamsRulesRulesetsBlockRule) implementsRulesetsRulesetNewParamsRule() {}
+
+// The action to perform when the rule matches.
+type RulesetNewParamsRulesRulesetsBlockRuleAction string
+
+const (
+ RulesetNewParamsRulesRulesetsBlockRuleActionBlock RulesetNewParamsRulesRulesetsBlockRuleAction = "block"
+)
+
+// The parameters configuring the rule's action.
+type RulesetNewParamsRulesRulesetsBlockRuleActionParameters struct {
+ // The response to show when the block is applied.
+ Response param.Field[RulesetNewParamsRulesRulesetsBlockRuleActionParametersResponse] `json:"response"`
+}
+
+func (r RulesetNewParamsRulesRulesetsBlockRuleActionParameters) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The response to show when the block is applied.
+type RulesetNewParamsRulesRulesetsBlockRuleActionParametersResponse struct {
+ // The content to return.
+ Content param.Field[string] `json:"content,required"`
+ // The type of the content to return.
+ ContentType param.Field[string] `json:"content_type,required"`
+ // The status code to return.
+ StatusCode param.Field[int64] `json:"status_code,required"`
+}
+
+func (r RulesetNewParamsRulesRulesetsBlockRuleActionParametersResponse) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// An object configuring the rule's logging behavior.
+type RulesetNewParamsRulesRulesetsBlockRuleLogging struct {
+ // Whether to generate a log when the rule matches.
+ Enabled param.Field[bool] `json:"enabled,required"`
+}
+
+func (r RulesetNewParamsRulesRulesetsBlockRuleLogging) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type RulesetNewParamsRulesRulesetsExecuteRule struct {
+ // The unique ID of the rule.
+ ID param.Field[string] `json:"id"`
+ // The action to perform when the rule matches.
+ Action param.Field[RulesetNewParamsRulesRulesetsExecuteRuleAction] `json:"action"`
+ // The parameters configuring the rule's action.
+ ActionParameters param.Field[RulesetNewParamsRulesRulesetsExecuteRuleActionParameters] `json:"action_parameters"`
+ // An informative description of the rule.
+ Description param.Field[string] `json:"description"`
+ // Whether the rule should be executed.
+ Enabled param.Field[bool] `json:"enabled"`
+ // The expression defining which traffic will match the rule.
+ Expression param.Field[string] `json:"expression"`
+ // An object configuring the rule's logging behavior.
+ Logging param.Field[RulesetNewParamsRulesRulesetsExecuteRuleLogging] `json:"logging"`
+ // The reference of the rule (the rule ID by default).
+ Ref param.Field[string] `json:"ref"`
+}
+
+func (r RulesetNewParamsRulesRulesetsExecuteRule) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+func (r RulesetNewParamsRulesRulesetsExecuteRule) implementsRulesetsRulesetNewParamsRule() {}
+
+// The action to perform when the rule matches.
+type RulesetNewParamsRulesRulesetsExecuteRuleAction string
+
+const (
+ RulesetNewParamsRulesRulesetsExecuteRuleActionExecute RulesetNewParamsRulesRulesetsExecuteRuleAction = "execute"
+)
+
+// The parameters configuring the rule's action.
+type RulesetNewParamsRulesRulesetsExecuteRuleActionParameters struct {
+ // The ID of the ruleset to execute.
+ ID param.Field[string] `json:"id,required"`
+ // The configuration to use for matched data logging.
+ MatchedData param.Field[RulesetNewParamsRulesRulesetsExecuteRuleActionParametersMatchedData] `json:"matched_data"`
+ // A set of overrides to apply to the target ruleset.
+ Overrides param.Field[RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverrides] `json:"overrides"`
+}
+
+func (r RulesetNewParamsRulesRulesetsExecuteRuleActionParameters) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The configuration to use for matched data logging.
+type RulesetNewParamsRulesRulesetsExecuteRuleActionParametersMatchedData struct {
+ // The public key to encrypt matched data logs with.
+ PublicKey param.Field[string] `json:"public_key,required"`
+}
+
+func (r RulesetNewParamsRulesRulesetsExecuteRuleActionParametersMatchedData) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// A set of overrides to apply to the target ruleset.
+type RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverrides struct {
+ // An action to override all rules with. This option has lower precedence than rule
+ // and category overrides.
+ Action param.Field[string] `json:"action"`
+ // A list of category-level overrides. This option has the second-highest
+ // precedence after rule-level overrides.
+ Categories param.Field[[]RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesCategory] `json:"categories"`
+ // Whether to enable execution of all rules. This option has lower precedence than
+ // rule and category overrides.
+ Enabled param.Field[bool] `json:"enabled"`
+ // A list of rule-level overrides. This option has the highest precedence.
+ Rules param.Field[[]RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesRule] `json:"rules"`
+ // A sensitivity level to set for all rules. This option has lower precedence than
+ // rule and category overrides and is only applicable for DDoS phases.
+ SensitivityLevel param.Field[RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel] `json:"sensitivity_level"`
+}
+
+func (r RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverrides) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// A category-level override
+type RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesCategory struct {
+ // The name of the category to override.
+ Category param.Field[string] `json:"category,required"`
+ // The action to override rules in the category with.
+ Action param.Field[string] `json:"action"`
+ // Whether to enable execution of rules in the category.
+ Enabled param.Field[bool] `json:"enabled"`
+ // The sensitivity level to use for rules in the category.
+ SensitivityLevel param.Field[RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel] `json:"sensitivity_level"`
+}
+
+func (r RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesCategory) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The sensitivity level to use for rules in the category.
+type RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel string
+
+const (
+ RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "default"
+ RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "medium"
+ RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "low"
+ RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "eoff"
+)
+
+// A rule-level override
+type RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesRule struct {
+ // The ID of the rule to override.
+ ID param.Field[string] `json:"id,required"`
+ // The action to override the rule with.
+ Action param.Field[string] `json:"action"`
+ // Whether to enable execution of the rule.
+ Enabled param.Field[bool] `json:"enabled"`
+ // The score threshold to use for the rule.
+ ScoreThreshold param.Field[int64] `json:"score_threshold"`
+ // The sensitivity level to use for the rule.
+ SensitivityLevel param.Field[RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel] `json:"sensitivity_level"`
+}
+
+func (r RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesRule) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The sensitivity level to use for the rule.
+type RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel string
+
+const (
+ RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "default"
+ RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "medium"
+ RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelLow RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "low"
+ RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "eoff"
+)
+
+// A sensitivity level to set for all rules. This option has lower precedence than
+// rule and category overrides and is only applicable for DDoS phases.
+type RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel string
+
+const (
+ RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelDefault RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "default"
+ RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelMedium RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "medium"
+ RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelLow RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "low"
+ RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelEoff RulesetNewParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "eoff"
+)
+
+// An object configuring the rule's logging behavior.
+type RulesetNewParamsRulesRulesetsExecuteRuleLogging struct {
+ // Whether to generate a log when the rule matches.
+ Enabled param.Field[bool] `json:"enabled,required"`
+}
+
+func (r RulesetNewParamsRulesRulesetsExecuteRuleLogging) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type RulesetNewParamsRulesRulesetsLogRule struct {
+ // The unique ID of the rule.
+ ID param.Field[string] `json:"id"`
+ // The action to perform when the rule matches.
+ Action param.Field[RulesetNewParamsRulesRulesetsLogRuleAction] `json:"action"`
+ // The parameters configuring the rule's action.
+ ActionParameters param.Field[interface{}] `json:"action_parameters"`
+ // An informative description of the rule.
+ Description param.Field[string] `json:"description"`
+ // Whether the rule should be executed.
+ Enabled param.Field[bool] `json:"enabled"`
+ // The expression defining which traffic will match the rule.
+ Expression param.Field[string] `json:"expression"`
+ // An object configuring the rule's logging behavior.
+ Logging param.Field[RulesetNewParamsRulesRulesetsLogRuleLogging] `json:"logging"`
+ // The reference of the rule (the rule ID by default).
+ Ref param.Field[string] `json:"ref"`
+}
+
+func (r RulesetNewParamsRulesRulesetsLogRule) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+func (r RulesetNewParamsRulesRulesetsLogRule) implementsRulesetsRulesetNewParamsRule() {}
+
+// The action to perform when the rule matches.
+type RulesetNewParamsRulesRulesetsLogRuleAction string
+
+const (
+ RulesetNewParamsRulesRulesetsLogRuleActionLog RulesetNewParamsRulesRulesetsLogRuleAction = "log"
+)
+
+// An object configuring the rule's logging behavior.
+type RulesetNewParamsRulesRulesetsLogRuleLogging struct {
+ // Whether to generate a log when the rule matches.
+ Enabled param.Field[bool] `json:"enabled,required"`
+}
+
+func (r RulesetNewParamsRulesRulesetsLogRuleLogging) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type RulesetNewParamsRulesRulesetsSkipRule struct {
+ // The unique ID of the rule.
+ ID param.Field[string] `json:"id"`
+ // The action to perform when the rule matches.
+ Action param.Field[RulesetNewParamsRulesRulesetsSkipRuleAction] `json:"action"`
+ // The parameters configuring the rule's action.
+ ActionParameters param.Field[RulesetNewParamsRulesRulesetsSkipRuleActionParameters] `json:"action_parameters"`
+ // An informative description of the rule.
+ Description param.Field[string] `json:"description"`
+ // Whether the rule should be executed.
+ Enabled param.Field[bool] `json:"enabled"`
+ // The expression defining which traffic will match the rule.
+ Expression param.Field[string] `json:"expression"`
+ // An object configuring the rule's logging behavior.
+ Logging param.Field[RulesetNewParamsRulesRulesetsSkipRuleLogging] `json:"logging"`
+ // The reference of the rule (the rule ID by default).
+ Ref param.Field[string] `json:"ref"`
+}
+
+func (r RulesetNewParamsRulesRulesetsSkipRule) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+func (r RulesetNewParamsRulesRulesetsSkipRule) implementsRulesetsRulesetNewParamsRule() {}
+
+// The action to perform when the rule matches.
+type RulesetNewParamsRulesRulesetsSkipRuleAction string
+
+const (
+ RulesetNewParamsRulesRulesetsSkipRuleActionSkip RulesetNewParamsRulesRulesetsSkipRuleAction = "skip"
+)
+
+// The parameters configuring the rule's action.
+type RulesetNewParamsRulesRulesetsSkipRuleActionParameters struct {
+ // A list of phases to skip the execution of. This option is incompatible with the
+ // ruleset and rulesets options.
+ Phases param.Field[[]RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase] `json:"phases"`
+ // A list of legacy security products to skip the execution of.
+ Products param.Field[[]RulesetNewParamsRulesRulesetsSkipRuleActionParametersProduct] `json:"products"`
+ // A mapping of ruleset IDs to a list of rule IDs in that ruleset to skip the
+ // execution of. This option is incompatible with the ruleset option.
+ Rules param.Field[map[string][]string] `json:"rules"`
+ // A ruleset to skip the execution of. This option is incompatible with the
+ // rulesets, rules and phases options.
+ Ruleset param.Field[RulesetNewParamsRulesRulesetsSkipRuleActionParametersRuleset] `json:"ruleset"`
+ // A list of ruleset IDs to skip the execution of. This option is incompatible with
+ // the ruleset and phases options.
+ Rulesets param.Field[[]string] `json:"rulesets"`
+}
+
+func (r RulesetNewParamsRulesRulesetsSkipRuleActionParameters) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// A phase to skip the execution of.
+type RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase string
+
+const (
+ RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseDDOSL4 RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase = "ddos_l4"
+ RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseDDOSL7 RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase = "ddos_l7"
+ RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPConfigSettings RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase = "http_config_settings"
+ RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPCustomErrors RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase = "http_custom_errors"
+ RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPLogCustomFields RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase = "http_log_custom_fields"
+ RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRatelimit RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase = "http_ratelimit"
+ RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestCacheSettings RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_cache_settings"
+ RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestDynamicRedirect RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_dynamic_redirect"
+ RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallCustom RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_custom"
+ RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallManaged RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_managed"
+ RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestLateTransform RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_late_transform"
+ RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestOrigin RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_origin"
+ RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestRedirect RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_redirect"
+ RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSanitize RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_sanitize"
+ RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSbfm RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_sbfm"
+ RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSelectConfiguration RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_select_configuration"
+ RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestTransform RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_transform"
+ RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseCompression RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase = "http_response_compression"
+ RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseFirewallManaged RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase = "http_response_firewall_managed"
+ RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseHeadersTransform RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase = "http_response_headers_transform"
+ RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseMagicTransit RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase = "magic_transit"
+ RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseMagicTransitIDsManaged RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_ids_managed"
+ RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhaseMagicTransitManaged RulesetNewParamsRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_managed"
+)
+
+// The name of a legacy security product to skip the execution of.
+type RulesetNewParamsRulesRulesetsSkipRuleActionParametersProduct string
+
+const (
+ RulesetNewParamsRulesRulesetsSkipRuleActionParametersProductBic RulesetNewParamsRulesRulesetsSkipRuleActionParametersProduct = "bic"
+ RulesetNewParamsRulesRulesetsSkipRuleActionParametersProductHot RulesetNewParamsRulesRulesetsSkipRuleActionParametersProduct = "hot"
+ RulesetNewParamsRulesRulesetsSkipRuleActionParametersProductRateLimit RulesetNewParamsRulesRulesetsSkipRuleActionParametersProduct = "rateLimit"
+ RulesetNewParamsRulesRulesetsSkipRuleActionParametersProductSecurityLevel RulesetNewParamsRulesRulesetsSkipRuleActionParametersProduct = "securityLevel"
+ RulesetNewParamsRulesRulesetsSkipRuleActionParametersProductUABlock RulesetNewParamsRulesRulesetsSkipRuleActionParametersProduct = "uaBlock"
+ RulesetNewParamsRulesRulesetsSkipRuleActionParametersProductWAF RulesetNewParamsRulesRulesetsSkipRuleActionParametersProduct = "waf"
+ RulesetNewParamsRulesRulesetsSkipRuleActionParametersProductZoneLockdown RulesetNewParamsRulesRulesetsSkipRuleActionParametersProduct = "zoneLockdown"
+)
+
+// A ruleset to skip the execution of. This option is incompatible with the
+// rulesets, rules and phases options.
+type RulesetNewParamsRulesRulesetsSkipRuleActionParametersRuleset string
+
+const (
+ RulesetNewParamsRulesRulesetsSkipRuleActionParametersRulesetCurrent RulesetNewParamsRulesRulesetsSkipRuleActionParametersRuleset = "current"
+)
+
+// An object configuring the rule's logging behavior.
+type RulesetNewParamsRulesRulesetsSkipRuleLogging struct {
+ // Whether to generate a log when the rule matches.
+ Enabled param.Field[bool] `json:"enabled,required"`
+}
+
+func (r RulesetNewParamsRulesRulesetsSkipRuleLogging) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// A response object.
+type RulesetNewResponseEnvelope struct {
+ // A list of error messages.
+ Errors []RulesetNewResponseEnvelopeErrors `json:"errors,required"`
+ // A list of warning messages.
+ Messages []RulesetNewResponseEnvelopeMessages `json:"messages,required"`
+ // A result.
+ Result RulesetsRulesetResponse `json:"result,required"`
+ // Whether the API call was successful.
+ Success RulesetNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON rulesetNewResponseEnvelopeJSON `json:"-"`
+}
+
+// rulesetNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [RulesetNewResponseEnvelope]
+type rulesetNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RulesetNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r rulesetNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+// A message.
+type RulesetNewResponseEnvelopeErrors struct {
+ // A text description of this message.
+ Message string `json:"message,required"`
+ // A unique code for this message.
+ Code int64 `json:"code"`
+ // The source of this message.
+ Source RulesetNewResponseEnvelopeErrorsSource `json:"source"`
+ JSON rulesetNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// rulesetNewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [RulesetNewResponseEnvelopeErrors]
+type rulesetNewResponseEnvelopeErrorsJSON struct {
+ Message apijson.Field
+ Code apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RulesetNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r rulesetNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+// The source of this message.
+type RulesetNewResponseEnvelopeErrorsSource struct {
+ // A JSON pointer to the field that is the source of the message.
+ Pointer string `json:"pointer,required"`
+ JSON rulesetNewResponseEnvelopeErrorsSourceJSON `json:"-"`
+}
+
+// rulesetNewResponseEnvelopeErrorsSourceJSON contains the JSON metadata for the
+// struct [RulesetNewResponseEnvelopeErrorsSource]
+type rulesetNewResponseEnvelopeErrorsSourceJSON struct {
+ Pointer apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RulesetNewResponseEnvelopeErrorsSource) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r rulesetNewResponseEnvelopeErrorsSourceJSON) RawJSON() string {
+ return r.raw
+}
+
+// A message.
+type RulesetNewResponseEnvelopeMessages struct {
+ // A text description of this message.
+ Message string `json:"message,required"`
+ // A unique code for this message.
+ Code int64 `json:"code"`
+ // The source of this message.
+ Source RulesetNewResponseEnvelopeMessagesSource `json:"source"`
+ JSON rulesetNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// rulesetNewResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [RulesetNewResponseEnvelopeMessages]
+type rulesetNewResponseEnvelopeMessagesJSON struct {
+ Message apijson.Field
+ Code apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RulesetNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r rulesetNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// The source of this message.
+type RulesetNewResponseEnvelopeMessagesSource struct {
+ // A JSON pointer to the field that is the source of the message.
+ Pointer string `json:"pointer,required"`
+ JSON rulesetNewResponseEnvelopeMessagesSourceJSON `json:"-"`
+}
+
+// rulesetNewResponseEnvelopeMessagesSourceJSON contains the JSON metadata for the
+// struct [RulesetNewResponseEnvelopeMessagesSource]
+type rulesetNewResponseEnvelopeMessagesSourceJSON struct {
+ Pointer apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RulesetNewResponseEnvelopeMessagesSource) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r rulesetNewResponseEnvelopeMessagesSourceJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful.
+type RulesetNewResponseEnvelopeSuccess bool
+
+const (
+ RulesetNewResponseEnvelopeSuccessTrue RulesetNewResponseEnvelopeSuccess = true
+)
+
+type RulesetUpdateParams struct {
+ // The unique ID of the ruleset.
+ ID param.Field[string] `json:"id,required"`
+ // The list of rules in the ruleset.
+ Rules param.Field[[]RulesetUpdateParamsRule] `json:"rules,required"`
+ // The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+ AccountID param.Field[string] `path:"account_id"`
+ // The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+ ZoneID param.Field[string] `path:"zone_id"`
+ // An informative description of the ruleset.
+ Description param.Field[string] `json:"description"`
+ // The kind of the ruleset.
+ Kind param.Field[RulesetUpdateParamsKind] `json:"kind"`
+ // The human-readable name of the ruleset.
+ Name param.Field[string] `json:"name"`
+ // The phase of the ruleset.
+ Phase param.Field[RulesetUpdateParamsPhase] `json:"phase"`
+}
+
+func (r RulesetUpdateParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Satisfied by [rulesets.RulesetUpdateParamsRulesRulesetsBlockRule],
+// [rulesets.RulesetUpdateParamsRulesRulesetsExecuteRule],
+// [rulesets.RulesetUpdateParamsRulesRulesetsLogRule],
+// [rulesets.RulesetUpdateParamsRulesRulesetsSkipRule].
+type RulesetUpdateParamsRule interface {
+ implementsRulesetsRulesetUpdateParamsRule()
+}
+
+type RulesetUpdateParamsRulesRulesetsBlockRule struct {
+ // The unique ID of the rule.
+ ID param.Field[string] `json:"id"`
+ // The action to perform when the rule matches.
+ Action param.Field[RulesetUpdateParamsRulesRulesetsBlockRuleAction] `json:"action"`
+ // The parameters configuring the rule's action.
+ ActionParameters param.Field[RulesetUpdateParamsRulesRulesetsBlockRuleActionParameters] `json:"action_parameters"`
+ // An informative description of the rule.
+ Description param.Field[string] `json:"description"`
+ // Whether the rule should be executed.
+ Enabled param.Field[bool] `json:"enabled"`
+ // The expression defining which traffic will match the rule.
+ Expression param.Field[string] `json:"expression"`
+ // An object configuring the rule's logging behavior.
+ Logging param.Field[RulesetUpdateParamsRulesRulesetsBlockRuleLogging] `json:"logging"`
+ // The reference of the rule (the rule ID by default).
+ Ref param.Field[string] `json:"ref"`
+}
+
+func (r RulesetUpdateParamsRulesRulesetsBlockRule) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+func (r RulesetUpdateParamsRulesRulesetsBlockRule) implementsRulesetsRulesetUpdateParamsRule() {}
+
+// The action to perform when the rule matches.
+type RulesetUpdateParamsRulesRulesetsBlockRuleAction string
+
+const (
+ RulesetUpdateParamsRulesRulesetsBlockRuleActionBlock RulesetUpdateParamsRulesRulesetsBlockRuleAction = "block"
+)
+
+// The parameters configuring the rule's action.
+type RulesetUpdateParamsRulesRulesetsBlockRuleActionParameters struct {
+ // The response to show when the block is applied.
+ Response param.Field[RulesetUpdateParamsRulesRulesetsBlockRuleActionParametersResponse] `json:"response"`
+}
+
+func (r RulesetUpdateParamsRulesRulesetsBlockRuleActionParameters) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The response to show when the block is applied.
+type RulesetUpdateParamsRulesRulesetsBlockRuleActionParametersResponse struct {
+ // The content to return.
+ Content param.Field[string] `json:"content,required"`
+ // The type of the content to return.
+ ContentType param.Field[string] `json:"content_type,required"`
+ // The status code to return.
+ StatusCode param.Field[int64] `json:"status_code,required"`
+}
+
+func (r RulesetUpdateParamsRulesRulesetsBlockRuleActionParametersResponse) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// An object configuring the rule's logging behavior.
+type RulesetUpdateParamsRulesRulesetsBlockRuleLogging struct {
+ // Whether to generate a log when the rule matches.
+ Enabled param.Field[bool] `json:"enabled,required"`
+}
+
+func (r RulesetUpdateParamsRulesRulesetsBlockRuleLogging) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type RulesetUpdateParamsRulesRulesetsExecuteRule struct {
+ // The unique ID of the rule.
+ ID param.Field[string] `json:"id"`
+ // The action to perform when the rule matches.
+ Action param.Field[RulesetUpdateParamsRulesRulesetsExecuteRuleAction] `json:"action"`
+ // The parameters configuring the rule's action.
+ ActionParameters param.Field[RulesetUpdateParamsRulesRulesetsExecuteRuleActionParameters] `json:"action_parameters"`
+ // An informative description of the rule.
+ Description param.Field[string] `json:"description"`
+ // Whether the rule should be executed.
+ Enabled param.Field[bool] `json:"enabled"`
+ // The expression defining which traffic will match the rule.
+ Expression param.Field[string] `json:"expression"`
+ // An object configuring the rule's logging behavior.
+ Logging param.Field[RulesetUpdateParamsRulesRulesetsExecuteRuleLogging] `json:"logging"`
+ // The reference of the rule (the rule ID by default).
+ Ref param.Field[string] `json:"ref"`
+}
+
+func (r RulesetUpdateParamsRulesRulesetsExecuteRule) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+func (r RulesetUpdateParamsRulesRulesetsExecuteRule) implementsRulesetsRulesetUpdateParamsRule() {}
+
+// The action to perform when the rule matches.
+type RulesetUpdateParamsRulesRulesetsExecuteRuleAction string
+
+const (
+ RulesetUpdateParamsRulesRulesetsExecuteRuleActionExecute RulesetUpdateParamsRulesRulesetsExecuteRuleAction = "execute"
+)
+
+// The parameters configuring the rule's action.
+type RulesetUpdateParamsRulesRulesetsExecuteRuleActionParameters struct {
+ // The ID of the ruleset to execute.
+ ID param.Field[string] `json:"id,required"`
+ // The configuration to use for matched data logging.
+ MatchedData param.Field[RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersMatchedData] `json:"matched_data"`
+ // A set of overrides to apply to the target ruleset.
+ Overrides param.Field[RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverrides] `json:"overrides"`
+}
+
+func (r RulesetUpdateParamsRulesRulesetsExecuteRuleActionParameters) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The configuration to use for matched data logging.
+type RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersMatchedData struct {
+ // The public key to encrypt matched data logs with.
+ PublicKey param.Field[string] `json:"public_key,required"`
+}
+
+func (r RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersMatchedData) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// A set of overrides to apply to the target ruleset.
+type RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverrides struct {
+ // An action to override all rules with. This option has lower precedence than rule
+ // and category overrides.
+ Action param.Field[string] `json:"action"`
+ // A list of category-level overrides. This option has the second-highest
+ // precedence after rule-level overrides.
+ Categories param.Field[[]RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategory] `json:"categories"`
+ // Whether to enable execution of all rules. This option has lower precedence than
+ // rule and category overrides.
+ Enabled param.Field[bool] `json:"enabled"`
+ // A list of rule-level overrides. This option has the highest precedence.
+ Rules param.Field[[]RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRule] `json:"rules"`
+ // A sensitivity level to set for all rules. This option has lower precedence than
+ // rule and category overrides and is only applicable for DDoS phases.
+ SensitivityLevel param.Field[RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel] `json:"sensitivity_level"`
+}
+
+func (r RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverrides) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// A category-level override
+type RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategory struct {
+ // The name of the category to override.
+ Category param.Field[string] `json:"category,required"`
+ // The action to override rules in the category with.
+ Action param.Field[string] `json:"action"`
+ // Whether to enable execution of rules in the category.
+ Enabled param.Field[bool] `json:"enabled"`
+ // The sensitivity level to use for rules in the category.
+ SensitivityLevel param.Field[RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel] `json:"sensitivity_level"`
+}
+
+func (r RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategory) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The sensitivity level to use for rules in the category.
+type RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel string
+
+const (
+ RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "default"
+ RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "medium"
+ RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "low"
+ RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "eoff"
+)
+
+// A rule-level override
+type RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRule struct {
+ // The ID of the rule to override.
+ ID param.Field[string] `json:"id,required"`
+ // The action to override the rule with.
+ Action param.Field[string] `json:"action"`
+ // Whether to enable execution of the rule.
+ Enabled param.Field[bool] `json:"enabled"`
+ // The score threshold to use for the rule.
+ ScoreThreshold param.Field[int64] `json:"score_threshold"`
+ // The sensitivity level to use for the rule.
+ SensitivityLevel param.Field[RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel] `json:"sensitivity_level"`
+}
+
+func (r RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRule) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The sensitivity level to use for the rule.
+type RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel string
+
+const (
+ RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "default"
+ RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "medium"
+ RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelLow RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "low"
+ RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "eoff"
+)
+
+// A sensitivity level to set for all rules. This option has lower precedence than
+// rule and category overrides and is only applicable for DDoS phases.
+type RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel string
+
+const (
+ RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelDefault RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "default"
+ RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelMedium RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "medium"
+ RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelLow RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "low"
+ RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelEoff RulesetUpdateParamsRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "eoff"
+)
+
+// An object configuring the rule's logging behavior.
+type RulesetUpdateParamsRulesRulesetsExecuteRuleLogging struct {
+ // Whether to generate a log when the rule matches.
+ Enabled param.Field[bool] `json:"enabled,required"`
+}
+
+func (r RulesetUpdateParamsRulesRulesetsExecuteRuleLogging) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type RulesetUpdateParamsRulesRulesetsLogRule struct {
+ // The unique ID of the rule.
+ ID param.Field[string] `json:"id"`
+ // The action to perform when the rule matches.
+ Action param.Field[RulesetUpdateParamsRulesRulesetsLogRuleAction] `json:"action"`
+ // The parameters configuring the rule's action.
+ ActionParameters param.Field[interface{}] `json:"action_parameters"`
+ // An informative description of the rule.
+ Description param.Field[string] `json:"description"`
+ // Whether the rule should be executed.
+ Enabled param.Field[bool] `json:"enabled"`
+ // The expression defining which traffic will match the rule.
+ Expression param.Field[string] `json:"expression"`
+ // An object configuring the rule's logging behavior.
+ Logging param.Field[RulesetUpdateParamsRulesRulesetsLogRuleLogging] `json:"logging"`
+ // The reference of the rule (the rule ID by default).
+ Ref param.Field[string] `json:"ref"`
+}
+
+func (r RulesetUpdateParamsRulesRulesetsLogRule) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+func (r RulesetUpdateParamsRulesRulesetsLogRule) implementsRulesetsRulesetUpdateParamsRule() {}
+
+// The action to perform when the rule matches.
+type RulesetUpdateParamsRulesRulesetsLogRuleAction string
+
+const (
+ RulesetUpdateParamsRulesRulesetsLogRuleActionLog RulesetUpdateParamsRulesRulesetsLogRuleAction = "log"
+)
+
+// An object configuring the rule's logging behavior.
+type RulesetUpdateParamsRulesRulesetsLogRuleLogging struct {
+ // Whether to generate a log when the rule matches.
+ Enabled param.Field[bool] `json:"enabled,required"`
+}
+
+func (r RulesetUpdateParamsRulesRulesetsLogRuleLogging) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type RulesetUpdateParamsRulesRulesetsSkipRule struct {
+ // The unique ID of the rule.
+ ID param.Field[string] `json:"id"`
+ // The action to perform when the rule matches.
+ Action param.Field[RulesetUpdateParamsRulesRulesetsSkipRuleAction] `json:"action"`
+ // The parameters configuring the rule's action.
+ ActionParameters param.Field[RulesetUpdateParamsRulesRulesetsSkipRuleActionParameters] `json:"action_parameters"`
+ // An informative description of the rule.
+ Description param.Field[string] `json:"description"`
+ // Whether the rule should be executed.
+ Enabled param.Field[bool] `json:"enabled"`
+ // The expression defining which traffic will match the rule.
+ Expression param.Field[string] `json:"expression"`
+ // An object configuring the rule's logging behavior.
+ Logging param.Field[RulesetUpdateParamsRulesRulesetsSkipRuleLogging] `json:"logging"`
+ // The reference of the rule (the rule ID by default).
+ Ref param.Field[string] `json:"ref"`
+}
+
+func (r RulesetUpdateParamsRulesRulesetsSkipRule) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+func (r RulesetUpdateParamsRulesRulesetsSkipRule) implementsRulesetsRulesetUpdateParamsRule() {}
+
+// The action to perform when the rule matches.
+type RulesetUpdateParamsRulesRulesetsSkipRuleAction string
+
+const (
+ RulesetUpdateParamsRulesRulesetsSkipRuleActionSkip RulesetUpdateParamsRulesRulesetsSkipRuleAction = "skip"
+)
+
+// The parameters configuring the rule's action.
+type RulesetUpdateParamsRulesRulesetsSkipRuleActionParameters struct {
+ // A list of phases to skip the execution of. This option is incompatible with the
+ // ruleset and rulesets options.
+ Phases param.Field[[]RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase] `json:"phases"`
+ // A list of legacy security products to skip the execution of.
+ Products param.Field[[]RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersProduct] `json:"products"`
+ // A mapping of ruleset IDs to a list of rule IDs in that ruleset to skip the
+ // execution of. This option is incompatible with the ruleset option.
+ Rules param.Field[map[string][]string] `json:"rules"`
+ // A ruleset to skip the execution of. This option is incompatible with the
+ // rulesets, rules and phases options.
+ Ruleset param.Field[RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersRuleset] `json:"ruleset"`
+ // A list of ruleset IDs to skip the execution of. This option is incompatible with
+ // the ruleset and phases options.
+ Rulesets param.Field[[]string] `json:"rulesets"`
+}
+
+func (r RulesetUpdateParamsRulesRulesetsSkipRuleActionParameters) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// A phase to skip the execution of.
+type RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase string
+
+const (
+ RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseDDOSL4 RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "ddos_l4"
+ RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseDDOSL7 RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "ddos_l7"
+ RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPConfigSettings RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_config_settings"
+ RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPCustomErrors RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_custom_errors"
+ RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPLogCustomFields RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_log_custom_fields"
+ RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRatelimit RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_ratelimit"
+ RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestCacheSettings RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_cache_settings"
+ RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestDynamicRedirect RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_dynamic_redirect"
+ RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallCustom RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_custom"
+ RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallManaged RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_managed"
+ RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestLateTransform RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_late_transform"
+ RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestOrigin RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_origin"
+ RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestRedirect RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_redirect"
+ RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSanitize RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_sanitize"
+ RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSbfm RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_sbfm"
+ RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSelectConfiguration RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_select_configuration"
+ RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestTransform RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_request_transform"
+ RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseCompression RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_response_compression"
+ RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseFirewallManaged RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_response_firewall_managed"
+ RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseHeadersTransform RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "http_response_headers_transform"
+ RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseMagicTransit RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "magic_transit"
+ RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseMagicTransitIDsManaged RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_ids_managed"
+ RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhaseMagicTransitManaged RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_managed"
+)
+
+// The name of a legacy security product to skip the execution of.
+type RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersProduct string
+
+const (
+ RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersProductBic RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersProduct = "bic"
+ RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersProductHot RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersProduct = "hot"
+ RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersProductRateLimit RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersProduct = "rateLimit"
+ RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersProductSecurityLevel RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersProduct = "securityLevel"
+ RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersProductUABlock RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersProduct = "uaBlock"
+ RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersProductWAF RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersProduct = "waf"
+ RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersProductZoneLockdown RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersProduct = "zoneLockdown"
+)
+
+// A ruleset to skip the execution of. This option is incompatible with the
+// rulesets, rules and phases options.
+type RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersRuleset string
+
+const (
+ RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersRulesetCurrent RulesetUpdateParamsRulesRulesetsSkipRuleActionParametersRuleset = "current"
+)
+
+// An object configuring the rule's logging behavior.
+type RulesetUpdateParamsRulesRulesetsSkipRuleLogging struct {
+ // Whether to generate a log when the rule matches.
+ Enabled param.Field[bool] `json:"enabled,required"`
+}
+
+func (r RulesetUpdateParamsRulesRulesetsSkipRuleLogging) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The kind of the ruleset.
+type RulesetUpdateParamsKind string
+
+const (
+ RulesetUpdateParamsKindManaged RulesetUpdateParamsKind = "managed"
+ RulesetUpdateParamsKindCustom RulesetUpdateParamsKind = "custom"
+ RulesetUpdateParamsKindRoot RulesetUpdateParamsKind = "root"
+ RulesetUpdateParamsKindZone RulesetUpdateParamsKind = "zone"
+)
+
+// The phase of the ruleset.
+type RulesetUpdateParamsPhase string
+
+const (
+ RulesetUpdateParamsPhaseDDOSL4 RulesetUpdateParamsPhase = "ddos_l4"
+ RulesetUpdateParamsPhaseDDOSL7 RulesetUpdateParamsPhase = "ddos_l7"
+ RulesetUpdateParamsPhaseHTTPConfigSettings RulesetUpdateParamsPhase = "http_config_settings"
+ RulesetUpdateParamsPhaseHTTPCustomErrors RulesetUpdateParamsPhase = "http_custom_errors"
+ RulesetUpdateParamsPhaseHTTPLogCustomFields RulesetUpdateParamsPhase = "http_log_custom_fields"
+ RulesetUpdateParamsPhaseHTTPRatelimit RulesetUpdateParamsPhase = "http_ratelimit"
+ RulesetUpdateParamsPhaseHTTPRequestCacheSettings RulesetUpdateParamsPhase = "http_request_cache_settings"
+ RulesetUpdateParamsPhaseHTTPRequestDynamicRedirect RulesetUpdateParamsPhase = "http_request_dynamic_redirect"
+ RulesetUpdateParamsPhaseHTTPRequestFirewallCustom RulesetUpdateParamsPhase = "http_request_firewall_custom"
+ RulesetUpdateParamsPhaseHTTPRequestFirewallManaged RulesetUpdateParamsPhase = "http_request_firewall_managed"
+ RulesetUpdateParamsPhaseHTTPRequestLateTransform RulesetUpdateParamsPhase = "http_request_late_transform"
+ RulesetUpdateParamsPhaseHTTPRequestOrigin RulesetUpdateParamsPhase = "http_request_origin"
+ RulesetUpdateParamsPhaseHTTPRequestRedirect RulesetUpdateParamsPhase = "http_request_redirect"
+ RulesetUpdateParamsPhaseHTTPRequestSanitize RulesetUpdateParamsPhase = "http_request_sanitize"
+ RulesetUpdateParamsPhaseHTTPRequestSbfm RulesetUpdateParamsPhase = "http_request_sbfm"
+ RulesetUpdateParamsPhaseHTTPRequestSelectConfiguration RulesetUpdateParamsPhase = "http_request_select_configuration"
+ RulesetUpdateParamsPhaseHTTPRequestTransform RulesetUpdateParamsPhase = "http_request_transform"
+ RulesetUpdateParamsPhaseHTTPResponseCompression RulesetUpdateParamsPhase = "http_response_compression"
+ RulesetUpdateParamsPhaseHTTPResponseFirewallManaged RulesetUpdateParamsPhase = "http_response_firewall_managed"
+ RulesetUpdateParamsPhaseHTTPResponseHeadersTransform RulesetUpdateParamsPhase = "http_response_headers_transform"
+ RulesetUpdateParamsPhaseMagicTransit RulesetUpdateParamsPhase = "magic_transit"
+ RulesetUpdateParamsPhaseMagicTransitIDsManaged RulesetUpdateParamsPhase = "magic_transit_ids_managed"
+ RulesetUpdateParamsPhaseMagicTransitManaged RulesetUpdateParamsPhase = "magic_transit_managed"
+)
+
+// A response object.
+type RulesetUpdateResponseEnvelope struct {
+ // A list of error messages.
+ Errors []RulesetUpdateResponseEnvelopeErrors `json:"errors,required"`
+ // A list of warning messages.
+ Messages []RulesetUpdateResponseEnvelopeMessages `json:"messages,required"`
+ // A result.
+ Result RulesetsRulesetResponse `json:"result,required"`
+ // Whether the API call was successful.
+ Success RulesetUpdateResponseEnvelopeSuccess `json:"success,required"`
+ JSON rulesetUpdateResponseEnvelopeJSON `json:"-"`
+}
+
+// rulesetUpdateResponseEnvelopeJSON contains the JSON metadata for the struct
+// [RulesetUpdateResponseEnvelope]
+type rulesetUpdateResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RulesetUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r rulesetUpdateResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+// A message.
+type RulesetUpdateResponseEnvelopeErrors struct {
+ // A text description of this message.
+ Message string `json:"message,required"`
+ // A unique code for this message.
+ Code int64 `json:"code"`
+ // The source of this message.
+ Source RulesetUpdateResponseEnvelopeErrorsSource `json:"source"`
+ JSON rulesetUpdateResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// rulesetUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [RulesetUpdateResponseEnvelopeErrors]
+type rulesetUpdateResponseEnvelopeErrorsJSON struct {
+ Message apijson.Field
+ Code apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RulesetUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r rulesetUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+// The source of this message.
+type RulesetUpdateResponseEnvelopeErrorsSource struct {
+ // A JSON pointer to the field that is the source of the message.
+ Pointer string `json:"pointer,required"`
+ JSON rulesetUpdateResponseEnvelopeErrorsSourceJSON `json:"-"`
+}
+
+// rulesetUpdateResponseEnvelopeErrorsSourceJSON contains the JSON metadata for the
+// struct [RulesetUpdateResponseEnvelopeErrorsSource]
+type rulesetUpdateResponseEnvelopeErrorsSourceJSON struct {
+ Pointer apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RulesetUpdateResponseEnvelopeErrorsSource) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r rulesetUpdateResponseEnvelopeErrorsSourceJSON) RawJSON() string {
+ return r.raw
+}
+
+// A message.
+type RulesetUpdateResponseEnvelopeMessages struct {
+ // A text description of this message.
+ Message string `json:"message,required"`
+ // A unique code for this message.
+ Code int64 `json:"code"`
+ // The source of this message.
+ Source RulesetUpdateResponseEnvelopeMessagesSource `json:"source"`
+ JSON rulesetUpdateResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// rulesetUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [RulesetUpdateResponseEnvelopeMessages]
+type rulesetUpdateResponseEnvelopeMessagesJSON struct {
+ Message apijson.Field
+ Code apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RulesetUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r rulesetUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// The source of this message.
+type RulesetUpdateResponseEnvelopeMessagesSource struct {
+ // A JSON pointer to the field that is the source of the message.
+ Pointer string `json:"pointer,required"`
+ JSON rulesetUpdateResponseEnvelopeMessagesSourceJSON `json:"-"`
+}
+
+// rulesetUpdateResponseEnvelopeMessagesSourceJSON contains the JSON metadata for
+// the struct [RulesetUpdateResponseEnvelopeMessagesSource]
+type rulesetUpdateResponseEnvelopeMessagesSourceJSON struct {
+ Pointer apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RulesetUpdateResponseEnvelopeMessagesSource) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r rulesetUpdateResponseEnvelopeMessagesSourceJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful.
+type RulesetUpdateResponseEnvelopeSuccess bool
+
+const (
+ RulesetUpdateResponseEnvelopeSuccessTrue RulesetUpdateResponseEnvelopeSuccess = true
+)
+
+type RulesetListParams struct {
+ // The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+ AccountID param.Field[string] `path:"account_id"`
+ // The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+ ZoneID param.Field[string] `path:"zone_id"`
+}
+
+// A response object.
+type RulesetListResponseEnvelope struct {
+ // A list of error messages.
+ Errors []RulesetListResponseEnvelopeErrors `json:"errors,required"`
+ // A list of warning messages.
+ Messages []RulesetListResponseEnvelopeMessages `json:"messages,required"`
+ // A result.
+ Result RulesetsRulesetsResponse `json:"result,required"`
+ // Whether the API call was successful.
+ Success RulesetListResponseEnvelopeSuccess `json:"success,required"`
+ JSON rulesetListResponseEnvelopeJSON `json:"-"`
+}
+
+// rulesetListResponseEnvelopeJSON contains the JSON metadata for the struct
+// [RulesetListResponseEnvelope]
+type rulesetListResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RulesetListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r rulesetListResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+// A message.
+type RulesetListResponseEnvelopeErrors struct {
+ // A text description of this message.
+ Message string `json:"message,required"`
+ // A unique code for this message.
+ Code int64 `json:"code"`
+ // The source of this message.
+ Source RulesetListResponseEnvelopeErrorsSource `json:"source"`
+ JSON rulesetListResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// rulesetListResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [RulesetListResponseEnvelopeErrors]
+type rulesetListResponseEnvelopeErrorsJSON struct {
+ Message apijson.Field
+ Code apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RulesetListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r rulesetListResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+// The source of this message.
+type RulesetListResponseEnvelopeErrorsSource struct {
+ // A JSON pointer to the field that is the source of the message.
+ Pointer string `json:"pointer,required"`
+ JSON rulesetListResponseEnvelopeErrorsSourceJSON `json:"-"`
+}
+
+// rulesetListResponseEnvelopeErrorsSourceJSON contains the JSON metadata for the
+// struct [RulesetListResponseEnvelopeErrorsSource]
+type rulesetListResponseEnvelopeErrorsSourceJSON struct {
+ Pointer apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RulesetListResponseEnvelopeErrorsSource) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r rulesetListResponseEnvelopeErrorsSourceJSON) RawJSON() string {
+ return r.raw
+}
+
+// A message.
+type RulesetListResponseEnvelopeMessages struct {
+ // A text description of this message.
+ Message string `json:"message,required"`
+ // A unique code for this message.
+ Code int64 `json:"code"`
+ // The source of this message.
+ Source RulesetListResponseEnvelopeMessagesSource `json:"source"`
+ JSON rulesetListResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// rulesetListResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [RulesetListResponseEnvelopeMessages]
+type rulesetListResponseEnvelopeMessagesJSON struct {
+ Message apijson.Field
+ Code apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RulesetListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r rulesetListResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// The source of this message.
+type RulesetListResponseEnvelopeMessagesSource struct {
+ // A JSON pointer to the field that is the source of the message.
+ Pointer string `json:"pointer,required"`
+ JSON rulesetListResponseEnvelopeMessagesSourceJSON `json:"-"`
+}
+
+// rulesetListResponseEnvelopeMessagesSourceJSON contains the JSON metadata for the
+// struct [RulesetListResponseEnvelopeMessagesSource]
+type rulesetListResponseEnvelopeMessagesSourceJSON struct {
+ Pointer apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RulesetListResponseEnvelopeMessagesSource) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r rulesetListResponseEnvelopeMessagesSourceJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful.
+type RulesetListResponseEnvelopeSuccess bool
+
+const (
+ RulesetListResponseEnvelopeSuccessTrue RulesetListResponseEnvelopeSuccess = true
+)
+
+type RulesetDeleteParams struct {
+ // The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+ AccountID param.Field[string] `path:"account_id"`
+ // The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+ ZoneID param.Field[string] `path:"zone_id"`
+}
+
+type RulesetGetParams struct {
+ // The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+ AccountID param.Field[string] `path:"account_id"`
+ // The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+ ZoneID param.Field[string] `path:"zone_id"`
+}
+
+// A response object.
+type RulesetGetResponseEnvelope struct {
+ // A list of error messages.
+ Errors []RulesetGetResponseEnvelopeErrors `json:"errors,required"`
+ // A list of warning messages.
+ Messages []RulesetGetResponseEnvelopeMessages `json:"messages,required"`
+ // A result.
+ Result RulesetsRulesetResponse `json:"result,required"`
+ // Whether the API call was successful.
+ Success RulesetGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON rulesetGetResponseEnvelopeJSON `json:"-"`
+}
+
+// rulesetGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [RulesetGetResponseEnvelope]
+type rulesetGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RulesetGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r rulesetGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+// A message.
+type RulesetGetResponseEnvelopeErrors struct {
+ // A text description of this message.
+ Message string `json:"message,required"`
+ // A unique code for this message.
+ Code int64 `json:"code"`
+ // The source of this message.
+ Source RulesetGetResponseEnvelopeErrorsSource `json:"source"`
+ JSON rulesetGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// rulesetGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [RulesetGetResponseEnvelopeErrors]
+type rulesetGetResponseEnvelopeErrorsJSON struct {
+ Message apijson.Field
+ Code apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RulesetGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r rulesetGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+// The source of this message.
+type RulesetGetResponseEnvelopeErrorsSource struct {
+ // A JSON pointer to the field that is the source of the message.
+ Pointer string `json:"pointer,required"`
+ JSON rulesetGetResponseEnvelopeErrorsSourceJSON `json:"-"`
+}
+
+// rulesetGetResponseEnvelopeErrorsSourceJSON contains the JSON metadata for the
+// struct [RulesetGetResponseEnvelopeErrorsSource]
+type rulesetGetResponseEnvelopeErrorsSourceJSON struct {
+ Pointer apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RulesetGetResponseEnvelopeErrorsSource) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r rulesetGetResponseEnvelopeErrorsSourceJSON) RawJSON() string {
+ return r.raw
+}
+
+// A message.
+type RulesetGetResponseEnvelopeMessages struct {
+ // A text description of this message.
+ Message string `json:"message,required"`
+ // A unique code for this message.
+ Code int64 `json:"code"`
+ // The source of this message.
+ Source RulesetGetResponseEnvelopeMessagesSource `json:"source"`
+ JSON rulesetGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// rulesetGetResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [RulesetGetResponseEnvelopeMessages]
+type rulesetGetResponseEnvelopeMessagesJSON struct {
+ Message apijson.Field
+ Code apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RulesetGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r rulesetGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// The source of this message.
+type RulesetGetResponseEnvelopeMessagesSource struct {
+ // A JSON pointer to the field that is the source of the message.
+ Pointer string `json:"pointer,required"`
+ JSON rulesetGetResponseEnvelopeMessagesSourceJSON `json:"-"`
+}
+
+// rulesetGetResponseEnvelopeMessagesSourceJSON contains the JSON metadata for the
+// struct [RulesetGetResponseEnvelopeMessagesSource]
+type rulesetGetResponseEnvelopeMessagesSourceJSON struct {
+ Pointer apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RulesetGetResponseEnvelopeMessagesSource) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r rulesetGetResponseEnvelopeMessagesSourceJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful.
+type RulesetGetResponseEnvelopeSuccess bool
+
+const (
+ RulesetGetResponseEnvelopeSuccessTrue RulesetGetResponseEnvelopeSuccess = true
+)
diff --git a/rulesets/ruleset_test.go b/rulesets/ruleset_test.go
new file mode 100644
index 00000000000..48c579a73ff
--- /dev/null
+++ b/rulesets/ruleset_test.go
@@ -0,0 +1,275 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package rulesets_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/rulesets"
+)
+
+func TestRulesetNewWithOptionalParams(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"),
+ )
+ _, err := client.Rulesets.New(context.TODO(), rulesets.RulesetNewParams{
+ Kind: cloudflare.F(rulesets.RulesetNewParamsKindRoot),
+ Name: cloudflare.F("My ruleset"),
+ Phase: cloudflare.F(rulesets.RulesetNewParamsPhaseHTTPRequestFirewallCustom),
+ Rules: cloudflare.F([]rulesets.RulesetNewParamsRule{rulesets.RulesetNewParamsRulesRulesetsBlockRule(rulesets.RulesetNewParamsRulesRulesetsBlockRule{
+ Action: cloudflare.F(rulesets.RulesetNewParamsRulesRulesetsBlockRuleActionBlock),
+ ActionParameters: cloudflare.F(rulesets.RulesetNewParamsRulesRulesetsBlockRuleActionParameters{
+ Response: cloudflare.F(rulesets.RulesetNewParamsRulesRulesetsBlockRuleActionParametersResponse{
+ Content: cloudflare.F("{\n \"success\": false,\n \"error\": \"you have been blocked\"\n}"),
+ ContentType: cloudflare.F("application/json"),
+ StatusCode: cloudflare.F(int64(400)),
+ }),
+ }),
+ Description: cloudflare.F("Block when the IP address is not 1.1.1.1"),
+ Enabled: cloudflare.F(true),
+ Expression: cloudflare.F("ip.src ne 1.1.1.1"),
+ ID: cloudflare.F("3a03d665bac047339bb530ecb439a90d"),
+ Logging: cloudflare.F(rulesets.RulesetNewParamsRulesRulesetsBlockRuleLogging{
+ Enabled: cloudflare.F(true),
+ }),
+ Ref: cloudflare.F("my_ref"),
+ }), rulesets.RulesetNewParamsRulesRulesetsBlockRule(rulesets.RulesetNewParamsRulesRulesetsBlockRule{
+ Action: cloudflare.F(rulesets.RulesetNewParamsRulesRulesetsBlockRuleActionBlock),
+ ActionParameters: cloudflare.F(rulesets.RulesetNewParamsRulesRulesetsBlockRuleActionParameters{
+ Response: cloudflare.F(rulesets.RulesetNewParamsRulesRulesetsBlockRuleActionParametersResponse{
+ Content: cloudflare.F("{\n \"success\": false,\n \"error\": \"you have been blocked\"\n}"),
+ ContentType: cloudflare.F("application/json"),
+ StatusCode: cloudflare.F(int64(400)),
+ }),
+ }),
+ Description: cloudflare.F("Block when the IP address is not 1.1.1.1"),
+ Enabled: cloudflare.F(true),
+ Expression: cloudflare.F("ip.src ne 1.1.1.1"),
+ ID: cloudflare.F("3a03d665bac047339bb530ecb439a90d"),
+ Logging: cloudflare.F(rulesets.RulesetNewParamsRulesRulesetsBlockRuleLogging{
+ Enabled: cloudflare.F(true),
+ }),
+ Ref: cloudflare.F("my_ref"),
+ }), rulesets.RulesetNewParamsRulesRulesetsBlockRule(rulesets.RulesetNewParamsRulesRulesetsBlockRule{
+ Action: cloudflare.F(rulesets.RulesetNewParamsRulesRulesetsBlockRuleActionBlock),
+ ActionParameters: cloudflare.F(rulesets.RulesetNewParamsRulesRulesetsBlockRuleActionParameters{
+ Response: cloudflare.F(rulesets.RulesetNewParamsRulesRulesetsBlockRuleActionParametersResponse{
+ Content: cloudflare.F("{\n \"success\": false,\n \"error\": \"you have been blocked\"\n}"),
+ ContentType: cloudflare.F("application/json"),
+ StatusCode: cloudflare.F(int64(400)),
+ }),
+ }),
+ Description: cloudflare.F("Block when the IP address is not 1.1.1.1"),
+ Enabled: cloudflare.F(true),
+ Expression: cloudflare.F("ip.src ne 1.1.1.1"),
+ ID: cloudflare.F("3a03d665bac047339bb530ecb439a90d"),
+ Logging: cloudflare.F(rulesets.RulesetNewParamsRulesRulesetsBlockRuleLogging{
+ Enabled: cloudflare.F(true),
+ }),
+ Ref: cloudflare.F("my_ref"),
+ })}),
+ AccountID: cloudflare.F("string"),
+ ZoneID: cloudflare.F("string"),
+ Description: cloudflare.F("My ruleset to execute managed rulesets"),
+ })
+ 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())
+ }
+}
+
+func TestRulesetUpdateWithOptionalParams(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"),
+ )
+ _, err := client.Rulesets.Update(
+ context.TODO(),
+ "2f2feab2026849078ba485f918791bdc",
+ rulesets.RulesetUpdateParams{
+ ID: cloudflare.F("2f2feab2026849078ba485f918791bdc"),
+ Rules: cloudflare.F([]rulesets.RulesetUpdateParamsRule{rulesets.RulesetUpdateParamsRulesRulesetsBlockRule(rulesets.RulesetUpdateParamsRulesRulesetsBlockRule{
+ Action: cloudflare.F(rulesets.RulesetUpdateParamsRulesRulesetsBlockRuleActionBlock),
+ ActionParameters: cloudflare.F(rulesets.RulesetUpdateParamsRulesRulesetsBlockRuleActionParameters{
+ Response: cloudflare.F(rulesets.RulesetUpdateParamsRulesRulesetsBlockRuleActionParametersResponse{
+ Content: cloudflare.F("{\n \"success\": false,\n \"error\": \"you have been blocked\"\n}"),
+ ContentType: cloudflare.F("application/json"),
+ StatusCode: cloudflare.F(int64(400)),
+ }),
+ }),
+ Description: cloudflare.F("Block when the IP address is not 1.1.1.1"),
+ Enabled: cloudflare.F(true),
+ Expression: cloudflare.F("ip.src ne 1.1.1.1"),
+ ID: cloudflare.F("3a03d665bac047339bb530ecb439a90d"),
+ Logging: cloudflare.F(rulesets.RulesetUpdateParamsRulesRulesetsBlockRuleLogging{
+ Enabled: cloudflare.F(true),
+ }),
+ Ref: cloudflare.F("my_ref"),
+ }), rulesets.RulesetUpdateParamsRulesRulesetsBlockRule(rulesets.RulesetUpdateParamsRulesRulesetsBlockRule{
+ Action: cloudflare.F(rulesets.RulesetUpdateParamsRulesRulesetsBlockRuleActionBlock),
+ ActionParameters: cloudflare.F(rulesets.RulesetUpdateParamsRulesRulesetsBlockRuleActionParameters{
+ Response: cloudflare.F(rulesets.RulesetUpdateParamsRulesRulesetsBlockRuleActionParametersResponse{
+ Content: cloudflare.F("{\n \"success\": false,\n \"error\": \"you have been blocked\"\n}"),
+ ContentType: cloudflare.F("application/json"),
+ StatusCode: cloudflare.F(int64(400)),
+ }),
+ }),
+ Description: cloudflare.F("Block when the IP address is not 1.1.1.1"),
+ Enabled: cloudflare.F(true),
+ Expression: cloudflare.F("ip.src ne 1.1.1.1"),
+ ID: cloudflare.F("3a03d665bac047339bb530ecb439a90d"),
+ Logging: cloudflare.F(rulesets.RulesetUpdateParamsRulesRulesetsBlockRuleLogging{
+ Enabled: cloudflare.F(true),
+ }),
+ Ref: cloudflare.F("my_ref"),
+ }), rulesets.RulesetUpdateParamsRulesRulesetsBlockRule(rulesets.RulesetUpdateParamsRulesRulesetsBlockRule{
+ Action: cloudflare.F(rulesets.RulesetUpdateParamsRulesRulesetsBlockRuleActionBlock),
+ ActionParameters: cloudflare.F(rulesets.RulesetUpdateParamsRulesRulesetsBlockRuleActionParameters{
+ Response: cloudflare.F(rulesets.RulesetUpdateParamsRulesRulesetsBlockRuleActionParametersResponse{
+ Content: cloudflare.F("{\n \"success\": false,\n \"error\": \"you have been blocked\"\n}"),
+ ContentType: cloudflare.F("application/json"),
+ StatusCode: cloudflare.F(int64(400)),
+ }),
+ }),
+ Description: cloudflare.F("Block when the IP address is not 1.1.1.1"),
+ Enabled: cloudflare.F(true),
+ Expression: cloudflare.F("ip.src ne 1.1.1.1"),
+ ID: cloudflare.F("3a03d665bac047339bb530ecb439a90d"),
+ Logging: cloudflare.F(rulesets.RulesetUpdateParamsRulesRulesetsBlockRuleLogging{
+ Enabled: cloudflare.F(true),
+ }),
+ Ref: cloudflare.F("my_ref"),
+ })}),
+ AccountID: cloudflare.F("string"),
+ ZoneID: cloudflare.F("string"),
+ Description: cloudflare.F("My ruleset to execute managed rulesets"),
+ Kind: cloudflare.F(rulesets.RulesetUpdateParamsKindRoot),
+ Name: cloudflare.F("My ruleset"),
+ Phase: cloudflare.F(rulesets.RulesetUpdateParamsPhaseHTTPRequestFirewallCustom),
+ },
+ )
+ 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())
+ }
+}
+
+func TestRulesetListWithOptionalParams(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"),
+ )
+ _, err := client.Rulesets.List(context.TODO(), rulesets.RulesetListParams{
+ AccountID: cloudflare.F("string"),
+ ZoneID: cloudflare.F("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())
+ }
+}
+
+func TestRulesetDeleteWithOptionalParams(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"),
+ )
+ err := client.Rulesets.Delete(
+ context.TODO(),
+ "2f2feab2026849078ba485f918791bdc",
+ rulesets.RulesetDeleteParams{
+ AccountID: cloudflare.F("string"),
+ ZoneID: cloudflare.F("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())
+ }
+}
+
+func TestRulesetGetWithOptionalParams(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"),
+ )
+ _, err := client.Rulesets.Get(
+ context.TODO(),
+ "2f2feab2026849078ba485f918791bdc",
+ rulesets.RulesetGetParams{
+ AccountID: cloudflare.F("string"),
+ ZoneID: cloudflare.F("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/rulesets/version.go b/rulesets/version.go
new file mode 100644
index 00000000000..b9318d0c4eb
--- /dev/null
+++ b/rulesets/version.go
@@ -0,0 +1,483 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package rulesets
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// VersionService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewVersionService] method instead.
+type VersionService struct {
+ Options []option.RequestOption
+ ByTags *VersionByTagService
+}
+
+// NewVersionService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewVersionService(opts ...option.RequestOption) (r *VersionService) {
+ r = &VersionService{}
+ r.Options = opts
+ r.ByTags = NewVersionByTagService(opts...)
+ return
+}
+
+// Fetches the versions of an account or zone ruleset.
+func (r *VersionService) List(ctx context.Context, rulesetID string, query VersionListParams, opts ...option.RequestOption) (res *RulesetsRulesetsResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env VersionListResponseEnvelope
+ var accountOrZone string
+ var accountOrZoneID param.Field[string]
+ if query.AccountID.Present {
+ accountOrZone = "accounts"
+ accountOrZoneID = query.AccountID
+ } else {
+ accountOrZone = "zones"
+ accountOrZoneID = query.ZoneID
+ }
+ path := fmt.Sprintf("%s/%s/rulesets/%s/versions", accountOrZone, accountOrZoneID, rulesetID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Deletes an existing version of an account or zone ruleset.
+func (r *VersionService) Delete(ctx context.Context, rulesetID string, rulesetVersion string, body VersionDeleteParams, opts ...option.RequestOption) (err error) {
+ opts = append(r.Options[:], opts...)
+ opts = append([]option.RequestOption{option.WithHeader("Accept", "")}, opts...)
+ var accountOrZone string
+ var accountOrZoneID param.Field[string]
+ if body.AccountID.Present {
+ accountOrZone = "accounts"
+ accountOrZoneID = body.AccountID
+ } else {
+ accountOrZone = "zones"
+ accountOrZoneID = body.ZoneID
+ }
+ path := fmt.Sprintf("%s/%s/rulesets/%s/versions/%s", accountOrZone, accountOrZoneID, rulesetID, rulesetVersion)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, nil, opts...)
+ return
+}
+
+// Fetches a specific version of an account or zone ruleset.
+func (r *VersionService) Get(ctx context.Context, rulesetID string, rulesetVersion string, query VersionGetParams, opts ...option.RequestOption) (res *RulesetsRulesetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env VersionGetResponseEnvelope
+ var accountOrZone string
+ var accountOrZoneID param.Field[string]
+ if query.AccountID.Present {
+ accountOrZone = "accounts"
+ accountOrZoneID = query.AccountID
+ } else {
+ accountOrZone = "zones"
+ accountOrZoneID = query.ZoneID
+ }
+ path := fmt.Sprintf("%s/%s/rulesets/%s/versions/%s", accountOrZone, accountOrZoneID, rulesetID, rulesetVersion)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// A ruleset object.
+type VersionListResponse struct {
+ // The kind of the ruleset.
+ Kind VersionListResponseKind `json:"kind,required"`
+ // The human-readable name of the ruleset.
+ Name string `json:"name,required"`
+ // The phase of the ruleset.
+ Phase VersionListResponsePhase `json:"phase,required"`
+ // The unique ID of the ruleset.
+ ID string `json:"id"`
+ // An informative description of the ruleset.
+ Description string `json:"description"`
+ // The timestamp of when the ruleset was last modified.
+ LastUpdated time.Time `json:"last_updated" format:"date-time"`
+ // The version of the ruleset.
+ Version string `json:"version"`
+ JSON versionListResponseJSON `json:"-"`
+}
+
+// versionListResponseJSON contains the JSON metadata for the struct
+// [VersionListResponse]
+type versionListResponseJSON struct {
+ Kind apijson.Field
+ Name apijson.Field
+ Phase apijson.Field
+ ID apijson.Field
+ Description apijson.Field
+ LastUpdated apijson.Field
+ Version apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *VersionListResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r versionListResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+// The kind of the ruleset.
+type VersionListResponseKind string
+
+const (
+ VersionListResponseKindManaged VersionListResponseKind = "managed"
+ VersionListResponseKindCustom VersionListResponseKind = "custom"
+ VersionListResponseKindRoot VersionListResponseKind = "root"
+ VersionListResponseKindZone VersionListResponseKind = "zone"
+)
+
+// The phase of the ruleset.
+type VersionListResponsePhase string
+
+const (
+ VersionListResponsePhaseDDOSL4 VersionListResponsePhase = "ddos_l4"
+ VersionListResponsePhaseDDOSL7 VersionListResponsePhase = "ddos_l7"
+ VersionListResponsePhaseHTTPConfigSettings VersionListResponsePhase = "http_config_settings"
+ VersionListResponsePhaseHTTPCustomErrors VersionListResponsePhase = "http_custom_errors"
+ VersionListResponsePhaseHTTPLogCustomFields VersionListResponsePhase = "http_log_custom_fields"
+ VersionListResponsePhaseHTTPRatelimit VersionListResponsePhase = "http_ratelimit"
+ VersionListResponsePhaseHTTPRequestCacheSettings VersionListResponsePhase = "http_request_cache_settings"
+ VersionListResponsePhaseHTTPRequestDynamicRedirect VersionListResponsePhase = "http_request_dynamic_redirect"
+ VersionListResponsePhaseHTTPRequestFirewallCustom VersionListResponsePhase = "http_request_firewall_custom"
+ VersionListResponsePhaseHTTPRequestFirewallManaged VersionListResponsePhase = "http_request_firewall_managed"
+ VersionListResponsePhaseHTTPRequestLateTransform VersionListResponsePhase = "http_request_late_transform"
+ VersionListResponsePhaseHTTPRequestOrigin VersionListResponsePhase = "http_request_origin"
+ VersionListResponsePhaseHTTPRequestRedirect VersionListResponsePhase = "http_request_redirect"
+ VersionListResponsePhaseHTTPRequestSanitize VersionListResponsePhase = "http_request_sanitize"
+ VersionListResponsePhaseHTTPRequestSbfm VersionListResponsePhase = "http_request_sbfm"
+ VersionListResponsePhaseHTTPRequestSelectConfiguration VersionListResponsePhase = "http_request_select_configuration"
+ VersionListResponsePhaseHTTPRequestTransform VersionListResponsePhase = "http_request_transform"
+ VersionListResponsePhaseHTTPResponseCompression VersionListResponsePhase = "http_response_compression"
+ VersionListResponsePhaseHTTPResponseFirewallManaged VersionListResponsePhase = "http_response_firewall_managed"
+ VersionListResponsePhaseHTTPResponseHeadersTransform VersionListResponsePhase = "http_response_headers_transform"
+ VersionListResponsePhaseMagicTransit VersionListResponsePhase = "magic_transit"
+ VersionListResponsePhaseMagicTransitIDsManaged VersionListResponsePhase = "magic_transit_ids_managed"
+ VersionListResponsePhaseMagicTransitManaged VersionListResponsePhase = "magic_transit_managed"
+)
+
+type VersionListParams struct {
+ // The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+ AccountID param.Field[string] `path:"account_id"`
+ // The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+ ZoneID param.Field[string] `path:"zone_id"`
+}
+
+// A response object.
+type VersionListResponseEnvelope struct {
+ // A list of error messages.
+ Errors []VersionListResponseEnvelopeErrors `json:"errors,required"`
+ // A list of warning messages.
+ Messages []VersionListResponseEnvelopeMessages `json:"messages,required"`
+ // A result.
+ Result RulesetsRulesetsResponse `json:"result,required"`
+ // Whether the API call was successful.
+ Success VersionListResponseEnvelopeSuccess `json:"success,required"`
+ JSON versionListResponseEnvelopeJSON `json:"-"`
+}
+
+// versionListResponseEnvelopeJSON contains the JSON metadata for the struct
+// [VersionListResponseEnvelope]
+type versionListResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *VersionListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r versionListResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+// A message.
+type VersionListResponseEnvelopeErrors struct {
+ // A text description of this message.
+ Message string `json:"message,required"`
+ // A unique code for this message.
+ Code int64 `json:"code"`
+ // The source of this message.
+ Source VersionListResponseEnvelopeErrorsSource `json:"source"`
+ JSON versionListResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// versionListResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [VersionListResponseEnvelopeErrors]
+type versionListResponseEnvelopeErrorsJSON struct {
+ Message apijson.Field
+ Code apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *VersionListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r versionListResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+// The source of this message.
+type VersionListResponseEnvelopeErrorsSource struct {
+ // A JSON pointer to the field that is the source of the message.
+ Pointer string `json:"pointer,required"`
+ JSON versionListResponseEnvelopeErrorsSourceJSON `json:"-"`
+}
+
+// versionListResponseEnvelopeErrorsSourceJSON contains the JSON metadata for the
+// struct [VersionListResponseEnvelopeErrorsSource]
+type versionListResponseEnvelopeErrorsSourceJSON struct {
+ Pointer apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *VersionListResponseEnvelopeErrorsSource) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r versionListResponseEnvelopeErrorsSourceJSON) RawJSON() string {
+ return r.raw
+}
+
+// A message.
+type VersionListResponseEnvelopeMessages struct {
+ // A text description of this message.
+ Message string `json:"message,required"`
+ // A unique code for this message.
+ Code int64 `json:"code"`
+ // The source of this message.
+ Source VersionListResponseEnvelopeMessagesSource `json:"source"`
+ JSON versionListResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// versionListResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [VersionListResponseEnvelopeMessages]
+type versionListResponseEnvelopeMessagesJSON struct {
+ Message apijson.Field
+ Code apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *VersionListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r versionListResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// The source of this message.
+type VersionListResponseEnvelopeMessagesSource struct {
+ // A JSON pointer to the field that is the source of the message.
+ Pointer string `json:"pointer,required"`
+ JSON versionListResponseEnvelopeMessagesSourceJSON `json:"-"`
+}
+
+// versionListResponseEnvelopeMessagesSourceJSON contains the JSON metadata for the
+// struct [VersionListResponseEnvelopeMessagesSource]
+type versionListResponseEnvelopeMessagesSourceJSON struct {
+ Pointer apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *VersionListResponseEnvelopeMessagesSource) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r versionListResponseEnvelopeMessagesSourceJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful.
+type VersionListResponseEnvelopeSuccess bool
+
+const (
+ VersionListResponseEnvelopeSuccessTrue VersionListResponseEnvelopeSuccess = true
+)
+
+type VersionDeleteParams struct {
+ // The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+ AccountID param.Field[string] `path:"account_id"`
+ // The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+ ZoneID param.Field[string] `path:"zone_id"`
+}
+
+type VersionGetParams struct {
+ // The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
+ AccountID param.Field[string] `path:"account_id"`
+ // The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
+ ZoneID param.Field[string] `path:"zone_id"`
+}
+
+// A response object.
+type VersionGetResponseEnvelope struct {
+ // A list of error messages.
+ Errors []VersionGetResponseEnvelopeErrors `json:"errors,required"`
+ // A list of warning messages.
+ Messages []VersionGetResponseEnvelopeMessages `json:"messages,required"`
+ // A result.
+ Result RulesetsRulesetResponse `json:"result,required"`
+ // Whether the API call was successful.
+ Success VersionGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON versionGetResponseEnvelopeJSON `json:"-"`
+}
+
+// versionGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [VersionGetResponseEnvelope]
+type versionGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *VersionGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r versionGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+// A message.
+type VersionGetResponseEnvelopeErrors struct {
+ // A text description of this message.
+ Message string `json:"message,required"`
+ // A unique code for this message.
+ Code int64 `json:"code"`
+ // The source of this message.
+ Source VersionGetResponseEnvelopeErrorsSource `json:"source"`
+ JSON versionGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// versionGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [VersionGetResponseEnvelopeErrors]
+type versionGetResponseEnvelopeErrorsJSON struct {
+ Message apijson.Field
+ Code apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *VersionGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r versionGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+// The source of this message.
+type VersionGetResponseEnvelopeErrorsSource struct {
+ // A JSON pointer to the field that is the source of the message.
+ Pointer string `json:"pointer,required"`
+ JSON versionGetResponseEnvelopeErrorsSourceJSON `json:"-"`
+}
+
+// versionGetResponseEnvelopeErrorsSourceJSON contains the JSON metadata for the
+// struct [VersionGetResponseEnvelopeErrorsSource]
+type versionGetResponseEnvelopeErrorsSourceJSON struct {
+ Pointer apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *VersionGetResponseEnvelopeErrorsSource) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r versionGetResponseEnvelopeErrorsSourceJSON) RawJSON() string {
+ return r.raw
+}
+
+// A message.
+type VersionGetResponseEnvelopeMessages struct {
+ // A text description of this message.
+ Message string `json:"message,required"`
+ // A unique code for this message.
+ Code int64 `json:"code"`
+ // The source of this message.
+ Source VersionGetResponseEnvelopeMessagesSource `json:"source"`
+ JSON versionGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// versionGetResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [VersionGetResponseEnvelopeMessages]
+type versionGetResponseEnvelopeMessagesJSON struct {
+ Message apijson.Field
+ Code apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *VersionGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r versionGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// The source of this message.
+type VersionGetResponseEnvelopeMessagesSource struct {
+ // A JSON pointer to the field that is the source of the message.
+ Pointer string `json:"pointer,required"`
+ JSON versionGetResponseEnvelopeMessagesSourceJSON `json:"-"`
+}
+
+// versionGetResponseEnvelopeMessagesSourceJSON contains the JSON metadata for the
+// struct [VersionGetResponseEnvelopeMessagesSource]
+type versionGetResponseEnvelopeMessagesSourceJSON struct {
+ Pointer apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *VersionGetResponseEnvelopeMessagesSource) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r versionGetResponseEnvelopeMessagesSourceJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful.
+type VersionGetResponseEnvelopeSuccess bool
+
+const (
+ VersionGetResponseEnvelopeSuccessTrue VersionGetResponseEnvelopeSuccess = true
+)
diff --git a/rulesets/version_test.go b/rulesets/version_test.go
new file mode 100644
index 00000000000..0de008b4ec0
--- /dev/null
+++ b/rulesets/version_test.go
@@ -0,0 +1,110 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package rulesets_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/rulesets"
+)
+
+func TestVersionListWithOptionalParams(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"),
+ )
+ _, err := client.Rulesets.Versions.List(
+ context.TODO(),
+ "2f2feab2026849078ba485f918791bdc",
+ rulesets.VersionListParams{
+ AccountID: cloudflare.F("string"),
+ ZoneID: cloudflare.F("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())
+ }
+}
+
+func TestVersionDeleteWithOptionalParams(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"),
+ )
+ err := client.Rulesets.Versions.Delete(
+ context.TODO(),
+ "2f2feab2026849078ba485f918791bdc",
+ "1",
+ rulesets.VersionDeleteParams{
+ AccountID: cloudflare.F("string"),
+ ZoneID: cloudflare.F("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())
+ }
+}
+
+func TestVersionGetWithOptionalParams(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"),
+ )
+ _, err := client.Rulesets.Versions.Get(
+ context.TODO(),
+ "2f2feab2026849078ba485f918791bdc",
+ "1",
+ rulesets.VersionGetParams{
+ AccountID: cloudflare.F("string"),
+ ZoneID: cloudflare.F("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/rulesets/versionbytag.go b/rulesets/versionbytag.go
new file mode 100644
index 00000000000..a56ce9d6e10
--- /dev/null
+++ b/rulesets/versionbytag.go
@@ -0,0 +1,193 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package rulesets
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// VersionByTagService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewVersionByTagService] method
+// instead.
+type VersionByTagService struct {
+ Options []option.RequestOption
+}
+
+// NewVersionByTagService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewVersionByTagService(opts ...option.RequestOption) (r *VersionByTagService) {
+ r = &VersionByTagService{}
+ r.Options = opts
+ return
+}
+
+// Fetches the rules of a managed account ruleset version for a given tag.
+func (r *VersionByTagService) Get(ctx context.Context, rulesetID string, rulesetVersion string, ruleTag string, query VersionByTagGetParams, opts ...option.RequestOption) (res *RulesetsRulesetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env VersionByTagGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/rulesets/%s/versions/%s/by_tag/%s", query.AccountID, rulesetID, rulesetVersion, ruleTag)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type VersionByTagGetParams struct {
+ // The unique ID of the account.
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+// A response object.
+type VersionByTagGetResponseEnvelope struct {
+ // A list of error messages.
+ Errors []VersionByTagGetResponseEnvelopeErrors `json:"errors,required"`
+ // A list of warning messages.
+ Messages []VersionByTagGetResponseEnvelopeMessages `json:"messages,required"`
+ // A result.
+ Result RulesetsRulesetResponse `json:"result,required"`
+ // Whether the API call was successful.
+ Success VersionByTagGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON versionByTagGetResponseEnvelopeJSON `json:"-"`
+}
+
+// versionByTagGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [VersionByTagGetResponseEnvelope]
+type versionByTagGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *VersionByTagGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r versionByTagGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+// A message.
+type VersionByTagGetResponseEnvelopeErrors struct {
+ // A text description of this message.
+ Message string `json:"message,required"`
+ // A unique code for this message.
+ Code int64 `json:"code"`
+ // The source of this message.
+ Source VersionByTagGetResponseEnvelopeErrorsSource `json:"source"`
+ JSON versionByTagGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// versionByTagGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [VersionByTagGetResponseEnvelopeErrors]
+type versionByTagGetResponseEnvelopeErrorsJSON struct {
+ Message apijson.Field
+ Code apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *VersionByTagGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r versionByTagGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+// The source of this message.
+type VersionByTagGetResponseEnvelopeErrorsSource struct {
+ // A JSON pointer to the field that is the source of the message.
+ Pointer string `json:"pointer,required"`
+ JSON versionByTagGetResponseEnvelopeErrorsSourceJSON `json:"-"`
+}
+
+// versionByTagGetResponseEnvelopeErrorsSourceJSON contains the JSON metadata for
+// the struct [VersionByTagGetResponseEnvelopeErrorsSource]
+type versionByTagGetResponseEnvelopeErrorsSourceJSON struct {
+ Pointer apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *VersionByTagGetResponseEnvelopeErrorsSource) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r versionByTagGetResponseEnvelopeErrorsSourceJSON) RawJSON() string {
+ return r.raw
+}
+
+// A message.
+type VersionByTagGetResponseEnvelopeMessages struct {
+ // A text description of this message.
+ Message string `json:"message,required"`
+ // A unique code for this message.
+ Code int64 `json:"code"`
+ // The source of this message.
+ Source VersionByTagGetResponseEnvelopeMessagesSource `json:"source"`
+ JSON versionByTagGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// versionByTagGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [VersionByTagGetResponseEnvelopeMessages]
+type versionByTagGetResponseEnvelopeMessagesJSON struct {
+ Message apijson.Field
+ Code apijson.Field
+ Source apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *VersionByTagGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r versionByTagGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// The source of this message.
+type VersionByTagGetResponseEnvelopeMessagesSource struct {
+ // A JSON pointer to the field that is the source of the message.
+ Pointer string `json:"pointer,required"`
+ JSON versionByTagGetResponseEnvelopeMessagesSourceJSON `json:"-"`
+}
+
+// versionByTagGetResponseEnvelopeMessagesSourceJSON contains the JSON metadata for
+// the struct [VersionByTagGetResponseEnvelopeMessagesSource]
+type versionByTagGetResponseEnvelopeMessagesSourceJSON struct {
+ Pointer apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *VersionByTagGetResponseEnvelopeMessagesSource) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r versionByTagGetResponseEnvelopeMessagesSourceJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful.
+type VersionByTagGetResponseEnvelopeSuccess bool
+
+const (
+ VersionByTagGetResponseEnvelopeSuccessTrue VersionByTagGetResponseEnvelopeSuccess = true
+)
diff --git a/rulesets/versionbytag_test.go b/rulesets/versionbytag_test.go
new file mode 100644
index 00000000000..b0ac57a9538
--- /dev/null
+++ b/rulesets/versionbytag_test.go
@@ -0,0 +1,47 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package rulesets_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/rulesets"
+)
+
+func TestVersionByTagGet(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"),
+ )
+ _, err := client.Rulesets.Versions.ByTags.Get(
+ context.TODO(),
+ "2f2feab2026849078ba485f918791bdc",
+ "1",
+ "directory-traversal",
+ rulesets.VersionByTagGetParams{
+ AccountID: cloudflare.F("abf9b32d38c5f572afde3336ec0ce302"),
+ },
+ )
+ 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/rulesetversion.go b/rulesetversion.go
deleted file mode 100644
index 0205917cde1..00000000000
--- a/rulesetversion.go
+++ /dev/null
@@ -1,1280 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "reflect"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
- "github.com/tidwall/gjson"
-)
-
-// RulesetVersionService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewRulesetVersionService] method
-// instead.
-type RulesetVersionService struct {
- Options []option.RequestOption
- ByTags *RulesetVersionByTagService
-}
-
-// NewRulesetVersionService generates a new service that applies the given options
-// to each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewRulesetVersionService(opts ...option.RequestOption) (r *RulesetVersionService) {
- r = &RulesetVersionService{}
- r.Options = opts
- r.ByTags = NewRulesetVersionByTagService(opts...)
- return
-}
-
-// Fetches the versions of an account or zone ruleset.
-func (r *RulesetVersionService) List(ctx context.Context, rulesetID string, query RulesetVersionListParams, opts ...option.RequestOption) (res *[]RulesetVersionListResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RulesetVersionListResponseEnvelope
- var accountOrZone string
- var accountOrZoneID param.Field[string]
- if query.AccountID.Present {
- accountOrZone = "accounts"
- accountOrZoneID = query.AccountID
- } else {
- accountOrZone = "zones"
- accountOrZoneID = query.ZoneID
- }
- path := fmt.Sprintf("%s/%s/rulesets/%s/versions", accountOrZone, accountOrZoneID, rulesetID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Deletes an existing version of an account or zone ruleset.
-func (r *RulesetVersionService) Delete(ctx context.Context, rulesetID string, rulesetVersion string, body RulesetVersionDeleteParams, opts ...option.RequestOption) (err error) {
- opts = append(r.Options[:], opts...)
- opts = append([]option.RequestOption{option.WithHeader("Accept", "")}, opts...)
- var accountOrZone string
- var accountOrZoneID param.Field[string]
- if body.AccountID.Present {
- accountOrZone = "accounts"
- accountOrZoneID = body.AccountID
- } else {
- accountOrZone = "zones"
- accountOrZoneID = body.ZoneID
- }
- path := fmt.Sprintf("%s/%s/rulesets/%s/versions/%s", accountOrZone, accountOrZoneID, rulesetID, rulesetVersion)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, nil, opts...)
- return
-}
-
-// Fetches a specific version of an account or zone ruleset.
-func (r *RulesetVersionService) Get(ctx context.Context, rulesetID string, rulesetVersion string, query RulesetVersionGetParams, opts ...option.RequestOption) (res *RulesetVersionGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RulesetVersionGetResponseEnvelope
- var accountOrZone string
- var accountOrZoneID param.Field[string]
- if query.AccountID.Present {
- accountOrZone = "accounts"
- accountOrZoneID = query.AccountID
- } else {
- accountOrZone = "zones"
- accountOrZoneID = query.ZoneID
- }
- path := fmt.Sprintf("%s/%s/rulesets/%s/versions/%s", accountOrZone, accountOrZoneID, rulesetID, rulesetVersion)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// A ruleset object.
-type RulesetVersionListResponse struct {
- // The kind of the ruleset.
- Kind RulesetVersionListResponseKind `json:"kind,required"`
- // The human-readable name of the ruleset.
- Name string `json:"name,required"`
- // The phase of the ruleset.
- Phase RulesetVersionListResponsePhase `json:"phase,required"`
- // The unique ID of the ruleset.
- ID string `json:"id"`
- // An informative description of the ruleset.
- Description string `json:"description"`
- // The timestamp of when the ruleset was last modified.
- LastUpdated time.Time `json:"last_updated" format:"date-time"`
- // The version of the ruleset.
- Version string `json:"version"`
- JSON rulesetVersionListResponseJSON `json:"-"`
-}
-
-// rulesetVersionListResponseJSON contains the JSON metadata for the struct
-// [RulesetVersionListResponse]
-type rulesetVersionListResponseJSON struct {
- Kind apijson.Field
- Name apijson.Field
- Phase apijson.Field
- ID apijson.Field
- Description apijson.Field
- LastUpdated apijson.Field
- Version apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetVersionListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetVersionListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// The kind of the ruleset.
-type RulesetVersionListResponseKind string
-
-const (
- RulesetVersionListResponseKindManaged RulesetVersionListResponseKind = "managed"
- RulesetVersionListResponseKindCustom RulesetVersionListResponseKind = "custom"
- RulesetVersionListResponseKindRoot RulesetVersionListResponseKind = "root"
- RulesetVersionListResponseKindZone RulesetVersionListResponseKind = "zone"
-)
-
-// The phase of the ruleset.
-type RulesetVersionListResponsePhase string
-
-const (
- RulesetVersionListResponsePhaseDDOSL4 RulesetVersionListResponsePhase = "ddos_l4"
- RulesetVersionListResponsePhaseDDOSL7 RulesetVersionListResponsePhase = "ddos_l7"
- RulesetVersionListResponsePhaseHTTPConfigSettings RulesetVersionListResponsePhase = "http_config_settings"
- RulesetVersionListResponsePhaseHTTPCustomErrors RulesetVersionListResponsePhase = "http_custom_errors"
- RulesetVersionListResponsePhaseHTTPLogCustomFields RulesetVersionListResponsePhase = "http_log_custom_fields"
- RulesetVersionListResponsePhaseHTTPRatelimit RulesetVersionListResponsePhase = "http_ratelimit"
- RulesetVersionListResponsePhaseHTTPRequestCacheSettings RulesetVersionListResponsePhase = "http_request_cache_settings"
- RulesetVersionListResponsePhaseHTTPRequestDynamicRedirect RulesetVersionListResponsePhase = "http_request_dynamic_redirect"
- RulesetVersionListResponsePhaseHTTPRequestFirewallCustom RulesetVersionListResponsePhase = "http_request_firewall_custom"
- RulesetVersionListResponsePhaseHTTPRequestFirewallManaged RulesetVersionListResponsePhase = "http_request_firewall_managed"
- RulesetVersionListResponsePhaseHTTPRequestLateTransform RulesetVersionListResponsePhase = "http_request_late_transform"
- RulesetVersionListResponsePhaseHTTPRequestOrigin RulesetVersionListResponsePhase = "http_request_origin"
- RulesetVersionListResponsePhaseHTTPRequestRedirect RulesetVersionListResponsePhase = "http_request_redirect"
- RulesetVersionListResponsePhaseHTTPRequestSanitize RulesetVersionListResponsePhase = "http_request_sanitize"
- RulesetVersionListResponsePhaseHTTPRequestSbfm RulesetVersionListResponsePhase = "http_request_sbfm"
- RulesetVersionListResponsePhaseHTTPRequestSelectConfiguration RulesetVersionListResponsePhase = "http_request_select_configuration"
- RulesetVersionListResponsePhaseHTTPRequestTransform RulesetVersionListResponsePhase = "http_request_transform"
- RulesetVersionListResponsePhaseHTTPResponseCompression RulesetVersionListResponsePhase = "http_response_compression"
- RulesetVersionListResponsePhaseHTTPResponseFirewallManaged RulesetVersionListResponsePhase = "http_response_firewall_managed"
- RulesetVersionListResponsePhaseHTTPResponseHeadersTransform RulesetVersionListResponsePhase = "http_response_headers_transform"
- RulesetVersionListResponsePhaseMagicTransit RulesetVersionListResponsePhase = "magic_transit"
- RulesetVersionListResponsePhaseMagicTransitIDsManaged RulesetVersionListResponsePhase = "magic_transit_ids_managed"
- RulesetVersionListResponsePhaseMagicTransitManaged RulesetVersionListResponsePhase = "magic_transit_managed"
-)
-
-// A result.
-type RulesetVersionGetResponse struct {
- // The unique ID of the ruleset.
- ID string `json:"id,required"`
- // The kind of the ruleset.
- Kind RulesetVersionGetResponseKind `json:"kind,required"`
- // The timestamp of when the ruleset was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The human-readable name of the ruleset.
- Name string `json:"name,required"`
- // The phase of the ruleset.
- Phase RulesetVersionGetResponsePhase `json:"phase,required"`
- // The list of rules in the ruleset.
- Rules []RulesetVersionGetResponseRule `json:"rules,required"`
- // The version of the ruleset.
- Version string `json:"version,required"`
- // An informative description of the ruleset.
- Description string `json:"description"`
- JSON rulesetVersionGetResponseJSON `json:"-"`
-}
-
-// rulesetVersionGetResponseJSON contains the JSON metadata for the struct
-// [RulesetVersionGetResponse]
-type rulesetVersionGetResponseJSON struct {
- ID apijson.Field
- Kind apijson.Field
- LastUpdated apijson.Field
- Name apijson.Field
- Phase apijson.Field
- Rules apijson.Field
- Version apijson.Field
- Description apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetVersionGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetVersionGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// The kind of the ruleset.
-type RulesetVersionGetResponseKind string
-
-const (
- RulesetVersionGetResponseKindManaged RulesetVersionGetResponseKind = "managed"
- RulesetVersionGetResponseKindCustom RulesetVersionGetResponseKind = "custom"
- RulesetVersionGetResponseKindRoot RulesetVersionGetResponseKind = "root"
- RulesetVersionGetResponseKindZone RulesetVersionGetResponseKind = "zone"
-)
-
-// The phase of the ruleset.
-type RulesetVersionGetResponsePhase string
-
-const (
- RulesetVersionGetResponsePhaseDDOSL4 RulesetVersionGetResponsePhase = "ddos_l4"
- RulesetVersionGetResponsePhaseDDOSL7 RulesetVersionGetResponsePhase = "ddos_l7"
- RulesetVersionGetResponsePhaseHTTPConfigSettings RulesetVersionGetResponsePhase = "http_config_settings"
- RulesetVersionGetResponsePhaseHTTPCustomErrors RulesetVersionGetResponsePhase = "http_custom_errors"
- RulesetVersionGetResponsePhaseHTTPLogCustomFields RulesetVersionGetResponsePhase = "http_log_custom_fields"
- RulesetVersionGetResponsePhaseHTTPRatelimit RulesetVersionGetResponsePhase = "http_ratelimit"
- RulesetVersionGetResponsePhaseHTTPRequestCacheSettings RulesetVersionGetResponsePhase = "http_request_cache_settings"
- RulesetVersionGetResponsePhaseHTTPRequestDynamicRedirect RulesetVersionGetResponsePhase = "http_request_dynamic_redirect"
- RulesetVersionGetResponsePhaseHTTPRequestFirewallCustom RulesetVersionGetResponsePhase = "http_request_firewall_custom"
- RulesetVersionGetResponsePhaseHTTPRequestFirewallManaged RulesetVersionGetResponsePhase = "http_request_firewall_managed"
- RulesetVersionGetResponsePhaseHTTPRequestLateTransform RulesetVersionGetResponsePhase = "http_request_late_transform"
- RulesetVersionGetResponsePhaseHTTPRequestOrigin RulesetVersionGetResponsePhase = "http_request_origin"
- RulesetVersionGetResponsePhaseHTTPRequestRedirect RulesetVersionGetResponsePhase = "http_request_redirect"
- RulesetVersionGetResponsePhaseHTTPRequestSanitize RulesetVersionGetResponsePhase = "http_request_sanitize"
- RulesetVersionGetResponsePhaseHTTPRequestSbfm RulesetVersionGetResponsePhase = "http_request_sbfm"
- RulesetVersionGetResponsePhaseHTTPRequestSelectConfiguration RulesetVersionGetResponsePhase = "http_request_select_configuration"
- RulesetVersionGetResponsePhaseHTTPRequestTransform RulesetVersionGetResponsePhase = "http_request_transform"
- RulesetVersionGetResponsePhaseHTTPResponseCompression RulesetVersionGetResponsePhase = "http_response_compression"
- RulesetVersionGetResponsePhaseHTTPResponseFirewallManaged RulesetVersionGetResponsePhase = "http_response_firewall_managed"
- RulesetVersionGetResponsePhaseHTTPResponseHeadersTransform RulesetVersionGetResponsePhase = "http_response_headers_transform"
- RulesetVersionGetResponsePhaseMagicTransit RulesetVersionGetResponsePhase = "magic_transit"
- RulesetVersionGetResponsePhaseMagicTransitIDsManaged RulesetVersionGetResponsePhase = "magic_transit_ids_managed"
- RulesetVersionGetResponsePhaseMagicTransitManaged RulesetVersionGetResponsePhase = "magic_transit_managed"
-)
-
-// Union satisfied by [RulesetVersionGetResponseRulesRulesetsBlockRule],
-// [RulesetVersionGetResponseRulesRulesetsExecuteRule],
-// [RulesetVersionGetResponseRulesRulesetsLogRule] or
-// [RulesetVersionGetResponseRulesRulesetsSkipRule].
-type RulesetVersionGetResponseRule interface {
- implementsRulesetVersionGetResponseRule()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*RulesetVersionGetResponseRule)(nil)).Elem(),
- "action",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(RulesetVersionGetResponseRulesRulesetsBlockRule{}),
- DiscriminatorValue: "block",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(RulesetVersionGetResponseRulesRulesetsExecuteRule{}),
- DiscriminatorValue: "execute",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(RulesetVersionGetResponseRulesRulesetsLogRule{}),
- DiscriminatorValue: "log",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(RulesetVersionGetResponseRulesRulesetsSkipRule{}),
- DiscriminatorValue: "skip",
- },
- )
-}
-
-type RulesetVersionGetResponseRulesRulesetsBlockRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action RulesetVersionGetResponseRulesRulesetsBlockRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters RulesetVersionGetResponseRulesRulesetsBlockRuleActionParameters `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging RulesetVersionGetResponseRulesRulesetsBlockRuleLogging `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON rulesetVersionGetResponseRulesRulesetsBlockRuleJSON `json:"-"`
-}
-
-// rulesetVersionGetResponseRulesRulesetsBlockRuleJSON contains the JSON metadata
-// for the struct [RulesetVersionGetResponseRulesRulesetsBlockRule]
-type rulesetVersionGetResponseRulesRulesetsBlockRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetVersionGetResponseRulesRulesetsBlockRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetVersionGetResponseRulesRulesetsBlockRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r RulesetVersionGetResponseRulesRulesetsBlockRule) implementsRulesetVersionGetResponseRule() {}
-
-// The action to perform when the rule matches.
-type RulesetVersionGetResponseRulesRulesetsBlockRuleAction string
-
-const (
- RulesetVersionGetResponseRulesRulesetsBlockRuleActionBlock RulesetVersionGetResponseRulesRulesetsBlockRuleAction = "block"
-)
-
-// The parameters configuring the rule's action.
-type RulesetVersionGetResponseRulesRulesetsBlockRuleActionParameters struct {
- // The response to show when the block is applied.
- Response RulesetVersionGetResponseRulesRulesetsBlockRuleActionParametersResponse `json:"response"`
- JSON rulesetVersionGetResponseRulesRulesetsBlockRuleActionParametersJSON `json:"-"`
-}
-
-// rulesetVersionGetResponseRulesRulesetsBlockRuleActionParametersJSON contains the
-// JSON metadata for the struct
-// [RulesetVersionGetResponseRulesRulesetsBlockRuleActionParameters]
-type rulesetVersionGetResponseRulesRulesetsBlockRuleActionParametersJSON struct {
- Response apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetVersionGetResponseRulesRulesetsBlockRuleActionParameters) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetVersionGetResponseRulesRulesetsBlockRuleActionParametersJSON) RawJSON() string {
- return r.raw
-}
-
-// The response to show when the block is applied.
-type RulesetVersionGetResponseRulesRulesetsBlockRuleActionParametersResponse struct {
- // The content to return.
- Content string `json:"content,required"`
- // The type of the content to return.
- ContentType string `json:"content_type,required"`
- // The status code to return.
- StatusCode int64 `json:"status_code,required"`
- JSON rulesetVersionGetResponseRulesRulesetsBlockRuleActionParametersResponseJSON `json:"-"`
-}
-
-// rulesetVersionGetResponseRulesRulesetsBlockRuleActionParametersResponseJSON
-// contains the JSON metadata for the struct
-// [RulesetVersionGetResponseRulesRulesetsBlockRuleActionParametersResponse]
-type rulesetVersionGetResponseRulesRulesetsBlockRuleActionParametersResponseJSON struct {
- Content apijson.Field
- ContentType apijson.Field
- StatusCode apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetVersionGetResponseRulesRulesetsBlockRuleActionParametersResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetVersionGetResponseRulesRulesetsBlockRuleActionParametersResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// An object configuring the rule's logging behavior.
-type RulesetVersionGetResponseRulesRulesetsBlockRuleLogging struct {
- // Whether to generate a log when the rule matches.
- Enabled bool `json:"enabled,required"`
- JSON rulesetVersionGetResponseRulesRulesetsBlockRuleLoggingJSON `json:"-"`
-}
-
-// rulesetVersionGetResponseRulesRulesetsBlockRuleLoggingJSON contains the JSON
-// metadata for the struct [RulesetVersionGetResponseRulesRulesetsBlockRuleLogging]
-type rulesetVersionGetResponseRulesRulesetsBlockRuleLoggingJSON struct {
- Enabled apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetVersionGetResponseRulesRulesetsBlockRuleLogging) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetVersionGetResponseRulesRulesetsBlockRuleLoggingJSON) RawJSON() string {
- return r.raw
-}
-
-type RulesetVersionGetResponseRulesRulesetsExecuteRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action RulesetVersionGetResponseRulesRulesetsExecuteRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters RulesetVersionGetResponseRulesRulesetsExecuteRuleActionParameters `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging RulesetVersionGetResponseRulesRulesetsExecuteRuleLogging `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON rulesetVersionGetResponseRulesRulesetsExecuteRuleJSON `json:"-"`
-}
-
-// rulesetVersionGetResponseRulesRulesetsExecuteRuleJSON contains the JSON metadata
-// for the struct [RulesetVersionGetResponseRulesRulesetsExecuteRule]
-type rulesetVersionGetResponseRulesRulesetsExecuteRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetVersionGetResponseRulesRulesetsExecuteRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetVersionGetResponseRulesRulesetsExecuteRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r RulesetVersionGetResponseRulesRulesetsExecuteRule) implementsRulesetVersionGetResponseRule() {
-}
-
-// The action to perform when the rule matches.
-type RulesetVersionGetResponseRulesRulesetsExecuteRuleAction string
-
-const (
- RulesetVersionGetResponseRulesRulesetsExecuteRuleActionExecute RulesetVersionGetResponseRulesRulesetsExecuteRuleAction = "execute"
-)
-
-// The parameters configuring the rule's action.
-type RulesetVersionGetResponseRulesRulesetsExecuteRuleActionParameters struct {
- // The ID of the ruleset to execute.
- ID string `json:"id,required"`
- // The configuration to use for matched data logging.
- MatchedData RulesetVersionGetResponseRulesRulesetsExecuteRuleActionParametersMatchedData `json:"matched_data"`
- // A set of overrides to apply to the target ruleset.
- Overrides RulesetVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverrides `json:"overrides"`
- JSON rulesetVersionGetResponseRulesRulesetsExecuteRuleActionParametersJSON `json:"-"`
-}
-
-// rulesetVersionGetResponseRulesRulesetsExecuteRuleActionParametersJSON contains
-// the JSON metadata for the struct
-// [RulesetVersionGetResponseRulesRulesetsExecuteRuleActionParameters]
-type rulesetVersionGetResponseRulesRulesetsExecuteRuleActionParametersJSON struct {
- ID apijson.Field
- MatchedData apijson.Field
- Overrides apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetVersionGetResponseRulesRulesetsExecuteRuleActionParameters) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetVersionGetResponseRulesRulesetsExecuteRuleActionParametersJSON) RawJSON() string {
- return r.raw
-}
-
-// The configuration to use for matched data logging.
-type RulesetVersionGetResponseRulesRulesetsExecuteRuleActionParametersMatchedData struct {
- // The public key to encrypt matched data logs with.
- PublicKey string `json:"public_key,required"`
- JSON rulesetVersionGetResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON `json:"-"`
-}
-
-// rulesetVersionGetResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON
-// contains the JSON metadata for the struct
-// [RulesetVersionGetResponseRulesRulesetsExecuteRuleActionParametersMatchedData]
-type rulesetVersionGetResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON struct {
- PublicKey apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetVersionGetResponseRulesRulesetsExecuteRuleActionParametersMatchedData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetVersionGetResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON) RawJSON() string {
- return r.raw
-}
-
-// A set of overrides to apply to the target ruleset.
-type RulesetVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverrides struct {
- // An action to override all rules with. This option has lower precedence than rule
- // and category overrides.
- Action string `json:"action"`
- // A list of category-level overrides. This option has the second-highest
- // precedence after rule-level overrides.
- Categories []RulesetVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory `json:"categories"`
- // Whether to enable execution of all rules. This option has lower precedence than
- // rule and category overrides.
- Enabled bool `json:"enabled"`
- // A list of rule-level overrides. This option has the highest precedence.
- Rules []RulesetVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRule `json:"rules"`
- // A sensitivity level to set for all rules. This option has lower precedence than
- // rule and category overrides and is only applicable for DDoS phases.
- SensitivityLevel RulesetVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel `json:"sensitivity_level"`
- JSON rulesetVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON `json:"-"`
-}
-
-// rulesetVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON
-// contains the JSON metadata for the struct
-// [RulesetVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverrides]
-type rulesetVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON struct {
- Action apijson.Field
- Categories apijson.Field
- Enabled apijson.Field
- Rules apijson.Field
- SensitivityLevel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverrides) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON) RawJSON() string {
- return r.raw
-}
-
-// A category-level override
-type RulesetVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory struct {
- // The name of the category to override.
- Category string `json:"category,required"`
- // The action to override rules in the category with.
- Action string `json:"action"`
- // Whether to enable execution of rules in the category.
- Enabled bool `json:"enabled"`
- // The sensitivity level to use for rules in the category.
- SensitivityLevel RulesetVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel `json:"sensitivity_level"`
- JSON rulesetVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON `json:"-"`
-}
-
-// rulesetVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON
-// contains the JSON metadata for the struct
-// [RulesetVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory]
-type rulesetVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON struct {
- Category apijson.Field
- Action apijson.Field
- Enabled apijson.Field
- SensitivityLevel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON) RawJSON() string {
- return r.raw
-}
-
-// The sensitivity level to use for rules in the category.
-type RulesetVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel string
-
-const (
- RulesetVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault RulesetVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "default"
- RulesetVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium RulesetVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "medium"
- RulesetVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow RulesetVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "low"
- RulesetVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff RulesetVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "eoff"
-)
-
-// A rule-level override
-type RulesetVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRule struct {
- // The ID of the rule to override.
- ID string `json:"id,required"`
- // The action to override the rule with.
- Action string `json:"action"`
- // Whether to enable execution of the rule.
- Enabled bool `json:"enabled"`
- // The score threshold to use for the rule.
- ScoreThreshold int64 `json:"score_threshold"`
- // The sensitivity level to use for the rule.
- SensitivityLevel RulesetVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel `json:"sensitivity_level"`
- JSON rulesetVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON `json:"-"`
-}
-
-// rulesetVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON
-// contains the JSON metadata for the struct
-// [RulesetVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRule]
-type rulesetVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON struct {
- ID apijson.Field
- Action apijson.Field
- Enabled apijson.Field
- ScoreThreshold apijson.Field
- SensitivityLevel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON) RawJSON() string {
- return r.raw
-}
-
-// The sensitivity level to use for the rule.
-type RulesetVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel string
-
-const (
- RulesetVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault RulesetVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "default"
- RulesetVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium RulesetVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "medium"
- RulesetVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelLow RulesetVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "low"
- RulesetVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff RulesetVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "eoff"
-)
-
-// A sensitivity level to set for all rules. This option has lower precedence than
-// rule and category overrides and is only applicable for DDoS phases.
-type RulesetVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel string
-
-const (
- RulesetVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelDefault RulesetVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "default"
- RulesetVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelMedium RulesetVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "medium"
- RulesetVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelLow RulesetVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "low"
- RulesetVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelEoff RulesetVersionGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "eoff"
-)
-
-// An object configuring the rule's logging behavior.
-type RulesetVersionGetResponseRulesRulesetsExecuteRuleLogging struct {
- // Whether to generate a log when the rule matches.
- Enabled bool `json:"enabled,required"`
- JSON rulesetVersionGetResponseRulesRulesetsExecuteRuleLoggingJSON `json:"-"`
-}
-
-// rulesetVersionGetResponseRulesRulesetsExecuteRuleLoggingJSON contains the JSON
-// metadata for the struct
-// [RulesetVersionGetResponseRulesRulesetsExecuteRuleLogging]
-type rulesetVersionGetResponseRulesRulesetsExecuteRuleLoggingJSON struct {
- Enabled apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetVersionGetResponseRulesRulesetsExecuteRuleLogging) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetVersionGetResponseRulesRulesetsExecuteRuleLoggingJSON) RawJSON() string {
- return r.raw
-}
-
-type RulesetVersionGetResponseRulesRulesetsLogRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action RulesetVersionGetResponseRulesRulesetsLogRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters interface{} `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging RulesetVersionGetResponseRulesRulesetsLogRuleLogging `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON rulesetVersionGetResponseRulesRulesetsLogRuleJSON `json:"-"`
-}
-
-// rulesetVersionGetResponseRulesRulesetsLogRuleJSON contains the JSON metadata for
-// the struct [RulesetVersionGetResponseRulesRulesetsLogRule]
-type rulesetVersionGetResponseRulesRulesetsLogRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetVersionGetResponseRulesRulesetsLogRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetVersionGetResponseRulesRulesetsLogRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r RulesetVersionGetResponseRulesRulesetsLogRule) implementsRulesetVersionGetResponseRule() {}
-
-// The action to perform when the rule matches.
-type RulesetVersionGetResponseRulesRulesetsLogRuleAction string
-
-const (
- RulesetVersionGetResponseRulesRulesetsLogRuleActionLog RulesetVersionGetResponseRulesRulesetsLogRuleAction = "log"
-)
-
-// An object configuring the rule's logging behavior.
-type RulesetVersionGetResponseRulesRulesetsLogRuleLogging struct {
- // Whether to generate a log when the rule matches.
- Enabled bool `json:"enabled,required"`
- JSON rulesetVersionGetResponseRulesRulesetsLogRuleLoggingJSON `json:"-"`
-}
-
-// rulesetVersionGetResponseRulesRulesetsLogRuleLoggingJSON contains the JSON
-// metadata for the struct [RulesetVersionGetResponseRulesRulesetsLogRuleLogging]
-type rulesetVersionGetResponseRulesRulesetsLogRuleLoggingJSON struct {
- Enabled apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetVersionGetResponseRulesRulesetsLogRuleLogging) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetVersionGetResponseRulesRulesetsLogRuleLoggingJSON) RawJSON() string {
- return r.raw
-}
-
-type RulesetVersionGetResponseRulesRulesetsSkipRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action RulesetVersionGetResponseRulesRulesetsSkipRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters RulesetVersionGetResponseRulesRulesetsSkipRuleActionParameters `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging RulesetVersionGetResponseRulesRulesetsSkipRuleLogging `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON rulesetVersionGetResponseRulesRulesetsSkipRuleJSON `json:"-"`
-}
-
-// rulesetVersionGetResponseRulesRulesetsSkipRuleJSON contains the JSON metadata
-// for the struct [RulesetVersionGetResponseRulesRulesetsSkipRule]
-type rulesetVersionGetResponseRulesRulesetsSkipRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetVersionGetResponseRulesRulesetsSkipRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetVersionGetResponseRulesRulesetsSkipRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r RulesetVersionGetResponseRulesRulesetsSkipRule) implementsRulesetVersionGetResponseRule() {}
-
-// The action to perform when the rule matches.
-type RulesetVersionGetResponseRulesRulesetsSkipRuleAction string
-
-const (
- RulesetVersionGetResponseRulesRulesetsSkipRuleActionSkip RulesetVersionGetResponseRulesRulesetsSkipRuleAction = "skip"
-)
-
-// The parameters configuring the rule's action.
-type RulesetVersionGetResponseRulesRulesetsSkipRuleActionParameters struct {
- // A list of phases to skip the execution of. This option is incompatible with the
- // ruleset and rulesets options.
- Phases []RulesetVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase `json:"phases"`
- // A list of legacy security products to skip the execution of.
- Products []RulesetVersionGetResponseRulesRulesetsSkipRuleActionParametersProduct `json:"products"`
- // A mapping of ruleset IDs to a list of rule IDs in that ruleset to skip the
- // execution of. This option is incompatible with the ruleset option.
- Rules map[string][]string `json:"rules"`
- // A ruleset to skip the execution of. This option is incompatible with the
- // rulesets, rules and phases options.
- Ruleset RulesetVersionGetResponseRulesRulesetsSkipRuleActionParametersRuleset `json:"ruleset"`
- // A list of ruleset IDs to skip the execution of. This option is incompatible with
- // the ruleset and phases options.
- Rulesets []string `json:"rulesets"`
- JSON rulesetVersionGetResponseRulesRulesetsSkipRuleActionParametersJSON `json:"-"`
-}
-
-// rulesetVersionGetResponseRulesRulesetsSkipRuleActionParametersJSON contains the
-// JSON metadata for the struct
-// [RulesetVersionGetResponseRulesRulesetsSkipRuleActionParameters]
-type rulesetVersionGetResponseRulesRulesetsSkipRuleActionParametersJSON struct {
- Phases apijson.Field
- Products apijson.Field
- Rules apijson.Field
- Ruleset apijson.Field
- Rulesets apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetVersionGetResponseRulesRulesetsSkipRuleActionParameters) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetVersionGetResponseRulesRulesetsSkipRuleActionParametersJSON) RawJSON() string {
- return r.raw
-}
-
-// A phase to skip the execution of.
-type RulesetVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase string
-
-const (
- RulesetVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseDDOSL4 RulesetVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "ddos_l4"
- RulesetVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseDDOSL7 RulesetVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "ddos_l7"
- RulesetVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPConfigSettings RulesetVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_config_settings"
- RulesetVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPCustomErrors RulesetVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_custom_errors"
- RulesetVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPLogCustomFields RulesetVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_log_custom_fields"
- RulesetVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRatelimit RulesetVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_ratelimit"
- RulesetVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestCacheSettings RulesetVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_cache_settings"
- RulesetVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestDynamicRedirect RulesetVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_dynamic_redirect"
- RulesetVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallCustom RulesetVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_custom"
- RulesetVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallManaged RulesetVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_managed"
- RulesetVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestLateTransform RulesetVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_late_transform"
- RulesetVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestOrigin RulesetVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_origin"
- RulesetVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestRedirect RulesetVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_redirect"
- RulesetVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSanitize RulesetVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_sanitize"
- RulesetVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSbfm RulesetVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_sbfm"
- RulesetVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSelectConfiguration RulesetVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_select_configuration"
- RulesetVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestTransform RulesetVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_transform"
- RulesetVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseCompression RulesetVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_compression"
- RulesetVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseFirewallManaged RulesetVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_firewall_managed"
- RulesetVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseHeadersTransform RulesetVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_headers_transform"
- RulesetVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransit RulesetVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit"
- RulesetVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitIDsManaged RulesetVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_ids_managed"
- RulesetVersionGetResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitManaged RulesetVersionGetResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_managed"
-)
-
-// The name of a legacy security product to skip the execution of.
-type RulesetVersionGetResponseRulesRulesetsSkipRuleActionParametersProduct string
-
-const (
- RulesetVersionGetResponseRulesRulesetsSkipRuleActionParametersProductBic RulesetVersionGetResponseRulesRulesetsSkipRuleActionParametersProduct = "bic"
- RulesetVersionGetResponseRulesRulesetsSkipRuleActionParametersProductHot RulesetVersionGetResponseRulesRulesetsSkipRuleActionParametersProduct = "hot"
- RulesetVersionGetResponseRulesRulesetsSkipRuleActionParametersProductRateLimit RulesetVersionGetResponseRulesRulesetsSkipRuleActionParametersProduct = "rateLimit"
- RulesetVersionGetResponseRulesRulesetsSkipRuleActionParametersProductSecurityLevel RulesetVersionGetResponseRulesRulesetsSkipRuleActionParametersProduct = "securityLevel"
- RulesetVersionGetResponseRulesRulesetsSkipRuleActionParametersProductUABlock RulesetVersionGetResponseRulesRulesetsSkipRuleActionParametersProduct = "uaBlock"
- RulesetVersionGetResponseRulesRulesetsSkipRuleActionParametersProductWAF RulesetVersionGetResponseRulesRulesetsSkipRuleActionParametersProduct = "waf"
- RulesetVersionGetResponseRulesRulesetsSkipRuleActionParametersProductZoneLockdown RulesetVersionGetResponseRulesRulesetsSkipRuleActionParametersProduct = "zoneLockdown"
-)
-
-// A ruleset to skip the execution of. This option is incompatible with the
-// rulesets, rules and phases options.
-type RulesetVersionGetResponseRulesRulesetsSkipRuleActionParametersRuleset string
-
-const (
- RulesetVersionGetResponseRulesRulesetsSkipRuleActionParametersRulesetCurrent RulesetVersionGetResponseRulesRulesetsSkipRuleActionParametersRuleset = "current"
-)
-
-// An object configuring the rule's logging behavior.
-type RulesetVersionGetResponseRulesRulesetsSkipRuleLogging struct {
- // Whether to generate a log when the rule matches.
- Enabled bool `json:"enabled,required"`
- JSON rulesetVersionGetResponseRulesRulesetsSkipRuleLoggingJSON `json:"-"`
-}
-
-// rulesetVersionGetResponseRulesRulesetsSkipRuleLoggingJSON contains the JSON
-// metadata for the struct [RulesetVersionGetResponseRulesRulesetsSkipRuleLogging]
-type rulesetVersionGetResponseRulesRulesetsSkipRuleLoggingJSON struct {
- Enabled apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetVersionGetResponseRulesRulesetsSkipRuleLogging) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetVersionGetResponseRulesRulesetsSkipRuleLoggingJSON) RawJSON() string {
- return r.raw
-}
-
-type RulesetVersionListParams struct {
- // The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
- AccountID param.Field[string] `path:"account_id"`
- // The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- ZoneID param.Field[string] `path:"zone_id"`
-}
-
-// A response object.
-type RulesetVersionListResponseEnvelope struct {
- // A list of error messages.
- Errors []RulesetVersionListResponseEnvelopeErrors `json:"errors,required"`
- // A list of warning messages.
- Messages []RulesetVersionListResponseEnvelopeMessages `json:"messages,required"`
- // A result.
- Result []RulesetVersionListResponse `json:"result,required"`
- // Whether the API call was successful.
- Success RulesetVersionListResponseEnvelopeSuccess `json:"success,required"`
- JSON rulesetVersionListResponseEnvelopeJSON `json:"-"`
-}
-
-// rulesetVersionListResponseEnvelopeJSON contains the JSON metadata for the struct
-// [RulesetVersionListResponseEnvelope]
-type rulesetVersionListResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetVersionListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetVersionListResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-// A message.
-type RulesetVersionListResponseEnvelopeErrors struct {
- // A text description of this message.
- Message string `json:"message,required"`
- // A unique code for this message.
- Code int64 `json:"code"`
- // The source of this message.
- Source RulesetVersionListResponseEnvelopeErrorsSource `json:"source"`
- JSON rulesetVersionListResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// rulesetVersionListResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [RulesetVersionListResponseEnvelopeErrors]
-type rulesetVersionListResponseEnvelopeErrorsJSON struct {
- Message apijson.Field
- Code apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetVersionListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetVersionListResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-// The source of this message.
-type RulesetVersionListResponseEnvelopeErrorsSource struct {
- // A JSON pointer to the field that is the source of the message.
- Pointer string `json:"pointer,required"`
- JSON rulesetVersionListResponseEnvelopeErrorsSourceJSON `json:"-"`
-}
-
-// rulesetVersionListResponseEnvelopeErrorsSourceJSON contains the JSON metadata
-// for the struct [RulesetVersionListResponseEnvelopeErrorsSource]
-type rulesetVersionListResponseEnvelopeErrorsSourceJSON struct {
- Pointer apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetVersionListResponseEnvelopeErrorsSource) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetVersionListResponseEnvelopeErrorsSourceJSON) RawJSON() string {
- return r.raw
-}
-
-// A message.
-type RulesetVersionListResponseEnvelopeMessages struct {
- // A text description of this message.
- Message string `json:"message,required"`
- // A unique code for this message.
- Code int64 `json:"code"`
- // The source of this message.
- Source RulesetVersionListResponseEnvelopeMessagesSource `json:"source"`
- JSON rulesetVersionListResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// rulesetVersionListResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [RulesetVersionListResponseEnvelopeMessages]
-type rulesetVersionListResponseEnvelopeMessagesJSON struct {
- Message apijson.Field
- Code apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetVersionListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetVersionListResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// The source of this message.
-type RulesetVersionListResponseEnvelopeMessagesSource struct {
- // A JSON pointer to the field that is the source of the message.
- Pointer string `json:"pointer,required"`
- JSON rulesetVersionListResponseEnvelopeMessagesSourceJSON `json:"-"`
-}
-
-// rulesetVersionListResponseEnvelopeMessagesSourceJSON contains the JSON metadata
-// for the struct [RulesetVersionListResponseEnvelopeMessagesSource]
-type rulesetVersionListResponseEnvelopeMessagesSourceJSON struct {
- Pointer apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetVersionListResponseEnvelopeMessagesSource) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetVersionListResponseEnvelopeMessagesSourceJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful.
-type RulesetVersionListResponseEnvelopeSuccess bool
-
-const (
- RulesetVersionListResponseEnvelopeSuccessTrue RulesetVersionListResponseEnvelopeSuccess = true
-)
-
-type RulesetVersionDeleteParams struct {
- // The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
- AccountID param.Field[string] `path:"account_id"`
- // The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- ZoneID param.Field[string] `path:"zone_id"`
-}
-
-type RulesetVersionGetParams struct {
- // The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
- AccountID param.Field[string] `path:"account_id"`
- // The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
- ZoneID param.Field[string] `path:"zone_id"`
-}
-
-// A response object.
-type RulesetVersionGetResponseEnvelope struct {
- // A list of error messages.
- Errors []RulesetVersionGetResponseEnvelopeErrors `json:"errors,required"`
- // A list of warning messages.
- Messages []RulesetVersionGetResponseEnvelopeMessages `json:"messages,required"`
- // A result.
- Result RulesetVersionGetResponse `json:"result,required"`
- // Whether the API call was successful.
- Success RulesetVersionGetResponseEnvelopeSuccess `json:"success,required"`
- JSON rulesetVersionGetResponseEnvelopeJSON `json:"-"`
-}
-
-// rulesetVersionGetResponseEnvelopeJSON contains the JSON metadata for the struct
-// [RulesetVersionGetResponseEnvelope]
-type rulesetVersionGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetVersionGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetVersionGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-// A message.
-type RulesetVersionGetResponseEnvelopeErrors struct {
- // A text description of this message.
- Message string `json:"message,required"`
- // A unique code for this message.
- Code int64 `json:"code"`
- // The source of this message.
- Source RulesetVersionGetResponseEnvelopeErrorsSource `json:"source"`
- JSON rulesetVersionGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// rulesetVersionGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [RulesetVersionGetResponseEnvelopeErrors]
-type rulesetVersionGetResponseEnvelopeErrorsJSON struct {
- Message apijson.Field
- Code apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetVersionGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetVersionGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-// The source of this message.
-type RulesetVersionGetResponseEnvelopeErrorsSource struct {
- // A JSON pointer to the field that is the source of the message.
- Pointer string `json:"pointer,required"`
- JSON rulesetVersionGetResponseEnvelopeErrorsSourceJSON `json:"-"`
-}
-
-// rulesetVersionGetResponseEnvelopeErrorsSourceJSON contains the JSON metadata for
-// the struct [RulesetVersionGetResponseEnvelopeErrorsSource]
-type rulesetVersionGetResponseEnvelopeErrorsSourceJSON struct {
- Pointer apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetVersionGetResponseEnvelopeErrorsSource) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetVersionGetResponseEnvelopeErrorsSourceJSON) RawJSON() string {
- return r.raw
-}
-
-// A message.
-type RulesetVersionGetResponseEnvelopeMessages struct {
- // A text description of this message.
- Message string `json:"message,required"`
- // A unique code for this message.
- Code int64 `json:"code"`
- // The source of this message.
- Source RulesetVersionGetResponseEnvelopeMessagesSource `json:"source"`
- JSON rulesetVersionGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// rulesetVersionGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [RulesetVersionGetResponseEnvelopeMessages]
-type rulesetVersionGetResponseEnvelopeMessagesJSON struct {
- Message apijson.Field
- Code apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetVersionGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetVersionGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// The source of this message.
-type RulesetVersionGetResponseEnvelopeMessagesSource struct {
- // A JSON pointer to the field that is the source of the message.
- Pointer string `json:"pointer,required"`
- JSON rulesetVersionGetResponseEnvelopeMessagesSourceJSON `json:"-"`
-}
-
-// rulesetVersionGetResponseEnvelopeMessagesSourceJSON contains the JSON metadata
-// for the struct [RulesetVersionGetResponseEnvelopeMessagesSource]
-type rulesetVersionGetResponseEnvelopeMessagesSourceJSON struct {
- Pointer apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetVersionGetResponseEnvelopeMessagesSource) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetVersionGetResponseEnvelopeMessagesSourceJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful.
-type RulesetVersionGetResponseEnvelopeSuccess bool
-
-const (
- RulesetVersionGetResponseEnvelopeSuccessTrue RulesetVersionGetResponseEnvelopeSuccess = true
-)
diff --git a/rulesetversion_test.go b/rulesetversion_test.go
deleted file mode 100644
index f0bb38079d8..00000000000
--- a/rulesetversion_test.go
+++ /dev/null
@@ -1,109 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRulesetVersionListWithOptionalParams(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"),
- )
- _, err := client.Rulesets.Versions.List(
- context.TODO(),
- "2f2feab2026849078ba485f918791bdc",
- cloudflare.RulesetVersionListParams{
- AccountID: cloudflare.F("string"),
- ZoneID: cloudflare.F("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())
- }
-}
-
-func TestRulesetVersionDeleteWithOptionalParams(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"),
- )
- err := client.Rulesets.Versions.Delete(
- context.TODO(),
- "2f2feab2026849078ba485f918791bdc",
- "1",
- cloudflare.RulesetVersionDeleteParams{
- AccountID: cloudflare.F("string"),
- ZoneID: cloudflare.F("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())
- }
-}
-
-func TestRulesetVersionGetWithOptionalParams(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"),
- )
- _, err := client.Rulesets.Versions.Get(
- context.TODO(),
- "2f2feab2026849078ba485f918791bdc",
- "1",
- cloudflare.RulesetVersionGetParams{
- AccountID: cloudflare.F("string"),
- ZoneID: cloudflare.F("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/rulesetversionbytag.go b/rulesetversionbytag.go
deleted file mode 100644
index 7f725456289..00000000000
--- a/rulesetversionbytag.go
+++ /dev/null
@@ -1,996 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "reflect"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
- "github.com/tidwall/gjson"
-)
-
-// RulesetVersionByTagService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewRulesetVersionByTagService]
-// method instead.
-type RulesetVersionByTagService struct {
- Options []option.RequestOption
-}
-
-// NewRulesetVersionByTagService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewRulesetVersionByTagService(opts ...option.RequestOption) (r *RulesetVersionByTagService) {
- r = &RulesetVersionByTagService{}
- r.Options = opts
- return
-}
-
-// Fetches the rules of a managed account ruleset version for a given tag.
-func (r *RulesetVersionByTagService) Get(ctx context.Context, rulesetID string, rulesetVersion string, ruleTag string, query RulesetVersionByTagGetParams, opts ...option.RequestOption) (res *RulesetVersionByTagGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RulesetVersionByTagGetResponseEnvelope
- path := fmt.Sprintf("accounts/%s/rulesets/%s/versions/%s/by_tag/%s", query.AccountID, rulesetID, rulesetVersion, ruleTag)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// A result.
-type RulesetVersionByTagGetResponse struct {
- // The unique ID of the ruleset.
- ID string `json:"id,required"`
- // The kind of the ruleset.
- Kind RulesetVersionByTagGetResponseKind `json:"kind,required"`
- // The timestamp of when the ruleset was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The human-readable name of the ruleset.
- Name string `json:"name,required"`
- // The phase of the ruleset.
- Phase RulesetVersionByTagGetResponsePhase `json:"phase,required"`
- // The list of rules in the ruleset.
- Rules []RulesetVersionByTagGetResponseRule `json:"rules,required"`
- // The version of the ruleset.
- Version string `json:"version,required"`
- // An informative description of the ruleset.
- Description string `json:"description"`
- JSON rulesetVersionByTagGetResponseJSON `json:"-"`
-}
-
-// rulesetVersionByTagGetResponseJSON contains the JSON metadata for the struct
-// [RulesetVersionByTagGetResponse]
-type rulesetVersionByTagGetResponseJSON struct {
- ID apijson.Field
- Kind apijson.Field
- LastUpdated apijson.Field
- Name apijson.Field
- Phase apijson.Field
- Rules apijson.Field
- Version apijson.Field
- Description apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetVersionByTagGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetVersionByTagGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// The kind of the ruleset.
-type RulesetVersionByTagGetResponseKind string
-
-const (
- RulesetVersionByTagGetResponseKindManaged RulesetVersionByTagGetResponseKind = "managed"
- RulesetVersionByTagGetResponseKindCustom RulesetVersionByTagGetResponseKind = "custom"
- RulesetVersionByTagGetResponseKindRoot RulesetVersionByTagGetResponseKind = "root"
- RulesetVersionByTagGetResponseKindZone RulesetVersionByTagGetResponseKind = "zone"
-)
-
-// The phase of the ruleset.
-type RulesetVersionByTagGetResponsePhase string
-
-const (
- RulesetVersionByTagGetResponsePhaseDDOSL4 RulesetVersionByTagGetResponsePhase = "ddos_l4"
- RulesetVersionByTagGetResponsePhaseDDOSL7 RulesetVersionByTagGetResponsePhase = "ddos_l7"
- RulesetVersionByTagGetResponsePhaseHTTPConfigSettings RulesetVersionByTagGetResponsePhase = "http_config_settings"
- RulesetVersionByTagGetResponsePhaseHTTPCustomErrors RulesetVersionByTagGetResponsePhase = "http_custom_errors"
- RulesetVersionByTagGetResponsePhaseHTTPLogCustomFields RulesetVersionByTagGetResponsePhase = "http_log_custom_fields"
- RulesetVersionByTagGetResponsePhaseHTTPRatelimit RulesetVersionByTagGetResponsePhase = "http_ratelimit"
- RulesetVersionByTagGetResponsePhaseHTTPRequestCacheSettings RulesetVersionByTagGetResponsePhase = "http_request_cache_settings"
- RulesetVersionByTagGetResponsePhaseHTTPRequestDynamicRedirect RulesetVersionByTagGetResponsePhase = "http_request_dynamic_redirect"
- RulesetVersionByTagGetResponsePhaseHTTPRequestFirewallCustom RulesetVersionByTagGetResponsePhase = "http_request_firewall_custom"
- RulesetVersionByTagGetResponsePhaseHTTPRequestFirewallManaged RulesetVersionByTagGetResponsePhase = "http_request_firewall_managed"
- RulesetVersionByTagGetResponsePhaseHTTPRequestLateTransform RulesetVersionByTagGetResponsePhase = "http_request_late_transform"
- RulesetVersionByTagGetResponsePhaseHTTPRequestOrigin RulesetVersionByTagGetResponsePhase = "http_request_origin"
- RulesetVersionByTagGetResponsePhaseHTTPRequestRedirect RulesetVersionByTagGetResponsePhase = "http_request_redirect"
- RulesetVersionByTagGetResponsePhaseHTTPRequestSanitize RulesetVersionByTagGetResponsePhase = "http_request_sanitize"
- RulesetVersionByTagGetResponsePhaseHTTPRequestSbfm RulesetVersionByTagGetResponsePhase = "http_request_sbfm"
- RulesetVersionByTagGetResponsePhaseHTTPRequestSelectConfiguration RulesetVersionByTagGetResponsePhase = "http_request_select_configuration"
- RulesetVersionByTagGetResponsePhaseHTTPRequestTransform RulesetVersionByTagGetResponsePhase = "http_request_transform"
- RulesetVersionByTagGetResponsePhaseHTTPResponseCompression RulesetVersionByTagGetResponsePhase = "http_response_compression"
- RulesetVersionByTagGetResponsePhaseHTTPResponseFirewallManaged RulesetVersionByTagGetResponsePhase = "http_response_firewall_managed"
- RulesetVersionByTagGetResponsePhaseHTTPResponseHeadersTransform RulesetVersionByTagGetResponsePhase = "http_response_headers_transform"
- RulesetVersionByTagGetResponsePhaseMagicTransit RulesetVersionByTagGetResponsePhase = "magic_transit"
- RulesetVersionByTagGetResponsePhaseMagicTransitIDsManaged RulesetVersionByTagGetResponsePhase = "magic_transit_ids_managed"
- RulesetVersionByTagGetResponsePhaseMagicTransitManaged RulesetVersionByTagGetResponsePhase = "magic_transit_managed"
-)
-
-// Union satisfied by [RulesetVersionByTagGetResponseRulesRulesetsBlockRule],
-// [RulesetVersionByTagGetResponseRulesRulesetsExecuteRule],
-// [RulesetVersionByTagGetResponseRulesRulesetsLogRule] or
-// [RulesetVersionByTagGetResponseRulesRulesetsSkipRule].
-type RulesetVersionByTagGetResponseRule interface {
- implementsRulesetVersionByTagGetResponseRule()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*RulesetVersionByTagGetResponseRule)(nil)).Elem(),
- "action",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(RulesetVersionByTagGetResponseRulesRulesetsBlockRule{}),
- DiscriminatorValue: "block",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(RulesetVersionByTagGetResponseRulesRulesetsExecuteRule{}),
- DiscriminatorValue: "execute",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(RulesetVersionByTagGetResponseRulesRulesetsLogRule{}),
- DiscriminatorValue: "log",
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(RulesetVersionByTagGetResponseRulesRulesetsSkipRule{}),
- DiscriminatorValue: "skip",
- },
- )
-}
-
-type RulesetVersionByTagGetResponseRulesRulesetsBlockRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action RulesetVersionByTagGetResponseRulesRulesetsBlockRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters RulesetVersionByTagGetResponseRulesRulesetsBlockRuleActionParameters `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging RulesetVersionByTagGetResponseRulesRulesetsBlockRuleLogging `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON rulesetVersionByTagGetResponseRulesRulesetsBlockRuleJSON `json:"-"`
-}
-
-// rulesetVersionByTagGetResponseRulesRulesetsBlockRuleJSON contains the JSON
-// metadata for the struct [RulesetVersionByTagGetResponseRulesRulesetsBlockRule]
-type rulesetVersionByTagGetResponseRulesRulesetsBlockRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetVersionByTagGetResponseRulesRulesetsBlockRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetVersionByTagGetResponseRulesRulesetsBlockRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r RulesetVersionByTagGetResponseRulesRulesetsBlockRule) implementsRulesetVersionByTagGetResponseRule() {
-}
-
-// The action to perform when the rule matches.
-type RulesetVersionByTagGetResponseRulesRulesetsBlockRuleAction string
-
-const (
- RulesetVersionByTagGetResponseRulesRulesetsBlockRuleActionBlock RulesetVersionByTagGetResponseRulesRulesetsBlockRuleAction = "block"
-)
-
-// The parameters configuring the rule's action.
-type RulesetVersionByTagGetResponseRulesRulesetsBlockRuleActionParameters struct {
- // The response to show when the block is applied.
- Response RulesetVersionByTagGetResponseRulesRulesetsBlockRuleActionParametersResponse `json:"response"`
- JSON rulesetVersionByTagGetResponseRulesRulesetsBlockRuleActionParametersJSON `json:"-"`
-}
-
-// rulesetVersionByTagGetResponseRulesRulesetsBlockRuleActionParametersJSON
-// contains the JSON metadata for the struct
-// [RulesetVersionByTagGetResponseRulesRulesetsBlockRuleActionParameters]
-type rulesetVersionByTagGetResponseRulesRulesetsBlockRuleActionParametersJSON struct {
- Response apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetVersionByTagGetResponseRulesRulesetsBlockRuleActionParameters) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetVersionByTagGetResponseRulesRulesetsBlockRuleActionParametersJSON) RawJSON() string {
- return r.raw
-}
-
-// The response to show when the block is applied.
-type RulesetVersionByTagGetResponseRulesRulesetsBlockRuleActionParametersResponse struct {
- // The content to return.
- Content string `json:"content,required"`
- // The type of the content to return.
- ContentType string `json:"content_type,required"`
- // The status code to return.
- StatusCode int64 `json:"status_code,required"`
- JSON rulesetVersionByTagGetResponseRulesRulesetsBlockRuleActionParametersResponseJSON `json:"-"`
-}
-
-// rulesetVersionByTagGetResponseRulesRulesetsBlockRuleActionParametersResponseJSON
-// contains the JSON metadata for the struct
-// [RulesetVersionByTagGetResponseRulesRulesetsBlockRuleActionParametersResponse]
-type rulesetVersionByTagGetResponseRulesRulesetsBlockRuleActionParametersResponseJSON struct {
- Content apijson.Field
- ContentType apijson.Field
- StatusCode apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetVersionByTagGetResponseRulesRulesetsBlockRuleActionParametersResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetVersionByTagGetResponseRulesRulesetsBlockRuleActionParametersResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// An object configuring the rule's logging behavior.
-type RulesetVersionByTagGetResponseRulesRulesetsBlockRuleLogging struct {
- // Whether to generate a log when the rule matches.
- Enabled bool `json:"enabled,required"`
- JSON rulesetVersionByTagGetResponseRulesRulesetsBlockRuleLoggingJSON `json:"-"`
-}
-
-// rulesetVersionByTagGetResponseRulesRulesetsBlockRuleLoggingJSON contains the
-// JSON metadata for the struct
-// [RulesetVersionByTagGetResponseRulesRulesetsBlockRuleLogging]
-type rulesetVersionByTagGetResponseRulesRulesetsBlockRuleLoggingJSON struct {
- Enabled apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetVersionByTagGetResponseRulesRulesetsBlockRuleLogging) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetVersionByTagGetResponseRulesRulesetsBlockRuleLoggingJSON) RawJSON() string {
- return r.raw
-}
-
-type RulesetVersionByTagGetResponseRulesRulesetsExecuteRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action RulesetVersionByTagGetResponseRulesRulesetsExecuteRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters RulesetVersionByTagGetResponseRulesRulesetsExecuteRuleActionParameters `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging RulesetVersionByTagGetResponseRulesRulesetsExecuteRuleLogging `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON rulesetVersionByTagGetResponseRulesRulesetsExecuteRuleJSON `json:"-"`
-}
-
-// rulesetVersionByTagGetResponseRulesRulesetsExecuteRuleJSON contains the JSON
-// metadata for the struct [RulesetVersionByTagGetResponseRulesRulesetsExecuteRule]
-type rulesetVersionByTagGetResponseRulesRulesetsExecuteRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetVersionByTagGetResponseRulesRulesetsExecuteRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetVersionByTagGetResponseRulesRulesetsExecuteRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r RulesetVersionByTagGetResponseRulesRulesetsExecuteRule) implementsRulesetVersionByTagGetResponseRule() {
-}
-
-// The action to perform when the rule matches.
-type RulesetVersionByTagGetResponseRulesRulesetsExecuteRuleAction string
-
-const (
- RulesetVersionByTagGetResponseRulesRulesetsExecuteRuleActionExecute RulesetVersionByTagGetResponseRulesRulesetsExecuteRuleAction = "execute"
-)
-
-// The parameters configuring the rule's action.
-type RulesetVersionByTagGetResponseRulesRulesetsExecuteRuleActionParameters struct {
- // The ID of the ruleset to execute.
- ID string `json:"id,required"`
- // The configuration to use for matched data logging.
- MatchedData RulesetVersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersMatchedData `json:"matched_data"`
- // A set of overrides to apply to the target ruleset.
- Overrides RulesetVersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverrides `json:"overrides"`
- JSON rulesetVersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersJSON `json:"-"`
-}
-
-// rulesetVersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersJSON
-// contains the JSON metadata for the struct
-// [RulesetVersionByTagGetResponseRulesRulesetsExecuteRuleActionParameters]
-type rulesetVersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersJSON struct {
- ID apijson.Field
- MatchedData apijson.Field
- Overrides apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetVersionByTagGetResponseRulesRulesetsExecuteRuleActionParameters) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetVersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersJSON) RawJSON() string {
- return r.raw
-}
-
-// The configuration to use for matched data logging.
-type RulesetVersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersMatchedData struct {
- // The public key to encrypt matched data logs with.
- PublicKey string `json:"public_key,required"`
- JSON rulesetVersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON `json:"-"`
-}
-
-// rulesetVersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON
-// contains the JSON metadata for the struct
-// [RulesetVersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersMatchedData]
-type rulesetVersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON struct {
- PublicKey apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetVersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersMatchedData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetVersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersMatchedDataJSON) RawJSON() string {
- return r.raw
-}
-
-// A set of overrides to apply to the target ruleset.
-type RulesetVersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverrides struct {
- // An action to override all rules with. This option has lower precedence than rule
- // and category overrides.
- Action string `json:"action"`
- // A list of category-level overrides. This option has the second-highest
- // precedence after rule-level overrides.
- Categories []RulesetVersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory `json:"categories"`
- // Whether to enable execution of all rules. This option has lower precedence than
- // rule and category overrides.
- Enabled bool `json:"enabled"`
- // A list of rule-level overrides. This option has the highest precedence.
- Rules []RulesetVersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRule `json:"rules"`
- // A sensitivity level to set for all rules. This option has lower precedence than
- // rule and category overrides and is only applicable for DDoS phases.
- SensitivityLevel RulesetVersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel `json:"sensitivity_level"`
- JSON rulesetVersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON `json:"-"`
-}
-
-// rulesetVersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON
-// contains the JSON metadata for the struct
-// [RulesetVersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverrides]
-type rulesetVersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON struct {
- Action apijson.Field
- Categories apijson.Field
- Enabled apijson.Field
- Rules apijson.Field
- SensitivityLevel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetVersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverrides) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetVersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesJSON) RawJSON() string {
- return r.raw
-}
-
-// A category-level override
-type RulesetVersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory struct {
- // The name of the category to override.
- Category string `json:"category,required"`
- // The action to override rules in the category with.
- Action string `json:"action"`
- // Whether to enable execution of rules in the category.
- Enabled bool `json:"enabled"`
- // The sensitivity level to use for rules in the category.
- SensitivityLevel RulesetVersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel `json:"sensitivity_level"`
- JSON rulesetVersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON `json:"-"`
-}
-
-// rulesetVersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON
-// contains the JSON metadata for the struct
-// [RulesetVersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory]
-type rulesetVersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON struct {
- Category apijson.Field
- Action apijson.Field
- Enabled apijson.Field
- SensitivityLevel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetVersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategory) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetVersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoryJSON) RawJSON() string {
- return r.raw
-}
-
-// The sensitivity level to use for rules in the category.
-type RulesetVersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel string
-
-const (
- RulesetVersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault RulesetVersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "default"
- RulesetVersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium RulesetVersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "medium"
- RulesetVersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow RulesetVersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "low"
- RulesetVersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff RulesetVersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "eoff"
-)
-
-// A rule-level override
-type RulesetVersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRule struct {
- // The ID of the rule to override.
- ID string `json:"id,required"`
- // The action to override the rule with.
- Action string `json:"action"`
- // Whether to enable execution of the rule.
- Enabled bool `json:"enabled"`
- // The score threshold to use for the rule.
- ScoreThreshold int64 `json:"score_threshold"`
- // The sensitivity level to use for the rule.
- SensitivityLevel RulesetVersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel `json:"sensitivity_level"`
- JSON rulesetVersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON `json:"-"`
-}
-
-// rulesetVersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON
-// contains the JSON metadata for the struct
-// [RulesetVersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRule]
-type rulesetVersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON struct {
- ID apijson.Field
- Action apijson.Field
- Enabled apijson.Field
- ScoreThreshold apijson.Field
- SensitivityLevel apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetVersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetVersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRuleJSON) RawJSON() string {
- return r.raw
-}
-
-// The sensitivity level to use for the rule.
-type RulesetVersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel string
-
-const (
- RulesetVersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault RulesetVersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "default"
- RulesetVersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium RulesetVersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "medium"
- RulesetVersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelLow RulesetVersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "low"
- RulesetVersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff RulesetVersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesRulesSensitivityLevel = "eoff"
-)
-
-// A sensitivity level to set for all rules. This option has lower precedence than
-// rule and category overrides and is only applicable for DDoS phases.
-type RulesetVersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel string
-
-const (
- RulesetVersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelDefault RulesetVersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "default"
- RulesetVersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelMedium RulesetVersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "medium"
- RulesetVersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelLow RulesetVersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "low"
- RulesetVersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevelEoff RulesetVersionByTagGetResponseRulesRulesetsExecuteRuleActionParametersOverridesSensitivityLevel = "eoff"
-)
-
-// An object configuring the rule's logging behavior.
-type RulesetVersionByTagGetResponseRulesRulesetsExecuteRuleLogging struct {
- // Whether to generate a log when the rule matches.
- Enabled bool `json:"enabled,required"`
- JSON rulesetVersionByTagGetResponseRulesRulesetsExecuteRuleLoggingJSON `json:"-"`
-}
-
-// rulesetVersionByTagGetResponseRulesRulesetsExecuteRuleLoggingJSON contains the
-// JSON metadata for the struct
-// [RulesetVersionByTagGetResponseRulesRulesetsExecuteRuleLogging]
-type rulesetVersionByTagGetResponseRulesRulesetsExecuteRuleLoggingJSON struct {
- Enabled apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetVersionByTagGetResponseRulesRulesetsExecuteRuleLogging) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetVersionByTagGetResponseRulesRulesetsExecuteRuleLoggingJSON) RawJSON() string {
- return r.raw
-}
-
-type RulesetVersionByTagGetResponseRulesRulesetsLogRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action RulesetVersionByTagGetResponseRulesRulesetsLogRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters interface{} `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging RulesetVersionByTagGetResponseRulesRulesetsLogRuleLogging `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON rulesetVersionByTagGetResponseRulesRulesetsLogRuleJSON `json:"-"`
-}
-
-// rulesetVersionByTagGetResponseRulesRulesetsLogRuleJSON contains the JSON
-// metadata for the struct [RulesetVersionByTagGetResponseRulesRulesetsLogRule]
-type rulesetVersionByTagGetResponseRulesRulesetsLogRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetVersionByTagGetResponseRulesRulesetsLogRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetVersionByTagGetResponseRulesRulesetsLogRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r RulesetVersionByTagGetResponseRulesRulesetsLogRule) implementsRulesetVersionByTagGetResponseRule() {
-}
-
-// The action to perform when the rule matches.
-type RulesetVersionByTagGetResponseRulesRulesetsLogRuleAction string
-
-const (
- RulesetVersionByTagGetResponseRulesRulesetsLogRuleActionLog RulesetVersionByTagGetResponseRulesRulesetsLogRuleAction = "log"
-)
-
-// An object configuring the rule's logging behavior.
-type RulesetVersionByTagGetResponseRulesRulesetsLogRuleLogging struct {
- // Whether to generate a log when the rule matches.
- Enabled bool `json:"enabled,required"`
- JSON rulesetVersionByTagGetResponseRulesRulesetsLogRuleLoggingJSON `json:"-"`
-}
-
-// rulesetVersionByTagGetResponseRulesRulesetsLogRuleLoggingJSON contains the JSON
-// metadata for the struct
-// [RulesetVersionByTagGetResponseRulesRulesetsLogRuleLogging]
-type rulesetVersionByTagGetResponseRulesRulesetsLogRuleLoggingJSON struct {
- Enabled apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetVersionByTagGetResponseRulesRulesetsLogRuleLogging) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetVersionByTagGetResponseRulesRulesetsLogRuleLoggingJSON) RawJSON() string {
- return r.raw
-}
-
-type RulesetVersionByTagGetResponseRulesRulesetsSkipRule struct {
- // The timestamp of when the rule was last modified.
- LastUpdated time.Time `json:"last_updated,required" format:"date-time"`
- // The version of the rule.
- Version string `json:"version,required"`
- // The unique ID of the rule.
- ID string `json:"id"`
- // The action to perform when the rule matches.
- Action RulesetVersionByTagGetResponseRulesRulesetsSkipRuleAction `json:"action"`
- // The parameters configuring the rule's action.
- ActionParameters RulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParameters `json:"action_parameters"`
- // The categories of the rule.
- Categories []string `json:"categories"`
- // An informative description of the rule.
- Description string `json:"description"`
- // Whether the rule should be executed.
- Enabled bool `json:"enabled"`
- // The expression defining which traffic will match the rule.
- Expression string `json:"expression"`
- // An object configuring the rule's logging behavior.
- Logging RulesetVersionByTagGetResponseRulesRulesetsSkipRuleLogging `json:"logging"`
- // The reference of the rule (the rule ID by default).
- Ref string `json:"ref"`
- JSON rulesetVersionByTagGetResponseRulesRulesetsSkipRuleJSON `json:"-"`
-}
-
-// rulesetVersionByTagGetResponseRulesRulesetsSkipRuleJSON contains the JSON
-// metadata for the struct [RulesetVersionByTagGetResponseRulesRulesetsSkipRule]
-type rulesetVersionByTagGetResponseRulesRulesetsSkipRuleJSON struct {
- LastUpdated apijson.Field
- Version apijson.Field
- ID apijson.Field
- Action apijson.Field
- ActionParameters apijson.Field
- Categories apijson.Field
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- Logging apijson.Field
- Ref apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetVersionByTagGetResponseRulesRulesetsSkipRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetVersionByTagGetResponseRulesRulesetsSkipRuleJSON) RawJSON() string {
- return r.raw
-}
-
-func (r RulesetVersionByTagGetResponseRulesRulesetsSkipRule) implementsRulesetVersionByTagGetResponseRule() {
-}
-
-// The action to perform when the rule matches.
-type RulesetVersionByTagGetResponseRulesRulesetsSkipRuleAction string
-
-const (
- RulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionSkip RulesetVersionByTagGetResponseRulesRulesetsSkipRuleAction = "skip"
-)
-
-// The parameters configuring the rule's action.
-type RulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParameters struct {
- // A list of phases to skip the execution of. This option is incompatible with the
- // ruleset and rulesets options.
- Phases []RulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhase `json:"phases"`
- // A list of legacy security products to skip the execution of.
- Products []RulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParametersProduct `json:"products"`
- // A mapping of ruleset IDs to a list of rule IDs in that ruleset to skip the
- // execution of. This option is incompatible with the ruleset option.
- Rules map[string][]string `json:"rules"`
- // A ruleset to skip the execution of. This option is incompatible with the
- // rulesets, rules and phases options.
- Ruleset RulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParametersRuleset `json:"ruleset"`
- // A list of ruleset IDs to skip the execution of. This option is incompatible with
- // the ruleset and phases options.
- Rulesets []string `json:"rulesets"`
- JSON rulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParametersJSON `json:"-"`
-}
-
-// rulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParametersJSON contains
-// the JSON metadata for the struct
-// [RulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParameters]
-type rulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParametersJSON struct {
- Phases apijson.Field
- Products apijson.Field
- Rules apijson.Field
- Ruleset apijson.Field
- Rulesets apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParameters) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParametersJSON) RawJSON() string {
- return r.raw
-}
-
-// A phase to skip the execution of.
-type RulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhase string
-
-const (
- RulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhaseDDOSL4 RulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhase = "ddos_l4"
- RulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhaseDDOSL7 RulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhase = "ddos_l7"
- RulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPConfigSettings RulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_config_settings"
- RulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPCustomErrors RulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_custom_errors"
- RulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPLogCustomFields RulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_log_custom_fields"
- RulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRatelimit RulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_ratelimit"
- RulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestCacheSettings RulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_cache_settings"
- RulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestDynamicRedirect RulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_dynamic_redirect"
- RulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallCustom RulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_custom"
- RulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestFirewallManaged RulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_firewall_managed"
- RulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestLateTransform RulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_late_transform"
- RulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestOrigin RulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_origin"
- RulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestRedirect RulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_redirect"
- RulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSanitize RulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_sanitize"
- RulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSbfm RulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_sbfm"
- RulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestSelectConfiguration RulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_select_configuration"
- RulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPRequestTransform RulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_request_transform"
- RulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseCompression RulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_compression"
- RulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseFirewallManaged RulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_firewall_managed"
- RulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhaseHTTPResponseHeadersTransform RulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhase = "http_response_headers_transform"
- RulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransit RulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit"
- RulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitIDsManaged RulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_ids_managed"
- RulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhaseMagicTransitManaged RulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParametersPhase = "magic_transit_managed"
-)
-
-// The name of a legacy security product to skip the execution of.
-type RulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParametersProduct string
-
-const (
- RulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParametersProductBic RulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParametersProduct = "bic"
- RulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParametersProductHot RulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParametersProduct = "hot"
- RulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParametersProductRateLimit RulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParametersProduct = "rateLimit"
- RulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParametersProductSecurityLevel RulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParametersProduct = "securityLevel"
- RulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParametersProductUABlock RulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParametersProduct = "uaBlock"
- RulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParametersProductWAF RulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParametersProduct = "waf"
- RulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParametersProductZoneLockdown RulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParametersProduct = "zoneLockdown"
-)
-
-// A ruleset to skip the execution of. This option is incompatible with the
-// rulesets, rules and phases options.
-type RulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParametersRuleset string
-
-const (
- RulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParametersRulesetCurrent RulesetVersionByTagGetResponseRulesRulesetsSkipRuleActionParametersRuleset = "current"
-)
-
-// An object configuring the rule's logging behavior.
-type RulesetVersionByTagGetResponseRulesRulesetsSkipRuleLogging struct {
- // Whether to generate a log when the rule matches.
- Enabled bool `json:"enabled,required"`
- JSON rulesetVersionByTagGetResponseRulesRulesetsSkipRuleLoggingJSON `json:"-"`
-}
-
-// rulesetVersionByTagGetResponseRulesRulesetsSkipRuleLoggingJSON contains the JSON
-// metadata for the struct
-// [RulesetVersionByTagGetResponseRulesRulesetsSkipRuleLogging]
-type rulesetVersionByTagGetResponseRulesRulesetsSkipRuleLoggingJSON struct {
- Enabled apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetVersionByTagGetResponseRulesRulesetsSkipRuleLogging) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetVersionByTagGetResponseRulesRulesetsSkipRuleLoggingJSON) RawJSON() string {
- return r.raw
-}
-
-type RulesetVersionByTagGetParams struct {
- // The unique ID of the account.
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-// A response object.
-type RulesetVersionByTagGetResponseEnvelope struct {
- // A list of error messages.
- Errors []RulesetVersionByTagGetResponseEnvelopeErrors `json:"errors,required"`
- // A list of warning messages.
- Messages []RulesetVersionByTagGetResponseEnvelopeMessages `json:"messages,required"`
- // A result.
- Result RulesetVersionByTagGetResponse `json:"result,required"`
- // Whether the API call was successful.
- Success RulesetVersionByTagGetResponseEnvelopeSuccess `json:"success,required"`
- JSON rulesetVersionByTagGetResponseEnvelopeJSON `json:"-"`
-}
-
-// rulesetVersionByTagGetResponseEnvelopeJSON contains the JSON metadata for the
-// struct [RulesetVersionByTagGetResponseEnvelope]
-type rulesetVersionByTagGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetVersionByTagGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetVersionByTagGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-// A message.
-type RulesetVersionByTagGetResponseEnvelopeErrors struct {
- // A text description of this message.
- Message string `json:"message,required"`
- // A unique code for this message.
- Code int64 `json:"code"`
- // The source of this message.
- Source RulesetVersionByTagGetResponseEnvelopeErrorsSource `json:"source"`
- JSON rulesetVersionByTagGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// rulesetVersionByTagGetResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [RulesetVersionByTagGetResponseEnvelopeErrors]
-type rulesetVersionByTagGetResponseEnvelopeErrorsJSON struct {
- Message apijson.Field
- Code apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetVersionByTagGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetVersionByTagGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-// The source of this message.
-type RulesetVersionByTagGetResponseEnvelopeErrorsSource struct {
- // A JSON pointer to the field that is the source of the message.
- Pointer string `json:"pointer,required"`
- JSON rulesetVersionByTagGetResponseEnvelopeErrorsSourceJSON `json:"-"`
-}
-
-// rulesetVersionByTagGetResponseEnvelopeErrorsSourceJSON contains the JSON
-// metadata for the struct [RulesetVersionByTagGetResponseEnvelopeErrorsSource]
-type rulesetVersionByTagGetResponseEnvelopeErrorsSourceJSON struct {
- Pointer apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetVersionByTagGetResponseEnvelopeErrorsSource) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetVersionByTagGetResponseEnvelopeErrorsSourceJSON) RawJSON() string {
- return r.raw
-}
-
-// A message.
-type RulesetVersionByTagGetResponseEnvelopeMessages struct {
- // A text description of this message.
- Message string `json:"message,required"`
- // A unique code for this message.
- Code int64 `json:"code"`
- // The source of this message.
- Source RulesetVersionByTagGetResponseEnvelopeMessagesSource `json:"source"`
- JSON rulesetVersionByTagGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// rulesetVersionByTagGetResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [RulesetVersionByTagGetResponseEnvelopeMessages]
-type rulesetVersionByTagGetResponseEnvelopeMessagesJSON struct {
- Message apijson.Field
- Code apijson.Field
- Source apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetVersionByTagGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetVersionByTagGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// The source of this message.
-type RulesetVersionByTagGetResponseEnvelopeMessagesSource struct {
- // A JSON pointer to the field that is the source of the message.
- Pointer string `json:"pointer,required"`
- JSON rulesetVersionByTagGetResponseEnvelopeMessagesSourceJSON `json:"-"`
-}
-
-// rulesetVersionByTagGetResponseEnvelopeMessagesSourceJSON contains the JSON
-// metadata for the struct [RulesetVersionByTagGetResponseEnvelopeMessagesSource]
-type rulesetVersionByTagGetResponseEnvelopeMessagesSourceJSON struct {
- Pointer apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RulesetVersionByTagGetResponseEnvelopeMessagesSource) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rulesetVersionByTagGetResponseEnvelopeMessagesSourceJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful.
-type RulesetVersionByTagGetResponseEnvelopeSuccess bool
-
-const (
- RulesetVersionByTagGetResponseEnvelopeSuccessTrue RulesetVersionByTagGetResponseEnvelopeSuccess = true
-)
diff --git a/rulesetversionbytag_test.go b/rulesetversionbytag_test.go
deleted file mode 100644
index 3752792bab9..00000000000
--- a/rulesetversionbytag_test.go
+++ /dev/null
@@ -1,46 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRulesetVersionByTagGet(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"),
- )
- _, err := client.Rulesets.Versions.ByTags.Get(
- context.TODO(),
- "2f2feab2026849078ba485f918791bdc",
- "1",
- "directory-traversal",
- cloudflare.RulesetVersionByTagGetParams{
- AccountID: cloudflare.F("abf9b32d38c5f572afde3336ec0ce302"),
- },
- )
- 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/rum/aliases.go b/rum/aliases.go
new file mode 100644
index 00000000000..1abe3af2916
--- /dev/null
+++ b/rum/aliases.go
@@ -0,0 +1,9 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package rum
+
+import (
+ "github.com/cloudflare/cloudflare-go/internal/apierror"
+)
+
+type Error = apierror.Error
diff --git a/rum/rule.go b/rum/rule.go
new file mode 100644
index 00000000000..0928b1c6bc9
--- /dev/null
+++ b/rum/rule.go
@@ -0,0 +1,321 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package rum
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// RuleService contains methods and other services that help with interacting with
+// the cloudflare API. Note, unlike clients, this service does not read variables
+// from the environment automatically. You should not instantiate this service
+// directly, and instead use the [NewRuleService] method instead.
+type RuleService struct {
+ Options []option.RequestOption
+}
+
+// NewRuleService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewRuleService(opts ...option.RequestOption) (r *RuleService) {
+ r = &RuleService{}
+ r.Options = opts
+ return
+}
+
+// Creates a new rule in a Web Analytics ruleset.
+func (r *RuleService) New(ctx context.Context, rulesetID string, params RuleNewParams, opts ...option.RequestOption) (res *RUMRule, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RuleNewResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/rum/v2/%s/rule", params.AccountID, rulesetID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Updates a rule in a Web Analytics ruleset.
+func (r *RuleService) Update(ctx context.Context, rulesetID string, ruleID string, params RuleUpdateParams, opts ...option.RequestOption) (res *RUMRule, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RuleUpdateResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/rum/v2/%s/rule/%s", params.AccountID, rulesetID, ruleID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Lists all the rules in a Web Analytics ruleset.
+func (r *RuleService) List(ctx context.Context, rulesetID string, query RuleListParams, opts ...option.RequestOption) (res *RuleListResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RuleListResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/rum/v2/%s/rules", query.AccountID, rulesetID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Deletes an existing rule from a Web Analytics ruleset.
+func (r *RuleService) Delete(ctx context.Context, rulesetID string, ruleID string, body RuleDeleteParams, opts ...option.RequestOption) (res *RuleDeleteResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RuleDeleteResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/rum/v2/%s/rule/%s", body.AccountID, rulesetID, ruleID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type RUMRule struct {
+ // The Web Analytics rule identifier.
+ ID string `json:"id"`
+ Created time.Time `json:"created" format:"date-time"`
+ // The hostname the rule will be applied to.
+ Host string `json:"host"`
+ // Whether the rule includes or excludes traffic from being measured.
+ Inclusive bool `json:"inclusive"`
+ // Whether the rule is paused or not.
+ IsPaused bool `json:"is_paused"`
+ // The paths the rule will be applied to.
+ Paths []string `json:"paths"`
+ Priority float64 `json:"priority"`
+ JSON rumRuleJSON `json:"-"`
+}
+
+// rumRuleJSON contains the JSON metadata for the struct [RUMRule]
+type rumRuleJSON struct {
+ ID apijson.Field
+ Created apijson.Field
+ Host apijson.Field
+ Inclusive apijson.Field
+ IsPaused apijson.Field
+ Paths apijson.Field
+ Priority apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RUMRule) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r rumRuleJSON) RawJSON() string {
+ return r.raw
+}
+
+type RuleListResponse struct {
+ // A list of rules.
+ Rules []RUMRule `json:"rules"`
+ Ruleset RuleListResponseRuleset `json:"ruleset"`
+ JSON ruleListResponseJSON `json:"-"`
+}
+
+// ruleListResponseJSON contains the JSON metadata for the struct
+// [RuleListResponse]
+type ruleListResponseJSON struct {
+ Rules apijson.Field
+ Ruleset apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RuleListResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ruleListResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type RuleListResponseRuleset struct {
+ // The Web Analytics ruleset identifier.
+ ID string `json:"id"`
+ // Whether the ruleset is enabled.
+ Enabled bool `json:"enabled"`
+ ZoneName string `json:"zone_name"`
+ // The zone identifier.
+ ZoneTag string `json:"zone_tag"`
+ JSON ruleListResponseRulesetJSON `json:"-"`
+}
+
+// ruleListResponseRulesetJSON contains the JSON metadata for the struct
+// [RuleListResponseRuleset]
+type ruleListResponseRulesetJSON struct {
+ ID apijson.Field
+ Enabled apijson.Field
+ ZoneName apijson.Field
+ ZoneTag apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RuleListResponseRuleset) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ruleListResponseRulesetJSON) RawJSON() string {
+ return r.raw
+}
+
+type RuleDeleteResponse struct {
+ // The Web Analytics rule identifier.
+ ID string `json:"id"`
+ JSON ruleDeleteResponseJSON `json:"-"`
+}
+
+// ruleDeleteResponseJSON contains the JSON metadata for the struct
+// [RuleDeleteResponse]
+type ruleDeleteResponseJSON struct {
+ ID apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RuleDeleteResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ruleDeleteResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type RuleNewParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ Host param.Field[string] `json:"host"`
+ // Whether the rule includes or excludes traffic from being measured.
+ Inclusive param.Field[bool] `json:"inclusive"`
+ // Whether the rule is paused or not.
+ IsPaused param.Field[bool] `json:"is_paused"`
+ Paths param.Field[[]string] `json:"paths"`
+}
+
+func (r RuleNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type RuleNewResponseEnvelope struct {
+ Result RUMRule `json:"result"`
+ JSON ruleNewResponseEnvelopeJSON `json:"-"`
+}
+
+// ruleNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [RuleNewResponseEnvelope]
+type ruleNewResponseEnvelopeJSON struct {
+ Result apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RuleNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ruleNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type RuleUpdateParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ Host param.Field[string] `json:"host"`
+ // Whether the rule includes or excludes traffic from being measured.
+ Inclusive param.Field[bool] `json:"inclusive"`
+ // Whether the rule is paused or not.
+ IsPaused param.Field[bool] `json:"is_paused"`
+ Paths param.Field[[]string] `json:"paths"`
+}
+
+func (r RuleUpdateParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type RuleUpdateResponseEnvelope struct {
+ Result RUMRule `json:"result"`
+ JSON ruleUpdateResponseEnvelopeJSON `json:"-"`
+}
+
+// ruleUpdateResponseEnvelopeJSON contains the JSON metadata for the struct
+// [RuleUpdateResponseEnvelope]
+type ruleUpdateResponseEnvelopeJSON struct {
+ Result apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RuleUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ruleUpdateResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type RuleListParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type RuleListResponseEnvelope struct {
+ Result RuleListResponse `json:"result"`
+ JSON ruleListResponseEnvelopeJSON `json:"-"`
+}
+
+// ruleListResponseEnvelopeJSON contains the JSON metadata for the struct
+// [RuleListResponseEnvelope]
+type ruleListResponseEnvelopeJSON struct {
+ Result apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RuleListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ruleListResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type RuleDeleteParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type RuleDeleteResponseEnvelope struct {
+ Result RuleDeleteResponse `json:"result"`
+ JSON ruleDeleteResponseEnvelopeJSON `json:"-"`
+}
+
+// ruleDeleteResponseEnvelopeJSON contains the JSON metadata for the struct
+// [RuleDeleteResponseEnvelope]
+type ruleDeleteResponseEnvelopeJSON struct {
+ Result apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RuleDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ruleDeleteResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/rum/rule_test.go b/rum/rule_test.go
new file mode 100644
index 00000000000..daba261be46
--- /dev/null
+++ b/rum/rule_test.go
@@ -0,0 +1,145 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package rum_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/rum"
+)
+
+func TestRuleNewWithOptionalParams(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"),
+ )
+ _, err := client.RUM.Rules.New(
+ context.TODO(),
+ "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ rum.RuleNewParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Host: cloudflare.F("example.com"),
+ Inclusive: cloudflare.F(true),
+ IsPaused: cloudflare.F(false),
+ Paths: cloudflare.F([]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())
+ }
+}
+
+func TestRuleUpdateWithOptionalParams(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"),
+ )
+ _, err := client.RUM.Rules.Update(
+ context.TODO(),
+ "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ rum.RuleUpdateParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Host: cloudflare.F("example.com"),
+ Inclusive: cloudflare.F(true),
+ IsPaused: cloudflare.F(false),
+ Paths: cloudflare.F([]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())
+ }
+}
+
+func TestRuleList(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"),
+ )
+ _, err := client.RUM.Rules.List(
+ context.TODO(),
+ "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ rum.RuleListParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestRuleDelete(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"),
+ )
+ _, err := client.RUM.Rules.Delete(
+ context.TODO(),
+ "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
+ rum.RuleDeleteParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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/rum.go b/rum/rum.go
similarity index 83%
rename from rum.go
rename to rum/rum.go
index da7e91f75ce..ff7e53eae1b 100644
--- a/rum.go
+++ b/rum/rum.go
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package cloudflare
+package rum
import (
"github.com/cloudflare/cloudflare-go/option"
@@ -12,8 +12,8 @@ import (
// directly, and instead use the [NewRUMService] method instead.
type RUMService struct {
Options []option.RequestOption
- SiteInfos *RUMSiteInfoService
- Rules *RUMRuleService
+ SiteInfos *SiteInfoService
+ Rules *RuleService
}
// NewRUMService generates a new service that applies the given options to each
@@ -22,7 +22,7 @@ type RUMService struct {
func NewRUMService(opts ...option.RequestOption) (r *RUMService) {
r = &RUMService{}
r.Options = opts
- r.SiteInfos = NewRUMSiteInfoService(opts...)
- r.Rules = NewRUMRuleService(opts...)
+ r.SiteInfos = NewSiteInfoService(opts...)
+ r.Rules = NewRuleService(opts...)
return
}
diff --git a/rum/siteinfo.go b/rum/siteinfo.go
new file mode 100644
index 00000000000..b0ce8d46111
--- /dev/null
+++ b/rum/siteinfo.go
@@ -0,0 +1,352 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package rum
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// SiteInfoService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewSiteInfoService] method instead.
+type SiteInfoService struct {
+ Options []option.RequestOption
+}
+
+// NewSiteInfoService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewSiteInfoService(opts ...option.RequestOption) (r *SiteInfoService) {
+ r = &SiteInfoService{}
+ r.Options = opts
+ return
+}
+
+// Creates a new Web Analytics site.
+func (r *SiteInfoService) New(ctx context.Context, params SiteInfoNewParams, opts ...option.RequestOption) (res *RUMSite, err error) {
+ opts = append(r.Options[:], opts...)
+ var env SiteInfoNewResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/rum/site_info", params.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Updates an existing Web Analytics site.
+func (r *SiteInfoService) Update(ctx context.Context, siteID string, params SiteInfoUpdateParams, opts ...option.RequestOption) (res *RUMSite, err error) {
+ opts = append(r.Options[:], opts...)
+ var env SiteInfoUpdateResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/rum/site_info/%s", params.AccountID, siteID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Lists all Web Analytics sites of an account.
+func (r *SiteInfoService) List(ctx context.Context, params SiteInfoListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[RUMSite], err error) {
+ var raw *http.Response
+ opts = append(r.Options, opts...)
+ opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
+ path := fmt.Sprintf("accounts/%s/rum/site_info/list", params.AccountID)
+ cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, params, &res, opts...)
+ if err != nil {
+ return nil, err
+ }
+ err = cfg.Execute()
+ if err != nil {
+ return nil, err
+ }
+ res.SetPageConfig(cfg, raw)
+ return res, nil
+}
+
+// Lists all Web Analytics sites of an account.
+func (r *SiteInfoService) ListAutoPaging(ctx context.Context, params SiteInfoListParams, opts ...option.RequestOption) *shared.V4PagePaginationArrayAutoPager[RUMSite] {
+ return shared.NewV4PagePaginationArrayAutoPager(r.List(ctx, params, opts...))
+}
+
+// Deletes an existing Web Analytics site.
+func (r *SiteInfoService) Delete(ctx context.Context, siteID string, body SiteInfoDeleteParams, opts ...option.RequestOption) (res *SiteInfoDeleteResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env SiteInfoDeleteResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/rum/site_info/%s", body.AccountID, siteID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Retrieves a Web Analytics site.
+func (r *SiteInfoService) Get(ctx context.Context, siteID string, query SiteInfoGetParams, opts ...option.RequestOption) (res *RUMSite, err error) {
+ opts = append(r.Options[:], opts...)
+ var env SiteInfoGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/rum/site_info/%s", query.AccountID, siteID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type RUMSite struct {
+ // If enabled, the JavaScript snippet is automatically injected for orange-clouded
+ // sites.
+ AutoInstall bool `json:"auto_install"`
+ Created time.Time `json:"created" format:"date-time"`
+ // A list of rules.
+ Rules []RUMRule `json:"rules"`
+ Ruleset RUMSiteRuleset `json:"ruleset"`
+ // The Web Analytics site identifier.
+ SiteTag string `json:"site_tag"`
+ // The Web Analytics site token.
+ SiteToken string `json:"site_token"`
+ // Encoded JavaScript snippet.
+ Snippet string `json:"snippet"`
+ JSON rumSiteJSON `json:"-"`
+}
+
+// rumSiteJSON contains the JSON metadata for the struct [RUMSite]
+type rumSiteJSON struct {
+ AutoInstall apijson.Field
+ Created apijson.Field
+ Rules apijson.Field
+ Ruleset apijson.Field
+ SiteTag apijson.Field
+ SiteToken apijson.Field
+ Snippet apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RUMSite) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r rumSiteJSON) RawJSON() string {
+ return r.raw
+}
+
+type RUMSiteRuleset struct {
+ // The Web Analytics ruleset identifier.
+ ID string `json:"id"`
+ // Whether the ruleset is enabled.
+ Enabled bool `json:"enabled"`
+ ZoneName string `json:"zone_name"`
+ // The zone identifier.
+ ZoneTag string `json:"zone_tag"`
+ JSON rumSiteRulesetJSON `json:"-"`
+}
+
+// rumSiteRulesetJSON contains the JSON metadata for the struct [RUMSiteRuleset]
+type rumSiteRulesetJSON struct {
+ ID apijson.Field
+ Enabled apijson.Field
+ ZoneName apijson.Field
+ ZoneTag apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RUMSiteRuleset) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r rumSiteRulesetJSON) RawJSON() string {
+ return r.raw
+}
+
+type SiteInfoDeleteResponse struct {
+ // The Web Analytics site identifier.
+ SiteTag string `json:"site_tag"`
+ JSON siteInfoDeleteResponseJSON `json:"-"`
+}
+
+// siteInfoDeleteResponseJSON contains the JSON metadata for the struct
+// [SiteInfoDeleteResponse]
+type siteInfoDeleteResponseJSON struct {
+ SiteTag apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *SiteInfoDeleteResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r siteInfoDeleteResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type SiteInfoNewParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ // If enabled, the JavaScript snippet is automatically injected for orange-clouded
+ // sites.
+ AutoInstall param.Field[bool] `json:"auto_install"`
+ // The hostname to use for gray-clouded sites.
+ Host param.Field[string] `json:"host"`
+ // The zone identifier.
+ ZoneTag param.Field[string] `json:"zone_tag"`
+}
+
+func (r SiteInfoNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type SiteInfoNewResponseEnvelope struct {
+ Result RUMSite `json:"result"`
+ JSON siteInfoNewResponseEnvelopeJSON `json:"-"`
+}
+
+// siteInfoNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [SiteInfoNewResponseEnvelope]
+type siteInfoNewResponseEnvelopeJSON struct {
+ Result apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *SiteInfoNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r siteInfoNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type SiteInfoUpdateParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ // If enabled, the JavaScript snippet is automatically injected for orange-clouded
+ // sites.
+ AutoInstall param.Field[bool] `json:"auto_install"`
+ // The hostname to use for gray-clouded sites.
+ Host param.Field[string] `json:"host"`
+ // The zone identifier.
+ ZoneTag param.Field[string] `json:"zone_tag"`
+}
+
+func (r SiteInfoUpdateParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type SiteInfoUpdateResponseEnvelope struct {
+ Result RUMSite `json:"result"`
+ JSON siteInfoUpdateResponseEnvelopeJSON `json:"-"`
+}
+
+// siteInfoUpdateResponseEnvelopeJSON contains the JSON metadata for the struct
+// [SiteInfoUpdateResponseEnvelope]
+type siteInfoUpdateResponseEnvelopeJSON struct {
+ Result apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *SiteInfoUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r siteInfoUpdateResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type SiteInfoListParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ // The property used to sort the list of results.
+ OrderBy param.Field[SiteInfoListParamsOrderBy] `query:"order_by"`
+ // Current page within the paginated list of results.
+ Page param.Field[float64] `query:"page"`
+ // Number of items to return per page of results.
+ PerPage param.Field[float64] `query:"per_page"`
+}
+
+// URLQuery serializes [SiteInfoListParams]'s query parameters as `url.Values`.
+func (r SiteInfoListParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// The property used to sort the list of results.
+type SiteInfoListParamsOrderBy string
+
+const (
+ SiteInfoListParamsOrderByHost SiteInfoListParamsOrderBy = "host"
+ SiteInfoListParamsOrderByCreated SiteInfoListParamsOrderBy = "created"
+)
+
+type SiteInfoDeleteParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type SiteInfoDeleteResponseEnvelope struct {
+ Result SiteInfoDeleteResponse `json:"result"`
+ JSON siteInfoDeleteResponseEnvelopeJSON `json:"-"`
+}
+
+// siteInfoDeleteResponseEnvelopeJSON contains the JSON metadata for the struct
+// [SiteInfoDeleteResponseEnvelope]
+type siteInfoDeleteResponseEnvelopeJSON struct {
+ Result apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *SiteInfoDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r siteInfoDeleteResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type SiteInfoGetParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type SiteInfoGetResponseEnvelope struct {
+ Result RUMSite `json:"result"`
+ JSON siteInfoGetResponseEnvelopeJSON `json:"-"`
+}
+
+// siteInfoGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [SiteInfoGetResponseEnvelope]
+type siteInfoGetResponseEnvelopeJSON struct {
+ Result apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *SiteInfoGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r siteInfoGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/rum/siteinfo_test.go b/rum/siteinfo_test.go
new file mode 100644
index 00000000000..2ebddcf8318
--- /dev/null
+++ b/rum/siteinfo_test.go
@@ -0,0 +1,166 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package rum_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/rum"
+)
+
+func TestSiteInfoNewWithOptionalParams(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"),
+ )
+ _, err := client.RUM.SiteInfos.New(context.TODO(), rum.SiteInfoNewParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ AutoInstall: cloudflare.F(true),
+ Host: cloudflare.F("example.com"),
+ ZoneTag: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ })
+ 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())
+ }
+}
+
+func TestSiteInfoUpdateWithOptionalParams(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"),
+ )
+ _, err := client.RUM.SiteInfos.Update(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ rum.SiteInfoUpdateParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ AutoInstall: cloudflare.F(true),
+ Host: cloudflare.F("example.com"),
+ ZoneTag: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestSiteInfoListWithOptionalParams(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"),
+ )
+ _, err := client.RUM.SiteInfos.List(context.TODO(), rum.SiteInfoListParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ OrderBy: cloudflare.F(rum.SiteInfoListParamsOrderByHost),
+ Page: cloudflare.F(1.000000),
+ PerPage: cloudflare.F(10.000000),
+ })
+ 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())
+ }
+}
+
+func TestSiteInfoDelete(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"),
+ )
+ _, err := client.RUM.SiteInfos.Delete(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ rum.SiteInfoDeleteParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestSiteInfoGet(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"),
+ )
+ _, err := client.RUM.SiteInfos.Get(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ rum.SiteInfoGetParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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/rumrule.go b/rumrule.go
deleted file mode 100644
index 3ab7e7c6872..00000000000
--- a/rumrule.go
+++ /dev/null
@@ -1,398 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RUMRuleService contains methods and other services that help with interacting
-// with the cloudflare API. Note, unlike clients, this service does not read
-// variables from the environment automatically. You should not instantiate this
-// service directly, and instead use the [NewRUMRuleService] method instead.
-type RUMRuleService struct {
- Options []option.RequestOption
-}
-
-// NewRUMRuleService generates a new service that applies the given options to each
-// request. These options are applied after the parent client's options (if there
-// is one), and before any request-specific options.
-func NewRUMRuleService(opts ...option.RequestOption) (r *RUMRuleService) {
- r = &RUMRuleService{}
- r.Options = opts
- return
-}
-
-// Creates a new rule in a Web Analytics ruleset.
-func (r *RUMRuleService) New(ctx context.Context, rulesetID string, params RUMRuleNewParams, opts ...option.RequestOption) (res *RUMRuleNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RUMRuleNewResponseEnvelope
- path := fmt.Sprintf("accounts/%s/rum/v2/%s/rule", params.AccountID, rulesetID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Updates a rule in a Web Analytics ruleset.
-func (r *RUMRuleService) Update(ctx context.Context, rulesetID string, ruleID string, params RUMRuleUpdateParams, opts ...option.RequestOption) (res *RUMRuleUpdateResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RUMRuleUpdateResponseEnvelope
- path := fmt.Sprintf("accounts/%s/rum/v2/%s/rule/%s", params.AccountID, rulesetID, ruleID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Lists all the rules in a Web Analytics ruleset.
-func (r *RUMRuleService) List(ctx context.Context, rulesetID string, query RUMRuleListParams, opts ...option.RequestOption) (res *RUMRuleListResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RUMRuleListResponseEnvelope
- path := fmt.Sprintf("accounts/%s/rum/v2/%s/rules", query.AccountID, rulesetID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Deletes an existing rule from a Web Analytics ruleset.
-func (r *RUMRuleService) Delete(ctx context.Context, rulesetID string, ruleID string, body RUMRuleDeleteParams, opts ...option.RequestOption) (res *RUMRuleDeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RUMRuleDeleteResponseEnvelope
- path := fmt.Sprintf("accounts/%s/rum/v2/%s/rule/%s", body.AccountID, rulesetID, ruleID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type RUMRuleNewResponse struct {
- // The Web Analytics rule identifier.
- ID string `json:"id"`
- Created time.Time `json:"created" format:"date-time"`
- // The hostname the rule will be applied to.
- Host string `json:"host"`
- // Whether the rule includes or excludes traffic from being measured.
- Inclusive bool `json:"inclusive"`
- // Whether the rule is paused or not.
- IsPaused bool `json:"is_paused"`
- // The paths the rule will be applied to.
- Paths []string `json:"paths"`
- Priority float64 `json:"priority"`
- JSON rumRuleNewResponseJSON `json:"-"`
-}
-
-// rumRuleNewResponseJSON contains the JSON metadata for the struct
-// [RUMRuleNewResponse]
-type rumRuleNewResponseJSON struct {
- ID apijson.Field
- Created apijson.Field
- Host apijson.Field
- Inclusive apijson.Field
- IsPaused apijson.Field
- Paths apijson.Field
- Priority apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RUMRuleNewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rumRuleNewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RUMRuleUpdateResponse struct {
- // The Web Analytics rule identifier.
- ID string `json:"id"`
- Created time.Time `json:"created" format:"date-time"`
- // The hostname the rule will be applied to.
- Host string `json:"host"`
- // Whether the rule includes or excludes traffic from being measured.
- Inclusive bool `json:"inclusive"`
- // Whether the rule is paused or not.
- IsPaused bool `json:"is_paused"`
- // The paths the rule will be applied to.
- Paths []string `json:"paths"`
- Priority float64 `json:"priority"`
- JSON rumRuleUpdateResponseJSON `json:"-"`
-}
-
-// rumRuleUpdateResponseJSON contains the JSON metadata for the struct
-// [RUMRuleUpdateResponse]
-type rumRuleUpdateResponseJSON struct {
- ID apijson.Field
- Created apijson.Field
- Host apijson.Field
- Inclusive apijson.Field
- IsPaused apijson.Field
- Paths apijson.Field
- Priority apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RUMRuleUpdateResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rumRuleUpdateResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RUMRuleListResponse struct {
- // A list of rules.
- Rules []RUMRuleListResponseRule `json:"rules"`
- Ruleset RUMRuleListResponseRuleset `json:"ruleset"`
- JSON rumRuleListResponseJSON `json:"-"`
-}
-
-// rumRuleListResponseJSON contains the JSON metadata for the struct
-// [RUMRuleListResponse]
-type rumRuleListResponseJSON struct {
- Rules apijson.Field
- Ruleset apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RUMRuleListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rumRuleListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RUMRuleListResponseRule struct {
- // The Web Analytics rule identifier.
- ID string `json:"id"`
- Created time.Time `json:"created" format:"date-time"`
- // The hostname the rule will be applied to.
- Host string `json:"host"`
- // Whether the rule includes or excludes traffic from being measured.
- Inclusive bool `json:"inclusive"`
- // Whether the rule is paused or not.
- IsPaused bool `json:"is_paused"`
- // The paths the rule will be applied to.
- Paths []string `json:"paths"`
- Priority float64 `json:"priority"`
- JSON rumRuleListResponseRuleJSON `json:"-"`
-}
-
-// rumRuleListResponseRuleJSON contains the JSON metadata for the struct
-// [RUMRuleListResponseRule]
-type rumRuleListResponseRuleJSON struct {
- ID apijson.Field
- Created apijson.Field
- Host apijson.Field
- Inclusive apijson.Field
- IsPaused apijson.Field
- Paths apijson.Field
- Priority apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RUMRuleListResponseRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rumRuleListResponseRuleJSON) RawJSON() string {
- return r.raw
-}
-
-type RUMRuleListResponseRuleset struct {
- // The Web Analytics ruleset identifier.
- ID string `json:"id"`
- // Whether the ruleset is enabled.
- Enabled bool `json:"enabled"`
- ZoneName string `json:"zone_name"`
- // The zone identifier.
- ZoneTag string `json:"zone_tag"`
- JSON rumRuleListResponseRulesetJSON `json:"-"`
-}
-
-// rumRuleListResponseRulesetJSON contains the JSON metadata for the struct
-// [RUMRuleListResponseRuleset]
-type rumRuleListResponseRulesetJSON struct {
- ID apijson.Field
- Enabled apijson.Field
- ZoneName apijson.Field
- ZoneTag apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RUMRuleListResponseRuleset) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rumRuleListResponseRulesetJSON) RawJSON() string {
- return r.raw
-}
-
-type RUMRuleDeleteResponse struct {
- // The Web Analytics rule identifier.
- ID string `json:"id"`
- JSON rumRuleDeleteResponseJSON `json:"-"`
-}
-
-// rumRuleDeleteResponseJSON contains the JSON metadata for the struct
-// [RUMRuleDeleteResponse]
-type rumRuleDeleteResponseJSON struct {
- ID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RUMRuleDeleteResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rumRuleDeleteResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RUMRuleNewParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
- Host param.Field[string] `json:"host"`
- // Whether the rule includes or excludes traffic from being measured.
- Inclusive param.Field[bool] `json:"inclusive"`
- // Whether the rule is paused or not.
- IsPaused param.Field[bool] `json:"is_paused"`
- Paths param.Field[[]string] `json:"paths"`
-}
-
-func (r RUMRuleNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type RUMRuleNewResponseEnvelope struct {
- Result RUMRuleNewResponse `json:"result"`
- JSON rumRuleNewResponseEnvelopeJSON `json:"-"`
-}
-
-// rumRuleNewResponseEnvelopeJSON contains the JSON metadata for the struct
-// [RUMRuleNewResponseEnvelope]
-type rumRuleNewResponseEnvelopeJSON struct {
- Result apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RUMRuleNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rumRuleNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RUMRuleUpdateParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
- Host param.Field[string] `json:"host"`
- // Whether the rule includes or excludes traffic from being measured.
- Inclusive param.Field[bool] `json:"inclusive"`
- // Whether the rule is paused or not.
- IsPaused param.Field[bool] `json:"is_paused"`
- Paths param.Field[[]string] `json:"paths"`
-}
-
-func (r RUMRuleUpdateParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type RUMRuleUpdateResponseEnvelope struct {
- Result RUMRuleUpdateResponse `json:"result"`
- JSON rumRuleUpdateResponseEnvelopeJSON `json:"-"`
-}
-
-// rumRuleUpdateResponseEnvelopeJSON contains the JSON metadata for the struct
-// [RUMRuleUpdateResponseEnvelope]
-type rumRuleUpdateResponseEnvelopeJSON struct {
- Result apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RUMRuleUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rumRuleUpdateResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RUMRuleListParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type RUMRuleListResponseEnvelope struct {
- Result RUMRuleListResponse `json:"result"`
- JSON rumRuleListResponseEnvelopeJSON `json:"-"`
-}
-
-// rumRuleListResponseEnvelopeJSON contains the JSON metadata for the struct
-// [RUMRuleListResponseEnvelope]
-type rumRuleListResponseEnvelopeJSON struct {
- Result apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RUMRuleListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rumRuleListResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RUMRuleDeleteParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type RUMRuleDeleteResponseEnvelope struct {
- Result RUMRuleDeleteResponse `json:"result"`
- JSON rumRuleDeleteResponseEnvelopeJSON `json:"-"`
-}
-
-// rumRuleDeleteResponseEnvelopeJSON contains the JSON metadata for the struct
-// [RUMRuleDeleteResponseEnvelope]
-type rumRuleDeleteResponseEnvelopeJSON struct {
- Result apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RUMRuleDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rumRuleDeleteResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
diff --git a/rumrule_test.go b/rumrule_test.go
deleted file mode 100644
index 77f1a6ee7d0..00000000000
--- a/rumrule_test.go
+++ /dev/null
@@ -1,144 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRUMRuleNewWithOptionalParams(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"),
- )
- _, err := client.RUM.Rules.New(
- context.TODO(),
- "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- cloudflare.RUMRuleNewParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Host: cloudflare.F("example.com"),
- Inclusive: cloudflare.F(true),
- IsPaused: cloudflare.F(false),
- Paths: cloudflare.F([]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())
- }
-}
-
-func TestRUMRuleUpdateWithOptionalParams(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"),
- )
- _, err := client.RUM.Rules.Update(
- context.TODO(),
- "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- cloudflare.RUMRuleUpdateParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Host: cloudflare.F("example.com"),
- Inclusive: cloudflare.F(true),
- IsPaused: cloudflare.F(false),
- Paths: cloudflare.F([]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())
- }
-}
-
-func TestRUMRuleList(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"),
- )
- _, err := client.RUM.Rules.List(
- context.TODO(),
- "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- cloudflare.RUMRuleListParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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())
- }
-}
-
-func TestRUMRuleDelete(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"),
- )
- _, err := client.RUM.Rules.Delete(
- context.TODO(),
- "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
- cloudflare.RUMRuleDeleteParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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/rumsiteinfo.go b/rumsiteinfo.go
deleted file mode 100644
index 94cb99dc330..00000000000
--- a/rumsiteinfo.go
+++ /dev/null
@@ -1,714 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// RUMSiteInfoService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewRUMSiteInfoService] method
-// instead.
-type RUMSiteInfoService struct {
- Options []option.RequestOption
-}
-
-// NewRUMSiteInfoService generates a new service that applies the given options to
-// each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewRUMSiteInfoService(opts ...option.RequestOption) (r *RUMSiteInfoService) {
- r = &RUMSiteInfoService{}
- r.Options = opts
- return
-}
-
-// Creates a new Web Analytics site.
-func (r *RUMSiteInfoService) New(ctx context.Context, params RUMSiteInfoNewParams, opts ...option.RequestOption) (res *RUMSiteInfoNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RUMSiteInfoNewResponseEnvelope
- path := fmt.Sprintf("accounts/%s/rum/site_info", params.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Updates an existing Web Analytics site.
-func (r *RUMSiteInfoService) Update(ctx context.Context, siteID string, params RUMSiteInfoUpdateParams, opts ...option.RequestOption) (res *RUMSiteInfoUpdateResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RUMSiteInfoUpdateResponseEnvelope
- path := fmt.Sprintf("accounts/%s/rum/site_info/%s", params.AccountID, siteID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Lists all Web Analytics sites of an account.
-func (r *RUMSiteInfoService) List(ctx context.Context, params RUMSiteInfoListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[RUMSiteInfoListResponse], err error) {
- var raw *http.Response
- opts = append(r.Options, opts...)
- opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
- path := fmt.Sprintf("accounts/%s/rum/site_info/list", params.AccountID)
- cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, params, &res, opts...)
- if err != nil {
- return nil, err
- }
- err = cfg.Execute()
- if err != nil {
- return nil, err
- }
- res.SetPageConfig(cfg, raw)
- return res, nil
-}
-
-// Lists all Web Analytics sites of an account.
-func (r *RUMSiteInfoService) ListAutoPaging(ctx context.Context, params RUMSiteInfoListParams, opts ...option.RequestOption) *shared.V4PagePaginationArrayAutoPager[RUMSiteInfoListResponse] {
- return shared.NewV4PagePaginationArrayAutoPager(r.List(ctx, params, opts...))
-}
-
-// Deletes an existing Web Analytics site.
-func (r *RUMSiteInfoService) Delete(ctx context.Context, siteID string, body RUMSiteInfoDeleteParams, opts ...option.RequestOption) (res *RUMSiteInfoDeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RUMSiteInfoDeleteResponseEnvelope
- path := fmt.Sprintf("accounts/%s/rum/site_info/%s", body.AccountID, siteID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Retrieves a Web Analytics site.
-func (r *RUMSiteInfoService) Get(ctx context.Context, siteID string, query RUMSiteInfoGetParams, opts ...option.RequestOption) (res *RUMSiteInfoGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env RUMSiteInfoGetResponseEnvelope
- path := fmt.Sprintf("accounts/%s/rum/site_info/%s", query.AccountID, siteID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type RUMSiteInfoNewResponse struct {
- // If enabled, the JavaScript snippet is automatically injected for orange-clouded
- // sites.
- AutoInstall bool `json:"auto_install"`
- Created time.Time `json:"created" format:"date-time"`
- // A list of rules.
- Rules []RUMSiteInfoNewResponseRule `json:"rules"`
- Ruleset RUMSiteInfoNewResponseRuleset `json:"ruleset"`
- // The Web Analytics site identifier.
- SiteTag string `json:"site_tag"`
- // The Web Analytics site token.
- SiteToken string `json:"site_token"`
- // Encoded JavaScript snippet.
- Snippet string `json:"snippet"`
- JSON rumSiteInfoNewResponseJSON `json:"-"`
-}
-
-// rumSiteInfoNewResponseJSON contains the JSON metadata for the struct
-// [RUMSiteInfoNewResponse]
-type rumSiteInfoNewResponseJSON struct {
- AutoInstall apijson.Field
- Created apijson.Field
- Rules apijson.Field
- Ruleset apijson.Field
- SiteTag apijson.Field
- SiteToken apijson.Field
- Snippet apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RUMSiteInfoNewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rumSiteInfoNewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RUMSiteInfoNewResponseRule struct {
- // The Web Analytics rule identifier.
- ID string `json:"id"`
- Created time.Time `json:"created" format:"date-time"`
- // The hostname the rule will be applied to.
- Host string `json:"host"`
- // Whether the rule includes or excludes traffic from being measured.
- Inclusive bool `json:"inclusive"`
- // Whether the rule is paused or not.
- IsPaused bool `json:"is_paused"`
- // The paths the rule will be applied to.
- Paths []string `json:"paths"`
- Priority float64 `json:"priority"`
- JSON rumSiteInfoNewResponseRuleJSON `json:"-"`
-}
-
-// rumSiteInfoNewResponseRuleJSON contains the JSON metadata for the struct
-// [RUMSiteInfoNewResponseRule]
-type rumSiteInfoNewResponseRuleJSON struct {
- ID apijson.Field
- Created apijson.Field
- Host apijson.Field
- Inclusive apijson.Field
- IsPaused apijson.Field
- Paths apijson.Field
- Priority apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RUMSiteInfoNewResponseRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rumSiteInfoNewResponseRuleJSON) RawJSON() string {
- return r.raw
-}
-
-type RUMSiteInfoNewResponseRuleset struct {
- // The Web Analytics ruleset identifier.
- ID string `json:"id"`
- // Whether the ruleset is enabled.
- Enabled bool `json:"enabled"`
- ZoneName string `json:"zone_name"`
- // The zone identifier.
- ZoneTag string `json:"zone_tag"`
- JSON rumSiteInfoNewResponseRulesetJSON `json:"-"`
-}
-
-// rumSiteInfoNewResponseRulesetJSON contains the JSON metadata for the struct
-// [RUMSiteInfoNewResponseRuleset]
-type rumSiteInfoNewResponseRulesetJSON struct {
- ID apijson.Field
- Enabled apijson.Field
- ZoneName apijson.Field
- ZoneTag apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RUMSiteInfoNewResponseRuleset) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rumSiteInfoNewResponseRulesetJSON) RawJSON() string {
- return r.raw
-}
-
-type RUMSiteInfoUpdateResponse struct {
- // If enabled, the JavaScript snippet is automatically injected for orange-clouded
- // sites.
- AutoInstall bool `json:"auto_install"`
- Created time.Time `json:"created" format:"date-time"`
- // A list of rules.
- Rules []RUMSiteInfoUpdateResponseRule `json:"rules"`
- Ruleset RUMSiteInfoUpdateResponseRuleset `json:"ruleset"`
- // The Web Analytics site identifier.
- SiteTag string `json:"site_tag"`
- // The Web Analytics site token.
- SiteToken string `json:"site_token"`
- // Encoded JavaScript snippet.
- Snippet string `json:"snippet"`
- JSON rumSiteInfoUpdateResponseJSON `json:"-"`
-}
-
-// rumSiteInfoUpdateResponseJSON contains the JSON metadata for the struct
-// [RUMSiteInfoUpdateResponse]
-type rumSiteInfoUpdateResponseJSON struct {
- AutoInstall apijson.Field
- Created apijson.Field
- Rules apijson.Field
- Ruleset apijson.Field
- SiteTag apijson.Field
- SiteToken apijson.Field
- Snippet apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RUMSiteInfoUpdateResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rumSiteInfoUpdateResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RUMSiteInfoUpdateResponseRule struct {
- // The Web Analytics rule identifier.
- ID string `json:"id"`
- Created time.Time `json:"created" format:"date-time"`
- // The hostname the rule will be applied to.
- Host string `json:"host"`
- // Whether the rule includes or excludes traffic from being measured.
- Inclusive bool `json:"inclusive"`
- // Whether the rule is paused or not.
- IsPaused bool `json:"is_paused"`
- // The paths the rule will be applied to.
- Paths []string `json:"paths"`
- Priority float64 `json:"priority"`
- JSON rumSiteInfoUpdateResponseRuleJSON `json:"-"`
-}
-
-// rumSiteInfoUpdateResponseRuleJSON contains the JSON metadata for the struct
-// [RUMSiteInfoUpdateResponseRule]
-type rumSiteInfoUpdateResponseRuleJSON struct {
- ID apijson.Field
- Created apijson.Field
- Host apijson.Field
- Inclusive apijson.Field
- IsPaused apijson.Field
- Paths apijson.Field
- Priority apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RUMSiteInfoUpdateResponseRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rumSiteInfoUpdateResponseRuleJSON) RawJSON() string {
- return r.raw
-}
-
-type RUMSiteInfoUpdateResponseRuleset struct {
- // The Web Analytics ruleset identifier.
- ID string `json:"id"`
- // Whether the ruleset is enabled.
- Enabled bool `json:"enabled"`
- ZoneName string `json:"zone_name"`
- // The zone identifier.
- ZoneTag string `json:"zone_tag"`
- JSON rumSiteInfoUpdateResponseRulesetJSON `json:"-"`
-}
-
-// rumSiteInfoUpdateResponseRulesetJSON contains the JSON metadata for the struct
-// [RUMSiteInfoUpdateResponseRuleset]
-type rumSiteInfoUpdateResponseRulesetJSON struct {
- ID apijson.Field
- Enabled apijson.Field
- ZoneName apijson.Field
- ZoneTag apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RUMSiteInfoUpdateResponseRuleset) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rumSiteInfoUpdateResponseRulesetJSON) RawJSON() string {
- return r.raw
-}
-
-type RUMSiteInfoListResponse struct {
- // If enabled, the JavaScript snippet is automatically injected for orange-clouded
- // sites.
- AutoInstall bool `json:"auto_install"`
- Created time.Time `json:"created" format:"date-time"`
- // A list of rules.
- Rules []RUMSiteInfoListResponseRule `json:"rules"`
- Ruleset RUMSiteInfoListResponseRuleset `json:"ruleset"`
- // The Web Analytics site identifier.
- SiteTag string `json:"site_tag"`
- // The Web Analytics site token.
- SiteToken string `json:"site_token"`
- // Encoded JavaScript snippet.
- Snippet string `json:"snippet"`
- JSON rumSiteInfoListResponseJSON `json:"-"`
-}
-
-// rumSiteInfoListResponseJSON contains the JSON metadata for the struct
-// [RUMSiteInfoListResponse]
-type rumSiteInfoListResponseJSON struct {
- AutoInstall apijson.Field
- Created apijson.Field
- Rules apijson.Field
- Ruleset apijson.Field
- SiteTag apijson.Field
- SiteToken apijson.Field
- Snippet apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RUMSiteInfoListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rumSiteInfoListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RUMSiteInfoListResponseRule struct {
- // The Web Analytics rule identifier.
- ID string `json:"id"`
- Created time.Time `json:"created" format:"date-time"`
- // The hostname the rule will be applied to.
- Host string `json:"host"`
- // Whether the rule includes or excludes traffic from being measured.
- Inclusive bool `json:"inclusive"`
- // Whether the rule is paused or not.
- IsPaused bool `json:"is_paused"`
- // The paths the rule will be applied to.
- Paths []string `json:"paths"`
- Priority float64 `json:"priority"`
- JSON rumSiteInfoListResponseRuleJSON `json:"-"`
-}
-
-// rumSiteInfoListResponseRuleJSON contains the JSON metadata for the struct
-// [RUMSiteInfoListResponseRule]
-type rumSiteInfoListResponseRuleJSON struct {
- ID apijson.Field
- Created apijson.Field
- Host apijson.Field
- Inclusive apijson.Field
- IsPaused apijson.Field
- Paths apijson.Field
- Priority apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RUMSiteInfoListResponseRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rumSiteInfoListResponseRuleJSON) RawJSON() string {
- return r.raw
-}
-
-type RUMSiteInfoListResponseRuleset struct {
- // The Web Analytics ruleset identifier.
- ID string `json:"id"`
- // Whether the ruleset is enabled.
- Enabled bool `json:"enabled"`
- ZoneName string `json:"zone_name"`
- // The zone identifier.
- ZoneTag string `json:"zone_tag"`
- JSON rumSiteInfoListResponseRulesetJSON `json:"-"`
-}
-
-// rumSiteInfoListResponseRulesetJSON contains the JSON metadata for the struct
-// [RUMSiteInfoListResponseRuleset]
-type rumSiteInfoListResponseRulesetJSON struct {
- ID apijson.Field
- Enabled apijson.Field
- ZoneName apijson.Field
- ZoneTag apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RUMSiteInfoListResponseRuleset) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rumSiteInfoListResponseRulesetJSON) RawJSON() string {
- return r.raw
-}
-
-type RUMSiteInfoDeleteResponse struct {
- // The Web Analytics site identifier.
- SiteTag string `json:"site_tag"`
- JSON rumSiteInfoDeleteResponseJSON `json:"-"`
-}
-
-// rumSiteInfoDeleteResponseJSON contains the JSON metadata for the struct
-// [RUMSiteInfoDeleteResponse]
-type rumSiteInfoDeleteResponseJSON struct {
- SiteTag apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RUMSiteInfoDeleteResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rumSiteInfoDeleteResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RUMSiteInfoGetResponse struct {
- // If enabled, the JavaScript snippet is automatically injected for orange-clouded
- // sites.
- AutoInstall bool `json:"auto_install"`
- Created time.Time `json:"created" format:"date-time"`
- // A list of rules.
- Rules []RUMSiteInfoGetResponseRule `json:"rules"`
- Ruleset RUMSiteInfoGetResponseRuleset `json:"ruleset"`
- // The Web Analytics site identifier.
- SiteTag string `json:"site_tag"`
- // The Web Analytics site token.
- SiteToken string `json:"site_token"`
- // Encoded JavaScript snippet.
- Snippet string `json:"snippet"`
- JSON rumSiteInfoGetResponseJSON `json:"-"`
-}
-
-// rumSiteInfoGetResponseJSON contains the JSON metadata for the struct
-// [RUMSiteInfoGetResponse]
-type rumSiteInfoGetResponseJSON struct {
- AutoInstall apijson.Field
- Created apijson.Field
- Rules apijson.Field
- Ruleset apijson.Field
- SiteTag apijson.Field
- SiteToken apijson.Field
- Snippet apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RUMSiteInfoGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rumSiteInfoGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type RUMSiteInfoGetResponseRule struct {
- // The Web Analytics rule identifier.
- ID string `json:"id"`
- Created time.Time `json:"created" format:"date-time"`
- // The hostname the rule will be applied to.
- Host string `json:"host"`
- // Whether the rule includes or excludes traffic from being measured.
- Inclusive bool `json:"inclusive"`
- // Whether the rule is paused or not.
- IsPaused bool `json:"is_paused"`
- // The paths the rule will be applied to.
- Paths []string `json:"paths"`
- Priority float64 `json:"priority"`
- JSON rumSiteInfoGetResponseRuleJSON `json:"-"`
-}
-
-// rumSiteInfoGetResponseRuleJSON contains the JSON metadata for the struct
-// [RUMSiteInfoGetResponseRule]
-type rumSiteInfoGetResponseRuleJSON struct {
- ID apijson.Field
- Created apijson.Field
- Host apijson.Field
- Inclusive apijson.Field
- IsPaused apijson.Field
- Paths apijson.Field
- Priority apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RUMSiteInfoGetResponseRule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rumSiteInfoGetResponseRuleJSON) RawJSON() string {
- return r.raw
-}
-
-type RUMSiteInfoGetResponseRuleset struct {
- // The Web Analytics ruleset identifier.
- ID string `json:"id"`
- // Whether the ruleset is enabled.
- Enabled bool `json:"enabled"`
- ZoneName string `json:"zone_name"`
- // The zone identifier.
- ZoneTag string `json:"zone_tag"`
- JSON rumSiteInfoGetResponseRulesetJSON `json:"-"`
-}
-
-// rumSiteInfoGetResponseRulesetJSON contains the JSON metadata for the struct
-// [RUMSiteInfoGetResponseRuleset]
-type rumSiteInfoGetResponseRulesetJSON struct {
- ID apijson.Field
- Enabled apijson.Field
- ZoneName apijson.Field
- ZoneTag apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RUMSiteInfoGetResponseRuleset) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rumSiteInfoGetResponseRulesetJSON) RawJSON() string {
- return r.raw
-}
-
-type RUMSiteInfoNewParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
- // If enabled, the JavaScript snippet is automatically injected for orange-clouded
- // sites.
- AutoInstall param.Field[bool] `json:"auto_install"`
- // The hostname to use for gray-clouded sites.
- Host param.Field[string] `json:"host"`
- // The zone identifier.
- ZoneTag param.Field[string] `json:"zone_tag"`
-}
-
-func (r RUMSiteInfoNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type RUMSiteInfoNewResponseEnvelope struct {
- Result RUMSiteInfoNewResponse `json:"result"`
- JSON rumSiteInfoNewResponseEnvelopeJSON `json:"-"`
-}
-
-// rumSiteInfoNewResponseEnvelopeJSON contains the JSON metadata for the struct
-// [RUMSiteInfoNewResponseEnvelope]
-type rumSiteInfoNewResponseEnvelopeJSON struct {
- Result apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RUMSiteInfoNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rumSiteInfoNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RUMSiteInfoUpdateParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
- // If enabled, the JavaScript snippet is automatically injected for orange-clouded
- // sites.
- AutoInstall param.Field[bool] `json:"auto_install"`
- // The hostname to use for gray-clouded sites.
- Host param.Field[string] `json:"host"`
- // The zone identifier.
- ZoneTag param.Field[string] `json:"zone_tag"`
-}
-
-func (r RUMSiteInfoUpdateParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type RUMSiteInfoUpdateResponseEnvelope struct {
- Result RUMSiteInfoUpdateResponse `json:"result"`
- JSON rumSiteInfoUpdateResponseEnvelopeJSON `json:"-"`
-}
-
-// rumSiteInfoUpdateResponseEnvelopeJSON contains the JSON metadata for the struct
-// [RUMSiteInfoUpdateResponseEnvelope]
-type rumSiteInfoUpdateResponseEnvelopeJSON struct {
- Result apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RUMSiteInfoUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rumSiteInfoUpdateResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RUMSiteInfoListParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
- // The property used to sort the list of results.
- OrderBy param.Field[RUMSiteInfoListParamsOrderBy] `query:"order_by"`
- // Current page within the paginated list of results.
- Page param.Field[float64] `query:"page"`
- // Number of items to return per page of results.
- PerPage param.Field[float64] `query:"per_page"`
-}
-
-// URLQuery serializes [RUMSiteInfoListParams]'s query parameters as `url.Values`.
-func (r RUMSiteInfoListParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// The property used to sort the list of results.
-type RUMSiteInfoListParamsOrderBy string
-
-const (
- RUMSiteInfoListParamsOrderByHost RUMSiteInfoListParamsOrderBy = "host"
- RUMSiteInfoListParamsOrderByCreated RUMSiteInfoListParamsOrderBy = "created"
-)
-
-type RUMSiteInfoDeleteParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type RUMSiteInfoDeleteResponseEnvelope struct {
- Result RUMSiteInfoDeleteResponse `json:"result"`
- JSON rumSiteInfoDeleteResponseEnvelopeJSON `json:"-"`
-}
-
-// rumSiteInfoDeleteResponseEnvelopeJSON contains the JSON metadata for the struct
-// [RUMSiteInfoDeleteResponseEnvelope]
-type rumSiteInfoDeleteResponseEnvelopeJSON struct {
- Result apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RUMSiteInfoDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rumSiteInfoDeleteResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type RUMSiteInfoGetParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type RUMSiteInfoGetResponseEnvelope struct {
- Result RUMSiteInfoGetResponse `json:"result"`
- JSON rumSiteInfoGetResponseEnvelopeJSON `json:"-"`
-}
-
-// rumSiteInfoGetResponseEnvelopeJSON contains the JSON metadata for the struct
-// [RUMSiteInfoGetResponseEnvelope]
-type rumSiteInfoGetResponseEnvelopeJSON struct {
- Result apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *RUMSiteInfoGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r rumSiteInfoGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
diff --git a/rumsiteinfo_test.go b/rumsiteinfo_test.go
deleted file mode 100644
index 29c013c97c7..00000000000
--- a/rumsiteinfo_test.go
+++ /dev/null
@@ -1,165 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestRUMSiteInfoNewWithOptionalParams(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"),
- )
- _, err := client.RUM.SiteInfos.New(context.TODO(), cloudflare.RUMSiteInfoNewParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- AutoInstall: cloudflare.F(true),
- Host: cloudflare.F("example.com"),
- ZoneTag: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- })
- 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())
- }
-}
-
-func TestRUMSiteInfoUpdateWithOptionalParams(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"),
- )
- _, err := client.RUM.SiteInfos.Update(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.RUMSiteInfoUpdateParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- AutoInstall: cloudflare.F(true),
- Host: cloudflare.F("example.com"),
- ZoneTag: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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())
- }
-}
-
-func TestRUMSiteInfoListWithOptionalParams(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"),
- )
- _, err := client.RUM.SiteInfos.List(context.TODO(), cloudflare.RUMSiteInfoListParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- OrderBy: cloudflare.F(cloudflare.RUMSiteInfoListParamsOrderByHost),
- Page: cloudflare.F(1.000000),
- PerPage: cloudflare.F(10.000000),
- })
- 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())
- }
-}
-
-func TestRUMSiteInfoDelete(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"),
- )
- _, err := client.RUM.SiteInfos.Delete(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.RUMSiteInfoDeleteParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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())
- }
-}
-
-func TestRUMSiteInfoGet(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"),
- )
- _, err := client.RUM.SiteInfos.Get(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.RUMSiteInfoGetParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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/secondary_dns/acl.go b/secondary_dns/acl.go
new file mode 100644
index 00000000000..fe3420b89a6
--- /dev/null
+++ b/secondary_dns/acl.go
@@ -0,0 +1,622 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package secondary_dns
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// ACLService contains methods and other services that help with interacting with
+// the cloudflare API. Note, unlike clients, this service does not read variables
+// from the environment automatically. You should not instantiate this service
+// directly, and instead use the [NewACLService] method instead.
+type ACLService struct {
+ Options []option.RequestOption
+}
+
+// NewACLService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewACLService(opts ...option.RequestOption) (r *ACLService) {
+ r = &ACLService{}
+ r.Options = opts
+ return
+}
+
+// Create ACL.
+func (r *ACLService) New(ctx context.Context, params ACLNewParams, opts ...option.RequestOption) (res *SecondaryDNSACL, err error) {
+ opts = append(r.Options[:], opts...)
+ var env ACLNewResponseEnvelope
+ path := fmt.Sprintf("accounts/%v/secondary_dns/acls", params.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Modify ACL.
+func (r *ACLService) Update(ctx context.Context, aclID interface{}, params ACLUpdateParams, opts ...option.RequestOption) (res *SecondaryDNSACL, err error) {
+ opts = append(r.Options[:], opts...)
+ var env ACLUpdateResponseEnvelope
+ path := fmt.Sprintf("accounts/%v/secondary_dns/acls/%v", params.AccountID, aclID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// List ACLs.
+func (r *ACLService) List(ctx context.Context, query ACLListParams, opts ...option.RequestOption) (res *[]SecondaryDNSACL, err error) {
+ opts = append(r.Options[:], opts...)
+ var env ACLListResponseEnvelope
+ path := fmt.Sprintf("accounts/%v/secondary_dns/acls", query.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Delete ACL.
+func (r *ACLService) Delete(ctx context.Context, aclID interface{}, body ACLDeleteParams, opts ...option.RequestOption) (res *ACLDeleteResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env ACLDeleteResponseEnvelope
+ path := fmt.Sprintf("accounts/%v/secondary_dns/acls/%v", body.AccountID, aclID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Get ACL.
+func (r *ACLService) Get(ctx context.Context, aclID interface{}, query ACLGetParams, opts ...option.RequestOption) (res *SecondaryDNSACL, err error) {
+ opts = append(r.Options[:], opts...)
+ var env ACLGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%v/secondary_dns/acls/%v", query.AccountID, aclID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type SecondaryDNSACL struct {
+ ID interface{} `json:"id,required"`
+ // Allowed IPv4/IPv6 address range of primary or secondary nameservers. This will
+ // be applied for the entire account. The IP range is used to allow additional
+ // NOTIFY IPs for secondary zones and IPs Cloudflare allows AXFR/IXFR requests from
+ // for primary zones. CIDRs are limited to a maximum of /24 for IPv4 and /64 for
+ // IPv6 respectively.
+ IPRange string `json:"ip_range,required"`
+ // The name of the acl.
+ Name string `json:"name,required"`
+ JSON secondaryDnsaclJSON `json:"-"`
+}
+
+// secondaryDnsaclJSON contains the JSON metadata for the struct [SecondaryDNSACL]
+type secondaryDnsaclJSON struct {
+ ID apijson.Field
+ IPRange apijson.Field
+ Name apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *SecondaryDNSACL) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r secondaryDnsaclJSON) RawJSON() string {
+ return r.raw
+}
+
+type ACLDeleteResponse struct {
+ ID interface{} `json:"id"`
+ JSON aclDeleteResponseJSON `json:"-"`
+}
+
+// aclDeleteResponseJSON contains the JSON metadata for the struct
+// [ACLDeleteResponse]
+type aclDeleteResponseJSON struct {
+ ID apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ACLDeleteResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r aclDeleteResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type ACLNewParams struct {
+ AccountID param.Field[interface{}] `path:"account_id,required"`
+ Body param.Field[interface{}] `json:"body,required"`
+}
+
+func (r ACLNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r.Body)
+}
+
+type ACLNewResponseEnvelope struct {
+ Errors []ACLNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []ACLNewResponseEnvelopeMessages `json:"messages,required"`
+ Result SecondaryDNSACL `json:"result,required"`
+ // Whether the API call was successful
+ Success ACLNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON aclNewResponseEnvelopeJSON `json:"-"`
+}
+
+// aclNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [ACLNewResponseEnvelope]
+type aclNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ACLNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r aclNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type ACLNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON aclNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// aclNewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [ACLNewResponseEnvelopeErrors]
+type aclNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ACLNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r aclNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type ACLNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON aclNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// aclNewResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [ACLNewResponseEnvelopeMessages]
+type aclNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ACLNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r aclNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type ACLNewResponseEnvelopeSuccess bool
+
+const (
+ ACLNewResponseEnvelopeSuccessTrue ACLNewResponseEnvelopeSuccess = true
+)
+
+type ACLUpdateParams struct {
+ AccountID param.Field[interface{}] `path:"account_id,required"`
+ // Allowed IPv4/IPv6 address range of primary or secondary nameservers. This will
+ // be applied for the entire account. The IP range is used to allow additional
+ // NOTIFY IPs for secondary zones and IPs Cloudflare allows AXFR/IXFR requests from
+ // for primary zones. CIDRs are limited to a maximum of /24 for IPv4 and /64 for
+ // IPv6 respectively.
+ IPRange param.Field[string] `json:"ip_range,required"`
+ // The name of the acl.
+ Name param.Field[string] `json:"name,required"`
+}
+
+func (r ACLUpdateParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type ACLUpdateResponseEnvelope struct {
+ Errors []ACLUpdateResponseEnvelopeErrors `json:"errors,required"`
+ Messages []ACLUpdateResponseEnvelopeMessages `json:"messages,required"`
+ Result SecondaryDNSACL `json:"result,required"`
+ // Whether the API call was successful
+ Success ACLUpdateResponseEnvelopeSuccess `json:"success,required"`
+ JSON aclUpdateResponseEnvelopeJSON `json:"-"`
+}
+
+// aclUpdateResponseEnvelopeJSON contains the JSON metadata for the struct
+// [ACLUpdateResponseEnvelope]
+type aclUpdateResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ACLUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r aclUpdateResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type ACLUpdateResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON aclUpdateResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// aclUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [ACLUpdateResponseEnvelopeErrors]
+type aclUpdateResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ACLUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r aclUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type ACLUpdateResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON aclUpdateResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// aclUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [ACLUpdateResponseEnvelopeMessages]
+type aclUpdateResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ACLUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r aclUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type ACLUpdateResponseEnvelopeSuccess bool
+
+const (
+ ACLUpdateResponseEnvelopeSuccessTrue ACLUpdateResponseEnvelopeSuccess = true
+)
+
+type ACLListParams struct {
+ AccountID param.Field[interface{}] `path:"account_id,required"`
+}
+
+type ACLListResponseEnvelope struct {
+ Errors []ACLListResponseEnvelopeErrors `json:"errors,required"`
+ Messages []ACLListResponseEnvelopeMessages `json:"messages,required"`
+ Result []SecondaryDNSACL `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success ACLListResponseEnvelopeSuccess `json:"success,required"`
+ ResultInfo ACLListResponseEnvelopeResultInfo `json:"result_info"`
+ JSON aclListResponseEnvelopeJSON `json:"-"`
+}
+
+// aclListResponseEnvelopeJSON contains the JSON metadata for the struct
+// [ACLListResponseEnvelope]
+type aclListResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ ResultInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ACLListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r aclListResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type ACLListResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON aclListResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// aclListResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [ACLListResponseEnvelopeErrors]
+type aclListResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ACLListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r aclListResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type ACLListResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON aclListResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// aclListResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [ACLListResponseEnvelopeMessages]
+type aclListResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ACLListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r aclListResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type ACLListResponseEnvelopeSuccess bool
+
+const (
+ ACLListResponseEnvelopeSuccessTrue ACLListResponseEnvelopeSuccess = true
+)
+
+type ACLListResponseEnvelopeResultInfo struct {
+ // Total number of results for the requested service
+ Count float64 `json:"count"`
+ // Current page within paginated list of results
+ Page float64 `json:"page"`
+ // Number of results per page of results
+ PerPage float64 `json:"per_page"`
+ // Total results available without any search parameters
+ TotalCount float64 `json:"total_count"`
+ JSON aclListResponseEnvelopeResultInfoJSON `json:"-"`
+}
+
+// aclListResponseEnvelopeResultInfoJSON contains the JSON metadata for the struct
+// [ACLListResponseEnvelopeResultInfo]
+type aclListResponseEnvelopeResultInfoJSON struct {
+ Count apijson.Field
+ Page apijson.Field
+ PerPage apijson.Field
+ TotalCount apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ACLListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r aclListResponseEnvelopeResultInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type ACLDeleteParams struct {
+ AccountID param.Field[interface{}] `path:"account_id,required"`
+}
+
+type ACLDeleteResponseEnvelope struct {
+ Errors []ACLDeleteResponseEnvelopeErrors `json:"errors,required"`
+ Messages []ACLDeleteResponseEnvelopeMessages `json:"messages,required"`
+ Result ACLDeleteResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success ACLDeleteResponseEnvelopeSuccess `json:"success,required"`
+ JSON aclDeleteResponseEnvelopeJSON `json:"-"`
+}
+
+// aclDeleteResponseEnvelopeJSON contains the JSON metadata for the struct
+// [ACLDeleteResponseEnvelope]
+type aclDeleteResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ACLDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r aclDeleteResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type ACLDeleteResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON aclDeleteResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// aclDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [ACLDeleteResponseEnvelopeErrors]
+type aclDeleteResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ACLDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r aclDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type ACLDeleteResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON aclDeleteResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// aclDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [ACLDeleteResponseEnvelopeMessages]
+type aclDeleteResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ACLDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r aclDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type ACLDeleteResponseEnvelopeSuccess bool
+
+const (
+ ACLDeleteResponseEnvelopeSuccessTrue ACLDeleteResponseEnvelopeSuccess = true
+)
+
+type ACLGetParams struct {
+ AccountID param.Field[interface{}] `path:"account_id,required"`
+}
+
+type ACLGetResponseEnvelope struct {
+ Errors []ACLGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []ACLGetResponseEnvelopeMessages `json:"messages,required"`
+ Result SecondaryDNSACL `json:"result,required"`
+ // Whether the API call was successful
+ Success ACLGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON aclGetResponseEnvelopeJSON `json:"-"`
+}
+
+// aclGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [ACLGetResponseEnvelope]
+type aclGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ACLGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r aclGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type ACLGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON aclGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// aclGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [ACLGetResponseEnvelopeErrors]
+type aclGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ACLGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r aclGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type ACLGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON aclGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// aclGetResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [ACLGetResponseEnvelopeMessages]
+type aclGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ACLGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r aclGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type ACLGetResponseEnvelopeSuccess bool
+
+const (
+ ACLGetResponseEnvelopeSuccessTrue ACLGetResponseEnvelopeSuccess = true
+)
diff --git a/secondary_dns/acl_test.go b/secondary_dns/acl_test.go
new file mode 100644
index 00000000000..ed5cb3485f5
--- /dev/null
+++ b/secondary_dns/acl_test.go
@@ -0,0 +1,160 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package secondary_dns_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/secondary_dns"
+)
+
+func TestACLNew(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"),
+ )
+ _, err := client.SecondaryDNS.ACLs.New(context.TODO(), secondary_dns.ACLNewParams{
+ AccountID: cloudflare.F[any]("01a7362d577a6c3019a474fd6f485823"),
+ Body: cloudflare.F[any](map[string]interface{}{}),
+ })
+ 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())
+ }
+}
+
+func TestACLUpdate(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"),
+ )
+ _, err := client.SecondaryDNS.ACLs.Update(
+ context.TODO(),
+ "23ff594956f20c2a721606e94745a8aa",
+ secondary_dns.ACLUpdateParams{
+ AccountID: cloudflare.F[any]("01a7362d577a6c3019a474fd6f485823"),
+ IPRange: cloudflare.F("192.0.2.53/28"),
+ Name: cloudflare.F("my-acl-1"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestACLList(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"),
+ )
+ _, err := client.SecondaryDNS.ACLs.List(context.TODO(), secondary_dns.ACLListParams{
+ AccountID: cloudflare.F[any]("01a7362d577a6c3019a474fd6f485823"),
+ })
+ 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())
+ }
+}
+
+func TestACLDelete(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"),
+ )
+ _, err := client.SecondaryDNS.ACLs.Delete(
+ context.TODO(),
+ "23ff594956f20c2a721606e94745a8aa",
+ secondary_dns.ACLDeleteParams{
+ AccountID: cloudflare.F[any]("01a7362d577a6c3019a474fd6f485823"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestACLGet(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"),
+ )
+ _, err := client.SecondaryDNS.ACLs.Get(
+ context.TODO(),
+ "23ff594956f20c2a721606e94745a8aa",
+ secondary_dns.ACLGetParams{
+ AccountID: cloudflare.F[any]("01a7362d577a6c3019a474fd6f485823"),
+ },
+ )
+ 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/secondary_dns/aliases.go b/secondary_dns/aliases.go
new file mode 100644
index 00000000000..2b90c548da4
--- /dev/null
+++ b/secondary_dns/aliases.go
@@ -0,0 +1,9 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package secondary_dns
+
+import (
+ "github.com/cloudflare/cloudflare-go/internal/apierror"
+)
+
+type Error = apierror.Error
diff --git a/secondary_dns/forceaxfr.go b/secondary_dns/forceaxfr.go
new file mode 100644
index 00000000000..983670ff3c3
--- /dev/null
+++ b/secondary_dns/forceaxfr.go
@@ -0,0 +1,132 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package secondary_dns
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// ForceAxfrService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewForceAxfrService] method instead.
+type ForceAxfrService struct {
+ Options []option.RequestOption
+}
+
+// NewForceAxfrService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewForceAxfrService(opts ...option.RequestOption) (r *ForceAxfrService) {
+ r = &ForceAxfrService{}
+ r.Options = opts
+ return
+}
+
+// Sends AXFR zone transfer request to primary nameserver(s).
+func (r *ForceAxfrService) New(ctx context.Context, body ForceAxfrNewParams, opts ...option.RequestOption) (res *SecondaryDNSForceResult, err error) {
+ opts = append(r.Options[:], opts...)
+ var env ForceAxfrNewResponseEnvelope
+ path := fmt.Sprintf("zones/%v/secondary_dns/force_axfr", body.ZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type SecondaryDNSForceResult = string
+
+type ForceAxfrNewParams struct {
+ ZoneID param.Field[interface{}] `path:"zone_id,required"`
+}
+
+type ForceAxfrNewResponseEnvelope struct {
+ Errors []ForceAxfrNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []ForceAxfrNewResponseEnvelopeMessages `json:"messages,required"`
+ // When force_axfr query parameter is set to true, the response is a simple string
+ Result SecondaryDNSForceResult `json:"result,required"`
+ // Whether the API call was successful
+ Success ForceAxfrNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON forceAxfrNewResponseEnvelopeJSON `json:"-"`
+}
+
+// forceAxfrNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [ForceAxfrNewResponseEnvelope]
+type forceAxfrNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ForceAxfrNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r forceAxfrNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type ForceAxfrNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON forceAxfrNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// forceAxfrNewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [ForceAxfrNewResponseEnvelopeErrors]
+type forceAxfrNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ForceAxfrNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r forceAxfrNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type ForceAxfrNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON forceAxfrNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// forceAxfrNewResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [ForceAxfrNewResponseEnvelopeMessages]
+type forceAxfrNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ForceAxfrNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r forceAxfrNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type ForceAxfrNewResponseEnvelopeSuccess bool
+
+const (
+ ForceAxfrNewResponseEnvelopeSuccessTrue ForceAxfrNewResponseEnvelopeSuccess = true
+)
diff --git a/secondary_dns/forceaxfr_test.go b/secondary_dns/forceaxfr_test.go
new file mode 100644
index 00000000000..5c41b076f9b
--- /dev/null
+++ b/secondary_dns/forceaxfr_test.go
@@ -0,0 +1,41 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package secondary_dns_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/secondary_dns"
+)
+
+func TestForceAxfrNew(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"),
+ )
+ _, err := client.SecondaryDNS.ForceAxfrs.New(context.TODO(), secondary_dns.ForceAxfrNewParams{
+ ZoneID: cloudflare.F[any]("269d8f4853475ca241c4e730be286b20"),
+ })
+ 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/secondary_dns/incoming.go b/secondary_dns/incoming.go
new file mode 100644
index 00000000000..d46e00ff7db
--- /dev/null
+++ b/secondary_dns/incoming.go
@@ -0,0 +1,595 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package secondary_dns
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// IncomingService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewIncomingService] method instead.
+type IncomingService struct {
+ Options []option.RequestOption
+}
+
+// NewIncomingService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewIncomingService(opts ...option.RequestOption) (r *IncomingService) {
+ r = &IncomingService{}
+ r.Options = opts
+ return
+}
+
+// Create secondary zone configuration for incoming zone transfers.
+func (r *IncomingService) New(ctx context.Context, params IncomingNewParams, opts ...option.RequestOption) (res *IncomingNewResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env IncomingNewResponseEnvelope
+ path := fmt.Sprintf("zones/%v/secondary_dns/incoming", params.ZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Update secondary zone configuration for incoming zone transfers.
+func (r *IncomingService) Update(ctx context.Context, params IncomingUpdateParams, opts ...option.RequestOption) (res *IncomingUpdateResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env IncomingUpdateResponseEnvelope
+ path := fmt.Sprintf("zones/%v/secondary_dns/incoming", params.ZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Delete secondary zone configuration for incoming zone transfers.
+func (r *IncomingService) Delete(ctx context.Context, body IncomingDeleteParams, opts ...option.RequestOption) (res *IncomingDeleteResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env IncomingDeleteResponseEnvelope
+ path := fmt.Sprintf("zones/%v/secondary_dns/incoming", body.ZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Get secondary zone configuration for incoming zone transfers.
+func (r *IncomingService) Get(ctx context.Context, query IncomingGetParams, opts ...option.RequestOption) (res *IncomingGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env IncomingGetResponseEnvelope
+ path := fmt.Sprintf("zones/%v/secondary_dns/incoming", query.ZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type IncomingNewResponse struct {
+ ID interface{} `json:"id"`
+ // How often should a secondary zone auto refresh regardless of DNS NOTIFY. Not
+ // applicable for primary zones.
+ AutoRefreshSeconds float64 `json:"auto_refresh_seconds"`
+ // The time for a specific event.
+ CheckedTime string `json:"checked_time"`
+ // The time for a specific event.
+ CreatedTime string `json:"created_time"`
+ // The time for a specific event.
+ ModifiedTime string `json:"modified_time"`
+ // Zone name.
+ Name string `json:"name"`
+ // A list of peer tags.
+ Peers []interface{} `json:"peers"`
+ // The serial number of the SOA for the given zone.
+ SoaSerial float64 `json:"soa_serial"`
+ JSON incomingNewResponseJSON `json:"-"`
+}
+
+// incomingNewResponseJSON contains the JSON metadata for the struct
+// [IncomingNewResponse]
+type incomingNewResponseJSON struct {
+ ID apijson.Field
+ AutoRefreshSeconds apijson.Field
+ CheckedTime apijson.Field
+ CreatedTime apijson.Field
+ ModifiedTime apijson.Field
+ Name apijson.Field
+ Peers apijson.Field
+ SoaSerial apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IncomingNewResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r incomingNewResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type IncomingUpdateResponse struct {
+ ID interface{} `json:"id"`
+ // How often should a secondary zone auto refresh regardless of DNS NOTIFY. Not
+ // applicable for primary zones.
+ AutoRefreshSeconds float64 `json:"auto_refresh_seconds"`
+ // The time for a specific event.
+ CheckedTime string `json:"checked_time"`
+ // The time for a specific event.
+ CreatedTime string `json:"created_time"`
+ // The time for a specific event.
+ ModifiedTime string `json:"modified_time"`
+ // Zone name.
+ Name string `json:"name"`
+ // A list of peer tags.
+ Peers []interface{} `json:"peers"`
+ // The serial number of the SOA for the given zone.
+ SoaSerial float64 `json:"soa_serial"`
+ JSON incomingUpdateResponseJSON `json:"-"`
+}
+
+// incomingUpdateResponseJSON contains the JSON metadata for the struct
+// [IncomingUpdateResponse]
+type incomingUpdateResponseJSON struct {
+ ID apijson.Field
+ AutoRefreshSeconds apijson.Field
+ CheckedTime apijson.Field
+ CreatedTime apijson.Field
+ ModifiedTime apijson.Field
+ Name apijson.Field
+ Peers apijson.Field
+ SoaSerial apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IncomingUpdateResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r incomingUpdateResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type IncomingDeleteResponse struct {
+ ID interface{} `json:"id"`
+ JSON incomingDeleteResponseJSON `json:"-"`
+}
+
+// incomingDeleteResponseJSON contains the JSON metadata for the struct
+// [IncomingDeleteResponse]
+type incomingDeleteResponseJSON struct {
+ ID apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IncomingDeleteResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r incomingDeleteResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type IncomingGetResponse struct {
+ ID interface{} `json:"id"`
+ // How often should a secondary zone auto refresh regardless of DNS NOTIFY. Not
+ // applicable for primary zones.
+ AutoRefreshSeconds float64 `json:"auto_refresh_seconds"`
+ // The time for a specific event.
+ CheckedTime string `json:"checked_time"`
+ // The time for a specific event.
+ CreatedTime string `json:"created_time"`
+ // The time for a specific event.
+ ModifiedTime string `json:"modified_time"`
+ // Zone name.
+ Name string `json:"name"`
+ // A list of peer tags.
+ Peers []interface{} `json:"peers"`
+ // The serial number of the SOA for the given zone.
+ SoaSerial float64 `json:"soa_serial"`
+ JSON incomingGetResponseJSON `json:"-"`
+}
+
+// incomingGetResponseJSON contains the JSON metadata for the struct
+// [IncomingGetResponse]
+type incomingGetResponseJSON struct {
+ ID apijson.Field
+ AutoRefreshSeconds apijson.Field
+ CheckedTime apijson.Field
+ CreatedTime apijson.Field
+ ModifiedTime apijson.Field
+ Name apijson.Field
+ Peers apijson.Field
+ SoaSerial apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IncomingGetResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r incomingGetResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type IncomingNewParams struct {
+ ZoneID param.Field[interface{}] `path:"zone_id,required"`
+ // How often should a secondary zone auto refresh regardless of DNS NOTIFY. Not
+ // applicable for primary zones.
+ AutoRefreshSeconds param.Field[float64] `json:"auto_refresh_seconds,required"`
+ // Zone name.
+ Name param.Field[string] `json:"name,required"`
+ // A list of peer tags.
+ Peers param.Field[[]interface{}] `json:"peers,required"`
+}
+
+func (r IncomingNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type IncomingNewResponseEnvelope struct {
+ Errors []IncomingNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []IncomingNewResponseEnvelopeMessages `json:"messages,required"`
+ Result IncomingNewResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success IncomingNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON incomingNewResponseEnvelopeJSON `json:"-"`
+}
+
+// incomingNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [IncomingNewResponseEnvelope]
+type incomingNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IncomingNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r incomingNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type IncomingNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON incomingNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// incomingNewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [IncomingNewResponseEnvelopeErrors]
+type incomingNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IncomingNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r incomingNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type IncomingNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON incomingNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// incomingNewResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [IncomingNewResponseEnvelopeMessages]
+type incomingNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IncomingNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r incomingNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type IncomingNewResponseEnvelopeSuccess bool
+
+const (
+ IncomingNewResponseEnvelopeSuccessTrue IncomingNewResponseEnvelopeSuccess = true
+)
+
+type IncomingUpdateParams struct {
+ ZoneID param.Field[interface{}] `path:"zone_id,required"`
+ // How often should a secondary zone auto refresh regardless of DNS NOTIFY. Not
+ // applicable for primary zones.
+ AutoRefreshSeconds param.Field[float64] `json:"auto_refresh_seconds,required"`
+ // Zone name.
+ Name param.Field[string] `json:"name,required"`
+ // A list of peer tags.
+ Peers param.Field[[]interface{}] `json:"peers,required"`
+}
+
+func (r IncomingUpdateParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type IncomingUpdateResponseEnvelope struct {
+ Errors []IncomingUpdateResponseEnvelopeErrors `json:"errors,required"`
+ Messages []IncomingUpdateResponseEnvelopeMessages `json:"messages,required"`
+ Result IncomingUpdateResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success IncomingUpdateResponseEnvelopeSuccess `json:"success,required"`
+ JSON incomingUpdateResponseEnvelopeJSON `json:"-"`
+}
+
+// incomingUpdateResponseEnvelopeJSON contains the JSON metadata for the struct
+// [IncomingUpdateResponseEnvelope]
+type incomingUpdateResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IncomingUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r incomingUpdateResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type IncomingUpdateResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON incomingUpdateResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// incomingUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [IncomingUpdateResponseEnvelopeErrors]
+type incomingUpdateResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IncomingUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r incomingUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type IncomingUpdateResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON incomingUpdateResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// incomingUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [IncomingUpdateResponseEnvelopeMessages]
+type incomingUpdateResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IncomingUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r incomingUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type IncomingUpdateResponseEnvelopeSuccess bool
+
+const (
+ IncomingUpdateResponseEnvelopeSuccessTrue IncomingUpdateResponseEnvelopeSuccess = true
+)
+
+type IncomingDeleteParams struct {
+ ZoneID param.Field[interface{}] `path:"zone_id,required"`
+}
+
+type IncomingDeleteResponseEnvelope struct {
+ Errors []IncomingDeleteResponseEnvelopeErrors `json:"errors,required"`
+ Messages []IncomingDeleteResponseEnvelopeMessages `json:"messages,required"`
+ Result IncomingDeleteResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success IncomingDeleteResponseEnvelopeSuccess `json:"success,required"`
+ JSON incomingDeleteResponseEnvelopeJSON `json:"-"`
+}
+
+// incomingDeleteResponseEnvelopeJSON contains the JSON metadata for the struct
+// [IncomingDeleteResponseEnvelope]
+type incomingDeleteResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IncomingDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r incomingDeleteResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type IncomingDeleteResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON incomingDeleteResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// incomingDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [IncomingDeleteResponseEnvelopeErrors]
+type incomingDeleteResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IncomingDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r incomingDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type IncomingDeleteResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON incomingDeleteResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// incomingDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [IncomingDeleteResponseEnvelopeMessages]
+type incomingDeleteResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IncomingDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r incomingDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type IncomingDeleteResponseEnvelopeSuccess bool
+
+const (
+ IncomingDeleteResponseEnvelopeSuccessTrue IncomingDeleteResponseEnvelopeSuccess = true
+)
+
+type IncomingGetParams struct {
+ ZoneID param.Field[interface{}] `path:"zone_id,required"`
+}
+
+type IncomingGetResponseEnvelope struct {
+ Errors []IncomingGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []IncomingGetResponseEnvelopeMessages `json:"messages,required"`
+ Result IncomingGetResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success IncomingGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON incomingGetResponseEnvelopeJSON `json:"-"`
+}
+
+// incomingGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [IncomingGetResponseEnvelope]
+type incomingGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IncomingGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r incomingGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type IncomingGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON incomingGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// incomingGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [IncomingGetResponseEnvelopeErrors]
+type incomingGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IncomingGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r incomingGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type IncomingGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON incomingGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// incomingGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [IncomingGetResponseEnvelopeMessages]
+type incomingGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *IncomingGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r incomingGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type IncomingGetResponseEnvelopeSuccess bool
+
+const (
+ IncomingGetResponseEnvelopeSuccessTrue IncomingGetResponseEnvelopeSuccess = true
+)
diff --git a/secondary_dns/incoming_test.go b/secondary_dns/incoming_test.go
new file mode 100644
index 00000000000..a8b80f28066
--- /dev/null
+++ b/secondary_dns/incoming_test.go
@@ -0,0 +1,125 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package secondary_dns_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/secondary_dns"
+)
+
+func TestIncomingNew(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"),
+ )
+ _, err := client.SecondaryDNS.Incoming.New(context.TODO(), secondary_dns.IncomingNewParams{
+ ZoneID: cloudflare.F[any]("269d8f4853475ca241c4e730be286b20"),
+ AutoRefreshSeconds: cloudflare.F(86400.000000),
+ Name: cloudflare.F("www.example.com."),
+ Peers: cloudflare.F([]interface{}{"23ff594956f20c2a721606e94745a8aa", "00920f38ce07c2e2f4df50b1f61d4194"}),
+ })
+ 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())
+ }
+}
+
+func TestIncomingUpdate(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"),
+ )
+ _, err := client.SecondaryDNS.Incoming.Update(context.TODO(), secondary_dns.IncomingUpdateParams{
+ ZoneID: cloudflare.F[any]("269d8f4853475ca241c4e730be286b20"),
+ AutoRefreshSeconds: cloudflare.F(86400.000000),
+ Name: cloudflare.F("www.example.com."),
+ Peers: cloudflare.F([]interface{}{"23ff594956f20c2a721606e94745a8aa", "00920f38ce07c2e2f4df50b1f61d4194"}),
+ })
+ 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())
+ }
+}
+
+func TestIncomingDelete(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"),
+ )
+ _, err := client.SecondaryDNS.Incoming.Delete(context.TODO(), secondary_dns.IncomingDeleteParams{
+ ZoneID: cloudflare.F[any]("269d8f4853475ca241c4e730be286b20"),
+ })
+ 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())
+ }
+}
+
+func TestIncomingGet(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"),
+ )
+ _, err := client.SecondaryDNS.Incoming.Get(context.TODO(), secondary_dns.IncomingGetParams{
+ ZoneID: cloudflare.F[any]("269d8f4853475ca241c4e730be286b20"),
+ })
+ 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/secondary_dns/outgoing.go b/secondary_dns/outgoing.go
new file mode 100644
index 00000000000..84a835b6c8a
--- /dev/null
+++ b/secondary_dns/outgoing.go
@@ -0,0 +1,884 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package secondary_dns
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// OutgoingService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewOutgoingService] method instead.
+type OutgoingService struct {
+ Options []option.RequestOption
+ Status *OutgoingStatusService
+}
+
+// NewOutgoingService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewOutgoingService(opts ...option.RequestOption) (r *OutgoingService) {
+ r = &OutgoingService{}
+ r.Options = opts
+ r.Status = NewOutgoingStatusService(opts...)
+ return
+}
+
+// Create primary zone configuration for outgoing zone transfers.
+func (r *OutgoingService) New(ctx context.Context, params OutgoingNewParams, opts ...option.RequestOption) (res *OutgoingNewResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env OutgoingNewResponseEnvelope
+ path := fmt.Sprintf("zones/%v/secondary_dns/outgoing", params.ZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Update primary zone configuration for outgoing zone transfers.
+func (r *OutgoingService) Update(ctx context.Context, params OutgoingUpdateParams, opts ...option.RequestOption) (res *OutgoingUpdateResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env OutgoingUpdateResponseEnvelope
+ path := fmt.Sprintf("zones/%v/secondary_dns/outgoing", params.ZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Delete primary zone configuration for outgoing zone transfers.
+func (r *OutgoingService) Delete(ctx context.Context, body OutgoingDeleteParams, opts ...option.RequestOption) (res *OutgoingDeleteResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env OutgoingDeleteResponseEnvelope
+ path := fmt.Sprintf("zones/%v/secondary_dns/outgoing", body.ZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Disable outgoing zone transfers for primary zone and clears IXFR backlog of
+// primary zone.
+func (r *OutgoingService) Disable(ctx context.Context, body OutgoingDisableParams, opts ...option.RequestOption) (res *SecondaryDNSDisableTransferResult, err error) {
+ opts = append(r.Options[:], opts...)
+ var env OutgoingDisableResponseEnvelope
+ path := fmt.Sprintf("zones/%v/secondary_dns/outgoing/disable", body.ZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Enable outgoing zone transfers for primary zone.
+func (r *OutgoingService) Enable(ctx context.Context, body OutgoingEnableParams, opts ...option.RequestOption) (res *SecondaryDNSEnableTransferResult, err error) {
+ opts = append(r.Options[:], opts...)
+ var env OutgoingEnableResponseEnvelope
+ path := fmt.Sprintf("zones/%v/secondary_dns/outgoing/enable", body.ZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Notifies the secondary nameserver(s) and clears IXFR backlog of primary zone.
+func (r *OutgoingService) ForceNotify(ctx context.Context, body OutgoingForceNotifyParams, opts ...option.RequestOption) (res *SecondaryDNSSchemasForceResult, err error) {
+ opts = append(r.Options[:], opts...)
+ var env OutgoingForceNotifyResponseEnvelope
+ path := fmt.Sprintf("zones/%v/secondary_dns/outgoing/force_notify", body.ZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Get primary zone configuration for outgoing zone transfers.
+func (r *OutgoingService) Get(ctx context.Context, query OutgoingGetParams, opts ...option.RequestOption) (res *OutgoingGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env OutgoingGetResponseEnvelope
+ path := fmt.Sprintf("zones/%v/secondary_dns/outgoing", query.ZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type SecondaryDNSDisableTransferResult = string
+
+type SecondaryDNSEnableTransferResult = string
+
+type SecondaryDNSSchemasForceResult = string
+
+type OutgoingNewResponse struct {
+ ID interface{} `json:"id"`
+ // The time for a specific event.
+ CheckedTime string `json:"checked_time"`
+ // The time for a specific event.
+ CreatedTime string `json:"created_time"`
+ // The time for a specific event.
+ LastTransferredTime string `json:"last_transferred_time"`
+ // Zone name.
+ Name string `json:"name"`
+ // A list of peer tags.
+ Peers []interface{} `json:"peers"`
+ // The serial number of the SOA for the given zone.
+ SoaSerial float64 `json:"soa_serial"`
+ JSON outgoingNewResponseJSON `json:"-"`
+}
+
+// outgoingNewResponseJSON contains the JSON metadata for the struct
+// [OutgoingNewResponse]
+type outgoingNewResponseJSON struct {
+ ID apijson.Field
+ CheckedTime apijson.Field
+ CreatedTime apijson.Field
+ LastTransferredTime apijson.Field
+ Name apijson.Field
+ Peers apijson.Field
+ SoaSerial apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *OutgoingNewResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r outgoingNewResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type OutgoingUpdateResponse struct {
+ ID interface{} `json:"id"`
+ // The time for a specific event.
+ CheckedTime string `json:"checked_time"`
+ // The time for a specific event.
+ CreatedTime string `json:"created_time"`
+ // The time for a specific event.
+ LastTransferredTime string `json:"last_transferred_time"`
+ // Zone name.
+ Name string `json:"name"`
+ // A list of peer tags.
+ Peers []interface{} `json:"peers"`
+ // The serial number of the SOA for the given zone.
+ SoaSerial float64 `json:"soa_serial"`
+ JSON outgoingUpdateResponseJSON `json:"-"`
+}
+
+// outgoingUpdateResponseJSON contains the JSON metadata for the struct
+// [OutgoingUpdateResponse]
+type outgoingUpdateResponseJSON struct {
+ ID apijson.Field
+ CheckedTime apijson.Field
+ CreatedTime apijson.Field
+ LastTransferredTime apijson.Field
+ Name apijson.Field
+ Peers apijson.Field
+ SoaSerial apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *OutgoingUpdateResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r outgoingUpdateResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type OutgoingDeleteResponse struct {
+ ID interface{} `json:"id"`
+ JSON outgoingDeleteResponseJSON `json:"-"`
+}
+
+// outgoingDeleteResponseJSON contains the JSON metadata for the struct
+// [OutgoingDeleteResponse]
+type outgoingDeleteResponseJSON struct {
+ ID apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *OutgoingDeleteResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r outgoingDeleteResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type OutgoingGetResponse struct {
+ ID interface{} `json:"id"`
+ // The time for a specific event.
+ CheckedTime string `json:"checked_time"`
+ // The time for a specific event.
+ CreatedTime string `json:"created_time"`
+ // The time for a specific event.
+ LastTransferredTime string `json:"last_transferred_time"`
+ // Zone name.
+ Name string `json:"name"`
+ // A list of peer tags.
+ Peers []interface{} `json:"peers"`
+ // The serial number of the SOA for the given zone.
+ SoaSerial float64 `json:"soa_serial"`
+ JSON outgoingGetResponseJSON `json:"-"`
+}
+
+// outgoingGetResponseJSON contains the JSON metadata for the struct
+// [OutgoingGetResponse]
+type outgoingGetResponseJSON struct {
+ ID apijson.Field
+ CheckedTime apijson.Field
+ CreatedTime apijson.Field
+ LastTransferredTime apijson.Field
+ Name apijson.Field
+ Peers apijson.Field
+ SoaSerial apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *OutgoingGetResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r outgoingGetResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type OutgoingNewParams struct {
+ ZoneID param.Field[interface{}] `path:"zone_id,required"`
+ // Zone name.
+ Name param.Field[string] `json:"name,required"`
+ // A list of peer tags.
+ Peers param.Field[[]interface{}] `json:"peers,required"`
+}
+
+func (r OutgoingNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type OutgoingNewResponseEnvelope struct {
+ Errors []OutgoingNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []OutgoingNewResponseEnvelopeMessages `json:"messages,required"`
+ Result OutgoingNewResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success OutgoingNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON outgoingNewResponseEnvelopeJSON `json:"-"`
+}
+
+// outgoingNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [OutgoingNewResponseEnvelope]
+type outgoingNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *OutgoingNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r outgoingNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type OutgoingNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON outgoingNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// outgoingNewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [OutgoingNewResponseEnvelopeErrors]
+type outgoingNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *OutgoingNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r outgoingNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type OutgoingNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON outgoingNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// outgoingNewResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [OutgoingNewResponseEnvelopeMessages]
+type outgoingNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *OutgoingNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r outgoingNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type OutgoingNewResponseEnvelopeSuccess bool
+
+const (
+ OutgoingNewResponseEnvelopeSuccessTrue OutgoingNewResponseEnvelopeSuccess = true
+)
+
+type OutgoingUpdateParams struct {
+ ZoneID param.Field[interface{}] `path:"zone_id,required"`
+ // Zone name.
+ Name param.Field[string] `json:"name,required"`
+ // A list of peer tags.
+ Peers param.Field[[]interface{}] `json:"peers,required"`
+}
+
+func (r OutgoingUpdateParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type OutgoingUpdateResponseEnvelope struct {
+ Errors []OutgoingUpdateResponseEnvelopeErrors `json:"errors,required"`
+ Messages []OutgoingUpdateResponseEnvelopeMessages `json:"messages,required"`
+ Result OutgoingUpdateResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success OutgoingUpdateResponseEnvelopeSuccess `json:"success,required"`
+ JSON outgoingUpdateResponseEnvelopeJSON `json:"-"`
+}
+
+// outgoingUpdateResponseEnvelopeJSON contains the JSON metadata for the struct
+// [OutgoingUpdateResponseEnvelope]
+type outgoingUpdateResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *OutgoingUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r outgoingUpdateResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type OutgoingUpdateResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON outgoingUpdateResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// outgoingUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [OutgoingUpdateResponseEnvelopeErrors]
+type outgoingUpdateResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *OutgoingUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r outgoingUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type OutgoingUpdateResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON outgoingUpdateResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// outgoingUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [OutgoingUpdateResponseEnvelopeMessages]
+type outgoingUpdateResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *OutgoingUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r outgoingUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type OutgoingUpdateResponseEnvelopeSuccess bool
+
+const (
+ OutgoingUpdateResponseEnvelopeSuccessTrue OutgoingUpdateResponseEnvelopeSuccess = true
+)
+
+type OutgoingDeleteParams struct {
+ ZoneID param.Field[interface{}] `path:"zone_id,required"`
+}
+
+type OutgoingDeleteResponseEnvelope struct {
+ Errors []OutgoingDeleteResponseEnvelopeErrors `json:"errors,required"`
+ Messages []OutgoingDeleteResponseEnvelopeMessages `json:"messages,required"`
+ Result OutgoingDeleteResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success OutgoingDeleteResponseEnvelopeSuccess `json:"success,required"`
+ JSON outgoingDeleteResponseEnvelopeJSON `json:"-"`
+}
+
+// outgoingDeleteResponseEnvelopeJSON contains the JSON metadata for the struct
+// [OutgoingDeleteResponseEnvelope]
+type outgoingDeleteResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *OutgoingDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r outgoingDeleteResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type OutgoingDeleteResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON outgoingDeleteResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// outgoingDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [OutgoingDeleteResponseEnvelopeErrors]
+type outgoingDeleteResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *OutgoingDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r outgoingDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type OutgoingDeleteResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON outgoingDeleteResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// outgoingDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [OutgoingDeleteResponseEnvelopeMessages]
+type outgoingDeleteResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *OutgoingDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r outgoingDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type OutgoingDeleteResponseEnvelopeSuccess bool
+
+const (
+ OutgoingDeleteResponseEnvelopeSuccessTrue OutgoingDeleteResponseEnvelopeSuccess = true
+)
+
+type OutgoingDisableParams struct {
+ ZoneID param.Field[interface{}] `path:"zone_id,required"`
+}
+
+type OutgoingDisableResponseEnvelope struct {
+ Errors []OutgoingDisableResponseEnvelopeErrors `json:"errors,required"`
+ Messages []OutgoingDisableResponseEnvelopeMessages `json:"messages,required"`
+ // The zone transfer status of a primary zone
+ Result SecondaryDNSDisableTransferResult `json:"result,required"`
+ // Whether the API call was successful
+ Success OutgoingDisableResponseEnvelopeSuccess `json:"success,required"`
+ JSON outgoingDisableResponseEnvelopeJSON `json:"-"`
+}
+
+// outgoingDisableResponseEnvelopeJSON contains the JSON metadata for the struct
+// [OutgoingDisableResponseEnvelope]
+type outgoingDisableResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *OutgoingDisableResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r outgoingDisableResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type OutgoingDisableResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON outgoingDisableResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// outgoingDisableResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [OutgoingDisableResponseEnvelopeErrors]
+type outgoingDisableResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *OutgoingDisableResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r outgoingDisableResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type OutgoingDisableResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON outgoingDisableResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// outgoingDisableResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [OutgoingDisableResponseEnvelopeMessages]
+type outgoingDisableResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *OutgoingDisableResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r outgoingDisableResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type OutgoingDisableResponseEnvelopeSuccess bool
+
+const (
+ OutgoingDisableResponseEnvelopeSuccessTrue OutgoingDisableResponseEnvelopeSuccess = true
+)
+
+type OutgoingEnableParams struct {
+ ZoneID param.Field[interface{}] `path:"zone_id,required"`
+}
+
+type OutgoingEnableResponseEnvelope struct {
+ Errors []OutgoingEnableResponseEnvelopeErrors `json:"errors,required"`
+ Messages []OutgoingEnableResponseEnvelopeMessages `json:"messages,required"`
+ // The zone transfer status of a primary zone
+ Result SecondaryDNSEnableTransferResult `json:"result,required"`
+ // Whether the API call was successful
+ Success OutgoingEnableResponseEnvelopeSuccess `json:"success,required"`
+ JSON outgoingEnableResponseEnvelopeJSON `json:"-"`
+}
+
+// outgoingEnableResponseEnvelopeJSON contains the JSON metadata for the struct
+// [OutgoingEnableResponseEnvelope]
+type outgoingEnableResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *OutgoingEnableResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r outgoingEnableResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type OutgoingEnableResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON outgoingEnableResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// outgoingEnableResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [OutgoingEnableResponseEnvelopeErrors]
+type outgoingEnableResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *OutgoingEnableResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r outgoingEnableResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type OutgoingEnableResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON outgoingEnableResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// outgoingEnableResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [OutgoingEnableResponseEnvelopeMessages]
+type outgoingEnableResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *OutgoingEnableResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r outgoingEnableResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type OutgoingEnableResponseEnvelopeSuccess bool
+
+const (
+ OutgoingEnableResponseEnvelopeSuccessTrue OutgoingEnableResponseEnvelopeSuccess = true
+)
+
+type OutgoingForceNotifyParams struct {
+ ZoneID param.Field[interface{}] `path:"zone_id,required"`
+}
+
+type OutgoingForceNotifyResponseEnvelope struct {
+ Errors []OutgoingForceNotifyResponseEnvelopeErrors `json:"errors,required"`
+ Messages []OutgoingForceNotifyResponseEnvelopeMessages `json:"messages,required"`
+ // When force_notify query parameter is set to true, the response is a simple
+ // string
+ Result SecondaryDNSSchemasForceResult `json:"result,required"`
+ // Whether the API call was successful
+ Success OutgoingForceNotifyResponseEnvelopeSuccess `json:"success,required"`
+ JSON outgoingForceNotifyResponseEnvelopeJSON `json:"-"`
+}
+
+// outgoingForceNotifyResponseEnvelopeJSON contains the JSON metadata for the
+// struct [OutgoingForceNotifyResponseEnvelope]
+type outgoingForceNotifyResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *OutgoingForceNotifyResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r outgoingForceNotifyResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type OutgoingForceNotifyResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON outgoingForceNotifyResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// outgoingForceNotifyResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [OutgoingForceNotifyResponseEnvelopeErrors]
+type outgoingForceNotifyResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *OutgoingForceNotifyResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r outgoingForceNotifyResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type OutgoingForceNotifyResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON outgoingForceNotifyResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// outgoingForceNotifyResponseEnvelopeMessagesJSON contains the JSON metadata for
+// the struct [OutgoingForceNotifyResponseEnvelopeMessages]
+type outgoingForceNotifyResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *OutgoingForceNotifyResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r outgoingForceNotifyResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type OutgoingForceNotifyResponseEnvelopeSuccess bool
+
+const (
+ OutgoingForceNotifyResponseEnvelopeSuccessTrue OutgoingForceNotifyResponseEnvelopeSuccess = true
+)
+
+type OutgoingGetParams struct {
+ ZoneID param.Field[interface{}] `path:"zone_id,required"`
+}
+
+type OutgoingGetResponseEnvelope struct {
+ Errors []OutgoingGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []OutgoingGetResponseEnvelopeMessages `json:"messages,required"`
+ Result OutgoingGetResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success OutgoingGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON outgoingGetResponseEnvelopeJSON `json:"-"`
+}
+
+// outgoingGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [OutgoingGetResponseEnvelope]
+type outgoingGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *OutgoingGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r outgoingGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type OutgoingGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON outgoingGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// outgoingGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [OutgoingGetResponseEnvelopeErrors]
+type outgoingGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *OutgoingGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r outgoingGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type OutgoingGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON outgoingGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// outgoingGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [OutgoingGetResponseEnvelopeMessages]
+type outgoingGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *OutgoingGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r outgoingGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type OutgoingGetResponseEnvelopeSuccess bool
+
+const (
+ OutgoingGetResponseEnvelopeSuccessTrue OutgoingGetResponseEnvelopeSuccess = true
+)
diff --git a/secondary_dns/outgoing_test.go b/secondary_dns/outgoing_test.go
new file mode 100644
index 00000000000..9b5c5e54f72
--- /dev/null
+++ b/secondary_dns/outgoing_test.go
@@ -0,0 +1,201 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package secondary_dns_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/secondary_dns"
+)
+
+func TestOutgoingNew(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"),
+ )
+ _, err := client.SecondaryDNS.Outgoing.New(context.TODO(), secondary_dns.OutgoingNewParams{
+ ZoneID: cloudflare.F[any]("269d8f4853475ca241c4e730be286b20"),
+ Name: cloudflare.F("www.example.com."),
+ Peers: cloudflare.F([]interface{}{"23ff594956f20c2a721606e94745a8aa", "00920f38ce07c2e2f4df50b1f61d4194"}),
+ })
+ 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())
+ }
+}
+
+func TestOutgoingUpdate(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"),
+ )
+ _, err := client.SecondaryDNS.Outgoing.Update(context.TODO(), secondary_dns.OutgoingUpdateParams{
+ ZoneID: cloudflare.F[any]("269d8f4853475ca241c4e730be286b20"),
+ Name: cloudflare.F("www.example.com."),
+ Peers: cloudflare.F([]interface{}{"23ff594956f20c2a721606e94745a8aa", "00920f38ce07c2e2f4df50b1f61d4194"}),
+ })
+ 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())
+ }
+}
+
+func TestOutgoingDelete(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"),
+ )
+ _, err := client.SecondaryDNS.Outgoing.Delete(context.TODO(), secondary_dns.OutgoingDeleteParams{
+ ZoneID: cloudflare.F[any]("269d8f4853475ca241c4e730be286b20"),
+ })
+ 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())
+ }
+}
+
+func TestOutgoingDisable(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"),
+ )
+ _, err := client.SecondaryDNS.Outgoing.Disable(context.TODO(), secondary_dns.OutgoingDisableParams{
+ ZoneID: cloudflare.F[any]("269d8f4853475ca241c4e730be286b20"),
+ })
+ 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())
+ }
+}
+
+func TestOutgoingEnable(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"),
+ )
+ _, err := client.SecondaryDNS.Outgoing.Enable(context.TODO(), secondary_dns.OutgoingEnableParams{
+ ZoneID: cloudflare.F[any]("269d8f4853475ca241c4e730be286b20"),
+ })
+ 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())
+ }
+}
+
+func TestOutgoingForceNotify(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"),
+ )
+ _, err := client.SecondaryDNS.Outgoing.ForceNotify(context.TODO(), secondary_dns.OutgoingForceNotifyParams{
+ ZoneID: cloudflare.F[any]("269d8f4853475ca241c4e730be286b20"),
+ })
+ 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())
+ }
+}
+
+func TestOutgoingGet(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"),
+ )
+ _, err := client.SecondaryDNS.Outgoing.Get(context.TODO(), secondary_dns.OutgoingGetParams{
+ ZoneID: cloudflare.F[any]("269d8f4853475ca241c4e730be286b20"),
+ })
+ 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/secondary_dns/outgoingstatus.go b/secondary_dns/outgoingstatus.go
new file mode 100644
index 00000000000..322157d5e78
--- /dev/null
+++ b/secondary_dns/outgoingstatus.go
@@ -0,0 +1,131 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package secondary_dns
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// OutgoingStatusService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewOutgoingStatusService] method
+// instead.
+type OutgoingStatusService struct {
+ Options []option.RequestOption
+}
+
+// NewOutgoingStatusService generates a new service that applies the given options
+// to each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewOutgoingStatusService(opts ...option.RequestOption) (r *OutgoingStatusService) {
+ r = &OutgoingStatusService{}
+ r.Options = opts
+ return
+}
+
+// Get primary zone transfer status.
+func (r *OutgoingStatusService) Get(ctx context.Context, query OutgoingStatusGetParams, opts ...option.RequestOption) (res *SecondaryDNSEnableTransferResult, err error) {
+ opts = append(r.Options[:], opts...)
+ var env OutgoingStatusGetResponseEnvelope
+ path := fmt.Sprintf("zones/%v/secondary_dns/outgoing/status", query.ZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type OutgoingStatusGetParams struct {
+ ZoneID param.Field[interface{}] `path:"zone_id,required"`
+}
+
+type OutgoingStatusGetResponseEnvelope struct {
+ Errors []OutgoingStatusGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []OutgoingStatusGetResponseEnvelopeMessages `json:"messages,required"`
+ // The zone transfer status of a primary zone
+ Result SecondaryDNSEnableTransferResult `json:"result,required"`
+ // Whether the API call was successful
+ Success OutgoingStatusGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON outgoingStatusGetResponseEnvelopeJSON `json:"-"`
+}
+
+// outgoingStatusGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [OutgoingStatusGetResponseEnvelope]
+type outgoingStatusGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *OutgoingStatusGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r outgoingStatusGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type OutgoingStatusGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON outgoingStatusGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// outgoingStatusGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [OutgoingStatusGetResponseEnvelopeErrors]
+type outgoingStatusGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *OutgoingStatusGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r outgoingStatusGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type OutgoingStatusGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON outgoingStatusGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// outgoingStatusGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [OutgoingStatusGetResponseEnvelopeMessages]
+type outgoingStatusGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *OutgoingStatusGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r outgoingStatusGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type OutgoingStatusGetResponseEnvelopeSuccess bool
+
+const (
+ OutgoingStatusGetResponseEnvelopeSuccessTrue OutgoingStatusGetResponseEnvelopeSuccess = true
+)
diff --git a/secondary_dns/outgoingstatus_test.go b/secondary_dns/outgoingstatus_test.go
new file mode 100644
index 00000000000..a7a19ecabf7
--- /dev/null
+++ b/secondary_dns/outgoingstatus_test.go
@@ -0,0 +1,41 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package secondary_dns_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/secondary_dns"
+)
+
+func TestOutgoingStatusGet(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"),
+ )
+ _, err := client.SecondaryDNS.Outgoing.Status.Get(context.TODO(), secondary_dns.OutgoingStatusGetParams{
+ ZoneID: cloudflare.F[any]("269d8f4853475ca241c4e730be286b20"),
+ })
+ 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/secondary_dns/peer.go b/secondary_dns/peer.go
new file mode 100644
index 00000000000..d78e533ba28
--- /dev/null
+++ b/secondary_dns/peer.go
@@ -0,0 +1,642 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package secondary_dns
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// PeerService contains methods and other services that help with interacting with
+// the cloudflare API. Note, unlike clients, this service does not read variables
+// from the environment automatically. You should not instantiate this service
+// directly, and instead use the [NewPeerService] method instead.
+type PeerService struct {
+ Options []option.RequestOption
+}
+
+// NewPeerService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewPeerService(opts ...option.RequestOption) (r *PeerService) {
+ r = &PeerService{}
+ r.Options = opts
+ return
+}
+
+// Create Peer.
+func (r *PeerService) New(ctx context.Context, params PeerNewParams, opts ...option.RequestOption) (res *SecondaryDNSPeer, err error) {
+ opts = append(r.Options[:], opts...)
+ var env PeerNewResponseEnvelope
+ path := fmt.Sprintf("accounts/%v/secondary_dns/peers", params.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Modify Peer.
+func (r *PeerService) Update(ctx context.Context, peerID interface{}, params PeerUpdateParams, opts ...option.RequestOption) (res *SecondaryDNSPeer, err error) {
+ opts = append(r.Options[:], opts...)
+ var env PeerUpdateResponseEnvelope
+ path := fmt.Sprintf("accounts/%v/secondary_dns/peers/%v", params.AccountID, peerID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// List Peers.
+func (r *PeerService) List(ctx context.Context, query PeerListParams, opts ...option.RequestOption) (res *[]SecondaryDNSPeer, err error) {
+ opts = append(r.Options[:], opts...)
+ var env PeerListResponseEnvelope
+ path := fmt.Sprintf("accounts/%v/secondary_dns/peers", query.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Delete Peer.
+func (r *PeerService) Delete(ctx context.Context, peerID interface{}, body PeerDeleteParams, opts ...option.RequestOption) (res *PeerDeleteResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env PeerDeleteResponseEnvelope
+ path := fmt.Sprintf("accounts/%v/secondary_dns/peers/%v", body.AccountID, peerID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Get Peer.
+func (r *PeerService) Get(ctx context.Context, peerID interface{}, query PeerGetParams, opts ...option.RequestOption) (res *SecondaryDNSPeer, err error) {
+ opts = append(r.Options[:], opts...)
+ var env PeerGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%v/secondary_dns/peers/%v", query.AccountID, peerID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type SecondaryDNSPeer struct {
+ ID interface{} `json:"id,required"`
+ // The name of the peer.
+ Name string `json:"name,required"`
+ // IPv4/IPv6 address of primary or secondary nameserver, depending on what zone
+ // this peer is linked to. For primary zones this IP defines the IP of the
+ // secondary nameserver Cloudflare will NOTIFY upon zone changes. For secondary
+ // zones this IP defines the IP of the primary nameserver Cloudflare will send
+ // AXFR/IXFR requests to.
+ IP string `json:"ip"`
+ // Enable IXFR transfer protocol, default is AXFR. Only applicable to secondary
+ // zones.
+ IxfrEnable bool `json:"ixfr_enable"`
+ // DNS port of primary or secondary nameserver, depending on what zone this peer is
+ // linked to.
+ Port float64 `json:"port"`
+ // TSIG authentication will be used for zone transfer if configured.
+ TSIGID string `json:"tsig_id"`
+ JSON secondaryDNSPeerJSON `json:"-"`
+}
+
+// secondaryDNSPeerJSON contains the JSON metadata for the struct
+// [SecondaryDNSPeer]
+type secondaryDNSPeerJSON struct {
+ ID apijson.Field
+ Name apijson.Field
+ IP apijson.Field
+ IxfrEnable apijson.Field
+ Port apijson.Field
+ TSIGID apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *SecondaryDNSPeer) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r secondaryDNSPeerJSON) RawJSON() string {
+ return r.raw
+}
+
+type PeerDeleteResponse struct {
+ ID interface{} `json:"id"`
+ JSON peerDeleteResponseJSON `json:"-"`
+}
+
+// peerDeleteResponseJSON contains the JSON metadata for the struct
+// [PeerDeleteResponse]
+type peerDeleteResponseJSON struct {
+ ID apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PeerDeleteResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r peerDeleteResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type PeerNewParams struct {
+ AccountID param.Field[interface{}] `path:"account_id,required"`
+ Body param.Field[interface{}] `json:"body,required"`
+}
+
+func (r PeerNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r.Body)
+}
+
+type PeerNewResponseEnvelope struct {
+ Errors []PeerNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []PeerNewResponseEnvelopeMessages `json:"messages,required"`
+ Result SecondaryDNSPeer `json:"result,required"`
+ // Whether the API call was successful
+ Success PeerNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON peerNewResponseEnvelopeJSON `json:"-"`
+}
+
+// peerNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [PeerNewResponseEnvelope]
+type peerNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PeerNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r peerNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type PeerNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON peerNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// peerNewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [PeerNewResponseEnvelopeErrors]
+type peerNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PeerNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r peerNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type PeerNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON peerNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// peerNewResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [PeerNewResponseEnvelopeMessages]
+type peerNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PeerNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r peerNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type PeerNewResponseEnvelopeSuccess bool
+
+const (
+ PeerNewResponseEnvelopeSuccessTrue PeerNewResponseEnvelopeSuccess = true
+)
+
+type PeerUpdateParams struct {
+ AccountID param.Field[interface{}] `path:"account_id,required"`
+ // The name of the peer.
+ Name param.Field[string] `json:"name,required"`
+ // IPv4/IPv6 address of primary or secondary nameserver, depending on what zone
+ // this peer is linked to. For primary zones this IP defines the IP of the
+ // secondary nameserver Cloudflare will NOTIFY upon zone changes. For secondary
+ // zones this IP defines the IP of the primary nameserver Cloudflare will send
+ // AXFR/IXFR requests to.
+ IP param.Field[string] `json:"ip"`
+ // Enable IXFR transfer protocol, default is AXFR. Only applicable to secondary
+ // zones.
+ IxfrEnable param.Field[bool] `json:"ixfr_enable"`
+ // DNS port of primary or secondary nameserver, depending on what zone this peer is
+ // linked to.
+ Port param.Field[float64] `json:"port"`
+ // TSIG authentication will be used for zone transfer if configured.
+ TSIGID param.Field[string] `json:"tsig_id"`
+}
+
+func (r PeerUpdateParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type PeerUpdateResponseEnvelope struct {
+ Errors []PeerUpdateResponseEnvelopeErrors `json:"errors,required"`
+ Messages []PeerUpdateResponseEnvelopeMessages `json:"messages,required"`
+ Result SecondaryDNSPeer `json:"result,required"`
+ // Whether the API call was successful
+ Success PeerUpdateResponseEnvelopeSuccess `json:"success,required"`
+ JSON peerUpdateResponseEnvelopeJSON `json:"-"`
+}
+
+// peerUpdateResponseEnvelopeJSON contains the JSON metadata for the struct
+// [PeerUpdateResponseEnvelope]
+type peerUpdateResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PeerUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r peerUpdateResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type PeerUpdateResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON peerUpdateResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// peerUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [PeerUpdateResponseEnvelopeErrors]
+type peerUpdateResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PeerUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r peerUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type PeerUpdateResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON peerUpdateResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// peerUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [PeerUpdateResponseEnvelopeMessages]
+type peerUpdateResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PeerUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r peerUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type PeerUpdateResponseEnvelopeSuccess bool
+
+const (
+ PeerUpdateResponseEnvelopeSuccessTrue PeerUpdateResponseEnvelopeSuccess = true
+)
+
+type PeerListParams struct {
+ AccountID param.Field[interface{}] `path:"account_id,required"`
+}
+
+type PeerListResponseEnvelope struct {
+ Errors []PeerListResponseEnvelopeErrors `json:"errors,required"`
+ Messages []PeerListResponseEnvelopeMessages `json:"messages,required"`
+ Result []SecondaryDNSPeer `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success PeerListResponseEnvelopeSuccess `json:"success,required"`
+ ResultInfo PeerListResponseEnvelopeResultInfo `json:"result_info"`
+ JSON peerListResponseEnvelopeJSON `json:"-"`
+}
+
+// peerListResponseEnvelopeJSON contains the JSON metadata for the struct
+// [PeerListResponseEnvelope]
+type peerListResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ ResultInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PeerListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r peerListResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type PeerListResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON peerListResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// peerListResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [PeerListResponseEnvelopeErrors]
+type peerListResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PeerListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r peerListResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type PeerListResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON peerListResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// peerListResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [PeerListResponseEnvelopeMessages]
+type peerListResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PeerListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r peerListResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type PeerListResponseEnvelopeSuccess bool
+
+const (
+ PeerListResponseEnvelopeSuccessTrue PeerListResponseEnvelopeSuccess = true
+)
+
+type PeerListResponseEnvelopeResultInfo struct {
+ // Total number of results for the requested service
+ Count float64 `json:"count"`
+ // Current page within paginated list of results
+ Page float64 `json:"page"`
+ // Number of results per page of results
+ PerPage float64 `json:"per_page"`
+ // Total results available without any search parameters
+ TotalCount float64 `json:"total_count"`
+ JSON peerListResponseEnvelopeResultInfoJSON `json:"-"`
+}
+
+// peerListResponseEnvelopeResultInfoJSON contains the JSON metadata for the struct
+// [PeerListResponseEnvelopeResultInfo]
+type peerListResponseEnvelopeResultInfoJSON struct {
+ Count apijson.Field
+ Page apijson.Field
+ PerPage apijson.Field
+ TotalCount apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PeerListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r peerListResponseEnvelopeResultInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type PeerDeleteParams struct {
+ AccountID param.Field[interface{}] `path:"account_id,required"`
+}
+
+type PeerDeleteResponseEnvelope struct {
+ Errors []PeerDeleteResponseEnvelopeErrors `json:"errors,required"`
+ Messages []PeerDeleteResponseEnvelopeMessages `json:"messages,required"`
+ Result PeerDeleteResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success PeerDeleteResponseEnvelopeSuccess `json:"success,required"`
+ JSON peerDeleteResponseEnvelopeJSON `json:"-"`
+}
+
+// peerDeleteResponseEnvelopeJSON contains the JSON metadata for the struct
+// [PeerDeleteResponseEnvelope]
+type peerDeleteResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PeerDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r peerDeleteResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type PeerDeleteResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON peerDeleteResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// peerDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [PeerDeleteResponseEnvelopeErrors]
+type peerDeleteResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PeerDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r peerDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type PeerDeleteResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON peerDeleteResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// peerDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [PeerDeleteResponseEnvelopeMessages]
+type peerDeleteResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PeerDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r peerDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type PeerDeleteResponseEnvelopeSuccess bool
+
+const (
+ PeerDeleteResponseEnvelopeSuccessTrue PeerDeleteResponseEnvelopeSuccess = true
+)
+
+type PeerGetParams struct {
+ AccountID param.Field[interface{}] `path:"account_id,required"`
+}
+
+type PeerGetResponseEnvelope struct {
+ Errors []PeerGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []PeerGetResponseEnvelopeMessages `json:"messages,required"`
+ Result SecondaryDNSPeer `json:"result,required"`
+ // Whether the API call was successful
+ Success PeerGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON peerGetResponseEnvelopeJSON `json:"-"`
+}
+
+// peerGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [PeerGetResponseEnvelope]
+type peerGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PeerGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r peerGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type PeerGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON peerGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// peerGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [PeerGetResponseEnvelopeErrors]
+type peerGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PeerGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r peerGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type PeerGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON peerGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// peerGetResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [PeerGetResponseEnvelopeMessages]
+type peerGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PeerGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r peerGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type PeerGetResponseEnvelopeSuccess bool
+
+const (
+ PeerGetResponseEnvelopeSuccessTrue PeerGetResponseEnvelopeSuccess = true
+)
diff --git a/secondary_dns/peer_test.go b/secondary_dns/peer_test.go
new file mode 100644
index 00000000000..7db35393bcb
--- /dev/null
+++ b/secondary_dns/peer_test.go
@@ -0,0 +1,163 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package secondary_dns_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/secondary_dns"
+)
+
+func TestPeerNew(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"),
+ )
+ _, err := client.SecondaryDNS.Peers.New(context.TODO(), secondary_dns.PeerNewParams{
+ AccountID: cloudflare.F[any]("01a7362d577a6c3019a474fd6f485823"),
+ Body: cloudflare.F[any](map[string]interface{}{}),
+ })
+ 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())
+ }
+}
+
+func TestPeerUpdateWithOptionalParams(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"),
+ )
+ _, err := client.SecondaryDNS.Peers.Update(
+ context.TODO(),
+ "23ff594956f20c2a721606e94745a8aa",
+ secondary_dns.PeerUpdateParams{
+ AccountID: cloudflare.F[any]("01a7362d577a6c3019a474fd6f485823"),
+ Name: cloudflare.F("my-peer-1"),
+ IP: cloudflare.F("192.0.2.53"),
+ IxfrEnable: cloudflare.F(false),
+ Port: cloudflare.F(53.000000),
+ TSIGID: cloudflare.F("69cd1e104af3e6ed3cb344f263fd0d5a"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestPeerList(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"),
+ )
+ _, err := client.SecondaryDNS.Peers.List(context.TODO(), secondary_dns.PeerListParams{
+ AccountID: cloudflare.F[any]("01a7362d577a6c3019a474fd6f485823"),
+ })
+ 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())
+ }
+}
+
+func TestPeerDelete(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"),
+ )
+ _, err := client.SecondaryDNS.Peers.Delete(
+ context.TODO(),
+ "23ff594956f20c2a721606e94745a8aa",
+ secondary_dns.PeerDeleteParams{
+ AccountID: cloudflare.F[any]("01a7362d577a6c3019a474fd6f485823"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestPeerGet(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"),
+ )
+ _, err := client.SecondaryDNS.Peers.Get(
+ context.TODO(),
+ "23ff594956f20c2a721606e94745a8aa",
+ secondary_dns.PeerGetParams{
+ AccountID: cloudflare.F[any]("01a7362d577a6c3019a474fd6f485823"),
+ },
+ )
+ 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/secondary_dns/secondarydns.go b/secondary_dns/secondarydns.go
new file mode 100644
index 00000000000..10b4b357120
--- /dev/null
+++ b/secondary_dns/secondarydns.go
@@ -0,0 +1,37 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package secondary_dns
+
+import (
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// SecondaryDNSService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewSecondaryDNSService] method
+// instead.
+type SecondaryDNSService struct {
+ Options []option.RequestOption
+ ForceAxfrs *ForceAxfrService
+ Incoming *IncomingService
+ Outgoing *OutgoingService
+ ACLs *ACLService
+ Peers *PeerService
+ TSIGs *TSIGService
+}
+
+// NewSecondaryDNSService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewSecondaryDNSService(opts ...option.RequestOption) (r *SecondaryDNSService) {
+ r = &SecondaryDNSService{}
+ r.Options = opts
+ r.ForceAxfrs = NewForceAxfrService(opts...)
+ r.Incoming = NewIncomingService(opts...)
+ r.Outgoing = NewOutgoingService(opts...)
+ r.ACLs = NewACLService(opts...)
+ r.Peers = NewPeerService(opts...)
+ r.TSIGs = NewTSIGService(opts...)
+ return
+}
diff --git a/secondary_dns/tsig.go b/secondary_dns/tsig.go
new file mode 100644
index 00000000000..7efe88b5051
--- /dev/null
+++ b/secondary_dns/tsig.go
@@ -0,0 +1,625 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package secondary_dns
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// TSIGService contains methods and other services that help with interacting with
+// the cloudflare API. Note, unlike clients, this service does not read variables
+// from the environment automatically. You should not instantiate this service
+// directly, and instead use the [NewTSIGService] method instead.
+type TSIGService struct {
+ Options []option.RequestOption
+}
+
+// NewTSIGService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewTSIGService(opts ...option.RequestOption) (r *TSIGService) {
+ r = &TSIGService{}
+ r.Options = opts
+ return
+}
+
+// Create TSIG.
+func (r *TSIGService) New(ctx context.Context, params TSIGNewParams, opts ...option.RequestOption) (res *SecondaryDNSTSIG, err error) {
+ opts = append(r.Options[:], opts...)
+ var env TSIGNewResponseEnvelope
+ path := fmt.Sprintf("accounts/%v/secondary_dns/tsigs", params.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Modify TSIG.
+func (r *TSIGService) Update(ctx context.Context, tsigID interface{}, params TSIGUpdateParams, opts ...option.RequestOption) (res *SecondaryDNSTSIG, err error) {
+ opts = append(r.Options[:], opts...)
+ var env TSIGUpdateResponseEnvelope
+ path := fmt.Sprintf("accounts/%v/secondary_dns/tsigs/%v", params.AccountID, tsigID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// List TSIGs.
+func (r *TSIGService) List(ctx context.Context, query TSIGListParams, opts ...option.RequestOption) (res *[]SecondaryDNSTSIG, err error) {
+ opts = append(r.Options[:], opts...)
+ var env TSIGListResponseEnvelope
+ path := fmt.Sprintf("accounts/%v/secondary_dns/tsigs", query.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Delete TSIG.
+func (r *TSIGService) Delete(ctx context.Context, tsigID interface{}, body TSIGDeleteParams, opts ...option.RequestOption) (res *TSIGDeleteResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env TSIGDeleteResponseEnvelope
+ path := fmt.Sprintf("accounts/%v/secondary_dns/tsigs/%v", body.AccountID, tsigID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Get TSIG.
+func (r *TSIGService) Get(ctx context.Context, tsigID interface{}, query TSIGGetParams, opts ...option.RequestOption) (res *SecondaryDNSTSIG, err error) {
+ opts = append(r.Options[:], opts...)
+ var env TSIGGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%v/secondary_dns/tsigs/%v", query.AccountID, tsigID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type SecondaryDNSTSIG struct {
+ ID interface{} `json:"id,required"`
+ // TSIG algorithm.
+ Algo string `json:"algo,required"`
+ // TSIG key name.
+ Name string `json:"name,required"`
+ // TSIG secret.
+ Secret string `json:"secret,required"`
+ JSON secondaryDnstsigJSON `json:"-"`
+}
+
+// secondaryDnstsigJSON contains the JSON metadata for the struct
+// [SecondaryDNSTSIG]
+type secondaryDnstsigJSON struct {
+ ID apijson.Field
+ Algo apijson.Field
+ Name apijson.Field
+ Secret apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *SecondaryDNSTSIG) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r secondaryDnstsigJSON) RawJSON() string {
+ return r.raw
+}
+
+type TSIGDeleteResponse struct {
+ ID interface{} `json:"id"`
+ JSON tsigDeleteResponseJSON `json:"-"`
+}
+
+// tsigDeleteResponseJSON contains the JSON metadata for the struct
+// [TSIGDeleteResponse]
+type tsigDeleteResponseJSON struct {
+ ID apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *TSIGDeleteResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r tsigDeleteResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type TSIGNewParams struct {
+ AccountID param.Field[interface{}] `path:"account_id,required"`
+ // TSIG algorithm.
+ Algo param.Field[string] `json:"algo,required"`
+ // TSIG key name.
+ Name param.Field[string] `json:"name,required"`
+ // TSIG secret.
+ Secret param.Field[string] `json:"secret,required"`
+}
+
+func (r TSIGNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type TSIGNewResponseEnvelope struct {
+ Errors []TSIGNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []TSIGNewResponseEnvelopeMessages `json:"messages,required"`
+ Result SecondaryDNSTSIG `json:"result,required"`
+ // Whether the API call was successful
+ Success TSIGNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON tsigNewResponseEnvelopeJSON `json:"-"`
+}
+
+// tsigNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [TSIGNewResponseEnvelope]
+type tsigNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *TSIGNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r tsigNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type TSIGNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON tsigNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// tsigNewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [TSIGNewResponseEnvelopeErrors]
+type tsigNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *TSIGNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r tsigNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type TSIGNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON tsigNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// tsigNewResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [TSIGNewResponseEnvelopeMessages]
+type tsigNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *TSIGNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r tsigNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type TSIGNewResponseEnvelopeSuccess bool
+
+const (
+ TSIGNewResponseEnvelopeSuccessTrue TSIGNewResponseEnvelopeSuccess = true
+)
+
+type TSIGUpdateParams struct {
+ AccountID param.Field[interface{}] `path:"account_id,required"`
+ // TSIG algorithm.
+ Algo param.Field[string] `json:"algo,required"`
+ // TSIG key name.
+ Name param.Field[string] `json:"name,required"`
+ // TSIG secret.
+ Secret param.Field[string] `json:"secret,required"`
+}
+
+func (r TSIGUpdateParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type TSIGUpdateResponseEnvelope struct {
+ Errors []TSIGUpdateResponseEnvelopeErrors `json:"errors,required"`
+ Messages []TSIGUpdateResponseEnvelopeMessages `json:"messages,required"`
+ Result SecondaryDNSTSIG `json:"result,required"`
+ // Whether the API call was successful
+ Success TSIGUpdateResponseEnvelopeSuccess `json:"success,required"`
+ JSON tsigUpdateResponseEnvelopeJSON `json:"-"`
+}
+
+// tsigUpdateResponseEnvelopeJSON contains the JSON metadata for the struct
+// [TSIGUpdateResponseEnvelope]
+type tsigUpdateResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *TSIGUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r tsigUpdateResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type TSIGUpdateResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON tsigUpdateResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// tsigUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [TSIGUpdateResponseEnvelopeErrors]
+type tsigUpdateResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *TSIGUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r tsigUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type TSIGUpdateResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON tsigUpdateResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// tsigUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [TSIGUpdateResponseEnvelopeMessages]
+type tsigUpdateResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *TSIGUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r tsigUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type TSIGUpdateResponseEnvelopeSuccess bool
+
+const (
+ TSIGUpdateResponseEnvelopeSuccessTrue TSIGUpdateResponseEnvelopeSuccess = true
+)
+
+type TSIGListParams struct {
+ AccountID param.Field[interface{}] `path:"account_id,required"`
+}
+
+type TSIGListResponseEnvelope struct {
+ Errors []TSIGListResponseEnvelopeErrors `json:"errors,required"`
+ Messages []TSIGListResponseEnvelopeMessages `json:"messages,required"`
+ Result []SecondaryDNSTSIG `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success TSIGListResponseEnvelopeSuccess `json:"success,required"`
+ ResultInfo TSIGListResponseEnvelopeResultInfo `json:"result_info"`
+ JSON tsigListResponseEnvelopeJSON `json:"-"`
+}
+
+// tsigListResponseEnvelopeJSON contains the JSON metadata for the struct
+// [TSIGListResponseEnvelope]
+type tsigListResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ ResultInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *TSIGListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r tsigListResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type TSIGListResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON tsigListResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// tsigListResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [TSIGListResponseEnvelopeErrors]
+type tsigListResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *TSIGListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r tsigListResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type TSIGListResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON tsigListResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// tsigListResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [TSIGListResponseEnvelopeMessages]
+type tsigListResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *TSIGListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r tsigListResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type TSIGListResponseEnvelopeSuccess bool
+
+const (
+ TSIGListResponseEnvelopeSuccessTrue TSIGListResponseEnvelopeSuccess = true
+)
+
+type TSIGListResponseEnvelopeResultInfo struct {
+ // Total number of results for the requested service
+ Count float64 `json:"count"`
+ // Current page within paginated list of results
+ Page float64 `json:"page"`
+ // Number of results per page of results
+ PerPage float64 `json:"per_page"`
+ // Total results available without any search parameters
+ TotalCount float64 `json:"total_count"`
+ JSON tsigListResponseEnvelopeResultInfoJSON `json:"-"`
+}
+
+// tsigListResponseEnvelopeResultInfoJSON contains the JSON metadata for the struct
+// [TSIGListResponseEnvelopeResultInfo]
+type tsigListResponseEnvelopeResultInfoJSON struct {
+ Count apijson.Field
+ Page apijson.Field
+ PerPage apijson.Field
+ TotalCount apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *TSIGListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r tsigListResponseEnvelopeResultInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type TSIGDeleteParams struct {
+ AccountID param.Field[interface{}] `path:"account_id,required"`
+}
+
+type TSIGDeleteResponseEnvelope struct {
+ Errors []TSIGDeleteResponseEnvelopeErrors `json:"errors,required"`
+ Messages []TSIGDeleteResponseEnvelopeMessages `json:"messages,required"`
+ Result TSIGDeleteResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success TSIGDeleteResponseEnvelopeSuccess `json:"success,required"`
+ JSON tsigDeleteResponseEnvelopeJSON `json:"-"`
+}
+
+// tsigDeleteResponseEnvelopeJSON contains the JSON metadata for the struct
+// [TSIGDeleteResponseEnvelope]
+type tsigDeleteResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *TSIGDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r tsigDeleteResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type TSIGDeleteResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON tsigDeleteResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// tsigDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [TSIGDeleteResponseEnvelopeErrors]
+type tsigDeleteResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *TSIGDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r tsigDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type TSIGDeleteResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON tsigDeleteResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// tsigDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [TSIGDeleteResponseEnvelopeMessages]
+type tsigDeleteResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *TSIGDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r tsigDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type TSIGDeleteResponseEnvelopeSuccess bool
+
+const (
+ TSIGDeleteResponseEnvelopeSuccessTrue TSIGDeleteResponseEnvelopeSuccess = true
+)
+
+type TSIGGetParams struct {
+ AccountID param.Field[interface{}] `path:"account_id,required"`
+}
+
+type TSIGGetResponseEnvelope struct {
+ Errors []TSIGGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []TSIGGetResponseEnvelopeMessages `json:"messages,required"`
+ Result SecondaryDNSTSIG `json:"result,required"`
+ // Whether the API call was successful
+ Success TSIGGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON tsigGetResponseEnvelopeJSON `json:"-"`
+}
+
+// tsigGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [TSIGGetResponseEnvelope]
+type tsigGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *TSIGGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r tsigGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type TSIGGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON tsigGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// tsigGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [TSIGGetResponseEnvelopeErrors]
+type tsigGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *TSIGGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r tsigGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type TSIGGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON tsigGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// tsigGetResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [TSIGGetResponseEnvelopeMessages]
+type tsigGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *TSIGGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r tsigGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type TSIGGetResponseEnvelopeSuccess bool
+
+const (
+ TSIGGetResponseEnvelopeSuccessTrue TSIGGetResponseEnvelopeSuccess = true
+)
diff --git a/secondary_dns/tsig_test.go b/secondary_dns/tsig_test.go
new file mode 100644
index 00000000000..c410881d5c7
--- /dev/null
+++ b/secondary_dns/tsig_test.go
@@ -0,0 +1,163 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package secondary_dns_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/secondary_dns"
+)
+
+func TestTSIGNew(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"),
+ )
+ _, err := client.SecondaryDNS.TSIGs.New(context.TODO(), secondary_dns.TSIGNewParams{
+ AccountID: cloudflare.F[any]("01a7362d577a6c3019a474fd6f485823"),
+ Algo: cloudflare.F("hmac-sha512."),
+ Name: cloudflare.F("tsig.customer.cf."),
+ Secret: cloudflare.F("caf79a7804b04337c9c66ccd7bef9190a1e1679b5dd03d8aa10f7ad45e1a9dab92b417896c15d4d007c7c14194538d2a5d0feffdecc5a7f0e1c570cfa700837c"),
+ })
+ 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())
+ }
+}
+
+func TestTSIGUpdate(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"),
+ )
+ _, err := client.SecondaryDNS.TSIGs.Update(
+ context.TODO(),
+ "69cd1e104af3e6ed3cb344f263fd0d5a",
+ secondary_dns.TSIGUpdateParams{
+ AccountID: cloudflare.F[any]("01a7362d577a6c3019a474fd6f485823"),
+ Algo: cloudflare.F("hmac-sha512."),
+ Name: cloudflare.F("tsig.customer.cf."),
+ Secret: cloudflare.F("caf79a7804b04337c9c66ccd7bef9190a1e1679b5dd03d8aa10f7ad45e1a9dab92b417896c15d4d007c7c14194538d2a5d0feffdecc5a7f0e1c570cfa700837c"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestTSIGList(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"),
+ )
+ _, err := client.SecondaryDNS.TSIGs.List(context.TODO(), secondary_dns.TSIGListParams{
+ AccountID: cloudflare.F[any]("01a7362d577a6c3019a474fd6f485823"),
+ })
+ 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())
+ }
+}
+
+func TestTSIGDelete(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"),
+ )
+ _, err := client.SecondaryDNS.TSIGs.Delete(
+ context.TODO(),
+ "69cd1e104af3e6ed3cb344f263fd0d5a",
+ secondary_dns.TSIGDeleteParams{
+ AccountID: cloudflare.F[any]("01a7362d577a6c3019a474fd6f485823"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestTSIGGet(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"),
+ )
+ _, err := client.SecondaryDNS.TSIGs.Get(
+ context.TODO(),
+ "69cd1e104af3e6ed3cb344f263fd0d5a",
+ secondary_dns.TSIGGetParams{
+ AccountID: cloudflare.F[any]("01a7362d577a6c3019a474fd6f485823"),
+ },
+ )
+ 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/secondarydns.go b/secondarydns.go
deleted file mode 100644
index 11b793c2f7d..00000000000
--- a/secondarydns.go
+++ /dev/null
@@ -1,37 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// SecondaryDNSService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewSecondaryDNSService] method
-// instead.
-type SecondaryDNSService struct {
- Options []option.RequestOption
- ForceAxfrs *SecondaryDNSForceAxfrService
- Incoming *SecondaryDNSIncomingService
- Outgoing *SecondaryDNSOutgoingService
- ACLs *SecondaryDNSACLService
- Peers *SecondaryDNSPeerService
- TSIGs *SecondaryDNSTSIGService
-}
-
-// NewSecondaryDNSService generates a new service that applies the given options to
-// each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewSecondaryDNSService(opts ...option.RequestOption) (r *SecondaryDNSService) {
- r = &SecondaryDNSService{}
- r.Options = opts
- r.ForceAxfrs = NewSecondaryDNSForceAxfrService(opts...)
- r.Incoming = NewSecondaryDNSIncomingService(opts...)
- r.Outgoing = NewSecondaryDNSOutgoingService(opts...)
- r.ACLs = NewSecondaryDNSACLService(opts...)
- r.Peers = NewSecondaryDNSPeerService(opts...)
- r.TSIGs = NewSecondaryDNSTSIGService(opts...)
- return
-}
diff --git a/secondarydnsacl.go b/secondarydnsacl.go
deleted file mode 100644
index ea99847a580..00000000000
--- a/secondarydnsacl.go
+++ /dev/null
@@ -1,717 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// SecondaryDNSACLService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewSecondaryDNSACLService] method
-// instead.
-type SecondaryDNSACLService struct {
- Options []option.RequestOption
-}
-
-// NewSecondaryDNSACLService generates a new service that applies the given options
-// to each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewSecondaryDNSACLService(opts ...option.RequestOption) (r *SecondaryDNSACLService) {
- r = &SecondaryDNSACLService{}
- r.Options = opts
- return
-}
-
-// Create ACL.
-func (r *SecondaryDNSACLService) New(ctx context.Context, params SecondaryDNSACLNewParams, opts ...option.RequestOption) (res *SecondaryDnsaclNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env SecondaryDnsaclNewResponseEnvelope
- path := fmt.Sprintf("accounts/%v/secondary_dns/acls", params.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Modify ACL.
-func (r *SecondaryDNSACLService) Update(ctx context.Context, aclID interface{}, params SecondaryDNSACLUpdateParams, opts ...option.RequestOption) (res *SecondaryDnsaclUpdateResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env SecondaryDnsaclUpdateResponseEnvelope
- path := fmt.Sprintf("accounts/%v/secondary_dns/acls/%v", params.AccountID, aclID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// List ACLs.
-func (r *SecondaryDNSACLService) List(ctx context.Context, query SecondaryDNSACLListParams, opts ...option.RequestOption) (res *[]SecondaryDnsaclListResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env SecondaryDnsaclListResponseEnvelope
- path := fmt.Sprintf("accounts/%v/secondary_dns/acls", query.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Delete ACL.
-func (r *SecondaryDNSACLService) Delete(ctx context.Context, aclID interface{}, body SecondaryDNSACLDeleteParams, opts ...option.RequestOption) (res *SecondaryDnsaclDeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env SecondaryDnsaclDeleteResponseEnvelope
- path := fmt.Sprintf("accounts/%v/secondary_dns/acls/%v", body.AccountID, aclID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Get ACL.
-func (r *SecondaryDNSACLService) Get(ctx context.Context, aclID interface{}, query SecondaryDNSACLGetParams, opts ...option.RequestOption) (res *SecondaryDnsaclGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env SecondaryDnsaclGetResponseEnvelope
- path := fmt.Sprintf("accounts/%v/secondary_dns/acls/%v", query.AccountID, aclID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type SecondaryDnsaclNewResponse struct {
- ID interface{} `json:"id,required"`
- // Allowed IPv4/IPv6 address range of primary or secondary nameservers. This will
- // be applied for the entire account. The IP range is used to allow additional
- // NOTIFY IPs for secondary zones and IPs Cloudflare allows AXFR/IXFR requests from
- // for primary zones. CIDRs are limited to a maximum of /24 for IPv4 and /64 for
- // IPv6 respectively.
- IPRange string `json:"ip_range,required"`
- // The name of the acl.
- Name string `json:"name,required"`
- JSON secondaryDnsaclNewResponseJSON `json:"-"`
-}
-
-// secondaryDnsaclNewResponseJSON contains the JSON metadata for the struct
-// [SecondaryDnsaclNewResponse]
-type secondaryDnsaclNewResponseJSON struct {
- ID apijson.Field
- IPRange apijson.Field
- Name apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDnsaclNewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDnsaclNewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDnsaclUpdateResponse struct {
- ID interface{} `json:"id,required"`
- // Allowed IPv4/IPv6 address range of primary or secondary nameservers. This will
- // be applied for the entire account. The IP range is used to allow additional
- // NOTIFY IPs for secondary zones and IPs Cloudflare allows AXFR/IXFR requests from
- // for primary zones. CIDRs are limited to a maximum of /24 for IPv4 and /64 for
- // IPv6 respectively.
- IPRange string `json:"ip_range,required"`
- // The name of the acl.
- Name string `json:"name,required"`
- JSON secondaryDnsaclUpdateResponseJSON `json:"-"`
-}
-
-// secondaryDnsaclUpdateResponseJSON contains the JSON metadata for the struct
-// [SecondaryDnsaclUpdateResponse]
-type secondaryDnsaclUpdateResponseJSON struct {
- ID apijson.Field
- IPRange apijson.Field
- Name apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDnsaclUpdateResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDnsaclUpdateResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDnsaclListResponse struct {
- ID interface{} `json:"id,required"`
- // Allowed IPv4/IPv6 address range of primary or secondary nameservers. This will
- // be applied for the entire account. The IP range is used to allow additional
- // NOTIFY IPs for secondary zones and IPs Cloudflare allows AXFR/IXFR requests from
- // for primary zones. CIDRs are limited to a maximum of /24 for IPv4 and /64 for
- // IPv6 respectively.
- IPRange string `json:"ip_range,required"`
- // The name of the acl.
- Name string `json:"name,required"`
- JSON secondaryDnsaclListResponseJSON `json:"-"`
-}
-
-// secondaryDnsaclListResponseJSON contains the JSON metadata for the struct
-// [SecondaryDnsaclListResponse]
-type secondaryDnsaclListResponseJSON struct {
- ID apijson.Field
- IPRange apijson.Field
- Name apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDnsaclListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDnsaclListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDnsaclDeleteResponse struct {
- ID interface{} `json:"id"`
- JSON secondaryDnsaclDeleteResponseJSON `json:"-"`
-}
-
-// secondaryDnsaclDeleteResponseJSON contains the JSON metadata for the struct
-// [SecondaryDnsaclDeleteResponse]
-type secondaryDnsaclDeleteResponseJSON struct {
- ID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDnsaclDeleteResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDnsaclDeleteResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDnsaclGetResponse struct {
- ID interface{} `json:"id,required"`
- // Allowed IPv4/IPv6 address range of primary or secondary nameservers. This will
- // be applied for the entire account. The IP range is used to allow additional
- // NOTIFY IPs for secondary zones and IPs Cloudflare allows AXFR/IXFR requests from
- // for primary zones. CIDRs are limited to a maximum of /24 for IPv4 and /64 for
- // IPv6 respectively.
- IPRange string `json:"ip_range,required"`
- // The name of the acl.
- Name string `json:"name,required"`
- JSON secondaryDnsaclGetResponseJSON `json:"-"`
-}
-
-// secondaryDnsaclGetResponseJSON contains the JSON metadata for the struct
-// [SecondaryDnsaclGetResponse]
-type secondaryDnsaclGetResponseJSON struct {
- ID apijson.Field
- IPRange apijson.Field
- Name apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDnsaclGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDnsaclGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDNSACLNewParams struct {
- AccountID param.Field[interface{}] `path:"account_id,required"`
- Body param.Field[interface{}] `json:"body,required"`
-}
-
-func (r SecondaryDNSACLNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r.Body)
-}
-
-type SecondaryDnsaclNewResponseEnvelope struct {
- Errors []SecondaryDnsaclNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []SecondaryDnsaclNewResponseEnvelopeMessages `json:"messages,required"`
- Result SecondaryDnsaclNewResponse `json:"result,required"`
- // Whether the API call was successful
- Success SecondaryDnsaclNewResponseEnvelopeSuccess `json:"success,required"`
- JSON secondaryDnsaclNewResponseEnvelopeJSON `json:"-"`
-}
-
-// secondaryDnsaclNewResponseEnvelopeJSON contains the JSON metadata for the struct
-// [SecondaryDnsaclNewResponseEnvelope]
-type secondaryDnsaclNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDnsaclNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDnsaclNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDnsaclNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON secondaryDnsaclNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// secondaryDnsaclNewResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [SecondaryDnsaclNewResponseEnvelopeErrors]
-type secondaryDnsaclNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDnsaclNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDnsaclNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDnsaclNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON secondaryDnsaclNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// secondaryDnsaclNewResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [SecondaryDnsaclNewResponseEnvelopeMessages]
-type secondaryDnsaclNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDnsaclNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDnsaclNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type SecondaryDnsaclNewResponseEnvelopeSuccess bool
-
-const (
- SecondaryDnsaclNewResponseEnvelopeSuccessTrue SecondaryDnsaclNewResponseEnvelopeSuccess = true
-)
-
-type SecondaryDNSACLUpdateParams struct {
- AccountID param.Field[interface{}] `path:"account_id,required"`
- // Allowed IPv4/IPv6 address range of primary or secondary nameservers. This will
- // be applied for the entire account. The IP range is used to allow additional
- // NOTIFY IPs for secondary zones and IPs Cloudflare allows AXFR/IXFR requests from
- // for primary zones. CIDRs are limited to a maximum of /24 for IPv4 and /64 for
- // IPv6 respectively.
- IPRange param.Field[string] `json:"ip_range,required"`
- // The name of the acl.
- Name param.Field[string] `json:"name,required"`
-}
-
-func (r SecondaryDNSACLUpdateParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type SecondaryDnsaclUpdateResponseEnvelope struct {
- Errors []SecondaryDnsaclUpdateResponseEnvelopeErrors `json:"errors,required"`
- Messages []SecondaryDnsaclUpdateResponseEnvelopeMessages `json:"messages,required"`
- Result SecondaryDnsaclUpdateResponse `json:"result,required"`
- // Whether the API call was successful
- Success SecondaryDnsaclUpdateResponseEnvelopeSuccess `json:"success,required"`
- JSON secondaryDnsaclUpdateResponseEnvelopeJSON `json:"-"`
-}
-
-// secondaryDnsaclUpdateResponseEnvelopeJSON contains the JSON metadata for the
-// struct [SecondaryDnsaclUpdateResponseEnvelope]
-type secondaryDnsaclUpdateResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDnsaclUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDnsaclUpdateResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDnsaclUpdateResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON secondaryDnsaclUpdateResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// secondaryDnsaclUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [SecondaryDnsaclUpdateResponseEnvelopeErrors]
-type secondaryDnsaclUpdateResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDnsaclUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDnsaclUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDnsaclUpdateResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON secondaryDnsaclUpdateResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// secondaryDnsaclUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [SecondaryDnsaclUpdateResponseEnvelopeMessages]
-type secondaryDnsaclUpdateResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDnsaclUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDnsaclUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type SecondaryDnsaclUpdateResponseEnvelopeSuccess bool
-
-const (
- SecondaryDnsaclUpdateResponseEnvelopeSuccessTrue SecondaryDnsaclUpdateResponseEnvelopeSuccess = true
-)
-
-type SecondaryDNSACLListParams struct {
- AccountID param.Field[interface{}] `path:"account_id,required"`
-}
-
-type SecondaryDnsaclListResponseEnvelope struct {
- Errors []SecondaryDnsaclListResponseEnvelopeErrors `json:"errors,required"`
- Messages []SecondaryDnsaclListResponseEnvelopeMessages `json:"messages,required"`
- Result []SecondaryDnsaclListResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success SecondaryDnsaclListResponseEnvelopeSuccess `json:"success,required"`
- ResultInfo SecondaryDnsaclListResponseEnvelopeResultInfo `json:"result_info"`
- JSON secondaryDnsaclListResponseEnvelopeJSON `json:"-"`
-}
-
-// secondaryDnsaclListResponseEnvelopeJSON contains the JSON metadata for the
-// struct [SecondaryDnsaclListResponseEnvelope]
-type secondaryDnsaclListResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- ResultInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDnsaclListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDnsaclListResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDnsaclListResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON secondaryDnsaclListResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// secondaryDnsaclListResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [SecondaryDnsaclListResponseEnvelopeErrors]
-type secondaryDnsaclListResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDnsaclListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDnsaclListResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDnsaclListResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON secondaryDnsaclListResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// secondaryDnsaclListResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [SecondaryDnsaclListResponseEnvelopeMessages]
-type secondaryDnsaclListResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDnsaclListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDnsaclListResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type SecondaryDnsaclListResponseEnvelopeSuccess bool
-
-const (
- SecondaryDnsaclListResponseEnvelopeSuccessTrue SecondaryDnsaclListResponseEnvelopeSuccess = true
-)
-
-type SecondaryDnsaclListResponseEnvelopeResultInfo struct {
- // Total number of results for the requested service
- Count float64 `json:"count"`
- // Current page within paginated list of results
- Page float64 `json:"page"`
- // Number of results per page of results
- PerPage float64 `json:"per_page"`
- // Total results available without any search parameters
- TotalCount float64 `json:"total_count"`
- JSON secondaryDnsaclListResponseEnvelopeResultInfoJSON `json:"-"`
-}
-
-// secondaryDnsaclListResponseEnvelopeResultInfoJSON contains the JSON metadata for
-// the struct [SecondaryDnsaclListResponseEnvelopeResultInfo]
-type secondaryDnsaclListResponseEnvelopeResultInfoJSON struct {
- Count apijson.Field
- Page apijson.Field
- PerPage apijson.Field
- TotalCount apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDnsaclListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDnsaclListResponseEnvelopeResultInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDNSACLDeleteParams struct {
- AccountID param.Field[interface{}] `path:"account_id,required"`
-}
-
-type SecondaryDnsaclDeleteResponseEnvelope struct {
- Errors []SecondaryDnsaclDeleteResponseEnvelopeErrors `json:"errors,required"`
- Messages []SecondaryDnsaclDeleteResponseEnvelopeMessages `json:"messages,required"`
- Result SecondaryDnsaclDeleteResponse `json:"result,required"`
- // Whether the API call was successful
- Success SecondaryDnsaclDeleteResponseEnvelopeSuccess `json:"success,required"`
- JSON secondaryDnsaclDeleteResponseEnvelopeJSON `json:"-"`
-}
-
-// secondaryDnsaclDeleteResponseEnvelopeJSON contains the JSON metadata for the
-// struct [SecondaryDnsaclDeleteResponseEnvelope]
-type secondaryDnsaclDeleteResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDnsaclDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDnsaclDeleteResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDnsaclDeleteResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON secondaryDnsaclDeleteResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// secondaryDnsaclDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [SecondaryDnsaclDeleteResponseEnvelopeErrors]
-type secondaryDnsaclDeleteResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDnsaclDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDnsaclDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDnsaclDeleteResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON secondaryDnsaclDeleteResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// secondaryDnsaclDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [SecondaryDnsaclDeleteResponseEnvelopeMessages]
-type secondaryDnsaclDeleteResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDnsaclDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDnsaclDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type SecondaryDnsaclDeleteResponseEnvelopeSuccess bool
-
-const (
- SecondaryDnsaclDeleteResponseEnvelopeSuccessTrue SecondaryDnsaclDeleteResponseEnvelopeSuccess = true
-)
-
-type SecondaryDNSACLGetParams struct {
- AccountID param.Field[interface{}] `path:"account_id,required"`
-}
-
-type SecondaryDnsaclGetResponseEnvelope struct {
- Errors []SecondaryDnsaclGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []SecondaryDnsaclGetResponseEnvelopeMessages `json:"messages,required"`
- Result SecondaryDnsaclGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success SecondaryDnsaclGetResponseEnvelopeSuccess `json:"success,required"`
- JSON secondaryDnsaclGetResponseEnvelopeJSON `json:"-"`
-}
-
-// secondaryDnsaclGetResponseEnvelopeJSON contains the JSON metadata for the struct
-// [SecondaryDnsaclGetResponseEnvelope]
-type secondaryDnsaclGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDnsaclGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDnsaclGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDnsaclGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON secondaryDnsaclGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// secondaryDnsaclGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [SecondaryDnsaclGetResponseEnvelopeErrors]
-type secondaryDnsaclGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDnsaclGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDnsaclGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDnsaclGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON secondaryDnsaclGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// secondaryDnsaclGetResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [SecondaryDnsaclGetResponseEnvelopeMessages]
-type secondaryDnsaclGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDnsaclGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDnsaclGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type SecondaryDnsaclGetResponseEnvelopeSuccess bool
-
-const (
- SecondaryDnsaclGetResponseEnvelopeSuccessTrue SecondaryDnsaclGetResponseEnvelopeSuccess = true
-)
diff --git a/secondarydnsacl_test.go b/secondarydnsacl_test.go
deleted file mode 100644
index 87acef30548..00000000000
--- a/secondarydnsacl_test.go
+++ /dev/null
@@ -1,159 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestSecondaryDNSACLNew(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"),
- )
- _, err := client.SecondaryDNS.ACLs.New(context.TODO(), cloudflare.SecondaryDNSACLNewParams{
- AccountID: cloudflare.F[any]("01a7362d577a6c3019a474fd6f485823"),
- Body: cloudflare.F[any](map[string]interface{}{}),
- })
- 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())
- }
-}
-
-func TestSecondaryDNSACLUpdate(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"),
- )
- _, err := client.SecondaryDNS.ACLs.Update(
- context.TODO(),
- "23ff594956f20c2a721606e94745a8aa",
- cloudflare.SecondaryDNSACLUpdateParams{
- AccountID: cloudflare.F[any]("01a7362d577a6c3019a474fd6f485823"),
- IPRange: cloudflare.F("192.0.2.53/28"),
- Name: cloudflare.F("my-acl-1"),
- },
- )
- 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())
- }
-}
-
-func TestSecondaryDNSACLList(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"),
- )
- _, err := client.SecondaryDNS.ACLs.List(context.TODO(), cloudflare.SecondaryDNSACLListParams{
- AccountID: cloudflare.F[any]("01a7362d577a6c3019a474fd6f485823"),
- })
- 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())
- }
-}
-
-func TestSecondaryDNSACLDelete(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"),
- )
- _, err := client.SecondaryDNS.ACLs.Delete(
- context.TODO(),
- "23ff594956f20c2a721606e94745a8aa",
- cloudflare.SecondaryDNSACLDeleteParams{
- AccountID: cloudflare.F[any]("01a7362d577a6c3019a474fd6f485823"),
- },
- )
- 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())
- }
-}
-
-func TestSecondaryDNSACLGet(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"),
- )
- _, err := client.SecondaryDNS.ACLs.Get(
- context.TODO(),
- "23ff594956f20c2a721606e94745a8aa",
- cloudflare.SecondaryDNSACLGetParams{
- AccountID: cloudflare.F[any]("01a7362d577a6c3019a474fd6f485823"),
- },
- )
- 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/secondarydnsforceaxfr.go b/secondarydnsforceaxfr.go
deleted file mode 100644
index 419073e7793..00000000000
--- a/secondarydnsforceaxfr.go
+++ /dev/null
@@ -1,131 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// SecondaryDNSForceAxfrService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewSecondaryDNSForceAxfrService]
-// method instead.
-type SecondaryDNSForceAxfrService struct {
- Options []option.RequestOption
-}
-
-// NewSecondaryDNSForceAxfrService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewSecondaryDNSForceAxfrService(opts ...option.RequestOption) (r *SecondaryDNSForceAxfrService) {
- r = &SecondaryDNSForceAxfrService{}
- r.Options = opts
- return
-}
-
-// Sends AXFR zone transfer request to primary nameserver(s).
-func (r *SecondaryDNSForceAxfrService) New(ctx context.Context, body SecondaryDNSForceAxfrNewParams, opts ...option.RequestOption) (res *string, err error) {
- opts = append(r.Options[:], opts...)
- var env SecondaryDNSForceAxfrNewResponseEnvelope
- path := fmt.Sprintf("zones/%v/secondary_dns/force_axfr", body.ZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type SecondaryDNSForceAxfrNewParams struct {
- ZoneID param.Field[interface{}] `path:"zone_id,required"`
-}
-
-type SecondaryDNSForceAxfrNewResponseEnvelope struct {
- Errors []SecondaryDNSForceAxfrNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []SecondaryDNSForceAxfrNewResponseEnvelopeMessages `json:"messages,required"`
- // When force_axfr query parameter is set to true, the response is a simple string
- Result string `json:"result,required"`
- // Whether the API call was successful
- Success SecondaryDNSForceAxfrNewResponseEnvelopeSuccess `json:"success,required"`
- JSON secondaryDNSForceAxfrNewResponseEnvelopeJSON `json:"-"`
-}
-
-// secondaryDNSForceAxfrNewResponseEnvelopeJSON contains the JSON metadata for the
-// struct [SecondaryDNSForceAxfrNewResponseEnvelope]
-type secondaryDNSForceAxfrNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDNSForceAxfrNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDNSForceAxfrNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDNSForceAxfrNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON secondaryDNSForceAxfrNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// secondaryDNSForceAxfrNewResponseEnvelopeErrorsJSON contains the JSON metadata
-// for the struct [SecondaryDNSForceAxfrNewResponseEnvelopeErrors]
-type secondaryDNSForceAxfrNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDNSForceAxfrNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDNSForceAxfrNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDNSForceAxfrNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON secondaryDNSForceAxfrNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// secondaryDNSForceAxfrNewResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [SecondaryDNSForceAxfrNewResponseEnvelopeMessages]
-type secondaryDNSForceAxfrNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDNSForceAxfrNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDNSForceAxfrNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type SecondaryDNSForceAxfrNewResponseEnvelopeSuccess bool
-
-const (
- SecondaryDNSForceAxfrNewResponseEnvelopeSuccessTrue SecondaryDNSForceAxfrNewResponseEnvelopeSuccess = true
-)
diff --git a/secondarydnsforceaxfr_test.go b/secondarydnsforceaxfr_test.go
deleted file mode 100644
index b3068420781..00000000000
--- a/secondarydnsforceaxfr_test.go
+++ /dev/null
@@ -1,40 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestSecondaryDNSForceAxfrNew(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"),
- )
- _, err := client.SecondaryDNS.ForceAxfrs.New(context.TODO(), cloudflare.SecondaryDNSForceAxfrNewParams{
- ZoneID: cloudflare.F[any]("269d8f4853475ca241c4e730be286b20"),
- })
- 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/secondarydnsincoming.go b/secondarydnsincoming.go
deleted file mode 100644
index 449a2a5d366..00000000000
--- a/secondarydnsincoming.go
+++ /dev/null
@@ -1,596 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// SecondaryDNSIncomingService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewSecondaryDNSIncomingService]
-// method instead.
-type SecondaryDNSIncomingService struct {
- Options []option.RequestOption
-}
-
-// NewSecondaryDNSIncomingService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewSecondaryDNSIncomingService(opts ...option.RequestOption) (r *SecondaryDNSIncomingService) {
- r = &SecondaryDNSIncomingService{}
- r.Options = opts
- return
-}
-
-// Create secondary zone configuration for incoming zone transfers.
-func (r *SecondaryDNSIncomingService) New(ctx context.Context, params SecondaryDNSIncomingNewParams, opts ...option.RequestOption) (res *SecondaryDNSIncomingNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env SecondaryDNSIncomingNewResponseEnvelope
- path := fmt.Sprintf("zones/%v/secondary_dns/incoming", params.ZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Update secondary zone configuration for incoming zone transfers.
-func (r *SecondaryDNSIncomingService) Update(ctx context.Context, params SecondaryDNSIncomingUpdateParams, opts ...option.RequestOption) (res *SecondaryDNSIncomingUpdateResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env SecondaryDNSIncomingUpdateResponseEnvelope
- path := fmt.Sprintf("zones/%v/secondary_dns/incoming", params.ZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Delete secondary zone configuration for incoming zone transfers.
-func (r *SecondaryDNSIncomingService) Delete(ctx context.Context, body SecondaryDNSIncomingDeleteParams, opts ...option.RequestOption) (res *SecondaryDNSIncomingDeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env SecondaryDNSIncomingDeleteResponseEnvelope
- path := fmt.Sprintf("zones/%v/secondary_dns/incoming", body.ZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Get secondary zone configuration for incoming zone transfers.
-func (r *SecondaryDNSIncomingService) Get(ctx context.Context, query SecondaryDNSIncomingGetParams, opts ...option.RequestOption) (res *SecondaryDNSIncomingGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env SecondaryDNSIncomingGetResponseEnvelope
- path := fmt.Sprintf("zones/%v/secondary_dns/incoming", query.ZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type SecondaryDNSIncomingNewResponse struct {
- ID interface{} `json:"id"`
- // How often should a secondary zone auto refresh regardless of DNS NOTIFY. Not
- // applicable for primary zones.
- AutoRefreshSeconds float64 `json:"auto_refresh_seconds"`
- // The time for a specific event.
- CheckedTime string `json:"checked_time"`
- // The time for a specific event.
- CreatedTime string `json:"created_time"`
- // The time for a specific event.
- ModifiedTime string `json:"modified_time"`
- // Zone name.
- Name string `json:"name"`
- // A list of peer tags.
- Peers []interface{} `json:"peers"`
- // The serial number of the SOA for the given zone.
- SoaSerial float64 `json:"soa_serial"`
- JSON secondaryDNSIncomingNewResponseJSON `json:"-"`
-}
-
-// secondaryDNSIncomingNewResponseJSON contains the JSON metadata for the struct
-// [SecondaryDNSIncomingNewResponse]
-type secondaryDNSIncomingNewResponseJSON struct {
- ID apijson.Field
- AutoRefreshSeconds apijson.Field
- CheckedTime apijson.Field
- CreatedTime apijson.Field
- ModifiedTime apijson.Field
- Name apijson.Field
- Peers apijson.Field
- SoaSerial apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDNSIncomingNewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDNSIncomingNewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDNSIncomingUpdateResponse struct {
- ID interface{} `json:"id"`
- // How often should a secondary zone auto refresh regardless of DNS NOTIFY. Not
- // applicable for primary zones.
- AutoRefreshSeconds float64 `json:"auto_refresh_seconds"`
- // The time for a specific event.
- CheckedTime string `json:"checked_time"`
- // The time for a specific event.
- CreatedTime string `json:"created_time"`
- // The time for a specific event.
- ModifiedTime string `json:"modified_time"`
- // Zone name.
- Name string `json:"name"`
- // A list of peer tags.
- Peers []interface{} `json:"peers"`
- // The serial number of the SOA for the given zone.
- SoaSerial float64 `json:"soa_serial"`
- JSON secondaryDNSIncomingUpdateResponseJSON `json:"-"`
-}
-
-// secondaryDNSIncomingUpdateResponseJSON contains the JSON metadata for the struct
-// [SecondaryDNSIncomingUpdateResponse]
-type secondaryDNSIncomingUpdateResponseJSON struct {
- ID apijson.Field
- AutoRefreshSeconds apijson.Field
- CheckedTime apijson.Field
- CreatedTime apijson.Field
- ModifiedTime apijson.Field
- Name apijson.Field
- Peers apijson.Field
- SoaSerial apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDNSIncomingUpdateResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDNSIncomingUpdateResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDNSIncomingDeleteResponse struct {
- ID interface{} `json:"id"`
- JSON secondaryDNSIncomingDeleteResponseJSON `json:"-"`
-}
-
-// secondaryDNSIncomingDeleteResponseJSON contains the JSON metadata for the struct
-// [SecondaryDNSIncomingDeleteResponse]
-type secondaryDNSIncomingDeleteResponseJSON struct {
- ID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDNSIncomingDeleteResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDNSIncomingDeleteResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDNSIncomingGetResponse struct {
- ID interface{} `json:"id"`
- // How often should a secondary zone auto refresh regardless of DNS NOTIFY. Not
- // applicable for primary zones.
- AutoRefreshSeconds float64 `json:"auto_refresh_seconds"`
- // The time for a specific event.
- CheckedTime string `json:"checked_time"`
- // The time for a specific event.
- CreatedTime string `json:"created_time"`
- // The time for a specific event.
- ModifiedTime string `json:"modified_time"`
- // Zone name.
- Name string `json:"name"`
- // A list of peer tags.
- Peers []interface{} `json:"peers"`
- // The serial number of the SOA for the given zone.
- SoaSerial float64 `json:"soa_serial"`
- JSON secondaryDNSIncomingGetResponseJSON `json:"-"`
-}
-
-// secondaryDNSIncomingGetResponseJSON contains the JSON metadata for the struct
-// [SecondaryDNSIncomingGetResponse]
-type secondaryDNSIncomingGetResponseJSON struct {
- ID apijson.Field
- AutoRefreshSeconds apijson.Field
- CheckedTime apijson.Field
- CreatedTime apijson.Field
- ModifiedTime apijson.Field
- Name apijson.Field
- Peers apijson.Field
- SoaSerial apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDNSIncomingGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDNSIncomingGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDNSIncomingNewParams struct {
- ZoneID param.Field[interface{}] `path:"zone_id,required"`
- // How often should a secondary zone auto refresh regardless of DNS NOTIFY. Not
- // applicable for primary zones.
- AutoRefreshSeconds param.Field[float64] `json:"auto_refresh_seconds,required"`
- // Zone name.
- Name param.Field[string] `json:"name,required"`
- // A list of peer tags.
- Peers param.Field[[]interface{}] `json:"peers,required"`
-}
-
-func (r SecondaryDNSIncomingNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type SecondaryDNSIncomingNewResponseEnvelope struct {
- Errors []SecondaryDNSIncomingNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []SecondaryDNSIncomingNewResponseEnvelopeMessages `json:"messages,required"`
- Result SecondaryDNSIncomingNewResponse `json:"result,required"`
- // Whether the API call was successful
- Success SecondaryDNSIncomingNewResponseEnvelopeSuccess `json:"success,required"`
- JSON secondaryDNSIncomingNewResponseEnvelopeJSON `json:"-"`
-}
-
-// secondaryDNSIncomingNewResponseEnvelopeJSON contains the JSON metadata for the
-// struct [SecondaryDNSIncomingNewResponseEnvelope]
-type secondaryDNSIncomingNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDNSIncomingNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDNSIncomingNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDNSIncomingNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON secondaryDNSIncomingNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// secondaryDNSIncomingNewResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [SecondaryDNSIncomingNewResponseEnvelopeErrors]
-type secondaryDNSIncomingNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDNSIncomingNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDNSIncomingNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDNSIncomingNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON secondaryDNSIncomingNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// secondaryDNSIncomingNewResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [SecondaryDNSIncomingNewResponseEnvelopeMessages]
-type secondaryDNSIncomingNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDNSIncomingNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDNSIncomingNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type SecondaryDNSIncomingNewResponseEnvelopeSuccess bool
-
-const (
- SecondaryDNSIncomingNewResponseEnvelopeSuccessTrue SecondaryDNSIncomingNewResponseEnvelopeSuccess = true
-)
-
-type SecondaryDNSIncomingUpdateParams struct {
- ZoneID param.Field[interface{}] `path:"zone_id,required"`
- // How often should a secondary zone auto refresh regardless of DNS NOTIFY. Not
- // applicable for primary zones.
- AutoRefreshSeconds param.Field[float64] `json:"auto_refresh_seconds,required"`
- // Zone name.
- Name param.Field[string] `json:"name,required"`
- // A list of peer tags.
- Peers param.Field[[]interface{}] `json:"peers,required"`
-}
-
-func (r SecondaryDNSIncomingUpdateParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type SecondaryDNSIncomingUpdateResponseEnvelope struct {
- Errors []SecondaryDNSIncomingUpdateResponseEnvelopeErrors `json:"errors,required"`
- Messages []SecondaryDNSIncomingUpdateResponseEnvelopeMessages `json:"messages,required"`
- Result SecondaryDNSIncomingUpdateResponse `json:"result,required"`
- // Whether the API call was successful
- Success SecondaryDNSIncomingUpdateResponseEnvelopeSuccess `json:"success,required"`
- JSON secondaryDNSIncomingUpdateResponseEnvelopeJSON `json:"-"`
-}
-
-// secondaryDNSIncomingUpdateResponseEnvelopeJSON contains the JSON metadata for
-// the struct [SecondaryDNSIncomingUpdateResponseEnvelope]
-type secondaryDNSIncomingUpdateResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDNSIncomingUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDNSIncomingUpdateResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDNSIncomingUpdateResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON secondaryDNSIncomingUpdateResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// secondaryDNSIncomingUpdateResponseEnvelopeErrorsJSON contains the JSON metadata
-// for the struct [SecondaryDNSIncomingUpdateResponseEnvelopeErrors]
-type secondaryDNSIncomingUpdateResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDNSIncomingUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDNSIncomingUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDNSIncomingUpdateResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON secondaryDNSIncomingUpdateResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// secondaryDNSIncomingUpdateResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct [SecondaryDNSIncomingUpdateResponseEnvelopeMessages]
-type secondaryDNSIncomingUpdateResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDNSIncomingUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDNSIncomingUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type SecondaryDNSIncomingUpdateResponseEnvelopeSuccess bool
-
-const (
- SecondaryDNSIncomingUpdateResponseEnvelopeSuccessTrue SecondaryDNSIncomingUpdateResponseEnvelopeSuccess = true
-)
-
-type SecondaryDNSIncomingDeleteParams struct {
- ZoneID param.Field[interface{}] `path:"zone_id,required"`
-}
-
-type SecondaryDNSIncomingDeleteResponseEnvelope struct {
- Errors []SecondaryDNSIncomingDeleteResponseEnvelopeErrors `json:"errors,required"`
- Messages []SecondaryDNSIncomingDeleteResponseEnvelopeMessages `json:"messages,required"`
- Result SecondaryDNSIncomingDeleteResponse `json:"result,required"`
- // Whether the API call was successful
- Success SecondaryDNSIncomingDeleteResponseEnvelopeSuccess `json:"success,required"`
- JSON secondaryDNSIncomingDeleteResponseEnvelopeJSON `json:"-"`
-}
-
-// secondaryDNSIncomingDeleteResponseEnvelopeJSON contains the JSON metadata for
-// the struct [SecondaryDNSIncomingDeleteResponseEnvelope]
-type secondaryDNSIncomingDeleteResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDNSIncomingDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDNSIncomingDeleteResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDNSIncomingDeleteResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON secondaryDNSIncomingDeleteResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// secondaryDNSIncomingDeleteResponseEnvelopeErrorsJSON contains the JSON metadata
-// for the struct [SecondaryDNSIncomingDeleteResponseEnvelopeErrors]
-type secondaryDNSIncomingDeleteResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDNSIncomingDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDNSIncomingDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDNSIncomingDeleteResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON secondaryDNSIncomingDeleteResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// secondaryDNSIncomingDeleteResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct [SecondaryDNSIncomingDeleteResponseEnvelopeMessages]
-type secondaryDNSIncomingDeleteResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDNSIncomingDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDNSIncomingDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type SecondaryDNSIncomingDeleteResponseEnvelopeSuccess bool
-
-const (
- SecondaryDNSIncomingDeleteResponseEnvelopeSuccessTrue SecondaryDNSIncomingDeleteResponseEnvelopeSuccess = true
-)
-
-type SecondaryDNSIncomingGetParams struct {
- ZoneID param.Field[interface{}] `path:"zone_id,required"`
-}
-
-type SecondaryDNSIncomingGetResponseEnvelope struct {
- Errors []SecondaryDNSIncomingGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []SecondaryDNSIncomingGetResponseEnvelopeMessages `json:"messages,required"`
- Result SecondaryDNSIncomingGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success SecondaryDNSIncomingGetResponseEnvelopeSuccess `json:"success,required"`
- JSON secondaryDNSIncomingGetResponseEnvelopeJSON `json:"-"`
-}
-
-// secondaryDNSIncomingGetResponseEnvelopeJSON contains the JSON metadata for the
-// struct [SecondaryDNSIncomingGetResponseEnvelope]
-type secondaryDNSIncomingGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDNSIncomingGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDNSIncomingGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDNSIncomingGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON secondaryDNSIncomingGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// secondaryDNSIncomingGetResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [SecondaryDNSIncomingGetResponseEnvelopeErrors]
-type secondaryDNSIncomingGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDNSIncomingGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDNSIncomingGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDNSIncomingGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON secondaryDNSIncomingGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// secondaryDNSIncomingGetResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [SecondaryDNSIncomingGetResponseEnvelopeMessages]
-type secondaryDNSIncomingGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDNSIncomingGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDNSIncomingGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type SecondaryDNSIncomingGetResponseEnvelopeSuccess bool
-
-const (
- SecondaryDNSIncomingGetResponseEnvelopeSuccessTrue SecondaryDNSIncomingGetResponseEnvelopeSuccess = true
-)
diff --git a/secondarydnsincoming_test.go b/secondarydnsincoming_test.go
deleted file mode 100644
index 154a89376c6..00000000000
--- a/secondarydnsincoming_test.go
+++ /dev/null
@@ -1,124 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestSecondaryDNSIncomingNew(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"),
- )
- _, err := client.SecondaryDNS.Incoming.New(context.TODO(), cloudflare.SecondaryDNSIncomingNewParams{
- ZoneID: cloudflare.F[any]("269d8f4853475ca241c4e730be286b20"),
- AutoRefreshSeconds: cloudflare.F(86400.000000),
- Name: cloudflare.F("www.example.com."),
- Peers: cloudflare.F([]interface{}{"23ff594956f20c2a721606e94745a8aa", "00920f38ce07c2e2f4df50b1f61d4194"}),
- })
- 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())
- }
-}
-
-func TestSecondaryDNSIncomingUpdate(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"),
- )
- _, err := client.SecondaryDNS.Incoming.Update(context.TODO(), cloudflare.SecondaryDNSIncomingUpdateParams{
- ZoneID: cloudflare.F[any]("269d8f4853475ca241c4e730be286b20"),
- AutoRefreshSeconds: cloudflare.F(86400.000000),
- Name: cloudflare.F("www.example.com."),
- Peers: cloudflare.F([]interface{}{"23ff594956f20c2a721606e94745a8aa", "00920f38ce07c2e2f4df50b1f61d4194"}),
- })
- 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())
- }
-}
-
-func TestSecondaryDNSIncomingDelete(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"),
- )
- _, err := client.SecondaryDNS.Incoming.Delete(context.TODO(), cloudflare.SecondaryDNSIncomingDeleteParams{
- ZoneID: cloudflare.F[any]("269d8f4853475ca241c4e730be286b20"),
- })
- 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())
- }
-}
-
-func TestSecondaryDNSIncomingGet(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"),
- )
- _, err := client.SecondaryDNS.Incoming.Get(context.TODO(), cloudflare.SecondaryDNSIncomingGetParams{
- ZoneID: cloudflare.F[any]("269d8f4853475ca241c4e730be286b20"),
- })
- 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/secondarydnsoutgoing.go b/secondarydnsoutgoing.go
deleted file mode 100644
index e21f7a6628a..00000000000
--- a/secondarydnsoutgoing.go
+++ /dev/null
@@ -1,880 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// SecondaryDNSOutgoingService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewSecondaryDNSOutgoingService]
-// method instead.
-type SecondaryDNSOutgoingService struct {
- Options []option.RequestOption
- Status *SecondaryDNSOutgoingStatusService
-}
-
-// NewSecondaryDNSOutgoingService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewSecondaryDNSOutgoingService(opts ...option.RequestOption) (r *SecondaryDNSOutgoingService) {
- r = &SecondaryDNSOutgoingService{}
- r.Options = opts
- r.Status = NewSecondaryDNSOutgoingStatusService(opts...)
- return
-}
-
-// Create primary zone configuration for outgoing zone transfers.
-func (r *SecondaryDNSOutgoingService) New(ctx context.Context, params SecondaryDNSOutgoingNewParams, opts ...option.RequestOption) (res *SecondaryDNSOutgoingNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env SecondaryDNSOutgoingNewResponseEnvelope
- path := fmt.Sprintf("zones/%v/secondary_dns/outgoing", params.ZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Update primary zone configuration for outgoing zone transfers.
-func (r *SecondaryDNSOutgoingService) Update(ctx context.Context, params SecondaryDNSOutgoingUpdateParams, opts ...option.RequestOption) (res *SecondaryDNSOutgoingUpdateResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env SecondaryDNSOutgoingUpdateResponseEnvelope
- path := fmt.Sprintf("zones/%v/secondary_dns/outgoing", params.ZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Delete primary zone configuration for outgoing zone transfers.
-func (r *SecondaryDNSOutgoingService) Delete(ctx context.Context, body SecondaryDNSOutgoingDeleteParams, opts ...option.RequestOption) (res *SecondaryDNSOutgoingDeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env SecondaryDNSOutgoingDeleteResponseEnvelope
- path := fmt.Sprintf("zones/%v/secondary_dns/outgoing", body.ZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Disable outgoing zone transfers for primary zone and clears IXFR backlog of
-// primary zone.
-func (r *SecondaryDNSOutgoingService) Disable(ctx context.Context, body SecondaryDNSOutgoingDisableParams, opts ...option.RequestOption) (res *string, err error) {
- opts = append(r.Options[:], opts...)
- var env SecondaryDNSOutgoingDisableResponseEnvelope
- path := fmt.Sprintf("zones/%v/secondary_dns/outgoing/disable", body.ZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Enable outgoing zone transfers for primary zone.
-func (r *SecondaryDNSOutgoingService) Enable(ctx context.Context, body SecondaryDNSOutgoingEnableParams, opts ...option.RequestOption) (res *string, err error) {
- opts = append(r.Options[:], opts...)
- var env SecondaryDNSOutgoingEnableResponseEnvelope
- path := fmt.Sprintf("zones/%v/secondary_dns/outgoing/enable", body.ZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Notifies the secondary nameserver(s) and clears IXFR backlog of primary zone.
-func (r *SecondaryDNSOutgoingService) ForceNotify(ctx context.Context, body SecondaryDNSOutgoingForceNotifyParams, opts ...option.RequestOption) (res *string, err error) {
- opts = append(r.Options[:], opts...)
- var env SecondaryDNSOutgoingForceNotifyResponseEnvelope
- path := fmt.Sprintf("zones/%v/secondary_dns/outgoing/force_notify", body.ZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Get primary zone configuration for outgoing zone transfers.
-func (r *SecondaryDNSOutgoingService) Get(ctx context.Context, query SecondaryDNSOutgoingGetParams, opts ...option.RequestOption) (res *SecondaryDNSOutgoingGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env SecondaryDNSOutgoingGetResponseEnvelope
- path := fmt.Sprintf("zones/%v/secondary_dns/outgoing", query.ZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type SecondaryDNSOutgoingNewResponse struct {
- ID interface{} `json:"id"`
- // The time for a specific event.
- CheckedTime string `json:"checked_time"`
- // The time for a specific event.
- CreatedTime string `json:"created_time"`
- // The time for a specific event.
- LastTransferredTime string `json:"last_transferred_time"`
- // Zone name.
- Name string `json:"name"`
- // A list of peer tags.
- Peers []interface{} `json:"peers"`
- // The serial number of the SOA for the given zone.
- SoaSerial float64 `json:"soa_serial"`
- JSON secondaryDNSOutgoingNewResponseJSON `json:"-"`
-}
-
-// secondaryDNSOutgoingNewResponseJSON contains the JSON metadata for the struct
-// [SecondaryDNSOutgoingNewResponse]
-type secondaryDNSOutgoingNewResponseJSON struct {
- ID apijson.Field
- CheckedTime apijson.Field
- CreatedTime apijson.Field
- LastTransferredTime apijson.Field
- Name apijson.Field
- Peers apijson.Field
- SoaSerial apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDNSOutgoingNewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDNSOutgoingNewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDNSOutgoingUpdateResponse struct {
- ID interface{} `json:"id"`
- // The time for a specific event.
- CheckedTime string `json:"checked_time"`
- // The time for a specific event.
- CreatedTime string `json:"created_time"`
- // The time for a specific event.
- LastTransferredTime string `json:"last_transferred_time"`
- // Zone name.
- Name string `json:"name"`
- // A list of peer tags.
- Peers []interface{} `json:"peers"`
- // The serial number of the SOA for the given zone.
- SoaSerial float64 `json:"soa_serial"`
- JSON secondaryDNSOutgoingUpdateResponseJSON `json:"-"`
-}
-
-// secondaryDNSOutgoingUpdateResponseJSON contains the JSON metadata for the struct
-// [SecondaryDNSOutgoingUpdateResponse]
-type secondaryDNSOutgoingUpdateResponseJSON struct {
- ID apijson.Field
- CheckedTime apijson.Field
- CreatedTime apijson.Field
- LastTransferredTime apijson.Field
- Name apijson.Field
- Peers apijson.Field
- SoaSerial apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDNSOutgoingUpdateResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDNSOutgoingUpdateResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDNSOutgoingDeleteResponse struct {
- ID interface{} `json:"id"`
- JSON secondaryDNSOutgoingDeleteResponseJSON `json:"-"`
-}
-
-// secondaryDNSOutgoingDeleteResponseJSON contains the JSON metadata for the struct
-// [SecondaryDNSOutgoingDeleteResponse]
-type secondaryDNSOutgoingDeleteResponseJSON struct {
- ID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDNSOutgoingDeleteResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDNSOutgoingDeleteResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDNSOutgoingGetResponse struct {
- ID interface{} `json:"id"`
- // The time for a specific event.
- CheckedTime string `json:"checked_time"`
- // The time for a specific event.
- CreatedTime string `json:"created_time"`
- // The time for a specific event.
- LastTransferredTime string `json:"last_transferred_time"`
- // Zone name.
- Name string `json:"name"`
- // A list of peer tags.
- Peers []interface{} `json:"peers"`
- // The serial number of the SOA for the given zone.
- SoaSerial float64 `json:"soa_serial"`
- JSON secondaryDNSOutgoingGetResponseJSON `json:"-"`
-}
-
-// secondaryDNSOutgoingGetResponseJSON contains the JSON metadata for the struct
-// [SecondaryDNSOutgoingGetResponse]
-type secondaryDNSOutgoingGetResponseJSON struct {
- ID apijson.Field
- CheckedTime apijson.Field
- CreatedTime apijson.Field
- LastTransferredTime apijson.Field
- Name apijson.Field
- Peers apijson.Field
- SoaSerial apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDNSOutgoingGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDNSOutgoingGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDNSOutgoingNewParams struct {
- ZoneID param.Field[interface{}] `path:"zone_id,required"`
- // Zone name.
- Name param.Field[string] `json:"name,required"`
- // A list of peer tags.
- Peers param.Field[[]interface{}] `json:"peers,required"`
-}
-
-func (r SecondaryDNSOutgoingNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type SecondaryDNSOutgoingNewResponseEnvelope struct {
- Errors []SecondaryDNSOutgoingNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []SecondaryDNSOutgoingNewResponseEnvelopeMessages `json:"messages,required"`
- Result SecondaryDNSOutgoingNewResponse `json:"result,required"`
- // Whether the API call was successful
- Success SecondaryDNSOutgoingNewResponseEnvelopeSuccess `json:"success,required"`
- JSON secondaryDNSOutgoingNewResponseEnvelopeJSON `json:"-"`
-}
-
-// secondaryDNSOutgoingNewResponseEnvelopeJSON contains the JSON metadata for the
-// struct [SecondaryDNSOutgoingNewResponseEnvelope]
-type secondaryDNSOutgoingNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDNSOutgoingNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDNSOutgoingNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDNSOutgoingNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON secondaryDNSOutgoingNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// secondaryDNSOutgoingNewResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [SecondaryDNSOutgoingNewResponseEnvelopeErrors]
-type secondaryDNSOutgoingNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDNSOutgoingNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDNSOutgoingNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDNSOutgoingNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON secondaryDNSOutgoingNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// secondaryDNSOutgoingNewResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [SecondaryDNSOutgoingNewResponseEnvelopeMessages]
-type secondaryDNSOutgoingNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDNSOutgoingNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDNSOutgoingNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type SecondaryDNSOutgoingNewResponseEnvelopeSuccess bool
-
-const (
- SecondaryDNSOutgoingNewResponseEnvelopeSuccessTrue SecondaryDNSOutgoingNewResponseEnvelopeSuccess = true
-)
-
-type SecondaryDNSOutgoingUpdateParams struct {
- ZoneID param.Field[interface{}] `path:"zone_id,required"`
- // Zone name.
- Name param.Field[string] `json:"name,required"`
- // A list of peer tags.
- Peers param.Field[[]interface{}] `json:"peers,required"`
-}
-
-func (r SecondaryDNSOutgoingUpdateParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type SecondaryDNSOutgoingUpdateResponseEnvelope struct {
- Errors []SecondaryDNSOutgoingUpdateResponseEnvelopeErrors `json:"errors,required"`
- Messages []SecondaryDNSOutgoingUpdateResponseEnvelopeMessages `json:"messages,required"`
- Result SecondaryDNSOutgoingUpdateResponse `json:"result,required"`
- // Whether the API call was successful
- Success SecondaryDNSOutgoingUpdateResponseEnvelopeSuccess `json:"success,required"`
- JSON secondaryDNSOutgoingUpdateResponseEnvelopeJSON `json:"-"`
-}
-
-// secondaryDNSOutgoingUpdateResponseEnvelopeJSON contains the JSON metadata for
-// the struct [SecondaryDNSOutgoingUpdateResponseEnvelope]
-type secondaryDNSOutgoingUpdateResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDNSOutgoingUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDNSOutgoingUpdateResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDNSOutgoingUpdateResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON secondaryDNSOutgoingUpdateResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// secondaryDNSOutgoingUpdateResponseEnvelopeErrorsJSON contains the JSON metadata
-// for the struct [SecondaryDNSOutgoingUpdateResponseEnvelopeErrors]
-type secondaryDNSOutgoingUpdateResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDNSOutgoingUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDNSOutgoingUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDNSOutgoingUpdateResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON secondaryDNSOutgoingUpdateResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// secondaryDNSOutgoingUpdateResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct [SecondaryDNSOutgoingUpdateResponseEnvelopeMessages]
-type secondaryDNSOutgoingUpdateResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDNSOutgoingUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDNSOutgoingUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type SecondaryDNSOutgoingUpdateResponseEnvelopeSuccess bool
-
-const (
- SecondaryDNSOutgoingUpdateResponseEnvelopeSuccessTrue SecondaryDNSOutgoingUpdateResponseEnvelopeSuccess = true
-)
-
-type SecondaryDNSOutgoingDeleteParams struct {
- ZoneID param.Field[interface{}] `path:"zone_id,required"`
-}
-
-type SecondaryDNSOutgoingDeleteResponseEnvelope struct {
- Errors []SecondaryDNSOutgoingDeleteResponseEnvelopeErrors `json:"errors,required"`
- Messages []SecondaryDNSOutgoingDeleteResponseEnvelopeMessages `json:"messages,required"`
- Result SecondaryDNSOutgoingDeleteResponse `json:"result,required"`
- // Whether the API call was successful
- Success SecondaryDNSOutgoingDeleteResponseEnvelopeSuccess `json:"success,required"`
- JSON secondaryDNSOutgoingDeleteResponseEnvelopeJSON `json:"-"`
-}
-
-// secondaryDNSOutgoingDeleteResponseEnvelopeJSON contains the JSON metadata for
-// the struct [SecondaryDNSOutgoingDeleteResponseEnvelope]
-type secondaryDNSOutgoingDeleteResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDNSOutgoingDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDNSOutgoingDeleteResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDNSOutgoingDeleteResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON secondaryDNSOutgoingDeleteResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// secondaryDNSOutgoingDeleteResponseEnvelopeErrorsJSON contains the JSON metadata
-// for the struct [SecondaryDNSOutgoingDeleteResponseEnvelopeErrors]
-type secondaryDNSOutgoingDeleteResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDNSOutgoingDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDNSOutgoingDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDNSOutgoingDeleteResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON secondaryDNSOutgoingDeleteResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// secondaryDNSOutgoingDeleteResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct [SecondaryDNSOutgoingDeleteResponseEnvelopeMessages]
-type secondaryDNSOutgoingDeleteResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDNSOutgoingDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDNSOutgoingDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type SecondaryDNSOutgoingDeleteResponseEnvelopeSuccess bool
-
-const (
- SecondaryDNSOutgoingDeleteResponseEnvelopeSuccessTrue SecondaryDNSOutgoingDeleteResponseEnvelopeSuccess = true
-)
-
-type SecondaryDNSOutgoingDisableParams struct {
- ZoneID param.Field[interface{}] `path:"zone_id,required"`
-}
-
-type SecondaryDNSOutgoingDisableResponseEnvelope struct {
- Errors []SecondaryDNSOutgoingDisableResponseEnvelopeErrors `json:"errors,required"`
- Messages []SecondaryDNSOutgoingDisableResponseEnvelopeMessages `json:"messages,required"`
- // The zone transfer status of a primary zone
- Result string `json:"result,required"`
- // Whether the API call was successful
- Success SecondaryDNSOutgoingDisableResponseEnvelopeSuccess `json:"success,required"`
- JSON secondaryDNSOutgoingDisableResponseEnvelopeJSON `json:"-"`
-}
-
-// secondaryDNSOutgoingDisableResponseEnvelopeJSON contains the JSON metadata for
-// the struct [SecondaryDNSOutgoingDisableResponseEnvelope]
-type secondaryDNSOutgoingDisableResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDNSOutgoingDisableResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDNSOutgoingDisableResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDNSOutgoingDisableResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON secondaryDNSOutgoingDisableResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// secondaryDNSOutgoingDisableResponseEnvelopeErrorsJSON contains the JSON metadata
-// for the struct [SecondaryDNSOutgoingDisableResponseEnvelopeErrors]
-type secondaryDNSOutgoingDisableResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDNSOutgoingDisableResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDNSOutgoingDisableResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDNSOutgoingDisableResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON secondaryDNSOutgoingDisableResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// secondaryDNSOutgoingDisableResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct [SecondaryDNSOutgoingDisableResponseEnvelopeMessages]
-type secondaryDNSOutgoingDisableResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDNSOutgoingDisableResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDNSOutgoingDisableResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type SecondaryDNSOutgoingDisableResponseEnvelopeSuccess bool
-
-const (
- SecondaryDNSOutgoingDisableResponseEnvelopeSuccessTrue SecondaryDNSOutgoingDisableResponseEnvelopeSuccess = true
-)
-
-type SecondaryDNSOutgoingEnableParams struct {
- ZoneID param.Field[interface{}] `path:"zone_id,required"`
-}
-
-type SecondaryDNSOutgoingEnableResponseEnvelope struct {
- Errors []SecondaryDNSOutgoingEnableResponseEnvelopeErrors `json:"errors,required"`
- Messages []SecondaryDNSOutgoingEnableResponseEnvelopeMessages `json:"messages,required"`
- // The zone transfer status of a primary zone
- Result string `json:"result,required"`
- // Whether the API call was successful
- Success SecondaryDNSOutgoingEnableResponseEnvelopeSuccess `json:"success,required"`
- JSON secondaryDNSOutgoingEnableResponseEnvelopeJSON `json:"-"`
-}
-
-// secondaryDNSOutgoingEnableResponseEnvelopeJSON contains the JSON metadata for
-// the struct [SecondaryDNSOutgoingEnableResponseEnvelope]
-type secondaryDNSOutgoingEnableResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDNSOutgoingEnableResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDNSOutgoingEnableResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDNSOutgoingEnableResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON secondaryDNSOutgoingEnableResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// secondaryDNSOutgoingEnableResponseEnvelopeErrorsJSON contains the JSON metadata
-// for the struct [SecondaryDNSOutgoingEnableResponseEnvelopeErrors]
-type secondaryDNSOutgoingEnableResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDNSOutgoingEnableResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDNSOutgoingEnableResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDNSOutgoingEnableResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON secondaryDNSOutgoingEnableResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// secondaryDNSOutgoingEnableResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct [SecondaryDNSOutgoingEnableResponseEnvelopeMessages]
-type secondaryDNSOutgoingEnableResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDNSOutgoingEnableResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDNSOutgoingEnableResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type SecondaryDNSOutgoingEnableResponseEnvelopeSuccess bool
-
-const (
- SecondaryDNSOutgoingEnableResponseEnvelopeSuccessTrue SecondaryDNSOutgoingEnableResponseEnvelopeSuccess = true
-)
-
-type SecondaryDNSOutgoingForceNotifyParams struct {
- ZoneID param.Field[interface{}] `path:"zone_id,required"`
-}
-
-type SecondaryDNSOutgoingForceNotifyResponseEnvelope struct {
- Errors []SecondaryDNSOutgoingForceNotifyResponseEnvelopeErrors `json:"errors,required"`
- Messages []SecondaryDNSOutgoingForceNotifyResponseEnvelopeMessages `json:"messages,required"`
- // When force_notify query parameter is set to true, the response is a simple
- // string
- Result string `json:"result,required"`
- // Whether the API call was successful
- Success SecondaryDNSOutgoingForceNotifyResponseEnvelopeSuccess `json:"success,required"`
- JSON secondaryDNSOutgoingForceNotifyResponseEnvelopeJSON `json:"-"`
-}
-
-// secondaryDNSOutgoingForceNotifyResponseEnvelopeJSON contains the JSON metadata
-// for the struct [SecondaryDNSOutgoingForceNotifyResponseEnvelope]
-type secondaryDNSOutgoingForceNotifyResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDNSOutgoingForceNotifyResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDNSOutgoingForceNotifyResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDNSOutgoingForceNotifyResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON secondaryDNSOutgoingForceNotifyResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// secondaryDNSOutgoingForceNotifyResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct [SecondaryDNSOutgoingForceNotifyResponseEnvelopeErrors]
-type secondaryDNSOutgoingForceNotifyResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDNSOutgoingForceNotifyResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDNSOutgoingForceNotifyResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDNSOutgoingForceNotifyResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON secondaryDNSOutgoingForceNotifyResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// secondaryDNSOutgoingForceNotifyResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct
-// [SecondaryDNSOutgoingForceNotifyResponseEnvelopeMessages]
-type secondaryDNSOutgoingForceNotifyResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDNSOutgoingForceNotifyResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDNSOutgoingForceNotifyResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type SecondaryDNSOutgoingForceNotifyResponseEnvelopeSuccess bool
-
-const (
- SecondaryDNSOutgoingForceNotifyResponseEnvelopeSuccessTrue SecondaryDNSOutgoingForceNotifyResponseEnvelopeSuccess = true
-)
-
-type SecondaryDNSOutgoingGetParams struct {
- ZoneID param.Field[interface{}] `path:"zone_id,required"`
-}
-
-type SecondaryDNSOutgoingGetResponseEnvelope struct {
- Errors []SecondaryDNSOutgoingGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []SecondaryDNSOutgoingGetResponseEnvelopeMessages `json:"messages,required"`
- Result SecondaryDNSOutgoingGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success SecondaryDNSOutgoingGetResponseEnvelopeSuccess `json:"success,required"`
- JSON secondaryDNSOutgoingGetResponseEnvelopeJSON `json:"-"`
-}
-
-// secondaryDNSOutgoingGetResponseEnvelopeJSON contains the JSON metadata for the
-// struct [SecondaryDNSOutgoingGetResponseEnvelope]
-type secondaryDNSOutgoingGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDNSOutgoingGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDNSOutgoingGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDNSOutgoingGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON secondaryDNSOutgoingGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// secondaryDNSOutgoingGetResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [SecondaryDNSOutgoingGetResponseEnvelopeErrors]
-type secondaryDNSOutgoingGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDNSOutgoingGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDNSOutgoingGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDNSOutgoingGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON secondaryDNSOutgoingGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// secondaryDNSOutgoingGetResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [SecondaryDNSOutgoingGetResponseEnvelopeMessages]
-type secondaryDNSOutgoingGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDNSOutgoingGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDNSOutgoingGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type SecondaryDNSOutgoingGetResponseEnvelopeSuccess bool
-
-const (
- SecondaryDNSOutgoingGetResponseEnvelopeSuccessTrue SecondaryDNSOutgoingGetResponseEnvelopeSuccess = true
-)
diff --git a/secondarydnsoutgoing_test.go b/secondarydnsoutgoing_test.go
deleted file mode 100644
index 726aa121a33..00000000000
--- a/secondarydnsoutgoing_test.go
+++ /dev/null
@@ -1,200 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestSecondaryDNSOutgoingNew(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"),
- )
- _, err := client.SecondaryDNS.Outgoing.New(context.TODO(), cloudflare.SecondaryDNSOutgoingNewParams{
- ZoneID: cloudflare.F[any]("269d8f4853475ca241c4e730be286b20"),
- Name: cloudflare.F("www.example.com."),
- Peers: cloudflare.F([]interface{}{"23ff594956f20c2a721606e94745a8aa", "00920f38ce07c2e2f4df50b1f61d4194"}),
- })
- 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())
- }
-}
-
-func TestSecondaryDNSOutgoingUpdate(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"),
- )
- _, err := client.SecondaryDNS.Outgoing.Update(context.TODO(), cloudflare.SecondaryDNSOutgoingUpdateParams{
- ZoneID: cloudflare.F[any]("269d8f4853475ca241c4e730be286b20"),
- Name: cloudflare.F("www.example.com."),
- Peers: cloudflare.F([]interface{}{"23ff594956f20c2a721606e94745a8aa", "00920f38ce07c2e2f4df50b1f61d4194"}),
- })
- 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())
- }
-}
-
-func TestSecondaryDNSOutgoingDelete(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"),
- )
- _, err := client.SecondaryDNS.Outgoing.Delete(context.TODO(), cloudflare.SecondaryDNSOutgoingDeleteParams{
- ZoneID: cloudflare.F[any]("269d8f4853475ca241c4e730be286b20"),
- })
- 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())
- }
-}
-
-func TestSecondaryDNSOutgoingDisable(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"),
- )
- _, err := client.SecondaryDNS.Outgoing.Disable(context.TODO(), cloudflare.SecondaryDNSOutgoingDisableParams{
- ZoneID: cloudflare.F[any]("269d8f4853475ca241c4e730be286b20"),
- })
- 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())
- }
-}
-
-func TestSecondaryDNSOutgoingEnable(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"),
- )
- _, err := client.SecondaryDNS.Outgoing.Enable(context.TODO(), cloudflare.SecondaryDNSOutgoingEnableParams{
- ZoneID: cloudflare.F[any]("269d8f4853475ca241c4e730be286b20"),
- })
- 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())
- }
-}
-
-func TestSecondaryDNSOutgoingForceNotify(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"),
- )
- _, err := client.SecondaryDNS.Outgoing.ForceNotify(context.TODO(), cloudflare.SecondaryDNSOutgoingForceNotifyParams{
- ZoneID: cloudflare.F[any]("269d8f4853475ca241c4e730be286b20"),
- })
- 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())
- }
-}
-
-func TestSecondaryDNSOutgoingGet(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"),
- )
- _, err := client.SecondaryDNS.Outgoing.Get(context.TODO(), cloudflare.SecondaryDNSOutgoingGetParams{
- ZoneID: cloudflare.F[any]("269d8f4853475ca241c4e730be286b20"),
- })
- 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/secondarydnsoutgoingstatus.go b/secondarydnsoutgoingstatus.go
deleted file mode 100644
index fad0d6624a7..00000000000
--- a/secondarydnsoutgoingstatus.go
+++ /dev/null
@@ -1,131 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// SecondaryDNSOutgoingStatusService contains methods and other services that help
-// with interacting with the cloudflare API. Note, unlike clients, this service
-// does not read variables from the environment automatically. You should not
-// instantiate this service directly, and instead use the
-// [NewSecondaryDNSOutgoingStatusService] method instead.
-type SecondaryDNSOutgoingStatusService struct {
- Options []option.RequestOption
-}
-
-// NewSecondaryDNSOutgoingStatusService generates a new service that applies the
-// given options to each request. These options are applied after the parent
-// client's options (if there is one), and before any request-specific options.
-func NewSecondaryDNSOutgoingStatusService(opts ...option.RequestOption) (r *SecondaryDNSOutgoingStatusService) {
- r = &SecondaryDNSOutgoingStatusService{}
- r.Options = opts
- return
-}
-
-// Get primary zone transfer status.
-func (r *SecondaryDNSOutgoingStatusService) Get(ctx context.Context, query SecondaryDNSOutgoingStatusGetParams, opts ...option.RequestOption) (res *string, err error) {
- opts = append(r.Options[:], opts...)
- var env SecondaryDNSOutgoingStatusGetResponseEnvelope
- path := fmt.Sprintf("zones/%v/secondary_dns/outgoing/status", query.ZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type SecondaryDNSOutgoingStatusGetParams struct {
- ZoneID param.Field[interface{}] `path:"zone_id,required"`
-}
-
-type SecondaryDNSOutgoingStatusGetResponseEnvelope struct {
- Errors []SecondaryDNSOutgoingStatusGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []SecondaryDNSOutgoingStatusGetResponseEnvelopeMessages `json:"messages,required"`
- // The zone transfer status of a primary zone
- Result string `json:"result,required"`
- // Whether the API call was successful
- Success SecondaryDNSOutgoingStatusGetResponseEnvelopeSuccess `json:"success,required"`
- JSON secondaryDNSOutgoingStatusGetResponseEnvelopeJSON `json:"-"`
-}
-
-// secondaryDNSOutgoingStatusGetResponseEnvelopeJSON contains the JSON metadata for
-// the struct [SecondaryDNSOutgoingStatusGetResponseEnvelope]
-type secondaryDNSOutgoingStatusGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDNSOutgoingStatusGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDNSOutgoingStatusGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDNSOutgoingStatusGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON secondaryDNSOutgoingStatusGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// secondaryDNSOutgoingStatusGetResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct [SecondaryDNSOutgoingStatusGetResponseEnvelopeErrors]
-type secondaryDNSOutgoingStatusGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDNSOutgoingStatusGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDNSOutgoingStatusGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDNSOutgoingStatusGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON secondaryDNSOutgoingStatusGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// secondaryDNSOutgoingStatusGetResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct [SecondaryDNSOutgoingStatusGetResponseEnvelopeMessages]
-type secondaryDNSOutgoingStatusGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDNSOutgoingStatusGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDNSOutgoingStatusGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type SecondaryDNSOutgoingStatusGetResponseEnvelopeSuccess bool
-
-const (
- SecondaryDNSOutgoingStatusGetResponseEnvelopeSuccessTrue SecondaryDNSOutgoingStatusGetResponseEnvelopeSuccess = true
-)
diff --git a/secondarydnsoutgoingstatus_test.go b/secondarydnsoutgoingstatus_test.go
deleted file mode 100644
index 0a115ff8d3e..00000000000
--- a/secondarydnsoutgoingstatus_test.go
+++ /dev/null
@@ -1,40 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestSecondaryDNSOutgoingStatusGet(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"),
- )
- _, err := client.SecondaryDNS.Outgoing.Status.Get(context.TODO(), cloudflare.SecondaryDNSOutgoingStatusGetParams{
- ZoneID: cloudflare.F[any]("269d8f4853475ca241c4e730be286b20"),
- })
- 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/secondarydnspeer.go b/secondarydnspeer.go
deleted file mode 100644
index ada4f3dac10..00000000000
--- a/secondarydnspeer.go
+++ /dev/null
@@ -1,769 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// SecondaryDNSPeerService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewSecondaryDNSPeerService] method
-// instead.
-type SecondaryDNSPeerService struct {
- Options []option.RequestOption
-}
-
-// NewSecondaryDNSPeerService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewSecondaryDNSPeerService(opts ...option.RequestOption) (r *SecondaryDNSPeerService) {
- r = &SecondaryDNSPeerService{}
- r.Options = opts
- return
-}
-
-// Create Peer.
-func (r *SecondaryDNSPeerService) New(ctx context.Context, params SecondaryDNSPeerNewParams, opts ...option.RequestOption) (res *SecondaryDNSPeerNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env SecondaryDNSPeerNewResponseEnvelope
- path := fmt.Sprintf("accounts/%v/secondary_dns/peers", params.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Modify Peer.
-func (r *SecondaryDNSPeerService) Update(ctx context.Context, peerID interface{}, params SecondaryDNSPeerUpdateParams, opts ...option.RequestOption) (res *SecondaryDNSPeerUpdateResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env SecondaryDNSPeerUpdateResponseEnvelope
- path := fmt.Sprintf("accounts/%v/secondary_dns/peers/%v", params.AccountID, peerID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// List Peers.
-func (r *SecondaryDNSPeerService) List(ctx context.Context, query SecondaryDNSPeerListParams, opts ...option.RequestOption) (res *[]SecondaryDNSPeerListResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env SecondaryDNSPeerListResponseEnvelope
- path := fmt.Sprintf("accounts/%v/secondary_dns/peers", query.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Delete Peer.
-func (r *SecondaryDNSPeerService) Delete(ctx context.Context, peerID interface{}, body SecondaryDNSPeerDeleteParams, opts ...option.RequestOption) (res *SecondaryDNSPeerDeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env SecondaryDNSPeerDeleteResponseEnvelope
- path := fmt.Sprintf("accounts/%v/secondary_dns/peers/%v", body.AccountID, peerID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Get Peer.
-func (r *SecondaryDNSPeerService) Get(ctx context.Context, peerID interface{}, query SecondaryDNSPeerGetParams, opts ...option.RequestOption) (res *SecondaryDNSPeerGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env SecondaryDNSPeerGetResponseEnvelope
- path := fmt.Sprintf("accounts/%v/secondary_dns/peers/%v", query.AccountID, peerID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type SecondaryDNSPeerNewResponse struct {
- ID interface{} `json:"id,required"`
- // The name of the peer.
- Name string `json:"name,required"`
- // IPv4/IPv6 address of primary or secondary nameserver, depending on what zone
- // this peer is linked to. For primary zones this IP defines the IP of the
- // secondary nameserver Cloudflare will NOTIFY upon zone changes. For secondary
- // zones this IP defines the IP of the primary nameserver Cloudflare will send
- // AXFR/IXFR requests to.
- IP string `json:"ip"`
- // Enable IXFR transfer protocol, default is AXFR. Only applicable to secondary
- // zones.
- IxfrEnable bool `json:"ixfr_enable"`
- // DNS port of primary or secondary nameserver, depending on what zone this peer is
- // linked to.
- Port float64 `json:"port"`
- // TSIG authentication will be used for zone transfer if configured.
- TSIGID string `json:"tsig_id"`
- JSON secondaryDNSPeerNewResponseJSON `json:"-"`
-}
-
-// secondaryDNSPeerNewResponseJSON contains the JSON metadata for the struct
-// [SecondaryDNSPeerNewResponse]
-type secondaryDNSPeerNewResponseJSON struct {
- ID apijson.Field
- Name apijson.Field
- IP apijson.Field
- IxfrEnable apijson.Field
- Port apijson.Field
- TSIGID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDNSPeerNewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDNSPeerNewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDNSPeerUpdateResponse struct {
- ID interface{} `json:"id,required"`
- // The name of the peer.
- Name string `json:"name,required"`
- // IPv4/IPv6 address of primary or secondary nameserver, depending on what zone
- // this peer is linked to. For primary zones this IP defines the IP of the
- // secondary nameserver Cloudflare will NOTIFY upon zone changes. For secondary
- // zones this IP defines the IP of the primary nameserver Cloudflare will send
- // AXFR/IXFR requests to.
- IP string `json:"ip"`
- // Enable IXFR transfer protocol, default is AXFR. Only applicable to secondary
- // zones.
- IxfrEnable bool `json:"ixfr_enable"`
- // DNS port of primary or secondary nameserver, depending on what zone this peer is
- // linked to.
- Port float64 `json:"port"`
- // TSIG authentication will be used for zone transfer if configured.
- TSIGID string `json:"tsig_id"`
- JSON secondaryDNSPeerUpdateResponseJSON `json:"-"`
-}
-
-// secondaryDNSPeerUpdateResponseJSON contains the JSON metadata for the struct
-// [SecondaryDNSPeerUpdateResponse]
-type secondaryDNSPeerUpdateResponseJSON struct {
- ID apijson.Field
- Name apijson.Field
- IP apijson.Field
- IxfrEnable apijson.Field
- Port apijson.Field
- TSIGID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDNSPeerUpdateResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDNSPeerUpdateResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDNSPeerListResponse struct {
- ID interface{} `json:"id,required"`
- // The name of the peer.
- Name string `json:"name,required"`
- // IPv4/IPv6 address of primary or secondary nameserver, depending on what zone
- // this peer is linked to. For primary zones this IP defines the IP of the
- // secondary nameserver Cloudflare will NOTIFY upon zone changes. For secondary
- // zones this IP defines the IP of the primary nameserver Cloudflare will send
- // AXFR/IXFR requests to.
- IP string `json:"ip"`
- // Enable IXFR transfer protocol, default is AXFR. Only applicable to secondary
- // zones.
- IxfrEnable bool `json:"ixfr_enable"`
- // DNS port of primary or secondary nameserver, depending on what zone this peer is
- // linked to.
- Port float64 `json:"port"`
- // TSIG authentication will be used for zone transfer if configured.
- TSIGID string `json:"tsig_id"`
- JSON secondaryDNSPeerListResponseJSON `json:"-"`
-}
-
-// secondaryDNSPeerListResponseJSON contains the JSON metadata for the struct
-// [SecondaryDNSPeerListResponse]
-type secondaryDNSPeerListResponseJSON struct {
- ID apijson.Field
- Name apijson.Field
- IP apijson.Field
- IxfrEnable apijson.Field
- Port apijson.Field
- TSIGID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDNSPeerListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDNSPeerListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDNSPeerDeleteResponse struct {
- ID interface{} `json:"id"`
- JSON secondaryDNSPeerDeleteResponseJSON `json:"-"`
-}
-
-// secondaryDNSPeerDeleteResponseJSON contains the JSON metadata for the struct
-// [SecondaryDNSPeerDeleteResponse]
-type secondaryDNSPeerDeleteResponseJSON struct {
- ID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDNSPeerDeleteResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDNSPeerDeleteResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDNSPeerGetResponse struct {
- ID interface{} `json:"id,required"`
- // The name of the peer.
- Name string `json:"name,required"`
- // IPv4/IPv6 address of primary or secondary nameserver, depending on what zone
- // this peer is linked to. For primary zones this IP defines the IP of the
- // secondary nameserver Cloudflare will NOTIFY upon zone changes. For secondary
- // zones this IP defines the IP of the primary nameserver Cloudflare will send
- // AXFR/IXFR requests to.
- IP string `json:"ip"`
- // Enable IXFR transfer protocol, default is AXFR. Only applicable to secondary
- // zones.
- IxfrEnable bool `json:"ixfr_enable"`
- // DNS port of primary or secondary nameserver, depending on what zone this peer is
- // linked to.
- Port float64 `json:"port"`
- // TSIG authentication will be used for zone transfer if configured.
- TSIGID string `json:"tsig_id"`
- JSON secondaryDNSPeerGetResponseJSON `json:"-"`
-}
-
-// secondaryDNSPeerGetResponseJSON contains the JSON metadata for the struct
-// [SecondaryDNSPeerGetResponse]
-type secondaryDNSPeerGetResponseJSON struct {
- ID apijson.Field
- Name apijson.Field
- IP apijson.Field
- IxfrEnable apijson.Field
- Port apijson.Field
- TSIGID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDNSPeerGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDNSPeerGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDNSPeerNewParams struct {
- AccountID param.Field[interface{}] `path:"account_id,required"`
- Body param.Field[interface{}] `json:"body,required"`
-}
-
-func (r SecondaryDNSPeerNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r.Body)
-}
-
-type SecondaryDNSPeerNewResponseEnvelope struct {
- Errors []SecondaryDNSPeerNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []SecondaryDNSPeerNewResponseEnvelopeMessages `json:"messages,required"`
- Result SecondaryDNSPeerNewResponse `json:"result,required"`
- // Whether the API call was successful
- Success SecondaryDNSPeerNewResponseEnvelopeSuccess `json:"success,required"`
- JSON secondaryDNSPeerNewResponseEnvelopeJSON `json:"-"`
-}
-
-// secondaryDNSPeerNewResponseEnvelopeJSON contains the JSON metadata for the
-// struct [SecondaryDNSPeerNewResponseEnvelope]
-type secondaryDNSPeerNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDNSPeerNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDNSPeerNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDNSPeerNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON secondaryDNSPeerNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// secondaryDNSPeerNewResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [SecondaryDNSPeerNewResponseEnvelopeErrors]
-type secondaryDNSPeerNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDNSPeerNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDNSPeerNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDNSPeerNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON secondaryDNSPeerNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// secondaryDNSPeerNewResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [SecondaryDNSPeerNewResponseEnvelopeMessages]
-type secondaryDNSPeerNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDNSPeerNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDNSPeerNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type SecondaryDNSPeerNewResponseEnvelopeSuccess bool
-
-const (
- SecondaryDNSPeerNewResponseEnvelopeSuccessTrue SecondaryDNSPeerNewResponseEnvelopeSuccess = true
-)
-
-type SecondaryDNSPeerUpdateParams struct {
- AccountID param.Field[interface{}] `path:"account_id,required"`
- // The name of the peer.
- Name param.Field[string] `json:"name,required"`
- // IPv4/IPv6 address of primary or secondary nameserver, depending on what zone
- // this peer is linked to. For primary zones this IP defines the IP of the
- // secondary nameserver Cloudflare will NOTIFY upon zone changes. For secondary
- // zones this IP defines the IP of the primary nameserver Cloudflare will send
- // AXFR/IXFR requests to.
- IP param.Field[string] `json:"ip"`
- // Enable IXFR transfer protocol, default is AXFR. Only applicable to secondary
- // zones.
- IxfrEnable param.Field[bool] `json:"ixfr_enable"`
- // DNS port of primary or secondary nameserver, depending on what zone this peer is
- // linked to.
- Port param.Field[float64] `json:"port"`
- // TSIG authentication will be used for zone transfer if configured.
- TSIGID param.Field[string] `json:"tsig_id"`
-}
-
-func (r SecondaryDNSPeerUpdateParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type SecondaryDNSPeerUpdateResponseEnvelope struct {
- Errors []SecondaryDNSPeerUpdateResponseEnvelopeErrors `json:"errors,required"`
- Messages []SecondaryDNSPeerUpdateResponseEnvelopeMessages `json:"messages,required"`
- Result SecondaryDNSPeerUpdateResponse `json:"result,required"`
- // Whether the API call was successful
- Success SecondaryDNSPeerUpdateResponseEnvelopeSuccess `json:"success,required"`
- JSON secondaryDNSPeerUpdateResponseEnvelopeJSON `json:"-"`
-}
-
-// secondaryDNSPeerUpdateResponseEnvelopeJSON contains the JSON metadata for the
-// struct [SecondaryDNSPeerUpdateResponseEnvelope]
-type secondaryDNSPeerUpdateResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDNSPeerUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDNSPeerUpdateResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDNSPeerUpdateResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON secondaryDNSPeerUpdateResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// secondaryDNSPeerUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [SecondaryDNSPeerUpdateResponseEnvelopeErrors]
-type secondaryDNSPeerUpdateResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDNSPeerUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDNSPeerUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDNSPeerUpdateResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON secondaryDNSPeerUpdateResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// secondaryDNSPeerUpdateResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [SecondaryDNSPeerUpdateResponseEnvelopeMessages]
-type secondaryDNSPeerUpdateResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDNSPeerUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDNSPeerUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type SecondaryDNSPeerUpdateResponseEnvelopeSuccess bool
-
-const (
- SecondaryDNSPeerUpdateResponseEnvelopeSuccessTrue SecondaryDNSPeerUpdateResponseEnvelopeSuccess = true
-)
-
-type SecondaryDNSPeerListParams struct {
- AccountID param.Field[interface{}] `path:"account_id,required"`
-}
-
-type SecondaryDNSPeerListResponseEnvelope struct {
- Errors []SecondaryDNSPeerListResponseEnvelopeErrors `json:"errors,required"`
- Messages []SecondaryDNSPeerListResponseEnvelopeMessages `json:"messages,required"`
- Result []SecondaryDNSPeerListResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success SecondaryDNSPeerListResponseEnvelopeSuccess `json:"success,required"`
- ResultInfo SecondaryDNSPeerListResponseEnvelopeResultInfo `json:"result_info"`
- JSON secondaryDNSPeerListResponseEnvelopeJSON `json:"-"`
-}
-
-// secondaryDNSPeerListResponseEnvelopeJSON contains the JSON metadata for the
-// struct [SecondaryDNSPeerListResponseEnvelope]
-type secondaryDNSPeerListResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- ResultInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDNSPeerListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDNSPeerListResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDNSPeerListResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON secondaryDNSPeerListResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// secondaryDNSPeerListResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [SecondaryDNSPeerListResponseEnvelopeErrors]
-type secondaryDNSPeerListResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDNSPeerListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDNSPeerListResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDNSPeerListResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON secondaryDNSPeerListResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// secondaryDNSPeerListResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [SecondaryDNSPeerListResponseEnvelopeMessages]
-type secondaryDNSPeerListResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDNSPeerListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDNSPeerListResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type SecondaryDNSPeerListResponseEnvelopeSuccess bool
-
-const (
- SecondaryDNSPeerListResponseEnvelopeSuccessTrue SecondaryDNSPeerListResponseEnvelopeSuccess = true
-)
-
-type SecondaryDNSPeerListResponseEnvelopeResultInfo struct {
- // Total number of results for the requested service
- Count float64 `json:"count"`
- // Current page within paginated list of results
- Page float64 `json:"page"`
- // Number of results per page of results
- PerPage float64 `json:"per_page"`
- // Total results available without any search parameters
- TotalCount float64 `json:"total_count"`
- JSON secondaryDNSPeerListResponseEnvelopeResultInfoJSON `json:"-"`
-}
-
-// secondaryDNSPeerListResponseEnvelopeResultInfoJSON contains the JSON metadata
-// for the struct [SecondaryDNSPeerListResponseEnvelopeResultInfo]
-type secondaryDNSPeerListResponseEnvelopeResultInfoJSON struct {
- Count apijson.Field
- Page apijson.Field
- PerPage apijson.Field
- TotalCount apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDNSPeerListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDNSPeerListResponseEnvelopeResultInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDNSPeerDeleteParams struct {
- AccountID param.Field[interface{}] `path:"account_id,required"`
-}
-
-type SecondaryDNSPeerDeleteResponseEnvelope struct {
- Errors []SecondaryDNSPeerDeleteResponseEnvelopeErrors `json:"errors,required"`
- Messages []SecondaryDNSPeerDeleteResponseEnvelopeMessages `json:"messages,required"`
- Result SecondaryDNSPeerDeleteResponse `json:"result,required"`
- // Whether the API call was successful
- Success SecondaryDNSPeerDeleteResponseEnvelopeSuccess `json:"success,required"`
- JSON secondaryDNSPeerDeleteResponseEnvelopeJSON `json:"-"`
-}
-
-// secondaryDNSPeerDeleteResponseEnvelopeJSON contains the JSON metadata for the
-// struct [SecondaryDNSPeerDeleteResponseEnvelope]
-type secondaryDNSPeerDeleteResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDNSPeerDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDNSPeerDeleteResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDNSPeerDeleteResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON secondaryDNSPeerDeleteResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// secondaryDNSPeerDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [SecondaryDNSPeerDeleteResponseEnvelopeErrors]
-type secondaryDNSPeerDeleteResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDNSPeerDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDNSPeerDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDNSPeerDeleteResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON secondaryDNSPeerDeleteResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// secondaryDNSPeerDeleteResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [SecondaryDNSPeerDeleteResponseEnvelopeMessages]
-type secondaryDNSPeerDeleteResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDNSPeerDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDNSPeerDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type SecondaryDNSPeerDeleteResponseEnvelopeSuccess bool
-
-const (
- SecondaryDNSPeerDeleteResponseEnvelopeSuccessTrue SecondaryDNSPeerDeleteResponseEnvelopeSuccess = true
-)
-
-type SecondaryDNSPeerGetParams struct {
- AccountID param.Field[interface{}] `path:"account_id,required"`
-}
-
-type SecondaryDNSPeerGetResponseEnvelope struct {
- Errors []SecondaryDNSPeerGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []SecondaryDNSPeerGetResponseEnvelopeMessages `json:"messages,required"`
- Result SecondaryDNSPeerGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success SecondaryDNSPeerGetResponseEnvelopeSuccess `json:"success,required"`
- JSON secondaryDNSPeerGetResponseEnvelopeJSON `json:"-"`
-}
-
-// secondaryDNSPeerGetResponseEnvelopeJSON contains the JSON metadata for the
-// struct [SecondaryDNSPeerGetResponseEnvelope]
-type secondaryDNSPeerGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDNSPeerGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDNSPeerGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDNSPeerGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON secondaryDNSPeerGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// secondaryDNSPeerGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [SecondaryDNSPeerGetResponseEnvelopeErrors]
-type secondaryDNSPeerGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDNSPeerGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDNSPeerGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDNSPeerGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON secondaryDNSPeerGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// secondaryDNSPeerGetResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [SecondaryDNSPeerGetResponseEnvelopeMessages]
-type secondaryDNSPeerGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDNSPeerGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDNSPeerGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type SecondaryDNSPeerGetResponseEnvelopeSuccess bool
-
-const (
- SecondaryDNSPeerGetResponseEnvelopeSuccessTrue SecondaryDNSPeerGetResponseEnvelopeSuccess = true
-)
diff --git a/secondarydnspeer_test.go b/secondarydnspeer_test.go
deleted file mode 100644
index 21bceae83f5..00000000000
--- a/secondarydnspeer_test.go
+++ /dev/null
@@ -1,162 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestSecondaryDNSPeerNew(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"),
- )
- _, err := client.SecondaryDNS.Peers.New(context.TODO(), cloudflare.SecondaryDNSPeerNewParams{
- AccountID: cloudflare.F[any]("01a7362d577a6c3019a474fd6f485823"),
- Body: cloudflare.F[any](map[string]interface{}{}),
- })
- 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())
- }
-}
-
-func TestSecondaryDNSPeerUpdateWithOptionalParams(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"),
- )
- _, err := client.SecondaryDNS.Peers.Update(
- context.TODO(),
- "23ff594956f20c2a721606e94745a8aa",
- cloudflare.SecondaryDNSPeerUpdateParams{
- AccountID: cloudflare.F[any]("01a7362d577a6c3019a474fd6f485823"),
- Name: cloudflare.F("my-peer-1"),
- IP: cloudflare.F("192.0.2.53"),
- IxfrEnable: cloudflare.F(false),
- Port: cloudflare.F(53.000000),
- TSIGID: cloudflare.F("69cd1e104af3e6ed3cb344f263fd0d5a"),
- },
- )
- 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())
- }
-}
-
-func TestSecondaryDNSPeerList(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"),
- )
- _, err := client.SecondaryDNS.Peers.List(context.TODO(), cloudflare.SecondaryDNSPeerListParams{
- AccountID: cloudflare.F[any]("01a7362d577a6c3019a474fd6f485823"),
- })
- 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())
- }
-}
-
-func TestSecondaryDNSPeerDelete(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"),
- )
- _, err := client.SecondaryDNS.Peers.Delete(
- context.TODO(),
- "23ff594956f20c2a721606e94745a8aa",
- cloudflare.SecondaryDNSPeerDeleteParams{
- AccountID: cloudflare.F[any]("01a7362d577a6c3019a474fd6f485823"),
- },
- )
- 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())
- }
-}
-
-func TestSecondaryDNSPeerGet(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"),
- )
- _, err := client.SecondaryDNS.Peers.Get(
- context.TODO(),
- "23ff594956f20c2a721606e94745a8aa",
- cloudflare.SecondaryDNSPeerGetParams{
- AccountID: cloudflare.F[any]("01a7362d577a6c3019a474fd6f485823"),
- },
- )
- 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/secondarydnstsig.go b/secondarydnstsig.go
deleted file mode 100644
index 13205e13abb..00000000000
--- a/secondarydnstsig.go
+++ /dev/null
@@ -1,716 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// SecondaryDNSTSIGService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewSecondaryDNSTSIGService] method
-// instead.
-type SecondaryDNSTSIGService struct {
- Options []option.RequestOption
-}
-
-// NewSecondaryDNSTSIGService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewSecondaryDNSTSIGService(opts ...option.RequestOption) (r *SecondaryDNSTSIGService) {
- r = &SecondaryDNSTSIGService{}
- r.Options = opts
- return
-}
-
-// Create TSIG.
-func (r *SecondaryDNSTSIGService) New(ctx context.Context, params SecondaryDNSTSIGNewParams, opts ...option.RequestOption) (res *SecondaryDnstsigNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env SecondaryDnstsigNewResponseEnvelope
- path := fmt.Sprintf("accounts/%v/secondary_dns/tsigs", params.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Modify TSIG.
-func (r *SecondaryDNSTSIGService) Update(ctx context.Context, tsigID interface{}, params SecondaryDNSTSIGUpdateParams, opts ...option.RequestOption) (res *SecondaryDnstsigUpdateResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env SecondaryDnstsigUpdateResponseEnvelope
- path := fmt.Sprintf("accounts/%v/secondary_dns/tsigs/%v", params.AccountID, tsigID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// List TSIGs.
-func (r *SecondaryDNSTSIGService) List(ctx context.Context, query SecondaryDNSTSIGListParams, opts ...option.RequestOption) (res *[]SecondaryDnstsigListResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env SecondaryDnstsigListResponseEnvelope
- path := fmt.Sprintf("accounts/%v/secondary_dns/tsigs", query.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Delete TSIG.
-func (r *SecondaryDNSTSIGService) Delete(ctx context.Context, tsigID interface{}, body SecondaryDNSTSIGDeleteParams, opts ...option.RequestOption) (res *SecondaryDnstsigDeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env SecondaryDnstsigDeleteResponseEnvelope
- path := fmt.Sprintf("accounts/%v/secondary_dns/tsigs/%v", body.AccountID, tsigID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Get TSIG.
-func (r *SecondaryDNSTSIGService) Get(ctx context.Context, tsigID interface{}, query SecondaryDNSTSIGGetParams, opts ...option.RequestOption) (res *SecondaryDnstsigGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env SecondaryDnstsigGetResponseEnvelope
- path := fmt.Sprintf("accounts/%v/secondary_dns/tsigs/%v", query.AccountID, tsigID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type SecondaryDnstsigNewResponse struct {
- ID interface{} `json:"id,required"`
- // TSIG algorithm.
- Algo string `json:"algo,required"`
- // TSIG key name.
- Name string `json:"name,required"`
- // TSIG secret.
- Secret string `json:"secret,required"`
- JSON secondaryDnstsigNewResponseJSON `json:"-"`
-}
-
-// secondaryDnstsigNewResponseJSON contains the JSON metadata for the struct
-// [SecondaryDnstsigNewResponse]
-type secondaryDnstsigNewResponseJSON struct {
- ID apijson.Field
- Algo apijson.Field
- Name apijson.Field
- Secret apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDnstsigNewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDnstsigNewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDnstsigUpdateResponse struct {
- ID interface{} `json:"id,required"`
- // TSIG algorithm.
- Algo string `json:"algo,required"`
- // TSIG key name.
- Name string `json:"name,required"`
- // TSIG secret.
- Secret string `json:"secret,required"`
- JSON secondaryDnstsigUpdateResponseJSON `json:"-"`
-}
-
-// secondaryDnstsigUpdateResponseJSON contains the JSON metadata for the struct
-// [SecondaryDnstsigUpdateResponse]
-type secondaryDnstsigUpdateResponseJSON struct {
- ID apijson.Field
- Algo apijson.Field
- Name apijson.Field
- Secret apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDnstsigUpdateResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDnstsigUpdateResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDnstsigListResponse struct {
- ID interface{} `json:"id,required"`
- // TSIG algorithm.
- Algo string `json:"algo,required"`
- // TSIG key name.
- Name string `json:"name,required"`
- // TSIG secret.
- Secret string `json:"secret,required"`
- JSON secondaryDnstsigListResponseJSON `json:"-"`
-}
-
-// secondaryDnstsigListResponseJSON contains the JSON metadata for the struct
-// [SecondaryDnstsigListResponse]
-type secondaryDnstsigListResponseJSON struct {
- ID apijson.Field
- Algo apijson.Field
- Name apijson.Field
- Secret apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDnstsigListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDnstsigListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDnstsigDeleteResponse struct {
- ID interface{} `json:"id"`
- JSON secondaryDnstsigDeleteResponseJSON `json:"-"`
-}
-
-// secondaryDnstsigDeleteResponseJSON contains the JSON metadata for the struct
-// [SecondaryDnstsigDeleteResponse]
-type secondaryDnstsigDeleteResponseJSON struct {
- ID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDnstsigDeleteResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDnstsigDeleteResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDnstsigGetResponse struct {
- ID interface{} `json:"id,required"`
- // TSIG algorithm.
- Algo string `json:"algo,required"`
- // TSIG key name.
- Name string `json:"name,required"`
- // TSIG secret.
- Secret string `json:"secret,required"`
- JSON secondaryDnstsigGetResponseJSON `json:"-"`
-}
-
-// secondaryDnstsigGetResponseJSON contains the JSON metadata for the struct
-// [SecondaryDnstsigGetResponse]
-type secondaryDnstsigGetResponseJSON struct {
- ID apijson.Field
- Algo apijson.Field
- Name apijson.Field
- Secret apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDnstsigGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDnstsigGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDNSTSIGNewParams struct {
- AccountID param.Field[interface{}] `path:"account_id,required"`
- // TSIG algorithm.
- Algo param.Field[string] `json:"algo,required"`
- // TSIG key name.
- Name param.Field[string] `json:"name,required"`
- // TSIG secret.
- Secret param.Field[string] `json:"secret,required"`
-}
-
-func (r SecondaryDNSTSIGNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type SecondaryDnstsigNewResponseEnvelope struct {
- Errors []SecondaryDnstsigNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []SecondaryDnstsigNewResponseEnvelopeMessages `json:"messages,required"`
- Result SecondaryDnstsigNewResponse `json:"result,required"`
- // Whether the API call was successful
- Success SecondaryDnstsigNewResponseEnvelopeSuccess `json:"success,required"`
- JSON secondaryDnstsigNewResponseEnvelopeJSON `json:"-"`
-}
-
-// secondaryDnstsigNewResponseEnvelopeJSON contains the JSON metadata for the
-// struct [SecondaryDnstsigNewResponseEnvelope]
-type secondaryDnstsigNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDnstsigNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDnstsigNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDnstsigNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON secondaryDnstsigNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// secondaryDnstsigNewResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [SecondaryDnstsigNewResponseEnvelopeErrors]
-type secondaryDnstsigNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDnstsigNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDnstsigNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDnstsigNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON secondaryDnstsigNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// secondaryDnstsigNewResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [SecondaryDnstsigNewResponseEnvelopeMessages]
-type secondaryDnstsigNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDnstsigNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDnstsigNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type SecondaryDnstsigNewResponseEnvelopeSuccess bool
-
-const (
- SecondaryDnstsigNewResponseEnvelopeSuccessTrue SecondaryDnstsigNewResponseEnvelopeSuccess = true
-)
-
-type SecondaryDNSTSIGUpdateParams struct {
- AccountID param.Field[interface{}] `path:"account_id,required"`
- // TSIG algorithm.
- Algo param.Field[string] `json:"algo,required"`
- // TSIG key name.
- Name param.Field[string] `json:"name,required"`
- // TSIG secret.
- Secret param.Field[string] `json:"secret,required"`
-}
-
-func (r SecondaryDNSTSIGUpdateParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type SecondaryDnstsigUpdateResponseEnvelope struct {
- Errors []SecondaryDnstsigUpdateResponseEnvelopeErrors `json:"errors,required"`
- Messages []SecondaryDnstsigUpdateResponseEnvelopeMessages `json:"messages,required"`
- Result SecondaryDnstsigUpdateResponse `json:"result,required"`
- // Whether the API call was successful
- Success SecondaryDnstsigUpdateResponseEnvelopeSuccess `json:"success,required"`
- JSON secondaryDnstsigUpdateResponseEnvelopeJSON `json:"-"`
-}
-
-// secondaryDnstsigUpdateResponseEnvelopeJSON contains the JSON metadata for the
-// struct [SecondaryDnstsigUpdateResponseEnvelope]
-type secondaryDnstsigUpdateResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDnstsigUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDnstsigUpdateResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDnstsigUpdateResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON secondaryDnstsigUpdateResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// secondaryDnstsigUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [SecondaryDnstsigUpdateResponseEnvelopeErrors]
-type secondaryDnstsigUpdateResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDnstsigUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDnstsigUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDnstsigUpdateResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON secondaryDnstsigUpdateResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// secondaryDnstsigUpdateResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [SecondaryDnstsigUpdateResponseEnvelopeMessages]
-type secondaryDnstsigUpdateResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDnstsigUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDnstsigUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type SecondaryDnstsigUpdateResponseEnvelopeSuccess bool
-
-const (
- SecondaryDnstsigUpdateResponseEnvelopeSuccessTrue SecondaryDnstsigUpdateResponseEnvelopeSuccess = true
-)
-
-type SecondaryDNSTSIGListParams struct {
- AccountID param.Field[interface{}] `path:"account_id,required"`
-}
-
-type SecondaryDnstsigListResponseEnvelope struct {
- Errors []SecondaryDnstsigListResponseEnvelopeErrors `json:"errors,required"`
- Messages []SecondaryDnstsigListResponseEnvelopeMessages `json:"messages,required"`
- Result []SecondaryDnstsigListResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success SecondaryDnstsigListResponseEnvelopeSuccess `json:"success,required"`
- ResultInfo SecondaryDnstsigListResponseEnvelopeResultInfo `json:"result_info"`
- JSON secondaryDnstsigListResponseEnvelopeJSON `json:"-"`
-}
-
-// secondaryDnstsigListResponseEnvelopeJSON contains the JSON metadata for the
-// struct [SecondaryDnstsigListResponseEnvelope]
-type secondaryDnstsigListResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- ResultInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDnstsigListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDnstsigListResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDnstsigListResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON secondaryDnstsigListResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// secondaryDnstsigListResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [SecondaryDnstsigListResponseEnvelopeErrors]
-type secondaryDnstsigListResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDnstsigListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDnstsigListResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDnstsigListResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON secondaryDnstsigListResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// secondaryDnstsigListResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [SecondaryDnstsigListResponseEnvelopeMessages]
-type secondaryDnstsigListResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDnstsigListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDnstsigListResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type SecondaryDnstsigListResponseEnvelopeSuccess bool
-
-const (
- SecondaryDnstsigListResponseEnvelopeSuccessTrue SecondaryDnstsigListResponseEnvelopeSuccess = true
-)
-
-type SecondaryDnstsigListResponseEnvelopeResultInfo struct {
- // Total number of results for the requested service
- Count float64 `json:"count"`
- // Current page within paginated list of results
- Page float64 `json:"page"`
- // Number of results per page of results
- PerPage float64 `json:"per_page"`
- // Total results available without any search parameters
- TotalCount float64 `json:"total_count"`
- JSON secondaryDnstsigListResponseEnvelopeResultInfoJSON `json:"-"`
-}
-
-// secondaryDnstsigListResponseEnvelopeResultInfoJSON contains the JSON metadata
-// for the struct [SecondaryDnstsigListResponseEnvelopeResultInfo]
-type secondaryDnstsigListResponseEnvelopeResultInfoJSON struct {
- Count apijson.Field
- Page apijson.Field
- PerPage apijson.Field
- TotalCount apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDnstsigListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDnstsigListResponseEnvelopeResultInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDNSTSIGDeleteParams struct {
- AccountID param.Field[interface{}] `path:"account_id,required"`
-}
-
-type SecondaryDnstsigDeleteResponseEnvelope struct {
- Errors []SecondaryDnstsigDeleteResponseEnvelopeErrors `json:"errors,required"`
- Messages []SecondaryDnstsigDeleteResponseEnvelopeMessages `json:"messages,required"`
- Result SecondaryDnstsigDeleteResponse `json:"result,required"`
- // Whether the API call was successful
- Success SecondaryDnstsigDeleteResponseEnvelopeSuccess `json:"success,required"`
- JSON secondaryDnstsigDeleteResponseEnvelopeJSON `json:"-"`
-}
-
-// secondaryDnstsigDeleteResponseEnvelopeJSON contains the JSON metadata for the
-// struct [SecondaryDnstsigDeleteResponseEnvelope]
-type secondaryDnstsigDeleteResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDnstsigDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDnstsigDeleteResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDnstsigDeleteResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON secondaryDnstsigDeleteResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// secondaryDnstsigDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [SecondaryDnstsigDeleteResponseEnvelopeErrors]
-type secondaryDnstsigDeleteResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDnstsigDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDnstsigDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDnstsigDeleteResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON secondaryDnstsigDeleteResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// secondaryDnstsigDeleteResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [SecondaryDnstsigDeleteResponseEnvelopeMessages]
-type secondaryDnstsigDeleteResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDnstsigDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDnstsigDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type SecondaryDnstsigDeleteResponseEnvelopeSuccess bool
-
-const (
- SecondaryDnstsigDeleteResponseEnvelopeSuccessTrue SecondaryDnstsigDeleteResponseEnvelopeSuccess = true
-)
-
-type SecondaryDNSTSIGGetParams struct {
- AccountID param.Field[interface{}] `path:"account_id,required"`
-}
-
-type SecondaryDnstsigGetResponseEnvelope struct {
- Errors []SecondaryDnstsigGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []SecondaryDnstsigGetResponseEnvelopeMessages `json:"messages,required"`
- Result SecondaryDnstsigGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success SecondaryDnstsigGetResponseEnvelopeSuccess `json:"success,required"`
- JSON secondaryDnstsigGetResponseEnvelopeJSON `json:"-"`
-}
-
-// secondaryDnstsigGetResponseEnvelopeJSON contains the JSON metadata for the
-// struct [SecondaryDnstsigGetResponseEnvelope]
-type secondaryDnstsigGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDnstsigGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDnstsigGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDnstsigGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON secondaryDnstsigGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// secondaryDnstsigGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [SecondaryDnstsigGetResponseEnvelopeErrors]
-type secondaryDnstsigGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDnstsigGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDnstsigGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type SecondaryDnstsigGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON secondaryDnstsigGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// secondaryDnstsigGetResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [SecondaryDnstsigGetResponseEnvelopeMessages]
-type secondaryDnstsigGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SecondaryDnstsigGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r secondaryDnstsigGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type SecondaryDnstsigGetResponseEnvelopeSuccess bool
-
-const (
- SecondaryDnstsigGetResponseEnvelopeSuccessTrue SecondaryDnstsigGetResponseEnvelopeSuccess = true
-)
diff --git a/secondarydnstsig_test.go b/secondarydnstsig_test.go
deleted file mode 100644
index 2d3b8c0492d..00000000000
--- a/secondarydnstsig_test.go
+++ /dev/null
@@ -1,162 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestSecondaryDNSTSIGNew(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"),
- )
- _, err := client.SecondaryDNS.TSIGs.New(context.TODO(), cloudflare.SecondaryDNSTSIGNewParams{
- AccountID: cloudflare.F[any]("01a7362d577a6c3019a474fd6f485823"),
- Algo: cloudflare.F("hmac-sha512."),
- Name: cloudflare.F("tsig.customer.cf."),
- Secret: cloudflare.F("caf79a7804b04337c9c66ccd7bef9190a1e1679b5dd03d8aa10f7ad45e1a9dab92b417896c15d4d007c7c14194538d2a5d0feffdecc5a7f0e1c570cfa700837c"),
- })
- 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())
- }
-}
-
-func TestSecondaryDNSTSIGUpdate(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"),
- )
- _, err := client.SecondaryDNS.TSIGs.Update(
- context.TODO(),
- "69cd1e104af3e6ed3cb344f263fd0d5a",
- cloudflare.SecondaryDNSTSIGUpdateParams{
- AccountID: cloudflare.F[any]("01a7362d577a6c3019a474fd6f485823"),
- Algo: cloudflare.F("hmac-sha512."),
- Name: cloudflare.F("tsig.customer.cf."),
- Secret: cloudflare.F("caf79a7804b04337c9c66ccd7bef9190a1e1679b5dd03d8aa10f7ad45e1a9dab92b417896c15d4d007c7c14194538d2a5d0feffdecc5a7f0e1c570cfa700837c"),
- },
- )
- 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())
- }
-}
-
-func TestSecondaryDNSTSIGList(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"),
- )
- _, err := client.SecondaryDNS.TSIGs.List(context.TODO(), cloudflare.SecondaryDNSTSIGListParams{
- AccountID: cloudflare.F[any]("01a7362d577a6c3019a474fd6f485823"),
- })
- 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())
- }
-}
-
-func TestSecondaryDNSTSIGDelete(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"),
- )
- _, err := client.SecondaryDNS.TSIGs.Delete(
- context.TODO(),
- "69cd1e104af3e6ed3cb344f263fd0d5a",
- cloudflare.SecondaryDNSTSIGDeleteParams{
- AccountID: cloudflare.F[any]("01a7362d577a6c3019a474fd6f485823"),
- },
- )
- 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())
- }
-}
-
-func TestSecondaryDNSTSIGGet(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"),
- )
- _, err := client.SecondaryDNS.TSIGs.Get(
- context.TODO(),
- "69cd1e104af3e6ed3cb344f263fd0d5a",
- cloudflare.SecondaryDNSTSIGGetParams{
- AccountID: cloudflare.F[any]("01a7362d577a6c3019a474fd6f485823"),
- },
- )
- 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/snippetcontent.go b/snippetcontent.go
deleted file mode 100644
index f5c49e900cd..00000000000
--- a/snippetcontent.go
+++ /dev/null
@@ -1,39 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
-
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// SnippetContentService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewSnippetContentService] method
-// instead.
-type SnippetContentService struct {
- Options []option.RequestOption
-}
-
-// NewSnippetContentService generates a new service that applies the given options
-// to each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewSnippetContentService(opts ...option.RequestOption) (r *SnippetContentService) {
- r = &SnippetContentService{}
- r.Options = opts
- return
-}
-
-// Snippet Content
-func (r *SnippetContentService) Get(ctx context.Context, zoneIdentifier string, snippetName string, opts ...option.RequestOption) (res *http.Response, err error) {
- opts = append(r.Options[:], opts...)
- opts = append([]option.RequestOption{option.WithHeader("Accept", "multipart/form-data")}, opts...)
- path := fmt.Sprintf("zones/%s/snippets/%s/content", zoneIdentifier, snippetName)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &res, opts...)
- return
-}
diff --git a/snippetcontent_test.go b/snippetcontent_test.go
deleted file mode 100644
index cf9fd4f7634..00000000000
--- a/snippetcontent_test.go
+++ /dev/null
@@ -1,56 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "bytes"
- "context"
- "errors"
- "io"
- "net/http"
- "net/http/httptest"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestSnippetContentGet(t *testing.T) {
- t.Skip("skipped: tests are disabled for the time being")
- server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
- w.WriteHeader(200)
- w.Write([]byte("abc"))
- }))
- defer server.Close()
- baseURL := server.URL
- client := cloudflare.NewClient(
- option.WithBaseURL(baseURL),
- option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"),
- option.WithAPIEmail("user@example.com"),
- )
- resp, err := client.Snippets.Content.Get(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- "snippet_name_01",
- )
- 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())
- }
- defer resp.Body.Close()
-
- b, err := io.ReadAll(resp.Body)
- 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())
- }
- if !bytes.Equal(b, []byte("abc")) {
- t.Fatalf("return value not %s: %s", "abc", b)
- }
-}
diff --git a/snippetrule.go b/snippetrule.go
deleted file mode 100644
index c7f9c35d324..00000000000
--- a/snippetrule.go
+++ /dev/null
@@ -1,299 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// SnippetRuleService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewSnippetRuleService] method
-// instead.
-type SnippetRuleService struct {
- Options []option.RequestOption
-}
-
-// NewSnippetRuleService generates a new service that applies the given options to
-// each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewSnippetRuleService(opts ...option.RequestOption) (r *SnippetRuleService) {
- r = &SnippetRuleService{}
- r.Options = opts
- return
-}
-
-// Put Rules
-func (r *SnippetRuleService) Update(ctx context.Context, zoneIdentifier string, body SnippetRuleUpdateParams, opts ...option.RequestOption) (res *[]SnippetRuleUpdateResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env SnippetRuleUpdateResponseEnvelope
- path := fmt.Sprintf("zones/%s/snippets/snippet_rules", zoneIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Rules
-func (r *SnippetRuleService) List(ctx context.Context, zoneIdentifier string, opts ...option.RequestOption) (res *[]SnippetRuleListResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env SnippetRuleListResponseEnvelope
- path := fmt.Sprintf("zones/%s/snippets/snippet_rules", zoneIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type SnippetRuleUpdateResponse struct {
- Description string `json:"description"`
- Enabled bool `json:"enabled"`
- Expression string `json:"expression"`
- // Snippet identifying name
- SnippetName string `json:"snippet_name"`
- JSON snippetRuleUpdateResponseJSON `json:"-"`
-}
-
-// snippetRuleUpdateResponseJSON contains the JSON metadata for the struct
-// [SnippetRuleUpdateResponse]
-type snippetRuleUpdateResponseJSON struct {
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- SnippetName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SnippetRuleUpdateResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r snippetRuleUpdateResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type SnippetRuleListResponse struct {
- Description string `json:"description"`
- Enabled bool `json:"enabled"`
- Expression string `json:"expression"`
- // Snippet identifying name
- SnippetName string `json:"snippet_name"`
- JSON snippetRuleListResponseJSON `json:"-"`
-}
-
-// snippetRuleListResponseJSON contains the JSON metadata for the struct
-// [SnippetRuleListResponse]
-type snippetRuleListResponseJSON struct {
- Description apijson.Field
- Enabled apijson.Field
- Expression apijson.Field
- SnippetName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SnippetRuleListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r snippetRuleListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type SnippetRuleUpdateParams struct {
- // List of snippet rules
- Rules param.Field[[]SnippetRuleUpdateParamsRule] `json:"rules"`
-}
-
-func (r SnippetRuleUpdateParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type SnippetRuleUpdateParamsRule struct {
- Description param.Field[string] `json:"description"`
- Enabled param.Field[bool] `json:"enabled"`
- Expression param.Field[string] `json:"expression"`
- // Snippet identifying name
- SnippetName param.Field[string] `json:"snippet_name"`
-}
-
-func (r SnippetRuleUpdateParamsRule) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type SnippetRuleUpdateResponseEnvelope struct {
- Errors []SnippetRuleUpdateResponseEnvelopeErrors `json:"errors,required"`
- Messages []SnippetRuleUpdateResponseEnvelopeMessages `json:"messages,required"`
- // List of snippet rules
- Result []SnippetRuleUpdateResponse `json:"result,required"`
- // Whether the API call was successful
- Success SnippetRuleUpdateResponseEnvelopeSuccess `json:"success,required"`
- JSON snippetRuleUpdateResponseEnvelopeJSON `json:"-"`
-}
-
-// snippetRuleUpdateResponseEnvelopeJSON contains the JSON metadata for the struct
-// [SnippetRuleUpdateResponseEnvelope]
-type snippetRuleUpdateResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SnippetRuleUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r snippetRuleUpdateResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type SnippetRuleUpdateResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON snippetRuleUpdateResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// snippetRuleUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [SnippetRuleUpdateResponseEnvelopeErrors]
-type snippetRuleUpdateResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SnippetRuleUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r snippetRuleUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type SnippetRuleUpdateResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON snippetRuleUpdateResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// snippetRuleUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [SnippetRuleUpdateResponseEnvelopeMessages]
-type snippetRuleUpdateResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SnippetRuleUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r snippetRuleUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type SnippetRuleUpdateResponseEnvelopeSuccess bool
-
-const (
- SnippetRuleUpdateResponseEnvelopeSuccessTrue SnippetRuleUpdateResponseEnvelopeSuccess = true
-)
-
-type SnippetRuleListResponseEnvelope struct {
- Errors []SnippetRuleListResponseEnvelopeErrors `json:"errors,required"`
- Messages []SnippetRuleListResponseEnvelopeMessages `json:"messages,required"`
- // List of snippet rules
- Result []SnippetRuleListResponse `json:"result,required"`
- // Whether the API call was successful
- Success SnippetRuleListResponseEnvelopeSuccess `json:"success,required"`
- JSON snippetRuleListResponseEnvelopeJSON `json:"-"`
-}
-
-// snippetRuleListResponseEnvelopeJSON contains the JSON metadata for the struct
-// [SnippetRuleListResponseEnvelope]
-type snippetRuleListResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SnippetRuleListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r snippetRuleListResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type SnippetRuleListResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON snippetRuleListResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// snippetRuleListResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [SnippetRuleListResponseEnvelopeErrors]
-type snippetRuleListResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SnippetRuleListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r snippetRuleListResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type SnippetRuleListResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON snippetRuleListResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// snippetRuleListResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [SnippetRuleListResponseEnvelopeMessages]
-type snippetRuleListResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SnippetRuleListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r snippetRuleListResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type SnippetRuleListResponseEnvelopeSuccess bool
-
-const (
- SnippetRuleListResponseEnvelopeSuccessTrue SnippetRuleListResponseEnvelopeSuccess = true
-)
diff --git a/snippetrule_test.go b/snippetrule_test.go
deleted file mode 100644
index 23a872950d9..00000000000
--- a/snippetrule_test.go
+++ /dev/null
@@ -1,83 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestSnippetRuleUpdateWithOptionalParams(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"),
- )
- _, err := client.Snippets.Rules.Update(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.SnippetRuleUpdateParams{
- Rules: cloudflare.F([]cloudflare.SnippetRuleUpdateParamsRule{{
- Description: cloudflare.F("Rule description"),
- Enabled: cloudflare.F(true),
- Expression: cloudflare.F("http.cookie eq \"a=b\""),
- SnippetName: cloudflare.F("snippet_name_01"),
- }, {
- Description: cloudflare.F("Rule description"),
- Enabled: cloudflare.F(true),
- Expression: cloudflare.F("http.cookie eq \"a=b\""),
- SnippetName: cloudflare.F("snippet_name_01"),
- }, {
- Description: cloudflare.F("Rule description"),
- Enabled: cloudflare.F(true),
- Expression: cloudflare.F("http.cookie eq \"a=b\""),
- SnippetName: cloudflare.F("snippet_name_01"),
- }}),
- },
- )
- 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())
- }
-}
-
-func TestSnippetRuleList(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"),
- )
- _, err := client.Snippets.Rules.List(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353")
- 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/snippets/aliases.go b/snippets/aliases.go
new file mode 100644
index 00000000000..4400ffac293
--- /dev/null
+++ b/snippets/aliases.go
@@ -0,0 +1,9 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package snippets
+
+import (
+ "github.com/cloudflare/cloudflare-go/internal/apierror"
+)
+
+type Error = apierror.Error
diff --git a/snippets/content.go b/snippets/content.go
new file mode 100644
index 00000000000..4fee13ce077
--- /dev/null
+++ b/snippets/content.go
@@ -0,0 +1,38 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package snippets
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// ContentService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewContentService] method instead.
+type ContentService struct {
+ Options []option.RequestOption
+}
+
+// NewContentService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewContentService(opts ...option.RequestOption) (r *ContentService) {
+ r = &ContentService{}
+ r.Options = opts
+ return
+}
+
+// Snippet Content
+func (r *ContentService) Get(ctx context.Context, zoneIdentifier string, snippetName string, opts ...option.RequestOption) (res *http.Response, err error) {
+ opts = append(r.Options[:], opts...)
+ opts = append([]option.RequestOption{option.WithHeader("Accept", "multipart/form-data")}, opts...)
+ path := fmt.Sprintf("zones/%s/snippets/%s/content", zoneIdentifier, snippetName)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &res, opts...)
+ return
+}
diff --git a/snippets/content_test.go b/snippets/content_test.go
new file mode 100644
index 00000000000..d5c01d19636
--- /dev/null
+++ b/snippets/content_test.go
@@ -0,0 +1,56 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package snippets_test
+
+import (
+ "bytes"
+ "context"
+ "errors"
+ "io"
+ "net/http"
+ "net/http/httptest"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestContentGet(t *testing.T) {
+ t.Skip("skipped: tests are disabled for the time being")
+ server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ w.WriteHeader(200)
+ w.Write([]byte("abc"))
+ }))
+ defer server.Close()
+ baseURL := server.URL
+ client := cloudflare.NewClient(
+ option.WithBaseURL(baseURL),
+ option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"),
+ option.WithAPIEmail("user@example.com"),
+ )
+ resp, err := client.Snippets.Content.Get(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ "snippet_name_01",
+ )
+ 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())
+ }
+ defer resp.Body.Close()
+
+ b, err := io.ReadAll(resp.Body)
+ 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())
+ }
+ if !bytes.Equal(b, []byte("abc")) {
+ t.Fatalf("return value not %s: %s", "abc", b)
+ }
+}
diff --git a/snippets/rule.go b/snippets/rule.go
new file mode 100644
index 00000000000..ab29db079fe
--- /dev/null
+++ b/snippets/rule.go
@@ -0,0 +1,298 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package snippets
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// RuleService contains methods and other services that help with interacting with
+// the cloudflare API. Note, unlike clients, this service does not read variables
+// from the environment automatically. You should not instantiate this service
+// directly, and instead use the [NewRuleService] method instead.
+type RuleService struct {
+ Options []option.RequestOption
+}
+
+// NewRuleService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewRuleService(opts ...option.RequestOption) (r *RuleService) {
+ r = &RuleService{}
+ r.Options = opts
+ return
+}
+
+// Put Rules
+func (r *RuleService) Update(ctx context.Context, zoneIdentifier string, body RuleUpdateParams, opts ...option.RequestOption) (res *[]RuleUpdateResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RuleUpdateResponseEnvelope
+ path := fmt.Sprintf("zones/%s/snippets/snippet_rules", zoneIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Rules
+func (r *RuleService) List(ctx context.Context, zoneIdentifier string, opts ...option.RequestOption) (res *[]RuleListResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RuleListResponseEnvelope
+ path := fmt.Sprintf("zones/%s/snippets/snippet_rules", zoneIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type RuleUpdateResponse struct {
+ Description string `json:"description"`
+ Enabled bool `json:"enabled"`
+ Expression string `json:"expression"`
+ // Snippet identifying name
+ SnippetName string `json:"snippet_name"`
+ JSON ruleUpdateResponseJSON `json:"-"`
+}
+
+// ruleUpdateResponseJSON contains the JSON metadata for the struct
+// [RuleUpdateResponse]
+type ruleUpdateResponseJSON struct {
+ Description apijson.Field
+ Enabled apijson.Field
+ Expression apijson.Field
+ SnippetName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RuleUpdateResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ruleUpdateResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type RuleListResponse struct {
+ Description string `json:"description"`
+ Enabled bool `json:"enabled"`
+ Expression string `json:"expression"`
+ // Snippet identifying name
+ SnippetName string `json:"snippet_name"`
+ JSON ruleListResponseJSON `json:"-"`
+}
+
+// ruleListResponseJSON contains the JSON metadata for the struct
+// [RuleListResponse]
+type ruleListResponseJSON struct {
+ Description apijson.Field
+ Enabled apijson.Field
+ Expression apijson.Field
+ SnippetName apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RuleListResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ruleListResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type RuleUpdateParams struct {
+ // List of snippet rules
+ Rules param.Field[[]RuleUpdateParamsRule] `json:"rules"`
+}
+
+func (r RuleUpdateParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type RuleUpdateParamsRule struct {
+ Description param.Field[string] `json:"description"`
+ Enabled param.Field[bool] `json:"enabled"`
+ Expression param.Field[string] `json:"expression"`
+ // Snippet identifying name
+ SnippetName param.Field[string] `json:"snippet_name"`
+}
+
+func (r RuleUpdateParamsRule) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type RuleUpdateResponseEnvelope struct {
+ Errors []RuleUpdateResponseEnvelopeErrors `json:"errors,required"`
+ Messages []RuleUpdateResponseEnvelopeMessages `json:"messages,required"`
+ // List of snippet rules
+ Result []RuleUpdateResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success RuleUpdateResponseEnvelopeSuccess `json:"success,required"`
+ JSON ruleUpdateResponseEnvelopeJSON `json:"-"`
+}
+
+// ruleUpdateResponseEnvelopeJSON contains the JSON metadata for the struct
+// [RuleUpdateResponseEnvelope]
+type ruleUpdateResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RuleUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ruleUpdateResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type RuleUpdateResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON ruleUpdateResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// ruleUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [RuleUpdateResponseEnvelopeErrors]
+type ruleUpdateResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RuleUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ruleUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type RuleUpdateResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON ruleUpdateResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// ruleUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [RuleUpdateResponseEnvelopeMessages]
+type ruleUpdateResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RuleUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ruleUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type RuleUpdateResponseEnvelopeSuccess bool
+
+const (
+ RuleUpdateResponseEnvelopeSuccessTrue RuleUpdateResponseEnvelopeSuccess = true
+)
+
+type RuleListResponseEnvelope struct {
+ Errors []RuleListResponseEnvelopeErrors `json:"errors,required"`
+ Messages []RuleListResponseEnvelopeMessages `json:"messages,required"`
+ // List of snippet rules
+ Result []RuleListResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success RuleListResponseEnvelopeSuccess `json:"success,required"`
+ JSON ruleListResponseEnvelopeJSON `json:"-"`
+}
+
+// ruleListResponseEnvelopeJSON contains the JSON metadata for the struct
+// [RuleListResponseEnvelope]
+type ruleListResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RuleListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ruleListResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type RuleListResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON ruleListResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// ruleListResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [RuleListResponseEnvelopeErrors]
+type ruleListResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RuleListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ruleListResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type RuleListResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON ruleListResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// ruleListResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [RuleListResponseEnvelopeMessages]
+type ruleListResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RuleListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r ruleListResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type RuleListResponseEnvelopeSuccess bool
+
+const (
+ RuleListResponseEnvelopeSuccessTrue RuleListResponseEnvelopeSuccess = true
+)
diff --git a/snippets/rule_test.go b/snippets/rule_test.go
new file mode 100644
index 00000000000..7cc78fd6d25
--- /dev/null
+++ b/snippets/rule_test.go
@@ -0,0 +1,84 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package snippets_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/snippets"
+)
+
+func TestRuleUpdateWithOptionalParams(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"),
+ )
+ _, err := client.Snippets.Rules.Update(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ snippets.RuleUpdateParams{
+ Rules: cloudflare.F([]snippets.RuleUpdateParamsRule{{
+ Description: cloudflare.F("Rule description"),
+ Enabled: cloudflare.F(true),
+ Expression: cloudflare.F("http.cookie eq \"a=b\""),
+ SnippetName: cloudflare.F("snippet_name_01"),
+ }, {
+ Description: cloudflare.F("Rule description"),
+ Enabled: cloudflare.F(true),
+ Expression: cloudflare.F("http.cookie eq \"a=b\""),
+ SnippetName: cloudflare.F("snippet_name_01"),
+ }, {
+ Description: cloudflare.F("Rule description"),
+ Enabled: cloudflare.F(true),
+ Expression: cloudflare.F("http.cookie eq \"a=b\""),
+ SnippetName: cloudflare.F("snippet_name_01"),
+ }}),
+ },
+ )
+ 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())
+ }
+}
+
+func TestRuleList(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"),
+ )
+ _, err := client.Snippets.Rules.List(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353")
+ 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/snippet.go b/snippets/snippet.go
similarity index 84%
rename from snippet.go
rename to snippets/snippet.go
index 4e60b9b01d1..906a82b34e7 100644
--- a/snippet.go
+++ b/snippets/snippet.go
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package cloudflare
+package snippets
import (
"context"
@@ -22,8 +22,8 @@ import (
// service directly, and instead use the [NewSnippetService] method instead.
type SnippetService struct {
Options []option.RequestOption
- Content *SnippetContentService
- Rules *SnippetRuleService
+ Content *ContentService
+ Rules *RuleService
}
// NewSnippetService generates a new service that applies the given options to each
@@ -32,13 +32,13 @@ type SnippetService struct {
func NewSnippetService(opts ...option.RequestOption) (r *SnippetService) {
r = &SnippetService{}
r.Options = opts
- r.Content = NewSnippetContentService(opts...)
- r.Rules = NewSnippetRuleService(opts...)
+ r.Content = NewContentService(opts...)
+ r.Rules = NewRuleService(opts...)
return
}
// Put Snippet
-func (r *SnippetService) Update(ctx context.Context, zoneIdentifier string, snippetName string, body SnippetUpdateParams, opts ...option.RequestOption) (res *SnippetUpdateResponse, err error) {
+func (r *SnippetService) Update(ctx context.Context, zoneIdentifier string, snippetName string, body SnippetUpdateParams, opts ...option.RequestOption) (res *Snippet, err error) {
opts = append(r.Options[:], opts...)
var env SnippetUpdateResponseEnvelope
path := fmt.Sprintf("zones/%s/snippets/%s", zoneIdentifier, snippetName)
@@ -51,7 +51,7 @@ func (r *SnippetService) Update(ctx context.Context, zoneIdentifier string, snip
}
// All Snippets
-func (r *SnippetService) List(ctx context.Context, zoneIdentifier string, opts ...option.RequestOption) (res *[]SnippetListResponse, err error) {
+func (r *SnippetService) List(ctx context.Context, zoneIdentifier string, opts ...option.RequestOption) (res *[]Snippet, err error) {
opts = append(r.Options[:], opts...)
var env SnippetListResponseEnvelope
path := fmt.Sprintf("zones/%s/snippets", zoneIdentifier)
@@ -77,7 +77,7 @@ func (r *SnippetService) Delete(ctx context.Context, zoneIdentifier string, snip
}
// Snippet
-func (r *SnippetService) Get(ctx context.Context, zoneIdentifier string, snippetName string, opts ...option.RequestOption) (res *SnippetGetResponse, err error) {
+func (r *SnippetService) Get(ctx context.Context, zoneIdentifier string, snippetName string, opts ...option.RequestOption) (res *Snippet, err error) {
opts = append(r.Options[:], opts...)
var env SnippetGetResponseEnvelope
path := fmt.Sprintf("zones/%s/snippets/%s", zoneIdentifier, snippetName)
@@ -90,19 +90,18 @@ func (r *SnippetService) Get(ctx context.Context, zoneIdentifier string, snippet
}
// Snippet Information
-type SnippetUpdateResponse struct {
+type Snippet struct {
// Creation time of the snippet
CreatedOn string `json:"created_on"`
// Modification time of the snippet
ModifiedOn string `json:"modified_on"`
// Snippet identifying name
- SnippetName string `json:"snippet_name"`
- JSON snippetUpdateResponseJSON `json:"-"`
+ SnippetName string `json:"snippet_name"`
+ JSON snippetJSON `json:"-"`
}
-// snippetUpdateResponseJSON contains the JSON metadata for the struct
-// [SnippetUpdateResponse]
-type snippetUpdateResponseJSON struct {
+// snippetJSON contains the JSON metadata for the struct [Snippet]
+type snippetJSON struct {
CreatedOn apijson.Field
ModifiedOn apijson.Field
SnippetName apijson.Field
@@ -110,47 +109,18 @@ type snippetUpdateResponseJSON struct {
ExtraFields map[string]apijson.Field
}
-func (r *SnippetUpdateResponse) UnmarshalJSON(data []byte) (err error) {
+func (r *Snippet) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
-func (r snippetUpdateResponseJSON) RawJSON() string {
+func (r snippetJSON) RawJSON() string {
return r.raw
}
-// Snippet Information
-type SnippetListResponse struct {
- // Creation time of the snippet
- CreatedOn string `json:"created_on"`
- // Modification time of the snippet
- ModifiedOn string `json:"modified_on"`
- // Snippet identifying name
- SnippetName string `json:"snippet_name"`
- JSON snippetListResponseJSON `json:"-"`
-}
-
-// snippetListResponseJSON contains the JSON metadata for the struct
-// [SnippetListResponse]
-type snippetListResponseJSON struct {
- CreatedOn apijson.Field
- ModifiedOn apijson.Field
- SnippetName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SnippetListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r snippetListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// Union satisfied by [SnippetDeleteResponseUnknown], [SnippetDeleteResponseArray]
-// or [shared.UnionString].
+// Union satisfied by [snippets.SnippetDeleteResponseUnknown],
+// [snippets.SnippetDeleteResponseArray] or [shared.UnionString].
type SnippetDeleteResponse interface {
- ImplementsSnippetDeleteResponse()
+ ImplementsSnippetsSnippetDeleteResponse()
}
func init() {
@@ -170,36 +140,7 @@ func init() {
type SnippetDeleteResponseArray []interface{}
-func (r SnippetDeleteResponseArray) ImplementsSnippetDeleteResponse() {}
-
-// Snippet Information
-type SnippetGetResponse struct {
- // Creation time of the snippet
- CreatedOn string `json:"created_on"`
- // Modification time of the snippet
- ModifiedOn string `json:"modified_on"`
- // Snippet identifying name
- SnippetName string `json:"snippet_name"`
- JSON snippetGetResponseJSON `json:"-"`
-}
-
-// snippetGetResponseJSON contains the JSON metadata for the struct
-// [SnippetGetResponse]
-type snippetGetResponseJSON struct {
- CreatedOn apijson.Field
- ModifiedOn apijson.Field
- SnippetName apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SnippetGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r snippetGetResponseJSON) RawJSON() string {
- return r.raw
-}
+func (r SnippetDeleteResponseArray) ImplementsSnippetsSnippetDeleteResponse() {}
type SnippetUpdateParams struct {
// Content files of uploaded snippet
@@ -224,7 +165,7 @@ type SnippetUpdateResponseEnvelope struct {
Errors []SnippetUpdateResponseEnvelopeErrors `json:"errors,required"`
Messages []SnippetUpdateResponseEnvelopeMessages `json:"messages,required"`
// Snippet Information
- Result SnippetUpdateResponse `json:"result,required"`
+ Result Snippet `json:"result,required"`
// Whether the API call was successful
Success SnippetUpdateResponseEnvelopeSuccess `json:"success,required"`
JSON snippetUpdateResponseEnvelopeJSON `json:"-"`
@@ -306,7 +247,7 @@ type SnippetListResponseEnvelope struct {
Errors []SnippetListResponseEnvelopeErrors `json:"errors,required"`
Messages []SnippetListResponseEnvelopeMessages `json:"messages,required"`
// List of all zone snippets
- Result []SnippetListResponse `json:"result,required"`
+ Result []Snippet `json:"result,required"`
// Whether the API call was successful
Success SnippetListResponseEnvelopeSuccess `json:"success,required"`
JSON snippetListResponseEnvelopeJSON `json:"-"`
@@ -469,7 +410,7 @@ type SnippetGetResponseEnvelope struct {
Errors []SnippetGetResponseEnvelopeErrors `json:"errors,required"`
Messages []SnippetGetResponseEnvelopeMessages `json:"messages,required"`
// Snippet Information
- Result SnippetGetResponse `json:"result,required"`
+ Result Snippet `json:"result,required"`
// Whether the API call was successful
Success SnippetGetResponseEnvelopeSuccess `json:"success,required"`
JSON snippetGetResponseEnvelopeJSON `json:"-"`
diff --git a/snippet_test.go b/snippets/snippet_test.go
similarity index 95%
rename from snippet_test.go
rename to snippets/snippet_test.go
index f53a6835681..fcbecb9ed54 100644
--- a/snippet_test.go
+++ b/snippets/snippet_test.go
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package cloudflare_test
+package snippets_test
import (
"context"
@@ -11,6 +11,7 @@ import (
"github.com/cloudflare/cloudflare-go"
"github.com/cloudflare/cloudflare-go/internal/testutil"
"github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/snippets"
)
func TestSnippetUpdateWithOptionalParams(t *testing.T) {
@@ -31,9 +32,9 @@ func TestSnippetUpdateWithOptionalParams(t *testing.T) {
context.TODO(),
"023e105f4ecef8ad9ca31a8372d0c353",
"snippet_name_01",
- cloudflare.SnippetUpdateParams{
+ snippets.SnippetUpdateParams{
Files: cloudflare.F("export { async function fetch(request, env) {return new Response('some_response') } }"),
- Metadata: cloudflare.F(cloudflare.SnippetUpdateParamsMetadata{
+ Metadata: cloudflare.F(snippets.SnippetUpdateParamsMetadata{
MainModule: cloudflare.F("main.js"),
}),
},
diff --git a/spectrum/aliases.go b/spectrum/aliases.go
new file mode 100644
index 00000000000..6ad4914a7af
--- /dev/null
+++ b/spectrum/aliases.go
@@ -0,0 +1,9 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package spectrum
+
+import (
+ "github.com/cloudflare/cloudflare-go/internal/apierror"
+)
+
+type Error = apierror.Error
diff --git a/spectrum/analytics.go b/spectrum/analytics.go
new file mode 100644
index 00000000000..f760e846bdc
--- /dev/null
+++ b/spectrum/analytics.go
@@ -0,0 +1,28 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package spectrum
+
+import (
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// AnalyticsService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewAnalyticsService] method instead.
+type AnalyticsService struct {
+ Options []option.RequestOption
+ Aggregates *AnalyticsAggregateService
+ Events *AnalyticsEventService
+}
+
+// NewAnalyticsService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewAnalyticsService(opts ...option.RequestOption) (r *AnalyticsService) {
+ r = &AnalyticsService{}
+ r.Options = opts
+ r.Aggregates = NewAnalyticsAggregateService(opts...)
+ r.Events = NewAnalyticsEventService(opts...)
+ return
+}
diff --git a/spectrum/analyticsaggregate.go b/spectrum/analyticsaggregate.go
new file mode 100644
index 00000000000..6412cea7e74
--- /dev/null
+++ b/spectrum/analyticsaggregate.go
@@ -0,0 +1,27 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package spectrum
+
+import (
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// AnalyticsAggregateService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewAnalyticsAggregateService] method
+// instead.
+type AnalyticsAggregateService struct {
+ Options []option.RequestOption
+ Currents *AnalyticsAggregateCurrentService
+}
+
+// NewAnalyticsAggregateService generates a new service that applies the given
+// options to each request. These options are applied after the parent client's
+// options (if there is one), and before any request-specific options.
+func NewAnalyticsAggregateService(opts ...option.RequestOption) (r *AnalyticsAggregateService) {
+ r = &AnalyticsAggregateService{}
+ r.Options = opts
+ r.Currents = NewAnalyticsAggregateCurrentService(opts...)
+ return
+}
diff --git a/spectrum/analyticsaggregatecurrent.go b/spectrum/analyticsaggregatecurrent.go
new file mode 100644
index 00000000000..b631f3d11db
--- /dev/null
+++ b/spectrum/analyticsaggregatecurrent.go
@@ -0,0 +1,151 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package spectrum
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// AnalyticsAggregateCurrentService contains methods and other services that help
+// with interacting with the cloudflare API. Note, unlike clients, this service
+// does not read variables from the environment automatically. You should not
+// instantiate this service directly, and instead use the
+// [NewAnalyticsAggregateCurrentService] method instead.
+type AnalyticsAggregateCurrentService struct {
+ Options []option.RequestOption
+}
+
+// NewAnalyticsAggregateCurrentService generates a new service that applies the
+// given options to each request. These options are applied after the parent
+// client's options (if there is one), and before any request-specific options.
+func NewAnalyticsAggregateCurrentService(opts ...option.RequestOption) (r *AnalyticsAggregateCurrentService) {
+ r = &AnalyticsAggregateCurrentService{}
+ r.Options = opts
+ return
+}
+
+// Retrieves analytics aggregated from the last minute of usage on Spectrum
+// applications underneath a given zone.
+func (r *AnalyticsAggregateCurrentService) Get(ctx context.Context, zone string, query AnalyticsAggregateCurrentGetParams, opts ...option.RequestOption) (res *[]AnalyticsAggregateCurrentGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AnalyticsAggregateCurrentGetResponseEnvelope
+ path := fmt.Sprintf("zones/%s/spectrum/analytics/aggregate/current", zone)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type AnalyticsAggregateCurrentGetResponse = interface{}
+
+type AnalyticsAggregateCurrentGetParams struct {
+ // Comma-delimited list of Spectrum Application Id(s). If provided, the response
+ // will be limited to Spectrum Application Id(s) that match.
+ AppIDParam param.Field[string] `query:"app_id_param"`
+ // Comma-delimited list of Spectrum Application Id(s). If provided, the response
+ // will be limited to Spectrum Application Id(s) that match.
+ AppID param.Field[string] `query:"appID"`
+ // Co-location identifier.
+ ColoName param.Field[string] `query:"colo_name"`
+}
+
+// URLQuery serializes [AnalyticsAggregateCurrentGetParams]'s query parameters as
+// `url.Values`.
+func (r AnalyticsAggregateCurrentGetParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type AnalyticsAggregateCurrentGetResponseEnvelope struct {
+ Errors []AnalyticsAggregateCurrentGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []AnalyticsAggregateCurrentGetResponseEnvelopeMessages `json:"messages,required"`
+ Result []AnalyticsAggregateCurrentGetResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success AnalyticsAggregateCurrentGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON analyticsAggregateCurrentGetResponseEnvelopeJSON `json:"-"`
+}
+
+// analyticsAggregateCurrentGetResponseEnvelopeJSON contains the JSON metadata for
+// the struct [AnalyticsAggregateCurrentGetResponseEnvelope]
+type analyticsAggregateCurrentGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AnalyticsAggregateCurrentGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r analyticsAggregateCurrentGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AnalyticsAggregateCurrentGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON analyticsAggregateCurrentGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// analyticsAggregateCurrentGetResponseEnvelopeErrorsJSON contains the JSON
+// metadata for the struct [AnalyticsAggregateCurrentGetResponseEnvelopeErrors]
+type analyticsAggregateCurrentGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AnalyticsAggregateCurrentGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r analyticsAggregateCurrentGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type AnalyticsAggregateCurrentGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON analyticsAggregateCurrentGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// analyticsAggregateCurrentGetResponseEnvelopeMessagesJSON contains the JSON
+// metadata for the struct [AnalyticsAggregateCurrentGetResponseEnvelopeMessages]
+type analyticsAggregateCurrentGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AnalyticsAggregateCurrentGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r analyticsAggregateCurrentGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type AnalyticsAggregateCurrentGetResponseEnvelopeSuccess bool
+
+const (
+ AnalyticsAggregateCurrentGetResponseEnvelopeSuccessTrue AnalyticsAggregateCurrentGetResponseEnvelopeSuccess = true
+)
diff --git a/spectrum/analyticsaggregatecurrent_test.go b/spectrum/analyticsaggregatecurrent_test.go
new file mode 100644
index 00000000000..624e7373497
--- /dev/null
+++ b/spectrum/analyticsaggregatecurrent_test.go
@@ -0,0 +1,47 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package spectrum_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/spectrum"
+)
+
+func TestAnalyticsAggregateCurrentGetWithOptionalParams(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"),
+ )
+ _, err := client.Spectrum.Analytics.Aggregates.Currents.Get(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ spectrum.AnalyticsAggregateCurrentGetParams{
+ AppIDParam: cloudflare.F("ea95132c15732412d22c1476fa83f27a,d122c5f4bb71e25cc9e86ab43b142e2f"),
+ AppID: cloudflare.F("ea95132c15732412d22c1476fa83f27a,d122c5f4bb71e25cc9e86ab43b142e2f"),
+ ColoName: cloudflare.F("PDX"),
+ },
+ )
+ 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/spectrum/analyticsevent.go b/spectrum/analyticsevent.go
new file mode 100644
index 00000000000..6ab98029fc5
--- /dev/null
+++ b/spectrum/analyticsevent.go
@@ -0,0 +1,29 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package spectrum
+
+import (
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// AnalyticsEventService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewAnalyticsEventService] method
+// instead.
+type AnalyticsEventService struct {
+ Options []option.RequestOption
+ Bytimes *AnalyticsEventBytimeService
+ Summaries *AnalyticsEventSummaryService
+}
+
+// NewAnalyticsEventService generates a new service that applies the given options
+// to each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewAnalyticsEventService(opts ...option.RequestOption) (r *AnalyticsEventService) {
+ r = &AnalyticsEventService{}
+ r.Options = opts
+ r.Bytimes = NewAnalyticsEventBytimeService(opts...)
+ r.Summaries = NewAnalyticsEventSummaryService(opts...)
+ return
+}
diff --git a/spectrum/analyticseventbytime.go b/spectrum/analyticseventbytime.go
new file mode 100644
index 00000000000..ceb1a40a104
--- /dev/null
+++ b/spectrum/analyticseventbytime.go
@@ -0,0 +1,244 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package spectrum
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+ "reflect"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/tidwall/gjson"
+)
+
+// AnalyticsEventBytimeService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewAnalyticsEventBytimeService]
+// method instead.
+type AnalyticsEventBytimeService struct {
+ Options []option.RequestOption
+}
+
+// NewAnalyticsEventBytimeService generates a new service that applies the given
+// options to each request. These options are applied after the parent client's
+// options (if there is one), and before any request-specific options.
+func NewAnalyticsEventBytimeService(opts ...option.RequestOption) (r *AnalyticsEventBytimeService) {
+ r = &AnalyticsEventBytimeService{}
+ r.Options = opts
+ return
+}
+
+// Retrieves a list of aggregate metrics grouped by time interval.
+func (r *AnalyticsEventBytimeService) Get(ctx context.Context, zone string, query AnalyticsEventBytimeGetParams, opts ...option.RequestOption) (res *AnalyticsEventBytimeGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AnalyticsEventBytimeGetResponseEnvelope
+ path := fmt.Sprintf("zones/%s/spectrum/analytics/events/bytime", zone)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Union satisfied by [spectrum.AnalyticsEventBytimeGetResponseUnknown] or
+// [shared.UnionString].
+type AnalyticsEventBytimeGetResponse interface {
+ ImplementsSpectrumAnalyticsEventBytimeGetResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*AnalyticsEventBytimeGetResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+type AnalyticsEventBytimeGetParams struct {
+ // Can be used to break down the data by given attributes. Options are:
+ //
+ // | Dimension | Name | Example |
+ // | --------- | ----------------------------- | ---------------------------------------------------------- |
+ // | event | Connection Event | connect, progress, disconnect, originError, clientFiltered |
+ // | appID | Application ID | 40d67c87c6cd4b889a4fd57805225e85 |
+ // | coloName | Colo Name | SFO |
+ // | ipVersion | IP version used by the client | 4, 6. |
+ Dimensions param.Field[[]AnalyticsEventBytimeGetParamsDimension] `query:"dimensions"`
+ // Used to filter rows by one or more dimensions. Filters can be combined using OR
+ // and AND boolean logic. AND takes precedence over OR in all the expressions. The
+ // OR operator is defined using a comma (,) or OR keyword surrounded by whitespace.
+ // The AND operator is defined using a semicolon (;) or AND keyword surrounded by
+ // whitespace. Note that the semicolon is a reserved character in URLs (rfc1738)
+ // and needs to be percent-encoded as %3B. Comparison options are:
+ //
+ // | Operator | Name | URL Encoded |
+ // | -------- | ------------------------ | ----------- |
+ // | == | Equals | %3D%3D |
+ // | != | Does not equals | !%3D |
+ // | > | Greater Than | %3E |
+ // | < | Less Than | %3C |
+ // | >= | Greater than or equal to | %3E%3D |
+ // | <= | Less than or equal to | %3C%3D . |
+ Filters param.Field[string] `query:"filters"`
+ // One or more metrics to compute. Options are:
+ //
+ // | Metric | Name | Example | Unit |
+ // | -------------- | ----------------------------------- | ------- | --------------------- |
+ // | count | Count of total events | 1000 | Count |
+ // | bytesIngress | Sum of ingress bytes | 1000 | Sum |
+ // | bytesEgress | Sum of egress bytes | 1000 | Sum |
+ // | durationAvg | Average connection duration | 1.0 | Time in milliseconds |
+ // | durationMedian | Median connection duration | 1.0 | Time in milliseconds |
+ // | duration90th | 90th percentile connection duration | 1.0 | Time in milliseconds |
+ // | duration99th | 99th percentile connection duration | 1.0 | Time in milliseconds. |
+ Metrics param.Field[[]AnalyticsEventBytimeGetParamsMetric] `query:"metrics"`
+ // Start of time interval to query, defaults to `until` - 6 hours. Timestamp must
+ // be in RFC3339 format and uses UTC unless otherwise specified.
+ Since param.Field[time.Time] `query:"since" format:"date-time"`
+ // The sort order for the result set; sort fields must be included in `metrics` or
+ // `dimensions`.
+ Sort param.Field[[]interface{}] `query:"sort"`
+ // Used to select time series resolution.
+ TimeDelta param.Field[AnalyticsEventBytimeGetParamsTimeDelta] `query:"time_delta"`
+ // End of time interval to query, defaults to current time. Timestamp must be in
+ // RFC3339 format and uses UTC unless otherwise specified.
+ Until param.Field[time.Time] `query:"until" format:"date-time"`
+}
+
+// URLQuery serializes [AnalyticsEventBytimeGetParams]'s query parameters as
+// `url.Values`.
+func (r AnalyticsEventBytimeGetParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type AnalyticsEventBytimeGetParamsDimension string
+
+const (
+ AnalyticsEventBytimeGetParamsDimensionEvent AnalyticsEventBytimeGetParamsDimension = "event"
+ AnalyticsEventBytimeGetParamsDimensionAppID AnalyticsEventBytimeGetParamsDimension = "appID"
+ AnalyticsEventBytimeGetParamsDimensionColoName AnalyticsEventBytimeGetParamsDimension = "coloName"
+ AnalyticsEventBytimeGetParamsDimensionIPVersion AnalyticsEventBytimeGetParamsDimension = "ipVersion"
+)
+
+type AnalyticsEventBytimeGetParamsMetric string
+
+const (
+ AnalyticsEventBytimeGetParamsMetricCount AnalyticsEventBytimeGetParamsMetric = "count"
+ AnalyticsEventBytimeGetParamsMetricBytesIngress AnalyticsEventBytimeGetParamsMetric = "bytesIngress"
+ AnalyticsEventBytimeGetParamsMetricBytesEgress AnalyticsEventBytimeGetParamsMetric = "bytesEgress"
+ AnalyticsEventBytimeGetParamsMetricDurationAvg AnalyticsEventBytimeGetParamsMetric = "durationAvg"
+ AnalyticsEventBytimeGetParamsMetricDurationMedian AnalyticsEventBytimeGetParamsMetric = "durationMedian"
+ AnalyticsEventBytimeGetParamsMetricDuration90th AnalyticsEventBytimeGetParamsMetric = "duration90th"
+ AnalyticsEventBytimeGetParamsMetricDuration99th AnalyticsEventBytimeGetParamsMetric = "duration99th"
+)
+
+// Used to select time series resolution.
+type AnalyticsEventBytimeGetParamsTimeDelta string
+
+const (
+ AnalyticsEventBytimeGetParamsTimeDeltaYear AnalyticsEventBytimeGetParamsTimeDelta = "year"
+ AnalyticsEventBytimeGetParamsTimeDeltaQuarter AnalyticsEventBytimeGetParamsTimeDelta = "quarter"
+ AnalyticsEventBytimeGetParamsTimeDeltaMonth AnalyticsEventBytimeGetParamsTimeDelta = "month"
+ AnalyticsEventBytimeGetParamsTimeDeltaWeek AnalyticsEventBytimeGetParamsTimeDelta = "week"
+ AnalyticsEventBytimeGetParamsTimeDeltaDay AnalyticsEventBytimeGetParamsTimeDelta = "day"
+ AnalyticsEventBytimeGetParamsTimeDeltaHour AnalyticsEventBytimeGetParamsTimeDelta = "hour"
+ AnalyticsEventBytimeGetParamsTimeDeltaDekaminute AnalyticsEventBytimeGetParamsTimeDelta = "dekaminute"
+ AnalyticsEventBytimeGetParamsTimeDeltaMinute AnalyticsEventBytimeGetParamsTimeDelta = "minute"
+)
+
+type AnalyticsEventBytimeGetResponseEnvelope struct {
+ Errors []AnalyticsEventBytimeGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []AnalyticsEventBytimeGetResponseEnvelopeMessages `json:"messages,required"`
+ Result AnalyticsEventBytimeGetResponse `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success AnalyticsEventBytimeGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON analyticsEventBytimeGetResponseEnvelopeJSON `json:"-"`
+}
+
+// analyticsEventBytimeGetResponseEnvelopeJSON contains the JSON metadata for the
+// struct [AnalyticsEventBytimeGetResponseEnvelope]
+type analyticsEventBytimeGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AnalyticsEventBytimeGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r analyticsEventBytimeGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AnalyticsEventBytimeGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON analyticsEventBytimeGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// analyticsEventBytimeGetResponseEnvelopeErrorsJSON contains the JSON metadata for
+// the struct [AnalyticsEventBytimeGetResponseEnvelopeErrors]
+type analyticsEventBytimeGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AnalyticsEventBytimeGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r analyticsEventBytimeGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type AnalyticsEventBytimeGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON analyticsEventBytimeGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// analyticsEventBytimeGetResponseEnvelopeMessagesJSON contains the JSON metadata
+// for the struct [AnalyticsEventBytimeGetResponseEnvelopeMessages]
+type analyticsEventBytimeGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AnalyticsEventBytimeGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r analyticsEventBytimeGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type AnalyticsEventBytimeGetResponseEnvelopeSuccess bool
+
+const (
+ AnalyticsEventBytimeGetResponseEnvelopeSuccessTrue AnalyticsEventBytimeGetResponseEnvelopeSuccess = true
+)
diff --git a/spectrum/analyticseventbytime_test.go b/spectrum/analyticseventbytime_test.go
new file mode 100644
index 00000000000..074e0ba83e2
--- /dev/null
+++ b/spectrum/analyticseventbytime_test.go
@@ -0,0 +1,52 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package spectrum_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/spectrum"
+)
+
+func TestAnalyticsEventBytimeGetWithOptionalParams(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"),
+ )
+ _, err := client.Spectrum.Analytics.Events.Bytimes.Get(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ spectrum.AnalyticsEventBytimeGetParams{
+ Dimensions: cloudflare.F([]spectrum.AnalyticsEventBytimeGetParamsDimension{spectrum.AnalyticsEventBytimeGetParamsDimensionEvent, spectrum.AnalyticsEventBytimeGetParamsDimensionAppID}),
+ Filters: cloudflare.F("event==disconnect%20AND%20coloName!=SFO"),
+ Metrics: cloudflare.F([]spectrum.AnalyticsEventBytimeGetParamsMetric{spectrum.AnalyticsEventBytimeGetParamsMetricCount, spectrum.AnalyticsEventBytimeGetParamsMetricBytesIngress}),
+ Since: cloudflare.F(time.Now()),
+ Sort: cloudflare.F([]interface{}{"+count", "-bytesIngress"}),
+ TimeDelta: cloudflare.F(spectrum.AnalyticsEventBytimeGetParamsTimeDeltaMinute),
+ Until: cloudflare.F(time.Now()),
+ },
+ )
+ 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/spectrum/analyticseventsummary.go b/spectrum/analyticseventsummary.go
new file mode 100644
index 00000000000..91f57492407
--- /dev/null
+++ b/spectrum/analyticseventsummary.go
@@ -0,0 +1,228 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package spectrum
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+ "reflect"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/tidwall/gjson"
+)
+
+// AnalyticsEventSummaryService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewAnalyticsEventSummaryService]
+// method instead.
+type AnalyticsEventSummaryService struct {
+ Options []option.RequestOption
+}
+
+// NewAnalyticsEventSummaryService generates a new service that applies the given
+// options to each request. These options are applied after the parent client's
+// options (if there is one), and before any request-specific options.
+func NewAnalyticsEventSummaryService(opts ...option.RequestOption) (r *AnalyticsEventSummaryService) {
+ r = &AnalyticsEventSummaryService{}
+ r.Options = opts
+ return
+}
+
+// Retrieves a list of summarised aggregate metrics over a given time period.
+func (r *AnalyticsEventSummaryService) Get(ctx context.Context, zone string, query AnalyticsEventSummaryGetParams, opts ...option.RequestOption) (res *AnalyticsEventSummaryGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AnalyticsEventSummaryGetResponseEnvelope
+ path := fmt.Sprintf("zones/%s/spectrum/analytics/events/summary", zone)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Union satisfied by [spectrum.AnalyticsEventSummaryGetResponseUnknown] or
+// [shared.UnionString].
+type AnalyticsEventSummaryGetResponse interface {
+ ImplementsSpectrumAnalyticsEventSummaryGetResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*AnalyticsEventSummaryGetResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+type AnalyticsEventSummaryGetParams struct {
+ // Can be used to break down the data by given attributes. Options are:
+ //
+ // | Dimension | Name | Example |
+ // | --------- | ----------------------------- | ---------------------------------------------------------- |
+ // | event | Connection Event | connect, progress, disconnect, originError, clientFiltered |
+ // | appID | Application ID | 40d67c87c6cd4b889a4fd57805225e85 |
+ // | coloName | Colo Name | SFO |
+ // | ipVersion | IP version used by the client | 4, 6. |
+ Dimensions param.Field[[]AnalyticsEventSummaryGetParamsDimension] `query:"dimensions"`
+ // Used to filter rows by one or more dimensions. Filters can be combined using OR
+ // and AND boolean logic. AND takes precedence over OR in all the expressions. The
+ // OR operator is defined using a comma (,) or OR keyword surrounded by whitespace.
+ // The AND operator is defined using a semicolon (;) or AND keyword surrounded by
+ // whitespace. Note that the semicolon is a reserved character in URLs (rfc1738)
+ // and needs to be percent-encoded as %3B. Comparison options are:
+ //
+ // | Operator | Name | URL Encoded |
+ // | -------- | ------------------------ | ----------- |
+ // | == | Equals | %3D%3D |
+ // | != | Does not equals | !%3D |
+ // | > | Greater Than | %3E |
+ // | < | Less Than | %3C |
+ // | >= | Greater than or equal to | %3E%3D |
+ // | <= | Less than or equal to | %3C%3D . |
+ Filters param.Field[string] `query:"filters"`
+ // One or more metrics to compute. Options are:
+ //
+ // | Metric | Name | Example | Unit |
+ // | -------------- | ----------------------------------- | ------- | --------------------- |
+ // | count | Count of total events | 1000 | Count |
+ // | bytesIngress | Sum of ingress bytes | 1000 | Sum |
+ // | bytesEgress | Sum of egress bytes | 1000 | Sum |
+ // | durationAvg | Average connection duration | 1.0 | Time in milliseconds |
+ // | durationMedian | Median connection duration | 1.0 | Time in milliseconds |
+ // | duration90th | 90th percentile connection duration | 1.0 | Time in milliseconds |
+ // | duration99th | 99th percentile connection duration | 1.0 | Time in milliseconds. |
+ Metrics param.Field[[]AnalyticsEventSummaryGetParamsMetric] `query:"metrics"`
+ // Start of time interval to query, defaults to `until` - 6 hours. Timestamp must
+ // be in RFC3339 format and uses UTC unless otherwise specified.
+ Since param.Field[time.Time] `query:"since" format:"date-time"`
+ // The sort order for the result set; sort fields must be included in `metrics` or
+ // `dimensions`.
+ Sort param.Field[[]interface{}] `query:"sort"`
+ // End of time interval to query, defaults to current time. Timestamp must be in
+ // RFC3339 format and uses UTC unless otherwise specified.
+ Until param.Field[time.Time] `query:"until" format:"date-time"`
+}
+
+// URLQuery serializes [AnalyticsEventSummaryGetParams]'s query parameters as
+// `url.Values`.
+func (r AnalyticsEventSummaryGetParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type AnalyticsEventSummaryGetParamsDimension string
+
+const (
+ AnalyticsEventSummaryGetParamsDimensionEvent AnalyticsEventSummaryGetParamsDimension = "event"
+ AnalyticsEventSummaryGetParamsDimensionAppID AnalyticsEventSummaryGetParamsDimension = "appID"
+ AnalyticsEventSummaryGetParamsDimensionColoName AnalyticsEventSummaryGetParamsDimension = "coloName"
+ AnalyticsEventSummaryGetParamsDimensionIPVersion AnalyticsEventSummaryGetParamsDimension = "ipVersion"
+)
+
+type AnalyticsEventSummaryGetParamsMetric string
+
+const (
+ AnalyticsEventSummaryGetParamsMetricCount AnalyticsEventSummaryGetParamsMetric = "count"
+ AnalyticsEventSummaryGetParamsMetricBytesIngress AnalyticsEventSummaryGetParamsMetric = "bytesIngress"
+ AnalyticsEventSummaryGetParamsMetricBytesEgress AnalyticsEventSummaryGetParamsMetric = "bytesEgress"
+ AnalyticsEventSummaryGetParamsMetricDurationAvg AnalyticsEventSummaryGetParamsMetric = "durationAvg"
+ AnalyticsEventSummaryGetParamsMetricDurationMedian AnalyticsEventSummaryGetParamsMetric = "durationMedian"
+ AnalyticsEventSummaryGetParamsMetricDuration90th AnalyticsEventSummaryGetParamsMetric = "duration90th"
+ AnalyticsEventSummaryGetParamsMetricDuration99th AnalyticsEventSummaryGetParamsMetric = "duration99th"
+)
+
+type AnalyticsEventSummaryGetResponseEnvelope struct {
+ Errors []AnalyticsEventSummaryGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []AnalyticsEventSummaryGetResponseEnvelopeMessages `json:"messages,required"`
+ Result AnalyticsEventSummaryGetResponse `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success AnalyticsEventSummaryGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON analyticsEventSummaryGetResponseEnvelopeJSON `json:"-"`
+}
+
+// analyticsEventSummaryGetResponseEnvelopeJSON contains the JSON metadata for the
+// struct [AnalyticsEventSummaryGetResponseEnvelope]
+type analyticsEventSummaryGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AnalyticsEventSummaryGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r analyticsEventSummaryGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AnalyticsEventSummaryGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON analyticsEventSummaryGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// analyticsEventSummaryGetResponseEnvelopeErrorsJSON contains the JSON metadata
+// for the struct [AnalyticsEventSummaryGetResponseEnvelopeErrors]
+type analyticsEventSummaryGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AnalyticsEventSummaryGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r analyticsEventSummaryGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type AnalyticsEventSummaryGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON analyticsEventSummaryGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// analyticsEventSummaryGetResponseEnvelopeMessagesJSON contains the JSON metadata
+// for the struct [AnalyticsEventSummaryGetResponseEnvelopeMessages]
+type analyticsEventSummaryGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AnalyticsEventSummaryGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r analyticsEventSummaryGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type AnalyticsEventSummaryGetResponseEnvelopeSuccess bool
+
+const (
+ AnalyticsEventSummaryGetResponseEnvelopeSuccessTrue AnalyticsEventSummaryGetResponseEnvelopeSuccess = true
+)
diff --git a/spectrum/analyticseventsummary_test.go b/spectrum/analyticseventsummary_test.go
new file mode 100644
index 00000000000..f5df4cf71ce
--- /dev/null
+++ b/spectrum/analyticseventsummary_test.go
@@ -0,0 +1,51 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package spectrum_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/spectrum"
+)
+
+func TestAnalyticsEventSummaryGetWithOptionalParams(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"),
+ )
+ _, err := client.Spectrum.Analytics.Events.Summaries.Get(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ spectrum.AnalyticsEventSummaryGetParams{
+ Dimensions: cloudflare.F([]spectrum.AnalyticsEventSummaryGetParamsDimension{spectrum.AnalyticsEventSummaryGetParamsDimensionEvent, spectrum.AnalyticsEventSummaryGetParamsDimensionAppID}),
+ Filters: cloudflare.F("event==disconnect%20AND%20coloName!=SFO"),
+ Metrics: cloudflare.F([]spectrum.AnalyticsEventSummaryGetParamsMetric{spectrum.AnalyticsEventSummaryGetParamsMetricCount, spectrum.AnalyticsEventSummaryGetParamsMetricBytesIngress}),
+ Since: cloudflare.F(time.Now()),
+ Sort: cloudflare.F([]interface{}{"+count", "-bytesIngress"}),
+ Until: cloudflare.F(time.Now()),
+ },
+ )
+ 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/spectrum/app.go b/spectrum/app.go
new file mode 100644
index 00000000000..5fe86e4d102
--- /dev/null
+++ b/spectrum/app.go
@@ -0,0 +1,1566 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package spectrum
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+ "reflect"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/tidwall/gjson"
+)
+
+// AppService contains methods and other services that help with interacting with
+// the cloudflare API. Note, unlike clients, this service does not read variables
+// from the environment automatically. You should not instantiate this service
+// directly, and instead use the [NewAppService] method instead.
+type AppService struct {
+ Options []option.RequestOption
+}
+
+// NewAppService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewAppService(opts ...option.RequestOption) (r *AppService) {
+ r = &AppService{}
+ r.Options = opts
+ return
+}
+
+// Creates a new Spectrum application from a configuration using a name for the
+// origin.
+func (r *AppService) New(ctx context.Context, zone string, body AppNewParams, opts ...option.RequestOption) (res *AppNewResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AppNewResponseEnvelope
+ path := fmt.Sprintf("zones/%s/spectrum/apps", zone)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Updates a previously existing application's configuration that uses a name for
+// the origin.
+func (r *AppService) Update(ctx context.Context, zone string, appID string, body AppUpdateParams, opts ...option.RequestOption) (res *AppUpdateResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AppUpdateResponseEnvelope
+ path := fmt.Sprintf("zones/%s/spectrum/apps/%s", zone, appID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Retrieves a list of currently existing Spectrum applications inside a zone.
+func (r *AppService) List(ctx context.Context, zone string, query AppListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[AppListResponse], err error) {
+ var raw *http.Response
+ opts = append(r.Options, opts...)
+ opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
+ path := fmt.Sprintf("zones/%s/spectrum/apps", zone)
+ cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...)
+ if err != nil {
+ return nil, err
+ }
+ err = cfg.Execute()
+ if err != nil {
+ return nil, err
+ }
+ res.SetPageConfig(cfg, raw)
+ return res, nil
+}
+
+// Retrieves a list of currently existing Spectrum applications inside a zone.
+func (r *AppService) ListAutoPaging(ctx context.Context, zone string, query AppListParams, opts ...option.RequestOption) *shared.V4PagePaginationArrayAutoPager[AppListResponse] {
+ return shared.NewV4PagePaginationArrayAutoPager(r.List(ctx, zone, query, opts...))
+}
+
+// Deletes a previously existing application.
+func (r *AppService) Delete(ctx context.Context, zone string, appID string, opts ...option.RequestOption) (res *AppDeleteResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AppDeleteResponseEnvelope
+ path := fmt.Sprintf("zones/%s/spectrum/apps/%s", zone, appID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Gets the application configuration of a specific application inside a zone.
+func (r *AppService) Get(ctx context.Context, zone string, appID string, opts ...option.RequestOption) (res *AppGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AppGetResponseEnvelope
+ path := fmt.Sprintf("zones/%s/spectrum/apps/%s", zone, appID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type AppNewResponse struct {
+ // Application identifier.
+ ID string `json:"id"`
+ // Enables Argo Smart Routing for this application. Notes: Only available for TCP
+ // applications with traffic_type set to "direct".
+ ArgoSmartRouting bool `json:"argo_smart_routing"`
+ // When the Application was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // The name and type of DNS record for the Spectrum application.
+ DNS AppNewResponseDNS `json:"dns"`
+ // The anycast edge IP configuration for the hostname of this application.
+ EdgeIPs AppNewResponseEdgeIPs `json:"edge_ips"`
+ // Enables IP Access Rules for this application. Notes: Only available for TCP
+ // applications.
+ IPFirewall bool `json:"ip_firewall"`
+ // When the Application was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // The name and type of DNS record for the Spectrum application.
+ OriginDNS AppNewResponseOriginDNS `json:"origin_dns"`
+ // The destination port at the origin. Only specified in conjunction with
+ // origin_dns. May use an integer to specify a single origin port, for example
+ // `1000`, or a string to specify a range of origin ports, for example
+ // `"1000-2000"`. Notes: If specifying a port range, the number of ports in the
+ // range must match the number of ports specified in the "protocol" field.
+ OriginPort AppNewResponseOriginPort `json:"origin_port"`
+ // The port configuration at Cloudflare’s edge. May specify a single port, for
+ // example `"tcp/1000"`, or a range of ports, for example `"tcp/1000-2000"`.
+ Protocol string `json:"protocol"`
+ // Enables Proxy Protocol to the origin. Refer to
+ // [Enable Proxy protocol](https://developers.cloudflare.com/spectrum/getting-started/proxy-protocol/)
+ // for implementation details on PROXY Protocol V1, PROXY Protocol V2, and Simple
+ // Proxy Protocol.
+ ProxyProtocol AppNewResponseProxyProtocol `json:"proxy_protocol"`
+ // The type of TLS termination associated with the application.
+ TLS AppNewResponseTLS `json:"tls"`
+ // Determines how data travels from the edge to your origin. When set to "direct",
+ // Spectrum will send traffic directly to your origin, and the application's type
+ // is derived from the `protocol`. When set to "http" or "https", Spectrum will
+ // apply Cloudflare's HTTP/HTTPS features as it sends traffic to your origin, and
+ // the application type matches this property exactly.
+ TrafficType AppNewResponseTrafficType `json:"traffic_type"`
+ JSON appNewResponseJSON `json:"-"`
+}
+
+// appNewResponseJSON contains the JSON metadata for the struct [AppNewResponse]
+type appNewResponseJSON struct {
+ ID apijson.Field
+ ArgoSmartRouting apijson.Field
+ CreatedOn apijson.Field
+ DNS apijson.Field
+ EdgeIPs apijson.Field
+ IPFirewall apijson.Field
+ ModifiedOn apijson.Field
+ OriginDNS apijson.Field
+ OriginPort apijson.Field
+ Protocol apijson.Field
+ ProxyProtocol apijson.Field
+ TLS apijson.Field
+ TrafficType apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AppNewResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r appNewResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+// The name and type of DNS record for the Spectrum application.
+type AppNewResponseDNS struct {
+ // The name of the DNS record associated with the application.
+ Name string `json:"name" format:"hostname"`
+ // The type of DNS record associated with the application.
+ Type AppNewResponseDNSType `json:"type"`
+ JSON appNewResponseDNSJSON `json:"-"`
+}
+
+// appNewResponseDNSJSON contains the JSON metadata for the struct
+// [AppNewResponseDNS]
+type appNewResponseDNSJSON struct {
+ Name apijson.Field
+ Type apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AppNewResponseDNS) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r appNewResponseDNSJSON) RawJSON() string {
+ return r.raw
+}
+
+// The type of DNS record associated with the application.
+type AppNewResponseDNSType string
+
+const (
+ AppNewResponseDNSTypeCNAME AppNewResponseDNSType = "CNAME"
+ AppNewResponseDNSTypeAddress AppNewResponseDNSType = "ADDRESS"
+)
+
+// The anycast edge IP configuration for the hostname of this application.
+//
+// Union satisfied by
+// [spectrum.AppNewResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariable] or
+// [spectrum.AppNewResponseEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariable].
+type AppNewResponseEdgeIPs interface {
+ implementsSpectrumAppNewResponseEdgeIPs()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*AppNewResponseEdgeIPs)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(AppNewResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariable{}),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(AppNewResponseEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariable{}),
+ },
+ )
+}
+
+type AppNewResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariable struct {
+ // The IP versions supported for inbound connections on Spectrum anycast IPs.
+ Connectivity AppNewResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariableConnectivity `json:"connectivity"`
+ // The type of edge IP configuration specified. Dynamically allocated edge IPs use
+ // Spectrum anycast IPs in accordance with the connectivity you specify. Only valid
+ // with CNAME DNS names.
+ Type AppNewResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariableType `json:"type"`
+ JSON appNewResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariableJSON `json:"-"`
+}
+
+// appNewResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariableJSON contains the JSON
+// metadata for the struct [AppNewResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariable]
+type appNewResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariableJSON struct {
+ Connectivity apijson.Field
+ Type apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AppNewResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariable) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r appNewResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariableJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r AppNewResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariable) implementsSpectrumAppNewResponseEdgeIPs() {
+}
+
+// The IP versions supported for inbound connections on Spectrum anycast IPs.
+type AppNewResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariableConnectivity string
+
+const (
+ AppNewResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariableConnectivityAll AppNewResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariableConnectivity = "all"
+ AppNewResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariableConnectivityIPV4 AppNewResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariableConnectivity = "ipv4"
+ AppNewResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariableConnectivityIPV6 AppNewResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariableConnectivity = "ipv6"
+)
+
+// The type of edge IP configuration specified. Dynamically allocated edge IPs use
+// Spectrum anycast IPs in accordance with the connectivity you specify. Only valid
+// with CNAME DNS names.
+type AppNewResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariableType string
+
+const (
+ AppNewResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariableTypeDynamic AppNewResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariableType = "dynamic"
+)
+
+type AppNewResponseEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariable struct {
+ // The array of customer owned IPs we broadcast via anycast for this hostname and
+ // application.
+ IPs []string `json:"ips"`
+ // The type of edge IP configuration specified. Statically allocated edge IPs use
+ // customer IPs in accordance with the ips array you specify. Only valid with
+ // ADDRESS DNS names.
+ Type AppNewResponseEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariableType `json:"type"`
+ JSON appNewResponseEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariableJSON `json:"-"`
+}
+
+// appNewResponseEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariableJSON contains the
+// JSON metadata for the struct
+// [AppNewResponseEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariable]
+type appNewResponseEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariableJSON struct {
+ IPs apijson.Field
+ Type apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AppNewResponseEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariable) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r appNewResponseEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariableJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r AppNewResponseEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariable) implementsSpectrumAppNewResponseEdgeIPs() {
+}
+
+// The type of edge IP configuration specified. Statically allocated edge IPs use
+// customer IPs in accordance with the ips array you specify. Only valid with
+// ADDRESS DNS names.
+type AppNewResponseEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariableType string
+
+const (
+ AppNewResponseEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariableTypeStatic AppNewResponseEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariableType = "static"
+)
+
+// The name and type of DNS record for the Spectrum application.
+type AppNewResponseOriginDNS struct {
+ // The name of the DNS record associated with the origin.
+ Name string `json:"name" format:"hostname"`
+ // The TTL of our resolution of your DNS record in seconds.
+ TTL int64 `json:"ttl"`
+ // The type of DNS record associated with the origin. "" is used to specify a
+ // combination of A/AAAA records.
+ Type AppNewResponseOriginDNSType `json:"type"`
+ JSON appNewResponseOriginDNSJSON `json:"-"`
+}
+
+// appNewResponseOriginDNSJSON contains the JSON metadata for the struct
+// [AppNewResponseOriginDNS]
+type appNewResponseOriginDNSJSON struct {
+ Name apijson.Field
+ TTL apijson.Field
+ Type apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AppNewResponseOriginDNS) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r appNewResponseOriginDNSJSON) RawJSON() string {
+ return r.raw
+}
+
+// The type of DNS record associated with the origin. "" is used to specify a
+// combination of A/AAAA records.
+type AppNewResponseOriginDNSType string
+
+const (
+ AppNewResponseOriginDNSTypeEmpty AppNewResponseOriginDNSType = ""
+ AppNewResponseOriginDNSTypeA AppNewResponseOriginDNSType = "A"
+ AppNewResponseOriginDNSTypeAAAA AppNewResponseOriginDNSType = "AAAA"
+ AppNewResponseOriginDNSTypeSRV AppNewResponseOriginDNSType = "SRV"
+)
+
+// The destination port at the origin. Only specified in conjunction with
+// origin_dns. May use an integer to specify a single origin port, for example
+// `1000`, or a string to specify a range of origin ports, for example
+// `"1000-2000"`. Notes: If specifying a port range, the number of ports in the
+// range must match the number of ports specified in the "protocol" field.
+//
+// Union satisfied by [shared.UnionInt] or [shared.UnionString].
+type AppNewResponseOriginPort interface {
+ ImplementsSpectrumAppNewResponseOriginPort()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*AppNewResponseOriginPort)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionInt(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+// Enables Proxy Protocol to the origin. Refer to
+// [Enable Proxy protocol](https://developers.cloudflare.com/spectrum/getting-started/proxy-protocol/)
+// for implementation details on PROXY Protocol V1, PROXY Protocol V2, and Simple
+// Proxy Protocol.
+type AppNewResponseProxyProtocol string
+
+const (
+ AppNewResponseProxyProtocolOff AppNewResponseProxyProtocol = "off"
+ AppNewResponseProxyProtocolV1 AppNewResponseProxyProtocol = "v1"
+ AppNewResponseProxyProtocolV2 AppNewResponseProxyProtocol = "v2"
+ AppNewResponseProxyProtocolSimple AppNewResponseProxyProtocol = "simple"
+)
+
+// The type of TLS termination associated with the application.
+type AppNewResponseTLS string
+
+const (
+ AppNewResponseTLSOff AppNewResponseTLS = "off"
+ AppNewResponseTLSFlexible AppNewResponseTLS = "flexible"
+ AppNewResponseTLSFull AppNewResponseTLS = "full"
+ AppNewResponseTLSStrict AppNewResponseTLS = "strict"
+)
+
+// Determines how data travels from the edge to your origin. When set to "direct",
+// Spectrum will send traffic directly to your origin, and the application's type
+// is derived from the `protocol`. When set to "http" or "https", Spectrum will
+// apply Cloudflare's HTTP/HTTPS features as it sends traffic to your origin, and
+// the application type matches this property exactly.
+type AppNewResponseTrafficType string
+
+const (
+ AppNewResponseTrafficTypeDirect AppNewResponseTrafficType = "direct"
+ AppNewResponseTrafficTypeHTTP AppNewResponseTrafficType = "http"
+ AppNewResponseTrafficTypeHTTPS AppNewResponseTrafficType = "https"
+)
+
+type AppUpdateResponse struct {
+ // Application identifier.
+ ID string `json:"id"`
+ // Enables Argo Smart Routing for this application. Notes: Only available for TCP
+ // applications with traffic_type set to "direct".
+ ArgoSmartRouting bool `json:"argo_smart_routing"`
+ // When the Application was created.
+ CreatedOn time.Time `json:"created_on" format:"date-time"`
+ // The name and type of DNS record for the Spectrum application.
+ DNS AppUpdateResponseDNS `json:"dns"`
+ // The anycast edge IP configuration for the hostname of this application.
+ EdgeIPs AppUpdateResponseEdgeIPs `json:"edge_ips"`
+ // Enables IP Access Rules for this application. Notes: Only available for TCP
+ // applications.
+ IPFirewall bool `json:"ip_firewall"`
+ // When the Application was last modified.
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ // The name and type of DNS record for the Spectrum application.
+ OriginDNS AppUpdateResponseOriginDNS `json:"origin_dns"`
+ // The destination port at the origin. Only specified in conjunction with
+ // origin_dns. May use an integer to specify a single origin port, for example
+ // `1000`, or a string to specify a range of origin ports, for example
+ // `"1000-2000"`. Notes: If specifying a port range, the number of ports in the
+ // range must match the number of ports specified in the "protocol" field.
+ OriginPort AppUpdateResponseOriginPort `json:"origin_port"`
+ // The port configuration at Cloudflare’s edge. May specify a single port, for
+ // example `"tcp/1000"`, or a range of ports, for example `"tcp/1000-2000"`.
+ Protocol string `json:"protocol"`
+ // Enables Proxy Protocol to the origin. Refer to
+ // [Enable Proxy protocol](https://developers.cloudflare.com/spectrum/getting-started/proxy-protocol/)
+ // for implementation details on PROXY Protocol V1, PROXY Protocol V2, and Simple
+ // Proxy Protocol.
+ ProxyProtocol AppUpdateResponseProxyProtocol `json:"proxy_protocol"`
+ // The type of TLS termination associated with the application.
+ TLS AppUpdateResponseTLS `json:"tls"`
+ // Determines how data travels from the edge to your origin. When set to "direct",
+ // Spectrum will send traffic directly to your origin, and the application's type
+ // is derived from the `protocol`. When set to "http" or "https", Spectrum will
+ // apply Cloudflare's HTTP/HTTPS features as it sends traffic to your origin, and
+ // the application type matches this property exactly.
+ TrafficType AppUpdateResponseTrafficType `json:"traffic_type"`
+ JSON appUpdateResponseJSON `json:"-"`
+}
+
+// appUpdateResponseJSON contains the JSON metadata for the struct
+// [AppUpdateResponse]
+type appUpdateResponseJSON struct {
+ ID apijson.Field
+ ArgoSmartRouting apijson.Field
+ CreatedOn apijson.Field
+ DNS apijson.Field
+ EdgeIPs apijson.Field
+ IPFirewall apijson.Field
+ ModifiedOn apijson.Field
+ OriginDNS apijson.Field
+ OriginPort apijson.Field
+ Protocol apijson.Field
+ ProxyProtocol apijson.Field
+ TLS apijson.Field
+ TrafficType apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AppUpdateResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r appUpdateResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+// The name and type of DNS record for the Spectrum application.
+type AppUpdateResponseDNS struct {
+ // The name of the DNS record associated with the application.
+ Name string `json:"name" format:"hostname"`
+ // The type of DNS record associated with the application.
+ Type AppUpdateResponseDNSType `json:"type"`
+ JSON appUpdateResponseDNSJSON `json:"-"`
+}
+
+// appUpdateResponseDNSJSON contains the JSON metadata for the struct
+// [AppUpdateResponseDNS]
+type appUpdateResponseDNSJSON struct {
+ Name apijson.Field
+ Type apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AppUpdateResponseDNS) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r appUpdateResponseDNSJSON) RawJSON() string {
+ return r.raw
+}
+
+// The type of DNS record associated with the application.
+type AppUpdateResponseDNSType string
+
+const (
+ AppUpdateResponseDNSTypeCNAME AppUpdateResponseDNSType = "CNAME"
+ AppUpdateResponseDNSTypeAddress AppUpdateResponseDNSType = "ADDRESS"
+)
+
+// The anycast edge IP configuration for the hostname of this application.
+//
+// Union satisfied by
+// [spectrum.AppUpdateResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariable] or
+// [spectrum.AppUpdateResponseEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariable].
+type AppUpdateResponseEdgeIPs interface {
+ implementsSpectrumAppUpdateResponseEdgeIPs()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*AppUpdateResponseEdgeIPs)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(AppUpdateResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariable{}),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(AppUpdateResponseEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariable{}),
+ },
+ )
+}
+
+type AppUpdateResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariable struct {
+ // The IP versions supported for inbound connections on Spectrum anycast IPs.
+ Connectivity AppUpdateResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariableConnectivity `json:"connectivity"`
+ // The type of edge IP configuration specified. Dynamically allocated edge IPs use
+ // Spectrum anycast IPs in accordance with the connectivity you specify. Only valid
+ // with CNAME DNS names.
+ Type AppUpdateResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariableType `json:"type"`
+ JSON appUpdateResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariableJSON `json:"-"`
+}
+
+// appUpdateResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariableJSON contains the JSON
+// metadata for the struct
+// [AppUpdateResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariable]
+type appUpdateResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariableJSON struct {
+ Connectivity apijson.Field
+ Type apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AppUpdateResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariable) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r appUpdateResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariableJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r AppUpdateResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariable) implementsSpectrumAppUpdateResponseEdgeIPs() {
+}
+
+// The IP versions supported for inbound connections on Spectrum anycast IPs.
+type AppUpdateResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariableConnectivity string
+
+const (
+ AppUpdateResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariableConnectivityAll AppUpdateResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariableConnectivity = "all"
+ AppUpdateResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariableConnectivityIPV4 AppUpdateResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariableConnectivity = "ipv4"
+ AppUpdateResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariableConnectivityIPV6 AppUpdateResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariableConnectivity = "ipv6"
+)
+
+// The type of edge IP configuration specified. Dynamically allocated edge IPs use
+// Spectrum anycast IPs in accordance with the connectivity you specify. Only valid
+// with CNAME DNS names.
+type AppUpdateResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariableType string
+
+const (
+ AppUpdateResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariableTypeDynamic AppUpdateResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariableType = "dynamic"
+)
+
+type AppUpdateResponseEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariable struct {
+ // The array of customer owned IPs we broadcast via anycast for this hostname and
+ // application.
+ IPs []string `json:"ips"`
+ // The type of edge IP configuration specified. Statically allocated edge IPs use
+ // customer IPs in accordance with the ips array you specify. Only valid with
+ // ADDRESS DNS names.
+ Type AppUpdateResponseEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariableType `json:"type"`
+ JSON appUpdateResponseEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariableJSON `json:"-"`
+}
+
+// appUpdateResponseEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariableJSON contains the
+// JSON metadata for the struct
+// [AppUpdateResponseEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariable]
+type appUpdateResponseEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariableJSON struct {
+ IPs apijson.Field
+ Type apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AppUpdateResponseEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariable) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r appUpdateResponseEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariableJSON) RawJSON() string {
+ return r.raw
+}
+
+func (r AppUpdateResponseEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariable) implementsSpectrumAppUpdateResponseEdgeIPs() {
+}
+
+// The type of edge IP configuration specified. Statically allocated edge IPs use
+// customer IPs in accordance with the ips array you specify. Only valid with
+// ADDRESS DNS names.
+type AppUpdateResponseEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariableType string
+
+const (
+ AppUpdateResponseEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariableTypeStatic AppUpdateResponseEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariableType = "static"
+)
+
+// The name and type of DNS record for the Spectrum application.
+type AppUpdateResponseOriginDNS struct {
+ // The name of the DNS record associated with the origin.
+ Name string `json:"name" format:"hostname"`
+ // The TTL of our resolution of your DNS record in seconds.
+ TTL int64 `json:"ttl"`
+ // The type of DNS record associated with the origin. "" is used to specify a
+ // combination of A/AAAA records.
+ Type AppUpdateResponseOriginDNSType `json:"type"`
+ JSON appUpdateResponseOriginDNSJSON `json:"-"`
+}
+
+// appUpdateResponseOriginDNSJSON contains the JSON metadata for the struct
+// [AppUpdateResponseOriginDNS]
+type appUpdateResponseOriginDNSJSON struct {
+ Name apijson.Field
+ TTL apijson.Field
+ Type apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AppUpdateResponseOriginDNS) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r appUpdateResponseOriginDNSJSON) RawJSON() string {
+ return r.raw
+}
+
+// The type of DNS record associated with the origin. "" is used to specify a
+// combination of A/AAAA records.
+type AppUpdateResponseOriginDNSType string
+
+const (
+ AppUpdateResponseOriginDNSTypeEmpty AppUpdateResponseOriginDNSType = ""
+ AppUpdateResponseOriginDNSTypeA AppUpdateResponseOriginDNSType = "A"
+ AppUpdateResponseOriginDNSTypeAAAA AppUpdateResponseOriginDNSType = "AAAA"
+ AppUpdateResponseOriginDNSTypeSRV AppUpdateResponseOriginDNSType = "SRV"
+)
+
+// The destination port at the origin. Only specified in conjunction with
+// origin_dns. May use an integer to specify a single origin port, for example
+// `1000`, or a string to specify a range of origin ports, for example
+// `"1000-2000"`. Notes: If specifying a port range, the number of ports in the
+// range must match the number of ports specified in the "protocol" field.
+//
+// Union satisfied by [shared.UnionInt] or [shared.UnionString].
+type AppUpdateResponseOriginPort interface {
+ ImplementsSpectrumAppUpdateResponseOriginPort()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*AppUpdateResponseOriginPort)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionInt(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+// Enables Proxy Protocol to the origin. Refer to
+// [Enable Proxy protocol](https://developers.cloudflare.com/spectrum/getting-started/proxy-protocol/)
+// for implementation details on PROXY Protocol V1, PROXY Protocol V2, and Simple
+// Proxy Protocol.
+type AppUpdateResponseProxyProtocol string
+
+const (
+ AppUpdateResponseProxyProtocolOff AppUpdateResponseProxyProtocol = "off"
+ AppUpdateResponseProxyProtocolV1 AppUpdateResponseProxyProtocol = "v1"
+ AppUpdateResponseProxyProtocolV2 AppUpdateResponseProxyProtocol = "v2"
+ AppUpdateResponseProxyProtocolSimple AppUpdateResponseProxyProtocol = "simple"
+)
+
+// The type of TLS termination associated with the application.
+type AppUpdateResponseTLS string
+
+const (
+ AppUpdateResponseTLSOff AppUpdateResponseTLS = "off"
+ AppUpdateResponseTLSFlexible AppUpdateResponseTLS = "flexible"
+ AppUpdateResponseTLSFull AppUpdateResponseTLS = "full"
+ AppUpdateResponseTLSStrict AppUpdateResponseTLS = "strict"
+)
+
+// Determines how data travels from the edge to your origin. When set to "direct",
+// Spectrum will send traffic directly to your origin, and the application's type
+// is derived from the `protocol`. When set to "http" or "https", Spectrum will
+// apply Cloudflare's HTTP/HTTPS features as it sends traffic to your origin, and
+// the application type matches this property exactly.
+type AppUpdateResponseTrafficType string
+
+const (
+ AppUpdateResponseTrafficTypeDirect AppUpdateResponseTrafficType = "direct"
+ AppUpdateResponseTrafficTypeHTTP AppUpdateResponseTrafficType = "http"
+ AppUpdateResponseTrafficTypeHTTPS AppUpdateResponseTrafficType = "https"
+)
+
+type AppListResponse = interface{}
+
+type AppDeleteResponse struct {
+ // Application identifier.
+ ID string `json:"id"`
+ JSON appDeleteResponseJSON `json:"-"`
+}
+
+// appDeleteResponseJSON contains the JSON metadata for the struct
+// [AppDeleteResponse]
+type appDeleteResponseJSON struct {
+ ID apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AppDeleteResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r appDeleteResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+// Union satisfied by [spectrum.AppGetResponseUnknown] or [shared.UnionString].
+type AppGetResponse interface {
+ ImplementsSpectrumAppGetResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*AppGetResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+type AppNewParams struct {
+ // The name and type of DNS record for the Spectrum application.
+ DNS param.Field[AppNewParamsDNS] `json:"dns,required"`
+ // The name and type of DNS record for the Spectrum application.
+ OriginDNS param.Field[AppNewParamsOriginDNS] `json:"origin_dns,required"`
+ // The destination port at the origin. Only specified in conjunction with
+ // origin_dns. May use an integer to specify a single origin port, for example
+ // `1000`, or a string to specify a range of origin ports, for example
+ // `"1000-2000"`. Notes: If specifying a port range, the number of ports in the
+ // range must match the number of ports specified in the "protocol" field.
+ OriginPort param.Field[AppNewParamsOriginPort] `json:"origin_port,required"`
+ // The port configuration at Cloudflare’s edge. May specify a single port, for
+ // example `"tcp/1000"`, or a range of ports, for example `"tcp/1000-2000"`.
+ Protocol param.Field[string] `json:"protocol,required"`
+ // Enables Argo Smart Routing for this application. Notes: Only available for TCP
+ // applications with traffic_type set to "direct".
+ ArgoSmartRouting param.Field[bool] `json:"argo_smart_routing"`
+ // The anycast edge IP configuration for the hostname of this application.
+ EdgeIPs param.Field[AppNewParamsEdgeIPs] `json:"edge_ips"`
+ // Enables IP Access Rules for this application. Notes: Only available for TCP
+ // applications.
+ IPFirewall param.Field[bool] `json:"ip_firewall"`
+ // Enables Proxy Protocol to the origin. Refer to
+ // [Enable Proxy protocol](https://developers.cloudflare.com/spectrum/getting-started/proxy-protocol/)
+ // for implementation details on PROXY Protocol V1, PROXY Protocol V2, and Simple
+ // Proxy Protocol.
+ ProxyProtocol param.Field[AppNewParamsProxyProtocol] `json:"proxy_protocol"`
+ // The type of TLS termination associated with the application.
+ TLS param.Field[AppNewParamsTLS] `json:"tls"`
+ // Determines how data travels from the edge to your origin. When set to "direct",
+ // Spectrum will send traffic directly to your origin, and the application's type
+ // is derived from the `protocol`. When set to "http" or "https", Spectrum will
+ // apply Cloudflare's HTTP/HTTPS features as it sends traffic to your origin, and
+ // the application type matches this property exactly.
+ TrafficType param.Field[AppNewParamsTrafficType] `json:"traffic_type"`
+}
+
+func (r AppNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The name and type of DNS record for the Spectrum application.
+type AppNewParamsDNS struct {
+ // The name of the DNS record associated with the application.
+ Name param.Field[string] `json:"name" format:"hostname"`
+ // The type of DNS record associated with the application.
+ Type param.Field[AppNewParamsDNSType] `json:"type"`
+}
+
+func (r AppNewParamsDNS) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The type of DNS record associated with the application.
+type AppNewParamsDNSType string
+
+const (
+ AppNewParamsDNSTypeCNAME AppNewParamsDNSType = "CNAME"
+ AppNewParamsDNSTypeAddress AppNewParamsDNSType = "ADDRESS"
+)
+
+// The name and type of DNS record for the Spectrum application.
+type AppNewParamsOriginDNS struct {
+ // The name of the DNS record associated with the origin.
+ Name param.Field[string] `json:"name" format:"hostname"`
+ // The TTL of our resolution of your DNS record in seconds.
+ TTL param.Field[int64] `json:"ttl"`
+ // The type of DNS record associated with the origin. "" is used to specify a
+ // combination of A/AAAA records.
+ Type param.Field[AppNewParamsOriginDNSType] `json:"type"`
+}
+
+func (r AppNewParamsOriginDNS) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The type of DNS record associated with the origin. "" is used to specify a
+// combination of A/AAAA records.
+type AppNewParamsOriginDNSType string
+
+const (
+ AppNewParamsOriginDNSTypeEmpty AppNewParamsOriginDNSType = ""
+ AppNewParamsOriginDNSTypeA AppNewParamsOriginDNSType = "A"
+ AppNewParamsOriginDNSTypeAAAA AppNewParamsOriginDNSType = "AAAA"
+ AppNewParamsOriginDNSTypeSRV AppNewParamsOriginDNSType = "SRV"
+)
+
+// The destination port at the origin. Only specified in conjunction with
+// origin_dns. May use an integer to specify a single origin port, for example
+// `1000`, or a string to specify a range of origin ports, for example
+// `"1000-2000"`. Notes: If specifying a port range, the number of ports in the
+// range must match the number of ports specified in the "protocol" field.
+//
+// Satisfied by [shared.UnionInt], [shared.UnionString].
+type AppNewParamsOriginPort interface {
+ ImplementsSpectrumAppNewParamsOriginPort()
+}
+
+// The anycast edge IP configuration for the hostname of this application.
+//
+// Satisfied by [spectrum.AppNewParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariable],
+// [spectrum.AppNewParamsEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariable].
+type AppNewParamsEdgeIPs interface {
+ implementsSpectrumAppNewParamsEdgeIPs()
+}
+
+type AppNewParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariable struct {
+ // The IP versions supported for inbound connections on Spectrum anycast IPs.
+ Connectivity param.Field[AppNewParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariableConnectivity] `json:"connectivity"`
+ // The type of edge IP configuration specified. Dynamically allocated edge IPs use
+ // Spectrum anycast IPs in accordance with the connectivity you specify. Only valid
+ // with CNAME DNS names.
+ Type param.Field[AppNewParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariableType] `json:"type"`
+}
+
+func (r AppNewParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariable) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+func (r AppNewParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariable) implementsSpectrumAppNewParamsEdgeIPs() {
+}
+
+// The IP versions supported for inbound connections on Spectrum anycast IPs.
+type AppNewParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariableConnectivity string
+
+const (
+ AppNewParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariableConnectivityAll AppNewParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariableConnectivity = "all"
+ AppNewParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariableConnectivityIPV4 AppNewParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariableConnectivity = "ipv4"
+ AppNewParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariableConnectivityIPV6 AppNewParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariableConnectivity = "ipv6"
+)
+
+// The type of edge IP configuration specified. Dynamically allocated edge IPs use
+// Spectrum anycast IPs in accordance with the connectivity you specify. Only valid
+// with CNAME DNS names.
+type AppNewParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariableType string
+
+const (
+ AppNewParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariableTypeDynamic AppNewParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariableType = "dynamic"
+)
+
+type AppNewParamsEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariable struct {
+ // The array of customer owned IPs we broadcast via anycast for this hostname and
+ // application.
+ IPs param.Field[[]string] `json:"ips"`
+ // The type of edge IP configuration specified. Statically allocated edge IPs use
+ // customer IPs in accordance with the ips array you specify. Only valid with
+ // ADDRESS DNS names.
+ Type param.Field[AppNewParamsEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariableType] `json:"type"`
+}
+
+func (r AppNewParamsEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariable) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+func (r AppNewParamsEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariable) implementsSpectrumAppNewParamsEdgeIPs() {
+}
+
+// The type of edge IP configuration specified. Statically allocated edge IPs use
+// customer IPs in accordance with the ips array you specify. Only valid with
+// ADDRESS DNS names.
+type AppNewParamsEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariableType string
+
+const (
+ AppNewParamsEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariableTypeStatic AppNewParamsEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariableType = "static"
+)
+
+// Enables Proxy Protocol to the origin. Refer to
+// [Enable Proxy protocol](https://developers.cloudflare.com/spectrum/getting-started/proxy-protocol/)
+// for implementation details on PROXY Protocol V1, PROXY Protocol V2, and Simple
+// Proxy Protocol.
+type AppNewParamsProxyProtocol string
+
+const (
+ AppNewParamsProxyProtocolOff AppNewParamsProxyProtocol = "off"
+ AppNewParamsProxyProtocolV1 AppNewParamsProxyProtocol = "v1"
+ AppNewParamsProxyProtocolV2 AppNewParamsProxyProtocol = "v2"
+ AppNewParamsProxyProtocolSimple AppNewParamsProxyProtocol = "simple"
+)
+
+// The type of TLS termination associated with the application.
+type AppNewParamsTLS string
+
+const (
+ AppNewParamsTLSOff AppNewParamsTLS = "off"
+ AppNewParamsTLSFlexible AppNewParamsTLS = "flexible"
+ AppNewParamsTLSFull AppNewParamsTLS = "full"
+ AppNewParamsTLSStrict AppNewParamsTLS = "strict"
+)
+
+// Determines how data travels from the edge to your origin. When set to "direct",
+// Spectrum will send traffic directly to your origin, and the application's type
+// is derived from the `protocol`. When set to "http" or "https", Spectrum will
+// apply Cloudflare's HTTP/HTTPS features as it sends traffic to your origin, and
+// the application type matches this property exactly.
+type AppNewParamsTrafficType string
+
+const (
+ AppNewParamsTrafficTypeDirect AppNewParamsTrafficType = "direct"
+ AppNewParamsTrafficTypeHTTP AppNewParamsTrafficType = "http"
+ AppNewParamsTrafficTypeHTTPS AppNewParamsTrafficType = "https"
+)
+
+type AppNewResponseEnvelope struct {
+ Errors []AppNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []AppNewResponseEnvelopeMessages `json:"messages,required"`
+ Result AppNewResponse `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success AppNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON appNewResponseEnvelopeJSON `json:"-"`
+}
+
+// appNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [AppNewResponseEnvelope]
+type appNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AppNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r appNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AppNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON appNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// appNewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [AppNewResponseEnvelopeErrors]
+type appNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AppNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r appNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type AppNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON appNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// appNewResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [AppNewResponseEnvelopeMessages]
+type appNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AppNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r appNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type AppNewResponseEnvelopeSuccess bool
+
+const (
+ AppNewResponseEnvelopeSuccessTrue AppNewResponseEnvelopeSuccess = true
+)
+
+type AppUpdateParams struct {
+ // The name and type of DNS record for the Spectrum application.
+ DNS param.Field[AppUpdateParamsDNS] `json:"dns,required"`
+ // The name and type of DNS record for the Spectrum application.
+ OriginDNS param.Field[AppUpdateParamsOriginDNS] `json:"origin_dns,required"`
+ // The destination port at the origin. Only specified in conjunction with
+ // origin_dns. May use an integer to specify a single origin port, for example
+ // `1000`, or a string to specify a range of origin ports, for example
+ // `"1000-2000"`. Notes: If specifying a port range, the number of ports in the
+ // range must match the number of ports specified in the "protocol" field.
+ OriginPort param.Field[AppUpdateParamsOriginPort] `json:"origin_port,required"`
+ // The port configuration at Cloudflare’s edge. May specify a single port, for
+ // example `"tcp/1000"`, or a range of ports, for example `"tcp/1000-2000"`.
+ Protocol param.Field[string] `json:"protocol,required"`
+ // Enables Argo Smart Routing for this application. Notes: Only available for TCP
+ // applications with traffic_type set to "direct".
+ ArgoSmartRouting param.Field[bool] `json:"argo_smart_routing"`
+ // The anycast edge IP configuration for the hostname of this application.
+ EdgeIPs param.Field[AppUpdateParamsEdgeIPs] `json:"edge_ips"`
+ // Enables IP Access Rules for this application. Notes: Only available for TCP
+ // applications.
+ IPFirewall param.Field[bool] `json:"ip_firewall"`
+ // Enables Proxy Protocol to the origin. Refer to
+ // [Enable Proxy protocol](https://developers.cloudflare.com/spectrum/getting-started/proxy-protocol/)
+ // for implementation details on PROXY Protocol V1, PROXY Protocol V2, and Simple
+ // Proxy Protocol.
+ ProxyProtocol param.Field[AppUpdateParamsProxyProtocol] `json:"proxy_protocol"`
+ // The type of TLS termination associated with the application.
+ TLS param.Field[AppUpdateParamsTLS] `json:"tls"`
+ // Determines how data travels from the edge to your origin. When set to "direct",
+ // Spectrum will send traffic directly to your origin, and the application's type
+ // is derived from the `protocol`. When set to "http" or "https", Spectrum will
+ // apply Cloudflare's HTTP/HTTPS features as it sends traffic to your origin, and
+ // the application type matches this property exactly.
+ TrafficType param.Field[AppUpdateParamsTrafficType] `json:"traffic_type"`
+}
+
+func (r AppUpdateParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The name and type of DNS record for the Spectrum application.
+type AppUpdateParamsDNS struct {
+ // The name of the DNS record associated with the application.
+ Name param.Field[string] `json:"name" format:"hostname"`
+ // The type of DNS record associated with the application.
+ Type param.Field[AppUpdateParamsDNSType] `json:"type"`
+}
+
+func (r AppUpdateParamsDNS) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The type of DNS record associated with the application.
+type AppUpdateParamsDNSType string
+
+const (
+ AppUpdateParamsDNSTypeCNAME AppUpdateParamsDNSType = "CNAME"
+ AppUpdateParamsDNSTypeAddress AppUpdateParamsDNSType = "ADDRESS"
+)
+
+// The name and type of DNS record for the Spectrum application.
+type AppUpdateParamsOriginDNS struct {
+ // The name of the DNS record associated with the origin.
+ Name param.Field[string] `json:"name" format:"hostname"`
+ // The TTL of our resolution of your DNS record in seconds.
+ TTL param.Field[int64] `json:"ttl"`
+ // The type of DNS record associated with the origin. "" is used to specify a
+ // combination of A/AAAA records.
+ Type param.Field[AppUpdateParamsOriginDNSType] `json:"type"`
+}
+
+func (r AppUpdateParamsOriginDNS) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The type of DNS record associated with the origin. "" is used to specify a
+// combination of A/AAAA records.
+type AppUpdateParamsOriginDNSType string
+
+const (
+ AppUpdateParamsOriginDNSTypeEmpty AppUpdateParamsOriginDNSType = ""
+ AppUpdateParamsOriginDNSTypeA AppUpdateParamsOriginDNSType = "A"
+ AppUpdateParamsOriginDNSTypeAAAA AppUpdateParamsOriginDNSType = "AAAA"
+ AppUpdateParamsOriginDNSTypeSRV AppUpdateParamsOriginDNSType = "SRV"
+)
+
+// The destination port at the origin. Only specified in conjunction with
+// origin_dns. May use an integer to specify a single origin port, for example
+// `1000`, or a string to specify a range of origin ports, for example
+// `"1000-2000"`. Notes: If specifying a port range, the number of ports in the
+// range must match the number of ports specified in the "protocol" field.
+//
+// Satisfied by [shared.UnionInt], [shared.UnionString].
+type AppUpdateParamsOriginPort interface {
+ ImplementsSpectrumAppUpdateParamsOriginPort()
+}
+
+// The anycast edge IP configuration for the hostname of this application.
+//
+// Satisfied by [spectrum.AppUpdateParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariable],
+// [spectrum.AppUpdateParamsEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariable].
+type AppUpdateParamsEdgeIPs interface {
+ implementsSpectrumAppUpdateParamsEdgeIPs()
+}
+
+type AppUpdateParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariable struct {
+ // The IP versions supported for inbound connections on Spectrum anycast IPs.
+ Connectivity param.Field[AppUpdateParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariableConnectivity] `json:"connectivity"`
+ // The type of edge IP configuration specified. Dynamically allocated edge IPs use
+ // Spectrum anycast IPs in accordance with the connectivity you specify. Only valid
+ // with CNAME DNS names.
+ Type param.Field[AppUpdateParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariableType] `json:"type"`
+}
+
+func (r AppUpdateParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariable) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+func (r AppUpdateParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariable) implementsSpectrumAppUpdateParamsEdgeIPs() {
+}
+
+// The IP versions supported for inbound connections on Spectrum anycast IPs.
+type AppUpdateParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariableConnectivity string
+
+const (
+ AppUpdateParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariableConnectivityAll AppUpdateParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariableConnectivity = "all"
+ AppUpdateParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariableConnectivityIPV4 AppUpdateParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariableConnectivity = "ipv4"
+ AppUpdateParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariableConnectivityIPV6 AppUpdateParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariableConnectivity = "ipv6"
+)
+
+// The type of edge IP configuration specified. Dynamically allocated edge IPs use
+// Spectrum anycast IPs in accordance with the connectivity you specify. Only valid
+// with CNAME DNS names.
+type AppUpdateParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariableType string
+
+const (
+ AppUpdateParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariableTypeDynamic AppUpdateParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariableType = "dynamic"
+)
+
+type AppUpdateParamsEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariable struct {
+ // The array of customer owned IPs we broadcast via anycast for this hostname and
+ // application.
+ IPs param.Field[[]string] `json:"ips"`
+ // The type of edge IP configuration specified. Statically allocated edge IPs use
+ // customer IPs in accordance with the ips array you specify. Only valid with
+ // ADDRESS DNS names.
+ Type param.Field[AppUpdateParamsEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariableType] `json:"type"`
+}
+
+func (r AppUpdateParamsEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariable) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+func (r AppUpdateParamsEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariable) implementsSpectrumAppUpdateParamsEdgeIPs() {
+}
+
+// The type of edge IP configuration specified. Statically allocated edge IPs use
+// customer IPs in accordance with the ips array you specify. Only valid with
+// ADDRESS DNS names.
+type AppUpdateParamsEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariableType string
+
+const (
+ AppUpdateParamsEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariableTypeStatic AppUpdateParamsEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariableType = "static"
+)
+
+// Enables Proxy Protocol to the origin. Refer to
+// [Enable Proxy protocol](https://developers.cloudflare.com/spectrum/getting-started/proxy-protocol/)
+// for implementation details on PROXY Protocol V1, PROXY Protocol V2, and Simple
+// Proxy Protocol.
+type AppUpdateParamsProxyProtocol string
+
+const (
+ AppUpdateParamsProxyProtocolOff AppUpdateParamsProxyProtocol = "off"
+ AppUpdateParamsProxyProtocolV1 AppUpdateParamsProxyProtocol = "v1"
+ AppUpdateParamsProxyProtocolV2 AppUpdateParamsProxyProtocol = "v2"
+ AppUpdateParamsProxyProtocolSimple AppUpdateParamsProxyProtocol = "simple"
+)
+
+// The type of TLS termination associated with the application.
+type AppUpdateParamsTLS string
+
+const (
+ AppUpdateParamsTLSOff AppUpdateParamsTLS = "off"
+ AppUpdateParamsTLSFlexible AppUpdateParamsTLS = "flexible"
+ AppUpdateParamsTLSFull AppUpdateParamsTLS = "full"
+ AppUpdateParamsTLSStrict AppUpdateParamsTLS = "strict"
+)
+
+// Determines how data travels from the edge to your origin. When set to "direct",
+// Spectrum will send traffic directly to your origin, and the application's type
+// is derived from the `protocol`. When set to "http" or "https", Spectrum will
+// apply Cloudflare's HTTP/HTTPS features as it sends traffic to your origin, and
+// the application type matches this property exactly.
+type AppUpdateParamsTrafficType string
+
+const (
+ AppUpdateParamsTrafficTypeDirect AppUpdateParamsTrafficType = "direct"
+ AppUpdateParamsTrafficTypeHTTP AppUpdateParamsTrafficType = "http"
+ AppUpdateParamsTrafficTypeHTTPS AppUpdateParamsTrafficType = "https"
+)
+
+type AppUpdateResponseEnvelope struct {
+ Errors []AppUpdateResponseEnvelopeErrors `json:"errors,required"`
+ Messages []AppUpdateResponseEnvelopeMessages `json:"messages,required"`
+ Result AppUpdateResponse `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success AppUpdateResponseEnvelopeSuccess `json:"success,required"`
+ JSON appUpdateResponseEnvelopeJSON `json:"-"`
+}
+
+// appUpdateResponseEnvelopeJSON contains the JSON metadata for the struct
+// [AppUpdateResponseEnvelope]
+type appUpdateResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AppUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r appUpdateResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AppUpdateResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON appUpdateResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// appUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [AppUpdateResponseEnvelopeErrors]
+type appUpdateResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AppUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r appUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type AppUpdateResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON appUpdateResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// appUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [AppUpdateResponseEnvelopeMessages]
+type appUpdateResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AppUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r appUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type AppUpdateResponseEnvelopeSuccess bool
+
+const (
+ AppUpdateResponseEnvelopeSuccessTrue AppUpdateResponseEnvelopeSuccess = true
+)
+
+type AppListParams struct {
+ // Sets the direction by which results are ordered.
+ Direction param.Field[AppListParamsDirection] `query:"direction"`
+ // Application field by which results are ordered.
+ Order param.Field[AppListParamsOrder] `query:"order"`
+ // Page number of paginated results. This parameter is required in order to use
+ // other pagination parameters. If included in the query, `result_info` will be
+ // present in the response.
+ Page param.Field[float64] `query:"page"`
+ // Sets the maximum number of results per page.
+ PerPage param.Field[float64] `query:"per_page"`
+}
+
+// URLQuery serializes [AppListParams]'s query parameters as `url.Values`.
+func (r AppListParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Sets the direction by which results are ordered.
+type AppListParamsDirection string
+
+const (
+ AppListParamsDirectionAsc AppListParamsDirection = "asc"
+ AppListParamsDirectionDesc AppListParamsDirection = "desc"
+)
+
+// Application field by which results are ordered.
+type AppListParamsOrder string
+
+const (
+ AppListParamsOrderProtocol AppListParamsOrder = "protocol"
+ AppListParamsOrderAppID AppListParamsOrder = "app_id"
+ AppListParamsOrderCreatedOn AppListParamsOrder = "created_on"
+ AppListParamsOrderModifiedOn AppListParamsOrder = "modified_on"
+ AppListParamsOrderDNS AppListParamsOrder = "dns"
+)
+
+type AppDeleteResponseEnvelope struct {
+ Errors []AppDeleteResponseEnvelopeErrors `json:"errors,required"`
+ Messages []AppDeleteResponseEnvelopeMessages `json:"messages,required"`
+ Result AppDeleteResponse `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success AppDeleteResponseEnvelopeSuccess `json:"success,required"`
+ JSON appDeleteResponseEnvelopeJSON `json:"-"`
+}
+
+// appDeleteResponseEnvelopeJSON contains the JSON metadata for the struct
+// [AppDeleteResponseEnvelope]
+type appDeleteResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AppDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r appDeleteResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AppDeleteResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON appDeleteResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// appDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [AppDeleteResponseEnvelopeErrors]
+type appDeleteResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AppDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r appDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type AppDeleteResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON appDeleteResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// appDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [AppDeleteResponseEnvelopeMessages]
+type appDeleteResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AppDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r appDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type AppDeleteResponseEnvelopeSuccess bool
+
+const (
+ AppDeleteResponseEnvelopeSuccessTrue AppDeleteResponseEnvelopeSuccess = true
+)
+
+type AppGetResponseEnvelope struct {
+ Errors []AppGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []AppGetResponseEnvelopeMessages `json:"messages,required"`
+ Result AppGetResponse `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success AppGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON appGetResponseEnvelopeJSON `json:"-"`
+}
+
+// appGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [AppGetResponseEnvelope]
+type appGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AppGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r appGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AppGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON appGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// appGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [AppGetResponseEnvelopeErrors]
+type appGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AppGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r appGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type AppGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON appGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// appGetResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [AppGetResponseEnvelopeMessages]
+type appGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AppGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r appGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type AppGetResponseEnvelopeSuccess bool
+
+const (
+ AppGetResponseEnvelopeSuccessTrue AppGetResponseEnvelopeSuccess = true
+)
diff --git a/spectrum/app_test.go b/spectrum/app_test.go
new file mode 100644
index 00000000000..43dec4fc3d8
--- /dev/null
+++ b/spectrum/app_test.go
@@ -0,0 +1,204 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package spectrum_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/spectrum"
+)
+
+func TestAppNewWithOptionalParams(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"),
+ )
+ _, err := client.Spectrum.Apps.New(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ spectrum.AppNewParams{
+ DNS: cloudflare.F(spectrum.AppNewParamsDNS{
+ Name: cloudflare.F("ssh.example.com"),
+ Type: cloudflare.F(spectrum.AppNewParamsDNSTypeCNAME),
+ }),
+ OriginDNS: cloudflare.F(spectrum.AppNewParamsOriginDNS{
+ Name: cloudflare.F("origin.example.com"),
+ TTL: cloudflare.F(int64(600)),
+ Type: cloudflare.F(spectrum.AppNewParamsOriginDNSTypeEmpty),
+ }),
+ OriginPort: cloudflare.F[spectrum.AppNewParamsOriginPort](shared.UnionInt(int64(22))),
+ Protocol: cloudflare.F("tcp/22"),
+ ArgoSmartRouting: cloudflare.F(true),
+ EdgeIPs: cloudflare.F[spectrum.AppNewParamsEdgeIPs](spectrum.AppNewParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariable(spectrum.AppNewParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariable{
+ Connectivity: cloudflare.F(spectrum.AppNewParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariableConnectivityAll),
+ Type: cloudflare.F(spectrum.AppNewParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariableTypeDynamic),
+ })),
+ IPFirewall: cloudflare.F(true),
+ ProxyProtocol: cloudflare.F(spectrum.AppNewParamsProxyProtocolOff),
+ TLS: cloudflare.F(spectrum.AppNewParamsTLSFull),
+ TrafficType: cloudflare.F(spectrum.AppNewParamsTrafficTypeDirect),
+ },
+ )
+ 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())
+ }
+}
+
+func TestAppUpdateWithOptionalParams(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"),
+ )
+ _, err := client.Spectrum.Apps.Update(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ "ea95132c15732412d22c1476fa83f27a",
+ spectrum.AppUpdateParams{
+ DNS: cloudflare.F(spectrum.AppUpdateParamsDNS{
+ Name: cloudflare.F("ssh.example.com"),
+ Type: cloudflare.F(spectrum.AppUpdateParamsDNSTypeCNAME),
+ }),
+ OriginDNS: cloudflare.F(spectrum.AppUpdateParamsOriginDNS{
+ Name: cloudflare.F("origin.example.com"),
+ TTL: cloudflare.F(int64(600)),
+ Type: cloudflare.F(spectrum.AppUpdateParamsOriginDNSTypeEmpty),
+ }),
+ OriginPort: cloudflare.F[spectrum.AppUpdateParamsOriginPort](shared.UnionInt(int64(22))),
+ Protocol: cloudflare.F("tcp/22"),
+ ArgoSmartRouting: cloudflare.F(true),
+ EdgeIPs: cloudflare.F[spectrum.AppUpdateParamsEdgeIPs](spectrum.AppUpdateParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariable(spectrum.AppUpdateParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariable{
+ Connectivity: cloudflare.F(spectrum.AppUpdateParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariableConnectivityAll),
+ Type: cloudflare.F(spectrum.AppUpdateParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariableTypeDynamic),
+ })),
+ IPFirewall: cloudflare.F(true),
+ ProxyProtocol: cloudflare.F(spectrum.AppUpdateParamsProxyProtocolOff),
+ TLS: cloudflare.F(spectrum.AppUpdateParamsTLSFull),
+ TrafficType: cloudflare.F(spectrum.AppUpdateParamsTrafficTypeDirect),
+ },
+ )
+ 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())
+ }
+}
+
+func TestAppListWithOptionalParams(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"),
+ )
+ _, err := client.Spectrum.Apps.List(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ spectrum.AppListParams{
+ Direction: cloudflare.F(spectrum.AppListParamsDirectionDesc),
+ Order: cloudflare.F(spectrum.AppListParamsOrderProtocol),
+ Page: cloudflare.F(1.000000),
+ PerPage: cloudflare.F(1.000000),
+ },
+ )
+ 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())
+ }
+}
+
+func TestAppDelete(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"),
+ )
+ _, err := client.Spectrum.Apps.Delete(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ "ea95132c15732412d22c1476fa83f27a",
+ )
+ 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())
+ }
+}
+
+func TestAppGet(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"),
+ )
+ _, err := client.Spectrum.Apps.Get(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ "ea95132c15732412d22c1476fa83f27a",
+ )
+ 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/spectrum.go b/spectrum/spectrum.go
similarity index 82%
rename from spectrum.go
rename to spectrum/spectrum.go
index ac0995065ca..66a6ca5a8be 100644
--- a/spectrum.go
+++ b/spectrum/spectrum.go
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package cloudflare
+package spectrum
import (
"github.com/cloudflare/cloudflare-go/option"
@@ -12,8 +12,8 @@ import (
// service directly, and instead use the [NewSpectrumService] method instead.
type SpectrumService struct {
Options []option.RequestOption
- Analytics *SpectrumAnalyticsService
- Apps *SpectrumAppService
+ Analytics *AnalyticsService
+ Apps *AppService
}
// NewSpectrumService generates a new service that applies the given options to
@@ -22,7 +22,7 @@ type SpectrumService struct {
func NewSpectrumService(opts ...option.RequestOption) (r *SpectrumService) {
r = &SpectrumService{}
r.Options = opts
- r.Analytics = NewSpectrumAnalyticsService(opts...)
- r.Apps = NewSpectrumAppService(opts...)
+ r.Analytics = NewAnalyticsService(opts...)
+ r.Apps = NewAppService(opts...)
return
}
diff --git a/spectrumanalytics.go b/spectrumanalytics.go
deleted file mode 100644
index f1267a5443d..00000000000
--- a/spectrumanalytics.go
+++ /dev/null
@@ -1,29 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// SpectrumAnalyticsService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewSpectrumAnalyticsService] method
-// instead.
-type SpectrumAnalyticsService struct {
- Options []option.RequestOption
- Aggregates *SpectrumAnalyticsAggregateService
- Events *SpectrumAnalyticsEventService
-}
-
-// NewSpectrumAnalyticsService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewSpectrumAnalyticsService(opts ...option.RequestOption) (r *SpectrumAnalyticsService) {
- r = &SpectrumAnalyticsService{}
- r.Options = opts
- r.Aggregates = NewSpectrumAnalyticsAggregateService(opts...)
- r.Events = NewSpectrumAnalyticsEventService(opts...)
- return
-}
diff --git a/spectrumanalyticsaggregate.go b/spectrumanalyticsaggregate.go
deleted file mode 100644
index 6e98aa2873c..00000000000
--- a/spectrumanalyticsaggregate.go
+++ /dev/null
@@ -1,27 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// SpectrumAnalyticsAggregateService contains methods and other services that help
-// with interacting with the cloudflare API. Note, unlike clients, this service
-// does not read variables from the environment automatically. You should not
-// instantiate this service directly, and instead use the
-// [NewSpectrumAnalyticsAggregateService] method instead.
-type SpectrumAnalyticsAggregateService struct {
- Options []option.RequestOption
- Currents *SpectrumAnalyticsAggregateCurrentService
-}
-
-// NewSpectrumAnalyticsAggregateService generates a new service that applies the
-// given options to each request. These options are applied after the parent
-// client's options (if there is one), and before any request-specific options.
-func NewSpectrumAnalyticsAggregateService(opts ...option.RequestOption) (r *SpectrumAnalyticsAggregateService) {
- r = &SpectrumAnalyticsAggregateService{}
- r.Options = opts
- r.Currents = NewSpectrumAnalyticsAggregateCurrentService(opts...)
- return
-}
diff --git a/spectrumanalyticsaggregatecurrent.go b/spectrumanalyticsaggregatecurrent.go
deleted file mode 100644
index 51e15b26785..00000000000
--- a/spectrumanalyticsaggregatecurrent.go
+++ /dev/null
@@ -1,153 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// SpectrumAnalyticsAggregateCurrentService contains methods and other services
-// that help with interacting with the cloudflare API. Note, unlike clients, this
-// service does not read variables from the environment automatically. You should
-// not instantiate this service directly, and instead use the
-// [NewSpectrumAnalyticsAggregateCurrentService] method instead.
-type SpectrumAnalyticsAggregateCurrentService struct {
- Options []option.RequestOption
-}
-
-// NewSpectrumAnalyticsAggregateCurrentService generates a new service that applies
-// the given options to each request. These options are applied after the parent
-// client's options (if there is one), and before any request-specific options.
-func NewSpectrumAnalyticsAggregateCurrentService(opts ...option.RequestOption) (r *SpectrumAnalyticsAggregateCurrentService) {
- r = &SpectrumAnalyticsAggregateCurrentService{}
- r.Options = opts
- return
-}
-
-// Retrieves analytics aggregated from the last minute of usage on Spectrum
-// applications underneath a given zone.
-func (r *SpectrumAnalyticsAggregateCurrentService) Get(ctx context.Context, zone string, query SpectrumAnalyticsAggregateCurrentGetParams, opts ...option.RequestOption) (res *[]SpectrumAnalyticsAggregateCurrentGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env SpectrumAnalyticsAggregateCurrentGetResponseEnvelope
- path := fmt.Sprintf("zones/%s/spectrum/analytics/aggregate/current", zone)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type SpectrumAnalyticsAggregateCurrentGetResponse = interface{}
-
-type SpectrumAnalyticsAggregateCurrentGetParams struct {
- // Comma-delimited list of Spectrum Application Id(s). If provided, the response
- // will be limited to Spectrum Application Id(s) that match.
- AppIDParam param.Field[string] `query:"app_id_param"`
- // Comma-delimited list of Spectrum Application Id(s). If provided, the response
- // will be limited to Spectrum Application Id(s) that match.
- AppID param.Field[string] `query:"appID"`
- // Co-location identifier.
- ColoName param.Field[string] `query:"colo_name"`
-}
-
-// URLQuery serializes [SpectrumAnalyticsAggregateCurrentGetParams]'s query
-// parameters as `url.Values`.
-func (r SpectrumAnalyticsAggregateCurrentGetParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type SpectrumAnalyticsAggregateCurrentGetResponseEnvelope struct {
- Errors []SpectrumAnalyticsAggregateCurrentGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []SpectrumAnalyticsAggregateCurrentGetResponseEnvelopeMessages `json:"messages,required"`
- Result []SpectrumAnalyticsAggregateCurrentGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success SpectrumAnalyticsAggregateCurrentGetResponseEnvelopeSuccess `json:"success,required"`
- JSON spectrumAnalyticsAggregateCurrentGetResponseEnvelopeJSON `json:"-"`
-}
-
-// spectrumAnalyticsAggregateCurrentGetResponseEnvelopeJSON contains the JSON
-// metadata for the struct [SpectrumAnalyticsAggregateCurrentGetResponseEnvelope]
-type spectrumAnalyticsAggregateCurrentGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SpectrumAnalyticsAggregateCurrentGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r spectrumAnalyticsAggregateCurrentGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type SpectrumAnalyticsAggregateCurrentGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON spectrumAnalyticsAggregateCurrentGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// spectrumAnalyticsAggregateCurrentGetResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct
-// [SpectrumAnalyticsAggregateCurrentGetResponseEnvelopeErrors]
-type spectrumAnalyticsAggregateCurrentGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SpectrumAnalyticsAggregateCurrentGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r spectrumAnalyticsAggregateCurrentGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type SpectrumAnalyticsAggregateCurrentGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON spectrumAnalyticsAggregateCurrentGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// spectrumAnalyticsAggregateCurrentGetResponseEnvelopeMessagesJSON contains the
-// JSON metadata for the struct
-// [SpectrumAnalyticsAggregateCurrentGetResponseEnvelopeMessages]
-type spectrumAnalyticsAggregateCurrentGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SpectrumAnalyticsAggregateCurrentGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r spectrumAnalyticsAggregateCurrentGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type SpectrumAnalyticsAggregateCurrentGetResponseEnvelopeSuccess bool
-
-const (
- SpectrumAnalyticsAggregateCurrentGetResponseEnvelopeSuccessTrue SpectrumAnalyticsAggregateCurrentGetResponseEnvelopeSuccess = true
-)
diff --git a/spectrumanalyticsaggregatecurrent_test.go b/spectrumanalyticsaggregatecurrent_test.go
deleted file mode 100644
index 40b2c6516a8..00000000000
--- a/spectrumanalyticsaggregatecurrent_test.go
+++ /dev/null
@@ -1,46 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestSpectrumAnalyticsAggregateCurrentGetWithOptionalParams(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"),
- )
- _, err := client.Spectrum.Analytics.Aggregates.Currents.Get(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.SpectrumAnalyticsAggregateCurrentGetParams{
- AppIDParam: cloudflare.F("ea95132c15732412d22c1476fa83f27a,d122c5f4bb71e25cc9e86ab43b142e2f"),
- AppID: cloudflare.F("ea95132c15732412d22c1476fa83f27a,d122c5f4bb71e25cc9e86ab43b142e2f"),
- ColoName: cloudflare.F("PDX"),
- },
- )
- 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/spectrumanalyticsevent.go b/spectrumanalyticsevent.go
deleted file mode 100644
index 66118d55dc6..00000000000
--- a/spectrumanalyticsevent.go
+++ /dev/null
@@ -1,29 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// SpectrumAnalyticsEventService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewSpectrumAnalyticsEventService]
-// method instead.
-type SpectrumAnalyticsEventService struct {
- Options []option.RequestOption
- Bytimes *SpectrumAnalyticsEventBytimeService
- Summaries *SpectrumAnalyticsEventSummaryService
-}
-
-// NewSpectrumAnalyticsEventService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewSpectrumAnalyticsEventService(opts ...option.RequestOption) (r *SpectrumAnalyticsEventService) {
- r = &SpectrumAnalyticsEventService{}
- r.Options = opts
- r.Bytimes = NewSpectrumAnalyticsEventBytimeService(opts...)
- r.Summaries = NewSpectrumAnalyticsEventSummaryService(opts...)
- return
-}
diff --git a/spectrumanalyticseventbytime.go b/spectrumanalyticseventbytime.go
deleted file mode 100644
index e3ebcce6eed..00000000000
--- a/spectrumanalyticseventbytime.go
+++ /dev/null
@@ -1,245 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
- "reflect"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/option"
- "github.com/tidwall/gjson"
-)
-
-// SpectrumAnalyticsEventBytimeService contains methods and other services that
-// help with interacting with the cloudflare API. Note, unlike clients, this
-// service does not read variables from the environment automatically. You should
-// not instantiate this service directly, and instead use the
-// [NewSpectrumAnalyticsEventBytimeService] method instead.
-type SpectrumAnalyticsEventBytimeService struct {
- Options []option.RequestOption
-}
-
-// NewSpectrumAnalyticsEventBytimeService generates a new service that applies the
-// given options to each request. These options are applied after the parent
-// client's options (if there is one), and before any request-specific options.
-func NewSpectrumAnalyticsEventBytimeService(opts ...option.RequestOption) (r *SpectrumAnalyticsEventBytimeService) {
- r = &SpectrumAnalyticsEventBytimeService{}
- r.Options = opts
- return
-}
-
-// Retrieves a list of aggregate metrics grouped by time interval.
-func (r *SpectrumAnalyticsEventBytimeService) Get(ctx context.Context, zone string, query SpectrumAnalyticsEventBytimeGetParams, opts ...option.RequestOption) (res *SpectrumAnalyticsEventBytimeGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env SpectrumAnalyticsEventBytimeGetResponseEnvelope
- path := fmt.Sprintf("zones/%s/spectrum/analytics/events/bytime", zone)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Union satisfied by [SpectrumAnalyticsEventBytimeGetResponseUnknown] or
-// [shared.UnionString].
-type SpectrumAnalyticsEventBytimeGetResponse interface {
- ImplementsSpectrumAnalyticsEventBytimeGetResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*SpectrumAnalyticsEventBytimeGetResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-type SpectrumAnalyticsEventBytimeGetParams struct {
- // Can be used to break down the data by given attributes. Options are:
- //
- // | Dimension | Name | Example |
- // | --------- | ----------------------------- | ---------------------------------------------------------- |
- // | event | Connection Event | connect, progress, disconnect, originError, clientFiltered |
- // | appID | Application ID | 40d67c87c6cd4b889a4fd57805225e85 |
- // | coloName | Colo Name | SFO |
- // | ipVersion | IP version used by the client | 4, 6. |
- Dimensions param.Field[[]SpectrumAnalyticsEventBytimeGetParamsDimension] `query:"dimensions"`
- // Used to filter rows by one or more dimensions. Filters can be combined using OR
- // and AND boolean logic. AND takes precedence over OR in all the expressions. The
- // OR operator is defined using a comma (,) or OR keyword surrounded by whitespace.
- // The AND operator is defined using a semicolon (;) or AND keyword surrounded by
- // whitespace. Note that the semicolon is a reserved character in URLs (rfc1738)
- // and needs to be percent-encoded as %3B. Comparison options are:
- //
- // | Operator | Name | URL Encoded |
- // | -------- | ------------------------ | ----------- |
- // | == | Equals | %3D%3D |
- // | != | Does not equals | !%3D |
- // | > | Greater Than | %3E |
- // | < | Less Than | %3C |
- // | >= | Greater than or equal to | %3E%3D |
- // | <= | Less than or equal to | %3C%3D . |
- Filters param.Field[string] `query:"filters"`
- // One or more metrics to compute. Options are:
- //
- // | Metric | Name | Example | Unit |
- // | -------------- | ----------------------------------- | ------- | --------------------- |
- // | count | Count of total events | 1000 | Count |
- // | bytesIngress | Sum of ingress bytes | 1000 | Sum |
- // | bytesEgress | Sum of egress bytes | 1000 | Sum |
- // | durationAvg | Average connection duration | 1.0 | Time in milliseconds |
- // | durationMedian | Median connection duration | 1.0 | Time in milliseconds |
- // | duration90th | 90th percentile connection duration | 1.0 | Time in milliseconds |
- // | duration99th | 99th percentile connection duration | 1.0 | Time in milliseconds. |
- Metrics param.Field[[]SpectrumAnalyticsEventBytimeGetParamsMetric] `query:"metrics"`
- // Start of time interval to query, defaults to `until` - 6 hours. Timestamp must
- // be in RFC3339 format and uses UTC unless otherwise specified.
- Since param.Field[time.Time] `query:"since" format:"date-time"`
- // The sort order for the result set; sort fields must be included in `metrics` or
- // `dimensions`.
- Sort param.Field[[]interface{}] `query:"sort"`
- // Used to select time series resolution.
- TimeDelta param.Field[SpectrumAnalyticsEventBytimeGetParamsTimeDelta] `query:"time_delta"`
- // End of time interval to query, defaults to current time. Timestamp must be in
- // RFC3339 format and uses UTC unless otherwise specified.
- Until param.Field[time.Time] `query:"until" format:"date-time"`
-}
-
-// URLQuery serializes [SpectrumAnalyticsEventBytimeGetParams]'s query parameters
-// as `url.Values`.
-func (r SpectrumAnalyticsEventBytimeGetParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type SpectrumAnalyticsEventBytimeGetParamsDimension string
-
-const (
- SpectrumAnalyticsEventBytimeGetParamsDimensionEvent SpectrumAnalyticsEventBytimeGetParamsDimension = "event"
- SpectrumAnalyticsEventBytimeGetParamsDimensionAppID SpectrumAnalyticsEventBytimeGetParamsDimension = "appID"
- SpectrumAnalyticsEventBytimeGetParamsDimensionColoName SpectrumAnalyticsEventBytimeGetParamsDimension = "coloName"
- SpectrumAnalyticsEventBytimeGetParamsDimensionIPVersion SpectrumAnalyticsEventBytimeGetParamsDimension = "ipVersion"
-)
-
-type SpectrumAnalyticsEventBytimeGetParamsMetric string
-
-const (
- SpectrumAnalyticsEventBytimeGetParamsMetricCount SpectrumAnalyticsEventBytimeGetParamsMetric = "count"
- SpectrumAnalyticsEventBytimeGetParamsMetricBytesIngress SpectrumAnalyticsEventBytimeGetParamsMetric = "bytesIngress"
- SpectrumAnalyticsEventBytimeGetParamsMetricBytesEgress SpectrumAnalyticsEventBytimeGetParamsMetric = "bytesEgress"
- SpectrumAnalyticsEventBytimeGetParamsMetricDurationAvg SpectrumAnalyticsEventBytimeGetParamsMetric = "durationAvg"
- SpectrumAnalyticsEventBytimeGetParamsMetricDurationMedian SpectrumAnalyticsEventBytimeGetParamsMetric = "durationMedian"
- SpectrumAnalyticsEventBytimeGetParamsMetricDuration90th SpectrumAnalyticsEventBytimeGetParamsMetric = "duration90th"
- SpectrumAnalyticsEventBytimeGetParamsMetricDuration99th SpectrumAnalyticsEventBytimeGetParamsMetric = "duration99th"
-)
-
-// Used to select time series resolution.
-type SpectrumAnalyticsEventBytimeGetParamsTimeDelta string
-
-const (
- SpectrumAnalyticsEventBytimeGetParamsTimeDeltaYear SpectrumAnalyticsEventBytimeGetParamsTimeDelta = "year"
- SpectrumAnalyticsEventBytimeGetParamsTimeDeltaQuarter SpectrumAnalyticsEventBytimeGetParamsTimeDelta = "quarter"
- SpectrumAnalyticsEventBytimeGetParamsTimeDeltaMonth SpectrumAnalyticsEventBytimeGetParamsTimeDelta = "month"
- SpectrumAnalyticsEventBytimeGetParamsTimeDeltaWeek SpectrumAnalyticsEventBytimeGetParamsTimeDelta = "week"
- SpectrumAnalyticsEventBytimeGetParamsTimeDeltaDay SpectrumAnalyticsEventBytimeGetParamsTimeDelta = "day"
- SpectrumAnalyticsEventBytimeGetParamsTimeDeltaHour SpectrumAnalyticsEventBytimeGetParamsTimeDelta = "hour"
- SpectrumAnalyticsEventBytimeGetParamsTimeDeltaDekaminute SpectrumAnalyticsEventBytimeGetParamsTimeDelta = "dekaminute"
- SpectrumAnalyticsEventBytimeGetParamsTimeDeltaMinute SpectrumAnalyticsEventBytimeGetParamsTimeDelta = "minute"
-)
-
-type SpectrumAnalyticsEventBytimeGetResponseEnvelope struct {
- Errors []SpectrumAnalyticsEventBytimeGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []SpectrumAnalyticsEventBytimeGetResponseEnvelopeMessages `json:"messages,required"`
- Result SpectrumAnalyticsEventBytimeGetResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success SpectrumAnalyticsEventBytimeGetResponseEnvelopeSuccess `json:"success,required"`
- JSON spectrumAnalyticsEventBytimeGetResponseEnvelopeJSON `json:"-"`
-}
-
-// spectrumAnalyticsEventBytimeGetResponseEnvelopeJSON contains the JSON metadata
-// for the struct [SpectrumAnalyticsEventBytimeGetResponseEnvelope]
-type spectrumAnalyticsEventBytimeGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SpectrumAnalyticsEventBytimeGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r spectrumAnalyticsEventBytimeGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type SpectrumAnalyticsEventBytimeGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON spectrumAnalyticsEventBytimeGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// spectrumAnalyticsEventBytimeGetResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct [SpectrumAnalyticsEventBytimeGetResponseEnvelopeErrors]
-type spectrumAnalyticsEventBytimeGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SpectrumAnalyticsEventBytimeGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r spectrumAnalyticsEventBytimeGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type SpectrumAnalyticsEventBytimeGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON spectrumAnalyticsEventBytimeGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// spectrumAnalyticsEventBytimeGetResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct
-// [SpectrumAnalyticsEventBytimeGetResponseEnvelopeMessages]
-type spectrumAnalyticsEventBytimeGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SpectrumAnalyticsEventBytimeGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r spectrumAnalyticsEventBytimeGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type SpectrumAnalyticsEventBytimeGetResponseEnvelopeSuccess bool
-
-const (
- SpectrumAnalyticsEventBytimeGetResponseEnvelopeSuccessTrue SpectrumAnalyticsEventBytimeGetResponseEnvelopeSuccess = true
-)
diff --git a/spectrumanalyticseventbytime_test.go b/spectrumanalyticseventbytime_test.go
deleted file mode 100644
index c876748d3fd..00000000000
--- a/spectrumanalyticseventbytime_test.go
+++ /dev/null
@@ -1,51 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
- "time"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestSpectrumAnalyticsEventBytimeGetWithOptionalParams(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"),
- )
- _, err := client.Spectrum.Analytics.Events.Bytimes.Get(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.SpectrumAnalyticsEventBytimeGetParams{
- Dimensions: cloudflare.F([]cloudflare.SpectrumAnalyticsEventBytimeGetParamsDimension{cloudflare.SpectrumAnalyticsEventBytimeGetParamsDimensionEvent, cloudflare.SpectrumAnalyticsEventBytimeGetParamsDimensionAppID}),
- Filters: cloudflare.F("event==disconnect%20AND%20coloName!=SFO"),
- Metrics: cloudflare.F([]cloudflare.SpectrumAnalyticsEventBytimeGetParamsMetric{cloudflare.SpectrumAnalyticsEventBytimeGetParamsMetricCount, cloudflare.SpectrumAnalyticsEventBytimeGetParamsMetricBytesIngress}),
- Since: cloudflare.F(time.Now()),
- Sort: cloudflare.F([]interface{}{"+count", "-bytesIngress"}),
- TimeDelta: cloudflare.F(cloudflare.SpectrumAnalyticsEventBytimeGetParamsTimeDeltaMinute),
- Until: cloudflare.F(time.Now()),
- },
- )
- 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/spectrumanalyticseventsummary.go b/spectrumanalyticseventsummary.go
deleted file mode 100644
index bdc0fe5f0c3..00000000000
--- a/spectrumanalyticseventsummary.go
+++ /dev/null
@@ -1,229 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
- "reflect"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/option"
- "github.com/tidwall/gjson"
-)
-
-// SpectrumAnalyticsEventSummaryService contains methods and other services that
-// help with interacting with the cloudflare API. Note, unlike clients, this
-// service does not read variables from the environment automatically. You should
-// not instantiate this service directly, and instead use the
-// [NewSpectrumAnalyticsEventSummaryService] method instead.
-type SpectrumAnalyticsEventSummaryService struct {
- Options []option.RequestOption
-}
-
-// NewSpectrumAnalyticsEventSummaryService generates a new service that applies the
-// given options to each request. These options are applied after the parent
-// client's options (if there is one), and before any request-specific options.
-func NewSpectrumAnalyticsEventSummaryService(opts ...option.RequestOption) (r *SpectrumAnalyticsEventSummaryService) {
- r = &SpectrumAnalyticsEventSummaryService{}
- r.Options = opts
- return
-}
-
-// Retrieves a list of summarised aggregate metrics over a given time period.
-func (r *SpectrumAnalyticsEventSummaryService) Get(ctx context.Context, zone string, query SpectrumAnalyticsEventSummaryGetParams, opts ...option.RequestOption) (res *SpectrumAnalyticsEventSummaryGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env SpectrumAnalyticsEventSummaryGetResponseEnvelope
- path := fmt.Sprintf("zones/%s/spectrum/analytics/events/summary", zone)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Union satisfied by [SpectrumAnalyticsEventSummaryGetResponseUnknown] or
-// [shared.UnionString].
-type SpectrumAnalyticsEventSummaryGetResponse interface {
- ImplementsSpectrumAnalyticsEventSummaryGetResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*SpectrumAnalyticsEventSummaryGetResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-type SpectrumAnalyticsEventSummaryGetParams struct {
- // Can be used to break down the data by given attributes. Options are:
- //
- // | Dimension | Name | Example |
- // | --------- | ----------------------------- | ---------------------------------------------------------- |
- // | event | Connection Event | connect, progress, disconnect, originError, clientFiltered |
- // | appID | Application ID | 40d67c87c6cd4b889a4fd57805225e85 |
- // | coloName | Colo Name | SFO |
- // | ipVersion | IP version used by the client | 4, 6. |
- Dimensions param.Field[[]SpectrumAnalyticsEventSummaryGetParamsDimension] `query:"dimensions"`
- // Used to filter rows by one or more dimensions. Filters can be combined using OR
- // and AND boolean logic. AND takes precedence over OR in all the expressions. The
- // OR operator is defined using a comma (,) or OR keyword surrounded by whitespace.
- // The AND operator is defined using a semicolon (;) or AND keyword surrounded by
- // whitespace. Note that the semicolon is a reserved character in URLs (rfc1738)
- // and needs to be percent-encoded as %3B. Comparison options are:
- //
- // | Operator | Name | URL Encoded |
- // | -------- | ------------------------ | ----------- |
- // | == | Equals | %3D%3D |
- // | != | Does not equals | !%3D |
- // | > | Greater Than | %3E |
- // | < | Less Than | %3C |
- // | >= | Greater than or equal to | %3E%3D |
- // | <= | Less than or equal to | %3C%3D . |
- Filters param.Field[string] `query:"filters"`
- // One or more metrics to compute. Options are:
- //
- // | Metric | Name | Example | Unit |
- // | -------------- | ----------------------------------- | ------- | --------------------- |
- // | count | Count of total events | 1000 | Count |
- // | bytesIngress | Sum of ingress bytes | 1000 | Sum |
- // | bytesEgress | Sum of egress bytes | 1000 | Sum |
- // | durationAvg | Average connection duration | 1.0 | Time in milliseconds |
- // | durationMedian | Median connection duration | 1.0 | Time in milliseconds |
- // | duration90th | 90th percentile connection duration | 1.0 | Time in milliseconds |
- // | duration99th | 99th percentile connection duration | 1.0 | Time in milliseconds. |
- Metrics param.Field[[]SpectrumAnalyticsEventSummaryGetParamsMetric] `query:"metrics"`
- // Start of time interval to query, defaults to `until` - 6 hours. Timestamp must
- // be in RFC3339 format and uses UTC unless otherwise specified.
- Since param.Field[time.Time] `query:"since" format:"date-time"`
- // The sort order for the result set; sort fields must be included in `metrics` or
- // `dimensions`.
- Sort param.Field[[]interface{}] `query:"sort"`
- // End of time interval to query, defaults to current time. Timestamp must be in
- // RFC3339 format and uses UTC unless otherwise specified.
- Until param.Field[time.Time] `query:"until" format:"date-time"`
-}
-
-// URLQuery serializes [SpectrumAnalyticsEventSummaryGetParams]'s query parameters
-// as `url.Values`.
-func (r SpectrumAnalyticsEventSummaryGetParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-type SpectrumAnalyticsEventSummaryGetParamsDimension string
-
-const (
- SpectrumAnalyticsEventSummaryGetParamsDimensionEvent SpectrumAnalyticsEventSummaryGetParamsDimension = "event"
- SpectrumAnalyticsEventSummaryGetParamsDimensionAppID SpectrumAnalyticsEventSummaryGetParamsDimension = "appID"
- SpectrumAnalyticsEventSummaryGetParamsDimensionColoName SpectrumAnalyticsEventSummaryGetParamsDimension = "coloName"
- SpectrumAnalyticsEventSummaryGetParamsDimensionIPVersion SpectrumAnalyticsEventSummaryGetParamsDimension = "ipVersion"
-)
-
-type SpectrumAnalyticsEventSummaryGetParamsMetric string
-
-const (
- SpectrumAnalyticsEventSummaryGetParamsMetricCount SpectrumAnalyticsEventSummaryGetParamsMetric = "count"
- SpectrumAnalyticsEventSummaryGetParamsMetricBytesIngress SpectrumAnalyticsEventSummaryGetParamsMetric = "bytesIngress"
- SpectrumAnalyticsEventSummaryGetParamsMetricBytesEgress SpectrumAnalyticsEventSummaryGetParamsMetric = "bytesEgress"
- SpectrumAnalyticsEventSummaryGetParamsMetricDurationAvg SpectrumAnalyticsEventSummaryGetParamsMetric = "durationAvg"
- SpectrumAnalyticsEventSummaryGetParamsMetricDurationMedian SpectrumAnalyticsEventSummaryGetParamsMetric = "durationMedian"
- SpectrumAnalyticsEventSummaryGetParamsMetricDuration90th SpectrumAnalyticsEventSummaryGetParamsMetric = "duration90th"
- SpectrumAnalyticsEventSummaryGetParamsMetricDuration99th SpectrumAnalyticsEventSummaryGetParamsMetric = "duration99th"
-)
-
-type SpectrumAnalyticsEventSummaryGetResponseEnvelope struct {
- Errors []SpectrumAnalyticsEventSummaryGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []SpectrumAnalyticsEventSummaryGetResponseEnvelopeMessages `json:"messages,required"`
- Result SpectrumAnalyticsEventSummaryGetResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success SpectrumAnalyticsEventSummaryGetResponseEnvelopeSuccess `json:"success,required"`
- JSON spectrumAnalyticsEventSummaryGetResponseEnvelopeJSON `json:"-"`
-}
-
-// spectrumAnalyticsEventSummaryGetResponseEnvelopeJSON contains the JSON metadata
-// for the struct [SpectrumAnalyticsEventSummaryGetResponseEnvelope]
-type spectrumAnalyticsEventSummaryGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SpectrumAnalyticsEventSummaryGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r spectrumAnalyticsEventSummaryGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type SpectrumAnalyticsEventSummaryGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON spectrumAnalyticsEventSummaryGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// spectrumAnalyticsEventSummaryGetResponseEnvelopeErrorsJSON contains the JSON
-// metadata for the struct [SpectrumAnalyticsEventSummaryGetResponseEnvelopeErrors]
-type spectrumAnalyticsEventSummaryGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SpectrumAnalyticsEventSummaryGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r spectrumAnalyticsEventSummaryGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type SpectrumAnalyticsEventSummaryGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON spectrumAnalyticsEventSummaryGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// spectrumAnalyticsEventSummaryGetResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct
-// [SpectrumAnalyticsEventSummaryGetResponseEnvelopeMessages]
-type spectrumAnalyticsEventSummaryGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SpectrumAnalyticsEventSummaryGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r spectrumAnalyticsEventSummaryGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type SpectrumAnalyticsEventSummaryGetResponseEnvelopeSuccess bool
-
-const (
- SpectrumAnalyticsEventSummaryGetResponseEnvelopeSuccessTrue SpectrumAnalyticsEventSummaryGetResponseEnvelopeSuccess = true
-)
diff --git a/spectrumanalyticseventsummary_test.go b/spectrumanalyticseventsummary_test.go
deleted file mode 100644
index f414a8a550e..00000000000
--- a/spectrumanalyticseventsummary_test.go
+++ /dev/null
@@ -1,50 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
- "time"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestSpectrumAnalyticsEventSummaryGetWithOptionalParams(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"),
- )
- _, err := client.Spectrum.Analytics.Events.Summaries.Get(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.SpectrumAnalyticsEventSummaryGetParams{
- Dimensions: cloudflare.F([]cloudflare.SpectrumAnalyticsEventSummaryGetParamsDimension{cloudflare.SpectrumAnalyticsEventSummaryGetParamsDimensionEvent, cloudflare.SpectrumAnalyticsEventSummaryGetParamsDimensionAppID}),
- Filters: cloudflare.F("event==disconnect%20AND%20coloName!=SFO"),
- Metrics: cloudflare.F([]cloudflare.SpectrumAnalyticsEventSummaryGetParamsMetric{cloudflare.SpectrumAnalyticsEventSummaryGetParamsMetricCount, cloudflare.SpectrumAnalyticsEventSummaryGetParamsMetricBytesIngress}),
- Since: cloudflare.F(time.Now()),
- Sort: cloudflare.F([]interface{}{"+count", "-bytesIngress"}),
- Until: cloudflare.F(time.Now()),
- },
- )
- 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/spectrumapp.go b/spectrumapp.go
deleted file mode 100644
index 89d5440642d..00000000000
--- a/spectrumapp.go
+++ /dev/null
@@ -1,1569 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
- "reflect"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/option"
- "github.com/tidwall/gjson"
-)
-
-// SpectrumAppService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewSpectrumAppService] method
-// instead.
-type SpectrumAppService struct {
- Options []option.RequestOption
-}
-
-// NewSpectrumAppService generates a new service that applies the given options to
-// each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewSpectrumAppService(opts ...option.RequestOption) (r *SpectrumAppService) {
- r = &SpectrumAppService{}
- r.Options = opts
- return
-}
-
-// Creates a new Spectrum application from a configuration using a name for the
-// origin.
-func (r *SpectrumAppService) New(ctx context.Context, zone string, body SpectrumAppNewParams, opts ...option.RequestOption) (res *SpectrumAppNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env SpectrumAppNewResponseEnvelope
- path := fmt.Sprintf("zones/%s/spectrum/apps", zone)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Updates a previously existing application's configuration that uses a name for
-// the origin.
-func (r *SpectrumAppService) Update(ctx context.Context, zone string, appID string, body SpectrumAppUpdateParams, opts ...option.RequestOption) (res *SpectrumAppUpdateResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env SpectrumAppUpdateResponseEnvelope
- path := fmt.Sprintf("zones/%s/spectrum/apps/%s", zone, appID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Retrieves a list of currently existing Spectrum applications inside a zone.
-func (r *SpectrumAppService) List(ctx context.Context, zone string, query SpectrumAppListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[SpectrumAppListResponse], err error) {
- var raw *http.Response
- opts = append(r.Options, opts...)
- opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
- path := fmt.Sprintf("zones/%s/spectrum/apps", zone)
- cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...)
- if err != nil {
- return nil, err
- }
- err = cfg.Execute()
- if err != nil {
- return nil, err
- }
- res.SetPageConfig(cfg, raw)
- return res, nil
-}
-
-// Retrieves a list of currently existing Spectrum applications inside a zone.
-func (r *SpectrumAppService) ListAutoPaging(ctx context.Context, zone string, query SpectrumAppListParams, opts ...option.RequestOption) *shared.V4PagePaginationArrayAutoPager[SpectrumAppListResponse] {
- return shared.NewV4PagePaginationArrayAutoPager(r.List(ctx, zone, query, opts...))
-}
-
-// Deletes a previously existing application.
-func (r *SpectrumAppService) Delete(ctx context.Context, zone string, appID string, opts ...option.RequestOption) (res *SpectrumAppDeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env SpectrumAppDeleteResponseEnvelope
- path := fmt.Sprintf("zones/%s/spectrum/apps/%s", zone, appID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Gets the application configuration of a specific application inside a zone.
-func (r *SpectrumAppService) Get(ctx context.Context, zone string, appID string, opts ...option.RequestOption) (res *SpectrumAppGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env SpectrumAppGetResponseEnvelope
- path := fmt.Sprintf("zones/%s/spectrum/apps/%s", zone, appID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type SpectrumAppNewResponse struct {
- // Application identifier.
- ID string `json:"id"`
- // Enables Argo Smart Routing for this application. Notes: Only available for TCP
- // applications with traffic_type set to "direct".
- ArgoSmartRouting bool `json:"argo_smart_routing"`
- // When the Application was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // The name and type of DNS record for the Spectrum application.
- DNS SpectrumAppNewResponseDNS `json:"dns"`
- // The anycast edge IP configuration for the hostname of this application.
- EdgeIPs SpectrumAppNewResponseEdgeIPs `json:"edge_ips"`
- // Enables IP Access Rules for this application. Notes: Only available for TCP
- // applications.
- IPFirewall bool `json:"ip_firewall"`
- // When the Application was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // The name and type of DNS record for the Spectrum application.
- OriginDNS SpectrumAppNewResponseOriginDNS `json:"origin_dns"`
- // The destination port at the origin. Only specified in conjunction with
- // origin_dns. May use an integer to specify a single origin port, for example
- // `1000`, or a string to specify a range of origin ports, for example
- // `"1000-2000"`. Notes: If specifying a port range, the number of ports in the
- // range must match the number of ports specified in the "protocol" field.
- OriginPort SpectrumAppNewResponseOriginPort `json:"origin_port"`
- // The port configuration at Cloudflare’s edge. May specify a single port, for
- // example `"tcp/1000"`, or a range of ports, for example `"tcp/1000-2000"`.
- Protocol string `json:"protocol"`
- // Enables Proxy Protocol to the origin. Refer to
- // [Enable Proxy protocol](https://developers.cloudflare.com/spectrum/getting-started/proxy-protocol/)
- // for implementation details on PROXY Protocol V1, PROXY Protocol V2, and Simple
- // Proxy Protocol.
- ProxyProtocol SpectrumAppNewResponseProxyProtocol `json:"proxy_protocol"`
- // The type of TLS termination associated with the application.
- TLS SpectrumAppNewResponseTLS `json:"tls"`
- // Determines how data travels from the edge to your origin. When set to "direct",
- // Spectrum will send traffic directly to your origin, and the application's type
- // is derived from the `protocol`. When set to "http" or "https", Spectrum will
- // apply Cloudflare's HTTP/HTTPS features as it sends traffic to your origin, and
- // the application type matches this property exactly.
- TrafficType SpectrumAppNewResponseTrafficType `json:"traffic_type"`
- JSON spectrumAppNewResponseJSON `json:"-"`
-}
-
-// spectrumAppNewResponseJSON contains the JSON metadata for the struct
-// [SpectrumAppNewResponse]
-type spectrumAppNewResponseJSON struct {
- ID apijson.Field
- ArgoSmartRouting apijson.Field
- CreatedOn apijson.Field
- DNS apijson.Field
- EdgeIPs apijson.Field
- IPFirewall apijson.Field
- ModifiedOn apijson.Field
- OriginDNS apijson.Field
- OriginPort apijson.Field
- Protocol apijson.Field
- ProxyProtocol apijson.Field
- TLS apijson.Field
- TrafficType apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SpectrumAppNewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r spectrumAppNewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// The name and type of DNS record for the Spectrum application.
-type SpectrumAppNewResponseDNS struct {
- // The name of the DNS record associated with the application.
- Name string `json:"name" format:"hostname"`
- // The type of DNS record associated with the application.
- Type SpectrumAppNewResponseDNSType `json:"type"`
- JSON spectrumAppNewResponseDNSJSON `json:"-"`
-}
-
-// spectrumAppNewResponseDNSJSON contains the JSON metadata for the struct
-// [SpectrumAppNewResponseDNS]
-type spectrumAppNewResponseDNSJSON struct {
- Name apijson.Field
- Type apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SpectrumAppNewResponseDNS) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r spectrumAppNewResponseDNSJSON) RawJSON() string {
- return r.raw
-}
-
-// The type of DNS record associated with the application.
-type SpectrumAppNewResponseDNSType string
-
-const (
- SpectrumAppNewResponseDNSTypeCNAME SpectrumAppNewResponseDNSType = "CNAME"
- SpectrumAppNewResponseDNSTypeAddress SpectrumAppNewResponseDNSType = "ADDRESS"
-)
-
-// The anycast edge IP configuration for the hostname of this application.
-//
-// Union satisfied by
-// [SpectrumAppNewResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariable] or
-// [SpectrumAppNewResponseEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariable].
-type SpectrumAppNewResponseEdgeIPs interface {
- implementsSpectrumAppNewResponseEdgeIPs()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*SpectrumAppNewResponseEdgeIPs)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(SpectrumAppNewResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariable{}),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(SpectrumAppNewResponseEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariable{}),
- },
- )
-}
-
-type SpectrumAppNewResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariable struct {
- // The IP versions supported for inbound connections on Spectrum anycast IPs.
- Connectivity SpectrumAppNewResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariableConnectivity `json:"connectivity"`
- // The type of edge IP configuration specified. Dynamically allocated edge IPs use
- // Spectrum anycast IPs in accordance with the connectivity you specify. Only valid
- // with CNAME DNS names.
- Type SpectrumAppNewResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariableType `json:"type"`
- JSON spectrumAppNewResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariableJSON `json:"-"`
-}
-
-// spectrumAppNewResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariableJSON contains the
-// JSON metadata for the struct
-// [SpectrumAppNewResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariable]
-type spectrumAppNewResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariableJSON struct {
- Connectivity apijson.Field
- Type apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SpectrumAppNewResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariable) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r spectrumAppNewResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariableJSON) RawJSON() string {
- return r.raw
-}
-
-func (r SpectrumAppNewResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariable) implementsSpectrumAppNewResponseEdgeIPs() {
-}
-
-// The IP versions supported for inbound connections on Spectrum anycast IPs.
-type SpectrumAppNewResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariableConnectivity string
-
-const (
- SpectrumAppNewResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariableConnectivityAll SpectrumAppNewResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariableConnectivity = "all"
- SpectrumAppNewResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariableConnectivityIPV4 SpectrumAppNewResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariableConnectivity = "ipv4"
- SpectrumAppNewResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariableConnectivityIPV6 SpectrumAppNewResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariableConnectivity = "ipv6"
-)
-
-// The type of edge IP configuration specified. Dynamically allocated edge IPs use
-// Spectrum anycast IPs in accordance with the connectivity you specify. Only valid
-// with CNAME DNS names.
-type SpectrumAppNewResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariableType string
-
-const (
- SpectrumAppNewResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariableTypeDynamic SpectrumAppNewResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariableType = "dynamic"
-)
-
-type SpectrumAppNewResponseEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariable struct {
- // The array of customer owned IPs we broadcast via anycast for this hostname and
- // application.
- IPs []string `json:"ips"`
- // The type of edge IP configuration specified. Statically allocated edge IPs use
- // customer IPs in accordance with the ips array you specify. Only valid with
- // ADDRESS DNS names.
- Type SpectrumAppNewResponseEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariableType `json:"type"`
- JSON spectrumAppNewResponseEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariableJSON `json:"-"`
-}
-
-// spectrumAppNewResponseEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariableJSON contains
-// the JSON metadata for the struct
-// [SpectrumAppNewResponseEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariable]
-type spectrumAppNewResponseEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariableJSON struct {
- IPs apijson.Field
- Type apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SpectrumAppNewResponseEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariable) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r spectrumAppNewResponseEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariableJSON) RawJSON() string {
- return r.raw
-}
-
-func (r SpectrumAppNewResponseEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariable) implementsSpectrumAppNewResponseEdgeIPs() {
-}
-
-// The type of edge IP configuration specified. Statically allocated edge IPs use
-// customer IPs in accordance with the ips array you specify. Only valid with
-// ADDRESS DNS names.
-type SpectrumAppNewResponseEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariableType string
-
-const (
- SpectrumAppNewResponseEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariableTypeStatic SpectrumAppNewResponseEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariableType = "static"
-)
-
-// The name and type of DNS record for the Spectrum application.
-type SpectrumAppNewResponseOriginDNS struct {
- // The name of the DNS record associated with the origin.
- Name string `json:"name" format:"hostname"`
- // The TTL of our resolution of your DNS record in seconds.
- TTL int64 `json:"ttl"`
- // The type of DNS record associated with the origin. "" is used to specify a
- // combination of A/AAAA records.
- Type SpectrumAppNewResponseOriginDNSType `json:"type"`
- JSON spectrumAppNewResponseOriginDNSJSON `json:"-"`
-}
-
-// spectrumAppNewResponseOriginDNSJSON contains the JSON metadata for the struct
-// [SpectrumAppNewResponseOriginDNS]
-type spectrumAppNewResponseOriginDNSJSON struct {
- Name apijson.Field
- TTL apijson.Field
- Type apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SpectrumAppNewResponseOriginDNS) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r spectrumAppNewResponseOriginDNSJSON) RawJSON() string {
- return r.raw
-}
-
-// The type of DNS record associated with the origin. "" is used to specify a
-// combination of A/AAAA records.
-type SpectrumAppNewResponseOriginDNSType string
-
-const (
- SpectrumAppNewResponseOriginDNSTypeEmpty SpectrumAppNewResponseOriginDNSType = ""
- SpectrumAppNewResponseOriginDNSTypeA SpectrumAppNewResponseOriginDNSType = "A"
- SpectrumAppNewResponseOriginDNSTypeAAAA SpectrumAppNewResponseOriginDNSType = "AAAA"
- SpectrumAppNewResponseOriginDNSTypeSRV SpectrumAppNewResponseOriginDNSType = "SRV"
-)
-
-// The destination port at the origin. Only specified in conjunction with
-// origin_dns. May use an integer to specify a single origin port, for example
-// `1000`, or a string to specify a range of origin ports, for example
-// `"1000-2000"`. Notes: If specifying a port range, the number of ports in the
-// range must match the number of ports specified in the "protocol" field.
-//
-// Union satisfied by [shared.UnionInt] or [shared.UnionString].
-type SpectrumAppNewResponseOriginPort interface {
- ImplementsSpectrumAppNewResponseOriginPort()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*SpectrumAppNewResponseOriginPort)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionInt(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-// Enables Proxy Protocol to the origin. Refer to
-// [Enable Proxy protocol](https://developers.cloudflare.com/spectrum/getting-started/proxy-protocol/)
-// for implementation details on PROXY Protocol V1, PROXY Protocol V2, and Simple
-// Proxy Protocol.
-type SpectrumAppNewResponseProxyProtocol string
-
-const (
- SpectrumAppNewResponseProxyProtocolOff SpectrumAppNewResponseProxyProtocol = "off"
- SpectrumAppNewResponseProxyProtocolV1 SpectrumAppNewResponseProxyProtocol = "v1"
- SpectrumAppNewResponseProxyProtocolV2 SpectrumAppNewResponseProxyProtocol = "v2"
- SpectrumAppNewResponseProxyProtocolSimple SpectrumAppNewResponseProxyProtocol = "simple"
-)
-
-// The type of TLS termination associated with the application.
-type SpectrumAppNewResponseTLS string
-
-const (
- SpectrumAppNewResponseTLSOff SpectrumAppNewResponseTLS = "off"
- SpectrumAppNewResponseTLSFlexible SpectrumAppNewResponseTLS = "flexible"
- SpectrumAppNewResponseTLSFull SpectrumAppNewResponseTLS = "full"
- SpectrumAppNewResponseTLSStrict SpectrumAppNewResponseTLS = "strict"
-)
-
-// Determines how data travels from the edge to your origin. When set to "direct",
-// Spectrum will send traffic directly to your origin, and the application's type
-// is derived from the `protocol`. When set to "http" or "https", Spectrum will
-// apply Cloudflare's HTTP/HTTPS features as it sends traffic to your origin, and
-// the application type matches this property exactly.
-type SpectrumAppNewResponseTrafficType string
-
-const (
- SpectrumAppNewResponseTrafficTypeDirect SpectrumAppNewResponseTrafficType = "direct"
- SpectrumAppNewResponseTrafficTypeHTTP SpectrumAppNewResponseTrafficType = "http"
- SpectrumAppNewResponseTrafficTypeHTTPS SpectrumAppNewResponseTrafficType = "https"
-)
-
-type SpectrumAppUpdateResponse struct {
- // Application identifier.
- ID string `json:"id"`
- // Enables Argo Smart Routing for this application. Notes: Only available for TCP
- // applications with traffic_type set to "direct".
- ArgoSmartRouting bool `json:"argo_smart_routing"`
- // When the Application was created.
- CreatedOn time.Time `json:"created_on" format:"date-time"`
- // The name and type of DNS record for the Spectrum application.
- DNS SpectrumAppUpdateResponseDNS `json:"dns"`
- // The anycast edge IP configuration for the hostname of this application.
- EdgeIPs SpectrumAppUpdateResponseEdgeIPs `json:"edge_ips"`
- // Enables IP Access Rules for this application. Notes: Only available for TCP
- // applications.
- IPFirewall bool `json:"ip_firewall"`
- // When the Application was last modified.
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- // The name and type of DNS record for the Spectrum application.
- OriginDNS SpectrumAppUpdateResponseOriginDNS `json:"origin_dns"`
- // The destination port at the origin. Only specified in conjunction with
- // origin_dns. May use an integer to specify a single origin port, for example
- // `1000`, or a string to specify a range of origin ports, for example
- // `"1000-2000"`. Notes: If specifying a port range, the number of ports in the
- // range must match the number of ports specified in the "protocol" field.
- OriginPort SpectrumAppUpdateResponseOriginPort `json:"origin_port"`
- // The port configuration at Cloudflare’s edge. May specify a single port, for
- // example `"tcp/1000"`, or a range of ports, for example `"tcp/1000-2000"`.
- Protocol string `json:"protocol"`
- // Enables Proxy Protocol to the origin. Refer to
- // [Enable Proxy protocol](https://developers.cloudflare.com/spectrum/getting-started/proxy-protocol/)
- // for implementation details on PROXY Protocol V1, PROXY Protocol V2, and Simple
- // Proxy Protocol.
- ProxyProtocol SpectrumAppUpdateResponseProxyProtocol `json:"proxy_protocol"`
- // The type of TLS termination associated with the application.
- TLS SpectrumAppUpdateResponseTLS `json:"tls"`
- // Determines how data travels from the edge to your origin. When set to "direct",
- // Spectrum will send traffic directly to your origin, and the application's type
- // is derived from the `protocol`. When set to "http" or "https", Spectrum will
- // apply Cloudflare's HTTP/HTTPS features as it sends traffic to your origin, and
- // the application type matches this property exactly.
- TrafficType SpectrumAppUpdateResponseTrafficType `json:"traffic_type"`
- JSON spectrumAppUpdateResponseJSON `json:"-"`
-}
-
-// spectrumAppUpdateResponseJSON contains the JSON metadata for the struct
-// [SpectrumAppUpdateResponse]
-type spectrumAppUpdateResponseJSON struct {
- ID apijson.Field
- ArgoSmartRouting apijson.Field
- CreatedOn apijson.Field
- DNS apijson.Field
- EdgeIPs apijson.Field
- IPFirewall apijson.Field
- ModifiedOn apijson.Field
- OriginDNS apijson.Field
- OriginPort apijson.Field
- Protocol apijson.Field
- ProxyProtocol apijson.Field
- TLS apijson.Field
- TrafficType apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SpectrumAppUpdateResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r spectrumAppUpdateResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// The name and type of DNS record for the Spectrum application.
-type SpectrumAppUpdateResponseDNS struct {
- // The name of the DNS record associated with the application.
- Name string `json:"name" format:"hostname"`
- // The type of DNS record associated with the application.
- Type SpectrumAppUpdateResponseDNSType `json:"type"`
- JSON spectrumAppUpdateResponseDNSJSON `json:"-"`
-}
-
-// spectrumAppUpdateResponseDNSJSON contains the JSON metadata for the struct
-// [SpectrumAppUpdateResponseDNS]
-type spectrumAppUpdateResponseDNSJSON struct {
- Name apijson.Field
- Type apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SpectrumAppUpdateResponseDNS) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r spectrumAppUpdateResponseDNSJSON) RawJSON() string {
- return r.raw
-}
-
-// The type of DNS record associated with the application.
-type SpectrumAppUpdateResponseDNSType string
-
-const (
- SpectrumAppUpdateResponseDNSTypeCNAME SpectrumAppUpdateResponseDNSType = "CNAME"
- SpectrumAppUpdateResponseDNSTypeAddress SpectrumAppUpdateResponseDNSType = "ADDRESS"
-)
-
-// The anycast edge IP configuration for the hostname of this application.
-//
-// Union satisfied by
-// [SpectrumAppUpdateResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariable] or
-// [SpectrumAppUpdateResponseEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariable].
-type SpectrumAppUpdateResponseEdgeIPs interface {
- implementsSpectrumAppUpdateResponseEdgeIPs()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*SpectrumAppUpdateResponseEdgeIPs)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(SpectrumAppUpdateResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariable{}),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(SpectrumAppUpdateResponseEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariable{}),
- },
- )
-}
-
-type SpectrumAppUpdateResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariable struct {
- // The IP versions supported for inbound connections on Spectrum anycast IPs.
- Connectivity SpectrumAppUpdateResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariableConnectivity `json:"connectivity"`
- // The type of edge IP configuration specified. Dynamically allocated edge IPs use
- // Spectrum anycast IPs in accordance with the connectivity you specify. Only valid
- // with CNAME DNS names.
- Type SpectrumAppUpdateResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariableType `json:"type"`
- JSON spectrumAppUpdateResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariableJSON `json:"-"`
-}
-
-// spectrumAppUpdateResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariableJSON contains
-// the JSON metadata for the struct
-// [SpectrumAppUpdateResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariable]
-type spectrumAppUpdateResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariableJSON struct {
- Connectivity apijson.Field
- Type apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SpectrumAppUpdateResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariable) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r spectrumAppUpdateResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariableJSON) RawJSON() string {
- return r.raw
-}
-
-func (r SpectrumAppUpdateResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariable) implementsSpectrumAppUpdateResponseEdgeIPs() {
-}
-
-// The IP versions supported for inbound connections on Spectrum anycast IPs.
-type SpectrumAppUpdateResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariableConnectivity string
-
-const (
- SpectrumAppUpdateResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariableConnectivityAll SpectrumAppUpdateResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariableConnectivity = "all"
- SpectrumAppUpdateResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariableConnectivityIPV4 SpectrumAppUpdateResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariableConnectivity = "ipv4"
- SpectrumAppUpdateResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariableConnectivityIPV6 SpectrumAppUpdateResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariableConnectivity = "ipv6"
-)
-
-// The type of edge IP configuration specified. Dynamically allocated edge IPs use
-// Spectrum anycast IPs in accordance with the connectivity you specify. Only valid
-// with CNAME DNS names.
-type SpectrumAppUpdateResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariableType string
-
-const (
- SpectrumAppUpdateResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariableTypeDynamic SpectrumAppUpdateResponseEdgeIPsSpectrumEdgeIPEyeballIPsVariableType = "dynamic"
-)
-
-type SpectrumAppUpdateResponseEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariable struct {
- // The array of customer owned IPs we broadcast via anycast for this hostname and
- // application.
- IPs []string `json:"ips"`
- // The type of edge IP configuration specified. Statically allocated edge IPs use
- // customer IPs in accordance with the ips array you specify. Only valid with
- // ADDRESS DNS names.
- Type SpectrumAppUpdateResponseEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariableType `json:"type"`
- JSON spectrumAppUpdateResponseEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariableJSON `json:"-"`
-}
-
-// spectrumAppUpdateResponseEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariableJSON
-// contains the JSON metadata for the struct
-// [SpectrumAppUpdateResponseEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariable]
-type spectrumAppUpdateResponseEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariableJSON struct {
- IPs apijson.Field
- Type apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SpectrumAppUpdateResponseEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariable) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r spectrumAppUpdateResponseEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariableJSON) RawJSON() string {
- return r.raw
-}
-
-func (r SpectrumAppUpdateResponseEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariable) implementsSpectrumAppUpdateResponseEdgeIPs() {
-}
-
-// The type of edge IP configuration specified. Statically allocated edge IPs use
-// customer IPs in accordance with the ips array you specify. Only valid with
-// ADDRESS DNS names.
-type SpectrumAppUpdateResponseEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariableType string
-
-const (
- SpectrumAppUpdateResponseEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariableTypeStatic SpectrumAppUpdateResponseEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariableType = "static"
-)
-
-// The name and type of DNS record for the Spectrum application.
-type SpectrumAppUpdateResponseOriginDNS struct {
- // The name of the DNS record associated with the origin.
- Name string `json:"name" format:"hostname"`
- // The TTL of our resolution of your DNS record in seconds.
- TTL int64 `json:"ttl"`
- // The type of DNS record associated with the origin. "" is used to specify a
- // combination of A/AAAA records.
- Type SpectrumAppUpdateResponseOriginDNSType `json:"type"`
- JSON spectrumAppUpdateResponseOriginDNSJSON `json:"-"`
-}
-
-// spectrumAppUpdateResponseOriginDNSJSON contains the JSON metadata for the struct
-// [SpectrumAppUpdateResponseOriginDNS]
-type spectrumAppUpdateResponseOriginDNSJSON struct {
- Name apijson.Field
- TTL apijson.Field
- Type apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SpectrumAppUpdateResponseOriginDNS) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r spectrumAppUpdateResponseOriginDNSJSON) RawJSON() string {
- return r.raw
-}
-
-// The type of DNS record associated with the origin. "" is used to specify a
-// combination of A/AAAA records.
-type SpectrumAppUpdateResponseOriginDNSType string
-
-const (
- SpectrumAppUpdateResponseOriginDNSTypeEmpty SpectrumAppUpdateResponseOriginDNSType = ""
- SpectrumAppUpdateResponseOriginDNSTypeA SpectrumAppUpdateResponseOriginDNSType = "A"
- SpectrumAppUpdateResponseOriginDNSTypeAAAA SpectrumAppUpdateResponseOriginDNSType = "AAAA"
- SpectrumAppUpdateResponseOriginDNSTypeSRV SpectrumAppUpdateResponseOriginDNSType = "SRV"
-)
-
-// The destination port at the origin. Only specified in conjunction with
-// origin_dns. May use an integer to specify a single origin port, for example
-// `1000`, or a string to specify a range of origin ports, for example
-// `"1000-2000"`. Notes: If specifying a port range, the number of ports in the
-// range must match the number of ports specified in the "protocol" field.
-//
-// Union satisfied by [shared.UnionInt] or [shared.UnionString].
-type SpectrumAppUpdateResponseOriginPort interface {
- ImplementsSpectrumAppUpdateResponseOriginPort()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*SpectrumAppUpdateResponseOriginPort)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.Number,
- Type: reflect.TypeOf(shared.UnionInt(0)),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-// Enables Proxy Protocol to the origin. Refer to
-// [Enable Proxy protocol](https://developers.cloudflare.com/spectrum/getting-started/proxy-protocol/)
-// for implementation details on PROXY Protocol V1, PROXY Protocol V2, and Simple
-// Proxy Protocol.
-type SpectrumAppUpdateResponseProxyProtocol string
-
-const (
- SpectrumAppUpdateResponseProxyProtocolOff SpectrumAppUpdateResponseProxyProtocol = "off"
- SpectrumAppUpdateResponseProxyProtocolV1 SpectrumAppUpdateResponseProxyProtocol = "v1"
- SpectrumAppUpdateResponseProxyProtocolV2 SpectrumAppUpdateResponseProxyProtocol = "v2"
- SpectrumAppUpdateResponseProxyProtocolSimple SpectrumAppUpdateResponseProxyProtocol = "simple"
-)
-
-// The type of TLS termination associated with the application.
-type SpectrumAppUpdateResponseTLS string
-
-const (
- SpectrumAppUpdateResponseTLSOff SpectrumAppUpdateResponseTLS = "off"
- SpectrumAppUpdateResponseTLSFlexible SpectrumAppUpdateResponseTLS = "flexible"
- SpectrumAppUpdateResponseTLSFull SpectrumAppUpdateResponseTLS = "full"
- SpectrumAppUpdateResponseTLSStrict SpectrumAppUpdateResponseTLS = "strict"
-)
-
-// Determines how data travels from the edge to your origin. When set to "direct",
-// Spectrum will send traffic directly to your origin, and the application's type
-// is derived from the `protocol`. When set to "http" or "https", Spectrum will
-// apply Cloudflare's HTTP/HTTPS features as it sends traffic to your origin, and
-// the application type matches this property exactly.
-type SpectrumAppUpdateResponseTrafficType string
-
-const (
- SpectrumAppUpdateResponseTrafficTypeDirect SpectrumAppUpdateResponseTrafficType = "direct"
- SpectrumAppUpdateResponseTrafficTypeHTTP SpectrumAppUpdateResponseTrafficType = "http"
- SpectrumAppUpdateResponseTrafficTypeHTTPS SpectrumAppUpdateResponseTrafficType = "https"
-)
-
-type SpectrumAppListResponse = interface{}
-
-type SpectrumAppDeleteResponse struct {
- // Application identifier.
- ID string `json:"id"`
- JSON spectrumAppDeleteResponseJSON `json:"-"`
-}
-
-// spectrumAppDeleteResponseJSON contains the JSON metadata for the struct
-// [SpectrumAppDeleteResponse]
-type spectrumAppDeleteResponseJSON struct {
- ID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SpectrumAppDeleteResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r spectrumAppDeleteResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// Union satisfied by [SpectrumAppGetResponseUnknown] or [shared.UnionString].
-type SpectrumAppGetResponse interface {
- ImplementsSpectrumAppGetResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*SpectrumAppGetResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-type SpectrumAppNewParams struct {
- // The name and type of DNS record for the Spectrum application.
- DNS param.Field[SpectrumAppNewParamsDNS] `json:"dns,required"`
- // The name and type of DNS record for the Spectrum application.
- OriginDNS param.Field[SpectrumAppNewParamsOriginDNS] `json:"origin_dns,required"`
- // The destination port at the origin. Only specified in conjunction with
- // origin_dns. May use an integer to specify a single origin port, for example
- // `1000`, or a string to specify a range of origin ports, for example
- // `"1000-2000"`. Notes: If specifying a port range, the number of ports in the
- // range must match the number of ports specified in the "protocol" field.
- OriginPort param.Field[SpectrumAppNewParamsOriginPort] `json:"origin_port,required"`
- // The port configuration at Cloudflare’s edge. May specify a single port, for
- // example `"tcp/1000"`, or a range of ports, for example `"tcp/1000-2000"`.
- Protocol param.Field[string] `json:"protocol,required"`
- // Enables Argo Smart Routing for this application. Notes: Only available for TCP
- // applications with traffic_type set to "direct".
- ArgoSmartRouting param.Field[bool] `json:"argo_smart_routing"`
- // The anycast edge IP configuration for the hostname of this application.
- EdgeIPs param.Field[SpectrumAppNewParamsEdgeIPs] `json:"edge_ips"`
- // Enables IP Access Rules for this application. Notes: Only available for TCP
- // applications.
- IPFirewall param.Field[bool] `json:"ip_firewall"`
- // Enables Proxy Protocol to the origin. Refer to
- // [Enable Proxy protocol](https://developers.cloudflare.com/spectrum/getting-started/proxy-protocol/)
- // for implementation details on PROXY Protocol V1, PROXY Protocol V2, and Simple
- // Proxy Protocol.
- ProxyProtocol param.Field[SpectrumAppNewParamsProxyProtocol] `json:"proxy_protocol"`
- // The type of TLS termination associated with the application.
- TLS param.Field[SpectrumAppNewParamsTLS] `json:"tls"`
- // Determines how data travels from the edge to your origin. When set to "direct",
- // Spectrum will send traffic directly to your origin, and the application's type
- // is derived from the `protocol`. When set to "http" or "https", Spectrum will
- // apply Cloudflare's HTTP/HTTPS features as it sends traffic to your origin, and
- // the application type matches this property exactly.
- TrafficType param.Field[SpectrumAppNewParamsTrafficType] `json:"traffic_type"`
-}
-
-func (r SpectrumAppNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The name and type of DNS record for the Spectrum application.
-type SpectrumAppNewParamsDNS struct {
- // The name of the DNS record associated with the application.
- Name param.Field[string] `json:"name" format:"hostname"`
- // The type of DNS record associated with the application.
- Type param.Field[SpectrumAppNewParamsDNSType] `json:"type"`
-}
-
-func (r SpectrumAppNewParamsDNS) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The type of DNS record associated with the application.
-type SpectrumAppNewParamsDNSType string
-
-const (
- SpectrumAppNewParamsDNSTypeCNAME SpectrumAppNewParamsDNSType = "CNAME"
- SpectrumAppNewParamsDNSTypeAddress SpectrumAppNewParamsDNSType = "ADDRESS"
-)
-
-// The name and type of DNS record for the Spectrum application.
-type SpectrumAppNewParamsOriginDNS struct {
- // The name of the DNS record associated with the origin.
- Name param.Field[string] `json:"name" format:"hostname"`
- // The TTL of our resolution of your DNS record in seconds.
- TTL param.Field[int64] `json:"ttl"`
- // The type of DNS record associated with the origin. "" is used to specify a
- // combination of A/AAAA records.
- Type param.Field[SpectrumAppNewParamsOriginDNSType] `json:"type"`
-}
-
-func (r SpectrumAppNewParamsOriginDNS) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The type of DNS record associated with the origin. "" is used to specify a
-// combination of A/AAAA records.
-type SpectrumAppNewParamsOriginDNSType string
-
-const (
- SpectrumAppNewParamsOriginDNSTypeEmpty SpectrumAppNewParamsOriginDNSType = ""
- SpectrumAppNewParamsOriginDNSTypeA SpectrumAppNewParamsOriginDNSType = "A"
- SpectrumAppNewParamsOriginDNSTypeAAAA SpectrumAppNewParamsOriginDNSType = "AAAA"
- SpectrumAppNewParamsOriginDNSTypeSRV SpectrumAppNewParamsOriginDNSType = "SRV"
-)
-
-// The destination port at the origin. Only specified in conjunction with
-// origin_dns. May use an integer to specify a single origin port, for example
-// `1000`, or a string to specify a range of origin ports, for example
-// `"1000-2000"`. Notes: If specifying a port range, the number of ports in the
-// range must match the number of ports specified in the "protocol" field.
-//
-// Satisfied by [shared.UnionInt], [shared.UnionString].
-type SpectrumAppNewParamsOriginPort interface {
- ImplementsSpectrumAppNewParamsOriginPort()
-}
-
-// The anycast edge IP configuration for the hostname of this application.
-//
-// Satisfied by [SpectrumAppNewParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariable],
-// [SpectrumAppNewParamsEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariable].
-type SpectrumAppNewParamsEdgeIPs interface {
- implementsSpectrumAppNewParamsEdgeIPs()
-}
-
-type SpectrumAppNewParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariable struct {
- // The IP versions supported for inbound connections on Spectrum anycast IPs.
- Connectivity param.Field[SpectrumAppNewParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariableConnectivity] `json:"connectivity"`
- // The type of edge IP configuration specified. Dynamically allocated edge IPs use
- // Spectrum anycast IPs in accordance with the connectivity you specify. Only valid
- // with CNAME DNS names.
- Type param.Field[SpectrumAppNewParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariableType] `json:"type"`
-}
-
-func (r SpectrumAppNewParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariable) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-func (r SpectrumAppNewParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariable) implementsSpectrumAppNewParamsEdgeIPs() {
-}
-
-// The IP versions supported for inbound connections on Spectrum anycast IPs.
-type SpectrumAppNewParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariableConnectivity string
-
-const (
- SpectrumAppNewParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariableConnectivityAll SpectrumAppNewParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariableConnectivity = "all"
- SpectrumAppNewParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariableConnectivityIPV4 SpectrumAppNewParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariableConnectivity = "ipv4"
- SpectrumAppNewParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariableConnectivityIPV6 SpectrumAppNewParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariableConnectivity = "ipv6"
-)
-
-// The type of edge IP configuration specified. Dynamically allocated edge IPs use
-// Spectrum anycast IPs in accordance with the connectivity you specify. Only valid
-// with CNAME DNS names.
-type SpectrumAppNewParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariableType string
-
-const (
- SpectrumAppNewParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariableTypeDynamic SpectrumAppNewParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariableType = "dynamic"
-)
-
-type SpectrumAppNewParamsEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariable struct {
- // The array of customer owned IPs we broadcast via anycast for this hostname and
- // application.
- IPs param.Field[[]string] `json:"ips"`
- // The type of edge IP configuration specified. Statically allocated edge IPs use
- // customer IPs in accordance with the ips array you specify. Only valid with
- // ADDRESS DNS names.
- Type param.Field[SpectrumAppNewParamsEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariableType] `json:"type"`
-}
-
-func (r SpectrumAppNewParamsEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariable) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-func (r SpectrumAppNewParamsEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariable) implementsSpectrumAppNewParamsEdgeIPs() {
-}
-
-// The type of edge IP configuration specified. Statically allocated edge IPs use
-// customer IPs in accordance with the ips array you specify. Only valid with
-// ADDRESS DNS names.
-type SpectrumAppNewParamsEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariableType string
-
-const (
- SpectrumAppNewParamsEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariableTypeStatic SpectrumAppNewParamsEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariableType = "static"
-)
-
-// Enables Proxy Protocol to the origin. Refer to
-// [Enable Proxy protocol](https://developers.cloudflare.com/spectrum/getting-started/proxy-protocol/)
-// for implementation details on PROXY Protocol V1, PROXY Protocol V2, and Simple
-// Proxy Protocol.
-type SpectrumAppNewParamsProxyProtocol string
-
-const (
- SpectrumAppNewParamsProxyProtocolOff SpectrumAppNewParamsProxyProtocol = "off"
- SpectrumAppNewParamsProxyProtocolV1 SpectrumAppNewParamsProxyProtocol = "v1"
- SpectrumAppNewParamsProxyProtocolV2 SpectrumAppNewParamsProxyProtocol = "v2"
- SpectrumAppNewParamsProxyProtocolSimple SpectrumAppNewParamsProxyProtocol = "simple"
-)
-
-// The type of TLS termination associated with the application.
-type SpectrumAppNewParamsTLS string
-
-const (
- SpectrumAppNewParamsTLSOff SpectrumAppNewParamsTLS = "off"
- SpectrumAppNewParamsTLSFlexible SpectrumAppNewParamsTLS = "flexible"
- SpectrumAppNewParamsTLSFull SpectrumAppNewParamsTLS = "full"
- SpectrumAppNewParamsTLSStrict SpectrumAppNewParamsTLS = "strict"
-)
-
-// Determines how data travels from the edge to your origin. When set to "direct",
-// Spectrum will send traffic directly to your origin, and the application's type
-// is derived from the `protocol`. When set to "http" or "https", Spectrum will
-// apply Cloudflare's HTTP/HTTPS features as it sends traffic to your origin, and
-// the application type matches this property exactly.
-type SpectrumAppNewParamsTrafficType string
-
-const (
- SpectrumAppNewParamsTrafficTypeDirect SpectrumAppNewParamsTrafficType = "direct"
- SpectrumAppNewParamsTrafficTypeHTTP SpectrumAppNewParamsTrafficType = "http"
- SpectrumAppNewParamsTrafficTypeHTTPS SpectrumAppNewParamsTrafficType = "https"
-)
-
-type SpectrumAppNewResponseEnvelope struct {
- Errors []SpectrumAppNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []SpectrumAppNewResponseEnvelopeMessages `json:"messages,required"`
- Result SpectrumAppNewResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success SpectrumAppNewResponseEnvelopeSuccess `json:"success,required"`
- JSON spectrumAppNewResponseEnvelopeJSON `json:"-"`
-}
-
-// spectrumAppNewResponseEnvelopeJSON contains the JSON metadata for the struct
-// [SpectrumAppNewResponseEnvelope]
-type spectrumAppNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SpectrumAppNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r spectrumAppNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type SpectrumAppNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON spectrumAppNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// spectrumAppNewResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [SpectrumAppNewResponseEnvelopeErrors]
-type spectrumAppNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SpectrumAppNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r spectrumAppNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type SpectrumAppNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON spectrumAppNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// spectrumAppNewResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [SpectrumAppNewResponseEnvelopeMessages]
-type spectrumAppNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SpectrumAppNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r spectrumAppNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type SpectrumAppNewResponseEnvelopeSuccess bool
-
-const (
- SpectrumAppNewResponseEnvelopeSuccessTrue SpectrumAppNewResponseEnvelopeSuccess = true
-)
-
-type SpectrumAppUpdateParams struct {
- // The name and type of DNS record for the Spectrum application.
- DNS param.Field[SpectrumAppUpdateParamsDNS] `json:"dns,required"`
- // The name and type of DNS record for the Spectrum application.
- OriginDNS param.Field[SpectrumAppUpdateParamsOriginDNS] `json:"origin_dns,required"`
- // The destination port at the origin. Only specified in conjunction with
- // origin_dns. May use an integer to specify a single origin port, for example
- // `1000`, or a string to specify a range of origin ports, for example
- // `"1000-2000"`. Notes: If specifying a port range, the number of ports in the
- // range must match the number of ports specified in the "protocol" field.
- OriginPort param.Field[SpectrumAppUpdateParamsOriginPort] `json:"origin_port,required"`
- // The port configuration at Cloudflare’s edge. May specify a single port, for
- // example `"tcp/1000"`, or a range of ports, for example `"tcp/1000-2000"`.
- Protocol param.Field[string] `json:"protocol,required"`
- // Enables Argo Smart Routing for this application. Notes: Only available for TCP
- // applications with traffic_type set to "direct".
- ArgoSmartRouting param.Field[bool] `json:"argo_smart_routing"`
- // The anycast edge IP configuration for the hostname of this application.
- EdgeIPs param.Field[SpectrumAppUpdateParamsEdgeIPs] `json:"edge_ips"`
- // Enables IP Access Rules for this application. Notes: Only available for TCP
- // applications.
- IPFirewall param.Field[bool] `json:"ip_firewall"`
- // Enables Proxy Protocol to the origin. Refer to
- // [Enable Proxy protocol](https://developers.cloudflare.com/spectrum/getting-started/proxy-protocol/)
- // for implementation details on PROXY Protocol V1, PROXY Protocol V2, and Simple
- // Proxy Protocol.
- ProxyProtocol param.Field[SpectrumAppUpdateParamsProxyProtocol] `json:"proxy_protocol"`
- // The type of TLS termination associated with the application.
- TLS param.Field[SpectrumAppUpdateParamsTLS] `json:"tls"`
- // Determines how data travels from the edge to your origin. When set to "direct",
- // Spectrum will send traffic directly to your origin, and the application's type
- // is derived from the `protocol`. When set to "http" or "https", Spectrum will
- // apply Cloudflare's HTTP/HTTPS features as it sends traffic to your origin, and
- // the application type matches this property exactly.
- TrafficType param.Field[SpectrumAppUpdateParamsTrafficType] `json:"traffic_type"`
-}
-
-func (r SpectrumAppUpdateParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The name and type of DNS record for the Spectrum application.
-type SpectrumAppUpdateParamsDNS struct {
- // The name of the DNS record associated with the application.
- Name param.Field[string] `json:"name" format:"hostname"`
- // The type of DNS record associated with the application.
- Type param.Field[SpectrumAppUpdateParamsDNSType] `json:"type"`
-}
-
-func (r SpectrumAppUpdateParamsDNS) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The type of DNS record associated with the application.
-type SpectrumAppUpdateParamsDNSType string
-
-const (
- SpectrumAppUpdateParamsDNSTypeCNAME SpectrumAppUpdateParamsDNSType = "CNAME"
- SpectrumAppUpdateParamsDNSTypeAddress SpectrumAppUpdateParamsDNSType = "ADDRESS"
-)
-
-// The name and type of DNS record for the Spectrum application.
-type SpectrumAppUpdateParamsOriginDNS struct {
- // The name of the DNS record associated with the origin.
- Name param.Field[string] `json:"name" format:"hostname"`
- // The TTL of our resolution of your DNS record in seconds.
- TTL param.Field[int64] `json:"ttl"`
- // The type of DNS record associated with the origin. "" is used to specify a
- // combination of A/AAAA records.
- Type param.Field[SpectrumAppUpdateParamsOriginDNSType] `json:"type"`
-}
-
-func (r SpectrumAppUpdateParamsOriginDNS) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// The type of DNS record associated with the origin. "" is used to specify a
-// combination of A/AAAA records.
-type SpectrumAppUpdateParamsOriginDNSType string
-
-const (
- SpectrumAppUpdateParamsOriginDNSTypeEmpty SpectrumAppUpdateParamsOriginDNSType = ""
- SpectrumAppUpdateParamsOriginDNSTypeA SpectrumAppUpdateParamsOriginDNSType = "A"
- SpectrumAppUpdateParamsOriginDNSTypeAAAA SpectrumAppUpdateParamsOriginDNSType = "AAAA"
- SpectrumAppUpdateParamsOriginDNSTypeSRV SpectrumAppUpdateParamsOriginDNSType = "SRV"
-)
-
-// The destination port at the origin. Only specified in conjunction with
-// origin_dns. May use an integer to specify a single origin port, for example
-// `1000`, or a string to specify a range of origin ports, for example
-// `"1000-2000"`. Notes: If specifying a port range, the number of ports in the
-// range must match the number of ports specified in the "protocol" field.
-//
-// Satisfied by [shared.UnionInt], [shared.UnionString].
-type SpectrumAppUpdateParamsOriginPort interface {
- ImplementsSpectrumAppUpdateParamsOriginPort()
-}
-
-// The anycast edge IP configuration for the hostname of this application.
-//
-// Satisfied by [SpectrumAppUpdateParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariable],
-// [SpectrumAppUpdateParamsEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariable].
-type SpectrumAppUpdateParamsEdgeIPs interface {
- implementsSpectrumAppUpdateParamsEdgeIPs()
-}
-
-type SpectrumAppUpdateParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariable struct {
- // The IP versions supported for inbound connections on Spectrum anycast IPs.
- Connectivity param.Field[SpectrumAppUpdateParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariableConnectivity] `json:"connectivity"`
- // The type of edge IP configuration specified. Dynamically allocated edge IPs use
- // Spectrum anycast IPs in accordance with the connectivity you specify. Only valid
- // with CNAME DNS names.
- Type param.Field[SpectrumAppUpdateParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariableType] `json:"type"`
-}
-
-func (r SpectrumAppUpdateParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariable) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-func (r SpectrumAppUpdateParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariable) implementsSpectrumAppUpdateParamsEdgeIPs() {
-}
-
-// The IP versions supported for inbound connections on Spectrum anycast IPs.
-type SpectrumAppUpdateParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariableConnectivity string
-
-const (
- SpectrumAppUpdateParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariableConnectivityAll SpectrumAppUpdateParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariableConnectivity = "all"
- SpectrumAppUpdateParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariableConnectivityIPV4 SpectrumAppUpdateParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariableConnectivity = "ipv4"
- SpectrumAppUpdateParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariableConnectivityIPV6 SpectrumAppUpdateParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariableConnectivity = "ipv6"
-)
-
-// The type of edge IP configuration specified. Dynamically allocated edge IPs use
-// Spectrum anycast IPs in accordance with the connectivity you specify. Only valid
-// with CNAME DNS names.
-type SpectrumAppUpdateParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariableType string
-
-const (
- SpectrumAppUpdateParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariableTypeDynamic SpectrumAppUpdateParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariableType = "dynamic"
-)
-
-type SpectrumAppUpdateParamsEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariable struct {
- // The array of customer owned IPs we broadcast via anycast for this hostname and
- // application.
- IPs param.Field[[]string] `json:"ips"`
- // The type of edge IP configuration specified. Statically allocated edge IPs use
- // customer IPs in accordance with the ips array you specify. Only valid with
- // ADDRESS DNS names.
- Type param.Field[SpectrumAppUpdateParamsEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariableType] `json:"type"`
-}
-
-func (r SpectrumAppUpdateParamsEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariable) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-func (r SpectrumAppUpdateParamsEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariable) implementsSpectrumAppUpdateParamsEdgeIPs() {
-}
-
-// The type of edge IP configuration specified. Statically allocated edge IPs use
-// customer IPs in accordance with the ips array you specify. Only valid with
-// ADDRESS DNS names.
-type SpectrumAppUpdateParamsEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariableType string
-
-const (
- SpectrumAppUpdateParamsEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariableTypeStatic SpectrumAppUpdateParamsEdgeIPsSpectrumEdgeIPCustomerOwnedIPsVariableType = "static"
-)
-
-// Enables Proxy Protocol to the origin. Refer to
-// [Enable Proxy protocol](https://developers.cloudflare.com/spectrum/getting-started/proxy-protocol/)
-// for implementation details on PROXY Protocol V1, PROXY Protocol V2, and Simple
-// Proxy Protocol.
-type SpectrumAppUpdateParamsProxyProtocol string
-
-const (
- SpectrumAppUpdateParamsProxyProtocolOff SpectrumAppUpdateParamsProxyProtocol = "off"
- SpectrumAppUpdateParamsProxyProtocolV1 SpectrumAppUpdateParamsProxyProtocol = "v1"
- SpectrumAppUpdateParamsProxyProtocolV2 SpectrumAppUpdateParamsProxyProtocol = "v2"
- SpectrumAppUpdateParamsProxyProtocolSimple SpectrumAppUpdateParamsProxyProtocol = "simple"
-)
-
-// The type of TLS termination associated with the application.
-type SpectrumAppUpdateParamsTLS string
-
-const (
- SpectrumAppUpdateParamsTLSOff SpectrumAppUpdateParamsTLS = "off"
- SpectrumAppUpdateParamsTLSFlexible SpectrumAppUpdateParamsTLS = "flexible"
- SpectrumAppUpdateParamsTLSFull SpectrumAppUpdateParamsTLS = "full"
- SpectrumAppUpdateParamsTLSStrict SpectrumAppUpdateParamsTLS = "strict"
-)
-
-// Determines how data travels from the edge to your origin. When set to "direct",
-// Spectrum will send traffic directly to your origin, and the application's type
-// is derived from the `protocol`. When set to "http" or "https", Spectrum will
-// apply Cloudflare's HTTP/HTTPS features as it sends traffic to your origin, and
-// the application type matches this property exactly.
-type SpectrumAppUpdateParamsTrafficType string
-
-const (
- SpectrumAppUpdateParamsTrafficTypeDirect SpectrumAppUpdateParamsTrafficType = "direct"
- SpectrumAppUpdateParamsTrafficTypeHTTP SpectrumAppUpdateParamsTrafficType = "http"
- SpectrumAppUpdateParamsTrafficTypeHTTPS SpectrumAppUpdateParamsTrafficType = "https"
-)
-
-type SpectrumAppUpdateResponseEnvelope struct {
- Errors []SpectrumAppUpdateResponseEnvelopeErrors `json:"errors,required"`
- Messages []SpectrumAppUpdateResponseEnvelopeMessages `json:"messages,required"`
- Result SpectrumAppUpdateResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success SpectrumAppUpdateResponseEnvelopeSuccess `json:"success,required"`
- JSON spectrumAppUpdateResponseEnvelopeJSON `json:"-"`
-}
-
-// spectrumAppUpdateResponseEnvelopeJSON contains the JSON metadata for the struct
-// [SpectrumAppUpdateResponseEnvelope]
-type spectrumAppUpdateResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SpectrumAppUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r spectrumAppUpdateResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type SpectrumAppUpdateResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON spectrumAppUpdateResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// spectrumAppUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [SpectrumAppUpdateResponseEnvelopeErrors]
-type spectrumAppUpdateResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SpectrumAppUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r spectrumAppUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type SpectrumAppUpdateResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON spectrumAppUpdateResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// spectrumAppUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [SpectrumAppUpdateResponseEnvelopeMessages]
-type spectrumAppUpdateResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SpectrumAppUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r spectrumAppUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type SpectrumAppUpdateResponseEnvelopeSuccess bool
-
-const (
- SpectrumAppUpdateResponseEnvelopeSuccessTrue SpectrumAppUpdateResponseEnvelopeSuccess = true
-)
-
-type SpectrumAppListParams struct {
- // Sets the direction by which results are ordered.
- Direction param.Field[SpectrumAppListParamsDirection] `query:"direction"`
- // Application field by which results are ordered.
- Order param.Field[SpectrumAppListParamsOrder] `query:"order"`
- // Page number of paginated results. This parameter is required in order to use
- // other pagination parameters. If included in the query, `result_info` will be
- // present in the response.
- Page param.Field[float64] `query:"page"`
- // Sets the maximum number of results per page.
- PerPage param.Field[float64] `query:"per_page"`
-}
-
-// URLQuery serializes [SpectrumAppListParams]'s query parameters as `url.Values`.
-func (r SpectrumAppListParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Sets the direction by which results are ordered.
-type SpectrumAppListParamsDirection string
-
-const (
- SpectrumAppListParamsDirectionAsc SpectrumAppListParamsDirection = "asc"
- SpectrumAppListParamsDirectionDesc SpectrumAppListParamsDirection = "desc"
-)
-
-// Application field by which results are ordered.
-type SpectrumAppListParamsOrder string
-
-const (
- SpectrumAppListParamsOrderProtocol SpectrumAppListParamsOrder = "protocol"
- SpectrumAppListParamsOrderAppID SpectrumAppListParamsOrder = "app_id"
- SpectrumAppListParamsOrderCreatedOn SpectrumAppListParamsOrder = "created_on"
- SpectrumAppListParamsOrderModifiedOn SpectrumAppListParamsOrder = "modified_on"
- SpectrumAppListParamsOrderDNS SpectrumAppListParamsOrder = "dns"
-)
-
-type SpectrumAppDeleteResponseEnvelope struct {
- Errors []SpectrumAppDeleteResponseEnvelopeErrors `json:"errors,required"`
- Messages []SpectrumAppDeleteResponseEnvelopeMessages `json:"messages,required"`
- Result SpectrumAppDeleteResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success SpectrumAppDeleteResponseEnvelopeSuccess `json:"success,required"`
- JSON spectrumAppDeleteResponseEnvelopeJSON `json:"-"`
-}
-
-// spectrumAppDeleteResponseEnvelopeJSON contains the JSON metadata for the struct
-// [SpectrumAppDeleteResponseEnvelope]
-type spectrumAppDeleteResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SpectrumAppDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r spectrumAppDeleteResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type SpectrumAppDeleteResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON spectrumAppDeleteResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// spectrumAppDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [SpectrumAppDeleteResponseEnvelopeErrors]
-type spectrumAppDeleteResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SpectrumAppDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r spectrumAppDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type SpectrumAppDeleteResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON spectrumAppDeleteResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// spectrumAppDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [SpectrumAppDeleteResponseEnvelopeMessages]
-type spectrumAppDeleteResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SpectrumAppDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r spectrumAppDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type SpectrumAppDeleteResponseEnvelopeSuccess bool
-
-const (
- SpectrumAppDeleteResponseEnvelopeSuccessTrue SpectrumAppDeleteResponseEnvelopeSuccess = true
-)
-
-type SpectrumAppGetResponseEnvelope struct {
- Errors []SpectrumAppGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []SpectrumAppGetResponseEnvelopeMessages `json:"messages,required"`
- Result SpectrumAppGetResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success SpectrumAppGetResponseEnvelopeSuccess `json:"success,required"`
- JSON spectrumAppGetResponseEnvelopeJSON `json:"-"`
-}
-
-// spectrumAppGetResponseEnvelopeJSON contains the JSON metadata for the struct
-// [SpectrumAppGetResponseEnvelope]
-type spectrumAppGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SpectrumAppGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r spectrumAppGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type SpectrumAppGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON spectrumAppGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// spectrumAppGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [SpectrumAppGetResponseEnvelopeErrors]
-type spectrumAppGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SpectrumAppGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r spectrumAppGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type SpectrumAppGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON spectrumAppGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// spectrumAppGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [SpectrumAppGetResponseEnvelopeMessages]
-type spectrumAppGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SpectrumAppGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r spectrumAppGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type SpectrumAppGetResponseEnvelopeSuccess bool
-
-const (
- SpectrumAppGetResponseEnvelopeSuccessTrue SpectrumAppGetResponseEnvelopeSuccess = true
-)
diff --git a/spectrumapp_test.go b/spectrumapp_test.go
deleted file mode 100644
index 9705bc3ae9f..00000000000
--- a/spectrumapp_test.go
+++ /dev/null
@@ -1,203 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestSpectrumAppNewWithOptionalParams(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"),
- )
- _, err := client.Spectrum.Apps.New(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.SpectrumAppNewParams{
- DNS: cloudflare.F(cloudflare.SpectrumAppNewParamsDNS{
- Name: cloudflare.F("ssh.example.com"),
- Type: cloudflare.F(cloudflare.SpectrumAppNewParamsDNSTypeCNAME),
- }),
- OriginDNS: cloudflare.F(cloudflare.SpectrumAppNewParamsOriginDNS{
- Name: cloudflare.F("origin.example.com"),
- TTL: cloudflare.F(int64(600)),
- Type: cloudflare.F(cloudflare.SpectrumAppNewParamsOriginDNSTypeEmpty),
- }),
- OriginPort: cloudflare.F[cloudflare.SpectrumAppNewParamsOriginPort](shared.UnionInt(int64(22))),
- Protocol: cloudflare.F("tcp/22"),
- ArgoSmartRouting: cloudflare.F(true),
- EdgeIPs: cloudflare.F[cloudflare.SpectrumAppNewParamsEdgeIPs](cloudflare.SpectrumAppNewParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariable(cloudflare.SpectrumAppNewParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariable{
- Connectivity: cloudflare.F(cloudflare.SpectrumAppNewParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariableConnectivityAll),
- Type: cloudflare.F(cloudflare.SpectrumAppNewParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariableTypeDynamic),
- })),
- IPFirewall: cloudflare.F(true),
- ProxyProtocol: cloudflare.F(cloudflare.SpectrumAppNewParamsProxyProtocolOff),
- TLS: cloudflare.F(cloudflare.SpectrumAppNewParamsTLSFull),
- TrafficType: cloudflare.F(cloudflare.SpectrumAppNewParamsTrafficTypeDirect),
- },
- )
- 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())
- }
-}
-
-func TestSpectrumAppUpdateWithOptionalParams(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"),
- )
- _, err := client.Spectrum.Apps.Update(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- "ea95132c15732412d22c1476fa83f27a",
- cloudflare.SpectrumAppUpdateParams{
- DNS: cloudflare.F(cloudflare.SpectrumAppUpdateParamsDNS{
- Name: cloudflare.F("ssh.example.com"),
- Type: cloudflare.F(cloudflare.SpectrumAppUpdateParamsDNSTypeCNAME),
- }),
- OriginDNS: cloudflare.F(cloudflare.SpectrumAppUpdateParamsOriginDNS{
- Name: cloudflare.F("origin.example.com"),
- TTL: cloudflare.F(int64(600)),
- Type: cloudflare.F(cloudflare.SpectrumAppUpdateParamsOriginDNSTypeEmpty),
- }),
- OriginPort: cloudflare.F[cloudflare.SpectrumAppUpdateParamsOriginPort](shared.UnionInt(int64(22))),
- Protocol: cloudflare.F("tcp/22"),
- ArgoSmartRouting: cloudflare.F(true),
- EdgeIPs: cloudflare.F[cloudflare.SpectrumAppUpdateParamsEdgeIPs](cloudflare.SpectrumAppUpdateParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariable(cloudflare.SpectrumAppUpdateParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariable{
- Connectivity: cloudflare.F(cloudflare.SpectrumAppUpdateParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariableConnectivityAll),
- Type: cloudflare.F(cloudflare.SpectrumAppUpdateParamsEdgeIPsSpectrumEdgeIPEyeballIPsVariableTypeDynamic),
- })),
- IPFirewall: cloudflare.F(true),
- ProxyProtocol: cloudflare.F(cloudflare.SpectrumAppUpdateParamsProxyProtocolOff),
- TLS: cloudflare.F(cloudflare.SpectrumAppUpdateParamsTLSFull),
- TrafficType: cloudflare.F(cloudflare.SpectrumAppUpdateParamsTrafficTypeDirect),
- },
- )
- 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())
- }
-}
-
-func TestSpectrumAppListWithOptionalParams(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"),
- )
- _, err := client.Spectrum.Apps.List(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.SpectrumAppListParams{
- Direction: cloudflare.F(cloudflare.SpectrumAppListParamsDirectionDesc),
- Order: cloudflare.F(cloudflare.SpectrumAppListParamsOrderProtocol),
- Page: cloudflare.F(1.000000),
- PerPage: cloudflare.F(1.000000),
- },
- )
- 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())
- }
-}
-
-func TestSpectrumAppDelete(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"),
- )
- _, err := client.Spectrum.Apps.Delete(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- "ea95132c15732412d22c1476fa83f27a",
- )
- 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())
- }
-}
-
-func TestSpectrumAppGet(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"),
- )
- _, err := client.Spectrum.Apps.Get(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- "ea95132c15732412d22c1476fa83f27a",
- )
- 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/speed/aliases.go b/speed/aliases.go
new file mode 100644
index 00000000000..ff4c7d8dc02
--- /dev/null
+++ b/speed/aliases.go
@@ -0,0 +1,9 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package speed
+
+import (
+ "github.com/cloudflare/cloudflare-go/internal/apierror"
+)
+
+type Error = apierror.Error
diff --git a/speed/availability.go b/speed/availability.go
new file mode 100644
index 00000000000..7e21cb3e063
--- /dev/null
+++ b/speed/availability.go
@@ -0,0 +1,182 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package speed
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// AvailabilityService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewAvailabilityService] method
+// instead.
+type AvailabilityService struct {
+ Options []option.RequestOption
+}
+
+// NewAvailabilityService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewAvailabilityService(opts ...option.RequestOption) (r *AvailabilityService) {
+ r = &AvailabilityService{}
+ r.Options = opts
+ return
+}
+
+// Retrieves quota for all plans, as well as the current zone quota.
+func (r *AvailabilityService) List(ctx context.Context, query AvailabilityListParams, opts ...option.RequestOption) (res *ObservatoryAvailabilities, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AvailabilityListResponseEnvelope
+ path := fmt.Sprintf("zones/%s/speed_api/availabilities", query.ZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type ObservatoryAvailabilities struct {
+ Quota ObservatoryAvailabilitiesQuota `json:"quota"`
+ Regions []ObservatoryAvailabilitiesRegion `json:"regions"`
+ RegionsPerPlan interface{} `json:"regionsPerPlan"`
+ JSON observatoryAvailabilitiesJSON `json:"-"`
+}
+
+// observatoryAvailabilitiesJSON contains the JSON metadata for the struct
+// [ObservatoryAvailabilities]
+type observatoryAvailabilitiesJSON struct {
+ Quota apijson.Field
+ Regions apijson.Field
+ RegionsPerPlan apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ObservatoryAvailabilities) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r observatoryAvailabilitiesJSON) RawJSON() string {
+ return r.raw
+}
+
+type ObservatoryAvailabilitiesQuota struct {
+ // Cloudflare plan.
+ Plan string `json:"plan"`
+ // The number of tests available per plan.
+ QuotasPerPlan map[string]float64 `json:"quotasPerPlan"`
+ // The number of remaining schedules available.
+ RemainingSchedules float64 `json:"remainingSchedules"`
+ // The number of remaining tests available.
+ RemainingTests float64 `json:"remainingTests"`
+ // The number of schedules available per plan.
+ ScheduleQuotasPerPlan map[string]float64 `json:"scheduleQuotasPerPlan"`
+ JSON observatoryAvailabilitiesQuotaJSON `json:"-"`
+}
+
+// observatoryAvailabilitiesQuotaJSON contains the JSON metadata for the struct
+// [ObservatoryAvailabilitiesQuota]
+type observatoryAvailabilitiesQuotaJSON struct {
+ Plan apijson.Field
+ QuotasPerPlan apijson.Field
+ RemainingSchedules apijson.Field
+ RemainingTests apijson.Field
+ ScheduleQuotasPerPlan apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ObservatoryAvailabilitiesQuota) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r observatoryAvailabilitiesQuotaJSON) RawJSON() string {
+ return r.raw
+}
+
+// A test region with a label.
+type ObservatoryAvailabilitiesRegion struct {
+ Label string `json:"label"`
+ // A test region.
+ Value ObservatoryAvailabilitiesRegionsValue `json:"value"`
+ JSON observatoryAvailabilitiesRegionJSON `json:"-"`
+}
+
+// observatoryAvailabilitiesRegionJSON contains the JSON metadata for the struct
+// [ObservatoryAvailabilitiesRegion]
+type observatoryAvailabilitiesRegionJSON struct {
+ Label apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ObservatoryAvailabilitiesRegion) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r observatoryAvailabilitiesRegionJSON) RawJSON() string {
+ return r.raw
+}
+
+// A test region.
+type ObservatoryAvailabilitiesRegionsValue string
+
+const (
+ ObservatoryAvailabilitiesRegionsValueAsiaEast1 ObservatoryAvailabilitiesRegionsValue = "asia-east1"
+ ObservatoryAvailabilitiesRegionsValueAsiaNortheast1 ObservatoryAvailabilitiesRegionsValue = "asia-northeast1"
+ ObservatoryAvailabilitiesRegionsValueAsiaNortheast2 ObservatoryAvailabilitiesRegionsValue = "asia-northeast2"
+ ObservatoryAvailabilitiesRegionsValueAsiaSouth1 ObservatoryAvailabilitiesRegionsValue = "asia-south1"
+ ObservatoryAvailabilitiesRegionsValueAsiaSoutheast1 ObservatoryAvailabilitiesRegionsValue = "asia-southeast1"
+ ObservatoryAvailabilitiesRegionsValueAustraliaSoutheast1 ObservatoryAvailabilitiesRegionsValue = "australia-southeast1"
+ ObservatoryAvailabilitiesRegionsValueEuropeNorth1 ObservatoryAvailabilitiesRegionsValue = "europe-north1"
+ ObservatoryAvailabilitiesRegionsValueEuropeSouthwest1 ObservatoryAvailabilitiesRegionsValue = "europe-southwest1"
+ ObservatoryAvailabilitiesRegionsValueEuropeWest1 ObservatoryAvailabilitiesRegionsValue = "europe-west1"
+ ObservatoryAvailabilitiesRegionsValueEuropeWest2 ObservatoryAvailabilitiesRegionsValue = "europe-west2"
+ ObservatoryAvailabilitiesRegionsValueEuropeWest3 ObservatoryAvailabilitiesRegionsValue = "europe-west3"
+ ObservatoryAvailabilitiesRegionsValueEuropeWest4 ObservatoryAvailabilitiesRegionsValue = "europe-west4"
+ ObservatoryAvailabilitiesRegionsValueEuropeWest8 ObservatoryAvailabilitiesRegionsValue = "europe-west8"
+ ObservatoryAvailabilitiesRegionsValueEuropeWest9 ObservatoryAvailabilitiesRegionsValue = "europe-west9"
+ ObservatoryAvailabilitiesRegionsValueMeWest1 ObservatoryAvailabilitiesRegionsValue = "me-west1"
+ ObservatoryAvailabilitiesRegionsValueSouthamericaEast1 ObservatoryAvailabilitiesRegionsValue = "southamerica-east1"
+ ObservatoryAvailabilitiesRegionsValueUsCentral1 ObservatoryAvailabilitiesRegionsValue = "us-central1"
+ ObservatoryAvailabilitiesRegionsValueUsEast1 ObservatoryAvailabilitiesRegionsValue = "us-east1"
+ ObservatoryAvailabilitiesRegionsValueUsEast4 ObservatoryAvailabilitiesRegionsValue = "us-east4"
+ ObservatoryAvailabilitiesRegionsValueUsSouth1 ObservatoryAvailabilitiesRegionsValue = "us-south1"
+ ObservatoryAvailabilitiesRegionsValueUsWest1 ObservatoryAvailabilitiesRegionsValue = "us-west1"
+)
+
+type AvailabilityListParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+}
+
+type AvailabilityListResponseEnvelope struct {
+ Result ObservatoryAvailabilities `json:"result"`
+ JSON availabilityListResponseEnvelopeJSON `json:"-"`
+}
+
+// availabilityListResponseEnvelopeJSON contains the JSON metadata for the struct
+// [AvailabilityListResponseEnvelope]
+type availabilityListResponseEnvelopeJSON struct {
+ Result apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AvailabilityListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r availabilityListResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/speed/availability_test.go b/speed/availability_test.go
new file mode 100644
index 00000000000..6ad28da98a0
--- /dev/null
+++ b/speed/availability_test.go
@@ -0,0 +1,41 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package speed_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/speed"
+)
+
+func TestAvailabilityList(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"),
+ )
+ _, err := client.Speed.Availabilities.List(context.TODO(), speed.AvailabilityListParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ })
+ 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/speed/page.go b/speed/page.go
new file mode 100644
index 00000000000..8083ce45e46
--- /dev/null
+++ b/speed/page.go
@@ -0,0 +1,160 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package speed
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// PageService contains methods and other services that help with interacting with
+// the cloudflare API. Note, unlike clients, this service does not read variables
+// from the environment automatically. You should not instantiate this service
+// directly, and instead use the [NewPageService] method instead.
+type PageService struct {
+ Options []option.RequestOption
+}
+
+// NewPageService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewPageService(opts ...option.RequestOption) (r *PageService) {
+ r = &PageService{}
+ r.Options = opts
+ return
+}
+
+// Lists all webpages which have been tested.
+func (r *PageService) List(ctx context.Context, query PageListParams, opts ...option.RequestOption) (res *[]PageListResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env PageListResponseEnvelope
+ path := fmt.Sprintf("zones/%s/speed_api/pages", query.ZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type PageListResponse struct {
+ // A test region with a label.
+ Region PageListResponseRegion `json:"region"`
+ // The frequency of the test.
+ ScheduleFrequency PageListResponseScheduleFrequency `json:"scheduleFrequency"`
+ Tests []ObservatoryPageTest `json:"tests"`
+ // A URL.
+ URL string `json:"url"`
+ JSON pageListResponseJSON `json:"-"`
+}
+
+// pageListResponseJSON contains the JSON metadata for the struct
+// [PageListResponse]
+type pageListResponseJSON struct {
+ Region apijson.Field
+ ScheduleFrequency apijson.Field
+ Tests apijson.Field
+ URL apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PageListResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r pageListResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+// A test region with a label.
+type PageListResponseRegion struct {
+ Label string `json:"label"`
+ // A test region.
+ Value PageListResponseRegionValue `json:"value"`
+ JSON pageListResponseRegionJSON `json:"-"`
+}
+
+// pageListResponseRegionJSON contains the JSON metadata for the struct
+// [PageListResponseRegion]
+type pageListResponseRegionJSON struct {
+ Label apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PageListResponseRegion) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r pageListResponseRegionJSON) RawJSON() string {
+ return r.raw
+}
+
+// A test region.
+type PageListResponseRegionValue string
+
+const (
+ PageListResponseRegionValueAsiaEast1 PageListResponseRegionValue = "asia-east1"
+ PageListResponseRegionValueAsiaNortheast1 PageListResponseRegionValue = "asia-northeast1"
+ PageListResponseRegionValueAsiaNortheast2 PageListResponseRegionValue = "asia-northeast2"
+ PageListResponseRegionValueAsiaSouth1 PageListResponseRegionValue = "asia-south1"
+ PageListResponseRegionValueAsiaSoutheast1 PageListResponseRegionValue = "asia-southeast1"
+ PageListResponseRegionValueAustraliaSoutheast1 PageListResponseRegionValue = "australia-southeast1"
+ PageListResponseRegionValueEuropeNorth1 PageListResponseRegionValue = "europe-north1"
+ PageListResponseRegionValueEuropeSouthwest1 PageListResponseRegionValue = "europe-southwest1"
+ PageListResponseRegionValueEuropeWest1 PageListResponseRegionValue = "europe-west1"
+ PageListResponseRegionValueEuropeWest2 PageListResponseRegionValue = "europe-west2"
+ PageListResponseRegionValueEuropeWest3 PageListResponseRegionValue = "europe-west3"
+ PageListResponseRegionValueEuropeWest4 PageListResponseRegionValue = "europe-west4"
+ PageListResponseRegionValueEuropeWest8 PageListResponseRegionValue = "europe-west8"
+ PageListResponseRegionValueEuropeWest9 PageListResponseRegionValue = "europe-west9"
+ PageListResponseRegionValueMeWest1 PageListResponseRegionValue = "me-west1"
+ PageListResponseRegionValueSouthamericaEast1 PageListResponseRegionValue = "southamerica-east1"
+ PageListResponseRegionValueUsCentral1 PageListResponseRegionValue = "us-central1"
+ PageListResponseRegionValueUsEast1 PageListResponseRegionValue = "us-east1"
+ PageListResponseRegionValueUsEast4 PageListResponseRegionValue = "us-east4"
+ PageListResponseRegionValueUsSouth1 PageListResponseRegionValue = "us-south1"
+ PageListResponseRegionValueUsWest1 PageListResponseRegionValue = "us-west1"
+)
+
+// The frequency of the test.
+type PageListResponseScheduleFrequency string
+
+const (
+ PageListResponseScheduleFrequencyDaily PageListResponseScheduleFrequency = "DAILY"
+ PageListResponseScheduleFrequencyWeekly PageListResponseScheduleFrequency = "WEEKLY"
+)
+
+type PageListParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+}
+
+type PageListResponseEnvelope struct {
+ Result []PageListResponse `json:"result"`
+ JSON pageListResponseEnvelopeJSON `json:"-"`
+}
+
+// pageListResponseEnvelopeJSON contains the JSON metadata for the struct
+// [PageListResponseEnvelope]
+type pageListResponseEnvelopeJSON struct {
+ Result apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *PageListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r pageListResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/speed/page_test.go b/speed/page_test.go
new file mode 100644
index 00000000000..3df98159b9a
--- /dev/null
+++ b/speed/page_test.go
@@ -0,0 +1,41 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package speed_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/speed"
+)
+
+func TestPageList(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"),
+ )
+ _, err := client.Speed.Pages.List(context.TODO(), speed.PageListParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ })
+ 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/speed/schedule.go b/speed/schedule.go
new file mode 100644
index 00000000000..364fe7872db
--- /dev/null
+++ b/speed/schedule.go
@@ -0,0 +1,133 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package speed
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// ScheduleService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewScheduleService] method instead.
+type ScheduleService struct {
+ Options []option.RequestOption
+}
+
+// NewScheduleService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewScheduleService(opts ...option.RequestOption) (r *ScheduleService) {
+ r = &ScheduleService{}
+ r.Options = opts
+ return
+}
+
+// Creates a scheduled test for a page.
+func (r *ScheduleService) New(ctx context.Context, url string, params ScheduleNewParams, opts ...option.RequestOption) (res *ScheduleNewResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env ScheduleNewResponseEnvelope
+ path := fmt.Sprintf("zones/%s/speed_api/schedule/%s", params.ZoneID, url)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type ScheduleNewResponse struct {
+ // The test schedule.
+ Schedule ObservatorySchedule `json:"schedule"`
+ Test ObservatoryPageTest `json:"test"`
+ JSON scheduleNewResponseJSON `json:"-"`
+}
+
+// scheduleNewResponseJSON contains the JSON metadata for the struct
+// [ScheduleNewResponse]
+type scheduleNewResponseJSON struct {
+ Schedule apijson.Field
+ Test apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ScheduleNewResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r scheduleNewResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type ScheduleNewParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+ // A test region.
+ Region param.Field[ScheduleNewParamsRegion] `query:"region"`
+}
+
+// URLQuery serializes [ScheduleNewParams]'s query parameters as `url.Values`.
+func (r ScheduleNewParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// A test region.
+type ScheduleNewParamsRegion string
+
+const (
+ ScheduleNewParamsRegionAsiaEast1 ScheduleNewParamsRegion = "asia-east1"
+ ScheduleNewParamsRegionAsiaNortheast1 ScheduleNewParamsRegion = "asia-northeast1"
+ ScheduleNewParamsRegionAsiaNortheast2 ScheduleNewParamsRegion = "asia-northeast2"
+ ScheduleNewParamsRegionAsiaSouth1 ScheduleNewParamsRegion = "asia-south1"
+ ScheduleNewParamsRegionAsiaSoutheast1 ScheduleNewParamsRegion = "asia-southeast1"
+ ScheduleNewParamsRegionAustraliaSoutheast1 ScheduleNewParamsRegion = "australia-southeast1"
+ ScheduleNewParamsRegionEuropeNorth1 ScheduleNewParamsRegion = "europe-north1"
+ ScheduleNewParamsRegionEuropeSouthwest1 ScheduleNewParamsRegion = "europe-southwest1"
+ ScheduleNewParamsRegionEuropeWest1 ScheduleNewParamsRegion = "europe-west1"
+ ScheduleNewParamsRegionEuropeWest2 ScheduleNewParamsRegion = "europe-west2"
+ ScheduleNewParamsRegionEuropeWest3 ScheduleNewParamsRegion = "europe-west3"
+ ScheduleNewParamsRegionEuropeWest4 ScheduleNewParamsRegion = "europe-west4"
+ ScheduleNewParamsRegionEuropeWest8 ScheduleNewParamsRegion = "europe-west8"
+ ScheduleNewParamsRegionEuropeWest9 ScheduleNewParamsRegion = "europe-west9"
+ ScheduleNewParamsRegionMeWest1 ScheduleNewParamsRegion = "me-west1"
+ ScheduleNewParamsRegionSouthamericaEast1 ScheduleNewParamsRegion = "southamerica-east1"
+ ScheduleNewParamsRegionUsCentral1 ScheduleNewParamsRegion = "us-central1"
+ ScheduleNewParamsRegionUsEast1 ScheduleNewParamsRegion = "us-east1"
+ ScheduleNewParamsRegionUsEast4 ScheduleNewParamsRegion = "us-east4"
+ ScheduleNewParamsRegionUsSouth1 ScheduleNewParamsRegion = "us-south1"
+ ScheduleNewParamsRegionUsWest1 ScheduleNewParamsRegion = "us-west1"
+)
+
+type ScheduleNewResponseEnvelope struct {
+ Result ScheduleNewResponse `json:"result"`
+ JSON scheduleNewResponseEnvelopeJSON `json:"-"`
+}
+
+// scheduleNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [ScheduleNewResponseEnvelope]
+type scheduleNewResponseEnvelopeJSON struct {
+ Result apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ScheduleNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r scheduleNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/speed/schedule_test.go b/speed/schedule_test.go
new file mode 100644
index 00000000000..bb2e720fad3
--- /dev/null
+++ b/speed/schedule_test.go
@@ -0,0 +1,46 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package speed_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/speed"
+)
+
+func TestScheduleNewWithOptionalParams(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"),
+ )
+ _, err := client.Speed.Schedule.New(
+ context.TODO(),
+ "example.com",
+ speed.ScheduleNewParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Region: cloudflare.F(speed.ScheduleNewParamsRegionUsCentral1),
+ },
+ )
+ 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/speed.go b/speed/speed.go
similarity index 78%
rename from speed.go
rename to speed/speed.go
index c1b09504850..6235606c635 100644
--- a/speed.go
+++ b/speed/speed.go
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package cloudflare
+package speed
import (
"context"
@@ -21,10 +21,10 @@ import (
// directly, and instead use the [NewSpeedService] method instead.
type SpeedService struct {
Options []option.RequestOption
- Tests *SpeedTestService
- Schedule *SpeedScheduleService
- Availabilities *SpeedAvailabilityService
- Pages *SpeedPageService
+ Tests *TestService
+ Schedule *ScheduleService
+ Availabilities *AvailabilityService
+ Pages *PageService
}
// NewSpeedService generates a new service that applies the given options to each
@@ -33,10 +33,10 @@ type SpeedService struct {
func NewSpeedService(opts ...option.RequestOption) (r *SpeedService) {
r = &SpeedService{}
r.Options = opts
- r.Tests = NewSpeedTestService(opts...)
- r.Schedule = NewSpeedScheduleService(opts...)
- r.Availabilities = NewSpeedAvailabilityService(opts...)
- r.Pages = NewSpeedPageService(opts...)
+ r.Tests = NewTestService(opts...)
+ r.Schedule = NewScheduleService(opts...)
+ r.Availabilities = NewAvailabilityService(opts...)
+ r.Pages = NewPageService(opts...)
return
}
@@ -54,7 +54,7 @@ func (r *SpeedService) Delete(ctx context.Context, url string, params SpeedDelet
}
// Retrieves the test schedule for a page in a specific region.
-func (r *SpeedService) ScheduleGet(ctx context.Context, url string, params SpeedScheduleGetParams, opts ...option.RequestOption) (res *SpeedScheduleGetResponse, err error) {
+func (r *SpeedService) ScheduleGet(ctx context.Context, url string, params SpeedScheduleGetParams, opts ...option.RequestOption) (res *ObservatorySchedule, err error) {
opts = append(r.Options[:], opts...)
var env SpeedScheduleGetResponseEnvelope
path := fmt.Sprintf("zones/%s/speed_api/schedule/%s", params.ZoneID, url)
@@ -67,7 +67,7 @@ func (r *SpeedService) ScheduleGet(ctx context.Context, url string, params Speed
}
// Lists the core web vital metrics trend over time for a specific page.
-func (r *SpeedService) TrendsList(ctx context.Context, url string, params SpeedTrendsListParams, opts ...option.RequestOption) (res *SpeedTrendsListResponse, err error) {
+func (r *SpeedService) TrendsList(ctx context.Context, url string, params SpeedTrendsListParams, opts ...option.RequestOption) (res *ObservatoryTrend, err error) {
opts = append(r.Options[:], opts...)
var env SpeedTrendsListResponseEnvelope
path := fmt.Sprintf("zones/%s/speed_api/pages/%s/trend", params.ZoneID, url)
@@ -79,42 +79,20 @@ func (r *SpeedService) TrendsList(ctx context.Context, url string, params SpeedT
return
}
-type SpeedDeleteResponse struct {
- // Number of items affected.
- Count float64 `json:"count"`
- JSON speedDeleteResponseJSON `json:"-"`
-}
-
-// speedDeleteResponseJSON contains the JSON metadata for the struct
-// [SpeedDeleteResponse]
-type speedDeleteResponseJSON struct {
- Count apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SpeedDeleteResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r speedDeleteResponseJSON) RawJSON() string {
- return r.raw
-}
-
// The test schedule.
-type SpeedScheduleGetResponse struct {
+type ObservatorySchedule struct {
// The frequency of the test.
- Frequency SpeedScheduleGetResponseFrequency `json:"frequency"`
+ Frequency ObservatoryScheduleFrequency `json:"frequency"`
// A test region.
- Region SpeedScheduleGetResponseRegion `json:"region"`
+ Region ObservatoryScheduleRegion `json:"region"`
// A URL.
- URL string `json:"url"`
- JSON speedScheduleGetResponseJSON `json:"-"`
+ URL string `json:"url"`
+ JSON observatoryScheduleJSON `json:"-"`
}
-// speedScheduleGetResponseJSON contains the JSON metadata for the struct
-// [SpeedScheduleGetResponse]
-type speedScheduleGetResponseJSON struct {
+// observatoryScheduleJSON contains the JSON metadata for the struct
+// [ObservatorySchedule]
+type observatoryScheduleJSON struct {
Frequency apijson.Field
Region apijson.Field
URL apijson.Field
@@ -122,50 +100,50 @@ type speedScheduleGetResponseJSON struct {
ExtraFields map[string]apijson.Field
}
-func (r *SpeedScheduleGetResponse) UnmarshalJSON(data []byte) (err error) {
+func (r *ObservatorySchedule) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
-func (r speedScheduleGetResponseJSON) RawJSON() string {
+func (r observatoryScheduleJSON) RawJSON() string {
return r.raw
}
// The frequency of the test.
-type SpeedScheduleGetResponseFrequency string
+type ObservatoryScheduleFrequency string
const (
- SpeedScheduleGetResponseFrequencyDaily SpeedScheduleGetResponseFrequency = "DAILY"
- SpeedScheduleGetResponseFrequencyWeekly SpeedScheduleGetResponseFrequency = "WEEKLY"
+ ObservatoryScheduleFrequencyDaily ObservatoryScheduleFrequency = "DAILY"
+ ObservatoryScheduleFrequencyWeekly ObservatoryScheduleFrequency = "WEEKLY"
)
// A test region.
-type SpeedScheduleGetResponseRegion string
+type ObservatoryScheduleRegion string
const (
- SpeedScheduleGetResponseRegionAsiaEast1 SpeedScheduleGetResponseRegion = "asia-east1"
- SpeedScheduleGetResponseRegionAsiaNortheast1 SpeedScheduleGetResponseRegion = "asia-northeast1"
- SpeedScheduleGetResponseRegionAsiaNortheast2 SpeedScheduleGetResponseRegion = "asia-northeast2"
- SpeedScheduleGetResponseRegionAsiaSouth1 SpeedScheduleGetResponseRegion = "asia-south1"
- SpeedScheduleGetResponseRegionAsiaSoutheast1 SpeedScheduleGetResponseRegion = "asia-southeast1"
- SpeedScheduleGetResponseRegionAustraliaSoutheast1 SpeedScheduleGetResponseRegion = "australia-southeast1"
- SpeedScheduleGetResponseRegionEuropeNorth1 SpeedScheduleGetResponseRegion = "europe-north1"
- SpeedScheduleGetResponseRegionEuropeSouthwest1 SpeedScheduleGetResponseRegion = "europe-southwest1"
- SpeedScheduleGetResponseRegionEuropeWest1 SpeedScheduleGetResponseRegion = "europe-west1"
- SpeedScheduleGetResponseRegionEuropeWest2 SpeedScheduleGetResponseRegion = "europe-west2"
- SpeedScheduleGetResponseRegionEuropeWest3 SpeedScheduleGetResponseRegion = "europe-west3"
- SpeedScheduleGetResponseRegionEuropeWest4 SpeedScheduleGetResponseRegion = "europe-west4"
- SpeedScheduleGetResponseRegionEuropeWest8 SpeedScheduleGetResponseRegion = "europe-west8"
- SpeedScheduleGetResponseRegionEuropeWest9 SpeedScheduleGetResponseRegion = "europe-west9"
- SpeedScheduleGetResponseRegionMeWest1 SpeedScheduleGetResponseRegion = "me-west1"
- SpeedScheduleGetResponseRegionSouthamericaEast1 SpeedScheduleGetResponseRegion = "southamerica-east1"
- SpeedScheduleGetResponseRegionUsCentral1 SpeedScheduleGetResponseRegion = "us-central1"
- SpeedScheduleGetResponseRegionUsEast1 SpeedScheduleGetResponseRegion = "us-east1"
- SpeedScheduleGetResponseRegionUsEast4 SpeedScheduleGetResponseRegion = "us-east4"
- SpeedScheduleGetResponseRegionUsSouth1 SpeedScheduleGetResponseRegion = "us-south1"
- SpeedScheduleGetResponseRegionUsWest1 SpeedScheduleGetResponseRegion = "us-west1"
+ ObservatoryScheduleRegionAsiaEast1 ObservatoryScheduleRegion = "asia-east1"
+ ObservatoryScheduleRegionAsiaNortheast1 ObservatoryScheduleRegion = "asia-northeast1"
+ ObservatoryScheduleRegionAsiaNortheast2 ObservatoryScheduleRegion = "asia-northeast2"
+ ObservatoryScheduleRegionAsiaSouth1 ObservatoryScheduleRegion = "asia-south1"
+ ObservatoryScheduleRegionAsiaSoutheast1 ObservatoryScheduleRegion = "asia-southeast1"
+ ObservatoryScheduleRegionAustraliaSoutheast1 ObservatoryScheduleRegion = "australia-southeast1"
+ ObservatoryScheduleRegionEuropeNorth1 ObservatoryScheduleRegion = "europe-north1"
+ ObservatoryScheduleRegionEuropeSouthwest1 ObservatoryScheduleRegion = "europe-southwest1"
+ ObservatoryScheduleRegionEuropeWest1 ObservatoryScheduleRegion = "europe-west1"
+ ObservatoryScheduleRegionEuropeWest2 ObservatoryScheduleRegion = "europe-west2"
+ ObservatoryScheduleRegionEuropeWest3 ObservatoryScheduleRegion = "europe-west3"
+ ObservatoryScheduleRegionEuropeWest4 ObservatoryScheduleRegion = "europe-west4"
+ ObservatoryScheduleRegionEuropeWest8 ObservatoryScheduleRegion = "europe-west8"
+ ObservatoryScheduleRegionEuropeWest9 ObservatoryScheduleRegion = "europe-west9"
+ ObservatoryScheduleRegionMeWest1 ObservatoryScheduleRegion = "me-west1"
+ ObservatoryScheduleRegionSouthamericaEast1 ObservatoryScheduleRegion = "southamerica-east1"
+ ObservatoryScheduleRegionUsCentral1 ObservatoryScheduleRegion = "us-central1"
+ ObservatoryScheduleRegionUsEast1 ObservatoryScheduleRegion = "us-east1"
+ ObservatoryScheduleRegionUsEast4 ObservatoryScheduleRegion = "us-east4"
+ ObservatoryScheduleRegionUsSouth1 ObservatoryScheduleRegion = "us-south1"
+ ObservatoryScheduleRegionUsWest1 ObservatoryScheduleRegion = "us-west1"
)
-type SpeedTrendsListResponse struct {
+type ObservatoryTrend struct {
// Cumulative Layout Shift trend.
Cls []float64 `json:"cls"`
// First Contentful Paint trend.
@@ -181,13 +159,13 @@ type SpeedTrendsListResponse struct {
// Time To First Byte trend.
Ttfb []float64 `json:"ttfb"`
// Time To Interactive trend.
- Tti []float64 `json:"tti"`
- JSON speedTrendsListResponseJSON `json:"-"`
+ Tti []float64 `json:"tti"`
+ JSON observatoryTrendJSON `json:"-"`
}
-// speedTrendsListResponseJSON contains the JSON metadata for the struct
-// [SpeedTrendsListResponse]
-type speedTrendsListResponseJSON struct {
+// observatoryTrendJSON contains the JSON metadata for the struct
+// [ObservatoryTrend]
+type observatoryTrendJSON struct {
Cls apijson.Field
Fcp apijson.Field
Lcp apijson.Field
@@ -200,11 +178,33 @@ type speedTrendsListResponseJSON struct {
ExtraFields map[string]apijson.Field
}
-func (r *SpeedTrendsListResponse) UnmarshalJSON(data []byte) (err error) {
+func (r *ObservatoryTrend) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
-func (r speedTrendsListResponseJSON) RawJSON() string {
+func (r observatoryTrendJSON) RawJSON() string {
+ return r.raw
+}
+
+type SpeedDeleteResponse struct {
+ // Number of items affected.
+ Count float64 `json:"count"`
+ JSON speedDeleteResponseJSON `json:"-"`
+}
+
+// speedDeleteResponseJSON contains the JSON metadata for the struct
+// [SpeedDeleteResponse]
+type speedDeleteResponseJSON struct {
+ Count apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *SpeedDeleteResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r speedDeleteResponseJSON) RawJSON() string {
return r.raw
}
@@ -315,7 +315,7 @@ const (
type SpeedScheduleGetResponseEnvelope struct {
// The test schedule.
- Result SpeedScheduleGetResponse `json:"result"`
+ Result ObservatorySchedule `json:"result"`
JSON speedScheduleGetResponseEnvelopeJSON `json:"-"`
}
@@ -392,7 +392,7 @@ const (
)
type SpeedTrendsListResponseEnvelope struct {
- Result SpeedTrendsListResponse `json:"result"`
+ Result ObservatoryTrend `json:"result"`
JSON speedTrendsListResponseEnvelopeJSON `json:"-"`
}
diff --git a/speed_test.go b/speed/speed_test.go
similarity index 86%
rename from speed_test.go
rename to speed/speed_test.go
index 95cd8bc8edf..252c1757b21 100644
--- a/speed_test.go
+++ b/speed/speed_test.go
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package cloudflare_test
+package speed_test
import (
"context"
@@ -11,6 +11,7 @@ import (
"github.com/cloudflare/cloudflare-go"
"github.com/cloudflare/cloudflare-go/internal/testutil"
"github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/speed"
)
func TestSpeedDeleteWithOptionalParams(t *testing.T) {
@@ -30,9 +31,9 @@ func TestSpeedDeleteWithOptionalParams(t *testing.T) {
_, err := client.Speed.Delete(
context.TODO(),
"example.com",
- cloudflare.SpeedDeleteParams{
+ speed.SpeedDeleteParams{
ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Region: cloudflare.F(cloudflare.SpeedDeleteParamsRegionUsCentral1),
+ Region: cloudflare.F(speed.SpeedDeleteParamsRegionUsCentral1),
},
)
if err != nil {
@@ -61,9 +62,9 @@ func TestSpeedScheduleGetWithOptionalParams(t *testing.T) {
_, err := client.Speed.ScheduleGet(
context.TODO(),
"example.com",
- cloudflare.SpeedScheduleGetParams{
+ speed.SpeedScheduleGetParams{
ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Region: cloudflare.F(cloudflare.SpeedScheduleGetParamsRegionUsCentral1),
+ Region: cloudflare.F(speed.SpeedScheduleGetParamsRegionUsCentral1),
},
)
if err != nil {
@@ -92,11 +93,11 @@ func TestSpeedTrendsList(t *testing.T) {
_, err := client.Speed.TrendsList(
context.TODO(),
"example.com",
- cloudflare.SpeedTrendsListParams{
+ speed.SpeedTrendsListParams{
ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- DeviceType: cloudflare.F(cloudflare.SpeedTrendsListParamsDeviceTypeDesktop),
+ DeviceType: cloudflare.F(speed.SpeedTrendsListParamsDeviceTypeDesktop),
Metrics: cloudflare.F("performanceScore,ttfb,fcp,si,lcp,tti,tbt,cls"),
- Region: cloudflare.F(cloudflare.SpeedTrendsListParamsRegionUsCentral1),
+ Region: cloudflare.F(speed.SpeedTrendsListParamsRegionUsCentral1),
Tz: cloudflare.F("string"),
},
)
diff --git a/speed/test.go b/speed/test.go
new file mode 100644
index 00000000000..cff613b8736
--- /dev/null
+++ b/speed/test.go
@@ -0,0 +1,718 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package speed
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// TestService contains methods and other services that help with interacting with
+// the cloudflare API. Note, unlike clients, this service does not read variables
+// from the environment automatically. You should not instantiate this service
+// directly, and instead use the [NewTestService] method instead.
+type TestService struct {
+ Options []option.RequestOption
+}
+
+// NewTestService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewTestService(opts ...option.RequestOption) (r *TestService) {
+ r = &TestService{}
+ r.Options = opts
+ return
+}
+
+// Starts a test for a specific webpage, in a specific region.
+func (r *TestService) New(ctx context.Context, url string, params TestNewParams, opts ...option.RequestOption) (res *ObservatoryPageTest, err error) {
+ opts = append(r.Options[:], opts...)
+ var env TestNewResponseEnvelope
+ path := fmt.Sprintf("zones/%s/speed_api/pages/%s/tests", params.ZoneID, url)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Test history (list of tests) for a specific webpage.
+func (r *TestService) List(ctx context.Context, url string, params TestListParams, opts ...option.RequestOption) (res *TestListResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ path := fmt.Sprintf("zones/%s/speed_api/pages/%s/tests", params.ZoneID, url)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, params, &res, opts...)
+ return
+}
+
+// Deletes all tests for a specific webpage from a specific region. Deleted tests
+// are still counted as part of the quota.
+func (r *TestService) Delete(ctx context.Context, url string, params TestDeleteParams, opts ...option.RequestOption) (res *TestDeleteResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env TestDeleteResponseEnvelope
+ path := fmt.Sprintf("zones/%s/speed_api/pages/%s/tests", params.ZoneID, url)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Retrieves the result of a specific test.
+func (r *TestService) Get(ctx context.Context, url string, testID string, query TestGetParams, opts ...option.RequestOption) (res *ObservatoryPageTest, err error) {
+ opts = append(r.Options[:], opts...)
+ var env TestGetResponseEnvelope
+ path := fmt.Sprintf("zones/%s/speed_api/pages/%s/tests/%s", query.ZoneID, url, testID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type ObservatoryPageTest struct {
+ // UUID
+ ID string `json:"id"`
+ Date time.Time `json:"date" format:"date-time"`
+ // The Lighthouse report.
+ DesktopReport ObservatoryPageTestDesktopReport `json:"desktopReport"`
+ // The Lighthouse report.
+ MobileReport ObservatoryPageTestMobileReport `json:"mobileReport"`
+ // A test region with a label.
+ Region ObservatoryPageTestRegion `json:"region"`
+ // The frequency of the test.
+ ScheduleFrequency ObservatoryPageTestScheduleFrequency `json:"scheduleFrequency"`
+ // A URL.
+ URL string `json:"url"`
+ JSON observatoryPageTestJSON `json:"-"`
+}
+
+// observatoryPageTestJSON contains the JSON metadata for the struct
+// [ObservatoryPageTest]
+type observatoryPageTestJSON struct {
+ ID apijson.Field
+ Date apijson.Field
+ DesktopReport apijson.Field
+ MobileReport apijson.Field
+ Region apijson.Field
+ ScheduleFrequency apijson.Field
+ URL apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ObservatoryPageTest) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r observatoryPageTestJSON) RawJSON() string {
+ return r.raw
+}
+
+// The Lighthouse report.
+type ObservatoryPageTestDesktopReport struct {
+ // Cumulative Layout Shift.
+ Cls float64 `json:"cls"`
+ // The type of device.
+ DeviceType ObservatoryPageTestDesktopReportDeviceType `json:"deviceType"`
+ Error ObservatoryPageTestDesktopReportError `json:"error"`
+ // First Contentful Paint.
+ Fcp float64 `json:"fcp"`
+ // The URL to the full Lighthouse JSON report.
+ JsonReportURL string `json:"jsonReportUrl"`
+ // Largest Contentful Paint.
+ Lcp float64 `json:"lcp"`
+ // The Lighthouse performance score.
+ PerformanceScore float64 `json:"performanceScore"`
+ // Speed Index.
+ Si float64 `json:"si"`
+ // The state of the Lighthouse report.
+ State ObservatoryPageTestDesktopReportState `json:"state"`
+ // Total Blocking Time.
+ Tbt float64 `json:"tbt"`
+ // Time To First Byte.
+ Ttfb float64 `json:"ttfb"`
+ // Time To Interactive.
+ Tti float64 `json:"tti"`
+ JSON observatoryPageTestDesktopReportJSON `json:"-"`
+}
+
+// observatoryPageTestDesktopReportJSON contains the JSON metadata for the struct
+// [ObservatoryPageTestDesktopReport]
+type observatoryPageTestDesktopReportJSON struct {
+ Cls apijson.Field
+ DeviceType apijson.Field
+ Error apijson.Field
+ Fcp apijson.Field
+ JsonReportURL apijson.Field
+ Lcp apijson.Field
+ PerformanceScore apijson.Field
+ Si apijson.Field
+ State apijson.Field
+ Tbt apijson.Field
+ Ttfb apijson.Field
+ Tti apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ObservatoryPageTestDesktopReport) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r observatoryPageTestDesktopReportJSON) RawJSON() string {
+ return r.raw
+}
+
+// The type of device.
+type ObservatoryPageTestDesktopReportDeviceType string
+
+const (
+ ObservatoryPageTestDesktopReportDeviceTypeDesktop ObservatoryPageTestDesktopReportDeviceType = "DESKTOP"
+ ObservatoryPageTestDesktopReportDeviceTypeMobile ObservatoryPageTestDesktopReportDeviceType = "MOBILE"
+)
+
+type ObservatoryPageTestDesktopReportError struct {
+ // The error code of the Lighthouse result.
+ Code ObservatoryPageTestDesktopReportErrorCode `json:"code"`
+ // Detailed error message.
+ Detail string `json:"detail"`
+ // The final URL displayed to the user.
+ FinalDisplayedURL string `json:"finalDisplayedUrl"`
+ JSON observatoryPageTestDesktopReportErrorJSON `json:"-"`
+}
+
+// observatoryPageTestDesktopReportErrorJSON contains the JSON metadata for the
+// struct [ObservatoryPageTestDesktopReportError]
+type observatoryPageTestDesktopReportErrorJSON struct {
+ Code apijson.Field
+ Detail apijson.Field
+ FinalDisplayedURL apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ObservatoryPageTestDesktopReportError) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r observatoryPageTestDesktopReportErrorJSON) RawJSON() string {
+ return r.raw
+}
+
+// The error code of the Lighthouse result.
+type ObservatoryPageTestDesktopReportErrorCode string
+
+const (
+ ObservatoryPageTestDesktopReportErrorCodeNotReachable ObservatoryPageTestDesktopReportErrorCode = "NOT_REACHABLE"
+ ObservatoryPageTestDesktopReportErrorCodeDNSFailure ObservatoryPageTestDesktopReportErrorCode = "DNS_FAILURE"
+ ObservatoryPageTestDesktopReportErrorCodeNotHTML ObservatoryPageTestDesktopReportErrorCode = "NOT_HTML"
+ ObservatoryPageTestDesktopReportErrorCodeLighthouseTimeout ObservatoryPageTestDesktopReportErrorCode = "LIGHTHOUSE_TIMEOUT"
+ ObservatoryPageTestDesktopReportErrorCodeUnknown ObservatoryPageTestDesktopReportErrorCode = "UNKNOWN"
+)
+
+// The state of the Lighthouse report.
+type ObservatoryPageTestDesktopReportState string
+
+const (
+ ObservatoryPageTestDesktopReportStateRunning ObservatoryPageTestDesktopReportState = "RUNNING"
+ ObservatoryPageTestDesktopReportStateComplete ObservatoryPageTestDesktopReportState = "COMPLETE"
+ ObservatoryPageTestDesktopReportStateFailed ObservatoryPageTestDesktopReportState = "FAILED"
+)
+
+// The Lighthouse report.
+type ObservatoryPageTestMobileReport struct {
+ // Cumulative Layout Shift.
+ Cls float64 `json:"cls"`
+ // The type of device.
+ DeviceType ObservatoryPageTestMobileReportDeviceType `json:"deviceType"`
+ Error ObservatoryPageTestMobileReportError `json:"error"`
+ // First Contentful Paint.
+ Fcp float64 `json:"fcp"`
+ // The URL to the full Lighthouse JSON report.
+ JsonReportURL string `json:"jsonReportUrl"`
+ // Largest Contentful Paint.
+ Lcp float64 `json:"lcp"`
+ // The Lighthouse performance score.
+ PerformanceScore float64 `json:"performanceScore"`
+ // Speed Index.
+ Si float64 `json:"si"`
+ // The state of the Lighthouse report.
+ State ObservatoryPageTestMobileReportState `json:"state"`
+ // Total Blocking Time.
+ Tbt float64 `json:"tbt"`
+ // Time To First Byte.
+ Ttfb float64 `json:"ttfb"`
+ // Time To Interactive.
+ Tti float64 `json:"tti"`
+ JSON observatoryPageTestMobileReportJSON `json:"-"`
+}
+
+// observatoryPageTestMobileReportJSON contains the JSON metadata for the struct
+// [ObservatoryPageTestMobileReport]
+type observatoryPageTestMobileReportJSON struct {
+ Cls apijson.Field
+ DeviceType apijson.Field
+ Error apijson.Field
+ Fcp apijson.Field
+ JsonReportURL apijson.Field
+ Lcp apijson.Field
+ PerformanceScore apijson.Field
+ Si apijson.Field
+ State apijson.Field
+ Tbt apijson.Field
+ Ttfb apijson.Field
+ Tti apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ObservatoryPageTestMobileReport) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r observatoryPageTestMobileReportJSON) RawJSON() string {
+ return r.raw
+}
+
+// The type of device.
+type ObservatoryPageTestMobileReportDeviceType string
+
+const (
+ ObservatoryPageTestMobileReportDeviceTypeDesktop ObservatoryPageTestMobileReportDeviceType = "DESKTOP"
+ ObservatoryPageTestMobileReportDeviceTypeMobile ObservatoryPageTestMobileReportDeviceType = "MOBILE"
+)
+
+type ObservatoryPageTestMobileReportError struct {
+ // The error code of the Lighthouse result.
+ Code ObservatoryPageTestMobileReportErrorCode `json:"code"`
+ // Detailed error message.
+ Detail string `json:"detail"`
+ // The final URL displayed to the user.
+ FinalDisplayedURL string `json:"finalDisplayedUrl"`
+ JSON observatoryPageTestMobileReportErrorJSON `json:"-"`
+}
+
+// observatoryPageTestMobileReportErrorJSON contains the JSON metadata for the
+// struct [ObservatoryPageTestMobileReportError]
+type observatoryPageTestMobileReportErrorJSON struct {
+ Code apijson.Field
+ Detail apijson.Field
+ FinalDisplayedURL apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ObservatoryPageTestMobileReportError) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r observatoryPageTestMobileReportErrorJSON) RawJSON() string {
+ return r.raw
+}
+
+// The error code of the Lighthouse result.
+type ObservatoryPageTestMobileReportErrorCode string
+
+const (
+ ObservatoryPageTestMobileReportErrorCodeNotReachable ObservatoryPageTestMobileReportErrorCode = "NOT_REACHABLE"
+ ObservatoryPageTestMobileReportErrorCodeDNSFailure ObservatoryPageTestMobileReportErrorCode = "DNS_FAILURE"
+ ObservatoryPageTestMobileReportErrorCodeNotHTML ObservatoryPageTestMobileReportErrorCode = "NOT_HTML"
+ ObservatoryPageTestMobileReportErrorCodeLighthouseTimeout ObservatoryPageTestMobileReportErrorCode = "LIGHTHOUSE_TIMEOUT"
+ ObservatoryPageTestMobileReportErrorCodeUnknown ObservatoryPageTestMobileReportErrorCode = "UNKNOWN"
+)
+
+// The state of the Lighthouse report.
+type ObservatoryPageTestMobileReportState string
+
+const (
+ ObservatoryPageTestMobileReportStateRunning ObservatoryPageTestMobileReportState = "RUNNING"
+ ObservatoryPageTestMobileReportStateComplete ObservatoryPageTestMobileReportState = "COMPLETE"
+ ObservatoryPageTestMobileReportStateFailed ObservatoryPageTestMobileReportState = "FAILED"
+)
+
+// A test region with a label.
+type ObservatoryPageTestRegion struct {
+ Label string `json:"label"`
+ // A test region.
+ Value ObservatoryPageTestRegionValue `json:"value"`
+ JSON observatoryPageTestRegionJSON `json:"-"`
+}
+
+// observatoryPageTestRegionJSON contains the JSON metadata for the struct
+// [ObservatoryPageTestRegion]
+type observatoryPageTestRegionJSON struct {
+ Label apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ObservatoryPageTestRegion) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r observatoryPageTestRegionJSON) RawJSON() string {
+ return r.raw
+}
+
+// A test region.
+type ObservatoryPageTestRegionValue string
+
+const (
+ ObservatoryPageTestRegionValueAsiaEast1 ObservatoryPageTestRegionValue = "asia-east1"
+ ObservatoryPageTestRegionValueAsiaNortheast1 ObservatoryPageTestRegionValue = "asia-northeast1"
+ ObservatoryPageTestRegionValueAsiaNortheast2 ObservatoryPageTestRegionValue = "asia-northeast2"
+ ObservatoryPageTestRegionValueAsiaSouth1 ObservatoryPageTestRegionValue = "asia-south1"
+ ObservatoryPageTestRegionValueAsiaSoutheast1 ObservatoryPageTestRegionValue = "asia-southeast1"
+ ObservatoryPageTestRegionValueAustraliaSoutheast1 ObservatoryPageTestRegionValue = "australia-southeast1"
+ ObservatoryPageTestRegionValueEuropeNorth1 ObservatoryPageTestRegionValue = "europe-north1"
+ ObservatoryPageTestRegionValueEuropeSouthwest1 ObservatoryPageTestRegionValue = "europe-southwest1"
+ ObservatoryPageTestRegionValueEuropeWest1 ObservatoryPageTestRegionValue = "europe-west1"
+ ObservatoryPageTestRegionValueEuropeWest2 ObservatoryPageTestRegionValue = "europe-west2"
+ ObservatoryPageTestRegionValueEuropeWest3 ObservatoryPageTestRegionValue = "europe-west3"
+ ObservatoryPageTestRegionValueEuropeWest4 ObservatoryPageTestRegionValue = "europe-west4"
+ ObservatoryPageTestRegionValueEuropeWest8 ObservatoryPageTestRegionValue = "europe-west8"
+ ObservatoryPageTestRegionValueEuropeWest9 ObservatoryPageTestRegionValue = "europe-west9"
+ ObservatoryPageTestRegionValueMeWest1 ObservatoryPageTestRegionValue = "me-west1"
+ ObservatoryPageTestRegionValueSouthamericaEast1 ObservatoryPageTestRegionValue = "southamerica-east1"
+ ObservatoryPageTestRegionValueUsCentral1 ObservatoryPageTestRegionValue = "us-central1"
+ ObservatoryPageTestRegionValueUsEast1 ObservatoryPageTestRegionValue = "us-east1"
+ ObservatoryPageTestRegionValueUsEast4 ObservatoryPageTestRegionValue = "us-east4"
+ ObservatoryPageTestRegionValueUsSouth1 ObservatoryPageTestRegionValue = "us-south1"
+ ObservatoryPageTestRegionValueUsWest1 ObservatoryPageTestRegionValue = "us-west1"
+)
+
+// The frequency of the test.
+type ObservatoryPageTestScheduleFrequency string
+
+const (
+ ObservatoryPageTestScheduleFrequencyDaily ObservatoryPageTestScheduleFrequency = "DAILY"
+ ObservatoryPageTestScheduleFrequencyWeekly ObservatoryPageTestScheduleFrequency = "WEEKLY"
+)
+
+type TestListResponse struct {
+ Errors []TestListResponseError `json:"errors,required"`
+ Messages []TestListResponseMessage `json:"messages,required"`
+ // Whether the API call was successful.
+ Success bool `json:"success,required"`
+ ResultInfo TestListResponseResultInfo `json:"result_info"`
+ JSON testListResponseJSON `json:"-"`
+}
+
+// testListResponseJSON contains the JSON metadata for the struct
+// [TestListResponse]
+type testListResponseJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Success apijson.Field
+ ResultInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *TestListResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r testListResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type TestListResponseError struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON testListResponseErrorJSON `json:"-"`
+}
+
+// testListResponseErrorJSON contains the JSON metadata for the struct
+// [TestListResponseError]
+type testListResponseErrorJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *TestListResponseError) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r testListResponseErrorJSON) RawJSON() string {
+ return r.raw
+}
+
+type TestListResponseMessage struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON testListResponseMessageJSON `json:"-"`
+}
+
+// testListResponseMessageJSON contains the JSON metadata for the struct
+// [TestListResponseMessage]
+type testListResponseMessageJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *TestListResponseMessage) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r testListResponseMessageJSON) RawJSON() string {
+ return r.raw
+}
+
+type TestListResponseResultInfo struct {
+ Count int64 `json:"count"`
+ Page int64 `json:"page"`
+ PerPage int64 `json:"per_page"`
+ TotalCount int64 `json:"total_count"`
+ JSON testListResponseResultInfoJSON `json:"-"`
+}
+
+// testListResponseResultInfoJSON contains the JSON metadata for the struct
+// [TestListResponseResultInfo]
+type testListResponseResultInfoJSON struct {
+ Count apijson.Field
+ Page apijson.Field
+ PerPage apijson.Field
+ TotalCount apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *TestListResponseResultInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r testListResponseResultInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type TestDeleteResponse struct {
+ // Number of items affected.
+ Count float64 `json:"count"`
+ JSON testDeleteResponseJSON `json:"-"`
+}
+
+// testDeleteResponseJSON contains the JSON metadata for the struct
+// [TestDeleteResponse]
+type testDeleteResponseJSON struct {
+ Count apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *TestDeleteResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r testDeleteResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type TestNewParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+ // A test region.
+ Region param.Field[TestNewParamsRegion] `json:"region"`
+}
+
+func (r TestNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// A test region.
+type TestNewParamsRegion string
+
+const (
+ TestNewParamsRegionAsiaEast1 TestNewParamsRegion = "asia-east1"
+ TestNewParamsRegionAsiaNortheast1 TestNewParamsRegion = "asia-northeast1"
+ TestNewParamsRegionAsiaNortheast2 TestNewParamsRegion = "asia-northeast2"
+ TestNewParamsRegionAsiaSouth1 TestNewParamsRegion = "asia-south1"
+ TestNewParamsRegionAsiaSoutheast1 TestNewParamsRegion = "asia-southeast1"
+ TestNewParamsRegionAustraliaSoutheast1 TestNewParamsRegion = "australia-southeast1"
+ TestNewParamsRegionEuropeNorth1 TestNewParamsRegion = "europe-north1"
+ TestNewParamsRegionEuropeSouthwest1 TestNewParamsRegion = "europe-southwest1"
+ TestNewParamsRegionEuropeWest1 TestNewParamsRegion = "europe-west1"
+ TestNewParamsRegionEuropeWest2 TestNewParamsRegion = "europe-west2"
+ TestNewParamsRegionEuropeWest3 TestNewParamsRegion = "europe-west3"
+ TestNewParamsRegionEuropeWest4 TestNewParamsRegion = "europe-west4"
+ TestNewParamsRegionEuropeWest8 TestNewParamsRegion = "europe-west8"
+ TestNewParamsRegionEuropeWest9 TestNewParamsRegion = "europe-west9"
+ TestNewParamsRegionMeWest1 TestNewParamsRegion = "me-west1"
+ TestNewParamsRegionSouthamericaEast1 TestNewParamsRegion = "southamerica-east1"
+ TestNewParamsRegionUsCentral1 TestNewParamsRegion = "us-central1"
+ TestNewParamsRegionUsEast1 TestNewParamsRegion = "us-east1"
+ TestNewParamsRegionUsEast4 TestNewParamsRegion = "us-east4"
+ TestNewParamsRegionUsSouth1 TestNewParamsRegion = "us-south1"
+ TestNewParamsRegionUsWest1 TestNewParamsRegion = "us-west1"
+)
+
+type TestNewResponseEnvelope struct {
+ Result ObservatoryPageTest `json:"result"`
+ JSON testNewResponseEnvelopeJSON `json:"-"`
+}
+
+// testNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [TestNewResponseEnvelope]
+type testNewResponseEnvelopeJSON struct {
+ Result apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *TestNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r testNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type TestListParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+ Page param.Field[int64] `query:"page"`
+ PerPage param.Field[int64] `query:"per_page"`
+ // A test region.
+ Region param.Field[TestListParamsRegion] `query:"region"`
+}
+
+// URLQuery serializes [TestListParams]'s query parameters as `url.Values`.
+func (r TestListParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// A test region.
+type TestListParamsRegion string
+
+const (
+ TestListParamsRegionAsiaEast1 TestListParamsRegion = "asia-east1"
+ TestListParamsRegionAsiaNortheast1 TestListParamsRegion = "asia-northeast1"
+ TestListParamsRegionAsiaNortheast2 TestListParamsRegion = "asia-northeast2"
+ TestListParamsRegionAsiaSouth1 TestListParamsRegion = "asia-south1"
+ TestListParamsRegionAsiaSoutheast1 TestListParamsRegion = "asia-southeast1"
+ TestListParamsRegionAustraliaSoutheast1 TestListParamsRegion = "australia-southeast1"
+ TestListParamsRegionEuropeNorth1 TestListParamsRegion = "europe-north1"
+ TestListParamsRegionEuropeSouthwest1 TestListParamsRegion = "europe-southwest1"
+ TestListParamsRegionEuropeWest1 TestListParamsRegion = "europe-west1"
+ TestListParamsRegionEuropeWest2 TestListParamsRegion = "europe-west2"
+ TestListParamsRegionEuropeWest3 TestListParamsRegion = "europe-west3"
+ TestListParamsRegionEuropeWest4 TestListParamsRegion = "europe-west4"
+ TestListParamsRegionEuropeWest8 TestListParamsRegion = "europe-west8"
+ TestListParamsRegionEuropeWest9 TestListParamsRegion = "europe-west9"
+ TestListParamsRegionMeWest1 TestListParamsRegion = "me-west1"
+ TestListParamsRegionSouthamericaEast1 TestListParamsRegion = "southamerica-east1"
+ TestListParamsRegionUsCentral1 TestListParamsRegion = "us-central1"
+ TestListParamsRegionUsEast1 TestListParamsRegion = "us-east1"
+ TestListParamsRegionUsEast4 TestListParamsRegion = "us-east4"
+ TestListParamsRegionUsSouth1 TestListParamsRegion = "us-south1"
+ TestListParamsRegionUsWest1 TestListParamsRegion = "us-west1"
+)
+
+type TestDeleteParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+ // A test region.
+ Region param.Field[TestDeleteParamsRegion] `query:"region"`
+}
+
+// URLQuery serializes [TestDeleteParams]'s query parameters as `url.Values`.
+func (r TestDeleteParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// A test region.
+type TestDeleteParamsRegion string
+
+const (
+ TestDeleteParamsRegionAsiaEast1 TestDeleteParamsRegion = "asia-east1"
+ TestDeleteParamsRegionAsiaNortheast1 TestDeleteParamsRegion = "asia-northeast1"
+ TestDeleteParamsRegionAsiaNortheast2 TestDeleteParamsRegion = "asia-northeast2"
+ TestDeleteParamsRegionAsiaSouth1 TestDeleteParamsRegion = "asia-south1"
+ TestDeleteParamsRegionAsiaSoutheast1 TestDeleteParamsRegion = "asia-southeast1"
+ TestDeleteParamsRegionAustraliaSoutheast1 TestDeleteParamsRegion = "australia-southeast1"
+ TestDeleteParamsRegionEuropeNorth1 TestDeleteParamsRegion = "europe-north1"
+ TestDeleteParamsRegionEuropeSouthwest1 TestDeleteParamsRegion = "europe-southwest1"
+ TestDeleteParamsRegionEuropeWest1 TestDeleteParamsRegion = "europe-west1"
+ TestDeleteParamsRegionEuropeWest2 TestDeleteParamsRegion = "europe-west2"
+ TestDeleteParamsRegionEuropeWest3 TestDeleteParamsRegion = "europe-west3"
+ TestDeleteParamsRegionEuropeWest4 TestDeleteParamsRegion = "europe-west4"
+ TestDeleteParamsRegionEuropeWest8 TestDeleteParamsRegion = "europe-west8"
+ TestDeleteParamsRegionEuropeWest9 TestDeleteParamsRegion = "europe-west9"
+ TestDeleteParamsRegionMeWest1 TestDeleteParamsRegion = "me-west1"
+ TestDeleteParamsRegionSouthamericaEast1 TestDeleteParamsRegion = "southamerica-east1"
+ TestDeleteParamsRegionUsCentral1 TestDeleteParamsRegion = "us-central1"
+ TestDeleteParamsRegionUsEast1 TestDeleteParamsRegion = "us-east1"
+ TestDeleteParamsRegionUsEast4 TestDeleteParamsRegion = "us-east4"
+ TestDeleteParamsRegionUsSouth1 TestDeleteParamsRegion = "us-south1"
+ TestDeleteParamsRegionUsWest1 TestDeleteParamsRegion = "us-west1"
+)
+
+type TestDeleteResponseEnvelope struct {
+ Result TestDeleteResponse `json:"result"`
+ JSON testDeleteResponseEnvelopeJSON `json:"-"`
+}
+
+// testDeleteResponseEnvelopeJSON contains the JSON metadata for the struct
+// [TestDeleteResponseEnvelope]
+type testDeleteResponseEnvelopeJSON struct {
+ Result apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *TestDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r testDeleteResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type TestGetParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+}
+
+type TestGetResponseEnvelope struct {
+ Result ObservatoryPageTest `json:"result"`
+ JSON testGetResponseEnvelopeJSON `json:"-"`
+}
+
+// testGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [TestGetResponseEnvelope]
+type testGetResponseEnvelopeJSON struct {
+ Result apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *TestGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r testGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/speed/test_test.go b/speed/test_test.go
new file mode 100644
index 00000000000..1b5683e4f20
--- /dev/null
+++ b/speed/test_test.go
@@ -0,0 +1,141 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package speed_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/speed"
+)
+
+func TestTestNewWithOptionalParams(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"),
+ )
+ _, err := client.Speed.Tests.New(
+ context.TODO(),
+ "example.com",
+ speed.TestNewParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Region: cloudflare.F(speed.TestNewParamsRegionUsCentral1),
+ },
+ )
+ 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())
+ }
+}
+
+func TestTestListWithOptionalParams(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"),
+ )
+ _, err := client.Speed.Tests.List(
+ context.TODO(),
+ "example.com",
+ speed.TestListParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Page: cloudflare.F(int64(1)),
+ PerPage: cloudflare.F(int64(20)),
+ Region: cloudflare.F(speed.TestListParamsRegionUsCentral1),
+ },
+ )
+ 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())
+ }
+}
+
+func TestTestDeleteWithOptionalParams(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"),
+ )
+ _, err := client.Speed.Tests.Delete(
+ context.TODO(),
+ "example.com",
+ speed.TestDeleteParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Region: cloudflare.F(speed.TestDeleteParamsRegionUsCentral1),
+ },
+ )
+ 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())
+ }
+}
+
+func TestTestGet(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"),
+ )
+ _, err := client.Speed.Tests.Get(
+ context.TODO(),
+ "example.com",
+ "string",
+ speed.TestGetParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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/speedavailability.go b/speedavailability.go
deleted file mode 100644
index bdaf8767e29..00000000000
--- a/speedavailability.go
+++ /dev/null
@@ -1,182 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// SpeedAvailabilityService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewSpeedAvailabilityService] method
-// instead.
-type SpeedAvailabilityService struct {
- Options []option.RequestOption
-}
-
-// NewSpeedAvailabilityService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewSpeedAvailabilityService(opts ...option.RequestOption) (r *SpeedAvailabilityService) {
- r = &SpeedAvailabilityService{}
- r.Options = opts
- return
-}
-
-// Retrieves quota for all plans, as well as the current zone quota.
-func (r *SpeedAvailabilityService) List(ctx context.Context, query SpeedAvailabilityListParams, opts ...option.RequestOption) (res *SpeedAvailabilityListResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env SpeedAvailabilityListResponseEnvelope
- path := fmt.Sprintf("zones/%s/speed_api/availabilities", query.ZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type SpeedAvailabilityListResponse struct {
- Quota SpeedAvailabilityListResponseQuota `json:"quota"`
- Regions []SpeedAvailabilityListResponseRegion `json:"regions"`
- RegionsPerPlan interface{} `json:"regionsPerPlan"`
- JSON speedAvailabilityListResponseJSON `json:"-"`
-}
-
-// speedAvailabilityListResponseJSON contains the JSON metadata for the struct
-// [SpeedAvailabilityListResponse]
-type speedAvailabilityListResponseJSON struct {
- Quota apijson.Field
- Regions apijson.Field
- RegionsPerPlan apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SpeedAvailabilityListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r speedAvailabilityListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type SpeedAvailabilityListResponseQuota struct {
- // Cloudflare plan.
- Plan string `json:"plan"`
- // The number of tests available per plan.
- QuotasPerPlan map[string]float64 `json:"quotasPerPlan"`
- // The number of remaining schedules available.
- RemainingSchedules float64 `json:"remainingSchedules"`
- // The number of remaining tests available.
- RemainingTests float64 `json:"remainingTests"`
- // The number of schedules available per plan.
- ScheduleQuotasPerPlan map[string]float64 `json:"scheduleQuotasPerPlan"`
- JSON speedAvailabilityListResponseQuotaJSON `json:"-"`
-}
-
-// speedAvailabilityListResponseQuotaJSON contains the JSON metadata for the struct
-// [SpeedAvailabilityListResponseQuota]
-type speedAvailabilityListResponseQuotaJSON struct {
- Plan apijson.Field
- QuotasPerPlan apijson.Field
- RemainingSchedules apijson.Field
- RemainingTests apijson.Field
- ScheduleQuotasPerPlan apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SpeedAvailabilityListResponseQuota) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r speedAvailabilityListResponseQuotaJSON) RawJSON() string {
- return r.raw
-}
-
-// A test region with a label.
-type SpeedAvailabilityListResponseRegion struct {
- Label string `json:"label"`
- // A test region.
- Value SpeedAvailabilityListResponseRegionsValue `json:"value"`
- JSON speedAvailabilityListResponseRegionJSON `json:"-"`
-}
-
-// speedAvailabilityListResponseRegionJSON contains the JSON metadata for the
-// struct [SpeedAvailabilityListResponseRegion]
-type speedAvailabilityListResponseRegionJSON struct {
- Label apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SpeedAvailabilityListResponseRegion) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r speedAvailabilityListResponseRegionJSON) RawJSON() string {
- return r.raw
-}
-
-// A test region.
-type SpeedAvailabilityListResponseRegionsValue string
-
-const (
- SpeedAvailabilityListResponseRegionsValueAsiaEast1 SpeedAvailabilityListResponseRegionsValue = "asia-east1"
- SpeedAvailabilityListResponseRegionsValueAsiaNortheast1 SpeedAvailabilityListResponseRegionsValue = "asia-northeast1"
- SpeedAvailabilityListResponseRegionsValueAsiaNortheast2 SpeedAvailabilityListResponseRegionsValue = "asia-northeast2"
- SpeedAvailabilityListResponseRegionsValueAsiaSouth1 SpeedAvailabilityListResponseRegionsValue = "asia-south1"
- SpeedAvailabilityListResponseRegionsValueAsiaSoutheast1 SpeedAvailabilityListResponseRegionsValue = "asia-southeast1"
- SpeedAvailabilityListResponseRegionsValueAustraliaSoutheast1 SpeedAvailabilityListResponseRegionsValue = "australia-southeast1"
- SpeedAvailabilityListResponseRegionsValueEuropeNorth1 SpeedAvailabilityListResponseRegionsValue = "europe-north1"
- SpeedAvailabilityListResponseRegionsValueEuropeSouthwest1 SpeedAvailabilityListResponseRegionsValue = "europe-southwest1"
- SpeedAvailabilityListResponseRegionsValueEuropeWest1 SpeedAvailabilityListResponseRegionsValue = "europe-west1"
- SpeedAvailabilityListResponseRegionsValueEuropeWest2 SpeedAvailabilityListResponseRegionsValue = "europe-west2"
- SpeedAvailabilityListResponseRegionsValueEuropeWest3 SpeedAvailabilityListResponseRegionsValue = "europe-west3"
- SpeedAvailabilityListResponseRegionsValueEuropeWest4 SpeedAvailabilityListResponseRegionsValue = "europe-west4"
- SpeedAvailabilityListResponseRegionsValueEuropeWest8 SpeedAvailabilityListResponseRegionsValue = "europe-west8"
- SpeedAvailabilityListResponseRegionsValueEuropeWest9 SpeedAvailabilityListResponseRegionsValue = "europe-west9"
- SpeedAvailabilityListResponseRegionsValueMeWest1 SpeedAvailabilityListResponseRegionsValue = "me-west1"
- SpeedAvailabilityListResponseRegionsValueSouthamericaEast1 SpeedAvailabilityListResponseRegionsValue = "southamerica-east1"
- SpeedAvailabilityListResponseRegionsValueUsCentral1 SpeedAvailabilityListResponseRegionsValue = "us-central1"
- SpeedAvailabilityListResponseRegionsValueUsEast1 SpeedAvailabilityListResponseRegionsValue = "us-east1"
- SpeedAvailabilityListResponseRegionsValueUsEast4 SpeedAvailabilityListResponseRegionsValue = "us-east4"
- SpeedAvailabilityListResponseRegionsValueUsSouth1 SpeedAvailabilityListResponseRegionsValue = "us-south1"
- SpeedAvailabilityListResponseRegionsValueUsWest1 SpeedAvailabilityListResponseRegionsValue = "us-west1"
-)
-
-type SpeedAvailabilityListParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
-}
-
-type SpeedAvailabilityListResponseEnvelope struct {
- Result SpeedAvailabilityListResponse `json:"result"`
- JSON speedAvailabilityListResponseEnvelopeJSON `json:"-"`
-}
-
-// speedAvailabilityListResponseEnvelopeJSON contains the JSON metadata for the
-// struct [SpeedAvailabilityListResponseEnvelope]
-type speedAvailabilityListResponseEnvelopeJSON struct {
- Result apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SpeedAvailabilityListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r speedAvailabilityListResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
diff --git a/speedavailability_test.go b/speedavailability_test.go
deleted file mode 100644
index 9ec0733db97..00000000000
--- a/speedavailability_test.go
+++ /dev/null
@@ -1,40 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestSpeedAvailabilityList(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"),
- )
- _, err := client.Speed.Availabilities.List(context.TODO(), cloudflare.SpeedAvailabilityListParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- })
- 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/speedpage.go b/speedpage.go
deleted file mode 100644
index 9133ea8c6c5..00000000000
--- a/speedpage.go
+++ /dev/null
@@ -1,482 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// SpeedPageService contains methods and other services that help with interacting
-// with the cloudflare API. Note, unlike clients, this service does not read
-// variables from the environment automatically. You should not instantiate this
-// service directly, and instead use the [NewSpeedPageService] method instead.
-type SpeedPageService struct {
- Options []option.RequestOption
-}
-
-// NewSpeedPageService generates a new service that applies the given options to
-// each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewSpeedPageService(opts ...option.RequestOption) (r *SpeedPageService) {
- r = &SpeedPageService{}
- r.Options = opts
- return
-}
-
-// Lists all webpages which have been tested.
-func (r *SpeedPageService) List(ctx context.Context, query SpeedPageListParams, opts ...option.RequestOption) (res *[]SpeedPageListResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env SpeedPageListResponseEnvelope
- path := fmt.Sprintf("zones/%s/speed_api/pages", query.ZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type SpeedPageListResponse struct {
- // A test region with a label.
- Region SpeedPageListResponseRegion `json:"region"`
- // The frequency of the test.
- ScheduleFrequency SpeedPageListResponseScheduleFrequency `json:"scheduleFrequency"`
- Tests []SpeedPageListResponseTest `json:"tests"`
- // A URL.
- URL string `json:"url"`
- JSON speedPageListResponseJSON `json:"-"`
-}
-
-// speedPageListResponseJSON contains the JSON metadata for the struct
-// [SpeedPageListResponse]
-type speedPageListResponseJSON struct {
- Region apijson.Field
- ScheduleFrequency apijson.Field
- Tests apijson.Field
- URL apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SpeedPageListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r speedPageListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// A test region with a label.
-type SpeedPageListResponseRegion struct {
- Label string `json:"label"`
- // A test region.
- Value SpeedPageListResponseRegionValue `json:"value"`
- JSON speedPageListResponseRegionJSON `json:"-"`
-}
-
-// speedPageListResponseRegionJSON contains the JSON metadata for the struct
-// [SpeedPageListResponseRegion]
-type speedPageListResponseRegionJSON struct {
- Label apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SpeedPageListResponseRegion) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r speedPageListResponseRegionJSON) RawJSON() string {
- return r.raw
-}
-
-// A test region.
-type SpeedPageListResponseRegionValue string
-
-const (
- SpeedPageListResponseRegionValueAsiaEast1 SpeedPageListResponseRegionValue = "asia-east1"
- SpeedPageListResponseRegionValueAsiaNortheast1 SpeedPageListResponseRegionValue = "asia-northeast1"
- SpeedPageListResponseRegionValueAsiaNortheast2 SpeedPageListResponseRegionValue = "asia-northeast2"
- SpeedPageListResponseRegionValueAsiaSouth1 SpeedPageListResponseRegionValue = "asia-south1"
- SpeedPageListResponseRegionValueAsiaSoutheast1 SpeedPageListResponseRegionValue = "asia-southeast1"
- SpeedPageListResponseRegionValueAustraliaSoutheast1 SpeedPageListResponseRegionValue = "australia-southeast1"
- SpeedPageListResponseRegionValueEuropeNorth1 SpeedPageListResponseRegionValue = "europe-north1"
- SpeedPageListResponseRegionValueEuropeSouthwest1 SpeedPageListResponseRegionValue = "europe-southwest1"
- SpeedPageListResponseRegionValueEuropeWest1 SpeedPageListResponseRegionValue = "europe-west1"
- SpeedPageListResponseRegionValueEuropeWest2 SpeedPageListResponseRegionValue = "europe-west2"
- SpeedPageListResponseRegionValueEuropeWest3 SpeedPageListResponseRegionValue = "europe-west3"
- SpeedPageListResponseRegionValueEuropeWest4 SpeedPageListResponseRegionValue = "europe-west4"
- SpeedPageListResponseRegionValueEuropeWest8 SpeedPageListResponseRegionValue = "europe-west8"
- SpeedPageListResponseRegionValueEuropeWest9 SpeedPageListResponseRegionValue = "europe-west9"
- SpeedPageListResponseRegionValueMeWest1 SpeedPageListResponseRegionValue = "me-west1"
- SpeedPageListResponseRegionValueSouthamericaEast1 SpeedPageListResponseRegionValue = "southamerica-east1"
- SpeedPageListResponseRegionValueUsCentral1 SpeedPageListResponseRegionValue = "us-central1"
- SpeedPageListResponseRegionValueUsEast1 SpeedPageListResponseRegionValue = "us-east1"
- SpeedPageListResponseRegionValueUsEast4 SpeedPageListResponseRegionValue = "us-east4"
- SpeedPageListResponseRegionValueUsSouth1 SpeedPageListResponseRegionValue = "us-south1"
- SpeedPageListResponseRegionValueUsWest1 SpeedPageListResponseRegionValue = "us-west1"
-)
-
-// The frequency of the test.
-type SpeedPageListResponseScheduleFrequency string
-
-const (
- SpeedPageListResponseScheduleFrequencyDaily SpeedPageListResponseScheduleFrequency = "DAILY"
- SpeedPageListResponseScheduleFrequencyWeekly SpeedPageListResponseScheduleFrequency = "WEEKLY"
-)
-
-type SpeedPageListResponseTest struct {
- // UUID
- ID string `json:"id"`
- Date time.Time `json:"date" format:"date-time"`
- // The Lighthouse report.
- DesktopReport SpeedPageListResponseTestsDesktopReport `json:"desktopReport"`
- // The Lighthouse report.
- MobileReport SpeedPageListResponseTestsMobileReport `json:"mobileReport"`
- // A test region with a label.
- Region SpeedPageListResponseTestsRegion `json:"region"`
- // The frequency of the test.
- ScheduleFrequency SpeedPageListResponseTestsScheduleFrequency `json:"scheduleFrequency"`
- // A URL.
- URL string `json:"url"`
- JSON speedPageListResponseTestJSON `json:"-"`
-}
-
-// speedPageListResponseTestJSON contains the JSON metadata for the struct
-// [SpeedPageListResponseTest]
-type speedPageListResponseTestJSON struct {
- ID apijson.Field
- Date apijson.Field
- DesktopReport apijson.Field
- MobileReport apijson.Field
- Region apijson.Field
- ScheduleFrequency apijson.Field
- URL apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SpeedPageListResponseTest) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r speedPageListResponseTestJSON) RawJSON() string {
- return r.raw
-}
-
-// The Lighthouse report.
-type SpeedPageListResponseTestsDesktopReport struct {
- // Cumulative Layout Shift.
- Cls float64 `json:"cls"`
- // The type of device.
- DeviceType SpeedPageListResponseTestsDesktopReportDeviceType `json:"deviceType"`
- Error SpeedPageListResponseTestsDesktopReportError `json:"error"`
- // First Contentful Paint.
- Fcp float64 `json:"fcp"`
- // The URL to the full Lighthouse JSON report.
- JsonReportURL string `json:"jsonReportUrl"`
- // Largest Contentful Paint.
- Lcp float64 `json:"lcp"`
- // The Lighthouse performance score.
- PerformanceScore float64 `json:"performanceScore"`
- // Speed Index.
- Si float64 `json:"si"`
- // The state of the Lighthouse report.
- State SpeedPageListResponseTestsDesktopReportState `json:"state"`
- // Total Blocking Time.
- Tbt float64 `json:"tbt"`
- // Time To First Byte.
- Ttfb float64 `json:"ttfb"`
- // Time To Interactive.
- Tti float64 `json:"tti"`
- JSON speedPageListResponseTestsDesktopReportJSON `json:"-"`
-}
-
-// speedPageListResponseTestsDesktopReportJSON contains the JSON metadata for the
-// struct [SpeedPageListResponseTestsDesktopReport]
-type speedPageListResponseTestsDesktopReportJSON struct {
- Cls apijson.Field
- DeviceType apijson.Field
- Error apijson.Field
- Fcp apijson.Field
- JsonReportURL apijson.Field
- Lcp apijson.Field
- PerformanceScore apijson.Field
- Si apijson.Field
- State apijson.Field
- Tbt apijson.Field
- Ttfb apijson.Field
- Tti apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SpeedPageListResponseTestsDesktopReport) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r speedPageListResponseTestsDesktopReportJSON) RawJSON() string {
- return r.raw
-}
-
-// The type of device.
-type SpeedPageListResponseTestsDesktopReportDeviceType string
-
-const (
- SpeedPageListResponseTestsDesktopReportDeviceTypeDesktop SpeedPageListResponseTestsDesktopReportDeviceType = "DESKTOP"
- SpeedPageListResponseTestsDesktopReportDeviceTypeMobile SpeedPageListResponseTestsDesktopReportDeviceType = "MOBILE"
-)
-
-type SpeedPageListResponseTestsDesktopReportError struct {
- // The error code of the Lighthouse result.
- Code SpeedPageListResponseTestsDesktopReportErrorCode `json:"code"`
- // Detailed error message.
- Detail string `json:"detail"`
- // The final URL displayed to the user.
- FinalDisplayedURL string `json:"finalDisplayedUrl"`
- JSON speedPageListResponseTestsDesktopReportErrorJSON `json:"-"`
-}
-
-// speedPageListResponseTestsDesktopReportErrorJSON contains the JSON metadata for
-// the struct [SpeedPageListResponseTestsDesktopReportError]
-type speedPageListResponseTestsDesktopReportErrorJSON struct {
- Code apijson.Field
- Detail apijson.Field
- FinalDisplayedURL apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SpeedPageListResponseTestsDesktopReportError) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r speedPageListResponseTestsDesktopReportErrorJSON) RawJSON() string {
- return r.raw
-}
-
-// The error code of the Lighthouse result.
-type SpeedPageListResponseTestsDesktopReportErrorCode string
-
-const (
- SpeedPageListResponseTestsDesktopReportErrorCodeNotReachable SpeedPageListResponseTestsDesktopReportErrorCode = "NOT_REACHABLE"
- SpeedPageListResponseTestsDesktopReportErrorCodeDNSFailure SpeedPageListResponseTestsDesktopReportErrorCode = "DNS_FAILURE"
- SpeedPageListResponseTestsDesktopReportErrorCodeNotHTML SpeedPageListResponseTestsDesktopReportErrorCode = "NOT_HTML"
- SpeedPageListResponseTestsDesktopReportErrorCodeLighthouseTimeout SpeedPageListResponseTestsDesktopReportErrorCode = "LIGHTHOUSE_TIMEOUT"
- SpeedPageListResponseTestsDesktopReportErrorCodeUnknown SpeedPageListResponseTestsDesktopReportErrorCode = "UNKNOWN"
-)
-
-// The state of the Lighthouse report.
-type SpeedPageListResponseTestsDesktopReportState string
-
-const (
- SpeedPageListResponseTestsDesktopReportStateRunning SpeedPageListResponseTestsDesktopReportState = "RUNNING"
- SpeedPageListResponseTestsDesktopReportStateComplete SpeedPageListResponseTestsDesktopReportState = "COMPLETE"
- SpeedPageListResponseTestsDesktopReportStateFailed SpeedPageListResponseTestsDesktopReportState = "FAILED"
-)
-
-// The Lighthouse report.
-type SpeedPageListResponseTestsMobileReport struct {
- // Cumulative Layout Shift.
- Cls float64 `json:"cls"`
- // The type of device.
- DeviceType SpeedPageListResponseTestsMobileReportDeviceType `json:"deviceType"`
- Error SpeedPageListResponseTestsMobileReportError `json:"error"`
- // First Contentful Paint.
- Fcp float64 `json:"fcp"`
- // The URL to the full Lighthouse JSON report.
- JsonReportURL string `json:"jsonReportUrl"`
- // Largest Contentful Paint.
- Lcp float64 `json:"lcp"`
- // The Lighthouse performance score.
- PerformanceScore float64 `json:"performanceScore"`
- // Speed Index.
- Si float64 `json:"si"`
- // The state of the Lighthouse report.
- State SpeedPageListResponseTestsMobileReportState `json:"state"`
- // Total Blocking Time.
- Tbt float64 `json:"tbt"`
- // Time To First Byte.
- Ttfb float64 `json:"ttfb"`
- // Time To Interactive.
- Tti float64 `json:"tti"`
- JSON speedPageListResponseTestsMobileReportJSON `json:"-"`
-}
-
-// speedPageListResponseTestsMobileReportJSON contains the JSON metadata for the
-// struct [SpeedPageListResponseTestsMobileReport]
-type speedPageListResponseTestsMobileReportJSON struct {
- Cls apijson.Field
- DeviceType apijson.Field
- Error apijson.Field
- Fcp apijson.Field
- JsonReportURL apijson.Field
- Lcp apijson.Field
- PerformanceScore apijson.Field
- Si apijson.Field
- State apijson.Field
- Tbt apijson.Field
- Ttfb apijson.Field
- Tti apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SpeedPageListResponseTestsMobileReport) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r speedPageListResponseTestsMobileReportJSON) RawJSON() string {
- return r.raw
-}
-
-// The type of device.
-type SpeedPageListResponseTestsMobileReportDeviceType string
-
-const (
- SpeedPageListResponseTestsMobileReportDeviceTypeDesktop SpeedPageListResponseTestsMobileReportDeviceType = "DESKTOP"
- SpeedPageListResponseTestsMobileReportDeviceTypeMobile SpeedPageListResponseTestsMobileReportDeviceType = "MOBILE"
-)
-
-type SpeedPageListResponseTestsMobileReportError struct {
- // The error code of the Lighthouse result.
- Code SpeedPageListResponseTestsMobileReportErrorCode `json:"code"`
- // Detailed error message.
- Detail string `json:"detail"`
- // The final URL displayed to the user.
- FinalDisplayedURL string `json:"finalDisplayedUrl"`
- JSON speedPageListResponseTestsMobileReportErrorJSON `json:"-"`
-}
-
-// speedPageListResponseTestsMobileReportErrorJSON contains the JSON metadata for
-// the struct [SpeedPageListResponseTestsMobileReportError]
-type speedPageListResponseTestsMobileReportErrorJSON struct {
- Code apijson.Field
- Detail apijson.Field
- FinalDisplayedURL apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SpeedPageListResponseTestsMobileReportError) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r speedPageListResponseTestsMobileReportErrorJSON) RawJSON() string {
- return r.raw
-}
-
-// The error code of the Lighthouse result.
-type SpeedPageListResponseTestsMobileReportErrorCode string
-
-const (
- SpeedPageListResponseTestsMobileReportErrorCodeNotReachable SpeedPageListResponseTestsMobileReportErrorCode = "NOT_REACHABLE"
- SpeedPageListResponseTestsMobileReportErrorCodeDNSFailure SpeedPageListResponseTestsMobileReportErrorCode = "DNS_FAILURE"
- SpeedPageListResponseTestsMobileReportErrorCodeNotHTML SpeedPageListResponseTestsMobileReportErrorCode = "NOT_HTML"
- SpeedPageListResponseTestsMobileReportErrorCodeLighthouseTimeout SpeedPageListResponseTestsMobileReportErrorCode = "LIGHTHOUSE_TIMEOUT"
- SpeedPageListResponseTestsMobileReportErrorCodeUnknown SpeedPageListResponseTestsMobileReportErrorCode = "UNKNOWN"
-)
-
-// The state of the Lighthouse report.
-type SpeedPageListResponseTestsMobileReportState string
-
-const (
- SpeedPageListResponseTestsMobileReportStateRunning SpeedPageListResponseTestsMobileReportState = "RUNNING"
- SpeedPageListResponseTestsMobileReportStateComplete SpeedPageListResponseTestsMobileReportState = "COMPLETE"
- SpeedPageListResponseTestsMobileReportStateFailed SpeedPageListResponseTestsMobileReportState = "FAILED"
-)
-
-// A test region with a label.
-type SpeedPageListResponseTestsRegion struct {
- Label string `json:"label"`
- // A test region.
- Value SpeedPageListResponseTestsRegionValue `json:"value"`
- JSON speedPageListResponseTestsRegionJSON `json:"-"`
-}
-
-// speedPageListResponseTestsRegionJSON contains the JSON metadata for the struct
-// [SpeedPageListResponseTestsRegion]
-type speedPageListResponseTestsRegionJSON struct {
- Label apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SpeedPageListResponseTestsRegion) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r speedPageListResponseTestsRegionJSON) RawJSON() string {
- return r.raw
-}
-
-// A test region.
-type SpeedPageListResponseTestsRegionValue string
-
-const (
- SpeedPageListResponseTestsRegionValueAsiaEast1 SpeedPageListResponseTestsRegionValue = "asia-east1"
- SpeedPageListResponseTestsRegionValueAsiaNortheast1 SpeedPageListResponseTestsRegionValue = "asia-northeast1"
- SpeedPageListResponseTestsRegionValueAsiaNortheast2 SpeedPageListResponseTestsRegionValue = "asia-northeast2"
- SpeedPageListResponseTestsRegionValueAsiaSouth1 SpeedPageListResponseTestsRegionValue = "asia-south1"
- SpeedPageListResponseTestsRegionValueAsiaSoutheast1 SpeedPageListResponseTestsRegionValue = "asia-southeast1"
- SpeedPageListResponseTestsRegionValueAustraliaSoutheast1 SpeedPageListResponseTestsRegionValue = "australia-southeast1"
- SpeedPageListResponseTestsRegionValueEuropeNorth1 SpeedPageListResponseTestsRegionValue = "europe-north1"
- SpeedPageListResponseTestsRegionValueEuropeSouthwest1 SpeedPageListResponseTestsRegionValue = "europe-southwest1"
- SpeedPageListResponseTestsRegionValueEuropeWest1 SpeedPageListResponseTestsRegionValue = "europe-west1"
- SpeedPageListResponseTestsRegionValueEuropeWest2 SpeedPageListResponseTestsRegionValue = "europe-west2"
- SpeedPageListResponseTestsRegionValueEuropeWest3 SpeedPageListResponseTestsRegionValue = "europe-west3"
- SpeedPageListResponseTestsRegionValueEuropeWest4 SpeedPageListResponseTestsRegionValue = "europe-west4"
- SpeedPageListResponseTestsRegionValueEuropeWest8 SpeedPageListResponseTestsRegionValue = "europe-west8"
- SpeedPageListResponseTestsRegionValueEuropeWest9 SpeedPageListResponseTestsRegionValue = "europe-west9"
- SpeedPageListResponseTestsRegionValueMeWest1 SpeedPageListResponseTestsRegionValue = "me-west1"
- SpeedPageListResponseTestsRegionValueSouthamericaEast1 SpeedPageListResponseTestsRegionValue = "southamerica-east1"
- SpeedPageListResponseTestsRegionValueUsCentral1 SpeedPageListResponseTestsRegionValue = "us-central1"
- SpeedPageListResponseTestsRegionValueUsEast1 SpeedPageListResponseTestsRegionValue = "us-east1"
- SpeedPageListResponseTestsRegionValueUsEast4 SpeedPageListResponseTestsRegionValue = "us-east4"
- SpeedPageListResponseTestsRegionValueUsSouth1 SpeedPageListResponseTestsRegionValue = "us-south1"
- SpeedPageListResponseTestsRegionValueUsWest1 SpeedPageListResponseTestsRegionValue = "us-west1"
-)
-
-// The frequency of the test.
-type SpeedPageListResponseTestsScheduleFrequency string
-
-const (
- SpeedPageListResponseTestsScheduleFrequencyDaily SpeedPageListResponseTestsScheduleFrequency = "DAILY"
- SpeedPageListResponseTestsScheduleFrequencyWeekly SpeedPageListResponseTestsScheduleFrequency = "WEEKLY"
-)
-
-type SpeedPageListParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
-}
-
-type SpeedPageListResponseEnvelope struct {
- Result []SpeedPageListResponse `json:"result"`
- JSON speedPageListResponseEnvelopeJSON `json:"-"`
-}
-
-// speedPageListResponseEnvelopeJSON contains the JSON metadata for the struct
-// [SpeedPageListResponseEnvelope]
-type speedPageListResponseEnvelopeJSON struct {
- Result apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SpeedPageListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r speedPageListResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
diff --git a/speedpage_test.go b/speedpage_test.go
deleted file mode 100644
index e3a6f4385ed..00000000000
--- a/speedpage_test.go
+++ /dev/null
@@ -1,40 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestSpeedPageList(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"),
- )
- _, err := client.Speed.Pages.List(context.TODO(), cloudflare.SpeedPageListParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- })
- 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/speedschedule.go b/speedschedule.go
deleted file mode 100644
index 2925367b264..00000000000
--- a/speedschedule.go
+++ /dev/null
@@ -1,520 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// SpeedScheduleService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewSpeedScheduleService] method
-// instead.
-type SpeedScheduleService struct {
- Options []option.RequestOption
-}
-
-// NewSpeedScheduleService generates a new service that applies the given options
-// to each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewSpeedScheduleService(opts ...option.RequestOption) (r *SpeedScheduleService) {
- r = &SpeedScheduleService{}
- r.Options = opts
- return
-}
-
-// Creates a scheduled test for a page.
-func (r *SpeedScheduleService) New(ctx context.Context, url string, params SpeedScheduleNewParams, opts ...option.RequestOption) (res *SpeedScheduleNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env SpeedScheduleNewResponseEnvelope
- path := fmt.Sprintf("zones/%s/speed_api/schedule/%s", params.ZoneID, url)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type SpeedScheduleNewResponse struct {
- // The test schedule.
- Schedule SpeedScheduleNewResponseSchedule `json:"schedule"`
- Test SpeedScheduleNewResponseTest `json:"test"`
- JSON speedScheduleNewResponseJSON `json:"-"`
-}
-
-// speedScheduleNewResponseJSON contains the JSON metadata for the struct
-// [SpeedScheduleNewResponse]
-type speedScheduleNewResponseJSON struct {
- Schedule apijson.Field
- Test apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SpeedScheduleNewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r speedScheduleNewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// The test schedule.
-type SpeedScheduleNewResponseSchedule struct {
- // The frequency of the test.
- Frequency SpeedScheduleNewResponseScheduleFrequency `json:"frequency"`
- // A test region.
- Region SpeedScheduleNewResponseScheduleRegion `json:"region"`
- // A URL.
- URL string `json:"url"`
- JSON speedScheduleNewResponseScheduleJSON `json:"-"`
-}
-
-// speedScheduleNewResponseScheduleJSON contains the JSON metadata for the struct
-// [SpeedScheduleNewResponseSchedule]
-type speedScheduleNewResponseScheduleJSON struct {
- Frequency apijson.Field
- Region apijson.Field
- URL apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SpeedScheduleNewResponseSchedule) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r speedScheduleNewResponseScheduleJSON) RawJSON() string {
- return r.raw
-}
-
-// The frequency of the test.
-type SpeedScheduleNewResponseScheduleFrequency string
-
-const (
- SpeedScheduleNewResponseScheduleFrequencyDaily SpeedScheduleNewResponseScheduleFrequency = "DAILY"
- SpeedScheduleNewResponseScheduleFrequencyWeekly SpeedScheduleNewResponseScheduleFrequency = "WEEKLY"
-)
-
-// A test region.
-type SpeedScheduleNewResponseScheduleRegion string
-
-const (
- SpeedScheduleNewResponseScheduleRegionAsiaEast1 SpeedScheduleNewResponseScheduleRegion = "asia-east1"
- SpeedScheduleNewResponseScheduleRegionAsiaNortheast1 SpeedScheduleNewResponseScheduleRegion = "asia-northeast1"
- SpeedScheduleNewResponseScheduleRegionAsiaNortheast2 SpeedScheduleNewResponseScheduleRegion = "asia-northeast2"
- SpeedScheduleNewResponseScheduleRegionAsiaSouth1 SpeedScheduleNewResponseScheduleRegion = "asia-south1"
- SpeedScheduleNewResponseScheduleRegionAsiaSoutheast1 SpeedScheduleNewResponseScheduleRegion = "asia-southeast1"
- SpeedScheduleNewResponseScheduleRegionAustraliaSoutheast1 SpeedScheduleNewResponseScheduleRegion = "australia-southeast1"
- SpeedScheduleNewResponseScheduleRegionEuropeNorth1 SpeedScheduleNewResponseScheduleRegion = "europe-north1"
- SpeedScheduleNewResponseScheduleRegionEuropeSouthwest1 SpeedScheduleNewResponseScheduleRegion = "europe-southwest1"
- SpeedScheduleNewResponseScheduleRegionEuropeWest1 SpeedScheduleNewResponseScheduleRegion = "europe-west1"
- SpeedScheduleNewResponseScheduleRegionEuropeWest2 SpeedScheduleNewResponseScheduleRegion = "europe-west2"
- SpeedScheduleNewResponseScheduleRegionEuropeWest3 SpeedScheduleNewResponseScheduleRegion = "europe-west3"
- SpeedScheduleNewResponseScheduleRegionEuropeWest4 SpeedScheduleNewResponseScheduleRegion = "europe-west4"
- SpeedScheduleNewResponseScheduleRegionEuropeWest8 SpeedScheduleNewResponseScheduleRegion = "europe-west8"
- SpeedScheduleNewResponseScheduleRegionEuropeWest9 SpeedScheduleNewResponseScheduleRegion = "europe-west9"
- SpeedScheduleNewResponseScheduleRegionMeWest1 SpeedScheduleNewResponseScheduleRegion = "me-west1"
- SpeedScheduleNewResponseScheduleRegionSouthamericaEast1 SpeedScheduleNewResponseScheduleRegion = "southamerica-east1"
- SpeedScheduleNewResponseScheduleRegionUsCentral1 SpeedScheduleNewResponseScheduleRegion = "us-central1"
- SpeedScheduleNewResponseScheduleRegionUsEast1 SpeedScheduleNewResponseScheduleRegion = "us-east1"
- SpeedScheduleNewResponseScheduleRegionUsEast4 SpeedScheduleNewResponseScheduleRegion = "us-east4"
- SpeedScheduleNewResponseScheduleRegionUsSouth1 SpeedScheduleNewResponseScheduleRegion = "us-south1"
- SpeedScheduleNewResponseScheduleRegionUsWest1 SpeedScheduleNewResponseScheduleRegion = "us-west1"
-)
-
-type SpeedScheduleNewResponseTest struct {
- // UUID
- ID string `json:"id"`
- Date time.Time `json:"date" format:"date-time"`
- // The Lighthouse report.
- DesktopReport SpeedScheduleNewResponseTestDesktopReport `json:"desktopReport"`
- // The Lighthouse report.
- MobileReport SpeedScheduleNewResponseTestMobileReport `json:"mobileReport"`
- // A test region with a label.
- Region SpeedScheduleNewResponseTestRegion `json:"region"`
- // The frequency of the test.
- ScheduleFrequency SpeedScheduleNewResponseTestScheduleFrequency `json:"scheduleFrequency"`
- // A URL.
- URL string `json:"url"`
- JSON speedScheduleNewResponseTestJSON `json:"-"`
-}
-
-// speedScheduleNewResponseTestJSON contains the JSON metadata for the struct
-// [SpeedScheduleNewResponseTest]
-type speedScheduleNewResponseTestJSON struct {
- ID apijson.Field
- Date apijson.Field
- DesktopReport apijson.Field
- MobileReport apijson.Field
- Region apijson.Field
- ScheduleFrequency apijson.Field
- URL apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SpeedScheduleNewResponseTest) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r speedScheduleNewResponseTestJSON) RawJSON() string {
- return r.raw
-}
-
-// The Lighthouse report.
-type SpeedScheduleNewResponseTestDesktopReport struct {
- // Cumulative Layout Shift.
- Cls float64 `json:"cls"`
- // The type of device.
- DeviceType SpeedScheduleNewResponseTestDesktopReportDeviceType `json:"deviceType"`
- Error SpeedScheduleNewResponseTestDesktopReportError `json:"error"`
- // First Contentful Paint.
- Fcp float64 `json:"fcp"`
- // The URL to the full Lighthouse JSON report.
- JsonReportURL string `json:"jsonReportUrl"`
- // Largest Contentful Paint.
- Lcp float64 `json:"lcp"`
- // The Lighthouse performance score.
- PerformanceScore float64 `json:"performanceScore"`
- // Speed Index.
- Si float64 `json:"si"`
- // The state of the Lighthouse report.
- State SpeedScheduleNewResponseTestDesktopReportState `json:"state"`
- // Total Blocking Time.
- Tbt float64 `json:"tbt"`
- // Time To First Byte.
- Ttfb float64 `json:"ttfb"`
- // Time To Interactive.
- Tti float64 `json:"tti"`
- JSON speedScheduleNewResponseTestDesktopReportJSON `json:"-"`
-}
-
-// speedScheduleNewResponseTestDesktopReportJSON contains the JSON metadata for the
-// struct [SpeedScheduleNewResponseTestDesktopReport]
-type speedScheduleNewResponseTestDesktopReportJSON struct {
- Cls apijson.Field
- DeviceType apijson.Field
- Error apijson.Field
- Fcp apijson.Field
- JsonReportURL apijson.Field
- Lcp apijson.Field
- PerformanceScore apijson.Field
- Si apijson.Field
- State apijson.Field
- Tbt apijson.Field
- Ttfb apijson.Field
- Tti apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SpeedScheduleNewResponseTestDesktopReport) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r speedScheduleNewResponseTestDesktopReportJSON) RawJSON() string {
- return r.raw
-}
-
-// The type of device.
-type SpeedScheduleNewResponseTestDesktopReportDeviceType string
-
-const (
- SpeedScheduleNewResponseTestDesktopReportDeviceTypeDesktop SpeedScheduleNewResponseTestDesktopReportDeviceType = "DESKTOP"
- SpeedScheduleNewResponseTestDesktopReportDeviceTypeMobile SpeedScheduleNewResponseTestDesktopReportDeviceType = "MOBILE"
-)
-
-type SpeedScheduleNewResponseTestDesktopReportError struct {
- // The error code of the Lighthouse result.
- Code SpeedScheduleNewResponseTestDesktopReportErrorCode `json:"code"`
- // Detailed error message.
- Detail string `json:"detail"`
- // The final URL displayed to the user.
- FinalDisplayedURL string `json:"finalDisplayedUrl"`
- JSON speedScheduleNewResponseTestDesktopReportErrorJSON `json:"-"`
-}
-
-// speedScheduleNewResponseTestDesktopReportErrorJSON contains the JSON metadata
-// for the struct [SpeedScheduleNewResponseTestDesktopReportError]
-type speedScheduleNewResponseTestDesktopReportErrorJSON struct {
- Code apijson.Field
- Detail apijson.Field
- FinalDisplayedURL apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SpeedScheduleNewResponseTestDesktopReportError) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r speedScheduleNewResponseTestDesktopReportErrorJSON) RawJSON() string {
- return r.raw
-}
-
-// The error code of the Lighthouse result.
-type SpeedScheduleNewResponseTestDesktopReportErrorCode string
-
-const (
- SpeedScheduleNewResponseTestDesktopReportErrorCodeNotReachable SpeedScheduleNewResponseTestDesktopReportErrorCode = "NOT_REACHABLE"
- SpeedScheduleNewResponseTestDesktopReportErrorCodeDNSFailure SpeedScheduleNewResponseTestDesktopReportErrorCode = "DNS_FAILURE"
- SpeedScheduleNewResponseTestDesktopReportErrorCodeNotHTML SpeedScheduleNewResponseTestDesktopReportErrorCode = "NOT_HTML"
- SpeedScheduleNewResponseTestDesktopReportErrorCodeLighthouseTimeout SpeedScheduleNewResponseTestDesktopReportErrorCode = "LIGHTHOUSE_TIMEOUT"
- SpeedScheduleNewResponseTestDesktopReportErrorCodeUnknown SpeedScheduleNewResponseTestDesktopReportErrorCode = "UNKNOWN"
-)
-
-// The state of the Lighthouse report.
-type SpeedScheduleNewResponseTestDesktopReportState string
-
-const (
- SpeedScheduleNewResponseTestDesktopReportStateRunning SpeedScheduleNewResponseTestDesktopReportState = "RUNNING"
- SpeedScheduleNewResponseTestDesktopReportStateComplete SpeedScheduleNewResponseTestDesktopReportState = "COMPLETE"
- SpeedScheduleNewResponseTestDesktopReportStateFailed SpeedScheduleNewResponseTestDesktopReportState = "FAILED"
-)
-
-// The Lighthouse report.
-type SpeedScheduleNewResponseTestMobileReport struct {
- // Cumulative Layout Shift.
- Cls float64 `json:"cls"`
- // The type of device.
- DeviceType SpeedScheduleNewResponseTestMobileReportDeviceType `json:"deviceType"`
- Error SpeedScheduleNewResponseTestMobileReportError `json:"error"`
- // First Contentful Paint.
- Fcp float64 `json:"fcp"`
- // The URL to the full Lighthouse JSON report.
- JsonReportURL string `json:"jsonReportUrl"`
- // Largest Contentful Paint.
- Lcp float64 `json:"lcp"`
- // The Lighthouse performance score.
- PerformanceScore float64 `json:"performanceScore"`
- // Speed Index.
- Si float64 `json:"si"`
- // The state of the Lighthouse report.
- State SpeedScheduleNewResponseTestMobileReportState `json:"state"`
- // Total Blocking Time.
- Tbt float64 `json:"tbt"`
- // Time To First Byte.
- Ttfb float64 `json:"ttfb"`
- // Time To Interactive.
- Tti float64 `json:"tti"`
- JSON speedScheduleNewResponseTestMobileReportJSON `json:"-"`
-}
-
-// speedScheduleNewResponseTestMobileReportJSON contains the JSON metadata for the
-// struct [SpeedScheduleNewResponseTestMobileReport]
-type speedScheduleNewResponseTestMobileReportJSON struct {
- Cls apijson.Field
- DeviceType apijson.Field
- Error apijson.Field
- Fcp apijson.Field
- JsonReportURL apijson.Field
- Lcp apijson.Field
- PerformanceScore apijson.Field
- Si apijson.Field
- State apijson.Field
- Tbt apijson.Field
- Ttfb apijson.Field
- Tti apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SpeedScheduleNewResponseTestMobileReport) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r speedScheduleNewResponseTestMobileReportJSON) RawJSON() string {
- return r.raw
-}
-
-// The type of device.
-type SpeedScheduleNewResponseTestMobileReportDeviceType string
-
-const (
- SpeedScheduleNewResponseTestMobileReportDeviceTypeDesktop SpeedScheduleNewResponseTestMobileReportDeviceType = "DESKTOP"
- SpeedScheduleNewResponseTestMobileReportDeviceTypeMobile SpeedScheduleNewResponseTestMobileReportDeviceType = "MOBILE"
-)
-
-type SpeedScheduleNewResponseTestMobileReportError struct {
- // The error code of the Lighthouse result.
- Code SpeedScheduleNewResponseTestMobileReportErrorCode `json:"code"`
- // Detailed error message.
- Detail string `json:"detail"`
- // The final URL displayed to the user.
- FinalDisplayedURL string `json:"finalDisplayedUrl"`
- JSON speedScheduleNewResponseTestMobileReportErrorJSON `json:"-"`
-}
-
-// speedScheduleNewResponseTestMobileReportErrorJSON contains the JSON metadata for
-// the struct [SpeedScheduleNewResponseTestMobileReportError]
-type speedScheduleNewResponseTestMobileReportErrorJSON struct {
- Code apijson.Field
- Detail apijson.Field
- FinalDisplayedURL apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SpeedScheduleNewResponseTestMobileReportError) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r speedScheduleNewResponseTestMobileReportErrorJSON) RawJSON() string {
- return r.raw
-}
-
-// The error code of the Lighthouse result.
-type SpeedScheduleNewResponseTestMobileReportErrorCode string
-
-const (
- SpeedScheduleNewResponseTestMobileReportErrorCodeNotReachable SpeedScheduleNewResponseTestMobileReportErrorCode = "NOT_REACHABLE"
- SpeedScheduleNewResponseTestMobileReportErrorCodeDNSFailure SpeedScheduleNewResponseTestMobileReportErrorCode = "DNS_FAILURE"
- SpeedScheduleNewResponseTestMobileReportErrorCodeNotHTML SpeedScheduleNewResponseTestMobileReportErrorCode = "NOT_HTML"
- SpeedScheduleNewResponseTestMobileReportErrorCodeLighthouseTimeout SpeedScheduleNewResponseTestMobileReportErrorCode = "LIGHTHOUSE_TIMEOUT"
- SpeedScheduleNewResponseTestMobileReportErrorCodeUnknown SpeedScheduleNewResponseTestMobileReportErrorCode = "UNKNOWN"
-)
-
-// The state of the Lighthouse report.
-type SpeedScheduleNewResponseTestMobileReportState string
-
-const (
- SpeedScheduleNewResponseTestMobileReportStateRunning SpeedScheduleNewResponseTestMobileReportState = "RUNNING"
- SpeedScheduleNewResponseTestMobileReportStateComplete SpeedScheduleNewResponseTestMobileReportState = "COMPLETE"
- SpeedScheduleNewResponseTestMobileReportStateFailed SpeedScheduleNewResponseTestMobileReportState = "FAILED"
-)
-
-// A test region with a label.
-type SpeedScheduleNewResponseTestRegion struct {
- Label string `json:"label"`
- // A test region.
- Value SpeedScheduleNewResponseTestRegionValue `json:"value"`
- JSON speedScheduleNewResponseTestRegionJSON `json:"-"`
-}
-
-// speedScheduleNewResponseTestRegionJSON contains the JSON metadata for the struct
-// [SpeedScheduleNewResponseTestRegion]
-type speedScheduleNewResponseTestRegionJSON struct {
- Label apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SpeedScheduleNewResponseTestRegion) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r speedScheduleNewResponseTestRegionJSON) RawJSON() string {
- return r.raw
-}
-
-// A test region.
-type SpeedScheduleNewResponseTestRegionValue string
-
-const (
- SpeedScheduleNewResponseTestRegionValueAsiaEast1 SpeedScheduleNewResponseTestRegionValue = "asia-east1"
- SpeedScheduleNewResponseTestRegionValueAsiaNortheast1 SpeedScheduleNewResponseTestRegionValue = "asia-northeast1"
- SpeedScheduleNewResponseTestRegionValueAsiaNortheast2 SpeedScheduleNewResponseTestRegionValue = "asia-northeast2"
- SpeedScheduleNewResponseTestRegionValueAsiaSouth1 SpeedScheduleNewResponseTestRegionValue = "asia-south1"
- SpeedScheduleNewResponseTestRegionValueAsiaSoutheast1 SpeedScheduleNewResponseTestRegionValue = "asia-southeast1"
- SpeedScheduleNewResponseTestRegionValueAustraliaSoutheast1 SpeedScheduleNewResponseTestRegionValue = "australia-southeast1"
- SpeedScheduleNewResponseTestRegionValueEuropeNorth1 SpeedScheduleNewResponseTestRegionValue = "europe-north1"
- SpeedScheduleNewResponseTestRegionValueEuropeSouthwest1 SpeedScheduleNewResponseTestRegionValue = "europe-southwest1"
- SpeedScheduleNewResponseTestRegionValueEuropeWest1 SpeedScheduleNewResponseTestRegionValue = "europe-west1"
- SpeedScheduleNewResponseTestRegionValueEuropeWest2 SpeedScheduleNewResponseTestRegionValue = "europe-west2"
- SpeedScheduleNewResponseTestRegionValueEuropeWest3 SpeedScheduleNewResponseTestRegionValue = "europe-west3"
- SpeedScheduleNewResponseTestRegionValueEuropeWest4 SpeedScheduleNewResponseTestRegionValue = "europe-west4"
- SpeedScheduleNewResponseTestRegionValueEuropeWest8 SpeedScheduleNewResponseTestRegionValue = "europe-west8"
- SpeedScheduleNewResponseTestRegionValueEuropeWest9 SpeedScheduleNewResponseTestRegionValue = "europe-west9"
- SpeedScheduleNewResponseTestRegionValueMeWest1 SpeedScheduleNewResponseTestRegionValue = "me-west1"
- SpeedScheduleNewResponseTestRegionValueSouthamericaEast1 SpeedScheduleNewResponseTestRegionValue = "southamerica-east1"
- SpeedScheduleNewResponseTestRegionValueUsCentral1 SpeedScheduleNewResponseTestRegionValue = "us-central1"
- SpeedScheduleNewResponseTestRegionValueUsEast1 SpeedScheduleNewResponseTestRegionValue = "us-east1"
- SpeedScheduleNewResponseTestRegionValueUsEast4 SpeedScheduleNewResponseTestRegionValue = "us-east4"
- SpeedScheduleNewResponseTestRegionValueUsSouth1 SpeedScheduleNewResponseTestRegionValue = "us-south1"
- SpeedScheduleNewResponseTestRegionValueUsWest1 SpeedScheduleNewResponseTestRegionValue = "us-west1"
-)
-
-// The frequency of the test.
-type SpeedScheduleNewResponseTestScheduleFrequency string
-
-const (
- SpeedScheduleNewResponseTestScheduleFrequencyDaily SpeedScheduleNewResponseTestScheduleFrequency = "DAILY"
- SpeedScheduleNewResponseTestScheduleFrequencyWeekly SpeedScheduleNewResponseTestScheduleFrequency = "WEEKLY"
-)
-
-type SpeedScheduleNewParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
- // A test region.
- Region param.Field[SpeedScheduleNewParamsRegion] `query:"region"`
-}
-
-// URLQuery serializes [SpeedScheduleNewParams]'s query parameters as `url.Values`.
-func (r SpeedScheduleNewParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// A test region.
-type SpeedScheduleNewParamsRegion string
-
-const (
- SpeedScheduleNewParamsRegionAsiaEast1 SpeedScheduleNewParamsRegion = "asia-east1"
- SpeedScheduleNewParamsRegionAsiaNortheast1 SpeedScheduleNewParamsRegion = "asia-northeast1"
- SpeedScheduleNewParamsRegionAsiaNortheast2 SpeedScheduleNewParamsRegion = "asia-northeast2"
- SpeedScheduleNewParamsRegionAsiaSouth1 SpeedScheduleNewParamsRegion = "asia-south1"
- SpeedScheduleNewParamsRegionAsiaSoutheast1 SpeedScheduleNewParamsRegion = "asia-southeast1"
- SpeedScheduleNewParamsRegionAustraliaSoutheast1 SpeedScheduleNewParamsRegion = "australia-southeast1"
- SpeedScheduleNewParamsRegionEuropeNorth1 SpeedScheduleNewParamsRegion = "europe-north1"
- SpeedScheduleNewParamsRegionEuropeSouthwest1 SpeedScheduleNewParamsRegion = "europe-southwest1"
- SpeedScheduleNewParamsRegionEuropeWest1 SpeedScheduleNewParamsRegion = "europe-west1"
- SpeedScheduleNewParamsRegionEuropeWest2 SpeedScheduleNewParamsRegion = "europe-west2"
- SpeedScheduleNewParamsRegionEuropeWest3 SpeedScheduleNewParamsRegion = "europe-west3"
- SpeedScheduleNewParamsRegionEuropeWest4 SpeedScheduleNewParamsRegion = "europe-west4"
- SpeedScheduleNewParamsRegionEuropeWest8 SpeedScheduleNewParamsRegion = "europe-west8"
- SpeedScheduleNewParamsRegionEuropeWest9 SpeedScheduleNewParamsRegion = "europe-west9"
- SpeedScheduleNewParamsRegionMeWest1 SpeedScheduleNewParamsRegion = "me-west1"
- SpeedScheduleNewParamsRegionSouthamericaEast1 SpeedScheduleNewParamsRegion = "southamerica-east1"
- SpeedScheduleNewParamsRegionUsCentral1 SpeedScheduleNewParamsRegion = "us-central1"
- SpeedScheduleNewParamsRegionUsEast1 SpeedScheduleNewParamsRegion = "us-east1"
- SpeedScheduleNewParamsRegionUsEast4 SpeedScheduleNewParamsRegion = "us-east4"
- SpeedScheduleNewParamsRegionUsSouth1 SpeedScheduleNewParamsRegion = "us-south1"
- SpeedScheduleNewParamsRegionUsWest1 SpeedScheduleNewParamsRegion = "us-west1"
-)
-
-type SpeedScheduleNewResponseEnvelope struct {
- Result SpeedScheduleNewResponse `json:"result"`
- JSON speedScheduleNewResponseEnvelopeJSON `json:"-"`
-}
-
-// speedScheduleNewResponseEnvelopeJSON contains the JSON metadata for the struct
-// [SpeedScheduleNewResponseEnvelope]
-type speedScheduleNewResponseEnvelopeJSON struct {
- Result apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SpeedScheduleNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r speedScheduleNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
diff --git a/speedschedule_test.go b/speedschedule_test.go
deleted file mode 100644
index 3fb8955b6ec..00000000000
--- a/speedschedule_test.go
+++ /dev/null
@@ -1,45 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestSpeedScheduleNewWithOptionalParams(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"),
- )
- _, err := client.Speed.Schedule.New(
- context.TODO(),
- "example.com",
- cloudflare.SpeedScheduleNewParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Region: cloudflare.F(cloudflare.SpeedScheduleNewParamsRegionUsCentral1),
- },
- )
- 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/speedtest.go b/speedtest.go
deleted file mode 100644
index 7a9663b114f..00000000000
--- a/speedtest.go
+++ /dev/null
@@ -1,1039 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// SpeedTestService contains methods and other services that help with interacting
-// with the cloudflare API. Note, unlike clients, this service does not read
-// variables from the environment automatically. You should not instantiate this
-// service directly, and instead use the [NewSpeedTestService] method instead.
-type SpeedTestService struct {
- Options []option.RequestOption
-}
-
-// NewSpeedTestService generates a new service that applies the given options to
-// each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewSpeedTestService(opts ...option.RequestOption) (r *SpeedTestService) {
- r = &SpeedTestService{}
- r.Options = opts
- return
-}
-
-// Starts a test for a specific webpage, in a specific region.
-func (r *SpeedTestService) New(ctx context.Context, url string, params SpeedTestNewParams, opts ...option.RequestOption) (res *SpeedTestNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env SpeedTestNewResponseEnvelope
- path := fmt.Sprintf("zones/%s/speed_api/pages/%s/tests", params.ZoneID, url)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Test history (list of tests) for a specific webpage.
-func (r *SpeedTestService) List(ctx context.Context, url string, params SpeedTestListParams, opts ...option.RequestOption) (res *SpeedTestListResponse, err error) {
- opts = append(r.Options[:], opts...)
- path := fmt.Sprintf("zones/%s/speed_api/pages/%s/tests", params.ZoneID, url)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, params, &res, opts...)
- return
-}
-
-// Deletes all tests for a specific webpage from a specific region. Deleted tests
-// are still counted as part of the quota.
-func (r *SpeedTestService) Delete(ctx context.Context, url string, params SpeedTestDeleteParams, opts ...option.RequestOption) (res *SpeedTestDeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env SpeedTestDeleteResponseEnvelope
- path := fmt.Sprintf("zones/%s/speed_api/pages/%s/tests", params.ZoneID, url)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Retrieves the result of a specific test.
-func (r *SpeedTestService) Get(ctx context.Context, url string, testID string, query SpeedTestGetParams, opts ...option.RequestOption) (res *SpeedTestGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env SpeedTestGetResponseEnvelope
- path := fmt.Sprintf("zones/%s/speed_api/pages/%s/tests/%s", query.ZoneID, url, testID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type SpeedTestNewResponse struct {
- // UUID
- ID string `json:"id"`
- Date time.Time `json:"date" format:"date-time"`
- // The Lighthouse report.
- DesktopReport SpeedTestNewResponseDesktopReport `json:"desktopReport"`
- // The Lighthouse report.
- MobileReport SpeedTestNewResponseMobileReport `json:"mobileReport"`
- // A test region with a label.
- Region SpeedTestNewResponseRegion `json:"region"`
- // The frequency of the test.
- ScheduleFrequency SpeedTestNewResponseScheduleFrequency `json:"scheduleFrequency"`
- // A URL.
- URL string `json:"url"`
- JSON speedTestNewResponseJSON `json:"-"`
-}
-
-// speedTestNewResponseJSON contains the JSON metadata for the struct
-// [SpeedTestNewResponse]
-type speedTestNewResponseJSON struct {
- ID apijson.Field
- Date apijson.Field
- DesktopReport apijson.Field
- MobileReport apijson.Field
- Region apijson.Field
- ScheduleFrequency apijson.Field
- URL apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SpeedTestNewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r speedTestNewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// The Lighthouse report.
-type SpeedTestNewResponseDesktopReport struct {
- // Cumulative Layout Shift.
- Cls float64 `json:"cls"`
- // The type of device.
- DeviceType SpeedTestNewResponseDesktopReportDeviceType `json:"deviceType"`
- Error SpeedTestNewResponseDesktopReportError `json:"error"`
- // First Contentful Paint.
- Fcp float64 `json:"fcp"`
- // The URL to the full Lighthouse JSON report.
- JsonReportURL string `json:"jsonReportUrl"`
- // Largest Contentful Paint.
- Lcp float64 `json:"lcp"`
- // The Lighthouse performance score.
- PerformanceScore float64 `json:"performanceScore"`
- // Speed Index.
- Si float64 `json:"si"`
- // The state of the Lighthouse report.
- State SpeedTestNewResponseDesktopReportState `json:"state"`
- // Total Blocking Time.
- Tbt float64 `json:"tbt"`
- // Time To First Byte.
- Ttfb float64 `json:"ttfb"`
- // Time To Interactive.
- Tti float64 `json:"tti"`
- JSON speedTestNewResponseDesktopReportJSON `json:"-"`
-}
-
-// speedTestNewResponseDesktopReportJSON contains the JSON metadata for the struct
-// [SpeedTestNewResponseDesktopReport]
-type speedTestNewResponseDesktopReportJSON struct {
- Cls apijson.Field
- DeviceType apijson.Field
- Error apijson.Field
- Fcp apijson.Field
- JsonReportURL apijson.Field
- Lcp apijson.Field
- PerformanceScore apijson.Field
- Si apijson.Field
- State apijson.Field
- Tbt apijson.Field
- Ttfb apijson.Field
- Tti apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SpeedTestNewResponseDesktopReport) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r speedTestNewResponseDesktopReportJSON) RawJSON() string {
- return r.raw
-}
-
-// The type of device.
-type SpeedTestNewResponseDesktopReportDeviceType string
-
-const (
- SpeedTestNewResponseDesktopReportDeviceTypeDesktop SpeedTestNewResponseDesktopReportDeviceType = "DESKTOP"
- SpeedTestNewResponseDesktopReportDeviceTypeMobile SpeedTestNewResponseDesktopReportDeviceType = "MOBILE"
-)
-
-type SpeedTestNewResponseDesktopReportError struct {
- // The error code of the Lighthouse result.
- Code SpeedTestNewResponseDesktopReportErrorCode `json:"code"`
- // Detailed error message.
- Detail string `json:"detail"`
- // The final URL displayed to the user.
- FinalDisplayedURL string `json:"finalDisplayedUrl"`
- JSON speedTestNewResponseDesktopReportErrorJSON `json:"-"`
-}
-
-// speedTestNewResponseDesktopReportErrorJSON contains the JSON metadata for the
-// struct [SpeedTestNewResponseDesktopReportError]
-type speedTestNewResponseDesktopReportErrorJSON struct {
- Code apijson.Field
- Detail apijson.Field
- FinalDisplayedURL apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SpeedTestNewResponseDesktopReportError) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r speedTestNewResponseDesktopReportErrorJSON) RawJSON() string {
- return r.raw
-}
-
-// The error code of the Lighthouse result.
-type SpeedTestNewResponseDesktopReportErrorCode string
-
-const (
- SpeedTestNewResponseDesktopReportErrorCodeNotReachable SpeedTestNewResponseDesktopReportErrorCode = "NOT_REACHABLE"
- SpeedTestNewResponseDesktopReportErrorCodeDNSFailure SpeedTestNewResponseDesktopReportErrorCode = "DNS_FAILURE"
- SpeedTestNewResponseDesktopReportErrorCodeNotHTML SpeedTestNewResponseDesktopReportErrorCode = "NOT_HTML"
- SpeedTestNewResponseDesktopReportErrorCodeLighthouseTimeout SpeedTestNewResponseDesktopReportErrorCode = "LIGHTHOUSE_TIMEOUT"
- SpeedTestNewResponseDesktopReportErrorCodeUnknown SpeedTestNewResponseDesktopReportErrorCode = "UNKNOWN"
-)
-
-// The state of the Lighthouse report.
-type SpeedTestNewResponseDesktopReportState string
-
-const (
- SpeedTestNewResponseDesktopReportStateRunning SpeedTestNewResponseDesktopReportState = "RUNNING"
- SpeedTestNewResponseDesktopReportStateComplete SpeedTestNewResponseDesktopReportState = "COMPLETE"
- SpeedTestNewResponseDesktopReportStateFailed SpeedTestNewResponseDesktopReportState = "FAILED"
-)
-
-// The Lighthouse report.
-type SpeedTestNewResponseMobileReport struct {
- // Cumulative Layout Shift.
- Cls float64 `json:"cls"`
- // The type of device.
- DeviceType SpeedTestNewResponseMobileReportDeviceType `json:"deviceType"`
- Error SpeedTestNewResponseMobileReportError `json:"error"`
- // First Contentful Paint.
- Fcp float64 `json:"fcp"`
- // The URL to the full Lighthouse JSON report.
- JsonReportURL string `json:"jsonReportUrl"`
- // Largest Contentful Paint.
- Lcp float64 `json:"lcp"`
- // The Lighthouse performance score.
- PerformanceScore float64 `json:"performanceScore"`
- // Speed Index.
- Si float64 `json:"si"`
- // The state of the Lighthouse report.
- State SpeedTestNewResponseMobileReportState `json:"state"`
- // Total Blocking Time.
- Tbt float64 `json:"tbt"`
- // Time To First Byte.
- Ttfb float64 `json:"ttfb"`
- // Time To Interactive.
- Tti float64 `json:"tti"`
- JSON speedTestNewResponseMobileReportJSON `json:"-"`
-}
-
-// speedTestNewResponseMobileReportJSON contains the JSON metadata for the struct
-// [SpeedTestNewResponseMobileReport]
-type speedTestNewResponseMobileReportJSON struct {
- Cls apijson.Field
- DeviceType apijson.Field
- Error apijson.Field
- Fcp apijson.Field
- JsonReportURL apijson.Field
- Lcp apijson.Field
- PerformanceScore apijson.Field
- Si apijson.Field
- State apijson.Field
- Tbt apijson.Field
- Ttfb apijson.Field
- Tti apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SpeedTestNewResponseMobileReport) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r speedTestNewResponseMobileReportJSON) RawJSON() string {
- return r.raw
-}
-
-// The type of device.
-type SpeedTestNewResponseMobileReportDeviceType string
-
-const (
- SpeedTestNewResponseMobileReportDeviceTypeDesktop SpeedTestNewResponseMobileReportDeviceType = "DESKTOP"
- SpeedTestNewResponseMobileReportDeviceTypeMobile SpeedTestNewResponseMobileReportDeviceType = "MOBILE"
-)
-
-type SpeedTestNewResponseMobileReportError struct {
- // The error code of the Lighthouse result.
- Code SpeedTestNewResponseMobileReportErrorCode `json:"code"`
- // Detailed error message.
- Detail string `json:"detail"`
- // The final URL displayed to the user.
- FinalDisplayedURL string `json:"finalDisplayedUrl"`
- JSON speedTestNewResponseMobileReportErrorJSON `json:"-"`
-}
-
-// speedTestNewResponseMobileReportErrorJSON contains the JSON metadata for the
-// struct [SpeedTestNewResponseMobileReportError]
-type speedTestNewResponseMobileReportErrorJSON struct {
- Code apijson.Field
- Detail apijson.Field
- FinalDisplayedURL apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SpeedTestNewResponseMobileReportError) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r speedTestNewResponseMobileReportErrorJSON) RawJSON() string {
- return r.raw
-}
-
-// The error code of the Lighthouse result.
-type SpeedTestNewResponseMobileReportErrorCode string
-
-const (
- SpeedTestNewResponseMobileReportErrorCodeNotReachable SpeedTestNewResponseMobileReportErrorCode = "NOT_REACHABLE"
- SpeedTestNewResponseMobileReportErrorCodeDNSFailure SpeedTestNewResponseMobileReportErrorCode = "DNS_FAILURE"
- SpeedTestNewResponseMobileReportErrorCodeNotHTML SpeedTestNewResponseMobileReportErrorCode = "NOT_HTML"
- SpeedTestNewResponseMobileReportErrorCodeLighthouseTimeout SpeedTestNewResponseMobileReportErrorCode = "LIGHTHOUSE_TIMEOUT"
- SpeedTestNewResponseMobileReportErrorCodeUnknown SpeedTestNewResponseMobileReportErrorCode = "UNKNOWN"
-)
-
-// The state of the Lighthouse report.
-type SpeedTestNewResponseMobileReportState string
-
-const (
- SpeedTestNewResponseMobileReportStateRunning SpeedTestNewResponseMobileReportState = "RUNNING"
- SpeedTestNewResponseMobileReportStateComplete SpeedTestNewResponseMobileReportState = "COMPLETE"
- SpeedTestNewResponseMobileReportStateFailed SpeedTestNewResponseMobileReportState = "FAILED"
-)
-
-// A test region with a label.
-type SpeedTestNewResponseRegion struct {
- Label string `json:"label"`
- // A test region.
- Value SpeedTestNewResponseRegionValue `json:"value"`
- JSON speedTestNewResponseRegionJSON `json:"-"`
-}
-
-// speedTestNewResponseRegionJSON contains the JSON metadata for the struct
-// [SpeedTestNewResponseRegion]
-type speedTestNewResponseRegionJSON struct {
- Label apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SpeedTestNewResponseRegion) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r speedTestNewResponseRegionJSON) RawJSON() string {
- return r.raw
-}
-
-// A test region.
-type SpeedTestNewResponseRegionValue string
-
-const (
- SpeedTestNewResponseRegionValueAsiaEast1 SpeedTestNewResponseRegionValue = "asia-east1"
- SpeedTestNewResponseRegionValueAsiaNortheast1 SpeedTestNewResponseRegionValue = "asia-northeast1"
- SpeedTestNewResponseRegionValueAsiaNortheast2 SpeedTestNewResponseRegionValue = "asia-northeast2"
- SpeedTestNewResponseRegionValueAsiaSouth1 SpeedTestNewResponseRegionValue = "asia-south1"
- SpeedTestNewResponseRegionValueAsiaSoutheast1 SpeedTestNewResponseRegionValue = "asia-southeast1"
- SpeedTestNewResponseRegionValueAustraliaSoutheast1 SpeedTestNewResponseRegionValue = "australia-southeast1"
- SpeedTestNewResponseRegionValueEuropeNorth1 SpeedTestNewResponseRegionValue = "europe-north1"
- SpeedTestNewResponseRegionValueEuropeSouthwest1 SpeedTestNewResponseRegionValue = "europe-southwest1"
- SpeedTestNewResponseRegionValueEuropeWest1 SpeedTestNewResponseRegionValue = "europe-west1"
- SpeedTestNewResponseRegionValueEuropeWest2 SpeedTestNewResponseRegionValue = "europe-west2"
- SpeedTestNewResponseRegionValueEuropeWest3 SpeedTestNewResponseRegionValue = "europe-west3"
- SpeedTestNewResponseRegionValueEuropeWest4 SpeedTestNewResponseRegionValue = "europe-west4"
- SpeedTestNewResponseRegionValueEuropeWest8 SpeedTestNewResponseRegionValue = "europe-west8"
- SpeedTestNewResponseRegionValueEuropeWest9 SpeedTestNewResponseRegionValue = "europe-west9"
- SpeedTestNewResponseRegionValueMeWest1 SpeedTestNewResponseRegionValue = "me-west1"
- SpeedTestNewResponseRegionValueSouthamericaEast1 SpeedTestNewResponseRegionValue = "southamerica-east1"
- SpeedTestNewResponseRegionValueUsCentral1 SpeedTestNewResponseRegionValue = "us-central1"
- SpeedTestNewResponseRegionValueUsEast1 SpeedTestNewResponseRegionValue = "us-east1"
- SpeedTestNewResponseRegionValueUsEast4 SpeedTestNewResponseRegionValue = "us-east4"
- SpeedTestNewResponseRegionValueUsSouth1 SpeedTestNewResponseRegionValue = "us-south1"
- SpeedTestNewResponseRegionValueUsWest1 SpeedTestNewResponseRegionValue = "us-west1"
-)
-
-// The frequency of the test.
-type SpeedTestNewResponseScheduleFrequency string
-
-const (
- SpeedTestNewResponseScheduleFrequencyDaily SpeedTestNewResponseScheduleFrequency = "DAILY"
- SpeedTestNewResponseScheduleFrequencyWeekly SpeedTestNewResponseScheduleFrequency = "WEEKLY"
-)
-
-type SpeedTestListResponse struct {
- Errors []SpeedTestListResponseError `json:"errors,required"`
- Messages []SpeedTestListResponseMessage `json:"messages,required"`
- // Whether the API call was successful.
- Success bool `json:"success,required"`
- ResultInfo SpeedTestListResponseResultInfo `json:"result_info"`
- JSON speedTestListResponseJSON `json:"-"`
-}
-
-// speedTestListResponseJSON contains the JSON metadata for the struct
-// [SpeedTestListResponse]
-type speedTestListResponseJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Success apijson.Field
- ResultInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SpeedTestListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r speedTestListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type SpeedTestListResponseError struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON speedTestListResponseErrorJSON `json:"-"`
-}
-
-// speedTestListResponseErrorJSON contains the JSON metadata for the struct
-// [SpeedTestListResponseError]
-type speedTestListResponseErrorJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SpeedTestListResponseError) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r speedTestListResponseErrorJSON) RawJSON() string {
- return r.raw
-}
-
-type SpeedTestListResponseMessage struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON speedTestListResponseMessageJSON `json:"-"`
-}
-
-// speedTestListResponseMessageJSON contains the JSON metadata for the struct
-// [SpeedTestListResponseMessage]
-type speedTestListResponseMessageJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SpeedTestListResponseMessage) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r speedTestListResponseMessageJSON) RawJSON() string {
- return r.raw
-}
-
-type SpeedTestListResponseResultInfo struct {
- Count int64 `json:"count"`
- Page int64 `json:"page"`
- PerPage int64 `json:"per_page"`
- TotalCount int64 `json:"total_count"`
- JSON speedTestListResponseResultInfoJSON `json:"-"`
-}
-
-// speedTestListResponseResultInfoJSON contains the JSON metadata for the struct
-// [SpeedTestListResponseResultInfo]
-type speedTestListResponseResultInfoJSON struct {
- Count apijson.Field
- Page apijson.Field
- PerPage apijson.Field
- TotalCount apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SpeedTestListResponseResultInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r speedTestListResponseResultInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type SpeedTestDeleteResponse struct {
- // Number of items affected.
- Count float64 `json:"count"`
- JSON speedTestDeleteResponseJSON `json:"-"`
-}
-
-// speedTestDeleteResponseJSON contains the JSON metadata for the struct
-// [SpeedTestDeleteResponse]
-type speedTestDeleteResponseJSON struct {
- Count apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SpeedTestDeleteResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r speedTestDeleteResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type SpeedTestGetResponse struct {
- // UUID
- ID string `json:"id"`
- Date time.Time `json:"date" format:"date-time"`
- // The Lighthouse report.
- DesktopReport SpeedTestGetResponseDesktopReport `json:"desktopReport"`
- // The Lighthouse report.
- MobileReport SpeedTestGetResponseMobileReport `json:"mobileReport"`
- // A test region with a label.
- Region SpeedTestGetResponseRegion `json:"region"`
- // The frequency of the test.
- ScheduleFrequency SpeedTestGetResponseScheduleFrequency `json:"scheduleFrequency"`
- // A URL.
- URL string `json:"url"`
- JSON speedTestGetResponseJSON `json:"-"`
-}
-
-// speedTestGetResponseJSON contains the JSON metadata for the struct
-// [SpeedTestGetResponse]
-type speedTestGetResponseJSON struct {
- ID apijson.Field
- Date apijson.Field
- DesktopReport apijson.Field
- MobileReport apijson.Field
- Region apijson.Field
- ScheduleFrequency apijson.Field
- URL apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SpeedTestGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r speedTestGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// The Lighthouse report.
-type SpeedTestGetResponseDesktopReport struct {
- // Cumulative Layout Shift.
- Cls float64 `json:"cls"`
- // The type of device.
- DeviceType SpeedTestGetResponseDesktopReportDeviceType `json:"deviceType"`
- Error SpeedTestGetResponseDesktopReportError `json:"error"`
- // First Contentful Paint.
- Fcp float64 `json:"fcp"`
- // The URL to the full Lighthouse JSON report.
- JsonReportURL string `json:"jsonReportUrl"`
- // Largest Contentful Paint.
- Lcp float64 `json:"lcp"`
- // The Lighthouse performance score.
- PerformanceScore float64 `json:"performanceScore"`
- // Speed Index.
- Si float64 `json:"si"`
- // The state of the Lighthouse report.
- State SpeedTestGetResponseDesktopReportState `json:"state"`
- // Total Blocking Time.
- Tbt float64 `json:"tbt"`
- // Time To First Byte.
- Ttfb float64 `json:"ttfb"`
- // Time To Interactive.
- Tti float64 `json:"tti"`
- JSON speedTestGetResponseDesktopReportJSON `json:"-"`
-}
-
-// speedTestGetResponseDesktopReportJSON contains the JSON metadata for the struct
-// [SpeedTestGetResponseDesktopReport]
-type speedTestGetResponseDesktopReportJSON struct {
- Cls apijson.Field
- DeviceType apijson.Field
- Error apijson.Field
- Fcp apijson.Field
- JsonReportURL apijson.Field
- Lcp apijson.Field
- PerformanceScore apijson.Field
- Si apijson.Field
- State apijson.Field
- Tbt apijson.Field
- Ttfb apijson.Field
- Tti apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SpeedTestGetResponseDesktopReport) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r speedTestGetResponseDesktopReportJSON) RawJSON() string {
- return r.raw
-}
-
-// The type of device.
-type SpeedTestGetResponseDesktopReportDeviceType string
-
-const (
- SpeedTestGetResponseDesktopReportDeviceTypeDesktop SpeedTestGetResponseDesktopReportDeviceType = "DESKTOP"
- SpeedTestGetResponseDesktopReportDeviceTypeMobile SpeedTestGetResponseDesktopReportDeviceType = "MOBILE"
-)
-
-type SpeedTestGetResponseDesktopReportError struct {
- // The error code of the Lighthouse result.
- Code SpeedTestGetResponseDesktopReportErrorCode `json:"code"`
- // Detailed error message.
- Detail string `json:"detail"`
- // The final URL displayed to the user.
- FinalDisplayedURL string `json:"finalDisplayedUrl"`
- JSON speedTestGetResponseDesktopReportErrorJSON `json:"-"`
-}
-
-// speedTestGetResponseDesktopReportErrorJSON contains the JSON metadata for the
-// struct [SpeedTestGetResponseDesktopReportError]
-type speedTestGetResponseDesktopReportErrorJSON struct {
- Code apijson.Field
- Detail apijson.Field
- FinalDisplayedURL apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SpeedTestGetResponseDesktopReportError) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r speedTestGetResponseDesktopReportErrorJSON) RawJSON() string {
- return r.raw
-}
-
-// The error code of the Lighthouse result.
-type SpeedTestGetResponseDesktopReportErrorCode string
-
-const (
- SpeedTestGetResponseDesktopReportErrorCodeNotReachable SpeedTestGetResponseDesktopReportErrorCode = "NOT_REACHABLE"
- SpeedTestGetResponseDesktopReportErrorCodeDNSFailure SpeedTestGetResponseDesktopReportErrorCode = "DNS_FAILURE"
- SpeedTestGetResponseDesktopReportErrorCodeNotHTML SpeedTestGetResponseDesktopReportErrorCode = "NOT_HTML"
- SpeedTestGetResponseDesktopReportErrorCodeLighthouseTimeout SpeedTestGetResponseDesktopReportErrorCode = "LIGHTHOUSE_TIMEOUT"
- SpeedTestGetResponseDesktopReportErrorCodeUnknown SpeedTestGetResponseDesktopReportErrorCode = "UNKNOWN"
-)
-
-// The state of the Lighthouse report.
-type SpeedTestGetResponseDesktopReportState string
-
-const (
- SpeedTestGetResponseDesktopReportStateRunning SpeedTestGetResponseDesktopReportState = "RUNNING"
- SpeedTestGetResponseDesktopReportStateComplete SpeedTestGetResponseDesktopReportState = "COMPLETE"
- SpeedTestGetResponseDesktopReportStateFailed SpeedTestGetResponseDesktopReportState = "FAILED"
-)
-
-// The Lighthouse report.
-type SpeedTestGetResponseMobileReport struct {
- // Cumulative Layout Shift.
- Cls float64 `json:"cls"`
- // The type of device.
- DeviceType SpeedTestGetResponseMobileReportDeviceType `json:"deviceType"`
- Error SpeedTestGetResponseMobileReportError `json:"error"`
- // First Contentful Paint.
- Fcp float64 `json:"fcp"`
- // The URL to the full Lighthouse JSON report.
- JsonReportURL string `json:"jsonReportUrl"`
- // Largest Contentful Paint.
- Lcp float64 `json:"lcp"`
- // The Lighthouse performance score.
- PerformanceScore float64 `json:"performanceScore"`
- // Speed Index.
- Si float64 `json:"si"`
- // The state of the Lighthouse report.
- State SpeedTestGetResponseMobileReportState `json:"state"`
- // Total Blocking Time.
- Tbt float64 `json:"tbt"`
- // Time To First Byte.
- Ttfb float64 `json:"ttfb"`
- // Time To Interactive.
- Tti float64 `json:"tti"`
- JSON speedTestGetResponseMobileReportJSON `json:"-"`
-}
-
-// speedTestGetResponseMobileReportJSON contains the JSON metadata for the struct
-// [SpeedTestGetResponseMobileReport]
-type speedTestGetResponseMobileReportJSON struct {
- Cls apijson.Field
- DeviceType apijson.Field
- Error apijson.Field
- Fcp apijson.Field
- JsonReportURL apijson.Field
- Lcp apijson.Field
- PerformanceScore apijson.Field
- Si apijson.Field
- State apijson.Field
- Tbt apijson.Field
- Ttfb apijson.Field
- Tti apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SpeedTestGetResponseMobileReport) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r speedTestGetResponseMobileReportJSON) RawJSON() string {
- return r.raw
-}
-
-// The type of device.
-type SpeedTestGetResponseMobileReportDeviceType string
-
-const (
- SpeedTestGetResponseMobileReportDeviceTypeDesktop SpeedTestGetResponseMobileReportDeviceType = "DESKTOP"
- SpeedTestGetResponseMobileReportDeviceTypeMobile SpeedTestGetResponseMobileReportDeviceType = "MOBILE"
-)
-
-type SpeedTestGetResponseMobileReportError struct {
- // The error code of the Lighthouse result.
- Code SpeedTestGetResponseMobileReportErrorCode `json:"code"`
- // Detailed error message.
- Detail string `json:"detail"`
- // The final URL displayed to the user.
- FinalDisplayedURL string `json:"finalDisplayedUrl"`
- JSON speedTestGetResponseMobileReportErrorJSON `json:"-"`
-}
-
-// speedTestGetResponseMobileReportErrorJSON contains the JSON metadata for the
-// struct [SpeedTestGetResponseMobileReportError]
-type speedTestGetResponseMobileReportErrorJSON struct {
- Code apijson.Field
- Detail apijson.Field
- FinalDisplayedURL apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SpeedTestGetResponseMobileReportError) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r speedTestGetResponseMobileReportErrorJSON) RawJSON() string {
- return r.raw
-}
-
-// The error code of the Lighthouse result.
-type SpeedTestGetResponseMobileReportErrorCode string
-
-const (
- SpeedTestGetResponseMobileReportErrorCodeNotReachable SpeedTestGetResponseMobileReportErrorCode = "NOT_REACHABLE"
- SpeedTestGetResponseMobileReportErrorCodeDNSFailure SpeedTestGetResponseMobileReportErrorCode = "DNS_FAILURE"
- SpeedTestGetResponseMobileReportErrorCodeNotHTML SpeedTestGetResponseMobileReportErrorCode = "NOT_HTML"
- SpeedTestGetResponseMobileReportErrorCodeLighthouseTimeout SpeedTestGetResponseMobileReportErrorCode = "LIGHTHOUSE_TIMEOUT"
- SpeedTestGetResponseMobileReportErrorCodeUnknown SpeedTestGetResponseMobileReportErrorCode = "UNKNOWN"
-)
-
-// The state of the Lighthouse report.
-type SpeedTestGetResponseMobileReportState string
-
-const (
- SpeedTestGetResponseMobileReportStateRunning SpeedTestGetResponseMobileReportState = "RUNNING"
- SpeedTestGetResponseMobileReportStateComplete SpeedTestGetResponseMobileReportState = "COMPLETE"
- SpeedTestGetResponseMobileReportStateFailed SpeedTestGetResponseMobileReportState = "FAILED"
-)
-
-// A test region with a label.
-type SpeedTestGetResponseRegion struct {
- Label string `json:"label"`
- // A test region.
- Value SpeedTestGetResponseRegionValue `json:"value"`
- JSON speedTestGetResponseRegionJSON `json:"-"`
-}
-
-// speedTestGetResponseRegionJSON contains the JSON metadata for the struct
-// [SpeedTestGetResponseRegion]
-type speedTestGetResponseRegionJSON struct {
- Label apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SpeedTestGetResponseRegion) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r speedTestGetResponseRegionJSON) RawJSON() string {
- return r.raw
-}
-
-// A test region.
-type SpeedTestGetResponseRegionValue string
-
-const (
- SpeedTestGetResponseRegionValueAsiaEast1 SpeedTestGetResponseRegionValue = "asia-east1"
- SpeedTestGetResponseRegionValueAsiaNortheast1 SpeedTestGetResponseRegionValue = "asia-northeast1"
- SpeedTestGetResponseRegionValueAsiaNortheast2 SpeedTestGetResponseRegionValue = "asia-northeast2"
- SpeedTestGetResponseRegionValueAsiaSouth1 SpeedTestGetResponseRegionValue = "asia-south1"
- SpeedTestGetResponseRegionValueAsiaSoutheast1 SpeedTestGetResponseRegionValue = "asia-southeast1"
- SpeedTestGetResponseRegionValueAustraliaSoutheast1 SpeedTestGetResponseRegionValue = "australia-southeast1"
- SpeedTestGetResponseRegionValueEuropeNorth1 SpeedTestGetResponseRegionValue = "europe-north1"
- SpeedTestGetResponseRegionValueEuropeSouthwest1 SpeedTestGetResponseRegionValue = "europe-southwest1"
- SpeedTestGetResponseRegionValueEuropeWest1 SpeedTestGetResponseRegionValue = "europe-west1"
- SpeedTestGetResponseRegionValueEuropeWest2 SpeedTestGetResponseRegionValue = "europe-west2"
- SpeedTestGetResponseRegionValueEuropeWest3 SpeedTestGetResponseRegionValue = "europe-west3"
- SpeedTestGetResponseRegionValueEuropeWest4 SpeedTestGetResponseRegionValue = "europe-west4"
- SpeedTestGetResponseRegionValueEuropeWest8 SpeedTestGetResponseRegionValue = "europe-west8"
- SpeedTestGetResponseRegionValueEuropeWest9 SpeedTestGetResponseRegionValue = "europe-west9"
- SpeedTestGetResponseRegionValueMeWest1 SpeedTestGetResponseRegionValue = "me-west1"
- SpeedTestGetResponseRegionValueSouthamericaEast1 SpeedTestGetResponseRegionValue = "southamerica-east1"
- SpeedTestGetResponseRegionValueUsCentral1 SpeedTestGetResponseRegionValue = "us-central1"
- SpeedTestGetResponseRegionValueUsEast1 SpeedTestGetResponseRegionValue = "us-east1"
- SpeedTestGetResponseRegionValueUsEast4 SpeedTestGetResponseRegionValue = "us-east4"
- SpeedTestGetResponseRegionValueUsSouth1 SpeedTestGetResponseRegionValue = "us-south1"
- SpeedTestGetResponseRegionValueUsWest1 SpeedTestGetResponseRegionValue = "us-west1"
-)
-
-// The frequency of the test.
-type SpeedTestGetResponseScheduleFrequency string
-
-const (
- SpeedTestGetResponseScheduleFrequencyDaily SpeedTestGetResponseScheduleFrequency = "DAILY"
- SpeedTestGetResponseScheduleFrequencyWeekly SpeedTestGetResponseScheduleFrequency = "WEEKLY"
-)
-
-type SpeedTestNewParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
- // A test region.
- Region param.Field[SpeedTestNewParamsRegion] `json:"region"`
-}
-
-func (r SpeedTestNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// A test region.
-type SpeedTestNewParamsRegion string
-
-const (
- SpeedTestNewParamsRegionAsiaEast1 SpeedTestNewParamsRegion = "asia-east1"
- SpeedTestNewParamsRegionAsiaNortheast1 SpeedTestNewParamsRegion = "asia-northeast1"
- SpeedTestNewParamsRegionAsiaNortheast2 SpeedTestNewParamsRegion = "asia-northeast2"
- SpeedTestNewParamsRegionAsiaSouth1 SpeedTestNewParamsRegion = "asia-south1"
- SpeedTestNewParamsRegionAsiaSoutheast1 SpeedTestNewParamsRegion = "asia-southeast1"
- SpeedTestNewParamsRegionAustraliaSoutheast1 SpeedTestNewParamsRegion = "australia-southeast1"
- SpeedTestNewParamsRegionEuropeNorth1 SpeedTestNewParamsRegion = "europe-north1"
- SpeedTestNewParamsRegionEuropeSouthwest1 SpeedTestNewParamsRegion = "europe-southwest1"
- SpeedTestNewParamsRegionEuropeWest1 SpeedTestNewParamsRegion = "europe-west1"
- SpeedTestNewParamsRegionEuropeWest2 SpeedTestNewParamsRegion = "europe-west2"
- SpeedTestNewParamsRegionEuropeWest3 SpeedTestNewParamsRegion = "europe-west3"
- SpeedTestNewParamsRegionEuropeWest4 SpeedTestNewParamsRegion = "europe-west4"
- SpeedTestNewParamsRegionEuropeWest8 SpeedTestNewParamsRegion = "europe-west8"
- SpeedTestNewParamsRegionEuropeWest9 SpeedTestNewParamsRegion = "europe-west9"
- SpeedTestNewParamsRegionMeWest1 SpeedTestNewParamsRegion = "me-west1"
- SpeedTestNewParamsRegionSouthamericaEast1 SpeedTestNewParamsRegion = "southamerica-east1"
- SpeedTestNewParamsRegionUsCentral1 SpeedTestNewParamsRegion = "us-central1"
- SpeedTestNewParamsRegionUsEast1 SpeedTestNewParamsRegion = "us-east1"
- SpeedTestNewParamsRegionUsEast4 SpeedTestNewParamsRegion = "us-east4"
- SpeedTestNewParamsRegionUsSouth1 SpeedTestNewParamsRegion = "us-south1"
- SpeedTestNewParamsRegionUsWest1 SpeedTestNewParamsRegion = "us-west1"
-)
-
-type SpeedTestNewResponseEnvelope struct {
- Result SpeedTestNewResponse `json:"result"`
- JSON speedTestNewResponseEnvelopeJSON `json:"-"`
-}
-
-// speedTestNewResponseEnvelopeJSON contains the JSON metadata for the struct
-// [SpeedTestNewResponseEnvelope]
-type speedTestNewResponseEnvelopeJSON struct {
- Result apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SpeedTestNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r speedTestNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type SpeedTestListParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
- Page param.Field[int64] `query:"page"`
- PerPage param.Field[int64] `query:"per_page"`
- // A test region.
- Region param.Field[SpeedTestListParamsRegion] `query:"region"`
-}
-
-// URLQuery serializes [SpeedTestListParams]'s query parameters as `url.Values`.
-func (r SpeedTestListParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// A test region.
-type SpeedTestListParamsRegion string
-
-const (
- SpeedTestListParamsRegionAsiaEast1 SpeedTestListParamsRegion = "asia-east1"
- SpeedTestListParamsRegionAsiaNortheast1 SpeedTestListParamsRegion = "asia-northeast1"
- SpeedTestListParamsRegionAsiaNortheast2 SpeedTestListParamsRegion = "asia-northeast2"
- SpeedTestListParamsRegionAsiaSouth1 SpeedTestListParamsRegion = "asia-south1"
- SpeedTestListParamsRegionAsiaSoutheast1 SpeedTestListParamsRegion = "asia-southeast1"
- SpeedTestListParamsRegionAustraliaSoutheast1 SpeedTestListParamsRegion = "australia-southeast1"
- SpeedTestListParamsRegionEuropeNorth1 SpeedTestListParamsRegion = "europe-north1"
- SpeedTestListParamsRegionEuropeSouthwest1 SpeedTestListParamsRegion = "europe-southwest1"
- SpeedTestListParamsRegionEuropeWest1 SpeedTestListParamsRegion = "europe-west1"
- SpeedTestListParamsRegionEuropeWest2 SpeedTestListParamsRegion = "europe-west2"
- SpeedTestListParamsRegionEuropeWest3 SpeedTestListParamsRegion = "europe-west3"
- SpeedTestListParamsRegionEuropeWest4 SpeedTestListParamsRegion = "europe-west4"
- SpeedTestListParamsRegionEuropeWest8 SpeedTestListParamsRegion = "europe-west8"
- SpeedTestListParamsRegionEuropeWest9 SpeedTestListParamsRegion = "europe-west9"
- SpeedTestListParamsRegionMeWest1 SpeedTestListParamsRegion = "me-west1"
- SpeedTestListParamsRegionSouthamericaEast1 SpeedTestListParamsRegion = "southamerica-east1"
- SpeedTestListParamsRegionUsCentral1 SpeedTestListParamsRegion = "us-central1"
- SpeedTestListParamsRegionUsEast1 SpeedTestListParamsRegion = "us-east1"
- SpeedTestListParamsRegionUsEast4 SpeedTestListParamsRegion = "us-east4"
- SpeedTestListParamsRegionUsSouth1 SpeedTestListParamsRegion = "us-south1"
- SpeedTestListParamsRegionUsWest1 SpeedTestListParamsRegion = "us-west1"
-)
-
-type SpeedTestDeleteParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
- // A test region.
- Region param.Field[SpeedTestDeleteParamsRegion] `query:"region"`
-}
-
-// URLQuery serializes [SpeedTestDeleteParams]'s query parameters as `url.Values`.
-func (r SpeedTestDeleteParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// A test region.
-type SpeedTestDeleteParamsRegion string
-
-const (
- SpeedTestDeleteParamsRegionAsiaEast1 SpeedTestDeleteParamsRegion = "asia-east1"
- SpeedTestDeleteParamsRegionAsiaNortheast1 SpeedTestDeleteParamsRegion = "asia-northeast1"
- SpeedTestDeleteParamsRegionAsiaNortheast2 SpeedTestDeleteParamsRegion = "asia-northeast2"
- SpeedTestDeleteParamsRegionAsiaSouth1 SpeedTestDeleteParamsRegion = "asia-south1"
- SpeedTestDeleteParamsRegionAsiaSoutheast1 SpeedTestDeleteParamsRegion = "asia-southeast1"
- SpeedTestDeleteParamsRegionAustraliaSoutheast1 SpeedTestDeleteParamsRegion = "australia-southeast1"
- SpeedTestDeleteParamsRegionEuropeNorth1 SpeedTestDeleteParamsRegion = "europe-north1"
- SpeedTestDeleteParamsRegionEuropeSouthwest1 SpeedTestDeleteParamsRegion = "europe-southwest1"
- SpeedTestDeleteParamsRegionEuropeWest1 SpeedTestDeleteParamsRegion = "europe-west1"
- SpeedTestDeleteParamsRegionEuropeWest2 SpeedTestDeleteParamsRegion = "europe-west2"
- SpeedTestDeleteParamsRegionEuropeWest3 SpeedTestDeleteParamsRegion = "europe-west3"
- SpeedTestDeleteParamsRegionEuropeWest4 SpeedTestDeleteParamsRegion = "europe-west4"
- SpeedTestDeleteParamsRegionEuropeWest8 SpeedTestDeleteParamsRegion = "europe-west8"
- SpeedTestDeleteParamsRegionEuropeWest9 SpeedTestDeleteParamsRegion = "europe-west9"
- SpeedTestDeleteParamsRegionMeWest1 SpeedTestDeleteParamsRegion = "me-west1"
- SpeedTestDeleteParamsRegionSouthamericaEast1 SpeedTestDeleteParamsRegion = "southamerica-east1"
- SpeedTestDeleteParamsRegionUsCentral1 SpeedTestDeleteParamsRegion = "us-central1"
- SpeedTestDeleteParamsRegionUsEast1 SpeedTestDeleteParamsRegion = "us-east1"
- SpeedTestDeleteParamsRegionUsEast4 SpeedTestDeleteParamsRegion = "us-east4"
- SpeedTestDeleteParamsRegionUsSouth1 SpeedTestDeleteParamsRegion = "us-south1"
- SpeedTestDeleteParamsRegionUsWest1 SpeedTestDeleteParamsRegion = "us-west1"
-)
-
-type SpeedTestDeleteResponseEnvelope struct {
- Result SpeedTestDeleteResponse `json:"result"`
- JSON speedTestDeleteResponseEnvelopeJSON `json:"-"`
-}
-
-// speedTestDeleteResponseEnvelopeJSON contains the JSON metadata for the struct
-// [SpeedTestDeleteResponseEnvelope]
-type speedTestDeleteResponseEnvelopeJSON struct {
- Result apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SpeedTestDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r speedTestDeleteResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type SpeedTestGetParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
-}
-
-type SpeedTestGetResponseEnvelope struct {
- Result SpeedTestGetResponse `json:"result"`
- JSON speedTestGetResponseEnvelopeJSON `json:"-"`
-}
-
-// speedTestGetResponseEnvelopeJSON contains the JSON metadata for the struct
-// [SpeedTestGetResponseEnvelope]
-type speedTestGetResponseEnvelopeJSON struct {
- Result apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SpeedTestGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r speedTestGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
diff --git a/speedtest_test.go b/speedtest_test.go
deleted file mode 100644
index 45c2a829e22..00000000000
--- a/speedtest_test.go
+++ /dev/null
@@ -1,140 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestSpeedTestNewWithOptionalParams(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"),
- )
- _, err := client.Speed.Tests.New(
- context.TODO(),
- "example.com",
- cloudflare.SpeedTestNewParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Region: cloudflare.F(cloudflare.SpeedTestNewParamsRegionUsCentral1),
- },
- )
- 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())
- }
-}
-
-func TestSpeedTestListWithOptionalParams(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"),
- )
- _, err := client.Speed.Tests.List(
- context.TODO(),
- "example.com",
- cloudflare.SpeedTestListParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Page: cloudflare.F(int64(1)),
- PerPage: cloudflare.F(int64(20)),
- Region: cloudflare.F(cloudflare.SpeedTestListParamsRegionUsCentral1),
- },
- )
- 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())
- }
-}
-
-func TestSpeedTestDeleteWithOptionalParams(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"),
- )
- _, err := client.Speed.Tests.Delete(
- context.TODO(),
- "example.com",
- cloudflare.SpeedTestDeleteParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Region: cloudflare.F(cloudflare.SpeedTestDeleteParamsRegionUsCentral1),
- },
- )
- 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())
- }
-}
-
-func TestSpeedTestGet(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"),
- )
- _, err := client.Speed.Tests.Get(
- context.TODO(),
- "example.com",
- "string",
- cloudflare.SpeedTestGetParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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/ssl.go b/ssl.go
deleted file mode 100644
index 15cef97e5b6..00000000000
--- a/ssl.go
+++ /dev/null
@@ -1,34 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// SSLService contains methods and other services that help with interacting with
-// the cloudflare API. Note, unlike clients, this service does not read variables
-// from the environment automatically. You should not instantiate this service
-// directly, and instead use the [NewSSLService] method instead.
-type SSLService struct {
- Options []option.RequestOption
- Analyze *SSLAnalyzeService
- CertificatePacks *SSLCertificatePackService
- Recommendations *SSLRecommendationService
- Universal *SSLUniversalService
- Verification *SSLVerificationService
-}
-
-// NewSSLService generates a new service that applies the given options to each
-// request. These options are applied after the parent client's options (if there
-// is one), and before any request-specific options.
-func NewSSLService(opts ...option.RequestOption) (r *SSLService) {
- r = &SSLService{}
- r.Options = opts
- r.Analyze = NewSSLAnalyzeService(opts...)
- r.CertificatePacks = NewSSLCertificatePackService(opts...)
- r.Recommendations = NewSSLRecommendationService(opts...)
- r.Universal = NewSSLUniversalService(opts...)
- r.Verification = NewSSLVerificationService(opts...)
- return
-}
diff --git a/ssl/aliases.go b/ssl/aliases.go
new file mode 100644
index 00000000000..93392ba99ac
--- /dev/null
+++ b/ssl/aliases.go
@@ -0,0 +1,9 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package ssl
+
+import (
+ "github.com/cloudflare/cloudflare-go/internal/apierror"
+)
+
+type Error = apierror.Error
diff --git a/ssl/analyze.go b/ssl/analyze.go
new file mode 100644
index 00000000000..c5752d14772
--- /dev/null
+++ b/ssl/analyze.go
@@ -0,0 +1,173 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package ssl
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "reflect"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/tidwall/gjson"
+)
+
+// AnalyzeService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewAnalyzeService] method instead.
+type AnalyzeService struct {
+ Options []option.RequestOption
+}
+
+// NewAnalyzeService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewAnalyzeService(opts ...option.RequestOption) (r *AnalyzeService) {
+ r = &AnalyzeService{}
+ r.Options = opts
+ return
+}
+
+// Returns the set of hostnames, the signature algorithm, and the expiration date
+// of the certificate.
+func (r *AnalyzeService) New(ctx context.Context, params AnalyzeNewParams, opts ...option.RequestOption) (res *AnalyzeNewResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AnalyzeNewResponseEnvelope
+ path := fmt.Sprintf("zones/%s/ssl/analyze", params.ZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Union satisfied by [ssl.AnalyzeNewResponseUnknown] or [shared.UnionString].
+type AnalyzeNewResponse interface {
+ ImplementsSSLAnalyzeNewResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*AnalyzeNewResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+type AnalyzeNewParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+ // A ubiquitous bundle has the highest probability of being verified everywhere,
+ // even by clients using outdated or unusual trust stores. An optimal bundle uses
+ // the shortest chain and newest intermediates. And the force bundle verifies the
+ // chain, but does not otherwise modify it.
+ BundleMethod param.Field[AnalyzeNewParamsBundleMethod] `json:"bundle_method"`
+ // The zone's SSL certificate or certificate and the intermediate(s).
+ Certificate param.Field[string] `json:"certificate"`
+}
+
+func (r AnalyzeNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// A ubiquitous bundle has the highest probability of being verified everywhere,
+// even by clients using outdated or unusual trust stores. An optimal bundle uses
+// the shortest chain and newest intermediates. And the force bundle verifies the
+// chain, but does not otherwise modify it.
+type AnalyzeNewParamsBundleMethod string
+
+const (
+ AnalyzeNewParamsBundleMethodUbiquitous AnalyzeNewParamsBundleMethod = "ubiquitous"
+ AnalyzeNewParamsBundleMethodOptimal AnalyzeNewParamsBundleMethod = "optimal"
+ AnalyzeNewParamsBundleMethodForce AnalyzeNewParamsBundleMethod = "force"
+)
+
+type AnalyzeNewResponseEnvelope struct {
+ Errors []AnalyzeNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []AnalyzeNewResponseEnvelopeMessages `json:"messages,required"`
+ Result AnalyzeNewResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success AnalyzeNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON analyzeNewResponseEnvelopeJSON `json:"-"`
+}
+
+// analyzeNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [AnalyzeNewResponseEnvelope]
+type analyzeNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AnalyzeNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r analyzeNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AnalyzeNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON analyzeNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// analyzeNewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [AnalyzeNewResponseEnvelopeErrors]
+type analyzeNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AnalyzeNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r analyzeNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type AnalyzeNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON analyzeNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// analyzeNewResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [AnalyzeNewResponseEnvelopeMessages]
+type analyzeNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AnalyzeNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r analyzeNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type AnalyzeNewResponseEnvelopeSuccess bool
+
+const (
+ AnalyzeNewResponseEnvelopeSuccessTrue AnalyzeNewResponseEnvelopeSuccess = true
+)
diff --git a/ssl/analyze_test.go b/ssl/analyze_test.go
new file mode 100644
index 00000000000..abd0a4f7c6b
--- /dev/null
+++ b/ssl/analyze_test.go
@@ -0,0 +1,43 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package ssl_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/ssl"
+)
+
+func TestAnalyzeNewWithOptionalParams(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"),
+ )
+ _, err := client.SSL.Analyze.New(context.TODO(), ssl.AnalyzeNewParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ BundleMethod: cloudflare.F(ssl.AnalyzeNewParamsBundleMethodUbiquitous),
+ Certificate: cloudflare.F("-----BEGIN CERTIFICATE-----\nMIIDtTCCAp2gAwIBAgIJAMHAwfXZ5/PWMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV\nBAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX\naWRnaXRzIFB0eSBMdGQwHhcNMTYwODI0MTY0MzAxWhcNMTYxMTIyMTY0MzAxWjBF\nMQswCQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50\nZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB\nCgKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmGdtcGbg/1\nCGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKnabIRuGvB\nKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpidtnKX/a+5\n0GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+pyFxIXjbEI\ndZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pEewooaeO2\nizNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABo4GnMIGkMB0GA1UdDgQWBBT/LbE4\n9rWf288N6sJA5BRb6FJIGDB1BgNVHSMEbjBsgBT/LbE49rWf288N6sJA5BRb6FJI\nGKFJpEcwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNV\nBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAMHAwfXZ5/PWMAwGA1UdEwQF\nMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAHHFwl0tH0quUYZYO0dZYt4R7SJ0pCm2\n2satiyzHl4OnXcHDpekAo7/a09c6Lz6AU83cKy/+x3/djYHXWba7HpEu0dR3ugQP\nMlr4zrhd9xKZ0KZKiYmtJH+ak4OM4L3FbT0owUZPyjLSlhMtJVcoRp5CJsjAMBUG\nSvD8RX+T01wzox/Qb+lnnNnOlaWpqu8eoOenybxKp1a9ULzIVvN/LAcc+14vioFq\n2swRWtmocBAs8QR9n4uvbpiYvS8eYueDCWMM4fvFfBhaDZ3N9IbtySh3SpFdQDhw\nYbjM2rxXiyLGxB4Bol7QTv4zHif7Zt89FReT/NBy4rzaskDJY5L6xmY=\n-----END CERTIFICATE-----\n"),
+ })
+ 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/ssl/certificatepack.go b/ssl/certificatepack.go
new file mode 100644
index 00000000000..56132d48bf3
--- /dev/null
+++ b/ssl/certificatepack.go
@@ -0,0 +1,641 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package ssl
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+ "reflect"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/tidwall/gjson"
+)
+
+// CertificatePackService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewCertificatePackService] method
+// instead.
+type CertificatePackService struct {
+ Options []option.RequestOption
+ Order *CertificatePackOrderService
+ Quota *CertificatePackQuotaService
+}
+
+// NewCertificatePackService generates a new service that applies the given options
+// to each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewCertificatePackService(opts ...option.RequestOption) (r *CertificatePackService) {
+ r = &CertificatePackService{}
+ r.Options = opts
+ r.Order = NewCertificatePackOrderService(opts...)
+ r.Quota = NewCertificatePackQuotaService(opts...)
+ return
+}
+
+// For a given zone, list all active certificate packs.
+func (r *CertificatePackService) List(ctx context.Context, params CertificatePackListParams, opts ...option.RequestOption) (res *[]CertificatePackListResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env CertificatePackListResponseEnvelope
+ path := fmt.Sprintf("zones/%s/ssl/certificate_packs", params.ZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// For a given zone, delete an advanced certificate pack.
+func (r *CertificatePackService) Delete(ctx context.Context, certificatePackID string, body CertificatePackDeleteParams, opts ...option.RequestOption) (res *CertificatePackDeleteResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env CertificatePackDeleteResponseEnvelope
+ path := fmt.Sprintf("zones/%s/ssl/certificate_packs/%s", body.ZoneID, certificatePackID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// For a given zone, restart validation for an advanced certificate pack. This is
+// only a validation operation for a Certificate Pack in a validation_timed_out
+// status.
+func (r *CertificatePackService) Edit(ctx context.Context, certificatePackID string, body CertificatePackEditParams, opts ...option.RequestOption) (res *CertificatePackEditResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env CertificatePackEditResponseEnvelope
+ path := fmt.Sprintf("zones/%s/ssl/certificate_packs/%s", body.ZoneID, certificatePackID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// For a given zone, get a certificate pack.
+func (r *CertificatePackService) Get(ctx context.Context, certificatePackID string, query CertificatePackGetParams, opts ...option.RequestOption) (res *CertificatePackGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env CertificatePackGetResponseEnvelope
+ path := fmt.Sprintf("zones/%s/ssl/certificate_packs/%s", query.ZoneID, certificatePackID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type CertificatePackListResponse = interface{}
+
+type CertificatePackDeleteResponse struct {
+ // Identifier
+ ID string `json:"id"`
+ JSON certificatePackDeleteResponseJSON `json:"-"`
+}
+
+// certificatePackDeleteResponseJSON contains the JSON metadata for the struct
+// [CertificatePackDeleteResponse]
+type certificatePackDeleteResponseJSON struct {
+ ID apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CertificatePackDeleteResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r certificatePackDeleteResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type CertificatePackEditResponse struct {
+ // Identifier
+ ID string `json:"id"`
+ // Certificate Authority selected for the order. For information on any certificate
+ // authority specific details or restrictions
+ // [see this page for more details.](https://developers.cloudflare.com/ssl/reference/certificate-authorities)
+ CertificateAuthority CertificatePackEditResponseCertificateAuthority `json:"certificate_authority"`
+ // Whether or not to add Cloudflare Branding for the order. This will add
+ // sni.cloudflaressl.com as the Common Name if set true.
+ CloudflareBranding bool `json:"cloudflare_branding"`
+ // Comma separated list of valid host names for the certificate packs. Must contain
+ // the zone apex, may not contain more than 50 hosts, and may not be empty.
+ Hosts []string `json:"hosts"`
+ // Status of certificate pack.
+ Status CertificatePackEditResponseStatus `json:"status"`
+ // Type of certificate pack.
+ Type CertificatePackEditResponseType `json:"type"`
+ // Validation Method selected for the order.
+ ValidationMethod CertificatePackEditResponseValidationMethod `json:"validation_method"`
+ // Validity Days selected for the order.
+ ValidityDays CertificatePackEditResponseValidityDays `json:"validity_days"`
+ JSON certificatePackEditResponseJSON `json:"-"`
+}
+
+// certificatePackEditResponseJSON contains the JSON metadata for the struct
+// [CertificatePackEditResponse]
+type certificatePackEditResponseJSON struct {
+ ID apijson.Field
+ CertificateAuthority apijson.Field
+ CloudflareBranding apijson.Field
+ Hosts apijson.Field
+ Status apijson.Field
+ Type apijson.Field
+ ValidationMethod apijson.Field
+ ValidityDays apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CertificatePackEditResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r certificatePackEditResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+// Certificate Authority selected for the order. For information on any certificate
+// authority specific details or restrictions
+// [see this page for more details.](https://developers.cloudflare.com/ssl/reference/certificate-authorities)
+type CertificatePackEditResponseCertificateAuthority string
+
+const (
+ CertificatePackEditResponseCertificateAuthorityGoogle CertificatePackEditResponseCertificateAuthority = "google"
+ CertificatePackEditResponseCertificateAuthorityLetsEncrypt CertificatePackEditResponseCertificateAuthority = "lets_encrypt"
+)
+
+// Status of certificate pack.
+type CertificatePackEditResponseStatus string
+
+const (
+ CertificatePackEditResponseStatusInitializing CertificatePackEditResponseStatus = "initializing"
+ CertificatePackEditResponseStatusPendingValidation CertificatePackEditResponseStatus = "pending_validation"
+ CertificatePackEditResponseStatusDeleted CertificatePackEditResponseStatus = "deleted"
+ CertificatePackEditResponseStatusPendingIssuance CertificatePackEditResponseStatus = "pending_issuance"
+ CertificatePackEditResponseStatusPendingDeployment CertificatePackEditResponseStatus = "pending_deployment"
+ CertificatePackEditResponseStatusPendingDeletion CertificatePackEditResponseStatus = "pending_deletion"
+ CertificatePackEditResponseStatusPendingExpiration CertificatePackEditResponseStatus = "pending_expiration"
+ CertificatePackEditResponseStatusExpired CertificatePackEditResponseStatus = "expired"
+ CertificatePackEditResponseStatusActive CertificatePackEditResponseStatus = "active"
+ CertificatePackEditResponseStatusInitializingTimedOut CertificatePackEditResponseStatus = "initializing_timed_out"
+ CertificatePackEditResponseStatusValidationTimedOut CertificatePackEditResponseStatus = "validation_timed_out"
+ CertificatePackEditResponseStatusIssuanceTimedOut CertificatePackEditResponseStatus = "issuance_timed_out"
+ CertificatePackEditResponseStatusDeploymentTimedOut CertificatePackEditResponseStatus = "deployment_timed_out"
+ CertificatePackEditResponseStatusDeletionTimedOut CertificatePackEditResponseStatus = "deletion_timed_out"
+ CertificatePackEditResponseStatusPendingCleanup CertificatePackEditResponseStatus = "pending_cleanup"
+ CertificatePackEditResponseStatusStagingDeployment CertificatePackEditResponseStatus = "staging_deployment"
+ CertificatePackEditResponseStatusStagingActive CertificatePackEditResponseStatus = "staging_active"
+ CertificatePackEditResponseStatusDeactivating CertificatePackEditResponseStatus = "deactivating"
+ CertificatePackEditResponseStatusInactive CertificatePackEditResponseStatus = "inactive"
+ CertificatePackEditResponseStatusBackupIssued CertificatePackEditResponseStatus = "backup_issued"
+ CertificatePackEditResponseStatusHoldingDeployment CertificatePackEditResponseStatus = "holding_deployment"
+)
+
+// Type of certificate pack.
+type CertificatePackEditResponseType string
+
+const (
+ CertificatePackEditResponseTypeAdvanced CertificatePackEditResponseType = "advanced"
+)
+
+// Validation Method selected for the order.
+type CertificatePackEditResponseValidationMethod string
+
+const (
+ CertificatePackEditResponseValidationMethodTXT CertificatePackEditResponseValidationMethod = "txt"
+ CertificatePackEditResponseValidationMethodHTTP CertificatePackEditResponseValidationMethod = "http"
+ CertificatePackEditResponseValidationMethodEmail CertificatePackEditResponseValidationMethod = "email"
+)
+
+// Validity Days selected for the order.
+type CertificatePackEditResponseValidityDays int64
+
+const (
+ CertificatePackEditResponseValidityDays14 CertificatePackEditResponseValidityDays = 14
+ CertificatePackEditResponseValidityDays30 CertificatePackEditResponseValidityDays = 30
+ CertificatePackEditResponseValidityDays90 CertificatePackEditResponseValidityDays = 90
+ CertificatePackEditResponseValidityDays365 CertificatePackEditResponseValidityDays = 365
+)
+
+// Union satisfied by [ssl.CertificatePackGetResponseUnknown] or
+// [shared.UnionString].
+type CertificatePackGetResponse interface {
+ ImplementsSSLCertificatePackGetResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*CertificatePackGetResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+type CertificatePackListParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+ // Include Certificate Packs of all statuses, not just active ones.
+ Status param.Field[CertificatePackListParamsStatus] `query:"status"`
+}
+
+// URLQuery serializes [CertificatePackListParams]'s query parameters as
+// `url.Values`.
+func (r CertificatePackListParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Include Certificate Packs of all statuses, not just active ones.
+type CertificatePackListParamsStatus string
+
+const (
+ CertificatePackListParamsStatusAll CertificatePackListParamsStatus = "all"
+)
+
+type CertificatePackListResponseEnvelope struct {
+ Errors []CertificatePackListResponseEnvelopeErrors `json:"errors,required"`
+ Messages []CertificatePackListResponseEnvelopeMessages `json:"messages,required"`
+ Result []CertificatePackListResponse `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success CertificatePackListResponseEnvelopeSuccess `json:"success,required"`
+ ResultInfo CertificatePackListResponseEnvelopeResultInfo `json:"result_info"`
+ JSON certificatePackListResponseEnvelopeJSON `json:"-"`
+}
+
+// certificatePackListResponseEnvelopeJSON contains the JSON metadata for the
+// struct [CertificatePackListResponseEnvelope]
+type certificatePackListResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ ResultInfo apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CertificatePackListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r certificatePackListResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type CertificatePackListResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON certificatePackListResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// certificatePackListResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [CertificatePackListResponseEnvelopeErrors]
+type certificatePackListResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CertificatePackListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r certificatePackListResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type CertificatePackListResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON certificatePackListResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// certificatePackListResponseEnvelopeMessagesJSON contains the JSON metadata for
+// the struct [CertificatePackListResponseEnvelopeMessages]
+type certificatePackListResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CertificatePackListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r certificatePackListResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type CertificatePackListResponseEnvelopeSuccess bool
+
+const (
+ CertificatePackListResponseEnvelopeSuccessTrue CertificatePackListResponseEnvelopeSuccess = true
+)
+
+type CertificatePackListResponseEnvelopeResultInfo struct {
+ // Total number of results for the requested service
+ Count float64 `json:"count"`
+ // Current page within paginated list of results
+ Page float64 `json:"page"`
+ // Number of results per page of results
+ PerPage float64 `json:"per_page"`
+ // Total results available without any search parameters
+ TotalCount float64 `json:"total_count"`
+ JSON certificatePackListResponseEnvelopeResultInfoJSON `json:"-"`
+}
+
+// certificatePackListResponseEnvelopeResultInfoJSON contains the JSON metadata for
+// the struct [CertificatePackListResponseEnvelopeResultInfo]
+type certificatePackListResponseEnvelopeResultInfoJSON struct {
+ Count apijson.Field
+ Page apijson.Field
+ PerPage apijson.Field
+ TotalCount apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CertificatePackListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r certificatePackListResponseEnvelopeResultInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+type CertificatePackDeleteParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+}
+
+type CertificatePackDeleteResponseEnvelope struct {
+ Errors []CertificatePackDeleteResponseEnvelopeErrors `json:"errors,required"`
+ Messages []CertificatePackDeleteResponseEnvelopeMessages `json:"messages,required"`
+ Result CertificatePackDeleteResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success CertificatePackDeleteResponseEnvelopeSuccess `json:"success,required"`
+ JSON certificatePackDeleteResponseEnvelopeJSON `json:"-"`
+}
+
+// certificatePackDeleteResponseEnvelopeJSON contains the JSON metadata for the
+// struct [CertificatePackDeleteResponseEnvelope]
+type certificatePackDeleteResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CertificatePackDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r certificatePackDeleteResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type CertificatePackDeleteResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON certificatePackDeleteResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// certificatePackDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for
+// the struct [CertificatePackDeleteResponseEnvelopeErrors]
+type certificatePackDeleteResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CertificatePackDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r certificatePackDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type CertificatePackDeleteResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON certificatePackDeleteResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// certificatePackDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for
+// the struct [CertificatePackDeleteResponseEnvelopeMessages]
+type certificatePackDeleteResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CertificatePackDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r certificatePackDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type CertificatePackDeleteResponseEnvelopeSuccess bool
+
+const (
+ CertificatePackDeleteResponseEnvelopeSuccessTrue CertificatePackDeleteResponseEnvelopeSuccess = true
+)
+
+type CertificatePackEditParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+}
+
+type CertificatePackEditResponseEnvelope struct {
+ Errors []CertificatePackEditResponseEnvelopeErrors `json:"errors,required"`
+ Messages []CertificatePackEditResponseEnvelopeMessages `json:"messages,required"`
+ Result CertificatePackEditResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success CertificatePackEditResponseEnvelopeSuccess `json:"success,required"`
+ JSON certificatePackEditResponseEnvelopeJSON `json:"-"`
+}
+
+// certificatePackEditResponseEnvelopeJSON contains the JSON metadata for the
+// struct [CertificatePackEditResponseEnvelope]
+type certificatePackEditResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CertificatePackEditResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r certificatePackEditResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type CertificatePackEditResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON certificatePackEditResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// certificatePackEditResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [CertificatePackEditResponseEnvelopeErrors]
+type certificatePackEditResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CertificatePackEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r certificatePackEditResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type CertificatePackEditResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON certificatePackEditResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// certificatePackEditResponseEnvelopeMessagesJSON contains the JSON metadata for
+// the struct [CertificatePackEditResponseEnvelopeMessages]
+type certificatePackEditResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CertificatePackEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r certificatePackEditResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type CertificatePackEditResponseEnvelopeSuccess bool
+
+const (
+ CertificatePackEditResponseEnvelopeSuccessTrue CertificatePackEditResponseEnvelopeSuccess = true
+)
+
+type CertificatePackGetParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+}
+
+type CertificatePackGetResponseEnvelope struct {
+ Errors []CertificatePackGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []CertificatePackGetResponseEnvelopeMessages `json:"messages,required"`
+ Result CertificatePackGetResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success CertificatePackGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON certificatePackGetResponseEnvelopeJSON `json:"-"`
+}
+
+// certificatePackGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [CertificatePackGetResponseEnvelope]
+type certificatePackGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CertificatePackGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r certificatePackGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type CertificatePackGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON certificatePackGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// certificatePackGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [CertificatePackGetResponseEnvelopeErrors]
+type certificatePackGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CertificatePackGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r certificatePackGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type CertificatePackGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON certificatePackGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// certificatePackGetResponseEnvelopeMessagesJSON contains the JSON metadata for
+// the struct [CertificatePackGetResponseEnvelopeMessages]
+type certificatePackGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CertificatePackGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r certificatePackGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type CertificatePackGetResponseEnvelopeSuccess bool
+
+const (
+ CertificatePackGetResponseEnvelopeSuccessTrue CertificatePackGetResponseEnvelopeSuccess = true
+)
diff --git a/ssl/certificatepack_test.go b/ssl/certificatepack_test.go
new file mode 100644
index 00000000000..296485763c8
--- /dev/null
+++ b/ssl/certificatepack_test.go
@@ -0,0 +1,132 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package ssl_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/ssl"
+)
+
+func TestCertificatePackListWithOptionalParams(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"),
+ )
+ _, err := client.SSL.CertificatePacks.List(context.TODO(), ssl.CertificatePackListParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Status: cloudflare.F(ssl.CertificatePackListParamsStatusAll),
+ })
+ 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())
+ }
+}
+
+func TestCertificatePackDelete(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"),
+ )
+ _, err := client.SSL.CertificatePacks.Delete(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ ssl.CertificatePackDeleteParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestCertificatePackEdit(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"),
+ )
+ _, err := client.SSL.CertificatePacks.Edit(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ ssl.CertificatePackEditParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestCertificatePackGet(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"),
+ )
+ _, err := client.SSL.CertificatePacks.Get(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ ssl.CertificatePackGetParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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/ssl/certificatepackorder.go b/ssl/certificatepackorder.go
new file mode 100644
index 00000000000..fadefd9024a
--- /dev/null
+++ b/ssl/certificatepackorder.go
@@ -0,0 +1,297 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package ssl
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// CertificatePackOrderService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewCertificatePackOrderService]
+// method instead.
+type CertificatePackOrderService struct {
+ Options []option.RequestOption
+}
+
+// NewCertificatePackOrderService generates a new service that applies the given
+// options to each request. These options are applied after the parent client's
+// options (if there is one), and before any request-specific options.
+func NewCertificatePackOrderService(opts ...option.RequestOption) (r *CertificatePackOrderService) {
+ r = &CertificatePackOrderService{}
+ r.Options = opts
+ return
+}
+
+// For a given zone, order an advanced certificate pack.
+func (r *CertificatePackOrderService) New(ctx context.Context, params CertificatePackOrderNewParams, opts ...option.RequestOption) (res *CertificatePackOrderNewResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env CertificatePackOrderNewResponseEnvelope
+ path := fmt.Sprintf("zones/%s/ssl/certificate_packs/order", params.ZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type CertificatePackOrderNewResponse struct {
+ // Identifier
+ ID string `json:"id"`
+ // Certificate Authority selected for the order. For information on any certificate
+ // authority specific details or restrictions
+ // [see this page for more details.](https://developers.cloudflare.com/ssl/reference/certificate-authorities)
+ CertificateAuthority CertificatePackOrderNewResponseCertificateAuthority `json:"certificate_authority"`
+ // Whether or not to add Cloudflare Branding for the order. This will add
+ // sni.cloudflaressl.com as the Common Name if set true.
+ CloudflareBranding bool `json:"cloudflare_branding"`
+ // Comma separated list of valid host names for the certificate packs. Must contain
+ // the zone apex, may not contain more than 50 hosts, and may not be empty.
+ Hosts []string `json:"hosts"`
+ // Status of certificate pack.
+ Status CertificatePackOrderNewResponseStatus `json:"status"`
+ // Type of certificate pack.
+ Type CertificatePackOrderNewResponseType `json:"type"`
+ // Validation Method selected for the order.
+ ValidationMethod CertificatePackOrderNewResponseValidationMethod `json:"validation_method"`
+ // Validity Days selected for the order.
+ ValidityDays CertificatePackOrderNewResponseValidityDays `json:"validity_days"`
+ JSON certificatePackOrderNewResponseJSON `json:"-"`
+}
+
+// certificatePackOrderNewResponseJSON contains the JSON metadata for the struct
+// [CertificatePackOrderNewResponse]
+type certificatePackOrderNewResponseJSON struct {
+ ID apijson.Field
+ CertificateAuthority apijson.Field
+ CloudflareBranding apijson.Field
+ Hosts apijson.Field
+ Status apijson.Field
+ Type apijson.Field
+ ValidationMethod apijson.Field
+ ValidityDays apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CertificatePackOrderNewResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r certificatePackOrderNewResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+// Certificate Authority selected for the order. For information on any certificate
+// authority specific details or restrictions
+// [see this page for more details.](https://developers.cloudflare.com/ssl/reference/certificate-authorities)
+type CertificatePackOrderNewResponseCertificateAuthority string
+
+const (
+ CertificatePackOrderNewResponseCertificateAuthorityGoogle CertificatePackOrderNewResponseCertificateAuthority = "google"
+ CertificatePackOrderNewResponseCertificateAuthorityLetsEncrypt CertificatePackOrderNewResponseCertificateAuthority = "lets_encrypt"
+)
+
+// Status of certificate pack.
+type CertificatePackOrderNewResponseStatus string
+
+const (
+ CertificatePackOrderNewResponseStatusInitializing CertificatePackOrderNewResponseStatus = "initializing"
+ CertificatePackOrderNewResponseStatusPendingValidation CertificatePackOrderNewResponseStatus = "pending_validation"
+ CertificatePackOrderNewResponseStatusDeleted CertificatePackOrderNewResponseStatus = "deleted"
+ CertificatePackOrderNewResponseStatusPendingIssuance CertificatePackOrderNewResponseStatus = "pending_issuance"
+ CertificatePackOrderNewResponseStatusPendingDeployment CertificatePackOrderNewResponseStatus = "pending_deployment"
+ CertificatePackOrderNewResponseStatusPendingDeletion CertificatePackOrderNewResponseStatus = "pending_deletion"
+ CertificatePackOrderNewResponseStatusPendingExpiration CertificatePackOrderNewResponseStatus = "pending_expiration"
+ CertificatePackOrderNewResponseStatusExpired CertificatePackOrderNewResponseStatus = "expired"
+ CertificatePackOrderNewResponseStatusActive CertificatePackOrderNewResponseStatus = "active"
+ CertificatePackOrderNewResponseStatusInitializingTimedOut CertificatePackOrderNewResponseStatus = "initializing_timed_out"
+ CertificatePackOrderNewResponseStatusValidationTimedOut CertificatePackOrderNewResponseStatus = "validation_timed_out"
+ CertificatePackOrderNewResponseStatusIssuanceTimedOut CertificatePackOrderNewResponseStatus = "issuance_timed_out"
+ CertificatePackOrderNewResponseStatusDeploymentTimedOut CertificatePackOrderNewResponseStatus = "deployment_timed_out"
+ CertificatePackOrderNewResponseStatusDeletionTimedOut CertificatePackOrderNewResponseStatus = "deletion_timed_out"
+ CertificatePackOrderNewResponseStatusPendingCleanup CertificatePackOrderNewResponseStatus = "pending_cleanup"
+ CertificatePackOrderNewResponseStatusStagingDeployment CertificatePackOrderNewResponseStatus = "staging_deployment"
+ CertificatePackOrderNewResponseStatusStagingActive CertificatePackOrderNewResponseStatus = "staging_active"
+ CertificatePackOrderNewResponseStatusDeactivating CertificatePackOrderNewResponseStatus = "deactivating"
+ CertificatePackOrderNewResponseStatusInactive CertificatePackOrderNewResponseStatus = "inactive"
+ CertificatePackOrderNewResponseStatusBackupIssued CertificatePackOrderNewResponseStatus = "backup_issued"
+ CertificatePackOrderNewResponseStatusHoldingDeployment CertificatePackOrderNewResponseStatus = "holding_deployment"
+)
+
+// Type of certificate pack.
+type CertificatePackOrderNewResponseType string
+
+const (
+ CertificatePackOrderNewResponseTypeAdvanced CertificatePackOrderNewResponseType = "advanced"
+)
+
+// Validation Method selected for the order.
+type CertificatePackOrderNewResponseValidationMethod string
+
+const (
+ CertificatePackOrderNewResponseValidationMethodTXT CertificatePackOrderNewResponseValidationMethod = "txt"
+ CertificatePackOrderNewResponseValidationMethodHTTP CertificatePackOrderNewResponseValidationMethod = "http"
+ CertificatePackOrderNewResponseValidationMethodEmail CertificatePackOrderNewResponseValidationMethod = "email"
+)
+
+// Validity Days selected for the order.
+type CertificatePackOrderNewResponseValidityDays int64
+
+const (
+ CertificatePackOrderNewResponseValidityDays14 CertificatePackOrderNewResponseValidityDays = 14
+ CertificatePackOrderNewResponseValidityDays30 CertificatePackOrderNewResponseValidityDays = 30
+ CertificatePackOrderNewResponseValidityDays90 CertificatePackOrderNewResponseValidityDays = 90
+ CertificatePackOrderNewResponseValidityDays365 CertificatePackOrderNewResponseValidityDays = 365
+)
+
+type CertificatePackOrderNewParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+ // Certificate Authority selected for the order. For information on any certificate
+ // authority specific details or restrictions
+ // [see this page for more details.](https://developers.cloudflare.com/ssl/reference/certificate-authorities)
+ CertificateAuthority param.Field[CertificatePackOrderNewParamsCertificateAuthority] `json:"certificate_authority,required"`
+ // Comma separated list of valid host names for the certificate packs. Must contain
+ // the zone apex, may not contain more than 50 hosts, and may not be empty.
+ Hosts param.Field[[]string] `json:"hosts,required"`
+ // Type of certificate pack.
+ Type param.Field[CertificatePackOrderNewParamsType] `json:"type,required"`
+ // Validation Method selected for the order.
+ ValidationMethod param.Field[CertificatePackOrderNewParamsValidationMethod] `json:"validation_method,required"`
+ // Validity Days selected for the order.
+ ValidityDays param.Field[CertificatePackOrderNewParamsValidityDays] `json:"validity_days,required"`
+ // Whether or not to add Cloudflare Branding for the order. This will add
+ // sni.cloudflaressl.com as the Common Name if set true.
+ CloudflareBranding param.Field[bool] `json:"cloudflare_branding"`
+}
+
+func (r CertificatePackOrderNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Certificate Authority selected for the order. For information on any certificate
+// authority specific details or restrictions
+// [see this page for more details.](https://developers.cloudflare.com/ssl/reference/certificate-authorities)
+type CertificatePackOrderNewParamsCertificateAuthority string
+
+const (
+ CertificatePackOrderNewParamsCertificateAuthorityGoogle CertificatePackOrderNewParamsCertificateAuthority = "google"
+ CertificatePackOrderNewParamsCertificateAuthorityLetsEncrypt CertificatePackOrderNewParamsCertificateAuthority = "lets_encrypt"
+)
+
+// Type of certificate pack.
+type CertificatePackOrderNewParamsType string
+
+const (
+ CertificatePackOrderNewParamsTypeAdvanced CertificatePackOrderNewParamsType = "advanced"
+)
+
+// Validation Method selected for the order.
+type CertificatePackOrderNewParamsValidationMethod string
+
+const (
+ CertificatePackOrderNewParamsValidationMethodTXT CertificatePackOrderNewParamsValidationMethod = "txt"
+ CertificatePackOrderNewParamsValidationMethodHTTP CertificatePackOrderNewParamsValidationMethod = "http"
+ CertificatePackOrderNewParamsValidationMethodEmail CertificatePackOrderNewParamsValidationMethod = "email"
+)
+
+// Validity Days selected for the order.
+type CertificatePackOrderNewParamsValidityDays int64
+
+const (
+ CertificatePackOrderNewParamsValidityDays14 CertificatePackOrderNewParamsValidityDays = 14
+ CertificatePackOrderNewParamsValidityDays30 CertificatePackOrderNewParamsValidityDays = 30
+ CertificatePackOrderNewParamsValidityDays90 CertificatePackOrderNewParamsValidityDays = 90
+ CertificatePackOrderNewParamsValidityDays365 CertificatePackOrderNewParamsValidityDays = 365
+)
+
+type CertificatePackOrderNewResponseEnvelope struct {
+ Errors []CertificatePackOrderNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []CertificatePackOrderNewResponseEnvelopeMessages `json:"messages,required"`
+ Result CertificatePackOrderNewResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success CertificatePackOrderNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON certificatePackOrderNewResponseEnvelopeJSON `json:"-"`
+}
+
+// certificatePackOrderNewResponseEnvelopeJSON contains the JSON metadata for the
+// struct [CertificatePackOrderNewResponseEnvelope]
+type certificatePackOrderNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CertificatePackOrderNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r certificatePackOrderNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type CertificatePackOrderNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON certificatePackOrderNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// certificatePackOrderNewResponseEnvelopeErrorsJSON contains the JSON metadata for
+// the struct [CertificatePackOrderNewResponseEnvelopeErrors]
+type certificatePackOrderNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CertificatePackOrderNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r certificatePackOrderNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type CertificatePackOrderNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON certificatePackOrderNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// certificatePackOrderNewResponseEnvelopeMessagesJSON contains the JSON metadata
+// for the struct [CertificatePackOrderNewResponseEnvelopeMessages]
+type certificatePackOrderNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CertificatePackOrderNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r certificatePackOrderNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type CertificatePackOrderNewResponseEnvelopeSuccess bool
+
+const (
+ CertificatePackOrderNewResponseEnvelopeSuccessTrue CertificatePackOrderNewResponseEnvelopeSuccess = true
+)
diff --git a/ssl/certificatepackorder_test.go b/ssl/certificatepackorder_test.go
new file mode 100644
index 00000000000..f37b6b3c791
--- /dev/null
+++ b/ssl/certificatepackorder_test.go
@@ -0,0 +1,47 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package ssl_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/ssl"
+)
+
+func TestCertificatePackOrderNewWithOptionalParams(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"),
+ )
+ _, err := client.SSL.CertificatePacks.Order.New(context.TODO(), ssl.CertificatePackOrderNewParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ CertificateAuthority: cloudflare.F(ssl.CertificatePackOrderNewParamsCertificateAuthorityLetsEncrypt),
+ Hosts: cloudflare.F([]string{"example.com", "*.example.com", "www.example.com"}),
+ Type: cloudflare.F(ssl.CertificatePackOrderNewParamsTypeAdvanced),
+ ValidationMethod: cloudflare.F(ssl.CertificatePackOrderNewParamsValidationMethodTXT),
+ ValidityDays: cloudflare.F(ssl.CertificatePackOrderNewParamsValidityDays14),
+ CloudflareBranding: cloudflare.F(false),
+ })
+ 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/ssl/certificatepackquota.go b/ssl/certificatepackquota.go
new file mode 100644
index 00000000000..1f8d1529885
--- /dev/null
+++ b/ssl/certificatepackquota.go
@@ -0,0 +1,177 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package ssl
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// CertificatePackQuotaService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewCertificatePackQuotaService]
+// method instead.
+type CertificatePackQuotaService struct {
+ Options []option.RequestOption
+}
+
+// NewCertificatePackQuotaService generates a new service that applies the given
+// options to each request. These options are applied after the parent client's
+// options (if there is one), and before any request-specific options.
+func NewCertificatePackQuotaService(opts ...option.RequestOption) (r *CertificatePackQuotaService) {
+ r = &CertificatePackQuotaService{}
+ r.Options = opts
+ return
+}
+
+// For a given zone, list certificate pack quotas.
+func (r *CertificatePackQuotaService) Get(ctx context.Context, query CertificatePackQuotaGetParams, opts ...option.RequestOption) (res *CertificatePackQuotaGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env CertificatePackQuotaGetResponseEnvelope
+ path := fmt.Sprintf("zones/%s/ssl/certificate_packs/quota", query.ZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type CertificatePackQuotaGetResponse struct {
+ Advanced CertificatePackQuotaGetResponseAdvanced `json:"advanced"`
+ JSON certificatePackQuotaGetResponseJSON `json:"-"`
+}
+
+// certificatePackQuotaGetResponseJSON contains the JSON metadata for the struct
+// [CertificatePackQuotaGetResponse]
+type certificatePackQuotaGetResponseJSON struct {
+ Advanced apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CertificatePackQuotaGetResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r certificatePackQuotaGetResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type CertificatePackQuotaGetResponseAdvanced struct {
+ // Quantity Allocated.
+ Allocated int64 `json:"allocated"`
+ // Quantity Used.
+ Used int64 `json:"used"`
+ JSON certificatePackQuotaGetResponseAdvancedJSON `json:"-"`
+}
+
+// certificatePackQuotaGetResponseAdvancedJSON contains the JSON metadata for the
+// struct [CertificatePackQuotaGetResponseAdvanced]
+type certificatePackQuotaGetResponseAdvancedJSON struct {
+ Allocated apijson.Field
+ Used apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CertificatePackQuotaGetResponseAdvanced) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r certificatePackQuotaGetResponseAdvancedJSON) RawJSON() string {
+ return r.raw
+}
+
+type CertificatePackQuotaGetParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+}
+
+type CertificatePackQuotaGetResponseEnvelope struct {
+ Errors []CertificatePackQuotaGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []CertificatePackQuotaGetResponseEnvelopeMessages `json:"messages,required"`
+ Result CertificatePackQuotaGetResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success CertificatePackQuotaGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON certificatePackQuotaGetResponseEnvelopeJSON `json:"-"`
+}
+
+// certificatePackQuotaGetResponseEnvelopeJSON contains the JSON metadata for the
+// struct [CertificatePackQuotaGetResponseEnvelope]
+type certificatePackQuotaGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CertificatePackQuotaGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r certificatePackQuotaGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type CertificatePackQuotaGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON certificatePackQuotaGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// certificatePackQuotaGetResponseEnvelopeErrorsJSON contains the JSON metadata for
+// the struct [CertificatePackQuotaGetResponseEnvelopeErrors]
+type certificatePackQuotaGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CertificatePackQuotaGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r certificatePackQuotaGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type CertificatePackQuotaGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON certificatePackQuotaGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// certificatePackQuotaGetResponseEnvelopeMessagesJSON contains the JSON metadata
+// for the struct [CertificatePackQuotaGetResponseEnvelopeMessages]
+type certificatePackQuotaGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CertificatePackQuotaGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r certificatePackQuotaGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type CertificatePackQuotaGetResponseEnvelopeSuccess bool
+
+const (
+ CertificatePackQuotaGetResponseEnvelopeSuccessTrue CertificatePackQuotaGetResponseEnvelopeSuccess = true
+)
diff --git a/ssl/certificatepackquota_test.go b/ssl/certificatepackquota_test.go
new file mode 100644
index 00000000000..69134f451a3
--- /dev/null
+++ b/ssl/certificatepackquota_test.go
@@ -0,0 +1,41 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package ssl_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/ssl"
+)
+
+func TestCertificatePackQuotaGet(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"),
+ )
+ _, err := client.SSL.CertificatePacks.Quota.Get(context.TODO(), ssl.CertificatePackQuotaGetParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ })
+ 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/ssl/recommendation.go b/ssl/recommendation.go
new file mode 100644
index 00000000000..669efd1b86d
--- /dev/null
+++ b/ssl/recommendation.go
@@ -0,0 +1,160 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package ssl
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// RecommendationService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewRecommendationService] method
+// instead.
+type RecommendationService struct {
+ Options []option.RequestOption
+}
+
+// NewRecommendationService generates a new service that applies the given options
+// to each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewRecommendationService(opts ...option.RequestOption) (r *RecommendationService) {
+ r = &RecommendationService{}
+ r.Options = opts
+ return
+}
+
+// Retrieve the SSL/TLS Recommender's recommendation for a zone.
+func (r *RecommendationService) Get(ctx context.Context, zoneIdentifier string, opts ...option.RequestOption) (res *RecommendationGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env RecommendationGetResponseEnvelope
+ path := fmt.Sprintf("zones/%s/ssl/recommendation", zoneIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type RecommendationGetResponse struct {
+ // Identifier of a recommedation result.
+ ID string `json:"id"`
+ ModifiedOn time.Time `json:"modified_on" format:"date-time"`
+ Value RecommendationGetResponseValue `json:"value"`
+ JSON recommendationGetResponseJSON `json:"-"`
+}
+
+// recommendationGetResponseJSON contains the JSON metadata for the struct
+// [RecommendationGetResponse]
+type recommendationGetResponseJSON struct {
+ ID apijson.Field
+ ModifiedOn apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecommendationGetResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recommendationGetResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type RecommendationGetResponseValue string
+
+const (
+ RecommendationGetResponseValueFlexible RecommendationGetResponseValue = "flexible"
+ RecommendationGetResponseValueFull RecommendationGetResponseValue = "full"
+ RecommendationGetResponseValueStrict RecommendationGetResponseValue = "strict"
+)
+
+type RecommendationGetResponseEnvelope struct {
+ Errors []RecommendationGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []RecommendationGetResponseEnvelopeMessages `json:"messages,required"`
+ Result RecommendationGetResponse `json:"result,required,nullable"`
+ // Whether the API call was successful
+ Success RecommendationGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON recommendationGetResponseEnvelopeJSON `json:"-"`
+}
+
+// recommendationGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [RecommendationGetResponseEnvelope]
+type recommendationGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecommendationGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recommendationGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type RecommendationGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON recommendationGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// recommendationGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [RecommendationGetResponseEnvelopeErrors]
+type recommendationGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecommendationGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recommendationGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type RecommendationGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON recommendationGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// recommendationGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [RecommendationGetResponseEnvelopeMessages]
+type recommendationGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *RecommendationGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r recommendationGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type RecommendationGetResponseEnvelopeSuccess bool
+
+const (
+ RecommendationGetResponseEnvelopeSuccessTrue RecommendationGetResponseEnvelopeSuccess = true
+)
diff --git a/ssl/recommendation_test.go b/ssl/recommendation_test.go
new file mode 100644
index 00000000000..3e89996282f
--- /dev/null
+++ b/ssl/recommendation_test.go
@@ -0,0 +1,38 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package ssl_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+func TestRecommendationGet(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"),
+ )
+ _, err := client.SSL.Recommendations.Get(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353")
+ 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/ssl/ssl.go b/ssl/ssl.go
new file mode 100644
index 00000000000..4cdb95c4f2b
--- /dev/null
+++ b/ssl/ssl.go
@@ -0,0 +1,34 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package ssl
+
+import (
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// SSLService contains methods and other services that help with interacting with
+// the cloudflare API. Note, unlike clients, this service does not read variables
+// from the environment automatically. You should not instantiate this service
+// directly, and instead use the [NewSSLService] method instead.
+type SSLService struct {
+ Options []option.RequestOption
+ Analyze *AnalyzeService
+ CertificatePacks *CertificatePackService
+ Recommendations *RecommendationService
+ Universal *UniversalService
+ Verification *VerificationService
+}
+
+// NewSSLService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewSSLService(opts ...option.RequestOption) (r *SSLService) {
+ r = &SSLService{}
+ r.Options = opts
+ r.Analyze = NewAnalyzeService(opts...)
+ r.CertificatePacks = NewCertificatePackService(opts...)
+ r.Recommendations = NewRecommendationService(opts...)
+ r.Universal = NewUniversalService(opts...)
+ r.Verification = NewVerificationService(opts...)
+ return
+}
diff --git a/ssl/universal.go b/ssl/universal.go
new file mode 100644
index 00000000000..b5356c845c9
--- /dev/null
+++ b/ssl/universal.go
@@ -0,0 +1,26 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package ssl
+
+import (
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// UniversalService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewUniversalService] method instead.
+type UniversalService struct {
+ Options []option.RequestOption
+ Settings *UniversalSettingService
+}
+
+// NewUniversalService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewUniversalService(opts ...option.RequestOption) (r *UniversalService) {
+ r = &UniversalService{}
+ r.Options = opts
+ r.Settings = NewUniversalSettingService(opts...)
+ return
+}
diff --git a/ssl/universalsetting.go b/ssl/universalsetting.go
new file mode 100644
index 00000000000..adc41bfcf84
--- /dev/null
+++ b/ssl/universalsetting.go
@@ -0,0 +1,306 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package ssl
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// UniversalSettingService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewUniversalSettingService] method
+// instead.
+type UniversalSettingService struct {
+ Options []option.RequestOption
+}
+
+// NewUniversalSettingService generates a new service that applies the given
+// options to each request. These options are applied after the parent client's
+// options (if there is one), and before any request-specific options.
+func NewUniversalSettingService(opts ...option.RequestOption) (r *UniversalSettingService) {
+ r = &UniversalSettingService{}
+ r.Options = opts
+ return
+}
+
+// Patch Universal SSL Settings for a Zone.
+func (r *UniversalSettingService) Edit(ctx context.Context, params UniversalSettingEditParams, opts ...option.RequestOption) (res *TLSCertificatesAndHostnamesUniversal, err error) {
+ opts = append(r.Options[:], opts...)
+ var env UniversalSettingEditResponseEnvelope
+ path := fmt.Sprintf("zones/%s/ssl/universal/settings", params.ZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Get Universal SSL Settings for a Zone.
+func (r *UniversalSettingService) Get(ctx context.Context, query UniversalSettingGetParams, opts ...option.RequestOption) (res *TLSCertificatesAndHostnamesUniversal, err error) {
+ opts = append(r.Options[:], opts...)
+ var env UniversalSettingGetResponseEnvelope
+ path := fmt.Sprintf("zones/%s/ssl/universal/settings", query.ZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type TLSCertificatesAndHostnamesUniversal struct {
+ // Disabling Universal SSL removes any currently active Universal SSL certificates
+ // for your zone from the edge and prevents any future Universal SSL certificates
+ // from being ordered. If there are no advanced certificates or custom certificates
+ // uploaded for the domain, visitors will be unable to access the domain over
+ // HTTPS.
+ //
+ // By disabling Universal SSL, you understand that the following Cloudflare
+ // settings and preferences will result in visitors being unable to visit your
+ // domain unless you have uploaded a custom certificate or purchased an advanced
+ // certificate.
+ //
+ // - HSTS
+ // - Always Use HTTPS
+ // - Opportunistic Encryption
+ // - Onion Routing
+ // - Any Page Rules redirecting traffic to HTTPS
+ //
+ // Similarly, any HTTP redirect to HTTPS at the origin while the Cloudflare proxy
+ // is enabled will result in users being unable to visit your site without a valid
+ // certificate at Cloudflare's edge.
+ //
+ // If you do not have a valid custom or advanced certificate at Cloudflare's edge
+ // and are unsure if any of the above Cloudflare settings are enabled, or if any
+ // HTTP redirects exist at your origin, we advise leaving Universal SSL enabled for
+ // your domain.
+ Enabled bool `json:"enabled"`
+ JSON tlsCertificatesAndHostnamesUniversalJSON `json:"-"`
+}
+
+// tlsCertificatesAndHostnamesUniversalJSON contains the JSON metadata for the
+// struct [TLSCertificatesAndHostnamesUniversal]
+type tlsCertificatesAndHostnamesUniversalJSON struct {
+ Enabled apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *TLSCertificatesAndHostnamesUniversal) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r tlsCertificatesAndHostnamesUniversalJSON) RawJSON() string {
+ return r.raw
+}
+
+type UniversalSettingEditParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+ // Disabling Universal SSL removes any currently active Universal SSL certificates
+ // for your zone from the edge and prevents any future Universal SSL certificates
+ // from being ordered. If there are no advanced certificates or custom certificates
+ // uploaded for the domain, visitors will be unable to access the domain over
+ // HTTPS.
+ //
+ // By disabling Universal SSL, you understand that the following Cloudflare
+ // settings and preferences will result in visitors being unable to visit your
+ // domain unless you have uploaded a custom certificate or purchased an advanced
+ // certificate.
+ //
+ // - HSTS
+ // - Always Use HTTPS
+ // - Opportunistic Encryption
+ // - Onion Routing
+ // - Any Page Rules redirecting traffic to HTTPS
+ //
+ // Similarly, any HTTP redirect to HTTPS at the origin while the Cloudflare proxy
+ // is enabled will result in users being unable to visit your site without a valid
+ // certificate at Cloudflare's edge.
+ //
+ // If you do not have a valid custom or advanced certificate at Cloudflare's edge
+ // and are unsure if any of the above Cloudflare settings are enabled, or if any
+ // HTTP redirects exist at your origin, we advise leaving Universal SSL enabled for
+ // your domain.
+ Enabled param.Field[bool] `json:"enabled"`
+}
+
+func (r UniversalSettingEditParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type UniversalSettingEditResponseEnvelope struct {
+ Errors []UniversalSettingEditResponseEnvelopeErrors `json:"errors,required"`
+ Messages []UniversalSettingEditResponseEnvelopeMessages `json:"messages,required"`
+ Result TLSCertificatesAndHostnamesUniversal `json:"result,required"`
+ // Whether the API call was successful
+ Success UniversalSettingEditResponseEnvelopeSuccess `json:"success,required"`
+ JSON universalSettingEditResponseEnvelopeJSON `json:"-"`
+}
+
+// universalSettingEditResponseEnvelopeJSON contains the JSON metadata for the
+// struct [UniversalSettingEditResponseEnvelope]
+type universalSettingEditResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *UniversalSettingEditResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r universalSettingEditResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type UniversalSettingEditResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON universalSettingEditResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// universalSettingEditResponseEnvelopeErrorsJSON contains the JSON metadata for
+// the struct [UniversalSettingEditResponseEnvelopeErrors]
+type universalSettingEditResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *UniversalSettingEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r universalSettingEditResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type UniversalSettingEditResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON universalSettingEditResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// universalSettingEditResponseEnvelopeMessagesJSON contains the JSON metadata for
+// the struct [UniversalSettingEditResponseEnvelopeMessages]
+type universalSettingEditResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *UniversalSettingEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r universalSettingEditResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type UniversalSettingEditResponseEnvelopeSuccess bool
+
+const (
+ UniversalSettingEditResponseEnvelopeSuccessTrue UniversalSettingEditResponseEnvelopeSuccess = true
+)
+
+type UniversalSettingGetParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+}
+
+type UniversalSettingGetResponseEnvelope struct {
+ Errors []UniversalSettingGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []UniversalSettingGetResponseEnvelopeMessages `json:"messages,required"`
+ Result TLSCertificatesAndHostnamesUniversal `json:"result,required"`
+ // Whether the API call was successful
+ Success UniversalSettingGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON universalSettingGetResponseEnvelopeJSON `json:"-"`
+}
+
+// universalSettingGetResponseEnvelopeJSON contains the JSON metadata for the
+// struct [UniversalSettingGetResponseEnvelope]
+type universalSettingGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *UniversalSettingGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r universalSettingGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type UniversalSettingGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON universalSettingGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// universalSettingGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [UniversalSettingGetResponseEnvelopeErrors]
+type universalSettingGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *UniversalSettingGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r universalSettingGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type UniversalSettingGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON universalSettingGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// universalSettingGetResponseEnvelopeMessagesJSON contains the JSON metadata for
+// the struct [UniversalSettingGetResponseEnvelopeMessages]
+type universalSettingGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *UniversalSettingGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r universalSettingGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type UniversalSettingGetResponseEnvelopeSuccess bool
+
+const (
+ UniversalSettingGetResponseEnvelopeSuccessTrue UniversalSettingGetResponseEnvelopeSuccess = true
+)
diff --git a/ssl/universalsetting_test.go b/ssl/universalsetting_test.go
new file mode 100644
index 00000000000..0e662ca452c
--- /dev/null
+++ b/ssl/universalsetting_test.go
@@ -0,0 +1,68 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package ssl_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/ssl"
+)
+
+func TestUniversalSettingEditWithOptionalParams(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"),
+ )
+ _, err := client.SSL.Universal.Settings.Edit(context.TODO(), ssl.UniversalSettingEditParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Enabled: cloudflare.F(true),
+ })
+ 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())
+ }
+}
+
+func TestUniversalSettingGet(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"),
+ )
+ _, err := client.SSL.Universal.Settings.Get(context.TODO(), ssl.UniversalSettingGetParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ })
+ 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/ssl/verification.go b/ssl/verification.go
new file mode 100644
index 00000000000..794316573b7
--- /dev/null
+++ b/ssl/verification.go
@@ -0,0 +1,373 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package ssl
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// VerificationService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewVerificationService] method
+// instead.
+type VerificationService struct {
+ Options []option.RequestOption
+}
+
+// NewVerificationService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewVerificationService(opts ...option.RequestOption) (r *VerificationService) {
+ r = &VerificationService{}
+ r.Options = opts
+ return
+}
+
+// Edit SSL validation method for a certificate pack. A PATCH request will request
+// an immediate validation check on any certificate, and return the updated status.
+// If a validation method is provided, the validation will be immediately attempted
+// using that method.
+func (r *VerificationService) Edit(ctx context.Context, certificatePackID string, params VerificationEditParams, opts ...option.RequestOption) (res *VerificationEditResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env VerificationEditResponseEnvelope
+ path := fmt.Sprintf("zones/%s/ssl/verification/%s", params.ZoneID, certificatePackID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Get SSL Verification Info for a Zone.
+func (r *VerificationService) Get(ctx context.Context, params VerificationGetParams, opts ...option.RequestOption) (res *[]TLSCertificatesAndHostnamesVerification, err error) {
+ opts = append(r.Options[:], opts...)
+ var env VerificationGetResponseEnvelope
+ path := fmt.Sprintf("zones/%s/ssl/verification", params.ZoneID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type TLSCertificatesAndHostnamesVerification struct {
+ // Current status of certificate.
+ CertificateStatus TLSCertificatesAndHostnamesVerificationCertificateStatus `json:"certificate_status,required"`
+ // Certificate Authority is manually reviewing the order.
+ BrandCheck bool `json:"brand_check"`
+ // Certificate Pack UUID.
+ CertPackUUID string `json:"cert_pack_uuid"`
+ // Certificate's signature algorithm.
+ Signature TLSCertificatesAndHostnamesVerificationSignature `json:"signature"`
+ // Validation method in use for a certificate pack order.
+ ValidationMethod TLSCertificatesAndHostnamesVerificationValidationMethod `json:"validation_method"`
+ // Certificate's required verification information.
+ VerificationInfo TLSCertificatesAndHostnamesVerificationVerificationInfo `json:"verification_info"`
+ // Status of the required verification information, omitted if verification status
+ // is unknown.
+ VerificationStatus bool `json:"verification_status"`
+ // Method of verification.
+ VerificationType TLSCertificatesAndHostnamesVerificationVerificationType `json:"verification_type"`
+ JSON tlsCertificatesAndHostnamesVerificationJSON `json:"-"`
+}
+
+// tlsCertificatesAndHostnamesVerificationJSON contains the JSON metadata for the
+// struct [TLSCertificatesAndHostnamesVerification]
+type tlsCertificatesAndHostnamesVerificationJSON struct {
+ CertificateStatus apijson.Field
+ BrandCheck apijson.Field
+ CertPackUUID apijson.Field
+ Signature apijson.Field
+ ValidationMethod apijson.Field
+ VerificationInfo apijson.Field
+ VerificationStatus apijson.Field
+ VerificationType apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *TLSCertificatesAndHostnamesVerification) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r tlsCertificatesAndHostnamesVerificationJSON) RawJSON() string {
+ return r.raw
+}
+
+// Current status of certificate.
+type TLSCertificatesAndHostnamesVerificationCertificateStatus string
+
+const (
+ TLSCertificatesAndHostnamesVerificationCertificateStatusInitializing TLSCertificatesAndHostnamesVerificationCertificateStatus = "initializing"
+ TLSCertificatesAndHostnamesVerificationCertificateStatusAuthorizing TLSCertificatesAndHostnamesVerificationCertificateStatus = "authorizing"
+ TLSCertificatesAndHostnamesVerificationCertificateStatusActive TLSCertificatesAndHostnamesVerificationCertificateStatus = "active"
+ TLSCertificatesAndHostnamesVerificationCertificateStatusExpired TLSCertificatesAndHostnamesVerificationCertificateStatus = "expired"
+ TLSCertificatesAndHostnamesVerificationCertificateStatusIssuing TLSCertificatesAndHostnamesVerificationCertificateStatus = "issuing"
+ TLSCertificatesAndHostnamesVerificationCertificateStatusTimingOut TLSCertificatesAndHostnamesVerificationCertificateStatus = "timing_out"
+ TLSCertificatesAndHostnamesVerificationCertificateStatusPendingDeployment TLSCertificatesAndHostnamesVerificationCertificateStatus = "pending_deployment"
+)
+
+// Certificate's signature algorithm.
+type TLSCertificatesAndHostnamesVerificationSignature string
+
+const (
+ TLSCertificatesAndHostnamesVerificationSignatureEcdsaWithSha256 TLSCertificatesAndHostnamesVerificationSignature = "ECDSAWithSHA256"
+ TLSCertificatesAndHostnamesVerificationSignatureSha1WithRsa TLSCertificatesAndHostnamesVerificationSignature = "SHA1WithRSA"
+ TLSCertificatesAndHostnamesVerificationSignatureSha256WithRsa TLSCertificatesAndHostnamesVerificationSignature = "SHA256WithRSA"
+)
+
+// Validation method in use for a certificate pack order.
+type TLSCertificatesAndHostnamesVerificationValidationMethod string
+
+const (
+ TLSCertificatesAndHostnamesVerificationValidationMethodHTTP TLSCertificatesAndHostnamesVerificationValidationMethod = "http"
+ TLSCertificatesAndHostnamesVerificationValidationMethodCNAME TLSCertificatesAndHostnamesVerificationValidationMethod = "cname"
+ TLSCertificatesAndHostnamesVerificationValidationMethodTXT TLSCertificatesAndHostnamesVerificationValidationMethod = "txt"
+)
+
+// Certificate's required verification information.
+type TLSCertificatesAndHostnamesVerificationVerificationInfo struct {
+ // Name of CNAME record.
+ RecordName TLSCertificatesAndHostnamesVerificationVerificationInfoRecordName `json:"record_name"`
+ // Target of CNAME record.
+ RecordTarget TLSCertificatesAndHostnamesVerificationVerificationInfoRecordTarget `json:"record_target"`
+ JSON tlsCertificatesAndHostnamesVerificationVerificationInfoJSON `json:"-"`
+}
+
+// tlsCertificatesAndHostnamesVerificationVerificationInfoJSON contains the JSON
+// metadata for the struct
+// [TLSCertificatesAndHostnamesVerificationVerificationInfo]
+type tlsCertificatesAndHostnamesVerificationVerificationInfoJSON struct {
+ RecordName apijson.Field
+ RecordTarget apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *TLSCertificatesAndHostnamesVerificationVerificationInfo) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r tlsCertificatesAndHostnamesVerificationVerificationInfoJSON) RawJSON() string {
+ return r.raw
+}
+
+// Name of CNAME record.
+type TLSCertificatesAndHostnamesVerificationVerificationInfoRecordName string
+
+const (
+ TLSCertificatesAndHostnamesVerificationVerificationInfoRecordNameRecordName TLSCertificatesAndHostnamesVerificationVerificationInfoRecordName = "record_name"
+ TLSCertificatesAndHostnamesVerificationVerificationInfoRecordNameHTTPURL TLSCertificatesAndHostnamesVerificationVerificationInfoRecordName = "http_url"
+ TLSCertificatesAndHostnamesVerificationVerificationInfoRecordNameCNAME TLSCertificatesAndHostnamesVerificationVerificationInfoRecordName = "cname"
+ TLSCertificatesAndHostnamesVerificationVerificationInfoRecordNameTXTName TLSCertificatesAndHostnamesVerificationVerificationInfoRecordName = "txt_name"
+)
+
+// Target of CNAME record.
+type TLSCertificatesAndHostnamesVerificationVerificationInfoRecordTarget string
+
+const (
+ TLSCertificatesAndHostnamesVerificationVerificationInfoRecordTargetRecordValue TLSCertificatesAndHostnamesVerificationVerificationInfoRecordTarget = "record_value"
+ TLSCertificatesAndHostnamesVerificationVerificationInfoRecordTargetHTTPBody TLSCertificatesAndHostnamesVerificationVerificationInfoRecordTarget = "http_body"
+ TLSCertificatesAndHostnamesVerificationVerificationInfoRecordTargetCNAMETarget TLSCertificatesAndHostnamesVerificationVerificationInfoRecordTarget = "cname_target"
+ TLSCertificatesAndHostnamesVerificationVerificationInfoRecordTargetTXTValue TLSCertificatesAndHostnamesVerificationVerificationInfoRecordTarget = "txt_value"
+)
+
+// Method of verification.
+type TLSCertificatesAndHostnamesVerificationVerificationType string
+
+const (
+ TLSCertificatesAndHostnamesVerificationVerificationTypeCNAME TLSCertificatesAndHostnamesVerificationVerificationType = "cname"
+ TLSCertificatesAndHostnamesVerificationVerificationTypeMetaTag TLSCertificatesAndHostnamesVerificationVerificationType = "meta tag"
+)
+
+type VerificationEditResponse struct {
+ // Result status.
+ Status string `json:"status"`
+ // Desired validation method.
+ ValidationMethod VerificationEditResponseValidationMethod `json:"validation_method"`
+ JSON verificationEditResponseJSON `json:"-"`
+}
+
+// verificationEditResponseJSON contains the JSON metadata for the struct
+// [VerificationEditResponse]
+type verificationEditResponseJSON struct {
+ Status apijson.Field
+ ValidationMethod apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *VerificationEditResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r verificationEditResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+// Desired validation method.
+type VerificationEditResponseValidationMethod string
+
+const (
+ VerificationEditResponseValidationMethodHTTP VerificationEditResponseValidationMethod = "http"
+ VerificationEditResponseValidationMethodCNAME VerificationEditResponseValidationMethod = "cname"
+ VerificationEditResponseValidationMethodTXT VerificationEditResponseValidationMethod = "txt"
+ VerificationEditResponseValidationMethodEmail VerificationEditResponseValidationMethod = "email"
+)
+
+type VerificationEditParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+ // Desired validation method.
+ ValidationMethod param.Field[VerificationEditParamsValidationMethod] `json:"validation_method,required"`
+}
+
+func (r VerificationEditParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Desired validation method.
+type VerificationEditParamsValidationMethod string
+
+const (
+ VerificationEditParamsValidationMethodHTTP VerificationEditParamsValidationMethod = "http"
+ VerificationEditParamsValidationMethodCNAME VerificationEditParamsValidationMethod = "cname"
+ VerificationEditParamsValidationMethodTXT VerificationEditParamsValidationMethod = "txt"
+ VerificationEditParamsValidationMethodEmail VerificationEditParamsValidationMethod = "email"
+)
+
+type VerificationEditResponseEnvelope struct {
+ Errors []VerificationEditResponseEnvelopeErrors `json:"errors,required"`
+ Messages []VerificationEditResponseEnvelopeMessages `json:"messages,required"`
+ Result VerificationEditResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success VerificationEditResponseEnvelopeSuccess `json:"success,required"`
+ JSON verificationEditResponseEnvelopeJSON `json:"-"`
+}
+
+// verificationEditResponseEnvelopeJSON contains the JSON metadata for the struct
+// [VerificationEditResponseEnvelope]
+type verificationEditResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *VerificationEditResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r verificationEditResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type VerificationEditResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON verificationEditResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// verificationEditResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [VerificationEditResponseEnvelopeErrors]
+type verificationEditResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *VerificationEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r verificationEditResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type VerificationEditResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON verificationEditResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// verificationEditResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [VerificationEditResponseEnvelopeMessages]
+type verificationEditResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *VerificationEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r verificationEditResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type VerificationEditResponseEnvelopeSuccess bool
+
+const (
+ VerificationEditResponseEnvelopeSuccessTrue VerificationEditResponseEnvelopeSuccess = true
+)
+
+type VerificationGetParams struct {
+ // Identifier
+ ZoneID param.Field[string] `path:"zone_id,required"`
+ // Immediately retry SSL Verification.
+ Retry param.Field[VerificationGetParamsRetry] `query:"retry"`
+}
+
+// URLQuery serializes [VerificationGetParams]'s query parameters as `url.Values`.
+func (r VerificationGetParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Immediately retry SSL Verification.
+type VerificationGetParamsRetry bool
+
+const (
+ VerificationGetParamsRetryTrue VerificationGetParamsRetry = true
+)
+
+type VerificationGetResponseEnvelope struct {
+ Result []TLSCertificatesAndHostnamesVerification `json:"result"`
+ JSON verificationGetResponseEnvelopeJSON `json:"-"`
+}
+
+// verificationGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [VerificationGetResponseEnvelope]
+type verificationGetResponseEnvelopeJSON struct {
+ Result apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *VerificationGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r verificationGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
diff --git a/ssl/verification_test.go b/ssl/verification_test.go
new file mode 100644
index 00000000000..975210580dd
--- /dev/null
+++ b/ssl/verification_test.go
@@ -0,0 +1,73 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package ssl_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/ssl"
+)
+
+func TestVerificationEdit(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"),
+ )
+ _, err := client.SSL.Verification.Edit(
+ context.TODO(),
+ "a77f8bd7-3b47-46b4-a6f1-75cf98109948",
+ ssl.VerificationEditParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ ValidationMethod: cloudflare.F(ssl.VerificationEditParamsValidationMethodTXT),
+ },
+ )
+ 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())
+ }
+}
+
+func TestVerificationGetWithOptionalParams(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"),
+ )
+ _, err := client.SSL.Verification.Get(context.TODO(), ssl.VerificationGetParams{
+ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Retry: cloudflare.F(ssl.VerificationGetParamsRetryTrue),
+ })
+ 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/sslanalyze.go b/sslanalyze.go
deleted file mode 100644
index 0f0195afbd7..00000000000
--- a/sslanalyze.go
+++ /dev/null
@@ -1,173 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "reflect"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/option"
- "github.com/tidwall/gjson"
-)
-
-// SSLAnalyzeService contains methods and other services that help with interacting
-// with the cloudflare API. Note, unlike clients, this service does not read
-// variables from the environment automatically. You should not instantiate this
-// service directly, and instead use the [NewSSLAnalyzeService] method instead.
-type SSLAnalyzeService struct {
- Options []option.RequestOption
-}
-
-// NewSSLAnalyzeService generates a new service that applies the given options to
-// each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewSSLAnalyzeService(opts ...option.RequestOption) (r *SSLAnalyzeService) {
- r = &SSLAnalyzeService{}
- r.Options = opts
- return
-}
-
-// Returns the set of hostnames, the signature algorithm, and the expiration date
-// of the certificate.
-func (r *SSLAnalyzeService) New(ctx context.Context, params SSLAnalyzeNewParams, opts ...option.RequestOption) (res *SSLAnalyzeNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env SSLAnalyzeNewResponseEnvelope
- path := fmt.Sprintf("zones/%s/ssl/analyze", params.ZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Union satisfied by [SSLAnalyzeNewResponseUnknown] or [shared.UnionString].
-type SSLAnalyzeNewResponse interface {
- ImplementsSSLAnalyzeNewResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*SSLAnalyzeNewResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-type SSLAnalyzeNewParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
- // A ubiquitous bundle has the highest probability of being verified everywhere,
- // even by clients using outdated or unusual trust stores. An optimal bundle uses
- // the shortest chain and newest intermediates. And the force bundle verifies the
- // chain, but does not otherwise modify it.
- BundleMethod param.Field[SSLAnalyzeNewParamsBundleMethod] `json:"bundle_method"`
- // The zone's SSL certificate or certificate and the intermediate(s).
- Certificate param.Field[string] `json:"certificate"`
-}
-
-func (r SSLAnalyzeNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// A ubiquitous bundle has the highest probability of being verified everywhere,
-// even by clients using outdated or unusual trust stores. An optimal bundle uses
-// the shortest chain and newest intermediates. And the force bundle verifies the
-// chain, but does not otherwise modify it.
-type SSLAnalyzeNewParamsBundleMethod string
-
-const (
- SSLAnalyzeNewParamsBundleMethodUbiquitous SSLAnalyzeNewParamsBundleMethod = "ubiquitous"
- SSLAnalyzeNewParamsBundleMethodOptimal SSLAnalyzeNewParamsBundleMethod = "optimal"
- SSLAnalyzeNewParamsBundleMethodForce SSLAnalyzeNewParamsBundleMethod = "force"
-)
-
-type SSLAnalyzeNewResponseEnvelope struct {
- Errors []SSLAnalyzeNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []SSLAnalyzeNewResponseEnvelopeMessages `json:"messages,required"`
- Result SSLAnalyzeNewResponse `json:"result,required"`
- // Whether the API call was successful
- Success SSLAnalyzeNewResponseEnvelopeSuccess `json:"success,required"`
- JSON sslAnalyzeNewResponseEnvelopeJSON `json:"-"`
-}
-
-// sslAnalyzeNewResponseEnvelopeJSON contains the JSON metadata for the struct
-// [SSLAnalyzeNewResponseEnvelope]
-type sslAnalyzeNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SSLAnalyzeNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r sslAnalyzeNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type SSLAnalyzeNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON sslAnalyzeNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// sslAnalyzeNewResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [SSLAnalyzeNewResponseEnvelopeErrors]
-type sslAnalyzeNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SSLAnalyzeNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r sslAnalyzeNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type SSLAnalyzeNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON sslAnalyzeNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// sslAnalyzeNewResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [SSLAnalyzeNewResponseEnvelopeMessages]
-type sslAnalyzeNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SSLAnalyzeNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r sslAnalyzeNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type SSLAnalyzeNewResponseEnvelopeSuccess bool
-
-const (
- SSLAnalyzeNewResponseEnvelopeSuccessTrue SSLAnalyzeNewResponseEnvelopeSuccess = true
-)
diff --git a/sslanalyze_test.go b/sslanalyze_test.go
deleted file mode 100644
index 9887d5411ff..00000000000
--- a/sslanalyze_test.go
+++ /dev/null
@@ -1,42 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestSSLAnalyzeNewWithOptionalParams(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"),
- )
- _, err := client.SSL.Analyze.New(context.TODO(), cloudflare.SSLAnalyzeNewParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- BundleMethod: cloudflare.F(cloudflare.SSLAnalyzeNewParamsBundleMethodUbiquitous),
- Certificate: cloudflare.F("-----BEGIN CERTIFICATE-----\nMIIDtTCCAp2gAwIBAgIJAMHAwfXZ5/PWMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV\nBAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX\naWRnaXRzIFB0eSBMdGQwHhcNMTYwODI0MTY0MzAxWhcNMTYxMTIyMTY0MzAxWjBF\nMQswCQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50\nZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB\nCgKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmGdtcGbg/1\nCGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKnabIRuGvB\nKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpidtnKX/a+5\n0GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+pyFxIXjbEI\ndZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pEewooaeO2\nizNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABo4GnMIGkMB0GA1UdDgQWBBT/LbE4\n9rWf288N6sJA5BRb6FJIGDB1BgNVHSMEbjBsgBT/LbE49rWf288N6sJA5BRb6FJI\nGKFJpEcwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNV\nBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAMHAwfXZ5/PWMAwGA1UdEwQF\nMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAHHFwl0tH0quUYZYO0dZYt4R7SJ0pCm2\n2satiyzHl4OnXcHDpekAo7/a09c6Lz6AU83cKy/+x3/djYHXWba7HpEu0dR3ugQP\nMlr4zrhd9xKZ0KZKiYmtJH+ak4OM4L3FbT0owUZPyjLSlhMtJVcoRp5CJsjAMBUG\nSvD8RX+T01wzox/Qb+lnnNnOlaWpqu8eoOenybxKp1a9ULzIVvN/LAcc+14vioFq\n2swRWtmocBAs8QR9n4uvbpiYvS8eYueDCWMM4fvFfBhaDZ3N9IbtySh3SpFdQDhw\nYbjM2rxXiyLGxB4Bol7QTv4zHif7Zt89FReT/NBy4rzaskDJY5L6xmY=\n-----END CERTIFICATE-----\n"),
- })
- 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/sslcertificatepack.go b/sslcertificatepack.go
deleted file mode 100644
index a5d2a2e3538..00000000000
--- a/sslcertificatepack.go
+++ /dev/null
@@ -1,641 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
- "reflect"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/option"
- "github.com/tidwall/gjson"
-)
-
-// SSLCertificatePackService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewSSLCertificatePackService] method
-// instead.
-type SSLCertificatePackService struct {
- Options []option.RequestOption
- Order *SSLCertificatePackOrderService
- Quota *SSLCertificatePackQuotaService
-}
-
-// NewSSLCertificatePackService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewSSLCertificatePackService(opts ...option.RequestOption) (r *SSLCertificatePackService) {
- r = &SSLCertificatePackService{}
- r.Options = opts
- r.Order = NewSSLCertificatePackOrderService(opts...)
- r.Quota = NewSSLCertificatePackQuotaService(opts...)
- return
-}
-
-// For a given zone, list all active certificate packs.
-func (r *SSLCertificatePackService) List(ctx context.Context, params SSLCertificatePackListParams, opts ...option.RequestOption) (res *[]SSLCertificatePackListResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env SSLCertificatePackListResponseEnvelope
- path := fmt.Sprintf("zones/%s/ssl/certificate_packs", params.ZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// For a given zone, delete an advanced certificate pack.
-func (r *SSLCertificatePackService) Delete(ctx context.Context, certificatePackID string, body SSLCertificatePackDeleteParams, opts ...option.RequestOption) (res *SSLCertificatePackDeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env SSLCertificatePackDeleteResponseEnvelope
- path := fmt.Sprintf("zones/%s/ssl/certificate_packs/%s", body.ZoneID, certificatePackID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// For a given zone, restart validation for an advanced certificate pack. This is
-// only a validation operation for a Certificate Pack in a validation_timed_out
-// status.
-func (r *SSLCertificatePackService) Edit(ctx context.Context, certificatePackID string, body SSLCertificatePackEditParams, opts ...option.RequestOption) (res *SSLCertificatePackEditResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env SSLCertificatePackEditResponseEnvelope
- path := fmt.Sprintf("zones/%s/ssl/certificate_packs/%s", body.ZoneID, certificatePackID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// For a given zone, get a certificate pack.
-func (r *SSLCertificatePackService) Get(ctx context.Context, certificatePackID string, query SSLCertificatePackGetParams, opts ...option.RequestOption) (res *SSLCertificatePackGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env SSLCertificatePackGetResponseEnvelope
- path := fmt.Sprintf("zones/%s/ssl/certificate_packs/%s", query.ZoneID, certificatePackID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type SSLCertificatePackListResponse = interface{}
-
-type SSLCertificatePackDeleteResponse struct {
- // Identifier
- ID string `json:"id"`
- JSON sslCertificatePackDeleteResponseJSON `json:"-"`
-}
-
-// sslCertificatePackDeleteResponseJSON contains the JSON metadata for the struct
-// [SSLCertificatePackDeleteResponse]
-type sslCertificatePackDeleteResponseJSON struct {
- ID apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SSLCertificatePackDeleteResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r sslCertificatePackDeleteResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type SSLCertificatePackEditResponse struct {
- // Identifier
- ID string `json:"id"`
- // Certificate Authority selected for the order. For information on any certificate
- // authority specific details or restrictions
- // [see this page for more details.](https://developers.cloudflare.com/ssl/reference/certificate-authorities)
- CertificateAuthority SSLCertificatePackEditResponseCertificateAuthority `json:"certificate_authority"`
- // Whether or not to add Cloudflare Branding for the order. This will add
- // sni.cloudflaressl.com as the Common Name if set true.
- CloudflareBranding bool `json:"cloudflare_branding"`
- // Comma separated list of valid host names for the certificate packs. Must contain
- // the zone apex, may not contain more than 50 hosts, and may not be empty.
- Hosts []string `json:"hosts"`
- // Status of certificate pack.
- Status SSLCertificatePackEditResponseStatus `json:"status"`
- // Type of certificate pack.
- Type SSLCertificatePackEditResponseType `json:"type"`
- // Validation Method selected for the order.
- ValidationMethod SSLCertificatePackEditResponseValidationMethod `json:"validation_method"`
- // Validity Days selected for the order.
- ValidityDays SSLCertificatePackEditResponseValidityDays `json:"validity_days"`
- JSON sslCertificatePackEditResponseJSON `json:"-"`
-}
-
-// sslCertificatePackEditResponseJSON contains the JSON metadata for the struct
-// [SSLCertificatePackEditResponse]
-type sslCertificatePackEditResponseJSON struct {
- ID apijson.Field
- CertificateAuthority apijson.Field
- CloudflareBranding apijson.Field
- Hosts apijson.Field
- Status apijson.Field
- Type apijson.Field
- ValidationMethod apijson.Field
- ValidityDays apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SSLCertificatePackEditResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r sslCertificatePackEditResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// Certificate Authority selected for the order. For information on any certificate
-// authority specific details or restrictions
-// [see this page for more details.](https://developers.cloudflare.com/ssl/reference/certificate-authorities)
-type SSLCertificatePackEditResponseCertificateAuthority string
-
-const (
- SSLCertificatePackEditResponseCertificateAuthorityGoogle SSLCertificatePackEditResponseCertificateAuthority = "google"
- SSLCertificatePackEditResponseCertificateAuthorityLetsEncrypt SSLCertificatePackEditResponseCertificateAuthority = "lets_encrypt"
-)
-
-// Status of certificate pack.
-type SSLCertificatePackEditResponseStatus string
-
-const (
- SSLCertificatePackEditResponseStatusInitializing SSLCertificatePackEditResponseStatus = "initializing"
- SSLCertificatePackEditResponseStatusPendingValidation SSLCertificatePackEditResponseStatus = "pending_validation"
- SSLCertificatePackEditResponseStatusDeleted SSLCertificatePackEditResponseStatus = "deleted"
- SSLCertificatePackEditResponseStatusPendingIssuance SSLCertificatePackEditResponseStatus = "pending_issuance"
- SSLCertificatePackEditResponseStatusPendingDeployment SSLCertificatePackEditResponseStatus = "pending_deployment"
- SSLCertificatePackEditResponseStatusPendingDeletion SSLCertificatePackEditResponseStatus = "pending_deletion"
- SSLCertificatePackEditResponseStatusPendingExpiration SSLCertificatePackEditResponseStatus = "pending_expiration"
- SSLCertificatePackEditResponseStatusExpired SSLCertificatePackEditResponseStatus = "expired"
- SSLCertificatePackEditResponseStatusActive SSLCertificatePackEditResponseStatus = "active"
- SSLCertificatePackEditResponseStatusInitializingTimedOut SSLCertificatePackEditResponseStatus = "initializing_timed_out"
- SSLCertificatePackEditResponseStatusValidationTimedOut SSLCertificatePackEditResponseStatus = "validation_timed_out"
- SSLCertificatePackEditResponseStatusIssuanceTimedOut SSLCertificatePackEditResponseStatus = "issuance_timed_out"
- SSLCertificatePackEditResponseStatusDeploymentTimedOut SSLCertificatePackEditResponseStatus = "deployment_timed_out"
- SSLCertificatePackEditResponseStatusDeletionTimedOut SSLCertificatePackEditResponseStatus = "deletion_timed_out"
- SSLCertificatePackEditResponseStatusPendingCleanup SSLCertificatePackEditResponseStatus = "pending_cleanup"
- SSLCertificatePackEditResponseStatusStagingDeployment SSLCertificatePackEditResponseStatus = "staging_deployment"
- SSLCertificatePackEditResponseStatusStagingActive SSLCertificatePackEditResponseStatus = "staging_active"
- SSLCertificatePackEditResponseStatusDeactivating SSLCertificatePackEditResponseStatus = "deactivating"
- SSLCertificatePackEditResponseStatusInactive SSLCertificatePackEditResponseStatus = "inactive"
- SSLCertificatePackEditResponseStatusBackupIssued SSLCertificatePackEditResponseStatus = "backup_issued"
- SSLCertificatePackEditResponseStatusHoldingDeployment SSLCertificatePackEditResponseStatus = "holding_deployment"
-)
-
-// Type of certificate pack.
-type SSLCertificatePackEditResponseType string
-
-const (
- SSLCertificatePackEditResponseTypeAdvanced SSLCertificatePackEditResponseType = "advanced"
-)
-
-// Validation Method selected for the order.
-type SSLCertificatePackEditResponseValidationMethod string
-
-const (
- SSLCertificatePackEditResponseValidationMethodTXT SSLCertificatePackEditResponseValidationMethod = "txt"
- SSLCertificatePackEditResponseValidationMethodHTTP SSLCertificatePackEditResponseValidationMethod = "http"
- SSLCertificatePackEditResponseValidationMethodEmail SSLCertificatePackEditResponseValidationMethod = "email"
-)
-
-// Validity Days selected for the order.
-type SSLCertificatePackEditResponseValidityDays int64
-
-const (
- SSLCertificatePackEditResponseValidityDays14 SSLCertificatePackEditResponseValidityDays = 14
- SSLCertificatePackEditResponseValidityDays30 SSLCertificatePackEditResponseValidityDays = 30
- SSLCertificatePackEditResponseValidityDays90 SSLCertificatePackEditResponseValidityDays = 90
- SSLCertificatePackEditResponseValidityDays365 SSLCertificatePackEditResponseValidityDays = 365
-)
-
-// Union satisfied by [SSLCertificatePackGetResponseUnknown] or
-// [shared.UnionString].
-type SSLCertificatePackGetResponse interface {
- ImplementsSSLCertificatePackGetResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*SSLCertificatePackGetResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-type SSLCertificatePackListParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
- // Include Certificate Packs of all statuses, not just active ones.
- Status param.Field[SSLCertificatePackListParamsStatus] `query:"status"`
-}
-
-// URLQuery serializes [SSLCertificatePackListParams]'s query parameters as
-// `url.Values`.
-func (r SSLCertificatePackListParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Include Certificate Packs of all statuses, not just active ones.
-type SSLCertificatePackListParamsStatus string
-
-const (
- SSLCertificatePackListParamsStatusAll SSLCertificatePackListParamsStatus = "all"
-)
-
-type SSLCertificatePackListResponseEnvelope struct {
- Errors []SSLCertificatePackListResponseEnvelopeErrors `json:"errors,required"`
- Messages []SSLCertificatePackListResponseEnvelopeMessages `json:"messages,required"`
- Result []SSLCertificatePackListResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success SSLCertificatePackListResponseEnvelopeSuccess `json:"success,required"`
- ResultInfo SSLCertificatePackListResponseEnvelopeResultInfo `json:"result_info"`
- JSON sslCertificatePackListResponseEnvelopeJSON `json:"-"`
-}
-
-// sslCertificatePackListResponseEnvelopeJSON contains the JSON metadata for the
-// struct [SSLCertificatePackListResponseEnvelope]
-type sslCertificatePackListResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- ResultInfo apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SSLCertificatePackListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r sslCertificatePackListResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type SSLCertificatePackListResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON sslCertificatePackListResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// sslCertificatePackListResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [SSLCertificatePackListResponseEnvelopeErrors]
-type sslCertificatePackListResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SSLCertificatePackListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r sslCertificatePackListResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type SSLCertificatePackListResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON sslCertificatePackListResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// sslCertificatePackListResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [SSLCertificatePackListResponseEnvelopeMessages]
-type sslCertificatePackListResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SSLCertificatePackListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r sslCertificatePackListResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type SSLCertificatePackListResponseEnvelopeSuccess bool
-
-const (
- SSLCertificatePackListResponseEnvelopeSuccessTrue SSLCertificatePackListResponseEnvelopeSuccess = true
-)
-
-type SSLCertificatePackListResponseEnvelopeResultInfo struct {
- // Total number of results for the requested service
- Count float64 `json:"count"`
- // Current page within paginated list of results
- Page float64 `json:"page"`
- // Number of results per page of results
- PerPage float64 `json:"per_page"`
- // Total results available without any search parameters
- TotalCount float64 `json:"total_count"`
- JSON sslCertificatePackListResponseEnvelopeResultInfoJSON `json:"-"`
-}
-
-// sslCertificatePackListResponseEnvelopeResultInfoJSON contains the JSON metadata
-// for the struct [SSLCertificatePackListResponseEnvelopeResultInfo]
-type sslCertificatePackListResponseEnvelopeResultInfoJSON struct {
- Count apijson.Field
- Page apijson.Field
- PerPage apijson.Field
- TotalCount apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SSLCertificatePackListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r sslCertificatePackListResponseEnvelopeResultInfoJSON) RawJSON() string {
- return r.raw
-}
-
-type SSLCertificatePackDeleteParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
-}
-
-type SSLCertificatePackDeleteResponseEnvelope struct {
- Errors []SSLCertificatePackDeleteResponseEnvelopeErrors `json:"errors,required"`
- Messages []SSLCertificatePackDeleteResponseEnvelopeMessages `json:"messages,required"`
- Result SSLCertificatePackDeleteResponse `json:"result,required"`
- // Whether the API call was successful
- Success SSLCertificatePackDeleteResponseEnvelopeSuccess `json:"success,required"`
- JSON sslCertificatePackDeleteResponseEnvelopeJSON `json:"-"`
-}
-
-// sslCertificatePackDeleteResponseEnvelopeJSON contains the JSON metadata for the
-// struct [SSLCertificatePackDeleteResponseEnvelope]
-type sslCertificatePackDeleteResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SSLCertificatePackDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r sslCertificatePackDeleteResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type SSLCertificatePackDeleteResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON sslCertificatePackDeleteResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// sslCertificatePackDeleteResponseEnvelopeErrorsJSON contains the JSON metadata
-// for the struct [SSLCertificatePackDeleteResponseEnvelopeErrors]
-type sslCertificatePackDeleteResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SSLCertificatePackDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r sslCertificatePackDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type SSLCertificatePackDeleteResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON sslCertificatePackDeleteResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// sslCertificatePackDeleteResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [SSLCertificatePackDeleteResponseEnvelopeMessages]
-type sslCertificatePackDeleteResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SSLCertificatePackDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r sslCertificatePackDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type SSLCertificatePackDeleteResponseEnvelopeSuccess bool
-
-const (
- SSLCertificatePackDeleteResponseEnvelopeSuccessTrue SSLCertificatePackDeleteResponseEnvelopeSuccess = true
-)
-
-type SSLCertificatePackEditParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
-}
-
-type SSLCertificatePackEditResponseEnvelope struct {
- Errors []SSLCertificatePackEditResponseEnvelopeErrors `json:"errors,required"`
- Messages []SSLCertificatePackEditResponseEnvelopeMessages `json:"messages,required"`
- Result SSLCertificatePackEditResponse `json:"result,required"`
- // Whether the API call was successful
- Success SSLCertificatePackEditResponseEnvelopeSuccess `json:"success,required"`
- JSON sslCertificatePackEditResponseEnvelopeJSON `json:"-"`
-}
-
-// sslCertificatePackEditResponseEnvelopeJSON contains the JSON metadata for the
-// struct [SSLCertificatePackEditResponseEnvelope]
-type sslCertificatePackEditResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SSLCertificatePackEditResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r sslCertificatePackEditResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type SSLCertificatePackEditResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON sslCertificatePackEditResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// sslCertificatePackEditResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [SSLCertificatePackEditResponseEnvelopeErrors]
-type sslCertificatePackEditResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SSLCertificatePackEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r sslCertificatePackEditResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type SSLCertificatePackEditResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON sslCertificatePackEditResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// sslCertificatePackEditResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [SSLCertificatePackEditResponseEnvelopeMessages]
-type sslCertificatePackEditResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SSLCertificatePackEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r sslCertificatePackEditResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type SSLCertificatePackEditResponseEnvelopeSuccess bool
-
-const (
- SSLCertificatePackEditResponseEnvelopeSuccessTrue SSLCertificatePackEditResponseEnvelopeSuccess = true
-)
-
-type SSLCertificatePackGetParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
-}
-
-type SSLCertificatePackGetResponseEnvelope struct {
- Errors []SSLCertificatePackGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []SSLCertificatePackGetResponseEnvelopeMessages `json:"messages,required"`
- Result SSLCertificatePackGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success SSLCertificatePackGetResponseEnvelopeSuccess `json:"success,required"`
- JSON sslCertificatePackGetResponseEnvelopeJSON `json:"-"`
-}
-
-// sslCertificatePackGetResponseEnvelopeJSON contains the JSON metadata for the
-// struct [SSLCertificatePackGetResponseEnvelope]
-type sslCertificatePackGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SSLCertificatePackGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r sslCertificatePackGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type SSLCertificatePackGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON sslCertificatePackGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// sslCertificatePackGetResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [SSLCertificatePackGetResponseEnvelopeErrors]
-type sslCertificatePackGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SSLCertificatePackGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r sslCertificatePackGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type SSLCertificatePackGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON sslCertificatePackGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// sslCertificatePackGetResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [SSLCertificatePackGetResponseEnvelopeMessages]
-type sslCertificatePackGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SSLCertificatePackGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r sslCertificatePackGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type SSLCertificatePackGetResponseEnvelopeSuccess bool
-
-const (
- SSLCertificatePackGetResponseEnvelopeSuccessTrue SSLCertificatePackGetResponseEnvelopeSuccess = true
-)
diff --git a/sslcertificatepack_test.go b/sslcertificatepack_test.go
deleted file mode 100644
index e4fafbded8c..00000000000
--- a/sslcertificatepack_test.go
+++ /dev/null
@@ -1,131 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestSSLCertificatePackListWithOptionalParams(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"),
- )
- _, err := client.SSL.CertificatePacks.List(context.TODO(), cloudflare.SSLCertificatePackListParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Status: cloudflare.F(cloudflare.SSLCertificatePackListParamsStatusAll),
- })
- 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())
- }
-}
-
-func TestSSLCertificatePackDelete(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"),
- )
- _, err := client.SSL.CertificatePacks.Delete(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.SSLCertificatePackDeleteParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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())
- }
-}
-
-func TestSSLCertificatePackEdit(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"),
- )
- _, err := client.SSL.CertificatePacks.Edit(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.SSLCertificatePackEditParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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())
- }
-}
-
-func TestSSLCertificatePackGet(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"),
- )
- _, err := client.SSL.CertificatePacks.Get(
- context.TODO(),
- "023e105f4ecef8ad9ca31a8372d0c353",
- cloudflare.SSLCertificatePackGetParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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/sslcertificatepackorder.go b/sslcertificatepackorder.go
deleted file mode 100644
index 4a553dd9f7c..00000000000
--- a/sslcertificatepackorder.go
+++ /dev/null
@@ -1,297 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// SSLCertificatePackOrderService contains methods and other services that help
-// with interacting with the cloudflare API. Note, unlike clients, this service
-// does not read variables from the environment automatically. You should not
-// instantiate this service directly, and instead use the
-// [NewSSLCertificatePackOrderService] method instead.
-type SSLCertificatePackOrderService struct {
- Options []option.RequestOption
-}
-
-// NewSSLCertificatePackOrderService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewSSLCertificatePackOrderService(opts ...option.RequestOption) (r *SSLCertificatePackOrderService) {
- r = &SSLCertificatePackOrderService{}
- r.Options = opts
- return
-}
-
-// For a given zone, order an advanced certificate pack.
-func (r *SSLCertificatePackOrderService) New(ctx context.Context, params SSLCertificatePackOrderNewParams, opts ...option.RequestOption) (res *SSLCertificatePackOrderNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env SSLCertificatePackOrderNewResponseEnvelope
- path := fmt.Sprintf("zones/%s/ssl/certificate_packs/order", params.ZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type SSLCertificatePackOrderNewResponse struct {
- // Identifier
- ID string `json:"id"`
- // Certificate Authority selected for the order. For information on any certificate
- // authority specific details or restrictions
- // [see this page for more details.](https://developers.cloudflare.com/ssl/reference/certificate-authorities)
- CertificateAuthority SSLCertificatePackOrderNewResponseCertificateAuthority `json:"certificate_authority"`
- // Whether or not to add Cloudflare Branding for the order. This will add
- // sni.cloudflaressl.com as the Common Name if set true.
- CloudflareBranding bool `json:"cloudflare_branding"`
- // Comma separated list of valid host names for the certificate packs. Must contain
- // the zone apex, may not contain more than 50 hosts, and may not be empty.
- Hosts []string `json:"hosts"`
- // Status of certificate pack.
- Status SSLCertificatePackOrderNewResponseStatus `json:"status"`
- // Type of certificate pack.
- Type SSLCertificatePackOrderNewResponseType `json:"type"`
- // Validation Method selected for the order.
- ValidationMethod SSLCertificatePackOrderNewResponseValidationMethod `json:"validation_method"`
- // Validity Days selected for the order.
- ValidityDays SSLCertificatePackOrderNewResponseValidityDays `json:"validity_days"`
- JSON sslCertificatePackOrderNewResponseJSON `json:"-"`
-}
-
-// sslCertificatePackOrderNewResponseJSON contains the JSON metadata for the struct
-// [SSLCertificatePackOrderNewResponse]
-type sslCertificatePackOrderNewResponseJSON struct {
- ID apijson.Field
- CertificateAuthority apijson.Field
- CloudflareBranding apijson.Field
- Hosts apijson.Field
- Status apijson.Field
- Type apijson.Field
- ValidationMethod apijson.Field
- ValidityDays apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SSLCertificatePackOrderNewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r sslCertificatePackOrderNewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// Certificate Authority selected for the order. For information on any certificate
-// authority specific details or restrictions
-// [see this page for more details.](https://developers.cloudflare.com/ssl/reference/certificate-authorities)
-type SSLCertificatePackOrderNewResponseCertificateAuthority string
-
-const (
- SSLCertificatePackOrderNewResponseCertificateAuthorityGoogle SSLCertificatePackOrderNewResponseCertificateAuthority = "google"
- SSLCertificatePackOrderNewResponseCertificateAuthorityLetsEncrypt SSLCertificatePackOrderNewResponseCertificateAuthority = "lets_encrypt"
-)
-
-// Status of certificate pack.
-type SSLCertificatePackOrderNewResponseStatus string
-
-const (
- SSLCertificatePackOrderNewResponseStatusInitializing SSLCertificatePackOrderNewResponseStatus = "initializing"
- SSLCertificatePackOrderNewResponseStatusPendingValidation SSLCertificatePackOrderNewResponseStatus = "pending_validation"
- SSLCertificatePackOrderNewResponseStatusDeleted SSLCertificatePackOrderNewResponseStatus = "deleted"
- SSLCertificatePackOrderNewResponseStatusPendingIssuance SSLCertificatePackOrderNewResponseStatus = "pending_issuance"
- SSLCertificatePackOrderNewResponseStatusPendingDeployment SSLCertificatePackOrderNewResponseStatus = "pending_deployment"
- SSLCertificatePackOrderNewResponseStatusPendingDeletion SSLCertificatePackOrderNewResponseStatus = "pending_deletion"
- SSLCertificatePackOrderNewResponseStatusPendingExpiration SSLCertificatePackOrderNewResponseStatus = "pending_expiration"
- SSLCertificatePackOrderNewResponseStatusExpired SSLCertificatePackOrderNewResponseStatus = "expired"
- SSLCertificatePackOrderNewResponseStatusActive SSLCertificatePackOrderNewResponseStatus = "active"
- SSLCertificatePackOrderNewResponseStatusInitializingTimedOut SSLCertificatePackOrderNewResponseStatus = "initializing_timed_out"
- SSLCertificatePackOrderNewResponseStatusValidationTimedOut SSLCertificatePackOrderNewResponseStatus = "validation_timed_out"
- SSLCertificatePackOrderNewResponseStatusIssuanceTimedOut SSLCertificatePackOrderNewResponseStatus = "issuance_timed_out"
- SSLCertificatePackOrderNewResponseStatusDeploymentTimedOut SSLCertificatePackOrderNewResponseStatus = "deployment_timed_out"
- SSLCertificatePackOrderNewResponseStatusDeletionTimedOut SSLCertificatePackOrderNewResponseStatus = "deletion_timed_out"
- SSLCertificatePackOrderNewResponseStatusPendingCleanup SSLCertificatePackOrderNewResponseStatus = "pending_cleanup"
- SSLCertificatePackOrderNewResponseStatusStagingDeployment SSLCertificatePackOrderNewResponseStatus = "staging_deployment"
- SSLCertificatePackOrderNewResponseStatusStagingActive SSLCertificatePackOrderNewResponseStatus = "staging_active"
- SSLCertificatePackOrderNewResponseStatusDeactivating SSLCertificatePackOrderNewResponseStatus = "deactivating"
- SSLCertificatePackOrderNewResponseStatusInactive SSLCertificatePackOrderNewResponseStatus = "inactive"
- SSLCertificatePackOrderNewResponseStatusBackupIssued SSLCertificatePackOrderNewResponseStatus = "backup_issued"
- SSLCertificatePackOrderNewResponseStatusHoldingDeployment SSLCertificatePackOrderNewResponseStatus = "holding_deployment"
-)
-
-// Type of certificate pack.
-type SSLCertificatePackOrderNewResponseType string
-
-const (
- SSLCertificatePackOrderNewResponseTypeAdvanced SSLCertificatePackOrderNewResponseType = "advanced"
-)
-
-// Validation Method selected for the order.
-type SSLCertificatePackOrderNewResponseValidationMethod string
-
-const (
- SSLCertificatePackOrderNewResponseValidationMethodTXT SSLCertificatePackOrderNewResponseValidationMethod = "txt"
- SSLCertificatePackOrderNewResponseValidationMethodHTTP SSLCertificatePackOrderNewResponseValidationMethod = "http"
- SSLCertificatePackOrderNewResponseValidationMethodEmail SSLCertificatePackOrderNewResponseValidationMethod = "email"
-)
-
-// Validity Days selected for the order.
-type SSLCertificatePackOrderNewResponseValidityDays int64
-
-const (
- SSLCertificatePackOrderNewResponseValidityDays14 SSLCertificatePackOrderNewResponseValidityDays = 14
- SSLCertificatePackOrderNewResponseValidityDays30 SSLCertificatePackOrderNewResponseValidityDays = 30
- SSLCertificatePackOrderNewResponseValidityDays90 SSLCertificatePackOrderNewResponseValidityDays = 90
- SSLCertificatePackOrderNewResponseValidityDays365 SSLCertificatePackOrderNewResponseValidityDays = 365
-)
-
-type SSLCertificatePackOrderNewParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
- // Certificate Authority selected for the order. For information on any certificate
- // authority specific details or restrictions
- // [see this page for more details.](https://developers.cloudflare.com/ssl/reference/certificate-authorities)
- CertificateAuthority param.Field[SSLCertificatePackOrderNewParamsCertificateAuthority] `json:"certificate_authority,required"`
- // Comma separated list of valid host names for the certificate packs. Must contain
- // the zone apex, may not contain more than 50 hosts, and may not be empty.
- Hosts param.Field[[]string] `json:"hosts,required"`
- // Type of certificate pack.
- Type param.Field[SSLCertificatePackOrderNewParamsType] `json:"type,required"`
- // Validation Method selected for the order.
- ValidationMethod param.Field[SSLCertificatePackOrderNewParamsValidationMethod] `json:"validation_method,required"`
- // Validity Days selected for the order.
- ValidityDays param.Field[SSLCertificatePackOrderNewParamsValidityDays] `json:"validity_days,required"`
- // Whether or not to add Cloudflare Branding for the order. This will add
- // sni.cloudflaressl.com as the Common Name if set true.
- CloudflareBranding param.Field[bool] `json:"cloudflare_branding"`
-}
-
-func (r SSLCertificatePackOrderNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Certificate Authority selected for the order. For information on any certificate
-// authority specific details or restrictions
-// [see this page for more details.](https://developers.cloudflare.com/ssl/reference/certificate-authorities)
-type SSLCertificatePackOrderNewParamsCertificateAuthority string
-
-const (
- SSLCertificatePackOrderNewParamsCertificateAuthorityGoogle SSLCertificatePackOrderNewParamsCertificateAuthority = "google"
- SSLCertificatePackOrderNewParamsCertificateAuthorityLetsEncrypt SSLCertificatePackOrderNewParamsCertificateAuthority = "lets_encrypt"
-)
-
-// Type of certificate pack.
-type SSLCertificatePackOrderNewParamsType string
-
-const (
- SSLCertificatePackOrderNewParamsTypeAdvanced SSLCertificatePackOrderNewParamsType = "advanced"
-)
-
-// Validation Method selected for the order.
-type SSLCertificatePackOrderNewParamsValidationMethod string
-
-const (
- SSLCertificatePackOrderNewParamsValidationMethodTXT SSLCertificatePackOrderNewParamsValidationMethod = "txt"
- SSLCertificatePackOrderNewParamsValidationMethodHTTP SSLCertificatePackOrderNewParamsValidationMethod = "http"
- SSLCertificatePackOrderNewParamsValidationMethodEmail SSLCertificatePackOrderNewParamsValidationMethod = "email"
-)
-
-// Validity Days selected for the order.
-type SSLCertificatePackOrderNewParamsValidityDays int64
-
-const (
- SSLCertificatePackOrderNewParamsValidityDays14 SSLCertificatePackOrderNewParamsValidityDays = 14
- SSLCertificatePackOrderNewParamsValidityDays30 SSLCertificatePackOrderNewParamsValidityDays = 30
- SSLCertificatePackOrderNewParamsValidityDays90 SSLCertificatePackOrderNewParamsValidityDays = 90
- SSLCertificatePackOrderNewParamsValidityDays365 SSLCertificatePackOrderNewParamsValidityDays = 365
-)
-
-type SSLCertificatePackOrderNewResponseEnvelope struct {
- Errors []SSLCertificatePackOrderNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []SSLCertificatePackOrderNewResponseEnvelopeMessages `json:"messages,required"`
- Result SSLCertificatePackOrderNewResponse `json:"result,required"`
- // Whether the API call was successful
- Success SSLCertificatePackOrderNewResponseEnvelopeSuccess `json:"success,required"`
- JSON sslCertificatePackOrderNewResponseEnvelopeJSON `json:"-"`
-}
-
-// sslCertificatePackOrderNewResponseEnvelopeJSON contains the JSON metadata for
-// the struct [SSLCertificatePackOrderNewResponseEnvelope]
-type sslCertificatePackOrderNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SSLCertificatePackOrderNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r sslCertificatePackOrderNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type SSLCertificatePackOrderNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON sslCertificatePackOrderNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// sslCertificatePackOrderNewResponseEnvelopeErrorsJSON contains the JSON metadata
-// for the struct [SSLCertificatePackOrderNewResponseEnvelopeErrors]
-type sslCertificatePackOrderNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SSLCertificatePackOrderNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r sslCertificatePackOrderNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type SSLCertificatePackOrderNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON sslCertificatePackOrderNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// sslCertificatePackOrderNewResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct [SSLCertificatePackOrderNewResponseEnvelopeMessages]
-type sslCertificatePackOrderNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SSLCertificatePackOrderNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r sslCertificatePackOrderNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type SSLCertificatePackOrderNewResponseEnvelopeSuccess bool
-
-const (
- SSLCertificatePackOrderNewResponseEnvelopeSuccessTrue SSLCertificatePackOrderNewResponseEnvelopeSuccess = true
-)
diff --git a/sslcertificatepackorder_test.go b/sslcertificatepackorder_test.go
deleted file mode 100644
index fe81cb35f56..00000000000
--- a/sslcertificatepackorder_test.go
+++ /dev/null
@@ -1,46 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestSSLCertificatePackOrderNewWithOptionalParams(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"),
- )
- _, err := client.SSL.CertificatePacks.Order.New(context.TODO(), cloudflare.SSLCertificatePackOrderNewParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- CertificateAuthority: cloudflare.F(cloudflare.SSLCertificatePackOrderNewParamsCertificateAuthorityLetsEncrypt),
- Hosts: cloudflare.F([]string{"example.com", "*.example.com", "www.example.com"}),
- Type: cloudflare.F(cloudflare.SSLCertificatePackOrderNewParamsTypeAdvanced),
- ValidationMethod: cloudflare.F(cloudflare.SSLCertificatePackOrderNewParamsValidationMethodTXT),
- ValidityDays: cloudflare.F(cloudflare.SSLCertificatePackOrderNewParamsValidityDays14),
- CloudflareBranding: cloudflare.F(false),
- })
- 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/sslcertificatepackquota.go b/sslcertificatepackquota.go
deleted file mode 100644
index dd4b3e34133..00000000000
--- a/sslcertificatepackquota.go
+++ /dev/null
@@ -1,177 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// SSLCertificatePackQuotaService contains methods and other services that help
-// with interacting with the cloudflare API. Note, unlike clients, this service
-// does not read variables from the environment automatically. You should not
-// instantiate this service directly, and instead use the
-// [NewSSLCertificatePackQuotaService] method instead.
-type SSLCertificatePackQuotaService struct {
- Options []option.RequestOption
-}
-
-// NewSSLCertificatePackQuotaService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewSSLCertificatePackQuotaService(opts ...option.RequestOption) (r *SSLCertificatePackQuotaService) {
- r = &SSLCertificatePackQuotaService{}
- r.Options = opts
- return
-}
-
-// For a given zone, list certificate pack quotas.
-func (r *SSLCertificatePackQuotaService) Get(ctx context.Context, query SSLCertificatePackQuotaGetParams, opts ...option.RequestOption) (res *SSLCertificatePackQuotaGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env SSLCertificatePackQuotaGetResponseEnvelope
- path := fmt.Sprintf("zones/%s/ssl/certificate_packs/quota", query.ZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type SSLCertificatePackQuotaGetResponse struct {
- Advanced SSLCertificatePackQuotaGetResponseAdvanced `json:"advanced"`
- JSON sslCertificatePackQuotaGetResponseJSON `json:"-"`
-}
-
-// sslCertificatePackQuotaGetResponseJSON contains the JSON metadata for the struct
-// [SSLCertificatePackQuotaGetResponse]
-type sslCertificatePackQuotaGetResponseJSON struct {
- Advanced apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SSLCertificatePackQuotaGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r sslCertificatePackQuotaGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type SSLCertificatePackQuotaGetResponseAdvanced struct {
- // Quantity Allocated.
- Allocated int64 `json:"allocated"`
- // Quantity Used.
- Used int64 `json:"used"`
- JSON sslCertificatePackQuotaGetResponseAdvancedJSON `json:"-"`
-}
-
-// sslCertificatePackQuotaGetResponseAdvancedJSON contains the JSON metadata for
-// the struct [SSLCertificatePackQuotaGetResponseAdvanced]
-type sslCertificatePackQuotaGetResponseAdvancedJSON struct {
- Allocated apijson.Field
- Used apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SSLCertificatePackQuotaGetResponseAdvanced) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r sslCertificatePackQuotaGetResponseAdvancedJSON) RawJSON() string {
- return r.raw
-}
-
-type SSLCertificatePackQuotaGetParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
-}
-
-type SSLCertificatePackQuotaGetResponseEnvelope struct {
- Errors []SSLCertificatePackQuotaGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []SSLCertificatePackQuotaGetResponseEnvelopeMessages `json:"messages,required"`
- Result SSLCertificatePackQuotaGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success SSLCertificatePackQuotaGetResponseEnvelopeSuccess `json:"success,required"`
- JSON sslCertificatePackQuotaGetResponseEnvelopeJSON `json:"-"`
-}
-
-// sslCertificatePackQuotaGetResponseEnvelopeJSON contains the JSON metadata for
-// the struct [SSLCertificatePackQuotaGetResponseEnvelope]
-type sslCertificatePackQuotaGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SSLCertificatePackQuotaGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r sslCertificatePackQuotaGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type SSLCertificatePackQuotaGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON sslCertificatePackQuotaGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// sslCertificatePackQuotaGetResponseEnvelopeErrorsJSON contains the JSON metadata
-// for the struct [SSLCertificatePackQuotaGetResponseEnvelopeErrors]
-type sslCertificatePackQuotaGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SSLCertificatePackQuotaGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r sslCertificatePackQuotaGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type SSLCertificatePackQuotaGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON sslCertificatePackQuotaGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// sslCertificatePackQuotaGetResponseEnvelopeMessagesJSON contains the JSON
-// metadata for the struct [SSLCertificatePackQuotaGetResponseEnvelopeMessages]
-type sslCertificatePackQuotaGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SSLCertificatePackQuotaGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r sslCertificatePackQuotaGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type SSLCertificatePackQuotaGetResponseEnvelopeSuccess bool
-
-const (
- SSLCertificatePackQuotaGetResponseEnvelopeSuccessTrue SSLCertificatePackQuotaGetResponseEnvelopeSuccess = true
-)
diff --git a/sslcertificatepackquota_test.go b/sslcertificatepackquota_test.go
deleted file mode 100644
index 11991d9ac3d..00000000000
--- a/sslcertificatepackquota_test.go
+++ /dev/null
@@ -1,40 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestSSLCertificatePackQuotaGet(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"),
- )
- _, err := client.SSL.CertificatePacks.Quota.Get(context.TODO(), cloudflare.SSLCertificatePackQuotaGetParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- })
- 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/sslrecommendation.go b/sslrecommendation.go
deleted file mode 100644
index f6414d51ca9..00000000000
--- a/sslrecommendation.go
+++ /dev/null
@@ -1,160 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// SSLRecommendationService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewSSLRecommendationService] method
-// instead.
-type SSLRecommendationService struct {
- Options []option.RequestOption
-}
-
-// NewSSLRecommendationService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewSSLRecommendationService(opts ...option.RequestOption) (r *SSLRecommendationService) {
- r = &SSLRecommendationService{}
- r.Options = opts
- return
-}
-
-// Retrieve the SSL/TLS Recommender's recommendation for a zone.
-func (r *SSLRecommendationService) Get(ctx context.Context, zoneIdentifier string, opts ...option.RequestOption) (res *SSLRecommendationGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env SSLRecommendationGetResponseEnvelope
- path := fmt.Sprintf("zones/%s/ssl/recommendation", zoneIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type SSLRecommendationGetResponse struct {
- // Identifier of a recommedation result.
- ID string `json:"id"`
- ModifiedOn time.Time `json:"modified_on" format:"date-time"`
- Value SSLRecommendationGetResponseValue `json:"value"`
- JSON sslRecommendationGetResponseJSON `json:"-"`
-}
-
-// sslRecommendationGetResponseJSON contains the JSON metadata for the struct
-// [SSLRecommendationGetResponse]
-type sslRecommendationGetResponseJSON struct {
- ID apijson.Field
- ModifiedOn apijson.Field
- Value apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SSLRecommendationGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r sslRecommendationGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type SSLRecommendationGetResponseValue string
-
-const (
- SSLRecommendationGetResponseValueFlexible SSLRecommendationGetResponseValue = "flexible"
- SSLRecommendationGetResponseValueFull SSLRecommendationGetResponseValue = "full"
- SSLRecommendationGetResponseValueStrict SSLRecommendationGetResponseValue = "strict"
-)
-
-type SSLRecommendationGetResponseEnvelope struct {
- Errors []SSLRecommendationGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []SSLRecommendationGetResponseEnvelopeMessages `json:"messages,required"`
- Result SSLRecommendationGetResponse `json:"result,required,nullable"`
- // Whether the API call was successful
- Success SSLRecommendationGetResponseEnvelopeSuccess `json:"success,required"`
- JSON sslRecommendationGetResponseEnvelopeJSON `json:"-"`
-}
-
-// sslRecommendationGetResponseEnvelopeJSON contains the JSON metadata for the
-// struct [SSLRecommendationGetResponseEnvelope]
-type sslRecommendationGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SSLRecommendationGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r sslRecommendationGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type SSLRecommendationGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON sslRecommendationGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// sslRecommendationGetResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [SSLRecommendationGetResponseEnvelopeErrors]
-type sslRecommendationGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SSLRecommendationGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r sslRecommendationGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type SSLRecommendationGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON sslRecommendationGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// sslRecommendationGetResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [SSLRecommendationGetResponseEnvelopeMessages]
-type sslRecommendationGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SSLRecommendationGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r sslRecommendationGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type SSLRecommendationGetResponseEnvelopeSuccess bool
-
-const (
- SSLRecommendationGetResponseEnvelopeSuccessTrue SSLRecommendationGetResponseEnvelopeSuccess = true
-)
diff --git a/sslrecommendation_test.go b/sslrecommendation_test.go
deleted file mode 100644
index a96797cd7bf..00000000000
--- a/sslrecommendation_test.go
+++ /dev/null
@@ -1,38 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestSSLRecommendationGet(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"),
- )
- _, err := client.SSL.Recommendations.Get(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353")
- 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/ssluniversal.go b/ssluniversal.go
deleted file mode 100644
index bdcc94eba05..00000000000
--- a/ssluniversal.go
+++ /dev/null
@@ -1,27 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// SSLUniversalService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewSSLUniversalService] method
-// instead.
-type SSLUniversalService struct {
- Options []option.RequestOption
- Settings *SSLUniversalSettingService
-}
-
-// NewSSLUniversalService generates a new service that applies the given options to
-// each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewSSLUniversalService(opts ...option.RequestOption) (r *SSLUniversalService) {
- r = &SSLUniversalService{}
- r.Options = opts
- r.Settings = NewSSLUniversalSettingService(opts...)
- return
-}
diff --git a/ssluniversalsetting.go b/ssluniversalsetting.go
deleted file mode 100644
index f8cc386ef20..00000000000
--- a/ssluniversalsetting.go
+++ /dev/null
@@ -1,352 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// SSLUniversalSettingService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewSSLUniversalSettingService]
-// method instead.
-type SSLUniversalSettingService struct {
- Options []option.RequestOption
-}
-
-// NewSSLUniversalSettingService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewSSLUniversalSettingService(opts ...option.RequestOption) (r *SSLUniversalSettingService) {
- r = &SSLUniversalSettingService{}
- r.Options = opts
- return
-}
-
-// Patch Universal SSL Settings for a Zone.
-func (r *SSLUniversalSettingService) Edit(ctx context.Context, params SSLUniversalSettingEditParams, opts ...option.RequestOption) (res *SSLUniversalSettingEditResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env SSLUniversalSettingEditResponseEnvelope
- path := fmt.Sprintf("zones/%s/ssl/universal/settings", params.ZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Get Universal SSL Settings for a Zone.
-func (r *SSLUniversalSettingService) Get(ctx context.Context, query SSLUniversalSettingGetParams, opts ...option.RequestOption) (res *SSLUniversalSettingGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env SSLUniversalSettingGetResponseEnvelope
- path := fmt.Sprintf("zones/%s/ssl/universal/settings", query.ZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type SSLUniversalSettingEditResponse struct {
- // Disabling Universal SSL removes any currently active Universal SSL certificates
- // for your zone from the edge and prevents any future Universal SSL certificates
- // from being ordered. If there are no advanced certificates or custom certificates
- // uploaded for the domain, visitors will be unable to access the domain over
- // HTTPS.
- //
- // By disabling Universal SSL, you understand that the following Cloudflare
- // settings and preferences will result in visitors being unable to visit your
- // domain unless you have uploaded a custom certificate or purchased an advanced
- // certificate.
- //
- // - HSTS
- // - Always Use HTTPS
- // - Opportunistic Encryption
- // - Onion Routing
- // - Any Page Rules redirecting traffic to HTTPS
- //
- // Similarly, any HTTP redirect to HTTPS at the origin while the Cloudflare proxy
- // is enabled will result in users being unable to visit your site without a valid
- // certificate at Cloudflare's edge.
- //
- // If you do not have a valid custom or advanced certificate at Cloudflare's edge
- // and are unsure if any of the above Cloudflare settings are enabled, or if any
- // HTTP redirects exist at your origin, we advise leaving Universal SSL enabled for
- // your domain.
- Enabled bool `json:"enabled"`
- JSON sslUniversalSettingEditResponseJSON `json:"-"`
-}
-
-// sslUniversalSettingEditResponseJSON contains the JSON metadata for the struct
-// [SSLUniversalSettingEditResponse]
-type sslUniversalSettingEditResponseJSON struct {
- Enabled apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SSLUniversalSettingEditResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r sslUniversalSettingEditResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type SSLUniversalSettingGetResponse struct {
- // Disabling Universal SSL removes any currently active Universal SSL certificates
- // for your zone from the edge and prevents any future Universal SSL certificates
- // from being ordered. If there are no advanced certificates or custom certificates
- // uploaded for the domain, visitors will be unable to access the domain over
- // HTTPS.
- //
- // By disabling Universal SSL, you understand that the following Cloudflare
- // settings and preferences will result in visitors being unable to visit your
- // domain unless you have uploaded a custom certificate or purchased an advanced
- // certificate.
- //
- // - HSTS
- // - Always Use HTTPS
- // - Opportunistic Encryption
- // - Onion Routing
- // - Any Page Rules redirecting traffic to HTTPS
- //
- // Similarly, any HTTP redirect to HTTPS at the origin while the Cloudflare proxy
- // is enabled will result in users being unable to visit your site without a valid
- // certificate at Cloudflare's edge.
- //
- // If you do not have a valid custom or advanced certificate at Cloudflare's edge
- // and are unsure if any of the above Cloudflare settings are enabled, or if any
- // HTTP redirects exist at your origin, we advise leaving Universal SSL enabled for
- // your domain.
- Enabled bool `json:"enabled"`
- JSON sslUniversalSettingGetResponseJSON `json:"-"`
-}
-
-// sslUniversalSettingGetResponseJSON contains the JSON metadata for the struct
-// [SSLUniversalSettingGetResponse]
-type sslUniversalSettingGetResponseJSON struct {
- Enabled apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SSLUniversalSettingGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r sslUniversalSettingGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type SSLUniversalSettingEditParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
- // Disabling Universal SSL removes any currently active Universal SSL certificates
- // for your zone from the edge and prevents any future Universal SSL certificates
- // from being ordered. If there are no advanced certificates or custom certificates
- // uploaded for the domain, visitors will be unable to access the domain over
- // HTTPS.
- //
- // By disabling Universal SSL, you understand that the following Cloudflare
- // settings and preferences will result in visitors being unable to visit your
- // domain unless you have uploaded a custom certificate or purchased an advanced
- // certificate.
- //
- // - HSTS
- // - Always Use HTTPS
- // - Opportunistic Encryption
- // - Onion Routing
- // - Any Page Rules redirecting traffic to HTTPS
- //
- // Similarly, any HTTP redirect to HTTPS at the origin while the Cloudflare proxy
- // is enabled will result in users being unable to visit your site without a valid
- // certificate at Cloudflare's edge.
- //
- // If you do not have a valid custom or advanced certificate at Cloudflare's edge
- // and are unsure if any of the above Cloudflare settings are enabled, or if any
- // HTTP redirects exist at your origin, we advise leaving Universal SSL enabled for
- // your domain.
- Enabled param.Field[bool] `json:"enabled"`
-}
-
-func (r SSLUniversalSettingEditParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type SSLUniversalSettingEditResponseEnvelope struct {
- Errors []SSLUniversalSettingEditResponseEnvelopeErrors `json:"errors,required"`
- Messages []SSLUniversalSettingEditResponseEnvelopeMessages `json:"messages,required"`
- Result SSLUniversalSettingEditResponse `json:"result,required"`
- // Whether the API call was successful
- Success SSLUniversalSettingEditResponseEnvelopeSuccess `json:"success,required"`
- JSON sslUniversalSettingEditResponseEnvelopeJSON `json:"-"`
-}
-
-// sslUniversalSettingEditResponseEnvelopeJSON contains the JSON metadata for the
-// struct [SSLUniversalSettingEditResponseEnvelope]
-type sslUniversalSettingEditResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SSLUniversalSettingEditResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r sslUniversalSettingEditResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type SSLUniversalSettingEditResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON sslUniversalSettingEditResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// sslUniversalSettingEditResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [SSLUniversalSettingEditResponseEnvelopeErrors]
-type sslUniversalSettingEditResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SSLUniversalSettingEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r sslUniversalSettingEditResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type SSLUniversalSettingEditResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON sslUniversalSettingEditResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// sslUniversalSettingEditResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [SSLUniversalSettingEditResponseEnvelopeMessages]
-type sslUniversalSettingEditResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SSLUniversalSettingEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r sslUniversalSettingEditResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type SSLUniversalSettingEditResponseEnvelopeSuccess bool
-
-const (
- SSLUniversalSettingEditResponseEnvelopeSuccessTrue SSLUniversalSettingEditResponseEnvelopeSuccess = true
-)
-
-type SSLUniversalSettingGetParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
-}
-
-type SSLUniversalSettingGetResponseEnvelope struct {
- Errors []SSLUniversalSettingGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []SSLUniversalSettingGetResponseEnvelopeMessages `json:"messages,required"`
- Result SSLUniversalSettingGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success SSLUniversalSettingGetResponseEnvelopeSuccess `json:"success,required"`
- JSON sslUniversalSettingGetResponseEnvelopeJSON `json:"-"`
-}
-
-// sslUniversalSettingGetResponseEnvelopeJSON contains the JSON metadata for the
-// struct [SSLUniversalSettingGetResponseEnvelope]
-type sslUniversalSettingGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SSLUniversalSettingGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r sslUniversalSettingGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type SSLUniversalSettingGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON sslUniversalSettingGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// sslUniversalSettingGetResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [SSLUniversalSettingGetResponseEnvelopeErrors]
-type sslUniversalSettingGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SSLUniversalSettingGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r sslUniversalSettingGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type SSLUniversalSettingGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON sslUniversalSettingGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// sslUniversalSettingGetResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [SSLUniversalSettingGetResponseEnvelopeMessages]
-type sslUniversalSettingGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SSLUniversalSettingGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r sslUniversalSettingGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type SSLUniversalSettingGetResponseEnvelopeSuccess bool
-
-const (
- SSLUniversalSettingGetResponseEnvelopeSuccessTrue SSLUniversalSettingGetResponseEnvelopeSuccess = true
-)
diff --git a/ssluniversalsetting_test.go b/ssluniversalsetting_test.go
deleted file mode 100644
index 101e7acd282..00000000000
--- a/ssluniversalsetting_test.go
+++ /dev/null
@@ -1,67 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestSSLUniversalSettingEditWithOptionalParams(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"),
- )
- _, err := client.SSL.Universal.Settings.Edit(context.TODO(), cloudflare.SSLUniversalSettingEditParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Enabled: cloudflare.F(true),
- })
- 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())
- }
-}
-
-func TestSSLUniversalSettingGet(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"),
- )
- _, err := client.SSL.Universal.Settings.Get(context.TODO(), cloudflare.SSLUniversalSettingGetParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- })
- 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/sslverification.go b/sslverification.go
deleted file mode 100644
index ac55a7202fe..00000000000
--- a/sslverification.go
+++ /dev/null
@@ -1,373 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// SSLVerificationService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewSSLVerificationService] method
-// instead.
-type SSLVerificationService struct {
- Options []option.RequestOption
-}
-
-// NewSSLVerificationService generates a new service that applies the given options
-// to each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewSSLVerificationService(opts ...option.RequestOption) (r *SSLVerificationService) {
- r = &SSLVerificationService{}
- r.Options = opts
- return
-}
-
-// Edit SSL validation method for a certificate pack. A PATCH request will request
-// an immediate validation check on any certificate, and return the updated status.
-// If a validation method is provided, the validation will be immediately attempted
-// using that method.
-func (r *SSLVerificationService) Edit(ctx context.Context, certificatePackID string, params SSLVerificationEditParams, opts ...option.RequestOption) (res *SSLVerificationEditResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env SSLVerificationEditResponseEnvelope
- path := fmt.Sprintf("zones/%s/ssl/verification/%s", params.ZoneID, certificatePackID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Get SSL Verification Info for a Zone.
-func (r *SSLVerificationService) Get(ctx context.Context, params SSLVerificationGetParams, opts ...option.RequestOption) (res *[]SSLVerificationGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env SSLVerificationGetResponseEnvelope
- path := fmt.Sprintf("zones/%s/ssl/verification", params.ZoneID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type SSLVerificationEditResponse struct {
- // Result status.
- Status string `json:"status"`
- // Desired validation method.
- ValidationMethod SSLVerificationEditResponseValidationMethod `json:"validation_method"`
- JSON sslVerificationEditResponseJSON `json:"-"`
-}
-
-// sslVerificationEditResponseJSON contains the JSON metadata for the struct
-// [SSLVerificationEditResponse]
-type sslVerificationEditResponseJSON struct {
- Status apijson.Field
- ValidationMethod apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SSLVerificationEditResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r sslVerificationEditResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// Desired validation method.
-type SSLVerificationEditResponseValidationMethod string
-
-const (
- SSLVerificationEditResponseValidationMethodHTTP SSLVerificationEditResponseValidationMethod = "http"
- SSLVerificationEditResponseValidationMethodCNAME SSLVerificationEditResponseValidationMethod = "cname"
- SSLVerificationEditResponseValidationMethodTXT SSLVerificationEditResponseValidationMethod = "txt"
- SSLVerificationEditResponseValidationMethodEmail SSLVerificationEditResponseValidationMethod = "email"
-)
-
-type SSLVerificationGetResponse struct {
- // Current status of certificate.
- CertificateStatus SSLVerificationGetResponseCertificateStatus `json:"certificate_status,required"`
- // Certificate Authority is manually reviewing the order.
- BrandCheck bool `json:"brand_check"`
- // Certificate Pack UUID.
- CertPackUUID string `json:"cert_pack_uuid"`
- // Certificate's signature algorithm.
- Signature SSLVerificationGetResponseSignature `json:"signature"`
- // Validation method in use for a certificate pack order.
- ValidationMethod SSLVerificationGetResponseValidationMethod `json:"validation_method"`
- // Certificate's required verification information.
- VerificationInfo SSLVerificationGetResponseVerificationInfo `json:"verification_info"`
- // Status of the required verification information, omitted if verification status
- // is unknown.
- VerificationStatus bool `json:"verification_status"`
- // Method of verification.
- VerificationType SSLVerificationGetResponseVerificationType `json:"verification_type"`
- JSON sslVerificationGetResponseJSON `json:"-"`
-}
-
-// sslVerificationGetResponseJSON contains the JSON metadata for the struct
-// [SSLVerificationGetResponse]
-type sslVerificationGetResponseJSON struct {
- CertificateStatus apijson.Field
- BrandCheck apijson.Field
- CertPackUUID apijson.Field
- Signature apijson.Field
- ValidationMethod apijson.Field
- VerificationInfo apijson.Field
- VerificationStatus apijson.Field
- VerificationType apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SSLVerificationGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r sslVerificationGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// Current status of certificate.
-type SSLVerificationGetResponseCertificateStatus string
-
-const (
- SSLVerificationGetResponseCertificateStatusInitializing SSLVerificationGetResponseCertificateStatus = "initializing"
- SSLVerificationGetResponseCertificateStatusAuthorizing SSLVerificationGetResponseCertificateStatus = "authorizing"
- SSLVerificationGetResponseCertificateStatusActive SSLVerificationGetResponseCertificateStatus = "active"
- SSLVerificationGetResponseCertificateStatusExpired SSLVerificationGetResponseCertificateStatus = "expired"
- SSLVerificationGetResponseCertificateStatusIssuing SSLVerificationGetResponseCertificateStatus = "issuing"
- SSLVerificationGetResponseCertificateStatusTimingOut SSLVerificationGetResponseCertificateStatus = "timing_out"
- SSLVerificationGetResponseCertificateStatusPendingDeployment SSLVerificationGetResponseCertificateStatus = "pending_deployment"
-)
-
-// Certificate's signature algorithm.
-type SSLVerificationGetResponseSignature string
-
-const (
- SSLVerificationGetResponseSignatureEcdsaWithSha256 SSLVerificationGetResponseSignature = "ECDSAWithSHA256"
- SSLVerificationGetResponseSignatureSha1WithRsa SSLVerificationGetResponseSignature = "SHA1WithRSA"
- SSLVerificationGetResponseSignatureSha256WithRsa SSLVerificationGetResponseSignature = "SHA256WithRSA"
-)
-
-// Validation method in use for a certificate pack order.
-type SSLVerificationGetResponseValidationMethod string
-
-const (
- SSLVerificationGetResponseValidationMethodHTTP SSLVerificationGetResponseValidationMethod = "http"
- SSLVerificationGetResponseValidationMethodCNAME SSLVerificationGetResponseValidationMethod = "cname"
- SSLVerificationGetResponseValidationMethodTXT SSLVerificationGetResponseValidationMethod = "txt"
-)
-
-// Certificate's required verification information.
-type SSLVerificationGetResponseVerificationInfo struct {
- // Name of CNAME record.
- RecordName SSLVerificationGetResponseVerificationInfoRecordName `json:"record_name"`
- // Target of CNAME record.
- RecordTarget SSLVerificationGetResponseVerificationInfoRecordTarget `json:"record_target"`
- JSON sslVerificationGetResponseVerificationInfoJSON `json:"-"`
-}
-
-// sslVerificationGetResponseVerificationInfoJSON contains the JSON metadata for
-// the struct [SSLVerificationGetResponseVerificationInfo]
-type sslVerificationGetResponseVerificationInfoJSON struct {
- RecordName apijson.Field
- RecordTarget apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SSLVerificationGetResponseVerificationInfo) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r sslVerificationGetResponseVerificationInfoJSON) RawJSON() string {
- return r.raw
-}
-
-// Name of CNAME record.
-type SSLVerificationGetResponseVerificationInfoRecordName string
-
-const (
- SSLVerificationGetResponseVerificationInfoRecordNameRecordName SSLVerificationGetResponseVerificationInfoRecordName = "record_name"
- SSLVerificationGetResponseVerificationInfoRecordNameHTTPURL SSLVerificationGetResponseVerificationInfoRecordName = "http_url"
- SSLVerificationGetResponseVerificationInfoRecordNameCNAME SSLVerificationGetResponseVerificationInfoRecordName = "cname"
- SSLVerificationGetResponseVerificationInfoRecordNameTXTName SSLVerificationGetResponseVerificationInfoRecordName = "txt_name"
-)
-
-// Target of CNAME record.
-type SSLVerificationGetResponseVerificationInfoRecordTarget string
-
-const (
- SSLVerificationGetResponseVerificationInfoRecordTargetRecordValue SSLVerificationGetResponseVerificationInfoRecordTarget = "record_value"
- SSLVerificationGetResponseVerificationInfoRecordTargetHTTPBody SSLVerificationGetResponseVerificationInfoRecordTarget = "http_body"
- SSLVerificationGetResponseVerificationInfoRecordTargetCNAMETarget SSLVerificationGetResponseVerificationInfoRecordTarget = "cname_target"
- SSLVerificationGetResponseVerificationInfoRecordTargetTXTValue SSLVerificationGetResponseVerificationInfoRecordTarget = "txt_value"
-)
-
-// Method of verification.
-type SSLVerificationGetResponseVerificationType string
-
-const (
- SSLVerificationGetResponseVerificationTypeCNAME SSLVerificationGetResponseVerificationType = "cname"
- SSLVerificationGetResponseVerificationTypeMetaTag SSLVerificationGetResponseVerificationType = "meta tag"
-)
-
-type SSLVerificationEditParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
- // Desired validation method.
- ValidationMethod param.Field[SSLVerificationEditParamsValidationMethod] `json:"validation_method,required"`
-}
-
-func (r SSLVerificationEditParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-// Desired validation method.
-type SSLVerificationEditParamsValidationMethod string
-
-const (
- SSLVerificationEditParamsValidationMethodHTTP SSLVerificationEditParamsValidationMethod = "http"
- SSLVerificationEditParamsValidationMethodCNAME SSLVerificationEditParamsValidationMethod = "cname"
- SSLVerificationEditParamsValidationMethodTXT SSLVerificationEditParamsValidationMethod = "txt"
- SSLVerificationEditParamsValidationMethodEmail SSLVerificationEditParamsValidationMethod = "email"
-)
-
-type SSLVerificationEditResponseEnvelope struct {
- Errors []SSLVerificationEditResponseEnvelopeErrors `json:"errors,required"`
- Messages []SSLVerificationEditResponseEnvelopeMessages `json:"messages,required"`
- Result SSLVerificationEditResponse `json:"result,required"`
- // Whether the API call was successful
- Success SSLVerificationEditResponseEnvelopeSuccess `json:"success,required"`
- JSON sslVerificationEditResponseEnvelopeJSON `json:"-"`
-}
-
-// sslVerificationEditResponseEnvelopeJSON contains the JSON metadata for the
-// struct [SSLVerificationEditResponseEnvelope]
-type sslVerificationEditResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SSLVerificationEditResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r sslVerificationEditResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type SSLVerificationEditResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON sslVerificationEditResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// sslVerificationEditResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [SSLVerificationEditResponseEnvelopeErrors]
-type sslVerificationEditResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SSLVerificationEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r sslVerificationEditResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type SSLVerificationEditResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON sslVerificationEditResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// sslVerificationEditResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [SSLVerificationEditResponseEnvelopeMessages]
-type sslVerificationEditResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SSLVerificationEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r sslVerificationEditResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type SSLVerificationEditResponseEnvelopeSuccess bool
-
-const (
- SSLVerificationEditResponseEnvelopeSuccessTrue SSLVerificationEditResponseEnvelopeSuccess = true
-)
-
-type SSLVerificationGetParams struct {
- // Identifier
- ZoneID param.Field[string] `path:"zone_id,required"`
- // Immediately retry SSL Verification.
- Retry param.Field[SSLVerificationGetParamsRetry] `query:"retry"`
-}
-
-// URLQuery serializes [SSLVerificationGetParams]'s query parameters as
-// `url.Values`.
-func (r SSLVerificationGetParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Immediately retry SSL Verification.
-type SSLVerificationGetParamsRetry bool
-
-const (
- SSLVerificationGetParamsRetryTrue SSLVerificationGetParamsRetry = true
-)
-
-type SSLVerificationGetResponseEnvelope struct {
- Result []SSLVerificationGetResponse `json:"result"`
- JSON sslVerificationGetResponseEnvelopeJSON `json:"-"`
-}
-
-// sslVerificationGetResponseEnvelopeJSON contains the JSON metadata for the struct
-// [SSLVerificationGetResponseEnvelope]
-type sslVerificationGetResponseEnvelopeJSON struct {
- Result apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *SSLVerificationGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r sslVerificationGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
diff --git a/sslverification_test.go b/sslverification_test.go
deleted file mode 100644
index bf069b18b3f..00000000000
--- a/sslverification_test.go
+++ /dev/null
@@ -1,72 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestSSLVerificationEdit(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"),
- )
- _, err := client.SSL.Verification.Edit(
- context.TODO(),
- "a77f8bd7-3b47-46b4-a6f1-75cf98109948",
- cloudflare.SSLVerificationEditParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- ValidationMethod: cloudflare.F(cloudflare.SSLVerificationEditParamsValidationMethodTXT),
- },
- )
- 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())
- }
-}
-
-func TestSSLVerificationGetWithOptionalParams(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"),
- )
- _, err := client.SSL.Verification.Get(context.TODO(), cloudflare.SSLVerificationGetParams{
- ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Retry: cloudflare.F(cloudflare.SSLVerificationGetParamsRetryTrue),
- })
- 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/storage/aliases.go b/storage/aliases.go
new file mode 100644
index 00000000000..95a4b7db028
--- /dev/null
+++ b/storage/aliases.go
@@ -0,0 +1,9 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package storage
+
+import (
+ "github.com/cloudflare/cloudflare-go/internal/apierror"
+)
+
+type Error = apierror.Error
diff --git a/storage/analytics.go b/storage/analytics.go
new file mode 100644
index 00000000000..257d5ced87a
--- /dev/null
+++ b/storage/analytics.go
@@ -0,0 +1,609 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package storage
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// AnalyticsService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewAnalyticsService] method instead.
+type AnalyticsService struct {
+ Options []option.RequestOption
+}
+
+// NewAnalyticsService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewAnalyticsService(opts ...option.RequestOption) (r *AnalyticsService) {
+ r = &AnalyticsService{}
+ r.Options = opts
+ return
+}
+
+// Retrieves Workers KV request metrics for the given account.
+func (r *AnalyticsService) List(ctx context.Context, params AnalyticsListParams, opts ...option.RequestOption) (res *WorkersKVSchemasResult, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AnalyticsListResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/storage/analytics", params.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Retrieves Workers KV stored data metrics for the given account.
+func (r *AnalyticsService) Stored(ctx context.Context, params AnalyticsStoredParams, opts ...option.RequestOption) (res *WorkersKVComponentsSchemasResult, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AnalyticsStoredResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/storage/analytics/stored", params.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Metrics on Workers KV requests.
+type WorkersKVComponentsSchemasResult struct {
+ Data []WorkersKVComponentsSchemasResultData `json:"data,required,nullable"`
+ // Number of seconds between current time and last processed event, i.e. how many
+ // seconds of data could be missing.
+ DataLag float64 `json:"data_lag,required"`
+ // Maximum results for each metric.
+ Max interface{} `json:"max,required"`
+ // Minimum results for each metric.
+ Min interface{} `json:"min,required"`
+ // For specifying result metrics.
+ Query WorkersKVComponentsSchemasResultQuery `json:"query,required"`
+ // Total number of rows in the result.
+ Rows float64 `json:"rows,required"`
+ // Total results for metrics across all data.
+ Totals interface{} `json:"totals,required"`
+ JSON workersKVComponentsSchemasResultJSON `json:"-"`
+}
+
+// workersKVComponentsSchemasResultJSON contains the JSON metadata for the struct
+// [WorkersKVComponentsSchemasResult]
+type workersKVComponentsSchemasResultJSON struct {
+ Data apijson.Field
+ DataLag apijson.Field
+ Max apijson.Field
+ Min apijson.Field
+ Query apijson.Field
+ Rows apijson.Field
+ Totals apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WorkersKVComponentsSchemasResult) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r workersKVComponentsSchemasResultJSON) RawJSON() string {
+ return r.raw
+}
+
+type WorkersKVComponentsSchemasResultData struct {
+ // List of metrics returned by the query.
+ Metrics []interface{} `json:"metrics,required"`
+ JSON workersKVComponentsSchemasResultDataJSON `json:"-"`
+}
+
+// workersKVComponentsSchemasResultDataJSON contains the JSON metadata for the
+// struct [WorkersKVComponentsSchemasResultData]
+type workersKVComponentsSchemasResultDataJSON struct {
+ Metrics apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WorkersKVComponentsSchemasResultData) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r workersKVComponentsSchemasResultDataJSON) RawJSON() string {
+ return r.raw
+}
+
+// For specifying result metrics.
+type WorkersKVComponentsSchemasResultQuery struct {
+ // Can be used to break down the data by given attributes.
+ Dimensions []string `json:"dimensions"`
+ // Used to filter rows by one or more dimensions. Filters can be combined using OR
+ // and AND boolean logic. AND takes precedence over OR in all the expressions. The
+ // OR operator is defined using a comma (,) or OR keyword surrounded by whitespace.
+ // The AND operator is defined using a semicolon (;) or AND keyword surrounded by
+ // whitespace. Note that the semicolon is a reserved character in URLs (rfc1738)
+ // and needs to be percent-encoded as %3B. Comparison options are:
+ //
+ // | Operator | Name | URL Encoded |
+ // | -------- | ------------------------ | ----------- |
+ // | == | Equals | %3D%3D |
+ // | != | Does not equals | !%3D |
+ // | > | Greater Than | %3E |
+ // | < | Less Than | %3C |
+ // | >= | Greater than or equal to | %3E%3D |
+ // | <= | Less than or equal to | %3C%3D . |
+ Filters string `json:"filters"`
+ // Limit number of returned metrics.
+ Limit int64 `json:"limit"`
+ // One or more metrics to compute.
+ Metrics []string `json:"metrics"`
+ // Start of time interval to query, defaults to 6 hours before request received.
+ Since time.Time `json:"since" format:"date-time"`
+ // Array of dimensions or metrics to sort by, each dimension/metric may be prefixed
+ // by - (descending) or + (ascending).
+ Sort []interface{} `json:"sort"`
+ // End of time interval to query, defaults to current time.
+ Until time.Time `json:"until" format:"date-time"`
+ JSON workersKVComponentsSchemasResultQueryJSON `json:"-"`
+}
+
+// workersKVComponentsSchemasResultQueryJSON contains the JSON metadata for the
+// struct [WorkersKVComponentsSchemasResultQuery]
+type workersKVComponentsSchemasResultQueryJSON struct {
+ Dimensions apijson.Field
+ Filters apijson.Field
+ Limit apijson.Field
+ Metrics apijson.Field
+ Since apijson.Field
+ Sort apijson.Field
+ Until apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WorkersKVComponentsSchemasResultQuery) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r workersKVComponentsSchemasResultQueryJSON) RawJSON() string {
+ return r.raw
+}
+
+// Metrics on Workers KV requests.
+type WorkersKVSchemasResult struct {
+ Data []WorkersKVSchemasResultData `json:"data,required,nullable"`
+ // Number of seconds between current time and last processed event, i.e. how many
+ // seconds of data could be missing.
+ DataLag float64 `json:"data_lag,required"`
+ // Maximum results for each metric.
+ Max interface{} `json:"max,required"`
+ // Minimum results for each metric.
+ Min interface{} `json:"min,required"`
+ // For specifying result metrics.
+ Query WorkersKVSchemasResultQuery `json:"query,required"`
+ // Total number of rows in the result.
+ Rows float64 `json:"rows,required"`
+ // Total results for metrics across all data.
+ Totals interface{} `json:"totals,required"`
+ JSON workersKVSchemasResultJSON `json:"-"`
+}
+
+// workersKVSchemasResultJSON contains the JSON metadata for the struct
+// [WorkersKVSchemasResult]
+type workersKVSchemasResultJSON struct {
+ Data apijson.Field
+ DataLag apijson.Field
+ Max apijson.Field
+ Min apijson.Field
+ Query apijson.Field
+ Rows apijson.Field
+ Totals apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WorkersKVSchemasResult) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r workersKVSchemasResultJSON) RawJSON() string {
+ return r.raw
+}
+
+type WorkersKVSchemasResultData struct {
+ // List of metrics returned by the query.
+ Metrics []interface{} `json:"metrics,required"`
+ JSON workersKVSchemasResultDataJSON `json:"-"`
+}
+
+// workersKVSchemasResultDataJSON contains the JSON metadata for the struct
+// [WorkersKVSchemasResultData]
+type workersKVSchemasResultDataJSON struct {
+ Metrics apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WorkersKVSchemasResultData) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r workersKVSchemasResultDataJSON) RawJSON() string {
+ return r.raw
+}
+
+// For specifying result metrics.
+type WorkersKVSchemasResultQuery struct {
+ // Can be used to break down the data by given attributes.
+ Dimensions []string `json:"dimensions"`
+ // Used to filter rows by one or more dimensions. Filters can be combined using OR
+ // and AND boolean logic. AND takes precedence over OR in all the expressions. The
+ // OR operator is defined using a comma (,) or OR keyword surrounded by whitespace.
+ // The AND operator is defined using a semicolon (;) or AND keyword surrounded by
+ // whitespace. Note that the semicolon is a reserved character in URLs (rfc1738)
+ // and needs to be percent-encoded as %3B. Comparison options are:
+ //
+ // | Operator | Name | URL Encoded |
+ // | -------- | ------------------------ | ----------- |
+ // | == | Equals | %3D%3D |
+ // | != | Does not equals | !%3D |
+ // | > | Greater Than | %3E |
+ // | < | Less Than | %3C |
+ // | >= | Greater than or equal to | %3E%3D |
+ // | <= | Less than or equal to | %3C%3D . |
+ Filters string `json:"filters"`
+ // Limit number of returned metrics.
+ Limit int64 `json:"limit"`
+ // One or more metrics to compute.
+ Metrics []string `json:"metrics"`
+ // Start of time interval to query, defaults to 6 hours before request received.
+ Since time.Time `json:"since" format:"date-time"`
+ // Array of dimensions or metrics to sort by, each dimension/metric may be prefixed
+ // by - (descending) or + (ascending).
+ Sort []interface{} `json:"sort"`
+ // End of time interval to query, defaults to current time.
+ Until time.Time `json:"until" format:"date-time"`
+ JSON workersKVSchemasResultQueryJSON `json:"-"`
+}
+
+// workersKVSchemasResultQueryJSON contains the JSON metadata for the struct
+// [WorkersKVSchemasResultQuery]
+type workersKVSchemasResultQueryJSON struct {
+ Dimensions apijson.Field
+ Filters apijson.Field
+ Limit apijson.Field
+ Metrics apijson.Field
+ Since apijson.Field
+ Sort apijson.Field
+ Until apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WorkersKVSchemasResultQuery) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r workersKVSchemasResultQueryJSON) RawJSON() string {
+ return r.raw
+}
+
+type AnalyticsListParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ // For specifying result metrics.
+ Query param.Field[AnalyticsListParamsQuery] `query:"query"`
+}
+
+// URLQuery serializes [AnalyticsListParams]'s query parameters as `url.Values`.
+func (r AnalyticsListParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// For specifying result metrics.
+type AnalyticsListParamsQuery struct {
+ // Can be used to break down the data by given attributes.
+ Dimensions param.Field[[]AnalyticsListParamsQueryDimension] `query:"dimensions"`
+ // Used to filter rows by one or more dimensions. Filters can be combined using OR
+ // and AND boolean logic. AND takes precedence over OR in all the expressions. The
+ // OR operator is defined using a comma (,) or OR keyword surrounded by whitespace.
+ // The AND operator is defined using a semicolon (;) or AND keyword surrounded by
+ // whitespace. Note that the semicolon is a reserved character in URLs (rfc1738)
+ // and needs to be percent-encoded as %3B. Comparison options are:
+ //
+ // | Operator | Name | URL Encoded |
+ // | -------- | ------------------------ | ----------- |
+ // | == | Equals | %3D%3D |
+ // | != | Does not equals | !%3D |
+ // | > | Greater Than | %3E |
+ // | < | Less Than | %3C |
+ // | >= | Greater than or equal to | %3E%3D |
+ // | <= | Less than or equal to | %3C%3D . |
+ Filters param.Field[string] `query:"filters"`
+ // Limit number of returned metrics.
+ Limit param.Field[int64] `query:"limit"`
+ // One or more metrics to compute.
+ Metrics param.Field[[]AnalyticsListParamsQueryMetric] `query:"metrics"`
+ // Start of time interval to query, defaults to 6 hours before request received.
+ Since param.Field[time.Time] `query:"since" format:"date-time"`
+ // Array of dimensions or metrics to sort by, each dimension/metric may be prefixed
+ // by - (descending) or + (ascending).
+ Sort param.Field[[]interface{}] `query:"sort"`
+ // End of time interval to query, defaults to current time.
+ Until param.Field[time.Time] `query:"until" format:"date-time"`
+}
+
+// URLQuery serializes [AnalyticsListParamsQuery]'s query parameters as
+// `url.Values`.
+func (r AnalyticsListParamsQuery) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// For drilling down on metrics.
+type AnalyticsListParamsQueryDimension string
+
+const (
+ AnalyticsListParamsQueryDimensionAccountID AnalyticsListParamsQueryDimension = "accountId"
+ AnalyticsListParamsQueryDimensionResponseCode AnalyticsListParamsQueryDimension = "responseCode"
+ AnalyticsListParamsQueryDimensionRequestType AnalyticsListParamsQueryDimension = "requestType"
+)
+
+// A quantitative measurement of KV usage.
+type AnalyticsListParamsQueryMetric string
+
+const (
+ AnalyticsListParamsQueryMetricRequests AnalyticsListParamsQueryMetric = "requests"
+ AnalyticsListParamsQueryMetricWriteKiB AnalyticsListParamsQueryMetric = "writeKiB"
+ AnalyticsListParamsQueryMetricReadKiB AnalyticsListParamsQueryMetric = "readKiB"
+)
+
+type AnalyticsListResponseEnvelope struct {
+ Errors []AnalyticsListResponseEnvelopeErrors `json:"errors,required"`
+ Messages []AnalyticsListResponseEnvelopeMessages `json:"messages,required"`
+ // Metrics on Workers KV requests.
+ Result WorkersKVSchemasResult `json:"result,required"`
+ // Whether the API call was successful
+ Success AnalyticsListResponseEnvelopeSuccess `json:"success,required"`
+ JSON analyticsListResponseEnvelopeJSON `json:"-"`
+}
+
+// analyticsListResponseEnvelopeJSON contains the JSON metadata for the struct
+// [AnalyticsListResponseEnvelope]
+type analyticsListResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AnalyticsListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r analyticsListResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AnalyticsListResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON analyticsListResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// analyticsListResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [AnalyticsListResponseEnvelopeErrors]
+type analyticsListResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AnalyticsListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r analyticsListResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type AnalyticsListResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON analyticsListResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// analyticsListResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [AnalyticsListResponseEnvelopeMessages]
+type analyticsListResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AnalyticsListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r analyticsListResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type AnalyticsListResponseEnvelopeSuccess bool
+
+const (
+ AnalyticsListResponseEnvelopeSuccessTrue AnalyticsListResponseEnvelopeSuccess = true
+)
+
+type AnalyticsStoredParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ // For specifying result metrics.
+ Query param.Field[AnalyticsStoredParamsQuery] `query:"query"`
+}
+
+// URLQuery serializes [AnalyticsStoredParams]'s query parameters as `url.Values`.
+func (r AnalyticsStoredParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// For specifying result metrics.
+type AnalyticsStoredParamsQuery struct {
+ // Can be used to break down the data by given attributes.
+ Dimensions param.Field[[]AnalyticsStoredParamsQueryDimension] `query:"dimensions"`
+ // Used to filter rows by one or more dimensions. Filters can be combined using OR
+ // and AND boolean logic. AND takes precedence over OR in all the expressions. The
+ // OR operator is defined using a comma (,) or OR keyword surrounded by whitespace.
+ // The AND operator is defined using a semicolon (;) or AND keyword surrounded by
+ // whitespace. Note that the semicolon is a reserved character in URLs (rfc1738)
+ // and needs to be percent-encoded as %3B. Comparison options are:
+ //
+ // | Operator | Name | URL Encoded |
+ // | -------- | ------------------------ | ----------- |
+ // | == | Equals | %3D%3D |
+ // | != | Does not equals | !%3D |
+ // | > | Greater Than | %3E |
+ // | < | Less Than | %3C |
+ // | >= | Greater than or equal to | %3E%3D |
+ // | <= | Less than or equal to | %3C%3D . |
+ Filters param.Field[string] `query:"filters"`
+ // Limit number of returned metrics.
+ Limit param.Field[int64] `query:"limit"`
+ // One or more metrics to compute.
+ Metrics param.Field[[]AnalyticsStoredParamsQueryMetric] `query:"metrics"`
+ // Start of time interval to query, defaults to 6 hours before request received.
+ Since param.Field[time.Time] `query:"since" format:"date-time"`
+ // Array of dimensions or metrics to sort by, each dimension/metric may be prefixed
+ // by - (descending) or + (ascending).
+ Sort param.Field[[]interface{}] `query:"sort"`
+ // End of time interval to query, defaults to current time.
+ Until param.Field[time.Time] `query:"until" format:"date-time"`
+}
+
+// URLQuery serializes [AnalyticsStoredParamsQuery]'s query parameters as
+// `url.Values`.
+func (r AnalyticsStoredParamsQuery) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// For drilling down on metrics.
+type AnalyticsStoredParamsQueryDimension string
+
+const (
+ AnalyticsStoredParamsQueryDimensionNamespaceID AnalyticsStoredParamsQueryDimension = "namespaceId"
+)
+
+// A quantitative measurement of KV usage.
+type AnalyticsStoredParamsQueryMetric string
+
+const (
+ AnalyticsStoredParamsQueryMetricStoredBytes AnalyticsStoredParamsQueryMetric = "storedBytes"
+ AnalyticsStoredParamsQueryMetricStoredKeys AnalyticsStoredParamsQueryMetric = "storedKeys"
+)
+
+type AnalyticsStoredResponseEnvelope struct {
+ Errors []AnalyticsStoredResponseEnvelopeErrors `json:"errors,required"`
+ Messages []AnalyticsStoredResponseEnvelopeMessages `json:"messages,required"`
+ // Metrics on Workers KV requests.
+ Result WorkersKVComponentsSchemasResult `json:"result,required"`
+ // Whether the API call was successful
+ Success AnalyticsStoredResponseEnvelopeSuccess `json:"success,required"`
+ JSON analyticsStoredResponseEnvelopeJSON `json:"-"`
+}
+
+// analyticsStoredResponseEnvelopeJSON contains the JSON metadata for the struct
+// [AnalyticsStoredResponseEnvelope]
+type analyticsStoredResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AnalyticsStoredResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r analyticsStoredResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AnalyticsStoredResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON analyticsStoredResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// analyticsStoredResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [AnalyticsStoredResponseEnvelopeErrors]
+type analyticsStoredResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AnalyticsStoredResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r analyticsStoredResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type AnalyticsStoredResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON analyticsStoredResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// analyticsStoredResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [AnalyticsStoredResponseEnvelopeMessages]
+type analyticsStoredResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AnalyticsStoredResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r analyticsStoredResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type AnalyticsStoredResponseEnvelopeSuccess bool
+
+const (
+ AnalyticsStoredResponseEnvelopeSuccessTrue AnalyticsStoredResponseEnvelopeSuccess = true
+)
diff --git a/storage/analytics_test.go b/storage/analytics_test.go
new file mode 100644
index 00000000000..b80bf1445ed
--- /dev/null
+++ b/storage/analytics_test.go
@@ -0,0 +1,86 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package storage_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/storage"
+)
+
+func TestAnalyticsListWithOptionalParams(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"),
+ )
+ _, err := client.Storage.Analytics.List(context.TODO(), storage.AnalyticsListParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Query: cloudflare.F(storage.AnalyticsListParamsQuery{
+ Dimensions: cloudflare.F([]storage.AnalyticsListParamsQueryDimension{storage.AnalyticsListParamsQueryDimensionAccountID, storage.AnalyticsListParamsQueryDimensionResponseCode, storage.AnalyticsListParamsQueryDimensionRequestType}),
+ Filters: cloudflare.F("requestType==read AND responseCode!=200"),
+ Limit: cloudflare.F(int64(0)),
+ Metrics: cloudflare.F([]storage.AnalyticsListParamsQueryMetric{storage.AnalyticsListParamsQueryMetricRequests, storage.AnalyticsListParamsQueryMetricWriteKiB, storage.AnalyticsListParamsQueryMetricReadKiB}),
+ Since: cloudflare.F(time.Now()),
+ Sort: cloudflare.F([]interface{}{"+requests", "-responseCode"}),
+ Until: cloudflare.F(time.Now()),
+ }),
+ })
+ 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())
+ }
+}
+
+func TestAnalyticsStoredWithOptionalParams(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"),
+ )
+ _, err := client.Storage.Analytics.Stored(context.TODO(), storage.AnalyticsStoredParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Query: cloudflare.F(storage.AnalyticsStoredParamsQuery{
+ Dimensions: cloudflare.F([]storage.AnalyticsStoredParamsQueryDimension{storage.AnalyticsStoredParamsQueryDimensionNamespaceID}),
+ Filters: cloudflare.F("namespaceId==a4e8cbb7-1b58-4990-925e-e026d40c4c64"),
+ Limit: cloudflare.F(int64(0)),
+ Metrics: cloudflare.F([]storage.AnalyticsStoredParamsQueryMetric{storage.AnalyticsStoredParamsQueryMetricStoredBytes, storage.AnalyticsStoredParamsQueryMetricStoredKeys}),
+ Since: cloudflare.F(time.Now()),
+ Sort: cloudflare.F([]interface{}{"+storedBytes", "-namespaceId"}),
+ Until: cloudflare.F(time.Now()),
+ }),
+ })
+ 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/storage.go b/storage/storage.go
similarity index 88%
rename from storage.go
rename to storage/storage.go
index 50a558c3103..c0f063081c4 100644
--- a/storage.go
+++ b/storage/storage.go
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package cloudflare
+package storage
import (
"github.com/cloudflare/cloudflare-go/option"
@@ -12,7 +12,7 @@ import (
// service directly, and instead use the [NewStorageService] method instead.
type StorageService struct {
Options []option.RequestOption
- Analytics *StorageAnalyticsService
+ Analytics *AnalyticsService
}
// NewStorageService generates a new service that applies the given options to each
@@ -21,6 +21,6 @@ type StorageService struct {
func NewStorageService(opts ...option.RequestOption) (r *StorageService) {
r = &StorageService{}
r.Options = opts
- r.Analytics = NewStorageAnalyticsService(opts...)
+ r.Analytics = NewAnalyticsService(opts...)
return
}
diff --git a/storageanalytics.go b/storageanalytics.go
deleted file mode 100644
index 6db766a75b8..00000000000
--- a/storageanalytics.go
+++ /dev/null
@@ -1,612 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// StorageAnalyticsService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewStorageAnalyticsService] method
-// instead.
-type StorageAnalyticsService struct {
- Options []option.RequestOption
-}
-
-// NewStorageAnalyticsService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewStorageAnalyticsService(opts ...option.RequestOption) (r *StorageAnalyticsService) {
- r = &StorageAnalyticsService{}
- r.Options = opts
- return
-}
-
-// Retrieves Workers KV request metrics for the given account.
-func (r *StorageAnalyticsService) List(ctx context.Context, params StorageAnalyticsListParams, opts ...option.RequestOption) (res *StorageAnalyticsListResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env StorageAnalyticsListResponseEnvelope
- path := fmt.Sprintf("accounts/%s/storage/analytics", params.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Retrieves Workers KV stored data metrics for the given account.
-func (r *StorageAnalyticsService) Stored(ctx context.Context, params StorageAnalyticsStoredParams, opts ...option.RequestOption) (res *StorageAnalyticsStoredResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env StorageAnalyticsStoredResponseEnvelope
- path := fmt.Sprintf("accounts/%s/storage/analytics/stored", params.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Metrics on Workers KV requests.
-type StorageAnalyticsListResponse struct {
- Data []StorageAnalyticsListResponseData `json:"data,required,nullable"`
- // Number of seconds between current time and last processed event, i.e. how many
- // seconds of data could be missing.
- DataLag float64 `json:"data_lag,required"`
- // Maximum results for each metric.
- Max interface{} `json:"max,required"`
- // Minimum results for each metric.
- Min interface{} `json:"min,required"`
- // For specifying result metrics.
- Query StorageAnalyticsListResponseQuery `json:"query,required"`
- // Total number of rows in the result.
- Rows float64 `json:"rows,required"`
- // Total results for metrics across all data.
- Totals interface{} `json:"totals,required"`
- JSON storageAnalyticsListResponseJSON `json:"-"`
-}
-
-// storageAnalyticsListResponseJSON contains the JSON metadata for the struct
-// [StorageAnalyticsListResponse]
-type storageAnalyticsListResponseJSON struct {
- Data apijson.Field
- DataLag apijson.Field
- Max apijson.Field
- Min apijson.Field
- Query apijson.Field
- Rows apijson.Field
- Totals apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StorageAnalyticsListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r storageAnalyticsListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type StorageAnalyticsListResponseData struct {
- // List of metrics returned by the query.
- Metrics []interface{} `json:"metrics,required"`
- JSON storageAnalyticsListResponseDataJSON `json:"-"`
-}
-
-// storageAnalyticsListResponseDataJSON contains the JSON metadata for the struct
-// [StorageAnalyticsListResponseData]
-type storageAnalyticsListResponseDataJSON struct {
- Metrics apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StorageAnalyticsListResponseData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r storageAnalyticsListResponseDataJSON) RawJSON() string {
- return r.raw
-}
-
-// For specifying result metrics.
-type StorageAnalyticsListResponseQuery struct {
- // Can be used to break down the data by given attributes.
- Dimensions []string `json:"dimensions"`
- // Used to filter rows by one or more dimensions. Filters can be combined using OR
- // and AND boolean logic. AND takes precedence over OR in all the expressions. The
- // OR operator is defined using a comma (,) or OR keyword surrounded by whitespace.
- // The AND operator is defined using a semicolon (;) or AND keyword surrounded by
- // whitespace. Note that the semicolon is a reserved character in URLs (rfc1738)
- // and needs to be percent-encoded as %3B. Comparison options are:
- //
- // | Operator | Name | URL Encoded |
- // | -------- | ------------------------ | ----------- |
- // | == | Equals | %3D%3D |
- // | != | Does not equals | !%3D |
- // | > | Greater Than | %3E |
- // | < | Less Than | %3C |
- // | >= | Greater than or equal to | %3E%3D |
- // | <= | Less than or equal to | %3C%3D . |
- Filters string `json:"filters"`
- // Limit number of returned metrics.
- Limit int64 `json:"limit"`
- // One or more metrics to compute.
- Metrics []string `json:"metrics"`
- // Start of time interval to query, defaults to 6 hours before request received.
- Since time.Time `json:"since" format:"date-time"`
- // Array of dimensions or metrics to sort by, each dimension/metric may be prefixed
- // by - (descending) or + (ascending).
- Sort []interface{} `json:"sort"`
- // End of time interval to query, defaults to current time.
- Until time.Time `json:"until" format:"date-time"`
- JSON storageAnalyticsListResponseQueryJSON `json:"-"`
-}
-
-// storageAnalyticsListResponseQueryJSON contains the JSON metadata for the struct
-// [StorageAnalyticsListResponseQuery]
-type storageAnalyticsListResponseQueryJSON struct {
- Dimensions apijson.Field
- Filters apijson.Field
- Limit apijson.Field
- Metrics apijson.Field
- Since apijson.Field
- Sort apijson.Field
- Until apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StorageAnalyticsListResponseQuery) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r storageAnalyticsListResponseQueryJSON) RawJSON() string {
- return r.raw
-}
-
-// Metrics on Workers KV requests.
-type StorageAnalyticsStoredResponse struct {
- Data []StorageAnalyticsStoredResponseData `json:"data,required,nullable"`
- // Number of seconds between current time and last processed event, i.e. how many
- // seconds of data could be missing.
- DataLag float64 `json:"data_lag,required"`
- // Maximum results for each metric.
- Max interface{} `json:"max,required"`
- // Minimum results for each metric.
- Min interface{} `json:"min,required"`
- // For specifying result metrics.
- Query StorageAnalyticsStoredResponseQuery `json:"query,required"`
- // Total number of rows in the result.
- Rows float64 `json:"rows,required"`
- // Total results for metrics across all data.
- Totals interface{} `json:"totals,required"`
- JSON storageAnalyticsStoredResponseJSON `json:"-"`
-}
-
-// storageAnalyticsStoredResponseJSON contains the JSON metadata for the struct
-// [StorageAnalyticsStoredResponse]
-type storageAnalyticsStoredResponseJSON struct {
- Data apijson.Field
- DataLag apijson.Field
- Max apijson.Field
- Min apijson.Field
- Query apijson.Field
- Rows apijson.Field
- Totals apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StorageAnalyticsStoredResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r storageAnalyticsStoredResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type StorageAnalyticsStoredResponseData struct {
- // List of metrics returned by the query.
- Metrics []interface{} `json:"metrics,required"`
- JSON storageAnalyticsStoredResponseDataJSON `json:"-"`
-}
-
-// storageAnalyticsStoredResponseDataJSON contains the JSON metadata for the struct
-// [StorageAnalyticsStoredResponseData]
-type storageAnalyticsStoredResponseDataJSON struct {
- Metrics apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StorageAnalyticsStoredResponseData) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r storageAnalyticsStoredResponseDataJSON) RawJSON() string {
- return r.raw
-}
-
-// For specifying result metrics.
-type StorageAnalyticsStoredResponseQuery struct {
- // Can be used to break down the data by given attributes.
- Dimensions []string `json:"dimensions"`
- // Used to filter rows by one or more dimensions. Filters can be combined using OR
- // and AND boolean logic. AND takes precedence over OR in all the expressions. The
- // OR operator is defined using a comma (,) or OR keyword surrounded by whitespace.
- // The AND operator is defined using a semicolon (;) or AND keyword surrounded by
- // whitespace. Note that the semicolon is a reserved character in URLs (rfc1738)
- // and needs to be percent-encoded as %3B. Comparison options are:
- //
- // | Operator | Name | URL Encoded |
- // | -------- | ------------------------ | ----------- |
- // | == | Equals | %3D%3D |
- // | != | Does not equals | !%3D |
- // | > | Greater Than | %3E |
- // | < | Less Than | %3C |
- // | >= | Greater than or equal to | %3E%3D |
- // | <= | Less than or equal to | %3C%3D . |
- Filters string `json:"filters"`
- // Limit number of returned metrics.
- Limit int64 `json:"limit"`
- // One or more metrics to compute.
- Metrics []string `json:"metrics"`
- // Start of time interval to query, defaults to 6 hours before request received.
- Since time.Time `json:"since" format:"date-time"`
- // Array of dimensions or metrics to sort by, each dimension/metric may be prefixed
- // by - (descending) or + (ascending).
- Sort []interface{} `json:"sort"`
- // End of time interval to query, defaults to current time.
- Until time.Time `json:"until" format:"date-time"`
- JSON storageAnalyticsStoredResponseQueryJSON `json:"-"`
-}
-
-// storageAnalyticsStoredResponseQueryJSON contains the JSON metadata for the
-// struct [StorageAnalyticsStoredResponseQuery]
-type storageAnalyticsStoredResponseQueryJSON struct {
- Dimensions apijson.Field
- Filters apijson.Field
- Limit apijson.Field
- Metrics apijson.Field
- Since apijson.Field
- Sort apijson.Field
- Until apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StorageAnalyticsStoredResponseQuery) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r storageAnalyticsStoredResponseQueryJSON) RawJSON() string {
- return r.raw
-}
-
-type StorageAnalyticsListParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
- // For specifying result metrics.
- Query param.Field[StorageAnalyticsListParamsQuery] `query:"query"`
-}
-
-// URLQuery serializes [StorageAnalyticsListParams]'s query parameters as
-// `url.Values`.
-func (r StorageAnalyticsListParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// For specifying result metrics.
-type StorageAnalyticsListParamsQuery struct {
- // Can be used to break down the data by given attributes.
- Dimensions param.Field[[]StorageAnalyticsListParamsQueryDimension] `query:"dimensions"`
- // Used to filter rows by one or more dimensions. Filters can be combined using OR
- // and AND boolean logic. AND takes precedence over OR in all the expressions. The
- // OR operator is defined using a comma (,) or OR keyword surrounded by whitespace.
- // The AND operator is defined using a semicolon (;) or AND keyword surrounded by
- // whitespace. Note that the semicolon is a reserved character in URLs (rfc1738)
- // and needs to be percent-encoded as %3B. Comparison options are:
- //
- // | Operator | Name | URL Encoded |
- // | -------- | ------------------------ | ----------- |
- // | == | Equals | %3D%3D |
- // | != | Does not equals | !%3D |
- // | > | Greater Than | %3E |
- // | < | Less Than | %3C |
- // | >= | Greater than or equal to | %3E%3D |
- // | <= | Less than or equal to | %3C%3D . |
- Filters param.Field[string] `query:"filters"`
- // Limit number of returned metrics.
- Limit param.Field[int64] `query:"limit"`
- // One or more metrics to compute.
- Metrics param.Field[[]StorageAnalyticsListParamsQueryMetric] `query:"metrics"`
- // Start of time interval to query, defaults to 6 hours before request received.
- Since param.Field[time.Time] `query:"since" format:"date-time"`
- // Array of dimensions or metrics to sort by, each dimension/metric may be prefixed
- // by - (descending) or + (ascending).
- Sort param.Field[[]interface{}] `query:"sort"`
- // End of time interval to query, defaults to current time.
- Until param.Field[time.Time] `query:"until" format:"date-time"`
-}
-
-// URLQuery serializes [StorageAnalyticsListParamsQuery]'s query parameters as
-// `url.Values`.
-func (r StorageAnalyticsListParamsQuery) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// For drilling down on metrics.
-type StorageAnalyticsListParamsQueryDimension string
-
-const (
- StorageAnalyticsListParamsQueryDimensionAccountID StorageAnalyticsListParamsQueryDimension = "accountId"
- StorageAnalyticsListParamsQueryDimensionResponseCode StorageAnalyticsListParamsQueryDimension = "responseCode"
- StorageAnalyticsListParamsQueryDimensionRequestType StorageAnalyticsListParamsQueryDimension = "requestType"
-)
-
-// A quantitative measurement of KV usage.
-type StorageAnalyticsListParamsQueryMetric string
-
-const (
- StorageAnalyticsListParamsQueryMetricRequests StorageAnalyticsListParamsQueryMetric = "requests"
- StorageAnalyticsListParamsQueryMetricWriteKiB StorageAnalyticsListParamsQueryMetric = "writeKiB"
- StorageAnalyticsListParamsQueryMetricReadKiB StorageAnalyticsListParamsQueryMetric = "readKiB"
-)
-
-type StorageAnalyticsListResponseEnvelope struct {
- Errors []StorageAnalyticsListResponseEnvelopeErrors `json:"errors,required"`
- Messages []StorageAnalyticsListResponseEnvelopeMessages `json:"messages,required"`
- // Metrics on Workers KV requests.
- Result StorageAnalyticsListResponse `json:"result,required"`
- // Whether the API call was successful
- Success StorageAnalyticsListResponseEnvelopeSuccess `json:"success,required"`
- JSON storageAnalyticsListResponseEnvelopeJSON `json:"-"`
-}
-
-// storageAnalyticsListResponseEnvelopeJSON contains the JSON metadata for the
-// struct [StorageAnalyticsListResponseEnvelope]
-type storageAnalyticsListResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StorageAnalyticsListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r storageAnalyticsListResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type StorageAnalyticsListResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON storageAnalyticsListResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// storageAnalyticsListResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [StorageAnalyticsListResponseEnvelopeErrors]
-type storageAnalyticsListResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StorageAnalyticsListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r storageAnalyticsListResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type StorageAnalyticsListResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON storageAnalyticsListResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// storageAnalyticsListResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [StorageAnalyticsListResponseEnvelopeMessages]
-type storageAnalyticsListResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StorageAnalyticsListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r storageAnalyticsListResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type StorageAnalyticsListResponseEnvelopeSuccess bool
-
-const (
- StorageAnalyticsListResponseEnvelopeSuccessTrue StorageAnalyticsListResponseEnvelopeSuccess = true
-)
-
-type StorageAnalyticsStoredParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
- // For specifying result metrics.
- Query param.Field[StorageAnalyticsStoredParamsQuery] `query:"query"`
-}
-
-// URLQuery serializes [StorageAnalyticsStoredParams]'s query parameters as
-// `url.Values`.
-func (r StorageAnalyticsStoredParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// For specifying result metrics.
-type StorageAnalyticsStoredParamsQuery struct {
- // Can be used to break down the data by given attributes.
- Dimensions param.Field[[]StorageAnalyticsStoredParamsQueryDimension] `query:"dimensions"`
- // Used to filter rows by one or more dimensions. Filters can be combined using OR
- // and AND boolean logic. AND takes precedence over OR in all the expressions. The
- // OR operator is defined using a comma (,) or OR keyword surrounded by whitespace.
- // The AND operator is defined using a semicolon (;) or AND keyword surrounded by
- // whitespace. Note that the semicolon is a reserved character in URLs (rfc1738)
- // and needs to be percent-encoded as %3B. Comparison options are:
- //
- // | Operator | Name | URL Encoded |
- // | -------- | ------------------------ | ----------- |
- // | == | Equals | %3D%3D |
- // | != | Does not equals | !%3D |
- // | > | Greater Than | %3E |
- // | < | Less Than | %3C |
- // | >= | Greater than or equal to | %3E%3D |
- // | <= | Less than or equal to | %3C%3D . |
- Filters param.Field[string] `query:"filters"`
- // Limit number of returned metrics.
- Limit param.Field[int64] `query:"limit"`
- // One or more metrics to compute.
- Metrics param.Field[[]StorageAnalyticsStoredParamsQueryMetric] `query:"metrics"`
- // Start of time interval to query, defaults to 6 hours before request received.
- Since param.Field[time.Time] `query:"since" format:"date-time"`
- // Array of dimensions or metrics to sort by, each dimension/metric may be prefixed
- // by - (descending) or + (ascending).
- Sort param.Field[[]interface{}] `query:"sort"`
- // End of time interval to query, defaults to current time.
- Until param.Field[time.Time] `query:"until" format:"date-time"`
-}
-
-// URLQuery serializes [StorageAnalyticsStoredParamsQuery]'s query parameters as
-// `url.Values`.
-func (r StorageAnalyticsStoredParamsQuery) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// For drilling down on metrics.
-type StorageAnalyticsStoredParamsQueryDimension string
-
-const (
- StorageAnalyticsStoredParamsQueryDimensionNamespaceID StorageAnalyticsStoredParamsQueryDimension = "namespaceId"
-)
-
-// A quantitative measurement of KV usage.
-type StorageAnalyticsStoredParamsQueryMetric string
-
-const (
- StorageAnalyticsStoredParamsQueryMetricStoredBytes StorageAnalyticsStoredParamsQueryMetric = "storedBytes"
- StorageAnalyticsStoredParamsQueryMetricStoredKeys StorageAnalyticsStoredParamsQueryMetric = "storedKeys"
-)
-
-type StorageAnalyticsStoredResponseEnvelope struct {
- Errors []StorageAnalyticsStoredResponseEnvelopeErrors `json:"errors,required"`
- Messages []StorageAnalyticsStoredResponseEnvelopeMessages `json:"messages,required"`
- // Metrics on Workers KV requests.
- Result StorageAnalyticsStoredResponse `json:"result,required"`
- // Whether the API call was successful
- Success StorageAnalyticsStoredResponseEnvelopeSuccess `json:"success,required"`
- JSON storageAnalyticsStoredResponseEnvelopeJSON `json:"-"`
-}
-
-// storageAnalyticsStoredResponseEnvelopeJSON contains the JSON metadata for the
-// struct [StorageAnalyticsStoredResponseEnvelope]
-type storageAnalyticsStoredResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StorageAnalyticsStoredResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r storageAnalyticsStoredResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type StorageAnalyticsStoredResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON storageAnalyticsStoredResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// storageAnalyticsStoredResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [StorageAnalyticsStoredResponseEnvelopeErrors]
-type storageAnalyticsStoredResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StorageAnalyticsStoredResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r storageAnalyticsStoredResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type StorageAnalyticsStoredResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON storageAnalyticsStoredResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// storageAnalyticsStoredResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [StorageAnalyticsStoredResponseEnvelopeMessages]
-type storageAnalyticsStoredResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StorageAnalyticsStoredResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r storageAnalyticsStoredResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type StorageAnalyticsStoredResponseEnvelopeSuccess bool
-
-const (
- StorageAnalyticsStoredResponseEnvelopeSuccessTrue StorageAnalyticsStoredResponseEnvelopeSuccess = true
-)
diff --git a/storageanalytics_test.go b/storageanalytics_test.go
deleted file mode 100644
index c4abf2111a4..00000000000
--- a/storageanalytics_test.go
+++ /dev/null
@@ -1,85 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
- "time"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestStorageAnalyticsListWithOptionalParams(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"),
- )
- _, err := client.Storage.Analytics.List(context.TODO(), cloudflare.StorageAnalyticsListParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Query: cloudflare.F(cloudflare.StorageAnalyticsListParamsQuery{
- Dimensions: cloudflare.F([]cloudflare.StorageAnalyticsListParamsQueryDimension{cloudflare.StorageAnalyticsListParamsQueryDimensionAccountID, cloudflare.StorageAnalyticsListParamsQueryDimensionResponseCode, cloudflare.StorageAnalyticsListParamsQueryDimensionRequestType}),
- Filters: cloudflare.F("requestType==read AND responseCode!=200"),
- Limit: cloudflare.F(int64(0)),
- Metrics: cloudflare.F([]cloudflare.StorageAnalyticsListParamsQueryMetric{cloudflare.StorageAnalyticsListParamsQueryMetricRequests, cloudflare.StorageAnalyticsListParamsQueryMetricWriteKiB, cloudflare.StorageAnalyticsListParamsQueryMetricReadKiB}),
- Since: cloudflare.F(time.Now()),
- Sort: cloudflare.F([]interface{}{"+requests", "-responseCode"}),
- Until: cloudflare.F(time.Now()),
- }),
- })
- 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())
- }
-}
-
-func TestStorageAnalyticsStoredWithOptionalParams(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"),
- )
- _, err := client.Storage.Analytics.Stored(context.TODO(), cloudflare.StorageAnalyticsStoredParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Query: cloudflare.F(cloudflare.StorageAnalyticsStoredParamsQuery{
- Dimensions: cloudflare.F([]cloudflare.StorageAnalyticsStoredParamsQueryDimension{cloudflare.StorageAnalyticsStoredParamsQueryDimensionNamespaceID}),
- Filters: cloudflare.F("namespaceId==a4e8cbb7-1b58-4990-925e-e026d40c4c64"),
- Limit: cloudflare.F(int64(0)),
- Metrics: cloudflare.F([]cloudflare.StorageAnalyticsStoredParamsQueryMetric{cloudflare.StorageAnalyticsStoredParamsQueryMetricStoredBytes, cloudflare.StorageAnalyticsStoredParamsQueryMetricStoredKeys}),
- Since: cloudflare.F(time.Now()),
- Sort: cloudflare.F([]interface{}{"+storedBytes", "-namespaceId"}),
- Until: cloudflare.F(time.Now()),
- }),
- })
- 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/stream.go b/stream.go
deleted file mode 100644
index 0d847db6a0c..00000000000
--- a/stream.go
+++ /dev/null
@@ -1,898 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "net/url"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/apiquery"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// StreamService contains methods and other services that help with interacting
-// with the cloudflare API. Note, unlike clients, this service does not read
-// variables from the environment automatically. You should not instantiate this
-// service directly, and instead use the [NewStreamService] method instead.
-type StreamService struct {
- Options []option.RequestOption
- AudioTracks *StreamAudioTrackService
- Videos *StreamVideoService
- Clips *StreamClipService
- Copies *StreamCopyService
- DirectUploads *StreamDirectUploadService
- Keys *StreamKeyService
- LiveInputs *StreamLiveInputService
- Watermarks *StreamWatermarkService
- Webhooks *StreamWebhookService
- Captions *StreamCaptionService
- Downloads *StreamDownloadService
- Embeds *StreamEmbedService
- Tokens *StreamTokenService
-}
-
-// NewStreamService generates a new service that applies the given options to each
-// request. These options are applied after the parent client's options (if there
-// is one), and before any request-specific options.
-func NewStreamService(opts ...option.RequestOption) (r *StreamService) {
- r = &StreamService{}
- r.Options = opts
- r.AudioTracks = NewStreamAudioTrackService(opts...)
- r.Videos = NewStreamVideoService(opts...)
- r.Clips = NewStreamClipService(opts...)
- r.Copies = NewStreamCopyService(opts...)
- r.DirectUploads = NewStreamDirectUploadService(opts...)
- r.Keys = NewStreamKeyService(opts...)
- r.LiveInputs = NewStreamLiveInputService(opts...)
- r.Watermarks = NewStreamWatermarkService(opts...)
- r.Webhooks = NewStreamWebhookService(opts...)
- r.Captions = NewStreamCaptionService(opts...)
- r.Downloads = NewStreamDownloadService(opts...)
- r.Embeds = NewStreamEmbedService(opts...)
- r.Tokens = NewStreamTokenService(opts...)
- return
-}
-
-// Initiates a video upload using the TUS protocol. On success, the server responds
-// with a status code 201 (created) and includes a `location` header to indicate
-// where the content should be uploaded. Refer to https://tus.io for protocol
-// details.
-func (r *StreamService) New(ctx context.Context, params StreamNewParams, opts ...option.RequestOption) (err error) {
- opts = append(r.Options[:], opts...)
- opts = append([]option.RequestOption{option.WithHeader("Accept", "")}, opts...)
- path := fmt.Sprintf("accounts/%s/stream", params.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, nil, opts...)
- return
-}
-
-// Lists up to 1000 videos from a single request. For a specific range, refer to
-// the optional parameters.
-func (r *StreamService) List(ctx context.Context, params StreamListParams, opts ...option.RequestOption) (res *[]StreamListResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env StreamListResponseEnvelope
- path := fmt.Sprintf("accounts/%s/stream", params.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Deletes a video and its copies from Cloudflare Stream.
-func (r *StreamService) Delete(ctx context.Context, identifier string, body StreamDeleteParams, opts ...option.RequestOption) (err error) {
- opts = append(r.Options[:], opts...)
- opts = append([]option.RequestOption{option.WithHeader("Accept", "")}, opts...)
- path := fmt.Sprintf("accounts/%s/stream/%s", body.AccountID, identifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, nil, opts...)
- return
-}
-
-// Fetches details for a single video.
-func (r *StreamService) Get(ctx context.Context, identifier string, query StreamGetParams, opts ...option.RequestOption) (res *StreamGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env StreamGetResponseEnvelope
- path := fmt.Sprintf("accounts/%s/stream/%s", query.AccountID, identifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type StreamListResponse struct {
- // Lists the origins allowed to display the video. Enter allowed origin domains in
- // an array and use `*` for wildcard subdomains. Empty arrays allow the video to be
- // viewed on any origin.
- AllowedOrigins []string `json:"allowedOrigins"`
- // The date and time the media item was created.
- Created time.Time `json:"created" format:"date-time"`
- // A user-defined identifier for the media creator.
- Creator string `json:"creator"`
- // The duration of the video in seconds. A value of `-1` means the duration is
- // unknown. The duration becomes available after the upload and before the video is
- // ready.
- Duration float64 `json:"duration"`
- Input StreamListResponseInput `json:"input"`
- // The live input ID used to upload a video with Stream Live.
- LiveInput string `json:"liveInput"`
- // The maximum duration in seconds for a video upload. Can be set for a video that
- // is not yet uploaded to limit its duration. Uploads that exceed the specified
- // duration will fail during processing. A value of `-1` means the value is
- // unknown.
- MaxDurationSeconds int64 `json:"maxDurationSeconds"`
- // A user modifiable key-value store used to reference other systems of record for
- // managing videos.
- Meta interface{} `json:"meta"`
- // The date and time the media item was last modified.
- Modified time.Time `json:"modified" format:"date-time"`
- Playback StreamListResponsePlayback `json:"playback"`
- // The video's preview page URI. This field is omitted until encoding is complete.
- Preview string `json:"preview" format:"uri"`
- // Indicates whether the video is playable. The field is empty if the video is not
- // ready for viewing or the live stream is still in progress.
- ReadyToStream bool `json:"readyToStream"`
- // Indicates the time at which the video became playable. The field is empty if the
- // video is not ready for viewing or the live stream is still in progress.
- ReadyToStreamAt time.Time `json:"readyToStreamAt" format:"date-time"`
- // Indicates whether the video can be a accessed using the UID. When set to `true`,
- // a signed token must be generated with a signing key to view the video.
- RequireSignedURLs bool `json:"requireSignedURLs"`
- // Indicates the date and time at which the video will be deleted. Omit the field
- // to indicate no change, or include with a `null` value to remove an existing
- // scheduled deletion. If specified, must be at least 30 days from upload time.
- ScheduledDeletion time.Time `json:"scheduledDeletion" format:"date-time"`
- // The size of the media item in bytes.
- Size float64 `json:"size"`
- // Specifies a detailed status for a video. If the `state` is `inprogress` or
- // `error`, the `step` field returns `encoding` or `manifest`. If the `state` is
- // `inprogress`, `pctComplete` returns a number between 0 and 100 to indicate the
- // approximate percent of completion. If the `state` is `error`, `errorReasonCode`
- // and `errorReasonText` provide additional details.
- Status StreamListResponseStatus `json:"status"`
- // The media item's thumbnail URI. This field is omitted until encoding is
- // complete.
- Thumbnail string `json:"thumbnail" format:"uri"`
- // The timestamp for a thumbnail image calculated as a percentage value of the
- // video's duration. To convert from a second-wise timestamp to a percentage,
- // divide the desired timestamp by the total duration of the video. If this value
- // is not set, the default thumbnail image is taken from 0s of the video.
- ThumbnailTimestampPct float64 `json:"thumbnailTimestampPct"`
- // A Cloudflare-generated unique identifier for a media item.
- Uid string `json:"uid"`
- // The date and time the media item was uploaded.
- Uploaded time.Time `json:"uploaded" format:"date-time"`
- // The date and time when the video upload URL is no longer valid for direct user
- // uploads.
- UploadExpiry time.Time `json:"uploadExpiry" format:"date-time"`
- Watermark StreamListResponseWatermark `json:"watermark"`
- JSON streamListResponseJSON `json:"-"`
-}
-
-// streamListResponseJSON contains the JSON metadata for the struct
-// [StreamListResponse]
-type streamListResponseJSON struct {
- AllowedOrigins apijson.Field
- Created apijson.Field
- Creator apijson.Field
- Duration apijson.Field
- Input apijson.Field
- LiveInput apijson.Field
- MaxDurationSeconds apijson.Field
- Meta apijson.Field
- Modified apijson.Field
- Playback apijson.Field
- Preview apijson.Field
- ReadyToStream apijson.Field
- ReadyToStreamAt apijson.Field
- RequireSignedURLs apijson.Field
- ScheduledDeletion apijson.Field
- Size apijson.Field
- Status apijson.Field
- Thumbnail apijson.Field
- ThumbnailTimestampPct apijson.Field
- Uid apijson.Field
- Uploaded apijson.Field
- UploadExpiry apijson.Field
- Watermark apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StreamListResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r streamListResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type StreamListResponseInput struct {
- // The video height in pixels. A value of `-1` means the height is unknown. The
- // value becomes available after the upload and before the video is ready.
- Height int64 `json:"height"`
- // The video width in pixels. A value of `-1` means the width is unknown. The value
- // becomes available after the upload and before the video is ready.
- Width int64 `json:"width"`
- JSON streamListResponseInputJSON `json:"-"`
-}
-
-// streamListResponseInputJSON contains the JSON metadata for the struct
-// [StreamListResponseInput]
-type streamListResponseInputJSON struct {
- Height apijson.Field
- Width apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StreamListResponseInput) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r streamListResponseInputJSON) RawJSON() string {
- return r.raw
-}
-
-type StreamListResponsePlayback struct {
- // DASH Media Presentation Description for the video.
- Dash string `json:"dash"`
- // The HLS manifest for the video.
- Hls string `json:"hls"`
- JSON streamListResponsePlaybackJSON `json:"-"`
-}
-
-// streamListResponsePlaybackJSON contains the JSON metadata for the struct
-// [StreamListResponsePlayback]
-type streamListResponsePlaybackJSON struct {
- Dash apijson.Field
- Hls apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StreamListResponsePlayback) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r streamListResponsePlaybackJSON) RawJSON() string {
- return r.raw
-}
-
-// Specifies a detailed status for a video. If the `state` is `inprogress` or
-// `error`, the `step` field returns `encoding` or `manifest`. If the `state` is
-// `inprogress`, `pctComplete` returns a number between 0 and 100 to indicate the
-// approximate percent of completion. If the `state` is `error`, `errorReasonCode`
-// and `errorReasonText` provide additional details.
-type StreamListResponseStatus struct {
- // Specifies why the video failed to encode. This field is empty if the video is
- // not in an `error` state. Preferred for programmatic use.
- ErrorReasonCode string `json:"errorReasonCode"`
- // Specifies why the video failed to encode using a human readable error message in
- // English. This field is empty if the video is not in an `error` state.
- ErrorReasonText string `json:"errorReasonText"`
- // Indicates the size of the entire upload in bytes. The value must be a
- // non-negative integer.
- PctComplete string `json:"pctComplete"`
- // Specifies the processing status for all quality levels for a video.
- State StreamListResponseStatusState `json:"state"`
- JSON streamListResponseStatusJSON `json:"-"`
-}
-
-// streamListResponseStatusJSON contains the JSON metadata for the struct
-// [StreamListResponseStatus]
-type streamListResponseStatusJSON struct {
- ErrorReasonCode apijson.Field
- ErrorReasonText apijson.Field
- PctComplete apijson.Field
- State apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StreamListResponseStatus) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r streamListResponseStatusJSON) RawJSON() string {
- return r.raw
-}
-
-// Specifies the processing status for all quality levels for a video.
-type StreamListResponseStatusState string
-
-const (
- StreamListResponseStatusStatePendingupload StreamListResponseStatusState = "pendingupload"
- StreamListResponseStatusStateDownloading StreamListResponseStatusState = "downloading"
- StreamListResponseStatusStateQueued StreamListResponseStatusState = "queued"
- StreamListResponseStatusStateInprogress StreamListResponseStatusState = "inprogress"
- StreamListResponseStatusStateReady StreamListResponseStatusState = "ready"
- StreamListResponseStatusStateError StreamListResponseStatusState = "error"
-)
-
-type StreamListResponseWatermark struct {
- // The date and a time a watermark profile was created.
- Created time.Time `json:"created" format:"date-time"`
- // The source URL for a downloaded image. If the watermark profile was created via
- // direct upload, this field is null.
- DownloadedFrom string `json:"downloadedFrom"`
- // The height of the image in pixels.
- Height int64 `json:"height"`
- // A short description of the watermark profile.
- Name string `json:"name"`
- // The translucency of the image. A value of `0.0` makes the image completely
- // transparent, and `1.0` makes the image completely opaque. Note that if the image
- // is already semi-transparent, setting this to `1.0` will not make the image
- // completely opaque.
- Opacity float64 `json:"opacity"`
- // The whitespace between the adjacent edges (determined by position) of the video
- // and the image. `0.0` indicates no padding, and `1.0` indicates a fully padded
- // video width or length, as determined by the algorithm.
- Padding float64 `json:"padding"`
- // The location of the image. Valid positions are: `upperRight`, `upperLeft`,
- // `lowerLeft`, `lowerRight`, and `center`. Note that `center` ignores the
- // `padding` parameter.
- Position string `json:"position"`
- // The size of the image relative to the overall size of the video. This parameter
- // will adapt to horizontal and vertical videos automatically. `0.0` indicates no
- // scaling (use the size of the image as-is), and `1.0 `fills the entire video.
- Scale float64 `json:"scale"`
- // The size of the image in bytes.
- Size float64 `json:"size"`
- // The unique identifier for a watermark profile.
- Uid string `json:"uid"`
- // The width of the image in pixels.
- Width int64 `json:"width"`
- JSON streamListResponseWatermarkJSON `json:"-"`
-}
-
-// streamListResponseWatermarkJSON contains the JSON metadata for the struct
-// [StreamListResponseWatermark]
-type streamListResponseWatermarkJSON struct {
- Created apijson.Field
- DownloadedFrom apijson.Field
- Height apijson.Field
- Name apijson.Field
- Opacity apijson.Field
- Padding apijson.Field
- Position apijson.Field
- Scale apijson.Field
- Size apijson.Field
- Uid apijson.Field
- Width apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StreamListResponseWatermark) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r streamListResponseWatermarkJSON) RawJSON() string {
- return r.raw
-}
-
-type StreamGetResponse struct {
- // Lists the origins allowed to display the video. Enter allowed origin domains in
- // an array and use `*` for wildcard subdomains. Empty arrays allow the video to be
- // viewed on any origin.
- AllowedOrigins []string `json:"allowedOrigins"`
- // The date and time the media item was created.
- Created time.Time `json:"created" format:"date-time"`
- // A user-defined identifier for the media creator.
- Creator string `json:"creator"`
- // The duration of the video in seconds. A value of `-1` means the duration is
- // unknown. The duration becomes available after the upload and before the video is
- // ready.
- Duration float64 `json:"duration"`
- Input StreamGetResponseInput `json:"input"`
- // The live input ID used to upload a video with Stream Live.
- LiveInput string `json:"liveInput"`
- // The maximum duration in seconds for a video upload. Can be set for a video that
- // is not yet uploaded to limit its duration. Uploads that exceed the specified
- // duration will fail during processing. A value of `-1` means the value is
- // unknown.
- MaxDurationSeconds int64 `json:"maxDurationSeconds"`
- // A user modifiable key-value store used to reference other systems of record for
- // managing videos.
- Meta interface{} `json:"meta"`
- // The date and time the media item was last modified.
- Modified time.Time `json:"modified" format:"date-time"`
- Playback StreamGetResponsePlayback `json:"playback"`
- // The video's preview page URI. This field is omitted until encoding is complete.
- Preview string `json:"preview" format:"uri"`
- // Indicates whether the video is playable. The field is empty if the video is not
- // ready for viewing or the live stream is still in progress.
- ReadyToStream bool `json:"readyToStream"`
- // Indicates the time at which the video became playable. The field is empty if the
- // video is not ready for viewing or the live stream is still in progress.
- ReadyToStreamAt time.Time `json:"readyToStreamAt" format:"date-time"`
- // Indicates whether the video can be a accessed using the UID. When set to `true`,
- // a signed token must be generated with a signing key to view the video.
- RequireSignedURLs bool `json:"requireSignedURLs"`
- // Indicates the date and time at which the video will be deleted. Omit the field
- // to indicate no change, or include with a `null` value to remove an existing
- // scheduled deletion. If specified, must be at least 30 days from upload time.
- ScheduledDeletion time.Time `json:"scheduledDeletion" format:"date-time"`
- // The size of the media item in bytes.
- Size float64 `json:"size"`
- // Specifies a detailed status for a video. If the `state` is `inprogress` or
- // `error`, the `step` field returns `encoding` or `manifest`. If the `state` is
- // `inprogress`, `pctComplete` returns a number between 0 and 100 to indicate the
- // approximate percent of completion. If the `state` is `error`, `errorReasonCode`
- // and `errorReasonText` provide additional details.
- Status StreamGetResponseStatus `json:"status"`
- // The media item's thumbnail URI. This field is omitted until encoding is
- // complete.
- Thumbnail string `json:"thumbnail" format:"uri"`
- // The timestamp for a thumbnail image calculated as a percentage value of the
- // video's duration. To convert from a second-wise timestamp to a percentage,
- // divide the desired timestamp by the total duration of the video. If this value
- // is not set, the default thumbnail image is taken from 0s of the video.
- ThumbnailTimestampPct float64 `json:"thumbnailTimestampPct"`
- // A Cloudflare-generated unique identifier for a media item.
- Uid string `json:"uid"`
- // The date and time the media item was uploaded.
- Uploaded time.Time `json:"uploaded" format:"date-time"`
- // The date and time when the video upload URL is no longer valid for direct user
- // uploads.
- UploadExpiry time.Time `json:"uploadExpiry" format:"date-time"`
- Watermark StreamGetResponseWatermark `json:"watermark"`
- JSON streamGetResponseJSON `json:"-"`
-}
-
-// streamGetResponseJSON contains the JSON metadata for the struct
-// [StreamGetResponse]
-type streamGetResponseJSON struct {
- AllowedOrigins apijson.Field
- Created apijson.Field
- Creator apijson.Field
- Duration apijson.Field
- Input apijson.Field
- LiveInput apijson.Field
- MaxDurationSeconds apijson.Field
- Meta apijson.Field
- Modified apijson.Field
- Playback apijson.Field
- Preview apijson.Field
- ReadyToStream apijson.Field
- ReadyToStreamAt apijson.Field
- RequireSignedURLs apijson.Field
- ScheduledDeletion apijson.Field
- Size apijson.Field
- Status apijson.Field
- Thumbnail apijson.Field
- ThumbnailTimestampPct apijson.Field
- Uid apijson.Field
- Uploaded apijson.Field
- UploadExpiry apijson.Field
- Watermark apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StreamGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r streamGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type StreamGetResponseInput struct {
- // The video height in pixels. A value of `-1` means the height is unknown. The
- // value becomes available after the upload and before the video is ready.
- Height int64 `json:"height"`
- // The video width in pixels. A value of `-1` means the width is unknown. The value
- // becomes available after the upload and before the video is ready.
- Width int64 `json:"width"`
- JSON streamGetResponseInputJSON `json:"-"`
-}
-
-// streamGetResponseInputJSON contains the JSON metadata for the struct
-// [StreamGetResponseInput]
-type streamGetResponseInputJSON struct {
- Height apijson.Field
- Width apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StreamGetResponseInput) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r streamGetResponseInputJSON) RawJSON() string {
- return r.raw
-}
-
-type StreamGetResponsePlayback struct {
- // DASH Media Presentation Description for the video.
- Dash string `json:"dash"`
- // The HLS manifest for the video.
- Hls string `json:"hls"`
- JSON streamGetResponsePlaybackJSON `json:"-"`
-}
-
-// streamGetResponsePlaybackJSON contains the JSON metadata for the struct
-// [StreamGetResponsePlayback]
-type streamGetResponsePlaybackJSON struct {
- Dash apijson.Field
- Hls apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StreamGetResponsePlayback) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r streamGetResponsePlaybackJSON) RawJSON() string {
- return r.raw
-}
-
-// Specifies a detailed status for a video. If the `state` is `inprogress` or
-// `error`, the `step` field returns `encoding` or `manifest`. If the `state` is
-// `inprogress`, `pctComplete` returns a number between 0 and 100 to indicate the
-// approximate percent of completion. If the `state` is `error`, `errorReasonCode`
-// and `errorReasonText` provide additional details.
-type StreamGetResponseStatus struct {
- // Specifies why the video failed to encode. This field is empty if the video is
- // not in an `error` state. Preferred for programmatic use.
- ErrorReasonCode string `json:"errorReasonCode"`
- // Specifies why the video failed to encode using a human readable error message in
- // English. This field is empty if the video is not in an `error` state.
- ErrorReasonText string `json:"errorReasonText"`
- // Indicates the size of the entire upload in bytes. The value must be a
- // non-negative integer.
- PctComplete string `json:"pctComplete"`
- // Specifies the processing status for all quality levels for a video.
- State StreamGetResponseStatusState `json:"state"`
- JSON streamGetResponseStatusJSON `json:"-"`
-}
-
-// streamGetResponseStatusJSON contains the JSON metadata for the struct
-// [StreamGetResponseStatus]
-type streamGetResponseStatusJSON struct {
- ErrorReasonCode apijson.Field
- ErrorReasonText apijson.Field
- PctComplete apijson.Field
- State apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StreamGetResponseStatus) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r streamGetResponseStatusJSON) RawJSON() string {
- return r.raw
-}
-
-// Specifies the processing status for all quality levels for a video.
-type StreamGetResponseStatusState string
-
-const (
- StreamGetResponseStatusStatePendingupload StreamGetResponseStatusState = "pendingupload"
- StreamGetResponseStatusStateDownloading StreamGetResponseStatusState = "downloading"
- StreamGetResponseStatusStateQueued StreamGetResponseStatusState = "queued"
- StreamGetResponseStatusStateInprogress StreamGetResponseStatusState = "inprogress"
- StreamGetResponseStatusStateReady StreamGetResponseStatusState = "ready"
- StreamGetResponseStatusStateError StreamGetResponseStatusState = "error"
-)
-
-type StreamGetResponseWatermark struct {
- // The date and a time a watermark profile was created.
- Created time.Time `json:"created" format:"date-time"`
- // The source URL for a downloaded image. If the watermark profile was created via
- // direct upload, this field is null.
- DownloadedFrom string `json:"downloadedFrom"`
- // The height of the image in pixels.
- Height int64 `json:"height"`
- // A short description of the watermark profile.
- Name string `json:"name"`
- // The translucency of the image. A value of `0.0` makes the image completely
- // transparent, and `1.0` makes the image completely opaque. Note that if the image
- // is already semi-transparent, setting this to `1.0` will not make the image
- // completely opaque.
- Opacity float64 `json:"opacity"`
- // The whitespace between the adjacent edges (determined by position) of the video
- // and the image. `0.0` indicates no padding, and `1.0` indicates a fully padded
- // video width or length, as determined by the algorithm.
- Padding float64 `json:"padding"`
- // The location of the image. Valid positions are: `upperRight`, `upperLeft`,
- // `lowerLeft`, `lowerRight`, and `center`. Note that `center` ignores the
- // `padding` parameter.
- Position string `json:"position"`
- // The size of the image relative to the overall size of the video. This parameter
- // will adapt to horizontal and vertical videos automatically. `0.0` indicates no
- // scaling (use the size of the image as-is), and `1.0 `fills the entire video.
- Scale float64 `json:"scale"`
- // The size of the image in bytes.
- Size float64 `json:"size"`
- // The unique identifier for a watermark profile.
- Uid string `json:"uid"`
- // The width of the image in pixels.
- Width int64 `json:"width"`
- JSON streamGetResponseWatermarkJSON `json:"-"`
-}
-
-// streamGetResponseWatermarkJSON contains the JSON metadata for the struct
-// [StreamGetResponseWatermark]
-type streamGetResponseWatermarkJSON struct {
- Created apijson.Field
- DownloadedFrom apijson.Field
- Height apijson.Field
- Name apijson.Field
- Opacity apijson.Field
- Padding apijson.Field
- Position apijson.Field
- Scale apijson.Field
- Size apijson.Field
- Uid apijson.Field
- Width apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StreamGetResponseWatermark) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r streamGetResponseWatermarkJSON) RawJSON() string {
- return r.raw
-}
-
-type StreamNewParams struct {
- // The account identifier tag.
- AccountID param.Field[string] `path:"account_id,required"`
- // Specifies the TUS protocol version. This value must be included in every upload
- // request. Notes: The only supported version of TUS protocol is 1.0.0.
- TusResumable param.Field[StreamNewParamsTusResumable] `header:"Tus-Resumable,required"`
- // Indicates the size of the entire upload in bytes. The value must be a
- // non-negative integer.
- UploadLength param.Field[int64] `header:"Upload-Length,required"`
- // A user-defined identifier for the media creator.
- UploadCreator param.Field[string] `header:"Upload-Creator"`
- // Comma-separated key-value pairs following the TUS protocol specification. Values
- // are Base-64 encoded. Supported keys: `name`, `requiresignedurls`,
- // `allowedorigins`, `thumbnailtimestamppct`, `watermark`, `scheduleddeletion`.
- UploadMetadata param.Field[string] `header:"Upload-Metadata"`
-}
-
-// Specifies the TUS protocol version. This value must be included in every upload
-// request. Notes: The only supported version of TUS protocol is 1.0.0.
-type StreamNewParamsTusResumable string
-
-const (
- StreamNewParamsTusResumable1_0_0 StreamNewParamsTusResumable = "1.0.0"
-)
-
-type StreamListParams struct {
- // The account identifier tag.
- AccountID param.Field[string] `path:"account_id,required"`
- // Lists videos in ascending order of creation.
- Asc param.Field[bool] `query:"asc"`
- // A user-defined identifier for the media creator.
- Creator param.Field[string] `query:"creator"`
- // Lists videos created before the specified date.
- End param.Field[time.Time] `query:"end" format:"date-time"`
- // Includes the total number of videos associated with the submitted query
- // parameters.
- IncludeCounts param.Field[bool] `query:"include_counts"`
- // Searches over the `name` key in the `meta` field. This field can be set with or
- // after the upload request.
- Search param.Field[string] `query:"search"`
- // Lists videos created after the specified date.
- Start param.Field[time.Time] `query:"start" format:"date-time"`
- // Specifies the processing status for all quality levels for a video.
- Status param.Field[StreamListParamsStatus] `query:"status"`
- // Specifies whether the video is `vod` or `live`.
- Type param.Field[string] `query:"type"`
-}
-
-// URLQuery serializes [StreamListParams]'s query parameters as `url.Values`.
-func (r StreamListParams) URLQuery() (v url.Values) {
- return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
- ArrayFormat: apiquery.ArrayQueryFormatComma,
- NestedFormat: apiquery.NestedQueryFormatBrackets,
- })
-}
-
-// Specifies the processing status for all quality levels for a video.
-type StreamListParamsStatus string
-
-const (
- StreamListParamsStatusPendingupload StreamListParamsStatus = "pendingupload"
- StreamListParamsStatusDownloading StreamListParamsStatus = "downloading"
- StreamListParamsStatusQueued StreamListParamsStatus = "queued"
- StreamListParamsStatusInprogress StreamListParamsStatus = "inprogress"
- StreamListParamsStatusReady StreamListParamsStatus = "ready"
- StreamListParamsStatusError StreamListParamsStatus = "error"
-)
-
-type StreamListResponseEnvelope struct {
- Errors []StreamListResponseEnvelopeErrors `json:"errors,required"`
- Messages []StreamListResponseEnvelopeMessages `json:"messages,required"`
- Result []StreamListResponse `json:"result,required"`
- // Whether the API call was successful
- Success StreamListResponseEnvelopeSuccess `json:"success,required"`
- // The total number of remaining videos based on cursor position.
- Range int64 `json:"range"`
- // The total number of videos that match the provided filters.
- Total int64 `json:"total"`
- JSON streamListResponseEnvelopeJSON `json:"-"`
-}
-
-// streamListResponseEnvelopeJSON contains the JSON metadata for the struct
-// [StreamListResponseEnvelope]
-type streamListResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- Range apijson.Field
- Total apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StreamListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r streamListResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type StreamListResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON streamListResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// streamListResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
-// [StreamListResponseEnvelopeErrors]
-type streamListResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StreamListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r streamListResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type StreamListResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON streamListResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// streamListResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
-// [StreamListResponseEnvelopeMessages]
-type streamListResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StreamListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r streamListResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type StreamListResponseEnvelopeSuccess bool
-
-const (
- StreamListResponseEnvelopeSuccessTrue StreamListResponseEnvelopeSuccess = true
-)
-
-type StreamDeleteParams struct {
- // The account identifier tag.
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type StreamGetParams struct {
- // The account identifier tag.
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type StreamGetResponseEnvelope struct {
- Errors []StreamGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []StreamGetResponseEnvelopeMessages `json:"messages,required"`
- Result StreamGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success StreamGetResponseEnvelopeSuccess `json:"success,required"`
- JSON streamGetResponseEnvelopeJSON `json:"-"`
-}
-
-// streamGetResponseEnvelopeJSON contains the JSON metadata for the struct
-// [StreamGetResponseEnvelope]
-type streamGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StreamGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r streamGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type StreamGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON streamGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// streamGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
-// [StreamGetResponseEnvelopeErrors]
-type streamGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StreamGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r streamGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type StreamGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON streamGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// streamGetResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
-// [StreamGetResponseEnvelopeMessages]
-type streamGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StreamGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r streamGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type StreamGetResponseEnvelopeSuccess bool
-
-const (
- StreamGetResponseEnvelopeSuccessTrue StreamGetResponseEnvelopeSuccess = true
-)
diff --git a/stream/aliases.go b/stream/aliases.go
new file mode 100644
index 00000000000..7d81e0f847d
--- /dev/null
+++ b/stream/aliases.go
@@ -0,0 +1,9 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package stream
+
+import (
+ "github.com/cloudflare/cloudflare-go/internal/apierror"
+)
+
+type Error = apierror.Error
diff --git a/stream/audiotrack.go b/stream/audiotrack.go
new file mode 100644
index 00000000000..796887d6c8a
--- /dev/null
+++ b/stream/audiotrack.go
@@ -0,0 +1,512 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package stream
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "reflect"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/tidwall/gjson"
+)
+
+// AudioTrackService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewAudioTrackService] method instead.
+type AudioTrackService struct {
+ Options []option.RequestOption
+}
+
+// NewAudioTrackService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewAudioTrackService(opts ...option.RequestOption) (r *AudioTrackService) {
+ r = &AudioTrackService{}
+ r.Options = opts
+ return
+}
+
+// Deletes additional audio tracks on a video. Deleting a default audio track is
+// not allowed. You must assign another audio track as default prior to deletion.
+func (r *AudioTrackService) Delete(ctx context.Context, identifier string, audioIdentifier string, body AudioTrackDeleteParams, opts ...option.RequestOption) (res *AudioTrackDeleteResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AudioTrackDeleteResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/stream/%s/audio/%s", body.AccountID, identifier, audioIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Adds an additional audio track to a video using the provided audio track URL.
+func (r *AudioTrackService) Copy(ctx context.Context, identifier string, params AudioTrackCopyParams, opts ...option.RequestOption) (res *StreamAdditionalAudio, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AudioTrackCopyResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/stream/%s/audio/copy", params.AccountID, identifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Edits additional audio tracks on a video. Editing the default status of an audio
+// track to `true` will mark all other audio tracks on the video default status to
+// `false`.
+func (r *AudioTrackService) Edit(ctx context.Context, identifier string, audioIdentifier string, params AudioTrackEditParams, opts ...option.RequestOption) (res *StreamAdditionalAudio, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AudioTrackEditResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/stream/%s/audio/%s", params.AccountID, identifier, audioIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Lists additional audio tracks on a video. Note this API will not return
+// information for audio attached to the video upload.
+func (r *AudioTrackService) Get(ctx context.Context, identifier string, query AudioTrackGetParams, opts ...option.RequestOption) (res *[]StreamAdditionalAudio, err error) {
+ opts = append(r.Options[:], opts...)
+ var env AudioTrackGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/stream/%s/audio", query.AccountID, identifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type StreamAdditionalAudio struct {
+ // Denotes whether the audio track will be played by default in a player.
+ Default bool `json:"default"`
+ // A string to uniquely identify the track amongst other audio track labels for the
+ // specified video.
+ Label string `json:"label"`
+ // Specifies the processing status of the video.
+ Status StreamAdditionalAudioStatus `json:"status"`
+ // A Cloudflare-generated unique identifier for a media item.
+ Uid string `json:"uid"`
+ JSON streamAdditionalAudioJSON `json:"-"`
+}
+
+// streamAdditionalAudioJSON contains the JSON metadata for the struct
+// [StreamAdditionalAudio]
+type streamAdditionalAudioJSON struct {
+ Default apijson.Field
+ Label apijson.Field
+ Status apijson.Field
+ Uid apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *StreamAdditionalAudio) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r streamAdditionalAudioJSON) RawJSON() string {
+ return r.raw
+}
+
+// Specifies the processing status of the video.
+type StreamAdditionalAudioStatus string
+
+const (
+ StreamAdditionalAudioStatusQueued StreamAdditionalAudioStatus = "queued"
+ StreamAdditionalAudioStatusReady StreamAdditionalAudioStatus = "ready"
+ StreamAdditionalAudioStatusError StreamAdditionalAudioStatus = "error"
+)
+
+// Union satisfied by [stream.AudioTrackDeleteResponseUnknown] or
+// [shared.UnionString].
+type AudioTrackDeleteResponse interface {
+ ImplementsStreamAudioTrackDeleteResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*AudioTrackDeleteResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+type AudioTrackDeleteParams struct {
+ // The account identifier tag.
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type AudioTrackDeleteResponseEnvelope struct {
+ Errors []AudioTrackDeleteResponseEnvelopeErrors `json:"errors,required"`
+ Messages []AudioTrackDeleteResponseEnvelopeMessages `json:"messages,required"`
+ Result AudioTrackDeleteResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success AudioTrackDeleteResponseEnvelopeSuccess `json:"success,required"`
+ JSON audioTrackDeleteResponseEnvelopeJSON `json:"-"`
+}
+
+// audioTrackDeleteResponseEnvelopeJSON contains the JSON metadata for the struct
+// [AudioTrackDeleteResponseEnvelope]
+type audioTrackDeleteResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AudioTrackDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r audioTrackDeleteResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AudioTrackDeleteResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON audioTrackDeleteResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// audioTrackDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [AudioTrackDeleteResponseEnvelopeErrors]
+type audioTrackDeleteResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AudioTrackDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r audioTrackDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type AudioTrackDeleteResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON audioTrackDeleteResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// audioTrackDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [AudioTrackDeleteResponseEnvelopeMessages]
+type audioTrackDeleteResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AudioTrackDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r audioTrackDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type AudioTrackDeleteResponseEnvelopeSuccess bool
+
+const (
+ AudioTrackDeleteResponseEnvelopeSuccessTrue AudioTrackDeleteResponseEnvelopeSuccess = true
+)
+
+type AudioTrackCopyParams struct {
+ // The account identifier tag.
+ AccountID param.Field[string] `path:"account_id,required"`
+ // A string to uniquely identify the track amongst other audio track labels for the
+ // specified video.
+ Label param.Field[string] `json:"label,required"`
+ // An audio track URL. The server must be publicly routable and support `HTTP HEAD`
+ // requests and `HTTP GET` range requests. The server should respond to `HTTP HEAD`
+ // requests with a `content-range` header that includes the size of the file.
+ URL param.Field[string] `json:"url" format:"uri"`
+}
+
+func (r AudioTrackCopyParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type AudioTrackCopyResponseEnvelope struct {
+ Errors []AudioTrackCopyResponseEnvelopeErrors `json:"errors,required"`
+ Messages []AudioTrackCopyResponseEnvelopeMessages `json:"messages,required"`
+ Result StreamAdditionalAudio `json:"result,required"`
+ // Whether the API call was successful
+ Success AudioTrackCopyResponseEnvelopeSuccess `json:"success,required"`
+ JSON audioTrackCopyResponseEnvelopeJSON `json:"-"`
+}
+
+// audioTrackCopyResponseEnvelopeJSON contains the JSON metadata for the struct
+// [AudioTrackCopyResponseEnvelope]
+type audioTrackCopyResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AudioTrackCopyResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r audioTrackCopyResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AudioTrackCopyResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON audioTrackCopyResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// audioTrackCopyResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [AudioTrackCopyResponseEnvelopeErrors]
+type audioTrackCopyResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AudioTrackCopyResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r audioTrackCopyResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type AudioTrackCopyResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON audioTrackCopyResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// audioTrackCopyResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [AudioTrackCopyResponseEnvelopeMessages]
+type audioTrackCopyResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AudioTrackCopyResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r audioTrackCopyResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type AudioTrackCopyResponseEnvelopeSuccess bool
+
+const (
+ AudioTrackCopyResponseEnvelopeSuccessTrue AudioTrackCopyResponseEnvelopeSuccess = true
+)
+
+type AudioTrackEditParams struct {
+ // The account identifier tag.
+ AccountID param.Field[string] `path:"account_id,required"`
+ // Denotes whether the audio track will be played by default in a player.
+ Default param.Field[bool] `json:"default"`
+ // A string to uniquely identify the track amongst other audio track labels for the
+ // specified video.
+ Label param.Field[string] `json:"label"`
+}
+
+func (r AudioTrackEditParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type AudioTrackEditResponseEnvelope struct {
+ Errors []AudioTrackEditResponseEnvelopeErrors `json:"errors,required"`
+ Messages []AudioTrackEditResponseEnvelopeMessages `json:"messages,required"`
+ Result StreamAdditionalAudio `json:"result,required"`
+ // Whether the API call was successful
+ Success AudioTrackEditResponseEnvelopeSuccess `json:"success,required"`
+ JSON audioTrackEditResponseEnvelopeJSON `json:"-"`
+}
+
+// audioTrackEditResponseEnvelopeJSON contains the JSON metadata for the struct
+// [AudioTrackEditResponseEnvelope]
+type audioTrackEditResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AudioTrackEditResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r audioTrackEditResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AudioTrackEditResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON audioTrackEditResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// audioTrackEditResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [AudioTrackEditResponseEnvelopeErrors]
+type audioTrackEditResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AudioTrackEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r audioTrackEditResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type AudioTrackEditResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON audioTrackEditResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// audioTrackEditResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [AudioTrackEditResponseEnvelopeMessages]
+type audioTrackEditResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AudioTrackEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r audioTrackEditResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type AudioTrackEditResponseEnvelopeSuccess bool
+
+const (
+ AudioTrackEditResponseEnvelopeSuccessTrue AudioTrackEditResponseEnvelopeSuccess = true
+)
+
+type AudioTrackGetParams struct {
+ // The account identifier tag.
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type AudioTrackGetResponseEnvelope struct {
+ Errors []AudioTrackGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []AudioTrackGetResponseEnvelopeMessages `json:"messages,required"`
+ Result []StreamAdditionalAudio `json:"result,required"`
+ // Whether the API call was successful
+ Success AudioTrackGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON audioTrackGetResponseEnvelopeJSON `json:"-"`
+}
+
+// audioTrackGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [AudioTrackGetResponseEnvelope]
+type audioTrackGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AudioTrackGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r audioTrackGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type AudioTrackGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON audioTrackGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// audioTrackGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [AudioTrackGetResponseEnvelopeErrors]
+type audioTrackGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AudioTrackGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r audioTrackGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type AudioTrackGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON audioTrackGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// audioTrackGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [AudioTrackGetResponseEnvelopeMessages]
+type audioTrackGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *AudioTrackGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r audioTrackGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type AudioTrackGetResponseEnvelopeSuccess bool
+
+const (
+ AudioTrackGetResponseEnvelopeSuccessTrue AudioTrackGetResponseEnvelopeSuccess = true
+)
diff --git a/stream/audiotrack_test.go b/stream/audiotrack_test.go
new file mode 100644
index 00000000000..cbf664cf088
--- /dev/null
+++ b/stream/audiotrack_test.go
@@ -0,0 +1,141 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package stream_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/stream"
+)
+
+func TestAudioTrackDelete(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"),
+ )
+ _, err := client.Stream.AudioTracks.Delete(
+ context.TODO(),
+ "ea95132c15732412d22c1476fa83f27a",
+ "ea95132c15732412d22c1476fa83f27a",
+ stream.AudioTrackDeleteParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestAudioTrackCopyWithOptionalParams(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"),
+ )
+ _, err := client.Stream.AudioTracks.Copy(
+ context.TODO(),
+ "ea95132c15732412d22c1476fa83f27a",
+ stream.AudioTrackCopyParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Label: cloudflare.F("director commentary"),
+ URL: cloudflare.F("https://www.examplestorage.com/audio_file.mp3"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestAudioTrackEditWithOptionalParams(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"),
+ )
+ _, err := client.Stream.AudioTracks.Edit(
+ context.TODO(),
+ "ea95132c15732412d22c1476fa83f27a",
+ "ea95132c15732412d22c1476fa83f27a",
+ stream.AudioTrackEditParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Default: cloudflare.F(true),
+ Label: cloudflare.F("director commentary"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestAudioTrackGet(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"),
+ )
+ _, err := client.Stream.AudioTracks.Get(
+ context.TODO(),
+ "ea95132c15732412d22c1476fa83f27a",
+ stream.AudioTrackGetParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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/stream/caption.go b/stream/caption.go
new file mode 100644
index 00000000000..96a8242e98c
--- /dev/null
+++ b/stream/caption.go
@@ -0,0 +1,404 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package stream
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "reflect"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/tidwall/gjson"
+)
+
+// CaptionService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewCaptionService] method instead.
+type CaptionService struct {
+ Options []option.RequestOption
+}
+
+// NewCaptionService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewCaptionService(opts ...option.RequestOption) (r *CaptionService) {
+ r = &CaptionService{}
+ r.Options = opts
+ return
+}
+
+// Uploads the caption or subtitle file to the endpoint for a specific BCP47
+// language. One caption or subtitle file per language is allowed.
+func (r *CaptionService) Update(ctx context.Context, identifier string, language string, params CaptionUpdateParams, opts ...option.RequestOption) (res *CaptionUpdateResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env CaptionUpdateResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/stream/%s/captions/%s", params.AccountID, identifier, language)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Removes the captions or subtitles from a video.
+func (r *CaptionService) Delete(ctx context.Context, identifier string, language string, body CaptionDeleteParams, opts ...option.RequestOption) (res *CaptionDeleteResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env CaptionDeleteResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/stream/%s/captions/%s", body.AccountID, identifier, language)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Lists the available captions or subtitles for a specific video.
+func (r *CaptionService) Get(ctx context.Context, identifier string, query CaptionGetParams, opts ...option.RequestOption) (res *[]StreamCaptions, err error) {
+ opts = append(r.Options[:], opts...)
+ var env CaptionGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/stream/%s/captions", query.AccountID, identifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type StreamCaptions struct {
+ // The language label displayed in the native language to users.
+ Label string `json:"label"`
+ // The language tag in BCP 47 format.
+ Language string `json:"language"`
+ JSON streamCaptionsJSON `json:"-"`
+}
+
+// streamCaptionsJSON contains the JSON metadata for the struct [StreamCaptions]
+type streamCaptionsJSON struct {
+ Label apijson.Field
+ Language apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *StreamCaptions) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r streamCaptionsJSON) RawJSON() string {
+ return r.raw
+}
+
+// Union satisfied by [stream.CaptionUpdateResponseUnknown] or
+// [shared.UnionString].
+type CaptionUpdateResponse interface {
+ ImplementsStreamCaptionUpdateResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*CaptionUpdateResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+// Union satisfied by [stream.CaptionDeleteResponseUnknown],
+// [stream.CaptionDeleteResponseArray] or [shared.UnionString].
+type CaptionDeleteResponse interface {
+ ImplementsStreamCaptionDeleteResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*CaptionDeleteResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(CaptionDeleteResponseArray{}),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+type CaptionDeleteResponseArray []interface{}
+
+func (r CaptionDeleteResponseArray) ImplementsStreamCaptionDeleteResponse() {}
+
+type CaptionUpdateParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ // The WebVTT file containing the caption or subtitle content.
+ File param.Field[string] `json:"file,required"`
+}
+
+func (r CaptionUpdateParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type CaptionUpdateResponseEnvelope struct {
+ Errors []CaptionUpdateResponseEnvelopeErrors `json:"errors,required"`
+ Messages []CaptionUpdateResponseEnvelopeMessages `json:"messages,required"`
+ Result CaptionUpdateResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success CaptionUpdateResponseEnvelopeSuccess `json:"success,required"`
+ JSON captionUpdateResponseEnvelopeJSON `json:"-"`
+}
+
+// captionUpdateResponseEnvelopeJSON contains the JSON metadata for the struct
+// [CaptionUpdateResponseEnvelope]
+type captionUpdateResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CaptionUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r captionUpdateResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type CaptionUpdateResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON captionUpdateResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// captionUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [CaptionUpdateResponseEnvelopeErrors]
+type captionUpdateResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CaptionUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r captionUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type CaptionUpdateResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON captionUpdateResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// captionUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [CaptionUpdateResponseEnvelopeMessages]
+type captionUpdateResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CaptionUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r captionUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type CaptionUpdateResponseEnvelopeSuccess bool
+
+const (
+ CaptionUpdateResponseEnvelopeSuccessTrue CaptionUpdateResponseEnvelopeSuccess = true
+)
+
+type CaptionDeleteParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type CaptionDeleteResponseEnvelope struct {
+ Errors []CaptionDeleteResponseEnvelopeErrors `json:"errors,required"`
+ Messages []CaptionDeleteResponseEnvelopeMessages `json:"messages,required"`
+ Result CaptionDeleteResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success CaptionDeleteResponseEnvelopeSuccess `json:"success,required"`
+ JSON captionDeleteResponseEnvelopeJSON `json:"-"`
+}
+
+// captionDeleteResponseEnvelopeJSON contains the JSON metadata for the struct
+// [CaptionDeleteResponseEnvelope]
+type captionDeleteResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CaptionDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r captionDeleteResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type CaptionDeleteResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON captionDeleteResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// captionDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [CaptionDeleteResponseEnvelopeErrors]
+type captionDeleteResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CaptionDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r captionDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type CaptionDeleteResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON captionDeleteResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// captionDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [CaptionDeleteResponseEnvelopeMessages]
+type captionDeleteResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CaptionDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r captionDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type CaptionDeleteResponseEnvelopeSuccess bool
+
+const (
+ CaptionDeleteResponseEnvelopeSuccessTrue CaptionDeleteResponseEnvelopeSuccess = true
+)
+
+type CaptionGetParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type CaptionGetResponseEnvelope struct {
+ Errors []CaptionGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []CaptionGetResponseEnvelopeMessages `json:"messages,required"`
+ Result []StreamCaptions `json:"result,required"`
+ // Whether the API call was successful
+ Success CaptionGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON captionGetResponseEnvelopeJSON `json:"-"`
+}
+
+// captionGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [CaptionGetResponseEnvelope]
+type captionGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CaptionGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r captionGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type CaptionGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON captionGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// captionGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [CaptionGetResponseEnvelopeErrors]
+type captionGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CaptionGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r captionGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type CaptionGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON captionGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// captionGetResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [CaptionGetResponseEnvelopeMessages]
+type captionGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CaptionGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r captionGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type CaptionGetResponseEnvelopeSuccess bool
+
+const (
+ CaptionGetResponseEnvelopeSuccessTrue CaptionGetResponseEnvelopeSuccess = true
+)
diff --git a/stream/caption_test.go b/stream/caption_test.go
new file mode 100644
index 00000000000..999722422cd
--- /dev/null
+++ b/stream/caption_test.go
@@ -0,0 +1,108 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package stream_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/stream"
+)
+
+func TestCaptionUpdate(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"),
+ )
+ _, err := client.Stream.Captions.Update(
+ context.TODO(),
+ "ea95132c15732412d22c1476fa83f27a",
+ "tr",
+ stream.CaptionUpdateParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ File: cloudflare.F("@/Users/kyle/Desktop/tr.vtt"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestCaptionDelete(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"),
+ )
+ _, err := client.Stream.Captions.Delete(
+ context.TODO(),
+ "ea95132c15732412d22c1476fa83f27a",
+ "tr",
+ stream.CaptionDeleteParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestCaptionGet(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"),
+ )
+ _, err := client.Stream.Captions.Get(
+ context.TODO(),
+ "ea95132c15732412d22c1476fa83f27a",
+ stream.CaptionGetParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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/stream/clip.go b/stream/clip.go
new file mode 100644
index 00000000000..5b4dabf1ec2
--- /dev/null
+++ b/stream/clip.go
@@ -0,0 +1,300 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package stream
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// ClipService contains methods and other services that help with interacting with
+// the cloudflare API. Note, unlike clients, this service does not read variables
+// from the environment automatically. You should not instantiate this service
+// directly, and instead use the [NewClipService] method instead.
+type ClipService struct {
+ Options []option.RequestOption
+}
+
+// NewClipService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewClipService(opts ...option.RequestOption) (r *ClipService) {
+ r = &ClipService{}
+ r.Options = opts
+ return
+}
+
+// Clips a video based on the specified start and end times provided in seconds.
+func (r *ClipService) New(ctx context.Context, params ClipNewParams, opts ...option.RequestOption) (res *StreamClipping, err error) {
+ opts = append(r.Options[:], opts...)
+ var env ClipNewResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/stream/clip", params.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type StreamClipping struct {
+ // Lists the origins allowed to display the video. Enter allowed origin domains in
+ // an array and use `*` for wildcard subdomains. Empty arrays allow the video to be
+ // viewed on any origin.
+ AllowedOrigins []string `json:"allowedOrigins"`
+ // The unique video identifier (UID).
+ ClippedFromVideoUid string `json:"clippedFromVideoUID"`
+ // The date and time the clip was created.
+ Created time.Time `json:"created" format:"date-time"`
+ // A user-defined identifier for the media creator.
+ Creator string `json:"creator"`
+ // Specifies the end time for the video clip in seconds.
+ EndTimeSeconds int64 `json:"endTimeSeconds"`
+ // The maximum duration in seconds for a video upload. Can be set for a video that
+ // is not yet uploaded to limit its duration. Uploads that exceed the specified
+ // duration will fail during processing. A value of `-1` means the value is
+ // unknown.
+ MaxDurationSeconds int64 `json:"maxDurationSeconds"`
+ // A user modifiable key-value store used to reference other systems of record for
+ // managing videos.
+ Meta interface{} `json:"meta"`
+ // The date and time the live input was last modified.
+ Modified time.Time `json:"modified" format:"date-time"`
+ Playback StreamClippingPlayback `json:"playback"`
+ // The video's preview page URI. This field is omitted until encoding is complete.
+ Preview string `json:"preview" format:"uri"`
+ // Indicates whether the video can be a accessed using the UID. When set to `true`,
+ // a signed token must be generated with a signing key to view the video.
+ RequireSignedURLs bool `json:"requireSignedURLs"`
+ // Specifies the start time for the video clip in seconds.
+ StartTimeSeconds int64 `json:"startTimeSeconds"`
+ // Specifies the processing status for all quality levels for a video.
+ Status StreamClippingStatus `json:"status"`
+ // The timestamp for a thumbnail image calculated as a percentage value of the
+ // video's duration. To convert from a second-wise timestamp to a percentage,
+ // divide the desired timestamp by the total duration of the video. If this value
+ // is not set, the default thumbnail image is taken from 0s of the video.
+ ThumbnailTimestampPct float64 `json:"thumbnailTimestampPct"`
+ Watermark StreamClippingWatermark `json:"watermark"`
+ JSON streamClippingJSON `json:"-"`
+}
+
+// streamClippingJSON contains the JSON metadata for the struct [StreamClipping]
+type streamClippingJSON struct {
+ AllowedOrigins apijson.Field
+ ClippedFromVideoUid apijson.Field
+ Created apijson.Field
+ Creator apijson.Field
+ EndTimeSeconds apijson.Field
+ MaxDurationSeconds apijson.Field
+ Meta apijson.Field
+ Modified apijson.Field
+ Playback apijson.Field
+ Preview apijson.Field
+ RequireSignedURLs apijson.Field
+ StartTimeSeconds apijson.Field
+ Status apijson.Field
+ ThumbnailTimestampPct apijson.Field
+ Watermark apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *StreamClipping) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r streamClippingJSON) RawJSON() string {
+ return r.raw
+}
+
+type StreamClippingPlayback struct {
+ // DASH Media Presentation Description for the video.
+ Dash string `json:"dash"`
+ // The HLS manifest for the video.
+ Hls string `json:"hls"`
+ JSON streamClippingPlaybackJSON `json:"-"`
+}
+
+// streamClippingPlaybackJSON contains the JSON metadata for the struct
+// [StreamClippingPlayback]
+type streamClippingPlaybackJSON struct {
+ Dash apijson.Field
+ Hls apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *StreamClippingPlayback) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r streamClippingPlaybackJSON) RawJSON() string {
+ return r.raw
+}
+
+// Specifies the processing status for all quality levels for a video.
+type StreamClippingStatus string
+
+const (
+ StreamClippingStatusPendingupload StreamClippingStatus = "pendingupload"
+ StreamClippingStatusDownloading StreamClippingStatus = "downloading"
+ StreamClippingStatusQueued StreamClippingStatus = "queued"
+ StreamClippingStatusInprogress StreamClippingStatus = "inprogress"
+ StreamClippingStatusReady StreamClippingStatus = "ready"
+ StreamClippingStatusError StreamClippingStatus = "error"
+)
+
+type StreamClippingWatermark struct {
+ // The unique identifier for the watermark profile.
+ Uid string `json:"uid"`
+ JSON streamClippingWatermarkJSON `json:"-"`
+}
+
+// streamClippingWatermarkJSON contains the JSON metadata for the struct
+// [StreamClippingWatermark]
+type streamClippingWatermarkJSON struct {
+ Uid apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *StreamClippingWatermark) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r streamClippingWatermarkJSON) RawJSON() string {
+ return r.raw
+}
+
+type ClipNewParams struct {
+ // The account identifier tag.
+ AccountID param.Field[string] `path:"account_id,required"`
+ // The unique video identifier (UID).
+ ClippedFromVideoUid param.Field[string] `json:"clippedFromVideoUID,required"`
+ // Specifies the end time for the video clip in seconds.
+ EndTimeSeconds param.Field[int64] `json:"endTimeSeconds,required"`
+ // Specifies the start time for the video clip in seconds.
+ StartTimeSeconds param.Field[int64] `json:"startTimeSeconds,required"`
+ // Lists the origins allowed to display the video. Enter allowed origin domains in
+ // an array and use `*` for wildcard subdomains. Empty arrays allow the video to be
+ // viewed on any origin.
+ AllowedOrigins param.Field[[]string] `json:"allowedOrigins"`
+ // A user-defined identifier for the media creator.
+ Creator param.Field[string] `json:"creator"`
+ // The maximum duration in seconds for a video upload. Can be set for a video that
+ // is not yet uploaded to limit its duration. Uploads that exceed the specified
+ // duration will fail during processing. A value of `-1` means the value is
+ // unknown.
+ MaxDurationSeconds param.Field[int64] `json:"maxDurationSeconds"`
+ // Indicates whether the video can be a accessed using the UID. When set to `true`,
+ // a signed token must be generated with a signing key to view the video.
+ RequireSignedURLs param.Field[bool] `json:"requireSignedURLs"`
+ // The timestamp for a thumbnail image calculated as a percentage value of the
+ // video's duration. To convert from a second-wise timestamp to a percentage,
+ // divide the desired timestamp by the total duration of the video. If this value
+ // is not set, the default thumbnail image is taken from 0s of the video.
+ ThumbnailTimestampPct param.Field[float64] `json:"thumbnailTimestampPct"`
+ Watermark param.Field[ClipNewParamsWatermark] `json:"watermark"`
+}
+
+func (r ClipNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type ClipNewParamsWatermark struct {
+ // The unique identifier for the watermark profile.
+ Uid param.Field[string] `json:"uid"`
+}
+
+func (r ClipNewParamsWatermark) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type ClipNewResponseEnvelope struct {
+ Errors []ClipNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []ClipNewResponseEnvelopeMessages `json:"messages,required"`
+ Result StreamClipping `json:"result,required"`
+ // Whether the API call was successful
+ Success ClipNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON clipNewResponseEnvelopeJSON `json:"-"`
+}
+
+// clipNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [ClipNewResponseEnvelope]
+type clipNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ClipNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r clipNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type ClipNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON clipNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// clipNewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [ClipNewResponseEnvelopeErrors]
+type clipNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ClipNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r clipNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type ClipNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON clipNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// clipNewResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [ClipNewResponseEnvelopeMessages]
+type clipNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ClipNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r clipNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type ClipNewResponseEnvelopeSuccess bool
+
+const (
+ ClipNewResponseEnvelopeSuccessTrue ClipNewResponseEnvelopeSuccess = true
+)
diff --git a/stream/clip_test.go b/stream/clip_test.go
new file mode 100644
index 00000000000..a62f51ddc86
--- /dev/null
+++ b/stream/clip_test.go
@@ -0,0 +1,52 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package stream_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/stream"
+)
+
+func TestClipNewWithOptionalParams(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"),
+ )
+ _, err := client.Stream.Clips.New(context.TODO(), stream.ClipNewParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ ClippedFromVideoUid: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ EndTimeSeconds: cloudflare.F(int64(0)),
+ StartTimeSeconds: cloudflare.F(int64(0)),
+ AllowedOrigins: cloudflare.F([]string{"example.com"}),
+ Creator: cloudflare.F("creator-id_abcde12345"),
+ MaxDurationSeconds: cloudflare.F(int64(1)),
+ RequireSignedURLs: cloudflare.F(true),
+ ThumbnailTimestampPct: cloudflare.F(0.529241),
+ Watermark: cloudflare.F(stream.ClipNewParamsWatermark{
+ Uid: cloudflare.F("ea95132c15732412d22c1476fa83f27a"),
+ }),
+ })
+ 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/stream/copy.go b/stream/copy.go
new file mode 100644
index 00000000000..f19cba44850
--- /dev/null
+++ b/stream/copy.go
@@ -0,0 +1,176 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package stream
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// CopyService contains methods and other services that help with interacting with
+// the cloudflare API. Note, unlike clients, this service does not read variables
+// from the environment automatically. You should not instantiate this service
+// directly, and instead use the [NewCopyService] method instead.
+type CopyService struct {
+ Options []option.RequestOption
+}
+
+// NewCopyService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewCopyService(opts ...option.RequestOption) (r *CopyService) {
+ r = &CopyService{}
+ r.Options = opts
+ return
+}
+
+// Uploads a video to Stream from a provided URL.
+func (r *CopyService) New(ctx context.Context, params CopyNewParams, opts ...option.RequestOption) (res *StreamVideos, err error) {
+ opts = append(r.Options[:], opts...)
+ var env CopyNewResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/stream/copy", params.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type CopyNewParams struct {
+ // The account identifier tag.
+ AccountID param.Field[string] `path:"account_id,required"`
+ // A video's URL. The server must be publicly routable and support `HTTP HEAD`
+ // requests and `HTTP GET` range requests. The server should respond to `HTTP HEAD`
+ // requests with a `content-range` header that includes the size of the file.
+ URL param.Field[string] `json:"url,required" format:"uri"`
+ // Lists the origins allowed to display the video. Enter allowed origin domains in
+ // an array and use `*` for wildcard subdomains. Empty arrays allow the video to be
+ // viewed on any origin.
+ AllowedOrigins param.Field[[]string] `json:"allowedOrigins"`
+ // A user-defined identifier for the media creator.
+ Creator param.Field[string] `json:"creator"`
+ // A user modifiable key-value store used to reference other systems of record for
+ // managing videos.
+ Meta param.Field[interface{}] `json:"meta"`
+ // Indicates whether the video can be a accessed using the UID. When set to `true`,
+ // a signed token must be generated with a signing key to view the video.
+ RequireSignedURLs param.Field[bool] `json:"requireSignedURLs"`
+ // Indicates the date and time at which the video will be deleted. Omit the field
+ // to indicate no change, or include with a `null` value to remove an existing
+ // scheduled deletion. If specified, must be at least 30 days from upload time.
+ ScheduledDeletion param.Field[time.Time] `json:"scheduledDeletion" format:"date-time"`
+ // The timestamp for a thumbnail image calculated as a percentage value of the
+ // video's duration. To convert from a second-wise timestamp to a percentage,
+ // divide the desired timestamp by the total duration of the video. If this value
+ // is not set, the default thumbnail image is taken from 0s of the video.
+ ThumbnailTimestampPct param.Field[float64] `json:"thumbnailTimestampPct"`
+ Watermark param.Field[CopyNewParamsWatermark] `json:"watermark"`
+ // A user-defined identifier for the media creator.
+ UploadCreator param.Field[string] `header:"Upload-Creator"`
+ // Comma-separated key-value pairs following the TUS protocol specification. Values
+ // are Base-64 encoded. Supported keys: `name`, `requiresignedurls`,
+ // `allowedorigins`, `thumbnailtimestamppct`, `watermark`, `scheduleddeletion`.
+ UploadMetadata param.Field[string] `header:"Upload-Metadata"`
+}
+
+func (r CopyNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type CopyNewParamsWatermark struct {
+ // The unique identifier for the watermark profile.
+ Uid param.Field[string] `json:"uid"`
+}
+
+func (r CopyNewParamsWatermark) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type CopyNewResponseEnvelope struct {
+ Errors []CopyNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []CopyNewResponseEnvelopeMessages `json:"messages,required"`
+ Result StreamVideos `json:"result,required"`
+ // Whether the API call was successful
+ Success CopyNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON copyNewResponseEnvelopeJSON `json:"-"`
+}
+
+// copyNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [CopyNewResponseEnvelope]
+type copyNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CopyNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r copyNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type CopyNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON copyNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// copyNewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [CopyNewResponseEnvelopeErrors]
+type copyNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CopyNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r copyNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type CopyNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON copyNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// copyNewResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [CopyNewResponseEnvelopeMessages]
+type copyNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CopyNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r copyNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type CopyNewResponseEnvelopeSuccess bool
+
+const (
+ CopyNewResponseEnvelopeSuccessTrue CopyNewResponseEnvelopeSuccess = true
+)
diff --git a/stream/copy_test.go b/stream/copy_test.go
new file mode 100644
index 00000000000..afa0acf060d
--- /dev/null
+++ b/stream/copy_test.go
@@ -0,0 +1,56 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package stream_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/stream"
+)
+
+func TestCopyNewWithOptionalParams(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"),
+ )
+ _, err := client.Stream.Copies.New(context.TODO(), stream.CopyNewParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ URL: cloudflare.F("https://example.com/myvideo.mp4"),
+ AllowedOrigins: cloudflare.F([]string{"example.com"}),
+ Creator: cloudflare.F("creator-id_abcde12345"),
+ Meta: cloudflare.F[any](map[string]interface{}{
+ "name": "video12345.mp4",
+ }),
+ RequireSignedURLs: cloudflare.F(true),
+ ScheduledDeletion: cloudflare.F(time.Now()),
+ ThumbnailTimestampPct: cloudflare.F(0.529241),
+ Watermark: cloudflare.F(stream.CopyNewParamsWatermark{
+ Uid: cloudflare.F("ea95132c15732412d22c1476fa83f27a"),
+ }),
+ UploadCreator: cloudflare.F("creator-id_abcde12345"),
+ UploadMetadata: cloudflare.F("name aGVsbG8gd29ybGQ=, requiresignedurls, allowedorigins ZXhhbXBsZS5jb20sdGVzdC5jb20="),
+ })
+ 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/stream/directupload.go b/stream/directupload.go
new file mode 100644
index 00000000000..19b5eee0821
--- /dev/null
+++ b/stream/directupload.go
@@ -0,0 +1,209 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package stream
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// DirectUploadService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewDirectUploadService] method
+// instead.
+type DirectUploadService struct {
+ Options []option.RequestOption
+}
+
+// NewDirectUploadService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewDirectUploadService(opts ...option.RequestOption) (r *DirectUploadService) {
+ r = &DirectUploadService{}
+ r.Options = opts
+ return
+}
+
+// Creates a direct upload that allows video uploads without an API key.
+func (r *DirectUploadService) New(ctx context.Context, params DirectUploadNewParams, opts ...option.RequestOption) (res *DirectUploadNewResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env DirectUploadNewResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/stream/direct_upload", params.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type DirectUploadNewResponse struct {
+ // Indicates the date and time at which the video will be deleted. Omit the field
+ // to indicate no change, or include with a `null` value to remove an existing
+ // scheduled deletion. If specified, must be at least 30 days from upload time.
+ ScheduledDeletion time.Time `json:"scheduledDeletion" format:"date-time"`
+ // A Cloudflare-generated unique identifier for a media item.
+ Uid string `json:"uid"`
+ // The URL an unauthenticated upload can use for a single
+ // `HTTP POST multipart/form-data` request.
+ UploadURL string `json:"uploadURL"`
+ Watermark StreamWatermarks `json:"watermark"`
+ JSON directUploadNewResponseJSON `json:"-"`
+}
+
+// directUploadNewResponseJSON contains the JSON metadata for the struct
+// [DirectUploadNewResponse]
+type directUploadNewResponseJSON struct {
+ ScheduledDeletion apijson.Field
+ Uid apijson.Field
+ UploadURL apijson.Field
+ Watermark apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DirectUploadNewResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r directUploadNewResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type DirectUploadNewParams struct {
+ // The account identifier tag.
+ AccountID param.Field[string] `path:"account_id,required"`
+ // The maximum duration in seconds for a video upload. Can be set for a video that
+ // is not yet uploaded to limit its duration. Uploads that exceed the specified
+ // duration will fail during processing. A value of `-1` means the value is
+ // unknown.
+ MaxDurationSeconds param.Field[int64] `json:"maxDurationSeconds,required"`
+ // Lists the origins allowed to display the video. Enter allowed origin domains in
+ // an array and use `*` for wildcard subdomains. Empty arrays allow the video to be
+ // viewed on any origin.
+ AllowedOrigins param.Field[[]string] `json:"allowedOrigins"`
+ // A user-defined identifier for the media creator.
+ Creator param.Field[string] `json:"creator"`
+ // The date and time after upload when videos will not be accepted.
+ Expiry param.Field[time.Time] `json:"expiry" format:"date-time"`
+ // A user modifiable key-value store used to reference other systems of record for
+ // managing videos.
+ Meta param.Field[interface{}] `json:"meta"`
+ // Indicates whether the video can be a accessed using the UID. When set to `true`,
+ // a signed token must be generated with a signing key to view the video.
+ RequireSignedURLs param.Field[bool] `json:"requireSignedURLs"`
+ // Indicates the date and time at which the video will be deleted. Omit the field
+ // to indicate no change, or include with a `null` value to remove an existing
+ // scheduled deletion. If specified, must be at least 30 days from upload time.
+ ScheduledDeletion param.Field[time.Time] `json:"scheduledDeletion" format:"date-time"`
+ // The timestamp for a thumbnail image calculated as a percentage value of the
+ // video's duration. To convert from a second-wise timestamp to a percentage,
+ // divide the desired timestamp by the total duration of the video. If this value
+ // is not set, the default thumbnail image is taken from 0s of the video.
+ ThumbnailTimestampPct param.Field[float64] `json:"thumbnailTimestampPct"`
+ Watermark param.Field[DirectUploadNewParamsWatermark] `json:"watermark"`
+ // A user-defined identifier for the media creator.
+ UploadCreator param.Field[string] `header:"Upload-Creator"`
+}
+
+func (r DirectUploadNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type DirectUploadNewParamsWatermark struct {
+ // The unique identifier for the watermark profile.
+ Uid param.Field[string] `json:"uid"`
+}
+
+func (r DirectUploadNewParamsWatermark) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type DirectUploadNewResponseEnvelope struct {
+ Errors []DirectUploadNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []DirectUploadNewResponseEnvelopeMessages `json:"messages,required"`
+ Result DirectUploadNewResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success DirectUploadNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON directUploadNewResponseEnvelopeJSON `json:"-"`
+}
+
+// directUploadNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [DirectUploadNewResponseEnvelope]
+type directUploadNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DirectUploadNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r directUploadNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type DirectUploadNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON directUploadNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// directUploadNewResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [DirectUploadNewResponseEnvelopeErrors]
+type directUploadNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DirectUploadNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r directUploadNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type DirectUploadNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON directUploadNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// directUploadNewResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [DirectUploadNewResponseEnvelopeMessages]
+type directUploadNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DirectUploadNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r directUploadNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type DirectUploadNewResponseEnvelopeSuccess bool
+
+const (
+ DirectUploadNewResponseEnvelopeSuccessTrue DirectUploadNewResponseEnvelopeSuccess = true
+)
diff --git a/stream/directupload_test.go b/stream/directupload_test.go
new file mode 100644
index 00000000000..8670b1d3dc3
--- /dev/null
+++ b/stream/directupload_test.go
@@ -0,0 +1,56 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package stream_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/stream"
+)
+
+func TestDirectUploadNewWithOptionalParams(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"),
+ )
+ _, err := client.Stream.DirectUploads.New(context.TODO(), stream.DirectUploadNewParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ MaxDurationSeconds: cloudflare.F(int64(1)),
+ AllowedOrigins: cloudflare.F([]string{"example.com"}),
+ Creator: cloudflare.F("creator-id_abcde12345"),
+ Expiry: cloudflare.F(time.Now()),
+ Meta: cloudflare.F[any](map[string]interface{}{
+ "name": "video12345.mp4",
+ }),
+ RequireSignedURLs: cloudflare.F(true),
+ ScheduledDeletion: cloudflare.F(time.Now()),
+ ThumbnailTimestampPct: cloudflare.F(0.529241),
+ Watermark: cloudflare.F(stream.DirectUploadNewParamsWatermark{
+ Uid: cloudflare.F("ea95132c15732412d22c1476fa83f27a"),
+ }),
+ UploadCreator: cloudflare.F("creator-id_abcde12345"),
+ })
+ 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/stream/download.go b/stream/download.go
new file mode 100644
index 00000000000..6a5cb006adb
--- /dev/null
+++ b/stream/download.go
@@ -0,0 +1,380 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package stream
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "reflect"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/tidwall/gjson"
+)
+
+// DownloadService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewDownloadService] method instead.
+type DownloadService struct {
+ Options []option.RequestOption
+}
+
+// NewDownloadService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewDownloadService(opts ...option.RequestOption) (r *DownloadService) {
+ r = &DownloadService{}
+ r.Options = opts
+ return
+}
+
+// Creates a download for a video when a video is ready to view.
+func (r *DownloadService) New(ctx context.Context, identifier string, body DownloadNewParams, opts ...option.RequestOption) (res *DownloadNewResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env DownloadNewResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/stream/%s/downloads", body.AccountID, identifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Delete the downloads for a video.
+func (r *DownloadService) Delete(ctx context.Context, identifier string, body DownloadDeleteParams, opts ...option.RequestOption) (res *DownloadDeleteResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env DownloadDeleteResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/stream/%s/downloads", body.AccountID, identifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Lists the downloads created for a video.
+func (r *DownloadService) Get(ctx context.Context, identifier string, query DownloadGetParams, opts ...option.RequestOption) (res *DownloadGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env DownloadGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/stream/%s/downloads", query.AccountID, identifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Union satisfied by [stream.DownloadNewResponseUnknown] or [shared.UnionString].
+type DownloadNewResponse interface {
+ ImplementsStreamDownloadNewResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*DownloadNewResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+// Union satisfied by [stream.DownloadDeleteResponseUnknown] or
+// [shared.UnionString].
+type DownloadDeleteResponse interface {
+ ImplementsStreamDownloadDeleteResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*DownloadDeleteResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+// Union satisfied by [stream.DownloadGetResponseUnknown] or [shared.UnionString].
+type DownloadGetResponse interface {
+ ImplementsStreamDownloadGetResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*DownloadGetResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+type DownloadNewParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type DownloadNewResponseEnvelope struct {
+ Errors []DownloadNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []DownloadNewResponseEnvelopeMessages `json:"messages,required"`
+ Result DownloadNewResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success DownloadNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON downloadNewResponseEnvelopeJSON `json:"-"`
+}
+
+// downloadNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [DownloadNewResponseEnvelope]
+type downloadNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DownloadNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r downloadNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type DownloadNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON downloadNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// downloadNewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [DownloadNewResponseEnvelopeErrors]
+type downloadNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DownloadNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r downloadNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type DownloadNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON downloadNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// downloadNewResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [DownloadNewResponseEnvelopeMessages]
+type downloadNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DownloadNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r downloadNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type DownloadNewResponseEnvelopeSuccess bool
+
+const (
+ DownloadNewResponseEnvelopeSuccessTrue DownloadNewResponseEnvelopeSuccess = true
+)
+
+type DownloadDeleteParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type DownloadDeleteResponseEnvelope struct {
+ Errors []DownloadDeleteResponseEnvelopeErrors `json:"errors,required"`
+ Messages []DownloadDeleteResponseEnvelopeMessages `json:"messages,required"`
+ Result DownloadDeleteResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success DownloadDeleteResponseEnvelopeSuccess `json:"success,required"`
+ JSON downloadDeleteResponseEnvelopeJSON `json:"-"`
+}
+
+// downloadDeleteResponseEnvelopeJSON contains the JSON metadata for the struct
+// [DownloadDeleteResponseEnvelope]
+type downloadDeleteResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DownloadDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r downloadDeleteResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type DownloadDeleteResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON downloadDeleteResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// downloadDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [DownloadDeleteResponseEnvelopeErrors]
+type downloadDeleteResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DownloadDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r downloadDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type DownloadDeleteResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON downloadDeleteResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// downloadDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [DownloadDeleteResponseEnvelopeMessages]
+type downloadDeleteResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DownloadDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r downloadDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type DownloadDeleteResponseEnvelopeSuccess bool
+
+const (
+ DownloadDeleteResponseEnvelopeSuccessTrue DownloadDeleteResponseEnvelopeSuccess = true
+)
+
+type DownloadGetParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type DownloadGetResponseEnvelope struct {
+ Errors []DownloadGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []DownloadGetResponseEnvelopeMessages `json:"messages,required"`
+ Result DownloadGetResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success DownloadGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON downloadGetResponseEnvelopeJSON `json:"-"`
+}
+
+// downloadGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [DownloadGetResponseEnvelope]
+type downloadGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DownloadGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r downloadGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type DownloadGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON downloadGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// downloadGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [DownloadGetResponseEnvelopeErrors]
+type downloadGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DownloadGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r downloadGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type DownloadGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON downloadGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// downloadGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [DownloadGetResponseEnvelopeMessages]
+type downloadGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *DownloadGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r downloadGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type DownloadGetResponseEnvelopeSuccess bool
+
+const (
+ DownloadGetResponseEnvelopeSuccessTrue DownloadGetResponseEnvelopeSuccess = true
+)
diff --git a/stream/download_test.go b/stream/download_test.go
new file mode 100644
index 00000000000..77f9909763d
--- /dev/null
+++ b/stream/download_test.go
@@ -0,0 +1,105 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package stream_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/stream"
+)
+
+func TestDownloadNew(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"),
+ )
+ _, err := client.Stream.Downloads.New(
+ context.TODO(),
+ "ea95132c15732412d22c1476fa83f27a",
+ stream.DownloadNewParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestDownloadDelete(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"),
+ )
+ _, err := client.Stream.Downloads.Delete(
+ context.TODO(),
+ "ea95132c15732412d22c1476fa83f27a",
+ stream.DownloadDeleteParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestDownloadGet(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"),
+ )
+ _, err := client.Stream.Downloads.Get(
+ context.TODO(),
+ "ea95132c15732412d22c1476fa83f27a",
+ stream.DownloadGetParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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/stream/embed.go b/stream/embed.go
new file mode 100644
index 00000000000..ce2544d4cc4
--- /dev/null
+++ b/stream/embed.go
@@ -0,0 +1,47 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package stream
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// EmbedService contains methods and other services that help with interacting with
+// the cloudflare API. Note, unlike clients, this service does not read variables
+// from the environment automatically. You should not instantiate this service
+// directly, and instead use the [NewEmbedService] method instead.
+type EmbedService struct {
+ Options []option.RequestOption
+}
+
+// NewEmbedService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewEmbedService(opts ...option.RequestOption) (r *EmbedService) {
+ r = &EmbedService{}
+ r.Options = opts
+ return
+}
+
+// Fetches an HTML code snippet to embed a video in a web page delivered through
+// Cloudflare. On success, returns an HTML fragment for use on web pages to display
+// a video. On failure, returns a JSON response body.
+func (r *EmbedService) Get(ctx context.Context, identifier string, query EmbedGetParams, opts ...option.RequestOption) (res *EmbedGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ path := fmt.Sprintf("accounts/%s/stream/%s/embed", query.AccountID, identifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &res, opts...)
+ return
+}
+
+type EmbedGetResponse = interface{}
+
+type EmbedGetParams struct {
+ // The account identifier tag.
+ AccountID param.Field[string] `path:"account_id,required"`
+}
diff --git a/stream/embed_test.go b/stream/embed_test.go
new file mode 100644
index 00000000000..987ad84fb58
--- /dev/null
+++ b/stream/embed_test.go
@@ -0,0 +1,45 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package stream_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/stream"
+)
+
+func TestEmbedGet(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"),
+ )
+ _, err := client.Stream.Embeds.Get(
+ context.TODO(),
+ "ea95132c15732412d22c1476fa83f27a",
+ stream.EmbedGetParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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/stream/key.go b/stream/key.go
new file mode 100644
index 00000000000..ad02153bca4
--- /dev/null
+++ b/stream/key.go
@@ -0,0 +1,404 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package stream
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "reflect"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/tidwall/gjson"
+)
+
+// KeyService contains methods and other services that help with interacting with
+// the cloudflare API. Note, unlike clients, this service does not read variables
+// from the environment automatically. You should not instantiate this service
+// directly, and instead use the [NewKeyService] method instead.
+type KeyService struct {
+ Options []option.RequestOption
+}
+
+// NewKeyService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewKeyService(opts ...option.RequestOption) (r *KeyService) {
+ r = &KeyService{}
+ r.Options = opts
+ return
+}
+
+// Creates an RSA private key in PEM and JWK formats. Key files are only displayed
+// once after creation. Keys are created, used, and deleted independently of
+// videos, and every key can sign any video.
+func (r *KeyService) New(ctx context.Context, body KeyNewParams, opts ...option.RequestOption) (res *StreamKeys, err error) {
+ opts = append(r.Options[:], opts...)
+ var env KeyNewResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/stream/keys", body.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Deletes signing keys and revokes all signed URLs generated with the key.
+func (r *KeyService) Delete(ctx context.Context, identifier string, body KeyDeleteParams, opts ...option.RequestOption) (res *KeyDeleteResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env KeyDeleteResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/stream/keys/%s", body.AccountID, identifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Lists the video ID and creation date and time when a signing key was created.
+func (r *KeyService) Get(ctx context.Context, query KeyGetParams, opts ...option.RequestOption) (res *[]KeyGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env KeyGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/stream/keys", query.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type StreamKeys struct {
+ // Identifier
+ ID string `json:"id"`
+ // The date and time a signing key was created.
+ Created time.Time `json:"created" format:"date-time"`
+ // The signing key in JWK format.
+ Jwk string `json:"jwk"`
+ // The signing key in PEM format.
+ Pem string `json:"pem"`
+ JSON streamKeysJSON `json:"-"`
+}
+
+// streamKeysJSON contains the JSON metadata for the struct [StreamKeys]
+type streamKeysJSON struct {
+ ID apijson.Field
+ Created apijson.Field
+ Jwk apijson.Field
+ Pem apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *StreamKeys) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r streamKeysJSON) RawJSON() string {
+ return r.raw
+}
+
+// Union satisfied by [stream.KeyDeleteResponseUnknown] or [shared.UnionString].
+type KeyDeleteResponse interface {
+ ImplementsStreamKeyDeleteResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*KeyDeleteResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+type KeyGetResponse struct {
+ // Identifier
+ ID string `json:"id"`
+ // The date and time a signing key was created.
+ Created time.Time `json:"created" format:"date-time"`
+ JSON keyGetResponseJSON `json:"-"`
+}
+
+// keyGetResponseJSON contains the JSON metadata for the struct [KeyGetResponse]
+type keyGetResponseJSON struct {
+ ID apijson.Field
+ Created apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *KeyGetResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r keyGetResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type KeyNewParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type KeyNewResponseEnvelope struct {
+ Errors []KeyNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []KeyNewResponseEnvelopeMessages `json:"messages,required"`
+ Result StreamKeys `json:"result,required"`
+ // Whether the API call was successful
+ Success KeyNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON keyNewResponseEnvelopeJSON `json:"-"`
+}
+
+// keyNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [KeyNewResponseEnvelope]
+type keyNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *KeyNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r keyNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type KeyNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON keyNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// keyNewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [KeyNewResponseEnvelopeErrors]
+type keyNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *KeyNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r keyNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type KeyNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON keyNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// keyNewResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [KeyNewResponseEnvelopeMessages]
+type keyNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *KeyNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r keyNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type KeyNewResponseEnvelopeSuccess bool
+
+const (
+ KeyNewResponseEnvelopeSuccessTrue KeyNewResponseEnvelopeSuccess = true
+)
+
+type KeyDeleteParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type KeyDeleteResponseEnvelope struct {
+ Errors []KeyDeleteResponseEnvelopeErrors `json:"errors,required"`
+ Messages []KeyDeleteResponseEnvelopeMessages `json:"messages,required"`
+ Result KeyDeleteResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success KeyDeleteResponseEnvelopeSuccess `json:"success,required"`
+ JSON keyDeleteResponseEnvelopeJSON `json:"-"`
+}
+
+// keyDeleteResponseEnvelopeJSON contains the JSON metadata for the struct
+// [KeyDeleteResponseEnvelope]
+type keyDeleteResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *KeyDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r keyDeleteResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type KeyDeleteResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON keyDeleteResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// keyDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [KeyDeleteResponseEnvelopeErrors]
+type keyDeleteResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *KeyDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r keyDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type KeyDeleteResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON keyDeleteResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// keyDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [KeyDeleteResponseEnvelopeMessages]
+type keyDeleteResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *KeyDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r keyDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type KeyDeleteResponseEnvelopeSuccess bool
+
+const (
+ KeyDeleteResponseEnvelopeSuccessTrue KeyDeleteResponseEnvelopeSuccess = true
+)
+
+type KeyGetParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type KeyGetResponseEnvelope struct {
+ Errors []KeyGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []KeyGetResponseEnvelopeMessages `json:"messages,required"`
+ Result []KeyGetResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success KeyGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON keyGetResponseEnvelopeJSON `json:"-"`
+}
+
+// keyGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [KeyGetResponseEnvelope]
+type keyGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *KeyGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r keyGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type KeyGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON keyGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// keyGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [KeyGetResponseEnvelopeErrors]
+type keyGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *KeyGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r keyGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type KeyGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON keyGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// keyGetResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [KeyGetResponseEnvelopeMessages]
+type keyGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *KeyGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r keyGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type KeyGetResponseEnvelopeSuccess bool
+
+const (
+ KeyGetResponseEnvelopeSuccessTrue KeyGetResponseEnvelopeSuccess = true
+)
diff --git a/stream/key_test.go b/stream/key_test.go
new file mode 100644
index 00000000000..a0d61120009
--- /dev/null
+++ b/stream/key_test.go
@@ -0,0 +1,97 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package stream_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/stream"
+)
+
+func TestKeyNew(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"),
+ )
+ _, err := client.Stream.Keys.New(context.TODO(), stream.KeyNewParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ })
+ 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())
+ }
+}
+
+func TestKeyDelete(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"),
+ )
+ _, err := client.Stream.Keys.Delete(
+ context.TODO(),
+ "023e105f4ecef8ad9ca31a8372d0c353",
+ stream.KeyDeleteParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestKeyGet(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"),
+ )
+ _, err := client.Stream.Keys.Get(context.TODO(), stream.KeyGetParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ })
+ 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/stream/liveinput.go b/stream/liveinput.go
new file mode 100644
index 00000000000..5dcf4288554
--- /dev/null
+++ b/stream/liveinput.go
@@ -0,0 +1,926 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package stream
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// LiveInputService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewLiveInputService] method instead.
+type LiveInputService struct {
+ Options []option.RequestOption
+ Outputs *LiveInputOutputService
+}
+
+// NewLiveInputService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewLiveInputService(opts ...option.RequestOption) (r *LiveInputService) {
+ r = &LiveInputService{}
+ r.Options = opts
+ r.Outputs = NewLiveInputOutputService(opts...)
+ return
+}
+
+// Creates a live input, and returns credentials that you or your users can use to
+// stream live video to Cloudflare Stream.
+func (r *LiveInputService) New(ctx context.Context, params LiveInputNewParams, opts ...option.RequestOption) (res *StreamLiveInput, err error) {
+ opts = append(r.Options[:], opts...)
+ var env LiveInputNewResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/stream/live_inputs", params.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Updates a specified live input.
+func (r *LiveInputService) Update(ctx context.Context, liveInputIdentifier string, params LiveInputUpdateParams, opts ...option.RequestOption) (res *StreamLiveInput, err error) {
+ opts = append(r.Options[:], opts...)
+ var env LiveInputUpdateResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/stream/live_inputs/%s", params.AccountID, liveInputIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Lists the live inputs created for an account. To get the credentials needed to
+// stream to a specific live input, request a single live input.
+func (r *LiveInputService) List(ctx context.Context, params LiveInputListParams, opts ...option.RequestOption) (res *LiveInputListResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env LiveInputListResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/stream/live_inputs", params.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Prevents a live input from being streamed to and makes the live input
+// inaccessible to any future API calls.
+func (r *LiveInputService) Delete(ctx context.Context, liveInputIdentifier string, body LiveInputDeleteParams, opts ...option.RequestOption) (err error) {
+ opts = append(r.Options[:], opts...)
+ opts = append([]option.RequestOption{option.WithHeader("Accept", "")}, opts...)
+ path := fmt.Sprintf("accounts/%s/stream/live_inputs/%s", body.AccountID, liveInputIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, nil, opts...)
+ return
+}
+
+// Retrieves details of an existing live input.
+func (r *LiveInputService) Get(ctx context.Context, liveInputIdentifier string, query LiveInputGetParams, opts ...option.RequestOption) (res *StreamLiveInput, err error) {
+ opts = append(r.Options[:], opts...)
+ var env LiveInputGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/stream/live_inputs/%s", query.AccountID, liveInputIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Details about a live input.
+type StreamLiveInput struct {
+ // The date and time the live input was created.
+ Created time.Time `json:"created" format:"date-time"`
+ // Indicates the number of days after which the live inputs recordings will be
+ // deleted. When a stream completes and the recording is ready, the value is used
+ // to calculate a scheduled deletion date for that recording. Omit the field to
+ // indicate no change, or include with a `null` value to remove an existing
+ // scheduled deletion.
+ DeleteRecordingAfterDays float64 `json:"deleteRecordingAfterDays"`
+ // A user modifiable key-value store used to reference other systems of record for
+ // managing live inputs.
+ Meta interface{} `json:"meta"`
+ // The date and time the live input was last modified.
+ Modified time.Time `json:"modified" format:"date-time"`
+ // Records the input to a Cloudflare Stream video. Behavior depends on the mode. In
+ // most cases, the video will initially be viewable as a live video and transition
+ // to on-demand after a condition is satisfied.
+ Recording StreamLiveInputRecording `json:"recording"`
+ // Details for streaming to an live input using RTMPS.
+ Rtmps StreamLiveInputRtmps `json:"rtmps"`
+ // Details for playback from an live input using RTMPS.
+ RtmpsPlayback StreamLiveInputRtmpsPlayback `json:"rtmpsPlayback"`
+ // Details for streaming to a live input using SRT.
+ Srt StreamLiveInputSrt `json:"srt"`
+ // Details for playback from an live input using SRT.
+ SrtPlayback StreamLiveInputSrtPlayback `json:"srtPlayback"`
+ // The connection status of a live input.
+ Status StreamLiveInputStatus `json:"status,nullable"`
+ // A unique identifier for a live input.
+ Uid string `json:"uid"`
+ // Details for streaming to a live input using WebRTC.
+ WebRtc StreamLiveInputWebRtc `json:"webRTC"`
+ // Details for playback from a live input using WebRTC.
+ WebRtcPlayback StreamLiveInputWebRtcPlayback `json:"webRTCPlayback"`
+ JSON streamLiveInputJSON `json:"-"`
+}
+
+// streamLiveInputJSON contains the JSON metadata for the struct [StreamLiveInput]
+type streamLiveInputJSON struct {
+ Created apijson.Field
+ DeleteRecordingAfterDays apijson.Field
+ Meta apijson.Field
+ Modified apijson.Field
+ Recording apijson.Field
+ Rtmps apijson.Field
+ RtmpsPlayback apijson.Field
+ Srt apijson.Field
+ SrtPlayback apijson.Field
+ Status apijson.Field
+ Uid apijson.Field
+ WebRtc apijson.Field
+ WebRtcPlayback apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *StreamLiveInput) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r streamLiveInputJSON) RawJSON() string {
+ return r.raw
+}
+
+// Records the input to a Cloudflare Stream video. Behavior depends on the mode. In
+// most cases, the video will initially be viewable as a live video and transition
+// to on-demand after a condition is satisfied.
+type StreamLiveInputRecording struct {
+ // Lists the origins allowed to display videos created with this input. Enter
+ // allowed origin domains in an array and use `*` for wildcard subdomains. An empty
+ // array allows videos to be viewed on any origin.
+ AllowedOrigins []string `json:"allowedOrigins"`
+ // Specifies the recording behavior for the live input. Set this value to `off` to
+ // prevent a recording. Set the value to `automatic` to begin a recording and
+ // transition to on-demand after Stream Live stops receiving input.
+ Mode StreamLiveInputRecordingMode `json:"mode"`
+ // Indicates if a video using the live input has the `requireSignedURLs` property
+ // set. Also enforces access controls on any video recording of the livestream with
+ // the live input.
+ RequireSignedURLs bool `json:"requireSignedURLs"`
+ // Determines the amount of time a live input configured in `automatic` mode should
+ // wait before a recording transitions from live to on-demand. `0` is recommended
+ // for most use cases and indicates the platform default should be used.
+ TimeoutSeconds int64 `json:"timeoutSeconds"`
+ JSON streamLiveInputRecordingJSON `json:"-"`
+}
+
+// streamLiveInputRecordingJSON contains the JSON metadata for the struct
+// [StreamLiveInputRecording]
+type streamLiveInputRecordingJSON struct {
+ AllowedOrigins apijson.Field
+ Mode apijson.Field
+ RequireSignedURLs apijson.Field
+ TimeoutSeconds apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *StreamLiveInputRecording) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r streamLiveInputRecordingJSON) RawJSON() string {
+ return r.raw
+}
+
+// Specifies the recording behavior for the live input. Set this value to `off` to
+// prevent a recording. Set the value to `automatic` to begin a recording and
+// transition to on-demand after Stream Live stops receiving input.
+type StreamLiveInputRecordingMode string
+
+const (
+ StreamLiveInputRecordingModeOff StreamLiveInputRecordingMode = "off"
+ StreamLiveInputRecordingModeAutomatic StreamLiveInputRecordingMode = "automatic"
+)
+
+// Details for streaming to an live input using RTMPS.
+type StreamLiveInputRtmps struct {
+ // The secret key to use when streaming via RTMPS to a live input.
+ StreamKey string `json:"streamKey"`
+ // The RTMPS URL you provide to the broadcaster, which they stream live video to.
+ URL string `json:"url"`
+ JSON streamLiveInputRtmpsJSON `json:"-"`
+}
+
+// streamLiveInputRtmpsJSON contains the JSON metadata for the struct
+// [StreamLiveInputRtmps]
+type streamLiveInputRtmpsJSON struct {
+ StreamKey apijson.Field
+ URL apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *StreamLiveInputRtmps) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r streamLiveInputRtmpsJSON) RawJSON() string {
+ return r.raw
+}
+
+// Details for playback from an live input using RTMPS.
+type StreamLiveInputRtmpsPlayback struct {
+ // The secret key to use for playback via RTMPS.
+ StreamKey string `json:"streamKey"`
+ // The URL used to play live video over RTMPS.
+ URL string `json:"url"`
+ JSON streamLiveInputRtmpsPlaybackJSON `json:"-"`
+}
+
+// streamLiveInputRtmpsPlaybackJSON contains the JSON metadata for the struct
+// [StreamLiveInputRtmpsPlayback]
+type streamLiveInputRtmpsPlaybackJSON struct {
+ StreamKey apijson.Field
+ URL apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *StreamLiveInputRtmpsPlayback) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r streamLiveInputRtmpsPlaybackJSON) RawJSON() string {
+ return r.raw
+}
+
+// Details for streaming to a live input using SRT.
+type StreamLiveInputSrt struct {
+ // The secret key to use when streaming via SRT to a live input.
+ Passphrase string `json:"passphrase"`
+ // The identifier of the live input to use when streaming via SRT.
+ StreamID string `json:"streamId"`
+ // The SRT URL you provide to the broadcaster, which they stream live video to.
+ URL string `json:"url"`
+ JSON streamLiveInputSrtJSON `json:"-"`
+}
+
+// streamLiveInputSrtJSON contains the JSON metadata for the struct
+// [StreamLiveInputSrt]
+type streamLiveInputSrtJSON struct {
+ Passphrase apijson.Field
+ StreamID apijson.Field
+ URL apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *StreamLiveInputSrt) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r streamLiveInputSrtJSON) RawJSON() string {
+ return r.raw
+}
+
+// Details for playback from an live input using SRT.
+type StreamLiveInputSrtPlayback struct {
+ // The secret key to use for playback via SRT.
+ Passphrase string `json:"passphrase"`
+ // The identifier of the live input to use for playback via SRT.
+ StreamID string `json:"streamId"`
+ // The URL used to play live video over SRT.
+ URL string `json:"url"`
+ JSON streamLiveInputSrtPlaybackJSON `json:"-"`
+}
+
+// streamLiveInputSrtPlaybackJSON contains the JSON metadata for the struct
+// [StreamLiveInputSrtPlayback]
+type streamLiveInputSrtPlaybackJSON struct {
+ Passphrase apijson.Field
+ StreamID apijson.Field
+ URL apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *StreamLiveInputSrtPlayback) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r streamLiveInputSrtPlaybackJSON) RawJSON() string {
+ return r.raw
+}
+
+// The connection status of a live input.
+type StreamLiveInputStatus string
+
+const (
+ StreamLiveInputStatusConnected StreamLiveInputStatus = "connected"
+ StreamLiveInputStatusReconnected StreamLiveInputStatus = "reconnected"
+ StreamLiveInputStatusReconnecting StreamLiveInputStatus = "reconnecting"
+ StreamLiveInputStatusClientDisconnect StreamLiveInputStatus = "client_disconnect"
+ StreamLiveInputStatusTTLExceeded StreamLiveInputStatus = "ttl_exceeded"
+ StreamLiveInputStatusFailedToConnect StreamLiveInputStatus = "failed_to_connect"
+ StreamLiveInputStatusFailedToReconnect StreamLiveInputStatus = "failed_to_reconnect"
+ StreamLiveInputStatusNewConfigurationAccepted StreamLiveInputStatus = "new_configuration_accepted"
+)
+
+// Details for streaming to a live input using WebRTC.
+type StreamLiveInputWebRtc struct {
+ // The WebRTC URL you provide to the broadcaster, which they stream live video to.
+ URL string `json:"url"`
+ JSON streamLiveInputWebRtcJSON `json:"-"`
+}
+
+// streamLiveInputWebRtcJSON contains the JSON metadata for the struct
+// [StreamLiveInputWebRtc]
+type streamLiveInputWebRtcJSON struct {
+ URL apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *StreamLiveInputWebRtc) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r streamLiveInputWebRtcJSON) RawJSON() string {
+ return r.raw
+}
+
+// Details for playback from a live input using WebRTC.
+type StreamLiveInputWebRtcPlayback struct {
+ // The URL used to play live video over WebRTC.
+ URL string `json:"url"`
+ JSON streamLiveInputWebRtcPlaybackJSON `json:"-"`
+}
+
+// streamLiveInputWebRtcPlaybackJSON contains the JSON metadata for the struct
+// [StreamLiveInputWebRtcPlayback]
+type streamLiveInputWebRtcPlaybackJSON struct {
+ URL apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *StreamLiveInputWebRtcPlayback) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r streamLiveInputWebRtcPlaybackJSON) RawJSON() string {
+ return r.raw
+}
+
+type LiveInputListResponse struct {
+ LiveInputs []LiveInputListResponseLiveInput `json:"liveInputs"`
+ // The total number of remaining live inputs based on cursor position.
+ Range int64 `json:"range"`
+ // The total number of live inputs that match the provided filters.
+ Total int64 `json:"total"`
+ JSON liveInputListResponseJSON `json:"-"`
+}
+
+// liveInputListResponseJSON contains the JSON metadata for the struct
+// [LiveInputListResponse]
+type liveInputListResponseJSON struct {
+ LiveInputs apijson.Field
+ Range apijson.Field
+ Total apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LiveInputListResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r liveInputListResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type LiveInputListResponseLiveInput struct {
+ // The date and time the live input was created.
+ Created time.Time `json:"created" format:"date-time"`
+ // Indicates the number of days after which the live inputs recordings will be
+ // deleted. When a stream completes and the recording is ready, the value is used
+ // to calculate a scheduled deletion date for that recording. Omit the field to
+ // indicate no change, or include with a `null` value to remove an existing
+ // scheduled deletion.
+ DeleteRecordingAfterDays float64 `json:"deleteRecordingAfterDays"`
+ // A user modifiable key-value store used to reference other systems of record for
+ // managing live inputs.
+ Meta interface{} `json:"meta"`
+ // The date and time the live input was last modified.
+ Modified time.Time `json:"modified" format:"date-time"`
+ // A unique identifier for a live input.
+ Uid string `json:"uid"`
+ JSON liveInputListResponseLiveInputJSON `json:"-"`
+}
+
+// liveInputListResponseLiveInputJSON contains the JSON metadata for the struct
+// [LiveInputListResponseLiveInput]
+type liveInputListResponseLiveInputJSON struct {
+ Created apijson.Field
+ DeleteRecordingAfterDays apijson.Field
+ Meta apijson.Field
+ Modified apijson.Field
+ Uid apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LiveInputListResponseLiveInput) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r liveInputListResponseLiveInputJSON) RawJSON() string {
+ return r.raw
+}
+
+type LiveInputNewParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ // Sets the creator ID asssociated with this live input.
+ DefaultCreator param.Field[string] `json:"defaultCreator"`
+ // Indicates the number of days after which the live inputs recordings will be
+ // deleted. When a stream completes and the recording is ready, the value is used
+ // to calculate a scheduled deletion date for that recording. Omit the field to
+ // indicate no change, or include with a `null` value to remove an existing
+ // scheduled deletion.
+ DeleteRecordingAfterDays param.Field[float64] `json:"deleteRecordingAfterDays"`
+ // A user modifiable key-value store used to reference other systems of record for
+ // managing live inputs.
+ Meta param.Field[interface{}] `json:"meta"`
+ // Records the input to a Cloudflare Stream video. Behavior depends on the mode. In
+ // most cases, the video will initially be viewable as a live video and transition
+ // to on-demand after a condition is satisfied.
+ Recording param.Field[LiveInputNewParamsRecording] `json:"recording"`
+}
+
+func (r LiveInputNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Records the input to a Cloudflare Stream video. Behavior depends on the mode. In
+// most cases, the video will initially be viewable as a live video and transition
+// to on-demand after a condition is satisfied.
+type LiveInputNewParamsRecording struct {
+ // Lists the origins allowed to display videos created with this input. Enter
+ // allowed origin domains in an array and use `*` for wildcard subdomains. An empty
+ // array allows videos to be viewed on any origin.
+ AllowedOrigins param.Field[[]string] `json:"allowedOrigins"`
+ // Specifies the recording behavior for the live input. Set this value to `off` to
+ // prevent a recording. Set the value to `automatic` to begin a recording and
+ // transition to on-demand after Stream Live stops receiving input.
+ Mode param.Field[LiveInputNewParamsRecordingMode] `json:"mode"`
+ // Indicates if a video using the live input has the `requireSignedURLs` property
+ // set. Also enforces access controls on any video recording of the livestream with
+ // the live input.
+ RequireSignedURLs param.Field[bool] `json:"requireSignedURLs"`
+ // Determines the amount of time a live input configured in `automatic` mode should
+ // wait before a recording transitions from live to on-demand. `0` is recommended
+ // for most use cases and indicates the platform default should be used.
+ TimeoutSeconds param.Field[int64] `json:"timeoutSeconds"`
+}
+
+func (r LiveInputNewParamsRecording) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Specifies the recording behavior for the live input. Set this value to `off` to
+// prevent a recording. Set the value to `automatic` to begin a recording and
+// transition to on-demand after Stream Live stops receiving input.
+type LiveInputNewParamsRecordingMode string
+
+const (
+ LiveInputNewParamsRecordingModeOff LiveInputNewParamsRecordingMode = "off"
+ LiveInputNewParamsRecordingModeAutomatic LiveInputNewParamsRecordingMode = "automatic"
+)
+
+type LiveInputNewResponseEnvelope struct {
+ Errors []LiveInputNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []LiveInputNewResponseEnvelopeMessages `json:"messages,required"`
+ // Details about a live input.
+ Result StreamLiveInput `json:"result,required"`
+ // Whether the API call was successful
+ Success LiveInputNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON liveInputNewResponseEnvelopeJSON `json:"-"`
+}
+
+// liveInputNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [LiveInputNewResponseEnvelope]
+type liveInputNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LiveInputNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r liveInputNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type LiveInputNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON liveInputNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// liveInputNewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [LiveInputNewResponseEnvelopeErrors]
+type liveInputNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LiveInputNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r liveInputNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type LiveInputNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON liveInputNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// liveInputNewResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [LiveInputNewResponseEnvelopeMessages]
+type liveInputNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LiveInputNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r liveInputNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type LiveInputNewResponseEnvelopeSuccess bool
+
+const (
+ LiveInputNewResponseEnvelopeSuccessTrue LiveInputNewResponseEnvelopeSuccess = true
+)
+
+type LiveInputUpdateParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ // Sets the creator ID asssociated with this live input.
+ DefaultCreator param.Field[string] `json:"defaultCreator"`
+ // Indicates the number of days after which the live inputs recordings will be
+ // deleted. When a stream completes and the recording is ready, the value is used
+ // to calculate a scheduled deletion date for that recording. Omit the field to
+ // indicate no change, or include with a `null` value to remove an existing
+ // scheduled deletion.
+ DeleteRecordingAfterDays param.Field[float64] `json:"deleteRecordingAfterDays"`
+ // A user modifiable key-value store used to reference other systems of record for
+ // managing live inputs.
+ Meta param.Field[interface{}] `json:"meta"`
+ // Records the input to a Cloudflare Stream video. Behavior depends on the mode. In
+ // most cases, the video will initially be viewable as a live video and transition
+ // to on-demand after a condition is satisfied.
+ Recording param.Field[LiveInputUpdateParamsRecording] `json:"recording"`
+}
+
+func (r LiveInputUpdateParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Records the input to a Cloudflare Stream video. Behavior depends on the mode. In
+// most cases, the video will initially be viewable as a live video and transition
+// to on-demand after a condition is satisfied.
+type LiveInputUpdateParamsRecording struct {
+ // Lists the origins allowed to display videos created with this input. Enter
+ // allowed origin domains in an array and use `*` for wildcard subdomains. An empty
+ // array allows videos to be viewed on any origin.
+ AllowedOrigins param.Field[[]string] `json:"allowedOrigins"`
+ // Specifies the recording behavior for the live input. Set this value to `off` to
+ // prevent a recording. Set the value to `automatic` to begin a recording and
+ // transition to on-demand after Stream Live stops receiving input.
+ Mode param.Field[LiveInputUpdateParamsRecordingMode] `json:"mode"`
+ // Indicates if a video using the live input has the `requireSignedURLs` property
+ // set. Also enforces access controls on any video recording of the livestream with
+ // the live input.
+ RequireSignedURLs param.Field[bool] `json:"requireSignedURLs"`
+ // Determines the amount of time a live input configured in `automatic` mode should
+ // wait before a recording transitions from live to on-demand. `0` is recommended
+ // for most use cases and indicates the platform default should be used.
+ TimeoutSeconds param.Field[int64] `json:"timeoutSeconds"`
+}
+
+func (r LiveInputUpdateParamsRecording) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Specifies the recording behavior for the live input. Set this value to `off` to
+// prevent a recording. Set the value to `automatic` to begin a recording and
+// transition to on-demand after Stream Live stops receiving input.
+type LiveInputUpdateParamsRecordingMode string
+
+const (
+ LiveInputUpdateParamsRecordingModeOff LiveInputUpdateParamsRecordingMode = "off"
+ LiveInputUpdateParamsRecordingModeAutomatic LiveInputUpdateParamsRecordingMode = "automatic"
+)
+
+type LiveInputUpdateResponseEnvelope struct {
+ Errors []LiveInputUpdateResponseEnvelopeErrors `json:"errors,required"`
+ Messages []LiveInputUpdateResponseEnvelopeMessages `json:"messages,required"`
+ // Details about a live input.
+ Result StreamLiveInput `json:"result,required"`
+ // Whether the API call was successful
+ Success LiveInputUpdateResponseEnvelopeSuccess `json:"success,required"`
+ JSON liveInputUpdateResponseEnvelopeJSON `json:"-"`
+}
+
+// liveInputUpdateResponseEnvelopeJSON contains the JSON metadata for the struct
+// [LiveInputUpdateResponseEnvelope]
+type liveInputUpdateResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LiveInputUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r liveInputUpdateResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type LiveInputUpdateResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON liveInputUpdateResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// liveInputUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [LiveInputUpdateResponseEnvelopeErrors]
+type liveInputUpdateResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LiveInputUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r liveInputUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type LiveInputUpdateResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON liveInputUpdateResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// liveInputUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [LiveInputUpdateResponseEnvelopeMessages]
+type liveInputUpdateResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LiveInputUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r liveInputUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type LiveInputUpdateResponseEnvelopeSuccess bool
+
+const (
+ LiveInputUpdateResponseEnvelopeSuccessTrue LiveInputUpdateResponseEnvelopeSuccess = true
+)
+
+type LiveInputListParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ // Includes the total number of videos associated with the submitted query
+ // parameters.
+ IncludeCounts param.Field[bool] `query:"include_counts"`
+}
+
+// URLQuery serializes [LiveInputListParams]'s query parameters as `url.Values`.
+func (r LiveInputListParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type LiveInputListResponseEnvelope struct {
+ Errors []LiveInputListResponseEnvelopeErrors `json:"errors,required"`
+ Messages []LiveInputListResponseEnvelopeMessages `json:"messages,required"`
+ Result LiveInputListResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success LiveInputListResponseEnvelopeSuccess `json:"success,required"`
+ JSON liveInputListResponseEnvelopeJSON `json:"-"`
+}
+
+// liveInputListResponseEnvelopeJSON contains the JSON metadata for the struct
+// [LiveInputListResponseEnvelope]
+type liveInputListResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LiveInputListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r liveInputListResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type LiveInputListResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON liveInputListResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// liveInputListResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [LiveInputListResponseEnvelopeErrors]
+type liveInputListResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LiveInputListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r liveInputListResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type LiveInputListResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON liveInputListResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// liveInputListResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [LiveInputListResponseEnvelopeMessages]
+type liveInputListResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LiveInputListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r liveInputListResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type LiveInputListResponseEnvelopeSuccess bool
+
+const (
+ LiveInputListResponseEnvelopeSuccessTrue LiveInputListResponseEnvelopeSuccess = true
+)
+
+type LiveInputDeleteParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type LiveInputGetParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type LiveInputGetResponseEnvelope struct {
+ Errors []LiveInputGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []LiveInputGetResponseEnvelopeMessages `json:"messages,required"`
+ // Details about a live input.
+ Result StreamLiveInput `json:"result,required"`
+ // Whether the API call was successful
+ Success LiveInputGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON liveInputGetResponseEnvelopeJSON `json:"-"`
+}
+
+// liveInputGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [LiveInputGetResponseEnvelope]
+type liveInputGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LiveInputGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r liveInputGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type LiveInputGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON liveInputGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// liveInputGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [LiveInputGetResponseEnvelopeErrors]
+type liveInputGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LiveInputGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r liveInputGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type LiveInputGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON liveInputGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// liveInputGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [LiveInputGetResponseEnvelopeMessages]
+type liveInputGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LiveInputGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r liveInputGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type LiveInputGetResponseEnvelopeSuccess bool
+
+const (
+ LiveInputGetResponseEnvelopeSuccessTrue LiveInputGetResponseEnvelopeSuccess = true
+)
diff --git a/stream/liveinput_test.go b/stream/liveinput_test.go
new file mode 100644
index 00000000000..a1eb60ec81f
--- /dev/null
+++ b/stream/liveinput_test.go
@@ -0,0 +1,180 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package stream_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/stream"
+)
+
+func TestLiveInputNewWithOptionalParams(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"),
+ )
+ _, err := client.Stream.LiveInputs.New(context.TODO(), stream.LiveInputNewParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ DefaultCreator: cloudflare.F("string"),
+ DeleteRecordingAfterDays: cloudflare.F(45.000000),
+ Meta: cloudflare.F[any](map[string]interface{}{
+ "name": "test stream 1",
+ }),
+ Recording: cloudflare.F(stream.LiveInputNewParamsRecording{
+ AllowedOrigins: cloudflare.F([]string{"example.com"}),
+ Mode: cloudflare.F(stream.LiveInputNewParamsRecordingModeOff),
+ RequireSignedURLs: cloudflare.F(false),
+ TimeoutSeconds: cloudflare.F(int64(0)),
+ }),
+ })
+ 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())
+ }
+}
+
+func TestLiveInputUpdateWithOptionalParams(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"),
+ )
+ _, err := client.Stream.LiveInputs.Update(
+ context.TODO(),
+ "66be4bf738797e01e1fca35a7bdecdcd",
+ stream.LiveInputUpdateParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ DefaultCreator: cloudflare.F("string"),
+ DeleteRecordingAfterDays: cloudflare.F(45.000000),
+ Meta: cloudflare.F[any](map[string]interface{}{
+ "name": "test stream 1",
+ }),
+ Recording: cloudflare.F(stream.LiveInputUpdateParamsRecording{
+ AllowedOrigins: cloudflare.F([]string{"example.com"}),
+ Mode: cloudflare.F(stream.LiveInputUpdateParamsRecordingModeOff),
+ RequireSignedURLs: cloudflare.F(false),
+ TimeoutSeconds: cloudflare.F(int64(0)),
+ }),
+ },
+ )
+ 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())
+ }
+}
+
+func TestLiveInputListWithOptionalParams(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"),
+ )
+ _, err := client.Stream.LiveInputs.List(context.TODO(), stream.LiveInputListParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ IncludeCounts: cloudflare.F(true),
+ })
+ 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())
+ }
+}
+
+func TestLiveInputDelete(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"),
+ )
+ err := client.Stream.LiveInputs.Delete(
+ context.TODO(),
+ "66be4bf738797e01e1fca35a7bdecdcd",
+ stream.LiveInputDeleteParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestLiveInputGet(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"),
+ )
+ _, err := client.Stream.LiveInputs.Get(
+ context.TODO(),
+ "66be4bf738797e01e1fca35a7bdecdcd",
+ stream.LiveInputGetParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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/stream/liveinputoutput.go b/stream/liveinputoutput.go
new file mode 100644
index 00000000000..409d4cbac6b
--- /dev/null
+++ b/stream/liveinputoutput.go
@@ -0,0 +1,403 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package stream
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// LiveInputOutputService contains methods and other services that help with
+// interacting with the cloudflare API. Note, unlike clients, this service does not
+// read variables from the environment automatically. You should not instantiate
+// this service directly, and instead use the [NewLiveInputOutputService] method
+// instead.
+type LiveInputOutputService struct {
+ Options []option.RequestOption
+}
+
+// NewLiveInputOutputService generates a new service that applies the given options
+// to each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewLiveInputOutputService(opts ...option.RequestOption) (r *LiveInputOutputService) {
+ r = &LiveInputOutputService{}
+ r.Options = opts
+ return
+}
+
+// Creates a new output that can be used to simulcast or restream live video to
+// other RTMP or SRT destinations. Outputs are always linked to a specific live
+// input — one live input can have many outputs.
+func (r *LiveInputOutputService) New(ctx context.Context, liveInputIdentifier string, params LiveInputOutputNewParams, opts ...option.RequestOption) (res *StreamOutput, err error) {
+ opts = append(r.Options[:], opts...)
+ var env LiveInputOutputNewResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/stream/live_inputs/%s/outputs", params.AccountID, liveInputIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Updates the state of an output.
+func (r *LiveInputOutputService) Update(ctx context.Context, liveInputIdentifier string, outputIdentifier string, params LiveInputOutputUpdateParams, opts ...option.RequestOption) (res *StreamOutput, err error) {
+ opts = append(r.Options[:], opts...)
+ var env LiveInputOutputUpdateResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/stream/live_inputs/%s/outputs/%s", params.AccountID, liveInputIdentifier, outputIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Retrieves all outputs associated with a specified live input.
+func (r *LiveInputOutputService) List(ctx context.Context, liveInputIdentifier string, query LiveInputOutputListParams, opts ...option.RequestOption) (res *[]StreamOutput, err error) {
+ opts = append(r.Options[:], opts...)
+ var env LiveInputOutputListResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/stream/live_inputs/%s/outputs", query.AccountID, liveInputIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Deletes an output and removes it from the associated live input.
+func (r *LiveInputOutputService) Delete(ctx context.Context, liveInputIdentifier string, outputIdentifier string, body LiveInputOutputDeleteParams, opts ...option.RequestOption) (err error) {
+ opts = append(r.Options[:], opts...)
+ opts = append([]option.RequestOption{option.WithHeader("Accept", "")}, opts...)
+ path := fmt.Sprintf("accounts/%s/stream/live_inputs/%s/outputs/%s", body.AccountID, liveInputIdentifier, outputIdentifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, nil, opts...)
+ return
+}
+
+type StreamOutput struct {
+ // When enabled, live video streamed to the associated live input will be sent to
+ // the output URL. When disabled, live video will not be sent to the output URL,
+ // even when streaming to the associated live input. Use this to control precisely
+ // when you start and stop simulcasting to specific destinations like YouTube and
+ // Twitch.
+ Enabled bool `json:"enabled"`
+ // The streamKey used to authenticate against an output's target.
+ StreamKey string `json:"streamKey"`
+ // A unique identifier for the output.
+ Uid string `json:"uid"`
+ // The URL an output uses to restream.
+ URL string `json:"url"`
+ JSON streamOutputJSON `json:"-"`
+}
+
+// streamOutputJSON contains the JSON metadata for the struct [StreamOutput]
+type streamOutputJSON struct {
+ Enabled apijson.Field
+ StreamKey apijson.Field
+ Uid apijson.Field
+ URL apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *StreamOutput) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r streamOutputJSON) RawJSON() string {
+ return r.raw
+}
+
+type LiveInputOutputNewParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ // The streamKey used to authenticate against an output's target.
+ StreamKey param.Field[string] `json:"streamKey,required"`
+ // The URL an output uses to restream.
+ URL param.Field[string] `json:"url,required"`
+ // When enabled, live video streamed to the associated live input will be sent to
+ // the output URL. When disabled, live video will not be sent to the output URL,
+ // even when streaming to the associated live input. Use this to control precisely
+ // when you start and stop simulcasting to specific destinations like YouTube and
+ // Twitch.
+ Enabled param.Field[bool] `json:"enabled"`
+}
+
+func (r LiveInputOutputNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type LiveInputOutputNewResponseEnvelope struct {
+ Errors []LiveInputOutputNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []LiveInputOutputNewResponseEnvelopeMessages `json:"messages,required"`
+ Result StreamOutput `json:"result,required"`
+ // Whether the API call was successful
+ Success LiveInputOutputNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON liveInputOutputNewResponseEnvelopeJSON `json:"-"`
+}
+
+// liveInputOutputNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [LiveInputOutputNewResponseEnvelope]
+type liveInputOutputNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LiveInputOutputNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r liveInputOutputNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type LiveInputOutputNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON liveInputOutputNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// liveInputOutputNewResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [LiveInputOutputNewResponseEnvelopeErrors]
+type liveInputOutputNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LiveInputOutputNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r liveInputOutputNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type LiveInputOutputNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON liveInputOutputNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// liveInputOutputNewResponseEnvelopeMessagesJSON contains the JSON metadata for
+// the struct [LiveInputOutputNewResponseEnvelopeMessages]
+type liveInputOutputNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LiveInputOutputNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r liveInputOutputNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type LiveInputOutputNewResponseEnvelopeSuccess bool
+
+const (
+ LiveInputOutputNewResponseEnvelopeSuccessTrue LiveInputOutputNewResponseEnvelopeSuccess = true
+)
+
+type LiveInputOutputUpdateParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+ // When enabled, live video streamed to the associated live input will be sent to
+ // the output URL. When disabled, live video will not be sent to the output URL,
+ // even when streaming to the associated live input. Use this to control precisely
+ // when you start and stop simulcasting to specific destinations like YouTube and
+ // Twitch.
+ Enabled param.Field[bool] `json:"enabled,required"`
+}
+
+func (r LiveInputOutputUpdateParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type LiveInputOutputUpdateResponseEnvelope struct {
+ Errors []LiveInputOutputUpdateResponseEnvelopeErrors `json:"errors,required"`
+ Messages []LiveInputOutputUpdateResponseEnvelopeMessages `json:"messages,required"`
+ Result StreamOutput `json:"result,required"`
+ // Whether the API call was successful
+ Success LiveInputOutputUpdateResponseEnvelopeSuccess `json:"success,required"`
+ JSON liveInputOutputUpdateResponseEnvelopeJSON `json:"-"`
+}
+
+// liveInputOutputUpdateResponseEnvelopeJSON contains the JSON metadata for the
+// struct [LiveInputOutputUpdateResponseEnvelope]
+type liveInputOutputUpdateResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LiveInputOutputUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r liveInputOutputUpdateResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type LiveInputOutputUpdateResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON liveInputOutputUpdateResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// liveInputOutputUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for
+// the struct [LiveInputOutputUpdateResponseEnvelopeErrors]
+type liveInputOutputUpdateResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LiveInputOutputUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r liveInputOutputUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type LiveInputOutputUpdateResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON liveInputOutputUpdateResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// liveInputOutputUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for
+// the struct [LiveInputOutputUpdateResponseEnvelopeMessages]
+type liveInputOutputUpdateResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LiveInputOutputUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r liveInputOutputUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type LiveInputOutputUpdateResponseEnvelopeSuccess bool
+
+const (
+ LiveInputOutputUpdateResponseEnvelopeSuccessTrue LiveInputOutputUpdateResponseEnvelopeSuccess = true
+)
+
+type LiveInputOutputListParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type LiveInputOutputListResponseEnvelope struct {
+ Errors []LiveInputOutputListResponseEnvelopeErrors `json:"errors,required"`
+ Messages []LiveInputOutputListResponseEnvelopeMessages `json:"messages,required"`
+ Result []StreamOutput `json:"result,required"`
+ // Whether the API call was successful
+ Success LiveInputOutputListResponseEnvelopeSuccess `json:"success,required"`
+ JSON liveInputOutputListResponseEnvelopeJSON `json:"-"`
+}
+
+// liveInputOutputListResponseEnvelopeJSON contains the JSON metadata for the
+// struct [LiveInputOutputListResponseEnvelope]
+type liveInputOutputListResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LiveInputOutputListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r liveInputOutputListResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type LiveInputOutputListResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON liveInputOutputListResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// liveInputOutputListResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [LiveInputOutputListResponseEnvelopeErrors]
+type liveInputOutputListResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LiveInputOutputListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r liveInputOutputListResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type LiveInputOutputListResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON liveInputOutputListResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// liveInputOutputListResponseEnvelopeMessagesJSON contains the JSON metadata for
+// the struct [LiveInputOutputListResponseEnvelopeMessages]
+type liveInputOutputListResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *LiveInputOutputListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r liveInputOutputListResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type LiveInputOutputListResponseEnvelopeSuccess bool
+
+const (
+ LiveInputOutputListResponseEnvelopeSuccessTrue LiveInputOutputListResponseEnvelopeSuccess = true
+)
+
+type LiveInputOutputDeleteParams struct {
+ // Identifier
+ AccountID param.Field[string] `path:"account_id,required"`
+}
diff --git a/stream/liveinputoutput_test.go b/stream/liveinputoutput_test.go
new file mode 100644
index 00000000000..af81560f398
--- /dev/null
+++ b/stream/liveinputoutput_test.go
@@ -0,0 +1,141 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package stream_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/stream"
+)
+
+func TestLiveInputOutputNewWithOptionalParams(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"),
+ )
+ _, err := client.Stream.LiveInputs.Outputs.New(
+ context.TODO(),
+ "66be4bf738797e01e1fca35a7bdecdcd",
+ stream.LiveInputOutputNewParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ StreamKey: cloudflare.F("uzya-f19y-g2g9-a2ee-51j2"),
+ URL: cloudflare.F("rtmp://a.rtmp.youtube.com/live2"),
+ Enabled: cloudflare.F(true),
+ },
+ )
+ 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())
+ }
+}
+
+func TestLiveInputOutputUpdate(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"),
+ )
+ _, err := client.Stream.LiveInputs.Outputs.Update(
+ context.TODO(),
+ "66be4bf738797e01e1fca35a7bdecdcd",
+ "baea4d9c515887b80289d5c33cf01145",
+ stream.LiveInputOutputUpdateParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Enabled: cloudflare.F(true),
+ },
+ )
+ 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())
+ }
+}
+
+func TestLiveInputOutputList(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"),
+ )
+ _, err := client.Stream.LiveInputs.Outputs.List(
+ context.TODO(),
+ "66be4bf738797e01e1fca35a7bdecdcd",
+ stream.LiveInputOutputListParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestLiveInputOutputDelete(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"),
+ )
+ err := client.Stream.LiveInputs.Outputs.Delete(
+ context.TODO(),
+ "66be4bf738797e01e1fca35a7bdecdcd",
+ "baea4d9c515887b80289d5c33cf01145",
+ stream.LiveInputOutputDeleteParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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/stream/stream.go b/stream/stream.go
new file mode 100644
index 00000000000..64a8119c4e8
--- /dev/null
+++ b/stream/stream.go
@@ -0,0 +1,563 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package stream
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// StreamService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewStreamService] method instead.
+type StreamService struct {
+ Options []option.RequestOption
+ AudioTracks *AudioTrackService
+ Videos *VideoService
+ Clips *ClipService
+ Copies *CopyService
+ DirectUploads *DirectUploadService
+ Keys *KeyService
+ LiveInputs *LiveInputService
+ Watermarks *WatermarkService
+ Webhooks *WebhookService
+ Captions *CaptionService
+ Downloads *DownloadService
+ Embeds *EmbedService
+ Tokens *TokenService
+}
+
+// NewStreamService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewStreamService(opts ...option.RequestOption) (r *StreamService) {
+ r = &StreamService{}
+ r.Options = opts
+ r.AudioTracks = NewAudioTrackService(opts...)
+ r.Videos = NewVideoService(opts...)
+ r.Clips = NewClipService(opts...)
+ r.Copies = NewCopyService(opts...)
+ r.DirectUploads = NewDirectUploadService(opts...)
+ r.Keys = NewKeyService(opts...)
+ r.LiveInputs = NewLiveInputService(opts...)
+ r.Watermarks = NewWatermarkService(opts...)
+ r.Webhooks = NewWebhookService(opts...)
+ r.Captions = NewCaptionService(opts...)
+ r.Downloads = NewDownloadService(opts...)
+ r.Embeds = NewEmbedService(opts...)
+ r.Tokens = NewTokenService(opts...)
+ return
+}
+
+// Initiates a video upload using the TUS protocol. On success, the server responds
+// with a status code 201 (created) and includes a `location` header to indicate
+// where the content should be uploaded. Refer to https://tus.io for protocol
+// details.
+func (r *StreamService) New(ctx context.Context, params StreamNewParams, opts ...option.RequestOption) (err error) {
+ opts = append(r.Options[:], opts...)
+ opts = append([]option.RequestOption{option.WithHeader("Accept", "")}, opts...)
+ path := fmt.Sprintf("accounts/%s/stream", params.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, nil, opts...)
+ return
+}
+
+// Lists up to 1000 videos from a single request. For a specific range, refer to
+// the optional parameters.
+func (r *StreamService) List(ctx context.Context, params StreamListParams, opts ...option.RequestOption) (res *[]StreamVideos, err error) {
+ opts = append(r.Options[:], opts...)
+ var env StreamListResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/stream", params.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Deletes a video and its copies from Cloudflare Stream.
+func (r *StreamService) Delete(ctx context.Context, identifier string, body StreamDeleteParams, opts ...option.RequestOption) (err error) {
+ opts = append(r.Options[:], opts...)
+ opts = append([]option.RequestOption{option.WithHeader("Accept", "")}, opts...)
+ path := fmt.Sprintf("accounts/%s/stream/%s", body.AccountID, identifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, nil, opts...)
+ return
+}
+
+// Fetches details for a single video.
+func (r *StreamService) Get(ctx context.Context, identifier string, query StreamGetParams, opts ...option.RequestOption) (res *StreamVideos, err error) {
+ opts = append(r.Options[:], opts...)
+ var env StreamGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/stream/%s", query.AccountID, identifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type StreamVideos struct {
+ // Lists the origins allowed to display the video. Enter allowed origin domains in
+ // an array and use `*` for wildcard subdomains. Empty arrays allow the video to be
+ // viewed on any origin.
+ AllowedOrigins []string `json:"allowedOrigins"`
+ // The date and time the media item was created.
+ Created time.Time `json:"created" format:"date-time"`
+ // A user-defined identifier for the media creator.
+ Creator string `json:"creator"`
+ // The duration of the video in seconds. A value of `-1` means the duration is
+ // unknown. The duration becomes available after the upload and before the video is
+ // ready.
+ Duration float64 `json:"duration"`
+ Input StreamVideosInput `json:"input"`
+ // The live input ID used to upload a video with Stream Live.
+ LiveInput string `json:"liveInput"`
+ // The maximum duration in seconds for a video upload. Can be set for a video that
+ // is not yet uploaded to limit its duration. Uploads that exceed the specified
+ // duration will fail during processing. A value of `-1` means the value is
+ // unknown.
+ MaxDurationSeconds int64 `json:"maxDurationSeconds"`
+ // A user modifiable key-value store used to reference other systems of record for
+ // managing videos.
+ Meta interface{} `json:"meta"`
+ // The date and time the media item was last modified.
+ Modified time.Time `json:"modified" format:"date-time"`
+ Playback StreamVideosPlayback `json:"playback"`
+ // The video's preview page URI. This field is omitted until encoding is complete.
+ Preview string `json:"preview" format:"uri"`
+ // Indicates whether the video is playable. The field is empty if the video is not
+ // ready for viewing or the live stream is still in progress.
+ ReadyToStream bool `json:"readyToStream"`
+ // Indicates the time at which the video became playable. The field is empty if the
+ // video is not ready for viewing or the live stream is still in progress.
+ ReadyToStreamAt time.Time `json:"readyToStreamAt" format:"date-time"`
+ // Indicates whether the video can be a accessed using the UID. When set to `true`,
+ // a signed token must be generated with a signing key to view the video.
+ RequireSignedURLs bool `json:"requireSignedURLs"`
+ // Indicates the date and time at which the video will be deleted. Omit the field
+ // to indicate no change, or include with a `null` value to remove an existing
+ // scheduled deletion. If specified, must be at least 30 days from upload time.
+ ScheduledDeletion time.Time `json:"scheduledDeletion" format:"date-time"`
+ // The size of the media item in bytes.
+ Size float64 `json:"size"`
+ // Specifies a detailed status for a video. If the `state` is `inprogress` or
+ // `error`, the `step` field returns `encoding` or `manifest`. If the `state` is
+ // `inprogress`, `pctComplete` returns a number between 0 and 100 to indicate the
+ // approximate percent of completion. If the `state` is `error`, `errorReasonCode`
+ // and `errorReasonText` provide additional details.
+ Status StreamVideosStatus `json:"status"`
+ // The media item's thumbnail URI. This field is omitted until encoding is
+ // complete.
+ Thumbnail string `json:"thumbnail" format:"uri"`
+ // The timestamp for a thumbnail image calculated as a percentage value of the
+ // video's duration. To convert from a second-wise timestamp to a percentage,
+ // divide the desired timestamp by the total duration of the video. If this value
+ // is not set, the default thumbnail image is taken from 0s of the video.
+ ThumbnailTimestampPct float64 `json:"thumbnailTimestampPct"`
+ // A Cloudflare-generated unique identifier for a media item.
+ Uid string `json:"uid"`
+ // The date and time the media item was uploaded.
+ Uploaded time.Time `json:"uploaded" format:"date-time"`
+ // The date and time when the video upload URL is no longer valid for direct user
+ // uploads.
+ UploadExpiry time.Time `json:"uploadExpiry" format:"date-time"`
+ Watermark StreamWatermarks `json:"watermark"`
+ JSON streamVideosJSON `json:"-"`
+}
+
+// streamVideosJSON contains the JSON metadata for the struct [StreamVideos]
+type streamVideosJSON struct {
+ AllowedOrigins apijson.Field
+ Created apijson.Field
+ Creator apijson.Field
+ Duration apijson.Field
+ Input apijson.Field
+ LiveInput apijson.Field
+ MaxDurationSeconds apijson.Field
+ Meta apijson.Field
+ Modified apijson.Field
+ Playback apijson.Field
+ Preview apijson.Field
+ ReadyToStream apijson.Field
+ ReadyToStreamAt apijson.Field
+ RequireSignedURLs apijson.Field
+ ScheduledDeletion apijson.Field
+ Size apijson.Field
+ Status apijson.Field
+ Thumbnail apijson.Field
+ ThumbnailTimestampPct apijson.Field
+ Uid apijson.Field
+ Uploaded apijson.Field
+ UploadExpiry apijson.Field
+ Watermark apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *StreamVideos) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r streamVideosJSON) RawJSON() string {
+ return r.raw
+}
+
+type StreamVideosInput struct {
+ // The video height in pixels. A value of `-1` means the height is unknown. The
+ // value becomes available after the upload and before the video is ready.
+ Height int64 `json:"height"`
+ // The video width in pixels. A value of `-1` means the width is unknown. The value
+ // becomes available after the upload and before the video is ready.
+ Width int64 `json:"width"`
+ JSON streamVideosInputJSON `json:"-"`
+}
+
+// streamVideosInputJSON contains the JSON metadata for the struct
+// [StreamVideosInput]
+type streamVideosInputJSON struct {
+ Height apijson.Field
+ Width apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *StreamVideosInput) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r streamVideosInputJSON) RawJSON() string {
+ return r.raw
+}
+
+type StreamVideosPlayback struct {
+ // DASH Media Presentation Description for the video.
+ Dash string `json:"dash"`
+ // The HLS manifest for the video.
+ Hls string `json:"hls"`
+ JSON streamVideosPlaybackJSON `json:"-"`
+}
+
+// streamVideosPlaybackJSON contains the JSON metadata for the struct
+// [StreamVideosPlayback]
+type streamVideosPlaybackJSON struct {
+ Dash apijson.Field
+ Hls apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *StreamVideosPlayback) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r streamVideosPlaybackJSON) RawJSON() string {
+ return r.raw
+}
+
+// Specifies a detailed status for a video. If the `state` is `inprogress` or
+// `error`, the `step` field returns `encoding` or `manifest`. If the `state` is
+// `inprogress`, `pctComplete` returns a number between 0 and 100 to indicate the
+// approximate percent of completion. If the `state` is `error`, `errorReasonCode`
+// and `errorReasonText` provide additional details.
+type StreamVideosStatus struct {
+ // Specifies why the video failed to encode. This field is empty if the video is
+ // not in an `error` state. Preferred for programmatic use.
+ ErrorReasonCode string `json:"errorReasonCode"`
+ // Specifies why the video failed to encode using a human readable error message in
+ // English. This field is empty if the video is not in an `error` state.
+ ErrorReasonText string `json:"errorReasonText"`
+ // Indicates the size of the entire upload in bytes. The value must be a
+ // non-negative integer.
+ PctComplete string `json:"pctComplete"`
+ // Specifies the processing status for all quality levels for a video.
+ State StreamVideosStatusState `json:"state"`
+ JSON streamVideosStatusJSON `json:"-"`
+}
+
+// streamVideosStatusJSON contains the JSON metadata for the struct
+// [StreamVideosStatus]
+type streamVideosStatusJSON struct {
+ ErrorReasonCode apijson.Field
+ ErrorReasonText apijson.Field
+ PctComplete apijson.Field
+ State apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *StreamVideosStatus) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r streamVideosStatusJSON) RawJSON() string {
+ return r.raw
+}
+
+// Specifies the processing status for all quality levels for a video.
+type StreamVideosStatusState string
+
+const (
+ StreamVideosStatusStatePendingupload StreamVideosStatusState = "pendingupload"
+ StreamVideosStatusStateDownloading StreamVideosStatusState = "downloading"
+ StreamVideosStatusStateQueued StreamVideosStatusState = "queued"
+ StreamVideosStatusStateInprogress StreamVideosStatusState = "inprogress"
+ StreamVideosStatusStateReady StreamVideosStatusState = "ready"
+ StreamVideosStatusStateError StreamVideosStatusState = "error"
+)
+
+type StreamNewParams struct {
+ // The account identifier tag.
+ AccountID param.Field[string] `path:"account_id,required"`
+ // Specifies the TUS protocol version. This value must be included in every upload
+ // request. Notes: The only supported version of TUS protocol is 1.0.0.
+ TusResumable param.Field[StreamNewParamsTusResumable] `header:"Tus-Resumable,required"`
+ // Indicates the size of the entire upload in bytes. The value must be a
+ // non-negative integer.
+ UploadLength param.Field[int64] `header:"Upload-Length,required"`
+ // A user-defined identifier for the media creator.
+ UploadCreator param.Field[string] `header:"Upload-Creator"`
+ // Comma-separated key-value pairs following the TUS protocol specification. Values
+ // are Base-64 encoded. Supported keys: `name`, `requiresignedurls`,
+ // `allowedorigins`, `thumbnailtimestamppct`, `watermark`, `scheduleddeletion`.
+ UploadMetadata param.Field[string] `header:"Upload-Metadata"`
+}
+
+// Specifies the TUS protocol version. This value must be included in every upload
+// request. Notes: The only supported version of TUS protocol is 1.0.0.
+type StreamNewParamsTusResumable string
+
+const (
+ StreamNewParamsTusResumable1_0_0 StreamNewParamsTusResumable = "1.0.0"
+)
+
+type StreamListParams struct {
+ // The account identifier tag.
+ AccountID param.Field[string] `path:"account_id,required"`
+ // Lists videos in ascending order of creation.
+ Asc param.Field[bool] `query:"asc"`
+ // A user-defined identifier for the media creator.
+ Creator param.Field[string] `query:"creator"`
+ // Lists videos created before the specified date.
+ End param.Field[time.Time] `query:"end" format:"date-time"`
+ // Includes the total number of videos associated with the submitted query
+ // parameters.
+ IncludeCounts param.Field[bool] `query:"include_counts"`
+ // Searches over the `name` key in the `meta` field. This field can be set with or
+ // after the upload request.
+ Search param.Field[string] `query:"search"`
+ // Lists videos created after the specified date.
+ Start param.Field[time.Time] `query:"start" format:"date-time"`
+ // Specifies the processing status for all quality levels for a video.
+ Status param.Field[StreamListParamsStatus] `query:"status"`
+ // Specifies whether the video is `vod` or `live`.
+ Type param.Field[string] `query:"type"`
+}
+
+// URLQuery serializes [StreamListParams]'s query parameters as `url.Values`.
+func (r StreamListParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Specifies the processing status for all quality levels for a video.
+type StreamListParamsStatus string
+
+const (
+ StreamListParamsStatusPendingupload StreamListParamsStatus = "pendingupload"
+ StreamListParamsStatusDownloading StreamListParamsStatus = "downloading"
+ StreamListParamsStatusQueued StreamListParamsStatus = "queued"
+ StreamListParamsStatusInprogress StreamListParamsStatus = "inprogress"
+ StreamListParamsStatusReady StreamListParamsStatus = "ready"
+ StreamListParamsStatusError StreamListParamsStatus = "error"
+)
+
+type StreamListResponseEnvelope struct {
+ Errors []StreamListResponseEnvelopeErrors `json:"errors,required"`
+ Messages []StreamListResponseEnvelopeMessages `json:"messages,required"`
+ Result []StreamVideos `json:"result,required"`
+ // Whether the API call was successful
+ Success StreamListResponseEnvelopeSuccess `json:"success,required"`
+ // The total number of remaining videos based on cursor position.
+ Range int64 `json:"range"`
+ // The total number of videos that match the provided filters.
+ Total int64 `json:"total"`
+ JSON streamListResponseEnvelopeJSON `json:"-"`
+}
+
+// streamListResponseEnvelopeJSON contains the JSON metadata for the struct
+// [StreamListResponseEnvelope]
+type streamListResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ Range apijson.Field
+ Total apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *StreamListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r streamListResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type StreamListResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON streamListResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// streamListResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [StreamListResponseEnvelopeErrors]
+type streamListResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *StreamListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r streamListResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type StreamListResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON streamListResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// streamListResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [StreamListResponseEnvelopeMessages]
+type streamListResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *StreamListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r streamListResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type StreamListResponseEnvelopeSuccess bool
+
+const (
+ StreamListResponseEnvelopeSuccessTrue StreamListResponseEnvelopeSuccess = true
+)
+
+type StreamDeleteParams struct {
+ // The account identifier tag.
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type StreamGetParams struct {
+ // The account identifier tag.
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type StreamGetResponseEnvelope struct {
+ Errors []StreamGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []StreamGetResponseEnvelopeMessages `json:"messages,required"`
+ Result StreamVideos `json:"result,required"`
+ // Whether the API call was successful
+ Success StreamGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON streamGetResponseEnvelopeJSON `json:"-"`
+}
+
+// streamGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [StreamGetResponseEnvelope]
+type streamGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *StreamGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r streamGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type StreamGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON streamGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// streamGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [StreamGetResponseEnvelopeErrors]
+type streamGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *StreamGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r streamGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type StreamGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON streamGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// streamGetResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [StreamGetResponseEnvelopeMessages]
+type streamGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *StreamGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r streamGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type StreamGetResponseEnvelopeSuccess bool
+
+const (
+ StreamGetResponseEnvelopeSuccessTrue StreamGetResponseEnvelopeSuccess = true
+)
diff --git a/stream_test.go b/stream/stream_test.go
similarity index 90%
rename from stream_test.go
rename to stream/stream_test.go
index e33919d31f5..8224cae829d 100644
--- a/stream_test.go
+++ b/stream/stream_test.go
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package cloudflare_test
+package stream_test
import (
"context"
@@ -12,6 +12,7 @@ import (
"github.com/cloudflare/cloudflare-go"
"github.com/cloudflare/cloudflare-go/internal/testutil"
"github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/stream"
)
func TestStreamNewWithOptionalParams(t *testing.T) {
@@ -28,9 +29,9 @@ func TestStreamNewWithOptionalParams(t *testing.T) {
option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"),
option.WithAPIEmail("user@example.com"),
)
- err := client.Stream.New(context.TODO(), cloudflare.StreamNewParams{
+ err := client.Stream.New(context.TODO(), stream.StreamNewParams{
AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- TusResumable: cloudflare.F(cloudflare.StreamNewParamsTusResumable1_0_0),
+ TusResumable: cloudflare.F(stream.StreamNewParamsTusResumable1_0_0),
UploadLength: cloudflare.F(int64(0)),
UploadCreator: cloudflare.F("creator-id_abcde12345"),
UploadMetadata: cloudflare.F("name aGVsbG8gd29ybGQ=, requiresignedurls, allowedorigins ZXhhbXBsZS5jb20sdGVzdC5jb20="),
@@ -58,7 +59,7 @@ func TestStreamListWithOptionalParams(t *testing.T) {
option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"),
option.WithAPIEmail("user@example.com"),
)
- _, err := client.Stream.List(context.TODO(), cloudflare.StreamListParams{
+ _, err := client.Stream.List(context.TODO(), stream.StreamListParams{
AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
Asc: cloudflare.F(true),
Creator: cloudflare.F("creator-id_abcde12345"),
@@ -66,7 +67,7 @@ func TestStreamListWithOptionalParams(t *testing.T) {
IncludeCounts: cloudflare.F(true),
Search: cloudflare.F("puppy.mp4"),
Start: cloudflare.F(time.Now()),
- Status: cloudflare.F(cloudflare.StreamListParamsStatusInprogress),
+ Status: cloudflare.F(stream.StreamListParamsStatusInprogress),
Type: cloudflare.F("live"),
})
if err != nil {
@@ -95,7 +96,7 @@ func TestStreamDelete(t *testing.T) {
err := client.Stream.Delete(
context.TODO(),
"ea95132c15732412d22c1476fa83f27a",
- cloudflare.StreamDeleteParams{
+ stream.StreamDeleteParams{
AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
},
)
@@ -125,7 +126,7 @@ func TestStreamGet(t *testing.T) {
_, err := client.Stream.Get(
context.TODO(),
"ea95132c15732412d22c1476fa83f27a",
- cloudflare.StreamGetParams{
+ stream.StreamGetParams{
AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
},
)
diff --git a/stream/token.go b/stream/token.go
new file mode 100644
index 00000000000..ab56b85a964
--- /dev/null
+++ b/stream/token.go
@@ -0,0 +1,221 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package stream
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// TokenService contains methods and other services that help with interacting with
+// the cloudflare API. Note, unlike clients, this service does not read variables
+// from the environment automatically. You should not instantiate this service
+// directly, and instead use the [NewTokenService] method instead.
+type TokenService struct {
+ Options []option.RequestOption
+}
+
+// NewTokenService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewTokenService(opts ...option.RequestOption) (r *TokenService) {
+ r = &TokenService{}
+ r.Options = opts
+ return
+}
+
+// Creates a signed URL token for a video. If a body is not provided in the
+// request, a token is created with default values.
+func (r *TokenService) New(ctx context.Context, identifier string, params TokenNewParams, opts ...option.RequestOption) (res *TokenNewResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env TokenNewResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/stream/%s/token", params.AccountID, identifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type TokenNewResponse struct {
+ // The signed token used with the signed URLs feature.
+ Token string `json:"token"`
+ JSON tokenNewResponseJSON `json:"-"`
+}
+
+// tokenNewResponseJSON contains the JSON metadata for the struct
+// [TokenNewResponse]
+type tokenNewResponseJSON struct {
+ Token apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *TokenNewResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r tokenNewResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type TokenNewParams struct {
+ // The account identifier tag.
+ AccountID param.Field[string] `path:"account_id,required"`
+ // The optional ID of a Stream signing key. If present, the `pem` field is also
+ // required.
+ ID param.Field[string] `json:"id"`
+ // The optional list of access rule constraints on the token. Access can be blocked
+ // or allowed based on an IP, IP range, or by country. Access rules are evaluated
+ // from first to last. If a rule matches, the associated action is applied and no
+ // further rules are evaluated.
+ AccessRules param.Field[[]TokenNewParamsAccessRule] `json:"accessRules"`
+ // The optional boolean value that enables using signed tokens to access MP4
+ // download links for a video.
+ Downloadable param.Field[bool] `json:"downloadable"`
+ // The optional unix epoch timestamp that specficies the time after a token is not
+ // accepted. The maximum time specification is 24 hours from issuing time. If this
+ // field is not set, the default is one hour after issuing.
+ Exp param.Field[int64] `json:"exp"`
+ // The optional unix epoch timestamp that specifies the time before a the token is
+ // not accepted. If this field is not set, the default is one hour before issuing.
+ Nbf param.Field[int64] `json:"nbf"`
+ // The optional base64 encoded private key in PEM format associated with a Stream
+ // signing key. If present, the `id` field is also required.
+ Pem param.Field[string] `json:"pem"`
+}
+
+func (r TokenNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// Defines rules for fine-grained control over content than signed URL tokens
+// alone. Access rules primarily make tokens conditionally valid based on user
+// information. Access Rules are specified on token payloads as the `accessRules`
+// property containing an array of Rule objects.
+type TokenNewParamsAccessRule struct {
+ // The action to take when a request matches a rule. If the action is `block`, the
+ // signed token blocks views for viewers matching the rule.
+ Action param.Field[TokenNewParamsAccessRulesAction] `json:"action"`
+ // An array of 2-letter country codes in ISO 3166-1 Alpha-2 format used to match
+ // requests.
+ Country param.Field[[]string] `json:"country"`
+ // An array of IPv4 or IPV6 addresses or CIDRs used to match requests.
+ IP param.Field[[]string] `json:"ip"`
+ // Lists available rule types to match for requests. An `any` type matches all
+ // requests and can be used as a wildcard to apply default actions after other
+ // rules.
+ Type param.Field[TokenNewParamsAccessRulesType] `json:"type"`
+}
+
+func (r TokenNewParamsAccessRule) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The action to take when a request matches a rule. If the action is `block`, the
+// signed token blocks views for viewers matching the rule.
+type TokenNewParamsAccessRulesAction string
+
+const (
+ TokenNewParamsAccessRulesActionAllow TokenNewParamsAccessRulesAction = "allow"
+ TokenNewParamsAccessRulesActionBlock TokenNewParamsAccessRulesAction = "block"
+)
+
+// Lists available rule types to match for requests. An `any` type matches all
+// requests and can be used as a wildcard to apply default actions after other
+// rules.
+type TokenNewParamsAccessRulesType string
+
+const (
+ TokenNewParamsAccessRulesTypeAny TokenNewParamsAccessRulesType = "any"
+ TokenNewParamsAccessRulesTypeIPSrc TokenNewParamsAccessRulesType = "ip.src"
+ TokenNewParamsAccessRulesTypeIPGeoipCountry TokenNewParamsAccessRulesType = "ip.geoip.country"
+)
+
+type TokenNewResponseEnvelope struct {
+ Errors []TokenNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []TokenNewResponseEnvelopeMessages `json:"messages,required"`
+ Result TokenNewResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success TokenNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON tokenNewResponseEnvelopeJSON `json:"-"`
+}
+
+// tokenNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [TokenNewResponseEnvelope]
+type tokenNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *TokenNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r tokenNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type TokenNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON tokenNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// tokenNewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [TokenNewResponseEnvelopeErrors]
+type tokenNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *TokenNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r tokenNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type TokenNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON tokenNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// tokenNewResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [TokenNewResponseEnvelopeMessages]
+type tokenNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *TokenNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r tokenNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type TokenNewResponseEnvelopeSuccess bool
+
+const (
+ TokenNewResponseEnvelopeSuccessTrue TokenNewResponseEnvelopeSuccess = true
+)
diff --git a/stream/token_test.go b/stream/token_test.go
new file mode 100644
index 00000000000..c6288fbb747
--- /dev/null
+++ b/stream/token_test.go
@@ -0,0 +1,66 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package stream_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/stream"
+)
+
+func TestTokenNewWithOptionalParams(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"),
+ )
+ _, err := client.Stream.Tokens.New(
+ context.TODO(),
+ "ea95132c15732412d22c1476fa83f27a",
+ stream.TokenNewParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ ID: cloudflare.F("ab0d4ef71g4425f8dcba9041231813000"),
+ AccessRules: cloudflare.F([]stream.TokenNewParamsAccessRule{{
+ Action: cloudflare.F(stream.TokenNewParamsAccessRulesActionBlock),
+ Country: cloudflare.F([]string{"US", "MX"}),
+ IP: cloudflare.F([]string{"string", "string", "string"}),
+ Type: cloudflare.F(stream.TokenNewParamsAccessRulesTypeIPGeoipCountry),
+ }, {
+ Action: cloudflare.F(stream.TokenNewParamsAccessRulesActionAllow),
+ Country: cloudflare.F([]string{"string", "string", "string"}),
+ IP: cloudflare.F([]string{"93.184.216.0/24", "2400:cb00::/32"}),
+ Type: cloudflare.F(stream.TokenNewParamsAccessRulesTypeIPSrc),
+ }, {
+ Action: cloudflare.F(stream.TokenNewParamsAccessRulesActionBlock),
+ Country: cloudflare.F([]string{"string", "string", "string"}),
+ IP: cloudflare.F([]string{"string", "string", "string"}),
+ Type: cloudflare.F(stream.TokenNewParamsAccessRulesTypeAny),
+ }}),
+ Downloadable: cloudflare.F(true),
+ Exp: cloudflare.F(int64(0)),
+ Nbf: cloudflare.F(int64(0)),
+ Pem: cloudflare.F("LS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktLS0tLQpNSUlFcEFJQkFBS0NBUUVBc284dnBvOFpEWXRkOUgzbWlPaW1qYXAzVXlVM0oyZ3kwTUYvN1R4blJuRnkwRHpDCkxqUk9naFZsQ0hPQmxsd3NVaE9GU0lyYnN4K05tUTdBeS90TFpXSGxuVGF3UWJ5WGZGOStJeDhVSnNlSHBGV1oKNVF5Z1JYd2liSjh1MVVsZ2xlcmZHMkpueldjVXpZTzEySktZN3doSkw1ajROMWgxZFJNUXQ5Q1pkZFlCQWRzOQpCdk02cjRFMDcxQkhQekhWeDMrUTI1VWtubGdUNXIwS3FiM1E1Y0dlTlBXY1JreW1ybkJEWWR0OXR4eFFMb1dPCllzNXdsMnVYWFVYL0VGcDMwajU0Nmp6czllWExLYlNDbjJjTDZFVE96Y2x3aG9DRGx2a2VQT05rUE9LMDVKNUMKTm1TdFdhMG9hV1VGRzM0MFl3cVVrWGt4OU9tNndXd1JldU1uU1FJREFRQUJBb0lCQUFJOHo1ck5kOEdtOGJBMgo1S3pxQjI1R2lOVENwbUNJeW53NXRJWHZTQmNHcEdydUcvdlN2WG9kVlFVSVY0TWdHQkVXUEFrVzdsNWVBcHI4CnA1ZFd5SkRXYTNkdklFSE9vSEpYU3dBYksxZzZEMTNVa2NkZ1EyRGpoNVhuWDhHZCtBY2c2SmRTQWgxOWtYSHEKMk54RUtBVDB6Ri83a1g2MkRkREFBcWxmQkpGSXJodVIvZUdEVWh4L2piTTRhQ2JCcFdiM0pnRE9OYm5tS1ZoMwpxS2ZwZmRZZENZU1lzWUxrNTlxRDF2VFNwUVFUQ0VadW9VKzNzRVNhdkJzaUs1bU0vTzY5ZkRMRXNURG1MeTVQCmhEK3BMQXI0SlhNNjFwRGVBS0l3cUVqWWJybXlDRHRXTUdJNnZzZ0E1eXQzUUJaME9vV2w5QUkwdWxoZ3p4dXQKZ2ZFNTRRRUNnWUVBN0F3a0lhVEEzYmQ4Nk9jSVZnNFlrWGk1cm5aNDdsM1k4V24zcjIzUmVISXhLdkllRUtSbgp5bUlFNDFtRVBBSmlGWFpLK1VPTXdkeS9EcnFJUithT1JiT2NiV01jWUg2QzgvbG1wdVJFaXE3SW1Ub3VWcnA4CnlnUkprMWprVDA4cTIvNmg4eTBEdjJqMitsaHFXNzRNOUt0cmwxcTRlWmZRUFREL01tR1NnTWtDZ1lFQXdhY04KaSttN1p6dnJtL3NuekF2VlZ5SEtwZHVUUjNERk1naC9maC9tZ0ZHZ1RwZWtUOVV5b3FleGNYQXdwMVlhL01iQQoyNTVJVDZRbXZZTm5yNXp6Wmxic2tMV0hsYllvbWhmWnVXTHhXR3hRaEFORWdaMFVVdUVTRGMvbWx2UXZHbEtSCkZoaGhBUWlVSmdDamhPaHk1SlBiNGFldGRKd0UxK09lVWRFaE1vRUNnWUVBNG8yZ25CM1o4ck5xa3NzemlBek4KYmNuMlJVbDJOaW9pejBwS3JMaDFaT29NNE5BekpQdjJsaHRQMzdtS0htS1hLMHczRjFqTEgwSTBxZmxFVmVZbQpSU1huakdHazJjUnpBYUVzOGgrQzNheDE0Z01pZUtGU3BqNUpNOEFNbVVZOXQ1cUVhN2FYc3o0V1ZoOUlMYmVTCkRiNzlhKzVwd21LQVBrcnBsTHhyZFdrQ2dZQlNNSHVBWVdBbmJYZ1BDS2FZWklGVWJNUWNacmY0ZnpWQ2lmYksKYWZHampvRlNPZXdEOGdGK3BWdWJRTGwxbkFieU44ek1xVDRaaHhybUhpcFlqMjJDaHV2NmN3RXJtbGRiSnpwQwpBMnRaVXdkTk1ESFlMUG5lUHlZeGRJWnlsUXFVeW14SGkydElUQUxNcWtLOGV3ZWdXZHpkeGhQSlJScU5JazhrCmZIVHhnUUtCZ1FEUFc2UXIxY3F3QjNUdnVWdWR4WGRqUTdIcDFodXhrNEVWaEFJZllKNFhSTW1NUE5YS28wdHUKdUt6LzE0QW14R0dvSWJxYVc1bDMzeFNteUxhem84clNUN0tSTjVKME9JSHcrZkR5SFgxdHpVSjZCTldDcEFTcwpjbWdNK0htSzVON0w2bkNaZFJQY2IwU1hGaVRQUGhCUG1PVWFDUnpER0ZMK2JYM1VwajJKbWc9PQotLS0tLUVORCBSU0EgUFJJVkFURSBLRVktLS0tLQo="),
+ },
+ )
+ 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/stream/video.go b/stream/video.go
new file mode 100644
index 00000000000..ebec270f8a5
--- /dev/null
+++ b/stream/video.go
@@ -0,0 +1,174 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package stream
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/apiquery"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/option"
+)
+
+// VideoService contains methods and other services that help with interacting with
+// the cloudflare API. Note, unlike clients, this service does not read variables
+// from the environment automatically. You should not instantiate this service
+// directly, and instead use the [NewVideoService] method instead.
+type VideoService struct {
+ Options []option.RequestOption
+}
+
+// NewVideoService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewVideoService(opts ...option.RequestOption) (r *VideoService) {
+ r = &VideoService{}
+ r.Options = opts
+ return
+}
+
+// Returns information about an account's storage use.
+func (r *VideoService) StorageUsage(ctx context.Context, params VideoStorageUsageParams, opts ...option.RequestOption) (res *VideoStorageUsageResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env VideoStorageUsageResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/stream/storage-usage", params.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type VideoStorageUsageResponse struct {
+ // A user-defined identifier for the media creator.
+ Creator string `json:"creator"`
+ // The total minutes of video content stored in the account.
+ TotalStorageMinutes int64 `json:"totalStorageMinutes"`
+ // The storage capacity alloted for the account.
+ TotalStorageMinutesLimit int64 `json:"totalStorageMinutesLimit"`
+ // The total count of videos associated with the account.
+ VideoCount int64 `json:"videoCount"`
+ JSON videoStorageUsageResponseJSON `json:"-"`
+}
+
+// videoStorageUsageResponseJSON contains the JSON metadata for the struct
+// [VideoStorageUsageResponse]
+type videoStorageUsageResponseJSON struct {
+ Creator apijson.Field
+ TotalStorageMinutes apijson.Field
+ TotalStorageMinutesLimit apijson.Field
+ VideoCount apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *VideoStorageUsageResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r videoStorageUsageResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type VideoStorageUsageParams struct {
+ // The account identifier tag.
+ AccountID param.Field[string] `path:"account_id,required"`
+ // A user-defined identifier for the media creator.
+ Creator param.Field[string] `query:"creator"`
+}
+
+// URLQuery serializes [VideoStorageUsageParams]'s query parameters as
+// `url.Values`.
+func (r VideoStorageUsageParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+type VideoStorageUsageResponseEnvelope struct {
+ Errors []VideoStorageUsageResponseEnvelopeErrors `json:"errors,required"`
+ Messages []VideoStorageUsageResponseEnvelopeMessages `json:"messages,required"`
+ Result VideoStorageUsageResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success VideoStorageUsageResponseEnvelopeSuccess `json:"success,required"`
+ JSON videoStorageUsageResponseEnvelopeJSON `json:"-"`
+}
+
+// videoStorageUsageResponseEnvelopeJSON contains the JSON metadata for the struct
+// [VideoStorageUsageResponseEnvelope]
+type videoStorageUsageResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *VideoStorageUsageResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r videoStorageUsageResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type VideoStorageUsageResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON videoStorageUsageResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// videoStorageUsageResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [VideoStorageUsageResponseEnvelopeErrors]
+type videoStorageUsageResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *VideoStorageUsageResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r videoStorageUsageResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type VideoStorageUsageResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON videoStorageUsageResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// videoStorageUsageResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [VideoStorageUsageResponseEnvelopeMessages]
+type videoStorageUsageResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *VideoStorageUsageResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r videoStorageUsageResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type VideoStorageUsageResponseEnvelopeSuccess bool
+
+const (
+ VideoStorageUsageResponseEnvelopeSuccessTrue VideoStorageUsageResponseEnvelopeSuccess = true
+)
diff --git a/stream/video_test.go b/stream/video_test.go
new file mode 100644
index 00000000000..fa8d69b8844
--- /dev/null
+++ b/stream/video_test.go
@@ -0,0 +1,42 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package stream_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/stream"
+)
+
+func TestVideoStorageUsageWithOptionalParams(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"),
+ )
+ _, err := client.Stream.Videos.StorageUsage(context.TODO(), stream.VideoStorageUsageParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ Creator: cloudflare.F("creator-id_abcde12345"),
+ })
+ 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/stream/watermark.go b/stream/watermark.go
new file mode 100644
index 00000000000..d9e92584a71
--- /dev/null
+++ b/stream/watermark.go
@@ -0,0 +1,568 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package stream
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "reflect"
+ "time"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/tidwall/gjson"
+)
+
+// WatermarkService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewWatermarkService] method instead.
+type WatermarkService struct {
+ Options []option.RequestOption
+}
+
+// NewWatermarkService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewWatermarkService(opts ...option.RequestOption) (r *WatermarkService) {
+ r = &WatermarkService{}
+ r.Options = opts
+ return
+}
+
+// Creates watermark profiles using a single `HTTP POST multipart/form-data`
+// request.
+func (r *WatermarkService) New(ctx context.Context, params WatermarkNewParams, opts ...option.RequestOption) (res *WatermarkNewResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env WatermarkNewResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/stream/watermarks", params.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Lists all watermark profiles for an account.
+func (r *WatermarkService) List(ctx context.Context, query WatermarkListParams, opts ...option.RequestOption) (res *[]StreamWatermarks, err error) {
+ opts = append(r.Options[:], opts...)
+ var env WatermarkListResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/stream/watermarks", query.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Deletes a watermark profile.
+func (r *WatermarkService) Delete(ctx context.Context, identifier string, body WatermarkDeleteParams, opts ...option.RequestOption) (res *WatermarkDeleteResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env WatermarkDeleteResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/stream/watermarks/%s", body.AccountID, identifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Retrieves details for a single watermark profile.
+func (r *WatermarkService) Get(ctx context.Context, identifier string, query WatermarkGetParams, opts ...option.RequestOption) (res *WatermarkGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env WatermarkGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/stream/watermarks/%s", query.AccountID, identifier)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+type StreamWatermarks struct {
+ // The date and a time a watermark profile was created.
+ Created time.Time `json:"created" format:"date-time"`
+ // The source URL for a downloaded image. If the watermark profile was created via
+ // direct upload, this field is null.
+ DownloadedFrom string `json:"downloadedFrom"`
+ // The height of the image in pixels.
+ Height int64 `json:"height"`
+ // A short description of the watermark profile.
+ Name string `json:"name"`
+ // The translucency of the image. A value of `0.0` makes the image completely
+ // transparent, and `1.0` makes the image completely opaque. Note that if the image
+ // is already semi-transparent, setting this to `1.0` will not make the image
+ // completely opaque.
+ Opacity float64 `json:"opacity"`
+ // The whitespace between the adjacent edges (determined by position) of the video
+ // and the image. `0.0` indicates no padding, and `1.0` indicates a fully padded
+ // video width or length, as determined by the algorithm.
+ Padding float64 `json:"padding"`
+ // The location of the image. Valid positions are: `upperRight`, `upperLeft`,
+ // `lowerLeft`, `lowerRight`, and `center`. Note that `center` ignores the
+ // `padding` parameter.
+ Position string `json:"position"`
+ // The size of the image relative to the overall size of the video. This parameter
+ // will adapt to horizontal and vertical videos automatically. `0.0` indicates no
+ // scaling (use the size of the image as-is), and `1.0 `fills the entire video.
+ Scale float64 `json:"scale"`
+ // The size of the image in bytes.
+ Size float64 `json:"size"`
+ // The unique identifier for a watermark profile.
+ Uid string `json:"uid"`
+ // The width of the image in pixels.
+ Width int64 `json:"width"`
+ JSON streamWatermarksJSON `json:"-"`
+}
+
+// streamWatermarksJSON contains the JSON metadata for the struct
+// [StreamWatermarks]
+type streamWatermarksJSON struct {
+ Created apijson.Field
+ DownloadedFrom apijson.Field
+ Height apijson.Field
+ Name apijson.Field
+ Opacity apijson.Field
+ Padding apijson.Field
+ Position apijson.Field
+ Scale apijson.Field
+ Size apijson.Field
+ Uid apijson.Field
+ Width apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *StreamWatermarks) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r streamWatermarksJSON) RawJSON() string {
+ return r.raw
+}
+
+// Union satisfied by [stream.WatermarkNewResponseUnknown] or [shared.UnionString].
+type WatermarkNewResponse interface {
+ ImplementsStreamWatermarkNewResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*WatermarkNewResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+// Union satisfied by [stream.WatermarkDeleteResponseUnknown] or
+// [shared.UnionString].
+type WatermarkDeleteResponse interface {
+ ImplementsStreamWatermarkDeleteResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*WatermarkDeleteResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+// Union satisfied by [stream.WatermarkGetResponseUnknown] or [shared.UnionString].
+type WatermarkGetResponse interface {
+ ImplementsStreamWatermarkGetResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*WatermarkGetResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+type WatermarkNewParams struct {
+ // The account identifier tag.
+ AccountID param.Field[string] `path:"account_id,required"`
+ // The image file to upload.
+ File param.Field[string] `json:"file,required"`
+ // A short description of the watermark profile.
+ Name param.Field[string] `json:"name"`
+ // The translucency of the image. A value of `0.0` makes the image completely
+ // transparent, and `1.0` makes the image completely opaque. Note that if the image
+ // is already semi-transparent, setting this to `1.0` will not make the image
+ // completely opaque.
+ Opacity param.Field[float64] `json:"opacity"`
+ // The whitespace between the adjacent edges (determined by position) of the video
+ // and the image. `0.0` indicates no padding, and `1.0` indicates a fully padded
+ // video width or length, as determined by the algorithm.
+ Padding param.Field[float64] `json:"padding"`
+ // The location of the image. Valid positions are: `upperRight`, `upperLeft`,
+ // `lowerLeft`, `lowerRight`, and `center`. Note that `center` ignores the
+ // `padding` parameter.
+ Position param.Field[string] `json:"position"`
+ // The size of the image relative to the overall size of the video. This parameter
+ // will adapt to horizontal and vertical videos automatically. `0.0` indicates no
+ // scaling (use the size of the image as-is), and `1.0 `fills the entire video.
+ Scale param.Field[float64] `json:"scale"`
+}
+
+func (r WatermarkNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type WatermarkNewResponseEnvelope struct {
+ Errors []WatermarkNewResponseEnvelopeErrors `json:"errors,required"`
+ Messages []WatermarkNewResponseEnvelopeMessages `json:"messages,required"`
+ Result WatermarkNewResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success WatermarkNewResponseEnvelopeSuccess `json:"success,required"`
+ JSON watermarkNewResponseEnvelopeJSON `json:"-"`
+}
+
+// watermarkNewResponseEnvelopeJSON contains the JSON metadata for the struct
+// [WatermarkNewResponseEnvelope]
+type watermarkNewResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WatermarkNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r watermarkNewResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type WatermarkNewResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON watermarkNewResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// watermarkNewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [WatermarkNewResponseEnvelopeErrors]
+type watermarkNewResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WatermarkNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r watermarkNewResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type WatermarkNewResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON watermarkNewResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// watermarkNewResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [WatermarkNewResponseEnvelopeMessages]
+type watermarkNewResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WatermarkNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r watermarkNewResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type WatermarkNewResponseEnvelopeSuccess bool
+
+const (
+ WatermarkNewResponseEnvelopeSuccessTrue WatermarkNewResponseEnvelopeSuccess = true
+)
+
+type WatermarkListParams struct {
+ // The account identifier tag.
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type WatermarkListResponseEnvelope struct {
+ Errors []WatermarkListResponseEnvelopeErrors `json:"errors,required"`
+ Messages []WatermarkListResponseEnvelopeMessages `json:"messages,required"`
+ Result []StreamWatermarks `json:"result,required"`
+ // Whether the API call was successful
+ Success WatermarkListResponseEnvelopeSuccess `json:"success,required"`
+ JSON watermarkListResponseEnvelopeJSON `json:"-"`
+}
+
+// watermarkListResponseEnvelopeJSON contains the JSON metadata for the struct
+// [WatermarkListResponseEnvelope]
+type watermarkListResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WatermarkListResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r watermarkListResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type WatermarkListResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON watermarkListResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// watermarkListResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [WatermarkListResponseEnvelopeErrors]
+type watermarkListResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WatermarkListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r watermarkListResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type WatermarkListResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON watermarkListResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// watermarkListResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [WatermarkListResponseEnvelopeMessages]
+type watermarkListResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WatermarkListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r watermarkListResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type WatermarkListResponseEnvelopeSuccess bool
+
+const (
+ WatermarkListResponseEnvelopeSuccessTrue WatermarkListResponseEnvelopeSuccess = true
+)
+
+type WatermarkDeleteParams struct {
+ // The account identifier tag.
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type WatermarkDeleteResponseEnvelope struct {
+ Errors []WatermarkDeleteResponseEnvelopeErrors `json:"errors,required"`
+ Messages []WatermarkDeleteResponseEnvelopeMessages `json:"messages,required"`
+ Result WatermarkDeleteResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success WatermarkDeleteResponseEnvelopeSuccess `json:"success,required"`
+ JSON watermarkDeleteResponseEnvelopeJSON `json:"-"`
+}
+
+// watermarkDeleteResponseEnvelopeJSON contains the JSON metadata for the struct
+// [WatermarkDeleteResponseEnvelope]
+type watermarkDeleteResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WatermarkDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r watermarkDeleteResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type WatermarkDeleteResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON watermarkDeleteResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// watermarkDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [WatermarkDeleteResponseEnvelopeErrors]
+type watermarkDeleteResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WatermarkDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r watermarkDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type WatermarkDeleteResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON watermarkDeleteResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// watermarkDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [WatermarkDeleteResponseEnvelopeMessages]
+type watermarkDeleteResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WatermarkDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r watermarkDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type WatermarkDeleteResponseEnvelopeSuccess bool
+
+const (
+ WatermarkDeleteResponseEnvelopeSuccessTrue WatermarkDeleteResponseEnvelopeSuccess = true
+)
+
+type WatermarkGetParams struct {
+ // The account identifier tag.
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type WatermarkGetResponseEnvelope struct {
+ Errors []WatermarkGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []WatermarkGetResponseEnvelopeMessages `json:"messages,required"`
+ Result WatermarkGetResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success WatermarkGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON watermarkGetResponseEnvelopeJSON `json:"-"`
+}
+
+// watermarkGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [WatermarkGetResponseEnvelope]
+type watermarkGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WatermarkGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r watermarkGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type WatermarkGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON watermarkGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// watermarkGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [WatermarkGetResponseEnvelopeErrors]
+type watermarkGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WatermarkGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r watermarkGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type WatermarkGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON watermarkGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// watermarkGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [WatermarkGetResponseEnvelopeMessages]
+type watermarkGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WatermarkGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r watermarkGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type WatermarkGetResponseEnvelopeSuccess bool
+
+const (
+ WatermarkGetResponseEnvelopeSuccessTrue WatermarkGetResponseEnvelopeSuccess = true
+)
diff --git a/stream/watermark_test.go b/stream/watermark_test.go
new file mode 100644
index 00000000000..56d74ae12a9
--- /dev/null
+++ b/stream/watermark_test.go
@@ -0,0 +1,133 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package stream_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/stream"
+)
+
+func TestWatermarkNewWithOptionalParams(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"),
+ )
+ _, err := client.Stream.Watermarks.New(context.TODO(), stream.WatermarkNewParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ File: cloudflare.F("@/Users/rchen/Downloads/watermark.png"),
+ Name: cloudflare.F("Marketing Videos"),
+ Opacity: cloudflare.F(0.750000),
+ Padding: cloudflare.F(0.100000),
+ Position: cloudflare.F("center"),
+ Scale: cloudflare.F(0.100000),
+ })
+ 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())
+ }
+}
+
+func TestWatermarkList(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"),
+ )
+ _, err := client.Stream.Watermarks.List(context.TODO(), stream.WatermarkListParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ })
+ 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())
+ }
+}
+
+func TestWatermarkDelete(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"),
+ )
+ _, err := client.Stream.Watermarks.Delete(
+ context.TODO(),
+ "ea95132c15732412d22c1476fa83f27a",
+ stream.WatermarkDeleteParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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())
+ }
+}
+
+func TestWatermarkGet(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"),
+ )
+ _, err := client.Stream.Watermarks.Get(
+ context.TODO(),
+ "ea95132c15732412d22c1476fa83f27a",
+ stream.WatermarkGetParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ },
+ )
+ 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/stream/webhook.go b/stream/webhook.go
new file mode 100644
index 00000000000..4d739d34eb4
--- /dev/null
+++ b/stream/webhook.go
@@ -0,0 +1,387 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package stream
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "reflect"
+
+ "github.com/cloudflare/cloudflare-go/internal/apijson"
+ "github.com/cloudflare/cloudflare-go/internal/param"
+ "github.com/cloudflare/cloudflare-go/internal/requestconfig"
+ "github.com/cloudflare/cloudflare-go/internal/shared"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/tidwall/gjson"
+)
+
+// WebhookService contains methods and other services that help with interacting
+// with the cloudflare API. Note, unlike clients, this service does not read
+// variables from the environment automatically. You should not instantiate this
+// service directly, and instead use the [NewWebhookService] method instead.
+type WebhookService struct {
+ Options []option.RequestOption
+}
+
+// NewWebhookService generates a new service that applies the given options to each
+// request. These options are applied after the parent client's options (if there
+// is one), and before any request-specific options.
+func NewWebhookService(opts ...option.RequestOption) (r *WebhookService) {
+ r = &WebhookService{}
+ r.Options = opts
+ return
+}
+
+// Creates a webhook notification.
+func (r *WebhookService) Update(ctx context.Context, params WebhookUpdateParams, opts ...option.RequestOption) (res *WebhookUpdateResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env WebhookUpdateResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/stream/webhook", params.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Deletes a webhook.
+func (r *WebhookService) Delete(ctx context.Context, body WebhookDeleteParams, opts ...option.RequestOption) (res *WebhookDeleteResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env WebhookDeleteResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/stream/webhook", body.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Retrieves a list of webhooks.
+func (r *WebhookService) Get(ctx context.Context, query WebhookGetParams, opts ...option.RequestOption) (res *WebhookGetResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ var env WebhookGetResponseEnvelope
+ path := fmt.Sprintf("accounts/%s/stream/webhook", query.AccountID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
+ if err != nil {
+ return
+ }
+ res = &env.Result
+ return
+}
+
+// Union satisfied by [stream.WebhookUpdateResponseUnknown] or
+// [shared.UnionString].
+type WebhookUpdateResponse interface {
+ ImplementsStreamWebhookUpdateResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*WebhookUpdateResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+// Union satisfied by [stream.WebhookDeleteResponseUnknown] or
+// [shared.UnionString].
+type WebhookDeleteResponse interface {
+ ImplementsStreamWebhookDeleteResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*WebhookDeleteResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+// Union satisfied by [stream.WebhookGetResponseUnknown] or [shared.UnionString].
+type WebhookGetResponse interface {
+ ImplementsStreamWebhookGetResponse()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*WebhookGetResponse)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ )
+}
+
+type WebhookUpdateParams struct {
+ // The account identifier tag.
+ AccountID param.Field[string] `path:"account_id,required"`
+ // The URL where webhooks will be sent.
+ NotificationURL param.Field[string] `json:"notificationUrl,required" format:"uri"`
+}
+
+func (r WebhookUpdateParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type WebhookUpdateResponseEnvelope struct {
+ Errors []WebhookUpdateResponseEnvelopeErrors `json:"errors,required"`
+ Messages []WebhookUpdateResponseEnvelopeMessages `json:"messages,required"`
+ Result WebhookUpdateResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success WebhookUpdateResponseEnvelopeSuccess `json:"success,required"`
+ JSON webhookUpdateResponseEnvelopeJSON `json:"-"`
+}
+
+// webhookUpdateResponseEnvelopeJSON contains the JSON metadata for the struct
+// [WebhookUpdateResponseEnvelope]
+type webhookUpdateResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WebhookUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r webhookUpdateResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type WebhookUpdateResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON webhookUpdateResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// webhookUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [WebhookUpdateResponseEnvelopeErrors]
+type webhookUpdateResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WebhookUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r webhookUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type WebhookUpdateResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON webhookUpdateResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// webhookUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [WebhookUpdateResponseEnvelopeMessages]
+type webhookUpdateResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WebhookUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r webhookUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type WebhookUpdateResponseEnvelopeSuccess bool
+
+const (
+ WebhookUpdateResponseEnvelopeSuccessTrue WebhookUpdateResponseEnvelopeSuccess = true
+)
+
+type WebhookDeleteParams struct {
+ // The account identifier tag.
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type WebhookDeleteResponseEnvelope struct {
+ Errors []WebhookDeleteResponseEnvelopeErrors `json:"errors,required"`
+ Messages []WebhookDeleteResponseEnvelopeMessages `json:"messages,required"`
+ Result WebhookDeleteResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success WebhookDeleteResponseEnvelopeSuccess `json:"success,required"`
+ JSON webhookDeleteResponseEnvelopeJSON `json:"-"`
+}
+
+// webhookDeleteResponseEnvelopeJSON contains the JSON metadata for the struct
+// [WebhookDeleteResponseEnvelope]
+type webhookDeleteResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WebhookDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r webhookDeleteResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type WebhookDeleteResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON webhookDeleteResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// webhookDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the
+// struct [WebhookDeleteResponseEnvelopeErrors]
+type webhookDeleteResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WebhookDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r webhookDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type WebhookDeleteResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON webhookDeleteResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// webhookDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the
+// struct [WebhookDeleteResponseEnvelopeMessages]
+type webhookDeleteResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WebhookDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r webhookDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type WebhookDeleteResponseEnvelopeSuccess bool
+
+const (
+ WebhookDeleteResponseEnvelopeSuccessTrue WebhookDeleteResponseEnvelopeSuccess = true
+)
+
+type WebhookGetParams struct {
+ // The account identifier tag.
+ AccountID param.Field[string] `path:"account_id,required"`
+}
+
+type WebhookGetResponseEnvelope struct {
+ Errors []WebhookGetResponseEnvelopeErrors `json:"errors,required"`
+ Messages []WebhookGetResponseEnvelopeMessages `json:"messages,required"`
+ Result WebhookGetResponse `json:"result,required"`
+ // Whether the API call was successful
+ Success WebhookGetResponseEnvelopeSuccess `json:"success,required"`
+ JSON webhookGetResponseEnvelopeJSON `json:"-"`
+}
+
+// webhookGetResponseEnvelopeJSON contains the JSON metadata for the struct
+// [WebhookGetResponseEnvelope]
+type webhookGetResponseEnvelopeJSON struct {
+ Errors apijson.Field
+ Messages apijson.Field
+ Result apijson.Field
+ Success apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WebhookGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r webhookGetResponseEnvelopeJSON) RawJSON() string {
+ return r.raw
+}
+
+type WebhookGetResponseEnvelopeErrors struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON webhookGetResponseEnvelopeErrorsJSON `json:"-"`
+}
+
+// webhookGetResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
+// [WebhookGetResponseEnvelopeErrors]
+type webhookGetResponseEnvelopeErrorsJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WebhookGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r webhookGetResponseEnvelopeErrorsJSON) RawJSON() string {
+ return r.raw
+}
+
+type WebhookGetResponseEnvelopeMessages struct {
+ Code int64 `json:"code,required"`
+ Message string `json:"message,required"`
+ JSON webhookGetResponseEnvelopeMessagesJSON `json:"-"`
+}
+
+// webhookGetResponseEnvelopeMessagesJSON contains the JSON metadata for the struct
+// [WebhookGetResponseEnvelopeMessages]
+type webhookGetResponseEnvelopeMessagesJSON struct {
+ Code apijson.Field
+ Message apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *WebhookGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r webhookGetResponseEnvelopeMessagesJSON) RawJSON() string {
+ return r.raw
+}
+
+// Whether the API call was successful
+type WebhookGetResponseEnvelopeSuccess bool
+
+const (
+ WebhookGetResponseEnvelopeSuccessTrue WebhookGetResponseEnvelopeSuccess = true
+)
diff --git a/stream/webhook_test.go b/stream/webhook_test.go
new file mode 100644
index 00000000000..483000b86a2
--- /dev/null
+++ b/stream/webhook_test.go
@@ -0,0 +1,94 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package stream_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/cloudflare/cloudflare-go"
+ "github.com/cloudflare/cloudflare-go/internal/testutil"
+ "github.com/cloudflare/cloudflare-go/option"
+ "github.com/cloudflare/cloudflare-go/stream"
+)
+
+func TestWebhookUpdate(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"),
+ )
+ _, err := client.Stream.Webhooks.Update(context.TODO(), stream.WebhookUpdateParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ NotificationURL: cloudflare.F("https://example.com"),
+ })
+ 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())
+ }
+}
+
+func TestWebhookDelete(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"),
+ )
+ _, err := client.Stream.Webhooks.Delete(context.TODO(), stream.WebhookDeleteParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ })
+ 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())
+ }
+}
+
+func TestWebhookGet(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"),
+ )
+ _, err := client.Stream.Webhooks.Get(context.TODO(), stream.WebhookGetParams{
+ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
+ })
+ 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/streamaudiotrack.go b/streamaudiotrack.go
deleted file mode 100644
index 3953d238028..00000000000
--- a/streamaudiotrack.go
+++ /dev/null
@@ -1,595 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "reflect"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/option"
- "github.com/tidwall/gjson"
-)
-
-// StreamAudioTrackService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewStreamAudioTrackService] method
-// instead.
-type StreamAudioTrackService struct {
- Options []option.RequestOption
-}
-
-// NewStreamAudioTrackService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewStreamAudioTrackService(opts ...option.RequestOption) (r *StreamAudioTrackService) {
- r = &StreamAudioTrackService{}
- r.Options = opts
- return
-}
-
-// Deletes additional audio tracks on a video. Deleting a default audio track is
-// not allowed. You must assign another audio track as default prior to deletion.
-func (r *StreamAudioTrackService) Delete(ctx context.Context, identifier string, audioIdentifier string, body StreamAudioTrackDeleteParams, opts ...option.RequestOption) (res *StreamAudioTrackDeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env StreamAudioTrackDeleteResponseEnvelope
- path := fmt.Sprintf("accounts/%s/stream/%s/audio/%s", body.AccountID, identifier, audioIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Adds an additional audio track to a video using the provided audio track URL.
-func (r *StreamAudioTrackService) Copy(ctx context.Context, identifier string, params StreamAudioTrackCopyParams, opts ...option.RequestOption) (res *StreamAudioTrackCopyResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env StreamAudioTrackCopyResponseEnvelope
- path := fmt.Sprintf("accounts/%s/stream/%s/audio/copy", params.AccountID, identifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Edits additional audio tracks on a video. Editing the default status of an audio
-// track to `true` will mark all other audio tracks on the video default status to
-// `false`.
-func (r *StreamAudioTrackService) Edit(ctx context.Context, identifier string, audioIdentifier string, params StreamAudioTrackEditParams, opts ...option.RequestOption) (res *StreamAudioTrackEditResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env StreamAudioTrackEditResponseEnvelope
- path := fmt.Sprintf("accounts/%s/stream/%s/audio/%s", params.AccountID, identifier, audioIdentifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Lists additional audio tracks on a video. Note this API will not return
-// information for audio attached to the video upload.
-func (r *StreamAudioTrackService) Get(ctx context.Context, identifier string, query StreamAudioTrackGetParams, opts ...option.RequestOption) (res *[]StreamAudioTrackGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env StreamAudioTrackGetResponseEnvelope
- path := fmt.Sprintf("accounts/%s/stream/%s/audio", query.AccountID, identifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Union satisfied by [StreamAudioTrackDeleteResponseUnknown] or
-// [shared.UnionString].
-type StreamAudioTrackDeleteResponse interface {
- ImplementsStreamAudioTrackDeleteResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*StreamAudioTrackDeleteResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-type StreamAudioTrackCopyResponse struct {
- // Denotes whether the audio track will be played by default in a player.
- Default bool `json:"default"`
- // A string to uniquely identify the track amongst other audio track labels for the
- // specified video.
- Label string `json:"label"`
- // Specifies the processing status of the video.
- Status StreamAudioTrackCopyResponseStatus `json:"status"`
- // A Cloudflare-generated unique identifier for a media item.
- Uid string `json:"uid"`
- JSON streamAudioTrackCopyResponseJSON `json:"-"`
-}
-
-// streamAudioTrackCopyResponseJSON contains the JSON metadata for the struct
-// [StreamAudioTrackCopyResponse]
-type streamAudioTrackCopyResponseJSON struct {
- Default apijson.Field
- Label apijson.Field
- Status apijson.Field
- Uid apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StreamAudioTrackCopyResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r streamAudioTrackCopyResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// Specifies the processing status of the video.
-type StreamAudioTrackCopyResponseStatus string
-
-const (
- StreamAudioTrackCopyResponseStatusQueued StreamAudioTrackCopyResponseStatus = "queued"
- StreamAudioTrackCopyResponseStatusReady StreamAudioTrackCopyResponseStatus = "ready"
- StreamAudioTrackCopyResponseStatusError StreamAudioTrackCopyResponseStatus = "error"
-)
-
-type StreamAudioTrackEditResponse struct {
- // Denotes whether the audio track will be played by default in a player.
- Default bool `json:"default"`
- // A string to uniquely identify the track amongst other audio track labels for the
- // specified video.
- Label string `json:"label"`
- // Specifies the processing status of the video.
- Status StreamAudioTrackEditResponseStatus `json:"status"`
- // A Cloudflare-generated unique identifier for a media item.
- Uid string `json:"uid"`
- JSON streamAudioTrackEditResponseJSON `json:"-"`
-}
-
-// streamAudioTrackEditResponseJSON contains the JSON metadata for the struct
-// [StreamAudioTrackEditResponse]
-type streamAudioTrackEditResponseJSON struct {
- Default apijson.Field
- Label apijson.Field
- Status apijson.Field
- Uid apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StreamAudioTrackEditResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r streamAudioTrackEditResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// Specifies the processing status of the video.
-type StreamAudioTrackEditResponseStatus string
-
-const (
- StreamAudioTrackEditResponseStatusQueued StreamAudioTrackEditResponseStatus = "queued"
- StreamAudioTrackEditResponseStatusReady StreamAudioTrackEditResponseStatus = "ready"
- StreamAudioTrackEditResponseStatusError StreamAudioTrackEditResponseStatus = "error"
-)
-
-type StreamAudioTrackGetResponse struct {
- // Denotes whether the audio track will be played by default in a player.
- Default bool `json:"default"`
- // A string to uniquely identify the track amongst other audio track labels for the
- // specified video.
- Label string `json:"label"`
- // Specifies the processing status of the video.
- Status StreamAudioTrackGetResponseStatus `json:"status"`
- // A Cloudflare-generated unique identifier for a media item.
- Uid string `json:"uid"`
- JSON streamAudioTrackGetResponseJSON `json:"-"`
-}
-
-// streamAudioTrackGetResponseJSON contains the JSON metadata for the struct
-// [StreamAudioTrackGetResponse]
-type streamAudioTrackGetResponseJSON struct {
- Default apijson.Field
- Label apijson.Field
- Status apijson.Field
- Uid apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StreamAudioTrackGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r streamAudioTrackGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-// Specifies the processing status of the video.
-type StreamAudioTrackGetResponseStatus string
-
-const (
- StreamAudioTrackGetResponseStatusQueued StreamAudioTrackGetResponseStatus = "queued"
- StreamAudioTrackGetResponseStatusReady StreamAudioTrackGetResponseStatus = "ready"
- StreamAudioTrackGetResponseStatusError StreamAudioTrackGetResponseStatus = "error"
-)
-
-type StreamAudioTrackDeleteParams struct {
- // The account identifier tag.
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type StreamAudioTrackDeleteResponseEnvelope struct {
- Errors []StreamAudioTrackDeleteResponseEnvelopeErrors `json:"errors,required"`
- Messages []StreamAudioTrackDeleteResponseEnvelopeMessages `json:"messages,required"`
- Result StreamAudioTrackDeleteResponse `json:"result,required"`
- // Whether the API call was successful
- Success StreamAudioTrackDeleteResponseEnvelopeSuccess `json:"success,required"`
- JSON streamAudioTrackDeleteResponseEnvelopeJSON `json:"-"`
-}
-
-// streamAudioTrackDeleteResponseEnvelopeJSON contains the JSON metadata for the
-// struct [StreamAudioTrackDeleteResponseEnvelope]
-type streamAudioTrackDeleteResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StreamAudioTrackDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r streamAudioTrackDeleteResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type StreamAudioTrackDeleteResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON streamAudioTrackDeleteResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// streamAudioTrackDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [StreamAudioTrackDeleteResponseEnvelopeErrors]
-type streamAudioTrackDeleteResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StreamAudioTrackDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r streamAudioTrackDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type StreamAudioTrackDeleteResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON streamAudioTrackDeleteResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// streamAudioTrackDeleteResponseEnvelopeMessagesJSON contains the JSON metadata
-// for the struct [StreamAudioTrackDeleteResponseEnvelopeMessages]
-type streamAudioTrackDeleteResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StreamAudioTrackDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r streamAudioTrackDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type StreamAudioTrackDeleteResponseEnvelopeSuccess bool
-
-const (
- StreamAudioTrackDeleteResponseEnvelopeSuccessTrue StreamAudioTrackDeleteResponseEnvelopeSuccess = true
-)
-
-type StreamAudioTrackCopyParams struct {
- // The account identifier tag.
- AccountID param.Field[string] `path:"account_id,required"`
- // A string to uniquely identify the track amongst other audio track labels for the
- // specified video.
- Label param.Field[string] `json:"label,required"`
- // An audio track URL. The server must be publicly routable and support `HTTP HEAD`
- // requests and `HTTP GET` range requests. The server should respond to `HTTP HEAD`
- // requests with a `content-range` header that includes the size of the file.
- URL param.Field[string] `json:"url" format:"uri"`
-}
-
-func (r StreamAudioTrackCopyParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type StreamAudioTrackCopyResponseEnvelope struct {
- Errors []StreamAudioTrackCopyResponseEnvelopeErrors `json:"errors,required"`
- Messages []StreamAudioTrackCopyResponseEnvelopeMessages `json:"messages,required"`
- Result StreamAudioTrackCopyResponse `json:"result,required"`
- // Whether the API call was successful
- Success StreamAudioTrackCopyResponseEnvelopeSuccess `json:"success,required"`
- JSON streamAudioTrackCopyResponseEnvelopeJSON `json:"-"`
-}
-
-// streamAudioTrackCopyResponseEnvelopeJSON contains the JSON metadata for the
-// struct [StreamAudioTrackCopyResponseEnvelope]
-type streamAudioTrackCopyResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StreamAudioTrackCopyResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r streamAudioTrackCopyResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type StreamAudioTrackCopyResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON streamAudioTrackCopyResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// streamAudioTrackCopyResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [StreamAudioTrackCopyResponseEnvelopeErrors]
-type streamAudioTrackCopyResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StreamAudioTrackCopyResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r streamAudioTrackCopyResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type StreamAudioTrackCopyResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON streamAudioTrackCopyResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// streamAudioTrackCopyResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [StreamAudioTrackCopyResponseEnvelopeMessages]
-type streamAudioTrackCopyResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StreamAudioTrackCopyResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r streamAudioTrackCopyResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type StreamAudioTrackCopyResponseEnvelopeSuccess bool
-
-const (
- StreamAudioTrackCopyResponseEnvelopeSuccessTrue StreamAudioTrackCopyResponseEnvelopeSuccess = true
-)
-
-type StreamAudioTrackEditParams struct {
- // The account identifier tag.
- AccountID param.Field[string] `path:"account_id,required"`
- // Denotes whether the audio track will be played by default in a player.
- Default param.Field[bool] `json:"default"`
- // A string to uniquely identify the track amongst other audio track labels for the
- // specified video.
- Label param.Field[string] `json:"label"`
-}
-
-func (r StreamAudioTrackEditParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type StreamAudioTrackEditResponseEnvelope struct {
- Errors []StreamAudioTrackEditResponseEnvelopeErrors `json:"errors,required"`
- Messages []StreamAudioTrackEditResponseEnvelopeMessages `json:"messages,required"`
- Result StreamAudioTrackEditResponse `json:"result,required"`
- // Whether the API call was successful
- Success StreamAudioTrackEditResponseEnvelopeSuccess `json:"success,required"`
- JSON streamAudioTrackEditResponseEnvelopeJSON `json:"-"`
-}
-
-// streamAudioTrackEditResponseEnvelopeJSON contains the JSON metadata for the
-// struct [StreamAudioTrackEditResponseEnvelope]
-type streamAudioTrackEditResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StreamAudioTrackEditResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r streamAudioTrackEditResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type StreamAudioTrackEditResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON streamAudioTrackEditResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// streamAudioTrackEditResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [StreamAudioTrackEditResponseEnvelopeErrors]
-type streamAudioTrackEditResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StreamAudioTrackEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r streamAudioTrackEditResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type StreamAudioTrackEditResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON streamAudioTrackEditResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// streamAudioTrackEditResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [StreamAudioTrackEditResponseEnvelopeMessages]
-type streamAudioTrackEditResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StreamAudioTrackEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r streamAudioTrackEditResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type StreamAudioTrackEditResponseEnvelopeSuccess bool
-
-const (
- StreamAudioTrackEditResponseEnvelopeSuccessTrue StreamAudioTrackEditResponseEnvelopeSuccess = true
-)
-
-type StreamAudioTrackGetParams struct {
- // The account identifier tag.
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type StreamAudioTrackGetResponseEnvelope struct {
- Errors []StreamAudioTrackGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []StreamAudioTrackGetResponseEnvelopeMessages `json:"messages,required"`
- Result []StreamAudioTrackGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success StreamAudioTrackGetResponseEnvelopeSuccess `json:"success,required"`
- JSON streamAudioTrackGetResponseEnvelopeJSON `json:"-"`
-}
-
-// streamAudioTrackGetResponseEnvelopeJSON contains the JSON metadata for the
-// struct [StreamAudioTrackGetResponseEnvelope]
-type streamAudioTrackGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StreamAudioTrackGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r streamAudioTrackGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type StreamAudioTrackGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON streamAudioTrackGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// streamAudioTrackGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [StreamAudioTrackGetResponseEnvelopeErrors]
-type streamAudioTrackGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StreamAudioTrackGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r streamAudioTrackGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type StreamAudioTrackGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON streamAudioTrackGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// streamAudioTrackGetResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [StreamAudioTrackGetResponseEnvelopeMessages]
-type streamAudioTrackGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StreamAudioTrackGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r streamAudioTrackGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type StreamAudioTrackGetResponseEnvelopeSuccess bool
-
-const (
- StreamAudioTrackGetResponseEnvelopeSuccessTrue StreamAudioTrackGetResponseEnvelopeSuccess = true
-)
diff --git a/streamaudiotrack_test.go b/streamaudiotrack_test.go
deleted file mode 100644
index d034294e4d1..00000000000
--- a/streamaudiotrack_test.go
+++ /dev/null
@@ -1,140 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestStreamAudioTrackDelete(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"),
- )
- _, err := client.Stream.AudioTracks.Delete(
- context.TODO(),
- "ea95132c15732412d22c1476fa83f27a",
- "ea95132c15732412d22c1476fa83f27a",
- cloudflare.StreamAudioTrackDeleteParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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())
- }
-}
-
-func TestStreamAudioTrackCopyWithOptionalParams(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"),
- )
- _, err := client.Stream.AudioTracks.Copy(
- context.TODO(),
- "ea95132c15732412d22c1476fa83f27a",
- cloudflare.StreamAudioTrackCopyParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Label: cloudflare.F("director commentary"),
- URL: cloudflare.F("https://www.examplestorage.com/audio_file.mp3"),
- },
- )
- 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())
- }
-}
-
-func TestStreamAudioTrackEditWithOptionalParams(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"),
- )
- _, err := client.Stream.AudioTracks.Edit(
- context.TODO(),
- "ea95132c15732412d22c1476fa83f27a",
- "ea95132c15732412d22c1476fa83f27a",
- cloudflare.StreamAudioTrackEditParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- Default: cloudflare.F(true),
- Label: cloudflare.F("director commentary"),
- },
- )
- 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())
- }
-}
-
-func TestStreamAudioTrackGet(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"),
- )
- _, err := client.Stream.AudioTracks.Get(
- context.TODO(),
- "ea95132c15732412d22c1476fa83f27a",
- cloudflare.StreamAudioTrackGetParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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/streamcaption.go b/streamcaption.go
deleted file mode 100644
index e417ca45875..00000000000
--- a/streamcaption.go
+++ /dev/null
@@ -1,405 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "reflect"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/option"
- "github.com/tidwall/gjson"
-)
-
-// StreamCaptionService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewStreamCaptionService] method
-// instead.
-type StreamCaptionService struct {
- Options []option.RequestOption
-}
-
-// NewStreamCaptionService generates a new service that applies the given options
-// to each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewStreamCaptionService(opts ...option.RequestOption) (r *StreamCaptionService) {
- r = &StreamCaptionService{}
- r.Options = opts
- return
-}
-
-// Uploads the caption or subtitle file to the endpoint for a specific BCP47
-// language. One caption or subtitle file per language is allowed.
-func (r *StreamCaptionService) Update(ctx context.Context, identifier string, language string, params StreamCaptionUpdateParams, opts ...option.RequestOption) (res *StreamCaptionUpdateResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env StreamCaptionUpdateResponseEnvelope
- path := fmt.Sprintf("accounts/%s/stream/%s/captions/%s", params.AccountID, identifier, language)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Removes the captions or subtitles from a video.
-func (r *StreamCaptionService) Delete(ctx context.Context, identifier string, language string, body StreamCaptionDeleteParams, opts ...option.RequestOption) (res *StreamCaptionDeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env StreamCaptionDeleteResponseEnvelope
- path := fmt.Sprintf("accounts/%s/stream/%s/captions/%s", body.AccountID, identifier, language)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Lists the available captions or subtitles for a specific video.
-func (r *StreamCaptionService) Get(ctx context.Context, identifier string, query StreamCaptionGetParams, opts ...option.RequestOption) (res *[]StreamCaptionGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env StreamCaptionGetResponseEnvelope
- path := fmt.Sprintf("accounts/%s/stream/%s/captions", query.AccountID, identifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Union satisfied by [StreamCaptionUpdateResponseUnknown] or [shared.UnionString].
-type StreamCaptionUpdateResponse interface {
- ImplementsStreamCaptionUpdateResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*StreamCaptionUpdateResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-// Union satisfied by [StreamCaptionDeleteResponseUnknown],
-// [StreamCaptionDeleteResponseArray] or [shared.UnionString].
-type StreamCaptionDeleteResponse interface {
- ImplementsStreamCaptionDeleteResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*StreamCaptionDeleteResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.JSON,
- Type: reflect.TypeOf(StreamCaptionDeleteResponseArray{}),
- },
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-type StreamCaptionDeleteResponseArray []interface{}
-
-func (r StreamCaptionDeleteResponseArray) ImplementsStreamCaptionDeleteResponse() {}
-
-type StreamCaptionGetResponse struct {
- // The language label displayed in the native language to users.
- Label string `json:"label"`
- // The language tag in BCP 47 format.
- Language string `json:"language"`
- JSON streamCaptionGetResponseJSON `json:"-"`
-}
-
-// streamCaptionGetResponseJSON contains the JSON metadata for the struct
-// [StreamCaptionGetResponse]
-type streamCaptionGetResponseJSON struct {
- Label apijson.Field
- Language apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StreamCaptionGetResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r streamCaptionGetResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type StreamCaptionUpdateParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
- // The WebVTT file containing the caption or subtitle content.
- File param.Field[string] `json:"file,required"`
-}
-
-func (r StreamCaptionUpdateParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type StreamCaptionUpdateResponseEnvelope struct {
- Errors []StreamCaptionUpdateResponseEnvelopeErrors `json:"errors,required"`
- Messages []StreamCaptionUpdateResponseEnvelopeMessages `json:"messages,required"`
- Result StreamCaptionUpdateResponse `json:"result,required"`
- // Whether the API call was successful
- Success StreamCaptionUpdateResponseEnvelopeSuccess `json:"success,required"`
- JSON streamCaptionUpdateResponseEnvelopeJSON `json:"-"`
-}
-
-// streamCaptionUpdateResponseEnvelopeJSON contains the JSON metadata for the
-// struct [StreamCaptionUpdateResponseEnvelope]
-type streamCaptionUpdateResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StreamCaptionUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r streamCaptionUpdateResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type StreamCaptionUpdateResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON streamCaptionUpdateResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// streamCaptionUpdateResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [StreamCaptionUpdateResponseEnvelopeErrors]
-type streamCaptionUpdateResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StreamCaptionUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r streamCaptionUpdateResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type StreamCaptionUpdateResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON streamCaptionUpdateResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// streamCaptionUpdateResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [StreamCaptionUpdateResponseEnvelopeMessages]
-type streamCaptionUpdateResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StreamCaptionUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r streamCaptionUpdateResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type StreamCaptionUpdateResponseEnvelopeSuccess bool
-
-const (
- StreamCaptionUpdateResponseEnvelopeSuccessTrue StreamCaptionUpdateResponseEnvelopeSuccess = true
-)
-
-type StreamCaptionDeleteParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type StreamCaptionDeleteResponseEnvelope struct {
- Errors []StreamCaptionDeleteResponseEnvelopeErrors `json:"errors,required"`
- Messages []StreamCaptionDeleteResponseEnvelopeMessages `json:"messages,required"`
- Result StreamCaptionDeleteResponse `json:"result,required"`
- // Whether the API call was successful
- Success StreamCaptionDeleteResponseEnvelopeSuccess `json:"success,required"`
- JSON streamCaptionDeleteResponseEnvelopeJSON `json:"-"`
-}
-
-// streamCaptionDeleteResponseEnvelopeJSON contains the JSON metadata for the
-// struct [StreamCaptionDeleteResponseEnvelope]
-type streamCaptionDeleteResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StreamCaptionDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r streamCaptionDeleteResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type StreamCaptionDeleteResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON streamCaptionDeleteResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// streamCaptionDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [StreamCaptionDeleteResponseEnvelopeErrors]
-type streamCaptionDeleteResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StreamCaptionDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r streamCaptionDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type StreamCaptionDeleteResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON streamCaptionDeleteResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// streamCaptionDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [StreamCaptionDeleteResponseEnvelopeMessages]
-type streamCaptionDeleteResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StreamCaptionDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r streamCaptionDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type StreamCaptionDeleteResponseEnvelopeSuccess bool
-
-const (
- StreamCaptionDeleteResponseEnvelopeSuccessTrue StreamCaptionDeleteResponseEnvelopeSuccess = true
-)
-
-type StreamCaptionGetParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type StreamCaptionGetResponseEnvelope struct {
- Errors []StreamCaptionGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []StreamCaptionGetResponseEnvelopeMessages `json:"messages,required"`
- Result []StreamCaptionGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success StreamCaptionGetResponseEnvelopeSuccess `json:"success,required"`
- JSON streamCaptionGetResponseEnvelopeJSON `json:"-"`
-}
-
-// streamCaptionGetResponseEnvelopeJSON contains the JSON metadata for the struct
-// [StreamCaptionGetResponseEnvelope]
-type streamCaptionGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StreamCaptionGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r streamCaptionGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type StreamCaptionGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON streamCaptionGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// streamCaptionGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [StreamCaptionGetResponseEnvelopeErrors]
-type streamCaptionGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StreamCaptionGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r streamCaptionGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type StreamCaptionGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON streamCaptionGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// streamCaptionGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [StreamCaptionGetResponseEnvelopeMessages]
-type streamCaptionGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StreamCaptionGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r streamCaptionGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type StreamCaptionGetResponseEnvelopeSuccess bool
-
-const (
- StreamCaptionGetResponseEnvelopeSuccessTrue StreamCaptionGetResponseEnvelopeSuccess = true
-)
diff --git a/streamcaption_test.go b/streamcaption_test.go
deleted file mode 100644
index fc105d52938..00000000000
--- a/streamcaption_test.go
+++ /dev/null
@@ -1,107 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestStreamCaptionUpdate(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"),
- )
- _, err := client.Stream.Captions.Update(
- context.TODO(),
- "ea95132c15732412d22c1476fa83f27a",
- "tr",
- cloudflare.StreamCaptionUpdateParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- File: cloudflare.F("@/Users/kyle/Desktop/tr.vtt"),
- },
- )
- 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())
- }
-}
-
-func TestStreamCaptionDelete(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"),
- )
- _, err := client.Stream.Captions.Delete(
- context.TODO(),
- "ea95132c15732412d22c1476fa83f27a",
- "tr",
- cloudflare.StreamCaptionDeleteParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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())
- }
-}
-
-func TestStreamCaptionGet(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"),
- )
- _, err := client.Stream.Captions.Get(
- context.TODO(),
- "ea95132c15732412d22c1476fa83f27a",
- cloudflare.StreamCaptionGetParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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/streamclip.go b/streamclip.go
deleted file mode 100644
index b80792a94de..00000000000
--- a/streamclip.go
+++ /dev/null
@@ -1,301 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// StreamClipService contains methods and other services that help with interacting
-// with the cloudflare API. Note, unlike clients, this service does not read
-// variables from the environment automatically. You should not instantiate this
-// service directly, and instead use the [NewStreamClipService] method instead.
-type StreamClipService struct {
- Options []option.RequestOption
-}
-
-// NewStreamClipService generates a new service that applies the given options to
-// each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewStreamClipService(opts ...option.RequestOption) (r *StreamClipService) {
- r = &StreamClipService{}
- r.Options = opts
- return
-}
-
-// Clips a video based on the specified start and end times provided in seconds.
-func (r *StreamClipService) New(ctx context.Context, params StreamClipNewParams, opts ...option.RequestOption) (res *StreamClipNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env StreamClipNewResponseEnvelope
- path := fmt.Sprintf("accounts/%s/stream/clip", params.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type StreamClipNewResponse struct {
- // Lists the origins allowed to display the video. Enter allowed origin domains in
- // an array and use `*` for wildcard subdomains. Empty arrays allow the video to be
- // viewed on any origin.
- AllowedOrigins []string `json:"allowedOrigins"`
- // The unique video identifier (UID).
- ClippedFromVideoUid string `json:"clippedFromVideoUID"`
- // The date and time the clip was created.
- Created time.Time `json:"created" format:"date-time"`
- // A user-defined identifier for the media creator.
- Creator string `json:"creator"`
- // Specifies the end time for the video clip in seconds.
- EndTimeSeconds int64 `json:"endTimeSeconds"`
- // The maximum duration in seconds for a video upload. Can be set for a video that
- // is not yet uploaded to limit its duration. Uploads that exceed the specified
- // duration will fail during processing. A value of `-1` means the value is
- // unknown.
- MaxDurationSeconds int64 `json:"maxDurationSeconds"`
- // A user modifiable key-value store used to reference other systems of record for
- // managing videos.
- Meta interface{} `json:"meta"`
- // The date and time the live input was last modified.
- Modified time.Time `json:"modified" format:"date-time"`
- Playback StreamClipNewResponsePlayback `json:"playback"`
- // The video's preview page URI. This field is omitted until encoding is complete.
- Preview string `json:"preview" format:"uri"`
- // Indicates whether the video can be a accessed using the UID. When set to `true`,
- // a signed token must be generated with a signing key to view the video.
- RequireSignedURLs bool `json:"requireSignedURLs"`
- // Specifies the start time for the video clip in seconds.
- StartTimeSeconds int64 `json:"startTimeSeconds"`
- // Specifies the processing status for all quality levels for a video.
- Status StreamClipNewResponseStatus `json:"status"`
- // The timestamp for a thumbnail image calculated as a percentage value of the
- // video's duration. To convert from a second-wise timestamp to a percentage,
- // divide the desired timestamp by the total duration of the video. If this value
- // is not set, the default thumbnail image is taken from 0s of the video.
- ThumbnailTimestampPct float64 `json:"thumbnailTimestampPct"`
- Watermark StreamClipNewResponseWatermark `json:"watermark"`
- JSON streamClipNewResponseJSON `json:"-"`
-}
-
-// streamClipNewResponseJSON contains the JSON metadata for the struct
-// [StreamClipNewResponse]
-type streamClipNewResponseJSON struct {
- AllowedOrigins apijson.Field
- ClippedFromVideoUid apijson.Field
- Created apijson.Field
- Creator apijson.Field
- EndTimeSeconds apijson.Field
- MaxDurationSeconds apijson.Field
- Meta apijson.Field
- Modified apijson.Field
- Playback apijson.Field
- Preview apijson.Field
- RequireSignedURLs apijson.Field
- StartTimeSeconds apijson.Field
- Status apijson.Field
- ThumbnailTimestampPct apijson.Field
- Watermark apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StreamClipNewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r streamClipNewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type StreamClipNewResponsePlayback struct {
- // DASH Media Presentation Description for the video.
- Dash string `json:"dash"`
- // The HLS manifest for the video.
- Hls string `json:"hls"`
- JSON streamClipNewResponsePlaybackJSON `json:"-"`
-}
-
-// streamClipNewResponsePlaybackJSON contains the JSON metadata for the struct
-// [StreamClipNewResponsePlayback]
-type streamClipNewResponsePlaybackJSON struct {
- Dash apijson.Field
- Hls apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StreamClipNewResponsePlayback) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r streamClipNewResponsePlaybackJSON) RawJSON() string {
- return r.raw
-}
-
-// Specifies the processing status for all quality levels for a video.
-type StreamClipNewResponseStatus string
-
-const (
- StreamClipNewResponseStatusPendingupload StreamClipNewResponseStatus = "pendingupload"
- StreamClipNewResponseStatusDownloading StreamClipNewResponseStatus = "downloading"
- StreamClipNewResponseStatusQueued StreamClipNewResponseStatus = "queued"
- StreamClipNewResponseStatusInprogress StreamClipNewResponseStatus = "inprogress"
- StreamClipNewResponseStatusReady StreamClipNewResponseStatus = "ready"
- StreamClipNewResponseStatusError StreamClipNewResponseStatus = "error"
-)
-
-type StreamClipNewResponseWatermark struct {
- // The unique identifier for the watermark profile.
- Uid string `json:"uid"`
- JSON streamClipNewResponseWatermarkJSON `json:"-"`
-}
-
-// streamClipNewResponseWatermarkJSON contains the JSON metadata for the struct
-// [StreamClipNewResponseWatermark]
-type streamClipNewResponseWatermarkJSON struct {
- Uid apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StreamClipNewResponseWatermark) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r streamClipNewResponseWatermarkJSON) RawJSON() string {
- return r.raw
-}
-
-type StreamClipNewParams struct {
- // The account identifier tag.
- AccountID param.Field[string] `path:"account_id,required"`
- // The unique video identifier (UID).
- ClippedFromVideoUid param.Field[string] `json:"clippedFromVideoUID,required"`
- // Specifies the end time for the video clip in seconds.
- EndTimeSeconds param.Field[int64] `json:"endTimeSeconds,required"`
- // Specifies the start time for the video clip in seconds.
- StartTimeSeconds param.Field[int64] `json:"startTimeSeconds,required"`
- // Lists the origins allowed to display the video. Enter allowed origin domains in
- // an array and use `*` for wildcard subdomains. Empty arrays allow the video to be
- // viewed on any origin.
- AllowedOrigins param.Field[[]string] `json:"allowedOrigins"`
- // A user-defined identifier for the media creator.
- Creator param.Field[string] `json:"creator"`
- // The maximum duration in seconds for a video upload. Can be set for a video that
- // is not yet uploaded to limit its duration. Uploads that exceed the specified
- // duration will fail during processing. A value of `-1` means the value is
- // unknown.
- MaxDurationSeconds param.Field[int64] `json:"maxDurationSeconds"`
- // Indicates whether the video can be a accessed using the UID. When set to `true`,
- // a signed token must be generated with a signing key to view the video.
- RequireSignedURLs param.Field[bool] `json:"requireSignedURLs"`
- // The timestamp for a thumbnail image calculated as a percentage value of the
- // video's duration. To convert from a second-wise timestamp to a percentage,
- // divide the desired timestamp by the total duration of the video. If this value
- // is not set, the default thumbnail image is taken from 0s of the video.
- ThumbnailTimestampPct param.Field[float64] `json:"thumbnailTimestampPct"`
- Watermark param.Field[StreamClipNewParamsWatermark] `json:"watermark"`
-}
-
-func (r StreamClipNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type StreamClipNewParamsWatermark struct {
- // The unique identifier for the watermark profile.
- Uid param.Field[string] `json:"uid"`
-}
-
-func (r StreamClipNewParamsWatermark) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type StreamClipNewResponseEnvelope struct {
- Errors []StreamClipNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []StreamClipNewResponseEnvelopeMessages `json:"messages,required"`
- Result StreamClipNewResponse `json:"result,required"`
- // Whether the API call was successful
- Success StreamClipNewResponseEnvelopeSuccess `json:"success,required"`
- JSON streamClipNewResponseEnvelopeJSON `json:"-"`
-}
-
-// streamClipNewResponseEnvelopeJSON contains the JSON metadata for the struct
-// [StreamClipNewResponseEnvelope]
-type streamClipNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StreamClipNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r streamClipNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type StreamClipNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON streamClipNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// streamClipNewResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [StreamClipNewResponseEnvelopeErrors]
-type streamClipNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StreamClipNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r streamClipNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type StreamClipNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON streamClipNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// streamClipNewResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [StreamClipNewResponseEnvelopeMessages]
-type streamClipNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StreamClipNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r streamClipNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type StreamClipNewResponseEnvelopeSuccess bool
-
-const (
- StreamClipNewResponseEnvelopeSuccessTrue StreamClipNewResponseEnvelopeSuccess = true
-)
diff --git a/streamclip_test.go b/streamclip_test.go
deleted file mode 100644
index 504bc548c39..00000000000
--- a/streamclip_test.go
+++ /dev/null
@@ -1,51 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestStreamClipNewWithOptionalParams(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"),
- )
- _, err := client.Stream.Clips.New(context.TODO(), cloudflare.StreamClipNewParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- ClippedFromVideoUid: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- EndTimeSeconds: cloudflare.F(int64(0)),
- StartTimeSeconds: cloudflare.F(int64(0)),
- AllowedOrigins: cloudflare.F([]string{"example.com"}),
- Creator: cloudflare.F("creator-id_abcde12345"),
- MaxDurationSeconds: cloudflare.F(int64(1)),
- RequireSignedURLs: cloudflare.F(true),
- ThumbnailTimestampPct: cloudflare.F(0.529241),
- Watermark: cloudflare.F(cloudflare.StreamClipNewParamsWatermark{
- Uid: cloudflare.F("ea95132c15732412d22c1476fa83f27a"),
- }),
- })
- 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/streamcopy.go b/streamcopy.go
deleted file mode 100644
index 6f28e9b30af..00000000000
--- a/streamcopy.go
+++ /dev/null
@@ -1,448 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// StreamCopyService contains methods and other services that help with interacting
-// with the cloudflare API. Note, unlike clients, this service does not read
-// variables from the environment automatically. You should not instantiate this
-// service directly, and instead use the [NewStreamCopyService] method instead.
-type StreamCopyService struct {
- Options []option.RequestOption
-}
-
-// NewStreamCopyService generates a new service that applies the given options to
-// each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewStreamCopyService(opts ...option.RequestOption) (r *StreamCopyService) {
- r = &StreamCopyService{}
- r.Options = opts
- return
-}
-
-// Uploads a video to Stream from a provided URL.
-func (r *StreamCopyService) New(ctx context.Context, params StreamCopyNewParams, opts ...option.RequestOption) (res *StreamCopyNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env StreamCopyNewResponseEnvelope
- path := fmt.Sprintf("accounts/%s/stream/copy", params.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type StreamCopyNewResponse struct {
- // Lists the origins allowed to display the video. Enter allowed origin domains in
- // an array and use `*` for wildcard subdomains. Empty arrays allow the video to be
- // viewed on any origin.
- AllowedOrigins []string `json:"allowedOrigins"`
- // The date and time the media item was created.
- Created time.Time `json:"created" format:"date-time"`
- // A user-defined identifier for the media creator.
- Creator string `json:"creator"`
- // The duration of the video in seconds. A value of `-1` means the duration is
- // unknown. The duration becomes available after the upload and before the video is
- // ready.
- Duration float64 `json:"duration"`
- Input StreamCopyNewResponseInput `json:"input"`
- // The live input ID used to upload a video with Stream Live.
- LiveInput string `json:"liveInput"`
- // The maximum duration in seconds for a video upload. Can be set for a video that
- // is not yet uploaded to limit its duration. Uploads that exceed the specified
- // duration will fail during processing. A value of `-1` means the value is
- // unknown.
- MaxDurationSeconds int64 `json:"maxDurationSeconds"`
- // A user modifiable key-value store used to reference other systems of record for
- // managing videos.
- Meta interface{} `json:"meta"`
- // The date and time the media item was last modified.
- Modified time.Time `json:"modified" format:"date-time"`
- Playback StreamCopyNewResponsePlayback `json:"playback"`
- // The video's preview page URI. This field is omitted until encoding is complete.
- Preview string `json:"preview" format:"uri"`
- // Indicates whether the video is playable. The field is empty if the video is not
- // ready for viewing or the live stream is still in progress.
- ReadyToStream bool `json:"readyToStream"`
- // Indicates the time at which the video became playable. The field is empty if the
- // video is not ready for viewing or the live stream is still in progress.
- ReadyToStreamAt time.Time `json:"readyToStreamAt" format:"date-time"`
- // Indicates whether the video can be a accessed using the UID. When set to `true`,
- // a signed token must be generated with a signing key to view the video.
- RequireSignedURLs bool `json:"requireSignedURLs"`
- // Indicates the date and time at which the video will be deleted. Omit the field
- // to indicate no change, or include with a `null` value to remove an existing
- // scheduled deletion. If specified, must be at least 30 days from upload time.
- ScheduledDeletion time.Time `json:"scheduledDeletion" format:"date-time"`
- // The size of the media item in bytes.
- Size float64 `json:"size"`
- // Specifies a detailed status for a video. If the `state` is `inprogress` or
- // `error`, the `step` field returns `encoding` or `manifest`. If the `state` is
- // `inprogress`, `pctComplete` returns a number between 0 and 100 to indicate the
- // approximate percent of completion. If the `state` is `error`, `errorReasonCode`
- // and `errorReasonText` provide additional details.
- Status StreamCopyNewResponseStatus `json:"status"`
- // The media item's thumbnail URI. This field is omitted until encoding is
- // complete.
- Thumbnail string `json:"thumbnail" format:"uri"`
- // The timestamp for a thumbnail image calculated as a percentage value of the
- // video's duration. To convert from a second-wise timestamp to a percentage,
- // divide the desired timestamp by the total duration of the video. If this value
- // is not set, the default thumbnail image is taken from 0s of the video.
- ThumbnailTimestampPct float64 `json:"thumbnailTimestampPct"`
- // A Cloudflare-generated unique identifier for a media item.
- Uid string `json:"uid"`
- // The date and time the media item was uploaded.
- Uploaded time.Time `json:"uploaded" format:"date-time"`
- // The date and time when the video upload URL is no longer valid for direct user
- // uploads.
- UploadExpiry time.Time `json:"uploadExpiry" format:"date-time"`
- Watermark StreamCopyNewResponseWatermark `json:"watermark"`
- JSON streamCopyNewResponseJSON `json:"-"`
-}
-
-// streamCopyNewResponseJSON contains the JSON metadata for the struct
-// [StreamCopyNewResponse]
-type streamCopyNewResponseJSON struct {
- AllowedOrigins apijson.Field
- Created apijson.Field
- Creator apijson.Field
- Duration apijson.Field
- Input apijson.Field
- LiveInput apijson.Field
- MaxDurationSeconds apijson.Field
- Meta apijson.Field
- Modified apijson.Field
- Playback apijson.Field
- Preview apijson.Field
- ReadyToStream apijson.Field
- ReadyToStreamAt apijson.Field
- RequireSignedURLs apijson.Field
- ScheduledDeletion apijson.Field
- Size apijson.Field
- Status apijson.Field
- Thumbnail apijson.Field
- ThumbnailTimestampPct apijson.Field
- Uid apijson.Field
- Uploaded apijson.Field
- UploadExpiry apijson.Field
- Watermark apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StreamCopyNewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r streamCopyNewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type StreamCopyNewResponseInput struct {
- // The video height in pixels. A value of `-1` means the height is unknown. The
- // value becomes available after the upload and before the video is ready.
- Height int64 `json:"height"`
- // The video width in pixels. A value of `-1` means the width is unknown. The value
- // becomes available after the upload and before the video is ready.
- Width int64 `json:"width"`
- JSON streamCopyNewResponseInputJSON `json:"-"`
-}
-
-// streamCopyNewResponseInputJSON contains the JSON metadata for the struct
-// [StreamCopyNewResponseInput]
-type streamCopyNewResponseInputJSON struct {
- Height apijson.Field
- Width apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StreamCopyNewResponseInput) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r streamCopyNewResponseInputJSON) RawJSON() string {
- return r.raw
-}
-
-type StreamCopyNewResponsePlayback struct {
- // DASH Media Presentation Description for the video.
- Dash string `json:"dash"`
- // The HLS manifest for the video.
- Hls string `json:"hls"`
- JSON streamCopyNewResponsePlaybackJSON `json:"-"`
-}
-
-// streamCopyNewResponsePlaybackJSON contains the JSON metadata for the struct
-// [StreamCopyNewResponsePlayback]
-type streamCopyNewResponsePlaybackJSON struct {
- Dash apijson.Field
- Hls apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StreamCopyNewResponsePlayback) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r streamCopyNewResponsePlaybackJSON) RawJSON() string {
- return r.raw
-}
-
-// Specifies a detailed status for a video. If the `state` is `inprogress` or
-// `error`, the `step` field returns `encoding` or `manifest`. If the `state` is
-// `inprogress`, `pctComplete` returns a number between 0 and 100 to indicate the
-// approximate percent of completion. If the `state` is `error`, `errorReasonCode`
-// and `errorReasonText` provide additional details.
-type StreamCopyNewResponseStatus struct {
- // Specifies why the video failed to encode. This field is empty if the video is
- // not in an `error` state. Preferred for programmatic use.
- ErrorReasonCode string `json:"errorReasonCode"`
- // Specifies why the video failed to encode using a human readable error message in
- // English. This field is empty if the video is not in an `error` state.
- ErrorReasonText string `json:"errorReasonText"`
- // Indicates the size of the entire upload in bytes. The value must be a
- // non-negative integer.
- PctComplete string `json:"pctComplete"`
- // Specifies the processing status for all quality levels for a video.
- State StreamCopyNewResponseStatusState `json:"state"`
- JSON streamCopyNewResponseStatusJSON `json:"-"`
-}
-
-// streamCopyNewResponseStatusJSON contains the JSON metadata for the struct
-// [StreamCopyNewResponseStatus]
-type streamCopyNewResponseStatusJSON struct {
- ErrorReasonCode apijson.Field
- ErrorReasonText apijson.Field
- PctComplete apijson.Field
- State apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StreamCopyNewResponseStatus) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r streamCopyNewResponseStatusJSON) RawJSON() string {
- return r.raw
-}
-
-// Specifies the processing status for all quality levels for a video.
-type StreamCopyNewResponseStatusState string
-
-const (
- StreamCopyNewResponseStatusStatePendingupload StreamCopyNewResponseStatusState = "pendingupload"
- StreamCopyNewResponseStatusStateDownloading StreamCopyNewResponseStatusState = "downloading"
- StreamCopyNewResponseStatusStateQueued StreamCopyNewResponseStatusState = "queued"
- StreamCopyNewResponseStatusStateInprogress StreamCopyNewResponseStatusState = "inprogress"
- StreamCopyNewResponseStatusStateReady StreamCopyNewResponseStatusState = "ready"
- StreamCopyNewResponseStatusStateError StreamCopyNewResponseStatusState = "error"
-)
-
-type StreamCopyNewResponseWatermark struct {
- // The date and a time a watermark profile was created.
- Created time.Time `json:"created" format:"date-time"`
- // The source URL for a downloaded image. If the watermark profile was created via
- // direct upload, this field is null.
- DownloadedFrom string `json:"downloadedFrom"`
- // The height of the image in pixels.
- Height int64 `json:"height"`
- // A short description of the watermark profile.
- Name string `json:"name"`
- // The translucency of the image. A value of `0.0` makes the image completely
- // transparent, and `1.0` makes the image completely opaque. Note that if the image
- // is already semi-transparent, setting this to `1.0` will not make the image
- // completely opaque.
- Opacity float64 `json:"opacity"`
- // The whitespace between the adjacent edges (determined by position) of the video
- // and the image. `0.0` indicates no padding, and `1.0` indicates a fully padded
- // video width or length, as determined by the algorithm.
- Padding float64 `json:"padding"`
- // The location of the image. Valid positions are: `upperRight`, `upperLeft`,
- // `lowerLeft`, `lowerRight`, and `center`. Note that `center` ignores the
- // `padding` parameter.
- Position string `json:"position"`
- // The size of the image relative to the overall size of the video. This parameter
- // will adapt to horizontal and vertical videos automatically. `0.0` indicates no
- // scaling (use the size of the image as-is), and `1.0 `fills the entire video.
- Scale float64 `json:"scale"`
- // The size of the image in bytes.
- Size float64 `json:"size"`
- // The unique identifier for a watermark profile.
- Uid string `json:"uid"`
- // The width of the image in pixels.
- Width int64 `json:"width"`
- JSON streamCopyNewResponseWatermarkJSON `json:"-"`
-}
-
-// streamCopyNewResponseWatermarkJSON contains the JSON metadata for the struct
-// [StreamCopyNewResponseWatermark]
-type streamCopyNewResponseWatermarkJSON struct {
- Created apijson.Field
- DownloadedFrom apijson.Field
- Height apijson.Field
- Name apijson.Field
- Opacity apijson.Field
- Padding apijson.Field
- Position apijson.Field
- Scale apijson.Field
- Size apijson.Field
- Uid apijson.Field
- Width apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StreamCopyNewResponseWatermark) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r streamCopyNewResponseWatermarkJSON) RawJSON() string {
- return r.raw
-}
-
-type StreamCopyNewParams struct {
- // The account identifier tag.
- AccountID param.Field[string] `path:"account_id,required"`
- // A video's URL. The server must be publicly routable and support `HTTP HEAD`
- // requests and `HTTP GET` range requests. The server should respond to `HTTP HEAD`
- // requests with a `content-range` header that includes the size of the file.
- URL param.Field[string] `json:"url,required" format:"uri"`
- // Lists the origins allowed to display the video. Enter allowed origin domains in
- // an array and use `*` for wildcard subdomains. Empty arrays allow the video to be
- // viewed on any origin.
- AllowedOrigins param.Field[[]string] `json:"allowedOrigins"`
- // A user-defined identifier for the media creator.
- Creator param.Field[string] `json:"creator"`
- // A user modifiable key-value store used to reference other systems of record for
- // managing videos.
- Meta param.Field[interface{}] `json:"meta"`
- // Indicates whether the video can be a accessed using the UID. When set to `true`,
- // a signed token must be generated with a signing key to view the video.
- RequireSignedURLs param.Field[bool] `json:"requireSignedURLs"`
- // Indicates the date and time at which the video will be deleted. Omit the field
- // to indicate no change, or include with a `null` value to remove an existing
- // scheduled deletion. If specified, must be at least 30 days from upload time.
- ScheduledDeletion param.Field[time.Time] `json:"scheduledDeletion" format:"date-time"`
- // The timestamp for a thumbnail image calculated as a percentage value of the
- // video's duration. To convert from a second-wise timestamp to a percentage,
- // divide the desired timestamp by the total duration of the video. If this value
- // is not set, the default thumbnail image is taken from 0s of the video.
- ThumbnailTimestampPct param.Field[float64] `json:"thumbnailTimestampPct"`
- Watermark param.Field[StreamCopyNewParamsWatermark] `json:"watermark"`
- // A user-defined identifier for the media creator.
- UploadCreator param.Field[string] `header:"Upload-Creator"`
- // Comma-separated key-value pairs following the TUS protocol specification. Values
- // are Base-64 encoded. Supported keys: `name`, `requiresignedurls`,
- // `allowedorigins`, `thumbnailtimestamppct`, `watermark`, `scheduleddeletion`.
- UploadMetadata param.Field[string] `header:"Upload-Metadata"`
-}
-
-func (r StreamCopyNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type StreamCopyNewParamsWatermark struct {
- // The unique identifier for the watermark profile.
- Uid param.Field[string] `json:"uid"`
-}
-
-func (r StreamCopyNewParamsWatermark) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type StreamCopyNewResponseEnvelope struct {
- Errors []StreamCopyNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []StreamCopyNewResponseEnvelopeMessages `json:"messages,required"`
- Result StreamCopyNewResponse `json:"result,required"`
- // Whether the API call was successful
- Success StreamCopyNewResponseEnvelopeSuccess `json:"success,required"`
- JSON streamCopyNewResponseEnvelopeJSON `json:"-"`
-}
-
-// streamCopyNewResponseEnvelopeJSON contains the JSON metadata for the struct
-// [StreamCopyNewResponseEnvelope]
-type streamCopyNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StreamCopyNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r streamCopyNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type StreamCopyNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON streamCopyNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// streamCopyNewResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [StreamCopyNewResponseEnvelopeErrors]
-type streamCopyNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StreamCopyNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r streamCopyNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type StreamCopyNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON streamCopyNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// streamCopyNewResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [StreamCopyNewResponseEnvelopeMessages]
-type streamCopyNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StreamCopyNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r streamCopyNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type StreamCopyNewResponseEnvelopeSuccess bool
-
-const (
- StreamCopyNewResponseEnvelopeSuccessTrue StreamCopyNewResponseEnvelopeSuccess = true
-)
diff --git a/streamcopy_test.go b/streamcopy_test.go
deleted file mode 100644
index c73e729262c..00000000000
--- a/streamcopy_test.go
+++ /dev/null
@@ -1,55 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
- "time"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestStreamCopyNewWithOptionalParams(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"),
- )
- _, err := client.Stream.Copies.New(context.TODO(), cloudflare.StreamCopyNewParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- URL: cloudflare.F("https://example.com/myvideo.mp4"),
- AllowedOrigins: cloudflare.F([]string{"example.com"}),
- Creator: cloudflare.F("creator-id_abcde12345"),
- Meta: cloudflare.F[any](map[string]interface{}{
- "name": "video12345.mp4",
- }),
- RequireSignedURLs: cloudflare.F(true),
- ScheduledDeletion: cloudflare.F(time.Now()),
- ThumbnailTimestampPct: cloudflare.F(0.529241),
- Watermark: cloudflare.F(cloudflare.StreamCopyNewParamsWatermark{
- Uid: cloudflare.F("ea95132c15732412d22c1476fa83f27a"),
- }),
- UploadCreator: cloudflare.F("creator-id_abcde12345"),
- UploadMetadata: cloudflare.F("name aGVsbG8gd29ybGQ=, requiresignedurls, allowedorigins ZXhhbXBsZS5jb20sdGVzdC5jb20="),
- })
- 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/streamdirectupload.go b/streamdirectupload.go
deleted file mode 100644
index 7521d5a9bad..00000000000
--- a/streamdirectupload.go
+++ /dev/null
@@ -1,271 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// StreamDirectUploadService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewStreamDirectUploadService] method
-// instead.
-type StreamDirectUploadService struct {
- Options []option.RequestOption
-}
-
-// NewStreamDirectUploadService generates a new service that applies the given
-// options to each request. These options are applied after the parent client's
-// options (if there is one), and before any request-specific options.
-func NewStreamDirectUploadService(opts ...option.RequestOption) (r *StreamDirectUploadService) {
- r = &StreamDirectUploadService{}
- r.Options = opts
- return
-}
-
-// Creates a direct upload that allows video uploads without an API key.
-func (r *StreamDirectUploadService) New(ctx context.Context, params StreamDirectUploadNewParams, opts ...option.RequestOption) (res *StreamDirectUploadNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env StreamDirectUploadNewResponseEnvelope
- path := fmt.Sprintf("accounts/%s/stream/direct_upload", params.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-type StreamDirectUploadNewResponse struct {
- // Indicates the date and time at which the video will be deleted. Omit the field
- // to indicate no change, or include with a `null` value to remove an existing
- // scheduled deletion. If specified, must be at least 30 days from upload time.
- ScheduledDeletion time.Time `json:"scheduledDeletion" format:"date-time"`
- // A Cloudflare-generated unique identifier for a media item.
- Uid string `json:"uid"`
- // The URL an unauthenticated upload can use for a single
- // `HTTP POST multipart/form-data` request.
- UploadURL string `json:"uploadURL"`
- Watermark StreamDirectUploadNewResponseWatermark `json:"watermark"`
- JSON streamDirectUploadNewResponseJSON `json:"-"`
-}
-
-// streamDirectUploadNewResponseJSON contains the JSON metadata for the struct
-// [StreamDirectUploadNewResponse]
-type streamDirectUploadNewResponseJSON struct {
- ScheduledDeletion apijson.Field
- Uid apijson.Field
- UploadURL apijson.Field
- Watermark apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StreamDirectUploadNewResponse) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r streamDirectUploadNewResponseJSON) RawJSON() string {
- return r.raw
-}
-
-type StreamDirectUploadNewResponseWatermark struct {
- // The date and a time a watermark profile was created.
- Created time.Time `json:"created" format:"date-time"`
- // The source URL for a downloaded image. If the watermark profile was created via
- // direct upload, this field is null.
- DownloadedFrom string `json:"downloadedFrom"`
- // The height of the image in pixels.
- Height int64 `json:"height"`
- // A short description of the watermark profile.
- Name string `json:"name"`
- // The translucency of the image. A value of `0.0` makes the image completely
- // transparent, and `1.0` makes the image completely opaque. Note that if the image
- // is already semi-transparent, setting this to `1.0` will not make the image
- // completely opaque.
- Opacity float64 `json:"opacity"`
- // The whitespace between the adjacent edges (determined by position) of the video
- // and the image. `0.0` indicates no padding, and `1.0` indicates a fully padded
- // video width or length, as determined by the algorithm.
- Padding float64 `json:"padding"`
- // The location of the image. Valid positions are: `upperRight`, `upperLeft`,
- // `lowerLeft`, `lowerRight`, and `center`. Note that `center` ignores the
- // `padding` parameter.
- Position string `json:"position"`
- // The size of the image relative to the overall size of the video. This parameter
- // will adapt to horizontal and vertical videos automatically. `0.0` indicates no
- // scaling (use the size of the image as-is), and `1.0 `fills the entire video.
- Scale float64 `json:"scale"`
- // The size of the image in bytes.
- Size float64 `json:"size"`
- // The unique identifier for a watermark profile.
- Uid string `json:"uid"`
- // The width of the image in pixels.
- Width int64 `json:"width"`
- JSON streamDirectUploadNewResponseWatermarkJSON `json:"-"`
-}
-
-// streamDirectUploadNewResponseWatermarkJSON contains the JSON metadata for the
-// struct [StreamDirectUploadNewResponseWatermark]
-type streamDirectUploadNewResponseWatermarkJSON struct {
- Created apijson.Field
- DownloadedFrom apijson.Field
- Height apijson.Field
- Name apijson.Field
- Opacity apijson.Field
- Padding apijson.Field
- Position apijson.Field
- Scale apijson.Field
- Size apijson.Field
- Uid apijson.Field
- Width apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StreamDirectUploadNewResponseWatermark) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r streamDirectUploadNewResponseWatermarkJSON) RawJSON() string {
- return r.raw
-}
-
-type StreamDirectUploadNewParams struct {
- // The account identifier tag.
- AccountID param.Field[string] `path:"account_id,required"`
- // The maximum duration in seconds for a video upload. Can be set for a video that
- // is not yet uploaded to limit its duration. Uploads that exceed the specified
- // duration will fail during processing. A value of `-1` means the value is
- // unknown.
- MaxDurationSeconds param.Field[int64] `json:"maxDurationSeconds,required"`
- // Lists the origins allowed to display the video. Enter allowed origin domains in
- // an array and use `*` for wildcard subdomains. Empty arrays allow the video to be
- // viewed on any origin.
- AllowedOrigins param.Field[[]string] `json:"allowedOrigins"`
- // A user-defined identifier for the media creator.
- Creator param.Field[string] `json:"creator"`
- // The date and time after upload when videos will not be accepted.
- Expiry param.Field[time.Time] `json:"expiry" format:"date-time"`
- // A user modifiable key-value store used to reference other systems of record for
- // managing videos.
- Meta param.Field[interface{}] `json:"meta"`
- // Indicates whether the video can be a accessed using the UID. When set to `true`,
- // a signed token must be generated with a signing key to view the video.
- RequireSignedURLs param.Field[bool] `json:"requireSignedURLs"`
- // Indicates the date and time at which the video will be deleted. Omit the field
- // to indicate no change, or include with a `null` value to remove an existing
- // scheduled deletion. If specified, must be at least 30 days from upload time.
- ScheduledDeletion param.Field[time.Time] `json:"scheduledDeletion" format:"date-time"`
- // The timestamp for a thumbnail image calculated as a percentage value of the
- // video's duration. To convert from a second-wise timestamp to a percentage,
- // divide the desired timestamp by the total duration of the video. If this value
- // is not set, the default thumbnail image is taken from 0s of the video.
- ThumbnailTimestampPct param.Field[float64] `json:"thumbnailTimestampPct"`
- Watermark param.Field[StreamDirectUploadNewParamsWatermark] `json:"watermark"`
- // A user-defined identifier for the media creator.
- UploadCreator param.Field[string] `header:"Upload-Creator"`
-}
-
-func (r StreamDirectUploadNewParams) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type StreamDirectUploadNewParamsWatermark struct {
- // The unique identifier for the watermark profile.
- Uid param.Field[string] `json:"uid"`
-}
-
-func (r StreamDirectUploadNewParamsWatermark) MarshalJSON() (data []byte, err error) {
- return apijson.MarshalRoot(r)
-}
-
-type StreamDirectUploadNewResponseEnvelope struct {
- Errors []StreamDirectUploadNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []StreamDirectUploadNewResponseEnvelopeMessages `json:"messages,required"`
- Result StreamDirectUploadNewResponse `json:"result,required"`
- // Whether the API call was successful
- Success StreamDirectUploadNewResponseEnvelopeSuccess `json:"success,required"`
- JSON streamDirectUploadNewResponseEnvelopeJSON `json:"-"`
-}
-
-// streamDirectUploadNewResponseEnvelopeJSON contains the JSON metadata for the
-// struct [StreamDirectUploadNewResponseEnvelope]
-type streamDirectUploadNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StreamDirectUploadNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r streamDirectUploadNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type StreamDirectUploadNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON streamDirectUploadNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// streamDirectUploadNewResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [StreamDirectUploadNewResponseEnvelopeErrors]
-type streamDirectUploadNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StreamDirectUploadNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r streamDirectUploadNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type StreamDirectUploadNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON streamDirectUploadNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// streamDirectUploadNewResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [StreamDirectUploadNewResponseEnvelopeMessages]
-type streamDirectUploadNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StreamDirectUploadNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r streamDirectUploadNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type StreamDirectUploadNewResponseEnvelopeSuccess bool
-
-const (
- StreamDirectUploadNewResponseEnvelopeSuccessTrue StreamDirectUploadNewResponseEnvelopeSuccess = true
-)
diff --git a/streamdirectupload_test.go b/streamdirectupload_test.go
deleted file mode 100644
index e803b051732..00000000000
--- a/streamdirectupload_test.go
+++ /dev/null
@@ -1,55 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
- "time"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestStreamDirectUploadNewWithOptionalParams(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"),
- )
- _, err := client.Stream.DirectUploads.New(context.TODO(), cloudflare.StreamDirectUploadNewParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- MaxDurationSeconds: cloudflare.F(int64(1)),
- AllowedOrigins: cloudflare.F([]string{"example.com"}),
- Creator: cloudflare.F("creator-id_abcde12345"),
- Expiry: cloudflare.F(time.Now()),
- Meta: cloudflare.F[any](map[string]interface{}{
- "name": "video12345.mp4",
- }),
- RequireSignedURLs: cloudflare.F(true),
- ScheduledDeletion: cloudflare.F(time.Now()),
- ThumbnailTimestampPct: cloudflare.F(0.529241),
- Watermark: cloudflare.F(cloudflare.StreamDirectUploadNewParamsWatermark{
- Uid: cloudflare.F("ea95132c15732412d22c1476fa83f27a"),
- }),
- UploadCreator: cloudflare.F("creator-id_abcde12345"),
- })
- 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/streamdownload.go b/streamdownload.go
deleted file mode 100644
index 0494ce232c0..00000000000
--- a/streamdownload.go
+++ /dev/null
@@ -1,381 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "reflect"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/option"
- "github.com/tidwall/gjson"
-)
-
-// StreamDownloadService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewStreamDownloadService] method
-// instead.
-type StreamDownloadService struct {
- Options []option.RequestOption
-}
-
-// NewStreamDownloadService generates a new service that applies the given options
-// to each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewStreamDownloadService(opts ...option.RequestOption) (r *StreamDownloadService) {
- r = &StreamDownloadService{}
- r.Options = opts
- return
-}
-
-// Creates a download for a video when a video is ready to view.
-func (r *StreamDownloadService) New(ctx context.Context, identifier string, body StreamDownloadNewParams, opts ...option.RequestOption) (res *StreamDownloadNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env StreamDownloadNewResponseEnvelope
- path := fmt.Sprintf("accounts/%s/stream/%s/downloads", body.AccountID, identifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Delete the downloads for a video.
-func (r *StreamDownloadService) Delete(ctx context.Context, identifier string, body StreamDownloadDeleteParams, opts ...option.RequestOption) (res *StreamDownloadDeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env StreamDownloadDeleteResponseEnvelope
- path := fmt.Sprintf("accounts/%s/stream/%s/downloads", body.AccountID, identifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Lists the downloads created for a video.
-func (r *StreamDownloadService) Get(ctx context.Context, identifier string, query StreamDownloadGetParams, opts ...option.RequestOption) (res *StreamDownloadGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env StreamDownloadGetResponseEnvelope
- path := fmt.Sprintf("accounts/%s/stream/%s/downloads", query.AccountID, identifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Union satisfied by [StreamDownloadNewResponseUnknown] or [shared.UnionString].
-type StreamDownloadNewResponse interface {
- ImplementsStreamDownloadNewResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*StreamDownloadNewResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-// Union satisfied by [StreamDownloadDeleteResponseUnknown] or
-// [shared.UnionString].
-type StreamDownloadDeleteResponse interface {
- ImplementsStreamDownloadDeleteResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*StreamDownloadDeleteResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-// Union satisfied by [StreamDownloadGetResponseUnknown] or [shared.UnionString].
-type StreamDownloadGetResponse interface {
- ImplementsStreamDownloadGetResponse()
-}
-
-func init() {
- apijson.RegisterUnion(
- reflect.TypeOf((*StreamDownloadGetResponse)(nil)).Elem(),
- "",
- apijson.UnionVariant{
- TypeFilter: gjson.String,
- Type: reflect.TypeOf(shared.UnionString("")),
- },
- )
-}
-
-type StreamDownloadNewParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type StreamDownloadNewResponseEnvelope struct {
- Errors []StreamDownloadNewResponseEnvelopeErrors `json:"errors,required"`
- Messages []StreamDownloadNewResponseEnvelopeMessages `json:"messages,required"`
- Result StreamDownloadNewResponse `json:"result,required"`
- // Whether the API call was successful
- Success StreamDownloadNewResponseEnvelopeSuccess `json:"success,required"`
- JSON streamDownloadNewResponseEnvelopeJSON `json:"-"`
-}
-
-// streamDownloadNewResponseEnvelopeJSON contains the JSON metadata for the struct
-// [StreamDownloadNewResponseEnvelope]
-type streamDownloadNewResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StreamDownloadNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r streamDownloadNewResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type StreamDownloadNewResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON streamDownloadNewResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// streamDownloadNewResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [StreamDownloadNewResponseEnvelopeErrors]
-type streamDownloadNewResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StreamDownloadNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r streamDownloadNewResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type StreamDownloadNewResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON streamDownloadNewResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// streamDownloadNewResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [StreamDownloadNewResponseEnvelopeMessages]
-type streamDownloadNewResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StreamDownloadNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r streamDownloadNewResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type StreamDownloadNewResponseEnvelopeSuccess bool
-
-const (
- StreamDownloadNewResponseEnvelopeSuccessTrue StreamDownloadNewResponseEnvelopeSuccess = true
-)
-
-type StreamDownloadDeleteParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type StreamDownloadDeleteResponseEnvelope struct {
- Errors []StreamDownloadDeleteResponseEnvelopeErrors `json:"errors,required"`
- Messages []StreamDownloadDeleteResponseEnvelopeMessages `json:"messages,required"`
- Result StreamDownloadDeleteResponse `json:"result,required"`
- // Whether the API call was successful
- Success StreamDownloadDeleteResponseEnvelopeSuccess `json:"success,required"`
- JSON streamDownloadDeleteResponseEnvelopeJSON `json:"-"`
-}
-
-// streamDownloadDeleteResponseEnvelopeJSON contains the JSON metadata for the
-// struct [StreamDownloadDeleteResponseEnvelope]
-type streamDownloadDeleteResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StreamDownloadDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r streamDownloadDeleteResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type StreamDownloadDeleteResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON streamDownloadDeleteResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// streamDownloadDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for
-// the struct [StreamDownloadDeleteResponseEnvelopeErrors]
-type streamDownloadDeleteResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StreamDownloadDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r streamDownloadDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type StreamDownloadDeleteResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON streamDownloadDeleteResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// streamDownloadDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for
-// the struct [StreamDownloadDeleteResponseEnvelopeMessages]
-type streamDownloadDeleteResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StreamDownloadDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r streamDownloadDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type StreamDownloadDeleteResponseEnvelopeSuccess bool
-
-const (
- StreamDownloadDeleteResponseEnvelopeSuccessTrue StreamDownloadDeleteResponseEnvelopeSuccess = true
-)
-
-type StreamDownloadGetParams struct {
- // Identifier
- AccountID param.Field[string] `path:"account_id,required"`
-}
-
-type StreamDownloadGetResponseEnvelope struct {
- Errors []StreamDownloadGetResponseEnvelopeErrors `json:"errors,required"`
- Messages []StreamDownloadGetResponseEnvelopeMessages `json:"messages,required"`
- Result StreamDownloadGetResponse `json:"result,required"`
- // Whether the API call was successful
- Success StreamDownloadGetResponseEnvelopeSuccess `json:"success,required"`
- JSON streamDownloadGetResponseEnvelopeJSON `json:"-"`
-}
-
-// streamDownloadGetResponseEnvelopeJSON contains the JSON metadata for the struct
-// [StreamDownloadGetResponseEnvelope]
-type streamDownloadGetResponseEnvelopeJSON struct {
- Errors apijson.Field
- Messages apijson.Field
- Result apijson.Field
- Success apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StreamDownloadGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r streamDownloadGetResponseEnvelopeJSON) RawJSON() string {
- return r.raw
-}
-
-type StreamDownloadGetResponseEnvelopeErrors struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON streamDownloadGetResponseEnvelopeErrorsJSON `json:"-"`
-}
-
-// streamDownloadGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
-// struct [StreamDownloadGetResponseEnvelopeErrors]
-type streamDownloadGetResponseEnvelopeErrorsJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StreamDownloadGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r streamDownloadGetResponseEnvelopeErrorsJSON) RawJSON() string {
- return r.raw
-}
-
-type StreamDownloadGetResponseEnvelopeMessages struct {
- Code int64 `json:"code,required"`
- Message string `json:"message,required"`
- JSON streamDownloadGetResponseEnvelopeMessagesJSON `json:"-"`
-}
-
-// streamDownloadGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
-// struct [StreamDownloadGetResponseEnvelopeMessages]
-type streamDownloadGetResponseEnvelopeMessagesJSON struct {
- Code apijson.Field
- Message apijson.Field
- raw string
- ExtraFields map[string]apijson.Field
-}
-
-func (r *StreamDownloadGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
- return apijson.UnmarshalRoot(data, r)
-}
-
-func (r streamDownloadGetResponseEnvelopeMessagesJSON) RawJSON() string {
- return r.raw
-}
-
-// Whether the API call was successful
-type StreamDownloadGetResponseEnvelopeSuccess bool
-
-const (
- StreamDownloadGetResponseEnvelopeSuccessTrue StreamDownloadGetResponseEnvelopeSuccess = true
-)
diff --git a/streamdownload_test.go b/streamdownload_test.go
deleted file mode 100644
index 66ea07e3b49..00000000000
--- a/streamdownload_test.go
+++ /dev/null
@@ -1,104 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestStreamDownloadNew(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"),
- )
- _, err := client.Stream.Downloads.New(
- context.TODO(),
- "ea95132c15732412d22c1476fa83f27a",
- cloudflare.StreamDownloadNewParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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())
- }
-}
-
-func TestStreamDownloadDelete(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"),
- )
- _, err := client.Stream.Downloads.Delete(
- context.TODO(),
- "ea95132c15732412d22c1476fa83f27a",
- cloudflare.StreamDownloadDeleteParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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())
- }
-}
-
-func TestStreamDownloadGet(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"),
- )
- _, err := client.Stream.Downloads.Get(
- context.TODO(),
- "ea95132c15732412d22c1476fa83f27a",
- cloudflare.StreamDownloadGetParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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/streamembed.go b/streamembed.go
deleted file mode 100644
index f1a5a95d2ed..00000000000
--- a/streamembed.go
+++ /dev/null
@@ -1,48 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
-
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-// StreamEmbedService contains methods and other services that help with
-// interacting with the cloudflare API. Note, unlike clients, this service does not
-// read variables from the environment automatically. You should not instantiate
-// this service directly, and instead use the [NewStreamEmbedService] method
-// instead.
-type StreamEmbedService struct {
- Options []option.RequestOption
-}
-
-// NewStreamEmbedService generates a new service that applies the given options to
-// each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewStreamEmbedService(opts ...option.RequestOption) (r *StreamEmbedService) {
- r = &StreamEmbedService{}
- r.Options = opts
- return
-}
-
-// Fetches an HTML code snippet to embed a video in a web page delivered through
-// Cloudflare. On success, returns an HTML fragment for use on web pages to display
-// a video. On failure, returns a JSON response body.
-func (r *StreamEmbedService) Get(ctx context.Context, identifier string, query StreamEmbedGetParams, opts ...option.RequestOption) (res *StreamEmbedGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- path := fmt.Sprintf("accounts/%s/stream/%s/embed", query.AccountID, identifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &res, opts...)
- return
-}
-
-type StreamEmbedGetResponse = interface{}
-
-type StreamEmbedGetParams struct {
- // The account identifier tag.
- AccountID param.Field[string] `path:"account_id,required"`
-}
diff --git a/streamembed_test.go b/streamembed_test.go
deleted file mode 100644
index ad26a50ec63..00000000000
--- a/streamembed_test.go
+++ /dev/null
@@ -1,44 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare_test
-
-import (
- "context"
- "errors"
- "os"
- "testing"
-
- "github.com/cloudflare/cloudflare-go"
- "github.com/cloudflare/cloudflare-go/internal/testutil"
- "github.com/cloudflare/cloudflare-go/option"
-)
-
-func TestStreamEmbedGet(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"),
- )
- _, err := client.Stream.Embeds.Get(
- context.TODO(),
- "ea95132c15732412d22c1476fa83f27a",
- cloudflare.StreamEmbedGetParams{
- AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
- },
- )
- 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/streamkey.go b/streamkey.go
deleted file mode 100644
index 34cda238242..00000000000
--- a/streamkey.go
+++ /dev/null
@@ -1,406 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package cloudflare
-
-import (
- "context"
- "fmt"
- "net/http"
- "reflect"
- "time"
-
- "github.com/cloudflare/cloudflare-go/internal/apijson"
- "github.com/cloudflare/cloudflare-go/internal/param"
- "github.com/cloudflare/cloudflare-go/internal/requestconfig"
- "github.com/cloudflare/cloudflare-go/internal/shared"
- "github.com/cloudflare/cloudflare-go/option"
- "github.com/tidwall/gjson"
-)
-
-// StreamKeyService contains methods and other services that help with interacting
-// with the cloudflare API. Note, unlike clients, this service does not read
-// variables from the environment automatically. You should not instantiate this
-// service directly, and instead use the [NewStreamKeyService] method instead.
-type StreamKeyService struct {
- Options []option.RequestOption
-}
-
-// NewStreamKeyService generates a new service that applies the given options to
-// each request. These options are applied after the parent client's options (if
-// there is one), and before any request-specific options.
-func NewStreamKeyService(opts ...option.RequestOption) (r *StreamKeyService) {
- r = &StreamKeyService{}
- r.Options = opts
- return
-}
-
-// Creates an RSA private key in PEM and JWK formats. Key files are only displayed
-// once after creation. Keys are created, used, and deleted independently of
-// videos, and every key can sign any video.
-func (r *StreamKeyService) New(ctx context.Context, body StreamKeyNewParams, opts ...option.RequestOption) (res *StreamKeyNewResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env StreamKeyNewResponseEnvelope
- path := fmt.Sprintf("accounts/%s/stream/keys", body.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Deletes signing keys and revokes all signed URLs generated with the key.
-func (r *StreamKeyService) Delete(ctx context.Context, identifier string, body StreamKeyDeleteParams, opts ...option.RequestOption) (res *StreamKeyDeleteResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env StreamKeyDeleteResponseEnvelope
- path := fmt.Sprintf("accounts/%s/stream/keys/%s", body.AccountID, identifier)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, body, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result
- return
-}
-
-// Lists the video ID and creation date and time when a signing key was created.
-func (r *StreamKeyService) Get(ctx context.Context, query StreamKeyGetParams, opts ...option.RequestOption) (res *[]StreamKeyGetResponse, err error) {
- opts = append(r.Options[:], opts...)
- var env StreamKeyGetResponseEnvelope
- path := fmt.Sprintf("accounts/%s/stream/keys", query.AccountID)
- err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
- if err != nil {
- return
- }
- res = &env.Result